From f618ca8e69d566ae8b98012b1dec8039ada5f5bb Mon Sep 17 00:00:00 2001 From: Youssef-Harby Date: Thu, 11 Apr 2024 18:01:47 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20Youssef-?= =?UTF-8?q?Harby/esri-style-ft-mapbox-style@f38e6459161274e42260c46437833c?= =?UTF-8?q?e624b32846=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...r-Dby-baET.js => AGraphicContainer-BXk7Eu6w.js} | 2 +- .../{Analysis-DeH3QoWt.js => Analysis-yEzECn2p.js} | 2 +- ...Info-DEdzaB9S.js => AttachmentInfo-Cm6dhnUr.js} | 2 +- ...ery-D61mmWw4.js => AttachmentQuery-DmEAIZff.js} | 2 +- ...tore-Ck-75lnq.js => AttributeStore-Bm6hLtR1.js} | 2 +- ...sTH6m.js => BaseDynamicLayerView2D-DSmk7XW5.js} | 2 +- ...Layer-CvxOjLC9.js => BingMapsLayer-CPBW-ptl.js} | 2 +- assets/{Bitmap--gOrgR8J.js => Bitmap-DpyomsG7.js} | 2 +- ...ner-Bq0Mk6_k.js => BitmapContainer-DD7rxH0u.js} | 2 +- ...dsStore-DMoG4U0L.js => BoundsStore-DRDtG3Mk.js} | 2 +- ...fferView-Ao_K-5Vg.js => BufferView-3om6S_aJ.js} | 2 +- ...-Bhih74F5.js => BuildingSceneLayer-DAfQRDdR.js} | 2 +- assets/{Button-BD3vvwHs.js => Button-D2RihRUZ.js} | 2 +- .../{CSVLayer-BGm6RUOY.js => CSVLayer-DfX_NRk3.js} | 2 +- ...ker-CrU3052N.js => CSVSourceWorker-DNn0ZitV.js} | 2 +- ... => CatalogDynamicGroupLayerView2D-CyoAbf0b.js} | 2 +- assets/CatalogFootprintLayerView2D-4V3pvH_N.js | 1 - assets/CatalogFootprintLayerView2D-KePfoiS2.js | 1 + ...gLayer-BLgHCc1c.js => CatalogLayer-4790y54a.js} | 2 +- ...-BuGdqUm1.js => CatalogLayerView2D-d-xBXyF9.js} | 2 +- ...81x8Sj.js => ClassBreaksDefinition-Djcxa8Lp.js} | 2 +- .../{ColorSet-DDQ4d9ui.js => ColorSet-wEWjQ87p.js} | 2 +- ...ColorStop-44hBlQ14.js => ColorStop-DCGjAKLC.js} | 2 +- ...Container-CB7SlLB9.js => Container-_n5wCgez.js} | 2 +- ....js => DefaultMaterial_COLOR_GAMMA-BQtlD4-o.js} | 2 +- ...tTheme-QXTOOsyZ.js => DefaultTheme-Ze4cVXuP.js} | 2 +- ...js => DeleteForwardEditsParameters-dCKYoO-P.js} | 2 +- ...ayer-CS8-5O4l.js => DimensionLayer-CKhQnsO-.js} | 2 +- ...leArray-DxyNBrRi.js => DoubleArray--0pYeNcV.js} | 2 +- ...-Yxye3Z.js => EdgeProcessingWorker-DXabLlxw.js} | 2 +- ...sLayer-SG7oYwiY.js => EditBusLayer-OslMX9fF.js} | 4 ++-- ...ayer-D3CeIkQP.js => ElevationLayer-QYZSSLWB.js} | 4 ++-- ...uery-BFZ9QB_a.js => ElevationQuery-DphYPRnK.js} | 2 +- ...Nk0sW.js => ElevationSamplerWorker-DR7iKj10.js} | 2 +- ...sh-7G1.js => ExportImageParameters-CXqmEVur.js} | 2 +- ...tegy-fFnMYcIc.js => ExportStrategy-SzILz8ne.js} | 2 +- ...oIo.js => ExportWMSImageParameters-Bl6JFYua.js} | 2 +- .../{External-DC51KyR4.js => External-DIoD7Bb4.js} | 2 +- ...Btq_FXyi.js => FeatureCommandQueue-DI81F3gA.js} | 2 +- ...ffect-ByrbZlne.js => FeatureEffect-DBbkrS6j.js} | 2 +- ...-CLTrRFqx.js => FeatureEffectLayer-DarO4Ctx.js} | 2 +- ...eLayer-D0kMrROG.js => FeatureLayer-BHxNIHhy.js} | 4 ++-- ...se-DPJuwFpX.js => FeatureLayerBase-D0I-Escx.js} | 2 +- ...-BeuGtrZI.js => FeatureLayerSource-3cjHhwgM.js} | 4 ++-- ...-Dw_5zj3d.js => FeatureLayerView2D-B6lIa9Lt.js} | 2 +- ...TTsaNH.js => FeaturePipelineWorker--iWINXTy.js} | 2 +- ...cGsNIN.js => FeatureReductionLayer-CK-tyM-9.js} | 2 +- ...ac.js => FeatureReductionSelection-t3T7oa8H.js} | 2 +- ...FeatureServiceSnappingSourceWorker-CRj73rBJ.js} | 2 +- ...atureSet-CYJUZgOk.js => FeatureSet-opEn8ou8.js} | 2 +- ...eStore-CqSz6SOQ.js => FeatureStore-CRMzrhIt.js} | 2 +- ...ate-DcprAdTM.js => FeatureTemplate-FZNGA_Ik.js} | 2 +- ...ureType-By3BEr9z.js => FeatureType-CwUl8Nf5.js} | 2 +- ...dsIndex-CLgRNeJ_.js => FieldsIndex-CK-0B5n9.js} | 2 +- ...mplate-eV18QveB.js => FormTemplate-BGxtsGX6.js} | 2 +- ...NLayer-BEhPE7YN.js => GeoJSONLayer-ibYVKi1c.js} | 4 ++-- ...CUwhItjB.js => GeoJSONSourceWorker-CJxkfTXL.js} | 2 +- ...SSLayer-8bgy1uXP.js => GeoRSSLayer-DBDQfWhL.js} | 2 +- ...D-DGBAg8jk.js => GeoRSSLayerView2D-DvkynA-l.js} | 2 +- ...ofadKoJ9.js => GraphQueryStreaming-BDRIPeal.js} | 2 +- ...er-CbvswCG0.js => GraphicContainer-Bue3JF2r.js} | 2 +- ...Layer-CexPXXFK.js => GraphicsLayer-g4hVfoZU.js} | 2 +- ...D7NawYZd.js => GraphicsLayerView2D-CtKxPbzt.js} | 2 +- ...ew2D-DbbthiwV.js => GraphicsView2D-B7H8XAnI.js} | 2 +- ...oupLayer-BGdGYmtj.js => GroupLayer-6WnGm0lP.js} | 4 ++-- ...2D-ayVE8wm-.js => GroupLayerView2D-BVygDtT5.js} | 2 +- ...er-abgLEfgq.js => HighlightCounter-qEuAaY1V.js} | 2 +- ...Cq.js => HighlightGraphicContainer-B5WIObEd.js} | 2 +- ...der-N_Is4gxa.js => I3SBinaryReader-Bg6QQKyW.js} | 2 +- ...B6gGfNoh.js => I3SLayerDefinitions-Bc0e5Sgz.js} | 2 +- .../{I3SUtil-DxFIPSkh.js => I3SUtil-Bs1mZiKI.js} | 2 +- ...ger-CHp4-snh.js => IdentityManager-DBFJchIs.js} | 4 ++-- ...Yhj.js => ImageHistogramParameters-DYfx5K-s.js} | 2 +- ...yLayer-Dz6vNBYB.js => ImageryLayer-BuJz_D0q.js} | 4 ++-- ...-D5_CduBq.js => ImageryLayerView2D-Cd1bppq2.js} | 2 +- ...er-B8fBMD3Z.js => ImageryTileLayer-BEBkov6O.js} | 6 +++--- ...rn228.js => ImageryTileLayerView2D-DAJXGdeV.js} | 2 +- .../{Indices-Dv-cCjFT.js => Indices-BRm9v2lM.js} | 2 +- ...E.js => IntegratedMesh3DTilesLayer-BxjpzO7W.js} | 2 +- ...DkCYLSWg.js => IntegratedMeshLayer-D8IB-5_i.js} | 2 +- ...t-Dd1W8HCo.js => InterleavedLayout-Cinhb-cY.js} | 2 +- .../{KMLLayer-D6CvdHt0.js => KMLLayer-dXg6eYPC.js} | 2 +- ...ew2D-B307IWZ8.js => KMLLayerView2D-BTxXwgAN.js} | 2 +- ...Pc.js => KnowledgeGraphLayerView2D-DZm8ubx6.js} | 2 +- ...belClass-6cZokw8y.js => LabelClass-CeatfK8u.js} | 2 +- ...lMetric-D2hbzzy_.js => LabelMetric-BcUxDImF.js} | 2 +- ...Info-Cdq3ulNh.js => LayerFloorInfo-DlYNbO-A.js} | 2 +- ...LayerView-BEFTHNYv.js => LayerView-Bux7vAEn.js} | 2 +- ...rcWorker-BiydENSI.js => LercWorker-BTGjGtNo.js} | 2 +- ...er-CjQ9MBRQ.js => LineOfSightLayer-fNRdYlBe.js} | 2 +- ...ayer-BS3nw-u_.js => LinkChartLayer-B9wu3mvA.js} | 4 ++-- ...DWorker-pyatxP09.js => Lyr3DWorker-DhzMvWrO.js} | 4 ++-- ...s-B5-grLP-.js => MagnifierPrograms-Dy7jbVaV.js} | 2 +- ...Layer-DqX26yH_.js => MapImageLayer-l41pl51g.js} | 2 +- ...iNdXAMVi.js => MapImageLayerView2D-Cq7vZ1xD.js} | 2 +- ...Layer-BXf_uYaT.js => MapNotesLayer-CPjCDXnt.js} | 2 +- ...DxdmUoTh.js => MapNotesLayerView2D-DgCKO3Zc.js} | 2 +- ...diaLayer-DrFcRt_9.js => MediaLayer-CdtBPk34.js} | 4 ++-- ...2D-vpnVWbi-.js => MediaLayerView2D-CfaV01hI.js} | 2 +- ...-CaK7s0IK.js => MemorySourceWorker-DFsRya29.js} | 2 +- assets/{Mesh-9oOqPmbT.js => Mesh--rTzs1p1.js} | 4 ++-- ...ltwu1Kq.js => MeshLocalVertexSpace-DRvwbFTJ.js} | 2 +- ...yer-BfwwYuSp.js => OGCFeatureLayer-_EJqre42.js} | 2 +- assets/OGCFeatureLayerView2D-BT1AiNl1.js | 1 + assets/OGCFeatureLayerView2D-DBRY7Ix7.js | 1 - ...ctStack-CF0cQvd2.js => ObjectStack-BAIuPeIh.js} | 2 +- ...-BmVWZwKB.js => OpenStreetMapLayer-BXLAjAfp.js} | 2 +- ...rByInfo-DKzv2-WS.js => OrderByInfo-DKyk5GLW.js} | 2 +- ...js => OrderIndependentTransparency-Btph8gYx.js} | 2 +- ...dLayer-Do089KpQ.js => OrderedLayer-dLoPhxcx.js} | 2 +- ...b-G1CjI.js => OrientedImageryLayer-DxeUAz8W.js} | 2 +- ...lper-B4ryGWZb.js => OverrideHelper-DxFZBnGL.js} | 2 +- ...er-C5tQTeCI.js => PBFDecoderWorker-DLXRZcsS.js} | 2 +- ...yer-ClQsf0Mo.js => PointCloudLayer-CsBDV7DT.js} | 2 +- ...s => PointCloudUniqueValueRenderer-DGqW3DIg.js} | 2 +- ...er-BVcb1Zzd.js => PointCloudWorker-RLZ1Rh8W.js} | 2 +- ...edRBush-BsFBmw1o.js => PooledRBush-BlFOlUgK.js} | 2 +- assets/{Popup-CMTUSIYl.js => Popup-DSVql8fN.js} | 6 +++--- .../{Program-DLRmaKpw.js => Program-DBsYtQ00.js} | 2 +- ...ate-BICQrNzS.js => ProgramTemplate-Ck2I0bIi.js} | 2 +- ...yEngine-RpcY23Sv.js => QueryEngine-loUu1VUW.js} | 4 ++-- ...QueryTask-CjHwD7wL.js => QueryTask-Cl66pG_V.js} | 4 ++-- ...er-D7OwkKeP.js => RasterSymbolizer-BN7ge8gb.js} | 4 ++-- ...i924Q6.js => RasterVFDisplayObject-DLrowEg_.js} | 2 +- ...Worker-DIZgcx97.js => RasterWorker-CzY22QDJ.js} | 2 +- ...Cache-D9cjIDVu.js => RawBlockCache-DNGqU_D7.js} | 2 +- ...er-1EkEhJeI.js => RefreshableLayer-_r2TPtol.js} | 2 +- ...1-PEoNB.js => RefreshableLayerView-L9NGpXXI.js} | 2 +- ...y-DDK72Kwc.js => RelationshipQuery-BDJrOxaX.js} | 2 +- ...xt-2weDpoeh.js => RenderingContext-vSxDymNY.js} | 2 +- ...uteLayer-Ba4tA3kd.js => RouteLayer-DIjUW0_h.js} | 2 +- ...2D-CcISu94y.js => RouteLayerView2D-CjJummeL.js} | 2 +- ...SDFHelper-CSK796Wb.js => SDFHelper-kKuXhauo.js} | 2 +- ...eneLayer-DiSvX6ty.js => SceneLayer-DVZLLmFB.js} | 4 ++-- ... => SceneLayerSnappingSourceWorker-HITRlJJU.js} | 2 +- ...er-fYw2Py8t.js => SceneLayerWorker-C6NfAzt5.js} | 4 ++-- ...ervice-l5OfqT0E.js => SceneService-DbS150xR.js} | 2 +- ...ata-2rdvzlLE.js => SourceLayerData-CTiUdlGY.js} | 2 +- ...ilter-C4Il3spK.js => SpatialFilter-D9TNROUn.js} | 2 +- assets/{Stop-VHT4QwcG.js => Stop-D_lBQff2.js} | 2 +- ...amLayer-BoGXecN6.js => StreamLayer-CxayZLf7.js} | 4 ++-- ...D-Be7jZFcL.js => StreamLayerView2D-DqZHXc4V.js} | 2 +- ...wner-CJjJUh6G.js => SublayersOwner-CywL6RlY.js} | 4 ++-- ...r-DOR5l1_M.js => SubtypeGroupLayer-DoVLJ5RR.js} | 4 ++-- assets/SubtypeGroupLayerView2D-BzijIwec.js | 7 ------- assets/SubtypeGroupLayerView2D-DykSTPs3.js | 7 +++++++ ...e-CSsTmbek.js => TechniqueInstance-XtnK2qy2.js} | 2 +- ...Layer-qq3v_i3q.js => TemporalLayer-CKICYnEl.js} | 2 +- .../{Texture-DJgkMrSB.js => Texture-S4dD-WHn.js} | 2 +- assets/{Theme-Bdh3gaKt.js => Theme-6HY29PEY.js} | 2 +- assets/{Tick-B3uT4_8g.js => Tick-DedlQq8S.js} | 2 +- ...ainer-Ci6dOowA.js => TileContainer-Bs-vXdD_.js} | 2 +- ...TileLayer-CULgL3B_.js => TileLayer-MOTdXvSA.js} | 2 +- ...w2D-BnlmUfzg.js => TileLayerView2D-CoWYvoLX.js} | 2 +- .../{TimeInfo-3TVmpFSA.js => TimeInfo-DooETFWC.js} | 2 +- .../{TimeOnly-Cm47ew5I.js => TimeOnly-BXSODLxA.js} | 2 +- .../{Tooltip-CVjHQVY5.js => Tooltip-C7eoaNP4.js} | 2 +- ...ry-B8kC7n5h.js => TopFeaturesQuery-CVQjqlfM.js} | 2 +- ...TurboLine-CkxIB4ZX.js => TurboLine-DNQdPIXo.js} | 4 ++-- ...BlkUix3g.js => UniqueValueRenderer-7V9Bhr-D.js} | 2 +- ...nLayer-BeNlyNrR.js => UnknownLayer-BSjgqi4d.js} | 2 +- ...one-DF0BqWCR.js => UnknownTimeZone-CK7VjgF3.js} | 2 +- ...er-bFwEkP2I.js => UnsupportedLayer-CYwmIZG0.js} | 2 +- ...2D-nj9Q-3df.js => UpdateTracking2D-Ds_Gdrxd.js} | 4 ++-- assets/{Util-BS8sJGjF.js => Util-CS5u4Lec.js} | 2 +- ...846VB2.js => VectorTileLayerView2D-BLrO1BgS.js} | 2 +- .../{Version-Bd0QsIQ5.js => Version-Dqq_CHBG.js} | 2 +- ...2D-CtjQ6rEp.js => VideoLayerView2D-Vkk8l0f8.js} | 2 +- ...xelLayer-C6oRPxv0.js => VoxelLayer-pjuHsY2A.js} | 2 +- .../{WFSLayer-B8MZMVqa.js => WFSLayer-DypvB2tP.js} | 2 +- ...ker-BX8deXfR.js => WFSSourceWorker-DM2J6sPN.js} | 2 +- ...tainer-B_Pv-8Yi.js => WGLContainer-DgZNq7b0.js} | 2 +- .../{WMSLayer-CBKAceAl.js => WMSLayer-5SlLwEaR.js} | 2 +- ...ew2D-D80tHNhN.js => WMSLayerView2D-BHemqaDF.js} | 2 +- ...WMTSLayer-B_E4A-J6.js => WMTSLayer-DfNOT9ZM.js} | 2 +- ...w2D-CZBGPwsV.js => WMTSLayerView2D-D7P1L341.js} | 2 +- ...eLayer-D3HPOkPd.js => WebTileLayer-IRzcPxtS.js} | 2 +- ...eClause-Dzgyc0wk.js => WhereClause-Ctld7DSu.js} | 2 +- ...r-DlTCcd69.js => WorkerTileHandler-B1--DifF.js} | 2 +- assets/{action-Ccs4b7Ti.js => action-DE-UH85X.js} | 2 +- ...-group-CACOwGqI.js => action-group-Cz5uoTMD.js} | 2 +- ...on-menu-CYcibT5U.js => action-menu-B2VkSdfS.js} | 2 +- assets/{apng-D2pTRXhQ.js => apng-DNWE4pJX.js} | 2 +- assets/{arcade-DTRx7SKL.js => arcade-D78QfcWG.js} | 2 +- ...-CNNOWwv8.js => arcadeAsyncRuntime-B50Rzrzf.js} | 2 +- ...deUtils-BoaybaAR.js => arcadeUtils-BxUF81hz.js} | 8 ++++---- ...js => arcgis-knowledge-client-core-B0fFx-E4.js} | 2 +- ... arcgis-knowledge-client-core-simd-IaMmXPr_.js} | 2 +- ...Layers-DI7gu0Vy.js => arcgisLayers-fiEUw9dp.js} | 4 ++-- ...s => associatedFeatureServiceUtils-nLeTqfYC.js} | 2 +- ...er-CY0Zu9W4.js => basis_transcoder-gYrXvU8A.js} | 2 +- assets/calcite-action-CEYA6ZsJ.js | 5 ----- ...-C5PvC65D.js => calcite-action-bar-glrD7fhe.js} | 2 +- assets/calcite-action-group-DMHrkhqu.js | 5 +++++ assets/calcite-action-group-oGHjFsjn.js | 5 ----- assets/calcite-action-xwwomTuE.js | 5 +++++ ...tton-CMjDkjDb.js => calcite-button-CWS09kHr.js} | 2 +- ...e-flow-AUD7SkeM.js => calcite-flow-cUQQQwo9.js} | 2 +- ...m-B7iK8dgk.js => calcite-flow-item-aWVm4yY6.js} | 2 +- ...e-icon-CHcIXU52.js => calcite-icon-BCYnyK8T.js} | 2 +- ...input-fjO1QChb.js => calcite-input-BwO9LTJJ.js} | 2 +- ...label-DonsloAk.js => calcite-label-DlQTm19c.js} | 2 +- ...e-list-D9nZpOdw.js => calcite-list-CAcrc3c7.js} | 2 +- ...m-BBiyp6uG.js => calcite-list-item-JeWmt-sE.js} | 2 +- ...mmtA.js => calcite-list-item-group-tUNZxrA0.js} | 2 +- ...ader-CzxKWzLl.js => calcite-loader-ijl1xz1O.js} | 2 +- ...modal-Dti-ITgz.js => calcite-modal-DgU9l6Wa.js} | 2 +- ...tice-CHsdelpI.js => calcite-notice-Bu--C1Vt.js} | 2 +- ...lities-BQHqqlJu.js => capabilities-DXGHT-QH.js} | 2 +- ...tCommon-DeDLy4W7.js => chartCommon-HGSAjsjY.js} | 2 +- ...lsAm5-DYfwNDSz.js => chartUtilsAm5-D5owA826.js} | 2 +- ...-CgRgH99f.js => clientSideDefaults-BQP5n3lX.js} | 2 +- ...lorRamps-BJydlf0f.js => colorRamps-CcakIWlU.js} | 2 +- ...puteTranslationToOriginAndRotation-BeE3rOSz.js} | 2 +- ...lot-D3Ya1Vfj.js => conditionalSlot-DMpb3OPD.js} | 2 +- ...on-BxU4QDA7.js => createConnection-BvioR9C8.js} | 4 ++-- ...dataUtils-BFJflGP5.js => dataUtils-DzOfgSpi.js} | 2 +- ...plicate-Bk22TunD.js => deduplicate-BR6i8Xk0.js} | 2 +- ...-CDZbz35M.js => deleteForwardEdits-DOePzMev.js} | 2 +- ...diffUtils-B4YFa5Ju.js => diffUtils-uUoMDFQS.js} | 2 +- ...edUtils-CGrSPor9.js => drapedUtils-DDBQ6RK5.js} | 4 ++-- assets/{earcut-hRlx3adE.js => earcut-CWKXDqDj.js} | 2 +- ...sing-Cvxjjjkp.js => edgeProcessing-Dg7MHcWM.js} | 2 +- ...port-DWTRjmy9.js => editingSupport-4MwIplWk.js} | 2 +- ...sZScale-CQCGPEjO.js => editsZScale-Bfe6gH1b.js} | 2 +- ...-Dag_mzct.js => elevationInfoUtils-DIYaTlLQ.js} | 2 +- ...orIds-BjeEaIen.js => executeForIds-CZ3M8IZd.js} | 2 +- assets/executeForTopCount-DDGFKOhN.js | 1 + assets/executeForTopCount-P_PtmMoE.js | 1 - assets/executeForTopExtents-BWFPmLVe.js | 1 - assets/executeForTopExtents-C_oYktcC.js | 1 + assets/executeForTopIds-B6SIZ04E.js | 1 + assets/executeForTopIds-CLsxKpmx.js | 1 - assets/executeQueryJSON-COxi_Fac.js | 1 + assets/executeQueryJSON-DngjHRnE.js | 1 - ...PBF-BYY2Ipuh.js => executeQueryPBF-DROgTCuZ.js} | 2 +- ...mN8.js => executeRelationshipQuery-BRG4cb0K.js} | 2 +- assets/executeTopFeaturesQuery-9oGsFDn1.js | 1 - assets/executeTopFeaturesQuery-DpUwEjEz.js | 1 + ...9mw0r.js => featureConversionUtils-BHhm7bvm.js} | 2 +- ...s-SShyxaG9.js => featureLayerUtils-D4E7zCBj.js} | 2 +- ...s-BhDaw8pS.js => featureLayerUtils-lwqyOSrl.js} | 4 ++-- ...ils-CGqLzAT0.js => featureSetUtils-BD9u_wDK.js} | 4 ++-- ...base-ahV3ZnCB.js => featuresetbase-WRrooxlm.js} | 2 +- ...geom-Cl8QdL8d.js => featuresetgeom-4-vjnWH-.js} | 2 +- ...ats-0jxQEihT.js => featuresetstats-442f9v7H.js} | 2 +- ...ng-DtQ-AsWo.js => featuresetstring-TQgTDW3a.js} | 2 +- ...ervice-C38RarY2.js => fetchService-Crgml5qT.js} | 2 +- ...ies-DMs4wT6-.js => fieldProperties-DnrQXLBM.js} | 2 +- ...floatRGBA-BLm-Rhaq.js => floatRGBA-Cs54GdjG.js} | 2 +- assets/{form-D5ySy5kP.js => form-BC9xTZIq.js} | 2 +- ...hUtils-CTQSvgbV.js => geohashUtils-DEscCvdk.js} | 2 +- .../{geojson-BLwRz6JF.js => geojson-AjfTISUf.js} | 2 +- ...geomasync-BBmYY70D.js => geomasync-B6doa0f9.js} | 2 +- ...gine-DD4bBRnV.js => geometryEngine-8LJe6rF3.js} | 2 +- ...B-ooCYDN.js => geometryEngineAsync-wvmuP1s9.js} | 2 +- ...-C5__2Su1.js => geometryEngineBase-CDbTTSsS.js} | 2 +- ...-D-7-cYHZ.js => geometryEngineJSON-BfS7Q-po.js} | 2 +- assets/geometryEngineWorker-C9d969a6.js | 1 + assets/geometryEngineWorker-iTtx-A2l.js | 1 - ...Z5hQKF0.js => geometryServiceUtils-CdocmtDi.js} | 2 +- ...erence-DtjTZVKi.js => georeference-DqFdARS7.js} | 2 +- assets/{gif-CppQXD_j.js => gif-DuihXOIa.js} | 2 +- ...tfexport-D_QduVJ6.js => gltfexport-BTAOUMHO.js} | 2 +- ...ils-BrcnmI65.js => groupLayerUtils-4dYtm0nq.js} | 2 +- ...pUtils-Clt5rJzr.js => heatmapUtils-BSteZBTj.js} | 2 +- ...ns-DbgbcWKM.js => highlightReasons-BOU4mnPE.js} | 2 +- .../{hydrated-CcIo9KoC.js => hydrated-D7zavlGk.js} | 2 +- assets/{i3s-DgwnR-Am.js => i3s-DvXaSYJ6.js} | 2 +- assets/{icon-BuW41TqN.js => icon-BXpWZdRl.js} | 2 +- ...ls-C0nKXf5P.js => imageBitmapUtils-BVxrhFkK.js} | 2 +- ...ageUtils-D_EPf7De.js => imageUtils-BNh57Y88.js} | 2 +- ...ageUtils-DNanu5Rn.js => imageUtils-ChIDAvDr.js} | 4 ++-- ...yUtils-Bct433Ji.js => imageryUtils-CP_eOmeO.js} | 2 +- assets/{index-CEWggaxV.js => index-BjUNJPVf.js} | 14 +++++++------- assets/{input2-BT_6gQkP.js => input2-D8djCUJ5.js} | 2 +- ...ractive-BR2V27xp.js => interactive-5-lo-GR7.js} | 2 +- ...jsonUtils-BseLl1fZ.js => jsonUtils-Dw332y6z.js} | 2 +- ...jsonUtils-qYmXvGJ1.js => jsonUtils-Ox5U0P0F.js} | 2 +- .../{kmlUtils-Dl7cXNEs.js => kmlUtils-C6tn6hG1.js} | 2 +- ...NmnapY.js => knowledgeGraphService-yi4prBvu.js} | 4 ++-- ...raph-x8GOX0-O.js => knowledgegraph-CifNQGEf.js} | 4 ++-- ...belUtils-Dnqx6jl5.js => labelUtils-3p0-m-Ee.js} | 2 +- ...ngInfo-CijajRsc.js => labelingInfo-DqAUis6e.js} | 2 +- ...eator-ByGguThJ.js => layersCreator-ua5OUPYt.js} | 2 +- ...Loader-NUfQIBq4.js => layersLoader-CBGHpR45.js} | 2 +- assets/lazyLayerLoader-Cu0XtDD2.js | 7 +++++++ assets/lazyLayerLoader-s-GqbiwM.js | 7 ------- .../{lclayout-BGy-0MYF.js => lclayout-QKV44p2z.js} | 2 +- ...lerc-wasm-IbDLBMkK.js => lerc-wasm-lV1hYBlU.js} | 2 +- .../{libtess-CR3C3MJB.js => libtess-B_UHPwdK.js} | 2 +- ...ess-asm-DL92duA_.js => libtess-asm-rVi5NxzN.js} | 2 +- ...Segment-B9UF3nEF.js => lineSegment-BYtydnRZ.js} | 2 +- ...TFMesh-CbP8-zjv.js => loadGLTFMesh-DdWfwp7n.js} | 2 +- .../{loadable-DylQ3Aza.js => loadable-CreDQ1Dd.js} | 2 +- assets/{loader-DQtzvvHl.js => loader-Bjz1lIB0.js} | 2 +- ...DWorker-BxsCtwuN.js => lyr3DWorker-CH63Ctm0.js} | 2 +- ...iewDeps-pgi5I2eW.js => mapViewDeps-B6Hg404o.js} | 2 +- ...ils-LvFj83T-.js => mediaLayerUtils-DFCF50LE.js} | 2 +- ...eSet-DmiifJYC.js => meshFeatureSet-BCixIf_6.js} | 2 +- ...FWpJFSd.js => meshVertexSpaceUtils-DwMoblqo.js} | 2 +- ...yVhR8j.js => multidimensionalUtils-u3oUX4w1.js} | 2 +- ...-B6VufdiX.js => normalizeUtilsSync-73yZ0QwV.js} | 2 +- assets/{number-Bu1a2qyF.js => number-CJqenc9O.js} | 2 +- ...BVnDNNos.js => objectResourceUtils-BlC7hkco.js} | 4 ++-- ...observers-MZ9Ss0UR.js => observers-B6R0JooC.js} | 2 +- ...ils-D4df60hh.js => ogcFeatureUtils-B_dc0icr.js} | 2 +- ...-CP78bYQO.js => openCloseComponent-7TDD8Qsp.js} | 2 +- ...BQdJNYvE.js => orientedBoundingBox-sJmHxD3E.js} | 2 +- assets/{pbf-D9QZb8S8.js => pbf-Du8sFEWo.js} | 2 +- ...Utils-CLRSFGBm.js => pbfQueryUtils-CSeFSIjv.js} | 2 +- .../{pe-wasm-CayGlshv.js => pe-wasm-Dbaxno0I.js} | 2 +- ...istable-uPSrwVmW.js => persistable-3OEDOKAC.js} | 2 +- ...ls-24oy2YlR.js => perspectiveUtils-DhC7L1B1.js} | 2 +- .../{pieChart-D4IZYqRN.js => pieChart-BW1iYy_W.js} | 2 +- assets/{plane-py4f_JCU.js => plane-DxOTtTwj.js} | 2 +- ...pupUtils-DAFYyAvw.js => popupUtils-DlZin22m.js} | 2 +- ...pupUtils-BovqErR_.js => popupUtils-Do2GfZME.js} | 2 +- ...Layers-B6YNSnGP.js => portalLayers-DU48R6fl.js} | 2 +- assets/portalUtils-ApkRv-Dr.js | 1 + assets/portalUtils-mNGSLeDa.js | 1 - .../{project-DmZZCyH4.js => project-DaC2Outd.js} | 2 +- ...s-CUjGHrU3.js => quantizationUtils-CfV316jZ.js} | 2 +- assets/{quat-CoKEr4Zu.js => quat-C0wQB0HB.js} | 2 +- assets/{query-BM8R3sQ6.js => query-Bk_ITqRK.js} | 2 +- ...ts-COJi206A.js => queryAttachments-DEPYJe-j.js} | 2 +- ...es-CtNPRLBc.js => queryTopFeatures-BZWuOU3o.js} | 2 +- ...yZScale-DN4aFXYn.js => queryZScale-Dwvn5BlQ.js} | 2 +- ...i37wQ.js => rasterProjectionHelper-CHkyWbma.js} | 2 +- ...erUtils-Dgn5fnGK.js => rasterUtils-DEPcL5Ca.js} | 2 +- ...ls-DXTinem2.js => rasterizingUtils-D-sJQSSt.js} | 2 +- .../{request-hDnRRtK8.js => request-DxtPt6s5.js} | 2 +- ...s-Dzwz9ori.js => requestImageUtils-BHJ_ulwE.js} | 2 +- ...n-orEjzZQo.js => resourceExtension-CiV172Z4.js} | 2 +- ...Utils-BqKyAr0B.js => resourceUtils-BHmy1O5x.js} | 2 +- ...Utils-CjqYbm2Q.js => resourceUtils-CfE36DzP.js} | 2 +- ...Utils-Cu1-5qu3.js => resourceUtils-p9pTIVIi.js} | 4 ++-- ...ils-BiX1lQSW.js => saveAPIKeyUtils-YRBbgdzi.js} | 2 +- ...saveUtils-BzCRy3uR.js => saveUtils-CGGzyvzv.js} | 2 +- ...aleUtils-Bqauo1zZ.js => scaleUtils-DWXMiS7R.js} | 2 +- assets/{scrim-DPpUFS3O.js => scrim-CUXJVHyU.js} | 2 +- ...e_j.js => serviceCapabilitiesUtils-DiP90Uds.js} | 2 +- ...ceUtils-QX9lwl5p.js => sourceUtils-BNTaqxhX.js} | 4 ++-- assets/{sphere-DHd2K2LR.js => sphere-F1imyuMS.js} | 2 +- ...sWorker-CD2pE8ny.js => statsWorker-CAnWqyLs.js} | 2 +- ...ls-w4YrSJTy.js => streamLayerUtils-i1YzXlx2.js} | 2 +- ...yleUtils-B_Iy1DTk.js => styleUtils--I7zqeL6.js} | 2 +- ...yleUtils-CnV_Xzhi.js => styleUtils-DOUOskVZ.js} | 2 +- ...Utils-BPYHHPMV.js => sublayerUtils-GrJ1gnTG.js} | 2 +- ...bstitute-DxAztrfK.js => substitute-Bz_UrLGp.js} | 2 +- ...ls-D_minlYz.js => symbolColorUtils-C9Wp-TPe.js} | 2 +- ...ls-BNd9Ueha.js => symbolLayerUtils-r4EvpcG3.js} | 4 ++-- assets/{t9n-gKZJT8eY.js => t9n-pVz2fW_o.js} | 2 +- ...bU.js => testSVGPremultipliedAlpha-BUMQhQ4O.js} | 2 +- ...Support-BjRbXIpn.js => timeSupport-DXkhlToK.js} | 4 ++-- .../{triangle-CU37cZF1.js => triangle-DmKBscqo.js} | 2 +- ...s-D_dYSFa_.js => uploadAssetErrors-DCHo_tDX.js} | 2 +- ...Assets-Do4zQv1Y.js => uploadAssets-CYfQLTBV.js} | 2 +- assets/{utils-B8iadP2F.js => utils-BKh1cxpi.js} | 2 +- assets/{utils-SjO_-1JL.js => utils-Bzmbfe7p.js} | 2 +- assets/{utils-CMvkNhle.js => utils-CBTVfSGR.js} | 2 +- assets/{utils-GMt8_G3w.js => utils-CY1ReiSd.js} | 2 +- assets/{utils-p-5Bbga5.js => utils-CuXO_Zzq.js} | 6 +++--- assets/{utils-CJVw5T-r.js => utils-D-nPH6yJ.js} | 2 +- assets/{utils-kx2f2Fff.js => utils-Dx_a2yJw.js} | 4 ++-- assets/{utils-2LBmsoaQ.js => utils-iOpWi7jV.js} | 2 +- assets/{utils3-D-MRQhiW.js => utils3-DOn9OzWH.js} | 2 +- assets/{vec3-CjYmIfaa.js => vec3-DdRUbala.js} | 2 +- ...nUtils-CaceEUVY.js => versionUtils-BIAEZzrm.js} | 2 +- ...z2k12BH8.js => visualVariableUtils-BX9G5gNQ.js} | 2 +- ...yt4cEoD8.js => webStyleSymbolUtils--Y3TqgZl.js} | 2 +- ...webglDeps-BqalI_vm.js => webglDeps-Cjw3mzdd.js} | 2 +- .../{wfsUtils-DeNqsSXH.js => wfsUtils-p2GOBpZe.js} | 2 +- .../{xyChart-CZRgKOoN.js => xyChart-Dpn5biYD.js} | 2 +- index.html | 2 +- 375 files changed, 433 insertions(+), 433 deletions(-) rename assets/{AGraphicContainer-Dby-baET.js => AGraphicContainer-BXk7Eu6w.js} (89%) rename assets/{Analysis-DeH3QoWt.js => Analysis-yEzECn2p.js} (92%) rename assets/{AttachmentInfo-DEdzaB9S.js => AttachmentInfo-Cm6dhnUr.js} (93%) rename assets/{AttachmentQuery-D61mmWw4.js => AttachmentQuery-DmEAIZff.js} (96%) rename assets/{AttributeStore-Ck-75lnq.js => AttributeStore-Bm6hLtR1.js} (98%) rename assets/{BaseDynamicLayerView2D-BqfsTH6m.js => BaseDynamicLayerView2D-DSmk7XW5.js} (57%) rename assets/{BingMapsLayer-CvxOjLC9.js => BingMapsLayer-CPBW-ptl.js} (97%) rename assets/{Bitmap--gOrgR8J.js => Bitmap-DpyomsG7.js} (95%) rename assets/{BitmapContainer-Bq0Mk6_k.js => BitmapContainer-DD7rxH0u.js} (82%) rename assets/{BoundsStore-DMoG4U0L.js => BoundsStore-DRDtG3Mk.js} (93%) rename assets/{BufferView-Ao_K-5Vg.js => BufferView-3om6S_aJ.js} (99%) rename assets/{BuildingSceneLayer-Bhih74F5.js => BuildingSceneLayer-DAfQRDdR.js} (87%) rename assets/{Button-BD3vvwHs.js => Button-D2RihRUZ.js} (96%) rename assets/{CSVLayer-BGm6RUOY.js => CSVLayer-DfX_NRk3.js} (79%) rename assets/{CSVSourceWorker-CrU3052N.js => CSVSourceWorker-DNn0ZitV.js} (92%) rename assets/{CatalogDynamicGroupLayerView2D-CqaPUHS1.js => CatalogDynamicGroupLayerView2D-CyoAbf0b.js} (87%) delete mode 100644 assets/CatalogFootprintLayerView2D-4V3pvH_N.js create mode 100644 assets/CatalogFootprintLayerView2D-KePfoiS2.js rename assets/{CatalogLayer-BLgHCc1c.js => CatalogLayer-4790y54a.js} (78%) rename assets/{CatalogLayerView2D-BuGdqUm1.js => CatalogLayerView2D-d-xBXyF9.js} (79%) rename assets/{ClassBreaksDefinition-D281x8Sj.js => ClassBreaksDefinition-Djcxa8Lp.js} (95%) rename assets/{ColorSet-DDQ4d9ui.js => ColorSet-wEWjQ87p.js} (95%) rename assets/{ColorStop-44hBlQ14.js => ColorStop-DCGjAKLC.js} (93%) rename assets/{Container-CB7SlLB9.js => Container-_n5wCgez.js} (99%) rename assets/{DefaultMaterial_COLOR_GAMMA-CWI-ZW7Q.js => DefaultMaterial_COLOR_GAMMA-BQtlD4-o.js} (98%) rename assets/{DefaultTheme-QXTOOsyZ.js => DefaultTheme-Ze4cVXuP.js} (99%) rename assets/{DeleteForwardEditsParameters-CpBjKiOL.js => DeleteForwardEditsParameters-dCKYoO-P.js} (73%) rename assets/{DimensionLayer-CS8-5O4l.js => DimensionLayer-CKhQnsO-.js} (98%) rename assets/{DoubleArray-DxyNBrRi.js => DoubleArray--0pYeNcV.js} (86%) rename assets/{EdgeProcessingWorker-C-Yxye3Z.js => EdgeProcessingWorker-DXabLlxw.js} (83%) rename assets/{EditBusLayer-SG7oYwiY.js => EditBusLayer-OslMX9fF.js} (91%) rename assets/{ElevationLayer-D3CeIkQP.js => ElevationLayer-QYZSSLWB.js} (95%) rename assets/{ElevationQuery-BFZ9QB_a.js => ElevationQuery-DphYPRnK.js} (99%) rename assets/{ElevationSamplerWorker-DNbNk0sW.js => ElevationSamplerWorker-DR7iKj10.js} (78%) rename assets/{ExportImageParameters-DVsh-7G1.js => ExportImageParameters-CXqmEVur.js} (95%) rename assets/{ExportStrategy-fFnMYcIc.js => ExportStrategy-SzILz8ne.js} (96%) rename assets/{ExportWMSImageParameters-D7gw-oIo.js => ExportWMSImageParameters-Bl6JFYua.js} (95%) rename assets/{External-DC51KyR4.js => External-DIoD7Bb4.js} (96%) rename assets/{FeatureCommandQueue-Btq_FXyi.js => FeatureCommandQueue-DI81F3gA.js} (99%) rename assets/{FeatureEffect-ByrbZlne.js => FeatureEffect-DBbkrS6j.js} (98%) rename assets/{FeatureEffectLayer-CLTrRFqx.js => FeatureEffectLayer-DarO4Ctx.js} (67%) rename assets/{FeatureLayer-D0kMrROG.js => FeatureLayer-BHxNIHhy.js} (87%) rename assets/{FeatureLayerBase-DPJuwFpX.js => FeatureLayerBase-D0I-Escx.js} (98%) rename assets/{FeatureLayerSource-BeuGtrZI.js => FeatureLayerSource-3cjHhwgM.js} (90%) rename assets/{FeatureLayerView2D-Dw_5zj3d.js => FeatureLayerView2D-B6lIa9Lt.js} (98%) rename assets/{FeaturePipelineWorker-6OTTsaNH.js => FeaturePipelineWorker--iWINXTy.js} (98%) rename assets/{FeatureReductionLayer-DncGsNIN.js => FeatureReductionLayer-CK-tyM-9.js} (97%) rename assets/{FeatureReductionSelection-BY3KVXac.js => FeatureReductionSelection-t3T7oa8H.js} (88%) rename assets/{FeatureServiceSnappingSourceWorker-BZ3sJkXx.js => FeatureServiceSnappingSourceWorker-CRj73rBJ.js} (96%) rename assets/{FeatureSet-CYJUZgOk.js => FeatureSet-opEn8ou8.js} (98%) rename assets/{FeatureStore-CqSz6SOQ.js => FeatureStore-CRMzrhIt.js} (92%) rename assets/{FeatureTemplate-DcprAdTM.js => FeatureTemplate-FZNGA_Ik.js} (94%) rename assets/{FeatureType-By3BEr9z.js => FeatureType-CwUl8Nf5.js} (85%) rename assets/{FieldsIndex-CLgRNeJ_.js => FieldsIndex-CK-0B5n9.js} (96%) rename assets/{FormTemplate-eV18QveB.js => FormTemplate-BGxtsGX6.js} (99%) rename assets/{GeoJSONLayer-BEhPE7YN.js => GeoJSONLayer-ibYVKi1c.js} (85%) rename assets/{GeoJSONSourceWorker-CUwhItjB.js => GeoJSONSourceWorker-CJxkfTXL.js} (89%) rename assets/{GeoRSSLayer-8bgy1uXP.js => GeoRSSLayer-DBDQfWhL.js} (96%) rename assets/{GeoRSSLayerView2D-DGBAg8jk.js => GeoRSSLayerView2D-DvkynA-l.js} (53%) rename assets/{GraphQueryStreaming-ofadKoJ9.js => GraphQueryStreaming-BDRIPeal.js} (96%) rename assets/{GraphicContainer-CbvswCG0.js => GraphicContainer-Bue3JF2r.js} (76%) rename assets/{GraphicsLayer-CexPXXFK.js => GraphicsLayer-g4hVfoZU.js} (93%) rename assets/{GraphicsLayerView2D-D7NawYZd.js => GraphicsLayerView2D-CtKxPbzt.js} (54%) rename assets/{GraphicsView2D-DbbthiwV.js => GraphicsView2D-B7H8XAnI.js} (97%) rename assets/{GroupLayer-BGdGYmtj.js => GroupLayer-6WnGm0lP.js} (89%) rename assets/{GroupLayerView2D-ayVE8wm-.js => GroupLayerView2D-BVygDtT5.js} (91%) rename assets/{HighlightCounter-abgLEfgq.js => HighlightCounter-qEuAaY1V.js} (90%) rename assets/{HighlightGraphicContainer-Cnwl0eCq.js => HighlightGraphicContainer-B5WIObEd.js} (64%) rename assets/{I3SBinaryReader-N_Is4gxa.js => I3SBinaryReader-Bg6QQKyW.js} (99%) rename assets/{I3SLayerDefinitions-B6gGfNoh.js => I3SLayerDefinitions-Bc0e5Sgz.js} (96%) rename assets/{I3SUtil-DxFIPSkh.js => I3SUtil-Bs1mZiKI.js} (80%) rename assets/{IdentityManager-CHp4-snh.js => IdentityManager-DBFJchIs.js} (97%) rename assets/{ImageHistogramParameters-CsWWZYhj.js => ImageHistogramParameters-DYfx5K-s.js} (98%) rename assets/{ImageryLayer-Dz6vNBYB.js => ImageryLayer-BuJz_D0q.js} (98%) rename assets/{ImageryLayerView2D-D5_CduBq.js => ImageryLayerView2D-Cd1bppq2.js} (86%) rename assets/{ImageryTileLayer-B8fBMD3Z.js => ImageryTileLayer-BEBkov6O.js} (98%) rename assets/{ImageryTileLayerView2D-CxFrn228.js => ImageryTileLayerView2D-DAJXGdeV.js} (97%) rename assets/{Indices-Dv-cCjFT.js => Indices-BRm9v2lM.js} (94%) rename assets/{IntegratedMesh3DTilesLayer-DO6ACvdE.js => IntegratedMesh3DTilesLayer-BxjpzO7W.js} (97%) rename assets/{IntegratedMeshLayer-DkCYLSWg.js => IntegratedMeshLayer-D8IB-5_i.js} (90%) rename assets/{InterleavedLayout-Dd1W8HCo.js => InterleavedLayout-Cinhb-cY.js} (96%) rename assets/{KMLLayer-D6CvdHt0.js => KMLLayer-dXg6eYPC.js} (88%) rename assets/{KMLLayerView2D-B307IWZ8.js => KMLLayerView2D-BTxXwgAN.js} (81%) rename assets/{KnowledgeGraphLayerView2D-CuM0qoPc.js => KnowledgeGraphLayerView2D-DZm8ubx6.js} (76%) rename assets/{LabelClass-6cZokw8y.js => LabelClass-CeatfK8u.js} (98%) rename assets/{LabelMetric-D2hbzzy_.js => LabelMetric-BcUxDImF.js} (98%) rename assets/{LayerFloorInfo-Cdq3ulNh.js => LayerFloorInfo-DlYNbO-A.js} (89%) rename assets/{LayerView-BEFTHNYv.js => LayerView-Bux7vAEn.js} (97%) rename assets/{LercWorker-BiydENSI.js => LercWorker-BTGjGtNo.js} (98%) rename assets/{LineOfSightLayer-CjQ9MBRQ.js => LineOfSightLayer-fNRdYlBe.js} (93%) rename assets/{LinkChartLayer-BS3nw-u_.js => LinkChartLayer-B9wu3mvA.js} (95%) rename assets/{Lyr3DWorker-pyatxP09.js => Lyr3DWorker-DhzMvWrO.js} (93%) rename assets/{MagnifierPrograms-B5-grLP-.js => MagnifierPrograms-Dy7jbVaV.js} (99%) rename assets/{MapImageLayer-DqX26yH_.js => MapImageLayer-l41pl51g.js} (75%) rename assets/{MapImageLayerView2D-iNdXAMVi.js => MapImageLayerView2D-Cq7vZ1xD.js} (64%) rename assets/{MapNotesLayer-BXf_uYaT.js => MapNotesLayer-CPjCDXnt.js} (83%) rename assets/{MapNotesLayerView2D-DxdmUoTh.js => MapNotesLayerView2D-DgCKO3Zc.js} (71%) rename assets/{MediaLayer-DrFcRt_9.js => MediaLayer-CdtBPk34.js} (96%) rename assets/{MediaLayerView2D-vpnVWbi-.js => MediaLayerView2D-CfaV01hI.js} (83%) rename assets/{MemorySourceWorker-CaK7s0IK.js => MemorySourceWorker-DFsRya29.js} (89%) rename assets/{Mesh-9oOqPmbT.js => Mesh--rTzs1p1.js} (95%) rename assets/{MeshLocalVertexSpace-Cltwu1Kq.js => MeshLocalVertexSpace-DRvwbFTJ.js} (91%) rename assets/{OGCFeatureLayer-BfwwYuSp.js => OGCFeatureLayer-_EJqre42.js} (84%) create mode 100644 assets/OGCFeatureLayerView2D-BT1AiNl1.js delete mode 100644 assets/OGCFeatureLayerView2D-DBRY7Ix7.js rename assets/{ObjectStack-CF0cQvd2.js => ObjectStack-BAIuPeIh.js} (88%) rename assets/{OpenStreetMapLayer-BmVWZwKB.js => OpenStreetMapLayer-BXLAjAfp.js} (94%) rename assets/{OrderByInfo-DKzv2-WS.js => OrderByInfo-DKyk5GLW.js} (79%) rename assets/{OrderIndependentTransparency-C747AfeB.js => OrderIndependentTransparency-Btph8gYx.js} (97%) rename assets/{OrderedLayer-Do089KpQ.js => OrderedLayer-dLoPhxcx.js} (80%) rename assets/{OrientedImageryLayer-Cb-G1CjI.js => OrientedImageryLayer-DxeUAz8W.js} (91%) rename assets/{OverrideHelper-B4ryGWZb.js => OverrideHelper-DxFZBnGL.js} (96%) rename assets/{PBFDecoderWorker-C5tQTeCI.js => PBFDecoderWorker-DLXRZcsS.js} (95%) rename assets/{PointCloudLayer-ClQsf0Mo.js => PointCloudLayer-CsBDV7DT.js} (93%) rename assets/{PointCloudUniqueValueRenderer-CdXEaMW5.js => PointCloudUniqueValueRenderer-DGqW3DIg.js} (98%) rename assets/{PointCloudWorker-BVcb1Zzd.js => PointCloudWorker-RLZ1Rh8W.js} (92%) rename assets/{PooledRBush-BsFBmw1o.js => PooledRBush-BlFOlUgK.js} (98%) rename assets/{Popup-CMTUSIYl.js => Popup-DSVql8fN.js} (95%) rename assets/{Program-DLRmaKpw.js => Program-DBsYtQ00.js} (99%) rename assets/{ProgramTemplate-BICQrNzS.js => ProgramTemplate-Ck2I0bIi.js} (93%) rename assets/{QueryEngine-RpcY23Sv.js => QueryEngine-loUu1VUW.js} (98%) rename assets/{QueryTask-CjHwD7wL.js => QueryTask-Cl66pG_V.js} (68%) rename assets/{RasterSymbolizer-D7OwkKeP.js => RasterSymbolizer-BN7ge8gb.js} (99%) rename assets/{RasterVFDisplayObject-boi924Q6.js => RasterVFDisplayObject-DLrowEg_.js} (98%) rename assets/{RasterWorker-DIZgcx97.js => RasterWorker-CzY22QDJ.js} (90%) rename assets/{RawBlockCache-D9cjIDVu.js => RawBlockCache-DNGqU_D7.js} (97%) rename assets/{RefreshableLayer-1EkEhJeI.js => RefreshableLayer-_r2TPtol.js} (96%) rename assets/{RefreshableLayerView-C1-PEoNB.js => RefreshableLayerView-L9NGpXXI.js} (81%) rename assets/{RelationshipQuery-DDK72Kwc.js => RelationshipQuery-BDJrOxaX.js} (97%) rename assets/{RenderingContext-2weDpoeh.js => RenderingContext-vSxDymNY.js} (98%) rename assets/{RouteLayer-Ba4tA3kd.js => RouteLayer-DIjUW0_h.js} (98%) rename assets/{RouteLayerView2D-CcISu94y.js => RouteLayerView2D-CjJummeL.js} (74%) rename assets/{SDFHelper-CSK796Wb.js => SDFHelper-kKuXhauo.js} (94%) rename assets/{SceneLayer-DiSvX6ty.js => SceneLayer-DVZLLmFB.js} (89%) rename assets/{SceneLayerSnappingSourceWorker-BIrjnrGh.js => SceneLayerSnappingSourceWorker-HITRlJJU.js} (96%) rename assets/{SceneLayerWorker-fYw2Py8t.js => SceneLayerWorker-C6NfAzt5.js} (82%) rename assets/{SceneService-l5OfqT0E.js => SceneService-DbS150xR.js} (97%) rename assets/{SourceLayerData-2rdvzlLE.js => SourceLayerData-CTiUdlGY.js} (96%) rename assets/{SpatialFilter-C4Il3spK.js => SpatialFilter-D9TNROUn.js} (99%) rename assets/{Stop-VHT4QwcG.js => Stop-D_lBQff2.js} (99%) rename assets/{StreamLayer-BoGXecN6.js => StreamLayer-CxayZLf7.js} (84%) rename assets/{StreamLayerView2D-Be7jZFcL.js => StreamLayerView2D-DqZHXc4V.js} (71%) rename assets/{SublayersOwner-CJjJUh6G.js => SublayersOwner-CywL6RlY.js} (91%) rename assets/{SubtypeGroupLayer-DOR5l1_M.js => SubtypeGroupLayer-DoVLJ5RR.js} (85%) delete mode 100644 assets/SubtypeGroupLayerView2D-BzijIwec.js create mode 100644 assets/SubtypeGroupLayerView2D-DykSTPs3.js rename assets/{TechniqueInstance-CSsTmbek.js => TechniqueInstance-XtnK2qy2.js} (94%) rename assets/{TemporalLayer-qq3v_i3q.js => TemporalLayer-CKICYnEl.js} (88%) rename assets/{Texture-DJgkMrSB.js => Texture-S4dD-WHn.js} (99%) rename assets/{Theme-Bdh3gaKt.js => Theme-6HY29PEY.js} (99%) rename assets/{Tick-B3uT4_8g.js => Tick-DedlQq8S.js} (99%) rename assets/{TileContainer-Ci6dOowA.js => TileContainer-Bs-vXdD_.js} (82%) rename assets/{TileLayer-CULgL3B_.js => TileLayer-MOTdXvSA.js} (78%) rename assets/{TileLayerView2D-BnlmUfzg.js => TileLayerView2D-CoWYvoLX.js} (70%) rename assets/{TimeInfo-3TVmpFSA.js => TimeInfo-DooETFWC.js} (97%) rename assets/{TimeOnly-Cm47ew5I.js => TimeOnly-BXSODLxA.js} (99%) rename assets/{Tooltip-CVjHQVY5.js => Tooltip-C7eoaNP4.js} (99%) rename assets/{TopFeaturesQuery-B8kC7n5h.js => TopFeaturesQuery-CVQjqlfM.js} (98%) rename assets/{TurboLine-CkxIB4ZX.js => TurboLine-DNQdPIXo.js} (98%) rename assets/{UniqueValueRenderer-BlkUix3g.js => UniqueValueRenderer-7V9Bhr-D.js} (99%) rename assets/{UnknownLayer-BeNlyNrR.js => UnknownLayer-BSjgqi4d.js} (91%) rename assets/{UnknownTimeZone-DF0BqWCR.js => UnknownTimeZone-CK7VjgF3.js} (75%) rename assets/{UnsupportedLayer-bFwEkP2I.js => UnsupportedLayer-CYwmIZG0.js} (93%) rename assets/{UpdateTracking2D-nj9Q-3df.js => UpdateTracking2D-Ds_Gdrxd.js} (99%) rename assets/{Util-BS8sJGjF.js => Util-CS5u4Lec.js} (87%) rename assets/{VectorTileLayerView2D-Bu846VB2.js => VectorTileLayerView2D-BLrO1BgS.js} (98%) rename assets/{Version-Bd0QsIQ5.js => Version-Dqq_CHBG.js} (93%) rename assets/{VideoLayerView2D-CtjQ6rEp.js => VideoLayerView2D-Vkk8l0f8.js} (77%) rename assets/{VoxelLayer-C6oRPxv0.js => VoxelLayer-pjuHsY2A.js} (98%) rename assets/{WFSLayer-B8MZMVqa.js => WFSLayer-DypvB2tP.js} (87%) rename assets/{WFSSourceWorker-BX8deXfR.js => WFSSourceWorker-DM2J6sPN.js} (87%) rename assets/{WGLContainer-B_Pv-8Yi.js => WGLContainer-DgZNq7b0.js} (99%) rename assets/{WMSLayer-CBKAceAl.js => WMSLayer-5SlLwEaR.js} (98%) rename assets/{WMSLayerView2D-D80tHNhN.js => WMSLayerView2D-BHemqaDF.js} (77%) rename assets/{WMTSLayer-B_E4A-J6.js => WMTSLayer-DfNOT9ZM.js} (99%) rename assets/{WMTSLayerView2D-CZBGPwsV.js => WMTSLayerView2D-D7P1L341.js} (84%) rename assets/{WebTileLayer-D3HPOkPd.js => WebTileLayer-IRzcPxtS.js} (97%) rename assets/{WhereClause-Dzgyc0wk.js => WhereClause-Ctld7DSu.js} (99%) rename assets/{WorkerTileHandler-DlTCcd69.js => WorkerTileHandler-B1--DifF.js} (99%) rename assets/{action-Ccs4b7Ti.js => action-DE-UH85X.js} (96%) rename assets/{action-group-CACOwGqI.js => action-group-Cz5uoTMD.js} (90%) rename assets/{action-menu-CYcibT5U.js => action-menu-B2VkSdfS.js} (99%) rename assets/{apng-D2pTRXhQ.js => apng-DNWE4pJX.js} (99%) rename assets/{arcade-DTRx7SKL.js => arcade-D78QfcWG.js} (73%) rename assets/{arcadeAsyncRuntime-CNNOWwv8.js => arcadeAsyncRuntime-B50Rzrzf.js} (97%) rename assets/{arcadeUtils-BoaybaAR.js => arcadeUtils-BxUF81hz.js} (98%) rename assets/{arcgis-knowledge-client-core-DKjhP7CP.js => arcgis-knowledge-client-core-B0fFx-E4.js} (99%) rename assets/{arcgis-knowledge-client-core-simd-B2yfXWvw.js => arcgis-knowledge-client-core-simd-IaMmXPr_.js} (99%) rename assets/{arcgisLayers-DI7gu0Vy.js => arcgisLayers-fiEUw9dp.js} (91%) rename assets/{associatedFeatureServiceUtils-BIEHgyxo.js => associatedFeatureServiceUtils-nLeTqfYC.js} (97%) rename assets/{basis_transcoder-CY0Zu9W4.js => basis_transcoder-gYrXvU8A.js} (99%) delete mode 100644 assets/calcite-action-CEYA6ZsJ.js rename assets/{calcite-action-bar-C5PvC65D.js => calcite-action-bar-glrD7fhe.js} (93%) create mode 100644 assets/calcite-action-group-DMHrkhqu.js delete mode 100644 assets/calcite-action-group-oGHjFsjn.js create mode 100644 assets/calcite-action-xwwomTuE.js rename assets/{calcite-button-CMjDkjDb.js => calcite-button-CWS09kHr.js} (98%) rename assets/{calcite-flow-AUD7SkeM.js => calcite-flow-cUQQQwo9.js} (95%) rename assets/{calcite-flow-item-B7iK8dgk.js => calcite-flow-item-aWVm4yY6.js} (96%) rename assets/{calcite-icon-CHcIXU52.js => calcite-icon-BCYnyK8T.js} (60%) rename assets/{calcite-input-fjO1QChb.js => calcite-input-BwO9LTJJ.js} (50%) rename assets/{calcite-label-DonsloAk.js => calcite-label-DlQTm19c.js} (96%) rename assets/{calcite-list-D9nZpOdw.js => calcite-list-CAcrc3c7.js} (98%) rename assets/{calcite-list-item-BBiyp6uG.js => calcite-list-item-JeWmt-sE.js} (97%) rename assets/{calcite-list-item-group-BIMGmmtA.js => calcite-list-item-group-tUNZxrA0.js} (93%) rename assets/{calcite-loader-CzxKWzLl.js => calcite-loader-ijl1xz1O.js} (69%) rename assets/{calcite-modal-Dti-ITgz.js => calcite-modal-DgU9l6Wa.js} (97%) rename assets/{calcite-notice-CHsdelpI.js => calcite-notice-Bu--C1Vt.js} (96%) rename assets/{capabilities-BQHqqlJu.js => capabilities-DXGHT-QH.js} (96%) rename assets/{chartCommon-DeDLy4W7.js => chartCommon-HGSAjsjY.js} (98%) rename assets/{chartUtilsAm5-DYfwNDSz.js => chartUtilsAm5-D5owA826.js} (99%) rename assets/{clientSideDefaults-CgRgH99f.js => clientSideDefaults-BQP5n3lX.js} (96%) rename assets/{colorRamps-BJydlf0f.js => colorRamps-CcakIWlU.js} (95%) rename assets/{computeTranslationToOriginAndRotation-DOOKw0d1.js => computeTranslationToOriginAndRotation-BeE3rOSz.js} (95%) rename assets/{conditionalSlot-D3Ya1Vfj.js => conditionalSlot-DMpb3OPD.js} (83%) rename assets/{createConnection-BxU4QDA7.js => createConnection-BvioR9C8.js} (84%) rename assets/{dataUtils-BFJflGP5.js => dataUtils-DzOfgSpi.js} (99%) rename assets/{deduplicate-Bk22TunD.js => deduplicate-BR6i8Xk0.js} (92%) rename assets/{deleteForwardEdits-CDZbz35M.js => deleteForwardEdits-DOePzMev.js} (69%) rename assets/{diffUtils-B4YFa5Ju.js => diffUtils-uUoMDFQS.js} (96%) rename assets/{drapedUtils-CGrSPor9.js => drapedUtils-DDBQ6RK5.js} (97%) rename assets/{earcut-hRlx3adE.js => earcut-CWKXDqDj.js} (99%) rename assets/{edgeProcessing-Cvxjjjkp.js => edgeProcessing-Dg7MHcWM.js} (96%) rename assets/{editingSupport-DWTRjmy9.js => editingSupport-4MwIplWk.js} (98%) rename assets/{editsZScale-CQCGPEjO.js => editsZScale-Bfe6gH1b.js} (89%) rename assets/{elevationInfoUtils-Dag_mzct.js => elevationInfoUtils-DIYaTlLQ.js} (90%) rename assets/{executeForIds-BjeEaIen.js => executeForIds-CZ3M8IZd.js} (57%) create mode 100644 assets/executeForTopCount-DDGFKOhN.js delete mode 100644 assets/executeForTopCount-P_PtmMoE.js delete mode 100644 assets/executeForTopExtents-BWFPmLVe.js create mode 100644 assets/executeForTopExtents-C_oYktcC.js create mode 100644 assets/executeForTopIds-B6SIZ04E.js delete mode 100644 assets/executeForTopIds-CLsxKpmx.js create mode 100644 assets/executeQueryJSON-COxi_Fac.js delete mode 100644 assets/executeQueryJSON-DngjHRnE.js rename assets/{executeQueryPBF-BYY2Ipuh.js => executeQueryPBF-DROgTCuZ.js} (96%) rename assets/{executeRelationshipQuery-DbtTkmN8.js => executeRelationshipQuery-BRG4cb0K.js} (82%) delete mode 100644 assets/executeTopFeaturesQuery-9oGsFDn1.js create mode 100644 assets/executeTopFeaturesQuery-DpUwEjEz.js rename assets/{featureConversionUtils-CmP9mw0r.js => featureConversionUtils-BHhm7bvm.js} (99%) rename assets/{featureLayerUtils-SShyxaG9.js => featureLayerUtils-D4E7zCBj.js} (94%) rename assets/{featureLayerUtils-BhDaw8pS.js => featureLayerUtils-lwqyOSrl.js} (93%) rename assets/{featureSetUtils-CGqLzAT0.js => featureSetUtils-BD9u_wDK.js} (98%) rename assets/{featuresetbase-ahV3ZnCB.js => featuresetbase-WRrooxlm.js} (89%) rename assets/{featuresetgeom-Cl8QdL8d.js => featuresetgeom-4-vjnWH-.js} (83%) rename assets/{featuresetstats-0jxQEihT.js => featuresetstats-442f9v7H.js} (84%) rename assets/{featuresetstring-DtQ-AsWo.js => featuresetstring-TQgTDW3a.js} (90%) rename assets/{fetchService-C38RarY2.js => fetchService-Crgml5qT.js} (91%) rename assets/{fieldProperties-DMs4wT6-.js => fieldProperties-DnrQXLBM.js} (89%) rename assets/{floatRGBA-BLm-Rhaq.js => floatRGBA-Cs54GdjG.js} (83%) rename assets/{form-D5ySy5kP.js => form-BC9xTZIq.js} (99%) rename assets/{geohashUtils-CTQSvgbV.js => geohashUtils-DEscCvdk.js} (91%) rename assets/{geojson-BLwRz6JF.js => geojson-AjfTISUf.js} (98%) rename assets/{geomasync-BBmYY70D.js => geomasync-B6doa0f9.js} (96%) rename assets/{geometryEngine-DD4bBRnV.js => geometryEngine-8LJe6rF3.js} (94%) rename assets/{geometryEngineAsync-B-ooCYDN.js => geometryEngineAsync-wvmuP1s9.js} (98%) rename assets/{geometryEngineBase-C5__2Su1.js => geometryEngineBase-CDbTTSsS.js} (99%) rename assets/{geometryEngineJSON-D-7-cYHZ.js => geometryEngineJSON-BfS7Q-po.js} (98%) create mode 100644 assets/geometryEngineWorker-C9d969a6.js delete mode 100644 assets/geometryEngineWorker-iTtx-A2l.js rename assets/{geometryServiceUtils-CZ5hQKF0.js => geometryServiceUtils-CdocmtDi.js} (83%) rename assets/{georeference-DtjTZVKi.js => georeference-DqFdARS7.js} (95%) rename assets/{gif-CppQXD_j.js => gif-DuihXOIa.js} (99%) rename assets/{gltfexport-D_QduVJ6.js => gltfexport-BTAOUMHO.js} (95%) rename assets/{groupLayerUtils-BrcnmI65.js => groupLayerUtils-4dYtm0nq.js} (76%) rename assets/{heatmapUtils-Clt5rJzr.js => heatmapUtils-BSteZBTj.js} (84%) rename assets/{highlightReasons-DbgbcWKM.js => highlightReasons-BOU4mnPE.js} (82%) rename assets/{hydrated-CcIo9KoC.js => hydrated-D7zavlGk.js} (90%) rename assets/{i3s-DgwnR-Am.js => i3s-DvXaSYJ6.js} (99%) rename assets/{icon-BuW41TqN.js => icon-BXpWZdRl.js} (94%) rename assets/{imageBitmapUtils-C0nKXf5P.js => imageBitmapUtils-BVxrhFkK.js} (84%) rename assets/{imageUtils-D_EPf7De.js => imageUtils-BNh57Y88.js} (90%) rename assets/{imageUtils-DNanu5Rn.js => imageUtils-ChIDAvDr.js} (78%) rename assets/{imageryUtils-Bct433Ji.js => imageryUtils-CP_eOmeO.js} (81%) rename assets/{index-CEWggaxV.js => index-BjUNJPVf.js} (98%) rename assets/{input2-BT_6gQkP.js => input2-D8djCUJ5.js} (98%) rename assets/{interactive-BR2V27xp.js => interactive-5-lo-GR7.js} (97%) rename assets/{jsonUtils-BseLl1fZ.js => jsonUtils-Dw332y6z.js} (98%) rename assets/{jsonUtils-qYmXvGJ1.js => jsonUtils-Ox5U0P0F.js} (97%) rename assets/{kmlUtils-Dl7cXNEs.js => kmlUtils-C6tn6hG1.js} (94%) rename assets/{knowledgeGraphService-pVNmnapY.js => knowledgeGraphService-yi4prBvu.js} (98%) rename assets/{knowledgegraph-x8GOX0-O.js => knowledgegraph-CifNQGEf.js} (84%) rename assets/{labelUtils-Dnqx6jl5.js => labelUtils-3p0-m-Ee.js} (93%) rename assets/{labelingInfo-CijajRsc.js => labelingInfo-DqAUis6e.js} (90%) rename assets/{layersCreator-ByGguThJ.js => layersCreator-ua5OUPYt.js} (95%) rename assets/{layersLoader-NUfQIBq4.js => layersLoader-CBGHpR45.js} (93%) create mode 100644 assets/lazyLayerLoader-Cu0XtDD2.js delete mode 100644 assets/lazyLayerLoader-s-GqbiwM.js rename assets/{lclayout-BGy-0MYF.js => lclayout-QKV44p2z.js} (99%) rename assets/{lerc-wasm-IbDLBMkK.js => lerc-wasm-lV1hYBlU.js} (99%) rename assets/{libtess-CR3C3MJB.js => libtess-B_UHPwdK.js} (99%) rename assets/{libtess-asm-DL92duA_.js => libtess-asm-rVi5NxzN.js} (99%) rename assets/{lineSegment-B9UF3nEF.js => lineSegment-BYtydnRZ.js} (76%) rename assets/{loadGLTFMesh-CbP8-zjv.js => loadGLTFMesh-DdWfwp7n.js} (82%) rename assets/{loadable-DylQ3Aza.js => loadable-CreDQ1Dd.js} (90%) rename assets/{loader-DQtzvvHl.js => loader-Bjz1lIB0.js} (99%) rename assets/{lyr3DWorker-BxsCtwuN.js => lyr3DWorker-CH63Ctm0.js} (99%) rename assets/{mapViewDeps-pgi5I2eW.js => mapViewDeps-B6Hg404o.js} (98%) rename assets/{mediaLayerUtils-LvFj83T-.js => mediaLayerUtils-DFCF50LE.js} (73%) rename assets/{meshFeatureSet-DmiifJYC.js => meshFeatureSet-BCixIf_6.js} (77%) rename assets/{meshVertexSpaceUtils-BFWpJFSd.js => meshVertexSpaceUtils-DwMoblqo.js} (87%) rename assets/{multidimensionalUtils-uKyVhR8j.js => multidimensionalUtils-u3oUX4w1.js} (99%) rename assets/{normalizeUtilsSync-B6VufdiX.js => normalizeUtilsSync-73yZ0QwV.js} (98%) rename assets/{number-Bu1a2qyF.js => number-CJqenc9O.js} (98%) rename assets/{objectResourceUtils-BVnDNNos.js => objectResourceUtils-BlC7hkco.js} (99%) rename assets/{observers-MZ9Ss0UR.js => observers-B6R0JooC.js} (95%) rename assets/{ogcFeatureUtils-D4df60hh.js => ogcFeatureUtils-B_dc0icr.js} (95%) rename assets/{openCloseComponent-CP78bYQO.js => openCloseComponent-7TDD8Qsp.js} (97%) rename assets/{orientedBoundingBox-BQdJNYvE.js => orientedBoundingBox-sJmHxD3E.js} (98%) rename assets/{pbf-D9QZb8S8.js => pbf-Du8sFEWo.js} (98%) rename assets/{pbfQueryUtils-CLRSFGBm.js => pbfQueryUtils-CSeFSIjv.js} (98%) rename assets/{pe-wasm-CayGlshv.js => pe-wasm-Dbaxno0I.js} (99%) rename assets/{persistable-uPSrwVmW.js => persistable-3OEDOKAC.js} (96%) rename assets/{perspectiveUtils-24oy2YlR.js => perspectiveUtils-DhC7L1B1.js} (91%) rename assets/{pieChart-D4IZYqRN.js => pieChart-BW1iYy_W.js} (98%) rename assets/{plane-py4f_JCU.js => plane-DxOTtTwj.js} (96%) rename assets/{popupUtils-DAFYyAvw.js => popupUtils-DlZin22m.js} (95%) rename assets/{popupUtils-BovqErR_.js => popupUtils-Do2GfZME.js} (91%) rename assets/{portalLayers-B6YNSnGP.js => portalLayers-DU48R6fl.js} (97%) create mode 100644 assets/portalUtils-ApkRv-Dr.js delete mode 100644 assets/portalUtils-mNGSLeDa.js rename assets/{project-DmZZCyH4.js => project-DaC2Outd.js} (94%) rename assets/{quantizationUtils-CUjGHrU3.js => quantizationUtils-CfV316jZ.js} (95%) rename assets/{quat-CoKEr4Zu.js => quat-C0wQB0HB.js} (98%) rename assets/{query-BM8R3sQ6.js => query-Bk_ITqRK.js} (96%) rename assets/{queryAttachments-COJi206A.js => queryAttachments-DEPYJe-j.js} (76%) rename assets/{queryTopFeatures-CtNPRLBc.js => queryTopFeatures-BZWuOU3o.js} (94%) rename assets/{queryZScale-DN4aFXYn.js => queryZScale-Dwvn5BlQ.js} (70%) rename assets/{rasterProjectionHelper-Bwvi37wQ.js => rasterProjectionHelper-CHkyWbma.js} (99%) rename assets/{rasterUtils-Dgn5fnGK.js => rasterUtils-DEPcL5Ca.js} (98%) rename assets/{rasterizingUtils-DXTinem2.js => rasterizingUtils-D-sJQSSt.js} (93%) rename assets/{request-hDnRRtK8.js => request-DxtPt6s5.js} (93%) rename assets/{requestImageUtils-Dzwz9ori.js => requestImageUtils-BHJ_ulwE.js} (54%) rename assets/{resourceExtension-orEjzZQo.js => resourceExtension-CiV172Z4.js} (88%) rename assets/{resourceUtils-BqKyAr0B.js => resourceUtils-BHmy1O5x.js} (92%) rename assets/{resourceUtils-CjqYbm2Q.js => resourceUtils-CfE36DzP.js} (97%) rename assets/{resourceUtils-Cu1-5qu3.js => resourceUtils-p9pTIVIi.js} (85%) rename assets/{saveAPIKeyUtils-BiX1lQSW.js => saveAPIKeyUtils-YRBbgdzi.js} (73%) rename assets/{saveUtils-BzCRy3uR.js => saveUtils-CGGzyvzv.js} (93%) rename assets/{scaleUtils-Bqauo1zZ.js => scaleUtils-DWXMiS7R.js} (82%) rename assets/{scrim-DPpUFS3O.js => scrim-CUXJVHyU.js} (91%) rename assets/{serviceCapabilitiesUtils-t8SL4e_j.js => serviceCapabilitiesUtils-DiP90Uds.js} (98%) rename assets/{sourceUtils-QX9lwl5p.js => sourceUtils-BNTaqxhX.js} (81%) rename assets/{sphere-DHd2K2LR.js => sphere-F1imyuMS.js} (95%) rename assets/{statsWorker-CD2pE8ny.js => statsWorker-CAnWqyLs.js} (90%) rename assets/{streamLayerUtils-w4YrSJTy.js => streamLayerUtils-i1YzXlx2.js} (75%) rename assets/{styleUtils-B_Iy1DTk.js => styleUtils--I7zqeL6.js} (86%) rename assets/{styleUtils-CnV_Xzhi.js => styleUtils-DOUOskVZ.js} (97%) rename assets/{sublayerUtils-BPYHHPMV.js => sublayerUtils-GrJ1gnTG.js} (94%) rename assets/{substitute-DxAztrfK.js => substitute-Bz_UrLGp.js} (87%) rename assets/{symbolColorUtils-D_minlYz.js => symbolColorUtils-C9Wp-TPe.js} (61%) rename assets/{symbolLayerUtils-BNd9Ueha.js => symbolLayerUtils-r4EvpcG3.js} (54%) rename assets/{t9n-gKZJT8eY.js => t9n-pVz2fW_o.js} (98%) rename assets/{testSVGPremultipliedAlpha-B0ipOzbU.js => testSVGPremultipliedAlpha-BUMQhQ4O.js} (90%) rename assets/{timeSupport-BjRbXIpn.js => timeSupport-DXkhlToK.js} (95%) rename assets/{triangle-CU37cZF1.js => triangle-DmKBscqo.js} (90%) rename assets/{uploadAssetErrors-D_dYSFa_.js => uploadAssetErrors-DCHo_tDX.js} (95%) rename assets/{uploadAssets-Do4zQv1Y.js => uploadAssets-CYfQLTBV.js} (97%) rename assets/{utils-B8iadP2F.js => utils-BKh1cxpi.js} (89%) rename assets/{utils-SjO_-1JL.js => utils-Bzmbfe7p.js} (93%) rename assets/{utils-CMvkNhle.js => utils-CBTVfSGR.js} (99%) rename assets/{utils-GMt8_G3w.js => utils-CY1ReiSd.js} (98%) rename assets/{utils-p-5Bbga5.js => utils-CuXO_Zzq.js} (97%) rename assets/{utils-CJVw5T-r.js => utils-D-nPH6yJ.js} (95%) rename assets/{utils-kx2f2Fff.js => utils-Dx_a2yJw.js} (92%) rename assets/{utils-2LBmsoaQ.js => utils-iOpWi7jV.js} (93%) rename assets/{utils3-D-MRQhiW.js => utils3-DOn9OzWH.js} (98%) rename assets/{vec3-CjYmIfaa.js => vec3-DdRUbala.js} (97%) rename assets/{versionUtils-CaceEUVY.js => versionUtils-BIAEZzrm.js} (98%) rename assets/{visualVariableUtils-z2k12BH8.js => visualVariableUtils-BX9G5gNQ.js} (98%) rename assets/{webStyleSymbolUtils-yt4cEoD8.js => webStyleSymbolUtils--Y3TqgZl.js} (85%) rename assets/{webglDeps-BqalI_vm.js => webglDeps-Cjw3mzdd.js} (82%) rename assets/{wfsUtils-DeNqsSXH.js => wfsUtils-p2GOBpZe.js} (98%) rename assets/{xyChart-CZRgKOoN.js => xyChart-Dpn5biYD.js} (99%) diff --git a/assets/AGraphicContainer-Dby-baET.js b/assets/AGraphicContainer-BXk7Eu6w.js similarity index 89% rename from assets/AGraphicContainer-Dby-baET.js rename to assets/AGraphicContainer-BXk7Eu6w.js index 87ac08e..a842ec9 100644 --- a/assets/AGraphicContainer-Dby-baET.js +++ b/assets/AGraphicContainer-BXk7Eu6w.js @@ -1,4 +1,4 @@ -import{eO as p,fV as O,g4 as v,g3 as I,g5 as M,fZ as V,eH as D,eM as $,eI as w,eJ as z,f_ as C,eK as E,fX as x,u as L}from"./index-CEWggaxV.js";import{i as N,r as T}from"./TechniqueInstance-CSsTmbek.js";import{i as F,N as P}from"./Container-CB7SlLB9.js";import{h}from"./FeatureCommandQueue-Btq_FXyi.js";import{r as k}from"./UpdateTracking2D-nj9Q-3df.js";import{r as H}from"./vec3f32-nZdmKIgz.js";import{b as U}from"./LabelMetric-D2hbzzy_.js";import{h as b}from"./Program-DLRmaKpw.js";import{o as W}from"./ProgramTemplate-BICQrNzS.js";let q=0;function c(f,e,t){return new N(k(q++),f,f.meshWriter.name,e,t)}const d={geometry:{visualVariableColor:null,visualVariableOpacity:null,visualVariableSizeMinMaxValue:null,visualVariableSizeScaleStops:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableRotation:null}};class j{constructor(){this.instances={fill:c(h.fill,d,{zoomRange:!0}),marker:c(h.marker,d,{zoomRange:!0}),line:c(h.line,d,{zoomRange:!0}),text:c(h.text,d,{zoomRange:!0,referenceSymbol:!1,clipAngle:!1}),complexFill:c(h.complexFill,d,{zoomRange:!0}),texturedLine:c(h.texturedLine,d,{zoomRange:!0})},this._instancesById=Object.values(this.instances).reduce((e,t)=>(e.set(t.instanceId,t),e),new Map)}getInstance(e){return this._instancesById.get(e)}}const G=Math.PI/180,Y=4;class J extends F{constructor(e){super(),this._program=null,this._vao=null,this._vertexBuffer=null,this._indexBuffer=null,this._dvsMat3=p(),this._localOrigin={x:0,y:0},this._getBounds=e}destroy(){this._vao&&(this._vao.dispose(),this._vao=null,this._vertexBuffer=null,this._indexBuffer=null),this._program=O(this._program)}doRender(e){const{context:t}=e,s=this._getBounds();if(s.length<1)return;this._createShaderProgram(t),this._updateMatricesAndLocalOrigin(e),this._updateBufferData(t,s),t.setBlendingEnabled(!0),t.setDepthTestEnabled(!1),t.setStencilWriteMask(0),t.setStencilTestEnabled(!1),t.setBlendFunction(v.ONE,v.ONE_MINUS_SRC_ALPHA),t.setColorMask(!0,!0,!0,!0);const r=this._program;t.bindVAO(this._vao),t.useProgram(r),r.setUniformMatrix3fv("u_dvsMat3",this._dvsMat3),t.gl.lineWidth(1),t.drawElements(I.LINES,8*s.length,M.UNSIGNED_INT,0),t.bindVAO()}_createTransforms(){return{displayViewScreenMat3:p()}}_createShaderProgram(e){if(this._program)return;const t=`precision highp float; +import{eO as p,fV as O,g4 as v,g3 as I,g5 as M,fZ as V,eH as D,eM as $,eI as w,eJ as z,f_ as C,eK as E,fX as x,u as L}from"./index-BjUNJPVf.js";import{i as N,r as T}from"./TechniqueInstance-XtnK2qy2.js";import{i as F,N as P}from"./Container-_n5wCgez.js";import{h}from"./FeatureCommandQueue-DI81F3gA.js";import{r as k}from"./UpdateTracking2D-Ds_Gdrxd.js";import{r as H}from"./vec3f32-nZdmKIgz.js";import{b as U}from"./LabelMetric-BcUxDImF.js";import{h as b}from"./Program-DBsYtQ00.js";import{o as W}from"./ProgramTemplate-Ck2I0bIi.js";let q=0;function c(f,e,t){return new N(k(q++),f,f.meshWriter.name,e,t)}const d={geometry:{visualVariableColor:null,visualVariableOpacity:null,visualVariableSizeMinMaxValue:null,visualVariableSizeScaleStops:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableRotation:null}};class j{constructor(){this.instances={fill:c(h.fill,d,{zoomRange:!0}),marker:c(h.marker,d,{zoomRange:!0}),line:c(h.line,d,{zoomRange:!0}),text:c(h.text,d,{zoomRange:!0,referenceSymbol:!1,clipAngle:!1}),complexFill:c(h.complexFill,d,{zoomRange:!0}),texturedLine:c(h.texturedLine,d,{zoomRange:!0})},this._instancesById=Object.values(this.instances).reduce((e,t)=>(e.set(t.instanceId,t),e),new Map)}getInstance(e){return this._instancesById.get(e)}}const G=Math.PI/180,Y=4;class J extends F{constructor(e){super(),this._program=null,this._vao=null,this._vertexBuffer=null,this._indexBuffer=null,this._dvsMat3=p(),this._localOrigin={x:0,y:0},this._getBounds=e}destroy(){this._vao&&(this._vao.dispose(),this._vao=null,this._vertexBuffer=null,this._indexBuffer=null),this._program=O(this._program)}doRender(e){const{context:t}=e,s=this._getBounds();if(s.length<1)return;this._createShaderProgram(t),this._updateMatricesAndLocalOrigin(e),this._updateBufferData(t,s),t.setBlendingEnabled(!0),t.setDepthTestEnabled(!1),t.setStencilWriteMask(0),t.setStencilTestEnabled(!1),t.setBlendFunction(v.ONE,v.ONE_MINUS_SRC_ALPHA),t.setColorMask(!0,!0,!0,!0);const r=this._program;t.bindVAO(this._vao),t.useProgram(r),r.setUniformMatrix3fv("u_dvsMat3",this._dvsMat3),t.gl.lineWidth(1),t.drawElements(I.LINES,8*s.length,M.UNSIGNED_INT,0),t.bindVAO()}_createTransforms(){return{displayViewScreenMat3:p()}}_createShaderProgram(e){if(this._program)return;const t=`precision highp float; uniform mat3 u_dvsMat3; attribute vec2 a_position; diff --git a/assets/Analysis-DeH3QoWt.js b/assets/Analysis-yEzECn2p.js similarity index 92% rename from assets/Analysis-DeH3QoWt.js rename to assets/Analysis-yEzECn2p.js index b87af0a..7428c12 100644 --- a/assets/Analysis-DeH3QoWt.js +++ b/assets/Analysis-yEzECn2p.js @@ -1 +1 @@ -import{dm as a,b4 as r,dn as l,q as o,d as s,y as i,f as p,a7 as c}from"./index-CEWggaxV.js";let d=0,t=class extends a(r(l(c))){constructor(n){super(n),this.id=`${Date.now().toString(16)}-analysis-${d++}`,this.title=null}get parent(){return this._get("parent")}set parent(n){const e=this.parent;if(e!=null)switch(e.type){case"line-of-sight":case"dimension":e.releaseAnalysis(this);break;case"2d":case"3d":e.analyses.includes(this)&&e.analyses.remove(this)}this._set("parent",n)}get isEditable(){return this.requiredPropertiesForEditing.every(o)}};s([i({type:String,constructOnly:!0,clonable:!1})],t.prototype,"id",void 0),s([i({type:String})],t.prototype,"title",void 0),s([i({clonable:!1,value:null})],t.prototype,"parent",null),s([i({readOnly:!0})],t.prototype,"isEditable",null),t=s([p("esri.analysis.Analysis")],t);const u=t;export{u as c}; +import{dm as a,b4 as r,dn as l,q as o,d as s,y as i,f as p,a7 as c}from"./index-BjUNJPVf.js";let d=0,t=class extends a(r(l(c))){constructor(n){super(n),this.id=`${Date.now().toString(16)}-analysis-${d++}`,this.title=null}get parent(){return this._get("parent")}set parent(n){const e=this.parent;if(e!=null)switch(e.type){case"line-of-sight":case"dimension":e.releaseAnalysis(this);break;case"2d":case"3d":e.analyses.includes(this)&&e.analyses.remove(this)}this._set("parent",n)}get isEditable(){return this.requiredPropertiesForEditing.every(o)}};s([i({type:String,constructOnly:!0,clonable:!1})],t.prototype,"id",void 0),s([i({type:String})],t.prototype,"title",void 0),s([i({clonable:!1,value:null})],t.prototype,"parent",null),s([i({readOnly:!0})],t.prototype,"isEditable",null),t=s([p("esri.analysis.Analysis")],t);const u=t;export{u as c}; diff --git a/assets/AttachmentInfo-DEdzaB9S.js b/assets/AttachmentInfo-Cm6dhnUr.js similarity index 93% rename from assets/AttachmentInfo-DEdzaB9S.js rename to assets/AttachmentInfo-Cm6dhnUr.js index 0cb9dd0..abe27a1 100644 --- a/assets/AttachmentInfo-DEdzaB9S.js +++ b/assets/AttachmentInfo-Cm6dhnUr.js @@ -1 +1 @@ -import{d as o,y as e,dS as s,f as u,aU as f}from"./index-CEWggaxV.js";function y(n){const{exifInfo:r,exifName:a,tagName:i}=n;if(!r||!a||!i)return null;const l=r.find(p=>p.name===a);return l?c({tagName:i,tags:l.tags}):null}function c(n){const{tagName:r,tags:a}=n;if(!a||!r)return null;const i=a.find(l=>l.name===r);return(i==null?void 0:i.value)||null}var d;const m={1:{id:1,rotation:0,mirrored:!1},2:{id:2,rotation:0,mirrored:!0},3:{id:3,rotation:180,mirrored:!1},4:{id:4,rotation:180,mirrored:!0},5:{id:5,rotation:-90,mirrored:!0},6:{id:6,rotation:90,mirrored:!1},7:{id:7,rotation:90,mirrored:!0},8:{id:8,rotation:-90,mirrored:!1}};let t=d=class extends f{constructor(n){super(n),this.contentType=null,this.exifInfo=null,this.id=null,this.globalId=null,this.keywords=null,this.name=null,this.parentGlobalId=null,this.parentObjectId=null,this.size=null,this.url=null}get orientationInfo(){const{exifInfo:n}=this,r=y({exifName:"Exif IFD0",tagName:"Orientation",exifInfo:n});return m[r]||null}clone(){return new d({contentType:this.contentType,exifInfo:this.exifInfo,id:this.id,globalId:this.globalId,keywords:this.keywords,name:this.name,parentGlobalId:this.parentGlobalId,parentObjectId:this.parentObjectId,size:this.size,url:this.url})}};o([e({type:String})],t.prototype,"contentType",void 0),o([e()],t.prototype,"exifInfo",void 0),o([e({readOnly:!0})],t.prototype,"orientationInfo",null),o([e({type:s})],t.prototype,"id",void 0),o([e({type:String})],t.prototype,"globalId",void 0),o([e({type:String})],t.prototype,"keywords",void 0),o([e({type:String})],t.prototype,"name",void 0),o([e({json:{read:!1}})],t.prototype,"parentGlobalId",void 0),o([e({json:{read:!1}})],t.prototype,"parentObjectId",void 0),o([e({type:s})],t.prototype,"size",void 0),o([e({json:{read:!1}})],t.prototype,"url",void 0),t=d=o([u("esri.layers.support.AttachmentInfo")],t);const h=t;export{h as a}; +import{d as o,y as e,dS as s,f as u,aU as f}from"./index-BjUNJPVf.js";function y(n){const{exifInfo:r,exifName:a,tagName:i}=n;if(!r||!a||!i)return null;const l=r.find(p=>p.name===a);return l?c({tagName:i,tags:l.tags}):null}function c(n){const{tagName:r,tags:a}=n;if(!a||!r)return null;const i=a.find(l=>l.name===r);return(i==null?void 0:i.value)||null}var d;const m={1:{id:1,rotation:0,mirrored:!1},2:{id:2,rotation:0,mirrored:!0},3:{id:3,rotation:180,mirrored:!1},4:{id:4,rotation:180,mirrored:!0},5:{id:5,rotation:-90,mirrored:!0},6:{id:6,rotation:90,mirrored:!1},7:{id:7,rotation:90,mirrored:!0},8:{id:8,rotation:-90,mirrored:!1}};let t=d=class extends f{constructor(n){super(n),this.contentType=null,this.exifInfo=null,this.id=null,this.globalId=null,this.keywords=null,this.name=null,this.parentGlobalId=null,this.parentObjectId=null,this.size=null,this.url=null}get orientationInfo(){const{exifInfo:n}=this,r=y({exifName:"Exif IFD0",tagName:"Orientation",exifInfo:n});return m[r]||null}clone(){return new d({contentType:this.contentType,exifInfo:this.exifInfo,id:this.id,globalId:this.globalId,keywords:this.keywords,name:this.name,parentGlobalId:this.parentGlobalId,parentObjectId:this.parentObjectId,size:this.size,url:this.url})}};o([e({type:String})],t.prototype,"contentType",void 0),o([e()],t.prototype,"exifInfo",void 0),o([e({readOnly:!0})],t.prototype,"orientationInfo",null),o([e({type:s})],t.prototype,"id",void 0),o([e({type:String})],t.prototype,"globalId",void 0),o([e({type:String})],t.prototype,"keywords",void 0),o([e({type:String})],t.prototype,"name",void 0),o([e({json:{read:!1}})],t.prototype,"parentGlobalId",void 0),o([e({json:{read:!1}})],t.prototype,"parentObjectId",void 0),o([e({type:s})],t.prototype,"size",void 0),o([e({json:{read:!1}})],t.prototype,"url",void 0),t=d=o([u("esri.layers.support.AttachmentInfo")],t);const h=t;export{h as a}; diff --git a/assets/AttachmentQuery-D61mmWw4.js b/assets/AttachmentQuery-DmEAIZff.js similarity index 96% rename from assets/AttachmentQuery-D61mmWw4.js rename to assets/AttachmentQuery-DmEAIZff.js index 9713aa2..2a7b868 100644 --- a/assets/AttachmentQuery-D61mmWw4.js +++ b/assets/AttachmentQuery-DmEAIZff.js @@ -1 +1 @@ -import{d as e,y as s,aR as n,f as a,aT as p,aU as h,aV as u}from"./index-CEWggaxV.js";var r;let t=r=class extends h{constructor(o){super(o),this.attachmentTypes=null,this.attachmentsWhere=null,this.cacheHint=void 0,this.keywords=null,this.globalIds=null,this.name=null,this.num=null,this.objectIds=null,this.returnMetadata=!1,this.size=null,this.start=null,this.where=null}writeStart(o,i){i.resultOffset=this.start,i.resultRecordCount=this.num||10}clone(){return new r(u({attachmentTypes:this.attachmentTypes,attachmentsWhere:this.attachmentsWhere,cacheHint:this.cacheHint,keywords:this.keywords,where:this.where,globalIds:this.globalIds,name:this.name,num:this.num,objectIds:this.objectIds,returnMetadata:this.returnMetadata,size:this.size,start:this.start}))}};e([s({type:[String],json:{write:!0}})],t.prototype,"attachmentTypes",void 0),e([s({type:String,json:{read:{source:"attachmentsDefinitionExpression"},write:{target:"attachmentsDefinitionExpression"}}})],t.prototype,"attachmentsWhere",void 0),e([s({type:Boolean,json:{write:!0}})],t.prototype,"cacheHint",void 0),e([s({type:[String],json:{write:!0}})],t.prototype,"keywords",void 0),e([s({type:[Number],json:{write:!0}})],t.prototype,"globalIds",void 0),e([s({json:{write:!0}})],t.prototype,"name",void 0),e([s({type:Number,json:{read:{source:"resultRecordCount"}}})],t.prototype,"num",void 0),e([s({type:[Number],json:{write:!0}})],t.prototype,"objectIds",void 0),e([s({type:Boolean,json:{default:!1,write:!0}})],t.prototype,"returnMetadata",void 0),e([s({type:[Number],json:{write:!0}})],t.prototype,"size",void 0),e([s({type:Number,json:{read:{source:"resultOffset"}}})],t.prototype,"start",void 0),e([n("start"),n("num")],t.prototype,"writeStart",null),e([s({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],t.prototype,"where",void 0),t=r=e([a("esri.rest.support.AttachmentQuery")],t),t.from=p(t);const l=t;export{l as c}; +import{d as e,y as s,aR as n,f as a,aT as p,aU as h,aV as u}from"./index-BjUNJPVf.js";var r;let t=r=class extends h{constructor(o){super(o),this.attachmentTypes=null,this.attachmentsWhere=null,this.cacheHint=void 0,this.keywords=null,this.globalIds=null,this.name=null,this.num=null,this.objectIds=null,this.returnMetadata=!1,this.size=null,this.start=null,this.where=null}writeStart(o,i){i.resultOffset=this.start,i.resultRecordCount=this.num||10}clone(){return new r(u({attachmentTypes:this.attachmentTypes,attachmentsWhere:this.attachmentsWhere,cacheHint:this.cacheHint,keywords:this.keywords,where:this.where,globalIds:this.globalIds,name:this.name,num:this.num,objectIds:this.objectIds,returnMetadata:this.returnMetadata,size:this.size,start:this.start}))}};e([s({type:[String],json:{write:!0}})],t.prototype,"attachmentTypes",void 0),e([s({type:String,json:{read:{source:"attachmentsDefinitionExpression"},write:{target:"attachmentsDefinitionExpression"}}})],t.prototype,"attachmentsWhere",void 0),e([s({type:Boolean,json:{write:!0}})],t.prototype,"cacheHint",void 0),e([s({type:[String],json:{write:!0}})],t.prototype,"keywords",void 0),e([s({type:[Number],json:{write:!0}})],t.prototype,"globalIds",void 0),e([s({json:{write:!0}})],t.prototype,"name",void 0),e([s({type:Number,json:{read:{source:"resultRecordCount"}}})],t.prototype,"num",void 0),e([s({type:[Number],json:{write:!0}})],t.prototype,"objectIds",void 0),e([s({type:Boolean,json:{default:!1,write:!0}})],t.prototype,"returnMetadata",void 0),e([s({type:[Number],json:{write:!0}})],t.prototype,"size",void 0),e([s({type:Number,json:{read:{source:"resultOffset"}}})],t.prototype,"start",void 0),e([n("start"),n("num")],t.prototype,"writeStart",null),e([s({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],t.prototype,"where",void 0),t=r=e([a("esri.rest.support.AttachmentQuery")],t),t.from=p(t);const l=t;export{l as c}; diff --git a/assets/AttributeStore-Ck-75lnq.js b/assets/AttributeStore-Bm6hLtR1.js similarity index 98% rename from assets/AttributeStore-Ck-75lnq.js rename to assets/AttributeStore-Bm6hLtR1.js index a0d3f06..a145989 100644 --- a/assets/AttributeStore-Ck-75lnq.js +++ b/assets/AttributeStore-Bm6hLtR1.js @@ -1 +1 @@ -import{s as de,t as H,o as le,M as fe,d as _e}from"./LabelMetric-D2hbzzy_.js";import{a as pe,n as me,b as m,c as ye,l as ge,s as be,k as xe,f as I}from"./UpdateTracking2D-nj9Q-3df.js";import{iU as W,q as A,aV as Ie,N as w,s as S,eP as we,l3 as Se,O as Te,aI as ve,aM as Ee,Q as Ae,aH as Ce,eZ as Me,af as j,ai as Fe,aX as ze,am as $e,aS as De,E as b,ah as Be,b0 as Re,l4 as Oe,X as Pe,l5 as Ve,U as C,g6 as O}from"./index-CEWggaxV.js";import{p as Ge}from"./labelUtils-Dnqx6jl5.js";import{Z as X}from"./FieldsIndex-CLgRNeJ_.js";import{m as M,n as J,a as q}from"./TimeOnly-Cm47ew5I.js";import{b as ke,v as je,t as Ne,n as We}from"./timeSupport-BjRbXIpn.js";import{r as P,p as K}from"./featureConversionUtils-CmP9mw0r.js";import{e as F,t as Le}from"./OptimizedGeometry-CQuTPb9g.js";import{m as Ue}from"./diffUtils-B4YFa5Ju.js";import{l as V}from"./highlightReasons-DbgbcWKM.js";const Ye=1.25;let D=class{get length(){return this._pos}constructor(e,t){this._pos=0;const r=t?this._roundToNearest(t,e.BYTES_PER_ELEMENT):40;this._array=new ArrayBuffer(r),this._buffer=new e(this._array),this._ctor=e,this._i16View=new Int16Array(this._array)}_roundToNearest(e,t){const r=Math.round(e);return t===1?r:r+(t-r%t)}_ensureSize(e){if(this._pos+e>=this._buffer.length){const t=this._roundToNearest((this._array.byteLength+e*this._buffer.BYTES_PER_ELEMENT)*Ye,this._buffer.BYTES_PER_ELEMENT),r=new ArrayBuffer(t),s=new this._ctor(r);s.set(this._buffer,0),this._array=r,this._buffer=s,this._i16View=new Int16Array(this._array)}}ensureSize(e){this._ensureSize(e)}writeF32(e){this._ensureSize(1);const t=this._pos;return new Float32Array(this._array,4*this._pos,1)[0]=e,this._pos++,t}push(e){this._ensureSize(1);const t=this._pos;return this._buffer[this._pos++]=e,t}writeFixed(e){this._buffer[this._pos++]=e}setValue(e,t){this._buffer[e]=t}i1616Add(e,t,r){this._i16View[2*e]+=t,this._i16View[2*e+1]+=r}getValue(e){return this._buffer[e]}getValueF32(e){return new Float32Array(this._array,4*e,1)[0]}incr(e){if(this._buffer.lengthd.name==="pos"||d.name==="position");if(!h)throw new Error("InternalError: Unable to find position attribute");this.layout={...t,position:h},this._indices=new D(Uint32Array,i),this._vertices=new D(Uint32Array,n),this._metrics=new D(Uint32Array,0),this._metricCountOffset=this._metrics.push(0),this._strideInt=o,this._instanceId=e}serialize(e){const t=this._indices.buffer(),r=this._vertices.buffer(),s=this._metrics.length?this._metrics.buffer():null;return e.push(t,r),{instanceId:this._instanceId,layout:this.layout,indices:t,vertices:r,metrics:s}}get strideInt(){return this._strideInt}get vertexCount(){return this._vertices.length/this._strideInt}get indexCount(){return this._indices.length}get indexWriter(){return this._indices}get vertexWriter(){return this._vertices}get metricWriter(){return this._metrics}vertexEnsureSize(e){this._vertices.ensureSize(e)}indexEnsureSize(e){this._indices.ensureSize(e)}writeIndex(e){this._indices.push(e)}writeVertex(e){this._vertices.push(e)}writeVertexRegion(e){this._vertices.writeRegion(e)}writeVertexF32(e){this._vertices.writeF32(e)}writeMetric(e){this._metrics.incr(this._metricCountOffset),e.serialize(this._metrics)}},Ut=class{constructor(e,t=0){this._id=e,this._sizeHint=t,this._entityRecordCountOffset=0,this._entityCountOffset=0,this._entityIdIndex=0,this._entitySortKeyIndex=0,this._instanceIdToVertexData=new Map,this._recordIndexStart=0,this._recordIndexCount=0,this._recordVertexStart=0,this._recordVertexCount=0,this._current={metric:null,writer:null,start:0,sortKey:0,instanceId:0,layoutHash:0,indexStart:0,vertexStart:0,textureKey:0,metricBoxLenPointer:0},this._entities=new D(Uint32Array,this._sizeHint*de.byteSizeHint),this._entityCountOffset=this._entities.push(0)}get id(){return this._id}serialize(){const e=new Array,t=[],r=this._entities.buffer();for(const s of this._instanceIdToVertexData.values())t.push(s.serialize(e));return{message:{data:t,entities:r},transferList:e}}vertexCount(){var e;return((e=this._current.writer)==null?void 0:e.vertexCount)??0}indexCount(){var e;return((e=this._current.writer)==null?void 0:e.indexCount)??0}vertexEnsureSize(e){this._current.writer.vertexEnsureSize(e)}indexEnsureSize(e){this._current.writer.indexEnsureSize(e)}vertexWrite(e){this._current.writer.writeVertex(e)}vertexWriteRegion(e){this._current.writer.writeVertexRegion(e)}vertexWriteF32(e){this._current.writer.writeVertexF32(e)}recordBounds(e,t,r,s){}indexWrite(e){this._current.writer.writeIndex(e)}metricStart(e){this._current.metric=e}metricEnd(){const e=this._current.writer;this._current.metric.bounds.length&&e.writeMetric(this._current.metric)}metricBoxWrite(e){this._current.metric.bounds.push(e)}entityStart(e,t=e){this._entityIdIndex=this._entities.push(e),this._entitySortKeyIndex=this._entities.writeF32(t),this._entityRecordCountOffset=this._entities.push(0)}entityRecordCount(){return this._entities.getValue(this._entityRecordCountOffset)}entityEnd(){this.entityRecordCount()===0?this._entities.seek(this._entityIdIndex):this._entities.incr(this._entityCountOffset)}recordCount(){return this._entities.getValue(this._entityRecordCountOffset)}recordStart(e,t,r=0){this._current.writer=this._getVertexWriter(e,t),this._current.indexStart=this._current.writer.indexCount,this._current.vertexStart=this._current.writer.vertexCount,this._current.instanceId=e,this._current.layoutHash=t.hash,this._current.textureKey=r}recordEnd(e=0){const t=this._current.vertexStart,r=this._current.writer.vertexCount-t;if(!r)return!1;const s=this._current.indexStart,i=this._current.writer.indexCount-s;return this._recordIndexStart=s,this._recordIndexCount=i,this._recordVertexStart=t,this._recordVertexCount=r,this._entities.incr(this._entityRecordCountOffset),H.write(this._entities,this._current.instanceId,this._current.textureKey,s,i,t,r,e),!0}copyLast(e,t){const r=this._recordVertexStart+this._recordVertexCount;this._entities.incr(this._entityRecordCountOffset),H.write(this._entities,this._current.instanceId,this._current.textureKey,this._recordIndexStart+this._recordIndexCount,this._recordIndexCount,r,this._recordVertexCount,0);const s=this._current.writer.indexWriter,i=this._current.writer.vertexWriter,n=this._recordIndexStart+this._recordIndexCount,o=this._recordVertexCount;for(let p=this._recordIndexStart;p!==n;p++){const _=s.getValue(p);s.push(_+o)}const h=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,d=this._recordVertexStart*h,c=(this._recordVertexStart+this._recordVertexCount)*h;for(let p=d;p!==c;p++){const _=i.getValue(p);i.push(_)}const u=this._current.writer.layout.position,l=u.packPrecisionFactor??1,y=u.offset/Uint32Array.BYTES_PER_ELEMENT,f=e*l,g=t*l;for(let p=r*h;p<=i.length;p+=h)i.i1616Add(p+y,f,g);this.recordEnd()}copyLastFrom(e,t,r){const s=e._entities.getValue(e._entityIdIndex);if(s!==this._entities.getValue(this._entityIdIndex)){const _=e._entities.getValueF32(e._entitySortKeyIndex);this.entityStart(s,_)}this.recordStart(e._current.instanceId,e._current.writer.layout,e._current.textureKey);const i=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,n=this._current.vertexStart,o=e._current.vertexStart-n,h=this._current.writer.indexWriter,d=this._current.writer.vertexWriter,c=e._current.writer.indexWriter,u=e._current.writer.vertexWriter;for(let _=e._current.indexStart;_!==c.length;_++){const T=c.getValue(_);h.push(T-o)}for(let _=e._current.vertexStart*i;_!==u.length;_++){const T=u.getValue(_);d.push(T)}const l=this._current.writer.layout.position,y=l.packPrecisionFactor??1,f=l.offset/Uint32Array.BYTES_PER_ELEMENT,g=t*y,p=r*y;for(let _=n*i;_<=d.length;_+=i)d.i1616Add(_+f,g,p);this.recordEnd()}_getVertexWriter(e,t){const{stride:r}=t,s=this._instanceIdToVertexData;return s.has(e)||s.set(e,new Xe(e,t,r,this._sizeHint)),s.get(e)}};function Je(a,e){let t;if(typeof a=="string")t=W(a+`-seed(${e})`);else{let r=12;t=a^e;do t=107*(t>>8^t)+r|0;while(--r!=0)}return(1+t/(1<<31))/2}function qe(a){return Math.floor(Je(a,Ke)*Qe)}const Ke=53290320,Qe=10;let E=class{destroy(){}},et=class extends E{constructor(e){super(),this._value=e}resize(e){}read(e,t){return this._value}readWithDefault(e,t,r){return this._value}referencesScale(){return!1}referencesGeometry(){return!1}};const tt=()=>S.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.mesh.MeshWriterInputEvaluator");async function z(a,e,t=!1){const{defaultValue:r,valueExpressionInfo:s,value:i}=e;if(s){const{expression:n}=s,o=await a.createComputedField({expression:n},t);return o?{...e,computed:o,defaultValue:r}:null}return{...e,computed:new et(i),defaultValue:r}}async function Q(a,e){const{defaultValue:t,valueExpressionInfo:r}=e,{expression:s}=r,i=await a.createComputedField({expression:s});return i?{...e,computed:i,defaultValue:t}:null}const ie=a=>typeof a!="boolean"&&typeof a!="number"&&"valueExpressionInfo"in a,rt=a=>a.some(e=>{for(const t in e){const r=e[t];if(ie(r))return!0}return!1});let st=class ne{static async create(e,t,r){const s={},i=new Map,n=new Map,o=new Map,h=new Map,d=new Map;for(const c in r.params){const u=r.params[c];if(u!=null&&typeof u=="object")if(Array.isArray(u)){if(typeof u[0]=="object")throw new Error(`InternalError: Cannot handle ${c}. Nested array params are not supported`);s[c]=u}else if("valueExpressionInfo"in u){if(u.value){s[c]=u.value;continue}const l=await Q(e,u);if(!l){s[c]=u.defaultValue;continue}i.set(c,l),s[c]=null}else switch(u.type){case"cim-effect-infos":if(u.effectInfos.some(l=>l.overrides.length)){n.set(c,{effects:await Promise.all(u.effectInfos.map(async l=>{const y=l.overrides.map(f=>z(e,f));return{effect:l.effect,compiledOverrides:(await Promise.all(y)).filter(A)}}))});break}s[c]=u.effectInfos.map(l=>l.effect);break;case"cim-marker-placement-info":u.overrides.length&&o.set(c,{placementInfo:u,compiledOverrides:(await Promise.all(u.overrides.map(l=>z(e,l)))).filter(A)}),s[c]=u.placement;break;case"text-rasterization-param":{if(u.overrides.length){const y=u.overrides.map(f=>z(e,f,u.useLegacyLabelEvaluationRules));h.set(c,{compiledOverrides:(await Promise.all(y)).filter(A),rasterizationParam:u,objectIdToResourceId:new Map});continue}const l={type:"cim-rasterization-info",resource:u.resource};s[c]=await t.fetchResourceImmediate(l)??null;break}case"sprite-rasterization-param":{if(u.overrides.length){const y=u.overrides.map(f=>z(e,f));h.set(c,{compiledOverrides:(await Promise.all(y)).filter(A),rasterizationParam:u,objectIdToResourceId:new Map});continue}if(u.resource.type==="animated"){h.set(c,{compiledOverrides:[],rasterizationParam:u,objectIdToResourceId:new Map});continue}const l={type:"cim-rasterization-info",resource:u.resource};s[c]=await t.fetchResourceImmediate(l)??null;break}case"cim-marker-transform-param":{const{params:l}=u;if(rt(l)){const y={compiledMarkerInfos:[]};await Promise.all(l.map(async f=>{const g={props:{}};for(const p in f)if(ie(f[p])){const _=await Q(e,f[p]);g.compiledExpressionMap||(g.compiledExpressionMap=new Map);const T=g.compiledExpressionMap;_&&T.set(p,_)}else g.props[p]=f[p];y.compiledMarkerInfos.push(g)})),d.set(c,y)}else s[c]={type:"cim-marker-transform-info",infos:l};break}default:s[c]=u}else s[c]=u}return new ne(r,s,i,n,o,h,d)}constructor(e,t,r,s,i,n,o){this.inputMeshParams=e,this._resolvedMeshParams=t,this._dynamicProperties=r,this._dynamicEffectProperties=s,this._dynamicPlacementProperties=i,this._dynamicAsyncProperties=n,this._dynamicTransformProperties=o,this.evaluator=h=>h}get hasDynamicProperties(){return!!(this._dynamicProperties.size||this._dynamicAsyncProperties.size||this._dynamicEffectProperties.size||this._dynamicTransformProperties.size||this._dynamicPlacementProperties.size)}get evaluatedMeshParams(){return this._evaluatedMeshParams||(this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams)),this._evaluatedMeshParams}enqueueRequest(e,t,r){for(const s of this._dynamicAsyncProperties.values()){const i=Ie(s.rasterizationParam.resource);s.rasterizationParam.resource.type==="animated"&&s.rasterizationParam.resource.randomizeStartTime&&(i.primitiveName="__RESERVED__PRIMITIVE__NAME__",i.startGroup=qe(t.getObjectId()||0));for(const{primitiveName:o,propertyName:h,computed:d,defaultValue:c,valueExpressionInfo:u}of s.compiledOverrides)try{const l=s.rasterizationParam.resource.type==="animated"?i.primitiveName:o;le(i,l,h,d,t,r,c)}catch(l){tt().errorOnce(new w("invalid-arcade-expression",`Encountered an error when evaluating the arcade expression '${u==null?void 0:u.expression}' (primitive: '${o}', property: '${h}')`,l))}const n=e.enqueueRequest({type:"cim-rasterization-info",resource:i});s.objectIdToResourceId.set(t.getObjectId(),n)}}evaluateMeshParams(e,t,r){for(const[s,i]of this._dynamicProperties.entries())this._resolvedMeshParams[s]=i.computed.readWithDefault(t,r,i.defaultValue);for(const[s,i]of this._dynamicPlacementProperties.entries())for(const{computed:n,defaultValue:o,propertyName:h}of i.compiledOverrides){const d=n.readWithDefault(t,r,o);i.placementInfo.placement[h]=d,this._resolvedMeshParams[s]=i.placementInfo.placement}for(const[s,i]of this._dynamicEffectProperties.entries())for(const n of i.effects){for(const{computed:o,defaultValue:h,propertyName:d}of n.compiledOverrides){const c=o.readWithDefault(t,r,h);n.effect[d]=c}this._resolvedMeshParams[s]=i.effects.map(o=>o.effect)}for(const[s,i]of this._dynamicTransformProperties.entries()){const n={type:"cim-marker-transform-info",infos:[]};for(const o of i.compiledMarkerInfos){const h={...o.props};if(o.compiledExpressionMap)for(const[d,c]of o.compiledExpressionMap){const u=c.computed.readWithDefault(t,r,c.defaultValue);h[d]=typeof u=="number"||typeof u=="boolean"?u:c.defaultValue}n.infos.push(h)}this._resolvedMeshParams[s]=n}for(const[s,i]of this._dynamicAsyncProperties.entries()){const n=i.objectIdToResourceId.get(t.getObjectId());if(n==null)continue;const o=e.getResource(n);this._resolvedMeshParams[s]=o}return this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams),this.evaluatedMeshParams}};async function it(a,e,t,r,s,i,n){const o=pe[t],h=await st.create(a,e,s),d=new o.constructor(r,h,i,n);return await d.loadDependencies(),d}async function Xt(a,e,t,r){return Promise.all(t.map(s=>it(a,e,s.meshWriterName,me(s.id),s.options,r,s.optionalAttributes)))}let nt=class{},qt=class extends nt{constructor(e){super(),this._fetcher=e,this._controller=new AbortController,this._pendingIds=new Set,this._pendingRequests=[],this._resourceIdToResource=new Map}destory(){this._controller.abort()}get _abortOptions(){return{signal:this._controller.signal}}enqueueRequest(e){const t=fe(e.resource),r=W(JSON.stringify(t));return this._pendingIds.has(r)||(this._pendingIds.add(r),this._pendingRequests.push({...e,resourceId:r})),r}async fetchEnqueuedResources(){const e=this._pendingRequests;this._pendingIds.clear(),this._pendingRequests=[];const t=await this._fetcher.fetch(e,this._abortOptions);for(let r=0;rr.replaceAll(/{[^}]*}/g,i=>{const n=i.slice(1,-1),o=s.metadata.fieldsIndex.get(n);if(o==null)return i;const h=s.readAttribute(n);return h==null?"":ht(h,o)}))}constructor(e){super(),this._evaluator=e}resize(e){}read(e,t){return this._evaluator(e)}readWithDefault(e,t,r){const s=this._evaluator(e);return ae(s)?r:s}referencesScale(){return!1}referencesGeometry(){return!1}};class ct extends E{constructor(e,t){super(),this._field=e,this._normalizationInfo=t}resize(e){throw new Error("Method not implemented.")}read(e,t){return this._readNormalized(e)}readWithDefault(e,t){return this._readNormalized(e)}referencesScale(){return!1}referencesGeometry(){return!1}_readNormalized(e){const t=e.readAttribute(this._field);if(t==null)return null;const{normalizationField:r,normalizationTotal:s,normalizationType:i}=this._normalizationInfo,n=e.readAttribute(r);switch(i??"esriNormalizeByField"){case"esriNormalizeByField":return n?n?t/n:void 0:null;case"esriNormalizeByLog":return Math.log(t)*Math.LOG10E;case"esriNormalizeByPercentOfTotal":return s?t/s*100:null}}}let L=class B{static fromBuffer(e,t){return new B(e,t)}static create(e,t=4294967295){const r=new Uint32Array(Math.ceil(e/32));return new B(r,t)}constructor(e,t){this._mask=0,this._buf=e,this._mask=t}_getIndex(e){return Math.floor(e/32)}has(e){const t=this._mask&e;return!!(this._buf[this._getIndex(t)]&1<>>=1,s++}}countSet(){let e=0;return this.forEachSet(t=>{e++}),e}};const G=()=>S.getLogger("esri.views.2d.layers.features.support.whereUtils"),dt={getAttribute:(a,e)=>a.readAttribute(e)};async function ue(a,e){try{const t=await Me(a,e);if(!t.isStandardized){const r=new w("mapview - bad input","Unable to apply filter's definition expression, as expression is not standardized.",t);G().error(r)}return r=>{const s=r.readArcadeFeature();try{return t.testFeature(s,dt)}catch{return G().warn("mapview-bad-where-clause","Encountered an error when evaluating where clause",a),!0}}}catch{return G().warn("mapview-bad-where-clause","Encountered an error when evaluating where clause",a),r=>!0}}const re=()=>S.getLogger("esri.views.2d.layers.features.support.ComputedAttributeStorage"),x=4294967295;function $(a,e,t){if(!(a.length>e))for(;a.length<=e;)a.push(t)}let er=class{constructor(e){this._numerics=[],this._strings=[],this._allocatedSize=256,this._bitsets=[],this._instanceIds=[],this._bounds=[],this._dirtyBitset=this.getBitset(this.createBitset()),this.compilationOptions=e}createBitset(){const e=this._bitsets.length;return this._bitsets.push(L.create(this._allocatedSize,m)),e+1}async createComputedField(e,t=!1){if(e.expression)try{if(!this.compilationOptions)throw new Error("InternalError: Compilation options not defined");return t?ut.create(e.expression,this.compilationOptions):await ot.create(e.expression,this.compilationOptions)}catch(s){const i=new w("featurelayer","Failed to compile arcade expression",{error:s,expression:e.expression});return re().error(i),null}if(e.normalizationType||e.normalizationField)return new ct(e.field,e);if(e.field)return new at(e.field);const r=new w("featurelayer","Unable to create computed field. No expression or field found",{info:e});return re().error(r),null}async createWhereClause(e){return e?ue(e,this.compilationOptions.fields):null}getBitset(e){return this._bitsets[e-1]}getComputedNumeric(e,t){return this.getComputedNumericAtIndex(e&m,0)}setComputedNumeric(e,t,r){return this.setComputedNumericAtIndex(e&m,r,0)}getComputedString(e,t){return this.getComputedStringAtIndex(e&m,0)}setComputedString(e,t,r){return this.setComputedStringAtIndex(e&m,0,r)}getComputedNumericAtIndex(e,t){const r=e&m;return this._ensureNumeric(t,r),this._numerics[t][r]}setComputedNumericAtIndex(e,t,r){const s=e&m;this._ensureNumeric(t,s),this._numerics[t][s]=r}getPackedChunkId(e){const t=e&m;return this._ensureInstanceId(t),this._instanceIds[t]}setPackedChunkId(e,t){const r=e&m;this._ensureInstanceId(r),this._instanceIds[r]=t}getComputedStringAtIndex(e,t){const r=e&m;return this._ensureString(t,r),this._strings[t][r]}setComputedStringAtIndex(e,t,r){const s=e&m;this._ensureString(t,s),this._strings[t][s]=r}getXMin(e){return this._bounds[4*(e&m)]}getYMin(e){return this._bounds[4*(e&m)+1]}getXMax(e){return this._bounds[4*(e&m)+2]}getYMax(e){return this._bounds[4*(e&m)+3]}setBounds(e,t,r=!1){const s=e&m;if(!r&&!this._dirtyBitset.has(e))return this._bounds[4*s]!==x;this._dirtyBitset.unset(e);const i=t.readGeometryWorldSpace();if($(this._bounds,4*s+4,0),!i||!i.coords.length)return this._bounds[4*s]=x,this._bounds[4*s+1]=x,this._bounds[4*s+2]=x,this._bounds[4*s+3]=x,!1;let n=1/0,o=1/0,h=-1/0,d=-1/0;return i.forEachVertex((c,u)=>{n=Math.min(n,c),o=Math.min(o,u),h=Math.max(h,c),d=Math.max(d,u)}),this._bounds[4*s]=n,this._bounds[4*s+1]=o,this._bounds[4*s+2]=h,this._bounds[4*s+3]=d,!0}getBounds(e,t){const r=this.getXMin(t),s=this.getYMin(t),i=this.getXMax(t),n=this.getYMax(t);return j(e,r,s,i,n),r!==x}_ensureNumeric(e,t){this._numerics[e]||(this._numerics[e]=[]),$(this._numerics[e],t,0)}_ensureInstanceId(e){$(this._instanceIds,e,0)}_ensureString(e,t){this._strings[e]||(this._strings[e]=[]),$(this._strings[e],t,null)}},N=class{getObjectId(e){return e.getObjectId()}getAttributes(e){return e.readAttributes()}getAttribute(e,t){return e.readAttribute(t)}getAttributeAsTimestamp(e,t){return e.readAttributeAsTimestamp(t)}cloneWithGeometry(e,t){return e}getGeometry(e){return e.readGeometryWorldSpace()}getCentroid(e,t){return e.readCentroidForDisplay()}};N.Shared=new N;const v=1,lt=2;class U{constructor(e){this._geometryBounds=Fe(),this._idToVisibility=new Map,this._serviceInfo=e}static async create(e){const t=new U(e);return await t.update(e.filterJSON,e.spatialReference),t}get hash(){return this._hash}check(e){return this._applyFilter(e)}clear(){const e=this._resetAllHiddenIds();return this.update(),{show:e,hide:[]}}invalidate(){this._idToVisibility.forEach((e,t)=>{this._idToVisibility.set(t,0)})}setKnownIds(e){for(const t of e)this._idToVisibility.set(t,v)}setTrue(e){const t=[],r=[],s=new Set(e);return this._idToVisibility.forEach((i,n)=>{const o=!!(this._idToVisibility.get(n)&v),h=s.has(n);!o&&h?t.push(n):o&&!h&&r.push(n),this._idToVisibility.set(n,h?v|lt:0)}),{show:t,hide:r}}createQuery(){const{geometry:e,spatialRel:t,where:r,timeExtent:s,objectIds:i}=this;return ze.fromJSON({geometry:e,spatialRel:t,where:r,timeExtent:s,objectIds:i})}async update(e,t){this._hash=JSON.stringify(e);const r=await ke(e,null,t);await Promise.all([this._setGeometryFilter(r),this._setIdFilter(r),this._setAttributeFilter(r),this._setTimeFilter(r)])}async _setAttributeFilter(e){if(!(e!=null&&e.where))return this._clause=null,void(this.where=null);this._clause=await ue(e.where,this._serviceInfo.fieldsIndex),this.where=e.where}_setIdFilter(e){this._idsToShow=(e==null?void 0:e.objectIds)&&new Set(e.objectIds),this._idsToHide=(e==null?void 0:e.hiddenIds)&&new Set(e.hiddenIds),this.objectIds=e==null?void 0:e.objectIds}async _setGeometryFilter(e){if(!(e!=null&&e.geometry))return this._spatialQueryOperator=null,this.geometry=null,void(this.spatialRel=null);const t=e.geometry,r=e.spatialRel||"esriSpatialRelIntersects",s=await je(r,t,this._serviceInfo.geometryType,this._serviceInfo.hasZ,this._serviceInfo.hasM);$e(this._geometryBounds,t),this._spatialQueryOperator=s,this.geometry=t,this.spatialRel=r}_setTimeFilter(e){if(this.timeExtent=this._timeOperator=null,e==null?void 0:e.timeExtent)if(this._serviceInfo.timeInfo)this.timeExtent=e.timeExtent,this._timeOperator=Ne(this._serviceInfo.timeInfo,e.timeExtent,N.Shared);else{const t=new w("feature-layer-view:time-filter-not-available","Unable to apply time filter, as layer doesn't have time metadata.",e.timeExtent);S.getLogger("esri.views.2d.layers.features.controllers.FeatureFilter").error(t)}}_applyFilter(e){return this._filterByGeometry(e)&&this._filterById(e)&&this._filterByTime(e)&&this._filterByExpression(e)}_filterByExpression(e){return!this.where||this._clause(e)}_filterById(e){var t,r;return(!((t=this._idsToHide)!=null&&t.size)||!this._idsToHide.has(e.getObjectId()))&&(!((r=this._idsToShow)!=null&&r.size)||this._idsToShow.has(e.getObjectId()))}_filterByGeometry(e){if(!this.geometry)return!0;const t=e.readGeometryWorldSpace();return!!t&&this._spatialQueryOperator(t)}_filterByTime(e){return this._timeOperator==null||this._timeOperator(e)}_resetAllHiddenIds(){const e=[];return this._idToVisibility.forEach((t,r)=>{t&v||(this._idToVisibility.set(r,v),e.push(r))}),e}}class ft{constructor(e){this._options=e,this._fieldsIndex="fieldsIndex"in e?X.fromJSON(e.fieldsIndex):new X(e.fields),e.spatialReference&&(this._spatialReference=De.fromJSON(e.spatialReference)),this._arcadeSchema={fields:this.fieldsIndex.fields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,objectIdField:this.objectIdField,globalIdField:this._options.globalIdField,spatialReference:this._spatialReference,timeInfo:this._options.timeInfo,typeIdField:this._options.typeIdField??void 0,types:this._options.types??void 0,subtypeField:this._options.subtypeField,subtypes:this._options.subtypes??void 0}}get fieldsIndex(){return this._fieldsIndex}get geometryType(){return this._options.geometryType}get timeInfo(){return this._options.timeInfo}get objectIdField(){return this._options.objectIdField}get globalIdField(){return this._options.globalIdField}get arcadeSchema(){return this._arcadeSchema}get spatialReference(){return this._spatialReference}get timeReferenceUnknownClient(){return this._options.timeReferenceUnknownClient}}let sr=class ce extends ft{static create(e){return new ce({fields:[],objectIdField:"uid",geometryType:null,spatialReference:e,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:null,typeIdField:null,types:null,timeReferenceUnknownClient:null})}};class _t{constructor(e){this._valid=L.create(e),this._data=new Array(e)}has(e){return this._valid.has(e)}set(e,t){this._valid.set(e),this._data[e]=t}get(e){return this._data[e]}}const R=b("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],pt=R[0],mt=R[1],yt=R[2],gt=R[3],Y=b("featurelayer-simplify-payload-size-factors")??[1,2,4],bt=Y[0],xt=Y[1],It=Y[2],wt=b("featurelayer-simplify-mobile-factor")??2,St=b("esri-mobile"),se=4294967295;function Tt(a,e,t){if(!(a.length>e))for(;a.length<=e;)a.push(t)}class ir{constructor(e){this.metadata=e,this.type="FeatureSetReader",this._deleted=null,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._caches=new Map,this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}get isEmpty(){return this._deleted!=null&&this._deleted.countSet()===this.getSize()}getAreaSimplificationThreshold(e,t){let r=1;const s=St?wt:1;t>4e6?r=It*s:t>1e6?r=xt*s:t>5e5?r=bt*s:t>1e5&&(r=s);let i=0;return e>4e3?i=gt*r:e>2e3?i=yt*r:e>100?i=mt:e>15&&(i=pt),i}parseTimestampOffset(e){return e}getBounds(e){if(Tt(this._boundsBuffer,4*this.getIndex()+4,0),this.getBoundsXMin()===se)return!1;if(this.getBoundsXMin()===0){const n=this.readGeometryWorldSpace();if(!n)return this.setBoundsXMin(se),!1;let o=1/0,h=1/0,d=-1/0,c=-1/0;return n.forEachVertex((u,l)=>{o=Math.min(o,u),h=Math.min(h,l),d=Math.max(d,u),c=Math.max(c,l)}),this.setBoundsXMin(o),this.setBoundsYMin(h),this.setBoundsXMax(d),this.setBoundsYMax(c),j(e,o,h,d,c),!0}const t=this.getBoundsXMin(),r=this.getBoundsYMin(),s=this.getBoundsXMax(),i=this.getBoundsYMax();return j(e,t,r,s,i),!0}getBoundsXMin(){return this._boundsBuffer[4*this.getIndex()]}setBoundsXMin(e){this._boundsBuffer[4*this.getIndex()]=e}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(e){this._boundsBuffer[4*this.getIndex()+1]=e}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(e){this._boundsBuffer[4*this.getIndex()+2]=e}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(e){this._boundsBuffer[4*this.getIndex()+3]=e}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return typeof t=="string"?new Date(t).getTime():typeof t=="number"||t==null?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(r!==void 0)return r;for(const s of this._joined){s.setIndex(this.getIndex());const i=s._readAttribute(e,t);if(i!==void 0)return i}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const s of Object.keys(r))e[s]=r[s]}return e}joinAttributes(e){this._joined.push(e)}removeIds(e){if(this._objectIdToIndex==null){const r=new Map,s=this.getCursor();for(;s.next();){const i=s.getObjectId();Be(i),r.set(i,s.getIndex())}this._objectIdToIndex=r}const t=this._objectIdToIndex;for(const r of e.values())t.has(r)&&this._removeAtIndex(t.get(r))}readOptimizedFeatureWorldSpace(){const e=this.readGeometryWorldSpace(),t=this.readAttributes(),r=this.readCentroidWorldSpace(),s=new Le(e,t,r);return s.objectId=this.getObjectId(),s.displayId=this.getDisplayId(),s}readLegacyFeatureForDisplay(){const e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){const e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){const e=this.readGeometryForDisplay();return P(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const e=this._readX(),t=this.getInTransform();return t==null?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){const e=this._readY(),t=this.getInTransform();return t==null?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){const e=this._readGeometryDeltaDecoded(!0);if(!e){const t=this._createGeometryFromServerCentroid();return t?t.deltaDecode():null}return e}readGeometryWorldSpace(){let e=this._readGeometry();if(e||(e=this._createGeometryFromServerCentroid()),!e)return null;const t=e.clone(),r=this.getInTransform();return r!=null&&K(t,t,this.hasZ,this.hasM,r),t}readCentroidForDisplay(){const e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){const e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();if(!t)return null;const r=t.clone(),s=this.getInTransform();return s!=null&&K(r,r,this.hasZ,this.hasM,s),r}setCache(e){let t=this._caches.get(e);t==null&&(t=new _t(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}_readGeometryDeltaDecoded(e){const t=this._readGeometry(e);return this.geometryType!=="esriGeometryPoint"&&t&&this.getInTransform()?t.deltaDecode():t}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some(t=>t.hasField(e))}geometry(){const e=this.readGeometryWorldSpace(),t=P(e,this.geometryType,this.hasZ,this.hasM),r=Re(t);if(r){if(!this.metadata.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");r.spatialReference=this.metadata.spatialReference}return r}autocastArcadeDate(e,t){return t&&t instanceof Date?this.isUnknownDateTimeField(e)?M.unknownDateJSToArcadeDate(t):M.dateJSAndZoneToArcadeDate(t,this.contextTimeZone??Oe):t}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===Pe}field(e){let t=this.fields.get(e);if(t)switch(t.type){case"date-only":case"esriFieldTypeDateOnly":return q.fromReader(this.readAttribute(e,!1));case"time-only":case"esriFieldTypeTimeOnly":return J.fromReader(this.readAttribute(e,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return M.fromReaderAsTimeStampOffset(this.readAttribute(e,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(e,this.readAttribute(e,!0));default:return this.readAttribute(e,!1)}for(const r of this._joined)if(r.setIndex(this.getIndex()),t=r.fields.get(e),t)switch(t.type){case"date-only":case"esriFieldTypeDateOnly":return q.fromReader(r._readAttribute(e,!1));case"time-only":case"esriFieldTypeTimeOnly":return J.fromReader(r._readAttribute(e,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return M.fromReaderAsTimeStampOffset(r._readAttribute(e,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(e,r._readAttribute(e,!0));default:return this.readAttribute(e,!1)}throw new Error(`Field ${e} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map(e=>e.name)}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());const t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes??{}}};for(const s in r.attributes){const i=r.attributes[s];i instanceof Date&&(r.attributes[s]=i.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(e=null){var t;return{attributes:this._readAttributes(),geometry:(e==null?void 0:e.keepGeometryType)===!0?this.geometry():((t=this.geometry())==null?void 0:t.toJSON())??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}_getExists(){return this._deleted==null||!this._deleted.has(this.getIndex())}_computeDisplayCentroid(e){if(this.getInTransform()==null)return We(new F,e,this.hasM,this.hasZ);const t=ye.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=ge(t);return r?(r[1]*=-1,new F([],r)):null}copyInto(e){e._joined=this._joined,e._deleted=this._deleted,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone}_readLegacyGeometryWorldSpace(){const e=this.readGeometryWorldSpace();return P(e,this.geometryType,!1,!1)}_createGeometryFromServerCentroid(){const e=this._readServerCentroid();if(!e)return null;const[t,r]=e.coords;return this._createQuantizedExtrudedGeometry(t,r)}_createQuantizedExtrudedGeometry(e,t){return this.geometryType==="esriGeometryPolyline"?this._createQuantizedExtrudedLine(e,t):this._createQuantizedExtrudedQuad(e,t)}_createQuantizedExtrudedQuad(e,t){return new F([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createQuantizedExtrudedLine(e,t){return new F([2],[e-1,t+1,1,-1])}_removeAtIndex(e){this._deleted==null&&(this._deleted=L.create(this.getSize())),this._deleted.set(e)}}const vt=(a,e)=>a&&((...t)=>e.warn("DEBUG:",...t))||(()=>null),Et=!1;class At{constructor(e){this.data=e,this._referenceCount=0}increment(){this._referenceCount+=1}decrement(){this._referenceCount-=1}empty(){return this._referenceCount===0}}class Ct{constructor(){this._freeIdsGenerationA=[],this._freeIdsGenerationB=[],this._idCounter=1,this._freeIds=this._freeIdsGenerationA,this._objectIdToDisplayId=new Map}createIdForObjectId(e){let t=this._objectIdToDisplayId.get(e);return t?t.increment():(t=new At(be(this._getFreeId(),!1)),t.increment(),this._objectIdToDisplayId.set(e,t)),t.data}releaseIdForObjectId(e){const t=this._objectIdToDisplayId.get(e);t&&(t.decrement(),t.empty()&&(this._objectIdToDisplayId.delete(e),this._freeIds.push(t.data)))}releaseAll(){for(const e of this._objectIdToDisplayId.values())this._freeIds.push(e.data);this._objectIdToDisplayId.clear()}incrementGeneration(){this._freeIds=this._freeIds===this._freeIdsGenerationA?this._freeIdsGenerationB:this._freeIdsGenerationA}_getFreeId(){return this._freeIds.length?this._freeIds.pop():this._idCounter++}}function Mt(a,e){if(!a||!e)return a;switch(e){case"radius":case"distance":return 2*a;case"diameter":case"width":return a;case"area":return Math.sqrt(a)}return a}const Z=()=>S.getLogger("esri.views.layers.2d.features.support.AttributeStore"),k=vt(Et,Z()),Ft={sharedArrayBuffer:b("esri-shared-array-buffer"),atomics:b("esri-atomics")};class zt{constructor(e,t,r){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:s,layout:i,textureOnly:n}=t;this.textureOnly=n||!1,this.pixelType=s,this.layout=i,this._resetRange(),this.size=e,this.isLocal=r,n||(this.data=this._initData(s,e))}get buffer(){var e;return(e=this.data)==null?void 0:e.buffer}unsetComponentAllTexels(e,t){const r=this.data;for(let s=0;st)return null;this._resetRange();const s=!this.isLocal,i=this.pixelType,n=this.layout,o=this.data;return{start:e,end:t,data:s&&o.slice(e*r,(t+1)*r)||null,pixelType:i,layout:n}}_initData(e,t){const r=ArrayBuffer,s=_e(e),i=new s(new r(t*t*4*s.BYTES_PER_ELEMENT));for(let n=0;nnull)}get referencesScale(){return this._referencesScale}get referencesGeometry(){return this._referencesGeometry}get _signal(){return this._abortController.signal}get hasHighlight(){return this._idsToHighlight.size>0}createDisplayIdForObjectId(e){return this._idGenerator.createIdForObjectId(e)}releaseDisplayIdForObjectId(e){return this._idGenerator.releaseIdForObjectId(e)}incrementDisplayIdGeneration(){this._idGenerator.incrementGeneration()}releaseAllIds(){this._idGenerator.releaseAll()}async update(e,t,r,s,i=0){const n=Ue(this._schema,e);if(this.version=i,n&&(b("esri-2d-update-debug")&&console.debug(`Version[${i}] AttributeStore.update`,{changed:n}),this._schema=e,this._attributeComputeInfo=null,this._initialize(),e!=null))if(r&&(this._filters=await Promise.all(e.filters.map(o=>o?U.create({geometryType:r.geometryType,hasM:!1,hasZ:!1,timeInfo:r.timeInfo,fieldsIndex:r.fieldsIndex,spatialReference:s??r.spatialReference,filterJSON:o}):null))),e.type!=="subtype")this._attributeComputeInfo={isSubtype:!1,map:new Map},await Promise.all(e.bindings.map(async o=>{const h=await this._bind(t,o);this._referencesGeometry=this._referencesGeometry||((h==null?void 0:h.referencesGeometry())??!1),this._referencesScale=this._referencesScale||((h==null?void 0:h.referencesScale())??!1)}));else{this._attributeComputeInfo={isSubtype:!0,subtypeField:e.subtypeField,map:new Map},this._referencesScale=!1,this._referencesGeometry=!1;for(const o in e.bindings){const h=e.bindings[o];await Promise.all(h.map(async d=>{const c=await this._bind(t,d,parseInt(o,10));this._referencesGeometry=this._referencesGeometry||((c==null?void 0:c.referencesGeometry())??!1),this._referencesScale=this._referencesScale||((c==null?void 0:c.referencesScale())??!1)}))}}}setHighlight(e,t){const r=this._getBlock(0);r.unsetComponentAllTexels(0,(1<{var g;const u=c*n%o,l=Math.floor(c*n/o),y=this._getBlock(l+O.VV);let f=(g=d.field)==null?void 0:g.read(t,r);d.valueRepresentation&&(f=Mt(f,d.valueRepresentation)),(f===null||isNaN(f)||f===1/0||f===-1/0)&&(f=xe),y.setData(s,u,f)}))}get epoch(){return this._epoch}async sendUpdates(){const e=this._blocks.map(r=>r!=null?r.toMessage():null),t=this._getInitArgs();b("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.start"),await this._client.update({initArgs:t,blockData:e,version:this.version,sendUpdateEpoch:this._epoch},this._signal),this._epoch+=1,b("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.end")}_ensureSizeForTexel(e){for(;e>=this._size*this._size;)if(this._expand())return}async _bind(e,t,r){const s=await e.createComputedField(t),{valueRepresentation:i}=t,n=this._attributeComputeInfo;if(n.isSubtype){const o=n.map.get(r)??new Map;o.set(t.binding,{field:s,valueRepresentation:i}),n.map.set(r,o)}else n.map.set(t.binding,{field:s,valueRepresentation:i});return s}_getInitArgs(){return this._initialized?null:(this._initialized=!0,this._getBlock(O.Animation),this._getBlock(O.GPGPU),{blockSize:this._size,blockDescriptors:this._blocks.map(e=>e!=null?{textureOnly:e.textureOnly,buffer:e.buffer,pixelType:e.pixelType}:null)})}_getBlock(e){const t=this._blocks[e];if(t!=null)return t;k(`Initializing AttributeBlock at index ${e}`);const r=new zt(this._size,this._blockDescriptors[e],this._client.isLocal);return this._blocks[e]=r,this._initialized=!1,r}_expand(){if(this._size=this._buffer.length){const t=this._roundToNearest((this._array.byteLength+e*this._buffer.BYTES_PER_ELEMENT)*Ye,this._buffer.BYTES_PER_ELEMENT),r=new ArrayBuffer(t),s=new this._ctor(r);s.set(this._buffer,0),this._array=r,this._buffer=s,this._i16View=new Int16Array(this._array)}}ensureSize(e){this._ensureSize(e)}writeF32(e){this._ensureSize(1);const t=this._pos;return new Float32Array(this._array,4*this._pos,1)[0]=e,this._pos++,t}push(e){this._ensureSize(1);const t=this._pos;return this._buffer[this._pos++]=e,t}writeFixed(e){this._buffer[this._pos++]=e}setValue(e,t){this._buffer[e]=t}i1616Add(e,t,r){this._i16View[2*e]+=t,this._i16View[2*e+1]+=r}getValue(e){return this._buffer[e]}getValueF32(e){return new Float32Array(this._array,4*e,1)[0]}incr(e){if(this._buffer.lengthd.name==="pos"||d.name==="position");if(!h)throw new Error("InternalError: Unable to find position attribute");this.layout={...t,position:h},this._indices=new D(Uint32Array,i),this._vertices=new D(Uint32Array,n),this._metrics=new D(Uint32Array,0),this._metricCountOffset=this._metrics.push(0),this._strideInt=o,this._instanceId=e}serialize(e){const t=this._indices.buffer(),r=this._vertices.buffer(),s=this._metrics.length?this._metrics.buffer():null;return e.push(t,r),{instanceId:this._instanceId,layout:this.layout,indices:t,vertices:r,metrics:s}}get strideInt(){return this._strideInt}get vertexCount(){return this._vertices.length/this._strideInt}get indexCount(){return this._indices.length}get indexWriter(){return this._indices}get vertexWriter(){return this._vertices}get metricWriter(){return this._metrics}vertexEnsureSize(e){this._vertices.ensureSize(e)}indexEnsureSize(e){this._indices.ensureSize(e)}writeIndex(e){this._indices.push(e)}writeVertex(e){this._vertices.push(e)}writeVertexRegion(e){this._vertices.writeRegion(e)}writeVertexF32(e){this._vertices.writeF32(e)}writeMetric(e){this._metrics.incr(this._metricCountOffset),e.serialize(this._metrics)}},Ut=class{constructor(e,t=0){this._id=e,this._sizeHint=t,this._entityRecordCountOffset=0,this._entityCountOffset=0,this._entityIdIndex=0,this._entitySortKeyIndex=0,this._instanceIdToVertexData=new Map,this._recordIndexStart=0,this._recordIndexCount=0,this._recordVertexStart=0,this._recordVertexCount=0,this._current={metric:null,writer:null,start:0,sortKey:0,instanceId:0,layoutHash:0,indexStart:0,vertexStart:0,textureKey:0,metricBoxLenPointer:0},this._entities=new D(Uint32Array,this._sizeHint*de.byteSizeHint),this._entityCountOffset=this._entities.push(0)}get id(){return this._id}serialize(){const e=new Array,t=[],r=this._entities.buffer();for(const s of this._instanceIdToVertexData.values())t.push(s.serialize(e));return{message:{data:t,entities:r},transferList:e}}vertexCount(){var e;return((e=this._current.writer)==null?void 0:e.vertexCount)??0}indexCount(){var e;return((e=this._current.writer)==null?void 0:e.indexCount)??0}vertexEnsureSize(e){this._current.writer.vertexEnsureSize(e)}indexEnsureSize(e){this._current.writer.indexEnsureSize(e)}vertexWrite(e){this._current.writer.writeVertex(e)}vertexWriteRegion(e){this._current.writer.writeVertexRegion(e)}vertexWriteF32(e){this._current.writer.writeVertexF32(e)}recordBounds(e,t,r,s){}indexWrite(e){this._current.writer.writeIndex(e)}metricStart(e){this._current.metric=e}metricEnd(){const e=this._current.writer;this._current.metric.bounds.length&&e.writeMetric(this._current.metric)}metricBoxWrite(e){this._current.metric.bounds.push(e)}entityStart(e,t=e){this._entityIdIndex=this._entities.push(e),this._entitySortKeyIndex=this._entities.writeF32(t),this._entityRecordCountOffset=this._entities.push(0)}entityRecordCount(){return this._entities.getValue(this._entityRecordCountOffset)}entityEnd(){this.entityRecordCount()===0?this._entities.seek(this._entityIdIndex):this._entities.incr(this._entityCountOffset)}recordCount(){return this._entities.getValue(this._entityRecordCountOffset)}recordStart(e,t,r=0){this._current.writer=this._getVertexWriter(e,t),this._current.indexStart=this._current.writer.indexCount,this._current.vertexStart=this._current.writer.vertexCount,this._current.instanceId=e,this._current.layoutHash=t.hash,this._current.textureKey=r}recordEnd(e=0){const t=this._current.vertexStart,r=this._current.writer.vertexCount-t;if(!r)return!1;const s=this._current.indexStart,i=this._current.writer.indexCount-s;return this._recordIndexStart=s,this._recordIndexCount=i,this._recordVertexStart=t,this._recordVertexCount=r,this._entities.incr(this._entityRecordCountOffset),H.write(this._entities,this._current.instanceId,this._current.textureKey,s,i,t,r,e),!0}copyLast(e,t){const r=this._recordVertexStart+this._recordVertexCount;this._entities.incr(this._entityRecordCountOffset),H.write(this._entities,this._current.instanceId,this._current.textureKey,this._recordIndexStart+this._recordIndexCount,this._recordIndexCount,r,this._recordVertexCount,0);const s=this._current.writer.indexWriter,i=this._current.writer.vertexWriter,n=this._recordIndexStart+this._recordIndexCount,o=this._recordVertexCount;for(let p=this._recordIndexStart;p!==n;p++){const _=s.getValue(p);s.push(_+o)}const h=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,d=this._recordVertexStart*h,c=(this._recordVertexStart+this._recordVertexCount)*h;for(let p=d;p!==c;p++){const _=i.getValue(p);i.push(_)}const u=this._current.writer.layout.position,l=u.packPrecisionFactor??1,y=u.offset/Uint32Array.BYTES_PER_ELEMENT,f=e*l,g=t*l;for(let p=r*h;p<=i.length;p+=h)i.i1616Add(p+y,f,g);this.recordEnd()}copyLastFrom(e,t,r){const s=e._entities.getValue(e._entityIdIndex);if(s!==this._entities.getValue(this._entityIdIndex)){const _=e._entities.getValueF32(e._entitySortKeyIndex);this.entityStart(s,_)}this.recordStart(e._current.instanceId,e._current.writer.layout,e._current.textureKey);const i=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,n=this._current.vertexStart,o=e._current.vertexStart-n,h=this._current.writer.indexWriter,d=this._current.writer.vertexWriter,c=e._current.writer.indexWriter,u=e._current.writer.vertexWriter;for(let _=e._current.indexStart;_!==c.length;_++){const T=c.getValue(_);h.push(T-o)}for(let _=e._current.vertexStart*i;_!==u.length;_++){const T=u.getValue(_);d.push(T)}const l=this._current.writer.layout.position,y=l.packPrecisionFactor??1,f=l.offset/Uint32Array.BYTES_PER_ELEMENT,g=t*y,p=r*y;for(let _=n*i;_<=d.length;_+=i)d.i1616Add(_+f,g,p);this.recordEnd()}_getVertexWriter(e,t){const{stride:r}=t,s=this._instanceIdToVertexData;return s.has(e)||s.set(e,new Xe(e,t,r,this._sizeHint)),s.get(e)}};function Je(a,e){let t;if(typeof a=="string")t=W(a+`-seed(${e})`);else{let r=12;t=a^e;do t=107*(t>>8^t)+r|0;while(--r!=0)}return(1+t/(1<<31))/2}function qe(a){return Math.floor(Je(a,Ke)*Qe)}const Ke=53290320,Qe=10;let E=class{destroy(){}},et=class extends E{constructor(e){super(),this._value=e}resize(e){}read(e,t){return this._value}readWithDefault(e,t,r){return this._value}referencesScale(){return!1}referencesGeometry(){return!1}};const tt=()=>S.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.mesh.MeshWriterInputEvaluator");async function z(a,e,t=!1){const{defaultValue:r,valueExpressionInfo:s,value:i}=e;if(s){const{expression:n}=s,o=await a.createComputedField({expression:n},t);return o?{...e,computed:o,defaultValue:r}:null}return{...e,computed:new et(i),defaultValue:r}}async function Q(a,e){const{defaultValue:t,valueExpressionInfo:r}=e,{expression:s}=r,i=await a.createComputedField({expression:s});return i?{...e,computed:i,defaultValue:t}:null}const ie=a=>typeof a!="boolean"&&typeof a!="number"&&"valueExpressionInfo"in a,rt=a=>a.some(e=>{for(const t in e){const r=e[t];if(ie(r))return!0}return!1});let st=class ne{static async create(e,t,r){const s={},i=new Map,n=new Map,o=new Map,h=new Map,d=new Map;for(const c in r.params){const u=r.params[c];if(u!=null&&typeof u=="object")if(Array.isArray(u)){if(typeof u[0]=="object")throw new Error(`InternalError: Cannot handle ${c}. Nested array params are not supported`);s[c]=u}else if("valueExpressionInfo"in u){if(u.value){s[c]=u.value;continue}const l=await Q(e,u);if(!l){s[c]=u.defaultValue;continue}i.set(c,l),s[c]=null}else switch(u.type){case"cim-effect-infos":if(u.effectInfos.some(l=>l.overrides.length)){n.set(c,{effects:await Promise.all(u.effectInfos.map(async l=>{const y=l.overrides.map(f=>z(e,f));return{effect:l.effect,compiledOverrides:(await Promise.all(y)).filter(A)}}))});break}s[c]=u.effectInfos.map(l=>l.effect);break;case"cim-marker-placement-info":u.overrides.length&&o.set(c,{placementInfo:u,compiledOverrides:(await Promise.all(u.overrides.map(l=>z(e,l)))).filter(A)}),s[c]=u.placement;break;case"text-rasterization-param":{if(u.overrides.length){const y=u.overrides.map(f=>z(e,f,u.useLegacyLabelEvaluationRules));h.set(c,{compiledOverrides:(await Promise.all(y)).filter(A),rasterizationParam:u,objectIdToResourceId:new Map});continue}const l={type:"cim-rasterization-info",resource:u.resource};s[c]=await t.fetchResourceImmediate(l)??null;break}case"sprite-rasterization-param":{if(u.overrides.length){const y=u.overrides.map(f=>z(e,f));h.set(c,{compiledOverrides:(await Promise.all(y)).filter(A),rasterizationParam:u,objectIdToResourceId:new Map});continue}if(u.resource.type==="animated"){h.set(c,{compiledOverrides:[],rasterizationParam:u,objectIdToResourceId:new Map});continue}const l={type:"cim-rasterization-info",resource:u.resource};s[c]=await t.fetchResourceImmediate(l)??null;break}case"cim-marker-transform-param":{const{params:l}=u;if(rt(l)){const y={compiledMarkerInfos:[]};await Promise.all(l.map(async f=>{const g={props:{}};for(const p in f)if(ie(f[p])){const _=await Q(e,f[p]);g.compiledExpressionMap||(g.compiledExpressionMap=new Map);const T=g.compiledExpressionMap;_&&T.set(p,_)}else g.props[p]=f[p];y.compiledMarkerInfos.push(g)})),d.set(c,y)}else s[c]={type:"cim-marker-transform-info",infos:l};break}default:s[c]=u}else s[c]=u}return new ne(r,s,i,n,o,h,d)}constructor(e,t,r,s,i,n,o){this.inputMeshParams=e,this._resolvedMeshParams=t,this._dynamicProperties=r,this._dynamicEffectProperties=s,this._dynamicPlacementProperties=i,this._dynamicAsyncProperties=n,this._dynamicTransformProperties=o,this.evaluator=h=>h}get hasDynamicProperties(){return!!(this._dynamicProperties.size||this._dynamicAsyncProperties.size||this._dynamicEffectProperties.size||this._dynamicTransformProperties.size||this._dynamicPlacementProperties.size)}get evaluatedMeshParams(){return this._evaluatedMeshParams||(this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams)),this._evaluatedMeshParams}enqueueRequest(e,t,r){for(const s of this._dynamicAsyncProperties.values()){const i=Ie(s.rasterizationParam.resource);s.rasterizationParam.resource.type==="animated"&&s.rasterizationParam.resource.randomizeStartTime&&(i.primitiveName="__RESERVED__PRIMITIVE__NAME__",i.startGroup=qe(t.getObjectId()||0));for(const{primitiveName:o,propertyName:h,computed:d,defaultValue:c,valueExpressionInfo:u}of s.compiledOverrides)try{const l=s.rasterizationParam.resource.type==="animated"?i.primitiveName:o;le(i,l,h,d,t,r,c)}catch(l){tt().errorOnce(new w("invalid-arcade-expression",`Encountered an error when evaluating the arcade expression '${u==null?void 0:u.expression}' (primitive: '${o}', property: '${h}')`,l))}const n=e.enqueueRequest({type:"cim-rasterization-info",resource:i});s.objectIdToResourceId.set(t.getObjectId(),n)}}evaluateMeshParams(e,t,r){for(const[s,i]of this._dynamicProperties.entries())this._resolvedMeshParams[s]=i.computed.readWithDefault(t,r,i.defaultValue);for(const[s,i]of this._dynamicPlacementProperties.entries())for(const{computed:n,defaultValue:o,propertyName:h}of i.compiledOverrides){const d=n.readWithDefault(t,r,o);i.placementInfo.placement[h]=d,this._resolvedMeshParams[s]=i.placementInfo.placement}for(const[s,i]of this._dynamicEffectProperties.entries())for(const n of i.effects){for(const{computed:o,defaultValue:h,propertyName:d}of n.compiledOverrides){const c=o.readWithDefault(t,r,h);n.effect[d]=c}this._resolvedMeshParams[s]=i.effects.map(o=>o.effect)}for(const[s,i]of this._dynamicTransformProperties.entries()){const n={type:"cim-marker-transform-info",infos:[]};for(const o of i.compiledMarkerInfos){const h={...o.props};if(o.compiledExpressionMap)for(const[d,c]of o.compiledExpressionMap){const u=c.computed.readWithDefault(t,r,c.defaultValue);h[d]=typeof u=="number"||typeof u=="boolean"?u:c.defaultValue}n.infos.push(h)}this._resolvedMeshParams[s]=n}for(const[s,i]of this._dynamicAsyncProperties.entries()){const n=i.objectIdToResourceId.get(t.getObjectId());if(n==null)continue;const o=e.getResource(n);this._resolvedMeshParams[s]=o}return this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams),this.evaluatedMeshParams}};async function it(a,e,t,r,s,i,n){const o=pe[t],h=await st.create(a,e,s),d=new o.constructor(r,h,i,n);return await d.loadDependencies(),d}async function Xt(a,e,t,r){return Promise.all(t.map(s=>it(a,e,s.meshWriterName,me(s.id),s.options,r,s.optionalAttributes)))}let nt=class{},qt=class extends nt{constructor(e){super(),this._fetcher=e,this._controller=new AbortController,this._pendingIds=new Set,this._pendingRequests=[],this._resourceIdToResource=new Map}destory(){this._controller.abort()}get _abortOptions(){return{signal:this._controller.signal}}enqueueRequest(e){const t=fe(e.resource),r=W(JSON.stringify(t));return this._pendingIds.has(r)||(this._pendingIds.add(r),this._pendingRequests.push({...e,resourceId:r})),r}async fetchEnqueuedResources(){const e=this._pendingRequests;this._pendingIds.clear(),this._pendingRequests=[];const t=await this._fetcher.fetch(e,this._abortOptions);for(let r=0;rr.replaceAll(/{[^}]*}/g,i=>{const n=i.slice(1,-1),o=s.metadata.fieldsIndex.get(n);if(o==null)return i;const h=s.readAttribute(n);return h==null?"":ht(h,o)}))}constructor(e){super(),this._evaluator=e}resize(e){}read(e,t){return this._evaluator(e)}readWithDefault(e,t,r){const s=this._evaluator(e);return ae(s)?r:s}referencesScale(){return!1}referencesGeometry(){return!1}};class ct extends E{constructor(e,t){super(),this._field=e,this._normalizationInfo=t}resize(e){throw new Error("Method not implemented.")}read(e,t){return this._readNormalized(e)}readWithDefault(e,t){return this._readNormalized(e)}referencesScale(){return!1}referencesGeometry(){return!1}_readNormalized(e){const t=e.readAttribute(this._field);if(t==null)return null;const{normalizationField:r,normalizationTotal:s,normalizationType:i}=this._normalizationInfo,n=e.readAttribute(r);switch(i??"esriNormalizeByField"){case"esriNormalizeByField":return n?n?t/n:void 0:null;case"esriNormalizeByLog":return Math.log(t)*Math.LOG10E;case"esriNormalizeByPercentOfTotal":return s?t/s*100:null}}}let L=class B{static fromBuffer(e,t){return new B(e,t)}static create(e,t=4294967295){const r=new Uint32Array(Math.ceil(e/32));return new B(r,t)}constructor(e,t){this._mask=0,this._buf=e,this._mask=t}_getIndex(e){return Math.floor(e/32)}has(e){const t=this._mask&e;return!!(this._buf[this._getIndex(t)]&1<>>=1,s++}}countSet(){let e=0;return this.forEachSet(t=>{e++}),e}};const G=()=>S.getLogger("esri.views.2d.layers.features.support.whereUtils"),dt={getAttribute:(a,e)=>a.readAttribute(e)};async function ue(a,e){try{const t=await Me(a,e);if(!t.isStandardized){const r=new w("mapview - bad input","Unable to apply filter's definition expression, as expression is not standardized.",t);G().error(r)}return r=>{const s=r.readArcadeFeature();try{return t.testFeature(s,dt)}catch{return G().warn("mapview-bad-where-clause","Encountered an error when evaluating where clause",a),!0}}}catch{return G().warn("mapview-bad-where-clause","Encountered an error when evaluating where clause",a),r=>!0}}const re=()=>S.getLogger("esri.views.2d.layers.features.support.ComputedAttributeStorage"),x=4294967295;function $(a,e,t){if(!(a.length>e))for(;a.length<=e;)a.push(t)}let er=class{constructor(e){this._numerics=[],this._strings=[],this._allocatedSize=256,this._bitsets=[],this._instanceIds=[],this._bounds=[],this._dirtyBitset=this.getBitset(this.createBitset()),this.compilationOptions=e}createBitset(){const e=this._bitsets.length;return this._bitsets.push(L.create(this._allocatedSize,m)),e+1}async createComputedField(e,t=!1){if(e.expression)try{if(!this.compilationOptions)throw new Error("InternalError: Compilation options not defined");return t?ut.create(e.expression,this.compilationOptions):await ot.create(e.expression,this.compilationOptions)}catch(s){const i=new w("featurelayer","Failed to compile arcade expression",{error:s,expression:e.expression});return re().error(i),null}if(e.normalizationType||e.normalizationField)return new ct(e.field,e);if(e.field)return new at(e.field);const r=new w("featurelayer","Unable to create computed field. No expression or field found",{info:e});return re().error(r),null}async createWhereClause(e){return e?ue(e,this.compilationOptions.fields):null}getBitset(e){return this._bitsets[e-1]}getComputedNumeric(e,t){return this.getComputedNumericAtIndex(e&m,0)}setComputedNumeric(e,t,r){return this.setComputedNumericAtIndex(e&m,r,0)}getComputedString(e,t){return this.getComputedStringAtIndex(e&m,0)}setComputedString(e,t,r){return this.setComputedStringAtIndex(e&m,0,r)}getComputedNumericAtIndex(e,t){const r=e&m;return this._ensureNumeric(t,r),this._numerics[t][r]}setComputedNumericAtIndex(e,t,r){const s=e&m;this._ensureNumeric(t,s),this._numerics[t][s]=r}getPackedChunkId(e){const t=e&m;return this._ensureInstanceId(t),this._instanceIds[t]}setPackedChunkId(e,t){const r=e&m;this._ensureInstanceId(r),this._instanceIds[r]=t}getComputedStringAtIndex(e,t){const r=e&m;return this._ensureString(t,r),this._strings[t][r]}setComputedStringAtIndex(e,t,r){const s=e&m;this._ensureString(t,s),this._strings[t][s]=r}getXMin(e){return this._bounds[4*(e&m)]}getYMin(e){return this._bounds[4*(e&m)+1]}getXMax(e){return this._bounds[4*(e&m)+2]}getYMax(e){return this._bounds[4*(e&m)+3]}setBounds(e,t,r=!1){const s=e&m;if(!r&&!this._dirtyBitset.has(e))return this._bounds[4*s]!==x;this._dirtyBitset.unset(e);const i=t.readGeometryWorldSpace();if($(this._bounds,4*s+4,0),!i||!i.coords.length)return this._bounds[4*s]=x,this._bounds[4*s+1]=x,this._bounds[4*s+2]=x,this._bounds[4*s+3]=x,!1;let n=1/0,o=1/0,h=-1/0,d=-1/0;return i.forEachVertex((c,u)=>{n=Math.min(n,c),o=Math.min(o,u),h=Math.max(h,c),d=Math.max(d,u)}),this._bounds[4*s]=n,this._bounds[4*s+1]=o,this._bounds[4*s+2]=h,this._bounds[4*s+3]=d,!0}getBounds(e,t){const r=this.getXMin(t),s=this.getYMin(t),i=this.getXMax(t),n=this.getYMax(t);return j(e,r,s,i,n),r!==x}_ensureNumeric(e,t){this._numerics[e]||(this._numerics[e]=[]),$(this._numerics[e],t,0)}_ensureInstanceId(e){$(this._instanceIds,e,0)}_ensureString(e,t){this._strings[e]||(this._strings[e]=[]),$(this._strings[e],t,null)}},N=class{getObjectId(e){return e.getObjectId()}getAttributes(e){return e.readAttributes()}getAttribute(e,t){return e.readAttribute(t)}getAttributeAsTimestamp(e,t){return e.readAttributeAsTimestamp(t)}cloneWithGeometry(e,t){return e}getGeometry(e){return e.readGeometryWorldSpace()}getCentroid(e,t){return e.readCentroidForDisplay()}};N.Shared=new N;const v=1,lt=2;class U{constructor(e){this._geometryBounds=Fe(),this._idToVisibility=new Map,this._serviceInfo=e}static async create(e){const t=new U(e);return await t.update(e.filterJSON,e.spatialReference),t}get hash(){return this._hash}check(e){return this._applyFilter(e)}clear(){const e=this._resetAllHiddenIds();return this.update(),{show:e,hide:[]}}invalidate(){this._idToVisibility.forEach((e,t)=>{this._idToVisibility.set(t,0)})}setKnownIds(e){for(const t of e)this._idToVisibility.set(t,v)}setTrue(e){const t=[],r=[],s=new Set(e);return this._idToVisibility.forEach((i,n)=>{const o=!!(this._idToVisibility.get(n)&v),h=s.has(n);!o&&h?t.push(n):o&&!h&&r.push(n),this._idToVisibility.set(n,h?v|lt:0)}),{show:t,hide:r}}createQuery(){const{geometry:e,spatialRel:t,where:r,timeExtent:s,objectIds:i}=this;return ze.fromJSON({geometry:e,spatialRel:t,where:r,timeExtent:s,objectIds:i})}async update(e,t){this._hash=JSON.stringify(e);const r=await ke(e,null,t);await Promise.all([this._setGeometryFilter(r),this._setIdFilter(r),this._setAttributeFilter(r),this._setTimeFilter(r)])}async _setAttributeFilter(e){if(!(e!=null&&e.where))return this._clause=null,void(this.where=null);this._clause=await ue(e.where,this._serviceInfo.fieldsIndex),this.where=e.where}_setIdFilter(e){this._idsToShow=(e==null?void 0:e.objectIds)&&new Set(e.objectIds),this._idsToHide=(e==null?void 0:e.hiddenIds)&&new Set(e.hiddenIds),this.objectIds=e==null?void 0:e.objectIds}async _setGeometryFilter(e){if(!(e!=null&&e.geometry))return this._spatialQueryOperator=null,this.geometry=null,void(this.spatialRel=null);const t=e.geometry,r=e.spatialRel||"esriSpatialRelIntersects",s=await je(r,t,this._serviceInfo.geometryType,this._serviceInfo.hasZ,this._serviceInfo.hasM);$e(this._geometryBounds,t),this._spatialQueryOperator=s,this.geometry=t,this.spatialRel=r}_setTimeFilter(e){if(this.timeExtent=this._timeOperator=null,e==null?void 0:e.timeExtent)if(this._serviceInfo.timeInfo)this.timeExtent=e.timeExtent,this._timeOperator=Ne(this._serviceInfo.timeInfo,e.timeExtent,N.Shared);else{const t=new w("feature-layer-view:time-filter-not-available","Unable to apply time filter, as layer doesn't have time metadata.",e.timeExtent);S.getLogger("esri.views.2d.layers.features.controllers.FeatureFilter").error(t)}}_applyFilter(e){return this._filterByGeometry(e)&&this._filterById(e)&&this._filterByTime(e)&&this._filterByExpression(e)}_filterByExpression(e){return!this.where||this._clause(e)}_filterById(e){var t,r;return(!((t=this._idsToHide)!=null&&t.size)||!this._idsToHide.has(e.getObjectId()))&&(!((r=this._idsToShow)!=null&&r.size)||this._idsToShow.has(e.getObjectId()))}_filterByGeometry(e){if(!this.geometry)return!0;const t=e.readGeometryWorldSpace();return!!t&&this._spatialQueryOperator(t)}_filterByTime(e){return this._timeOperator==null||this._timeOperator(e)}_resetAllHiddenIds(){const e=[];return this._idToVisibility.forEach((t,r)=>{t&v||(this._idToVisibility.set(r,v),e.push(r))}),e}}class ft{constructor(e){this._options=e,this._fieldsIndex="fieldsIndex"in e?X.fromJSON(e.fieldsIndex):new X(e.fields),e.spatialReference&&(this._spatialReference=De.fromJSON(e.spatialReference)),this._arcadeSchema={fields:this.fieldsIndex.fields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,objectIdField:this.objectIdField,globalIdField:this._options.globalIdField,spatialReference:this._spatialReference,timeInfo:this._options.timeInfo,typeIdField:this._options.typeIdField??void 0,types:this._options.types??void 0,subtypeField:this._options.subtypeField,subtypes:this._options.subtypes??void 0}}get fieldsIndex(){return this._fieldsIndex}get geometryType(){return this._options.geometryType}get timeInfo(){return this._options.timeInfo}get objectIdField(){return this._options.objectIdField}get globalIdField(){return this._options.globalIdField}get arcadeSchema(){return this._arcadeSchema}get spatialReference(){return this._spatialReference}get timeReferenceUnknownClient(){return this._options.timeReferenceUnknownClient}}let sr=class ce extends ft{static create(e){return new ce({fields:[],objectIdField:"uid",geometryType:null,spatialReference:e,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:null,typeIdField:null,types:null,timeReferenceUnknownClient:null})}};class _t{constructor(e){this._valid=L.create(e),this._data=new Array(e)}has(e){return this._valid.has(e)}set(e,t){this._valid.set(e),this._data[e]=t}get(e){return this._data[e]}}const R=b("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],pt=R[0],mt=R[1],yt=R[2],gt=R[3],Y=b("featurelayer-simplify-payload-size-factors")??[1,2,4],bt=Y[0],xt=Y[1],It=Y[2],wt=b("featurelayer-simplify-mobile-factor")??2,St=b("esri-mobile"),se=4294967295;function Tt(a,e,t){if(!(a.length>e))for(;a.length<=e;)a.push(t)}class ir{constructor(e){this.metadata=e,this.type="FeatureSetReader",this._deleted=null,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._caches=new Map,this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}get isEmpty(){return this._deleted!=null&&this._deleted.countSet()===this.getSize()}getAreaSimplificationThreshold(e,t){let r=1;const s=St?wt:1;t>4e6?r=It*s:t>1e6?r=xt*s:t>5e5?r=bt*s:t>1e5&&(r=s);let i=0;return e>4e3?i=gt*r:e>2e3?i=yt*r:e>100?i=mt:e>15&&(i=pt),i}parseTimestampOffset(e){return e}getBounds(e){if(Tt(this._boundsBuffer,4*this.getIndex()+4,0),this.getBoundsXMin()===se)return!1;if(this.getBoundsXMin()===0){const n=this.readGeometryWorldSpace();if(!n)return this.setBoundsXMin(se),!1;let o=1/0,h=1/0,d=-1/0,c=-1/0;return n.forEachVertex((u,l)=>{o=Math.min(o,u),h=Math.min(h,l),d=Math.max(d,u),c=Math.max(c,l)}),this.setBoundsXMin(o),this.setBoundsYMin(h),this.setBoundsXMax(d),this.setBoundsYMax(c),j(e,o,h,d,c),!0}const t=this.getBoundsXMin(),r=this.getBoundsYMin(),s=this.getBoundsXMax(),i=this.getBoundsYMax();return j(e,t,r,s,i),!0}getBoundsXMin(){return this._boundsBuffer[4*this.getIndex()]}setBoundsXMin(e){this._boundsBuffer[4*this.getIndex()]=e}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(e){this._boundsBuffer[4*this.getIndex()+1]=e}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(e){this._boundsBuffer[4*this.getIndex()+2]=e}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(e){this._boundsBuffer[4*this.getIndex()+3]=e}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return typeof t=="string"?new Date(t).getTime():typeof t=="number"||t==null?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(r!==void 0)return r;for(const s of this._joined){s.setIndex(this.getIndex());const i=s._readAttribute(e,t);if(i!==void 0)return i}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const s of Object.keys(r))e[s]=r[s]}return e}joinAttributes(e){this._joined.push(e)}removeIds(e){if(this._objectIdToIndex==null){const r=new Map,s=this.getCursor();for(;s.next();){const i=s.getObjectId();Be(i),r.set(i,s.getIndex())}this._objectIdToIndex=r}const t=this._objectIdToIndex;for(const r of e.values())t.has(r)&&this._removeAtIndex(t.get(r))}readOptimizedFeatureWorldSpace(){const e=this.readGeometryWorldSpace(),t=this.readAttributes(),r=this.readCentroidWorldSpace(),s=new Le(e,t,r);return s.objectId=this.getObjectId(),s.displayId=this.getDisplayId(),s}readLegacyFeatureForDisplay(){const e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){const e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){const e=this.readGeometryForDisplay();return P(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const e=this._readX(),t=this.getInTransform();return t==null?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){const e=this._readY(),t=this.getInTransform();return t==null?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){const e=this._readGeometryDeltaDecoded(!0);if(!e){const t=this._createGeometryFromServerCentroid();return t?t.deltaDecode():null}return e}readGeometryWorldSpace(){let e=this._readGeometry();if(e||(e=this._createGeometryFromServerCentroid()),!e)return null;const t=e.clone(),r=this.getInTransform();return r!=null&&K(t,t,this.hasZ,this.hasM,r),t}readCentroidForDisplay(){const e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){const e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();if(!t)return null;const r=t.clone(),s=this.getInTransform();return s!=null&&K(r,r,this.hasZ,this.hasM,s),r}setCache(e){let t=this._caches.get(e);t==null&&(t=new _t(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}_readGeometryDeltaDecoded(e){const t=this._readGeometry(e);return this.geometryType!=="esriGeometryPoint"&&t&&this.getInTransform()?t.deltaDecode():t}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some(t=>t.hasField(e))}geometry(){const e=this.readGeometryWorldSpace(),t=P(e,this.geometryType,this.hasZ,this.hasM),r=Re(t);if(r){if(!this.metadata.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");r.spatialReference=this.metadata.spatialReference}return r}autocastArcadeDate(e,t){return t&&t instanceof Date?this.isUnknownDateTimeField(e)?M.unknownDateJSToArcadeDate(t):M.dateJSAndZoneToArcadeDate(t,this.contextTimeZone??Oe):t}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===Pe}field(e){let t=this.fields.get(e);if(t)switch(t.type){case"date-only":case"esriFieldTypeDateOnly":return q.fromReader(this.readAttribute(e,!1));case"time-only":case"esriFieldTypeTimeOnly":return J.fromReader(this.readAttribute(e,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return M.fromReaderAsTimeStampOffset(this.readAttribute(e,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(e,this.readAttribute(e,!0));default:return this.readAttribute(e,!1)}for(const r of this._joined)if(r.setIndex(this.getIndex()),t=r.fields.get(e),t)switch(t.type){case"date-only":case"esriFieldTypeDateOnly":return q.fromReader(r._readAttribute(e,!1));case"time-only":case"esriFieldTypeTimeOnly":return J.fromReader(r._readAttribute(e,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return M.fromReaderAsTimeStampOffset(r._readAttribute(e,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(e,r._readAttribute(e,!0));default:return this.readAttribute(e,!1)}throw new Error(`Field ${e} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map(e=>e.name)}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());const t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes??{}}};for(const s in r.attributes){const i=r.attributes[s];i instanceof Date&&(r.attributes[s]=i.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(e=null){var t;return{attributes:this._readAttributes(),geometry:(e==null?void 0:e.keepGeometryType)===!0?this.geometry():((t=this.geometry())==null?void 0:t.toJSON())??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}_getExists(){return this._deleted==null||!this._deleted.has(this.getIndex())}_computeDisplayCentroid(e){if(this.getInTransform()==null)return We(new F,e,this.hasM,this.hasZ);const t=ye.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=ge(t);return r?(r[1]*=-1,new F([],r)):null}copyInto(e){e._joined=this._joined,e._deleted=this._deleted,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone}_readLegacyGeometryWorldSpace(){const e=this.readGeometryWorldSpace();return P(e,this.geometryType,!1,!1)}_createGeometryFromServerCentroid(){const e=this._readServerCentroid();if(!e)return null;const[t,r]=e.coords;return this._createQuantizedExtrudedGeometry(t,r)}_createQuantizedExtrudedGeometry(e,t){return this.geometryType==="esriGeometryPolyline"?this._createQuantizedExtrudedLine(e,t):this._createQuantizedExtrudedQuad(e,t)}_createQuantizedExtrudedQuad(e,t){return new F([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createQuantizedExtrudedLine(e,t){return new F([2],[e-1,t+1,1,-1])}_removeAtIndex(e){this._deleted==null&&(this._deleted=L.create(this.getSize())),this._deleted.set(e)}}const vt=(a,e)=>a&&((...t)=>e.warn("DEBUG:",...t))||(()=>null),Et=!1;class At{constructor(e){this.data=e,this._referenceCount=0}increment(){this._referenceCount+=1}decrement(){this._referenceCount-=1}empty(){return this._referenceCount===0}}class Ct{constructor(){this._freeIdsGenerationA=[],this._freeIdsGenerationB=[],this._idCounter=1,this._freeIds=this._freeIdsGenerationA,this._objectIdToDisplayId=new Map}createIdForObjectId(e){let t=this._objectIdToDisplayId.get(e);return t?t.increment():(t=new At(be(this._getFreeId(),!1)),t.increment(),this._objectIdToDisplayId.set(e,t)),t.data}releaseIdForObjectId(e){const t=this._objectIdToDisplayId.get(e);t&&(t.decrement(),t.empty()&&(this._objectIdToDisplayId.delete(e),this._freeIds.push(t.data)))}releaseAll(){for(const e of this._objectIdToDisplayId.values())this._freeIds.push(e.data);this._objectIdToDisplayId.clear()}incrementGeneration(){this._freeIds=this._freeIds===this._freeIdsGenerationA?this._freeIdsGenerationB:this._freeIdsGenerationA}_getFreeId(){return this._freeIds.length?this._freeIds.pop():this._idCounter++}}function Mt(a,e){if(!a||!e)return a;switch(e){case"radius":case"distance":return 2*a;case"diameter":case"width":return a;case"area":return Math.sqrt(a)}return a}const Z=()=>S.getLogger("esri.views.layers.2d.features.support.AttributeStore"),k=vt(Et,Z()),Ft={sharedArrayBuffer:b("esri-shared-array-buffer"),atomics:b("esri-atomics")};class zt{constructor(e,t,r){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:s,layout:i,textureOnly:n}=t;this.textureOnly=n||!1,this.pixelType=s,this.layout=i,this._resetRange(),this.size=e,this.isLocal=r,n||(this.data=this._initData(s,e))}get buffer(){var e;return(e=this.data)==null?void 0:e.buffer}unsetComponentAllTexels(e,t){const r=this.data;for(let s=0;st)return null;this._resetRange();const s=!this.isLocal,i=this.pixelType,n=this.layout,o=this.data;return{start:e,end:t,data:s&&o.slice(e*r,(t+1)*r)||null,pixelType:i,layout:n}}_initData(e,t){const r=ArrayBuffer,s=_e(e),i=new s(new r(t*t*4*s.BYTES_PER_ELEMENT));for(let n=0;nnull)}get referencesScale(){return this._referencesScale}get referencesGeometry(){return this._referencesGeometry}get _signal(){return this._abortController.signal}get hasHighlight(){return this._idsToHighlight.size>0}createDisplayIdForObjectId(e){return this._idGenerator.createIdForObjectId(e)}releaseDisplayIdForObjectId(e){return this._idGenerator.releaseIdForObjectId(e)}incrementDisplayIdGeneration(){this._idGenerator.incrementGeneration()}releaseAllIds(){this._idGenerator.releaseAll()}async update(e,t,r,s,i=0){const n=Ue(this._schema,e);if(this.version=i,n&&(b("esri-2d-update-debug")&&console.debug(`Version[${i}] AttributeStore.update`,{changed:n}),this._schema=e,this._attributeComputeInfo=null,this._initialize(),e!=null))if(r&&(this._filters=await Promise.all(e.filters.map(o=>o?U.create({geometryType:r.geometryType,hasM:!1,hasZ:!1,timeInfo:r.timeInfo,fieldsIndex:r.fieldsIndex,spatialReference:s??r.spatialReference,filterJSON:o}):null))),e.type!=="subtype")this._attributeComputeInfo={isSubtype:!1,map:new Map},await Promise.all(e.bindings.map(async o=>{const h=await this._bind(t,o);this._referencesGeometry=this._referencesGeometry||((h==null?void 0:h.referencesGeometry())??!1),this._referencesScale=this._referencesScale||((h==null?void 0:h.referencesScale())??!1)}));else{this._attributeComputeInfo={isSubtype:!0,subtypeField:e.subtypeField,map:new Map},this._referencesScale=!1,this._referencesGeometry=!1;for(const o in e.bindings){const h=e.bindings[o];await Promise.all(h.map(async d=>{const c=await this._bind(t,d,parseInt(o,10));this._referencesGeometry=this._referencesGeometry||((c==null?void 0:c.referencesGeometry())??!1),this._referencesScale=this._referencesScale||((c==null?void 0:c.referencesScale())??!1)}))}}}setHighlight(e,t){const r=this._getBlock(0);r.unsetComponentAllTexels(0,(1<{var g;const u=c*n%o,l=Math.floor(c*n/o),y=this._getBlock(l+O.VV);let f=(g=d.field)==null?void 0:g.read(t,r);d.valueRepresentation&&(f=Mt(f,d.valueRepresentation)),(f===null||isNaN(f)||f===1/0||f===-1/0)&&(f=xe),y.setData(s,u,f)}))}get epoch(){return this._epoch}async sendUpdates(){const e=this._blocks.map(r=>r!=null?r.toMessage():null),t=this._getInitArgs();b("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.start"),await this._client.update({initArgs:t,blockData:e,version:this.version,sendUpdateEpoch:this._epoch},this._signal),this._epoch+=1,b("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.end")}_ensureSizeForTexel(e){for(;e>=this._size*this._size;)if(this._expand())return}async _bind(e,t,r){const s=await e.createComputedField(t),{valueRepresentation:i}=t,n=this._attributeComputeInfo;if(n.isSubtype){const o=n.map.get(r)??new Map;o.set(t.binding,{field:s,valueRepresentation:i}),n.map.set(r,o)}else n.map.set(t.binding,{field:s,valueRepresentation:i});return s}_getInitArgs(){return this._initialized?null:(this._initialized=!0,this._getBlock(O.Animation),this._getBlock(O.GPGPU),{blockSize:this._size,blockDescriptors:this._blocks.map(e=>e!=null?{textureOnly:e.textureOnly,buffer:e.buffer,pixelType:e.pixelType}:null)})}_getBlock(e){const t=this._blocks[e];if(t!=null)return t;k(`Initializing AttributeBlock at index ${e}`);const r=new zt(this._size,this._blockDescriptors[e],this._client.isLocal);return this._blocks[e]=r,this._initialized=!1,r}_expand(){if(this._size{o(i)||p.getLogger(this).error(i)}),this.notifyChange("updating")}attach(){this._bitmapContainer=new h,this.container.addChild(this._bitmapContainer),this._strategy=new c({container:this._bitmapContainer,fetchSource:this.fetchBitmapData.bind(this),requestUpdate:this.requestUpdate.bind(this)})}detach(){this._strategy.destroy(),this._strategy=null,this.container.removeChild(this._bitmapContainer),this._bitmapContainer.removeAllChildren()}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}fetchBitmapData(e,i,s){return this.layer.fetchImageBitmap(e,i,s)}async doRefresh(){this.requestUpdate()}isUpdating(){return this._strategy.updating||this.updateRequested}};r([a()],t.prototype,"_strategy",void 0),r([a()],t.prototype,"updating",void 0),t=r([m("esri.views.2d.layers.BaseDynamicLayerView2D")],t);const E=t;export{E as default}; +import{b as o,s as p,d as r,y as a,f as m}from"./index-BjUNJPVf.js";import{a as h}from"./BitmapContainer-DD7rxH0u.js";import{m as n,u as d}from"./LayerView-Bux7vAEn.js";import{v as c}from"./ExportStrategy-SzILz8ne.js";import{i as u}from"./RefreshableLayerView-L9NGpXXI.js";import"./WGLContainer-DgZNq7b0.js";import"./LabelMetric-BcUxDImF.js";import"./Texture-S4dD-WHn.js";import"./Program-DBsYtQ00.js";import"./ProgramTemplate-Ck2I0bIi.js";import"./Container-_n5wCgez.js";import"./highlightReasons-BOU4mnPE.js";import"./config-MDUrh2eL.js";import"./earcut-CWKXDqDj.js";import"./featureConversionUtils-BHhm7bvm.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./scaleUtils-DWXMiS7R.js";import"./Bitmap-DpyomsG7.js";let t=class extends u(n(d)){update(e){this._strategy.update(e).catch(i=>{o(i)||p.getLogger(this).error(i)}),this.notifyChange("updating")}attach(){this._bitmapContainer=new h,this.container.addChild(this._bitmapContainer),this._strategy=new c({container:this._bitmapContainer,fetchSource:this.fetchBitmapData.bind(this),requestUpdate:this.requestUpdate.bind(this)})}detach(){this._strategy.destroy(),this._strategy=null,this.container.removeChild(this._bitmapContainer),this._bitmapContainer.removeAllChildren()}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}fetchBitmapData(e,i,s){return this.layer.fetchImageBitmap(e,i,s)}async doRefresh(){this.requestUpdate()}isUpdating(){return this._strategy.updating||this.updateRequested}};r([a()],t.prototype,"_strategy",void 0),r([a()],t.prototype,"updating",void 0),t=r([m("esri.views.2d.layers.BaseDynamicLayerView2D")],t);const E=t;export{E as default}; diff --git a/assets/BingMapsLayer-CvxOjLC9.js b/assets/BingMapsLayer-CPBW-ptl.js similarity index 97% rename from assets/BingMapsLayer-CvxOjLC9.js rename to assets/BingMapsLayer-CPBW-ptl.js index b159b9e..8aae266 100644 --- a/assets/BingMapsLayer-CvxOjLC9.js +++ b/assets/BingMapsLayer-CPBW-ptl.js @@ -1 +1 @@ -import{bP as f,bQ as j,dZ as b,aS as h,aE as x,ai as U,M as c,N as u,d as r,y as s,f as T,fs as B,bT as P,aY as R,dp as k,dr as $,aA as _,d_ as a}from"./index-CEWggaxV.js";import{f as I}from"./RefreshableLayer-1EkEhJeI.js";import{o as M}from"./imageBitmapUtils-C0nKXf5P.js";var v;const y=new B("0/0/0",0,0,0,void 0);let d=v=class extends f(j(I(P))){constructor(){super(...arguments),this.tileInfo=b.create({spatialReference:h.WebMercator,size:256}),this.type="base-tile",this.fullExtent=new x(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,h.WebMercator),this.spatialReference=h.WebMercator}getTileBounds(e,t,i,l){const n=l||U();return y.level=e,y.row=t,y.col=i,y.extent=n,this.tileInfo.updateTileInfo(y),y.extent=void 0,n}fetchTile(e,t,i,l={}){const{signal:n}=l,p=this.getTileUrl(e,t,i),g={responseType:"image",signal:n,query:{...this.refreshParameters}};return c(p??"",g).then(m=>m.data)}async fetchImageBitmapTile(e,t,i,l={}){const{signal:n}=l;if(this.fetchTile!==v.prototype.fetchTile){const S=await this.fetchTile(e,t,i,l);return M(S,e,t,i,n)}const p=this.getTileUrl(e,t,i)??"",g={responseType:"blob",signal:n,query:{...this.refreshParameters}},{data:m}=await c(p,g);return M(m,e,t,i,n)}getTileUrl(){throw new u("basetilelayer:gettileurl-not-implemented","getTileUrl() is not implemented")}};r([s({type:b})],d.prototype,"tileInfo",void 0),r([s({type:["show","hide"]})],d.prototype,"listMode",void 0),r([s({readOnly:!0,value:"base-tile"})],d.prototype,"type",void 0),r([s({nonNullable:!0})],d.prototype,"fullExtent",void 0),r([s()],d.prototype,"spatialReference",void 0),d=v=r([T("esri.layers.BaseTileLayer")],d);const A=d,w=new R({BingMapsAerial:"aerial",BingMapsRoad:"road",BingMapsHybrid:"hybrid"}),L="https://dev.virtualearth.net";let o=class extends f(k($(A))){constructor(e){super(e),this.type="bing-maps",this.tileInfo=new b({size:[256,256],dpi:96,origin:new _({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:h.WebMercator}),spatialReference:h.WebMercator,lods:[new a({level:1,resolution:78271.5169639999,scale:295828763795777e-6}),new a({level:2,resolution:39135.7584820001,scale:147914381897889e-6}),new a({level:3,resolution:19567.8792409999,scale:73957190948944e-6}),new a({level:4,resolution:9783.93962049996,scale:36978595474472e-6}),new a({level:5,resolution:4891.96981024998,scale:18489297737236e-6}),new a({level:6,resolution:2445.98490512499,scale:9244648868618e-6}),new a({level:7,resolution:1222.99245256249,scale:4622324434309e-6}),new a({level:8,resolution:611.49622628138,scale:2311162217155e-6}),new a({level:9,resolution:305.748113140558,scale:1155581108577e-6}),new a({level:10,resolution:152.874056570411,scale:577790.554289}),new a({level:11,resolution:76.4370282850732,scale:288895.277144}),new a({level:12,resolution:38.2185141425366,scale:144447.638572}),new a({level:13,resolution:19.1092570712683,scale:72223.819286}),new a({level:14,resolution:9.55462853563415,scale:36111.909643}),new a({level:15,resolution:4.77731426794937,scale:18055.954822}),new a({level:16,resolution:2.38865713397468,scale:9027.977411}),new a({level:17,resolution:1.19432856685505,scale:4513.988705}),new a({level:18,resolution:.597164283559817,scale:2256.994353}),new a({level:19,resolution:.298582141647617,scale:1128.497176}),new a({level:20,resolution:.1492910708238085,scale:564.248588})]}),this.key=null,this.style="road",this.culture="en-US",this.region=null,this.portalUrl=null,this.hasAttributionData=!0}get bingMetadata(){return this._get("bingMetadata")}set bingMetadata(e){this._set("bingMetadata",e)}get copyright(){return this.bingMetadata!=null?this.bingMetadata.copyright:null}get operationalLayerType(){return w.toJSON(this.style)}get bingLogo(){return this.bingMetadata!=null?this.bingMetadata.brandLogoUri:null}load(e){return this.key?this.addResolvingPromise(this._getMetadata()):this.portalUrl?this.addResolvingPromise(this._getPortalBingKey().then(()=>this._getMetadata())):this.addResolvingPromise(Promise.reject(new u("bingmapslayer:load","Bing layer must have bing key."))),Promise.resolve(this)}getTileUrl(e,t,i){if(!this.loaded||this.bingMetadata==null)return null;const l=this.bingMetadata.resourceSets[0].resources[0],n=l.imageUrlSubdomains[t%l.imageUrlSubdomains.length],p=this._getQuadKey(e,t,i);return l.imageUrl.replace("{subdomain}",n).replace("{quadkey}",p)}async fetchAttributionData(){return this.load().then(()=>this.bingMetadata==null?null:{contributors:this.bingMetadata.resourceSets[0].resources[0].imageryProviders.map(e=>({attribution:e.attribution,coverageAreas:e.coverageAreas.map(t=>({zoomMin:t.zoomMin,zoomMax:t.zoomMax,score:1,bbox:[t.bbox[0],t.bbox[1],t.bbox[2],t.bbox[3]]}))}))})}_getMetadata(){const e={road:"roadOnDemand",aerial:"aerial",hybrid:"aerialWithLabelsOnDemand"}[this.style];return c(`${L}/REST/v1/Imagery/Metadata/${e}`,{responseType:"json",query:{include:"ImageryProviders",uriScheme:"https",key:this.key,suppressStatus:!0,output:"json",culture:this.culture,userRegion:this.region}}).then(t=>{const i=t.data;if(i.statusCode!==200)throw new u("bingmapslayer:getmetadata",i.statusDescription);if(this.bingMetadata=i,this.bingMetadata.resourceSets.length===0)throw new u("bingmapslayer:getmetadata","no bing resourcesets");if(this.bingMetadata.resourceSets[0].resources.length===0)throw new u("bingmapslayer:getmetadata","no bing resources")}).catch(t=>{throw new u("bingmapslayer:getmetadata",t.message)})}_getPortalBingKey(){return c(this.portalUrl??"",{responseType:"json",authMode:"no-prompt",query:{f:"json"}}).then(e=>{if(!e.data.bingKey)throw new u("bingmapslayer:getportalbingkey","The referenced Portal does not contain a valid bing key");this.key=e.data.bingKey}).catch(e=>{throw new u("bingmapslayer:getportalbingkey",e.message)})}_getQuadKey(e,t,i){let l="";for(let n=e;n>0;n--){let p=0;const g=1<m.data)}async fetchImageBitmapTile(e,t,i,l={}){const{signal:n}=l;if(this.fetchTile!==v.prototype.fetchTile){const S=await this.fetchTile(e,t,i,l);return M(S,e,t,i,n)}const p=this.getTileUrl(e,t,i)??"",g={responseType:"blob",signal:n,query:{...this.refreshParameters}},{data:m}=await c(p,g);return M(m,e,t,i,n)}getTileUrl(){throw new u("basetilelayer:gettileurl-not-implemented","getTileUrl() is not implemented")}};r([s({type:b})],d.prototype,"tileInfo",void 0),r([s({type:["show","hide"]})],d.prototype,"listMode",void 0),r([s({readOnly:!0,value:"base-tile"})],d.prototype,"type",void 0),r([s({nonNullable:!0})],d.prototype,"fullExtent",void 0),r([s()],d.prototype,"spatialReference",void 0),d=v=r([T("esri.layers.BaseTileLayer")],d);const A=d,w=new R({BingMapsAerial:"aerial",BingMapsRoad:"road",BingMapsHybrid:"hybrid"}),L="https://dev.virtualearth.net";let o=class extends f(k($(A))){constructor(e){super(e),this.type="bing-maps",this.tileInfo=new b({size:[256,256],dpi:96,origin:new _({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:h.WebMercator}),spatialReference:h.WebMercator,lods:[new a({level:1,resolution:78271.5169639999,scale:295828763795777e-6}),new a({level:2,resolution:39135.7584820001,scale:147914381897889e-6}),new a({level:3,resolution:19567.8792409999,scale:73957190948944e-6}),new a({level:4,resolution:9783.93962049996,scale:36978595474472e-6}),new a({level:5,resolution:4891.96981024998,scale:18489297737236e-6}),new a({level:6,resolution:2445.98490512499,scale:9244648868618e-6}),new a({level:7,resolution:1222.99245256249,scale:4622324434309e-6}),new a({level:8,resolution:611.49622628138,scale:2311162217155e-6}),new a({level:9,resolution:305.748113140558,scale:1155581108577e-6}),new a({level:10,resolution:152.874056570411,scale:577790.554289}),new a({level:11,resolution:76.4370282850732,scale:288895.277144}),new a({level:12,resolution:38.2185141425366,scale:144447.638572}),new a({level:13,resolution:19.1092570712683,scale:72223.819286}),new a({level:14,resolution:9.55462853563415,scale:36111.909643}),new a({level:15,resolution:4.77731426794937,scale:18055.954822}),new a({level:16,resolution:2.38865713397468,scale:9027.977411}),new a({level:17,resolution:1.19432856685505,scale:4513.988705}),new a({level:18,resolution:.597164283559817,scale:2256.994353}),new a({level:19,resolution:.298582141647617,scale:1128.497176}),new a({level:20,resolution:.1492910708238085,scale:564.248588})]}),this.key=null,this.style="road",this.culture="en-US",this.region=null,this.portalUrl=null,this.hasAttributionData=!0}get bingMetadata(){return this._get("bingMetadata")}set bingMetadata(e){this._set("bingMetadata",e)}get copyright(){return this.bingMetadata!=null?this.bingMetadata.copyright:null}get operationalLayerType(){return w.toJSON(this.style)}get bingLogo(){return this.bingMetadata!=null?this.bingMetadata.brandLogoUri:null}load(e){return this.key?this.addResolvingPromise(this._getMetadata()):this.portalUrl?this.addResolvingPromise(this._getPortalBingKey().then(()=>this._getMetadata())):this.addResolvingPromise(Promise.reject(new u("bingmapslayer:load","Bing layer must have bing key."))),Promise.resolve(this)}getTileUrl(e,t,i){if(!this.loaded||this.bingMetadata==null)return null;const l=this.bingMetadata.resourceSets[0].resources[0],n=l.imageUrlSubdomains[t%l.imageUrlSubdomains.length],p=this._getQuadKey(e,t,i);return l.imageUrl.replace("{subdomain}",n).replace("{quadkey}",p)}async fetchAttributionData(){return this.load().then(()=>this.bingMetadata==null?null:{contributors:this.bingMetadata.resourceSets[0].resources[0].imageryProviders.map(e=>({attribution:e.attribution,coverageAreas:e.coverageAreas.map(t=>({zoomMin:t.zoomMin,zoomMax:t.zoomMax,score:1,bbox:[t.bbox[0],t.bbox[1],t.bbox[2],t.bbox[3]]}))}))})}_getMetadata(){const e={road:"roadOnDemand",aerial:"aerial",hybrid:"aerialWithLabelsOnDemand"}[this.style];return c(`${L}/REST/v1/Imagery/Metadata/${e}`,{responseType:"json",query:{include:"ImageryProviders",uriScheme:"https",key:this.key,suppressStatus:!0,output:"json",culture:this.culture,userRegion:this.region}}).then(t=>{const i=t.data;if(i.statusCode!==200)throw new u("bingmapslayer:getmetadata",i.statusDescription);if(this.bingMetadata=i,this.bingMetadata.resourceSets.length===0)throw new u("bingmapslayer:getmetadata","no bing resourcesets");if(this.bingMetadata.resourceSets[0].resources.length===0)throw new u("bingmapslayer:getmetadata","no bing resources")}).catch(t=>{throw new u("bingmapslayer:getmetadata",t.message)})}_getPortalBingKey(){return c(this.portalUrl??"",{responseType:"json",authMode:"no-prompt",query:{f:"json"}}).then(e=>{if(!e.data.bingKey)throw new u("bingmapslayer:getportalbingkey","The referenced Portal does not contain a valid bing key");this.key=e.data.bingKey}).catch(e=>{throw new u("bingmapslayer:getportalbingkey",e.message)})}_getQuadKey(e,t,i){let l="";for(let n=e;n>0;n--){let p=0;const g=1<i.abort()),c(i,h=>r.reject(h)),this._uploadStatus={controller:i,resolver:r},this.source=t,r.promise}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this._source instanceof HTMLImageElement?(this._sourceHeight=this._source.naturalHeight,this._sourceWidth=this._source.naturalWidth):this._source&&(this._sourceHeight=this._source.height,this._sourceWidth=this._source.width))}updateTransitionProperties(t,e){t>=64&&(this.fadeTransitionEnabled=!1,this.inFadeTransition=!1),super.updateTransitionProperties(t,e)}setTransform(t){const e=x(this.transforms.displayViewScreenMat3),[i,r]=t.toScreenNoRotation([0,0],[this.x,this.y]),h=this.resolution/this.pixelRatio/t.resolution,l=h*this.width,o=h*this.height,n=Math.PI*this.rotation/180;u(e,e,a(i,r)),u(e,e,a(l/2,o/2)),_(e,e,-n),u(e,e,a(-l/2,-o/2)),g(e,e,a(l,o)),m(this.transforms.displayViewScreenMat3,t.displayViewMat3,e)}setSamplingProfile(t){this._texture&&(t.mips&&!this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._texture.setSamplingMode(t.samplingMode))}bind(t,e){this._texture&&t.bindTexture(this._texture,e)}async updateTexture({context:t,painter:e}){if(!this._textureInvalidated)return;if(this._textureInvalidated=!1,this._texture||(this._texture=this._createTexture(t)),!this.source)return void this._texture.setData(null);this._texture.resize(this._sourceWidth,this._sourceHeight);const i=A(this.source);try{if(this._uploadStatus!=null){const{controller:r,resolver:h}=this._uploadStatus,l={signal:r.signal},{width:o,height:n}=this,d=this._texture;await e.textureUploadManager.enqueueTextureUpdate({data:i,texture:d,width:o,height:n},l),h.resolve(),this._uploadStatus=null}else this._texture.setData(i);this.ready()}catch(r){w(r)}}onDetach(){this.destroy()}_createTransforms(){return{displayViewScreenMat3:f()}}_createTexture(t){const e=this.immutable,i=new b;return i.internalFormat=e?B.RGBA8:k.RGBA,i.wrapMode=R.CLAMP_TO_EDGE,i.isImmutable=e,i.width=this._sourceWidth,i.height=this._sourceHeight,new v(t,i)}}export{W as b,M as f,T as g,y as l}; +import{df as p,eG as c,eH as x,eI as u,eJ as a,eK as _,eL as g,eM as m,eN as w,eO as f,l as B,v as k,D as R}from"./index-BjUNJPVf.js";import{i as S}from"./Container-_n5wCgez.js";import{e as b,m as v}from"./Texture-S4dD-WHn.js";class y{constructor(t,e,i){this.pixelBlock=t,this.extent=e,this.originalPixelBlock=i}get width(){return this.pixelBlock!=null?this.pixelBlock.width:0}get height(){return this.pixelBlock!=null?this.pixelBlock.height:0}render(t){const e=this.pixelBlock;if(e==null)return;const i=this.filter({extent:this.extent,pixelBlock:this.originalPixelBlock??e});if(i.pixelBlock==null)return;i.pixelBlock.maskIsAlpha&&(i.pixelBlock.premultiplyAlpha=!0);const r=i.pixelBlock.getAsRGBA(),h=t.createImageData(i.pixelBlock.width,i.pixelBlock.height);h.data.set(r),t.putImageData(h,0,0)}getRenderedRasterPixels(){const t=this.filter({extent:this.extent,pixelBlock:this.pixelBlock});return t.pixelBlock==null?null:(t.pixelBlock.maskIsAlpha&&(t.pixelBlock.premultiplyAlpha=!0),{width:t.pixelBlock.width,height:t.pixelBlock.height,renderedRasterPixels:new Uint8Array(t.pixelBlock.getAsRGBA().buffer)})}}function T(s){return s&&"render"in s}function M(s){const t=document.createElement("canvas");return t.width=s.width,t.height=s.height,s.render(t.getContext("2d")),t}function A(s){var t;return T(s)?s instanceof y?(t=s.getRenderedRasterPixels())==null?void 0:t.renderedRasterPixels:M(s):s}class W extends S{constructor(t=null,e=!1){super(),this.blendFunction="standard",this._sourceWidth=0,this._sourceHeight=0,this._textureInvalidated=!1,this._texture=null,this.stencilRef=0,this.coordScale=[1,1],this._height=void 0,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this._width=void 0,this.x=0,this.y=0,this.immutable=e,this.source=t,this.requestRender=this.requestRender.bind(this)}destroy(){this._texture&&(this._texture.dispose(),this._texture=null),this._uploadStatus!=null&&(this._uploadStatus.controller.abort(),this._uploadStatus=null)}get isSourceScaled(){return this.width!==this._sourceWidth||this.height!==this._sourceHeight}get height(){return this._height!==void 0?this._height:this._sourceHeight}set height(t){this._height=t}get source(){return this._source}set source(t){t==null&&this._source==null||(this._source=t,this.invalidateTexture(),this.requestRender())}get width(){return this._width!==void 0?this._width:this._sourceWidth}set width(t){this._width=t}beforeRender(t){super.beforeRender(t),this.updateTexture(t)}async setSourceAsync(t,e){this._uploadStatus!=null&&this._uploadStatus.controller.abort();const i=new AbortController,r=p();return c(e,()=>i.abort()),c(i,h=>r.reject(h)),this._uploadStatus={controller:i,resolver:r},this.source=t,r.promise}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this._source instanceof HTMLImageElement?(this._sourceHeight=this._source.naturalHeight,this._sourceWidth=this._source.naturalWidth):this._source&&(this._sourceHeight=this._source.height,this._sourceWidth=this._source.width))}updateTransitionProperties(t,e){t>=64&&(this.fadeTransitionEnabled=!1,this.inFadeTransition=!1),super.updateTransitionProperties(t,e)}setTransform(t){const e=x(this.transforms.displayViewScreenMat3),[i,r]=t.toScreenNoRotation([0,0],[this.x,this.y]),h=this.resolution/this.pixelRatio/t.resolution,l=h*this.width,o=h*this.height,n=Math.PI*this.rotation/180;u(e,e,a(i,r)),u(e,e,a(l/2,o/2)),_(e,e,-n),u(e,e,a(-l/2,-o/2)),g(e,e,a(l,o)),m(this.transforms.displayViewScreenMat3,t.displayViewMat3,e)}setSamplingProfile(t){this._texture&&(t.mips&&!this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._texture.setSamplingMode(t.samplingMode))}bind(t,e){this._texture&&t.bindTexture(this._texture,e)}async updateTexture({context:t,painter:e}){if(!this._textureInvalidated)return;if(this._textureInvalidated=!1,this._texture||(this._texture=this._createTexture(t)),!this.source)return void this._texture.setData(null);this._texture.resize(this._sourceWidth,this._sourceHeight);const i=A(this.source);try{if(this._uploadStatus!=null){const{controller:r,resolver:h}=this._uploadStatus,l={signal:r.signal},{width:o,height:n}=this,d=this._texture;await e.textureUploadManager.enqueueTextureUpdate({data:i,texture:d,width:o,height:n},l),h.resolve(),this._uploadStatus=null}else this._texture.setData(i);this.ready()}catch(r){w(r)}}onDetach(){this.destroy()}_createTransforms(){return{displayViewScreenMat3:f()}}_createTexture(t){const e=this.immutable,i=new b;return i.internalFormat=e?B.RGBA8:k.RGBA,i.wrapMode=R.CLAMP_TO_EDGE,i.isImmutable=e,i.width=this._sourceWidth,i.height=this._sourceHeight,new v(t,i)}}export{W as b,M as f,T as g,y as l}; diff --git a/assets/BitmapContainer-Bq0Mk6_k.js b/assets/BitmapContainer-DD7rxH0u.js similarity index 82% rename from assets/BitmapContainer-Bq0Mk6_k.js rename to assets/BitmapContainer-DD7rxH0u.js index a02e96a..7c03a04 100644 --- a/assets/BitmapContainer-Bq0Mk6_k.js +++ b/assets/BitmapContainer-DD7rxH0u.js @@ -1 +1 @@ -import{n as s,h as a}from"./WGLContainer-B_Pv-8Yi.js";import{E as t}from"./Container-CB7SlLB9.js";class h extends s{constructor(){super(...arguments),this._hasCrossfade=!1}get requiresDedicatedFBO(){return super.requiresDedicatedFBO||this._hasCrossfade}beforeRender(e){super.beforeRender(e),this._manageFade()}prepareRenderPasses(e){const r=e.registerRenderPass({name:"bitmap",brushes:[a.bitmap],target:()=>this.children,drawPhase:t.MAP});return[...super.prepareRenderPasses(e),r]}_manageFade(){this.children.reduce((e,r)=>e+(r.inFadeTransition?1:0),0)>=2?(this.children.forEach(e=>e.blendFunction="additive"),this._hasCrossfade=!0):(this.children.forEach(e=>e.blendFunction="standard"),this._hasCrossfade=!1)}}export{h as a}; +import{n as s,h as a}from"./WGLContainer-DgZNq7b0.js";import{E as t}from"./Container-_n5wCgez.js";class h extends s{constructor(){super(...arguments),this._hasCrossfade=!1}get requiresDedicatedFBO(){return super.requiresDedicatedFBO||this._hasCrossfade}beforeRender(e){super.beforeRender(e),this._manageFade()}prepareRenderPasses(e){const r=e.registerRenderPass({name:"bitmap",brushes:[a.bitmap],target:()=>this.children,drawPhase:t.MAP});return[...super.prepareRenderPasses(e),r]}_manageFade(){this.children.reduce((e,r)=>e+(r.inFadeTransition?1:0),0)>=2?(this.children.forEach(e=>e.blendFunction="additive"),this._hasCrossfade=!0):(this.children.forEach(e=>e.blendFunction="standard"),this._hasCrossfade=!1)}}export{h as a}; diff --git a/assets/BoundsStore-DMoG4U0L.js b/assets/BoundsStore-DRDtG3Mk.js similarity index 93% rename from assets/BoundsStore-DMoG4U0L.js rename to assets/BoundsStore-DRDtG3Mk.js index 4e7a29f..c477467 100644 --- a/assets/BoundsStore-DMoG4U0L.js +++ b/assets/BoundsStore-DRDtG3Mk.js @@ -1 +1 @@ -import{E as o,cc as h}from"./index-CEWggaxV.js";import{s as a}from"./PooledRBush-BsFBmw1o.js";const _=5e4,t={minX:0,minY:0,maxX:0,maxY:0};function u(d){t.minX=d[0],t.minY=d[1],t.maxX=d[2],t.maxY=d[3]}function l(d,s,i){u(s),d.search(t,i)}class B{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new a(9,o("esri-csp-restrictions")?s=>({minX:s[0],minY:s[1],maxX:s[2],maxY:s[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const s=new Array(this._idByBounds.size);let i=0;this._idByBounds.forEach((n,e)=>{s[i++]=e}),this._indexInvalid=!1,this._index.clear(),this._index.load(s)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter(s=>this._idByBounds.has(s))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const s=h();for(const i of this._boundsById.values())i&&(s[0]=Math.min(i[0],s[0]),s[1]=Math.min(i[1],s[1]),s[2]=Math.max(i[2],s[2]),s[3]=Math.max(i[3],s[3]));return s}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(s){const i=this._boundsById.get(s);this._boundsById.delete(s),i&&(this._idByBounds.delete(i),this._indexInvalid||this._index.remove(i))}forEachInBounds(s,i){this._loadIndex(),l(this._index,s,n=>i(this._idByBounds.get(n)))}get(s){return this._boundsById.get(s)}has(s){return this._boundsById.has(s)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(s,i){if(!this._indexInvalid){const n=this._boundsById.get(s);n&&(this._index.remove(n),this._idByBounds.delete(n))}this._boundsById.set(s,i),i&&(this._idByBounds.set(i,s),this._indexInvalid||(this._boundsToLoad.push(i),this._boundsToLoad.length>_&&this._loadIndex()))}}export{B as o}; +import{E as o,cc as h}from"./index-BjUNJPVf.js";import{s as a}from"./PooledRBush-BlFOlUgK.js";const _=5e4,t={minX:0,minY:0,maxX:0,maxY:0};function u(d){t.minX=d[0],t.minY=d[1],t.maxX=d[2],t.maxY=d[3]}function l(d,s,i){u(s),d.search(t,i)}class B{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new a(9,o("esri-csp-restrictions")?s=>({minX:s[0],minY:s[1],maxX:s[2],maxY:s[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const s=new Array(this._idByBounds.size);let i=0;this._idByBounds.forEach((n,e)=>{s[i++]=e}),this._indexInvalid=!1,this._index.clear(),this._index.load(s)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter(s=>this._idByBounds.has(s))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const s=h();for(const i of this._boundsById.values())i&&(s[0]=Math.min(i[0],s[0]),s[1]=Math.min(i[1],s[1]),s[2]=Math.max(i[2],s[2]),s[3]=Math.max(i[3],s[3]));return s}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(s){const i=this._boundsById.get(s);this._boundsById.delete(s),i&&(this._idByBounds.delete(i),this._indexInvalid||this._index.remove(i))}forEachInBounds(s,i){this._loadIndex(),l(this._index,s,n=>i(this._idByBounds.get(n)))}get(s){return this._boundsById.get(s)}has(s){return this._boundsById.has(s)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(s,i){if(!this._indexInvalid){const n=this._boundsById.get(s);n&&(this._index.remove(n),this._idByBounds.delete(n))}this._boundsById.set(s,i),i&&(this._idByBounds.set(i,s),this._indexInvalid||(this._boundsToLoad.push(i),this._boundsToLoad.length>_&&this._loadIndex()))}}export{B as o}; diff --git a/assets/BufferView-Ao_K-5Vg.js b/assets/BufferView-3om6S_aJ.js similarity index 99% rename from assets/BufferView-Ao_K-5Vg.js rename to assets/BufferView-3om6S_aJ.js index de637d4..833f05f 100644 --- a/assets/BufferView-Ao_K-5Vg.js +++ b/assets/BufferView-3om6S_aJ.js @@ -1 +1 @@ -import{fj as G,fg as H,cl as _}from"./index-CEWggaxV.js";let q=class{constructor(e,t,s=0,r,i){this.TypedArrayConstructor=e,this.elementCount=9;const f=this.TypedArrayConstructor;r===void 0&&(r=9*f.BYTES_PER_ELEMENT);const u=t.byteLength===0?0:s;this.typedBuffer=i==null?new f(t,u):new f(t,u,(i-s)/f.BYTES_PER_ELEMENT),this.typedBufferStride=r/f.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,s=this.count-t){const r=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,r,this.stride,r+s*this.stride)}getMat(e,t){let s=e*this.typedBufferStride;for(let r=0;r<9;r++)t[r]=this.typedBuffer[s++];return t}setMat(e,t){let s=e*this.typedBufferStride;for(let r=0;r<9;r++)this.typedBuffer[s++]=t[r]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,s){this.typedBuffer[e*this.typedBufferStride+t]=s}copyFrom(e,t,s){const r=this.typedBuffer,i=t.typedBuffer;let f=e*this.typedBufferStride,u=s*t.typedBufferStride;for(let p=0;p<9;++p)r[f++]=i[u++]}get buffer(){return this.typedBuffer.buffer}};q.ElementCount=9;let z=class{constructor(e,t,s=0,r,i){this.TypedArrayConstructor=e,this.elementCount=16;const f=this.TypedArrayConstructor;r===void 0&&(r=16*f.BYTES_PER_ELEMENT);const u=t.byteLength===0?0:s;this.typedBuffer=i==null?new f(t,u):new f(t,u,(i-s)/f.BYTES_PER_ELEMENT),this.typedBufferStride=r/f.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,s=this.count-t){const r=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,r,this.stride,r+s*this.stride)}getMat(e,t){let s=e*this.typedBufferStride;for(let r=0;r<16;r++)t[r]=this.typedBuffer[s++];return t}setMat(e,t){let s=e*this.typedBufferStride;for(let r=0;r<16;r++)this.typedBuffer[s++]=t[r]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,s){this.typedBuffer[e*this.typedBufferStride+t]=s}copyFrom(e,t,s){const r=this.typedBuffer,i=t.typedBuffer;let f=e*this.typedBufferStride,u=s*t.typedBufferStride;for(let p=0;p<16;++p)r[f++]=i[u++]}get buffer(){return this.typedBuffer.buffer}};z.ElementCount=16;class y{constructor(e,t,s=0,r,i){this.TypedArrayConstructor=e,this.elementCount=1;const f=this.TypedArrayConstructor;r===void 0&&(r=f.BYTES_PER_ELEMENT);const u=t.byteLength===0?0:s;this.typedBuffer=i==null?new f(t,u):new f(t,u,(i-s)/f.BYTES_PER_ELEMENT),this.stride=r,this.typedBufferStride=r/f.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride)}sliceBuffer(e,t,s=this.count-t){const r=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,r,this.stride,r+s*this.stride)}get(e){return this.typedBuffer[e*this.typedBufferStride]}set(e,t){this.typedBuffer[e*this.typedBufferStride]=t}get buffer(){return this.typedBuffer.buffer}}y.ElementCount=1;let n=class{constructor(e,t,s=0,r,i){this.TypedArrayConstructor=e,this.elementCount=2;const f=this.TypedArrayConstructor;r===void 0&&(r=2*f.BYTES_PER_ELEMENT);const u=t.byteLength===0?0:s;this.typedBuffer=i==null?new f(t,u):new f(t,u,(i-s)/f.BYTES_PER_ELEMENT),this.typedBufferStride=r/f.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,s=this.count-t){const r=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,r,this.stride,r+s*this.stride)}getVec(e,t){return e*=this.typedBufferStride,G(t,this.typedBuffer[e],this.typedBuffer[e+1])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e]=t[1]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,s){this.typedBuffer[e*this.typedBufferStride+t]=s}setValues(e,t,s){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e]=s}copyFrom(e,t,s){const r=this.typedBuffer,i=t.typedBuffer;let f=e*this.typedBufferStride,u=s*t.typedBufferStride;r[f++]=i[u++],r[f]=i[u]}get buffer(){return this.typedBuffer.buffer}};n.ElementCount=2;let h=class{constructor(e,t,s=0,r,i){this.TypedArrayConstructor=e,this.elementCount=3;const f=this.TypedArrayConstructor;r===void 0&&(r=3*f.BYTES_PER_ELEMENT);const u=t.byteLength===0?0:s;this.typedBuffer=i==null?new f(t,u):new f(t,u,(i-s)/f.BYTES_PER_ELEMENT),this.typedBufferStride=r/f.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,s=this.count-t){const r=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,r,this.stride,r+s*this.stride)}getVec(e,t){return e*=this.typedBufferStride,H(t,this.typedBuffer[e],this.typedBuffer[e+1],this.typedBuffer[e+2])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e++]=t[1],this.typedBuffer[e]=t[2]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,s){this.typedBuffer[e*this.typedBufferStride+t]=s}setValues(e,t,s,r){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e++]=s,this.typedBuffer[e]=r}copyFrom(e,t,s){const r=this.typedBuffer,i=t.typedBuffer;let f=e*this.typedBufferStride,u=s*t.typedBufferStride;r[f++]=i[u++],r[f++]=i[u++],r[f]=i[u]}get buffer(){return this.typedBuffer.buffer}};h.ElementCount=3;class c{constructor(e,t,s=0,r,i){this.TypedArrayConstructor=e,this.start=s,this.elementCount=4;const f=this.TypedArrayConstructor;r===void 0&&(r=4*f.BYTES_PER_ELEMENT);const u=t.byteLength===0?0:s;this.typedBuffer=i==null?new f(t,u):new f(t,u,(i-s)/f.BYTES_PER_ELEMENT),this.typedBufferStride=r/f.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,s=this.count-t){const r=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,r,this.stride,r+s*this.stride)}getVec(e,t){return e*=this.typedBufferStride,_(t,this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e++]=t[1],this.typedBuffer[e++]=t[2],this.typedBuffer[e]=t[3]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,s){this.typedBuffer[e*this.typedBufferStride+t]=s}setValues(e,t,s,r,i){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e++]=s,this.typedBuffer[e++]=r,this.typedBuffer[e]=i}copyFrom(e,t,s){const r=this.typedBuffer,i=t.typedBuffer;let f=e*this.typedBufferStride,u=s*t.typedBufferStride;r[f++]=i[u++],r[f++]=i[u++],r[f++]=i[u++],r[f]=i[u]}get buffer(){return this.typedBuffer.buffer}}c.ElementCount=4;class D extends y{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}static fromTypedArray(e,t){return new D(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}D.ElementType="f32";class l extends n{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}slice(e,t){return this.sliceBuffer(l,e,t)}static fromTypedArray(e,t){return new l(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}l.ElementType="f32";class o extends h{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}slice(e,t){return this.sliceBuffer(o,e,t)}static fromTypedArray(e,t){return new o(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}o.ElementType="f32";class a extends c{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}slice(e,t){return this.sliceBuffer(a,e,t)}static fromTypedArray(e,t){return new a(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}a.ElementType="f32";class B extends q{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}slice(e,t){return this.sliceBuffer(B,e,t)}static fromTypedArray(e,t){return new B(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}B.ElementType="f32";class b extends q{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(b,e,t)}static fromTypedArray(e,t){return new b(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}b.ElementType="f64";class T extends z{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}slice(e,t){return this.sliceBuffer(T,e,t)}static fromTypedArray(e,t){return new T(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}T.ElementType="f32";class E extends z{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(E,e,t)}static fromTypedArray(e,t){return new E(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}E.ElementType="f64";class m extends y{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(m,e,t)}static fromTypedArray(e,t){return new m(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}m.ElementType="f64";class A extends n{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(A,e,t)}static fromTypedArray(e,t){return new A(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}A.ElementType="f64";class O extends h{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(O,e,t)}static fromTypedArray(e,t){return new O(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}O.ElementType="f64";class S extends c{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(S,e,t)}static fromTypedArray(e,t){return new S(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}S.ElementType="f64";class g extends y{constructor(e,t=0,s,r){super(Uint8Array,e,t,s,r),this.elementType="u8"}slice(e,t){return this.sliceBuffer(g,e,t)}static fromTypedArray(e,t){return new g(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}g.ElementType="u8";class L extends n{constructor(e,t=0,s,r){super(Uint8Array,e,t,s,r),this.elementType="u8"}slice(e,t){return this.sliceBuffer(L,e,t)}static fromTypedArray(e,t){return new L(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}L.ElementType="u8";class w extends h{constructor(e,t=0,s,r){super(Uint8Array,e,t,s,r),this.elementType="u8"}slice(e,t){return this.sliceBuffer(w,e,t)}static fromTypedArray(e,t){return new w(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}w.ElementType="u8";class x extends c{constructor(e,t=0,s,r){super(Uint8Array,e,t,s,r),this.elementType="u8"}slice(e,t){return this.sliceBuffer(x,e,t)}static fromTypedArray(e,t){return new x(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}x.ElementType="u8";class M extends y{constructor(e,t=0,s,r){super(Uint16Array,e,t,s,r),this.elementType="u16"}slice(e,t){return this.sliceBuffer(M,e,t)}static fromTypedArray(e,t){return new M(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}M.ElementType="u16";class C extends n{constructor(e,t=0,s,r){super(Uint16Array,e,t,s,r),this.elementType="u16"}slice(e,t){return this.sliceBuffer(C,e,t)}static fromTypedArray(e,t){return new C(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}C.ElementType="u16";class N extends h{constructor(e,t=0,s,r){super(Uint16Array,e,t,s,r),this.elementType="u16"}slice(e,t){return this.sliceBuffer(N,e,t)}static fromTypedArray(e,t){return new N(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}N.ElementType="u16";class P extends c{constructor(e,t=0,s,r){super(Uint16Array,e,t,s,r),this.elementType="u16"}slice(e,t){return this.sliceBuffer(P,e,t)}static fromTypedArray(e,t){return new P(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}P.ElementType="u16";class R extends y{constructor(e,t=0,s,r){super(Uint32Array,e,t,s,r),this.elementType="u32"}slice(e,t){return this.sliceBuffer(R,e,t)}static fromTypedArray(e,t){return new R(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}R.ElementType="u32";class Y extends n{constructor(e,t=0,s,r){super(Uint32Array,e,t,s,r),this.elementType="u32"}slice(e,t){return this.sliceBuffer(Y,e,t)}static fromTypedArray(e,t){return new Y(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}Y.ElementType="u32";class F extends h{constructor(e,t=0,s,r){super(Uint32Array,e,t,s,r),this.elementType="u32"}slice(e,t){return this.sliceBuffer(F,e,t)}static fromTypedArray(e,t){return new F(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}F.ElementType="u32";class I extends c{constructor(e,t=0,s,r){super(Uint32Array,e,t,s,r),this.elementType="u32"}slice(e,t){return this.sliceBuffer(I,e,t)}static fromTypedArray(e,t){return new I(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}I.ElementType="u32";class U extends y{constructor(e,t=0,s,r){super(Int8Array,e,t,s,r),this.elementType="i8"}slice(e,t){return this.sliceBuffer(U,e,t)}static fromTypedArray(e,t){return new U(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}U.ElementType="i8";class V extends n{constructor(e,t=0,s,r){super(Int8Array,e,t,s,r),this.elementType="i8"}slice(e,t){return this.sliceBuffer(V,e,t)}static fromTypedArray(e,t){return new V(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}V.ElementType="i8";class $ extends h{constructor(e,t=0,s,r){super(Int8Array,e,t,s,r),this.elementType="i8"}slice(e,t){return this.sliceBuffer($,e,t)}static fromTypedArray(e,t){return new $(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}$.ElementType="i8";class v extends c{constructor(e,t=0,s,r){super(Int8Array,e,t,s,r),this.elementType="i8"}slice(e,t){return this.sliceBuffer(v,e,t)}static fromTypedArray(e,t){return new v(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}v.ElementType="i8";class j extends y{constructor(e,t=0,s,r){super(Int16Array,e,t,s,r),this.elementType="i16"}slice(e,t){return this.sliceBuffer(j,e,t)}static fromTypedArray(e,t){return new j(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}j.ElementType="i16";class J extends n{constructor(e,t=0,s,r){super(Int16Array,e,t,s,r),this.elementType="i16"}slice(e,t){return this.sliceBuffer(J,e,t)}static fromTypedArray(e,t){return new J(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}J.ElementType="i16";class K extends h{constructor(e,t=0,s,r){super(Int16Array,e,t,s,r),this.elementType="i16"}slice(e,t){return this.sliceBuffer(K,e,t)}static fromTypedArray(e,t){return new K(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}K.ElementType="i16";class Q extends c{constructor(e,t=0,s,r){super(Int16Array,e,t,s,r),this.elementType="i16"}slice(e,t){return this.sliceBuffer(Q,e,t)}static fromTypedArray(e,t){return new Q(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}Q.ElementType="i16";class W extends y{constructor(e,t=0,s,r){super(Int32Array,e,t,s,r),this.elementType="i32"}slice(e,t){return this.sliceBuffer(W,e,t)}static fromTypedArray(e,t){return new W(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}W.ElementType="i32";class X extends n{constructor(e,t=0,s,r){super(Int32Array,e,t,s,r),this.elementType="i32"}slice(e,t){return this.sliceBuffer(X,e,t)}static fromTypedArray(e,t){return new X(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}X.ElementType="i32";class Z extends h{constructor(e,t=0,s,r){super(Int32Array,e,t,s,r),this.elementType="i32"}slice(e,t){return this.sliceBuffer(Z,e,t)}static fromTypedArray(e,t){return new Z(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}Z.ElementType="i32";class k extends c{constructor(e,t=0,s,r){super(Int32Array,e,t,s,r),this.elementType="i32"}slice(e,t){return this.sliceBuffer(k,e,t)}static fromTypedArray(e,t){return new k(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}k.ElementType="i32";export{L as A,R as B,W as C,X as D,N as E,Y as F,Z as G,k as H,F as I,P as L,$ as M,w as O,v as S,O as T,I as U,V,b as a,E as b,a as c,g as d,M as g,S as h,o as i,U as j,j as k,B as l,A as m,m as o,T as p,J as q,l as u,K as v,C as w,x,D as y,Q as z}; +import{fj as G,fg as H,cl as _}from"./index-BjUNJPVf.js";let q=class{constructor(e,t,s=0,r,i){this.TypedArrayConstructor=e,this.elementCount=9;const f=this.TypedArrayConstructor;r===void 0&&(r=9*f.BYTES_PER_ELEMENT);const u=t.byteLength===0?0:s;this.typedBuffer=i==null?new f(t,u):new f(t,u,(i-s)/f.BYTES_PER_ELEMENT),this.typedBufferStride=r/f.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,s=this.count-t){const r=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,r,this.stride,r+s*this.stride)}getMat(e,t){let s=e*this.typedBufferStride;for(let r=0;r<9;r++)t[r]=this.typedBuffer[s++];return t}setMat(e,t){let s=e*this.typedBufferStride;for(let r=0;r<9;r++)this.typedBuffer[s++]=t[r]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,s){this.typedBuffer[e*this.typedBufferStride+t]=s}copyFrom(e,t,s){const r=this.typedBuffer,i=t.typedBuffer;let f=e*this.typedBufferStride,u=s*t.typedBufferStride;for(let p=0;p<9;++p)r[f++]=i[u++]}get buffer(){return this.typedBuffer.buffer}};q.ElementCount=9;let z=class{constructor(e,t,s=0,r,i){this.TypedArrayConstructor=e,this.elementCount=16;const f=this.TypedArrayConstructor;r===void 0&&(r=16*f.BYTES_PER_ELEMENT);const u=t.byteLength===0?0:s;this.typedBuffer=i==null?new f(t,u):new f(t,u,(i-s)/f.BYTES_PER_ELEMENT),this.typedBufferStride=r/f.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,s=this.count-t){const r=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,r,this.stride,r+s*this.stride)}getMat(e,t){let s=e*this.typedBufferStride;for(let r=0;r<16;r++)t[r]=this.typedBuffer[s++];return t}setMat(e,t){let s=e*this.typedBufferStride;for(let r=0;r<16;r++)this.typedBuffer[s++]=t[r]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,s){this.typedBuffer[e*this.typedBufferStride+t]=s}copyFrom(e,t,s){const r=this.typedBuffer,i=t.typedBuffer;let f=e*this.typedBufferStride,u=s*t.typedBufferStride;for(let p=0;p<16;++p)r[f++]=i[u++]}get buffer(){return this.typedBuffer.buffer}};z.ElementCount=16;class y{constructor(e,t,s=0,r,i){this.TypedArrayConstructor=e,this.elementCount=1;const f=this.TypedArrayConstructor;r===void 0&&(r=f.BYTES_PER_ELEMENT);const u=t.byteLength===0?0:s;this.typedBuffer=i==null?new f(t,u):new f(t,u,(i-s)/f.BYTES_PER_ELEMENT),this.stride=r,this.typedBufferStride=r/f.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride)}sliceBuffer(e,t,s=this.count-t){const r=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,r,this.stride,r+s*this.stride)}get(e){return this.typedBuffer[e*this.typedBufferStride]}set(e,t){this.typedBuffer[e*this.typedBufferStride]=t}get buffer(){return this.typedBuffer.buffer}}y.ElementCount=1;let n=class{constructor(e,t,s=0,r,i){this.TypedArrayConstructor=e,this.elementCount=2;const f=this.TypedArrayConstructor;r===void 0&&(r=2*f.BYTES_PER_ELEMENT);const u=t.byteLength===0?0:s;this.typedBuffer=i==null?new f(t,u):new f(t,u,(i-s)/f.BYTES_PER_ELEMENT),this.typedBufferStride=r/f.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,s=this.count-t){const r=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,r,this.stride,r+s*this.stride)}getVec(e,t){return e*=this.typedBufferStride,G(t,this.typedBuffer[e],this.typedBuffer[e+1])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e]=t[1]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,s){this.typedBuffer[e*this.typedBufferStride+t]=s}setValues(e,t,s){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e]=s}copyFrom(e,t,s){const r=this.typedBuffer,i=t.typedBuffer;let f=e*this.typedBufferStride,u=s*t.typedBufferStride;r[f++]=i[u++],r[f]=i[u]}get buffer(){return this.typedBuffer.buffer}};n.ElementCount=2;let h=class{constructor(e,t,s=0,r,i){this.TypedArrayConstructor=e,this.elementCount=3;const f=this.TypedArrayConstructor;r===void 0&&(r=3*f.BYTES_PER_ELEMENT);const u=t.byteLength===0?0:s;this.typedBuffer=i==null?new f(t,u):new f(t,u,(i-s)/f.BYTES_PER_ELEMENT),this.typedBufferStride=r/f.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,s=this.count-t){const r=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,r,this.stride,r+s*this.stride)}getVec(e,t){return e*=this.typedBufferStride,H(t,this.typedBuffer[e],this.typedBuffer[e+1],this.typedBuffer[e+2])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e++]=t[1],this.typedBuffer[e]=t[2]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,s){this.typedBuffer[e*this.typedBufferStride+t]=s}setValues(e,t,s,r){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e++]=s,this.typedBuffer[e]=r}copyFrom(e,t,s){const r=this.typedBuffer,i=t.typedBuffer;let f=e*this.typedBufferStride,u=s*t.typedBufferStride;r[f++]=i[u++],r[f++]=i[u++],r[f]=i[u]}get buffer(){return this.typedBuffer.buffer}};h.ElementCount=3;class c{constructor(e,t,s=0,r,i){this.TypedArrayConstructor=e,this.start=s,this.elementCount=4;const f=this.TypedArrayConstructor;r===void 0&&(r=4*f.BYTES_PER_ELEMENT);const u=t.byteLength===0?0:s;this.typedBuffer=i==null?new f(t,u):new f(t,u,(i-s)/f.BYTES_PER_ELEMENT),this.typedBufferStride=r/f.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,s=this.count-t){const r=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,r,this.stride,r+s*this.stride)}getVec(e,t){return e*=this.typedBufferStride,_(t,this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e++]=t[1],this.typedBuffer[e++]=t[2],this.typedBuffer[e]=t[3]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,s){this.typedBuffer[e*this.typedBufferStride+t]=s}setValues(e,t,s,r,i){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e++]=s,this.typedBuffer[e++]=r,this.typedBuffer[e]=i}copyFrom(e,t,s){const r=this.typedBuffer,i=t.typedBuffer;let f=e*this.typedBufferStride,u=s*t.typedBufferStride;r[f++]=i[u++],r[f++]=i[u++],r[f++]=i[u++],r[f]=i[u]}get buffer(){return this.typedBuffer.buffer}}c.ElementCount=4;class D extends y{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}static fromTypedArray(e,t){return new D(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}D.ElementType="f32";class l extends n{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}slice(e,t){return this.sliceBuffer(l,e,t)}static fromTypedArray(e,t){return new l(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}l.ElementType="f32";class o extends h{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}slice(e,t){return this.sliceBuffer(o,e,t)}static fromTypedArray(e,t){return new o(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}o.ElementType="f32";class a extends c{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}slice(e,t){return this.sliceBuffer(a,e,t)}static fromTypedArray(e,t){return new a(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}a.ElementType="f32";class B extends q{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}slice(e,t){return this.sliceBuffer(B,e,t)}static fromTypedArray(e,t){return new B(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}B.ElementType="f32";class b extends q{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(b,e,t)}static fromTypedArray(e,t){return new b(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}b.ElementType="f64";class T extends z{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}slice(e,t){return this.sliceBuffer(T,e,t)}static fromTypedArray(e,t){return new T(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}T.ElementType="f32";class E extends z{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(E,e,t)}static fromTypedArray(e,t){return new E(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}E.ElementType="f64";class m extends y{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(m,e,t)}static fromTypedArray(e,t){return new m(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}m.ElementType="f64";class A extends n{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(A,e,t)}static fromTypedArray(e,t){return new A(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}A.ElementType="f64";class O extends h{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(O,e,t)}static fromTypedArray(e,t){return new O(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}O.ElementType="f64";class S extends c{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(S,e,t)}static fromTypedArray(e,t){return new S(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}S.ElementType="f64";class g extends y{constructor(e,t=0,s,r){super(Uint8Array,e,t,s,r),this.elementType="u8"}slice(e,t){return this.sliceBuffer(g,e,t)}static fromTypedArray(e,t){return new g(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}g.ElementType="u8";class L extends n{constructor(e,t=0,s,r){super(Uint8Array,e,t,s,r),this.elementType="u8"}slice(e,t){return this.sliceBuffer(L,e,t)}static fromTypedArray(e,t){return new L(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}L.ElementType="u8";class w extends h{constructor(e,t=0,s,r){super(Uint8Array,e,t,s,r),this.elementType="u8"}slice(e,t){return this.sliceBuffer(w,e,t)}static fromTypedArray(e,t){return new w(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}w.ElementType="u8";class x extends c{constructor(e,t=0,s,r){super(Uint8Array,e,t,s,r),this.elementType="u8"}slice(e,t){return this.sliceBuffer(x,e,t)}static fromTypedArray(e,t){return new x(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}x.ElementType="u8";class M extends y{constructor(e,t=0,s,r){super(Uint16Array,e,t,s,r),this.elementType="u16"}slice(e,t){return this.sliceBuffer(M,e,t)}static fromTypedArray(e,t){return new M(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}M.ElementType="u16";class C extends n{constructor(e,t=0,s,r){super(Uint16Array,e,t,s,r),this.elementType="u16"}slice(e,t){return this.sliceBuffer(C,e,t)}static fromTypedArray(e,t){return new C(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}C.ElementType="u16";class N extends h{constructor(e,t=0,s,r){super(Uint16Array,e,t,s,r),this.elementType="u16"}slice(e,t){return this.sliceBuffer(N,e,t)}static fromTypedArray(e,t){return new N(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}N.ElementType="u16";class P extends c{constructor(e,t=0,s,r){super(Uint16Array,e,t,s,r),this.elementType="u16"}slice(e,t){return this.sliceBuffer(P,e,t)}static fromTypedArray(e,t){return new P(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}P.ElementType="u16";class R extends y{constructor(e,t=0,s,r){super(Uint32Array,e,t,s,r),this.elementType="u32"}slice(e,t){return this.sliceBuffer(R,e,t)}static fromTypedArray(e,t){return new R(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}R.ElementType="u32";class Y extends n{constructor(e,t=0,s,r){super(Uint32Array,e,t,s,r),this.elementType="u32"}slice(e,t){return this.sliceBuffer(Y,e,t)}static fromTypedArray(e,t){return new Y(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}Y.ElementType="u32";class F extends h{constructor(e,t=0,s,r){super(Uint32Array,e,t,s,r),this.elementType="u32"}slice(e,t){return this.sliceBuffer(F,e,t)}static fromTypedArray(e,t){return new F(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}F.ElementType="u32";class I extends c{constructor(e,t=0,s,r){super(Uint32Array,e,t,s,r),this.elementType="u32"}slice(e,t){return this.sliceBuffer(I,e,t)}static fromTypedArray(e,t){return new I(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}I.ElementType="u32";class U extends y{constructor(e,t=0,s,r){super(Int8Array,e,t,s,r),this.elementType="i8"}slice(e,t){return this.sliceBuffer(U,e,t)}static fromTypedArray(e,t){return new U(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}U.ElementType="i8";class V extends n{constructor(e,t=0,s,r){super(Int8Array,e,t,s,r),this.elementType="i8"}slice(e,t){return this.sliceBuffer(V,e,t)}static fromTypedArray(e,t){return new V(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}V.ElementType="i8";class $ extends h{constructor(e,t=0,s,r){super(Int8Array,e,t,s,r),this.elementType="i8"}slice(e,t){return this.sliceBuffer($,e,t)}static fromTypedArray(e,t){return new $(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}$.ElementType="i8";class v extends c{constructor(e,t=0,s,r){super(Int8Array,e,t,s,r),this.elementType="i8"}slice(e,t){return this.sliceBuffer(v,e,t)}static fromTypedArray(e,t){return new v(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}v.ElementType="i8";class j extends y{constructor(e,t=0,s,r){super(Int16Array,e,t,s,r),this.elementType="i16"}slice(e,t){return this.sliceBuffer(j,e,t)}static fromTypedArray(e,t){return new j(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}j.ElementType="i16";class J extends n{constructor(e,t=0,s,r){super(Int16Array,e,t,s,r),this.elementType="i16"}slice(e,t){return this.sliceBuffer(J,e,t)}static fromTypedArray(e,t){return new J(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}J.ElementType="i16";class K extends h{constructor(e,t=0,s,r){super(Int16Array,e,t,s,r),this.elementType="i16"}slice(e,t){return this.sliceBuffer(K,e,t)}static fromTypedArray(e,t){return new K(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}K.ElementType="i16";class Q extends c{constructor(e,t=0,s,r){super(Int16Array,e,t,s,r),this.elementType="i16"}slice(e,t){return this.sliceBuffer(Q,e,t)}static fromTypedArray(e,t){return new Q(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}Q.ElementType="i16";class W extends y{constructor(e,t=0,s,r){super(Int32Array,e,t,s,r),this.elementType="i32"}slice(e,t){return this.sliceBuffer(W,e,t)}static fromTypedArray(e,t){return new W(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}W.ElementType="i32";class X extends n{constructor(e,t=0,s,r){super(Int32Array,e,t,s,r),this.elementType="i32"}slice(e,t){return this.sliceBuffer(X,e,t)}static fromTypedArray(e,t){return new X(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}X.ElementType="i32";class Z extends h{constructor(e,t=0,s,r){super(Int32Array,e,t,s,r),this.elementType="i32"}slice(e,t){return this.sliceBuffer(Z,e,t)}static fromTypedArray(e,t){return new Z(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}Z.ElementType="i32";class k extends c{constructor(e,t=0,s,r){super(Int32Array,e,t,s,r),this.elementType="i32"}slice(e,t){return this.sliceBuffer(k,e,t)}static fromTypedArray(e,t){return new k(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}k.ElementType="i32";export{L as A,R as B,W as C,X as D,N as E,Y as F,Z as G,k as H,F as I,P as L,$ as M,w as O,v as S,O as T,I as U,V,b as a,E as b,a as c,g as d,M as g,S as h,o as i,U as j,j as k,B as l,A as m,m as o,T as p,J as q,l as u,K as v,C as w,x,D as y,Q as z}; diff --git a/assets/BuildingSceneLayer-Bhih74F5.js b/assets/BuildingSceneLayer-DAfQRDdR.js similarity index 87% rename from assets/BuildingSceneLayer-Bhih74F5.js rename to assets/BuildingSceneLayer-DAfQRDdR.js index d31f013..ede953c 100644 --- a/assets/BuildingSceneLayer-Bhih74F5.js +++ b/assets/BuildingSceneLayer-DAfQRDdR.js @@ -1 +1 @@ -import{dn as de,d as t,y as s,aZ as I,dS as ce,k3 as _,f as p,h7 as he,fw as ee,hk as te,s as x,M as re,aX as me,hW as ge,N as F,j as fe,aE as ve,aS as se,bR as be,fD as Se,i as we,c9 as ie,aY as $e,V as b,au as Oe,k4 as xe,aU as g,aV as d,k5 as Fe,da as Ie,dM as Le,dp as je,dq as Te,bQ as Be,dr as Ee,dO as Ae,dN as Pe,C as _e,b_ as qe,ay as Ne,dQ as Re,k6 as ke,dt as Me,e8 as Ue,bT as Qe}from"./index-CEWggaxV.js";import"./UniqueValueRenderer-BlkUix3g.js";import{u as De}from"./jsonUtils-BseLl1fZ.js";import oe from"./FeatureLayer-D0kMrROG.js";import{m as Ke,s as Ve}from"./capabilities-BQHqqlJu.js";import{s as Ce}from"./fieldProperties-DMs4wT6-.js";import{Z as Ze}from"./FieldsIndex-CLgRNeJ_.js";import{r as He,L as Je,P as Z}from"./SceneService-l5OfqT0E.js";import{s as We,l as Ge,u as Xe,m as ze}from"./I3SLayerDefinitions-B6gGfNoh.js";import{p as Ye}from"./popupUtils-DAFYyAvw.js";import{$ as et}from"./I3SUtil-DxFIPSkh.js";import{n as tt,p as rt}from"./popupUtils-BovqErR_.js";import{s as st}from"./associatedFeatureServiceUtils-BIEHgyxo.js";import{I as H,x as it,Z as ot}from"./elevationInfoUtils-Dag_mzct.js";import"./ColorStop-44hBlQ14.js";import"./diffUtils-B4YFa5Ju.js";import"./colorRamps-BJydlf0f.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-z2k12BH8.js";import"./jsonUtils-qYmXvGJ1.js";import"./styleUtils-CnV_Xzhi.js";import"./Version-Bd0QsIQ5.js";import"./OverrideHelper-B4ryGWZb.js";import"./utils-p-5Bbga5.js";import"./quantizationUtils-CUjGHrU3.js";import"./heatmapUtils-Clt5rJzr.js";import"./FormTemplate-eV18QveB.js";import"./editsZScale-CQCGPEjO.js";import"./queryZScale-DN4aFXYn.js";import"./FeatureSet-CYJUZgOk.js";import"./EditBusLayer-SG7oYwiY.js";import"./FeatureEffectLayer-CLTrRFqx.js";import"./FeatureEffect-ByrbZlne.js";import"./FeatureLayerBase-DPJuwFpX.js";import"./featureLayerUtils-BhDaw8pS.js";import"./AttachmentQuery-D61mmWw4.js";import"./RelationshipQuery-DDK72Kwc.js";import"./LayerFloorInfo-Cdq3ulNh.js";import"./serviceCapabilitiesUtils-t8SL4e_j.js";import"./FeatureReductionLayer-DncGsNIN.js";import"./FeatureReductionSelection-BY3KVXac.js";import"./LabelClass-6cZokw8y.js";import"./labelUtils-Dnqx6jl5.js";import"./defaultsJSON-CHAaurhX.js";import"./MD5-C9MwAd2G.js";import"./OrderedLayer-Do089KpQ.js";import"./OrderByInfo-DKzv2-WS.js";import"./RefreshableLayer-1EkEhJeI.js";import"./TemporalLayer-qq3v_i3q.js";import"./TimeInfo-3TVmpFSA.js";import"./FeatureTemplate-DcprAdTM.js";import"./FeatureType-By3BEr9z.js";import"./labelingInfo-CijajRsc.js";import"./versionUtils-CaceEUVY.js";import"./styleUtils-B_Iy1DTk.js";import"./TopFeaturesQuery-B8kC7n5h.js";import"./interfaces-CL2NbQte.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./originUtils-D69mHv66.js";import"./multiOriginJSONSupportUtils-C0wm8_Yw.js";import"./resourceUtils-Cu1-5qu3.js";import"./resourceUtils-CjqYbm2Q.js";import"./saveAPIKeyUtils-BiX1lQSW.js";import"./saveUtils-BzCRy3uR.js";import"./mat4f64-CSKppSlJ.js";import"./computeTranslationToOriginAndRotation-DOOKw0d1.js";import"./sphere-DHd2K2LR.js";import"./ObjectStack-CF0cQvd2.js";import"./plane-py4f_JCU.js";import"./mat3f64-q3fE-ZOt.js";import"./quatf64-Bdb9ZJJK.js";import"./I3SBinaryReader-N_Is4gxa.js";import"./VertexAttribute-BlT9lbVY.js";import"./symbolColorUtils-D_minlYz.js";import"./orientedBoundingBox-BQdJNYvE.js";import"./quat-CoKEr4Zu.js";let y=class extends de(he){constructor(r){super(r),this.title="",this.id=-1,this.modelName=null,this.isEmpty=null,this.legendEnabled=!0,this.visible=!0,this.opacity=1}readTitle(r,i){return typeof i.alias=="string"?i.alias:typeof i.name=="string"?i.name:""}readIdOnlyOnce(r){return this.id!==-1?this.id:typeof r=="number"?r:-1}};t([s({type:String,json:{origins:{"web-scene":{write:!0},"portal-item":{write:!0}}}})],y.prototype,"title",void 0),t([I("service","title",["alias","name"])],y.prototype,"readTitle",null),t([s()],y.prototype,"layer",void 0),t([s({type:ce,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],y.prototype,"id",void 0),t([I("service","id")],y.prototype,"readIdOnlyOnce",null),t([s(_(String))],y.prototype,"modelName",void 0),t([s(_(Boolean))],y.prototype,"isEmpty",void 0),t([s({type:Boolean,nonNullable:!0})],y.prototype,"legendEnabled",void 0),t([s({type:Boolean,json:{name:"visibility",write:!0}})],y.prototype,"visible",void 0),t([s({type:Number,json:{write:!0}})],y.prototype,"opacity",void 0),y=t([p("esri.layers.buildingSublayers.BuildingSublayer")],y);const ae=y,J=Ce();let o=class extends Ke(ee.LoadableMixin(te(ae))){constructor(e){super(e),this.type="building-component",this.nodePages=null,this.materialDefinitions=[],this.textureSetDefinitions=[],this.geometryDefinitions=[],this.indexInfo=null,this.serviceUpdateTimeStamp=null,this.store=null,this.attributeStorageInfo=[],this.fields=[],this.associatedLayer=null,this.outFields=null,this.listMode="show",this.renderer=null,this.definitionExpression=null,this.popupEnabled=!0,this.popupTemplate=null,this.layerType="3d-object"}get parsedUrl(){var e,r;return this.layer?{path:`${(e=this.layer.parsedUrl)==null?void 0:e.path}/sublayers/${this.id}`,query:(r=this.layer.parsedUrl)==null?void 0:r.query}:{path:""}}get fieldsIndex(){return new Ze(this.fields)}readAssociatedLayer(e,r){const i=this.layer.associatedFeatureServiceItem,a=r.associatedLayerID;return i!=null&&typeof a=="number"?new oe({portalItem:i,customParameters:this.customParameters,layerId:a}):null}get objectIdField(){if(this.fields!=null){for(const e of this.fields)if(e.type==="oid")return e.name}return null}get displayField(){return this.associatedLayer!=null?this.associatedLayer.displayField:void 0}get apiKey(){return this.layer.apiKey}get customParameters(){return this.layer.customParameters}get fullExtent(){return this.layer.fullExtent}get spatialReference(){return this.layer.spatialReference}get version(){return this.layer.version}get elevationInfo(){return this.layer.elevationInfo}get minScale(){return this.layer.minScale}get maxScale(){return this.layer.maxScale}get effectiveScaleRange(){return this.layer.effectiveScaleRange}get defaultPopupTemplate(){return this.createPopupTemplate()}load(e){const r=e!=null?e.signal:null,i=this._fetchService(r).then(()=>{this.indexInfo=He(this.parsedUrl.path,this.rootNode,this.nodePages,this.customParameters,this.apiKey,x.getLogger(this),r)});return this.addResolvingPromise(i),Promise.resolve(this)}createPopupTemplate(e){return Ye(this,e)}async _fetchService(e){const r=(await re(this.parsedUrl.path,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e})).data;this.read(r,{origin:"service",url:this.parsedUrl})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,r){var a,n,c;const i=(n=(a=this.getFeatureType(r==null?void 0:r.feature))==null?void 0:a.domains)==null?void 0:n[e];return i&&i.type!=="inherited"?i:((c=this.getField(e))==null?void 0:c.domain)??null}getFeatureType(e){return e&&this.associatedLayer!=null?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer!=null?this.associatedLayer.types??[]:[]}get typeIdField(){return this.associatedLayer!=null?this.associatedLayer.typeIdField:null}get geometryType(){return this.layerType==="3d-object"?"mesh":"point"}get profile(){return this.layerType==="3d-object"?"mesh-pyramids":"points"}get capabilities(){const e=this.associatedLayer!=null&&this.associatedLayer.capabilities?this.associatedLayer.capabilities:Ve,{query:r,data:{supportsZ:i,supportsM:a,isVersioned:n}}=e;return{query:r,data:{supportsZ:i,supportsM:a,isVersioned:n}}}createQuery(){const e=new me;return this.geometryType!=="mesh"&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e}queryExtent(e,r){return this._getAssociatedLayerForQuery().then(i=>i.queryExtent(e||this.createQuery(),r))}queryFeatureCount(e,r){return this._getAssociatedLayerForQuery().then(i=>i.queryFeatureCount(e||this.createQuery(),r))}queryFeatures(e,r){return this._getAssociatedLayerForQuery().then(i=>i.queryFeatures(e||this.createQuery(),r)).then(i=>{if(i!=null&&i.features)for(const a of i.features)a.layer=this.layer,a.sourceLayer=this;return i})}queryObjectIds(e,r){return this._getAssociatedLayerForQuery().then(i=>i.queryObjectIds(e||this.createQuery(),r))}async queryCachedAttributes(e,r){const i=ge(this.fieldsIndex,await tt(this,rt(this)));return et(this.parsedUrl.path,this.attributeStorageInfo,e,r,i,this.apiKey,this.customParameters)}async queryCachedFeature(e,r){const i=await this.queryCachedAttributes(e,[r]);if(!i||i.length===0)throw new F("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const a=new fe;return a.attributes=i[0],a.layer=this,a.sourceLayer=this,a}getFieldUsageInfo(e){return this.fieldsIndex.has(e)?{supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1}:{supportsLabelingInfo:!1,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:this.associatedLayer!=null}}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e!=null&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),this.associatedLayer==null)throw new F("buildingscenelayer:query-not-available","BuildingSceneLayer component layer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new F("buildingscenelayer:query-not-available","BuildingSceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}};t([s({readOnly:!0})],o.prototype,"parsedUrl",null),t([s({type:We,readOnly:!0})],o.prototype,"nodePages",void 0),t([s({type:[Ge],readOnly:!0})],o.prototype,"materialDefinitions",void 0),t([s({type:[Xe],readOnly:!0})],o.prototype,"textureSetDefinitions",void 0),t([s({type:[ze],readOnly:!0})],o.prototype,"geometryDefinitions",void 0),t([s({readOnly:!0})],o.prototype,"serviceUpdateTimeStamp",void 0),t([s({readOnly:!0})],o.prototype,"store",void 0),t([s({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],o.prototype,"rootNode",void 0),t([s({readOnly:!0})],o.prototype,"attributeStorageInfo",void 0),t([s(J.fields)],o.prototype,"fields",void 0),t([s({readOnly:!0})],o.prototype,"fieldsIndex",null),t([s({readOnly:!0,type:oe})],o.prototype,"associatedLayer",void 0),t([I("service","associatedLayer",["associatedLayerID"])],o.prototype,"readAssociatedLayer",null),t([s(J.outFields)],o.prototype,"outFields",void 0),t([s({type:String,readOnly:!0})],o.prototype,"objectIdField",null),t([s({readOnly:!0,type:String,json:{read:!1}})],o.prototype,"displayField",null),t([s({readOnly:!0,type:String})],o.prototype,"apiKey",null),t([s({readOnly:!0,type:String})],o.prototype,"customParameters",null),t([s({readOnly:!0,type:ve})],o.prototype,"fullExtent",null),t([s({readOnly:!0,type:se})],o.prototype,"spatialReference",null),t([s({readOnly:!0})],o.prototype,"version",null),t([s({readOnly:!0,type:be})],o.prototype,"elevationInfo",null),t([s({readOnly:!0,type:Number})],o.prototype,"minScale",null),t([s({readOnly:!0,type:Number})],o.prototype,"maxScale",null),t([s({readOnly:!0,type:Number})],o.prototype,"effectiveScaleRange",null),t([s({type:["hide","show"],json:{write:!0}})],o.prototype,"listMode",void 0),t([s({types:De,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],o.prototype,"renderer",void 0),t([s({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),t([s(Se)],o.prototype,"popupEnabled",void 0),t([s({type:we,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],o.prototype,"popupTemplate",void 0),t([s({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],o.prototype,"normalReferenceFrame",void 0),t([s({readOnly:!0,json:{read:!1}})],o.prototype,"defaultPopupTemplate",null),t([s()],o.prototype,"types",null),t([s()],o.prototype,"typeIdField",null),t([s({json:{write:!1}}),ie(new $e({"3DObject":"3d-object",Point:"point"}))],o.prototype,"layerType",void 0),t([s()],o.prototype,"geometryType",null),t([s()],o.prototype,"profile",null),t([s({readOnly:!0,json:{read:!1}})],o.prototype,"capabilities",null),o=t([p("esri.layers.buildingSublayers.BuildingComponentSublayer")],o);const q=o;var N;const W={type:b,readOnly:!0,json:{origins:{service:{read:{source:"sublayers",reader:ne}}},read:!1}};function ne(e,r,i){if(e&&Array.isArray(e))return new b(e.map(a=>{const n=at(a);if(n){const c=new n;return c.read(a,i),c}return i!=null&&i.messages&&a&&i.messages.push(new Oe("building-scene-layer:unsupported-sublayer-type","Building scene sublayer of type '"+(a.type||"unknown")+"' are not supported",{definition:a,context:i})),null}))}let m=N=class extends ae{constructor(e){super(e),this.type="building-group",this.listMode="show",this.sublayers=null}loadAll(){return xe(this,e=>N.forEachSublayer(this.sublayers,r=>{r.type!=="building-group"&&e(r)}))}};function at(e){return e.layerType==="group"?m:q}t([s({type:["hide","show","hide-children"],json:{write:!0}})],m.prototype,"listMode",void 0),t([s(W)],m.prototype,"sublayers",void 0),m=N=t([p("esri.layers.buildingSublayers.BuildingGroupSublayer")],m),function(e){function r(i,a){i.forEach(n=>{a(n),n.type==="building-group"&&r(n.sublayers,a)})}e.sublayersProperty=W,e.readSublayers=ne,e.forEachSublayer=r}(m||(m={}));const f=m;let L=class extends g{constructor(){super(...arguments),this.type=null}};t([s({type:String,readOnly:!0,json:{write:!0}})],L.prototype,"type",void 0),L=t([p("esri.layers.support.BuildingFilterAuthoringInfo")],L);const le=L;var R;let S=R=class extends g{constructor(){super(...arguments),this.filterType=null,this.filterValues=null}clone(){return new R({filterType:this.filterType,filterValues:d(this.filterValues)})}};t([s({type:String,json:{write:!0}})],S.prototype,"filterType",void 0),t([s({type:[String],json:{write:!0}})],S.prototype,"filterValues",void 0),S=R=t([p("esri.layers.support.BuildingFilterAuthoringInfoType")],S);const nt=S;var k;const lt=b.ofType(nt);let j=k=class extends g{clone(){return new k({filterTypes:d(this.filterTypes)})}};t([s({type:lt,json:{write:!0}})],j.prototype,"filterTypes",void 0),j=k=t([p("esri.layers.support.BuildingFilterAuthoringInfoBlock")],j);const pt=j;var M;const yt=b.ofType(pt);let w=M=class extends le{constructor(){super(...arguments),this.type="checkbox"}clone(){return new M({filterBlocks:d(this.filterBlocks)})}};t([s({type:["checkbox"]})],w.prototype,"type",void 0),t([s({type:yt,json:{write:!0}})],w.prototype,"filterBlocks",void 0),w=M=t([p("esri.layers.support.BuildingFilterAuthoringInfoCheckbox")],w);const G=w;let T=class extends g{};t([s({readOnly:!0,json:{read:!1}})],T.prototype,"type",void 0),T=t([p("esri.layers.support.BuildingFilterMode")],T);const A=T;var U;let B=U=class extends A{constructor(){super(...arguments),this.type="solid"}clone(){return new U}};t([s({type:["solid"],readOnly:!0,json:{write:!0}})],B.prototype,"type",void 0),B=U=t([p("esri.layers.support.BuildingFilterModeSolid")],B);const Q=B;var D;let $=D=class extends A{constructor(){super(...arguments),this.type="wire-frame",this.edges=null}clone(){return new D({edges:d(this.edges)})}};t([ie({wireFrame:"wire-frame"})],$.prototype,"type",void 0),t([s(Fe)],$.prototype,"edges",void 0),$=D=t([p("esri.layers.support.BuildingFilterModeWireFrame")],$);const X=$;var K;let E=K=class extends A{constructor(){super(...arguments),this.type="x-ray"}clone(){return new K}};t([s({type:["x-ray"],readOnly:!0,json:{write:!0}})],E.prototype,"type",void 0),E=K=t([p("esri.layers.support.BuildingFilterModeXRay")],E);const z=E;var V;const ut={nonNullable:!0,types:{key:"type",base:A,typeMap:{solid:Q,"wire-frame":X,"x-ray":z}},json:{read:e=>{switch(e==null?void 0:e.type){case"solid":return Q.fromJSON(e);case"wireFrame":return X.fromJSON(e);case"x-ray":return z.fromJSON(e);default:return}},write:{enabled:!0,isRequired:!0}}};let v=V=class extends g{constructor(){super(...arguments),this.filterExpression=null,this.filterMode=new Q,this.title=""}clone(){return new V({filterExpression:this.filterExpression,filterMode:d(this.filterMode),title:this.title})}};t([s({type:String,json:{write:{enabled:!0,isRequired:!0}}})],v.prototype,"filterExpression",void 0),t([s(ut)],v.prototype,"filterMode",void 0),t([s({type:String,json:{write:{enabled:!0,isRequired:!0}}})],v.prototype,"title",void 0),v=V=t([p("esri.layers.support.BuildingFilterBlock")],v);const dt=v;var C;const ct=b.ofType(dt);let h=C=class extends g{constructor(){super(...arguments),this.description=null,this.filterBlocks=null,this.id=Ie(),this.name=null}clone(){return new C({description:this.description,filterBlocks:d(this.filterBlocks),id:this.id,name:this.name,filterAuthoringInfo:d(this.filterAuthoringInfo)})}};t([s({type:String,json:{write:!0}})],h.prototype,"description",void 0),t([s({type:ct,json:{write:{enabled:!0,isRequired:!0}}})],h.prototype,"filterBlocks",void 0),t([s({types:{key:"type",base:le,typeMap:{checkbox:G}},json:{read:e=>(e==null?void 0:e.type)==="checkbox"?G.fromJSON(e):null,write:!0}})],h.prototype,"filterAuthoringInfo",void 0),t([s({type:String,constructOnly:!0,json:{write:{enabled:!0,isRequired:!0}}})],h.prototype,"id",void 0),t([s({type:String,json:{write:{enabled:!0,isRequired:!0}}})],h.prototype,"name",void 0),h=C=t([p("esri.layers.support.BuildingFilter")],h);const ht=h;let u=class extends g{constructor(){super(...arguments),this.fieldName=null,this.modelName=null,this.label=null,this.min=null,this.max=null,this.mostFrequentValues=null,this.subLayerIds=null}};t([s({type:String})],u.prototype,"fieldName",void 0),t([s({type:String})],u.prototype,"modelName",void 0),t([s({type:String})],u.prototype,"label",void 0),t([s({type:Number})],u.prototype,"min",void 0),t([s({type:Number})],u.prototype,"max",void 0),t([s({json:{read:e=>Array.isArray(e)&&(e.every(r=>typeof r=="string")||e.every(r=>typeof r=="number"))?e.slice():null}})],u.prototype,"mostFrequentValues",void 0),t([s({type:[Number]})],u.prototype,"subLayerIds",void 0),u=t([p("esri.layers.support.BuildingFieldStatistics")],u);let O=class extends ee.LoadableMixin(te(g)){constructor(){super(...arguments),this.url=null}get fields(){return this.loaded||this.loadStatus==="loading"?this._get("fields"):(x.getLogger(this).error("building summary statistics are not loaded"),null)}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this._fetchService(r)),Promise.resolve(this)}async _fetchService(e){const r=(await re(this.url,{query:{f:"json"},responseType:"json",signal:e})).data;this.read(r,{origin:"service"})}};t([s({constructOnly:!0,type:String})],O.prototype,"url",void 0),t([s({readOnly:!0,type:[u],json:{read:{source:"summary"}}})],O.prototype,"fields",null),O=t([p("esri.layers.support.BuildingSummaryStatistics")],O);const pe=O,ye=b.ofType(ht),ue=d(f.sublayersProperty);var Y;const P=(Y=ue.json)==null?void 0:Y.origins;P&&(P["web-scene"]={type:[q],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}},P["portal-item"]={type:[q],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}});let l=class extends Je(Le(je(Te(Be(Ee(Ae(Pe(Qe)))))))){constructor(e){super(e),this.operationalLayerType="BuildingSceneLayer",this.allSublayers=new _e({getCollections:()=>[this.sublayers],getChildrenFunction:r=>r.type==="building-group"?r.sublayers:null}),this.sublayers=null,this._sublayerOverrides=null,this.filters=new ye,this.activeFilterId=null,this.summaryStatistics=null,this.outFields=null,this.legendEnabled=!0,this.type="building-scene"}normalizeCtorArgs(e){return typeof e=="string"?{url:e}:e??{}}destroy(){this.allSublayers.destroy()}readSublayers(e,r,i){const a=f.readSublayers(e,r,i);return f.forEachSublayer(a,n=>n.layer=this),this._sublayerOverrides&&(this.applySublayerOverrides(a,this._sublayerOverrides),this._sublayerOverrides=null),a}applySublayerOverrides(e,{overrides:r,context:i}){f.forEachSublayer(e,a=>a.read(r.get(a.id),i))}readSublayerOverrides(e,r){var a;const i=new Map;for(const n of e)n!=null&&typeof n=="object"&&typeof n.id=="number"?i.set(n.id,n):(a=r.messages)==null||a.push(new F("building-scene-layer:invalid-sublayer-override","Invalid value for sublayer override. Not an object or no id specified.",{value:n}));return{overrides:i,context:r}}writeSublayerOverrides(e,r,i){const a=[];f.forEachSublayer(this.sublayers,n=>{const c=n.write({},i);Object.keys(c).length>1&&a.push(c)}),a.length>0&&(r.sublayers=a)}writeUnappliedOverrides(e,r){r.sublayers=[],e.overrides.forEach(i=>{r.sublayers.push(d(i))})}write(e,r){return e=super.write(e,r),!r||r.origin!=="web-scene"&&r.origin!=="portal-item"||(this.sublayers?this.writeSublayerOverrides(this.sublayers,e,r):this._sublayerOverrides&&this.writeUnappliedOverrides(this._sublayerOverrides,e)),e}read(e,r){if(super.read(e,r),r&&(r.origin==="web-scene"||r.origin==="portal-item")&&e!=null&&Array.isArray(e.sublayers)){const i=this.readSublayerOverrides(e.sublayers,r);this.sublayers?this.applySublayerOverrides(this.sublayers,i):this._sublayerOverrides=i}}readSummaryStatistics(e,r){var i;if(typeof r.statisticsHRef=="string"){const a=qe((i=this.parsedUrl)==null?void 0:i.path,r.statisticsHRef);return new pe({url:a})}return null}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}load(e){const r=e!=null?e.signal:null,i=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(Ne).then(()=>this._fetchService(r)).then(()=>this._fetchAssociatedFeatureService(r));return this.addResolvingPromise(i),Promise.resolve(this)}loadAll(){return Re(this,e=>{f.forEachSublayer(this.sublayers,r=>{r.type!=="building-group"&&e(r)}),this.summaryStatistics&&e(this.summaryStatistics)})}async saveAs(e,r){return this._debouncedSaveOperations(Z.SAVE_AS,{...r,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"};return this._debouncedSaveOperations(Z.SAVE,e)}validateLayer(e){if(!e.layerType||e.layerType!=="Building")throw new F("buildingscenelayer:layer-type-not-supported","BuildingSceneLayer does not support this layer type",{layerType:e.layerType})}_getTypeKeywords(){return["Building"]}async _fetchAssociatedFeatureService(e){try{const{portalItem:r}=await st(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e});this.associatedFeatureServiceItem=r}catch(r){x.getLogger(this).warn("Associated feature service item could not be loaded",r)}}_validateElevationInfo(){const e=this.elevationInfo,r="Building scene layers";H(x.getLogger(this),it(r,"absolute-height",e)),H(x.getLogger(this),ot(r,e))}};t([s({type:["BuildingSceneLayer"]})],l.prototype,"operationalLayerType",void 0),t([s({readOnly:!0})],l.prototype,"allSublayers",void 0),t([s(ue)],l.prototype,"sublayers",void 0),t([I("service","sublayers")],l.prototype,"readSublayers",null),t([s({type:ye,nonNullable:!0,json:{write:!0}})],l.prototype,"filters",void 0),t([s({type:String,json:{write:!0}})],l.prototype,"activeFilterId",void 0),t([s({readOnly:!0,type:pe})],l.prototype,"summaryStatistics",void 0),t([I("summaryStatistics",["statisticsHRef"])],l.prototype,"readSummaryStatistics",null),t([s({type:[String],json:{read:!1}})],l.prototype,"outFields",void 0),t([s(ke)],l.prototype,"fullExtent",void 0),t([s(Me)],l.prototype,"legendEnabled",void 0),t([s({type:["show","hide","hide-children"]})],l.prototype,"listMode",void 0),t([s(_(se))],l.prototype,"spatialReference",void 0),t([s(Ue)],l.prototype,"elevationInfo",null),t([s({json:{read:!1},readOnly:!0})],l.prototype,"type",void 0),t([s()],l.prototype,"associatedFeatureServiceItem",void 0),l=t([p("esri.layers.BuildingSceneLayer")],l);const Mr=l;export{Mr as default}; +import{dn as de,d as t,y as s,aZ as I,dS as ce,k3 as _,f as p,h7 as he,fw as ee,hk as te,s as x,M as re,aX as me,hW as ge,N as F,j as fe,aE as ve,aS as se,bR as be,fD as Se,i as we,c9 as ie,aY as $e,V as b,au as Oe,k4 as xe,aU as g,aV as d,k5 as Fe,da as Ie,dM as Le,dp as je,dq as Te,bQ as Be,dr as Ee,dO as Ae,dN as Pe,C as _e,b_ as qe,ay as Ne,dQ as Re,k6 as ke,dt as Me,e8 as Ue,bT as Qe}from"./index-BjUNJPVf.js";import"./UniqueValueRenderer-7V9Bhr-D.js";import{u as De}from"./jsonUtils-Dw332y6z.js";import oe from"./FeatureLayer-BHxNIHhy.js";import{m as Ke,s as Ve}from"./capabilities-DXGHT-QH.js";import{s as Ce}from"./fieldProperties-DnrQXLBM.js";import{Z as Ze}from"./FieldsIndex-CK-0B5n9.js";import{r as He,L as Je,P as Z}from"./SceneService-DbS150xR.js";import{s as We,l as Ge,u as Xe,m as ze}from"./I3SLayerDefinitions-Bc0e5Sgz.js";import{p as Ye}from"./popupUtils-DlZin22m.js";import{$ as et}from"./I3SUtil-Bs1mZiKI.js";import{n as tt,p as rt}from"./popupUtils-Do2GfZME.js";import{s as st}from"./associatedFeatureServiceUtils-nLeTqfYC.js";import{I as H,x as it,Z as ot}from"./elevationInfoUtils-DIYaTlLQ.js";import"./ColorStop-DCGjAKLC.js";import"./diffUtils-uUoMDFQS.js";import"./colorRamps-CcakIWlU.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-BX9G5gNQ.js";import"./jsonUtils-Ox5U0P0F.js";import"./styleUtils-DOUOskVZ.js";import"./Version-Dqq_CHBG.js";import"./OverrideHelper-DxFZBnGL.js";import"./utils-CuXO_Zzq.js";import"./quantizationUtils-CfV316jZ.js";import"./heatmapUtils-BSteZBTj.js";import"./FormTemplate-BGxtsGX6.js";import"./editsZScale-Bfe6gH1b.js";import"./queryZScale-Dwvn5BlQ.js";import"./FeatureSet-opEn8ou8.js";import"./EditBusLayer-OslMX9fF.js";import"./FeatureEffectLayer-DarO4Ctx.js";import"./FeatureEffect-DBbkrS6j.js";import"./FeatureLayerBase-D0I-Escx.js";import"./featureLayerUtils-lwqyOSrl.js";import"./AttachmentQuery-DmEAIZff.js";import"./RelationshipQuery-BDJrOxaX.js";import"./LayerFloorInfo-DlYNbO-A.js";import"./serviceCapabilitiesUtils-DiP90Uds.js";import"./FeatureReductionLayer-CK-tyM-9.js";import"./FeatureReductionSelection-t3T7oa8H.js";import"./LabelClass-CeatfK8u.js";import"./labelUtils-3p0-m-Ee.js";import"./defaultsJSON-CHAaurhX.js";import"./MD5-C9MwAd2G.js";import"./OrderedLayer-dLoPhxcx.js";import"./OrderByInfo-DKyk5GLW.js";import"./RefreshableLayer-_r2TPtol.js";import"./TemporalLayer-CKICYnEl.js";import"./TimeInfo-DooETFWC.js";import"./FeatureTemplate-FZNGA_Ik.js";import"./FeatureType-CwUl8Nf5.js";import"./labelingInfo-DqAUis6e.js";import"./versionUtils-BIAEZzrm.js";import"./styleUtils--I7zqeL6.js";import"./TopFeaturesQuery-CVQjqlfM.js";import"./interfaces-CL2NbQte.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./originUtils-D69mHv66.js";import"./multiOriginJSONSupportUtils-C0wm8_Yw.js";import"./resourceUtils-p9pTIVIi.js";import"./resourceUtils-CfE36DzP.js";import"./saveAPIKeyUtils-YRBbgdzi.js";import"./saveUtils-CGGzyvzv.js";import"./mat4f64-CSKppSlJ.js";import"./computeTranslationToOriginAndRotation-BeE3rOSz.js";import"./sphere-F1imyuMS.js";import"./ObjectStack-BAIuPeIh.js";import"./plane-DxOTtTwj.js";import"./mat3f64-q3fE-ZOt.js";import"./quatf64-Bdb9ZJJK.js";import"./I3SBinaryReader-Bg6QQKyW.js";import"./VertexAttribute-BlT9lbVY.js";import"./symbolColorUtils-C9Wp-TPe.js";import"./orientedBoundingBox-sJmHxD3E.js";import"./quat-C0wQB0HB.js";let y=class extends de(he){constructor(r){super(r),this.title="",this.id=-1,this.modelName=null,this.isEmpty=null,this.legendEnabled=!0,this.visible=!0,this.opacity=1}readTitle(r,i){return typeof i.alias=="string"?i.alias:typeof i.name=="string"?i.name:""}readIdOnlyOnce(r){return this.id!==-1?this.id:typeof r=="number"?r:-1}};t([s({type:String,json:{origins:{"web-scene":{write:!0},"portal-item":{write:!0}}}})],y.prototype,"title",void 0),t([I("service","title",["alias","name"])],y.prototype,"readTitle",null),t([s()],y.prototype,"layer",void 0),t([s({type:ce,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],y.prototype,"id",void 0),t([I("service","id")],y.prototype,"readIdOnlyOnce",null),t([s(_(String))],y.prototype,"modelName",void 0),t([s(_(Boolean))],y.prototype,"isEmpty",void 0),t([s({type:Boolean,nonNullable:!0})],y.prototype,"legendEnabled",void 0),t([s({type:Boolean,json:{name:"visibility",write:!0}})],y.prototype,"visible",void 0),t([s({type:Number,json:{write:!0}})],y.prototype,"opacity",void 0),y=t([p("esri.layers.buildingSublayers.BuildingSublayer")],y);const ae=y,J=Ce();let o=class extends Ke(ee.LoadableMixin(te(ae))){constructor(e){super(e),this.type="building-component",this.nodePages=null,this.materialDefinitions=[],this.textureSetDefinitions=[],this.geometryDefinitions=[],this.indexInfo=null,this.serviceUpdateTimeStamp=null,this.store=null,this.attributeStorageInfo=[],this.fields=[],this.associatedLayer=null,this.outFields=null,this.listMode="show",this.renderer=null,this.definitionExpression=null,this.popupEnabled=!0,this.popupTemplate=null,this.layerType="3d-object"}get parsedUrl(){var e,r;return this.layer?{path:`${(e=this.layer.parsedUrl)==null?void 0:e.path}/sublayers/${this.id}`,query:(r=this.layer.parsedUrl)==null?void 0:r.query}:{path:""}}get fieldsIndex(){return new Ze(this.fields)}readAssociatedLayer(e,r){const i=this.layer.associatedFeatureServiceItem,a=r.associatedLayerID;return i!=null&&typeof a=="number"?new oe({portalItem:i,customParameters:this.customParameters,layerId:a}):null}get objectIdField(){if(this.fields!=null){for(const e of this.fields)if(e.type==="oid")return e.name}return null}get displayField(){return this.associatedLayer!=null?this.associatedLayer.displayField:void 0}get apiKey(){return this.layer.apiKey}get customParameters(){return this.layer.customParameters}get fullExtent(){return this.layer.fullExtent}get spatialReference(){return this.layer.spatialReference}get version(){return this.layer.version}get elevationInfo(){return this.layer.elevationInfo}get minScale(){return this.layer.minScale}get maxScale(){return this.layer.maxScale}get effectiveScaleRange(){return this.layer.effectiveScaleRange}get defaultPopupTemplate(){return this.createPopupTemplate()}load(e){const r=e!=null?e.signal:null,i=this._fetchService(r).then(()=>{this.indexInfo=He(this.parsedUrl.path,this.rootNode,this.nodePages,this.customParameters,this.apiKey,x.getLogger(this),r)});return this.addResolvingPromise(i),Promise.resolve(this)}createPopupTemplate(e){return Ye(this,e)}async _fetchService(e){const r=(await re(this.parsedUrl.path,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e})).data;this.read(r,{origin:"service",url:this.parsedUrl})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,r){var a,n,c;const i=(n=(a=this.getFeatureType(r==null?void 0:r.feature))==null?void 0:a.domains)==null?void 0:n[e];return i&&i.type!=="inherited"?i:((c=this.getField(e))==null?void 0:c.domain)??null}getFeatureType(e){return e&&this.associatedLayer!=null?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer!=null?this.associatedLayer.types??[]:[]}get typeIdField(){return this.associatedLayer!=null?this.associatedLayer.typeIdField:null}get geometryType(){return this.layerType==="3d-object"?"mesh":"point"}get profile(){return this.layerType==="3d-object"?"mesh-pyramids":"points"}get capabilities(){const e=this.associatedLayer!=null&&this.associatedLayer.capabilities?this.associatedLayer.capabilities:Ve,{query:r,data:{supportsZ:i,supportsM:a,isVersioned:n}}=e;return{query:r,data:{supportsZ:i,supportsM:a,isVersioned:n}}}createQuery(){const e=new me;return this.geometryType!=="mesh"&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e}queryExtent(e,r){return this._getAssociatedLayerForQuery().then(i=>i.queryExtent(e||this.createQuery(),r))}queryFeatureCount(e,r){return this._getAssociatedLayerForQuery().then(i=>i.queryFeatureCount(e||this.createQuery(),r))}queryFeatures(e,r){return this._getAssociatedLayerForQuery().then(i=>i.queryFeatures(e||this.createQuery(),r)).then(i=>{if(i!=null&&i.features)for(const a of i.features)a.layer=this.layer,a.sourceLayer=this;return i})}queryObjectIds(e,r){return this._getAssociatedLayerForQuery().then(i=>i.queryObjectIds(e||this.createQuery(),r))}async queryCachedAttributes(e,r){const i=ge(this.fieldsIndex,await tt(this,rt(this)));return et(this.parsedUrl.path,this.attributeStorageInfo,e,r,i,this.apiKey,this.customParameters)}async queryCachedFeature(e,r){const i=await this.queryCachedAttributes(e,[r]);if(!i||i.length===0)throw new F("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const a=new fe;return a.attributes=i[0],a.layer=this,a.sourceLayer=this,a}getFieldUsageInfo(e){return this.fieldsIndex.has(e)?{supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1}:{supportsLabelingInfo:!1,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:this.associatedLayer!=null}}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e!=null&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),this.associatedLayer==null)throw new F("buildingscenelayer:query-not-available","BuildingSceneLayer component layer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new F("buildingscenelayer:query-not-available","BuildingSceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}};t([s({readOnly:!0})],o.prototype,"parsedUrl",null),t([s({type:We,readOnly:!0})],o.prototype,"nodePages",void 0),t([s({type:[Ge],readOnly:!0})],o.prototype,"materialDefinitions",void 0),t([s({type:[Xe],readOnly:!0})],o.prototype,"textureSetDefinitions",void 0),t([s({type:[ze],readOnly:!0})],o.prototype,"geometryDefinitions",void 0),t([s({readOnly:!0})],o.prototype,"serviceUpdateTimeStamp",void 0),t([s({readOnly:!0})],o.prototype,"store",void 0),t([s({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],o.prototype,"rootNode",void 0),t([s({readOnly:!0})],o.prototype,"attributeStorageInfo",void 0),t([s(J.fields)],o.prototype,"fields",void 0),t([s({readOnly:!0})],o.prototype,"fieldsIndex",null),t([s({readOnly:!0,type:oe})],o.prototype,"associatedLayer",void 0),t([I("service","associatedLayer",["associatedLayerID"])],o.prototype,"readAssociatedLayer",null),t([s(J.outFields)],o.prototype,"outFields",void 0),t([s({type:String,readOnly:!0})],o.prototype,"objectIdField",null),t([s({readOnly:!0,type:String,json:{read:!1}})],o.prototype,"displayField",null),t([s({readOnly:!0,type:String})],o.prototype,"apiKey",null),t([s({readOnly:!0,type:String})],o.prototype,"customParameters",null),t([s({readOnly:!0,type:ve})],o.prototype,"fullExtent",null),t([s({readOnly:!0,type:se})],o.prototype,"spatialReference",null),t([s({readOnly:!0})],o.prototype,"version",null),t([s({readOnly:!0,type:be})],o.prototype,"elevationInfo",null),t([s({readOnly:!0,type:Number})],o.prototype,"minScale",null),t([s({readOnly:!0,type:Number})],o.prototype,"maxScale",null),t([s({readOnly:!0,type:Number})],o.prototype,"effectiveScaleRange",null),t([s({type:["hide","show"],json:{write:!0}})],o.prototype,"listMode",void 0),t([s({types:De,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],o.prototype,"renderer",void 0),t([s({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),t([s(Se)],o.prototype,"popupEnabled",void 0),t([s({type:we,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],o.prototype,"popupTemplate",void 0),t([s({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],o.prototype,"normalReferenceFrame",void 0),t([s({readOnly:!0,json:{read:!1}})],o.prototype,"defaultPopupTemplate",null),t([s()],o.prototype,"types",null),t([s()],o.prototype,"typeIdField",null),t([s({json:{write:!1}}),ie(new $e({"3DObject":"3d-object",Point:"point"}))],o.prototype,"layerType",void 0),t([s()],o.prototype,"geometryType",null),t([s()],o.prototype,"profile",null),t([s({readOnly:!0,json:{read:!1}})],o.prototype,"capabilities",null),o=t([p("esri.layers.buildingSublayers.BuildingComponentSublayer")],o);const q=o;var N;const W={type:b,readOnly:!0,json:{origins:{service:{read:{source:"sublayers",reader:ne}}},read:!1}};function ne(e,r,i){if(e&&Array.isArray(e))return new b(e.map(a=>{const n=at(a);if(n){const c=new n;return c.read(a,i),c}return i!=null&&i.messages&&a&&i.messages.push(new Oe("building-scene-layer:unsupported-sublayer-type","Building scene sublayer of type '"+(a.type||"unknown")+"' are not supported",{definition:a,context:i})),null}))}let m=N=class extends ae{constructor(e){super(e),this.type="building-group",this.listMode="show",this.sublayers=null}loadAll(){return xe(this,e=>N.forEachSublayer(this.sublayers,r=>{r.type!=="building-group"&&e(r)}))}};function at(e){return e.layerType==="group"?m:q}t([s({type:["hide","show","hide-children"],json:{write:!0}})],m.prototype,"listMode",void 0),t([s(W)],m.prototype,"sublayers",void 0),m=N=t([p("esri.layers.buildingSublayers.BuildingGroupSublayer")],m),function(e){function r(i,a){i.forEach(n=>{a(n),n.type==="building-group"&&r(n.sublayers,a)})}e.sublayersProperty=W,e.readSublayers=ne,e.forEachSublayer=r}(m||(m={}));const f=m;let L=class extends g{constructor(){super(...arguments),this.type=null}};t([s({type:String,readOnly:!0,json:{write:!0}})],L.prototype,"type",void 0),L=t([p("esri.layers.support.BuildingFilterAuthoringInfo")],L);const le=L;var R;let S=R=class extends g{constructor(){super(...arguments),this.filterType=null,this.filterValues=null}clone(){return new R({filterType:this.filterType,filterValues:d(this.filterValues)})}};t([s({type:String,json:{write:!0}})],S.prototype,"filterType",void 0),t([s({type:[String],json:{write:!0}})],S.prototype,"filterValues",void 0),S=R=t([p("esri.layers.support.BuildingFilterAuthoringInfoType")],S);const nt=S;var k;const lt=b.ofType(nt);let j=k=class extends g{clone(){return new k({filterTypes:d(this.filterTypes)})}};t([s({type:lt,json:{write:!0}})],j.prototype,"filterTypes",void 0),j=k=t([p("esri.layers.support.BuildingFilterAuthoringInfoBlock")],j);const pt=j;var M;const yt=b.ofType(pt);let w=M=class extends le{constructor(){super(...arguments),this.type="checkbox"}clone(){return new M({filterBlocks:d(this.filterBlocks)})}};t([s({type:["checkbox"]})],w.prototype,"type",void 0),t([s({type:yt,json:{write:!0}})],w.prototype,"filterBlocks",void 0),w=M=t([p("esri.layers.support.BuildingFilterAuthoringInfoCheckbox")],w);const G=w;let T=class extends g{};t([s({readOnly:!0,json:{read:!1}})],T.prototype,"type",void 0),T=t([p("esri.layers.support.BuildingFilterMode")],T);const A=T;var U;let B=U=class extends A{constructor(){super(...arguments),this.type="solid"}clone(){return new U}};t([s({type:["solid"],readOnly:!0,json:{write:!0}})],B.prototype,"type",void 0),B=U=t([p("esri.layers.support.BuildingFilterModeSolid")],B);const Q=B;var D;let $=D=class extends A{constructor(){super(...arguments),this.type="wire-frame",this.edges=null}clone(){return new D({edges:d(this.edges)})}};t([ie({wireFrame:"wire-frame"})],$.prototype,"type",void 0),t([s(Fe)],$.prototype,"edges",void 0),$=D=t([p("esri.layers.support.BuildingFilterModeWireFrame")],$);const X=$;var K;let E=K=class extends A{constructor(){super(...arguments),this.type="x-ray"}clone(){return new K}};t([s({type:["x-ray"],readOnly:!0,json:{write:!0}})],E.prototype,"type",void 0),E=K=t([p("esri.layers.support.BuildingFilterModeXRay")],E);const z=E;var V;const ut={nonNullable:!0,types:{key:"type",base:A,typeMap:{solid:Q,"wire-frame":X,"x-ray":z}},json:{read:e=>{switch(e==null?void 0:e.type){case"solid":return Q.fromJSON(e);case"wireFrame":return X.fromJSON(e);case"x-ray":return z.fromJSON(e);default:return}},write:{enabled:!0,isRequired:!0}}};let v=V=class extends g{constructor(){super(...arguments),this.filterExpression=null,this.filterMode=new Q,this.title=""}clone(){return new V({filterExpression:this.filterExpression,filterMode:d(this.filterMode),title:this.title})}};t([s({type:String,json:{write:{enabled:!0,isRequired:!0}}})],v.prototype,"filterExpression",void 0),t([s(ut)],v.prototype,"filterMode",void 0),t([s({type:String,json:{write:{enabled:!0,isRequired:!0}}})],v.prototype,"title",void 0),v=V=t([p("esri.layers.support.BuildingFilterBlock")],v);const dt=v;var C;const ct=b.ofType(dt);let h=C=class extends g{constructor(){super(...arguments),this.description=null,this.filterBlocks=null,this.id=Ie(),this.name=null}clone(){return new C({description:this.description,filterBlocks:d(this.filterBlocks),id:this.id,name:this.name,filterAuthoringInfo:d(this.filterAuthoringInfo)})}};t([s({type:String,json:{write:!0}})],h.prototype,"description",void 0),t([s({type:ct,json:{write:{enabled:!0,isRequired:!0}}})],h.prototype,"filterBlocks",void 0),t([s({types:{key:"type",base:le,typeMap:{checkbox:G}},json:{read:e=>(e==null?void 0:e.type)==="checkbox"?G.fromJSON(e):null,write:!0}})],h.prototype,"filterAuthoringInfo",void 0),t([s({type:String,constructOnly:!0,json:{write:{enabled:!0,isRequired:!0}}})],h.prototype,"id",void 0),t([s({type:String,json:{write:{enabled:!0,isRequired:!0}}})],h.prototype,"name",void 0),h=C=t([p("esri.layers.support.BuildingFilter")],h);const ht=h;let u=class extends g{constructor(){super(...arguments),this.fieldName=null,this.modelName=null,this.label=null,this.min=null,this.max=null,this.mostFrequentValues=null,this.subLayerIds=null}};t([s({type:String})],u.prototype,"fieldName",void 0),t([s({type:String})],u.prototype,"modelName",void 0),t([s({type:String})],u.prototype,"label",void 0),t([s({type:Number})],u.prototype,"min",void 0),t([s({type:Number})],u.prototype,"max",void 0),t([s({json:{read:e=>Array.isArray(e)&&(e.every(r=>typeof r=="string")||e.every(r=>typeof r=="number"))?e.slice():null}})],u.prototype,"mostFrequentValues",void 0),t([s({type:[Number]})],u.prototype,"subLayerIds",void 0),u=t([p("esri.layers.support.BuildingFieldStatistics")],u);let O=class extends ee.LoadableMixin(te(g)){constructor(){super(...arguments),this.url=null}get fields(){return this.loaded||this.loadStatus==="loading"?this._get("fields"):(x.getLogger(this).error("building summary statistics are not loaded"),null)}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this._fetchService(r)),Promise.resolve(this)}async _fetchService(e){const r=(await re(this.url,{query:{f:"json"},responseType:"json",signal:e})).data;this.read(r,{origin:"service"})}};t([s({constructOnly:!0,type:String})],O.prototype,"url",void 0),t([s({readOnly:!0,type:[u],json:{read:{source:"summary"}}})],O.prototype,"fields",null),O=t([p("esri.layers.support.BuildingSummaryStatistics")],O);const pe=O,ye=b.ofType(ht),ue=d(f.sublayersProperty);var Y;const P=(Y=ue.json)==null?void 0:Y.origins;P&&(P["web-scene"]={type:[q],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}},P["portal-item"]={type:[q],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}});let l=class extends Je(Le(je(Te(Be(Ee(Ae(Pe(Qe)))))))){constructor(e){super(e),this.operationalLayerType="BuildingSceneLayer",this.allSublayers=new _e({getCollections:()=>[this.sublayers],getChildrenFunction:r=>r.type==="building-group"?r.sublayers:null}),this.sublayers=null,this._sublayerOverrides=null,this.filters=new ye,this.activeFilterId=null,this.summaryStatistics=null,this.outFields=null,this.legendEnabled=!0,this.type="building-scene"}normalizeCtorArgs(e){return typeof e=="string"?{url:e}:e??{}}destroy(){this.allSublayers.destroy()}readSublayers(e,r,i){const a=f.readSublayers(e,r,i);return f.forEachSublayer(a,n=>n.layer=this),this._sublayerOverrides&&(this.applySublayerOverrides(a,this._sublayerOverrides),this._sublayerOverrides=null),a}applySublayerOverrides(e,{overrides:r,context:i}){f.forEachSublayer(e,a=>a.read(r.get(a.id),i))}readSublayerOverrides(e,r){var a;const i=new Map;for(const n of e)n!=null&&typeof n=="object"&&typeof n.id=="number"?i.set(n.id,n):(a=r.messages)==null||a.push(new F("building-scene-layer:invalid-sublayer-override","Invalid value for sublayer override. Not an object or no id specified.",{value:n}));return{overrides:i,context:r}}writeSublayerOverrides(e,r,i){const a=[];f.forEachSublayer(this.sublayers,n=>{const c=n.write({},i);Object.keys(c).length>1&&a.push(c)}),a.length>0&&(r.sublayers=a)}writeUnappliedOverrides(e,r){r.sublayers=[],e.overrides.forEach(i=>{r.sublayers.push(d(i))})}write(e,r){return e=super.write(e,r),!r||r.origin!=="web-scene"&&r.origin!=="portal-item"||(this.sublayers?this.writeSublayerOverrides(this.sublayers,e,r):this._sublayerOverrides&&this.writeUnappliedOverrides(this._sublayerOverrides,e)),e}read(e,r){if(super.read(e,r),r&&(r.origin==="web-scene"||r.origin==="portal-item")&&e!=null&&Array.isArray(e.sublayers)){const i=this.readSublayerOverrides(e.sublayers,r);this.sublayers?this.applySublayerOverrides(this.sublayers,i):this._sublayerOverrides=i}}readSummaryStatistics(e,r){var i;if(typeof r.statisticsHRef=="string"){const a=qe((i=this.parsedUrl)==null?void 0:i.path,r.statisticsHRef);return new pe({url:a})}return null}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}load(e){const r=e!=null?e.signal:null,i=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(Ne).then(()=>this._fetchService(r)).then(()=>this._fetchAssociatedFeatureService(r));return this.addResolvingPromise(i),Promise.resolve(this)}loadAll(){return Re(this,e=>{f.forEachSublayer(this.sublayers,r=>{r.type!=="building-group"&&e(r)}),this.summaryStatistics&&e(this.summaryStatistics)})}async saveAs(e,r){return this._debouncedSaveOperations(Z.SAVE_AS,{...r,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"};return this._debouncedSaveOperations(Z.SAVE,e)}validateLayer(e){if(!e.layerType||e.layerType!=="Building")throw new F("buildingscenelayer:layer-type-not-supported","BuildingSceneLayer does not support this layer type",{layerType:e.layerType})}_getTypeKeywords(){return["Building"]}async _fetchAssociatedFeatureService(e){try{const{portalItem:r}=await st(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e});this.associatedFeatureServiceItem=r}catch(r){x.getLogger(this).warn("Associated feature service item could not be loaded",r)}}_validateElevationInfo(){const e=this.elevationInfo,r="Building scene layers";H(x.getLogger(this),it(r,"absolute-height",e)),H(x.getLogger(this),ot(r,e))}};t([s({type:["BuildingSceneLayer"]})],l.prototype,"operationalLayerType",void 0),t([s({readOnly:!0})],l.prototype,"allSublayers",void 0),t([s(ue)],l.prototype,"sublayers",void 0),t([I("service","sublayers")],l.prototype,"readSublayers",null),t([s({type:ye,nonNullable:!0,json:{write:!0}})],l.prototype,"filters",void 0),t([s({type:String,json:{write:!0}})],l.prototype,"activeFilterId",void 0),t([s({readOnly:!0,type:pe})],l.prototype,"summaryStatistics",void 0),t([I("summaryStatistics",["statisticsHRef"])],l.prototype,"readSummaryStatistics",null),t([s({type:[String],json:{read:!1}})],l.prototype,"outFields",void 0),t([s(ke)],l.prototype,"fullExtent",void 0),t([s(Me)],l.prototype,"legendEnabled",void 0),t([s({type:["show","hide","hide-children"]})],l.prototype,"listMode",void 0),t([s(_(se))],l.prototype,"spatialReference",void 0),t([s(Ue)],l.prototype,"elevationInfo",null),t([s({json:{read:!1},readOnly:!0})],l.prototype,"type",void 0),t([s()],l.prototype,"associatedFeatureServiceItem",void 0),l=t([p("esri.layers.BuildingSceneLayer")],l);const Mr=l;export{Mr as default}; diff --git a/assets/Button-BD3vvwHs.js b/assets/Button-D2RihRUZ.js similarity index 96% rename from assets/Button-BD3vvwHs.js rename to assets/Button-D2RihRUZ.js index 3514245..9512117 100644 --- a/assets/Button-BD3vvwHs.js +++ b/assets/Button-D2RihRUZ.js @@ -1 +1 @@ -import{z as f,i as R,C as _,ar as b,ak as T,am as g}from"./Theme-Bdh3gaKt.js";class p extends f{_beforeChanged(){super._beforeChanged(),(this.isDirty("cornerRadiusTL")||this.isDirty("cornerRadiusTR")||this.isDirty("cornerRadiusBR")||this.isDirty("cornerRadiusBL"))&&(this._clear=!0)}_draw(){let s=this.width(),e=this.height(),t=s,i=e,c=t/Math.abs(s),l=i/Math.abs(e);if(_(t)&&_(i)){let d=Math.min(t,i)/2,r=b(this.get("cornerRadiusTL",8),d),n=b(this.get("cornerRadiusTR",8),d),o=b(this.get("cornerRadiusBR",8),d),h=b(this.get("cornerRadiusBL",8),d),u=Math.min(Math.abs(t/2),Math.abs(i/2));r=g(r,0,u),n=g(n,0,u),o=g(o,0,u),h=g(h,0,u);const a=this._display;a.moveTo(r*c,0),a.lineTo(t-n*c,0),n>0&&a.arcTo(t,0,t,n*l,n),a.lineTo(t,i-o*l),o>0&&a.arcTo(t,i,t-o*c,i,o),a.lineTo(h*c,i),h>0&&a.arcTo(0,i,0,i-h*l,h),a.lineTo(0,r*l),r>0&&a.arcTo(0,0,r*c,0,r),a.closePath()}}}Object.defineProperty(p,"className",{enumerable:!0,configurable:!0,writable:!0,value:"RoundedRectangle"}),Object.defineProperty(p,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:f.classNames.concat([p.className])});class m extends R{_afterNew(){this._settings.themeTags=T(this._settings.themeTags,["button"]),super._afterNew(),this._settings.background||this.set("background",p.new(this._root,{themeTags:T(this._settings.themeTags,["background"])})),this.setPrivate("trustBounds",!0)}_prepareChildren(){if(super._prepareChildren(),this.isDirty("icon")){const s=this._prevSettings.icon,e=this.get("icon");e!==s&&(this._disposeProperty("icon"),s&&s.dispose(),e&&this.children.push(e),this._prevSettings.icon=e)}if(this.isDirty("label")){const s=this._prevSettings.label,e=this.get("label");e!==s&&(this._disposeProperty("label"),s&&s.dispose(),e&&this.children.push(e),this._prevSettings.label=e)}}}Object.defineProperty(m,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Button"}),Object.defineProperty(m,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:R.classNames.concat([m.className])});export{p as n,m as o}; +import{z as f,i as R,C as _,ar as b,ak as T,am as g}from"./Theme-6HY29PEY.js";class p extends f{_beforeChanged(){super._beforeChanged(),(this.isDirty("cornerRadiusTL")||this.isDirty("cornerRadiusTR")||this.isDirty("cornerRadiusBR")||this.isDirty("cornerRadiusBL"))&&(this._clear=!0)}_draw(){let s=this.width(),e=this.height(),t=s,i=e,c=t/Math.abs(s),l=i/Math.abs(e);if(_(t)&&_(i)){let d=Math.min(t,i)/2,r=b(this.get("cornerRadiusTL",8),d),n=b(this.get("cornerRadiusTR",8),d),o=b(this.get("cornerRadiusBR",8),d),h=b(this.get("cornerRadiusBL",8),d),u=Math.min(Math.abs(t/2),Math.abs(i/2));r=g(r,0,u),n=g(n,0,u),o=g(o,0,u),h=g(h,0,u);const a=this._display;a.moveTo(r*c,0),a.lineTo(t-n*c,0),n>0&&a.arcTo(t,0,t,n*l,n),a.lineTo(t,i-o*l),o>0&&a.arcTo(t,i,t-o*c,i,o),a.lineTo(h*c,i),h>0&&a.arcTo(0,i,0,i-h*l,h),a.lineTo(0,r*l),r>0&&a.arcTo(0,0,r*c,0,r),a.closePath()}}}Object.defineProperty(p,"className",{enumerable:!0,configurable:!0,writable:!0,value:"RoundedRectangle"}),Object.defineProperty(p,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:f.classNames.concat([p.className])});class m extends R{_afterNew(){this._settings.themeTags=T(this._settings.themeTags,["button"]),super._afterNew(),this._settings.background||this.set("background",p.new(this._root,{themeTags:T(this._settings.themeTags,["background"])})),this.setPrivate("trustBounds",!0)}_prepareChildren(){if(super._prepareChildren(),this.isDirty("icon")){const s=this._prevSettings.icon,e=this.get("icon");e!==s&&(this._disposeProperty("icon"),s&&s.dispose(),e&&this.children.push(e),this._prevSettings.icon=e)}if(this.isDirty("label")){const s=this._prevSettings.label,e=this.get("label");e!==s&&(this._disposeProperty("label"),s&&s.dispose(),e&&this.children.push(e),this._prevSettings.label=e)}}}Object.defineProperty(m,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Button"}),Object.defineProperty(m,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:R.classNames.concat([m.className])});export{p as n,m as o}; diff --git a/assets/CSVLayer-BGm6RUOY.js b/assets/CSVLayer-DfX_NRk3.js similarity index 79% rename from assets/CSVLayer-BGm6RUOY.js rename to assets/CSVLayer-DfX_NRk3.js index babe166..840c632 100644 --- a/assets/CSVLayer-BGm6RUOY.js +++ b/assets/CSVLayer-DfX_NRk3.js @@ -1 +1 @@ -import{d as i,y as r,f as h,fw as v,k as w,aE as S,ec as O,E as F,aZ as b,dC as I,fz as q,aS as N,ay as _,bW as C,aX as l,N as m}from"./index-CEWggaxV.js";import J from"./FeatureLayer-D0kMrROG.js";import{d as P}from"./FeatureSet-CYJUZgOk.js";import{l as j}from"./clientSideDefaults-CgRgH99f.js";import"./UniqueValueRenderer-BlkUix3g.js";import"./ColorStop-44hBlQ14.js";import"./diffUtils-B4YFa5Ju.js";import"./colorRamps-BJydlf0f.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-z2k12BH8.js";import"./jsonUtils-qYmXvGJ1.js";import"./styleUtils-CnV_Xzhi.js";import"./jsonUtils-BseLl1fZ.js";import"./Version-Bd0QsIQ5.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./OverrideHelper-B4ryGWZb.js";import"./utils-p-5Bbga5.js";import"./quantizationUtils-CUjGHrU3.js";import"./heatmapUtils-Clt5rJzr.js";import"./FormTemplate-eV18QveB.js";import"./editsZScale-CQCGPEjO.js";import"./queryZScale-DN4aFXYn.js";import"./EditBusLayer-SG7oYwiY.js";import"./FeatureEffectLayer-CLTrRFqx.js";import"./FeatureEffect-ByrbZlne.js";import"./FeatureLayerBase-DPJuwFpX.js";import"./featureLayerUtils-BhDaw8pS.js";import"./AttachmentQuery-D61mmWw4.js";import"./RelationshipQuery-DDK72Kwc.js";import"./LayerFloorInfo-Cdq3ulNh.js";import"./serviceCapabilitiesUtils-t8SL4e_j.js";import"./FeatureReductionLayer-DncGsNIN.js";import"./FeatureReductionSelection-BY3KVXac.js";import"./LabelClass-6cZokw8y.js";import"./labelUtils-Dnqx6jl5.js";import"./defaultsJSON-CHAaurhX.js";import"./MD5-C9MwAd2G.js";import"./OrderedLayer-Do089KpQ.js";import"./OrderByInfo-DKzv2-WS.js";import"./RefreshableLayer-1EkEhJeI.js";import"./TemporalLayer-qq3v_i3q.js";import"./TimeInfo-3TVmpFSA.js";import"./FeatureTemplate-DcprAdTM.js";import"./FeatureType-By3BEr9z.js";import"./fieldProperties-DMs4wT6-.js";import"./labelingInfo-CijajRsc.js";import"./versionUtils-CaceEUVY.js";import"./styleUtils-B_Iy1DTk.js";import"./TopFeaturesQuery-B8kC7n5h.js";import"./popupUtils-DAFYyAvw.js";import"./interfaces-CL2NbQte.js";import"./QueryEngineCapabilities-CTDe3LlQ.js";let n=class extends v{constructor(t){super(t),this.type="csv",this.refresh=w(async e=>{await this.load();const{extent:o,timeExtent:a}=await this._connection.invoke("refresh",e);return o&&(this.sourceJSON.extent=o),a&&(this.sourceJSON.timeInfo.timeExtent=[a.start,a.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(t){const e=t!=null?t.signal:null;return this.addResolvingPromise(this._startWorker(e)),Promise.resolve(this)}destroy(){var t;(t=this._connection)==null||t.close(),this._connection=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(t,e={}){await this.load(e);const o=await this._connection.invoke("queryFeatures",t?t.toJSON():null,e);return P.fromJSON(o)}async queryFeaturesJSON(t,e={}){return await this.load(e),this._connection.invoke("queryFeatures",t?t.toJSON():null,e)}async queryFeatureCount(t,e={}){return await this.load(e),this._connection.invoke("queryFeatureCount",t?t.toJSON():null,e)}async queryObjectIds(t,e={}){return await this.load(e),this._connection.invoke("queryObjectIds",t?t.toJSON():null,e)}async queryExtent(t,e={}){await this.load(e);const o=await this._connection.invoke("queryExtent",t?t.toJSON():null,e);return{count:o.count,extent:S.fromJSON(o.extent)}}async querySnapping(t,e={}){return await this.load(e),this._connection.invoke("querySnapping",t,e)}async _startWorker(t){this._connection=await O("CSVSourceWorker",{strategy:F("feature-layers-workers")?"dedicated":"local",signal:t,registryTarget:this});const{url:e,delimiter:o,fields:a,latitudeField:y,longitudeField:f,spatialReference:u,timeInfo:d}=this.loadOptions,p=await this._connection.invoke("load",{url:e,customParameters:this.customParameters,parsingOptions:{delimiter:o,fields:a==null?void 0:a.map(g=>g.toJSON()),latitudeField:y,longitudeField:f,spatialReference:u==null?void 0:u.toJSON(),timeInfo:d==null?void 0:d.toJSON()}},{signal:t});this.locationInfo=p.locationInfo,this.sourceJSON=p.layerDefinition,this.delimiter=p.delimiter}};i([r()],n.prototype,"type",void 0),i([r()],n.prototype,"loadOptions",void 0),i([r()],n.prototype,"customParameters",void 0),i([r()],n.prototype,"locationInfo",void 0),i([r()],n.prototype,"sourceJSON",void 0),i([r()],n.prototype,"delimiter",void 0),n=i([h("esri.layers.graphics.sources.CSVSource")],n);function c(t,e){throw new m(e,`CSVLayer (title: ${t.title}, id: ${t.id}) cannot be saved to a portal item`)}let s=class extends J{constructor(...t){super(...t),this.geometryType="point",this.capabilities=j(!1,!1),this.delimiter=null,this.editingEnabled=!1,this.fields=null,this.latitudeField=null,this.locationType="coordinates",this.longitudeField=null,this.operationalLayerType="CSV",this.outFields=["*"],this.path=null,this.spatialReference=N.WGS84,this.source=null,this.type="csv"}normalizeCtorArgs(t,e){return typeof t=="string"?{url:t,...e}:t}load(t){const e=t!=null?t.signal:null,o=this.loadFromPortal({supportedTypes:["CSV"],supportsData:!1},t).catch(_).then(async()=>this.initLayerProperties(await this.createGraphicsSource(e)));return this.addResolvingPromise(o),Promise.resolve(this)}get isTable(){return this.loaded&&this.geometryType==null}readWebMapLabelsVisible(t,e){var o,a;return e.showLabels!=null?e.showLabels:!!((a=(o=e.layerDefinition)==null?void 0:o.drawingInfo)!=null&&a.labelingInfo)}set url(t){if(!t)return void this._set("url",t);const e=C(t);this._set("url",e.path),e.query&&(this.customParameters={...this.customParameters,...e.query})}async createGraphicsSource(t){const e=new n({loadOptions:{delimiter:this.delimiter,fields:this.fields,latitudeField:this.latitudeField??void 0,longitudeField:this.longitudeField??void 0,spatialReference:this.spatialReference??void 0,timeInfo:this.timeInfo??void 0,url:this.url},customParameters:this.customParameters??void 0});return this._set("source",e),await e.load({signal:t}),this.read({locationInfo:e.locationInfo,columnDelimiter:e.delimiter},{origin:"service",url:this.parsedUrl}),e}queryFeatures(t,e){return this.load().then(()=>this.source.queryFeatures(l.from(t)||this.createQuery())).then(o=>{if(o!=null&&o.features)for(const a of o.features)a.layer=a.sourceLayer=this;return o})}queryObjectIds(t,e){return this.load().then(()=>this.source.queryObjectIds(l.from(t)||this.createQuery()))}queryFeatureCount(t,e){return this.load().then(()=>this.source.queryFeatureCount(l.from(t)||this.createQuery()))}queryExtent(t,e){return this.load().then(()=>this.source.queryExtent(l.from(t)||this.createQuery()))}read(t,e){super.read(t,e),e&&e.origin==="service"&&this.revert(["latitudeField","longitudeField"],"service")}write(t,e){return super.write(t,{...e,writeLayerSchema:!0})}clone(){throw new m("csv-layer:clone",`CSVLayer (title: ${this.title}, id: ${this.id}) cannot be cloned`)}async save(t){return c(this,"csv-layer:save")}async saveAs(t,e){return c(this,"csv-layer:save-as")}async hasDataChanged(){try{const{dataChanged:t,updates:e}=await this.source.refresh(this.customParameters);return e!=null&&this.read(e,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),t}catch{}return!1}_verifyFields(){}_verifySource(){}_hasMemorySource(){return!1}};i([r({readOnly:!0,json:{read:!1,write:!1}})],s.prototype,"capabilities",void 0),i([r({type:[","," ",";","|"," "],json:{read:{source:"columnDelimiter"},write:{target:"columnDelimiter",ignoreOrigin:!0}}})],s.prototype,"delimiter",void 0),i([r({readOnly:!0,type:Boolean,json:{origins:{"web-scene":{read:!1,write:!1}}}})],s.prototype,"editingEnabled",void 0),i([r({json:{read:{source:"layerDefinition.fields"},write:{target:"layerDefinition.fields"}}})],s.prototype,"fields",void 0),i([r({type:Boolean,readOnly:!0})],s.prototype,"isTable",null),i([b("web-map","labelsVisible",["layerDefinition.drawingInfo.labelingInfo","showLabels"])],s.prototype,"readWebMapLabelsVisible",null),i([r({type:String,json:{read:{source:"locationInfo.latitudeFieldName"},write:{target:"locationInfo.latitudeFieldName",ignoreOrigin:!0}}})],s.prototype,"latitudeField",void 0),i([r({type:["show","hide"]})],s.prototype,"listMode",void 0),i([r({type:["coordinates"],json:{read:{source:"locationInfo.locationType"},write:{target:"locationInfo.locationType",ignoreOrigin:!0,isRequired:!0}}})],s.prototype,"locationType",void 0),i([r({type:String,json:{read:{source:"locationInfo.longitudeFieldName"},write:{target:"locationInfo.longitudeFieldName",ignoreOrigin:!0}}})],s.prototype,"longitudeField",void 0),i([r({type:["CSV"]})],s.prototype,"operationalLayerType",void 0),i([r()],s.prototype,"outFields",void 0),i([r({type:String,json:{origins:{"web-scene":{read:!1,write:!1}},read:!1,write:!1}})],s.prototype,"path",void 0),i([r({json:{read:!1},cast:null,type:n,readOnly:!0})],s.prototype,"source",void 0),i([r({json:{read:!1},value:"csv",readOnly:!0})],s.prototype,"type",void 0),i([r({json:{read:I,write:{isRequired:!0,ignoreOrigin:!0,writer:q}}})],s.prototype,"url",null),s=i([h("esri.layers.CSVLayer")],s);const jt=s;export{jt as default}; +import{d as i,y as r,f as h,fw as v,k as w,aE as S,ec as O,E as F,aZ as b,dC as I,fz as q,aS as N,ay as _,bW as C,aX as l,N as m}from"./index-BjUNJPVf.js";import J from"./FeatureLayer-BHxNIHhy.js";import{d as P}from"./FeatureSet-opEn8ou8.js";import{l as j}from"./clientSideDefaults-BQP5n3lX.js";import"./UniqueValueRenderer-7V9Bhr-D.js";import"./ColorStop-DCGjAKLC.js";import"./diffUtils-uUoMDFQS.js";import"./colorRamps-CcakIWlU.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-BX9G5gNQ.js";import"./jsonUtils-Ox5U0P0F.js";import"./styleUtils-DOUOskVZ.js";import"./jsonUtils-Dw332y6z.js";import"./Version-Dqq_CHBG.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./OverrideHelper-DxFZBnGL.js";import"./utils-CuXO_Zzq.js";import"./quantizationUtils-CfV316jZ.js";import"./heatmapUtils-BSteZBTj.js";import"./FormTemplate-BGxtsGX6.js";import"./editsZScale-Bfe6gH1b.js";import"./queryZScale-Dwvn5BlQ.js";import"./EditBusLayer-OslMX9fF.js";import"./FeatureEffectLayer-DarO4Ctx.js";import"./FeatureEffect-DBbkrS6j.js";import"./FeatureLayerBase-D0I-Escx.js";import"./featureLayerUtils-lwqyOSrl.js";import"./AttachmentQuery-DmEAIZff.js";import"./RelationshipQuery-BDJrOxaX.js";import"./LayerFloorInfo-DlYNbO-A.js";import"./serviceCapabilitiesUtils-DiP90Uds.js";import"./FeatureReductionLayer-CK-tyM-9.js";import"./FeatureReductionSelection-t3T7oa8H.js";import"./LabelClass-CeatfK8u.js";import"./labelUtils-3p0-m-Ee.js";import"./defaultsJSON-CHAaurhX.js";import"./MD5-C9MwAd2G.js";import"./OrderedLayer-dLoPhxcx.js";import"./OrderByInfo-DKyk5GLW.js";import"./RefreshableLayer-_r2TPtol.js";import"./TemporalLayer-CKICYnEl.js";import"./TimeInfo-DooETFWC.js";import"./FeatureTemplate-FZNGA_Ik.js";import"./FeatureType-CwUl8Nf5.js";import"./fieldProperties-DnrQXLBM.js";import"./labelingInfo-DqAUis6e.js";import"./versionUtils-BIAEZzrm.js";import"./styleUtils--I7zqeL6.js";import"./TopFeaturesQuery-CVQjqlfM.js";import"./popupUtils-DlZin22m.js";import"./interfaces-CL2NbQte.js";import"./QueryEngineCapabilities-CTDe3LlQ.js";let n=class extends v{constructor(t){super(t),this.type="csv",this.refresh=w(async e=>{await this.load();const{extent:o,timeExtent:a}=await this._connection.invoke("refresh",e);return o&&(this.sourceJSON.extent=o),a&&(this.sourceJSON.timeInfo.timeExtent=[a.start,a.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(t){const e=t!=null?t.signal:null;return this.addResolvingPromise(this._startWorker(e)),Promise.resolve(this)}destroy(){var t;(t=this._connection)==null||t.close(),this._connection=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(t,e={}){await this.load(e);const o=await this._connection.invoke("queryFeatures",t?t.toJSON():null,e);return P.fromJSON(o)}async queryFeaturesJSON(t,e={}){return await this.load(e),this._connection.invoke("queryFeatures",t?t.toJSON():null,e)}async queryFeatureCount(t,e={}){return await this.load(e),this._connection.invoke("queryFeatureCount",t?t.toJSON():null,e)}async queryObjectIds(t,e={}){return await this.load(e),this._connection.invoke("queryObjectIds",t?t.toJSON():null,e)}async queryExtent(t,e={}){await this.load(e);const o=await this._connection.invoke("queryExtent",t?t.toJSON():null,e);return{count:o.count,extent:S.fromJSON(o.extent)}}async querySnapping(t,e={}){return await this.load(e),this._connection.invoke("querySnapping",t,e)}async _startWorker(t){this._connection=await O("CSVSourceWorker",{strategy:F("feature-layers-workers")?"dedicated":"local",signal:t,registryTarget:this});const{url:e,delimiter:o,fields:a,latitudeField:y,longitudeField:f,spatialReference:u,timeInfo:d}=this.loadOptions,p=await this._connection.invoke("load",{url:e,customParameters:this.customParameters,parsingOptions:{delimiter:o,fields:a==null?void 0:a.map(g=>g.toJSON()),latitudeField:y,longitudeField:f,spatialReference:u==null?void 0:u.toJSON(),timeInfo:d==null?void 0:d.toJSON()}},{signal:t});this.locationInfo=p.locationInfo,this.sourceJSON=p.layerDefinition,this.delimiter=p.delimiter}};i([r()],n.prototype,"type",void 0),i([r()],n.prototype,"loadOptions",void 0),i([r()],n.prototype,"customParameters",void 0),i([r()],n.prototype,"locationInfo",void 0),i([r()],n.prototype,"sourceJSON",void 0),i([r()],n.prototype,"delimiter",void 0),n=i([h("esri.layers.graphics.sources.CSVSource")],n);function c(t,e){throw new m(e,`CSVLayer (title: ${t.title}, id: ${t.id}) cannot be saved to a portal item`)}let s=class extends J{constructor(...t){super(...t),this.geometryType="point",this.capabilities=j(!1,!1),this.delimiter=null,this.editingEnabled=!1,this.fields=null,this.latitudeField=null,this.locationType="coordinates",this.longitudeField=null,this.operationalLayerType="CSV",this.outFields=["*"],this.path=null,this.spatialReference=N.WGS84,this.source=null,this.type="csv"}normalizeCtorArgs(t,e){return typeof t=="string"?{url:t,...e}:t}load(t){const e=t!=null?t.signal:null,o=this.loadFromPortal({supportedTypes:["CSV"],supportsData:!1},t).catch(_).then(async()=>this.initLayerProperties(await this.createGraphicsSource(e)));return this.addResolvingPromise(o),Promise.resolve(this)}get isTable(){return this.loaded&&this.geometryType==null}readWebMapLabelsVisible(t,e){var o,a;return e.showLabels!=null?e.showLabels:!!((a=(o=e.layerDefinition)==null?void 0:o.drawingInfo)!=null&&a.labelingInfo)}set url(t){if(!t)return void this._set("url",t);const e=C(t);this._set("url",e.path),e.query&&(this.customParameters={...this.customParameters,...e.query})}async createGraphicsSource(t){const e=new n({loadOptions:{delimiter:this.delimiter,fields:this.fields,latitudeField:this.latitudeField??void 0,longitudeField:this.longitudeField??void 0,spatialReference:this.spatialReference??void 0,timeInfo:this.timeInfo??void 0,url:this.url},customParameters:this.customParameters??void 0});return this._set("source",e),await e.load({signal:t}),this.read({locationInfo:e.locationInfo,columnDelimiter:e.delimiter},{origin:"service",url:this.parsedUrl}),e}queryFeatures(t,e){return this.load().then(()=>this.source.queryFeatures(l.from(t)||this.createQuery())).then(o=>{if(o!=null&&o.features)for(const a of o.features)a.layer=a.sourceLayer=this;return o})}queryObjectIds(t,e){return this.load().then(()=>this.source.queryObjectIds(l.from(t)||this.createQuery()))}queryFeatureCount(t,e){return this.load().then(()=>this.source.queryFeatureCount(l.from(t)||this.createQuery()))}queryExtent(t,e){return this.load().then(()=>this.source.queryExtent(l.from(t)||this.createQuery()))}read(t,e){super.read(t,e),e&&e.origin==="service"&&this.revert(["latitudeField","longitudeField"],"service")}write(t,e){return super.write(t,{...e,writeLayerSchema:!0})}clone(){throw new m("csv-layer:clone",`CSVLayer (title: ${this.title}, id: ${this.id}) cannot be cloned`)}async save(t){return c(this,"csv-layer:save")}async saveAs(t,e){return c(this,"csv-layer:save-as")}async hasDataChanged(){try{const{dataChanged:t,updates:e}=await this.source.refresh(this.customParameters);return e!=null&&this.read(e,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),t}catch{}return!1}_verifyFields(){}_verifySource(){}_hasMemorySource(){return!1}};i([r({readOnly:!0,json:{read:!1,write:!1}})],s.prototype,"capabilities",void 0),i([r({type:[","," ",";","|"," "],json:{read:{source:"columnDelimiter"},write:{target:"columnDelimiter",ignoreOrigin:!0}}})],s.prototype,"delimiter",void 0),i([r({readOnly:!0,type:Boolean,json:{origins:{"web-scene":{read:!1,write:!1}}}})],s.prototype,"editingEnabled",void 0),i([r({json:{read:{source:"layerDefinition.fields"},write:{target:"layerDefinition.fields"}}})],s.prototype,"fields",void 0),i([r({type:Boolean,readOnly:!0})],s.prototype,"isTable",null),i([b("web-map","labelsVisible",["layerDefinition.drawingInfo.labelingInfo","showLabels"])],s.prototype,"readWebMapLabelsVisible",null),i([r({type:String,json:{read:{source:"locationInfo.latitudeFieldName"},write:{target:"locationInfo.latitudeFieldName",ignoreOrigin:!0}}})],s.prototype,"latitudeField",void 0),i([r({type:["show","hide"]})],s.prototype,"listMode",void 0),i([r({type:["coordinates"],json:{read:{source:"locationInfo.locationType"},write:{target:"locationInfo.locationType",ignoreOrigin:!0,isRequired:!0}}})],s.prototype,"locationType",void 0),i([r({type:String,json:{read:{source:"locationInfo.longitudeFieldName"},write:{target:"locationInfo.longitudeFieldName",ignoreOrigin:!0}}})],s.prototype,"longitudeField",void 0),i([r({type:["CSV"]})],s.prototype,"operationalLayerType",void 0),i([r()],s.prototype,"outFields",void 0),i([r({type:String,json:{origins:{"web-scene":{read:!1,write:!1}},read:!1,write:!1}})],s.prototype,"path",void 0),i([r({json:{read:!1},cast:null,type:n,readOnly:!0})],s.prototype,"source",void 0),i([r({json:{read:!1},value:"csv",readOnly:!0})],s.prototype,"type",void 0),i([r({json:{read:I,write:{isRequired:!0,ignoreOrigin:!0,writer:q}}})],s.prototype,"url",null),s=i([h("esri.layers.CSVLayer")],s);const jt=s;export{jt as default}; diff --git a/assets/CSVSourceWorker-CrU3052N.js b/assets/CSVSourceWorker-DNn0ZitV.js similarity index 92% rename from assets/CSVSourceWorker-CrU3052N.js rename to assets/CSVSourceWorker-DNn0ZitV.js index 3a352f9..048eca5 100644 --- a/assets/CSVSourceWorker-CrU3052N.js +++ b/assets/CSVSourceWorker-DNn0ZitV.js @@ -1,4 +1,4 @@ -import{a3 as _,cD as j,N as I,cE as P,b as R,s as V,bW as L,M as A,W as T,T as G,G as M,ak as Q,fn as Z,fo as W,aS as Y,cB as B,bV as J}from"./index-CEWggaxV.js";import{e as U,n as H}from"./date-M6n_RqpC.js";import{t as K}from"./json-Wa8cmqdu.js";import{t as z,e as X}from"./OptimizedGeometry-CQuTPb9g.js";import{m as ee}from"./FeatureStore-CqSz6SOQ.js";import{x as te}from"./timeSupport-BjRbXIpn.js";import{$ as ie}from"./QueryEngine-RpcY23Sv.js";import{a as ne}from"./number-Bu1a2qyF.js";import{i as re,o as oe}from"./clientSideDefaults-CgRgH99f.js";import{Z as w}from"./FieldsIndex-CLgRNeJ_.js";import"./featureConversionUtils-CmP9mw0r.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./BoundsStore-DMoG4U0L.js";import"./PooledRBush-BsFBmw1o.js";import"./WhereClause-Dzgyc0wk.js";import"./TimeOnly-Cm47ew5I.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./QueryEngineCapabilities-CTDe3LlQ.js";import"./quantizationUtils-CUjGHrU3.js";import"./utils-B8iadP2F.js";import"./heatmapUtils-Clt5rJzr.js";import"./utils-SjO_-1JL.js";import"./utils-GMt8_G3w.js";import"./ClassBreaksDefinition-D281x8Sj.js";import"./RenderState-DaVlEYWY.js";import"./defaultsJSON-CHAaurhX.js";const E=/^\s*"([\S\s]*)"\s*$/,S=/""/g,O=` +import{a3 as _,cD as j,N as I,cE as P,b as R,s as V,bW as L,M as A,W as T,T as G,G as M,ak as Q,fn as Z,fo as W,aS as Y,cB as B,bV as J}from"./index-BjUNJPVf.js";import{e as U,n as H}from"./date-M6n_RqpC.js";import{t as K}from"./json-Wa8cmqdu.js";import{t as z,e as X}from"./OptimizedGeometry-CQuTPb9g.js";import{m as ee}from"./FeatureStore-CRMzrhIt.js";import{x as te}from"./timeSupport-DXkhlToK.js";import{$ as ie}from"./QueryEngine-loUu1VUW.js";import{a as ne}from"./number-CJqenc9O.js";import{i as re,o as oe}from"./clientSideDefaults-BQP5n3lX.js";import{Z as w}from"./FieldsIndex-CK-0B5n9.js";import"./featureConversionUtils-BHhm7bvm.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./BoundsStore-DRDtG3Mk.js";import"./PooledRBush-BlFOlUgK.js";import"./WhereClause-Ctld7DSu.js";import"./TimeOnly-BXSODLxA.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./QueryEngineCapabilities-CTDe3LlQ.js";import"./quantizationUtils-CfV316jZ.js";import"./utils-BKh1cxpi.js";import"./heatmapUtils-BSteZBTj.js";import"./utils-Bzmbfe7p.js";import"./utils-CY1ReiSd.js";import"./ClassBreaksDefinition-Djcxa8Lp.js";import"./RenderState-DaVlEYWY.js";import"./defaultsJSON-CHAaurhX.js";const E=/^\s*"([\S\s]*)"\s*$/,S=/""/g,O=` `,se=[","," ",";","|"," "];function*$(r,t,e){let i=0;for(;i<=r.length;){const n=r.indexOf(t,i),o=r.substring(i,n>-1?n:void 0);i+=o.length+t.length,e&&!o.trim()||(yield o)}}function q(r){const t=r.includes(`\r `)?`\r `:O;return $(r,t,!0)}function C(r,t){return $(r,t,!1)}function ae(r,t,e){r=r.trim(),t=t==null?void 0:t.trim();const i=[],n=Array.from(new Set([e==null?void 0:e.delimiter,...se])).filter(s=>s!=null);for(const s of n){const a=N(r,s).length,u=N(t,s).length??a;a>1&&i.push({weight:Math.min(a,u),delimiter:s})}const o=i.sort(({weight:s},{weight:a})=>a-s).map(({delimiter:s})=>s);for(const s of o){const a=le(k(r,s).names,e==null?void 0:e.longitudeField,e==null?void 0:e.latitudeField);if(a.longitudeFieldName&&a.latitudeFieldName)return{delimiter:s,locationInfo:a}}return{delimiter:o[0],locationInfo:null}}function*v(r,t,e,i=()=>Object.create(null)){const n=q(r);n.next();let o="",s="",a=0,u=i(),d=0;e:for(const h of n){const m=C(h,e);for(const y of m)if(o+=s+y,s="",a+=D(y),a%2==0){if(a>0){const g=E.exec(o);if(!g){u=i(),d=0,o="",a=0;continue e}u[t[d]]=g[1].replaceAll(S,'"'),d++}else u[t[d]]=o,d++;o="",a=0}else s=e;a===0?(yield u,u=i(),d=0):s=O}}function k(r,t){const e=N(r,t).filter(n=>n!=null),i=e.map(n=>_(n));for(let n=i.length-1;n>=0;n--)i[n]||(i.splice(n,1),e.splice(n,1));return{names:i,aliases:e}}function N(r,t){if(!(r!=null&&r.length))return[];const e=[];let i="",n="",o=0;const s=C(r,t);for(const a of s)if(i+=n+a,n="",o+=D(a),o%2==0){if(o>0){const u=E.exec(i);u&&e.push(u[1].replaceAll(S,'"'))}else e.push(i);i="",o=0}else n=t;return e}function D(r){let t=0,e=0;for(e=r.indexOf('"',e);e>=0;)t++,e=r.indexOf('"',e+1);return t}function le(r,t,e){var s,a;t=(s=_(t))==null?void 0:s.toLowerCase(),e=(a=_(e))==null?void 0:a.toLowerCase();const i=r.map(u=>u.toLowerCase()),n=t?r[i.indexOf(t)]:null,o=e?r[i.indexOf(e)]:null;return{longitudeFieldName:n||r[i.indexOf(fe.find(u=>i.includes(u)))],latitudeFieldName:o||r[i.indexOf(de.find(u=>i.includes(u)))]}}function ce(r,t,e,i,n){const o=[],s=v(r,e,t),a=[];for(const u of s){if(a.length===10)break;a.push(u)}for(let u=0;uy[d]))){case"integer":m="esriFieldTypeInteger";break;case"double":m="esriFieldTypeDouble";break;case"date":m="esriFieldTypeDate";break;default:m="esriFieldTypeString"}o.push({name:d,type:m,alias:h,length:j(m)})}}return o}function ue(r){if(!r.length)return"string";const t=/[^+\-.,0-9]/;return r.map(e=>{if(e!==""){if(!t.test(e)){let i=x(e);if(!isNaN(i))return/[.,]/.test(e)||!Number.isInteger(i)||i>214783647||i<-214783648?"double":"integer";if(e.includes("E")&&(i=Number(e),!Number.isNaN(i)||e.includes(",")&&(e=e.replace(",","."),i=Number(e),!Number.isNaN(i))))return"double"}return U(e)?"date":"string"}}).reduce((e,i)=>e===void 0?i:i===void 0?e:e===i?i:e==="string"||i==="string"?"string":e==="double"||i==="double"?"double":void 0)}const x=function(){const r=ne(),t=new RegExp("^"+r.regexp+"$"),e=new RegExp("["+r.group+"\\s\\xa0]","g"),i=r.factor;return n=>{const o=t.exec(n);if(r.factor=i,!o)return NaN;let s=o[1];if(!o[1]){if(!o[2])return NaN;s=o[2],r.factor*=-1}return s=s.replace(e,"").replace(r.decimal,"."),+s*r.factor}}(),de=["lat","latitude","latitude83","latdecdeg","lat_dd","y","ycenter","point_y"],fe=["lon","lng","long","longitude","longitude83","longdecdeg","long_dd","x","xcenter","point_x"],me=oe("esriGeometryPoint"),pe=["csv"],he=[0,0];class ye{constructor(t,e){this.x=t,this.y=e}}class Ze{constructor(){this._queryEngine=null,this._snapshotFeatures=async t=>{const e=await this._fetch(t);return this._createFeatures(e)}}destroy(){var t;(t=this._queryEngine)==null||t.destroy(),this._queryEngine=null}async load(t,e={}){var u;this._loadOptions=t;const[i]=await Promise.all([this._fetch(e.signal),this._checkProjection((u=t==null?void 0:t.parsingOptions)==null?void 0:u.spatialReference)]),n=ge(i,t);this._locationInfo=n.locationInfo,this._delimiter=n.delimiter,this._queryEngine=this._createQueryEngine(n);const o=await this._createFeatures(i);this._queryEngine.featureStore.addMany(o);const{fullExtent:s,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();if(n.layerDefinition.extent=s,a){const{start:d,end:h}=a;n.layerDefinition.timeInfo.timeExtent=[d,h]}return n}async applyEdits(){throw new I("csv-layer:editing-not-supported","applyEdits() is not supported on CSVLayer")}async queryFeatures(t={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(t,e.signal)}async queryFeatureCount(t={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(t,e.signal)}async queryObjectIds(t={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(t,e.signal)}async queryExtent(t={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(t,e.signal)}async querySnapping(t,e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(t,e.signal)}async refresh(t){var n;this._loadOptions.customParameters=t,(n=this._snapshotTask)==null||n.abort(),this._snapshotTask=P(this._snapshotFeatures),this._snapshotTask.promise.then(o=>{this._queryEngine.featureStore.clear(),o&&this._queryEngine.featureStore.addMany(o)},o=>{this._queryEngine.featureStore.clear(),R(o)||V.getLogger("esri.layers.CSVLayer").error(new I("csv-layer:refresh","An error occurred during refresh",{error:o}))}),await this._waitSnapshotComplete();const{fullExtent:e,timeExtent:i}=await this._queryEngine.fetchRecomputedExtents();return{extent:e,timeExtent:i}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(t){const{url:e,customParameters:i}=this._loadOptions;if(!e)throw new I("csv-layer:invalid-source","url not defined");const n=L(e);return(await A(n.path,{query:{...n.query,...i},responseType:"text",signal:t})).data}_createQueryEngine(t){const{objectIdField:e,fields:i,extent:n,timeInfo:o}=t.layerDefinition,s=new ee({geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1});return new ie({fieldsIndex:w.fromLayerJSON({fields:i,dateFieldsTimeReference:{timeZoneIANA:T}}),geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1,timeInfo:o,objectIdField:e,spatialReference:n.spatialReference||{wkid:4326},cacheSpatialQueries:!0,featureStore:s})}async _createFeatures(t){const{latitudeFieldName:e,longitudeFieldName:i}=this._locationInfo,{objectIdField:n,fieldsIndex:o,spatialReference:s}=this._queryEngine;let a=[];const u=[],d=o.fields.filter(l=>l.name!==n).map(l=>l.name);let h=0;const m={};for(const l of o.fields)if(l.type!=="esriFieldTypeOID"&&l.type!=="esriFieldTypeGlobalID"){const p=G(l);p!==void 0&&(m[l.name]=p)}const y=v(t,d,this._delimiter,re(m,n));for(const l of y){const p=this._parseCoordinateValue(l[e]),F=this._parseCoordinateValue(l[i]);if(F!=null&&p!=null&&!isNaN(p)&&!isNaN(F)){l[e]=p,l[i]=F;for(const c in l)if(c!==e&&c!==i){if(o.isDateField(c))l[c]=H(l[c]);else if(o.isNumericField(c)){const f=x(l[c]);isNaN(f)?l[c]=null:l[c]=f}}l[n]=h,h++,a.push(new ye(F,p)),u.push(l)}}if(!M({wkid:4326},s))if(Q(s))for(const l of a)[l.x,l.y]=Z(l.x,l.y,he);else a=W(K,a,Y.WGS84,s,null,null);const g=[];for(let l=0;l181)&&(e=parseFloat(t)),e}async _checkProjection(t){try{await te(B,t)}catch{throw new I("csv-layer:projection-not-supported","Projection not supported")}}}function ge(r,t){var l,p,F;const e=t.parsingOptions||{},i={delimiter:e.delimiter,layerDefinition:null,locationInfo:{latitudeFieldName:e.latitudeField,longitudeFieldName:e.longitudeField}},n=i.layerDefinition={name:J(t.url,pe)||"csv",dateFieldsTimeReference:{timeZoneIANA:T},drawingInfo:me,geometryType:"esriGeometryPoint",objectIdField:null,fields:[],timeInfo:e.timeInfo,extent:{xmin:Number.POSITIVE_INFINITY,ymin:Number.POSITIVE_INFINITY,xmax:Number.NEGATIVE_INFINITY,ymax:Number.NEGATIVE_INFINITY,spatialReference:e.spatialReference||{wkid:4326}}},o=q(r),s=(l=o.next().value)==null?void 0:l.trim(),a=(p=o.next().value)==null?void 0:p.trim();if(!s)throw new I("csv-layer:empty-csv","CSV is empty",{csv:r});const{delimiter:u,locationInfo:d}=ae(s,a,e);if(!u)throw new I("csv-layer:invalid-delimiter","Unable to detect the delimiter from CSV",{firstLine:s,secondLine:a,parsingOptions:e});if(!d)throw new I("csv-layer:location-fields-not-found","Unable to identify latitude and longitude fields from the CSV file",{firstLine:s,secondLine:a,parsingOptions:e});i.locationInfo=d,i.delimiter=u;const{names:h,aliases:m}=k(s,u),y=ce(r,i.delimiter,h,m,i.locationInfo);if((F=e.fields)!=null&&F.length){const c=new w(e.fields);for(const f of y){const b=c.get(f.name);b&&Object.assign(f,b)}}if(!y.some(c=>c.type==="esriFieldTypeOID"&&(n.objectIdField=c.name,!0))){const c={name:"__OBJECTID",alias:"__OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1};n.objectIdField=c.name,y.unshift(c)}n.fields=y;const g=new w(n.fields);if(i.locationInfo&&(i.locationInfo.latitudeFieldName=g.get(i.locationInfo.latitudeFieldName).name,i.locationInfo.longitudeFieldName=g.get(i.locationInfo.longitudeFieldName).name),n.timeInfo){const c=n.timeInfo;if(c.startTimeField){const f=g.get(c.startTimeField);f?(c.startTimeField=f.name,f.type="esriFieldTypeDate"):c.startTimeField=null}if(c.endTimeField){const f=g.get(c.endTimeField);f?(c.endTimeField=f.name,f.type="esriFieldTypeDate"):c.endTimeField=null}if(c.trackIdField){const f=g.get(c.trackIdField);c.trackIdField=f?f.name:null}c.startTimeField||c.endTimeField||(n.timeInfo=null)}return i}export{Ze as default}; diff --git a/assets/CatalogDynamicGroupLayerView2D-CqaPUHS1.js b/assets/CatalogDynamicGroupLayerView2D-CyoAbf0b.js similarity index 87% rename from assets/CatalogDynamicGroupLayerView2D-CqaPUHS1.js rename to assets/CatalogDynamicGroupLayerView2D-CyoAbf0b.js index 8adf573..66d39f7 100644 --- a/assets/CatalogDynamicGroupLayerView2D-CqaPUHS1.js +++ b/assets/CatalogDynamicGroupLayerView2D-CyoAbf0b.js @@ -1 +1 @@ -import{V as u,k as c,p as m,g as y,s as f,n as g,d as w,f as V}from"./index-CEWggaxV.js";import{m as v,u as C}from"./LayerView-BEFTHNYv.js";import"./scaleUtils-Bqauo1zZ.js";import"./Container-CB7SlLB9.js";import"./highlightReasons-DbgbcWKM.js";import"./Texture-DJgkMrSB.js";const d=Symbol();let l=class extends v(C){constructor(){super(...arguments),this.layerViews=new u,this._debouncedUpdate=c(async()=>{const{layer:e,parent:{footprintLayerView:i}}=this;let s=[];if(i){const n=this._createQuery(),{features:o}=await i.queryFeatures(n);this.suspended||(s=o.map(r=>e.acquireLayer(r)))}this.removeHandles(d),this.addHandles(s,d)})}attach(){this.addAttachHandles([this._updatingHandles.addOnCollectionChange(()=>this.layerViews,()=>this._updateStageChildren(),{initial:!0}),m(()=>{var e;return((e=this.parent.footprintLayerView)==null?void 0:e.dataUpdating)===!1},()=>this._updateLayers()),y(()=>{var e;return[this.layer.maximumVisibleSublayers,this.suspended,(e=this.parent.footprintLayerView)==null?void 0:e.filter]},()=>this._updateLayers())])}detach(){this.container.removeAllChildren(),this.removeHandles(d)}update(e){}moveStart(){}viewChange(){}moveEnd(){}isUpdating(){return this.layerViews.some(e=>e.updating)}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((e,i)=>this.container.addChildAt(e.container,i))}_updateLayers(){this.suspended?this.removeHandles(d):this._updatingHandles.addPromise(this._debouncedUpdate().catch(e=>{f.getLogger(this).error(e)}))}_createQuery(){const{parent:{footprintLayerView:e},layer:{maximumVisibleSublayers:i,parent:{itemTypeField:s,itemSourceField:n,objectIdField:o,orderBy:r}}}=this,p=`${s} <> 'Scene Service'`,t=e.createQuery();t.returnGeometry=!1,t.num=i,t.outFields=[o,n],t.where=g(t.where,p);const a=r==null?void 0:r.find(h=>h.field&&!h.valueExpression);return a!=null&&a.field&&(t.orderByFields=[`${a.field} ${a.order==="descending"?"DESC":"ASC"}`]),t}};l=w([V("esri.views.2d.layers.CatalogDynamicGroupLayerView2D")],l);const F=l;export{F as default}; +import{V as u,k as c,p as m,g as y,s as f,n as g,d as w,f as V}from"./index-BjUNJPVf.js";import{m as v,u as C}from"./LayerView-Bux7vAEn.js";import"./scaleUtils-DWXMiS7R.js";import"./Container-_n5wCgez.js";import"./highlightReasons-BOU4mnPE.js";import"./Texture-S4dD-WHn.js";const d=Symbol();let l=class extends v(C){constructor(){super(...arguments),this.layerViews=new u,this._debouncedUpdate=c(async()=>{const{layer:e,parent:{footprintLayerView:i}}=this;let s=[];if(i){const n=this._createQuery(),{features:o}=await i.queryFeatures(n);this.suspended||(s=o.map(r=>e.acquireLayer(r)))}this.removeHandles(d),this.addHandles(s,d)})}attach(){this.addAttachHandles([this._updatingHandles.addOnCollectionChange(()=>this.layerViews,()=>this._updateStageChildren(),{initial:!0}),m(()=>{var e;return((e=this.parent.footprintLayerView)==null?void 0:e.dataUpdating)===!1},()=>this._updateLayers()),y(()=>{var e;return[this.layer.maximumVisibleSublayers,this.suspended,(e=this.parent.footprintLayerView)==null?void 0:e.filter]},()=>this._updateLayers())])}detach(){this.container.removeAllChildren(),this.removeHandles(d)}update(e){}moveStart(){}viewChange(){}moveEnd(){}isUpdating(){return this.layerViews.some(e=>e.updating)}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((e,i)=>this.container.addChildAt(e.container,i))}_updateLayers(){this.suspended?this.removeHandles(d):this._updatingHandles.addPromise(this._debouncedUpdate().catch(e=>{f.getLogger(this).error(e)}))}_createQuery(){const{parent:{footprintLayerView:e},layer:{maximumVisibleSublayers:i,parent:{itemTypeField:s,itemSourceField:n,objectIdField:o,orderBy:r}}}=this,p=`${s} <> 'Scene Service'`,t=e.createQuery();t.returnGeometry=!1,t.num=i,t.outFields=[o,n],t.where=g(t.where,p);const a=r==null?void 0:r.find(h=>h.field&&!h.valueExpression);return a!=null&&a.field&&(t.orderByFields=[`${a.field} ${a.order==="descending"?"DESC":"ASC"}`]),t}};l=w([V("esri.views.2d.layers.CatalogDynamicGroupLayerView2D")],l);const F=l;export{F as default}; diff --git a/assets/CatalogFootprintLayerView2D-4V3pvH_N.js b/assets/CatalogFootprintLayerView2D-4V3pvH_N.js deleted file mode 100644 index a45c219..0000000 --- a/assets/CatalogFootprintLayerView2D-4V3pvH_N.js +++ /dev/null @@ -1 +0,0 @@ -import{d as o,y as i,f as m}from"./index-CEWggaxV.js";import{X as e}from"./FeatureLayerView2D-Dw_5zj3d.js";import"./diffUtils-B4YFa5Ju.js";import"./Container-CB7SlLB9.js";import"./highlightReasons-DbgbcWKM.js";import"./Texture-DJgkMrSB.js";import"./FeatureEffect-ByrbZlne.js";import"./FeatureSet-CYJUZgOk.js";import"./LayerView-BEFTHNYv.js";import"./scaleUtils-Bqauo1zZ.js";import"./TechniqueInstance-CSsTmbek.js";import"./UpdateTracking2D-nj9Q-3df.js";import"./TurboLine-CkxIB4ZX.js";import"./earcut-hRlx3adE.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./utils-p-5Bbga5.js";import"./Rect-CUzevAry.js";import"./LabelMetric-D2hbzzy_.js";import"./Program-DLRmaKpw.js";import"./labelUtils-Dnqx6jl5.js";import"./defaultsJSON-CHAaurhX.js";import"./BindType-BmZEZMMh.js";import"./Util-BS8sJGjF.js";import"./constants-D5zmR9t2.js";import"./TileContainer-Ci6dOowA.js";import"./WGLContainer-B_Pv-8Yi.js";import"./ProgramTemplate-BICQrNzS.js";import"./config-MDUrh2eL.js";import"./featureConversionUtils-CmP9mw0r.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./tileUtils-B7X19rIS.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./OrderByInfo-DKzv2-WS.js";import"./labelingInfo-CijajRsc.js";import"./LabelClass-6cZokw8y.js";import"./jsonUtils-qYmXvGJ1.js";import"./heatmapUtils-Clt5rJzr.js";import"./SDFHelper-CSK796Wb.js";import"./floatRGBA-BLm-Rhaq.js";import"./FeatureCommandQueue-Btq_FXyi.js";import"./HighlightCounter-abgLEfgq.js";import"./floorFilterUtils-DZ5C6FQv.js";import"./popupUtils-BovqErR_.js";import"./RefreshableLayerView-C1-PEoNB.js";let t=class extends e{get updateSuspended(){var r;const p=(r=this.parent)==null?void 0:r.dynamicGroupLayerView;return this.suspended&&(!p||p.suspended===!0)}};o([i()],t.prototype,"updateSuspended",null),t=o([m("esri.views.2d.layers.CatalogFootprintLayerView2D")],t);const Z=t;export{Z as default}; diff --git a/assets/CatalogFootprintLayerView2D-KePfoiS2.js b/assets/CatalogFootprintLayerView2D-KePfoiS2.js new file mode 100644 index 0000000..af349e8 --- /dev/null +++ b/assets/CatalogFootprintLayerView2D-KePfoiS2.js @@ -0,0 +1 @@ +import{d as o,y as i,f as m}from"./index-BjUNJPVf.js";import{X as e}from"./FeatureLayerView2D-B6lIa9Lt.js";import"./diffUtils-uUoMDFQS.js";import"./Container-_n5wCgez.js";import"./highlightReasons-BOU4mnPE.js";import"./Texture-S4dD-WHn.js";import"./FeatureEffect-DBbkrS6j.js";import"./FeatureSet-opEn8ou8.js";import"./LayerView-Bux7vAEn.js";import"./scaleUtils-DWXMiS7R.js";import"./TechniqueInstance-XtnK2qy2.js";import"./UpdateTracking2D-Ds_Gdrxd.js";import"./TurboLine-DNQdPIXo.js";import"./earcut-CWKXDqDj.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./utils-CuXO_Zzq.js";import"./Rect-CUzevAry.js";import"./LabelMetric-BcUxDImF.js";import"./Program-DBsYtQ00.js";import"./labelUtils-3p0-m-Ee.js";import"./defaultsJSON-CHAaurhX.js";import"./BindType-BmZEZMMh.js";import"./Util-CS5u4Lec.js";import"./constants-D5zmR9t2.js";import"./TileContainer-Bs-vXdD_.js";import"./WGLContainer-DgZNq7b0.js";import"./ProgramTemplate-Ck2I0bIi.js";import"./config-MDUrh2eL.js";import"./featureConversionUtils-BHhm7bvm.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./tileUtils-B7X19rIS.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./OrderByInfo-DKyk5GLW.js";import"./labelingInfo-DqAUis6e.js";import"./LabelClass-CeatfK8u.js";import"./jsonUtils-Ox5U0P0F.js";import"./heatmapUtils-BSteZBTj.js";import"./SDFHelper-kKuXhauo.js";import"./floatRGBA-Cs54GdjG.js";import"./FeatureCommandQueue-DI81F3gA.js";import"./HighlightCounter-qEuAaY1V.js";import"./floorFilterUtils-DZ5C6FQv.js";import"./popupUtils-Do2GfZME.js";import"./RefreshableLayerView-L9NGpXXI.js";let t=class extends e{get updateSuspended(){var r;const p=(r=this.parent)==null?void 0:r.dynamicGroupLayerView;return this.suspended&&(!p||p.suspended===!0)}};o([i()],t.prototype,"updateSuspended",null),t=o([m("esri.views.2d.layers.CatalogFootprintLayerView2D")],t);const Z=t;export{Z as default}; diff --git a/assets/CatalogLayer-BLgHCc1c.js b/assets/CatalogLayer-4790y54a.js similarity index 78% rename from assets/CatalogLayer-BLgHCc1c.js rename to assets/CatalogLayer-4790y54a.js index 65b5fc2..4b96dcc 100644 --- a/assets/CatalogLayer-BLgHCc1c.js +++ b/assets/CatalogLayer-4790y54a.js @@ -1 +1 @@ -import{ee as _,bQ as c,bP as h,dr as f,V as w,Z as b,e as $,s as j,ax as T,bT as m,aw as F,d as o,y as s,fC as L,f as g,fB as x,dt as S,fD as P,i as R,dM as O,dp as C,dq as V,dO as Q,dN as q,b4 as E,ay as B,N as v,bW as D,b_ as N,aX as y,M as G}from"./index-CEWggaxV.js";import{a as U}from"./lazyLayerLoader-s-GqbiwM.js";import{c as J}from"./OrderByInfo-DKzv2-WS.js";import{T as M}from"./utils-GMt8_G3w.js";import"./UniqueValueRenderer-BlkUix3g.js";import{a as A}from"./jsonUtils-BseLl1fZ.js";import{p as k}from"./FeatureEffectLayer-CLTrRFqx.js";import{C as H}from"./LabelClass-6cZokw8y.js";import{i as K}from"./labelingInfo-CijajRsc.js";import{p as W}from"./popupUtils-DAFYyAvw.js";import X from"./FeatureLayerSource-BeuGtrZI.js";import{o as Z}from"./clientSideDefaults-CgRgH99f.js";import{D as z}from"./FeatureLayerBase-DPJuwFpX.js";import{c as Y}from"./OrderedLayer-Do089KpQ.js";import{f as ee}from"./RefreshableLayer-1EkEhJeI.js";import{f as te}from"./TemporalLayer-qq3v_i3q.js";import{Q as re}from"./featureLayerUtils-BhDaw8pS.js";import{s as oe}from"./fieldProperties-DMs4wT6-.js";import{e as ie}from"./versionUtils-CaceEUVY.js";import"./ClassBreaksDefinition-D281x8Sj.js";import"./ColorStop-44hBlQ14.js";import"./diffUtils-B4YFa5Ju.js";import"./colorRamps-BJydlf0f.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-z2k12BH8.js";import"./jsonUtils-qYmXvGJ1.js";import"./styleUtils-CnV_Xzhi.js";import"./Version-Bd0QsIQ5.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./OverrideHelper-B4ryGWZb.js";import"./utils-p-5Bbga5.js";import"./quantizationUtils-CUjGHrU3.js";import"./heatmapUtils-Clt5rJzr.js";import"./FeatureEffect-ByrbZlne.js";import"./labelUtils-Dnqx6jl5.js";import"./defaultsJSON-CHAaurhX.js";import"./meshVertexSpaceUtils-BFWpJFSd.js";import"./MeshLocalVertexSpace-Cltwu1Kq.js";import"./vec3-CjYmIfaa.js";import"./External-DC51KyR4.js";import"./infoFor3D-DsOdlPuA.js";import"./editingSupport-DWTRjmy9.js";import"./EditBusLayer-SG7oYwiY.js";import"./QueryTask-CjHwD7wL.js";import"./executeForIds-BjeEaIen.js";import"./query-BM8R3sQ6.js";import"./pbfQueryUtils-CLRSFGBm.js";import"./pbf-D9QZb8S8.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./queryZScale-DN4aFXYn.js";import"./executeQueryJSON-DngjHRnE.js";import"./FeatureSet-CYJUZgOk.js";import"./executeQueryPBF-BYY2Ipuh.js";import"./featureConversionUtils-CmP9mw0r.js";import"./editsZScale-CQCGPEjO.js";import"./QueryEngineCapabilities-CTDe3LlQ.js";import"./AttachmentQuery-D61mmWw4.js";import"./RelationshipQuery-DDK72Kwc.js";import"./LayerFloorInfo-Cdq3ulNh.js";import"./serviceCapabilitiesUtils-t8SL4e_j.js";import"./TimeInfo-3TVmpFSA.js";class se{constructor(t,r){this.objectId=t,this.itemSource=r,this.count=0,this.layer=null,this.sortValue=void 0}}const u=new _(20,e=>e.destroy());let l=class extends c(h(f(m))){constructor(e){super(e),this._oidToReference=new Map,this._layerToReference=new Map,this._portals=new Map,this.layers=new w,this.maximumVisibleSublayers=10,this.opacity=1,this.title="Layers In View",this.type="catalog-dynamic-group",this.visible=!0}load(e){return this.addResolvingPromise(this.parent.load()),Promise.resolve(this)}get _orderBy(){var e;return((e=this.parent.orderBy)==null?void 0:e.find(t=>!t.valueExpression&&t.field))??new J({field:this.parent.objectIdField})}get _referenceComparator(){const e=this._orderBy,t=this.parent.fieldsIndex.get(e.field),r=M(t==null?void 0:t.toJSON().type,e.order==="descending");return(i,a)=>r(i.sortValue,a.sortValue)||i.objectId-i.objectId}acquireLayer(e){const t=e.getObjectId(),r=b(this._oidToReference,t,()=>this._createLayerReference(e));return r.count++,$(()=>{r.count--,r.count||this._disposeLayerReference(r)})}_createLayerReference(e){const t=e.getObjectId(),r=e.getAttribute(this.parent.itemSourceField),i=new se(t,r);if(u.get(r))return this._addLayer(u.pop(r),i,e),i;let a;try{a=JSON.parse(r)}catch(d){return j.getLogger(this).error(d),i}return this._createLayer(a).then(d=>{this.destroyed||i.count===0?(u.get(r)||u.put(i.itemSource,d),i.layer=null):this._addLayer(d,i,e)}).catch(()=>{}),i}_addLayer(e,t,r){this._layerToReference.set(e,t),t.sortValue=r.getAttribute(this._orderBy.field),t.layer=e,e.parent=this,this.layers.add(e),this.layers.sort((i,a)=>this._referenceComparator(this._layerToReference.get(i),this._layerToReference.get(a)))}_disposeLayerReference(e){e.layer&&(this._layerToReference.delete(e.layer),this.layers.remove(e.layer),u.put(e.itemSource,e.layer)),this._oidToReference.delete(e.objectId)}async _createLayer(e){if(!pe(e))return new(await U.UnsupportedLayer());const{itemId:t,portalUrl:r}=e,i=b(this._portals,r,()=>new T({url:r}));return m.fromPortalItem(new F({id:t,portal:i}))}};o([s()],l.prototype,"_orderBy",null),o([s()],l.prototype,"_referenceComparator",null),o([s({readOnly:!0})],l.prototype,"layers",void 0),o([s()],l.prototype,"maximumVisibleSublayers",void 0),o([s(L)],l.prototype,"opacity",void 0),o([s({type:String,json:{name:"title",write:!0}})],l.prototype,"title",void 0),o([s({json:{read:!1}})],l.prototype,"type",void 0),o([s({type:Boolean,json:{name:"visibility",write:!0}})],l.prototype,"visible",void 0),l=o([g("esri.layers.catalog.CatalogDynamicGroupLayer")],l);const ae=l;function pe(e){return typeof e=="object"&&e!=null&&"itemId"in e&&"portalUrl"in e}let n=class extends c(k(h(f(m)))){constructor(e){super(e),this.labelingInfo=null,this.labelsVisible=!0,this.legendEnabled=!0,this.opacity=1,this.popupEnabled=!0,this.popupTemplate=null,this.renderer=null,this.type="catalog-footprint",this.visible=!0}load(e){return this.addResolvingPromise(this.parent.load()),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}get fields(){return this.parent.fields}get fieldsIndex(){return this.parent.fieldsIndex}get geometryType(){return this.parent.geometryType}get objectIdField(){return this.parent.objectIdField}get orderBy(){return this.parent.orderBy}createPopupTemplate(e){const t={fields:this.parent.fields,objectIdField:this.parent.objectIdField,title:this.title};return W(t,e)}createQuery(){return this.parent.createQuery()}queryFeatures(e,t){return this.parent.queryFeatures(e,t)}};o([s({readOnly:!0})],n.prototype,"defaultPopupTemplate",null),o([s({type:[H],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:K,write:!0}})],n.prototype,"labelingInfo",void 0),o([s(x)],n.prototype,"labelsVisible",void 0),o([s(S)],n.prototype,"legendEnabled",void 0),o([s(L)],n.prototype,"opacity",void 0),o([s(P)],n.prototype,"popupEnabled",void 0),o([s({type:R,json:{name:"popupInfo",write:!0}})],n.prototype,"popupTemplate",void 0),o([s({types:A,json:{name:"layerDefinition.drawingInfo.renderer"}})],n.prototype,"renderer",void 0),o([s({json:{read:!1}})],n.prototype,"type",void 0),o([s({type:Boolean,json:{name:"visibility",write:!0}})],n.prototype,"visible",void 0),n=o([g("esri.layers.catalog.CatalogFootprintLayer")],n);const ne=n,le="esri.layers.CatalogLayer",I=oe();let p=class extends z(h(Y(te(c(ee(O(C(V(f(Q(q(E(m))))))))))))){constructor(e){super(e),this.dynamicGroupLayer=new ae({parent:this}),this.fields=null,this.fieldsIndex=null,this.footprintLayer=new ne({parent:this}),this.itemSourceField="cd_itemsource",this.itemTypeField="cd_itemtype",this.layers=new w([this.dynamicGroupLayer,this.footprintLayer]),this.source=new X({layer:this}),this.type="catalog"}load(e){const t=e!=null?e.signal:null,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(B).then(async()=>{var i;if(!this.url)throw new v("catalog-layer:missing-url","Catalog layer must be created with a url");if(this.url&&this.layerId==null){const a=await this._fetchFirstValidLayerId(t);if(a==null)throw new v("catalog-layer:missing-layerId","There is no Catalog Layer in the service",{service:this.url});this.layerId=a}await this.source.load(),this.source.sourceJSON&&(this.sourceJSON=this.source.sourceJSON,this.read(this.source.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:(i=this.portalItem)==null?void 0:i.portal,url:this.parsedUrl}))}).then(()=>re(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")??0)+1}get parsedUrl(){const e=D(this.url);return e!=null&&this.layerId!=null&&(e.path=N(e.path,this.layerId.toString())),e}createQuery(){var a;const e=new y,t=(a=this.capabilities)==null?void 0:a.query;e.returnGeometry=!0,t&&(e.compactGeometryEnabled=t.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=t.supportsDefaultSpatialReference),e.outFields=["*"];const{timeOffset:r,timeExtent:i}=this;return e.timeExtent=r!=null&&i!=null?i.offset(-r.value,r.unit):i||null,e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){var r;return(r=this.fieldsIndex.get(e))==null?void 0:r.domain}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(y.from(e)??r.createQuery(),t);if(i!=null&&i.features)for(const a of i.features)a.layer=a.sourceLayer=r.footprintLayer;return i}async queryObjectIds(e,t){return(await this.load()).source.queryObjectIds(y.from(e)??this.createQuery(),t)}async queryFeatureCount(e,t){return(await this.load()).source.queryFeatureCount(y.from(e)??this.createQuery(),t)}async queryExtent(e,t){return(await this.load()).source.queryExtent(y.from(e)??this.createQuery(),t)}serviceSupportsSpatialReference(e){return this.loaded&&ie(this,e)}read(e,t){super.read(e,t);let r=e.footprintLayer;r||(t==null?void 0:t.origin)!=="service"||(r={layerDefinition:{drawingInfo:Z(e.geometryType)}}),this.footprintLayer.read(r,t)}_fetchFirstValidLayerId(e){return G(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(t=>{var i;const r=t.data;if(r)return Array.isArray(r.layers)?(i=r.layers.find(a=>a.type==="Catalog Layer"))==null?void 0:i.id:void 0})}};o([s({readOnly:!0})],p.prototype,"createQueryVersion",null),o([s({...I.fields,json:{origins:{service:{name:"fields"}}}})],p.prototype,"fields",void 0),o([s(I.fieldsIndex)],p.prototype,"fieldsIndex",void 0),o([s({json:{read:!1,write:!1}})],p.prototype,"footprintLayer",void 0),o([s()],p.prototype,"itemSourceField",void 0),o([s()],p.prototype,"itemTypeField",void 0),o([s()],p.prototype,"layers",void 0),o([s({value:"CatalogLayer",type:["CatalogLayer"]})],p.prototype,"operationalLayerType",void 0),o([s()],p.prototype,"outFields",void 0),o([s({readOnly:!0})],p.prototype,"parsedUrl",null),o([s()],p.prototype,"source",void 0),o([s({json:{read:!1}})],p.prototype,"type",void 0),p=o([g(le)],p);const vt=p;export{vt as default}; +import{ee as _,bQ as c,bP as h,dr as f,V as w,Z as b,e as $,s as j,ax as T,bT as m,aw as F,d as o,y as s,fC as L,f as g,fB as x,dt as S,fD as P,i as R,dM as O,dp as C,dq as V,dO as Q,dN as q,b4 as E,ay as B,N as v,bW as D,b_ as N,aX as y,M as G}from"./index-BjUNJPVf.js";import{a as U}from"./lazyLayerLoader-Cu0XtDD2.js";import{c as J}from"./OrderByInfo-DKyk5GLW.js";import{T as M}from"./utils-CY1ReiSd.js";import"./UniqueValueRenderer-7V9Bhr-D.js";import{a as A}from"./jsonUtils-Dw332y6z.js";import{p as k}from"./FeatureEffectLayer-DarO4Ctx.js";import{C as H}from"./LabelClass-CeatfK8u.js";import{i as K}from"./labelingInfo-DqAUis6e.js";import{p as W}from"./popupUtils-DlZin22m.js";import X from"./FeatureLayerSource-3cjHhwgM.js";import{o as Z}from"./clientSideDefaults-BQP5n3lX.js";import{D as z}from"./FeatureLayerBase-D0I-Escx.js";import{c as Y}from"./OrderedLayer-dLoPhxcx.js";import{f as ee}from"./RefreshableLayer-_r2TPtol.js";import{f as te}from"./TemporalLayer-CKICYnEl.js";import{Q as re}from"./featureLayerUtils-lwqyOSrl.js";import{s as oe}from"./fieldProperties-DnrQXLBM.js";import{e as ie}from"./versionUtils-BIAEZzrm.js";import"./ClassBreaksDefinition-Djcxa8Lp.js";import"./ColorStop-DCGjAKLC.js";import"./diffUtils-uUoMDFQS.js";import"./colorRamps-CcakIWlU.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-BX9G5gNQ.js";import"./jsonUtils-Ox5U0P0F.js";import"./styleUtils-DOUOskVZ.js";import"./Version-Dqq_CHBG.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./OverrideHelper-DxFZBnGL.js";import"./utils-CuXO_Zzq.js";import"./quantizationUtils-CfV316jZ.js";import"./heatmapUtils-BSteZBTj.js";import"./FeatureEffect-DBbkrS6j.js";import"./labelUtils-3p0-m-Ee.js";import"./defaultsJSON-CHAaurhX.js";import"./meshVertexSpaceUtils-DwMoblqo.js";import"./MeshLocalVertexSpace-DRvwbFTJ.js";import"./vec3-DdRUbala.js";import"./External-DIoD7Bb4.js";import"./infoFor3D-DsOdlPuA.js";import"./editingSupport-4MwIplWk.js";import"./EditBusLayer-OslMX9fF.js";import"./QueryTask-Cl66pG_V.js";import"./executeForIds-CZ3M8IZd.js";import"./query-Bk_ITqRK.js";import"./pbfQueryUtils-CSeFSIjv.js";import"./pbf-Du8sFEWo.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./queryZScale-Dwvn5BlQ.js";import"./executeQueryJSON-COxi_Fac.js";import"./FeatureSet-opEn8ou8.js";import"./executeQueryPBF-DROgTCuZ.js";import"./featureConversionUtils-BHhm7bvm.js";import"./editsZScale-Bfe6gH1b.js";import"./QueryEngineCapabilities-CTDe3LlQ.js";import"./AttachmentQuery-DmEAIZff.js";import"./RelationshipQuery-BDJrOxaX.js";import"./LayerFloorInfo-DlYNbO-A.js";import"./serviceCapabilitiesUtils-DiP90Uds.js";import"./TimeInfo-DooETFWC.js";class se{constructor(t,r){this.objectId=t,this.itemSource=r,this.count=0,this.layer=null,this.sortValue=void 0}}const u=new _(20,e=>e.destroy());let l=class extends c(h(f(m))){constructor(e){super(e),this._oidToReference=new Map,this._layerToReference=new Map,this._portals=new Map,this.layers=new w,this.maximumVisibleSublayers=10,this.opacity=1,this.title="Layers In View",this.type="catalog-dynamic-group",this.visible=!0}load(e){return this.addResolvingPromise(this.parent.load()),Promise.resolve(this)}get _orderBy(){var e;return((e=this.parent.orderBy)==null?void 0:e.find(t=>!t.valueExpression&&t.field))??new J({field:this.parent.objectIdField})}get _referenceComparator(){const e=this._orderBy,t=this.parent.fieldsIndex.get(e.field),r=M(t==null?void 0:t.toJSON().type,e.order==="descending");return(i,a)=>r(i.sortValue,a.sortValue)||i.objectId-i.objectId}acquireLayer(e){const t=e.getObjectId(),r=b(this._oidToReference,t,()=>this._createLayerReference(e));return r.count++,$(()=>{r.count--,r.count||this._disposeLayerReference(r)})}_createLayerReference(e){const t=e.getObjectId(),r=e.getAttribute(this.parent.itemSourceField),i=new se(t,r);if(u.get(r))return this._addLayer(u.pop(r),i,e),i;let a;try{a=JSON.parse(r)}catch(d){return j.getLogger(this).error(d),i}return this._createLayer(a).then(d=>{this.destroyed||i.count===0?(u.get(r)||u.put(i.itemSource,d),i.layer=null):this._addLayer(d,i,e)}).catch(()=>{}),i}_addLayer(e,t,r){this._layerToReference.set(e,t),t.sortValue=r.getAttribute(this._orderBy.field),t.layer=e,e.parent=this,this.layers.add(e),this.layers.sort((i,a)=>this._referenceComparator(this._layerToReference.get(i),this._layerToReference.get(a)))}_disposeLayerReference(e){e.layer&&(this._layerToReference.delete(e.layer),this.layers.remove(e.layer),u.put(e.itemSource,e.layer)),this._oidToReference.delete(e.objectId)}async _createLayer(e){if(!pe(e))return new(await U.UnsupportedLayer());const{itemId:t,portalUrl:r}=e,i=b(this._portals,r,()=>new T({url:r}));return m.fromPortalItem(new F({id:t,portal:i}))}};o([s()],l.prototype,"_orderBy",null),o([s()],l.prototype,"_referenceComparator",null),o([s({readOnly:!0})],l.prototype,"layers",void 0),o([s()],l.prototype,"maximumVisibleSublayers",void 0),o([s(L)],l.prototype,"opacity",void 0),o([s({type:String,json:{name:"title",write:!0}})],l.prototype,"title",void 0),o([s({json:{read:!1}})],l.prototype,"type",void 0),o([s({type:Boolean,json:{name:"visibility",write:!0}})],l.prototype,"visible",void 0),l=o([g("esri.layers.catalog.CatalogDynamicGroupLayer")],l);const ae=l;function pe(e){return typeof e=="object"&&e!=null&&"itemId"in e&&"portalUrl"in e}let n=class extends c(k(h(f(m)))){constructor(e){super(e),this.labelingInfo=null,this.labelsVisible=!0,this.legendEnabled=!0,this.opacity=1,this.popupEnabled=!0,this.popupTemplate=null,this.renderer=null,this.type="catalog-footprint",this.visible=!0}load(e){return this.addResolvingPromise(this.parent.load()),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}get fields(){return this.parent.fields}get fieldsIndex(){return this.parent.fieldsIndex}get geometryType(){return this.parent.geometryType}get objectIdField(){return this.parent.objectIdField}get orderBy(){return this.parent.orderBy}createPopupTemplate(e){const t={fields:this.parent.fields,objectIdField:this.parent.objectIdField,title:this.title};return W(t,e)}createQuery(){return this.parent.createQuery()}queryFeatures(e,t){return this.parent.queryFeatures(e,t)}};o([s({readOnly:!0})],n.prototype,"defaultPopupTemplate",null),o([s({type:[H],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:K,write:!0}})],n.prototype,"labelingInfo",void 0),o([s(x)],n.prototype,"labelsVisible",void 0),o([s(S)],n.prototype,"legendEnabled",void 0),o([s(L)],n.prototype,"opacity",void 0),o([s(P)],n.prototype,"popupEnabled",void 0),o([s({type:R,json:{name:"popupInfo",write:!0}})],n.prototype,"popupTemplate",void 0),o([s({types:A,json:{name:"layerDefinition.drawingInfo.renderer"}})],n.prototype,"renderer",void 0),o([s({json:{read:!1}})],n.prototype,"type",void 0),o([s({type:Boolean,json:{name:"visibility",write:!0}})],n.prototype,"visible",void 0),n=o([g("esri.layers.catalog.CatalogFootprintLayer")],n);const ne=n,le="esri.layers.CatalogLayer",I=oe();let p=class extends z(h(Y(te(c(ee(O(C(V(f(Q(q(E(m))))))))))))){constructor(e){super(e),this.dynamicGroupLayer=new ae({parent:this}),this.fields=null,this.fieldsIndex=null,this.footprintLayer=new ne({parent:this}),this.itemSourceField="cd_itemsource",this.itemTypeField="cd_itemtype",this.layers=new w([this.dynamicGroupLayer,this.footprintLayer]),this.source=new X({layer:this}),this.type="catalog"}load(e){const t=e!=null?e.signal:null,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(B).then(async()=>{var i;if(!this.url)throw new v("catalog-layer:missing-url","Catalog layer must be created with a url");if(this.url&&this.layerId==null){const a=await this._fetchFirstValidLayerId(t);if(a==null)throw new v("catalog-layer:missing-layerId","There is no Catalog Layer in the service",{service:this.url});this.layerId=a}await this.source.load(),this.source.sourceJSON&&(this.sourceJSON=this.source.sourceJSON,this.read(this.source.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:(i=this.portalItem)==null?void 0:i.portal,url:this.parsedUrl}))}).then(()=>re(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")??0)+1}get parsedUrl(){const e=D(this.url);return e!=null&&this.layerId!=null&&(e.path=N(e.path,this.layerId.toString())),e}createQuery(){var a;const e=new y,t=(a=this.capabilities)==null?void 0:a.query;e.returnGeometry=!0,t&&(e.compactGeometryEnabled=t.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=t.supportsDefaultSpatialReference),e.outFields=["*"];const{timeOffset:r,timeExtent:i}=this;return e.timeExtent=r!=null&&i!=null?i.offset(-r.value,r.unit):i||null,e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){var r;return(r=this.fieldsIndex.get(e))==null?void 0:r.domain}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(y.from(e)??r.createQuery(),t);if(i!=null&&i.features)for(const a of i.features)a.layer=a.sourceLayer=r.footprintLayer;return i}async queryObjectIds(e,t){return(await this.load()).source.queryObjectIds(y.from(e)??this.createQuery(),t)}async queryFeatureCount(e,t){return(await this.load()).source.queryFeatureCount(y.from(e)??this.createQuery(),t)}async queryExtent(e,t){return(await this.load()).source.queryExtent(y.from(e)??this.createQuery(),t)}serviceSupportsSpatialReference(e){return this.loaded&&ie(this,e)}read(e,t){super.read(e,t);let r=e.footprintLayer;r||(t==null?void 0:t.origin)!=="service"||(r={layerDefinition:{drawingInfo:Z(e.geometryType)}}),this.footprintLayer.read(r,t)}_fetchFirstValidLayerId(e){return G(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(t=>{var i;const r=t.data;if(r)return Array.isArray(r.layers)?(i=r.layers.find(a=>a.type==="Catalog Layer"))==null?void 0:i.id:void 0})}};o([s({readOnly:!0})],p.prototype,"createQueryVersion",null),o([s({...I.fields,json:{origins:{service:{name:"fields"}}}})],p.prototype,"fields",void 0),o([s(I.fieldsIndex)],p.prototype,"fieldsIndex",void 0),o([s({json:{read:!1,write:!1}})],p.prototype,"footprintLayer",void 0),o([s()],p.prototype,"itemSourceField",void 0),o([s()],p.prototype,"itemTypeField",void 0),o([s()],p.prototype,"layers",void 0),o([s({value:"CatalogLayer",type:["CatalogLayer"]})],p.prototype,"operationalLayerType",void 0),o([s()],p.prototype,"outFields",void 0),o([s({readOnly:!0})],p.prototype,"parsedUrl",null),o([s()],p.prototype,"source",void 0),o([s({json:{read:!1}})],p.prototype,"type",void 0),p=o([g(le)],p);const vt=p;export{vt as default}; diff --git a/assets/CatalogLayerView2D-BuGdqUm1.js b/assets/CatalogLayerView2D-d-xBXyF9.js similarity index 79% rename from assets/CatalogLayerView2D-BuGdqUm1.js rename to assets/CatalogLayerView2D-d-xBXyF9.js index 60efc1a..5c41ba1 100644 --- a/assets/CatalogLayerView2D-BuGdqUm1.js +++ b/assets/CatalogLayerView2D-d-xBXyF9.js @@ -1 +1 @@ -import{V as n,d as r,y as a,f as o}from"./index-CEWggaxV.js";import{m as s,u as l}from"./LayerView-BEFTHNYv.js";import"./scaleUtils-Bqauo1zZ.js";import"./Container-CB7SlLB9.js";import"./highlightReasons-DbgbcWKM.js";import"./Texture-DJgkMrSB.js";let i=class extends s(l){constructor(){super(...arguments),this.layerViews=new n}get dynamicGroupLayerView(){return this.layerViews.find(e=>{var t;return e.layer===((t=this.layer)==null?void 0:t.dynamicGroupLayer)})}get footprintLayerView(){return this.layerViews.find(e=>{var t;return e.layer===((t=this.layer)==null?void 0:t.footprintLayer)})}update(e){}moveStart(){}viewChange(){}moveEnd(){}attach(){this.addAttachHandles([this._updatingHandles.addOnCollectionChange(()=>this.layerViews,()=>this._updateStageChildren(),{initial:!0})])}detach(){this.container.removeAllChildren()}isUpdating(){return this.layerViews.some(e=>e.updating)}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((e,t)=>this.container.addChildAt(e.container,t))}};r([a()],i.prototype,"dynamicGroupLayerView",null),r([a()],i.prototype,"footprintLayerView",null),r([a()],i.prototype,"layerViews",void 0),i=r([o("esri.views.2d.layers.CatalogLayerView2D")],i);const c=i;export{c as default}; +import{V as n,d as r,y as a,f as o}from"./index-BjUNJPVf.js";import{m as s,u as l}from"./LayerView-Bux7vAEn.js";import"./scaleUtils-DWXMiS7R.js";import"./Container-_n5wCgez.js";import"./highlightReasons-BOU4mnPE.js";import"./Texture-S4dD-WHn.js";let i=class extends s(l){constructor(){super(...arguments),this.layerViews=new n}get dynamicGroupLayerView(){return this.layerViews.find(e=>{var t;return e.layer===((t=this.layer)==null?void 0:t.dynamicGroupLayer)})}get footprintLayerView(){return this.layerViews.find(e=>{var t;return e.layer===((t=this.layer)==null?void 0:t.footprintLayer)})}update(e){}moveStart(){}viewChange(){}moveEnd(){}attach(){this.addAttachHandles([this._updatingHandles.addOnCollectionChange(()=>this.layerViews,()=>this._updateStageChildren(),{initial:!0})])}detach(){this.container.removeAllChildren()}isUpdating(){return this.layerViews.some(e=>e.updating)}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((e,t)=>this.container.addChildAt(e.container,t))}};r([a()],i.prototype,"dynamicGroupLayerView",null),r([a()],i.prototype,"footprintLayerView",null),r([a()],i.prototype,"layerViews",void 0),i=r([o("esri.views.2d.layers.CatalogLayerView2D")],i);const c=i;export{c as default}; diff --git a/assets/ClassBreaksDefinition-D281x8Sj.js b/assets/ClassBreaksDefinition-Djcxa8Lp.js similarity index 95% rename from assets/ClassBreaksDefinition-D281x8Sj.js rename to assets/ClassBreaksDefinition-Djcxa8Lp.js index b441d8a..a31706e 100644 --- a/assets/ClassBreaksDefinition-D281x8Sj.js +++ b/assets/ClassBreaksDefinition-Djcxa8Lp.js @@ -1 +1 @@ -import{aY as r,d as i,c9 as o,y as t,f as l,aU as d}from"./index-CEWggaxV.js";const s=new r({esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation",esriClassifyDefinedInterval:"defined-interval"}),n=new r({esriNormalizeByLog:"log",esriNormalizeByPercentOfTotal:"percent-of-total",esriNormalizeByField:"field"});let e=class extends d{constructor(a){super(a),this.type="class-breaks-definition",this.breakCount=null,this.classificationField=null,this.classificationMethod=null,this.normalizationField=null,this.normalizationType=null}set standardDeviationInterval(a){this.classificationMethod==="standard-deviation"&&this._set("standardDeviationInterval",a)}set definedInterval(a){this.classificationMethod==="defined-interval"&&this._set("definedInterval",a)}};i([o({classBreaksDef:"class-breaks-definition"})],e.prototype,"type",void 0),i([t({json:{write:!0}})],e.prototype,"breakCount",void 0),i([t({json:{write:!0}})],e.prototype,"classificationField",void 0),i([t({type:String,json:{read:s.read,write:s.write}})],e.prototype,"classificationMethod",void 0),i([t({json:{write:!0}})],e.prototype,"normalizationField",void 0),i([t({json:{read:n.read,write:n.write}})],e.prototype,"normalizationType",void 0),i([t({value:null,json:{write:!0}})],e.prototype,"standardDeviationInterval",null),i([t({value:null,json:{write:!0}})],e.prototype,"definedInterval",null),e=i([l("esri.rest.support.ClassBreaksDefinition")],e);const p=e;export{p as d}; +import{aY as r,d as i,c9 as o,y as t,f as l,aU as d}from"./index-BjUNJPVf.js";const s=new r({esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation",esriClassifyDefinedInterval:"defined-interval"}),n=new r({esriNormalizeByLog:"log",esriNormalizeByPercentOfTotal:"percent-of-total",esriNormalizeByField:"field"});let e=class extends d{constructor(a){super(a),this.type="class-breaks-definition",this.breakCount=null,this.classificationField=null,this.classificationMethod=null,this.normalizationField=null,this.normalizationType=null}set standardDeviationInterval(a){this.classificationMethod==="standard-deviation"&&this._set("standardDeviationInterval",a)}set definedInterval(a){this.classificationMethod==="defined-interval"&&this._set("definedInterval",a)}};i([o({classBreaksDef:"class-breaks-definition"})],e.prototype,"type",void 0),i([t({json:{write:!0}})],e.prototype,"breakCount",void 0),i([t({json:{write:!0}})],e.prototype,"classificationField",void 0),i([t({type:String,json:{read:s.read,write:s.write}})],e.prototype,"classificationMethod",void 0),i([t({json:{write:!0}})],e.prototype,"normalizationField",void 0),i([t({json:{read:n.read,write:n.write}})],e.prototype,"normalizationType",void 0),i([t({value:null,json:{write:!0}})],e.prototype,"standardDeviationInterval",null),i([t({value:null,json:{write:!0}})],e.prototype,"definedInterval",null),e=i([l("esri.rest.support.ClassBreaksDefinition")],e);const p=e;export{p as d}; diff --git a/assets/ColorSet-DDQ4d9ui.js b/assets/ColorSet-wEWjQ87p.js similarity index 95% rename from assets/ColorSet-DDQ4d9ui.js rename to assets/ColorSet-wEWjQ87p.js index 89c9fa7..5ee4673 100644 --- a/assets/ColorSet-DDQ4d9ui.js +++ b/assets/ColorSet-wEWjQ87p.js @@ -1 +1 @@ -import{B as c,a3 as h}from"./Theme-Bdh3gaKt.js";class u extends c{_afterNew(){super._afterNewApplyThemes(),this._dirty.colors=!1}_beforeChanged(){this.isDirty("colors")&&this.reset()}generateColors(){this.setPrivate("currentPass",this.getPrivate("currentPass",0)+1);const e=this.getPrivate("currentPass"),t=this.get("colors",[this.get("baseColor",h.fromHex(16711680))]);this.getPrivate("numColors")||this.setPrivate("numColors",t.length);const r=this.getPrivate("numColors"),g=0,i=this.get("passOptions"),P=this.get("reuse");for(let a=g;a1;)n-=1;let s=o.s+(i.saturation||0)*e;s>1&&(s=1),s<0&&(s=0);let l=o.l+(i.lightness||0)*e;for(;l>1;)l-=1;t.push(h.fromHSL(n,s,l))}}getIndex(e){const t=this.get("colors",[]),r=this.get("saturation");return e>=t.length?(this.generateColors(),this.getIndex(e)):r!=null?h.saturate(t[e],r):t[e]}next(){let e=this.getPrivate("currentStep",this.get("startIndex",0));return this.setPrivate("currentStep",e+this.get("step",1)),this.getIndex(e)}reset(){this.setPrivate("currentStep",this.get("startIndex",0)),this.setPrivate("currentPass",0)}}Object.defineProperty(u,"className",{enumerable:!0,configurable:!0,writable:!0,value:"ColorSet"}),Object.defineProperty(u,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:c.classNames.concat([u.className])});export{u as s}; +import{B as c,a3 as h}from"./Theme-6HY29PEY.js";class u extends c{_afterNew(){super._afterNewApplyThemes(),this._dirty.colors=!1}_beforeChanged(){this.isDirty("colors")&&this.reset()}generateColors(){this.setPrivate("currentPass",this.getPrivate("currentPass",0)+1);const e=this.getPrivate("currentPass"),t=this.get("colors",[this.get("baseColor",h.fromHex(16711680))]);this.getPrivate("numColors")||this.setPrivate("numColors",t.length);const r=this.getPrivate("numColors"),g=0,i=this.get("passOptions"),P=this.get("reuse");for(let a=g;a1;)n-=1;let s=o.s+(i.saturation||0)*e;s>1&&(s=1),s<0&&(s=0);let l=o.l+(i.lightness||0)*e;for(;l>1;)l-=1;t.push(h.fromHSL(n,s,l))}}getIndex(e){const t=this.get("colors",[]),r=this.get("saturation");return e>=t.length?(this.generateColors(),this.getIndex(e)):r!=null?h.saturate(t[e],r):t[e]}next(){let e=this.getPrivate("currentStep",this.get("startIndex",0));return this.setPrivate("currentStep",e+this.get("step",1)),this.getIndex(e)}reset(){this.setPrivate("currentStep",this.get("startIndex",0)),this.setPrivate("currentPass",0)}}Object.defineProperty(u,"className",{enumerable:!0,configurable:!0,writable:!0,value:"ColorSet"}),Object.defineProperty(u,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:c.classNames.concat([u.className])});export{u as s}; diff --git a/assets/ColorStop-44hBlQ14.js b/assets/ColorStop-DCGjAKLC.js similarity index 93% rename from assets/ColorStop-44hBlQ14.js rename to assets/ColorStop-DCGjAKLC.js index 3139672..04097e3 100644 --- a/assets/ColorStop-44hBlQ14.js +++ b/assets/ColorStop-DCGjAKLC.js @@ -1 +1 @@ -import{d as t,y as r,f as n,aU as a,a9 as c,dS as v,aR as d}from"./index-CEWggaxV.js";var s;let o=s=class extends a{constructor(){super(...arguments),this.title=null}clone(){return new s({title:this.title})}};t([r({type:String,json:{write:!0}})],o.prototype,"title",void 0),o=s=t([n("esri.renderers.support.LegendOptions")],o);var i;let e=i=class extends a{constructor(l){super(l),this.color=null,this.label=null,this.value=null}writeValue(l,p,u){p[u]=l??0}clone(){return new i({color:this.color&&this.color.clone(),label:this.label,value:this.value})}};t([r({type:c,json:{type:[v],write:!0}})],e.prototype,"color",void 0),t([r({type:String,json:{write:!0}})],e.prototype,"label",void 0),t([r({type:Number,json:{write:{writerEnsuresNonNull:!0}}})],e.prototype,"value",void 0),t([d("value")],e.prototype,"writeValue",null),e=i=t([n("esri.renderers.visualVariables.support.ColorStop")],e);const h=e;export{h as a,o as p}; +import{d as t,y as r,f as n,aU as a,a9 as c,dS as v,aR as d}from"./index-BjUNJPVf.js";var s;let o=s=class extends a{constructor(){super(...arguments),this.title=null}clone(){return new s({title:this.title})}};t([r({type:String,json:{write:!0}})],o.prototype,"title",void 0),o=s=t([n("esri.renderers.support.LegendOptions")],o);var i;let e=i=class extends a{constructor(l){super(l),this.color=null,this.label=null,this.value=null}writeValue(l,p,u){p[u]=l??0}clone(){return new i({color:this.color&&this.color.clone(),label:this.label,value:this.value})}};t([r({type:c,json:{type:[v],write:!0}})],e.prototype,"color",void 0),t([r({type:String,json:{write:!0}})],e.prototype,"label",void 0),t([r({type:Number,json:{write:{writerEnsuresNonNull:!0}}})],e.prototype,"value",void 0),t([d("value")],e.prototype,"writeValue",null),e=i=t([n("esri.renderers.visualVariables.support.ColorStop")],e);const h=e;export{h as a,o as p}; diff --git a/assets/Container-CB7SlLB9.js b/assets/Container-_n5wCgez.js similarity index 99% rename from assets/Container-CB7SlLB9.js rename to assets/Container-_n5wCgez.js index 8c044be..bc031a7 100644 --- a/assets/Container-CB7SlLB9.js +++ b/assets/Container-_n5wCgez.js @@ -1 +1 @@ -import{d as g,y as m,f as k,a7 as Z,E as R,s as V,aV as L,iO as j,iP as z,iQ as Q,ca as J,df as S,D as tt,iR as et,hf as it,iS as M,bo as st,iT as C,ij as w,aY as nt,eO as rt}from"./index-CEWggaxV.js";import{l as ot,c as A}from"./highlightReasons-DbgbcWKM.js";import{e as lt,m as ht}from"./Texture-DJgkMrSB.js";const E=-1;let f=class extends Z{constructor(t){super(t),this._from=null,this._to=null,this._final=null,this._current=[],this._time=0,this.duration=R("mapview-transitions-duration"),this.effects=[]}set effect(t){if(this._get("effect")!==(t=t||"")){this._set("effect",t);try{this._transitionTo(P(t))}catch(i){this._transitionTo([]),V.getLogger(this).warn("Invalid Effect",{effect:t,error:i})}}}get hasEffects(){return this.transitioning||!!this.effects.length}set scale(t){this._updateForScale(t)}get transitioning(){return this._to!==null}canTransitionTo(t){try{return this.scale>0&&H(this._current,P(t),this.scale)}catch{return!1}}transitionStep(t,i){this._applyTimeTransition(t),this._updateForScale(i)}endTransitions(){this._applyTimeTransition(this.duration)}_transitionTo(t){this.scale>0&&H(this._current,t,this.scale)?(this._final=t,this._to=L(t),at(this._current,this._to,this.scale),this._from=L(this._current),this._time=0):(this._from=this._to=this._final=null,this._current=t),this._set("effects",this._current[0]?L(this._current[0].effects):[])}_applyTimeTransition(t){if(!(this._to&&this._from&&this._current&&this._final))return;this._time+=t;const i=Math.min(1,this._time/this.duration);for(let s=0;s=i[0].scale)l=n=i[0].effects;else if(t<=i[s].scale)l=n=i[s].effects;else for(let o=0;o=t&&c.scale<=t){h=(t-r.scale)/(c.scale-r.scale),n=r.effects,l=c.effects;break}}for(let o=0;o1||t.length>1)&&i<=0)&&z(e[0].effects,t[0].effects)}function at(e,t,i){const s=e.length>t.length?e:t,n=e.length>t.length?t:e,l=n[n.length-1],h=(l==null?void 0:l.scale)??i,o=(l==null?void 0:l.effects)??[];for(let r=n.length;rs?Math.max(s,n-l):Math.min(s,n+l),this.computedVisible=this.computedOpacity>0;const h=s===this.computedOpacity;this.inFadeTransition=!h,h||this.requestRender()}}else this.computedOpacity=this.opacity,this.computedVisible=this.visible}onAttach(){}onDetach(){}doRender(t){}ready(){this._isReady||(this._isReady=!0,this.emit("isReady"),this.requestRender())}};const ft=1,Tt=[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],St=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],O=256,_={outlineWidth:1.3,outerHaloWidth:.4,innerHaloWidth:.4,outlinePosition:0},T=()=>V.getLogger("esri.views.2d.engine.webgl.painter.highlight.HighlightGradient");function pt(e,t){t.fillColor[0]=e.color.r/255,t.fillColor[1]=e.color.g/255,t.fillColor[2]=e.color.b/255,t.fillColor[3]=e.color.a,e.haloColor?(t.outlineColor[0]=e.haloColor.r/255,t.outlineColor[1]=e.haloColor.g/255,t.outlineColor[2]=e.haloColor.b/255,t.outlineColor[3]=e.haloColor.a):(t.outlineColor[0]=t.fillColor[0],t.outlineColor[1]=t.fillColor[1],t.outlineColor[2]=t.fillColor[2],t.outlineColor[3]=t.fillColor[3]),t.fillColor[3]*=e.fillOpacity,t.outlineColor[3]*=e.haloOpacity,t.fillColor[0]*=t.fillColor[3],t.fillColor[1]*=t.fillColor[3],t.fillColor[2]*=t.fillColor[3],t.outlineColor[0]*=t.outlineColor[3],t.outlineColor[1]*=t.outlineColor[3],t.outlineColor[2]*=t.outlineColor[3],t.outlineWidth=_.outlineWidth,t.outerHaloWidth=_.outerHaloWidth,t.innerHaloWidth=_.innerHaloWidth,t.outlinePosition=_.outlinePosition}const gt=[0,0,0,0];class B{constructor(){this.type="single",this._convertedHighlightOptions={fillColor:[.2*.75,.6*.75,.675,.75],outlineColor:[.2*.9,.54,.81,.9],outlinePosition:_.outlinePosition,outlineWidth:_.outlineWidth,innerHaloWidth:_.innerHaloWidth,outerHaloWidth:_.outerHaloWidth},this._shadeTexChanged=!0,this._texelData=new Uint8Array(4*O),this._minMaxDistance=[0,0]}setHighlightOptions(t){const i=this._convertedHighlightOptions;pt(t,i);const s=i.outlinePosition-i.outlineWidth/2-i.outerHaloWidth,n=i.outlinePosition-i.outlineWidth/2,l=i.outlinePosition+i.outlineWidth/2,h=i.outlinePosition+i.outlineWidth/2+i.innerHaloWidth,o=Math.sqrt(Math.PI/2)*ft,r=Math.abs(s)>o?Math.round(10*(Math.abs(s)-o))/10:0,c=Math.abs(h)>o?Math.round(10*(Math.abs(h)-o))/10:0;let u;r&&!c?T().error("The outer rim of the highlight is "+r+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards positive values (inwards)."):!r&&c?T().error("The inner rim of the highlight is "+c+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards negative values (outwards)."):r&&c&&T().error("The highlight is "+Math.max(r,c)+"px away from the edge of the feature; consider reducing some width values.");const a=[void 0,void 0,void 0,void 0];function y(d,I,p){a[0]=(1-p)*d[0]+p*I[0],a[1]=(1-p)*d[1]+p*I[1],a[2]=(1-p)*d[2]+p*I[2],a[3]=(1-p)*d[3]+p*I[3]}const{_texelData:v}=this;for(let d=0;de.stencilRef,compare:it.EQUAL,mask:255,op:{fail:M.KEEP,zFail:M.KEEP,zPass:M.REPLACE}}}},mt={color:{write:[!0,!0,!0,!0],blendMode:"additive"},depth:!1,stencil:!1},Rt={...K,color:{write:[!0,!0,!0,!0],blendMode:"delete"}};function yt({pixelRatio:e,state:t,displayLevel:i,requiredLevel:s},n){const l=1/2**(i-n.key.level),h=1/2**(s-n.key.level);return{displayMat3:Array.from(t.displayMat3),displayViewMat3:Array.from(t.displayViewMat3),displayViewScreenMat3:Array.from(n.transforms.displayViewScreenMat3),viewMat3:Array.from(t.viewMat3),tileMat3:Array.from(n.transforms.tileMat3),displayZoomFactor:l,requiredZoomFactor:h,tileOffset:[n.x,n.y],currentScale:t.scale,currentZoom:i,metersPerSRUnit:st(t.spatialReference),rotation:t.rotation,pixelRatio:e}}function X(e){var t;return((t=e.passOptions)==null?void 0:t.type)==="highlight"}function Y(e){var t;return((t=e.passOptions)==null?void 0:t.type)==="hittest"}function Ot(e){if(!Y(e))return null;const{position:t}=e.passOptions,i=e.pixelRatio,s=R("esri-mobile");return{position:t,distance:R(s?"hittest-2d-mobile-tolerance":"hittest-2d-desktop-tolerance")*i,smallSymbolDistance:R(s?"hittest-2d-mobile-tolerance":"hittest-2d-small-symbol-tolerance")*i,smallSymbolSizeThreshold:R("hittest-2d-small-symbol-tolerance-threshold")}}function Et(e){if(!X(e))return null;const{activeReasons:t,highlightAll:i}=e.passOptions;return{activeReasons:t,highlightAll:i?1:0}}function wt(e,t,i){const s={};for(const n in i)i[n]instanceof Function?s[n]=i[n](e,t):s[n]=i[n];return s}function Pt(e,t){const{attributeView:i,context:s}=e;return{storage:i.getUniforms(s),view:yt(e,t),hittestRequest:Ot(e),highlight:Et(e)}}function Ht(e){return{inside:e.selection===b.InsideEffect,outside:e.selection===b.OutsideEffect}}function vt(e){return Y(e)?mt:X(e)&&e.passOptions.stepType==="clear"?Rt:K}function Gt(e){const{row:t,col:i}=e.key,s=i*w,n=t*w;return{tileOffsetFromLocalOrigin:[s%C,n%C],maxIntsToLocalOrigin:[Math.floor(s/C),Math.floor(n/C)]}}new nt({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch",mesh:"mesh"});function xt(e){const{bandCount:t,attributeTable:i,colormap:s,pixelType:n}=e.raster.rasterInfo;return t===1&&(i!=null||s!=null||n==="u8"||n==="s8")}function It(e,t){return(e==null?void 0:e.type)==="single"&&t.multiHighlightEnabled&&(e.destroy(),e=null),(e==null?void 0:e.type)!=="multi"||t.multiHighlightEnabled||(e.destroy(),e=null),e||(e=t.multiHighlightEnabled?new _t:new B),e.setHighlightOptions(t),e}function Dt(e,t,i){const{painter:s,highlightGradient:n}=e,{highlight:l}=s.effects;if(!n)return;const h=e.passOptions,o=n.getReasonsWithGradients();for(let r=0;ri.clips=t)}get computedEffects(){var t;return((t=this._effectView)==null?void 0:t.effects)??null}get effect(){var t;return((t=this._effectView)==null?void 0:t.effect)??""}set effect(t){(this._effectView||t)&&(this._effectView||(this._effectView=new f),this._effectView.effect=t,this.requestRender())}get highlightOptions(){return this._highlightOptions}set highlightOptions(t){if(!t)return this._highlightOptions=null,void(this._highlightGradient&&(this._highlightGradient.destroy(),this._highlightGradient=null,this.requestRender()));this._highlightOptions&&this._highlightOptions.equals(t)||(this._highlightOptions=t,this._highlightGradient=It(this._highlightGradient,t),this.requestRender())}get hasBlending(){return!!this.blendMode}get hasHighlight(){return this.children.some(t=>t.hasHighlight)}get hasLabels(){return this.children.some(t=>t.hasLabels)}get requiresDedicatedFBO(){return this.children.some(t=>"blendMode"in t&&t.blendMode&&t.blendMode!=="normal")}updateTransitionProperties(t,i){super.updateTransitionProperties(t,i),this._effectView&&(this._effectView.transitionStep(t,i),this._effectView.transitioning&&this.requestRender())}doRender(t){var n;const i=this.createRenderParams(t),{painter:s}=i;s.beforeRenderLayer(i,(n=this._clips)!=null&&n.length?255:0,this.computedOpacity),this.renderChildren(i),s.afterRenderLayer(i,this.computedOpacity)}addChild(t){return this.addChildAt(t,this.children.length)}addChildAt(t,i=this.children.length){if(!t||this.contains(t))return t;this._needsSort=!0;const s=t.parent;return s&&s!==this&&s.removeChild(t),i>=this.children.length?this.children.push(t):this.children.splice(i,0,t),this._childrenSet.add(t),t.parent=this,t.stage=this.stage,this!==this.stage&&(t.clips=this.clips),this.requestRender(),t}contains(t){return this._childrenSet.has(t)}endTransitions(){super.endTransitions(),this._effectView&&(this._effectView.endTransitions(),this.requestRender())}removeAllChildren(){this._childrenSet.clear(),this._needsSort=!0;for(const t of this.children)this!==this.stage&&(t.clips=null),t.stage=null,t.parent=null;this.children.length=0}removeChild(t){return this.contains(t)?this.removeChildAt(this.children.indexOf(t)):t}removeChildAt(t){if(t<0||t>=this.children.length)return null;this._needsSort=!0;const i=this.children.splice(t,1)[0];return this._childrenSet.delete(i),this!==this.stage&&(i.clips=null),i.stage=null,i.parent=null,i}sortChildren(t){this._needsSort&&(this.children.sort(t),this._needsSort=!1)}beforeRender(t){super.beforeRender(t);for(const i of this.children)i.beforeRender(t)}afterRender(t){super.afterRender(t);for(const i of this.children)i.afterRender(t)}_createTransforms(){return{displayViewScreenMat3:rt()}}onAttach(){super.onAttach();const t=this.stage;for(const i of this.children)i.stage=t}onDetach(){super.onDetach();for(const t of this.children)t.stage=null}renderChildren(t){for(const i of this.children)i.processRender(t)}createRenderParams(t){return{...t,requireFBO:this.requiresDedicatedFBO,blendMode:this.blendMode,effects:this.computedEffects,globalOpacity:t.globalOpacity*this.computedOpacity,inFadeTransition:this.inFadeTransition,highlightGradient:this._highlightGradient||t.highlightGradient}}}export{F as A,D as E,$ as L,vt as M,q as N,b as R,U as S,Dt as a,f as b,Pt as c,yt as d,wt as e,X as f,St as g,$t as h,ut as i,Y as m,ft as o,xt as r,Tt as t,Gt as w,Ht as y}; +import{d as g,y as m,f as k,a7 as Z,E as R,s as V,aV as L,iO as j,iP as z,iQ as Q,ca as J,df as S,D as tt,iR as et,hf as it,iS as M,bo as st,iT as C,ij as w,aY as nt,eO as rt}from"./index-BjUNJPVf.js";import{l as ot,c as A}from"./highlightReasons-BOU4mnPE.js";import{e as lt,m as ht}from"./Texture-S4dD-WHn.js";const E=-1;let f=class extends Z{constructor(t){super(t),this._from=null,this._to=null,this._final=null,this._current=[],this._time=0,this.duration=R("mapview-transitions-duration"),this.effects=[]}set effect(t){if(this._get("effect")!==(t=t||"")){this._set("effect",t);try{this._transitionTo(P(t))}catch(i){this._transitionTo([]),V.getLogger(this).warn("Invalid Effect",{effect:t,error:i})}}}get hasEffects(){return this.transitioning||!!this.effects.length}set scale(t){this._updateForScale(t)}get transitioning(){return this._to!==null}canTransitionTo(t){try{return this.scale>0&&H(this._current,P(t),this.scale)}catch{return!1}}transitionStep(t,i){this._applyTimeTransition(t),this._updateForScale(i)}endTransitions(){this._applyTimeTransition(this.duration)}_transitionTo(t){this.scale>0&&H(this._current,t,this.scale)?(this._final=t,this._to=L(t),at(this._current,this._to,this.scale),this._from=L(this._current),this._time=0):(this._from=this._to=this._final=null,this._current=t),this._set("effects",this._current[0]?L(this._current[0].effects):[])}_applyTimeTransition(t){if(!(this._to&&this._from&&this._current&&this._final))return;this._time+=t;const i=Math.min(1,this._time/this.duration);for(let s=0;s=i[0].scale)l=n=i[0].effects;else if(t<=i[s].scale)l=n=i[s].effects;else for(let o=0;o=t&&c.scale<=t){h=(t-r.scale)/(c.scale-r.scale),n=r.effects,l=c.effects;break}}for(let o=0;o1||t.length>1)&&i<=0)&&z(e[0].effects,t[0].effects)}function at(e,t,i){const s=e.length>t.length?e:t,n=e.length>t.length?t:e,l=n[n.length-1],h=(l==null?void 0:l.scale)??i,o=(l==null?void 0:l.effects)??[];for(let r=n.length;rs?Math.max(s,n-l):Math.min(s,n+l),this.computedVisible=this.computedOpacity>0;const h=s===this.computedOpacity;this.inFadeTransition=!h,h||this.requestRender()}}else this.computedOpacity=this.opacity,this.computedVisible=this.visible}onAttach(){}onDetach(){}doRender(t){}ready(){this._isReady||(this._isReady=!0,this.emit("isReady"),this.requestRender())}};const ft=1,Tt=[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],St=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],O=256,_={outlineWidth:1.3,outerHaloWidth:.4,innerHaloWidth:.4,outlinePosition:0},T=()=>V.getLogger("esri.views.2d.engine.webgl.painter.highlight.HighlightGradient");function pt(e,t){t.fillColor[0]=e.color.r/255,t.fillColor[1]=e.color.g/255,t.fillColor[2]=e.color.b/255,t.fillColor[3]=e.color.a,e.haloColor?(t.outlineColor[0]=e.haloColor.r/255,t.outlineColor[1]=e.haloColor.g/255,t.outlineColor[2]=e.haloColor.b/255,t.outlineColor[3]=e.haloColor.a):(t.outlineColor[0]=t.fillColor[0],t.outlineColor[1]=t.fillColor[1],t.outlineColor[2]=t.fillColor[2],t.outlineColor[3]=t.fillColor[3]),t.fillColor[3]*=e.fillOpacity,t.outlineColor[3]*=e.haloOpacity,t.fillColor[0]*=t.fillColor[3],t.fillColor[1]*=t.fillColor[3],t.fillColor[2]*=t.fillColor[3],t.outlineColor[0]*=t.outlineColor[3],t.outlineColor[1]*=t.outlineColor[3],t.outlineColor[2]*=t.outlineColor[3],t.outlineWidth=_.outlineWidth,t.outerHaloWidth=_.outerHaloWidth,t.innerHaloWidth=_.innerHaloWidth,t.outlinePosition=_.outlinePosition}const gt=[0,0,0,0];class B{constructor(){this.type="single",this._convertedHighlightOptions={fillColor:[.2*.75,.6*.75,.675,.75],outlineColor:[.2*.9,.54,.81,.9],outlinePosition:_.outlinePosition,outlineWidth:_.outlineWidth,innerHaloWidth:_.innerHaloWidth,outerHaloWidth:_.outerHaloWidth},this._shadeTexChanged=!0,this._texelData=new Uint8Array(4*O),this._minMaxDistance=[0,0]}setHighlightOptions(t){const i=this._convertedHighlightOptions;pt(t,i);const s=i.outlinePosition-i.outlineWidth/2-i.outerHaloWidth,n=i.outlinePosition-i.outlineWidth/2,l=i.outlinePosition+i.outlineWidth/2,h=i.outlinePosition+i.outlineWidth/2+i.innerHaloWidth,o=Math.sqrt(Math.PI/2)*ft,r=Math.abs(s)>o?Math.round(10*(Math.abs(s)-o))/10:0,c=Math.abs(h)>o?Math.round(10*(Math.abs(h)-o))/10:0;let u;r&&!c?T().error("The outer rim of the highlight is "+r+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards positive values (inwards)."):!r&&c?T().error("The inner rim of the highlight is "+c+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards negative values (outwards)."):r&&c&&T().error("The highlight is "+Math.max(r,c)+"px away from the edge of the feature; consider reducing some width values.");const a=[void 0,void 0,void 0,void 0];function y(d,I,p){a[0]=(1-p)*d[0]+p*I[0],a[1]=(1-p)*d[1]+p*I[1],a[2]=(1-p)*d[2]+p*I[2],a[3]=(1-p)*d[3]+p*I[3]}const{_texelData:v}=this;for(let d=0;de.stencilRef,compare:it.EQUAL,mask:255,op:{fail:M.KEEP,zFail:M.KEEP,zPass:M.REPLACE}}}},mt={color:{write:[!0,!0,!0,!0],blendMode:"additive"},depth:!1,stencil:!1},Rt={...K,color:{write:[!0,!0,!0,!0],blendMode:"delete"}};function yt({pixelRatio:e,state:t,displayLevel:i,requiredLevel:s},n){const l=1/2**(i-n.key.level),h=1/2**(s-n.key.level);return{displayMat3:Array.from(t.displayMat3),displayViewMat3:Array.from(t.displayViewMat3),displayViewScreenMat3:Array.from(n.transforms.displayViewScreenMat3),viewMat3:Array.from(t.viewMat3),tileMat3:Array.from(n.transforms.tileMat3),displayZoomFactor:l,requiredZoomFactor:h,tileOffset:[n.x,n.y],currentScale:t.scale,currentZoom:i,metersPerSRUnit:st(t.spatialReference),rotation:t.rotation,pixelRatio:e}}function X(e){var t;return((t=e.passOptions)==null?void 0:t.type)==="highlight"}function Y(e){var t;return((t=e.passOptions)==null?void 0:t.type)==="hittest"}function Ot(e){if(!Y(e))return null;const{position:t}=e.passOptions,i=e.pixelRatio,s=R("esri-mobile");return{position:t,distance:R(s?"hittest-2d-mobile-tolerance":"hittest-2d-desktop-tolerance")*i,smallSymbolDistance:R(s?"hittest-2d-mobile-tolerance":"hittest-2d-small-symbol-tolerance")*i,smallSymbolSizeThreshold:R("hittest-2d-small-symbol-tolerance-threshold")}}function Et(e){if(!X(e))return null;const{activeReasons:t,highlightAll:i}=e.passOptions;return{activeReasons:t,highlightAll:i?1:0}}function wt(e,t,i){const s={};for(const n in i)i[n]instanceof Function?s[n]=i[n](e,t):s[n]=i[n];return s}function Pt(e,t){const{attributeView:i,context:s}=e;return{storage:i.getUniforms(s),view:yt(e,t),hittestRequest:Ot(e),highlight:Et(e)}}function Ht(e){return{inside:e.selection===b.InsideEffect,outside:e.selection===b.OutsideEffect}}function vt(e){return Y(e)?mt:X(e)&&e.passOptions.stepType==="clear"?Rt:K}function Gt(e){const{row:t,col:i}=e.key,s=i*w,n=t*w;return{tileOffsetFromLocalOrigin:[s%C,n%C],maxIntsToLocalOrigin:[Math.floor(s/C),Math.floor(n/C)]}}new nt({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch",mesh:"mesh"});function xt(e){const{bandCount:t,attributeTable:i,colormap:s,pixelType:n}=e.raster.rasterInfo;return t===1&&(i!=null||s!=null||n==="u8"||n==="s8")}function It(e,t){return(e==null?void 0:e.type)==="single"&&t.multiHighlightEnabled&&(e.destroy(),e=null),(e==null?void 0:e.type)!=="multi"||t.multiHighlightEnabled||(e.destroy(),e=null),e||(e=t.multiHighlightEnabled?new _t:new B),e.setHighlightOptions(t),e}function Dt(e,t,i){const{painter:s,highlightGradient:n}=e,{highlight:l}=s.effects;if(!n)return;const h=e.passOptions,o=n.getReasonsWithGradients();for(let r=0;ri.clips=t)}get computedEffects(){var t;return((t=this._effectView)==null?void 0:t.effects)??null}get effect(){var t;return((t=this._effectView)==null?void 0:t.effect)??""}set effect(t){(this._effectView||t)&&(this._effectView||(this._effectView=new f),this._effectView.effect=t,this.requestRender())}get highlightOptions(){return this._highlightOptions}set highlightOptions(t){if(!t)return this._highlightOptions=null,void(this._highlightGradient&&(this._highlightGradient.destroy(),this._highlightGradient=null,this.requestRender()));this._highlightOptions&&this._highlightOptions.equals(t)||(this._highlightOptions=t,this._highlightGradient=It(this._highlightGradient,t),this.requestRender())}get hasBlending(){return!!this.blendMode}get hasHighlight(){return this.children.some(t=>t.hasHighlight)}get hasLabels(){return this.children.some(t=>t.hasLabels)}get requiresDedicatedFBO(){return this.children.some(t=>"blendMode"in t&&t.blendMode&&t.blendMode!=="normal")}updateTransitionProperties(t,i){super.updateTransitionProperties(t,i),this._effectView&&(this._effectView.transitionStep(t,i),this._effectView.transitioning&&this.requestRender())}doRender(t){var n;const i=this.createRenderParams(t),{painter:s}=i;s.beforeRenderLayer(i,(n=this._clips)!=null&&n.length?255:0,this.computedOpacity),this.renderChildren(i),s.afterRenderLayer(i,this.computedOpacity)}addChild(t){return this.addChildAt(t,this.children.length)}addChildAt(t,i=this.children.length){if(!t||this.contains(t))return t;this._needsSort=!0;const s=t.parent;return s&&s!==this&&s.removeChild(t),i>=this.children.length?this.children.push(t):this.children.splice(i,0,t),this._childrenSet.add(t),t.parent=this,t.stage=this.stage,this!==this.stage&&(t.clips=this.clips),this.requestRender(),t}contains(t){return this._childrenSet.has(t)}endTransitions(){super.endTransitions(),this._effectView&&(this._effectView.endTransitions(),this.requestRender())}removeAllChildren(){this._childrenSet.clear(),this._needsSort=!0;for(const t of this.children)this!==this.stage&&(t.clips=null),t.stage=null,t.parent=null;this.children.length=0}removeChild(t){return this.contains(t)?this.removeChildAt(this.children.indexOf(t)):t}removeChildAt(t){if(t<0||t>=this.children.length)return null;this._needsSort=!0;const i=this.children.splice(t,1)[0];return this._childrenSet.delete(i),this!==this.stage&&(i.clips=null),i.stage=null,i.parent=null,i}sortChildren(t){this._needsSort&&(this.children.sort(t),this._needsSort=!1)}beforeRender(t){super.beforeRender(t);for(const i of this.children)i.beforeRender(t)}afterRender(t){super.afterRender(t);for(const i of this.children)i.afterRender(t)}_createTransforms(){return{displayViewScreenMat3:rt()}}onAttach(){super.onAttach();const t=this.stage;for(const i of this.children)i.stage=t}onDetach(){super.onDetach();for(const t of this.children)t.stage=null}renderChildren(t){for(const i of this.children)i.processRender(t)}createRenderParams(t){return{...t,requireFBO:this.requiresDedicatedFBO,blendMode:this.blendMode,effects:this.computedEffects,globalOpacity:t.globalOpacity*this.computedOpacity,inFadeTransition:this.inFadeTransition,highlightGradient:this._highlightGradient||t.highlightGradient}}}export{F as A,D as E,$ as L,vt as M,q as N,b as R,U as S,Dt as a,f as b,Pt as c,yt as d,wt as e,X as f,St as g,$t as h,ut as i,Y as m,ft as o,xt as r,Tt as t,Gt as w,Ht as y}; diff --git a/assets/DefaultMaterial_COLOR_GAMMA-CWI-ZW7Q.js b/assets/DefaultMaterial_COLOR_GAMMA-BQtlD4-o.js similarity index 98% rename from assets/DefaultMaterial_COLOR_GAMMA-CWI-ZW7Q.js rename to assets/DefaultMaterial_COLOR_GAMMA-BQtlD4-o.js index 00f8178..bf49cbd 100644 --- a/assets/DefaultMaterial_COLOR_GAMMA-CWI-ZW7Q.js +++ b/assets/DefaultMaterial_COLOR_GAMMA-BQtlD4-o.js @@ -1 +1 @@ -import{b as Y}from"./vec3-CjYmIfaa.js";import{cg as ie,k7 as ue,k8 as le,k9 as fe,jc as X,at as ce,ka as Q,M as de,as as pe,ay as me,N as f,D as P,L as G,bm as he,kb as ye,g5 as c,J as we,Z as Te,hL as ge,kc as _e,kd as be,hI as xe,cP as Se,ke as H,s as j,g3 as O,kf as Ee}from"./index-CEWggaxV.js";import{e as W,r as k}from"./mat4f64-CSKppSlJ.js";import{r as Z}from"./Version-Bd0QsIQ5.js";import{v as Oe}from"./quat-CoKEr4Zu.js";import{e as Ae}from"./quatf64-Bdb9ZJJK.js";import{B as Re,g as Ne,d as ve,i as V,c as z,u as ee,x as Ie,L as Me,O as Ce,E as Be,F as Le,w as $e,q as Fe,A as Ue,V as De}from"./BufferView-Ao_K-5Vg.js";import{n as Pe,t as Ge,o as je,r as Ve}from"./resourceUtils-BqKyAr0B.js";import{l as ke,i as He}from"./Indices-Dv-cCjFT.js";function ze(o,e,r){if(o.count!==e.count)return void Y().error("source and destination buffers need to have the same number of elements");const t=o.count,n=r[0],s=r[1],a=r[2],i=r[3],u=r[4],l=r[5],m=r[6],h=r[7],w=r[8],p=r[9],T=r[10],d=r[11],y=r[12],x=r[13],g=r[14],b=r[15],_=o.typedBuffer,A=o.typedBufferStride,S=e.typedBuffer,M=e.typedBufferStride;for(let R=0;R0){const T=1/Math.sqrt(p);t[u]=T*m,t[u+1]=T*h,t[u+2]=T*w}}}function Je(o,e,r){re(o.typedBuffer,e,r,o.typedBufferStride)}function re(o,e,r,t=4){const n=Math.min(o.length/t,e.count),s=e.typedBuffer,a=e.typedBufferStride;let i=0,u=0;for(let l=0;l{const e={...ae,...o.pbrMetallicRoughness},r=at({...st,...o.extras});return{...nt,...o,pbrMetallicRoughness:e,extras:r}};function at(o){switch(o.ESRI_externalColorMixMode){case"multiply":case"tint":case"ignore":case"replace":break;default:he(o.ESRI_externalColorMixMode),o.ESRI_externalColorMixMode="tint"}return o}const it={magFilter:G.LINEAR,minFilter:G.LINEAR_MIPMAP_LINEAR,wrapS:P.REPEAT,wrapT:P.REPEAT},ut=o=>({...it,...o});function lt(o){let e,r;return o.replace(/^(.*\/)?([^/]*)$/,(t,n,s)=>(e=n||"",r=s||"","")),{dirPart:e,filePart:r}}const F={MAGIC:1179937895,CHUNK_TYPE_JSON:1313821514,CHUNK_TYPE_BIN:5130562,MIN_HEADER_LENGTH:20};class E{constructor(e,r,t,n){if(this._context=e,this.uri=r,this.json=t,this._glbBuffer=n,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._supportedExtensions=["KHR_texture_basisu","KHR_texture_transform"],this._baseUri=lt(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),t.scenes==null)throw new f("gltf-loader-unsupported-feature","Scenes must be defined.");if(t.meshes==null)throw new f("gltf-loader-unsupported-feature","Meshes must be defined");if(t.nodes==null)throw new f("gltf-loader-unsupported-feature","Nodes must be defined.");this._computeNodeParents()}static async load(e,r,t){if(X(r)){const a=we(r);if(a&&a.mediaType!=="model/gltf-binary")try{const u=JSON.parse(a.isBase64?atob(a.data):a.data);return new E(e,r,u)}catch{}const i=Q(r);if(E._isGLBData(i))return this._fromGLBData(e,r,i)}if(ht.test(r)||(t==null?void 0:t.expectedType)==="gltf"){const a=await e.loadJSON(r,t);return new E(e,r,a)}const n=await e.loadBinary(r,t);if(E._isGLBData(n))return this._fromGLBData(e,r,n);if(yt.test(r)||(t==null?void 0:t.expectedType)==="glb")throw new f("gltf-loader-invalid-glb","This is not a valid glb file.");const s=await e.loadJSON(r,t);return new E(e,r,s)}static _isGLBData(e){if(e==null)return!1;const r=new q(e);return r.remainingBytes()>=4&&r.readUint32()===F.MAGIC}static async _fromGLBData(e,r,t){const n=await E._parseGLBData(t);return new E(e,r,n.json,n.binaryData)}static async _parseGLBData(e){const r=new q(e);if(r.remainingBytes()<12)throw new f("gltf-loader-error","glb binary data is insufficiently large.");const t=r.readUint32(),n=r.readUint32(),s=r.readUint32();if(t!==F.MAGIC)throw new f("gltf-loader-error","Magic first 4 bytes do not fit to expected glb value.");if(e.byteLength=8;){const l=r.readUint32(),m=r.readUint32();if(u===0){if(m!==F.CHUNK_TYPE_JSON)throw new f("gltf-loader-error","First glb chunk must be JSON.");if(l<0)throw new f("gltf-loader-error","No JSON data found.");a=await Pe(r.readUint8Array(l))}else if(u===1){if(m!==F.CHUNK_TYPE_BIN)throw new f("gltf-loader-unsupported-feature","Second glb chunk expected to be BIN.");i=r.readUint8Array(l)}else j.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] More than 2 glb chunks detected. Skipping.");u+=1}if(!a)throw new f("gltf-loader-error","No glb JSON chunk detected.");return{json:a,binaryData:i}}async getBuffer(e,r){const t=this.json.buffers[e];if(t.uri==null){if(this._glbBuffer==null)throw new f("gltf-loader-error","glb buffer not present");return this._glbBuffer}const n=await this._getBufferLoader(e,r);if(n.byteLength!==t.byteLength)throw new f("gltf-loader-error","Buffer byte lengths should match.");return n}async _getBufferLoader(e,r){const t=this._bufferLoaders.get(e);if(t)return t;const n=this.json.buffers[e].uri,s=this._context.loadBinary(this._resolveUri(n),r).then(a=>new Uint8Array(a));return this._bufferLoaders.set(e,s),s}async getAccessor(e,r){if(!this.json.accessors)throw new f("gltf-loader-unsupported-feature","Accessors missing.");const t=this.json.accessors[e];if((t==null?void 0:t.bufferView)==null)throw new f("gltf-loader-unsupported-feature","Some accessor does not specify a bufferView.");if(t.type in[L.MAT2,L.MAT3,L.MAT4])throw new f("gltf-loader-unsupported-feature",`AttributeType ${t.type} is not supported`);const n=this.json.bufferViews[t.bufferView],s=await this.getBuffer(n.buffer,r),a=dt[t.type],i=pt[t.componentType],u=a*i,l=n.byteStride||u;return{raw:s.buffer,byteStride:l,byteOffset:s.byteOffset+(n.byteOffset||0)+(t.byteOffset||0),entryCount:t.count,isDenselyPacked:l===u,componentCount:a,componentByteSize:i,componentType:t.componentType,min:t.min,max:t.max,normalized:!!t.normalized}}async getIndexData(e,r){if(e.indices==null)return;const t=await this.getAccessor(e.indices,r);if(t.isDenselyPacked)switch(t.componentType){case c.UNSIGNED_BYTE:return new Uint8Array(t.raw,t.byteOffset,t.entryCount);case c.UNSIGNED_SHORT:return new Uint16Array(t.raw,t.byteOffset,t.entryCount);case c.UNSIGNED_INT:return new Uint32Array(t.raw,t.byteOffset,t.entryCount)}else switch(t.componentType){case c.UNSIGNED_BYTE:return D(this._wrapAccessor(ve,t));case c.UNSIGNED_SHORT:return D(this._wrapAccessor(Ne,t));case c.UNSIGNED_INT:return D(this._wrapAccessor(Re,t))}}async getPositionData(e,r){if(e.attributes.POSITION==null)throw new f("gltf-loader-unsupported-feature","No POSITION vertex data found.");const t=await this.getAccessor(e.attributes.POSITION,r);if(t.componentType!==c.FLOAT)throw new f("gltf-loader-unsupported-feature","Expected type FLOAT for POSITION vertex attribute, but found "+c[t.componentType]);if(t.componentCount!==3)throw new f("gltf-loader-unsupported-feature","POSITION vertex attribute must have 3 components, but found "+t.componentCount.toFixed());return this._wrapAccessor(V,t)}async getNormalData(e,r){if(e.attributes.NORMAL==null)throw new f("gltf-loader-error","No NORMAL vertex data found.");const t=await this.getAccessor(e.attributes.NORMAL,r);if(t.componentType!==c.FLOAT)throw new f("gltf-loader-unsupported-feature","Expected type FLOAT for NORMAL vertex attribute, but found "+c[t.componentType]);if(t.componentCount!==3)throw new f("gltf-loader-unsupported-feature","NORMAL vertex attribute must have 3 components, but found "+t.componentCount.toFixed());return this._wrapAccessor(V,t)}async getTangentData(e,r){if(e.attributes.TANGENT==null)throw new f("gltf-loader-error","No TANGENT vertex data found.");const t=await this.getAccessor(e.attributes.TANGENT,r);if(t.componentType!==c.FLOAT)throw new f("gltf-loader-unsupported-feature","Expected type FLOAT for TANGENT vertex attribute, but found "+c[t.componentType]);if(t.componentCount!==4)throw new f("gltf-loader-unsupported-feature","TANGENT vertex attribute must have 4 components, but found "+t.componentCount.toFixed());return new z(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*t.entryCount)}async getTextureCoordinates(e,r){if(e.attributes.TEXCOORD_0==null)throw new f("gltf-loader-error","No TEXCOORD_0 vertex data found.");const t=await this.getAccessor(e.attributes.TEXCOORD_0,r);if(t.componentCount!==2)throw new f("gltf-loader-unsupported-feature","TEXCOORD_0 vertex attribute must have 2 components, but found "+t.componentCount.toFixed());if(t.componentType===c.FLOAT)return this._wrapAccessor(ee,t);if(!t.normalized)throw new f("gltf-loader-unsupported-feature","Integer component types are only supported for a normalized accessor for TEXCOORD_0.");return mt(t)}async getVertexColors(e,r){if(e.attributes.COLOR_0==null)throw new f("gltf-loader-error","No COLOR_0 vertex data found.");const t=await this.getAccessor(e.attributes.COLOR_0,r);if(t.componentCount!==4&&t.componentCount!==3)throw new f("gltf-loader-unsupported-feature","COLOR_0 attribute must have 3 or 4 components, but found "+t.componentCount.toFixed());if(t.componentCount===4){if(t.componentType===c.FLOAT)return this._wrapAccessor(z,t);if(t.componentType===c.UNSIGNED_BYTE)return this._wrapAccessor(Ie,t);if(t.componentType===c.UNSIGNED_SHORT)return this._wrapAccessor(Me,t)}else if(t.componentCount===3){if(t.componentType===c.FLOAT)return this._wrapAccessor(V,t);if(t.componentType===c.UNSIGNED_BYTE)return this._wrapAccessor(Ce,t);if(t.componentType===c.UNSIGNED_SHORT)return this._wrapAccessor(Be,t)}throw new f("gltf-loader-unsupported-feature","Unsupported component type for COLOR_0 attribute: "+c[t.componentType])}hasPositions(e){return e.attributes.POSITION!==void 0}hasNormals(e){return e.attributes.NORMAL!==void 0}hasVertexColors(e){return e.attributes.COLOR_0!==void 0}hasTextureCoordinates(e){return e.attributes.TEXCOORD_0!==void 0}hasTangents(e){return e.attributes.TANGENT!==void 0}async getMaterial(e,r,t){var s,a,i,u,l,m,h,w,p,T;let n=e.material?this._materialCache.get(e.material):void 0;if(!n){const d=e.material!=null?J(this.json.materials[e.material]):J(),y=d.pbrMetallicRoughness,x=this.hasVertexColors(e),g=this.getTexture(y.baseColorTexture,r),b=this.getTexture(d.normalTexture,r),_=t?this.getTexture(d.occlusionTexture,r):void 0,A=t?this.getTexture(d.emissiveTexture,r):void 0,S=t?this.getTexture(y.metallicRoughnessTexture,r):void 0,M=e.material!=null?e.material:-1;n={alphaMode:d.alphaMode,alphaCutoff:d.alphaCutoff,color:y.baseColorFactor,doubleSided:!!d.doubleSided,colorTexture:await g,normalTexture:await b,name:d.name,id:M,occlusionTexture:await _,emissiveTexture:await A,emissiveFactor:d.emissiveFactor,metallicFactor:y.metallicFactor,roughnessFactor:y.roughnessFactor,metallicRoughnessTexture:await S,hasVertexColors:x,ESRI_externalColorMixMode:d.extras.ESRI_externalColorMixMode,colorTextureTransform:(a=(s=y==null?void 0:y.baseColorTexture)==null?void 0:s.extensions)==null?void 0:a.KHR_texture_transform,normalTextureTransform:(u=(i=d.normalTexture)==null?void 0:i.extensions)==null?void 0:u.KHR_texture_transform,occlusionTextureTransform:(m=(l=d.occlusionTexture)==null?void 0:l.extensions)==null?void 0:m.KHR_texture_transform,emissiveTextureTransform:(w=(h=d.emissiveTexture)==null?void 0:h.extensions)==null?void 0:w.KHR_texture_transform,metallicRoughnessTextureTransform:(T=(p=y==null?void 0:y.metallicRoughnessTexture)==null?void 0:p.extensions)==null?void 0:T.KHR_texture_transform,receiveAmbientOcclusion:d.extras.ESRI_receiveAmbientOcclusion,receiveShadows:d.extras.ESRI_receiveShadows}}return n}async getTexture(e,r){if(!e)return;if((e.texCoord||0)!==0)throw new f("gltf-loader-unsupported-feature","Only TEXCOORD with index 0 is supported.");const t=e.index,n=this.json.textures[t],s=ut(n.sampler!=null?this.json.samplers[n.sampler]:{}),a=this._getTextureSourceId(n),i=this.json.images[a],u=await this._loadTextureImageData(t,n,r);return Te(this._textureCache,t,()=>{const l=h=>h===33071||h===33648||h===10497,m=h=>{throw new f("gltf-loader-error",`Unexpected TextureSampler WrapMode: ${h}`)};return{data:u,wrapS:l(s.wrapS)?s.wrapS:m(s.wrapS),wrapT:l(s.wrapT)?s.wrapT:m(s.wrapT),minFilter:s.minFilter,name:i.name,id:t}})}getNodeTransform(e){if(e===void 0)return ft;let r=this._nodeTransformCache.get(e);if(!r){const t=this.getNodeTransform(this._getNodeParent(e)),n=this.json.nodes[e];n.matrix?r=ge(W(),t,n.matrix):n.translation||n.rotation||n.scale?(r=k(t),n.translation&&_e(r,r,n.translation),n.rotation&&(U[3]=Oe(U,n.rotation),be(r,r,U[3],U)),n.scale&&xe(r,r,n.scale)):r=k(t),this._nodeTransformCache.set(e,r)}return r}_wrapAccessor(e,r){return new e(r.raw,r.byteOffset,r.byteStride,r.byteOffset+r.byteStride*(r.entryCount-1)+r.componentByteSize*r.componentCount)}_resolveUri(e){return Se(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=Z.parse(this.json.asset.version,"glTF");ct.validate(e)}_checkRequiredExtensionsSupported(){const e=this.json;if(e.extensionsRequired&&!e.extensionsRequired.every(r=>this._supportedExtensions.includes(r)))throw new f("gltf-loader-unsupported-feature","gltf loader was not able to load unsupported feature. Required extensions: "+e.extensionsRequired.join(", "))}_computeNodeParents(){this.json.nodes.forEach((e,r)=>{e.children&&e.children.forEach(t=>{this._nodeParentMap.set(t,r)})})}async _loadTextureImageData(e,r,t){const n=this._textureLoaders.get(e);if(n)return n;const s=this._createTextureLoader(r,t);return this._textureLoaders.set(e,s),s}_getTextureSourceId(e){if(e.extensions!==void 0&&e.extensions.KHR_texture_basisu!==null)return e.extensions.KHR_texture_basisu.source;if(e.source!==null)return e.source;throw new f("gltf-loader-unsupported-feature","Source is expected to be defined for a texture. It can also be omitted in favour of an KHR_texture_basisu extension tag.")}async _createTextureLoader(e,r){const t=this._getTextureSourceId(e),n=this.json.images[t];if(n.uri){if(n.uri.endsWith(".ktx2")){const u=await this._context.loadBinary(this._resolveUri(n.uri),r);return new Ge(new Uint8Array(u))}return this._context.loadImage(this._resolveUri(n.uri),r)}if(n.bufferView==null)throw new f("gltf-loader-unsupported-feature","Image bufferView must be defined.");if(n.mimeType==null)throw new f("gltf-loader-unsupported-feature","Image mimeType must be defined.");const s=this.json.bufferViews[n.bufferView],a=await this.getBuffer(s.buffer,r);if(s.byteStride!=null)throw new f("gltf-loader-unsupported-feature","byteStride not supported for image buffer");const i=a.byteOffset+(s.byteOffset||0);return je(new Uint8Array(a.buffer,i,s.byteLength),n.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;const e=await H(Array.from(this._bufferLoaders.values())),r=await H(Array.from(this._textureLoaders.values()));return e.reduce((t,n)=>t+((n==null?void 0:n.byteLength)??0),0)+r.reduce((t,n)=>t+(n?Ve(n)?n.data.byteLength:n.width*n.height*4:0),0)}}const ft=ye(W(),Math.PI/2),ct=new Z(2,0,"glTF"),U=Ae(),dt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},pt={[c.BYTE]:1,[c.UNSIGNED_BYTE]:1,[c.SHORT]:2,[c.UNSIGNED_SHORT]:2,[c.FLOAT]:4,[c.INT]:4,[c.UNSIGNED_INT]:4};function mt(o){switch(o.componentType){case c.BYTE:return new De(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case c.UNSIGNED_BYTE:return new Ue(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case c.SHORT:return new Fe(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case c.UNSIGNED_SHORT:return new $e(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case c.UNSIGNED_INT:return new Le(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case c.FLOAT:return new ee(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount)}}const ht=/\.gltf$/i,yt=/\.glb$/i;let wt=0;async function Dt(o,e,r={},t=!0){var h,w;const n=await E.load(o,e,r),s="gltf_"+wt++,a={lods:[],materials:new Map,textures:new Map,meta:Tt(n)},i=!(!n.json.asset.extras||n.json.asset.extras.ESRI_type!=="symbolResource"),u=(w=(h=n.json.asset.extras)==null?void 0:h.ESRI_webstyleSymbol)==null?void 0:w.webstyle,l=new Map;await gt(n,async(p,T,d,y)=>{var I;const x=l.get(d)??0;l.set(d,x+1);const g=p.mode!==void 0?p.mode:O.TRIANGLES,b=g===O.TRIANGLES||g===O.TRIANGLE_STRIP||g===O.TRIANGLE_FAN?g:null;if(b==null)return void j.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Unsupported primitive mode ("+O[g]+"). Skipping primitive.");if(!n.hasPositions(p))return void j.getLogger("esri.views.3d.glTF").warn("Skipping primitive without POSITION vertex attribute.");const _=n.getPositionData(p,r),A=n.getMaterial(p,r,t),S=n.hasNormals(p)?n.getNormalData(p,r):null,M=n.hasTangents(p)?n.getTangentData(p,r):null,R=n.hasTextureCoordinates(p)?n.getTextureCoordinates(p,r):null,N=n.hasVertexColors(p)?n.getVertexColors(p,r):null,C=n.getIndexData(p,r),B={name:y,transform:k(T),attributes:{position:await _,normal:S?await S:null,texCoord0:R?await R:null,color:N?await N:null,tangent:M?await M:null},indices:await C,primitiveType:b,material:bt(a,await A,s)};let v=null;((I=a.meta)==null?void 0:I.ESRI_lod)!=null&&a.meta.ESRI_lod.metric==="screenSpaceRadius"&&(v=a.meta.ESRI_lod.thresholds[d]),a.lods[d]=a.lods[d]||{parts:[],name:y,lodThreshold:v},a.lods[d].parts[x]=B});for(const p of a.lods)p.parts=p.parts.filter(T=>!!T);const m=await n.getLoadedBuffersSize();return{model:a,meta:{isEsriSymbolResource:i,uri:n.uri,ESRI_webstyle:u},customMeta:{},size:m}}function Tt(o){const e=o.json;let r=null;return e.nodes.forEach(t=>{const n=t.extras;n!=null&&(n.ESRI_proxyEllipsoid||n.ESRI_lod)&&(r=n)}),r}async function gt(o,e){const r=o.json,t=r.scenes[r.scene||0].nodes,n=t.length>1,s=[];for(const i of t){const u=r.nodes[i];s.push(a(i,0)),_t(u)&&!n&&u.extensions.MSFT_lod.ids.forEach((l,m)=>a(l,m+1))}async function a(i,u){const l=r.nodes[i],m=o.getNodeTransform(i);if(l.weights!=null&&j.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Morph targets are not supported."),l.mesh!=null){const h=r.meshes[l.mesh];for(const w of h.primitives)s.push(e(w,m,u,h.name))}for(const h of l.children||[])s.push(a(h,u))}await Promise.all(s)}function _t(o){var e;return((e=o.extensions)==null?void 0:e.MSFT_lod)&&Array.isArray(o.extensions.MSFT_lod.ids)}function bt(o,e,r){const t=s=>{const a=`${r}_tex_${s&&s.id}${s!=null&&s.name?"_"+s.name:""}`;if(s&&!o.textures.has(a)){const i=ot(s.data,{wrap:{s:s.wrapS,t:s.wrapT},mipmap:xt.has(s.minFilter),noUnpackFlip:!0});o.textures.set(a,i)}return a},n=`${r}_mat_${e.id}_${e.name}`;if(!o.materials.has(n)){const s=rt({color:[e.color[0],e.color[1],e.color[2]],opacity:e.color[3],alphaMode:e.alphaMode,alphaCutoff:e.alphaCutoff,doubleSided:e.doubleSided,colorMixMode:e.ESRI_externalColorMixMode,textureColor:e.colorTexture?t(e.colorTexture):void 0,textureNormal:e.normalTexture?t(e.normalTexture):void 0,textureOcclusion:e.occlusionTexture?t(e.occlusionTexture):void 0,textureEmissive:e.emissiveTexture?t(e.emissiveTexture):void 0,textureMetallicRoughness:e.metallicRoughnessTexture?t(e.metallicRoughnessTexture):void 0,emissiveFactor:[e.emissiveFactor[0],e.emissiveFactor[1],e.emissiveFactor[2]],colorTextureTransform:e.colorTextureTransform,normalTextureTransform:e.normalTextureTransform,occlusionTextureTransform:e.occlusionTextureTransform,emissiveTextureTransform:e.emissiveTextureTransform,metallicRoughnessTextureTransform:e.metallicRoughnessTextureTransform,metallicFactor:e.metallicFactor,roughnessFactor:e.roughnessFactor,receiveShadows:e.receiveShadows,receiveAmbientOcclustion:e.receiveAmbientOcclusion});o.materials.set(n,s)}return n}const xt=new Set([G.LINEAR_MIPMAP_LINEAR,G.LINEAR_MIPMAP_NEAREST]);function Pt(o,e){switch(e){case O.TRIANGLES:return St(o);case O.TRIANGLE_STRIP:return Et(o);case O.TRIANGLE_FAN:return Ot(o)}}function St(o){return typeof o=="number"?ke(o):Ee(o)?new Uint16Array(o):o}function Et(o){const e=typeof o=="number"?o:o.length;if(e<3)return[];const r=e-2,t=He(3*r);if(typeof o=="number"){let n=0;for(let s=0;s0){const T=1/Math.sqrt(p);t[u]=T*m,t[u+1]=T*h,t[u+2]=T*w}}}function Je(o,e,r){re(o.typedBuffer,e,r,o.typedBufferStride)}function re(o,e,r,t=4){const n=Math.min(o.length/t,e.count),s=e.typedBuffer,a=e.typedBufferStride;let i=0,u=0;for(let l=0;l{const e={...ae,...o.pbrMetallicRoughness},r=at({...st,...o.extras});return{...nt,...o,pbrMetallicRoughness:e,extras:r}};function at(o){switch(o.ESRI_externalColorMixMode){case"multiply":case"tint":case"ignore":case"replace":break;default:he(o.ESRI_externalColorMixMode),o.ESRI_externalColorMixMode="tint"}return o}const it={magFilter:G.LINEAR,minFilter:G.LINEAR_MIPMAP_LINEAR,wrapS:P.REPEAT,wrapT:P.REPEAT},ut=o=>({...it,...o});function lt(o){let e,r;return o.replace(/^(.*\/)?([^/]*)$/,(t,n,s)=>(e=n||"",r=s||"","")),{dirPart:e,filePart:r}}const F={MAGIC:1179937895,CHUNK_TYPE_JSON:1313821514,CHUNK_TYPE_BIN:5130562,MIN_HEADER_LENGTH:20};class E{constructor(e,r,t,n){if(this._context=e,this.uri=r,this.json=t,this._glbBuffer=n,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._supportedExtensions=["KHR_texture_basisu","KHR_texture_transform"],this._baseUri=lt(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),t.scenes==null)throw new f("gltf-loader-unsupported-feature","Scenes must be defined.");if(t.meshes==null)throw new f("gltf-loader-unsupported-feature","Meshes must be defined");if(t.nodes==null)throw new f("gltf-loader-unsupported-feature","Nodes must be defined.");this._computeNodeParents()}static async load(e,r,t){if(X(r)){const a=we(r);if(a&&a.mediaType!=="model/gltf-binary")try{const u=JSON.parse(a.isBase64?atob(a.data):a.data);return new E(e,r,u)}catch{}const i=Q(r);if(E._isGLBData(i))return this._fromGLBData(e,r,i)}if(ht.test(r)||(t==null?void 0:t.expectedType)==="gltf"){const a=await e.loadJSON(r,t);return new E(e,r,a)}const n=await e.loadBinary(r,t);if(E._isGLBData(n))return this._fromGLBData(e,r,n);if(yt.test(r)||(t==null?void 0:t.expectedType)==="glb")throw new f("gltf-loader-invalid-glb","This is not a valid glb file.");const s=await e.loadJSON(r,t);return new E(e,r,s)}static _isGLBData(e){if(e==null)return!1;const r=new q(e);return r.remainingBytes()>=4&&r.readUint32()===F.MAGIC}static async _fromGLBData(e,r,t){const n=await E._parseGLBData(t);return new E(e,r,n.json,n.binaryData)}static async _parseGLBData(e){const r=new q(e);if(r.remainingBytes()<12)throw new f("gltf-loader-error","glb binary data is insufficiently large.");const t=r.readUint32(),n=r.readUint32(),s=r.readUint32();if(t!==F.MAGIC)throw new f("gltf-loader-error","Magic first 4 bytes do not fit to expected glb value.");if(e.byteLength=8;){const l=r.readUint32(),m=r.readUint32();if(u===0){if(m!==F.CHUNK_TYPE_JSON)throw new f("gltf-loader-error","First glb chunk must be JSON.");if(l<0)throw new f("gltf-loader-error","No JSON data found.");a=await Pe(r.readUint8Array(l))}else if(u===1){if(m!==F.CHUNK_TYPE_BIN)throw new f("gltf-loader-unsupported-feature","Second glb chunk expected to be BIN.");i=r.readUint8Array(l)}else j.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] More than 2 glb chunks detected. Skipping.");u+=1}if(!a)throw new f("gltf-loader-error","No glb JSON chunk detected.");return{json:a,binaryData:i}}async getBuffer(e,r){const t=this.json.buffers[e];if(t.uri==null){if(this._glbBuffer==null)throw new f("gltf-loader-error","glb buffer not present");return this._glbBuffer}const n=await this._getBufferLoader(e,r);if(n.byteLength!==t.byteLength)throw new f("gltf-loader-error","Buffer byte lengths should match.");return n}async _getBufferLoader(e,r){const t=this._bufferLoaders.get(e);if(t)return t;const n=this.json.buffers[e].uri,s=this._context.loadBinary(this._resolveUri(n),r).then(a=>new Uint8Array(a));return this._bufferLoaders.set(e,s),s}async getAccessor(e,r){if(!this.json.accessors)throw new f("gltf-loader-unsupported-feature","Accessors missing.");const t=this.json.accessors[e];if((t==null?void 0:t.bufferView)==null)throw new f("gltf-loader-unsupported-feature","Some accessor does not specify a bufferView.");if(t.type in[L.MAT2,L.MAT3,L.MAT4])throw new f("gltf-loader-unsupported-feature",`AttributeType ${t.type} is not supported`);const n=this.json.bufferViews[t.bufferView],s=await this.getBuffer(n.buffer,r),a=dt[t.type],i=pt[t.componentType],u=a*i,l=n.byteStride||u;return{raw:s.buffer,byteStride:l,byteOffset:s.byteOffset+(n.byteOffset||0)+(t.byteOffset||0),entryCount:t.count,isDenselyPacked:l===u,componentCount:a,componentByteSize:i,componentType:t.componentType,min:t.min,max:t.max,normalized:!!t.normalized}}async getIndexData(e,r){if(e.indices==null)return;const t=await this.getAccessor(e.indices,r);if(t.isDenselyPacked)switch(t.componentType){case c.UNSIGNED_BYTE:return new Uint8Array(t.raw,t.byteOffset,t.entryCount);case c.UNSIGNED_SHORT:return new Uint16Array(t.raw,t.byteOffset,t.entryCount);case c.UNSIGNED_INT:return new Uint32Array(t.raw,t.byteOffset,t.entryCount)}else switch(t.componentType){case c.UNSIGNED_BYTE:return D(this._wrapAccessor(ve,t));case c.UNSIGNED_SHORT:return D(this._wrapAccessor(Ne,t));case c.UNSIGNED_INT:return D(this._wrapAccessor(Re,t))}}async getPositionData(e,r){if(e.attributes.POSITION==null)throw new f("gltf-loader-unsupported-feature","No POSITION vertex data found.");const t=await this.getAccessor(e.attributes.POSITION,r);if(t.componentType!==c.FLOAT)throw new f("gltf-loader-unsupported-feature","Expected type FLOAT for POSITION vertex attribute, but found "+c[t.componentType]);if(t.componentCount!==3)throw new f("gltf-loader-unsupported-feature","POSITION vertex attribute must have 3 components, but found "+t.componentCount.toFixed());return this._wrapAccessor(V,t)}async getNormalData(e,r){if(e.attributes.NORMAL==null)throw new f("gltf-loader-error","No NORMAL vertex data found.");const t=await this.getAccessor(e.attributes.NORMAL,r);if(t.componentType!==c.FLOAT)throw new f("gltf-loader-unsupported-feature","Expected type FLOAT for NORMAL vertex attribute, but found "+c[t.componentType]);if(t.componentCount!==3)throw new f("gltf-loader-unsupported-feature","NORMAL vertex attribute must have 3 components, but found "+t.componentCount.toFixed());return this._wrapAccessor(V,t)}async getTangentData(e,r){if(e.attributes.TANGENT==null)throw new f("gltf-loader-error","No TANGENT vertex data found.");const t=await this.getAccessor(e.attributes.TANGENT,r);if(t.componentType!==c.FLOAT)throw new f("gltf-loader-unsupported-feature","Expected type FLOAT for TANGENT vertex attribute, but found "+c[t.componentType]);if(t.componentCount!==4)throw new f("gltf-loader-unsupported-feature","TANGENT vertex attribute must have 4 components, but found "+t.componentCount.toFixed());return new z(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*t.entryCount)}async getTextureCoordinates(e,r){if(e.attributes.TEXCOORD_0==null)throw new f("gltf-loader-error","No TEXCOORD_0 vertex data found.");const t=await this.getAccessor(e.attributes.TEXCOORD_0,r);if(t.componentCount!==2)throw new f("gltf-loader-unsupported-feature","TEXCOORD_0 vertex attribute must have 2 components, but found "+t.componentCount.toFixed());if(t.componentType===c.FLOAT)return this._wrapAccessor(ee,t);if(!t.normalized)throw new f("gltf-loader-unsupported-feature","Integer component types are only supported for a normalized accessor for TEXCOORD_0.");return mt(t)}async getVertexColors(e,r){if(e.attributes.COLOR_0==null)throw new f("gltf-loader-error","No COLOR_0 vertex data found.");const t=await this.getAccessor(e.attributes.COLOR_0,r);if(t.componentCount!==4&&t.componentCount!==3)throw new f("gltf-loader-unsupported-feature","COLOR_0 attribute must have 3 or 4 components, but found "+t.componentCount.toFixed());if(t.componentCount===4){if(t.componentType===c.FLOAT)return this._wrapAccessor(z,t);if(t.componentType===c.UNSIGNED_BYTE)return this._wrapAccessor(Ie,t);if(t.componentType===c.UNSIGNED_SHORT)return this._wrapAccessor(Me,t)}else if(t.componentCount===3){if(t.componentType===c.FLOAT)return this._wrapAccessor(V,t);if(t.componentType===c.UNSIGNED_BYTE)return this._wrapAccessor(Ce,t);if(t.componentType===c.UNSIGNED_SHORT)return this._wrapAccessor(Be,t)}throw new f("gltf-loader-unsupported-feature","Unsupported component type for COLOR_0 attribute: "+c[t.componentType])}hasPositions(e){return e.attributes.POSITION!==void 0}hasNormals(e){return e.attributes.NORMAL!==void 0}hasVertexColors(e){return e.attributes.COLOR_0!==void 0}hasTextureCoordinates(e){return e.attributes.TEXCOORD_0!==void 0}hasTangents(e){return e.attributes.TANGENT!==void 0}async getMaterial(e,r,t){var s,a,i,u,l,m,h,w,p,T;let n=e.material?this._materialCache.get(e.material):void 0;if(!n){const d=e.material!=null?J(this.json.materials[e.material]):J(),y=d.pbrMetallicRoughness,x=this.hasVertexColors(e),g=this.getTexture(y.baseColorTexture,r),b=this.getTexture(d.normalTexture,r),_=t?this.getTexture(d.occlusionTexture,r):void 0,A=t?this.getTexture(d.emissiveTexture,r):void 0,S=t?this.getTexture(y.metallicRoughnessTexture,r):void 0,M=e.material!=null?e.material:-1;n={alphaMode:d.alphaMode,alphaCutoff:d.alphaCutoff,color:y.baseColorFactor,doubleSided:!!d.doubleSided,colorTexture:await g,normalTexture:await b,name:d.name,id:M,occlusionTexture:await _,emissiveTexture:await A,emissiveFactor:d.emissiveFactor,metallicFactor:y.metallicFactor,roughnessFactor:y.roughnessFactor,metallicRoughnessTexture:await S,hasVertexColors:x,ESRI_externalColorMixMode:d.extras.ESRI_externalColorMixMode,colorTextureTransform:(a=(s=y==null?void 0:y.baseColorTexture)==null?void 0:s.extensions)==null?void 0:a.KHR_texture_transform,normalTextureTransform:(u=(i=d.normalTexture)==null?void 0:i.extensions)==null?void 0:u.KHR_texture_transform,occlusionTextureTransform:(m=(l=d.occlusionTexture)==null?void 0:l.extensions)==null?void 0:m.KHR_texture_transform,emissiveTextureTransform:(w=(h=d.emissiveTexture)==null?void 0:h.extensions)==null?void 0:w.KHR_texture_transform,metallicRoughnessTextureTransform:(T=(p=y==null?void 0:y.metallicRoughnessTexture)==null?void 0:p.extensions)==null?void 0:T.KHR_texture_transform,receiveAmbientOcclusion:d.extras.ESRI_receiveAmbientOcclusion,receiveShadows:d.extras.ESRI_receiveShadows}}return n}async getTexture(e,r){if(!e)return;if((e.texCoord||0)!==0)throw new f("gltf-loader-unsupported-feature","Only TEXCOORD with index 0 is supported.");const t=e.index,n=this.json.textures[t],s=ut(n.sampler!=null?this.json.samplers[n.sampler]:{}),a=this._getTextureSourceId(n),i=this.json.images[a],u=await this._loadTextureImageData(t,n,r);return Te(this._textureCache,t,()=>{const l=h=>h===33071||h===33648||h===10497,m=h=>{throw new f("gltf-loader-error",`Unexpected TextureSampler WrapMode: ${h}`)};return{data:u,wrapS:l(s.wrapS)?s.wrapS:m(s.wrapS),wrapT:l(s.wrapT)?s.wrapT:m(s.wrapT),minFilter:s.minFilter,name:i.name,id:t}})}getNodeTransform(e){if(e===void 0)return ft;let r=this._nodeTransformCache.get(e);if(!r){const t=this.getNodeTransform(this._getNodeParent(e)),n=this.json.nodes[e];n.matrix?r=ge(W(),t,n.matrix):n.translation||n.rotation||n.scale?(r=k(t),n.translation&&_e(r,r,n.translation),n.rotation&&(U[3]=Oe(U,n.rotation),be(r,r,U[3],U)),n.scale&&xe(r,r,n.scale)):r=k(t),this._nodeTransformCache.set(e,r)}return r}_wrapAccessor(e,r){return new e(r.raw,r.byteOffset,r.byteStride,r.byteOffset+r.byteStride*(r.entryCount-1)+r.componentByteSize*r.componentCount)}_resolveUri(e){return Se(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=Z.parse(this.json.asset.version,"glTF");ct.validate(e)}_checkRequiredExtensionsSupported(){const e=this.json;if(e.extensionsRequired&&!e.extensionsRequired.every(r=>this._supportedExtensions.includes(r)))throw new f("gltf-loader-unsupported-feature","gltf loader was not able to load unsupported feature. Required extensions: "+e.extensionsRequired.join(", "))}_computeNodeParents(){this.json.nodes.forEach((e,r)=>{e.children&&e.children.forEach(t=>{this._nodeParentMap.set(t,r)})})}async _loadTextureImageData(e,r,t){const n=this._textureLoaders.get(e);if(n)return n;const s=this._createTextureLoader(r,t);return this._textureLoaders.set(e,s),s}_getTextureSourceId(e){if(e.extensions!==void 0&&e.extensions.KHR_texture_basisu!==null)return e.extensions.KHR_texture_basisu.source;if(e.source!==null)return e.source;throw new f("gltf-loader-unsupported-feature","Source is expected to be defined for a texture. It can also be omitted in favour of an KHR_texture_basisu extension tag.")}async _createTextureLoader(e,r){const t=this._getTextureSourceId(e),n=this.json.images[t];if(n.uri){if(n.uri.endsWith(".ktx2")){const u=await this._context.loadBinary(this._resolveUri(n.uri),r);return new Ge(new Uint8Array(u))}return this._context.loadImage(this._resolveUri(n.uri),r)}if(n.bufferView==null)throw new f("gltf-loader-unsupported-feature","Image bufferView must be defined.");if(n.mimeType==null)throw new f("gltf-loader-unsupported-feature","Image mimeType must be defined.");const s=this.json.bufferViews[n.bufferView],a=await this.getBuffer(s.buffer,r);if(s.byteStride!=null)throw new f("gltf-loader-unsupported-feature","byteStride not supported for image buffer");const i=a.byteOffset+(s.byteOffset||0);return je(new Uint8Array(a.buffer,i,s.byteLength),n.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;const e=await H(Array.from(this._bufferLoaders.values())),r=await H(Array.from(this._textureLoaders.values()));return e.reduce((t,n)=>t+((n==null?void 0:n.byteLength)??0),0)+r.reduce((t,n)=>t+(n?Ve(n)?n.data.byteLength:n.width*n.height*4:0),0)}}const ft=ye(W(),Math.PI/2),ct=new Z(2,0,"glTF"),U=Ae(),dt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},pt={[c.BYTE]:1,[c.UNSIGNED_BYTE]:1,[c.SHORT]:2,[c.UNSIGNED_SHORT]:2,[c.FLOAT]:4,[c.INT]:4,[c.UNSIGNED_INT]:4};function mt(o){switch(o.componentType){case c.BYTE:return new De(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case c.UNSIGNED_BYTE:return new Ue(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case c.SHORT:return new Fe(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case c.UNSIGNED_SHORT:return new $e(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case c.UNSIGNED_INT:return new Le(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case c.FLOAT:return new ee(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount)}}const ht=/\.gltf$/i,yt=/\.glb$/i;let wt=0;async function Dt(o,e,r={},t=!0){var h,w;const n=await E.load(o,e,r),s="gltf_"+wt++,a={lods:[],materials:new Map,textures:new Map,meta:Tt(n)},i=!(!n.json.asset.extras||n.json.asset.extras.ESRI_type!=="symbolResource"),u=(w=(h=n.json.asset.extras)==null?void 0:h.ESRI_webstyleSymbol)==null?void 0:w.webstyle,l=new Map;await gt(n,async(p,T,d,y)=>{var I;const x=l.get(d)??0;l.set(d,x+1);const g=p.mode!==void 0?p.mode:O.TRIANGLES,b=g===O.TRIANGLES||g===O.TRIANGLE_STRIP||g===O.TRIANGLE_FAN?g:null;if(b==null)return void j.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Unsupported primitive mode ("+O[g]+"). Skipping primitive.");if(!n.hasPositions(p))return void j.getLogger("esri.views.3d.glTF").warn("Skipping primitive without POSITION vertex attribute.");const _=n.getPositionData(p,r),A=n.getMaterial(p,r,t),S=n.hasNormals(p)?n.getNormalData(p,r):null,M=n.hasTangents(p)?n.getTangentData(p,r):null,R=n.hasTextureCoordinates(p)?n.getTextureCoordinates(p,r):null,N=n.hasVertexColors(p)?n.getVertexColors(p,r):null,C=n.getIndexData(p,r),B={name:y,transform:k(T),attributes:{position:await _,normal:S?await S:null,texCoord0:R?await R:null,color:N?await N:null,tangent:M?await M:null},indices:await C,primitiveType:b,material:bt(a,await A,s)};let v=null;((I=a.meta)==null?void 0:I.ESRI_lod)!=null&&a.meta.ESRI_lod.metric==="screenSpaceRadius"&&(v=a.meta.ESRI_lod.thresholds[d]),a.lods[d]=a.lods[d]||{parts:[],name:y,lodThreshold:v},a.lods[d].parts[x]=B});for(const p of a.lods)p.parts=p.parts.filter(T=>!!T);const m=await n.getLoadedBuffersSize();return{model:a,meta:{isEsriSymbolResource:i,uri:n.uri,ESRI_webstyle:u},customMeta:{},size:m}}function Tt(o){const e=o.json;let r=null;return e.nodes.forEach(t=>{const n=t.extras;n!=null&&(n.ESRI_proxyEllipsoid||n.ESRI_lod)&&(r=n)}),r}async function gt(o,e){const r=o.json,t=r.scenes[r.scene||0].nodes,n=t.length>1,s=[];for(const i of t){const u=r.nodes[i];s.push(a(i,0)),_t(u)&&!n&&u.extensions.MSFT_lod.ids.forEach((l,m)=>a(l,m+1))}async function a(i,u){const l=r.nodes[i],m=o.getNodeTransform(i);if(l.weights!=null&&j.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Morph targets are not supported."),l.mesh!=null){const h=r.meshes[l.mesh];for(const w of h.primitives)s.push(e(w,m,u,h.name))}for(const h of l.children||[])s.push(a(h,u))}await Promise.all(s)}function _t(o){var e;return((e=o.extensions)==null?void 0:e.MSFT_lod)&&Array.isArray(o.extensions.MSFT_lod.ids)}function bt(o,e,r){const t=s=>{const a=`${r}_tex_${s&&s.id}${s!=null&&s.name?"_"+s.name:""}`;if(s&&!o.textures.has(a)){const i=ot(s.data,{wrap:{s:s.wrapS,t:s.wrapT},mipmap:xt.has(s.minFilter),noUnpackFlip:!0});o.textures.set(a,i)}return a},n=`${r}_mat_${e.id}_${e.name}`;if(!o.materials.has(n)){const s=rt({color:[e.color[0],e.color[1],e.color[2]],opacity:e.color[3],alphaMode:e.alphaMode,alphaCutoff:e.alphaCutoff,doubleSided:e.doubleSided,colorMixMode:e.ESRI_externalColorMixMode,textureColor:e.colorTexture?t(e.colorTexture):void 0,textureNormal:e.normalTexture?t(e.normalTexture):void 0,textureOcclusion:e.occlusionTexture?t(e.occlusionTexture):void 0,textureEmissive:e.emissiveTexture?t(e.emissiveTexture):void 0,textureMetallicRoughness:e.metallicRoughnessTexture?t(e.metallicRoughnessTexture):void 0,emissiveFactor:[e.emissiveFactor[0],e.emissiveFactor[1],e.emissiveFactor[2]],colorTextureTransform:e.colorTextureTransform,normalTextureTransform:e.normalTextureTransform,occlusionTextureTransform:e.occlusionTextureTransform,emissiveTextureTransform:e.emissiveTextureTransform,metallicRoughnessTextureTransform:e.metallicRoughnessTextureTransform,metallicFactor:e.metallicFactor,roughnessFactor:e.roughnessFactor,receiveShadows:e.receiveShadows,receiveAmbientOcclustion:e.receiveAmbientOcclusion});o.materials.set(n,s)}return n}const xt=new Set([G.LINEAR_MIPMAP_LINEAR,G.LINEAR_MIPMAP_NEAREST]);function Pt(o,e){switch(e){case O.TRIANGLES:return St(o);case O.TRIANGLE_STRIP:return Et(o);case O.TRIANGLE_FAN:return Ot(o)}}function St(o){return typeof o=="number"?ke(o):Ee(o)?new Uint16Array(o):o}function Et(o){const e=typeof o=="number"?o:o.length;if(e<3)return[];const r=e-2,t=He(3*r);if(typeof o=="number"){let n=0;for(let s=0;s{g.set(s,p)})}class A extends h{setupDefaultRules(){super.setupDefaultRules();const s=this._root.language,o=this._root.interfaceColors,d=this._root.horizontalLayout,p=this._root.verticalLayout,e=this.rule.bind(this);e("InterfaceColors").setAll({stroke:i.fromHex(15066597),fill:i.fromHex(15987699),primaryButton:i.fromHex(6788316),primaryButtonHover:i.fromHex(6779356),primaryButtonDown:i.fromHex(6872182),primaryButtonActive:i.fromHex(6872182),primaryButtonText:i.fromHex(16777215),primaryButtonStroke:i.fromHex(16777215),secondaryButton:i.fromHex(14277081),secondaryButtonHover:i.fromHex(10724259),secondaryButtonDown:i.fromHex(9276813),secondaryButtonActive:i.fromHex(15132390),secondaryButtonText:i.fromHex(0),secondaryButtonStroke:i.fromHex(16777215),grid:i.fromHex(0),background:i.fromHex(16777215),alternativeBackground:i.fromHex(0),text:i.fromHex(0),alternativeText:i.fromHex(16777215),disabled:i.fromHex(11382189),positive:i.fromHex(5288704),negative:i.fromHex(11730944)});{const t=e("ColorSet");t.setAll({passOptions:{hue:.05,saturation:0,lightness:0},colors:[i.fromHex(6797276)],step:1,reuse:!1,startIndex:0}),t.setPrivate("currentStep",0),t.setPrivate("currentPass",0)}e("Entity").setAll({stateAnimationDuration:0,stateAnimationEasing:c(u)}),e("Component").setAll({interpolationDuration:0,interpolationEasing:c(u)}),e("Sprite").setAll({visible:!0,scale:1,opacity:1,rotation:0,position:"relative",tooltipX:n,tooltipY:n,tooltipPosition:"fixed",isMeasured:!0}),e("Sprite").states.create("default",{visible:!0,opacity:1}),e("Container").setAll({interactiveChildren:!0,setStateOnChildren:!1}),e("Graphics").setAll({strokeWidth:1}),e("Chart").setAll({width:r,height:r,interactiveChildren:!1}),e("ZoomableContainer").setAll({width:r,height:r,wheelable:!0,pinchZoom:!0,maxZoomLevel:32,minZoomLevel:1,zoomStep:2,animationEasing:c(u),animationDuration:600}),e("Sprite",["horizontal","center"]).setAll({centerX:n,x:n}),e("Sprite",["vertical","center"]).setAll({centerY:n,y:n}),e("Container",["horizontal","layout"]).setAll({layout:d}),e("Container",["vertical","layout"]).setAll({layout:p}),e("Pattern").setAll({repetition:"repeat",width:50,height:50,rotation:0,fillOpacity:1}),e("LinePattern").setAll({gap:6,colorOpacity:1,width:49,height:49}),e("RectanglePattern").setAll({gap:6,checkered:!1,centered:!0,maxWidth:5,maxHeight:5,width:48,height:48,strokeWidth:0}),e("CirclePattern").setAll({gap:5,checkered:!1,centered:!1,radius:3,strokeWidth:0,width:45,height:45}),e("GrainPattern").setAll({width:200,height:200,colors:[i.fromHex(0)],size:1,horizontalGap:0,verticalGap:0,density:1,minOpacity:0,maxOpacity:.2}),e("LinearGradient").setAll({rotation:90}),e("Legend").setAll({fillField:"fill",strokeField:"stroke",nameField:"name",layout:R.new(this._root,{}),layer:30,clickTarget:"itemContainer"}),e("Container",["legend","item","itemcontainer"]).setAll({paddingLeft:5,paddingRight:5,paddingBottom:5,paddingTop:5,layout:d,setStateOnChildren:!0,interactiveChildren:!1,ariaChecked:!0,focusable:!0,ariaLabel:s.translate("Press ENTER to toggle"),role:"checkbox"});{const t=e("Rectangle",["legend","item","background"]);t.setAll({fillOpacity:0}),a(t,"fill",o,"background")}e("Container",["legend","marker"]).setAll({setStateOnChildren:!0,centerY:n,paddingLeft:0,paddingRight:0,paddingBottom:0,paddingTop:0,width:18,height:18}),e("RoundedRectangle",["legend","marker","rectangle"]).setAll({width:r,height:r,cornerRadiusBL:3,cornerRadiusTL:3,cornerRadiusBR:3,cornerRadiusTR:3});{const t=e("RoundedRectangle",["legend","marker","rectangle"]).states.create("disabled",{});a(t,"fill",o,"disabled"),a(t,"stroke",o,"disabled")}e("Label",["legend","label"]).setAll({centerY:n,marginLeft:5,paddingRight:0,paddingLeft:0,paddingTop:0,paddingBottom:0,populateText:!0}),a(e("Label",["legend","label"]).states.create("disabled",{}),"fill",o,"disabled"),e("Label",["legend","value","label"]).setAll({centerY:n,marginLeft:5,paddingRight:0,paddingLeft:0,paddingTop:0,paddingBottom:0,width:50,centerX:r,populateText:!0}),a(e("Label",["legend","value","label"]).states.create("disabled",{}),"fill",o,"disabled"),e("HeatLegend").setAll({stepCount:1}),e("RoundedRectangle",["heatlegend","marker"]).setAll({cornerRadiusTR:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusBL:0}),e("RoundedRectangle",["vertical","heatlegend","marker"]).setAll({height:r,width:15}),e("RoundedRectangle",["horizontal","heatlegend","marker"]).setAll({width:r,height:15}),e("HeatLegend",["vertical"]).setAll({height:r}),e("HeatLegend",["horizontal"]).setAll({width:r}),e("Label",["heatlegend","start"]).setAll({paddingLeft:5,paddingRight:5,paddingTop:5,paddingBottom:5}),e("Label",["heatlegend","end"]).setAll({paddingLeft:5,paddingRight:5,paddingTop:5,paddingBottom:5});{const t=e("Label");t.setAll({paddingTop:8,paddingBottom:8,paddingLeft:10,paddingRight:10,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontSize:"1em",populateText:!1}),a(t,"fill",o,"text")}e("RadialLabel").setAll({textType:"regular",centerY:n,centerX:n,inside:!1,radius:0,baseRadius:r,orientation:"auto",textAlign:"center"}),e("RoundedRectangle").setAll({cornerRadiusTL:8,cornerRadiusBL:8,cornerRadiusTR:8,cornerRadiusBR:8}),e("PointedRectangle").setAll({pointerBaseWidth:15,pointerLength:10,cornerRadius:8}),e("Slice").setAll({shiftRadius:0,dRadius:0,dInnerRadius:0});{const t=e("Tick");t.setAll({strokeOpacity:.15,isMeasured:!1,length:4.5,position:"absolute",crisp:!0}),a(t,"stroke",o,"grid")}e("Bullet").setAll({locationX:.5,locationY:.5}),e("Tooltip").setAll({position:"absolute",getFillFromSprite:!0,getStrokeFromSprite:!1,autoTextColor:!0,paddingTop:9,paddingBottom:8,paddingLeft:10,paddingRight:10,marginBottom:5,pointerOrientation:"vertical",centerX:n,centerY:n,animationEasing:c(u),exportable:!1}),e("Polygon").setAll({animationEasing:c(u)}),e("PointedRectangle",["tooltip","background"]).setAll({strokeOpacity:.9,cornerRadius:4,pointerLength:4,pointerBaseWidth:8,fillOpacity:.9,stroke:i.fromHex(16777215)});{const t=e("Label",["tooltip"]);t.setAll({role:"tooltip",populateText:!0,paddingRight:0,paddingTop:0,paddingLeft:0,paddingBottom:0}),a(t,"fill",o,"alternativeText")}e("Button").setAll({paddingTop:8,paddingBottom:8,paddingLeft:10,paddingRight:10,interactive:!0,layout:d,interactiveChildren:!1,setStateOnChildren:!0,focusable:!0}),e("Button").states.create("hover",{}),e("Button").states.create("down",{stateAnimationDuration:0}),e("Button").states.create("active",{});{const t=e("RoundedRectangle",["button","background"]);a(t,"fill",o,"primaryButton"),a(t,"stroke",o,"primaryButtonStroke")}a(e("RoundedRectangle",["button","background"]).states.create("hover",{}),"fill",o,"primaryButtonHover"),a(e("RoundedRectangle",["button","background"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"primaryButtonDown"),a(e("RoundedRectangle",["button","background"]).states.create("active",{}),"fill",o,"primaryButtonActive"),a(e("Graphics",["button","icon"]),"stroke",o,"primaryButtonText"),a(e("Label",["button"]),"fill",o,"primaryButtonText"),e("Button",["zoom"]).setAll({paddingTop:18,paddingBottom:18,paddingLeft:12,paddingRight:12,centerX:46,centerY:-10,y:0,x:r,role:"button",ariaLabel:s.translate("Zoom Out"),layer:30});{const t=e("RoundedRectangle",["background","button","zoom"]);t.setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),a(t,"fill",o,"primaryButton")}a(e("RoundedRectangle",["background","button","zoom"]).states.create("hover",{}),"fill",o,"primaryButtonHover"),a(e("RoundedRectangle",["background","button","zoom"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"primaryButtonDown");{const t=e("Graphics",["icon","button","zoom"]);t.setAll({crisp:!0,strokeOpacity:.7,draw:l=>{l.moveTo(0,0),l.lineTo(12,0)}}),a(t,"stroke",o,"primaryButtonText")}e("Button",["resize"]).setAll({paddingTop:9,paddingBottom:9,paddingLeft:13,paddingRight:13,draggable:!0,centerX:n,centerY:n,position:"absolute",role:"slider",ariaValueMin:"0",ariaValueMax:"100",ariaLabel:s.translate("Use up and down arrows to move selection")});{const t=e("RoundedRectangle",["background","resize","button"]);t.setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),a(t,"fill",o,"secondaryButton"),a(t,"stroke",o,"secondaryButtonStroke")}a(e("RoundedRectangle",["background","resize","button"]).states.create("hover",{}),"fill",o,"secondaryButtonHover"),a(e("RoundedRectangle",["background","resize","button"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"secondaryButtonDown");{const t=e("Graphics",["resize","button","icon"]);t.setAll({interactive:!1,crisp:!0,strokeOpacity:.5,draw:l=>{l.moveTo(0,.5),l.lineTo(0,12.5),l.moveTo(4,.5),l.lineTo(4,12.5)}}),a(t,"stroke",o,"secondaryButtonText")}e("Button",["resize","vertical"]).setAll({rotation:90,cursorOverStyle:"ns-resize"}),e("Button",["resize","horizontal"]).setAll({cursorOverStyle:"ew-resize"}),e("Button",["play"]).setAll({paddingTop:13,paddingBottom:13,paddingLeft:14,paddingRight:14,ariaLabel:s.translate("Play"),toggleKey:"active"});{const t=e("RoundedRectangle",["play","background"]);t.setAll({strokeOpacity:.5,cornerRadiusBL:100,cornerRadiusBR:100,cornerRadiusTL:100,cornerRadiusTR:100}),a(t,"fill",o,"primaryButton")}{const t=e("Graphics",["play","icon"]);t.setAll({stateAnimationDuration:0,dx:1,draw:l=>{l.moveTo(0,-5),l.lineTo(8,0),l.lineTo(0,5),l.lineTo(0,-5)}}),a(t,"fill",o,"primaryButtonText")}e("Graphics",["play","icon"]).states.create("default",{stateAnimationDuration:0}),e("Graphics",["play","icon"]).states.create("active",{stateAnimationDuration:0,draw:t=>{t.moveTo(-4,-5),t.lineTo(-1,-5),t.lineTo(-1,5),t.lineTo(-4,5),t.lineTo(-4,-5),t.moveTo(4,-5),t.lineTo(1,-5),t.lineTo(1,5),t.lineTo(4,5),t.lineTo(4,-5)}}),e("Button",["switch"]).setAll({paddingTop:4,paddingBottom:4,paddingLeft:4,paddingRight:4,ariaLabel:s.translate("Press ENTER to toggle"),toggleKey:"active",width:40,height:24,layout:null});{const t=e("RoundedRectangle",["switch","background"]);t.setAll({strokeOpacity:.5,cornerRadiusBL:100,cornerRadiusBR:100,cornerRadiusTL:100,cornerRadiusTR:100}),a(t,"fill",o,"primaryButton")}{const t=e("Circle",["switch","icon"]);t.setAll({radius:8,centerY:0,centerX:0,dx:0}),a(t,"fill",o,"primaryButtonText")}e("Graphics",["switch","icon"]).states.create("active",{dx:16}),e("Scrollbar").setAll({start:0,end:1,layer:30,animationEasing:c(u)}),e("Scrollbar",["vertical"]).setAll({marginRight:13,marginLeft:13,minWidth:12,height:r}),e("Scrollbar",["horizontal"]).setAll({marginTop:13,marginBottom:13,minHeight:12,width:r}),this.rule("Button",["scrollbar"]).setAll({exportable:!1});{const t=e("RoundedRectangle",["scrollbar","main","background"]);t.setAll({cornerRadiusTL:8,cornerRadiusBL:8,cornerRadiusTR:8,cornerRadiusBR:8,fillOpacity:.8}),a(t,"fill",o,"fill")}{const t=e("RoundedRectangle",["scrollbar","thumb"]);t.setAll({role:"slider",ariaLive:"polite",position:"absolute",draggable:!0}),a(t,"fill",o,"secondaryButton")}a(e("RoundedRectangle",["scrollbar","thumb"]).states.create("hover",{}),"fill",o,"secondaryButtonHover"),a(e("RoundedRectangle",["scrollbar","thumb"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"secondaryButtonDown"),e("RoundedRectangle",["scrollbar","thumb","vertical"]).setAll({x:n,width:r,centerX:n,ariaLabel:s.translate("Use up and down arrows to move selection")}),e("RoundedRectangle",["scrollbar","thumb","horizontal"]).setAll({y:n,centerY:n,height:r,ariaLabel:s.translate("Use left and right arrows to move selection")});{const t=e("PointedRectangle",["axis","tooltip","background"]);t.setAll({cornerRadius:0}),a(t,"fill",o,"alternativeBackground")}e("Label",["axis","tooltip"]).setAll({role:void 0}),e("Label",["axis","tooltip","y"]).setAll({textAlign:"right"}),e("Label",["axis","tooltip","y","opposite"]).setAll({textAlign:"left"}),e("Label",["axis","tooltip","x"]).setAll({textAlign:"center"}),e("Tooltip",["categoryaxis"]).setAll({labelText:"{category}"}),e("Star").setAll({spikes:5,innerRadius:5,radius:10}),e("Tooltip",["stock"]).setAll({paddingTop:6,paddingBottom:5,paddingLeft:7,paddingRight:7}),e("PointedRectangle",["tooltip","stock","axis"]).setAll({pointerLength:0,pointerBaseWidth:0,cornerRadius:3}),e("Label",["tooltip","stock"]).setAll({fontSize:"0.8em"}),e("SpriteResizer").setAll({rotationStep:10}),e("Container",["resizer","grip"]).states.create("hover",{});{const t=e("RoundedRectangle",["resizer","grip"]);t.setAll({strokeOpacity:.7,strokeWidth:1,fillOpacity:1,width:12,height:12}),a(t,"fill",o,"background"),a(t,"stroke",o,"alternativeBackground")}{const t=e("RoundedRectangle",["resizer","grip","outline"]);t.setAll({strokeOpacity:0,fillOpacity:0,width:20,height:20}),t.states.create("hover",{fillOpacity:.3}),a(t,"fill",o,"alternativeBackground")}e("RoundedRectangle",["resizer","grip","left"]).setAll({cornerRadiusBL:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusTR:0}),e("RoundedRectangle",["resizer","grip","right"]).setAll({cornerRadiusBL:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusTR:0});{const t=e("Rectangle",["resizer","rectangle"]);t.setAll({strokeDasharray:[2,2],strokeOpacity:.5,strokeWidth:1}),a(t,"stroke",o,"alternativeBackground")}e("Graphics",["button","plus","icon"]).setAll({x:n,y:n,draw:t=>{t.moveTo(-4,0),t.lineTo(4,0),t.moveTo(0,-4),t.lineTo(0,4)}}),e("Graphics",["button","minus","icon"]).setAll({x:n,y:n,draw:t=>{t.moveTo(-4,0),t.lineTo(4,0)}}),e("Graphics",["button","home","icon"]).setAll({x:n,y:n,svgPath:"M 8 -1 L 6 -1 L 6 7 L 2 7 L 2 1 L -2 1 L -2 7 L -6 7 L -6 -1 L -8 -1 L 0 -9 L 8 -1 Z M 8 -1"}),e("Button",["zoomtools"]).setAll({marginTop:1,marginBottom:2}),e("ZoomTools").setAll({x:r,centerX:r,y:r,centerY:r,paddingRight:10,paddingBottom:10})}}export{a as l,A as s}; +import{an as h,a3 as i,ao as c,ap as n,r,Z as R,aq as u}from"./Theme-6HY29PEY.js";function a(g,s,o,d){g.set(s,o.get(d)),o.on(d,p=>{g.set(s,p)})}class A extends h{setupDefaultRules(){super.setupDefaultRules();const s=this._root.language,o=this._root.interfaceColors,d=this._root.horizontalLayout,p=this._root.verticalLayout,e=this.rule.bind(this);e("InterfaceColors").setAll({stroke:i.fromHex(15066597),fill:i.fromHex(15987699),primaryButton:i.fromHex(6788316),primaryButtonHover:i.fromHex(6779356),primaryButtonDown:i.fromHex(6872182),primaryButtonActive:i.fromHex(6872182),primaryButtonText:i.fromHex(16777215),primaryButtonStroke:i.fromHex(16777215),secondaryButton:i.fromHex(14277081),secondaryButtonHover:i.fromHex(10724259),secondaryButtonDown:i.fromHex(9276813),secondaryButtonActive:i.fromHex(15132390),secondaryButtonText:i.fromHex(0),secondaryButtonStroke:i.fromHex(16777215),grid:i.fromHex(0),background:i.fromHex(16777215),alternativeBackground:i.fromHex(0),text:i.fromHex(0),alternativeText:i.fromHex(16777215),disabled:i.fromHex(11382189),positive:i.fromHex(5288704),negative:i.fromHex(11730944)});{const t=e("ColorSet");t.setAll({passOptions:{hue:.05,saturation:0,lightness:0},colors:[i.fromHex(6797276)],step:1,reuse:!1,startIndex:0}),t.setPrivate("currentStep",0),t.setPrivate("currentPass",0)}e("Entity").setAll({stateAnimationDuration:0,stateAnimationEasing:c(u)}),e("Component").setAll({interpolationDuration:0,interpolationEasing:c(u)}),e("Sprite").setAll({visible:!0,scale:1,opacity:1,rotation:0,position:"relative",tooltipX:n,tooltipY:n,tooltipPosition:"fixed",isMeasured:!0}),e("Sprite").states.create("default",{visible:!0,opacity:1}),e("Container").setAll({interactiveChildren:!0,setStateOnChildren:!1}),e("Graphics").setAll({strokeWidth:1}),e("Chart").setAll({width:r,height:r,interactiveChildren:!1}),e("ZoomableContainer").setAll({width:r,height:r,wheelable:!0,pinchZoom:!0,maxZoomLevel:32,minZoomLevel:1,zoomStep:2,animationEasing:c(u),animationDuration:600}),e("Sprite",["horizontal","center"]).setAll({centerX:n,x:n}),e("Sprite",["vertical","center"]).setAll({centerY:n,y:n}),e("Container",["horizontal","layout"]).setAll({layout:d}),e("Container",["vertical","layout"]).setAll({layout:p}),e("Pattern").setAll({repetition:"repeat",width:50,height:50,rotation:0,fillOpacity:1}),e("LinePattern").setAll({gap:6,colorOpacity:1,width:49,height:49}),e("RectanglePattern").setAll({gap:6,checkered:!1,centered:!0,maxWidth:5,maxHeight:5,width:48,height:48,strokeWidth:0}),e("CirclePattern").setAll({gap:5,checkered:!1,centered:!1,radius:3,strokeWidth:0,width:45,height:45}),e("GrainPattern").setAll({width:200,height:200,colors:[i.fromHex(0)],size:1,horizontalGap:0,verticalGap:0,density:1,minOpacity:0,maxOpacity:.2}),e("LinearGradient").setAll({rotation:90}),e("Legend").setAll({fillField:"fill",strokeField:"stroke",nameField:"name",layout:R.new(this._root,{}),layer:30,clickTarget:"itemContainer"}),e("Container",["legend","item","itemcontainer"]).setAll({paddingLeft:5,paddingRight:5,paddingBottom:5,paddingTop:5,layout:d,setStateOnChildren:!0,interactiveChildren:!1,ariaChecked:!0,focusable:!0,ariaLabel:s.translate("Press ENTER to toggle"),role:"checkbox"});{const t=e("Rectangle",["legend","item","background"]);t.setAll({fillOpacity:0}),a(t,"fill",o,"background")}e("Container",["legend","marker"]).setAll({setStateOnChildren:!0,centerY:n,paddingLeft:0,paddingRight:0,paddingBottom:0,paddingTop:0,width:18,height:18}),e("RoundedRectangle",["legend","marker","rectangle"]).setAll({width:r,height:r,cornerRadiusBL:3,cornerRadiusTL:3,cornerRadiusBR:3,cornerRadiusTR:3});{const t=e("RoundedRectangle",["legend","marker","rectangle"]).states.create("disabled",{});a(t,"fill",o,"disabled"),a(t,"stroke",o,"disabled")}e("Label",["legend","label"]).setAll({centerY:n,marginLeft:5,paddingRight:0,paddingLeft:0,paddingTop:0,paddingBottom:0,populateText:!0}),a(e("Label",["legend","label"]).states.create("disabled",{}),"fill",o,"disabled"),e("Label",["legend","value","label"]).setAll({centerY:n,marginLeft:5,paddingRight:0,paddingLeft:0,paddingTop:0,paddingBottom:0,width:50,centerX:r,populateText:!0}),a(e("Label",["legend","value","label"]).states.create("disabled",{}),"fill",o,"disabled"),e("HeatLegend").setAll({stepCount:1}),e("RoundedRectangle",["heatlegend","marker"]).setAll({cornerRadiusTR:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusBL:0}),e("RoundedRectangle",["vertical","heatlegend","marker"]).setAll({height:r,width:15}),e("RoundedRectangle",["horizontal","heatlegend","marker"]).setAll({width:r,height:15}),e("HeatLegend",["vertical"]).setAll({height:r}),e("HeatLegend",["horizontal"]).setAll({width:r}),e("Label",["heatlegend","start"]).setAll({paddingLeft:5,paddingRight:5,paddingTop:5,paddingBottom:5}),e("Label",["heatlegend","end"]).setAll({paddingLeft:5,paddingRight:5,paddingTop:5,paddingBottom:5});{const t=e("Label");t.setAll({paddingTop:8,paddingBottom:8,paddingLeft:10,paddingRight:10,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontSize:"1em",populateText:!1}),a(t,"fill",o,"text")}e("RadialLabel").setAll({textType:"regular",centerY:n,centerX:n,inside:!1,radius:0,baseRadius:r,orientation:"auto",textAlign:"center"}),e("RoundedRectangle").setAll({cornerRadiusTL:8,cornerRadiusBL:8,cornerRadiusTR:8,cornerRadiusBR:8}),e("PointedRectangle").setAll({pointerBaseWidth:15,pointerLength:10,cornerRadius:8}),e("Slice").setAll({shiftRadius:0,dRadius:0,dInnerRadius:0});{const t=e("Tick");t.setAll({strokeOpacity:.15,isMeasured:!1,length:4.5,position:"absolute",crisp:!0}),a(t,"stroke",o,"grid")}e("Bullet").setAll({locationX:.5,locationY:.5}),e("Tooltip").setAll({position:"absolute",getFillFromSprite:!0,getStrokeFromSprite:!1,autoTextColor:!0,paddingTop:9,paddingBottom:8,paddingLeft:10,paddingRight:10,marginBottom:5,pointerOrientation:"vertical",centerX:n,centerY:n,animationEasing:c(u),exportable:!1}),e("Polygon").setAll({animationEasing:c(u)}),e("PointedRectangle",["tooltip","background"]).setAll({strokeOpacity:.9,cornerRadius:4,pointerLength:4,pointerBaseWidth:8,fillOpacity:.9,stroke:i.fromHex(16777215)});{const t=e("Label",["tooltip"]);t.setAll({role:"tooltip",populateText:!0,paddingRight:0,paddingTop:0,paddingLeft:0,paddingBottom:0}),a(t,"fill",o,"alternativeText")}e("Button").setAll({paddingTop:8,paddingBottom:8,paddingLeft:10,paddingRight:10,interactive:!0,layout:d,interactiveChildren:!1,setStateOnChildren:!0,focusable:!0}),e("Button").states.create("hover",{}),e("Button").states.create("down",{stateAnimationDuration:0}),e("Button").states.create("active",{});{const t=e("RoundedRectangle",["button","background"]);a(t,"fill",o,"primaryButton"),a(t,"stroke",o,"primaryButtonStroke")}a(e("RoundedRectangle",["button","background"]).states.create("hover",{}),"fill",o,"primaryButtonHover"),a(e("RoundedRectangle",["button","background"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"primaryButtonDown"),a(e("RoundedRectangle",["button","background"]).states.create("active",{}),"fill",o,"primaryButtonActive"),a(e("Graphics",["button","icon"]),"stroke",o,"primaryButtonText"),a(e("Label",["button"]),"fill",o,"primaryButtonText"),e("Button",["zoom"]).setAll({paddingTop:18,paddingBottom:18,paddingLeft:12,paddingRight:12,centerX:46,centerY:-10,y:0,x:r,role:"button",ariaLabel:s.translate("Zoom Out"),layer:30});{const t=e("RoundedRectangle",["background","button","zoom"]);t.setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),a(t,"fill",o,"primaryButton")}a(e("RoundedRectangle",["background","button","zoom"]).states.create("hover",{}),"fill",o,"primaryButtonHover"),a(e("RoundedRectangle",["background","button","zoom"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"primaryButtonDown");{const t=e("Graphics",["icon","button","zoom"]);t.setAll({crisp:!0,strokeOpacity:.7,draw:l=>{l.moveTo(0,0),l.lineTo(12,0)}}),a(t,"stroke",o,"primaryButtonText")}e("Button",["resize"]).setAll({paddingTop:9,paddingBottom:9,paddingLeft:13,paddingRight:13,draggable:!0,centerX:n,centerY:n,position:"absolute",role:"slider",ariaValueMin:"0",ariaValueMax:"100",ariaLabel:s.translate("Use up and down arrows to move selection")});{const t=e("RoundedRectangle",["background","resize","button"]);t.setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),a(t,"fill",o,"secondaryButton"),a(t,"stroke",o,"secondaryButtonStroke")}a(e("RoundedRectangle",["background","resize","button"]).states.create("hover",{}),"fill",o,"secondaryButtonHover"),a(e("RoundedRectangle",["background","resize","button"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"secondaryButtonDown");{const t=e("Graphics",["resize","button","icon"]);t.setAll({interactive:!1,crisp:!0,strokeOpacity:.5,draw:l=>{l.moveTo(0,.5),l.lineTo(0,12.5),l.moveTo(4,.5),l.lineTo(4,12.5)}}),a(t,"stroke",o,"secondaryButtonText")}e("Button",["resize","vertical"]).setAll({rotation:90,cursorOverStyle:"ns-resize"}),e("Button",["resize","horizontal"]).setAll({cursorOverStyle:"ew-resize"}),e("Button",["play"]).setAll({paddingTop:13,paddingBottom:13,paddingLeft:14,paddingRight:14,ariaLabel:s.translate("Play"),toggleKey:"active"});{const t=e("RoundedRectangle",["play","background"]);t.setAll({strokeOpacity:.5,cornerRadiusBL:100,cornerRadiusBR:100,cornerRadiusTL:100,cornerRadiusTR:100}),a(t,"fill",o,"primaryButton")}{const t=e("Graphics",["play","icon"]);t.setAll({stateAnimationDuration:0,dx:1,draw:l=>{l.moveTo(0,-5),l.lineTo(8,0),l.lineTo(0,5),l.lineTo(0,-5)}}),a(t,"fill",o,"primaryButtonText")}e("Graphics",["play","icon"]).states.create("default",{stateAnimationDuration:0}),e("Graphics",["play","icon"]).states.create("active",{stateAnimationDuration:0,draw:t=>{t.moveTo(-4,-5),t.lineTo(-1,-5),t.lineTo(-1,5),t.lineTo(-4,5),t.lineTo(-4,-5),t.moveTo(4,-5),t.lineTo(1,-5),t.lineTo(1,5),t.lineTo(4,5),t.lineTo(4,-5)}}),e("Button",["switch"]).setAll({paddingTop:4,paddingBottom:4,paddingLeft:4,paddingRight:4,ariaLabel:s.translate("Press ENTER to toggle"),toggleKey:"active",width:40,height:24,layout:null});{const t=e("RoundedRectangle",["switch","background"]);t.setAll({strokeOpacity:.5,cornerRadiusBL:100,cornerRadiusBR:100,cornerRadiusTL:100,cornerRadiusTR:100}),a(t,"fill",o,"primaryButton")}{const t=e("Circle",["switch","icon"]);t.setAll({radius:8,centerY:0,centerX:0,dx:0}),a(t,"fill",o,"primaryButtonText")}e("Graphics",["switch","icon"]).states.create("active",{dx:16}),e("Scrollbar").setAll({start:0,end:1,layer:30,animationEasing:c(u)}),e("Scrollbar",["vertical"]).setAll({marginRight:13,marginLeft:13,minWidth:12,height:r}),e("Scrollbar",["horizontal"]).setAll({marginTop:13,marginBottom:13,minHeight:12,width:r}),this.rule("Button",["scrollbar"]).setAll({exportable:!1});{const t=e("RoundedRectangle",["scrollbar","main","background"]);t.setAll({cornerRadiusTL:8,cornerRadiusBL:8,cornerRadiusTR:8,cornerRadiusBR:8,fillOpacity:.8}),a(t,"fill",o,"fill")}{const t=e("RoundedRectangle",["scrollbar","thumb"]);t.setAll({role:"slider",ariaLive:"polite",position:"absolute",draggable:!0}),a(t,"fill",o,"secondaryButton")}a(e("RoundedRectangle",["scrollbar","thumb"]).states.create("hover",{}),"fill",o,"secondaryButtonHover"),a(e("RoundedRectangle",["scrollbar","thumb"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"secondaryButtonDown"),e("RoundedRectangle",["scrollbar","thumb","vertical"]).setAll({x:n,width:r,centerX:n,ariaLabel:s.translate("Use up and down arrows to move selection")}),e("RoundedRectangle",["scrollbar","thumb","horizontal"]).setAll({y:n,centerY:n,height:r,ariaLabel:s.translate("Use left and right arrows to move selection")});{const t=e("PointedRectangle",["axis","tooltip","background"]);t.setAll({cornerRadius:0}),a(t,"fill",o,"alternativeBackground")}e("Label",["axis","tooltip"]).setAll({role:void 0}),e("Label",["axis","tooltip","y"]).setAll({textAlign:"right"}),e("Label",["axis","tooltip","y","opposite"]).setAll({textAlign:"left"}),e("Label",["axis","tooltip","x"]).setAll({textAlign:"center"}),e("Tooltip",["categoryaxis"]).setAll({labelText:"{category}"}),e("Star").setAll({spikes:5,innerRadius:5,radius:10}),e("Tooltip",["stock"]).setAll({paddingTop:6,paddingBottom:5,paddingLeft:7,paddingRight:7}),e("PointedRectangle",["tooltip","stock","axis"]).setAll({pointerLength:0,pointerBaseWidth:0,cornerRadius:3}),e("Label",["tooltip","stock"]).setAll({fontSize:"0.8em"}),e("SpriteResizer").setAll({rotationStep:10}),e("Container",["resizer","grip"]).states.create("hover",{});{const t=e("RoundedRectangle",["resizer","grip"]);t.setAll({strokeOpacity:.7,strokeWidth:1,fillOpacity:1,width:12,height:12}),a(t,"fill",o,"background"),a(t,"stroke",o,"alternativeBackground")}{const t=e("RoundedRectangle",["resizer","grip","outline"]);t.setAll({strokeOpacity:0,fillOpacity:0,width:20,height:20}),t.states.create("hover",{fillOpacity:.3}),a(t,"fill",o,"alternativeBackground")}e("RoundedRectangle",["resizer","grip","left"]).setAll({cornerRadiusBL:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusTR:0}),e("RoundedRectangle",["resizer","grip","right"]).setAll({cornerRadiusBL:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusTR:0});{const t=e("Rectangle",["resizer","rectangle"]);t.setAll({strokeDasharray:[2,2],strokeOpacity:.5,strokeWidth:1}),a(t,"stroke",o,"alternativeBackground")}e("Graphics",["button","plus","icon"]).setAll({x:n,y:n,draw:t=>{t.moveTo(-4,0),t.lineTo(4,0),t.moveTo(0,-4),t.lineTo(0,4)}}),e("Graphics",["button","minus","icon"]).setAll({x:n,y:n,draw:t=>{t.moveTo(-4,0),t.lineTo(4,0)}}),e("Graphics",["button","home","icon"]).setAll({x:n,y:n,svgPath:"M 8 -1 L 6 -1 L 6 7 L 2 7 L 2 1 L -2 1 L -2 7 L -6 7 L -6 -1 L -8 -1 L 0 -9 L 8 -1 Z M 8 -1"}),e("Button",["zoomtools"]).setAll({marginTop:1,marginBottom:2}),e("ZoomTools").setAll({x:r,centerX:r,y:r,centerY:r,paddingRight:10,paddingBottom:10})}}export{a as l,A as s}; diff --git a/assets/DeleteForwardEditsParameters-CpBjKiOL.js b/assets/DeleteForwardEditsParameters-dCKYoO-P.js similarity index 73% rename from assets/DeleteForwardEditsParameters-CpBjKiOL.js rename to assets/DeleteForwardEditsParameters-dCKYoO-P.js index a21f22d..216bb60 100644 --- a/assets/DeleteForwardEditsParameters-CpBjKiOL.js +++ b/assets/DeleteForwardEditsParameters-dCKYoO-P.js @@ -1 +1 @@ -import{d as s,y as r,f as n,aU as a,er as m}from"./index-CEWggaxV.js";var o;let t=o=class extends a{static from(e){return m(o,e)}constructor(e){super(e),this.sessionId=void 0,this.moment=null}};s([r({type:String,json:{write:!0}})],t.prototype,"sessionId",void 0),s([r({type:Date,json:{type:Number,write:{writer:(e,i)=>{i.moment=e?e.getTime():null}}}})],t.prototype,"moment",void 0),t=o=s([n("esri.rest.versionManagement.gdbVersion.support.PostParameters")],t);const d=t;export{d as default}; +import{d as s,y as r,f as n,aU as a,er as m}from"./index-BjUNJPVf.js";var o;let t=o=class extends a{static from(e){return m(o,e)}constructor(e){super(e),this.sessionId=void 0,this.moment=null}};s([r({type:String,json:{write:!0}})],t.prototype,"sessionId",void 0),s([r({type:Date,json:{type:Number,write:{writer:(e,i)=>{i.moment=e?e.getTime():null}}}})],t.prototype,"moment",void 0),t=o=s([n("esri.rest.versionManagement.gdbVersion.support.PostParameters")],t);const d=t;export{d as default}; diff --git a/assets/DimensionLayer-CS8-5O4l.js b/assets/DimensionLayer-CKhQnsO-.js similarity index 98% rename from assets/DimensionLayer-CS8-5O4l.js rename to assets/DimensionLayer-CKhQnsO-.js index 56c5fd1..37a23a2 100644 --- a/assets/DimensionLayer-CS8-5O4l.js +++ b/assets/DimensionLayer-CKhQnsO-.js @@ -1 +1 @@ -import{dm as P,a9 as d,d as t,y as n,dS as h,f0 as w,bg as q,f as m,hO as R,aA as v,e1 as D,hP as S,hQ as z,V as N,x as E,g as $,fJ as j,w as T,hR as A,aE as x,dp as k,dr as C,aR as L,bT as _}from"./index-CEWggaxV.js";import{c as H}from"./Analysis-DeH3QoWt.js";let r=class extends P(R){constructor(e){super(e),this.type="simple",this.color=new d("black"),this.lineSize=2,this.fontSize=10,this.textColor=new d("black"),this.textBackgroundColor=new d([255,255,255,.6])}};t([n({type:["simple"],readOnly:!0,json:{write:{isRequired:!0}}})],r.prototype,"type",void 0),t([n({type:d,nonNullable:!0,json:{type:[h],write:{isRequired:!0}}})],r.prototype,"color",void 0),t([n({type:Number,cast:w,nonNullable:!0,range:{min:q(1)},json:{write:{isRequired:!0}}})],r.prototype,"lineSize",void 0),t([n({type:Number,cast:w,nonNullable:!0,json:{write:{isRequired:!0}}})],r.prototype,"fontSize",void 0),t([n({type:d,nonNullable:!0,json:{type:[h],write:{isRequired:!0}}})],r.prototype,"textColor",void 0),t([n({type:d,nonNullable:!0,json:{type:[h],write:{isRequired:!0}}})],r.prototype,"textBackgroundColor",void 0),r=t([m("esri.analysis.DimensionSimpleStyle")],r);const g=r;var y;(function(e){e.Horizontal="horizontal",e.Vertical="vertical",e.Direct="direct"})(y||(y={}));const M=[y.Horizontal,y.Vertical,y.Direct];let l=class extends P(R){constructor(e){super(e),this.type="length",this.startPoint=null,this.endPoint=null,this.measureType=y.Direct,this.offset=0,this.orientation=0}};t([n({type:["length"],json:{write:{isRequired:!0}}})],l.prototype,"type",void 0),t([n({type:v,json:{write:!0}})],l.prototype,"startPoint",void 0),t([n({type:v,json:{write:!0}})],l.prototype,"endPoint",void 0),t([n({type:M,nonNullable:!0,json:{write:{isRequired:!0}}})],l.prototype,"measureType",void 0),t([n({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],l.prototype,"offset",void 0),t([n({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),D(e=>S.normalize(z(e),0,!0))],l.prototype,"orientation",void 0),l=t([m("esri.analysis.LengthDimension")],l);const O=l,f=N.ofType(O);let a=class extends H{constructor(e){super(e),this.type="dimension",this.style=new g,this.extent=null}initialize(){this.addHandles($(()=>this._computeExtent(),e=>{(e==null?void 0:e.pending)==null&&this._set("extent",e!=null?e.extent:null)},j))}get dimensions(){return this._get("dimensions")||new f}set dimensions(e){this._set("dimensions",T(e,this.dimensions,f))}get spatialReference(){for(const e of this.dimensions){if(e.startPoint!=null)return e.startPoint.spatialReference;if(e.endPoint!=null)return e.endPoint.spatialReference}return null}get requiredPropertiesForEditing(){return this.dimensions.reduce((e,i)=>(e.push(i.startPoint,i.endPoint),e),[])}async waitComputeExtent(){const e=this._computeExtent();return e!=null?e.pending:Promise.resolve()}_computeExtent(){const e=this.spatialReference;if(e==null)return{pending:null,extent:null};const i=[];for(const o of this.dimensions)o.startPoint!=null&&i.push(o.startPoint),o.endPoint!=null&&i.push(o.endPoint);const p=A(i,e);if(p.pending!=null)return{pending:p.pending,extent:null};let c=null;return p.geometries!=null&&(c=p.geometries.reduce((o,u)=>o==null?u!=null?x.fromPoint(u):null:u!=null?o.union(x.fromPoint(u)):o,null)),{pending:null,extent:c}}clear(){this.dimensions.removeAll()}};t([n({type:["dimension"]})],a.prototype,"type",void 0),t([n({cast:E,type:f,nonNullable:!0})],a.prototype,"dimensions",null),t([n({readOnly:!0})],a.prototype,"spatialReference",null),t([n({types:{key:"type",base:null,typeMap:{simple:g}},nonNullable:!0})],a.prototype,"style",void 0),t([n({value:null,readOnly:!0})],a.prototype,"extent",void 0),t([n({readOnly:!0})],a.prototype,"requiredPropertiesForEditing",null),a=t([m("esri.analysis.DimensionAnalysis")],a);const b=a;let s=class extends k(C(_)){constructor(e){if(super(e),this.type="dimension",this.operationalLayerType="ArcGISDimensionLayer",this.source=new b,this.opacity=1,e){const{source:i,style:p}=e;i&&p&&(i.style=p)}}initialize(){this.addHandles([$(()=>this.source,(e,i)=>{i!=null&&i.parent===this&&(i.parent=null),e!=null&&(e.parent=this)},j)])}async load(){return this.addResolvingPromise(this.source.waitComputeExtent()),this}get spatialReference(){return this.source.spatialReference}get style(){return this.source.style}set style(e){this.source.style=e}get fullExtent(){return this.source.extent}releaseAnalysis(e){this.source===e&&(this.source=new b)}get analysis(){return this.source}set analysis(e){this.source=e}get dimensions(){return this.source.dimensions}set dimensions(e){this.source.dimensions=e}writeDimensions(e,i,p,c){i.dimensions=e.filter(({startPoint:o,endPoint:u})=>o!=null&&u!=null).map(o=>o.toJSON(c)).toJSON()}};t([n({json:{read:!1},readOnly:!0})],s.prototype,"type",void 0),t([n({type:["ArcGISDimensionLayer"]})],s.prototype,"operationalLayerType",void 0),t([n({nonNullable:!0})],s.prototype,"source",void 0),t([n({readOnly:!0})],s.prototype,"spatialReference",null),t([n({types:{key:"type",base:null,typeMap:{simple:g}},json:{write:{ignoreOrigin:!0}}})],s.prototype,"style",null),t([n({readOnly:!0})],s.prototype,"fullExtent",null),t([n({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],s.prototype,"opacity",void 0),t([n({type:["show","hide"]})],s.prototype,"listMode",void 0),t([n({type:N.ofType(O),json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{ignoreOrigin:!0}}}}})],s.prototype,"dimensions",null),t([L("web-scene","dimensions")],s.prototype,"writeDimensions",null),s=t([m("esri.layers.DimensionLayer")],s);const B=s;export{B as default}; +import{dm as P,a9 as d,d as t,y as n,dS as h,f0 as w,bg as q,f as m,hO as R,aA as v,e1 as D,hP as S,hQ as z,V as N,x as E,g as $,fJ as j,w as T,hR as A,aE as x,dp as k,dr as C,aR as L,bT as _}from"./index-BjUNJPVf.js";import{c as H}from"./Analysis-yEzECn2p.js";let r=class extends P(R){constructor(e){super(e),this.type="simple",this.color=new d("black"),this.lineSize=2,this.fontSize=10,this.textColor=new d("black"),this.textBackgroundColor=new d([255,255,255,.6])}};t([n({type:["simple"],readOnly:!0,json:{write:{isRequired:!0}}})],r.prototype,"type",void 0),t([n({type:d,nonNullable:!0,json:{type:[h],write:{isRequired:!0}}})],r.prototype,"color",void 0),t([n({type:Number,cast:w,nonNullable:!0,range:{min:q(1)},json:{write:{isRequired:!0}}})],r.prototype,"lineSize",void 0),t([n({type:Number,cast:w,nonNullable:!0,json:{write:{isRequired:!0}}})],r.prototype,"fontSize",void 0),t([n({type:d,nonNullable:!0,json:{type:[h],write:{isRequired:!0}}})],r.prototype,"textColor",void 0),t([n({type:d,nonNullable:!0,json:{type:[h],write:{isRequired:!0}}})],r.prototype,"textBackgroundColor",void 0),r=t([m("esri.analysis.DimensionSimpleStyle")],r);const g=r;var y;(function(e){e.Horizontal="horizontal",e.Vertical="vertical",e.Direct="direct"})(y||(y={}));const M=[y.Horizontal,y.Vertical,y.Direct];let l=class extends P(R){constructor(e){super(e),this.type="length",this.startPoint=null,this.endPoint=null,this.measureType=y.Direct,this.offset=0,this.orientation=0}};t([n({type:["length"],json:{write:{isRequired:!0}}})],l.prototype,"type",void 0),t([n({type:v,json:{write:!0}})],l.prototype,"startPoint",void 0),t([n({type:v,json:{write:!0}})],l.prototype,"endPoint",void 0),t([n({type:M,nonNullable:!0,json:{write:{isRequired:!0}}})],l.prototype,"measureType",void 0),t([n({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],l.prototype,"offset",void 0),t([n({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),D(e=>S.normalize(z(e),0,!0))],l.prototype,"orientation",void 0),l=t([m("esri.analysis.LengthDimension")],l);const O=l,f=N.ofType(O);let a=class extends H{constructor(e){super(e),this.type="dimension",this.style=new g,this.extent=null}initialize(){this.addHandles($(()=>this._computeExtent(),e=>{(e==null?void 0:e.pending)==null&&this._set("extent",e!=null?e.extent:null)},j))}get dimensions(){return this._get("dimensions")||new f}set dimensions(e){this._set("dimensions",T(e,this.dimensions,f))}get spatialReference(){for(const e of this.dimensions){if(e.startPoint!=null)return e.startPoint.spatialReference;if(e.endPoint!=null)return e.endPoint.spatialReference}return null}get requiredPropertiesForEditing(){return this.dimensions.reduce((e,i)=>(e.push(i.startPoint,i.endPoint),e),[])}async waitComputeExtent(){const e=this._computeExtent();return e!=null?e.pending:Promise.resolve()}_computeExtent(){const e=this.spatialReference;if(e==null)return{pending:null,extent:null};const i=[];for(const o of this.dimensions)o.startPoint!=null&&i.push(o.startPoint),o.endPoint!=null&&i.push(o.endPoint);const p=A(i,e);if(p.pending!=null)return{pending:p.pending,extent:null};let c=null;return p.geometries!=null&&(c=p.geometries.reduce((o,u)=>o==null?u!=null?x.fromPoint(u):null:u!=null?o.union(x.fromPoint(u)):o,null)),{pending:null,extent:c}}clear(){this.dimensions.removeAll()}};t([n({type:["dimension"]})],a.prototype,"type",void 0),t([n({cast:E,type:f,nonNullable:!0})],a.prototype,"dimensions",null),t([n({readOnly:!0})],a.prototype,"spatialReference",null),t([n({types:{key:"type",base:null,typeMap:{simple:g}},nonNullable:!0})],a.prototype,"style",void 0),t([n({value:null,readOnly:!0})],a.prototype,"extent",void 0),t([n({readOnly:!0})],a.prototype,"requiredPropertiesForEditing",null),a=t([m("esri.analysis.DimensionAnalysis")],a);const b=a;let s=class extends k(C(_)){constructor(e){if(super(e),this.type="dimension",this.operationalLayerType="ArcGISDimensionLayer",this.source=new b,this.opacity=1,e){const{source:i,style:p}=e;i&&p&&(i.style=p)}}initialize(){this.addHandles([$(()=>this.source,(e,i)=>{i!=null&&i.parent===this&&(i.parent=null),e!=null&&(e.parent=this)},j)])}async load(){return this.addResolvingPromise(this.source.waitComputeExtent()),this}get spatialReference(){return this.source.spatialReference}get style(){return this.source.style}set style(e){this.source.style=e}get fullExtent(){return this.source.extent}releaseAnalysis(e){this.source===e&&(this.source=new b)}get analysis(){return this.source}set analysis(e){this.source=e}get dimensions(){return this.source.dimensions}set dimensions(e){this.source.dimensions=e}writeDimensions(e,i,p,c){i.dimensions=e.filter(({startPoint:o,endPoint:u})=>o!=null&&u!=null).map(o=>o.toJSON(c)).toJSON()}};t([n({json:{read:!1},readOnly:!0})],s.prototype,"type",void 0),t([n({type:["ArcGISDimensionLayer"]})],s.prototype,"operationalLayerType",void 0),t([n({nonNullable:!0})],s.prototype,"source",void 0),t([n({readOnly:!0})],s.prototype,"spatialReference",null),t([n({types:{key:"type",base:null,typeMap:{simple:g}},json:{write:{ignoreOrigin:!0}}})],s.prototype,"style",null),t([n({readOnly:!0})],s.prototype,"fullExtent",null),t([n({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],s.prototype,"opacity",void 0),t([n({type:["show","hide"]})],s.prototype,"listMode",void 0),t([n({type:N.ofType(O),json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{ignoreOrigin:!0}}}}})],s.prototype,"dimensions",null),t([L("web-scene","dimensions")],s.prototype,"writeDimensions",null),s=t([m("esri.layers.DimensionLayer")],s);const B=s;export{B as default}; diff --git a/assets/DoubleArray-DxyNBrRi.js b/assets/DoubleArray--0pYeNcV.js similarity index 86% rename from assets/DoubleArray-DxyNBrRi.js rename to assets/DoubleArray--0pYeNcV.js index a0c2b0a..5f301b9 100644 --- a/assets/DoubleArray-DxyNBrRi.js +++ b/assets/DoubleArray--0pYeNcV.js @@ -1 +1 @@ -import{ch as t,cg as n}from"./index-CEWggaxV.js";function y(r,a=!1){return r<=t?a?new Array(r).fill(0):new Array(r):new Float64Array(r)}function u(r){return(n(r)?r.length:r.byteLength/8)<=t?Array.from(r):new Float64Array(r)}function i(r,a,e){return Array.isArray(r)?r.slice(a,a+e):r.subarray(a,a+e)}function A(r,a){for(let e=0;enull,write:()=>{},trim:()=>null};export{B as default}; +import{I as f}from"./InterleavedLayout-Cinhb-cY.js";import{f as d,u as c,a as u,I as p,d as g,m as h}from"./edgeProcessing-Dg7MHcWM.js";import"./BufferView-3om6S_aJ.js";import"./index-BjUNJPVf.js";import"./types-D0PSWh4d.js";import"./Util-CS5u4Lec.js";import"./deduplicate-BR6i8Xk0.js";import"./Indices-BRm9v2lM.js";import"./VertexAttribute-BlT9lbVY.js";function a(t,e){return e.push(t.buffer),{buffer:t.buffer,layout:new f(t.layout)}}class B{async extract(e){const i=o(e),n=d(i),s=[i.data.buffer];return{result:m(n,s),transferList:s}}async extractComponentsEdgeLocations(e){const i=o(e),n=c(i.data,i.skipDeduplicate,i.indices,i.indicesLength),s=u(n,L,l),r=[];return{result:a(s.regular.instancesData,r),transferList:r}}async extractEdgeLocations(e){const i=o(e),n=c(i.data,i.skipDeduplicate,i.indices,i.indicesLength),s=u(n,I,l),r=[];return{result:a(s.regular.instancesData,r),transferList:r}}}function o(t){return{data:p.createView(t.dataBuffer),indices:t.indicesType==="Uint32Array"?new Uint32Array(t.indices):t.indicesType==="Uint16Array"?new Uint16Array(t.indices):t.indices,indicesLength:t.indicesLength,writerSettings:t.writerSettings,skipDeduplicate:t.skipDeduplicate}}function m(t,e){return e.push(t.regular.lodInfo.lengths.buffer),e.push(t.silhouette.lodInfo.lengths.buffer),{regular:{instancesData:a(t.regular.instancesData,e),lodInfo:{lengths:t.regular.lodInfo.lengths.buffer}},silhouette:{instancesData:a(t.silhouette.instancesData,e),lodInfo:{lengths:t.silhouette.lodInfo.lengths.buffer}},averageEdgeLength:t.averageEdgeLength}}class w{allocate(e){return g.createBuffer(e)}trim(e,i){return e.slice(0,i)}write(e,i,n){e.position0.setVec(i,n.position0),e.position1.setVec(i,n.position1)}}class y{allocate(e){return h.createBuffer(e)}trim(e,i){return e.slice(0,i)}write(e,i,n){e.position0.setVec(i,n.position0),e.position1.setVec(i,n.position1),e.componentIndex.set(i,n.componentIndex)}}const I=new w,L=new y,l={allocate:()=>null,write:()=>{},trim:()=>null};export{B as default}; diff --git a/assets/EditBusLayer-SG7oYwiY.js b/assets/EditBusLayer-OslMX9fF.js similarity index 91% rename from assets/EditBusLayer-SG7oYwiY.js rename to assets/EditBusLayer-OslMX9fF.js index 01b8ee9..a58c0f2 100644 --- a/assets/EditBusLayer-SG7oYwiY.js +++ b/assets/EditBusLayer-OslMX9fF.js @@ -1,7 +1,7 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/deleteForwardEdits-CDZbz35M.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css","assets/DeleteForwardEditsParameters-CpBjKiOL.js"] + __vite__mapDeps.viteFileDeps = ["assets/deleteForwardEdits-DOePzMev.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css","assets/DeleteForwardEditsParameters-dCKYoO-P.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{eT as R,M as T,_ as V,ca as H,d as U,f as x,df as k,aV as p}from"./index-CEWggaxV.js";const P=R(),j=new Map,w=new Map;async function B(e,i,d){if(!e||!d)return!1;if(!i)return!0;const r=new URL(e).host;let t=j.get(r);if(!t){const n=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,"");t=(await T(n,{responseType:"json",query:{f:"json"}})).data.defaultVersionName}return t===i}async function N(e,i,d=!1){var n,a;if(!e||!i)return!0;const r=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),t=(n=w.get(r))==null?void 0:n.entries();if(t){for(const[l,c]of t)if(c.name===i){const u=!((a=c.stack)!=null&&a.hasForwardEdits());if(!u&&d){const[{deleteForwardEdits:m},{default:h}]=await Promise.all([V(()=>import("./deleteForwardEdits-CDZbz35M.js"),__vite__mapDeps([0,1,2])),V(()=>import("./DeleteForwardEditsParameters-CpBjKiOL.js"),__vite__mapDeps([3,1,2]))]);return m(r,l,new h({sessionId:P,moment:c.moment}))}return u}}return!0}function D(e,i){var t;if(!e)return!1;const d=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),r=(t=w.get(d))==null?void 0:t.entries();if(r){for(const[n,a]of r)if(a.name===i)return a.lockType==="edit"}return!1}const g=new H.EventEmitter;function O(e){return g.on("apply-edits",new WeakRef(e))}function W(e){return g.on("update-moment",new WeakRef(e))}function z(e,i,d=null,r=!1){const t=k();return r=i==null||r,g.emit("apply-edits",{serviceUrl:e,layerId:i,gdbVersion:d,mayReceiveServiceEdits:r,result:t.promise}),t}const E="esri.layers.mixins.EditBusLayer",$=Symbol(E);function C(e){return e!=null&&typeof e=="object"&&$ in e}function f(e){return e!=null&&typeof e=="object"&&"gdbVersion"in e}function b(e,i,d){const r=new URL(e).host,t=j.get(r),n=a=>!a||a===t;return n(i)&&n(d)||i===d}const G=e=>{var i;let d=class extends e{constructor(...r){super(...r),this[i]=!0,this._applyEditsHandler=t=>{const{serviceUrl:n,layerId:a,gdbVersion:l,mayReceiveServiceEdits:c,result:u}=t,m=n===this.url,h=a!=null&&this.layerId!=null&&a===this.layerId,A=f(this),S=f(this)&&b(n,l,this.gdbVersion);if(!m||A&&!S||!h&&!c)return;const L=u.then(s=>{var y;if(h&&(s.addedFeatures.length||s.updatedFeatures.length||s.deletedFeatures.length||s.addedAttachments.length||s.updatedAttachments.length||s.deletedAttachments.length))return this.emit("edits",p(s)),s;const I=(y=s.editedFeatures)==null?void 0:y.find(({layerId:F})=>F===this.layerId);if(I){const{adds:F,updates:M,deletes:v}=I.editedFeatures,_={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:F?F.map(({attributes:o})=>({objectId:this.objectIdField&&o[this.objectIdField],globalId:this.globalIdField&&o[this.globalIdField]})):[],deletedFeatures:v?v.map(({attributes:o})=>({objectId:this.objectIdField&&o[this.objectIdField],globalId:this.globalIdField&&o[this.globalIdField]})):[],updatedFeatures:M?M.map(({current:{attributes:o}})=>({objectId:this.objectIdField&&o[this.objectIdField],globalId:this.globalIdField&&o[this.globalIdField]})):[],editedFeatures:p(s.editedFeatures),exceededTransferLimit:!1,historicMoment:p(s.historicMoment)};return this.emit("edits",_),_}return{edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:p(s.editedFeatures),exceededTransferLimit:!1,historicMoment:p(s.historicMoment)}}).then(s=>("historicMoment"in this&&this.historicMoment!==s.historicMoment&&D(n,l)&&(this.historicMoment=s.historicMoment),s));this.emit("apply-edits",{result:L})},this._updateMomentHandler=t=>{const{serviceUrl:n,gdbVersion:a,moment:l}=t,c=n===this.url,u=f(this),m=f(this)&&b(n,a,this.gdbVersion),h=f(this)&&!b(n,this.gdbVersion,null);c&&u&&m&&h&&"historicMoment"in this&&this.historicMoment!==l&&(this.historicMoment=l)},this.when().then(()=>{this.addHandles(O(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(W(this._updateMomentHandler))},()=>{})}};return i=$,d=U([x(E)],d),d};export{G as F,B as a,D as c,z as h,N as i,C as p,P as t}; +import{eT as R,M as T,_ as V,ca as H,d as U,f as x,df as k,aV as p}from"./index-BjUNJPVf.js";const P=R(),j=new Map,w=new Map;async function B(e,i,d){if(!e||!d)return!1;if(!i)return!0;const r=new URL(e).host;let t=j.get(r);if(!t){const n=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,"");t=(await T(n,{responseType:"json",query:{f:"json"}})).data.defaultVersionName}return t===i}async function N(e,i,d=!1){var n,a;if(!e||!i)return!0;const r=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),t=(n=w.get(r))==null?void 0:n.entries();if(t){for(const[l,c]of t)if(c.name===i){const u=!((a=c.stack)!=null&&a.hasForwardEdits());if(!u&&d){const[{deleteForwardEdits:m},{default:h}]=await Promise.all([V(()=>import("./deleteForwardEdits-DOePzMev.js"),__vite__mapDeps([0,1,2])),V(()=>import("./DeleteForwardEditsParameters-dCKYoO-P.js"),__vite__mapDeps([3,1,2]))]);return m(r,l,new h({sessionId:P,moment:c.moment}))}return u}}return!0}function D(e,i){var t;if(!e)return!1;const d=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),r=(t=w.get(d))==null?void 0:t.entries();if(r){for(const[n,a]of r)if(a.name===i)return a.lockType==="edit"}return!1}const g=new H.EventEmitter;function O(e){return g.on("apply-edits",new WeakRef(e))}function W(e){return g.on("update-moment",new WeakRef(e))}function z(e,i,d=null,r=!1){const t=k();return r=i==null||r,g.emit("apply-edits",{serviceUrl:e,layerId:i,gdbVersion:d,mayReceiveServiceEdits:r,result:t.promise}),t}const E="esri.layers.mixins.EditBusLayer",$=Symbol(E);function C(e){return e!=null&&typeof e=="object"&&$ in e}function f(e){return e!=null&&typeof e=="object"&&"gdbVersion"in e}function b(e,i,d){const r=new URL(e).host,t=j.get(r),n=a=>!a||a===t;return n(i)&&n(d)||i===d}const G=e=>{var i;let d=class extends e{constructor(...r){super(...r),this[i]=!0,this._applyEditsHandler=t=>{const{serviceUrl:n,layerId:a,gdbVersion:l,mayReceiveServiceEdits:c,result:u}=t,m=n===this.url,h=a!=null&&this.layerId!=null&&a===this.layerId,A=f(this),S=f(this)&&b(n,l,this.gdbVersion);if(!m||A&&!S||!h&&!c)return;const L=u.then(s=>{var y;if(h&&(s.addedFeatures.length||s.updatedFeatures.length||s.deletedFeatures.length||s.addedAttachments.length||s.updatedAttachments.length||s.deletedAttachments.length))return this.emit("edits",p(s)),s;const I=(y=s.editedFeatures)==null?void 0:y.find(({layerId:F})=>F===this.layerId);if(I){const{adds:F,updates:M,deletes:v}=I.editedFeatures,_={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:F?F.map(({attributes:o})=>({objectId:this.objectIdField&&o[this.objectIdField],globalId:this.globalIdField&&o[this.globalIdField]})):[],deletedFeatures:v?v.map(({attributes:o})=>({objectId:this.objectIdField&&o[this.objectIdField],globalId:this.globalIdField&&o[this.globalIdField]})):[],updatedFeatures:M?M.map(({current:{attributes:o}})=>({objectId:this.objectIdField&&o[this.objectIdField],globalId:this.globalIdField&&o[this.globalIdField]})):[],editedFeatures:p(s.editedFeatures),exceededTransferLimit:!1,historicMoment:p(s.historicMoment)};return this.emit("edits",_),_}return{edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:p(s.editedFeatures),exceededTransferLimit:!1,historicMoment:p(s.historicMoment)}}).then(s=>("historicMoment"in this&&this.historicMoment!==s.historicMoment&&D(n,l)&&(this.historicMoment=s.historicMoment),s));this.emit("apply-edits",{result:L})},this._updateMomentHandler=t=>{const{serviceUrl:n,gdbVersion:a,moment:l}=t,c=n===this.url,u=f(this),m=f(this)&&b(n,a,this.gdbVersion),h=f(this)&&!b(n,this.gdbVersion,null);c&&u&&m&&h&&"historicMoment"in this&&this.historicMoment!==l&&(this.historicMoment=l)},this.when().then(()=>{this.addHandles(O(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(W(this._updateMomentHandler))},()=>{})}};return i=$,d=U([x(E)],d),d};export{G as F,B as a,D as c,z as h,N as i,C as p,P as t}; diff --git a/assets/ElevationLayer-D3CeIkQP.js b/assets/ElevationLayer-QYZSSLWB.js similarity index 95% rename from assets/ElevationLayer-D3CeIkQP.js rename to assets/ElevationLayer-QYZSSLWB.js index 53d66eb..1b144c2 100644 --- a/assets/ElevationLayer-D3CeIkQP.js +++ b/assets/ElevationLayer-QYZSSLWB.js @@ -1,7 +1,7 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/ElevationQuery-BFZ9QB_a.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css"] + __vite__mapDeps.viteFileDeps = ["assets/ElevationQuery-DphYPRnK.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{ec as g,s as f,e as w,hp as b,at as p,d$ as V,dM as T,dp as D,dq as S,dr as $,hq as L,N as x,ay as k,M as c,e0 as I,_ as y,d as o,y as l,aZ as _,g_ as M,du as N,f as E,bT as O}from"./index-CEWggaxV.js";class j{constructor(e,t,i,a){this._hasNoDataValues=null,this._minValue=null,this._maxValue=null,"pixelData"in e?(this.values=e.pixelData,this.width=e.width,this.height=e.height,this.noDataValue=e.noDataValue):(this.values=e,this.width=t,this.height=i,this.noDataValue=a)}get hasNoDataValues(){if(this._hasNoDataValues==null){const e=this.noDataValue;this._hasNoDataValues=this.values.includes(e)}return this._hasNoDataValues}get minValue(){return this._ensureBounds(),this._minValue}get maxValue(){return this._ensureBounds(),this._maxValue}_ensureBounds(){if(this._minValue!=null)return;const{noDataValue:e,values:t}=this;let i=1/0,a=-1/0,h=!0;for(const n of t)n===e?this._hasNoDataValues=!0:(i=na?n:a,h=!1);h?(this._minValue=0,this._maxValue=0):(this._minValue=i,this._maxValue=a>-3e38?a:0)}}class P{constructor(e,t,i,a,h={}){this._mainMethod=t,this._transferLists=i,this._listeners=[],this._promise=g(e,{...h,schedule:a}).then(n=>{if(this._thread===void 0){this._thread=n,this._promise=null,h.hasInitialize&&this.broadcast({},"initialize");for(const d of this._listeners)this._connectListener(d)}else n.close()}),this._promise.catch(n=>f.getLogger("esri.core.workers.WorkerHandle").error(`Failed to initialize ${e} worker: ${n}`))}on(e,t){const i={removed:!1,eventName:e,callback:t,threadHandle:null};return this._listeners.push(i),this._connectListener(i),w(()=>{i.removed=!0,b(this._listeners,i),this._thread&&i.threadHandle!=null&&i.threadHandle.remove()})}destroy(){this._thread&&(this._thread.close(),this._thread=null),this._promise=null,this._listeners.length=0,this._transferLists={}}invoke(e,t){return this.invokeMethod(this._mainMethod,e,t)}invokeMethod(e,t,i){if(this._thread){const a=this._transferLists[e],h=a?a(t):[];return this._thread.invoke(e,t,{transferList:h,signal:i})}return this._promise?this._promise.then(()=>(p(i),this.invokeMethod(e,t,i))):Promise.reject(null)}broadcast(e,t){return this._thread?Promise.all(this._thread.broadcast(t,e)).then(()=>{}):this._promise?this._promise.then(()=>this.broadcast(e,t)):Promise.reject()}get promise(){return this._promise}_connectListener(e){this._thread&&this._thread.on(e.eventName,e.callback).then(t=>{e.removed||(e.threadHandle=t)})}}class v extends P{constructor(e=null){super("LercWorker","_decode",{_decode:t=>[t.buffer]},e,{strategy:"dedicated"}),this.schedule=e,this.ref=0}decode(e,t,i){return e&&e.byteLength!==0?this.invoke({buffer:e,options:t},i):Promise.resolve(null)}release(){--this.ref<=0&&(u.forEach((e,t)=>{e===this&&u.delete(t)}),this.destroy())}}const u=new Map;function A(s=null){let e=u.get(s);return e||(s!=null?(e=new v(t=>s.immediate.schedule(t)),u.set(s,e)):(e=new v,u.set(null,e))),++e.ref,e}let r=class extends V(T(D(S($(O))))){constructor(...s){super(...s),this.capabilities={operations:{supportsTileMap:!1}},this.copyright=null,this.heightModelInfo=null,this.path=null,this.minScale=void 0,this.maxScale=void 0,this.opacity=1,this.operationalLayerType="ArcGISTiledElevationServiceLayer",this.sourceJSON=null,this.type="elevation",this.url=null,this.version=null,this._lercDecoder=A()}normalizeCtorArgs(s,e){return typeof s=="string"?{url:s,...e}:s}destroy(){this._lercDecoder=L(this._lercDecoder)}readCapabilities(s,e){const t=e.capabilities&&e.capabilities.split(",").map(i=>i.toLowerCase().trim());return t?{operations:{supportsTileMap:t.includes("tilemap")}}:{operations:{supportsTileMap:!1}}}readVersion(s,e){let t=e.currentVersion;return t||(t=9.3),t}load(s){const e=s!=null?s.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"],supportsData:!1,validateItem:t=>{if(t.typeKeywords){for(let i=0;ithis._fetchImageService(e))),Promise.resolve(this)}fetchTile(s,e,t,i){const a=(i=i||{signal:null}).signal!=null?i.signal:i.signal=new AbortController().signal,h={responseType:"array-buffer",signal:a},n={noDataValue:i.noDataValue,returnFileInfo:!0};return this.load().then(()=>this._fetchTileAvailability(s,e,t,i)).then(()=>c(this.getTileUrl(s,e,t),h)).then(d=>this._lercDecoder.decode(d.data,n,a)).then(d=>new j(d))}getTileUrl(s,e,t){const i=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,a=I({...this.parsedUrl.query,blankTile:!i&&null});return`${this.parsedUrl.path}/tile/${s}/${e}/${t}${a?"?"+a:""}`}async queryElevation(s,e){const{ElevationQuery:t}=await y(()=>import("./ElevationQuery-BFZ9QB_a.js"),__vite__mapDeps([0,1,2]));return p(e),new t().query(this,s,e)}async createElevationSampler(s,e){const{ElevationQuery:t}=await y(()=>import("./ElevationQuery-BFZ9QB_a.js"),__vite__mapDeps([0,1,2]));return p(e),new t().createSampler(this,s,e)}_fetchTileAvailability(s,e,t,i){return this.tilemapCache?this.tilemapCache.fetchAvailability(s,e,t,i):Promise.resolve("unknown")}async _fetchImageService(s){var i;if(this.sourceJSON)return this.sourceJSON;const e={query:{f:"json",...this.parsedUrl.query},responseType:"json",signal:s},t=await c(this.parsedUrl.path,e);t.ssl&&(this.url=(i=this.url)==null?void 0:i.replace(/^http:/i,"https:")),this.sourceJSON=t.data,this.read(t.data,{origin:"service",url:this.parsedUrl})}get hasOverriddenFetchTile(){return!this.fetchTile[m]}};o([l({readOnly:!0})],r.prototype,"capabilities",void 0),o([_("service","capabilities",["capabilities"])],r.prototype,"readCapabilities",null),o([l({json:{read:{source:"copyrightText"}}})],r.prototype,"copyright",void 0),o([l({readOnly:!0,type:M})],r.prototype,"heightModelInfo",void 0),o([l({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],r.prototype,"path",void 0),o([l({type:["show","hide"]})],r.prototype,"listMode",void 0),o([l({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],r.prototype,"minScale",void 0),o([l({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],r.prototype,"maxScale",void 0),o([l({json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],r.prototype,"opacity",void 0),o([l({type:["ArcGISTiledElevationServiceLayer"]})],r.prototype,"operationalLayerType",void 0),o([l()],r.prototype,"sourceJSON",void 0),o([l({json:{read:!1},value:"elevation",readOnly:!0})],r.prototype,"type",void 0),o([l(N)],r.prototype,"url",void 0),o([l()],r.prototype,"version",void 0),o([_("version",["currentVersion"])],r.prototype,"readVersion",null),r=o([E("esri.layers.ElevationLayer")],r);const m=Symbol("default-fetch-tile");r.prototype.fetchTile[m]=!0;const U=r;export{U as default}; +import{ec as g,s as f,e as w,hp as b,at as p,d$ as V,dM as T,dp as D,dq as S,dr as $,hq as L,N as x,ay as k,M as c,e0 as I,_ as y,d as o,y as l,aZ as _,g_ as M,du as N,f as E,bT as O}from"./index-BjUNJPVf.js";class j{constructor(e,t,i,a){this._hasNoDataValues=null,this._minValue=null,this._maxValue=null,"pixelData"in e?(this.values=e.pixelData,this.width=e.width,this.height=e.height,this.noDataValue=e.noDataValue):(this.values=e,this.width=t,this.height=i,this.noDataValue=a)}get hasNoDataValues(){if(this._hasNoDataValues==null){const e=this.noDataValue;this._hasNoDataValues=this.values.includes(e)}return this._hasNoDataValues}get minValue(){return this._ensureBounds(),this._minValue}get maxValue(){return this._ensureBounds(),this._maxValue}_ensureBounds(){if(this._minValue!=null)return;const{noDataValue:e,values:t}=this;let i=1/0,a=-1/0,h=!0;for(const n of t)n===e?this._hasNoDataValues=!0:(i=na?n:a,h=!1);h?(this._minValue=0,this._maxValue=0):(this._minValue=i,this._maxValue=a>-3e38?a:0)}}class P{constructor(e,t,i,a,h={}){this._mainMethod=t,this._transferLists=i,this._listeners=[],this._promise=g(e,{...h,schedule:a}).then(n=>{if(this._thread===void 0){this._thread=n,this._promise=null,h.hasInitialize&&this.broadcast({},"initialize");for(const d of this._listeners)this._connectListener(d)}else n.close()}),this._promise.catch(n=>f.getLogger("esri.core.workers.WorkerHandle").error(`Failed to initialize ${e} worker: ${n}`))}on(e,t){const i={removed:!1,eventName:e,callback:t,threadHandle:null};return this._listeners.push(i),this._connectListener(i),w(()=>{i.removed=!0,b(this._listeners,i),this._thread&&i.threadHandle!=null&&i.threadHandle.remove()})}destroy(){this._thread&&(this._thread.close(),this._thread=null),this._promise=null,this._listeners.length=0,this._transferLists={}}invoke(e,t){return this.invokeMethod(this._mainMethod,e,t)}invokeMethod(e,t,i){if(this._thread){const a=this._transferLists[e],h=a?a(t):[];return this._thread.invoke(e,t,{transferList:h,signal:i})}return this._promise?this._promise.then(()=>(p(i),this.invokeMethod(e,t,i))):Promise.reject(null)}broadcast(e,t){return this._thread?Promise.all(this._thread.broadcast(t,e)).then(()=>{}):this._promise?this._promise.then(()=>this.broadcast(e,t)):Promise.reject()}get promise(){return this._promise}_connectListener(e){this._thread&&this._thread.on(e.eventName,e.callback).then(t=>{e.removed||(e.threadHandle=t)})}}class v extends P{constructor(e=null){super("LercWorker","_decode",{_decode:t=>[t.buffer]},e,{strategy:"dedicated"}),this.schedule=e,this.ref=0}decode(e,t,i){return e&&e.byteLength!==0?this.invoke({buffer:e,options:t},i):Promise.resolve(null)}release(){--this.ref<=0&&(u.forEach((e,t)=>{e===this&&u.delete(t)}),this.destroy())}}const u=new Map;function A(s=null){let e=u.get(s);return e||(s!=null?(e=new v(t=>s.immediate.schedule(t)),u.set(s,e)):(e=new v,u.set(null,e))),++e.ref,e}let r=class extends V(T(D(S($(O))))){constructor(...s){super(...s),this.capabilities={operations:{supportsTileMap:!1}},this.copyright=null,this.heightModelInfo=null,this.path=null,this.minScale=void 0,this.maxScale=void 0,this.opacity=1,this.operationalLayerType="ArcGISTiledElevationServiceLayer",this.sourceJSON=null,this.type="elevation",this.url=null,this.version=null,this._lercDecoder=A()}normalizeCtorArgs(s,e){return typeof s=="string"?{url:s,...e}:s}destroy(){this._lercDecoder=L(this._lercDecoder)}readCapabilities(s,e){const t=e.capabilities&&e.capabilities.split(",").map(i=>i.toLowerCase().trim());return t?{operations:{supportsTileMap:t.includes("tilemap")}}:{operations:{supportsTileMap:!1}}}readVersion(s,e){let t=e.currentVersion;return t||(t=9.3),t}load(s){const e=s!=null?s.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"],supportsData:!1,validateItem:t=>{if(t.typeKeywords){for(let i=0;ithis._fetchImageService(e))),Promise.resolve(this)}fetchTile(s,e,t,i){const a=(i=i||{signal:null}).signal!=null?i.signal:i.signal=new AbortController().signal,h={responseType:"array-buffer",signal:a},n={noDataValue:i.noDataValue,returnFileInfo:!0};return this.load().then(()=>this._fetchTileAvailability(s,e,t,i)).then(()=>c(this.getTileUrl(s,e,t),h)).then(d=>this._lercDecoder.decode(d.data,n,a)).then(d=>new j(d))}getTileUrl(s,e,t){const i=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,a=I({...this.parsedUrl.query,blankTile:!i&&null});return`${this.parsedUrl.path}/tile/${s}/${e}/${t}${a?"?"+a:""}`}async queryElevation(s,e){const{ElevationQuery:t}=await y(()=>import("./ElevationQuery-DphYPRnK.js"),__vite__mapDeps([0,1,2]));return p(e),new t().query(this,s,e)}async createElevationSampler(s,e){const{ElevationQuery:t}=await y(()=>import("./ElevationQuery-DphYPRnK.js"),__vite__mapDeps([0,1,2]));return p(e),new t().createSampler(this,s,e)}_fetchTileAvailability(s,e,t,i){return this.tilemapCache?this.tilemapCache.fetchAvailability(s,e,t,i):Promise.resolve("unknown")}async _fetchImageService(s){var i;if(this.sourceJSON)return this.sourceJSON;const e={query:{f:"json",...this.parsedUrl.query},responseType:"json",signal:s},t=await c(this.parsedUrl.path,e);t.ssl&&(this.url=(i=this.url)==null?void 0:i.replace(/^http:/i,"https:")),this.sourceJSON=t.data,this.read(t.data,{origin:"service",url:this.parsedUrl})}get hasOverriddenFetchTile(){return!this.fetchTile[m]}};o([l({readOnly:!0})],r.prototype,"capabilities",void 0),o([_("service","capabilities",["capabilities"])],r.prototype,"readCapabilities",null),o([l({json:{read:{source:"copyrightText"}}})],r.prototype,"copyright",void 0),o([l({readOnly:!0,type:M})],r.prototype,"heightModelInfo",void 0),o([l({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],r.prototype,"path",void 0),o([l({type:["show","hide"]})],r.prototype,"listMode",void 0),o([l({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],r.prototype,"minScale",void 0),o([l({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],r.prototype,"maxScale",void 0),o([l({json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],r.prototype,"opacity",void 0),o([l({type:["ArcGISTiledElevationServiceLayer"]})],r.prototype,"operationalLayerType",void 0),o([l()],r.prototype,"sourceJSON",void 0),o([l({json:{read:!1},value:"elevation",readOnly:!0})],r.prototype,"type",void 0),o([l(N)],r.prototype,"url",void 0),o([l()],r.prototype,"version",void 0),o([_("version",["currentVersion"])],r.prototype,"readVersion",null),r=o([E("esri.layers.ElevationLayer")],r);const m=Symbol("default-fetch-tile");r.prototype.fetchTile[m]=!0;const U=r;export{U as default}; diff --git a/assets/ElevationQuery-BFZ9QB_a.js b/assets/ElevationQuery-DphYPRnK.js similarity index 99% rename from assets/ElevationQuery-BFZ9QB_a.js rename to assets/ElevationQuery-DphYPRnK.js index 0fe446d..45d1bd2 100644 --- a/assets/ElevationQuery-BFZ9QB_a.js +++ b/assets/ElevationQuery-DphYPRnK.js @@ -1 +1 @@ -import{aA as q,dX as U,ai as W,s as J,e as K,bo as g,ha as Y,cQ as ee,N as d,d2 as I,bv as $,ff as te,ah as L,fy as D,ay as O,fs as Q,as as ie,aD as A,aC as ne,hb as N}from"./index-CEWggaxV.js";const M=()=>J.getLogger("esri.layers.support.ElevationSampler");class X{queryElevation(e){return le(e.clone(),this)}on(){return K()}projectIfRequired(e,t){return B(e,t)}}class se extends X{get spatialReference(){return this.extent.spatialReference}constructor(e,t,i){super(),this.tile=e,this.noDataValue=i;const n=e.tile.extent;this.extent=U(n,t.spatialReference),this.extent.zmin=e.zmin,this.extent.zmax=e.zmax,this._aaExtent=n;const s=g(t.spatialReference),l=t.lodAt(e.tile.level).resolution*s;this.demResolution={min:l,max:l}}contains(e){const t=this.projectIfRequired(e,this.spatialReference);return t!=null&&this.containsAt(t.x,t.y)}containsAt(e,t){return Y(this._aaExtent,e,t)}elevationAt(e,t){if(!this.containsAt(e,t)){const i=this.extent,n=`${i.xmin}, ${i.ymin}, ${i.xmax}, ${i.ymax}`;return M().warn("#elevationAt()",`Point used to sample elevation (${e}, ${t}) is outside of the sampler extent (${n})`),this.noDataValue}return this.tile.sample(e,t)??this.noDataValue}}class Z extends X{get spatialReference(){return this.extent.spatialReference}constructor(e,t,i){let n;super(),typeof t=="number"?(this.noDataValue=t,n=null):(n=t,this.noDataValue=i),this.samplers=n?e.map(l=>new se(l,n,this.noDataValue)):e;const s=this.samplers[0];if(s){this.extent=s.extent.clone();const{min:l,max:o}=s.demResolution;this.demResolution={min:l,max:o};for(let a=1;at?t:c}class fe{async queryAll(e,t,i){if(!(e=i&&i.ignoreInvisibleLayers?e.filter(r=>r.visible):e.slice()).length)throw new d("elevation-query:invalid-layer","Elevation queries require at least one elevation layer to fetch tiles from");const n=x.fromGeometry(t);let s=!1;i&&i.returnSampleInfo||(s=!0);const l={...w,...i,returnSampleInfo:!0},o=await this.query(e[e.length-1],n,l),a=await this._queryAllContinue(e,o,l);return a.geometry=a.geometry.export(),s&&delete a.sampleInfo,a}async query(e,t,i){if(!e)throw new d("elevation-query:invalid-layer","Elevation queries require an elevation layer to fetch tiles from");if(!t||!(t instanceof x)&&t.type!=="point"&&t.type!=="multipoint"&&t.type!=="polyline")throw new d("elevation-query:invalid-geometry","Only point, polyline and multipoint geometries can be used to query elevation");const n={...w,...i},s=new ue(e,t.spatialReference,n),l=n.signal;return await e.load({signal:l}),await this._createGeometryDescriptor(s,t,l),await this._selectTiles(s,l),await this._populateElevationTiles(s,l),this._sampleGeometryWithElevation(s),this._createQueryResult(s,l)}async createSampler(e,t,i){if(!e)throw new d("elevation-query:invalid-layer","Elevation queries require an elevation layer to fetch tiles from");if(!t||t.type!=="extent")throw new d("elevation-query:invalid-extent","Invalid or undefined extent");const n={...w,...i};return this._createSampler(e,t,n)}async createSamplerAll(e,t,i){if(!(e=i&&i.ignoreInvisibleLayers?e.filter(l=>l.visible):e.slice()).length)throw new d("elevation-query:invalid-layer","Elevation queries require at least one elevation layer to fetch tiles from");if(!t||t.type!=="extent")throw new d("elevation-query:invalid-extent","Invalid or undefined extent");const n={...w,...i,returnSampleInfo:!0},s=await this._createSampler(e[e.length-1],t,n);return this._createSamplerAllContinue(e,t,s,n)}async _createSampler(e,t,i,n){const s=i.signal;await e.load({signal:s});const l=t.spatialReference,o=e.tileInfo.spatialReference;l.equals(o)||(await I([{source:l,dest:o}],{signal:s}),t=$(t,o));const a=new he(e,t,i,n);return await this._selectTiles(a,s),await this._populateElevationTiles(a,s),new Z(a.elevationTiles,a.layer.tileInfo,a.options.noDataValue)}async _createSamplerAllContinue(e,t,i,n){if(e.pop(),!e.length)return i;const s=i.samplers.filter(r=>!r.tile.hasNoDataValues).map(r=>te(r.extent)),l=await this._createSampler(e[e.length-1],t,n,s);if(l.samplers.length===0)return i;const o=i.samplers.concat(l.samplers),a=new Z(o,n.noDataValue);return this._createSamplerAllContinue(e,t,a,n)}async _queryAllContinue(e,t,i){const n=e.pop(),s=t.geometry.coordinates,l=t.sampleInfo;L(l);const o=[],a=[];for(let p=0;p=0?h.source||(h.source=n):e.length&&(o.push(s[p]),a.push(p))}if(!e.length||o.length===0)return t;const r=t.geometry.clone(o),u=await this.query(e[e.length-1],r,i),m=u.sampleInfo;if(!m)throw new Error("no sampleInfo");return a.forEach((p,h)=>{s[p].z=u.geometry.coordinates[h].z,l[p].demResolution=m[h].demResolution}),this._queryAllContinue(e,t,i)}async _createQueryResult(e,t){const i=await e.geometry.project(e.outSpatialReference,t);L(i);const n={geometry:i.export(),noDataValue:e.options.noDataValue};return e.options.returnSampleInfo&&(n.sampleInfo=this._extractSampleInfo(e)),e.geometry.coordinates.forEach(s=>{s.tile=null,s.elevationTile=null}),n}async _createGeometryDescriptor(e,t,i){let n;const s=e.layer.tileInfo.spatialReference;if(t instanceof x?n=await t.project(s,i):(await I([{source:t.spatialReference,dest:s}],{signal:i}),n=$(t,s)),!n)throw new d("elevation-query:spatial-reference-mismatch",`Cannot query elevation in '${t.spatialReference.wkid}' on an elevation service in '${s.wkid}'`);e.geometry=x.fromGeometry(n)}async _selectTiles(e,t){e.type==="geometry"&&this._preselectOutsideLayerExtent(e);const i=e.options.demResolution;if(typeof i=="number")this._selectTilesClosestResolution(e,i);else if(i==="finest-contiguous")await this._selectTilesFinestContiguous(e,t);else{if(i!=="auto")throw new d("elevation-query:invalid-dem-resolution",`Invalid dem resolution value '${i}', expected a number, "finest-contiguous" or "auto"`);await this._selectTilesAuto(e,t)}}_preselectOutsideLayerExtent(e){if(e.layer.fullExtent==null)return;const t=new G(null);t.sample=()=>e.options.noDataValue,e.outsideExtentTile=t;const i=e.layer.fullExtent;e.geometry.coordinates.forEach(n=>{const s=n.x,l=n.y;(si.xmax||li.ymax)&&(n.elevationTile=t)})}_selectTilesClosestResolution(e,t){const i=this._findNearestDemResolutionLODIndex(e,t);e.selectTilesAtLOD(i)}_findNearestDemResolutionLODIndex(e,t){const{tileInfo:i,tilemapCache:n}=e.layer,s=t/g(i.spatialReference),l=T(i,n);let o=l[0],a=0;for(let r=1;rs.fetchAvailability(o.level,o.row,o.col,{signal:i}))),i);else if(await this._populateElevationTiles(e,i),!e.allElevationTilesFetched())throw e.clearElevationTiles(),new d("elevation-query:has-unavailable-tiles")}catch(o){O(o),await this._selectTilesFinestContiguousAt(e,t-1,i)}}async _populateElevationTiles(e,t){const i=e.getTilesToFetch(),n={},s=e.options.cache,l=e.options.noDataValue,o=i.map(async a=>{if(a.id==null)return;const r=`${e.layer.uid}:${a.id}:${l}`,u=s!=null?s.get(r):null,m=u??await e.layer.fetchTile(a.level,a.row,a.col,{noDataValue:l,signal:t});s!=null&&s.put(r,m),n[a.id]=new G(a,m)});await D(Promise.allSettled(o),t),e.populateElevationTiles(n)}async _selectTilesAuto(e,t){this._selectTilesAutoFinest(e),this._reduceTilesForMaximumRequests(e);const i=e.layer.tilemapCache;if(!i||C(i))return this._selectTilesAutoPrefetchUpsample(e,t);const n=e.getTilesToFetch(),s={},l=n.map(async o=>{const a=new Q(null,0,0,0,W()),r=await ie(i.fetchAvailabilityUpsample(o.level,o.row,o.col,a,{signal:t}));r.ok!==!1?o.id!=null&&(s[o.id]=a):O(r.error)});await D(Promise.all(l),t),e.remapTiles(s)}_reduceTilesForMaximumRequests(e){const t=e.layer.tileInfo;let i=0;const n={},s=a=>{a.id!=null&&(a.id in n?n[a.id]++:(n[a.id]=1,i++))},l=a=>{if(a.id==null)return;const r=n[a.id];r===1?(delete n[a.id],i--):n[a.id]=r-1};e.forEachTileToFetch(s,l);let o=!0;for(;o&&(o=!1,e.forEachTileToFetch(a=>{i<=e.options.maximumAutoTileRequests||(l(a),t.upsampleTile(a)&&(o=!0),s(a))},l),o););}_selectTilesAutoFinest(e){const{tileInfo:t,tilemapCache:i}=e.layer,n=j(t,i,e.options.minDemResolution);e.selectTilesAtLOD(n,e.options.maximumAutoTileRequests)}async _selectTilesAutoPrefetchUpsample(e,t){const i=e.layer.tileInfo;await this._populateElevationTiles(e,t);let n=!1;e.forEachTileToFetch((s,l)=>{i.upsampleTile(s)?n=!0:l()}),n&&await this._selectTilesAutoPrefetchUpsample(e,t)}_sampleGeometryWithElevation(e){e.geometry.coordinates.forEach(t=>{const i=t.elevationTile;let n=e.options.noDataValue;if(i){const s=i.sample(t.x,t.y);s!=null?n=s:t.elevationTile=null}t.z=n})}_extractSampleInfo(e){const t=e.layer.tileInfo,i=g(t.spatialReference);return e.geometry.coordinates.map(n=>{let s=-1;return n.elevationTile&&n.elevationTile!==e.outsideExtentTile&&(s=t.lodAt(n.elevationTile.tile.level).resolution*i),{demResolution:s}})}}class x{export(){return this._exporter(this.coordinates,this.spatialReference)}clone(e){const t=new x;return t.geometry=this.geometry,t.spatialReference=this.spatialReference,t.coordinates=e||this.coordinates.map(i=>i.clone()),t._exporter=this._exporter,t}async project(e,t){if(this.spatialReference.equals(e))return this.clone();await I([{source:this.spatialReference,dest:e}],{signal:t});const i=new A({spatialReference:this.spatialReference,points:this.coordinates.map(o=>[o.x,o.y])}),n=$(i,e);if(!n)return null;const s=this.coordinates.map((o,a)=>{const r=o.clone(),u=n.points[a];return r.x=u[0],r.y=u[1],r}),l=this.clone(s);return l.spatialReference=e,l}static fromGeometry(e){const t=new x;if(t.geometry=e,t.spatialReference=e.spatialReference,e instanceof x)t.coordinates=e.coordinates.map(i=>i.clone()),t._exporter=(i,n)=>{const s=e.clone(i);return s.spatialReference=n,s};else switch(e.type){case"point":{const i=e,{hasZ:n,hasM:s}=i;t.coordinates=n&&s?[new f(i.x,i.y,i.z,i.m)]:n?[new f(i.x,i.y,i.z)]:s?[new f(i.x,i.y,null,i.m)]:[new f(i.x,i.y)],t._exporter=(l,o)=>e.hasM?new q(l[0].x,l[0].y,l[0].z,l[0].m,o):new q(l[0].x,l[0].y,l[0].z,o);break}case"multipoint":{const i=e,{hasZ:n,hasM:s}=i;t.coordinates=n&&s?i.points.map(l=>new f(l[0],l[1],l[2],l[3])):n?i.points.map(l=>new f(l[0],l[1],l[2])):s?i.points.map(l=>new f(l[0],l[1],null,l[2])):i.points.map(l=>new f(l[0],l[1])),t._exporter=(l,o)=>e.hasM?new A({points:l.map(a=>[a.x,a.y,a.z,a.m]),hasZ:!0,hasM:!0,spatialReference:o}):new A(l.map(a=>[a.x,a.y,a.z]),o);break}case"polyline":{const i=e,n=[],s=[],{hasZ:l,hasM:o}=e;let a=0;for(const r of i.paths)if(s.push([a,a+r.length]),a+=r.length,l&&o)for(const u of r)n.push(new f(u[0],u[1],u[2],u[3]));else if(l)for(const u of r)n.push(new f(u[0],u[1],u[2]));else if(o)for(const u of r)n.push(new f(u[0],u[1],null,u[2]));else for(const u of r)n.push(new f(u[0],u[1]));t.coordinates=n,t._exporter=(r,u)=>{const m=e.hasM?r.map(h=>[h.x,h.y,h.z,h.m]):r.map(h=>[h.x,h.y,h.z]),p=s.map(h=>m.slice(h[0],h[1]));return new ne({paths:p,hasM:e.hasM,hasZ:!0,spatialReference:u})};break}}return t}}class f{constructor(e,t,i=null,n=null,s=null,l=null){this.x=e,this.y=t,this.z=i,this.m=n,this.tile=s,this.elevationTile=l}clone(){return new f(this.x,this.y,this.z,this.m)}}class H{constructor(e,t){this.layer=e,this.options=t}}class ue extends H{constructor(e,t,i){super(e,i),this.outSpatialReference=t,this.type="geometry"}selectTilesAtLOD(e){if(e<0)this.geometry.coordinates.forEach(t=>t.tile=null);else{const{tileInfo:t,tilemapCache:i}=this.layer,n=T(t,i)[e].level;this.geometry.coordinates.forEach(s=>s.tile=t.tileAt(n,s.x,s.y))}}allElevationTilesFetched(){return!this.geometry.coordinates.some(e=>!e.elevationTile)}clearElevationTiles(){for(const e of this.geometry.coordinates)e.elevationTile!==this.outsideExtentTile&&(e.elevationTile=null)}populateElevationTiles(e){var t;for(const i of this.geometry.coordinates)!i.elevationTile&&((t=i.tile)!=null&&t.id)&&(i.elevationTile=e[i.tile.id])}remapTiles(e){var t;for(const i of this.geometry.coordinates){const n=(t=i.tile)==null?void 0:t.id;i.tile=n?e[n]:null}}getTilesToFetch(){var i;const e={},t=[];for(const n of this.geometry.coordinates){const s=n.tile;if(!s)continue;const l=(i=n.tile)==null?void 0:i.id;n.elevationTile||!l||e[l]||(e[l]=s,t.push(s))}return t}forEachTileToFetch(e){for(const t of this.geometry.coordinates)t.tile&&!t.elevationTile&&e(t.tile,()=>{t.tile=null})}}class he extends H{constructor(e,t,i,n){super(e,i),this.type="extent",this.elevationTiles=[],this._candidateTiles=[],this._fetchedCandidates=new Set,this.extent=t.clone().intersection(e.fullExtent),this.maskExtents=n}selectTilesAtLOD(e,t){const i=this._maximumLodForRequests(t),n=Math.min(i,e);n<0?this._candidateTiles.length=0:this._selectCandidateTilesCoveringExtentAt(n)}_maximumLodForRequests(e){const{tileInfo:t,tilemapCache:i}=this.layer,n=T(t,i);if(!e)return n.length-1;const s=this.extent;if(s==null)return-1;for(let l=n.length-1;l>=0;l--){const o=n[l],a=o.resolution*t.size[0],r=o.resolution*t.size[1];if(Math.ceil(s.width/a)*Math.ceil(s.height/r)<=e)return l}return-1}allElevationTilesFetched(){return this._candidateTiles.length===this.elevationTiles.length}clearElevationTiles(){this.elevationTiles.length=0,this._fetchedCandidates.clear()}populateElevationTiles(e){for(const t of this._candidateTiles){const i=t.id&&e[t.id];i&&(this._fetchedCandidates.add(t),this.elevationTiles.push(i))}}remapTiles(e){this._candidateTiles=this._uniqueNonOverlappingTiles(this._candidateTiles.map(t=>e[t.id]))}getTilesToFetch(){return this._candidateTiles}forEachTileToFetch(e,t){const i=this._candidateTiles;this._candidateTiles=[],i.forEach(n=>{if(this._fetchedCandidates.has(n))return void(t&&t(n));let s=!1;e(n,()=>s=!0),s?t&&t(n):this._candidateTiles.push(n)}),this._candidateTiles=this._uniqueNonOverlappingTiles(this._candidateTiles,t)}_uniqueNonOverlappingTiles(e,t){const i={},n=[];for(const l of e){const o=l.id;o&&!i[o]?(i[o]=l,n.push(l)):t&&t(l)}const s=n.sort((l,o)=>l.level-o.level);return s.filter((l,o)=>{for(let a=0;ae.extent&&N(t,e.extent))}}function j(c,e,t=0){const i=T(c,e);let n=i.length-1;if(t>0){const s=t/g(c.spatialReference),l=i.findIndex(o=>o.resolution0&&(n=l-1)}return n}const w={maximumAutoTileRequests:20,noDataValue:0,returnSampleInfo:!1,demResolution:"auto",minDemResolution:0};function T(c,e){const t=c.lods;if(C(e)){const{effectiveMinLOD:i,effectiveMaxLOD:n}=e;return t.filter(s=>s.level>=i&&s.level<=n)}return t}function C(c){return(c==null?void 0:c.tileInfo)!=null}export{fe as ElevationQuery,x as GeometryDescriptor,j as getFinestLodIndex}; +import{aA as q,dX as U,ai as W,s as J,e as K,bo as g,ha as Y,cQ as ee,N as d,d2 as I,bv as $,ff as te,ah as L,fy as D,ay as O,fs as Q,as as ie,aD as A,aC as ne,hb as N}from"./index-BjUNJPVf.js";const M=()=>J.getLogger("esri.layers.support.ElevationSampler");class X{queryElevation(e){return le(e.clone(),this)}on(){return K()}projectIfRequired(e,t){return B(e,t)}}class se extends X{get spatialReference(){return this.extent.spatialReference}constructor(e,t,i){super(),this.tile=e,this.noDataValue=i;const n=e.tile.extent;this.extent=U(n,t.spatialReference),this.extent.zmin=e.zmin,this.extent.zmax=e.zmax,this._aaExtent=n;const s=g(t.spatialReference),l=t.lodAt(e.tile.level).resolution*s;this.demResolution={min:l,max:l}}contains(e){const t=this.projectIfRequired(e,this.spatialReference);return t!=null&&this.containsAt(t.x,t.y)}containsAt(e,t){return Y(this._aaExtent,e,t)}elevationAt(e,t){if(!this.containsAt(e,t)){const i=this.extent,n=`${i.xmin}, ${i.ymin}, ${i.xmax}, ${i.ymax}`;return M().warn("#elevationAt()",`Point used to sample elevation (${e}, ${t}) is outside of the sampler extent (${n})`),this.noDataValue}return this.tile.sample(e,t)??this.noDataValue}}class Z extends X{get spatialReference(){return this.extent.spatialReference}constructor(e,t,i){let n;super(),typeof t=="number"?(this.noDataValue=t,n=null):(n=t,this.noDataValue=i),this.samplers=n?e.map(l=>new se(l,n,this.noDataValue)):e;const s=this.samplers[0];if(s){this.extent=s.extent.clone();const{min:l,max:o}=s.demResolution;this.demResolution={min:l,max:o};for(let a=1;at?t:c}class fe{async queryAll(e,t,i){if(!(e=i&&i.ignoreInvisibleLayers?e.filter(r=>r.visible):e.slice()).length)throw new d("elevation-query:invalid-layer","Elevation queries require at least one elevation layer to fetch tiles from");const n=x.fromGeometry(t);let s=!1;i&&i.returnSampleInfo||(s=!0);const l={...w,...i,returnSampleInfo:!0},o=await this.query(e[e.length-1],n,l),a=await this._queryAllContinue(e,o,l);return a.geometry=a.geometry.export(),s&&delete a.sampleInfo,a}async query(e,t,i){if(!e)throw new d("elevation-query:invalid-layer","Elevation queries require an elevation layer to fetch tiles from");if(!t||!(t instanceof x)&&t.type!=="point"&&t.type!=="multipoint"&&t.type!=="polyline")throw new d("elevation-query:invalid-geometry","Only point, polyline and multipoint geometries can be used to query elevation");const n={...w,...i},s=new ue(e,t.spatialReference,n),l=n.signal;return await e.load({signal:l}),await this._createGeometryDescriptor(s,t,l),await this._selectTiles(s,l),await this._populateElevationTiles(s,l),this._sampleGeometryWithElevation(s),this._createQueryResult(s,l)}async createSampler(e,t,i){if(!e)throw new d("elevation-query:invalid-layer","Elevation queries require an elevation layer to fetch tiles from");if(!t||t.type!=="extent")throw new d("elevation-query:invalid-extent","Invalid or undefined extent");const n={...w,...i};return this._createSampler(e,t,n)}async createSamplerAll(e,t,i){if(!(e=i&&i.ignoreInvisibleLayers?e.filter(l=>l.visible):e.slice()).length)throw new d("elevation-query:invalid-layer","Elevation queries require at least one elevation layer to fetch tiles from");if(!t||t.type!=="extent")throw new d("elevation-query:invalid-extent","Invalid or undefined extent");const n={...w,...i,returnSampleInfo:!0},s=await this._createSampler(e[e.length-1],t,n);return this._createSamplerAllContinue(e,t,s,n)}async _createSampler(e,t,i,n){const s=i.signal;await e.load({signal:s});const l=t.spatialReference,o=e.tileInfo.spatialReference;l.equals(o)||(await I([{source:l,dest:o}],{signal:s}),t=$(t,o));const a=new he(e,t,i,n);return await this._selectTiles(a,s),await this._populateElevationTiles(a,s),new Z(a.elevationTiles,a.layer.tileInfo,a.options.noDataValue)}async _createSamplerAllContinue(e,t,i,n){if(e.pop(),!e.length)return i;const s=i.samplers.filter(r=>!r.tile.hasNoDataValues).map(r=>te(r.extent)),l=await this._createSampler(e[e.length-1],t,n,s);if(l.samplers.length===0)return i;const o=i.samplers.concat(l.samplers),a=new Z(o,n.noDataValue);return this._createSamplerAllContinue(e,t,a,n)}async _queryAllContinue(e,t,i){const n=e.pop(),s=t.geometry.coordinates,l=t.sampleInfo;L(l);const o=[],a=[];for(let p=0;p=0?h.source||(h.source=n):e.length&&(o.push(s[p]),a.push(p))}if(!e.length||o.length===0)return t;const r=t.geometry.clone(o),u=await this.query(e[e.length-1],r,i),m=u.sampleInfo;if(!m)throw new Error("no sampleInfo");return a.forEach((p,h)=>{s[p].z=u.geometry.coordinates[h].z,l[p].demResolution=m[h].demResolution}),this._queryAllContinue(e,t,i)}async _createQueryResult(e,t){const i=await e.geometry.project(e.outSpatialReference,t);L(i);const n={geometry:i.export(),noDataValue:e.options.noDataValue};return e.options.returnSampleInfo&&(n.sampleInfo=this._extractSampleInfo(e)),e.geometry.coordinates.forEach(s=>{s.tile=null,s.elevationTile=null}),n}async _createGeometryDescriptor(e,t,i){let n;const s=e.layer.tileInfo.spatialReference;if(t instanceof x?n=await t.project(s,i):(await I([{source:t.spatialReference,dest:s}],{signal:i}),n=$(t,s)),!n)throw new d("elevation-query:spatial-reference-mismatch",`Cannot query elevation in '${t.spatialReference.wkid}' on an elevation service in '${s.wkid}'`);e.geometry=x.fromGeometry(n)}async _selectTiles(e,t){e.type==="geometry"&&this._preselectOutsideLayerExtent(e);const i=e.options.demResolution;if(typeof i=="number")this._selectTilesClosestResolution(e,i);else if(i==="finest-contiguous")await this._selectTilesFinestContiguous(e,t);else{if(i!=="auto")throw new d("elevation-query:invalid-dem-resolution",`Invalid dem resolution value '${i}', expected a number, "finest-contiguous" or "auto"`);await this._selectTilesAuto(e,t)}}_preselectOutsideLayerExtent(e){if(e.layer.fullExtent==null)return;const t=new G(null);t.sample=()=>e.options.noDataValue,e.outsideExtentTile=t;const i=e.layer.fullExtent;e.geometry.coordinates.forEach(n=>{const s=n.x,l=n.y;(si.xmax||li.ymax)&&(n.elevationTile=t)})}_selectTilesClosestResolution(e,t){const i=this._findNearestDemResolutionLODIndex(e,t);e.selectTilesAtLOD(i)}_findNearestDemResolutionLODIndex(e,t){const{tileInfo:i,tilemapCache:n}=e.layer,s=t/g(i.spatialReference),l=T(i,n);let o=l[0],a=0;for(let r=1;rs.fetchAvailability(o.level,o.row,o.col,{signal:i}))),i);else if(await this._populateElevationTiles(e,i),!e.allElevationTilesFetched())throw e.clearElevationTiles(),new d("elevation-query:has-unavailable-tiles")}catch(o){O(o),await this._selectTilesFinestContiguousAt(e,t-1,i)}}async _populateElevationTiles(e,t){const i=e.getTilesToFetch(),n={},s=e.options.cache,l=e.options.noDataValue,o=i.map(async a=>{if(a.id==null)return;const r=`${e.layer.uid}:${a.id}:${l}`,u=s!=null?s.get(r):null,m=u??await e.layer.fetchTile(a.level,a.row,a.col,{noDataValue:l,signal:t});s!=null&&s.put(r,m),n[a.id]=new G(a,m)});await D(Promise.allSettled(o),t),e.populateElevationTiles(n)}async _selectTilesAuto(e,t){this._selectTilesAutoFinest(e),this._reduceTilesForMaximumRequests(e);const i=e.layer.tilemapCache;if(!i||C(i))return this._selectTilesAutoPrefetchUpsample(e,t);const n=e.getTilesToFetch(),s={},l=n.map(async o=>{const a=new Q(null,0,0,0,W()),r=await ie(i.fetchAvailabilityUpsample(o.level,o.row,o.col,a,{signal:t}));r.ok!==!1?o.id!=null&&(s[o.id]=a):O(r.error)});await D(Promise.all(l),t),e.remapTiles(s)}_reduceTilesForMaximumRequests(e){const t=e.layer.tileInfo;let i=0;const n={},s=a=>{a.id!=null&&(a.id in n?n[a.id]++:(n[a.id]=1,i++))},l=a=>{if(a.id==null)return;const r=n[a.id];r===1?(delete n[a.id],i--):n[a.id]=r-1};e.forEachTileToFetch(s,l);let o=!0;for(;o&&(o=!1,e.forEachTileToFetch(a=>{i<=e.options.maximumAutoTileRequests||(l(a),t.upsampleTile(a)&&(o=!0),s(a))},l),o););}_selectTilesAutoFinest(e){const{tileInfo:t,tilemapCache:i}=e.layer,n=j(t,i,e.options.minDemResolution);e.selectTilesAtLOD(n,e.options.maximumAutoTileRequests)}async _selectTilesAutoPrefetchUpsample(e,t){const i=e.layer.tileInfo;await this._populateElevationTiles(e,t);let n=!1;e.forEachTileToFetch((s,l)=>{i.upsampleTile(s)?n=!0:l()}),n&&await this._selectTilesAutoPrefetchUpsample(e,t)}_sampleGeometryWithElevation(e){e.geometry.coordinates.forEach(t=>{const i=t.elevationTile;let n=e.options.noDataValue;if(i){const s=i.sample(t.x,t.y);s!=null?n=s:t.elevationTile=null}t.z=n})}_extractSampleInfo(e){const t=e.layer.tileInfo,i=g(t.spatialReference);return e.geometry.coordinates.map(n=>{let s=-1;return n.elevationTile&&n.elevationTile!==e.outsideExtentTile&&(s=t.lodAt(n.elevationTile.tile.level).resolution*i),{demResolution:s}})}}class x{export(){return this._exporter(this.coordinates,this.spatialReference)}clone(e){const t=new x;return t.geometry=this.geometry,t.spatialReference=this.spatialReference,t.coordinates=e||this.coordinates.map(i=>i.clone()),t._exporter=this._exporter,t}async project(e,t){if(this.spatialReference.equals(e))return this.clone();await I([{source:this.spatialReference,dest:e}],{signal:t});const i=new A({spatialReference:this.spatialReference,points:this.coordinates.map(o=>[o.x,o.y])}),n=$(i,e);if(!n)return null;const s=this.coordinates.map((o,a)=>{const r=o.clone(),u=n.points[a];return r.x=u[0],r.y=u[1],r}),l=this.clone(s);return l.spatialReference=e,l}static fromGeometry(e){const t=new x;if(t.geometry=e,t.spatialReference=e.spatialReference,e instanceof x)t.coordinates=e.coordinates.map(i=>i.clone()),t._exporter=(i,n)=>{const s=e.clone(i);return s.spatialReference=n,s};else switch(e.type){case"point":{const i=e,{hasZ:n,hasM:s}=i;t.coordinates=n&&s?[new f(i.x,i.y,i.z,i.m)]:n?[new f(i.x,i.y,i.z)]:s?[new f(i.x,i.y,null,i.m)]:[new f(i.x,i.y)],t._exporter=(l,o)=>e.hasM?new q(l[0].x,l[0].y,l[0].z,l[0].m,o):new q(l[0].x,l[0].y,l[0].z,o);break}case"multipoint":{const i=e,{hasZ:n,hasM:s}=i;t.coordinates=n&&s?i.points.map(l=>new f(l[0],l[1],l[2],l[3])):n?i.points.map(l=>new f(l[0],l[1],l[2])):s?i.points.map(l=>new f(l[0],l[1],null,l[2])):i.points.map(l=>new f(l[0],l[1])),t._exporter=(l,o)=>e.hasM?new A({points:l.map(a=>[a.x,a.y,a.z,a.m]),hasZ:!0,hasM:!0,spatialReference:o}):new A(l.map(a=>[a.x,a.y,a.z]),o);break}case"polyline":{const i=e,n=[],s=[],{hasZ:l,hasM:o}=e;let a=0;for(const r of i.paths)if(s.push([a,a+r.length]),a+=r.length,l&&o)for(const u of r)n.push(new f(u[0],u[1],u[2],u[3]));else if(l)for(const u of r)n.push(new f(u[0],u[1],u[2]));else if(o)for(const u of r)n.push(new f(u[0],u[1],null,u[2]));else for(const u of r)n.push(new f(u[0],u[1]));t.coordinates=n,t._exporter=(r,u)=>{const m=e.hasM?r.map(h=>[h.x,h.y,h.z,h.m]):r.map(h=>[h.x,h.y,h.z]),p=s.map(h=>m.slice(h[0],h[1]));return new ne({paths:p,hasM:e.hasM,hasZ:!0,spatialReference:u})};break}}return t}}class f{constructor(e,t,i=null,n=null,s=null,l=null){this.x=e,this.y=t,this.z=i,this.m=n,this.tile=s,this.elevationTile=l}clone(){return new f(this.x,this.y,this.z,this.m)}}class H{constructor(e,t){this.layer=e,this.options=t}}class ue extends H{constructor(e,t,i){super(e,i),this.outSpatialReference=t,this.type="geometry"}selectTilesAtLOD(e){if(e<0)this.geometry.coordinates.forEach(t=>t.tile=null);else{const{tileInfo:t,tilemapCache:i}=this.layer,n=T(t,i)[e].level;this.geometry.coordinates.forEach(s=>s.tile=t.tileAt(n,s.x,s.y))}}allElevationTilesFetched(){return!this.geometry.coordinates.some(e=>!e.elevationTile)}clearElevationTiles(){for(const e of this.geometry.coordinates)e.elevationTile!==this.outsideExtentTile&&(e.elevationTile=null)}populateElevationTiles(e){var t;for(const i of this.geometry.coordinates)!i.elevationTile&&((t=i.tile)!=null&&t.id)&&(i.elevationTile=e[i.tile.id])}remapTiles(e){var t;for(const i of this.geometry.coordinates){const n=(t=i.tile)==null?void 0:t.id;i.tile=n?e[n]:null}}getTilesToFetch(){var i;const e={},t=[];for(const n of this.geometry.coordinates){const s=n.tile;if(!s)continue;const l=(i=n.tile)==null?void 0:i.id;n.elevationTile||!l||e[l]||(e[l]=s,t.push(s))}return t}forEachTileToFetch(e){for(const t of this.geometry.coordinates)t.tile&&!t.elevationTile&&e(t.tile,()=>{t.tile=null})}}class he extends H{constructor(e,t,i,n){super(e,i),this.type="extent",this.elevationTiles=[],this._candidateTiles=[],this._fetchedCandidates=new Set,this.extent=t.clone().intersection(e.fullExtent),this.maskExtents=n}selectTilesAtLOD(e,t){const i=this._maximumLodForRequests(t),n=Math.min(i,e);n<0?this._candidateTiles.length=0:this._selectCandidateTilesCoveringExtentAt(n)}_maximumLodForRequests(e){const{tileInfo:t,tilemapCache:i}=this.layer,n=T(t,i);if(!e)return n.length-1;const s=this.extent;if(s==null)return-1;for(let l=n.length-1;l>=0;l--){const o=n[l],a=o.resolution*t.size[0],r=o.resolution*t.size[1];if(Math.ceil(s.width/a)*Math.ceil(s.height/r)<=e)return l}return-1}allElevationTilesFetched(){return this._candidateTiles.length===this.elevationTiles.length}clearElevationTiles(){this.elevationTiles.length=0,this._fetchedCandidates.clear()}populateElevationTiles(e){for(const t of this._candidateTiles){const i=t.id&&e[t.id];i&&(this._fetchedCandidates.add(t),this.elevationTiles.push(i))}}remapTiles(e){this._candidateTiles=this._uniqueNonOverlappingTiles(this._candidateTiles.map(t=>e[t.id]))}getTilesToFetch(){return this._candidateTiles}forEachTileToFetch(e,t){const i=this._candidateTiles;this._candidateTiles=[],i.forEach(n=>{if(this._fetchedCandidates.has(n))return void(t&&t(n));let s=!1;e(n,()=>s=!0),s?t&&t(n):this._candidateTiles.push(n)}),this._candidateTiles=this._uniqueNonOverlappingTiles(this._candidateTiles,t)}_uniqueNonOverlappingTiles(e,t){const i={},n=[];for(const l of e){const o=l.id;o&&!i[o]?(i[o]=l,n.push(l)):t&&t(l)}const s=n.sort((l,o)=>l.level-o.level);return s.filter((l,o)=>{for(let a=0;ae.extent&&N(t,e.extent))}}function j(c,e,t=0){const i=T(c,e);let n=i.length-1;if(t>0){const s=t/g(c.spatialReference),l=i.findIndex(o=>o.resolution0&&(n=l-1)}return n}const w={maximumAutoTileRequests:20,noDataValue:0,returnSampleInfo:!1,demResolution:"auto",minDemResolution:0};function T(c,e){const t=c.lods;if(C(e)){const{effectiveMinLOD:i,effectiveMaxLOD:n}=e;return t.filter(s=>s.level>=i&&s.level<=n)}return t}function C(c){return(c==null?void 0:c.tileInfo)!=null}export{fe as ElevationQuery,x as GeometryDescriptor,j as getFinestLodIndex}; diff --git a/assets/ElevationSamplerWorker-DNbNk0sW.js b/assets/ElevationSamplerWorker-DR7iKj10.js similarity index 78% rename from assets/ElevationSamplerWorker-DNbNk0sW.js rename to assets/ElevationSamplerWorker-DR7iKj10.js index 0f1b28b..1355aa8 100644 --- a/assets/ElevationSamplerWorker-DNbNk0sW.js +++ b/assets/ElevationSamplerWorker-DR7iKj10.js @@ -1 +1 @@ -import{E as l}from"./index-CEWggaxV.js";import{s as p}from"./PooledRBush-BsFBmw1o.js";import{g as h}from"./meshVertexSpaceUtils-BFWpJFSd.js";import{P as u}from"./georeference-DtjTZVKi.js";import"./MeshLocalVertexSpace-Cltwu1Kq.js";import"./vec3-CjYmIfaa.js";import"./mat3f64-q3fE-ZOt.js";import"./mat4f64-CSKppSlJ.js";import"./computeTranslationToOriginAndRotation-DOOKw0d1.js";import"./DoubleArray-DxyNBrRi.js";import"./quat-CoKEr4Zu.js";import"./quatf64-Bdb9ZJJK.js";import"./BufferView-Ao_K-5Vg.js";class b{async createIndex(t,r){var m;const e=new Array;if(!((m=t.vertexAttributes)!=null&&m.position))return new p;const a=this._createMeshData(t),n=r!=null?await r.invoke("createIndexThread",a,{transferList:e}):this.createIndexThread(a).result;return this._createPooledRBush().fromJSON(n)}createIndexThread(t){const r=new Float64Array(t.position),e=this._createPooledRBush();return t.components?this._createIndexComponentsThread(e,r,t.components.map(a=>new Uint32Array(a))):this._createIndexAllThread(e,r)}_createIndexAllThread(t,r){const e=new Array(r.length/9);let a=0;for(let n=0;n!e.faces)?{position:r}:{position:r,components:t.components.map(e=>e.faces)}}_createPooledRBush(){return new p(9,l("esri-csp-restrictions")?t=>t:[".minX",".minY",".maxX",".maxY"])}}function c(o,t,r,e){return{minX:Math.min(o[t],o[r],o[e]),maxX:Math.max(o[t],o[r],o[e]),minY:Math.min(o[t+1],o[r+1],o[e+1]),maxY:Math.max(o[t+1],o[r+1],o[e+1]),p0:[o[t],o[t+1],o[t+2]],p1:[o[r],o[r+1],o[r+2]],p2:[o[e],o[e+1],o[e+2]]}}export{b as default}; +import{E as l}from"./index-BjUNJPVf.js";import{s as p}from"./PooledRBush-BlFOlUgK.js";import{g as h}from"./meshVertexSpaceUtils-DwMoblqo.js";import{P as u}from"./georeference-DqFdARS7.js";import"./MeshLocalVertexSpace-DRvwbFTJ.js";import"./vec3-DdRUbala.js";import"./mat3f64-q3fE-ZOt.js";import"./mat4f64-CSKppSlJ.js";import"./computeTranslationToOriginAndRotation-BeE3rOSz.js";import"./DoubleArray--0pYeNcV.js";import"./quat-C0wQB0HB.js";import"./quatf64-Bdb9ZJJK.js";import"./BufferView-3om6S_aJ.js";class b{async createIndex(t,r){var m;const e=new Array;if(!((m=t.vertexAttributes)!=null&&m.position))return new p;const a=this._createMeshData(t),n=r!=null?await r.invoke("createIndexThread",a,{transferList:e}):this.createIndexThread(a).result;return this._createPooledRBush().fromJSON(n)}createIndexThread(t){const r=new Float64Array(t.position),e=this._createPooledRBush();return t.components?this._createIndexComponentsThread(e,r,t.components.map(a=>new Uint32Array(a))):this._createIndexAllThread(e,r)}_createIndexAllThread(t,r){const e=new Array(r.length/9);let a=0;for(let n=0;n!e.faces)?{position:r}:{position:r,components:t.components.map(e=>e.faces)}}_createPooledRBush(){return new p(9,l("esri-csp-restrictions")?t=>t:[".minX",".minY",".maxX",".maxY"])}}function c(o,t,r,e){return{minX:Math.min(o[t],o[r],o[e]),maxX:Math.max(o[t],o[r],o[e]),minY:Math.min(o[t+1],o[r+1],o[e+1]),maxY:Math.max(o[t+1],o[r+1],o[e+1]),p0:[o[t],o[t+1],o[t+2]],p1:[o[r],o[r+1],o[r+2]],p2:[o[e],o[e+1],o[e+2]]}}export{b as default}; diff --git a/assets/ExportImageParameters-DVsh-7G1.js b/assets/ExportImageParameters-CXqmEVur.js similarity index 95% rename from assets/ExportImageParameters-DVsh-7G1.js rename to assets/ExportImageParameters-CXqmEVur.js index aa31248..6a7fe0d 100644 --- a/assets/ExportImageParameters-DVsh-7G1.js +++ b/assets/ExportImageParameters-CXqmEVur.js @@ -1 +1 @@ -import{d as t,y as a,bK as h,f as c,a7 as p,n as u}from"./index-CEWggaxV.js";import{d as b}from"./scaleUtils-Bqauo1zZ.js";import{n as m}from"./floorFilterUtils-DZ5C6FQv.js";import{n as d}from"./sublayerUtils-BPYHHPMV.js";const f={visible:"visibleSublayers",definitionExpression:"layerDefs",labelingInfo:"hasDynamicLayers",labelsVisible:"hasDynamicLayers",opacity:"hasDynamicLayers",minScale:"visibleSublayers",maxScale:"visibleSublayers",renderer:"hasDynamicLayers",source:"hasDynamicLayers"};let r=class extends p{constructor(e){super(e),this.floors=null,this.scale=0}destroy(){this.layer=null}get dynamicLayers(){if(!this.hasDynamicLayers)return null;const e=this.visibleSublayers.map(s=>{const o=m(this.floors,s);return s.toExportImageJSON(o)});return e.length?JSON.stringify(e):null}get hasDynamicLayers(){return this.layer&&d(this.visibleSublayers,this.layer.serviceSublayers,this.layer.gdbVersion)}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.removeHandles("layer"),e&&this.addHandles([e.allSublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("sublayer-update",s=>this.notifyChange(f[s.propertyName]))],"layer"))}get layers(){const e=this.visibleSublayers;return e?e.length?"show:"+e.map(s=>s.id).join(","):"show:-1":null}get layerDefs(){var o;const e=!!((o=this.floors)!=null&&o.length),s=this.visibleSublayers.filter(l=>l.definitionExpression!=null||e&&l.floorInfo!=null);return s.length?JSON.stringify(s.reduce((l,n)=>{const i=m(this.floors,n),y=u(i,n.definitionExpression);return y!=null&&(l[n.id]=y),l},{})):null}get version(){this.commitProperty("layers"),this.commitProperty("layerDefs"),this.commitProperty("dynamicLayers"),this.commitProperty("timeExtent");const e=this.layer;return e&&(e.commitProperty("dpi"),e.commitProperty("imageFormat"),e.commitProperty("imageTransparency"),e.commitProperty("gdbVersion")),(this._get("version")||0)+1}get visibleSublayers(){const e=[];if(!this.layer)return e;const s=this.layer.sublayers,o=this.scale,l=i=>{i.visible&&(o===0||b(o,i.minScale,i.maxScale))&&(i.sublayers?i.sublayers.forEach(l):e.unshift(i))};s&&s.forEach(l);const n=this._get("visibleSublayers");return!n||n.length!==e.length||n.some((i,y)=>e[y]!==i)?e:n}toJSON(){const e=this.layer;let s={dpi:e.dpi,format:e.imageFormat,transparent:e.imageTransparency,gdbVersion:e.gdbVersion||null};return this.hasDynamicLayers&&this.dynamicLayers?s.dynamicLayers=this.dynamicLayers:s={...s,layers:this.layers,layerDefs:this.layerDefs},s}};t([a({readOnly:!0})],r.prototype,"dynamicLayers",null),t([a()],r.prototype,"floors",void 0),t([a({readOnly:!0})],r.prototype,"hasDynamicLayers",null),t([a()],r.prototype,"layer",null),t([a({readOnly:!0})],r.prototype,"layers",null),t([a({readOnly:!0})],r.prototype,"layerDefs",null),t([a({type:Number})],r.prototype,"scale",void 0),t([a(h)],r.prototype,"timeExtent",void 0),t([a({readOnly:!0})],r.prototype,"version",null),t([a({readOnly:!0})],r.prototype,"visibleSublayers",null),r=t([c("esri.layers.mixins.ExportImageParameters")],r);export{r as m}; +import{d as t,y as a,bK as h,f as c,a7 as p,n as u}from"./index-BjUNJPVf.js";import{d as b}from"./scaleUtils-DWXMiS7R.js";import{n as m}from"./floorFilterUtils-DZ5C6FQv.js";import{n as d}from"./sublayerUtils-GrJ1gnTG.js";const f={visible:"visibleSublayers",definitionExpression:"layerDefs",labelingInfo:"hasDynamicLayers",labelsVisible:"hasDynamicLayers",opacity:"hasDynamicLayers",minScale:"visibleSublayers",maxScale:"visibleSublayers",renderer:"hasDynamicLayers",source:"hasDynamicLayers"};let r=class extends p{constructor(e){super(e),this.floors=null,this.scale=0}destroy(){this.layer=null}get dynamicLayers(){if(!this.hasDynamicLayers)return null;const e=this.visibleSublayers.map(s=>{const o=m(this.floors,s);return s.toExportImageJSON(o)});return e.length?JSON.stringify(e):null}get hasDynamicLayers(){return this.layer&&d(this.visibleSublayers,this.layer.serviceSublayers,this.layer.gdbVersion)}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.removeHandles("layer"),e&&this.addHandles([e.allSublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("sublayer-update",s=>this.notifyChange(f[s.propertyName]))],"layer"))}get layers(){const e=this.visibleSublayers;return e?e.length?"show:"+e.map(s=>s.id).join(","):"show:-1":null}get layerDefs(){var o;const e=!!((o=this.floors)!=null&&o.length),s=this.visibleSublayers.filter(l=>l.definitionExpression!=null||e&&l.floorInfo!=null);return s.length?JSON.stringify(s.reduce((l,n)=>{const i=m(this.floors,n),y=u(i,n.definitionExpression);return y!=null&&(l[n.id]=y),l},{})):null}get version(){this.commitProperty("layers"),this.commitProperty("layerDefs"),this.commitProperty("dynamicLayers"),this.commitProperty("timeExtent");const e=this.layer;return e&&(e.commitProperty("dpi"),e.commitProperty("imageFormat"),e.commitProperty("imageTransparency"),e.commitProperty("gdbVersion")),(this._get("version")||0)+1}get visibleSublayers(){const e=[];if(!this.layer)return e;const s=this.layer.sublayers,o=this.scale,l=i=>{i.visible&&(o===0||b(o,i.minScale,i.maxScale))&&(i.sublayers?i.sublayers.forEach(l):e.unshift(i))};s&&s.forEach(l);const n=this._get("visibleSublayers");return!n||n.length!==e.length||n.some((i,y)=>e[y]!==i)?e:n}toJSON(){const e=this.layer;let s={dpi:e.dpi,format:e.imageFormat,transparent:e.imageTransparency,gdbVersion:e.gdbVersion||null};return this.hasDynamicLayers&&this.dynamicLayers?s.dynamicLayers=this.dynamicLayers:s={...s,layers:this.layers,layerDefs:this.layerDefs},s}};t([a({readOnly:!0})],r.prototype,"dynamicLayers",null),t([a()],r.prototype,"floors",void 0),t([a({readOnly:!0})],r.prototype,"hasDynamicLayers",null),t([a()],r.prototype,"layer",null),t([a({readOnly:!0})],r.prototype,"layers",null),t([a({readOnly:!0})],r.prototype,"layerDefs",null),t([a({type:Number})],r.prototype,"scale",void 0),t([a(h)],r.prototype,"timeExtent",void 0),t([a({readOnly:!0})],r.prototype,"version",null),t([a({readOnly:!0})],r.prototype,"visibleSublayers",null),r=t([c("esri.layers.mixins.ExportImageParameters")],r);export{r as m}; diff --git a/assets/ExportStrategy-fFnMYcIc.js b/assets/ExportStrategy-SzILz8ne.js similarity index 96% rename from assets/ExportStrategy-fFnMYcIc.js rename to assets/ExportStrategy-SzILz8ne.js index 257d330..3f26d1b 100644 --- a/assets/ExportStrategy-fFnMYcIc.js +++ b/assets/ExportStrategy-SzILz8ne.js @@ -1 +1 @@ -import{ai as W,a as E,d as p,y as c,f as $,a7 as N,k as R,at as _,aj as H,ay as T,dc as q,dX as z,dZ as I,h as j}from"./index-CEWggaxV.js";import{b as B}from"./Bitmap--gOrgR8J.js";const C=Math.PI/180;function U(e){return e*C}function k(e,i){const s=U(i.rotation),t=Math.abs(Math.cos(s)),r=Math.abs(Math.sin(s)),[o,n]=i.size;return e[0]=Math.round(n*r+o*t),e[1]=Math.round(n*t+o*r),e}function A(e,i,s,t){const[r,o]=i,[n,a]=t,l=.5*s;return e[0]=r-l*n,e[1]=o-l*a,e[2]=r+l*n,e[3]=o+l*a,e}const u=W(),m=[0,0],v=new E(0,0,0,0),y={container:null,fetchSource:null,requestUpdate:null,imageMaxWidth:2048,imageMaxHeight:2048,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1};let h=class extends N{constructor(e){super(e),this._imagePromise=null,this.bitmaps=[],this.hidpi=y.hidpi,this.imageMaxWidth=y.imageMaxWidth,this.imageMaxHeight=y.imageMaxHeight,this.imageRotationSupported=y.imageRotationSupported,this.imageNormalizationSupported=y.imageNormalizationSupported,this.update=R(async(i,s)=>{if(_(s),!i.stationary||this.destroyed)return;const t=i.state,r=H(t.spatialReference),o=this.hidpi?i.pixelRatio:1,n=this.imageNormalizationSupported&&t.worldScreenWidth&&t.worldScreenWidtha||Math.floor(m[1]*o)>l,M=r&&(t.extent.xminr.valid[1]),f=!this.imageNormalizationSupported&&M,w=!S&&!f,x=this.imageRotationSupported?t.rotation:0,b=this.container.children.slice();if(w){const d=n?t.paddedViewState.center:t.center;this._imagePromise&&console.error("Image promise was not defined!"),this._imagePromise=this._singleExport(t,m,d,t.resolution,x,o,s)}else{let d=Math.min(a,l);f&&(d=Math.min(t.worldScreenWidth,d)),this._imagePromise=this._tiledExport(t,d,o,s)}try{const d=await this._imagePromise??[];_(s);const P=[];if(this._imagePromise=null,this.destroyed)return;this.bitmaps=d;for(const g of b)d.includes(g)||P.push(g.fadeOut().then(()=>{g.remove(),g.destroy()}));for(const g of d)P.push(g.fadeIn());await Promise.all(P)}catch(d){this._imagePromise=null,T(d)}},5e3),this.updateExports=R(async i=>{const s=[];for(const t of this.container.children){if(!t.visible||!t.stage)return;s.push(i(t).then(()=>{t.invalidateTexture(),t.requestRender()}))}this._imagePromise=q(s).then(()=>this._imagePromise=null),await this._imagePromise})}destroy(){this.bitmaps.forEach(e=>e.destroy()),this.bitmaps=[]}get updating(){return!this.destroyed&&this._imagePromise!==null}async _export(e,i,s,t,r,o){const n=await this.fetchSource(e,Math.floor(i*r),Math.floor(s*r),{rotation:t,pixelRatio:r,signal:o});_(o);const a=new B(null,!0);return a.x=e.xmin,a.y=e.ymax,a.resolution=e.width/i,a.rotation=t,a.pixelRatio=r,a.opacity=0,this.container.addChild(a),await a.setSourceAsync(n,o),_(o),a}async _singleExport(e,i,s,t,r,o,n){A(u,s,t,i);const a=z(u,e.spatialReference);return[await this._export(a,i[0],i[1],r,o,n)]}_tiledExport(e,i,s,t){const r=I.create({size:i,spatialReference:e.spatialReference,scales:[e.scale]}),o=new j(r),n=o.getTileCoverage(e);if(!n)return null;const a=[];return n.forEach((l,S,M,f)=>{v.set(l,S,M,0),o.getTileBounds(u,v);const w=z(u,e.spatialReference);a.push(this._export(w,i,i,0,s,t).then(x=>(f!==0&&(v.set(l,S,M,f),o.getTileBounds(u,v),x.x=u[0],x.y=u[3]),x)))}),Promise.all(a)}};p([c()],h.prototype,"_imagePromise",void 0),p([c()],h.prototype,"bitmaps",void 0),p([c()],h.prototype,"container",void 0),p([c()],h.prototype,"fetchSource",void 0),p([c()],h.prototype,"hidpi",void 0),p([c()],h.prototype,"imageMaxWidth",void 0),p([c()],h.prototype,"imageMaxHeight",void 0),p([c()],h.prototype,"imageRotationSupported",void 0),p([c()],h.prototype,"imageNormalizationSupported",void 0),p([c()],h.prototype,"requestUpdate",void 0),p([c()],h.prototype,"updating",null),h=p([$("esri.views.2d.layers.support.ExportStrategy")],h);const X=h;export{X as v}; +import{ai as W,a as E,d as p,y as c,f as $,a7 as N,k as R,at as _,aj as H,ay as T,dc as q,dX as z,dZ as I,h as j}from"./index-BjUNJPVf.js";import{b as B}from"./Bitmap-DpyomsG7.js";const C=Math.PI/180;function U(e){return e*C}function k(e,i){const s=U(i.rotation),t=Math.abs(Math.cos(s)),r=Math.abs(Math.sin(s)),[o,n]=i.size;return e[0]=Math.round(n*r+o*t),e[1]=Math.round(n*t+o*r),e}function A(e,i,s,t){const[r,o]=i,[n,a]=t,l=.5*s;return e[0]=r-l*n,e[1]=o-l*a,e[2]=r+l*n,e[3]=o+l*a,e}const u=W(),m=[0,0],v=new E(0,0,0,0),y={container:null,fetchSource:null,requestUpdate:null,imageMaxWidth:2048,imageMaxHeight:2048,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1};let h=class extends N{constructor(e){super(e),this._imagePromise=null,this.bitmaps=[],this.hidpi=y.hidpi,this.imageMaxWidth=y.imageMaxWidth,this.imageMaxHeight=y.imageMaxHeight,this.imageRotationSupported=y.imageRotationSupported,this.imageNormalizationSupported=y.imageNormalizationSupported,this.update=R(async(i,s)=>{if(_(s),!i.stationary||this.destroyed)return;const t=i.state,r=H(t.spatialReference),o=this.hidpi?i.pixelRatio:1,n=this.imageNormalizationSupported&&t.worldScreenWidth&&t.worldScreenWidtha||Math.floor(m[1]*o)>l,M=r&&(t.extent.xminr.valid[1]),f=!this.imageNormalizationSupported&&M,w=!S&&!f,x=this.imageRotationSupported?t.rotation:0,b=this.container.children.slice();if(w){const d=n?t.paddedViewState.center:t.center;this._imagePromise&&console.error("Image promise was not defined!"),this._imagePromise=this._singleExport(t,m,d,t.resolution,x,o,s)}else{let d=Math.min(a,l);f&&(d=Math.min(t.worldScreenWidth,d)),this._imagePromise=this._tiledExport(t,d,o,s)}try{const d=await this._imagePromise??[];_(s);const P=[];if(this._imagePromise=null,this.destroyed)return;this.bitmaps=d;for(const g of b)d.includes(g)||P.push(g.fadeOut().then(()=>{g.remove(),g.destroy()}));for(const g of d)P.push(g.fadeIn());await Promise.all(P)}catch(d){this._imagePromise=null,T(d)}},5e3),this.updateExports=R(async i=>{const s=[];for(const t of this.container.children){if(!t.visible||!t.stage)return;s.push(i(t).then(()=>{t.invalidateTexture(),t.requestRender()}))}this._imagePromise=q(s).then(()=>this._imagePromise=null),await this._imagePromise})}destroy(){this.bitmaps.forEach(e=>e.destroy()),this.bitmaps=[]}get updating(){return!this.destroyed&&this._imagePromise!==null}async _export(e,i,s,t,r,o){const n=await this.fetchSource(e,Math.floor(i*r),Math.floor(s*r),{rotation:t,pixelRatio:r,signal:o});_(o);const a=new B(null,!0);return a.x=e.xmin,a.y=e.ymax,a.resolution=e.width/i,a.rotation=t,a.pixelRatio=r,a.opacity=0,this.container.addChild(a),await a.setSourceAsync(n,o),_(o),a}async _singleExport(e,i,s,t,r,o,n){A(u,s,t,i);const a=z(u,e.spatialReference);return[await this._export(a,i[0],i[1],r,o,n)]}_tiledExport(e,i,s,t){const r=I.create({size:i,spatialReference:e.spatialReference,scales:[e.scale]}),o=new j(r),n=o.getTileCoverage(e);if(!n)return null;const a=[];return n.forEach((l,S,M,f)=>{v.set(l,S,M,0),o.getTileBounds(u,v);const w=z(u,e.spatialReference);a.push(this._export(w,i,i,0,s,t).then(x=>(f!==0&&(v.set(l,S,M,f),o.getTileBounds(u,v),x.x=u[0],x.y=u[3]),x)))}),Promise.all(a)}};p([c()],h.prototype,"_imagePromise",void 0),p([c()],h.prototype,"bitmaps",void 0),p([c()],h.prototype,"container",void 0),p([c()],h.prototype,"fetchSource",void 0),p([c()],h.prototype,"hidpi",void 0),p([c()],h.prototype,"imageMaxWidth",void 0),p([c()],h.prototype,"imageMaxHeight",void 0),p([c()],h.prototype,"imageRotationSupported",void 0),p([c()],h.prototype,"imageNormalizationSupported",void 0),p([c()],h.prototype,"requestUpdate",void 0),p([c()],h.prototype,"updating",null),h=p([$("esri.views.2d.layers.support.ExportStrategy")],h);const X=h;export{X as v}; diff --git a/assets/ExportWMSImageParameters-D7gw-oIo.js b/assets/ExportWMSImageParameters-Bl6JFYua.js similarity index 95% rename from assets/ExportWMSImageParameters-D7gw-oIo.js rename to assets/ExportWMSImageParameters-Bl6JFYua.js index 25a48a3..95ef08d 100644 --- a/assets/ExportWMSImageParameters-D7gw-oIo.js +++ b/assets/ExportWMSImageParameters-Bl6JFYua.js @@ -1 +1 @@ -import{d as a,y as l,f as m,a7 as h}from"./index-CEWggaxV.js";const b={visible:"visibleSublayers"};let s=class extends h{constructor(e){super(e),this.scale=0}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.removeHandles("layer"),e&&this.addHandles([e.sublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("wms-sublayer-update",r=>this.notifyChange(b[r.propertyName]))],"layer"))}get layers(){return this.visibleSublayers.filter(({name:e})=>e).map(({name:e})=>e).join()}get version(){this.commitProperty("layers");const e=this.layer;return e&&e.commitProperty("imageTransparency"),(this._get("version")||0)+1}get visibleSublayers(){const{layer:e,scale:r}=this,t=e==null?void 0:e.sublayers,i=[],o=n=>{const{minScale:y,maxScale:p,sublayers:u,visible:c}=n;c&&(r===0||(y===0||r<=y)&&(p===0||r>=p))&&(u?u.forEach(o):i.push(n))};return t==null||t.forEach(o),i}toJSON(){const{layer:e,layers:r}=this,{imageFormat:t,imageTransparency:i,version:o}=e;return{format:t,request:"GetMap",service:"WMS",styles:"",transparent:i?"TRUE":"FALSE",version:o,layers:r}}};a([l()],s.prototype,"layer",null),a([l({readOnly:!0})],s.prototype,"layers",null),a([l({type:Number})],s.prototype,"scale",void 0),a([l({readOnly:!0})],s.prototype,"version",null),a([l({readOnly:!0})],s.prototype,"visibleSublayers",null),s=a([m("esri.layers.support.ExportWMSImageParameters")],s);export{s as a}; +import{d as a,y as l,f as m,a7 as h}from"./index-BjUNJPVf.js";const b={visible:"visibleSublayers"};let s=class extends h{constructor(e){super(e),this.scale=0}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.removeHandles("layer"),e&&this.addHandles([e.sublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("wms-sublayer-update",r=>this.notifyChange(b[r.propertyName]))],"layer"))}get layers(){return this.visibleSublayers.filter(({name:e})=>e).map(({name:e})=>e).join()}get version(){this.commitProperty("layers");const e=this.layer;return e&&e.commitProperty("imageTransparency"),(this._get("version")||0)+1}get visibleSublayers(){const{layer:e,scale:r}=this,t=e==null?void 0:e.sublayers,i=[],o=n=>{const{minScale:y,maxScale:p,sublayers:u,visible:c}=n;c&&(r===0||(y===0||r<=y)&&(p===0||r>=p))&&(u?u.forEach(o):i.push(n))};return t==null||t.forEach(o),i}toJSON(){const{layer:e,layers:r}=this,{imageFormat:t,imageTransparency:i,version:o}=e;return{format:t,request:"GetMap",service:"WMS",styles:"",transparent:i?"TRUE":"FALSE",version:o,layers:r}}};a([l()],s.prototype,"layer",null),a([l({readOnly:!0})],s.prototype,"layers",null),a([l({type:Number})],s.prototype,"scale",void 0),a([l({readOnly:!0})],s.prototype,"version",null),a([l({readOnly:!0})],s.prototype,"visibleSublayers",null),s=a([m("esri.layers.support.ExportWMSImageParameters")],s);export{s as a}; diff --git a/assets/External-DC51KyR4.js b/assets/External-DIoD7Bb4.js similarity index 96% rename from assets/External-DC51KyR4.js rename to assets/External-DIoD7Bb4.js index 90b51cd..11ddc52 100644 --- a/assets/External-DC51KyR4.js +++ b/assets/External-DIoD7Bb4.js @@ -1 +1 @@ -import{de as g,at as p,M as b}from"./index-CEWggaxV.js";import{c as N,u as A,i as v}from"./infoFor3D-DsOdlPuA.js";class m{constructor(r,s,t){this.assetName=r,this.assetMimeType=s,this.parts=t}equals(r){return this===r||this.assetName===r.assetName&&this.assetMimeType===r.assetMimeType&&g(this.parts,r.parts,(s,t)=>s.equals(t))}isOnService(r){return this.parts.every(s=>s.isOnService(r))}makeHash(){let r="";for(const s of this.parts)r+=s.partHash;return r}async toBlob(r){const{parts:s}=this;if(s.length===1)return s[0].toBlob(r);const t=await Promise.all(s.map(a=>a.toBlob(r)));return p(r),new Blob(t)}}class B{constructor(r,s){this.partUrl=r,this.partHash=s}equals(r){return this===r||this.partUrl===r.partUrl&&this.partHash===r.partHash}isOnService(r){return this.partUrl.startsWith(`${r.path}/assets/`)}async toBlob(r){const{data:s}=await b(this.partUrl,{responseType:"blob"});return p(r),s}}function H(e){return $(e==null?void 0:e.source)}function u(e){return Array.isArray(e)?e.every(r=>r instanceof m):!1}const c=/^(model\/gltf\+json)|(model\/gltf-binary)$/,f=/\.(gltf|glb)/i;function $(e){return e?Array.isArray(e)?e.some(l):l(e):!1}function l(e){if(e instanceof File){const{type:r,name:s}=e;return c.test(r)||f.test(s)}return c.test(e.assetMimeType)||f.test(e.assetName)}function d(e,r){if(!e)return!1;const{source:s}=e;return M(s,r)}function q(e,r){if(e===r)return!0;const{source:s}=e,{source:t}=r;if(s===t)return!0;if(u(s)&&u(t)){if(s.length!==t.length)return!1;const a=(n,o)=>n.assetNameo.assetName?1:0,i=[...s].sort(a),y=[...t].sort(a);for(let n=0;n0&&s.every(t=>h(t,r))}return h(e,r)}function h(e,r){return e instanceof m&&e.isOnService(r)}function O(e,r){return e instanceof File?N(e,r):A(e.assetMimeType,r)??v(e.assetName,r)}function S(e){return Array.isArray(e)?e:[e]}function w(e){return!!e.original}export{S as A,O as N,d as h,m as i,B as o,H as u,w as v,q as y}; +import{de as g,at as p,M as b}from"./index-BjUNJPVf.js";import{c as N,u as A,i as v}from"./infoFor3D-DsOdlPuA.js";class m{constructor(r,s,t){this.assetName=r,this.assetMimeType=s,this.parts=t}equals(r){return this===r||this.assetName===r.assetName&&this.assetMimeType===r.assetMimeType&&g(this.parts,r.parts,(s,t)=>s.equals(t))}isOnService(r){return this.parts.every(s=>s.isOnService(r))}makeHash(){let r="";for(const s of this.parts)r+=s.partHash;return r}async toBlob(r){const{parts:s}=this;if(s.length===1)return s[0].toBlob(r);const t=await Promise.all(s.map(a=>a.toBlob(r)));return p(r),new Blob(t)}}class B{constructor(r,s){this.partUrl=r,this.partHash=s}equals(r){return this===r||this.partUrl===r.partUrl&&this.partHash===r.partHash}isOnService(r){return this.partUrl.startsWith(`${r.path}/assets/`)}async toBlob(r){const{data:s}=await b(this.partUrl,{responseType:"blob"});return p(r),s}}function H(e){return $(e==null?void 0:e.source)}function u(e){return Array.isArray(e)?e.every(r=>r instanceof m):!1}const c=/^(model\/gltf\+json)|(model\/gltf-binary)$/,f=/\.(gltf|glb)/i;function $(e){return e?Array.isArray(e)?e.some(l):l(e):!1}function l(e){if(e instanceof File){const{type:r,name:s}=e;return c.test(r)||f.test(s)}return c.test(e.assetMimeType)||f.test(e.assetName)}function d(e,r){if(!e)return!1;const{source:s}=e;return M(s,r)}function q(e,r){if(e===r)return!0;const{source:s}=e,{source:t}=r;if(s===t)return!0;if(u(s)&&u(t)){if(s.length!==t.length)return!1;const a=(n,o)=>n.assetNameo.assetName?1:0,i=[...s].sort(a),y=[...t].sort(a);for(let n=0;n0&&s.every(t=>h(t,r))}return h(e,r)}function h(e,r){return e instanceof m&&e.isOnService(r)}function O(e,r){return e instanceof File?N(e,r):A(e.assetMimeType,r)??v(e.assetName,r)}function S(e){return Array.isArray(e)?e:[e]}function w(e){return!!e.original}export{S as A,O as N,d as h,m as i,B as o,H as u,w as v,q as y}; diff --git a/assets/FeatureCommandQueue-Btq_FXyi.js b/assets/FeatureCommandQueue-DI81F3gA.js similarity index 99% rename from assets/FeatureCommandQueue-Btq_FXyi.js rename to assets/FeatureCommandQueue-DI81F3gA.js index f7535fb..ba549b5 100644 --- a/assets/FeatureCommandQueue-Btq_FXyi.js +++ b/assets/FeatureCommandQueue-DI81F3gA.js @@ -1,3 +1,3 @@ -import{g as x,_ as S,h as qt,P as pe,j as jt,i as j,G as z,m as Q,B as Se,p as n,q as H,H as V,u as Kt,v as Xt,w as A,C as y,S as U,F as yt,x as Ri,y as Te,z as X,A as Ve,D as je,E as Ke,I as He,L as st,M as _t,N as Zt,O as Yt,a as B,Q as Ii,R as Ci,T as Oi,V as Ei,X as Di,Y as Li,$ as Bi,a0 as ce,a1 as zt,a2 as Qt,a3 as rt,a4 as $t,a5 as Mt,a6 as Pt,a7 as D,a8 as Jt,a9 as ei,aa as at,ab as ki,ac as le,ad as Ft,ae as ot,af as ti,ag as Ni,ah as Ui,ai as Ye,aj as Hi,ak as Wi,al as Gi,am as qi,an as ji,ao as ii,ap as si,aq as ri,ar as ai,as as oi,at as ni,au as bt,av as li,aw as Ki,ax as Tt,ay as nt,az as ui,aA as lt,aB as Qe,aC as Xi,aD as Zi,aE as Yi,aF as Qi,aG as Ji,aH as es,aI as ts,aJ as is,aK as ss,aL as rs,aM as as,aN as os,aO as ns,aP as re,aQ as he,aR as ae,aS as $e,aT as ls,K as us,d as cs}from"./UpdateTracking2D-nj9Q-3df.js";import{t as ps}from"./utils-p-5Bbga5.js";import{d as c,lt as R,ij as N,g5 as Z,fX as At,iv as ds,L as _e,D as ut,is as ci,g3 as hs,U as We,i3 as fs,lu as Rt,lv as ms,g2 as ct,N as De,v as fe,l as It,fV as Ct,s as pi,hf as ys,iS as Je,lw as Ot,kl as bs,iU as vs,f0 as Et,la as vt,bh as xe,lx as gs,bo as xs,bn as ws,q as Ss,kg as Vs}from"./index-CEWggaxV.js";import{E as we,S as de,f as pt,m as F,c as E,y as I,M as L,d as _s,e as W,w as Xe,L as Oe}from"./Container-CB7SlLB9.js";import{h as Dt,s as zs,i as di,x as hi}from"./Program-DLRmaKpw.js";import{o as $s}from"./ProgramTemplate-BICQrNzS.js";import{a as fi}from"./LabelMetric-D2hbzzy_.js";import{e as Ge,m as mi}from"./Texture-DJgkMrSB.js";import{o as Ms}from"./constants-D5zmR9t2.js";import{c as Lt}from"./WGLContainer-B_Pv-8Yi.js";let k=class{constructor(e){this.registryName=e,this.postProcessingEnabled=!1,this.overrideStencilRef=null,this.drawPhase=we.MAP|we.HITTEST|we.HIGHLIGHT|we.DEBUG,this.symbologyPlane=de.FILL}startup(){}shutdown(e){}postProcess(e,t){}},yi=class extends qt{};c([x(0,y)],yi.prototype,"pos",void 0);let Ps=class extends Te{},bi=class extends pe{};c([S(n)],bi.prototype,"dotSize",void 0);let Le=class extends pe{};c([S(U)],Le.prototype,"locations",void 0),c([S(n)],Le.prototype,"pixelRatio",void 0),c([S(n)],Le.prototype,"tileZoomFactor",void 0);const Fs=1e-6;class ye extends jt{vertex(e){const t=new j(1,0,0,0,-1,0,0,1,1).multiply(new z(e.pos.xy.divide(N),1)),i=Q(this.draw.locations,t.xy),r=Se(this.instance.dotSize.divide(2),new n(1));let a=new n(0);a=a.add(H(i.a,new n(Fs)).multiply(2));let o=r.add(this.instance.dotSize);const l=this.view.displayViewScreenMat3.multiply(new z(e.pos.add(.5),1)),u=new V(l.xy,a,1),p=this.instance.dotSize.divide(o),d=new n(-1).divide(r.divide(o));return o=o.multiply(this.draw.pixelRatio.multiply(this.draw.tileZoomFactor)),{glPosition:u,glPointSize:o,color:i,ratio:p,invEdgeRatio:d}}fragment(e){const t=Kt(e.glPointCoord.subtract(.5)).multiply(2),i=Xt(new n(0),new n(1),e.invEdgeRatio.multiply(t.subtract(e.ratio)).add(1)),r=new yt;return r.glFragColor=e.color.multiply(i),r}}c([S(bi)],ye.prototype,"instance",void 0),c([S(Le)],ye.prototype,"draw",void 0),c([S(Ri)],ye.prototype,"view",void 0),c([R(0,A(yi))],ye.prototype,"vertex",null),c([R(0,A(Ps))],ye.prototype,"fragment",null);class vi extends je{}c([x(3,n)],vi.prototype,"inverseArea",void 0);let Be=class extends pe{};c([S(X.ofType(V,2))],Be.prototype,"isActive",void 0),c([S(X.ofType(V,8))],Be.prototype,"colors",void 0),c([S(n)],Be.prototype,"dotValue",void 0);let be=class extends pe{};c([S(U)],be.prototype,"dotTexture0",void 0),c([S(U)],be.prototype,"dotTexture1",void 0),c([S(n)],be.prototype,"tileZoomFactor",void 0),c([S(n)],be.prototype,"pixelRatio",void 0),c([S(n)],be.prototype,"tileDotsOverArea",void 0);let ve=class extends Ke{_dotThreshold(e,t,i){return e.divide(t).divide(i)}vertex(e){const t=new j(2/N,0,0,0,-2/N,0,-1,1,1).multiply(new z(e.pos,1)),i=this.clip(e.id),r=new V(t.xy,i,1),a=this.storage.getVVData(e.id).multiply(this.instance.isActive.get(0)).multiply(e.inverseArea),o=this.storage.getDataDrivenData0(e.id).multiply(this.instance.isActive.get(1)).multiply(e.inverseArea),l=this.draw.tileZoomFactor.multiply(N).divide(this.draw.pixelRatio),u=this._dotThreshold(a,this.instance.dotValue,this.draw.tileDotsOverArea),p=this._dotThreshold(o,this.instance.dotValue,this.draw.tileDotsOverArea),d=e.pos.add(.5).divide(l);return{glPosition:r,color:new V(0,0,0,0),textureCoords:d,thresholds0:u,thresholds1:p}}fragment(e){const t=new yt,i=Q(this.draw.dotTexture0,e.textureCoords),r=Q(this.draw.dotTexture1,e.textureCoords),a=e.thresholds0.subtract(i),o=e.thresholds1.subtract(r);let l;const u=He.fromColumns(this.instance.colors[0],this.instance.colors[1],this.instance.colors[2],this.instance.colors[3]),p=He.fromColumns(this.instance.colors[4],this.instance.colors[5],this.instance.colors[6],this.instance.colors[7]);if(this.blending){const d=H(new n(0),a),h=H(new n(0),o),f=st(d,a).add(st(h,o)),m=H(f,new n(0)),v=new n(1).subtract(m),b=f.add(m),g=a.multiply(d).divide(b),w=o.multiply(h).divide(b),_=u.multiply(g).add(p.multiply(w));l=v.multiply(_)}else{const d=Se(_t(a),_t(o)),h=H(d,new n(0)),f=new n(1).subtract(h),m=H(d,a),v=H(d,o),b=u.multiply(m).add(p.multiply(v));l=f.multiply(b)}return t.glFragColor=l,t}hittest(e){return Zt(this.hittestRequest)}};c([Ve],ve.prototype,"blending",void 0),c([S(Be)],ve.prototype,"instance",void 0),c([S(be)],ve.prototype,"draw",void 0),c([R(0,A(vi))],ve.prototype,"vertex",null),c([R(0,A(Te))],ve.prototype,"fragment",null);const dt={[Z.BYTE]:1,[Z.UNSIGNED_BYTE]:1,[Z.SHORT]:2,[Z.UNSIGNED_SHORT]:2,[Z.INT]:4,[Z.UNSIGNED_INT]:4,[Z.FLOAT]:4};let Ts=class{constructor(e,t){this._boundPart=null;const i=[];for(const a of t.vertex){const o=Dt.createVertex(e,At.STATIC_DRAW,a);i.push(o)}const r=[];for(const a of t.index||[]){const o=Dt.createIndex(e,At.STATIC_DRAW,a);r.push(o)}this.groups=[];for(const a of t.groups){let o;if(a.index!=null){if(!t.index)throw new Error("No index data.");const{BYTES_PER_ELEMENT:f}=t.index[a.index];f===2?o=Z.UNSIGNED_SHORT:f===4&&(o=Z.UNSIGNED_INT)}const l=a.index!=null?r[a.index]:null,u=new Map,p={},d={};for(const f of a.attributes){const{name:m,count:v,type:b,offset:g,normalized:w,divisor:_,stride:P,vertex:T,location:C}=f,$=`vertex-buffer-${T}`;let K=p[$];K||(K=p[$]=[]);const ue=new ds(m,v,b,g,P,w,_);K.push(ue),u.set(m,C),d[$]=i[T]}const h=new $s(e,u,p,d,l);this.groups.push({...a,vertexArray:h,locations:u,layout:p,indexing:o})}this.parts=t.parts}bind(e,t){this._boundPart=t;const{group:i}=this.parts[this._boundPart],{vertexArray:r}=this.groups[i];e.bindVAO(r)}draw(e){if(this._boundPart==null)throw new Error("Mesh.bind() has not been called.");const{start:t,count:i}=this.parts[this._boundPart],{group:r}=this.parts[this._boundPart],{indexing:a,primitive:o}=this.groups[r];a?e.drawElements(o,i,a,t*dt[a]):e.drawArrays(o,t,i)}unbind(e){this._boundPart=null,e.bindVAO(null)}destroy(){for(const{vertexArray:e}of this.groups)e.dispose()}},As=class gi extends Ts{static create(e,t){const i=[];let{stride:r,hash:a}=t.layout;if(r==null){r=0;for(const{count:f,type:m,offset:v}of t.layout.attributes){if(v!=null)throw new Error("Stride cannot be computed automatically when attribute offsets are supplied explicitly.");r+=f*dt[m]}}let o=0,l=0;for(const{count:f,name:m,offset:v,type:b,normalized:g}of t.layout.attributes){v!=null&&(l=v);const w={name:m,location:o,vertex:0,count:f,type:b,offset:l,stride:r,divisor:0,normalized:g!=null&&g};i.push(w),o++,l+=f*dt[b]}const u={attributes:i,primitive:t.primitive};t.index!=null&&(u.index=0);let{count:p}=t;if(p==null&&(p=t.index?t.index.length:t.vertex.byteLength/r,Math.floor(p)!==p))throw new Error(`The byte length of vertex data must be an exact multiple of the stride, which is ${r}.`);const d={start:0,count:p,group:0,primitive:t.primitive},h={vertex:[t.vertex],parts:[d],groups:[u]};return t.index!=null&&(h.index=[t.index]),a==null&&(a=fi(i)),new gi(e,h,{hash:a,attributes:i,stride:r})}constructor(e,t,i){super(e,t),this.layout=i}bind(e,t=0){super.bind(e,t)}},Rs=class{constructor(){this._dotTextureSize=0,this._dotTextures=null,this._dotMesh=null}destroy(){this._disposeTextures(),this._dotFBO&&this._dotFBO.dispose(),this._dotMesh&&this._dotMesh.destroy()}getFBO(e){if(this._dotFBO==null){const t=N,i=N,r=new Ge(t,i);r.samplingMode=_e.NEAREST,r.wrapMode=ut.CLAMP_TO_EDGE;const a=new zs(e,new di(ci.DEPTH_STENCIL,t,i));this._dotFBO=new hi(e,r,a)}return this._dotFBO}getDotDensityMesh(e){if(this._dotMesh==null){const t=N,i=t*t,r=2,a=new Int16Array(i*r);for(let u=0;upi.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.heatmap.HeatmapResources");let Us=class{destroy(){this._accumulateFramebuffer=Ct(this._accumulateFramebuffer),this._resolveGradientTexture=Ct(this._resolveGradientTexture),this._prevGradientHash=null,this._qualityProfile=null}get initialized(){return this._accumulateFramebuffer!=null&&this._resolveGradientTexture!=null}get accumulateFramebuffer(){return this._accumulateFramebuffer}get resolveGradientTexture(){return this._resolveGradientTexture}loadQualityProfile(e){if(this._qualityProfile==null){const t=ks(e,Ns());this._qualityProfile={...t,defines:{usesHalfFloatPrecision:t.dataType!==We.FLOAT}}}return this._qualityProfile}ensureAccumulateFBO(e,t,i){if(this._accumulateFramebuffer==null){const{dataType:r,samplingMode:a,pixelFormat:o,internalFormat:l}=this.loadQualityProfile(e),u=new Ge(t,i);u.pixelFormat=o,u.internalFormat=l,u.dataType=r,u.samplingMode=a,u.wrapMode=ut.CLAMP_TO_EDGE;const p=new di(ci.DEPTH_STENCIL,t,i);this._accumulateFramebuffer=new hi(e,u,p)}else{const{width:r,height:a}=this._accumulateFramebuffer;r===t&&a===i||this._accumulateFramebuffer.resize(t,i)}return this._accumulateFramebuffer}ensureResolveGradientTexture(e,t,i){if(this._resolveGradientTexture==null){const r=new Ge;r.wrapMode=ut.CLAMP_TO_EDGE,this._resolveGradientTexture=new mi(e,r)}else this._prevGradientHash!==t&&(this._resolveGradientTexture.resize(i.length/4,1),this._resolveGradientTexture.setData(i),this._prevGradientHash=t);return this._resolveGradientTexture}};function xi(s){return s?.25:1}let wi=class extends je{};c([x(5,y)],wi.prototype,"offset",void 0);let Hs=class extends Te{},ht=class extends pe{};c([S(n)],ht.prototype,"radius",void 0),c([S(n)],ht.prototype,"isFieldActive",void 0);let Pe=class extends Ke{constructor(){super(...arguments),this.usesHalfFloatPrecision=!1}vertex(e){const{radius:t,isFieldActive:i}=this.kernelControls,r=e.offset,a=i.multiply(this.storage.getVVData(e.id).x).add(new n(1).subtract(i)),o=this.view.displayViewScreenMat3.multiply(new z(e.pos,1)).add(this.view.displayViewMat3.multiply(new z(r,0)).multiply(t)),l=this.clip(e.id);return{glPosition:new V(o.xy,l,1),offset:r,fieldValue:a,color:new V(0),...this.maybeRunHittest(e,{},null)}}fragment(e){const{offset:t,fieldValue:i}=e,r=Kt(t),a=H(r,new n(1)),o=new n(1).subtract(r.multiply(r)),l=o.multiply(o),u=a.multiply(l).multiply(i).multiply(new n(xi(this.usesHalfFloatPrecision)));return this.getFragmentOutput(new V(u),e)}hittest(e){const{viewMat3:t,tileMat3:i}=this.view,r=t.multiply(i).multiply(new z(e.pos,1));return Li(r.xy,this.kernelControls.radius,this.hittestRequest.position)}};c([Ve],Pe.prototype,"usesHalfFloatPrecision",void 0),c([S(ht)],Pe.prototype,"kernelControls",void 0),c([R(0,A(wi))],Pe.prototype,"vertex",null),c([R(0,A(Hs))],Pe.prototype,"fragment",null);let Si=class extends qt{};c([x(0,y)],Si.prototype,"pos",void 0);let Ws=class extends Bi{},ke=class extends pe{};c([S(U)],ke.prototype,"texture",void 0),c([S(y)],ke.prototype,"minAndInvRange",void 0),c([S(n)],ke.prototype,"normalization",void 0);let Vi=class extends pe{};c([S(U)],Vi.prototype,"texture",void 0);let ge=class extends jt{constructor(){super(...arguments),this.usesHalfFloatPrecision=!1}vertex(e){return{glPosition:new V(e.pos.multiply(2).subtract(1),1,1),uv:e.pos}}fragment(e){const{accumulatedDensity:t,gradient:i}=this;let r=Q(t.texture,e.uv).r.multiply(new n(xi(this.usesHalfFloatPrecision)));r=r.multiply(t.normalization),r=r.subtract(t.minAndInvRange.x).multiply(t.minAndInvRange.y);const a=Q(i.texture,new y(r,.5)),o=new yt;return o.glFragColor=new V(a.rgb.multiply(a.a),a.a),o}};c([Ve],ge.prototype,"usesHalfFloatPrecision",void 0),c([S(ke)],ge.prototype,"accumulatedDensity",void 0),c([S(Vi)],ge.prototype,"gradient",void 0),c([R(0,A(Si))],ge.prototype,"vertex",null),c([R(0,A(Ws))],ge.prototype,"fragment",null);let Gs=class extends k{constructor(){super(...arguments),this.meshWriter=B.HeatmapMeshWriter,this.shaders={accumulate:new Pe,resolve:new ge},this.postProcessingEnabled=!0,this._isBound=!1,this._resources=new Map,this.overrideStencilRef=_i}shutdown(e){var t;super.shutdown(e),(t=this._resources.get(e))==null||t.destroy(),this._resources.delete(e),this._prevFBO=null,this._unbind()}render(e,t){const{context:i,painter:r,state:a}=e,o=t.instance.getInput(),{isFieldActive:l}=o,u=this._getOrCreateResourcesRecord(i),p=u.loadQualityProfile(i);if(pt(e))return;F(e)||this._bind(e,u,o),r.setShader({shader:this.shaders.accumulate,uniforms:{...E(e,t.target),kernelControls:{radius:kt(o,a),isFieldActive:l?1:0}},defines:{...I(e),...p.defines},optionalAttributes:t.instance.optionalAttributes,useComputeBuffer:F(e)});const d=F(e)?js:zi;r.setPipelineState(d),r.submitDraw(i,t)}postProcess(e,t){if(F(e)||pt(e))return;const{context:i,painter:r}=e,a=this._resources.get(i);if(this._prevFBO==null||this._prevViewport==null||!(a!=null&&a.initialized))return;const{defines:o}=a.loadQualityProfile(i),{minDensity:l,maxDensity:u,radius:p}=t.getInput(),d=8,h=9,f=a.accumulateFramebuffer,m=a.resolveGradientTexture;r.setShader({shader:this.shaders.resolve,uniforms:{accumulatedDensity:{texture:{unit:d,texture:f.colorTexture},minAndInvRange:[l,1/(u-l)],normalization:3/(p*p*Math.PI)},gradient:{texture:{unit:h,texture:m}}},defines:o,optionalAttributes:{},useComputeBuffer:!1}),i.bindFramebuffer(this._prevFBO),i.setViewport(0,0,this._prevViewport.width,this._prevViewport.height),i.bindTexture(f.colorTexture,d),i.bindTexture(m,h),r.setPipelineState(Ks),r.submitDrawQuad(i),this._unbind()}_getOrCreateResourcesRecord(e){let t=this._resources.get(e);return t==null&&(t=new Us,this._resources.set(e,t)),t}_unbind(){this._prevFBO=null,this._prevViewport=null,this._isBound=!1}_bind(e,t,i){if(this._isBound)return;const{context:r,state:a,pixelRatio:o}=e,l=r.getBoundFramebufferObject(),u=r.getViewport();this._prevFBO=l,this._prevViewport=u;const{gradient:p,gradientHash:d}=i;t.ensureResolveGradientTexture(r,d,p);const{width:h,height:f}=u,m=qs(kt(i,a),o),v=h*m,b=f*m,g=t.ensureAccumulateFBO(r,v,b);r.blitFramebuffer(l,g,0,0,l.width,l.height,0,0,g.width,g.height,ct.STENCIL_BUFFER_BIT,_e.NEAREST),r.bindFramebuffer(g),r.setViewport(0,0,g.width,g.height),r.setColorMask(!0,!0,!0,!0),r.setClearColor(0,0,0,0),r.clear(ct.COLOR_BUFFER_BIT),this._isBound=!0}};function qs(s,e){const t=e>1.5?.25:.5;return s<1/(2*t)?1:t}function _i(s){return s.key.level+1}const zi={color:{write:[!0,!0,!0,!0],blendMode:"additive"},depth:!1,stencil:{write:!1,test:{ref:_i,compare:ys.GEQUAL,mask:255,op:{fail:Je.KEEP,zFail:Je.KEEP,zPass:Je.REPLACE}}}},js={...zi,stencil:!1},Ks={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!1};function kt(s,e){const{referenceScale:t,radius:i}=s;return i*(t!==0?t/e.scale:1)}let gt=class extends pe{getVVRotationMat4(e){return ce(zt(e),He.identity(),()=>{const t=this._getNormalizedAngle(e).multiply($t),i=Mt(t),r=Pt(t);return new He(r,i,0,0,i.multiply(new n(-1)),r,0,0,0,0,1,0,0,0,0,1)})}getVVRotationMat3(e){return ce(zt(e),j.identity(),()=>{const t=this._getNormalizedAngle(e).multiply($t),i=Mt(t),r=Pt(t);return new j(r,i,0,i.multiply(new n(-1)),r,0,0,0,1)})}_getNormalizedAngle(e){const t=Qt(this.rotationType,new n(rt.Arithmatic));return ce(t,new n(90).subtract(e),e)}};c([S(n)],gt.prototype,"rotationType",void 0);const Xs=360/254;class G extends je{}c([x(3,V)],G.prototype,"color",void 0),c([x(4,y)],G.prototype,"offset",void 0),c([x(5,y)],G.prototype,"textureUV",void 0),c([x(6,n)],G.prototype,"fontSize",void 0),c([x(7,n)],G.prototype,"referenceSize",void 0),c([x(8,n)],G.prototype,"haloFontSize",void 0),c([x(9,V)],G.prototype,"haloColor",void 0),c([x(10,y)],G.prototype,"zoomRange",void 0),c([x(11,n)],G.prototype,"clipAngle",void 0),c([x(12,V)],G.prototype,"referenceSymbol",void 0);let ft=class extends Jt{};c([x(13,y)],ft.prototype,"offsetNextVertex1",void 0),c([x(14,y)],ft.prototype,"offsetNextVertex2",void 0);class Zs extends Te{}class O extends Ke{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"]},this.isHaloPass=!1,this.isBackgroundPass=!1,this.isLabel=!1}clipLabel(e,t,i){const r=t.multiply(Xs),a=ei(this.view.rotation.subtract(r)),o=at(new n(360).subtract(a),a);let l=new n(0);const u=ki(this.view.currentZoom.multiply(Ot)).divide(Ot),p=e.x,d=e.y,h=new n(1).subtract(H(p,u)).multiply(2),f=H(new n(90),o).multiply(2),m=new n(2).multiply(new n(1).subtract(H(u,d)));return l=l.add(i.multiply(h)),l=l.add(i.multiply(f)),l=l.add(m),l}vertex(e,t){const i=le(e.bitset,qi),r=new n(1).subtract(i);let a=e.fontSize,o=a.divide(Ft);const l=this.isHaloPass?e.haloColor:this._getVertexColor(e),u=this.isLabel?l.multiply(this.storage.getAnimationValue(e.id)):l,p=this.view.displayViewScreenMat3.multiply(new z(e.pos,1));let d=e.offset,h=new n(1),f=j.identity();if(this.isLabel){if(!e.referenceSymbol)throw new Error("InternalError: Optional attribute 'referenceSymbol' expected for labels");const P=e.referenceSymbol,T=P.xy,C=P.z,$=this._unpackDirection(P.w),K=ot(this,e.id,C).divide(2),ue=$.multiply(K.add(bs));d=d.add(T).add(ue)}else h=ot(this,e.id,e.referenceSize).divide(e.referenceSize),a=a.multiply(h),o=o.multiply(h),d=d.multiply(h),f=ti(this,e.id),d=f.multiply(new z(d,0)).xy;const m=le(e.bitset,ji),v=this._getViewRotationMatrix(m).multiply(new z(d,0));let b=this.isLabel?this.clipLabel(e.zoomRange,e.clipAngle,m):this.clip(e.id,e.zoomRange);b=this.isBackgroundPass?b.add(r.multiply(2)):b.add(i.multiply(2));const g=new V(p.xy.add(v.xy),b,1),w=e.textureUV.divide(this.mosaicInfo.size);let _=new n(0);return this.isHaloPass&&(_=e.haloFontSize.divide(o).divide(Ni)),{glPosition:g,color:u,size:o,textureUV:w,antialiasingWidth:new n(.105*Ft).divide(a).divide(this.view.pixelRatio),haloDistanceOffset:_,...this.maybeRunHittest(e,t,{vvSizeAdjustment:h,vvRotation:f})}}_getViewRotationMatrix(e){const t=this.view.displayViewMat3,i=this.view.displayMat3,r=new n(1).subtract(e);return t.multiply(e).add(i.multiply(r))}fragment(e){const t=new n(.25),i=new n(1).subtract(t),r=Q(this.mosaicInfo.texture,e.textureUV).a;let a=i.subtract(e.haloDistanceOffset);this.highlight&&(a=a.divide(2));const o=e.antialiasingWidth,l=Xt(a.subtract(o),a.add(o),r);return this.getFragmentOutput(e.color.multiply(l),e)}hittest(e,t,{vvSizeAdjustment:i,vvRotation:r}){const a=r.multiply(new z(e.offset.multiply(i),0)),o=r.multiply(new z(t.offsetNextVertex1.multiply(i),0)),l=r.multiply(new z(t.offsetNextVertex2.multiply(i),0)),{viewMat3:u,tileMat3:p}=this.view,d=u.multiply(p).multiply(new z(e.pos,1)),h=d.add(p.multiply(a)).xy,f=d.add(p.multiply(o)).xy,m=d.add(p.multiply(l)).xy;return Ui(this.hittestRequest.position,h.xy,f.xy,m.xy)}_unpackDirection(e){const t=new Ye(e),i=Hi(t,new Ye(2)),r=Wi(t,new Ye(3));return new y(new n(i).subtract(1),new n(r).subtract(1))}_getVertexColor(e){let t=e.color;if(this.visualVariableColor){const i=this.storage.getColorValue(e.id);t=this.visualVariableColor.getColor(i,e.color,new Gi(!1))}if(this.visualVariableOpacity){const i=this.storage.getOpacityValue(e.id),r=this.visualVariableOpacity.getOpacity(i);t=t.multiply(r)}return t}}c([D(ii)],O.prototype,"visualVariableColor",void 0),c([D(si)],O.prototype,"visualVariableOpacity",void 0),c([D(gt)],O.prototype,"visualVariableRotation",void 0),c([D(ri)],O.prototype,"visualVariableSizeMinMaxValue",void 0),c([D(ai)],O.prototype,"visualVariableSizeScaleStops",void 0),c([D(oi)],O.prototype,"visualVariableSizeStops",void 0),c([D(ni)],O.prototype,"visualVariableSizeUnitValue",void 0),c([S(bt)],O.prototype,"mosaicInfo",void 0),c([Ve],O.prototype,"isHaloPass",void 0),c([Ve],O.prototype,"isBackgroundPass",void 0),c([Ve],O.prototype,"isLabel",void 0),c([R(0,A(G)),R(1,A(ft))],O.prototype,"vertex",null),c([R(0,A(Zs))],O.prototype,"fragment",null);let Ys=class extends k{constructor(){super(...arguments),this.meshWriter=B.LabelMeshWriter,this.shaders={geometry:new O},this.drawPhase=we.LABEL|we.LABEL_ALPHA,this.symbologyPlane=de.TEXT}render(e,t){const{context:i,painter:r}=e,a=I(e),o={...L(e)},l={shader:this.shaders.geometry,uniforms:{...W(e,t.target,t.instance.getInput().geometry),...E(e,t.target),mosaicInfo:r.textureManager.getMosaicInfo(i,t.textureKey)},defines:{...a,isHaloPass:!1,isBackgroundPass:!0,isLabel:!0},optionalAttributes:t.instance.optionalAttributes,useComputeBuffer:!1};r.setShader(l),r.setPipelineState(o),r.submitDraw(i,t),r.setShader({...l,defines:{...a,isHaloPass:!0,isBackgroundPass:!1,isLabel:!0}}),r.setPipelineState(o),r.submitDraw(i,t),r.setShader({...l,defines:{...a,isHaloPass:!1,isBackgroundPass:!1,isLabel:!0}}),r.setPipelineState(o),r.submitDraw(i,t)}},Qs=class extends k{constructor(){super(...arguments),this.meshWriter=B.LineMeshWriter,this.shaders={geometry:new li},this.symbologyPlane=de.LINE}render(e,t){const{context:i,painter:r,pixelRatio:a}=e;r.setShader({shader:this.shaders.geometry,uniforms:{...W(e,t.target,t.instance.getInput().geometry),...E(e,t.target),antialiasingControls:Ae(a)},defines:{...I(e)},optionalAttributes:t.instance.optionalAttributes,useComputeBuffer:F(e)}),r.setPipelineState(L(e)),r.submitDraw(i,t)}};class Ne extends Ki{}c([x(9,n)],Ne.prototype,"accumulatedDistance",void 0),c([x(10,y)],Ne.prototype,"segmentDirection",void 0),c([x(11,V)],Ne.prototype,"tlbr",void 0);class mt extends li{_getLineWidthRatio(e,t){const i=new n(Ms),r=le(e.bitset,Yi);return r.multiply(Se(t,new n(.25))).add(new n(1).subtract(r)).divide(i)}_getSDFAlpha(e){const{halfWidth:t,normal:i,tlbr:r,patternSize:a,accumulatedDistance:o,lineWidthRatio:l}=e,u=a.x.multiply(new n(2)).multiply(l),p=Tt(o.divide(u)),d=new n(.25).multiply(i.y).add(new n(.5)),h=nt(r.xy,r.zw,new y(p,d)),f=ui(Q(this.mosaicInfo.texture,h)).subtract(new n(.5)).multiply(t),m=lt(new n(.5).subtract(f),new n(0),new n(1));return new V(m)}_getPatternColor(e){const{halfWidth:t,normal:i,color:r,accumulatedDistance:a,patternSize:o,sampleAlphaOnly:l,tlbr:u}=e,p=o.y.multiply(new n(2).multiply(t).divide(o.x)),d=Tt(a.divide(p)),h=new n(.5).multiply(i.y).add(new n(.5)),f=nt(u.xy,u.zw,new y(h,d));let m=Q(this.mosaicInfo.texture,f);return this.visualVariableColor!=null&&(m=ce(Qe(l,new n(.5)),new V(r.a),r)),m}vertex(e,t){const{segmentDirection:i,tlbr:r,bitset:a}=e,o=Xi(this,e),l=e.accumulatedDistance.divide(this.view.displayZoomFactor).add(st(i,o.scaledOffset)),u=new y(r.z.subtract(r.x),r.w.subtract(r.y)),p=r.divide(this.mosaicInfo.size.xyxy),d=le(a,Qi),h=le(a,Ji),f=ce(Qe(d,new n(.5)),this._getLineWidthRatio(e,o.scaledHalfWidth),new n(1));return{...o,tlbr:p,patternSize:u,accumulatedDistance:l,isSDF:d,sampleAlphaOnly:h,lineWidthRatio:f,...this.maybeRunHittest(e,t,o.halfWidth)}}fragment(e){const{color:t,opacity:i,isSDF:r}=e,a=Zi(e,this.antialiasingControls.blur),o=ce(Qe(r,new n(.5)),this._getSDFAlpha(e),this._getPatternColor(e)),l=t.multiply(i).multiply(a).multiply(o);return this.getFragmentOutput(l,e)}}c([S(bt)],mt.prototype,"mosaicInfo",void 0),c([R(0,A(Ne)),R(1,A(es))],mt.prototype,"vertex",null);let Js=class extends k{constructor(){super(...arguments),this.meshWriter=B.TexturedLineMeshWriter,this.shaders={geometry:new mt},this.symbologyPlane=de.LINE}render(e,t){const{context:i,painter:r,pixelRatio:a}=e;r.setShader({shader:this.shaders.geometry,uniforms:{...W(e,t.target,t.instance.getInput().geometry),...E(e,t.target),antialiasingControls:Ae(a),mosaicInfo:r.textureManager.getMosaicInfo(i,t.textureKey)},defines:{...I(e)},optionalAttributes:t.instance.optionalAttributes,useComputeBuffer:F(e)}),r.setPipelineState(L(e)),r.submitDraw(i,t)}};class ne extends je{}c([x(3,V)],ne.prototype,"color",void 0),c([x(4,V)],ne.prototype,"outlineColor",void 0),c([x(5,y)],ne.prototype,"offset",void 0),c([x(6,y)],ne.prototype,"textureUV",void 0),c([x(7,V)],ne.prototype,"sizing",void 0),c([x(8,n)],ne.prototype,"placementAngle",void 0),c([x(9,n)],ne.prototype,"sizeRatio",void 0),c([x(10,y)],ne.prototype,"zoomRange",void 0);class Fe extends Jt{}c([x(12,y)],Fe.prototype,"offsetNextVertex1",void 0),c([x(13,y)],Fe.prototype,"offsetNextVertex2",void 0),c([x(14,y)],Fe.prototype,"textureUVNextVertex1",void 0),c([x(15,y)],Fe.prototype,"textureUVNextVertex2",void 0);class er extends Te{}function oe(s,e,t,i){return e.multiply(s.x).add(t.multiply(s.y)).add(i.multiply(s.z))}function et(s){return s.multiply(s).divide(128)}class q extends Ke{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],textureUV:["textureUVNextVertex1","textureUVNextVertex2"]}}vertex(e,t){const i=et(e.sizing.x),r=et(e.sizing.y),a=et(e.sizing.z),o=e.placementAngle,l=le(e.bitset,$e.bitset.isSDF),u=le(e.bitset,$e.bitset.isMapAligned),p=le(e.bitset,$e.bitset.scaleSymbolsProportionally),d=ts(e.bitset,$e.bitset.colorLocked),h=is(this,e.id),f=ss(this,e.id,e.color,d).multiply(h),m=this.view.displayViewScreenMat3.multiply(new z(e.pos.xy,1)),v=ot(this,e.id,a).divide(a),b=i.multiply(v),g=e.offset.xy.multiply(v);let w=r.multiply(p.multiply(v.subtract(1)).add(1));w=at(w,Se(b.subtract(.99),new n(0)));const _=Se(w,new n(1)),P=at(w,new n(1)),T=j.fromRotation(o.multiply(rs)),C=ti(this,e.id),$=this._getViewRotationMatrix(u).multiply(C).multiply(T).multiply(new z(g.xy,0)),K=this.clip(e.id,e.zoomRange),ue=new V(m.xy.add($.xy),K,1),Re=e.textureUV.divide(this.mosaicInfo.size),Ie=e.outlineColor.multiply(P),Ce=le(e.bitset,$e.bitset.overrideOutlineColor),ze=e.sizeRatio.multiply(b).multiply(.5);return{glPosition:ue,color:f,textureUV:Re,outlineColor:Ie,outlineSize:_,distanceToPx:ze,isSDF:l,overrideOutlineColor:Ce,...this.maybeRunHittest(e,t,{pos:e.pos,size:b,sizeCorrection:v,isMapAligned:u,outlineSize:_,distanceToPx:ze,isSDF:l})}}fragment(e){const t=this._getColor(e.textureUV,e);return this.getFragmentOutput(t,e)}hittest(e,t,i){return ce(as(i.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(e,t,i),this._hittestMarker(e,t,i))}_getViewRotationMatrix(e){const t=this.view.displayViewMat3,i=this.view.displayMat3,r=new n(1).subtract(e);return t.multiply(e).add(i.multiply(r))}_getViewScreenMatrix(e){const t=this.view.viewMat3.multiply(this.view.tileMat3),i=this.view.tileMat3,r=new n(1).subtract(e);return t.multiply(e).add(i.multiply(r))}_getColor(e,t){return ce(Qt(t.isSDF,new n(1)),this._getSDFColor(e,t),this._getSpriteColor(e,t))}_getSpriteColor(e,t){return Q(this.mosaicInfo.texture,e).multiply(t.color)}_getSDFColor(e,t){const i=Q(this.mosaicInfo.texture,e),r=new n(.5).subtract(ui(i)).multiply(t.distanceToPx).multiply(os),a=lt(new n(.5).subtract(r),new n(0),new n(1)),o=t.color.multiply(a);let l=t.outlineSize;this.highlight&&(l=Se(l,t.overrideOutlineColor.multiply(4)));const u=l.multiply(.5),p=ei(r).subtract(u),d=lt(new n(.5).subtract(p),new n(0),new n(1)),h=nt(t.outlineColor,t.color,t.overrideOutlineColor).multiply(d);return new n(1).subtract(h.a).multiply(o).add(h)}_hittestSmallMarker(e,t,i){const{position:r,distance:a,smallSymbolDistance:o}=this.hittestRequest,l=a.subtract(o),{viewMat3:u,tileMat3:p}=this.view,d=u.multiply(p).multiply(new z(i.pos,1)).xy,h=i.size.multiply(.5);return ns(d,r).subtract(h).add(l)}_hittestMarker(e,t,i){const{pos:r,size:a,sizeCorrection:o,isMapAligned:l,outlineSize:u,isSDF:p,distanceToPx:d}=i,h=new z(e.offset.multiply(o),0),f=new z(t.offsetNextVertex1.multiply(o),0),m=new z(t.offsetNextVertex2.multiply(o),0),{viewMat3:v,tileMat3:b}=this.view,g=v.multiply(b).multiply(new z(r,1)),w=this._getViewScreenMatrix(l),_=g.add(w.multiply(h)).xy,P=g.add(w.multiply(f)).xy,T=g.add(w.multiply(m)).xy,C=this.hittestRequest.position,$=this.hittestRequest.distance,K=re(C.add(new y(he($),he($))),_,P,T),ue=re(C.add(new y(0,he($))),_,P,T),Re=re(C.add(new y($,he($))),_,P,T),Ie=re(C.add(new y(he($),0)),_,P,T),Ce=re(C,_,P,T),ze=re(C.add(new y($,0)),_,P,T),wt=re(C.add(new y(he($),$)),_,P,T),St=re(C.add(new y(0,$)),_,P,T),Vt=re(C.add(new y($,$)),_,P,T),ee=e.textureUV.divide(this.mosaicInfo.size),te=t.textureUVNextVertex1.divide(this.mosaicInfo.size),ie=t.textureUVNextVertex2.divide(this.mosaicInfo.size),se={color:new V(1),outlineColor:new V(1),overrideOutlineColor:new n(1),outlineSize:u,distanceToPx:d,isSDF:p};let M=new n(0);return M=M.add(ae(K).multiply(this._getColor(oe(K,ee,te,ie),se).a)),M=M.add(ae(ue).multiply(this._getColor(oe(ue,ee,te,ie),se).a)),M=M.add(ae(Re).multiply(this._getColor(oe(Re,ee,te,ie),se).a)),M=M.add(ae(Ie).multiply(this._getColor(oe(Ie,ee,te,ie),se).a)),M=M.add(ae(Ce).multiply(this._getColor(oe(Ce,ee,te,ie),se).a)),M=M.add(ae(ze).multiply(this._getColor(oe(ze,ee,te,ie),se).a)),M=M.add(ae(wt).multiply(this._getColor(oe(wt,ee,te,ie),se).a)),M=M.add(ae(St).multiply(this._getColor(oe(St,ee,te,ie),se).a)),M=M.add(ae(Vt).multiply(this._getColor(oe(Vt,ee,te,ie),se).a)),H(M,new n(.05)).multiply(Zt(this.hittestRequest))}}c([D(ii)],q.prototype,"visualVariableColor",void 0),c([D(si)],q.prototype,"visualVariableOpacity",void 0),c([D(gt)],q.prototype,"visualVariableRotation",void 0),c([D(ri)],q.prototype,"visualVariableSizeMinMaxValue",void 0),c([D(ai)],q.prototype,"visualVariableSizeScaleStops",void 0),c([D(oi)],q.prototype,"visualVariableSizeStops",void 0),c([D(ni)],q.prototype,"visualVariableSizeUnitValue",void 0),c([S(bt)],q.prototype,"mosaicInfo",void 0),c([R(0,A(ne)),R(1,A(Fe))],q.prototype,"vertex",null),c([R(0,A(er))],q.prototype,"fragment",null);let tr=class extends k{constructor(){super(...arguments),this.meshWriter=B.MarkerMeshWriter,this.shaders={geometry:new q},this.symbologyPlane=de.MARKER}render(e,t){const{context:i,painter:r}=e;r.setShader({shader:this.shaders.geometry,uniforms:{...W(e,t.target,t.instance.getInput().geometry),...E(e,t.target),mosaicInfo:r.textureManager.getMosaicInfo(i,t.textureKey,!0)},defines:{...I(e)},optionalAttributes:t.instance.optionalAttributes,useComputeBuffer:F(e)}),r.setPipelineState(L(e)),r.submitDraw(i,t)}};class ir{constructor(){this.computeAttributes={}}get locationsMap(){const e=new Map;for(const t in this.locations)e.set(t,this.locations[t].index);return e}get optionPropertyKeys(){if(!this._optionPropertyKeys){const e=new Set(Object.keys(this.options));this._optionPropertyKeys=e}return this._optionPropertyKeys}get _transformFeedbackBindings(){return[]}get locationInfo(){if(!this._locationInfo){const e=this.locationsMap,t=Array.from(e.entries()).map(([r,a])=>`${r}.${a}`).join("."),i=vs(t);this._locationInfo={hash:i,locations:e}}return this._locationInfo}get renamedLocationsMap(){const e=new Map;for(const[t,i]of this.locationsMap.entries())e.set("a_"+t,i);return e}getShaderKey(e,t,i){const r=Object.keys(i).filter(o=>i[o]).map(o=>`${o}_${i[o].toString()}`).join("."),a=Object.keys(t).filter(o=>this.optionPropertyKeys.has(o)).join(".");return`${e.hash}.${r}.${a}`}getProgram(e,t,i,r){let a="",o="";for(const l in i)if(i[l]){const u=typeof i[l]=="boolean"?`#define ${l} +import{g as x,_ as S,h as qt,P as pe,j as jt,i as j,G as z,m as Q,B as Se,p as n,q as H,H as V,u as Kt,v as Xt,w as A,C as y,S as U,F as yt,x as Ri,y as Te,z as X,A as Ve,D as je,E as Ke,I as He,L as st,M as _t,N as Zt,O as Yt,a as B,Q as Ii,R as Ci,T as Oi,V as Ei,X as Di,Y as Li,$ as Bi,a0 as ce,a1 as zt,a2 as Qt,a3 as rt,a4 as $t,a5 as Mt,a6 as Pt,a7 as D,a8 as Jt,a9 as ei,aa as at,ab as ki,ac as le,ad as Ft,ae as ot,af as ti,ag as Ni,ah as Ui,ai as Ye,aj as Hi,ak as Wi,al as Gi,am as qi,an as ji,ao as ii,ap as si,aq as ri,ar as ai,as as oi,at as ni,au as bt,av as li,aw as Ki,ax as Tt,ay as nt,az as ui,aA as lt,aB as Qe,aC as Xi,aD as Zi,aE as Yi,aF as Qi,aG as Ji,aH as es,aI as ts,aJ as is,aK as ss,aL as rs,aM as as,aN as os,aO as ns,aP as re,aQ as he,aR as ae,aS as $e,aT as ls,K as us,d as cs}from"./UpdateTracking2D-Ds_Gdrxd.js";import{t as ps}from"./utils-CuXO_Zzq.js";import{d as c,lt as R,ij as N,g5 as Z,fX as At,iv as ds,L as _e,D as ut,is as ci,g3 as hs,U as We,i3 as fs,lu as Rt,lv as ms,g2 as ct,N as De,v as fe,l as It,fV as Ct,s as pi,hf as ys,iS as Je,lw as Ot,kl as bs,iU as vs,f0 as Et,la as vt,bh as xe,lx as gs,bo as xs,bn as ws,q as Ss,kg as Vs}from"./index-BjUNJPVf.js";import{E as we,S as de,f as pt,m as F,c as E,y as I,M as L,d as _s,e as W,w as Xe,L as Oe}from"./Container-_n5wCgez.js";import{h as Dt,s as zs,i as di,x as hi}from"./Program-DBsYtQ00.js";import{o as $s}from"./ProgramTemplate-Ck2I0bIi.js";import{a as fi}from"./LabelMetric-BcUxDImF.js";import{e as Ge,m as mi}from"./Texture-S4dD-WHn.js";import{o as Ms}from"./constants-D5zmR9t2.js";import{c as Lt}from"./WGLContainer-DgZNq7b0.js";let k=class{constructor(e){this.registryName=e,this.postProcessingEnabled=!1,this.overrideStencilRef=null,this.drawPhase=we.MAP|we.HITTEST|we.HIGHLIGHT|we.DEBUG,this.symbologyPlane=de.FILL}startup(){}shutdown(e){}postProcess(e,t){}},yi=class extends qt{};c([x(0,y)],yi.prototype,"pos",void 0);let Ps=class extends Te{},bi=class extends pe{};c([S(n)],bi.prototype,"dotSize",void 0);let Le=class extends pe{};c([S(U)],Le.prototype,"locations",void 0),c([S(n)],Le.prototype,"pixelRatio",void 0),c([S(n)],Le.prototype,"tileZoomFactor",void 0);const Fs=1e-6;class ye extends jt{vertex(e){const t=new j(1,0,0,0,-1,0,0,1,1).multiply(new z(e.pos.xy.divide(N),1)),i=Q(this.draw.locations,t.xy),r=Se(this.instance.dotSize.divide(2),new n(1));let a=new n(0);a=a.add(H(i.a,new n(Fs)).multiply(2));let o=r.add(this.instance.dotSize);const l=this.view.displayViewScreenMat3.multiply(new z(e.pos.add(.5),1)),u=new V(l.xy,a,1),p=this.instance.dotSize.divide(o),d=new n(-1).divide(r.divide(o));return o=o.multiply(this.draw.pixelRatio.multiply(this.draw.tileZoomFactor)),{glPosition:u,glPointSize:o,color:i,ratio:p,invEdgeRatio:d}}fragment(e){const t=Kt(e.glPointCoord.subtract(.5)).multiply(2),i=Xt(new n(0),new n(1),e.invEdgeRatio.multiply(t.subtract(e.ratio)).add(1)),r=new yt;return r.glFragColor=e.color.multiply(i),r}}c([S(bi)],ye.prototype,"instance",void 0),c([S(Le)],ye.prototype,"draw",void 0),c([S(Ri)],ye.prototype,"view",void 0),c([R(0,A(yi))],ye.prototype,"vertex",null),c([R(0,A(Ps))],ye.prototype,"fragment",null);class vi extends je{}c([x(3,n)],vi.prototype,"inverseArea",void 0);let Be=class extends pe{};c([S(X.ofType(V,2))],Be.prototype,"isActive",void 0),c([S(X.ofType(V,8))],Be.prototype,"colors",void 0),c([S(n)],Be.prototype,"dotValue",void 0);let be=class extends pe{};c([S(U)],be.prototype,"dotTexture0",void 0),c([S(U)],be.prototype,"dotTexture1",void 0),c([S(n)],be.prototype,"tileZoomFactor",void 0),c([S(n)],be.prototype,"pixelRatio",void 0),c([S(n)],be.prototype,"tileDotsOverArea",void 0);let ve=class extends Ke{_dotThreshold(e,t,i){return e.divide(t).divide(i)}vertex(e){const t=new j(2/N,0,0,0,-2/N,0,-1,1,1).multiply(new z(e.pos,1)),i=this.clip(e.id),r=new V(t.xy,i,1),a=this.storage.getVVData(e.id).multiply(this.instance.isActive.get(0)).multiply(e.inverseArea),o=this.storage.getDataDrivenData0(e.id).multiply(this.instance.isActive.get(1)).multiply(e.inverseArea),l=this.draw.tileZoomFactor.multiply(N).divide(this.draw.pixelRatio),u=this._dotThreshold(a,this.instance.dotValue,this.draw.tileDotsOverArea),p=this._dotThreshold(o,this.instance.dotValue,this.draw.tileDotsOverArea),d=e.pos.add(.5).divide(l);return{glPosition:r,color:new V(0,0,0,0),textureCoords:d,thresholds0:u,thresholds1:p}}fragment(e){const t=new yt,i=Q(this.draw.dotTexture0,e.textureCoords),r=Q(this.draw.dotTexture1,e.textureCoords),a=e.thresholds0.subtract(i),o=e.thresholds1.subtract(r);let l;const u=He.fromColumns(this.instance.colors[0],this.instance.colors[1],this.instance.colors[2],this.instance.colors[3]),p=He.fromColumns(this.instance.colors[4],this.instance.colors[5],this.instance.colors[6],this.instance.colors[7]);if(this.blending){const d=H(new n(0),a),h=H(new n(0),o),f=st(d,a).add(st(h,o)),m=H(f,new n(0)),v=new n(1).subtract(m),b=f.add(m),g=a.multiply(d).divide(b),w=o.multiply(h).divide(b),_=u.multiply(g).add(p.multiply(w));l=v.multiply(_)}else{const d=Se(_t(a),_t(o)),h=H(d,new n(0)),f=new n(1).subtract(h),m=H(d,a),v=H(d,o),b=u.multiply(m).add(p.multiply(v));l=f.multiply(b)}return t.glFragColor=l,t}hittest(e){return Zt(this.hittestRequest)}};c([Ve],ve.prototype,"blending",void 0),c([S(Be)],ve.prototype,"instance",void 0),c([S(be)],ve.prototype,"draw",void 0),c([R(0,A(vi))],ve.prototype,"vertex",null),c([R(0,A(Te))],ve.prototype,"fragment",null);const dt={[Z.BYTE]:1,[Z.UNSIGNED_BYTE]:1,[Z.SHORT]:2,[Z.UNSIGNED_SHORT]:2,[Z.INT]:4,[Z.UNSIGNED_INT]:4,[Z.FLOAT]:4};let Ts=class{constructor(e,t){this._boundPart=null;const i=[];for(const a of t.vertex){const o=Dt.createVertex(e,At.STATIC_DRAW,a);i.push(o)}const r=[];for(const a of t.index||[]){const o=Dt.createIndex(e,At.STATIC_DRAW,a);r.push(o)}this.groups=[];for(const a of t.groups){let o;if(a.index!=null){if(!t.index)throw new Error("No index data.");const{BYTES_PER_ELEMENT:f}=t.index[a.index];f===2?o=Z.UNSIGNED_SHORT:f===4&&(o=Z.UNSIGNED_INT)}const l=a.index!=null?r[a.index]:null,u=new Map,p={},d={};for(const f of a.attributes){const{name:m,count:v,type:b,offset:g,normalized:w,divisor:_,stride:P,vertex:T,location:C}=f,$=`vertex-buffer-${T}`;let K=p[$];K||(K=p[$]=[]);const ue=new ds(m,v,b,g,P,w,_);K.push(ue),u.set(m,C),d[$]=i[T]}const h=new $s(e,u,p,d,l);this.groups.push({...a,vertexArray:h,locations:u,layout:p,indexing:o})}this.parts=t.parts}bind(e,t){this._boundPart=t;const{group:i}=this.parts[this._boundPart],{vertexArray:r}=this.groups[i];e.bindVAO(r)}draw(e){if(this._boundPart==null)throw new Error("Mesh.bind() has not been called.");const{start:t,count:i}=this.parts[this._boundPart],{group:r}=this.parts[this._boundPart],{indexing:a,primitive:o}=this.groups[r];a?e.drawElements(o,i,a,t*dt[a]):e.drawArrays(o,t,i)}unbind(e){this._boundPart=null,e.bindVAO(null)}destroy(){for(const{vertexArray:e}of this.groups)e.dispose()}},As=class gi extends Ts{static create(e,t){const i=[];let{stride:r,hash:a}=t.layout;if(r==null){r=0;for(const{count:f,type:m,offset:v}of t.layout.attributes){if(v!=null)throw new Error("Stride cannot be computed automatically when attribute offsets are supplied explicitly.");r+=f*dt[m]}}let o=0,l=0;for(const{count:f,name:m,offset:v,type:b,normalized:g}of t.layout.attributes){v!=null&&(l=v);const w={name:m,location:o,vertex:0,count:f,type:b,offset:l,stride:r,divisor:0,normalized:g!=null&&g};i.push(w),o++,l+=f*dt[b]}const u={attributes:i,primitive:t.primitive};t.index!=null&&(u.index=0);let{count:p}=t;if(p==null&&(p=t.index?t.index.length:t.vertex.byteLength/r,Math.floor(p)!==p))throw new Error(`The byte length of vertex data must be an exact multiple of the stride, which is ${r}.`);const d={start:0,count:p,group:0,primitive:t.primitive},h={vertex:[t.vertex],parts:[d],groups:[u]};return t.index!=null&&(h.index=[t.index]),a==null&&(a=fi(i)),new gi(e,h,{hash:a,attributes:i,stride:r})}constructor(e,t,i){super(e,t),this.layout=i}bind(e,t=0){super.bind(e,t)}},Rs=class{constructor(){this._dotTextureSize=0,this._dotTextures=null,this._dotMesh=null}destroy(){this._disposeTextures(),this._dotFBO&&this._dotFBO.dispose(),this._dotMesh&&this._dotMesh.destroy()}getFBO(e){if(this._dotFBO==null){const t=N,i=N,r=new Ge(t,i);r.samplingMode=_e.NEAREST,r.wrapMode=ut.CLAMP_TO_EDGE;const a=new zs(e,new di(ci.DEPTH_STENCIL,t,i));this._dotFBO=new hi(e,r,a)}return this._dotFBO}getDotDensityMesh(e){if(this._dotMesh==null){const t=N,i=t*t,r=2,a=new Int16Array(i*r);for(let u=0;upi.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.heatmap.HeatmapResources");let Us=class{destroy(){this._accumulateFramebuffer=Ct(this._accumulateFramebuffer),this._resolveGradientTexture=Ct(this._resolveGradientTexture),this._prevGradientHash=null,this._qualityProfile=null}get initialized(){return this._accumulateFramebuffer!=null&&this._resolveGradientTexture!=null}get accumulateFramebuffer(){return this._accumulateFramebuffer}get resolveGradientTexture(){return this._resolveGradientTexture}loadQualityProfile(e){if(this._qualityProfile==null){const t=ks(e,Ns());this._qualityProfile={...t,defines:{usesHalfFloatPrecision:t.dataType!==We.FLOAT}}}return this._qualityProfile}ensureAccumulateFBO(e,t,i){if(this._accumulateFramebuffer==null){const{dataType:r,samplingMode:a,pixelFormat:o,internalFormat:l}=this.loadQualityProfile(e),u=new Ge(t,i);u.pixelFormat=o,u.internalFormat=l,u.dataType=r,u.samplingMode=a,u.wrapMode=ut.CLAMP_TO_EDGE;const p=new di(ci.DEPTH_STENCIL,t,i);this._accumulateFramebuffer=new hi(e,u,p)}else{const{width:r,height:a}=this._accumulateFramebuffer;r===t&&a===i||this._accumulateFramebuffer.resize(t,i)}return this._accumulateFramebuffer}ensureResolveGradientTexture(e,t,i){if(this._resolveGradientTexture==null){const r=new Ge;r.wrapMode=ut.CLAMP_TO_EDGE,this._resolveGradientTexture=new mi(e,r)}else this._prevGradientHash!==t&&(this._resolveGradientTexture.resize(i.length/4,1),this._resolveGradientTexture.setData(i),this._prevGradientHash=t);return this._resolveGradientTexture}};function xi(s){return s?.25:1}let wi=class extends je{};c([x(5,y)],wi.prototype,"offset",void 0);let Hs=class extends Te{},ht=class extends pe{};c([S(n)],ht.prototype,"radius",void 0),c([S(n)],ht.prototype,"isFieldActive",void 0);let Pe=class extends Ke{constructor(){super(...arguments),this.usesHalfFloatPrecision=!1}vertex(e){const{radius:t,isFieldActive:i}=this.kernelControls,r=e.offset,a=i.multiply(this.storage.getVVData(e.id).x).add(new n(1).subtract(i)),o=this.view.displayViewScreenMat3.multiply(new z(e.pos,1)).add(this.view.displayViewMat3.multiply(new z(r,0)).multiply(t)),l=this.clip(e.id);return{glPosition:new V(o.xy,l,1),offset:r,fieldValue:a,color:new V(0),...this.maybeRunHittest(e,{},null)}}fragment(e){const{offset:t,fieldValue:i}=e,r=Kt(t),a=H(r,new n(1)),o=new n(1).subtract(r.multiply(r)),l=o.multiply(o),u=a.multiply(l).multiply(i).multiply(new n(xi(this.usesHalfFloatPrecision)));return this.getFragmentOutput(new V(u),e)}hittest(e){const{viewMat3:t,tileMat3:i}=this.view,r=t.multiply(i).multiply(new z(e.pos,1));return Li(r.xy,this.kernelControls.radius,this.hittestRequest.position)}};c([Ve],Pe.prototype,"usesHalfFloatPrecision",void 0),c([S(ht)],Pe.prototype,"kernelControls",void 0),c([R(0,A(wi))],Pe.prototype,"vertex",null),c([R(0,A(Hs))],Pe.prototype,"fragment",null);let Si=class extends qt{};c([x(0,y)],Si.prototype,"pos",void 0);let Ws=class extends Bi{},ke=class extends pe{};c([S(U)],ke.prototype,"texture",void 0),c([S(y)],ke.prototype,"minAndInvRange",void 0),c([S(n)],ke.prototype,"normalization",void 0);let Vi=class extends pe{};c([S(U)],Vi.prototype,"texture",void 0);let ge=class extends jt{constructor(){super(...arguments),this.usesHalfFloatPrecision=!1}vertex(e){return{glPosition:new V(e.pos.multiply(2).subtract(1),1,1),uv:e.pos}}fragment(e){const{accumulatedDensity:t,gradient:i}=this;let r=Q(t.texture,e.uv).r.multiply(new n(xi(this.usesHalfFloatPrecision)));r=r.multiply(t.normalization),r=r.subtract(t.minAndInvRange.x).multiply(t.minAndInvRange.y);const a=Q(i.texture,new y(r,.5)),o=new yt;return o.glFragColor=new V(a.rgb.multiply(a.a),a.a),o}};c([Ve],ge.prototype,"usesHalfFloatPrecision",void 0),c([S(ke)],ge.prototype,"accumulatedDensity",void 0),c([S(Vi)],ge.prototype,"gradient",void 0),c([R(0,A(Si))],ge.prototype,"vertex",null),c([R(0,A(Ws))],ge.prototype,"fragment",null);let Gs=class extends k{constructor(){super(...arguments),this.meshWriter=B.HeatmapMeshWriter,this.shaders={accumulate:new Pe,resolve:new ge},this.postProcessingEnabled=!0,this._isBound=!1,this._resources=new Map,this.overrideStencilRef=_i}shutdown(e){var t;super.shutdown(e),(t=this._resources.get(e))==null||t.destroy(),this._resources.delete(e),this._prevFBO=null,this._unbind()}render(e,t){const{context:i,painter:r,state:a}=e,o=t.instance.getInput(),{isFieldActive:l}=o,u=this._getOrCreateResourcesRecord(i),p=u.loadQualityProfile(i);if(pt(e))return;F(e)||this._bind(e,u,o),r.setShader({shader:this.shaders.accumulate,uniforms:{...E(e,t.target),kernelControls:{radius:kt(o,a),isFieldActive:l?1:0}},defines:{...I(e),...p.defines},optionalAttributes:t.instance.optionalAttributes,useComputeBuffer:F(e)});const d=F(e)?js:zi;r.setPipelineState(d),r.submitDraw(i,t)}postProcess(e,t){if(F(e)||pt(e))return;const{context:i,painter:r}=e,a=this._resources.get(i);if(this._prevFBO==null||this._prevViewport==null||!(a!=null&&a.initialized))return;const{defines:o}=a.loadQualityProfile(i),{minDensity:l,maxDensity:u,radius:p}=t.getInput(),d=8,h=9,f=a.accumulateFramebuffer,m=a.resolveGradientTexture;r.setShader({shader:this.shaders.resolve,uniforms:{accumulatedDensity:{texture:{unit:d,texture:f.colorTexture},minAndInvRange:[l,1/(u-l)],normalization:3/(p*p*Math.PI)},gradient:{texture:{unit:h,texture:m}}},defines:o,optionalAttributes:{},useComputeBuffer:!1}),i.bindFramebuffer(this._prevFBO),i.setViewport(0,0,this._prevViewport.width,this._prevViewport.height),i.bindTexture(f.colorTexture,d),i.bindTexture(m,h),r.setPipelineState(Ks),r.submitDrawQuad(i),this._unbind()}_getOrCreateResourcesRecord(e){let t=this._resources.get(e);return t==null&&(t=new Us,this._resources.set(e,t)),t}_unbind(){this._prevFBO=null,this._prevViewport=null,this._isBound=!1}_bind(e,t,i){if(this._isBound)return;const{context:r,state:a,pixelRatio:o}=e,l=r.getBoundFramebufferObject(),u=r.getViewport();this._prevFBO=l,this._prevViewport=u;const{gradient:p,gradientHash:d}=i;t.ensureResolveGradientTexture(r,d,p);const{width:h,height:f}=u,m=qs(kt(i,a),o),v=h*m,b=f*m,g=t.ensureAccumulateFBO(r,v,b);r.blitFramebuffer(l,g,0,0,l.width,l.height,0,0,g.width,g.height,ct.STENCIL_BUFFER_BIT,_e.NEAREST),r.bindFramebuffer(g),r.setViewport(0,0,g.width,g.height),r.setColorMask(!0,!0,!0,!0),r.setClearColor(0,0,0,0),r.clear(ct.COLOR_BUFFER_BIT),this._isBound=!0}};function qs(s,e){const t=e>1.5?.25:.5;return s<1/(2*t)?1:t}function _i(s){return s.key.level+1}const zi={color:{write:[!0,!0,!0,!0],blendMode:"additive"},depth:!1,stencil:{write:!1,test:{ref:_i,compare:ys.GEQUAL,mask:255,op:{fail:Je.KEEP,zFail:Je.KEEP,zPass:Je.REPLACE}}}},js={...zi,stencil:!1},Ks={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!1};function kt(s,e){const{referenceScale:t,radius:i}=s;return i*(t!==0?t/e.scale:1)}let gt=class extends pe{getVVRotationMat4(e){return ce(zt(e),He.identity(),()=>{const t=this._getNormalizedAngle(e).multiply($t),i=Mt(t),r=Pt(t);return new He(r,i,0,0,i.multiply(new n(-1)),r,0,0,0,0,1,0,0,0,0,1)})}getVVRotationMat3(e){return ce(zt(e),j.identity(),()=>{const t=this._getNormalizedAngle(e).multiply($t),i=Mt(t),r=Pt(t);return new j(r,i,0,i.multiply(new n(-1)),r,0,0,0,1)})}_getNormalizedAngle(e){const t=Qt(this.rotationType,new n(rt.Arithmatic));return ce(t,new n(90).subtract(e),e)}};c([S(n)],gt.prototype,"rotationType",void 0);const Xs=360/254;class G extends je{}c([x(3,V)],G.prototype,"color",void 0),c([x(4,y)],G.prototype,"offset",void 0),c([x(5,y)],G.prototype,"textureUV",void 0),c([x(6,n)],G.prototype,"fontSize",void 0),c([x(7,n)],G.prototype,"referenceSize",void 0),c([x(8,n)],G.prototype,"haloFontSize",void 0),c([x(9,V)],G.prototype,"haloColor",void 0),c([x(10,y)],G.prototype,"zoomRange",void 0),c([x(11,n)],G.prototype,"clipAngle",void 0),c([x(12,V)],G.prototype,"referenceSymbol",void 0);let ft=class extends Jt{};c([x(13,y)],ft.prototype,"offsetNextVertex1",void 0),c([x(14,y)],ft.prototype,"offsetNextVertex2",void 0);class Zs extends Te{}class O extends Ke{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"]},this.isHaloPass=!1,this.isBackgroundPass=!1,this.isLabel=!1}clipLabel(e,t,i){const r=t.multiply(Xs),a=ei(this.view.rotation.subtract(r)),o=at(new n(360).subtract(a),a);let l=new n(0);const u=ki(this.view.currentZoom.multiply(Ot)).divide(Ot),p=e.x,d=e.y,h=new n(1).subtract(H(p,u)).multiply(2),f=H(new n(90),o).multiply(2),m=new n(2).multiply(new n(1).subtract(H(u,d)));return l=l.add(i.multiply(h)),l=l.add(i.multiply(f)),l=l.add(m),l}vertex(e,t){const i=le(e.bitset,qi),r=new n(1).subtract(i);let a=e.fontSize,o=a.divide(Ft);const l=this.isHaloPass?e.haloColor:this._getVertexColor(e),u=this.isLabel?l.multiply(this.storage.getAnimationValue(e.id)):l,p=this.view.displayViewScreenMat3.multiply(new z(e.pos,1));let d=e.offset,h=new n(1),f=j.identity();if(this.isLabel){if(!e.referenceSymbol)throw new Error("InternalError: Optional attribute 'referenceSymbol' expected for labels");const P=e.referenceSymbol,T=P.xy,C=P.z,$=this._unpackDirection(P.w),K=ot(this,e.id,C).divide(2),ue=$.multiply(K.add(bs));d=d.add(T).add(ue)}else h=ot(this,e.id,e.referenceSize).divide(e.referenceSize),a=a.multiply(h),o=o.multiply(h),d=d.multiply(h),f=ti(this,e.id),d=f.multiply(new z(d,0)).xy;const m=le(e.bitset,ji),v=this._getViewRotationMatrix(m).multiply(new z(d,0));let b=this.isLabel?this.clipLabel(e.zoomRange,e.clipAngle,m):this.clip(e.id,e.zoomRange);b=this.isBackgroundPass?b.add(r.multiply(2)):b.add(i.multiply(2));const g=new V(p.xy.add(v.xy),b,1),w=e.textureUV.divide(this.mosaicInfo.size);let _=new n(0);return this.isHaloPass&&(_=e.haloFontSize.divide(o).divide(Ni)),{glPosition:g,color:u,size:o,textureUV:w,antialiasingWidth:new n(.105*Ft).divide(a).divide(this.view.pixelRatio),haloDistanceOffset:_,...this.maybeRunHittest(e,t,{vvSizeAdjustment:h,vvRotation:f})}}_getViewRotationMatrix(e){const t=this.view.displayViewMat3,i=this.view.displayMat3,r=new n(1).subtract(e);return t.multiply(e).add(i.multiply(r))}fragment(e){const t=new n(.25),i=new n(1).subtract(t),r=Q(this.mosaicInfo.texture,e.textureUV).a;let a=i.subtract(e.haloDistanceOffset);this.highlight&&(a=a.divide(2));const o=e.antialiasingWidth,l=Xt(a.subtract(o),a.add(o),r);return this.getFragmentOutput(e.color.multiply(l),e)}hittest(e,t,{vvSizeAdjustment:i,vvRotation:r}){const a=r.multiply(new z(e.offset.multiply(i),0)),o=r.multiply(new z(t.offsetNextVertex1.multiply(i),0)),l=r.multiply(new z(t.offsetNextVertex2.multiply(i),0)),{viewMat3:u,tileMat3:p}=this.view,d=u.multiply(p).multiply(new z(e.pos,1)),h=d.add(p.multiply(a)).xy,f=d.add(p.multiply(o)).xy,m=d.add(p.multiply(l)).xy;return Ui(this.hittestRequest.position,h.xy,f.xy,m.xy)}_unpackDirection(e){const t=new Ye(e),i=Hi(t,new Ye(2)),r=Wi(t,new Ye(3));return new y(new n(i).subtract(1),new n(r).subtract(1))}_getVertexColor(e){let t=e.color;if(this.visualVariableColor){const i=this.storage.getColorValue(e.id);t=this.visualVariableColor.getColor(i,e.color,new Gi(!1))}if(this.visualVariableOpacity){const i=this.storage.getOpacityValue(e.id),r=this.visualVariableOpacity.getOpacity(i);t=t.multiply(r)}return t}}c([D(ii)],O.prototype,"visualVariableColor",void 0),c([D(si)],O.prototype,"visualVariableOpacity",void 0),c([D(gt)],O.prototype,"visualVariableRotation",void 0),c([D(ri)],O.prototype,"visualVariableSizeMinMaxValue",void 0),c([D(ai)],O.prototype,"visualVariableSizeScaleStops",void 0),c([D(oi)],O.prototype,"visualVariableSizeStops",void 0),c([D(ni)],O.prototype,"visualVariableSizeUnitValue",void 0),c([S(bt)],O.prototype,"mosaicInfo",void 0),c([Ve],O.prototype,"isHaloPass",void 0),c([Ve],O.prototype,"isBackgroundPass",void 0),c([Ve],O.prototype,"isLabel",void 0),c([R(0,A(G)),R(1,A(ft))],O.prototype,"vertex",null),c([R(0,A(Zs))],O.prototype,"fragment",null);let Ys=class extends k{constructor(){super(...arguments),this.meshWriter=B.LabelMeshWriter,this.shaders={geometry:new O},this.drawPhase=we.LABEL|we.LABEL_ALPHA,this.symbologyPlane=de.TEXT}render(e,t){const{context:i,painter:r}=e,a=I(e),o={...L(e)},l={shader:this.shaders.geometry,uniforms:{...W(e,t.target,t.instance.getInput().geometry),...E(e,t.target),mosaicInfo:r.textureManager.getMosaicInfo(i,t.textureKey)},defines:{...a,isHaloPass:!1,isBackgroundPass:!0,isLabel:!0},optionalAttributes:t.instance.optionalAttributes,useComputeBuffer:!1};r.setShader(l),r.setPipelineState(o),r.submitDraw(i,t),r.setShader({...l,defines:{...a,isHaloPass:!0,isBackgroundPass:!1,isLabel:!0}}),r.setPipelineState(o),r.submitDraw(i,t),r.setShader({...l,defines:{...a,isHaloPass:!1,isBackgroundPass:!1,isLabel:!0}}),r.setPipelineState(o),r.submitDraw(i,t)}},Qs=class extends k{constructor(){super(...arguments),this.meshWriter=B.LineMeshWriter,this.shaders={geometry:new li},this.symbologyPlane=de.LINE}render(e,t){const{context:i,painter:r,pixelRatio:a}=e;r.setShader({shader:this.shaders.geometry,uniforms:{...W(e,t.target,t.instance.getInput().geometry),...E(e,t.target),antialiasingControls:Ae(a)},defines:{...I(e)},optionalAttributes:t.instance.optionalAttributes,useComputeBuffer:F(e)}),r.setPipelineState(L(e)),r.submitDraw(i,t)}};class Ne extends Ki{}c([x(9,n)],Ne.prototype,"accumulatedDistance",void 0),c([x(10,y)],Ne.prototype,"segmentDirection",void 0),c([x(11,V)],Ne.prototype,"tlbr",void 0);class mt extends li{_getLineWidthRatio(e,t){const i=new n(Ms),r=le(e.bitset,Yi);return r.multiply(Se(t,new n(.25))).add(new n(1).subtract(r)).divide(i)}_getSDFAlpha(e){const{halfWidth:t,normal:i,tlbr:r,patternSize:a,accumulatedDistance:o,lineWidthRatio:l}=e,u=a.x.multiply(new n(2)).multiply(l),p=Tt(o.divide(u)),d=new n(.25).multiply(i.y).add(new n(.5)),h=nt(r.xy,r.zw,new y(p,d)),f=ui(Q(this.mosaicInfo.texture,h)).subtract(new n(.5)).multiply(t),m=lt(new n(.5).subtract(f),new n(0),new n(1));return new V(m)}_getPatternColor(e){const{halfWidth:t,normal:i,color:r,accumulatedDistance:a,patternSize:o,sampleAlphaOnly:l,tlbr:u}=e,p=o.y.multiply(new n(2).multiply(t).divide(o.x)),d=Tt(a.divide(p)),h=new n(.5).multiply(i.y).add(new n(.5)),f=nt(u.xy,u.zw,new y(h,d));let m=Q(this.mosaicInfo.texture,f);return this.visualVariableColor!=null&&(m=ce(Qe(l,new n(.5)),new V(r.a),r)),m}vertex(e,t){const{segmentDirection:i,tlbr:r,bitset:a}=e,o=Xi(this,e),l=e.accumulatedDistance.divide(this.view.displayZoomFactor).add(st(i,o.scaledOffset)),u=new y(r.z.subtract(r.x),r.w.subtract(r.y)),p=r.divide(this.mosaicInfo.size.xyxy),d=le(a,Qi),h=le(a,Ji),f=ce(Qe(d,new n(.5)),this._getLineWidthRatio(e,o.scaledHalfWidth),new n(1));return{...o,tlbr:p,patternSize:u,accumulatedDistance:l,isSDF:d,sampleAlphaOnly:h,lineWidthRatio:f,...this.maybeRunHittest(e,t,o.halfWidth)}}fragment(e){const{color:t,opacity:i,isSDF:r}=e,a=Zi(e,this.antialiasingControls.blur),o=ce(Qe(r,new n(.5)),this._getSDFAlpha(e),this._getPatternColor(e)),l=t.multiply(i).multiply(a).multiply(o);return this.getFragmentOutput(l,e)}}c([S(bt)],mt.prototype,"mosaicInfo",void 0),c([R(0,A(Ne)),R(1,A(es))],mt.prototype,"vertex",null);let Js=class extends k{constructor(){super(...arguments),this.meshWriter=B.TexturedLineMeshWriter,this.shaders={geometry:new mt},this.symbologyPlane=de.LINE}render(e,t){const{context:i,painter:r,pixelRatio:a}=e;r.setShader({shader:this.shaders.geometry,uniforms:{...W(e,t.target,t.instance.getInput().geometry),...E(e,t.target),antialiasingControls:Ae(a),mosaicInfo:r.textureManager.getMosaicInfo(i,t.textureKey)},defines:{...I(e)},optionalAttributes:t.instance.optionalAttributes,useComputeBuffer:F(e)}),r.setPipelineState(L(e)),r.submitDraw(i,t)}};class ne extends je{}c([x(3,V)],ne.prototype,"color",void 0),c([x(4,V)],ne.prototype,"outlineColor",void 0),c([x(5,y)],ne.prototype,"offset",void 0),c([x(6,y)],ne.prototype,"textureUV",void 0),c([x(7,V)],ne.prototype,"sizing",void 0),c([x(8,n)],ne.prototype,"placementAngle",void 0),c([x(9,n)],ne.prototype,"sizeRatio",void 0),c([x(10,y)],ne.prototype,"zoomRange",void 0);class Fe extends Jt{}c([x(12,y)],Fe.prototype,"offsetNextVertex1",void 0),c([x(13,y)],Fe.prototype,"offsetNextVertex2",void 0),c([x(14,y)],Fe.prototype,"textureUVNextVertex1",void 0),c([x(15,y)],Fe.prototype,"textureUVNextVertex2",void 0);class er extends Te{}function oe(s,e,t,i){return e.multiply(s.x).add(t.multiply(s.y)).add(i.multiply(s.z))}function et(s){return s.multiply(s).divide(128)}class q extends Ke{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],textureUV:["textureUVNextVertex1","textureUVNextVertex2"]}}vertex(e,t){const i=et(e.sizing.x),r=et(e.sizing.y),a=et(e.sizing.z),o=e.placementAngle,l=le(e.bitset,$e.bitset.isSDF),u=le(e.bitset,$e.bitset.isMapAligned),p=le(e.bitset,$e.bitset.scaleSymbolsProportionally),d=ts(e.bitset,$e.bitset.colorLocked),h=is(this,e.id),f=ss(this,e.id,e.color,d).multiply(h),m=this.view.displayViewScreenMat3.multiply(new z(e.pos.xy,1)),v=ot(this,e.id,a).divide(a),b=i.multiply(v),g=e.offset.xy.multiply(v);let w=r.multiply(p.multiply(v.subtract(1)).add(1));w=at(w,Se(b.subtract(.99),new n(0)));const _=Se(w,new n(1)),P=at(w,new n(1)),T=j.fromRotation(o.multiply(rs)),C=ti(this,e.id),$=this._getViewRotationMatrix(u).multiply(C).multiply(T).multiply(new z(g.xy,0)),K=this.clip(e.id,e.zoomRange),ue=new V(m.xy.add($.xy),K,1),Re=e.textureUV.divide(this.mosaicInfo.size),Ie=e.outlineColor.multiply(P),Ce=le(e.bitset,$e.bitset.overrideOutlineColor),ze=e.sizeRatio.multiply(b).multiply(.5);return{glPosition:ue,color:f,textureUV:Re,outlineColor:Ie,outlineSize:_,distanceToPx:ze,isSDF:l,overrideOutlineColor:Ce,...this.maybeRunHittest(e,t,{pos:e.pos,size:b,sizeCorrection:v,isMapAligned:u,outlineSize:_,distanceToPx:ze,isSDF:l})}}fragment(e){const t=this._getColor(e.textureUV,e);return this.getFragmentOutput(t,e)}hittest(e,t,i){return ce(as(i.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(e,t,i),this._hittestMarker(e,t,i))}_getViewRotationMatrix(e){const t=this.view.displayViewMat3,i=this.view.displayMat3,r=new n(1).subtract(e);return t.multiply(e).add(i.multiply(r))}_getViewScreenMatrix(e){const t=this.view.viewMat3.multiply(this.view.tileMat3),i=this.view.tileMat3,r=new n(1).subtract(e);return t.multiply(e).add(i.multiply(r))}_getColor(e,t){return ce(Qt(t.isSDF,new n(1)),this._getSDFColor(e,t),this._getSpriteColor(e,t))}_getSpriteColor(e,t){return Q(this.mosaicInfo.texture,e).multiply(t.color)}_getSDFColor(e,t){const i=Q(this.mosaicInfo.texture,e),r=new n(.5).subtract(ui(i)).multiply(t.distanceToPx).multiply(os),a=lt(new n(.5).subtract(r),new n(0),new n(1)),o=t.color.multiply(a);let l=t.outlineSize;this.highlight&&(l=Se(l,t.overrideOutlineColor.multiply(4)));const u=l.multiply(.5),p=ei(r).subtract(u),d=lt(new n(.5).subtract(p),new n(0),new n(1)),h=nt(t.outlineColor,t.color,t.overrideOutlineColor).multiply(d);return new n(1).subtract(h.a).multiply(o).add(h)}_hittestSmallMarker(e,t,i){const{position:r,distance:a,smallSymbolDistance:o}=this.hittestRequest,l=a.subtract(o),{viewMat3:u,tileMat3:p}=this.view,d=u.multiply(p).multiply(new z(i.pos,1)).xy,h=i.size.multiply(.5);return ns(d,r).subtract(h).add(l)}_hittestMarker(e,t,i){const{pos:r,size:a,sizeCorrection:o,isMapAligned:l,outlineSize:u,isSDF:p,distanceToPx:d}=i,h=new z(e.offset.multiply(o),0),f=new z(t.offsetNextVertex1.multiply(o),0),m=new z(t.offsetNextVertex2.multiply(o),0),{viewMat3:v,tileMat3:b}=this.view,g=v.multiply(b).multiply(new z(r,1)),w=this._getViewScreenMatrix(l),_=g.add(w.multiply(h)).xy,P=g.add(w.multiply(f)).xy,T=g.add(w.multiply(m)).xy,C=this.hittestRequest.position,$=this.hittestRequest.distance,K=re(C.add(new y(he($),he($))),_,P,T),ue=re(C.add(new y(0,he($))),_,P,T),Re=re(C.add(new y($,he($))),_,P,T),Ie=re(C.add(new y(he($),0)),_,P,T),Ce=re(C,_,P,T),ze=re(C.add(new y($,0)),_,P,T),wt=re(C.add(new y(he($),$)),_,P,T),St=re(C.add(new y(0,$)),_,P,T),Vt=re(C.add(new y($,$)),_,P,T),ee=e.textureUV.divide(this.mosaicInfo.size),te=t.textureUVNextVertex1.divide(this.mosaicInfo.size),ie=t.textureUVNextVertex2.divide(this.mosaicInfo.size),se={color:new V(1),outlineColor:new V(1),overrideOutlineColor:new n(1),outlineSize:u,distanceToPx:d,isSDF:p};let M=new n(0);return M=M.add(ae(K).multiply(this._getColor(oe(K,ee,te,ie),se).a)),M=M.add(ae(ue).multiply(this._getColor(oe(ue,ee,te,ie),se).a)),M=M.add(ae(Re).multiply(this._getColor(oe(Re,ee,te,ie),se).a)),M=M.add(ae(Ie).multiply(this._getColor(oe(Ie,ee,te,ie),se).a)),M=M.add(ae(Ce).multiply(this._getColor(oe(Ce,ee,te,ie),se).a)),M=M.add(ae(ze).multiply(this._getColor(oe(ze,ee,te,ie),se).a)),M=M.add(ae(wt).multiply(this._getColor(oe(wt,ee,te,ie),se).a)),M=M.add(ae(St).multiply(this._getColor(oe(St,ee,te,ie),se).a)),M=M.add(ae(Vt).multiply(this._getColor(oe(Vt,ee,te,ie),se).a)),H(M,new n(.05)).multiply(Zt(this.hittestRequest))}}c([D(ii)],q.prototype,"visualVariableColor",void 0),c([D(si)],q.prototype,"visualVariableOpacity",void 0),c([D(gt)],q.prototype,"visualVariableRotation",void 0),c([D(ri)],q.prototype,"visualVariableSizeMinMaxValue",void 0),c([D(ai)],q.prototype,"visualVariableSizeScaleStops",void 0),c([D(oi)],q.prototype,"visualVariableSizeStops",void 0),c([D(ni)],q.prototype,"visualVariableSizeUnitValue",void 0),c([S(bt)],q.prototype,"mosaicInfo",void 0),c([R(0,A(ne)),R(1,A(Fe))],q.prototype,"vertex",null),c([R(0,A(er))],q.prototype,"fragment",null);let tr=class extends k{constructor(){super(...arguments),this.meshWriter=B.MarkerMeshWriter,this.shaders={geometry:new q},this.symbologyPlane=de.MARKER}render(e,t){const{context:i,painter:r}=e;r.setShader({shader:this.shaders.geometry,uniforms:{...W(e,t.target,t.instance.getInput().geometry),...E(e,t.target),mosaicInfo:r.textureManager.getMosaicInfo(i,t.textureKey,!0)},defines:{...I(e)},optionalAttributes:t.instance.optionalAttributes,useComputeBuffer:F(e)}),r.setPipelineState(L(e)),r.submitDraw(i,t)}};class ir{constructor(){this.computeAttributes={}}get locationsMap(){const e=new Map;for(const t in this.locations)e.set(t,this.locations[t].index);return e}get optionPropertyKeys(){if(!this._optionPropertyKeys){const e=new Set(Object.keys(this.options));this._optionPropertyKeys=e}return this._optionPropertyKeys}get _transformFeedbackBindings(){return[]}get locationInfo(){if(!this._locationInfo){const e=this.locationsMap,t=Array.from(e.entries()).map(([r,a])=>`${r}.${a}`).join("."),i=vs(t);this._locationInfo={hash:i,locations:e}}return this._locationInfo}get renamedLocationsMap(){const e=new Map;for(const[t,i]of this.locationsMap.entries())e.set("a_"+t,i);return e}getShaderKey(e,t,i){const r=Object.keys(i).filter(o=>i[o]).map(o=>`${o}_${i[o].toString()}`).join("."),a=Object.keys(t).filter(o=>this.optionPropertyKeys.has(o)).join(".");return`${e.hash}.${r}.${a}`}getProgram(e,t,i,r){let a="",o="";for(const l in i)if(i[l]){const u=typeof i[l]=="boolean"?`#define ${l} `:`#define ${l} ${i[l]} `;a+=u,o+=u}return a+=this.vertexShader,o+=this.fragmentShader,new ls(a,o,this.renamedLocationsMap,this.locationInfo,this._getUniformBindings(t),this._transformFeedbackBindings)}_getUniformBindings(e){const t=[];for(const i in this.required){const r=this.required[i];t.push({uniformHydrated:null,shaderModulePath:i,uniformName:i,uniformType:r.type,uniformArrayElementType:Nt(r),uniformArrayLength:Ut(r)})}for(const i in e){const r=this.options[i];if(e[i])for(const a in r){const o=r[a];t.push({uniformHydrated:null,shaderModulePath:`${i}.${a}`,uniformName:a,uniformType:o.type,uniformArrayElementType:Nt(o),uniformArrayLength:Ut(o)})}}return t}}const Nt=s=>{var e;return s.type==="array"?(e=s.elementType)==null?void 0:e.type:void 0},Ut=s=>s.type==="array"?s.size:void 0,sr={hittestDist:n,hittestPos:y},rr={filterFlags:U,animation:U,visualVariableData:U,dataDriven0:U,dataDriven1:U,dataDriven2:U,gpgpu:U,size:n},ar={displayViewScreenMat3:j,displayViewMat3:j,displayMat3:j,viewMat3:j,tileMat3:j,displayZoomFactor:n,requiredZoomFactor:n,tileOffset:y,currentScale:n,currentZoom:n,metersPerSRUnit:n};let or=class extends ir{constructor(){super(...arguments),this.vertexShader=Lt("materials/pie/pie.vert"),this.fragmentShader=Lt("materials/pie/pie.frag"),this.required={...rr,...ar,outlineWidth:n,colors:X,defaultColor:V,othersColor:V,outlineColor:V,donutRatio:n,sectorThreshold:n},this.options={hittestUniforms:sr,visualVariableSizeMinMaxValue:{minMaxValueAndSize:V},visualVariableSizeScaleStops:{sizes:{...X.ofType(n,8),type:"array",elementType:n,size:8},values:{...X.ofType(n,8),type:"array",elementType:n,size:8}},visualVariableSizeStops:{sizes:{...X.ofType(n,8),type:"array",elementType:n,size:8},values:{...X.ofType(n,8),type:"array",elementType:n,size:8}},visualVariableSizeUnitValue:{unitValueToPixelsRatio:n},visualVariableOpacity:{opacities:{...X.ofType(n,8),type:"array",elementType:n,size:8},opacityValues:{...X.ofType(n,8),type:"array",elementType:n,size:8}}},this.locations={pos:{index:0,type:y},id:{index:1,type:z},bitset:{index:2,type:n},offset:{index:3,type:y},texCoords:{index:4,type:y},size:{index:5,type:y},referenceSize:{index:6,type:n},zoomRange:{index:7,type:y}},this.defines={VV_SIZE_MIN_MAX_VALUE:"boolean",VV_SIZE_SCALE_STOPS:"boolean",VV_SIZE_FIELD_STOPS:"boolean",VV_SIZE_UNIT_VALUE:"boolean",VV_OPACITY:"boolean",HITTEST:"boolean",numberOfFields:"number",highlight:"boolean",inside:"boolean",outside:"boolean"}}setNumberOfFields(e){this.required.colors={...X.ofType(V,e),type:"array",elementType:V,size:e}}},nr=class extends k{constructor(){super(...arguments),this.meshWriter=B.PieChartMeshWriter,this.shaders={geometry:new or},this.symbologyPlane=de.MARKER}render(e,t){var m,v;const{context:i,painter:r}=e,{instance:a,target:o}=t,l=this.shaders.geometry,u=a.getInput(),p=u.numberOfFields,d=F(e),h=E(e,o),f=I(e);l.setNumberOfFields(p),r.setShader({shader:l,uniforms:{...W(e,t.target,u.geometry),...h.storage,...h.view,hittestUniforms:h.hittestRequest?{hittestDist:(m=h.hittestRequest)==null?void 0:m.distance,hittestPos:(v=h.hittestRequest)==null?void 0:v.position}:null},defines:{VV_SIZE_MIN_MAX_VALUE:!!u.geometry.visualVariableSizeMinMaxValue,VV_SIZE_SCALE_STOPS:!!u.geometry.visualVariableSizeScaleStops,VV_SIZE_FIELD_STOPS:!!u.geometry.visualVariableSizeStops,VV_SIZE_UNIT_VALUE:!!u.geometry.visualVariableSizeUnitValue,VV_OPACITY:!!u.geometry.visualVariableOpacity,HITTEST:d,highlight:h.highlight?1:0,...f,numberOfFields:p},optionalAttributes:{},useComputeBuffer:d}),r.setPipelineState(L(e)),r.submitDraw(i,t)}},lr=class extends k{constructor(){super(...arguments),this.meshWriter=B.TextMeshWriter,this.shaders={geometry:new O},this.symbologyPlane=de.TEXT}render(e,t){const{context:i,painter:r}=e,a=I(e),o={shader:this.shaders.geometry,uniforms:{...W(e,t.target,t.instance.getInput().geometry),...E(e,t.target),mosaicInfo:r.textureManager.getMosaicInfo(i,t.textureKey)},defines:{...a,isHaloPass:!1,isBackgroundPass:!0,isLabel:!1},optionalAttributes:t.instance.optionalAttributes,useComputeBuffer:F(e)};r.setShader(o),r.setPipelineState(L(e)),r.submitDraw(i,t),r.setShader({...o,defines:{...a,isHaloPass:!0,isBackgroundPass:!1,isLabel:!1}}),r.submitDraw(i,t),r.setShader({...o,defines:{...a,isHaloPass:!1,isBackgroundPass:!1,isLabel:!1}}),r.submitDraw(i,t)}};const J={fill:new Es("fill"),patternFill:new Ls("patternFill"),complexFill:new Cs("complexFill"),outlineFill:new Ds("outlineFill"),patternOutlineFill:new Bs("patternOutlineFill"),complexOutlineFill:new Os("complexOutlineFill"),marker:new tr("marker"),pieChart:new nr("pieChart"),line:new Qs("line"),texturedLine:new Js("texturedLine"),text:new lr("text"),label:new Ys("label"),heatmap:new Gs("heatmap"),dotDensity:new Is("dotDensity")};function ka(){for(const s in J)J[s].startup()}function Na(s){for(const e in J)J[e].shutdown(s)}function qe(s,e){const t=s.slice(0,e),i=e-t.length;for(let r=0;rpi.getLogger("esri.views.2d.layers.features.support.rendererUtils");function Pi(s){return s.map(e=>cr(e)?pr(e.clone()):e)}function cr(s){return(s.type==="size"||s.type==="color"||s.type==="opacity")&&s.stops!=null}function pr(s){return s.stops=fr(s.type,s.stops??[]),s}function me(s,e,t){return(1-t)*s+t*e}function dr(s,e){const[t,...i]=e,r=i.pop(),a=i[0].value,o=i[i.length-1].value,l=(o-a)/$i,u=[];for(let p=a;p=i[d].value;)d++;const h=i[d],f=e[d-1],m=p-f.value,v=h.value===f.value?1:m/(h.value-f.value);if(s==="color"){const b=i[d],g=e[d-1],w=b.color.clone();w.r=me(g.color.r,w.r,v),w.g=me(g.color.g,w.g,v),w.b=me(g.color.b,w.b,v),w.a=me(g.color.a,w.a,v),u.push({value:p,color:w,label:b.label})}else if(s==="size"){const b=i[d],g=e[d-1],w=Et(b.size),_=me(Et(g.size),w,v);u.push({value:p,size:_,label:b.label})}else{const b=i[d],g=me(e[d-1].opacity,b.opacity,v);u.push({value:p,opacity:g,label:b.label})}}return[t,...u,r]}function hr(s){const[e,...t]=s,i=t.pop();for(;t.length>$i;){let r=0,a=0;for(let o=1;oa&&(a=p,r=o)}t.splice(r,1)}return[e,...t,i]}function fr(s,e){return e.length<=Ue?e:(Mi().warn(`Found ${e.length} Visual Variable stops, but MapView only supports ${Ue}. Displayed stops will be simplified.`),e.length>2*Ue?dr(s,e):hr(e))}function mr(){const{supportsColorBufferFloat:s,supportsColorBufferFloatBlend:e,supportsColorBufferHalfFloat:t}=vt();return s&&e||t}function Ua(s){if(!s)return!0;switch(s.type){case"dot-density":break;case"heatmap":if(!mr()){const e=vt(),t=["supportsColorBufferFloat","supportsColorBufferFloatBlend","supportsColorBufferHalfFloat"].filter(i=>!e[i]).join(", ");return Mi().errorOnce(new De("webgl-missing-extension",`Missing WebGL2 requirements for Heatmap: ${t}`)),!1}}return!0}const yr=1.25,Ee=128,br=128;function vr(s){var a;if(!((a=s.stops)!=null&&a.length))return null;const e=s.stops.sort((o,l)=>o.value-l.value),t=qe(e,8),i=t.map(({value:o})=>o),r=t.map(({color:o})=>ur(o));return{values:i,colors:r}}function gr(s){var i;if(!((i=s.stops)!=null&&i.length))return null;const e=s.stops.sort((r,a)=>r.value-a.value),t=qe(e,8);return{opacityValues:t.map(({value:r})=>r),opacities:t.map(({opacity:r})=>r)}}function xr(s){return{rotationType:s.rotationType==="geographic"?rt.Geographic:rt.Arithmatic}}function tt(s){var i;if(!((i=s.stops)!=null&&i.length))return null;if(s.stops.some(r=>r.useMaxValue||r.useMinValue))return(r,a)=>{const o=r.statisticsByLevel.get(a.key.level),l=s.stops.map(p=>{var d,h;return{value:p.useMaxValue?((d=o==null?void 0:o.get(s.field))==null?void 0:d.maxValue)??0:p.useMinValue?((h=o==null?void 0:o.get(s.field))==null?void 0:h.minValue)??0:p.value,size:p.size?xe(p.size):gs}}).sort((p,d)=>p.value-d.value),u=qe(l,8);return{values:u.map(({value:p})=>p),sizes:u.map(({size:p})=>p)}};const e=s.stops.sort((r,a)=>r.value-a.value),t=qe(e,8);return{values:t.map(({value:r})=>r),sizes:t.map(({size:r})=>xe(r))}}function wr(s){return e=>{const{state:t}=e;return{unitValueToPixelsRatio:xs(t.spatialReference)/ws[s.valueUnit]/t.resolution}}}function Ht(s,e){const t=e.length;if(s{const l=a.state.scale,u=xe(Ht(l,i.stops)),p=xe(Ht(l,r.stops));return{minMaxValueAndSize:[e,t,u,p]}};if(typeof i=="object"||typeof r=="object")throw new Error("InternalError: Found a partial VisualVariableSizeMinMaxValue");return{minMaxValueAndSize:[e,t,xe(i),xe(r)]}}const xt={visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:null,visualVariableSizeStops:null,visualVariableSizeScaleStops:null,visualVariableSizeOutlineScaleStops:null,visualVariableSizeUnitValue:null,visualVariableSizeMinMaxValue:null};function Fi(s,e=br,t=yr){if(s.visualVariableSizeMinMaxValue)return s.visualVariableSizeMinMaxValue instanceof Function?Ee:Math.max(s.visualVariableSizeMinMaxValue.minMaxValueAndSize[3]*t,e);if(s.visualVariableSizeScaleStops){if(s.visualVariableSizeScaleStops instanceof Function)return Ee;const i=s.visualVariableSizeScaleStops.sizes;return Math.max(i[i.length-1]*t,e)}if(s.visualVariableSizeStops){if(s.visualVariableSizeStops instanceof Function)return Ee;const i=s.visualVariableSizeStops.sizes;return Math.max(i[i.length-1]*t,e)}return s.visualVariableSizeUnitValue?2*Ee:0}function Ha(s){const e={...xt};if(!s||!("visualVariables"in s)||!s.visualVariables)return e;for(const t of Pi(s.visualVariables))switch(t.type){case"color":e.visualVariableColor=vr(t);break;case"opacity":e.visualVariableOpacity=gr(t);break;case"rotation":e.visualVariableRotation=xr(t);break;case"size":switch(Vr(t)){case"field-stops":e.visualVariableSizeStops=tt(t);break;case"scale-stops":t.target==="outline"?e.visualVariableSizeOutlineScaleStops=tt(t):e.visualVariableSizeScaleStops=tt(t);break;case"min-max":e.visualVariableSizeMinMaxValue=Sr(t);break;case"unit-value":e.visualVariableSizeUnitValue=wr(t)}break;default:console.error("Unable to handle VV type")}return e}function Vr(s){if(typeof s.minDataValue=="number"&&typeof s.maxDataValue=="number"&&s.minSize!=null&&s.maxSize!=null)return"min-max";if((s.expression&&s.expression==="view.scale"||s.valueExpression&&s.valueExpression==="$view.scale")&&Array.isArray(s.stops))return"scale-stops";if((s.field!=null||s.expression&&s.expression!=="view.scale"||s.valueExpression&&s.valueExpression!=="$view.scale")&&(Array.isArray(s.stops)||"levels"in s&&s.levels))return"field-stops";if((s.field!=null||s.expression&&s.expression!=="view.scale"||s.valueExpression&&s.valueExpression!=="$view.scale")&&s.valueUnit!=null)return"unit-value";throw new Error("InternalError: Found unknown sizeVV type")}function _r(s){return!!(s.visualVariableSizeMinMaxValue||s.visualVariableSizeScaleStops||s.visualVariableSizeStops||s.visualVariableSizeUnitValue||s.visualVariableSizeOutlineScaleStops)}function Wa(s){return!!s.visualVariableRotation}function zr(s){return s.minScale||s.maxScale?{minScale:s.minScale??0,maxScale:s.maxScale??0}:null}function Y(s){if(s==null)return null;if(Array.isArray(s)){const[e,t,i,r]=s;return[e,t,i,255*r]}return typeof s=="string"?s:{...s,defaultValue:Y(s==null?void 0:s.defaultValue)}}async function Ga(s,e){const{cimResourceManager:t,cimAnalyzer:i,scaleExpression:r}=e.schemaOptions;await Promise.all(us.fetchResources(s.symbol,t,[]));const a=i.analyzeSymbolReference(s,!1),o={scaleInfo:zr(s),scaleExpression:r},l=[];for(const u of a)switch(u.type){case"marker":l.push(...$r(u,e,o));break;case"fill":l.push(...Tr(u,e,o));break;case"line":l.push(...Rr(u,e,o));break;case"text":l.push(...Or(u,e,o))}return l}function $r(s,e,t){const{uniforms:i,schemaOptions:r}=e,{store:a}=r,o=s.isOutline?{...xt,visualVariableSizeScaleStops:i.visualVariableSizeOutlineScaleStops}:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue,visualVariableRotation:i.visualVariableRotation};return Mr(a.ensureInstance(J.marker,{geometry:o},{zoomRange:!!t.scaleInfo}),s,i,t)}function Mr(s,e,t,{scaleInfo:i,scaleExpression:r}){const a=_r(t);return[s.createMeshInfo({params:{size:e.size,scaleX:e.scaleX,anchorX:e.anchorPoint.x,anchorY:e.anchorPoint.y,angle:e.rotation,color:Y(e.color)??[0,0,0,0],colorLocked:e.colorLocked,frameHeight:e.frameHeight,widthRatio:e.widthRatio,scaleInfo:i,offsetX:e.offsetX,offsetY:e.offsetY,outlineColor:Y(e.outlineColor)??[0,0,0,0],outlineSize:e.outlineWidth,referenceSize:e.referenceSize||ps.CIMVectorMarker.size,rotateClockwise:e.rotateClockwise,scaleFactor:r??1,sizeRatio:e.sizeRatio,alignment:e.alignment,isAbsoluteAnchorPoint:e.isAbsoluteAnchorPoint,scaleSymbolsProportionally:e.scaleSymbolsProportionally,sprite:e.spriteRasterizationParam,hasSizeVV:a,placement:e.markerPlacement,effects:e.effects?{type:"cim-effect-infos",effectInfos:e.effects}:null,transforms:e.transform,minPixelBuffer:Fi(t)}})]}function Pr(s,e,t){const{uniforms:i,schemaOptions:r}=e,{store:a}=r;return Fr(a.ensureInstance(J.fill,{geometry:{visualVariableColor:s.colorLocked?null:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity}},{zoomRange:!!t.scaleInfo}),s,t)}function Fr(s,e,{scaleInfo:t}){return[s.createMeshInfo({params:{color:Y(e.color)??[0,0,0,0],scaleInfo:t,effects:e.effects?{type:"cim-effect-infos",effectInfos:e.effects}:null}})]}function Tr(s,e,t){if(!s.spriteRasterizationParam)return Pr(s,e,t);const{uniforms:i,schemaOptions:r}=e,{store:a}=r;return Ar(a.ensureInstance(J.complexFill,{geometry:{visualVariableColor:s.colorLocked?null:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity}},{zoomRange:!!t.scaleInfo}),s,i.visualVariableColor!=null,t)}function Ar(s,e,t,{scaleInfo:i}){if(!e.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const r=!!e.hasUnresolvedReplacementColor&&(!t||e.colorLocked),a=e.sampleAlphaOnly&&!r,o=e.spriteRasterizationParam;return[s.createMeshInfo({params:{color:Y(e.color)??[0,0,0,0],height:e.height,aspectRatio:e.scaleX,offsetX:e.offsetX,offsetY:e.offsetY,scaleX:1,scaleY:1,angle:e.angle,applyRandomOffset:e.applyRandomOffset,sampleAlphaOnly:a,scaleProportionally:o.resource.type==="CIMHatchFill",sprite:o,scaleInfo:i,effects:e.effects?{type:"cim-effect-infos",effectInfos:e.effects}:null}})]}function Rr(s,e,t){const{uniforms:i,schemaOptions:r}=e,{store:a}=r,o=s.isOutline?{...xt,visualVariableSizeScaleStops:i.visualVariableSizeOutlineScaleStops}:{visualVariableColor:s.colorLocked?null:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue},l={geometry:o},u=!!(o.visualVariableSizeMinMaxValue||o.visualVariableSizeScaleStops||o.visualVariableSizeStops||o.visualVariableSizeUnitValue);return s.spriteRasterizationParam?Cr(a.ensureInstance(J.texturedLine,l,{zoomRange:!!t.scaleInfo}),s,u,t):Ir(a.ensureInstance(J.line,l,{zoomRange:!!t.scaleInfo}),s,u,t)}function Ti(s,e,{scaleInfo:t}){return{params:{color:Y(s.color)??[0,0,0,0],width:s.width,referenceWidth:s.referenceWidth,capType:s.cap,joinType:s.join,miterLimit:s.miterLimit,scaleInfo:t,hasSizeVV:e,effects:s.effects?{type:"cim-effect-infos",effectInfos:s.effects}:null}}}function Ir(s,e,t,i){if(e.spriteRasterizationParam)throw new Error("InternalError: Sprite should not be defined");return[s.createMeshInfo({params:Ti(e,t,i).params})]}function Cr(s,e,t,i){const{spriteRasterizationParam:r,scaleDash:a,sampleAlphaOnly:o}=e;if(!r)throw new Error("InternalError: Sprite should be defined");return[s.createMeshInfo({params:{...Ti(e,t,i).params,shouldScaleDash:a??!1,shouldSampleAlphaOnly:o,isSDF:r.resource.type!=="CIMPictureStroke",sprite:r}})]}function Or(s,e,t){const{uniforms:i,schemaOptions:r}=e,{store:a}=r;return Er(a.ensureInstance(J.text,{geometry:{visualVariableColor:s.colorLocked?null:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableRotation:i.visualVariableRotation,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue}},{zoomRange:!!t.scaleInfo,referenceSymbol:!1,clipAngle:!1}),s,i,t)}function Er(s,e,t,{scaleInfo:i,scaleExpression:r}){return[s.createMeshInfo({params:{boxBackgroundColor:Y(e.backgroundColor),boxBorderLineColor:Y(e.borderLineColor),boxBorderLineSize:e.borderLineWidth??0,color:Y(e.color)??[0,0,0,0],offsetX:e.offsetX,offsetY:e.offsetY,postAngle:e.angle,fontSize:e.size,referenceSize:e.referenceSize,decoration:e.decoration,haloColor:Y(e.outlineColor)??[0,0,0,0],haloFontSize:e.outlineSize,lineWidth:e.lineWidth||512,lineHeightRatio:1,horizontalAlignment:e.horizontalAlignment??"center",verticalAlignment:e.verticalAlignment??"baseline",useCIMAngleBehavior:!1,glyphs:e.textRasterizationParam,scaleInfo:i,effects:e.effects?{type:"cim-effect-infos",effectInfos:e.effects}:null,placement:e.markerPlacement,transforms:e.transform,scaleFactor:r??1,minPixelBuffer:Fi(t),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,isLineLabel:!1}})]}function qa(s,e){return{type:"simple",filters:e,capabilities:{maxTextureSize:vt().maxTextureSize},bindings:Dr(s)}}function Ze(s){switch(s){case"opacity":return Oe.OPACITY;case"color":return Oe.COLOR;case"rotation":return Oe.ROTATION;case"size":return Oe.SIZE;default:return null}}function Dr(s){if(!s)return[];switch(s.type){case"simple":case"class-breaks":case"unique-value":case"dictionary":return Ai(s);case"dot-density":return Lr(s);case"pie-chart":return Br(s);case"heatmap":return kr(s)}}function Lr(s){const e=[];for(const t of s.attributes)e.push({binding:e.length,expression:t.valueExpression,field:t.field});return e}function Br(s){const e=Ai(s);let t=4;for(const i of s.attributes)e.push({binding:t++,expression:i.valueExpression,field:i.field});return e}function kr({valueExpression:s,field:e}){return s||e?[{binding:0,expression:s,field:e}]:[]}function Ai(s){var e;return!("visualVariables"in s)||!((e=s.visualVariables)!=null&&e.length)?[]:Pi(s.visualVariables).map(t=>Gr(t)).filter(Ss)}function Nr(s){return s.valueExpression==="$view.scale"?null:{binding:Ze(s.type),field:s.field,normalizationField:s.normalizationField,expression:s.valueExpression,valueRepresentation:s.valueRepresentation}}function Ur(s){return{binding:Ze(s.type),field:s.field,normalizationField:s.normalizationField,expression:s.valueExpression}}function Hr(s){return{binding:Ze(s.type),field:s.field,normalizationField:s.normalizationField,expression:s.valueExpression}}function Wr(s){return{binding:Ze(s.type),expression:s.valueExpression,field:s.field}}function Gr(s){switch(s.type){case"size":return Nr(s);case"color":return Ur(s);case"opacity":return Hr(s);case"rotation":return Wr(s)}}function it(s){return s.some(e=>e.globalId)}function Me(s){return s.filter(e=>!e.error).map(e=>e.objectId??e.globalId).filter(e=>e!=null)}function Wt(s,e){const t=new Set(s);for(const i of e.values())t.add(i);return t}function Gt(s,e){const t=new Set(s);for(const i of e.values())t.delete(i);return t}class ja{constructor(e){this.updateTracking=new cs({debugName:"FeatureCommandQueue"}),this._hasGlobalIds=!1,this._queueProcessor=new Vs({concurrency:1,process:e.process})}destroy(){this.updateTracking.destroy(),this._queueProcessor.destroy(),this.clear()}clear(){this._queueProcessor.clear()}async push(e){return this.updateTracking.addPromise(this._doPush(e))}async _doPush(e){const t=this._queueProcessor,i=t.last(),r=[];switch(e.type){case"update":if((i==null?void 0:i.type)===e.type)return;r.push(t.push(e));break;case"edit":{const a=(i==null?void 0:i.type)==="processed-edit"?i:null;a&&t.popLast();const o=this._mergeEdits(a,e);for(const l of o)l&&r.push(t.push(l));break}}await Promise.all(r)}_mergeEdits(e,t){const{addedFeatures:i,deletedFeatures:r,updatedFeatures:a}=t.edits;if(this._hasGlobalIds=this._hasGlobalIds||it(i)||it(a)||it(r),this._hasGlobalIds)return[e,{type:"processed-edit",edits:{addOrModified:[...i,...a],removed:r}}];const o=new Set(Me((e==null?void 0:e.edits.addOrModified)??[])),l=new Set(Me((e==null?void 0:e.edits.removed)??[])),u=new Set([...Me(i),...Me(a)]),p=new Set(Me(r));return[{type:"processed-edit",edits:{addOrModified:Array.from(Wt(Gt(o,p),u)).map(d=>({objectId:d})),removed:Array.from(Wt(Gt(l,u),p)).map(d=>({objectId:d}))}}]}}export{ka as F,Ar as S,Na as T,Ir as a,ja as b,Ha as c,ur as d,Fi as e,_r as f,Ai as g,J as h,Wa as i,Ua as m,Ga as n,Fr as p,zr as s,qa as t,Mr as u,xt as x,Er as y,Cr as z}; diff --git a/assets/FeatureEffect-ByrbZlne.js b/assets/FeatureEffect-DBbkrS6j.js similarity index 98% rename from assets/FeatureEffect-ByrbZlne.js rename to assets/FeatureEffect-DBbkrS6j.js index 62e849c..e3f2600 100644 --- a/assets/FeatureEffect-ByrbZlne.js +++ b/assets/FeatureEffect-DBbkrS6j.js @@ -1 +1 @@ -import{aY as x,d as i,y as l,a$ as I,b2 as N,f as E,aU as j,aX as L,aV as d,b1 as y,f4 as S,f5 as g,N as m}from"./index-CEWggaxV.js";var h;const p=new x({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),f=new x({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let n=h=class extends j{constructor(e){super(e),this.where=null,this.geometry=null,this.spatialRelationship="intersects",this.distance=void 0,this.objectIds=null,this.units=null,this.timeExtent=null}createQuery(e={}){const{where:t,geometry:s,spatialRelationship:a,timeExtent:r,objectIds:u,units:c,distance:$}=this;return new L({geometry:d(s),objectIds:d(u),spatialRelationship:a,timeExtent:d(r),where:t,units:c,distance:$,...e})}clone(){const{where:e,geometry:t,spatialRelationship:s,timeExtent:a,objectIds:r,units:u,distance:c}=this;return new h({geometry:d(t),objectIds:d(r),spatialRelationship:s,timeExtent:d(a),where:e,units:u,distance:c})}};i([l({type:String,json:{write:!0}})],n.prototype,"where",void 0),i([l({types:I,json:{write:!0}})],n.prototype,"geometry",void 0),i([l({type:p.apiValues,json:{name:"spatialRel",read:{reader:p.read},write:{allowNull:!1,writer:p.write,overridePolicy(){return{enabled:this.geometry!=null}}}}})],n.prototype,"spatialRelationship",void 0),i([l({type:Number,json:{write:{overridePolicy(e){return{enabled:e!=null&&this.geometry!=null}}}}})],n.prototype,"distance",void 0),i([l({type:[Number],json:{write:!0}})],n.prototype,"objectIds",void 0),i([l({type:f.apiValues,json:{read:f.read,write:{writer:f.write,overridePolicy(e){return{enabled:e!=null&&this.geometry!=null}}}}})],n.prototype,"units",void 0),i([l({type:N,json:{write:!0}})],n.prototype,"timeExtent",void 0),n=h=i([E("esri.layers.support.FeatureFilter")],n);const U=n;var w;const b={read:{reader:S},write:{writer:g,overridePolicy(){return{allowNull:this.excludedEffect!=null,isRequired:this.excludedEffect==null}}}},v={read:{reader:S},write:{writer:g,overridePolicy(){return{allowNull:this.includedEffect!=null,isRequired:this.includedEffect==null}}}},R={name:"showExcludedLabels",default:!0};let o=w=class extends j{constructor(e){super(e),this.filter=null,this.includedEffect=null,this.excludedEffect=null,this.excludedLabelsVisible=!1}write(e,t){var a,r;const s=super.write(e,t);if(t!=null&&t.origin){if(s.filter){const u=Object.keys(s.filter);if(u.length>1||u[0]!=="where")return(a=t.messages)==null||a.push(new m("web-document-write:unsupported-feature-effect","Invalid feature effect 'filter'. A filter can only contain a 'where' property",{layer:t.layer,effect:this})),null}if("showExcludedLabels"in s)return(r=t.messages)==null||r.push(new m("web-document-write:unsupported-feature-effect","Invalid value for property 'excludedLabelsVisible' which should always be 'true'",{layer:t.layer,effect:this})),null}return s}clone(){return new w({filter:this.filter!=null?this.filter.clone():null,includedEffect:this.includedEffect,excludedEffect:this.excludedEffect,excludedLabelsVisible:this.excludedLabelsVisible})}};i([l({type:U,json:{write:{allowNull:!0,writer(e,t,s,a){const r=e==null?void 0:e.write({},a);r&&Object.keys(r).length!==0?y(s,r,t):y(s,null,t)}}}})],o.prototype,"filter",void 0),i([l({json:{write:!0,origins:{"web-map":b,"portal-item":b}}})],o.prototype,"includedEffect",void 0),i([l({json:{write:!0,origins:{"web-map":v,"portal-item":v}}})],o.prototype,"excludedEffect",void 0),i([l({type:Boolean,json:{write:!0,name:"showExcludedLabels",origins:{"web-map":R,"portal-item":R}}})],o.prototype,"excludedLabelsVisible",void 0),o=w=i([E("esri.layers.support.FeatureEffect")],o);const _=o;export{U as d,_ as m}; +import{aY as x,d as i,y as l,a$ as I,b2 as N,f as E,aU as j,aX as L,aV as d,b1 as y,f4 as S,f5 as g,N as m}from"./index-BjUNJPVf.js";var h;const p=new x({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),f=new x({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let n=h=class extends j{constructor(e){super(e),this.where=null,this.geometry=null,this.spatialRelationship="intersects",this.distance=void 0,this.objectIds=null,this.units=null,this.timeExtent=null}createQuery(e={}){const{where:t,geometry:s,spatialRelationship:a,timeExtent:r,objectIds:u,units:c,distance:$}=this;return new L({geometry:d(s),objectIds:d(u),spatialRelationship:a,timeExtent:d(r),where:t,units:c,distance:$,...e})}clone(){const{where:e,geometry:t,spatialRelationship:s,timeExtent:a,objectIds:r,units:u,distance:c}=this;return new h({geometry:d(t),objectIds:d(r),spatialRelationship:s,timeExtent:d(a),where:e,units:u,distance:c})}};i([l({type:String,json:{write:!0}})],n.prototype,"where",void 0),i([l({types:I,json:{write:!0}})],n.prototype,"geometry",void 0),i([l({type:p.apiValues,json:{name:"spatialRel",read:{reader:p.read},write:{allowNull:!1,writer:p.write,overridePolicy(){return{enabled:this.geometry!=null}}}}})],n.prototype,"spatialRelationship",void 0),i([l({type:Number,json:{write:{overridePolicy(e){return{enabled:e!=null&&this.geometry!=null}}}}})],n.prototype,"distance",void 0),i([l({type:[Number],json:{write:!0}})],n.prototype,"objectIds",void 0),i([l({type:f.apiValues,json:{read:f.read,write:{writer:f.write,overridePolicy(e){return{enabled:e!=null&&this.geometry!=null}}}}})],n.prototype,"units",void 0),i([l({type:N,json:{write:!0}})],n.prototype,"timeExtent",void 0),n=h=i([E("esri.layers.support.FeatureFilter")],n);const U=n;var w;const b={read:{reader:S},write:{writer:g,overridePolicy(){return{allowNull:this.excludedEffect!=null,isRequired:this.excludedEffect==null}}}},v={read:{reader:S},write:{writer:g,overridePolicy(){return{allowNull:this.includedEffect!=null,isRequired:this.includedEffect==null}}}},R={name:"showExcludedLabels",default:!0};let o=w=class extends j{constructor(e){super(e),this.filter=null,this.includedEffect=null,this.excludedEffect=null,this.excludedLabelsVisible=!1}write(e,t){var a,r;const s=super.write(e,t);if(t!=null&&t.origin){if(s.filter){const u=Object.keys(s.filter);if(u.length>1||u[0]!=="where")return(a=t.messages)==null||a.push(new m("web-document-write:unsupported-feature-effect","Invalid feature effect 'filter'. A filter can only contain a 'where' property",{layer:t.layer,effect:this})),null}if("showExcludedLabels"in s)return(r=t.messages)==null||r.push(new m("web-document-write:unsupported-feature-effect","Invalid value for property 'excludedLabelsVisible' which should always be 'true'",{layer:t.layer,effect:this})),null}return s}clone(){return new w({filter:this.filter!=null?this.filter.clone():null,includedEffect:this.includedEffect,excludedEffect:this.excludedEffect,excludedLabelsVisible:this.excludedLabelsVisible})}};i([l({type:U,json:{write:{allowNull:!0,writer(e,t,s,a){const r=e==null?void 0:e.write({},a);r&&Object.keys(r).length!==0?y(s,r,t):y(s,null,t)}}}})],o.prototype,"filter",void 0),i([l({json:{write:!0,origins:{"web-map":b,"portal-item":b}}})],o.prototype,"includedEffect",void 0),i([l({json:{write:!0,origins:{"web-map":v,"portal-item":v}}})],o.prototype,"excludedEffect",void 0),i([l({type:Boolean,json:{write:!0,name:"showExcludedLabels",origins:{"web-map":R,"portal-item":R}}})],o.prototype,"excludedLabelsVisible",void 0),o=w=i([E("esri.layers.support.FeatureEffect")],o);const _=o;export{U as d,_ as m}; diff --git a/assets/FeatureEffectLayer-CLTrRFqx.js b/assets/FeatureEffectLayer-DarO4Ctx.js similarity index 67% rename from assets/FeatureEffectLayer-CLTrRFqx.js rename to assets/FeatureEffectLayer-DarO4Ctx.js index 323a0ef..6449021 100644 --- a/assets/FeatureEffectLayer-CLTrRFqx.js +++ b/assets/FeatureEffectLayer-DarO4Ctx.js @@ -1 +1 @@ -import{d as t,y as o,f as a}from"./index-CEWggaxV.js";import{m as f}from"./FeatureEffect-ByrbZlne.js";const r={write:{allowNull:!0}},p=s=>{let e=class extends s{constructor(){super(...arguments),this.featureEffect=null}};return t([o({type:f,json:{origins:{"web-map":r,"portal-item":r}}})],e.prototype,"featureEffect",void 0),e=t([a("esri.layers.mixins.FeatureEffectLayer")],e),e};export{p}; +import{d as t,y as o,f as a}from"./index-BjUNJPVf.js";import{m as f}from"./FeatureEffect-DBbkrS6j.js";const r={write:{allowNull:!0}},p=s=>{let e=class extends s{constructor(){super(...arguments),this.featureEffect=null}};return t([o({type:f,json:{origins:{"web-map":r,"portal-item":r}}})],e.prototype,"featureEffect",void 0),e=t([a("esri.layers.mixins.FeatureEffectLayer")],e),e};export{p}; diff --git a/assets/FeatureLayer-D0kMrROG.js b/assets/FeatureLayer-BHxNIHhy.js similarity index 87% rename from assets/FeatureLayer-D0kMrROG.js rename to assets/FeatureLayer-BHxNIHhy.js index d32a58d..c19b3d1 100644 --- a/assets/FeatureLayer-D0kMrROG.js +++ b/assets/FeatureLayer-BHxNIHhy.js @@ -1,7 +1,7 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/featureLayerUtils-SShyxaG9.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css","assets/originUtils-D69mHv66.js","assets/multiOriginJSONSupportUtils-C0wm8_Yw.js","assets/utils-2LBmsoaQ.js","assets/saveAPIKeyUtils-BiX1lQSW.js","assets/saveUtils-BzCRy3uR.js","assets/fetchService-C38RarY2.js","assets/lazyLayerLoader-s-GqbiwM.js","assets/FeatureLayerSource-BeuGtrZI.js","assets/meshVertexSpaceUtils-BFWpJFSd.js","assets/MeshLocalVertexSpace-Cltwu1Kq.js","assets/vec3-CjYmIfaa.js","assets/External-DC51KyR4.js","assets/infoFor3D-DsOdlPuA.js","assets/editingSupport-DWTRjmy9.js","assets/EditBusLayer-SG7oYwiY.js","assets/clientSideDefaults-CgRgH99f.js","assets/QueryEngineCapabilities-CTDe3LlQ.js","assets/defaultsJSON-CHAaurhX.js","assets/QueryTask-CjHwD7wL.js","assets/executeForIds-BjeEaIen.js","assets/query-BM8R3sQ6.js","assets/pbfQueryUtils-CLRSFGBm.js","assets/pbf-D9QZb8S8.js","assets/OptimizedGeometry-CQuTPb9g.js","assets/OptimizedFeatureSet-Blu9Ckm7.js","assets/queryZScale-DN4aFXYn.js","assets/executeQueryJSON-DngjHRnE.js","assets/FeatureSet-CYJUZgOk.js","assets/executeQueryPBF-BYY2Ipuh.js","assets/featureConversionUtils-CmP9mw0r.js","assets/featureLayerUtils-BhDaw8pS.js","assets/jsonUtils-BseLl1fZ.js","assets/UniqueValueRenderer-BlkUix3g.js","assets/ColorStop-44hBlQ14.js","assets/diffUtils-B4YFa5Ju.js","assets/colorRamps-BJydlf0f.js","assets/sizeVariableUtils-Cmcuvw-4.js","assets/visualVariableUtils-z2k12BH8.js","assets/jsonUtils-qYmXvGJ1.js","assets/styleUtils-CnV_Xzhi.js","assets/Version-Bd0QsIQ5.js","assets/FieldsIndex-CLgRNeJ_.js","assets/UnknownTimeZone-DF0BqWCR.js","assets/OverrideHelper-B4ryGWZb.js","assets/utils-p-5Bbga5.js","assets/quantizationUtils-CUjGHrU3.js","assets/heatmapUtils-Clt5rJzr.js","assets/AttachmentQuery-D61mmWw4.js","assets/RelationshipQuery-DDK72Kwc.js","assets/editsZScale-CQCGPEjO.js"] + __vite__mapDeps.viteFileDeps = ["assets/featureLayerUtils-D4E7zCBj.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css","assets/originUtils-D69mHv66.js","assets/multiOriginJSONSupportUtils-C0wm8_Yw.js","assets/utils-iOpWi7jV.js","assets/saveAPIKeyUtils-YRBbgdzi.js","assets/saveUtils-CGGzyvzv.js","assets/fetchService-Crgml5qT.js","assets/lazyLayerLoader-Cu0XtDD2.js","assets/FeatureLayerSource-3cjHhwgM.js","assets/meshVertexSpaceUtils-DwMoblqo.js","assets/MeshLocalVertexSpace-DRvwbFTJ.js","assets/vec3-DdRUbala.js","assets/External-DIoD7Bb4.js","assets/infoFor3D-DsOdlPuA.js","assets/editingSupport-4MwIplWk.js","assets/EditBusLayer-OslMX9fF.js","assets/clientSideDefaults-BQP5n3lX.js","assets/QueryEngineCapabilities-CTDe3LlQ.js","assets/defaultsJSON-CHAaurhX.js","assets/QueryTask-Cl66pG_V.js","assets/executeForIds-CZ3M8IZd.js","assets/query-Bk_ITqRK.js","assets/pbfQueryUtils-CSeFSIjv.js","assets/pbf-Du8sFEWo.js","assets/OptimizedGeometry-CQuTPb9g.js","assets/OptimizedFeatureSet-Blu9Ckm7.js","assets/queryZScale-Dwvn5BlQ.js","assets/executeQueryJSON-COxi_Fac.js","assets/FeatureSet-opEn8ou8.js","assets/executeQueryPBF-DROgTCuZ.js","assets/featureConversionUtils-BHhm7bvm.js","assets/featureLayerUtils-lwqyOSrl.js","assets/jsonUtils-Dw332y6z.js","assets/UniqueValueRenderer-7V9Bhr-D.js","assets/ColorStop-DCGjAKLC.js","assets/diffUtils-uUoMDFQS.js","assets/colorRamps-CcakIWlU.js","assets/sizeVariableUtils-Cmcuvw-4.js","assets/visualVariableUtils-BX9G5gNQ.js","assets/jsonUtils-Ox5U0P0F.js","assets/styleUtils-DOUOskVZ.js","assets/Version-Dqq_CHBG.js","assets/FieldsIndex-CK-0B5n9.js","assets/UnknownTimeZone-CK7VjgF3.js","assets/OverrideHelper-DxFZBnGL.js","assets/utils-CuXO_Zzq.js","assets/quantizationUtils-CfV316jZ.js","assets/heatmapUtils-BSteZBTj.js","assets/AttachmentQuery-DmEAIZff.js","assets/RelationshipQuery-BDJrOxaX.js","assets/editsZScale-Bfe6gH1b.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{fw as z,hk as U,N as f,aE as H,aB as B,ec as K,E as X,s as T,fM as L,d as o,hl as Y,j as R,aT as ee,y as n,f as E,V as C,a7 as te,bP as ie,bQ as re,dM as se,dp as oe,dq as ae,dr as ne,dO as le,dN as ue,b4 as pe,aS as de,k as ye,ay as ce,b1 as I,bW as he,b_ as P,fA as x,fS as me,av as fe,g$ as ge,fy as be,_ as G,n as we,aX as ve,M as _e,b3 as Fe,aZ as y,hm as Se,aQ as Te,aR as $,ds as Ie,fB as Ee,eV as A,aV as D,fT as $e,dt as De,hn as Oe,fD as je,i as Me,fE as Ce,e1 as qe,bT as Le,ho as Re}from"./index-CEWggaxV.js";import"./UniqueValueRenderer-BlkUix3g.js";import{o as Pe,a as xe,u as Ge}from"./jsonUtils-BseLl1fZ.js";import{y as Ae}from"./FormTemplate-eV18QveB.js";import{i as Ne}from"./editsZScale-CQCGPEjO.js";import{t as N}from"./queryZScale-DN4aFXYn.js";import{d as k}from"./FeatureSet-CYJUZgOk.js";import{F as Je}from"./EditBusLayer-SG7oYwiY.js";import{p as Ve}from"./FeatureEffectLayer-CLTrRFqx.js";import{D as ke}from"./FeatureLayerBase-DPJuwFpX.js";import{c as Qe}from"./FeatureReductionLayer-DncGsNIN.js";import{c as We}from"./OrderedLayer-Do089KpQ.js";import{f as Ze}from"./RefreshableLayer-1EkEhJeI.js";import{f as ze}from"./TemporalLayer-qq3v_i3q.js";import{Q as Ue,T as He,R as Be,M as Ke,D as Xe,m as Ye,w as et,b as tt,g as it,x as rt,j as st,I as ot,q as at,F as nt,A as lt,O as ut,P as pt,E as dt,S as yt,f as J}from"./featureLayerUtils-BhDaw8pS.js";import{p as Q}from"./FeatureTemplate-DcprAdTM.js";import{n as W}from"./FeatureType-By3BEr9z.js";import{s as ct}from"./fieldProperties-DMs4wT6-.js";import{C as ht}from"./LabelClass-6cZokw8y.js";import{i as O}from"./labelingInfo-CijajRsc.js";import{a as mt}from"./serviceCapabilitiesUtils-t8SL4e_j.js";import{d as ft}from"./TimeInfo-3TVmpFSA.js";import{e as gt}from"./versionUtils-CaceEUVY.js";import{t as bt}from"./styleUtils-B_Iy1DTk.js";import{S as _}from"./TopFeaturesQuery-B8kC7n5h.js";import{p as wt}from"./popupUtils-DAFYyAvw.js";import{A as F}from"./interfaces-CL2NbQte.js";import"./ColorStop-44hBlQ14.js";import"./diffUtils-B4YFa5Ju.js";import"./colorRamps-BJydlf0f.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-z2k12BH8.js";import"./jsonUtils-qYmXvGJ1.js";import"./styleUtils-CnV_Xzhi.js";import"./Version-Bd0QsIQ5.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./OverrideHelper-B4ryGWZb.js";import"./utils-p-5Bbga5.js";import"./quantizationUtils-CUjGHrU3.js";import"./heatmapUtils-Clt5rJzr.js";import"./FeatureEffect-ByrbZlne.js";import"./LayerFloorInfo-Cdq3ulNh.js";import"./FeatureReductionSelection-BY3KVXac.js";import"./MD5-C9MwAd2G.js";import"./OrderByInfo-DKzv2-WS.js";import"./AttachmentQuery-D61mmWw4.js";import"./RelationshipQuery-DDK72Kwc.js";import"./labelUtils-Dnqx6jl5.js";import"./defaultsJSON-CHAaurhX.js";let vt=0,g=class extends z.LoadableMixin(U(C)){constructor(e){super(e),this._idToClientGraphic=null,this.type="memory"}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){var e;(e=this._connection)==null||e.close(),this._connection=null}get _workerGeometryType(){var t;const e=(t=this.layer)==null?void 0:t.geometryType;return e?this._geometryTypeRequiresClientGraphicMapping(e)?"polygon":e:null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}async queryFeatures(e,t={}){await this.load(t);const i=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);N(e,this.layer.spatialReference,i);const r=k.fromJSON(i);if(!this._requiresClientGraphicMapping())return r;const s=this.layer.objectIdField;for(const l of r.features){const u=l.attributes[s],c=this._idToClientGraphic.get(u);c&&(l.geometry=c.geometry)}return r.geometryType=this.layer.geometryType,r}async queryFeaturesJSON(e,t={}){if(this._requiresClientGraphicMapping())throw new f("query-features-json:unsupported","Cannot query in JSON format for client only geometry types (mesh and extent)");await this.load(t);const i=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return N(e,this.layer.spatialReference,i),i}queryFeatureCount(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t))}queryObjectIds(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t))}queryExtent(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t)).then(i=>({count:i.count,extent:H.fromJSON(i.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}async _applyEdits(e){if(!this._connection)throw new f("feature-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField;let i=null;const r=[],s=[];await Promise.all([this._prepareClientMapping(e.addFeatures,null),this._prepareClientMapping(e.updateFeatures,null)]);const l=p=>"objectId"in p&&p.objectId!=null?p.objectId:"attributes"in p&&p.attributes[t]!=null?p.attributes[t]:null;if(e.addFeatures&&(i=this._prepareAddFeatures(e.addFeatures)),e.deleteFeatures)for(const p of e.deleteFeatures){const m=l(p);m!=null&&r.push(m)}const u=e.updateFeatures&&this._idToClientGraphic?new Map:null;if(e.updateFeatures){for(const p of e.updateFeatures)if(s.push(this._serializeFeature(p)),u){const m=l(p);m!=null&&u.set(m,p)}}Ne(i?i.features:null,s,this.layer.spatialReference);const{fullExtent:c,featureEditResults:d}=await this._connection.invoke("applyEdits",{adds:i?i.features:[],updates:s,deletes:r});return this.fullExtent=c,i&&i.finish(d.uidToObjectId),this._updateClientGraphicIds(u,d),this._createEditsResult(d)}async _prepareClientMapping(e,t){if(this._layerOrSourceGeometryType!=="mesh"||e==null)return;const i=[];for(const{geometry:r}of e)r==null||r.type!=="mesh"||r.hasExtent||r.loaded||i.push(r.load({signal:t}));i.length&&await Promise.all(i)}_updateClientGraphicIds(e,t){if(this._idToClientGraphic){if(e)for(const i of t.updateResults){if(!i.success)continue;const r=e.get(i.objectId);r!=null&&this._addIdToClientGraphic(r)}for(const i of t.deleteResults)i.success&&this._idToClientGraphic.delete(i.objectId)}}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=e.success===!0?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new f("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}_prepareAddFeatures(e){const t=new Map,i=new Array(e.length);let r=null;for(let l=0;l{T.getLogger(this).error("Source modifications will not propagate after layer has been loaded. Please use .applyEdits() instead"),w.preventDefault()}));const m={features:p.features,fields:t==null?void 0:t.map(w=>w.toJSON()),geometryType:L.toJSON(this._workerGeometryType),hasM:this._layerOrSourceGeometryType!=="mesh"&&s,hasZ:this._layerOrSourceGeometryType==="mesh"||l,objectIdField:r,spatialReference:d?null:i&&i.toJSON(),timeInfo:(u==null?void 0:u.toJSON())??null,dateFieldsTimeZone:c},b=await this._connection.invoke("load",m,{signal:e});for(const w of b.warnings)T.getLogger(this.layer).warn("#load()",`${w.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:w});b.featureErrors.length&&T.getLogger(this.layer).warn("#load()",`Encountered ${b.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{errors:b.featureErrors});const q=b.layerDefinition;this._geometryTypeRequiresClientGraphicMapping(p.inferredGeometryType)&&(q.geometryType=L.toJSON(p.inferredGeometryType)),this.sourceJSON=q,this._requiresClientGraphicMapping()&&(this._idToClientGraphic=new Map),p.finish(b.assignedObjectIds)}};o([Y({Type:R,ensureType:ee(R)})],g.prototype,"itemType",void 0),o([n()],g.prototype,"type",void 0),o([n({constructOnly:!0})],g.prototype,"layer",void 0),o([n({readOnly:!0})],g.prototype,"_workerGeometryType",null),o([n()],g.prototype,"sourceJSON",void 0),g=o([E("esri.layers.graphics.sources.MemorySource")],g);let v=class extends te{constructor(){super(...arguments),this.updating=!1,this.status="unknown"}};o([n()],v.prototype,"updating",void 0),o([n()],v.prototype,"status",void 0),v=o([E("esri.layers.support.PublishingInfo")],v);const _t=v,Z="esri.layers.mixins.PublishableLayer",Ft=Symbol(Z),St=e=>{var t;let i=class extends e{constructor(){super(...arguments),this[t]=!0}get publishingInfo(){if(this.destroyed)return null;const r=this._get("publishingInfo");if(r)return r;const s=new _t;return this._checkPublishingStatus(s),s}_checkPublishingStatus(r){let u=0;const c=async p=>{let m;r.updating=!0;try{m=await this.fetchPublishingStatus()}catch{m="unavailable"}m!=="published"&&m!=="unavailable"||(r.status==="publishing"&&this.refresh(),d.remove()),r.status=m,r.updating=!1,d.removed||(u=setTimeout(c,p,p+125))},d={removed:!1,remove(){this.removed=!0,clearTimeout(u)}};this.when().catch(()=>d.remove()),c(250),this.addHandles(d)}};return t=Ft,o([n({readOnly:!0,clonable:!1})],i.prototype,"publishingInfo",null),i=o([E(Z)],i),i},h="FeatureLayer";function S(e,t){return new f("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function V(e){return e&&e instanceof C}const j=ct();function M(e,t,i){const r=!!(i!=null&&i.writeLayerSchema);return{enabled:r,ignoreOrigin:r}}let a=class extends ke(Qe(Ve(St(Je(ie(We(ze(re(Ze(se(oe(ae(ne(le(ue(pe(Le))))))))))))))))){constructor(...e){super(...e),this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=de.WGS84,this.subtypeCode=null,this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=ye(async(t,i,r)=>{const{save:s,saveAs:l}=await G(()=>import("./featureLayerUtils-SShyxaG9.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));switch(t){case F.SAVE:return s(this,i);case F.SAVE_AS:return l(this,r,i)}})}destroy(){var e;(e=this.source)==null||e.destroy()}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){var r;const t=e!=null?e.signal:null;if((r=this.portalItem)!=null&&r.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(s=>this.initLayerProperties(s))),Promise.resolve(this);const i=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(ce).then(async()=>{if(this.url&&this.layerId==null&&/FeatureServer|MapServer\/*$/i.test(this.url)){const s=await this._fetchFirstValidLayerId(t);s!=null&&(this.layerId=s)}if(!this.url&&!this._hasMemorySource())throw new f("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>Ue(this,"load",e));return this.addResolvingPromise(i),Promise.resolve(this)}readCapabilities(e,t){return t=t.layerDefinition||t,mt(t,this.url)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){var e;return!(this.loaded&&!((e=this.capabilities)!=null&&e.operations.supportsEditing))&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,i){return this._readEditingEnabled(t,!0,i)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,i,r){this._writeEditingEnabled(e,t,!0,r)}get effectiveEditingEnabled(){return He(this)}readIsTable(e,t){return(t=(t==null?void 0:t.layerDefinition)??t).type==="Table"||!t.geometryType}writeIsTable(e,t,i,r){r!=null&&r.writeLayerSchema&&I(i,e?"Table":"Feature Layer",t)}readGlobalIdField(e,t){return Be(t.layerDefinition||t)}readObjectIdField(e,t){return Ke(t.layerDefinition||t)}get parsedUrl(){const e=he(this.url);return e!=null&&(this.dynamicDataSource!=null?e.path=P(e.path,"dynamicLayer"):this.layerId!=null&&(e.path=P(e.path,this.layerId.toString()))),e}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){x(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,i){var s;t=t.layerDefinition||t;const r=(s=t.drawingInfo)==null?void 0:s.renderer;if(r){const l=Pe(r,t,i)??void 0;return l||T.getLogger(this).error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:i}),l}return Xe(t,i)}set source(e){const t=this._get("source");t!==e&&(V(t)&&this._resetMemorySource(t),V(e)&&this._initMemorySource(e),this._set("source",e))}castSource(e){return e?Array.isArray(e)||e instanceof C?new g({layer:this,items:e}):e:null}readSource(e,t){const i=k.fromJSON(t.featureSet);return new g({layer:this,items:(i==null?void 0:i.features)??[]})}readTemplates(e,t){const i=t.editFieldsInfo,r=i==null?void 0:i.creatorField,s=i==null?void 0:i.editorField;return e=e==null?void 0:e.map(l=>Q.fromJSON(l)),this._fixTemplates(e,r),this._fixTemplates(e,s),e}readTitle(e,t){var s,l,u;const i=((s=t.layerDefinition)==null?void 0:s.name)??t.name,r=t.title||((l=t.layerDefinition)==null?void 0:l.title);if(i){const c=(u=this.portalItem)==null?void 0:u.title;if(this.sublayerTitleMode==="item-title")return this.url?me(this.url,i):i;let d=i;if(!d&&this.url){const p=fe(this.url);p!=null&&(d=p.title)}return d?(this.sublayerTitleMode==="item-title-and-service-name"&&c&&c!==d&&(d=c+" - "+d),ge(d)):void 0}if(this.sublayerTitleMode==="item-title"&&r)return r}readTitleFromWebMap(e,t){var i;return t.title||((i=t.layerDefinition)==null?void 0:i.name)}readTypeIdField(e,t){let i=(t=t.layerDefinition||t).typeIdField;if(i&&t.fields){i=i.toLowerCase();const r=t.fields.find(s=>s.name.toLowerCase()===i);r&&(i=r.name)}return i}readTypes(e,t){e=(t=t.layerDefinition||t).types;const i=t.editFieldsInfo,r=i==null?void 0:i.creatorField,s=i==null?void 0:i.editorField;return e==null?void 0:e.map(l=>(l=W.fromJSON(l),this._fixTemplates(l.templates,r),this._fixTemplates(l.templates,s),l))}readVisible(e,t){var i;return((i=t.layerDefinition)==null?void 0:i.defaultVisibility)!=null?!!t.layerDefinition.defaultVisibility:t.visibility!=null?!!t.visibility:void 0}async addAttachment(e,t){return Ye(this,e,t,h)}async updateAttachment(e,t,i){return et(this,e,t,i,h)}async applyEdits(e,t){return tt(this,e,t)}async uploadAssets(e,t){return it(this,e,t)}on(e,t){return super.on(e,t)}createPopupTemplate(e){return wt(this,e)}async createGraphicsSource(e){if(this._hasMemorySource()&&this.source)return this.source.load({signal:e});const{default:t}=await be(G(()=>import("./FeatureLayerSource-BeuGtrZI.js"),__vite__mapDeps([10,1,2,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52])),e);return new t({layer:this}).load({signal:e})}createQuery(){const e=rt(this);e.dynamicDataSource=this.dynamicDataSource;const t=this.subtypeCode!=null?`${this.subtypeField} = ${this.subtypeCode}`:null,i=we(this.definitionExpression,t);return e.where=i||"1=1",e}async deleteAttachments(e,t){return st(this,e,t,h)}async fetchRecomputedExtents(e){return ot(this,e,h)}getFeatureType(e){const{typeIdField:t,types:i}=this;if(!t||!e)return null;const r=e.attributes?e.attributes[t]:void 0;if(r==null)return null;let s=null;return i==null||i.some(l=>{const{id:u}=l;return u!=null&&(u.toString()===r.toString()&&(s=l),!!s)}),s}getFieldDomain(e,t){const i=t==null?void 0:t.feature,r=this.getFeatureType(i);if(r){const s=r.domains&&r.domains[e];if(s&&s.type!=="inherited")return s}return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}async queryAttachments(e,t){return at(this,e,t,h)}async queryFeatures(e,t){const i=await this.load(),r=await i.source.queryFeatures(ve.from(e)??i.createQuery(),t);if(r!=null&&r.features)for(const s of r.features)s.layer=s.sourceLayer=i;return r}async queryObjectIds(e,t){return nt(this,e,t,h)}async queryFeatureCount(e,t){return lt(this,e,t,h)}async queryExtent(e,t){return ut(this,e,t,h)}async queryRelatedFeatures(e,t){return pt(this,e,t,h)}async queryRelatedFeaturesCount(e,t){return dt(this,e,t,h)}async queryTopFeatures(e,t){var l;const{source:i,capabilities:r}=await this.load();if(!i.queryTopFeatures||!((l=r==null?void 0:r.query)!=null&&l.supportsTopFeaturesQuery))throw new f(h,"Layer source does not support queryTopFeatures capability");const s=await i.queryTopFeatures(_.from(e),t);if(s!=null&&s.features)for(const u of s.features)u.layer=u.sourceLayer=this;return s}async queryTopObjectIds(e,t){const{source:i,capabilities:r}=await this.load();if(!i.queryTopObjectIds||!(r!=null&&r.query.supportsTopFeaturesQuery))throw new f(h,"Layer source does not support queryTopObjectIds capability");return i.queryTopObjectIds(_.from(e),t)}async queryTopFeaturesExtent(e,t){var s;const{source:i,capabilities:r}=await this.load();if(!i.queryTopExtents||!((s=r==null?void 0:r.query)!=null&&s.supportsTopFeaturesQuery))throw new f(h,"Layer source does not support queryTopExtents capability");return i.queryTopExtents(_.from(e),t)}async queryTopFeatureCount(e,t){var s;const{source:i,capabilities:r}=await this.load();if(!i.queryTopCount||!((s=r==null?void 0:r.query)!=null&&s.supportsTopFeaturesQuery))throw new f(h,"Layer source does not support queryFeatureCount capability");return i.queryTopCount(_.from(e),t)}read(e,t){const i=e.featureCollection;if((i||e.type==="Feature Collection")&&(this.resourceInfo=e),i){const r=i.layers;r&&r.length===1&&(super.read(r[0],t),i.showLegend!=null&&super.read({showLegend:i.showLegend},t))}super.read(e,t),t&&t.origin==="service"&&(this.revert(["objectIdField","fields","timeInfo","dateFieldsTimeZone"],"service"),this.spatialReference||this.revert(["spatialReference"],"service"))}write(e,t){t={...t,origin:(t==null?void 0:t.origin)??void 0,writeLayerSchema:(t==null?void 0:t.writeLayerSchema)??this._hasMemorySource()};const{origin:i,layerContainerType:r,messages:s}=t;if(this.dynamicDataSource)return s==null||s.push(S(this,"using a dynamic data source cannot be written to web scenes, web maps and feature service items")),null;if(this.isTable){if((i==="web-map"||i==="web-scene")&&r!=="tables")return s==null||s.push(S(this,`a table source can only be written to tables, not ${r}`)),null;if(this._hasMemorySource())return s==null||s.push(S(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&(i==="web-map"||i==="web-scene")&&r==="tables")return s==null||s.push(S(this,"using a non-table source cannot be written to tables in web maps or web scenes")),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new f(h,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){var t;return!!this.loaded&&(((t=this.source)==null?void 0:t.type)==="memory"||gt(this,e))}async save(e){return this._debouncedSaveOperations(F.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(F.SAVE_AS,t,e)}_readEditingEnabled(e,t,i){var s;let r=(s=e.layerDefinition)==null?void 0:s.capabilities;return r?this._hasEditingCapability(r):(r=e.capabilities,t&&(i==null?void 0:i.origin)==="web-map"&&!this._hasMemorySource()&&r?this._hasEditingCapability(r):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(t=>t.trim()).includes("editing")}_writeEditingEnabled(e,t,i,r){var s,l;if(!e){const u=(l=(s=this.capabilities)==null?void 0:s.operations)!=null&&l.supportsSync?"Query,Sync":"Query";I("layerDefinition.capabilities",u,t),i&&!(r!=null&&r.writeLayerSchema)&&(t.capabilities=u)}}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}_fetchFirstValidLayerId(e){return _e(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(t=>{const i=t.data;if(i)return this.findFirstValidLayerId(i)})}async initLayerProperties(e){var t;return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:(t=this.portalItem)==null?void 0:t.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),x(this.renderer,this.fieldsIndex),Fe(this.timeInfo,this.fieldsIndex),bt(this,{origin:"service"})}async hasDataChanged(){return yt(this)}async fetchPublishingStatus(){const e=this.source;return e!=null&&e.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){var t,i;const e=((t=this.parsedUrl)==null?void 0:t.path)??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||e.search(/\/FeatureServer\//i)!==-1||(i=this.fields)!=null&&i.some(r=>r.type==="geometry")||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach(i=>{var s;const r=(s=i.prototype)==null?void 0:s.attributes;r&&t&&delete r[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new f("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new f("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(t=>{t.layer=this,t.sourceLayer=this}),this.addHandles([e.on("after-add",t=>{t.item.layer=this,t.item.sourceLayer=this}),e.on("after-remove",t=>{t.item.layer=null,t.item.sourceLayer=null})],"fl-source")}_resetMemorySource(e){e.forEach(t=>{t.layer=null,t.sourceLayer=null}),this.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){return Array.isArray(e.layers)&&e.layers.length>0?e.layers[0].id:Array.isArray(e.tables)&&e.tables.length>0?e.tables[0].id:void 0}};o([y("service","capabilities")],a.prototype,"readCapabilities",null),o([n({json:{origins:{"web-scene":{write:!1}},write:!0}})],a.prototype,"charts",void 0),o([n({readOnly:!0})],a.prototype,"createQueryVersion",null),o([n({json:{read:{source:"layerDefinition.copyrightText"}}})],a.prototype,"copyright",void 0),o([n({json:{read:{source:"layerDefinition.displayField"}}})],a.prototype,"displayField",void 0),o([n({types:Se,readOnly:!0})],a.prototype,"defaultSymbol",void 0),o([n({type:Te})],a.prototype,"dynamicDataSource",void 0),o([n({type:Boolean})],a.prototype,"editingEnabled",null),o([y(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],a.prototype,"readEditingEnabled",null),o([y("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],a.prototype,"readEditingEnabledFromWebMap",null),o([$(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],a.prototype,"writeEditingEnabled",null),o([$("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],a.prototype,"writeEditingEnabledToWebMap",null),o([n({readOnly:!0})],a.prototype,"effectiveEditingEnabled",null),o([n({...j.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:M}}}}})],a.prototype,"fields",void 0),o([n(j.fieldsIndex)],a.prototype,"fieldsIndex",void 0),o([n({type:Ae,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],a.prototype,"formTemplate",void 0),o([n({json:{read:{source:"layerDefinition.extent"}}})],a.prototype,"fullExtent",void 0),o([n({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:M,writer(e,t,i){const r=e?J.toJSON(e):null;r&&I(i,r,t)}}}},read:{source:"layerDefinition.geometryType",reader:J.read}}})],a.prototype,"geometryType",void 0),o([n({json:{read:{source:"layerDefinition.hasM"}}})],a.prototype,"hasM",void 0),o([n({json:{read:{source:"layerDefinition.hasZ"}}})],a.prototype,"hasZ",void 0),o([n(Ie)],a.prototype,"id",void 0),o([n({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],a.prototype,"infoFor3D",void 0),o([n({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],a.prototype,"isTable",void 0),o([y("service","isTable",["type","geometryType"]),y("isTable",["layerDefinition.type","layerDefinition.geometryType"])],a.prototype,"readIsTable",null),o([$("web-map","isTable")],a.prototype,"writeIsTable",null),o([n(Ee)],a.prototype,"labelsVisible",void 0),o([n({type:[ht],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:O,write:!1},"web-scene":{name:"layerDefinition.drawingInfo.labelingInfo",read:O,write:{enabled:!0,layerContainerTypes:A}}},name:"layerDefinition.drawingInfo.labelingInfo",read:O,write:!0}})],a.prototype,"labelingInfo",void 0),o([n((()=>{const e=D($e);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(t,i,r){I(r,Re(t),i)}}},e})())],a.prototype,"opacity",void 0),o([n(De)],a.prototype,"legendEnabled",void 0),o([n({type:["show","hide"],json:(()=>{const e=D(Oe.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],a.prototype,"listMode",void 0),o([y("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],a.prototype,"readGlobalIdField",null),o([n({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:M}}}}})],a.prototype,"objectIdField",void 0),o([y("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],a.prototype,"readObjectIdField",null),o([n({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],a.prototype,"operationalLayerType",void 0),o([n(j.outFields)],a.prototype,"outFields",void 0),o([n({readOnly:!0})],a.prototype,"parsedUrl",null),o([n({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],a.prototype,"path",void 0),o([n(je)],a.prototype,"popupEnabled",void 0),o([n({type:Me,json:{name:"popupInfo",write:!0}})],a.prototype,"popupTemplate",void 0),o([n({readOnly:!0})],a.prototype,"defaultPopupTemplate",null),o([n({types:xe,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:Ge,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:A,overridePolicy:(e,t,i)=>({ignoreOrigin:i==null?void 0:i.writeLayerSchema})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,i)=>({ignoreOrigin:i==null?void 0:i.writeLayerSchema})}}})],a.prototype,"renderer",null),o([y("service","renderer",["drawingInfo.renderer","defaultSymbol"]),y("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],a.prototype,"readRenderer",null),o([n()],a.prototype,"resourceInfo",void 0),o([n((()=>{const e=D(Ce);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],a.prototype,"screenSizePerspectiveEnabled",void 0),o([n({clonable:!1})],a.prototype,"source",null),o([qe("source")],a.prototype,"castSource",null),o([y("portal-item","source",["featureSet"]),y("web-map","source",["featureSet"])],a.prototype,"readSource",null),o([n({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],a.prototype,"spatialReference",void 0),o([n({type:Number})],a.prototype,"subtypeCode",void 0),o([n({type:[Q]})],a.prototype,"templates",void 0),o([y("templates",["editFieldsInfo","creatorField","editorField","templates"])],a.prototype,"readTemplates",null),o([n({type:ft})],a.prototype,"timeInfo",void 0),o([n()],a.prototype,"title",void 0),o([y("service","title",["name"]),y("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],a.prototype,"readTitle",null),o([y("web-map","title",["layerDefinition.name","title"])],a.prototype,"readTitleFromWebMap",null),o([n({type:String})],a.prototype,"sublayerTitleMode",void 0),o([n({json:{read:!1}})],a.prototype,"type",void 0),o([n({type:String})],a.prototype,"typeIdField",void 0),o([y("service","typeIdField"),y("typeIdField",["layerDefinition.typeIdField"])],a.prototype,"readTypeIdField",null),o([n({type:[W]})],a.prototype,"types",void 0),o([y("service","types",["types"]),y("types",["layerDefinition.types"])],a.prototype,"readTypes",null),o([n({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility"}}}}})],a.prototype,"visible",void 0),o([y("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],a.prototype,"readVisible",null),a=o([E("esri.layers.FeatureLayer")],a);const vi=a;export{vi as default}; +import{fw as z,hk as U,N as f,aE as H,aB as B,ec as K,E as X,s as T,fM as L,d as o,hl as Y,j as R,aT as ee,y as n,f as E,V as C,a7 as te,bP as ie,bQ as re,dM as se,dp as oe,dq as ae,dr as ne,dO as le,dN as ue,b4 as pe,aS as de,k as ye,ay as ce,b1 as I,bW as he,b_ as P,fA as x,fS as me,av as fe,g$ as ge,fy as be,_ as G,n as we,aX as ve,M as _e,b3 as Fe,aZ as y,hm as Se,aQ as Te,aR as $,ds as Ie,fB as Ee,eV as A,aV as D,fT as $e,dt as De,hn as Oe,fD as je,i as Me,fE as Ce,e1 as qe,bT as Le,ho as Re}from"./index-BjUNJPVf.js";import"./UniqueValueRenderer-7V9Bhr-D.js";import{o as Pe,a as xe,u as Ge}from"./jsonUtils-Dw332y6z.js";import{y as Ae}from"./FormTemplate-BGxtsGX6.js";import{i as Ne}from"./editsZScale-Bfe6gH1b.js";import{t as N}from"./queryZScale-Dwvn5BlQ.js";import{d as k}from"./FeatureSet-opEn8ou8.js";import{F as Je}from"./EditBusLayer-OslMX9fF.js";import{p as Ve}from"./FeatureEffectLayer-DarO4Ctx.js";import{D as ke}from"./FeatureLayerBase-D0I-Escx.js";import{c as Qe}from"./FeatureReductionLayer-CK-tyM-9.js";import{c as We}from"./OrderedLayer-dLoPhxcx.js";import{f as Ze}from"./RefreshableLayer-_r2TPtol.js";import{f as ze}from"./TemporalLayer-CKICYnEl.js";import{Q as Ue,T as He,R as Be,M as Ke,D as Xe,m as Ye,w as et,b as tt,g as it,x as rt,j as st,I as ot,q as at,F as nt,A as lt,O as ut,P as pt,E as dt,S as yt,f as J}from"./featureLayerUtils-lwqyOSrl.js";import{p as Q}from"./FeatureTemplate-FZNGA_Ik.js";import{n as W}from"./FeatureType-CwUl8Nf5.js";import{s as ct}from"./fieldProperties-DnrQXLBM.js";import{C as ht}from"./LabelClass-CeatfK8u.js";import{i as O}from"./labelingInfo-DqAUis6e.js";import{a as mt}from"./serviceCapabilitiesUtils-DiP90Uds.js";import{d as ft}from"./TimeInfo-DooETFWC.js";import{e as gt}from"./versionUtils-BIAEZzrm.js";import{t as bt}from"./styleUtils--I7zqeL6.js";import{S as _}from"./TopFeaturesQuery-CVQjqlfM.js";import{p as wt}from"./popupUtils-DlZin22m.js";import{A as F}from"./interfaces-CL2NbQte.js";import"./ColorStop-DCGjAKLC.js";import"./diffUtils-uUoMDFQS.js";import"./colorRamps-CcakIWlU.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-BX9G5gNQ.js";import"./jsonUtils-Ox5U0P0F.js";import"./styleUtils-DOUOskVZ.js";import"./Version-Dqq_CHBG.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./OverrideHelper-DxFZBnGL.js";import"./utils-CuXO_Zzq.js";import"./quantizationUtils-CfV316jZ.js";import"./heatmapUtils-BSteZBTj.js";import"./FeatureEffect-DBbkrS6j.js";import"./LayerFloorInfo-DlYNbO-A.js";import"./FeatureReductionSelection-t3T7oa8H.js";import"./MD5-C9MwAd2G.js";import"./OrderByInfo-DKyk5GLW.js";import"./AttachmentQuery-DmEAIZff.js";import"./RelationshipQuery-BDJrOxaX.js";import"./labelUtils-3p0-m-Ee.js";import"./defaultsJSON-CHAaurhX.js";let vt=0,g=class extends z.LoadableMixin(U(C)){constructor(e){super(e),this._idToClientGraphic=null,this.type="memory"}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){var e;(e=this._connection)==null||e.close(),this._connection=null}get _workerGeometryType(){var t;const e=(t=this.layer)==null?void 0:t.geometryType;return e?this._geometryTypeRequiresClientGraphicMapping(e)?"polygon":e:null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}async queryFeatures(e,t={}){await this.load(t);const i=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);N(e,this.layer.spatialReference,i);const r=k.fromJSON(i);if(!this._requiresClientGraphicMapping())return r;const s=this.layer.objectIdField;for(const l of r.features){const u=l.attributes[s],c=this._idToClientGraphic.get(u);c&&(l.geometry=c.geometry)}return r.geometryType=this.layer.geometryType,r}async queryFeaturesJSON(e,t={}){if(this._requiresClientGraphicMapping())throw new f("query-features-json:unsupported","Cannot query in JSON format for client only geometry types (mesh and extent)");await this.load(t);const i=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return N(e,this.layer.spatialReference,i),i}queryFeatureCount(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t))}queryObjectIds(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t))}queryExtent(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t)).then(i=>({count:i.count,extent:H.fromJSON(i.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}async _applyEdits(e){if(!this._connection)throw new f("feature-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField;let i=null;const r=[],s=[];await Promise.all([this._prepareClientMapping(e.addFeatures,null),this._prepareClientMapping(e.updateFeatures,null)]);const l=p=>"objectId"in p&&p.objectId!=null?p.objectId:"attributes"in p&&p.attributes[t]!=null?p.attributes[t]:null;if(e.addFeatures&&(i=this._prepareAddFeatures(e.addFeatures)),e.deleteFeatures)for(const p of e.deleteFeatures){const m=l(p);m!=null&&r.push(m)}const u=e.updateFeatures&&this._idToClientGraphic?new Map:null;if(e.updateFeatures){for(const p of e.updateFeatures)if(s.push(this._serializeFeature(p)),u){const m=l(p);m!=null&&u.set(m,p)}}Ne(i?i.features:null,s,this.layer.spatialReference);const{fullExtent:c,featureEditResults:d}=await this._connection.invoke("applyEdits",{adds:i?i.features:[],updates:s,deletes:r});return this.fullExtent=c,i&&i.finish(d.uidToObjectId),this._updateClientGraphicIds(u,d),this._createEditsResult(d)}async _prepareClientMapping(e,t){if(this._layerOrSourceGeometryType!=="mesh"||e==null)return;const i=[];for(const{geometry:r}of e)r==null||r.type!=="mesh"||r.hasExtent||r.loaded||i.push(r.load({signal:t}));i.length&&await Promise.all(i)}_updateClientGraphicIds(e,t){if(this._idToClientGraphic){if(e)for(const i of t.updateResults){if(!i.success)continue;const r=e.get(i.objectId);r!=null&&this._addIdToClientGraphic(r)}for(const i of t.deleteResults)i.success&&this._idToClientGraphic.delete(i.objectId)}}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=e.success===!0?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new f("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}_prepareAddFeatures(e){const t=new Map,i=new Array(e.length);let r=null;for(let l=0;l{T.getLogger(this).error("Source modifications will not propagate after layer has been loaded. Please use .applyEdits() instead"),w.preventDefault()}));const m={features:p.features,fields:t==null?void 0:t.map(w=>w.toJSON()),geometryType:L.toJSON(this._workerGeometryType),hasM:this._layerOrSourceGeometryType!=="mesh"&&s,hasZ:this._layerOrSourceGeometryType==="mesh"||l,objectIdField:r,spatialReference:d?null:i&&i.toJSON(),timeInfo:(u==null?void 0:u.toJSON())??null,dateFieldsTimeZone:c},b=await this._connection.invoke("load",m,{signal:e});for(const w of b.warnings)T.getLogger(this.layer).warn("#load()",`${w.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:w});b.featureErrors.length&&T.getLogger(this.layer).warn("#load()",`Encountered ${b.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{errors:b.featureErrors});const q=b.layerDefinition;this._geometryTypeRequiresClientGraphicMapping(p.inferredGeometryType)&&(q.geometryType=L.toJSON(p.inferredGeometryType)),this.sourceJSON=q,this._requiresClientGraphicMapping()&&(this._idToClientGraphic=new Map),p.finish(b.assignedObjectIds)}};o([Y({Type:R,ensureType:ee(R)})],g.prototype,"itemType",void 0),o([n()],g.prototype,"type",void 0),o([n({constructOnly:!0})],g.prototype,"layer",void 0),o([n({readOnly:!0})],g.prototype,"_workerGeometryType",null),o([n()],g.prototype,"sourceJSON",void 0),g=o([E("esri.layers.graphics.sources.MemorySource")],g);let v=class extends te{constructor(){super(...arguments),this.updating=!1,this.status="unknown"}};o([n()],v.prototype,"updating",void 0),o([n()],v.prototype,"status",void 0),v=o([E("esri.layers.support.PublishingInfo")],v);const _t=v,Z="esri.layers.mixins.PublishableLayer",Ft=Symbol(Z),St=e=>{var t;let i=class extends e{constructor(){super(...arguments),this[t]=!0}get publishingInfo(){if(this.destroyed)return null;const r=this._get("publishingInfo");if(r)return r;const s=new _t;return this._checkPublishingStatus(s),s}_checkPublishingStatus(r){let u=0;const c=async p=>{let m;r.updating=!0;try{m=await this.fetchPublishingStatus()}catch{m="unavailable"}m!=="published"&&m!=="unavailable"||(r.status==="publishing"&&this.refresh(),d.remove()),r.status=m,r.updating=!1,d.removed||(u=setTimeout(c,p,p+125))},d={removed:!1,remove(){this.removed=!0,clearTimeout(u)}};this.when().catch(()=>d.remove()),c(250),this.addHandles(d)}};return t=Ft,o([n({readOnly:!0,clonable:!1})],i.prototype,"publishingInfo",null),i=o([E(Z)],i),i},h="FeatureLayer";function S(e,t){return new f("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function V(e){return e&&e instanceof C}const j=ct();function M(e,t,i){const r=!!(i!=null&&i.writeLayerSchema);return{enabled:r,ignoreOrigin:r}}let a=class extends ke(Qe(Ve(St(Je(ie(We(ze(re(Ze(se(oe(ae(ne(le(ue(pe(Le))))))))))))))))){constructor(...e){super(...e),this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=de.WGS84,this.subtypeCode=null,this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=ye(async(t,i,r)=>{const{save:s,saveAs:l}=await G(()=>import("./featureLayerUtils-D4E7zCBj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));switch(t){case F.SAVE:return s(this,i);case F.SAVE_AS:return l(this,r,i)}})}destroy(){var e;(e=this.source)==null||e.destroy()}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){var r;const t=e!=null?e.signal:null;if((r=this.portalItem)!=null&&r.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(s=>this.initLayerProperties(s))),Promise.resolve(this);const i=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(ce).then(async()=>{if(this.url&&this.layerId==null&&/FeatureServer|MapServer\/*$/i.test(this.url)){const s=await this._fetchFirstValidLayerId(t);s!=null&&(this.layerId=s)}if(!this.url&&!this._hasMemorySource())throw new f("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>Ue(this,"load",e));return this.addResolvingPromise(i),Promise.resolve(this)}readCapabilities(e,t){return t=t.layerDefinition||t,mt(t,this.url)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){var e;return!(this.loaded&&!((e=this.capabilities)!=null&&e.operations.supportsEditing))&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,i){return this._readEditingEnabled(t,!0,i)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,i,r){this._writeEditingEnabled(e,t,!0,r)}get effectiveEditingEnabled(){return He(this)}readIsTable(e,t){return(t=(t==null?void 0:t.layerDefinition)??t).type==="Table"||!t.geometryType}writeIsTable(e,t,i,r){r!=null&&r.writeLayerSchema&&I(i,e?"Table":"Feature Layer",t)}readGlobalIdField(e,t){return Be(t.layerDefinition||t)}readObjectIdField(e,t){return Ke(t.layerDefinition||t)}get parsedUrl(){const e=he(this.url);return e!=null&&(this.dynamicDataSource!=null?e.path=P(e.path,"dynamicLayer"):this.layerId!=null&&(e.path=P(e.path,this.layerId.toString()))),e}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){x(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,i){var s;t=t.layerDefinition||t;const r=(s=t.drawingInfo)==null?void 0:s.renderer;if(r){const l=Pe(r,t,i)??void 0;return l||T.getLogger(this).error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:i}),l}return Xe(t,i)}set source(e){const t=this._get("source");t!==e&&(V(t)&&this._resetMemorySource(t),V(e)&&this._initMemorySource(e),this._set("source",e))}castSource(e){return e?Array.isArray(e)||e instanceof C?new g({layer:this,items:e}):e:null}readSource(e,t){const i=k.fromJSON(t.featureSet);return new g({layer:this,items:(i==null?void 0:i.features)??[]})}readTemplates(e,t){const i=t.editFieldsInfo,r=i==null?void 0:i.creatorField,s=i==null?void 0:i.editorField;return e=e==null?void 0:e.map(l=>Q.fromJSON(l)),this._fixTemplates(e,r),this._fixTemplates(e,s),e}readTitle(e,t){var s,l,u;const i=((s=t.layerDefinition)==null?void 0:s.name)??t.name,r=t.title||((l=t.layerDefinition)==null?void 0:l.title);if(i){const c=(u=this.portalItem)==null?void 0:u.title;if(this.sublayerTitleMode==="item-title")return this.url?me(this.url,i):i;let d=i;if(!d&&this.url){const p=fe(this.url);p!=null&&(d=p.title)}return d?(this.sublayerTitleMode==="item-title-and-service-name"&&c&&c!==d&&(d=c+" - "+d),ge(d)):void 0}if(this.sublayerTitleMode==="item-title"&&r)return r}readTitleFromWebMap(e,t){var i;return t.title||((i=t.layerDefinition)==null?void 0:i.name)}readTypeIdField(e,t){let i=(t=t.layerDefinition||t).typeIdField;if(i&&t.fields){i=i.toLowerCase();const r=t.fields.find(s=>s.name.toLowerCase()===i);r&&(i=r.name)}return i}readTypes(e,t){e=(t=t.layerDefinition||t).types;const i=t.editFieldsInfo,r=i==null?void 0:i.creatorField,s=i==null?void 0:i.editorField;return e==null?void 0:e.map(l=>(l=W.fromJSON(l),this._fixTemplates(l.templates,r),this._fixTemplates(l.templates,s),l))}readVisible(e,t){var i;return((i=t.layerDefinition)==null?void 0:i.defaultVisibility)!=null?!!t.layerDefinition.defaultVisibility:t.visibility!=null?!!t.visibility:void 0}async addAttachment(e,t){return Ye(this,e,t,h)}async updateAttachment(e,t,i){return et(this,e,t,i,h)}async applyEdits(e,t){return tt(this,e,t)}async uploadAssets(e,t){return it(this,e,t)}on(e,t){return super.on(e,t)}createPopupTemplate(e){return wt(this,e)}async createGraphicsSource(e){if(this._hasMemorySource()&&this.source)return this.source.load({signal:e});const{default:t}=await be(G(()=>import("./FeatureLayerSource-3cjHhwgM.js"),__vite__mapDeps([10,1,2,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52])),e);return new t({layer:this}).load({signal:e})}createQuery(){const e=rt(this);e.dynamicDataSource=this.dynamicDataSource;const t=this.subtypeCode!=null?`${this.subtypeField} = ${this.subtypeCode}`:null,i=we(this.definitionExpression,t);return e.where=i||"1=1",e}async deleteAttachments(e,t){return st(this,e,t,h)}async fetchRecomputedExtents(e){return ot(this,e,h)}getFeatureType(e){const{typeIdField:t,types:i}=this;if(!t||!e)return null;const r=e.attributes?e.attributes[t]:void 0;if(r==null)return null;let s=null;return i==null||i.some(l=>{const{id:u}=l;return u!=null&&(u.toString()===r.toString()&&(s=l),!!s)}),s}getFieldDomain(e,t){const i=t==null?void 0:t.feature,r=this.getFeatureType(i);if(r){const s=r.domains&&r.domains[e];if(s&&s.type!=="inherited")return s}return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}async queryAttachments(e,t){return at(this,e,t,h)}async queryFeatures(e,t){const i=await this.load(),r=await i.source.queryFeatures(ve.from(e)??i.createQuery(),t);if(r!=null&&r.features)for(const s of r.features)s.layer=s.sourceLayer=i;return r}async queryObjectIds(e,t){return nt(this,e,t,h)}async queryFeatureCount(e,t){return lt(this,e,t,h)}async queryExtent(e,t){return ut(this,e,t,h)}async queryRelatedFeatures(e,t){return pt(this,e,t,h)}async queryRelatedFeaturesCount(e,t){return dt(this,e,t,h)}async queryTopFeatures(e,t){var l;const{source:i,capabilities:r}=await this.load();if(!i.queryTopFeatures||!((l=r==null?void 0:r.query)!=null&&l.supportsTopFeaturesQuery))throw new f(h,"Layer source does not support queryTopFeatures capability");const s=await i.queryTopFeatures(_.from(e),t);if(s!=null&&s.features)for(const u of s.features)u.layer=u.sourceLayer=this;return s}async queryTopObjectIds(e,t){const{source:i,capabilities:r}=await this.load();if(!i.queryTopObjectIds||!(r!=null&&r.query.supportsTopFeaturesQuery))throw new f(h,"Layer source does not support queryTopObjectIds capability");return i.queryTopObjectIds(_.from(e),t)}async queryTopFeaturesExtent(e,t){var s;const{source:i,capabilities:r}=await this.load();if(!i.queryTopExtents||!((s=r==null?void 0:r.query)!=null&&s.supportsTopFeaturesQuery))throw new f(h,"Layer source does not support queryTopExtents capability");return i.queryTopExtents(_.from(e),t)}async queryTopFeatureCount(e,t){var s;const{source:i,capabilities:r}=await this.load();if(!i.queryTopCount||!((s=r==null?void 0:r.query)!=null&&s.supportsTopFeaturesQuery))throw new f(h,"Layer source does not support queryFeatureCount capability");return i.queryTopCount(_.from(e),t)}read(e,t){const i=e.featureCollection;if((i||e.type==="Feature Collection")&&(this.resourceInfo=e),i){const r=i.layers;r&&r.length===1&&(super.read(r[0],t),i.showLegend!=null&&super.read({showLegend:i.showLegend},t))}super.read(e,t),t&&t.origin==="service"&&(this.revert(["objectIdField","fields","timeInfo","dateFieldsTimeZone"],"service"),this.spatialReference||this.revert(["spatialReference"],"service"))}write(e,t){t={...t,origin:(t==null?void 0:t.origin)??void 0,writeLayerSchema:(t==null?void 0:t.writeLayerSchema)??this._hasMemorySource()};const{origin:i,layerContainerType:r,messages:s}=t;if(this.dynamicDataSource)return s==null||s.push(S(this,"using a dynamic data source cannot be written to web scenes, web maps and feature service items")),null;if(this.isTable){if((i==="web-map"||i==="web-scene")&&r!=="tables")return s==null||s.push(S(this,`a table source can only be written to tables, not ${r}`)),null;if(this._hasMemorySource())return s==null||s.push(S(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&(i==="web-map"||i==="web-scene")&&r==="tables")return s==null||s.push(S(this,"using a non-table source cannot be written to tables in web maps or web scenes")),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new f(h,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){var t;return!!this.loaded&&(((t=this.source)==null?void 0:t.type)==="memory"||gt(this,e))}async save(e){return this._debouncedSaveOperations(F.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(F.SAVE_AS,t,e)}_readEditingEnabled(e,t,i){var s;let r=(s=e.layerDefinition)==null?void 0:s.capabilities;return r?this._hasEditingCapability(r):(r=e.capabilities,t&&(i==null?void 0:i.origin)==="web-map"&&!this._hasMemorySource()&&r?this._hasEditingCapability(r):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(t=>t.trim()).includes("editing")}_writeEditingEnabled(e,t,i,r){var s,l;if(!e){const u=(l=(s=this.capabilities)==null?void 0:s.operations)!=null&&l.supportsSync?"Query,Sync":"Query";I("layerDefinition.capabilities",u,t),i&&!(r!=null&&r.writeLayerSchema)&&(t.capabilities=u)}}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}_fetchFirstValidLayerId(e){return _e(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(t=>{const i=t.data;if(i)return this.findFirstValidLayerId(i)})}async initLayerProperties(e){var t;return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:(t=this.portalItem)==null?void 0:t.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),x(this.renderer,this.fieldsIndex),Fe(this.timeInfo,this.fieldsIndex),bt(this,{origin:"service"})}async hasDataChanged(){return yt(this)}async fetchPublishingStatus(){const e=this.source;return e!=null&&e.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){var t,i;const e=((t=this.parsedUrl)==null?void 0:t.path)??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||e.search(/\/FeatureServer\//i)!==-1||(i=this.fields)!=null&&i.some(r=>r.type==="geometry")||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach(i=>{var s;const r=(s=i.prototype)==null?void 0:s.attributes;r&&t&&delete r[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new f("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new f("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(t=>{t.layer=this,t.sourceLayer=this}),this.addHandles([e.on("after-add",t=>{t.item.layer=this,t.item.sourceLayer=this}),e.on("after-remove",t=>{t.item.layer=null,t.item.sourceLayer=null})],"fl-source")}_resetMemorySource(e){e.forEach(t=>{t.layer=null,t.sourceLayer=null}),this.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){return Array.isArray(e.layers)&&e.layers.length>0?e.layers[0].id:Array.isArray(e.tables)&&e.tables.length>0?e.tables[0].id:void 0}};o([y("service","capabilities")],a.prototype,"readCapabilities",null),o([n({json:{origins:{"web-scene":{write:!1}},write:!0}})],a.prototype,"charts",void 0),o([n({readOnly:!0})],a.prototype,"createQueryVersion",null),o([n({json:{read:{source:"layerDefinition.copyrightText"}}})],a.prototype,"copyright",void 0),o([n({json:{read:{source:"layerDefinition.displayField"}}})],a.prototype,"displayField",void 0),o([n({types:Se,readOnly:!0})],a.prototype,"defaultSymbol",void 0),o([n({type:Te})],a.prototype,"dynamicDataSource",void 0),o([n({type:Boolean})],a.prototype,"editingEnabled",null),o([y(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],a.prototype,"readEditingEnabled",null),o([y("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],a.prototype,"readEditingEnabledFromWebMap",null),o([$(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],a.prototype,"writeEditingEnabled",null),o([$("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],a.prototype,"writeEditingEnabledToWebMap",null),o([n({readOnly:!0})],a.prototype,"effectiveEditingEnabled",null),o([n({...j.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:M}}}}})],a.prototype,"fields",void 0),o([n(j.fieldsIndex)],a.prototype,"fieldsIndex",void 0),o([n({type:Ae,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],a.prototype,"formTemplate",void 0),o([n({json:{read:{source:"layerDefinition.extent"}}})],a.prototype,"fullExtent",void 0),o([n({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:M,writer(e,t,i){const r=e?J.toJSON(e):null;r&&I(i,r,t)}}}},read:{source:"layerDefinition.geometryType",reader:J.read}}})],a.prototype,"geometryType",void 0),o([n({json:{read:{source:"layerDefinition.hasM"}}})],a.prototype,"hasM",void 0),o([n({json:{read:{source:"layerDefinition.hasZ"}}})],a.prototype,"hasZ",void 0),o([n(Ie)],a.prototype,"id",void 0),o([n({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],a.prototype,"infoFor3D",void 0),o([n({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],a.prototype,"isTable",void 0),o([y("service","isTable",["type","geometryType"]),y("isTable",["layerDefinition.type","layerDefinition.geometryType"])],a.prototype,"readIsTable",null),o([$("web-map","isTable")],a.prototype,"writeIsTable",null),o([n(Ee)],a.prototype,"labelsVisible",void 0),o([n({type:[ht],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:O,write:!1},"web-scene":{name:"layerDefinition.drawingInfo.labelingInfo",read:O,write:{enabled:!0,layerContainerTypes:A}}},name:"layerDefinition.drawingInfo.labelingInfo",read:O,write:!0}})],a.prototype,"labelingInfo",void 0),o([n((()=>{const e=D($e);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(t,i,r){I(r,Re(t),i)}}},e})())],a.prototype,"opacity",void 0),o([n(De)],a.prototype,"legendEnabled",void 0),o([n({type:["show","hide"],json:(()=>{const e=D(Oe.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],a.prototype,"listMode",void 0),o([y("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],a.prototype,"readGlobalIdField",null),o([n({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:M}}}}})],a.prototype,"objectIdField",void 0),o([y("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],a.prototype,"readObjectIdField",null),o([n({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],a.prototype,"operationalLayerType",void 0),o([n(j.outFields)],a.prototype,"outFields",void 0),o([n({readOnly:!0})],a.prototype,"parsedUrl",null),o([n({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],a.prototype,"path",void 0),o([n(je)],a.prototype,"popupEnabled",void 0),o([n({type:Me,json:{name:"popupInfo",write:!0}})],a.prototype,"popupTemplate",void 0),o([n({readOnly:!0})],a.prototype,"defaultPopupTemplate",null),o([n({types:xe,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:Ge,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:A,overridePolicy:(e,t,i)=>({ignoreOrigin:i==null?void 0:i.writeLayerSchema})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,i)=>({ignoreOrigin:i==null?void 0:i.writeLayerSchema})}}})],a.prototype,"renderer",null),o([y("service","renderer",["drawingInfo.renderer","defaultSymbol"]),y("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],a.prototype,"readRenderer",null),o([n()],a.prototype,"resourceInfo",void 0),o([n((()=>{const e=D(Ce);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],a.prototype,"screenSizePerspectiveEnabled",void 0),o([n({clonable:!1})],a.prototype,"source",null),o([qe("source")],a.prototype,"castSource",null),o([y("portal-item","source",["featureSet"]),y("web-map","source",["featureSet"])],a.prototype,"readSource",null),o([n({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],a.prototype,"spatialReference",void 0),o([n({type:Number})],a.prototype,"subtypeCode",void 0),o([n({type:[Q]})],a.prototype,"templates",void 0),o([y("templates",["editFieldsInfo","creatorField","editorField","templates"])],a.prototype,"readTemplates",null),o([n({type:ft})],a.prototype,"timeInfo",void 0),o([n()],a.prototype,"title",void 0),o([y("service","title",["name"]),y("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],a.prototype,"readTitle",null),o([y("web-map","title",["layerDefinition.name","title"])],a.prototype,"readTitleFromWebMap",null),o([n({type:String})],a.prototype,"sublayerTitleMode",void 0),o([n({json:{read:!1}})],a.prototype,"type",void 0),o([n({type:String})],a.prototype,"typeIdField",void 0),o([y("service","typeIdField"),y("typeIdField",["layerDefinition.typeIdField"])],a.prototype,"readTypeIdField",null),o([n({type:[W]})],a.prototype,"types",void 0),o([y("service","types",["types"]),y("types",["layerDefinition.types"])],a.prototype,"readTypes",null),o([n({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility"}}}}})],a.prototype,"visible",void 0),o([y("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],a.prototype,"readVisible",null),a=o([E("esri.layers.FeatureLayer")],a);const vi=a;export{vi as default}; diff --git a/assets/FeatureLayerBase-DPJuwFpX.js b/assets/FeatureLayerBase-D0I-Escx.js similarity index 98% rename from assets/FeatureLayerBase-DPJuwFpX.js rename to assets/FeatureLayerBase-D0I-Escx.js index c832cba..6a36826 100644 --- a/assets/FeatureLayerBase-DPJuwFpX.js +++ b/assets/FeatureLayerBase-D0I-Escx.js @@ -1 +1 @@ -import{b4 as m,d as e,y as t,dR as g,f as v,aU as f,i1 as x,i2 as T,aY as j,b5 as E,aZ as a,aR as O,aV as F,e8 as R,eV as D,aE as M,g_ as U,V as I,fQ as $,fR as A,aS as b,du as B,h0 as C,s as Q,h1 as V}from"./index-CEWggaxV.js";import{f as k,U as Z,R as G,M as N,C as P}from"./featureLayerUtils-BhDaw8pS.js";import{p as z}from"./LayerFloorInfo-Cdq3ulNh.js";import{a as J}from"./serviceCapabilitiesUtils-t8SL4e_j.js";let u=class extends m(f){constructor(i){super(i),this.creatorField=null,this.creationDateField=null,this.editorField=null,this.editDateField=null,this.realm=null,this.timeZone=null}};e([t()],u.prototype,"creatorField",void 0),e([t()],u.prototype,"creationDateField",void 0),e([t()],u.prototype,"editorField",void 0),e([t()],u.prototype,"editDateField",void 0),e([t()],u.prototype,"realm",void 0),e([t(g("dateFieldsTimeReference",!0))],u.prototype,"timeZone",void 0),u=e([v("esri.layers.support.EditFieldsInfo")],u);const L=u;let d=class extends m(f){constructor(i){super(i)}};e([t({constructOnly:!0,json:{write:!0}})],d.prototype,"name",void 0),e([t({constructOnly:!0,json:{write:!0}})],d.prototype,"fields",void 0),e([t({constructOnly:!0,json:{write:!0}})],d.prototype,"isAscending",void 0),e([t({constructOnly:!0,json:{write:!0}})],d.prototype,"indexType",void 0),e([t({constructOnly:!0,json:{write:!0}})],d.prototype,"isUnique",void 0),e([t({constructOnly:!0,json:{write:!0}})],d.prototype,"description",void 0),d=e([v("esri.layers.support.FeatureIndex")],d);let h=class extends m(f){constructor(i){super(i),this.shapeAreaField=null,this.shapeLengthField=null,this.units=null}};e([t({type:String,json:{read:{source:"shapeAreaFieldName"}}})],h.prototype,"shapeAreaField",void 0),e([t({type:String,json:{read:{source:"shapeLengthFieldName"}}})],h.prototype,"shapeLengthField",void 0),e([t({type:String,json:{read:n=>x.read(n)||T.read(n)}})],h.prototype,"units",void 0),h=e([v("esri.layers.support.GeometryFieldsInfo")],h);const H=h,S=new j({esriRelCardinalityOneToOne:"one-to-one",esriRelCardinalityOneToMany:"one-to-many",esriRelCardinalityManyToMany:"many-to-many"}),w=new j({esriRelRoleOrigin:"origin",esriRelRoleDestination:"destination"});let p=class extends m(f){constructor(n){super(n),this.cardinality=null,this.composite=null,this.id=null,this.keyField=null,this.keyFieldInRelationshipTable=null,this.name=null,this.relatedTableId=null,this.relationshipTableId=null,this.role=null}};e([t({json:{read:S.read,write:S.write}})],p.prototype,"cardinality",void 0),e([t({json:{read:!0,write:!0}})],p.prototype,"composite",void 0),e([t({json:{read:!0,write:!0}})],p.prototype,"id",void 0),e([t({json:{read:!0,write:!0}})],p.prototype,"keyField",void 0),e([t({json:{read:!0,write:!0}})],p.prototype,"keyFieldInRelationshipTable",void 0),e([t({json:{read:!0,write:!0}})],p.prototype,"name",void 0),e([t({json:{read:!0,write:!0}})],p.prototype,"relatedTableId",void 0),e([t({json:{read:!0,write:!0}})],p.prototype,"relationshipTableId",void 0),e([t({json:{read:w.read,write:w.write}})],p.prototype,"role",void 0),p=e([v("esri.layers.support.Relationship")],p);const q=p;let y=class extends m(f){constructor(n){super(n),this.code=null,this.defaultValues={},this.domains=null,this.name=null}readDomains(n){if(!n)return null;const i={};for(const r of Object.keys(n))i[r]=E(n[r]);return i}writeDomains(n,i){var o;if(!n)return;const r={};for(const s of Object.keys(n))n[s]&&(r[s]=(o=n[s])==null?void 0:o.toJSON());i.domains=r}};e([t({type:Number,json:{write:!0}})],y.prototype,"code",void 0),e([t({type:Object,json:{write:!0}})],y.prototype,"defaultValues",void 0),e([t({json:{write:!0}})],y.prototype,"domains",void 0),e([a("domains")],y.prototype,"readDomains",null),e([O("domains")],y.prototype,"writeDomains",null),e([t({type:String,json:{write:!0}})],y.prototype,"name",void 0),y=e([v("esri.layers.support.Subtype")],y);const W=y,oe=n=>{let i=class extends n{constructor(){super(...arguments),this.copyright=null,this.capabilities=null,this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.definitionExpression=null,this.displayField=null,this.editFieldsInfo=null,this.editingInfo=null,this.elevationInfo=null,this.floorInfo=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.globalIdField=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.indexes=new(I.ofType(d)),this.isTable=!1,this.layerId=void 0,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.preferredTimeZone=null,this.relationships=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.sourceJSON=null,this.spatialReference=b.WGS84,this.subtypeField=null,this.subtypes=null,this.trackIdField=null,this.version=void 0}get authenticationTriggerEvent(){if(!this.url)return null;const{capabilities:r}=this;if(r){const{query:s,operations:l,editing:c}=r;if(!s.supportsQueryByOthers||!s.supportsQueryByAnonymous||l.supportsEditing&&!(c.supportsUpdateByOthers&&c.supportsUpdateByAnonymous&&c.supportsDeleteByOthers&&c.supportsDeleteByAnonymous))return"load"}if(this.userHasUpdateItemPrivileges){if(Z(this))return"load";if(this.hasUpdateItemRestrictions)return r.operations.supportsQuery?"editing":"load"}if(this.userHasFullEditingPrivileges&&this.hasFullEditingRestrictions)return"editing";const o=this.editFieldsInfo;return(o!=null&&o.creatorField||o!=null&&o.editorField)&&(r!=null&&r.operations.supportsEditing)?"editing":null}readCapabilitiesFromService(r,o){return J(o,this.url)}readEditingInfo(r,o){const{editingInfo:s}=o;return s?{lastEditDate:s.lastEditDate!=null?new Date(s.lastEditDate):null}:null}get effectiveCapabilities(){var c;const r=this.capabilities;if(!r)return null;const o=F(r),{operations:s,editing:l}=o;return(c=this.sourceJSON)!=null&&c.isMultiServicesView?(this.userHasUpdateItemPrivileges&&(s.supportsQuery=!0),o):this.userHasUpdateItemPrivileges?(s.supportsAdd=s.supportsDelete=s.supportsEditing=s.supportsQuery=s.supportsUpdate=l.supportsDeleteByOthers=l.supportsGeometryUpdate=l.supportsUpdateByOthers=!0,o):(this.userHasFullEditingPrivileges&&s.supportsEditing&&(s.supportsAdd=s.supportsDelete=s.supportsUpdate=l.supportsGeometryUpdate=!0),o)}readGlobalIdFieldFromService(r,o){return G(o)}get hasFullEditingRestrictions(){var l;const r=this.capabilities;if(!r||(l=this.sourceJSON)!=null&&l.isMultiServicesView)return!1;const{operations:o,editing:s}=r;return o.supportsEditing&&!(o.supportsAdd&&o.supportsDelete&&o.supportsUpdate&&s.supportsGeometryUpdate)}get hasUpdateItemRestrictions(){var l;const r=this.capabilities;if(!r)return!1;const{operations:o,editing:s}=r;return(l=this.sourceJSON)!=null&&l.isMultiServicesView?!o.supportsQuery:!(o.supportsAdd&&o.supportsDelete&&o.supportsEditing&&o.supportsQuery&&o.supportsUpdate&&s.supportsDeleteByOthers&&s.supportsGeometryUpdate&&s.supportsUpdateByOthers)}readIsTableFromService(r,o){return o.type==="Table"}readMaxScale(r,o){return o.effectiveMaxScale||r||0}readMinScale(r,o){return o.effectiveMinScale||r||0}readObjectIdFieldFromService(r,o){return N(o)}readServiceDefinitionExpression(r,o){return o.definitionQuery||o.definitionExpression}set url(r){const o=C({layer:this,url:r,nonStandardUrlAllowed:!0,logger:Q.getLogger(this)});this._set("url",o.url),o.layerId!=null&&this._set("layerId",o.layerId)}writeUrl(r,o,s,l){V(this,r,null,o,l)}readVersion(r,o){return P(o)}};return e([t({readOnly:!0})],i.prototype,"authenticationTriggerEvent",null),e([t({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],i.prototype,"copyright",void 0),e([t({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","maxRecordCount","maxRecordCountFactor","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],i.prototype,"capabilities",void 0),e([a("service","capabilities")],i.prototype,"readCapabilitiesFromService",null),e([t(g("dateFieldsTimeReference"))],i.prototype,"dateFieldsTimeZone",void 0),e([t({type:Boolean})],i.prototype,"datesInUnknownTimezone",void 0),e([t({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),e([t({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],i.prototype,"displayField",void 0),e([t({readOnly:!0,type:L})],i.prototype,"editFieldsInfo",void 0),e([t({readOnly:!0})],i.prototype,"editingInfo",void 0),e([a("editingInfo")],i.prototype,"readEditingInfo",null),e([t({readOnly:!0})],i.prototype,"effectiveCapabilities",null),e([t((()=>{const r=F(R),o=r.json.origins;return o["web-map"]={read:!1,write:!1},o["portal-item"]={read:!1,write:!1},r})())],i.prototype,"elevationInfo",void 0),e([t({type:z,json:{name:"layerDefinition.floorInfo",write:!0,origins:{"web-scene":{name:"layerDefinition.floorInfo",write:{enabled:!0,layerContainerTypes:D}}}}})],i.prototype,"floorInfo",void 0),e([t({type:M,json:{origins:{service:{read:{source:"extent"}}}}})],i.prototype,"fullExtent",void 0),e([t()],i.prototype,"gdbVersion",void 0),e([t({readOnly:!0,type:H,json:{read:{source:"geometryProperties"}}})],i.prototype,"geometryFieldsInfo",void 0),e([t({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:k.read}}}})],i.prototype,"geometryType",void 0),e([t({type:String})],i.prototype,"globalIdField",void 0),e([a("service","globalIdField",["globalIdField","fields"])],i.prototype,"readGlobalIdFieldFromService",null),e([t({readOnly:!0})],i.prototype,"hasFullEditingRestrictions",null),e([t({type:Boolean,json:{origins:{service:{read:!0}}}})],i.prototype,"hasM",void 0),e([t({readOnly:!0})],i.prototype,"hasUpdateItemRestrictions",null),e([t({type:Boolean,json:{origins:{service:{read:!0}}}})],i.prototype,"hasZ",void 0),e([t({readOnly:!0,type:U})],i.prototype,"heightModelInfo",void 0),e([t({type:Date})],i.prototype,"historicMoment",void 0),e([t({type:I.ofType(d),readOnly:!0})],i.prototype,"indexes",void 0),e([t({readOnly:!0})],i.prototype,"isTable",void 0),e([a("service","isTable",["type"])],i.prototype,"readIsTableFromService",null),e([t({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],i.prototype,"layerId",void 0),e([t($)],i.prototype,"maxScale",void 0),e([a("service","maxScale",["maxScale","effectiveMaxScale"])],i.prototype,"readMaxScale",null),e([t(A)],i.prototype,"minScale",void 0),e([a("service","minScale",["minScale","effectiveMinScale"])],i.prototype,"readMinScale",null),e([t({type:String})],i.prototype,"objectIdField",void 0),e([a("service","objectIdField",["objectIdField","fields"])],i.prototype,"readObjectIdFieldFromService",null),e([t(g("preferredTimeReference"))],i.prototype,"preferredTimeZone",void 0),e([t({type:[q],readOnly:!0})],i.prototype,"relationships",void 0),e([t({type:Boolean})],i.prototype,"returnM",void 0),e([t({type:Boolean})],i.prototype,"returnZ",void 0),e([t({readOnly:!0,json:{write:!1}})],i.prototype,"serverGens",void 0),e([t({readOnly:!0})],i.prototype,"serviceDefinitionExpression",void 0),e([a("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],i.prototype,"readServiceDefinitionExpression",null),e([t({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],i.prototype,"serviceItemId",void 0),e([t()],i.prototype,"sourceJSON",void 0),e([t({type:b,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],i.prototype,"spatialReference",void 0),e([t({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],i.prototype,"subtypeField",void 0),e([t({type:[W],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],i.prototype,"subtypes",void 0),e([t({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],i.prototype,"trackIdField",void 0),e([t(B)],i.prototype,"url",null),e([O("url")],i.prototype,"writeUrl",null),e([t({json:{origins:{service:{read:!0}},read:!1}})],i.prototype,"version",void 0),e([a("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],i.prototype,"readVersion",null),i=e([v("esri.layers.mixins.FeatureLayerBase")],i),i};export{oe as D}; +import{b4 as m,d as e,y as t,dR as g,f as v,aU as f,i1 as x,i2 as T,aY as j,b5 as E,aZ as a,aR as O,aV as F,e8 as R,eV as D,aE as M,g_ as U,V as I,fQ as $,fR as A,aS as b,du as B,h0 as C,s as Q,h1 as V}from"./index-BjUNJPVf.js";import{f as k,U as Z,R as G,M as N,C as P}from"./featureLayerUtils-lwqyOSrl.js";import{p as z}from"./LayerFloorInfo-DlYNbO-A.js";import{a as J}from"./serviceCapabilitiesUtils-DiP90Uds.js";let u=class extends m(f){constructor(i){super(i),this.creatorField=null,this.creationDateField=null,this.editorField=null,this.editDateField=null,this.realm=null,this.timeZone=null}};e([t()],u.prototype,"creatorField",void 0),e([t()],u.prototype,"creationDateField",void 0),e([t()],u.prototype,"editorField",void 0),e([t()],u.prototype,"editDateField",void 0),e([t()],u.prototype,"realm",void 0),e([t(g("dateFieldsTimeReference",!0))],u.prototype,"timeZone",void 0),u=e([v("esri.layers.support.EditFieldsInfo")],u);const L=u;let d=class extends m(f){constructor(i){super(i)}};e([t({constructOnly:!0,json:{write:!0}})],d.prototype,"name",void 0),e([t({constructOnly:!0,json:{write:!0}})],d.prototype,"fields",void 0),e([t({constructOnly:!0,json:{write:!0}})],d.prototype,"isAscending",void 0),e([t({constructOnly:!0,json:{write:!0}})],d.prototype,"indexType",void 0),e([t({constructOnly:!0,json:{write:!0}})],d.prototype,"isUnique",void 0),e([t({constructOnly:!0,json:{write:!0}})],d.prototype,"description",void 0),d=e([v("esri.layers.support.FeatureIndex")],d);let h=class extends m(f){constructor(i){super(i),this.shapeAreaField=null,this.shapeLengthField=null,this.units=null}};e([t({type:String,json:{read:{source:"shapeAreaFieldName"}}})],h.prototype,"shapeAreaField",void 0),e([t({type:String,json:{read:{source:"shapeLengthFieldName"}}})],h.prototype,"shapeLengthField",void 0),e([t({type:String,json:{read:n=>x.read(n)||T.read(n)}})],h.prototype,"units",void 0),h=e([v("esri.layers.support.GeometryFieldsInfo")],h);const H=h,S=new j({esriRelCardinalityOneToOne:"one-to-one",esriRelCardinalityOneToMany:"one-to-many",esriRelCardinalityManyToMany:"many-to-many"}),w=new j({esriRelRoleOrigin:"origin",esriRelRoleDestination:"destination"});let p=class extends m(f){constructor(n){super(n),this.cardinality=null,this.composite=null,this.id=null,this.keyField=null,this.keyFieldInRelationshipTable=null,this.name=null,this.relatedTableId=null,this.relationshipTableId=null,this.role=null}};e([t({json:{read:S.read,write:S.write}})],p.prototype,"cardinality",void 0),e([t({json:{read:!0,write:!0}})],p.prototype,"composite",void 0),e([t({json:{read:!0,write:!0}})],p.prototype,"id",void 0),e([t({json:{read:!0,write:!0}})],p.prototype,"keyField",void 0),e([t({json:{read:!0,write:!0}})],p.prototype,"keyFieldInRelationshipTable",void 0),e([t({json:{read:!0,write:!0}})],p.prototype,"name",void 0),e([t({json:{read:!0,write:!0}})],p.prototype,"relatedTableId",void 0),e([t({json:{read:!0,write:!0}})],p.prototype,"relationshipTableId",void 0),e([t({json:{read:w.read,write:w.write}})],p.prototype,"role",void 0),p=e([v("esri.layers.support.Relationship")],p);const q=p;let y=class extends m(f){constructor(n){super(n),this.code=null,this.defaultValues={},this.domains=null,this.name=null}readDomains(n){if(!n)return null;const i={};for(const r of Object.keys(n))i[r]=E(n[r]);return i}writeDomains(n,i){var o;if(!n)return;const r={};for(const s of Object.keys(n))n[s]&&(r[s]=(o=n[s])==null?void 0:o.toJSON());i.domains=r}};e([t({type:Number,json:{write:!0}})],y.prototype,"code",void 0),e([t({type:Object,json:{write:!0}})],y.prototype,"defaultValues",void 0),e([t({json:{write:!0}})],y.prototype,"domains",void 0),e([a("domains")],y.prototype,"readDomains",null),e([O("domains")],y.prototype,"writeDomains",null),e([t({type:String,json:{write:!0}})],y.prototype,"name",void 0),y=e([v("esri.layers.support.Subtype")],y);const W=y,oe=n=>{let i=class extends n{constructor(){super(...arguments),this.copyright=null,this.capabilities=null,this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.definitionExpression=null,this.displayField=null,this.editFieldsInfo=null,this.editingInfo=null,this.elevationInfo=null,this.floorInfo=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.globalIdField=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.indexes=new(I.ofType(d)),this.isTable=!1,this.layerId=void 0,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.preferredTimeZone=null,this.relationships=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.sourceJSON=null,this.spatialReference=b.WGS84,this.subtypeField=null,this.subtypes=null,this.trackIdField=null,this.version=void 0}get authenticationTriggerEvent(){if(!this.url)return null;const{capabilities:r}=this;if(r){const{query:s,operations:l,editing:c}=r;if(!s.supportsQueryByOthers||!s.supportsQueryByAnonymous||l.supportsEditing&&!(c.supportsUpdateByOthers&&c.supportsUpdateByAnonymous&&c.supportsDeleteByOthers&&c.supportsDeleteByAnonymous))return"load"}if(this.userHasUpdateItemPrivileges){if(Z(this))return"load";if(this.hasUpdateItemRestrictions)return r.operations.supportsQuery?"editing":"load"}if(this.userHasFullEditingPrivileges&&this.hasFullEditingRestrictions)return"editing";const o=this.editFieldsInfo;return(o!=null&&o.creatorField||o!=null&&o.editorField)&&(r!=null&&r.operations.supportsEditing)?"editing":null}readCapabilitiesFromService(r,o){return J(o,this.url)}readEditingInfo(r,o){const{editingInfo:s}=o;return s?{lastEditDate:s.lastEditDate!=null?new Date(s.lastEditDate):null}:null}get effectiveCapabilities(){var c;const r=this.capabilities;if(!r)return null;const o=F(r),{operations:s,editing:l}=o;return(c=this.sourceJSON)!=null&&c.isMultiServicesView?(this.userHasUpdateItemPrivileges&&(s.supportsQuery=!0),o):this.userHasUpdateItemPrivileges?(s.supportsAdd=s.supportsDelete=s.supportsEditing=s.supportsQuery=s.supportsUpdate=l.supportsDeleteByOthers=l.supportsGeometryUpdate=l.supportsUpdateByOthers=!0,o):(this.userHasFullEditingPrivileges&&s.supportsEditing&&(s.supportsAdd=s.supportsDelete=s.supportsUpdate=l.supportsGeometryUpdate=!0),o)}readGlobalIdFieldFromService(r,o){return G(o)}get hasFullEditingRestrictions(){var l;const r=this.capabilities;if(!r||(l=this.sourceJSON)!=null&&l.isMultiServicesView)return!1;const{operations:o,editing:s}=r;return o.supportsEditing&&!(o.supportsAdd&&o.supportsDelete&&o.supportsUpdate&&s.supportsGeometryUpdate)}get hasUpdateItemRestrictions(){var l;const r=this.capabilities;if(!r)return!1;const{operations:o,editing:s}=r;return(l=this.sourceJSON)!=null&&l.isMultiServicesView?!o.supportsQuery:!(o.supportsAdd&&o.supportsDelete&&o.supportsEditing&&o.supportsQuery&&o.supportsUpdate&&s.supportsDeleteByOthers&&s.supportsGeometryUpdate&&s.supportsUpdateByOthers)}readIsTableFromService(r,o){return o.type==="Table"}readMaxScale(r,o){return o.effectiveMaxScale||r||0}readMinScale(r,o){return o.effectiveMinScale||r||0}readObjectIdFieldFromService(r,o){return N(o)}readServiceDefinitionExpression(r,o){return o.definitionQuery||o.definitionExpression}set url(r){const o=C({layer:this,url:r,nonStandardUrlAllowed:!0,logger:Q.getLogger(this)});this._set("url",o.url),o.layerId!=null&&this._set("layerId",o.layerId)}writeUrl(r,o,s,l){V(this,r,null,o,l)}readVersion(r,o){return P(o)}};return e([t({readOnly:!0})],i.prototype,"authenticationTriggerEvent",null),e([t({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],i.prototype,"copyright",void 0),e([t({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","maxRecordCount","maxRecordCountFactor","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],i.prototype,"capabilities",void 0),e([a("service","capabilities")],i.prototype,"readCapabilitiesFromService",null),e([t(g("dateFieldsTimeReference"))],i.prototype,"dateFieldsTimeZone",void 0),e([t({type:Boolean})],i.prototype,"datesInUnknownTimezone",void 0),e([t({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),e([t({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],i.prototype,"displayField",void 0),e([t({readOnly:!0,type:L})],i.prototype,"editFieldsInfo",void 0),e([t({readOnly:!0})],i.prototype,"editingInfo",void 0),e([a("editingInfo")],i.prototype,"readEditingInfo",null),e([t({readOnly:!0})],i.prototype,"effectiveCapabilities",null),e([t((()=>{const r=F(R),o=r.json.origins;return o["web-map"]={read:!1,write:!1},o["portal-item"]={read:!1,write:!1},r})())],i.prototype,"elevationInfo",void 0),e([t({type:z,json:{name:"layerDefinition.floorInfo",write:!0,origins:{"web-scene":{name:"layerDefinition.floorInfo",write:{enabled:!0,layerContainerTypes:D}}}}})],i.prototype,"floorInfo",void 0),e([t({type:M,json:{origins:{service:{read:{source:"extent"}}}}})],i.prototype,"fullExtent",void 0),e([t()],i.prototype,"gdbVersion",void 0),e([t({readOnly:!0,type:H,json:{read:{source:"geometryProperties"}}})],i.prototype,"geometryFieldsInfo",void 0),e([t({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:k.read}}}})],i.prototype,"geometryType",void 0),e([t({type:String})],i.prototype,"globalIdField",void 0),e([a("service","globalIdField",["globalIdField","fields"])],i.prototype,"readGlobalIdFieldFromService",null),e([t({readOnly:!0})],i.prototype,"hasFullEditingRestrictions",null),e([t({type:Boolean,json:{origins:{service:{read:!0}}}})],i.prototype,"hasM",void 0),e([t({readOnly:!0})],i.prototype,"hasUpdateItemRestrictions",null),e([t({type:Boolean,json:{origins:{service:{read:!0}}}})],i.prototype,"hasZ",void 0),e([t({readOnly:!0,type:U})],i.prototype,"heightModelInfo",void 0),e([t({type:Date})],i.prototype,"historicMoment",void 0),e([t({type:I.ofType(d),readOnly:!0})],i.prototype,"indexes",void 0),e([t({readOnly:!0})],i.prototype,"isTable",void 0),e([a("service","isTable",["type"])],i.prototype,"readIsTableFromService",null),e([t({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],i.prototype,"layerId",void 0),e([t($)],i.prototype,"maxScale",void 0),e([a("service","maxScale",["maxScale","effectiveMaxScale"])],i.prototype,"readMaxScale",null),e([t(A)],i.prototype,"minScale",void 0),e([a("service","minScale",["minScale","effectiveMinScale"])],i.prototype,"readMinScale",null),e([t({type:String})],i.prototype,"objectIdField",void 0),e([a("service","objectIdField",["objectIdField","fields"])],i.prototype,"readObjectIdFieldFromService",null),e([t(g("preferredTimeReference"))],i.prototype,"preferredTimeZone",void 0),e([t({type:[q],readOnly:!0})],i.prototype,"relationships",void 0),e([t({type:Boolean})],i.prototype,"returnM",void 0),e([t({type:Boolean})],i.prototype,"returnZ",void 0),e([t({readOnly:!0,json:{write:!1}})],i.prototype,"serverGens",void 0),e([t({readOnly:!0})],i.prototype,"serviceDefinitionExpression",void 0),e([a("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],i.prototype,"readServiceDefinitionExpression",null),e([t({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],i.prototype,"serviceItemId",void 0),e([t()],i.prototype,"sourceJSON",void 0),e([t({type:b,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],i.prototype,"spatialReference",void 0),e([t({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],i.prototype,"subtypeField",void 0),e([t({type:[W],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],i.prototype,"subtypes",void 0),e([t({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],i.prototype,"trackIdField",void 0),e([t(B)],i.prototype,"url",null),e([O("url")],i.prototype,"writeUrl",null),e([t({json:{origins:{service:{read:!0}},read:!1}})],i.prototype,"version",void 0),e([a("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],i.prototype,"readVersion",null),i=e([v("esri.layers.mixins.FeatureLayerBase")],i),i};export{oe as D}; diff --git a/assets/FeatureLayerSource-BeuGtrZI.js b/assets/FeatureLayerSource-3cjHhwgM.js similarity index 90% rename from assets/FeatureLayerSource-BeuGtrZI.js rename to assets/FeatureLayerSource-3cjHhwgM.js index d6c98b3..b32f848 100644 --- a/assets/FeatureLayerSource-BeuGtrZI.js +++ b/assets/FeatureLayerSource-3cjHhwgM.js @@ -1,7 +1,7 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/uploadAssets-Do4zQv1Y.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css","assets/External-DC51KyR4.js","assets/infoFor3D-DsOdlPuA.js","assets/uploadAssetErrors-D_dYSFa_.js"] + __vite__mapDeps.viteFileDeps = ["assets/uploadAssets-CYfQLTBV.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css","assets/External-DIoD7Bb4.js","assets/infoFor3D-DsOdlPuA.js","assets/uploadAssetErrors-DCHo_tDX.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{G,cG as U,ak as V,ft as H,fu as C,fv as X,s as $,N as A,j as Y,b0 as z,aY as Q,d as _,y as T,f as W,fw as Z,k as B,E as j,M as m,q as M,az as K,aE as ee,b2 as te,b7 as ae,b_ as L,_ as se,fx as re,b1 as ie,ay as ne,di as oe,aS as ue,aX as le}from"./index-CEWggaxV.js";import{g as de,a as ce}from"./meshVertexSpaceUtils-BFWpJFSd.js";import{v as pe}from"./External-DC51KyR4.js";import{isFeatureIdentifierArrayWithGlobalId as he,isFeatureIdentifierArrayWithObjectId as ye}from"./editingSupport-DWTRjmy9.js";import{o as me}from"./clientSideDefaults-CgRgH99f.js";import{x as fe}from"./QueryTask-CjHwD7wL.js";import{Q as x}from"./featureLayerUtils-BhDaw8pS.js";import{F as ge}from"./infoFor3D-DsOdlPuA.js";import{s as we}from"./executeQueryJSON-DngjHRnE.js";import{i as be}from"./editsZScale-CQCGPEjO.js";import{i as Re,c as qe,a as Se,t as Ie}from"./EditBusLayer-SG7oYwiY.js";import"./MeshLocalVertexSpace-Cltwu1Kq.js";import"./vec3-CjYmIfaa.js";import"./QueryEngineCapabilities-CTDe3LlQ.js";import"./defaultsJSON-CHAaurhX.js";import"./executeForIds-BjeEaIen.js";import"./query-BM8R3sQ6.js";import"./pbfQueryUtils-CLRSFGBm.js";import"./pbf-D9QZb8S8.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./queryZScale-DN4aFXYn.js";import"./executeQueryPBF-BYY2Ipuh.js";import"./featureConversionUtils-CmP9mw0r.js";import"./FeatureSet-CYJUZgOk.js";import"./jsonUtils-BseLl1fZ.js";import"./UniqueValueRenderer-BlkUix3g.js";import"./ColorStop-44hBlQ14.js";import"./diffUtils-B4YFa5Ju.js";import"./colorRamps-BJydlf0f.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-z2k12BH8.js";import"./jsonUtils-qYmXvGJ1.js";import"./styleUtils-CnV_Xzhi.js";import"./Version-Bd0QsIQ5.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./OverrideHelper-B4ryGWZb.js";import"./utils-p-5Bbga5.js";import"./quantizationUtils-CUjGHrU3.js";import"./heatmapUtils-Clt5rJzr.js";import"./AttachmentQuery-D61mmWw4.js";import"./RelationshipQuery-DDK72Kwc.js";async function P(t,e,a){const{geometry:s}=e,r={...e.attributes};if(a!=null&&(s==null?void 0:s.type)==="mesh"){const{transformFieldRoles:i}=a,{origin:o,spatialReference:n,transform:u,vertexSpace:l}=s,c=l.type==="local",p=t.spatialReference,f=p.isGeographic,S=G(p,n),b=S||U(p)&&(U(n)||V(n));if(!(c&&f&&b||!c&&!f&&S))return null;const d=H(o,n,p);if(d==null)return null;if(r[i.originX]=d.x,r[i.originY]=d.y,r[i.originZ]=d.z??0,u!=null){const{translation:I,scale:h,rotation:y}=u,R=c?1:C(n)/C(p);r[i.translationX]=I[0]*R,r[i.translationY]=I[2]*R,r[i.translationZ]=-I[1]*R,r[i.scaleX]=h[0],r[i.scaleY]=h[2],r[i.scaleZ]=h[1],r[i.rotationX]=y[0],r[i.rotationY]=y[2],r[i.rotationZ]=-y[1],r[i.rotationDeg]=y[3]}return{attributes:r}}return s==null?{attributes:r}:s.type==="mesh"||s.type==="extent"?null:{geometry:s.toJSON(),attributes:r}}async function Fe(t,e){const a=await Promise.all((e.addAttachments??[]).map(i=>D(t,i))),s=await Promise.all((e.updateAttachments??[]).map(i=>D(t,i))),r=e.deleteAttachments??[];return a.length||s.length||r.length?{adds:a,updates:s,deletes:[...r]}:null}async function D(t,e){var c;const{feature:a,attachment:s}=e,{globalId:r,name:i,contentType:o,data:n,uploadId:u}=s,l={globalId:r};if(a&&("attributes"in a?l.parentGlobalId=(c=a.attributes)==null?void 0:c[t.globalIdField]:a.globalId&&(l.parentGlobalId=a.globalId)),u)l.uploadId=u;else if(n){const p=await X(n);p&&(l.contentType=p.mediaType,l.data=p.data),n instanceof File&&(l.name=n.name)}return i&&(l.name=i),o&&(l.contentType=o),l}function Ae(t,e,a){if(!e||e.length===0)return[];if(a&&he(e))return e.map(r=>r.globalId);if(ye(e))return e.map(r=>r.objectId);const s=a?t.globalIdField:t.objectIdField;return s?e.map(r=>r.getAttribute(s)):[]}function Oe(t){var r,i,o;const e=t==null?void 0:t.assetMaps;if(e){for(const n of e.addResults)n.success||$.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${n.globalId}.`);for(const n of e.updateResults)n.success||$.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${n.globalId}.`)}const a=t==null?void 0:t.attachments,s={addFeatureResults:((r=t==null?void 0:t.addResults)==null?void 0:r.map(q))??[],updateFeatureResults:((i=t==null?void 0:t.updateResults)==null?void 0:i.map(q))??[],deleteFeatureResults:((o=t==null?void 0:t.deleteResults)==null?void 0:o.map(q))??[],addAttachmentResults:a!=null&&a.addResults?a.addResults.map(q):[],updateAttachmentResults:a!=null&&a.updateResults?a.updateResults.map(q):[],deleteAttachmentResults:a!=null&&a.deleteResults?a.deleteResults.map(q):[]};return t!=null&&t.editMoment&&(s.editMoment=t.editMoment),s}function q(t){const e=t.success===!0?null:t.error||{code:void 0,description:void 0};return{objectId:t.objectId,globalId:t.globalId,error:e?new A("feature-layer-source:edit-failure",e.description,{code:e.code}):null}}function v(t,e){return new Y({attributes:t.attributes,geometry:z({...t.geometry,spatialReference:e})})}function Ee(t,e){var a,s,r;return{adds:((a=t==null?void 0:t.adds)==null?void 0:a.map(i=>v(i,e)))||[],updates:((s=t==null?void 0:t.updates)==null?void 0:s.map(i=>({original:v(i[0],e),current:v(i[1],e)})))||[],deletes:((r=t==null?void 0:t.deletes)==null?void 0:r.map(i=>v(i,e)))||[],spatialReference:e}}function _e(t){const e=t.details.raw,a=+e.code,s=+e.extendedCode;return a===500&&(s===-2147217144||s===-2147467261)}const xe=new Q({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),ve=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),$e=new Q({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let O=class extends Z{constructor(){super(...arguments),this.type="feature-layer",this.refresh=B(async()=>{var a,s;await this.load();const t=(a=this.sourceJSON.editingInfo)==null?void 0:a.lastEditDate;if(t==null)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const e=t!==((s=this.sourceJSON.editingInfo)==null?void 0:s.lastEditDate);return{dataChanged:e,updates:e?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}),this._ongoingAssetUploads=new Map}load(t){const e=this.layer.sourceJSON,a=this._fetchService(e,{...t}).then(()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,t)).then(()=>this._ensureLatestMetadata(t));return this.addResolvingPromise(a),Promise.resolve(this)}get queryTask(){var l;const{capabilities:t,parsedUrl:e,dynamicDataSource:a,infoFor3D:s,gdbVersion:r,spatialReference:i,fieldsIndex:o}=this.layer,n=j("featurelayer-pbf")&&(t==null?void 0:t.query.supportsFormatPBF)&&s==null,u=((l=t==null?void 0:t.operations)==null?void 0:l.supportsQueryAttachments)??!1;return new fe({url:e.path,pbfSupported:n,fieldsIndex:o,infoFor3D:s,dynamicDataSource:a,gdbVersion:r,sourceSpatialReference:i,queryAttachmentsSupported:u})}async addAttachment(t,e){await this.load();const{layer:a}=this;await x(a,"editing");const s=t.attributes[a.objectIdField],r=a.parsedUrl.path+"/"+s+"/addAttachment",i=this._getLayerRequestOptions(),o=this._getFormDataForAttachment(e,i.query);try{const n=await m(r,{body:o});return q(n.data.addAttachmentResult)}catch(n){throw this._createAttachmentErrorResult(s,n)}}async updateAttachment(t,e,a){await this.load();const{layer:s}=this;await x(s,"editing");const r=t.attributes[s.objectIdField],i=s.parsedUrl.path+"/"+r+"/updateAttachment",o=this._getLayerRequestOptions({query:{attachmentId:e}}),n=this._getFormDataForAttachment(a,o.query);try{const u=await m(i,{body:n});return q(u.data.updateAttachmentResult)}catch(u){throw this._createAttachmentErrorResult(r,u)}}async applyEdits(t,e){var g,F,E,N,J,k;await this.load();const{layer:a}=this;await x(a,"editing");const s=a.infoFor3D,r=s!=null,i=r||((e==null?void 0:e.globalIdUsed)??!1),o=r?await this._uploadMeshesAndGetAssetMapEditsJSON(t):null,n=((g=t.addFeatures)==null?void 0:g.map(w=>P(this.layer,w,s)))??[],u=(await Promise.all(n)).filter(M),l=((F=t.updateFeatures)==null?void 0:F.map(w=>P(this.layer,w,s)))??[],c=(await Promise.all(l)).filter(M),p=Ae(this.layer,t.deleteFeatures,i);be(u,c,a.spatialReference);const f=await Fe(this.layer,t),S=a.capabilities.editing.supportsAsyncApplyEdits&&r,b=(e==null?void 0:e.gdbVersion)||a.gdbVersion,d={gdbVersion:b,rollbackOnFailure:e==null?void 0:e.rollbackOnFailureEnabled,useGlobalIds:i,returnEditMoment:e==null?void 0:e.returnEditMoment,usePreviousEditMoment:e==null?void 0:e.usePreviousEditMoment,async:S};await Re(this.layer.url,b,!0);const I=qe(this.layer.url,b||null);if(await Se(a.url,b,a.historicMoment))throw new A("feature-layer-source:historic-version","Editing a historic version is not allowed");e!=null&&e.returnServiceEditsOption?(d.edits=JSON.stringify([{id:a.layerId,adds:u,updates:c,deletes:p,attachments:f,assetMaps:o}]),d.returnServiceEditsOption=xe.toJSON(e==null?void 0:e.returnServiceEditsOption),d.returnServiceEditsInSourceSR=e==null?void 0:e.returnServiceEditsInSourceSR):(d.adds=u.length?JSON.stringify(u):null,d.updates=c.length?JSON.stringify(c):null,d.deletes=p.length?i?JSON.stringify(p):p.join(","):null,d.attachments=f&&JSON.stringify(f),d.assetMaps=o!=null?JSON.stringify(o):void 0);const h=this._getLayerRequestOptions({method:"post",query:d});I&&(h.authMode="immediate",h.query.returnEditMoment=!0,h.query.sessionId=Ie);const y=e!=null&&e.returnServiceEditsOption?a.url:a.parsedUrl.path;let R;try{R=S?await this._asyncApplyEdits(y+"/applyEdits",h):await m(y+"/applyEdits",h)}catch(w){if(!_e(w))throw w;h.authMode="immediate",R=S?await this._asyncApplyEdits(y+"/applyEdits",h):await m(y+"/applyEdits",h)}if(!((E=a.capabilities.operations)!=null&&E.supportsEditing)&&((J=(N=a.effectiveCapabilities)==null?void 0:N.operations)!=null&&J.supportsEditing)){const w=(k=K)==null?void 0:k.findCredential(a.url);await(w==null?void 0:w.refreshToken())}return this._createEditsResult(R)}async deleteAttachments(t,e){await this.load();const{layer:a}=this;await x(a,"editing");const s=t.attributes[a.objectIdField],r=a.parsedUrl.path+"/"+s+"/deleteAttachments";try{return(await m(r,this._getLayerRequestOptions({query:{attachmentIds:e.join(",")},method:"post"}))).data.deleteAttachmentResults.map(q)}catch(i){throw this._createAttachmentErrorResult(s,i)}}fetchRecomputedExtents(t={}){const e=t.signal;return this.load({signal:e}).then(async()=>{const a=this._getLayerRequestOptions({...t,query:{returnUpdates:!0}}),{layerId:s,url:r}=this.layer,{data:i}=await m(`${r}/${s}`,a),{id:o,extent:n,fullExtent:u,timeExtent:l}=i,c=n||u;return{id:o,fullExtent:c&&ee.fromJSON(c),timeExtent:l&&te.fromJSON({start:l[0],end:l[1]})}})}async queryAttachments(t,e={}){await this.load();const a=this._getLayerRequestOptions(e);return this.queryTask.executeAttachmentQuery(t,a)}async queryFeatures(t,e){var s;await this.load();const a=await this.queryTask.execute(t,{...e,query:this._createRequestQueryOptions(e)});return(s=t.outStatistics)!=null&&s.length&&a.features.length&&a.features.forEach(r=>{var o;const i=r.attributes;(o=t.outStatistics)==null||o.forEach(({outStatisticFieldName:n})=>{if(n){const u=n.toLowerCase();u&&u in i&&n!==u&&(i[n]=i[u],delete i[u])}})}),a}async queryFeaturesJSON(t,e){return await this.load(),this.queryTask.executeJSON(t,{...e,query:this._createRequestQueryOptions(e)})}async queryObjectIds(t,e){return await this.load(),this.queryTask.executeForIds(t,{...e,query:this._createRequestQueryOptions(e)})}async queryFeatureCount(t,e){return await this.load(),this.queryTask.executeForCount(t,{...e,query:this._createRequestQueryOptions(e)})}async queryExtent(t,e){return await this.load(),this.queryTask.executeForExtent(t,{...e,query:this._createRequestQueryOptions(e)})}async queryRelatedFeatures(t,e){return await this.load(),this.queryTask.executeRelationshipQuery(t,{...e,query:this._createRequestQueryOptions(e)})}async queryRelatedFeaturesCount(t,e){return await this.load(),this.queryTask.executeRelationshipQueryForCount(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopFeatures(t,e){return await this.load(),this.queryTask.executeTopFeaturesQuery(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopObjectIds(t,e){return await this.load(),this.queryTask.executeForTopIds(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopExtents(t,e){return await this.load(),this.queryTask.executeForTopExtents(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopCount(t,e){return await this.load(),this.queryTask.executeForTopCount(t,{...e,query:this._createRequestQueryOptions(e)})}async fetchPublishingStatus(){if(!ae(this.layer.url))return"unavailable";const t=L(this.layer.url,"status"),e=await m(t,{query:{f:"json"}});return $e.fromJSON(e.data.status)}async uploadAssets(t,e){const{uploadAssets:a}=await se(()=>import("./uploadAssets-Do4zQv1Y.js"),__vite__mapDeps([0,1,2,3,4,5]));return a(t,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},e)}async _asyncApplyEdits(t,e){const a=(await m(t,e)).data.statusUrl;for(;;){const s=(await m(a,{query:{f:"json"},responseType:"json"})).data;switch(s.status){case"Completed":return m(s.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new A("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new A("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await re(Te)}}_createRequestQueryOptions(t){const e={...this.layer.customParameters,token:this.layer.apiKey,...t==null?void 0:t.query};return this.layer.datesInUnknownTimezone&&(e.timeReferenceUnknownClient=!0),e}async _fetchService(t,e){if(!t){const s={};j("featurelayer-advanced-symbols")&&(s.returnAdvancedSymbols=!0),e!=null&&e.cacheBust&&(s._ts=Date.now());const{data:r}=await m(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:s,signal:e==null?void 0:e.signal}));t=r}this.sourceJSON=await this._patchServiceJSON(t,e==null?void 0:e.signal);const a=t.type;if(!ve.has(a))throw new A("feature-layer-source:unsupported-type",`Source type "${a}" is not supported`)}async _patchServiceJSON(t,e){var a;if(t.type!=="Table"&&t.geometryType&&!((a=t==null?void 0:t.drawingInfo)!=null&&a.renderer)&&!t.defaultSymbol){const s=me(t.geometryType).renderer;ie("drawingInfo.renderer",s,t)}if(t.geometryType==="esriGeometryMultiPatch"&&t.infoFor3D&&(t.geometryType="mesh"),t.extent==null)try{const{data:s}=await m(this.layer.url,this._getLayerRequestOptions({signal:e}));s.spatialReference&&(t.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:s.spatialReference})}catch(s){ne(s)}return t}async _ensureLatestMetadata(t){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...t,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(t){const{addAssetFeatures:e}=t;if(!(e!=null&&e.length))return null;const a=await this._filterRedundantAssetMaps(e);if(!(e!=null&&e.length))return null;const s=new Array,r=new Map;for(const i of a){const{geometry:o}=i,{vertexSpace:n}=o;if(de(n))s.push(o);else{const u=ce(o);r.set(u,o),i.geometry=u,s.push(u)}}await this.uploadAssets(s);for(const[i,o]of r)o.addExternalSources(i.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(a),updates:[],deletes:[]}}_getAssetMapEditsJSON(t){const e=new Array,a=this.layer.globalIdField,s=this.layer.parsedUrl;for(const r of t){const i=r.geometry,{metadata:o}=i,n=o.getExternalSourcesOnService(s),u=r.getAttribute(a);if(n.length===0){$.getLogger(this).error(`Skipping feature ${u}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}const{source:l}=n.find(pe)??n[0];for(const c of l)c.parts.length===1?e.push({globalId:oe(),parentGlobalId:u,assetName:c.assetName,assetHash:c.parts[0].partHash,flags:[]}):$.getLogger(this).error(`Skipping asset ${c.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return e}_createEditsResult(t){const e=t.data,{layerId:a}=this.layer,s=[];let r=null;if(Array.isArray(e))for(const o of e)s.push({id:o.id,editedFeatures:o.editedFeatures}),o.id===a&&(r={addResults:o.addResults??[],updateResults:o.updateResults??[],deleteResults:o.deleteResults??[],attachments:o.attachments,editMoment:o.editMoment});else r=e;const i=Oe(r);if(s.length>0){i.editedFeatureResults=[];for(const o of s){const{editedFeatures:n}=o,u=n!=null&&n.spatialReference?new ue(n.spatialReference):null;i.editedFeatureResults.push({layerId:o.id,editedFeatures:Ee(n,u)})}}return i}_createAttachmentErrorResult(t,e){var r;const a=((r=e.details.messages)==null?void 0:r[0])||e.message,s=e.details.httpStatus||e.details.messageCode;return{objectId:t,globalId:null,error:new A("feature-layer-source:attachment-failure",a,{code:s})}}_getFormDataForAttachment(t,e){const a=t instanceof FormData?t:t&&t.elements?new FormData(t):null;if(a)for(const s in e){const r=e[s];r!=null&&(a.set?a.set(s,r):a.append(s,r))}return a}_getLayerRequestOptions(t={}){const{parsedUrl:e,gdbVersion:a,dynamicDataSource:s}=this.layer;return{...t,query:{gdbVersion:a,layer:s?JSON.stringify({source:s}):void 0,...e.query,f:"json",...this._createRequestQueryOptions(t)},responseType:"json"}}async _filterRedundantAssetMaps(t){const{layer:e}=this,{globalIdField:a,infoFor3D:s,parsedUrl:r}=e;if(s==null||a==null)return t;const i=ge(s);if(i==null)return t;const o=L(r.path,`../${i.id}`),n=new Array,u=new Array;for(const d of t)d.geometry.metadata.getExternalSourcesOnService(r).length>0?u.push(d):n.push(d);const l=u.map(d=>d.getAttribute(a)).filter(M);if(l.length===0)return t;const{assetMapFieldRoles:{parentGlobalId:c,assetHash:p}}=s,f=new le;f.where=`${c} IN (${l.map(d=>`'${d}'`)})`,f.outFields=[p,c],f.returnGeometry=!1;const S=await we(o,f),{features:b}=S;return b.length===0?t:[...n,...u.filter(d=>{const I=d.getAttribute(a);if(!I)return!0;const{metadata:h}=d.geometry,y=b.filter(g=>g.getAttribute(c)===I);if(y.length===0)return!0;const R=y.map(g=>g.getAttribute(p));return h.getExternalSourcesOnService(r).flatMap(({source:g})=>g.flatMap(F=>F.parts.map(E=>E.partHash))).some(g=>R.every(F=>g!==F))})]}};_([T()],O.prototype,"type",void 0),_([T({constructOnly:!0})],O.prototype,"layer",void 0),_([T({readOnly:!0})],O.prototype,"queryTask",null),O=_([W("esri.layers.graphics.sources.FeatureLayerSource")],O);const Te=1e3,St=O;export{St as default}; +import{G,cG as U,ak as V,ft as H,fu as C,fv as X,s as $,N as A,j as Y,b0 as z,aY as Q,d as _,y as T,f as W,fw as Z,k as B,E as j,M as m,q as M,az as K,aE as ee,b2 as te,b7 as ae,b_ as L,_ as se,fx as re,b1 as ie,ay as ne,di as oe,aS as ue,aX as le}from"./index-BjUNJPVf.js";import{g as de,a as ce}from"./meshVertexSpaceUtils-DwMoblqo.js";import{v as pe}from"./External-DIoD7Bb4.js";import{isFeatureIdentifierArrayWithGlobalId as he,isFeatureIdentifierArrayWithObjectId as ye}from"./editingSupport-4MwIplWk.js";import{o as me}from"./clientSideDefaults-BQP5n3lX.js";import{x as fe}from"./QueryTask-Cl66pG_V.js";import{Q as x}from"./featureLayerUtils-lwqyOSrl.js";import{F as ge}from"./infoFor3D-DsOdlPuA.js";import{s as we}from"./executeQueryJSON-COxi_Fac.js";import{i as be}from"./editsZScale-Bfe6gH1b.js";import{i as Re,c as qe,a as Se,t as Ie}from"./EditBusLayer-OslMX9fF.js";import"./MeshLocalVertexSpace-DRvwbFTJ.js";import"./vec3-DdRUbala.js";import"./QueryEngineCapabilities-CTDe3LlQ.js";import"./defaultsJSON-CHAaurhX.js";import"./executeForIds-CZ3M8IZd.js";import"./query-Bk_ITqRK.js";import"./pbfQueryUtils-CSeFSIjv.js";import"./pbf-Du8sFEWo.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./queryZScale-Dwvn5BlQ.js";import"./executeQueryPBF-DROgTCuZ.js";import"./featureConversionUtils-BHhm7bvm.js";import"./FeatureSet-opEn8ou8.js";import"./jsonUtils-Dw332y6z.js";import"./UniqueValueRenderer-7V9Bhr-D.js";import"./ColorStop-DCGjAKLC.js";import"./diffUtils-uUoMDFQS.js";import"./colorRamps-CcakIWlU.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-BX9G5gNQ.js";import"./jsonUtils-Ox5U0P0F.js";import"./styleUtils-DOUOskVZ.js";import"./Version-Dqq_CHBG.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./OverrideHelper-DxFZBnGL.js";import"./utils-CuXO_Zzq.js";import"./quantizationUtils-CfV316jZ.js";import"./heatmapUtils-BSteZBTj.js";import"./AttachmentQuery-DmEAIZff.js";import"./RelationshipQuery-BDJrOxaX.js";async function P(t,e,a){const{geometry:s}=e,r={...e.attributes};if(a!=null&&(s==null?void 0:s.type)==="mesh"){const{transformFieldRoles:i}=a,{origin:o,spatialReference:n,transform:u,vertexSpace:l}=s,c=l.type==="local",p=t.spatialReference,f=p.isGeographic,S=G(p,n),b=S||U(p)&&(U(n)||V(n));if(!(c&&f&&b||!c&&!f&&S))return null;const d=H(o,n,p);if(d==null)return null;if(r[i.originX]=d.x,r[i.originY]=d.y,r[i.originZ]=d.z??0,u!=null){const{translation:I,scale:h,rotation:y}=u,R=c?1:C(n)/C(p);r[i.translationX]=I[0]*R,r[i.translationY]=I[2]*R,r[i.translationZ]=-I[1]*R,r[i.scaleX]=h[0],r[i.scaleY]=h[2],r[i.scaleZ]=h[1],r[i.rotationX]=y[0],r[i.rotationY]=y[2],r[i.rotationZ]=-y[1],r[i.rotationDeg]=y[3]}return{attributes:r}}return s==null?{attributes:r}:s.type==="mesh"||s.type==="extent"?null:{geometry:s.toJSON(),attributes:r}}async function Fe(t,e){const a=await Promise.all((e.addAttachments??[]).map(i=>D(t,i))),s=await Promise.all((e.updateAttachments??[]).map(i=>D(t,i))),r=e.deleteAttachments??[];return a.length||s.length||r.length?{adds:a,updates:s,deletes:[...r]}:null}async function D(t,e){var c;const{feature:a,attachment:s}=e,{globalId:r,name:i,contentType:o,data:n,uploadId:u}=s,l={globalId:r};if(a&&("attributes"in a?l.parentGlobalId=(c=a.attributes)==null?void 0:c[t.globalIdField]:a.globalId&&(l.parentGlobalId=a.globalId)),u)l.uploadId=u;else if(n){const p=await X(n);p&&(l.contentType=p.mediaType,l.data=p.data),n instanceof File&&(l.name=n.name)}return i&&(l.name=i),o&&(l.contentType=o),l}function Ae(t,e,a){if(!e||e.length===0)return[];if(a&&he(e))return e.map(r=>r.globalId);if(ye(e))return e.map(r=>r.objectId);const s=a?t.globalIdField:t.objectIdField;return s?e.map(r=>r.getAttribute(s)):[]}function Oe(t){var r,i,o;const e=t==null?void 0:t.assetMaps;if(e){for(const n of e.addResults)n.success||$.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${n.globalId}.`);for(const n of e.updateResults)n.success||$.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${n.globalId}.`)}const a=t==null?void 0:t.attachments,s={addFeatureResults:((r=t==null?void 0:t.addResults)==null?void 0:r.map(q))??[],updateFeatureResults:((i=t==null?void 0:t.updateResults)==null?void 0:i.map(q))??[],deleteFeatureResults:((o=t==null?void 0:t.deleteResults)==null?void 0:o.map(q))??[],addAttachmentResults:a!=null&&a.addResults?a.addResults.map(q):[],updateAttachmentResults:a!=null&&a.updateResults?a.updateResults.map(q):[],deleteAttachmentResults:a!=null&&a.deleteResults?a.deleteResults.map(q):[]};return t!=null&&t.editMoment&&(s.editMoment=t.editMoment),s}function q(t){const e=t.success===!0?null:t.error||{code:void 0,description:void 0};return{objectId:t.objectId,globalId:t.globalId,error:e?new A("feature-layer-source:edit-failure",e.description,{code:e.code}):null}}function v(t,e){return new Y({attributes:t.attributes,geometry:z({...t.geometry,spatialReference:e})})}function Ee(t,e){var a,s,r;return{adds:((a=t==null?void 0:t.adds)==null?void 0:a.map(i=>v(i,e)))||[],updates:((s=t==null?void 0:t.updates)==null?void 0:s.map(i=>({original:v(i[0],e),current:v(i[1],e)})))||[],deletes:((r=t==null?void 0:t.deletes)==null?void 0:r.map(i=>v(i,e)))||[],spatialReference:e}}function _e(t){const e=t.details.raw,a=+e.code,s=+e.extendedCode;return a===500&&(s===-2147217144||s===-2147467261)}const xe=new Q({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),ve=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),$e=new Q({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let O=class extends Z{constructor(){super(...arguments),this.type="feature-layer",this.refresh=B(async()=>{var a,s;await this.load();const t=(a=this.sourceJSON.editingInfo)==null?void 0:a.lastEditDate;if(t==null)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const e=t!==((s=this.sourceJSON.editingInfo)==null?void 0:s.lastEditDate);return{dataChanged:e,updates:e?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}),this._ongoingAssetUploads=new Map}load(t){const e=this.layer.sourceJSON,a=this._fetchService(e,{...t}).then(()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,t)).then(()=>this._ensureLatestMetadata(t));return this.addResolvingPromise(a),Promise.resolve(this)}get queryTask(){var l;const{capabilities:t,parsedUrl:e,dynamicDataSource:a,infoFor3D:s,gdbVersion:r,spatialReference:i,fieldsIndex:o}=this.layer,n=j("featurelayer-pbf")&&(t==null?void 0:t.query.supportsFormatPBF)&&s==null,u=((l=t==null?void 0:t.operations)==null?void 0:l.supportsQueryAttachments)??!1;return new fe({url:e.path,pbfSupported:n,fieldsIndex:o,infoFor3D:s,dynamicDataSource:a,gdbVersion:r,sourceSpatialReference:i,queryAttachmentsSupported:u})}async addAttachment(t,e){await this.load();const{layer:a}=this;await x(a,"editing");const s=t.attributes[a.objectIdField],r=a.parsedUrl.path+"/"+s+"/addAttachment",i=this._getLayerRequestOptions(),o=this._getFormDataForAttachment(e,i.query);try{const n=await m(r,{body:o});return q(n.data.addAttachmentResult)}catch(n){throw this._createAttachmentErrorResult(s,n)}}async updateAttachment(t,e,a){await this.load();const{layer:s}=this;await x(s,"editing");const r=t.attributes[s.objectIdField],i=s.parsedUrl.path+"/"+r+"/updateAttachment",o=this._getLayerRequestOptions({query:{attachmentId:e}}),n=this._getFormDataForAttachment(a,o.query);try{const u=await m(i,{body:n});return q(u.data.updateAttachmentResult)}catch(u){throw this._createAttachmentErrorResult(r,u)}}async applyEdits(t,e){var g,F,E,N,J,k;await this.load();const{layer:a}=this;await x(a,"editing");const s=a.infoFor3D,r=s!=null,i=r||((e==null?void 0:e.globalIdUsed)??!1),o=r?await this._uploadMeshesAndGetAssetMapEditsJSON(t):null,n=((g=t.addFeatures)==null?void 0:g.map(w=>P(this.layer,w,s)))??[],u=(await Promise.all(n)).filter(M),l=((F=t.updateFeatures)==null?void 0:F.map(w=>P(this.layer,w,s)))??[],c=(await Promise.all(l)).filter(M),p=Ae(this.layer,t.deleteFeatures,i);be(u,c,a.spatialReference);const f=await Fe(this.layer,t),S=a.capabilities.editing.supportsAsyncApplyEdits&&r,b=(e==null?void 0:e.gdbVersion)||a.gdbVersion,d={gdbVersion:b,rollbackOnFailure:e==null?void 0:e.rollbackOnFailureEnabled,useGlobalIds:i,returnEditMoment:e==null?void 0:e.returnEditMoment,usePreviousEditMoment:e==null?void 0:e.usePreviousEditMoment,async:S};await Re(this.layer.url,b,!0);const I=qe(this.layer.url,b||null);if(await Se(a.url,b,a.historicMoment))throw new A("feature-layer-source:historic-version","Editing a historic version is not allowed");e!=null&&e.returnServiceEditsOption?(d.edits=JSON.stringify([{id:a.layerId,adds:u,updates:c,deletes:p,attachments:f,assetMaps:o}]),d.returnServiceEditsOption=xe.toJSON(e==null?void 0:e.returnServiceEditsOption),d.returnServiceEditsInSourceSR=e==null?void 0:e.returnServiceEditsInSourceSR):(d.adds=u.length?JSON.stringify(u):null,d.updates=c.length?JSON.stringify(c):null,d.deletes=p.length?i?JSON.stringify(p):p.join(","):null,d.attachments=f&&JSON.stringify(f),d.assetMaps=o!=null?JSON.stringify(o):void 0);const h=this._getLayerRequestOptions({method:"post",query:d});I&&(h.authMode="immediate",h.query.returnEditMoment=!0,h.query.sessionId=Ie);const y=e!=null&&e.returnServiceEditsOption?a.url:a.parsedUrl.path;let R;try{R=S?await this._asyncApplyEdits(y+"/applyEdits",h):await m(y+"/applyEdits",h)}catch(w){if(!_e(w))throw w;h.authMode="immediate",R=S?await this._asyncApplyEdits(y+"/applyEdits",h):await m(y+"/applyEdits",h)}if(!((E=a.capabilities.operations)!=null&&E.supportsEditing)&&((J=(N=a.effectiveCapabilities)==null?void 0:N.operations)!=null&&J.supportsEditing)){const w=(k=K)==null?void 0:k.findCredential(a.url);await(w==null?void 0:w.refreshToken())}return this._createEditsResult(R)}async deleteAttachments(t,e){await this.load();const{layer:a}=this;await x(a,"editing");const s=t.attributes[a.objectIdField],r=a.parsedUrl.path+"/"+s+"/deleteAttachments";try{return(await m(r,this._getLayerRequestOptions({query:{attachmentIds:e.join(",")},method:"post"}))).data.deleteAttachmentResults.map(q)}catch(i){throw this._createAttachmentErrorResult(s,i)}}fetchRecomputedExtents(t={}){const e=t.signal;return this.load({signal:e}).then(async()=>{const a=this._getLayerRequestOptions({...t,query:{returnUpdates:!0}}),{layerId:s,url:r}=this.layer,{data:i}=await m(`${r}/${s}`,a),{id:o,extent:n,fullExtent:u,timeExtent:l}=i,c=n||u;return{id:o,fullExtent:c&&ee.fromJSON(c),timeExtent:l&&te.fromJSON({start:l[0],end:l[1]})}})}async queryAttachments(t,e={}){await this.load();const a=this._getLayerRequestOptions(e);return this.queryTask.executeAttachmentQuery(t,a)}async queryFeatures(t,e){var s;await this.load();const a=await this.queryTask.execute(t,{...e,query:this._createRequestQueryOptions(e)});return(s=t.outStatistics)!=null&&s.length&&a.features.length&&a.features.forEach(r=>{var o;const i=r.attributes;(o=t.outStatistics)==null||o.forEach(({outStatisticFieldName:n})=>{if(n){const u=n.toLowerCase();u&&u in i&&n!==u&&(i[n]=i[u],delete i[u])}})}),a}async queryFeaturesJSON(t,e){return await this.load(),this.queryTask.executeJSON(t,{...e,query:this._createRequestQueryOptions(e)})}async queryObjectIds(t,e){return await this.load(),this.queryTask.executeForIds(t,{...e,query:this._createRequestQueryOptions(e)})}async queryFeatureCount(t,e){return await this.load(),this.queryTask.executeForCount(t,{...e,query:this._createRequestQueryOptions(e)})}async queryExtent(t,e){return await this.load(),this.queryTask.executeForExtent(t,{...e,query:this._createRequestQueryOptions(e)})}async queryRelatedFeatures(t,e){return await this.load(),this.queryTask.executeRelationshipQuery(t,{...e,query:this._createRequestQueryOptions(e)})}async queryRelatedFeaturesCount(t,e){return await this.load(),this.queryTask.executeRelationshipQueryForCount(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopFeatures(t,e){return await this.load(),this.queryTask.executeTopFeaturesQuery(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopObjectIds(t,e){return await this.load(),this.queryTask.executeForTopIds(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopExtents(t,e){return await this.load(),this.queryTask.executeForTopExtents(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopCount(t,e){return await this.load(),this.queryTask.executeForTopCount(t,{...e,query:this._createRequestQueryOptions(e)})}async fetchPublishingStatus(){if(!ae(this.layer.url))return"unavailable";const t=L(this.layer.url,"status"),e=await m(t,{query:{f:"json"}});return $e.fromJSON(e.data.status)}async uploadAssets(t,e){const{uploadAssets:a}=await se(()=>import("./uploadAssets-CYfQLTBV.js"),__vite__mapDeps([0,1,2,3,4,5]));return a(t,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},e)}async _asyncApplyEdits(t,e){const a=(await m(t,e)).data.statusUrl;for(;;){const s=(await m(a,{query:{f:"json"},responseType:"json"})).data;switch(s.status){case"Completed":return m(s.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new A("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new A("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await re(Te)}}_createRequestQueryOptions(t){const e={...this.layer.customParameters,token:this.layer.apiKey,...t==null?void 0:t.query};return this.layer.datesInUnknownTimezone&&(e.timeReferenceUnknownClient=!0),e}async _fetchService(t,e){if(!t){const s={};j("featurelayer-advanced-symbols")&&(s.returnAdvancedSymbols=!0),e!=null&&e.cacheBust&&(s._ts=Date.now());const{data:r}=await m(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:s,signal:e==null?void 0:e.signal}));t=r}this.sourceJSON=await this._patchServiceJSON(t,e==null?void 0:e.signal);const a=t.type;if(!ve.has(a))throw new A("feature-layer-source:unsupported-type",`Source type "${a}" is not supported`)}async _patchServiceJSON(t,e){var a;if(t.type!=="Table"&&t.geometryType&&!((a=t==null?void 0:t.drawingInfo)!=null&&a.renderer)&&!t.defaultSymbol){const s=me(t.geometryType).renderer;ie("drawingInfo.renderer",s,t)}if(t.geometryType==="esriGeometryMultiPatch"&&t.infoFor3D&&(t.geometryType="mesh"),t.extent==null)try{const{data:s}=await m(this.layer.url,this._getLayerRequestOptions({signal:e}));s.spatialReference&&(t.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:s.spatialReference})}catch(s){ne(s)}return t}async _ensureLatestMetadata(t){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...t,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(t){const{addAssetFeatures:e}=t;if(!(e!=null&&e.length))return null;const a=await this._filterRedundantAssetMaps(e);if(!(e!=null&&e.length))return null;const s=new Array,r=new Map;for(const i of a){const{geometry:o}=i,{vertexSpace:n}=o;if(de(n))s.push(o);else{const u=ce(o);r.set(u,o),i.geometry=u,s.push(u)}}await this.uploadAssets(s);for(const[i,o]of r)o.addExternalSources(i.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(a),updates:[],deletes:[]}}_getAssetMapEditsJSON(t){const e=new Array,a=this.layer.globalIdField,s=this.layer.parsedUrl;for(const r of t){const i=r.geometry,{metadata:o}=i,n=o.getExternalSourcesOnService(s),u=r.getAttribute(a);if(n.length===0){$.getLogger(this).error(`Skipping feature ${u}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}const{source:l}=n.find(pe)??n[0];for(const c of l)c.parts.length===1?e.push({globalId:oe(),parentGlobalId:u,assetName:c.assetName,assetHash:c.parts[0].partHash,flags:[]}):$.getLogger(this).error(`Skipping asset ${c.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return e}_createEditsResult(t){const e=t.data,{layerId:a}=this.layer,s=[];let r=null;if(Array.isArray(e))for(const o of e)s.push({id:o.id,editedFeatures:o.editedFeatures}),o.id===a&&(r={addResults:o.addResults??[],updateResults:o.updateResults??[],deleteResults:o.deleteResults??[],attachments:o.attachments,editMoment:o.editMoment});else r=e;const i=Oe(r);if(s.length>0){i.editedFeatureResults=[];for(const o of s){const{editedFeatures:n}=o,u=n!=null&&n.spatialReference?new ue(n.spatialReference):null;i.editedFeatureResults.push({layerId:o.id,editedFeatures:Ee(n,u)})}}return i}_createAttachmentErrorResult(t,e){var r;const a=((r=e.details.messages)==null?void 0:r[0])||e.message,s=e.details.httpStatus||e.details.messageCode;return{objectId:t,globalId:null,error:new A("feature-layer-source:attachment-failure",a,{code:s})}}_getFormDataForAttachment(t,e){const a=t instanceof FormData?t:t&&t.elements?new FormData(t):null;if(a)for(const s in e){const r=e[s];r!=null&&(a.set?a.set(s,r):a.append(s,r))}return a}_getLayerRequestOptions(t={}){const{parsedUrl:e,gdbVersion:a,dynamicDataSource:s}=this.layer;return{...t,query:{gdbVersion:a,layer:s?JSON.stringify({source:s}):void 0,...e.query,f:"json",...this._createRequestQueryOptions(t)},responseType:"json"}}async _filterRedundantAssetMaps(t){const{layer:e}=this,{globalIdField:a,infoFor3D:s,parsedUrl:r}=e;if(s==null||a==null)return t;const i=ge(s);if(i==null)return t;const o=L(r.path,`../${i.id}`),n=new Array,u=new Array;for(const d of t)d.geometry.metadata.getExternalSourcesOnService(r).length>0?u.push(d):n.push(d);const l=u.map(d=>d.getAttribute(a)).filter(M);if(l.length===0)return t;const{assetMapFieldRoles:{parentGlobalId:c,assetHash:p}}=s,f=new le;f.where=`${c} IN (${l.map(d=>`'${d}'`)})`,f.outFields=[p,c],f.returnGeometry=!1;const S=await we(o,f),{features:b}=S;return b.length===0?t:[...n,...u.filter(d=>{const I=d.getAttribute(a);if(!I)return!0;const{metadata:h}=d.geometry,y=b.filter(g=>g.getAttribute(c)===I);if(y.length===0)return!0;const R=y.map(g=>g.getAttribute(p));return h.getExternalSourcesOnService(r).flatMap(({source:g})=>g.flatMap(F=>F.parts.map(E=>E.partHash))).some(g=>R.every(F=>g!==F))})]}};_([T()],O.prototype,"type",void 0),_([T({constructOnly:!0})],O.prototype,"layer",void 0),_([T({readOnly:!0})],O.prototype,"queryTask",null),O=_([W("esri.layers.graphics.sources.FeatureLayerSource")],O);const Te=1e3,St=O;export{St as default}; diff --git a/assets/FeatureLayerView2D-Dw_5zj3d.js b/assets/FeatureLayerView2D-B6lIa9Lt.js similarity index 98% rename from assets/FeatureLayerView2D-Dw_5zj3d.js rename to assets/FeatureLayerView2D-B6lIa9Lt.js index 15f9660..a162370 100644 --- a/assets/FeatureLayerView2D-Dw_5zj3d.js +++ b/assets/FeatureLayerView2D-B6lIa9Lt.js @@ -1,4 +1,4 @@ -import{d as h,y as f,f as Z,j as Ie,a7 as Ye,E as g,aZ as lt,aS as ot,iU as ut,a as xe,ai as ct,N as C,s as q,i0 as dt,at as pe,df as et,ec as pt,ca as ht,l6 as ft,I as tt,bn as yt,bh as ae,n as fe,l7 as oe,dz as mt,l8 as G,l9 as ue,dh as N,aV as ne,b7 as ge,la as gt,bq as ke,bK as bt,g as Ee,fJ as St,z as qe,b6 as Ue,hW as Le,aX as ye,c8 as vt,lb as Be,lc as _t,ld as Je,le as wt,lf as Vt,ii as ce,jE as ve,lg as It,k as xt,bm as Et,V as Ft,q as Rt,e as De,aE as Ot,P as $t,u as zt,eN as Tt,b as _e,lh as Ct}from"./index-CEWggaxV.js";import{m as je}from"./diffUtils-B4YFa5Ju.js";import{b as He,E as we,R as H,a as At,N as Qe}from"./Container-CB7SlLB9.js";import{d as te,m as Pt}from"./FeatureEffect-ByrbZlne.js";import{d as Fe}from"./FeatureSet-CYJUZgOk.js";import{t as Mt}from"./highlightReasons-DbgbcWKM.js";import{m as Nt,u as kt}from"./LayerView-BEFTHNYv.js";import{i as Ge,r as qt}from"./TechniqueInstance-CSsTmbek.js";import{r as Ke,K as W,o as Ut,e as Lt,Z as Bt}from"./UpdateTracking2D-nj9Q-3df.js";import{b as Jt}from"./WGLContainer-B_Pv-8Yi.js";import{o as Dt}from"./tileUtils-B7X19rIS.js";import{i as M}from"./sizeVariableUtils-Cmcuvw-4.js";import{c as jt}from"./OrderByInfo-DKzv2-WS.js";import{c as Ht}from"./labelingInfo-CijajRsc.js";import{f as Qt}from"./heatmapUtils-Clt5rJzr.js";import{e as Gt}from"./SDFHelper-CSK796Wb.js";import"./LabelMetric-D2hbzzy_.js";import{n as me,h as x,c as z,d as de,e as U,f as ie,i as Re,x as be,t as Oe,m as L,g as Kt,b as Zt}from"./FeatureCommandQueue-Btq_FXyi.js";import{t as Wt}from"./HighlightCounter-abgLEfgq.js";import{o as Ze}from"./floorFilterUtils-DZ5C6FQv.js";import{p as Ve,n as Xt}from"./popupUtils-BovqErR_.js";import{i as Yt}from"./RefreshableLayerView-C1-PEoNB.js";let he=class extends Ie{constructor(){super(...arguments),this.isAggregate=!0}getEffectivePopupTemplate(e=!1){var r;if(this.popupTemplate)return this.popupTemplate;const t=(r=this.sourceLayer)==null?void 0:r.featureReduction;return t&&"popupTemplate"in t&&t.popupEnabled?t.popupTemplate:null}getObjectId(){return this.attributes.aggregateId}};h([f({type:Boolean})],he.prototype,"isAggregate",void 0),he=h([Z("esri.AggregateGraphic")],he);const $e=he;let E=class extends Ye{constructor(e){super(e),this._filter=null,this.duration=g("mapview-transitions-duration"),this._excludedEffectView=new He(e),this._includedEffectView=new He(e)}get excludedEffects(){return this._excludedEffectView.effects}set featureEffect(e){this._get("featureEffect")!==e&&this._transitionTo(e)}get filter(){var e;return this._filter||((e=this.featureEffect)==null?void 0:e.filter)||null}get hasEffects(){return this._excludedEffectView.hasEffects||this._includedEffectView.hasEffects}get includedEffects(){return this._includedEffectView.effects}set scale(e){this._set("scale",e),this._excludedEffectView.scale=e,this._includedEffectView.scale=e}get transitioning(){return this._excludedEffectView.transitioning||this._includedEffectView.transitioning}transitionStep(e,t){this._set("scale",t),this.transitioning?(this._includedEffectView.transitionStep(e,t),this._excludedEffectView.transitionStep(e,t),this.transitioning||(this._filter=null)):(this._excludedEffectView.scale=t,this._includedEffectView.scale=t)}endTransitions(){this._includedEffectView.endTransitions(),this._excludedEffectView.endTransitions(),this._filter=null}_transitionTo(e){const t=this._get("featureEffect"),r=e,s=r==null?void 0:r.includedEffect,a=r==null?void 0:r.excludedEffect,n=this._includedEffectView.canTransitionTo(s)&&this._excludedEffectView.canTransitionTo(a);this._includedEffectView.effect=s,this._excludedEffectView.effect=a,this._set("featureEffect",r),this._filter=(r==null?void 0:r.filter)||(t==null?void 0:t.filter)||null,n||this.endTransitions()}};h([f()],E.prototype,"_filter",void 0),h([f()],E.prototype,"_excludedEffectView",void 0),h([f()],E.prototype,"_includedEffectView",void 0),h([f()],E.prototype,"duration",void 0),h([f()],E.prototype,"excludedEffects",null),h([f()],E.prototype,"featureEffect",null),h([f()],E.prototype,"filter",null),h([f()],E.prototype,"hasEffects",null),h([f()],E.prototype,"includedEffects",null),h([f({value:0})],E.prototype,"scale",null),h([f()],E.prototype,"transitioning",null),E=h([Z("esri.layers.effects.FeatureEffectView")],E);const ei=E;let ee=class extends Fe{constructor(){super(...arguments),this.features=[]}readFeatures(e,t){var a;const r=ot.fromJSON(t.spatialReference),s=[];for(let n=0;n";console.debug(`Version[${e.version}] Tile[${e.id}] Chunk[${n}] RenderState.updateTile [${e.type}]`,e)}const t=this._ensureTile(e.id);if(e.type==="update"){const[n,...o]=e.modify;t.onMessage({type:"update",modify:n,remove:e.remove,end:e.end,attributeEpoch:e.attributeEpoch});for(const u of o){const l=this._tiles.get(u.tileId);l&&l.onMessage({type:"update",modify:u,remove:e.remove,end:!1,isPixelBuffer:!0,attributeEpoch:null})}return}if(e.append==null)return void t.onMessage({type:"append",clear:e.clear,debugInfo:e.debugInfo,end:e.end,attributeEpoch:e.attributeEpoch});const[r,...s]=e.append;t.onMessage({type:"append",clear:e.clear,append:r,debugInfo:e.debugInfo,end:e.end,attributeEpoch:e.attributeEpoch});for(const n of s){const o=this._tiles.get(n.tileId);o&&o.onMessage({type:"update",modify:n,remove:[],sort:!1,end:!1,isPixelBuffer:!0,attributeEpoch:null})}}removeTile(e){const t=this._tiles.get(e);g("esri-2d-update-debug")&&console.debug(`Tile[${e}] RenderState.removeTile`),t==null||t.destroy(),this._tiles.delete(e)}isTileDone(e){const t=this._tiles.get(e.id);return!!t&&t.isReady}_ensureTile(e){if(!this._tiles.has(e)){const t=this._createTile(e);this._copyPixelBufferedEntitiesInto(t),this._tiles.set(e,t)}return this._tiles.get(e)}_createTile(e){g("esri-2d-update-debug")&&console.debug(`Version[${this.version}] Tile[${e}] RenderState.createTile`);const t=new xe(e),r=this._tileInfoView.getTileBounds(ct(),t),s=this._tileInfoView.getTileResolution(t.level),a=new Jt(t,s,r[0],r[3],!0);if(a.stage=this.getStage(),!a.stage){const n=new C("featurelayerview:webgl","Cannot create tile with empty stage");q.getLogger("esri.views.2d.layers.features.RenderState").error(n)}return a}_copyPixelBufferedEntitiesInto(e){let t=7;for(let r=-1;r<=1;r++)for(let s=-1;s<=1;s++){if(r===0&&s===0)continue;const a=this._tileInfoView.tileInfo.isWrappable,n=Dt(e.key,s,r,a).id,o=this._tiles.get(n);if(o!=null){const u=1<r.needsUpload);t.length&&(t[Math.floor(Math.random()*t.length)].upload(),t.length>=2&&this.requestRender());for(const r of this._renderState.tiles())r.tryReady(this.attributeView.currentEpoch)&&(this._layerView.requestUpdate(),this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this.requestRender())}for(const t of this.children)t.setTransform(e.state);switch(this.hasAnimation&&e.painter.effects.integrate.draw(e,e.attributeView),super.renderChildren(e),e.drawPhase){case we.MAP:return this._renderMapPhase(e);case we.HIGHLIGHT:return this._renderHighlightPhase(e);case we.LABEL:return this._renderLabelPhase(e)}}subscriptions(){return this._subscriptions.values()}get _instanceStore(){return this._store}get instanceStore(){return this._store}get layerView(){return this._layerView}get hasLabels(){return this._layerView.labelingCollisionInfos.length>0}get hasHighlight(){return this._layerView.hasHighlight()}get _layer(){return this._layerView.layer}_getExclusivePostprocessingInstance({drawPhase:e}){if(this._instanceStore==null)return null;let t=0,r=null;for(const s of this._instanceStore.values())s.techniqueRef.drawPhase&e&&(t++,s.techniqueRef.postProcessingEnabled&&(r=s));return t>1?null:r}_getOverrideStencilRef({drawPhase:e}){if(this._instanceStore==null)return null;let t=null;for(const r of this._instanceStore.values()){if(!(r.techniqueRef.drawPhase&e))continue;const{overrideStencilRef:s}=r.techniqueRef;if(t==null)t=s;else if(t!==s){t=null;break}}return t}get children(){return this._renderState?Array.from(this._renderState.tiles()).filter(e=>this._visibleTiles.has(e.key.id)):[]}async updateAttributeView(e){this.requestRender(),await this.updatingHandles.addPromise(this.attributeView.requestUpdate(e)),this.hasLabels&&this._layerView.view.labelManager.requestUpdate()}updateSubscriptions(e){for(const{tileId:t,version:r}of e.subscribe)if(this._subscriptions.has(t))this._subscriptions.get(t).version=r;else{const s=new si(t,r);this._subscriptions.set(t,s),this.updatingHandles.addPromise(s.promise)}for(const t of e.unsubscribe){const r=this._subscriptions.get(t);r==null||r.destroy(),this._subscriptions.delete(t),this.removeTile(t)}}isDone(e){return!!this._renderState&&this._renderState.isTileDone(e)}async updateRenderState(e){g("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext=new ri(()=>this._stage,e,this._tileInfoView)}getDisplayStatistics(e,t){const r=this._statisticsByLevel.get(e);return r?r.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates)return void this._updateStatisticsRequests.push({level:e,statistics:t});let r=this._statisticsByLevel.get(e);r||(r=new Map,this._statisticsByLevel.set(e,r));for(const s of t)r.set(s.fieldName,{minValue:s.minValue,maxValue:s.maxValue})}editStart(){var e;(e=this._renderState)==null||e.lockUploads(),this.attributeView.lockTextureUploads(),this._lockStatisticUpdates=!0}editEnd(){var e;(e=this._renderState)==null||e.unlockUploads(),this.attributeView.unlockTextureUploads(),this._lockStatisticUpdates=!1;for(const t of this._updateStatisticsRequests)this.updateStatistics(t.level,t.statistics);this._updateStatisticsRequests=[],this.requestRender()}swapRenderState(){var e;if(this._renderStateNext&&(g("esri-2d-update-debug")&&console.debug(`Version[${this._renderStateNext.version}] FeatureContainer.update.swapRenderState`),(e=this._renderState)==null||e.destroy(),this._renderState=this._renderStateNext,this._renderStateNext=null),this._renderState)for(const t of this._renderState.tiles())t.upload();this.requestRender()}setVisibleTiles(e){this._visibleTiles=e}async onMessage(e,t){if(pe(t),!this._subscriptions.has(e.id))return;const r=this._subscriptions.get(e.id);if(r.version!==e.subscriptionVesrion){if(g("esri-2d-update-debug")){const a=`${e.subscriptionVesrion} != ${r.version}`;console.debug(`Version[${a}] Tile[${e.id}] FeatureContainer - Dropping message, outdated version]`,e)}return}const s=this._renderStateNext??this._renderState;if(!s)throw new Error("InternalError: No renderState defined");s.version!==e.version&&console.error(`InternalError: Version mismatch. [renderState: ${s.version}, message: ${e.version}]`),s.updateTile(e),e.end&&this._subscriptions.get(e.id).end(),this.requestRender(),this._layerView.view.labelManager.requestUpdate(),this._layerView.requestUpdate()}removeTile(e){(this._renderState||this._renderStateNext)&&(this._renderState&&this._renderState.removeTile(e),this._renderStateNext&&this._renderStateNext.removeTile(e))}hitTest(e){let t=this._hitTestsRequests.find(({x:s,y:a})=>s===e.x&&a===e.y);const r=et();return t?t.resolvers.push(r):(t={x:e.x,y:e.y,resolvers:[r]},this._hitTestsRequests.push(t)),this.requestRender(),r.promise}getSortKeys(e){const t=new Set(e),r=new Map;for(const s of this.children)if(s.getSortKeys(t).forEach((a,n)=>r.set(n,a)),r.size===t.size)break;return r}get hasAnimation(){return this.hasLabels}updateTransitionProperties(e,t){super.updateTransitionProperties(e,t),this._layerView.featureEffectView.transitionStep(e,t),this._layerView.featureEffectView.transitioning&&this.requestRender()}doRender(e){const{minScale:t,maxScale:r}=this._layer.effectiveScaleRange,s=e.state.scale;s<=(t||1/0)&&s>=r&&super.doRender(e)}afterRender(e){super.afterRender(e),this._hitTestsRequests.length&&this.requestRender()}setStencilReference(e){const t=this._getOverrideStencilRef(e);if(t==null)super.setStencilReference(e);else for(const r of this.children)r.stencilRef=t(r)}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,H.All),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&At(e,!1,t=>{this._renderFeatures(t,H.Highlight)})}_renderLabelPhase(e){this._renderFeatures(e,H.All)}_renderInsideEffect(e){const t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,H.InsideEffect),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){const t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,H.OutsideEffect),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){const{context:t}=e,r=e.painter.effects.hittest,s=t.getBoundFramebufferObject(),a=t.getViewport(),n=e.passOptions;r.bind(e),e.passOptions=r.createOptions(e,this._hitTestsRequests),this._renderFeatures(e,H.All),r.draw(e),r.unbind(),t.bindFramebuffer(s),t.restoreViewport(a),e.passOptions=n}_renderFeatures(e,t){for(const s of this.children){if(!s.visible)continue;const a=g("featurelayer-force-marker-text-draw-order")?Qe.STRICT_MARKERS_AND_TEXT:Qe.BATCHING,n=s.getDisplayList(e.drawPhase,this._instanceStore,a);e.selection=t,n==null||n.render(e)}const r=this._getExclusivePostprocessingInstance(e);r!=null&&r.techniqueRef.postProcess(e,r)}};async function ni(i){const e=await pt("FeaturePipelineWorker",{client:i,strategy:"dedicated"});return new li(e)}let li=class{constructor(e){this._connection=e,this.pipeline=this._connection.createInvokeProxy(),this.features=this._connection.createInvokeProxy("features"),this.aggregates=this._connection.createInvokeProxy("aggregates"),this.streamMessenger=this._connection.createInvokeProxy("streamMessenger")}destroy(){this._connection.destroy()}get closed(){return this._connection.closed}};const oi="esri.views.2d.layers.features.FeatureSourceEventLog";let T=class extends Ye{constructor(){super(...arguments),this.events=new ht,this._updatingStrategy=!0,this._tileToEvent=new ft,this._fetchStatus={outstanding:0,done:0}}get hasAllFeatures(){var e;return this._hasAllData()&&(((e=this._strategyInfo)==null?void 0:e.willQueryAllFeatures)??!1)}get hasAllFeaturesInView(){return this._hasAllData()}get hasFullGeometries(){var e;return this._hasAllData()&&(((e=this._strategyInfo)==null?void 0:e.willQueryFullResolutionGeometry)??!1)}onEvent(e){switch(e.type){case"subscribe":case"unsubscribe":case"loaded":case"error":this._handleTileEvent(e);break;case"updateStrategyStart":this._updatingStrategy=!0,this._fetchStatus={done:0,outstanding:0},this._strategyInfo=e.about;break;case"updateStrategyEnd":this._updatingStrategy=!1;break;case"updateFieldsStart":this._fetchStatus={done:0,outstanding:0};break;case"updateFieldsEnd":break;case"updateFieldsError":this.events.emit("error",e);break;case"fetchStart":this._fetchStatus.outstanding+=1,this.events.emit("status",this._fetchStatus);break;case"fetchEnd":this._fetchStatus.done+=1,this.events.emit("status",this._fetchStatus),e.done&&(this._fetchStatus={done:0,outstanding:0})}}_hasAllData(){return!this._updatingStrategy&&this._hasAllTileData()}_hasAllTileData(){for(const e of this._tileToEvent.values())if(e[e.length-1].type!=="loaded")return!1;return!0}_handleTileEvent(e){switch(e.type){case"subscribe":this._tileToEvent.set(e.tile,[e]);break;case"unsubscribe":this._tileToEvent.delete(e.tile);break;case"loaded":{const t=this._tileToEvent.get(e.tile);if(!t)return;t.push(e),this._tileToEvent.set(e.tile,t);break}case"error":{const t=this._tileToEvent.get(e.tile);if(!t)return;t.push(e),this._tileToEvent.set(e.tile,t),this.events.emit("error",e);break}}}};h([f({readOnly:!0})],T.prototype,"hasAllFeatures",null),h([f({readOnly:!0})],T.prototype,"hasAllFeaturesInView",null),h([f({readOnly:!0})],T.prototype,"hasFullGeometries",null),h([f()],T.prototype,"_updatingStrategy",void 0),h([f()],T.prototype,"_strategyInfo",void 0),h([f()],T.prototype,"_tileToEvent",void 0),T=h([Z(oi)],T);function P(i){switch(i.geometryType){case"point":return"esriGeometryPoint";case"polyline":return"esriGeometryPolyline";case"polygon":case"multipatch":return"esriGeometryPolygon";case"multipoint":return"esriGeometryMultipoint";default:return null}}function R(i,e){const t=i.featureReduction;return t&&t.type!=="selection"&&(!("maxScale"in t)||!t.maxScale||t.maxScale=r?n:a+s*(n-a)}function hi(i,e){const t=i/e.minDataValue,r=O(e.minSize,i),s=O(e.maxSize,i);let a=null;return a=t*r,tt(a,r,s)}function fi(i,e){const[t,r,s]=mi(i,e.cache.ipData);if(t===r)return O(e.stops[t].size,i);{const a=O(e.stops[t].size,i);return a+(O(e.stops[r].size,i)-a)*s}}function yi(i,e){const t=yt[e.valueUnit],r=O(e.minSize,i),s=O(e.maxSize,i),{valueRepresentation:a}=e;let n=null;return n=a==="area"?2*Math.sqrt(i/ui)/t:a==="radius"||a==="distance"?2*i/t:i/t,tt(n,r,s)}function mi(i,e){if(!e)return;let t=0,r=e.length-1;return e.some((s,a)=>it.deconflictionStrategy!=="none")))??!1}function X(i,e){var r;const t=R(i,e);if(t!=null&&t.labelsVisible&&((r=t.labelingInfo)!=null&&r.length))return t.labelingInfo.every(s=>s.deconflictionStrategy!=="none")}function gi(i){return e=>ae(it(e,i))}function B(i){const e=i!=null&&"visualVariables"in i&&i.visualVariables;if(!e)return null;for(const t of e)if(t.type==="size")return gi(t);return null}function J(i,e,t,r,s){var u,l;const a=e.subtypeCode!=null?`${e.subtypeField} = ${e.subtypeCode}`:null,n=fe(e.definitionExpression,a),o=e.customParameters??{};return s&&(o.token=s),{type:"feature",mutable:{sourceRefreshVersion:r,availableFields:t.availableFields,dataFilter:{definitionExpression:n,gdbVersion:e.gdbVersion,historicMoment:(u=e.historicMoment)==null?void 0:u.getTime(),outSpatialReference:t.outSpatialReference.toJSON(),timeExtent:(l=e.timeExtent)==null?void 0:l.toJSON(),customParameters:o}},service:i,tileInfoJSON:t.tileInfoJSON}}function bi(i,e,t=0){if(e==null)return i[t]=0,i[t+1]=0,i[t+2]=0,void(i[t+3]=0);const{r,g:s,b:a,a:n}=e;i[t]=r*n/255,i[t+1]=s*n/255,i[t+2]=a*n/255,i[t+3]=n}async function A(i,e){if(!i)return[];switch(i.type){case"simple-fill":return st(i,e);case"picture-fill":return Oi(i,e);case"simple-marker":return wi(i,e);case"picture-marker":return Vi(i,e);case"simple-line":return le(i,e,!1);case"text":return xi(i,e);case"label":return Ei(i,e);case"cim":return me(i.data,e);case"web-style":{const t=await i.fetchCIMSymbol();return me(t.data,e)}default:throw new Error(`symbol not supported ${i.type}`)}}async function Si(i,e){const{schemaOptions:t}=e,{store:r}=t,s=new Array(oe),a=new Array(oe/4);for(let l=0;lde(c.color)),visualVariableOpacity:s.visualVariableOpacity,visualVariableSizeMinMaxValue:s.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:s.visualVariableSizeScaleStops,visualVariableSizeStops:s.visualVariableSizeStops,visualVariableSizeUnitValue:s.visualVariableSizeUnitValue,hittestUniforms:null},numberOfFields:i.attributes.length},{}).createMeshInfo({params:{size:i.size,outlineWidth:r,effects:null,scaleInfo:null,minPixelBuffer:U(s)}});return[...i.backgroundFillSymbol?st(i.backgroundFillSymbol,{schemaOptions:e,path:"",uniforms:be}):[],a]}function rt(i){if(i.style==="path"){if(i.path==null)throw new Error("Symbol with a style of type path must define a path");return{type:"sprite-rasterization-param",overrides:[],resource:{type:"path",path:i.path,asFill:!0}}}const e=W.fromSimpleMarker(i);if("outline"in i&&i.outline&&i.outline.style!=="none"&&i.outline.style!=="solid"){if(!e||!e.symbolLayers)throw new Error("Error handling marker! ");return{type:"sprite-rasterization-param",resource:e.symbolLayers[0],overrides:[]}}return{type:"sprite-rasterization-param",resource:Gt(e),overrides:[]}}async function wi(i,e){var p,y,m,b,V;const{uniforms:t,schemaOptions:r}=e,{store:s}=r;if(i.style==="path"||i.outline&&i.outline.style!=="solid"&&i.outline.style!=="none"){const S=W.fromSimpleMarker(i);if(!S||!S.symbolLayers)throw new Error("Error handling marker! ");if(t.visualVariableRotation&&(S.angleAlignment="Map"),i.style!=="path"){const w=S.symbolLayers[0];if(ie(e.uniforms)){const v=U(e.uniforms,0,1);if(v>w.size){const F=v/w.size;w.size=v;const $=(p=w.markerGraphics)==null?void 0:p[0].symbol;($.symbolLayers&&$.symbolLayers[0]).width*=F}}}return me({type:"CIMSymbolReference",symbol:S},e)}const a=s.ensureInstance(x.marker,{geometry:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue,visualVariableRotation:t.visualVariableRotation}},{zoomRange:!1}),n=rt(i);let o=((y=i.color)==null?void 0:y.toArray())??[0,0,0,0];n.resource.type==="CIMVectorMarker"&&(o=[255,255,255,255]);const u=i.style==="triangle"?124/116:1,l=i.size,c=l*u,d=t.visualVariableColor!=null&&(i.style==="cross"||i.style==="x");return[a.createMeshInfo({params:{type:"simple",color:o,height:l,width:c,offsetX:i.xoffset,offsetY:i.yoffset,angle:i.angle,alignment:Re(t)?G.MAP:G.SCREEN,outlineColor:((b=(m=i.outline)==null?void 0:m.color)==null?void 0:b.toArray())??[0,0,0,0],outlineSize:((V=i.outline)==null?void 0:V.width)??1,referenceSize:l,sprite:n,overrideOutlineColor:d,hasSizeVV:ie(t),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:U(t)}})]}function Vi(i,e){const{uniforms:t,schemaOptions:r}=e,{store:s}=r,a=s.ensureInstance(x.marker,{geometry:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue,visualVariableRotation:t.visualVariableRotation}},{zoomRange:!1}),n=W.createPictureMarkerRasterizationParam(i);return n?[a.createMeshInfo({params:{type:"picture",color:[255,255,255,255],height:i.height,width:i.width,offsetX:i.xoffset,offsetY:i.yoffset,angle:i.angle,alignment:Re(t)?G.MAP:G.SCREEN,outlineColor:null,outlineSize:0,referenceSize:i.height,sprite:n,overrideOutlineColor:!1,hasSizeVV:ie(t),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:U(t)}})]:[]}function Ii(i,e,t){var b,V;const{uniforms:r,schemaOptions:s}=t,{store:a}=s,n=a.ensureInstance(x.marker,{geometry:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue,visualVariableRotation:r.visualVariableRotation}},{zoomRange:!1}),o=rt(i),u=6,l=u*e.width,c=l,d=((b=i.color)==null?void 0:b.toArray())??((V=e.color)==null?void 0:V.toArray())??[0,0,0,0],p=i.style==="cross"||i.style==="x";let y;switch(i.placement){case"begin-end":y=ue.Both;break;case"begin":y=ue.JustBegin;break;case"end":y=ue.JustEnd;break;default:y=ue.None}const m={type:"cim-marker-placement-info",placement:{type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:y,offsetAlongLine:0},overrides:[]};return[n.createMeshInfo({params:{type:"simple",color:d,height:c,width:l,offsetX:0,offsetY:0,angle:0,alignment:Re(r)?G.MAP:G.SCREEN,outlineColor:d,outlineSize:p?e.width:0,referenceSize:c/u,sprite:o,overrideOutlineColor:p&&r.visualVariableColor!=null,hasSizeVV:ie(r),placement:m,transforms:null,effects:null,scaleInfo:null,minPixelBuffer:U(r)}})]}function xi(i,e){var a,n,o,u;const{uniforms:t,schemaOptions:r}=e,{store:s}=r;return[s.ensureInstance(x.text,{geometry:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableRotation:t.visualVariableRotation,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue}},{zoomRange:!1,clipAngle:!1,referenceSymbol:!1}).createMeshInfo({params:{boxBackgroundColor:(a=i.backgroundColor)==null?void 0:a.toArray(),boxBorderLineColor:(n=i.borderLineColor)==null?void 0:n.toArray(),boxBorderLineSize:i.borderLineSize??0,color:((o=i.color)==null?void 0:o.toArray())??[0,0,0,0],offsetX:i.xoffset,offsetY:i.yoffset,postAngle:i.angle,fontSize:i.font.size,decoration:i.font.decoration,haloColor:((u=i.haloColor)==null?void 0:u.toArray())??[0,0,0,0],haloFontSize:i.haloSize??0,lineWidth:i.lineWidth,lineHeightRatio:i.lineHeight,horizontalAlignment:i.horizontalAlignment,verticalAlignment:i.verticalAlignment,useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:i.font.toJSON(),textString:i.text,symbol:W.createCIMTextSymbolfromTextSymbol(i)},overrides:[]},referenceSize:null,effects:null,placement:null,scaleInfo:null,transforms:null,scaleFactor:1,minPixelBuffer:U(t),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,isLineLabel:!1}})]}function Ei(i,e){var m,b,V,S,w,v;const{schemaOptions:t,uniforms:r}=e,{store:s}=t,a=i.symbol,{allowOverrun:n,repeatLabel:o,repeatLabelDistance:u}=i,l={maxScale:i.maxScale??0,minScale:i.minScale??0},c=s.ensureInstance(x.label,{geometry:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:r.visualVariableRotation,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue}},{zoomRange:!0,clipAngle:!0,referenceSymbol:!0}),d=i.labelPlacement,[p,y]=Ut(d);return[c.createMeshInfo({params:{boxBackgroundColor:(m=a.backgroundColor)==null?void 0:m.toArray(),boxBorderLineColor:(b=a.borderLineColor)==null?void 0:b.toArray(),boxBorderLineSize:a.borderLineSize??0,color:((V=a.color)==null?void 0:V.toArray())??[0,0,0,0],offsetX:a.xoffset,offsetY:a.yoffset,postAngle:a.angle,fontSize:a.font.size,decoration:a.font.decoration,haloColor:((S=a.haloColor)==null?void 0:S.toArray())??[0,0,0,0],haloFontSize:a.haloSize??0,lineWidth:a.lineWidth,lineHeightRatio:a.lineHeight,horizontalAlignment:p,verticalAlignment:y,repeatLabel:o,repeatLabelDistance:ae(u),allowOverrun:n,labelPosition:i.labelPosition,scaleInfo:l,minPixelBuffer:U(r),useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:a.font.toJSON(),textString:a.text,symbol:W.createCIMTextSymbolfromTextSymbol(a),primitiveName:"label-override"},useLegacyLabelEvaluationRules:((w=i.labelExpressionInfo)==null?void 0:w.expression)==null,overrides:[{type:"CIMPrimitiveOverride",valueExpressionInfo:{type:"CIMExpressionInfo",expression:((v=i.labelExpressionInfo)==null?void 0:v.expression)??i.labelExpression,returnType:"String"},primitiveName:"label-override",propertyName:"textString",defaultValue:""}]},referenceSize:null,effects:null,placement:null,transforms:null,scaleFactor:1,isLineLabel:!1}})]}function ze(i,e){var r;const t=i.width;return{outlineColor:((r=i.color)==null?void 0:r.toArray())||[0,0,0,1],width:t,referenceWidth:t,capType:i.cap??"round",joinType:i.join??"round",miterLimit:i.miterLimit,hasSizeVV:e}}function Fi(i,e){var l,c,d;const{uniforms:t,schemaOptions:r}=e,{store:s}=r,a=((l=i.color)==null?void 0:l.toArray())??[0,0,0,0],n={type:"sprite-rasterization-param",resource:{type:"fill-style",style:i.style},overrides:[]};if(((c=i.outline)==null?void 0:c.style)==="solid")return[s.ensureInstance(x.patternOutlineFill,{geometry:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeScaleStops:t.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null}},{zoomRange:!1}).createMeshInfo({params:{color:a,...ze(i.outline,!!t.visualVariableSizeOutlineScaleStops),sprite:n,scaleInfo:null,effects:null}})];const o=[],u=s.ensureInstance(x.patternFill,{geometry:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity}},{zoomRange:!1}).createMeshInfo({params:{color:((d=i.color)==null?void 0:d.toArray())??[0,0,0,0],sprite:n,scaleInfo:null,effects:null}});return o.push(u),i.outline&&o.push(...le(i.outline,e,!0)),o}function Ri(i,e){var o,u;const{uniforms:t,schemaOptions:r}=e,{store:s}=r,a=((o=i.color)==null?void 0:o.toArray())??[0,0,0,0];if(i.style!=="none"&&((u=i.outline)==null?void 0:u.style)==="solid")return[s.ensureInstance(x.outlineFill,{geometry:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeScaleStops:t.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null}},{zoomRange:!1}).createMeshInfo({params:{color:a,...ze(i.outline,!!t.visualVariableSizeOutlineScaleStops),scaleInfo:null,effects:null}})];const n=[];if(i.style!=="none"){const l=s.ensureInstance(x.fill,{geometry:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity}},{zoomRange:!1}).createMeshInfo({params:{color:a,scaleInfo:null,effects:null}});n.push(l)}return i.outline&&n.push(...le(i.outline,e,!0)),n}function st(i,e){const{style:t}=i;return t&&t!=="none"&&t!=="solid"?Fi(i,e):Ri(i,e)}function Oi(i,e){const{outline:t}=i,{uniforms:r,schemaOptions:s}=e,{store:a}=s,n=[],o=W.createPictureFillRasterizationParam(i);if(!o)return[];const{width:u,height:l,xoffset:c,yoffset:d,xscale:p,yscale:y}=i,m={color:[255,255,255,255],sprite:o,height:l,aspectRatio:u/l,offsetX:c,offsetY:d,scaleX:p,scaleY:y,angle:0,applyRandomOffset:!1,sampleAlphaOnly:!1,scaleProportionally:!1,effects:null,scaleInfo:null};if((t==null?void 0:t.style)==="solid")return[a.ensureInstance(x.complexOutlineFill,{geometry:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null}},{zoomRange:!1}).createMeshInfo({params:{...m,...ze(t,!!r.visualVariableSizeOutlineScaleStops)}})];const b=a.ensureInstance(x.complexFill,{geometry:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity}},{zoomRange:!1});return n.push(b.createMeshInfo({params:m})),t&&n.push(...le(t,e,!0)),n}function le(i,e,t){const{color:r,style:s,width:a,cap:n,join:o}=i,{schemaOptions:u}=e,{store:l}=u,c=[],d=t?{...be,visualVariableSizeScaleStops:e.uniforms.visualVariableSizeOutlineScaleStops}:e.uniforms,p={geometry:{visualVariableColor:d.visualVariableColor,visualVariableOpacity:d.visualVariableOpacity,visualVariableSizeMinMaxValue:d.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:d.visualVariableSizeScaleStops,visualVariableSizeStops:d.visualVariableSizeStops,visualVariableSizeUnitValue:d.visualVariableSizeUnitValue}},y={color:(r==null?void 0:r.toArray())??[0,0,0,0],width:a,referenceWidth:a,capType:n,joinType:o,miterLimit:i.miterLimit,hasSizeVV:ie(d),effects:null,scaleInfo:null};if(s==null||s==="solid"){const m=l.ensureInstance(x.line,p,{zoomRange:!1}).createMeshInfo({params:y});c.push(m)}else if(s!=="none"){const m=l.ensureInstance(x.texturedLine,p,{zoomRange:!1}).createMeshInfo({params:{...y,shouldScaleDash:!0,shouldSampleAlphaOnly:!1,isSDF:!0,sprite:{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:Lt(s,n),capStyle:Bt(n)},overrides:[]}}});c.push(m)}return i.marker!=null&&c.push(...Ii(i.marker,i,e)),c}async function re(i,e,t){const r=e.labelsVisible&&e.labelingInfo||[],s=P(e),a=Ht(r,s);return{type:"label",classes:await Promise.all(a.map((n,o)=>$i(i,n,o,t)))}}async function $i(i,e,t,r){var a;const s=await A(e,{path:`${t}`,schemaOptions:i,uniforms:r});return{maxScale:e.maxScale,minScale:e.minScale,expression:((a=e.labelExpressionInfo)==null?void 0:a.expression)??e.labelExpression,where:e.where,meshes:s}}async function se(i,e){if(!e)return{type:"simple",meshes:[]};switch(e.type){case"simple":return zi(i,e);case"dot-density":return Ti(i,e);case"class-breaks":return Ci(i,e);case"unique-value":return Ai(i,e);case"dictionary":return Pi(e);case"heatmap":return Mi(i,e);case"pie-chart":return Ni(i,e)}}async function zi(i,e){const t=e.getSymbols(),r=t.length?t[0]:null,s=z(e);return{type:"simple",meshes:await A(r,{schemaOptions:i,uniforms:s,path:"renderer.symbol"})}}async function Ti(i,e){const t=z(e);return{type:"dot-density",meshes:await Si(e,{schemaOptions:i,uniforms:t,path:"renderer.symbol"})}}async function Ci(i,e){const t=z(e),r=e.backgroundFillSymbol,s=e.normalizationType,a=s==="log"?"esriNormalizeByLog":s==="percent-of-total"?"esriNormalizeByPercentOfTotal":s==="field"?"esriNormalizeByField":null,n=e.classBreakInfos.map(async c=>({meshes:await A(c.symbol,{path:`renderer-stop-${c.minValue}-${c.maxValue}`,schemaOptions:i,uniforms:t}),min:c.minValue,max:c.maxValue})),o=(await Promise.all(n)).sort((c,d)=>c.min-d.min),u=await A(r,{schemaOptions:i,path:"renderer.backgroundFill",uniforms:{...be,visualVariableSizeOutlineScaleStops:t.visualVariableSizeOutlineScaleStops}}),l=await A(e.defaultSymbol,{schemaOptions:i,path:"renderer.defaultSymbol",uniforms:t});return{type:"interval",field:e.field,expression:e.valueExpression,backgroundFill:u,defaultSymbol:l,intervals:o,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,normalizationType:a,isMaxInclusive:e.isMaxInclusive}}async function Ai(i,e){const t=[],r=z(e),s=await A(e.backgroundFillSymbol,{schemaOptions:i,path:"renderer.backgroundFill",uniforms:{...be,visualVariableSizeOutlineScaleStops:r.visualVariableSizeOutlineScaleStops}}),a=await A(e.defaultSymbol,{schemaOptions:i,path:"renderer.defaultSymbol",uniforms:r});for(const n of e.uniqueValueInfos??[]){const o=await A(n.symbol,{path:`renderer-unique-value-${n.value}`,schemaOptions:i,uniforms:r});t.push({value:""+n.value,symbol:o})}return{type:"map",field:e.field,expression:e.valueExpression,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,backgroundFill:s,defaultSymbol:a,map:t}}function Pi(i){const e=z(i),t=i.scaleExpression,r=t!=null&&t!=="1"?{valueExpressionInfo:{type:"CIMExpressionInfo",expression:i.scaleExpression,returnType:"Numeric"},defaultValue:1}:void 0;return{type:"dictionary",fieldMap:i.fieldMap,scaleExpression:r,visualVariableUniforms:e}}async function Mi(i,e){return{type:"heatmap",meshes:await vi(e,i)}}async function Ni(i,e){return{type:"pie-chart",meshes:_i(e,i)}}async function ki(i,e){const t=e.renderer,r=z(t);return{symbology:await se(i,t),labels:await re(i,e,r)}}async function D(i,e,t,r){const s=t.featureReduction;if(s)switch(s.type){case"binning":return Ui(s,i,e,t,r);case"cluster":return Li(s,i,e,t,r)}const a=Bi(t.orderBy,t.renderer,t.objectIdField);return{storage:Oe(t.renderer,e.filters),mesh:{displayRefreshVersion:r,strategy:{type:"feature"},factory:await ki(i,t),sortKey:a,timeZone:e.timeZone}}}function at(i,e){return i.fields.map(t=>({...t.toJSON(),type:qi(t,e)}))}function qi(i,e){const{onStatisticExpression:t,onStatisticField:r,statisticType:s}=i;switch(s){case"min":case"max":case"avg":case"avg_angle":case"sum":case"count":return"esriFieldTypeDouble";case"mode":{if(t){const{returnType:n}=t;return n?n==="string"?"esriFieldTypeString":"esriFieldTypeDouble":"esriFieldTypeString"}const a=e.find(n=>n.name===r);return a?a.type:"esriFieldTypeString"}}}async function Ui(i,e,t,r,s){const a=at(i,r.fields),n=i.renderer,o=await se(e,n),u=Oe(n,[null,null]),l=z(n),c=await re(e,{geometryType:"polygon",labelingInfo:i.labelingInfo,labelsVisible:i.labelsVisible},l);return{storage:u,mesh:{displayRefreshVersion:s,strategy:{type:"binning",fields:a,fixedBinLevel:i.fixedBinLevel,featureFilter:t.filters[0]},factory:{labels:c,symbology:o},sortKey:null,timeZone:t.timeZone}}}async function Li(i,e,t,r,s){const a=at(i,r.fields),n={type:"cluster",feature:await se(e,i.effectiveFeatureRenderer),cluster:await se(e,i.effectiveClusterRenderer)},o=z(i.effectiveFeatureRenderer),u={type:"cluster",feature:await re(e,r,o),cluster:await re(e,{geometryType:"point",labelingInfo:i.labelingInfo,labelsVisible:i.labelsVisible},o)};return{storage:Oe(i.effectiveFeatureRenderer,[null,null]),mesh:{displayRefreshVersion:s,strategy:{type:"cluster",fields:a,featureFilter:t.filters[0],clusterRadius:ae(i.clusterRadius/2)},factory:{labels:u,symbology:n},sortKey:null,timeZone:t.timeZone}}}function Bi(i,e,t){const r=e!=null&&e.type==="unique-value"&&e.orderByClassesEnabled;if(i!=="default"||r||(i=[new jt({field:t,order:"descending"})]),i!=="default"&&i.length){i.length;const s=i[0],a=s.order==="ascending"?"asc":"desc";return s.field?{field:s.field,order:a}:s.valueExpression?{expression:s.valueExpression,order:a}:null}return r?{byRenderer:!0,order:"asc"}:null}let Ji=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=k(t);return[{vvEvaluators:{0:B(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(e){var v,F;const t=this.layer,r=t.parent,s=N(r),{capabilities:a,editingInfo:n,objectIdField:o,globalIdField:u,datesInUnknownTimezone:l,orderBy:c,subtypeField:d,parsedUrl:p}=r,y=r.fieldsIndex.toJSON(),m=P(t),b=(v=r.timeInfo)==null?void 0:v.toJSON(),V=t.spatialReference.toJSON(),S=ne(p);let w=o;if(c!=null&&c.length){const $=!c[0].valueExpression&&c[0].field;$&&(w=$)}return{type:"feature-service",source:S,isSourceHosted:ge(S.path),orderByFields:w,metadata:{timeReferenceUnknownClient:l,subtypeField:d,globalIdField:u,fieldsIndex:y,geometryType:m,objectIdField:o,timeInfo:b,spatialReference:V,subtypes:null,typeIdField:null,types:null},queryMetadata:{capabilities:a,effectiveCapabilities:s,lastEditDate:(F=n==null?void 0:n.lastEditDate)==null?void 0:F.getTime(),snapshotInfo:null}}}createSourceSchema(e,t,r){const{definitionExpression:s,customParameters:a,timeExtent:n,apiKey:o}=this.layer.parent;return J(e,{definitionExpression:s,customParameters:a,timeExtent:n},t,r,o)}createProcessorSchema(e,t,r){const{parent:{fields:s,geometryType:a,orderBy:n,objectIdField:o},renderer:u,labelingInfo:l,labelsVisible:c}=this.layer,d={featureReduction:null,fields:s.map(p=>p.toJSON()),geometryType:a,labelingInfo:l,labelsVisible:c,objectIdField:o,orderBy:n??"default",renderer:u==null?void 0:u.clone()};return D(e,t,d,r)}get hasRequiredSupport(){return L(this.layer.renderer)}getUpdateHashProperties(e){const t=this.layer,{parent:r,parent:{definitionExpression:s,apiKey:a},renderer:n}=t,o=this.layer.labelsVisible?this.layer.labelingInfo:null;return{apiKey:a,customParameters:JSON.stringify(r.customParameters),definitionExpression:s,labelingInfo:o,orderBy:JSON.stringify(r.orderBy),renderer:n}}setGraphicOrigin(e){e.origin={type:"catalog",layer:this.layer}}};function Te(i,e){const t=i.extent,r=e==null?void 0:e.clone().intersection(t),s=r!=null?r.width*r.height:0,a=e?e.width*e.height:0,n=a===0?0:s/a,o=g("featurelayer-snapshot-point-coverage");return!isNaN(n)&&n>=o}function K(i,e){return i.floorInfo!=null&&(i.floorInfo.viewAllLevelIds.length>0||e.floors.length>0)}function Ce(i,e,t){const r=Di(i,e==null?void 0:e.where,t);return r&&(e??(e=new te),e.where=r),e}function Di(i,e,t){var u;if(i.floorInfo==null||!((u=t.floors)!=null&&u.length))return e;let r=t.floors;const{floorField:s,viewAllLevelIds:a}=i.floorInfo;a.length&&(r=a);const n=r.filter(l=>l!=="").map(l=>"'"+l+"'");if(n.push("''"),e==null?void 0:e.includes(s)){let l=new RegExp("AND \\("+s+".*NULL\\)","g");e=e.replace(l,""),l=new RegExp("\\("+s+".*NULL\\)","g"),e=(e=e.replace(l,"")).replaceAll(/\s+/g," ").trim()}let o="("+s+" IN ({ids}) OR "+s+" IS NULL)";return o=o.replace("{ids}",n.join(", ")),fe(e,o)}let ji=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=X(t,e)??k(t);return[{vvEvaluators:{0:B(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(e){var Ae,Pe,Me,Ne;const t=this.layer,r=N(t),{capabilities:s,editingInfo:a,objectIdField:n,typeIdField:o,globalIdField:u,datesInUnknownTimezone:l,orderBy:c,subtypeField:d,refreshInterval:p}=t,y=t.fieldsIndex.toJSON(),m=y.fields,b=P(t),V=(Ae=t.timeInfo)==null?void 0:Ae.toJSON(),S=t.spatialReference.toJSON(),w=(Pe=t.types)==null?void 0:Pe.map(j=>j.toJSON()),v=ne(this.layer.parsedUrl);this.layer.dynamicDataSource&&(v.query={layer:JSON.stringify({source:this.layer.dynamicDataSource})});let F=this.layer.objectIdField;if(c!=null&&c.length){const j=!c[0].valueExpression&&c[0].field;j&&(F=j)}const $=(a==null?void 0:a.lastEditDate)==null&&p>0,Y=g("featurelayer-snapshot-enabled")&&t.geometryType==="point"&&(s==null?void 0:s.query.supportsPagination)&&!(s!=null&&s.operations.supportsEditing)&&!$,Se=Y&&Te(e,t.fullExtent);return{type:"feature-service",source:v,isSourceHosted:ge(v.path),orderByFields:F,metadata:{typeIdField:o??void 0,types:w,timeReferenceUnknownClient:l,subtypeField:d,globalIdField:u,fields:m,fieldsIndex:y,geometryType:b,objectIdField:n,timeInfo:V,spatialReference:S,subtypes:(Me=this.layer.subtypes)==null?void 0:Me.map(j=>j.toJSON())},queryMetadata:{capabilities:s,effectiveCapabilities:r,lastEditDate:(Ne=a==null?void 0:a.lastEditDate)==null?void 0:Ne.getTime(),snapshotInfo:{supportsSnapshotMinThreshold:Y,supportsSnapshotMaxThreshold:Se,snapshotCountThresholds:{min:g("featurelayer-snapshot-point-min-threshold"),max:g("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t,r){const{definitionExpression:s,customParameters:a,gdbVersion:n,historicMoment:o,subtypeCode:u,subtypeField:l,timeExtent:c,apiKey:d}=this.layer;return J(e,{definitionExpression:s,customParameters:a,gdbVersion:n,historicMoment:o,subtypeCode:u,subtypeField:l,timeExtent:c},t,r,d)}createProcessorSchema(e,t,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:u,orderBy:l,objectIdField:c}=this.layer,d={fields:s.map(p=>p.toJSON()),renderer:a==null?void 0:a.clone(),featureReduction:R(this.layer,t),geometryType:n,labelingInfo:o,labelsVisible:u,objectIdField:c,orderBy:l??"default"};return D(e,t,d,r)}get hasRequiredSupport(){return L(this.layer.renderer)}hasFilters(e){return K(this.layer,e)}addFilters(e,t){return Ce(this.layer,e,t)}getUpdateHashProperties(e){var y,m;const t=this.layer,{definitionExpression:r,renderer:s,gdbVersion:a,apiKey:n,subtypeCode:o}=t,u=this.layer.labelsVisible?this.layer.labelingInfo:null,l=((y=t.historicMoment)==null?void 0:y.getTime())??void 0,c=JSON.stringify(t.customParameters),d=(m=R(t,e))==null?void 0:m.toJSON(),p=JSON.stringify(t.orderBy);return{apiKey:n,customParameters:c,definitionExpression:r,featureReduction:d,floors:K(this.layer,e)?e.floors:null,gdbVersion:a,historicMoment:l,labelingInfo:u,orderBy:p,renderer:s,subtypeCode:o}}};function Hi(i){if(!("openPorts"in i))throw new C("source-not-supported")}class We{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=X(t,e)??k(t);return[{vvEvaluators:{0:B(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(e){var c;const t=this.layer,r=N(t),{capabilities:s,objectIdField:a}=t,n=t.fieldsIndex.toJSON(),o=P(t),u=(c=t.timeInfo)==null?void 0:c.toJSON(),l=t.spatialReference.toJSON();return Hi(t.source),{type:"memory",source:await t.source.openPorts(),orderByFields:a,metadata:{fieldsIndex:n,geometryType:o,objectIdField:a,timeInfo:u,spatialReference:l,subtypes:null,subtypeField:null,globalIdField:null,typeIdField:null,types:null,timeReferenceUnknownClient:null},queryMetadata:{capabilities:s,effectiveCapabilities:r,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,t,r){const{definitionExpression:s,timeExtent:a}=this.layer;return J(e,{definitionExpression:s,timeExtent:a,customParameters:null},t,r,null)}createProcessorSchema(e,t,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:u,orderBy:l,objectIdField:c}=this.layer,d={fields:s.map(p=>p.toJSON()),renderer:a==null?void 0:a.clone(),featureReduction:R(this.layer,t),geometryType:n,labelingInfo:o,labelsVisible:u,objectIdField:c,orderBy:l??"default"};return D(e,t,d,r)}get hasRequiredSupport(){return L(this.layer.renderer)}getUpdateHashProperties(e){var o;const t=this.layer,{definitionExpression:r,renderer:s}=t,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=(o=R(t,e))==null?void 0:o.toJSON();return{orderBy:JSON.stringify(t.orderBy),definitionExpression:r,renderer:s,labelingInfo:a,featureReduction:n}}}let Qi=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=X(t,e)??k(t);return[{vvEvaluators:{0:B(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(e){const t=this.layer,r=N(t),{capabilities:s,objectIdField:a}=t,n=t.fieldsIndex.toJSON(),o=P(t),u=t.spatialReference.toJSON();return{type:"memory",source:await t.source.openPorts(),orderByFields:a,metadata:{fieldsIndex:n,geometryType:o,objectIdField:a,spatialReference:u,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null},queryMetadata:{capabilities:s,effectiveCapabilities:r,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,t,r){const{definitionExpression:s}=this.layer;return J(e,{definitionExpression:s,customParameters:null},t,r,null)}createProcessorSchema(e,t,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:u,objectIdField:l}=this.layer,c={fields:s.map(d=>d.toJSON()),renderer:a==null?void 0:a.clone(),featureReduction:R(this.layer,t),geometryType:n,labelingInfo:o,labelsVisible:u,objectIdField:l,orderBy:"default"};return D(e,t,c,r)}get hasRequiredSupport(){return L(this.layer.renderer)}getUpdateHashProperties(e){var o;const t=this.layer,{definitionExpression:r,renderer:s}=t,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=(o=R(t,e))==null?void 0:o.toJSON();return{definitionExpression:r,renderer:s,labelingInfo:a,featureReduction:n}}},Gi=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=X(t,e)??k(t);return[{vvEvaluators:{0:B(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(e){var y;const t=this.layer,r=N(t),{capabilities:s,objectIdField:a}=t,n=t.fieldsIndex.toJSON(),o=P(t),u=(y=t.timeInfo)==null?void 0:y.toJSON(),l=t.spatialReference.toJSON(),c=t.source.getSource(),d=this.layer.objectIdField,p=ne(s);return p.query.maxRecordCount=c.maxRecordCount,{type:"ogc",source:c,orderByFields:d,metadata:{fieldsIndex:n,geometryType:o,objectIdField:a,timeInfo:u,spatialReference:l,globalIdField:null,subtypeField:null,subtypes:null,timeReferenceUnknownClient:null,typeIdField:null,types:null},queryMetadata:{capabilities:p,effectiveCapabilities:r,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,t,r){const{customParameters:s,timeExtent:a,apiKey:n}=this.layer;return J(e,{customParameters:s,timeExtent:a},t,r,n)}createProcessorSchema(e,t,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:u,orderBy:l,objectIdField:c}=this.layer,d={fields:s.map(p=>p.toJSON()),renderer:a==null?void 0:a.clone(),featureReduction:R(this.layer,t),geometryType:n,labelingInfo:o,labelsVisible:u,objectIdField:c,orderBy:l??"default"};return D(e,t,d,r)}get hasRequiredSupport(){return L(this.layer.renderer)}getUpdateHashProperties(e){var u;const t=this.layer,{renderer:r,apiKey:s}=t,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=JSON.stringify(t.customParameters),o=(u=R(t,e))==null?void 0:u.toJSON();return{apiKey:s,customParameters:n,featureReduction:o,labelingInfo:a,orderBy:JSON.stringify(t.orderBy),renderer:r}}},Ki=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=X(t,e)??k(t);return[{vvEvaluators:{0:B(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(e){var v;const t=this.layer,r=N(t),{capabilities:s,objectIdField:a,globalIdField:n,orderBy:o,refreshInterval:u}=t,l=t.fieldsIndex.toJSON(),c=l.fields,d=P(t),p=(v=t.timeInfo)==null?void 0:v.toJSON(),y=t.spatialReference.toJSON(),m=ne(this.layer.parsedUrl);let b=this.layer.objectIdField;if(o!=null&&o.length){const F=!o[0].valueExpression&&o[0].field;F&&(b=F)}const V=u>0,S=g("featurelayer-snapshot-enabled")&&t.geometryType==="point"&&(s==null?void 0:s.query.supportsPagination)&&!(s!=null&&s.operations.supportsEditing)&&!V,w=S&&Te(e,t.fullExtent);return{type:"feature-service",source:m,isSourceHosted:ge(m.path),orderByFields:b,metadata:{globalIdField:n,fields:c,fieldsIndex:l,geometryType:d,objectIdField:a,timeInfo:p,spatialReference:y,timeReferenceUnknownClient:!1,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{capabilities:s,effectiveCapabilities:r,lastEditDate:null,snapshotInfo:{supportsSnapshotMinThreshold:S,supportsSnapshotMaxThreshold:w,snapshotCountThresholds:{min:g("featurelayer-snapshot-point-min-threshold"),max:g("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t,r){const{definitionExpression:s,customParameters:a,timeExtent:n}=this.layer;return J(e,{definitionExpression:s,customParameters:a,timeExtent:n},t,r,null)}createProcessorSchema(e,t,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:u,orderBy:l,objectIdField:c}=this.layer,d={fields:s.map(p=>p.toJSON()),renderer:a==null?void 0:a.clone(),featureReduction:R(this.layer,t),geometryType:n,labelingInfo:o,labelsVisible:u,objectIdField:c,orderBy:l??"default"};return D(e,t,d,r)}get hasRequiredSupport(){return L(this.layer.renderer)}hasFilters(e){return K(this.layer,e)}addFilters(e,t){return Ce(this.layer,e,t)}getUpdateHashProperties(e){var u;const t=this.layer,{definitionExpression:r,renderer:s}=t,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=JSON.stringify(t.customParameters),o=(u=R(t,e))==null?void 0:u.toJSON();return{orderBy:JSON.stringify(t.orderBy),definitionExpression:r,renderer:s,labelingInfo:a,featureReduction:o,customParameters:n,floors:K(this.layer,e)?e.floors:null}}};class Zi{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=X(t,e)??k(t);return[{vvEvaluators:{0:B(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(e){var o;const t=this.layer,{objectIdField:r}=t,s=P(t),a=((o=t.timeInfo)==null?void 0:o.toJSON())||null,n=t.spatialReference?t.spatialReference.toJSON():null;return{source:this.layer.parsedUrl,metadata:{fieldsIndex:this.layer.fieldsIndex.toJSON(),geometryType:s,objectIdField:r,timeInfo:a,timeReferenceUnknownClient:null,spatialReference:n,subtypeField:null,subtypes:null,globalIdField:null,typeIdField:null,types:null}}}createSourceSchema(e,t,r){const{definitionExpression:s,geometryDefinition:a,customParameters:n}=this.layer;return{type:"stream",service:e,tileInfoJSON:t.tileInfoJSON,mutable:{sourceRefreshVersion:r,availableFields:t.availableFields,dataFilter:{geometryDefinition:a==null?void 0:a.toJSON(),definitionExpression:s,outSpatialReference:t.outSpatialReference.toJSON(),customParameters:n??null,maxReconnectionAttempts:this.layer.maxReconnectionAttempts,maxReconnectionInterval:this.layer.maxReconnectionInterval,purgeOptions:this.layer.purgeOptions.toJSON()}}}}createProcessorSchema(e,t,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:u,objectIdField:l}=this.layer,c={fields:s.map(d=>d.toJSON()),renderer:a==null?void 0:a.clone(),featureReduction:R(this.layer,t),geometryType:n,labelingInfo:o,labelsVisible:u,objectIdField:l,orderBy:"default"};return D(e,t,c,r)}get hasRequiredSupport(){return L(this.layer.renderer)}getUpdateHashProperties(e){var u;const t=this.layer,{definitionExpression:r,renderer:s}=t,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=JSON.stringify(t.customParameters),o=(u=R(t,e))==null?void 0:u.toJSON();return{definitionExpression:r,renderer:s,labelingInfo:a,featureReduction:o,customParameters:n,streamFilter:`${JSON.stringify(t.geometryDefinition)}${t.definitionExpression}`}}}async function Wi(i,{subtypeField:e,sublayers:t}){const r=await Promise.all(t.map(({renderer:s})=>se(i,s)));return{type:"subtype",subtypeField:e,renderers:t.reduce((s,{subtypeCode:a},n)=>({...s,[a]:r[n]}),{})}}function Xi(i,e){const t=gt();return{type:"subtype",filters:i.filters,capabilities:{maxTextureSize:t.maxTextureSize},subtypeField:e.subtypeField,target:"feature",bindings:e.sublayers.reduce((r,{renderer:s,subtypeCode:a})=>({...r,[a]:Kt(s)}),{})}}async function Yi(i,{subtypeField:e,sublayers:t}){const r=await Promise.all(t.map(s=>{const a=z(s.renderer),n={...s,geometryType:s.geometryType??null};return re(i,n,a)}));return{type:"subtype",subtypeField:e,renderers:t.reduce((s,{subtypeCode:a},n)=>({...s,[a]:r[n]}),{})}}async function er(i,e,t,r){return{storage:Xi(e,t),mesh:{displayRefreshVersion:r,strategy:{type:"feature"},factory:{symbology:await Wi(i,t),labels:await Yi(i,t)},sortKey:null,timeZone:e.timeZone}}}class tr{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){return[{vvEvaluators:{},deconflictionEnabled:this.layer.sublayers.every(t=>k(t))}]}async createServiceOptions(e){var F,$,Y;const t=this.layer,r=N(t),{capabilities:s,datesInUnknownTimezone:a,editingInfo:n,globalIdField:o,objectIdField:u,refreshInterval:l,subtypeField:c}=t,d=t.fieldsIndex.toJSON(),p=P(t),y=(F=t.timeInfo)==null?void 0:F.toJSON(),m=t.spatialReference.toJSON(),b=ne(this.layer.parsedUrl),V=u,S=(n==null?void 0:n.lastEditDate)==null&&l>0,w=g("featurelayer-snapshot-enabled")&&t.geometryType==="point"&&(s==null?void 0:s.query.supportsPagination)&&!(s!=null&&s.operations.supportsEditing)&&!S,v=w&&Te(e,t.fullExtent);return{type:"feature-service",source:b,isSourceHosted:ge(b.path),orderByFields:V,metadata:{timeReferenceUnknownClient:a,subtypeField:c,globalIdField:o,fieldsIndex:d,geometryType:p,objectIdField:u,timeInfo:y,spatialReference:m,subtypes:($=this.layer.subtypes)==null?void 0:$.map(Se=>Se.toJSON()),typeIdField:null,types:null},queryMetadata:{capabilities:s,effectiveCapabilities:r,lastEditDate:(Y=n==null?void 0:n.lastEditDate)==null?void 0:Y.getTime(),snapshotInfo:{supportsSnapshotMinThreshold:w,supportsSnapshotMaxThreshold:v,snapshotCountThresholds:{min:g("featurelayer-snapshot-point-min-threshold"),max:g("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t,r){const{definitionExpression:s,customParameters:a,gdbVersion:n,historicMoment:o,subtypeField:u,timeExtent:l,apiKey:c}=this.layer,d=this.layer.sublayers.map(m=>m.subtypeCode).join(","),p=this.layer.sublayers.length?`${this.layer.subtypeField} IN (${d})`:"1=2",y={definitionExpression:fe(s,p),customParameters:a,gdbVersion:n,historicMoment:o,subtypeField:u,timeExtent:l};return J(e,y,t,r,c)}createProcessorSchema(e,t,r){const s={subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,a=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfo:a.labelingInfo,labelsVisible:a.labelsVisible,renderer:a.renderer,subtypeCode:a.subtypeCode,orderBy:null}))};return er(e,t,s,r)}hasFilters(e){return K(this.layer,e)||ir(this.layer,e)}addFilters(e,t){e=Ce(this.layer,e,t);const r=this.layer.sublayers.filter(a=>!nt(a,t)).map(a=>a.subtypeCode);if(!r.length)return e;e??(e=new te);const s=`NOT ${this.layer.subtypeField} IN (${r.join(",")})`;return e.where=fe(e.where,s),e}get hasRequiredSupport(){return!0}getUpdateHashProperties(e){var l;const t=this.layer,{definitionExpression:r,gdbVersion:s,apiKey:a}=t,n=((l=t.historicMoment)==null?void 0:l.getTime())??void 0,o=JSON.stringify(t.customParameters),u=K(this.layer,e)?e.floors:null;return{gdbVersion:s,definitionExpression:r,historicMoment:n,customParameters:o,apiKey:a,sublayerHash:"sublayers"in this.layer&&this.layer.sublayers.items.reduce((c,d)=>c+`${d.visible?1:0}.${JSON.stringify(d.renderer)}.${d.labelsVisible} +import{d as h,y as f,f as Z,j as Ie,a7 as Ye,E as g,aZ as lt,aS as ot,iU as ut,a as xe,ai as ct,N as C,s as q,i0 as dt,at as pe,df as et,ec as pt,ca as ht,l6 as ft,I as tt,bn as yt,bh as ae,n as fe,l7 as oe,dz as mt,l8 as G,l9 as ue,dh as N,aV as ne,b7 as ge,la as gt,bq as ke,bK as bt,g as Ee,fJ as St,z as qe,b6 as Ue,hW as Le,aX as ye,c8 as vt,lb as Be,lc as _t,ld as Je,le as wt,lf as Vt,ii as ce,jE as ve,lg as It,k as xt,bm as Et,V as Ft,q as Rt,e as De,aE as Ot,P as $t,u as zt,eN as Tt,b as _e,lh as Ct}from"./index-BjUNJPVf.js";import{m as je}from"./diffUtils-uUoMDFQS.js";import{b as He,E as we,R as H,a as At,N as Qe}from"./Container-_n5wCgez.js";import{d as te,m as Pt}from"./FeatureEffect-DBbkrS6j.js";import{d as Fe}from"./FeatureSet-opEn8ou8.js";import{t as Mt}from"./highlightReasons-BOU4mnPE.js";import{m as Nt,u as kt}from"./LayerView-Bux7vAEn.js";import{i as Ge,r as qt}from"./TechniqueInstance-XtnK2qy2.js";import{r as Ke,K as W,o as Ut,e as Lt,Z as Bt}from"./UpdateTracking2D-Ds_Gdrxd.js";import{b as Jt}from"./WGLContainer-DgZNq7b0.js";import{o as Dt}from"./tileUtils-B7X19rIS.js";import{i as M}from"./sizeVariableUtils-Cmcuvw-4.js";import{c as jt}from"./OrderByInfo-DKyk5GLW.js";import{c as Ht}from"./labelingInfo-DqAUis6e.js";import{f as Qt}from"./heatmapUtils-BSteZBTj.js";import{e as Gt}from"./SDFHelper-kKuXhauo.js";import"./LabelMetric-BcUxDImF.js";import{n as me,h as x,c as z,d as de,e as U,f as ie,i as Re,x as be,t as Oe,m as L,g as Kt,b as Zt}from"./FeatureCommandQueue-DI81F3gA.js";import{t as Wt}from"./HighlightCounter-qEuAaY1V.js";import{o as Ze}from"./floorFilterUtils-DZ5C6FQv.js";import{p as Ve,n as Xt}from"./popupUtils-Do2GfZME.js";import{i as Yt}from"./RefreshableLayerView-L9NGpXXI.js";let he=class extends Ie{constructor(){super(...arguments),this.isAggregate=!0}getEffectivePopupTemplate(e=!1){var r;if(this.popupTemplate)return this.popupTemplate;const t=(r=this.sourceLayer)==null?void 0:r.featureReduction;return t&&"popupTemplate"in t&&t.popupEnabled?t.popupTemplate:null}getObjectId(){return this.attributes.aggregateId}};h([f({type:Boolean})],he.prototype,"isAggregate",void 0),he=h([Z("esri.AggregateGraphic")],he);const $e=he;let E=class extends Ye{constructor(e){super(e),this._filter=null,this.duration=g("mapview-transitions-duration"),this._excludedEffectView=new He(e),this._includedEffectView=new He(e)}get excludedEffects(){return this._excludedEffectView.effects}set featureEffect(e){this._get("featureEffect")!==e&&this._transitionTo(e)}get filter(){var e;return this._filter||((e=this.featureEffect)==null?void 0:e.filter)||null}get hasEffects(){return this._excludedEffectView.hasEffects||this._includedEffectView.hasEffects}get includedEffects(){return this._includedEffectView.effects}set scale(e){this._set("scale",e),this._excludedEffectView.scale=e,this._includedEffectView.scale=e}get transitioning(){return this._excludedEffectView.transitioning||this._includedEffectView.transitioning}transitionStep(e,t){this._set("scale",t),this.transitioning?(this._includedEffectView.transitionStep(e,t),this._excludedEffectView.transitionStep(e,t),this.transitioning||(this._filter=null)):(this._excludedEffectView.scale=t,this._includedEffectView.scale=t)}endTransitions(){this._includedEffectView.endTransitions(),this._excludedEffectView.endTransitions(),this._filter=null}_transitionTo(e){const t=this._get("featureEffect"),r=e,s=r==null?void 0:r.includedEffect,a=r==null?void 0:r.excludedEffect,n=this._includedEffectView.canTransitionTo(s)&&this._excludedEffectView.canTransitionTo(a);this._includedEffectView.effect=s,this._excludedEffectView.effect=a,this._set("featureEffect",r),this._filter=(r==null?void 0:r.filter)||(t==null?void 0:t.filter)||null,n||this.endTransitions()}};h([f()],E.prototype,"_filter",void 0),h([f()],E.prototype,"_excludedEffectView",void 0),h([f()],E.prototype,"_includedEffectView",void 0),h([f()],E.prototype,"duration",void 0),h([f()],E.prototype,"excludedEffects",null),h([f()],E.prototype,"featureEffect",null),h([f()],E.prototype,"filter",null),h([f()],E.prototype,"hasEffects",null),h([f()],E.prototype,"includedEffects",null),h([f({value:0})],E.prototype,"scale",null),h([f()],E.prototype,"transitioning",null),E=h([Z("esri.layers.effects.FeatureEffectView")],E);const ei=E;let ee=class extends Fe{constructor(){super(...arguments),this.features=[]}readFeatures(e,t){var a;const r=ot.fromJSON(t.spatialReference),s=[];for(let n=0;n";console.debug(`Version[${e.version}] Tile[${e.id}] Chunk[${n}] RenderState.updateTile [${e.type}]`,e)}const t=this._ensureTile(e.id);if(e.type==="update"){const[n,...o]=e.modify;t.onMessage({type:"update",modify:n,remove:e.remove,end:e.end,attributeEpoch:e.attributeEpoch});for(const u of o){const l=this._tiles.get(u.tileId);l&&l.onMessage({type:"update",modify:u,remove:e.remove,end:!1,isPixelBuffer:!0,attributeEpoch:null})}return}if(e.append==null)return void t.onMessage({type:"append",clear:e.clear,debugInfo:e.debugInfo,end:e.end,attributeEpoch:e.attributeEpoch});const[r,...s]=e.append;t.onMessage({type:"append",clear:e.clear,append:r,debugInfo:e.debugInfo,end:e.end,attributeEpoch:e.attributeEpoch});for(const n of s){const o=this._tiles.get(n.tileId);o&&o.onMessage({type:"update",modify:n,remove:[],sort:!1,end:!1,isPixelBuffer:!0,attributeEpoch:null})}}removeTile(e){const t=this._tiles.get(e);g("esri-2d-update-debug")&&console.debug(`Tile[${e}] RenderState.removeTile`),t==null||t.destroy(),this._tiles.delete(e)}isTileDone(e){const t=this._tiles.get(e.id);return!!t&&t.isReady}_ensureTile(e){if(!this._tiles.has(e)){const t=this._createTile(e);this._copyPixelBufferedEntitiesInto(t),this._tiles.set(e,t)}return this._tiles.get(e)}_createTile(e){g("esri-2d-update-debug")&&console.debug(`Version[${this.version}] Tile[${e}] RenderState.createTile`);const t=new xe(e),r=this._tileInfoView.getTileBounds(ct(),t),s=this._tileInfoView.getTileResolution(t.level),a=new Jt(t,s,r[0],r[3],!0);if(a.stage=this.getStage(),!a.stage){const n=new C("featurelayerview:webgl","Cannot create tile with empty stage");q.getLogger("esri.views.2d.layers.features.RenderState").error(n)}return a}_copyPixelBufferedEntitiesInto(e){let t=7;for(let r=-1;r<=1;r++)for(let s=-1;s<=1;s++){if(r===0&&s===0)continue;const a=this._tileInfoView.tileInfo.isWrappable,n=Dt(e.key,s,r,a).id,o=this._tiles.get(n);if(o!=null){const u=1<r.needsUpload);t.length&&(t[Math.floor(Math.random()*t.length)].upload(),t.length>=2&&this.requestRender());for(const r of this._renderState.tiles())r.tryReady(this.attributeView.currentEpoch)&&(this._layerView.requestUpdate(),this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this.requestRender())}for(const t of this.children)t.setTransform(e.state);switch(this.hasAnimation&&e.painter.effects.integrate.draw(e,e.attributeView),super.renderChildren(e),e.drawPhase){case we.MAP:return this._renderMapPhase(e);case we.HIGHLIGHT:return this._renderHighlightPhase(e);case we.LABEL:return this._renderLabelPhase(e)}}subscriptions(){return this._subscriptions.values()}get _instanceStore(){return this._store}get instanceStore(){return this._store}get layerView(){return this._layerView}get hasLabels(){return this._layerView.labelingCollisionInfos.length>0}get hasHighlight(){return this._layerView.hasHighlight()}get _layer(){return this._layerView.layer}_getExclusivePostprocessingInstance({drawPhase:e}){if(this._instanceStore==null)return null;let t=0,r=null;for(const s of this._instanceStore.values())s.techniqueRef.drawPhase&e&&(t++,s.techniqueRef.postProcessingEnabled&&(r=s));return t>1?null:r}_getOverrideStencilRef({drawPhase:e}){if(this._instanceStore==null)return null;let t=null;for(const r of this._instanceStore.values()){if(!(r.techniqueRef.drawPhase&e))continue;const{overrideStencilRef:s}=r.techniqueRef;if(t==null)t=s;else if(t!==s){t=null;break}}return t}get children(){return this._renderState?Array.from(this._renderState.tiles()).filter(e=>this._visibleTiles.has(e.key.id)):[]}async updateAttributeView(e){this.requestRender(),await this.updatingHandles.addPromise(this.attributeView.requestUpdate(e)),this.hasLabels&&this._layerView.view.labelManager.requestUpdate()}updateSubscriptions(e){for(const{tileId:t,version:r}of e.subscribe)if(this._subscriptions.has(t))this._subscriptions.get(t).version=r;else{const s=new si(t,r);this._subscriptions.set(t,s),this.updatingHandles.addPromise(s.promise)}for(const t of e.unsubscribe){const r=this._subscriptions.get(t);r==null||r.destroy(),this._subscriptions.delete(t),this.removeTile(t)}}isDone(e){return!!this._renderState&&this._renderState.isTileDone(e)}async updateRenderState(e){g("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext=new ri(()=>this._stage,e,this._tileInfoView)}getDisplayStatistics(e,t){const r=this._statisticsByLevel.get(e);return r?r.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates)return void this._updateStatisticsRequests.push({level:e,statistics:t});let r=this._statisticsByLevel.get(e);r||(r=new Map,this._statisticsByLevel.set(e,r));for(const s of t)r.set(s.fieldName,{minValue:s.minValue,maxValue:s.maxValue})}editStart(){var e;(e=this._renderState)==null||e.lockUploads(),this.attributeView.lockTextureUploads(),this._lockStatisticUpdates=!0}editEnd(){var e;(e=this._renderState)==null||e.unlockUploads(),this.attributeView.unlockTextureUploads(),this._lockStatisticUpdates=!1;for(const t of this._updateStatisticsRequests)this.updateStatistics(t.level,t.statistics);this._updateStatisticsRequests=[],this.requestRender()}swapRenderState(){var e;if(this._renderStateNext&&(g("esri-2d-update-debug")&&console.debug(`Version[${this._renderStateNext.version}] FeatureContainer.update.swapRenderState`),(e=this._renderState)==null||e.destroy(),this._renderState=this._renderStateNext,this._renderStateNext=null),this._renderState)for(const t of this._renderState.tiles())t.upload();this.requestRender()}setVisibleTiles(e){this._visibleTiles=e}async onMessage(e,t){if(pe(t),!this._subscriptions.has(e.id))return;const r=this._subscriptions.get(e.id);if(r.version!==e.subscriptionVesrion){if(g("esri-2d-update-debug")){const a=`${e.subscriptionVesrion} != ${r.version}`;console.debug(`Version[${a}] Tile[${e.id}] FeatureContainer - Dropping message, outdated version]`,e)}return}const s=this._renderStateNext??this._renderState;if(!s)throw new Error("InternalError: No renderState defined");s.version!==e.version&&console.error(`InternalError: Version mismatch. [renderState: ${s.version}, message: ${e.version}]`),s.updateTile(e),e.end&&this._subscriptions.get(e.id).end(),this.requestRender(),this._layerView.view.labelManager.requestUpdate(),this._layerView.requestUpdate()}removeTile(e){(this._renderState||this._renderStateNext)&&(this._renderState&&this._renderState.removeTile(e),this._renderStateNext&&this._renderStateNext.removeTile(e))}hitTest(e){let t=this._hitTestsRequests.find(({x:s,y:a})=>s===e.x&&a===e.y);const r=et();return t?t.resolvers.push(r):(t={x:e.x,y:e.y,resolvers:[r]},this._hitTestsRequests.push(t)),this.requestRender(),r.promise}getSortKeys(e){const t=new Set(e),r=new Map;for(const s of this.children)if(s.getSortKeys(t).forEach((a,n)=>r.set(n,a)),r.size===t.size)break;return r}get hasAnimation(){return this.hasLabels}updateTransitionProperties(e,t){super.updateTransitionProperties(e,t),this._layerView.featureEffectView.transitionStep(e,t),this._layerView.featureEffectView.transitioning&&this.requestRender()}doRender(e){const{minScale:t,maxScale:r}=this._layer.effectiveScaleRange,s=e.state.scale;s<=(t||1/0)&&s>=r&&super.doRender(e)}afterRender(e){super.afterRender(e),this._hitTestsRequests.length&&this.requestRender()}setStencilReference(e){const t=this._getOverrideStencilRef(e);if(t==null)super.setStencilReference(e);else for(const r of this.children)r.stencilRef=t(r)}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,H.All),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&At(e,!1,t=>{this._renderFeatures(t,H.Highlight)})}_renderLabelPhase(e){this._renderFeatures(e,H.All)}_renderInsideEffect(e){const t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,H.InsideEffect),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){const t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,H.OutsideEffect),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){const{context:t}=e,r=e.painter.effects.hittest,s=t.getBoundFramebufferObject(),a=t.getViewport(),n=e.passOptions;r.bind(e),e.passOptions=r.createOptions(e,this._hitTestsRequests),this._renderFeatures(e,H.All),r.draw(e),r.unbind(),t.bindFramebuffer(s),t.restoreViewport(a),e.passOptions=n}_renderFeatures(e,t){for(const s of this.children){if(!s.visible)continue;const a=g("featurelayer-force-marker-text-draw-order")?Qe.STRICT_MARKERS_AND_TEXT:Qe.BATCHING,n=s.getDisplayList(e.drawPhase,this._instanceStore,a);e.selection=t,n==null||n.render(e)}const r=this._getExclusivePostprocessingInstance(e);r!=null&&r.techniqueRef.postProcess(e,r)}};async function ni(i){const e=await pt("FeaturePipelineWorker",{client:i,strategy:"dedicated"});return new li(e)}let li=class{constructor(e){this._connection=e,this.pipeline=this._connection.createInvokeProxy(),this.features=this._connection.createInvokeProxy("features"),this.aggregates=this._connection.createInvokeProxy("aggregates"),this.streamMessenger=this._connection.createInvokeProxy("streamMessenger")}destroy(){this._connection.destroy()}get closed(){return this._connection.closed}};const oi="esri.views.2d.layers.features.FeatureSourceEventLog";let T=class extends Ye{constructor(){super(...arguments),this.events=new ht,this._updatingStrategy=!0,this._tileToEvent=new ft,this._fetchStatus={outstanding:0,done:0}}get hasAllFeatures(){var e;return this._hasAllData()&&(((e=this._strategyInfo)==null?void 0:e.willQueryAllFeatures)??!1)}get hasAllFeaturesInView(){return this._hasAllData()}get hasFullGeometries(){var e;return this._hasAllData()&&(((e=this._strategyInfo)==null?void 0:e.willQueryFullResolutionGeometry)??!1)}onEvent(e){switch(e.type){case"subscribe":case"unsubscribe":case"loaded":case"error":this._handleTileEvent(e);break;case"updateStrategyStart":this._updatingStrategy=!0,this._fetchStatus={done:0,outstanding:0},this._strategyInfo=e.about;break;case"updateStrategyEnd":this._updatingStrategy=!1;break;case"updateFieldsStart":this._fetchStatus={done:0,outstanding:0};break;case"updateFieldsEnd":break;case"updateFieldsError":this.events.emit("error",e);break;case"fetchStart":this._fetchStatus.outstanding+=1,this.events.emit("status",this._fetchStatus);break;case"fetchEnd":this._fetchStatus.done+=1,this.events.emit("status",this._fetchStatus),e.done&&(this._fetchStatus={done:0,outstanding:0})}}_hasAllData(){return!this._updatingStrategy&&this._hasAllTileData()}_hasAllTileData(){for(const e of this._tileToEvent.values())if(e[e.length-1].type!=="loaded")return!1;return!0}_handleTileEvent(e){switch(e.type){case"subscribe":this._tileToEvent.set(e.tile,[e]);break;case"unsubscribe":this._tileToEvent.delete(e.tile);break;case"loaded":{const t=this._tileToEvent.get(e.tile);if(!t)return;t.push(e),this._tileToEvent.set(e.tile,t);break}case"error":{const t=this._tileToEvent.get(e.tile);if(!t)return;t.push(e),this._tileToEvent.set(e.tile,t),this.events.emit("error",e);break}}}};h([f({readOnly:!0})],T.prototype,"hasAllFeatures",null),h([f({readOnly:!0})],T.prototype,"hasAllFeaturesInView",null),h([f({readOnly:!0})],T.prototype,"hasFullGeometries",null),h([f()],T.prototype,"_updatingStrategy",void 0),h([f()],T.prototype,"_strategyInfo",void 0),h([f()],T.prototype,"_tileToEvent",void 0),T=h([Z(oi)],T);function P(i){switch(i.geometryType){case"point":return"esriGeometryPoint";case"polyline":return"esriGeometryPolyline";case"polygon":case"multipatch":return"esriGeometryPolygon";case"multipoint":return"esriGeometryMultipoint";default:return null}}function R(i,e){const t=i.featureReduction;return t&&t.type!=="selection"&&(!("maxScale"in t)||!t.maxScale||t.maxScale=r?n:a+s*(n-a)}function hi(i,e){const t=i/e.minDataValue,r=O(e.minSize,i),s=O(e.maxSize,i);let a=null;return a=t*r,tt(a,r,s)}function fi(i,e){const[t,r,s]=mi(i,e.cache.ipData);if(t===r)return O(e.stops[t].size,i);{const a=O(e.stops[t].size,i);return a+(O(e.stops[r].size,i)-a)*s}}function yi(i,e){const t=yt[e.valueUnit],r=O(e.minSize,i),s=O(e.maxSize,i),{valueRepresentation:a}=e;let n=null;return n=a==="area"?2*Math.sqrt(i/ui)/t:a==="radius"||a==="distance"?2*i/t:i/t,tt(n,r,s)}function mi(i,e){if(!e)return;let t=0,r=e.length-1;return e.some((s,a)=>it.deconflictionStrategy!=="none")))??!1}function X(i,e){var r;const t=R(i,e);if(t!=null&&t.labelsVisible&&((r=t.labelingInfo)!=null&&r.length))return t.labelingInfo.every(s=>s.deconflictionStrategy!=="none")}function gi(i){return e=>ae(it(e,i))}function B(i){const e=i!=null&&"visualVariables"in i&&i.visualVariables;if(!e)return null;for(const t of e)if(t.type==="size")return gi(t);return null}function J(i,e,t,r,s){var u,l;const a=e.subtypeCode!=null?`${e.subtypeField} = ${e.subtypeCode}`:null,n=fe(e.definitionExpression,a),o=e.customParameters??{};return s&&(o.token=s),{type:"feature",mutable:{sourceRefreshVersion:r,availableFields:t.availableFields,dataFilter:{definitionExpression:n,gdbVersion:e.gdbVersion,historicMoment:(u=e.historicMoment)==null?void 0:u.getTime(),outSpatialReference:t.outSpatialReference.toJSON(),timeExtent:(l=e.timeExtent)==null?void 0:l.toJSON(),customParameters:o}},service:i,tileInfoJSON:t.tileInfoJSON}}function bi(i,e,t=0){if(e==null)return i[t]=0,i[t+1]=0,i[t+2]=0,void(i[t+3]=0);const{r,g:s,b:a,a:n}=e;i[t]=r*n/255,i[t+1]=s*n/255,i[t+2]=a*n/255,i[t+3]=n}async function A(i,e){if(!i)return[];switch(i.type){case"simple-fill":return st(i,e);case"picture-fill":return Oi(i,e);case"simple-marker":return wi(i,e);case"picture-marker":return Vi(i,e);case"simple-line":return le(i,e,!1);case"text":return xi(i,e);case"label":return Ei(i,e);case"cim":return me(i.data,e);case"web-style":{const t=await i.fetchCIMSymbol();return me(t.data,e)}default:throw new Error(`symbol not supported ${i.type}`)}}async function Si(i,e){const{schemaOptions:t}=e,{store:r}=t,s=new Array(oe),a=new Array(oe/4);for(let l=0;lde(c.color)),visualVariableOpacity:s.visualVariableOpacity,visualVariableSizeMinMaxValue:s.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:s.visualVariableSizeScaleStops,visualVariableSizeStops:s.visualVariableSizeStops,visualVariableSizeUnitValue:s.visualVariableSizeUnitValue,hittestUniforms:null},numberOfFields:i.attributes.length},{}).createMeshInfo({params:{size:i.size,outlineWidth:r,effects:null,scaleInfo:null,minPixelBuffer:U(s)}});return[...i.backgroundFillSymbol?st(i.backgroundFillSymbol,{schemaOptions:e,path:"",uniforms:be}):[],a]}function rt(i){if(i.style==="path"){if(i.path==null)throw new Error("Symbol with a style of type path must define a path");return{type:"sprite-rasterization-param",overrides:[],resource:{type:"path",path:i.path,asFill:!0}}}const e=W.fromSimpleMarker(i);if("outline"in i&&i.outline&&i.outline.style!=="none"&&i.outline.style!=="solid"){if(!e||!e.symbolLayers)throw new Error("Error handling marker! ");return{type:"sprite-rasterization-param",resource:e.symbolLayers[0],overrides:[]}}return{type:"sprite-rasterization-param",resource:Gt(e),overrides:[]}}async function wi(i,e){var p,y,m,b,V;const{uniforms:t,schemaOptions:r}=e,{store:s}=r;if(i.style==="path"||i.outline&&i.outline.style!=="solid"&&i.outline.style!=="none"){const S=W.fromSimpleMarker(i);if(!S||!S.symbolLayers)throw new Error("Error handling marker! ");if(t.visualVariableRotation&&(S.angleAlignment="Map"),i.style!=="path"){const w=S.symbolLayers[0];if(ie(e.uniforms)){const v=U(e.uniforms,0,1);if(v>w.size){const F=v/w.size;w.size=v;const $=(p=w.markerGraphics)==null?void 0:p[0].symbol;($.symbolLayers&&$.symbolLayers[0]).width*=F}}}return me({type:"CIMSymbolReference",symbol:S},e)}const a=s.ensureInstance(x.marker,{geometry:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue,visualVariableRotation:t.visualVariableRotation}},{zoomRange:!1}),n=rt(i);let o=((y=i.color)==null?void 0:y.toArray())??[0,0,0,0];n.resource.type==="CIMVectorMarker"&&(o=[255,255,255,255]);const u=i.style==="triangle"?124/116:1,l=i.size,c=l*u,d=t.visualVariableColor!=null&&(i.style==="cross"||i.style==="x");return[a.createMeshInfo({params:{type:"simple",color:o,height:l,width:c,offsetX:i.xoffset,offsetY:i.yoffset,angle:i.angle,alignment:Re(t)?G.MAP:G.SCREEN,outlineColor:((b=(m=i.outline)==null?void 0:m.color)==null?void 0:b.toArray())??[0,0,0,0],outlineSize:((V=i.outline)==null?void 0:V.width)??1,referenceSize:l,sprite:n,overrideOutlineColor:d,hasSizeVV:ie(t),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:U(t)}})]}function Vi(i,e){const{uniforms:t,schemaOptions:r}=e,{store:s}=r,a=s.ensureInstance(x.marker,{geometry:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue,visualVariableRotation:t.visualVariableRotation}},{zoomRange:!1}),n=W.createPictureMarkerRasterizationParam(i);return n?[a.createMeshInfo({params:{type:"picture",color:[255,255,255,255],height:i.height,width:i.width,offsetX:i.xoffset,offsetY:i.yoffset,angle:i.angle,alignment:Re(t)?G.MAP:G.SCREEN,outlineColor:null,outlineSize:0,referenceSize:i.height,sprite:n,overrideOutlineColor:!1,hasSizeVV:ie(t),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:U(t)}})]:[]}function Ii(i,e,t){var b,V;const{uniforms:r,schemaOptions:s}=t,{store:a}=s,n=a.ensureInstance(x.marker,{geometry:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue,visualVariableRotation:r.visualVariableRotation}},{zoomRange:!1}),o=rt(i),u=6,l=u*e.width,c=l,d=((b=i.color)==null?void 0:b.toArray())??((V=e.color)==null?void 0:V.toArray())??[0,0,0,0],p=i.style==="cross"||i.style==="x";let y;switch(i.placement){case"begin-end":y=ue.Both;break;case"begin":y=ue.JustBegin;break;case"end":y=ue.JustEnd;break;default:y=ue.None}const m={type:"cim-marker-placement-info",placement:{type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:y,offsetAlongLine:0},overrides:[]};return[n.createMeshInfo({params:{type:"simple",color:d,height:c,width:l,offsetX:0,offsetY:0,angle:0,alignment:Re(r)?G.MAP:G.SCREEN,outlineColor:d,outlineSize:p?e.width:0,referenceSize:c/u,sprite:o,overrideOutlineColor:p&&r.visualVariableColor!=null,hasSizeVV:ie(r),placement:m,transforms:null,effects:null,scaleInfo:null,minPixelBuffer:U(r)}})]}function xi(i,e){var a,n,o,u;const{uniforms:t,schemaOptions:r}=e,{store:s}=r;return[s.ensureInstance(x.text,{geometry:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableRotation:t.visualVariableRotation,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue}},{zoomRange:!1,clipAngle:!1,referenceSymbol:!1}).createMeshInfo({params:{boxBackgroundColor:(a=i.backgroundColor)==null?void 0:a.toArray(),boxBorderLineColor:(n=i.borderLineColor)==null?void 0:n.toArray(),boxBorderLineSize:i.borderLineSize??0,color:((o=i.color)==null?void 0:o.toArray())??[0,0,0,0],offsetX:i.xoffset,offsetY:i.yoffset,postAngle:i.angle,fontSize:i.font.size,decoration:i.font.decoration,haloColor:((u=i.haloColor)==null?void 0:u.toArray())??[0,0,0,0],haloFontSize:i.haloSize??0,lineWidth:i.lineWidth,lineHeightRatio:i.lineHeight,horizontalAlignment:i.horizontalAlignment,verticalAlignment:i.verticalAlignment,useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:i.font.toJSON(),textString:i.text,symbol:W.createCIMTextSymbolfromTextSymbol(i)},overrides:[]},referenceSize:null,effects:null,placement:null,scaleInfo:null,transforms:null,scaleFactor:1,minPixelBuffer:U(t),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,isLineLabel:!1}})]}function Ei(i,e){var m,b,V,S,w,v;const{schemaOptions:t,uniforms:r}=e,{store:s}=t,a=i.symbol,{allowOverrun:n,repeatLabel:o,repeatLabelDistance:u}=i,l={maxScale:i.maxScale??0,minScale:i.minScale??0},c=s.ensureInstance(x.label,{geometry:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:r.visualVariableRotation,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue}},{zoomRange:!0,clipAngle:!0,referenceSymbol:!0}),d=i.labelPlacement,[p,y]=Ut(d);return[c.createMeshInfo({params:{boxBackgroundColor:(m=a.backgroundColor)==null?void 0:m.toArray(),boxBorderLineColor:(b=a.borderLineColor)==null?void 0:b.toArray(),boxBorderLineSize:a.borderLineSize??0,color:((V=a.color)==null?void 0:V.toArray())??[0,0,0,0],offsetX:a.xoffset,offsetY:a.yoffset,postAngle:a.angle,fontSize:a.font.size,decoration:a.font.decoration,haloColor:((S=a.haloColor)==null?void 0:S.toArray())??[0,0,0,0],haloFontSize:a.haloSize??0,lineWidth:a.lineWidth,lineHeightRatio:a.lineHeight,horizontalAlignment:p,verticalAlignment:y,repeatLabel:o,repeatLabelDistance:ae(u),allowOverrun:n,labelPosition:i.labelPosition,scaleInfo:l,minPixelBuffer:U(r),useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:a.font.toJSON(),textString:a.text,symbol:W.createCIMTextSymbolfromTextSymbol(a),primitiveName:"label-override"},useLegacyLabelEvaluationRules:((w=i.labelExpressionInfo)==null?void 0:w.expression)==null,overrides:[{type:"CIMPrimitiveOverride",valueExpressionInfo:{type:"CIMExpressionInfo",expression:((v=i.labelExpressionInfo)==null?void 0:v.expression)??i.labelExpression,returnType:"String"},primitiveName:"label-override",propertyName:"textString",defaultValue:""}]},referenceSize:null,effects:null,placement:null,transforms:null,scaleFactor:1,isLineLabel:!1}})]}function ze(i,e){var r;const t=i.width;return{outlineColor:((r=i.color)==null?void 0:r.toArray())||[0,0,0,1],width:t,referenceWidth:t,capType:i.cap??"round",joinType:i.join??"round",miterLimit:i.miterLimit,hasSizeVV:e}}function Fi(i,e){var l,c,d;const{uniforms:t,schemaOptions:r}=e,{store:s}=r,a=((l=i.color)==null?void 0:l.toArray())??[0,0,0,0],n={type:"sprite-rasterization-param",resource:{type:"fill-style",style:i.style},overrides:[]};if(((c=i.outline)==null?void 0:c.style)==="solid")return[s.ensureInstance(x.patternOutlineFill,{geometry:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeScaleStops:t.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null}},{zoomRange:!1}).createMeshInfo({params:{color:a,...ze(i.outline,!!t.visualVariableSizeOutlineScaleStops),sprite:n,scaleInfo:null,effects:null}})];const o=[],u=s.ensureInstance(x.patternFill,{geometry:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity}},{zoomRange:!1}).createMeshInfo({params:{color:((d=i.color)==null?void 0:d.toArray())??[0,0,0,0],sprite:n,scaleInfo:null,effects:null}});return o.push(u),i.outline&&o.push(...le(i.outline,e,!0)),o}function Ri(i,e){var o,u;const{uniforms:t,schemaOptions:r}=e,{store:s}=r,a=((o=i.color)==null?void 0:o.toArray())??[0,0,0,0];if(i.style!=="none"&&((u=i.outline)==null?void 0:u.style)==="solid")return[s.ensureInstance(x.outlineFill,{geometry:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeScaleStops:t.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null}},{zoomRange:!1}).createMeshInfo({params:{color:a,...ze(i.outline,!!t.visualVariableSizeOutlineScaleStops),scaleInfo:null,effects:null}})];const n=[];if(i.style!=="none"){const l=s.ensureInstance(x.fill,{geometry:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity}},{zoomRange:!1}).createMeshInfo({params:{color:a,scaleInfo:null,effects:null}});n.push(l)}return i.outline&&n.push(...le(i.outline,e,!0)),n}function st(i,e){const{style:t}=i;return t&&t!=="none"&&t!=="solid"?Fi(i,e):Ri(i,e)}function Oi(i,e){const{outline:t}=i,{uniforms:r,schemaOptions:s}=e,{store:a}=s,n=[],o=W.createPictureFillRasterizationParam(i);if(!o)return[];const{width:u,height:l,xoffset:c,yoffset:d,xscale:p,yscale:y}=i,m={color:[255,255,255,255],sprite:o,height:l,aspectRatio:u/l,offsetX:c,offsetY:d,scaleX:p,scaleY:y,angle:0,applyRandomOffset:!1,sampleAlphaOnly:!1,scaleProportionally:!1,effects:null,scaleInfo:null};if((t==null?void 0:t.style)==="solid")return[a.ensureInstance(x.complexOutlineFill,{geometry:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null}},{zoomRange:!1}).createMeshInfo({params:{...m,...ze(t,!!r.visualVariableSizeOutlineScaleStops)}})];const b=a.ensureInstance(x.complexFill,{geometry:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity}},{zoomRange:!1});return n.push(b.createMeshInfo({params:m})),t&&n.push(...le(t,e,!0)),n}function le(i,e,t){const{color:r,style:s,width:a,cap:n,join:o}=i,{schemaOptions:u}=e,{store:l}=u,c=[],d=t?{...be,visualVariableSizeScaleStops:e.uniforms.visualVariableSizeOutlineScaleStops}:e.uniforms,p={geometry:{visualVariableColor:d.visualVariableColor,visualVariableOpacity:d.visualVariableOpacity,visualVariableSizeMinMaxValue:d.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:d.visualVariableSizeScaleStops,visualVariableSizeStops:d.visualVariableSizeStops,visualVariableSizeUnitValue:d.visualVariableSizeUnitValue}},y={color:(r==null?void 0:r.toArray())??[0,0,0,0],width:a,referenceWidth:a,capType:n,joinType:o,miterLimit:i.miterLimit,hasSizeVV:ie(d),effects:null,scaleInfo:null};if(s==null||s==="solid"){const m=l.ensureInstance(x.line,p,{zoomRange:!1}).createMeshInfo({params:y});c.push(m)}else if(s!=="none"){const m=l.ensureInstance(x.texturedLine,p,{zoomRange:!1}).createMeshInfo({params:{...y,shouldScaleDash:!0,shouldSampleAlphaOnly:!1,isSDF:!0,sprite:{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:Lt(s,n),capStyle:Bt(n)},overrides:[]}}});c.push(m)}return i.marker!=null&&c.push(...Ii(i.marker,i,e)),c}async function re(i,e,t){const r=e.labelsVisible&&e.labelingInfo||[],s=P(e),a=Ht(r,s);return{type:"label",classes:await Promise.all(a.map((n,o)=>$i(i,n,o,t)))}}async function $i(i,e,t,r){var a;const s=await A(e,{path:`${t}`,schemaOptions:i,uniforms:r});return{maxScale:e.maxScale,minScale:e.minScale,expression:((a=e.labelExpressionInfo)==null?void 0:a.expression)??e.labelExpression,where:e.where,meshes:s}}async function se(i,e){if(!e)return{type:"simple",meshes:[]};switch(e.type){case"simple":return zi(i,e);case"dot-density":return Ti(i,e);case"class-breaks":return Ci(i,e);case"unique-value":return Ai(i,e);case"dictionary":return Pi(e);case"heatmap":return Mi(i,e);case"pie-chart":return Ni(i,e)}}async function zi(i,e){const t=e.getSymbols(),r=t.length?t[0]:null,s=z(e);return{type:"simple",meshes:await A(r,{schemaOptions:i,uniforms:s,path:"renderer.symbol"})}}async function Ti(i,e){const t=z(e);return{type:"dot-density",meshes:await Si(e,{schemaOptions:i,uniforms:t,path:"renderer.symbol"})}}async function Ci(i,e){const t=z(e),r=e.backgroundFillSymbol,s=e.normalizationType,a=s==="log"?"esriNormalizeByLog":s==="percent-of-total"?"esriNormalizeByPercentOfTotal":s==="field"?"esriNormalizeByField":null,n=e.classBreakInfos.map(async c=>({meshes:await A(c.symbol,{path:`renderer-stop-${c.minValue}-${c.maxValue}`,schemaOptions:i,uniforms:t}),min:c.minValue,max:c.maxValue})),o=(await Promise.all(n)).sort((c,d)=>c.min-d.min),u=await A(r,{schemaOptions:i,path:"renderer.backgroundFill",uniforms:{...be,visualVariableSizeOutlineScaleStops:t.visualVariableSizeOutlineScaleStops}}),l=await A(e.defaultSymbol,{schemaOptions:i,path:"renderer.defaultSymbol",uniforms:t});return{type:"interval",field:e.field,expression:e.valueExpression,backgroundFill:u,defaultSymbol:l,intervals:o,normalizationField:e.normalizationField,normalizationTotal:e.normalizationTotal,normalizationType:a,isMaxInclusive:e.isMaxInclusive}}async function Ai(i,e){const t=[],r=z(e),s=await A(e.backgroundFillSymbol,{schemaOptions:i,path:"renderer.backgroundFill",uniforms:{...be,visualVariableSizeOutlineScaleStops:r.visualVariableSizeOutlineScaleStops}}),a=await A(e.defaultSymbol,{schemaOptions:i,path:"renderer.defaultSymbol",uniforms:r});for(const n of e.uniqueValueInfos??[]){const o=await A(n.symbol,{path:`renderer-unique-value-${n.value}`,schemaOptions:i,uniforms:r});t.push({value:""+n.value,symbol:o})}return{type:"map",field:e.field,expression:e.valueExpression,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,backgroundFill:s,defaultSymbol:a,map:t}}function Pi(i){const e=z(i),t=i.scaleExpression,r=t!=null&&t!=="1"?{valueExpressionInfo:{type:"CIMExpressionInfo",expression:i.scaleExpression,returnType:"Numeric"},defaultValue:1}:void 0;return{type:"dictionary",fieldMap:i.fieldMap,scaleExpression:r,visualVariableUniforms:e}}async function Mi(i,e){return{type:"heatmap",meshes:await vi(e,i)}}async function Ni(i,e){return{type:"pie-chart",meshes:_i(e,i)}}async function ki(i,e){const t=e.renderer,r=z(t);return{symbology:await se(i,t),labels:await re(i,e,r)}}async function D(i,e,t,r){const s=t.featureReduction;if(s)switch(s.type){case"binning":return Ui(s,i,e,t,r);case"cluster":return Li(s,i,e,t,r)}const a=Bi(t.orderBy,t.renderer,t.objectIdField);return{storage:Oe(t.renderer,e.filters),mesh:{displayRefreshVersion:r,strategy:{type:"feature"},factory:await ki(i,t),sortKey:a,timeZone:e.timeZone}}}function at(i,e){return i.fields.map(t=>({...t.toJSON(),type:qi(t,e)}))}function qi(i,e){const{onStatisticExpression:t,onStatisticField:r,statisticType:s}=i;switch(s){case"min":case"max":case"avg":case"avg_angle":case"sum":case"count":return"esriFieldTypeDouble";case"mode":{if(t){const{returnType:n}=t;return n?n==="string"?"esriFieldTypeString":"esriFieldTypeDouble":"esriFieldTypeString"}const a=e.find(n=>n.name===r);return a?a.type:"esriFieldTypeString"}}}async function Ui(i,e,t,r,s){const a=at(i,r.fields),n=i.renderer,o=await se(e,n),u=Oe(n,[null,null]),l=z(n),c=await re(e,{geometryType:"polygon",labelingInfo:i.labelingInfo,labelsVisible:i.labelsVisible},l);return{storage:u,mesh:{displayRefreshVersion:s,strategy:{type:"binning",fields:a,fixedBinLevel:i.fixedBinLevel,featureFilter:t.filters[0]},factory:{labels:c,symbology:o},sortKey:null,timeZone:t.timeZone}}}async function Li(i,e,t,r,s){const a=at(i,r.fields),n={type:"cluster",feature:await se(e,i.effectiveFeatureRenderer),cluster:await se(e,i.effectiveClusterRenderer)},o=z(i.effectiveFeatureRenderer),u={type:"cluster",feature:await re(e,r,o),cluster:await re(e,{geometryType:"point",labelingInfo:i.labelingInfo,labelsVisible:i.labelsVisible},o)};return{storage:Oe(i.effectiveFeatureRenderer,[null,null]),mesh:{displayRefreshVersion:s,strategy:{type:"cluster",fields:a,featureFilter:t.filters[0],clusterRadius:ae(i.clusterRadius/2)},factory:{labels:u,symbology:n},sortKey:null,timeZone:t.timeZone}}}function Bi(i,e,t){const r=e!=null&&e.type==="unique-value"&&e.orderByClassesEnabled;if(i!=="default"||r||(i=[new jt({field:t,order:"descending"})]),i!=="default"&&i.length){i.length;const s=i[0],a=s.order==="ascending"?"asc":"desc";return s.field?{field:s.field,order:a}:s.valueExpression?{expression:s.valueExpression,order:a}:null}return r?{byRenderer:!0,order:"asc"}:null}let Ji=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=k(t);return[{vvEvaluators:{0:B(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(e){var v,F;const t=this.layer,r=t.parent,s=N(r),{capabilities:a,editingInfo:n,objectIdField:o,globalIdField:u,datesInUnknownTimezone:l,orderBy:c,subtypeField:d,parsedUrl:p}=r,y=r.fieldsIndex.toJSON(),m=P(t),b=(v=r.timeInfo)==null?void 0:v.toJSON(),V=t.spatialReference.toJSON(),S=ne(p);let w=o;if(c!=null&&c.length){const $=!c[0].valueExpression&&c[0].field;$&&(w=$)}return{type:"feature-service",source:S,isSourceHosted:ge(S.path),orderByFields:w,metadata:{timeReferenceUnknownClient:l,subtypeField:d,globalIdField:u,fieldsIndex:y,geometryType:m,objectIdField:o,timeInfo:b,spatialReference:V,subtypes:null,typeIdField:null,types:null},queryMetadata:{capabilities:a,effectiveCapabilities:s,lastEditDate:(F=n==null?void 0:n.lastEditDate)==null?void 0:F.getTime(),snapshotInfo:null}}}createSourceSchema(e,t,r){const{definitionExpression:s,customParameters:a,timeExtent:n,apiKey:o}=this.layer.parent;return J(e,{definitionExpression:s,customParameters:a,timeExtent:n},t,r,o)}createProcessorSchema(e,t,r){const{parent:{fields:s,geometryType:a,orderBy:n,objectIdField:o},renderer:u,labelingInfo:l,labelsVisible:c}=this.layer,d={featureReduction:null,fields:s.map(p=>p.toJSON()),geometryType:a,labelingInfo:l,labelsVisible:c,objectIdField:o,orderBy:n??"default",renderer:u==null?void 0:u.clone()};return D(e,t,d,r)}get hasRequiredSupport(){return L(this.layer.renderer)}getUpdateHashProperties(e){const t=this.layer,{parent:r,parent:{definitionExpression:s,apiKey:a},renderer:n}=t,o=this.layer.labelsVisible?this.layer.labelingInfo:null;return{apiKey:a,customParameters:JSON.stringify(r.customParameters),definitionExpression:s,labelingInfo:o,orderBy:JSON.stringify(r.orderBy),renderer:n}}setGraphicOrigin(e){e.origin={type:"catalog",layer:this.layer}}};function Te(i,e){const t=i.extent,r=e==null?void 0:e.clone().intersection(t),s=r!=null?r.width*r.height:0,a=e?e.width*e.height:0,n=a===0?0:s/a,o=g("featurelayer-snapshot-point-coverage");return!isNaN(n)&&n>=o}function K(i,e){return i.floorInfo!=null&&(i.floorInfo.viewAllLevelIds.length>0||e.floors.length>0)}function Ce(i,e,t){const r=Di(i,e==null?void 0:e.where,t);return r&&(e??(e=new te),e.where=r),e}function Di(i,e,t){var u;if(i.floorInfo==null||!((u=t.floors)!=null&&u.length))return e;let r=t.floors;const{floorField:s,viewAllLevelIds:a}=i.floorInfo;a.length&&(r=a);const n=r.filter(l=>l!=="").map(l=>"'"+l+"'");if(n.push("''"),e==null?void 0:e.includes(s)){let l=new RegExp("AND \\("+s+".*NULL\\)","g");e=e.replace(l,""),l=new RegExp("\\("+s+".*NULL\\)","g"),e=(e=e.replace(l,"")).replaceAll(/\s+/g," ").trim()}let o="("+s+" IN ({ids}) OR "+s+" IS NULL)";return o=o.replace("{ids}",n.join(", ")),fe(e,o)}let ji=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=X(t,e)??k(t);return[{vvEvaluators:{0:B(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(e){var Ae,Pe,Me,Ne;const t=this.layer,r=N(t),{capabilities:s,editingInfo:a,objectIdField:n,typeIdField:o,globalIdField:u,datesInUnknownTimezone:l,orderBy:c,subtypeField:d,refreshInterval:p}=t,y=t.fieldsIndex.toJSON(),m=y.fields,b=P(t),V=(Ae=t.timeInfo)==null?void 0:Ae.toJSON(),S=t.spatialReference.toJSON(),w=(Pe=t.types)==null?void 0:Pe.map(j=>j.toJSON()),v=ne(this.layer.parsedUrl);this.layer.dynamicDataSource&&(v.query={layer:JSON.stringify({source:this.layer.dynamicDataSource})});let F=this.layer.objectIdField;if(c!=null&&c.length){const j=!c[0].valueExpression&&c[0].field;j&&(F=j)}const $=(a==null?void 0:a.lastEditDate)==null&&p>0,Y=g("featurelayer-snapshot-enabled")&&t.geometryType==="point"&&(s==null?void 0:s.query.supportsPagination)&&!(s!=null&&s.operations.supportsEditing)&&!$,Se=Y&&Te(e,t.fullExtent);return{type:"feature-service",source:v,isSourceHosted:ge(v.path),orderByFields:F,metadata:{typeIdField:o??void 0,types:w,timeReferenceUnknownClient:l,subtypeField:d,globalIdField:u,fields:m,fieldsIndex:y,geometryType:b,objectIdField:n,timeInfo:V,spatialReference:S,subtypes:(Me=this.layer.subtypes)==null?void 0:Me.map(j=>j.toJSON())},queryMetadata:{capabilities:s,effectiveCapabilities:r,lastEditDate:(Ne=a==null?void 0:a.lastEditDate)==null?void 0:Ne.getTime(),snapshotInfo:{supportsSnapshotMinThreshold:Y,supportsSnapshotMaxThreshold:Se,snapshotCountThresholds:{min:g("featurelayer-snapshot-point-min-threshold"),max:g("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t,r){const{definitionExpression:s,customParameters:a,gdbVersion:n,historicMoment:o,subtypeCode:u,subtypeField:l,timeExtent:c,apiKey:d}=this.layer;return J(e,{definitionExpression:s,customParameters:a,gdbVersion:n,historicMoment:o,subtypeCode:u,subtypeField:l,timeExtent:c},t,r,d)}createProcessorSchema(e,t,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:u,orderBy:l,objectIdField:c}=this.layer,d={fields:s.map(p=>p.toJSON()),renderer:a==null?void 0:a.clone(),featureReduction:R(this.layer,t),geometryType:n,labelingInfo:o,labelsVisible:u,objectIdField:c,orderBy:l??"default"};return D(e,t,d,r)}get hasRequiredSupport(){return L(this.layer.renderer)}hasFilters(e){return K(this.layer,e)}addFilters(e,t){return Ce(this.layer,e,t)}getUpdateHashProperties(e){var y,m;const t=this.layer,{definitionExpression:r,renderer:s,gdbVersion:a,apiKey:n,subtypeCode:o}=t,u=this.layer.labelsVisible?this.layer.labelingInfo:null,l=((y=t.historicMoment)==null?void 0:y.getTime())??void 0,c=JSON.stringify(t.customParameters),d=(m=R(t,e))==null?void 0:m.toJSON(),p=JSON.stringify(t.orderBy);return{apiKey:n,customParameters:c,definitionExpression:r,featureReduction:d,floors:K(this.layer,e)?e.floors:null,gdbVersion:a,historicMoment:l,labelingInfo:u,orderBy:p,renderer:s,subtypeCode:o}}};function Hi(i){if(!("openPorts"in i))throw new C("source-not-supported")}class We{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=X(t,e)??k(t);return[{vvEvaluators:{0:B(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(e){var c;const t=this.layer,r=N(t),{capabilities:s,objectIdField:a}=t,n=t.fieldsIndex.toJSON(),o=P(t),u=(c=t.timeInfo)==null?void 0:c.toJSON(),l=t.spatialReference.toJSON();return Hi(t.source),{type:"memory",source:await t.source.openPorts(),orderByFields:a,metadata:{fieldsIndex:n,geometryType:o,objectIdField:a,timeInfo:u,spatialReference:l,subtypes:null,subtypeField:null,globalIdField:null,typeIdField:null,types:null,timeReferenceUnknownClient:null},queryMetadata:{capabilities:s,effectiveCapabilities:r,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,t,r){const{definitionExpression:s,timeExtent:a}=this.layer;return J(e,{definitionExpression:s,timeExtent:a,customParameters:null},t,r,null)}createProcessorSchema(e,t,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:u,orderBy:l,objectIdField:c}=this.layer,d={fields:s.map(p=>p.toJSON()),renderer:a==null?void 0:a.clone(),featureReduction:R(this.layer,t),geometryType:n,labelingInfo:o,labelsVisible:u,objectIdField:c,orderBy:l??"default"};return D(e,t,d,r)}get hasRequiredSupport(){return L(this.layer.renderer)}getUpdateHashProperties(e){var o;const t=this.layer,{definitionExpression:r,renderer:s}=t,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=(o=R(t,e))==null?void 0:o.toJSON();return{orderBy:JSON.stringify(t.orderBy),definitionExpression:r,renderer:s,labelingInfo:a,featureReduction:n}}}let Qi=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=X(t,e)??k(t);return[{vvEvaluators:{0:B(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(e){const t=this.layer,r=N(t),{capabilities:s,objectIdField:a}=t,n=t.fieldsIndex.toJSON(),o=P(t),u=t.spatialReference.toJSON();return{type:"memory",source:await t.source.openPorts(),orderByFields:a,metadata:{fieldsIndex:n,geometryType:o,objectIdField:a,spatialReference:u,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null},queryMetadata:{capabilities:s,effectiveCapabilities:r,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,t,r){const{definitionExpression:s}=this.layer;return J(e,{definitionExpression:s,customParameters:null},t,r,null)}createProcessorSchema(e,t,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:u,objectIdField:l}=this.layer,c={fields:s.map(d=>d.toJSON()),renderer:a==null?void 0:a.clone(),featureReduction:R(this.layer,t),geometryType:n,labelingInfo:o,labelsVisible:u,objectIdField:l,orderBy:"default"};return D(e,t,c,r)}get hasRequiredSupport(){return L(this.layer.renderer)}getUpdateHashProperties(e){var o;const t=this.layer,{definitionExpression:r,renderer:s}=t,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=(o=R(t,e))==null?void 0:o.toJSON();return{definitionExpression:r,renderer:s,labelingInfo:a,featureReduction:n}}},Gi=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=X(t,e)??k(t);return[{vvEvaluators:{0:B(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(e){var y;const t=this.layer,r=N(t),{capabilities:s,objectIdField:a}=t,n=t.fieldsIndex.toJSON(),o=P(t),u=(y=t.timeInfo)==null?void 0:y.toJSON(),l=t.spatialReference.toJSON(),c=t.source.getSource(),d=this.layer.objectIdField,p=ne(s);return p.query.maxRecordCount=c.maxRecordCount,{type:"ogc",source:c,orderByFields:d,metadata:{fieldsIndex:n,geometryType:o,objectIdField:a,timeInfo:u,spatialReference:l,globalIdField:null,subtypeField:null,subtypes:null,timeReferenceUnknownClient:null,typeIdField:null,types:null},queryMetadata:{capabilities:p,effectiveCapabilities:r,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,t,r){const{customParameters:s,timeExtent:a,apiKey:n}=this.layer;return J(e,{customParameters:s,timeExtent:a},t,r,n)}createProcessorSchema(e,t,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:u,orderBy:l,objectIdField:c}=this.layer,d={fields:s.map(p=>p.toJSON()),renderer:a==null?void 0:a.clone(),featureReduction:R(this.layer,t),geometryType:n,labelingInfo:o,labelsVisible:u,objectIdField:c,orderBy:l??"default"};return D(e,t,d,r)}get hasRequiredSupport(){return L(this.layer.renderer)}getUpdateHashProperties(e){var u;const t=this.layer,{renderer:r,apiKey:s}=t,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=JSON.stringify(t.customParameters),o=(u=R(t,e))==null?void 0:u.toJSON();return{apiKey:s,customParameters:n,featureReduction:o,labelingInfo:a,orderBy:JSON.stringify(t.orderBy),renderer:r}}},Ki=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=X(t,e)??k(t);return[{vvEvaluators:{0:B(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(e){var v;const t=this.layer,r=N(t),{capabilities:s,objectIdField:a,globalIdField:n,orderBy:o,refreshInterval:u}=t,l=t.fieldsIndex.toJSON(),c=l.fields,d=P(t),p=(v=t.timeInfo)==null?void 0:v.toJSON(),y=t.spatialReference.toJSON(),m=ne(this.layer.parsedUrl);let b=this.layer.objectIdField;if(o!=null&&o.length){const F=!o[0].valueExpression&&o[0].field;F&&(b=F)}const V=u>0,S=g("featurelayer-snapshot-enabled")&&t.geometryType==="point"&&(s==null?void 0:s.query.supportsPagination)&&!(s!=null&&s.operations.supportsEditing)&&!V,w=S&&Te(e,t.fullExtent);return{type:"feature-service",source:m,isSourceHosted:ge(m.path),orderByFields:b,metadata:{globalIdField:n,fields:c,fieldsIndex:l,geometryType:d,objectIdField:a,timeInfo:p,spatialReference:y,timeReferenceUnknownClient:!1,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{capabilities:s,effectiveCapabilities:r,lastEditDate:null,snapshotInfo:{supportsSnapshotMinThreshold:S,supportsSnapshotMaxThreshold:w,snapshotCountThresholds:{min:g("featurelayer-snapshot-point-min-threshold"),max:g("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t,r){const{definitionExpression:s,customParameters:a,timeExtent:n}=this.layer;return J(e,{definitionExpression:s,customParameters:a,timeExtent:n},t,r,null)}createProcessorSchema(e,t,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:u,orderBy:l,objectIdField:c}=this.layer,d={fields:s.map(p=>p.toJSON()),renderer:a==null?void 0:a.clone(),featureReduction:R(this.layer,t),geometryType:n,labelingInfo:o,labelsVisible:u,objectIdField:c,orderBy:l??"default"};return D(e,t,d,r)}get hasRequiredSupport(){return L(this.layer.renderer)}hasFilters(e){return K(this.layer,e)}addFilters(e,t){return Ce(this.layer,e,t)}getUpdateHashProperties(e){var u;const t=this.layer,{definitionExpression:r,renderer:s}=t,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=JSON.stringify(t.customParameters),o=(u=R(t,e))==null?void 0:u.toJSON();return{orderBy:JSON.stringify(t.orderBy),definitionExpression:r,renderer:s,labelingInfo:a,featureReduction:o,customParameters:n,floors:K(this.layer,e)?e.floors:null}}};class Zi{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,r=X(t,e)??k(t);return[{vvEvaluators:{0:B(t.renderer)},deconflictionEnabled:r}]}async createServiceOptions(e){var o;const t=this.layer,{objectIdField:r}=t,s=P(t),a=((o=t.timeInfo)==null?void 0:o.toJSON())||null,n=t.spatialReference?t.spatialReference.toJSON():null;return{source:this.layer.parsedUrl,metadata:{fieldsIndex:this.layer.fieldsIndex.toJSON(),geometryType:s,objectIdField:r,timeInfo:a,timeReferenceUnknownClient:null,spatialReference:n,subtypeField:null,subtypes:null,globalIdField:null,typeIdField:null,types:null}}}createSourceSchema(e,t,r){const{definitionExpression:s,geometryDefinition:a,customParameters:n}=this.layer;return{type:"stream",service:e,tileInfoJSON:t.tileInfoJSON,mutable:{sourceRefreshVersion:r,availableFields:t.availableFields,dataFilter:{geometryDefinition:a==null?void 0:a.toJSON(),definitionExpression:s,outSpatialReference:t.outSpatialReference.toJSON(),customParameters:n??null,maxReconnectionAttempts:this.layer.maxReconnectionAttempts,maxReconnectionInterval:this.layer.maxReconnectionInterval,purgeOptions:this.layer.purgeOptions.toJSON()}}}}createProcessorSchema(e,t,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:u,objectIdField:l}=this.layer,c={fields:s.map(d=>d.toJSON()),renderer:a==null?void 0:a.clone(),featureReduction:R(this.layer,t),geometryType:n,labelingInfo:o,labelsVisible:u,objectIdField:l,orderBy:"default"};return D(e,t,c,r)}get hasRequiredSupport(){return L(this.layer.renderer)}getUpdateHashProperties(e){var u;const t=this.layer,{definitionExpression:r,renderer:s}=t,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=JSON.stringify(t.customParameters),o=(u=R(t,e))==null?void 0:u.toJSON();return{definitionExpression:r,renderer:s,labelingInfo:a,featureReduction:o,customParameters:n,streamFilter:`${JSON.stringify(t.geometryDefinition)}${t.definitionExpression}`}}}async function Wi(i,{subtypeField:e,sublayers:t}){const r=await Promise.all(t.map(({renderer:s})=>se(i,s)));return{type:"subtype",subtypeField:e,renderers:t.reduce((s,{subtypeCode:a},n)=>({...s,[a]:r[n]}),{})}}function Xi(i,e){const t=gt();return{type:"subtype",filters:i.filters,capabilities:{maxTextureSize:t.maxTextureSize},subtypeField:e.subtypeField,target:"feature",bindings:e.sublayers.reduce((r,{renderer:s,subtypeCode:a})=>({...r,[a]:Kt(s)}),{})}}async function Yi(i,{subtypeField:e,sublayers:t}){const r=await Promise.all(t.map(s=>{const a=z(s.renderer),n={...s,geometryType:s.geometryType??null};return re(i,n,a)}));return{type:"subtype",subtypeField:e,renderers:t.reduce((s,{subtypeCode:a},n)=>({...s,[a]:r[n]}),{})}}async function er(i,e,t,r){return{storage:Xi(e,t),mesh:{displayRefreshVersion:r,strategy:{type:"feature"},factory:{symbology:await Wi(i,t),labels:await Yi(i,t)},sortKey:null,timeZone:e.timeZone}}}class tr{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){return[{vvEvaluators:{},deconflictionEnabled:this.layer.sublayers.every(t=>k(t))}]}async createServiceOptions(e){var F,$,Y;const t=this.layer,r=N(t),{capabilities:s,datesInUnknownTimezone:a,editingInfo:n,globalIdField:o,objectIdField:u,refreshInterval:l,subtypeField:c}=t,d=t.fieldsIndex.toJSON(),p=P(t),y=(F=t.timeInfo)==null?void 0:F.toJSON(),m=t.spatialReference.toJSON(),b=ne(this.layer.parsedUrl),V=u,S=(n==null?void 0:n.lastEditDate)==null&&l>0,w=g("featurelayer-snapshot-enabled")&&t.geometryType==="point"&&(s==null?void 0:s.query.supportsPagination)&&!(s!=null&&s.operations.supportsEditing)&&!S,v=w&&Te(e,t.fullExtent);return{type:"feature-service",source:b,isSourceHosted:ge(b.path),orderByFields:V,metadata:{timeReferenceUnknownClient:a,subtypeField:c,globalIdField:o,fieldsIndex:d,geometryType:p,objectIdField:u,timeInfo:y,spatialReference:m,subtypes:($=this.layer.subtypes)==null?void 0:$.map(Se=>Se.toJSON()),typeIdField:null,types:null},queryMetadata:{capabilities:s,effectiveCapabilities:r,lastEditDate:(Y=n==null?void 0:n.lastEditDate)==null?void 0:Y.getTime(),snapshotInfo:{supportsSnapshotMinThreshold:w,supportsSnapshotMaxThreshold:v,snapshotCountThresholds:{min:g("featurelayer-snapshot-point-min-threshold"),max:g("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t,r){const{definitionExpression:s,customParameters:a,gdbVersion:n,historicMoment:o,subtypeField:u,timeExtent:l,apiKey:c}=this.layer,d=this.layer.sublayers.map(m=>m.subtypeCode).join(","),p=this.layer.sublayers.length?`${this.layer.subtypeField} IN (${d})`:"1=2",y={definitionExpression:fe(s,p),customParameters:a,gdbVersion:n,historicMoment:o,subtypeField:u,timeExtent:l};return J(e,y,t,r,c)}createProcessorSchema(e,t,r){const s={subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,a=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfo:a.labelingInfo,labelsVisible:a.labelsVisible,renderer:a.renderer,subtypeCode:a.subtypeCode,orderBy:null}))};return er(e,t,s,r)}hasFilters(e){return K(this.layer,e)||ir(this.layer,e)}addFilters(e,t){e=Ce(this.layer,e,t);const r=this.layer.sublayers.filter(a=>!nt(a,t)).map(a=>a.subtypeCode);if(!r.length)return e;e??(e=new te);const s=`NOT ${this.layer.subtypeField} IN (${r.join(",")})`;return e.where=fe(e.where,s),e}get hasRequiredSupport(){return!0}getUpdateHashProperties(e){var l;const t=this.layer,{definitionExpression:r,gdbVersion:s,apiKey:a}=t,n=((l=t.historicMoment)==null?void 0:l.getTime())??void 0,o=JSON.stringify(t.customParameters),u=K(this.layer,e)?e.floors:null;return{gdbVersion:s,definitionExpression:r,historicMoment:n,customParameters:o,apiKey:a,sublayerHash:"sublayers"in this.layer&&this.layer.sublayers.items.reduce((c,d)=>c+`${d.visible?1:0}.${JSON.stringify(d.renderer)}.${d.labelsVisible} .${JSON.stringify(d.labelingInfo)}`,""),floors:u}}setGraphicOrigin(e){const t=this.layer.fieldsIndex.get(this.layer.subtypeField),r=e.attributes[t.name],s=this.layer.sublayers.find(a=>a.subtypeCode===r);e.layer=e.sourceLayer=s}}function ir(i,e){return i.sublayers.some(t=>!nt(t,e))}function nt(i,e){return i.visible&&(i.minScale===0||ke(e.scale,i.minScale)||e.scalei.maxScale)}async function _(i,e){try{return await i}catch(t){if(t.name!=="no-queryEngine")throw t;return e}}function Q(i,e){const t=new Set;for(const r of i instanceof Set?i.values():i.keys())e.has(r)||t.add(r);return t}class rr{constructor(e){this.version=e}}class sr{constructor(e){this._subscriptions=new Map,this._visible=new Set,this._paused=new Set,this._version=0,this._config=e}destroy(){}get _coverageSet(){const e=this._coverage?Array.from(this._coverage.keys()).map(t=>t.id):[];return new Set(e)}suspend(){this._suspendedOverage=this._coverage,this._coverage=null,this._updateSubscriptions()}resume(){this._coverage==null&&(this._coverage=this._suspendedOverage,this._suspendedOverage=null,this._updateSubscriptions())}update(e){return this._version=this._version+1%Number.MAX_SAFE_INTEGER,this._updateCoverage(e),this._updateSubscriptions(),new Set(this._visible)}_updateCoverage(e){this._coverage=this._config.tileInfoView.getTileCoverage(e.state,0,!0,"closest")}_updateSubscriptions(){const e=this._coverageSet,t=this._updateVisibility(),r=Q(t,e),s=Q(this._subscriptions,t),a=Q(e,this._subscriptions),n=Q(s,e),o=Q(r,n),u=Q(o,this._paused);this._visible=t;for(const l of a.values())this._subscriptions.set(l,new rr(this._version));for(const l of u.values())this._paused.add(l);for(const l of n.values())this._subscriptions.delete(l),this._paused.delete(l);(a.size||n.size||u.size)&&this._sendUpdateSubscriptions(a,n,u)}_sendUpdateSubscriptions(e,t,r){const s=Array.from(e.values()).map(a=>({tileId:a,version:this._subscriptions.get(a).version}));this._config.updateSubscriptions({subscribe:s,unsubscribe:Array.from(t.values()),pause:Array.from(r.values()),tileInfoJSON:this._config.tileInfoView.tileInfo.toJSON()})}_updateVisibility(){const e=new Set;if(!this._coverage)return e;for(const t of this._coverage.keys()){if(this._config.isDone(t)){e.add(t.id);continue}this._addVisibleParent(e,t)||this._addVisibleChildren(e,t)||e.add(t.id)}return e}_addVisibleParent(e,t){let r=!1;for(const s of this._visible.values())new xe(s).containsChild(t)&&(e.add(s),r=!0);return r}_addVisibleChildren(e,t){let r=!1;for(const s of this._visible.values()){const a=new xe(s);t.containsChild(a)&&(e.add(s),r=!0)}return r}}const ar=i=>{let e=class extends i{constructor(...t){super(...t),this._updatingRequiredFieldsPromise=null,this.dataUpdating=!1,this.filter=null,this.timeExtent=null,this.layer=null,this.requiredFields=[],this.view=null}initialize(){this.addHandles([Ee(()=>{var r;const t=this.layer;return[t&&"elevationInfo"in t?(r=t.elevationInfo)==null?void 0:r.featureExpressionInfo:null,t&&"displayField"in t?t.displayField:null,t&&"timeInfo"in t&&t.timeInfo,t&&"renderer"in t&&t.renderer,t&&"labelingInfo"in t&&t.labelingInfo,t&&"floorInfo"in t&&t.floorInfo,this.filter,this.featureEffect,this.timeExtent]},()=>this._handleRequiredFieldsChange(),St),qe(()=>{var t;return(t=this.view)==null?void 0:t.floors},"change",()=>this._handleRequiredFieldsChange()),qe(()=>{const t=this.layer;return t&&"sublayers"in t?t.sublayers:null},"change",()=>this._handleRequiredFieldsChange())])}get availableFields(){if(!this.layer)return[];const{layer:t,layer:{fieldsIndex:r},requiredFields:s}=this;return"outFields"in t&&t.outFields?Ue(r,[...Le(r,t.outFields),...s]):Ue(r,s)}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(t){this._override("featureEffect",t)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(t){q.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}highlight(t){throw new Error("missing implementation")}createQuery(){const t={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},r=this.filter!=null?this.filter.createQuery(t):new ye(t);if("floorInfo"in this.layer&&this.layer.floorInfo){const s=Ze(this);s!=null&&(r.where=r.where?`(${r.where}) AND (${s})`:s)}return this.timeExtent!=null&&(r.timeExtent=r.timeExtent!=null?r.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),r}createAggregateQuery(){const t={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new ye(t)}queryFeatures(t,r){throw new Error("missing implementation")}queryObjectIds(t,r){throw new Error("missing implementation")}queryFeatureCount(t,r){throw new Error("missing implementation")}queryExtent(t,r){throw new Error("missing implementation")}async fetchPopupFeaturesFromGraphics(t,r){return this._validateFetchPopupFeatures(t,r),this._fetchPopupFeatures(t,r)}_loadArcadeModules(t){var r;return(r=t.expressionInfos)!=null&&r.length||Array.isArray(t.content)&&t.content.some(s=>s.type==="expression")?vt():Promise.resolve()}_handleRequiredFieldsChange(){const t=this._updateRequiredFields();this._set("_updatingRequiredFieldsPromise",t),t.then(()=>{this._updatingRequiredFieldsPromise===t&&this._set("_updatingRequiredFieldsPromise",null)})}async _updateRequiredFields(){if(!this.layer||!this.view)return;const t=this.view.type==="3d",{layer:r,layer:{fieldsIndex:s,objectIdField:a}}=this,n="renderer"in r&&r.renderer,o="orderBy"in r&&r.orderBy,u="featureReduction"in r?r.featureReduction:null,l=new Set,c=await Promise.allSettled([n?n.collectRequiredFields(l,s):null,Be(l,r),t&&"elevationInfo"in r?_t(l,r):null,this.filter!=null?Je(l,r,this.filter):null,t||this.featureEffect==null?null:Je(l,r,this.featureEffect.filter),!t&&u?wt(l,r,u):null,!t&&o?Vt(l,r,o):null]);if("timeInfo"in r&&r.timeInfo&&this.timeExtent&&ce(l,r.fieldsIndex,[r.timeInfo.startField,r.timeInfo.endField]),"floorInfo"in r&&r.floorInfo&&ce(l,r.fieldsIndex,[r.floorInfo.floorField]),r.type==="feature"&&t&&r.infoFor3D!=null&&(r.globalIdField==null&&q.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),ce(l,r.fieldsIndex,[r.globalIdField])),r.type==="subtype-group"){ve(l,s,r.subtypeField);const p=r.sublayers.map(y=>{var m;return Promise.all([(m=y.renderer)==null?void 0:m.collectRequiredFields(l,s),Be(l,y)])});await Promise.allSettled(p)}r.type==="catalog-footprint"&&ce(l,s,[r.parent.itemSourceField,r.parent.itemTypeField]);for(const p of c)p.status==="rejected"&&q.getLogger(this).error(p.reason);ve(l,s,a),t&&"displayField"in r&&r.displayField&&ve(l,s,r.displayField);const d=Array.from(l).sort();this._set("requiredFields",d)}_validateFetchPopupFeatures(t,r){if(r!=null)for(const s of t){const a=s.origin&&"layer"in s.origin?s.origin.layer:s.layer;if("popupEnabled"in a&&!a.popupEnabled)throw new C("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:a});if(s.isAggregate){const n="featureReduction"in a?a.featureReduction:null;if(!(n&&"popupTemplate"in n&&n.popupEnabled&&n.popupTemplate))throw new C("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:a})}else if("popupTemplate"in a&&!Ve(a,r))throw new C("featurelayerview:fetchPopupFeatures","Layer does not define a popup template",{layer:a})}}_popupFeatureHasRequiredFields(t,r){return It(r,t)}async _fetchPopupFeatures(t,r){var o;const s=new Array(t.length),a=new Map,n=await this._createPopupQuery(t.map(u=>{var l;return((l=u.origin)==null?void 0:l.layer)??u.layer}),r);for(let u=0;uthis._createPopupQuery(void 0,t)}}get test(){return this.getTest()}};return h([f()],e.prototype,"_updatingRequiredFieldsPromise",void 0),h([f({readOnly:!0})],e.prototype,"availableFields",null),h([f({readOnly:!0})],e.prototype,"dataUpdating",void 0),h([f({type:Pt})],e.prototype,"featureEffect",null),h([f({type:te})],e.prototype,"filter",void 0),h([f(bt)],e.prototype,"timeExtent",void 0),h([f()],e.prototype,"layer",void 0),h([f({type:Number})],e.prototype,"maximumNumberOfFeatures",null),h([f({readOnly:!0,type:Boolean})],e.prototype,"maximumNumberOfFeaturesExceeded",null),h([f({readOnly:!0})],e.prototype,"requiredFields",void 0),h([f()],e.prototype,"suspended",void 0),h([f()],e.prototype,"view",void 0),e=h([Z("esri.views.layers.FeatureLayerView")],e),e};function nr(i,e){const t=new Set;return i&&i.forEach(r=>t.add(r)),e&&e.forEach(r=>t.add(r)),t.has("*")?["*"]:Array.from(t)}const lr="esri.views.2d.layers.FeatureLayerView2D",Xe=4294967294;let I=class extends ar(Yt(Nt(kt))){constructor(){super(...arguments),this._commandsQueue=new Zt({process:i=>{switch(i.type){case"processed-edit":return this._doEdit(i);case"update":return this._doUpdate()}}}),this._visibilityOverrides=new Set,this._highlightCounter=new Wt,this._updateHighlight=xt(async()=>{const i=[];for(const e of this._highlightCounter.ids()){const t=this._highlightCounter.getHighestReason(e),r=Mt(t);i.push({objectId:e,highlightFlags:r})}this._worker.pipeline.updateHighlight({highlights:i})}),this._lastAvailableFields=[],this.eventLog=new T,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._fields=null,this.featureEffectView=new ei}destroy(){var i;(i=this._worker)==null||i.destroy(),this._commandsQueue.destroy()}initialize(){this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransitions()}async _initProxy(){var t;const i=this.layer;if("isTable"in i&&i.isTable)throw new C("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:i});if(i.geometryType==="mesh")throw new C("featurelayerview:geometry-type-not-supported",`Geometry type of ${i.geometryType} is not supported`,{layer:i});if((i.type==="feature"||i.type==="subtype-group")&&((t=N(i))==null?void 0:t.operations.supportsQuery)===!1)throw new C("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:i});this._worker&&this._worker.destroy();const e=this._createClientOptions();this._worker=await ni(e)}get hasAllFeatures(){return this.layer.visible&&this.eventLog.hasAllFeatures}get hasAllFeaturesInView(){return this.layer.visible&&this.eventLog.hasAllFeaturesInView}get hasFullGeometries(){return this.layer.visible&&this.eventLog.hasFullGeometries}get labelingCollisionInfos(){const i=this.layerAdapter.getLabelingDeconflictionInfo(this.view),e=this.layer.geometryType,t=!this.suspended;return i.map(({vvEvaluators:r,deconflictionEnabled:s})=>({container:this.featureContainer,vvEvaluators:r,deconflictionEnabled:s,geometryType:e,visible:t}))}get layerAdapter(){switch(this.layer.type){case"feature":return this.layer.source.type==="memory"?new We(this.layer):new ji(this.layer);case"geojson":case"csv":case"wfs":return new We(this.layer);case"subtype-group":return new tr(this.layer);case"ogc-feature":return new Gi(this.layer);case"stream":return new Zi(this.layer);case"oriented-imagery":return new Ki(this.layer);case"knowledge-graph-sublayer":return new Qi(this.layer);case"catalog-footprint":return new Ji(this.layer);default:Et(this.layer)}return null}get updateHash(){if(!this.layerAdapter)return null;const{availableFields:i,_displayRefreshVersion:e,timeExtent:t,clips:r,filter:s,featureEffect:a,_sourceRefreshVersion:n,view:{timeZone:o}}=this,u=JSON.stringify(r),l=a==null?void 0:a.toJSON(),c=s==null?void 0:s.toJSON();return JSON.stringify({availableFields:i,clipsHash:u,displayRefreshVersion:e,effectHash:l,filterHash:c,sourceRefreshVersion:n,timeExtent:t,timeZone:o,...this.layerAdapter.getUpdateHashProperties(this.view)})}getDisplayStatistics(i,e){var t;return(t=this.featureContainer)==null?void 0:t.getDisplayStatistics(i,e)}async queryHeatmapStatistics(i){return this._worker.pipeline.queryHeatmapStatistics(i)}highlight(i,e="highlight"){let t;i instanceof Ie?t=[i.getObjectId()]:typeof i=="number"||typeof i=="string"?t=[i]:Ft.isCollection(i)&&i.length>0?t=i.map(s=>s==null?void 0:s.getObjectId()).toArray():Array.isArray(i)&&i.length>0&&(t=typeof i[0]=="number"||typeof i[0]=="string"?i:i.map(s=>s==null?void 0:s.getObjectId()));const r=t==null?void 0:t.filter(Rt);return r!=null&&r.length?(this._addHighlight(r,e),De(()=>this._removeHighlight(r,e))):De()}getHighlightIds(){return Array.from(this._highlightCounter.ids())}hasHighlight(){return!this._highlightCounter.empty}async hitTest(i,e){const t=await this.featureContainer.hitTest(e);if(t.length===0)return null;const{features:r,aggregates:s}=await this._worker.pipeline.getDisplayFeatures(t),a=this.featureContainer.getSortKeys(t),n=({displayId:o},{displayId:u})=>a.has(o)&&a.has(u)?a.get(o)-a.get(u):o-u;return r.sort(n).reverse(),s.sort(n).reverse(),[...s.map(o=>this._createGraphicHit(i,$e.fromJSON(o))),...r.map(o=>this._createGraphicHit(i,Ie.fromJSON(o)))]}queryStatistics(){return _(this._worker.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}querySummaryStatistics(i,e,t){const r={...e,scale:this.view.scale},s=this._worker.features.executeQueryForSummaryStatistics(this._cleanUpQuery(i),r,t);return _(s,{})}async queryAggregateSummaryStatistics(i,e,t){const r={...e,scale:this.view.scale},s=this._worker.aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(i),r,t);return _(s,{})}async queryUniqueValues(i,e,t){const r={...e,scale:this.view.scale},s=this._worker.features.executeQueryForUniqueValues(this._cleanUpQuery(i),r,t);return _(s,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(i,e,t){const r={...e,scale:this.view.scale},s=this._worker.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(i),r,t);return _(s,{uniqueValueInfos:[]})}async queryClassBreaks(i,e,t){const r={...e,scale:this.view.scale},s=this._worker.features.executeQueryForClassBreaks(this._cleanUpQuery(i),r,t);return _(s,{classBreakInfos:[]})}async queryAggregateClassBreaks(i,e,t){const r={...e,scale:this.view.scale},s=this._worker.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(i),r,t);return _(s,{classBreakInfos:[]})}async queryHistogram(i,e,t){const r={...e,scale:this.view.scale},s=this._worker.features.executeQueryForHistogram(this._cleanUpQuery(i),r,t);return _(s,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(i,e,t){const r={...e,scale:this.view.scale},s=this._worker.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(i),r,t);return _(s,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(i,e){return this.queryFeaturesJSON(i,e).then(t=>{const r=Fe.fromJSON(t);return r.features.forEach(s=>this._setLayersForFeature(s)),r})}async queryVisibleFeatures(i,e){const t=this._worker.pipeline.queryVisibleFeatures(this._cleanUpQuery(i),e),r=await _(t,{features:[]}),s=Fe.fromJSON(r);return s.features.forEach(a=>this._setLayersForFeature(a)),s}async queryAggregates(i,e){const t=this._worker.aggregates.executeQuery(this._cleanUpAggregateQuery(i),e),r=await _(t,{features:[]}),s=ti.fromJSON(r);return s.features.forEach(a=>this._setLayersForFeature(a)),s}queryAggregateIds(i,e){const t=this._worker.aggregates.executeQueryForIds(this._cleanUpAggregateQuery(i),e);return _(t,[])}queryAggregateCount(i,e){const t=this._worker.aggregates.executeQueryForCount(this._cleanUpAggregateQuery(i),e);return _(t,0)}queryAggregateJSON(i,e){const t=this._worker.aggregates.executeQuery(this._cleanUpAggregateQuery(i),e);return _(t,{features:[]})}async queryFeaturesJSON(i,e){const t=this._worker.features.executeQuery(this._cleanUpQuery(i),e);return _(t,{features:[]})}queryObjectIds(i,e){const t=this._worker.features.executeQueryForIds(this._cleanUpQuery(i),e);return _(t,[])}queryFeatureCount(i,e){const t=this._worker.features.executeQueryForCount(this._cleanUpQuery(i),e);return _(t,0)}async queryExtent(i,e){const t=this._worker.features.executeQueryForExtent(this._cleanUpQuery(i),e),r=await _(t,{count:0,extent:null});return{count:r.count,extent:Ot.fromJSON(r.extent)}}async getSampleFeatures(i){return this._worker.pipeline.getSampleFeatures(i)}setVisibility(i,e){e?this._visibilityOverrides.delete(i):this._visibilityOverrides.add(i),this._update()}update(i){if(!this._subscriptionManager)return;const e=this._subscriptionManager.update(i);this.featureContainer.setVisibleTiles(e)}attach(){g("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),this.featureContainer=new ai(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._subscriptionManager=new sr({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:i=>{this.featureContainer.updateSubscriptions(i),this._worker.pipeline.updateSubscriptions(i)},isDone:i=>this.featureContainer.isDone(i)}),this.requestUpdate(),this.addAttachHandles([Ee(()=>this.updateHash,()=>this._update(),$t),Ee(()=>this.updateSuspended,i=>{i||this._subscriptionManager.resume()})]),this.layer.type!=="stream"&&this.layer.type!=="catalog-footprint"&&this.addAttachHandles(this.layer.on("edits",i=>this._edit(i)))}detach(){g("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._fields=null,this.featureContainer.destroy(),this._commandsQueue.clear(),this.container.removeAllChildren(),this._subscriptionManager=zt(this._subscriptionManager),this._worker.pipeline.onDetach()}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){const i="renderer"in this.layer&&this.layer.renderer!=null,e=this._commandsQueue.updateTracking.updating,t=this._updatingRequiredFieldsPromise!=null,r=this.featureContainer.updatingHandles.updating,s=i&&(e||t)||r||this._pipelineUpdating||this.dataUpdating;if(g("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${s} -> hasRenderer ${i} -> updatingRequiredFields ${t} diff --git a/assets/FeaturePipelineWorker-6OTTsaNH.js b/assets/FeaturePipelineWorker--iWINXTy.js similarity index 98% rename from assets/FeaturePipelineWorker-6OTTsaNH.js rename to assets/FeaturePipelineWorker--iWINXTy.js index ee59c73..426aaeb 100644 --- a/assets/FeaturePipelineWorker-6OTTsaNH.js +++ b/assets/FeaturePipelineWorker--iWINXTy.js @@ -1 +1 @@ -import{a as we,ij as x,kg as ht,ca as xe,bF as ke,aS as V,bo as Ht,bp as Jt,ip as Kt,eW as ut,E as y,eN as Fe,u as dt,at as Y,aX as ct,b7 as es,b2 as ts,d as G,y as K,f as lt,a7 as _t,g as pe,N as D,ah as ss,s as rs,lX as is,ia as se,ib as ns,i3 as pt,I as as,eF as gt,M as os,jm as hs,df as Te,bh as us,cY as ds,lY as cs,dZ as De,h as Le}from"./index-CEWggaxV.js";import{m as ft,p as he,d as ze,s as Ue}from"./diffUtils-B4YFa5Ju.js";import{n as Ge,i as A,r as ls,M as Ce,p as Me,d as yt,f as $e,g as _s,a as ps,b as gs,h as fs,j as ys}from"./AttributeStore-Ck-75lnq.js";import{o as ms}from"./tileUtils-B7X19rIS.js";import{S as bs,R as Is,A as vs}from"./geohashUtils-CTQSvgbV.js";import{g as Ss,e as ws,c as mt,N as xs,n as bt,p as ks,b as Fs,w as Ts,a as X,K as Cs,O as Ms,r as $s,f as It}from"./featureConversionUtils-CmP9mw0r.js";import{s as H,t as B,e as T}from"./OptimizedGeometry-CQuTPb9g.js";import{x as Os,j as We}from"./timeSupport-BjRbXIpn.js";import{o as qs,$ as vt}from"./QueryEngine-RpcY23Sv.js";import{Z as St}from"./FieldsIndex-CLgRNeJ_.js";import{d as As,c as Ne,S as Rs}from"./query-BM8R3sQ6.js";import{m as wt}from"./quantizationUtils-CUjGHrU3.js";import{$ as Be}from"./ogcFeatureUtils-D4df60hh.js";import{n as Es}from"./pbf-D9QZb8S8.js";import{b as Ps,h as js}from"./pbfQueryUtils-CLRSFGBm.js";import{t as Ve}from"./CircularArray-DfLrgW_-.js";import{createConnection as Ds}from"./createConnection-BxU4QDA7.js";import{d as Ls}from"./UpdateTracking2D-nj9Q-3df.js";import"./LabelMetric-D2hbzzy_.js";import"./Texture-DJgkMrSB.js";import"./Program-DLRmaKpw.js";import"./labelUtils-Dnqx6jl5.js";import"./defaultsJSON-CHAaurhX.js";import"./TimeOnly-Cm47ew5I.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./highlightReasons-DbgbcWKM.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./json-Wa8cmqdu.js";import"./WhereClause-Dzgyc0wk.js";import"./QueryEngineCapabilities-CTDe3LlQ.js";import"./utils-B8iadP2F.js";import"./heatmapUtils-Clt5rJzr.js";import"./utils-SjO_-1JL.js";import"./utils-GMt8_G3w.js";import"./ClassBreaksDefinition-D281x8Sj.js";import"./RenderState-DaVlEYWY.js";import"./queryZScale-DN4aFXYn.js";import"./geojson-BLwRz6JF.js";import"./date-M6n_RqpC.js";import"./clientSideDefaults-CgRgH99f.js";import"./sourceUtils-QX9lwl5p.js";import"./TurboLine-CkxIB4ZX.js";import"./earcut-hRlx3adE.js";import"./utils-p-5Bbga5.js";import"./Rect-CUzevAry.js";import"./BindType-BmZEZMMh.js";import"./Util-BS8sJGjF.js";import"./constants-D5zmR9t2.js";let zs=class{constructor(e){this._client=e,this.layerView=this._client.createInvokeProxy("",{ignoreConnectionErrors:!0}),this.container=this._client.createInvokeProxy("container",{ignoreConnectionErrors:!0}),this.eventLog=this._client.createInvokeProxy("eventLog",{ignoreConnectionErrors:!0})}};const re=1,Oe=2,ie=4,qe=8,Ae=16,ne=32,Re=64,ae=128;function ue(u){switch(u){case re:case qe:case ne:return-1;case Oe:case Re:return 0;case ie:case Ae:case ae:return 1}}function de(u){switch(u){case re:case Oe:case ie:return-1;case qe:case Ae:return 0;case ne:case Re:case ae:return 1}}const Ye=re|qe|ne,Xe=ie|Ae|ae,Qe=re|Oe|ie,Ze=ne|Re|ae;let Us=class{constructor(e,t,s,r=0){this.tileKey=e,this._bufferingEnabled=t,this._sizeHint=r,this._meshes={self:new Ge(this.id,this._sizeHint),neighbors:new Array},this._currentRecordOverlaps=0,this._currentEntityOverlaps=0,this._copyBufferedDataIntoSelf=s&&this._bufferingEnabled&&e.level===0}get id(){return this.tileKey.id}vertexCount(){return this._meshes.self.vertexCount()}indexCount(){return this._meshes.self.indexCount()}indexEnsureSize(e){this._meshes.self.indexEnsureSize(e)}entityStart(e,t=e){this._currentEntityOverlaps=0,this._meshes.self.entityStart(e,t)}entityRecordCount(){return this._meshes.self.entityRecordCount()}entityEnd(){if(this._meshes.self.entityEnd(),this._bufferingEnabled){if(this._copyBufferedDataIntoSelf)return;for(let e=0;e<8;e++){const t=1<{const n=r.serialize(),a=1<=x-i?Ye:Xe|Ye)|(t<0+n?Ze:t>=x-n?Qe:Ze|Qe));this._currentRecordOverlaps|=a}_copyIntoNeighbors(){for(let e=0;e<8;e++){const t=1<0){const r=this.getBackgroundFill();if(r)return[...r,...s]}return s}getSortKey(e,t){return 0}doMatch(e,t){return null}async fetchResources(e,t){}},Ws=class kt extends L{static async fromDictionaryRenderer(e,t,s){return new kt(e,t,s)}constructor(e,t,s){super(),this._storage=e,this._schema=t,this._viewParams=s,this._hashToGroup=new Map}get fieldMap(){return this._schema.fieldMap}async fetchResources(e,t){const s=t.getCursor(),r=[];for(;s.next();)r.push(this._updateMeshWriterGroup(e,s));await Promise.all(r)}match(e,t){const s=e.getAttributeHash();return this._hashToGroup.get(s)}async _updateMeshWriterGroup(e,t){const s=t.readLegacyFeatureForDisplay(),r=t.getAttributeHash();if(this._hashToGroup.has(r))return;this._hashToGroup.set(r,null);const i=await e.fetchDictionaryResourceImmediate({type:"dictionary-request",feature:s});if(!i)return;const n=await A(this._storage,e,i.meshes,this._viewParams);this._hashToGroup.set(r,n)}},Ns=class Ft extends L{constructor(e,t){super(),this._intervals=[],this._isMaxInclusive=t,this._field=e}static async fromIntervalSchema(e,t,s,r){const i=await e.createComputedField(s),n=new Ft(i,s.isMaxInclusive);await Promise.all(s.intervals.map(async h=>{const c=await A(e,t,h.meshes,r);n.add(h,c)}));const a=await A(e,t,s.defaultSymbol,r);n.setDefault(a);const o=await A(e,t,s.backgroundFill,r);return n.setBackgroundFill(o),n}add(e,t){this._intervals.push({interval:e,result:t}),this._intervals.sort((s,r)=>s.interval.min-r.interval.min)}size(){return super.size()+this._intervals.length}doMatch(e,t){var r;const s=(r=this._field)==null?void 0:r.read(e,t);if(s==null||isNaN(s)||s===1/0||s===-1/0)return null;for(let i=0;i=n.min,h=this._isMaxInclusive?s<=n.max:s{const o=await A(e,t,a.meshes,r);return{minScale:a.minScale,maxScale:a.maxScale,meshes:o,expression:null,where:await e.createWhereClause(a.where)}}),n=await Promise.all(i);return new Tt(n)}constructor(e){super(),this._labels=e}match(e,t){if(!this._labels.length)return null;const s=this._getLabels(t.$view.scale),r=[];for(const i of s)i.where&&!i.where(e)||r.push(...i.meshes);return r}_getLabels(e){return this._labels.filter(t=>this._validForTileScale(t,e))}_validForTileScale(e,t){const s=t-t/4,r=t+t/2;return(!e.minScale||e.minScale>=s)&&(!e.maxScale||e.maxScale<=r)}},Vs=class Ct extends L{constructor(e,t){super(),this._defaultSymbolSortKey=0,this._nullResult=null,this._resultsMap=new Map,this._fields=[],this._fields=e,this._separator=t||""}static async fromMatcherSchema(e,t,s,r){const i=s.expression?[e.createComputedField({expression:s.expression})]:[s.field?e.createComputedField({field:s.field}):null,s.field2?e.createComputedField({field:s.field2}):null,s.field3?e.createComputedField({field:s.field3}):null],n=(await Promise.all(i)).filter(c=>!!c),a=new Ct(n,s.fieldDelimiter),o=await A(e,t,s.defaultSymbol,r);a.setDefault(o);const h=await A(e,t,s.backgroundFill,r);return a.setBackgroundFill(h),await Promise.all(s.map.map(async(c,d)=>{const l=await A(e,t,c.symbol,r);c.value===""?a.setNullResult(l):a.add(c.value,l,d+1)})),a}setNullResult(e){this._nullResult=e}getSortKey(e,t){const s=this._getValueFromFields(e,t);if(s==null||s===""||s==="")return 0;const r=this._resultsMap.get(s.toString());return r?r.sortKey:this._defaultSymbolSortKey}add(e,t,s){this._resultsMap.set(e.toString(),{meshWriters:t,sortKey:s}),this._defaultSymbolSortKey=Math.max(this._defaultSymbolSortKey,s+1)}size(){return super.size()+this._resultsMap.size}doMatch(e,t){var i;const s=this._getValueFromFields(e,t);if(this._nullResult!==null&&(s==null||s===""||s===""))return this._nullResult;if(s==null)return null;const r=s.toString();return(i=this._resultsMap.get(r))==null?void 0:i.meshWriters}_getValueFromFields(e,t){const s=[];for(const r of this._fields){const i=r.read(e,t);i==null||i===""?s.push(""):s.push(i)}return s.join(this._separator)}};async function Q(u,e,t,s){switch(t.type){case"simple":case"heatmap":case"dot-density":case"pie-chart":return L.from(u,e,t,s);case"interval":return Ns.fromIntervalSchema(u,e,t,s);case"dictionary":return Ws.fromDictionaryRenderer(u,t,s);case"label":return Bs.fromLabelSchema(u,e,t,s);case"map":return Vs.fromMatcherSchema(u,e,t,s);case"subtype":return Ys.fromSubtypes(u,e,t,s);case"cluster":return Xs.fromClusterSchema(u,e,t,s);default:throw new Error("Impl")}}let Ys=class Mt extends L{constructor(e,t){super(),this._subMatchers=e,this._subtypeField=t}static async fromSubtypes(e,t,s,r){const i=new Map,n=[];for(const a in s.renderers){const o=parseInt(a,10),h=Q(e,t,s.renderers[a],r).then(c=>i.set(o,c));n.push(h)}return await Promise.all(n),new Mt(i,s.subtypeField)}match(e,t){const s=e.readAttribute(this._subtypeField),r=this._subMatchers.get(s);return r?r.match(e,t):null}},Xs=class $t extends L{static async fromClusterSchema(e,t,s,r){const[i,n]=await Promise.all([Q(e,t,s.feature,r),Q(e,t,s.cluster,r)]);return new $t(i,n)}constructor(e,t){super(),this._featureMatcher=e,this._clusterMatcher=t}match(e,t){return e.readAttribute("cluster_count")===1?this._featureMatcher.match(e,t):this._clusterMatcher.match(e,t)}},Qs=class Ot extends Gs{static async create(e,t,s,r){const i=await Q(e,t,s.symbology,r),n=s.labels?await Q(e,t,s.labels,r):null;return new Ot(i,n)}constructor(e,t){super(),this._symbology=e,this._labels=t}destroy(){}async enqueueMatcherRequests(e,t){var s;await Promise.all([this._symbology.fetchResources(e,t),(s=this._labels)==null?void 0:s.fetchResources(e,t)])}enqueueWriterRequests(e,t,s){const r=this._symbology.match(t,s);if(r){for(const i of r)i.enqueueRequest(e,t,s);if(this._labels){const i=this._labels.match(t,s);if(!i)return;for(const n of i)n.enqueueRequest(e,t,s)}}}write(e,t,s,r,i){const n=this._symbology.match(s,r);if(n){for(const a of n)a.write(e,t,s,r,i);if(e.entityRecordCount()>=1&&this._labels){const a=this._labels.match(s,r);if(!a)return;for(const o of a)o.setReferences(n),o.write(e,t,s,r,i)}}}getSortKey(e,t){return this._symbology.getSortKey(e,t)}},Zs=class{constructor(e){this._outstandingMessages=[],this._queue=new ht({concurrency:e.concurrency,process:t=>e.process(t)})}async push(e){if(e.end)return await Promise.all(this._outstandingMessages),await this._queue.push(e),void(this._outstandingMessages=[]);const t=this._queue.push(e);return this._outstandingMessages.push(t),t}},qt=class ge{static async create(e,t){var r;if(t.statisticType==="count"){const i=new ls(1);return new ge(t.name,t.alias,t.type,t.statisticType,i)}const s=await e.createComputedField({expression:(r=t.onStatisticExpression)==null?void 0:r.expression,field:t.onStatisticField});return new ge(t.name,t.alias,t.type,t.statisticType,s)}constructor(e,t,s,r,i){this.name=e,this.alias=t,this.type=s,this.statisticType=r,this.computed=i}},Ee=class{constructor(e){this.subscription=e,this.handledChunks=new Set}destroy(){}},At=class{constructor(e,t){this._source=e,this._attributeStore=t,this._sendStates=new Map}destroy(){}get enablePixelBuffering(){return!0}onSubscribe(e){const t=this.createState(e);this._sendStates.set(e.key.id,t),this.updateChunks()}onUnsubscribe(e){var t;(t=this._sendStates.get(e.key.id))==null||t.destroy(),this._sendStates.delete(e.key.id)}invalidate(){const e=Array.from(this._sendStates.values());this._sendStates.clear();for(const t of e)t.destroy(),this.onSubscribe(t.subscription)}invalidateAttributeData(){}getFeatureObjectIdsForAggregate(e){throw new Error("InternalError: AggregateId lookup not supported")}getDisplayIds(e){return this.displayMap(e,t=>t,t=>t)}getDisplayAndObjectIds(e){return this.displayMap(e,t=>t,(t,s,r)=>[t,r])}afterUpdateChunks(){}},Rt=class extends At{constructor(e,t,s,r){super(e,t),this.spatialReference=s,this.aggregateFields=r,this.events=new xe,this.featureAdapter=qs}get aggregateQueryEngine(){return this._aggregateQueryEngine||(this._aggregateQueryEngine=new vt({featureStore:this,fieldsIndex:this._metadata.fieldsIndex,geometryType:this._metadata.geometryType,objectIdField:this._metadata.objectIdField,spatialReference:this.spatialReference})),this._aggregateQueryEngine}removeChunks(e){}forEach(e){return this.forEachAggregateWorldSpace(e)}forEachInBounds(e,t){}forEachBounds(e,t){const s=ke();for(const r of e){const i=Ss(s,r.geometry,!1,!1);i&&t(i)}}},Pe=class{constructor(e,t,s,r,i){this.subscription=e,this.reader=t,this.clear=s,this.end=r,this.debugInfo=i,this.type="append"}get id(){return this.subscription.tile.id}createMessage(e,t,s){return{type:"append",clear:this.clear,id:this.id,append:e,end:this.end,debugInfo:this.debugInfo,subscriptionVesrion:this.subscription.version,version:t,attributeEpoch:s}}},fe=class{constructor(e,t,s,r,i){this.subscription=e,this.reader=t,this.remove=s,this.end=r,this.debugInfo=i,this.type="update"}get id(){return this.subscription.tile.id}createMessage(e,t,s){return{type:"update",id:this.id,modify:e,debugInfo:this.debugInfo,remove:this.remove,version:t,subscriptionVesrion:this.subscription.version,end:this.end,attributeEpoch:s}}},M=class j extends Ce{static fromFeatures(e,t){const{objectIdField:s,geometryType:r}=t,i=ws([],e,r,!1,!1,s);for(let n=0;n!(s.objectId!=null&&t.has(s.objectId)))}getSize(){return this._features.length}getCursor(){return this.copy()}getInTransform(){return this._transform}getAttributeHash(){let e="";for(const t in this._current.attributes)e+=this._current.attributes[t];return e}getIndex(){return this._featureIndex}setIndex(e){this._featureIndex=e}getObjectId(){var e;return(e=this._current)==null?void 0:e.objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){this._current.displayId=e}copy(){const e=new j(this._features,this.metadata);return this.copyInto(e),e}next(){for(;++this._featureIndexqt.create(n,c))),h=e.featureFilter?await yt.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:t,filterJSON:e.featureFilter}):null;return await Os(t,V.WGS84),new Et({fields:o,geohashLevel:a,spatialReference:t,featureFilter:h,timeZone:i},e.fields,s,r)}constructor(e,t,s,r){super(s,r,e.spatialReference,e.fields),this._indexOptions=e,this._metadata=new $e({geometryType:"esriGeometryPolygon",objectIdField:"aggregateId",fields:t,globalIdField:null,spatialReference:s.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null})}createState(e){return new Hs(e,this._attributeStore)}async*applyOverride(e){for(const t of this._sendStates.values())t.reset(),yield new Pe(t.subscription,M.empty(this._source.metadata),!0,!1,{})}displayMap(e,t,s){const r=new Map(e.map(n=>[t(n),n])),i=[];for(const n of this._sendStates.values())for(const a of n.featuresWorldSpace()){const{objectId:o,displayId:h}=a,c=r.get(o);if(c!=null){const d=s(h,c,o);i.push(d),r.delete(o)}}return i}getDisplayFeatures(e){const t=new Set(e),s=new Set,r=[];for(const i of this._sendStates.values())for(const n of i.featuresWorldSpace())t.has(n.displayId)&&!s.has(n.objectId)&&(n.geometry&&r.push({...bt(n,this._metadata.geometryType,!1,!1),displayId:n.displayId}),s.add(n.objectId));return{features:[],aggregates:r}}getFeatureObjectIdsForAggregate(e){for(const t of this._sendStates.values())for(const s of t.bins.values())if(s.id===e)return Array.from(s.objectIds);return[]}async*updateChunks(){if(this._source.chunks().length)for(const e of this._sendStates.values())yield*this._update(e,this._source)}forEachAggregateWorldSpace(e){for(const t of this._sendStates.values())for(const s of t.featuresWorldSpace())e(s)}async*_update(e,t){const{handledChunks:s,subscription:r,bins:i}=e,{spatialReference:n,geohashLevel:a}=this._indexOptions,o=r.tile;if(e.done)return;for(const p of t.chunks()){if(s.has(p.chunkId))continue;s.add(p.chunkId);const I=p.queryInfo;if("tileId"in I){const b=new we(I.tileId);if(b.level!==o.level||b.world!==o.key.world)continue}const f=p.getGeohashIndex(this._indexOptions),k=e.getGeohashBounds(n,a);k!=null&&f.putBins(i,k)}const h=[],c=r.tile.transform,d=r.tile.key.level;for(const p of i.values()){if(p.cachedFeature)p.cachedFeature.attributes=p.getAttributes();else{const I=p.getGeometry(this.spatialReference,c),f=new B(I,p.getAttributes(),null);I||(f.centroid=p.getGeometryCentroid(this.spatialReference,c)),f.objectId=p.id,f.displayId=this._attributeStore.createDisplayIdForObjectId(`${f.objectId}.${d}`),p.cachedFeature=f}h.push(p.cachedFeature)}this.events.emit("changed"),e.done=!t.updateTracking.updating;const l=M.fromOptimizedFeatures(h,this._metadata,c),g=l.getCursor(),_=e.subscription.tile.createArcadeEvaluationOptions(this._indexOptions.timeZone);for(;g.next();)this._attributeStore.setAttributeData(g.getDisplayId(),g,_);yield new fe(e.subscription,l,[],e.done,{})}};const He=Math.PI/180;let Pt=class ye{static create(e){return new ye(e.map(t=>Ks(t)))}constructor(e){this._statistics=e}values(){return this._statistics.values()}insert(e,t){for(const s of this._statistics)s.insert(e,t)}merge(e){for(let t=0;te.clone()))}};function Ks(u){switch(u.statisticType){case"min":return new er(u);case"max":return new tr(u);case"avg":return new rr(u);case"avg_angle":return new ir(u);case"sum":case"count":return new sr(u);case"mode":return new nr(u)}}let W=class{constructor(e){this.field=e}insert(e,t){if(!this.field.computed)return;const s=this.field.computed.read(e,t);_s(s)||this._insertValue(s)}},er=class jt extends W{constructor(){super(...arguments),this.type="min",this.value=Number.MAX_VALUE}_insertValue(e){this.value=Math.min(this.value,e)}merge(e){this.value=Math.min(this.value,e.value)}clone(){const e=new jt(this.field);return e.value=this.value,e}},tr=class Dt extends W{constructor(){super(...arguments),this.type="max",this.value=Number.MIN_VALUE}_insertValue(e){this.value=Math.max(this.value,e)}merge(e){this.value=Math.max(this.value,e.value)}clone(){const e=new Dt(this.field);return e.value=this.value,e}},sr=class Lt extends W{constructor(){super(...arguments),this.type="sum",this.value=0}_insertValue(e){this.value+=e}merge(e){this.value+=e.value}clone(){const e=new Lt(this.field);return e.value=this.value,e}},rr=class zt extends W{constructor(){super(...arguments),this.type="avg",this._total=0,this._count=0}get value(){return this._total/this._count}_insertValue(e){this._total+=e,this._count+=1}merge(e){this._total+=e._total,this._count+=e._count}clone(){const e=new zt(this.field);return e._total=this._total,e._count=this._count,e}},ir=class Ut extends W{constructor(){super(...arguments),this.type="avg_angle",this._x=0,this._y=0,this._count=0}get value(){const e=this._x/this._count,t=this._y/this._count,s=180/Math.PI;return Math.atan2(t,e)*s}_insertValue(e){this._x=this._x+Math.cos(e*He),this._y=this._y+Math.sin(e*He),this._count+=1}merge(e){this._x+=e._x,this._y+=e._y,this._count+=e._count}clone(){const e=new Ut(this.field);return e._x=this._x,e._y=this._y,e._count=this._count,e}},nr=class Gt extends W{constructor(){super(...arguments),this._frequencies=new Map}get value(){let e,t=0;for(const[s,r]of this._frequencies.entries())r>t&&(t=r,e=s);return e}_insertValue(e){const t=this._frequencies.get(e);t!=null?this._frequencies.set(e,t+1):this._frequencies.set(e,1)}merge(e){for(const[t,s]of e._frequencies.entries()){const r=this._frequencies.get(t);r!=null?this._frequencies.set(t,r+s):this._frequencies.set(t,s)}}clone(){const e=new Gt(this.field);return e._frequencies=new Map(this._frequencies),e}},me=class ee{static createId(e,t){return`${e}.${t}`}static create(e,t,s,r){return new ee(e,t,Pt.create(s),r)}constructor(e,t,s,r){this.gridX=e,this.gridY=t,this._statistics=s,this._worldUnitsPerCell=r,this._count=0,this._xWorldTotal=0,this._yWorldTotal=0,this._objectIds=new Set}get id(){return ee.createId(this.gridX,this.gridY)}get count(){return this._count}get statistics(){return this._statistics}get objectIds(){return this._objectIds}get firstObjectId(){return this._objectIds.values().next().value}get centroidXWorld(){return this._xWorldTotal/this._count}get centroidYWorld(){return this._yWorldTotal/this._count}clone(){const e=new ee(this.gridX,this.gridY,this._statistics.clone(),this._worldUnitsPerCell);return e._count=this._count,e._xWorldTotal=this._xWorldTotal,e._yWorldTotal=this._yWorldTotal,e._firstFeatureAttributes=this._firstFeatureAttributes,e._objectIds=new Set(this._objectIds),e}insert(e,t,s,r){this._count===0?this._firstFeatureAttributes=e.readAttributes():this._firstFeatureAttributes=null,this._count+=1,this._xWorldTotal+=s,this._yWorldTotal+=r,this._statistics.insert(e,t),this._objectIds.add(e.getObjectId())}merge(e){if(e._count!==0){this._count+=e._count,this._firstFeatureAttributes=e._firstFeatureAttributes,this._xWorldTotal+=e._xWorldTotal,this._yWorldTotal+=e._yWorldTotal,this._statistics.merge(e._statistics);for(const t of e._objectIds.values())this._objectIds.add(t)}}getCentroidX(e){return e==null?this.centroidXWorld:Fs(e,this.centroidXWorld)}getCentroidY(e){return e==null?this.centroidYWorld:Ts(e,this.centroidYWorld)}getCentroid(e){const t=new T([],[this.centroidXWorld,this.centroidYWorld]);if(e!=null){const s=new T;return X(s,t,!1,!1,"esriGeometryPoint",e)}return t}getGeometricCentroid(e){const t=this.gridX*this._worldUnitsPerCell+.5*this._worldUnitsPerCell,s=this.gridY*this._worldUnitsPerCell+.5*this._worldUnitsPerCell,r=new T([],[t,s]);if(e!=null){const i=new T;return X(i,r,!1,!1,"esriGeometryPoint",e)}return r}getAttributes(){const e={aggregateId:this.id};for(const t of this._statistics.values())e[t.field.name]=t.value;return this._firstFeatureAttributes!=null?{...e,...this._firstFeatureAttributes}:e}};const ar=96;function be(u,e){return Ht(u)*Jt*ar/e}let or=class{constructor(e){this._options=e,this._cells=new Map,this._pixelsPerMapUnit=be(e.spatialReference,e.scale)}insert(e,t){const s=e.getCursor(),r={$view:{scale:this._options.scale,timeZone:this._options.timeZone}};for(;s.next();)this._insertFeature(s,r,t)}putCellsInBounds(e,t){const[s,r,i,n]=t,a=Math.floor(s*this._pixelsPerMapUnit/this._options.cellSize),o=Math.floor(r*this._pixelsPerMapUnit/this._options.cellSize),h=Math.ceil(i*this._pixelsPerMapUnit/this._options.cellSize),c=Math.ceil(n*this._pixelsPerMapUnit/this._options.cellSize);for(let d=o;d<=c;d++)for(let l=a;l<=h;l++){const g=`${l}.${d}`,_=this._cells.get(g);if(!_)continue;const m=e.get(_.id);m?_&&!e.has(_.id)&&m.merge(_):e.set(_.id,_.clone())}}putCells(e){for(const t of this._cells.values()){const s=e.get(t.id);s?s.merge(t):e.set(t.id,t.clone())}}_insertFeature(e,t,s){const{featureFilter:r}=this._options;if(r!==null&&!r.check(e))return;let i=0,n=0;if(e.geometryType==="esriGeometryPoint")i=e.readXWorldSpace(),n=e.readYWorldSpace();else{if(s){const l=e.readCentroidForDisplay();if(l==null)return;const[g,_]=l.coords;if(g<0||g>x||_<0||_>x)return}const d=e.readCentroidWorldSpace();if(d==null)return;i=d.coords[0],n=d.coords[1]}const a=i*this._pixelsPerMapUnit,o=n*this._pixelsPerMapUnit,h=Math.floor(a/this._options.cellSize),c=Math.floor(o/this._options.cellSize);this._getCellOrCreate(h,c).insert(e,t,i,n)}_getCellOrCreate(e,t){const s=me.createId(e,t);let r=this._cells.get(s);if(!r){const i=1*this._options.cellSize/this._pixelsPerMapUnit;r=me.create(e,t,this._options.fields,i),this._cells.set(s,r)}return r}},hr=class{constructor(e,t){this.inner=e,this.displayId=t}};const J=128;let ur=class extends Ee{constructor(e){super(e),this.didSend=!1,this.done=!1}},dr=class{constructor(e,t,s,r,i){this._level=e,this._scale=t,this._indexOptions=s,this._clusterRadius=r,this._store=i,this._cells=new Map,this._handledChunks=new Set,this._statistics=new Map,this._clusters=new Map}destroy(){this._clearClusters()}_clearClusters(){for(const e of this._clusters.values())this._store.releaseDisplayIdForObjectId(e.inner.id);this._clusters.clear()}*aggregatesWorldSpace(){for(const e of this._clusters.values()){const t=e.inner.getCentroid(null),s=new B(t,e.inner.getAttributes(),null);s.objectId=e.inner.id,s.displayId=e.displayId,yield s}}clusters(){return this._clusters.values()}updateChunks(e,t){let s=!1;for(const a of e){const o=a.queryInfo;"tileId"in o&&new we(o.tileId).level!==this._level||this._handledChunks.has(a.normalizedChunkId)||(this._handledChunks.add(a.normalizedChunkId),s=!0,a.getGridIndex({...this._indexOptions,scale:this._scale}).putCells(this._cells))}const r={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0},i=be(this._indexOptions.spatialReference,this._scale),n=this._indexOptions.cellSize;for(const{subscription:a}of t){const o=a.tile.bounds,h=Math.floor(o[0]*i/n),c=Math.floor(o[1]*i/n),d=Math.ceil(o[2]*i/n),l=Math.ceil(o[3]*i/n);r.xMin=Math.min(r.xMin,h),r.yMin=Math.min(r.yMin,c),r.xMax=Math.max(r.xMax,d),r.yMax=Math.max(r.yMax,l)}return this._lastCellBounds!=null&&r.xMin===this._lastCellBounds.xMin&&r.yMin===this._lastCellBounds.yMin&&r.yMin===this._lastCellBounds.yMin&&r.yMax===this._lastCellBounds.yMax||(s=!0,this._lastCellBounds=r),s&&this._clusterCells(r),s}async updateStatistics(e){let t=!1;for(const s of this._clusters.values())s.inner.count>1&&(t=this._updateAggregateStatistics(this._statistics,s.inner)||t);if(t){const s=Array.from(this._statistics.entries()).map(([r,i])=>({fieldName:r,minValue:i.minValue,maxValue:i.maxValue}));await e.container.updateStatistics(this._level,s)}}createAggregateFeatures(e,t){const s=e.subscription,r=[],i=s.tile.transform;for(const n of this._clusters.values()){let a=n.inner.getCentroidX(i);const o=n.inner.getCentroidY(i),h=s.tile.lod,c=h.wrap?h.worldSize[0]:null,d=n.inner.count===1?n.inner.firstObjectId:n.inner.id,l=n.displayId;if(c!=null)if(c===1){const g=new T([],[a,o]),_=new B(g,n.inner.getAttributes(),null);_.geometry.coords[0]-=x,_.objectId=d,_.displayId=l,r.push(_);const m=new T([],[a,o]),p=new B(m,n.inner.getAttributes(),null);p.geometry.coords[0]+=x,p.objectId=d,p.displayId=l,r.push(p)}else a>x+x/2?a-=c*x:a<-x/2&&(a+=c*x);if(a=-J&&o=-J){const g=new T([],[a,o]),_=new B(g,n.inner.getAttributes(),null);_.objectId=d,_.displayId=l,r.push(_)}}return M.fromOptimizedFeatures(r,t,s.tile.transform)}_clusterCells(e){let t=Array.from(this._cells.values());t=t.sort((a,o)=>o.count-a.count);const s=[];for(const a of this._clusters.values())s.push(a.inner.id);this._clusters.clear();const r=this._clusterRadius*(1/be(this._indexOptions.spatialReference,this._scale)),i=1+this._clusterRadius/this._indexOptions.cellSize,n=new Set;for(const a of t){if(n.has(a.id)||a.gridXe.xMax||a.gridYe.yMax)continue;const o=this._store.createDisplayIdForObjectId(a.id),h=new hr(a.clone(),o);n.add(a.id),this._clusters.set(a.id,h);const c=a.centroidXWorld,d=a.centroidYWorld;for(let l=a.gridY-i;l<=a.gridY+i;l++)for(let g=a.gridX-i;g<=a.gridX+i;g++){if(l===a.gridY&&g===a.gridX)continue;const _=this._cells.get(me.createId(g,l));if(!_||n.has(_.id))continue;const m=Math.abs(_.centroidXWorld-c),p=Math.abs(_.centroidYWorld-d);mqt.create(a,h))),spatialReference:s,featureFilter:t.featureFilter?await yt.create({geometryType:r.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:r.metadata.timeInfo,fieldsIndex:r.metadata.fieldsIndex,spatialReference:s,filterJSON:t.featureFilter}):null,cellSize:t.clusterRadius/4,timeZone:n};return new je(e,t.clusterRadius,o,t.fields,r,i)}constructor(e,t,s,r,i,n){super(i,n,s.spatialReference,s.fields),this._connection=e,this._clusterRadius=t,this._indexOptions=s,this._cellsPerScale=new Map,this._metadata=new $e({geometryType:"esriGeometryPoint",objectIdField:"aggregateId",fields:[...r,...this._source.metadata.fieldsIndex.fields,{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}],globalIdField:null,spatialReference:i.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null})}get enablePixelBuffering(){return!1}invalidate(){super.invalidate();for(const e of this._cellsPerScale.values())e.destroy();this._cellsPerScale.clear()}onSubscribe(e){super.onSubscribe(e),this._requiredLevel=e.tile.level,this._requiredScale=e.tile.scale}createState(e){return new ur(e)}async*applyOverride(e){for(const t of this._cellsPerScale.values())t.destroy();this._cellsPerScale.clear();for(const t of this._sendStates.values())t.done=!1}displayMap(e,t,s){const r=new Map(e.map(a=>[t(a),a])),i=[],n=this._getClusterState(this._requiredLevel,this._requiredScale);for(const a of n.clusters()){const o=r.get(a.inner.id);if(o==null){if(a.inner.count===1){const h=r.get(a.inner.firstObjectId);if(h!=null){const c=s(a.displayId,h,a.inner.firstObjectId);i.push(c),r.delete(a.inner.firstObjectId)}}}else{const h=s(a.displayId,o,a.inner.id);i.push(h),r.delete(a.inner.id)}}return i}getDisplayFeatures(e){const t=new Set(e),s=new Set,r=[],i=[],n=this._getClusterState(this._requiredLevel,this._requiredScale);for(const a of n.aggregatesWorldSpace())if(t.has(a.displayId)&&!s.has(a.displayId)){const o=bt(a,this._metadata.geometryType,!1,!1);if(s.add(a.displayId),o.attributes.cluster_count===1){r.push({...o,displayId:a.displayId});continue}i.push({...o,displayId:a.displayId})}return{features:r,aggregates:i}}getFeatureObjectIdsForAggregate(e){const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const s of t.clusters())if(s.inner.id===e)return Array.from(s.inner.objectIds);return[]}async*updateChunks(){const e=this._source.chunks();if(!e.length)return;const t=this._getClusterState(this._requiredLevel,this._requiredScale),s=Array.from(this._sendStates.values()).filter(n=>n.subscription.tile.level===this._requiredLevel);if(t.updateChunks(e,s)||!this._source.updateTracking.updating)for(const n of s)n.subscription.tile.level===this._requiredLevel&&(n.didSend=!1,n.done=!1);const r=Array.from(this._sendStates.values()).filter(n=>n.done).map(n=>n.subscription.tile.key),i=new Set(r);for(const n of this._sendStates.values())this._source.updateTracking.updating&&(r.some(a=>a.containsChild(n.subscription.tile.key))||n.subscription.tile.key.getChildKeys().every(a=>i.has(a)))||n.didSend||n.subscription.tile.level!==this._requiredLevel||(n.didSend=!0,yield*this._update(n,t,this._source));await t.updateStatistics(this._connection)}forEachAggregateWorldSpace(e){if(this._requiredLevel==null||this._requiredScale==null)return;const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const s of t.aggregatesWorldSpace())e(s)}_getClusterState(e,t){if(e==null||t==null)throw new Error("InternalError: Level and scale must be defined");let s=this._cellsPerScale.get(t);return s||(s=new dr(e,t,this._indexOptions,this._clusterRadius,this._attributeStore),this._cellsPerScale.set(t,s)),s}async*_update(e,t,s){if(e.done)return;const r=t.createAggregateFeatures(e,this._metadata);this.events.emit("changed"),e.done=!s.updateTracking.updating;const i=r.getCursor(),n=e.subscription.tile.createArcadeEvaluationOptions(this._indexOptions.timeZone);for(;i.next();)this._attributeStore.setAttributeData(i.getDisplayId(),i,n);yield new Pe(e.subscription,r,!0,e.done,{})}}let cr=class Wt{static fromReader(e){const t=[],s=e.copy(),r=ke();for(;s.next();)s.getBounds(r)&&t.push(s.getIndex());const i=Kt(9,n=>(s.setIndex(n),{minX:s.getBoundsXMin(),minY:s.getBoundsYMin(),maxX:s.getBoundsXMax(),maxY:s.getBoundsYMax()}));return i.load(t),new Wt(i)}constructor(e){this._index=e}search(e){const t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this._index.search(t)}},Je=class Ie{static create(e,t,s,r){const i=Pt.create(e),n=new Array(32);for(let a=0;a=n)return;const l=Math.ceil((h+1)/2),g=Math.floor((h+1)/2),_=1-h%2,m=30-(3*l+2*g),p=30-(2*l+3*g),I=(r&7*_+3*(1-_)<>m,f=(i&3*_+7*(1-_)<>p,k=I+f*(8*_+4*(1-_));c=c<<3*_+2*(1-_)|I,d=d<<2*_+3*(1-_)|f,o.children[k]==null&&(o.children[k]=Je.create(this._fields,c,d,h+1)),h+=1,o=o.children[k]}}putBins(e,t){for(const s of this.getNodes(t)){const r=e.get(s.id);r?r.merge(s):e.set(s.id,s.clone())}}getNodes(e){const t=[],{geohashBounds:s,level:r}=e;let i=this._root;for(;i!==null;){const n=i.depth,a=i.xNode,o=i.yNode;if(n>=r){t.push(i),i=i.next;continue}const h=Math.ceil((n+1)/2),c=Math.floor((n+1)/2),d=1-n%2,l=30-(3*h+2*c),g=30-(2*h+3*c),_=~((1<>l,I=(s.yLL&m)>>g,f=(s.xTR&_)>>l,k=(s.yTR&m)>>g,b=a<<3*d+2*(1-d),v=o<<2*d+3*(1-d),S=b+8*d+4*(1-d),w=v+4*d+8*(1-d),$=Math.max(b,p),F=Math.max(v,I),O=Math.min(S,f),R=Math.min(w,k);let C=null,q=null;for(let E=F;E<=R;E++)for(let P=$;P<=O;P++){const Zt=P-b+(E-v)*(8*d+4*(1-d)),N=i.children[Zt];N&&(C||(C=N,C.next=i.next),q&&(q.next=N),q=N,N.next=i.next)}i=C||i.next}return t}},_r=class{constructor(e){this._options=e,this._tree=new lr(e.fields)}insert(e,t){const s=e.getCursor(),r={$view:{scale:0,timeZone:this._options.timeZone}};for(;s.next();)this._insertFeature(s,r,t)}putBins(e,t){this._tree.putBins(e,t)}_insertFeature(e,t,s){const{featureFilter:r,geohashLevel:i,spatialReference:n}=this._options;if(r!==null&&!r.check(e))return;let a=0,o=0;if(e.geometryType==="esriGeometryPoint")a=e.readXWorldSpace(),o=e.readYWorldSpace();else{if(s){const d=e.readCentroidForDisplay();if(d==null)return;const[l,g]=d.coords;if(l<0||l>x||g<0||g>x)return}const c=e.readCentroidWorldSpace();if(c==null)return;a=c.coords[0],o=c.coords[1]}const h=vs(a,o,i,n);h&&this._tree.insert(e,a,o,h[0],h[1],i,t)}},pr=class ve extends Ce{static from(e,t){return new ve(e.copy(),t)}constructor(e,t){super(e.metadata),this._currentIndex=-1,this._displayTranslationX=0,this._displayTranslationY=0,this._displayScaleX=1,this._displayScaleY=1,this._reader=e,this._indices=t,this._isPoint=e.geometryType==="esriGeometryPoint"}setTransformForDisplay(e){const t=this._reader.getInTransform();if(t==null){const[d,l]=e.scale,[g,_]=e.translate;return this._displayTranslationX=-g/d,this._displayScaleX=1/d,this._displayTranslationY=_/l,this._displayScaleY=1/-l,void(this._displayTransform=e)}const[s,r]=t.scale,[i,n]=t.translate,[a,o]=e.scale,[h,c]=e.translate;if(this._displayScaleX=s/a,this._displayTranslationX=(i-h)/a,this._displayScaleY=r/o,this._displayTranslationY=(-n+c)/o,!this._isPoint&&t)throw new Error("InternalError: Relative transformations not supported for non-point features");this._displayTransform=e}getInTransform(){return this._reader.getInTransform()}get fields(){return this._reader.fields}get hasNext(){return this._currentIndex+1[t(n),n])),i=[];for(const n of this._source.chunks()){const a=n.reader.getCursor();for(;a.next();){const o=a.getObjectId(),h=a.getDisplayId(),c=r.get(o);if(c!=null){const d=s(h,c,o);i.push(d),r.delete(o)}}}return i}getDisplayFeatures(e){const t=new Set(e),s=new Set,r=[];for(const i of this._source.chunks()){const n=i.reader.getCursor();for(;n.next();){const a=n.getObjectId(),o=n.getDisplayId();t.has(o)&&!s.has(a)&&(r.push({...n.readLegacyFeatureWorldSpace(),displayId:o}),s.add(a))}}return{features:r,aggregates:[]}}async*applyOverride(e){const t=[],s=e.reader.getCursor();for(;s.next();){const a=s.getObjectId();t.push(a);const o=this._attributeStore.createDisplayIdForObjectId(a);s.setDisplayId(o),this._attributeStore.setAttributeData(o,s,this._evalOptions)}const r=this.getDisplayIds(t),i=this.getDisplayIds(e.removed),n=new Nt(this._source.metadata);n.applyOverrides(e),this.handledChunks.add(n.chunkId),this.handledChunksForAttributeData.add(n.chunkId),this.handledChunksForIdCreation.add(n.chunkId);for(const a of this._sendStates.values())a.handledChunks.add(n.chunkId),yield new fe(a.subscription,null,r,!1,n.queryInfo);for(const a of this._sendStates.values()){const o=n.getTileReader(a.subscription.tile);yield new fe(a.subscription,o,i,!1,n.queryInfo)}for(const a of e.removed)this._attributeStore.releaseDisplayIdForObjectId(a)}async*updateChunks(){if(this._source.chunks().length){await this._updateAttributeData();for(const e of this._sendStates.values())yield*this._update(e)}}removeChunks(e){for(const t of e)this.handledChunks.delete(t.chunkId),this.handledChunksForAttributeData.delete(t.chunkId),this._cleanupChunkIds(t)}afterUpdateChunks(){for(const e of this._streamLayerDeferredObjectIdsToRemove)this._attributeStore.releaseDisplayIdForObjectId(e);this._streamLayerDeferredObjectIdsToRemove=[]}_cleanupChunkIds(e){if(this.handledChunksForIdCreation.has(e.chunkId)){const t=e.reader.getCursor();for(;t.next();){const s=t.getObjectId();this._source.isStream?this._streamLayerDeferredObjectIdsToRemove.push(s):this._attributeStore.releaseDisplayIdForObjectId(s)}this.handledChunksForIdCreation.delete(e.chunkId)}}async _updateAttributeData(){for(const e of this._source.chunks()){const{chunkId:t,reader:s}=e;if(!this.handledChunksForIdCreation.has(t)){this.handledChunksForIdCreation.add(t);const r=s.getCursor();for(;r.next();){const i=this._attributeStore.createDisplayIdForObjectId(r.getObjectId());r.setDisplayId(i)}}}for(const e of this._source.chunks())if(!this.handledChunksForAttributeData.has(e.chunkId)){this.handledChunksForAttributeData.add(e.chunkId);const t=e.reader.getCursor();for(;t.next();){const s=t.getDisplayId();this._attributeStore.setAttributeData(s,t,this._evalOptions)}}}*_update(e){const{subscription:t,handledChunks:s}=e;for(const r of this._source.chunks()){const{chunkId:i}=r;if(s.has(i))continue;s.add(i);const n=r.getTileReader(t.tile);n&&(yield new Pe(e.subscription,n,!1,r.end,r.queryInfo))}}},yr=class{constructor(e,t){this._connection=e,this._source=t,this._version=1,this._proxy=new ps({fetch:(s,r)=>this._connection.layerView.fetch(s,r),fetchDictionary:(s,r)=>this._connection.layerView.fetchDictionary(s,r)}),this._attributeStore=new gs({isLocal:!1,update:s=>ut(this._connection.container.updateAttributeView(s))})}destroy(){var e;this._proxy.destory(),(e=this._strategy)==null||e.destroy(),this._attributeStore.destroy()}get aggregateQueryEngine(){var e;return(e=this._strategy)==null?void 0:e.aggregateQueryEngine}getDisplayFeatures(e){return this._strategy?this._strategy.getDisplayFeatures(e):{features:[],aggregates:[]}}getFeatureObjectIdsForAggregate(e){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(e):[]}onSubscribe(e){var t;(t=this._strategy)==null||t.onSubscribe(e)}onUnsubscribe(e){var t;(t=this._strategy)==null||t.onUnsubscribe(e)}async update(e,t,s,r,i){var c;const n=e.processor,a=ft(this._schema,n);if(!a&&!r)return;y("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:a,schema:n}),this._schema=n;const o=V.fromJSON(e.source.mutable.dataFilter.outSpatialReference),h=new Me({fields:this._source.metadata.fieldsIndex,spatialReference:o});return await this._attributeStore.update(n.storage,h,this._source.metadata,o,t),(c=this._strategy)==null||c.invalidateAttributeData(),r||he(a,"mesh")?(he(a,"mesh.strategy")&&await this._updateStrategy(n.mesh.strategy,o,i,n.mesh.timeZone),this._updateSortKey(h,"sortKey"in n.mesh?n.mesh.sortKey:null),(he(a,"mesh.factory")||n.mesh.factory.symbology.type==="dictionary")&&(this._factory=await Qs.create(h,this._proxy,n.mesh.factory,s)),this._invalidate(),this._version=t,this._connection.container.updateRenderState(this._version)):void 0}async applyOverride(e){if(!this._strategy)return;const t=this._strategy.applyOverride(e);for await(const s of t)try{await this._process(s)}catch{}this._source.applyOverride(e)}async updateChunks(){var e;await this._doUpdateChunks(),(e=this._strategy)==null||e.afterUpdateChunks()}async removeChunks(e){var t;(t=this._strategy)==null||t.removeChunks(e),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:e}){if(!this._strategy)return void this._attributeStore.setHighlight(e.map(({objectId:s,highlightFlags:r})=>({objectId:s,highlightFlags:r,displayId:-1})),e);const t=this._strategy.displayMap(e,({objectId:s})=>s,(s,{highlightFlags:r},i)=>({objectId:i,displayId:s,highlightFlags:r}));this._attributeStore.setHighlight(t,e)}async _doUpdateChunks(){if(!this._strategy)return;const e=this._strategy.updateChunks(),t=[],s=new Map;for await(const r of e){let i=s.get(r.id);i==null&&(i=new Zs({concurrency:16,process:a=>this._process(a)}),s.set(r.id,i));const n=i.push(r).catch(a=>Fe(a));t.push(n)}try{await Promise.all(t)}catch{}y("esri-2d-update-debug")&&console.log("SendUpdates"),await this._attributeStore.sendUpdates(),y("esri-2d-update-debug")&&console.log("SendUpdates.await")}async _updateStrategy(e,t,s,r){var i;switch((i=this._strategy)==null||i.destroy(),e.type){case"feature":this._strategy=new fr(this._source,this._attributeStore,r);break;case"binning":this._strategy=await Js.create(e,t,this._source,this._attributeStore,r);break;case"cluster":this._strategy=await je.create(this._connection,e,t,this._source,this._attributeStore,r)}for(const n of s)this._strategy.onSubscribe(n)}async _updateSortKey(e,t){var s;if(this._sortInfo=dt((s=this._sortInfo)==null?void 0:s.computed),t!=null){const r=t.byRenderer?null:await e.createComputedField(t);this._sortInfo={...t,computed:r}}}_invalidate(){this._strategy&&this._strategy.invalidate()}async _process(e){const t=e.subscription;if(y("esri-2d-update-debug")){const o=t.tile;console.debug(`Version[${this._version}] Tile[${o.key.id}, end=${e.end}] Processor._process`)}await this._fetchResources(e),Y(t.signal);const s=await this._write(e,t.tile.createArcadeEvaluationOptions(this._schema.mesh.timeZone)),r=t.tile.tileInfoView.tileInfo.isWrappable,{message:i,transferList:n}=s.serialize(r),a=e.createMessage(i,this._version,this._attributeStore.epoch);if(Y(t.signal),this._connection.container.onMessage(a,{signal:t.signal,transferList:n}),this._attributeStore.sendUpdates(),y("esri-2d-update-debug")){const o=t.tile;console.debug(`Version[${this._version}] Tile[${o.key.id}, end=${e.end}] Processor._process.await`)}}async _fetchResources(e){await this._fetchMatcherResources(e),await this._fetchWriterResources(e)}async _fetchMatcherResources(e){if(e.reader)return this._factory.enqueueMatcherRequests(this._proxy,e.reader)}async _fetchWriterResources(e){if(!e.reader)return;const t=e.reader.getCursor(),s=e.subscription.tile.createArcadeEvaluationOptions(this._schema.mesh.timeZone);for(;t.next();)this._factory.enqueueWriterRequests(this._proxy,t,s);await this._proxy.fetchEnqueuedResources()}async _write(e,t){var h;const s=e.subscription.tile,r=(h=e.reader)==null?void 0:h.getCursor(),i=(r==null?void 0:r.getSize())??0,n=s.tileInfoView.tileInfo.isWrappable,a=new Us(s.key,this._strategy.enablePixelBuffering,n,i);if(!r)return a;const o=s.createArcadeEvaluationOptions(this._schema.mesh.timeZone);for(;r.next();){const c=this._getSortKeyValue(r,t);a.entityStart(r.getDisplayId(),c),this._factory.write(a,this._proxy,r,o,s.level),a.entityEnd()}return a}_getSortKeyValue(e,t){if(!this._sortInfo)return 0;const{computed:s,order:r,byRenderer:i}=this._sortInfo,n=i?this._factory.getSortKey(e,t):s==null?void 0:s.read(e,t);return n==null||isNaN(n)?0:n*(r==="asc"?-1:1)}},mr=class Bt{static from(e){let t=0,s=0,r=0;return e.forEach(i=>{const n=i._readGeometry();n&&(s+=n.isPoint?1:n.lengths.reduce((a,o)=>a+o,0),r+=n.isPoint?1:n.lengths.length,t+=1)}),new Bt(t,s,r)}constructor(e,t,s){this.featureCount=e,this.vertexCount=t,this.ringCount=s}toJSON(){return{featureCount:this.featureCount,ringCount:this.featureCount,vertexCount:this.featureCount}}};const ce=4;function br(u,e){const{service:t}=u,s=t.orderByFields??e.objectIdField+" ASC",r=t.source,i={returnCentroid:!(r!==null&&typeof r=="object"&&"path"in r&&es(r.path))&&e.geometryType==="esriGeometryPolygon",returnGeometry:!0,timeReferenceUnknownClient:e.timeReferenceUnknownClient??void 0,outSpatialReference:V.fromJSON(u.mutable.dataFilter.outSpatialReference),orderByFields:[s],where:u.mutable.dataFilter.definitionExpression??"1=1",outFields:u.mutable.availableFields};if(u.type==="feature"){const{gdbVersion:n,historicMoment:a,timeExtent:o}=u.mutable.dataFilter;return{...i,gdbVersion:n,historicMoment:a?new Date(a):null,timeExtent:o?ts.fromJSON(o):null,outFields:u.mutable.availableFields}}return i}let Ir=class Vt{static fromSchema(e,t){return new Vt(br(e,t),e.mutable.dataFilter.customParameters,t.geometryType,e.service.queryMetadata.capabilities)}constructor(e,t,s,r){this._queryParams=e,this._customParameters=t,this._geometryType=s,this._capabilities=r}get pageSize(){if(this._capabilities==null)throw new Error("InternalError: Service does not support paged queries");const{query:e}=this._capabilities,t=e.supportsMaxRecordCountFactor?ce:null,s=(e.maxRecordCount??8e3)*(t??1);return Math.min(8e3,s)}updateFields(e){this._queryParams.outFields=e}createPatchFieldsQuery(e,t){const s=e.clone();if(this._queryParams.outFields[0]==="*"){if((s.outFields??[])[0]==="*")return null;s.outFields=this._queryParams.outFields}else{const r=new Set(this._queryParams.outFields),i=[];for(const n of r)t.hasField(n)||i.push(n);if(i.length===0)return null;s.outFields=i}return s.returnGeometry=!1,s.returnCentroid=!1,s.quantizationParameters=null,s.cacheHint=!0,{inner:s,customParameters:this._customParameters}}createQuery(e={}){if(!this._queryParams)throw new Error("InternalError: queryInfo should be defined");return{inner:new ct({...this._queryParams,...e}),customParameters:this._customParameters}}createTileQuery(e,t){if(this._capabilities==null)throw new Error("InternalError: Service does not support tile queries");const s=this.createQuery(t),r=s.inner;return r.quantizationParameters=t.quantizationParameters??e.getQuantizationParameters(),r.resultType="tile",r.geometry=e.extent,this._capabilities.query.supportsQuantization?this._geometryType==="esriGeometryPolyline"&&(r.maxAllowableOffset=e.resolution*y("feature-polyline-generalization-factor")):this._geometryType!=="esriGeometryPolyline"&&this._geometryType!=="esriGeometryPolygon"||(r.maxAllowableOffset=e.resolution,this._geometryType==="esriGeometryPolyline"&&(r.maxAllowableOffset*=y("feature-polyline-generalization-factor"))),r.defaultSpatialReferenceEnabled=this._capabilities.query.supportsDefaultSpatialReference,r.compactGeometryEnabled=this._capabilities.query.supportsCompactGeometry,this._capabilities.query.supportsMaxRecordCountFactor&&(r.maxRecordCountFactor=ce),s}createPagedTileQuery(e,t){const s=this.pageSize;return this.createTileQuery(e,{start:s*t,num:s,returnExceededLimitFeatures:!0})}createPagedQuery(e){const t=this.pageSize;return this.createQuery({start:t*e,num:t,returnExceededLimitFeatures:!0,maxRecordCountFactor:ce})}};const vr=2500;let te=class extends _t{constructor(e){super(),this._connection=e,this._enabledEventTypes=new Set,this._updateInfo={websocket:0,client:0},this._lastTime=performance.now(),this.addHandles([pe(()=>{var t;return((t=this._strategy)==null?void 0:t.connectionStatus)??"disconnected"},t=>{this._layerView.setProperty({propertyName:"pipelineConnectionStatus",value:t})},{initial:!0}),pe(()=>{var t;return((t=this._strategy)==null?void 0:t.errorString)||null},t=>this._layerView.setProperty({propertyName:"pipelineErrorString",value:t}),{initial:!0})])}destroy(){this._strategy=null,this.removeAllHandles()}get _layerView(){return this._connection.layerView}set strategy(e){this._strategy==null&&this._resetUpdateInfo(performance.now());const t="event-handles";this.removeHandles(t),e!=null&&this.addHandles([e.events.on("data-received",s=>this._onFeature(s)),e.events.on("message-received",s=>this._onWebSocketMessage(s)),e.events.on("features-updated",s=>this._onUpdate(s)),e.events.on("tick",()=>this._onTick())],t),this._strategy=e}updateCustomParameters(e){var t;e!=null&&((t=this._strategy)==null||t.updateCustomParameters(e))}sendMessageToSocket(e){var t;(t=this._strategy)==null||t.sendMessageToSocket(e)}sendMessageToClient(e){var t;(t=this._strategy)==null||t.sendMessageToClient(e)}enableEvent(e,t){t?this._enabledEventTypes.add(e):this._enabledEventTypes.delete(e)}disconnect(){var e;(e=this._strategy)==null||e.disconnect()}connect(){var e;(e=this._strategy)==null||e.connect()}clear(){var e;(e=this._strategy)==null||e.clear()}_onWebSocketMessage(e){this._enabledEventTypes.has("message-received")&&this._layerView.emitEvent({name:"message-received",event:e})}_onFeature(e){this._updateInfo.websocket++,this._enabledEventTypes.has("data-received")&&this._layerView.emitEvent({name:"data-received",event:{attributes:e.attributes,centroid:e.centroid,geometry:e.geometry}})}_onUpdate(e){this._updateInfo.client+=e}_onTick(){const e=performance.now(),t=e-this._lastTime;if(t>vr){const s=Math.round(this._updateInfo.client/(t/1e3)),r=Math.round(this._updateInfo.websocket/(t/1e3));this._resetUpdateInfo(e),this._layerView.emitEvent({name:"update-rate",event:{client:s,websocket:r}})}}_resetUpdateInfo(e){this._lastTime=e,this._updateInfo.client=0,this._updateInfo.websocket=0}};G([K()],te.prototype,"_strategy",void 0),te=G([lt("esri.views.2d.layers.features.sources.StreamMessenger")],te);let Yt=class{constructor(e){this._store=e,this._controller=new AbortController}destroy(){this._controller.abort()}get _options(){return{signal:this._controller.signal}}async queryOverride(e){throw new Error("InternalError: LoadStrategy does not support fetching")}};const le=268435455;let Sr=class{constructor(){this.hasFeatures=!1,this.exceededTransferLimit=!1,this.fieldCount=0,this.featureCount=0,this.objectIdFieldIndex=0,this.vertexCount=0,this.offsets={attributes:new Array,geometry:new Array},this.centroid=new Array}};function wr(u,e,t=!1){var $;const h=u.asUnsafe(),c=h.pos(),d=new Sr;let l=0,g=0;const _=1,m=2,p=4,I=3;let f=null,k=null,b=null,v=!1;const S=[];for(;h.next();)switch(h.tag()){case 1:f=h.getString();break;case 3:k=h.getString();break;case 12:b=h.processMessage(js);break;case 9:if(d.exceededTransferLimit=h.getBool(),d.exceededTransferLimit){d.offsets.geometry=t?new Float64Array(8e3):new Int32Array(8e3),d.centroid=t?new Float64Array(16e3):new Int32Array(16e3);for(let F=0;F0}let Mr=class Se extends Ce{static fromBuffer(e,t,s=!1){const r=t.geometryType,i=kr(e),n=wr(i,r==="esriGeometryPoint",s);return new Se(i,n,t)}constructor(e,t,s){super(s),this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0,centroid:void 0,legacyFeature:void 0,optFeature:void 0},this._parseCaches=new Array,this._geometryType=s.geometryType,this._reader=e,this._header=t,this._hasNext=t.hasFeatures,this._isPoints=s.geometryType==="esriGeometryPoint"}get _size(){return this._header.featureCount}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get hasZ(){return!1}get hasM(){return!1}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getInTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._cache.centroid=void 0,this._cache.legacyFeature=void 0,this._cache.optFeature=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){return this._readAttributeAtIndex(this._header.objectIdFieldIndex)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const e=this._reader.clone(),t=new Se(e,this._header,this.metadata);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._cache.centroid=void 0,this._cache.legacyFeature=void 0,this._cache.optFeature=void 0;++this._featureIndexd.length)for(let p=0;p=p?(l+=-.5*(O-b)*(R+v),f>1&&_e(d[c-2],d[c-1],S,w)?(d[c-2]+=S,d[c-1]+=w):(d[c++]=S,d[c++]=w,f++),b=O,v=R):($+=S,F+=w),S=$,w=F,I++}f<3||k?c-=2*f:(l+=-.5*(b+S-b)*(v+w+v),_e(d[c-2],d[c-1],S,w)?(d[c-2]+=S,d[c-1]+=w,o.push(f)):(d[c++]=S,d[c++]=w,o.push(++f)))}else{let p=0,I=r.getSInt32(),f=r.getSInt32();this.hasZ&&r.getSInt32(),this.hasM&&r.getSInt32(),d[c++]=I,d[c++]=f,p+=1;for(let k=1;k2&&_e(d[c-2],d[c-1],b,v)?(d[c-2]+=b,d[c-1]+=v):(d[c++]=b,d[c++]=v,p+=1),I=S,f=w}o.push(p)}break}default:r.skip()}return this._cache.area=l,o.length?new T(o,d):null}};class oe{constructor(e,t){this.service=e,this._metadata=t}destroy(){}}function $r(u,e){switch(u.type){case"memory":return new qr(u,e);case"ogc":return new Er(u,e);case"feature-service":return u.queryMetadata.capabilities.query.supportsFormatPBF&&y("featurelayer-pbf")?new Ar(u,e):new Rr(u,e)}}async function Or(u){const e=new is;return await e.open(u,{}),e}class qr extends oe{constructor(e,t){super(e,t),this._portsOpen=Or(e.source).then(s=>this.client=s)}destroy(){this.client.close(),this.client=null}async executeQuery(e,t){await this._portsOpen;const s=await this.client.invoke("queryFeatures",e.toJSON(),t);return M.fromFeatureSet(s,this._metadata)}}class Ar extends oe{async executeQuery(e,t){const{data:s}=await As(this.service.source,e,t),r=!e.quantizationParameters;return Mr.fromBuffer(s,this._metadata,r)}}class Rr extends oe{async executeQuery(e,t){var a;const{source:s,queryMetadata:r}=this.service,i=r.capabilities;if(e.quantizationParameters!=null&&!i.query.supportsQuantization){const o=e.clone(),h=wt(o.quantizationParameters);o.quantizationParameters=null;const{data:c}=await Ne(s,o,this._metadata.spatialReference,t),d=mt(c,this._metadata.objectIdField);return It(h,d),M.fromOptimizedFeatureSet(d,this._metadata)}const{data:n}=await Ne(s,e,this._metadata.spatialReference,t);return this._metadata.geometryType==="esriGeometryPoint"&&(n.features=(a=n.features)==null?void 0:a.filter(o=>{if(o.geometry!=null){const h=o.geometry;return Number.isFinite(h.x)&&Number.isFinite(h.y)}return!0})),M.fromFeatureSet(n,this._metadata)}}let Er=class extends oe{async executeQuery(e,t){const{capabilities:s}=this.service.queryMetadata;if(e.quantizationParameters&&!s.query.supportsQuantization){const i=e.clone(),n=wt(i.quantizationParameters);i.quantizationParameters=null;const a=await Be(this.service.source,e,t);return It(n,a),M.fromOptimizedFeatureSet(a,this._metadata)}const r=await Be(this.service.source,e,t);return M.fromOptimizedFeatureSet(r,this._metadata)}},Xt=class extends Yt{constructor(e,t,s,r,i){super(s),this._serviceInfo=e,this._queryInfo=t,this._metadata=r,this._eventLog=i,this._queue=new ht({concurrency:16,process:async n=>{var o;const a={signal:(o=n.options)==null?void 0:o.signal,query:n.query.customParameters};return this._adapter.executeQuery(n.query.inner,a)}}),this._adapter=$r(e,r)}async updateFields(e){this._queryInfo.updateFields(e);const t=Array.from(this._store.chunks()).map(async r=>{const i=ct.fromJSON(r.queryInfo.queryJSON);if(i)try{return await this._tryUpdateFields(r.reader,i),null}catch(n){return n}}),s=(await Promise.all(t)).filter(r=>r);if(s.length)throw new D("featurelayer-query","Encountered errors when downloading fields",{errors:s})}async queryOverride({edits:e}){const t=[],s=[];for(const n of e.removed)n.objectId!=null&&n.objectId!==-1?t.push(n.objectId):s.push(n.globalId);s.length&&t.push(...this._mapGlobalIdsToObjectIds(s));const r=e.addOrModified.map(({objectId:n})=>n);let i;if(r.length){const n=this._queryInfo.createQuery({objectIds:r});i=await this._fetch(n)}else i=M.empty(this._metadata);return{reader:i,removed:t}}_mapGlobalIdsToObjectIds(e){const t=new Set(e),s=this._metadata.globalIdField;if(s==null)throw new Error("InternalError: Recieved an edit with globalIds, but not supported by the service");const r=[];return this._store.forEachUnsafe(i=>{const n=i.readAttribute(s);t.has(n)&&r.push(i.getObjectId())}),r}async _fetch(e,t){const s=await this._enqueue(e,t);return await this._tryUpdateFields(s,e.inner),s}async _tryUpdateFields(e,t){const s=this._queryInfo.createPatchFieldsQuery(t,e);if(!s)return;const r=await this._enqueue(s,this._options);e.joinAttributes(r)}async _enqueue(e,t){return this._eventLog.onEvent({type:"fetchStart"}),this._queue.push({query:e,options:t}).finally(()=>{this._eventLog.onEvent({type:"fetchEnd",done:this._queue.length===0})})}},Qt=class extends Xt{constructor(){super(...arguments),this._chunksById=new Map}unload(e){this._removeChunks(e.tile)}_addChunk(e){const t=e.tile.id;this._chunksById.has(t)||this._chunksById.set(t,[]);const s=e.size();(s||e.first||e.end)&&(y("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] ATileLoadStrategy.addChunk [count=${s}]`),this._chunksById.get(t).push(e),this._store.insert(e))}_removeChunks(e){const t=this._chunksById.get(e.key.id)??[];for(const s of t)y("esri-2d-update-debug")&&console.debug(`Tile[${e.key.id}] Chunk[${s.chunkId}] ATileLoadStrategy.removeChunk`),this._store.remove(s);this._chunksById.delete(e.key.id)}},rt=class extends Z{constructor(e,t,s,r,i,n){var a,o;super(),this._reader=e,this._queryJSON=t,this._tile=s,this._sourceTile=r,this._sourceTileDepth=i,this._end=n,this.chunkId=`${this._tile.key.id}.${(a=this._sourceTile)==null?void 0:a.key.id}${this._end?"e":""}`,this.normalizedChunkId=`${this._tile.key.normalizedId}.${(o=this._sourceTile)==null?void 0:o.key.normalizedId}${this._end?"e":""}`}get queryInfo(){var e;return{type:"drill-down-tile",chunkId:this.chunkId,tileId:this._tile.key.id,queryJSON:this._queryJSON,sourceTileDepth:this._sourceTileDepth,sourceTileId:(e=this._sourceTile)==null?void 0:e.key.id,size:this.size(),end:this.end}}get first(){return this._sourceTileDepth===0}get reader(){return this._reader}get end(){return this._end}get tile(){return this._tile}get isTiled(){return!0}getTileReader(e){return this._tile.key.id===e.key.id?this.reader:null}},Pr=class{constructor(e,t){this.subscription=e,this._tileIdToResult=new Map,this._controller=new AbortController,se(e.options,()=>this._controller.abort()),se(t,()=>this._controller.abort())}get(e){return this._tileIdToResult.get(e)}set(e,t){this._tileIdToResult.set(e,t)}get options(){return{signal:this._controller.signal}}},jr=class extends Qt{constructor(){super(...arguments),this._loadStates=new Map}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(e){this._loadStates.has(e.key.id)||this._loadStates.set(e.key.id,new Pr(e,this._options));const t=this._loadStates.get(e.key.id);let s;try{for await(const i of this._fetchChunkInfos(t,e.tile,0)){const{queryJSON:n,reader:a,sourceTile:o,sourceTileDepth:h,tile:c}=i,d=new rt(a,n,c,o,h,!1);Y(e.options),this._addChunk(d)}}catch(i){s=i}const r=new rt(M.empty(this._metadata),null,e.tile,null,-1,!0);if(this._addChunk(r),s)throw s}unload(e){super.unload(e),this._loadStates.delete(e.key.id)}async*_fetchChunkInfos(e,t,s){let r=e.get(t.id);const i=!!r;if(r||(r=await this._fetchChunkInfo(e,t,s),e.set(t.id,r)),r.reader.exceededTransferLimit&&sthis._controller.abort()),se(t,()=>this._controller.abort())}resetAbortController(){this._controller=new AbortController}get pageStart(){let e=-1;for(const t of this._pages.values())e=Math.max(e,t);return e+1}get done(){return this._done}get options(){return{signal:this._controller.signal}}add(e,t){this._pages.add(e),this._done=this._done||t}},Lr=class extends Qt{constructor(){super(...arguments),this._loadStates=new Map}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(e){this._loadStates.has(e.key.id)||this._loadStates.set(e.key.id,new Dr(e,this._options));const t=this._loadStates.get(e.key.id);let s;t.resetAbortController();try{await this._fetchPages(t)}catch(i){s=i}const r=new it(M.empty(this._metadata),null,e.tile,-1,!0);if(ns(t.options)||this._addChunk(r),s)throw s}unload(e){super.unload(e),this._loadStates.delete(e.key.id)}async _fetchPages(e){let r=0,i=e.pageStart,n=1;for(;r<20&&!e.done;){const a=[];for(let h=0;ho).sort((a,o)=>this._random.getInt()-this._random.getInt()),r=await Promise.all(s.map(a=>this._downloadPage(a))),i=new nt(M.empty(this._metadata),null,-1,!0);this._store.insert(i);const n=r.filter(a=>a);if(n.length)throw new D("featurelayer-query","Encountered errors when downloading data",{errors:n})}async _downloadPage(e){try{const t=this._queryInfo.createPagedQuery(e),s=await this._fetch(t,this._options),r=new nt(s,t.inner.toJSON(),e,!1);return Y(this._options),this._store.insert(r),null}catch(t){return t}}}const Ur="__esri_stream_id__",at="__esri_timestamp__",ot=1e3;class Gr{constructor(e,t,s,r,i=128){this._trackIdToObservations=new Map,this._idCounter=0,this._lastPurge=performance.now(),this._addOrUpdated=new Map,this._removed=[],this._maxAge=0,this._timeInfo=s,this._purgeOptions=r,this.store=e,this.objectIdField=t,this.purgeInterval=i,this._useGeneratedIds=this.objectIdField===Ur}removeById(e){this._removed.push(e)}removeByTrackId(e){const t=this._trackIdToObservations.get(e);if(t)for(const s of t.entries)this._removed.push(s)}add(e){var n;if(this._useGeneratedIds){const a=this._nextId();e.attributes[this.objectIdField]=a,e.objectId=a}else e.objectId=e.attributes[this.objectIdField];const t=e.objectId;if(this._addOrUpdated.set(t,e),this._maxAge=Math.max(this._maxAge,e.attributes[this._timeInfo.startTimeField]),!this._timeInfo.trackIdField)return this._trackIdLessObservations==null&&(this._trackIdLessObservations=new Ve(1e5)),void this._trackIdLessObservations.enqueue(t);const s=e.attributes[this._timeInfo.trackIdField];if(!this._trackIdToObservations.has(s)){const a=((n=this._purgeOptions)==null?void 0:n.maxObservations)!=null?this._purgeOptions.maxObservations:ot,o=as(a,0,ot);this._trackIdToObservations.set(s,new Ve(o))}const r=this._trackIdToObservations.get(s),i=r==null?void 0:r.enqueue(t);i!=null&&(this._addOrUpdated.has(i)?this._addOrUpdated.delete(i):this._removed.push(i))}checkForUpdates(){const e=this._getToAdd(),t=this._getToRemove(),s=performance.now();s-this._lastPurge>=this.purgeInterval&&(this._purge(s),this._lastPurge=s);const r=[];if(t!=null)for(const n of t){const a=this.store.removeById(n);a!=null&&r.push(a)}const i=[];if(e!=null){const n=new Set(t??[]);for(const a of e)n.has(a.objectId)||(a.attributes[at]=s,this.store.add(a),i.push(a))}return!(!i.length&&!(r!=null&&r.length))&&(this.store.update(i,r),!0)}_getToAdd(){if(!this._addOrUpdated.size)return null;const e=new Array(this._addOrUpdated.size);let t=0;return this._addOrUpdated.forEach(s=>e[t++]=s),this._addOrUpdated.clear(),e}_getToRemove(){const e=this._removed;return this._removed.length?(this._removed=[],e):null}_nextId(){const e=this._idCounter;return this._idCounter=(this._idCounter+1)%4294967294+1,e}_purge(e){const t=this._purgeOptions;t!=null&&(this._purgeSomeByDisplayCount(t),this._purgeByAge(t),this._purgeByAgeReceived(e,t),this._purgeTracks())}_purgeSomeByDisplayCount(e){if(!e.displayCount)return;let t=this.store.size;if(t>e.displayCount){if(this._timeInfo.trackIdField){for(const s of this._trackIdToObservations.values())if(t>e.displayCount&&s.size){const r=s.dequeue();this._removed.push(r),t--}}if(this._trackIdLessObservations!=null){let s=t-e.displayCount;for(;s-- >0;){const r=this._trackIdLessObservations.dequeue();r!=null&&this._removed.push(r)}}}}_purgeByAge(e){var i;const t=(i=this._timeInfo)==null?void 0:i.startTimeField;if(!e.age||!t)return;const s=60*e.age*1e3,r=this._maxAge-s;this.store.forEach(n=>{n.attributes[t]{r.attributes[at]{e.size===0&&this._trackIdToObservations.delete(t)})}}let U=class extends _t{constructor(u){super(u)}get connectionStatus(){var u;return(u=this.connection)==null?void 0:u.connectionStatus}get errorString(){var u;return(u=this.connection)==null?void 0:u.errorString}};G([K()],U.prototype,"connection",void 0),G([K()],U.prototype,"connectionStatus",null),G([K()],U.prototype,"errorString",null),U=G([lt("esri.views.2d.layers.features.sources.StreamConnectionState")],U);class Wr{constructor(e,t){this._metadata=e,this._onUpdate=t,this._objectIdToFeature=new Map}get size(){return this._objectIdToFeature.size}get reader(){return M.fromFeatures([...this._objectIdToFeature.values()],this._metadata)}add(e){this._objectIdToFeature.set(e.objectId,e)}forEach(e){this._objectIdToFeature.forEach(e)}removeById(e){const t=this._objectIdToFeature.get(e);return t?(this._objectIdToFeature.delete(e),t):null}clear(){this._objectIdToFeature=new Map}update(e,t){this._onUpdate((e==null?void 0:e.length)??0)}}let Nr=class extends Z{constructor(e){super(),this._reader=e,this.chunkId="stream-chunk",this.normalizedChunkId="stream-chunk"}get reader(){return this._reader}get first(){return!0}get end(){return!0}get queryInfo(){return{type:"stream",chunkId:this.chunkId,size:this.size(),end:this.end}}get isTiled(){return!1}getTileReader(e){const t=this.queryFeaturesInBounds(e.bounds);return t.setTransformForDisplay(e.transform),t}};class Br extends Yt{constructor(e,t,s,r,i){super(s),this._service=e,this._dataFilter=t,this._streamOptions=r,this._metadata=i,this._connectionState=new U,this._forceRefresh=!1,this.events=new xe;const{objectIdField:n,timeInfo:a}=this._metadata,{purgeOptions:o}=t;this._stagingStore=new Wr(this._metadata,h=>this.events.emit("features-updated",h)),this._manager=new Gr(this._stagingStore,n,a,o),this.connect()}destroy(){super.destroy(),this.disconnect()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}get connectionStatus(){return this._connectionState.connectionStatus}get errorString(){var e;return(e=this._connectionState)==null?void 0:e.errorString}async refresh(){const e=this._chunk!=null;this._manager.checkForUpdates()||!e||this._forceRefresh?(this._chunk&&this._store.remove(this._chunk),this._forceRefresh=!1,this._chunk=new Nr(this._stagingStore.reader),this._store.insert(this._chunk),this.events.emit("tick")):this.events.emit("tick")}async updateFields(e){throw new Error("Updating available fields not supported for StreamLayer")}async load(e){}unload(e){}disconnect(){var e;this._connection=dt(this._connection),this._connectionState.connection=null,(e=this._handlesGroup)==null||e.remove()}connect(){if(this._connection!=null)return;const{geometryType:e,spatialReference:t}=this._metadata,{maxReconnectionAttempts:s,maxReconnectionInterval:r,geometryDefinition:i,definitionExpression:n,customParameters:a}=this._dataFilter;this._connection=Ds(this._service.source,t,this._streamOptions.outSR,e,n,i,s,r,a),this._handlesGroup=gt([this._connection.on("data-received",o=>this._onFeature(o)),this._connection.on("message-received",o=>this._onWebSocketMessage(o))]),this._connectionState.connection=this._connection}clear(){this._manager.checkForUpdates(),this._stagingStore.clear(),this._forceRefresh=!0}updateCustomParameters(e){var t;(t=this._connection)==null||t.updateCustomParameters(e)}sendMessageToSocket(e){var t;(t=this._connection)==null||t.sendMessageToSocket(e)}sendMessageToClient(e){var t;(t=this._connection)==null||t.sendMessageToClient(e)}_onWebSocketMessage(e){if("type"in e)switch(e.type){case"delete":if(e.objectIds)for(const t of e.objectIds)this._manager.removeById(t);if(e.trackIds)for(const t of e.trackIds)this._manager.removeByTrackId(t);break;case"clear":this.clear()}this.events.emit("message-received",e)}_onFeature(e){try{this._manager.add(e),this.events.emit("data-received",e)}catch{}}}class Vr{constructor(e){this._onChange=e,this._chunks=new Map,this._chunksToRemove=[],this.events=new xe,this.featureAdapter=new ys}destroy(){this.clear()}clear(){for(const e of this._chunks.values())this._chunksToRemove.push(e);this._chunks.clear(),this._overrideChunk!=null&&this._chunksToRemove.push(this._overrideChunk),this._overrideChunk=null}*chunks(){this._overrideChunk&&(yield this._overrideChunk),yield*this._chunks.values()}insert(e){var t;y("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.insert`),(t=this._overrideChunk)!=null&&t.overridenIds.size&&e.reader.removeIds(this._overrideChunk.overridenIds),this._chunks.set(e.chunkId,e),this.events.emit("changed"),this._onChange()}remove(e){y("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.remove`),this._chunks.delete(e.chunkId),this._chunksToRemove.push(e)}cleanupRemovedChunks(){const e=this._chunksToRemove;return this._chunksToRemove=[],e}applyOverrides(e,t){this._overrideChunk==null&&(this._overrideChunk=new Nt(t)),this._overrideChunk.applyOverrides(e);for(const s of this._chunks.values())s.reader.removeIds(this._overrideChunk.overridenIds),s.invalidate()}forEach(e){const t=new Set;for(const s of this.chunks()){const r=s.reader.getCursor();for(;r.next();){const i=r.getObjectId();t.has(i)||(e(r.copy()),t.add(i))}}}forEachUnsafe(e){const t=new Set;for(const s of this.chunks()){const r=s.reader.getCursor();for(;r.next();){const i=r.getObjectId();t.has(i)||(e(r),t.add(i))}}}forEachInBounds(e,t){const s=new Set;for(const r of this.chunks()){const i=r.queryFeaturesInBounds(e);for(;i.next();){const n=i.getObjectId();s.has(n)||(t(i.copy()),s.add(n))}}}forEachBounds(e,t){const s=ke();for(const r of e)r.getBounds(s)&&t(s)}}class Yr{constructor(e,t,s,r){this._aggregateAdapter=e,this._subscriptions=t,this._onChange=s,this._connection=r,this._updateTracking=new Ls({debugName:"FeatureSource"}),this._didInvalidateData=!1,this._store=new Vr(this._onChange)}destroy(){var e,t;(e=this._strategy)==null||e.destroy(),this._store.destroy(),(t=this._streamMessenger)==null||t.destroy()}get _eventLog(){return this._connection.eventLog}get metadata(){if(!this._metadata)throw new Error("InternalError: Metadata not defined. Was update called?");return this._metadata}get service(){return this._schema.service}get store(){return this._store}get streamMessenger(){return this._streamMessenger==null&&this._initStreamMessenger(),this._streamMessenger}get statistics(){return mr.from(this._store)}get updateTracking(){return this._updateTracking}get queryEngine(){if(!this._queryEngine){if(!this._schema)return null;const{dataFilter:e}=this._schema.mutable,t=this._schema.mutable.availableFields,s=this._metadata;this._queryEngine=new vt({featureStore:this._store,fieldsIndex:s.fieldsIndex,geometryType:s.geometryType,objectIdField:s.objectIdField,hasM:!1,hasZ:!1,spatialReference:e.outSpatialReference,cacheSpatialQueries:!0,aggregateAdapter:this._aggregateAdapter,timeInfo:s.timeInfo,definitionExpression:e.definitionExpression,availableFields:t})}return this._queryEngine}get isStream(){return this._schema.type==="stream"}chunks(){return Array.from(this._store.chunks())}cleanupRemovedChunks(){return this._store.cleanupRemovedChunks()}onSubscribe(e){var s;this._eventLog.onEvent({type:"subscribe",tile:e.tile.id});const t=(s=this._strategy)==null?void 0:s.load(e);t&&(t.then(()=>this._eventLog.onEvent({type:"loaded",tile:e.tile.id})).catch(r=>this._eventLog.onEvent({type:"error",tile:e.tile.id,error:r})),this._updateTracking.addPromise(t))}onResume(e){var t;this._updateTracking.addPromise(ut((t=this._strategy)==null?void 0:t.load(e)))}onUnsubscribe(e){var t;this._eventLog.onEvent({type:"unsubscribe",tile:e.tile.id}),(t=this._strategy)==null||t.unload(e)}getOverride(e){return this._updateTracking.addPromise(this._doGetOverride(e))}applyOverride(e){this._didInvalidateData=!0,this._store.applyOverrides(e,this.metadata)}async update(e,t){var i,n,a;const s=e.source,r=ft((i=this._schema)==null?void 0:i.mutable,s.mutable);if(!r)return!1;if(y("esri-2d-update-debug")&&console.debug(`Version[${t}] FeatureSource.update`,{changes:r}),this._schema=s,this._metadata=new $e(this._schema.service.metadata),(n=this._queryEngine)==null||n.destroy(),this._queryEngine=null,this._schema.type==="feature"&&this._schema.service.queryMetadata.lastEditDate!=null&&(this._lastEditDate=this._schema.service.queryMetadata.lastEditDate),this._streamMessenger==null&&this._schema.type==="stream"&&this._initStreamMessenger(),ze(r,"sourceRefreshVersion")&&((a=this._strategy)==null?void 0:a.refresh))return await this._strategy.refresh(),!0;if(s.type==="feature"&&ze(r,"availableFields")){if(await this._queryLastEditDateChanged()||this._didInvalidateData)this._didInvalidateData=!1,await this._updateStrategy(t);else{this._eventLog.onEvent({type:"updateFieldsStart"});try{await this._strategy.updateFields(s.mutable.availableFields),this._eventLog.onEvent({type:"updateFieldsEnd"})}catch(o){this._eventLog.onEvent({type:"updateFieldsError",error:o})}}return!1}return!(!Ue(r,"dataFilter")&&!Ue(r,"sourceRefreshVersion"))&&(await this._updateStrategy(t),!0)}_initStreamMessenger(){this._streamMessenger==null&&(this._streamMessenger=new te(this._connection))}async _doGetOverride(e){return this._strategy.queryOverride(e)}async _queryLastEditDateChanged(){if(this._lastEditDate==null)return!1;const e=this._schema.service.source,t={...e.query,f:"json"},s=(await os(e.path,{query:t,responseType:"json"})).data.editingInfo.lastEditDate;return s!==this._lastEditDate&&(this._lastEditDate=s,!0)}async _createStrategy(){const e=this.service,t="isSourceHosted"in e&&e.isSourceHosted,s=Array.isArray(e.source),r=e.source&&"collection"in e.source,i=t||s||r;if(this._schema.type==="stream"){const o=new Br(this._schema.service,this._schema.mutable.dataFilter,this._store,{outSR:this._schema.mutable.dataFilter.outSpatialReference},this.metadata);return this._streamMessenger.strategy=o,o}const n=Ir.fromSchema(this._schema,this._metadata),a=await this._supportSnapshotMode(this._schema,n);return a?new zr(this._schema.service,n,this._store,a.featureCount,this.metadata,this._eventLog):i?new Lr(this._schema.service,n,this._store,this.metadata,this._eventLog):new jr(this._schema.service,n,this._store,this.metadata,this._eventLog)}async _updateStrategy(e){var n;const t=await this._createStrategy();this._eventLog.onEvent({type:"updateStrategyStart",about:t.about});const s=!!this._strategy;this._store.clear(),(n=this._strategy)==null||n.destroy(),this._strategy=t,y("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategy`,{strategy:t});const r=Array.from(this._subscriptions.values());if(!r.length)return void this._eventLog.onEvent({type:"updateStrategyEnd"});const i=Promise.all(r.map(a=>this._strategy.load(a).then(()=>this._eventLog.onEvent({type:"loaded",tile:a.tile.id})).catch(o=>this._eventLog.onEvent({type:"error",tile:a.tile.id,error:o}))));this._updateTracking.addPromise(i);try{s&&await i}catch(a){Fe(a)}this._eventLog.onEvent({type:"updateStrategyEnd"}),y("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategyEnd`,{strategy:t})}async _supportSnapshotMode(e,t){const{queryMetadata:s}=e.service,r=s.snapshotInfo;if(!r||!r.supportsSnapshotMinThreshold||!r.snapshotCountThresholds)return null;const i=e.service.source,n=t.createQuery();n.inner.orderByFields=[],n.inner.returnGeometry=!1;const a=(await Rs(i,n.inner,{query:n.customParameters})).data.count,{min:o,max:h}=r.snapshotCountThresholds;return a<=o||r.supportsSnapshotMaxThreshold&&athis._processor.getFeatureObjectIdsForAggregate(e)},this._subscriptions=new Map,this._updateRequested=!1,this._updateSubscriptionRequests=[],this._updateHighlightRequests=[]}destroy(){this._subscriptions.clear(),this._processor.destroy(),this._source.destroy(),this._handles.remove(),this._editState=null,this._tileInfoView=null}onDetach(){this.destroy(),this._initialize(this._connection)}_initialize(e){this._source=new Yr(this._aggregateAdapter,this._subscriptions,()=>this._requestUpdate(),e),this._processor=new yr(e,this._source),this._handles=gt([pe(()=>this._source.updateTracking.updating,()=>{this._requestUpdate(),this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0})})])}set remoteClient(e){this._connection=new zs(e),this._initialize(this._connection)}get features(){const e=this._source.queryEngine;if(!e)throw new D("no-queryEngine","No query engine defined");return e}get aggregates(){const e=this._processor.aggregateQueryEngine;if(!e)throw new D("no-queryEngine","No aggregate query engine defined");return e}get processor(){return this._processor}get streamMessenger(){return this._source.streamMessenger}getDisplayFeatures(e){return this._processor.getDisplayFeatures(e)}async updateSchema(e,t){return y("esri-2d-update-debug")&&this._updateSchemaState&&console.error("InternalError: Schema already updating"),this._updateSchemaState=new Zr(e,t),this._requestUpdate(),this._updateSchemaState.resolver.promise}updateSubscriptions(e){this._updateSubscriptionRequests.push(e),this._requestUpdate()}updateHighlight(e){this._updateHighlightRequests.push(e),this._requestUpdate()}async onEdits(e){if(this._editState!=null)throw new D("InternalError - Already processing an edit");this._editState=new Qr(e);const t=this._editState.resolver.promise;return this._requestUpdate(),t}queryStatistics(){return this._source.statistics.toJSON()}async queryVisibleFeatures(e,t){return this.features.executeQuery(e,t)}async queryHeatmapStatistics(e){const t=Math.round(us(e.radius));let s=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;const i=typeof e.fieldOffset=="string",n=e.fieldOffset??0,a=Array.from(this._subscriptions.values()),o=this._source.chunks(),h=t**2,c=3/(Math.PI*h),d=2*t,l=Math.ceil(x/d);for(const g of a){const _=g.tile,m=new Float64Array(l*l);for(const p of o){const I=p.getTileReader(_);if(!I)continue;const f=I.getCursor();for(;f.next();){let k=1;if(e.field!=null){const O=f.readAttribute(e.field);k=i?-1*+O:+O+n}const b=f.readXForDisplay()/d,v=f.readYForDisplay()/d,S=Math.floor(b),w=Math.floor(v);if(S<0||w<0||S>=l||w>=l)continue;const $=((.5+S-b)*d)**2+((.5+w-v)*d)**2;if($>h)continue;const F=k*(c*(1-$/h)**2);m[w+S*l]+=F}}for(let p=0;po+h.size(),0)<=e.minFeatureCount){if(!this._source.updateTracking.updating){const o=[];return this._source.store.forEachUnsafe(h=>o.push(h.readLegacyFeatureWorldSpace())),o}return null}const s=new Set,r=[],i=t.map(o=>o.reader.getCursor()),n=new pt,a=3*e.sampleSize;for(let o=0;o=e.sampleSize?r:null}_requestUpdate(){this._updateRequested||(this._updateRequested=!0,ds(()=>this._scheduleNextUpdate()))}_scheduleNextUpdate(){this._updateRequested&&(this._ongoingUpdate||(this._ongoingUpdate=this._doUpdate().finally(()=>{this._ongoingUpdate=null,this._scheduleNextUpdate()}),this._updateRequested=!1))}_subscribe(e){const t=e.tileId;if(this._subscriptions.has(t)){const i=this._subscriptions.get(t);return void(i.paused&&(y("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.resume`),i.resume(),i.version=e.version,this._source.onResume(i)))}y("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.subscribe`);const s=new cs(this._tileInfoView,t),r=new Xr(s,e.version);this._subscriptions.set(t,r),this._source.onSubscribe(r),this._processor.onSubscribe(r)}_unsubscribe(e){const t=this._subscriptions.get(e);t&&(y("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.unsubscribe`),this._source.onUnsubscribe(t),this._processor.onUnsubscribe(t),this._subscriptions.delete(t.key.id),t.destroy())}_pauseSubscription(e){const t=this._subscriptions.get(e);t&&(y("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.pause`),t.pause())}async _doUpdate(){if(y("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateStart"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0}),this._updateSubscriptionRequests.length){const r=this._updateSubscriptionRequests;this._updateSubscriptionRequests=[];for(const i of r)this._doUpdateSubscriptions(i)}const e=this._updateSchemaState;if(this._updateSchemaState=null,e!=null){const{schema:r,version:i}=e;await this._doUpdateSchema(r,i)}const t=this._editState;if(this._editState=null,t!=null){y("esri-2d-update-debug")&&console.debug("Pipeline.applyEditOverride",t.edit);const r=await this._source.getOverride(t.edit);await this._processor.applyOverride(r),y("esri-2d-update-debug")&&console.debug("Pipeline.endEditOverride",t.edit)}if(this._updateHighlightRequests.length){const r=this._updateHighlightRequests;this._updateHighlightRequests=[];for(const i of r)this._processor.updateHighlight(i)}const s=this._source.cleanupRemovedChunks();this._processor.removeChunks(s);try{this._subscriptions.size&&(y("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksStart"),await this._processor.updateChunks(),y("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksEnd"))}catch(r){Fe(r)}t!=null&&t.resolver.resolve(),e!=null&&e.resolver.resolve(),this._updateRequested?(y("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=true]"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0})):(y("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=false, After flush]"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:this._updateRequested}))}async _doUpdateSchema(e,t){var r;if(y("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateStart`,{schema:e}),!this._tileInfoView){const i=De.fromJSON(e.source.tileInfoJSON);this._tileInfoView=new Le(i)}const s={tileInfo:(r=this._tileInfoView)==null?void 0:r.tileInfo};try{const i=await this._source.update(e,t),n=Array.from(this._subscriptions.values());await this._processor.update(e,t,s,i,n)}catch(i){console.error(i)}y("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateEnd`)}_doUpdateSubscriptions(e){if(y("esri-2d-update-debug")&&console.debug("Pipeline.updateSubscriptions",e),!this._tileInfoView){const t=De.fromJSON(e.tileInfoJSON);this._tileInfoView=new Le(t)}for(const t of e.subscribe)this._subscribe(t);for(const t of e.unsubscribe)this._unsubscribe(t);if(y("featurelayer-query-pausing-enabled"))for(const t of e.pause)this._pauseSubscription(t)}}export{Cn as default}; +import{a as we,ij as x,kg as ht,ca as xe,bF as ke,aS as V,bo as Ht,bp as Jt,ip as Kt,eW as ut,E as y,eN as Fe,u as dt,at as Y,aX as ct,b7 as es,b2 as ts,d as G,y as K,f as lt,a7 as _t,g as pe,N as D,ah as ss,s as rs,lX as is,ia as se,ib as ns,i3 as pt,I as as,eF as gt,M as os,jm as hs,df as Te,bh as us,cY as ds,lY as cs,dZ as De,h as Le}from"./index-BjUNJPVf.js";import{m as ft,p as he,d as ze,s as Ue}from"./diffUtils-uUoMDFQS.js";import{n as Ge,i as A,r as ls,M as Ce,p as Me,d as yt,f as $e,g as _s,a as ps,b as gs,h as fs,j as ys}from"./AttributeStore-Bm6hLtR1.js";import{o as ms}from"./tileUtils-B7X19rIS.js";import{S as bs,R as Is,A as vs}from"./geohashUtils-DEscCvdk.js";import{g as Ss,e as ws,c as mt,N as xs,n as bt,p as ks,b as Fs,w as Ts,a as X,K as Cs,O as Ms,r as $s,f as It}from"./featureConversionUtils-BHhm7bvm.js";import{s as H,t as B,e as T}from"./OptimizedGeometry-CQuTPb9g.js";import{x as Os,j as We}from"./timeSupport-DXkhlToK.js";import{o as qs,$ as vt}from"./QueryEngine-loUu1VUW.js";import{Z as St}from"./FieldsIndex-CK-0B5n9.js";import{d as As,c as Ne,S as Rs}from"./query-Bk_ITqRK.js";import{m as wt}from"./quantizationUtils-CfV316jZ.js";import{$ as Be}from"./ogcFeatureUtils-B_dc0icr.js";import{n as Es}from"./pbf-Du8sFEWo.js";import{b as Ps,h as js}from"./pbfQueryUtils-CSeFSIjv.js";import{t as Ve}from"./CircularArray-DfLrgW_-.js";import{createConnection as Ds}from"./createConnection-BvioR9C8.js";import{d as Ls}from"./UpdateTracking2D-Ds_Gdrxd.js";import"./LabelMetric-BcUxDImF.js";import"./Texture-S4dD-WHn.js";import"./Program-DBsYtQ00.js";import"./labelUtils-3p0-m-Ee.js";import"./defaultsJSON-CHAaurhX.js";import"./TimeOnly-BXSODLxA.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./highlightReasons-BOU4mnPE.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./json-Wa8cmqdu.js";import"./WhereClause-Ctld7DSu.js";import"./QueryEngineCapabilities-CTDe3LlQ.js";import"./utils-BKh1cxpi.js";import"./heatmapUtils-BSteZBTj.js";import"./utils-Bzmbfe7p.js";import"./utils-CY1ReiSd.js";import"./ClassBreaksDefinition-Djcxa8Lp.js";import"./RenderState-DaVlEYWY.js";import"./queryZScale-Dwvn5BlQ.js";import"./geojson-AjfTISUf.js";import"./date-M6n_RqpC.js";import"./clientSideDefaults-BQP5n3lX.js";import"./sourceUtils-BNTaqxhX.js";import"./TurboLine-DNQdPIXo.js";import"./earcut-CWKXDqDj.js";import"./utils-CuXO_Zzq.js";import"./Rect-CUzevAry.js";import"./BindType-BmZEZMMh.js";import"./Util-CS5u4Lec.js";import"./constants-D5zmR9t2.js";let zs=class{constructor(e){this._client=e,this.layerView=this._client.createInvokeProxy("",{ignoreConnectionErrors:!0}),this.container=this._client.createInvokeProxy("container",{ignoreConnectionErrors:!0}),this.eventLog=this._client.createInvokeProxy("eventLog",{ignoreConnectionErrors:!0})}};const re=1,Oe=2,ie=4,qe=8,Ae=16,ne=32,Re=64,ae=128;function ue(u){switch(u){case re:case qe:case ne:return-1;case Oe:case Re:return 0;case ie:case Ae:case ae:return 1}}function de(u){switch(u){case re:case Oe:case ie:return-1;case qe:case Ae:return 0;case ne:case Re:case ae:return 1}}const Ye=re|qe|ne,Xe=ie|Ae|ae,Qe=re|Oe|ie,Ze=ne|Re|ae;let Us=class{constructor(e,t,s,r=0){this.tileKey=e,this._bufferingEnabled=t,this._sizeHint=r,this._meshes={self:new Ge(this.id,this._sizeHint),neighbors:new Array},this._currentRecordOverlaps=0,this._currentEntityOverlaps=0,this._copyBufferedDataIntoSelf=s&&this._bufferingEnabled&&e.level===0}get id(){return this.tileKey.id}vertexCount(){return this._meshes.self.vertexCount()}indexCount(){return this._meshes.self.indexCount()}indexEnsureSize(e){this._meshes.self.indexEnsureSize(e)}entityStart(e,t=e){this._currentEntityOverlaps=0,this._meshes.self.entityStart(e,t)}entityRecordCount(){return this._meshes.self.entityRecordCount()}entityEnd(){if(this._meshes.self.entityEnd(),this._bufferingEnabled){if(this._copyBufferedDataIntoSelf)return;for(let e=0;e<8;e++){const t=1<{const n=r.serialize(),a=1<=x-i?Ye:Xe|Ye)|(t<0+n?Ze:t>=x-n?Qe:Ze|Qe));this._currentRecordOverlaps|=a}_copyIntoNeighbors(){for(let e=0;e<8;e++){const t=1<0){const r=this.getBackgroundFill();if(r)return[...r,...s]}return s}getSortKey(e,t){return 0}doMatch(e,t){return null}async fetchResources(e,t){}},Ws=class kt extends L{static async fromDictionaryRenderer(e,t,s){return new kt(e,t,s)}constructor(e,t,s){super(),this._storage=e,this._schema=t,this._viewParams=s,this._hashToGroup=new Map}get fieldMap(){return this._schema.fieldMap}async fetchResources(e,t){const s=t.getCursor(),r=[];for(;s.next();)r.push(this._updateMeshWriterGroup(e,s));await Promise.all(r)}match(e,t){const s=e.getAttributeHash();return this._hashToGroup.get(s)}async _updateMeshWriterGroup(e,t){const s=t.readLegacyFeatureForDisplay(),r=t.getAttributeHash();if(this._hashToGroup.has(r))return;this._hashToGroup.set(r,null);const i=await e.fetchDictionaryResourceImmediate({type:"dictionary-request",feature:s});if(!i)return;const n=await A(this._storage,e,i.meshes,this._viewParams);this._hashToGroup.set(r,n)}},Ns=class Ft extends L{constructor(e,t){super(),this._intervals=[],this._isMaxInclusive=t,this._field=e}static async fromIntervalSchema(e,t,s,r){const i=await e.createComputedField(s),n=new Ft(i,s.isMaxInclusive);await Promise.all(s.intervals.map(async h=>{const c=await A(e,t,h.meshes,r);n.add(h,c)}));const a=await A(e,t,s.defaultSymbol,r);n.setDefault(a);const o=await A(e,t,s.backgroundFill,r);return n.setBackgroundFill(o),n}add(e,t){this._intervals.push({interval:e,result:t}),this._intervals.sort((s,r)=>s.interval.min-r.interval.min)}size(){return super.size()+this._intervals.length}doMatch(e,t){var r;const s=(r=this._field)==null?void 0:r.read(e,t);if(s==null||isNaN(s)||s===1/0||s===-1/0)return null;for(let i=0;i=n.min,h=this._isMaxInclusive?s<=n.max:s{const o=await A(e,t,a.meshes,r);return{minScale:a.minScale,maxScale:a.maxScale,meshes:o,expression:null,where:await e.createWhereClause(a.where)}}),n=await Promise.all(i);return new Tt(n)}constructor(e){super(),this._labels=e}match(e,t){if(!this._labels.length)return null;const s=this._getLabels(t.$view.scale),r=[];for(const i of s)i.where&&!i.where(e)||r.push(...i.meshes);return r}_getLabels(e){return this._labels.filter(t=>this._validForTileScale(t,e))}_validForTileScale(e,t){const s=t-t/4,r=t+t/2;return(!e.minScale||e.minScale>=s)&&(!e.maxScale||e.maxScale<=r)}},Vs=class Ct extends L{constructor(e,t){super(),this._defaultSymbolSortKey=0,this._nullResult=null,this._resultsMap=new Map,this._fields=[],this._fields=e,this._separator=t||""}static async fromMatcherSchema(e,t,s,r){const i=s.expression?[e.createComputedField({expression:s.expression})]:[s.field?e.createComputedField({field:s.field}):null,s.field2?e.createComputedField({field:s.field2}):null,s.field3?e.createComputedField({field:s.field3}):null],n=(await Promise.all(i)).filter(c=>!!c),a=new Ct(n,s.fieldDelimiter),o=await A(e,t,s.defaultSymbol,r);a.setDefault(o);const h=await A(e,t,s.backgroundFill,r);return a.setBackgroundFill(h),await Promise.all(s.map.map(async(c,d)=>{const l=await A(e,t,c.symbol,r);c.value===""?a.setNullResult(l):a.add(c.value,l,d+1)})),a}setNullResult(e){this._nullResult=e}getSortKey(e,t){const s=this._getValueFromFields(e,t);if(s==null||s===""||s==="")return 0;const r=this._resultsMap.get(s.toString());return r?r.sortKey:this._defaultSymbolSortKey}add(e,t,s){this._resultsMap.set(e.toString(),{meshWriters:t,sortKey:s}),this._defaultSymbolSortKey=Math.max(this._defaultSymbolSortKey,s+1)}size(){return super.size()+this._resultsMap.size}doMatch(e,t){var i;const s=this._getValueFromFields(e,t);if(this._nullResult!==null&&(s==null||s===""||s===""))return this._nullResult;if(s==null)return null;const r=s.toString();return(i=this._resultsMap.get(r))==null?void 0:i.meshWriters}_getValueFromFields(e,t){const s=[];for(const r of this._fields){const i=r.read(e,t);i==null||i===""?s.push(""):s.push(i)}return s.join(this._separator)}};async function Q(u,e,t,s){switch(t.type){case"simple":case"heatmap":case"dot-density":case"pie-chart":return L.from(u,e,t,s);case"interval":return Ns.fromIntervalSchema(u,e,t,s);case"dictionary":return Ws.fromDictionaryRenderer(u,t,s);case"label":return Bs.fromLabelSchema(u,e,t,s);case"map":return Vs.fromMatcherSchema(u,e,t,s);case"subtype":return Ys.fromSubtypes(u,e,t,s);case"cluster":return Xs.fromClusterSchema(u,e,t,s);default:throw new Error("Impl")}}let Ys=class Mt extends L{constructor(e,t){super(),this._subMatchers=e,this._subtypeField=t}static async fromSubtypes(e,t,s,r){const i=new Map,n=[];for(const a in s.renderers){const o=parseInt(a,10),h=Q(e,t,s.renderers[a],r).then(c=>i.set(o,c));n.push(h)}return await Promise.all(n),new Mt(i,s.subtypeField)}match(e,t){const s=e.readAttribute(this._subtypeField),r=this._subMatchers.get(s);return r?r.match(e,t):null}},Xs=class $t extends L{static async fromClusterSchema(e,t,s,r){const[i,n]=await Promise.all([Q(e,t,s.feature,r),Q(e,t,s.cluster,r)]);return new $t(i,n)}constructor(e,t){super(),this._featureMatcher=e,this._clusterMatcher=t}match(e,t){return e.readAttribute("cluster_count")===1?this._featureMatcher.match(e,t):this._clusterMatcher.match(e,t)}},Qs=class Ot extends Gs{static async create(e,t,s,r){const i=await Q(e,t,s.symbology,r),n=s.labels?await Q(e,t,s.labels,r):null;return new Ot(i,n)}constructor(e,t){super(),this._symbology=e,this._labels=t}destroy(){}async enqueueMatcherRequests(e,t){var s;await Promise.all([this._symbology.fetchResources(e,t),(s=this._labels)==null?void 0:s.fetchResources(e,t)])}enqueueWriterRequests(e,t,s){const r=this._symbology.match(t,s);if(r){for(const i of r)i.enqueueRequest(e,t,s);if(this._labels){const i=this._labels.match(t,s);if(!i)return;for(const n of i)n.enqueueRequest(e,t,s)}}}write(e,t,s,r,i){const n=this._symbology.match(s,r);if(n){for(const a of n)a.write(e,t,s,r,i);if(e.entityRecordCount()>=1&&this._labels){const a=this._labels.match(s,r);if(!a)return;for(const o of a)o.setReferences(n),o.write(e,t,s,r,i)}}}getSortKey(e,t){return this._symbology.getSortKey(e,t)}},Zs=class{constructor(e){this._outstandingMessages=[],this._queue=new ht({concurrency:e.concurrency,process:t=>e.process(t)})}async push(e){if(e.end)return await Promise.all(this._outstandingMessages),await this._queue.push(e),void(this._outstandingMessages=[]);const t=this._queue.push(e);return this._outstandingMessages.push(t),t}},qt=class ge{static async create(e,t){var r;if(t.statisticType==="count"){const i=new ls(1);return new ge(t.name,t.alias,t.type,t.statisticType,i)}const s=await e.createComputedField({expression:(r=t.onStatisticExpression)==null?void 0:r.expression,field:t.onStatisticField});return new ge(t.name,t.alias,t.type,t.statisticType,s)}constructor(e,t,s,r,i){this.name=e,this.alias=t,this.type=s,this.statisticType=r,this.computed=i}},Ee=class{constructor(e){this.subscription=e,this.handledChunks=new Set}destroy(){}},At=class{constructor(e,t){this._source=e,this._attributeStore=t,this._sendStates=new Map}destroy(){}get enablePixelBuffering(){return!0}onSubscribe(e){const t=this.createState(e);this._sendStates.set(e.key.id,t),this.updateChunks()}onUnsubscribe(e){var t;(t=this._sendStates.get(e.key.id))==null||t.destroy(),this._sendStates.delete(e.key.id)}invalidate(){const e=Array.from(this._sendStates.values());this._sendStates.clear();for(const t of e)t.destroy(),this.onSubscribe(t.subscription)}invalidateAttributeData(){}getFeatureObjectIdsForAggregate(e){throw new Error("InternalError: AggregateId lookup not supported")}getDisplayIds(e){return this.displayMap(e,t=>t,t=>t)}getDisplayAndObjectIds(e){return this.displayMap(e,t=>t,(t,s,r)=>[t,r])}afterUpdateChunks(){}},Rt=class extends At{constructor(e,t,s,r){super(e,t),this.spatialReference=s,this.aggregateFields=r,this.events=new xe,this.featureAdapter=qs}get aggregateQueryEngine(){return this._aggregateQueryEngine||(this._aggregateQueryEngine=new vt({featureStore:this,fieldsIndex:this._metadata.fieldsIndex,geometryType:this._metadata.geometryType,objectIdField:this._metadata.objectIdField,spatialReference:this.spatialReference})),this._aggregateQueryEngine}removeChunks(e){}forEach(e){return this.forEachAggregateWorldSpace(e)}forEachInBounds(e,t){}forEachBounds(e,t){const s=ke();for(const r of e){const i=Ss(s,r.geometry,!1,!1);i&&t(i)}}},Pe=class{constructor(e,t,s,r,i){this.subscription=e,this.reader=t,this.clear=s,this.end=r,this.debugInfo=i,this.type="append"}get id(){return this.subscription.tile.id}createMessage(e,t,s){return{type:"append",clear:this.clear,id:this.id,append:e,end:this.end,debugInfo:this.debugInfo,subscriptionVesrion:this.subscription.version,version:t,attributeEpoch:s}}},fe=class{constructor(e,t,s,r,i){this.subscription=e,this.reader=t,this.remove=s,this.end=r,this.debugInfo=i,this.type="update"}get id(){return this.subscription.tile.id}createMessage(e,t,s){return{type:"update",id:this.id,modify:e,debugInfo:this.debugInfo,remove:this.remove,version:t,subscriptionVesrion:this.subscription.version,end:this.end,attributeEpoch:s}}},M=class j extends Ce{static fromFeatures(e,t){const{objectIdField:s,geometryType:r}=t,i=ws([],e,r,!1,!1,s);for(let n=0;n!(s.objectId!=null&&t.has(s.objectId)))}getSize(){return this._features.length}getCursor(){return this.copy()}getInTransform(){return this._transform}getAttributeHash(){let e="";for(const t in this._current.attributes)e+=this._current.attributes[t];return e}getIndex(){return this._featureIndex}setIndex(e){this._featureIndex=e}getObjectId(){var e;return(e=this._current)==null?void 0:e.objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){this._current.displayId=e}copy(){const e=new j(this._features,this.metadata);return this.copyInto(e),e}next(){for(;++this._featureIndexqt.create(n,c))),h=e.featureFilter?await yt.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:t,filterJSON:e.featureFilter}):null;return await Os(t,V.WGS84),new Et({fields:o,geohashLevel:a,spatialReference:t,featureFilter:h,timeZone:i},e.fields,s,r)}constructor(e,t,s,r){super(s,r,e.spatialReference,e.fields),this._indexOptions=e,this._metadata=new $e({geometryType:"esriGeometryPolygon",objectIdField:"aggregateId",fields:t,globalIdField:null,spatialReference:s.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null})}createState(e){return new Hs(e,this._attributeStore)}async*applyOverride(e){for(const t of this._sendStates.values())t.reset(),yield new Pe(t.subscription,M.empty(this._source.metadata),!0,!1,{})}displayMap(e,t,s){const r=new Map(e.map(n=>[t(n),n])),i=[];for(const n of this._sendStates.values())for(const a of n.featuresWorldSpace()){const{objectId:o,displayId:h}=a,c=r.get(o);if(c!=null){const d=s(h,c,o);i.push(d),r.delete(o)}}return i}getDisplayFeatures(e){const t=new Set(e),s=new Set,r=[];for(const i of this._sendStates.values())for(const n of i.featuresWorldSpace())t.has(n.displayId)&&!s.has(n.objectId)&&(n.geometry&&r.push({...bt(n,this._metadata.geometryType,!1,!1),displayId:n.displayId}),s.add(n.objectId));return{features:[],aggregates:r}}getFeatureObjectIdsForAggregate(e){for(const t of this._sendStates.values())for(const s of t.bins.values())if(s.id===e)return Array.from(s.objectIds);return[]}async*updateChunks(){if(this._source.chunks().length)for(const e of this._sendStates.values())yield*this._update(e,this._source)}forEachAggregateWorldSpace(e){for(const t of this._sendStates.values())for(const s of t.featuresWorldSpace())e(s)}async*_update(e,t){const{handledChunks:s,subscription:r,bins:i}=e,{spatialReference:n,geohashLevel:a}=this._indexOptions,o=r.tile;if(e.done)return;for(const p of t.chunks()){if(s.has(p.chunkId))continue;s.add(p.chunkId);const I=p.queryInfo;if("tileId"in I){const b=new we(I.tileId);if(b.level!==o.level||b.world!==o.key.world)continue}const f=p.getGeohashIndex(this._indexOptions),k=e.getGeohashBounds(n,a);k!=null&&f.putBins(i,k)}const h=[],c=r.tile.transform,d=r.tile.key.level;for(const p of i.values()){if(p.cachedFeature)p.cachedFeature.attributes=p.getAttributes();else{const I=p.getGeometry(this.spatialReference,c),f=new B(I,p.getAttributes(),null);I||(f.centroid=p.getGeometryCentroid(this.spatialReference,c)),f.objectId=p.id,f.displayId=this._attributeStore.createDisplayIdForObjectId(`${f.objectId}.${d}`),p.cachedFeature=f}h.push(p.cachedFeature)}this.events.emit("changed"),e.done=!t.updateTracking.updating;const l=M.fromOptimizedFeatures(h,this._metadata,c),g=l.getCursor(),_=e.subscription.tile.createArcadeEvaluationOptions(this._indexOptions.timeZone);for(;g.next();)this._attributeStore.setAttributeData(g.getDisplayId(),g,_);yield new fe(e.subscription,l,[],e.done,{})}};const He=Math.PI/180;let Pt=class ye{static create(e){return new ye(e.map(t=>Ks(t)))}constructor(e){this._statistics=e}values(){return this._statistics.values()}insert(e,t){for(const s of this._statistics)s.insert(e,t)}merge(e){for(let t=0;te.clone()))}};function Ks(u){switch(u.statisticType){case"min":return new er(u);case"max":return new tr(u);case"avg":return new rr(u);case"avg_angle":return new ir(u);case"sum":case"count":return new sr(u);case"mode":return new nr(u)}}let W=class{constructor(e){this.field=e}insert(e,t){if(!this.field.computed)return;const s=this.field.computed.read(e,t);_s(s)||this._insertValue(s)}},er=class jt extends W{constructor(){super(...arguments),this.type="min",this.value=Number.MAX_VALUE}_insertValue(e){this.value=Math.min(this.value,e)}merge(e){this.value=Math.min(this.value,e.value)}clone(){const e=new jt(this.field);return e.value=this.value,e}},tr=class Dt extends W{constructor(){super(...arguments),this.type="max",this.value=Number.MIN_VALUE}_insertValue(e){this.value=Math.max(this.value,e)}merge(e){this.value=Math.max(this.value,e.value)}clone(){const e=new Dt(this.field);return e.value=this.value,e}},sr=class Lt extends W{constructor(){super(...arguments),this.type="sum",this.value=0}_insertValue(e){this.value+=e}merge(e){this.value+=e.value}clone(){const e=new Lt(this.field);return e.value=this.value,e}},rr=class zt extends W{constructor(){super(...arguments),this.type="avg",this._total=0,this._count=0}get value(){return this._total/this._count}_insertValue(e){this._total+=e,this._count+=1}merge(e){this._total+=e._total,this._count+=e._count}clone(){const e=new zt(this.field);return e._total=this._total,e._count=this._count,e}},ir=class Ut extends W{constructor(){super(...arguments),this.type="avg_angle",this._x=0,this._y=0,this._count=0}get value(){const e=this._x/this._count,t=this._y/this._count,s=180/Math.PI;return Math.atan2(t,e)*s}_insertValue(e){this._x=this._x+Math.cos(e*He),this._y=this._y+Math.sin(e*He),this._count+=1}merge(e){this._x+=e._x,this._y+=e._y,this._count+=e._count}clone(){const e=new Ut(this.field);return e._x=this._x,e._y=this._y,e._count=this._count,e}},nr=class Gt extends W{constructor(){super(...arguments),this._frequencies=new Map}get value(){let e,t=0;for(const[s,r]of this._frequencies.entries())r>t&&(t=r,e=s);return e}_insertValue(e){const t=this._frequencies.get(e);t!=null?this._frequencies.set(e,t+1):this._frequencies.set(e,1)}merge(e){for(const[t,s]of e._frequencies.entries()){const r=this._frequencies.get(t);r!=null?this._frequencies.set(t,r+s):this._frequencies.set(t,s)}}clone(){const e=new Gt(this.field);return e._frequencies=new Map(this._frequencies),e}},me=class ee{static createId(e,t){return`${e}.${t}`}static create(e,t,s,r){return new ee(e,t,Pt.create(s),r)}constructor(e,t,s,r){this.gridX=e,this.gridY=t,this._statistics=s,this._worldUnitsPerCell=r,this._count=0,this._xWorldTotal=0,this._yWorldTotal=0,this._objectIds=new Set}get id(){return ee.createId(this.gridX,this.gridY)}get count(){return this._count}get statistics(){return this._statistics}get objectIds(){return this._objectIds}get firstObjectId(){return this._objectIds.values().next().value}get centroidXWorld(){return this._xWorldTotal/this._count}get centroidYWorld(){return this._yWorldTotal/this._count}clone(){const e=new ee(this.gridX,this.gridY,this._statistics.clone(),this._worldUnitsPerCell);return e._count=this._count,e._xWorldTotal=this._xWorldTotal,e._yWorldTotal=this._yWorldTotal,e._firstFeatureAttributes=this._firstFeatureAttributes,e._objectIds=new Set(this._objectIds),e}insert(e,t,s,r){this._count===0?this._firstFeatureAttributes=e.readAttributes():this._firstFeatureAttributes=null,this._count+=1,this._xWorldTotal+=s,this._yWorldTotal+=r,this._statistics.insert(e,t),this._objectIds.add(e.getObjectId())}merge(e){if(e._count!==0){this._count+=e._count,this._firstFeatureAttributes=e._firstFeatureAttributes,this._xWorldTotal+=e._xWorldTotal,this._yWorldTotal+=e._yWorldTotal,this._statistics.merge(e._statistics);for(const t of e._objectIds.values())this._objectIds.add(t)}}getCentroidX(e){return e==null?this.centroidXWorld:Fs(e,this.centroidXWorld)}getCentroidY(e){return e==null?this.centroidYWorld:Ts(e,this.centroidYWorld)}getCentroid(e){const t=new T([],[this.centroidXWorld,this.centroidYWorld]);if(e!=null){const s=new T;return X(s,t,!1,!1,"esriGeometryPoint",e)}return t}getGeometricCentroid(e){const t=this.gridX*this._worldUnitsPerCell+.5*this._worldUnitsPerCell,s=this.gridY*this._worldUnitsPerCell+.5*this._worldUnitsPerCell,r=new T([],[t,s]);if(e!=null){const i=new T;return X(i,r,!1,!1,"esriGeometryPoint",e)}return r}getAttributes(){const e={aggregateId:this.id};for(const t of this._statistics.values())e[t.field.name]=t.value;return this._firstFeatureAttributes!=null?{...e,...this._firstFeatureAttributes}:e}};const ar=96;function be(u,e){return Ht(u)*Jt*ar/e}let or=class{constructor(e){this._options=e,this._cells=new Map,this._pixelsPerMapUnit=be(e.spatialReference,e.scale)}insert(e,t){const s=e.getCursor(),r={$view:{scale:this._options.scale,timeZone:this._options.timeZone}};for(;s.next();)this._insertFeature(s,r,t)}putCellsInBounds(e,t){const[s,r,i,n]=t,a=Math.floor(s*this._pixelsPerMapUnit/this._options.cellSize),o=Math.floor(r*this._pixelsPerMapUnit/this._options.cellSize),h=Math.ceil(i*this._pixelsPerMapUnit/this._options.cellSize),c=Math.ceil(n*this._pixelsPerMapUnit/this._options.cellSize);for(let d=o;d<=c;d++)for(let l=a;l<=h;l++){const g=`${l}.${d}`,_=this._cells.get(g);if(!_)continue;const m=e.get(_.id);m?_&&!e.has(_.id)&&m.merge(_):e.set(_.id,_.clone())}}putCells(e){for(const t of this._cells.values()){const s=e.get(t.id);s?s.merge(t):e.set(t.id,t.clone())}}_insertFeature(e,t,s){const{featureFilter:r}=this._options;if(r!==null&&!r.check(e))return;let i=0,n=0;if(e.geometryType==="esriGeometryPoint")i=e.readXWorldSpace(),n=e.readYWorldSpace();else{if(s){const l=e.readCentroidForDisplay();if(l==null)return;const[g,_]=l.coords;if(g<0||g>x||_<0||_>x)return}const d=e.readCentroidWorldSpace();if(d==null)return;i=d.coords[0],n=d.coords[1]}const a=i*this._pixelsPerMapUnit,o=n*this._pixelsPerMapUnit,h=Math.floor(a/this._options.cellSize),c=Math.floor(o/this._options.cellSize);this._getCellOrCreate(h,c).insert(e,t,i,n)}_getCellOrCreate(e,t){const s=me.createId(e,t);let r=this._cells.get(s);if(!r){const i=1*this._options.cellSize/this._pixelsPerMapUnit;r=me.create(e,t,this._options.fields,i),this._cells.set(s,r)}return r}},hr=class{constructor(e,t){this.inner=e,this.displayId=t}};const J=128;let ur=class extends Ee{constructor(e){super(e),this.didSend=!1,this.done=!1}},dr=class{constructor(e,t,s,r,i){this._level=e,this._scale=t,this._indexOptions=s,this._clusterRadius=r,this._store=i,this._cells=new Map,this._handledChunks=new Set,this._statistics=new Map,this._clusters=new Map}destroy(){this._clearClusters()}_clearClusters(){for(const e of this._clusters.values())this._store.releaseDisplayIdForObjectId(e.inner.id);this._clusters.clear()}*aggregatesWorldSpace(){for(const e of this._clusters.values()){const t=e.inner.getCentroid(null),s=new B(t,e.inner.getAttributes(),null);s.objectId=e.inner.id,s.displayId=e.displayId,yield s}}clusters(){return this._clusters.values()}updateChunks(e,t){let s=!1;for(const a of e){const o=a.queryInfo;"tileId"in o&&new we(o.tileId).level!==this._level||this._handledChunks.has(a.normalizedChunkId)||(this._handledChunks.add(a.normalizedChunkId),s=!0,a.getGridIndex({...this._indexOptions,scale:this._scale}).putCells(this._cells))}const r={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0},i=be(this._indexOptions.spatialReference,this._scale),n=this._indexOptions.cellSize;for(const{subscription:a}of t){const o=a.tile.bounds,h=Math.floor(o[0]*i/n),c=Math.floor(o[1]*i/n),d=Math.ceil(o[2]*i/n),l=Math.ceil(o[3]*i/n);r.xMin=Math.min(r.xMin,h),r.yMin=Math.min(r.yMin,c),r.xMax=Math.max(r.xMax,d),r.yMax=Math.max(r.yMax,l)}return this._lastCellBounds!=null&&r.xMin===this._lastCellBounds.xMin&&r.yMin===this._lastCellBounds.yMin&&r.yMin===this._lastCellBounds.yMin&&r.yMax===this._lastCellBounds.yMax||(s=!0,this._lastCellBounds=r),s&&this._clusterCells(r),s}async updateStatistics(e){let t=!1;for(const s of this._clusters.values())s.inner.count>1&&(t=this._updateAggregateStatistics(this._statistics,s.inner)||t);if(t){const s=Array.from(this._statistics.entries()).map(([r,i])=>({fieldName:r,minValue:i.minValue,maxValue:i.maxValue}));await e.container.updateStatistics(this._level,s)}}createAggregateFeatures(e,t){const s=e.subscription,r=[],i=s.tile.transform;for(const n of this._clusters.values()){let a=n.inner.getCentroidX(i);const o=n.inner.getCentroidY(i),h=s.tile.lod,c=h.wrap?h.worldSize[0]:null,d=n.inner.count===1?n.inner.firstObjectId:n.inner.id,l=n.displayId;if(c!=null)if(c===1){const g=new T([],[a,o]),_=new B(g,n.inner.getAttributes(),null);_.geometry.coords[0]-=x,_.objectId=d,_.displayId=l,r.push(_);const m=new T([],[a,o]),p=new B(m,n.inner.getAttributes(),null);p.geometry.coords[0]+=x,p.objectId=d,p.displayId=l,r.push(p)}else a>x+x/2?a-=c*x:a<-x/2&&(a+=c*x);if(a=-J&&o=-J){const g=new T([],[a,o]),_=new B(g,n.inner.getAttributes(),null);_.objectId=d,_.displayId=l,r.push(_)}}return M.fromOptimizedFeatures(r,t,s.tile.transform)}_clusterCells(e){let t=Array.from(this._cells.values());t=t.sort((a,o)=>o.count-a.count);const s=[];for(const a of this._clusters.values())s.push(a.inner.id);this._clusters.clear();const r=this._clusterRadius*(1/be(this._indexOptions.spatialReference,this._scale)),i=1+this._clusterRadius/this._indexOptions.cellSize,n=new Set;for(const a of t){if(n.has(a.id)||a.gridXe.xMax||a.gridYe.yMax)continue;const o=this._store.createDisplayIdForObjectId(a.id),h=new hr(a.clone(),o);n.add(a.id),this._clusters.set(a.id,h);const c=a.centroidXWorld,d=a.centroidYWorld;for(let l=a.gridY-i;l<=a.gridY+i;l++)for(let g=a.gridX-i;g<=a.gridX+i;g++){if(l===a.gridY&&g===a.gridX)continue;const _=this._cells.get(me.createId(g,l));if(!_||n.has(_.id))continue;const m=Math.abs(_.centroidXWorld-c),p=Math.abs(_.centroidYWorld-d);mqt.create(a,h))),spatialReference:s,featureFilter:t.featureFilter?await yt.create({geometryType:r.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:r.metadata.timeInfo,fieldsIndex:r.metadata.fieldsIndex,spatialReference:s,filterJSON:t.featureFilter}):null,cellSize:t.clusterRadius/4,timeZone:n};return new je(e,t.clusterRadius,o,t.fields,r,i)}constructor(e,t,s,r,i,n){super(i,n,s.spatialReference,s.fields),this._connection=e,this._clusterRadius=t,this._indexOptions=s,this._cellsPerScale=new Map,this._metadata=new $e({geometryType:"esriGeometryPoint",objectIdField:"aggregateId",fields:[...r,...this._source.metadata.fieldsIndex.fields,{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}],globalIdField:null,spatialReference:i.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null})}get enablePixelBuffering(){return!1}invalidate(){super.invalidate();for(const e of this._cellsPerScale.values())e.destroy();this._cellsPerScale.clear()}onSubscribe(e){super.onSubscribe(e),this._requiredLevel=e.tile.level,this._requiredScale=e.tile.scale}createState(e){return new ur(e)}async*applyOverride(e){for(const t of this._cellsPerScale.values())t.destroy();this._cellsPerScale.clear();for(const t of this._sendStates.values())t.done=!1}displayMap(e,t,s){const r=new Map(e.map(a=>[t(a),a])),i=[],n=this._getClusterState(this._requiredLevel,this._requiredScale);for(const a of n.clusters()){const o=r.get(a.inner.id);if(o==null){if(a.inner.count===1){const h=r.get(a.inner.firstObjectId);if(h!=null){const c=s(a.displayId,h,a.inner.firstObjectId);i.push(c),r.delete(a.inner.firstObjectId)}}}else{const h=s(a.displayId,o,a.inner.id);i.push(h),r.delete(a.inner.id)}}return i}getDisplayFeatures(e){const t=new Set(e),s=new Set,r=[],i=[],n=this._getClusterState(this._requiredLevel,this._requiredScale);for(const a of n.aggregatesWorldSpace())if(t.has(a.displayId)&&!s.has(a.displayId)){const o=bt(a,this._metadata.geometryType,!1,!1);if(s.add(a.displayId),o.attributes.cluster_count===1){r.push({...o,displayId:a.displayId});continue}i.push({...o,displayId:a.displayId})}return{features:r,aggregates:i}}getFeatureObjectIdsForAggregate(e){const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const s of t.clusters())if(s.inner.id===e)return Array.from(s.inner.objectIds);return[]}async*updateChunks(){const e=this._source.chunks();if(!e.length)return;const t=this._getClusterState(this._requiredLevel,this._requiredScale),s=Array.from(this._sendStates.values()).filter(n=>n.subscription.tile.level===this._requiredLevel);if(t.updateChunks(e,s)||!this._source.updateTracking.updating)for(const n of s)n.subscription.tile.level===this._requiredLevel&&(n.didSend=!1,n.done=!1);const r=Array.from(this._sendStates.values()).filter(n=>n.done).map(n=>n.subscription.tile.key),i=new Set(r);for(const n of this._sendStates.values())this._source.updateTracking.updating&&(r.some(a=>a.containsChild(n.subscription.tile.key))||n.subscription.tile.key.getChildKeys().every(a=>i.has(a)))||n.didSend||n.subscription.tile.level!==this._requiredLevel||(n.didSend=!0,yield*this._update(n,t,this._source));await t.updateStatistics(this._connection)}forEachAggregateWorldSpace(e){if(this._requiredLevel==null||this._requiredScale==null)return;const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const s of t.aggregatesWorldSpace())e(s)}_getClusterState(e,t){if(e==null||t==null)throw new Error("InternalError: Level and scale must be defined");let s=this._cellsPerScale.get(t);return s||(s=new dr(e,t,this._indexOptions,this._clusterRadius,this._attributeStore),this._cellsPerScale.set(t,s)),s}async*_update(e,t,s){if(e.done)return;const r=t.createAggregateFeatures(e,this._metadata);this.events.emit("changed"),e.done=!s.updateTracking.updating;const i=r.getCursor(),n=e.subscription.tile.createArcadeEvaluationOptions(this._indexOptions.timeZone);for(;i.next();)this._attributeStore.setAttributeData(i.getDisplayId(),i,n);yield new Pe(e.subscription,r,!0,e.done,{})}}let cr=class Wt{static fromReader(e){const t=[],s=e.copy(),r=ke();for(;s.next();)s.getBounds(r)&&t.push(s.getIndex());const i=Kt(9,n=>(s.setIndex(n),{minX:s.getBoundsXMin(),minY:s.getBoundsYMin(),maxX:s.getBoundsXMax(),maxY:s.getBoundsYMax()}));return i.load(t),new Wt(i)}constructor(e){this._index=e}search(e){const t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this._index.search(t)}},Je=class Ie{static create(e,t,s,r){const i=Pt.create(e),n=new Array(32);for(let a=0;a=n)return;const l=Math.ceil((h+1)/2),g=Math.floor((h+1)/2),_=1-h%2,m=30-(3*l+2*g),p=30-(2*l+3*g),I=(r&7*_+3*(1-_)<>m,f=(i&3*_+7*(1-_)<>p,k=I+f*(8*_+4*(1-_));c=c<<3*_+2*(1-_)|I,d=d<<2*_+3*(1-_)|f,o.children[k]==null&&(o.children[k]=Je.create(this._fields,c,d,h+1)),h+=1,o=o.children[k]}}putBins(e,t){for(const s of this.getNodes(t)){const r=e.get(s.id);r?r.merge(s):e.set(s.id,s.clone())}}getNodes(e){const t=[],{geohashBounds:s,level:r}=e;let i=this._root;for(;i!==null;){const n=i.depth,a=i.xNode,o=i.yNode;if(n>=r){t.push(i),i=i.next;continue}const h=Math.ceil((n+1)/2),c=Math.floor((n+1)/2),d=1-n%2,l=30-(3*h+2*c),g=30-(2*h+3*c),_=~((1<>l,I=(s.yLL&m)>>g,f=(s.xTR&_)>>l,k=(s.yTR&m)>>g,b=a<<3*d+2*(1-d),v=o<<2*d+3*(1-d),S=b+8*d+4*(1-d),w=v+4*d+8*(1-d),$=Math.max(b,p),F=Math.max(v,I),O=Math.min(S,f),R=Math.min(w,k);let C=null,q=null;for(let E=F;E<=R;E++)for(let P=$;P<=O;P++){const Zt=P-b+(E-v)*(8*d+4*(1-d)),N=i.children[Zt];N&&(C||(C=N,C.next=i.next),q&&(q.next=N),q=N,N.next=i.next)}i=C||i.next}return t}},_r=class{constructor(e){this._options=e,this._tree=new lr(e.fields)}insert(e,t){const s=e.getCursor(),r={$view:{scale:0,timeZone:this._options.timeZone}};for(;s.next();)this._insertFeature(s,r,t)}putBins(e,t){this._tree.putBins(e,t)}_insertFeature(e,t,s){const{featureFilter:r,geohashLevel:i,spatialReference:n}=this._options;if(r!==null&&!r.check(e))return;let a=0,o=0;if(e.geometryType==="esriGeometryPoint")a=e.readXWorldSpace(),o=e.readYWorldSpace();else{if(s){const d=e.readCentroidForDisplay();if(d==null)return;const[l,g]=d.coords;if(l<0||l>x||g<0||g>x)return}const c=e.readCentroidWorldSpace();if(c==null)return;a=c.coords[0],o=c.coords[1]}const h=vs(a,o,i,n);h&&this._tree.insert(e,a,o,h[0],h[1],i,t)}},pr=class ve extends Ce{static from(e,t){return new ve(e.copy(),t)}constructor(e,t){super(e.metadata),this._currentIndex=-1,this._displayTranslationX=0,this._displayTranslationY=0,this._displayScaleX=1,this._displayScaleY=1,this._reader=e,this._indices=t,this._isPoint=e.geometryType==="esriGeometryPoint"}setTransformForDisplay(e){const t=this._reader.getInTransform();if(t==null){const[d,l]=e.scale,[g,_]=e.translate;return this._displayTranslationX=-g/d,this._displayScaleX=1/d,this._displayTranslationY=_/l,this._displayScaleY=1/-l,void(this._displayTransform=e)}const[s,r]=t.scale,[i,n]=t.translate,[a,o]=e.scale,[h,c]=e.translate;if(this._displayScaleX=s/a,this._displayTranslationX=(i-h)/a,this._displayScaleY=r/o,this._displayTranslationY=(-n+c)/o,!this._isPoint&&t)throw new Error("InternalError: Relative transformations not supported for non-point features");this._displayTransform=e}getInTransform(){return this._reader.getInTransform()}get fields(){return this._reader.fields}get hasNext(){return this._currentIndex+1[t(n),n])),i=[];for(const n of this._source.chunks()){const a=n.reader.getCursor();for(;a.next();){const o=a.getObjectId(),h=a.getDisplayId(),c=r.get(o);if(c!=null){const d=s(h,c,o);i.push(d),r.delete(o)}}}return i}getDisplayFeatures(e){const t=new Set(e),s=new Set,r=[];for(const i of this._source.chunks()){const n=i.reader.getCursor();for(;n.next();){const a=n.getObjectId(),o=n.getDisplayId();t.has(o)&&!s.has(a)&&(r.push({...n.readLegacyFeatureWorldSpace(),displayId:o}),s.add(a))}}return{features:r,aggregates:[]}}async*applyOverride(e){const t=[],s=e.reader.getCursor();for(;s.next();){const a=s.getObjectId();t.push(a);const o=this._attributeStore.createDisplayIdForObjectId(a);s.setDisplayId(o),this._attributeStore.setAttributeData(o,s,this._evalOptions)}const r=this.getDisplayIds(t),i=this.getDisplayIds(e.removed),n=new Nt(this._source.metadata);n.applyOverrides(e),this.handledChunks.add(n.chunkId),this.handledChunksForAttributeData.add(n.chunkId),this.handledChunksForIdCreation.add(n.chunkId);for(const a of this._sendStates.values())a.handledChunks.add(n.chunkId),yield new fe(a.subscription,null,r,!1,n.queryInfo);for(const a of this._sendStates.values()){const o=n.getTileReader(a.subscription.tile);yield new fe(a.subscription,o,i,!1,n.queryInfo)}for(const a of e.removed)this._attributeStore.releaseDisplayIdForObjectId(a)}async*updateChunks(){if(this._source.chunks().length){await this._updateAttributeData();for(const e of this._sendStates.values())yield*this._update(e)}}removeChunks(e){for(const t of e)this.handledChunks.delete(t.chunkId),this.handledChunksForAttributeData.delete(t.chunkId),this._cleanupChunkIds(t)}afterUpdateChunks(){for(const e of this._streamLayerDeferredObjectIdsToRemove)this._attributeStore.releaseDisplayIdForObjectId(e);this._streamLayerDeferredObjectIdsToRemove=[]}_cleanupChunkIds(e){if(this.handledChunksForIdCreation.has(e.chunkId)){const t=e.reader.getCursor();for(;t.next();){const s=t.getObjectId();this._source.isStream?this._streamLayerDeferredObjectIdsToRemove.push(s):this._attributeStore.releaseDisplayIdForObjectId(s)}this.handledChunksForIdCreation.delete(e.chunkId)}}async _updateAttributeData(){for(const e of this._source.chunks()){const{chunkId:t,reader:s}=e;if(!this.handledChunksForIdCreation.has(t)){this.handledChunksForIdCreation.add(t);const r=s.getCursor();for(;r.next();){const i=this._attributeStore.createDisplayIdForObjectId(r.getObjectId());r.setDisplayId(i)}}}for(const e of this._source.chunks())if(!this.handledChunksForAttributeData.has(e.chunkId)){this.handledChunksForAttributeData.add(e.chunkId);const t=e.reader.getCursor();for(;t.next();){const s=t.getDisplayId();this._attributeStore.setAttributeData(s,t,this._evalOptions)}}}*_update(e){const{subscription:t,handledChunks:s}=e;for(const r of this._source.chunks()){const{chunkId:i}=r;if(s.has(i))continue;s.add(i);const n=r.getTileReader(t.tile);n&&(yield new Pe(e.subscription,n,!1,r.end,r.queryInfo))}}},yr=class{constructor(e,t){this._connection=e,this._source=t,this._version=1,this._proxy=new ps({fetch:(s,r)=>this._connection.layerView.fetch(s,r),fetchDictionary:(s,r)=>this._connection.layerView.fetchDictionary(s,r)}),this._attributeStore=new gs({isLocal:!1,update:s=>ut(this._connection.container.updateAttributeView(s))})}destroy(){var e;this._proxy.destory(),(e=this._strategy)==null||e.destroy(),this._attributeStore.destroy()}get aggregateQueryEngine(){var e;return(e=this._strategy)==null?void 0:e.aggregateQueryEngine}getDisplayFeatures(e){return this._strategy?this._strategy.getDisplayFeatures(e):{features:[],aggregates:[]}}getFeatureObjectIdsForAggregate(e){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(e):[]}onSubscribe(e){var t;(t=this._strategy)==null||t.onSubscribe(e)}onUnsubscribe(e){var t;(t=this._strategy)==null||t.onUnsubscribe(e)}async update(e,t,s,r,i){var c;const n=e.processor,a=ft(this._schema,n);if(!a&&!r)return;y("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:a,schema:n}),this._schema=n;const o=V.fromJSON(e.source.mutable.dataFilter.outSpatialReference),h=new Me({fields:this._source.metadata.fieldsIndex,spatialReference:o});return await this._attributeStore.update(n.storage,h,this._source.metadata,o,t),(c=this._strategy)==null||c.invalidateAttributeData(),r||he(a,"mesh")?(he(a,"mesh.strategy")&&await this._updateStrategy(n.mesh.strategy,o,i,n.mesh.timeZone),this._updateSortKey(h,"sortKey"in n.mesh?n.mesh.sortKey:null),(he(a,"mesh.factory")||n.mesh.factory.symbology.type==="dictionary")&&(this._factory=await Qs.create(h,this._proxy,n.mesh.factory,s)),this._invalidate(),this._version=t,this._connection.container.updateRenderState(this._version)):void 0}async applyOverride(e){if(!this._strategy)return;const t=this._strategy.applyOverride(e);for await(const s of t)try{await this._process(s)}catch{}this._source.applyOverride(e)}async updateChunks(){var e;await this._doUpdateChunks(),(e=this._strategy)==null||e.afterUpdateChunks()}async removeChunks(e){var t;(t=this._strategy)==null||t.removeChunks(e),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:e}){if(!this._strategy)return void this._attributeStore.setHighlight(e.map(({objectId:s,highlightFlags:r})=>({objectId:s,highlightFlags:r,displayId:-1})),e);const t=this._strategy.displayMap(e,({objectId:s})=>s,(s,{highlightFlags:r},i)=>({objectId:i,displayId:s,highlightFlags:r}));this._attributeStore.setHighlight(t,e)}async _doUpdateChunks(){if(!this._strategy)return;const e=this._strategy.updateChunks(),t=[],s=new Map;for await(const r of e){let i=s.get(r.id);i==null&&(i=new Zs({concurrency:16,process:a=>this._process(a)}),s.set(r.id,i));const n=i.push(r).catch(a=>Fe(a));t.push(n)}try{await Promise.all(t)}catch{}y("esri-2d-update-debug")&&console.log("SendUpdates"),await this._attributeStore.sendUpdates(),y("esri-2d-update-debug")&&console.log("SendUpdates.await")}async _updateStrategy(e,t,s,r){var i;switch((i=this._strategy)==null||i.destroy(),e.type){case"feature":this._strategy=new fr(this._source,this._attributeStore,r);break;case"binning":this._strategy=await Js.create(e,t,this._source,this._attributeStore,r);break;case"cluster":this._strategy=await je.create(this._connection,e,t,this._source,this._attributeStore,r)}for(const n of s)this._strategy.onSubscribe(n)}async _updateSortKey(e,t){var s;if(this._sortInfo=dt((s=this._sortInfo)==null?void 0:s.computed),t!=null){const r=t.byRenderer?null:await e.createComputedField(t);this._sortInfo={...t,computed:r}}}_invalidate(){this._strategy&&this._strategy.invalidate()}async _process(e){const t=e.subscription;if(y("esri-2d-update-debug")){const o=t.tile;console.debug(`Version[${this._version}] Tile[${o.key.id}, end=${e.end}] Processor._process`)}await this._fetchResources(e),Y(t.signal);const s=await this._write(e,t.tile.createArcadeEvaluationOptions(this._schema.mesh.timeZone)),r=t.tile.tileInfoView.tileInfo.isWrappable,{message:i,transferList:n}=s.serialize(r),a=e.createMessage(i,this._version,this._attributeStore.epoch);if(Y(t.signal),this._connection.container.onMessage(a,{signal:t.signal,transferList:n}),this._attributeStore.sendUpdates(),y("esri-2d-update-debug")){const o=t.tile;console.debug(`Version[${this._version}] Tile[${o.key.id}, end=${e.end}] Processor._process.await`)}}async _fetchResources(e){await this._fetchMatcherResources(e),await this._fetchWriterResources(e)}async _fetchMatcherResources(e){if(e.reader)return this._factory.enqueueMatcherRequests(this._proxy,e.reader)}async _fetchWriterResources(e){if(!e.reader)return;const t=e.reader.getCursor(),s=e.subscription.tile.createArcadeEvaluationOptions(this._schema.mesh.timeZone);for(;t.next();)this._factory.enqueueWriterRequests(this._proxy,t,s);await this._proxy.fetchEnqueuedResources()}async _write(e,t){var h;const s=e.subscription.tile,r=(h=e.reader)==null?void 0:h.getCursor(),i=(r==null?void 0:r.getSize())??0,n=s.tileInfoView.tileInfo.isWrappable,a=new Us(s.key,this._strategy.enablePixelBuffering,n,i);if(!r)return a;const o=s.createArcadeEvaluationOptions(this._schema.mesh.timeZone);for(;r.next();){const c=this._getSortKeyValue(r,t);a.entityStart(r.getDisplayId(),c),this._factory.write(a,this._proxy,r,o,s.level),a.entityEnd()}return a}_getSortKeyValue(e,t){if(!this._sortInfo)return 0;const{computed:s,order:r,byRenderer:i}=this._sortInfo,n=i?this._factory.getSortKey(e,t):s==null?void 0:s.read(e,t);return n==null||isNaN(n)?0:n*(r==="asc"?-1:1)}},mr=class Bt{static from(e){let t=0,s=0,r=0;return e.forEach(i=>{const n=i._readGeometry();n&&(s+=n.isPoint?1:n.lengths.reduce((a,o)=>a+o,0),r+=n.isPoint?1:n.lengths.length,t+=1)}),new Bt(t,s,r)}constructor(e,t,s){this.featureCount=e,this.vertexCount=t,this.ringCount=s}toJSON(){return{featureCount:this.featureCount,ringCount:this.featureCount,vertexCount:this.featureCount}}};const ce=4;function br(u,e){const{service:t}=u,s=t.orderByFields??e.objectIdField+" ASC",r=t.source,i={returnCentroid:!(r!==null&&typeof r=="object"&&"path"in r&&es(r.path))&&e.geometryType==="esriGeometryPolygon",returnGeometry:!0,timeReferenceUnknownClient:e.timeReferenceUnknownClient??void 0,outSpatialReference:V.fromJSON(u.mutable.dataFilter.outSpatialReference),orderByFields:[s],where:u.mutable.dataFilter.definitionExpression??"1=1",outFields:u.mutable.availableFields};if(u.type==="feature"){const{gdbVersion:n,historicMoment:a,timeExtent:o}=u.mutable.dataFilter;return{...i,gdbVersion:n,historicMoment:a?new Date(a):null,timeExtent:o?ts.fromJSON(o):null,outFields:u.mutable.availableFields}}return i}let Ir=class Vt{static fromSchema(e,t){return new Vt(br(e,t),e.mutable.dataFilter.customParameters,t.geometryType,e.service.queryMetadata.capabilities)}constructor(e,t,s,r){this._queryParams=e,this._customParameters=t,this._geometryType=s,this._capabilities=r}get pageSize(){if(this._capabilities==null)throw new Error("InternalError: Service does not support paged queries");const{query:e}=this._capabilities,t=e.supportsMaxRecordCountFactor?ce:null,s=(e.maxRecordCount??8e3)*(t??1);return Math.min(8e3,s)}updateFields(e){this._queryParams.outFields=e}createPatchFieldsQuery(e,t){const s=e.clone();if(this._queryParams.outFields[0]==="*"){if((s.outFields??[])[0]==="*")return null;s.outFields=this._queryParams.outFields}else{const r=new Set(this._queryParams.outFields),i=[];for(const n of r)t.hasField(n)||i.push(n);if(i.length===0)return null;s.outFields=i}return s.returnGeometry=!1,s.returnCentroid=!1,s.quantizationParameters=null,s.cacheHint=!0,{inner:s,customParameters:this._customParameters}}createQuery(e={}){if(!this._queryParams)throw new Error("InternalError: queryInfo should be defined");return{inner:new ct({...this._queryParams,...e}),customParameters:this._customParameters}}createTileQuery(e,t){if(this._capabilities==null)throw new Error("InternalError: Service does not support tile queries");const s=this.createQuery(t),r=s.inner;return r.quantizationParameters=t.quantizationParameters??e.getQuantizationParameters(),r.resultType="tile",r.geometry=e.extent,this._capabilities.query.supportsQuantization?this._geometryType==="esriGeometryPolyline"&&(r.maxAllowableOffset=e.resolution*y("feature-polyline-generalization-factor")):this._geometryType!=="esriGeometryPolyline"&&this._geometryType!=="esriGeometryPolygon"||(r.maxAllowableOffset=e.resolution,this._geometryType==="esriGeometryPolyline"&&(r.maxAllowableOffset*=y("feature-polyline-generalization-factor"))),r.defaultSpatialReferenceEnabled=this._capabilities.query.supportsDefaultSpatialReference,r.compactGeometryEnabled=this._capabilities.query.supportsCompactGeometry,this._capabilities.query.supportsMaxRecordCountFactor&&(r.maxRecordCountFactor=ce),s}createPagedTileQuery(e,t){const s=this.pageSize;return this.createTileQuery(e,{start:s*t,num:s,returnExceededLimitFeatures:!0})}createPagedQuery(e){const t=this.pageSize;return this.createQuery({start:t*e,num:t,returnExceededLimitFeatures:!0,maxRecordCountFactor:ce})}};const vr=2500;let te=class extends _t{constructor(e){super(),this._connection=e,this._enabledEventTypes=new Set,this._updateInfo={websocket:0,client:0},this._lastTime=performance.now(),this.addHandles([pe(()=>{var t;return((t=this._strategy)==null?void 0:t.connectionStatus)??"disconnected"},t=>{this._layerView.setProperty({propertyName:"pipelineConnectionStatus",value:t})},{initial:!0}),pe(()=>{var t;return((t=this._strategy)==null?void 0:t.errorString)||null},t=>this._layerView.setProperty({propertyName:"pipelineErrorString",value:t}),{initial:!0})])}destroy(){this._strategy=null,this.removeAllHandles()}get _layerView(){return this._connection.layerView}set strategy(e){this._strategy==null&&this._resetUpdateInfo(performance.now());const t="event-handles";this.removeHandles(t),e!=null&&this.addHandles([e.events.on("data-received",s=>this._onFeature(s)),e.events.on("message-received",s=>this._onWebSocketMessage(s)),e.events.on("features-updated",s=>this._onUpdate(s)),e.events.on("tick",()=>this._onTick())],t),this._strategy=e}updateCustomParameters(e){var t;e!=null&&((t=this._strategy)==null||t.updateCustomParameters(e))}sendMessageToSocket(e){var t;(t=this._strategy)==null||t.sendMessageToSocket(e)}sendMessageToClient(e){var t;(t=this._strategy)==null||t.sendMessageToClient(e)}enableEvent(e,t){t?this._enabledEventTypes.add(e):this._enabledEventTypes.delete(e)}disconnect(){var e;(e=this._strategy)==null||e.disconnect()}connect(){var e;(e=this._strategy)==null||e.connect()}clear(){var e;(e=this._strategy)==null||e.clear()}_onWebSocketMessage(e){this._enabledEventTypes.has("message-received")&&this._layerView.emitEvent({name:"message-received",event:e})}_onFeature(e){this._updateInfo.websocket++,this._enabledEventTypes.has("data-received")&&this._layerView.emitEvent({name:"data-received",event:{attributes:e.attributes,centroid:e.centroid,geometry:e.geometry}})}_onUpdate(e){this._updateInfo.client+=e}_onTick(){const e=performance.now(),t=e-this._lastTime;if(t>vr){const s=Math.round(this._updateInfo.client/(t/1e3)),r=Math.round(this._updateInfo.websocket/(t/1e3));this._resetUpdateInfo(e),this._layerView.emitEvent({name:"update-rate",event:{client:s,websocket:r}})}}_resetUpdateInfo(e){this._lastTime=e,this._updateInfo.client=0,this._updateInfo.websocket=0}};G([K()],te.prototype,"_strategy",void 0),te=G([lt("esri.views.2d.layers.features.sources.StreamMessenger")],te);let Yt=class{constructor(e){this._store=e,this._controller=new AbortController}destroy(){this._controller.abort()}get _options(){return{signal:this._controller.signal}}async queryOverride(e){throw new Error("InternalError: LoadStrategy does not support fetching")}};const le=268435455;let Sr=class{constructor(){this.hasFeatures=!1,this.exceededTransferLimit=!1,this.fieldCount=0,this.featureCount=0,this.objectIdFieldIndex=0,this.vertexCount=0,this.offsets={attributes:new Array,geometry:new Array},this.centroid=new Array}};function wr(u,e,t=!1){var $;const h=u.asUnsafe(),c=h.pos(),d=new Sr;let l=0,g=0;const _=1,m=2,p=4,I=3;let f=null,k=null,b=null,v=!1;const S=[];for(;h.next();)switch(h.tag()){case 1:f=h.getString();break;case 3:k=h.getString();break;case 12:b=h.processMessage(js);break;case 9:if(d.exceededTransferLimit=h.getBool(),d.exceededTransferLimit){d.offsets.geometry=t?new Float64Array(8e3):new Int32Array(8e3),d.centroid=t?new Float64Array(16e3):new Int32Array(16e3);for(let F=0;F0}let Mr=class Se extends Ce{static fromBuffer(e,t,s=!1){const r=t.geometryType,i=kr(e),n=wr(i,r==="esriGeometryPoint",s);return new Se(i,n,t)}constructor(e,t,s){super(s),this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0,centroid:void 0,legacyFeature:void 0,optFeature:void 0},this._parseCaches=new Array,this._geometryType=s.geometryType,this._reader=e,this._header=t,this._hasNext=t.hasFeatures,this._isPoints=s.geometryType==="esriGeometryPoint"}get _size(){return this._header.featureCount}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get hasZ(){return!1}get hasM(){return!1}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getInTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._cache.centroid=void 0,this._cache.legacyFeature=void 0,this._cache.optFeature=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){return this._readAttributeAtIndex(this._header.objectIdFieldIndex)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const e=this._reader.clone(),t=new Se(e,this._header,this.metadata);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._cache.centroid=void 0,this._cache.legacyFeature=void 0,this._cache.optFeature=void 0;++this._featureIndexd.length)for(let p=0;p=p?(l+=-.5*(O-b)*(R+v),f>1&&_e(d[c-2],d[c-1],S,w)?(d[c-2]+=S,d[c-1]+=w):(d[c++]=S,d[c++]=w,f++),b=O,v=R):($+=S,F+=w),S=$,w=F,I++}f<3||k?c-=2*f:(l+=-.5*(b+S-b)*(v+w+v),_e(d[c-2],d[c-1],S,w)?(d[c-2]+=S,d[c-1]+=w,o.push(f)):(d[c++]=S,d[c++]=w,o.push(++f)))}else{let p=0,I=r.getSInt32(),f=r.getSInt32();this.hasZ&&r.getSInt32(),this.hasM&&r.getSInt32(),d[c++]=I,d[c++]=f,p+=1;for(let k=1;k2&&_e(d[c-2],d[c-1],b,v)?(d[c-2]+=b,d[c-1]+=v):(d[c++]=b,d[c++]=v,p+=1),I=S,f=w}o.push(p)}break}default:r.skip()}return this._cache.area=l,o.length?new T(o,d):null}};class oe{constructor(e,t){this.service=e,this._metadata=t}destroy(){}}function $r(u,e){switch(u.type){case"memory":return new qr(u,e);case"ogc":return new Er(u,e);case"feature-service":return u.queryMetadata.capabilities.query.supportsFormatPBF&&y("featurelayer-pbf")?new Ar(u,e):new Rr(u,e)}}async function Or(u){const e=new is;return await e.open(u,{}),e}class qr extends oe{constructor(e,t){super(e,t),this._portsOpen=Or(e.source).then(s=>this.client=s)}destroy(){this.client.close(),this.client=null}async executeQuery(e,t){await this._portsOpen;const s=await this.client.invoke("queryFeatures",e.toJSON(),t);return M.fromFeatureSet(s,this._metadata)}}class Ar extends oe{async executeQuery(e,t){const{data:s}=await As(this.service.source,e,t),r=!e.quantizationParameters;return Mr.fromBuffer(s,this._metadata,r)}}class Rr extends oe{async executeQuery(e,t){var a;const{source:s,queryMetadata:r}=this.service,i=r.capabilities;if(e.quantizationParameters!=null&&!i.query.supportsQuantization){const o=e.clone(),h=wt(o.quantizationParameters);o.quantizationParameters=null;const{data:c}=await Ne(s,o,this._metadata.spatialReference,t),d=mt(c,this._metadata.objectIdField);return It(h,d),M.fromOptimizedFeatureSet(d,this._metadata)}const{data:n}=await Ne(s,e,this._metadata.spatialReference,t);return this._metadata.geometryType==="esriGeometryPoint"&&(n.features=(a=n.features)==null?void 0:a.filter(o=>{if(o.geometry!=null){const h=o.geometry;return Number.isFinite(h.x)&&Number.isFinite(h.y)}return!0})),M.fromFeatureSet(n,this._metadata)}}let Er=class extends oe{async executeQuery(e,t){const{capabilities:s}=this.service.queryMetadata;if(e.quantizationParameters&&!s.query.supportsQuantization){const i=e.clone(),n=wt(i.quantizationParameters);i.quantizationParameters=null;const a=await Be(this.service.source,e,t);return It(n,a),M.fromOptimizedFeatureSet(a,this._metadata)}const r=await Be(this.service.source,e,t);return M.fromOptimizedFeatureSet(r,this._metadata)}},Xt=class extends Yt{constructor(e,t,s,r,i){super(s),this._serviceInfo=e,this._queryInfo=t,this._metadata=r,this._eventLog=i,this._queue=new ht({concurrency:16,process:async n=>{var o;const a={signal:(o=n.options)==null?void 0:o.signal,query:n.query.customParameters};return this._adapter.executeQuery(n.query.inner,a)}}),this._adapter=$r(e,r)}async updateFields(e){this._queryInfo.updateFields(e);const t=Array.from(this._store.chunks()).map(async r=>{const i=ct.fromJSON(r.queryInfo.queryJSON);if(i)try{return await this._tryUpdateFields(r.reader,i),null}catch(n){return n}}),s=(await Promise.all(t)).filter(r=>r);if(s.length)throw new D("featurelayer-query","Encountered errors when downloading fields",{errors:s})}async queryOverride({edits:e}){const t=[],s=[];for(const n of e.removed)n.objectId!=null&&n.objectId!==-1?t.push(n.objectId):s.push(n.globalId);s.length&&t.push(...this._mapGlobalIdsToObjectIds(s));const r=e.addOrModified.map(({objectId:n})=>n);let i;if(r.length){const n=this._queryInfo.createQuery({objectIds:r});i=await this._fetch(n)}else i=M.empty(this._metadata);return{reader:i,removed:t}}_mapGlobalIdsToObjectIds(e){const t=new Set(e),s=this._metadata.globalIdField;if(s==null)throw new Error("InternalError: Recieved an edit with globalIds, but not supported by the service");const r=[];return this._store.forEachUnsafe(i=>{const n=i.readAttribute(s);t.has(n)&&r.push(i.getObjectId())}),r}async _fetch(e,t){const s=await this._enqueue(e,t);return await this._tryUpdateFields(s,e.inner),s}async _tryUpdateFields(e,t){const s=this._queryInfo.createPatchFieldsQuery(t,e);if(!s)return;const r=await this._enqueue(s,this._options);e.joinAttributes(r)}async _enqueue(e,t){return this._eventLog.onEvent({type:"fetchStart"}),this._queue.push({query:e,options:t}).finally(()=>{this._eventLog.onEvent({type:"fetchEnd",done:this._queue.length===0})})}},Qt=class extends Xt{constructor(){super(...arguments),this._chunksById=new Map}unload(e){this._removeChunks(e.tile)}_addChunk(e){const t=e.tile.id;this._chunksById.has(t)||this._chunksById.set(t,[]);const s=e.size();(s||e.first||e.end)&&(y("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] ATileLoadStrategy.addChunk [count=${s}]`),this._chunksById.get(t).push(e),this._store.insert(e))}_removeChunks(e){const t=this._chunksById.get(e.key.id)??[];for(const s of t)y("esri-2d-update-debug")&&console.debug(`Tile[${e.key.id}] Chunk[${s.chunkId}] ATileLoadStrategy.removeChunk`),this._store.remove(s);this._chunksById.delete(e.key.id)}},rt=class extends Z{constructor(e,t,s,r,i,n){var a,o;super(),this._reader=e,this._queryJSON=t,this._tile=s,this._sourceTile=r,this._sourceTileDepth=i,this._end=n,this.chunkId=`${this._tile.key.id}.${(a=this._sourceTile)==null?void 0:a.key.id}${this._end?"e":""}`,this.normalizedChunkId=`${this._tile.key.normalizedId}.${(o=this._sourceTile)==null?void 0:o.key.normalizedId}${this._end?"e":""}`}get queryInfo(){var e;return{type:"drill-down-tile",chunkId:this.chunkId,tileId:this._tile.key.id,queryJSON:this._queryJSON,sourceTileDepth:this._sourceTileDepth,sourceTileId:(e=this._sourceTile)==null?void 0:e.key.id,size:this.size(),end:this.end}}get first(){return this._sourceTileDepth===0}get reader(){return this._reader}get end(){return this._end}get tile(){return this._tile}get isTiled(){return!0}getTileReader(e){return this._tile.key.id===e.key.id?this.reader:null}},Pr=class{constructor(e,t){this.subscription=e,this._tileIdToResult=new Map,this._controller=new AbortController,se(e.options,()=>this._controller.abort()),se(t,()=>this._controller.abort())}get(e){return this._tileIdToResult.get(e)}set(e,t){this._tileIdToResult.set(e,t)}get options(){return{signal:this._controller.signal}}},jr=class extends Qt{constructor(){super(...arguments),this._loadStates=new Map}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(e){this._loadStates.has(e.key.id)||this._loadStates.set(e.key.id,new Pr(e,this._options));const t=this._loadStates.get(e.key.id);let s;try{for await(const i of this._fetchChunkInfos(t,e.tile,0)){const{queryJSON:n,reader:a,sourceTile:o,sourceTileDepth:h,tile:c}=i,d=new rt(a,n,c,o,h,!1);Y(e.options),this._addChunk(d)}}catch(i){s=i}const r=new rt(M.empty(this._metadata),null,e.tile,null,-1,!0);if(this._addChunk(r),s)throw s}unload(e){super.unload(e),this._loadStates.delete(e.key.id)}async*_fetchChunkInfos(e,t,s){let r=e.get(t.id);const i=!!r;if(r||(r=await this._fetchChunkInfo(e,t,s),e.set(t.id,r)),r.reader.exceededTransferLimit&&sthis._controller.abort()),se(t,()=>this._controller.abort())}resetAbortController(){this._controller=new AbortController}get pageStart(){let e=-1;for(const t of this._pages.values())e=Math.max(e,t);return e+1}get done(){return this._done}get options(){return{signal:this._controller.signal}}add(e,t){this._pages.add(e),this._done=this._done||t}},Lr=class extends Qt{constructor(){super(...arguments),this._loadStates=new Map}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(e){this._loadStates.has(e.key.id)||this._loadStates.set(e.key.id,new Dr(e,this._options));const t=this._loadStates.get(e.key.id);let s;t.resetAbortController();try{await this._fetchPages(t)}catch(i){s=i}const r=new it(M.empty(this._metadata),null,e.tile,-1,!0);if(ns(t.options)||this._addChunk(r),s)throw s}unload(e){super.unload(e),this._loadStates.delete(e.key.id)}async _fetchPages(e){let r=0,i=e.pageStart,n=1;for(;r<20&&!e.done;){const a=[];for(let h=0;ho).sort((a,o)=>this._random.getInt()-this._random.getInt()),r=await Promise.all(s.map(a=>this._downloadPage(a))),i=new nt(M.empty(this._metadata),null,-1,!0);this._store.insert(i);const n=r.filter(a=>a);if(n.length)throw new D("featurelayer-query","Encountered errors when downloading data",{errors:n})}async _downloadPage(e){try{const t=this._queryInfo.createPagedQuery(e),s=await this._fetch(t,this._options),r=new nt(s,t.inner.toJSON(),e,!1);return Y(this._options),this._store.insert(r),null}catch(t){return t}}}const Ur="__esri_stream_id__",at="__esri_timestamp__",ot=1e3;class Gr{constructor(e,t,s,r,i=128){this._trackIdToObservations=new Map,this._idCounter=0,this._lastPurge=performance.now(),this._addOrUpdated=new Map,this._removed=[],this._maxAge=0,this._timeInfo=s,this._purgeOptions=r,this.store=e,this.objectIdField=t,this.purgeInterval=i,this._useGeneratedIds=this.objectIdField===Ur}removeById(e){this._removed.push(e)}removeByTrackId(e){const t=this._trackIdToObservations.get(e);if(t)for(const s of t.entries)this._removed.push(s)}add(e){var n;if(this._useGeneratedIds){const a=this._nextId();e.attributes[this.objectIdField]=a,e.objectId=a}else e.objectId=e.attributes[this.objectIdField];const t=e.objectId;if(this._addOrUpdated.set(t,e),this._maxAge=Math.max(this._maxAge,e.attributes[this._timeInfo.startTimeField]),!this._timeInfo.trackIdField)return this._trackIdLessObservations==null&&(this._trackIdLessObservations=new Ve(1e5)),void this._trackIdLessObservations.enqueue(t);const s=e.attributes[this._timeInfo.trackIdField];if(!this._trackIdToObservations.has(s)){const a=((n=this._purgeOptions)==null?void 0:n.maxObservations)!=null?this._purgeOptions.maxObservations:ot,o=as(a,0,ot);this._trackIdToObservations.set(s,new Ve(o))}const r=this._trackIdToObservations.get(s),i=r==null?void 0:r.enqueue(t);i!=null&&(this._addOrUpdated.has(i)?this._addOrUpdated.delete(i):this._removed.push(i))}checkForUpdates(){const e=this._getToAdd(),t=this._getToRemove(),s=performance.now();s-this._lastPurge>=this.purgeInterval&&(this._purge(s),this._lastPurge=s);const r=[];if(t!=null)for(const n of t){const a=this.store.removeById(n);a!=null&&r.push(a)}const i=[];if(e!=null){const n=new Set(t??[]);for(const a of e)n.has(a.objectId)||(a.attributes[at]=s,this.store.add(a),i.push(a))}return!(!i.length&&!(r!=null&&r.length))&&(this.store.update(i,r),!0)}_getToAdd(){if(!this._addOrUpdated.size)return null;const e=new Array(this._addOrUpdated.size);let t=0;return this._addOrUpdated.forEach(s=>e[t++]=s),this._addOrUpdated.clear(),e}_getToRemove(){const e=this._removed;return this._removed.length?(this._removed=[],e):null}_nextId(){const e=this._idCounter;return this._idCounter=(this._idCounter+1)%4294967294+1,e}_purge(e){const t=this._purgeOptions;t!=null&&(this._purgeSomeByDisplayCount(t),this._purgeByAge(t),this._purgeByAgeReceived(e,t),this._purgeTracks())}_purgeSomeByDisplayCount(e){if(!e.displayCount)return;let t=this.store.size;if(t>e.displayCount){if(this._timeInfo.trackIdField){for(const s of this._trackIdToObservations.values())if(t>e.displayCount&&s.size){const r=s.dequeue();this._removed.push(r),t--}}if(this._trackIdLessObservations!=null){let s=t-e.displayCount;for(;s-- >0;){const r=this._trackIdLessObservations.dequeue();r!=null&&this._removed.push(r)}}}}_purgeByAge(e){var i;const t=(i=this._timeInfo)==null?void 0:i.startTimeField;if(!e.age||!t)return;const s=60*e.age*1e3,r=this._maxAge-s;this.store.forEach(n=>{n.attributes[t]{r.attributes[at]{e.size===0&&this._trackIdToObservations.delete(t)})}}let U=class extends _t{constructor(u){super(u)}get connectionStatus(){var u;return(u=this.connection)==null?void 0:u.connectionStatus}get errorString(){var u;return(u=this.connection)==null?void 0:u.errorString}};G([K()],U.prototype,"connection",void 0),G([K()],U.prototype,"connectionStatus",null),G([K()],U.prototype,"errorString",null),U=G([lt("esri.views.2d.layers.features.sources.StreamConnectionState")],U);class Wr{constructor(e,t){this._metadata=e,this._onUpdate=t,this._objectIdToFeature=new Map}get size(){return this._objectIdToFeature.size}get reader(){return M.fromFeatures([...this._objectIdToFeature.values()],this._metadata)}add(e){this._objectIdToFeature.set(e.objectId,e)}forEach(e){this._objectIdToFeature.forEach(e)}removeById(e){const t=this._objectIdToFeature.get(e);return t?(this._objectIdToFeature.delete(e),t):null}clear(){this._objectIdToFeature=new Map}update(e,t){this._onUpdate((e==null?void 0:e.length)??0)}}let Nr=class extends Z{constructor(e){super(),this._reader=e,this.chunkId="stream-chunk",this.normalizedChunkId="stream-chunk"}get reader(){return this._reader}get first(){return!0}get end(){return!0}get queryInfo(){return{type:"stream",chunkId:this.chunkId,size:this.size(),end:this.end}}get isTiled(){return!1}getTileReader(e){const t=this.queryFeaturesInBounds(e.bounds);return t.setTransformForDisplay(e.transform),t}};class Br extends Yt{constructor(e,t,s,r,i){super(s),this._service=e,this._dataFilter=t,this._streamOptions=r,this._metadata=i,this._connectionState=new U,this._forceRefresh=!1,this.events=new xe;const{objectIdField:n,timeInfo:a}=this._metadata,{purgeOptions:o}=t;this._stagingStore=new Wr(this._metadata,h=>this.events.emit("features-updated",h)),this._manager=new Gr(this._stagingStore,n,a,o),this.connect()}destroy(){super.destroy(),this.disconnect()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}get connectionStatus(){return this._connectionState.connectionStatus}get errorString(){var e;return(e=this._connectionState)==null?void 0:e.errorString}async refresh(){const e=this._chunk!=null;this._manager.checkForUpdates()||!e||this._forceRefresh?(this._chunk&&this._store.remove(this._chunk),this._forceRefresh=!1,this._chunk=new Nr(this._stagingStore.reader),this._store.insert(this._chunk),this.events.emit("tick")):this.events.emit("tick")}async updateFields(e){throw new Error("Updating available fields not supported for StreamLayer")}async load(e){}unload(e){}disconnect(){var e;this._connection=dt(this._connection),this._connectionState.connection=null,(e=this._handlesGroup)==null||e.remove()}connect(){if(this._connection!=null)return;const{geometryType:e,spatialReference:t}=this._metadata,{maxReconnectionAttempts:s,maxReconnectionInterval:r,geometryDefinition:i,definitionExpression:n,customParameters:a}=this._dataFilter;this._connection=Ds(this._service.source,t,this._streamOptions.outSR,e,n,i,s,r,a),this._handlesGroup=gt([this._connection.on("data-received",o=>this._onFeature(o)),this._connection.on("message-received",o=>this._onWebSocketMessage(o))]),this._connectionState.connection=this._connection}clear(){this._manager.checkForUpdates(),this._stagingStore.clear(),this._forceRefresh=!0}updateCustomParameters(e){var t;(t=this._connection)==null||t.updateCustomParameters(e)}sendMessageToSocket(e){var t;(t=this._connection)==null||t.sendMessageToSocket(e)}sendMessageToClient(e){var t;(t=this._connection)==null||t.sendMessageToClient(e)}_onWebSocketMessage(e){if("type"in e)switch(e.type){case"delete":if(e.objectIds)for(const t of e.objectIds)this._manager.removeById(t);if(e.trackIds)for(const t of e.trackIds)this._manager.removeByTrackId(t);break;case"clear":this.clear()}this.events.emit("message-received",e)}_onFeature(e){try{this._manager.add(e),this.events.emit("data-received",e)}catch{}}}class Vr{constructor(e){this._onChange=e,this._chunks=new Map,this._chunksToRemove=[],this.events=new xe,this.featureAdapter=new ys}destroy(){this.clear()}clear(){for(const e of this._chunks.values())this._chunksToRemove.push(e);this._chunks.clear(),this._overrideChunk!=null&&this._chunksToRemove.push(this._overrideChunk),this._overrideChunk=null}*chunks(){this._overrideChunk&&(yield this._overrideChunk),yield*this._chunks.values()}insert(e){var t;y("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.insert`),(t=this._overrideChunk)!=null&&t.overridenIds.size&&e.reader.removeIds(this._overrideChunk.overridenIds),this._chunks.set(e.chunkId,e),this.events.emit("changed"),this._onChange()}remove(e){y("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.remove`),this._chunks.delete(e.chunkId),this._chunksToRemove.push(e)}cleanupRemovedChunks(){const e=this._chunksToRemove;return this._chunksToRemove=[],e}applyOverrides(e,t){this._overrideChunk==null&&(this._overrideChunk=new Nt(t)),this._overrideChunk.applyOverrides(e);for(const s of this._chunks.values())s.reader.removeIds(this._overrideChunk.overridenIds),s.invalidate()}forEach(e){const t=new Set;for(const s of this.chunks()){const r=s.reader.getCursor();for(;r.next();){const i=r.getObjectId();t.has(i)||(e(r.copy()),t.add(i))}}}forEachUnsafe(e){const t=new Set;for(const s of this.chunks()){const r=s.reader.getCursor();for(;r.next();){const i=r.getObjectId();t.has(i)||(e(r),t.add(i))}}}forEachInBounds(e,t){const s=new Set;for(const r of this.chunks()){const i=r.queryFeaturesInBounds(e);for(;i.next();){const n=i.getObjectId();s.has(n)||(t(i.copy()),s.add(n))}}}forEachBounds(e,t){const s=ke();for(const r of e)r.getBounds(s)&&t(s)}}class Yr{constructor(e,t,s,r){this._aggregateAdapter=e,this._subscriptions=t,this._onChange=s,this._connection=r,this._updateTracking=new Ls({debugName:"FeatureSource"}),this._didInvalidateData=!1,this._store=new Vr(this._onChange)}destroy(){var e,t;(e=this._strategy)==null||e.destroy(),this._store.destroy(),(t=this._streamMessenger)==null||t.destroy()}get _eventLog(){return this._connection.eventLog}get metadata(){if(!this._metadata)throw new Error("InternalError: Metadata not defined. Was update called?");return this._metadata}get service(){return this._schema.service}get store(){return this._store}get streamMessenger(){return this._streamMessenger==null&&this._initStreamMessenger(),this._streamMessenger}get statistics(){return mr.from(this._store)}get updateTracking(){return this._updateTracking}get queryEngine(){if(!this._queryEngine){if(!this._schema)return null;const{dataFilter:e}=this._schema.mutable,t=this._schema.mutable.availableFields,s=this._metadata;this._queryEngine=new vt({featureStore:this._store,fieldsIndex:s.fieldsIndex,geometryType:s.geometryType,objectIdField:s.objectIdField,hasM:!1,hasZ:!1,spatialReference:e.outSpatialReference,cacheSpatialQueries:!0,aggregateAdapter:this._aggregateAdapter,timeInfo:s.timeInfo,definitionExpression:e.definitionExpression,availableFields:t})}return this._queryEngine}get isStream(){return this._schema.type==="stream"}chunks(){return Array.from(this._store.chunks())}cleanupRemovedChunks(){return this._store.cleanupRemovedChunks()}onSubscribe(e){var s;this._eventLog.onEvent({type:"subscribe",tile:e.tile.id});const t=(s=this._strategy)==null?void 0:s.load(e);t&&(t.then(()=>this._eventLog.onEvent({type:"loaded",tile:e.tile.id})).catch(r=>this._eventLog.onEvent({type:"error",tile:e.tile.id,error:r})),this._updateTracking.addPromise(t))}onResume(e){var t;this._updateTracking.addPromise(ut((t=this._strategy)==null?void 0:t.load(e)))}onUnsubscribe(e){var t;this._eventLog.onEvent({type:"unsubscribe",tile:e.tile.id}),(t=this._strategy)==null||t.unload(e)}getOverride(e){return this._updateTracking.addPromise(this._doGetOverride(e))}applyOverride(e){this._didInvalidateData=!0,this._store.applyOverrides(e,this.metadata)}async update(e,t){var i,n,a;const s=e.source,r=ft((i=this._schema)==null?void 0:i.mutable,s.mutable);if(!r)return!1;if(y("esri-2d-update-debug")&&console.debug(`Version[${t}] FeatureSource.update`,{changes:r}),this._schema=s,this._metadata=new $e(this._schema.service.metadata),(n=this._queryEngine)==null||n.destroy(),this._queryEngine=null,this._schema.type==="feature"&&this._schema.service.queryMetadata.lastEditDate!=null&&(this._lastEditDate=this._schema.service.queryMetadata.lastEditDate),this._streamMessenger==null&&this._schema.type==="stream"&&this._initStreamMessenger(),ze(r,"sourceRefreshVersion")&&((a=this._strategy)==null?void 0:a.refresh))return await this._strategy.refresh(),!0;if(s.type==="feature"&&ze(r,"availableFields")){if(await this._queryLastEditDateChanged()||this._didInvalidateData)this._didInvalidateData=!1,await this._updateStrategy(t);else{this._eventLog.onEvent({type:"updateFieldsStart"});try{await this._strategy.updateFields(s.mutable.availableFields),this._eventLog.onEvent({type:"updateFieldsEnd"})}catch(o){this._eventLog.onEvent({type:"updateFieldsError",error:o})}}return!1}return!(!Ue(r,"dataFilter")&&!Ue(r,"sourceRefreshVersion"))&&(await this._updateStrategy(t),!0)}_initStreamMessenger(){this._streamMessenger==null&&(this._streamMessenger=new te(this._connection))}async _doGetOverride(e){return this._strategy.queryOverride(e)}async _queryLastEditDateChanged(){if(this._lastEditDate==null)return!1;const e=this._schema.service.source,t={...e.query,f:"json"},s=(await os(e.path,{query:t,responseType:"json"})).data.editingInfo.lastEditDate;return s!==this._lastEditDate&&(this._lastEditDate=s,!0)}async _createStrategy(){const e=this.service,t="isSourceHosted"in e&&e.isSourceHosted,s=Array.isArray(e.source),r=e.source&&"collection"in e.source,i=t||s||r;if(this._schema.type==="stream"){const o=new Br(this._schema.service,this._schema.mutable.dataFilter,this._store,{outSR:this._schema.mutable.dataFilter.outSpatialReference},this.metadata);return this._streamMessenger.strategy=o,o}const n=Ir.fromSchema(this._schema,this._metadata),a=await this._supportSnapshotMode(this._schema,n);return a?new zr(this._schema.service,n,this._store,a.featureCount,this.metadata,this._eventLog):i?new Lr(this._schema.service,n,this._store,this.metadata,this._eventLog):new jr(this._schema.service,n,this._store,this.metadata,this._eventLog)}async _updateStrategy(e){var n;const t=await this._createStrategy();this._eventLog.onEvent({type:"updateStrategyStart",about:t.about});const s=!!this._strategy;this._store.clear(),(n=this._strategy)==null||n.destroy(),this._strategy=t,y("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategy`,{strategy:t});const r=Array.from(this._subscriptions.values());if(!r.length)return void this._eventLog.onEvent({type:"updateStrategyEnd"});const i=Promise.all(r.map(a=>this._strategy.load(a).then(()=>this._eventLog.onEvent({type:"loaded",tile:a.tile.id})).catch(o=>this._eventLog.onEvent({type:"error",tile:a.tile.id,error:o}))));this._updateTracking.addPromise(i);try{s&&await i}catch(a){Fe(a)}this._eventLog.onEvent({type:"updateStrategyEnd"}),y("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategyEnd`,{strategy:t})}async _supportSnapshotMode(e,t){const{queryMetadata:s}=e.service,r=s.snapshotInfo;if(!r||!r.supportsSnapshotMinThreshold||!r.snapshotCountThresholds)return null;const i=e.service.source,n=t.createQuery();n.inner.orderByFields=[],n.inner.returnGeometry=!1;const a=(await Rs(i,n.inner,{query:n.customParameters})).data.count,{min:o,max:h}=r.snapshotCountThresholds;return a<=o||r.supportsSnapshotMaxThreshold&&athis._processor.getFeatureObjectIdsForAggregate(e)},this._subscriptions=new Map,this._updateRequested=!1,this._updateSubscriptionRequests=[],this._updateHighlightRequests=[]}destroy(){this._subscriptions.clear(),this._processor.destroy(),this._source.destroy(),this._handles.remove(),this._editState=null,this._tileInfoView=null}onDetach(){this.destroy(),this._initialize(this._connection)}_initialize(e){this._source=new Yr(this._aggregateAdapter,this._subscriptions,()=>this._requestUpdate(),e),this._processor=new yr(e,this._source),this._handles=gt([pe(()=>this._source.updateTracking.updating,()=>{this._requestUpdate(),this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0})})])}set remoteClient(e){this._connection=new zs(e),this._initialize(this._connection)}get features(){const e=this._source.queryEngine;if(!e)throw new D("no-queryEngine","No query engine defined");return e}get aggregates(){const e=this._processor.aggregateQueryEngine;if(!e)throw new D("no-queryEngine","No aggregate query engine defined");return e}get processor(){return this._processor}get streamMessenger(){return this._source.streamMessenger}getDisplayFeatures(e){return this._processor.getDisplayFeatures(e)}async updateSchema(e,t){return y("esri-2d-update-debug")&&this._updateSchemaState&&console.error("InternalError: Schema already updating"),this._updateSchemaState=new Zr(e,t),this._requestUpdate(),this._updateSchemaState.resolver.promise}updateSubscriptions(e){this._updateSubscriptionRequests.push(e),this._requestUpdate()}updateHighlight(e){this._updateHighlightRequests.push(e),this._requestUpdate()}async onEdits(e){if(this._editState!=null)throw new D("InternalError - Already processing an edit");this._editState=new Qr(e);const t=this._editState.resolver.promise;return this._requestUpdate(),t}queryStatistics(){return this._source.statistics.toJSON()}async queryVisibleFeatures(e,t){return this.features.executeQuery(e,t)}async queryHeatmapStatistics(e){const t=Math.round(us(e.radius));let s=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;const i=typeof e.fieldOffset=="string",n=e.fieldOffset??0,a=Array.from(this._subscriptions.values()),o=this._source.chunks(),h=t**2,c=3/(Math.PI*h),d=2*t,l=Math.ceil(x/d);for(const g of a){const _=g.tile,m=new Float64Array(l*l);for(const p of o){const I=p.getTileReader(_);if(!I)continue;const f=I.getCursor();for(;f.next();){let k=1;if(e.field!=null){const O=f.readAttribute(e.field);k=i?-1*+O:+O+n}const b=f.readXForDisplay()/d,v=f.readYForDisplay()/d,S=Math.floor(b),w=Math.floor(v);if(S<0||w<0||S>=l||w>=l)continue;const $=((.5+S-b)*d)**2+((.5+w-v)*d)**2;if($>h)continue;const F=k*(c*(1-$/h)**2);m[w+S*l]+=F}}for(let p=0;po+h.size(),0)<=e.minFeatureCount){if(!this._source.updateTracking.updating){const o=[];return this._source.store.forEachUnsafe(h=>o.push(h.readLegacyFeatureWorldSpace())),o}return null}const s=new Set,r=[],i=t.map(o=>o.reader.getCursor()),n=new pt,a=3*e.sampleSize;for(let o=0;o=e.sampleSize?r:null}_requestUpdate(){this._updateRequested||(this._updateRequested=!0,ds(()=>this._scheduleNextUpdate()))}_scheduleNextUpdate(){this._updateRequested&&(this._ongoingUpdate||(this._ongoingUpdate=this._doUpdate().finally(()=>{this._ongoingUpdate=null,this._scheduleNextUpdate()}),this._updateRequested=!1))}_subscribe(e){const t=e.tileId;if(this._subscriptions.has(t)){const i=this._subscriptions.get(t);return void(i.paused&&(y("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.resume`),i.resume(),i.version=e.version,this._source.onResume(i)))}y("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.subscribe`);const s=new cs(this._tileInfoView,t),r=new Xr(s,e.version);this._subscriptions.set(t,r),this._source.onSubscribe(r),this._processor.onSubscribe(r)}_unsubscribe(e){const t=this._subscriptions.get(e);t&&(y("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.unsubscribe`),this._source.onUnsubscribe(t),this._processor.onUnsubscribe(t),this._subscriptions.delete(t.key.id),t.destroy())}_pauseSubscription(e){const t=this._subscriptions.get(e);t&&(y("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.pause`),t.pause())}async _doUpdate(){if(y("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateStart"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0}),this._updateSubscriptionRequests.length){const r=this._updateSubscriptionRequests;this._updateSubscriptionRequests=[];for(const i of r)this._doUpdateSubscriptions(i)}const e=this._updateSchemaState;if(this._updateSchemaState=null,e!=null){const{schema:r,version:i}=e;await this._doUpdateSchema(r,i)}const t=this._editState;if(this._editState=null,t!=null){y("esri-2d-update-debug")&&console.debug("Pipeline.applyEditOverride",t.edit);const r=await this._source.getOverride(t.edit);await this._processor.applyOverride(r),y("esri-2d-update-debug")&&console.debug("Pipeline.endEditOverride",t.edit)}if(this._updateHighlightRequests.length){const r=this._updateHighlightRequests;this._updateHighlightRequests=[];for(const i of r)this._processor.updateHighlight(i)}const s=this._source.cleanupRemovedChunks();this._processor.removeChunks(s);try{this._subscriptions.size&&(y("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksStart"),await this._processor.updateChunks(),y("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksEnd"))}catch(r){Fe(r)}t!=null&&t.resolver.resolve(),e!=null&&e.resolver.resolve(),this._updateRequested?(y("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=true]"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0})):(y("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=false, After flush]"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:this._updateRequested}))}async _doUpdateSchema(e,t){var r;if(y("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateStart`,{schema:e}),!this._tileInfoView){const i=De.fromJSON(e.source.tileInfoJSON);this._tileInfoView=new Le(i)}const s={tileInfo:(r=this._tileInfoView)==null?void 0:r.tileInfo};try{const i=await this._source.update(e,t),n=Array.from(this._subscriptions.values());await this._processor.update(e,t,s,i,n)}catch(i){console.error(i)}y("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateEnd`)}_doUpdateSubscriptions(e){if(y("esri-2d-update-debug")&&console.debug("Pipeline.updateSubscriptions",e),!this._tileInfoView){const t=De.fromJSON(e.tileInfoJSON);this._tileInfoView=new Le(t)}for(const t of e.subscribe)this._subscribe(t);for(const t of e.unsubscribe)this._unsubscribe(t);if(y("featurelayer-query-pausing-enabled"))for(const t of e.pause)this._pauseSubscription(t)}}export{Cn as default}; diff --git a/assets/FeatureReductionLayer-DncGsNIN.js b/assets/FeatureReductionLayer-CK-tyM-9.js similarity index 97% rename from assets/FeatureReductionLayer-DncGsNIN.js rename to assets/FeatureReductionLayer-CK-tyM-9.js index 9369150..c1b4be1 100644 --- a/assets/FeatureReductionLayer-DncGsNIN.js +++ b/assets/FeatureReductionLayer-CK-tyM-9.js @@ -1 +1 @@ -import{b4 as te,d as n,y as a,f as w,aU as j,aV as d,c9 as k,fB as O,fD as U,i as q,aR as R,aZ as S,b1 as J,f0 as v,iu as ie,eV as re,E as H,dy as se,N as ne,s as oe,g as ae,ez as le}from"./index-CEWggaxV.js";import{j as ue,b as pe,a as I}from"./UniqueValueRenderer-BlkUix3g.js";import{a as P,o as _,m as z}from"./jsonUtils-BseLl1fZ.js";import{t as $,p as N}from"./FeatureReductionSelection-BY3KVXac.js";import{D as Z}from"./featureLayerUtils-BhDaw8pS.js";import{C as K}from"./LabelClass-6cZokw8y.js";import{x as Q}from"./MD5-C9MwAd2G.js";let b=class extends te(j){constructor(s){super(s),this.expression=null,this.title=null,this.returnType=null}};n([a({type:String,json:{write:!0}})],b.prototype,"expression",void 0),n([a({type:String,json:{write:!0}})],b.prototype,"title",void 0),n([a({type:String,json:{write:!0}})],b.prototype,"returnType",void 0),b=n([w("esri.layers.support.ExpressionInfo")],b);const C=b;var F;let c=F=class extends j{constructor(i){super(i),this.isAutoGenerated=!1,this.name=null,this.alias=null,this.onStatisticField=null,this.onStatisticExpression=null,this.statisticType=null}clone(){return new F({name:this.name,alias:this.alias,isAutoGenerated:this.isAutoGenerated,onStatisticExpression:d(this.onStatisticExpression),onStatisticField:this.onStatisticField,statisticType:this.statisticType})}};n([a({type:Boolean,json:{write:!0}})],c.prototype,"isAutoGenerated",void 0),n([a({type:String,json:{write:!0}})],c.prototype,"name",void 0),n([a({type:String,json:{write:!0}})],c.prototype,"alias",void 0),n([a({type:String,json:{write:!0}})],c.prototype,"onStatisticField",void 0),n([a({type:C,json:{write:!0}})],c.prototype,"onStatisticExpression",void 0),n([a({type:String,json:{write:!0}})],c.prototype,"statisticType",void 0),c=F=n([w("esri.layers.support.AggregateField")],c);const y=c;var V;const de="esri.layers.support.FeatureReductionBinning";let p=V=class extends ${constructor(i){super(i),this.type="binning",this.binType="geohash",this.fixedBinLevel=3,this.labelingInfo=null,this.labelsVisible=!0,this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.fields=[],this.renderer=null}writeFields(i,s,e){const t=i.filter(r=>r.statisticType!=="avg_angle").map(r=>r.toJSON());J(e,t,s)}readRenderer(i,s,e){var r;const t=(r=s.drawingInfo)==null?void 0:r.renderer;return t?_(t,s,e)??void 0:Z(s,e)}clone(){return new V({fields:d(this.fields),fixedBinLevel:this.fixedBinLevel,labelingInfo:d(this.labelingInfo),labelsVisible:this.labelsVisible,maxScale:this.maxScale,popupEnabled:this.popupEnabled,popupTemplate:d(this.popupTemplate),renderer:d(this.renderer)})}};n([k({binning:"binning"})],p.prototype,"type",void 0),n([k({geohash:"geohash"})],p.prototype,"binType",void 0),n([a({type:Number,range:{min:1,max:9},json:{write:!0}})],p.prototype,"fixedBinLevel",void 0),n([a({type:[K],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],p.prototype,"labelingInfo",void 0),n([a(O)],p.prototype,"labelsVisible",void 0),n([a({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],p.prototype,"maxScale",void 0),n([a(U)],p.prototype,"popupEnabled",void 0),n([a({type:q,json:{name:"popupInfo",write:!0}})],p.prototype,"popupTemplate",void 0),n([a({type:[y],json:{write:!0}})],p.prototype,"fields",void 0),n([R("fields")],p.prototype,"writeFields",null),n([a({types:P,json:{write:{target:"drawingInfo.renderer"}}})],p.prototype,"renderer",void 0),n([S("renderer",["drawingInfo.renderer"])],p.prototype,"readRenderer",null),p=V=n([w(de)],p);const W=p;var T;const ce="esri.layers.support.FeatureReductionCluster";function L(i){var s;return i.type==="simple"&&!((s=i.visualVariables)!=null&&s.length)}let l=T=class extends j{constructor(i){super(i),this.type="cluster",this.clusterRadius=v("80px"),this.clusterMinSize=v("12px"),this.clusterMaxSize=v("50px"),this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.renderer=null,this.symbol=null,this.labelingInfo=null,this.labelsVisible=!0,this.fields=[]}readRenderer(i,s,e){var r,o;const t=(r=s.drawingInfo)==null?void 0:r.renderer;return(o=t==null?void 0:t.authoringInfo)!=null&&o.isAutoGenerated?null:t?L(t)?null:_(t,s,e)??void 0:Z(s,e)}readSymbol(i,s,e){var r,o;const t=(r=s.drawingInfo)==null?void 0:r.renderer;if((o=t==null?void 0:t.authoringInfo)!=null&&o.isAutoGenerated)return null;if(t&&L(t)){const u=_(t,s,e);return u==null?void 0:u.symbol}return null}writeSymbol(i,s,e,t){var o,u;const r=(u=(o=this.renderer)==null?void 0:o.authoringInfo)==null?void 0:u.isAutoGenerated;if(!this.renderer||r){const h=new z({symbol:i});s.drawingInfo={renderer:h.write({},t)}}}writeFields(i,s,e){const t=i.filter(r=>r.statisticType!=="avg_angle").map(r=>r.toJSON());J(e,t,s)}readFields(i,s,e){return i.filter(t=>!t.isAutoGenerated).map(t=>y.fromJSON(t))}clone(){return new T({clusterRadius:this.clusterRadius,clusterMinSize:this.clusterMinSize,clusterMaxSize:this.clusterMaxSize,labelingInfo:d(this.labelingInfo),labelsVisible:this.labelsVisible,fields:d(this.fields),maxScale:this.maxScale,renderer:d(this.renderer),symbol:d(this.symbol),popupEnabled:this.popupEnabled,popupTemplate:d(this.popupTemplate)})}};n([a({type:["cluster"],readOnly:!0,json:{write:!0}})],l.prototype,"type",void 0),n([a({type:Number,cast:i=>i==="auto"?i:v(i),json:{write:!0}})],l.prototype,"clusterRadius",void 0),n([a({type:Number,cast:v,json:{write:!0}})],l.prototype,"clusterMinSize",void 0),n([a({type:Number,cast:v,json:{write:!0}})],l.prototype,"clusterMaxSize",void 0),n([a({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],l.prototype,"maxScale",void 0),n([a(U)],l.prototype,"popupEnabled",void 0),n([a({type:q,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],l.prototype,"popupTemplate",void 0),n([a({types:P,json:{write:{target:"drawingInfo.renderer"}}})],l.prototype,"renderer",void 0),n([S("renderer",["drawingInfo.renderer"])],l.prototype,"readRenderer",null),n([a({types:ie})],l.prototype,"symbol",void 0),n([S("symbol",["drawingInfo.renderer"])],l.prototype,"readSymbol",null),n([R("symbol")],l.prototype,"writeSymbol",null),n([a({type:[K],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],l.prototype,"labelingInfo",void 0),n([a(O)],l.prototype,"labelsVisible",void 0),n([a({type:[y],json:{write:!0}})],l.prototype,"fields",void 0),n([R("fields")],l.prototype,"writeFields",null),n([S("fields")],l.prototype,"readFields",null),l=T=n([w(ce)],l);const X=l,B={key:"type",base:$,typeMap:{cluster:X,binning:W}},fe={types:{key:"type",base:$,typeMap:{selection:N,cluster:X,binning:W}},json:{name:"layerDefinition.featureReduction",write:{allowNull:!0},origins:{"web-map":{types:B},"portal-item":{types:B},"web-scene":{types:{key:"type",base:$,typeMap:{selection:N}},name:"layerDefinition.featureReduction",write:{layerContainerTypes:re}}}}},ye=()=>oe.getLogger("esri.views.2d.layers.support.clusterUtils");H.add("esri-cluster-arcade-enabled",!0);const me=H("esri-cluster-arcade-enabled"),be=new Set(["simple-line","simple-fill","picture-fill"]);function D(i,s){let e=s.clone();if(!ve(e))return e;if(s.getSymbols().some(t=>be.has(t.type))&&(e=new z({symbol:new se})),e.authoringInfo||(e.authoringInfo=new ue),e.authoringInfo.isAutoGenerated=!0,"visualVariables"in e){const t=(e.visualVariables||[]).filter(r=>r.valueExpression!=="$view.scale");t.forEach(r=>{r.type==="rotation"?r.field?r.field=f(i,r.field,"avg_angle","number"):r.valueExpression&&(r.field=g(i,r.valueExpression,"avg_angle","number"),r.valueExpression=null):r.normalizationField?(r.field=f(i,r.field,"avg_norm","number",r.normalizationField),r.normalizationField=null):r.field?r.field=f(i,r.field,"avg","number"):r.valueExpression&&(r.field=g(i,r.valueExpression,"avg","number"),r.valueExpression=null)}),e.visualVariables=t}switch(e.type){case"simple":break;case"pie-chart":for(const t of e.attributes)t.field?t.field=f(i,t.field,"sum","number"):t.valueExpression&&(t.field=g(i,t.valueExpression,"sum","number"),t.valueExpression=null);break;case"unique-value":e.field?e.field=f(i,e.field,"mode","string"):e.valueExpression&&(e.field=g(i,e.valueExpression,"mode","string"),e.valueExpression=null);break;case"class-breaks":e.normalizationField?(e.field=f(i,e.field,"avg_norm","number",e.normalizationField),e.normalizationField=null):e.field?e.field=f(i,e.field,"avg","number"):e.valueExpression&&(e.field=g(i,e.valueExpression,"avg","number"),e.valueExpression=null)}return e}const ve=i=>{const s=e=>ye().error(new ne("Unsupported-renderer",e,{renderer:i}));if(!i)return!1;switch(i.type){case"unique-value":if(i.field2||i.field3)return s("FeatureReductionCluster does not support multi-field UniqueValueRenderers"),!1;break;case"class-breaks":if(i.normalizationField){const e=i.normalizationType;if(e!=="field")return s(`FeatureReductionCluster does not support a normalizationType of ${e}`),!1}break;case"simple":case"pie-chart":break;default:return s(`FeatureReductionCluster does not support renderers of type ${i.type}`),!1}if(!me){if("valueExpression"in i&&i.valueExpression)return s("FeatureReductionCluster does not currently support renderer.valueExpression. Support will be added in a future release"),!1;if(("visualVariables"in i&&i.visualVariables||[]).some(e=>!(!("valueExpression"in e)||!e.valueExpression)))return s("FeatureReductionCluster does not currently support visualVariables with a valueExpression. Support will be added in a future release"),!1}return!0};function he(i,s,e){switch(i){case"sum":return`cluster_sum_${s}`;case"avg":case"avg_angle":return`cluster_avg_${s}`;case"mode":return`cluster_type_${s}`;case"avg_norm":{const t=e,r="field",o=s.toLowerCase()+",norm:"+r+","+t.toLowerCase();return"cluster_avg_"+Q(o)}}}function g(i,s,e,t){const r=Q(s),o=e==="mode"?`cluster_type_${r}`:e==="sum"?`cluster_sum_${r}`:`cluster_avg_${r}`;return i.some(u=>u.name===o)||i.push(new y({name:o,isAutoGenerated:!0,onStatisticExpression:new C({expression:s,returnType:t}),statisticType:e})),o}function f(i,s,e,t,r){if(s==="cluster_count"||i.some(u=>u.name===s))return s;const o=he(e,s,r);return i.some(u=>u.name===o)||(e==="avg_norm"?i.push(new y({name:o,isAutoGenerated:!0,onStatisticExpression:new C({expression:`$feature.${s} / $feature.${r}`,returnType:t}),statisticType:"avg"})):i.push(new y({name:o,isAutoGenerated:!0,onStatisticField:s,statisticType:e}))),o}const _e=i=>{let s=class extends i{constructor(...e){super(...e),this.addHandles(ae(()=>this.renderer,()=>{if(this.featureReduction){const t=this._normalizeFeatureReduction(this.featureReduction);this._set("featureReduction",t)}},le))}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}set renderer(e){}_withClusterVariable(e,t,r){const o=e.clone();return"visualVariables"in o&&(o.visualVariables||(o.visualVariables=[]),o.visualVariables.some(u=>u.type==="size")||o.visualVariables.push(new pe({field:"cluster_count",stops:[new I({value:1}),new I({useMinValue:!0,size:t}),new I({useMaxValue:!0,size:r})]}))),o}_normalizeFeatureReduction(e){var M;if((e==null?void 0:e.type)!=="cluster")return e;const t=e.clone(),r=[new y({name:"cluster_count",isAutoGenerated:!0,statisticType:"count"})],o=(t.fields??[]).filter(m=>!m.isAutoGenerated),u=e.renderer&&!((M=e.renderer.authoringInfo)!=null&&M.isAutoGenerated),{clusterMinSize:h,clusterMaxSize:E}=t;if(u){t.fields=[...r,...o];const m=this._withClusterVariable(t.renderer,h,E);return t.effectiveFeatureRenderer=m,t.effectiveClusterRenderer=m,t}if(e.symbol){if(t.fields=[...r,...o],t.renderer=null,!this.renderer)return t.effectiveFeatureRenderer=null,t.effectiveClusterRenderer=null,t;const m=D(r,this.renderer),x=this._withClusterVariable(m,h,E),Y="visualVariables"in x&&x.visualVariables?x.visualVariables:[],ee=new z({symbol:e.symbol,visualVariables:Y});return t.fields=[...r,...o],t.effectiveFeatureRenderer=x,t.effectiveClusterRenderer=ee,t}if(!this.renderer)return e;const A=D(r,this.renderer);t.fields=[...r,...o],t.renderer=A;const G=this._withClusterVariable(A,h,E);return t.effectiveFeatureRenderer=G,t.effectiveClusterRenderer=G,t}};return n([a(fe)],s.prototype,"featureReduction",null),s=n([w("esri.layers.mixins.FeatureReductionLayer")],s),s};export{_e as c}; +import{b4 as te,d as n,y as a,f as w,aU as j,aV as d,c9 as k,fB as O,fD as U,i as q,aR as R,aZ as S,b1 as J,f0 as v,iu as ie,eV as re,E as H,dy as se,N as ne,s as oe,g as ae,ez as le}from"./index-BjUNJPVf.js";import{j as ue,b as pe,a as I}from"./UniqueValueRenderer-7V9Bhr-D.js";import{a as P,o as _,m as z}from"./jsonUtils-Dw332y6z.js";import{t as $,p as N}from"./FeatureReductionSelection-t3T7oa8H.js";import{D as Z}from"./featureLayerUtils-lwqyOSrl.js";import{C as K}from"./LabelClass-CeatfK8u.js";import{x as Q}from"./MD5-C9MwAd2G.js";let b=class extends te(j){constructor(s){super(s),this.expression=null,this.title=null,this.returnType=null}};n([a({type:String,json:{write:!0}})],b.prototype,"expression",void 0),n([a({type:String,json:{write:!0}})],b.prototype,"title",void 0),n([a({type:String,json:{write:!0}})],b.prototype,"returnType",void 0),b=n([w("esri.layers.support.ExpressionInfo")],b);const C=b;var F;let c=F=class extends j{constructor(i){super(i),this.isAutoGenerated=!1,this.name=null,this.alias=null,this.onStatisticField=null,this.onStatisticExpression=null,this.statisticType=null}clone(){return new F({name:this.name,alias:this.alias,isAutoGenerated:this.isAutoGenerated,onStatisticExpression:d(this.onStatisticExpression),onStatisticField:this.onStatisticField,statisticType:this.statisticType})}};n([a({type:Boolean,json:{write:!0}})],c.prototype,"isAutoGenerated",void 0),n([a({type:String,json:{write:!0}})],c.prototype,"name",void 0),n([a({type:String,json:{write:!0}})],c.prototype,"alias",void 0),n([a({type:String,json:{write:!0}})],c.prototype,"onStatisticField",void 0),n([a({type:C,json:{write:!0}})],c.prototype,"onStatisticExpression",void 0),n([a({type:String,json:{write:!0}})],c.prototype,"statisticType",void 0),c=F=n([w("esri.layers.support.AggregateField")],c);const y=c;var V;const de="esri.layers.support.FeatureReductionBinning";let p=V=class extends ${constructor(i){super(i),this.type="binning",this.binType="geohash",this.fixedBinLevel=3,this.labelingInfo=null,this.labelsVisible=!0,this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.fields=[],this.renderer=null}writeFields(i,s,e){const t=i.filter(r=>r.statisticType!=="avg_angle").map(r=>r.toJSON());J(e,t,s)}readRenderer(i,s,e){var r;const t=(r=s.drawingInfo)==null?void 0:r.renderer;return t?_(t,s,e)??void 0:Z(s,e)}clone(){return new V({fields:d(this.fields),fixedBinLevel:this.fixedBinLevel,labelingInfo:d(this.labelingInfo),labelsVisible:this.labelsVisible,maxScale:this.maxScale,popupEnabled:this.popupEnabled,popupTemplate:d(this.popupTemplate),renderer:d(this.renderer)})}};n([k({binning:"binning"})],p.prototype,"type",void 0),n([k({geohash:"geohash"})],p.prototype,"binType",void 0),n([a({type:Number,range:{min:1,max:9},json:{write:!0}})],p.prototype,"fixedBinLevel",void 0),n([a({type:[K],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],p.prototype,"labelingInfo",void 0),n([a(O)],p.prototype,"labelsVisible",void 0),n([a({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],p.prototype,"maxScale",void 0),n([a(U)],p.prototype,"popupEnabled",void 0),n([a({type:q,json:{name:"popupInfo",write:!0}})],p.prototype,"popupTemplate",void 0),n([a({type:[y],json:{write:!0}})],p.prototype,"fields",void 0),n([R("fields")],p.prototype,"writeFields",null),n([a({types:P,json:{write:{target:"drawingInfo.renderer"}}})],p.prototype,"renderer",void 0),n([S("renderer",["drawingInfo.renderer"])],p.prototype,"readRenderer",null),p=V=n([w(de)],p);const W=p;var T;const ce="esri.layers.support.FeatureReductionCluster";function L(i){var s;return i.type==="simple"&&!((s=i.visualVariables)!=null&&s.length)}let l=T=class extends j{constructor(i){super(i),this.type="cluster",this.clusterRadius=v("80px"),this.clusterMinSize=v("12px"),this.clusterMaxSize=v("50px"),this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.renderer=null,this.symbol=null,this.labelingInfo=null,this.labelsVisible=!0,this.fields=[]}readRenderer(i,s,e){var r,o;const t=(r=s.drawingInfo)==null?void 0:r.renderer;return(o=t==null?void 0:t.authoringInfo)!=null&&o.isAutoGenerated?null:t?L(t)?null:_(t,s,e)??void 0:Z(s,e)}readSymbol(i,s,e){var r,o;const t=(r=s.drawingInfo)==null?void 0:r.renderer;if((o=t==null?void 0:t.authoringInfo)!=null&&o.isAutoGenerated)return null;if(t&&L(t)){const u=_(t,s,e);return u==null?void 0:u.symbol}return null}writeSymbol(i,s,e,t){var o,u;const r=(u=(o=this.renderer)==null?void 0:o.authoringInfo)==null?void 0:u.isAutoGenerated;if(!this.renderer||r){const h=new z({symbol:i});s.drawingInfo={renderer:h.write({},t)}}}writeFields(i,s,e){const t=i.filter(r=>r.statisticType!=="avg_angle").map(r=>r.toJSON());J(e,t,s)}readFields(i,s,e){return i.filter(t=>!t.isAutoGenerated).map(t=>y.fromJSON(t))}clone(){return new T({clusterRadius:this.clusterRadius,clusterMinSize:this.clusterMinSize,clusterMaxSize:this.clusterMaxSize,labelingInfo:d(this.labelingInfo),labelsVisible:this.labelsVisible,fields:d(this.fields),maxScale:this.maxScale,renderer:d(this.renderer),symbol:d(this.symbol),popupEnabled:this.popupEnabled,popupTemplate:d(this.popupTemplate)})}};n([a({type:["cluster"],readOnly:!0,json:{write:!0}})],l.prototype,"type",void 0),n([a({type:Number,cast:i=>i==="auto"?i:v(i),json:{write:!0}})],l.prototype,"clusterRadius",void 0),n([a({type:Number,cast:v,json:{write:!0}})],l.prototype,"clusterMinSize",void 0),n([a({type:Number,cast:v,json:{write:!0}})],l.prototype,"clusterMaxSize",void 0),n([a({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],l.prototype,"maxScale",void 0),n([a(U)],l.prototype,"popupEnabled",void 0),n([a({type:q,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],l.prototype,"popupTemplate",void 0),n([a({types:P,json:{write:{target:"drawingInfo.renderer"}}})],l.prototype,"renderer",void 0),n([S("renderer",["drawingInfo.renderer"])],l.prototype,"readRenderer",null),n([a({types:ie})],l.prototype,"symbol",void 0),n([S("symbol",["drawingInfo.renderer"])],l.prototype,"readSymbol",null),n([R("symbol")],l.prototype,"writeSymbol",null),n([a({type:[K],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],l.prototype,"labelingInfo",void 0),n([a(O)],l.prototype,"labelsVisible",void 0),n([a({type:[y],json:{write:!0}})],l.prototype,"fields",void 0),n([R("fields")],l.prototype,"writeFields",null),n([S("fields")],l.prototype,"readFields",null),l=T=n([w(ce)],l);const X=l,B={key:"type",base:$,typeMap:{cluster:X,binning:W}},fe={types:{key:"type",base:$,typeMap:{selection:N,cluster:X,binning:W}},json:{name:"layerDefinition.featureReduction",write:{allowNull:!0},origins:{"web-map":{types:B},"portal-item":{types:B},"web-scene":{types:{key:"type",base:$,typeMap:{selection:N}},name:"layerDefinition.featureReduction",write:{layerContainerTypes:re}}}}},ye=()=>oe.getLogger("esri.views.2d.layers.support.clusterUtils");H.add("esri-cluster-arcade-enabled",!0);const me=H("esri-cluster-arcade-enabled"),be=new Set(["simple-line","simple-fill","picture-fill"]);function D(i,s){let e=s.clone();if(!ve(e))return e;if(s.getSymbols().some(t=>be.has(t.type))&&(e=new z({symbol:new se})),e.authoringInfo||(e.authoringInfo=new ue),e.authoringInfo.isAutoGenerated=!0,"visualVariables"in e){const t=(e.visualVariables||[]).filter(r=>r.valueExpression!=="$view.scale");t.forEach(r=>{r.type==="rotation"?r.field?r.field=f(i,r.field,"avg_angle","number"):r.valueExpression&&(r.field=g(i,r.valueExpression,"avg_angle","number"),r.valueExpression=null):r.normalizationField?(r.field=f(i,r.field,"avg_norm","number",r.normalizationField),r.normalizationField=null):r.field?r.field=f(i,r.field,"avg","number"):r.valueExpression&&(r.field=g(i,r.valueExpression,"avg","number"),r.valueExpression=null)}),e.visualVariables=t}switch(e.type){case"simple":break;case"pie-chart":for(const t of e.attributes)t.field?t.field=f(i,t.field,"sum","number"):t.valueExpression&&(t.field=g(i,t.valueExpression,"sum","number"),t.valueExpression=null);break;case"unique-value":e.field?e.field=f(i,e.field,"mode","string"):e.valueExpression&&(e.field=g(i,e.valueExpression,"mode","string"),e.valueExpression=null);break;case"class-breaks":e.normalizationField?(e.field=f(i,e.field,"avg_norm","number",e.normalizationField),e.normalizationField=null):e.field?e.field=f(i,e.field,"avg","number"):e.valueExpression&&(e.field=g(i,e.valueExpression,"avg","number"),e.valueExpression=null)}return e}const ve=i=>{const s=e=>ye().error(new ne("Unsupported-renderer",e,{renderer:i}));if(!i)return!1;switch(i.type){case"unique-value":if(i.field2||i.field3)return s("FeatureReductionCluster does not support multi-field UniqueValueRenderers"),!1;break;case"class-breaks":if(i.normalizationField){const e=i.normalizationType;if(e!=="field")return s(`FeatureReductionCluster does not support a normalizationType of ${e}`),!1}break;case"simple":case"pie-chart":break;default:return s(`FeatureReductionCluster does not support renderers of type ${i.type}`),!1}if(!me){if("valueExpression"in i&&i.valueExpression)return s("FeatureReductionCluster does not currently support renderer.valueExpression. Support will be added in a future release"),!1;if(("visualVariables"in i&&i.visualVariables||[]).some(e=>!(!("valueExpression"in e)||!e.valueExpression)))return s("FeatureReductionCluster does not currently support visualVariables with a valueExpression. Support will be added in a future release"),!1}return!0};function he(i,s,e){switch(i){case"sum":return`cluster_sum_${s}`;case"avg":case"avg_angle":return`cluster_avg_${s}`;case"mode":return`cluster_type_${s}`;case"avg_norm":{const t=e,r="field",o=s.toLowerCase()+",norm:"+r+","+t.toLowerCase();return"cluster_avg_"+Q(o)}}}function g(i,s,e,t){const r=Q(s),o=e==="mode"?`cluster_type_${r}`:e==="sum"?`cluster_sum_${r}`:`cluster_avg_${r}`;return i.some(u=>u.name===o)||i.push(new y({name:o,isAutoGenerated:!0,onStatisticExpression:new C({expression:s,returnType:t}),statisticType:e})),o}function f(i,s,e,t,r){if(s==="cluster_count"||i.some(u=>u.name===s))return s;const o=he(e,s,r);return i.some(u=>u.name===o)||(e==="avg_norm"?i.push(new y({name:o,isAutoGenerated:!0,onStatisticExpression:new C({expression:`$feature.${s} / $feature.${r}`,returnType:t}),statisticType:"avg"})):i.push(new y({name:o,isAutoGenerated:!0,onStatisticField:s,statisticType:e}))),o}const _e=i=>{let s=class extends i{constructor(...e){super(...e),this.addHandles(ae(()=>this.renderer,()=>{if(this.featureReduction){const t=this._normalizeFeatureReduction(this.featureReduction);this._set("featureReduction",t)}},le))}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}set renderer(e){}_withClusterVariable(e,t,r){const o=e.clone();return"visualVariables"in o&&(o.visualVariables||(o.visualVariables=[]),o.visualVariables.some(u=>u.type==="size")||o.visualVariables.push(new pe({field:"cluster_count",stops:[new I({value:1}),new I({useMinValue:!0,size:t}),new I({useMaxValue:!0,size:r})]}))),o}_normalizeFeatureReduction(e){var M;if((e==null?void 0:e.type)!=="cluster")return e;const t=e.clone(),r=[new y({name:"cluster_count",isAutoGenerated:!0,statisticType:"count"})],o=(t.fields??[]).filter(m=>!m.isAutoGenerated),u=e.renderer&&!((M=e.renderer.authoringInfo)!=null&&M.isAutoGenerated),{clusterMinSize:h,clusterMaxSize:E}=t;if(u){t.fields=[...r,...o];const m=this._withClusterVariable(t.renderer,h,E);return t.effectiveFeatureRenderer=m,t.effectiveClusterRenderer=m,t}if(e.symbol){if(t.fields=[...r,...o],t.renderer=null,!this.renderer)return t.effectiveFeatureRenderer=null,t.effectiveClusterRenderer=null,t;const m=D(r,this.renderer),x=this._withClusterVariable(m,h,E),Y="visualVariables"in x&&x.visualVariables?x.visualVariables:[],ee=new z({symbol:e.symbol,visualVariables:Y});return t.fields=[...r,...o],t.effectiveFeatureRenderer=x,t.effectiveClusterRenderer=ee,t}if(!this.renderer)return e;const A=D(r,this.renderer);t.fields=[...r,...o],t.renderer=A;const G=this._withClusterVariable(A,h,E);return t.effectiveFeatureRenderer=G,t.effectiveClusterRenderer=G,t}};return n([a(fe)],s.prototype,"featureReduction",null),s=n([w("esri.layers.mixins.FeatureReductionLayer")],s),s};export{_e as c}; diff --git a/assets/FeatureReductionSelection-BY3KVXac.js b/assets/FeatureReductionSelection-t3T7oa8H.js similarity index 88% rename from assets/FeatureReductionSelection-BY3KVXac.js rename to assets/FeatureReductionSelection-t3T7oa8H.js index 7a8b717..b7b068e 100644 --- a/assets/FeatureReductionSelection-BY3KVXac.js +++ b/assets/FeatureReductionSelection-t3T7oa8H.js @@ -1 +1 @@ -import{d as s,y as o,f as n,aU as c}from"./index-CEWggaxV.js";let e=class extends c{constructor(){super(...arguments),this.type=null}};s([o({type:["selection","cluster","binning"],readOnly:!0,json:{read:!1,write:!0}})],e.prototype,"type",void 0),e=s([n("esri.layers.support.FeatureReduction")],e);var r;let t=r=class extends e{constructor(p){super(p),this.type="selection"}clone(){return new r}};s([o({type:["selection"]})],t.prototype,"type",void 0),t=r=s([n("esri.layers.support.FeatureReductionSelection")],t);const l=t;export{l as p,e as t}; +import{d as s,y as o,f as n,aU as c}from"./index-BjUNJPVf.js";let e=class extends c{constructor(){super(...arguments),this.type=null}};s([o({type:["selection","cluster","binning"],readOnly:!0,json:{read:!1,write:!0}})],e.prototype,"type",void 0),e=s([n("esri.layers.support.FeatureReduction")],e);var r;let t=r=class extends e{constructor(p){super(p),this.type="selection"}clone(){return new r}};s([o({type:["selection"]})],t.prototype,"type",void 0),t=r=s([n("esri.layers.support.FeatureReductionSelection")],t);const l=t;export{l as p,e as t}; diff --git a/assets/FeatureServiceSnappingSourceWorker-BZ3sJkXx.js b/assets/FeatureServiceSnappingSourceWorker-CRj73rBJ.js similarity index 96% rename from assets/FeatureServiceSnappingSourceWorker-BZ3sJkXx.js rename to assets/FeatureServiceSnappingSourceWorker-CRj73rBJ.js index 6227da9..4ee84e7 100644 --- a/assets/FeatureServiceSnappingSourceWorker-BZ3sJkXx.js +++ b/assets/FeatureServiceSnappingSourceWorker-CRj73rBJ.js @@ -1 +1 @@ -import{ee as X,bk as st,Z as it,at as y,iW as rt,aV as N,iU as j,d as h,y as d,f as O,a7 as P,ai as Y,cE as A,e_ as M,ff as z,io as D,iX as U,iY as nt,iZ as $,i0 as R,de as at,ez as tt,p as ot,b7 as lt,aX as v,aE as ut,ay as ct,s as ht,e as dt,i_ as pt,dX as ft,i$ as _t,j0 as q,dZ as w,j1 as gt,j2 as B,j3 as et,fs as yt,ca as mt,df as k,aS as S,bR as Et,g as V,fK as Ft,b0 as Ct}from"./index-CEWggaxV.js";import{m as Tt}from"./FeatureStore-CqSz6SOQ.js";import{$ as bt}from"./QueryEngine-RpcY23Sv.js";import{i as St,c as vt,g as It}from"./featureConversionUtils-CmP9mw0r.js";import{a as wt}from"./pbfQueryUtils-CLRSFGBm.js";import{x as Ot,f as xt,c as At,S as $t}from"./query-BM8R3sQ6.js";import{o as Rt}from"./BoundsStore-DMoG4U0L.js";import"./timeSupport-BjRbXIpn.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./json-Wa8cmqdu.js";import"./WhereClause-Dzgyc0wk.js";import"./TimeOnly-Cm47ew5I.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./QueryEngineCapabilities-CTDe3LlQ.js";import"./quantizationUtils-CUjGHrU3.js";import"./utils-B8iadP2F.js";import"./heatmapUtils-Clt5rJzr.js";import"./utils-SjO_-1JL.js";import"./utils-GMt8_G3w.js";import"./ClassBreaksDefinition-D281x8Sj.js";import"./FieldsIndex-CLgRNeJ_.js";import"./RenderState-DaVlEYWY.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./pbf-D9QZb8S8.js";import"./queryZScale-DN4aFXYn.js";import"./PooledRBush-BsFBmw1o.js";function J(t=!1,e){if(t){const{elevationInfo:s,alignPointsInFeatures:i}=e;return new zt(s,i)}return new Ht}let Ht=class{async alignCandidates(e,s,i){return e}notifyElevationSourceChange(){}};const Pt=1024;let zt=class{constructor(e,s){this._elevationInfo=e,this._alignPointsInFeatures=s,this._alignmentsCache=new X(Pt),this._cacheVersion=0}async alignCandidates(e,s,i){const r=this._elevationInfo;return r==null||r.mode!=="absolute-height"||r.featureExpressionInfo?this._alignComputedElevationCandidates(e,s,i):(this._alignAbsoluteElevationCandidates(e,s,r),e)}notifyElevationSourceChange(){this._alignmentsCache.clear(),this._cacheVersion++}_alignAbsoluteElevationCandidates(e,s,i){const{offset:r,unit:n}=i;if(r==null)return;const a=st(s),o=r*(rt(n??"meters")/a);for(const l of e)switch(l.type){case"edge":l.start.z+=o,l.end.z+=o;continue;case"vertex":l.target.z+=o;continue}}async _alignComputedElevationCandidates(e,s,i){const r=new Map;for(const g of e)it(r,g.objectId,Nt).push(g);const[n,a,o]=this._prepareQuery(r,s),l=await this._alignPointsInFeatures(n,i);if(y(i),o!==this._cacheVersion)return this._alignComputedElevationCandidates(e,s,i);this._applyCacheAndResponse(n,l,a);const{drapedObjectIds:c,failedObjectIds:f}=l,_=[];for(const g of e){const{objectId:m}=g;c.has(m)&&g.type==="edge"&&(g.draped=!0),f.has(m)||_.push(g)}return _}_prepareQuery(e,s){const i=[],r=[];for(const[n,a]of e){const o=[];for(const l of a)this._addToQueriesOrCachedResult(n,l.target,o,r),l.type==="edge"&&(this._addToQueriesOrCachedResult(n,l.start,o,r),this._addToQueriesOrCachedResult(n,l.end,o,r));o.length!==0&&i.push({objectId:n,points:o})}return[{spatialReference:s.toJSON(),pointsInFeatures:i},r,this._cacheVersion]}_addToQueriesOrCachedResult(e,s,i,r){const n=L(e,s),a=this._alignmentsCache.get(n);a==null?i.push(s):r.push(new Dt(s,a))}_applyCacheAndResponse(e,{elevations:s,drapedObjectIds:i,failedObjectIds:r},n){for(const l of n)l.apply();let a=0;const o=this._alignmentsCache;for(const{objectId:l,points:c}of e.pointsInFeatures){if(r.has(l)){a+=c.length;continue}const f=!i.has(l);for(const _ of c){const g=L(l,_),m=s[a++];_.z=m,f&&o.put(g,m,1)}}}};class Dt{constructor(e,s){this.point=e,this.z=s}apply(){this.point.z=this.z}}function L(t,{x:e,y:s,z:i,spatialReference:r}){return`${t}-${e}-${s}-${i??0}}-wkid:${r==null?void 0:r.wkid}`}function Nt(){return[]}let jt=class{filter(e,s){return s}notifyElevationSourceChange(){}},Mt=class{filter(e,s){const{point:i,distance:r}=e,{z:n}=i;if(n==null||s.length===0)return s;const a=Vt(r),o=this._updateCandidatesTo3D(s,i,a).filter(Ut);return o.sort(Jt),o}_updateCandidatesTo3D(e,s,i){for(const r of e)switch(r.type){case"edge":qt(r,s,i);continue;case"vertex":kt(r,s,i);continue}return e}};function Ut(t){return t.distance<=1}function Q(t=!1){return t?new Mt:new jt}function qt(t,e,{x:s,y:i,z:r}){const{start:n,end:a,target:o}=t;t.draped||Bt(o,e,n,a);const l=(e.x-o.x)/s,c=(e.y-o.y)/i,f=(e.z-o.z)/r;t.distance=Math.sqrt(l*l+c*c+f*f)}function Bt(t,e,s,i){const r=i.x-s.x,n=i.y-s.y,a=i.z-s.z,o=r*r+n*n+a*a,l=(e.x-s.x)*r+(e.y-s.y)*n+a*(e.z-s.z),c=Math.min(1,Math.max(0,l/o)),f=s.x+r*c,_=s.y+n*c,g=s.z+a*c;t.x=f,t.y=_,t.z=g}function kt(t,e,{x:s,y:i,z:r}){const{target:n}=t,a=(e.x-n.x)/s,o=(e.y-n.y)/i,l=(e.z-n.z)/r,c=Math.sqrt(a*a+o*o+l*l);t.distance=c}function Vt(t){return typeof t=="number"?{x:t,y:t,z:t}:t}function Jt(t,e){return t.distance-e.distance}function G(t=!1,e){return t?new Gt(e):new Lt}class Lt{async fetch(){return[]}notifySymbologyChange(){}}const Qt=1024;class Gt{constructor(e){this._getSymbologyCandidates=e,this._candidatesCache=new X(Qt),this._cacheVersion=0}async fetch(e,s){if(e.length===0)return[];const i=[],r=[],n=this._candidatesCache;for(const _ of e){const g=Z(_),m=n.get(g);if(m)for(const b of m)r.push(N(b));else i.push(_),n.put(g,[],1)}if(i.length===0)return r;const a=this._cacheVersion,{candidates:o,sourceCandidateIndices:l}=await this._getSymbologyCandidates(i,s);if(y(s),a!==this._cacheVersion)return this.fetch(e,s);const c=[],{length:f}=o;for(let _=0;_e.callback(s)).catch(()=>{}).then(()=>{this._pending.shift(),this._process()})}};h([d()],I.prototype,"updating",void 0),I=h([O("esri.core.AsyncSequence")],I);class Zt{constructor(e,s){this.data=e,this.resolution=s,this.state={type:u.CREATED},this.alive=!0}process(e){switch(this.state.type){case u.CREATED:return this.state=this._gotoFetchCount(this.state,e),this.state.task.promise.then(e.resume,e.resume);case u.FETCH_COUNT:break;case u.FETCHED_COUNT:return this.state=this._gotoFetchFeatures(this.state,e),this.state.task.promise.then(e.resume,e.resume);case u.FETCH_FEATURES:break;case u.FETCHED_FEATURES:this.state=this._goToDone(this.state,e);case u.DONE:}return null}get debugInfo(){return{data:this.data,featureCount:this._featureCount,state:this._stateToString}}get _featureCount(){switch(this.state.type){case u.CREATED:case u.FETCH_COUNT:return 0;case u.FETCHED_COUNT:return this.state.featureCount;case u.FETCH_FEATURES:return this.state.previous.featureCount;case u.FETCHED_FEATURES:return this.state.features.length;case u.DONE:return this.state.previous.features.length}}get _stateToString(){switch(this.state.type){case u.CREATED:return"created";case u.FETCH_COUNT:return"fetch-count";case u.FETCHED_COUNT:return"fetched-count";case u.FETCH_FEATURES:return"fetch-features";case u.FETCHED_FEATURES:return"fetched-features";case u.DONE:return"done"}}_gotoFetchCount(e,s){return{type:u.FETCH_COUNT,previous:e,task:A(async i=>{const r=await M(s.fetchCount(this,i));this.state.type===u.FETCH_COUNT&&(this.state=this._gotoFetchedCount(this.state,r.ok?r.value:1/0))})}}_gotoFetchedCount(e,s){return{type:u.FETCHED_COUNT,featureCount:s,previous:e}}_gotoFetchFeatures(e,s){return{type:u.FETCH_FEATURES,previous:e,task:A(async i=>{const r=await M(s.fetchFeatures(this,e.featureCount,i));this.state.type===u.FETCH_FEATURES&&(this.state=this._gotoFetchedFeatures(this.state,r.ok?r.value:[]))})}}_gotoFetchedFeatures(e,s){return{type:u.FETCHED_FEATURES,previous:e,features:s}}_goToDone(e,s){return s.finish(this,e.features),{type:u.DONE,previous:e}}reset(){const e=this.state;switch(this.state={type:u.CREATED},e.type){case u.CREATED:case u.FETCHED_COUNT:case u.FETCHED_FEATURES:case u.DONE:break;case u.FETCH_COUNT:case u.FETCH_FEATURES:e.task.abort()}}intersects(e){return e==null||!this.data.extent||(z(e,W),D(this.data.extent,W))}}var u;(function(t){t[t.CREATED=0]="CREATED",t[t.FETCH_COUNT=1]="FETCH_COUNT",t[t.FETCHED_COUNT=2]="FETCHED_COUNT",t[t.FETCH_FEATURES=3]="FETCH_FEATURES",t[t.FETCHED_FEATURES=4]="FETCHED_FEATURES",t[t.DONE=5]="DONE"})(u||(u={}));const W=Y();let p=class extends P{get _minimumVerticesPerFeature(){var t;switch((t=this.store)==null?void 0:t.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const t=new Set;return this.objectIdField&&t.add(this.objectIdField),this.globalIdField&&t.add(this.globalIdField),t}set outFields(t){const e=this._get("outFields"),s=U(t,this._mandatoryOutFields);nt(s,e)||(this._set("outFields",s),$(s,e)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(t){const e=this._get("filter"),s=this._filterProperties(t);JSON.stringify(e)!==JSON.stringify(s)&&this._set("filter",s)}set customParameters(t){const e=this._get("customParameters");JSON.stringify(e)!==JSON.stringify(t)&&this._set("customParameters",t)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(t){const e=this._get("tileInfo");e!==t&&(t!=null&&e!=null&&JSON.stringify(t)===JSON.stringify(e)||(this._set("tileInfo",t),this.store.tileInfo=t))}set tileSize(t){this._get("tileSize")!==t&&this._set("tileSize",t)}get updating(){return this.updatingExcludingEdits||this._pendingEdits.updating}get updatingExcludingEdits(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(t){super(t),this.suspended=!0,this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new R,this._pendingEdits=new I,this._pendingEditsAbortController=new AbortController}initialize(){this._initializeFetchExtent(),this._updatingHandles.add(()=>this._configuration,()=>this.refresh()),this._updatingHandles.add(()=>this.tilesOfInterest,(t,e)=>{at(t,e,({id:s},{id:i})=>s===i)||this._process()},tt),this.addHandles(ot(()=>!this.suspended,()=>this._process()))}destroy(){this._pendingTiles.forEach(t=>this._deletePendingTile(t)),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._pendingEditsAbortController.abort(),this._pendingEditsAbortController=null,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach(t=>this._deletePendingTile(t)),this._process()}applyEdits(t){this._pendingEdits.push(t,async e=>{if(e.addedFeatures.length===0&&e.updatedFeatures.length===0&&e.deletedFeatures.length===0)return;for(const[,i]of this._pendingTiles)i.reset();const s={...e,deletedFeatures:e.deletedFeatures.map(({objectId:i,globalId:r})=>i&&i!==-1?i:this._lookupObjectIdByGlobalId(r))};await this._updatingHandles.addPromise(this.store.processEdits(s,(i,r)=>this._queryFeaturesById(i,r),this._pendingEditsAbortController.signal)),this._processPendingTiles()})}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!lt(this.url))return;const t=A(async e=>{var s;try{const i=await Ot(this.url,new v({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:e});this.store.extent=ut.fromJSON((s=i.data)==null?void 0:s.extent)}catch(i){ct(i),ht.getLogger(this).warn("Failed to fetch data extent",i)}});this._updatingHandles.addPromise(t.promise.then(()=>this._process())),this.addHandles(dt(()=>t.abort()))}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map(t=>t.debugInfo),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const[,t]of this._pendingTiles)t.alive=!1}_createPendingTiles(){if(this.suspended)return;const t=this._collectMissingTilesInfo();if(this._setAvailability(t==null?1:t.coveredArea/t.fullArea),t!=null)for(const{data:e,resolution:s}of t.missingTiles){const i=this._pendingTiles.get(e.id);i?(i.resolution=s,i.alive=!0):this._createPendingTile(e,s)}}_collectMissingTilesInfo(){let t=null;for(let e=this.tilesOfInterest.length-1;e>=0;e--){const s=this.tilesOfInterest[e],i=this.store.process(s,(r,n)=>this._verifyTileComplexity(r,n),this.outFields);t==null?t=i:t.prepend(i)}return t}_deletePendingTiles(){for(const[,t]of this._pendingTiles)t.alive||this._deletePendingTile(t)}_processPendingTiles(){const t={fetchCount:(e,s)=>this._fetchCount(e,s),fetchFeatures:(e,s,i)=>this._fetchFeatures(e,s,i),finish:(e,s)=>this._finishPendingTile(e,s),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(t))for(const[,e]of this._pendingTiles)this._verifyTileComplexity(this.store.getFeatureCount(e.data),e.resolution)&&this._updatingHandles.addPromise(e.process(t))}_verifyTileComplexity(t,e){return this._verifyVertexComplexity(t)&&this._verifyFeatureDensity(t,e)}_verifyVertexComplexity(t){return t*this._minimumVerticesPerFeature{t===r.attributes[e]&&(i=r.objectId??r.attributes[s])}),i==null)throw new Error(`Expected to find a feature with globalId ${t}`);return i}_queryFeaturesById(t,e){const s=this._createFeaturesQuery();return s.objectIds=t,this._queryFeatures(s,e)}_queryFeatures(t,e){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(t,e):this._queryFeaturesJSON(t,e)}async _queryFeaturesPBF(t,e){const{sourceSpatialReference:s}=this,{data:i}=await xt(this.url,t,new wt({sourceSpatialReference:s}),{query:this._configuration.customParameters,timeout:x,signal:e});return St(i)}async _queryFeaturesJSON(t,e){const{sourceSpatialReference:s}=this,{data:i}=await At(this.url,t,s,{query:this._configuration.customParameters,timeout:x,signal:e});return vt(i,this.objectIdField)}_createCountQuery(t){const e=this._createBaseQuery(t);return this.capabilities.query.supportsCacheHint&&(e.cacheHint=!0),e}_createFeaturesQuery(t=null){var r;const e=this._createBaseQuery(t),s=(t==null?void 0:t.data)!=null?this.store.getAttributesForTile((r=t==null?void 0:t.data)==null?void 0:r.id):null,i=U(pt(this.outFields,s??new Set),this._mandatoryOutFields);return e.outFields=Array.from(i),e.returnGeometry=!0,t!=null&&(this.capabilities.query.supportsResultType?e.resultType="tile":this.capabilities.query.supportsCacheHint&&(e.cacheHint=!0)),e}_createBaseQuery(t){const e=new v({returnZ:this.hasZ,returnM:!1,geometry:this.tileInfo!=null&&t!=null?ft(t.data.extent,this.tileInfo.spatialReference):void 0}),s=this._configuration.filter;return s!=null&&(e.where=s.where,e.gdbVersion=s.gdbVersion,e.timeExtent=s.timeExtent),e.outSpatialReference=this.spatialReference,e}_setPagingParameters(t,e,s){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:i,supportsCacheHint:r,tileMaxRecordCount:n,maxRecordCount:a,supportsResultType:o}=this.capabilities.query,l=i?v.MAX_MAX_RECORD_COUNT_FACTOR:1,c=l*((o||r)&&n?n:a||Wt);return t.start=e,i?(t.maxRecordCountFactor=Math.min(l,Math.ceil(s/c)),t.num=Math.min(s,t.maxRecordCountFactor*c)):t.num=Math.min(s,c),!0}};h([d({constructOnly:!0})],p.prototype,"url",void 0),h([d({constructOnly:!0})],p.prototype,"objectIdField",void 0),h([d({constructOnly:!0})],p.prototype,"globalIdField",void 0),h([d({constructOnly:!0})],p.prototype,"capabilities",void 0),h([d({constructOnly:!0})],p.prototype,"sourceSpatialReference",void 0),h([d({constructOnly:!0})],p.prototype,"spatialReference",void 0),h([d({constructOnly:!0})],p.prototype,"store",void 0),h([d({readOnly:!0})],p.prototype,"_minimumVerticesPerFeature",null),h([d()],p.prototype,"_mandatoryOutFields",null),h([d()],p.prototype,"outFields",null),h([d()],p.prototype,"suspended",void 0),h([d()],p.prototype,"filter",null),h([d()],p.prototype,"customParameters",null),h([d({readOnly:!0})],p.prototype,"_configuration",null),h([d()],p.prototype,"tileInfo",null),h([d()],p.prototype,"tileSize",null),h([d()],p.prototype,"tilesOfInterest",void 0),h([d({readOnly:!0})],p.prototype,"updating",null),h([d({readOnly:!0})],p.prototype,"updatingExcludingEdits",null),h([d({readOnly:!0})],p.prototype,"availability",void 0),h([d()],p.prototype,"hasZ",null),p=h([O("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],p);const Wt=2e3,x=6e5,Kt=1e6,Xt=25,Yt=1;class te{constructor(){this._store=new Map,this._byteSize=0}set(e,s){this.delete(e),this._store.set(e,s),this._byteSize+=s.byteSize}delete(e){const s=this._store.get(e);return!!this._store.delete(e)&&(s!=null&&(this._byteSize-=s.byteSize),!0)}get(e){return this._used(e),this._store.get(e)}has(e){return this._used(e),this._store.has(e)}clear(){this._store.clear()}applyByteSizeLimit(e,s){for(const[i,r]of this._store){if(this._byteSize<=e)break;this.delete(i),s(r)}}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}_used(e){const s=this._store.get(e);s&&(this._store.delete(e),this._store.set(e,s))}}let F=class extends P{constructor(t){super(t),this.tileInfo=null,this.extent=null,this.maximumByteSize=10*_t.MEGABYTES,this._tileBounds=new Rt,this._tiles=new te,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=Y()}add(t,e){var r;for(const n of e)this._referenceFeature(n.objectId);const s=this.featureStore.upsertMany(e),i=s.map(n=>new Set(Object.keys(n.attributes))).reduce((n,a)=>q(n,a),new Set(Object.keys(((r=s[0])==null?void 0:r.attributes)??[])));this._addTileStorage(t,new Set(s.map(n=>n.objectId)),ee(s),i),this._tiles.applyByteSizeLimit(this.maximumByteSize,n=>this._removeTileStorage(n))}getAttributesForTile(t){var e;return t?(e=this._tiles.get(t))==null?void 0:e.attributeKeys:null}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(t,e,s){return this._processEditsDelete(t.deletedFeatures.concat(t.updatedFeatures)),this._processEditsRefetch(t.addedFeatures.concat(t.updatedFeatures),e,s)}_addTileStorage(t,e,s,i){const r=t.id;this._tiles.set(r,new re(t,e,s,i)),this._tileBounds.set(r,t.extent),this._tileFeatureCounts.set(r,e.size)}_remove({id:t}){const e=this._tiles.get(t);e&&this._removeTileStorage(e)}_removeTileStorage(t){const e=[];for(const i of t.objectIds)this._unreferenceFeature(i)===C.REMOVED&&e.push(i);this.featureStore.removeManyById(e);const s=t.data.id;this._tiles.delete(s),this._tileBounds.delete(s)}_processEditsDelete(t){this.featureStore.removeManyById(t);for(const[,e]of this._tiles){for(const s of t)e.objectIds.delete(s);this._tileFeatureCounts.set(e.data.id,e.objectIds.size)}for(const e of t)this._refCounts.delete(e)}async _processEditsRefetch(t,e,s){const i=(await e(t,s)).features,{hasZ:r,hasM:n}=this.featureStore;for(const a of i){const o=It(this._tmpBoundingRect,a.geometry,r,n);o!=null&&this._tileBounds.forEachInBounds(o,l=>{const c=this._tiles.get(l);this.featureStore.add(a);const f=a.objectId;c.objectIds.has(f)||(c.objectIds.add(f),this._referenceFeature(f),this._tileFeatureCounts.set(c.data.id,c.objectIds.size))})}}process(t,e=()=>!0,s){if(this.tileInfo==null||!t.extent||this.extent!=null&&!D(z(this.extent,this._tmpBoundingRect),t.extent))return new H(t);const i=this.getAttributesForTile(t.id);if($(s,i))return new H(t);const r=this._createTileTree(t,this.tileInfo);return this._simplify(r,e,null,0,1),this._collectMissingTiles(t,r,this.tileInfo,s)}get debugInfo(){return Array.from(this._tiles.values()).map(({data:t})=>({data:t,featureCount:this._tileFeatureCounts.get(t.id)||0}))}getFeatureCount(t){return this._tileFeatureCounts.get(t.id)??0}async fetchCount(t,e,s,i){const r=this._tileFeatureCounts.get(t.id);if(r!=null)return r;const n=await $t(e,s,i);return this._tileFeatureCounts.set(t.id,n.data.count),n.data.count}_createTileTree(t,e){const s=new K(t.level,t.row,t.col);return e.updateTileInfo(s,w.ExtrapolateOptions.POWER_OF_TWO),this._tileBounds.forEachInBounds(t.extent,i=>{var n;const r=(n=this._tiles.get(i))==null?void 0:n.data;r&&this._tilesAreRelated(t,r)&&this._populateChildren(s,r,e,this._tileFeatureCounts.get(r.id)||0)}),s}_tilesAreRelated(t,e){if(!t||!e)return!1;if(t.level===e.level)return t.row===e.row&&t.col===e.col;const s=t.level>r,a=e.col>>r,o=t.row<<1,l=a-(t.col<<1)+(n-o<<1),c=t.children[l];if(c!=null)this._populateChildren(c,e,s,i);else{const f=new K(t.level+1,n,a);s.updateTileInfo(f,w.ExtrapolateOptions.POWER_OF_TWO),t.children[l]=f,this._populateChildren(f,e,s,i)}}_simplify(t,e,s,i,r){const n=r*r;if(t.isLeaf)return e(this.getFeatureCount(t),r)?0:(this._remove(t),s!=null&&(s.children[i]=null),n);const a=r/2,o=a*a;let l=0;for(let c=0;c{const n=this._tiles.get(r.id);if(n){s=s?q(s,n.attributeKeys):new Set(n.attributeKeys),i+=n.byteSize;for(const a of n.objectIds)e.has(a)||(e.add(a),this._referenceFeature(a));this._remove(r)}}),this._addTileStorage(t,e,i,s??new Set),t.isLeaf=!0,t.children[0]=t.children[1]=t.children[2]=t.children[3]=null,this._tileFeatureCounts.set(t.id,e.size)}_forEachLeaf(t,e){for(const s of t.children)s!=null&&(s.isLeaf?e(s):this._forEachLeaf(s,e))}_purge(t){if(t!=null)if(t.isLeaf)this._remove(t);else for(let e=0;e>1),(t.col<<1)+(1&o),a):this._collectMissingTilesRecurse(l,e,a,i)}}_referenceFeature(t){const e=(this._refCounts.get(t)||0)+1;return this._refCounts.set(t,e),e===1?C.ADDED:C.UNCHANGED}_unreferenceFeature(t){const e=(this._refCounts.get(t)||0)-1;return e===0?(this._refCounts.delete(t),C.REMOVED):(e>0&&this._refCounts.set(t,e),C.UNCHANGED)}get test(){return{tiles:Array.from(this._tiles.values()).map(t=>`${t.data.id}:[${Array.from(t.objectIds)}]`),featureReferences:Array.from(this._refCounts.keys()).map(t=>`${t}:${this._refCounts.get(t)}`)}}};function ee(t){return t.reduce((e,s)=>e+se(s),0)}function se(t){return 32+ie(t.geometry)+gt(t.attributes)}function ie(t){if(t==null)return 0;const e=B(t.lengths,4);return 32+B(t.coords,8)+e}h([d({constructOnly:!0})],F.prototype,"featureStore",void 0),h([d()],F.prototype,"tileInfo",void 0),h([d()],F.prototype,"extent",void 0),h([d()],F.prototype,"maximumByteSize",void 0),F=h([O("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],F);class re{constructor(e,s,i,r){this.data=e,this.objectIds=s,this.byteSize=i,this.attributeKeys=r}}let K=class{constructor(e,s,i){this.level=e,this.row=s,this.col=i,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(this.children[0]!=null||this.children[1]!=null||this.children[2]!=null||this.children[3]!=null)}};class H{constructor(e,s=[]){this.missingTiles=s,this.fullArea=0,this.coveredArea=0,this.fullArea=et(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}}let ne=class{constructor(e,s,i){this._tileInfo=e,this._extent=null,this.info=new H(s),i!=null&&(this._extent=z(i))}addMissing(e,s,i,r){const n=new yt(null,e,s,i);this._tileInfo.updateTileInfo(n,w.ExtrapolateOptions.POWER_OF_TWO),n.extent==null||this._extent!=null&&!D(this._extent,n.extent)||(this.info.missingTiles.push({data:n,resolution:r}),this.info.coveredArea-=et(n.extent))}};const ae=.18751;var C;(function(t){t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.UNCHANGED=2]="UNCHANGED"})(C||(C={}));let T=class extends mt.EventedAccessor{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=k(),this._elevationAligner=J(),this._elevationFilter=Q(),this._symbologyCandidatesFetcher=G(),this._updatingHandles=new R,this._editsUpdatingHandles=new R,this._pendingApplyEdits=new Map,this._alignPointsInFeatures=async(t,e)=>{const s={query:t},i=await this.remoteClient.invoke("alignElevation",s,{signal:e});return y(e),i},this._getSymbologyCandidates=async(t,e)=>{const s={candidates:t,spatialReference:this._spatialReference.toJSON()},i=await this.remoteClient.invoke("getSymbologyCandidates",s,{signal:e});return y(e),i}}get updating(){return this.updatingExcludingEdits||this._editsUpdatingHandles.updating||this._featureFetcher.updating}get updatingExcludingEdits(){return this._featureFetcher.updatingExcludingEdits||this._isInitializing||this._updatingHandles.updating}destroy(){var t,e,s;(t=this._featureFetcher)==null||t.destroy(),(e=this._queryEngine)==null||e.destroy(),(s=this._featureStore)==null||s.clear()}async setup(t){if(this.destroyed)return{result:{}};const{geometryType:e,objectIdField:s,timeInfo:i,fieldsIndex:r}=t.serviceInfo,{hasZ:n}=t,a=S.fromJSON(t.spatialReference);this._spatialReference=a,this._featureStore=new Tt({...t.serviceInfo,hasZ:n,hasM:!1}),this._queryEngine=new bt({spatialReference:t.spatialReference,featureStore:this._featureStore,geometryType:e,fieldsIndex:r,hasZ:n,hasM:!1,objectIdField:s,timeInfo:i}),this._featureFetcher=new p({store:new F({featureStore:this._featureStore}),url:t.serviceInfo.url,objectIdField:t.serviceInfo.objectIdField,globalIdField:t.serviceInfo.globalIdField,capabilities:t.serviceInfo.capabilities,spatialReference:a,sourceSpatialReference:S.fromJSON(t.serviceInfo.spatialReference),customParameters:t.configuration.customParameters});const o=t.configuration.viewType==="3d";return this._elevationAligner=J(o,{elevationInfo:t.elevationInfo!=null?Et.fromJSON(t.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures}),this._elevationFilter=Q(o),this.addHandles([V(()=>this._featureFetcher.availability,l=>this.emit("notify-availability",{availability:l}),tt),V(()=>this.updating,()=>this._notifyUpdating())]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(t.configuration)}async configure(t){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(t),E}async setSuspended(t,e){return await this._updatingHandles.addPromise(this._whenSetup.promise),y(e),this._featureFetcher.suspended=t,E}async updateOutFields(t,e){return await this._updatingHandles.addPromise(this._whenSetup.promise),y(e),this._featureFetcher.outFields=new Set(t??[]),E}async fetchCandidates(t,e){await this._whenSetup.promise,y(e);const s=oe(t),i=e==null?void 0:e.signal,r=await this._queryEngine.executeQueryForSnapping(s,i);y(i);const n=await this._elevationAligner.alignCandidates(r.candidates,S.fromJSON(t.point.spatialReference)??S.WGS84,i);y(i);const a=await this._symbologyCandidatesFetcher.fetch(n,i);y(i);const o=a.length===0?n:n.concat(a);return{result:{candidates:this._elevationFilter.filter(s,o)}}}async updateTiles(t,e){return await this._updatingHandles.addPromise(this._whenSetup.promise),y(e),this._featureFetcher.tileSize=t.tileSize,this._featureFetcher.tilesOfInterest=t.tiles,this._featureFetcher.tileInfo=t.tileInfo!=null?w.fromJSON(t.tileInfo):null,E}async refresh(t,e){return await this._updatingHandles.addPromise(this._whenSetup.promise),y(e),this._featureFetcher.refresh(),E}async whenNotUpdating(t,e){return await this._updatingHandles.addPromise(this._whenSetup.promise),y(e),await Ft(()=>!this.updatingExcludingEdits,e),y(e),E}async getDebugInfo(t,e){return y(e),{result:this._featureFetcher.debugInfo}}async beginApplyEdits(t,e){this._updatingHandles.addPromise(this._whenSetup.promise),y(e);const s=k();return this._pendingApplyEdits.set(t.id,s),this._featureFetcher.applyEdits(s.promise),this._editsUpdatingHandles.addPromise(s.promise),E}async endApplyEdits(t,e){const s=this._pendingApplyEdits.get(t.id);return s&&s.resolve(t.edits),y(e),E}async notifyElevationSourceChange(t,e){return this._elevationAligner.notifyElevationSourceChange(),E}async notifySymbologyChange(t,e){return this._symbologyCandidatesFetcher.notifySymbologyChange(),E}async setSymbologySnappingSupported(t){return this._symbologyCandidatesFetcher=G(t,this._getSymbologyCandidates),E}_updateFeatureFetcherConfiguration(t){this._featureFetcher.filter=t.filter!=null?v.fromJSON(t.filter):null,this._featureFetcher.customParameters=t.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};h([d({readOnly:!0})],T.prototype,"updating",null),h([d({readOnly:!0})],T.prototype,"updatingExcludingEdits",null),h([d()],T.prototype,"_isInitializing",void 0),T=h([O("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],T);const qe=T;function oe(t){if(!t.filter)return{...t,query:{where:"1=1"}};const{distance:e,units:s,spatialRel:i,where:r,timeExtent:n,objectIds:a}=t.filter,o={geometry:t.filter.geometry?Ct(t.filter.geometry):void 0,distance:e,units:s,spatialRel:i,timeExtent:n,objectIds:a,where:r??"1=1"};return{...t,query:o}}const E={result:{}};export{qe as default}; +import{ee as X,bk as st,Z as it,at as y,iW as rt,aV as N,iU as j,d as h,y as d,f as O,a7 as P,ai as Y,cE as A,e_ as M,ff as z,io as D,iX as U,iY as nt,iZ as $,i0 as R,de as at,ez as tt,p as ot,b7 as lt,aX as v,aE as ut,ay as ct,s as ht,e as dt,i_ as pt,dX as ft,i$ as _t,j0 as q,dZ as w,j1 as gt,j2 as B,j3 as et,fs as yt,ca as mt,df as k,aS as S,bR as Et,g as V,fK as Ft,b0 as Ct}from"./index-BjUNJPVf.js";import{m as Tt}from"./FeatureStore-CRMzrhIt.js";import{$ as bt}from"./QueryEngine-loUu1VUW.js";import{i as St,c as vt,g as It}from"./featureConversionUtils-BHhm7bvm.js";import{a as wt}from"./pbfQueryUtils-CSeFSIjv.js";import{x as Ot,f as xt,c as At,S as $t}from"./query-Bk_ITqRK.js";import{o as Rt}from"./BoundsStore-DRDtG3Mk.js";import"./timeSupport-DXkhlToK.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./json-Wa8cmqdu.js";import"./WhereClause-Ctld7DSu.js";import"./TimeOnly-BXSODLxA.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./QueryEngineCapabilities-CTDe3LlQ.js";import"./quantizationUtils-CfV316jZ.js";import"./utils-BKh1cxpi.js";import"./heatmapUtils-BSteZBTj.js";import"./utils-Bzmbfe7p.js";import"./utils-CY1ReiSd.js";import"./ClassBreaksDefinition-Djcxa8Lp.js";import"./FieldsIndex-CK-0B5n9.js";import"./RenderState-DaVlEYWY.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./pbf-Du8sFEWo.js";import"./queryZScale-Dwvn5BlQ.js";import"./PooledRBush-BlFOlUgK.js";function J(t=!1,e){if(t){const{elevationInfo:s,alignPointsInFeatures:i}=e;return new zt(s,i)}return new Ht}let Ht=class{async alignCandidates(e,s,i){return e}notifyElevationSourceChange(){}};const Pt=1024;let zt=class{constructor(e,s){this._elevationInfo=e,this._alignPointsInFeatures=s,this._alignmentsCache=new X(Pt),this._cacheVersion=0}async alignCandidates(e,s,i){const r=this._elevationInfo;return r==null||r.mode!=="absolute-height"||r.featureExpressionInfo?this._alignComputedElevationCandidates(e,s,i):(this._alignAbsoluteElevationCandidates(e,s,r),e)}notifyElevationSourceChange(){this._alignmentsCache.clear(),this._cacheVersion++}_alignAbsoluteElevationCandidates(e,s,i){const{offset:r,unit:n}=i;if(r==null)return;const a=st(s),o=r*(rt(n??"meters")/a);for(const l of e)switch(l.type){case"edge":l.start.z+=o,l.end.z+=o;continue;case"vertex":l.target.z+=o;continue}}async _alignComputedElevationCandidates(e,s,i){const r=new Map;for(const g of e)it(r,g.objectId,Nt).push(g);const[n,a,o]=this._prepareQuery(r,s),l=await this._alignPointsInFeatures(n,i);if(y(i),o!==this._cacheVersion)return this._alignComputedElevationCandidates(e,s,i);this._applyCacheAndResponse(n,l,a);const{drapedObjectIds:c,failedObjectIds:f}=l,_=[];for(const g of e){const{objectId:m}=g;c.has(m)&&g.type==="edge"&&(g.draped=!0),f.has(m)||_.push(g)}return _}_prepareQuery(e,s){const i=[],r=[];for(const[n,a]of e){const o=[];for(const l of a)this._addToQueriesOrCachedResult(n,l.target,o,r),l.type==="edge"&&(this._addToQueriesOrCachedResult(n,l.start,o,r),this._addToQueriesOrCachedResult(n,l.end,o,r));o.length!==0&&i.push({objectId:n,points:o})}return[{spatialReference:s.toJSON(),pointsInFeatures:i},r,this._cacheVersion]}_addToQueriesOrCachedResult(e,s,i,r){const n=L(e,s),a=this._alignmentsCache.get(n);a==null?i.push(s):r.push(new Dt(s,a))}_applyCacheAndResponse(e,{elevations:s,drapedObjectIds:i,failedObjectIds:r},n){for(const l of n)l.apply();let a=0;const o=this._alignmentsCache;for(const{objectId:l,points:c}of e.pointsInFeatures){if(r.has(l)){a+=c.length;continue}const f=!i.has(l);for(const _ of c){const g=L(l,_),m=s[a++];_.z=m,f&&o.put(g,m,1)}}}};class Dt{constructor(e,s){this.point=e,this.z=s}apply(){this.point.z=this.z}}function L(t,{x:e,y:s,z:i,spatialReference:r}){return`${t}-${e}-${s}-${i??0}}-wkid:${r==null?void 0:r.wkid}`}function Nt(){return[]}let jt=class{filter(e,s){return s}notifyElevationSourceChange(){}},Mt=class{filter(e,s){const{point:i,distance:r}=e,{z:n}=i;if(n==null||s.length===0)return s;const a=Vt(r),o=this._updateCandidatesTo3D(s,i,a).filter(Ut);return o.sort(Jt),o}_updateCandidatesTo3D(e,s,i){for(const r of e)switch(r.type){case"edge":qt(r,s,i);continue;case"vertex":kt(r,s,i);continue}return e}};function Ut(t){return t.distance<=1}function Q(t=!1){return t?new Mt:new jt}function qt(t,e,{x:s,y:i,z:r}){const{start:n,end:a,target:o}=t;t.draped||Bt(o,e,n,a);const l=(e.x-o.x)/s,c=(e.y-o.y)/i,f=(e.z-o.z)/r;t.distance=Math.sqrt(l*l+c*c+f*f)}function Bt(t,e,s,i){const r=i.x-s.x,n=i.y-s.y,a=i.z-s.z,o=r*r+n*n+a*a,l=(e.x-s.x)*r+(e.y-s.y)*n+a*(e.z-s.z),c=Math.min(1,Math.max(0,l/o)),f=s.x+r*c,_=s.y+n*c,g=s.z+a*c;t.x=f,t.y=_,t.z=g}function kt(t,e,{x:s,y:i,z:r}){const{target:n}=t,a=(e.x-n.x)/s,o=(e.y-n.y)/i,l=(e.z-n.z)/r,c=Math.sqrt(a*a+o*o+l*l);t.distance=c}function Vt(t){return typeof t=="number"?{x:t,y:t,z:t}:t}function Jt(t,e){return t.distance-e.distance}function G(t=!1,e){return t?new Gt(e):new Lt}class Lt{async fetch(){return[]}notifySymbologyChange(){}}const Qt=1024;class Gt{constructor(e){this._getSymbologyCandidates=e,this._candidatesCache=new X(Qt),this._cacheVersion=0}async fetch(e,s){if(e.length===0)return[];const i=[],r=[],n=this._candidatesCache;for(const _ of e){const g=Z(_),m=n.get(g);if(m)for(const b of m)r.push(N(b));else i.push(_),n.put(g,[],1)}if(i.length===0)return r;const a=this._cacheVersion,{candidates:o,sourceCandidateIndices:l}=await this._getSymbologyCandidates(i,s);if(y(s),a!==this._cacheVersion)return this.fetch(e,s);const c=[],{length:f}=o;for(let _=0;_e.callback(s)).catch(()=>{}).then(()=>{this._pending.shift(),this._process()})}};h([d()],I.prototype,"updating",void 0),I=h([O("esri.core.AsyncSequence")],I);class Zt{constructor(e,s){this.data=e,this.resolution=s,this.state={type:u.CREATED},this.alive=!0}process(e){switch(this.state.type){case u.CREATED:return this.state=this._gotoFetchCount(this.state,e),this.state.task.promise.then(e.resume,e.resume);case u.FETCH_COUNT:break;case u.FETCHED_COUNT:return this.state=this._gotoFetchFeatures(this.state,e),this.state.task.promise.then(e.resume,e.resume);case u.FETCH_FEATURES:break;case u.FETCHED_FEATURES:this.state=this._goToDone(this.state,e);case u.DONE:}return null}get debugInfo(){return{data:this.data,featureCount:this._featureCount,state:this._stateToString}}get _featureCount(){switch(this.state.type){case u.CREATED:case u.FETCH_COUNT:return 0;case u.FETCHED_COUNT:return this.state.featureCount;case u.FETCH_FEATURES:return this.state.previous.featureCount;case u.FETCHED_FEATURES:return this.state.features.length;case u.DONE:return this.state.previous.features.length}}get _stateToString(){switch(this.state.type){case u.CREATED:return"created";case u.FETCH_COUNT:return"fetch-count";case u.FETCHED_COUNT:return"fetched-count";case u.FETCH_FEATURES:return"fetch-features";case u.FETCHED_FEATURES:return"fetched-features";case u.DONE:return"done"}}_gotoFetchCount(e,s){return{type:u.FETCH_COUNT,previous:e,task:A(async i=>{const r=await M(s.fetchCount(this,i));this.state.type===u.FETCH_COUNT&&(this.state=this._gotoFetchedCount(this.state,r.ok?r.value:1/0))})}}_gotoFetchedCount(e,s){return{type:u.FETCHED_COUNT,featureCount:s,previous:e}}_gotoFetchFeatures(e,s){return{type:u.FETCH_FEATURES,previous:e,task:A(async i=>{const r=await M(s.fetchFeatures(this,e.featureCount,i));this.state.type===u.FETCH_FEATURES&&(this.state=this._gotoFetchedFeatures(this.state,r.ok?r.value:[]))})}}_gotoFetchedFeatures(e,s){return{type:u.FETCHED_FEATURES,previous:e,features:s}}_goToDone(e,s){return s.finish(this,e.features),{type:u.DONE,previous:e}}reset(){const e=this.state;switch(this.state={type:u.CREATED},e.type){case u.CREATED:case u.FETCHED_COUNT:case u.FETCHED_FEATURES:case u.DONE:break;case u.FETCH_COUNT:case u.FETCH_FEATURES:e.task.abort()}}intersects(e){return e==null||!this.data.extent||(z(e,W),D(this.data.extent,W))}}var u;(function(t){t[t.CREATED=0]="CREATED",t[t.FETCH_COUNT=1]="FETCH_COUNT",t[t.FETCHED_COUNT=2]="FETCHED_COUNT",t[t.FETCH_FEATURES=3]="FETCH_FEATURES",t[t.FETCHED_FEATURES=4]="FETCHED_FEATURES",t[t.DONE=5]="DONE"})(u||(u={}));const W=Y();let p=class extends P{get _minimumVerticesPerFeature(){var t;switch((t=this.store)==null?void 0:t.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const t=new Set;return this.objectIdField&&t.add(this.objectIdField),this.globalIdField&&t.add(this.globalIdField),t}set outFields(t){const e=this._get("outFields"),s=U(t,this._mandatoryOutFields);nt(s,e)||(this._set("outFields",s),$(s,e)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(t){const e=this._get("filter"),s=this._filterProperties(t);JSON.stringify(e)!==JSON.stringify(s)&&this._set("filter",s)}set customParameters(t){const e=this._get("customParameters");JSON.stringify(e)!==JSON.stringify(t)&&this._set("customParameters",t)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(t){const e=this._get("tileInfo");e!==t&&(t!=null&&e!=null&&JSON.stringify(t)===JSON.stringify(e)||(this._set("tileInfo",t),this.store.tileInfo=t))}set tileSize(t){this._get("tileSize")!==t&&this._set("tileSize",t)}get updating(){return this.updatingExcludingEdits||this._pendingEdits.updating}get updatingExcludingEdits(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(t){super(t),this.suspended=!0,this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new R,this._pendingEdits=new I,this._pendingEditsAbortController=new AbortController}initialize(){this._initializeFetchExtent(),this._updatingHandles.add(()=>this._configuration,()=>this.refresh()),this._updatingHandles.add(()=>this.tilesOfInterest,(t,e)=>{at(t,e,({id:s},{id:i})=>s===i)||this._process()},tt),this.addHandles(ot(()=>!this.suspended,()=>this._process()))}destroy(){this._pendingTiles.forEach(t=>this._deletePendingTile(t)),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._pendingEditsAbortController.abort(),this._pendingEditsAbortController=null,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach(t=>this._deletePendingTile(t)),this._process()}applyEdits(t){this._pendingEdits.push(t,async e=>{if(e.addedFeatures.length===0&&e.updatedFeatures.length===0&&e.deletedFeatures.length===0)return;for(const[,i]of this._pendingTiles)i.reset();const s={...e,deletedFeatures:e.deletedFeatures.map(({objectId:i,globalId:r})=>i&&i!==-1?i:this._lookupObjectIdByGlobalId(r))};await this._updatingHandles.addPromise(this.store.processEdits(s,(i,r)=>this._queryFeaturesById(i,r),this._pendingEditsAbortController.signal)),this._processPendingTiles()})}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!lt(this.url))return;const t=A(async e=>{var s;try{const i=await Ot(this.url,new v({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:e});this.store.extent=ut.fromJSON((s=i.data)==null?void 0:s.extent)}catch(i){ct(i),ht.getLogger(this).warn("Failed to fetch data extent",i)}});this._updatingHandles.addPromise(t.promise.then(()=>this._process())),this.addHandles(dt(()=>t.abort()))}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map(t=>t.debugInfo),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const[,t]of this._pendingTiles)t.alive=!1}_createPendingTiles(){if(this.suspended)return;const t=this._collectMissingTilesInfo();if(this._setAvailability(t==null?1:t.coveredArea/t.fullArea),t!=null)for(const{data:e,resolution:s}of t.missingTiles){const i=this._pendingTiles.get(e.id);i?(i.resolution=s,i.alive=!0):this._createPendingTile(e,s)}}_collectMissingTilesInfo(){let t=null;for(let e=this.tilesOfInterest.length-1;e>=0;e--){const s=this.tilesOfInterest[e],i=this.store.process(s,(r,n)=>this._verifyTileComplexity(r,n),this.outFields);t==null?t=i:t.prepend(i)}return t}_deletePendingTiles(){for(const[,t]of this._pendingTiles)t.alive||this._deletePendingTile(t)}_processPendingTiles(){const t={fetchCount:(e,s)=>this._fetchCount(e,s),fetchFeatures:(e,s,i)=>this._fetchFeatures(e,s,i),finish:(e,s)=>this._finishPendingTile(e,s),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(t))for(const[,e]of this._pendingTiles)this._verifyTileComplexity(this.store.getFeatureCount(e.data),e.resolution)&&this._updatingHandles.addPromise(e.process(t))}_verifyTileComplexity(t,e){return this._verifyVertexComplexity(t)&&this._verifyFeatureDensity(t,e)}_verifyVertexComplexity(t){return t*this._minimumVerticesPerFeature{t===r.attributes[e]&&(i=r.objectId??r.attributes[s])}),i==null)throw new Error(`Expected to find a feature with globalId ${t}`);return i}_queryFeaturesById(t,e){const s=this._createFeaturesQuery();return s.objectIds=t,this._queryFeatures(s,e)}_queryFeatures(t,e){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(t,e):this._queryFeaturesJSON(t,e)}async _queryFeaturesPBF(t,e){const{sourceSpatialReference:s}=this,{data:i}=await xt(this.url,t,new wt({sourceSpatialReference:s}),{query:this._configuration.customParameters,timeout:x,signal:e});return St(i)}async _queryFeaturesJSON(t,e){const{sourceSpatialReference:s}=this,{data:i}=await At(this.url,t,s,{query:this._configuration.customParameters,timeout:x,signal:e});return vt(i,this.objectIdField)}_createCountQuery(t){const e=this._createBaseQuery(t);return this.capabilities.query.supportsCacheHint&&(e.cacheHint=!0),e}_createFeaturesQuery(t=null){var r;const e=this._createBaseQuery(t),s=(t==null?void 0:t.data)!=null?this.store.getAttributesForTile((r=t==null?void 0:t.data)==null?void 0:r.id):null,i=U(pt(this.outFields,s??new Set),this._mandatoryOutFields);return e.outFields=Array.from(i),e.returnGeometry=!0,t!=null&&(this.capabilities.query.supportsResultType?e.resultType="tile":this.capabilities.query.supportsCacheHint&&(e.cacheHint=!0)),e}_createBaseQuery(t){const e=new v({returnZ:this.hasZ,returnM:!1,geometry:this.tileInfo!=null&&t!=null?ft(t.data.extent,this.tileInfo.spatialReference):void 0}),s=this._configuration.filter;return s!=null&&(e.where=s.where,e.gdbVersion=s.gdbVersion,e.timeExtent=s.timeExtent),e.outSpatialReference=this.spatialReference,e}_setPagingParameters(t,e,s){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:i,supportsCacheHint:r,tileMaxRecordCount:n,maxRecordCount:a,supportsResultType:o}=this.capabilities.query,l=i?v.MAX_MAX_RECORD_COUNT_FACTOR:1,c=l*((o||r)&&n?n:a||Wt);return t.start=e,i?(t.maxRecordCountFactor=Math.min(l,Math.ceil(s/c)),t.num=Math.min(s,t.maxRecordCountFactor*c)):t.num=Math.min(s,c),!0}};h([d({constructOnly:!0})],p.prototype,"url",void 0),h([d({constructOnly:!0})],p.prototype,"objectIdField",void 0),h([d({constructOnly:!0})],p.prototype,"globalIdField",void 0),h([d({constructOnly:!0})],p.prototype,"capabilities",void 0),h([d({constructOnly:!0})],p.prototype,"sourceSpatialReference",void 0),h([d({constructOnly:!0})],p.prototype,"spatialReference",void 0),h([d({constructOnly:!0})],p.prototype,"store",void 0),h([d({readOnly:!0})],p.prototype,"_minimumVerticesPerFeature",null),h([d()],p.prototype,"_mandatoryOutFields",null),h([d()],p.prototype,"outFields",null),h([d()],p.prototype,"suspended",void 0),h([d()],p.prototype,"filter",null),h([d()],p.prototype,"customParameters",null),h([d({readOnly:!0})],p.prototype,"_configuration",null),h([d()],p.prototype,"tileInfo",null),h([d()],p.prototype,"tileSize",null),h([d()],p.prototype,"tilesOfInterest",void 0),h([d({readOnly:!0})],p.prototype,"updating",null),h([d({readOnly:!0})],p.prototype,"updatingExcludingEdits",null),h([d({readOnly:!0})],p.prototype,"availability",void 0),h([d()],p.prototype,"hasZ",null),p=h([O("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],p);const Wt=2e3,x=6e5,Kt=1e6,Xt=25,Yt=1;class te{constructor(){this._store=new Map,this._byteSize=0}set(e,s){this.delete(e),this._store.set(e,s),this._byteSize+=s.byteSize}delete(e){const s=this._store.get(e);return!!this._store.delete(e)&&(s!=null&&(this._byteSize-=s.byteSize),!0)}get(e){return this._used(e),this._store.get(e)}has(e){return this._used(e),this._store.has(e)}clear(){this._store.clear()}applyByteSizeLimit(e,s){for(const[i,r]of this._store){if(this._byteSize<=e)break;this.delete(i),s(r)}}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}_used(e){const s=this._store.get(e);s&&(this._store.delete(e),this._store.set(e,s))}}let F=class extends P{constructor(t){super(t),this.tileInfo=null,this.extent=null,this.maximumByteSize=10*_t.MEGABYTES,this._tileBounds=new Rt,this._tiles=new te,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=Y()}add(t,e){var r;for(const n of e)this._referenceFeature(n.objectId);const s=this.featureStore.upsertMany(e),i=s.map(n=>new Set(Object.keys(n.attributes))).reduce((n,a)=>q(n,a),new Set(Object.keys(((r=s[0])==null?void 0:r.attributes)??[])));this._addTileStorage(t,new Set(s.map(n=>n.objectId)),ee(s),i),this._tiles.applyByteSizeLimit(this.maximumByteSize,n=>this._removeTileStorage(n))}getAttributesForTile(t){var e;return t?(e=this._tiles.get(t))==null?void 0:e.attributeKeys:null}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(t,e,s){return this._processEditsDelete(t.deletedFeatures.concat(t.updatedFeatures)),this._processEditsRefetch(t.addedFeatures.concat(t.updatedFeatures),e,s)}_addTileStorage(t,e,s,i){const r=t.id;this._tiles.set(r,new re(t,e,s,i)),this._tileBounds.set(r,t.extent),this._tileFeatureCounts.set(r,e.size)}_remove({id:t}){const e=this._tiles.get(t);e&&this._removeTileStorage(e)}_removeTileStorage(t){const e=[];for(const i of t.objectIds)this._unreferenceFeature(i)===C.REMOVED&&e.push(i);this.featureStore.removeManyById(e);const s=t.data.id;this._tiles.delete(s),this._tileBounds.delete(s)}_processEditsDelete(t){this.featureStore.removeManyById(t);for(const[,e]of this._tiles){for(const s of t)e.objectIds.delete(s);this._tileFeatureCounts.set(e.data.id,e.objectIds.size)}for(const e of t)this._refCounts.delete(e)}async _processEditsRefetch(t,e,s){const i=(await e(t,s)).features,{hasZ:r,hasM:n}=this.featureStore;for(const a of i){const o=It(this._tmpBoundingRect,a.geometry,r,n);o!=null&&this._tileBounds.forEachInBounds(o,l=>{const c=this._tiles.get(l);this.featureStore.add(a);const f=a.objectId;c.objectIds.has(f)||(c.objectIds.add(f),this._referenceFeature(f),this._tileFeatureCounts.set(c.data.id,c.objectIds.size))})}}process(t,e=()=>!0,s){if(this.tileInfo==null||!t.extent||this.extent!=null&&!D(z(this.extent,this._tmpBoundingRect),t.extent))return new H(t);const i=this.getAttributesForTile(t.id);if($(s,i))return new H(t);const r=this._createTileTree(t,this.tileInfo);return this._simplify(r,e,null,0,1),this._collectMissingTiles(t,r,this.tileInfo,s)}get debugInfo(){return Array.from(this._tiles.values()).map(({data:t})=>({data:t,featureCount:this._tileFeatureCounts.get(t.id)||0}))}getFeatureCount(t){return this._tileFeatureCounts.get(t.id)??0}async fetchCount(t,e,s,i){const r=this._tileFeatureCounts.get(t.id);if(r!=null)return r;const n=await $t(e,s,i);return this._tileFeatureCounts.set(t.id,n.data.count),n.data.count}_createTileTree(t,e){const s=new K(t.level,t.row,t.col);return e.updateTileInfo(s,w.ExtrapolateOptions.POWER_OF_TWO),this._tileBounds.forEachInBounds(t.extent,i=>{var n;const r=(n=this._tiles.get(i))==null?void 0:n.data;r&&this._tilesAreRelated(t,r)&&this._populateChildren(s,r,e,this._tileFeatureCounts.get(r.id)||0)}),s}_tilesAreRelated(t,e){if(!t||!e)return!1;if(t.level===e.level)return t.row===e.row&&t.col===e.col;const s=t.level>r,a=e.col>>r,o=t.row<<1,l=a-(t.col<<1)+(n-o<<1),c=t.children[l];if(c!=null)this._populateChildren(c,e,s,i);else{const f=new K(t.level+1,n,a);s.updateTileInfo(f,w.ExtrapolateOptions.POWER_OF_TWO),t.children[l]=f,this._populateChildren(f,e,s,i)}}_simplify(t,e,s,i,r){const n=r*r;if(t.isLeaf)return e(this.getFeatureCount(t),r)?0:(this._remove(t),s!=null&&(s.children[i]=null),n);const a=r/2,o=a*a;let l=0;for(let c=0;c{const n=this._tiles.get(r.id);if(n){s=s?q(s,n.attributeKeys):new Set(n.attributeKeys),i+=n.byteSize;for(const a of n.objectIds)e.has(a)||(e.add(a),this._referenceFeature(a));this._remove(r)}}),this._addTileStorage(t,e,i,s??new Set),t.isLeaf=!0,t.children[0]=t.children[1]=t.children[2]=t.children[3]=null,this._tileFeatureCounts.set(t.id,e.size)}_forEachLeaf(t,e){for(const s of t.children)s!=null&&(s.isLeaf?e(s):this._forEachLeaf(s,e))}_purge(t){if(t!=null)if(t.isLeaf)this._remove(t);else for(let e=0;e>1),(t.col<<1)+(1&o),a):this._collectMissingTilesRecurse(l,e,a,i)}}_referenceFeature(t){const e=(this._refCounts.get(t)||0)+1;return this._refCounts.set(t,e),e===1?C.ADDED:C.UNCHANGED}_unreferenceFeature(t){const e=(this._refCounts.get(t)||0)-1;return e===0?(this._refCounts.delete(t),C.REMOVED):(e>0&&this._refCounts.set(t,e),C.UNCHANGED)}get test(){return{tiles:Array.from(this._tiles.values()).map(t=>`${t.data.id}:[${Array.from(t.objectIds)}]`),featureReferences:Array.from(this._refCounts.keys()).map(t=>`${t}:${this._refCounts.get(t)}`)}}};function ee(t){return t.reduce((e,s)=>e+se(s),0)}function se(t){return 32+ie(t.geometry)+gt(t.attributes)}function ie(t){if(t==null)return 0;const e=B(t.lengths,4);return 32+B(t.coords,8)+e}h([d({constructOnly:!0})],F.prototype,"featureStore",void 0),h([d()],F.prototype,"tileInfo",void 0),h([d()],F.prototype,"extent",void 0),h([d()],F.prototype,"maximumByteSize",void 0),F=h([O("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],F);class re{constructor(e,s,i,r){this.data=e,this.objectIds=s,this.byteSize=i,this.attributeKeys=r}}let K=class{constructor(e,s,i){this.level=e,this.row=s,this.col=i,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(this.children[0]!=null||this.children[1]!=null||this.children[2]!=null||this.children[3]!=null)}};class H{constructor(e,s=[]){this.missingTiles=s,this.fullArea=0,this.coveredArea=0,this.fullArea=et(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}}let ne=class{constructor(e,s,i){this._tileInfo=e,this._extent=null,this.info=new H(s),i!=null&&(this._extent=z(i))}addMissing(e,s,i,r){const n=new yt(null,e,s,i);this._tileInfo.updateTileInfo(n,w.ExtrapolateOptions.POWER_OF_TWO),n.extent==null||this._extent!=null&&!D(this._extent,n.extent)||(this.info.missingTiles.push({data:n,resolution:r}),this.info.coveredArea-=et(n.extent))}};const ae=.18751;var C;(function(t){t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.UNCHANGED=2]="UNCHANGED"})(C||(C={}));let T=class extends mt.EventedAccessor{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=k(),this._elevationAligner=J(),this._elevationFilter=Q(),this._symbologyCandidatesFetcher=G(),this._updatingHandles=new R,this._editsUpdatingHandles=new R,this._pendingApplyEdits=new Map,this._alignPointsInFeatures=async(t,e)=>{const s={query:t},i=await this.remoteClient.invoke("alignElevation",s,{signal:e});return y(e),i},this._getSymbologyCandidates=async(t,e)=>{const s={candidates:t,spatialReference:this._spatialReference.toJSON()},i=await this.remoteClient.invoke("getSymbologyCandidates",s,{signal:e});return y(e),i}}get updating(){return this.updatingExcludingEdits||this._editsUpdatingHandles.updating||this._featureFetcher.updating}get updatingExcludingEdits(){return this._featureFetcher.updatingExcludingEdits||this._isInitializing||this._updatingHandles.updating}destroy(){var t,e,s;(t=this._featureFetcher)==null||t.destroy(),(e=this._queryEngine)==null||e.destroy(),(s=this._featureStore)==null||s.clear()}async setup(t){if(this.destroyed)return{result:{}};const{geometryType:e,objectIdField:s,timeInfo:i,fieldsIndex:r}=t.serviceInfo,{hasZ:n}=t,a=S.fromJSON(t.spatialReference);this._spatialReference=a,this._featureStore=new Tt({...t.serviceInfo,hasZ:n,hasM:!1}),this._queryEngine=new bt({spatialReference:t.spatialReference,featureStore:this._featureStore,geometryType:e,fieldsIndex:r,hasZ:n,hasM:!1,objectIdField:s,timeInfo:i}),this._featureFetcher=new p({store:new F({featureStore:this._featureStore}),url:t.serviceInfo.url,objectIdField:t.serviceInfo.objectIdField,globalIdField:t.serviceInfo.globalIdField,capabilities:t.serviceInfo.capabilities,spatialReference:a,sourceSpatialReference:S.fromJSON(t.serviceInfo.spatialReference),customParameters:t.configuration.customParameters});const o=t.configuration.viewType==="3d";return this._elevationAligner=J(o,{elevationInfo:t.elevationInfo!=null?Et.fromJSON(t.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures}),this._elevationFilter=Q(o),this.addHandles([V(()=>this._featureFetcher.availability,l=>this.emit("notify-availability",{availability:l}),tt),V(()=>this.updating,()=>this._notifyUpdating())]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(t.configuration)}async configure(t){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(t),E}async setSuspended(t,e){return await this._updatingHandles.addPromise(this._whenSetup.promise),y(e),this._featureFetcher.suspended=t,E}async updateOutFields(t,e){return await this._updatingHandles.addPromise(this._whenSetup.promise),y(e),this._featureFetcher.outFields=new Set(t??[]),E}async fetchCandidates(t,e){await this._whenSetup.promise,y(e);const s=oe(t),i=e==null?void 0:e.signal,r=await this._queryEngine.executeQueryForSnapping(s,i);y(i);const n=await this._elevationAligner.alignCandidates(r.candidates,S.fromJSON(t.point.spatialReference)??S.WGS84,i);y(i);const a=await this._symbologyCandidatesFetcher.fetch(n,i);y(i);const o=a.length===0?n:n.concat(a);return{result:{candidates:this._elevationFilter.filter(s,o)}}}async updateTiles(t,e){return await this._updatingHandles.addPromise(this._whenSetup.promise),y(e),this._featureFetcher.tileSize=t.tileSize,this._featureFetcher.tilesOfInterest=t.tiles,this._featureFetcher.tileInfo=t.tileInfo!=null?w.fromJSON(t.tileInfo):null,E}async refresh(t,e){return await this._updatingHandles.addPromise(this._whenSetup.promise),y(e),this._featureFetcher.refresh(),E}async whenNotUpdating(t,e){return await this._updatingHandles.addPromise(this._whenSetup.promise),y(e),await Ft(()=>!this.updatingExcludingEdits,e),y(e),E}async getDebugInfo(t,e){return y(e),{result:this._featureFetcher.debugInfo}}async beginApplyEdits(t,e){this._updatingHandles.addPromise(this._whenSetup.promise),y(e);const s=k();return this._pendingApplyEdits.set(t.id,s),this._featureFetcher.applyEdits(s.promise),this._editsUpdatingHandles.addPromise(s.promise),E}async endApplyEdits(t,e){const s=this._pendingApplyEdits.get(t.id);return s&&s.resolve(t.edits),y(e),E}async notifyElevationSourceChange(t,e){return this._elevationAligner.notifyElevationSourceChange(),E}async notifySymbologyChange(t,e){return this._symbologyCandidatesFetcher.notifySymbologyChange(),E}async setSymbologySnappingSupported(t){return this._symbologyCandidatesFetcher=G(t,this._getSymbologyCandidates),E}_updateFeatureFetcherConfiguration(t){this._featureFetcher.filter=t.filter!=null?v.fromJSON(t.filter):null,this._featureFetcher.customParameters=t.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};h([d({readOnly:!0})],T.prototype,"updating",null),h([d({readOnly:!0})],T.prototype,"updatingExcludingEdits",null),h([d()],T.prototype,"_isInitializing",void 0),T=h([O("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],T);const qe=T;function oe(t){if(!t.filter)return{...t,query:{where:"1=1"}};const{distance:e,units:s,spatialRel:i,where:r,timeExtent:n,objectIds:a}=t.filter,o={geometry:t.filter.geometry?Ct(t.filter.geometry):void 0,distance:e,units:s,spatialRel:i,timeExtent:n,objectIds:a,where:r??"1=1"};return{...t,query:o}}const E={result:{}};export{qe as default}; diff --git a/assets/FeatureSet-CYJUZgOk.js b/assets/FeatureSet-opEn8ou8.js similarity index 98% rename from assets/FeatureSet-CYJUZgOk.js rename to assets/FeatureSet-opEn8ou8.js index c79965f..cdf7894 100644 --- a/assets/FeatureSet-CYJUZgOk.js +++ b/assets/FeatureSet-opEn8ou8.js @@ -1 +1 @@ -import{aY as j,d as h,y as d,j as N,aZ as S,a_ as F,aR as T,a$ as P,aS as w,f as q,aU as J,b0 as O,aV as M,ab as v}from"./index-CEWggaxV.js";var G;const z=new j({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let c=G=class extends J{constructor(r){super(r),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(r,a){var s;const o=w.fromJSON(a.spatialReference),e=[];for(let t=0;t0)for(let o=0;oMath.round((n-e)/a),l=n=>Math.round((s-n)/o),f=this.features,u=this._getQuantizationFunction(this.geometryType,t,l);for(let n=0,y=f.length;np*t+e,u=p=>s-p*l;let n=null,y=null;if(this.hasZ&&((m=o==null?void 0:o.scale)==null?void 0:m[2])!=null){const{translate:[,,p],scale:[,,R]}=o;n=x=>x*R+p}if(this.hasM&&((g=o==null?void 0:o.scale)==null?void 0:g[3])!=null){const{translate:[,,,p],scale:[,,,R]}=o;y=x=>x==null?x:x*R+p}const i=this._getHydrationFunction(r,f,u,n,y);for(const{geometry:p}of a)p!=null&&i&&i(p);return this.transform=null,this}_quantizePoints(r,a,o){let e,s;const t=[];for(let l=0,f=r.length;l0){const n=a(u[0]),y=o(u[1]);n===e&&y===s||(t.push([n-e,y-s]),e=n,s=y)}else e=a(u[0]),s=o(u[1]),t.push([e,s])}return t.length>0?t:null}_getQuantizationFunction(r,a,o){return r==="point"?e=>(e.x=a(e.x),e.y=o(e.y),e):r==="polyline"||r==="polygon"?e=>{const s=v(e)?e.rings:e.paths,t=[];for(let l=0,f=s.length;l0?(v(e)?e.rings=t:e.paths=t,e):null}:r==="multipoint"?e=>{const s=this._quantizePoints(e.points,a,o);return s&&s.length>0?(e.points=s,e):null}:r==="extent"?e=>e:null}_getHydrationFunction(r,a,o,e,s){return r==="point"?t=>{t.x=a(t.x),t.y=o(t.y),e&&(t.z=e(t.z))}:r==="polyline"||r==="polygon"?t=>{const l=v(t)?t.rings:t.paths;let f,u;for(let n=0,y=l.length;n0?(f+=p[0],u+=p[1]):(f=p[0],u=p[1]),p[0]=a(f),p[1]=o(u)}}if(e&&s)for(let n=0,y=l.length;n{t.xmin=a(t.xmin),t.ymin=o(t.ymin),t.xmax=a(t.xmax),t.ymax=o(t.ymax),e&&t.zmax!=null&&t.zmin!=null&&(t.zmax=e(t.zmax),t.zmin=e(t.zmin)),s&&t.mmax!=null&&t.mmin!=null&&(t.mmax=s(t.mmax),t.mmin=s(t.mmin))}:r==="multipoint"?t=>{const l=t.points;let f,u;for(let n=0,y=l.length;n0?(f+=i[0],u+=i[1]):(f=i[0],u=i[1]),i[0]=a(f),i[1]=o(u)}if(e&&s)for(let n=0,y=l.length;n({enabled:r})}}})],c.prototype,"exceededTransferLimit",void 0),h([d({type:[N],json:{write:!0}})],c.prototype,"features",void 0),h([S("features")],c.prototype,"readFeatures",null),h([d({type:[F],json:{write:!0}})],c.prototype,"fields",void 0),h([d({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:z.read}}})],c.prototype,"geometryType",void 0),h([T("geometryType")],c.prototype,"writeGeometryType",null),h([d({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],c.prototype,"hasM",void 0),h([d({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],c.prototype,"hasZ",void 0),h([d({types:P,json:{write:!0}})],c.prototype,"queryGeometry",void 0),h([S("queryGeometry")],c.prototype,"readQueryGeometry",null),h([d({type:w,json:{write:!0}})],c.prototype,"spatialReference",void 0),h([T("spatialReference")],c.prototype,"writeSpatialReference",null),h([d({json:{write:!0}})],c.prototype,"transform",void 0),c=G=h([q("esri.rest.support.FeatureSet")],c),c.prototype.toJSON.isDefaultToJSON=!0;const $=c;export{$ as d}; +import{aY as j,d as h,y as d,j as N,aZ as S,a_ as F,aR as T,a$ as P,aS as w,f as q,aU as J,b0 as O,aV as M,ab as v}from"./index-BjUNJPVf.js";var G;const z=new j({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let c=G=class extends J{constructor(r){super(r),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(r,a){var s;const o=w.fromJSON(a.spatialReference),e=[];for(let t=0;t0)for(let o=0;oMath.round((n-e)/a),l=n=>Math.round((s-n)/o),f=this.features,u=this._getQuantizationFunction(this.geometryType,t,l);for(let n=0,y=f.length;np*t+e,u=p=>s-p*l;let n=null,y=null;if(this.hasZ&&((m=o==null?void 0:o.scale)==null?void 0:m[2])!=null){const{translate:[,,p],scale:[,,R]}=o;n=x=>x*R+p}if(this.hasM&&((g=o==null?void 0:o.scale)==null?void 0:g[3])!=null){const{translate:[,,,p],scale:[,,,R]}=o;y=x=>x==null?x:x*R+p}const i=this._getHydrationFunction(r,f,u,n,y);for(const{geometry:p}of a)p!=null&&i&&i(p);return this.transform=null,this}_quantizePoints(r,a,o){let e,s;const t=[];for(let l=0,f=r.length;l0){const n=a(u[0]),y=o(u[1]);n===e&&y===s||(t.push([n-e,y-s]),e=n,s=y)}else e=a(u[0]),s=o(u[1]),t.push([e,s])}return t.length>0?t:null}_getQuantizationFunction(r,a,o){return r==="point"?e=>(e.x=a(e.x),e.y=o(e.y),e):r==="polyline"||r==="polygon"?e=>{const s=v(e)?e.rings:e.paths,t=[];for(let l=0,f=s.length;l0?(v(e)?e.rings=t:e.paths=t,e):null}:r==="multipoint"?e=>{const s=this._quantizePoints(e.points,a,o);return s&&s.length>0?(e.points=s,e):null}:r==="extent"?e=>e:null}_getHydrationFunction(r,a,o,e,s){return r==="point"?t=>{t.x=a(t.x),t.y=o(t.y),e&&(t.z=e(t.z))}:r==="polyline"||r==="polygon"?t=>{const l=v(t)?t.rings:t.paths;let f,u;for(let n=0,y=l.length;n0?(f+=p[0],u+=p[1]):(f=p[0],u=p[1]),p[0]=a(f),p[1]=o(u)}}if(e&&s)for(let n=0,y=l.length;n{t.xmin=a(t.xmin),t.ymin=o(t.ymin),t.xmax=a(t.xmax),t.ymax=o(t.ymax),e&&t.zmax!=null&&t.zmin!=null&&(t.zmax=e(t.zmax),t.zmin=e(t.zmin)),s&&t.mmax!=null&&t.mmin!=null&&(t.mmax=s(t.mmax),t.mmin=s(t.mmin))}:r==="multipoint"?t=>{const l=t.points;let f,u;for(let n=0,y=l.length;n0?(f+=i[0],u+=i[1]):(f=i[0],u=i[1]),i[0]=a(f),i[1]=o(u)}if(e&&s)for(let n=0,y=l.length;n({enabled:r})}}})],c.prototype,"exceededTransferLimit",void 0),h([d({type:[N],json:{write:!0}})],c.prototype,"features",void 0),h([S("features")],c.prototype,"readFeatures",null),h([d({type:[F],json:{write:!0}})],c.prototype,"fields",void 0),h([d({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:z.read}}})],c.prototype,"geometryType",void 0),h([T("geometryType")],c.prototype,"writeGeometryType",null),h([d({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],c.prototype,"hasM",void 0),h([d({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],c.prototype,"hasZ",void 0),h([d({types:P,json:{write:!0}})],c.prototype,"queryGeometry",void 0),h([S("queryGeometry")],c.prototype,"readQueryGeometry",null),h([d({type:w,json:{write:!0}})],c.prototype,"spatialReference",void 0),h([T("spatialReference")],c.prototype,"writeSpatialReference",null),h([d({json:{write:!0}})],c.prototype,"transform",void 0),c=G=h([q("esri.rest.support.FeatureSet")],c),c.prototype.toJSON.isDefaultToJSON=!0;const $=c;export{$ as d}; diff --git a/assets/FeatureStore-CqSz6SOQ.js b/assets/FeatureStore-CRMzrhIt.js similarity index 92% rename from assets/FeatureStore-CqSz6SOQ.js rename to assets/FeatureStore-CRMzrhIt.js index 865736d..39a4b1f 100644 --- a/assets/FeatureStore-CqSz6SOQ.js +++ b/assets/FeatureStore-CRMzrhIt.js @@ -1 +1 @@ -import{bF as u,ca as f,q as l,cb as m,s as a,N as n,ai as d}from"./index-CEWggaxV.js";import{g as h}from"./featureConversionUtils-CmP9mw0r.js";import{o as g}from"./BoundsStore-DMoG4U0L.js";import{h as _}from"./timeSupport-BjRbXIpn.js";import{o as y}from"./QueryEngine-RpcY23Sv.js";const c=u();class F{constructor(e){this.geometryInfo=e,this._boundsStore=new g,this._featuresById=new Map,this._markedIds=new Set,this.events=new f,this.featureAdapter=y}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach(t=>{t.geometry!=null&&t.geometry.coords&&(e+=t.geometry.coords.length)}),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(this.fullBounds==null)return null;const[t,s,r,o]=this.fullBounds;return{xmin:t,ymin:s,xmax:r,ymax:o,spatialReference:_(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}upsertMany(e){const t=e.map(s=>this._upsert(s));return this._emitChanged(),t.filter(l)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const s=this._featuresById.get(t);s&&this._remove(s)}this._emitChanged()}forEachBounds(e,t){for(const s of e){const r=this._boundsStore.get(s.objectId);r&&t(m(c,r))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach(t=>e(t))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,s=>{t(this._featuresById.get(s))})}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach((t,s)=>{this._markedIds.has(s)||(e=!0,this._remove(t))}),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){var o,i;if(!e)return;const t=e.objectId;if(t==null)return void a.getLogger("esri.layers.graphics.data.FeatureStore").error(new n("featurestore:invalid-feature","feature id is missing",{feature:e}));const s=this._featuresById.get(t);let r;if(this._markedIds.add(t),s?(e.displayId=s.displayId,r=this._boundsStore.get(t),this._boundsStore.delete(t)):this.onFeatureAdd!=null&&this.onFeatureAdd(e),!((i=(o=e.geometry)==null?void 0:o.coords)!=null&&i.length))return this._boundsStore.set(t,null),void this._featuresById.set(t,e);r=h(r??d(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),r!=null&&this._boundsStore.set(t,r),this._featuresById.set(t,e)}_upsert(e){const t=e==null?void 0:e.objectId;if(t==null)return a.getLogger("esri.layers.graphics.data.FeatureStore").error(new n("featurestore:invalid-feature","feature id is missing",{feature:e})),null;const s=this._featuresById.get(t);if(!s)return this._add(e),e;this._markedIds.add(t);const{geometry:r,attributes:o}=e;for(const i in o)s.attributes[i]=o[i];return r&&(s.geometry=r,this._boundsStore.set(t,h(d(),r,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),s}_remove(e){this.onFeatureRemove!=null&&this.onFeatureRemove(e);const t=e.objectId;return this._markedIds.delete(t),this._boundsStore.delete(t),this._featuresById.delete(t),e}}export{F as m}; +import{bF as u,ca as f,q as l,cb as m,s as a,N as n,ai as d}from"./index-BjUNJPVf.js";import{g as h}from"./featureConversionUtils-BHhm7bvm.js";import{o as g}from"./BoundsStore-DRDtG3Mk.js";import{h as _}from"./timeSupport-DXkhlToK.js";import{o as y}from"./QueryEngine-loUu1VUW.js";const c=u();class F{constructor(e){this.geometryInfo=e,this._boundsStore=new g,this._featuresById=new Map,this._markedIds=new Set,this.events=new f,this.featureAdapter=y}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach(t=>{t.geometry!=null&&t.geometry.coords&&(e+=t.geometry.coords.length)}),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(this.fullBounds==null)return null;const[t,s,r,o]=this.fullBounds;return{xmin:t,ymin:s,xmax:r,ymax:o,spatialReference:_(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}upsertMany(e){const t=e.map(s=>this._upsert(s));return this._emitChanged(),t.filter(l)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const s=this._featuresById.get(t);s&&this._remove(s)}this._emitChanged()}forEachBounds(e,t){for(const s of e){const r=this._boundsStore.get(s.objectId);r&&t(m(c,r))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach(t=>e(t))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,s=>{t(this._featuresById.get(s))})}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach((t,s)=>{this._markedIds.has(s)||(e=!0,this._remove(t))}),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){var o,i;if(!e)return;const t=e.objectId;if(t==null)return void a.getLogger("esri.layers.graphics.data.FeatureStore").error(new n("featurestore:invalid-feature","feature id is missing",{feature:e}));const s=this._featuresById.get(t);let r;if(this._markedIds.add(t),s?(e.displayId=s.displayId,r=this._boundsStore.get(t),this._boundsStore.delete(t)):this.onFeatureAdd!=null&&this.onFeatureAdd(e),!((i=(o=e.geometry)==null?void 0:o.coords)!=null&&i.length))return this._boundsStore.set(t,null),void this._featuresById.set(t,e);r=h(r??d(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),r!=null&&this._boundsStore.set(t,r),this._featuresById.set(t,e)}_upsert(e){const t=e==null?void 0:e.objectId;if(t==null)return a.getLogger("esri.layers.graphics.data.FeatureStore").error(new n("featurestore:invalid-feature","feature id is missing",{feature:e})),null;const s=this._featuresById.get(t);if(!s)return this._add(e),e;this._markedIds.add(t);const{geometry:r,attributes:o}=e;for(const i in o)s.attributes[i]=o[i];return r&&(s.geometry=r,this._boundsStore.set(t,h(d(),r,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),s}_remove(e){this.onFeatureRemove!=null&&this.onFeatureRemove(e);const t=e.objectId;return this._markedIds.delete(t),this._boundsStore.delete(t),this._featuresById.delete(t),e}}export{F as m}; diff --git a/assets/FeatureTemplate-DcprAdTM.js b/assets/FeatureTemplate-FZNGA_Ik.js similarity index 94% rename from assets/FeatureTemplate-DcprAdTM.js rename to assets/FeatureTemplate-FZNGA_Ik.js index c04f474..7970f99 100644 --- a/assets/FeatureTemplate-DcprAdTM.js +++ b/assets/FeatureTemplate-FZNGA_Ik.js @@ -1 +1 @@ -import{aY as l,b4 as a,d as o,y as r,f as s,aU as n}from"./index-CEWggaxV.js";const t=new l({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let e=class extends a(n){constructor(i){super(i),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};o([r({json:{write:!0}})],e.prototype,"name",void 0),o([r({json:{write:!0}})],e.prototype,"description",void 0),o([r({json:{read:t.read,write:t.write}})],e.prototype,"drawingTool",void 0),o([r({json:{write:!0}})],e.prototype,"prototype",void 0),o([r({json:{write:!0}})],e.prototype,"thumbnail",void 0),e=o([s("esri.layers.support.FeatureTemplate")],e);const d=e;export{d as p}; +import{aY as l,b4 as a,d as o,y as r,f as s,aU as n}from"./index-BjUNJPVf.js";const t=new l({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let e=class extends a(n){constructor(i){super(i),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};o([r({json:{write:!0}})],e.prototype,"name",void 0),o([r({json:{write:!0}})],e.prototype,"description",void 0),o([r({json:{read:t.read,write:t.write}})],e.prototype,"drawingTool",void 0),o([r({json:{write:!0}})],e.prototype,"prototype",void 0),o([r({json:{write:!0}})],e.prototype,"thumbnail",void 0),e=o([s("esri.layers.support.FeatureTemplate")],e);const d=e;export{d as p}; diff --git a/assets/FeatureType-By3BEr9z.js b/assets/FeatureType-CwUl8Nf5.js similarity index 85% rename from assets/FeatureType-By3BEr9z.js rename to assets/FeatureType-CwUl8Nf5.js index a61cd0c..2c97896 100644 --- a/assets/FeatureType-By3BEr9z.js +++ b/assets/FeatureType-CwUl8Nf5.js @@ -1 +1 @@ -import{b4 as p,b5 as l,d as s,y as i,aZ as m,aR as d,f as c,aU as y}from"./index-CEWggaxV.js";import{p as u}from"./FeatureTemplate-DcprAdTM.js";let t=class extends p(y){constructor(o){super(o),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(o){const r={};for(const e of Object.keys(o))r[e]=l(o[e]);return r}writeDomains(o,r){var a;const e={};for(const n of Object.keys(o))o[n]&&(e[n]=(a=o[n])==null?void 0:a.toJSON());r.domains=e}};s([i({json:{write:!0}})],t.prototype,"id",void 0),s([i({json:{write:!0}})],t.prototype,"name",void 0),s([i({json:{write:!0}})],t.prototype,"domains",void 0),s([m("domains")],t.prototype,"readDomains",null),s([d("domains")],t.prototype,"writeDomains",null),s([i({type:[u],json:{write:!0}})],t.prototype,"templates",void 0),t=s([c("esri.layers.support.FeatureType")],t);const w=t;export{w as n}; +import{b4 as p,b5 as l,d as s,y as i,aZ as m,aR as d,f as c,aU as y}from"./index-BjUNJPVf.js";import{p as u}from"./FeatureTemplate-FZNGA_Ik.js";let t=class extends p(y){constructor(o){super(o),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(o){const r={};for(const e of Object.keys(o))r[e]=l(o[e]);return r}writeDomains(o,r){var a;const e={};for(const n of Object.keys(o))o[n]&&(e[n]=(a=o[n])==null?void 0:a.toJSON());r.domains=e}};s([i({json:{write:!0}})],t.prototype,"id",void 0),s([i({json:{write:!0}})],t.prototype,"name",void 0),s([i({json:{write:!0}})],t.prototype,"domains",void 0),s([m("domains")],t.prototype,"readDomains",null),s([d("domains")],t.prototype,"writeDomains",null),s([i({type:[u],json:{write:!0}})],t.prototype,"templates",void 0),t=s([c("esri.layers.support.FeatureType")],t);const w=t;export{w as n}; diff --git a/assets/FieldsIndex-CLgRNeJ_.js b/assets/FieldsIndex-CK-0B5n9.js similarity index 96% rename from assets/FieldsIndex-CLgRNeJ_.js rename to assets/FieldsIndex-CK-0B5n9.js index d19a86b..856845c 100644 --- a/assets/FieldsIndex-CLgRNeJ_.js +++ b/assets/FieldsIndex-CK-0B5n9.js @@ -1 +1 @@ -import{O as M,Q as S,R as y,S as g,T as O,s as b,N as B,W as c,X as f,Y as q,Z as z,a0 as R,a1 as $,a2 as D,a3 as I,a4 as h}from"./index-CEWggaxV.js";import{t as L}from"./UnknownTimeZone-DF0BqWCR.js";function x(s){return"timeZone"in s}function J(s){return"timeZone"in s}function A(s){return"dateFieldsTimeZone"in s}const v=new Map;class u{static fromJSON(e){return new u(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new u(e.fields??[],T(e))}static fromLayerJSON(e){return new u(e.fields??[],T(e))}constructor(e=[],i){var l;this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=i?new Map(i):null;const n=[];for(const t of this.fields){const a=t==null?void 0:t.name,r=_(a);if(a&&r){const o=d(a);this._fieldsMap.set(a,t),this._fieldsMap.set(o,t),this._normalizedFieldsMap.set(r,t),n.push(`${o}:${t.type}:${(l=this._timeZoneByFieldName)==null?void 0:l.get(a)}`),M(t)?(this.dateFields.push(t),this._dateFieldsSet.add(t)):S(t)&&(this._numericFieldsSet.add(t),this.numericFields.push(t)),y(t)||g(t)||(t.editable=t.editable==null||!!t.editable,t.nullable=t.nullable==null||!!t.nullable)}}n.sort(),this.uid=n.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)y(e)||g(e)||e.nullable||O(e)!==void 0||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===(e==null?void 0:e.uid)}has(e){return this.get(e)!=null}get(e){if(!e)return;let i=this._fieldsMap.get(e);return i||(i=this._fieldsMap.get(d(e))??this._normalizedFieldsMap.get(_(e)),i&&this._fieldsMap.set(e,i),i)}getTimeZone(e){const i=this.get(e&&typeof e!="string"?e.name:e);return i?this._timeZoneByFieldName?this._timeZoneByFieldName.get(i.name):i.type==="date"||i.type==="esriFieldTypeDate"?(b.getLogger("esri.layers.support.FieldsIndex").error(new B("getTimeZone:no-timezone-information",`no time zone information for field '${i.name}'`)),c):Z.has(i.type)?f:null:null}getLuxonTimeZone(e){const i=this.getTimeZone(e);return i?i===f?L.instance:i===c?q.utcInstance:z(v,i,()=>R.create(i)):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return $(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){var i;return((i=this.get(e))==null?void 0:i.name)??void 0}toJSON(){return{fields:this.fields.map(e=>D(e)?e.toJSON():e),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}function d(s){return s.trim().toLowerCase()}function _(s){var e;return((e=I(s))==null?void 0:e.toLowerCase())??""}const Z=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function T(s){const e=new Map;if(!s.fields)return e;const i=s.datesInUnknownTimezone===!0,{timeInfo:n,editFieldsInfo:l}=s,t=(n?"startField"in n?n.startField:n.startTimeField:"")??"",a=(n?"endField"in n?n.endField:n.endTimeField:"")??"",r=A(s)?s.dateFieldsTimeZone??null:s.dateFieldsTimeReference?h(s.dateFieldsTimeReference):null,o=l?x(l)?l.timeZone??r:l.dateFieldsTimeReference?h(l.dateFieldsTimeReference):r??c:null,p=n?J(n)?n.timeZone??r:n.timeReference?h(n.timeReference):r:null,w=new Map([[d((l==null?void 0:l.creationDateField)??""),o],[d((l==null?void 0:l.editDateField)??""),o],[d(t),p],[d(a),p]]);for(const{name:m,type:F}of s.fields)if(Z.has(F))e.set(m,f);else if(F!=="date"&&F!=="esriFieldTypeDate")e.set(m,null);else if(i)e.set(m,f);else{const N=w.get(d(m??""))??r;e.set(m,N)}return e}export{u as Z}; +import{O as M,Q as S,R as y,S as g,T as O,s as b,N as B,W as c,X as f,Y as q,Z as z,a0 as R,a1 as $,a2 as D,a3 as I,a4 as h}from"./index-BjUNJPVf.js";import{t as L}from"./UnknownTimeZone-CK7VjgF3.js";function x(s){return"timeZone"in s}function J(s){return"timeZone"in s}function A(s){return"dateFieldsTimeZone"in s}const v=new Map;class u{static fromJSON(e){return new u(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new u(e.fields??[],T(e))}static fromLayerJSON(e){return new u(e.fields??[],T(e))}constructor(e=[],i){var l;this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=i?new Map(i):null;const n=[];for(const t of this.fields){const a=t==null?void 0:t.name,r=_(a);if(a&&r){const o=d(a);this._fieldsMap.set(a,t),this._fieldsMap.set(o,t),this._normalizedFieldsMap.set(r,t),n.push(`${o}:${t.type}:${(l=this._timeZoneByFieldName)==null?void 0:l.get(a)}`),M(t)?(this.dateFields.push(t),this._dateFieldsSet.add(t)):S(t)&&(this._numericFieldsSet.add(t),this.numericFields.push(t)),y(t)||g(t)||(t.editable=t.editable==null||!!t.editable,t.nullable=t.nullable==null||!!t.nullable)}}n.sort(),this.uid=n.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)y(e)||g(e)||e.nullable||O(e)!==void 0||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===(e==null?void 0:e.uid)}has(e){return this.get(e)!=null}get(e){if(!e)return;let i=this._fieldsMap.get(e);return i||(i=this._fieldsMap.get(d(e))??this._normalizedFieldsMap.get(_(e)),i&&this._fieldsMap.set(e,i),i)}getTimeZone(e){const i=this.get(e&&typeof e!="string"?e.name:e);return i?this._timeZoneByFieldName?this._timeZoneByFieldName.get(i.name):i.type==="date"||i.type==="esriFieldTypeDate"?(b.getLogger("esri.layers.support.FieldsIndex").error(new B("getTimeZone:no-timezone-information",`no time zone information for field '${i.name}'`)),c):Z.has(i.type)?f:null:null}getLuxonTimeZone(e){const i=this.getTimeZone(e);return i?i===f?L.instance:i===c?q.utcInstance:z(v,i,()=>R.create(i)):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return $(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){var i;return((i=this.get(e))==null?void 0:i.name)??void 0}toJSON(){return{fields:this.fields.map(e=>D(e)?e.toJSON():e),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}function d(s){return s.trim().toLowerCase()}function _(s){var e;return((e=I(s))==null?void 0:e.toLowerCase())??""}const Z=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function T(s){const e=new Map;if(!s.fields)return e;const i=s.datesInUnknownTimezone===!0,{timeInfo:n,editFieldsInfo:l}=s,t=(n?"startField"in n?n.startField:n.startTimeField:"")??"",a=(n?"endField"in n?n.endField:n.endTimeField:"")??"",r=A(s)?s.dateFieldsTimeZone??null:s.dateFieldsTimeReference?h(s.dateFieldsTimeReference):null,o=l?x(l)?l.timeZone??r:l.dateFieldsTimeReference?h(l.dateFieldsTimeReference):r??c:null,p=n?J(n)?n.timeZone??r:n.timeReference?h(n.timeReference):r:null,w=new Map([[d((l==null?void 0:l.creationDateField)??""),o],[d((l==null?void 0:l.editDateField)??""),o],[d(t),p],[d(a),p]]);for(const{name:m,type:F}of s.fields)if(Z.has(F))e.set(m,f);else if(F!=="date"&&F!=="esriFieldTypeDate")e.set(m,null);else if(i)e.set(m,f);else{const N=w.get(d(m??""))??r;e.set(m,N)}return e}export{u as Z}; diff --git a/assets/FormTemplate-eV18QveB.js b/assets/FormTemplate-BGxtsGX6.js similarity index 99% rename from assets/FormTemplate-eV18QveB.js rename to assets/FormTemplate-BGxtsGX6.js index 95f0b7d..c9207fd 100644 --- a/assets/FormTemplate-eV18QveB.js +++ b/assets/FormTemplate-BGxtsGX6.js @@ -1 +1 @@ -import{d as t,y as i,f as o,aU as V,aZ as l,aR as a,kZ as ft,b5 as bt,k_ as $t,aV as N,k$ as jt,e1 as ht}from"./index-CEWggaxV.js";var q;let w=q=class extends V{constructor(e){super(e),this.expression=null,this.name=null,this.returnType="boolean",this.title=null}clone(){return new q({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};t([i({type:String,json:{write:!0}})],w.prototype,"expression",void 0),t([i({type:String,json:{write:!0}})],w.prototype,"name",void 0),t([i({type:["boolean","date","number","string"],json:{write:!0}})],w.prototype,"returnType",void 0),t([i({type:String,json:{write:!0}})],w.prototype,"title",void 0),w=q=t([o("esri.form.ExpressionInfo")],w);const gt=w;let v=class extends V{constructor(n){super(n),this.description=null,this.label=null,this.type=null,this.visibilityExpression=null}};t([i({type:String,json:{write:!0}})],v.prototype,"description",void 0),t([i({type:String,json:{write:!0}})],v.prototype,"label",void 0),t([i()],v.prototype,"type",void 0),t([i({type:String,json:{write:!0}})],v.prototype,"visibilityExpression",void 0),v=t([o("esri.form.elements.Element")],v);const b=v;var H;let R=H=class extends V{constructor(e){super(e),this.type=null}clone(){return new H({type:this.type})}};t([i({type:["attachment","audio","document","image","signature","video"],json:{write:!0}})],R.prototype,"type",void 0),R=H=t([o("esri.form.elements.inputs.AttachmentInput")],R);const Et=R;var K;let f=K=class extends b{constructor(e){super(e),this.attachmentKeyword=null,this.editableExpression=null,this.input=null,this.type="attachment"}clone(){return new K({attachmentKeyword:this.attachmentKeyword,description:this.description,editableExpression:this.editableExpression,input:this.input,label:this.label,visibilityExpression:this.visibilityExpression})}};t([i({type:String,json:{write:!0}})],f.prototype,"attachmentKeyword",void 0),t([i({type:String,json:{write:!0}})],f.prototype,"editableExpression",void 0),t([i({type:Et,json:{read:{source:"inputType"},write:{target:"inputType"}}})],f.prototype,"input",void 0),t([i({type:["attachment"],json:{read:!1,write:!0}})],f.prototype,"type",void 0),f=K=t([o("esri.form.elements.AttachmentElement")],f);const rt=f;let L=class extends V{constructor(e){super(e),this.type=null}};t([i()],L.prototype,"type",void 0),L=t([o("esri.form.elements.inputs.Input")],L);const c=L;let T=class extends c{constructor(n){super(n),this.maxLength=null,this.minLength=0}};t([i({type:Number,json:{write:!0}})],T.prototype,"maxLength",void 0),t([i({type:Number,json:{write:!0}})],T.prototype,"minLength",void 0),T=t([o("esri.form.elements.inputs.TextInput")],T);const st=T;var P;let O=P=class extends st{constructor(e){super(e),this.type="barcode-scanner"}clone(){return new P({maxLength:this.maxLength,minLength:this.minLength})}};t([i({type:["barcode-scanner"],json:{read:!1,write:!0}})],O.prototype,"type",void 0),O=P=t([o("esri.form.elements.inputs.BarcodeScannerInput")],O);const St=O;var A;let j=A=class extends c{constructor(e){super(e),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="combo-box"}clone(){return new A({showNoValueOption:this.showNoValueOption,noValueOptionLabel:this.noValueOptionLabel})}};t([i({type:String,json:{write:!0}})],j.prototype,"noValueOptionLabel",void 0),t([i({type:Boolean,json:{write:!0}})],j.prototype,"showNoValueOption",void 0),t([i({type:["combo-box"],json:{read:!1,write:!0}})],j.prototype,"type",void 0),j=A=t([o("esri.form.elements.inputs.ComboBoxInput")],j);const Mt=j;var _;function pt(e){return e??null}function lt(e){return e??null}let m=_=class extends c{constructor(e){super(e),this.max=null,this.min=null,this.type="date-picker"}readMax(e,n){return pt(n.max)}writeMax(e,n){n.max=lt(e)}readMin(e,n){return pt(n.min)}writeMin(e,n){n.min=lt(e)}clone(){return new _({max:this.max,min:this.min})}};t([i({type:String,json:{type:String,write:!0}})],m.prototype,"max",void 0),t([l("max")],m.prototype,"readMax",null),t([a("max")],m.prototype,"writeMax",null),t([i({type:String,json:{type:String,write:!0}})],m.prototype,"min",void 0),t([l("min")],m.prototype,"readMin",null),t([a("min")],m.prototype,"writeMin",null),t([i({type:["date-picker"],json:{read:!1,write:!0}})],m.prototype,"type",void 0),m=_=t([o("esri.form.elements.inputs.DatePickerInput")],m);const Tt=m;var J;function B(e){return e??null}function F(e){return e??null}let s=J=class extends c{constructor(e){super(e),this.includeTimeOffset=!0,this.max=null,this.min=null,this.timeResolution="minutes",this.type="datetimeoffset-picker"}readMax(e,n){return B(n.max)}writeMax(e,n){n.max=F(e)}readMin(e,n){return B(n.min)}writeMin(e,n){n.min=F(e)}readTimeResolution(e,n){return B(n.timeResolution)}writeTimeResolution(e,n){n.timeResolution=F(e)}clone(){return new J({includeTimeOffset:this.includeTimeOffset,max:this.max,min:this.min,timeResolution:this.timeResolution})}};t([i({type:Boolean,json:{write:!0}})],s.prototype,"includeTimeOffset",void 0),t([i({type:String,json:{type:String,write:!0}})],s.prototype,"max",void 0),t([l("max")],s.prototype,"readMax",null),t([a("max")],s.prototype,"writeMax",null),t([i({type:String,json:{type:String,write:!0}})],s.prototype,"min",void 0),t([l("min")],s.prototype,"readMin",null),t([a("min")],s.prototype,"writeMin",null),t([i({type:String,json:{type:String,write:!0}})],s.prototype,"timeResolution",void 0),t([l("timeResolution")],s.prototype,"readTimeResolution",null),t([a("timeResolution")],s.prototype,"writeTimeResolution",null),t([i({type:["datetimeoffset-picker"],json:{read:!1,write:!0}})],s.prototype,"type",void 0),s=J=t([o("esri.form.elements.inputs.DateTimeOffsetPickerInput")],s);const Vt=s;var Z;function at(e){return e!=null?new Date(e):null}function ut(e){return e?e.getTime():null}let u=Z=class extends c{constructor(e){super(e),this.includeTime=!1,this.max=null,this.min=null,this.type="datetime-picker"}readMax(e,n){return at(n.max)}writeMax(e,n){n.max=ut(e)}readMin(e,n){return at(n.min)}writeMin(e,n){n.min=ut(e)}clone(){return new Z({includeTime:this.includeTime,max:this.max,min:this.min})}};t([i({type:Boolean,json:{write:!0}})],u.prototype,"includeTime",void 0),t([i({type:Date,json:{type:Number,write:!0}})],u.prototype,"max",void 0),t([l("max")],u.prototype,"readMax",null),t([a("max")],u.prototype,"writeMax",null),t([i({type:Date,json:{type:Number,write:!0}})],u.prototype,"min",void 0),t([l("min")],u.prototype,"readMin",null),t([a("min")],u.prototype,"writeMin",null),t([i({type:["datetime-picker"],json:{read:!1,write:!0}})],u.prototype,"type",void 0),u=Z=t([o("esri.form.elements.inputs.DateTimePickerInput")],u);const Rt=u;var U;let g=U=class extends c{constructor(e){super(e),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="radio-buttons"}clone(){return new U({noValueOptionLabel:this.noValueOptionLabel,showNoValueOption:this.showNoValueOption})}};t([i({type:String,json:{write:!0}})],g.prototype,"noValueOptionLabel",void 0),t([i({type:Boolean,json:{write:!0}})],g.prototype,"showNoValueOption",void 0),t([i({type:["radio-buttons"],json:{read:!1,write:!0}})],g.prototype,"type",void 0),g=U=t([o("esri.form.elements.inputs.RadioButtonsInput")],g);const Lt=g;var z;let E=z=class extends c{constructor(e){super(e),this.offValue=null,this.onValue=null,this.type="switch"}clone(){return new z({offValue:this.offValue,onValue:this.onValue})}};t([i({type:[String,Number],json:{write:!0}})],E.prototype,"offValue",void 0),t([i({type:[String,Number],json:{write:!0}})],E.prototype,"onValue",void 0),t([i({type:["switch"],json:{read:!1,write:!0}})],E.prototype,"type",void 0),E=z=t([o("esri.form.elements.inputs.SwitchInput")],E);const Ot=E;var Q;let k=Q=class extends st{constructor(e){super(e),this.type="text-area"}clone(){return new Q({maxLength:this.maxLength,minLength:this.minLength})}};t([i({type:["text-area"],json:{read:!1,write:!0}})],k.prototype,"type",void 0),k=Q=t([o("esri.form.elements.inputs.TextAreaInput")],k);const kt=k;var X;let I=X=class extends st{constructor(e){super(e),this.type="text-box"}clone(){return new X({maxLength:this.maxLength,minLength:this.minLength})}};t([i({type:["text-box"],json:{read:!1,write:!0}})],I.prototype,"type",void 0),I=X=t([o("esri.form.elements.inputs.TextBoxInput")],I);const It=I;var Y;function W(e){return e??null}function G(e){return e??null}let r=Y=class extends c{constructor(e){super(e),this.max=null,this.min=null,this.timeResolution="minutes",this.type="time-picker"}readMax(e,n){return W(n.max)}writeMax(e,n){n.max=G(e)}readMin(e,n){return W(n.min)}writeMin(e,n){n.min=G(e)}readTimeResolution(e,n){return W(n.timeResolution)}writeTimeResolution(e,n){n.timeResolution=G(e)}clone(){return new Y({max:this.max,min:this.min,timeResolution:this.timeResolution})}};t([i({type:String,json:{type:String,write:!0}})],r.prototype,"max",void 0),t([l("max")],r.prototype,"readMax",null),t([a("max")],r.prototype,"writeMax",null),t([i({type:String,json:{type:String,write:!0}})],r.prototype,"min",void 0),t([l("min")],r.prototype,"readMin",null),t([a("min")],r.prototype,"writeMin",null),t([i({type:String,json:{type:String,write:!0}})],r.prototype,"timeResolution",void 0),t([l("timeResolution")],r.prototype,"readTimeResolution",null),t([a("timeResolution")],r.prototype,"writeTimeResolution",null),t([i({type:["time-picker"],json:{read:!1,write:!0}})],r.prototype,"type",void 0),r=Y=t([o("esri.form.elements.inputs.TimePickerInput")],r);const Nt=r,Bt={base:c,key:"type",typeMap:{"barcode-scanner":St,"combo-box":Mt,"date-picker":Tt,"datetime-picker":Rt,"datetimeoffset-picker":Vt,"radio-buttons":Lt,switch:Ot,"text-area":kt,"text-box":It,"time-picker":Nt}};var tt;let p=tt=class extends b{constructor(e){super(e),this.domain=null,this.editableExpression=null,this.fieldName=null,this.hint=null,this.input=null,this.requiredExpression=null,this.type="field",this.valueExpression=null}get editable(){return this._get("editable")??!0}set editable(e){this._set("editable",e)}clone(){return new tt({description:this.description,domain:this.domain,editable:this.editable,editableExpression:this.editableExpression,fieldName:this.fieldName,hint:this.hint,input:this.input,label:this.label,requiredExpression:this.requiredExpression,valueExpression:this.valueExpression,visibilityExpression:this.visibilityExpression})}};t([i({types:ft,json:{read:{reader:bt},write:!0}})],p.prototype,"domain",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"editable",null),t([i({type:String,json:{write:!0}})],p.prototype,"editableExpression",void 0),t([i({type:String,json:{write:!0}})],p.prototype,"fieldName",void 0),t([i({type:String,json:{write:!0}})],p.prototype,"hint",void 0),t([i({types:Bt,json:{read:{source:"inputType"},write:{target:"inputType"}}})],p.prototype,"input",void 0),t([i({type:String,json:{write:!0}})],p.prototype,"requiredExpression",void 0),t([i({type:String,json:{read:!1,write:!0}})],p.prototype,"type",void 0),t([i({type:String,json:{write:!0}})],p.prototype,"valueExpression",void 0),p=tt=t([o("esri.form.elements.FieldElement")],p);const yt=p;var et;let h=et=class extends b{constructor(e){super(e),this.displayCount=null,this.displayType="list",this.editableExpression=null,this.orderByFields=null,this.relationshipId=null,this.type="relationship"}clone(){return new et({description:this.description,displayCount:this.displayCount,displayType:this.displayType,editableExpression:this.editableExpression,label:this.label,orderByFields:N(this.orderByFields),relationshipId:this.relationshipId,visibilityExpression:this.visibilityExpression})}};t([i({type:Number,json:{write:!0}})],h.prototype,"displayCount",void 0),t([i({type:["list"],json:{write:!0}})],h.prototype,"displayType",void 0),t([i({type:String,json:{write:!0}})],h.prototype,"editableExpression",void 0),t([i({type:[$t],json:{write:!0}})],h.prototype,"orderByFields",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"relationshipId",void 0),t([i({type:["relationship"],json:{read:!1,write:!0}})],h.prototype,"type",void 0),h=et=t([o("esri.form.elements.RelationshipElement")],h);const mt=h;var it;let S=it=class extends b{constructor(e){super(e),this.text=null,this.textFormat="plain-text",this.type="text"}clone(){return new it({text:this.text,textFormat:this.textFormat,visibilityExpression:this.visibilityExpression})}};t([i({type:String,json:{write:!0}})],S.prototype,"text",void 0),t([i({type:String,json:{write:!0}})],S.prototype,"textFormat",void 0),t([i({type:["text"],readOnly:!0,json:{read:!1,write:!0}})],S.prototype,"type",void 0),S=it=t([o("esri.form.elements.TextElement")],S);const dt=S;function ct(e){return{typesWithGroup:{base:b,key:"type",typeMap:{attachment:rt,field:yt,group:e,relationship:mt,text:dt}},typesWithoutGroup:{base:b,key:"type",typeMap:{attachment:rt,field:yt,relationship:mt,text:dt}}}}function xt(e,n,M=!0){if(!e)return null;const $=M?n.typesWithGroup.typeMap:n.typesWithoutGroup.typeMap;return e.filter(x=>$[x.type]).map(x=>$[x.type].fromJSON(x))}function wt(e,n,M=!0){if(!e)return null;const $=M?n.typesWithGroup.typeMap:n.typesWithoutGroup.typeMap;return e.filter(x=>$[x.type]).map(x=>x.toJSON())}function vt(e,n,M=!0){return e?e.map($=>jt(M?n.typesWithGroup:n.typesWithoutGroup,$)):null}var nt;let d=nt=class extends b{constructor(e){super(e),this.elements=null,this.initialState="expanded",this.type="group"}castElements(e){return vt(e,D,!1)}readElements(e,n){return xt(n.formElements,D,!1)}writeElements(e,n){n.formElements=wt(e,D,!1)}clone(){return new nt({description:this.description,elements:N(this.elements),initialState:this.initialState,label:this.label,visibilityExpression:this.visibilityExpression})}};t([i({json:{write:!0}})],d.prototype,"elements",void 0),t([ht("elements")],d.prototype,"castElements",null),t([l("elements",["formElements"])],d.prototype,"readElements",null),t([a("elements")],d.prototype,"writeElements",null),t([i({type:["collapsed","expanded"],json:{write:!0}})],d.prototype,"initialState",void 0),t([i({type:String,json:{read:!1,write:!0}})],d.prototype,"type",void 0),d=nt=t([o("esri.form.elements.GroupElement")],d);const D=ct(d),Ft=d;var ot;const C=ct(Ft);let y=ot=class extends V{constructor(e){super(e),this.description=null,this.elements=null,this.expressionInfos=null,this.preserveFieldValuesWhenHidden=!1,this.title=null}castElements(e){return vt(e,C)}readElements(e,n){return xt(n.formElements,C)}writeElements(e,n){n.formElements=wt(e,C)}clone(){return new ot({description:this.description,expressionInfos:N(this.expressionInfos),elements:N(this.elements),title:this.title,preserveFieldValuesWhenHidden:this.preserveFieldValuesWhenHidden})}};t([i({type:String,json:{write:!0}})],y.prototype,"description",void 0),t([i({json:{write:!0}})],y.prototype,"elements",void 0),t([ht("elements")],y.prototype,"castElements",null),t([l("elements",["formElements"])],y.prototype,"readElements",null),t([a("elements")],y.prototype,"writeElements",null),t([i({type:[gt],json:{write:!0}})],y.prototype,"expressionInfos",void 0),t([i({type:Boolean,json:{default:!1,write:!0}})],y.prototype,"preserveFieldValuesWhenHidden",void 0),t([i({type:String,json:{write:!0}})],y.prototype,"title",void 0),y=ot=t([o("esri.form.FormTemplate")],y);const Ct=y;export{Ct as y}; +import{d as t,y as i,f as o,aU as V,aZ as l,aR as a,kZ as ft,b5 as bt,k_ as $t,aV as N,k$ as jt,e1 as ht}from"./index-BjUNJPVf.js";var q;let w=q=class extends V{constructor(e){super(e),this.expression=null,this.name=null,this.returnType="boolean",this.title=null}clone(){return new q({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};t([i({type:String,json:{write:!0}})],w.prototype,"expression",void 0),t([i({type:String,json:{write:!0}})],w.prototype,"name",void 0),t([i({type:["boolean","date","number","string"],json:{write:!0}})],w.prototype,"returnType",void 0),t([i({type:String,json:{write:!0}})],w.prototype,"title",void 0),w=q=t([o("esri.form.ExpressionInfo")],w);const gt=w;let v=class extends V{constructor(n){super(n),this.description=null,this.label=null,this.type=null,this.visibilityExpression=null}};t([i({type:String,json:{write:!0}})],v.prototype,"description",void 0),t([i({type:String,json:{write:!0}})],v.prototype,"label",void 0),t([i()],v.prototype,"type",void 0),t([i({type:String,json:{write:!0}})],v.prototype,"visibilityExpression",void 0),v=t([o("esri.form.elements.Element")],v);const b=v;var H;let R=H=class extends V{constructor(e){super(e),this.type=null}clone(){return new H({type:this.type})}};t([i({type:["attachment","audio","document","image","signature","video"],json:{write:!0}})],R.prototype,"type",void 0),R=H=t([o("esri.form.elements.inputs.AttachmentInput")],R);const Et=R;var K;let f=K=class extends b{constructor(e){super(e),this.attachmentKeyword=null,this.editableExpression=null,this.input=null,this.type="attachment"}clone(){return new K({attachmentKeyword:this.attachmentKeyword,description:this.description,editableExpression:this.editableExpression,input:this.input,label:this.label,visibilityExpression:this.visibilityExpression})}};t([i({type:String,json:{write:!0}})],f.prototype,"attachmentKeyword",void 0),t([i({type:String,json:{write:!0}})],f.prototype,"editableExpression",void 0),t([i({type:Et,json:{read:{source:"inputType"},write:{target:"inputType"}}})],f.prototype,"input",void 0),t([i({type:["attachment"],json:{read:!1,write:!0}})],f.prototype,"type",void 0),f=K=t([o("esri.form.elements.AttachmentElement")],f);const rt=f;let L=class extends V{constructor(e){super(e),this.type=null}};t([i()],L.prototype,"type",void 0),L=t([o("esri.form.elements.inputs.Input")],L);const c=L;let T=class extends c{constructor(n){super(n),this.maxLength=null,this.minLength=0}};t([i({type:Number,json:{write:!0}})],T.prototype,"maxLength",void 0),t([i({type:Number,json:{write:!0}})],T.prototype,"minLength",void 0),T=t([o("esri.form.elements.inputs.TextInput")],T);const st=T;var P;let O=P=class extends st{constructor(e){super(e),this.type="barcode-scanner"}clone(){return new P({maxLength:this.maxLength,minLength:this.minLength})}};t([i({type:["barcode-scanner"],json:{read:!1,write:!0}})],O.prototype,"type",void 0),O=P=t([o("esri.form.elements.inputs.BarcodeScannerInput")],O);const St=O;var A;let j=A=class extends c{constructor(e){super(e),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="combo-box"}clone(){return new A({showNoValueOption:this.showNoValueOption,noValueOptionLabel:this.noValueOptionLabel})}};t([i({type:String,json:{write:!0}})],j.prototype,"noValueOptionLabel",void 0),t([i({type:Boolean,json:{write:!0}})],j.prototype,"showNoValueOption",void 0),t([i({type:["combo-box"],json:{read:!1,write:!0}})],j.prototype,"type",void 0),j=A=t([o("esri.form.elements.inputs.ComboBoxInput")],j);const Mt=j;var _;function pt(e){return e??null}function lt(e){return e??null}let m=_=class extends c{constructor(e){super(e),this.max=null,this.min=null,this.type="date-picker"}readMax(e,n){return pt(n.max)}writeMax(e,n){n.max=lt(e)}readMin(e,n){return pt(n.min)}writeMin(e,n){n.min=lt(e)}clone(){return new _({max:this.max,min:this.min})}};t([i({type:String,json:{type:String,write:!0}})],m.prototype,"max",void 0),t([l("max")],m.prototype,"readMax",null),t([a("max")],m.prototype,"writeMax",null),t([i({type:String,json:{type:String,write:!0}})],m.prototype,"min",void 0),t([l("min")],m.prototype,"readMin",null),t([a("min")],m.prototype,"writeMin",null),t([i({type:["date-picker"],json:{read:!1,write:!0}})],m.prototype,"type",void 0),m=_=t([o("esri.form.elements.inputs.DatePickerInput")],m);const Tt=m;var J;function B(e){return e??null}function F(e){return e??null}let s=J=class extends c{constructor(e){super(e),this.includeTimeOffset=!0,this.max=null,this.min=null,this.timeResolution="minutes",this.type="datetimeoffset-picker"}readMax(e,n){return B(n.max)}writeMax(e,n){n.max=F(e)}readMin(e,n){return B(n.min)}writeMin(e,n){n.min=F(e)}readTimeResolution(e,n){return B(n.timeResolution)}writeTimeResolution(e,n){n.timeResolution=F(e)}clone(){return new J({includeTimeOffset:this.includeTimeOffset,max:this.max,min:this.min,timeResolution:this.timeResolution})}};t([i({type:Boolean,json:{write:!0}})],s.prototype,"includeTimeOffset",void 0),t([i({type:String,json:{type:String,write:!0}})],s.prototype,"max",void 0),t([l("max")],s.prototype,"readMax",null),t([a("max")],s.prototype,"writeMax",null),t([i({type:String,json:{type:String,write:!0}})],s.prototype,"min",void 0),t([l("min")],s.prototype,"readMin",null),t([a("min")],s.prototype,"writeMin",null),t([i({type:String,json:{type:String,write:!0}})],s.prototype,"timeResolution",void 0),t([l("timeResolution")],s.prototype,"readTimeResolution",null),t([a("timeResolution")],s.prototype,"writeTimeResolution",null),t([i({type:["datetimeoffset-picker"],json:{read:!1,write:!0}})],s.prototype,"type",void 0),s=J=t([o("esri.form.elements.inputs.DateTimeOffsetPickerInput")],s);const Vt=s;var Z;function at(e){return e!=null?new Date(e):null}function ut(e){return e?e.getTime():null}let u=Z=class extends c{constructor(e){super(e),this.includeTime=!1,this.max=null,this.min=null,this.type="datetime-picker"}readMax(e,n){return at(n.max)}writeMax(e,n){n.max=ut(e)}readMin(e,n){return at(n.min)}writeMin(e,n){n.min=ut(e)}clone(){return new Z({includeTime:this.includeTime,max:this.max,min:this.min})}};t([i({type:Boolean,json:{write:!0}})],u.prototype,"includeTime",void 0),t([i({type:Date,json:{type:Number,write:!0}})],u.prototype,"max",void 0),t([l("max")],u.prototype,"readMax",null),t([a("max")],u.prototype,"writeMax",null),t([i({type:Date,json:{type:Number,write:!0}})],u.prototype,"min",void 0),t([l("min")],u.prototype,"readMin",null),t([a("min")],u.prototype,"writeMin",null),t([i({type:["datetime-picker"],json:{read:!1,write:!0}})],u.prototype,"type",void 0),u=Z=t([o("esri.form.elements.inputs.DateTimePickerInput")],u);const Rt=u;var U;let g=U=class extends c{constructor(e){super(e),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="radio-buttons"}clone(){return new U({noValueOptionLabel:this.noValueOptionLabel,showNoValueOption:this.showNoValueOption})}};t([i({type:String,json:{write:!0}})],g.prototype,"noValueOptionLabel",void 0),t([i({type:Boolean,json:{write:!0}})],g.prototype,"showNoValueOption",void 0),t([i({type:["radio-buttons"],json:{read:!1,write:!0}})],g.prototype,"type",void 0),g=U=t([o("esri.form.elements.inputs.RadioButtonsInput")],g);const Lt=g;var z;let E=z=class extends c{constructor(e){super(e),this.offValue=null,this.onValue=null,this.type="switch"}clone(){return new z({offValue:this.offValue,onValue:this.onValue})}};t([i({type:[String,Number],json:{write:!0}})],E.prototype,"offValue",void 0),t([i({type:[String,Number],json:{write:!0}})],E.prototype,"onValue",void 0),t([i({type:["switch"],json:{read:!1,write:!0}})],E.prototype,"type",void 0),E=z=t([o("esri.form.elements.inputs.SwitchInput")],E);const Ot=E;var Q;let k=Q=class extends st{constructor(e){super(e),this.type="text-area"}clone(){return new Q({maxLength:this.maxLength,minLength:this.minLength})}};t([i({type:["text-area"],json:{read:!1,write:!0}})],k.prototype,"type",void 0),k=Q=t([o("esri.form.elements.inputs.TextAreaInput")],k);const kt=k;var X;let I=X=class extends st{constructor(e){super(e),this.type="text-box"}clone(){return new X({maxLength:this.maxLength,minLength:this.minLength})}};t([i({type:["text-box"],json:{read:!1,write:!0}})],I.prototype,"type",void 0),I=X=t([o("esri.form.elements.inputs.TextBoxInput")],I);const It=I;var Y;function W(e){return e??null}function G(e){return e??null}let r=Y=class extends c{constructor(e){super(e),this.max=null,this.min=null,this.timeResolution="minutes",this.type="time-picker"}readMax(e,n){return W(n.max)}writeMax(e,n){n.max=G(e)}readMin(e,n){return W(n.min)}writeMin(e,n){n.min=G(e)}readTimeResolution(e,n){return W(n.timeResolution)}writeTimeResolution(e,n){n.timeResolution=G(e)}clone(){return new Y({max:this.max,min:this.min,timeResolution:this.timeResolution})}};t([i({type:String,json:{type:String,write:!0}})],r.prototype,"max",void 0),t([l("max")],r.prototype,"readMax",null),t([a("max")],r.prototype,"writeMax",null),t([i({type:String,json:{type:String,write:!0}})],r.prototype,"min",void 0),t([l("min")],r.prototype,"readMin",null),t([a("min")],r.prototype,"writeMin",null),t([i({type:String,json:{type:String,write:!0}})],r.prototype,"timeResolution",void 0),t([l("timeResolution")],r.prototype,"readTimeResolution",null),t([a("timeResolution")],r.prototype,"writeTimeResolution",null),t([i({type:["time-picker"],json:{read:!1,write:!0}})],r.prototype,"type",void 0),r=Y=t([o("esri.form.elements.inputs.TimePickerInput")],r);const Nt=r,Bt={base:c,key:"type",typeMap:{"barcode-scanner":St,"combo-box":Mt,"date-picker":Tt,"datetime-picker":Rt,"datetimeoffset-picker":Vt,"radio-buttons":Lt,switch:Ot,"text-area":kt,"text-box":It,"time-picker":Nt}};var tt;let p=tt=class extends b{constructor(e){super(e),this.domain=null,this.editableExpression=null,this.fieldName=null,this.hint=null,this.input=null,this.requiredExpression=null,this.type="field",this.valueExpression=null}get editable(){return this._get("editable")??!0}set editable(e){this._set("editable",e)}clone(){return new tt({description:this.description,domain:this.domain,editable:this.editable,editableExpression:this.editableExpression,fieldName:this.fieldName,hint:this.hint,input:this.input,label:this.label,requiredExpression:this.requiredExpression,valueExpression:this.valueExpression,visibilityExpression:this.visibilityExpression})}};t([i({types:ft,json:{read:{reader:bt},write:!0}})],p.prototype,"domain",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"editable",null),t([i({type:String,json:{write:!0}})],p.prototype,"editableExpression",void 0),t([i({type:String,json:{write:!0}})],p.prototype,"fieldName",void 0),t([i({type:String,json:{write:!0}})],p.prototype,"hint",void 0),t([i({types:Bt,json:{read:{source:"inputType"},write:{target:"inputType"}}})],p.prototype,"input",void 0),t([i({type:String,json:{write:!0}})],p.prototype,"requiredExpression",void 0),t([i({type:String,json:{read:!1,write:!0}})],p.prototype,"type",void 0),t([i({type:String,json:{write:!0}})],p.prototype,"valueExpression",void 0),p=tt=t([o("esri.form.elements.FieldElement")],p);const yt=p;var et;let h=et=class extends b{constructor(e){super(e),this.displayCount=null,this.displayType="list",this.editableExpression=null,this.orderByFields=null,this.relationshipId=null,this.type="relationship"}clone(){return new et({description:this.description,displayCount:this.displayCount,displayType:this.displayType,editableExpression:this.editableExpression,label:this.label,orderByFields:N(this.orderByFields),relationshipId:this.relationshipId,visibilityExpression:this.visibilityExpression})}};t([i({type:Number,json:{write:!0}})],h.prototype,"displayCount",void 0),t([i({type:["list"],json:{write:!0}})],h.prototype,"displayType",void 0),t([i({type:String,json:{write:!0}})],h.prototype,"editableExpression",void 0),t([i({type:[$t],json:{write:!0}})],h.prototype,"orderByFields",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"relationshipId",void 0),t([i({type:["relationship"],json:{read:!1,write:!0}})],h.prototype,"type",void 0),h=et=t([o("esri.form.elements.RelationshipElement")],h);const mt=h;var it;let S=it=class extends b{constructor(e){super(e),this.text=null,this.textFormat="plain-text",this.type="text"}clone(){return new it({text:this.text,textFormat:this.textFormat,visibilityExpression:this.visibilityExpression})}};t([i({type:String,json:{write:!0}})],S.prototype,"text",void 0),t([i({type:String,json:{write:!0}})],S.prototype,"textFormat",void 0),t([i({type:["text"],readOnly:!0,json:{read:!1,write:!0}})],S.prototype,"type",void 0),S=it=t([o("esri.form.elements.TextElement")],S);const dt=S;function ct(e){return{typesWithGroup:{base:b,key:"type",typeMap:{attachment:rt,field:yt,group:e,relationship:mt,text:dt}},typesWithoutGroup:{base:b,key:"type",typeMap:{attachment:rt,field:yt,relationship:mt,text:dt}}}}function xt(e,n,M=!0){if(!e)return null;const $=M?n.typesWithGroup.typeMap:n.typesWithoutGroup.typeMap;return e.filter(x=>$[x.type]).map(x=>$[x.type].fromJSON(x))}function wt(e,n,M=!0){if(!e)return null;const $=M?n.typesWithGroup.typeMap:n.typesWithoutGroup.typeMap;return e.filter(x=>$[x.type]).map(x=>x.toJSON())}function vt(e,n,M=!0){return e?e.map($=>jt(M?n.typesWithGroup:n.typesWithoutGroup,$)):null}var nt;let d=nt=class extends b{constructor(e){super(e),this.elements=null,this.initialState="expanded",this.type="group"}castElements(e){return vt(e,D,!1)}readElements(e,n){return xt(n.formElements,D,!1)}writeElements(e,n){n.formElements=wt(e,D,!1)}clone(){return new nt({description:this.description,elements:N(this.elements),initialState:this.initialState,label:this.label,visibilityExpression:this.visibilityExpression})}};t([i({json:{write:!0}})],d.prototype,"elements",void 0),t([ht("elements")],d.prototype,"castElements",null),t([l("elements",["formElements"])],d.prototype,"readElements",null),t([a("elements")],d.prototype,"writeElements",null),t([i({type:["collapsed","expanded"],json:{write:!0}})],d.prototype,"initialState",void 0),t([i({type:String,json:{read:!1,write:!0}})],d.prototype,"type",void 0),d=nt=t([o("esri.form.elements.GroupElement")],d);const D=ct(d),Ft=d;var ot;const C=ct(Ft);let y=ot=class extends V{constructor(e){super(e),this.description=null,this.elements=null,this.expressionInfos=null,this.preserveFieldValuesWhenHidden=!1,this.title=null}castElements(e){return vt(e,C)}readElements(e,n){return xt(n.formElements,C)}writeElements(e,n){n.formElements=wt(e,C)}clone(){return new ot({description:this.description,expressionInfos:N(this.expressionInfos),elements:N(this.elements),title:this.title,preserveFieldValuesWhenHidden:this.preserveFieldValuesWhenHidden})}};t([i({type:String,json:{write:!0}})],y.prototype,"description",void 0),t([i({json:{write:!0}})],y.prototype,"elements",void 0),t([ht("elements")],y.prototype,"castElements",null),t([l("elements",["formElements"])],y.prototype,"readElements",null),t([a("elements")],y.prototype,"writeElements",null),t([i({type:[gt],json:{write:!0}})],y.prototype,"expressionInfos",void 0),t([i({type:Boolean,json:{default:!1,write:!0}})],y.prototype,"preserveFieldValuesWhenHidden",void 0),t([i({type:String,json:{write:!0}})],y.prototype,"title",void 0),y=ot=t([o("esri.form.FormTemplate")],y);const Ct=y;export{Ct as y}; diff --git a/assets/GeoJSONLayer-BEhPE7YN.js b/assets/GeoJSONLayer-ibYVKi1c.js similarity index 85% rename from assets/GeoJSONLayer-BEhPE7YN.js rename to assets/GeoJSONLayer-ibYVKi1c.js index 590f5ea..f6d7545 100644 --- a/assets/GeoJSONLayer-BEhPE7YN.js +++ b/assets/GeoJSONLayer-ibYVKi1c.js @@ -1,7 +1,7 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/editingSupport-DWTRjmy9.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css","assets/EditBusLayer-SG7oYwiY.js","assets/infoFor3D-DsOdlPuA.js"] + __vite__mapDeps.viteFileDeps = ["assets/editingSupport-4MwIplWk.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css","assets/EditBusLayer-OslMX9fF.js","assets/infoFor3D-DsOdlPuA.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{d as r,y as i,f as b,fw as x,k as $,aE as O,N as m,aB as w,ec as j,E as N,d3 as E,s as f,dO as J,bP as R,bQ as P,dp as q,dq as T,dr as k,aS as I,ay as D,fA as g,b3 as C,bW as v,_ as G,aX as c,dR as Q,e8 as Z,a_ as z,ds as L,fB as B,dt as V,fC as A,fD as W,i as M,fE as U,du as X,bT as H}from"./index-CEWggaxV.js";import"./UniqueValueRenderer-BlkUix3g.js";import{a as K,u as Y}from"./jsonUtils-BseLl1fZ.js";import{l as ee}from"./clientSideDefaults-CgRgH99f.js";import{d as te}from"./FeatureSet-CYJUZgOk.js";import{p as re}from"./FeatureEffectLayer-CLTrRFqx.js";import{c as ie}from"./FeatureReductionLayer-DncGsNIN.js";import{c as oe}from"./OrderedLayer-Do089KpQ.js";import{f as se}from"./RefreshableLayer-1EkEhJeI.js";import{f as ne}from"./TemporalLayer-qq3v_i3q.js";import{p as ae}from"./FeatureTemplate-DcprAdTM.js";import{s as le}from"./fieldProperties-DMs4wT6-.js";import{C as pe}from"./LabelClass-6cZokw8y.js";import{i as ue}from"./labelingInfo-CijajRsc.js";import{p as de}from"./popupUtils-DAFYyAvw.js";import"./ColorStop-44hBlQ14.js";import"./diffUtils-B4YFa5Ju.js";import"./colorRamps-BJydlf0f.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-z2k12BH8.js";import"./jsonUtils-qYmXvGJ1.js";import"./styleUtils-CnV_Xzhi.js";import"./Version-Bd0QsIQ5.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./OverrideHelper-B4ryGWZb.js";import"./utils-p-5Bbga5.js";import"./quantizationUtils-CUjGHrU3.js";import"./heatmapUtils-Clt5rJzr.js";import"./QueryEngineCapabilities-CTDe3LlQ.js";import"./defaultsJSON-CHAaurhX.js";import"./FeatureEffect-ByrbZlne.js";import"./FeatureReductionSelection-BY3KVXac.js";import"./featureLayerUtils-BhDaw8pS.js";import"./AttachmentQuery-D61mmWw4.js";import"./RelationshipQuery-DDK72Kwc.js";import"./MD5-C9MwAd2G.js";import"./OrderByInfo-DKzv2-WS.js";import"./TimeInfo-3TVmpFSA.js";import"./labelUtils-Dnqx6jl5.js";let p=class extends x{constructor(){super(...arguments),this.type="geojson",this.refresh=$(async e=>{await this.load();const{extent:t,timeExtent:s}=await this._connection.invoke("refresh",e);return this.sourceJSON.extent=t,s&&(this.sourceJSON.timeInfo.timeExtent=[s.start,s.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){var e;(e=this._connection)==null||e.close(),this._connection=null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}queryFeatures(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatures",e?e.toJSON():null,t)).then(s=>te.fromJSON(s))}queryFeaturesJSON(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatures",e?e.toJSON():null,t))}queryFeatureCount(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t))}queryObjectIds(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t))}queryExtent(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t)).then(s=>({count:s.count,extent:O.fromJSON(s.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}_applyEdits(e){if(!this._connection)throw new m("geojson-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField,s=[],n=[],l=[];if(e.addFeatures)for(const a of e.addFeatures)s.push(this._serializeFeature(a));if(e.deleteFeatures)for(const a of e.deleteFeatures)"objectId"in a&&a.objectId!=null?n.push(a.objectId):"attributes"in a&&a.attributes[t]!=null&&n.push(a.attributes[t]);if(e.updateFeatures)for(const a of e.updateFeatures)l.push(this._serializeFeature(a));return this._connection.invoke("applyEdits",{adds:s,updates:l,deletes:n}).then(({extent:a,timeExtent:u,featureEditResults:h})=>(this.sourceJSON.extent=a,u&&(this.sourceJSON.timeInfo.timeExtent=[u.start,u.end]),this._createEditsResult(h)))}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=e.success===!0?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new m("geojson-layer-source:edit-failure",t.description,{code:t.code}):null}}_serializeFeature(e){const{attributes:t}=e,s=this._geometryForSerialization(e);return s?{geometry:s.toJSON(),attributes:t}:{attributes:t}}_geometryForSerialization(e){const{geometry:t}=e;return t==null?null:t.type==="mesh"||t.type==="extent"?w.fromExtent(t.extent):t}async _startWorker(e){this._connection=await j("GeoJSONSourceWorker",{strategy:N("feature-layers-workers")?"dedicated":"local",signal:e,registryTarget:this});const{fields:t,spatialReference:s,hasZ:n,geometryType:l,objectIdField:a,url:u,timeInfo:h,customParameters:F}=this.layer,S=this.layer.originOf("spatialReference")==="defaults",_={url:u,customParameters:F,fields:t&&t.map(y=>y.toJSON()),geometryType:E.toJSON(l),hasZ:n,objectIdField:a,timeInfo:h?h.toJSON():null,spatialReference:S?null:s&&s.toJSON()},d=await this._connection.invoke("load",_,{signal:e});for(const y of d.warnings)f.getLogger(this.layer).warn("#load()",`$${y.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:y});d.featureErrors.length&&f.getLogger(this.layer).warn("#load()",`Encountered ${d.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{errors:d.featureErrors}),this.sourceJSON=d.layerDefinition,this.capabilities=ee(this.sourceJSON.hasZ,!0)}};r([i()],p.prototype,"capabilities",void 0),r([i()],p.prototype,"type",void 0),r([i({constructOnly:!0})],p.prototype,"layer",void 0),r([i()],p.prototype,"sourceJSON",void 0),p=r([b("esri.layers.graphics.sources.GeoJSONSource")],p);const ce=le();let o=class extends oe(J(ie(re(R(ne(P(se(q(T(k(H))))))))))){constructor(e){super(e),this.copyright=null,this.dateFieldsTimeZone=null,this.definitionExpression=null,this.displayField=null,this.editingEnabled=!1,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.hasZ=void 0,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="GeoJSON",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new p({layer:this}),this.spatialReference=I.WGS84,this.templates=null,this.title="GeoJSON",this.type="geojson"}destroy(){var e;(e=this.source)==null||e.destroy()}load(e){const t=this.loadFromPortal({supportedTypes:["GeoJson"],supportsData:!1},e).catch(D).then(()=>this.source.load(e)).then(()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo"],"service"),g(this.renderer,this.fieldsIndex),C(this.timeInfo,this.fieldsIndex)});return this.addResolvingPromise(t),Promise.resolve(this)}get capabilities(){return this.source?this.source.capabilities:null}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}get isTable(){return this.loaded&&this.geometryType==null}get parsedUrl(){return this.url?v(this.url):null}set renderer(e){g(e,this.fieldsIndex),this._set("renderer",e)}set url(e){if(!e)return void this._set("url",e);const t=v(e);this._set("url",t.path),t.query&&(this.customParameters={...this.customParameters,...t.query})}async applyEdits(e,t){const{applyEdits:s}=await G(()=>import("./editingSupport-DWTRjmy9.js"),__vite__mapDeps([0,1,2,3,4]));await this.load();const n=await s(this,this.source,e,t);return this.read({extent:this.source.sourceJSON.extent,timeInfo:this.source.sourceJSON.timeInfo},{origin:"service",ignoreDefaults:!0}),n}on(e,t){return super.on(e,t)}createPopupTemplate(e){return de(this,e)}createQuery(){var l;const e=new c,t=(l=this.capabilities)==null?void 0:l.data;e.returnGeometry=!0,t&&t.supportsZ&&(e.returnZ=!0),e.outFields=["*"],e.where=this.definitionExpression||"1=1";const{timeOffset:s,timeExtent:n}=this;return e.timeExtent=s!=null&&n!=null?n.offset(-s.value,s.unit):n||null,e}getFieldDomain(e,t){var s;return(s=this.getField(e))==null?void 0:s.domain}getField(e){return this.fieldsIndex.get(e)}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(c.from(e)||this.createQuery(),t)).then(s=>{if(s!=null&&s.features)for(const n of s.features)n.layer=n.sourceLayer=this;return s})}queryObjectIds(e,t){return this.load().then(()=>this.source.queryObjectIds(c.from(e)||this.createQuery(),t))}queryFeatureCount(e,t){return this.load().then(()=>this.source.queryFeatureCount(c.from(e)||this.createQuery(),t))}queryExtent(e,t){return this.load().then(()=>this.source.queryExtent(c.from(e)||this.createQuery(),t))}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return t!=null&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};r([i({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"capabilities",null),r([i({type:String})],o.prototype,"copyright",void 0),r([i({readOnly:!0})],o.prototype,"createQueryVersion",null),r([i(Q("dateFieldsTimeReference"))],o.prototype,"dateFieldsTimeZone",void 0),r([i({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),r([i({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),r([i({type:String})],o.prototype,"displayField",void 0),r([i({type:Boolean})],o.prototype,"editingEnabled",void 0),r([i(Z)],o.prototype,"elevationInfo",void 0),r([i({type:[z],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],o.prototype,"fields",void 0),r([i(ce.fieldsIndex)],o.prototype,"fieldsIndex",void 0),r([i({type:O,json:{name:"extent"}})],o.prototype,"fullExtent",void 0),r([i({type:["point","polygon","polyline","multipoint"],json:{read:{reader:E.read}}})],o.prototype,"geometryType",void 0),r([i({type:Boolean})],o.prototype,"hasZ",void 0),r([i(L)],o.prototype,"id",void 0),r([i({type:Boolean,readOnly:!0})],o.prototype,"isTable",null),r([i(B)],o.prototype,"labelsVisible",void 0),r([i({type:[pe],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:ue},write:!0}})],o.prototype,"labelingInfo",void 0),r([i(V)],o.prototype,"legendEnabled",void 0),r([i({type:["show","hide"]})],o.prototype,"listMode",void 0),r([i({type:String,json:{name:"layerDefinition.objectIdField",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"objectIdField"}}}})],o.prototype,"objectIdField",void 0),r([i(A)],o.prototype,"opacity",void 0),r([i({type:["GeoJSON"]})],o.prototype,"operationalLayerType",void 0),r([i({readOnly:!0})],o.prototype,"parsedUrl",null),r([i(W)],o.prototype,"popupEnabled",void 0),r([i({type:M,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),r([i({types:K,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:Y}}}})],o.prototype,"renderer",null),r([i(U)],o.prototype,"screenSizePerspectiveEnabled",void 0),r([i({readOnly:!0})],o.prototype,"source",void 0),r([i({type:I})],o.prototype,"spatialReference",void 0),r([i({type:[ae]})],o.prototype,"templates",void 0),r([i()],o.prototype,"title",void 0),r([i({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),r([i(X)],o.prototype,"url",null),o=r([b("esri.layers.GeoJSONLayer")],o);const Ye=o;export{Ye as default}; +import{d as r,y as i,f as b,fw as x,k as $,aE as O,N as m,aB as w,ec as j,E as N,d3 as E,s as f,dO as J,bP as R,bQ as P,dp as q,dq as T,dr as k,aS as I,ay as D,fA as g,b3 as C,bW as v,_ as G,aX as c,dR as Q,e8 as Z,a_ as z,ds as L,fB as B,dt as V,fC as A,fD as W,i as M,fE as U,du as X,bT as H}from"./index-BjUNJPVf.js";import"./UniqueValueRenderer-7V9Bhr-D.js";import{a as K,u as Y}from"./jsonUtils-Dw332y6z.js";import{l as ee}from"./clientSideDefaults-BQP5n3lX.js";import{d as te}from"./FeatureSet-opEn8ou8.js";import{p as re}from"./FeatureEffectLayer-DarO4Ctx.js";import{c as ie}from"./FeatureReductionLayer-CK-tyM-9.js";import{c as oe}from"./OrderedLayer-dLoPhxcx.js";import{f as se}from"./RefreshableLayer-_r2TPtol.js";import{f as ne}from"./TemporalLayer-CKICYnEl.js";import{p as ae}from"./FeatureTemplate-FZNGA_Ik.js";import{s as le}from"./fieldProperties-DnrQXLBM.js";import{C as pe}from"./LabelClass-CeatfK8u.js";import{i as ue}from"./labelingInfo-DqAUis6e.js";import{p as de}from"./popupUtils-DlZin22m.js";import"./ColorStop-DCGjAKLC.js";import"./diffUtils-uUoMDFQS.js";import"./colorRamps-CcakIWlU.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-BX9G5gNQ.js";import"./jsonUtils-Ox5U0P0F.js";import"./styleUtils-DOUOskVZ.js";import"./Version-Dqq_CHBG.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./OverrideHelper-DxFZBnGL.js";import"./utils-CuXO_Zzq.js";import"./quantizationUtils-CfV316jZ.js";import"./heatmapUtils-BSteZBTj.js";import"./QueryEngineCapabilities-CTDe3LlQ.js";import"./defaultsJSON-CHAaurhX.js";import"./FeatureEffect-DBbkrS6j.js";import"./FeatureReductionSelection-t3T7oa8H.js";import"./featureLayerUtils-lwqyOSrl.js";import"./AttachmentQuery-DmEAIZff.js";import"./RelationshipQuery-BDJrOxaX.js";import"./MD5-C9MwAd2G.js";import"./OrderByInfo-DKyk5GLW.js";import"./TimeInfo-DooETFWC.js";import"./labelUtils-3p0-m-Ee.js";let p=class extends x{constructor(){super(...arguments),this.type="geojson",this.refresh=$(async e=>{await this.load();const{extent:t,timeExtent:s}=await this._connection.invoke("refresh",e);return this.sourceJSON.extent=t,s&&(this.sourceJSON.timeInfo.timeExtent=[s.start,s.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){var e;(e=this._connection)==null||e.close(),this._connection=null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}queryFeatures(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatures",e?e.toJSON():null,t)).then(s=>te.fromJSON(s))}queryFeaturesJSON(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatures",e?e.toJSON():null,t))}queryFeatureCount(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t))}queryObjectIds(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t))}queryExtent(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t)).then(s=>({count:s.count,extent:O.fromJSON(s.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}_applyEdits(e){if(!this._connection)throw new m("geojson-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField,s=[],n=[],l=[];if(e.addFeatures)for(const a of e.addFeatures)s.push(this._serializeFeature(a));if(e.deleteFeatures)for(const a of e.deleteFeatures)"objectId"in a&&a.objectId!=null?n.push(a.objectId):"attributes"in a&&a.attributes[t]!=null&&n.push(a.attributes[t]);if(e.updateFeatures)for(const a of e.updateFeatures)l.push(this._serializeFeature(a));return this._connection.invoke("applyEdits",{adds:s,updates:l,deletes:n}).then(({extent:a,timeExtent:u,featureEditResults:h})=>(this.sourceJSON.extent=a,u&&(this.sourceJSON.timeInfo.timeExtent=[u.start,u.end]),this._createEditsResult(h)))}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=e.success===!0?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new m("geojson-layer-source:edit-failure",t.description,{code:t.code}):null}}_serializeFeature(e){const{attributes:t}=e,s=this._geometryForSerialization(e);return s?{geometry:s.toJSON(),attributes:t}:{attributes:t}}_geometryForSerialization(e){const{geometry:t}=e;return t==null?null:t.type==="mesh"||t.type==="extent"?w.fromExtent(t.extent):t}async _startWorker(e){this._connection=await j("GeoJSONSourceWorker",{strategy:N("feature-layers-workers")?"dedicated":"local",signal:e,registryTarget:this});const{fields:t,spatialReference:s,hasZ:n,geometryType:l,objectIdField:a,url:u,timeInfo:h,customParameters:F}=this.layer,S=this.layer.originOf("spatialReference")==="defaults",_={url:u,customParameters:F,fields:t&&t.map(y=>y.toJSON()),geometryType:E.toJSON(l),hasZ:n,objectIdField:a,timeInfo:h?h.toJSON():null,spatialReference:S?null:s&&s.toJSON()},d=await this._connection.invoke("load",_,{signal:e});for(const y of d.warnings)f.getLogger(this.layer).warn("#load()",`$${y.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:y});d.featureErrors.length&&f.getLogger(this.layer).warn("#load()",`Encountered ${d.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{errors:d.featureErrors}),this.sourceJSON=d.layerDefinition,this.capabilities=ee(this.sourceJSON.hasZ,!0)}};r([i()],p.prototype,"capabilities",void 0),r([i()],p.prototype,"type",void 0),r([i({constructOnly:!0})],p.prototype,"layer",void 0),r([i()],p.prototype,"sourceJSON",void 0),p=r([b("esri.layers.graphics.sources.GeoJSONSource")],p);const ce=le();let o=class extends oe(J(ie(re(R(ne(P(se(q(T(k(H))))))))))){constructor(e){super(e),this.copyright=null,this.dateFieldsTimeZone=null,this.definitionExpression=null,this.displayField=null,this.editingEnabled=!1,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.hasZ=void 0,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="GeoJSON",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new p({layer:this}),this.spatialReference=I.WGS84,this.templates=null,this.title="GeoJSON",this.type="geojson"}destroy(){var e;(e=this.source)==null||e.destroy()}load(e){const t=this.loadFromPortal({supportedTypes:["GeoJson"],supportsData:!1},e).catch(D).then(()=>this.source.load(e)).then(()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo"],"service"),g(this.renderer,this.fieldsIndex),C(this.timeInfo,this.fieldsIndex)});return this.addResolvingPromise(t),Promise.resolve(this)}get capabilities(){return this.source?this.source.capabilities:null}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}get isTable(){return this.loaded&&this.geometryType==null}get parsedUrl(){return this.url?v(this.url):null}set renderer(e){g(e,this.fieldsIndex),this._set("renderer",e)}set url(e){if(!e)return void this._set("url",e);const t=v(e);this._set("url",t.path),t.query&&(this.customParameters={...this.customParameters,...t.query})}async applyEdits(e,t){const{applyEdits:s}=await G(()=>import("./editingSupport-4MwIplWk.js"),__vite__mapDeps([0,1,2,3,4]));await this.load();const n=await s(this,this.source,e,t);return this.read({extent:this.source.sourceJSON.extent,timeInfo:this.source.sourceJSON.timeInfo},{origin:"service",ignoreDefaults:!0}),n}on(e,t){return super.on(e,t)}createPopupTemplate(e){return de(this,e)}createQuery(){var l;const e=new c,t=(l=this.capabilities)==null?void 0:l.data;e.returnGeometry=!0,t&&t.supportsZ&&(e.returnZ=!0),e.outFields=["*"],e.where=this.definitionExpression||"1=1";const{timeOffset:s,timeExtent:n}=this;return e.timeExtent=s!=null&&n!=null?n.offset(-s.value,s.unit):n||null,e}getFieldDomain(e,t){var s;return(s=this.getField(e))==null?void 0:s.domain}getField(e){return this.fieldsIndex.get(e)}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(c.from(e)||this.createQuery(),t)).then(s=>{if(s!=null&&s.features)for(const n of s.features)n.layer=n.sourceLayer=this;return s})}queryObjectIds(e,t){return this.load().then(()=>this.source.queryObjectIds(c.from(e)||this.createQuery(),t))}queryFeatureCount(e,t){return this.load().then(()=>this.source.queryFeatureCount(c.from(e)||this.createQuery(),t))}queryExtent(e,t){return this.load().then(()=>this.source.queryExtent(c.from(e)||this.createQuery(),t))}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return t!=null&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};r([i({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"capabilities",null),r([i({type:String})],o.prototype,"copyright",void 0),r([i({readOnly:!0})],o.prototype,"createQueryVersion",null),r([i(Q("dateFieldsTimeReference"))],o.prototype,"dateFieldsTimeZone",void 0),r([i({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),r([i({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),r([i({type:String})],o.prototype,"displayField",void 0),r([i({type:Boolean})],o.prototype,"editingEnabled",void 0),r([i(Z)],o.prototype,"elevationInfo",void 0),r([i({type:[z],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],o.prototype,"fields",void 0),r([i(ce.fieldsIndex)],o.prototype,"fieldsIndex",void 0),r([i({type:O,json:{name:"extent"}})],o.prototype,"fullExtent",void 0),r([i({type:["point","polygon","polyline","multipoint"],json:{read:{reader:E.read}}})],o.prototype,"geometryType",void 0),r([i({type:Boolean})],o.prototype,"hasZ",void 0),r([i(L)],o.prototype,"id",void 0),r([i({type:Boolean,readOnly:!0})],o.prototype,"isTable",null),r([i(B)],o.prototype,"labelsVisible",void 0),r([i({type:[pe],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:ue},write:!0}})],o.prototype,"labelingInfo",void 0),r([i(V)],o.prototype,"legendEnabled",void 0),r([i({type:["show","hide"]})],o.prototype,"listMode",void 0),r([i({type:String,json:{name:"layerDefinition.objectIdField",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"objectIdField"}}}})],o.prototype,"objectIdField",void 0),r([i(A)],o.prototype,"opacity",void 0),r([i({type:["GeoJSON"]})],o.prototype,"operationalLayerType",void 0),r([i({readOnly:!0})],o.prototype,"parsedUrl",null),r([i(W)],o.prototype,"popupEnabled",void 0),r([i({type:M,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),r([i({types:K,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:Y}}}})],o.prototype,"renderer",null),r([i(U)],o.prototype,"screenSizePerspectiveEnabled",void 0),r([i({readOnly:!0})],o.prototype,"source",void 0),r([i({type:I})],o.prototype,"spatialReference",void 0),r([i({type:[ae]})],o.prototype,"templates",void 0),r([i()],o.prototype,"title",void 0),r([i({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),r([i(X)],o.prototype,"url",null),o=r([b("esri.layers.GeoJSONLayer")],o);const Ye=o;export{Ye as default}; diff --git a/assets/GeoJSONSourceWorker-CUwhItjB.js b/assets/GeoJSONSourceWorker-CJxkfTXL.js similarity index 89% rename from assets/GeoJSONSourceWorker-CUwhItjB.js rename to assets/GeoJSONSourceWorker-CJxkfTXL.js index 45c1587..6d48a8c 100644 --- a/assets/GeoJSONSourceWorker-CUwhItjB.js +++ b/assets/GeoJSONSourceWorker-CJxkfTXL.js @@ -1 +1 @@ -import{cB as _,N as F,cC as C,T as Q,cD as v,W as Z,cE as A,b as G,s as P,G as M,M as N,cF as R}from"./index-CEWggaxV.js";import{o as z,r as B,e as J,n as L,t as U}from"./featureConversionUtils-CmP9mw0r.js";import{m as W}from"./FeatureStore-CqSz6SOQ.js";import{x as E,j as b}from"./timeSupport-BjRbXIpn.js";import{$ as H}from"./QueryEngine-RpcY23Sv.js";import{I as V,N as K,E as Y}from"./geojson-BLwRz6JF.js";import{o as X,a as ee,i as te}from"./clientSideDefaults-CgRgH99f.js";import{j as ie,p as T,d as w,f as I,y as O}from"./sourceUtils-QX9lwl5p.js";import{Z as $}from"./FieldsIndex-CLgRNeJ_.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./BoundsStore-DMoG4U0L.js";import"./PooledRBush-BsFBmw1o.js";import"./json-Wa8cmqdu.js";import"./WhereClause-Dzgyc0wk.js";import"./TimeOnly-Cm47ew5I.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./QueryEngineCapabilities-CTDe3LlQ.js";import"./quantizationUtils-CUjGHrU3.js";import"./utils-B8iadP2F.js";import"./heatmapUtils-Clt5rJzr.js";import"./utils-SjO_-1JL.js";import"./utils-GMt8_G3w.js";import"./ClassBreaksDefinition-D281x8Sj.js";import"./RenderState-DaVlEYWY.js";import"./date-M6n_RqpC.js";import"./defaultsJSON-CHAaurhX.js";const se={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!1,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0}};class ke{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){var e;(e=this._queryEngine)==null||e.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e,t={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const n=[],[i]=await Promise.all([e.url?this._fetch(t==null?void 0:t.signal):null,this._checkProjection(e.spatialReference)]),s=V(i,{geometryType:e.geometryType}),o=e.fields||s.fields||[],d=e.hasZ!=null?e.hasZ:s.hasZ,p=s.geometryType;let m=e.objectIdField||s.objectIdFieldName||"__OBJECTID";const h=e.spatialReference||_;let r=e.timeInfo;o===s.fields&&s.unknownFields.length>0&&n.push({name:"geojson-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:s.unknownFields}});const l=new $(o);let u=l.get(m);u?(u.type!=="esriFieldTypeString"&&(u.type="esriFieldTypeOID"),u.editable=!1,u.nullable=!1,m=u.name):(u={alias:m,name:m,type:s.objectIdFieldType==="string"?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},o.unshift(u));const y={};for(const a of o){if(a.name==null&&(a.name=a.alias),a.alias==null&&(a.alias=a.name),!a.name)throw new F("geojson-layer:invalid-field-name","field name is missing",{field:a});if(!C.jsonValues.includes(a.type))throw new F("geojson-layer:invalid-field-type",`invalid type for field "${a.name}"`,{field:a});if(a.name!==u.name){const g=Q(a);g!==void 0&&(y[a.name]=g)}a.length==null&&(a.length=v(a))}if(r){if(r.startTimeField){const a=l.get(r.startTimeField);a?(r.startTimeField=a.name,a.type="esriFieldTypeDate"):r.startTimeField=null}if(r.endTimeField){const a=l.get(r.endTimeField);a?(r.endTimeField=a.name,a.type="esriFieldTypeDate"):r.endTimeField=null}if(r.trackIdField){const a=l.get(r.trackIdField);a?r.trackIdField=a.name:(r.trackIdField=null,n.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:r}}))}r.startTimeField||r.endTimeField||(n.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:r}}),r=null)}const c=p?X(p):void 0,j=l.dateFields.length?{timeZoneIANA:Z}:null,f={warnings:n,featureErrors:[],layerDefinition:{...se,drawingInfo:c??void 0,templates:ee(y),extent:void 0,geometryType:p,objectIdField:m,fields:o,hasZ:!!d,timeInfo:r,dateFieldsTimeReference:j}};this._queryEngine=new H({fieldsIndex:$.fromLayerJSON({fields:o,timeInfo:r,dateFieldsTimeReference:j}),geometryType:p,hasM:!1,hasZ:d,objectIdField:m,spatialReference:h,timeInfo:r,featureStore:new W({geometryType:p,hasM:!1,hasZ:d}),cacheSpatialQueries:!0});const q=this._queryEngine.fieldsIndex.requiredFields.indexOf(u);q>-1&&this._queryEngine.fieldsIndex.requiredFields.splice(q,1),this._createDefaultAttributes=te(y,m);const x=await this._createFeatures(i);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,x);const k=this._normalizeFeatures(x,f.featureErrors);this._queryEngine.featureStore.addMany(k);const{fullExtent:D,timeExtent:S}=await this._queryEngine.fetchRecomputedExtents();if(f.layerDefinition.extent=D,S){const{start:a,end:g}=S;f.layerDefinition.timeInfo.timeExtent=[a,g]}return f}async applyEdits(e){const{spatialReference:t,geometryType:n}=this._queryEngine;return await Promise.all([ie(t,n),E(e.adds,t),E(e.updates,t)]),await this._waitSnapshotComplete(),this._applyEdits(e)}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){var i;this._loadOptions.customParameters=e,(i=this._snapshotTask)==null||i.abort(),this._snapshotTask=A(this._snapshotFeatures),this._snapshotTask.promise.then(s=>{this._queryEngine.featureStore.clear(),this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,s);const o=this._normalizeFeatures(s);o&&this._queryEngine.featureStore.addMany(o)},s=>{this._queryEngine.featureStore.clear(),G(s)||P.getLogger("esri.layers.GeoJSONLayer").error(new F("geojson-layer:refresh","An error occurred during refresh",{error:s}))}),await this._waitSnapshotComplete();const{fullExtent:t,timeExtent:n}=await this._queryEngine.fetchRecomputedExtents();return{extent:t,timeExtent:n}}async _createFeatures(e){if(e==null)return[];const{geometryType:t,hasZ:n,objectIdField:i}=this._queryEngine,s=K(e,{geometryType:t,hasZ:n,objectIdField:i});if(!M(this._queryEngine.spatialReference,_))for(const o of s)o.geometry!=null&&(o.geometry=z(b(B(o.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),_,this._queryEngine.spatialReference)));return s}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(e){const{url:t,customParameters:n}=this._loadOptions,i=(await N(t,{responseType:"json",query:{...n},signal:e})).data;return Y(i),i}_normalizeFeatures(e,t){const{objectIdField:n,fieldsIndex:i}=this._queryEngine,s=[];for(const o of e){const d=this._createDefaultAttributes(),p=T(i,d,o.attributes,!0);p?t==null||t.push(p):(this._assignObjectId(d,o.attributes,!0),o.attributes=d,o.objectId=d[n],s.push(o))}return s}async _applyEdits(e){const{adds:t,updates:n,deletes:i}=e,s={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t!=null&&t.length&&this._applyAddEdits(s,t),n!=null&&n.length&&this._applyUpdateEdits(s,n),i==null?void 0:i.length){for(const p of i)s.deleteResults.push(w(p));this._queryEngine.featureStore.removeManyById(i)}const{fullExtent:o,timeExtent:d}=await this._queryEngine.fetchRecomputedExtents();return{extent:o,timeExtent:d,featureEditResults:s}}_applyAddEdits(e,t){const{addResults:n}=e,{geometryType:i,hasM:s,hasZ:o,objectIdField:d,spatialReference:p,featureStore:m,fieldsIndex:h}=this._queryEngine,r=[];for(const l of t){if(l.geometry&&i!==R(l.geometry)){n.push(I("Incorrect geometry type."));continue}const u=this._createDefaultAttributes(),y=T(h,u,l.attributes);if(y)n.push(y);else{if(this._assignObjectId(u,l.attributes),l.attributes=u,l.uid!=null){const c=l.attributes[d];e.uidToObjectId[l.uid]=c}if(l.geometry!=null){const c=l.geometry.spatialReference??p;l.geometry=b(O(l.geometry,c),c,p)}r.push(l),n.push(w(l.attributes[d]))}}m.addMany(J([],r,i,o,s,d))}_applyUpdateEdits({updateResults:e},t){const{geometryType:n,hasM:i,hasZ:s,objectIdField:o,spatialReference:d,featureStore:p,fieldsIndex:m}=this._queryEngine;for(const h of t){const{attributes:r,geometry:l}=h,u=r==null?void 0:r[o];if(u==null){e.push(I(`Identifier field ${o} missing`));continue}if(!p.has(u)){e.push(I(`Feature with object id ${u} missing`));continue}const y=L(p.getFeature(u),n,s,i);if(l!=null){if(n!==R(l)){e.push(I("Incorrect geometry type."));continue}const c=l.spatialReference??d;y.geometry=b(O(l,c),c,d)}if(r){const c=T(m,y.attributes,r);if(c){e.push(c);continue}}p.add(U(y,n,s,i,o)),e.push(w(u))}}_createObjectIdGenerator(e,t){const n=e.fieldsIndex.get(e.objectIdField);if(n.type==="esriFieldTypeString")return()=>n.name+"-"+Date.now().toString(16);let i=Number.NEGATIVE_INFINITY;for(const s of t)s.objectId&&(i=Math.max(i,s.objectId));return i=Math.max(0,i)+1,()=>i++}_assignObjectId(e,t,n=!1){const i=this._queryEngine.objectIdField;e[i]=n&&i in t?t[i]:this._objectIdGenerator()}async _checkProjection(e){try{await E(_,e)}catch{throw new F("geojson-layer","Projection not supported")}}}export{ke as default}; +import{cB as _,N as F,cC as C,T as Q,cD as v,W as Z,cE as A,b as G,s as P,G as M,M as N,cF as R}from"./index-BjUNJPVf.js";import{o as z,r as B,e as J,n as L,t as U}from"./featureConversionUtils-BHhm7bvm.js";import{m as W}from"./FeatureStore-CRMzrhIt.js";import{x as E,j as b}from"./timeSupport-DXkhlToK.js";import{$ as H}from"./QueryEngine-loUu1VUW.js";import{I as V,N as K,E as Y}from"./geojson-AjfTISUf.js";import{o as X,a as ee,i as te}from"./clientSideDefaults-BQP5n3lX.js";import{j as ie,p as T,d as w,f as I,y as O}from"./sourceUtils-BNTaqxhX.js";import{Z as $}from"./FieldsIndex-CK-0B5n9.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./BoundsStore-DRDtG3Mk.js";import"./PooledRBush-BlFOlUgK.js";import"./json-Wa8cmqdu.js";import"./WhereClause-Ctld7DSu.js";import"./TimeOnly-BXSODLxA.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./QueryEngineCapabilities-CTDe3LlQ.js";import"./quantizationUtils-CfV316jZ.js";import"./utils-BKh1cxpi.js";import"./heatmapUtils-BSteZBTj.js";import"./utils-Bzmbfe7p.js";import"./utils-CY1ReiSd.js";import"./ClassBreaksDefinition-Djcxa8Lp.js";import"./RenderState-DaVlEYWY.js";import"./date-M6n_RqpC.js";import"./defaultsJSON-CHAaurhX.js";const se={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!1,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0}};class ke{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){var e;(e=this._queryEngine)==null||e.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e,t={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const n=[],[i]=await Promise.all([e.url?this._fetch(t==null?void 0:t.signal):null,this._checkProjection(e.spatialReference)]),s=V(i,{geometryType:e.geometryType}),o=e.fields||s.fields||[],d=e.hasZ!=null?e.hasZ:s.hasZ,p=s.geometryType;let m=e.objectIdField||s.objectIdFieldName||"__OBJECTID";const h=e.spatialReference||_;let r=e.timeInfo;o===s.fields&&s.unknownFields.length>0&&n.push({name:"geojson-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:s.unknownFields}});const l=new $(o);let u=l.get(m);u?(u.type!=="esriFieldTypeString"&&(u.type="esriFieldTypeOID"),u.editable=!1,u.nullable=!1,m=u.name):(u={alias:m,name:m,type:s.objectIdFieldType==="string"?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},o.unshift(u));const y={};for(const a of o){if(a.name==null&&(a.name=a.alias),a.alias==null&&(a.alias=a.name),!a.name)throw new F("geojson-layer:invalid-field-name","field name is missing",{field:a});if(!C.jsonValues.includes(a.type))throw new F("geojson-layer:invalid-field-type",`invalid type for field "${a.name}"`,{field:a});if(a.name!==u.name){const g=Q(a);g!==void 0&&(y[a.name]=g)}a.length==null&&(a.length=v(a))}if(r){if(r.startTimeField){const a=l.get(r.startTimeField);a?(r.startTimeField=a.name,a.type="esriFieldTypeDate"):r.startTimeField=null}if(r.endTimeField){const a=l.get(r.endTimeField);a?(r.endTimeField=a.name,a.type="esriFieldTypeDate"):r.endTimeField=null}if(r.trackIdField){const a=l.get(r.trackIdField);a?r.trackIdField=a.name:(r.trackIdField=null,n.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:r}}))}r.startTimeField||r.endTimeField||(n.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:r}}),r=null)}const c=p?X(p):void 0,j=l.dateFields.length?{timeZoneIANA:Z}:null,f={warnings:n,featureErrors:[],layerDefinition:{...se,drawingInfo:c??void 0,templates:ee(y),extent:void 0,geometryType:p,objectIdField:m,fields:o,hasZ:!!d,timeInfo:r,dateFieldsTimeReference:j}};this._queryEngine=new H({fieldsIndex:$.fromLayerJSON({fields:o,timeInfo:r,dateFieldsTimeReference:j}),geometryType:p,hasM:!1,hasZ:d,objectIdField:m,spatialReference:h,timeInfo:r,featureStore:new W({geometryType:p,hasM:!1,hasZ:d}),cacheSpatialQueries:!0});const q=this._queryEngine.fieldsIndex.requiredFields.indexOf(u);q>-1&&this._queryEngine.fieldsIndex.requiredFields.splice(q,1),this._createDefaultAttributes=te(y,m);const x=await this._createFeatures(i);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,x);const k=this._normalizeFeatures(x,f.featureErrors);this._queryEngine.featureStore.addMany(k);const{fullExtent:D,timeExtent:S}=await this._queryEngine.fetchRecomputedExtents();if(f.layerDefinition.extent=D,S){const{start:a,end:g}=S;f.layerDefinition.timeInfo.timeExtent=[a,g]}return f}async applyEdits(e){const{spatialReference:t,geometryType:n}=this._queryEngine;return await Promise.all([ie(t,n),E(e.adds,t),E(e.updates,t)]),await this._waitSnapshotComplete(),this._applyEdits(e)}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){var i;this._loadOptions.customParameters=e,(i=this._snapshotTask)==null||i.abort(),this._snapshotTask=A(this._snapshotFeatures),this._snapshotTask.promise.then(s=>{this._queryEngine.featureStore.clear(),this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,s);const o=this._normalizeFeatures(s);o&&this._queryEngine.featureStore.addMany(o)},s=>{this._queryEngine.featureStore.clear(),G(s)||P.getLogger("esri.layers.GeoJSONLayer").error(new F("geojson-layer:refresh","An error occurred during refresh",{error:s}))}),await this._waitSnapshotComplete();const{fullExtent:t,timeExtent:n}=await this._queryEngine.fetchRecomputedExtents();return{extent:t,timeExtent:n}}async _createFeatures(e){if(e==null)return[];const{geometryType:t,hasZ:n,objectIdField:i}=this._queryEngine,s=K(e,{geometryType:t,hasZ:n,objectIdField:i});if(!M(this._queryEngine.spatialReference,_))for(const o of s)o.geometry!=null&&(o.geometry=z(b(B(o.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),_,this._queryEngine.spatialReference)));return s}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(e){const{url:t,customParameters:n}=this._loadOptions,i=(await N(t,{responseType:"json",query:{...n},signal:e})).data;return Y(i),i}_normalizeFeatures(e,t){const{objectIdField:n,fieldsIndex:i}=this._queryEngine,s=[];for(const o of e){const d=this._createDefaultAttributes(),p=T(i,d,o.attributes,!0);p?t==null||t.push(p):(this._assignObjectId(d,o.attributes,!0),o.attributes=d,o.objectId=d[n],s.push(o))}return s}async _applyEdits(e){const{adds:t,updates:n,deletes:i}=e,s={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t!=null&&t.length&&this._applyAddEdits(s,t),n!=null&&n.length&&this._applyUpdateEdits(s,n),i==null?void 0:i.length){for(const p of i)s.deleteResults.push(w(p));this._queryEngine.featureStore.removeManyById(i)}const{fullExtent:o,timeExtent:d}=await this._queryEngine.fetchRecomputedExtents();return{extent:o,timeExtent:d,featureEditResults:s}}_applyAddEdits(e,t){const{addResults:n}=e,{geometryType:i,hasM:s,hasZ:o,objectIdField:d,spatialReference:p,featureStore:m,fieldsIndex:h}=this._queryEngine,r=[];for(const l of t){if(l.geometry&&i!==R(l.geometry)){n.push(I("Incorrect geometry type."));continue}const u=this._createDefaultAttributes(),y=T(h,u,l.attributes);if(y)n.push(y);else{if(this._assignObjectId(u,l.attributes),l.attributes=u,l.uid!=null){const c=l.attributes[d];e.uidToObjectId[l.uid]=c}if(l.geometry!=null){const c=l.geometry.spatialReference??p;l.geometry=b(O(l.geometry,c),c,p)}r.push(l),n.push(w(l.attributes[d]))}}m.addMany(J([],r,i,o,s,d))}_applyUpdateEdits({updateResults:e},t){const{geometryType:n,hasM:i,hasZ:s,objectIdField:o,spatialReference:d,featureStore:p,fieldsIndex:m}=this._queryEngine;for(const h of t){const{attributes:r,geometry:l}=h,u=r==null?void 0:r[o];if(u==null){e.push(I(`Identifier field ${o} missing`));continue}if(!p.has(u)){e.push(I(`Feature with object id ${u} missing`));continue}const y=L(p.getFeature(u),n,s,i);if(l!=null){if(n!==R(l)){e.push(I("Incorrect geometry type."));continue}const c=l.spatialReference??d;y.geometry=b(O(l,c),c,d)}if(r){const c=T(m,y.attributes,r);if(c){e.push(c);continue}}p.add(U(y,n,s,i,o)),e.push(w(u))}}_createObjectIdGenerator(e,t){const n=e.fieldsIndex.get(e.objectIdField);if(n.type==="esriFieldTypeString")return()=>n.name+"-"+Date.now().toString(16);let i=Number.NEGATIVE_INFINITY;for(const s of t)s.objectId&&(i=Math.max(i,s.objectId));return i=Math.max(0,i)+1,()=>i++}_assignObjectId(e,t,n=!1){const i=this._queryEngine.objectIdField;e[i]=n&&i in t?t[i]:this._objectIdGenerator()}async _checkProjection(e){try{await E(_,e)}catch{throw new F("geojson-layer","Projection not supported")}}}export{ke as default}; diff --git a/assets/GeoRSSLayer-8bgy1uXP.js b/assets/GeoRSSLayer-DBDQfWhL.js similarity index 96% rename from assets/GeoRSSLayer-8bgy1uXP.js rename to assets/GeoRSSLayer-DBDQfWhL.js index b3baadd..3cfe048 100644 --- a/assets/GeoRSSLayer-8bgy1uXP.js +++ b/assets/GeoRSSLayer-DBDQfWhL.js @@ -1 +1 @@ -import{bP as y,dp as p,dq as d,bQ as u,dr as c,bV as h,ay as m,M as S,cG as f,bE as v,d as o,y as s,aZ as g,aE as b,ds as C,dt as G,du as P,f as w,dv as n,dw as x,dx as _,dy as R,dz as k,bT as E}from"./index-CEWggaxV.js";import{f as $}from"./RefreshableLayer-1EkEhJeI.js";const j=["atom","xml"],F={base:n,key:"type",typeMap:{"simple-line":x},errorContext:"symbol"},M={base:n,key:"type",typeMap:{"picture-marker":_,"simple-marker":R},errorContext:"symbol"},T={base:n,key:"type",typeMap:{"simple-fill":k},errorContext:"symbol"};let t=class extends y($(p(d(u(c(E)))))){constructor(...e){super(...e),this.description=null,this.fullExtent=null,this.legendEnabled=!0,this.lineSymbol=null,this.pointSymbol=null,this.polygonSymbol=null,this.operationalLayerType="GeoRSS",this.url=null,this.type="geo-rss"}normalizeCtorArgs(e,r){return typeof e=="string"?{url:e,...r}:e}readFeatureCollections(e,r){return r.featureCollection.layers.forEach(i=>{var a;const l=i.layerDefinition.drawingInfo.renderer.symbol;l&&l.type==="esriSFS"&&((a=l.outline)!=null&&a.style.includes("esriSFS"))&&(l.outline.style="esriSLSSolid")}),r.featureCollection.layers}get hasPoints(){return this._hasGeometry("esriGeometryPoint")}get hasPolylines(){return this._hasGeometry("esriGeometryPolyline")}get hasPolygons(){return this._hasGeometry("esriGeometryPolygon")}get title(){const e=this._get("title");return e&&this.originOf("title")!=="defaults"?e:this.url?h(this.url,j)||"GeoRSS":e||""}set title(e){this._set("title",e)}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service","Feature Service","Feature Collection","Scene Service"]},e).catch(m).then(()=>this._fetchService(r)).then(i=>{this.read(i,{origin:"service"})})),Promise.resolve(this)}async hasDataChanged(){const e=await this._fetchService();return this.read(e,{origin:"service",ignoreDefaults:!0}),!0}async _fetchService(e){const r=this.spatialReference,{data:i}=await S(v.geoRSSServiceUrl,{query:{url:this.url,refresh:!!this.loaded||void 0,outSR:f(r)?void 0:r.wkid??JSON.stringify(r)},signal:e});return i}_hasGeometry(e){var r;return((r=this.featureCollections)==null?void 0:r.some(i=>{var l,a;return((l=i.featureSet)==null?void 0:l.geometryType)===e&&((a=i.featureSet.features)==null?void 0:a.length)>0}))??!1}};o([s()],t.prototype,"description",void 0),o([s()],t.prototype,"featureCollections",void 0),o([g("service","featureCollections",["featureCollection.layers"])],t.prototype,"readFeatureCollections",null),o([s({type:b,json:{name:"lookAtExtent"}})],t.prototype,"fullExtent",void 0),o([s(C)],t.prototype,"id",void 0),o([s(G)],t.prototype,"legendEnabled",void 0),o([s({types:F,json:{write:!0}})],t.prototype,"lineSymbol",void 0),o([s({type:["show","hide"]})],t.prototype,"listMode",void 0),o([s({types:M,json:{write:!0}})],t.prototype,"pointSymbol",void 0),o([s({types:T,json:{write:!0}})],t.prototype,"polygonSymbol",void 0),o([s({type:["GeoRSS"]})],t.prototype,"operationalLayerType",void 0),o([s(P)],t.prototype,"url",void 0),o([s({json:{origins:{service:{read:{source:"name",reader:e=>e||void 0}}}}})],t.prototype,"title",null),o([s({readOnly:!0,json:{read:!1},value:"geo-rss"})],t.prototype,"type",void 0),t=o([w("esri.layers.GeoRSSLayer")],t);const O=t;export{O as default}; +import{bP as y,dp as p,dq as d,bQ as u,dr as c,bV as h,ay as m,M as S,cG as f,bE as v,d as o,y as s,aZ as g,aE as b,ds as C,dt as G,du as P,f as w,dv as n,dw as x,dx as _,dy as R,dz as k,bT as E}from"./index-BjUNJPVf.js";import{f as $}from"./RefreshableLayer-_r2TPtol.js";const j=["atom","xml"],F={base:n,key:"type",typeMap:{"simple-line":x},errorContext:"symbol"},M={base:n,key:"type",typeMap:{"picture-marker":_,"simple-marker":R},errorContext:"symbol"},T={base:n,key:"type",typeMap:{"simple-fill":k},errorContext:"symbol"};let t=class extends y($(p(d(u(c(E)))))){constructor(...e){super(...e),this.description=null,this.fullExtent=null,this.legendEnabled=!0,this.lineSymbol=null,this.pointSymbol=null,this.polygonSymbol=null,this.operationalLayerType="GeoRSS",this.url=null,this.type="geo-rss"}normalizeCtorArgs(e,r){return typeof e=="string"?{url:e,...r}:e}readFeatureCollections(e,r){return r.featureCollection.layers.forEach(i=>{var a;const l=i.layerDefinition.drawingInfo.renderer.symbol;l&&l.type==="esriSFS"&&((a=l.outline)!=null&&a.style.includes("esriSFS"))&&(l.outline.style="esriSLSSolid")}),r.featureCollection.layers}get hasPoints(){return this._hasGeometry("esriGeometryPoint")}get hasPolylines(){return this._hasGeometry("esriGeometryPolyline")}get hasPolygons(){return this._hasGeometry("esriGeometryPolygon")}get title(){const e=this._get("title");return e&&this.originOf("title")!=="defaults"?e:this.url?h(this.url,j)||"GeoRSS":e||""}set title(e){this._set("title",e)}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service","Feature Service","Feature Collection","Scene Service"]},e).catch(m).then(()=>this._fetchService(r)).then(i=>{this.read(i,{origin:"service"})})),Promise.resolve(this)}async hasDataChanged(){const e=await this._fetchService();return this.read(e,{origin:"service",ignoreDefaults:!0}),!0}async _fetchService(e){const r=this.spatialReference,{data:i}=await S(v.geoRSSServiceUrl,{query:{url:this.url,refresh:!!this.loaded||void 0,outSR:f(r)?void 0:r.wkid??JSON.stringify(r)},signal:e});return i}_hasGeometry(e){var r;return((r=this.featureCollections)==null?void 0:r.some(i=>{var l,a;return((l=i.featureSet)==null?void 0:l.geometryType)===e&&((a=i.featureSet.features)==null?void 0:a.length)>0}))??!1}};o([s()],t.prototype,"description",void 0),o([s()],t.prototype,"featureCollections",void 0),o([g("service","featureCollections",["featureCollection.layers"])],t.prototype,"readFeatureCollections",null),o([s({type:b,json:{name:"lookAtExtent"}})],t.prototype,"fullExtent",void 0),o([s(C)],t.prototype,"id",void 0),o([s(G)],t.prototype,"legendEnabled",void 0),o([s({types:F,json:{write:!0}})],t.prototype,"lineSymbol",void 0),o([s({type:["show","hide"]})],t.prototype,"listMode",void 0),o([s({types:M,json:{write:!0}})],t.prototype,"pointSymbol",void 0),o([s({types:T,json:{write:!0}})],t.prototype,"polygonSymbol",void 0),o([s({type:["GeoRSS"]})],t.prototype,"operationalLayerType",void 0),o([s(P)],t.prototype,"url",void 0),o([s({json:{origins:{service:{read:{source:"name",reader:e=>e||void 0}}}}})],t.prototype,"title",null),o([s({readOnly:!0,json:{read:!1},value:"geo-rss"})],t.prototype,"type",void 0),t=o([w("esri.layers.GeoRSSLayer")],t);const O=t;export{O as default}; diff --git a/assets/GeoRSSLayerView2D-DGBAg8jk.js b/assets/GeoRSSLayerView2D-DvkynA-l.js similarity index 53% rename from assets/GeoRSSLayerView2D-DGBAg8jk.js rename to assets/GeoRSSLayerView2D-DvkynA-l.js index 163eb48..6a08972 100644 --- a/assets/GeoRSSLayerView2D-DGBAg8jk.js +++ b/assets/GeoRSSLayerView2D-DvkynA-l.js @@ -1 +1 @@ -import{g as l,P as h,V as g,i as f,d as w,f as d}from"./index-CEWggaxV.js";import{t as u,m as n}from"./jsonUtils-BseLl1fZ.js";import{d as V}from"./FeatureSet-CYJUZgOk.js";import{m as b,u as S}from"./LayerView-BEFTHNYv.js";import{t as _}from"./GraphicContainer-CbvswCG0.js";import{$ as T}from"./GraphicsView2D-DbbthiwV.js";import"./UniqueValueRenderer-BlkUix3g.js";import"./ColorStop-44hBlQ14.js";import"./diffUtils-B4YFa5Ju.js";import"./colorRamps-BJydlf0f.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-z2k12BH8.js";import"./jsonUtils-qYmXvGJ1.js";import"./styleUtils-CnV_Xzhi.js";import"./Version-Bd0QsIQ5.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./OverrideHelper-B4ryGWZb.js";import"./utils-p-5Bbga5.js";import"./quantizationUtils-CUjGHrU3.js";import"./heatmapUtils-Clt5rJzr.js";import"./scaleUtils-Bqauo1zZ.js";import"./Container-CB7SlLB9.js";import"./highlightReasons-DbgbcWKM.js";import"./Texture-DJgkMrSB.js";import"./AGraphicContainer-Dby-baET.js";import"./TechniqueInstance-CSsTmbek.js";import"./UpdateTracking2D-nj9Q-3df.js";import"./TurboLine-CkxIB4ZX.js";import"./earcut-hRlx3adE.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./Rect-CUzevAry.js";import"./LabelMetric-D2hbzzy_.js";import"./Program-DLRmaKpw.js";import"./labelUtils-Dnqx6jl5.js";import"./defaultsJSON-CHAaurhX.js";import"./BindType-BmZEZMMh.js";import"./Util-BS8sJGjF.js";import"./constants-D5zmR9t2.js";import"./TileContainer-Ci6dOowA.js";import"./WGLContainer-B_Pv-8Yi.js";import"./ProgramTemplate-BICQrNzS.js";import"./config-MDUrh2eL.js";import"./featureConversionUtils-CmP9mw0r.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./FeatureCommandQueue-Btq_FXyi.js";import"./vec3f32-nZdmKIgz.js";import"./AttributeStore-Ck-75lnq.js";import"./TimeOnly-Cm47ew5I.js";import"./timeSupport-BjRbXIpn.js";import"./json-Wa8cmqdu.js";import"./normalizeUtilsSync-B6VufdiX.js";let y=class extends b(S){constructor(){super(...arguments),this._graphicsViewMap={},this._popupTemplates=new Map,this.graphicsViews=[]}async hitTest(t,r){if(!this.graphicsViews.length)return null;const o=this.layer;return this.graphicsViews.reverse().flatMap(e=>{const i=this._popupTemplates.get(e),s=e.hitTest(t);for(const p of s)p.layer=o,p.sourceLayer=o,p.popupTemplate=i;return s}).map(e=>({type:"graphic",graphic:e,layer:o,mapPoint:t}))}update(t){if(this.graphicsViews)for(const r of this.graphicsViews)r.processUpdate(t)}attach(){this.addAttachHandles([l(()=>{var t;return(t=this.layer)==null?void 0:t.featureCollections},t=>{this._clear();for(const{popupInfo:r,featureSet:o,layerDefinition:e}of t){const i=V.fromJSON(o),s=new g(i.features),p=e.drawingInfo,c=r?f.fromJSON(r):null,m=u(p.renderer),a=new T({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:s,renderer:m,container:new _(this.view.featuresTilingScheme)});this._graphicsViewMap[i.geometryType]=a,this._popupTemplates.set(a,c),i.geometryType!=="polygon"||this.layer.polygonSymbol?i.geometryType!=="polyline"||this.layer.lineSymbol?i.geometryType!=="point"||this.layer.pointSymbol||(this.layer.pointSymbol=m.symbol):this.layer.lineSymbol=m.symbol:this.layer.polygonSymbol=m.symbol,this.graphicsViews.push(a),this.container.addChild(a.container)}},h),l(()=>{var t;return(t=this.layer)==null?void 0:t.polygonSymbol},t=>{this._graphicsViewMap.polygon.renderer=new n({symbol:t})},h),l(()=>{var t;return(t=this.layer)==null?void 0:t.lineSymbol},t=>{this._graphicsViewMap.polyline.renderer=new n({symbol:t})},h),l(()=>{var t;return(t=this.layer)==null?void 0:t.pointSymbol},t=>{this._graphicsViewMap.point.renderer=new n({symbol:t})},h)])}detach(){this._clear()}moveStart(){}moveEnd(){}viewChange(){for(const t of this.graphicsViews)t.viewChange()}_clear(){this.container.removeAllChildren();for(const t of this.graphicsViews)t.destroy();this._graphicsViewMap={},this._popupTemplates.clear(),this.graphicsViews.length=0}};y=w([d("esri.views.2d.layers.GeoRSSLayerView2D")],y);const _t=y;export{_t as default}; +import{g as l,P as h,V as g,i as f,d as w,f as d}from"./index-BjUNJPVf.js";import{t as u,m as n}from"./jsonUtils-Dw332y6z.js";import{d as V}from"./FeatureSet-opEn8ou8.js";import{m as b,u as S}from"./LayerView-Bux7vAEn.js";import{t as _}from"./GraphicContainer-Bue3JF2r.js";import{$ as T}from"./GraphicsView2D-B7H8XAnI.js";import"./UniqueValueRenderer-7V9Bhr-D.js";import"./ColorStop-DCGjAKLC.js";import"./diffUtils-uUoMDFQS.js";import"./colorRamps-CcakIWlU.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-BX9G5gNQ.js";import"./jsonUtils-Ox5U0P0F.js";import"./styleUtils-DOUOskVZ.js";import"./Version-Dqq_CHBG.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./OverrideHelper-DxFZBnGL.js";import"./utils-CuXO_Zzq.js";import"./quantizationUtils-CfV316jZ.js";import"./heatmapUtils-BSteZBTj.js";import"./scaleUtils-DWXMiS7R.js";import"./Container-_n5wCgez.js";import"./highlightReasons-BOU4mnPE.js";import"./Texture-S4dD-WHn.js";import"./AGraphicContainer-BXk7Eu6w.js";import"./TechniqueInstance-XtnK2qy2.js";import"./UpdateTracking2D-Ds_Gdrxd.js";import"./TurboLine-DNQdPIXo.js";import"./earcut-CWKXDqDj.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./Rect-CUzevAry.js";import"./LabelMetric-BcUxDImF.js";import"./Program-DBsYtQ00.js";import"./labelUtils-3p0-m-Ee.js";import"./defaultsJSON-CHAaurhX.js";import"./BindType-BmZEZMMh.js";import"./Util-CS5u4Lec.js";import"./constants-D5zmR9t2.js";import"./TileContainer-Bs-vXdD_.js";import"./WGLContainer-DgZNq7b0.js";import"./ProgramTemplate-Ck2I0bIi.js";import"./config-MDUrh2eL.js";import"./featureConversionUtils-BHhm7bvm.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./FeatureCommandQueue-DI81F3gA.js";import"./vec3f32-nZdmKIgz.js";import"./AttributeStore-Bm6hLtR1.js";import"./TimeOnly-BXSODLxA.js";import"./timeSupport-DXkhlToK.js";import"./json-Wa8cmqdu.js";import"./normalizeUtilsSync-73yZ0QwV.js";let y=class extends b(S){constructor(){super(...arguments),this._graphicsViewMap={},this._popupTemplates=new Map,this.graphicsViews=[]}async hitTest(t,r){if(!this.graphicsViews.length)return null;const o=this.layer;return this.graphicsViews.reverse().flatMap(e=>{const i=this._popupTemplates.get(e),s=e.hitTest(t);for(const p of s)p.layer=o,p.sourceLayer=o,p.popupTemplate=i;return s}).map(e=>({type:"graphic",graphic:e,layer:o,mapPoint:t}))}update(t){if(this.graphicsViews)for(const r of this.graphicsViews)r.processUpdate(t)}attach(){this.addAttachHandles([l(()=>{var t;return(t=this.layer)==null?void 0:t.featureCollections},t=>{this._clear();for(const{popupInfo:r,featureSet:o,layerDefinition:e}of t){const i=V.fromJSON(o),s=new g(i.features),p=e.drawingInfo,c=r?f.fromJSON(r):null,m=u(p.renderer),a=new T({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:s,renderer:m,container:new _(this.view.featuresTilingScheme)});this._graphicsViewMap[i.geometryType]=a,this._popupTemplates.set(a,c),i.geometryType!=="polygon"||this.layer.polygonSymbol?i.geometryType!=="polyline"||this.layer.lineSymbol?i.geometryType!=="point"||this.layer.pointSymbol||(this.layer.pointSymbol=m.symbol):this.layer.lineSymbol=m.symbol:this.layer.polygonSymbol=m.symbol,this.graphicsViews.push(a),this.container.addChild(a.container)}},h),l(()=>{var t;return(t=this.layer)==null?void 0:t.polygonSymbol},t=>{this._graphicsViewMap.polygon.renderer=new n({symbol:t})},h),l(()=>{var t;return(t=this.layer)==null?void 0:t.lineSymbol},t=>{this._graphicsViewMap.polyline.renderer=new n({symbol:t})},h),l(()=>{var t;return(t=this.layer)==null?void 0:t.pointSymbol},t=>{this._graphicsViewMap.point.renderer=new n({symbol:t})},h)])}detach(){this._clear()}moveStart(){}moveEnd(){}viewChange(){for(const t of this.graphicsViews)t.viewChange()}_clear(){this.container.removeAllChildren();for(const t of this.graphicsViews)t.destroy();this._graphicsViewMap={},this._popupTemplates.clear(),this.graphicsViews.length=0}};y=w([d("esri.views.2d.layers.GeoRSSLayerView2D")],y);const _t=y;export{_t as default}; diff --git a/assets/GraphQueryStreaming-ofadKoJ9.js b/assets/GraphQueryStreaming-BDRIPeal.js similarity index 96% rename from assets/GraphQueryStreaming-ofadKoJ9.js rename to assets/GraphQueryStreaming-BDRIPeal.js index 096228b..e07d174 100644 --- a/assets/GraphQueryStreaming-ofadKoJ9.js +++ b/assets/GraphQueryStreaming-BDRIPeal.js @@ -1 +1 @@ -import{d as t,y as e,f as o,aU as h,aA as G,aC as w,a7 as g}from"./index-CEWggaxV.js";let a=class extends h{constructor(s){super(s),this.properties=null}};t([e({json:{write:!0}})],a.prototype,"properties",void 0),a=t([o("esri.rest.knowledgeGraph.GraphObject")],a);const c=a;let i=class extends c{constructor(s){super(s),this.typeName=null,this.id=null}};t([e({type:String,json:{write:!0}})],i.prototype,"typeName",void 0),t([e({type:String,json:{write:!0}})],i.prototype,"id",void 0),i=t([o("esri.rest.knowledgeGraph.GraphNamedObject")],i);const m=i;let l=class extends m{constructor(s){super(s),this.layoutGeometry=null}};t([e({type:G,json:{write:!0}})],l.prototype,"layoutGeometry",void 0),l=t([o("esri.rest.knowledgeGraph.Entity")],l);const S=l;let n=class extends m{constructor(r){super(r),this.originId=null,this.destinationId=null,this.layoutGeometry=null}};t([e({type:String,json:{write:!0}})],n.prototype,"originId",void 0),t([e({type:String,json:{write:!0}})],n.prototype,"destinationId",void 0),t([e({type:w,json:{write:!0}})],n.prototype,"layoutGeometry",void 0),n=t([o("esri.rest.Relationship.Relationship")],n);const b=n;let y=class extends c{constructor(r){super(r)}};y=t([o("esri.rest.knowledgeGraph.ObjectValue")],y);const k=y;let u=class extends h{constructor(s){super(s),this.path=null}};t([e({type:[c],json:{write:!0}})],u.prototype,"path",void 0),u=t([o("esri.rest.knowledgeGraph.Path")],u);const f=u;let d=class extends g{constructor(r){super(r),this.openCypherQuery=""}};t([e()],d.prototype,"openCypherQuery",void 0),d=t([o("esri.rest.knowledgeGraph.GraphQuery")],d);const v=d;let p=class extends v{constructor(r){super(r),this.bindParameters=null,this.bindGeometryQuantizationParameters=null,this.outputQuantizationParameters=null,this.outputSpatialReference=null}};t([e()],p.prototype,"bindParameters",void 0),t([e()],p.prototype,"bindGeometryQuantizationParameters",void 0),t([e()],p.prototype,"outputQuantizationParameters",void 0),t([e()],p.prototype,"outputSpatialReference",void 0),p=t([o("esri.rest.knowledgeGraph.GraphQueryStreaming")],p);const z=p;export{z as a,f as c,S as m,b as p,k as t}; +import{d as t,y as e,f as o,aU as h,aA as G,aC as w,a7 as g}from"./index-BjUNJPVf.js";let a=class extends h{constructor(s){super(s),this.properties=null}};t([e({json:{write:!0}})],a.prototype,"properties",void 0),a=t([o("esri.rest.knowledgeGraph.GraphObject")],a);const c=a;let i=class extends c{constructor(s){super(s),this.typeName=null,this.id=null}};t([e({type:String,json:{write:!0}})],i.prototype,"typeName",void 0),t([e({type:String,json:{write:!0}})],i.prototype,"id",void 0),i=t([o("esri.rest.knowledgeGraph.GraphNamedObject")],i);const m=i;let l=class extends m{constructor(s){super(s),this.layoutGeometry=null}};t([e({type:G,json:{write:!0}})],l.prototype,"layoutGeometry",void 0),l=t([o("esri.rest.knowledgeGraph.Entity")],l);const S=l;let n=class extends m{constructor(r){super(r),this.originId=null,this.destinationId=null,this.layoutGeometry=null}};t([e({type:String,json:{write:!0}})],n.prototype,"originId",void 0),t([e({type:String,json:{write:!0}})],n.prototype,"destinationId",void 0),t([e({type:w,json:{write:!0}})],n.prototype,"layoutGeometry",void 0),n=t([o("esri.rest.Relationship.Relationship")],n);const b=n;let y=class extends c{constructor(r){super(r)}};y=t([o("esri.rest.knowledgeGraph.ObjectValue")],y);const k=y;let u=class extends h{constructor(s){super(s),this.path=null}};t([e({type:[c],json:{write:!0}})],u.prototype,"path",void 0),u=t([o("esri.rest.knowledgeGraph.Path")],u);const f=u;let d=class extends g{constructor(r){super(r),this.openCypherQuery=""}};t([e()],d.prototype,"openCypherQuery",void 0),d=t([o("esri.rest.knowledgeGraph.GraphQuery")],d);const v=d;let p=class extends v{constructor(r){super(r),this.bindParameters=null,this.bindGeometryQuantizationParameters=null,this.outputQuantizationParameters=null,this.outputSpatialReference=null}};t([e()],p.prototype,"bindParameters",void 0),t([e()],p.prototype,"bindGeometryQuantizationParameters",void 0),t([e()],p.prototype,"outputQuantizationParameters",void 0),t([e()],p.prototype,"outputSpatialReference",void 0),p=t([o("esri.rest.knowledgeGraph.GraphQueryStreaming")],p);const z=p;export{z as a,f as c,S as m,b as p,k as t}; diff --git a/assets/GraphicContainer-CbvswCG0.js b/assets/GraphicContainer-Bue3JF2r.js similarity index 76% rename from assets/GraphicContainer-CbvswCG0.js rename to assets/GraphicContainer-Bue3JF2r.js index 14a1887..ea2f935 100644 --- a/assets/GraphicContainer-CbvswCG0.js +++ b/assets/GraphicContainer-Bue3JF2r.js @@ -1 +1 @@ -import{E as t,R as h,a as s}from"./Container-CB7SlLB9.js";import{i}from"./AGraphicContainer-Dby-baET.js";class l extends i{renderChildren(e){for(const r of this.children)r.setTransform(e.state);if(super.renderChildren(e),this.attributeView.update(),this.children.some(r=>r.hasData)){switch(e.drawPhase){case t.MAP:this._renderChildren(e,h.All);break;case t.HIGHLIGHT:this.hasHighlight&&this._renderHighlight(e)}this._boundsRenderer&&this._boundsRenderer.doRender(e)}}_renderHighlight(e){s(e,!1,r=>{this._renderChildren(r,h.Highlight)})}}export{l as t}; +import{E as t,R as h,a as s}from"./Container-_n5wCgez.js";import{i}from"./AGraphicContainer-BXk7Eu6w.js";class l extends i{renderChildren(e){for(const r of this.children)r.setTransform(e.state);if(super.renderChildren(e),this.attributeView.update(),this.children.some(r=>r.hasData)){switch(e.drawPhase){case t.MAP:this._renderChildren(e,h.All);break;case t.HIGHLIGHT:this.hasHighlight&&this._renderHighlight(e)}this._boundsRenderer&&this._boundsRenderer.doRender(e)}}_renderHighlight(e){s(e,!1,r=>{this._renderChildren(r,h.Highlight)})}}export{l as t}; diff --git a/assets/GraphicsLayer-CexPXXFK.js b/assets/GraphicsLayer-g4hVfoZU.js similarity index 93% rename from assets/GraphicsLayer-CexPXXFK.js rename to assets/GraphicsLayer-g4hVfoZU.js index acaa2dd..1e9986b 100644 --- a/assets/GraphicsLayer-CexPXXFK.js +++ b/assets/GraphicsLayer-g4hVfoZU.js @@ -1 +1 @@ -import{bP as a,bQ as p,c as i,d as r,y as s,bR as h,bS as n,f as c,bT as d}from"./index-CEWggaxV.js";let t=class extends a(p(d)){constructor(e){super(e),this.elevationInfo=null,this.graphics=new i,this.screenSizePerspectiveEnabled=!0,this.type="graphics",this.internal=!1}destroy(){this.removeAll(),this.graphics.destroy()}add(e){return this.graphics.add(e),this}addMany(e){return this.graphics.addMany(e),this}removeAll(){return this.graphics.removeAll(),this}remove(e){this.graphics.remove(e)}removeMany(e){this.graphics.removeMany(e)}on(e,o){return super.on(e,o)}graphicChanged(e){this.emit("graphic-update",e)}};r([s({type:h})],t.prototype,"elevationInfo",void 0),r([s(n(i,"graphics"))],t.prototype,"graphics",void 0),r([s({type:["show","hide"]})],t.prototype,"listMode",void 0),r([s()],t.prototype,"screenSizePerspectiveEnabled",void 0),r([s({readOnly:!0})],t.prototype,"type",void 0),r([s({constructOnly:!0})],t.prototype,"internal",void 0),t=r([c("esri.layers.GraphicsLayer")],t);const y=t;export{y as h}; +import{bP as a,bQ as p,c as i,d as r,y as s,bR as h,bS as n,f as c,bT as d}from"./index-BjUNJPVf.js";let t=class extends a(p(d)){constructor(e){super(e),this.elevationInfo=null,this.graphics=new i,this.screenSizePerspectiveEnabled=!0,this.type="graphics",this.internal=!1}destroy(){this.removeAll(),this.graphics.destroy()}add(e){return this.graphics.add(e),this}addMany(e){return this.graphics.addMany(e),this}removeAll(){return this.graphics.removeAll(),this}remove(e){this.graphics.remove(e)}removeMany(e){this.graphics.removeMany(e)}on(e,o){return super.on(e,o)}graphicChanged(e){this.emit("graphic-update",e)}};r([s({type:h})],t.prototype,"elevationInfo",void 0),r([s(n(i,"graphics"))],t.prototype,"graphics",void 0),r([s({type:["show","hide"]})],t.prototype,"listMode",void 0),r([s()],t.prototype,"screenSizePerspectiveEnabled",void 0),r([s({readOnly:!0})],t.prototype,"type",void 0),r([s({constructOnly:!0})],t.prototype,"internal",void 0),t=r([c("esri.layers.GraphicsLayer")],t);const y=t;export{y as h}; diff --git a/assets/GraphicsLayerView2D-D7NawYZd.js b/assets/GraphicsLayerView2D-CtKxPbzt.js similarity index 54% rename from assets/GraphicsLayerView2D-D7NawYZd.js rename to assets/GraphicsLayerView2D-CtKxPbzt.js index 1d66056..3a9d2ff 100644 --- a/assets/GraphicsLayerView2D-D7NawYZd.js +++ b/assets/GraphicsLayerView2D-CtKxPbzt.js @@ -1 +1 @@ -import{u as a,j as g,V as m,q as n,e as p,d as o,y as l,f as c}from"./index-CEWggaxV.js";import{t as d}from"./highlightReasons-DbgbcWKM.js";import{m as u,u as w}from"./LayerView-BEFTHNYv.js";import{t as y}from"./GraphicContainer-CbvswCG0.js";import{$ as V}from"./GraphicsView2D-DbbthiwV.js";import{t as f}from"./HighlightCounter-abgLEfgq.js";import"./scaleUtils-Bqauo1zZ.js";import"./Container-CB7SlLB9.js";import"./Texture-DJgkMrSB.js";import"./AGraphicContainer-Dby-baET.js";import"./TechniqueInstance-CSsTmbek.js";import"./UpdateTracking2D-nj9Q-3df.js";import"./TurboLine-CkxIB4ZX.js";import"./earcut-hRlx3adE.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./utils-p-5Bbga5.js";import"./Rect-CUzevAry.js";import"./LabelMetric-D2hbzzy_.js";import"./Program-DLRmaKpw.js";import"./labelUtils-Dnqx6jl5.js";import"./defaultsJSON-CHAaurhX.js";import"./BindType-BmZEZMMh.js";import"./Util-BS8sJGjF.js";import"./constants-D5zmR9t2.js";import"./TileContainer-Ci6dOowA.js";import"./WGLContainer-B_Pv-8Yi.js";import"./ProgramTemplate-BICQrNzS.js";import"./config-MDUrh2eL.js";import"./featureConversionUtils-CmP9mw0r.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./FeatureCommandQueue-Btq_FXyi.js";import"./vec3f32-nZdmKIgz.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./OverrideHelper-B4ryGWZb.js";import"./quantizationUtils-CUjGHrU3.js";import"./AttributeStore-Ck-75lnq.js";import"./TimeOnly-Cm47ew5I.js";import"./timeSupport-BjRbXIpn.js";import"./json-Wa8cmqdu.js";import"./diffUtils-B4YFa5Ju.js";import"./normalizeUtilsSync-B6VufdiX.js";let s=class extends u(w){constructor(){super(...arguments),this._highlightCounter=new f}attach(){this.graphicsView=new V({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this.layer.graphics,container:new y(this.view.featuresTilingScheme),layerId:this.layer.id}),this.container.addChild(this.graphicsView.container),this.addAttachHandles(this.layer.on("graphic-update",this.graphicsView.graphicUpdateHandler)),this._updateHighlight()}detach(){this.container.removeAllChildren(),this.graphicsView=a(this.graphicsView)}async hitTest(i){return this.graphicsView?this.graphicsView.hitTest(i).map(t=>({type:"graphic",graphic:t,mapPoint:i,layer:this.layer})):null}queryGraphics(){return Promise.resolve(this.graphicsView.graphics)}update(i){this.graphicsView.processUpdate(i)}moveStart(){}viewChange(){this.graphicsView.viewChange()}moveEnd(){}isUpdating(){return!this.graphicsView||this.graphicsView.updating}highlight(i,t="highlight"){let r;typeof i=="number"?r=[i]:i instanceof g?r=[i.uid]:Array.isArray(i)&&i.length>0?r=typeof i[0]=="number"?i:i.map(h=>h&&h.uid):m.isCollection(i)&&i.length>0&&(r=i.map(h=>h&&h.uid).toArray());const e=r==null?void 0:r.filter(n);return e!=null&&e.length?(this._addHighlight(e,t),p(()=>this._removeHighlight(e,t))):p()}_addHighlight(i,t){this._highlightCounter.addReason(i,t),this._updateHighlight()}_removeHighlight(i,t){this._highlightCounter.deleteReason(i,t),this._updateHighlight()}_updateHighlight(){var t;const i=[];for(const r of this._highlightCounter.ids()){const e=this._highlightCounter.getHighestReason(r),h=d(e);i.push({objectId:r,highlightFlags:h})}(t=this.graphicsView)==null||t.setHighlight(i)}};o([l()],s.prototype,"graphicsView",void 0),s=o([c("esri.views.2d.layers.GraphicsLayerView2D")],s);const ai=s;export{ai as default}; +import{u as a,j as g,V as m,q as n,e as p,d as o,y as l,f as c}from"./index-BjUNJPVf.js";import{t as d}from"./highlightReasons-BOU4mnPE.js";import{m as u,u as w}from"./LayerView-Bux7vAEn.js";import{t as y}from"./GraphicContainer-Bue3JF2r.js";import{$ as V}from"./GraphicsView2D-B7H8XAnI.js";import{t as f}from"./HighlightCounter-qEuAaY1V.js";import"./scaleUtils-DWXMiS7R.js";import"./Container-_n5wCgez.js";import"./Texture-S4dD-WHn.js";import"./AGraphicContainer-BXk7Eu6w.js";import"./TechniqueInstance-XtnK2qy2.js";import"./UpdateTracking2D-Ds_Gdrxd.js";import"./TurboLine-DNQdPIXo.js";import"./earcut-CWKXDqDj.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./utils-CuXO_Zzq.js";import"./Rect-CUzevAry.js";import"./LabelMetric-BcUxDImF.js";import"./Program-DBsYtQ00.js";import"./labelUtils-3p0-m-Ee.js";import"./defaultsJSON-CHAaurhX.js";import"./BindType-BmZEZMMh.js";import"./Util-CS5u4Lec.js";import"./constants-D5zmR9t2.js";import"./TileContainer-Bs-vXdD_.js";import"./WGLContainer-DgZNq7b0.js";import"./ProgramTemplate-Ck2I0bIi.js";import"./config-MDUrh2eL.js";import"./featureConversionUtils-BHhm7bvm.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./FeatureCommandQueue-DI81F3gA.js";import"./vec3f32-nZdmKIgz.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./OverrideHelper-DxFZBnGL.js";import"./quantizationUtils-CfV316jZ.js";import"./AttributeStore-Bm6hLtR1.js";import"./TimeOnly-BXSODLxA.js";import"./timeSupport-DXkhlToK.js";import"./json-Wa8cmqdu.js";import"./diffUtils-uUoMDFQS.js";import"./normalizeUtilsSync-73yZ0QwV.js";let s=class extends u(w){constructor(){super(...arguments),this._highlightCounter=new f}attach(){this.graphicsView=new V({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this.layer.graphics,container:new y(this.view.featuresTilingScheme),layerId:this.layer.id}),this.container.addChild(this.graphicsView.container),this.addAttachHandles(this.layer.on("graphic-update",this.graphicsView.graphicUpdateHandler)),this._updateHighlight()}detach(){this.container.removeAllChildren(),this.graphicsView=a(this.graphicsView)}async hitTest(i){return this.graphicsView?this.graphicsView.hitTest(i).map(t=>({type:"graphic",graphic:t,mapPoint:i,layer:this.layer})):null}queryGraphics(){return Promise.resolve(this.graphicsView.graphics)}update(i){this.graphicsView.processUpdate(i)}moveStart(){}viewChange(){this.graphicsView.viewChange()}moveEnd(){}isUpdating(){return!this.graphicsView||this.graphicsView.updating}highlight(i,t="highlight"){let r;typeof i=="number"?r=[i]:i instanceof g?r=[i.uid]:Array.isArray(i)&&i.length>0?r=typeof i[0]=="number"?i:i.map(h=>h&&h.uid):m.isCollection(i)&&i.length>0&&(r=i.map(h=>h&&h.uid).toArray());const e=r==null?void 0:r.filter(n);return e!=null&&e.length?(this._addHighlight(e,t),p(()=>this._removeHighlight(e,t))):p()}_addHighlight(i,t){this._highlightCounter.addReason(i,t),this._updateHighlight()}_removeHighlight(i,t){this._highlightCounter.deleteReason(i,t),this._updateHighlight()}_updateHighlight(){var t;const i=[];for(const r of this._highlightCounter.ids()){const e=this._highlightCounter.getHighestReason(r),h=d(e);i.push({objectId:r,highlightFlags:h})}(t=this.graphicsView)==null||t.setHighlight(i)}};o([l()],s.prototype,"graphicsView",void 0),s=o([c("esri.views.2d.layers.GraphicsLayerView2D")],s);const ai=s;export{ai as default}; diff --git a/assets/GraphicsView2D-DbbthiwV.js b/assets/GraphicsView2D-B7H8XAnI.js similarity index 97% rename from assets/GraphicsView2D-DbbthiwV.js rename to assets/GraphicsView2D-B7H8XAnI.js index c6bc445..9e61921 100644 --- a/assets/GraphicsView2D-DbbthiwV.js +++ b/assets/GraphicsView2D-B7H8XAnI.js @@ -1,3 +1,3 @@ -import{cF as E,ij as S,ik as W,il as Z,aB as B,ai as g,im as N,F as V,E as m,fZ as X,io as Q,ip as Y,aj as J,am as K,bh as M,dn as ee,g as te,q as se,eW as re,iq as ie,at as oe,ac as ae,ab as ne,ah as he,d as y,y as _,f as de,a7 as ce}from"./index-CEWggaxV.js";import{Z as le}from"./FieldsIndex-CLgRNeJ_.js";import{W as ue,J as k,d as pe,U as me,K as ye,n as _e}from"./UpdateTracking2D-nj9Q-3df.js";import{f as ge}from"./OverrideHelper-B4ryGWZb.js";import{O as fe,y as be,N as we}from"./labelUtils-Dnqx6jl5.js";import{b as Ie}from"./WGLContainer-B_Pv-8Yi.js";import{M as Se,p as ve,b as xe,s as Re,a as Te,n as Me,c as $e}from"./AttributeStore-Ck-75lnq.js";import{s as Ge,y as Ce,z as ze,a as Oe,p as Ue,S as ke,u as Pe,x as P,b as je,t as qe}from"./FeatureCommandQueue-Btq_FXyi.js";import{o as Ee,h as Ve,a as z}from"./featureConversionUtils-CmP9mw0r.js";import{e as x}from"./OptimizedGeometry-CQuTPb9g.js";import{a as Ae}from"./normalizeUtilsSync-B6VufdiX.js";import{x as Fe,j as De}from"./timeSupport-BjRbXIpn.js";async function He(r,e,t){const s=[],i={scaleInfo:Ge(r),scaleExpression:null};for(const o of e)switch(o.type){case"marker":s.push(...Pe(t.instances.marker,o,P,i));break;case"fill":o.spriteRasterizationParam==null?s.push(...Ue(t.instances.fill,o,i)):s.push(...ke(t.instances.complexFill,o,!1,i));break;case"line":o.spriteRasterizationParam?s.push(...ze(t.instances.texturedLine,o,!1,i)):s.push(...Oe(t.instances.line,o,!1,i));break;case"text":s.push(...Ce(t.instances.text,o,P,i))}return s}class $ extends Se{static from(e,t,s){return new $(e,t,s)}constructor(e,t,s){super(s),this._items=e,this._tile=t,this._index=-1,this._cachedGeometry=null;const i=t.lod;i.wrap&&(this._wrappingInfo={worldSizeX:i.worldSize[0]})}get _current(){return this._items[this._index]}getItem(){return this._current}getZOrder(){return this._current.zOrder}getMeshWriters(){var e;return((e=this._current.symbolResource)==null?void 0:e.symbolInfo.meshWriters)??[]}hasField(e){return this._current.attributes[e]!=null}field(e){return this.readAttribute(e)}get geometryType(){const e=E(this._current.geometry);return e==="esriGeometryPoint"?"esriGeometryMultipoint":e}getCursor(){return this.copy()}copy(){const e=new $(this._items,this._tile,this.metadata);return this.copyInto(e),e}copyInto(e){super.copyInto(e),e._cachedGeometry=this._cachedGeometry,e._index=this._index}get fields(){throw new Error("Fields reading not supported to graphics.")}get hasFeatures(){return!!this._items.length}get hasNext(){return this._index+1S*(i-1)&&(e[o]=a-S*i)}_readX(){const e=this._readGeometry();return e!=null?e.coords[0]:0}_readY(){const e=this._readGeometry();return e!=null?e.coords[1]:0}_readServerCentroid(){switch(this.geometryType){case"esriGeometryPolygon":{const e=Z(this._current.projectedGeometry),t=new x([],e);return z(new x,t,this.hasZ,this.hasM,this.geometryType,this._tile.transform)}case"esriGeometryPolyline":{const e=this._current.projectedGeometry,t=W(e.paths,this.hasZ),s=new x([],t);return z(new x,s,this.hasZ,this.hasM,this.geometryType,this._tile.transform)}}return null}_readAttribute(e,t){const s=this._current.attributes[e];if(s!==void 0)return s;const i=e.toLowerCase();for(const o in this._current.attributes)if(o.toLowerCase()===i)return this._current.attributes[o]}_readAttributes(){return this._current.attributes}}const O=50;function j(r){if(!r)return null;const{xmin:e,ymin:t,xmax:s,ymax:i,spatialReference:o}=r;return new B({rings:[[[e,t],[e,i],[s,i],[s,t],[e,t]]],spatialReference:o})}let Le=class A{static fromGraphic(e,t,s,i){return new A(e.geometry,t,e.attributes,e.visible,e.uid,s,i)}constructor(e,t,s,i,o,a,n){this.geometry=e,this.symbol=t,this.attributes=s,this.visible=i,this.objectId=o,this.zOrder=a,this.displayId=n,this.bounds=g(),this.prevBounds=g(),this.size=[0,0,0,0]}get linearCIM(){var e;return(e=this.symbolResource)==null?void 0:e.symbolInfo.linearCIM}update(e,t,s){return(this.geometry!==e.geometry||this.attributes!==e.attributes||this.symbol!==t||this.zOrder!==s||this.visible!==e.visible)&&(this.prevBounds=this.bounds,this.bounds=g(),this.zOrder=s,this.geometry=e.geometry,this.attributes=e.attributes,this.symbol=t,this.visible=e.visible,this.symbolResource=null,this.projectedGeometry=null,!0)}async projectAndNormalize(e){let t=this.geometry;if(!t||!t.spatialReference||t.type==="mesh")return;t.type==="extent"&&(t=j(t)),await Fe(t.spatialReference,e);const s=Ae(t);if(!s)return;const i=De(s,t.spatialReference,e);i&&N(i),this.projectedGeometry=V(i)?j(i):i}};class We{constructor(e,t,s){this.added=e,this.updated=t,this.removed=s}hasAnyUpdate(){return!!(this.added.length||this.updated.length||this.removed.length)}}const q=1e-5;function Ze(r,e){return e.zOrder-r.zOrder}class Be{constructor(e,t,s,i,o){this._items=new Map,this._boundsDirty=!1,this._outSpatialReference=e,this._cimResourceManager=t,this._hittestDrawHelper=new ue(t),this._tileInfoView=s,this._store=o;const a=s.getClosestInfoForScale(i);this._resolution=this._tileInfoView.getTileResolution(a.level)}items(){return this._items.values()}getItem(e){return this._items.get(e)}async update(e,t,s){const i=[],o=[],a=[],n=new Set,l=[];let d=0;for(const h of e.items){d++;const c=h.uid,u=this._items.get(c),f=t(h);if(n.add(c),u){u.update(h,f,d)&&(o.push(u),l.push(this._updateItem(u,s)));continue}const b=this._store.createDisplayIdForObjectId(c),w=Le.fromGraphic(h,f,d,b);l.push(this._updateItem(w,s)),this._items.set(w.objectId,w),i.push(w)}for(const[h,c]of this._items.entries())n.has(h)||(this._store.releaseDisplayIdForObjectId(h),this._items.delete(h),a.push(c));return await Promise.all(l),this._index=null,new We(i,o,a)}updateLevel(e){this._resolution!==e&&(this._index=null,this._boundsDirty=!0,this._resolution=e)}hitTest(e,t,s,i,o){const a=m("esri-mobile"),n=m(a?"hittest-2d-mobile-tolerance":"hittest-2d-desktop-tolerance"),l=n+(a?0:m("hittest-2d-small-symbol-tolerance"));e=X(e,this._tileInfoView.spatialReference);const d=i*window.devicePixelRatio*l,h=g();h[0]=e-d,h[1]=t-d,h[2]=e+d,h[3]=t+d;const c=i*window.devicePixelRatio*n,u=g();u[0]=e-c,u[1]=t-c,u[2]=e+c,u[3]=t+c;const f=.5*i*(l+O),b=this._searchIndex(e-f,t-f,e+f,t+f);if(!b||b.length===0)return[];const w=[],U=g(),R=g();for(const I of b){if(!I.visible)continue;const{projectedGeometry:C,symbolResource:T}=I;this._getSymbolBounds(U,T,C,R,o),R[3]=R[2]=R[1]=R[0]=0,Q(U,h)&&w.push(I)}if(w.length===0)return[];const F=this._hittestDrawHelper,G=[];for(const I of w){const{projectedGeometry:C,symbolResource:T}=I;if(!T)continue;const{textInfo:D,symbolInfo:H}=T,L=H.cimSymbol;F.hitTest(u,L.symbol,C,D,o,i)&&G.push(I)}return G.sort(Ze),G.map(I=>I.objectId)}queryItems(e){return this._items.size===0?[]:this._searchForItems(e)}clear(){this._items.clear(),this._index=null}async _updateItem(e,t){await e.projectAndNormalize(this._outSpatialReference),await t(e);const{size:s}=e;s[0]=s[1]=s[2]=s[3]=0,this._getSymbolBounds(e.bounds,e.symbolResource,e.projectedGeometry,e.size,0)}_searchIndex(e,t,s,i){return this._boundsDirty&&(this._items.forEach(o=>this._getSymbolBounds(o.bounds,o.symbolResource,o.projectedGeometry,o.size,0)),this._boundsDirty=!1),this._index||(this._index=Y(9,o=>({minX:o.bounds[0],minY:o.bounds[1],maxX:o.bounds[2],maxY:o.bounds[3]})),this._index.load(Array.from(this._items.values()))),this._index.search({minX:e,minY:t,maxX:s,maxY:i})}_searchForItems(e){const t=this._tileInfoView.spatialReference,s=e.bounds,i=J(t);if(i&&t.isWrappable){const[o,a]=i.valid,n=Math.abs(s[2]-a){switch(e.type){case"processed-edit":throw new Error("InternalError: Unsupported command");case"update":return this._update()}}}),this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this.container.destroy(),this.view=null,this.renderer=null,this._set("graphics",null),this._controller.abort(),this._graphicStore.clear(),this._attributeStore=null,this._hashToSymbolInfo.clear(),this._updateTracking.destroy(),this._commandQueue.destroy()}_initAttributeStore(){this._storage=new ve({spatialReference:this.view.spatialReference,fields:new le}),this._attributeStore=new xe({isLocal:!0,update:async e=>{m("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateStart`,{message:e});const t=this.container.attributeView.requestUpdate(e);this.container.requestRender(),await t,m("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateEnd`,{message:e})}});const r=qe(null,[]);this._attributeStore.update(r,this._storage,null),this.container.checkHighlight=()=>this._attributeStore.hasHighlight}initialize(){this._initAttributeStore(),this._metadata=Re.create(this.view.spatialReference),this._resourceProxy=new Te({fetch:e=>Promise.all(e.map(t=>this.view.stage.textureManager.rasterizeItem(t))),fetchDictionary:e=>{throw new Error("InternalError: Graphics do not support Dictionary requests")}}),this.addHandles([te(()=>this._effectiveRenderer,()=>this._pushUpdate()),this.view.graphicsTileStore.on("update",this._onTileUpdate.bind(this)),this.container.on("attach",()=>{this.addHandles([this.graphics.on("change",()=>this._pushUpdate())]),this._graphicStore=new Be(this.view.spatialReference,this._cimResourceManager,this.view.featuresTilingScheme,this.view.state.scale,this._attributeStore),this._attached=!0,this.requestUpdate(),this._pushUpdate()})]),this._updateTracking.addUpdateTracking("CommandQueue",this._commandQueue.updateTracking);const r=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:r,removed:[]})}get _effectiveRenderer(){return typeof this.renderer=="function"?this.renderer():this.renderer}get _cimResourceManager(){return this.view.stage.textureManager.resourceManager}get updating(){const r=!this._attached||this._updateTracking.updating;return m("esri-2d-log-updating")&&console.log(`Updating GraphicsView2D: ${r} +import{cF as E,ij as S,ik as W,il as Z,aB as B,ai as g,im as N,F as V,E as m,fZ as X,io as Q,ip as Y,aj as J,am as K,bh as M,dn as ee,g as te,q as se,eW as re,iq as ie,at as oe,ac as ae,ab as ne,ah as he,d as y,y as _,f as de,a7 as ce}from"./index-BjUNJPVf.js";import{Z as le}from"./FieldsIndex-CK-0B5n9.js";import{W as ue,J as k,d as pe,U as me,K as ye,n as _e}from"./UpdateTracking2D-Ds_Gdrxd.js";import{f as ge}from"./OverrideHelper-DxFZBnGL.js";import{O as fe,y as be,N as we}from"./labelUtils-3p0-m-Ee.js";import{b as Ie}from"./WGLContainer-DgZNq7b0.js";import{M as Se,p as ve,b as xe,s as Re,a as Te,n as Me,c as $e}from"./AttributeStore-Bm6hLtR1.js";import{s as Ge,y as Ce,z as ze,a as Oe,p as Ue,S as ke,u as Pe,x as P,b as je,t as qe}from"./FeatureCommandQueue-DI81F3gA.js";import{o as Ee,h as Ve,a as z}from"./featureConversionUtils-BHhm7bvm.js";import{e as x}from"./OptimizedGeometry-CQuTPb9g.js";import{a as Ae}from"./normalizeUtilsSync-73yZ0QwV.js";import{x as Fe,j as De}from"./timeSupport-DXkhlToK.js";async function He(r,e,t){const s=[],i={scaleInfo:Ge(r),scaleExpression:null};for(const o of e)switch(o.type){case"marker":s.push(...Pe(t.instances.marker,o,P,i));break;case"fill":o.spriteRasterizationParam==null?s.push(...Ue(t.instances.fill,o,i)):s.push(...ke(t.instances.complexFill,o,!1,i));break;case"line":o.spriteRasterizationParam?s.push(...ze(t.instances.texturedLine,o,!1,i)):s.push(...Oe(t.instances.line,o,!1,i));break;case"text":s.push(...Ce(t.instances.text,o,P,i))}return s}class $ extends Se{static from(e,t,s){return new $(e,t,s)}constructor(e,t,s){super(s),this._items=e,this._tile=t,this._index=-1,this._cachedGeometry=null;const i=t.lod;i.wrap&&(this._wrappingInfo={worldSizeX:i.worldSize[0]})}get _current(){return this._items[this._index]}getItem(){return this._current}getZOrder(){return this._current.zOrder}getMeshWriters(){var e;return((e=this._current.symbolResource)==null?void 0:e.symbolInfo.meshWriters)??[]}hasField(e){return this._current.attributes[e]!=null}field(e){return this.readAttribute(e)}get geometryType(){const e=E(this._current.geometry);return e==="esriGeometryPoint"?"esriGeometryMultipoint":e}getCursor(){return this.copy()}copy(){const e=new $(this._items,this._tile,this.metadata);return this.copyInto(e),e}copyInto(e){super.copyInto(e),e._cachedGeometry=this._cachedGeometry,e._index=this._index}get fields(){throw new Error("Fields reading not supported to graphics.")}get hasFeatures(){return!!this._items.length}get hasNext(){return this._index+1S*(i-1)&&(e[o]=a-S*i)}_readX(){const e=this._readGeometry();return e!=null?e.coords[0]:0}_readY(){const e=this._readGeometry();return e!=null?e.coords[1]:0}_readServerCentroid(){switch(this.geometryType){case"esriGeometryPolygon":{const e=Z(this._current.projectedGeometry),t=new x([],e);return z(new x,t,this.hasZ,this.hasM,this.geometryType,this._tile.transform)}case"esriGeometryPolyline":{const e=this._current.projectedGeometry,t=W(e.paths,this.hasZ),s=new x([],t);return z(new x,s,this.hasZ,this.hasM,this.geometryType,this._tile.transform)}}return null}_readAttribute(e,t){const s=this._current.attributes[e];if(s!==void 0)return s;const i=e.toLowerCase();for(const o in this._current.attributes)if(o.toLowerCase()===i)return this._current.attributes[o]}_readAttributes(){return this._current.attributes}}const O=50;function j(r){if(!r)return null;const{xmin:e,ymin:t,xmax:s,ymax:i,spatialReference:o}=r;return new B({rings:[[[e,t],[e,i],[s,i],[s,t],[e,t]]],spatialReference:o})}let Le=class A{static fromGraphic(e,t,s,i){return new A(e.geometry,t,e.attributes,e.visible,e.uid,s,i)}constructor(e,t,s,i,o,a,n){this.geometry=e,this.symbol=t,this.attributes=s,this.visible=i,this.objectId=o,this.zOrder=a,this.displayId=n,this.bounds=g(),this.prevBounds=g(),this.size=[0,0,0,0]}get linearCIM(){var e;return(e=this.symbolResource)==null?void 0:e.symbolInfo.linearCIM}update(e,t,s){return(this.geometry!==e.geometry||this.attributes!==e.attributes||this.symbol!==t||this.zOrder!==s||this.visible!==e.visible)&&(this.prevBounds=this.bounds,this.bounds=g(),this.zOrder=s,this.geometry=e.geometry,this.attributes=e.attributes,this.symbol=t,this.visible=e.visible,this.symbolResource=null,this.projectedGeometry=null,!0)}async projectAndNormalize(e){let t=this.geometry;if(!t||!t.spatialReference||t.type==="mesh")return;t.type==="extent"&&(t=j(t)),await Fe(t.spatialReference,e);const s=Ae(t);if(!s)return;const i=De(s,t.spatialReference,e);i&&N(i),this.projectedGeometry=V(i)?j(i):i}};class We{constructor(e,t,s){this.added=e,this.updated=t,this.removed=s}hasAnyUpdate(){return!!(this.added.length||this.updated.length||this.removed.length)}}const q=1e-5;function Ze(r,e){return e.zOrder-r.zOrder}class Be{constructor(e,t,s,i,o){this._items=new Map,this._boundsDirty=!1,this._outSpatialReference=e,this._cimResourceManager=t,this._hittestDrawHelper=new ue(t),this._tileInfoView=s,this._store=o;const a=s.getClosestInfoForScale(i);this._resolution=this._tileInfoView.getTileResolution(a.level)}items(){return this._items.values()}getItem(e){return this._items.get(e)}async update(e,t,s){const i=[],o=[],a=[],n=new Set,l=[];let d=0;for(const h of e.items){d++;const c=h.uid,u=this._items.get(c),f=t(h);if(n.add(c),u){u.update(h,f,d)&&(o.push(u),l.push(this._updateItem(u,s)));continue}const b=this._store.createDisplayIdForObjectId(c),w=Le.fromGraphic(h,f,d,b);l.push(this._updateItem(w,s)),this._items.set(w.objectId,w),i.push(w)}for(const[h,c]of this._items.entries())n.has(h)||(this._store.releaseDisplayIdForObjectId(h),this._items.delete(h),a.push(c));return await Promise.all(l),this._index=null,new We(i,o,a)}updateLevel(e){this._resolution!==e&&(this._index=null,this._boundsDirty=!0,this._resolution=e)}hitTest(e,t,s,i,o){const a=m("esri-mobile"),n=m(a?"hittest-2d-mobile-tolerance":"hittest-2d-desktop-tolerance"),l=n+(a?0:m("hittest-2d-small-symbol-tolerance"));e=X(e,this._tileInfoView.spatialReference);const d=i*window.devicePixelRatio*l,h=g();h[0]=e-d,h[1]=t-d,h[2]=e+d,h[3]=t+d;const c=i*window.devicePixelRatio*n,u=g();u[0]=e-c,u[1]=t-c,u[2]=e+c,u[3]=t+c;const f=.5*i*(l+O),b=this._searchIndex(e-f,t-f,e+f,t+f);if(!b||b.length===0)return[];const w=[],U=g(),R=g();for(const I of b){if(!I.visible)continue;const{projectedGeometry:C,symbolResource:T}=I;this._getSymbolBounds(U,T,C,R,o),R[3]=R[2]=R[1]=R[0]=0,Q(U,h)&&w.push(I)}if(w.length===0)return[];const F=this._hittestDrawHelper,G=[];for(const I of w){const{projectedGeometry:C,symbolResource:T}=I;if(!T)continue;const{textInfo:D,symbolInfo:H}=T,L=H.cimSymbol;F.hitTest(u,L.symbol,C,D,o,i)&&G.push(I)}return G.sort(Ze),G.map(I=>I.objectId)}queryItems(e){return this._items.size===0?[]:this._searchForItems(e)}clear(){this._items.clear(),this._index=null}async _updateItem(e,t){await e.projectAndNormalize(this._outSpatialReference),await t(e);const{size:s}=e;s[0]=s[1]=s[2]=s[3]=0,this._getSymbolBounds(e.bounds,e.symbolResource,e.projectedGeometry,e.size,0)}_searchIndex(e,t,s,i){return this._boundsDirty&&(this._items.forEach(o=>this._getSymbolBounds(o.bounds,o.symbolResource,o.projectedGeometry,o.size,0)),this._boundsDirty=!1),this._index||(this._index=Y(9,o=>({minX:o.bounds[0],minY:o.bounds[1],maxX:o.bounds[2],maxY:o.bounds[3]})),this._index.load(Array.from(this._items.values()))),this._index.search({minX:e,minY:t,maxX:s,maxY:i})}_searchForItems(e){const t=this._tileInfoView.spatialReference,s=e.bounds,i=J(t);if(i&&t.isWrappable){const[o,a]=i.valid,n=Math.abs(s[2]-a){switch(e.type){case"processed-edit":throw new Error("InternalError: Unsupported command");case"update":return this._update()}}}),this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this.container.destroy(),this.view=null,this.renderer=null,this._set("graphics",null),this._controller.abort(),this._graphicStore.clear(),this._attributeStore=null,this._hashToSymbolInfo.clear(),this._updateTracking.destroy(),this._commandQueue.destroy()}_initAttributeStore(){this._storage=new ve({spatialReference:this.view.spatialReference,fields:new le}),this._attributeStore=new xe({isLocal:!0,update:async e=>{m("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateStart`,{message:e});const t=this.container.attributeView.requestUpdate(e);this.container.requestRender(),await t,m("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateEnd`,{message:e})}});const r=qe(null,[]);this._attributeStore.update(r,this._storage,null),this.container.checkHighlight=()=>this._attributeStore.hasHighlight}initialize(){this._initAttributeStore(),this._metadata=Re.create(this.view.spatialReference),this._resourceProxy=new Te({fetch:e=>Promise.all(e.map(t=>this.view.stage.textureManager.rasterizeItem(t))),fetchDictionary:e=>{throw new Error("InternalError: Graphics do not support Dictionary requests")}}),this.addHandles([te(()=>this._effectiveRenderer,()=>this._pushUpdate()),this.view.graphicsTileStore.on("update",this._onTileUpdate.bind(this)),this.container.on("attach",()=>{this.addHandles([this.graphics.on("change",()=>this._pushUpdate())]),this._graphicStore=new Be(this.view.spatialReference,this._cimResourceManager,this.view.featuresTilingScheme,this.view.state.scale,this._attributeStore),this._attached=!0,this.requestUpdate(),this._pushUpdate()})]),this._updateTracking.addUpdateTracking("CommandQueue",this._commandQueue.updateTracking);const r=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:r,removed:[]})}get _effectiveRenderer(){return typeof this.renderer=="function"?this.renderer():this.renderer}get _cimResourceManager(){return this.view.stage.textureManager.resourceManager}get updating(){const r=!this._attached||this._updateTracking.updating;return m("esri-2d-log-updating")&&console.log(`Updating GraphicsView2D: ${r} -> attaching ${!this._attached} -> updateTracking ${this._updateTracking.updating}`),r}hitTest(r){if(!this.view||this.view.suspended)return[];const{resolution:e,rotation:t}=this.view.state,s=this._graphicStore.hitTest(r.x,r.y,2,e,t),i=new Set(s),o=this.graphics.items.reduce((a,n)=>(i.has(n.uid)&&a.set(n.uid,n),a),new Map);return s.map(a=>o.get(a)).filter(se)}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback()),this.notifyChange("updating")}processUpdate(r){this.updateRequested&&(this.updateRequested=!1,this.update(r))}viewChange(){this.requestUpdate()}setHighlight(r){var t;const e=[];for(const{objectId:s,highlightFlags:i}of r){const o=(t=this._graphicStore.getItem(s))==null?void 0:t.displayId;e.push({objectId:s,highlightFlags:i,displayId:o})}this._attributeStore.setHighlight(e,r),this._pushUpdate()}graphicUpdateHandler(r){this._pushUpdate()}update(r){this.updateRequested=!1,this._attached&&this._graphicStore.updateLevel(r.state.resolution)}_pushUpdate(){re(this._commandQueue.push({type:"update"}))}async _update(){try{m("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView._update start`);const r=await this._graphicStore.update(this.graphics,t=>this._getSymbolForGraphic(t),t=>this._ensureSymbolResource(t));if(!r.hasAnyUpdate())return void await this._attributeStore.sendUpdates();r.removed.length&&(this._cleanupRequired=!0),m("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView updateMessage`,r);const e=this._createTileMessages(r);await this._fetchResources(e),this._write(e);for(const t of r.added)this._setFilterState(t);for(const t of r.updated)this._setFilterState(t);m("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate`,r),await this._attributeStore.sendUpdates(),m("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate.await`,r)}catch{}this._cleanupSharedResources()}_createTileMessages(r){const e=new Map;for(const t of r.added){const s=this.view.graphicsTileStore.getIntersectingTiles(t.bounds);for(const i of s)v.getOrCreate(i,e,this._metadata).addedOrModified.push(t)}for(const t of r.updated){const s=this.view.graphicsTileStore.getIntersectingTiles(t.prevBounds),i=this.view.graphicsTileStore.getIntersectingTiles(t.bounds);for(const o of s)v.getOrCreate(o,e,this._metadata).removed.push(t.displayId);for(const o of i)v.getOrCreate(o,e,this._metadata).addedOrModified.push(t)}for(const t of r.removed){const s=this.view.graphicsTileStore.getIntersectingTiles(t.bounds);for(const i of s)v.getOrCreate(i,e,this._metadata).removed.push(t.displayId)}return Array.from(e.values())}async _fetchResources(r){for(const{tile:e,reader:t}of r){m("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${e.id}] GraphicsView fetchResources`,r);const s=t.getCursor();for(;s.next();)for(const i of s.getMeshWriters())i.enqueueRequest(this._resourceProxy,s,e.createArcadeEvaluationOptions(this.view.timeZone))}await this._resourceProxy.fetchEnqueuedResources()}_write(r){for(const e of r){m("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${e.tile.id}] GraphicsView write`,e);const t=this._writeMeshes(e);let s=this._tiles.get(e.tile.key);s||(s=this._createFeatureTile(e.tile.key)),m("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${e.tile.id}] GraphicsView onTileData`,e),this.container.onTileData(s,{type:"update",modify:t,remove:e.removed,end:!1,attributeEpoch:this._attributeStore.epoch}),this.container.requestRender()}}_writeMeshes(r){const e=new Me(r.tile.id),t=r.reader.getCursor();for(;t.next();){e.entityStart(t.getDisplayId(),t.getZOrder());for(const s of t.getMeshWriters())s.write(e,this._resourceProxy,t,r.tile.createArcadeEvaluationOptions(this.view.timeZone),r.tile.level);e.entityEnd()}return{...e.serialize().message,tileId:r.tile.id}}_setFilterState(r){const e=r.displayId,t=this._attributeStore.getHighlightFlags(r.objectId);this._attributeStore.setData(e,0,0,t|(r.visible?ie:0))}_getSymbolForGraphic(r){return r.symbol!=null?r.symbol:this._effectiveRenderer!=null?this._effectiveRenderer.getSymbol(r):this._getNullSymbol(r)}async _ensureSymbolResource(r){if(!r.symbol)return;const e=await this._getSymbolInfo(r.symbol);if(!e)return;const t=e.linearCIM.filter(s=>s.type==="text");if(t.length>0){const s=await this._getTextResources(r,t);r.symbolResource={symbolInfo:e,textInfo:s}}else r.symbolResource={symbolInfo:e}}_getSymbolInfo(r){const e=r.hash();return this._hashToSymbolInfo.has(e)||this._hashToSymbolInfo.set(e,this._createSymbolInfo(e,r).catch(t=>null)),this._hashToSymbolInfo.get(e)}async _createSymbolInfo(r,e){const t=await this._convertToCIMSymbol(e),s=await this._createLinearCIM(t);if(e.type==="text")for(const i of s)i.type==="text"&&(i.lineWidth=e.lineWidth);return{hash:r,cimSymbol:t,linearCIM:s,meshWriters:await this._createMeshWriters(t,s)}}async _convertToCIMSymbol(r){const e=me(r);return e.type==="web-style"?(await e.fetchCIMSymbol()).data:e}async _createLinearCIM(r){return await Promise.all(ye.fetchResources(r.symbol,this._cimResourceManager,[])),this.view.stage.cimAnalyzer.analyzeSymbolReference(r,!1)}async _createMeshWriters(r,e){oe(this._controller.signal);const t=this.container.instanceStore,s=await He(r,e,t);return Promise.all(s.map(i=>$e(this._storage,this._resourceProxy,i.meshWriterName,_e(i.id),i.options,{tileInfo:this.view.featuresTilingScheme.tileInfo},i.optionalAttributes)))}_onTileUpdate(r){if(r.added&&r.added.length>0)for(const e of r.added)this._updateTracking.addPromise(this._addTile(e));if(r.removed&&r.removed.length>0)for(const e of r.removed)this._removeTile(e.key)}_createFeatureTile(r){const e=this.view.featuresTilingScheme.getTileBounds(g(),r),t=this.view.featuresTilingScheme.getTileResolution(r.level),s=new Ie(r,t,e[0],e[3]);return this._tiles.set(r,s),this.container.addChild(s),s}async _addTile(r){if(!this._attached)return;const e=this._graphicStore.queryItems(r);if(!e.length)return;const t=this._createFeatureTile(r.key),s=v.fromItems(r,e,this._metadata);await this._fetchResources([s]);const i=this._writeMeshes(s);t.onMessage({type:"append",append:i,clear:!1,end:!0,attributeEpoch:this._attributeStore.epoch})}_removeTile(r){if(!this._tiles.has(r))return;const e=this._tiles.get(r);this.container.removeChild(e),e.destroy(),this._tiles.delete(r)}_getNullSymbol(r){const e=r.geometry;return ae(e)?fe:ne(e)||V(e)?be:this.defaultPointSymbolEnabled?we:null}async _getTextResources(r,e){const t=new Array,s=new Array;for(let n=0;n0){const c=ge.resolveSymbolOverrides({type:"CIMSymbolReference",primitiveOverrides:h,symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,size:d.symbol.height,anchorPointUnits:"Relative",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:d.symbol,textString:d.textString}],scaleSymbolsProportionally:!0,respectFrame:!0}]}},r,this.view.spatialReference,null,E(r.projectedGeometry),null,null);c.then(u=>{const f=u.symbolLayers[0],{textString:b}=f.markerGraphics[0];s.push({type:"cim-rasterization-info",resource:{type:"text",textString:b||"",font:d.font}}),l.text=d.textString=b||""}),t.push(c)}else s.push({type:"cim-rasterization-info",resource:d})}t.length>0&&await Promise.all(t);const i=s.map(n=>this.view.stage.textureManager.rasterizeItem(n)),o=await Promise.all(i);he(o);const a=new Map;for(let n=0;n __vite__mapDeps.viteFileDeps[i]) } -import{bP as u,bQ as v,dp as c,dq as m,fF as f,fG as _,dr as w,C as g,fH as I,k as L,g as h,bs as O,fI as S,aw as A,ay as V,dQ as P,a6 as $,d as r,y as l,aR as p,aZ as E,fJ as M,z as C,ez as b,f as T,bT as x,_ as G,s as R}from"./index-CEWggaxV.js";import{a as H}from"./lazyLayerLoader-s-GqbiwM.js";import{A as y}from"./interfaces-CL2NbQte.js";import{r as j}from"./saveUtils-BzCRy3uR.js";const F=Symbol("WebScene");let s=class extends u(v(c(m(f(_(w(x))))))){constructor(e){super(e),this.allLayers=new g({getCollections:()=>[this.layers],getChildrenFunction:i=>"layers"in i?i.layers:null}),this.allTables=I(this),this.fullExtent=void 0,this.operationalLayerType="GroupLayer",this.spatialReference=void 0,this.type="group",this._debouncedSaveOperations=L(async(i,t,a)=>{const{save:o,saveAs:n}=await G(()=>import("./groupLayerUtils-BrcnmI65.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));switch(i){case y.SAVE:return o(this,t);case y.SAVE_AS:return n(this,a,t)}})}initialize(){this._enforceVisibility(this.visibilityMode,this.visible),this.addHandles([h(()=>{let e=this.parent;for(;e&&"parent"in e&&e.parent;)e=e.parent;return e&&F in e},e=>{const i="prevent-adding-tables";this.removeHandles(i),e&&(this.tables.removeAll(),this.addHandles(C(()=>this.tables,"before-add",t=>{t.preventDefault(),R.getLogger(this).errorOnce("tables","tables in group layers in a webscene are not supported. Please move the tables from the group layer to the webscene if you want to persist them.")}),i))},M),h(()=>this.visible,this._onVisibilityChange.bind(this),b)])}destroy(){this.allLayers.destroy(),this.allTables.destroy()}get sourceIsPortalItem(){return this.portalItem&&this.originIdOf("portalItem")===O.USER}_writeLayers(e,i,t,a){const o=[];if(!e)return o;e.forEach(n=>{const d=S(n,a.webmap?a.webmap.getLayerJSONFromResourceInfo(n):null,a);d!=null&&d.layerType&&o.push(d)}),i.layers=o}set portalItem(e){this._set("portalItem",e)}readPortalItem(e,i,t){const{itemId:a,layerType:o}=i;if(o==="GroupLayer"&&a)return new A({id:a,portal:t==null?void 0:t.portal})}writePortalItem(e,i){e!=null&&e.id&&(i.itemId=e.id)}set visibilityMode(e){const i=this._get("visibilityMode")!==e;this._set("visibilityMode",e),i&&this._enforceVisibility(e,this.visible)}async beforeSave(){return j(this)}load(e){const i=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Group Layer","Scene Service"],layerModuleTypeMap:H},e).catch(t=>{if(V(t),this.sourceIsPortalItem)throw t});return this.addResolvingPromise(i),Promise.resolve(this)}async loadAll(){return P(this,e=>{e(this.layers,this.tables)})}async save(e){return this._debouncedSaveOperations(y.SAVE,e)}async saveAs(e,i){return this._debouncedSaveOperations(y.SAVE_AS,i,e)}layerAdded(e){e.visible&&this.visibilityMode==="exclusive"?this._turnOffOtherLayers(e):this.visibilityMode==="inherited"&&(e.visible=this.visible),this.hasHandles(e.uid)?console.error(`Layer read to Grouplayer: uid=${e.uid}`):this.addHandles(h(()=>e.visible,i=>this._onChildVisibilityChange(e,i),b),e.uid)}layerRemoved(e){this.removeHandles(e.uid),this._enforceVisibility(this.visibilityMode,this.visible)}_turnOffOtherLayers(e){this.layers.forEach(i=>{i!==e&&(i.visible=!1)})}_enforceVisibility(e,i){if(!$(this).initialized)return;const t=this.layers;let a=t.find(o=>o.visible);switch(e){case"exclusive":t.length&&!a&&(a=t.at(0),a.visible=!0),this._turnOffOtherLayers(a);break;case"inherited":t.forEach(o=>{o.visible=i})}}_onVisibilityChange(e){this.visibilityMode==="inherited"&&this.layers.forEach(i=>{i.visible=e})}_onChildVisibilityChange(e,i){switch(this.visibilityMode){case"exclusive":i?this._turnOffOtherLayers(e):this._isAnyLayerVisible()||(e.visible=!0);break;case"inherited":e.visible=this.visible}}_isAnyLayerVisible(){return this.layers.some(e=>e.visible)}};r([l({readOnly:!0,dependsOn:[]})],s.prototype,"allLayers",void 0),r([l({readOnly:!0})],s.prototype,"allTables",void 0),r([l({json:{read:!0,write:!0}})],s.prototype,"blendMode",void 0),r([l()],s.prototype,"fullExtent",void 0),r([l({readOnly:!0})],s.prototype,"sourceIsPortalItem",null),r([l({json:{read:!1,write:{ignoreOrigin:!0}}})],s.prototype,"layers",void 0),r([p("layers")],s.prototype,"_writeLayers",null),r([l({type:["GroupLayer"]})],s.prototype,"operationalLayerType",void 0),r([l({json:{origins:{"web-map":{read:!1,write:{overridePolicy(e,i,t){return{enabled:(e==null?void 0:e.type)==="Group Layer"&&(t==null?void 0:t.initiator)!==this}}}},"web-scene":{read:!1,write:!1}}}})],s.prototype,"portalItem",null),r([E("web-map","portalItem",["itemId"])],s.prototype,"readPortalItem",null),r([p("web-map","portalItem",{itemId:{type:String}})],s.prototype,"writePortalItem",null),r([l()],s.prototype,"spatialReference",void 0),r([l({json:{read:!1},readOnly:!0,value:"group"})],s.prototype,"type",void 0),r([l({type:["independent","inherited","exclusive"],value:"independent",json:{write:!0,origins:{"web-map":{type:["independent","exclusive"],write:(e,i,t)=>{e!=="inherited"&&(i[t]=e)}}}}})],s.prototype,"visibilityMode",null),s=r([T("esri.layers.GroupLayer")],s);const Q=s;export{Q as default}; +import{bP as u,bQ as v,dp as c,dq as m,fF as f,fG as _,dr as w,C as g,fH as I,k as L,g as h,bs as O,fI as S,aw as A,ay as V,dQ as P,a6 as $,d as r,y as l,aR as p,aZ as E,fJ as M,z as C,ez as b,f as T,bT as x,_ as G,s as R}from"./index-BjUNJPVf.js";import{a as H}from"./lazyLayerLoader-Cu0XtDD2.js";import{A as y}from"./interfaces-CL2NbQte.js";import{r as j}from"./saveUtils-CGGzyvzv.js";const F=Symbol("WebScene");let s=class extends u(v(c(m(f(_(w(x))))))){constructor(e){super(e),this.allLayers=new g({getCollections:()=>[this.layers],getChildrenFunction:i=>"layers"in i?i.layers:null}),this.allTables=I(this),this.fullExtent=void 0,this.operationalLayerType="GroupLayer",this.spatialReference=void 0,this.type="group",this._debouncedSaveOperations=L(async(i,t,a)=>{const{save:o,saveAs:n}=await G(()=>import("./groupLayerUtils-4dYtm0nq.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));switch(i){case y.SAVE:return o(this,t);case y.SAVE_AS:return n(this,a,t)}})}initialize(){this._enforceVisibility(this.visibilityMode,this.visible),this.addHandles([h(()=>{let e=this.parent;for(;e&&"parent"in e&&e.parent;)e=e.parent;return e&&F in e},e=>{const i="prevent-adding-tables";this.removeHandles(i),e&&(this.tables.removeAll(),this.addHandles(C(()=>this.tables,"before-add",t=>{t.preventDefault(),R.getLogger(this).errorOnce("tables","tables in group layers in a webscene are not supported. Please move the tables from the group layer to the webscene if you want to persist them.")}),i))},M),h(()=>this.visible,this._onVisibilityChange.bind(this),b)])}destroy(){this.allLayers.destroy(),this.allTables.destroy()}get sourceIsPortalItem(){return this.portalItem&&this.originIdOf("portalItem")===O.USER}_writeLayers(e,i,t,a){const o=[];if(!e)return o;e.forEach(n=>{const d=S(n,a.webmap?a.webmap.getLayerJSONFromResourceInfo(n):null,a);d!=null&&d.layerType&&o.push(d)}),i.layers=o}set portalItem(e){this._set("portalItem",e)}readPortalItem(e,i,t){const{itemId:a,layerType:o}=i;if(o==="GroupLayer"&&a)return new A({id:a,portal:t==null?void 0:t.portal})}writePortalItem(e,i){e!=null&&e.id&&(i.itemId=e.id)}set visibilityMode(e){const i=this._get("visibilityMode")!==e;this._set("visibilityMode",e),i&&this._enforceVisibility(e,this.visible)}async beforeSave(){return j(this)}load(e){const i=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Group Layer","Scene Service"],layerModuleTypeMap:H},e).catch(t=>{if(V(t),this.sourceIsPortalItem)throw t});return this.addResolvingPromise(i),Promise.resolve(this)}async loadAll(){return P(this,e=>{e(this.layers,this.tables)})}async save(e){return this._debouncedSaveOperations(y.SAVE,e)}async saveAs(e,i){return this._debouncedSaveOperations(y.SAVE_AS,i,e)}layerAdded(e){e.visible&&this.visibilityMode==="exclusive"?this._turnOffOtherLayers(e):this.visibilityMode==="inherited"&&(e.visible=this.visible),this.hasHandles(e.uid)?console.error(`Layer read to Grouplayer: uid=${e.uid}`):this.addHandles(h(()=>e.visible,i=>this._onChildVisibilityChange(e,i),b),e.uid)}layerRemoved(e){this.removeHandles(e.uid),this._enforceVisibility(this.visibilityMode,this.visible)}_turnOffOtherLayers(e){this.layers.forEach(i=>{i!==e&&(i.visible=!1)})}_enforceVisibility(e,i){if(!$(this).initialized)return;const t=this.layers;let a=t.find(o=>o.visible);switch(e){case"exclusive":t.length&&!a&&(a=t.at(0),a.visible=!0),this._turnOffOtherLayers(a);break;case"inherited":t.forEach(o=>{o.visible=i})}}_onVisibilityChange(e){this.visibilityMode==="inherited"&&this.layers.forEach(i=>{i.visible=e})}_onChildVisibilityChange(e,i){switch(this.visibilityMode){case"exclusive":i?this._turnOffOtherLayers(e):this._isAnyLayerVisible()||(e.visible=!0);break;case"inherited":e.visible=this.visible}}_isAnyLayerVisible(){return this.layers.some(e=>e.visible)}};r([l({readOnly:!0,dependsOn:[]})],s.prototype,"allLayers",void 0),r([l({readOnly:!0})],s.prototype,"allTables",void 0),r([l({json:{read:!0,write:!0}})],s.prototype,"blendMode",void 0),r([l()],s.prototype,"fullExtent",void 0),r([l({readOnly:!0})],s.prototype,"sourceIsPortalItem",null),r([l({json:{read:!1,write:{ignoreOrigin:!0}}})],s.prototype,"layers",void 0),r([p("layers")],s.prototype,"_writeLayers",null),r([l({type:["GroupLayer"]})],s.prototype,"operationalLayerType",void 0),r([l({json:{origins:{"web-map":{read:!1,write:{overridePolicy(e,i,t){return{enabled:(e==null?void 0:e.type)==="Group Layer"&&(t==null?void 0:t.initiator)!==this}}}},"web-scene":{read:!1,write:!1}}}})],s.prototype,"portalItem",null),r([E("web-map","portalItem",["itemId"])],s.prototype,"readPortalItem",null),r([p("web-map","portalItem",{itemId:{type:String}})],s.prototype,"writePortalItem",null),r([l()],s.prototype,"spatialReference",void 0),r([l({json:{read:!1},readOnly:!0,value:"group"})],s.prototype,"type",void 0),r([l({type:["independent","inherited","exclusive"],value:"independent",json:{write:!0,origins:{"web-map":{type:["independent","exclusive"],write:(e,i,t)=>{e!=="inherited"&&(i[t]=e)}}}}})],s.prototype,"visibilityMode",null),s=r([T("esri.layers.GroupLayer")],s);const Q=s;export{Q as default}; diff --git a/assets/GroupLayerView2D-ayVE8wm-.js b/assets/GroupLayerView2D-BVygDtT5.js similarity index 91% rename from assets/GroupLayerView2D-ayVE8wm-.js rename to assets/GroupLayerView2D-BVygDtT5.js index 6fda16f..c928071 100644 --- a/assets/GroupLayerView2D-ayVE8wm-.js +++ b/assets/GroupLayerView2D-BVygDtT5.js @@ -1 +1 @@ -import{d as l,y as a,x as o,f as d,V,g as y,ez as h,w as p}from"./index-CEWggaxV.js";import{u as w,m as v}from"./LayerView-BEFTHNYv.js";import"./scaleUtils-Bqauo1zZ.js";import"./Container-CB7SlLB9.js";import"./highlightReasons-DbgbcWKM.js";import"./Texture-DJgkMrSB.js";let t=class extends w{constructor(i){super(i),this.type="group",this.layerViews=new V}destroy(){this.layerViews.length=0}_allLayerViewVisibility(i){this.layerViews.forEach(e=>{e.visible=i})}initialize(){this.addHandles([this.layerViews.on("change",i=>this._layerViewsChangeHandler(i)),y(()=>{var i;return(i=this.layer)==null?void 0:i.visibilityMode},()=>{this.layer&&this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(null))},h),y(()=>this.visible,i=>{this._applyVisibility(()=>this._allLayerViewVisibility(i),()=>{})},h)],"grouplayerview"),this._layerViewsChangeHandler({target:null,added:this.layerViews.toArray(),removed:[],moved:[]})}set layerViews(i){this._set("layerViews",p(i,this._get("layerViews")))}get updatingProgress(){return this.layerViews.length===0?1:this.layerViews.reduce((i,e)=>i+e.updatingProgress,0)/this.layerViews.length}isUpdating(){return this.layerViews.some(i=>i.updating)}_hasLayerViewVisibleOverrides(){return this.layerViews.some(i=>i._isOverridden("visible"))}_findLayerViewForLayer(i){return i&&this.layerViews.find(e=>e.layer===i)}_firstVisibleOnLayerOrder(){const i=this.layer.layers.find(e=>{const s=this._findLayerViewForLayer(e);return!!(s!=null&&s.visible)});return i&&this._findLayerViewForLayer(i)}_applyExclusiveVisibility(i){i==null&&(i=this._firstVisibleOnLayerOrder())==null&&this.layerViews.length>0&&(i=this._findLayerViewForLayer(this.layer.layers.at(0))),this.layerViews.forEach(e=>{e.visible=e===i})}_layerViewsChangeHandler(i){this.removeHandles("grouplayerview:visible"),this.addHandles(this.layerViews.map(s=>y(()=>s.visible,r=>this._applyVisibility(()=>{r!==this.visible&&(s.visible=this.visible)},()=>this._applyExclusiveVisibility(r?s:null)),h)).toArray(),"grouplayerview:visible");const e=i.added[i.added.length-1];this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(e!=null&&e.visible?e:null))}_applyVisibility(i,e){var s,r;this._hasLayerViewVisibleOverrides()&&(((s=this.layer)==null?void 0:s.visibilityMode)==="inherited"?i():((r=this.layer)==null?void 0:r.visibilityMode)==="exclusive"&&e())}};l([a({cast:o})],t.prototype,"layerViews",null),l([a({readOnly:!0})],t.prototype,"updatingProgress",null),l([a()],t.prototype,"view",void 0),t=l([d("esri.views.layers.GroupLayerView")],t);const u=t;let n=class extends v(u){attach(){this._updateStageChildren(),this.addAttachHandles(this.layerViews.on("after-changes",()=>this._updateStageChildren()))}detach(){this.container.removeAllChildren()}update(i){}moveStart(){}viewChange(){}moveEnd(){}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((i,e)=>this.container.addChildAt(i.container,e))}};n=l([d("esri.views.2d.layers.GroupLayerView2D")],n);const f=n;export{f as default}; +import{d as l,y as a,x as o,f as d,V,g as y,ez as h,w as p}from"./index-BjUNJPVf.js";import{u as w,m as v}from"./LayerView-Bux7vAEn.js";import"./scaleUtils-DWXMiS7R.js";import"./Container-_n5wCgez.js";import"./highlightReasons-BOU4mnPE.js";import"./Texture-S4dD-WHn.js";let t=class extends w{constructor(i){super(i),this.type="group",this.layerViews=new V}destroy(){this.layerViews.length=0}_allLayerViewVisibility(i){this.layerViews.forEach(e=>{e.visible=i})}initialize(){this.addHandles([this.layerViews.on("change",i=>this._layerViewsChangeHandler(i)),y(()=>{var i;return(i=this.layer)==null?void 0:i.visibilityMode},()=>{this.layer&&this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(null))},h),y(()=>this.visible,i=>{this._applyVisibility(()=>this._allLayerViewVisibility(i),()=>{})},h)],"grouplayerview"),this._layerViewsChangeHandler({target:null,added:this.layerViews.toArray(),removed:[],moved:[]})}set layerViews(i){this._set("layerViews",p(i,this._get("layerViews")))}get updatingProgress(){return this.layerViews.length===0?1:this.layerViews.reduce((i,e)=>i+e.updatingProgress,0)/this.layerViews.length}isUpdating(){return this.layerViews.some(i=>i.updating)}_hasLayerViewVisibleOverrides(){return this.layerViews.some(i=>i._isOverridden("visible"))}_findLayerViewForLayer(i){return i&&this.layerViews.find(e=>e.layer===i)}_firstVisibleOnLayerOrder(){const i=this.layer.layers.find(e=>{const s=this._findLayerViewForLayer(e);return!!(s!=null&&s.visible)});return i&&this._findLayerViewForLayer(i)}_applyExclusiveVisibility(i){i==null&&(i=this._firstVisibleOnLayerOrder())==null&&this.layerViews.length>0&&(i=this._findLayerViewForLayer(this.layer.layers.at(0))),this.layerViews.forEach(e=>{e.visible=e===i})}_layerViewsChangeHandler(i){this.removeHandles("grouplayerview:visible"),this.addHandles(this.layerViews.map(s=>y(()=>s.visible,r=>this._applyVisibility(()=>{r!==this.visible&&(s.visible=this.visible)},()=>this._applyExclusiveVisibility(r?s:null)),h)).toArray(),"grouplayerview:visible");const e=i.added[i.added.length-1];this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(e!=null&&e.visible?e:null))}_applyVisibility(i,e){var s,r;this._hasLayerViewVisibleOverrides()&&(((s=this.layer)==null?void 0:s.visibilityMode)==="inherited"?i():((r=this.layer)==null?void 0:r.visibilityMode)==="exclusive"&&e())}};l([a({cast:o})],t.prototype,"layerViews",null),l([a({readOnly:!0})],t.prototype,"updatingProgress",null),l([a()],t.prototype,"view",void 0),t=l([d("esri.views.layers.GroupLayerView")],t);const u=t;let n=class extends v(u){attach(){this._updateStageChildren(),this.addAttachHandles(this.layerViews.on("after-changes",()=>this._updateStageChildren()))}detach(){this.container.removeAllChildren()}update(i){}moveStart(){}viewChange(){}moveEnd(){}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((i,e)=>this.container.addChildAt(i.container,e))}};n=l([d("esri.views.2d.layers.GroupLayerView2D")],n);const f=n;export{f as default}; diff --git a/assets/HighlightCounter-abgLEfgq.js b/assets/HighlightCounter-qEuAaY1V.js similarity index 90% rename from assets/HighlightCounter-abgLEfgq.js rename to assets/HighlightCounter-qEuAaY1V.js index 0b7cefa..9b124fe 100644 --- a/assets/HighlightCounter-abgLEfgq.js +++ b/assets/HighlightCounter-qEuAaY1V.js @@ -1 +1 @@ -import{l as r}from"./highlightReasons-DbgbcWKM.js";class l{constructor(){this._idToCounters=new Map}get empty(){return this._idToCounters.size===0}addReason(s,t){for(const o of s){let e=this._idToCounters.get(o);e||(e=new Map,this._idToCounters.set(o,e)),e.set(t,(e.get(t)||0)+1)}}deleteReason(s,t){for(const o of s){const e=this._idToCounters.get(o);if(!e)continue;let n=e.get(t);if(n==null)return;n--,n>0?e.set(t,n):e.delete(t),e.size===0&&this._idToCounters.delete(o)}}getHighestReason(s){const t=this._idToCounters.get(s);if(!t)return null;let o=null;for(const e of r)t.get(e)&&(o=e);return o||null}ids(){return this._idToCounters.keys()}}export{l as t}; +import{l as r}from"./highlightReasons-BOU4mnPE.js";class l{constructor(){this._idToCounters=new Map}get empty(){return this._idToCounters.size===0}addReason(s,t){for(const o of s){let e=this._idToCounters.get(o);e||(e=new Map,this._idToCounters.set(o,e)),e.set(t,(e.get(t)||0)+1)}}deleteReason(s,t){for(const o of s){const e=this._idToCounters.get(o);if(!e)continue;let n=e.get(t);if(n==null)return;n--,n>0?e.set(t,n):e.delete(t),e.size===0&&this._idToCounters.delete(o)}}getHighestReason(s){const t=this._idToCounters.get(s);if(!t)return null;let o=null;for(const e of r)t.get(e)&&(o=e);return o||null}ids(){return this._idToCounters.keys()}}export{l as t}; diff --git a/assets/HighlightGraphicContainer-Cnwl0eCq.js b/assets/HighlightGraphicContainer-B5WIObEd.js similarity index 64% rename from assets/HighlightGraphicContainer-Cnwl0eCq.js rename to assets/HighlightGraphicContainer-B5WIObEd.js index 311a510..b0dcd28 100644 --- a/assets/HighlightGraphicContainer-Cnwl0eCq.js +++ b/assets/HighlightGraphicContainer-B5WIObEd.js @@ -1 +1 @@ -import{d as s,f as i}from"./index-CEWggaxV.js";import{E as a,a as h,R as o}from"./Container-CB7SlLB9.js";import{i as n}from"./AGraphicContainer-Dby-baET.js";let t=class extends n{get hasHighlight(){return this.children.some(e=>e.hasData)}renderChildren(e){this.attributeView.update(),e.drawPhase===a.HIGHLIGHT&&this.children.some(r=>r.hasData)&&(super.renderChildren(e),e.context.setColorMask(!0,!0,!0,!0),h(e,!0,r=>{this._renderChildren(r,o.All)}))}};t=s([i("esri.views.2d.layers.support.HighlightGraphicContainer")],t);const m=t;export{m as h}; +import{d as s,f as i}from"./index-BjUNJPVf.js";import{E as a,a as h,R as o}from"./Container-_n5wCgez.js";import{i as n}from"./AGraphicContainer-BXk7Eu6w.js";let t=class extends n{get hasHighlight(){return this.children.some(e=>e.hasData)}renderChildren(e){this.attributeView.update(),e.drawPhase===a.HIGHLIGHT&&this.children.some(r=>r.hasData)&&(super.renderChildren(e),e.context.setColorMask(!0,!0,!0,!0),h(e,!0,r=>{this._renderChildren(r,o.All)}))}};t=s([i("esri.views.2d.layers.support.HighlightGraphicContainer")],t);const m=t;export{m as h}; diff --git a/assets/I3SBinaryReader-N_Is4gxa.js b/assets/I3SBinaryReader-Bg6QQKyW.js similarity index 99% rename from assets/I3SBinaryReader-N_Is4gxa.js rename to assets/I3SBinaryReader-Bg6QQKyW.js index 679ab9b..41dbe24 100644 --- a/assets/I3SBinaryReader-N_Is4gxa.js +++ b/assets/I3SBinaryReader-Bg6QQKyW.js @@ -1,2 +1,2 @@ -import{N as f,s as D,aV as S}from"./index-CEWggaxV.js";import{e as U}from"./VertexAttribute-BlT9lbVY.js";const d=!0,m={identifierOffset:0,identifierLength:10,versionOffset:10,checksumOffset:12,byteCount:16};function L(t,e,r){return{identifier:String.fromCharCode.apply(null,new Uint8Array(t,r+m.identifierOffset,m.identifierLength)),version:e.getUint16(r+m.versionOffset,d),checksum:e.getUint32(r+m.checksumOffset,d)}}const w={sizeLo:0,sizeHi:4,minX:8,minY:16,minZ:24,maxX:32,maxY:40,maxZ:48,errorX:56,errorY:64,errorZ:72,count:80,reserved:84,byteCount:88};function k(t,e){return{sizeLo:t.getUint32(e+w.sizeLo,d),sizeHi:t.getUint32(e+w.sizeHi,d),minX:t.getFloat64(e+w.minX,d),minY:t.getFloat64(e+w.minY,d),minZ:t.getFloat64(e+w.minZ,d),maxX:t.getFloat64(e+w.maxX,d),maxY:t.getFloat64(e+w.maxY,d),maxZ:t.getFloat64(e+w.maxZ,d),errorX:t.getFloat64(e+w.errorX,d),errorY:t.getFloat64(e+w.errorY,d),errorZ:t.getFloat64(e+w.errorZ,d),count:t.getUint32(e+w.count,d),reserved:t.getUint32(e+w.reserved,d)}}function q(t){const e=new DataView(t,0);let r=0;const{identifier:c,version:o}=L(t,e,r);if(r+=m.byteCount,c!=="LEPCC ")throw new f("lepcc-decode-error","Bad identifier");if(o>1)throw new f("lepcc-decode-error","Unknown version");const n=k(e,r);if(r+=w.byteCount,n.sizeHi*2**32+n.sizeLo!==t.byteLength)throw new f("lepcc-decode-error","Bad size");const s=new Float64Array(3*n.count),a=[],i=[],u=[],l=[];if(r=I(t,r,a),r=I(t,r,i),r=I(t,r,u),r=I(t,r,l),r!==t.byteLength)throw new f("lepcc-decode-error","Bad length");let g=0,y=0;for(let b=0;b>6;let i=0;if(a===0)i=c.getUint32(1,d),e+=5;else if(a===1)i=c.getUint16(1,d),e+=3;else{if(a!==2)throw new f("lepcc-decode-error","Bad count type");i=c.getUint8(1),e+=2}if(s)throw new f("lepcc-decode-error","LUT not implemented");const u=Math.ceil(i*n/8),l=new Uint8Array(t,e,u);let g=0,y=0,b=0;const v=-1>>>32-n;for(let C=0;C>>=n,y-=n,y+n>32&&(g|=l[b-1]>>8-y)}return e+b}const h={sizeLo:0,sizeHi:4,count:8,colorMapCount:12,lookupMethod:14,compressionMethod:15,byteCount:16};function V(t,e){return{sizeLo:t.getUint32(e+h.sizeLo,d),sizeHi:t.getUint32(e+h.sizeHi,d),count:t.getUint32(e+h.count,d),colorMapCount:t.getUint16(e+h.colorMapCount,d),lookupMethod:t.getUint8(e+h.lookupMethod),compressionMethod:t.getUint8(e+h.compressionMethod)}}function Y(t){const e=new DataView(t,0);let r=0;const{identifier:c,version:o}=L(t,e,r);if(r+=m.byteCount,c!=="ClusterRGB")throw new f("lepcc-decode-error","Bad identifier");if(o>1)throw new f("lepcc-decode-error","Unknown version");const n=V(e,r);if(r+=h.byteCount,n.sizeHi*2**32+n.sizeLo!==t.byteLength)throw new f("lepcc-decode-error","Bad size");if((n.lookupMethod===2||n.lookupMethod===1)&&n.compressionMethod===0){if(3*n.colorMapCount+n.count+r!==t.byteLength||n.colorMapCount>256)throw new f("lepcc-decode-error","Bad count");const s=new Uint8Array(t,r,3*n.colorMapCount),a=new Uint8Array(t,r+3*n.colorMapCount,n.count),i=new Uint8Array(3*n.count);for(let u=0;u1)throw new f("lepcc-decode-error","Unknown version");const n=$(e,r);if(r+=p.byteCount,n.sizeHi*2**32+n.sizeLo!==t.byteLength)throw new f("lepcc-decode-error","Bad size");const s=new Uint16Array(n.count);if(n.bitsPerPoint===8){if(n.count+r!==t.byteLength)throw new f("lepcc-decode-error","Bad size");const a=new Uint8Array(t,r,n.count);for(let i=0;iD.getLogger("esri.views.3d.layers.i3s.I3SBinaryReader");function Z(t,e,r){let c="",o=0;for(;o=192&&n<224){if(o+1>=r)throw new f("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");const s=(31&n)<<6|63&t[e+o+1];c+=String.fromCharCode(s),o+=2}else if(n>=224&&n<240){if(o+2>=r)throw new f("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const s=(15&n)<<12|(63&t[e+o+1])<<6|63&t[e+o+2];c+=String.fromCharCode(s),o+=3}else{if(!(n>=240&&n<248))throw new f("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");{if(o+3>=r)throw new f("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const s=(7&n)<<18|(63&t[e+o+1])<<12|(63&t[e+o+2])<<6|63&t[e+o+3];if(s>=65536){const a=55296+(s-65536>>10),i=56320+(1023&s);c+=String.fromCharCode(a,i)}else c+=String.fromCharCode(s);o+=4}}}return c}function B(t,e){const r={byteOffset:0,byteCount:0,fields:Object.create(null)};let c=0;for(let o=0;o{const o=c?Date.parse(c):null;return o&&!Number.isNaN(o)?o:null})}function T(t,e,r){const c=[];let o,n,s=0;for(n=0;n0){if(c.push(Z(r,s,o-1)),r[s+o-1]!==0)throw new f("string-array-error","Invalid string array: missing null termination.")}else c.push(null);s+=o}return c}function F(t,e){return new O[e.valueType](t,e.byteOffset,e.count*e.valuesPerElement)}function N(t,e){return new Uint8Array(t,e.byteOffset,e.byteCount)}function j(t,e,r){const c=e.header!=null?B(t,e.header):{byteOffset:0,byteCount:0,fields:{count:r}},o={header:c,byteOffset:c.byteCount,byteCount:0,entries:Object.create(null)};let n=c.byteCount;for(let s=0;s1)throw new f("lepcc-decode-error","Unknown version");const n=k(e,r);if(r+=w.byteCount,n.sizeHi*2**32+n.sizeLo!==t.byteLength)throw new f("lepcc-decode-error","Bad size");const s=new Float64Array(3*n.count),a=[],i=[],u=[],l=[];if(r=I(t,r,a),r=I(t,r,i),r=I(t,r,u),r=I(t,r,l),r!==t.byteLength)throw new f("lepcc-decode-error","Bad length");let g=0,y=0;for(let b=0;b>6;let i=0;if(a===0)i=c.getUint32(1,d),e+=5;else if(a===1)i=c.getUint16(1,d),e+=3;else{if(a!==2)throw new f("lepcc-decode-error","Bad count type");i=c.getUint8(1),e+=2}if(s)throw new f("lepcc-decode-error","LUT not implemented");const u=Math.ceil(i*n/8),l=new Uint8Array(t,e,u);let g=0,y=0,b=0;const v=-1>>>32-n;for(let C=0;C>>=n,y-=n,y+n>32&&(g|=l[b-1]>>8-y)}return e+b}const h={sizeLo:0,sizeHi:4,count:8,colorMapCount:12,lookupMethod:14,compressionMethod:15,byteCount:16};function V(t,e){return{sizeLo:t.getUint32(e+h.sizeLo,d),sizeHi:t.getUint32(e+h.sizeHi,d),count:t.getUint32(e+h.count,d),colorMapCount:t.getUint16(e+h.colorMapCount,d),lookupMethod:t.getUint8(e+h.lookupMethod),compressionMethod:t.getUint8(e+h.compressionMethod)}}function Y(t){const e=new DataView(t,0);let r=0;const{identifier:c,version:o}=L(t,e,r);if(r+=m.byteCount,c!=="ClusterRGB")throw new f("lepcc-decode-error","Bad identifier");if(o>1)throw new f("lepcc-decode-error","Unknown version");const n=V(e,r);if(r+=h.byteCount,n.sizeHi*2**32+n.sizeLo!==t.byteLength)throw new f("lepcc-decode-error","Bad size");if((n.lookupMethod===2||n.lookupMethod===1)&&n.compressionMethod===0){if(3*n.colorMapCount+n.count+r!==t.byteLength||n.colorMapCount>256)throw new f("lepcc-decode-error","Bad count");const s=new Uint8Array(t,r,3*n.colorMapCount),a=new Uint8Array(t,r+3*n.colorMapCount,n.count),i=new Uint8Array(3*n.count);for(let u=0;u1)throw new f("lepcc-decode-error","Unknown version");const n=$(e,r);if(r+=p.byteCount,n.sizeHi*2**32+n.sizeLo!==t.byteLength)throw new f("lepcc-decode-error","Bad size");const s=new Uint16Array(n.count);if(n.bitsPerPoint===8){if(n.count+r!==t.byteLength)throw new f("lepcc-decode-error","Bad size");const a=new Uint8Array(t,r,n.count);for(let i=0;iD.getLogger("esri.views.3d.layers.i3s.I3SBinaryReader");function Z(t,e,r){let c="",o=0;for(;o=192&&n<224){if(o+1>=r)throw new f("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");const s=(31&n)<<6|63&t[e+o+1];c+=String.fromCharCode(s),o+=2}else if(n>=224&&n<240){if(o+2>=r)throw new f("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const s=(15&n)<<12|(63&t[e+o+1])<<6|63&t[e+o+2];c+=String.fromCharCode(s),o+=3}else{if(!(n>=240&&n<248))throw new f("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");{if(o+3>=r)throw new f("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const s=(7&n)<<18|(63&t[e+o+1])<<12|(63&t[e+o+2])<<6|63&t[e+o+3];if(s>=65536){const a=55296+(s-65536>>10),i=56320+(1023&s);c+=String.fromCharCode(a,i)}else c+=String.fromCharCode(s);o+=4}}}return c}function B(t,e){const r={byteOffset:0,byteCount:0,fields:Object.create(null)};let c=0;for(let o=0;o{const o=c?Date.parse(c):null;return o&&!Number.isNaN(o)?o:null})}function T(t,e,r){const c=[];let o,n,s=0;for(n=0;n0){if(c.push(Z(r,s,o-1)),r[s+o-1]!==0)throw new f("string-array-error","Invalid string array: missing null termination.")}else c.push(null);s+=o}return c}function F(t,e){return new O[e.valueType](t,e.byteOffset,e.count*e.valuesPerElement)}function N(t,e){return new Uint8Array(t,e.byteOffset,e.byteCount)}function j(t,e,r){const c=e.header!=null?B(t,e.header):{byteOffset:0,byteCount:0,fields:{count:r}},o={header:c,byteOffset:c.byteCount,byteCount:0,entries:Object.create(null)};let n=c.byteCount;for(let s=0;snew DataView(t,0).getFloat32(e,!0),Float64:(t,e)=>new DataView(t,0).getFloat64(e,!0),UInt8:(t,e)=>new DataView(t,0).getUint8(e),Int8:(t,e)=>new DataView(t,0).getInt8(e),UInt16:(t,e)=>new DataView(t,0).getUint16(e,!0),Int16:(t,e)=>new DataView(t,0).getInt16(e,!0),UInt32:(t,e)=>new DataView(t,0).getUint32(e,!0),Int32:(t,e)=>new DataView(t,0).getInt32(e,!0)};function x(t){return O.hasOwnProperty(t)}function A(t){return x(t)?O[t].BYTES_PER_ELEMENT:0}export{K as I,q as c,F as l,J as w}; diff --git a/assets/I3SLayerDefinitions-B6gGfNoh.js b/assets/I3SLayerDefinitions-Bc0e5Sgz.js similarity index 96% rename from assets/I3SLayerDefinitions-B6gGfNoh.js rename to assets/I3SLayerDefinitions-Bc0e5Sgz.js index d394c61..2d7c8b2 100644 --- a/assets/I3SLayerDefinitions-B6gGfNoh.js +++ b/assets/I3SLayerDefinitions-Bc0e5Sgz.js @@ -1 +1 @@ -import{d as e,y as t,f as s,c9 as n,aU as i}from"./index-CEWggaxV.js";let u=class extends i{constructor(){super(...arguments),this.nodesPerPage=null,this.rootIndex=0,this.lodSelectionMetricType=null}};e([t({type:Number})],u.prototype,"nodesPerPage",void 0),e([t({type:Number})],u.prototype,"rootIndex",void 0),e([t({type:String})],u.prototype,"lodSelectionMetricType",void 0),u=e([s("esri.layer.support.I3SNodePageDefinition")],u);let a=class extends i{constructor(){super(...arguments),this.factor=1}};e([t({type:Number,json:{read:{source:"textureSetDefinitionId"}}})],a.prototype,"id",void 0),e([t({type:Number})],a.prototype,"factor",void 0),a=e([s("esri.layer.support.I3SMaterialTexture")],a);let l=class extends i{constructor(){super(...arguments),this.baseColorFactor=[1,1,1,1],this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.metallicFactor=1,this.roughnessFactor=1}};e([t({type:[Number]})],l.prototype,"baseColorFactor",void 0),e([t({type:a})],l.prototype,"baseColorTexture",void 0),e([t({type:a})],l.prototype,"metallicRoughnessTexture",void 0),e([t({type:Number})],l.prototype,"metallicFactor",void 0),e([t({type:Number})],l.prototype,"roughnessFactor",void 0),l=e([s("esri.layer.support.I3SMaterialPBRMetallicRoughness")],l);let o=class extends i{constructor(){super(...arguments),this.alphaMode="opaque",this.alphaCutoff=.25,this.doubleSided=!1,this.cullFace="none",this.normalTexture=null,this.occlusionTexture=null,this.emissiveTexture=null,this.emissiveFactor=null,this.pbrMetallicRoughness=null}};e([n({opaque:"opaque",mask:"mask",blend:"blend"})],o.prototype,"alphaMode",void 0),e([t({type:Number})],o.prototype,"alphaCutoff",void 0),e([t({type:Boolean})],o.prototype,"doubleSided",void 0),e([n({none:"none",back:"back",front:"front"})],o.prototype,"cullFace",void 0),e([t({type:a})],o.prototype,"normalTexture",void 0),e([t({type:a})],o.prototype,"occlusionTexture",void 0),e([t({type:a})],o.prototype,"emissiveTexture",void 0),e([t({type:[Number]})],o.prototype,"emissiveFactor",void 0),e([t({type:l})],o.prototype,"pbrMetallicRoughness",void 0),o=e([s("esri.layer.support.I3SMaterialDefinition")],o);let y=class extends i{};e([t({type:String,json:{read:{source:["name","index"],reader:(v,x)=>v??`${x.index}`}}})],y.prototype,"name",void 0),e([n({jpg:"jpg",png:"png",dds:"dds","ktx-etc2":"ktx-etc2",ktx2:"ktx2",basis:"basis"})],y.prototype,"format",void 0),y=e([s("esri.layer.support.I3STextureFormat")],y);let c=class extends i{constructor(){super(...arguments),this.atlas=!1}};e([t({type:[y]})],c.prototype,"formats",void 0),e([t({type:Boolean})],c.prototype,"atlas",void 0),c=e([s("esri.layer.support.I3STextureSetDefinition")],c);let p=class extends i{};e([n({Float32:"Float32",UInt64:"UInt64",UInt32:"UInt32",UInt16:"UInt16",UInt8:"UInt8"})],p.prototype,"type",void 0),e([t({type:Number})],p.prototype,"component",void 0),p=e([s("esri.layer.support.I3SGeometryAttribute")],p);let d=class extends i{};e([n({draco:"draco"})],d.prototype,"encoding",void 0),e([t({type:[String]})],d.prototype,"attributes",void 0),d=e([s("esri.layer.support.I3SGeometryCompressedAttributes")],d);let r=class extends i{constructor(){super(...arguments),this.offset=0}};e([t({type:Number})],r.prototype,"offset",void 0),e([t({type:p})],r.prototype,"position",void 0),e([t({type:p})],r.prototype,"normal",void 0),e([t({type:p})],r.prototype,"uv0",void 0),e([t({type:p})],r.prototype,"color",void 0),e([t({type:p})],r.prototype,"uvRegion",void 0),e([t({type:p})],r.prototype,"featureId",void 0),e([t({type:p})],r.prototype,"faceRange",void 0),e([t({type:d})],r.prototype,"compressedAttributes",void 0),r=e([s("esri.layer.support.I3SGeometryBuffer")],r);let m=class extends i{};e([n({triangle:"triangle"})],m.prototype,"topology",void 0),e([t()],m.prototype,"geometryBuffers",void 0),m=e([s("esri.layer.support.I3SGeometryDefinition")],m);export{o as l,m,u as s,c as u}; +import{d as e,y as t,f as s,c9 as n,aU as i}from"./index-BjUNJPVf.js";let u=class extends i{constructor(){super(...arguments),this.nodesPerPage=null,this.rootIndex=0,this.lodSelectionMetricType=null}};e([t({type:Number})],u.prototype,"nodesPerPage",void 0),e([t({type:Number})],u.prototype,"rootIndex",void 0),e([t({type:String})],u.prototype,"lodSelectionMetricType",void 0),u=e([s("esri.layer.support.I3SNodePageDefinition")],u);let a=class extends i{constructor(){super(...arguments),this.factor=1}};e([t({type:Number,json:{read:{source:"textureSetDefinitionId"}}})],a.prototype,"id",void 0),e([t({type:Number})],a.prototype,"factor",void 0),a=e([s("esri.layer.support.I3SMaterialTexture")],a);let l=class extends i{constructor(){super(...arguments),this.baseColorFactor=[1,1,1,1],this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.metallicFactor=1,this.roughnessFactor=1}};e([t({type:[Number]})],l.prototype,"baseColorFactor",void 0),e([t({type:a})],l.prototype,"baseColorTexture",void 0),e([t({type:a})],l.prototype,"metallicRoughnessTexture",void 0),e([t({type:Number})],l.prototype,"metallicFactor",void 0),e([t({type:Number})],l.prototype,"roughnessFactor",void 0),l=e([s("esri.layer.support.I3SMaterialPBRMetallicRoughness")],l);let o=class extends i{constructor(){super(...arguments),this.alphaMode="opaque",this.alphaCutoff=.25,this.doubleSided=!1,this.cullFace="none",this.normalTexture=null,this.occlusionTexture=null,this.emissiveTexture=null,this.emissiveFactor=null,this.pbrMetallicRoughness=null}};e([n({opaque:"opaque",mask:"mask",blend:"blend"})],o.prototype,"alphaMode",void 0),e([t({type:Number})],o.prototype,"alphaCutoff",void 0),e([t({type:Boolean})],o.prototype,"doubleSided",void 0),e([n({none:"none",back:"back",front:"front"})],o.prototype,"cullFace",void 0),e([t({type:a})],o.prototype,"normalTexture",void 0),e([t({type:a})],o.prototype,"occlusionTexture",void 0),e([t({type:a})],o.prototype,"emissiveTexture",void 0),e([t({type:[Number]})],o.prototype,"emissiveFactor",void 0),e([t({type:l})],o.prototype,"pbrMetallicRoughness",void 0),o=e([s("esri.layer.support.I3SMaterialDefinition")],o);let y=class extends i{};e([t({type:String,json:{read:{source:["name","index"],reader:(v,x)=>v??`${x.index}`}}})],y.prototype,"name",void 0),e([n({jpg:"jpg",png:"png",dds:"dds","ktx-etc2":"ktx-etc2",ktx2:"ktx2",basis:"basis"})],y.prototype,"format",void 0),y=e([s("esri.layer.support.I3STextureFormat")],y);let c=class extends i{constructor(){super(...arguments),this.atlas=!1}};e([t({type:[y]})],c.prototype,"formats",void 0),e([t({type:Boolean})],c.prototype,"atlas",void 0),c=e([s("esri.layer.support.I3STextureSetDefinition")],c);let p=class extends i{};e([n({Float32:"Float32",UInt64:"UInt64",UInt32:"UInt32",UInt16:"UInt16",UInt8:"UInt8"})],p.prototype,"type",void 0),e([t({type:Number})],p.prototype,"component",void 0),p=e([s("esri.layer.support.I3SGeometryAttribute")],p);let d=class extends i{};e([n({draco:"draco"})],d.prototype,"encoding",void 0),e([t({type:[String]})],d.prototype,"attributes",void 0),d=e([s("esri.layer.support.I3SGeometryCompressedAttributes")],d);let r=class extends i{constructor(){super(...arguments),this.offset=0}};e([t({type:Number})],r.prototype,"offset",void 0),e([t({type:p})],r.prototype,"position",void 0),e([t({type:p})],r.prototype,"normal",void 0),e([t({type:p})],r.prototype,"uv0",void 0),e([t({type:p})],r.prototype,"color",void 0),e([t({type:p})],r.prototype,"uvRegion",void 0),e([t({type:p})],r.prototype,"featureId",void 0),e([t({type:p})],r.prototype,"faceRange",void 0),e([t({type:d})],r.prototype,"compressedAttributes",void 0),r=e([s("esri.layer.support.I3SGeometryBuffer")],r);let m=class extends i{};e([n({triangle:"triangle"})],m.prototype,"topology",void 0),e([t()],m.prototype,"geometryBuffers",void 0),m=e([s("esri.layer.support.I3SGeometryDefinition")],m);export{o as l,m,u as s,c as u}; diff --git a/assets/I3SUtil-DxFIPSkh.js b/assets/I3SUtil-Bs1mZiKI.js similarity index 80% rename from assets/I3SUtil-DxFIPSkh.js rename to assets/I3SUtil-Bs1mZiKI.js index 7605f22..094dc38 100644 --- a/assets/I3SUtil-DxFIPSkh.js +++ b/assets/I3SUtil-Bs1mZiKI.js @@ -1 +1 @@ -import{aS as R,gS as T,ai as E,M as h,hM as g,hN as O}from"./index-CEWggaxV.js";import"./mat4f64-CSKppSlJ.js";import"./computeTranslationToOriginAndRotation-DOOKw0d1.js";import"./sphere-DHd2K2LR.js";import{I as P}from"./I3SBinaryReader-N_Is4gxa.js";import"./symbolColorUtils-D_minlYz.js";import{O as U}from"./orientedBoundingBox-BQdJNYvE.js";function d(n,e,t,i){return{x:n,y:e,z:t,hasZ:t!=null,hasM:!1,spatialReference:i,type:"point"}}d(0,0,0,R.WGS84);var s;(function(n){n[n.INVISIBLE=0]="INVISIBLE",n[n.TRANSPARENT=1]="TRANSPARENT",n[n.OPAQUE=2]="OPAQUE"})(s||(s={}));function C(n){return{...D,...n,type:"solid"}}const D={color:T(0,0,0,.2),size:1,extensionLength:0,opacity:1,objectTransparency:s.OPAQUE,hasSlicePlane:!1};T(0,0,0,.2),s.OPAQUE;E();var S;async function M(n,e,t,i,p,N,m,c){const u=[];for(const o of e)if(o&&p.includes(o.name)){const r=`${n}/nodes/${t}/attributes/${o.key}/0`;u.push({url:r,storageInfo:o})}const f=await Promise.allSettled(u.map(o=>h(o.url,{responseType:"array-buffer",query:{...m,token:N},signal:c==null?void 0:c.signal}).then(r=>P(o.storageInfo,r.data)))),l=[];for(const o of i){const r={};for(let a=0;ah(o.url,{responseType:"array-buffer",query:{...m,token:N},signal:c==null?void 0:c.signal}).then(r=>P(o.storageInfo,r.data)))),l=[];for(const o of i){const r={};for(let a=0;a __vite__mapDeps.viteFileDeps[i]) } -import{d as p,y as f,i4 as se,f as F,i5 as _e,i6 as fe,_ as j,i7 as x,i8 as ge,aU as ae,ca as he,az as A,i9 as le,bW as H,df as N,ia as E,N as U,ib as me,c$ as C,fN as D,M as R,eE as L,ic as J,fW as G,e0 as re,id as ve,bE as W,eR as Ie,ie as we,aG as V,cP as ie,bD as Se,ig as ye}from"./index-CEWggaxV.js";import{s as ke}from"./substitute-DxAztrfK.js";const K="esri-identity-modal",X={base:K,info:`${K}__info`,notice:`${K}__notice`},Ae="ArcGIS Online";let O=class extends _e{constructor(c,e){super(c,e),this.container=document.createElement("div"),this.error=null,this.oAuthPrompt=!1,this.open=!1,this.signingIn=!1,this.server=null,this.resource=null,this._usernameInputNode=null,this._passwordInputNode=null,document.body.appendChild(this.container)}loadDependencies(){return fe({button:()=>j(()=>import("./calcite-button-CMjDkjDb.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])),input:()=>j(()=>import("./calcite-input-fjO1QChb.js"),__vite__mapDeps([14,15,1,2,4,5,3,6,10,11,7,8,9,12])),label:()=>j(()=>import("./calcite-label-DonsloAk.js"),__vite__mapDeps([16,1,2,7,4,5,8])),modal:()=>j(()=>import("./calcite-modal-Dti-ITgz.js"),__vite__mapDeps([17,1,2,18,11,4,5,19,9,20,10,8,12,13,21])),notice:()=>j(()=>import("./calcite-notice-CHsdelpI.js"),__vite__mapDeps([22,1,2,18,11,4,5,9,10,20,8,12]))})}get title(){var c;return(c=this.commonMessages)==null?void 0:c.auth.signIn}render(){var b;const{open:c,title:e,messages:t,signingIn:s,oAuthPrompt:i,server:r,resource:n,error:h}=this,{info:u,oAuthInfo:o,lblItem:l,invalidUser:d,noAuthService:a,lblUser:_,lblPwd:w,lblCancel:g,lblSigning:I,lblOk:m}=t;return x("div",{class:this.classes(X.base,ge())},x("form",{bind:this,onsubmit:this._submit},x("calcite-modal",{bind:this,open:c,outsideCloseDisabled:!0,scale:"s",widthScale:"s",onCalciteModalClose:this._cancel,onCalciteModalOpen:this._focusUsernameInput},x("div",{slot:"header"},e),x("div",{slot:"content"},x("div",{class:X.info},ke(i?o:u,{server:r&&/\.arcgis\.com/i.test(r)?Ae:r,resource:`(${n||l})`})),h?x("calcite-notice",{class:X.notice,icon:"exclamation-mark-triangle",kind:"danger",open:!0},x("div",{slot:"message"},(b=h.details)!=null&&b.httpStatus?d:a)):null,i?null:[x("calcite-label",null,_,x("calcite-input",{afterCreate:q=>this._usernameInputNode=q,autocomplete:"off",bind:this,name:"username",required:!0,spellcheck:!1,type:"text",value:""})),x("calcite-label",null,w,x("calcite-input",{afterCreate:q=>this._passwordInputNode=q,bind:this,name:"password",required:!0,type:"password",value:""}))]),x("calcite-button",{appearance:"outline",bind:this,onclick:this._cancel,slot:"secondary",type:"button",width:"full"},g),x("calcite-button",{loading:!!s,slot:"primary",type:"submit",width:"full"},s?I:m))))}_focusUsernameInput(){requestAnimationFrame(()=>{var c;(c=this._usernameInputNode)==null||c.setFocus()})}_cancel(){this._set("signingIn",!1),this.open=!1,this._usernameInputNode&&(this._usernameInputNode.value=""),this._passwordInputNode&&(this._passwordInputNode.value=""),this.emit("cancel")}_submit(c){var t,s;c.preventDefault(),this._set("signingIn",!0);const e=this.oAuthPrompt?{}:{username:(t=this._usernameInputNode)==null?void 0:t.value,password:(s=this._passwordInputNode)==null?void 0:s.value};this.emit("submit",e)}};p([f({readOnly:!0})],O.prototype,"container",void 0),p([f(),se("esri/t9n/common")],O.prototype,"commonMessages",void 0),p([f()],O.prototype,"error",void 0),p([f(),se("esri/identity/t9n/identity")],O.prototype,"messages",void 0),p([f()],O.prototype,"oAuthPrompt",void 0),p([f()],O.prototype,"open",void 0),p([f()],O.prototype,"signingIn",void 0),p([f()],O.prototype,"server",void 0),p([f({readOnly:!0})],O.prototype,"title",null),p([f()],O.prototype,"resource",void 0),O=p([F("esri.identity.IdentityModal")],O);const ne=O,Y="esriJSAPIOAuth";class Z{constructor(e,t){this.oAuthInfo=null,this.storage=null,this.appId=null,this.codeVerifier=null,this.expires=null,this.refreshToken=null,this.ssl=null,this.stateUID=null,this.token=null,this.userId=null,this.oAuthInfo=e,this.storage=t,this._init()}isValid(){let e=!1;if(this.oAuthInfo&&this.userId&&(this.refreshToken||this.token)){if(this.expires==null&&this.refreshToken)e=!0;else if(this.expires){const t=Date.now();this.expires>t&&(this.expires-t)/1e3>60*this.oAuthInfo.minTimeUntilExpiration&&(e=!0)}}return e}save(){if(!this.storage)return!1;const e=this._load(),t=this.oAuthInfo;if(t&&t.authNamespace&&t.portalUrl){let s=e[t.authNamespace];s||(s=e[t.authNamespace]={}),this.appId||(this.appId=t.appId),s[t.portalUrl]={appId:this.appId,codeVerifier:this.codeVerifier,expires:this.expires,refreshToken:this.refreshToken,ssl:this.ssl,stateUID:this.stateUID,token:this.token,userId:this.userId};try{this.storage.setItem(Y,JSON.stringify(e))}catch(i){return console.warn(i),!1}return!0}return!1}destroy(){const e=this._load(),t=this.oAuthInfo;if(t!=null&&t.appId&&(t!=null&&t.portalUrl)&&(this.expires==null||this.expires>Date.now())&&(this.refreshToken||this.token)){const s=t.portalUrl.replace(/^http:/i,"https:")+"/sharing/rest/oauth2/revokeToken",i=new FormData;if(i.append("f","json"),i.append("auth_token",this.refreshToken||this.token),i.append("client_id",t.appId),i.append("token_type_hint",this.refreshToken?"refresh_token":"access_token"),typeof navigator.sendBeacon=="function")navigator.sendBeacon(s,i);else{const r=new XMLHttpRequest;r.open("POST",s),r.send(i)}}if(t&&t.authNamespace&&t.portalUrl&&this.storage){const s=e[t.authNamespace];if(s){delete s[t.portalUrl];try{this.storage.setItem(Y,JSON.stringify(e))}catch(i){console.log(i)}}}t&&(t._oAuthCred=null,this.oAuthInfo=null)}_init(){const e=this._load(),t=this.oAuthInfo;if(t&&t.authNamespace&&t.portalUrl){let s=e[t.authNamespace];s&&(s=s[t.portalUrl],s&&(this.appId=s.appId,this.codeVerifier=s.codeVerifier,this.expires=s.expires,this.refreshToken=s.refreshToken,this.ssl=s.ssl,this.stateUID=s.stateUID,this.token=s.token,this.userId=s.userId))}}_load(){let e={};if(this.storage){const t=this.storage.getItem(Y);if(t)try{e=JSON.parse(t)}catch(s){console.warn(s)}}return e}}Z.prototype.declaredClass="esri.identity.OAuthCredential";var $;let T=$=class extends ae{constructor(c){super(c),this._oAuthCred=null,this.appId=null,this.authNamespace="/",this.expiration=20160,this.flowType="auto",this.forceLogin=!1,this.forceUserId=!1,this.locale=null,this.minTimeUntilExpiration=30,this.popup=!1,this.popupCallbackUrl="oauth-callback.html",this.popupWindowFeatures="height=490,width=800,resizable,scrollbars,status",this.portalUrl="https://www.arcgis.com",this.preserveUrlHash=!1,this.userId=null}clone(){return $.fromJSON(this.toJSON())}};p([f({json:{write:!0}})],T.prototype,"appId",void 0),p([f({json:{write:!0}})],T.prototype,"authNamespace",void 0),p([f({json:{write:!0}})],T.prototype,"expiration",void 0),p([f({json:{write:!0}})],T.prototype,"flowType",void 0),p([f({json:{write:!0}})],T.prototype,"forceLogin",void 0),p([f({json:{write:!0}})],T.prototype,"forceUserId",void 0),p([f({json:{write:!0}})],T.prototype,"locale",void 0),p([f({json:{write:!0}})],T.prototype,"minTimeUntilExpiration",void 0),p([f({json:{write:!0}})],T.prototype,"popup",void 0),p([f({json:{write:!0}})],T.prototype,"popupCallbackUrl",void 0),p([f({json:{write:!0}})],T.prototype,"popupWindowFeatures",void 0),p([f({json:{write:!0}})],T.prototype,"portalUrl",void 0),p([f({json:{write:!0}})],T.prototype,"preserveUrlHash",void 0),p([f({json:{write:!0}})],T.prototype,"userId",void 0),T=$=p([F("esri.identity.OAuthInfo")],T);const oe=T;let P=class extends ae{constructor(c){super(c),this.adminTokenServiceUrl=null,this.currentVersion=null,this.hasPortal=null,this.hasServer=null,this.owningSystemUrl=null,this.owningTenant=null,this.server=null,this.shortLivedTokenValidity=null,this.tokenServiceUrl=null,this.webTierAuth=null}};p([f({json:{write:!0}})],P.prototype,"adminTokenServiceUrl",void 0),p([f({json:{write:!0}})],P.prototype,"currentVersion",void 0),p([f({json:{write:!0}})],P.prototype,"hasPortal",void 0),p([f({json:{write:!0}})],P.prototype,"hasServer",void 0),p([f({json:{write:!0}})],P.prototype,"owningSystemUrl",void 0),p([f({json:{write:!0}})],P.prototype,"owningTenant",void 0),p([f({json:{write:!0}})],P.prototype,"server",void 0),p([f({json:{write:!0}})],P.prototype,"shortLivedTokenValidity",void 0),p([f({json:{write:!0}})],P.prototype,"tokenServiceUrl",void 0),p([f({json:{write:!0}})],P.prototype,"webTierAuth",void 0),P=p([F("esri.identity.ServerInfo")],P);const Q=P,M={},ce=c=>{const e=new D(c.owningSystemUrl).host,t=new D(c.server).host,s=/.+\.arcgis\.com$/i;return s.test(e)&&s.test(t)},ee=(c,e)=>!!(ce(c)&&e&&e.some(t=>t.test(c.server)));let z=null,B=null;try{z=window.localStorage,B=window.sessionStorage}catch{}class de extends he{constructor(){super(),this._portalConfig=globalThis.esriGeowConfig,this.serverInfos=[],this.oAuthInfos=[],this.credentials=[],this._soReqs=[],this._xoReqs=[],this._portals=[],this._defaultOAuthInfo=null,this._defaultTokenValidity=60,this.dialog=null,this.tokenValidity=null,this.normalizeWebTierAuth=!1,this._appOrigin=window.origin!=="null"?window.origin:window.location.origin,this._appUrlObj=H(window.location.href),this._busy=null,this._rejectOnPersistedPageShow=!1,this._oAuthLocationParams=null,this._gwTokenUrl="/sharing/rest/generateToken",this._agsRest="/rest/services",this._agsPortal=/\/sharing(\/|$)/i,this._agsAdmin=/(https?:\/\/[^\/]+\/[^\/]+)\/admin\/?(\/.*)?$/i,this._adminSvcs=/\/rest\/admin\/services(\/|$)/i,this._gwDomains=[{regex:/^https?:\/\/www\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:dev|[a-z\d-]+\.mapsdev)\.arcgis\.com/i,customBaseUrl:"mapsdev.arcgis.com",tokenServiceUrl:"https://dev.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:devext|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,customBaseUrl:"mapsdevext.arcgis.com",tokenServiceUrl:"https://devext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:qaext|[a-z\d-]+\.mapsqa)\.arcgis\.com/i,customBaseUrl:"mapsqa.arcgis.com",tokenServiceUrl:"https://qaext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/[a-z\d-]+\.maps\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"}],this._legacyFed=[],this._regexSDirUrl=/http.+\/rest\/services\/?/gi,this._regexServerType=/(\/(FeatureServer|GPServer|GeoDataServer|GeocodeServer|GeoenrichmentServer|GeometryServer|GlobeServer|ImageServer|KnowledgeGraphServer|MapServer|MissionServer|MobileServer|NAServer|NetworkDiagramServer|OGCFeatureServer|ParcelFabricServer|RelationalCatalogServer|SceneServer|StreamServer|UtilityNetworkServer|ValidationServer|VectorTileServer|VersionManagementServer|VideoServer)).*/gi,this._gwUser=/http.+\/users\/([^\/]+)\/?.*/i,this._gwItem=/http.+\/items\/([^\/]+)\/?.*/i,this._gwGroup=/http.+\/groups\/([^\/]+)\/?.*/i,this._rePortalTokenSvc=/\/sharing(\/rest)?\/generatetoken/i,this._createDefaultOAuthInfo=!0,this._hasTestedIfAppIsOnPortal=!1,this._getOAuthLocationParams(),window.addEventListener("pageshow",e=>{this._pageShowHandler(e)})}registerServers(e){const t=this.serverInfos;t?(e=e.filter(s=>!this.findServerInfo(s.server)),this.serverInfos=t.concat(e)):this.serverInfos=e,e.forEach(s=>{s.owningSystemUrl&&this._portals.push(s.owningSystemUrl),s.hasPortal&&this._portals.push(s.server)})}registerOAuthInfos(e){const t=this.oAuthInfos;if(t){for(const s of e){const i=this.findOAuthInfo(s.portalUrl);i&&t.splice(t.indexOf(i),1)}this.oAuthInfos=t.concat(e)}else this.oAuthInfos=e}registerToken(e){e={...e};const t=this._sanitizeUrl(e.server),s=this._isServerRsrc(t);let i,r=this.findServerInfo(t),n=!0;r||(r=new Q,r.server=this._getServerInstanceRoot(t),s?r.hasServer=!0:(r.tokenServiceUrl=this._getTokenSvcUrl(t),r.hasPortal=!0),this.registerServers([r])),i=this._findCredential(t),i?(delete e.server,Object.assign(i,e),n=!1):(i=new S({userId:e.userId,server:r.server,token:e.token,expires:e.expires,ssl:e.ssl,scope:s?"server":"portal"}),i.resources=[t],this.credentials.push(i)),i.emitTokenChange(!1),n||i.refreshServerTokens()}toJSON(){return le({serverInfos:this.serverInfos.map(e=>e.toJSON()),oAuthInfos:this.oAuthInfos.map(e=>e.toJSON()),credentials:this.credentials.map(e=>e.toJSON())})}initialize(e){if(!e)return;typeof e=="string"&&(e=JSON.parse(e));const t=e.serverInfos,s=e.oAuthInfos,i=e.credentials;if(t){const r=[];t.forEach(n=>{n.server&&n.tokenServiceUrl&&r.push(n.declaredClass?n:new Q(n))}),r.length&&this.registerServers(r)}if(s){const r=[];s.forEach(n=>{n.appId&&r.push(n.declaredClass?n:new oe(n))}),r.length&&this.registerOAuthInfos(r)}i&&i.forEach(r=>{r.server&&r.token&&r.expires&&r.expires>Date.now()&&((r=r.declaredClass?r:new S(r)).emitTokenChange(),this.credentials.push(r))})}findServerInfo(e){let t;e=this._sanitizeUrl(e);for(const s of this.serverInfos)if(this._hasSameServerInstance(s.server,e)){t=s;break}return t}findOAuthInfo(e){let t;e=this._sanitizeUrl(e);for(const s of this.oAuthInfos)if(this._hasSameServerInstance(s.portalUrl,e)){t=s;break}return t}findCredential(e,t){if(!e)return;let s;e=this._sanitizeUrl(e);const i=this._isServerRsrc(e)?"server":"portal";if(t){for(const r of this.credentials)if(this._hasSameServerInstance(r.server,e)&&t===r.userId&&r.scope===i){s=r;break}}else for(const r of this.credentials)if(this._hasSameServerInstance(r.server,e)&&this._getIdenticalSvcIdx(e,r)!==-1&&r.scope===i){s=r;break}return s}getCredential(e,t){let s,i,r=!0;t&&(s=!!t.token,i=t.error,r=t.prompt!==!1),t={...t},e=this._sanitizeUrl(e);const n=new AbortController,h=N();if(t.signal&&E(t.signal,()=>{n.abort()}),E(n,()=>{h.reject(new U("identity-manager:user-aborted","ABORTED"))}),me(n))return h.promise;t.signal=n.signal;const u=this._isAdminResource(e),o=s?this.findCredential(e):null;let l;if(o&&i&&i.details&&i.details.httpStatus===498)o.destroy();else if(o)return l=new U("identity-manager:not-authorized","You are currently signed in as: '"+o.userId+"'. You do not have access to this resource: "+e,{error:i}),h.reject(l),h.promise;const d=this._findCredential(e,t);if(d)return h.resolve(d),h.promise;let a=this.findServerInfo(e);if(a)!a.hasPortal&&a.server&&a.owningSystemUrl&&this._hasSameServerInstance(a.server,a.owningSystemUrl)&&(a.hasPortal=!0),!a.hasServer&&this._isServerRsrc(e)&&(a._restInfoPms=this._getTokenSvcUrl(e),a.hasServer=!0);else{const _=this._getTokenSvcUrl(e);if(!_)return l=new U("identity-manager:unknown-resource","Unknown resource - could not find token service endpoint."),h.reject(l),h.promise;a=new Q,a.server=this._getServerInstanceRoot(e),typeof _=="string"?(a.tokenServiceUrl=_,a.hasPortal=!0):(a._restInfoPms=_,a.hasServer=!0),this.registerServers([a])}return a.hasPortal&&a._selfReq===void 0&&(r||C(a.tokenServiceUrl,this._appOrigin)||this._gwDomains.some(_=>_.tokenServiceUrl===a.tokenServiceUrl))&&(a._selfReq={owningTenant:t==null?void 0:t.owningTenant,selfDfd:this._getPortalSelf(a.tokenServiceUrl.replace(this._rePortalTokenSvc,"/sharing/rest/portals/self"),e)}),this._enqueue(e,a,t,h,u)}getResourceName(e){return this._isRESTService(e)?e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"")||"":this._gwUser.test(e)&&e.replace(this._gwUser,"$1")||this._gwItem.test(e)&&e.replace(this._gwItem,"$1")||this._gwGroup.test(e)&&e.replace(this._gwGroup,"$1")||""}generateToken(e,t,s){const i=this._rePortalTokenSvc.test(e.tokenServiceUrl),r=new D(this._appOrigin),n=e.shortLivedTokenValidity;let h,u,o,l,d,a,_,w;t&&(w=this.tokenValidity||n||this._defaultTokenValidity,w>n&&n>0&&(w=n)),s&&(h=s.isAdmin,u=s.serverUrl,o=s.token,a=s.signal,_=s.ssl,e.customParameters=s.customParameters),h?l=e.adminTokenServiceUrl:(l=e.tokenServiceUrl,d=new D(l.toLowerCase()),e.webTierAuth&&(s!=null&&s.serverUrl)&&!_&&r.scheme==="http"&&(C(r.uri,l,!0)||d.scheme==="https"&&r.host===d.host&&r.port==="7080"&&d.port==="7443")&&(l=l.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const g={query:{request:"getToken",username:t==null?void 0:t.username,password:t==null?void 0:t.password,serverUrl:u,token:o,expiration:w,referer:h||i?this._appOrigin:null,client:h?"referer":null,f:"json",...e.customParameters},method:"post",authMode:"anonymous",useProxy:this._useProxy(e,s),signal:a,...s==null?void 0:s.ioArgs};return i||(g.withCredentials=!1),R(l,g).then(I=>{const m=I.data;if(!(m!=null&&m.token))return new U("identity-manager:authentication-failed","Unable to generate token");const b=e.server;return M[b]||(M[b]={}),t&&(M[b][t.username]=t.password),m.validity=w,m})}isBusy(){return!!this._busy}checkSignInStatus(e){return this.checkAppAccess(e,"").then(t=>t.credential)}checkAppAccess(e,t,s){let i=!1;return this.getCredential(e,{prompt:!1}).then(r=>{let n;const h={f:"json"};if(r.scope==="portal")if(t&&(this._doPortalSignIn(e)||s!=null&&s.force))n=r.server+"/sharing/rest/oauth2/validateAppAccess",h.client_id=t;else{if(!r.token)return{credential:r};n=r.server+"/sharing/rest"}else{if(!r.token)return{credential:r};n=r.server+"/rest/services"}return r.token&&(h.token=r.token),R(n,{query:h,authMode:"anonymous"}).then(u=>{if(u.data.valid===!1)throw new U("identity-manager:not-authorized",`You are currently signed in as: '${r.userId}'.`,u.data);return i=!!u.data.viewOnlyUserTypeApp,{credential:r}}).catch(u=>{var l;if(u.name==="identity-manager:not-authorized")throw u;const o=(l=u.details)==null?void 0:l.httpStatus;if(o===498)throw r.destroy(),new U("identity-manager:not-authenticated","User is not signed in.");if(o===400)throw new U("identity-manager:invalid-request");return{credential:r}})}).then(r=>({credential:r.credential,viewOnly:i}))}setOAuthResponseHash(e){e&&(e.charAt(0)==="#"&&(e=e.substring(1)),this._processOAuthPopupParams(L(e)))}setOAuthRedirectionHandler(e){this._oAuthRedirectFunc=e}setProtocolErrorHandler(e){this._protocolFunc=e}signIn(e,t,s={}){const i=N(),r=()=>{var l;u==null||u.remove(),o==null||o.remove(),(l=this.dialog)==null||l.destroy(),this.dialog=u=o=null},n=()=>{r(),this._oAuthDfd=null,i.reject(new U("identity-manager:user-aborted","ABORTED"))};s.signal&&E(s.signal,()=>{n()});const h=new ne({open:!0,resource:this.getResourceName(e),server:t.server});this.dialog=h,this.emit("dialog-create");let u=h.on("cancel",n),o=h.on("submit",l=>{this.generateToken(t,l,{isAdmin:s.isAdmin,signal:s.signal}).then(d=>{r();const a=new S({userId:l.username,server:t.server,token:d.token,expires:d.expires!=null?Number(d.expires):null,ssl:!!d.ssl,isAdmin:s.isAdmin,validity:d.validity});i.resolve(a)}).catch(d=>{h.error=d,h.signingIn=!1})});return i.promise}oAuthSignIn(e,t,s,i){this._oAuthDfd=N();const r=this._oAuthDfd;let n;i!=null&&i.signal&&E(i.signal,()=>{const a=this._oAuthDfd&&this._oAuthDfd.oAuthWin_;a&&!a.closed?a.close():this.dialog&&l()}),r.resUrl_=e,r.sinfo_=t,r.oinfo_=s;const h=s._oAuthCred;if(h.storage&&(s.flowType==="authorization-code"||s.flowType==="auto"&&t.currentVersion>=8.4)){let a=crypto.getRandomValues(new Uint8Array(32));n=J(a),h.codeVerifier=n,a=crypto.getRandomValues(new Uint8Array(32)),h.stateUID=J(a),h.save()||(h.codeVerifier=n=null)}else h.codeVerifier=null;let u,o;this._getCodeChallenge(n).then(a=>{const _=!i||i.oAuthPopupConfirmation!==!1;if(!s.popup||!_)return void this._doOAuthSignIn(e,t,s,a);const w=new ne({oAuthPrompt:!0,server:t.server,open:!0});this.dialog=w,this.emit("dialog-create"),u=w.on("cancel",l),o=w.on("submit",()=>{d(),this._doOAuthSignIn(e,t,s,a)})});const l=()=>{d(),this._oAuthDfd=null,r.reject(new U("identity-manager:user-aborted","ABORTED"))},d=()=>{var a;u==null||u.remove(),o==null||o.remove(),(a=this.dialog)==null||a.destroy(),this.dialog=null};return r.promise}destroyCredentials(){this.credentials&&this.credentials.slice().forEach(e=>{e.destroy()}),this.emit("credentials-destroy")}enablePostMessageAuth(e="https://www.arcgis.com/sharing/rest"){this._postMessageAuthHandle&&this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=G(window,"message",t=>{var s;if((t.origin===this._appOrigin||t.origin.endsWith(".arcgis.com"))&&((s=t.data)==null?void 0:s.type)==="arcgis:auth:requestCredential"){const i=t.source;this.getCredential(e).then(r=>{i.postMessage({type:"arcgis:auth:credential",credential:{expires:r.expires,server:r.server,ssl:r.ssl,token:r.token,userId:r.userId}},t.origin)}).catch(r=>{i.postMessage({type:"arcgis:auth:error",error:{name:r.name,message:r.message}},t.origin)})}})}disablePostMessageAuth(){this._postMessageAuthHandle&&(this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=null)}_getOAuthLocationParams(){var s,i;let e=window.location.hash;if(e){e.charAt(0)==="#"&&(e=e.substring(1));const r=L(e);let n=!1;if(r.access_token&&r.expires_in&&r.state&&r.hasOwnProperty("username"))try{r.state=JSON.parse(r.state),r.state.portalUrl&&(this._oAuthLocationParams=r,n=!0)}catch{}else if(r.error&&r.error_description&&(console.log("IdentityManager OAuth Error: ",r.error," - ",r.error_description),r.error==="access_denied"&&(n=!0,r.state)))try{r.state=JSON.parse(r.state)}catch{}n&&(window.location.hash=((s=r.state)==null?void 0:s.hash)||"")}let t=window.location.search;if(t){t.charAt(0)==="?"&&(t=t.substring(1));const r=L(t);let n=!1;if(r.code&&r.state)try{r.state=JSON.parse(r.state),r.state.portalUrl&&r.state.uid&&(this._oAuthLocationParams=r,n=!0)}catch{}else if(r.error&&r.error_description&&(console.log("IdentityManager OAuth Error: ",r.error," - ",r.error_description),r.error==="access_denied"&&(n=!0,r.state)))try{r.state=JSON.parse(r.state)}catch{}if(n){const h={...r};["code","error","error_description","message_code","persist","state"].forEach(l=>{delete h[l]});const u=re(h),o=window.location.pathname+(u?`?${u}`:"")+(((i=r.state)==null?void 0:i.hash)||"");window.history.replaceState(window.history.state,"",o)}}}_getOAuthToken(e,t,s,i,r){return e=e.replace(/^http:/i,"https:"),R(`${e}/sharing/rest/oauth2/token`,{authMode:"anonymous",method:"post",query:i&&r?{grant_type:"authorization_code",code:t,redirect_uri:i,client_id:s,code_verifier:r}:{grant_type:"refresh_token",refresh_token:t,client_id:s}}).then(n=>n.data)}_getCodeChallenge(e){if(e&&globalThis.isSecureContext){const t=new TextEncoder().encode(e);return crypto.subtle.digest("SHA-256",t).then(s=>J(new Uint8Array(s)))}return Promise.resolve(null)}_pageShowHandler(e){if(e.persisted&&this.isBusy()&&this._rejectOnPersistedPageShow){const t=new U("identity-manager:user-aborted","ABORTED");this._errbackFunc(t)}}_findCredential(e,t){let s,i,r,n,h=-1;const u=t==null?void 0:t.token,o=t==null?void 0:t.resource,l=this._isServerRsrc(e)?"server":"portal",d=this.credentials.filter(a=>this._hasSameServerInstance(a.server,e)&&a.scope===l);if(e=o||e,d.length)if(d.length===1){if(s=d[0],r=this.findServerInfo(s.server),i=r==null?void 0:r.owningSystemUrl,n=i?this.findCredential(i,s.userId):void 0,h=this._getIdenticalSvcIdx(e,s),!u)return h===-1&&s.resources.push(e),this._addResource(e,n),s;h!==-1&&(s.resources.splice(h,1),this._removeResource(e,n))}else{let a,_;if(d.some(w=>(_=this._getIdenticalSvcIdx(e,w),_!==-1&&(a=w,r=this.findServerInfo(a.server),i=r==null?void 0:r.owningSystemUrl,n=i?this.findCredential(i,a.userId):void 0,h=_,!0))),u)a&&(a.resources.splice(h,1),this._removeResource(e,n));else if(a)return this._addResource(e,n),a}}_findOAuthInfo(e){let t=this.findOAuthInfo(e);if(!t){for(const s of this.oAuthInfos)if(this._isIdProvider(s.portalUrl,e)){t=s;break}}return t}_addResource(e,t){t&&this._getIdenticalSvcIdx(e,t)===-1&&t.resources.push(e)}_removeResource(e,t){let s=-1;t&&(s=this._getIdenticalSvcIdx(e,t),s>-1&&t.resources.splice(s,1))}_useProxy(e,t){return(t==null?void 0:t.isAdmin)&&!C(e.adminTokenServiceUrl,this._appOrigin)||!this._isPortalDomain(e.tokenServiceUrl)&&String(e.currentVersion)==="10.1"&&!C(e.tokenServiceUrl,this._appOrigin)}_getOrigin(e){const t=new D(e);return t.scheme+"://"+t.host+(t.port!=null?":"+t.port:"")}_getServerInstanceRoot(e){const t=e.toLowerCase();let s=t.indexOf(this._agsRest);return s===-1&&this._isAdminResource(e)&&(s=this._agsAdmin.test(e)?e.replace(this._agsAdmin,"$1").length:e.search(this._adminSvcs)),s!==-1||ve(t)||(s=t.indexOf("/sharing")),s===-1&&t.substr(-1)==="/"&&(s=t.length-1),s>-1?e.substring(0,s):e}_hasSameServerInstance(e,t){return e.substr(-1)==="/"&&(e=e.slice(0,-1)),e=e.toLowerCase(),t=this._getServerInstanceRoot(t).toLowerCase(),e=this._normalizeAGOLorgDomain(e),t=this._normalizeAGOLorgDomain(t),(e=e.substr(e.indexOf(":")))===(t=t.substr(t.indexOf(":")))}_normalizeAGOLorgDomain(e){const t=/^https?:\/\/(?:cdn|[a-z\d-]+\.maps)\.arcgis\.com/i,s=/^https?:\/\/(?:cdndev|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,i=/^https?:\/\/(?:cdnqa|[a-z\d-]+\.mapsqa)\.arcgis\.com/i;return t.test(e)?e=e.replace(t,"https://www.arcgis.com"):s.test(e)?e=e.replace(s,"https://devext.arcgis.com"):i.test(e)&&(e=e.replace(i,"https://qaext.arcgis.com")),e}_sanitizeUrl(e){const t=(W.request.proxyUrl||"").toLowerCase(),s=t?e.toLowerCase().indexOf(t+"?"):-1;return s!==-1&&(e=e.substring(s+t.length+1)),e=Ie(e),H(e).path}_isRESTService(e){return e.includes(this._agsRest)}_isAdminResource(e){return this._agsAdmin.test(e)||this._adminSvcs.test(e)}_isServerRsrc(e){return this._isRESTService(e)||this._isAdminResource(e)}_isIdenticalService(e,t){let s=!1;if(this._isRESTService(e)&&this._isRESTService(t)){const i=this._getSuffix(e).toLowerCase(),r=this._getSuffix(t).toLowerCase();if(s=i===r,!s){const n=/(.*)\/(MapServer|FeatureServer|UtilityNetworkServer).*/gi;s=i.replaceAll(n,"$1")===r.replaceAll(n,"$1")}}else this._isAdminResource(e)&&this._isAdminResource(t)?s=!0:this._isServerRsrc(e)||this._isServerRsrc(t)||!this._isPortalDomain(e)||(s=!0);return s}_isPortalDomain(e){const t=new D(e.toLowerCase()),s=this._portalConfig;let i=this._gwDomains.some(r=>r.regex.test(t.uri));return!i&&s&&(i=this._hasSameServerInstance(this._getServerInstanceRoot(s.restBaseUrl),t.uri)),i||W.portalUrl&&(i=C(t,W.portalUrl,!0)),i||(i=this._portals.some(r=>this._hasSameServerInstance(r,t.uri))),i=i||this._agsPortal.test(t.path),i}_isIdProvider(e,t){let s=-1,i=-1;this._gwDomains.forEach((n,h)=>{s===-1&&n.regex.test(e)&&(s=h),i===-1&&n.regex.test(t)&&(i=h)});let r=!1;if(s>-1&&i>-1&&(s===0||s===4?i!==0&&i!==4||(r=!0):s===1?i!==1&&i!==2||(r=!0):s===2?i===2&&(r=!0):s===3&&i===3&&(r=!0)),!r){const n=this.findServerInfo(t),h=n==null?void 0:n.owningSystemUrl;h&&ce(n)&&this._isPortalDomain(h)&&this._isIdProvider(e,h)&&(r=!0)}return r}_getIdenticalSvcIdx(e,t){let s=-1;for(let i=0;in.data),{adminUrl:t,promise:s}}if(this._isPortalDomain(e)){let r="";if(this._gwDomains.some(n=>(n.regex.test(e)&&(r=n.tokenServiceUrl),!!r)),r||this._portals.some(n=>(this._hasSameServerInstance(n,e)&&(r=n+this._gwTokenUrl),!!r)),r||(i=e.toLowerCase().indexOf("/sharing"),i!==-1&&(r=e.substring(0,i)+this._gwTokenUrl)),r||(r=this._getOrigin(e)+this._gwTokenUrl),r){const n=new D(e).port;/^http:\/\//i.test(e)&&n==="7080"&&(r=r.replace(/:7080/i,":7443")),r=r.replace(/http:/i,"https:")}return r}if(e.toLowerCase().includes("premium.arcgisonline.com"))return"https://premium.arcgisonline.com/server/tokens"}_processOAuthResponseParams(e,t,s){const i=t._oAuthCred;if(e.code){const n=i.codeVerifier;return i.codeVerifier=null,i.stateUID=null,i.save(),this._getOAuthToken(s.server,e.code,t.appId,this._getRedirectURI(t,!0),n).then(h=>{const u=new S({userId:h.username,server:s.server,token:h.access_token,expires:Date.now()+1e3*h.expires_in,ssl:h.ssl,oAuthState:e.state,_oAuthCred:i});return t.userId=u.userId,i.storage=h.persist?z:B,i.refreshToken=h.refresh_token,i.token=null,i.expires=h.refresh_token_expires_in?Date.now()+1e3*h.refresh_token_expires_in:null,i.userId=u.userId,i.ssl=u.ssl,i.save(),u})}const r=new S({userId:e.username,server:s.server,token:e.access_token,expires:Date.now()+1e3*Number(e.expires_in),ssl:e.ssl==="true",oAuthState:e.state,_oAuthCred:i});return t.userId=r.userId,i.storage=e.persist?z:B,i.refreshToken=null,i.token=r.token,i.expires=r.expires,i.userId=r.userId,i.ssl=r.ssl,i.save(),Promise.resolve(r)}_processOAuthPopupParams(e){var s;const t=this._oAuthDfd;if(this._oAuthDfd=null,t)if(clearInterval(this._oAuthIntervalId),(s=this._oAuthOnPopupHandle)==null||s.remove(),e.error){const i=e.error==="access_denied",r=new U(i?"identity-manager:user-aborted":"identity-manager:authentication-failed",i?"ABORTED":"OAuth: "+e.error+" - "+e.error_description);t.reject(r)}else this._processOAuthResponseParams(e,t.oinfo_,t.sinfo_).then(i=>{t.resolve(i)}).catch(i=>{t.reject(i)})}_setOAuthResponseQueryString(e){e&&(e.charAt(0)==="?"&&(e=e.substring(1)),this._processOAuthPopupParams(L(e)))}_exchangeToken(e,t,s){return R(`${e}/sharing/rest/oauth2/exchangeToken`,{authMode:"anonymous",method:"post",query:{f:"json",client_id:t,token:s}}).then(i=>i.data.token)}_getPlatformSelf(e,t){return e=e.replace(/^http:/i,"https:"),R(`${e}/sharing/rest/oauth2/platformSelf`,{authMode:"anonymous",headers:{"X-Esri-Auth-Client-Id":t,"X-Esri-Auth-Redirect-Uri":window.location.href.replace(/#.*$/,"")},method:"post",query:{f:"json",expiration:30},withCredentials:!0}).then(s=>s.data)}_getPortalSelf(e,t){let s;return this._gwDomains.some(i=>(i.regex.test(e)&&(s=i.customBaseUrl),!!s)),s?Promise.resolve({allSSL:!0,currentVersion:"8.4",customBaseUrl:s,portalMode:"multitenant",supportsOAuth:!0}):(this._appOrigin.startsWith("https:")?e=e.replace(/^http:/i,"https:").replace(/:7080/i,":7443"):/^http:/i.test(t)&&(e=e.replace(/^https:/i,"http:").replace(/:7443/i,":7080")),R(e,{query:{f:"json"},authMode:"anonymous",withCredentials:!0}).then(i=>i.data))}_doPortalSignIn(e){const t=this._portalConfig,s=window.location.href,i=this.findServerInfo(e);return!(!t&&!this._isPortalDomain(s)||!(i?i.hasPortal||i.owningSystemUrl&&this._isPortalDomain(i.owningSystemUrl):this._isPortalDomain(e))||!(this._isIdProvider(s,e)||t&&(this._hasSameServerInstance(this._getServerInstanceRoot(t.restBaseUrl),e)||this._isIdProvider(t.restBaseUrl,e))||C(s,e,!0)))}_checkProtocol(e,t,s,i){let r=!0;const n=i?t.adminTokenServiceUrl:t.tokenServiceUrl;return n.trim().toLowerCase().startsWith("https:")&&!this._appOrigin.startsWith("https:")&&we(n)&&(r=!!this._protocolFunc&&!!this._protocolFunc({resourceUrl:e,serverInfo:t}),!r)&&s(new U("identity-manager:aborted","Aborted the Sign-In process to avoid sending password over insecure connection.")),r}_enqueue(e,t,s,i,r,n){return i||(i=N()),i.resUrl_=e,i.sinfo_=t,i.options_=s,i.admin_=r,i.refresh_=n,this._busy?this._hasSameServerInstance(this._getServerInstanceRoot(e),this._busy.resUrl_)?(this._oAuthDfd&&this._oAuthDfd.oAuthWin_&&this._oAuthDfd.oAuthWin_.focus(),this._soReqs.push(i)):this._xoReqs.push(i):this._doSignIn(i),i.promise}_doSignIn(e){this._busy=e,this._rejectOnPersistedPageShow=!1;const t=o=>{var I;const l=(I=e.options_)==null?void 0:I.resource,d=e.resUrl_,a=e.refresh_;let _=!1;this.credentials.includes(o)||(a&&this.credentials.includes(a)?(a.userId=o.userId,a.token=o.token,a.expires=o.expires,a.validity=o.validity,a.ssl=o.ssl,a.creationTime=o.creationTime,_=!0,o=a):this.credentials.push(o)),o.resources||(o.resources=[]),o.resources.includes(l||d)||o.resources.push(l||d),o.scope=this._isServerRsrc(d)?"server":"portal",o.emitTokenChange();const w=this._soReqs,g={};this._soReqs=[],w.forEach(m=>{if(!this._isIdenticalService(d,m.resUrl_)){const b=this._getSuffix(m.resUrl_);g[b]||(g[b]=!0,o.resources.push(m.resUrl_))}}),e.resolve(o),w.forEach(m=>{this._hasSameServerInstance(this._getServerInstanceRoot(d),m.resUrl_)?m.resolve(o):this._soReqs.push(m)}),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,_||this.emit("credential-create",{credential:o}),this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},s=o=>{e.reject(o),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},i=(o,l,d,a)=>{var b,q,te;const _=e.sinfo_,w=!e.options_||e.options_.prompt!==!1,g=_.hasPortal&&this._findOAuthInfo(e.resUrl_);let I,m;if(o)t(new S({userId:o,server:_.server,token:d||null,expires:a!=null?Number(a):null,ssl:!!l}));else if(window!==window.parent&&((b=this._appUrlObj.query)!=null&&b["arcgis-auth-origin"])&&((q=this._appUrlObj.query)!=null&&q["arcgis-auth-portal"])&&this._hasSameServerInstance(this._getServerInstanceRoot(this._appUrlObj.query["arcgis-auth-portal"]),e.resUrl_)){window.parent.postMessage({type:"arcgis:auth:requestCredential"},this._appUrlObj.query["arcgis-auth-origin"]);const v=G(window,"message",y=>{y.source===window.parent&&y.data&&(y.data.type==="arcgis:auth:credential"?(v.remove(),y.data.credential.expires{v.remove()})}else if(g){let v=g._oAuthCred;if(!v){const y=new Z(g,z),k=new Z(g,B);y.isValid()&&k.isValid()?y.expires>k.expires?(v=y,k.destroy()):(v=k,y.destroy()):v=y.isValid()?y:k,g._oAuthCred=v}if(v.isValid()){I=new S({userId:v.userId,server:_.server,token:v.token,expires:v.expires,ssl:v.ssl,_oAuthCred:v});const y=g.appId!==v.appId&&this._doPortalSignIn(e.resUrl_);y||v.refreshToken?(e._pendingDfd=v.refreshToken?this._getOAuthToken(_.server,v.refreshToken,v.appId).then(k=>(I.expires=Date.now()+1e3*k.expires_in,I.token=k.access_token,I)):Promise.resolve(I),e._pendingDfd.then(k=>y?this._exchangeToken(k.server,g.appId,k.token).then(pe=>(k.token=pe,k)).catch(()=>k):k).then(k=>{t(k)}).catch(()=>{v==null||v.destroy(),i()})):t(I)}else if(this._oAuthLocationParams&&this._hasSameServerInstance(g.portalUrl,this._oAuthLocationParams.state.portalUrl)&&(this._oAuthLocationParams.access_token||this._oAuthLocationParams.code&&this._oAuthLocationParams.state.uid===v.stateUID&&v.codeVerifier)){const y=this._oAuthLocationParams;this._oAuthLocationParams=null,e._pendingDfd=this._processOAuthResponseParams(y,g,_).then(k=>{t(k)}).catch(s)}else{const y=()=>{w?e._pendingDfd=this.oAuthSignIn(e.resUrl_,_,g,e.options_).then(t,s):(m=new U("identity-manager:not-authenticated","User is not signed in."),s(m))};this._doPortalSignIn(e.resUrl_)?e._pendingDfd=this._getPlatformSelf(_.server,g.appId).then(k=>{C(k.portalUrl,this._appOrigin,!0)?(I=new S({userId:k.username,server:_.server,expires:Date.now()+1e3*k.expires_in,token:k.token}),t(I)):y()}).catch(y):y()}}else if(w){if(this._checkProtocol(e.resUrl_,_,s,e.admin_)){let v=e.options_;e.admin_&&(v=v||{},v.isAdmin=!0),e._pendingDfd=this.signIn(e.resUrl_,_,v).then(t,s)}}else m=new U("identity-manager:not-authenticated","User is not signed in."),s(m)},r=()=>{const o=e.sinfo_,l=o.owningSystemUrl,d=e.options_;let a,_,w,g;if(d&&(a=d.token,_=d.error,w=d.prompt),g=this._findCredential(l,{token:a,resource:e.resUrl_}),!g){for(const I of this.credentials)if(this._isIdProvider(l,I.server)){g=I;break}}if(g){const I=this.findCredential(e.resUrl_,g.userId);if(I)t(I);else if(ee(o,this._legacyFed)){const m=g.toJSON();m.server=o.server,m.resources=null,t(new S(m))}else(e._pendingDfd=this.generateToken(this.findServerInfo(g.server),null,{serverUrl:e.resUrl_,token:g.token,signal:e.options_.signal,ssl:g.ssl})).then(m=>{t(new S({userId:g==null?void 0:g.userId,server:o.server,token:m.token,expires:m.expires!=null?Number(m.expires):null,ssl:!!m.ssl,isAdmin:e.admin_,validity:m.validity}))},s)}else this._busy=null,a&&(e.options_.token=null),(e._pendingDfd=this.getCredential(l.replace(/\/?$/,"/sharing"),{resource:e.resUrl_,owningTenant:o.owningTenant,signal:e.options_.signal,token:a,error:_,prompt:w})).then(()=>{this._enqueue(e.resUrl_,e.sinfo_,e.options_,e,e.admin_)},I=>{e.resUrl_=e.sinfo_=e.refresh_=null,e.reject(I)})};this._errbackFunc=s;const n=e.sinfo_.owningSystemUrl,h=this._isServerRsrc(e.resUrl_),u=e.sinfo_._restInfoPms;u?u.promise.then(o=>{const l=e.sinfo_;if(l._restInfoPms){l.adminTokenServiceUrl=l._restInfoPms.adminUrl,l._restInfoPms=null,l.tokenServiceUrl=(V("authInfo.tokenServicesUrl",o)||V("authInfo.tokenServiceUrl",o)||V("tokenServiceUrl",o))??null,l.shortLivedTokenValidity=V("authInfo.shortLivedTokenValidity",o)??null,l.currentVersion=o.currentVersion,l.owningTenant=o.owningTenant;const d=l.owningSystemUrl=o.owningSystemUrl;d&&this._portals.push(d)}h&&l.owningSystemUrl?r():i()},()=>{e.sinfo_._restInfoPms=null;const o=new U("identity-manager:server-identification-failed","Unknown resource - could not find token service endpoint.");s(o)}):h&&n?r():e.sinfo_._selfReq?e.sinfo_._selfReq.selfDfd.then(o=>{var g;const l={};let d,a,_,w;return o&&(d=(g=o.user)==null?void 0:g.username,l.username=d,l.allSSL=o.allSSL,a=o.supportsOAuth,w=parseFloat(o.currentVersion),o.portalMode==="multitenant"&&(_=o.customBaseUrl),e.sinfo_.currentVersion=w),e.sinfo_.webTierAuth=!!d,d&&this.normalizeWebTierAuth?this.generateToken(e.sinfo_,null,{ssl:l.allSSL}).catch(()=>null).then(I=>(l.portalToken=I&&I.token,l.tokenExpiration=I&&I.expires,l)):!d&&a&&w>=4.4&&!this._findOAuthInfo(e.resUrl_)?this._generateOAuthInfo({portalUrl:e.sinfo_.server,customBaseUrl:_,owningTenant:e.sinfo_._selfReq.owningTenant}).catch(()=>null).then(()=>l):l}).catch(()=>null).then(o=>{e.sinfo_._selfReq=null,o?i(o.username,o.allSSL,o.portalToken,o.tokenExpiration):i()}):i()}_generateOAuthInfo(e){let t,s=null,i=e.portalUrl;const r=e.customBaseUrl,n=e.owningTenant,h=!this._defaultOAuthInfo&&this._createDefaultOAuthInfo&&!this._hasTestedIfAppIsOnPortal;if(h){s=window.location.href;let u=s.indexOf("?");u>-1&&(s=s.slice(0,u)),u=s.search(/\/(apps|home)\//),s=u>-1?s.slice(0,u):null}return h&&s?(this._hasTestedIfAppIsOnPortal=!0,t=R(s+"/sharing/rest",{query:{f:"json"}}).then(()=>{this._defaultOAuthInfo=new oe({appId:"arcgisonline",popupCallbackUrl:s+"/home/oauth-callback.html"})})):t=Promise.resolve(),t.then(()=>{if(this._defaultOAuthInfo)return i=i.replace(/^http:/i,"https:"),R(i+"/sharing/rest/oauth2/validateRedirectUri",{query:{accountId:n,client_id:this._defaultOAuthInfo.appId,redirect_uri:ie(this._defaultOAuthInfo.popupCallbackUrl),f:"json"}}).then(u=>{if(u.data.valid){const o=this._defaultOAuthInfo.clone();u.data.urlKey&&r?o.portalUrl="https://"+u.data.urlKey.toLowerCase()+"."+r:o.portalUrl=i,o.popup=window!==window.top||!(C(i,this._appOrigin)||this._gwDomains.some(l=>l.regex.test(i)&&l.regex.test(this._appOrigin))),this.oAuthInfos.push(o)}})})}_doOAuthSignIn(e,t,s,i){const r=s._oAuthCred,n={portalUrl:s.portalUrl};!s.popup&&s.preserveUrlHash&&window.location.hash&&(n.hash=window.location.hash),r.stateUID&&(n.uid=r.stateUID);const h={client_id:s.appId,response_type:r.codeVerifier?"code":"token",state:JSON.stringify(n),expiration:s.expiration,locale:s.locale,redirect_uri:this._getRedirectURI(s,!!r.codeVerifier)};s.forceLogin&&(h.force_login=!0),s.forceUserId&&s.userId&&(h.prepopulatedusername=s.userId),!s.popup&&this._doPortalSignIn(e)&&(h.redirectToUserOrgUrl=!0),r.codeVerifier&&(h.code_challenge=i||r.codeVerifier,h.code_challenge_method=i?"S256":"plain");const u=s.portalUrl.replace(/^http:/i,"https:")+"/sharing/oauth2/authorize",o=u+"?"+re(h);if(s.popup){const l=window.open(o,"esriJSAPIOAuth",s.popupWindowFeatures);if(l)l.focus(),this._oAuthDfd.oAuthWin_=l,this._oAuthIntervalId=setInterval(()=>{if(l.closed){clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle.remove();const d=this._oAuthDfd;if(d){const a=new U("identity-manager:user-aborted","ABORTED");d.reject(a)}}},500),this._oAuthOnPopupHandle=G(window,["arcgis:auth:hash","arcgis:auth:location:search"],d=>{d.type==="arcgis:auth:hash"?this.setOAuthResponseHash(d.detail):this._setOAuthResponseQueryString(d.detail)});else{const d=new U("identity-manager:popup-blocked","ABORTED");this._oAuthDfd.reject(d)}}else this._rejectOnPersistedPageShow=!0,this._oAuthRedirectFunc?this._oAuthRedirectFunc({authorizeParams:h,authorizeUrl:u,resourceUrl:e,serverInfo:t,oAuthInfo:s}):window.location.href=o}_getRedirectURI(e,t){const s=window.location.href.replace(/#.*$/,"");if(e.popup)return ie(e.popupCallbackUrl);if(t){const i=H(s);return i.query&&["code","error","error_description","message_code","persist","state"].forEach(r=>{delete i.query[r]}),Se(i.path,i.query)}return s}}de.prototype.declaredClass="esri.identity.IdentityManagerBase";let S=class extends he.EventedAccessor{constructor(c){super(c),this._oAuthCred=null,this.tokenRefreshBuffer=2,c!=null&&c._oAuthCred&&(this._oAuthCred=c._oAuthCred)}initialize(){this.resources=this.resources||[],this.creationTime==null&&(this.creationTime=Date.now())}refreshToken(){const c=A.findServerInfo(this.server),e=c==null?void 0:c.owningSystemUrl,t=!!e&&this.scope==="server",s=t&&ee(c,A._legacyFed),i=c.webTierAuth,r=i&&A.normalizeWebTierAuth,n=M[this.server],h=n==null?void 0:n[this.userId];let u,o=this.resources&&this.resources[0],l=t?A.findServerInfo(e):null,d={username:this.userId,password:h};if(i&&!r)return;t&&!l&&A.serverInfos.some(_=>(A._isIdProvider(e,_.server)&&(l=_),!!l));const a=l?A.findCredential(l.server,this.userId):null;if(!t||a){if(!s){if(t)u={serverUrl:o,token:a==null?void 0:a.token,ssl:a&&a.ssl};else if(r)d=null,u={ssl:this.ssl};else{if(!h){let _;return o&&(o=A._sanitizeUrl(o),this._enqueued=1,_=A._enqueue(o,c,null,null,this.isAdmin,this),_.then(()=>{this._enqueued=0,this.refreshServerTokens()}).catch(()=>{this._enqueued=0})),_}this.isAdmin&&(u={isAdmin:!0})}return A.generateToken(t?l:c,t?null:d,u).then(_=>{this.token=_.token,this.expires=_.expires!=null?Number(_.expires):null,this.creationTime=Date.now(),this.validity=_.validity,this.emitTokenChange(),this.refreshServerTokens()}).catch(()=>{})}a==null||a.refreshToken()}}refreshServerTokens(){this.scope==="portal"&&A.credentials.forEach(c=>{const e=A.findServerInfo(c.server),t=e==null?void 0:e.owningSystemUrl;c!==this&&c.userId===this.userId&&t&&c.scope==="server"&&(A._hasSameServerInstance(this.server,t)||A._isIdProvider(t,this.server))&&(ee(e,A._legacyFed)?(c.token=this.token,c.expires=this.expires,c.creationTime=this.creationTime,c.validity=this.validity,c.emitTokenChange()):c.refreshToken())})}emitTokenChange(c){clearTimeout(this._refreshTimer);const e=this.server?A.findServerInfo(this.server):null,t=e==null?void 0:e.owningSystemUrl,s=t?A.findServerInfo(t):null;c===!1||t&&this.scope!=="portal"&&(!(s!=null&&s.webTierAuth)||A.normalizeWebTierAuth)||this.expires==null&&this.validity==null||this._startRefreshTimer(),this.emit("token-change")}destroy(){this.userId=this.server=this.token=this.expires=this.validity=this.resources=this.creationTime=null,this._oAuthCred&&(this._oAuthCred.destroy(),this._oAuthCred=null);const c=A.credentials.indexOf(this);c>-1&&A.credentials.splice(c,1),this.emitTokenChange(),this.emit("destroy")}toJSON(){const c=le({userId:this.userId,server:this.server,token:this.token,expires:this.expires,validity:this.validity,ssl:this.ssl,isAdmin:this.isAdmin,creationTime:this.creationTime,scope:this.scope}),e=this.resources;return e&&e.length>0&&(c.resources=e.slice()),c}_startRefreshTimer(){clearTimeout(this._refreshTimer);const c=6e4*this.tokenRefreshBuffer,e=2**31-1;let t=(this.validity?this.creationTime+6e4*this.validity:this.expires)-Date.now();t<0?t=0:t>e&&(t=e),this._refreshTimer=setTimeout(this.refreshToken.bind(this),t>c?t-c:t)}};p([f()],S.prototype,"creationTime",void 0),p([f()],S.prototype,"expires",void 0),p([f()],S.prototype,"isAdmin",void 0),p([f()],S.prototype,"oAuthState",void 0),p([f()],S.prototype,"resources",void 0),p([f()],S.prototype,"scope",void 0),p([f()],S.prototype,"server",void 0),p([f()],S.prototype,"ssl",void 0),p([f()],S.prototype,"token",void 0),p([f()],S.prototype,"tokenRefreshBuffer",void 0),p([f()],S.prototype,"userId",void 0),p([f()],S.prototype,"validity",void 0),S=p([F("esri.identity.Credential")],S);class ue extends de{}ue.prototype.declaredClass="esri.identity.IdentityManager";const Ue=new ue;ye(Ue);export{Ue as default}; +import{d as p,y as f,i4 as se,f as F,i5 as _e,i6 as fe,_ as j,i7 as x,i8 as ge,aU as ae,ca as he,az as A,i9 as le,bW as H,df as N,ia as E,N as U,ib as me,c$ as C,fN as D,M as R,eE as L,ic as J,fW as G,e0 as re,id as ve,bE as W,eR as Ie,ie as we,aG as V,cP as ie,bD as Se,ig as ye}from"./index-BjUNJPVf.js";import{s as ke}from"./substitute-Bz_UrLGp.js";const K="esri-identity-modal",X={base:K,info:`${K}__info`,notice:`${K}__notice`},Ae="ArcGIS Online";let O=class extends _e{constructor(c,e){super(c,e),this.container=document.createElement("div"),this.error=null,this.oAuthPrompt=!1,this.open=!1,this.signingIn=!1,this.server=null,this.resource=null,this._usernameInputNode=null,this._passwordInputNode=null,document.body.appendChild(this.container)}loadDependencies(){return fe({button:()=>j(()=>import("./calcite-button-CWS09kHr.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])),input:()=>j(()=>import("./calcite-input-BwO9LTJJ.js"),__vite__mapDeps([14,15,1,2,4,5,3,6,10,11,7,8,9,12])),label:()=>j(()=>import("./calcite-label-DlQTm19c.js"),__vite__mapDeps([16,1,2,7,4,5,8])),modal:()=>j(()=>import("./calcite-modal-DgU9l6Wa.js"),__vite__mapDeps([17,1,2,18,11,4,5,19,9,20,10,8,12,13,21])),notice:()=>j(()=>import("./calcite-notice-Bu--C1Vt.js"),__vite__mapDeps([22,1,2,18,11,4,5,9,10,20,8,12]))})}get title(){var c;return(c=this.commonMessages)==null?void 0:c.auth.signIn}render(){var b;const{open:c,title:e,messages:t,signingIn:s,oAuthPrompt:i,server:r,resource:n,error:h}=this,{info:u,oAuthInfo:o,lblItem:l,invalidUser:d,noAuthService:a,lblUser:_,lblPwd:w,lblCancel:g,lblSigning:I,lblOk:m}=t;return x("div",{class:this.classes(X.base,ge())},x("form",{bind:this,onsubmit:this._submit},x("calcite-modal",{bind:this,open:c,outsideCloseDisabled:!0,scale:"s",widthScale:"s",onCalciteModalClose:this._cancel,onCalciteModalOpen:this._focusUsernameInput},x("div",{slot:"header"},e),x("div",{slot:"content"},x("div",{class:X.info},ke(i?o:u,{server:r&&/\.arcgis\.com/i.test(r)?Ae:r,resource:`(${n||l})`})),h?x("calcite-notice",{class:X.notice,icon:"exclamation-mark-triangle",kind:"danger",open:!0},x("div",{slot:"message"},(b=h.details)!=null&&b.httpStatus?d:a)):null,i?null:[x("calcite-label",null,_,x("calcite-input",{afterCreate:q=>this._usernameInputNode=q,autocomplete:"off",bind:this,name:"username",required:!0,spellcheck:!1,type:"text",value:""})),x("calcite-label",null,w,x("calcite-input",{afterCreate:q=>this._passwordInputNode=q,bind:this,name:"password",required:!0,type:"password",value:""}))]),x("calcite-button",{appearance:"outline",bind:this,onclick:this._cancel,slot:"secondary",type:"button",width:"full"},g),x("calcite-button",{loading:!!s,slot:"primary",type:"submit",width:"full"},s?I:m))))}_focusUsernameInput(){requestAnimationFrame(()=>{var c;(c=this._usernameInputNode)==null||c.setFocus()})}_cancel(){this._set("signingIn",!1),this.open=!1,this._usernameInputNode&&(this._usernameInputNode.value=""),this._passwordInputNode&&(this._passwordInputNode.value=""),this.emit("cancel")}_submit(c){var t,s;c.preventDefault(),this._set("signingIn",!0);const e=this.oAuthPrompt?{}:{username:(t=this._usernameInputNode)==null?void 0:t.value,password:(s=this._passwordInputNode)==null?void 0:s.value};this.emit("submit",e)}};p([f({readOnly:!0})],O.prototype,"container",void 0),p([f(),se("esri/t9n/common")],O.prototype,"commonMessages",void 0),p([f()],O.prototype,"error",void 0),p([f(),se("esri/identity/t9n/identity")],O.prototype,"messages",void 0),p([f()],O.prototype,"oAuthPrompt",void 0),p([f()],O.prototype,"open",void 0),p([f()],O.prototype,"signingIn",void 0),p([f()],O.prototype,"server",void 0),p([f({readOnly:!0})],O.prototype,"title",null),p([f()],O.prototype,"resource",void 0),O=p([F("esri.identity.IdentityModal")],O);const ne=O,Y="esriJSAPIOAuth";class Z{constructor(e,t){this.oAuthInfo=null,this.storage=null,this.appId=null,this.codeVerifier=null,this.expires=null,this.refreshToken=null,this.ssl=null,this.stateUID=null,this.token=null,this.userId=null,this.oAuthInfo=e,this.storage=t,this._init()}isValid(){let e=!1;if(this.oAuthInfo&&this.userId&&(this.refreshToken||this.token)){if(this.expires==null&&this.refreshToken)e=!0;else if(this.expires){const t=Date.now();this.expires>t&&(this.expires-t)/1e3>60*this.oAuthInfo.minTimeUntilExpiration&&(e=!0)}}return e}save(){if(!this.storage)return!1;const e=this._load(),t=this.oAuthInfo;if(t&&t.authNamespace&&t.portalUrl){let s=e[t.authNamespace];s||(s=e[t.authNamespace]={}),this.appId||(this.appId=t.appId),s[t.portalUrl]={appId:this.appId,codeVerifier:this.codeVerifier,expires:this.expires,refreshToken:this.refreshToken,ssl:this.ssl,stateUID:this.stateUID,token:this.token,userId:this.userId};try{this.storage.setItem(Y,JSON.stringify(e))}catch(i){return console.warn(i),!1}return!0}return!1}destroy(){const e=this._load(),t=this.oAuthInfo;if(t!=null&&t.appId&&(t!=null&&t.portalUrl)&&(this.expires==null||this.expires>Date.now())&&(this.refreshToken||this.token)){const s=t.portalUrl.replace(/^http:/i,"https:")+"/sharing/rest/oauth2/revokeToken",i=new FormData;if(i.append("f","json"),i.append("auth_token",this.refreshToken||this.token),i.append("client_id",t.appId),i.append("token_type_hint",this.refreshToken?"refresh_token":"access_token"),typeof navigator.sendBeacon=="function")navigator.sendBeacon(s,i);else{const r=new XMLHttpRequest;r.open("POST",s),r.send(i)}}if(t&&t.authNamespace&&t.portalUrl&&this.storage){const s=e[t.authNamespace];if(s){delete s[t.portalUrl];try{this.storage.setItem(Y,JSON.stringify(e))}catch(i){console.log(i)}}}t&&(t._oAuthCred=null,this.oAuthInfo=null)}_init(){const e=this._load(),t=this.oAuthInfo;if(t&&t.authNamespace&&t.portalUrl){let s=e[t.authNamespace];s&&(s=s[t.portalUrl],s&&(this.appId=s.appId,this.codeVerifier=s.codeVerifier,this.expires=s.expires,this.refreshToken=s.refreshToken,this.ssl=s.ssl,this.stateUID=s.stateUID,this.token=s.token,this.userId=s.userId))}}_load(){let e={};if(this.storage){const t=this.storage.getItem(Y);if(t)try{e=JSON.parse(t)}catch(s){console.warn(s)}}return e}}Z.prototype.declaredClass="esri.identity.OAuthCredential";var $;let T=$=class extends ae{constructor(c){super(c),this._oAuthCred=null,this.appId=null,this.authNamespace="/",this.expiration=20160,this.flowType="auto",this.forceLogin=!1,this.forceUserId=!1,this.locale=null,this.minTimeUntilExpiration=30,this.popup=!1,this.popupCallbackUrl="oauth-callback.html",this.popupWindowFeatures="height=490,width=800,resizable,scrollbars,status",this.portalUrl="https://www.arcgis.com",this.preserveUrlHash=!1,this.userId=null}clone(){return $.fromJSON(this.toJSON())}};p([f({json:{write:!0}})],T.prototype,"appId",void 0),p([f({json:{write:!0}})],T.prototype,"authNamespace",void 0),p([f({json:{write:!0}})],T.prototype,"expiration",void 0),p([f({json:{write:!0}})],T.prototype,"flowType",void 0),p([f({json:{write:!0}})],T.prototype,"forceLogin",void 0),p([f({json:{write:!0}})],T.prototype,"forceUserId",void 0),p([f({json:{write:!0}})],T.prototype,"locale",void 0),p([f({json:{write:!0}})],T.prototype,"minTimeUntilExpiration",void 0),p([f({json:{write:!0}})],T.prototype,"popup",void 0),p([f({json:{write:!0}})],T.prototype,"popupCallbackUrl",void 0),p([f({json:{write:!0}})],T.prototype,"popupWindowFeatures",void 0),p([f({json:{write:!0}})],T.prototype,"portalUrl",void 0),p([f({json:{write:!0}})],T.prototype,"preserveUrlHash",void 0),p([f({json:{write:!0}})],T.prototype,"userId",void 0),T=$=p([F("esri.identity.OAuthInfo")],T);const oe=T;let P=class extends ae{constructor(c){super(c),this.adminTokenServiceUrl=null,this.currentVersion=null,this.hasPortal=null,this.hasServer=null,this.owningSystemUrl=null,this.owningTenant=null,this.server=null,this.shortLivedTokenValidity=null,this.tokenServiceUrl=null,this.webTierAuth=null}};p([f({json:{write:!0}})],P.prototype,"adminTokenServiceUrl",void 0),p([f({json:{write:!0}})],P.prototype,"currentVersion",void 0),p([f({json:{write:!0}})],P.prototype,"hasPortal",void 0),p([f({json:{write:!0}})],P.prototype,"hasServer",void 0),p([f({json:{write:!0}})],P.prototype,"owningSystemUrl",void 0),p([f({json:{write:!0}})],P.prototype,"owningTenant",void 0),p([f({json:{write:!0}})],P.prototype,"server",void 0),p([f({json:{write:!0}})],P.prototype,"shortLivedTokenValidity",void 0),p([f({json:{write:!0}})],P.prototype,"tokenServiceUrl",void 0),p([f({json:{write:!0}})],P.prototype,"webTierAuth",void 0),P=p([F("esri.identity.ServerInfo")],P);const Q=P,M={},ce=c=>{const e=new D(c.owningSystemUrl).host,t=new D(c.server).host,s=/.+\.arcgis\.com$/i;return s.test(e)&&s.test(t)},ee=(c,e)=>!!(ce(c)&&e&&e.some(t=>t.test(c.server)));let z=null,B=null;try{z=window.localStorage,B=window.sessionStorage}catch{}class de extends he{constructor(){super(),this._portalConfig=globalThis.esriGeowConfig,this.serverInfos=[],this.oAuthInfos=[],this.credentials=[],this._soReqs=[],this._xoReqs=[],this._portals=[],this._defaultOAuthInfo=null,this._defaultTokenValidity=60,this.dialog=null,this.tokenValidity=null,this.normalizeWebTierAuth=!1,this._appOrigin=window.origin!=="null"?window.origin:window.location.origin,this._appUrlObj=H(window.location.href),this._busy=null,this._rejectOnPersistedPageShow=!1,this._oAuthLocationParams=null,this._gwTokenUrl="/sharing/rest/generateToken",this._agsRest="/rest/services",this._agsPortal=/\/sharing(\/|$)/i,this._agsAdmin=/(https?:\/\/[^\/]+\/[^\/]+)\/admin\/?(\/.*)?$/i,this._adminSvcs=/\/rest\/admin\/services(\/|$)/i,this._gwDomains=[{regex:/^https?:\/\/www\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:dev|[a-z\d-]+\.mapsdev)\.arcgis\.com/i,customBaseUrl:"mapsdev.arcgis.com",tokenServiceUrl:"https://dev.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:devext|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,customBaseUrl:"mapsdevext.arcgis.com",tokenServiceUrl:"https://devext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:qaext|[a-z\d-]+\.mapsqa)\.arcgis\.com/i,customBaseUrl:"mapsqa.arcgis.com",tokenServiceUrl:"https://qaext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/[a-z\d-]+\.maps\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"}],this._legacyFed=[],this._regexSDirUrl=/http.+\/rest\/services\/?/gi,this._regexServerType=/(\/(FeatureServer|GPServer|GeoDataServer|GeocodeServer|GeoenrichmentServer|GeometryServer|GlobeServer|ImageServer|KnowledgeGraphServer|MapServer|MissionServer|MobileServer|NAServer|NetworkDiagramServer|OGCFeatureServer|ParcelFabricServer|RelationalCatalogServer|SceneServer|StreamServer|UtilityNetworkServer|ValidationServer|VectorTileServer|VersionManagementServer|VideoServer)).*/gi,this._gwUser=/http.+\/users\/([^\/]+)\/?.*/i,this._gwItem=/http.+\/items\/([^\/]+)\/?.*/i,this._gwGroup=/http.+\/groups\/([^\/]+)\/?.*/i,this._rePortalTokenSvc=/\/sharing(\/rest)?\/generatetoken/i,this._createDefaultOAuthInfo=!0,this._hasTestedIfAppIsOnPortal=!1,this._getOAuthLocationParams(),window.addEventListener("pageshow",e=>{this._pageShowHandler(e)})}registerServers(e){const t=this.serverInfos;t?(e=e.filter(s=>!this.findServerInfo(s.server)),this.serverInfos=t.concat(e)):this.serverInfos=e,e.forEach(s=>{s.owningSystemUrl&&this._portals.push(s.owningSystemUrl),s.hasPortal&&this._portals.push(s.server)})}registerOAuthInfos(e){const t=this.oAuthInfos;if(t){for(const s of e){const i=this.findOAuthInfo(s.portalUrl);i&&t.splice(t.indexOf(i),1)}this.oAuthInfos=t.concat(e)}else this.oAuthInfos=e}registerToken(e){e={...e};const t=this._sanitizeUrl(e.server),s=this._isServerRsrc(t);let i,r=this.findServerInfo(t),n=!0;r||(r=new Q,r.server=this._getServerInstanceRoot(t),s?r.hasServer=!0:(r.tokenServiceUrl=this._getTokenSvcUrl(t),r.hasPortal=!0),this.registerServers([r])),i=this._findCredential(t),i?(delete e.server,Object.assign(i,e),n=!1):(i=new S({userId:e.userId,server:r.server,token:e.token,expires:e.expires,ssl:e.ssl,scope:s?"server":"portal"}),i.resources=[t],this.credentials.push(i)),i.emitTokenChange(!1),n||i.refreshServerTokens()}toJSON(){return le({serverInfos:this.serverInfos.map(e=>e.toJSON()),oAuthInfos:this.oAuthInfos.map(e=>e.toJSON()),credentials:this.credentials.map(e=>e.toJSON())})}initialize(e){if(!e)return;typeof e=="string"&&(e=JSON.parse(e));const t=e.serverInfos,s=e.oAuthInfos,i=e.credentials;if(t){const r=[];t.forEach(n=>{n.server&&n.tokenServiceUrl&&r.push(n.declaredClass?n:new Q(n))}),r.length&&this.registerServers(r)}if(s){const r=[];s.forEach(n=>{n.appId&&r.push(n.declaredClass?n:new oe(n))}),r.length&&this.registerOAuthInfos(r)}i&&i.forEach(r=>{r.server&&r.token&&r.expires&&r.expires>Date.now()&&((r=r.declaredClass?r:new S(r)).emitTokenChange(),this.credentials.push(r))})}findServerInfo(e){let t;e=this._sanitizeUrl(e);for(const s of this.serverInfos)if(this._hasSameServerInstance(s.server,e)){t=s;break}return t}findOAuthInfo(e){let t;e=this._sanitizeUrl(e);for(const s of this.oAuthInfos)if(this._hasSameServerInstance(s.portalUrl,e)){t=s;break}return t}findCredential(e,t){if(!e)return;let s;e=this._sanitizeUrl(e);const i=this._isServerRsrc(e)?"server":"portal";if(t){for(const r of this.credentials)if(this._hasSameServerInstance(r.server,e)&&t===r.userId&&r.scope===i){s=r;break}}else for(const r of this.credentials)if(this._hasSameServerInstance(r.server,e)&&this._getIdenticalSvcIdx(e,r)!==-1&&r.scope===i){s=r;break}return s}getCredential(e,t){let s,i,r=!0;t&&(s=!!t.token,i=t.error,r=t.prompt!==!1),t={...t},e=this._sanitizeUrl(e);const n=new AbortController,h=N();if(t.signal&&E(t.signal,()=>{n.abort()}),E(n,()=>{h.reject(new U("identity-manager:user-aborted","ABORTED"))}),me(n))return h.promise;t.signal=n.signal;const u=this._isAdminResource(e),o=s?this.findCredential(e):null;let l;if(o&&i&&i.details&&i.details.httpStatus===498)o.destroy();else if(o)return l=new U("identity-manager:not-authorized","You are currently signed in as: '"+o.userId+"'. You do not have access to this resource: "+e,{error:i}),h.reject(l),h.promise;const d=this._findCredential(e,t);if(d)return h.resolve(d),h.promise;let a=this.findServerInfo(e);if(a)!a.hasPortal&&a.server&&a.owningSystemUrl&&this._hasSameServerInstance(a.server,a.owningSystemUrl)&&(a.hasPortal=!0),!a.hasServer&&this._isServerRsrc(e)&&(a._restInfoPms=this._getTokenSvcUrl(e),a.hasServer=!0);else{const _=this._getTokenSvcUrl(e);if(!_)return l=new U("identity-manager:unknown-resource","Unknown resource - could not find token service endpoint."),h.reject(l),h.promise;a=new Q,a.server=this._getServerInstanceRoot(e),typeof _=="string"?(a.tokenServiceUrl=_,a.hasPortal=!0):(a._restInfoPms=_,a.hasServer=!0),this.registerServers([a])}return a.hasPortal&&a._selfReq===void 0&&(r||C(a.tokenServiceUrl,this._appOrigin)||this._gwDomains.some(_=>_.tokenServiceUrl===a.tokenServiceUrl))&&(a._selfReq={owningTenant:t==null?void 0:t.owningTenant,selfDfd:this._getPortalSelf(a.tokenServiceUrl.replace(this._rePortalTokenSvc,"/sharing/rest/portals/self"),e)}),this._enqueue(e,a,t,h,u)}getResourceName(e){return this._isRESTService(e)?e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"")||"":this._gwUser.test(e)&&e.replace(this._gwUser,"$1")||this._gwItem.test(e)&&e.replace(this._gwItem,"$1")||this._gwGroup.test(e)&&e.replace(this._gwGroup,"$1")||""}generateToken(e,t,s){const i=this._rePortalTokenSvc.test(e.tokenServiceUrl),r=new D(this._appOrigin),n=e.shortLivedTokenValidity;let h,u,o,l,d,a,_,w;t&&(w=this.tokenValidity||n||this._defaultTokenValidity,w>n&&n>0&&(w=n)),s&&(h=s.isAdmin,u=s.serverUrl,o=s.token,a=s.signal,_=s.ssl,e.customParameters=s.customParameters),h?l=e.adminTokenServiceUrl:(l=e.tokenServiceUrl,d=new D(l.toLowerCase()),e.webTierAuth&&(s!=null&&s.serverUrl)&&!_&&r.scheme==="http"&&(C(r.uri,l,!0)||d.scheme==="https"&&r.host===d.host&&r.port==="7080"&&d.port==="7443")&&(l=l.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const g={query:{request:"getToken",username:t==null?void 0:t.username,password:t==null?void 0:t.password,serverUrl:u,token:o,expiration:w,referer:h||i?this._appOrigin:null,client:h?"referer":null,f:"json",...e.customParameters},method:"post",authMode:"anonymous",useProxy:this._useProxy(e,s),signal:a,...s==null?void 0:s.ioArgs};return i||(g.withCredentials=!1),R(l,g).then(I=>{const m=I.data;if(!(m!=null&&m.token))return new U("identity-manager:authentication-failed","Unable to generate token");const b=e.server;return M[b]||(M[b]={}),t&&(M[b][t.username]=t.password),m.validity=w,m})}isBusy(){return!!this._busy}checkSignInStatus(e){return this.checkAppAccess(e,"").then(t=>t.credential)}checkAppAccess(e,t,s){let i=!1;return this.getCredential(e,{prompt:!1}).then(r=>{let n;const h={f:"json"};if(r.scope==="portal")if(t&&(this._doPortalSignIn(e)||s!=null&&s.force))n=r.server+"/sharing/rest/oauth2/validateAppAccess",h.client_id=t;else{if(!r.token)return{credential:r};n=r.server+"/sharing/rest"}else{if(!r.token)return{credential:r};n=r.server+"/rest/services"}return r.token&&(h.token=r.token),R(n,{query:h,authMode:"anonymous"}).then(u=>{if(u.data.valid===!1)throw new U("identity-manager:not-authorized",`You are currently signed in as: '${r.userId}'.`,u.data);return i=!!u.data.viewOnlyUserTypeApp,{credential:r}}).catch(u=>{var l;if(u.name==="identity-manager:not-authorized")throw u;const o=(l=u.details)==null?void 0:l.httpStatus;if(o===498)throw r.destroy(),new U("identity-manager:not-authenticated","User is not signed in.");if(o===400)throw new U("identity-manager:invalid-request");return{credential:r}})}).then(r=>({credential:r.credential,viewOnly:i}))}setOAuthResponseHash(e){e&&(e.charAt(0)==="#"&&(e=e.substring(1)),this._processOAuthPopupParams(L(e)))}setOAuthRedirectionHandler(e){this._oAuthRedirectFunc=e}setProtocolErrorHandler(e){this._protocolFunc=e}signIn(e,t,s={}){const i=N(),r=()=>{var l;u==null||u.remove(),o==null||o.remove(),(l=this.dialog)==null||l.destroy(),this.dialog=u=o=null},n=()=>{r(),this._oAuthDfd=null,i.reject(new U("identity-manager:user-aborted","ABORTED"))};s.signal&&E(s.signal,()=>{n()});const h=new ne({open:!0,resource:this.getResourceName(e),server:t.server});this.dialog=h,this.emit("dialog-create");let u=h.on("cancel",n),o=h.on("submit",l=>{this.generateToken(t,l,{isAdmin:s.isAdmin,signal:s.signal}).then(d=>{r();const a=new S({userId:l.username,server:t.server,token:d.token,expires:d.expires!=null?Number(d.expires):null,ssl:!!d.ssl,isAdmin:s.isAdmin,validity:d.validity});i.resolve(a)}).catch(d=>{h.error=d,h.signingIn=!1})});return i.promise}oAuthSignIn(e,t,s,i){this._oAuthDfd=N();const r=this._oAuthDfd;let n;i!=null&&i.signal&&E(i.signal,()=>{const a=this._oAuthDfd&&this._oAuthDfd.oAuthWin_;a&&!a.closed?a.close():this.dialog&&l()}),r.resUrl_=e,r.sinfo_=t,r.oinfo_=s;const h=s._oAuthCred;if(h.storage&&(s.flowType==="authorization-code"||s.flowType==="auto"&&t.currentVersion>=8.4)){let a=crypto.getRandomValues(new Uint8Array(32));n=J(a),h.codeVerifier=n,a=crypto.getRandomValues(new Uint8Array(32)),h.stateUID=J(a),h.save()||(h.codeVerifier=n=null)}else h.codeVerifier=null;let u,o;this._getCodeChallenge(n).then(a=>{const _=!i||i.oAuthPopupConfirmation!==!1;if(!s.popup||!_)return void this._doOAuthSignIn(e,t,s,a);const w=new ne({oAuthPrompt:!0,server:t.server,open:!0});this.dialog=w,this.emit("dialog-create"),u=w.on("cancel",l),o=w.on("submit",()=>{d(),this._doOAuthSignIn(e,t,s,a)})});const l=()=>{d(),this._oAuthDfd=null,r.reject(new U("identity-manager:user-aborted","ABORTED"))},d=()=>{var a;u==null||u.remove(),o==null||o.remove(),(a=this.dialog)==null||a.destroy(),this.dialog=null};return r.promise}destroyCredentials(){this.credentials&&this.credentials.slice().forEach(e=>{e.destroy()}),this.emit("credentials-destroy")}enablePostMessageAuth(e="https://www.arcgis.com/sharing/rest"){this._postMessageAuthHandle&&this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=G(window,"message",t=>{var s;if((t.origin===this._appOrigin||t.origin.endsWith(".arcgis.com"))&&((s=t.data)==null?void 0:s.type)==="arcgis:auth:requestCredential"){const i=t.source;this.getCredential(e).then(r=>{i.postMessage({type:"arcgis:auth:credential",credential:{expires:r.expires,server:r.server,ssl:r.ssl,token:r.token,userId:r.userId}},t.origin)}).catch(r=>{i.postMessage({type:"arcgis:auth:error",error:{name:r.name,message:r.message}},t.origin)})}})}disablePostMessageAuth(){this._postMessageAuthHandle&&(this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=null)}_getOAuthLocationParams(){var s,i;let e=window.location.hash;if(e){e.charAt(0)==="#"&&(e=e.substring(1));const r=L(e);let n=!1;if(r.access_token&&r.expires_in&&r.state&&r.hasOwnProperty("username"))try{r.state=JSON.parse(r.state),r.state.portalUrl&&(this._oAuthLocationParams=r,n=!0)}catch{}else if(r.error&&r.error_description&&(console.log("IdentityManager OAuth Error: ",r.error," - ",r.error_description),r.error==="access_denied"&&(n=!0,r.state)))try{r.state=JSON.parse(r.state)}catch{}n&&(window.location.hash=((s=r.state)==null?void 0:s.hash)||"")}let t=window.location.search;if(t){t.charAt(0)==="?"&&(t=t.substring(1));const r=L(t);let n=!1;if(r.code&&r.state)try{r.state=JSON.parse(r.state),r.state.portalUrl&&r.state.uid&&(this._oAuthLocationParams=r,n=!0)}catch{}else if(r.error&&r.error_description&&(console.log("IdentityManager OAuth Error: ",r.error," - ",r.error_description),r.error==="access_denied"&&(n=!0,r.state)))try{r.state=JSON.parse(r.state)}catch{}if(n){const h={...r};["code","error","error_description","message_code","persist","state"].forEach(l=>{delete h[l]});const u=re(h),o=window.location.pathname+(u?`?${u}`:"")+(((i=r.state)==null?void 0:i.hash)||"");window.history.replaceState(window.history.state,"",o)}}}_getOAuthToken(e,t,s,i,r){return e=e.replace(/^http:/i,"https:"),R(`${e}/sharing/rest/oauth2/token`,{authMode:"anonymous",method:"post",query:i&&r?{grant_type:"authorization_code",code:t,redirect_uri:i,client_id:s,code_verifier:r}:{grant_type:"refresh_token",refresh_token:t,client_id:s}}).then(n=>n.data)}_getCodeChallenge(e){if(e&&globalThis.isSecureContext){const t=new TextEncoder().encode(e);return crypto.subtle.digest("SHA-256",t).then(s=>J(new Uint8Array(s)))}return Promise.resolve(null)}_pageShowHandler(e){if(e.persisted&&this.isBusy()&&this._rejectOnPersistedPageShow){const t=new U("identity-manager:user-aborted","ABORTED");this._errbackFunc(t)}}_findCredential(e,t){let s,i,r,n,h=-1;const u=t==null?void 0:t.token,o=t==null?void 0:t.resource,l=this._isServerRsrc(e)?"server":"portal",d=this.credentials.filter(a=>this._hasSameServerInstance(a.server,e)&&a.scope===l);if(e=o||e,d.length)if(d.length===1){if(s=d[0],r=this.findServerInfo(s.server),i=r==null?void 0:r.owningSystemUrl,n=i?this.findCredential(i,s.userId):void 0,h=this._getIdenticalSvcIdx(e,s),!u)return h===-1&&s.resources.push(e),this._addResource(e,n),s;h!==-1&&(s.resources.splice(h,1),this._removeResource(e,n))}else{let a,_;if(d.some(w=>(_=this._getIdenticalSvcIdx(e,w),_!==-1&&(a=w,r=this.findServerInfo(a.server),i=r==null?void 0:r.owningSystemUrl,n=i?this.findCredential(i,a.userId):void 0,h=_,!0))),u)a&&(a.resources.splice(h,1),this._removeResource(e,n));else if(a)return this._addResource(e,n),a}}_findOAuthInfo(e){let t=this.findOAuthInfo(e);if(!t){for(const s of this.oAuthInfos)if(this._isIdProvider(s.portalUrl,e)){t=s;break}}return t}_addResource(e,t){t&&this._getIdenticalSvcIdx(e,t)===-1&&t.resources.push(e)}_removeResource(e,t){let s=-1;t&&(s=this._getIdenticalSvcIdx(e,t),s>-1&&t.resources.splice(s,1))}_useProxy(e,t){return(t==null?void 0:t.isAdmin)&&!C(e.adminTokenServiceUrl,this._appOrigin)||!this._isPortalDomain(e.tokenServiceUrl)&&String(e.currentVersion)==="10.1"&&!C(e.tokenServiceUrl,this._appOrigin)}_getOrigin(e){const t=new D(e);return t.scheme+"://"+t.host+(t.port!=null?":"+t.port:"")}_getServerInstanceRoot(e){const t=e.toLowerCase();let s=t.indexOf(this._agsRest);return s===-1&&this._isAdminResource(e)&&(s=this._agsAdmin.test(e)?e.replace(this._agsAdmin,"$1").length:e.search(this._adminSvcs)),s!==-1||ve(t)||(s=t.indexOf("/sharing")),s===-1&&t.substr(-1)==="/"&&(s=t.length-1),s>-1?e.substring(0,s):e}_hasSameServerInstance(e,t){return e.substr(-1)==="/"&&(e=e.slice(0,-1)),e=e.toLowerCase(),t=this._getServerInstanceRoot(t).toLowerCase(),e=this._normalizeAGOLorgDomain(e),t=this._normalizeAGOLorgDomain(t),(e=e.substr(e.indexOf(":")))===(t=t.substr(t.indexOf(":")))}_normalizeAGOLorgDomain(e){const t=/^https?:\/\/(?:cdn|[a-z\d-]+\.maps)\.arcgis\.com/i,s=/^https?:\/\/(?:cdndev|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,i=/^https?:\/\/(?:cdnqa|[a-z\d-]+\.mapsqa)\.arcgis\.com/i;return t.test(e)?e=e.replace(t,"https://www.arcgis.com"):s.test(e)?e=e.replace(s,"https://devext.arcgis.com"):i.test(e)&&(e=e.replace(i,"https://qaext.arcgis.com")),e}_sanitizeUrl(e){const t=(W.request.proxyUrl||"").toLowerCase(),s=t?e.toLowerCase().indexOf(t+"?"):-1;return s!==-1&&(e=e.substring(s+t.length+1)),e=Ie(e),H(e).path}_isRESTService(e){return e.includes(this._agsRest)}_isAdminResource(e){return this._agsAdmin.test(e)||this._adminSvcs.test(e)}_isServerRsrc(e){return this._isRESTService(e)||this._isAdminResource(e)}_isIdenticalService(e,t){let s=!1;if(this._isRESTService(e)&&this._isRESTService(t)){const i=this._getSuffix(e).toLowerCase(),r=this._getSuffix(t).toLowerCase();if(s=i===r,!s){const n=/(.*)\/(MapServer|FeatureServer|UtilityNetworkServer).*/gi;s=i.replaceAll(n,"$1")===r.replaceAll(n,"$1")}}else this._isAdminResource(e)&&this._isAdminResource(t)?s=!0:this._isServerRsrc(e)||this._isServerRsrc(t)||!this._isPortalDomain(e)||(s=!0);return s}_isPortalDomain(e){const t=new D(e.toLowerCase()),s=this._portalConfig;let i=this._gwDomains.some(r=>r.regex.test(t.uri));return!i&&s&&(i=this._hasSameServerInstance(this._getServerInstanceRoot(s.restBaseUrl),t.uri)),i||W.portalUrl&&(i=C(t,W.portalUrl,!0)),i||(i=this._portals.some(r=>this._hasSameServerInstance(r,t.uri))),i=i||this._agsPortal.test(t.path),i}_isIdProvider(e,t){let s=-1,i=-1;this._gwDomains.forEach((n,h)=>{s===-1&&n.regex.test(e)&&(s=h),i===-1&&n.regex.test(t)&&(i=h)});let r=!1;if(s>-1&&i>-1&&(s===0||s===4?i!==0&&i!==4||(r=!0):s===1?i!==1&&i!==2||(r=!0):s===2?i===2&&(r=!0):s===3&&i===3&&(r=!0)),!r){const n=this.findServerInfo(t),h=n==null?void 0:n.owningSystemUrl;h&&ce(n)&&this._isPortalDomain(h)&&this._isIdProvider(e,h)&&(r=!0)}return r}_getIdenticalSvcIdx(e,t){let s=-1;for(let i=0;in.data),{adminUrl:t,promise:s}}if(this._isPortalDomain(e)){let r="";if(this._gwDomains.some(n=>(n.regex.test(e)&&(r=n.tokenServiceUrl),!!r)),r||this._portals.some(n=>(this._hasSameServerInstance(n,e)&&(r=n+this._gwTokenUrl),!!r)),r||(i=e.toLowerCase().indexOf("/sharing"),i!==-1&&(r=e.substring(0,i)+this._gwTokenUrl)),r||(r=this._getOrigin(e)+this._gwTokenUrl),r){const n=new D(e).port;/^http:\/\//i.test(e)&&n==="7080"&&(r=r.replace(/:7080/i,":7443")),r=r.replace(/http:/i,"https:")}return r}if(e.toLowerCase().includes("premium.arcgisonline.com"))return"https://premium.arcgisonline.com/server/tokens"}_processOAuthResponseParams(e,t,s){const i=t._oAuthCred;if(e.code){const n=i.codeVerifier;return i.codeVerifier=null,i.stateUID=null,i.save(),this._getOAuthToken(s.server,e.code,t.appId,this._getRedirectURI(t,!0),n).then(h=>{const u=new S({userId:h.username,server:s.server,token:h.access_token,expires:Date.now()+1e3*h.expires_in,ssl:h.ssl,oAuthState:e.state,_oAuthCred:i});return t.userId=u.userId,i.storage=h.persist?z:B,i.refreshToken=h.refresh_token,i.token=null,i.expires=h.refresh_token_expires_in?Date.now()+1e3*h.refresh_token_expires_in:null,i.userId=u.userId,i.ssl=u.ssl,i.save(),u})}const r=new S({userId:e.username,server:s.server,token:e.access_token,expires:Date.now()+1e3*Number(e.expires_in),ssl:e.ssl==="true",oAuthState:e.state,_oAuthCred:i});return t.userId=r.userId,i.storage=e.persist?z:B,i.refreshToken=null,i.token=r.token,i.expires=r.expires,i.userId=r.userId,i.ssl=r.ssl,i.save(),Promise.resolve(r)}_processOAuthPopupParams(e){var s;const t=this._oAuthDfd;if(this._oAuthDfd=null,t)if(clearInterval(this._oAuthIntervalId),(s=this._oAuthOnPopupHandle)==null||s.remove(),e.error){const i=e.error==="access_denied",r=new U(i?"identity-manager:user-aborted":"identity-manager:authentication-failed",i?"ABORTED":"OAuth: "+e.error+" - "+e.error_description);t.reject(r)}else this._processOAuthResponseParams(e,t.oinfo_,t.sinfo_).then(i=>{t.resolve(i)}).catch(i=>{t.reject(i)})}_setOAuthResponseQueryString(e){e&&(e.charAt(0)==="?"&&(e=e.substring(1)),this._processOAuthPopupParams(L(e)))}_exchangeToken(e,t,s){return R(`${e}/sharing/rest/oauth2/exchangeToken`,{authMode:"anonymous",method:"post",query:{f:"json",client_id:t,token:s}}).then(i=>i.data.token)}_getPlatformSelf(e,t){return e=e.replace(/^http:/i,"https:"),R(`${e}/sharing/rest/oauth2/platformSelf`,{authMode:"anonymous",headers:{"X-Esri-Auth-Client-Id":t,"X-Esri-Auth-Redirect-Uri":window.location.href.replace(/#.*$/,"")},method:"post",query:{f:"json",expiration:30},withCredentials:!0}).then(s=>s.data)}_getPortalSelf(e,t){let s;return this._gwDomains.some(i=>(i.regex.test(e)&&(s=i.customBaseUrl),!!s)),s?Promise.resolve({allSSL:!0,currentVersion:"8.4",customBaseUrl:s,portalMode:"multitenant",supportsOAuth:!0}):(this._appOrigin.startsWith("https:")?e=e.replace(/^http:/i,"https:").replace(/:7080/i,":7443"):/^http:/i.test(t)&&(e=e.replace(/^https:/i,"http:").replace(/:7443/i,":7080")),R(e,{query:{f:"json"},authMode:"anonymous",withCredentials:!0}).then(i=>i.data))}_doPortalSignIn(e){const t=this._portalConfig,s=window.location.href,i=this.findServerInfo(e);return!(!t&&!this._isPortalDomain(s)||!(i?i.hasPortal||i.owningSystemUrl&&this._isPortalDomain(i.owningSystemUrl):this._isPortalDomain(e))||!(this._isIdProvider(s,e)||t&&(this._hasSameServerInstance(this._getServerInstanceRoot(t.restBaseUrl),e)||this._isIdProvider(t.restBaseUrl,e))||C(s,e,!0)))}_checkProtocol(e,t,s,i){let r=!0;const n=i?t.adminTokenServiceUrl:t.tokenServiceUrl;return n.trim().toLowerCase().startsWith("https:")&&!this._appOrigin.startsWith("https:")&&we(n)&&(r=!!this._protocolFunc&&!!this._protocolFunc({resourceUrl:e,serverInfo:t}),!r)&&s(new U("identity-manager:aborted","Aborted the Sign-In process to avoid sending password over insecure connection.")),r}_enqueue(e,t,s,i,r,n){return i||(i=N()),i.resUrl_=e,i.sinfo_=t,i.options_=s,i.admin_=r,i.refresh_=n,this._busy?this._hasSameServerInstance(this._getServerInstanceRoot(e),this._busy.resUrl_)?(this._oAuthDfd&&this._oAuthDfd.oAuthWin_&&this._oAuthDfd.oAuthWin_.focus(),this._soReqs.push(i)):this._xoReqs.push(i):this._doSignIn(i),i.promise}_doSignIn(e){this._busy=e,this._rejectOnPersistedPageShow=!1;const t=o=>{var I;const l=(I=e.options_)==null?void 0:I.resource,d=e.resUrl_,a=e.refresh_;let _=!1;this.credentials.includes(o)||(a&&this.credentials.includes(a)?(a.userId=o.userId,a.token=o.token,a.expires=o.expires,a.validity=o.validity,a.ssl=o.ssl,a.creationTime=o.creationTime,_=!0,o=a):this.credentials.push(o)),o.resources||(o.resources=[]),o.resources.includes(l||d)||o.resources.push(l||d),o.scope=this._isServerRsrc(d)?"server":"portal",o.emitTokenChange();const w=this._soReqs,g={};this._soReqs=[],w.forEach(m=>{if(!this._isIdenticalService(d,m.resUrl_)){const b=this._getSuffix(m.resUrl_);g[b]||(g[b]=!0,o.resources.push(m.resUrl_))}}),e.resolve(o),w.forEach(m=>{this._hasSameServerInstance(this._getServerInstanceRoot(d),m.resUrl_)?m.resolve(o):this._soReqs.push(m)}),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,_||this.emit("credential-create",{credential:o}),this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},s=o=>{e.reject(o),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},i=(o,l,d,a)=>{var b,q,te;const _=e.sinfo_,w=!e.options_||e.options_.prompt!==!1,g=_.hasPortal&&this._findOAuthInfo(e.resUrl_);let I,m;if(o)t(new S({userId:o,server:_.server,token:d||null,expires:a!=null?Number(a):null,ssl:!!l}));else if(window!==window.parent&&((b=this._appUrlObj.query)!=null&&b["arcgis-auth-origin"])&&((q=this._appUrlObj.query)!=null&&q["arcgis-auth-portal"])&&this._hasSameServerInstance(this._getServerInstanceRoot(this._appUrlObj.query["arcgis-auth-portal"]),e.resUrl_)){window.parent.postMessage({type:"arcgis:auth:requestCredential"},this._appUrlObj.query["arcgis-auth-origin"]);const v=G(window,"message",y=>{y.source===window.parent&&y.data&&(y.data.type==="arcgis:auth:credential"?(v.remove(),y.data.credential.expires{v.remove()})}else if(g){let v=g._oAuthCred;if(!v){const y=new Z(g,z),k=new Z(g,B);y.isValid()&&k.isValid()?y.expires>k.expires?(v=y,k.destroy()):(v=k,y.destroy()):v=y.isValid()?y:k,g._oAuthCred=v}if(v.isValid()){I=new S({userId:v.userId,server:_.server,token:v.token,expires:v.expires,ssl:v.ssl,_oAuthCred:v});const y=g.appId!==v.appId&&this._doPortalSignIn(e.resUrl_);y||v.refreshToken?(e._pendingDfd=v.refreshToken?this._getOAuthToken(_.server,v.refreshToken,v.appId).then(k=>(I.expires=Date.now()+1e3*k.expires_in,I.token=k.access_token,I)):Promise.resolve(I),e._pendingDfd.then(k=>y?this._exchangeToken(k.server,g.appId,k.token).then(pe=>(k.token=pe,k)).catch(()=>k):k).then(k=>{t(k)}).catch(()=>{v==null||v.destroy(),i()})):t(I)}else if(this._oAuthLocationParams&&this._hasSameServerInstance(g.portalUrl,this._oAuthLocationParams.state.portalUrl)&&(this._oAuthLocationParams.access_token||this._oAuthLocationParams.code&&this._oAuthLocationParams.state.uid===v.stateUID&&v.codeVerifier)){const y=this._oAuthLocationParams;this._oAuthLocationParams=null,e._pendingDfd=this._processOAuthResponseParams(y,g,_).then(k=>{t(k)}).catch(s)}else{const y=()=>{w?e._pendingDfd=this.oAuthSignIn(e.resUrl_,_,g,e.options_).then(t,s):(m=new U("identity-manager:not-authenticated","User is not signed in."),s(m))};this._doPortalSignIn(e.resUrl_)?e._pendingDfd=this._getPlatformSelf(_.server,g.appId).then(k=>{C(k.portalUrl,this._appOrigin,!0)?(I=new S({userId:k.username,server:_.server,expires:Date.now()+1e3*k.expires_in,token:k.token}),t(I)):y()}).catch(y):y()}}else if(w){if(this._checkProtocol(e.resUrl_,_,s,e.admin_)){let v=e.options_;e.admin_&&(v=v||{},v.isAdmin=!0),e._pendingDfd=this.signIn(e.resUrl_,_,v).then(t,s)}}else m=new U("identity-manager:not-authenticated","User is not signed in."),s(m)},r=()=>{const o=e.sinfo_,l=o.owningSystemUrl,d=e.options_;let a,_,w,g;if(d&&(a=d.token,_=d.error,w=d.prompt),g=this._findCredential(l,{token:a,resource:e.resUrl_}),!g){for(const I of this.credentials)if(this._isIdProvider(l,I.server)){g=I;break}}if(g){const I=this.findCredential(e.resUrl_,g.userId);if(I)t(I);else if(ee(o,this._legacyFed)){const m=g.toJSON();m.server=o.server,m.resources=null,t(new S(m))}else(e._pendingDfd=this.generateToken(this.findServerInfo(g.server),null,{serverUrl:e.resUrl_,token:g.token,signal:e.options_.signal,ssl:g.ssl})).then(m=>{t(new S({userId:g==null?void 0:g.userId,server:o.server,token:m.token,expires:m.expires!=null?Number(m.expires):null,ssl:!!m.ssl,isAdmin:e.admin_,validity:m.validity}))},s)}else this._busy=null,a&&(e.options_.token=null),(e._pendingDfd=this.getCredential(l.replace(/\/?$/,"/sharing"),{resource:e.resUrl_,owningTenant:o.owningTenant,signal:e.options_.signal,token:a,error:_,prompt:w})).then(()=>{this._enqueue(e.resUrl_,e.sinfo_,e.options_,e,e.admin_)},I=>{e.resUrl_=e.sinfo_=e.refresh_=null,e.reject(I)})};this._errbackFunc=s;const n=e.sinfo_.owningSystemUrl,h=this._isServerRsrc(e.resUrl_),u=e.sinfo_._restInfoPms;u?u.promise.then(o=>{const l=e.sinfo_;if(l._restInfoPms){l.adminTokenServiceUrl=l._restInfoPms.adminUrl,l._restInfoPms=null,l.tokenServiceUrl=(V("authInfo.tokenServicesUrl",o)||V("authInfo.tokenServiceUrl",o)||V("tokenServiceUrl",o))??null,l.shortLivedTokenValidity=V("authInfo.shortLivedTokenValidity",o)??null,l.currentVersion=o.currentVersion,l.owningTenant=o.owningTenant;const d=l.owningSystemUrl=o.owningSystemUrl;d&&this._portals.push(d)}h&&l.owningSystemUrl?r():i()},()=>{e.sinfo_._restInfoPms=null;const o=new U("identity-manager:server-identification-failed","Unknown resource - could not find token service endpoint.");s(o)}):h&&n?r():e.sinfo_._selfReq?e.sinfo_._selfReq.selfDfd.then(o=>{var g;const l={};let d,a,_,w;return o&&(d=(g=o.user)==null?void 0:g.username,l.username=d,l.allSSL=o.allSSL,a=o.supportsOAuth,w=parseFloat(o.currentVersion),o.portalMode==="multitenant"&&(_=o.customBaseUrl),e.sinfo_.currentVersion=w),e.sinfo_.webTierAuth=!!d,d&&this.normalizeWebTierAuth?this.generateToken(e.sinfo_,null,{ssl:l.allSSL}).catch(()=>null).then(I=>(l.portalToken=I&&I.token,l.tokenExpiration=I&&I.expires,l)):!d&&a&&w>=4.4&&!this._findOAuthInfo(e.resUrl_)?this._generateOAuthInfo({portalUrl:e.sinfo_.server,customBaseUrl:_,owningTenant:e.sinfo_._selfReq.owningTenant}).catch(()=>null).then(()=>l):l}).catch(()=>null).then(o=>{e.sinfo_._selfReq=null,o?i(o.username,o.allSSL,o.portalToken,o.tokenExpiration):i()}):i()}_generateOAuthInfo(e){let t,s=null,i=e.portalUrl;const r=e.customBaseUrl,n=e.owningTenant,h=!this._defaultOAuthInfo&&this._createDefaultOAuthInfo&&!this._hasTestedIfAppIsOnPortal;if(h){s=window.location.href;let u=s.indexOf("?");u>-1&&(s=s.slice(0,u)),u=s.search(/\/(apps|home)\//),s=u>-1?s.slice(0,u):null}return h&&s?(this._hasTestedIfAppIsOnPortal=!0,t=R(s+"/sharing/rest",{query:{f:"json"}}).then(()=>{this._defaultOAuthInfo=new oe({appId:"arcgisonline",popupCallbackUrl:s+"/home/oauth-callback.html"})})):t=Promise.resolve(),t.then(()=>{if(this._defaultOAuthInfo)return i=i.replace(/^http:/i,"https:"),R(i+"/sharing/rest/oauth2/validateRedirectUri",{query:{accountId:n,client_id:this._defaultOAuthInfo.appId,redirect_uri:ie(this._defaultOAuthInfo.popupCallbackUrl),f:"json"}}).then(u=>{if(u.data.valid){const o=this._defaultOAuthInfo.clone();u.data.urlKey&&r?o.portalUrl="https://"+u.data.urlKey.toLowerCase()+"."+r:o.portalUrl=i,o.popup=window!==window.top||!(C(i,this._appOrigin)||this._gwDomains.some(l=>l.regex.test(i)&&l.regex.test(this._appOrigin))),this.oAuthInfos.push(o)}})})}_doOAuthSignIn(e,t,s,i){const r=s._oAuthCred,n={portalUrl:s.portalUrl};!s.popup&&s.preserveUrlHash&&window.location.hash&&(n.hash=window.location.hash),r.stateUID&&(n.uid=r.stateUID);const h={client_id:s.appId,response_type:r.codeVerifier?"code":"token",state:JSON.stringify(n),expiration:s.expiration,locale:s.locale,redirect_uri:this._getRedirectURI(s,!!r.codeVerifier)};s.forceLogin&&(h.force_login=!0),s.forceUserId&&s.userId&&(h.prepopulatedusername=s.userId),!s.popup&&this._doPortalSignIn(e)&&(h.redirectToUserOrgUrl=!0),r.codeVerifier&&(h.code_challenge=i||r.codeVerifier,h.code_challenge_method=i?"S256":"plain");const u=s.portalUrl.replace(/^http:/i,"https:")+"/sharing/oauth2/authorize",o=u+"?"+re(h);if(s.popup){const l=window.open(o,"esriJSAPIOAuth",s.popupWindowFeatures);if(l)l.focus(),this._oAuthDfd.oAuthWin_=l,this._oAuthIntervalId=setInterval(()=>{if(l.closed){clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle.remove();const d=this._oAuthDfd;if(d){const a=new U("identity-manager:user-aborted","ABORTED");d.reject(a)}}},500),this._oAuthOnPopupHandle=G(window,["arcgis:auth:hash","arcgis:auth:location:search"],d=>{d.type==="arcgis:auth:hash"?this.setOAuthResponseHash(d.detail):this._setOAuthResponseQueryString(d.detail)});else{const d=new U("identity-manager:popup-blocked","ABORTED");this._oAuthDfd.reject(d)}}else this._rejectOnPersistedPageShow=!0,this._oAuthRedirectFunc?this._oAuthRedirectFunc({authorizeParams:h,authorizeUrl:u,resourceUrl:e,serverInfo:t,oAuthInfo:s}):window.location.href=o}_getRedirectURI(e,t){const s=window.location.href.replace(/#.*$/,"");if(e.popup)return ie(e.popupCallbackUrl);if(t){const i=H(s);return i.query&&["code","error","error_description","message_code","persist","state"].forEach(r=>{delete i.query[r]}),Se(i.path,i.query)}return s}}de.prototype.declaredClass="esri.identity.IdentityManagerBase";let S=class extends he.EventedAccessor{constructor(c){super(c),this._oAuthCred=null,this.tokenRefreshBuffer=2,c!=null&&c._oAuthCred&&(this._oAuthCred=c._oAuthCred)}initialize(){this.resources=this.resources||[],this.creationTime==null&&(this.creationTime=Date.now())}refreshToken(){const c=A.findServerInfo(this.server),e=c==null?void 0:c.owningSystemUrl,t=!!e&&this.scope==="server",s=t&&ee(c,A._legacyFed),i=c.webTierAuth,r=i&&A.normalizeWebTierAuth,n=M[this.server],h=n==null?void 0:n[this.userId];let u,o=this.resources&&this.resources[0],l=t?A.findServerInfo(e):null,d={username:this.userId,password:h};if(i&&!r)return;t&&!l&&A.serverInfos.some(_=>(A._isIdProvider(e,_.server)&&(l=_),!!l));const a=l?A.findCredential(l.server,this.userId):null;if(!t||a){if(!s){if(t)u={serverUrl:o,token:a==null?void 0:a.token,ssl:a&&a.ssl};else if(r)d=null,u={ssl:this.ssl};else{if(!h){let _;return o&&(o=A._sanitizeUrl(o),this._enqueued=1,_=A._enqueue(o,c,null,null,this.isAdmin,this),_.then(()=>{this._enqueued=0,this.refreshServerTokens()}).catch(()=>{this._enqueued=0})),_}this.isAdmin&&(u={isAdmin:!0})}return A.generateToken(t?l:c,t?null:d,u).then(_=>{this.token=_.token,this.expires=_.expires!=null?Number(_.expires):null,this.creationTime=Date.now(),this.validity=_.validity,this.emitTokenChange(),this.refreshServerTokens()}).catch(()=>{})}a==null||a.refreshToken()}}refreshServerTokens(){this.scope==="portal"&&A.credentials.forEach(c=>{const e=A.findServerInfo(c.server),t=e==null?void 0:e.owningSystemUrl;c!==this&&c.userId===this.userId&&t&&c.scope==="server"&&(A._hasSameServerInstance(this.server,t)||A._isIdProvider(t,this.server))&&(ee(e,A._legacyFed)?(c.token=this.token,c.expires=this.expires,c.creationTime=this.creationTime,c.validity=this.validity,c.emitTokenChange()):c.refreshToken())})}emitTokenChange(c){clearTimeout(this._refreshTimer);const e=this.server?A.findServerInfo(this.server):null,t=e==null?void 0:e.owningSystemUrl,s=t?A.findServerInfo(t):null;c===!1||t&&this.scope!=="portal"&&(!(s!=null&&s.webTierAuth)||A.normalizeWebTierAuth)||this.expires==null&&this.validity==null||this._startRefreshTimer(),this.emit("token-change")}destroy(){this.userId=this.server=this.token=this.expires=this.validity=this.resources=this.creationTime=null,this._oAuthCred&&(this._oAuthCred.destroy(),this._oAuthCred=null);const c=A.credentials.indexOf(this);c>-1&&A.credentials.splice(c,1),this.emitTokenChange(),this.emit("destroy")}toJSON(){const c=le({userId:this.userId,server:this.server,token:this.token,expires:this.expires,validity:this.validity,ssl:this.ssl,isAdmin:this.isAdmin,creationTime:this.creationTime,scope:this.scope}),e=this.resources;return e&&e.length>0&&(c.resources=e.slice()),c}_startRefreshTimer(){clearTimeout(this._refreshTimer);const c=6e4*this.tokenRefreshBuffer,e=2**31-1;let t=(this.validity?this.creationTime+6e4*this.validity:this.expires)-Date.now();t<0?t=0:t>e&&(t=e),this._refreshTimer=setTimeout(this.refreshToken.bind(this),t>c?t-c:t)}};p([f()],S.prototype,"creationTime",void 0),p([f()],S.prototype,"expires",void 0),p([f()],S.prototype,"isAdmin",void 0),p([f()],S.prototype,"oAuthState",void 0),p([f()],S.prototype,"resources",void 0),p([f()],S.prototype,"scope",void 0),p([f()],S.prototype,"server",void 0),p([f()],S.prototype,"ssl",void 0),p([f()],S.prototype,"token",void 0),p([f()],S.prototype,"tokenRefreshBuffer",void 0),p([f()],S.prototype,"userId",void 0),p([f()],S.prototype,"validity",void 0),S=p([F("esri.identity.Credential")],S);class ue extends de{}ue.prototype.declaredClass="esri.identity.IdentityManager";const Ue=new ue;ye(Ue);export{Ue as default}; diff --git a/assets/ImageHistogramParameters-CsWWZYhj.js b/assets/ImageHistogramParameters-DYfx5K-s.js similarity index 98% rename from assets/ImageHistogramParameters-CsWWZYhj.js rename to assets/ImageHistogramParameters-DYfx5K-s.js index 706ce05..4c85600 100644 --- a/assets/ImageHistogramParameters-CsWWZYhj.js +++ b/assets/ImageHistogramParameters-DYfx5K-s.js @@ -1 +1 @@ -import{aY as ge,a9 as h,d as n,y as o,f0 as fe,c9 as W,f as v,aU as S,dS as P,aZ as z,aV as b,aR as me,aA as ye,dj as Bt,j as zt,dy as Ut,dw as Rt,dx as De,au as Ht,gk as q,e1 as kt,jD as pe,s as de,b0 as ut,et as Zt,aE as Se,aB as Et,ec as Pt,N as j,a_ as Vt,aW as Gt,eq as Ot,ep as Jt,M as O,aS as Wt,a$ as Ft,b2 as _t,cF as $t}from"./index-CEWggaxV.js";import{p as pt}from"./multidimensionalUtils-uKyVhR8j.js";import{e as k,h as Kt,f as Qt,p as Xt,u as Z}from"./dataUtils-BFJflGP5.js";import{v as dt,j as Mt,b as gt,c as mt,w as Ie,d as tt,A as Ze,e as it}from"./UniqueValueRenderer-BlkUix3g.js";import{p as qt}from"./ColorStop-44hBlQ14.js";import{e as Te,f as le,i as Yt,j as ei,o as Ee,u as yt,t as It,k as ti,l as ii,p as ai,a as ri}from"./RasterSymbolizer-D7OwkKeP.js";import{m as wt,p as ht,a as At}from"./colorRamps-BJydlf0f.js";import{getAllSizes as ni,getRotationAngle as oi}from"./visualVariableUtils-z2k12BH8.js";import{R as si,D as li}from"./utils-kx2f2Fff.js";import"./ClassBreaksDefinition-D281x8Sj.js";import{d as ci}from"./FeatureSet-CYJUZgOk.js";var Ce;const re=new ge({flow_from:"flow-from",flow_to:"flow-to"});let A=Ce=class extends dt(S){constructor(e){super(e),this.density=.8,this.color=new h([255,255,255,1]),this.maxPathLength=200,this.trailWidth=1.5,this.flowSpeed=10,this.trailLength=100,this.smoothing=0,this.flowRepresentation="flow-from",this.type="flow",this.authoringInfo=null,this.legendOptions=null,this.trailCap="butt",this.background="none"}clone(){var N,p;const{density:e,maxPathLength:t,trailWidth:a,flowSpeed:i,trailLength:r,smoothing:s,flowRepresentation:l,trailCap:u,background:y}=this,c=this.color.clone(),w=(this.visualVariables||[]).map(d=>d.clone()),M=(N=this.authoringInfo)==null?void 0:N.clone(),U=(p=this.legendOptions)==null?void 0:p.clone();return new Ce({density:e,color:c,maxPathLength:t,trailWidth:a,flowSpeed:i,trailLength:r,trailCap:u,background:y,smoothing:s,flowRepresentation:l,visualVariables:w,authoringInfo:M,legendOptions:U})}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}};n([o({type:Number,json:{write:!0}})],A.prototype,"density",void 0),n([o({type:h,json:{write:{allowNull:!0}}})],A.prototype,"color",void 0),n([o({type:Number,cast:fe,json:{write:!0}})],A.prototype,"maxPathLength",void 0),n([o({type:Number,cast:fe,json:{write:!0}})],A.prototype,"trailWidth",void 0),n([o({type:Number,json:{write:!0}})],A.prototype,"flowSpeed",void 0),n([o({type:Number,json:{write:!0}})],A.prototype,"trailLength",void 0),n([o({type:Number,cast:fe,json:{write:!1}})],A.prototype,"smoothing",void 0),n([o({type:re.apiValues,json:{type:re.jsonValues,read:{reader:re.read},write:{writer:re.write}}})],A.prototype,"flowRepresentation",void 0),n([W({flowRenderer:"flow"})],A.prototype,"type",void 0),n([o({type:Mt,json:{write:!0}})],A.prototype,"authoringInfo",void 0),n([o({type:qt,json:{write:!0}})],A.prototype,"legendOptions",void 0),n([o({type:String,json:{write:!0}})],A.prototype,"trailCap",void 0),n([o({type:String,json:{write:!0}})],A.prototype,"background",void 0),A=Ce=n([v("esri.renderers.FlowRenderer")],A);const ft=A;let J=class extends S{constructor(){super(...arguments),this.value=null,this.label=null,this.color=null}};n([o({type:Number,json:{write:!0}})],J.prototype,"value",void 0),n([o({type:String,json:{write:!0}})],J.prototype,"label",void 0),n([o({type:h,json:{type:[P],write:!0}})],J.prototype,"color",void 0),J=n([v("esri.renderers.support.ColormapInfo")],J);const Dt=J;var $;let K=$=class extends S{constructor(e){super(e),this.colormapInfos=null,this.type="raster-colormap"}static createFromColormap(e,t){if(!e)return null;const a=e[0].length===5,i=[...e].sort((r,s)=>r[0]-s[0]).map(r=>Dt.fromJSON({value:r[0],color:a?r.slice(1,5):r.slice(1,4).concat([255]),label:t?t[r[0]]??"":r[0]}));return new $({colormapInfos:i})}static createFromColorramp(e){const t=Te(e);return $.createFromColormap(t)}clone(){return new $({colormapInfos:this.colormapInfos.map(e=>e.toJSON())})}extractColormap(){return this.colormapInfos.map(({value:e,color:t})=>[e,t.r,t.g,t.b,t.a>1?t.a:255*t.a&255]).sort((e,t)=>e[0]-t[0])}};n([o({type:[Dt],json:{write:!0}})],K.prototype,"colormapInfos",void 0),n([W({rasterColormap:"raster-colormap"})],K.prototype,"type",void 0),K=$=n([v("esri.renderers.RasterColormapRenderer")],K);const Pe=K;var Ne;let C=Ne=class extends S{constructor(e){super(e),this.altitude=45,this.azimuth=315,this.colorRamp=null,this.hillshadeType="traditional",this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.scalingType="none",this.type="raster-shaded-relief",this.zFactor=1}readColorRamp(e){return ht(e)}clone(){return new Ne({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,scalingType:this.scalingType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,colorRamp:b(this.colorRamp)})}};n([o({type:Number,json:{write:!0}})],C.prototype,"altitude",void 0),n([o({type:Number,json:{write:!0}})],C.prototype,"azimuth",void 0),n([o({types:wt,json:{write:!0}})],C.prototype,"colorRamp",void 0),n([z("colorRamp")],C.prototype,"readColorRamp",null),n([o({type:["traditional","multi-directional"],json:{write:!0}})],C.prototype,"hillshadeType",void 0),n([o({type:Number,json:{write:!0}})],C.prototype,"pixelSizePower",void 0),n([o({type:Number,json:{write:!0}})],C.prototype,"pixelSizeFactor",void 0),n([o({type:["none","adjusted"],json:{write:!0}})],C.prototype,"scalingType",void 0),n([W({rasterShadedRelief:"raster-shaded-relief"})],C.prototype,"type",void 0),n([o({type:Number,json:{write:!0}})],C.prototype,"zFactor",void 0),C=Ne=n([v("esri.renderers.RasterShadedReliefRenderer")],C);const bt=C;var Le;let g=Le=class extends S{constructor(e){super(e),this.colorRamp=null,this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.maxPercent=null,this.minPercent=null,this.numberOfStandardDeviations=null,this.outputMax=null,this.outputMin=null,this.sigmoidStrengthLevel=null,this.statistics=[],this.histograms=null,this.useGamma=!1,this.stretchType="none",this.type="raster-stretch"}readColorRamp(e){if(e)return ht(e)}writeStatistics(e,t,a){e!=null&&e.length&&(Array.isArray(e[0])||(e=e.map(i=>[i.min,i.max,i.avg,i.stddev])),t[a]=e)}readStretchType(e,t){let a=t.stretchType;return typeof a=="number"&&(a=Yt[a]),le.read(a)}clone(){return new Le({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:b(this.statistics),gamma:b(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,colorRamp:b(this.colorRamp),histograms:b(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment})}};n([o({types:wt,json:{write:!0}})],g.prototype,"colorRamp",void 0),n([z("colorRamp")],g.prototype,"readColorRamp",null),n([o({type:Boolean,json:{write:!0}})],g.prototype,"computeGamma",void 0),n([o({type:Boolean,json:{write:{target:"dra"},read:{source:"dra"}}})],g.prototype,"dynamicRangeAdjustment",void 0),n([o({type:[Number],json:{write:!0}})],g.prototype,"gamma",void 0),n([o({type:Number,json:{write:!0}})],g.prototype,"maxPercent",void 0),n([o({type:Number,json:{write:!0}})],g.prototype,"minPercent",void 0),n([o({type:Number,json:{write:!0}})],g.prototype,"numberOfStandardDeviations",void 0),n([o({type:Number,json:{read:{source:"max"},write:{target:"max"}}})],g.prototype,"outputMax",void 0),n([o({type:Number,json:{read:{source:"min"},write:{target:"min"}}})],g.prototype,"outputMin",void 0),n([o({type:Number,json:{write:!0}})],g.prototype,"sigmoidStrengthLevel",void 0),n([o({json:{type:[[Number]],write:!0}})],g.prototype,"statistics",void 0),n([o()],g.prototype,"histograms",void 0),n([me("statistics")],g.prototype,"writeStatistics",null),n([o({type:Boolean,json:{write:!0}})],g.prototype,"useGamma",void 0),n([o({type:le.apiValues,json:{type:le.jsonValues,write:le.write}})],g.prototype,"stretchType",void 0),n([z("stretchType",["stretchType"])],g.prototype,"readStretchType",null),n([W({rasterStretch:"raster-stretch"})],g.prototype,"type",void 0),g=Le=n([v("esri.renderers.RasterStretchRenderer")],g);const Ve=g;var xe;const at=new Set(["esriMetersPerSecond","esriKilometersPerHour","esriKnots","esriFeetPerSecond","esriMilesPerHour"]),ne=new ge({beaufort_ft:"beaufort-ft",beaufort_km:"beaufort-km",beaufort_kn:"beaufort-kn",beaufort_m:"beaufort-m",beaufort_mi:"beaufort-mi",classified_arrow:"classified-arrow",ocean_current_kn:"ocean-current-kn",ocean_current_m:"ocean-current-m",simple_scalar:"simple-scalar",single_arrow:"single-arrow",wind_speed:"wind-barb"}),oe=new ge({flow_from:"flow-from",flow_to:"flow-to"});let f=xe=class extends dt(S){constructor(e){super(e),this.attributeField="Magnitude",this.flowRepresentation="flow-from",this.rotationType="arithmetic",this.style="single-arrow",this.symbolTileSize=50,this.type="vector-field"}readInputUnit(e,t){return at.has(e)?k.fromJSON(e):null}readOutputUnit(e,t){return at.has(e)?k.fromJSON(e):null}get styleRenderer(){const e=this.style,t=this.attributeField,a=this._createStyleRenderer(e);return a.field=t,a}get sizeVariables(){const e=[];if(this.visualVariables)for(const t of this.visualVariables)t.type==="size"&&e.push(t);if(e.length===0){const t=new gt({field:"Magnitude",minSize:.2*this.symbolTileSize,maxSize:.8*this.symbolTileSize});this.visualVariables?this.visualVariables.push(t):this._set("visualVariables",[t]),e.push(t)}return e}get rotationVariables(){const e=[];if(this.visualVariables)for(const t of this.visualVariables)t.type==="rotation"&&e.push(t);if(e.length===0){const t=new mt({field:"Direction",rotationType:this.rotationType});this.visualVariables?this.visualVariables.push(t):this._set("visualVariables",[t]),e.push(t)}return e}clone(){return new xe({attributeField:this.attributeField,flowRepresentation:this.flowRepresentation,rotationType:this.rotationType,symbolTileSize:this.symbolTileSize,style:this.style,visualVariables:b(this.visualVariables),inputUnit:this.inputUnit,outputUnit:this.outputUnit})}async getGraphicsFromPixelData(e,t=!1,a=[]){var U;const i=new Array,r=Kt(this.inputUnit,this.outputUnit),s=((U=this.rotationVariables[0])==null?void 0:U.rotationType)||this.rotationType,l=t?Qt(e.pixelBlock,"vector-uv",s,r):Xt(e.pixelBlock,"vector-magdir",r);if(l==null)return i;const u=e.extent,y=l.mask!=null&&l.mask.length>0;let c=0;const w=(u.xmax-u.xmin)/l.width,M=(u.ymax-u.ymin)/l.height;for(let N=0;NB.intersects(d));if((!y||l.mask[c])&&!L){const B={Magnitude:l.pixels[0][c],Direction:l.pixels[1][c]},R=new zt({geometry:{type:"point",x:d.x,y:d.y,spatialReference:u.spatialReference},attributes:B});R.symbol=this._getVisualVariablesAppliedSymbol(R),i.push(R)}}return i}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}getClassBreakInfos(){var e;return(e=this.styleRenderer)==null?void 0:e.classBreakInfos}getDefaultSymbol(){var e;return(e=this.styleRenderer)==null?void 0:e.defaultSymbol}_getDefaultSymbol(e){return new Ut({path:"M14,32 14,18 9,23 16,3 22,23 17,18 17,32 z",outline:new Rt({width:0}),size:20,color:e||new h([0,92,230])})}_getVisualVariablesAppliedSymbol(e){var r,s;if(!e)return;const t=(s=(r=this.styleRenderer)==null?void 0:r.getSymbol(e))==null?void 0:s.clone(),a=this.sizeVariables,i=this.rotationVariables;if(a&&a.length&&this.sizeVariables.forEach(l=>si(t,ni([l],e))),i&&i.length){const l=this.flowRepresentation==="flow-to"==(this.style==="ocean-current-kn"||this.style==="ocean-current-m")?0:180;e.attributes.Direction=e.attributes.Direction+l,this.rotationVariables.forEach(u=>li(t,oi(u,e),u.axis))}return t}_createStyleRenderer(e){let t={defaultSymbol:this._getDefaultSymbol(),classBreakInfos:[]};switch(e){case"single-arrow":t=this._createSingleArrowRenderer();break;case"beaufort-kn":t=this._createBeaufortKnotsRenderer();break;case"beaufort-m":t=this._createBeaufortMeterRenderer();break;case"beaufort-ft":t=this._createBeaufortFeetRenderer();break;case"beaufort-mi":t=this._createBeaufortMilesRenderer();break;case"beaufort-km":t=this._createBeaufortKilometersRenderer();break;case"ocean-current-m":t=this._createCurrentMeterRenderer();break;case"ocean-current-kn":t=this._createCurrentKnotsRenderer();break;case"simple-scalar":t=this._createSimpleScalarRenderer();break;case"wind-barb":t=this._createWindBarbsRenderer();break;case"classified-arrow":t=this._createClassifiedArrowRenderer()}return new Ie(t)}_createSingleArrowRenderer(){return{defaultSymbol:this._getDefaultSymbol()}}_createBeaufortKnotsRenderer(){const e=[0,1,3,6,10,16,21,27,33,40,47,55,63],t=[[40,146,199],[89,162,186],[129,179,171],[160,194,155],[191,212,138],[218,230,119],[250,250,100],[252,213,83],[252,179,102],[250,141,52],[247,110,42],[240,71,29]];return{defaultSymbol:this._getDefaultSymbol(new h([214,47,39])),classBreakInfos:this._getClassBreaks(e,t)}}_createBeaufortMeterRenderer(){const e=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7],t=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]];return{defaultSymbol:this._getDefaultSymbol(new h([214,47,39])),classBreakInfos:this._getClassBreaks(e,t)}}_createBeaufortFeetRenderer(){const e=this._getDefaultSymbol(new h([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const a=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],i=3.28084;return t=t.map(r=>r*i),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,a)}}_createBeaufortMilesRenderer(){const e=this._getDefaultSymbol(new h([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const a=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],i=2.23694;return t=t.map(r=>r*i),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,a)}}_createBeaufortKilometersRenderer(){const e=this._getDefaultSymbol(new h([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const a=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],i=3.6;return t=t.map(r=>r*i),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,a)}}_createCurrentMeterRenderer(){const e=[0,.5,1,1.5,2],t=[[78,26,153],[179,27,26],[202,128,26],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new h([177,177,177])),classBreakInfos:this._getClassBreaks(e,t)}}_createCurrentKnotsRenderer(){const e=[0,.25,.5,1,1.5,2,2.5,3,3.5,4],t=[[0,0,0],[0,37,100],[78,26,153],[151,0,100],[179,27,26],[177,78,26],[202,128,26],[177,179,52],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new h([177,177,177])),classBreakInfos:this._getClassBreaks(e,t)}}_createClassifiedArrowRenderer(){var i;const e=this._getDefaultSymbol(new h([56,168,0]));let t=[0,1e-6,3.5,7,10.5,14];if((i=this.sizeVariables)!=null&&i.length){const r=this.sizeVariables[0].minDataValue,s=this.sizeVariables[0].maxDataValue;if(r&&s){const l=(s-r)/5;t=Array.from(Array(6).keys()).map(u=>r+l*u)}}const a=[[56,168,0],[139,309,0],[255,255,0],[255,128,0],[255,0,0]];return{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,a)}}_createSimpleScalarRenderer(){return{defaultSymbol:De.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACsAAAArCAQAAABLVLlLAAAABGdBTUEAAYagMeiWXwAAAAJiS0dEAACqjSMyAAAACXBIWXMAAABIAAAASABGyWs+AAAC3ElEQVRIx9XXvW4cVRQH8N982btpsIREJECyiCXsxX4DKh6AliqGKCBBE2SlwlHgAbBD/AKmyEYUeQ1KahPZSZQvBCkQLTHZ7KGY8Xodz4w3a1NwbzVzz/znfJ//zbStVC5q3icKak9GAs2QIdDx3PtW/S011NW3p+M5Eomh11ipTIKe6+4LQzHaQ+G+63pIZNJJQXMpljwTwj1brpgx5w1zZlyx5Z4QnllEIm2xeeSUHBf0hV0bejo1Uh09G3aFvgXk7cCJFBc9EdaRVuHJJaOdKyTV2TVhYLMduNR0Q9gxL5GaaTDw8GzejrDRBpxWoGsySRW0dttKuattwNkIlFw2YXgzOdYq4Ox49PlM+JrKd5OusjTWhBuVxUfMX/KXXZ3WEmkuqa67wspR4BTbwtKr/5u4fFgStse/T7EifFPnnYl9zPq4vmUOPrRndgoHjDti1gOPqlyXoifcRNGQzUd31lDyfHmob1Gp35vSr+P6vilcQ5Egtyd8YF/ySg9NhPM+9M/IOaHwp5+PSZayXTvCogEUwlatC3J8LLwYtcWB8EuDXQVuCkV5/B4eNHb7wGBs87LBDS+xjdVSn09wq1G8dFM+9tSUhIGneLvUdniKxKpTYljCpu3j7rVWlHj/P23v4NPGUEyeCQnexe9lJjzEQqMjJs+EzNAX6B98dBZVRmroJx95x/A/6gln18EyfCUsl+qdXb/tjvfbw+mwforpUOBz4XLVoBwAn3aWnfeH246NyBXhrq7TTN5lNSP9RkU+puUJm3W2Tsdq0nZWM07srk7MwQrZSRysjjGWBLRJNsNbfj2JMR4AbxpU1XLAb9Mxfpsq5EjMuuiR8L0JiHOOBX3hiUvOmavN0nMueSzcceFk0BK4pMqLo7vDD1Z0qrtDx7Itt4Xwm9UqbMmk8S0Dtuzb2pvOU99Z1nLTOfleNmvfZfP2pYZmPfajwosKdDBNpacNpVGGsWX9CyDI8Xq/Sj6QAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE0LTExLTEwVDAzOjE3OjU4LTA1OjAwF+tHyQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNC0xMS0xMFQwMzoxNzo1OC0wNTowMGa2/3UAAAAASUVORK5CYII=",height:20,width:20,type:"esriPMS",angle:0})}}_createWindBarbsRenderer(){const e=Array.from(Array(31).keys()).map(r=>5*r),t=[{range:"0-5",path:"M20 20 M5 20 A15 15 0 1 0 35 20 A15 15 0 1 0 5 20 M20 20 M10 20 A10 10 0 1 0 30 20 A10 10 0 1 0 10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTIwIDIwIE01IDIwIEExNSAxNSAwIDEgMCAzNSAyMCBBMTUgMTUgMCAxIDAgNSAyMCBNMjAgMjAgTTEwIDIwIEExMCAxMCAwIDEgMCAzMCAyMCBBMTAgMTAgMCAxIDAgMTAgMjAiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"5-10",path:"M25 0 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"10-15",path:"M25 0 L25 40 L10 45 L25 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"15-20",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjEyIDAgMTUgNDUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"20-25",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"25-30",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIEwyNSAzNSBNMjUgMzAgTDE3LjUgMzIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"30-35",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"35-40",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"40-45",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"45-50",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"50-55",path:"M25 0 L25 40 L10 40 L25 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"55-60",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxNy41IDMyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"60-65",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"65-70",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"70-75",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"75-80",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"80-85",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"85-90",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxNy41IDE3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"90-95",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"95-100",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20 L25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCBMMjUgMTUgTTI1IDEwIEwxNy41IDEyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"100-105",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"105-110",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDE3LjUgMjcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"110-115",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"115-120",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDE3LjUgMjIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"120-125",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"125-130",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDE3LjUgMTcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"130-135",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"135-140",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDE3LjUgMTIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"140-145",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"145-150",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IE0yNSAxMCBNMjUgNSBMMTcuNSA3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="}],a=De.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACgAAAApCAQAAADtq6NDAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAJiS0dEAP+Hj8y/AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAEY0lEQVRIx5XXWWxWRRQH8N+d+31tUdGAVjGglYJABFEBY91jfDAg7piYaFTccA++uMQEFRcSXlATtxiXqMQt4G4iisYl0ai4sIQYtVFZ1KIFKdTS0l4f7vRCS5fPebozc+bM/2z/Mzcx0AgSiUxXnKfIdMn875FIhX53U2n/B/s+kKM4UINTjTBZImixxnrv+9a2iL6zEoUBXcoudrWj/OtHm3wt02lfU9Qao9OnHvIhgmww84MEl1qnxfNmGrqHxAizLdPpC6chGcAxKGGcL+30gOERf1BSpUqVslQSV8d5ReZFe8VQ9avufJn31cWwlJV7iafKStGOE/1qvfH9qUxxu8ydUdmuSKbGO8YUdT2inKLG69pM70tliktl5qIkCAJGmusDG7Vqsc0WjZa4UBlBiA5YZIcjYzB7qDtH5kaUJFLs7RGZTZ42W4PRRmtwvbdt1+wGiaS4drEtDttdZYIDNVuAclR3vA3+dI3qHqmVSy7U6Tv1MScCPvPR7nIpFlsdCy3FdTLPGhK92e2CUITjMJ9ocwKxnsZqc3O3JwMma3d6UVLnyVxB4aXemZqvPqLdpJhW3KVVbY4yYImPo6M5Urv50fj+0z/FG9YaEiENs8UtMfXUaTeTePNHlhXfA1UU+2lyD1Il3Gtt9+adfpNG7dNlpg2U/T3KYLZ2dUWFdTgp3/rQ4sK973qnInV5TIf40x3dhvrJPBiqyWUo4wAtLqhQYS71qK+QKOFRywmGK/kpikzV6WMKhh58vGWs4TIJNjiEYLIuP8Tt4/zmLyqk+AyrJSbF+Qq1DgqRUPMxyl+9q3IQhX/rMCJ6tEunriDs1oSyQZKlr9AkhT2ZIARbJfaJS1vtVbHB+Rgi0RK/y1q1BWsEEyLoz40xtGKcARPVWB1BTPO7f4LNtpkUl1aoMbViLyZo0GRjPD3BxnxjqXeLYlvhqYrzMMG3HoyJXa3JjfnGlbYYFlP7Jh3qKsKY4hQ7TY0nG+xwRL61n63mxHtqNHosigyMLmClNwvuecFnOZB88nNBDzNkzhxEZaKMBVoKapggMzvHHXBEpNSSFAvtcFRsVn0bW8LlMmcXs+c0Kne3gRR32+zg4uXwjC6zit6Wt4a8LXVfcp/MtQXHn2ynGbuCmb8GvvFeJLEE82ReU9/n6+dkq2x3buG9Wn94smcgAw631RPR7BTH+kbmHReZoEpOdEe7zWqZl40s0JWs9Hmv7hjBHqPDwsjGKVJnWWqjbdZp1KhJi0aPmxYZsIRhlttgeF+Jlke41QcOQKoqilSb6HJzSvNG3G/UoWnxwsmt+sVaYwd63dRbqdnMyCPVeyRPvpYgdavM22oGKoMUVRbJfOWMwidJ8Zzb1UvmWK/VVUXzHaTjjrVYh1897HT7xxYEVUaa5SWb/WO+YUWa9SrwvigzM8YlzlYv2GSdVCYxxlBtVnnFq5olwp5/BEk/OLsf5LUmG2+inRJdVvjZ97ZH9/zP34ug1O91pf4p+D+JYBpvrKxfbwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNC0xMS0xMFQwMzoxMjowOS0wNTowMB9ViV0AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTQtMTEtMTBUMDM6MTI6MDktMDU6MDBuCDHhAAAAAElFTkSuQmCC",height:20,width:20,type:"esriPMS",angle:0}),i=e.map((r,s)=>{let l;if(s!==e.length-1)if(s===0)l={minValue:r,maxValue:e[s+1],symbol:a};else{const u=De.fromJSON({type:"esriPMS",imageData:t[s].imageData,contentType:"image/svg+xml",height:32,width:32,angle:0});l={minValue:r,maxValue:e[s+1],symbol:u}}return new tt(l)});return{defaultSymbol:a,classBreakInfos:i}}_getClassBreaks(e,t){return t.map((a,i)=>new tt({minValue:e[i],maxValue:e[i+1],symbol:this._getDefaultSymbol(new h(a))}))}};n([o({type:String,json:{write:!0}})],f.prototype,"attributeField",void 0),n([o({type:oe.apiValues,json:{type:oe.jsonValues,read:{reader:oe.read},write:{writer:oe.write}}})],f.prototype,"flowRepresentation",void 0),n([o({type:["geographic","arithmetic"],json:{write:!0}})],f.prototype,"rotationType",void 0),n([o({type:ne.apiValues,json:{type:ne.jsonValues,read:{reader:ne.read},write:{writer:ne.write}}})],f.prototype,"style",void 0),n([o({json:{write:!0}})],f.prototype,"symbolTileSize",void 0),n([o({type:k.apiValues,json:{type:k.jsonValues,write:{writer:k.write}}})],f.prototype,"inputUnit",void 0),n([z("inputUnit")],f.prototype,"readInputUnit",null),n([o({type:k.apiValues,json:{type:k.jsonValues,read:{reader:k.read},write:{writer:k.write}}})],f.prototype,"outputUnit",void 0),n([z("outputUnit")],f.prototype,"readOutputUnit",null),n([W({vectorField:"vector-field"})],f.prototype,"type",void 0),n([o({type:Ie})],f.prototype,"styleRenderer",null),n([o({type:gt})],f.prototype,"sizeVariables",null),n([o({type:mt})],f.prototype,"rotationVariables",null),f=xe=n([v("esri.renderers.VectorFieldRenderer")],f);const Ge=f,rt={key:"type",base:null,typeMap:{"unique-value":Ze,"class-breaks":Ie,"raster-colormap":Pe,"raster-stretch":Ve,"vector-field":Ge,"raster-shaded-relief":bt,flow:ft}},nt={...rt,typeMap:{...rt.typeMap}};delete nt.typeMap["vector-field"],delete nt.typeMap.flow;const ui={uniqueValue:Ze,classBreaks:Ie,rasterStretch:Ve,rasterColormap:Pe,vectorField:Ge,rasterShadedRelief:bt,flowRenderer:ft};function pi(e){return e&&ui[e.type]||null}function Wi(e,t){if(!e)return null;if(e.type==="classBreaks"&&e.classificationMethod){const i=e.authoringInfo||{classificationMethod:""};i.classificationMethod=e.classificationMethod,e.authoringInfo=i}e.type==="vectorField"&&e.visualVariables&&!Array.isArray(e.visualVariables)&&(e.visualVariables=[e.visualVariables]);const a=pi(e);if(a){const i=new a;return i.read(e,t),i}return t!=null&&t.messages&&e&&t.messages.push(new Ht("renderer:unsupported","Renderers of type '"+(e.type||"unknown")+"' are not supported",{definition:e,context:t})),null}const Fi=q()({RSP_NearestNeighbor:"nearest",RSP_BilinearInterpolation:"bilinear",RSP_CubicConvolution:"cubic",RSP_Majority:"majority"}),_i=q()({esriNoDataMatchAny:"any",esriNoDataMatchAll:"all"}),be=q()({U1:"u1",U2:"u2",U4:"u4",U8:"u8",S8:"s8",U16:"u16",S16:"s16",U32:"u32",S32:"s32",F32:"f32",F64:"f64",C64:"c64",C128:"c128",UNKNOWN:"unknown"});let E=class extends S{constructor(){super(...arguments),this.pixelType="unknown"}};n([o({type:String,json:{write:!0}})],E.prototype,"name",void 0),n([o({type:String,json:{write:!0}})],E.prototype,"description",void 0),n([o({type:P,json:{type:P,write:!0,name:"_object_id"}})],E.prototype,"id",void 0),n([o({type:String,json:{type:be.jsonValues,read:be.read,write:be.write}})],E.prototype,"pixelType",void 0),n([o({type:String,json:{write:!0}})],E.prototype,"type",void 0),E=n([v("esri.layers.support.RasterFunctionInfo")],E);const di=E;let H=class extends S{constructor(){super(...arguments),this.isDataset=!1,this.isPublic=!1,this.type="RasterFunctionVariable"}};n([o({type:String,json:{write:!0}})],H.prototype,"name",void 0),n([o({type:Number,json:{type:P,write:!0,name:"_object_id"}})],H.prototype,"id",void 0),n([o({type:Boolean,json:{write:!0}})],H.prototype,"isDataset",void 0),n([o({type:Boolean,json:{write:!0}})],H.prototype,"isPublic",void 0),n([o({json:{write:!0}})],H.prototype,"value",void 0),n([o({type:String,json:{write:!0}})],H.prototype,"type",void 0),H=n([v("esri.layers.support.RasterFunctionVariable")],H);const Mi=H,se={key:"type",base:null,typeMap:{RasterFunctionVariable:Mi}};let V=class extends S{};n([o({types:se,json:{types:se,name:"MatchVariable"}})],V.prototype,"matchVariable",void 0),n([o({types:se,json:{types:se,name:"UnionDimension"}})],V.prototype,"unionDimension",void 0),n([o({type:Number,json:{type:P,write:!0,name:"_object_id"}})],V.prototype,"id",void 0),n([o({type:String,json:{write:!0}})],V.prototype,"type",void 0),V=n([v("esri.layers.support.RasterFunctionProperties")],V);const gi=V,je=new ge({0:"mosaic",1:"item",2:"item-group"},{useNumericKeys:!0});let I=class extends S{constructor(){super(...arguments),this.functionType="mosaic",this.type="RasterFunctionTemplate"}};n([o({type:[String],json:{write:!0}})],I.prototype,"aliases",void 0),n([o({type:Object,json:{write:!0}})],I.prototype,"arguments",void 0),n([o({type:String,json:{write:!0}})],I.prototype,"description",void 0),n([o({type:di,json:{write:!0,name:"function"}})],I.prototype,"functionInfo",void 0),n([o({type:je.apiValues,json:{type:[0,1,2],read:je.read,write:je.write}})],I.prototype,"functionType",void 0),n([o({type:String,json:{write:!0}})],I.prototype,"group",void 0),n([o({type:String,json:{write:!0}})],I.prototype,"help",void 0),n([o({type:Number,json:{type:P,write:!0,name:"_object_id"}})],I.prototype,"id",void 0),n([o({type:String,json:{write:!0}})],I.prototype,"name",void 0),n([o({type:String,json:{write:!0,name:"definition"}})],I.prototype,"queryDefinition",void 0),n([o({type:String,json:{write:!0}})],I.prototype,"tag",void 0),n([o({type:gi,json:{write:!0}})],I.prototype,"properties",void 0),n([o({type:String,json:{write:!0}})],I.prototype,"thumbnail",void 0),n([o({type:String,json:{write:!0}})],I.prototype,"thumbnailEx",void 0),n([o({json:{type:["RasterFunctionTemplate"],write:!0}})],I.prototype,"type",void 0),I=n([v("esri.layers.support.RasterFunctionTemplate")],I);const jt=I;var Be;const ce=new Set(["raster","raster2","dem","fillraster"]),ue=new Set(["rasters"]),ot=e=>e!=null&&e.rasterFunction?D.fromJSON(e):e,ve=e=>e&&e instanceof D?e.toJSON():e,ze=e=>(e==null?void 0:e.functionName)&&!e.declaredClass,st=e=>ze(e)?new D(e):e,mi=e=>{if(e==null)return null;e=b(e);const t={};for(const a of Object.keys(e))ce.has(a.toLowerCase())?t[a]=ot(e[a]):ue.has(a.toLowerCase())&&Array.isArray(e[a])?t[a]=e[a].map(ot):t[a]=e[a];return t},yi={types:{key:"type",base:null,typeMap:{RasterFunctionTemplate:jt}},json:{write:!0,name:"rasterFunctionDefinition"}};let D=Be=class extends S{constructor(e){super(e),this.functionName=null,this.outputPixelType="unknown",this.variableName=null,this.functionDefinition=null}set functionArguments(e){if(e){const t=Object.keys(e);if(t.some(a=>ce.has(a.toLowerCase())&&ze(e[a]))||t.some(a=>ue.has(a.toLowerCase())&&Array.isArray(e[a])&&e[a].some(i=>ze(i)))){e=b(e);for(const a of t)ce.has(a.toLowerCase())?e[a]=st(e[a]):ue.has(a.toLowerCase())&&Array.isArray(e[a])&&(e[a]=e[a].map(i=>st(i)))}}this._set("functionArguments",e)}readFunctionArguments(e){return mi(e)}writeFunctionArguments(e,t,a){const i={};for(const r of Object.keys(e))ce.has(r.toLowerCase())?i[r]=ve(e[r]):ue.has(r.toLowerCase())&&Array.isArray(e[r])?i[r]=e[r].map(ve):i[r]=ve(e[r]);t[a]=i}readFunctionName(e,t){const a=t.rasterFunctionInfos;return t.name||(a!=null&&a.length&&a[0].name!=="None"?a[0].name:t.rasterFunctionDefinition?t.rasterFunctionDefinition.name:t.rasterFunction)}get rasterFunctionDefinition(){var e;return(e=this.functionDefinition)==null?void 0:e.toJSON()}set rasterFunctionDefinition(e){this.functionDefinition=e?jt.fromJSON(e):null}get hasClipFunction(){return this.rasterFunctionDefinition?JSON.stringify(this.rasterFunctionDefinition).includes('"type":"ClipFunction"'):JSON.stringify(this).includes('"rasterFunction":"Clip"')}clone(){return new Be({functionName:this.functionName,functionArguments:b(this.functionArguments),outputPixelType:this.outputPixelType,variableName:this.variableName,rasterFunctionDefinition:b(this.rasterFunctionDefinition)})}};n([o({json:{type:Object,name:"rasterFunctionArguments"}})],D.prototype,"functionArguments",null),n([z("functionArguments")],D.prototype,"readFunctionArguments",null),n([me("functionArguments")],D.prototype,"writeFunctionArguments",null),n([o({json:{type:String,write:{target:"rasterFunction"}}})],D.prototype,"functionName",void 0),n([z("functionName",["rasterFunction","rasterFunctionInfos","rasterFunctionDefinition"])],D.prototype,"readFunctionName",null),n([W({C128:"c128",C64:"c64",F32:"f32",F64:"f64",S16:"s16",S32:"s32",S8:"s8",U1:"u1",U16:"u16",U2:"u2",U32:"u32",U4:"u4",U8:"u8",UNKNOWN:"unknown"},{ignoreUnknown:!1}),o({json:{default:"unknown"}})],D.prototype,"outputPixelType",void 0),n([o({type:String,json:{read:!0,write:!0}})],D.prototype,"variableName",void 0),n([o()],D.prototype,"rasterFunctionDefinition",null),n([o(yi)],D.prototype,"functionDefinition",void 0),n([o()],D.prototype,"hasClipFunction",null),D=Be=n([v("esri.layers.support.RasterFunction")],D);const Me=D;var Ue;const Q=q()({MT_FIRST:"first",MT_LAST:"last",MT_MIN:"min",MT_MAX:"max",MT_MEAN:"mean",MT_BLEND:"blend",MT_SUM:"sum"}),Re=q()({esriMosaicNone:"none",esriMosaicCenter:"center",esriMosaicNadir:"nadir",esriMosaicViewpoint:"viewpoint",esriMosaicAttribute:"attribute",esriMosaicLockRaster:"lock-raster",esriMosaicNorthwest:"northwest",esriMosaicSeamline:"seamline"});function Ii(e){let t;switch(e?e.toLowerCase().replace("esrimosaic",""):""){case"byattribute":case"attribute":t="esriMosaicAttribute";break;case"lockraster":t="esriMosaicLockRaster";break;case"center":t="esriMosaicCenter";break;case"northwest":t="esriMosaicNorthwest";break;case"nadir":t="esriMosaicNadir";break;case"viewpoint":t="esriMosaicViewpoint";break;case"seamline":t="esriMosaicSeamline";break;default:t="esriMosaicNone"}return Re.fromJSON(t)}let m=Ue=class extends S{constructor(e){super(e),this.ascending=!0,this.itemRasterFunction=null,this.lockRasterIds=null,this.method=null,this.multidimensionalDefinition=null,this.objectIds=null,this.operation=null,this.sortField=null,this.sortValue=null,this.viewpoint=null,this.where=null}readAscending(e,t){return t.ascending!=null?t.ascending:t.sortAscending==null||t.sortAscending}get itemRenderingRule(){return pe(de.getLogger(this),"itemRenderingRule",{replacement:"itemRasterFunction",version:"4.27",warnOnce:!0}),this._get("itemRasterFunction")}set itemRenderingRule(e){pe(de.getLogger(this),"itemRenderingRule",{replacement:"itemRasterFunction",version:"4.27",warnOnce:!0}),this._set("itemRasterFunction",e)}readMethod(e,t){return Ii(t.mosaicMethod||t.defaultMosaicMethod)}writeMultidimensionalDefinition(e,t,a){e!=null&&(e=e.filter(({variableName:i,dimensionName:r})=>i&&i!=="*"||r)).length&&(t[a]=e.map(i=>i.toJSON()))}readOperation(e,t){var s;const a=t.mosaicOperation,i=(s=t.mosaicOperator)==null?void 0:s.toLowerCase(),r=a||(i?Q.toJSON(i):null);return Q.fromJSON(r)||"first"}castSortValue(e){return e==null||typeof e=="string"||typeof e=="number"?e:`${e}`}clone(){return new Ue({ascending:this.ascending,itemRasterFunction:b(this.itemRasterFunction),lockRasterIds:b(this.lockRasterIds),method:this.method,multidimensionalDefinition:b(this.multidimensionalDefinition),objectIds:b(this.objectIds),operation:this.operation,sortField:this.sortField,sortValue:this.sortValue,viewpoint:b(this.viewpoint),where:this.where})}};n([o({type:Boolean,json:{write:!0}})],m.prototype,"ascending",void 0),n([z("ascending",["ascending","sortAscending"])],m.prototype,"readAscending",null),n([o({type:Me,json:{name:"itemRenderingRule",write:!0}})],m.prototype,"itemRasterFunction",void 0),n([o({type:Me})],m.prototype,"itemRenderingRule",null),n([o({type:[P],json:{write:{overridePolicy(){return{enabled:this.method==="lock-raster"}}}}})],m.prototype,"lockRasterIds",void 0),n([o({type:String,json:{type:Re.jsonValues,write:{target:"mosaicMethod",writer:Re.write}}})],m.prototype,"method",void 0),n([z("method",["mosaicMethod","defaultMosaicMethod"])],m.prototype,"readMethod",null),n([o({type:[pt],json:{write:!0}})],m.prototype,"multidimensionalDefinition",void 0),n([me("multidimensionalDefinition")],m.prototype,"writeMultidimensionalDefinition",null),n([o({type:[P],json:{name:"fids",write:!0}})],m.prototype,"objectIds",void 0),n([o({json:{type:Q.jsonValues,read:{reader:Q.read},write:{target:"mosaicOperation",writer:Q.write}}})],m.prototype,"operation",void 0),n([z("operation",["mosaicOperation","mosaicOperator"])],m.prototype,"readOperation",null),n([o({type:String,json:{write:{overridePolicy(){return{enabled:this.method==="attribute"}}}}})],m.prototype,"sortField",void 0),n([o({type:[String,Number],json:{write:{allowNull:!0,overridePolicy(){return{enabled:this.method==="attribute",allowNull:!0}}}}})],m.prototype,"sortValue",void 0),n([kt("sortValue")],m.prototype,"castSortValue",null),n([o({type:ye,json:{write:!0}})],m.prototype,"viewpoint",void 0),n([o({type:String,json:{write:!0}})],m.prototype,"where",void 0),m=Ue=n([v("esri.layers.support.MosaicRule")],m);const wi=m;var He;const hi={base:Zt,key:"type",typeMap:{extent:Se,polygon:Et}};let G=He=class extends S{constructor(e){super(e),this.areaOfInterest=null,this.subsetDefinitions=null}get dimensions(){const{subsetDefinitions:e}=this;if(e==null||e.length===0)return[];const t=new Map;e.forEach(i=>{if(!i.dimensionName)return;let r,s;if(Array.isArray(i.values[0])){const l=i.values;r=l[0][0],s=l[i.values.length-1][1]}else{const l=i.values;r=l[0],s=l[i.values.length-1]}if(t.has(i.dimensionName)){const l=t.get(i.dimensionName);l[0]=Math.min(r,l[0]),l[1]=Math.max(s,l[1])}else t.set(i.dimensionName,[r,s])});const a=[];for(const i of t)a.push({name:i[0],extent:i[1]});return a}get variables(){const{subsetDefinitions:e}=this;if(e==null||e.length===0)return[];const t=new Set;return e.forEach(a=>{a.variableName&&t.add(a.variableName)}),[...t]}clone(){var a;const e=(a=this.subsetDefinitions)==null?void 0:a.map(i=>i.clone()),t=this.areaOfInterest?this.areaOfInterest.clone():this.areaOfInterest;return new He({areaOfInterest:t,subsetDefinitions:e})}};n([o({types:hi,json:{read:ut,write:!0}})],G.prototype,"areaOfInterest",void 0),n([o({readOnly:!0})],G.prototype,"dimensions",null),n([o({readOnly:!0})],G.prototype,"variables",null),n([o({type:[pt],json:{write:!0}})],G.prototype,"subsetDefinitions",void 0),G=He=n([v("esri.layers.support.MultidimensionalSubset")],G);const Xi=G;class qi{constructor(){this._workerThread=null,this._destroyed=!1}async initialize(){const t=await Pt("RasterWorker");this._destroyed?t.close():this._workerThread=t}destroy(){this._destroyed=!0,this._workerThread&&(this._workerThread.close(),this._workerThread=null)}async convertVectorFieldData(t,a){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const i=await this._workerThread.invoke("convertVectorFieldData",{pixelBlock:t.pixelBlock.toJSON(),type:t.dataType},a);return i?new Z(i):null}computeStatisticsHistograms(t,a){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");return this._workerThread.invoke("computeStatisticsHistograms",{pixelBlock:t.pixelBlock.toJSON()},a)}async decode(t,a){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const i=await this._workerThread.invoke("decode",t,a);return i?new Z(i):null}async symbolize(t,a){var s,l;if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const i={extent:(s=t.extent)==null?void 0:s.toJSON(),pixelBlock:(l=t.pixelBlock)==null?void 0:l.toJSON(),simpleStretchParams:t.simpleStretchParams,bandIds:t.bandIds},r=await this._workerThread.invoke("symbolize",i,a);return r?new Z(r):null}async updateSymbolizer(t,a){var r;if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const i=(r=t==null?void 0:t.rendererJSON)==null?void 0:r.histograms;await Promise.all(this._workerThread.broadcast("updateSymbolizer",{symbolizerJSON:t.toJSON(),histograms:i},a))}async updateRasterFunction(t,a){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");await Promise.all(this._workerThread.broadcast("updateRasterFunction",{rasterFunctionJSON:t.toJSON()},a))}async process(t,a){var r,s;if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const i=await this._workerThread.invoke("process",{extent:(r=t.extent)==null?void 0:r.toJSON(),primaryPixelSizes:(s=t.primaryPixelSizes)==null?void 0:s.map(l=>l!=null?l.toJSON():null),primaryPixelBlocks:t.primaryPixelBlocks.map(l=>l!=null?l.toJSON():null),primaryRasterIds:t.primaryRasterIds},a);return i?new Z(i):null}async stretch(t,a){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!(t!=null&&t.pixelBlock))return null;const i={srcPixelBlock:t.pixelBlock.toJSON(),stretchParams:t.stretchParams},r=await this._workerThread.invoke("stretch",i,a);return r?new Z(r):null}async split(t,a){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!(t!=null&&t.pixelBlock))return null;const i={srcPixelBlock:t.pixelBlock.toJSON(),tileSize:t.tileSize,maximumPyramidLevel:t.maximumPyramidLevel,useBilinear:t.useBilinear},r=await this._workerThread.invoke("split",i,a);return r&&r.forEach((s,l)=>{r.set(l,s?Z.fromJSON(s):null)}),r}async clipTile(t,a){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!(t!=null&&t.pixelBlock))return null;const i={...t,pixelBlock:t.pixelBlock.toJSON()},r=await this._workerThread.invoke("clipTile",i,a);return r?Z.fromJSON(r):null}async estimateStatisticsHistograms(t,a){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!(t!=null&&t.pixelBlock))return null;const i={srcPixelBlock:t.pixelBlock.toJSON()};return await this._workerThread.invoke("estimateStatisticsHistograms",i,a)}async mosaicAndTransform(t,a){var s;if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!((s=t==null?void 0:t.srcPixelBlocks)!=null&&s.length))return{pixelBlock:null};const i={...t,srcPixelBlocks:t.srcPixelBlocks.map(l=>l!=null?l.toJSON():null)},r=await this._workerThread.invoke("mosaicAndTransform",i,a);return{pixelBlock:r.pixelBlock?new Z(r.pixelBlock):null,localNorthDirections:r.localNorthDirections}}async createFlowMesh(t,a){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const i={buffer:t.flowData.data.buffer,maskBuffer:t.flowData.mask.buffer,width:t.flowData.width,height:t.flowData.height},{meshType:r,simulationSettings:s}=t,l=await this._workerThread.invoke("createFlowMesh",{meshType:r,flowData:i,simulationSettings:s},{...a,transferList:[i.buffer,i.maskBuffer]});return{vertexData:new Float32Array(l.vertexBuffer),indexData:new Uint32Array(l.indexBuffer)}}getProjectionOffsetGrid(t,a){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const i=t.datumTransformation!=null?t.datumTransformation.steps.map(l=>({wkid:l.wkid,wkt:l.wkt,isInverse:l.isInverse})):null,r=t.rasterTransform!=null?t.rasterTransform.toJSON():null,s={projectedExtent:t.projectedExtent.toJSON(),srcBufferExtent:t.srcBufferExtent.toJSON(),pixelSize:t.pixelSize,hasWrapAround:t.hasWrapAround,spacing:t.spacing,datumTransformationSteps:i,rasterTransform:r,isAdaptive:t.isAdaptive,includeGCSGrid:t.includeGCSGrid};return this._workerThread.invoke("getProjectionOffsetGrid",s,a)}}const Ai=.25,fi=At.fromJSON({type:"multipart",colorRamps:[{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]}),lt=At.fromJSON(ei[0]),vt=new Set(["scientific","standard-time","vector-uv","vector-magdir","vector-u","vector-v","vector-magnitude","vector-direction"]);function Yi(e,t){const{attributeTable:a,colormap:i}=e;if(Ee(e)){const r=xi(e);if(r!=null)return r}if(i!=null){const r=Ni(e);if(r!=null)return r}if(a!=null){const r=Ti(e);if(r!=null)return r}return Di(e,t)}function ea(e,t=!1){const a=["raster-stretch"];return yt(e,t)&&a.push("raster-colormap"),It(e)&&a.push("unique-value"),ti(e,t)&&a.push("class-breaks"),ii(e)&&a.push("raster-shaded-relief"),Ee(e)&&a.push("vector-field"),ai(e)&&a.push("flow"),a}function ta(e,t,a){const i=["nearest","bilinear","cubic","majority"].find(r=>r===(a==null?void 0:a.toLowerCase()));return t==="Map"?i??"bilinear":e.dataType==="standard-time"?i??"nearest":e.dataType==="thematic"||e.attributeTable||e.colormap?i==="nearest"||i==="majority"?i:"nearest":i??"bilinear"}function Di(e,t){e=bi(e,t==null?void 0:t.variableName);const{bandCount:a}=e;let{bandIds:i,stretchType:r}=t||{};i!=null&&i.some(M=>M>=a)&&(i=null);let s=e.statistics,l=e.histograms;a>1?(i=i!=null&&i.length?i:ji(e),s=s==null?null:i==null?void 0:i.map(M=>s[M]),l=l==null?null:i==null?void 0:i.map(M=>l[M])):i=[0],r==null&&(r=Si(e));let u=!1;switch(r){case"none":u=!1;break;case"percent-clip":u=!(l!=null&&l.length);break;default:u=!(s!=null&&s.length)}const{dataType:y}=e,c=(i==null?void 0:i.length)===1&&vt.has(y)?fi:null,w=new Ve({stretchType:r,dynamicRangeAdjustment:u,colorRamp:c,outputMin:0,outputMax:255,gamma:(i==null?void 0:i.length)===1?[1]:[1,1,1],useGamma:!1});return r==="percent-clip"?w.maxPercent=w.minPercent=Ai:r==="standard-deviation"&&(w.numberOfStandardDeviations=2),u||e.multidimensionalInfo==null&&!(t!=null&&t.includeStatisticsInStretch)||(r==="percent-clip"?w.histograms=l:r!=="min-max"&&r!=="standard-deviation"||(w.statistics=s)),w}function bi(e,t){const{multidimensionalInfo:a}=e;if(!t||!a)return e;const i=a.variables.find(r=>r.name===t);if(!i)return e;if(e=e.clone(),i){const{statistics:r,histograms:s}=i;r!=null&&r.length&&(e.statistics=r.map(l=>({min:l.min,max:l.max,avg:l.avg,stddev:l.stddev}))),s!=null&&s.length&&(e.histograms=s)}return e}function ji(e){const t=e.bandCount;if(t===1)return null;if(t===2)return[0];const{bandInfos:a}=e;let i;if(a.length===t){const{red:r,green:s,blue:l,nir:u}=vi(a);r!=null&&s!=null&&l!=null?i=[r,s,l]:u!=null&&r!=null&&s!=null&&(i=[u,r,s])}return!i&&t>=3&&(i=[0,1,2]),i}function vi(e){const t={};for(let a=0;a=410&&s<=480&&l>=480&&l<=540?t.blue=a:t.green==null&&s>=490&&s<=560&&l>=560&&l<=610?t.green=a:t.red==null&&s>=595&&s<=670&&l>=660&&l<=730?t.red=a:t.nir==null&&s>=700&&s<=860&&l>=800&&l<=950&&(t.nir=a)}}return t}function Si(e){let t="percent-clip";const{pixelType:a,dataType:i,histograms:r,statistics:s,multidimensionalInfo:l}=e,u=vt.has(i)||i==="generic"&&l!=null;return a!=="u8"||i!=="processed"&&r!=null&&s!=null?a==="u8"||i==="elevation"||u?t="min-max":r!=null?t="percent-clip":s!=null&&(t="min-max"):t="none",t}function Ti(e,t,a,i){if(!It(e,t))return null;const{attributeTable:r,statistics:s}=e,l=St(r,t),u=X(r,"red"),y=X(r,"green"),c=X(r,"blue"),w=new Mt,M=[],U=new Set,N=!!(u&&y&&c);if(r!=null)r.features.forEach(p=>{const d=p.attributes[l.name];if(!U.has(p.attributes[l.name])&&d!=null){U.add(d);const L=N&&(u.type==="single"||u.type==="double")&&(y.type==="single"||y.type==="double")&&(c.type==="single"||c.type==="double")&&!r.features.some(R=>R.attributes[u.name]>1||R.attributes[y.name]>1||R.attributes[c.name]>1),B=L?255:1;M.push(new it({value:p.attributes[l.name],label:p.attributes[l.name]+"",symbol:{type:"simple-fill",style:"solid",outline:null,color:new h(N?[p.attributes[u.name]*B,p.attributes[y.name]*B,p.attributes[c.name]*B,1]:[0,0,0,0])}}))}});else if(s!=null&&s[0])for(let p=s[0].min;p<=s[0].max;p++)M.push(new it({value:p,label:p.toString(),symbol:{type:"simple-fill",style:"solid",outline:null,color:new h([0,0,0,0])}}));if(M.sort((p,d)=>p.value&&typeof p.value.valueOf()=="string"?0:p.value>d.value?1:-1),!N){const p=Te(lt,{numColors:M.length});M.forEach((d,L)=>d.symbol.color=new h(p[L].slice(1,4))),w.colorRamp=lt}if(a||i){const p=a||Te(i,{numColors:M.length}).map(d=>d.slice(1));M.forEach((d,L)=>d.symbol.color=new h(p[L])),w.colorRamp=i}return new Ze({field:l.name,uniqueValueInfos:M,authoringInfo:w})}function St(e,t,a){let i;return e!=null?(i=t?e.fields.find(r=>t.toLowerCase()===r.name.toLowerCase()):Ci(e.fields),i||(a||(i=e.fields.find(r=>r.type==="string")),i||(i=X(e,"value")))):i=new Vt({name:"value"}),i}function Ci(e){let t;for(let a=0;aa.name.toLowerCase()===t)}function Ni(e){if(!yt(e))return null;let t;const{attributeTable:a,colormap:i}=e;if(a!=null){const r=X(a,"value"),s=St(a,null,!0);s.type==="string"&&(t={},a.features.forEach(l=>{const u=l.attributes;t[u[r.name]]=s?u[s.name]:u[r.name]}))}return Pe.createFromColormap(i,t)}const Li=new Map([["m/s","meter-per-second"],["km/h","kilometer-per-hour"],["knots","knots"],["ft/s","feet-per-second"],["mph","mile-per-hour"]]);function xi(e){if(!Ee(e))return null;let t;if(e.statistics!=null&&e.statistics.length&&(e.dataType==="vector-magdir"||e.dataType==="vector-uv")){const{minMagnitude:r,maxMagnitude:s}=Bi(e.dataType,e.statistics);t=[{type:"size",field:"Magnitude",minSize:10,maxSize:40,minDataValue:r,maxDataValue:s}]}const a=e.multidimensionalInfo!=null?Li.get(e.multidimensionalInfo.variables[0].unit):null,i=new Ge({visualVariables:t,inputUnit:a,rotationType:"geographic"});return i.visualVariables=[...i.sizeVariables,...i.rotationVariables],i}function ct(e){var t;return{color:(t=e.symbolLayers[0].material)==null?void 0:t.color,type:"esriSFS",style:"esriSFSSolid"}}function ia(e){var t,a;if(e.type==="uniqueValue"){const i=e.uniqueValueInfos,r=i==null?void 0:i[0].symbol;return(t=r==null?void 0:r.symbolLayers)!=null&&t.length&&(e.uniqueValueInfos=i==null?void 0:i.map(s=>({value:s.value,label:s.label,symbol:s.symbol?ct(s.symbol):null}))),e}if(e.type==="classBreaks"){const i=e.classBreakInfos,r=i[0].symbol;return(a=r==null?void 0:r.symbolLayers)!=null&&a.length&&(e.classBreakInfos=i.map(s=>({classMinValue:s.classMinValue,classMaxValue:s.classMaxValue,label:s.label,symbol:s.symbol?ct(s.symbol):null}))),e}return e}function Bi(e,t){let a,i;if(e==="vector-magdir")a=t[0].min,i=t[0].max;else{const r=t[0].min,s=t[0].max,l=t[1].min,u=t[1].max;a=0,i=Math.max(Math.abs(r),Math.abs(l),Math.abs(s),Math.abs(u))}return{minMagnitude:a,maxMagnitude:i}}async function Tt(e,t,a){var Je,We,Fe,_e,$e,Ke,Qe,Xe,qe,Ye;const i=Gt(e),{rasterFunction:r,sourceJSON:s}=t||{},l=r?JSON.stringify(r.rasterFunctionDefinition||r):null,u=Ot({...i.query,renderingRule:l,f:"json"}),y=Jt(u,a);e=i.path;const c=s||await O(e,y).then(T=>T.data),w=c.hasRasterAttributeTable?O(`${e}/rasterAttributeTable`,y):null,M=c.hasColormap?O(`${e}/colormap`,y):null,U=c.hasHistograms?O(`${e}/histograms`,y):null,N=c.currentVersion>=10.3?O(`${e}/keyProperties`,y):null,p=c.hasMultidimensions?O(`${e}/multidimensionalInfo`,y):null,d=await Promise.allSettled([w,M,U,N,p]);let L=null;if(c.minValues&&c.minValues.length===c.bandCount){L=[];for(let T=0;T{var et;(et=T.statistics)!=null&&et.length&&T.statistics.forEach(ae=>{ae.avg=ae.mean,ae.stddev=ae.standardDeviation})});const{defaultVariable:he,serviceDataType:_}=c;he&&he!==F.DefaultVariable&&(F.DefaultVariable=he),_!=null&&_.includes("esriImageServiceDataTypeVector")&&!_.includes(F.DataType)&&(F.DataType=_.replace("esriImageServiceDataType",""));let Ae=c.noDataValue;return(Ye=c.noDataValues)!=null&&Ye.length&&c.noDataValues.some(T=>T!==Ae)&&(Ae=c.noDataValues),new ri({width:R,height:Ct,bandCount:c.bandCount,extent:Se.fromJSON(c.extent),spatialReference:Oe,pixelSize:new ye({x:c.pixelSizeX,y:c.pixelSizeY,spatialReference:Oe}),pixelType:c.pixelType.toLowerCase(),statistics:L,attributeTable:Nt,colormap:Lt,histograms:xt,keyProperties:F,noDataValue:Ae,multidimensionalInfo:we})}function aa(e,t,a){return Tt(e,{sourceJSON:t},a)}function ra(e,t,a){return Tt(e,{rasterFunction:t},a)}function na(e,t){e.attributeTable||(t.hasRasterAttributeTable=!1),e.histograms||(t.hasHistograms=!1),e.colormap||(t.hasColormap=!1),e.multidimensionalInfo||(t.hasMultidimensions=!1)}var ke;let x=ke=class extends S{constructor(){super(...arguments),this.geometry=null,this.mosaicRule=null,this.rasterFunction=null,this.pixelSize=null,this.raster=void 0,this.timeExtent=null}writeGeometry(e,t,a){e!=null&&(t.geometryType=$t(e),t[a]=e.toJSON())}get renderingRule(){return pe(de.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._get("rasterFunction")}set renderingRule(e){pe(de.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._set("rasterFunction",e)}clone(){return new ke(b({geometry:this.geometry,mosaicRule:this.mosaicRule,rasterFunction:this.rasterFunction,pixelSize:this.pixelSize,raster:this.raster,timeExtent:this.timeExtent}))}};n([o({types:Ft,json:{read:ut}})],x.prototype,"geometry",void 0),n([me("geometry")],x.prototype,"writeGeometry",null),n([o({type:wi,json:{write:!0}})],x.prototype,"mosaicRule",void 0),n([o({type:Me})],x.prototype,"renderingRule",null),n([o({type:Me,json:{write:!0,name:"renderingRule"}})],x.prototype,"rasterFunction",void 0),n([o({type:ye,json:{write:!0}})],x.prototype,"pixelSize",void 0),n([o({json:{write:!0}})],x.prototype,"raster",void 0),n([o({type:_t,json:{read:{source:"time"},write:{target:"time"}}})],x.prototype,"timeExtent",void 0),x=ke=n([v("esri.rest.support.ImageHistogramParameters")],x);const oa=x;export{bi as B,ji as E,ia as K,Me as N,ta as S,Yi as V,Wi as a,Fi as b,Xi as c,nt as d,ra as f,oa as h,_i as i,wi as j,ea as k,rt as l,aa as m,be as n,na as p,qi as t}; +import{aY as ge,a9 as h,d as n,y as o,f0 as fe,c9 as W,f as v,aU as S,dS as P,aZ as z,aV as b,aR as me,aA as ye,dj as Bt,j as zt,dy as Ut,dw as Rt,dx as De,au as Ht,gk as q,e1 as kt,jD as pe,s as de,b0 as ut,et as Zt,aE as Se,aB as Et,ec as Pt,N as j,a_ as Vt,aW as Gt,eq as Ot,ep as Jt,M as O,aS as Wt,a$ as Ft,b2 as _t,cF as $t}from"./index-BjUNJPVf.js";import{p as pt}from"./multidimensionalUtils-u3oUX4w1.js";import{e as k,h as Kt,f as Qt,p as Xt,u as Z}from"./dataUtils-DzOfgSpi.js";import{v as dt,j as Mt,b as gt,c as mt,w as Ie,d as tt,A as Ze,e as it}from"./UniqueValueRenderer-7V9Bhr-D.js";import{p as qt}from"./ColorStop-DCGjAKLC.js";import{e as Te,f as le,i as Yt,j as ei,o as Ee,u as yt,t as It,k as ti,l as ii,p as ai,a as ri}from"./RasterSymbolizer-BN7ge8gb.js";import{m as wt,p as ht,a as At}from"./colorRamps-CcakIWlU.js";import{getAllSizes as ni,getRotationAngle as oi}from"./visualVariableUtils-BX9G5gNQ.js";import{R as si,D as li}from"./utils-Dx_a2yJw.js";import"./ClassBreaksDefinition-Djcxa8Lp.js";import{d as ci}from"./FeatureSet-opEn8ou8.js";var Ce;const re=new ge({flow_from:"flow-from",flow_to:"flow-to"});let A=Ce=class extends dt(S){constructor(e){super(e),this.density=.8,this.color=new h([255,255,255,1]),this.maxPathLength=200,this.trailWidth=1.5,this.flowSpeed=10,this.trailLength=100,this.smoothing=0,this.flowRepresentation="flow-from",this.type="flow",this.authoringInfo=null,this.legendOptions=null,this.trailCap="butt",this.background="none"}clone(){var N,p;const{density:e,maxPathLength:t,trailWidth:a,flowSpeed:i,trailLength:r,smoothing:s,flowRepresentation:l,trailCap:u,background:y}=this,c=this.color.clone(),w=(this.visualVariables||[]).map(d=>d.clone()),M=(N=this.authoringInfo)==null?void 0:N.clone(),U=(p=this.legendOptions)==null?void 0:p.clone();return new Ce({density:e,color:c,maxPathLength:t,trailWidth:a,flowSpeed:i,trailLength:r,trailCap:u,background:y,smoothing:s,flowRepresentation:l,visualVariables:w,authoringInfo:M,legendOptions:U})}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}};n([o({type:Number,json:{write:!0}})],A.prototype,"density",void 0),n([o({type:h,json:{write:{allowNull:!0}}})],A.prototype,"color",void 0),n([o({type:Number,cast:fe,json:{write:!0}})],A.prototype,"maxPathLength",void 0),n([o({type:Number,cast:fe,json:{write:!0}})],A.prototype,"trailWidth",void 0),n([o({type:Number,json:{write:!0}})],A.prototype,"flowSpeed",void 0),n([o({type:Number,json:{write:!0}})],A.prototype,"trailLength",void 0),n([o({type:Number,cast:fe,json:{write:!1}})],A.prototype,"smoothing",void 0),n([o({type:re.apiValues,json:{type:re.jsonValues,read:{reader:re.read},write:{writer:re.write}}})],A.prototype,"flowRepresentation",void 0),n([W({flowRenderer:"flow"})],A.prototype,"type",void 0),n([o({type:Mt,json:{write:!0}})],A.prototype,"authoringInfo",void 0),n([o({type:qt,json:{write:!0}})],A.prototype,"legendOptions",void 0),n([o({type:String,json:{write:!0}})],A.prototype,"trailCap",void 0),n([o({type:String,json:{write:!0}})],A.prototype,"background",void 0),A=Ce=n([v("esri.renderers.FlowRenderer")],A);const ft=A;let J=class extends S{constructor(){super(...arguments),this.value=null,this.label=null,this.color=null}};n([o({type:Number,json:{write:!0}})],J.prototype,"value",void 0),n([o({type:String,json:{write:!0}})],J.prototype,"label",void 0),n([o({type:h,json:{type:[P],write:!0}})],J.prototype,"color",void 0),J=n([v("esri.renderers.support.ColormapInfo")],J);const Dt=J;var $;let K=$=class extends S{constructor(e){super(e),this.colormapInfos=null,this.type="raster-colormap"}static createFromColormap(e,t){if(!e)return null;const a=e[0].length===5,i=[...e].sort((r,s)=>r[0]-s[0]).map(r=>Dt.fromJSON({value:r[0],color:a?r.slice(1,5):r.slice(1,4).concat([255]),label:t?t[r[0]]??"":r[0]}));return new $({colormapInfos:i})}static createFromColorramp(e){const t=Te(e);return $.createFromColormap(t)}clone(){return new $({colormapInfos:this.colormapInfos.map(e=>e.toJSON())})}extractColormap(){return this.colormapInfos.map(({value:e,color:t})=>[e,t.r,t.g,t.b,t.a>1?t.a:255*t.a&255]).sort((e,t)=>e[0]-t[0])}};n([o({type:[Dt],json:{write:!0}})],K.prototype,"colormapInfos",void 0),n([W({rasterColormap:"raster-colormap"})],K.prototype,"type",void 0),K=$=n([v("esri.renderers.RasterColormapRenderer")],K);const Pe=K;var Ne;let C=Ne=class extends S{constructor(e){super(e),this.altitude=45,this.azimuth=315,this.colorRamp=null,this.hillshadeType="traditional",this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.scalingType="none",this.type="raster-shaded-relief",this.zFactor=1}readColorRamp(e){return ht(e)}clone(){return new Ne({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,scalingType:this.scalingType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,colorRamp:b(this.colorRamp)})}};n([o({type:Number,json:{write:!0}})],C.prototype,"altitude",void 0),n([o({type:Number,json:{write:!0}})],C.prototype,"azimuth",void 0),n([o({types:wt,json:{write:!0}})],C.prototype,"colorRamp",void 0),n([z("colorRamp")],C.prototype,"readColorRamp",null),n([o({type:["traditional","multi-directional"],json:{write:!0}})],C.prototype,"hillshadeType",void 0),n([o({type:Number,json:{write:!0}})],C.prototype,"pixelSizePower",void 0),n([o({type:Number,json:{write:!0}})],C.prototype,"pixelSizeFactor",void 0),n([o({type:["none","adjusted"],json:{write:!0}})],C.prototype,"scalingType",void 0),n([W({rasterShadedRelief:"raster-shaded-relief"})],C.prototype,"type",void 0),n([o({type:Number,json:{write:!0}})],C.prototype,"zFactor",void 0),C=Ne=n([v("esri.renderers.RasterShadedReliefRenderer")],C);const bt=C;var Le;let g=Le=class extends S{constructor(e){super(e),this.colorRamp=null,this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.maxPercent=null,this.minPercent=null,this.numberOfStandardDeviations=null,this.outputMax=null,this.outputMin=null,this.sigmoidStrengthLevel=null,this.statistics=[],this.histograms=null,this.useGamma=!1,this.stretchType="none",this.type="raster-stretch"}readColorRamp(e){if(e)return ht(e)}writeStatistics(e,t,a){e!=null&&e.length&&(Array.isArray(e[0])||(e=e.map(i=>[i.min,i.max,i.avg,i.stddev])),t[a]=e)}readStretchType(e,t){let a=t.stretchType;return typeof a=="number"&&(a=Yt[a]),le.read(a)}clone(){return new Le({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:b(this.statistics),gamma:b(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,colorRamp:b(this.colorRamp),histograms:b(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment})}};n([o({types:wt,json:{write:!0}})],g.prototype,"colorRamp",void 0),n([z("colorRamp")],g.prototype,"readColorRamp",null),n([o({type:Boolean,json:{write:!0}})],g.prototype,"computeGamma",void 0),n([o({type:Boolean,json:{write:{target:"dra"},read:{source:"dra"}}})],g.prototype,"dynamicRangeAdjustment",void 0),n([o({type:[Number],json:{write:!0}})],g.prototype,"gamma",void 0),n([o({type:Number,json:{write:!0}})],g.prototype,"maxPercent",void 0),n([o({type:Number,json:{write:!0}})],g.prototype,"minPercent",void 0),n([o({type:Number,json:{write:!0}})],g.prototype,"numberOfStandardDeviations",void 0),n([o({type:Number,json:{read:{source:"max"},write:{target:"max"}}})],g.prototype,"outputMax",void 0),n([o({type:Number,json:{read:{source:"min"},write:{target:"min"}}})],g.prototype,"outputMin",void 0),n([o({type:Number,json:{write:!0}})],g.prototype,"sigmoidStrengthLevel",void 0),n([o({json:{type:[[Number]],write:!0}})],g.prototype,"statistics",void 0),n([o()],g.prototype,"histograms",void 0),n([me("statistics")],g.prototype,"writeStatistics",null),n([o({type:Boolean,json:{write:!0}})],g.prototype,"useGamma",void 0),n([o({type:le.apiValues,json:{type:le.jsonValues,write:le.write}})],g.prototype,"stretchType",void 0),n([z("stretchType",["stretchType"])],g.prototype,"readStretchType",null),n([W({rasterStretch:"raster-stretch"})],g.prototype,"type",void 0),g=Le=n([v("esri.renderers.RasterStretchRenderer")],g);const Ve=g;var xe;const at=new Set(["esriMetersPerSecond","esriKilometersPerHour","esriKnots","esriFeetPerSecond","esriMilesPerHour"]),ne=new ge({beaufort_ft:"beaufort-ft",beaufort_km:"beaufort-km",beaufort_kn:"beaufort-kn",beaufort_m:"beaufort-m",beaufort_mi:"beaufort-mi",classified_arrow:"classified-arrow",ocean_current_kn:"ocean-current-kn",ocean_current_m:"ocean-current-m",simple_scalar:"simple-scalar",single_arrow:"single-arrow",wind_speed:"wind-barb"}),oe=new ge({flow_from:"flow-from",flow_to:"flow-to"});let f=xe=class extends dt(S){constructor(e){super(e),this.attributeField="Magnitude",this.flowRepresentation="flow-from",this.rotationType="arithmetic",this.style="single-arrow",this.symbolTileSize=50,this.type="vector-field"}readInputUnit(e,t){return at.has(e)?k.fromJSON(e):null}readOutputUnit(e,t){return at.has(e)?k.fromJSON(e):null}get styleRenderer(){const e=this.style,t=this.attributeField,a=this._createStyleRenderer(e);return a.field=t,a}get sizeVariables(){const e=[];if(this.visualVariables)for(const t of this.visualVariables)t.type==="size"&&e.push(t);if(e.length===0){const t=new gt({field:"Magnitude",minSize:.2*this.symbolTileSize,maxSize:.8*this.symbolTileSize});this.visualVariables?this.visualVariables.push(t):this._set("visualVariables",[t]),e.push(t)}return e}get rotationVariables(){const e=[];if(this.visualVariables)for(const t of this.visualVariables)t.type==="rotation"&&e.push(t);if(e.length===0){const t=new mt({field:"Direction",rotationType:this.rotationType});this.visualVariables?this.visualVariables.push(t):this._set("visualVariables",[t]),e.push(t)}return e}clone(){return new xe({attributeField:this.attributeField,flowRepresentation:this.flowRepresentation,rotationType:this.rotationType,symbolTileSize:this.symbolTileSize,style:this.style,visualVariables:b(this.visualVariables),inputUnit:this.inputUnit,outputUnit:this.outputUnit})}async getGraphicsFromPixelData(e,t=!1,a=[]){var U;const i=new Array,r=Kt(this.inputUnit,this.outputUnit),s=((U=this.rotationVariables[0])==null?void 0:U.rotationType)||this.rotationType,l=t?Qt(e.pixelBlock,"vector-uv",s,r):Xt(e.pixelBlock,"vector-magdir",r);if(l==null)return i;const u=e.extent,y=l.mask!=null&&l.mask.length>0;let c=0;const w=(u.xmax-u.xmin)/l.width,M=(u.ymax-u.ymin)/l.height;for(let N=0;NB.intersects(d));if((!y||l.mask[c])&&!L){const B={Magnitude:l.pixels[0][c],Direction:l.pixels[1][c]},R=new zt({geometry:{type:"point",x:d.x,y:d.y,spatialReference:u.spatialReference},attributes:B});R.symbol=this._getVisualVariablesAppliedSymbol(R),i.push(R)}}return i}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}getClassBreakInfos(){var e;return(e=this.styleRenderer)==null?void 0:e.classBreakInfos}getDefaultSymbol(){var e;return(e=this.styleRenderer)==null?void 0:e.defaultSymbol}_getDefaultSymbol(e){return new Ut({path:"M14,32 14,18 9,23 16,3 22,23 17,18 17,32 z",outline:new Rt({width:0}),size:20,color:e||new h([0,92,230])})}_getVisualVariablesAppliedSymbol(e){var r,s;if(!e)return;const t=(s=(r=this.styleRenderer)==null?void 0:r.getSymbol(e))==null?void 0:s.clone(),a=this.sizeVariables,i=this.rotationVariables;if(a&&a.length&&this.sizeVariables.forEach(l=>si(t,ni([l],e))),i&&i.length){const l=this.flowRepresentation==="flow-to"==(this.style==="ocean-current-kn"||this.style==="ocean-current-m")?0:180;e.attributes.Direction=e.attributes.Direction+l,this.rotationVariables.forEach(u=>li(t,oi(u,e),u.axis))}return t}_createStyleRenderer(e){let t={defaultSymbol:this._getDefaultSymbol(),classBreakInfos:[]};switch(e){case"single-arrow":t=this._createSingleArrowRenderer();break;case"beaufort-kn":t=this._createBeaufortKnotsRenderer();break;case"beaufort-m":t=this._createBeaufortMeterRenderer();break;case"beaufort-ft":t=this._createBeaufortFeetRenderer();break;case"beaufort-mi":t=this._createBeaufortMilesRenderer();break;case"beaufort-km":t=this._createBeaufortKilometersRenderer();break;case"ocean-current-m":t=this._createCurrentMeterRenderer();break;case"ocean-current-kn":t=this._createCurrentKnotsRenderer();break;case"simple-scalar":t=this._createSimpleScalarRenderer();break;case"wind-barb":t=this._createWindBarbsRenderer();break;case"classified-arrow":t=this._createClassifiedArrowRenderer()}return new Ie(t)}_createSingleArrowRenderer(){return{defaultSymbol:this._getDefaultSymbol()}}_createBeaufortKnotsRenderer(){const e=[0,1,3,6,10,16,21,27,33,40,47,55,63],t=[[40,146,199],[89,162,186],[129,179,171],[160,194,155],[191,212,138],[218,230,119],[250,250,100],[252,213,83],[252,179,102],[250,141,52],[247,110,42],[240,71,29]];return{defaultSymbol:this._getDefaultSymbol(new h([214,47,39])),classBreakInfos:this._getClassBreaks(e,t)}}_createBeaufortMeterRenderer(){const e=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7],t=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]];return{defaultSymbol:this._getDefaultSymbol(new h([214,47,39])),classBreakInfos:this._getClassBreaks(e,t)}}_createBeaufortFeetRenderer(){const e=this._getDefaultSymbol(new h([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const a=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],i=3.28084;return t=t.map(r=>r*i),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,a)}}_createBeaufortMilesRenderer(){const e=this._getDefaultSymbol(new h([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const a=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],i=2.23694;return t=t.map(r=>r*i),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,a)}}_createBeaufortKilometersRenderer(){const e=this._getDefaultSymbol(new h([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const a=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],i=3.6;return t=t.map(r=>r*i),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,a)}}_createCurrentMeterRenderer(){const e=[0,.5,1,1.5,2],t=[[78,26,153],[179,27,26],[202,128,26],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new h([177,177,177])),classBreakInfos:this._getClassBreaks(e,t)}}_createCurrentKnotsRenderer(){const e=[0,.25,.5,1,1.5,2,2.5,3,3.5,4],t=[[0,0,0],[0,37,100],[78,26,153],[151,0,100],[179,27,26],[177,78,26],[202,128,26],[177,179,52],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new h([177,177,177])),classBreakInfos:this._getClassBreaks(e,t)}}_createClassifiedArrowRenderer(){var i;const e=this._getDefaultSymbol(new h([56,168,0]));let t=[0,1e-6,3.5,7,10.5,14];if((i=this.sizeVariables)!=null&&i.length){const r=this.sizeVariables[0].minDataValue,s=this.sizeVariables[0].maxDataValue;if(r&&s){const l=(s-r)/5;t=Array.from(Array(6).keys()).map(u=>r+l*u)}}const a=[[56,168,0],[139,309,0],[255,255,0],[255,128,0],[255,0,0]];return{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,a)}}_createSimpleScalarRenderer(){return{defaultSymbol:De.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACsAAAArCAQAAABLVLlLAAAABGdBTUEAAYagMeiWXwAAAAJiS0dEAACqjSMyAAAACXBIWXMAAABIAAAASABGyWs+AAAC3ElEQVRIx9XXvW4cVRQH8N982btpsIREJECyiCXsxX4DKh6AliqGKCBBE2SlwlHgAbBD/AKmyEYUeQ1KahPZSZQvBCkQLTHZ7KGY8Xodz4w3a1NwbzVzz/znfJ//zbStVC5q3icKak9GAs2QIdDx3PtW/S011NW3p+M5Eomh11ipTIKe6+4LQzHaQ+G+63pIZNJJQXMpljwTwj1brpgx5w1zZlyx5Z4QnllEIm2xeeSUHBf0hV0bejo1Uh09G3aFvgXk7cCJFBc9EdaRVuHJJaOdKyTV2TVhYLMduNR0Q9gxL5GaaTDw8GzejrDRBpxWoGsySRW0dttKuattwNkIlFw2YXgzOdYq4Ox49PlM+JrKd5OusjTWhBuVxUfMX/KXXZ3WEmkuqa67wspR4BTbwtKr/5u4fFgStse/T7EifFPnnYl9zPq4vmUOPrRndgoHjDti1gOPqlyXoifcRNGQzUd31lDyfHmob1Gp35vSr+P6vilcQ5Egtyd8YF/ySg9NhPM+9M/IOaHwp5+PSZayXTvCogEUwlatC3J8LLwYtcWB8EuDXQVuCkV5/B4eNHb7wGBs87LBDS+xjdVSn09wq1G8dFM+9tSUhIGneLvUdniKxKpTYljCpu3j7rVWlHj/P23v4NPGUEyeCQnexe9lJjzEQqMjJs+EzNAX6B98dBZVRmroJx95x/A/6gln18EyfCUsl+qdXb/tjvfbw+mwforpUOBz4XLVoBwAn3aWnfeH246NyBXhrq7TTN5lNSP9RkU+puUJm3W2Tsdq0nZWM07srk7MwQrZSRysjjGWBLRJNsNbfj2JMR4AbxpU1XLAb9Mxfpsq5EjMuuiR8L0JiHOOBX3hiUvOmavN0nMueSzcceFk0BK4pMqLo7vDD1Z0qrtDx7Itt4Xwm9UqbMmk8S0Dtuzb2pvOU99Z1nLTOfleNmvfZfP2pYZmPfajwosKdDBNpacNpVGGsWX9CyDI8Xq/Sj6QAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE0LTExLTEwVDAzOjE3OjU4LTA1OjAwF+tHyQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNC0xMS0xMFQwMzoxNzo1OC0wNTowMGa2/3UAAAAASUVORK5CYII=",height:20,width:20,type:"esriPMS",angle:0})}}_createWindBarbsRenderer(){const e=Array.from(Array(31).keys()).map(r=>5*r),t=[{range:"0-5",path:"M20 20 M5 20 A15 15 0 1 0 35 20 A15 15 0 1 0 5 20 M20 20 M10 20 A10 10 0 1 0 30 20 A10 10 0 1 0 10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTIwIDIwIE01IDIwIEExNSAxNSAwIDEgMCAzNSAyMCBBMTUgMTUgMCAxIDAgNSAyMCBNMjAgMjAgTTEwIDIwIEExMCAxMCAwIDEgMCAzMCAyMCBBMTAgMTAgMCAxIDAgMTAgMjAiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"5-10",path:"M25 0 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"10-15",path:"M25 0 L25 40 L10 45 L25 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"15-20",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjEyIDAgMTUgNDUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"20-25",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"25-30",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIEwyNSAzNSBNMjUgMzAgTDE3LjUgMzIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"30-35",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"35-40",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"40-45",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"45-50",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"50-55",path:"M25 0 L25 40 L10 40 L25 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"55-60",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxNy41IDMyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"60-65",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"65-70",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"70-75",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"75-80",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"80-85",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"85-90",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxNy41IDE3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"90-95",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"95-100",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20 L25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCBMMjUgMTUgTTI1IDEwIEwxNy41IDEyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"100-105",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"105-110",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDE3LjUgMjcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"110-115",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"115-120",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDE3LjUgMjIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"120-125",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"125-130",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDE3LjUgMTcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"130-135",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"135-140",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDE3LjUgMTIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"140-145",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"145-150",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IE0yNSAxMCBNMjUgNSBMMTcuNSA3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="}],a=De.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACgAAAApCAQAAADtq6NDAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAJiS0dEAP+Hj8y/AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAEY0lEQVRIx5XXWWxWRRQH8N+d+31tUdGAVjGglYJABFEBY91jfDAg7piYaFTccA++uMQEFRcSXlATtxiXqMQt4G4iisYl0ai4sIQYtVFZ1KIFKdTS0l4f7vRCS5fPebozc+bM/2z/Mzcx0AgSiUxXnKfIdMn875FIhX53U2n/B/s+kKM4UINTjTBZImixxnrv+9a2iL6zEoUBXcoudrWj/OtHm3wt02lfU9Qao9OnHvIhgmww84MEl1qnxfNmGrqHxAizLdPpC6chGcAxKGGcL+30gOERf1BSpUqVslQSV8d5ReZFe8VQ9avufJn31cWwlJV7iafKStGOE/1qvfH9qUxxu8ydUdmuSKbGO8YUdT2inKLG69pM70tliktl5qIkCAJGmusDG7Vqsc0WjZa4UBlBiA5YZIcjYzB7qDtH5kaUJFLs7RGZTZ42W4PRRmtwvbdt1+wGiaS4drEtDttdZYIDNVuAclR3vA3+dI3qHqmVSy7U6Tv1MScCPvPR7nIpFlsdCy3FdTLPGhK92e2CUITjMJ9ocwKxnsZqc3O3JwMma3d6UVLnyVxB4aXemZqvPqLdpJhW3KVVbY4yYImPo6M5Urv50fj+0z/FG9YaEiENs8UtMfXUaTeTePNHlhXfA1UU+2lyD1Il3Gtt9+adfpNG7dNlpg2U/T3KYLZ2dUWFdTgp3/rQ4sK973qnInV5TIf40x3dhvrJPBiqyWUo4wAtLqhQYS71qK+QKOFRywmGK/kpikzV6WMKhh58vGWs4TIJNjiEYLIuP8Tt4/zmLyqk+AyrJSbF+Qq1DgqRUPMxyl+9q3IQhX/rMCJ6tEunriDs1oSyQZKlr9AkhT2ZIARbJfaJS1vtVbHB+Rgi0RK/y1q1BWsEEyLoz40xtGKcARPVWB1BTPO7f4LNtpkUl1aoMbViLyZo0GRjPD3BxnxjqXeLYlvhqYrzMMG3HoyJXa3JjfnGlbYYFlP7Jh3qKsKY4hQ7TY0nG+xwRL61n63mxHtqNHosigyMLmClNwvuecFnOZB88nNBDzNkzhxEZaKMBVoKapggMzvHHXBEpNSSFAvtcFRsVn0bW8LlMmcXs+c0Kne3gRR32+zg4uXwjC6zit6Wt4a8LXVfcp/MtQXHn2ynGbuCmb8GvvFeJLEE82ReU9/n6+dkq2x3buG9Wn94smcgAw631RPR7BTH+kbmHReZoEpOdEe7zWqZl40s0JWs9Hmv7hjBHqPDwsjGKVJnWWqjbdZp1KhJi0aPmxYZsIRhlttgeF+Jlke41QcOQKoqilSb6HJzSvNG3G/UoWnxwsmt+sVaYwd63dRbqdnMyCPVeyRPvpYgdavM22oGKoMUVRbJfOWMwidJ8Zzb1UvmWK/VVUXzHaTjjrVYh1897HT7xxYEVUaa5SWb/WO+YUWa9SrwvigzM8YlzlYv2GSdVCYxxlBtVnnFq5olwp5/BEk/OLsf5LUmG2+inRJdVvjZ97ZH9/zP34ug1O91pf4p+D+JYBpvrKxfbwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNC0xMS0xMFQwMzoxMjowOS0wNTowMB9ViV0AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTQtMTEtMTBUMDM6MTI6MDktMDU6MDBuCDHhAAAAAElFTkSuQmCC",height:20,width:20,type:"esriPMS",angle:0}),i=e.map((r,s)=>{let l;if(s!==e.length-1)if(s===0)l={minValue:r,maxValue:e[s+1],symbol:a};else{const u=De.fromJSON({type:"esriPMS",imageData:t[s].imageData,contentType:"image/svg+xml",height:32,width:32,angle:0});l={minValue:r,maxValue:e[s+1],symbol:u}}return new tt(l)});return{defaultSymbol:a,classBreakInfos:i}}_getClassBreaks(e,t){return t.map((a,i)=>new tt({minValue:e[i],maxValue:e[i+1],symbol:this._getDefaultSymbol(new h(a))}))}};n([o({type:String,json:{write:!0}})],f.prototype,"attributeField",void 0),n([o({type:oe.apiValues,json:{type:oe.jsonValues,read:{reader:oe.read},write:{writer:oe.write}}})],f.prototype,"flowRepresentation",void 0),n([o({type:["geographic","arithmetic"],json:{write:!0}})],f.prototype,"rotationType",void 0),n([o({type:ne.apiValues,json:{type:ne.jsonValues,read:{reader:ne.read},write:{writer:ne.write}}})],f.prototype,"style",void 0),n([o({json:{write:!0}})],f.prototype,"symbolTileSize",void 0),n([o({type:k.apiValues,json:{type:k.jsonValues,write:{writer:k.write}}})],f.prototype,"inputUnit",void 0),n([z("inputUnit")],f.prototype,"readInputUnit",null),n([o({type:k.apiValues,json:{type:k.jsonValues,read:{reader:k.read},write:{writer:k.write}}})],f.prototype,"outputUnit",void 0),n([z("outputUnit")],f.prototype,"readOutputUnit",null),n([W({vectorField:"vector-field"})],f.prototype,"type",void 0),n([o({type:Ie})],f.prototype,"styleRenderer",null),n([o({type:gt})],f.prototype,"sizeVariables",null),n([o({type:mt})],f.prototype,"rotationVariables",null),f=xe=n([v("esri.renderers.VectorFieldRenderer")],f);const Ge=f,rt={key:"type",base:null,typeMap:{"unique-value":Ze,"class-breaks":Ie,"raster-colormap":Pe,"raster-stretch":Ve,"vector-field":Ge,"raster-shaded-relief":bt,flow:ft}},nt={...rt,typeMap:{...rt.typeMap}};delete nt.typeMap["vector-field"],delete nt.typeMap.flow;const ui={uniqueValue:Ze,classBreaks:Ie,rasterStretch:Ve,rasterColormap:Pe,vectorField:Ge,rasterShadedRelief:bt,flowRenderer:ft};function pi(e){return e&&ui[e.type]||null}function Wi(e,t){if(!e)return null;if(e.type==="classBreaks"&&e.classificationMethod){const i=e.authoringInfo||{classificationMethod:""};i.classificationMethod=e.classificationMethod,e.authoringInfo=i}e.type==="vectorField"&&e.visualVariables&&!Array.isArray(e.visualVariables)&&(e.visualVariables=[e.visualVariables]);const a=pi(e);if(a){const i=new a;return i.read(e,t),i}return t!=null&&t.messages&&e&&t.messages.push(new Ht("renderer:unsupported","Renderers of type '"+(e.type||"unknown")+"' are not supported",{definition:e,context:t})),null}const Fi=q()({RSP_NearestNeighbor:"nearest",RSP_BilinearInterpolation:"bilinear",RSP_CubicConvolution:"cubic",RSP_Majority:"majority"}),_i=q()({esriNoDataMatchAny:"any",esriNoDataMatchAll:"all"}),be=q()({U1:"u1",U2:"u2",U4:"u4",U8:"u8",S8:"s8",U16:"u16",S16:"s16",U32:"u32",S32:"s32",F32:"f32",F64:"f64",C64:"c64",C128:"c128",UNKNOWN:"unknown"});let E=class extends S{constructor(){super(...arguments),this.pixelType="unknown"}};n([o({type:String,json:{write:!0}})],E.prototype,"name",void 0),n([o({type:String,json:{write:!0}})],E.prototype,"description",void 0),n([o({type:P,json:{type:P,write:!0,name:"_object_id"}})],E.prototype,"id",void 0),n([o({type:String,json:{type:be.jsonValues,read:be.read,write:be.write}})],E.prototype,"pixelType",void 0),n([o({type:String,json:{write:!0}})],E.prototype,"type",void 0),E=n([v("esri.layers.support.RasterFunctionInfo")],E);const di=E;let H=class extends S{constructor(){super(...arguments),this.isDataset=!1,this.isPublic=!1,this.type="RasterFunctionVariable"}};n([o({type:String,json:{write:!0}})],H.prototype,"name",void 0),n([o({type:Number,json:{type:P,write:!0,name:"_object_id"}})],H.prototype,"id",void 0),n([o({type:Boolean,json:{write:!0}})],H.prototype,"isDataset",void 0),n([o({type:Boolean,json:{write:!0}})],H.prototype,"isPublic",void 0),n([o({json:{write:!0}})],H.prototype,"value",void 0),n([o({type:String,json:{write:!0}})],H.prototype,"type",void 0),H=n([v("esri.layers.support.RasterFunctionVariable")],H);const Mi=H,se={key:"type",base:null,typeMap:{RasterFunctionVariable:Mi}};let V=class extends S{};n([o({types:se,json:{types:se,name:"MatchVariable"}})],V.prototype,"matchVariable",void 0),n([o({types:se,json:{types:se,name:"UnionDimension"}})],V.prototype,"unionDimension",void 0),n([o({type:Number,json:{type:P,write:!0,name:"_object_id"}})],V.prototype,"id",void 0),n([o({type:String,json:{write:!0}})],V.prototype,"type",void 0),V=n([v("esri.layers.support.RasterFunctionProperties")],V);const gi=V,je=new ge({0:"mosaic",1:"item",2:"item-group"},{useNumericKeys:!0});let I=class extends S{constructor(){super(...arguments),this.functionType="mosaic",this.type="RasterFunctionTemplate"}};n([o({type:[String],json:{write:!0}})],I.prototype,"aliases",void 0),n([o({type:Object,json:{write:!0}})],I.prototype,"arguments",void 0),n([o({type:String,json:{write:!0}})],I.prototype,"description",void 0),n([o({type:di,json:{write:!0,name:"function"}})],I.prototype,"functionInfo",void 0),n([o({type:je.apiValues,json:{type:[0,1,2],read:je.read,write:je.write}})],I.prototype,"functionType",void 0),n([o({type:String,json:{write:!0}})],I.prototype,"group",void 0),n([o({type:String,json:{write:!0}})],I.prototype,"help",void 0),n([o({type:Number,json:{type:P,write:!0,name:"_object_id"}})],I.prototype,"id",void 0),n([o({type:String,json:{write:!0}})],I.prototype,"name",void 0),n([o({type:String,json:{write:!0,name:"definition"}})],I.prototype,"queryDefinition",void 0),n([o({type:String,json:{write:!0}})],I.prototype,"tag",void 0),n([o({type:gi,json:{write:!0}})],I.prototype,"properties",void 0),n([o({type:String,json:{write:!0}})],I.prototype,"thumbnail",void 0),n([o({type:String,json:{write:!0}})],I.prototype,"thumbnailEx",void 0),n([o({json:{type:["RasterFunctionTemplate"],write:!0}})],I.prototype,"type",void 0),I=n([v("esri.layers.support.RasterFunctionTemplate")],I);const jt=I;var Be;const ce=new Set(["raster","raster2","dem","fillraster"]),ue=new Set(["rasters"]),ot=e=>e!=null&&e.rasterFunction?D.fromJSON(e):e,ve=e=>e&&e instanceof D?e.toJSON():e,ze=e=>(e==null?void 0:e.functionName)&&!e.declaredClass,st=e=>ze(e)?new D(e):e,mi=e=>{if(e==null)return null;e=b(e);const t={};for(const a of Object.keys(e))ce.has(a.toLowerCase())?t[a]=ot(e[a]):ue.has(a.toLowerCase())&&Array.isArray(e[a])?t[a]=e[a].map(ot):t[a]=e[a];return t},yi={types:{key:"type",base:null,typeMap:{RasterFunctionTemplate:jt}},json:{write:!0,name:"rasterFunctionDefinition"}};let D=Be=class extends S{constructor(e){super(e),this.functionName=null,this.outputPixelType="unknown",this.variableName=null,this.functionDefinition=null}set functionArguments(e){if(e){const t=Object.keys(e);if(t.some(a=>ce.has(a.toLowerCase())&&ze(e[a]))||t.some(a=>ue.has(a.toLowerCase())&&Array.isArray(e[a])&&e[a].some(i=>ze(i)))){e=b(e);for(const a of t)ce.has(a.toLowerCase())?e[a]=st(e[a]):ue.has(a.toLowerCase())&&Array.isArray(e[a])&&(e[a]=e[a].map(i=>st(i)))}}this._set("functionArguments",e)}readFunctionArguments(e){return mi(e)}writeFunctionArguments(e,t,a){const i={};for(const r of Object.keys(e))ce.has(r.toLowerCase())?i[r]=ve(e[r]):ue.has(r.toLowerCase())&&Array.isArray(e[r])?i[r]=e[r].map(ve):i[r]=ve(e[r]);t[a]=i}readFunctionName(e,t){const a=t.rasterFunctionInfos;return t.name||(a!=null&&a.length&&a[0].name!=="None"?a[0].name:t.rasterFunctionDefinition?t.rasterFunctionDefinition.name:t.rasterFunction)}get rasterFunctionDefinition(){var e;return(e=this.functionDefinition)==null?void 0:e.toJSON()}set rasterFunctionDefinition(e){this.functionDefinition=e?jt.fromJSON(e):null}get hasClipFunction(){return this.rasterFunctionDefinition?JSON.stringify(this.rasterFunctionDefinition).includes('"type":"ClipFunction"'):JSON.stringify(this).includes('"rasterFunction":"Clip"')}clone(){return new Be({functionName:this.functionName,functionArguments:b(this.functionArguments),outputPixelType:this.outputPixelType,variableName:this.variableName,rasterFunctionDefinition:b(this.rasterFunctionDefinition)})}};n([o({json:{type:Object,name:"rasterFunctionArguments"}})],D.prototype,"functionArguments",null),n([z("functionArguments")],D.prototype,"readFunctionArguments",null),n([me("functionArguments")],D.prototype,"writeFunctionArguments",null),n([o({json:{type:String,write:{target:"rasterFunction"}}})],D.prototype,"functionName",void 0),n([z("functionName",["rasterFunction","rasterFunctionInfos","rasterFunctionDefinition"])],D.prototype,"readFunctionName",null),n([W({C128:"c128",C64:"c64",F32:"f32",F64:"f64",S16:"s16",S32:"s32",S8:"s8",U1:"u1",U16:"u16",U2:"u2",U32:"u32",U4:"u4",U8:"u8",UNKNOWN:"unknown"},{ignoreUnknown:!1}),o({json:{default:"unknown"}})],D.prototype,"outputPixelType",void 0),n([o({type:String,json:{read:!0,write:!0}})],D.prototype,"variableName",void 0),n([o()],D.prototype,"rasterFunctionDefinition",null),n([o(yi)],D.prototype,"functionDefinition",void 0),n([o()],D.prototype,"hasClipFunction",null),D=Be=n([v("esri.layers.support.RasterFunction")],D);const Me=D;var Ue;const Q=q()({MT_FIRST:"first",MT_LAST:"last",MT_MIN:"min",MT_MAX:"max",MT_MEAN:"mean",MT_BLEND:"blend",MT_SUM:"sum"}),Re=q()({esriMosaicNone:"none",esriMosaicCenter:"center",esriMosaicNadir:"nadir",esriMosaicViewpoint:"viewpoint",esriMosaicAttribute:"attribute",esriMosaicLockRaster:"lock-raster",esriMosaicNorthwest:"northwest",esriMosaicSeamline:"seamline"});function Ii(e){let t;switch(e?e.toLowerCase().replace("esrimosaic",""):""){case"byattribute":case"attribute":t="esriMosaicAttribute";break;case"lockraster":t="esriMosaicLockRaster";break;case"center":t="esriMosaicCenter";break;case"northwest":t="esriMosaicNorthwest";break;case"nadir":t="esriMosaicNadir";break;case"viewpoint":t="esriMosaicViewpoint";break;case"seamline":t="esriMosaicSeamline";break;default:t="esriMosaicNone"}return Re.fromJSON(t)}let m=Ue=class extends S{constructor(e){super(e),this.ascending=!0,this.itemRasterFunction=null,this.lockRasterIds=null,this.method=null,this.multidimensionalDefinition=null,this.objectIds=null,this.operation=null,this.sortField=null,this.sortValue=null,this.viewpoint=null,this.where=null}readAscending(e,t){return t.ascending!=null?t.ascending:t.sortAscending==null||t.sortAscending}get itemRenderingRule(){return pe(de.getLogger(this),"itemRenderingRule",{replacement:"itemRasterFunction",version:"4.27",warnOnce:!0}),this._get("itemRasterFunction")}set itemRenderingRule(e){pe(de.getLogger(this),"itemRenderingRule",{replacement:"itemRasterFunction",version:"4.27",warnOnce:!0}),this._set("itemRasterFunction",e)}readMethod(e,t){return Ii(t.mosaicMethod||t.defaultMosaicMethod)}writeMultidimensionalDefinition(e,t,a){e!=null&&(e=e.filter(({variableName:i,dimensionName:r})=>i&&i!=="*"||r)).length&&(t[a]=e.map(i=>i.toJSON()))}readOperation(e,t){var s;const a=t.mosaicOperation,i=(s=t.mosaicOperator)==null?void 0:s.toLowerCase(),r=a||(i?Q.toJSON(i):null);return Q.fromJSON(r)||"first"}castSortValue(e){return e==null||typeof e=="string"||typeof e=="number"?e:`${e}`}clone(){return new Ue({ascending:this.ascending,itemRasterFunction:b(this.itemRasterFunction),lockRasterIds:b(this.lockRasterIds),method:this.method,multidimensionalDefinition:b(this.multidimensionalDefinition),objectIds:b(this.objectIds),operation:this.operation,sortField:this.sortField,sortValue:this.sortValue,viewpoint:b(this.viewpoint),where:this.where})}};n([o({type:Boolean,json:{write:!0}})],m.prototype,"ascending",void 0),n([z("ascending",["ascending","sortAscending"])],m.prototype,"readAscending",null),n([o({type:Me,json:{name:"itemRenderingRule",write:!0}})],m.prototype,"itemRasterFunction",void 0),n([o({type:Me})],m.prototype,"itemRenderingRule",null),n([o({type:[P],json:{write:{overridePolicy(){return{enabled:this.method==="lock-raster"}}}}})],m.prototype,"lockRasterIds",void 0),n([o({type:String,json:{type:Re.jsonValues,write:{target:"mosaicMethod",writer:Re.write}}})],m.prototype,"method",void 0),n([z("method",["mosaicMethod","defaultMosaicMethod"])],m.prototype,"readMethod",null),n([o({type:[pt],json:{write:!0}})],m.prototype,"multidimensionalDefinition",void 0),n([me("multidimensionalDefinition")],m.prototype,"writeMultidimensionalDefinition",null),n([o({type:[P],json:{name:"fids",write:!0}})],m.prototype,"objectIds",void 0),n([o({json:{type:Q.jsonValues,read:{reader:Q.read},write:{target:"mosaicOperation",writer:Q.write}}})],m.prototype,"operation",void 0),n([z("operation",["mosaicOperation","mosaicOperator"])],m.prototype,"readOperation",null),n([o({type:String,json:{write:{overridePolicy(){return{enabled:this.method==="attribute"}}}}})],m.prototype,"sortField",void 0),n([o({type:[String,Number],json:{write:{allowNull:!0,overridePolicy(){return{enabled:this.method==="attribute",allowNull:!0}}}}})],m.prototype,"sortValue",void 0),n([kt("sortValue")],m.prototype,"castSortValue",null),n([o({type:ye,json:{write:!0}})],m.prototype,"viewpoint",void 0),n([o({type:String,json:{write:!0}})],m.prototype,"where",void 0),m=Ue=n([v("esri.layers.support.MosaicRule")],m);const wi=m;var He;const hi={base:Zt,key:"type",typeMap:{extent:Se,polygon:Et}};let G=He=class extends S{constructor(e){super(e),this.areaOfInterest=null,this.subsetDefinitions=null}get dimensions(){const{subsetDefinitions:e}=this;if(e==null||e.length===0)return[];const t=new Map;e.forEach(i=>{if(!i.dimensionName)return;let r,s;if(Array.isArray(i.values[0])){const l=i.values;r=l[0][0],s=l[i.values.length-1][1]}else{const l=i.values;r=l[0],s=l[i.values.length-1]}if(t.has(i.dimensionName)){const l=t.get(i.dimensionName);l[0]=Math.min(r,l[0]),l[1]=Math.max(s,l[1])}else t.set(i.dimensionName,[r,s])});const a=[];for(const i of t)a.push({name:i[0],extent:i[1]});return a}get variables(){const{subsetDefinitions:e}=this;if(e==null||e.length===0)return[];const t=new Set;return e.forEach(a=>{a.variableName&&t.add(a.variableName)}),[...t]}clone(){var a;const e=(a=this.subsetDefinitions)==null?void 0:a.map(i=>i.clone()),t=this.areaOfInterest?this.areaOfInterest.clone():this.areaOfInterest;return new He({areaOfInterest:t,subsetDefinitions:e})}};n([o({types:hi,json:{read:ut,write:!0}})],G.prototype,"areaOfInterest",void 0),n([o({readOnly:!0})],G.prototype,"dimensions",null),n([o({readOnly:!0})],G.prototype,"variables",null),n([o({type:[pt],json:{write:!0}})],G.prototype,"subsetDefinitions",void 0),G=He=n([v("esri.layers.support.MultidimensionalSubset")],G);const Xi=G;class qi{constructor(){this._workerThread=null,this._destroyed=!1}async initialize(){const t=await Pt("RasterWorker");this._destroyed?t.close():this._workerThread=t}destroy(){this._destroyed=!0,this._workerThread&&(this._workerThread.close(),this._workerThread=null)}async convertVectorFieldData(t,a){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const i=await this._workerThread.invoke("convertVectorFieldData",{pixelBlock:t.pixelBlock.toJSON(),type:t.dataType},a);return i?new Z(i):null}computeStatisticsHistograms(t,a){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");return this._workerThread.invoke("computeStatisticsHistograms",{pixelBlock:t.pixelBlock.toJSON()},a)}async decode(t,a){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const i=await this._workerThread.invoke("decode",t,a);return i?new Z(i):null}async symbolize(t,a){var s,l;if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const i={extent:(s=t.extent)==null?void 0:s.toJSON(),pixelBlock:(l=t.pixelBlock)==null?void 0:l.toJSON(),simpleStretchParams:t.simpleStretchParams,bandIds:t.bandIds},r=await this._workerThread.invoke("symbolize",i,a);return r?new Z(r):null}async updateSymbolizer(t,a){var r;if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const i=(r=t==null?void 0:t.rendererJSON)==null?void 0:r.histograms;await Promise.all(this._workerThread.broadcast("updateSymbolizer",{symbolizerJSON:t.toJSON(),histograms:i},a))}async updateRasterFunction(t,a){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");await Promise.all(this._workerThread.broadcast("updateRasterFunction",{rasterFunctionJSON:t.toJSON()},a))}async process(t,a){var r,s;if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const i=await this._workerThread.invoke("process",{extent:(r=t.extent)==null?void 0:r.toJSON(),primaryPixelSizes:(s=t.primaryPixelSizes)==null?void 0:s.map(l=>l!=null?l.toJSON():null),primaryPixelBlocks:t.primaryPixelBlocks.map(l=>l!=null?l.toJSON():null),primaryRasterIds:t.primaryRasterIds},a);return i?new Z(i):null}async stretch(t,a){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!(t!=null&&t.pixelBlock))return null;const i={srcPixelBlock:t.pixelBlock.toJSON(),stretchParams:t.stretchParams},r=await this._workerThread.invoke("stretch",i,a);return r?new Z(r):null}async split(t,a){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!(t!=null&&t.pixelBlock))return null;const i={srcPixelBlock:t.pixelBlock.toJSON(),tileSize:t.tileSize,maximumPyramidLevel:t.maximumPyramidLevel,useBilinear:t.useBilinear},r=await this._workerThread.invoke("split",i,a);return r&&r.forEach((s,l)=>{r.set(l,s?Z.fromJSON(s):null)}),r}async clipTile(t,a){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!(t!=null&&t.pixelBlock))return null;const i={...t,pixelBlock:t.pixelBlock.toJSON()},r=await this._workerThread.invoke("clipTile",i,a);return r?Z.fromJSON(r):null}async estimateStatisticsHistograms(t,a){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!(t!=null&&t.pixelBlock))return null;const i={srcPixelBlock:t.pixelBlock.toJSON()};return await this._workerThread.invoke("estimateStatisticsHistograms",i,a)}async mosaicAndTransform(t,a){var s;if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!((s=t==null?void 0:t.srcPixelBlocks)!=null&&s.length))return{pixelBlock:null};const i={...t,srcPixelBlocks:t.srcPixelBlocks.map(l=>l!=null?l.toJSON():null)},r=await this._workerThread.invoke("mosaicAndTransform",i,a);return{pixelBlock:r.pixelBlock?new Z(r.pixelBlock):null,localNorthDirections:r.localNorthDirections}}async createFlowMesh(t,a){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const i={buffer:t.flowData.data.buffer,maskBuffer:t.flowData.mask.buffer,width:t.flowData.width,height:t.flowData.height},{meshType:r,simulationSettings:s}=t,l=await this._workerThread.invoke("createFlowMesh",{meshType:r,flowData:i,simulationSettings:s},{...a,transferList:[i.buffer,i.maskBuffer]});return{vertexData:new Float32Array(l.vertexBuffer),indexData:new Uint32Array(l.indexBuffer)}}getProjectionOffsetGrid(t,a){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const i=t.datumTransformation!=null?t.datumTransformation.steps.map(l=>({wkid:l.wkid,wkt:l.wkt,isInverse:l.isInverse})):null,r=t.rasterTransform!=null?t.rasterTransform.toJSON():null,s={projectedExtent:t.projectedExtent.toJSON(),srcBufferExtent:t.srcBufferExtent.toJSON(),pixelSize:t.pixelSize,hasWrapAround:t.hasWrapAround,spacing:t.spacing,datumTransformationSteps:i,rasterTransform:r,isAdaptive:t.isAdaptive,includeGCSGrid:t.includeGCSGrid};return this._workerThread.invoke("getProjectionOffsetGrid",s,a)}}const Ai=.25,fi=At.fromJSON({type:"multipart",colorRamps:[{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]}),lt=At.fromJSON(ei[0]),vt=new Set(["scientific","standard-time","vector-uv","vector-magdir","vector-u","vector-v","vector-magnitude","vector-direction"]);function Yi(e,t){const{attributeTable:a,colormap:i}=e;if(Ee(e)){const r=xi(e);if(r!=null)return r}if(i!=null){const r=Ni(e);if(r!=null)return r}if(a!=null){const r=Ti(e);if(r!=null)return r}return Di(e,t)}function ea(e,t=!1){const a=["raster-stretch"];return yt(e,t)&&a.push("raster-colormap"),It(e)&&a.push("unique-value"),ti(e,t)&&a.push("class-breaks"),ii(e)&&a.push("raster-shaded-relief"),Ee(e)&&a.push("vector-field"),ai(e)&&a.push("flow"),a}function ta(e,t,a){const i=["nearest","bilinear","cubic","majority"].find(r=>r===(a==null?void 0:a.toLowerCase()));return t==="Map"?i??"bilinear":e.dataType==="standard-time"?i??"nearest":e.dataType==="thematic"||e.attributeTable||e.colormap?i==="nearest"||i==="majority"?i:"nearest":i??"bilinear"}function Di(e,t){e=bi(e,t==null?void 0:t.variableName);const{bandCount:a}=e;let{bandIds:i,stretchType:r}=t||{};i!=null&&i.some(M=>M>=a)&&(i=null);let s=e.statistics,l=e.histograms;a>1?(i=i!=null&&i.length?i:ji(e),s=s==null?null:i==null?void 0:i.map(M=>s[M]),l=l==null?null:i==null?void 0:i.map(M=>l[M])):i=[0],r==null&&(r=Si(e));let u=!1;switch(r){case"none":u=!1;break;case"percent-clip":u=!(l!=null&&l.length);break;default:u=!(s!=null&&s.length)}const{dataType:y}=e,c=(i==null?void 0:i.length)===1&&vt.has(y)?fi:null,w=new Ve({stretchType:r,dynamicRangeAdjustment:u,colorRamp:c,outputMin:0,outputMax:255,gamma:(i==null?void 0:i.length)===1?[1]:[1,1,1],useGamma:!1});return r==="percent-clip"?w.maxPercent=w.minPercent=Ai:r==="standard-deviation"&&(w.numberOfStandardDeviations=2),u||e.multidimensionalInfo==null&&!(t!=null&&t.includeStatisticsInStretch)||(r==="percent-clip"?w.histograms=l:r!=="min-max"&&r!=="standard-deviation"||(w.statistics=s)),w}function bi(e,t){const{multidimensionalInfo:a}=e;if(!t||!a)return e;const i=a.variables.find(r=>r.name===t);if(!i)return e;if(e=e.clone(),i){const{statistics:r,histograms:s}=i;r!=null&&r.length&&(e.statistics=r.map(l=>({min:l.min,max:l.max,avg:l.avg,stddev:l.stddev}))),s!=null&&s.length&&(e.histograms=s)}return e}function ji(e){const t=e.bandCount;if(t===1)return null;if(t===2)return[0];const{bandInfos:a}=e;let i;if(a.length===t){const{red:r,green:s,blue:l,nir:u}=vi(a);r!=null&&s!=null&&l!=null?i=[r,s,l]:u!=null&&r!=null&&s!=null&&(i=[u,r,s])}return!i&&t>=3&&(i=[0,1,2]),i}function vi(e){const t={};for(let a=0;a=410&&s<=480&&l>=480&&l<=540?t.blue=a:t.green==null&&s>=490&&s<=560&&l>=560&&l<=610?t.green=a:t.red==null&&s>=595&&s<=670&&l>=660&&l<=730?t.red=a:t.nir==null&&s>=700&&s<=860&&l>=800&&l<=950&&(t.nir=a)}}return t}function Si(e){let t="percent-clip";const{pixelType:a,dataType:i,histograms:r,statistics:s,multidimensionalInfo:l}=e,u=vt.has(i)||i==="generic"&&l!=null;return a!=="u8"||i!=="processed"&&r!=null&&s!=null?a==="u8"||i==="elevation"||u?t="min-max":r!=null?t="percent-clip":s!=null&&(t="min-max"):t="none",t}function Ti(e,t,a,i){if(!It(e,t))return null;const{attributeTable:r,statistics:s}=e,l=St(r,t),u=X(r,"red"),y=X(r,"green"),c=X(r,"blue"),w=new Mt,M=[],U=new Set,N=!!(u&&y&&c);if(r!=null)r.features.forEach(p=>{const d=p.attributes[l.name];if(!U.has(p.attributes[l.name])&&d!=null){U.add(d);const L=N&&(u.type==="single"||u.type==="double")&&(y.type==="single"||y.type==="double")&&(c.type==="single"||c.type==="double")&&!r.features.some(R=>R.attributes[u.name]>1||R.attributes[y.name]>1||R.attributes[c.name]>1),B=L?255:1;M.push(new it({value:p.attributes[l.name],label:p.attributes[l.name]+"",symbol:{type:"simple-fill",style:"solid",outline:null,color:new h(N?[p.attributes[u.name]*B,p.attributes[y.name]*B,p.attributes[c.name]*B,1]:[0,0,0,0])}}))}});else if(s!=null&&s[0])for(let p=s[0].min;p<=s[0].max;p++)M.push(new it({value:p,label:p.toString(),symbol:{type:"simple-fill",style:"solid",outline:null,color:new h([0,0,0,0])}}));if(M.sort((p,d)=>p.value&&typeof p.value.valueOf()=="string"?0:p.value>d.value?1:-1),!N){const p=Te(lt,{numColors:M.length});M.forEach((d,L)=>d.symbol.color=new h(p[L].slice(1,4))),w.colorRamp=lt}if(a||i){const p=a||Te(i,{numColors:M.length}).map(d=>d.slice(1));M.forEach((d,L)=>d.symbol.color=new h(p[L])),w.colorRamp=i}return new Ze({field:l.name,uniqueValueInfos:M,authoringInfo:w})}function St(e,t,a){let i;return e!=null?(i=t?e.fields.find(r=>t.toLowerCase()===r.name.toLowerCase()):Ci(e.fields),i||(a||(i=e.fields.find(r=>r.type==="string")),i||(i=X(e,"value")))):i=new Vt({name:"value"}),i}function Ci(e){let t;for(let a=0;aa.name.toLowerCase()===t)}function Ni(e){if(!yt(e))return null;let t;const{attributeTable:a,colormap:i}=e;if(a!=null){const r=X(a,"value"),s=St(a,null,!0);s.type==="string"&&(t={},a.features.forEach(l=>{const u=l.attributes;t[u[r.name]]=s?u[s.name]:u[r.name]}))}return Pe.createFromColormap(i,t)}const Li=new Map([["m/s","meter-per-second"],["km/h","kilometer-per-hour"],["knots","knots"],["ft/s","feet-per-second"],["mph","mile-per-hour"]]);function xi(e){if(!Ee(e))return null;let t;if(e.statistics!=null&&e.statistics.length&&(e.dataType==="vector-magdir"||e.dataType==="vector-uv")){const{minMagnitude:r,maxMagnitude:s}=Bi(e.dataType,e.statistics);t=[{type:"size",field:"Magnitude",minSize:10,maxSize:40,minDataValue:r,maxDataValue:s}]}const a=e.multidimensionalInfo!=null?Li.get(e.multidimensionalInfo.variables[0].unit):null,i=new Ge({visualVariables:t,inputUnit:a,rotationType:"geographic"});return i.visualVariables=[...i.sizeVariables,...i.rotationVariables],i}function ct(e){var t;return{color:(t=e.symbolLayers[0].material)==null?void 0:t.color,type:"esriSFS",style:"esriSFSSolid"}}function ia(e){var t,a;if(e.type==="uniqueValue"){const i=e.uniqueValueInfos,r=i==null?void 0:i[0].symbol;return(t=r==null?void 0:r.symbolLayers)!=null&&t.length&&(e.uniqueValueInfos=i==null?void 0:i.map(s=>({value:s.value,label:s.label,symbol:s.symbol?ct(s.symbol):null}))),e}if(e.type==="classBreaks"){const i=e.classBreakInfos,r=i[0].symbol;return(a=r==null?void 0:r.symbolLayers)!=null&&a.length&&(e.classBreakInfos=i.map(s=>({classMinValue:s.classMinValue,classMaxValue:s.classMaxValue,label:s.label,symbol:s.symbol?ct(s.symbol):null}))),e}return e}function Bi(e,t){let a,i;if(e==="vector-magdir")a=t[0].min,i=t[0].max;else{const r=t[0].min,s=t[0].max,l=t[1].min,u=t[1].max;a=0,i=Math.max(Math.abs(r),Math.abs(l),Math.abs(s),Math.abs(u))}return{minMagnitude:a,maxMagnitude:i}}async function Tt(e,t,a){var Je,We,Fe,_e,$e,Ke,Qe,Xe,qe,Ye;const i=Gt(e),{rasterFunction:r,sourceJSON:s}=t||{},l=r?JSON.stringify(r.rasterFunctionDefinition||r):null,u=Ot({...i.query,renderingRule:l,f:"json"}),y=Jt(u,a);e=i.path;const c=s||await O(e,y).then(T=>T.data),w=c.hasRasterAttributeTable?O(`${e}/rasterAttributeTable`,y):null,M=c.hasColormap?O(`${e}/colormap`,y):null,U=c.hasHistograms?O(`${e}/histograms`,y):null,N=c.currentVersion>=10.3?O(`${e}/keyProperties`,y):null,p=c.hasMultidimensions?O(`${e}/multidimensionalInfo`,y):null,d=await Promise.allSettled([w,M,U,N,p]);let L=null;if(c.minValues&&c.minValues.length===c.bandCount){L=[];for(let T=0;T{var et;(et=T.statistics)!=null&&et.length&&T.statistics.forEach(ae=>{ae.avg=ae.mean,ae.stddev=ae.standardDeviation})});const{defaultVariable:he,serviceDataType:_}=c;he&&he!==F.DefaultVariable&&(F.DefaultVariable=he),_!=null&&_.includes("esriImageServiceDataTypeVector")&&!_.includes(F.DataType)&&(F.DataType=_.replace("esriImageServiceDataType",""));let Ae=c.noDataValue;return(Ye=c.noDataValues)!=null&&Ye.length&&c.noDataValues.some(T=>T!==Ae)&&(Ae=c.noDataValues),new ri({width:R,height:Ct,bandCount:c.bandCount,extent:Se.fromJSON(c.extent),spatialReference:Oe,pixelSize:new ye({x:c.pixelSizeX,y:c.pixelSizeY,spatialReference:Oe}),pixelType:c.pixelType.toLowerCase(),statistics:L,attributeTable:Nt,colormap:Lt,histograms:xt,keyProperties:F,noDataValue:Ae,multidimensionalInfo:we})}function aa(e,t,a){return Tt(e,{sourceJSON:t},a)}function ra(e,t,a){return Tt(e,{rasterFunction:t},a)}function na(e,t){e.attributeTable||(t.hasRasterAttributeTable=!1),e.histograms||(t.hasHistograms=!1),e.colormap||(t.hasColormap=!1),e.multidimensionalInfo||(t.hasMultidimensions=!1)}var ke;let x=ke=class extends S{constructor(){super(...arguments),this.geometry=null,this.mosaicRule=null,this.rasterFunction=null,this.pixelSize=null,this.raster=void 0,this.timeExtent=null}writeGeometry(e,t,a){e!=null&&(t.geometryType=$t(e),t[a]=e.toJSON())}get renderingRule(){return pe(de.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._get("rasterFunction")}set renderingRule(e){pe(de.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._set("rasterFunction",e)}clone(){return new ke(b({geometry:this.geometry,mosaicRule:this.mosaicRule,rasterFunction:this.rasterFunction,pixelSize:this.pixelSize,raster:this.raster,timeExtent:this.timeExtent}))}};n([o({types:Ft,json:{read:ut}})],x.prototype,"geometry",void 0),n([me("geometry")],x.prototype,"writeGeometry",null),n([o({type:wi,json:{write:!0}})],x.prototype,"mosaicRule",void 0),n([o({type:Me})],x.prototype,"renderingRule",null),n([o({type:Me,json:{write:!0,name:"renderingRule"}})],x.prototype,"rasterFunction",void 0),n([o({type:ye,json:{write:!0}})],x.prototype,"pixelSize",void 0),n([o({json:{write:!0}})],x.prototype,"raster",void 0),n([o({type:_t,json:{read:{source:"time"},write:{target:"time"}}})],x.prototype,"timeExtent",void 0),x=ke=n([v("esri.rest.support.ImageHistogramParameters")],x);const oa=x;export{bi as B,ji as E,ia as K,Me as N,ta as S,Yi as V,Wi as a,Fi as b,Xi as c,nt as d,ra as f,oa as h,_i as i,wi as j,ea as k,rt as l,aa as m,be as n,na as p,qi as t}; diff --git a/assets/ImageryLayer-Dz6vNBYB.js b/assets/ImageryLayer-BuJz_D0q.js similarity index 98% rename from assets/ImageryLayer-Dz6vNBYB.js rename to assets/ImageryLayer-BuJz_D0q.js index 8282a6a..3003db0 100644 --- a/assets/ImageryLayer-Dz6vNBYB.js +++ b/assets/ImageryLayer-BuJz_D0q.js @@ -1,7 +1,7 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/imageryUtils-Bct433Ji.js","assets/utils-2LBmsoaQ.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css","assets/originUtils-D69mHv66.js","assets/multiOriginJSONSupportUtils-C0wm8_Yw.js","assets/saveAPIKeyUtils-BiX1lQSW.js","assets/saveUtils-BzCRy3uR.js"] + __vite__mapDeps.viteFileDeps = ["assets/imageryUtils-CP_eOmeO.js","assets/utils-iOpWi7jV.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css","assets/originUtils-D69mHv66.js","assets/multiOriginJSONSupportUtils-C0wm8_Yw.js","assets/saveAPIKeyUtils-YRBbgdzi.js","assets/saveUtils-CGGzyvzv.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{aV as Q,d as r,y as o,aR as T,f as b,aU as P,aA as A,aS as se,i2 as be,i1 as ot,lU as lt,aZ as V,aB as Ze,aE as ze,a$ as oe,b0 as te,aW as M,eq as z,ep as U,M as D,dj as Ne,dP as wt,b4 as Se,dS as Be,aY as kt,cF as ie,c9 as Wt,lV as Zt,b2 as Pt,jD as Ve,s as we,aD as Kt,a_ as Fe,fC as Xt,du as Yt,bW as ei,N as I,er as $,aX as mt,g as ti,j as ii,lW as ri,hQ as si,bP as ni,bQ as ai,dp as oi,dq as li,dO as ui,dM as pi,dr as ci,k as mi,ay as di,dt as yi,fD as hi,i as gi,bT as fi,_ as wi}from"./index-CEWggaxV.js";import{N as S,b as ve,i as Ue,j as k,c as Ri,l as vi,d as bi,n as dt,a as Si,h as yt,f as xi,m as Ii,p as Fi,k as Di,E as Ti,V as Pi,K as ji,t as Ni}from"./ImageHistogramParameters-CsWWZYhj.js";import{m as ht,g as _i,p as Oi,d as Ci}from"./multidimensionalUtils-uKyVhR8j.js";import{i as $i,u as gt,s as Ai,l as Vi}from"./dataUtils-BFJflGP5.js";import{G as Mt,e as Jt,f as Mi,q as Ji,A as Ei,n as qi,a as Et,L as Gi,S as Ot,P as Li}from"./RasterSymbolizer-D7OwkKeP.js";import{b as zi}from"./UniqueValueRenderer-BlkUix3g.js";import{Z as Ui}from"./FieldsIndex-CLgRNeJ_.js";import{t as Ct}from"./imageBitmapUtils-C0nKXf5P.js";import{d as qt}from"./FeatureSet-CYJUZgOk.js";import{s as Hi}from"./executeQueryJSON-DngjHRnE.js";import"./pbf-D9QZb8S8.js";import"./AttachmentInfo-DEdzaB9S.js";import"./AttachmentQuery-D61mmWw4.js";import{s as Bi,n as Qi}from"./executeForIds-BjeEaIen.js";import"./RelationshipQuery-DDK72Kwc.js";import"./TopFeaturesQuery-B8kC7n5h.js";import{f as ki}from"./RefreshableLayer-1EkEhJeI.js";import{f as Wi}from"./TemporalLayer-qq3v_i3q.js";import{e as Zi}from"./versionUtils-CaceEUVY.js";import{p as Ki}from"./popupUtils-DAFYyAvw.js";import{A as We}from"./interfaces-CL2NbQte.js";import"./ColorStop-44hBlQ14.js";import"./colorRamps-BJydlf0f.js";import"./visualVariableUtils-z2k12BH8.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./utils-kx2f2Fff.js";import"./utils-p-5Bbga5.js";import"./ClassBreaksDefinition-D281x8Sj.js";import"./diffUtils-B4YFa5Ju.js";import"./jsonUtils-qYmXvGJ1.js";import"./styleUtils-CnV_Xzhi.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./query-BM8R3sQ6.js";import"./pbfQueryUtils-CLRSFGBm.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./queryZScale-DN4aFXYn.js";import"./TimeInfo-3TVmpFSA.js";const Xi={StretchFunction:{arguments:{ComputeGamma:{isDataset:!1,isPublic:!1,name:"ComputeGamma",type:"RasterFunctionVariable",value:!1},DRA:{isDataset:!1,isPublic:!1,name:"DRA",type:"RasterFunctionVariable",value:!1},EstimateStatsHistogram:{isDataset:!1,isPublic:!1,name:"EstimateStatsHistogram",type:"RasterFunctionVariable",value:!1},Gamma:{displayName:"Gamma",isDataset:!1,isPublic:!1,name:"Gamma",type:"RasterFunctionVariable"},Histograms:{isDataset:!1,isPublic:!1,name:"Histograms",type:"RasterFunctionVariable"},Max:{isDataset:!1,isPublic:!1,name:"Max",type:"RasterFunctionVariable",value:255},MaxPercent:{isDataset:!1,isPublic:!1,name:"MaxPercent",type:"RasterFunctionVariable",value:.5},Min:{isDataset:!1,isPublic:!1,name:"Min",type:"RasterFunctionVariable",value:0},MinPercent:{isDataset:!1,isPublic:!1,name:"MinPercent",type:"RasterFunctionVariable",value:.25},NumberOfStandardDeviations:{isDataset:!1,isPublic:!1,name:"NumberOfStandardDeviation",type:"RasterFunctionVariable",value:2},Raster:{isDataset:!0,isPublic:!1,name:"Raster",type:"RasterFunctionVariable"},SigmoidStrengthLevel:{isDataset:!1,isPublic:!1,name:"SigmoidStrengthLevel",type:"RasterFunctionVariable",value:2},Statistics:{isDataset:!1,isPublic:!1,name:"Statistics",type:"RasterFunctionVariable"},StretchType:{isDataset:!1,isPublic:!1,name:"StretchType",type:"RasterFunctionVariable",value:0},type:"StretchFunctionArguments",UseGamma:{isDataset:!1,isPublic:!1,name:"UseGamma",type:"RasterFunctionVariable",value:!1}},description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",function:{description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",name:"Stretch",pixelType:"UNKNOWN",type:"StretchFunction"},functionType:0,name:"Stretch",thumbnail:""},RemapFunction:{name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table.",function:{type:"RemapFunction",pixelType:"UNKNOWN",name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},UseTable:{name:"UseTable",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},InputRanges:{name:"InputRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Input Ranges"},OutputValues:{name:"OutputValues",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Output Values"},NoDataRanges:{name:"NoDataRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"NoData Ranges"},Table:{name:"Table",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputField:{name:"InputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},OutputField:{name:"OutputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputMaxField:{name:"InputMaxField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},RemapTableType:{name:"RemapTableType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},AllowUnmatched:{name:"AllowUnmatched",isPublic:!1,isDataset:!1,value:!0,type:"RasterFunctionVariable"},type:"RemapFunctionArguments"},functionType:0,thumbnail:""},ColormapFunction:{name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp.",function:{type:"ColormapFunction",pixelType:"UNKNOWN",name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},ColormapName:{name:"ColormapName",isPublic:!1,isDataset:!1,value:"Gray",type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},type:"ColormapFunctionArguments"},functionType:0,thumbnail:""},ShadedReliefFunction:{name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image.",function:{type:"ShadedReliefFunction",pixelType:"UNKNOWN",name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"ShadedReliefFunctionArguments"},functionType:0,thumbnail:""},HillshadeFunction:{name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image",function:{type:"HillshadeFunction",pixelType:"UNKNOWN",name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image"},arguments:{DEM:{name:"DEM",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"HillshadeFunctionArguments"},functionType:0,thumbnail:""},ResampleFunction:{name:"Resample",description:"Changes the cell size of a raster.",function:{type:"ResampleFunction",pixelType:"UNKNOWN",name:"Resample",description:"Changes the cell size of a raster."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ResamplingType:{name:"ResamplingType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},InputCellSize:{name:"InputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},OutputCellSize:{name:"OutputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},type:"ResampleFunctionArguments"},functionType:0,thumbnail:""}},Yi=new Set(["u1","u2","u4","u8","s8","u16","s16"]),er={simple_scalar:"Simple Scalar",wind_barb:"Wind Barb",single_arrow:"Single Arrow",beaufort_kn:"Beaufort Wind (Knots)",beaufort_m:"Beaufort Wind (MetersPerSecond)",ocean_current_m:"Ocean Current (MetersPerSecond)",ocean_current_kn:"Ocean Current (Knots)"},tr=new Set(["raster-stretch","unique-value","class-breaks","raster-shaded-relief","vector-field","raster-colormap"]);function Gt(s){return tr.has(s.type)}function ft(s,i){var e;if(!s||!i)return Q(s||i);const a=Q(s);if(a.functionDefinition&&i.rasterFunctionDefinition){const t=i.rasterFunctionDefinition;(t.thumbnail||t.thumbnailEx)&&(t.thumbnail=t.thumbnailEx=void 0),Lt(a.functionDefinition.arguments,i),a.rasterFunctionDefinition=a.functionDefinition.toJSON()}else((e=i.functionName)==null?void 0:e.toLowerCase())!=="none"&&(zt(a.functionArguments).Raster=i);return a}function Lt(s,i){for(const a in s)a.toLowerCase()==="raster"&&(s[a].type==="RasterFunctionVariable"?(s[a]=i.rasterFunctionDefinition,s[a].type="RasterFunctionTemplate"):s[a].type==="RasterFunctionTemplate"&&Lt(s[a].arguments,i))}function ne(s){const i=Q(Xi[s.functionName+"Function"]),a=s.functionArguments;for(const e in a)e.toLowerCase()==="raster"?(i.arguments[e]=ne(a[e]),i.arguments[e].type="RasterFunctionTemplate"):e.toLowerCase()==="colormap"?(i.arguments[e].value=pr(a[e]),i.arguments.ColorSchemeType.value=0):i.arguments[e].value=a[e];return i}function ir(s,i){switch(i=i||{},s.type){case"raster-stretch":return nr(s,i);case"class-breaks":return ar(s,i);case"unique-value":return or(s,i);case"raster-colormap":return lr(s,i);case"vector-field":return rr(s,i);case"raster-shaded-relief":return sr(s,i);case"flow":throw new Error("Unsupported rendering rule.")}}function zt(s){const i=(s==null?void 0:s.Raster)??(s==null?void 0:s.raster);return i&&i.declaredClass==="esri.layers.support.RasterFunction"?zt(i.functionArguments):s}const Ee={none:0,standardDeviation:3,histogramEqualization:4,minMax:5,percentClip:6,sigmoid:9};function rr(s,i){const a=new S;a.functionName="VectorFieldRenderer";const{dataType:e,bandNames:t}=i,n=e==="vector-uv";let l,u;if(t&&t.length===2){const R=t.map(f=>f.toLowerCase());l=R.indexOf("magnitude"),u=R.indexOf("direction")}l!==-1&&l!==null||(l=0,u=1);const p=s.rotationType==="arithmetic"?1:2,m=s.flowRepresentation==="flow-from"?0:1,c=s.visualVariables?s.visualVariables.find(R=>R.field==="Magnitude"):new zi,d={magnitudeBandID:l,directionBandID:u,isUVComponents:n,referenceSystem:p,massFlowAngleRepresentation:m,symbolTileSize:50,symbolTileSizeUnits:100,calculationMethod:"Vector Average",symbologyName:er[s.style.toLowerCase().replace("-","_")],minimumMagnitude:c.minDataValue,maximumMagnitude:c.maxDataValue,minimumSymbolSize:c.minSize,maximumSymbolSize:c.maxSize};a.functionArguments=d;const h=ne(a);return i.convertToRFT?S.fromJSON({rasterFunctionDefinition:h}):a}function sr(s,i){const a=i.convertToRFT;if(i.dataType!=="elevation"&&(i.dataType!=="generic"||i.bandCount!==1||i.pixelType!=="s16"&&i.pixelType!=="s32"&&i.pixelType!=="f32"&&i.pixelType!=="f64"))return new S;const e=new S;e.functionName="Hillshade";const t=s.hillshadeType==="traditional"?0:1,n=s.scalingType==="none"?1:3,l={HillshadeType:t,SlopeType:n,ZFactor:s.zFactor};return t===0&&(l.Azimuth=s.azimuth,l.Altitude=s.altitude),n===3&&(l.PSPower=s.pixelSizePower,l.PSZFactor=s.pixelSizeFactor),e.functionArguments=l,e.variableName="Raster",s.colorRamp&&(e.functionName="ShadedRelief",a?l.ColorRamp=Mt(s.colorRamp):l.Colormap=Jt(s.colorRamp)),a?new S({rasterFunctionDefinition:ne(e)}):e}function nr(s,i){var u;const a=i.convertToRFT,e=new S;e.functionName="Stretch";const t=Ee[Mi.toJSON(s.stretchType)],n="u8",l={StretchType:t,Statistics:ur(s.statistics??[]),DRA:s.dynamicRangeAdjustment,UseGamma:s.useGamma,Gamma:s.gamma,ComputeGamma:s.computeGamma};if(s.outputMin!=null&&(l.Min=s.outputMin),s.outputMax!=null&&(l.Max=s.outputMax),t===Ee.standardDeviation?(l.NumberOfStandardDeviations=s.numberOfStandardDeviations,e.outputPixelType=n):t===Ee.percentClip?(l.MinPercent=s.minPercent,l.MaxPercent=s.maxPercent,e.outputPixelType=n):t===Ee.minMax?e.outputPixelType=n:t===Ee.sigmoid&&(l.SigmoidStrengthLevel=s.sigmoidStrengthLevel),e.functionArguments=l,e.variableName="Raster",s.colorRamp){const p=s.colorRamp,m=new S;if(a)m.functionArguments={ColorRamp:Mt(p)};else{const c=Ji(p,!0);if(c)m.functionArguments={colorRampName:c};else if(!i.convertColorRampToColormap||p.type!=="algorithmic"&&p.type!=="multipart"){const d=s.colorRamp.toJSON();d.type==="algorithmic"?d.algorithm=d.algorithm||"esriCIELabAlgorithm":d.type==="multipart"&&((u=d.colorRamps)!=null&&u.length)&&d.colorRamps.forEach(h=>h.algorithm=h.algorithm||"esriCIELabAlgorithm"),m.functionArguments={colorRamp:d}}else m.functionArguments={Colormap:Jt(p)}}return m.variableName="Raster",m.functionName="Colormap",m.functionArguments.Raster=e,a?new S({rasterFunctionDefinition:ne(m)}):m}return a?new S({rasterFunctionDefinition:ne(e)}):e}function ar(s,i){const a=[],e=[],t=[],n=[],{pixelType:u,rasterAttributeTable:p}=i,m=p==null?null:p.features,c=Ut(p);if(c&&m&&Array.isArray(m)&&s.classBreakInfos){s.classBreakInfos.forEach((y,g)=>{var G;const v=(G=y.symbol)==null?void 0:G.color;let _;v!=null&&v.a&&y.minValue!=null&&y.maxValue!=null&&m.forEach(J=>{y.minValue!=null&&y.maxValue!=null&&(_=J.attributes[s.field],(_>=y.minValue&&_=y.minValue)&&n.push([J.attributes[c],v.r,v.g,v.b]))})});const f=u?ut(n,u):n,w=new S;return w.functionName="Colormap",w.functionArguments={},w.functionArguments.Colormap=f,w.variableName="Raster",i.convertToRFT?new S({rasterFunctionDefinition:ne(w)}):w}s.classBreakInfos.forEach((f,w)=>{if(f.minValue==null||f.maxValue==null)return;const y=f.symbol&&f.symbol.color;y!=null&&y.a?(w===0?a.push(f.minValue,f.maxValue+1e-4):a.push(f.minValue+1e-4,f.maxValue+1e-4),e.push(w),n.push([w,y.r,y.g,y.b])):t.push(f.minValue,f.maxValue)});const d=u?ut(n,u):n,h=new S;h.functionName="Remap",h.functionArguments={InputRanges:a,OutputValues:e,NoDataRanges:t},h.variableName="Raster";const R=new S;return R.functionName="Colormap",R.functionArguments={Colormap:d,Raster:h},i.convertToRFT?new S({rasterFunctionDefinition:ne(R)}):R}function ut(s,i){const a=Yi.has(i)?$i(i):null;return a&&s.push([Math.floor(a[0]-1),0,0,0],[Math.ceil(a[1]+1),0,0,0]),s}function Ut(s){if(s==null)return;const{fields:i}=s,a=i==null?void 0:i.find(e=>(e==null?void 0:e.name)&&e.name.toLowerCase()==="value");return a==null?void 0:a.name}function or(s,i){var d,h,R;const a=[],{pixelType:e,rasterAttributeTable:t}=i,n=t==null?null:t.features,l=Ut(t),u=(h=(d=s.defaultSymbol)==null?void 0:d.color)==null?void 0:h.toRgb(),p=s.uniqueValueInfos;if(p)if(n){if(l){const f=new Map;p.forEach(y=>{var _;const g=y.value,v=(_=y.symbol)==null?void 0:_.color;g!=null&&(v!=null&&v.a)&&f.set(String(g),v.toRgb())});const w=s.field;n.forEach(({attributes:y})=>{const g=String(y[w]),v=y[l],_=f.get(g);_?a.push([v,..._]):u&&a.push([v,...u])})}}else for(let f=0;f{const e=a;if(Array.isArray(e))i.push(e);else{if(e.min==null||e.max==null)return;const t=[e.min,e.max,e.avg||0,e.stddev||0];i.push(t)}}),i}function pr(s){const i=[],a=[];return s.forEach(e=>{i.push(e[0]),a.push(Ei([...e.slice(1),255]))}),{type:"RasterColormap",values:i,colors:a}}let O=class extends P{constructor(){super(...arguments),this.layer=null,this.compression=void 0,this.pixelType=void 0,this.lercVersion=2}get adjustAspectRatio(){return this.layer.adjustAspectRatio}writeAdjustAspectRatio(i,a,e){this.layer.version<10.3||(a[e]=i)}get bandIds(){return this.layer.bandIds}get compressionQuality(){return this.layer.compressionQuality}writeCompressionQuality(i,a,e){this.format&&this.format.toLowerCase().includes("jpg")&&i!=null&&(a[e]=i)}get compressionTolerance(){return this.layer.compressionTolerance}writeCompressionTolerance(i,a,e){this.format==="lerc"&&i!=null&&(a[e]=i)}get format(){var i;return((i=this.layer.renderer)==null?void 0:i.type)==="vector-field"?"lerc":this.layer.format}get interpolation(){return this.layer.interpolation}get noData(){return this.layer.noData}get noDataInterpretation(){return this.layer.noDataInterpretation}writeLercVersion(i,a,e){this.format==="lerc"&&this.layer.version>=10.5&&(a[e]=i)}get version(){const i=this.layer;return i.commitProperty("bandIds"),i.commitProperty("format"),i.commitProperty("compressionQuality"),i.commitProperty("compressionTolerance"),i.commitProperty("interpolation"),i.commitProperty("noData"),i.commitProperty("noDataInterpretation"),i.commitProperty("mosaicRule"),i.commitProperty("rasterFunction"),i.commitProperty("adjustAspectRatio"),i.commitProperty("pixelFilter"),i.commitProperty("definitionExpression"),i.commitProperty("multidimensionalSubset"),(this._get("version")||0)+1}set version(i){this._set("version",i)}get mosaicRule(){const i=this.layer;let a=i.mosaicRule;const e=i.definitionExpression;return a?e&&e!==a.where&&(a=a.clone(),a.where=e):e&&(a=new k({where:e})),a}get rasterFunction(){var l,u;const i=this.layer;let{rasterFunction:a}=i;const e=i.pixelFilter,t=!i.format||i.format.includes("jpg")||i.format.includes("png");a=this._addResampleRasterFunction(a);const n=(l=i.multidimensionalSubset)==null?void 0:l.areaOfInterest;return n&&(a=this._addClipFunction(a,n)),t&&!e&&((u=i.renderer)==null?void 0:u.type)!=="vector-field"&&(a=this.combineRendererWithRenderingRule(a)),a}combineRendererWithRenderingRule(i){const a=this.layer,{rasterInfo:e,renderer:t}=a;return i=i||a.rasterFunction,!t||!Gt(t)?i:ft(ir(t,{rasterAttributeTable:e.attributeTable,pixelType:e.pixelType,dataType:e.dataType,bandNames:e.bandInfos.map(({name:n})=>n),convertColorRampToColormap:a.version<10.6,convertToRFT:!!(i!=null&&i.rasterFunctionDefinition),bandCount:e.bandCount}),i)}_addResampleRasterFunction(i){var n;if(((n=this.layer.renderer)==null?void 0:n.type)!=="vector-field"||(i==null?void 0:i.functionName)==="Resample")return i;const a=this.layer.serviceDataType==="esriImageServiceDataTypeVector-UV"?7:10,e=this.layer.serviceRasterInfo.pixelSize;let t=new S({functionName:"Resample",functionArguments:{ResamplingType:a,InputCellSize:e}});return t=i!=null&&i.rasterFunctionDefinition?new S({rasterFunctionDefinition:ne(t)}):t,ft(t,i)}_addClipFunction(i,a){const e=new S({functionName:"Clip",functionArguments:{ClippingGeometry:a.toJSON(),ClippingType:1}});return ft(e,i)}};r([o()],O.prototype,"layer",void 0),r([o({json:{write:!0}})],O.prototype,"adjustAspectRatio",null),r([T("adjustAspectRatio")],O.prototype,"writeAdjustAspectRatio",null),r([o({json:{write:!0}})],O.prototype,"bandIds",null),r([o({json:{write:!0}})],O.prototype,"compression",void 0),r([o({json:{write:!0}})],O.prototype,"compressionQuality",null),r([T("compressionQuality")],O.prototype,"writeCompressionQuality",null),r([o({json:{write:!0}})],O.prototype,"compressionTolerance",null),r([T("compressionTolerance")],O.prototype,"writeCompressionTolerance",null),r([o({json:{write:!0}})],O.prototype,"format",null),r([o({type:String,json:{read:{reader:ve.read},write:{writer:ve.write}}})],O.prototype,"interpolation",null),r([o({json:{write:!0}})],O.prototype,"noData",null),r([o({type:String,json:{read:{reader:Ue.read},write:{writer:Ue.write}}})],O.prototype,"noDataInterpretation",null),r([o({json:{write:!0}})],O.prototype,"pixelType",void 0),r([o({json:{write:!0}})],O.prototype,"lercVersion",void 0),r([T("lercVersion")],O.prototype,"writeLercVersion",null),r([o({type:Number})],O.prototype,"version",null),r([o({json:{write:!0}})],O.prototype,"mosaicRule",null),r([o({json:{write:!0,name:"renderingRule"}})],O.prototype,"rasterFunction",null),O=r([b("esri.layers.mixins.ExportImageServiceParameters")],O);const Ht=s=>{let i=class extends s{constructor(){super(...arguments),this.make=null,this.model=null,this.focalLength=null,this.pixelSize=null,this.rows=null,this.cols=null}};return r([o({json:{write:!0}})],i.prototype,"make",void 0),r([o({json:{write:!0}})],i.prototype,"model",void 0),r([o({json:{write:!0}})],i.prototype,"focalLength",void 0),r([o({json:{write:!0}})],i.prototype,"pixelSize",void 0),r([o({json:{write:!0}})],i.prototype,"rows",void 0),r([o({json:{write:!0}})],i.prototype,"cols",void 0),i=r([b("esri.rest.support.CameraInfoMixin")],i),i};let K=class extends Ht(P){constructor(){super(...arguments),this.id=null,this.referenceUri=null,this.acquisitionDate=null,this.cameraID=null,this.center=null,this.perspectiveCenter=null,this.orientation=null}writeAcquisitionDate(i,a){a.acquisitionDate=i==null?void 0:i.getTime()}};r([o({json:{write:!0}})],K.prototype,"id",void 0),r([o({json:{name:"uri",write:!0}})],K.prototype,"referenceUri",void 0),r([o({type:Date,json:{write:!0}})],K.prototype,"acquisitionDate",void 0),r([T("acquisitionDate")],K.prototype,"writeAcquisitionDate",null),r([o({json:{write:!0}})],K.prototype,"cameraID",void 0),r([o({type:A,json:{write:!0}})],K.prototype,"center",void 0),r([o({type:A,json:{write:!0}})],K.prototype,"perspectiveCenter",void 0),r([o({json:{write:!0}})],K.prototype,"orientation",void 0),K=r([b("esri.rest.support.ImageInspectionInfo")],K);const cr=K;let Ke=class extends P{constructor(){super(...arguments),this.images=null}};r([o({type:[cr],json:{write:!0}})],Ke.prototype,"images",void 0),Ke=r([b("esri.rest.support.FindImagesResult")],Ke);const mr=Ke;let _e=class extends P{constructor(i){super(i),this.north=null,this.up=null,this.spatialReference=null}};r([o({type:Number,json:{write:!0}})],_e.prototype,"north",void 0),r([o({type:Number,json:{write:!0}})],_e.prototype,"up",void 0),r([o({type:se,json:{write:!0}})],_e.prototype,"spatialReference",void 0),_e=r([b("esri.rest.support.ImageAngleResult")],_e);const dr=_e;let fe=class extends P{constructor(){super(...arguments),this.value=null,this.displayValue=null,this.uncertainty=null}};r([o({type:Number,json:{read:!0,write:!0}})],fe.prototype,"value",void 0),r([o({type:String,json:{read:!0,write:!0}})],fe.prototype,"displayValue",void 0),r([o({type:Number,json:{read:!0,write:!0}})],fe.prototype,"uncertainty",void 0),fe=r([b("esri.rest.support.ImageMeasureResultValue")],fe);let Me=class extends fe{constructor(){super(...arguments),this.unit=null}};r([o({type:String,json:{read:be.read,write:be.write}})],Me.prototype,"unit",void 0),Me=r([b("esri.rest.support.ImageMeasureResultLengthValue")],Me);let Xe=class extends fe{constructor(){super(...arguments),this.unit=null}};r([o({type:String,json:{read:ot.read,write:ot.write}})],Xe.prototype,"unit",void 0),Xe=r([b("esri.rest.support.ImageMeasureResultAreaValue")],Xe);let He=class extends fe{constructor(){super(...arguments),this.unit=null}};r([o({type:String,json:{read:lt.read,write:lt.write}})],He.prototype,"unit",void 0),He=r([b("esri.rest.support.ImageMeasureResultAngleValue")],He);let Re=class extends P{constructor(){super(...arguments),this.name=null,this.sensorName=null}};r([o({type:String,json:{read:!0,write:!0}})],Re.prototype,"name",void 0),r([o({type:String,json:{read:!0,write:!0}})],Re.prototype,"sensorName",void 0),Re=r([b("esri.rest.support.BaseImageMeasureResult")],Re);let qe=class extends Re{constructor(){super(...arguments),this.area=null,this.perimeter=null}};r([o({type:Xe,json:{read:!0,write:!0}})],qe.prototype,"area",void 0),r([o({type:Me,json:{read:!0,write:!0}})],qe.prototype,"perimeter",void 0),qe=r([b("esri.rest.support.ImageAreaResult")],qe);const yr=qe;let Oe=class extends P{constructor(){super(...arguments),this.area=null,this.geometry=null}readGeometry(i,a){return i==null?null:i.rings?Ze.fromJSON(i):ze.fromJSON(i)}};r([o({type:Number,json:{write:!0}})],Oe.prototype,"area",void 0),r([o({json:{name:"shape",write:!0}})],Oe.prototype,"geometry",void 0),r([V("geometry")],Oe.prototype,"readGeometry",null),Oe=r([b("esri.rest.support.ImageBoundaryResult")],Oe);const hr=Oe;let Ce=class extends Re{constructor(){super(...arguments),this.distance=null,this.azimuthAngle=null,this.elevationAngle=null}};r([o({type:Me,json:{read:!0,write:!0}})],Ce.prototype,"distance",void 0),r([o({type:He,json:{read:!0,write:!0}})],Ce.prototype,"azimuthAngle",void 0),r([o({type:He,json:{read:!0,write:!0}})],Ce.prototype,"elevationAngle",void 0),Ce=r([b("esri.rest.support.ImageDistanceResult")],Ce);const gr=Ce;let Ye=class extends Ht(P){constructor(){super(...arguments),this.id=null}};r([o({json:{write:!0}})],Ye.prototype,"id",void 0),Ye=r([b("esri.rest.support.CameraInfo")],Ye);const fr=Ye;let X=class extends P{constructor(){super(...arguments),this.id=null,this.name=null,this.acquisitionDate=null,this.cameraID=null,this.center=null,this.gps=null,this.orientation=null}writeAcquisitionDate(i,a){a.acquisitionDate=i==null?void 0:i.getTime()}};r([o({json:{write:!0}})],X.prototype,"id",void 0),r([o({json:{write:!0}})],X.prototype,"name",void 0),r([o({type:Date,json:{write:!0}})],X.prototype,"acquisitionDate",void 0),r([T("acquisitionDate")],X.prototype,"writeAcquisitionDate",null),r([o({json:{write:!0}})],X.prototype,"cameraID",void 0),r([o({type:A,json:{write:!0}})],X.prototype,"center",void 0),r([o({json:{write:!0}})],X.prototype,"gps",void 0),r([o({json:{write:!0}})],X.prototype,"orientation",void 0),X=r([b("esri.rest.support.ImageGPSInfo")],X);const wr=X;let Ge=class extends P{constructor(){super(...arguments),this.images=null,this.cameras=null}};r([o({type:[wr],json:{write:!0}})],Ge.prototype,"images",void 0),r([o({type:[fr],json:{write:!0}})],Ge.prototype,"cameras",void 0),Ge=r([b("esri.rest.support.ImageGPSInfoResult")],Ge);const Rr=Ge;let et=class extends Re{constructor(){super(...arguments),this.height=null}};r([o({type:Me,json:{read:!0,write:!0}})],et.prototype,"height",void 0),et=r([b("esri.rest.support.ImageHeightResult")],et);const vr=et;let Y=class extends P{constructor(){super(...arguments),this.catalogItemVisibilities=null,this.catalogItems=null,this.location=null,this.name=null,this.objectId=null,this.processedValues=null,this.properties=null,this.value=null}};r([o({json:{write:!0}})],Y.prototype,"catalogItemVisibilities",void 0),r([o({type:qt,json:{write:!0}})],Y.prototype,"catalogItems",void 0),r([o({type:A,json:{write:!0}})],Y.prototype,"location",void 0),r([o({json:{write:!0}})],Y.prototype,"name",void 0),r([o({json:{write:!0}})],Y.prototype,"objectId",void 0),r([o({json:{write:!0}})],Y.prototype,"processedValues",void 0),r([o({json:{write:!0}})],Y.prototype,"properties",void 0),r([o({json:{write:!0}})],Y.prototype,"value",void 0),Y=r([b("esri.rest.support.ImageIdentifyResult")],Y);const br=Y;let tt=class extends P{constructor(){super(...arguments),this.geometries=null}};r([o({json:{write:!0}})],tt.prototype,"geometries",void 0),tt=r([b("esri.rest.support.ImagePixelLocationResult")],tt);const Sr=tt;let it=class extends Re{constructor(){super(...arguments),this.point=null}};r([o({type:A,json:{name:"point.value",read:!0,write:!0}})],it.prototype,"point",void 0),it=r([b("esri.rest.support.ImagePointResult")],it);const xr=it;let ue=class extends P{constructor(){super(...arguments),this.attributes=null,this.location=null,this.locationId=null,this.rasterId=null,this.resolution=null,this.pixelValue=null}};r([o({json:{write:!0}})],ue.prototype,"attributes",void 0),r([o({type:A,json:{write:!0}})],ue.prototype,"location",void 0),r([o({json:{write:!0}})],ue.prototype,"locationId",void 0),r([o({json:{write:!0}})],ue.prototype,"rasterId",void 0),r([o({json:{write:!0}})],ue.prototype,"resolution",void 0),r([o({json:{write:!0}})],ue.prototype,"pixelValue",void 0),ue=r([b("esri.rest.support.ImageSample")],ue);const Ir=ue;let rt=class extends P{constructor(){super(...arguments),this.samples=null}};r([o({type:[Ir],json:{write:!0}})],rt.prototype,"samples",void 0),rt=r([b("esri.rest.support.ImageSampleResult")],rt);const Fr=rt;let st=class extends P{constructor(){super(...arguments),this.url=null}};r([o({json:{name:"imageURL",write:!0}})],st.prototype,"url",void 0),st=r([b("esri.rest.support.ImageUrlResult")],st);const Dr=st;let he=class extends P{constructor(){super(...arguments),this.geometry=null,this.length=null,this.area=null,this.center=null}readCenter(i,a){return i.spatialReference||(i={...i,spatialReference:a.Shape.spatialReference}),A.fromJSON(i)}};r([o({types:oe,json:{name:"Shape",read:te,write:!0}})],he.prototype,"geometry",void 0),r([o({json:{name:"Length",write:!0}})],he.prototype,"length",void 0),r([o({json:{name:"Area",write:!0}})],he.prototype,"area",void 0),r([o({json:{name:"Center",write:!0}})],he.prototype,"center",void 0),r([V("center")],he.prototype,"readCenter",null),he=r([b("esri.rest.support.MeasureAreaFromImageResult")],he);const Tr=he;let Le=class extends P{constructor(){super(...arguments),this.geometry=null,this.length=null}};r([o({types:oe,json:{name:"Shape",read:te,write:!0}})],Le.prototype,"geometry",void 0),r([o({json:{name:"Length",write:!0}})],Le.prototype,"length",void 0),Le=r([b("esri.rest.support.MeasureLengthFromImageResult")],Le);const Pr=Le;function jt(s){const i=s==null?void 0:s.time;if(i&&(i.start!=null||i.end!=null)){const a=[];i.start!=null&&a.push(i.start),i.end==null||a.includes(i.end)||a.push(i.end),s.time=a.join(",")}}async function Bt(s,i,a){const e=M(s),t=i.geometry?[i.geometry]:[],n=await Ne(t),l=i.toJSON();jt(l);const u=n==null?void 0:n[0];u!=null&&(l.geometry=ae(u));const p=z({...e.query,f:"json",...l});return U(p,a)}async function jr(s,i,a){var p,m,c;const e=i.toJSON();e.angleName!=null&&(e.angleName=e.angleName.join(",")),(m=(p=i==null?void 0:i.point)==null?void 0:p.spatialReference)!=null&&m.imageCoordinateSystem&&(e.point.spatialReference=ct(i.point.spatialReference)),(c=i==null?void 0:i.spatialReference)!=null&&c.imageCoordinateSystem&&(e.spatialReference=Je(i.spatialReference));const t=M(s),n=z({...t.query,f:"json",...e}),l=U(n,a),{data:u}=await D(`${t.path}/computeAngles`,l);return u.spatialReference=u.spatialReference?u.spatialReference.geodataXform!=null?new se({wkid:0,imageCoordinateSystem:u.spatialReference}):se.fromJSON(u.spatialReference):null,u.north==="NaN"&&(u.north=null),u.up==="NaN"&&(u.up=null),new dr(u)}async function Nr(s,i,a){var m;const e=i.toJSON(),{geometries:t}=i;if(t)for(let c=0;c{u.avg=u.mean,u.stddev=u.standardDeviation}),{statistics:l,histograms:n.histograms}}async function Or(s,i,a){const e=await Bt(s,i,a),t=M(s),{data:n}=await D(`${t.path}/computeHistograms`,e);return{histograms:n.histograms}}async function Cr(s,i,a){var d,h;const e=i.toJSON();jt(e),(d=e.outFields)!=null&&d.length&&(e.outFields=e.outFields.join(","));const t=await Ne(i.geometry),n=t==null?void 0:t[0];n!=null&&(e.geometry=ae(n));const l=M(s),u=z({...l.query,f:"json",...e}),p=U(u,a),{data:m}=await D(`${l.path}/getSamples`,p),c=(h=m==null?void 0:m.samples)==null?void 0:h.map(R=>{const f=R.value==="NaN"||R.value===""?null:R.value.split(" ").map(w=>Number(w));return{...R,pixelValue:f}});return Fr.fromJSON({samples:c})}async function $t(s,i,a){const e=M(s),t=i.geometry?[i.geometry]:[];return Ne(t).then(n=>{const l=i.toJSON(),u=n==null?void 0:n[0];u!=null&&(l.geometry=JSON.stringify(ae(u)));const p=z({...e.query,f:"json",...l}),m=U(p,a);return D(e.path+"/identify",m)}).then(n=>br.fromJSON(n.data))}async function $r(s,i,a){const e=await pt(s,i,[i.fromGeometry,i.toGeometry],a);return vr.fromJSON(e)}async function Ar(s,i,a){const e=await pt(s,i,[i.geometry],a);return yr.fromJSON(e)}async function Vr(s,i,a){const e=await pt(s,i,[i.geometry],a);return xr.fromJSON(e)}async function Mr(s,i,a){const e=await pt(s,i,[i.fromGeometry,i.toGeometry],a);return gr.fromJSON(e)}async function pt(s,i,a,e){const t=M(s),n=await Ne(a),l=i.toJSON();n[0]!=null&&(l.fromGeometry=JSON.stringify(ae(n[0]))),n[1]!=null&&(l.toGeometry=JSON.stringify(ae(n[1])));const u=z({...t.query,f:"json",...l}),p=U(u,e),{data:m}=await D(t.path+"/measure",p);return m}async function Jr(s,i,a){const e=await Qt(s,i,a);return Pr.fromJSON(e)}async function Er(s,i,a){const e=await Qt(s,i,a);return Tr.fromJSON(e)}async function Qt(s,i,a){const e=M(s),t=i.toJSON(),n=z({...e.query,f:"json",...t}),l=U(n,a),{data:u}=await D(e.path+"/measureFromImage",l);return u}function ae(s){var a;const i=s.toJSON();return(a=s.spatialReference)!=null&&a.imageCoordinateSystem&&(i.spatialReference=ct(s.spatialReference)),i}function ct(s){const{imageCoordinateSystem:i}=s;if(i){const{id:a,referenceServiceName:e}=i;return a!=null?e?{icsid:a,icsns:e}:{icsid:a}:{ics:i}}return s.toJSON()}function Je(s,i){if(!s.imageCoordinateSystem)return wt(s);const a=ct(s),{icsid:e,icsns:t}=a;return e==null||t!=null&&!(i!=null&&i.toLowerCase().includes("/"+t.toLowerCase()+"/"))?JSON.stringify(a):`0:${e}`}async function qr(s,i,a){const e=M(s),t=i.toJSON();i.outSpatialReference&&(t.outSR=Je(i.outSpatialReference));const n=z({...e.query,f:"json",...t}),l=U(n,a),{data:u}=await D(e.path+"/queryBoundary",l);return hr.fromJSON(u)}async function Gr(s,i,a){var d,h;const e=i.toJSON();jt(e),(d=e.objectIds)!=null&&d.length&&(e.objectIds=e.objectIds.join(",")),e.geometry||e.objectIds||e.time||e.where||(e.where="1=1");const t=await Ne(i.geometry),n=t==null?void 0:t[0];n!=null&&(e.geometry=ae(n));const l=(n==null?void 0:n.spatialReference)??((h=i.geometry)==null?void 0:h.spatialReference);l&&(e.inSR=Je(l));const u=M(s),p=z({...u.query,f:"json",...e}),m=U(p,a),{data:c}=await D(`${u.path}/queryGPSInfo`,m);return Rr.fromJSON(c)}async function Lr(s,i,a){const e=i.toJSON();i.geometry.spatialReference.imageCoordinateSystem&&(e.geometry=ae(i.geometry)),i.depthOffset&&i.adjust||delete e.options;const t=M(s),n=z({...t.query,f:"json",...e}),l=U(n,a),{data:u}=await D(`${t.path}/imageToMap`,l);return te(u)}async function zr(s,i,a){var p;const e=i.toJSON();(p=i.rasterIds)!=null&&p.length&&(e.rasterIds=i.rasterIds.join(","));const t=M(s),n=z({...t.query,f:"json",...e}),l=U(n,a),{data:u}=await D(`${t.path}/imageToMapMultiray`,l);return te(u)}async function Ur(s,i,a){var d;const e=i.toJSON(),t=await Ne(i.geometry),n=t==null?void 0:t[0];n!=null&&(e.geometry=ae(n)),i.visibleOnly||delete e.options;const l=(n==null?void 0:n.spatialReference)??((d=i.geometry)==null?void 0:d.spatialReference);l&&(e.inSR=Je(l));const u=M(s),p=z({...u.query,f:"json",...e}),m=U(p,a),{data:c}=await D(`${u.path}/mapToImage`,m);return te(c)}async function Hr(s,i,a){const e=i.toJSON(),t=M(s),n=z({...t.query,f:"json",...e}),l=U(n,a),{data:u}=await D(`${t.path}/getImageUrl`,l);return Dr.fromJSON(u)}async function Br(s,i,a){var m;const e=i.toJSON(),t=await Ne([i.fromGeometry,i.toGeometry]);t[0]!=null&&(e.fromGeometry=ae(t[0]),t[0].spatialReference&&(e.inSR=Je(t[0].spatialReference))),t[1]!=null&&(e.toGeometry=ae(t[1])),(m=i.objectIds)!=null&&m.length&&(e.objectIds=e.objectIds.join(","));const n=M(s),l=z({...n.query,f:"json",...e}),u=U(l,a),{data:p}=await D(`${n.path}/find`,u);return mr.fromJSON(p)}async function Qr(s,i,a){var G,J;const e=M(s),t=z({...e==null?void 0:e.query,f:"json"}),n=U(t,a),l=`${e==null?void 0:e.path}/${i}/info`,u=D(`${l}`,n),p=D(`${l}/keyProperties`,n),m=await Promise.allSettled([u,p]),c=m[0].status==="fulfilled"?m[0].value.data:null,d=m[1].status==="fulfilled"?m[1].value.data:null;let h=null;(G=c.statistics)!=null&&G.length&&(h=c.statistics.map(F=>({min:F[0],max:F[1],avg:F[2],stddev:F[3]})));const R=ze.fromJSON(c.extent),f=Math.ceil(R.width/c.pixelSizeX-.1),w=Math.ceil(R.height/c.pixelSizeY-.1),y=R.spatialReference,g=new A({x:c.pixelSizeX,y:c.pixelSizeY,spatialReference:y}),v=(J=c.histograms)!=null&&J.length?c.histograms:null,_=new qi({origin:c.origin,blockWidth:c.blockWidth,blockHeight:c.blockHeight,firstPyramidLevel:c.firstPyramidLevel,maximumPyramidLevel:c.maxPyramidLevel});return new Et({width:f,height:w,bandCount:c.bandCount,extent:R,spatialReference:y,pixelSize:g,pixelType:c.pixelType.toLowerCase(),statistics:h,histograms:v,keyProperties:d,storageInfo:_})}let ge=class extends Se(P){constructor(){super(...arguments),this.fromGeometry=null,this.toGeometry=null,this.objectIds=null,this.where=null,this.maxCount=null}};r([o({type:A,json:{read:!0}})],ge.prototype,"fromGeometry",void 0),r([o({type:A,json:{read:!0,write:!0}})],ge.prototype,"toGeometry",void 0),r([o({json:{write:!0}})],ge.prototype,"objectIds",void 0),r([o({type:String,json:{write:!0}})],ge.prototype,"where",void 0),r([o({type:Number,json:{write:!0}})],ge.prototype,"maxCount",void 0),ge=r([b("esri.rest.support.FindImagesParameters")],ge);const kr=ge;var Rt;let De=Rt=class extends P{constructor(s){super(s),this.angleNames=null,this.point=null,this.spatialReference=null,this.rasterId=null}clone(){return new Rt(Q({angleNames:this.angleNames,point:this.point,spatialReference:this.spatialReference,rasterId:this.rasterId}))}};r([o({type:[String],json:{name:"angleName",write:!0}})],De.prototype,"angleNames",void 0),r([o({type:A,json:{write:!0}})],De.prototype,"point",void 0),r([o({type:se,json:{write:!0}})],De.prototype,"spatialReference",void 0),r([o({type:Be,json:{write:!0}})],De.prototype,"rasterId",void 0),De=Rt=r([b("esri.rest.support.ImageAngleParameters")],De);const Wr=De,W=new kt({esriMensurationPoint:"point",esriMensurationCentroid:"centroid",esriMensurationDistanceAndAngle:"distance-and-angle",esriMensurationAreaAndPerimeter:"area-and-perimeter",esriMensurationHeightFromBaseAndTop:"base-and-top",esriMensurationHeightFromBaseAndTopShadow:"base-and-top-shadow",esriMensurationHeightFromTopAndTopShadow:"top-and-top-shadow",esriMensurationPoint3D:"point-3D",esriMensurationCentroid3D:"centroid-3D",esriMensurationDistanceAndAngle3D:"distance-and-angle-3D",esriMensurationAreaAndPerimeter3D:"area-and-perimeter-3D"});let ee=class extends P{constructor(){super(...arguments),this.type=null,this.measureOperation=null,this.mosaicRule=null,this.pixelSize=null,this.raster=void 0}};r([o()],ee.prototype,"type",void 0),r([o({type:W.apiValues,json:{read:W.read,write:W.write}})],ee.prototype,"measureOperation",void 0),r([o({type:k,json:{write:!0}})],ee.prototype,"mosaicRule",void 0),r([o({type:A,json:{write:!0}})],ee.prototype,"pixelSize",void 0),r([o({json:{write:!0}})],ee.prototype,"raster",void 0),ee=r([b("esri.rest.support.BaseImageMeasureParameters")],ee);var vt;let pe=vt=class extends ee{constructor(){super(...arguments),this.type="area-perimeter",this.geometry=null,this.is3D=!1,this.linearUnit="meters",this.areaUnit="square-meters"}writeGeometry(s,i,a){s!=null&&(i.geometryType=ie(s),i[a]=s.toJSON())}get measureOperation(){return this.is3D?"area-and-perimeter-3D":"area-and-perimeter"}clone(){return new vt(Q({geometry:this.geometry,is3D:this.is3D,linearUnit:this.linearUnit,areaUnit:this.areaUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};r([o({types:oe,json:{name:"fromGeometry",read:!0,write:!0}})],pe.prototype,"geometry",void 0),r([T("geometry")],pe.prototype,"writeGeometry",null),r([o({type:W.apiValues,json:{write:W.write}})],pe.prototype,"measureOperation",null),r([o({json:{read:!0}})],pe.prototype,"is3D",void 0),r([o({type:String,json:{read:be.read,write:be.write}})],pe.prototype,"linearUnit",void 0),r([o({type:String,json:{read:ot.read,write:ot.write}})],pe.prototype,"areaUnit",void 0),pe=vt=r([b("esri.rest.support.ImageAreaParameters")],pe);const Zr=pe;let nt=class extends Se(P){constructor(){super(...arguments),this.outSpatialReference=null}};r([o({type:se,json:{name:"outSR",write:!0}})],nt.prototype,"outSpatialReference",void 0),nt=r([b("esri.rest.support.ImageBoundaryParameters")],nt);const Kr=nt;var bt;let re=bt=class extends ee{constructor(){super(...arguments),this.type="distance-angle",this.fromGeometry=null,this.toGeometry=null,this.is3D=!1,this.linearUnit="meters",this.angularUnit="degrees"}writeFromGeometry(s,i,a){s!=null&&(i.geometryType=ie(s),i[a]=s.toJSON())}get measureOperation(){return this.is3D?"distance-and-angle-3D":"distance-and-angle"}clone(){return new bt(Q({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,is3D:this.is3D,linearUnit:this.linearUnit,angularUnit:this.angularUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};r([o({type:A,json:{read:!0,write:!0}})],re.prototype,"fromGeometry",void 0),r([T("fromGeometry")],re.prototype,"writeFromGeometry",null),r([o({type:A,json:{read:!0,write:!0}})],re.prototype,"toGeometry",void 0),r([o({type:W.apiValues,json:{write:W.write}})],re.prototype,"measureOperation",null),r([o({json:{read:!0}})],re.prototype,"is3D",void 0),r([o({type:String,json:{read:be.read,write:be.write}})],re.prototype,"linearUnit",void 0),r([o({type:String,json:{read:lt.read,write:lt.write}})],re.prototype,"angularUnit",void 0),re=bt=r([b("esri.rest.support.ImageDistanceParameters")],re);const Xr=re;let ce=class extends Se(P){constructor(){super(...arguments),this.geometry=null,this.objectIds=null,this.spatialRelationship="intersects",this.timeExtent=null,this.where=null}writeGeometry(i,a,e){i!=null&&(a.geometryType=ie(i),a[e]=JSON.stringify(i.toJSON()))}};r([o({types:oe,json:{read:te,write:!0}})],ce.prototype,"geometry",void 0),r([T("geometry")],ce.prototype,"writeGeometry",null),r([o({json:{write:!0}})],ce.prototype,"objectIds",void 0),r([Wt(Zt,{ignoreUnknown:!1,name:"spatialRel"})],ce.prototype,"spatialRelationship",void 0),r([o({type:Pt,json:{name:"time",write:!0}})],ce.prototype,"timeExtent",void 0),r([o({type:String,json:{write:!0}})],ce.prototype,"where",void 0),ce=r([b("esri.rest.support.ImageGPSInfoParameters")],ce);const Yr=ce;var St;let me=St=class extends ee{constructor(){super(...arguments),this.type="height",this.fromGeometry=null,this.toGeometry=null,this.operationType="base-and-top",this.linearUnit="meters"}writeFromGeometry(s,i,a){s!=null&&(i.geometryType=ie(s),i[a]=s.toJSON())}get measureOperation(){return this.operationType}clone(){return new St(Q({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,operationType:this.operationType,linearUnit:this.linearUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};r([o({type:A,json:{read:!0}})],me.prototype,"fromGeometry",void 0),r([T("fromGeometry")],me.prototype,"writeFromGeometry",null),r([o({type:A,json:{read:!0,write:!0}})],me.prototype,"toGeometry",void 0),r([o({type:W.apiValues,json:{write:W.write}})],me.prototype,"measureOperation",null),r([o({json:{read:!0}})],me.prototype,"operationType",void 0),r([o({type:String,json:{read:be.read,write:be.write}})],me.prototype,"linearUnit",void 0),me=St=r([b("esri.rest.support.ImageHeightParameters")],me);const es=me;var xt;let N=xt=class extends P{constructor(){super(...arguments),this.geometry=null,this.rasterFunctions=null,this.pixelSize=null,this.returnGeometry=!0,this.returnCatalogItems=!0,this.returnPixelValues=!0,this.maxItemCount=null,this.timeExtent=null,this.raster=void 0,this.viewId=void 0,this.processAsMultidimensional=!1}writeGeometry(s,i,a){s!=null&&(i.geometryType=ie(s),i[a]=JSON.stringify(s.toJSON()))}set mosaicRule(s){let i=s;i!=null&&i.mosaicMethod&&(i=k.fromJSON({...i.toJSON(),mosaicMethod:i.mosaicMethod,mosaicOperation:i.mosaicOperation})),this._set("mosaicRule",i)}writeMosaicRule(s,i,a){s!=null&&(i[a]=JSON.stringify(s.toJSON()))}get renderingRule(){return Ve(we.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._get("rasterFunction")}set renderingRule(s){Ve(we.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._set("rasterFunction",s)}get renderingRules(){return Ve(we.getLogger(this),"renderingRules",{replacement:"rasterFunctions",version:"4.27",warnOnce:!0}),this._get("rasterFunctions")}set renderingRules(s){Ve(we.getLogger(this),"renderingRules",{replacement:"rasterFunctions",version:"4.27",warnOnce:!0}),this._set("rasterFunctions",s)}set rasterFunction(s){let i=s;i!=null&&i.rasterFunction&&(i=S.fromJSON({...i.toJSON(),rasterFunction:i.rasterFunction,rasterFunctionArguments:i.rasterFunctionArguments})),this._set("rasterFunction",i)}writeRasterFunction(s,i,a){s!=null&&(i[a]=JSON.stringify(s.toJSON())),s.rasterFunctionDefinition&&(i[a]=JSON.stringify(s.rasterFunctionDefinition))}writeRasterFunctions(s,i,a){s!=null&&(i[a]=JSON.stringify(s.map(e=>e.rasterFunctionDefinition||e.toJSON())))}writePixelSize(s,i,a){s!=null&&(i[a]=JSON.stringify(s))}writeTimeExtent(s,i,a){if(s!=null){const e=s.start!=null?s.start.getTime():null,t=s.end!=null?s.end.getTime():null;i[a]=e!=null?t!=null?`${e},${t}`:`${e}`:null}}clone(){return new xt(Q({geometry:this.geometry,mosaicRule:this.mosaicRule,rasterFunction:this.rasterFunction,rasterFunctions:this.rasterFunctions,pixelSize:this.pixelSize,returnGeometry:this.returnGeometry,returnCatalogItems:this.returnCatalogItems,returnPixelValues:this.returnPixelValues,maxItemCount:this.maxItemCount,processAsMultidimensional:this.processAsMultidimensional,raster:this.raster,viewId:this.viewId,timeExtent:this.timeExtent}))}};r([o({json:{write:!0}})],N.prototype,"geometry",void 0),r([T("geometry")],N.prototype,"writeGeometry",null),r([o({type:k,json:{write:!0}})],N.prototype,"mosaicRule",null),r([T("mosaicRule")],N.prototype,"writeMosaicRule",null),r([o({type:S})],N.prototype,"renderingRule",null),r([o({type:[S]})],N.prototype,"renderingRules",null),r([o({type:S,json:{write:!0,name:"renderingRule"}})],N.prototype,"rasterFunction",null),r([T("rasterFunction")],N.prototype,"writeRasterFunction",null),r([o({type:[S],json:{write:!0,name:"renderingRules"}})],N.prototype,"rasterFunctions",void 0),r([T("rasterFunctions")],N.prototype,"writeRasterFunctions",null),r([o({type:A,json:{write:!0}})],N.prototype,"pixelSize",void 0),r([T("pixelSize")],N.prototype,"writePixelSize",null),r([o({type:Boolean,json:{write:!0}})],N.prototype,"returnGeometry",void 0),r([o({type:Boolean,json:{write:!0}})],N.prototype,"returnCatalogItems",void 0),r([o({type:Boolean,json:{write:!0}})],N.prototype,"returnPixelValues",void 0),r([o({type:Number,json:{write:!0}})],N.prototype,"maxItemCount",void 0),r([o({type:Pt,json:{write:{target:"time"}}})],N.prototype,"timeExtent",void 0),r([T("timeExtent")],N.prototype,"writeTimeExtent",null),r([o({json:{write:!0}})],N.prototype,"raster",void 0),r([o({json:{write:!0}})],N.prototype,"viewId",void 0),r([o({type:Boolean,json:{write:!0}})],N.prototype,"processAsMultidimensional",void 0),N=xt=r([b("esri.rest.support.ImageIdentifyParameters")],N);const At=N;var It;let $e=It=class extends P{constructor(){super(...arguments),this.geometries=null,this.rasterId=null}writeGeometry(s,i,a){i.geometries={geometryType:"esriGeometryPoint",geometries:s.map(e=>e.toJSON())}}clone(){var s;return new It({geometries:((s=this.geometries)==null?void 0:s.map(i=>i.clone()))??[],rasterId:this.rasterId})}};r([o({type:[A],json:{write:!0}})],$e.prototype,"geometries",void 0),r([T("geometries")],$e.prototype,"writeGeometry",null),r([o({type:Be,json:{write:!0}})],$e.prototype,"rasterId",void 0),$e=It=r([b("esri.rest.support.ImagePixelLocationParameters")],$e);const ts=$e;var Ft;let Te=Ft=class extends ee{constructor(){super(...arguments),this.type="point",this.geometry=null,this.is3D=!1}writeGeometry(s,i,a){s!=null&&(i.geometryType=ie(s),i[a]=s.toJSON())}get measureOperation(){const{is3D:s,geometry:i}=this;return i.type==="point"?s?"point-3D":"point":s?"centroid-3D":"centroid"}clone(){return new Ft(Q({geometry:this.geometry,is3D:this.is3D,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};r([o({types:oe,json:{name:"fromGeometry",read:te}})],Te.prototype,"geometry",void 0),r([T("geometry")],Te.prototype,"writeGeometry",null),r([o({type:W.apiValues,json:{read:W.read,write:W.write}})],Te.prototype,"measureOperation",null),r([o({json:{read:!0}})],Te.prototype,"is3D",void 0),Te=Ft=r([b("esri.rest.support.ImagePointParameters")],Te);const is=Te;var Dt;let q=Dt=class extends P{constructor(){super(...arguments),this.geometry=null,this.interpolation="nearest",this.mosaicRule=null,this.outFields=null,this.pixelSize=null,this.returnFirstValueOnly=!0,this.sampleDistance=null,this.sampleCount=null,this.sliceId=null,this.timeExtent=null}writeGeometry(s,i,a){s!=null&&(i.geometryType=ie(s),i[a]=s.toJSON())}set locations(s){if(s!=null&&s.length){const i=new Kt({spatialReference:s[0].spatialReference});i.points=s.map(a=>[a.x,a.y]),this._set("locations",s),this.geometry=i}}clone(){return new Dt(Q({geometry:this.geometry,locations:this.locations,interpolation:this.interpolation,mosaicRule:this.mosaicRule,outFields:this.outFields,raster:this.raster,returnFirstValueOnly:this.returnFirstValueOnly,sampleDistance:this.sampleDistance,sampleCount:this.sampleCount,sliceId:this.sliceId,pixelSize:this.pixelSize,timeExtent:this.timeExtent}))}};r([o({types:oe,json:{read:te}})],q.prototype,"geometry",void 0),r([T("geometry")],q.prototype,"writeGeometry",null),r([o()],q.prototype,"locations",null),r([o({type:String,json:{type:ve.jsonValues,read:ve.read,write:ve.write}})],q.prototype,"interpolation",void 0),r([o({type:k,json:{write:!0}})],q.prototype,"mosaicRule",void 0),r([o({type:[String],json:{write:!0}})],q.prototype,"outFields",void 0),r([o({type:A,json:{write:!0}})],q.prototype,"pixelSize",void 0),r([o({type:String,json:{write:!0}})],q.prototype,"raster",void 0),r([o({type:Boolean,json:{write:!0}})],q.prototype,"returnFirstValueOnly",void 0),r([o({type:Number,json:{write:!0}})],q.prototype,"sampleDistance",void 0),r([o({type:Number,json:{write:!0}})],q.prototype,"sampleCount",void 0),r([o({type:Number,json:{write:!0}})],q.prototype,"sliceId",void 0),r([o({type:Pt,json:{read:{source:"time"},write:{target:"time"}}})],q.prototype,"timeExtent",void 0),q=Dt=r([b("esri.rest.support.ImageSampleParameters")],q);const rs=q;let Pe=class extends Se(P){constructor(){super(...arguments),this.geometries=[],this.rasterIds=null,this.outSpatialReference=null}writeGeometries(i,a,e){a.geometries=i!=null&&i.length?{geometryType:ie(i[0]),geometries:i.map(t=>({...t.toJSON(),spatialReference:void 0}))}:null}};r([o({types:[oe]})],Pe.prototype,"geometries",void 0),r([T("geometries")],Pe.prototype,"writeGeometries",null),r([o({type:[Be],json:{write:!0}})],Pe.prototype,"rasterIds",void 0),r([o({type:se,json:{name:"outSR",write:!0}})],Pe.prototype,"outSpatialReference",void 0),Pe=r([b("esri.rest.support.ImageToMapMultirayParameters")],Pe);const ss=Pe;let de=class extends Se(P){constructor(){super(...arguments),this.geometry=null,this.rasterId=null,this.outSpatialReference=null,this.depthOffset=0,this.adjust=!1}writeGeometry(i,a,e){i!=null&&(a.geometryType=ie(i),a[e]={...i.toJSON(),spatialReference:void 0})}};r([o({types:oe,json:{read:te,write:!0}})],de.prototype,"geometry",void 0),r([T("geometry")],de.prototype,"writeGeometry",null),r([o({json:{write:!0}})],de.prototype,"rasterId",void 0),r([o({type:se,json:{name:"outSR",write:!0}})],de.prototype,"outSpatialReference",void 0),r([o({json:{name:"options.DOff",write:!0}})],de.prototype,"depthOffset",void 0),r([o({json:{name:"options.Adjust",write:!0}})],de.prototype,"adjust",void 0),de=r([b("esri.rest.support.ImageToMapParameters")],de);const ns=de;let at=class extends Se(P){constructor(){super(...arguments),this.referenceUri=null}};r([o({type:String,json:{name:"uri",write:!0}})],at.prototype,"referenceUri",void 0),at=r([b("esri.rest.support.ImageUrlParameters")],at);const as=at;let je=class extends Se(P){constructor(){super(...arguments),this.geometry=null,this.rasterId=null,this.visibleOnly=!1}writeGeometry(s,i,a){s!=null&&(i.geometryType=ie(s),i[a]=JSON.stringify(s))}};r([o({types:oe,json:{read:te,write:!0}})],je.prototype,"geometry",void 0),r([T("geometry")],je.prototype,"writeGeometry",null),r([o({json:{write:!0}})],je.prototype,"rasterId",void 0),r([o({json:{name:"options.VisibleOnly",write:!0}})],je.prototype,"visibleOnly",void 0),je=r([b("esri.rest.support.MapToImageParameters")],je);const os=je;var Tt;let Ae=Tt=class extends P{constructor(){super(...arguments),this.geometry=null,this.rasterId=void 0}writeGeometry(s,i,a){s!=null&&(i.geometryType=ie(s),i[a]={...s.toJSON(),spatialReference:void 0})}clone(){const s=Q({geometry:this.geometry,rasterId:this.rasterId});return new Tt(s)}};r([o({types:oe,json:{name:"fromGeometry",read:te,write:!0}})],Ae.prototype,"geometry",void 0),r([T("geometry")],Ae.prototype,"writeGeometry",null),r([o({json:{write:!0}})],Ae.prototype,"rasterId",void 0),Ae=Tt=r([b("esri.rest.support.MeasureFromImageParameters")],Ae);const Vt=Ae,ls=new Set(["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"]),us=ri(si,{min:0,max:255});function ps(s){if(!s)return null;const i=JSON.stringify(s).match(/"rasterFunction":"(.*?")/gi),a=i==null?void 0:i.map(e=>e.replace('"rasterFunction":"',"").replace('"',""));return a?a.join("/"):null}const cs=s=>{let i=class extends s{constructor(){super(...arguments),this._functionRasterInfos={},this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this._cachedRendererJson=null,this._serviceSupportsMosaicRule=null,this._rasterAttributeTableFieldPrefix="Raster.",this.adjustAspectRatio=null,this.bandIds=void 0,this.capabilities=null,this.compressionQuality=void 0,this.compressionTolerance=.01,this.copyright=null,this.defaultMosaicRule=null,this.definitionExpression=null,this.exportImageServiceParameters=null,this.rasterInfo=null,this.fields=null,this.fullExtent=null,this.hasMultidimensions=!1,this.imageMaxHeight=4100,this.imageMaxWidth=4100,this.interpolation=void 0,this.minScale=0,this.maxScale=0,this.multidimensionalInfo=null,this.multidimensionalSubset=null,this.noData=null,this.noDataInterpretation=void 0,this.objectIdField=null,this.geometryType="polygon",this.typeIdField=null,this.types=[],this.pixelFilter=null,this.raster=void 0,this.sourceType=null,this.viewId=void 0,this.symbolizer=null,this.rasterFunctionInfos=null,this.serviceDataType=null,this.spatialReference=null,this.pixelType=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.url=null,this.version=void 0}initialize(){this._set("exportImageServiceParameters",new O({layer:this}))}readServiceSupportsMosaicRule(e,t){return this._isMosaicRuleSupported(t)}get _rasterFunctionNamesIndex(){const e=new Map;return!this.rasterFunctionInfos||this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.length<1||this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.forEach(t=>{e.set(t.name.toLowerCase().replaceAll(/ /gi,"_"),t.name)}),e}readBandIds(e,t){if(Array.isArray(e)&&e.length>0&&e.every(n=>typeof n=="number"))return e}readCapabilities(e,t){return this._readCapabilities(t)}writeCompressionQuality(e,t,n){e!=null&&this.format!=="lerc"&&(t[n]=e)}writeCompressionTolerance(e,t,n){this.format==="lerc"&&e!=null&&(t[n]=e)}readDefaultMosaicRule(e,t){return this._serviceSupportsMosaicRule?k.fromJSON(t):null}get fieldsIndex(){return this.fields?new Ui(this.fields):null}set format(e){e&&ls.has(e.toLowerCase())&&this._set("format",e.toLowerCase())}readFormat(e,t){return t.serviceDataType==="esriImageServiceDataTypeVector-UV"||t.serviceDataType==="esriImageServiceDataTypeVector-MagDir"||this.pixelFilter!=null?"lerc":"jpgpng"}readMinScale(e,t){return t.minLOD!=null&&t.maxLOD!=null?e:0}readMaxScale(e,t){return t.minLOD!=null&&t.maxLOD!=null?e:0}set mosaicRule(e){let t=e;t!=null&&t.mosaicMethod&&(t=k.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}readMosaicRule(e,t){const n=e||t.mosaicRule;return n?k.fromJSON(n):this._isMosaicRuleSupported(t)?k.fromJSON(t):null}writeMosaicRule(e,t,n){let l=this.mosaicRule;const u=this.definitionExpression;l?u&&u!==l.where&&(l=l.clone(),l.where=u):u&&(l=new k({where:u})),this._isValidCustomizedMosaicRule(l)&&(t[n]=l.toJSON())}writeNoData(e,t,n){e!=null&&typeof e=="number"&&(t[n]=us(e))}readObjectIdField(e,t){if(!e){const n=t.fields.find(l=>l.type==="esriFieldTypeOID"||l.type==="oid");e=n==null?void 0:n.name}return e}get parsedUrl(){return ei(this.url)}readSourceType(e,t){return this._isMosaicDataset(t)?"mosaic-dataset":"raster-dataset"}set renderer(e){this.loaded&&(e=this._configRenderer(e)),this._set("renderer",e)}readRenderer(e,t,n){var p,m;const l=(m=(p=t==null?void 0:t.layerDefinition)==null?void 0:p.drawingInfo)==null?void 0:m.renderer,u=Si(l,n);return u==null?null:(u.type==="vector-field"&&t.symbolTileSize&&!l.symbolTileSize&&(u.symbolTileSize=t.symbolTileSize),Gt(u)||we.getLogger(this).warn("ArcGISImageService","Imagery layer doesn't support given renderer type."),u)}writeRenderer(e,t,n){t.layerDefinition=t.layerDefinition||{},t.layerDefinition.drawingInfo=t.layerDefinition.drawingInfo||{},t.layerDefinition.drawingInfo.renderer=e.toJSON(),e.type==="vector-field"&&(t.symbolTileSize=e.symbolTileSize)}get rasterFields(){var m;const e=this._rasterAttributeTableFieldPrefix,t=new Fe({name:"Raster.ItemPixelValue",alias:"Item Pixel Value",domain:null,editable:!1,length:50,type:"string"}),n=new Fe({name:"Raster.ServicePixelValue",alias:"Service Pixel Value",domain:null,editable:!1,length:50,type:"string"}),l=new Fe({name:"Raster.ServicePixelValue.Raw",alias:"Raw Service Pixel Value",domain:null,editable:!1,length:50,type:"string"});let u=this.fields?Q(this.fields):[];u.push(n),(m=this.capabilities)!=null&&m.operations.supportsQuery&&this.fields&&this.fields.length>0&&u.push(t),this.version>=10.4&&this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.some(c=>c.name.toLowerCase()==="none")&&u.push(l),this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.filter(c=>c.name.toLowerCase()!=="none").forEach(c=>{u.push(new Fe({name:"Raster.ServicePixelValue."+c.name,alias:c.name,domain:null,editable:!1,length:50,type:"string"}))}),this._isVectorDataSet()&&(u.push(new Fe({name:"Raster.Magnitude",alias:"Magnitude",domain:null,editable:!1,type:"double"})),u.push(new Fe({name:"Raster.Direction",alias:"Direction",domain:null,editable:!1,type:"double"})));const{attributeTable:p}=this.rasterInfo??{};if(p!=null){const c=p.fields.filter(d=>d.type!=="esriFieldTypeOID"&&d.name.toLowerCase()!=="value").map(d=>{const h=Q(d);return h.name=e+d.name,h});u=u.concat(c)}return u}get renderingRule(){return Ve(we.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this.rasterFunction}set renderingRule(e){Ve(we.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._set("rasterFunction",e)}set rasterFunction(e){let t=e;t!=null&&t.rasterFunction&&(t=S.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("rasterFunction",t)}readRasterFunction(e,t){const n=t.rasterFunctionInfos;return t.renderingRule||n!=null&&n.length&&n[0].name!=="None"?this._isRFTJson(t.renderingRule)?S.fromJSON({rasterFunctionDefinition:t.renderingRule}):S.fromJSON(t.renderingRule||{rasterFunctionInfos:t.rasterFunctionInfos}):null}readSpatialReference(e,t){const n=e||t.extent.spatialReference;return n?se.fromJSON(n):null}readPixelType(e){return dt.fromJSON(e)||e}writePixelType(e,t,n){this.serviceRasterInfo!=null&&this.pixelType===this.serviceRasterInfo.pixelType||(t[n]=dt.toJSON(e))}readVersion(e,t){let n=t.currentVersion;return n||(n=t.hasOwnProperty("fields")||t.hasOwnProperty("timeInfo")?10:9.3),n}applyFilter(e){let t=e;return this.pixelFilter&&(t=this._clonePixelData(e),this.pixelFilter(t)),t}async applyRenderer(e,t){let n=e;const{renderer:l,symbolizer:u,pixelFilter:p,bandIds:m}=this;if(!this._isPicture()&&l&&u&&!p){const c=JSON.stringify(this._cachedRendererJson)!==JSON.stringify(l.toJSON()),d=this._rasterJobHandler.instance;if(d){c&&(u.bind(),await d.updateSymbolizer(u,t),this._cachedRendererJson=l.toJSON());const h=await d.symbolize({bandIds:m,...e},t);n={extent:e.extent,pixelBlock:h}}else n={extent:e.extent,pixelBlock:u.symbolize({bandIds:m,...e})}}return n}destroy(){this._shutdownJobHandler()}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}async computeAngles(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsComputeAngles)throw new I("imagery-layer:compute-angles","this operation is not supported on the input image service");return e=$(Wr,e).clone(),jr(this.url,e,this._getRequestOptions(t))}async computePixelSpaceLocations(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsComputePixelLocation)throw new I("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return e=$(ts,e).clone(),Nr(this.url,e,this._getRequestOptions(t))}async computeHistograms(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsComputeHistograms)throw new I("imagery-layer:compute-histograms","this operation is not supported on the input image service");return e=$(yt,e).clone(),this._applyMosaicAndRenderingRules(e),Or(this.url,e,this._getRequestOptions(t))}async computeStatisticsHistograms(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsComputeStatisticsHistograms)throw new I("imagery-layer:compute-statistics-histograms","this operation is not supported on the input image service");return e=$(yt,e).clone(),this._applyMosaicAndRenderingRules(e),_r(this.url,e,this._getRequestOptions(t))}async measureHeight(e,t){const n=await this._fetchCapabilities(t==null?void 0:t.signal);if(!(e.operationType==="base-and-top"?n.mensuration.supportsHeightFromBaseAndTop:e.operationType==="base-and-top-shadow"?n.mensuration.supportsHeightFromBaseAndTopShadow:n.mensuration.supportsHeightFromTopAndTopShadow))throw new I("imagery-layer:measure-height","this operation is not supported on the input image service");return e=$(es,e).clone(),this._applyMosaicAndRenderingRules(e),$r(this.url,e,this._getRequestOptions(t))}async measureAreaAndPerimeter(e,t){const n=await this._fetchCapabilities(t==null?void 0:t.signal);if(!(n.mensuration.supportsAreaAndPerimeter&&(!e.is3D||n.mensuration.supports3D)))throw new I("imagery-layer:measure-area-and-perimeter","this operation is not supported on the input image service");return e=$(Zr,e).clone(),this._applyMosaicAndRenderingRules(e),Ar(this.url,e,this._getRequestOptions(t))}async measureDistanceAndAngle(e,t){const n=await this._fetchCapabilities(t==null?void 0:t.signal);if(!(n.mensuration.supportsDistanceAndAngle&&(!e.is3D||n.mensuration.supports3D)))throw new I("imagery-layer:measure-distance-and-angle","this operation is not supported on the input image service");return e=$(Xr,e).clone(),this._applyMosaicAndRenderingRules(e),Mr(this.url,e,this._getRequestOptions(t))}async measurePointOrCentroid(e,t){const n=await this._fetchCapabilities(t==null?void 0:t.signal);if(!(n.mensuration.supportsPointOrCentroid&&(!e.is3D||n.mensuration.supports3D)))throw new I("imagery-layer:measure-point-or-centroid","this operation is not supported on the input image service");return e=$(is,e).clone(),this._applyMosaicAndRenderingRules(e),Vr(this.url,e,this._getRequestOptions(t))}async measureLengthFromImage(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsMeasureFromImage)throw new I("imagery-layer:measure-length-from-image","this operation is not supported on the input image service");if(e.geometry.type!=="polyline")throw new I("imagery-layer:measure-length-from-image","this input geometry must be a polyline");return e=$(Vt,e).clone(),Jr(this.url,e,this._getRequestOptions(t))}async measureAreaFromImage(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsMeasureFromImage)throw new I("imagery-layer:measure-area-from-image","this operation is not supported on the input image service");if(e.geometry.type!=="polygon")throw new I("imagery-layer:measure-area-from-image","this input geometry must be a polygon");return e=$(Vt,e).clone(),Er(this.url,e,this._getRequestOptions(t))}getField(e){const{fieldsIndex:t}=this;return t!=null?t.get(e):void 0}getFieldDomain(e,t){const n=this.getField(e);return n?n.domain:null}async fetchImage(e,t,n,l={}){if(e==null||t==null||n==null)throw new I("imagery-layer:fetch-image","Insufficient parameters for requesting an image. A valid extent, width and height values are required.");if(this.renderer||this.symbolizer){const d=await this._generateRasterInfo(this.rasterFunction,{signal:l.signal});d&&(this.rasterInfo=d)}const u=this.getExportImageServiceParameters(e,t,n,l.timeExtent);if(u==null){if(l.requestAsImageElement&&this._canRequestImageElement(this.format)){const g=document.createElement("canvas");return g.width=t,g.height=n,l.returnImageBitmap?{imageBitmap:await Ct(g,`${a(this.parsedUrl)}/exportImage`,l.signal)}:{imageOrCanvasElement:g}}const{bandIds:d,rasterInfo:h}=this,R=((d==null?void 0:d.length)||h.bandCount)??0,f=t*n,w=h.pixelType,y=[];for(let g=0;g=10.3?e==null?void 0:e.rasterFunction:null})}).then(t=>t.data)}fetchRasterAttributeTable(e){return this.version<10.1?Promise.reject(new I("#fetchRasterAttributeTable()","Failed to get rasterAttributeTable")):D(a(this.parsedUrl)+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.3?e==null?void 0:e.rasterFunction:null})}).then(t=>qt.fromJSON(t.data))}getCatalogItemRasterInfo(e,t){const n={...t,query:this._getQueryParams()};return Qr(a(this.parsedUrl),e,n)}async getCatalogItemICSInfo(e,t){var xe,Ie,le,Nt,_t;const{data:n}=await D(a(this.parsedUrl)+"/"+e+"/info/ics",{query:this._getQueryParams(),...t}),l=n==null?void 0:n.ics;if(!l)return;let u=null;try{u=(await D(a(this.parsedUrl)+"/"+e+"/info",{query:this._getQueryParams(),...t})).data.extent}catch{}if(!u||!u.spatialReference)return{ics:l,icsToPixelTransform:null,icsExtent:null,northDirection:null};const p=this.version>=10.7?D(a(this.parsedUrl)+"/"+e+"/info/icstopixel",{query:this._getQueryParams(),...t}).then(x=>x.data).catch(()=>({})):{},m=u.spatialReference,c={geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[u]}),inSR:wt(m),outSR:"0:"+e},d=D(a(this.parsedUrl)+"/project",{query:this._getQueryParams(c),...t}).then(x=>x.data).catch(()=>({})),h=5,R=(u.xmin+u.xmax)/2,f=(u.ymax-u.ymin)/(h+1),w=u.ymin+f,y=[];for(let x=0;xx.data).catch(()=>({})),_=await Promise.all([p,d,v]);let G=_[0].ipxf;if(G==null){const x=(xe=l.geodataXform)==null?void 0:xe.xf_0;((Ie=x==null?void 0:x.name)==null?void 0:Ie.toLowerCase())==="topup"&&((le=x==null?void 0:x.coefficients)==null?void 0:le.length)===6&&(G={affine:{name:"ics [sensor: Frame] to pixel (column, row) transformation",coefficients:x.coefficients,cellsizeRatio:0,type:"GeometricXform"}})}const J=ze.fromJSON((_t=(Nt=_[1])==null?void 0:Nt.geometries)==null?void 0:_t[0]);J&&(J.spatialReference=new se({wkid:0,imageCoordinateSystem:l}));const F=_[2].geometries?_[2].geometries.filter(x=>(x==null?void 0:x.x)!=null&&x.y!=null&&x.x!=="NaN"&&x.y!=="NaN"):[],H=F.length;if(H<3)return{ics:l,icsToPixelTransform:G,icsExtent:J,northDirection:null};let Z=0,C=0,j=0,L=0;for(let x=0;xF[0].x,ke=F[h-1].y>F[0].y;return E===1/0?ye=ke?90:270:E===0?ye=Qe?0:180:E>0?ye=Qe?180*Math.atan(E)/Math.PI:180*Math.atan(E)/Math.PI+180:E<0&&(ye=ke?180+180*Math.atan(E)/Math.PI:360+180*Math.atan(E)/Math.PI),{ics:l,icsToPixelTransform:G,icsExtent:J,northDirection:ye}}async generateRasterInfo(e,t){var p;if(e=$(S,e),this.serviceRasterInfo&&(!e||((p=e.functionName)==null?void 0:p.toLowerCase())==="none"||this._isVectorFieldResampleFunction(e)))return this.serviceRasterInfo;const n=ps(e);if(!n)throw new I("imagery-layer:generate-raster-info","the rendering rule is not supported");if(this._functionRasterInfos[n])return this._functionRasterInfos[n];const l={...t,query:this._getQueryParams()},u=xi(a(this.parsedUrl),e,l);this._functionRasterInfos[n]=u;try{return await u}catch(m){throw this._functionRasterInfos[n]=null,m}}getExportImageServiceParameters(e,t,n,l){var y;e=e.clone().shiftCentralMeridian();const u=Je(e.spatialReference,a(this.parsedUrl));this.pixelType!==this.serviceRasterInfo.pixelType&&(this.exportImageServiceParameters.pixelType=this.pixelType);const p=this.exportImageServiceParameters.toJSON(),{bandIds:m,noData:c}=p;let{renderingRule:d}=p;const h=(y=this.rasterFunction)==null?void 0:y.rasterFunctionDefinition,R=!this.renderer||this.renderer.type==="raster-stretch";if(m!=null&&m.length&&this._hasRasterFunction(this.rasterFunction)&&!h&&R){const g={rasterFunction:"ExtractBand",rasterFunctionArguments:{BandIds:m}};if(d.rasterFunction==="Stretch")g.rasterFunctionArguments.Raster=d.rasterFunctionArguments.Raster,d.rasterFunctionArguments.Raster=g;else if(d.rasterFunction==="Colormap"){const v=d.rasterFunctionArguments.Raster;(v==null?void 0:v.rasterFunction)==="Stretch"?(g.rasterFunctionArguments.Raster=v.rasterFunctionArguments.Raster,v.rasterFunctionArguments.Raster=g):(g.rasterFunctionArguments.Raster=v,d.rasterFunctionArguments.Raster=g)}else g.rasterFunctionArguments.Raster=d,d=g;p.bandIds=void 0}else p.bandIds=m==null?void 0:m.join(",");c instanceof Array&&c.length>0&&(p.noData=c.join(","));const f=this._processMultidimensionalIntersection(null,l,this.exportImageServiceParameters.mosaicRule);if(f.isOutSide)return null;p.mosaicRule=f.mosaicRule!=null?JSON.stringify(f.mosaicRule):null,l=f.timeExtent,p.renderingRule=this._getRenderingRuleString(S.fromJSON(d));const w={};if(l!=null){const{start:g,end:v}=l.toJSON();g&&v&&g===v?w.time=""+g:g==null&&v==null||(w.time=`${g??"null"},${v??"null"}`)}return{bbox:e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:u,imageSR:u,size:t+","+n,...p,...w}}async getSamples(e,t){const n=await this._fetchCapabilities(t==null?void 0:t.signal);if(!(n!=null&&n.operations.supportsGetSamples))throw new I("imagery-layer:get-samples","getSamples operation is not supported on the input image service");e=$(rs,e).clone();const{raster:l}=this;return l&&e.raster==null&&(e.raster=l),Cr(this.url,e,this._getRequestOptions(t))}async identify(e,t){var p;if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsIdentify)throw new I("imagery-layer:identify","identify operation is not supported on the input image service");e=$(At,e).clone(),this.version<10.91&&((p=e.geometry)==null?void 0:p.type)==="extent"&&(e.geometry=Ze.fromExtent(e.geometry));const n=this._processMultidimensionalIntersection(e.geometry,e.timeExtent,e.mosaicRule||this.mosaicRule);if(n.isOutSide)throw new I("imagery-layer:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");e.timeExtent=n.timeExtent,e.mosaicRule=n.mosaicRule;const{raster:l,rasterFunction:u}=this;return u&&e.rasterFunction==null&&(e.rasterFunction=u),l&&e.raster==null&&(e.raster=l),$t(this.url,e,this._getRequestOptions(t))}async imageToMap(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsImageToMap)throw new I("imagery-layer:image-to-map","imageToMap operation is not supported on the input image service");return e=$(ns,e),Lr(a(this.parsedUrl),e,this._getRequestOptions(t))}async imageToMapMultiray(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsImageToMapMultiray)throw new I("imagery-layer:image-to-map-multiray","imageToMapMultiray operation is not supported on the input image service");return e=$(ss,e),zr(a(this.parsedUrl),e,this._getRequestOptions(t))}async mapToImage(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsMapToImage)throw new I("imagery-layer:map-to-image","mapToImage operation is not supported on the input image service");return e=$(os,e),Ur(a(this.parsedUrl),e,this._getRequestOptions(t))}async findImages(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsFindImages)throw new I("imagery-layer:find-images","findImages operation is not supported on the input image service");return e=$(kr,e),Br(a(this.parsedUrl),e,this._getRequestOptions(t))}async getImageUrl(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsGetImageUrl)throw new I("imagery-layer:get-image-url","getImageUrl operation is not supported on the input image service");return e=$(as,e),Hr(a(this.parsedUrl),e,this._getRequestOptions(t))}createQuery(){const e=new mt;return e.outFields=["*"],e.returnGeometry=!0,e.where=this.definitionExpression||"1=1",e}async queryBoundary(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsQueryBoundary)throw new I("imagery-layer:query-boundary","queryBoundary operation is not supported on the input image service");return e=$(Kr,e??{outSpatialReference:this.spatialReference}).clone(),qr(a(this.parsedUrl),e,this._getRequestOptions(t))}async queryRasters(e,t){return{query:e,requestOptions:t}=await this._prepareForQuery(e,t),Hi(this.url,e,t)}async queryObjectIds(e,t){return{query:e,requestOptions:t}=await this._prepareForQuery(e,t),Bi(this.url,e,t)}async queryGPSInfo(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsQueryGPSInfo)throw new I("imagery-layer:query-gps-info","queryGPSInfo operation is not supported on the input image service");return e=$(Yr,e??{outSpatialReference:this.spatialReference}).clone(),Gr(a(this.parsedUrl),e,this._getRequestOptions(t))}async queryRasterCount(e,t){return{query:e,requestOptions:t}=await this._prepareForQuery(e,t),Qi(this.url,e,t)}async queryVisibleRasters(e,t){var J,F,H,Z;if(!e)throw new I("imagery-layer: query-visible-rasters","missing query parameter");await this.load();const{pixelSize:n,returnDomainValues:l,returnTopmostRaster:u,showNoDataRecords:p}=t||{pixelSize:null,returnDomainValues:!1,returnTopmostRaster:!1,showNoDataRecords:!1};let m=!1,c=null,d=null;const h="raster.servicepixelvalue",R=this._rasterFunctionNamesIndex;if(e.outFields!=null&&(m=e.outFields.some(C=>!C.toLowerCase().includes(h)),this.version>=10.4)){const C=e.outFields.filter(L=>L.toLowerCase().includes(h)&&L.length>h.length).map(L=>{const E=L.slice(h.length+1);return[this._updateRenderingRulesFunctionName(E,R),E]});c=C.map(L=>new S({functionName:L[0]})),d=C.map(L=>L[1]);const{rasterFunction:j}=this;c.length===0?j!=null&&j.functionName?(c.push(j),d.push(j.functionName)):c=null:j!=null&&j.functionName&&!c.some(L=>L.functionName===j.functionName)&&(c.push(j),d.push(j.functionName))}const f=e.outSpatialReference==null||e.outSpatialReference.equals(this.spatialReference),{multidimensionalSubset:w}=this;let y=e.timeExtent||this.timeExtent;if(w){const{isOutside:C,intersection:j}=ht(w,{geometry:e.geometry,timeExtent:e.timeExtent,multidimensionalDefinition:(J=this.exportImageServiceParameters.mosaicRule)==null?void 0:J.multidimensionalDefinition});if(C)throw new I("imagery-layer:query-visible-rasters","the request cannot be fulfilled when falling outside of the multidimensional subset");(j==null?void 0:j.timeExtent)!=null&&(y=j.timeExtent)}const g=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,y);let v=e.geometry;this.version<10.91&&(v==null?void 0:v.type)==="extent"&&(v=Ze.fromExtent(v));const _=this._getQueryParams({geometry:v,timeExtent:y,mosaicRule:g,rasterFunction:this.version<10.4?this.rasterFunction:null,rasterFunctions:c,pixelSize:n,returnCatalogItems:m,returnGeometry:f,raster:this.raster,maxItemCount:u?1:null});delete _.f;const G=new At(_);try{await this._generateRasterInfo(this.rasterFunction);const C=await $t(this.url,G,{signal:t==null?void 0:t.signal,query:{...this.customParameters}}),j=e.outFields,L=C.value!=null&&C.value.toLowerCase().includes("nodata");if(!(m&&!f&&((F=C==null?void 0:C.catalogItems)!=null&&F.features.length)&&(p||!L)))return this._processVisibleRastersResponse(C,{returnDomainValues:l,templateRRFunctionNames:d,showNoDataRecords:p,templateFields:j});const E=this.objectIdField||"ObjectId",ye=((H=C.catalogItems)==null?void 0:H.features)??[],Qe=ye.map(Ie=>{var le;return(le=Ie.attributes)==null?void 0:le[E]}),ke=new mt({objectIds:Qe,returnGeometry:!0,outSpatialReference:e.outSpatialReference,outFields:[E]}),xe=await this.queryRasters(ke);return(Z=xe==null?void 0:xe.features)!=null&&Z.length&&xe.features.forEach(Ie=>{ye.forEach(le=>{le.attributes[E]===Ie.attributes[E]&&(le.geometry=new Ze(Ie.geometry),e.outSpatialReference!=null&&(le.geometry.spatialReference=e.outSpatialReference))})}),this._processVisibleRastersResponse(C,{returnDomainValues:l,templateRRFunctionNames:d,showNoDataRecords:p,templateFields:j})}catch{throw new I("imagery-layer:query-visible-rasters","encountered error when querying visible rasters")}}async fetchVariableStatisticsHistograms(e,t){const n=D(a(this.parsedUrl)+"/statistics",{query:this._getQueryParams({variable:e}),signal:t}).then(p=>{var m;return(m=p.data)==null?void 0:m.statistics}),l=D(a(this.parsedUrl)+"/histograms",{query:this._getQueryParams({variable:e}),signal:t}).then(p=>{var m;return(m=p.data)==null?void 0:m.histograms}),u=await Promise.all([n,l]);return u[0]&&u[0].forEach(p=>{p.avg=p.mean,p.stddev=p.standardDeviation}),{statistics:u[0]||null,histograms:u[1]||null}}async createFlowMesh(e,t){const n=this._rasterJobHandler.instance;return n?n.createFlowMesh(e,t):Ai(e.meshType,e.simulationSettings,e.flowData,t.signal!=null?t.signal:new AbortController().signal)}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo.multidimensionalInfo;return _i(this.multidimensionalSubset,t)}async _fetchService(e){await this._fetchServiceInfo(e),this.rasterInfo||(this.rasterInfo=this.serviceRasterInfo);const t=this.sourceJSON,n=this.serviceRasterInfo!=null?Promise.resolve(this.serviceRasterInfo):Ii(a(this.parsedUrl),t,{signal:e,query:this._getQueryParams()}).then(p=>(this._set("serviceRasterInfo",p),this._set("multidimensionalInfo",p.multidimensionalInfo),Fi(p,t),p)),l=this._hasRasterFunction(this.rasterFunction)?this._generateRasterInfo(this.rasterFunction,{signal:e}):null,u=this._getRasterFunctionInfos();return Promise.all([n,l,u]).then(p=>{p[1]?this._set("rasterInfo",p[1]):this._set("rasterInfo",p[0]),p[2]&&this._set("rasterFunctionInfos",p[2]),this.renderer&&!this._isSupportedRenderer(this.renderer)&&(this._set("renderer",null),we.getLogger(this).warn("ArcGISImageService","Switching to the default renderer. Renderer applied is not valid for this Imagery Layer")),this._set("renderer",this._configRenderer(this.renderer)),this.addHandles([ti(()=>this.rasterFunction,c=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this._generateRasterInfo(c).then(d=>{d&&(this.rasterInfo=d)})})]);const{serviceRasterInfo:m}=this;m.multidimensionalInfo!=null&&this._updateMultidimensionalDefinition(m)})}_combineMosaicRuleWithTimeExtent(e,t){var w;const n=this.timeInfo,{multidimensionalInfo:l}=this.serviceRasterInfo;if(e==null||l==null||t==null||(n==null?void 0:n.startField)==null)return e;const{startField:u}=n,p=l.variables.some(y=>y.dimensions.some(g=>g.name===u))?u:"StdTime";if(e=e.clone(),this.sourceType==="mosaic-dataset")return e.multidimensionalDefinition=(w=e.multidimensionalDefinition)==null?void 0:w.filter(y=>y.dimensionName!==p),this._cleanupMultidimensionalDefinition(e);e.multidimensionalDefinition=e.multidimensionalDefinition||[];const m=e.multidimensionalDefinition.filter(y=>y.dimensionName===p),c=t.start!=null?t.start.getTime():null,d=t.end!=null?t.end.getTime():null,h=c==null||d==null||c===d,R=h?[c||d]:[[c,d]],f=this.version>=10.8;if(m.length)m.forEach(y=>{y.dimensionName===p&&(f?(y.dimensionName=null,y.isSlice=!1,y.values=[]):(y.isSlice=h,y.values=R))});else if(!f){const y=e.multidimensionalDefinition.filter(g=>g.variableName!=null&&g.dimensionName==null);y.length?y.forEach(g=>{g.dimensionName=p,g.isSlice=h,g.values=R}):e.multidimensionalDefinition.push(new Oi({variableName:"",dimensionName:p,isSlice:h,values:R}))}return this._cleanupMultidimensionalDefinition(e)}_cleanupMultidimensionalDefinition(e){return e==null?null:(e.multidimensionalDefinition&&(e.multidimensionalDefinition=e.multidimensionalDefinition.filter(t=>!(!t.variableName&&!t.dimensionName)),e.multidimensionalDefinition.length===0&&(e.multidimensionalDefinition=null)),this.sourceType!=="mosaic-dataset"&&e.multidimensionalDefinition==null?null:e)}async _prepareForQuery(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsQuery)throw new I("imagery-layer:query-rasters","query operation is not supported on the input image service");return e=e!=null?$(mt,e):this.createQuery(),t=this._getRequestOptions(t),this.raster&&(t.query={...t.query,raster:this.raster}),{query:e,requestOptions:t}}async _initJobHandler(){if(this._rasterJobHandler.connectionPromise!=null)return this._rasterJobHandler.connectionPromise;const e=new Ni;this._rasterJobHandler.connectionPromise=e.initialize().then(()=>{this._rasterJobHandler.instance=e},()=>{}),await this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null}_isSupportedRenderer(e){const{rasterInfo:t,rasterFunction:n}=this;return e.type==="unique-value"&&this._hasRasterFunction(n)&&(t==null?void 0:t.bandCount)===1&&["u8","s8"].includes(t.pixelType)||t!=null&&e!=null&&Di(t).includes(e.type)}async _fetchCapabilities(e){return this.capabilities||await this._fetchServiceInfo(e),this.capabilities}async _fetchServiceInfo(e){var n;let t=this.sourceJSON;if(!t){const{data:l,ssl:u}=await D(a(this.parsedUrl),{query:this._getQueryParams(),signal:e});t=l,this.sourceJSON=t,u&&(this.url=this.url.replace(/^http:/i,"https:"))}if(((n=t.capabilities)==null?void 0:n.toLowerCase().split(",").map(l=>l.trim()).indexOf("tilesonly"))>-1)throw new I("imagery-layer:fetch-service-info","use ImageryTileLayer to open tiles-only image services");this.read(t,{origin:"service",url:this.parsedUrl})}_isMosaicDataset(e){var t;return e.serviceSourceType?e.serviceSourceType==="esriImageServiceSourceTypeMosaicDataset":((t=e.fields)==null?void 0:t.length)>0}_isMosaicRuleSupported(e){var l;if(!e)return!1;const t=this._isMosaicDataset(e),n=e.currentVersion>=10.71&&e.hasMultidimensions&&!(((l=e.fields)==null?void 0:l.length)>1);return t||n}_isVectorFieldResampleFunction(e){if(e==null)return!1;const{functionName:t,functionArguments:n}=e,l=(t==null?void 0:t.toLowerCase())==="resample",u=(n==null?void 0:n.ResampleType)||(n==null?void 0:n.resampleType);return l&&(u===7||u===10)}_isPicture(){return!this.format||this.format.includes("jpg")||this.format.includes("png")}_configRenderer(e){var l,u;const t=this._isPicture(),{rasterInfo:n}=this;if(!t&&!this.pixelFilter||this._isVectorDataSet()){if(!this.bandIds&&n.bandCount>=3){const m=Ti(n);!m||n.bandCount===3&&m[0]===0&&m[1]===1&&m[2]===2||(this.bandIds=m)}e||(e=Pi(n,{bandIds:this.bandIds,variableName:this.rasterFunction?null:(u=(l=this.mosaicRule)==null?void 0:l.multidimensionalDefinition)==null?void 0:u[0].variableName}));const p=ji(e.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=p,this.symbolizer.rasterInfo=n):this.symbolizer=new Gi({rendererJSON:p,rasterInfo:n}),this.symbolizer.bind().success||(this.symbolizer=null)}return e}_clonePixelData(e){return e==null?e:{extent:e.extent&&e.extent.clone(),pixelBlock:e.pixelBlock!=null?e.pixelBlock.clone():null}}_getQueryParams(e){(e==null?void 0:e.renderingRule)!=null&&typeof e.renderingRule!="string"&&(e.renderingRule=this._getRenderingRuleString(e.renderingRule));const{raster:t,viewId:n}=this;return{raster:t,viewId:n,f:"json",...e,...this.customParameters}}_getRequestOptions(e){return{...e,query:{...e==null?void 0:e.query,...this.customParameters}}}_decodePixelBlock(e,t,n){return this._rasterJobHandler.instance?this._rasterJobHandler.instance.decode({data:e,options:t}):Ot(e,t,n)}async _getRasterFunctionInfos(e){var n;const t=this.sourceJSON.rasterFunctionInfos;return this.loaded?t:t&&this.version>=10.3?t.length===1&&t[0].name.toLowerCase()==="none"?t:(n=(await D(a(this.parsedUrl)+"/rasterFunctionInfos",{query:this._getQueryParams(),signal:e})).data)==null?void 0:n.rasterFunctionInfos:null}_canRequestImageElement(e){return!this.pixelFilter&&(!e||e.includes("png"))}async _requestArrayBuffer(e){const{imageProps:t,requestAsImageElement:n,returnImageBitmap:l,signal:u}=e;if(n&&this._canRequestImageElement(t.format)){const w=`${a(this.parsedUrl)}/exportImage`,{data:y}=await D(w,{responseType:l?"blob":"image",query:this._getQueryParams({f:"image",...this.refreshParameters,...e.imageServiceParameters}),signal:u});return y instanceof Blob?{imageBitmap:await Ct(y,w,u),params:t}:{imageOrCanvasElement:y,params:t}}const p=this._initJobHandler(),m=D(a(this.parsedUrl)+"/exportImage",{responseType:"array-buffer",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:u}),c=(await Promise.all([m,p]))[0].data,d=t.format||"jpgpng";let h=d;if(h!=="bsq"&&h!=="bip"&&(h=Li(c)),!h)throw new I("imagery-layer:fetch-image","unsupported format signature "+String.fromCharCode.apply(null,new Uint8Array(c)));const R={signal:u};return{pixelData:{pixelBlock:await(d==="gif"||d==="bmp"||d.includes("png")&&(h==="png"||h==="jpg")?Ot(c,{useCanvas:!0,...t},R):this._decodePixelBlock(c,{width:t.width,height:t.height,planes:null,pixelType:null,noDataValue:null,format:d},R)),extent:t.extent},params:t}}_generateRasterInfo(e,t){return this.generateRasterInfo(e,t).catch(()=>null)}_isValidCustomizedMosaicRule(e){var t;return e&&JSON.stringify(e.toJSON())!==JSON.stringify((t=this.defaultMosaicRule)==null?void 0:t.toJSON())}_updateMultidimensionalDefinition(e){var n;if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;let t=Ci(e,{multidimensionalSubset:this.multidimensionalSubset});if(t!=null&&t.length>0){this.mosaicRule=this.mosaicRule||new k;const l=this.mosaicRule.multidimensionalDefinition;!this.sourceJSON.defaultVariableName&&this.rasterFunction&&((n=this.rasterFunction.functionName)==null?void 0:n.toLowerCase())!=="none"&&t.forEach(u=>u.variableName=""),t=t.filter(({variableName:u,dimensionName:p})=>u&&u!=="*"||p),!(l!=null&&l.length)&&t.length&&(this.mosaicRule.multidimensionalDefinition=t)}}_processVisibleRastersResponse(e,t){var _,G,J;t=t||{};const n=e.value,{templateRRFunctionNames:l,showNoDataRecords:u,returnDomainValues:p,templateFields:m}=t,c=e.processedValues;let d=(_=e.catalogItems)==null?void 0:_.features,h=((J=(G=e.properties)==null?void 0:G.Values)==null?void 0:J.map(F=>F.replaceAll(/ /gi,", ")))||[];const R=this.objectIdField||"ObjectId",f=typeof n=="string"&&n.toLowerCase().includes("nodata"),w=[];if(n&&!d&&!f){const F={};F[R]=0,h=[n],d=[new ii(this.fullExtent,null,F)]}if(!d)return[];let y,g,v;this._updateResponseFieldNames(d,m),f&&!u&&(d=[]);for(let F=0;F0&&l&&l.length>0&&l.includes(this.rasterFunction.functionName)?c[l.indexOf(this.rasterFunction.functionName)]:n,g.toLowerCase()==="nodata"&&!u)continue;const H="Raster.ItemPixelValue",Z="Raster.ServicePixelValue";y.attributes[H]=g,y.attributes[Z]=v,this._updateFeatureWithMagDirValues(y,g);const C=this.fields&&this.fields.length>0;let j=this.rasterFunction&&this.serviceRasterInfo.attributeTable!=null?C?g:n:v;this.rasterFunction||(j=C?g:n),this._updateFeatureWithRasterAttributeTableValues(y,j)}if(y.sourceLayer=y.layer=this,p&&this._updateFeatureWithDomainValues(y),l&&c&&l.length===c.length)for(let H=0;Hc.name).find(c=>c.toLowerCase()==="value");if(!p)return;const m=l.filter(c=>c.attributes[p]===(t!=null?parseInt(t,10):null));m&&m[0]&&u.forEach(c=>{const d=this._rasterAttributeTableFieldPrefix+c.name;e.attributes[d]=m[0].attributes[c.name]})}_updateFeatureWithMagDirValues(e,t){if(!this._isVectorDataSet())return;const n=t.split(/,\s*/).map(c=>parseFloat(c)),l=n.map(c=>[c]),u=n.map(c=>({minValue:c,maxValue:c,noDataValue:null})),p=new gt({height:1,width:1,pixelType:"f32",pixels:l,statistics:u});this.pixelFilter!=null&&this.pixelFilter({pixelBlock:p,extent:new ze(0,0,0,0,this.spatialReference)});const m=this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"?[p.pixels[0][0],p.pixels[1][0]]:Vi([p.pixels[0][0],p.pixels[1][0]]);e.attributes["Raster.Magnitude"]=m[0],e.attributes["Raster.Direction"]=m[1]}_updateFeatureWithDomainValues(e){const t=this.fields&&this.fields.filter(n=>n.domain&&n.domain.type==="coded-value");t!=null&&t.forEach(n=>{const l=e.attributes[n.name];if(l!=null){const u=n.domain.codedValues.find(p=>p.code===l);u&&(e.attributes[n.name]=u.name)}})}_updateResponseFieldNames(e,t){if(!t||t.length<1)return;const n=this.fieldsIndex;n!=null&&e.forEach(l=>{var u;if(l!=null&&l.attributes)for(const p of t){const m=(u=n.get(p))==null?void 0:u.name;m&&m!==p&&(l.attributes[p]=l.attributes[m],delete l.attributes[m])}})}_getRenderingRuleString(e){if(e){let t=e.toJSON();return t=t.rasterFunctionDefinition??t,(t.thumbnail||t.thumbnailEx)&&(t.thumbnail=t.thumbnailEx=null),JSON.stringify(t)}return null}_hasRasterFunction(e){return(e==null?void 0:e.functionName)!=null&&e.functionName.toLowerCase()!=="none"}_updateRenderingRulesFunctionName(e,t){if(!e||e.length<1)return;if(e==="Raw")return e.replace("Raw","None");const n=e.toLowerCase().replaceAll(/ /gi,"_");return t.has(n)?t.get(n):e}_isRFTJson(e){return(e==null?void 0:e.name)&&e.arguments&&e.function&&e.hasOwnProperty("functionType")}_isVectorDataSet(){return this.serviceDataType==="esriImageServiceDataTypeVector-UV"||this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"}_applyMosaicAndRenderingRules(e){const{raster:t,mosaicRule:n,rasterFunction:l}=this;l&&e instanceof yt&&e.rasterFunction==null&&(e.rasterFunction=l),n&&e.mosaicRule==null&&(e.mosaicRule=n),t&&e.raster==null&&(e.raster=t)}_readCapabilities(e){var g;const t=e.capabilities?e.capabilities.toLowerCase().split(",").map(v=>v.trim()):["image","catalog"],{currentVersion:n,advancedQueryCapabilities:l,maxRecordCount:u}=e,p=t.includes("image"),m=e.serviceDataType==="esriImageServiceDataTypeElevation",c=!(!e.spatialReference&&!((g=e.extent)!=null&&g.spatialReference)),d=t.includes("edit"),h=t.includes("mensuration")&&c,R=e.mensurationCapabilities==null?[]:e.mensurationCapabilities.toLowerCase().split(",").map(v=>v.trim()),f=h&&R.includes("basic"),w=this._isMosaicDataset(e)&&t.includes("catalog"),y=t.includes("download");return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:p,supportsExportImage:p,supportsIdentify:p,supportsImageToMap:n>=11.2&&w,supportsImageToMapMultiray:n>=11.2&&w,supportsMapToImage:n>=11.2&&w,supportsFindImages:n>=11.2&&w,supportsGetImageUrl:n>=11.2&&y,supportsMeasure:h,supportsMeasureFromImage:n>=11.2,supportsDownload:y,supportsQuery:w&&e.fields&&e.fields.length>0,supportsGetSamples:n>=10.2&&p,supportsProject:n>=10.3&&p,supportsComputeStatisticsHistograms:n>=10.4&&p,supportsQueryBoundary:n>=10.6&&p,supportsCalculateVolume:n>=10.7&&m,supportsComputePixelLocation:n>=10.7&&w,supportsComputeAngles:n>=10.91,supportsQueryGPSInfo:n>=11.2&&w,supportsAdd:d,supportsDelete:d,supportsEditing:d,supportsUpdate:d,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1,supportsQueryAnalytics:!1,supportsQueryTopFeatures:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:u,maxRecordCountFactor:void 0,supportsStatistics:!!(l!=null&&l.supportsStatistics),supportsOrderBy:!!(l!=null&&l.supportsOrderBy),supportsDistinct:!!(l!=null&&l.supportsDistinct),supportsPagination:!!(l!=null&&l.supportsPagination),supportsStandardizedQueriesOnly:!!(l!=null&&l.useStandardizedQueries),supportsPercentileStatistics:!!(l!=null&&l.supportsPercentileStatistics),supportsCentroid:!!(l!=null&&l.supportsReturningGeometryCentroid),supportsDistance:!!(l!=null&&l.supportsQueryWithDistance),supportsExtent:!!(l!=null&&l.supportsReturningQueryExtent),supportsGeometryProperties:!!(l!=null&&l.supportsReturningGeometryProperties),supportsHavingClause:!!(l!=null&&l.supportsHavingClause),supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:!1,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!!(l!=null&&l.supportsDefaultSR),supportsFullTextSearch:!1,supportsCompactGeometry:!1,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0},mensuration:{supportsDistanceAndAngle:f,supportsAreaAndPerimeter:f,supportsPointOrCentroid:f,supportsHeightFromBaseAndTop:h&&R.includes("base-top height"),supportsHeightFromBaseAndTopShadow:h&&R.includes("base-top shadow height"),supportsHeightFromTopAndTopShadow:h&&R.includes("top-top shadow height"),supports3D:h&&R.includes("3d")}}}};function a(e){return(e==null?void 0:e.path)??""}return r([o({clonable:!1})],i.prototype,"_functionRasterInfos",void 0),r([o({clonable:!1})],i.prototype,"_rasterJobHandler",void 0),r([o({clonable:!1})],i.prototype,"_cachedRendererJson",void 0),r([o({readOnly:!0})],i.prototype,"_serviceSupportsMosaicRule",void 0),r([V("_serviceSupportsMosaicRule",["currentVersion","fields"])],i.prototype,"readServiceSupportsMosaicRule",null),r([o({readOnly:!0})],i.prototype,"_rasterAttributeTableFieldPrefix",void 0),r([o({readOnly:!0})],i.prototype,"_rasterFunctionNamesIndex",null),r([o()],i.prototype,"adjustAspectRatio",void 0),r([o({type:[Be],json:{write:!0}})],i.prototype,"bandIds",void 0),r([V("bandIds")],i.prototype,"readBandIds",null),r([o({readOnly:!0,json:{read:!1}})],i.prototype,"capabilities",void 0),r([V("service","capabilities",["capabilities","currentVersion","serviceDataType"])],i.prototype,"readCapabilities",null),r([o({type:Number})],i.prototype,"compressionQuality",void 0),r([T("compressionQuality")],i.prototype,"writeCompressionQuality",null),r([o({type:Number})],i.prototype,"compressionTolerance",void 0),r([T("compressionTolerance")],i.prototype,"writeCompressionTolerance",null),r([o({json:{read:{source:"copyrightText"}}})],i.prototype,"copyright",void 0),r([o({readOnly:!0,dependsOn:["_serviceSupportsMosaicRule"]})],i.prototype,"defaultMosaicRule",void 0),r([V("defaultMosaicRule",["defaultMosaicMethod"])],i.prototype,"readDefaultMosaicRule",null),r([o({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),r([o({readOnly:!0,constructOnly:!0})],i.prototype,"exportImageServiceParameters",void 0),r([o()],i.prototype,"rasterInfo",void 0),r([o({readOnly:!0,type:[Fe]})],i.prototype,"fields",void 0),r([o({readOnly:!0})],i.prototype,"fieldsIndex",null),r([o({type:["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"],json:{write:!0}})],i.prototype,"format",null),r([V("service","format",["serviceDataType"])],i.prototype,"readFormat",null),r([o({type:ze})],i.prototype,"fullExtent",void 0),r([o({readOnly:!0})],i.prototype,"hasMultidimensions",void 0),r([o({json:{read:{source:"maxImageHeight"}}})],i.prototype,"imageMaxHeight",void 0),r([o({json:{read:{source:"maxImageWidth"}}})],i.prototype,"imageMaxWidth",void 0),r([o({type:String,json:{type:ve.jsonValues,read:ve.read,write:ve.write}})],i.prototype,"interpolation",void 0),r([o()],i.prototype,"minScale",void 0),r([V("service","minScale")],i.prototype,"readMinScale",null),r([o()],i.prototype,"maxScale",void 0),r([V("service","maxScale")],i.prototype,"readMaxScale",null),r([o({type:k})],i.prototype,"mosaicRule",null),r([V("mosaicRule",["mosaicRule","defaultMosaicMethod"])],i.prototype,"readMosaicRule",null),r([T("mosaicRule")],i.prototype,"writeMosaicRule",null),r([o()],i.prototype,"multidimensionalInfo",void 0),r([o({type:Ri,json:{write:!0}})],i.prototype,"multidimensionalSubset",void 0),r([o({json:{type:Be}})],i.prototype,"noData",void 0),r([T("noData")],i.prototype,"writeNoData",null),r([o({type:String,json:{type:Ue.jsonValues,read:Ue.read,write:Ue.write}})],i.prototype,"noDataInterpretation",void 0),r([o({type:String,readOnly:!0,json:{read:{source:["fields"]}}})],i.prototype,"objectIdField",void 0),r([V("objectIdField")],i.prototype,"readObjectIdField",null),r([o({readOnly:!0})],i.prototype,"geometryType",void 0),r([o({})],i.prototype,"typeIdField",void 0),r([o({})],i.prototype,"types",void 0),r([o({readOnly:!0})],i.prototype,"parsedUrl",null),r([o({type:Function})],i.prototype,"pixelFilter",void 0),r([o()],i.prototype,"raster",void 0),r([o({readOnly:!0})],i.prototype,"sourceType",void 0),r([V("sourceType",["serviceSourceType","fields"])],i.prototype,"readSourceType",null),r([o()],i.prototype,"viewId",void 0),r([o({types:vi,json:{name:"layerDefinition.drawingInfo.renderer",origins:{"web-scene":{types:bi,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&e.type!=="vector-field"&&e.type!=="flow"})}}}}})],i.prototype,"renderer",null),r([V("renderer")],i.prototype,"readRenderer",null),r([T("renderer")],i.prototype,"writeRenderer",null),r([o({clonable:!1})],i.prototype,"symbolizer",void 0),r([o(Xt)],i.prototype,"opacity",void 0),r([o({readOnly:!0})],i.prototype,"rasterFields",null),r([o({constructOnly:!0})],i.prototype,"rasterFunctionInfos",void 0),r([o({type:S})],i.prototype,"renderingRule",null),r([o({type:S,json:{name:"renderingRule"}})],i.prototype,"rasterFunction",null),r([V("rasterFunction",["renderingRule","rasterFunctionInfos"])],i.prototype,"readRasterFunction",null),r([o({readOnly:!0})],i.prototype,"serviceDataType",void 0),r([o({readOnly:!0,type:se})],i.prototype,"spatialReference",void 0),r([V("spatialReference",["spatialReference","extent"])],i.prototype,"readSpatialReference",null),r([o({json:{type:dt.jsonValues}})],i.prototype,"pixelType",void 0),r([V("pixelType")],i.prototype,"readPixelType",null),r([T("pixelType")],i.prototype,"writePixelType",null),r([o({constructOnly:!0,type:Et})],i.prototype,"serviceRasterInfo",void 0),r([o()],i.prototype,"sourceJSON",void 0),r([o(Yt)],i.prototype,"url",void 0),r([o({readOnly:!0})],i.prototype,"version",void 0),r([V("version",["currentVersion","fields","timeInfo"])],i.prototype,"readVersion",null),i=r([b("esri.layers.mixins.ArcGISImageService")],i),i};let B=class extends ni(Wi(ai(oi(li(cs(ki(ui(pi(ci(Se(fi))))))))))){constructor(...s){super(...s),this.isReference=null,this.operationalLayerType="ArcGISImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.type="imagery",this._debouncedSaveOperations=mi(async(i,a,e)=>{const{save:t,saveAs:n}=await wi(()=>import("./imageryUtils-Bct433Ji.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]));switch(i){case We.SAVE:return t(this,a);case We.SAVE_AS:return n(this,e,a)}})}normalizeCtorArgs(s,i){return typeof s=="string"?{url:s,...i}:s}load(s){const i=s!=null?s.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},s).catch(di).then(()=>this._fetchService(i))),Promise.resolve(this)}get legendEnabled(){return!this._isPreviewLayer&&(this._get("legendEnabled")??!0)}set legendEnabled(s){this._set("legendEnabled",s)}get listMode(){return this._isPreviewLayer?"hide":this._get("listMode")}set listMode(s){this._set("listMode",s)}writeOperationalLayerType(s,i,a){var t;const e=((t=this.renderer)==null?void 0:t.type)==="vector-field";i[a]=e?"ArcGISImageServiceVectorLayer":"ArcGISImageServiceLayer"}get defaultPopupTemplate(){return this.createPopupTemplate()}get _isPreviewLayer(){var s;return!(!this.raster||!((s=this.url)!=null&&s.toLowerCase().includes("/rasterrendering/imageserver")))}createPopupTemplate(s){var p;const i=this.rasterFields,a=this.title,e=new Set;let t=!1,n=!1;this.capabilities&&(t=this.capabilities.operations.supportsQuery&&this.fields&&this.fields.length>0,n=this.serviceDataType==="esriImageServiceDataTypeVector-UV"||this.serviceDataType==="esriImageServiceDataTypeVector-MagDir");const l=new Set;t&&l.add("raster.itempixelvalue");for(const m of i){const c=m.name.toLowerCase();l.has(c)||c.includes("raster.servicepixelvalue.")||e.add(m.name)}n&&e.add("raster.magnitude").add("raster.direction");const u=Ki({fields:i,title:a},{...s,visibleFieldNames:e});return u!=null&&u.fieldInfos&&((p=this.rasterInfo)!=null&&p.pixelType.startsWith("f"))&&u.fieldInfos.forEach(({format:m,fieldName:c})=>{m&&/^raster\.(item|service)pixelvalue/i.test(c)&&(m.places=2)}),u}queryFeatures(s,i){return this.queryRasters(s,i).then(a=>{if(a!=null&&a.features)for(const e of a.features)e.layer=e.sourceLayer=this;return a})}queryFeatureCount(s,i){return this.queryRasterCount(s,i)}redraw(){this.emit("redraw")}async save(s){return this._debouncedSaveOperations(We.SAVE,s)}async saveAs(s,i){return this._debouncedSaveOperations(We.SAVE_AS,i,s)}serviceSupportsSpatialReference(s){return Zi(this,s)}write(s,i){if(!this._isPreviewLayer)return super.write(s,i);if(i!=null&&i.messages){const a=`${i.origin}/${i.layerContainerType||"operational-layers"}`;i.messages.push(new I("layer:unsupported",`Imagery preview layer (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${a}'`,{layer:this}))}return null}};r([o(yi)],B.prototype,"legendEnabled",null),r([o({type:["show","hide"]})],B.prototype,"listMode",null),r([o({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],B.prototype,"isReference",void 0),r([o({type:["ArcGISImageServiceLayer"],json:{origins:{"web-map":{type:["ArcGISImageServiceLayer","ArcGISImageServiceVectorLayer"],read:!1,write:{target:"layerType",ignoreOrigin:!0}}}}})],B.prototype,"operationalLayerType",void 0),r([T("web-map","operationalLayerType")],B.prototype,"writeOperationalLayerType",null),r([o(hi)],B.prototype,"popupEnabled",void 0),r([o({type:gi,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],B.prototype,"popupTemplate",void 0),r([o({readOnly:!0})],B.prototype,"defaultPopupTemplate",null),r([o({readOnly:!0,json:{read:!1}})],B.prototype,"type",void 0),r([o({readOnly:!0})],B.prototype,"_isPreviewLayer",null),B=r([b("esri.layers.ImageryLayer")],B);const In=B;export{In as default}; +import{aV as Q,d as r,y as o,aR as T,f as b,aU as P,aA as A,aS as se,i2 as be,i1 as ot,lU as lt,aZ as V,aB as Ze,aE as ze,a$ as oe,b0 as te,aW as M,eq as z,ep as U,M as D,dj as Ne,dP as wt,b4 as Se,dS as Be,aY as kt,cF as ie,c9 as Wt,lV as Zt,b2 as Pt,jD as Ve,s as we,aD as Kt,a_ as Fe,fC as Xt,du as Yt,bW as ei,N as I,er as $,aX as mt,g as ti,j as ii,lW as ri,hQ as si,bP as ni,bQ as ai,dp as oi,dq as li,dO as ui,dM as pi,dr as ci,k as mi,ay as di,dt as yi,fD as hi,i as gi,bT as fi,_ as wi}from"./index-BjUNJPVf.js";import{N as S,b as ve,i as Ue,j as k,c as Ri,l as vi,d as bi,n as dt,a as Si,h as yt,f as xi,m as Ii,p as Fi,k as Di,E as Ti,V as Pi,K as ji,t as Ni}from"./ImageHistogramParameters-DYfx5K-s.js";import{m as ht,g as _i,p as Oi,d as Ci}from"./multidimensionalUtils-u3oUX4w1.js";import{i as $i,u as gt,s as Ai,l as Vi}from"./dataUtils-DzOfgSpi.js";import{G as Mt,e as Jt,f as Mi,q as Ji,A as Ei,n as qi,a as Et,L as Gi,S as Ot,P as Li}from"./RasterSymbolizer-BN7ge8gb.js";import{b as zi}from"./UniqueValueRenderer-7V9Bhr-D.js";import{Z as Ui}from"./FieldsIndex-CK-0B5n9.js";import{t as Ct}from"./imageBitmapUtils-BVxrhFkK.js";import{d as qt}from"./FeatureSet-opEn8ou8.js";import{s as Hi}from"./executeQueryJSON-COxi_Fac.js";import"./pbf-Du8sFEWo.js";import"./AttachmentInfo-Cm6dhnUr.js";import"./AttachmentQuery-DmEAIZff.js";import{s as Bi,n as Qi}from"./executeForIds-CZ3M8IZd.js";import"./RelationshipQuery-BDJrOxaX.js";import"./TopFeaturesQuery-CVQjqlfM.js";import{f as ki}from"./RefreshableLayer-_r2TPtol.js";import{f as Wi}from"./TemporalLayer-CKICYnEl.js";import{e as Zi}from"./versionUtils-BIAEZzrm.js";import{p as Ki}from"./popupUtils-DlZin22m.js";import{A as We}from"./interfaces-CL2NbQte.js";import"./ColorStop-DCGjAKLC.js";import"./colorRamps-CcakIWlU.js";import"./visualVariableUtils-BX9G5gNQ.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./utils-Dx_a2yJw.js";import"./utils-CuXO_Zzq.js";import"./ClassBreaksDefinition-Djcxa8Lp.js";import"./diffUtils-uUoMDFQS.js";import"./jsonUtils-Ox5U0P0F.js";import"./styleUtils-DOUOskVZ.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./query-Bk_ITqRK.js";import"./pbfQueryUtils-CSeFSIjv.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./queryZScale-Dwvn5BlQ.js";import"./TimeInfo-DooETFWC.js";const Xi={StretchFunction:{arguments:{ComputeGamma:{isDataset:!1,isPublic:!1,name:"ComputeGamma",type:"RasterFunctionVariable",value:!1},DRA:{isDataset:!1,isPublic:!1,name:"DRA",type:"RasterFunctionVariable",value:!1},EstimateStatsHistogram:{isDataset:!1,isPublic:!1,name:"EstimateStatsHistogram",type:"RasterFunctionVariable",value:!1},Gamma:{displayName:"Gamma",isDataset:!1,isPublic:!1,name:"Gamma",type:"RasterFunctionVariable"},Histograms:{isDataset:!1,isPublic:!1,name:"Histograms",type:"RasterFunctionVariable"},Max:{isDataset:!1,isPublic:!1,name:"Max",type:"RasterFunctionVariable",value:255},MaxPercent:{isDataset:!1,isPublic:!1,name:"MaxPercent",type:"RasterFunctionVariable",value:.5},Min:{isDataset:!1,isPublic:!1,name:"Min",type:"RasterFunctionVariable",value:0},MinPercent:{isDataset:!1,isPublic:!1,name:"MinPercent",type:"RasterFunctionVariable",value:.25},NumberOfStandardDeviations:{isDataset:!1,isPublic:!1,name:"NumberOfStandardDeviation",type:"RasterFunctionVariable",value:2},Raster:{isDataset:!0,isPublic:!1,name:"Raster",type:"RasterFunctionVariable"},SigmoidStrengthLevel:{isDataset:!1,isPublic:!1,name:"SigmoidStrengthLevel",type:"RasterFunctionVariable",value:2},Statistics:{isDataset:!1,isPublic:!1,name:"Statistics",type:"RasterFunctionVariable"},StretchType:{isDataset:!1,isPublic:!1,name:"StretchType",type:"RasterFunctionVariable",value:0},type:"StretchFunctionArguments",UseGamma:{isDataset:!1,isPublic:!1,name:"UseGamma",type:"RasterFunctionVariable",value:!1}},description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",function:{description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",name:"Stretch",pixelType:"UNKNOWN",type:"StretchFunction"},functionType:0,name:"Stretch",thumbnail:""},RemapFunction:{name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table.",function:{type:"RemapFunction",pixelType:"UNKNOWN",name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},UseTable:{name:"UseTable",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},InputRanges:{name:"InputRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Input Ranges"},OutputValues:{name:"OutputValues",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Output Values"},NoDataRanges:{name:"NoDataRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"NoData Ranges"},Table:{name:"Table",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputField:{name:"InputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},OutputField:{name:"OutputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputMaxField:{name:"InputMaxField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},RemapTableType:{name:"RemapTableType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},AllowUnmatched:{name:"AllowUnmatched",isPublic:!1,isDataset:!1,value:!0,type:"RasterFunctionVariable"},type:"RemapFunctionArguments"},functionType:0,thumbnail:""},ColormapFunction:{name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp.",function:{type:"ColormapFunction",pixelType:"UNKNOWN",name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},ColormapName:{name:"ColormapName",isPublic:!1,isDataset:!1,value:"Gray",type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},type:"ColormapFunctionArguments"},functionType:0,thumbnail:""},ShadedReliefFunction:{name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image.",function:{type:"ShadedReliefFunction",pixelType:"UNKNOWN",name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"ShadedReliefFunctionArguments"},functionType:0,thumbnail:""},HillshadeFunction:{name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image",function:{type:"HillshadeFunction",pixelType:"UNKNOWN",name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image"},arguments:{DEM:{name:"DEM",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"HillshadeFunctionArguments"},functionType:0,thumbnail:""},ResampleFunction:{name:"Resample",description:"Changes the cell size of a raster.",function:{type:"ResampleFunction",pixelType:"UNKNOWN",name:"Resample",description:"Changes the cell size of a raster."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ResamplingType:{name:"ResamplingType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},InputCellSize:{name:"InputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},OutputCellSize:{name:"OutputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},type:"ResampleFunctionArguments"},functionType:0,thumbnail:""}},Yi=new Set(["u1","u2","u4","u8","s8","u16","s16"]),er={simple_scalar:"Simple Scalar",wind_barb:"Wind Barb",single_arrow:"Single Arrow",beaufort_kn:"Beaufort Wind (Knots)",beaufort_m:"Beaufort Wind (MetersPerSecond)",ocean_current_m:"Ocean Current (MetersPerSecond)",ocean_current_kn:"Ocean Current (Knots)"},tr=new Set(["raster-stretch","unique-value","class-breaks","raster-shaded-relief","vector-field","raster-colormap"]);function Gt(s){return tr.has(s.type)}function ft(s,i){var e;if(!s||!i)return Q(s||i);const a=Q(s);if(a.functionDefinition&&i.rasterFunctionDefinition){const t=i.rasterFunctionDefinition;(t.thumbnail||t.thumbnailEx)&&(t.thumbnail=t.thumbnailEx=void 0),Lt(a.functionDefinition.arguments,i),a.rasterFunctionDefinition=a.functionDefinition.toJSON()}else((e=i.functionName)==null?void 0:e.toLowerCase())!=="none"&&(zt(a.functionArguments).Raster=i);return a}function Lt(s,i){for(const a in s)a.toLowerCase()==="raster"&&(s[a].type==="RasterFunctionVariable"?(s[a]=i.rasterFunctionDefinition,s[a].type="RasterFunctionTemplate"):s[a].type==="RasterFunctionTemplate"&&Lt(s[a].arguments,i))}function ne(s){const i=Q(Xi[s.functionName+"Function"]),a=s.functionArguments;for(const e in a)e.toLowerCase()==="raster"?(i.arguments[e]=ne(a[e]),i.arguments[e].type="RasterFunctionTemplate"):e.toLowerCase()==="colormap"?(i.arguments[e].value=pr(a[e]),i.arguments.ColorSchemeType.value=0):i.arguments[e].value=a[e];return i}function ir(s,i){switch(i=i||{},s.type){case"raster-stretch":return nr(s,i);case"class-breaks":return ar(s,i);case"unique-value":return or(s,i);case"raster-colormap":return lr(s,i);case"vector-field":return rr(s,i);case"raster-shaded-relief":return sr(s,i);case"flow":throw new Error("Unsupported rendering rule.")}}function zt(s){const i=(s==null?void 0:s.Raster)??(s==null?void 0:s.raster);return i&&i.declaredClass==="esri.layers.support.RasterFunction"?zt(i.functionArguments):s}const Ee={none:0,standardDeviation:3,histogramEqualization:4,minMax:5,percentClip:6,sigmoid:9};function rr(s,i){const a=new S;a.functionName="VectorFieldRenderer";const{dataType:e,bandNames:t}=i,n=e==="vector-uv";let l,u;if(t&&t.length===2){const R=t.map(f=>f.toLowerCase());l=R.indexOf("magnitude"),u=R.indexOf("direction")}l!==-1&&l!==null||(l=0,u=1);const p=s.rotationType==="arithmetic"?1:2,m=s.flowRepresentation==="flow-from"?0:1,c=s.visualVariables?s.visualVariables.find(R=>R.field==="Magnitude"):new zi,d={magnitudeBandID:l,directionBandID:u,isUVComponents:n,referenceSystem:p,massFlowAngleRepresentation:m,symbolTileSize:50,symbolTileSizeUnits:100,calculationMethod:"Vector Average",symbologyName:er[s.style.toLowerCase().replace("-","_")],minimumMagnitude:c.minDataValue,maximumMagnitude:c.maxDataValue,minimumSymbolSize:c.minSize,maximumSymbolSize:c.maxSize};a.functionArguments=d;const h=ne(a);return i.convertToRFT?S.fromJSON({rasterFunctionDefinition:h}):a}function sr(s,i){const a=i.convertToRFT;if(i.dataType!=="elevation"&&(i.dataType!=="generic"||i.bandCount!==1||i.pixelType!=="s16"&&i.pixelType!=="s32"&&i.pixelType!=="f32"&&i.pixelType!=="f64"))return new S;const e=new S;e.functionName="Hillshade";const t=s.hillshadeType==="traditional"?0:1,n=s.scalingType==="none"?1:3,l={HillshadeType:t,SlopeType:n,ZFactor:s.zFactor};return t===0&&(l.Azimuth=s.azimuth,l.Altitude=s.altitude),n===3&&(l.PSPower=s.pixelSizePower,l.PSZFactor=s.pixelSizeFactor),e.functionArguments=l,e.variableName="Raster",s.colorRamp&&(e.functionName="ShadedRelief",a?l.ColorRamp=Mt(s.colorRamp):l.Colormap=Jt(s.colorRamp)),a?new S({rasterFunctionDefinition:ne(e)}):e}function nr(s,i){var u;const a=i.convertToRFT,e=new S;e.functionName="Stretch";const t=Ee[Mi.toJSON(s.stretchType)],n="u8",l={StretchType:t,Statistics:ur(s.statistics??[]),DRA:s.dynamicRangeAdjustment,UseGamma:s.useGamma,Gamma:s.gamma,ComputeGamma:s.computeGamma};if(s.outputMin!=null&&(l.Min=s.outputMin),s.outputMax!=null&&(l.Max=s.outputMax),t===Ee.standardDeviation?(l.NumberOfStandardDeviations=s.numberOfStandardDeviations,e.outputPixelType=n):t===Ee.percentClip?(l.MinPercent=s.minPercent,l.MaxPercent=s.maxPercent,e.outputPixelType=n):t===Ee.minMax?e.outputPixelType=n:t===Ee.sigmoid&&(l.SigmoidStrengthLevel=s.sigmoidStrengthLevel),e.functionArguments=l,e.variableName="Raster",s.colorRamp){const p=s.colorRamp,m=new S;if(a)m.functionArguments={ColorRamp:Mt(p)};else{const c=Ji(p,!0);if(c)m.functionArguments={colorRampName:c};else if(!i.convertColorRampToColormap||p.type!=="algorithmic"&&p.type!=="multipart"){const d=s.colorRamp.toJSON();d.type==="algorithmic"?d.algorithm=d.algorithm||"esriCIELabAlgorithm":d.type==="multipart"&&((u=d.colorRamps)!=null&&u.length)&&d.colorRamps.forEach(h=>h.algorithm=h.algorithm||"esriCIELabAlgorithm"),m.functionArguments={colorRamp:d}}else m.functionArguments={Colormap:Jt(p)}}return m.variableName="Raster",m.functionName="Colormap",m.functionArguments.Raster=e,a?new S({rasterFunctionDefinition:ne(m)}):m}return a?new S({rasterFunctionDefinition:ne(e)}):e}function ar(s,i){const a=[],e=[],t=[],n=[],{pixelType:u,rasterAttributeTable:p}=i,m=p==null?null:p.features,c=Ut(p);if(c&&m&&Array.isArray(m)&&s.classBreakInfos){s.classBreakInfos.forEach((y,g)=>{var G;const v=(G=y.symbol)==null?void 0:G.color;let _;v!=null&&v.a&&y.minValue!=null&&y.maxValue!=null&&m.forEach(J=>{y.minValue!=null&&y.maxValue!=null&&(_=J.attributes[s.field],(_>=y.minValue&&_=y.minValue)&&n.push([J.attributes[c],v.r,v.g,v.b]))})});const f=u?ut(n,u):n,w=new S;return w.functionName="Colormap",w.functionArguments={},w.functionArguments.Colormap=f,w.variableName="Raster",i.convertToRFT?new S({rasterFunctionDefinition:ne(w)}):w}s.classBreakInfos.forEach((f,w)=>{if(f.minValue==null||f.maxValue==null)return;const y=f.symbol&&f.symbol.color;y!=null&&y.a?(w===0?a.push(f.minValue,f.maxValue+1e-4):a.push(f.minValue+1e-4,f.maxValue+1e-4),e.push(w),n.push([w,y.r,y.g,y.b])):t.push(f.minValue,f.maxValue)});const d=u?ut(n,u):n,h=new S;h.functionName="Remap",h.functionArguments={InputRanges:a,OutputValues:e,NoDataRanges:t},h.variableName="Raster";const R=new S;return R.functionName="Colormap",R.functionArguments={Colormap:d,Raster:h},i.convertToRFT?new S({rasterFunctionDefinition:ne(R)}):R}function ut(s,i){const a=Yi.has(i)?$i(i):null;return a&&s.push([Math.floor(a[0]-1),0,0,0],[Math.ceil(a[1]+1),0,0,0]),s}function Ut(s){if(s==null)return;const{fields:i}=s,a=i==null?void 0:i.find(e=>(e==null?void 0:e.name)&&e.name.toLowerCase()==="value");return a==null?void 0:a.name}function or(s,i){var d,h,R;const a=[],{pixelType:e,rasterAttributeTable:t}=i,n=t==null?null:t.features,l=Ut(t),u=(h=(d=s.defaultSymbol)==null?void 0:d.color)==null?void 0:h.toRgb(),p=s.uniqueValueInfos;if(p)if(n){if(l){const f=new Map;p.forEach(y=>{var _;const g=y.value,v=(_=y.symbol)==null?void 0:_.color;g!=null&&(v!=null&&v.a)&&f.set(String(g),v.toRgb())});const w=s.field;n.forEach(({attributes:y})=>{const g=String(y[w]),v=y[l],_=f.get(g);_?a.push([v,..._]):u&&a.push([v,...u])})}}else for(let f=0;f{const e=a;if(Array.isArray(e))i.push(e);else{if(e.min==null||e.max==null)return;const t=[e.min,e.max,e.avg||0,e.stddev||0];i.push(t)}}),i}function pr(s){const i=[],a=[];return s.forEach(e=>{i.push(e[0]),a.push(Ei([...e.slice(1),255]))}),{type:"RasterColormap",values:i,colors:a}}let O=class extends P{constructor(){super(...arguments),this.layer=null,this.compression=void 0,this.pixelType=void 0,this.lercVersion=2}get adjustAspectRatio(){return this.layer.adjustAspectRatio}writeAdjustAspectRatio(i,a,e){this.layer.version<10.3||(a[e]=i)}get bandIds(){return this.layer.bandIds}get compressionQuality(){return this.layer.compressionQuality}writeCompressionQuality(i,a,e){this.format&&this.format.toLowerCase().includes("jpg")&&i!=null&&(a[e]=i)}get compressionTolerance(){return this.layer.compressionTolerance}writeCompressionTolerance(i,a,e){this.format==="lerc"&&i!=null&&(a[e]=i)}get format(){var i;return((i=this.layer.renderer)==null?void 0:i.type)==="vector-field"?"lerc":this.layer.format}get interpolation(){return this.layer.interpolation}get noData(){return this.layer.noData}get noDataInterpretation(){return this.layer.noDataInterpretation}writeLercVersion(i,a,e){this.format==="lerc"&&this.layer.version>=10.5&&(a[e]=i)}get version(){const i=this.layer;return i.commitProperty("bandIds"),i.commitProperty("format"),i.commitProperty("compressionQuality"),i.commitProperty("compressionTolerance"),i.commitProperty("interpolation"),i.commitProperty("noData"),i.commitProperty("noDataInterpretation"),i.commitProperty("mosaicRule"),i.commitProperty("rasterFunction"),i.commitProperty("adjustAspectRatio"),i.commitProperty("pixelFilter"),i.commitProperty("definitionExpression"),i.commitProperty("multidimensionalSubset"),(this._get("version")||0)+1}set version(i){this._set("version",i)}get mosaicRule(){const i=this.layer;let a=i.mosaicRule;const e=i.definitionExpression;return a?e&&e!==a.where&&(a=a.clone(),a.where=e):e&&(a=new k({where:e})),a}get rasterFunction(){var l,u;const i=this.layer;let{rasterFunction:a}=i;const e=i.pixelFilter,t=!i.format||i.format.includes("jpg")||i.format.includes("png");a=this._addResampleRasterFunction(a);const n=(l=i.multidimensionalSubset)==null?void 0:l.areaOfInterest;return n&&(a=this._addClipFunction(a,n)),t&&!e&&((u=i.renderer)==null?void 0:u.type)!=="vector-field"&&(a=this.combineRendererWithRenderingRule(a)),a}combineRendererWithRenderingRule(i){const a=this.layer,{rasterInfo:e,renderer:t}=a;return i=i||a.rasterFunction,!t||!Gt(t)?i:ft(ir(t,{rasterAttributeTable:e.attributeTable,pixelType:e.pixelType,dataType:e.dataType,bandNames:e.bandInfos.map(({name:n})=>n),convertColorRampToColormap:a.version<10.6,convertToRFT:!!(i!=null&&i.rasterFunctionDefinition),bandCount:e.bandCount}),i)}_addResampleRasterFunction(i){var n;if(((n=this.layer.renderer)==null?void 0:n.type)!=="vector-field"||(i==null?void 0:i.functionName)==="Resample")return i;const a=this.layer.serviceDataType==="esriImageServiceDataTypeVector-UV"?7:10,e=this.layer.serviceRasterInfo.pixelSize;let t=new S({functionName:"Resample",functionArguments:{ResamplingType:a,InputCellSize:e}});return t=i!=null&&i.rasterFunctionDefinition?new S({rasterFunctionDefinition:ne(t)}):t,ft(t,i)}_addClipFunction(i,a){const e=new S({functionName:"Clip",functionArguments:{ClippingGeometry:a.toJSON(),ClippingType:1}});return ft(e,i)}};r([o()],O.prototype,"layer",void 0),r([o({json:{write:!0}})],O.prototype,"adjustAspectRatio",null),r([T("adjustAspectRatio")],O.prototype,"writeAdjustAspectRatio",null),r([o({json:{write:!0}})],O.prototype,"bandIds",null),r([o({json:{write:!0}})],O.prototype,"compression",void 0),r([o({json:{write:!0}})],O.prototype,"compressionQuality",null),r([T("compressionQuality")],O.prototype,"writeCompressionQuality",null),r([o({json:{write:!0}})],O.prototype,"compressionTolerance",null),r([T("compressionTolerance")],O.prototype,"writeCompressionTolerance",null),r([o({json:{write:!0}})],O.prototype,"format",null),r([o({type:String,json:{read:{reader:ve.read},write:{writer:ve.write}}})],O.prototype,"interpolation",null),r([o({json:{write:!0}})],O.prototype,"noData",null),r([o({type:String,json:{read:{reader:Ue.read},write:{writer:Ue.write}}})],O.prototype,"noDataInterpretation",null),r([o({json:{write:!0}})],O.prototype,"pixelType",void 0),r([o({json:{write:!0}})],O.prototype,"lercVersion",void 0),r([T("lercVersion")],O.prototype,"writeLercVersion",null),r([o({type:Number})],O.prototype,"version",null),r([o({json:{write:!0}})],O.prototype,"mosaicRule",null),r([o({json:{write:!0,name:"renderingRule"}})],O.prototype,"rasterFunction",null),O=r([b("esri.layers.mixins.ExportImageServiceParameters")],O);const Ht=s=>{let i=class extends s{constructor(){super(...arguments),this.make=null,this.model=null,this.focalLength=null,this.pixelSize=null,this.rows=null,this.cols=null}};return r([o({json:{write:!0}})],i.prototype,"make",void 0),r([o({json:{write:!0}})],i.prototype,"model",void 0),r([o({json:{write:!0}})],i.prototype,"focalLength",void 0),r([o({json:{write:!0}})],i.prototype,"pixelSize",void 0),r([o({json:{write:!0}})],i.prototype,"rows",void 0),r([o({json:{write:!0}})],i.prototype,"cols",void 0),i=r([b("esri.rest.support.CameraInfoMixin")],i),i};let K=class extends Ht(P){constructor(){super(...arguments),this.id=null,this.referenceUri=null,this.acquisitionDate=null,this.cameraID=null,this.center=null,this.perspectiveCenter=null,this.orientation=null}writeAcquisitionDate(i,a){a.acquisitionDate=i==null?void 0:i.getTime()}};r([o({json:{write:!0}})],K.prototype,"id",void 0),r([o({json:{name:"uri",write:!0}})],K.prototype,"referenceUri",void 0),r([o({type:Date,json:{write:!0}})],K.prototype,"acquisitionDate",void 0),r([T("acquisitionDate")],K.prototype,"writeAcquisitionDate",null),r([o({json:{write:!0}})],K.prototype,"cameraID",void 0),r([o({type:A,json:{write:!0}})],K.prototype,"center",void 0),r([o({type:A,json:{write:!0}})],K.prototype,"perspectiveCenter",void 0),r([o({json:{write:!0}})],K.prototype,"orientation",void 0),K=r([b("esri.rest.support.ImageInspectionInfo")],K);const cr=K;let Ke=class extends P{constructor(){super(...arguments),this.images=null}};r([o({type:[cr],json:{write:!0}})],Ke.prototype,"images",void 0),Ke=r([b("esri.rest.support.FindImagesResult")],Ke);const mr=Ke;let _e=class extends P{constructor(i){super(i),this.north=null,this.up=null,this.spatialReference=null}};r([o({type:Number,json:{write:!0}})],_e.prototype,"north",void 0),r([o({type:Number,json:{write:!0}})],_e.prototype,"up",void 0),r([o({type:se,json:{write:!0}})],_e.prototype,"spatialReference",void 0),_e=r([b("esri.rest.support.ImageAngleResult")],_e);const dr=_e;let fe=class extends P{constructor(){super(...arguments),this.value=null,this.displayValue=null,this.uncertainty=null}};r([o({type:Number,json:{read:!0,write:!0}})],fe.prototype,"value",void 0),r([o({type:String,json:{read:!0,write:!0}})],fe.prototype,"displayValue",void 0),r([o({type:Number,json:{read:!0,write:!0}})],fe.prototype,"uncertainty",void 0),fe=r([b("esri.rest.support.ImageMeasureResultValue")],fe);let Me=class extends fe{constructor(){super(...arguments),this.unit=null}};r([o({type:String,json:{read:be.read,write:be.write}})],Me.prototype,"unit",void 0),Me=r([b("esri.rest.support.ImageMeasureResultLengthValue")],Me);let Xe=class extends fe{constructor(){super(...arguments),this.unit=null}};r([o({type:String,json:{read:ot.read,write:ot.write}})],Xe.prototype,"unit",void 0),Xe=r([b("esri.rest.support.ImageMeasureResultAreaValue")],Xe);let He=class extends fe{constructor(){super(...arguments),this.unit=null}};r([o({type:String,json:{read:lt.read,write:lt.write}})],He.prototype,"unit",void 0),He=r([b("esri.rest.support.ImageMeasureResultAngleValue")],He);let Re=class extends P{constructor(){super(...arguments),this.name=null,this.sensorName=null}};r([o({type:String,json:{read:!0,write:!0}})],Re.prototype,"name",void 0),r([o({type:String,json:{read:!0,write:!0}})],Re.prototype,"sensorName",void 0),Re=r([b("esri.rest.support.BaseImageMeasureResult")],Re);let qe=class extends Re{constructor(){super(...arguments),this.area=null,this.perimeter=null}};r([o({type:Xe,json:{read:!0,write:!0}})],qe.prototype,"area",void 0),r([o({type:Me,json:{read:!0,write:!0}})],qe.prototype,"perimeter",void 0),qe=r([b("esri.rest.support.ImageAreaResult")],qe);const yr=qe;let Oe=class extends P{constructor(){super(...arguments),this.area=null,this.geometry=null}readGeometry(i,a){return i==null?null:i.rings?Ze.fromJSON(i):ze.fromJSON(i)}};r([o({type:Number,json:{write:!0}})],Oe.prototype,"area",void 0),r([o({json:{name:"shape",write:!0}})],Oe.prototype,"geometry",void 0),r([V("geometry")],Oe.prototype,"readGeometry",null),Oe=r([b("esri.rest.support.ImageBoundaryResult")],Oe);const hr=Oe;let Ce=class extends Re{constructor(){super(...arguments),this.distance=null,this.azimuthAngle=null,this.elevationAngle=null}};r([o({type:Me,json:{read:!0,write:!0}})],Ce.prototype,"distance",void 0),r([o({type:He,json:{read:!0,write:!0}})],Ce.prototype,"azimuthAngle",void 0),r([o({type:He,json:{read:!0,write:!0}})],Ce.prototype,"elevationAngle",void 0),Ce=r([b("esri.rest.support.ImageDistanceResult")],Ce);const gr=Ce;let Ye=class extends Ht(P){constructor(){super(...arguments),this.id=null}};r([o({json:{write:!0}})],Ye.prototype,"id",void 0),Ye=r([b("esri.rest.support.CameraInfo")],Ye);const fr=Ye;let X=class extends P{constructor(){super(...arguments),this.id=null,this.name=null,this.acquisitionDate=null,this.cameraID=null,this.center=null,this.gps=null,this.orientation=null}writeAcquisitionDate(i,a){a.acquisitionDate=i==null?void 0:i.getTime()}};r([o({json:{write:!0}})],X.prototype,"id",void 0),r([o({json:{write:!0}})],X.prototype,"name",void 0),r([o({type:Date,json:{write:!0}})],X.prototype,"acquisitionDate",void 0),r([T("acquisitionDate")],X.prototype,"writeAcquisitionDate",null),r([o({json:{write:!0}})],X.prototype,"cameraID",void 0),r([o({type:A,json:{write:!0}})],X.prototype,"center",void 0),r([o({json:{write:!0}})],X.prototype,"gps",void 0),r([o({json:{write:!0}})],X.prototype,"orientation",void 0),X=r([b("esri.rest.support.ImageGPSInfo")],X);const wr=X;let Ge=class extends P{constructor(){super(...arguments),this.images=null,this.cameras=null}};r([o({type:[wr],json:{write:!0}})],Ge.prototype,"images",void 0),r([o({type:[fr],json:{write:!0}})],Ge.prototype,"cameras",void 0),Ge=r([b("esri.rest.support.ImageGPSInfoResult")],Ge);const Rr=Ge;let et=class extends Re{constructor(){super(...arguments),this.height=null}};r([o({type:Me,json:{read:!0,write:!0}})],et.prototype,"height",void 0),et=r([b("esri.rest.support.ImageHeightResult")],et);const vr=et;let Y=class extends P{constructor(){super(...arguments),this.catalogItemVisibilities=null,this.catalogItems=null,this.location=null,this.name=null,this.objectId=null,this.processedValues=null,this.properties=null,this.value=null}};r([o({json:{write:!0}})],Y.prototype,"catalogItemVisibilities",void 0),r([o({type:qt,json:{write:!0}})],Y.prototype,"catalogItems",void 0),r([o({type:A,json:{write:!0}})],Y.prototype,"location",void 0),r([o({json:{write:!0}})],Y.prototype,"name",void 0),r([o({json:{write:!0}})],Y.prototype,"objectId",void 0),r([o({json:{write:!0}})],Y.prototype,"processedValues",void 0),r([o({json:{write:!0}})],Y.prototype,"properties",void 0),r([o({json:{write:!0}})],Y.prototype,"value",void 0),Y=r([b("esri.rest.support.ImageIdentifyResult")],Y);const br=Y;let tt=class extends P{constructor(){super(...arguments),this.geometries=null}};r([o({json:{write:!0}})],tt.prototype,"geometries",void 0),tt=r([b("esri.rest.support.ImagePixelLocationResult")],tt);const Sr=tt;let it=class extends Re{constructor(){super(...arguments),this.point=null}};r([o({type:A,json:{name:"point.value",read:!0,write:!0}})],it.prototype,"point",void 0),it=r([b("esri.rest.support.ImagePointResult")],it);const xr=it;let ue=class extends P{constructor(){super(...arguments),this.attributes=null,this.location=null,this.locationId=null,this.rasterId=null,this.resolution=null,this.pixelValue=null}};r([o({json:{write:!0}})],ue.prototype,"attributes",void 0),r([o({type:A,json:{write:!0}})],ue.prototype,"location",void 0),r([o({json:{write:!0}})],ue.prototype,"locationId",void 0),r([o({json:{write:!0}})],ue.prototype,"rasterId",void 0),r([o({json:{write:!0}})],ue.prototype,"resolution",void 0),r([o({json:{write:!0}})],ue.prototype,"pixelValue",void 0),ue=r([b("esri.rest.support.ImageSample")],ue);const Ir=ue;let rt=class extends P{constructor(){super(...arguments),this.samples=null}};r([o({type:[Ir],json:{write:!0}})],rt.prototype,"samples",void 0),rt=r([b("esri.rest.support.ImageSampleResult")],rt);const Fr=rt;let st=class extends P{constructor(){super(...arguments),this.url=null}};r([o({json:{name:"imageURL",write:!0}})],st.prototype,"url",void 0),st=r([b("esri.rest.support.ImageUrlResult")],st);const Dr=st;let he=class extends P{constructor(){super(...arguments),this.geometry=null,this.length=null,this.area=null,this.center=null}readCenter(i,a){return i.spatialReference||(i={...i,spatialReference:a.Shape.spatialReference}),A.fromJSON(i)}};r([o({types:oe,json:{name:"Shape",read:te,write:!0}})],he.prototype,"geometry",void 0),r([o({json:{name:"Length",write:!0}})],he.prototype,"length",void 0),r([o({json:{name:"Area",write:!0}})],he.prototype,"area",void 0),r([o({json:{name:"Center",write:!0}})],he.prototype,"center",void 0),r([V("center")],he.prototype,"readCenter",null),he=r([b("esri.rest.support.MeasureAreaFromImageResult")],he);const Tr=he;let Le=class extends P{constructor(){super(...arguments),this.geometry=null,this.length=null}};r([o({types:oe,json:{name:"Shape",read:te,write:!0}})],Le.prototype,"geometry",void 0),r([o({json:{name:"Length",write:!0}})],Le.prototype,"length",void 0),Le=r([b("esri.rest.support.MeasureLengthFromImageResult")],Le);const Pr=Le;function jt(s){const i=s==null?void 0:s.time;if(i&&(i.start!=null||i.end!=null)){const a=[];i.start!=null&&a.push(i.start),i.end==null||a.includes(i.end)||a.push(i.end),s.time=a.join(",")}}async function Bt(s,i,a){const e=M(s),t=i.geometry?[i.geometry]:[],n=await Ne(t),l=i.toJSON();jt(l);const u=n==null?void 0:n[0];u!=null&&(l.geometry=ae(u));const p=z({...e.query,f:"json",...l});return U(p,a)}async function jr(s,i,a){var p,m,c;const e=i.toJSON();e.angleName!=null&&(e.angleName=e.angleName.join(",")),(m=(p=i==null?void 0:i.point)==null?void 0:p.spatialReference)!=null&&m.imageCoordinateSystem&&(e.point.spatialReference=ct(i.point.spatialReference)),(c=i==null?void 0:i.spatialReference)!=null&&c.imageCoordinateSystem&&(e.spatialReference=Je(i.spatialReference));const t=M(s),n=z({...t.query,f:"json",...e}),l=U(n,a),{data:u}=await D(`${t.path}/computeAngles`,l);return u.spatialReference=u.spatialReference?u.spatialReference.geodataXform!=null?new se({wkid:0,imageCoordinateSystem:u.spatialReference}):se.fromJSON(u.spatialReference):null,u.north==="NaN"&&(u.north=null),u.up==="NaN"&&(u.up=null),new dr(u)}async function Nr(s,i,a){var m;const e=i.toJSON(),{geometries:t}=i;if(t)for(let c=0;c{u.avg=u.mean,u.stddev=u.standardDeviation}),{statistics:l,histograms:n.histograms}}async function Or(s,i,a){const e=await Bt(s,i,a),t=M(s),{data:n}=await D(`${t.path}/computeHistograms`,e);return{histograms:n.histograms}}async function Cr(s,i,a){var d,h;const e=i.toJSON();jt(e),(d=e.outFields)!=null&&d.length&&(e.outFields=e.outFields.join(","));const t=await Ne(i.geometry),n=t==null?void 0:t[0];n!=null&&(e.geometry=ae(n));const l=M(s),u=z({...l.query,f:"json",...e}),p=U(u,a),{data:m}=await D(`${l.path}/getSamples`,p),c=(h=m==null?void 0:m.samples)==null?void 0:h.map(R=>{const f=R.value==="NaN"||R.value===""?null:R.value.split(" ").map(w=>Number(w));return{...R,pixelValue:f}});return Fr.fromJSON({samples:c})}async function $t(s,i,a){const e=M(s),t=i.geometry?[i.geometry]:[];return Ne(t).then(n=>{const l=i.toJSON(),u=n==null?void 0:n[0];u!=null&&(l.geometry=JSON.stringify(ae(u)));const p=z({...e.query,f:"json",...l}),m=U(p,a);return D(e.path+"/identify",m)}).then(n=>br.fromJSON(n.data))}async function $r(s,i,a){const e=await pt(s,i,[i.fromGeometry,i.toGeometry],a);return vr.fromJSON(e)}async function Ar(s,i,a){const e=await pt(s,i,[i.geometry],a);return yr.fromJSON(e)}async function Vr(s,i,a){const e=await pt(s,i,[i.geometry],a);return xr.fromJSON(e)}async function Mr(s,i,a){const e=await pt(s,i,[i.fromGeometry,i.toGeometry],a);return gr.fromJSON(e)}async function pt(s,i,a,e){const t=M(s),n=await Ne(a),l=i.toJSON();n[0]!=null&&(l.fromGeometry=JSON.stringify(ae(n[0]))),n[1]!=null&&(l.toGeometry=JSON.stringify(ae(n[1])));const u=z({...t.query,f:"json",...l}),p=U(u,e),{data:m}=await D(t.path+"/measure",p);return m}async function Jr(s,i,a){const e=await Qt(s,i,a);return Pr.fromJSON(e)}async function Er(s,i,a){const e=await Qt(s,i,a);return Tr.fromJSON(e)}async function Qt(s,i,a){const e=M(s),t=i.toJSON(),n=z({...e.query,f:"json",...t}),l=U(n,a),{data:u}=await D(e.path+"/measureFromImage",l);return u}function ae(s){var a;const i=s.toJSON();return(a=s.spatialReference)!=null&&a.imageCoordinateSystem&&(i.spatialReference=ct(s.spatialReference)),i}function ct(s){const{imageCoordinateSystem:i}=s;if(i){const{id:a,referenceServiceName:e}=i;return a!=null?e?{icsid:a,icsns:e}:{icsid:a}:{ics:i}}return s.toJSON()}function Je(s,i){if(!s.imageCoordinateSystem)return wt(s);const a=ct(s),{icsid:e,icsns:t}=a;return e==null||t!=null&&!(i!=null&&i.toLowerCase().includes("/"+t.toLowerCase()+"/"))?JSON.stringify(a):`0:${e}`}async function qr(s,i,a){const e=M(s),t=i.toJSON();i.outSpatialReference&&(t.outSR=Je(i.outSpatialReference));const n=z({...e.query,f:"json",...t}),l=U(n,a),{data:u}=await D(e.path+"/queryBoundary",l);return hr.fromJSON(u)}async function Gr(s,i,a){var d,h;const e=i.toJSON();jt(e),(d=e.objectIds)!=null&&d.length&&(e.objectIds=e.objectIds.join(",")),e.geometry||e.objectIds||e.time||e.where||(e.where="1=1");const t=await Ne(i.geometry),n=t==null?void 0:t[0];n!=null&&(e.geometry=ae(n));const l=(n==null?void 0:n.spatialReference)??((h=i.geometry)==null?void 0:h.spatialReference);l&&(e.inSR=Je(l));const u=M(s),p=z({...u.query,f:"json",...e}),m=U(p,a),{data:c}=await D(`${u.path}/queryGPSInfo`,m);return Rr.fromJSON(c)}async function Lr(s,i,a){const e=i.toJSON();i.geometry.spatialReference.imageCoordinateSystem&&(e.geometry=ae(i.geometry)),i.depthOffset&&i.adjust||delete e.options;const t=M(s),n=z({...t.query,f:"json",...e}),l=U(n,a),{data:u}=await D(`${t.path}/imageToMap`,l);return te(u)}async function zr(s,i,a){var p;const e=i.toJSON();(p=i.rasterIds)!=null&&p.length&&(e.rasterIds=i.rasterIds.join(","));const t=M(s),n=z({...t.query,f:"json",...e}),l=U(n,a),{data:u}=await D(`${t.path}/imageToMapMultiray`,l);return te(u)}async function Ur(s,i,a){var d;const e=i.toJSON(),t=await Ne(i.geometry),n=t==null?void 0:t[0];n!=null&&(e.geometry=ae(n)),i.visibleOnly||delete e.options;const l=(n==null?void 0:n.spatialReference)??((d=i.geometry)==null?void 0:d.spatialReference);l&&(e.inSR=Je(l));const u=M(s),p=z({...u.query,f:"json",...e}),m=U(p,a),{data:c}=await D(`${u.path}/mapToImage`,m);return te(c)}async function Hr(s,i,a){const e=i.toJSON(),t=M(s),n=z({...t.query,f:"json",...e}),l=U(n,a),{data:u}=await D(`${t.path}/getImageUrl`,l);return Dr.fromJSON(u)}async function Br(s,i,a){var m;const e=i.toJSON(),t=await Ne([i.fromGeometry,i.toGeometry]);t[0]!=null&&(e.fromGeometry=ae(t[0]),t[0].spatialReference&&(e.inSR=Je(t[0].spatialReference))),t[1]!=null&&(e.toGeometry=ae(t[1])),(m=i.objectIds)!=null&&m.length&&(e.objectIds=e.objectIds.join(","));const n=M(s),l=z({...n.query,f:"json",...e}),u=U(l,a),{data:p}=await D(`${n.path}/find`,u);return mr.fromJSON(p)}async function Qr(s,i,a){var G,J;const e=M(s),t=z({...e==null?void 0:e.query,f:"json"}),n=U(t,a),l=`${e==null?void 0:e.path}/${i}/info`,u=D(`${l}`,n),p=D(`${l}/keyProperties`,n),m=await Promise.allSettled([u,p]),c=m[0].status==="fulfilled"?m[0].value.data:null,d=m[1].status==="fulfilled"?m[1].value.data:null;let h=null;(G=c.statistics)!=null&&G.length&&(h=c.statistics.map(F=>({min:F[0],max:F[1],avg:F[2],stddev:F[3]})));const R=ze.fromJSON(c.extent),f=Math.ceil(R.width/c.pixelSizeX-.1),w=Math.ceil(R.height/c.pixelSizeY-.1),y=R.spatialReference,g=new A({x:c.pixelSizeX,y:c.pixelSizeY,spatialReference:y}),v=(J=c.histograms)!=null&&J.length?c.histograms:null,_=new qi({origin:c.origin,blockWidth:c.blockWidth,blockHeight:c.blockHeight,firstPyramidLevel:c.firstPyramidLevel,maximumPyramidLevel:c.maxPyramidLevel});return new Et({width:f,height:w,bandCount:c.bandCount,extent:R,spatialReference:y,pixelSize:g,pixelType:c.pixelType.toLowerCase(),statistics:h,histograms:v,keyProperties:d,storageInfo:_})}let ge=class extends Se(P){constructor(){super(...arguments),this.fromGeometry=null,this.toGeometry=null,this.objectIds=null,this.where=null,this.maxCount=null}};r([o({type:A,json:{read:!0}})],ge.prototype,"fromGeometry",void 0),r([o({type:A,json:{read:!0,write:!0}})],ge.prototype,"toGeometry",void 0),r([o({json:{write:!0}})],ge.prototype,"objectIds",void 0),r([o({type:String,json:{write:!0}})],ge.prototype,"where",void 0),r([o({type:Number,json:{write:!0}})],ge.prototype,"maxCount",void 0),ge=r([b("esri.rest.support.FindImagesParameters")],ge);const kr=ge;var Rt;let De=Rt=class extends P{constructor(s){super(s),this.angleNames=null,this.point=null,this.spatialReference=null,this.rasterId=null}clone(){return new Rt(Q({angleNames:this.angleNames,point:this.point,spatialReference:this.spatialReference,rasterId:this.rasterId}))}};r([o({type:[String],json:{name:"angleName",write:!0}})],De.prototype,"angleNames",void 0),r([o({type:A,json:{write:!0}})],De.prototype,"point",void 0),r([o({type:se,json:{write:!0}})],De.prototype,"spatialReference",void 0),r([o({type:Be,json:{write:!0}})],De.prototype,"rasterId",void 0),De=Rt=r([b("esri.rest.support.ImageAngleParameters")],De);const Wr=De,W=new kt({esriMensurationPoint:"point",esriMensurationCentroid:"centroid",esriMensurationDistanceAndAngle:"distance-and-angle",esriMensurationAreaAndPerimeter:"area-and-perimeter",esriMensurationHeightFromBaseAndTop:"base-and-top",esriMensurationHeightFromBaseAndTopShadow:"base-and-top-shadow",esriMensurationHeightFromTopAndTopShadow:"top-and-top-shadow",esriMensurationPoint3D:"point-3D",esriMensurationCentroid3D:"centroid-3D",esriMensurationDistanceAndAngle3D:"distance-and-angle-3D",esriMensurationAreaAndPerimeter3D:"area-and-perimeter-3D"});let ee=class extends P{constructor(){super(...arguments),this.type=null,this.measureOperation=null,this.mosaicRule=null,this.pixelSize=null,this.raster=void 0}};r([o()],ee.prototype,"type",void 0),r([o({type:W.apiValues,json:{read:W.read,write:W.write}})],ee.prototype,"measureOperation",void 0),r([o({type:k,json:{write:!0}})],ee.prototype,"mosaicRule",void 0),r([o({type:A,json:{write:!0}})],ee.prototype,"pixelSize",void 0),r([o({json:{write:!0}})],ee.prototype,"raster",void 0),ee=r([b("esri.rest.support.BaseImageMeasureParameters")],ee);var vt;let pe=vt=class extends ee{constructor(){super(...arguments),this.type="area-perimeter",this.geometry=null,this.is3D=!1,this.linearUnit="meters",this.areaUnit="square-meters"}writeGeometry(s,i,a){s!=null&&(i.geometryType=ie(s),i[a]=s.toJSON())}get measureOperation(){return this.is3D?"area-and-perimeter-3D":"area-and-perimeter"}clone(){return new vt(Q({geometry:this.geometry,is3D:this.is3D,linearUnit:this.linearUnit,areaUnit:this.areaUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};r([o({types:oe,json:{name:"fromGeometry",read:!0,write:!0}})],pe.prototype,"geometry",void 0),r([T("geometry")],pe.prototype,"writeGeometry",null),r([o({type:W.apiValues,json:{write:W.write}})],pe.prototype,"measureOperation",null),r([o({json:{read:!0}})],pe.prototype,"is3D",void 0),r([o({type:String,json:{read:be.read,write:be.write}})],pe.prototype,"linearUnit",void 0),r([o({type:String,json:{read:ot.read,write:ot.write}})],pe.prototype,"areaUnit",void 0),pe=vt=r([b("esri.rest.support.ImageAreaParameters")],pe);const Zr=pe;let nt=class extends Se(P){constructor(){super(...arguments),this.outSpatialReference=null}};r([o({type:se,json:{name:"outSR",write:!0}})],nt.prototype,"outSpatialReference",void 0),nt=r([b("esri.rest.support.ImageBoundaryParameters")],nt);const Kr=nt;var bt;let re=bt=class extends ee{constructor(){super(...arguments),this.type="distance-angle",this.fromGeometry=null,this.toGeometry=null,this.is3D=!1,this.linearUnit="meters",this.angularUnit="degrees"}writeFromGeometry(s,i,a){s!=null&&(i.geometryType=ie(s),i[a]=s.toJSON())}get measureOperation(){return this.is3D?"distance-and-angle-3D":"distance-and-angle"}clone(){return new bt(Q({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,is3D:this.is3D,linearUnit:this.linearUnit,angularUnit:this.angularUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};r([o({type:A,json:{read:!0,write:!0}})],re.prototype,"fromGeometry",void 0),r([T("fromGeometry")],re.prototype,"writeFromGeometry",null),r([o({type:A,json:{read:!0,write:!0}})],re.prototype,"toGeometry",void 0),r([o({type:W.apiValues,json:{write:W.write}})],re.prototype,"measureOperation",null),r([o({json:{read:!0}})],re.prototype,"is3D",void 0),r([o({type:String,json:{read:be.read,write:be.write}})],re.prototype,"linearUnit",void 0),r([o({type:String,json:{read:lt.read,write:lt.write}})],re.prototype,"angularUnit",void 0),re=bt=r([b("esri.rest.support.ImageDistanceParameters")],re);const Xr=re;let ce=class extends Se(P){constructor(){super(...arguments),this.geometry=null,this.objectIds=null,this.spatialRelationship="intersects",this.timeExtent=null,this.where=null}writeGeometry(i,a,e){i!=null&&(a.geometryType=ie(i),a[e]=JSON.stringify(i.toJSON()))}};r([o({types:oe,json:{read:te,write:!0}})],ce.prototype,"geometry",void 0),r([T("geometry")],ce.prototype,"writeGeometry",null),r([o({json:{write:!0}})],ce.prototype,"objectIds",void 0),r([Wt(Zt,{ignoreUnknown:!1,name:"spatialRel"})],ce.prototype,"spatialRelationship",void 0),r([o({type:Pt,json:{name:"time",write:!0}})],ce.prototype,"timeExtent",void 0),r([o({type:String,json:{write:!0}})],ce.prototype,"where",void 0),ce=r([b("esri.rest.support.ImageGPSInfoParameters")],ce);const Yr=ce;var St;let me=St=class extends ee{constructor(){super(...arguments),this.type="height",this.fromGeometry=null,this.toGeometry=null,this.operationType="base-and-top",this.linearUnit="meters"}writeFromGeometry(s,i,a){s!=null&&(i.geometryType=ie(s),i[a]=s.toJSON())}get measureOperation(){return this.operationType}clone(){return new St(Q({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,operationType:this.operationType,linearUnit:this.linearUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};r([o({type:A,json:{read:!0}})],me.prototype,"fromGeometry",void 0),r([T("fromGeometry")],me.prototype,"writeFromGeometry",null),r([o({type:A,json:{read:!0,write:!0}})],me.prototype,"toGeometry",void 0),r([o({type:W.apiValues,json:{write:W.write}})],me.prototype,"measureOperation",null),r([o({json:{read:!0}})],me.prototype,"operationType",void 0),r([o({type:String,json:{read:be.read,write:be.write}})],me.prototype,"linearUnit",void 0),me=St=r([b("esri.rest.support.ImageHeightParameters")],me);const es=me;var xt;let N=xt=class extends P{constructor(){super(...arguments),this.geometry=null,this.rasterFunctions=null,this.pixelSize=null,this.returnGeometry=!0,this.returnCatalogItems=!0,this.returnPixelValues=!0,this.maxItemCount=null,this.timeExtent=null,this.raster=void 0,this.viewId=void 0,this.processAsMultidimensional=!1}writeGeometry(s,i,a){s!=null&&(i.geometryType=ie(s),i[a]=JSON.stringify(s.toJSON()))}set mosaicRule(s){let i=s;i!=null&&i.mosaicMethod&&(i=k.fromJSON({...i.toJSON(),mosaicMethod:i.mosaicMethod,mosaicOperation:i.mosaicOperation})),this._set("mosaicRule",i)}writeMosaicRule(s,i,a){s!=null&&(i[a]=JSON.stringify(s.toJSON()))}get renderingRule(){return Ve(we.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._get("rasterFunction")}set renderingRule(s){Ve(we.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._set("rasterFunction",s)}get renderingRules(){return Ve(we.getLogger(this),"renderingRules",{replacement:"rasterFunctions",version:"4.27",warnOnce:!0}),this._get("rasterFunctions")}set renderingRules(s){Ve(we.getLogger(this),"renderingRules",{replacement:"rasterFunctions",version:"4.27",warnOnce:!0}),this._set("rasterFunctions",s)}set rasterFunction(s){let i=s;i!=null&&i.rasterFunction&&(i=S.fromJSON({...i.toJSON(),rasterFunction:i.rasterFunction,rasterFunctionArguments:i.rasterFunctionArguments})),this._set("rasterFunction",i)}writeRasterFunction(s,i,a){s!=null&&(i[a]=JSON.stringify(s.toJSON())),s.rasterFunctionDefinition&&(i[a]=JSON.stringify(s.rasterFunctionDefinition))}writeRasterFunctions(s,i,a){s!=null&&(i[a]=JSON.stringify(s.map(e=>e.rasterFunctionDefinition||e.toJSON())))}writePixelSize(s,i,a){s!=null&&(i[a]=JSON.stringify(s))}writeTimeExtent(s,i,a){if(s!=null){const e=s.start!=null?s.start.getTime():null,t=s.end!=null?s.end.getTime():null;i[a]=e!=null?t!=null?`${e},${t}`:`${e}`:null}}clone(){return new xt(Q({geometry:this.geometry,mosaicRule:this.mosaicRule,rasterFunction:this.rasterFunction,rasterFunctions:this.rasterFunctions,pixelSize:this.pixelSize,returnGeometry:this.returnGeometry,returnCatalogItems:this.returnCatalogItems,returnPixelValues:this.returnPixelValues,maxItemCount:this.maxItemCount,processAsMultidimensional:this.processAsMultidimensional,raster:this.raster,viewId:this.viewId,timeExtent:this.timeExtent}))}};r([o({json:{write:!0}})],N.prototype,"geometry",void 0),r([T("geometry")],N.prototype,"writeGeometry",null),r([o({type:k,json:{write:!0}})],N.prototype,"mosaicRule",null),r([T("mosaicRule")],N.prototype,"writeMosaicRule",null),r([o({type:S})],N.prototype,"renderingRule",null),r([o({type:[S]})],N.prototype,"renderingRules",null),r([o({type:S,json:{write:!0,name:"renderingRule"}})],N.prototype,"rasterFunction",null),r([T("rasterFunction")],N.prototype,"writeRasterFunction",null),r([o({type:[S],json:{write:!0,name:"renderingRules"}})],N.prototype,"rasterFunctions",void 0),r([T("rasterFunctions")],N.prototype,"writeRasterFunctions",null),r([o({type:A,json:{write:!0}})],N.prototype,"pixelSize",void 0),r([T("pixelSize")],N.prototype,"writePixelSize",null),r([o({type:Boolean,json:{write:!0}})],N.prototype,"returnGeometry",void 0),r([o({type:Boolean,json:{write:!0}})],N.prototype,"returnCatalogItems",void 0),r([o({type:Boolean,json:{write:!0}})],N.prototype,"returnPixelValues",void 0),r([o({type:Number,json:{write:!0}})],N.prototype,"maxItemCount",void 0),r([o({type:Pt,json:{write:{target:"time"}}})],N.prototype,"timeExtent",void 0),r([T("timeExtent")],N.prototype,"writeTimeExtent",null),r([o({json:{write:!0}})],N.prototype,"raster",void 0),r([o({json:{write:!0}})],N.prototype,"viewId",void 0),r([o({type:Boolean,json:{write:!0}})],N.prototype,"processAsMultidimensional",void 0),N=xt=r([b("esri.rest.support.ImageIdentifyParameters")],N);const At=N;var It;let $e=It=class extends P{constructor(){super(...arguments),this.geometries=null,this.rasterId=null}writeGeometry(s,i,a){i.geometries={geometryType:"esriGeometryPoint",geometries:s.map(e=>e.toJSON())}}clone(){var s;return new It({geometries:((s=this.geometries)==null?void 0:s.map(i=>i.clone()))??[],rasterId:this.rasterId})}};r([o({type:[A],json:{write:!0}})],$e.prototype,"geometries",void 0),r([T("geometries")],$e.prototype,"writeGeometry",null),r([o({type:Be,json:{write:!0}})],$e.prototype,"rasterId",void 0),$e=It=r([b("esri.rest.support.ImagePixelLocationParameters")],$e);const ts=$e;var Ft;let Te=Ft=class extends ee{constructor(){super(...arguments),this.type="point",this.geometry=null,this.is3D=!1}writeGeometry(s,i,a){s!=null&&(i.geometryType=ie(s),i[a]=s.toJSON())}get measureOperation(){const{is3D:s,geometry:i}=this;return i.type==="point"?s?"point-3D":"point":s?"centroid-3D":"centroid"}clone(){return new Ft(Q({geometry:this.geometry,is3D:this.is3D,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};r([o({types:oe,json:{name:"fromGeometry",read:te}})],Te.prototype,"geometry",void 0),r([T("geometry")],Te.prototype,"writeGeometry",null),r([o({type:W.apiValues,json:{read:W.read,write:W.write}})],Te.prototype,"measureOperation",null),r([o({json:{read:!0}})],Te.prototype,"is3D",void 0),Te=Ft=r([b("esri.rest.support.ImagePointParameters")],Te);const is=Te;var Dt;let q=Dt=class extends P{constructor(){super(...arguments),this.geometry=null,this.interpolation="nearest",this.mosaicRule=null,this.outFields=null,this.pixelSize=null,this.returnFirstValueOnly=!0,this.sampleDistance=null,this.sampleCount=null,this.sliceId=null,this.timeExtent=null}writeGeometry(s,i,a){s!=null&&(i.geometryType=ie(s),i[a]=s.toJSON())}set locations(s){if(s!=null&&s.length){const i=new Kt({spatialReference:s[0].spatialReference});i.points=s.map(a=>[a.x,a.y]),this._set("locations",s),this.geometry=i}}clone(){return new Dt(Q({geometry:this.geometry,locations:this.locations,interpolation:this.interpolation,mosaicRule:this.mosaicRule,outFields:this.outFields,raster:this.raster,returnFirstValueOnly:this.returnFirstValueOnly,sampleDistance:this.sampleDistance,sampleCount:this.sampleCount,sliceId:this.sliceId,pixelSize:this.pixelSize,timeExtent:this.timeExtent}))}};r([o({types:oe,json:{read:te}})],q.prototype,"geometry",void 0),r([T("geometry")],q.prototype,"writeGeometry",null),r([o()],q.prototype,"locations",null),r([o({type:String,json:{type:ve.jsonValues,read:ve.read,write:ve.write}})],q.prototype,"interpolation",void 0),r([o({type:k,json:{write:!0}})],q.prototype,"mosaicRule",void 0),r([o({type:[String],json:{write:!0}})],q.prototype,"outFields",void 0),r([o({type:A,json:{write:!0}})],q.prototype,"pixelSize",void 0),r([o({type:String,json:{write:!0}})],q.prototype,"raster",void 0),r([o({type:Boolean,json:{write:!0}})],q.prototype,"returnFirstValueOnly",void 0),r([o({type:Number,json:{write:!0}})],q.prototype,"sampleDistance",void 0),r([o({type:Number,json:{write:!0}})],q.prototype,"sampleCount",void 0),r([o({type:Number,json:{write:!0}})],q.prototype,"sliceId",void 0),r([o({type:Pt,json:{read:{source:"time"},write:{target:"time"}}})],q.prototype,"timeExtent",void 0),q=Dt=r([b("esri.rest.support.ImageSampleParameters")],q);const rs=q;let Pe=class extends Se(P){constructor(){super(...arguments),this.geometries=[],this.rasterIds=null,this.outSpatialReference=null}writeGeometries(i,a,e){a.geometries=i!=null&&i.length?{geometryType:ie(i[0]),geometries:i.map(t=>({...t.toJSON(),spatialReference:void 0}))}:null}};r([o({types:[oe]})],Pe.prototype,"geometries",void 0),r([T("geometries")],Pe.prototype,"writeGeometries",null),r([o({type:[Be],json:{write:!0}})],Pe.prototype,"rasterIds",void 0),r([o({type:se,json:{name:"outSR",write:!0}})],Pe.prototype,"outSpatialReference",void 0),Pe=r([b("esri.rest.support.ImageToMapMultirayParameters")],Pe);const ss=Pe;let de=class extends Se(P){constructor(){super(...arguments),this.geometry=null,this.rasterId=null,this.outSpatialReference=null,this.depthOffset=0,this.adjust=!1}writeGeometry(i,a,e){i!=null&&(a.geometryType=ie(i),a[e]={...i.toJSON(),spatialReference:void 0})}};r([o({types:oe,json:{read:te,write:!0}})],de.prototype,"geometry",void 0),r([T("geometry")],de.prototype,"writeGeometry",null),r([o({json:{write:!0}})],de.prototype,"rasterId",void 0),r([o({type:se,json:{name:"outSR",write:!0}})],de.prototype,"outSpatialReference",void 0),r([o({json:{name:"options.DOff",write:!0}})],de.prototype,"depthOffset",void 0),r([o({json:{name:"options.Adjust",write:!0}})],de.prototype,"adjust",void 0),de=r([b("esri.rest.support.ImageToMapParameters")],de);const ns=de;let at=class extends Se(P){constructor(){super(...arguments),this.referenceUri=null}};r([o({type:String,json:{name:"uri",write:!0}})],at.prototype,"referenceUri",void 0),at=r([b("esri.rest.support.ImageUrlParameters")],at);const as=at;let je=class extends Se(P){constructor(){super(...arguments),this.geometry=null,this.rasterId=null,this.visibleOnly=!1}writeGeometry(s,i,a){s!=null&&(i.geometryType=ie(s),i[a]=JSON.stringify(s))}};r([o({types:oe,json:{read:te,write:!0}})],je.prototype,"geometry",void 0),r([T("geometry")],je.prototype,"writeGeometry",null),r([o({json:{write:!0}})],je.prototype,"rasterId",void 0),r([o({json:{name:"options.VisibleOnly",write:!0}})],je.prototype,"visibleOnly",void 0),je=r([b("esri.rest.support.MapToImageParameters")],je);const os=je;var Tt;let Ae=Tt=class extends P{constructor(){super(...arguments),this.geometry=null,this.rasterId=void 0}writeGeometry(s,i,a){s!=null&&(i.geometryType=ie(s),i[a]={...s.toJSON(),spatialReference:void 0})}clone(){const s=Q({geometry:this.geometry,rasterId:this.rasterId});return new Tt(s)}};r([o({types:oe,json:{name:"fromGeometry",read:te,write:!0}})],Ae.prototype,"geometry",void 0),r([T("geometry")],Ae.prototype,"writeGeometry",null),r([o({json:{write:!0}})],Ae.prototype,"rasterId",void 0),Ae=Tt=r([b("esri.rest.support.MeasureFromImageParameters")],Ae);const Vt=Ae,ls=new Set(["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"]),us=ri(si,{min:0,max:255});function ps(s){if(!s)return null;const i=JSON.stringify(s).match(/"rasterFunction":"(.*?")/gi),a=i==null?void 0:i.map(e=>e.replace('"rasterFunction":"',"").replace('"',""));return a?a.join("/"):null}const cs=s=>{let i=class extends s{constructor(){super(...arguments),this._functionRasterInfos={},this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this._cachedRendererJson=null,this._serviceSupportsMosaicRule=null,this._rasterAttributeTableFieldPrefix="Raster.",this.adjustAspectRatio=null,this.bandIds=void 0,this.capabilities=null,this.compressionQuality=void 0,this.compressionTolerance=.01,this.copyright=null,this.defaultMosaicRule=null,this.definitionExpression=null,this.exportImageServiceParameters=null,this.rasterInfo=null,this.fields=null,this.fullExtent=null,this.hasMultidimensions=!1,this.imageMaxHeight=4100,this.imageMaxWidth=4100,this.interpolation=void 0,this.minScale=0,this.maxScale=0,this.multidimensionalInfo=null,this.multidimensionalSubset=null,this.noData=null,this.noDataInterpretation=void 0,this.objectIdField=null,this.geometryType="polygon",this.typeIdField=null,this.types=[],this.pixelFilter=null,this.raster=void 0,this.sourceType=null,this.viewId=void 0,this.symbolizer=null,this.rasterFunctionInfos=null,this.serviceDataType=null,this.spatialReference=null,this.pixelType=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.url=null,this.version=void 0}initialize(){this._set("exportImageServiceParameters",new O({layer:this}))}readServiceSupportsMosaicRule(e,t){return this._isMosaicRuleSupported(t)}get _rasterFunctionNamesIndex(){const e=new Map;return!this.rasterFunctionInfos||this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.length<1||this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.forEach(t=>{e.set(t.name.toLowerCase().replaceAll(/ /gi,"_"),t.name)}),e}readBandIds(e,t){if(Array.isArray(e)&&e.length>0&&e.every(n=>typeof n=="number"))return e}readCapabilities(e,t){return this._readCapabilities(t)}writeCompressionQuality(e,t,n){e!=null&&this.format!=="lerc"&&(t[n]=e)}writeCompressionTolerance(e,t,n){this.format==="lerc"&&e!=null&&(t[n]=e)}readDefaultMosaicRule(e,t){return this._serviceSupportsMosaicRule?k.fromJSON(t):null}get fieldsIndex(){return this.fields?new Ui(this.fields):null}set format(e){e&&ls.has(e.toLowerCase())&&this._set("format",e.toLowerCase())}readFormat(e,t){return t.serviceDataType==="esriImageServiceDataTypeVector-UV"||t.serviceDataType==="esriImageServiceDataTypeVector-MagDir"||this.pixelFilter!=null?"lerc":"jpgpng"}readMinScale(e,t){return t.minLOD!=null&&t.maxLOD!=null?e:0}readMaxScale(e,t){return t.minLOD!=null&&t.maxLOD!=null?e:0}set mosaicRule(e){let t=e;t!=null&&t.mosaicMethod&&(t=k.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}readMosaicRule(e,t){const n=e||t.mosaicRule;return n?k.fromJSON(n):this._isMosaicRuleSupported(t)?k.fromJSON(t):null}writeMosaicRule(e,t,n){let l=this.mosaicRule;const u=this.definitionExpression;l?u&&u!==l.where&&(l=l.clone(),l.where=u):u&&(l=new k({where:u})),this._isValidCustomizedMosaicRule(l)&&(t[n]=l.toJSON())}writeNoData(e,t,n){e!=null&&typeof e=="number"&&(t[n]=us(e))}readObjectIdField(e,t){if(!e){const n=t.fields.find(l=>l.type==="esriFieldTypeOID"||l.type==="oid");e=n==null?void 0:n.name}return e}get parsedUrl(){return ei(this.url)}readSourceType(e,t){return this._isMosaicDataset(t)?"mosaic-dataset":"raster-dataset"}set renderer(e){this.loaded&&(e=this._configRenderer(e)),this._set("renderer",e)}readRenderer(e,t,n){var p,m;const l=(m=(p=t==null?void 0:t.layerDefinition)==null?void 0:p.drawingInfo)==null?void 0:m.renderer,u=Si(l,n);return u==null?null:(u.type==="vector-field"&&t.symbolTileSize&&!l.symbolTileSize&&(u.symbolTileSize=t.symbolTileSize),Gt(u)||we.getLogger(this).warn("ArcGISImageService","Imagery layer doesn't support given renderer type."),u)}writeRenderer(e,t,n){t.layerDefinition=t.layerDefinition||{},t.layerDefinition.drawingInfo=t.layerDefinition.drawingInfo||{},t.layerDefinition.drawingInfo.renderer=e.toJSON(),e.type==="vector-field"&&(t.symbolTileSize=e.symbolTileSize)}get rasterFields(){var m;const e=this._rasterAttributeTableFieldPrefix,t=new Fe({name:"Raster.ItemPixelValue",alias:"Item Pixel Value",domain:null,editable:!1,length:50,type:"string"}),n=new Fe({name:"Raster.ServicePixelValue",alias:"Service Pixel Value",domain:null,editable:!1,length:50,type:"string"}),l=new Fe({name:"Raster.ServicePixelValue.Raw",alias:"Raw Service Pixel Value",domain:null,editable:!1,length:50,type:"string"});let u=this.fields?Q(this.fields):[];u.push(n),(m=this.capabilities)!=null&&m.operations.supportsQuery&&this.fields&&this.fields.length>0&&u.push(t),this.version>=10.4&&this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.some(c=>c.name.toLowerCase()==="none")&&u.push(l),this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.filter(c=>c.name.toLowerCase()!=="none").forEach(c=>{u.push(new Fe({name:"Raster.ServicePixelValue."+c.name,alias:c.name,domain:null,editable:!1,length:50,type:"string"}))}),this._isVectorDataSet()&&(u.push(new Fe({name:"Raster.Magnitude",alias:"Magnitude",domain:null,editable:!1,type:"double"})),u.push(new Fe({name:"Raster.Direction",alias:"Direction",domain:null,editable:!1,type:"double"})));const{attributeTable:p}=this.rasterInfo??{};if(p!=null){const c=p.fields.filter(d=>d.type!=="esriFieldTypeOID"&&d.name.toLowerCase()!=="value").map(d=>{const h=Q(d);return h.name=e+d.name,h});u=u.concat(c)}return u}get renderingRule(){return Ve(we.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this.rasterFunction}set renderingRule(e){Ve(we.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._set("rasterFunction",e)}set rasterFunction(e){let t=e;t!=null&&t.rasterFunction&&(t=S.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("rasterFunction",t)}readRasterFunction(e,t){const n=t.rasterFunctionInfos;return t.renderingRule||n!=null&&n.length&&n[0].name!=="None"?this._isRFTJson(t.renderingRule)?S.fromJSON({rasterFunctionDefinition:t.renderingRule}):S.fromJSON(t.renderingRule||{rasterFunctionInfos:t.rasterFunctionInfos}):null}readSpatialReference(e,t){const n=e||t.extent.spatialReference;return n?se.fromJSON(n):null}readPixelType(e){return dt.fromJSON(e)||e}writePixelType(e,t,n){this.serviceRasterInfo!=null&&this.pixelType===this.serviceRasterInfo.pixelType||(t[n]=dt.toJSON(e))}readVersion(e,t){let n=t.currentVersion;return n||(n=t.hasOwnProperty("fields")||t.hasOwnProperty("timeInfo")?10:9.3),n}applyFilter(e){let t=e;return this.pixelFilter&&(t=this._clonePixelData(e),this.pixelFilter(t)),t}async applyRenderer(e,t){let n=e;const{renderer:l,symbolizer:u,pixelFilter:p,bandIds:m}=this;if(!this._isPicture()&&l&&u&&!p){const c=JSON.stringify(this._cachedRendererJson)!==JSON.stringify(l.toJSON()),d=this._rasterJobHandler.instance;if(d){c&&(u.bind(),await d.updateSymbolizer(u,t),this._cachedRendererJson=l.toJSON());const h=await d.symbolize({bandIds:m,...e},t);n={extent:e.extent,pixelBlock:h}}else n={extent:e.extent,pixelBlock:u.symbolize({bandIds:m,...e})}}return n}destroy(){this._shutdownJobHandler()}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}async computeAngles(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsComputeAngles)throw new I("imagery-layer:compute-angles","this operation is not supported on the input image service");return e=$(Wr,e).clone(),jr(this.url,e,this._getRequestOptions(t))}async computePixelSpaceLocations(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsComputePixelLocation)throw new I("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return e=$(ts,e).clone(),Nr(this.url,e,this._getRequestOptions(t))}async computeHistograms(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsComputeHistograms)throw new I("imagery-layer:compute-histograms","this operation is not supported on the input image service");return e=$(yt,e).clone(),this._applyMosaicAndRenderingRules(e),Or(this.url,e,this._getRequestOptions(t))}async computeStatisticsHistograms(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsComputeStatisticsHistograms)throw new I("imagery-layer:compute-statistics-histograms","this operation is not supported on the input image service");return e=$(yt,e).clone(),this._applyMosaicAndRenderingRules(e),_r(this.url,e,this._getRequestOptions(t))}async measureHeight(e,t){const n=await this._fetchCapabilities(t==null?void 0:t.signal);if(!(e.operationType==="base-and-top"?n.mensuration.supportsHeightFromBaseAndTop:e.operationType==="base-and-top-shadow"?n.mensuration.supportsHeightFromBaseAndTopShadow:n.mensuration.supportsHeightFromTopAndTopShadow))throw new I("imagery-layer:measure-height","this operation is not supported on the input image service");return e=$(es,e).clone(),this._applyMosaicAndRenderingRules(e),$r(this.url,e,this._getRequestOptions(t))}async measureAreaAndPerimeter(e,t){const n=await this._fetchCapabilities(t==null?void 0:t.signal);if(!(n.mensuration.supportsAreaAndPerimeter&&(!e.is3D||n.mensuration.supports3D)))throw new I("imagery-layer:measure-area-and-perimeter","this operation is not supported on the input image service");return e=$(Zr,e).clone(),this._applyMosaicAndRenderingRules(e),Ar(this.url,e,this._getRequestOptions(t))}async measureDistanceAndAngle(e,t){const n=await this._fetchCapabilities(t==null?void 0:t.signal);if(!(n.mensuration.supportsDistanceAndAngle&&(!e.is3D||n.mensuration.supports3D)))throw new I("imagery-layer:measure-distance-and-angle","this operation is not supported on the input image service");return e=$(Xr,e).clone(),this._applyMosaicAndRenderingRules(e),Mr(this.url,e,this._getRequestOptions(t))}async measurePointOrCentroid(e,t){const n=await this._fetchCapabilities(t==null?void 0:t.signal);if(!(n.mensuration.supportsPointOrCentroid&&(!e.is3D||n.mensuration.supports3D)))throw new I("imagery-layer:measure-point-or-centroid","this operation is not supported on the input image service");return e=$(is,e).clone(),this._applyMosaicAndRenderingRules(e),Vr(this.url,e,this._getRequestOptions(t))}async measureLengthFromImage(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsMeasureFromImage)throw new I("imagery-layer:measure-length-from-image","this operation is not supported on the input image service");if(e.geometry.type!=="polyline")throw new I("imagery-layer:measure-length-from-image","this input geometry must be a polyline");return e=$(Vt,e).clone(),Jr(this.url,e,this._getRequestOptions(t))}async measureAreaFromImage(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsMeasureFromImage)throw new I("imagery-layer:measure-area-from-image","this operation is not supported on the input image service");if(e.geometry.type!=="polygon")throw new I("imagery-layer:measure-area-from-image","this input geometry must be a polygon");return e=$(Vt,e).clone(),Er(this.url,e,this._getRequestOptions(t))}getField(e){const{fieldsIndex:t}=this;return t!=null?t.get(e):void 0}getFieldDomain(e,t){const n=this.getField(e);return n?n.domain:null}async fetchImage(e,t,n,l={}){if(e==null||t==null||n==null)throw new I("imagery-layer:fetch-image","Insufficient parameters for requesting an image. A valid extent, width and height values are required.");if(this.renderer||this.symbolizer){const d=await this._generateRasterInfo(this.rasterFunction,{signal:l.signal});d&&(this.rasterInfo=d)}const u=this.getExportImageServiceParameters(e,t,n,l.timeExtent);if(u==null){if(l.requestAsImageElement&&this._canRequestImageElement(this.format)){const g=document.createElement("canvas");return g.width=t,g.height=n,l.returnImageBitmap?{imageBitmap:await Ct(g,`${a(this.parsedUrl)}/exportImage`,l.signal)}:{imageOrCanvasElement:g}}const{bandIds:d,rasterInfo:h}=this,R=((d==null?void 0:d.length)||h.bandCount)??0,f=t*n,w=h.pixelType,y=[];for(let g=0;g=10.3?e==null?void 0:e.rasterFunction:null})}).then(t=>t.data)}fetchRasterAttributeTable(e){return this.version<10.1?Promise.reject(new I("#fetchRasterAttributeTable()","Failed to get rasterAttributeTable")):D(a(this.parsedUrl)+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.3?e==null?void 0:e.rasterFunction:null})}).then(t=>qt.fromJSON(t.data))}getCatalogItemRasterInfo(e,t){const n={...t,query:this._getQueryParams()};return Qr(a(this.parsedUrl),e,n)}async getCatalogItemICSInfo(e,t){var xe,Ie,le,Nt,_t;const{data:n}=await D(a(this.parsedUrl)+"/"+e+"/info/ics",{query:this._getQueryParams(),...t}),l=n==null?void 0:n.ics;if(!l)return;let u=null;try{u=(await D(a(this.parsedUrl)+"/"+e+"/info",{query:this._getQueryParams(),...t})).data.extent}catch{}if(!u||!u.spatialReference)return{ics:l,icsToPixelTransform:null,icsExtent:null,northDirection:null};const p=this.version>=10.7?D(a(this.parsedUrl)+"/"+e+"/info/icstopixel",{query:this._getQueryParams(),...t}).then(x=>x.data).catch(()=>({})):{},m=u.spatialReference,c={geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[u]}),inSR:wt(m),outSR:"0:"+e},d=D(a(this.parsedUrl)+"/project",{query:this._getQueryParams(c),...t}).then(x=>x.data).catch(()=>({})),h=5,R=(u.xmin+u.xmax)/2,f=(u.ymax-u.ymin)/(h+1),w=u.ymin+f,y=[];for(let x=0;xx.data).catch(()=>({})),_=await Promise.all([p,d,v]);let G=_[0].ipxf;if(G==null){const x=(xe=l.geodataXform)==null?void 0:xe.xf_0;((Ie=x==null?void 0:x.name)==null?void 0:Ie.toLowerCase())==="topup"&&((le=x==null?void 0:x.coefficients)==null?void 0:le.length)===6&&(G={affine:{name:"ics [sensor: Frame] to pixel (column, row) transformation",coefficients:x.coefficients,cellsizeRatio:0,type:"GeometricXform"}})}const J=ze.fromJSON((_t=(Nt=_[1])==null?void 0:Nt.geometries)==null?void 0:_t[0]);J&&(J.spatialReference=new se({wkid:0,imageCoordinateSystem:l}));const F=_[2].geometries?_[2].geometries.filter(x=>(x==null?void 0:x.x)!=null&&x.y!=null&&x.x!=="NaN"&&x.y!=="NaN"):[],H=F.length;if(H<3)return{ics:l,icsToPixelTransform:G,icsExtent:J,northDirection:null};let Z=0,C=0,j=0,L=0;for(let x=0;xF[0].x,ke=F[h-1].y>F[0].y;return E===1/0?ye=ke?90:270:E===0?ye=Qe?0:180:E>0?ye=Qe?180*Math.atan(E)/Math.PI:180*Math.atan(E)/Math.PI+180:E<0&&(ye=ke?180+180*Math.atan(E)/Math.PI:360+180*Math.atan(E)/Math.PI),{ics:l,icsToPixelTransform:G,icsExtent:J,northDirection:ye}}async generateRasterInfo(e,t){var p;if(e=$(S,e),this.serviceRasterInfo&&(!e||((p=e.functionName)==null?void 0:p.toLowerCase())==="none"||this._isVectorFieldResampleFunction(e)))return this.serviceRasterInfo;const n=ps(e);if(!n)throw new I("imagery-layer:generate-raster-info","the rendering rule is not supported");if(this._functionRasterInfos[n])return this._functionRasterInfos[n];const l={...t,query:this._getQueryParams()},u=xi(a(this.parsedUrl),e,l);this._functionRasterInfos[n]=u;try{return await u}catch(m){throw this._functionRasterInfos[n]=null,m}}getExportImageServiceParameters(e,t,n,l){var y;e=e.clone().shiftCentralMeridian();const u=Je(e.spatialReference,a(this.parsedUrl));this.pixelType!==this.serviceRasterInfo.pixelType&&(this.exportImageServiceParameters.pixelType=this.pixelType);const p=this.exportImageServiceParameters.toJSON(),{bandIds:m,noData:c}=p;let{renderingRule:d}=p;const h=(y=this.rasterFunction)==null?void 0:y.rasterFunctionDefinition,R=!this.renderer||this.renderer.type==="raster-stretch";if(m!=null&&m.length&&this._hasRasterFunction(this.rasterFunction)&&!h&&R){const g={rasterFunction:"ExtractBand",rasterFunctionArguments:{BandIds:m}};if(d.rasterFunction==="Stretch")g.rasterFunctionArguments.Raster=d.rasterFunctionArguments.Raster,d.rasterFunctionArguments.Raster=g;else if(d.rasterFunction==="Colormap"){const v=d.rasterFunctionArguments.Raster;(v==null?void 0:v.rasterFunction)==="Stretch"?(g.rasterFunctionArguments.Raster=v.rasterFunctionArguments.Raster,v.rasterFunctionArguments.Raster=g):(g.rasterFunctionArguments.Raster=v,d.rasterFunctionArguments.Raster=g)}else g.rasterFunctionArguments.Raster=d,d=g;p.bandIds=void 0}else p.bandIds=m==null?void 0:m.join(",");c instanceof Array&&c.length>0&&(p.noData=c.join(","));const f=this._processMultidimensionalIntersection(null,l,this.exportImageServiceParameters.mosaicRule);if(f.isOutSide)return null;p.mosaicRule=f.mosaicRule!=null?JSON.stringify(f.mosaicRule):null,l=f.timeExtent,p.renderingRule=this._getRenderingRuleString(S.fromJSON(d));const w={};if(l!=null){const{start:g,end:v}=l.toJSON();g&&v&&g===v?w.time=""+g:g==null&&v==null||(w.time=`${g??"null"},${v??"null"}`)}return{bbox:e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:u,imageSR:u,size:t+","+n,...p,...w}}async getSamples(e,t){const n=await this._fetchCapabilities(t==null?void 0:t.signal);if(!(n!=null&&n.operations.supportsGetSamples))throw new I("imagery-layer:get-samples","getSamples operation is not supported on the input image service");e=$(rs,e).clone();const{raster:l}=this;return l&&e.raster==null&&(e.raster=l),Cr(this.url,e,this._getRequestOptions(t))}async identify(e,t){var p;if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsIdentify)throw new I("imagery-layer:identify","identify operation is not supported on the input image service");e=$(At,e).clone(),this.version<10.91&&((p=e.geometry)==null?void 0:p.type)==="extent"&&(e.geometry=Ze.fromExtent(e.geometry));const n=this._processMultidimensionalIntersection(e.geometry,e.timeExtent,e.mosaicRule||this.mosaicRule);if(n.isOutSide)throw new I("imagery-layer:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");e.timeExtent=n.timeExtent,e.mosaicRule=n.mosaicRule;const{raster:l,rasterFunction:u}=this;return u&&e.rasterFunction==null&&(e.rasterFunction=u),l&&e.raster==null&&(e.raster=l),$t(this.url,e,this._getRequestOptions(t))}async imageToMap(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsImageToMap)throw new I("imagery-layer:image-to-map","imageToMap operation is not supported on the input image service");return e=$(ns,e),Lr(a(this.parsedUrl),e,this._getRequestOptions(t))}async imageToMapMultiray(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsImageToMapMultiray)throw new I("imagery-layer:image-to-map-multiray","imageToMapMultiray operation is not supported on the input image service");return e=$(ss,e),zr(a(this.parsedUrl),e,this._getRequestOptions(t))}async mapToImage(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsMapToImage)throw new I("imagery-layer:map-to-image","mapToImage operation is not supported on the input image service");return e=$(os,e),Ur(a(this.parsedUrl),e,this._getRequestOptions(t))}async findImages(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsFindImages)throw new I("imagery-layer:find-images","findImages operation is not supported on the input image service");return e=$(kr,e),Br(a(this.parsedUrl),e,this._getRequestOptions(t))}async getImageUrl(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsGetImageUrl)throw new I("imagery-layer:get-image-url","getImageUrl operation is not supported on the input image service");return e=$(as,e),Hr(a(this.parsedUrl),e,this._getRequestOptions(t))}createQuery(){const e=new mt;return e.outFields=["*"],e.returnGeometry=!0,e.where=this.definitionExpression||"1=1",e}async queryBoundary(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsQueryBoundary)throw new I("imagery-layer:query-boundary","queryBoundary operation is not supported on the input image service");return e=$(Kr,e??{outSpatialReference:this.spatialReference}).clone(),qr(a(this.parsedUrl),e,this._getRequestOptions(t))}async queryRasters(e,t){return{query:e,requestOptions:t}=await this._prepareForQuery(e,t),Hi(this.url,e,t)}async queryObjectIds(e,t){return{query:e,requestOptions:t}=await this._prepareForQuery(e,t),Bi(this.url,e,t)}async queryGPSInfo(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsQueryGPSInfo)throw new I("imagery-layer:query-gps-info","queryGPSInfo operation is not supported on the input image service");return e=$(Yr,e??{outSpatialReference:this.spatialReference}).clone(),Gr(a(this.parsedUrl),e,this._getRequestOptions(t))}async queryRasterCount(e,t){return{query:e,requestOptions:t}=await this._prepareForQuery(e,t),Qi(this.url,e,t)}async queryVisibleRasters(e,t){var J,F,H,Z;if(!e)throw new I("imagery-layer: query-visible-rasters","missing query parameter");await this.load();const{pixelSize:n,returnDomainValues:l,returnTopmostRaster:u,showNoDataRecords:p}=t||{pixelSize:null,returnDomainValues:!1,returnTopmostRaster:!1,showNoDataRecords:!1};let m=!1,c=null,d=null;const h="raster.servicepixelvalue",R=this._rasterFunctionNamesIndex;if(e.outFields!=null&&(m=e.outFields.some(C=>!C.toLowerCase().includes(h)),this.version>=10.4)){const C=e.outFields.filter(L=>L.toLowerCase().includes(h)&&L.length>h.length).map(L=>{const E=L.slice(h.length+1);return[this._updateRenderingRulesFunctionName(E,R),E]});c=C.map(L=>new S({functionName:L[0]})),d=C.map(L=>L[1]);const{rasterFunction:j}=this;c.length===0?j!=null&&j.functionName?(c.push(j),d.push(j.functionName)):c=null:j!=null&&j.functionName&&!c.some(L=>L.functionName===j.functionName)&&(c.push(j),d.push(j.functionName))}const f=e.outSpatialReference==null||e.outSpatialReference.equals(this.spatialReference),{multidimensionalSubset:w}=this;let y=e.timeExtent||this.timeExtent;if(w){const{isOutside:C,intersection:j}=ht(w,{geometry:e.geometry,timeExtent:e.timeExtent,multidimensionalDefinition:(J=this.exportImageServiceParameters.mosaicRule)==null?void 0:J.multidimensionalDefinition});if(C)throw new I("imagery-layer:query-visible-rasters","the request cannot be fulfilled when falling outside of the multidimensional subset");(j==null?void 0:j.timeExtent)!=null&&(y=j.timeExtent)}const g=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,y);let v=e.geometry;this.version<10.91&&(v==null?void 0:v.type)==="extent"&&(v=Ze.fromExtent(v));const _=this._getQueryParams({geometry:v,timeExtent:y,mosaicRule:g,rasterFunction:this.version<10.4?this.rasterFunction:null,rasterFunctions:c,pixelSize:n,returnCatalogItems:m,returnGeometry:f,raster:this.raster,maxItemCount:u?1:null});delete _.f;const G=new At(_);try{await this._generateRasterInfo(this.rasterFunction);const C=await $t(this.url,G,{signal:t==null?void 0:t.signal,query:{...this.customParameters}}),j=e.outFields,L=C.value!=null&&C.value.toLowerCase().includes("nodata");if(!(m&&!f&&((F=C==null?void 0:C.catalogItems)!=null&&F.features.length)&&(p||!L)))return this._processVisibleRastersResponse(C,{returnDomainValues:l,templateRRFunctionNames:d,showNoDataRecords:p,templateFields:j});const E=this.objectIdField||"ObjectId",ye=((H=C.catalogItems)==null?void 0:H.features)??[],Qe=ye.map(Ie=>{var le;return(le=Ie.attributes)==null?void 0:le[E]}),ke=new mt({objectIds:Qe,returnGeometry:!0,outSpatialReference:e.outSpatialReference,outFields:[E]}),xe=await this.queryRasters(ke);return(Z=xe==null?void 0:xe.features)!=null&&Z.length&&xe.features.forEach(Ie=>{ye.forEach(le=>{le.attributes[E]===Ie.attributes[E]&&(le.geometry=new Ze(Ie.geometry),e.outSpatialReference!=null&&(le.geometry.spatialReference=e.outSpatialReference))})}),this._processVisibleRastersResponse(C,{returnDomainValues:l,templateRRFunctionNames:d,showNoDataRecords:p,templateFields:j})}catch{throw new I("imagery-layer:query-visible-rasters","encountered error when querying visible rasters")}}async fetchVariableStatisticsHistograms(e,t){const n=D(a(this.parsedUrl)+"/statistics",{query:this._getQueryParams({variable:e}),signal:t}).then(p=>{var m;return(m=p.data)==null?void 0:m.statistics}),l=D(a(this.parsedUrl)+"/histograms",{query:this._getQueryParams({variable:e}),signal:t}).then(p=>{var m;return(m=p.data)==null?void 0:m.histograms}),u=await Promise.all([n,l]);return u[0]&&u[0].forEach(p=>{p.avg=p.mean,p.stddev=p.standardDeviation}),{statistics:u[0]||null,histograms:u[1]||null}}async createFlowMesh(e,t){const n=this._rasterJobHandler.instance;return n?n.createFlowMesh(e,t):Ai(e.meshType,e.simulationSettings,e.flowData,t.signal!=null?t.signal:new AbortController().signal)}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo.multidimensionalInfo;return _i(this.multidimensionalSubset,t)}async _fetchService(e){await this._fetchServiceInfo(e),this.rasterInfo||(this.rasterInfo=this.serviceRasterInfo);const t=this.sourceJSON,n=this.serviceRasterInfo!=null?Promise.resolve(this.serviceRasterInfo):Ii(a(this.parsedUrl),t,{signal:e,query:this._getQueryParams()}).then(p=>(this._set("serviceRasterInfo",p),this._set("multidimensionalInfo",p.multidimensionalInfo),Fi(p,t),p)),l=this._hasRasterFunction(this.rasterFunction)?this._generateRasterInfo(this.rasterFunction,{signal:e}):null,u=this._getRasterFunctionInfos();return Promise.all([n,l,u]).then(p=>{p[1]?this._set("rasterInfo",p[1]):this._set("rasterInfo",p[0]),p[2]&&this._set("rasterFunctionInfos",p[2]),this.renderer&&!this._isSupportedRenderer(this.renderer)&&(this._set("renderer",null),we.getLogger(this).warn("ArcGISImageService","Switching to the default renderer. Renderer applied is not valid for this Imagery Layer")),this._set("renderer",this._configRenderer(this.renderer)),this.addHandles([ti(()=>this.rasterFunction,c=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this._generateRasterInfo(c).then(d=>{d&&(this.rasterInfo=d)})})]);const{serviceRasterInfo:m}=this;m.multidimensionalInfo!=null&&this._updateMultidimensionalDefinition(m)})}_combineMosaicRuleWithTimeExtent(e,t){var w;const n=this.timeInfo,{multidimensionalInfo:l}=this.serviceRasterInfo;if(e==null||l==null||t==null||(n==null?void 0:n.startField)==null)return e;const{startField:u}=n,p=l.variables.some(y=>y.dimensions.some(g=>g.name===u))?u:"StdTime";if(e=e.clone(),this.sourceType==="mosaic-dataset")return e.multidimensionalDefinition=(w=e.multidimensionalDefinition)==null?void 0:w.filter(y=>y.dimensionName!==p),this._cleanupMultidimensionalDefinition(e);e.multidimensionalDefinition=e.multidimensionalDefinition||[];const m=e.multidimensionalDefinition.filter(y=>y.dimensionName===p),c=t.start!=null?t.start.getTime():null,d=t.end!=null?t.end.getTime():null,h=c==null||d==null||c===d,R=h?[c||d]:[[c,d]],f=this.version>=10.8;if(m.length)m.forEach(y=>{y.dimensionName===p&&(f?(y.dimensionName=null,y.isSlice=!1,y.values=[]):(y.isSlice=h,y.values=R))});else if(!f){const y=e.multidimensionalDefinition.filter(g=>g.variableName!=null&&g.dimensionName==null);y.length?y.forEach(g=>{g.dimensionName=p,g.isSlice=h,g.values=R}):e.multidimensionalDefinition.push(new Oi({variableName:"",dimensionName:p,isSlice:h,values:R}))}return this._cleanupMultidimensionalDefinition(e)}_cleanupMultidimensionalDefinition(e){return e==null?null:(e.multidimensionalDefinition&&(e.multidimensionalDefinition=e.multidimensionalDefinition.filter(t=>!(!t.variableName&&!t.dimensionName)),e.multidimensionalDefinition.length===0&&(e.multidimensionalDefinition=null)),this.sourceType!=="mosaic-dataset"&&e.multidimensionalDefinition==null?null:e)}async _prepareForQuery(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsQuery)throw new I("imagery-layer:query-rasters","query operation is not supported on the input image service");return e=e!=null?$(mt,e):this.createQuery(),t=this._getRequestOptions(t),this.raster&&(t.query={...t.query,raster:this.raster}),{query:e,requestOptions:t}}async _initJobHandler(){if(this._rasterJobHandler.connectionPromise!=null)return this._rasterJobHandler.connectionPromise;const e=new Ni;this._rasterJobHandler.connectionPromise=e.initialize().then(()=>{this._rasterJobHandler.instance=e},()=>{}),await this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null}_isSupportedRenderer(e){const{rasterInfo:t,rasterFunction:n}=this;return e.type==="unique-value"&&this._hasRasterFunction(n)&&(t==null?void 0:t.bandCount)===1&&["u8","s8"].includes(t.pixelType)||t!=null&&e!=null&&Di(t).includes(e.type)}async _fetchCapabilities(e){return this.capabilities||await this._fetchServiceInfo(e),this.capabilities}async _fetchServiceInfo(e){var n;let t=this.sourceJSON;if(!t){const{data:l,ssl:u}=await D(a(this.parsedUrl),{query:this._getQueryParams(),signal:e});t=l,this.sourceJSON=t,u&&(this.url=this.url.replace(/^http:/i,"https:"))}if(((n=t.capabilities)==null?void 0:n.toLowerCase().split(",").map(l=>l.trim()).indexOf("tilesonly"))>-1)throw new I("imagery-layer:fetch-service-info","use ImageryTileLayer to open tiles-only image services");this.read(t,{origin:"service",url:this.parsedUrl})}_isMosaicDataset(e){var t;return e.serviceSourceType?e.serviceSourceType==="esriImageServiceSourceTypeMosaicDataset":((t=e.fields)==null?void 0:t.length)>0}_isMosaicRuleSupported(e){var l;if(!e)return!1;const t=this._isMosaicDataset(e),n=e.currentVersion>=10.71&&e.hasMultidimensions&&!(((l=e.fields)==null?void 0:l.length)>1);return t||n}_isVectorFieldResampleFunction(e){if(e==null)return!1;const{functionName:t,functionArguments:n}=e,l=(t==null?void 0:t.toLowerCase())==="resample",u=(n==null?void 0:n.ResampleType)||(n==null?void 0:n.resampleType);return l&&(u===7||u===10)}_isPicture(){return!this.format||this.format.includes("jpg")||this.format.includes("png")}_configRenderer(e){var l,u;const t=this._isPicture(),{rasterInfo:n}=this;if(!t&&!this.pixelFilter||this._isVectorDataSet()){if(!this.bandIds&&n.bandCount>=3){const m=Ti(n);!m||n.bandCount===3&&m[0]===0&&m[1]===1&&m[2]===2||(this.bandIds=m)}e||(e=Pi(n,{bandIds:this.bandIds,variableName:this.rasterFunction?null:(u=(l=this.mosaicRule)==null?void 0:l.multidimensionalDefinition)==null?void 0:u[0].variableName}));const p=ji(e.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=p,this.symbolizer.rasterInfo=n):this.symbolizer=new Gi({rendererJSON:p,rasterInfo:n}),this.symbolizer.bind().success||(this.symbolizer=null)}return e}_clonePixelData(e){return e==null?e:{extent:e.extent&&e.extent.clone(),pixelBlock:e.pixelBlock!=null?e.pixelBlock.clone():null}}_getQueryParams(e){(e==null?void 0:e.renderingRule)!=null&&typeof e.renderingRule!="string"&&(e.renderingRule=this._getRenderingRuleString(e.renderingRule));const{raster:t,viewId:n}=this;return{raster:t,viewId:n,f:"json",...e,...this.customParameters}}_getRequestOptions(e){return{...e,query:{...e==null?void 0:e.query,...this.customParameters}}}_decodePixelBlock(e,t,n){return this._rasterJobHandler.instance?this._rasterJobHandler.instance.decode({data:e,options:t}):Ot(e,t,n)}async _getRasterFunctionInfos(e){var n;const t=this.sourceJSON.rasterFunctionInfos;return this.loaded?t:t&&this.version>=10.3?t.length===1&&t[0].name.toLowerCase()==="none"?t:(n=(await D(a(this.parsedUrl)+"/rasterFunctionInfos",{query:this._getQueryParams(),signal:e})).data)==null?void 0:n.rasterFunctionInfos:null}_canRequestImageElement(e){return!this.pixelFilter&&(!e||e.includes("png"))}async _requestArrayBuffer(e){const{imageProps:t,requestAsImageElement:n,returnImageBitmap:l,signal:u}=e;if(n&&this._canRequestImageElement(t.format)){const w=`${a(this.parsedUrl)}/exportImage`,{data:y}=await D(w,{responseType:l?"blob":"image",query:this._getQueryParams({f:"image",...this.refreshParameters,...e.imageServiceParameters}),signal:u});return y instanceof Blob?{imageBitmap:await Ct(y,w,u),params:t}:{imageOrCanvasElement:y,params:t}}const p=this._initJobHandler(),m=D(a(this.parsedUrl)+"/exportImage",{responseType:"array-buffer",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:u}),c=(await Promise.all([m,p]))[0].data,d=t.format||"jpgpng";let h=d;if(h!=="bsq"&&h!=="bip"&&(h=Li(c)),!h)throw new I("imagery-layer:fetch-image","unsupported format signature "+String.fromCharCode.apply(null,new Uint8Array(c)));const R={signal:u};return{pixelData:{pixelBlock:await(d==="gif"||d==="bmp"||d.includes("png")&&(h==="png"||h==="jpg")?Ot(c,{useCanvas:!0,...t},R):this._decodePixelBlock(c,{width:t.width,height:t.height,planes:null,pixelType:null,noDataValue:null,format:d},R)),extent:t.extent},params:t}}_generateRasterInfo(e,t){return this.generateRasterInfo(e,t).catch(()=>null)}_isValidCustomizedMosaicRule(e){var t;return e&&JSON.stringify(e.toJSON())!==JSON.stringify((t=this.defaultMosaicRule)==null?void 0:t.toJSON())}_updateMultidimensionalDefinition(e){var n;if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;let t=Ci(e,{multidimensionalSubset:this.multidimensionalSubset});if(t!=null&&t.length>0){this.mosaicRule=this.mosaicRule||new k;const l=this.mosaicRule.multidimensionalDefinition;!this.sourceJSON.defaultVariableName&&this.rasterFunction&&((n=this.rasterFunction.functionName)==null?void 0:n.toLowerCase())!=="none"&&t.forEach(u=>u.variableName=""),t=t.filter(({variableName:u,dimensionName:p})=>u&&u!=="*"||p),!(l!=null&&l.length)&&t.length&&(this.mosaicRule.multidimensionalDefinition=t)}}_processVisibleRastersResponse(e,t){var _,G,J;t=t||{};const n=e.value,{templateRRFunctionNames:l,showNoDataRecords:u,returnDomainValues:p,templateFields:m}=t,c=e.processedValues;let d=(_=e.catalogItems)==null?void 0:_.features,h=((J=(G=e.properties)==null?void 0:G.Values)==null?void 0:J.map(F=>F.replaceAll(/ /gi,", ")))||[];const R=this.objectIdField||"ObjectId",f=typeof n=="string"&&n.toLowerCase().includes("nodata"),w=[];if(n&&!d&&!f){const F={};F[R]=0,h=[n],d=[new ii(this.fullExtent,null,F)]}if(!d)return[];let y,g,v;this._updateResponseFieldNames(d,m),f&&!u&&(d=[]);for(let F=0;F0&&l&&l.length>0&&l.includes(this.rasterFunction.functionName)?c[l.indexOf(this.rasterFunction.functionName)]:n,g.toLowerCase()==="nodata"&&!u)continue;const H="Raster.ItemPixelValue",Z="Raster.ServicePixelValue";y.attributes[H]=g,y.attributes[Z]=v,this._updateFeatureWithMagDirValues(y,g);const C=this.fields&&this.fields.length>0;let j=this.rasterFunction&&this.serviceRasterInfo.attributeTable!=null?C?g:n:v;this.rasterFunction||(j=C?g:n),this._updateFeatureWithRasterAttributeTableValues(y,j)}if(y.sourceLayer=y.layer=this,p&&this._updateFeatureWithDomainValues(y),l&&c&&l.length===c.length)for(let H=0;Hc.name).find(c=>c.toLowerCase()==="value");if(!p)return;const m=l.filter(c=>c.attributes[p]===(t!=null?parseInt(t,10):null));m&&m[0]&&u.forEach(c=>{const d=this._rasterAttributeTableFieldPrefix+c.name;e.attributes[d]=m[0].attributes[c.name]})}_updateFeatureWithMagDirValues(e,t){if(!this._isVectorDataSet())return;const n=t.split(/,\s*/).map(c=>parseFloat(c)),l=n.map(c=>[c]),u=n.map(c=>({minValue:c,maxValue:c,noDataValue:null})),p=new gt({height:1,width:1,pixelType:"f32",pixels:l,statistics:u});this.pixelFilter!=null&&this.pixelFilter({pixelBlock:p,extent:new ze(0,0,0,0,this.spatialReference)});const m=this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"?[p.pixels[0][0],p.pixels[1][0]]:Vi([p.pixels[0][0],p.pixels[1][0]]);e.attributes["Raster.Magnitude"]=m[0],e.attributes["Raster.Direction"]=m[1]}_updateFeatureWithDomainValues(e){const t=this.fields&&this.fields.filter(n=>n.domain&&n.domain.type==="coded-value");t!=null&&t.forEach(n=>{const l=e.attributes[n.name];if(l!=null){const u=n.domain.codedValues.find(p=>p.code===l);u&&(e.attributes[n.name]=u.name)}})}_updateResponseFieldNames(e,t){if(!t||t.length<1)return;const n=this.fieldsIndex;n!=null&&e.forEach(l=>{var u;if(l!=null&&l.attributes)for(const p of t){const m=(u=n.get(p))==null?void 0:u.name;m&&m!==p&&(l.attributes[p]=l.attributes[m],delete l.attributes[m])}})}_getRenderingRuleString(e){if(e){let t=e.toJSON();return t=t.rasterFunctionDefinition??t,(t.thumbnail||t.thumbnailEx)&&(t.thumbnail=t.thumbnailEx=null),JSON.stringify(t)}return null}_hasRasterFunction(e){return(e==null?void 0:e.functionName)!=null&&e.functionName.toLowerCase()!=="none"}_updateRenderingRulesFunctionName(e,t){if(!e||e.length<1)return;if(e==="Raw")return e.replace("Raw","None");const n=e.toLowerCase().replaceAll(/ /gi,"_");return t.has(n)?t.get(n):e}_isRFTJson(e){return(e==null?void 0:e.name)&&e.arguments&&e.function&&e.hasOwnProperty("functionType")}_isVectorDataSet(){return this.serviceDataType==="esriImageServiceDataTypeVector-UV"||this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"}_applyMosaicAndRenderingRules(e){const{raster:t,mosaicRule:n,rasterFunction:l}=this;l&&e instanceof yt&&e.rasterFunction==null&&(e.rasterFunction=l),n&&e.mosaicRule==null&&(e.mosaicRule=n),t&&e.raster==null&&(e.raster=t)}_readCapabilities(e){var g;const t=e.capabilities?e.capabilities.toLowerCase().split(",").map(v=>v.trim()):["image","catalog"],{currentVersion:n,advancedQueryCapabilities:l,maxRecordCount:u}=e,p=t.includes("image"),m=e.serviceDataType==="esriImageServiceDataTypeElevation",c=!(!e.spatialReference&&!((g=e.extent)!=null&&g.spatialReference)),d=t.includes("edit"),h=t.includes("mensuration")&&c,R=e.mensurationCapabilities==null?[]:e.mensurationCapabilities.toLowerCase().split(",").map(v=>v.trim()),f=h&&R.includes("basic"),w=this._isMosaicDataset(e)&&t.includes("catalog"),y=t.includes("download");return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:p,supportsExportImage:p,supportsIdentify:p,supportsImageToMap:n>=11.2&&w,supportsImageToMapMultiray:n>=11.2&&w,supportsMapToImage:n>=11.2&&w,supportsFindImages:n>=11.2&&w,supportsGetImageUrl:n>=11.2&&y,supportsMeasure:h,supportsMeasureFromImage:n>=11.2,supportsDownload:y,supportsQuery:w&&e.fields&&e.fields.length>0,supportsGetSamples:n>=10.2&&p,supportsProject:n>=10.3&&p,supportsComputeStatisticsHistograms:n>=10.4&&p,supportsQueryBoundary:n>=10.6&&p,supportsCalculateVolume:n>=10.7&&m,supportsComputePixelLocation:n>=10.7&&w,supportsComputeAngles:n>=10.91,supportsQueryGPSInfo:n>=11.2&&w,supportsAdd:d,supportsDelete:d,supportsEditing:d,supportsUpdate:d,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1,supportsQueryAnalytics:!1,supportsQueryTopFeatures:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:u,maxRecordCountFactor:void 0,supportsStatistics:!!(l!=null&&l.supportsStatistics),supportsOrderBy:!!(l!=null&&l.supportsOrderBy),supportsDistinct:!!(l!=null&&l.supportsDistinct),supportsPagination:!!(l!=null&&l.supportsPagination),supportsStandardizedQueriesOnly:!!(l!=null&&l.useStandardizedQueries),supportsPercentileStatistics:!!(l!=null&&l.supportsPercentileStatistics),supportsCentroid:!!(l!=null&&l.supportsReturningGeometryCentroid),supportsDistance:!!(l!=null&&l.supportsQueryWithDistance),supportsExtent:!!(l!=null&&l.supportsReturningQueryExtent),supportsGeometryProperties:!!(l!=null&&l.supportsReturningGeometryProperties),supportsHavingClause:!!(l!=null&&l.supportsHavingClause),supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:!1,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!!(l!=null&&l.supportsDefaultSR),supportsFullTextSearch:!1,supportsCompactGeometry:!1,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0},mensuration:{supportsDistanceAndAngle:f,supportsAreaAndPerimeter:f,supportsPointOrCentroid:f,supportsHeightFromBaseAndTop:h&&R.includes("base-top height"),supportsHeightFromBaseAndTopShadow:h&&R.includes("base-top shadow height"),supportsHeightFromTopAndTopShadow:h&&R.includes("top-top shadow height"),supports3D:h&&R.includes("3d")}}}};function a(e){return(e==null?void 0:e.path)??""}return r([o({clonable:!1})],i.prototype,"_functionRasterInfos",void 0),r([o({clonable:!1})],i.prototype,"_rasterJobHandler",void 0),r([o({clonable:!1})],i.prototype,"_cachedRendererJson",void 0),r([o({readOnly:!0})],i.prototype,"_serviceSupportsMosaicRule",void 0),r([V("_serviceSupportsMosaicRule",["currentVersion","fields"])],i.prototype,"readServiceSupportsMosaicRule",null),r([o({readOnly:!0})],i.prototype,"_rasterAttributeTableFieldPrefix",void 0),r([o({readOnly:!0})],i.prototype,"_rasterFunctionNamesIndex",null),r([o()],i.prototype,"adjustAspectRatio",void 0),r([o({type:[Be],json:{write:!0}})],i.prototype,"bandIds",void 0),r([V("bandIds")],i.prototype,"readBandIds",null),r([o({readOnly:!0,json:{read:!1}})],i.prototype,"capabilities",void 0),r([V("service","capabilities",["capabilities","currentVersion","serviceDataType"])],i.prototype,"readCapabilities",null),r([o({type:Number})],i.prototype,"compressionQuality",void 0),r([T("compressionQuality")],i.prototype,"writeCompressionQuality",null),r([o({type:Number})],i.prototype,"compressionTolerance",void 0),r([T("compressionTolerance")],i.prototype,"writeCompressionTolerance",null),r([o({json:{read:{source:"copyrightText"}}})],i.prototype,"copyright",void 0),r([o({readOnly:!0,dependsOn:["_serviceSupportsMosaicRule"]})],i.prototype,"defaultMosaicRule",void 0),r([V("defaultMosaicRule",["defaultMosaicMethod"])],i.prototype,"readDefaultMosaicRule",null),r([o({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),r([o({readOnly:!0,constructOnly:!0})],i.prototype,"exportImageServiceParameters",void 0),r([o()],i.prototype,"rasterInfo",void 0),r([o({readOnly:!0,type:[Fe]})],i.prototype,"fields",void 0),r([o({readOnly:!0})],i.prototype,"fieldsIndex",null),r([o({type:["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"],json:{write:!0}})],i.prototype,"format",null),r([V("service","format",["serviceDataType"])],i.prototype,"readFormat",null),r([o({type:ze})],i.prototype,"fullExtent",void 0),r([o({readOnly:!0})],i.prototype,"hasMultidimensions",void 0),r([o({json:{read:{source:"maxImageHeight"}}})],i.prototype,"imageMaxHeight",void 0),r([o({json:{read:{source:"maxImageWidth"}}})],i.prototype,"imageMaxWidth",void 0),r([o({type:String,json:{type:ve.jsonValues,read:ve.read,write:ve.write}})],i.prototype,"interpolation",void 0),r([o()],i.prototype,"minScale",void 0),r([V("service","minScale")],i.prototype,"readMinScale",null),r([o()],i.prototype,"maxScale",void 0),r([V("service","maxScale")],i.prototype,"readMaxScale",null),r([o({type:k})],i.prototype,"mosaicRule",null),r([V("mosaicRule",["mosaicRule","defaultMosaicMethod"])],i.prototype,"readMosaicRule",null),r([T("mosaicRule")],i.prototype,"writeMosaicRule",null),r([o()],i.prototype,"multidimensionalInfo",void 0),r([o({type:Ri,json:{write:!0}})],i.prototype,"multidimensionalSubset",void 0),r([o({json:{type:Be}})],i.prototype,"noData",void 0),r([T("noData")],i.prototype,"writeNoData",null),r([o({type:String,json:{type:Ue.jsonValues,read:Ue.read,write:Ue.write}})],i.prototype,"noDataInterpretation",void 0),r([o({type:String,readOnly:!0,json:{read:{source:["fields"]}}})],i.prototype,"objectIdField",void 0),r([V("objectIdField")],i.prototype,"readObjectIdField",null),r([o({readOnly:!0})],i.prototype,"geometryType",void 0),r([o({})],i.prototype,"typeIdField",void 0),r([o({})],i.prototype,"types",void 0),r([o({readOnly:!0})],i.prototype,"parsedUrl",null),r([o({type:Function})],i.prototype,"pixelFilter",void 0),r([o()],i.prototype,"raster",void 0),r([o({readOnly:!0})],i.prototype,"sourceType",void 0),r([V("sourceType",["serviceSourceType","fields"])],i.prototype,"readSourceType",null),r([o()],i.prototype,"viewId",void 0),r([o({types:vi,json:{name:"layerDefinition.drawingInfo.renderer",origins:{"web-scene":{types:bi,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&e.type!=="vector-field"&&e.type!=="flow"})}}}}})],i.prototype,"renderer",null),r([V("renderer")],i.prototype,"readRenderer",null),r([T("renderer")],i.prototype,"writeRenderer",null),r([o({clonable:!1})],i.prototype,"symbolizer",void 0),r([o(Xt)],i.prototype,"opacity",void 0),r([o({readOnly:!0})],i.prototype,"rasterFields",null),r([o({constructOnly:!0})],i.prototype,"rasterFunctionInfos",void 0),r([o({type:S})],i.prototype,"renderingRule",null),r([o({type:S,json:{name:"renderingRule"}})],i.prototype,"rasterFunction",null),r([V("rasterFunction",["renderingRule","rasterFunctionInfos"])],i.prototype,"readRasterFunction",null),r([o({readOnly:!0})],i.prototype,"serviceDataType",void 0),r([o({readOnly:!0,type:se})],i.prototype,"spatialReference",void 0),r([V("spatialReference",["spatialReference","extent"])],i.prototype,"readSpatialReference",null),r([o({json:{type:dt.jsonValues}})],i.prototype,"pixelType",void 0),r([V("pixelType")],i.prototype,"readPixelType",null),r([T("pixelType")],i.prototype,"writePixelType",null),r([o({constructOnly:!0,type:Et})],i.prototype,"serviceRasterInfo",void 0),r([o()],i.prototype,"sourceJSON",void 0),r([o(Yt)],i.prototype,"url",void 0),r([o({readOnly:!0})],i.prototype,"version",void 0),r([V("version",["currentVersion","fields","timeInfo"])],i.prototype,"readVersion",null),i=r([b("esri.layers.mixins.ArcGISImageService")],i),i};let B=class extends ni(Wi(ai(oi(li(cs(ki(ui(pi(ci(Se(fi))))))))))){constructor(...s){super(...s),this.isReference=null,this.operationalLayerType="ArcGISImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.type="imagery",this._debouncedSaveOperations=mi(async(i,a,e)=>{const{save:t,saveAs:n}=await wi(()=>import("./imageryUtils-CP_eOmeO.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]));switch(i){case We.SAVE:return t(this,a);case We.SAVE_AS:return n(this,e,a)}})}normalizeCtorArgs(s,i){return typeof s=="string"?{url:s,...i}:s}load(s){const i=s!=null?s.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},s).catch(di).then(()=>this._fetchService(i))),Promise.resolve(this)}get legendEnabled(){return!this._isPreviewLayer&&(this._get("legendEnabled")??!0)}set legendEnabled(s){this._set("legendEnabled",s)}get listMode(){return this._isPreviewLayer?"hide":this._get("listMode")}set listMode(s){this._set("listMode",s)}writeOperationalLayerType(s,i,a){var t;const e=((t=this.renderer)==null?void 0:t.type)==="vector-field";i[a]=e?"ArcGISImageServiceVectorLayer":"ArcGISImageServiceLayer"}get defaultPopupTemplate(){return this.createPopupTemplate()}get _isPreviewLayer(){var s;return!(!this.raster||!((s=this.url)!=null&&s.toLowerCase().includes("/rasterrendering/imageserver")))}createPopupTemplate(s){var p;const i=this.rasterFields,a=this.title,e=new Set;let t=!1,n=!1;this.capabilities&&(t=this.capabilities.operations.supportsQuery&&this.fields&&this.fields.length>0,n=this.serviceDataType==="esriImageServiceDataTypeVector-UV"||this.serviceDataType==="esriImageServiceDataTypeVector-MagDir");const l=new Set;t&&l.add("raster.itempixelvalue");for(const m of i){const c=m.name.toLowerCase();l.has(c)||c.includes("raster.servicepixelvalue.")||e.add(m.name)}n&&e.add("raster.magnitude").add("raster.direction");const u=Ki({fields:i,title:a},{...s,visibleFieldNames:e});return u!=null&&u.fieldInfos&&((p=this.rasterInfo)!=null&&p.pixelType.startsWith("f"))&&u.fieldInfos.forEach(({format:m,fieldName:c})=>{m&&/^raster\.(item|service)pixelvalue/i.test(c)&&(m.places=2)}),u}queryFeatures(s,i){return this.queryRasters(s,i).then(a=>{if(a!=null&&a.features)for(const e of a.features)e.layer=e.sourceLayer=this;return a})}queryFeatureCount(s,i){return this.queryRasterCount(s,i)}redraw(){this.emit("redraw")}async save(s){return this._debouncedSaveOperations(We.SAVE,s)}async saveAs(s,i){return this._debouncedSaveOperations(We.SAVE_AS,i,s)}serviceSupportsSpatialReference(s){return Zi(this,s)}write(s,i){if(!this._isPreviewLayer)return super.write(s,i);if(i!=null&&i.messages){const a=`${i.origin}/${i.layerContainerType||"operational-layers"}`;i.messages.push(new I("layer:unsupported",`Imagery preview layer (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${a}'`,{layer:this}))}return null}};r([o(yi)],B.prototype,"legendEnabled",null),r([o({type:["show","hide"]})],B.prototype,"listMode",null),r([o({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],B.prototype,"isReference",void 0),r([o({type:["ArcGISImageServiceLayer"],json:{origins:{"web-map":{type:["ArcGISImageServiceLayer","ArcGISImageServiceVectorLayer"],read:!1,write:{target:"layerType",ignoreOrigin:!0}}}}})],B.prototype,"operationalLayerType",void 0),r([T("web-map","operationalLayerType")],B.prototype,"writeOperationalLayerType",null),r([o(hi)],B.prototype,"popupEnabled",void 0),r([o({type:gi,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],B.prototype,"popupTemplate",void 0),r([o({readOnly:!0})],B.prototype,"defaultPopupTemplate",null),r([o({readOnly:!0,json:{read:!1}})],B.prototype,"type",void 0),r([o({readOnly:!0})],B.prototype,"_isPreviewLayer",null),B=r([b("esri.layers.ImageryLayer")],B);const In=B;export{In as default}; diff --git a/assets/ImageryLayerView2D-D5_CduBq.js b/assets/ImageryLayerView2D-Cd1bppq2.js similarity index 86% rename from assets/ImageryLayerView2D-D5_CduBq.js rename to assets/ImageryLayerView2D-Cd1bppq2.js index 1ddc7b3..28de5a1 100644 --- a/assets/ImageryLayerView2D-D5_CduBq.js +++ b/assets/ImageryLayerView2D-Cd1bppq2.js @@ -1,4 +1,4 @@ -import{d as a,y as o,f as v,a7 as R,b,s as _,j as P,k as z,aE as B,g as f,fJ as F,M as I,dP as U,bK as C,N as V,at as M,aX as L,aA as E,c as j,ez as $,V as S,e as q,E as N}from"./index-CEWggaxV.js";import{d as O,f as H,a as J}from"./RasterVFDisplayObject-boi924Q6.js";import{m as G,u as W}from"./LayerView-BEFTHNYv.js";import{$ as K}from"./GraphicsView2D-DbbthiwV.js";import{h as X}from"./HighlightGraphicContainer-Cnwl0eCq.js";import{M as Q,m as Y,f as Z}from"./dataUtils-BFJflGP5.js";import{a as ee}from"./BitmapContainer-Bq0Mk6_k.js";import{h as te,E as D}from"./Container-CB7SlLB9.js";import{l as ie}from"./Bitmap--gOrgR8J.js";import{v as re}from"./ExportStrategy-fFnMYcIc.js";import{J as se}from"./rasterProjectionHelper-Bwvi37wQ.js";import{n as ae}from"./WGLContainer-B_Pv-8Yi.js";import{p as oe}from"./popupUtils-BovqErR_.js";import{i as ne}from"./RefreshableLayerView-C1-PEoNB.js";import"./Program-DLRmaKpw.js";import"./Texture-DJgkMrSB.js";import"./ProgramTemplate-BICQrNzS.js";import"./LabelMetric-D2hbzzy_.js";import"./scaleUtils-Bqauo1zZ.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./UpdateTracking2D-nj9Q-3df.js";import"./TurboLine-CkxIB4ZX.js";import"./earcut-hRlx3adE.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./utils-p-5Bbga5.js";import"./Rect-CUzevAry.js";import"./labelUtils-Dnqx6jl5.js";import"./defaultsJSON-CHAaurhX.js";import"./BindType-BmZEZMMh.js";import"./Util-BS8sJGjF.js";import"./highlightReasons-DbgbcWKM.js";import"./constants-D5zmR9t2.js";import"./OverrideHelper-B4ryGWZb.js";import"./quantizationUtils-CUjGHrU3.js";import"./AttributeStore-Ck-75lnq.js";import"./TimeOnly-Cm47ew5I.js";import"./timeSupport-BjRbXIpn.js";import"./featureConversionUtils-CmP9mw0r.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./json-Wa8cmqdu.js";import"./diffUtils-B4YFa5Ju.js";import"./FeatureCommandQueue-Btq_FXyi.js";import"./normalizeUtilsSync-B6VufdiX.js";import"./AGraphicContainer-Dby-baET.js";import"./TechniqueInstance-CSsTmbek.js";import"./TileContainer-Ci6dOowA.js";import"./vec3f32-nZdmKIgz.js";import"./config-MDUrh2eL.js";let h=class extends R{constructor(){super(...arguments),this.attached=!1,this.container=new te,this.updateRequested=!1,this.type="imagery",this._bitmapView=new ee}destroy(){this.attached&&(this.detach(),this.attached=!1),this.updateRequested=!1}get updating(){return!this.attached||this.isUpdating()}update(e){this.strategy.update(e).catch(t=>{b(t)||_.getLogger(this).error(t)})}hitTest(e){return new P({attributes:{},geometry:e.clone(),layer:this.layer})}attach(){this.container.addChild(this._bitmapView);const e=this.layer.version>=10,t=this.layer.version>=10.1?this.layer.imageMaxHeight:2048,i=this.layer.version>=10.1?this.layer.imageMaxWidth:2048;this.strategy=new re({container:this._bitmapView,imageNormalizationSupported:e,imageMaxHeight:t,imageMaxWidth:i,fetchSource:this._fetchImage.bind(this),requestUpdate:()=>this.requestUpdate()})}detach(){this.strategy.destroy(),this._bitmapView.removeAllChildren(),this.container.removeAllChildren(),this.updateRequested=!1}redraw(){this.strategy.updateExports(async e=>{const{source:t}=e;if(!t||t instanceof ImageBitmap)return;const i=await this.layer.applyRenderer({extent:t.extent,pixelBlock:t.originalPixelBlock??t.pixelBlock});t.filter=r=>this.layer.pixelFilter?this.layer.applyFilter(r):{...i,extent:t.extent}}).catch(e=>{b(e)||_.getLogger(this).error(e)})}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate())}isUpdating(){return this.strategy.updating||this.updateRequested}getPixelData(){if(this.updating)return null;const e=this.strategy.bitmaps;if(e.length===1&&e[0].source)return{extent:e[0].source.extent,pixelBlock:e[0].source.originalPixelBlock};if(e.length>1){const t=this.view.extent,i=e.map(s=>s.source).filter(s=>s.extent&&s.extent.intersects(t)).map(s=>({extent:s.extent,pixelBlock:s.originalPixelBlock})),r=Q(i,t);return r!=null?{extent:r.extent,pixelBlock:r.pixelBlock}:null}return null}async _fetchImage(e,t,i,r){var c;(r=r||{}).timeExtent=this.timeExtent,r.requestAsImageElement=!0,r.returnImageBitmap=!0;const s=await this.layer.fetchImage(e,t,i,r);if(s.imageBitmap)return s.imageBitmap;const n=await this.layer.applyRenderer(s.pixelData,{signal:r.signal}),l=new ie(n.pixelBlock,(c=n.extent)==null?void 0:c.clone(),s.pixelData.pixelBlock);return l.filter=p=>this.layer.applyFilter(p),l}};a([o()],h.prototype,"attached",void 0),a([o()],h.prototype,"container",void 0),a([o()],h.prototype,"layer",void 0),a([o()],h.prototype,"strategy",void 0),a([o()],h.prototype,"timeExtent",void 0),a([o()],h.prototype,"view",void 0),a([o()],h.prototype,"updateRequested",void 0),a([o()],h.prototype,"updating",null),a([o()],h.prototype,"type",void 0),h=a([v("esri.views.2d.layers.imagery.ImageryView2D")],h);const le=h;class he extends ae{constructor(){super(...arguments),this.symbolTypes=["triangle"]}prepareRenderPasses(t){const i=t.registerRenderPass({name:"imagery (vf)",brushes:[O],target:()=>this.children,drawPhase:D.MAP});return[...super.prepareRenderPasses(t),i]}doRender(t){this.visible&&t.drawPhase===D.MAP&&this.symbolTypes.forEach(i=>{t.renderPass=i,super.doRender(t)})}}let y=class extends R{constructor(e){super(e),this._loading=null,this.update=z((t,i)=>this._update(t,i).catch(r=>{b(r)||_.getLogger(this).error(r)}))}get updating(){return!!this._loading}redraw(e){if(!this.container.children.length)return;const t=this.container.children[0];t.symbolizerParameters=e,t.invalidateVAO(),this.container.symbolTypes=e.style==="wind_speed"?["scalar","triangle"]:e.style==="simple_scalar"?["scalar"]:["triangle"],this.container.requestRender()}async _update(e,t,i){if(!e.stationary)return;const{extent:r,spatialReference:s}=e.state,n=new B({xmin:r.xmin,ymin:r.ymin,xmax:r.xmax,ymax:r.ymax,spatialReference:s}),[l,c]=e.state.size;this._loading=this.fetchPixels(n,l,c,i);const p=await this._loading;this._addToDisplay(p,t,e.state),this._loading=null}_addToDisplay(e,t,i){if(e.pixelBlock==null)return this.container.children.forEach(l=>l.destroy()),void this.container.removeAllChildren();const{extent:r,pixelBlock:s}=e,n=new H(s);n.offset=[0,0],n.symbolizerParameters=t,n.rawPixelData=e,n.invalidateVAO(),n.x=r.xmin,n.y=r.ymax,n.pixelRatio=i.pixelRatio,n.rotation=i.rotation,n.resolution=i.resolution,n.width=s.width*t.symbolTileSize,n.height=s.height*t.symbolTileSize,this.container.children.forEach(l=>l.destroy()),this.container.removeAllChildren(),this.container.symbolTypes=t.style==="wind_speed"?["scalar","triangle"]:t.style==="simple_scalar"?["scalar"]:["triangle"],this.container.addChild(n)}};a([o()],y.prototype,"fetchPixels",void 0),a([o()],y.prototype,"container",void 0),a([o()],y.prototype,"_loading",void 0),a([o()],y.prototype,"updating",null),y=a([v("esri.views.2d.layers.imagery.ImageryVFStrategy")],y);const pe=y;let d=class extends R{constructor(){super(...arguments),this.attached=!1,this.container=new he,this.type="imageryVF",this._dataParameters={exportParametersVersion:0,bbox:"",symbolTileSize:0,time:""},this._fetchpixels=async(e,t,i,r)=>{const s=await this._projectFullExtentPromise,{symbolTileSize:n}=this.layer.renderer,{extent:l,width:c,height:p}=Y(e,t,i,n,s);if(s!=null&&!s.intersects(e))return{extent:l,pixelBlock:null};const m={bbox:`${l.xmin}, ${l.ymin}, ${l.xmax}, ${l.ymax}`,exportParametersVersion:this.layer.exportImageServiceParameters.version,symbolTileSize:n,time:JSON.stringify(this.timeExtent||"")};if(this._canReuseVectorFieldData(m)){const u=this.getPixelData();if(u!=null&&`${u.extent.xmin}, ${u.extent.ymin}, ${u.extent.xmax}, ${u.extent.ymax}`===m.bbox)return u}const{pixelData:g}=await this.layer.fetchImage(l,c,p,{timeExtent:this.timeExtent,requestAsImageElement:!1,signal:r});this._dataParameters=m;const x=g==null?void 0:g.pixelBlock;return x==null?{extent:l,pixelBlock:null}:{extent:l,pixelBlock:this.layer.rasterInfo.dataType==="vector-uv"?Z(x,"vector-uv"):x}}}get updating(){return!this.attached||this._strategy.updating}attach(){this._projectFullExtentPromise=this._getProjectedFullExtent(this.view.spatialReference),this._strategy=new pe({container:this.container,fetchPixels:this._fetchpixels}),this.addHandles(f(()=>this.layer.renderer,e=>this._updateSymbolizerParams(e),F),"attach")}detach(){this._strategy.destroy(),this.container.children.forEach(e=>e.destroy()),this.container.removeAllChildren(),this.removeHandles("attach"),this._strategy=this.container=this._projectFullExtentPromise=null}getPixelData(){var r;const e=(r=this.container.children[0])==null?void 0:r.rawPixelData;if(this.updating||!e)return null;const{extent:t,pixelBlock:i}=e;return{extent:t,pixelBlock:i}}hitTest(e){return new P({attributes:{},geometry:e.clone(),layer:this.layer})}update(e){this._strategy.update(e,this._symbolizerParams).catch(t=>{b(t)||_.getLogger(this).error(t)})}redraw(){const{renderer:e}=this.layer;e&&(this._updateSymbolizerParams(e),this._strategy.redraw(this._symbolizerParams))}_canReuseVectorFieldData(e){const t=this._dataParameters.exportParametersVersion===e.exportParametersVersion,i=this._dataParameters.time===e.time,r=this._dataParameters.symbolTileSize===e.symbolTileSize,s=this._dataParameters.bbox===e.bbox;return t&&i&&r&&s}async _getProjectedFullExtent(e){try{return se(this.layer.fullExtent,e)}catch{try{const i=(await I(this.layer.url,{query:{option:"footprints",outSR:U(e),f:"json"}})).data.featureCollection.layers[0].layerDefinition.extent;return i?B.fromJSON(i):null}catch{return null}}}_updateSymbolizerParams(e){e.type==="vector-field"&&(this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null}))}};a([o()],d.prototype,"attached",void 0),a([o()],d.prototype,"container",void 0),a([o()],d.prototype,"layer",void 0),a([o()],d.prototype,"timeExtent",void 0),a([o()],d.prototype,"type",void 0),a([o()],d.prototype,"view",void 0),a([o()],d.prototype,"updating",null),d=a([v("esri.views.2d.layers.imagery.VectorFieldView2D")],d);const de=d,ce=e=>{let t=class extends e{constructor(){super(...arguments),this.view=null}async fetchPopupFeaturesAtLocation(i,r){const{layer:s}=this;if(!i)throw new V("imagerylayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:s});const{popupEnabled:n}=s,l=oe(s,r);if(!n||l==null)throw new V("imagerylayerview:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:n,popupTemplate:l});const c=await l.getRequiredFields();M(r);const p=new L;p.timeExtent=this.timeExtent,p.geometry=i,p.outFields=c,p.outSpatialReference=i.spatialReference;const{resolution:m,spatialReference:g}=this.view,x=this.view.type==="2d"?new E(m,m,g):new E(.5*m,.5*m,g),{returnTopmostRaster:u,showNoDataRecords:k}=l.layerOptions||{returnTopmostRaster:!0,showNoDataRecords:!1},T={returnDomainValues:!0,returnTopmostRaster:u,pixelSize:x,showNoDataRecords:k,signal:r==null?void 0:r.signal};return s.queryVisibleRasters(p,T).then(A=>A)}canResume(){var i;return!!super.canResume()&&!((i=this.timeExtent)!=null&&i.isEmpty)}};return a([o()],t.prototype,"layer",void 0),a([o()],t.prototype,"suspended",void 0),a([o(C)],t.prototype,"timeExtent",void 0),a([o()],t.prototype,"view",void 0),t=a([v("esri.views.layers.ImageryLayerView")],t),t};let w=class extends ce(ne(G(W))){constructor(){super(...arguments),this._exportImageVersion=-1,this._highlightGraphics=new j,this._highlightView=void 0,this.layer=null,this.subview=null}get pixelData(){const{subview:e}=this;return this.updating||!e?null:"getPixelData"in e?e.getPixelData():null}update(e){var t;(t=this.subview)==null||t.update(e)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.view&&(this._highlightView=new K({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new X(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container)),this.addAttachHandles([f(()=>this.layer.exportImageServiceParameters.version,e=>{e&&this._exportImageVersion!==e&&(this._exportImageVersion=e,this.requestUpdate())},$),f(()=>this.timeExtent,e=>{const{subview:t}=this;t&&(t.timeExtent=e,"redraw"in t?this.requestUpdate():t.redrawOrRefetch())},$),this.layer.on("redraw",()=>{const{subview:e}=this;e&&("redraw"in e?e.redraw():e.redrawOrRefetch())}),f(()=>this.layer.renderer,()=>this._setSubView())])}detach(){var e,t;this.layer.decreaseRasterJobHandlerUsage(),this.container.removeAllChildren(),this._detachSubview(this.subview),(e=this.subview)==null||e.destroy(),this.subview=null,(t=this._highlightView)==null||t.destroy(),this._exportImageVersion=-1}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}highlight(e,t){if(!((Array.isArray(e)?e[0]:S.isCollection(e)?e.at(0):e)instanceof P))return q();let i=[];return Array.isArray(e)||S.isCollection(e)?i=e.map(r=>r.clone()):e instanceof P&&(i=[e.clone()]),this._highlightGraphics.addMany(i),q(()=>this._highlightGraphics.removeMany(i))}async doRefresh(){this.requestUpdate()}isUpdating(){var t,i;const e=!this.subview||this.subview.updating||!!((t=this._highlightView)!=null&&t.updating);return N("esri-2d-log-updating")&&console.log(`Updating ImageryLayerView2D (${this.layer.id}): ${e} +import{d as a,y as o,f as v,a7 as R,b,s as _,j as P,k as z,aE as B,g as f,fJ as F,M as I,dP as U,bK as C,N as V,at as M,aX as L,aA as E,c as j,ez as $,V as S,e as q,E as N}from"./index-BjUNJPVf.js";import{d as O,f as H,a as J}from"./RasterVFDisplayObject-DLrowEg_.js";import{m as G,u as W}from"./LayerView-Bux7vAEn.js";import{$ as K}from"./GraphicsView2D-B7H8XAnI.js";import{h as X}from"./HighlightGraphicContainer-B5WIObEd.js";import{M as Q,m as Y,f as Z}from"./dataUtils-DzOfgSpi.js";import{a as ee}from"./BitmapContainer-DD7rxH0u.js";import{h as te,E as D}from"./Container-_n5wCgez.js";import{l as ie}from"./Bitmap-DpyomsG7.js";import{v as re}from"./ExportStrategy-SzILz8ne.js";import{J as se}from"./rasterProjectionHelper-CHkyWbma.js";import{n as ae}from"./WGLContainer-DgZNq7b0.js";import{p as oe}from"./popupUtils-Do2GfZME.js";import{i as ne}from"./RefreshableLayerView-L9NGpXXI.js";import"./Program-DBsYtQ00.js";import"./Texture-S4dD-WHn.js";import"./ProgramTemplate-Ck2I0bIi.js";import"./LabelMetric-BcUxDImF.js";import"./scaleUtils-DWXMiS7R.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./UpdateTracking2D-Ds_Gdrxd.js";import"./TurboLine-DNQdPIXo.js";import"./earcut-CWKXDqDj.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./utils-CuXO_Zzq.js";import"./Rect-CUzevAry.js";import"./labelUtils-3p0-m-Ee.js";import"./defaultsJSON-CHAaurhX.js";import"./BindType-BmZEZMMh.js";import"./Util-CS5u4Lec.js";import"./highlightReasons-BOU4mnPE.js";import"./constants-D5zmR9t2.js";import"./OverrideHelper-DxFZBnGL.js";import"./quantizationUtils-CfV316jZ.js";import"./AttributeStore-Bm6hLtR1.js";import"./TimeOnly-BXSODLxA.js";import"./timeSupport-DXkhlToK.js";import"./featureConversionUtils-BHhm7bvm.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./json-Wa8cmqdu.js";import"./diffUtils-uUoMDFQS.js";import"./FeatureCommandQueue-DI81F3gA.js";import"./normalizeUtilsSync-73yZ0QwV.js";import"./AGraphicContainer-BXk7Eu6w.js";import"./TechniqueInstance-XtnK2qy2.js";import"./TileContainer-Bs-vXdD_.js";import"./vec3f32-nZdmKIgz.js";import"./config-MDUrh2eL.js";let h=class extends R{constructor(){super(...arguments),this.attached=!1,this.container=new te,this.updateRequested=!1,this.type="imagery",this._bitmapView=new ee}destroy(){this.attached&&(this.detach(),this.attached=!1),this.updateRequested=!1}get updating(){return!this.attached||this.isUpdating()}update(e){this.strategy.update(e).catch(t=>{b(t)||_.getLogger(this).error(t)})}hitTest(e){return new P({attributes:{},geometry:e.clone(),layer:this.layer})}attach(){this.container.addChild(this._bitmapView);const e=this.layer.version>=10,t=this.layer.version>=10.1?this.layer.imageMaxHeight:2048,i=this.layer.version>=10.1?this.layer.imageMaxWidth:2048;this.strategy=new re({container:this._bitmapView,imageNormalizationSupported:e,imageMaxHeight:t,imageMaxWidth:i,fetchSource:this._fetchImage.bind(this),requestUpdate:()=>this.requestUpdate()})}detach(){this.strategy.destroy(),this._bitmapView.removeAllChildren(),this.container.removeAllChildren(),this.updateRequested=!1}redraw(){this.strategy.updateExports(async e=>{const{source:t}=e;if(!t||t instanceof ImageBitmap)return;const i=await this.layer.applyRenderer({extent:t.extent,pixelBlock:t.originalPixelBlock??t.pixelBlock});t.filter=r=>this.layer.pixelFilter?this.layer.applyFilter(r):{...i,extent:t.extent}}).catch(e=>{b(e)||_.getLogger(this).error(e)})}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate())}isUpdating(){return this.strategy.updating||this.updateRequested}getPixelData(){if(this.updating)return null;const e=this.strategy.bitmaps;if(e.length===1&&e[0].source)return{extent:e[0].source.extent,pixelBlock:e[0].source.originalPixelBlock};if(e.length>1){const t=this.view.extent,i=e.map(s=>s.source).filter(s=>s.extent&&s.extent.intersects(t)).map(s=>({extent:s.extent,pixelBlock:s.originalPixelBlock})),r=Q(i,t);return r!=null?{extent:r.extent,pixelBlock:r.pixelBlock}:null}return null}async _fetchImage(e,t,i,r){var c;(r=r||{}).timeExtent=this.timeExtent,r.requestAsImageElement=!0,r.returnImageBitmap=!0;const s=await this.layer.fetchImage(e,t,i,r);if(s.imageBitmap)return s.imageBitmap;const n=await this.layer.applyRenderer(s.pixelData,{signal:r.signal}),l=new ie(n.pixelBlock,(c=n.extent)==null?void 0:c.clone(),s.pixelData.pixelBlock);return l.filter=p=>this.layer.applyFilter(p),l}};a([o()],h.prototype,"attached",void 0),a([o()],h.prototype,"container",void 0),a([o()],h.prototype,"layer",void 0),a([o()],h.prototype,"strategy",void 0),a([o()],h.prototype,"timeExtent",void 0),a([o()],h.prototype,"view",void 0),a([o()],h.prototype,"updateRequested",void 0),a([o()],h.prototype,"updating",null),a([o()],h.prototype,"type",void 0),h=a([v("esri.views.2d.layers.imagery.ImageryView2D")],h);const le=h;class he extends ae{constructor(){super(...arguments),this.symbolTypes=["triangle"]}prepareRenderPasses(t){const i=t.registerRenderPass({name:"imagery (vf)",brushes:[O],target:()=>this.children,drawPhase:D.MAP});return[...super.prepareRenderPasses(t),i]}doRender(t){this.visible&&t.drawPhase===D.MAP&&this.symbolTypes.forEach(i=>{t.renderPass=i,super.doRender(t)})}}let y=class extends R{constructor(e){super(e),this._loading=null,this.update=z((t,i)=>this._update(t,i).catch(r=>{b(r)||_.getLogger(this).error(r)}))}get updating(){return!!this._loading}redraw(e){if(!this.container.children.length)return;const t=this.container.children[0];t.symbolizerParameters=e,t.invalidateVAO(),this.container.symbolTypes=e.style==="wind_speed"?["scalar","triangle"]:e.style==="simple_scalar"?["scalar"]:["triangle"],this.container.requestRender()}async _update(e,t,i){if(!e.stationary)return;const{extent:r,spatialReference:s}=e.state,n=new B({xmin:r.xmin,ymin:r.ymin,xmax:r.xmax,ymax:r.ymax,spatialReference:s}),[l,c]=e.state.size;this._loading=this.fetchPixels(n,l,c,i);const p=await this._loading;this._addToDisplay(p,t,e.state),this._loading=null}_addToDisplay(e,t,i){if(e.pixelBlock==null)return this.container.children.forEach(l=>l.destroy()),void this.container.removeAllChildren();const{extent:r,pixelBlock:s}=e,n=new H(s);n.offset=[0,0],n.symbolizerParameters=t,n.rawPixelData=e,n.invalidateVAO(),n.x=r.xmin,n.y=r.ymax,n.pixelRatio=i.pixelRatio,n.rotation=i.rotation,n.resolution=i.resolution,n.width=s.width*t.symbolTileSize,n.height=s.height*t.symbolTileSize,this.container.children.forEach(l=>l.destroy()),this.container.removeAllChildren(),this.container.symbolTypes=t.style==="wind_speed"?["scalar","triangle"]:t.style==="simple_scalar"?["scalar"]:["triangle"],this.container.addChild(n)}};a([o()],y.prototype,"fetchPixels",void 0),a([o()],y.prototype,"container",void 0),a([o()],y.prototype,"_loading",void 0),a([o()],y.prototype,"updating",null),y=a([v("esri.views.2d.layers.imagery.ImageryVFStrategy")],y);const pe=y;let d=class extends R{constructor(){super(...arguments),this.attached=!1,this.container=new he,this.type="imageryVF",this._dataParameters={exportParametersVersion:0,bbox:"",symbolTileSize:0,time:""},this._fetchpixels=async(e,t,i,r)=>{const s=await this._projectFullExtentPromise,{symbolTileSize:n}=this.layer.renderer,{extent:l,width:c,height:p}=Y(e,t,i,n,s);if(s!=null&&!s.intersects(e))return{extent:l,pixelBlock:null};const m={bbox:`${l.xmin}, ${l.ymin}, ${l.xmax}, ${l.ymax}`,exportParametersVersion:this.layer.exportImageServiceParameters.version,symbolTileSize:n,time:JSON.stringify(this.timeExtent||"")};if(this._canReuseVectorFieldData(m)){const u=this.getPixelData();if(u!=null&&`${u.extent.xmin}, ${u.extent.ymin}, ${u.extent.xmax}, ${u.extent.ymax}`===m.bbox)return u}const{pixelData:g}=await this.layer.fetchImage(l,c,p,{timeExtent:this.timeExtent,requestAsImageElement:!1,signal:r});this._dataParameters=m;const x=g==null?void 0:g.pixelBlock;return x==null?{extent:l,pixelBlock:null}:{extent:l,pixelBlock:this.layer.rasterInfo.dataType==="vector-uv"?Z(x,"vector-uv"):x}}}get updating(){return!this.attached||this._strategy.updating}attach(){this._projectFullExtentPromise=this._getProjectedFullExtent(this.view.spatialReference),this._strategy=new pe({container:this.container,fetchPixels:this._fetchpixels}),this.addHandles(f(()=>this.layer.renderer,e=>this._updateSymbolizerParams(e),F),"attach")}detach(){this._strategy.destroy(),this.container.children.forEach(e=>e.destroy()),this.container.removeAllChildren(),this.removeHandles("attach"),this._strategy=this.container=this._projectFullExtentPromise=null}getPixelData(){var r;const e=(r=this.container.children[0])==null?void 0:r.rawPixelData;if(this.updating||!e)return null;const{extent:t,pixelBlock:i}=e;return{extent:t,pixelBlock:i}}hitTest(e){return new P({attributes:{},geometry:e.clone(),layer:this.layer})}update(e){this._strategy.update(e,this._symbolizerParams).catch(t=>{b(t)||_.getLogger(this).error(t)})}redraw(){const{renderer:e}=this.layer;e&&(this._updateSymbolizerParams(e),this._strategy.redraw(this._symbolizerParams))}_canReuseVectorFieldData(e){const t=this._dataParameters.exportParametersVersion===e.exportParametersVersion,i=this._dataParameters.time===e.time,r=this._dataParameters.symbolTileSize===e.symbolTileSize,s=this._dataParameters.bbox===e.bbox;return t&&i&&r&&s}async _getProjectedFullExtent(e){try{return se(this.layer.fullExtent,e)}catch{try{const i=(await I(this.layer.url,{query:{option:"footprints",outSR:U(e),f:"json"}})).data.featureCollection.layers[0].layerDefinition.extent;return i?B.fromJSON(i):null}catch{return null}}}_updateSymbolizerParams(e){e.type==="vector-field"&&(this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null}))}};a([o()],d.prototype,"attached",void 0),a([o()],d.prototype,"container",void 0),a([o()],d.prototype,"layer",void 0),a([o()],d.prototype,"timeExtent",void 0),a([o()],d.prototype,"type",void 0),a([o()],d.prototype,"view",void 0),a([o()],d.prototype,"updating",null),d=a([v("esri.views.2d.layers.imagery.VectorFieldView2D")],d);const de=d,ce=e=>{let t=class extends e{constructor(){super(...arguments),this.view=null}async fetchPopupFeaturesAtLocation(i,r){const{layer:s}=this;if(!i)throw new V("imagerylayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:s});const{popupEnabled:n}=s,l=oe(s,r);if(!n||l==null)throw new V("imagerylayerview:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:n,popupTemplate:l});const c=await l.getRequiredFields();M(r);const p=new L;p.timeExtent=this.timeExtent,p.geometry=i,p.outFields=c,p.outSpatialReference=i.spatialReference;const{resolution:m,spatialReference:g}=this.view,x=this.view.type==="2d"?new E(m,m,g):new E(.5*m,.5*m,g),{returnTopmostRaster:u,showNoDataRecords:k}=l.layerOptions||{returnTopmostRaster:!0,showNoDataRecords:!1},T={returnDomainValues:!0,returnTopmostRaster:u,pixelSize:x,showNoDataRecords:k,signal:r==null?void 0:r.signal};return s.queryVisibleRasters(p,T).then(A=>A)}canResume(){var i;return!!super.canResume()&&!((i=this.timeExtent)!=null&&i.isEmpty)}};return a([o()],t.prototype,"layer",void 0),a([o()],t.prototype,"suspended",void 0),a([o(C)],t.prototype,"timeExtent",void 0),a([o()],t.prototype,"view",void 0),t=a([v("esri.views.layers.ImageryLayerView")],t),t};let w=class extends ce(ne(G(W))){constructor(){super(...arguments),this._exportImageVersion=-1,this._highlightGraphics=new j,this._highlightView=void 0,this.layer=null,this.subview=null}get pixelData(){const{subview:e}=this;return this.updating||!e?null:"getPixelData"in e?e.getPixelData():null}update(e){var t;(t=this.subview)==null||t.update(e)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.view&&(this._highlightView=new K({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new X(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container)),this.addAttachHandles([f(()=>this.layer.exportImageServiceParameters.version,e=>{e&&this._exportImageVersion!==e&&(this._exportImageVersion=e,this.requestUpdate())},$),f(()=>this.timeExtent,e=>{const{subview:t}=this;t&&(t.timeExtent=e,"redraw"in t?this.requestUpdate():t.redrawOrRefetch())},$),this.layer.on("redraw",()=>{const{subview:e}=this;e&&("redraw"in e?e.redraw():e.redrawOrRefetch())}),f(()=>this.layer.renderer,()=>this._setSubView())])}detach(){var e,t;this.layer.decreaseRasterJobHandlerUsage(),this.container.removeAllChildren(),this._detachSubview(this.subview),(e=this.subview)==null||e.destroy(),this.subview=null,(t=this._highlightView)==null||t.destroy(),this._exportImageVersion=-1}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}highlight(e,t){if(!((Array.isArray(e)?e[0]:S.isCollection(e)?e.at(0):e)instanceof P))return q();let i=[];return Array.isArray(e)||S.isCollection(e)?i=e.map(r=>r.clone()):e instanceof P&&(i=[e.clone()]),this._highlightGraphics.addMany(i),q(()=>this._highlightGraphics.removeMany(i))}async doRefresh(){this.requestUpdate()}isUpdating(){var t,i;const e=!this.subview||this.subview.updating||!!((t=this._highlightView)!=null&&t.updating);return N("esri-2d-log-updating")&&console.log(`Updating ImageryLayerView2D (${this.layer.id}): ${e} -> subview ${!this.subview||this.subview.updating} -> higlightView ${(i=this._highlightView)==null?void 0:i.updating} `),e}_setSubView(){var i,r;if(!this.view)return;const e=(i=this.layer.renderer)==null?void 0:i.type;let t="imagery";if(e==="vector-field"?t="imageryVF":e==="flow"&&(t="flow"),this.subview){const{type:s}=this.subview;if(s===t)return this._attachSubview(this.subview),void(s==="flow"?this.subview.redrawOrRefetch():s==="imagery"&&this.layer.format==="lerc"?this.subview.redraw():this.requestUpdate());this._detachSubview(this.subview),(r=this.subview)==null||r.destroy()}this.subview=t==="imagery"?new le({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):t==="imageryVF"?new de({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new J({layer:this.layer,layerView:this}),this._attachSubview(this.subview),this.requestUpdate()}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0))}_detachSubview(e){e!=null&&e.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}};a([o()],w.prototype,"pixelData",null),a([o()],w.prototype,"subview",void 0),w=a([v("esri.views.2d.layers.ImageryLayerView2D")],w);const lt=w;export{lt as default}; diff --git a/assets/ImageryTileLayer-B8fBMD3Z.js b/assets/ImageryTileLayer-BEBkov6O.js similarity index 98% rename from assets/ImageryTileLayer-B8fBMD3Z.js rename to assets/ImageryTileLayer-BEBkov6O.js index db38065..f457832 100644 --- a/assets/ImageryTileLayer-B8fBMD3Z.js +++ b/assets/ImageryTileLayer-BEBkov6O.js @@ -1,8 +1,8 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/geometryEngine-DD4bBRnV.js","assets/geometryEngineBase-C5__2Su1.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css","assets/hydrated-CcIo9KoC.js","assets/imageryUtils-Bct433Ji.js","assets/utils-2LBmsoaQ.js","assets/originUtils-D69mHv66.js","assets/multiOriginJSONSupportUtils-C0wm8_Yw.js","assets/saveAPIKeyUtils-BiX1lQSW.js","assets/saveUtils-BzCRy3uR.js"] + __vite__mapDeps.viteFileDeps = ["assets/geometryEngine-8LJe6rF3.js","assets/geometryEngineBase-CDbTTSsS.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css","assets/hydrated-D7zavlGk.js","assets/imageryUtils-CP_eOmeO.js","assets/utils-iOpWi7jV.js","assets/originUtils-D69mHv66.js","assets/multiOriginJSONSupportUtils-C0wm8_Yw.js","assets/saveAPIKeyUtils-YRBbgdzi.js","assets/saveUtils-CGGzyvzv.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{hk as Tt,kg as _t,dZ as te,kh as ht,s as le,N as O,er as Le,aA as A,aE as z,M as ft,d_ as mt,aS as L,ia as kt,d as I,y as v,du as dt,f as K,aU as Ft,_ as He,bo as Ye,aB as Mt,aZ as Ct,jD as Pt,aj as Ot,a9 as Dt,ki as $t,dc as pt,kj as Nt,q as Be,E as Bt,jj as Et,ah as Jt,bW as At,kk as zt,bP as Lt,bQ as Ht,dp as Wt,dq as Gt,dO as jt,dM as qt,dr as Ut,b4 as Vt,k as Xt,ay as Yt,a_ as he,g as Kt,dS as Qt,c9 as Zt,dt as ei,i as ti,bT as ii}from"./index-CEWggaxV.js";import{c as si,N as Ee,l as ni,d as ri,a as ai,h as oi,K as Ke,B as Qe,S as li,E as ci,V as Ze,t as ui,p as hi,m as fi,b as mi}from"./ImageHistogramParameters-CsWWZYhj.js";import{h as yt,D as gt,i as di,a as pi,p as We,d as et,o as yi,f as tt,g as gi}from"./multidimensionalUtils-uKyVhR8j.js";import{S as xi,n as ge,m as Ge,L as wi,r as it,a as xe,h as Ii,g as je,P as bi,b as Si,F as Ri,U as vi,N as Ti,R as _i,c as we,B as ki,d as Fi,D as Mi}from"./RasterSymbolizer-D7OwkKeP.js";import{i as st,m as nt,x as rt,h as Ci,s as Pi}from"./RawBlockCache-D9cjIDVu.js";import{U as Fe,D as xt,R as Oi,a as Di,l as $i,c as Ni,u as Y,f as Bi,s as Ei,d as Ji,E as Ai,W as zi,T as Li}from"./dataUtils-BFJflGP5.js";import{T as Je,D as Ie,j as at,r as ot,o as Hi,V as Me,J as ve,e as Wi,Z as Gi,C as ji,U as Ae}from"./rasterProjectionHelper-Bwvi37wQ.js";import{d as _e}from"./FeatureSet-CYJUZgOk.js";import{R as wt,f as qi,i as Ui,y as qe,c as Vi,N as Xi}from"./utils-CMvkNhle.js";import{f as Yi}from"./RefreshableLayer-1EkEhJeI.js";import{f as Ki}from"./TemporalLayer-qq3v_i3q.js";import{p as Qi}from"./popupUtils-DAFYyAvw.js";import{A as be}from"./interfaces-CL2NbQte.js";import"./UniqueValueRenderer-BlkUix3g.js";import"./ColorStop-44hBlQ14.js";import"./diffUtils-B4YFa5Ju.js";import"./colorRamps-BJydlf0f.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-z2k12BH8.js";import"./jsonUtils-qYmXvGJ1.js";import"./styleUtils-CnV_Xzhi.js";import"./utils-kx2f2Fff.js";import"./utils-p-5Bbga5.js";import"./ClassBreaksDefinition-D281x8Sj.js";import"./TimeInfo-3TVmpFSA.js";const lt=8,Zi=256;let es=0,G=class extends Tt(Ft){constructor(){super(...arguments),this._tileFetchQueue=new _t({concurrency:32,process:(i,e)=>this._fetchRawTile(i.pyramidLevel,i.row,i.col,{...i.options,signal:e})}),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}async init(){const i=Je();this.addResolvingPromise(i),await this.when()}normalizeCtorArgs(i){return i!=null&&i.ioConfig&&(i={...i,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:te.create(),...i.ioConfig}}),i}get _isGlobalWrappableSource(){const{rasterInfo:i}=this,e=Ie(i.spatialReference);return e!=null&&i.extent.width>=e/2}get _hasNoneOrGCSShiftTransform(){const{transform:i}=this.rasterInfo;return i==null||i.type==="gcs-shift"}set rasterJobHandler(i){var e,n;this._set("rasterJobHandler",i),this.datasetFormat==="Function"&&((n=(e=this.primaryRasters)==null?void 0:e.rasters)==null||n.forEach(t=>t.rasterJobHandler=i))}get rasterId(){return this.url||"rasterId-"+es++}set url(i){this._set("url",ht(i,le.getLogger(this)))}async open(i){throw new O("BaseRaster:open-not-implemented","open() is not implemented")}async fetchTile(i,e,n,t={}){const s=t.tileInfo||this.rasterInfo.storageInfo.tileInfo,a=this.getTileExtentFromTileInfo(i,e,n,s);return t={noClip:!0,...t},this.fetchPixels(a,s.size[0],s.size[1],t)}async identify(i,e={}){var M;i=Le(A,i).clone().normalize();const{multidimensionalDefinition:n,timeExtent:t}=e,{rasterInfo:s}=this,{hasMultidimensionalTranspose:a,multidimensionalInfo:r}=s;let{transposedVariableName:o}=e;const l=r!=null&&a&&(t!=null||yt(n));l&&!o&&(o=n!=null&&n.length>0?n[0].variableName??void 0:r.variables[0].name,e={...e,transposedVariableName:o}),e=this._getRequestOptionsWithSliceId(e);const{spatialReference:c,extent:h}=s,{datumTransformation:u}=e;let m=at(i,c,u);if(!h.intersects(m))return{location:m,value:null};if(s.transform!=null){const P=s.transform.inverseTransform(m);if(!s.nativeExtent.intersects(P))return{location:P,value:null};m=P}let f=0;const p=o!=null&&r!=null&&s.hasMultidimensionalTranspose;if(this.datasetFormat==="Function"){const P=this.primaryRasters.rasters[0];if(p)return P.identify(m,e);const{pixelSize:B}=s,C=3,D=B.x*C/2,$=B.y*C/2,E=new z({xmin:m.x-D,xmax:m.x+D,ymin:m.y-$,ymax:m.y+$,spatialReference:c}),X={interpolation:"nearest",multidimensionalDefinition:n,sliceId:e.sliceId},{pixelBlock:H}=await P.fetchPixels(E,C,C,X),{pixelBlock:W}=await this.fetchPixels(E,C,C,X);if(H==null)return{location:m,value:null};const q=Math.floor(C*C*.5),ee=!H.mask||H.mask[q]?H.pixels.map(N=>N[q]):null;let U;return W!=null&&(U=!W.mask||W.mask[q]?W.pixels.map(N=>N[q]):void 0),{location:m,value:ee,processedValue:U,pyramidLevel:0}}if(!p){if(e.srcResolution)f=ot(e.srcResolution,s,this.ioConfig.sampling).pyramidLevel;else if(f=await this.computeBestPyramidLevelForLocation(i,e),f==null)return{location:m,value:null}}const g=this.identifyPixelLocation(m,f,null,p);if(g===null)return{location:m,value:null};const{row:d,col:y,rowOffset:x,colOffset:w,blockWidth:S}=g,T=o??e.sliceId,b=st(this.rasterId,T),_=`${f}/${d}/${y}`;let k=nt(b,null,_);k==null&&(k=this.fetchRawTile(f,d,y,e),rt(b,null,_,k));const R=await k;if(!((M=R==null?void 0:R.pixels)!=null&&M.length))return{location:m,value:null};const F=x*S+w;return this._processIdentifyResult(R,{srcLocation:m,position:F,pyramidLevel:f,useTransposedTile:!!p,requestSomeSlices:l,identifyOptions:e})}async fetchPixels(i,e,n,t={}){i=Hi(i),t=this._getRequestOptionsWithSliceId(t);const{_hasNoneOrGCSShiftTransform:s}=this;if(t.requestRawData&&s)return this._fetchPixels(i,e,n,t);const a=Ie(i.spatialReference),r=Me(i);if(a==null||r===0||r===1&&this._isGlobalWrappableSource&&s)return this._fetchPixels(i,e,n,t);if(r>=3)return{extent:i,pixelBlock:null};const o=[],{xmin:l,xmax:c}=i,h=Math.round(a/(c-l)*e),u=h-Math.round((a/2-l)/(c-l)*e);let m=0;const f=[];for(let y=0;y<=r;y++){const x=new z({xmin:y===0?l:-a/2,xmax:y===r?c-a*y:a/2,ymin:i.ymin,ymax:i.ymax,spatialReference:i.spatialReference}),w=y===0?h-u:y===r?e-m:h;m+=w,f.push(w);const S=t.disableWrapAround&&y>0?null:this._fetchPixels(x,w,n,t);o.push(S)}const p=(await Promise.all(o)).map(y=>y==null?void 0:y.pixelBlock);let g=null;const d={width:e,height:n};return this.rasterJobHandler?g=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:p,srcMosaicSize:d,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:f},t)).pixelBlock:g=Fe(p,d,{blockWidths:f}),{extent:i,srcExtent:ve(i,this.rasterInfo.spatialReference,t.datumTransformation),pixelBlock:g}}async fetchRawPixels(i,e,n,t={}){e={x:Math.floor(e.x),y:Math.floor(e.y)};const s=await this._fetchRawTiles(i,e,n,t),{nativeExtent:a,nativePixelSize:r,storageInfo:o}=this.rasterInfo,l=2**i,c=r.x*l,h=r.y*l,u=new z({xmin:a.xmin+c*e.x,xmax:a.xmin+c*(e.x+n.width-1),ymin:a.ymax-h*(e.y+n.height-1),ymax:a.ymax-h*e.y,spatialReference:a.spatialReference});if(!s)return{extent:u,srcExtent:u,pixelBlock:null};const{pixelBlocks:m,mosaicSize:f}=s;if(m.length===1&&m[0]!=null&&m[0].width===n.width&&m[0].height===n.height)return{extent:u,srcExtent:u,pixelBlock:s.pixelBlocks[0]};const p=i>0?o.pyramidBlockWidth:o.blockWidth,g=i>0?o.pyramidBlockHeight:o.blockHeight,d={x:e.x%p,y:e.y%g};let y;return this.rasterJobHandler?y=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:m,srcMosaicSize:f,destDimension:n,clipOffset:d,clipSize:n,coefs:null,sampleSpacing:null,interpolation:t.interpolation,alignmentInfo:null,blockWidths:null},t)).pixelBlock:y=Fe(m,f,{clipOffset:d,clipSize:n}),{extent:u,srcExtent:u,pixelBlock:y}}fetchRawTile(i,e,n,t){throw new O("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(i){return ve(this.rasterInfo.extent,i)}decodePixelBlock(i,e){return!this.rasterJobHandler||e.useCanvas?xi(i,e):this.rasterJobHandler.decode({data:i,options:e})}async request(i,e,n=0){const{customFetchParameters:t}=this.ioConfig,{range:s,query:a,headers:r}=e;n=n??e.retryCount??this.ioConfig.retryCount;const o=s?{Range:`bytes=${s.from}-${s.to}`}:null;try{return await ft(i,{...e,query:{...a,...t},headers:{...r,...o}})}catch(l){if(n>0)return n--,this.request(i,e,n);throw l}}getSliceIndex(i){const{multidimensionalInfo:e}=this.rasterInfo;return e==null||i==null||i.length===0?null:gt(i,e)}getTileExtentFromTileInfo(i,e,n,t){const s=t.lodAt(i);return this.getTileExtent({x:s.resolution,y:s.resolution},e,n,t.origin,t.spatialReference,t.size)}updateTileInfo(){const{storageInfo:i,spatialReference:e,extent:n,pixelSize:t}=this.rasterInfo;if(!i.tileInfo){const s=[],a=i.maximumPyramidLevel||0;let r=Math.max(t.x,t.y),o=1/.0254*96*r;for(let c=0;c<=a;c++)s.unshift(new mt({level:a-c,resolution:r,scale:o})),r*=2,o*=2;const l=new A({x:n.xmin,y:n.ymax,spatialReference:e});i.tileInfo=new te({origin:l,size:[i.blockWidth,i.blockHeight],spatialReference:e,lods:s}),i.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(i,e=512,n=512,t){const{width:s,height:a,nativeExtent:r,pixelSize:o,spatialReference:l}=i,c=new A({x:r.xmin,y:r.ymax,spatialReference:l});t==null&&(t=Math.max(0,Math.round(Math.log(Math.max(s,a))/Math.LN2-8)));const h=this.computeBlockBoundary(r,512,512,{x:r.xmin,y:r.ymax},[o],t);i.storageInfo=new ge({blockWidth:e,blockHeight:n,pyramidBlockWidth:e,pyramidBlockHeight:n,origin:c,firstPyramidLevel:1,maximumPyramidLevel:t,blockBoundary:h})}async computeBestPyramidLevelForLocation(i,e={}){return 0}computeBlockBoundary(i,e,n,t,s,a=0,r=2){if(s.length===1&&a>0){s=[...s];let{x:h,y:u}=s[0];for(let m=0;mo)return null;const f=this.getPyramidPixelSize(e),{x:p,y:g}=f,d=(l.y-m.y)/g/u,y=(m.x-l.x)/p/h,x=Math.min(u-1,Math.floor((d-Math.floor(d))*u)),w=Math.min(h-1,Math.floor((y-Math.floor(y))*h));return{pyramidLevel:e,row:Math.floor(d),col:Math.floor(y),rowOffset:x,colOffset:w,blockWidth:h,srcLocation:m}}getTileExtent(i,e,n,t,s,a){const[r,o]=a,l=t.x+n*r*i.x,c=l+r*i.x,h=t.y-e*o*i.y,u=h-o*i.y;return new z({xmin:l,xmax:c,ymin:u,ymax:h,spatialReference:s})}getBlockWidthHeight(i){return{blockWidth:i>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:i>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(i,e,n){const t=this.rasterInfo.storageInfo.blockBoundary[i];return!t||t.maxRowe||t.minCol>n}updateImageSpaceRasterInfo(i){const{extent:e,pixelSize:n}=i;if(e.xmin===-.5&&e.ymax===.5&&n.x===1&&n.y===1&&i.transform==null)return;const{width:t,height:s}=i,a=L.WebMercator;i.spatialReference=a,i.extent=i.nativeExtent=new z({xmin:-.5,ymax:.5,xmax:t-.5,ymin:.5-s,spatialReference:a}),i.isPseudoSpatialReference=!0,i.transform=null,i.pixelSize=new A({x:1,y:1,spatialReference:a});const{extent:r,storageInfo:o}=i;if(o){o.origin=new A({x:r.xmin,y:r.ymax,spatialReference:a});const{tileInfo:l}=o;if(l){l.origin=o.origin;const c=(i.nativePixelSize.x+i.nativePixelSize.y)/2;l.lods.forEach((h,u)=>{h.resolution=c*2**u,h.scale=96*h.resolution/.0254})}}}async _fetchPixels(i,e,n,t={}){let s=Me(i);if(s>=2)return{extent:i,pixelBlock:null};const a=this._getSourceDataInfo(i,e,n,t),{pyramidLevel:r,srcResolution:o,srcExtent:l,srcWidth:c,srcHeight:h,ul:u}=a;if(c===0||h===0)return{extent:i,srcExtent:l,pixelBlock:null};const{rasterInfo:m}=this,f=m.transform,p=(f==null?void 0:f.type)==="gcs-shift",g=Ie(i.spatialReference)!=null;!p&&g||(s=Me(a.srcExtent,p));const d=await this._fetchRawTiles(r,u,{width:c,height:h,wrapCount:s},t);if(!d)return{extent:i,srcExtent:l,pixelBlock:null};const y=m.storageInfo,x=r>0?y.pyramidBlockWidth:y.blockWidth,w=r>0?y.pyramidBlockHeight:y.blockHeight;let{x:S,y:T}=m.pixelSize;if(r>0){const{pyramidResolutions:N,pyramidScalingFactor:vt}=y;if(N!=null&&N[r-1])({x:S,y:T}=N[r-1]);else{const Xe=vt**r;S*=Xe,T*=Xe}}const b=m.spatialReference,_=new A({x:S,y:T,spatialReference:b}),k=x===c&&w===h&&u.x%x==0&&u.y%w==0,R=new A({x:(i.xmax-i.xmin)/e,y:(i.ymax-i.ymin)/n,spatialReference:i.spatialReference}),F=!i.spatialReference.equals(b),M=b.isGeographic?1e-9:1e-4,{datumTransformation:P}=t;if(!F&&k&&d.pixelBlocks.length===1&&x===e&&w===n&&this._isSameResolution(o,R,M))return{extent:i,srcExtent:l,srcTilePixelSize:_,pixelBlock:d.pixelBlocks[0]};const B=g&&Ie(l.spatialReference)!=null&&this._hasNoneOrGCSShiftTransform,C=t.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");C&&!this.rasterJobHandler&&await Je();const D=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:i,srcBufferExtent:d.extent,pixelSize:R.toJSON(),datumTransformation:P,rasterTransform:f,hasWrapAround:s>0||B,isAdaptive:this.ioConfig.optimizeProjectionAccuracy!==!1,includeGCSGrid:C},t):Wi({projectedExtent:i,srcBufferExtent:d.extent,pixelSize:R,datumTransformation:P,rasterTransform:f,hasWrapAround:s>0||B,isAdaptive:!1,includeGCSGrid:C});let $;const E=!t.requestRawData,X={rows:D.spacing[0],cols:D.spacing[1]},H=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(r,d.extent.xmin):void 0,{pixelBlocks:W,mosaicSize:q,isPartiallyFilled:ee}=d;let U=null;if(this.rasterJobHandler)({pixelBlock:$,localNorthDirections:U}=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:W,srcMosaicSize:q,destDimension:E?{width:e,height:n}:null,coefs:E?D.coefficients:null,sampleSpacing:E?X:null,projectDirections:C,gcsGrid:C?D.gcsGrid:null,isUV:this.rasterInfo.dataType==="vector-uv",interpolation:t.interpolation,alignmentInfo:H,blockWidths:null},t));else{const N=Fe(W,q,{alignmentInfo:H});$=E?xt(N,{width:e,height:n},D.coefficients,X,t.interpolation):N,C&&D.gcsGrid&&(U=Oi({width:e,height:n},D.gcsGrid),$=Di($,this.rasterInfo.dataType,U))}return t.requestRawData||C?{extent:i,srcExtent:l,srcTilePixelSize:_,pixelBlock:$,transformGrid:D,localNorthDirections:U,isPartiallyFilled:ee}:{extent:i,srcExtent:l,srcTilePixelSize:_,pixelBlock:$}}async _fetchRawTiles(i,e,n,t){const{origin:s,blockBoundary:a}=this.rasterInfo.storageInfo,{blockWidth:r,blockHeight:o}=this.getBlockWidthHeight(i);let{x:l,y:c}=e,{width:h,height:u,wrapCount:m}=n;const f=this._getRasterTileAlignmentInfo(i,0);t.buffer&&(l-=t.buffer.cols,c-=t.buffer.rows,h+=2*t.buffer.cols,u+=2*t.buffer.rows);let p=0,g=0,d=0;m&&f!=null&&({worldColumnCountFromOrigin:g,originColumnOffset:d,rightPadding:p}=f,g*f.blockWidth-p>=l+h&&(p=0));const y=Math.floor(l/r),x=Math.floor(c/o),w=Math.floor((l+h+p-1)/r),S=Math.floor((c+u+p-1)/o),T=a[i];if(!T)return null;const{minRow:b,minCol:_,maxCol:k,maxRow:R}=T;if(m===0&&(SR||y>k))return null;const F=new Array;let M=!1;const P=this.ioConfig.allowPartialFill==null?t.allowPartialFill:this.ioConfig.allowPartialFill;for(let H=x;H<=S;H++)for(let W=y;W<=w;W++){let q=W;if(!t.disableWrapAround&&m&&f!=null&&g<=W&&(q=W-g-d),H>=b&&q>=_&&R>=H&&k>=q){const ee=this._tileFetchQueue.push({pyramidLevel:i,row:H,col:q,options:t},{signal:t.signal});P?F.push(new Promise(U=>{ee.then(N=>U(N)).catch(()=>{M=!0,U(null)})})):F.push(ee)}else F.push(Promise.resolve(null))}if(F.length===0)return null;const B=await Promise.all(F),C={height:(S-x+1)*o,width:(w-y+1)*r},{spatialReference:D}=this.rasterInfo,$=this.getPyramidPixelSize(i),{x:E,y:X}=$;return{extent:new z({xmin:s.x+y*r*E,xmax:s.x+(w+1)*r*E,ymin:s.y-(S+1)*o*X,ymax:s.y-x*o*X,spatialReference:D}),pixelBlocks:B,mosaicSize:C,isPartiallyFilled:M}}_isSameResolution(i,e,n){return Math.abs(i.x-e.x)l||n>o)return Promise.resolve(null);const c=st(this.rasterId,t.sliceId),h=`${i}/${e}/${n}`;let u=nt(c,t.registryId,h);if(u==null){const m=new AbortController;u=this.fetchRawTile(i,e,n,{...t,signal:m.signal}),rt(c,t.registryId,h,u,m),u.catch(()=>Ci(c,t.registryId,h))}return t.signal&&kt(t,()=>{Pi(c,t.registryId,h)}),u}_computeMagDirValues(i){var l;const{bandCount:e,dataType:n}=this.rasterInfo;if(!(e===2&&n==="vector-magdir"||n==="vector-uv")||(i==null?void 0:i.length)!==2||!((l=i[0])!=null&&l.length))return null;const t=i[0].length;if(n==="vector-magdir"){const c=i[1].map(h=>(h+360)%360);return[i[0],c]}const[s,a]=i,r=[],o=[];for(let c=0;c=16,m=l===a&&this._requireTooManySrcTiles(r,o,e,n);if(u||m||r===0||o===0){const f=new A({x:(i.xmax-i.xmin)/e,y:(i.ymax-i.ymin)/n,spatialReference:i.spatialReference});let p=ji(f,this.rasterInfo.spatialReference,i,s.datumTransformation);const g=!p||t.srcResolution&&p.x+p.y=d){const y=2**d;p={x:t.srcResolution.x*y,y:t.srcResolution.y*y}}}p&&(s.srcResolution=p,this._updateSourceDataInfo(i,s))}return this._requireTooManySrcTiles(s.srcWidth,s.srcHeight,e,n)&&(s.srcWidth=0,s.srcHeight=0),s}_requireTooManySrcTiles(i,e,n,t){const{tileInfo:s}=this.rasterInfo.storageInfo,a=Math.ceil(i/s.size[0])*Math.ceil(e/s.size[1]),r=i/n,o=e/t,l=Math.max(1,(n+t)/1024);return a>=Zi*l||r>lt||o>lt}_updateSourceDataInfo(i,e){e.srcWidth=0,e.srcHeight=0;const{rasterInfo:n}=this,t=n.spatialReference,{srcResolution:s,datumTransformation:a}=e,{pyramidLevel:r,pyramidResolution:o,excessiveReading:l}=ot(s,n,this.ioConfig.sampling);if(l)return;let c=e.srcExtent||ve(i,t,a);if(c==null)return;const h=n.transform;h&&(c=h.inverseTransform(c)),e.srcExtent=c;const{x:u,y:m}=n.storageInfo.origin,f=Math.floor((c.xmin-u)/o.x+.1),p=Math.floor((m-c.ymax)/o.y+.1),g=Math.floor((c.xmax-u)/o.x-.1),d=Math.floor((m-c.ymin)/o.y-.1),y=c.width<.1*o.x?0:g-f+1,x=c.height<.1*o.y?0:d-p+1;e.pyramidLevel=r,e.pyramidResolution=o,e.srcWidth=y,e.srcHeight=x,e.ul={x:f,y:p}}_getRequestOptionsWithSliceId(i){return this.rasterInfo.multidimensionalInfo!=null&&i.sliceId==null&&(i={...i,sliceId:this.getSliceIndex(i.multidimensionalDefinition)}),i}_processIdentifyResult(i,e){const{srcLocation:n,position:t,pyramidLevel:s,useTransposedTile:a}=e,r=i.pixels[0].length/i.width/i.height;if(!(!i.mask||i.mask[t]))return{location:n,value:null};const{multidimensionalInfo:o}=this.rasterInfo;if(o==null||!a){const d=i.pixels.map(w=>w[t]),y={location:n,value:d,pyramidLevel:s},x=this._computeMagDirValues(d.map(w=>[w]));return x!=null&&x.length&&(y.magdirValue=x.map(w=>w[0])),y}let l=i.pixels.map(d=>d.slice(t*r,t*r+r)),c=this._computeMagDirValues(l);const{requestSomeSlices:h,identifyOptions:u}=e;let m=di(o,u.transposedVariableName);if(h){const d=pi(m,u.multidimensionalDefinition,u.timeExtent);l=l.map(y=>d.map(x=>y[x])),c=c==null?void 0:c.map(y=>d.map(x=>y[x])),m=d.map(y=>m[y])}const f=i.noDataValues||this.rasterInfo.noDataValue,p={pixels:l,pixelType:i.pixelType};let g;return f!=null&&(Ni(p,f),g=p.mask),{location:n,value:null,dataSeries:m.map((d,y)=>{const x={value:(g==null?void 0:g[y])===0?null:l.map(w=>w[y]),multidimensionalDefinition:d.multidimensionalDefinition.map(w=>new We({...w,isSlice:!0}))};return c!=null&&c.length&&(x.magdirValue=[c[0][y],c[1][y]]),x}),pyramidLevel:s}}};I([v()],G.prototype,"_rasterTileAlignmentInfo",void 0),I([v()],G.prototype,"_tileFetchQueue",void 0),I([v({readOnly:!0})],G.prototype,"_isGlobalWrappableSource",null),I([v({readOnly:!0})],G.prototype,"_hasNoneOrGCSShiftTransform",null),I([v()],G.prototype,"rasterJobHandler",null),I([v({readOnly:!0})],G.prototype,"rasterId",null),I([v(dt)],G.prototype,"url",null),I([v({type:String,json:{write:!0}})],G.prototype,"datasetName",void 0),I([v({type:String,json:{write:!0}})],G.prototype,"datasetFormat",void 0),I([v()],G.prototype,"hasUniqueSourceStorageInfo",void 0),I([v()],G.prototype,"rasterInfo",void 0),I([v()],G.prototype,"ioConfig",void 0),I([v()],G.prototype,"sourceJSON",void 0),G=I([K("esri.layers.support.rasterDatasets.BaseRaster")],G);const se=G;function ts(i,e){if(i.spatialReference.equals(e))return i;const n=Ye(i.spatialReference),t=Ye(e);if(n===t)return i;const s=n/t;return{x:i.x*s,y:i.y*s}}async function ze(i,e,n){if(n.type==="extent")return ss(i,e,n);const{width:t,height:s}=i,a=new Uint8Array(t*s),{contains:r,intersects:o}=await He(()=>import("./geometryEngine-DD4bBRnV.js"),__vite__mapDeps([0,1,2,3,4]));return o(e,n)?n.type==="polyline"?ns(i,e,n):r(n,e)?i:is(i,e,n):new Y({pixelType:i.pixelType,width:t,height:s,mask:a,maskIsAlpha:!1,pixels:[...i.pixels]})}function is(i,e,n){if(!i)return i;const{width:t,height:s}=i,a=e.width/t,r=e.height/s,{xmin:o,ymax:l}=e;let c;if(n.type==="extent"){const d=(n.xmin-o)/a,y=(n.xmax-o)/a,x=(l-n.ymax)/r,w=(l-n.ymin)/r;c=[[[d,x],[d,w],[y,w],[y,x],[d,x]]]}else c=n.rings.map(d=>d.map(([y,x])=>[(y-o)/a,(l-x)/r]));const h=document.createElement("canvas");h.width=t,h.height=s;const u=h.getContext("2d");u.fillStyle="#f00",u.beginPath(),c.forEach(d=>{u.moveTo(d[0][0],d[0][1]);for(let y=0;y127?255:0);return new Y({pixelType:i.pixelType,width:t,height:s,mask:g,maskIsAlpha:!1,pixels:[...i.pixels]})}function ss(i,e,n){const{width:t,height:s}=i,a=new Uint8Array(t*s),r=e.width/t,o=e.height/s;if(n.width/r<.5||n.height/o<.5)return new Y({pixelType:i.pixelType,width:t,height:s,mask:a,pixels:[...i.pixels]});const{xmin:l,xmax:c,ymin:h,ymax:u}=e,{xmin:m,xmax:f,ymin:p,ymax:g}=n,d=Math.max(l,m),y=Math.min(c,f),x=Math.max(h,p),w=Math.min(u,g),S=.5*r,T=.5*o;if(y-dc-S||x>u-T||w.5&&_%1<.5||P===B&&k%1>.5&&R%1<.5)return new Y({pixelType:i.pixelType,width:t,height:s,mask:a,pixels:[...i.pixels]});if(F===0&&P===0&&M===t&&B===s)return i;const C=i.mask;for(let D=P;D<=B;D++)for(let $=F;$<=M;$++){const E=D*t+$;a[E]=C?C[E]:255}return new Y({pixelType:i.pixelType,width:t,height:s,mask:a,pixels:[...i.pixels]})}function ns(i,e,n){const{width:t,height:s}=i,a=new Uint8Array(t*s),r=e.width/t,o=e.height/s,{xmin:l,ymax:c}=e,{paths:h}=n,u=i.mask;for(let m=0;mg?a*Math.round((u-g)/a):0),f=d-(fg?a*Math.round((m-g)/a):0),p=d-(pg?a*Math.floor((u-g)/a+.1):0),f=d-(fp.rasterJobHandler=this.rasterJobHandler)));const{rasters:t,rasterIds:s}=this.primaryRasters,a=t.map(p=>p.rasterInfo?void 0:p.open(e));await Promise.all(a);const r=t.map(({rasterInfo:p})=>p),o=n.bind({rasterInfos:r,rasterIds:s});if(n.rawSourceRasterInfos=r,!o.success||r.length===0)throw new O("raster-function:open",`cannot bind the function: ${o.error??""}`);const l=n.functionName==="Table"?n:(f=n.functionArguments)==null?void 0:f.raster;(l==null?void 0:l.functionName)==="Table"&&(n.rasterInfo.attributeTable=_e.fromJSON(l.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const c=r[0];this.hasUniqueSourceStorageInfo=r.length===1||r.slice(1).every(p=>this._hasSameStorageInfo(p,c)),this.set("sourceJSON",t[0].sourceJSON),this.set("rasterInfo",n.rasterInfo),await this._updateClipGeometry()}async syncJobHandler(){var e;return(e=this.rasterJobHandler)==null?void 0:e.updateRasterFunction(this.rasterFunction)}async fetchPixels(e,n,t,s={}){var S,T;const{rasters:a,rasterIds:r}=this.primaryRasters;let o=!1;const{interpolation:l}=s,c=(S=this.rasterFunction.flatWebGLFunctionChain)==null?void 0:S.hasFocalFunction;!s.requestRawData&&c&&(o=a.length===1&&!s.skipRasterFunction,s={...s,interpolation:"bilinear",requestRawData:o});const h=a.map(b=>b.fetchPixels(e,n,t,s)),u=await Promise.all(h),m=u.map(b=>b.pixelBlock),f=o||s.requestRawData?u.map(b=>b.srcTilePixelSize):null;if(s.skipRasterFunction||m.every(b=>b==null))return u[0];const p=((T=u.find(b=>b.pixelBlock!=null))==null?void 0:T.extent)??e;let g=this.rasterJobHandler?await this.rasterJobHandler.process({extent:p,primaryPixelBlocks:m,primaryPixelSizes:f,primaryRasterIds:r}):this.rasterFunction.process({extent:p,primaryPixelBlocks:m,primaryPixelSizes:f,primaryRasterIds:r});const{transformGrid:d}=u[0];if(!o||g==null||d==null){const b=s.noClip?null:this.getClippingGeometry(p.spatialReference);return s.noClip||s.requestRawData||g==null||!b||(g=await ze(g,p,b)),{...u[0],pixelBlock:g}}const y={rows:d.spacing[0],cols:d.spacing[1]};let x;this.rasterJobHandler?x=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[g],srcMosaicSize:{width:g.width,height:g.height},destDimension:{width:n,height:t},coefs:d.coefficients,sampleSpacing:y,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:l,alignmentInfo:void 0,blockWidths:null},s)).pixelBlock:x=xt(g,{width:n,height:t},d.coefficients,y,l);const w=s.noClip?null:this.getClippingGeometry(e.spatialReference);return s.noClip||s.requestRawData||x==null||w==null||(x=await ze(x,e,w)),{extent:e,srcExtent:u[0].srcExtent,pixelBlock:x}}getClippingGeometry(e){const n=this._clippingGeometry.get("0");if(!e||!n)return n;const t=this._getSRKey(e);let s=this._clippingGeometry.get(t);return s!=null||(s=e.equals(n.spatialReference)?n:Ae(n,e),this._clippingGeometry.set(t,s)),s}_hasSameStorageInfo(e,n){const{storageInfo:t,pixelSize:s,spatialReference:a,extent:r}=e,{storageInfo:o,pixelSize:l,spatialReference:c,extent:h}=n;return s.x===l.x&&s.y===l.y&&a.equals(c)&&r.equals(h)&&t.blockHeight===o.blockHeight&&t.blockWidth===o.blockWidth&&t.maximumPyramidLevel===o.maximumPyramidLevel}async _updateClipGeometry(){const e=this.rasterFunction.getClippingGeometries()[0];let n=e==null?void 0:e.clippingGeometry;if(n&&e.clippingType==="inside"){const{extent:t}=this.rasterInfo,{difference:s,densify:a}=await He(()=>import("./geometryEngine-DD4bBRnV.js"),__vite__mapDeps([0,1,2,3,4]));let r=a(Mt.fromExtent(t),2*(t.width+t.height)/as);r=Ae(r,n.spatialReference),n=s(r,n)}this._clippingGeometry.clear(),n&&this._clippingGeometry.set("0",n)}_getSRKey(e){return String(e.wkid??e.wkt??e.wkt2)}};I([v({type:String,json:{write:!0}})],ne.prototype,"datasetFormat",void 0),I([v()],ne.prototype,"tileType",void 0),I([v()],ne.prototype,"rasterFunction",void 0),I([v()],ne.prototype,"primaryRasters",void 0),ne=I([K("esri.layers.support.rasterDatasets.FunctionRaster")],ne);const It=ne,os=i=>{let e=class extends i{constructor(...t){var s,a;super(...t),this._isConstructedFromFunctionRaster=!1,this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this.bandIds=null,this.copyright=null,this.interpolation="nearest",this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=((a=(s=t[0])==null?void 0:s.raster)==null?void 0:a.datasetFormat)==="Function"}get fullExtent(){var t;return(t=this.serviceRasterInfo)==null?void 0:t.extent}set multidimensionalDefinition(t){this._set("multidimensionalDefinition",t),this.updateRenderer()}set rasterFunction(t){var s;((s=t==null?void 0:t.functionName)==null?void 0:s.toLowerCase())==="none"&&(t=void 0),this._set("rasterFunction",t),this.updateRasterFunction()}get rasterInfo(){return Pt(le.getLogger(this),"rasterInfo",{replacement:"serviceRasterInfo",version:"4.29",warnOnce:!0}),this._get("serviceRasterInfo")}set url(t){this._set("url",ht(t,le.getLogger(this)))}set renderer(t){t==null&&this.rasterFunction==null?this._configDefaultRenderer("override"):(this._set("renderer",t),this.updateRenderer())}readRenderer(t,s,a){var o,l;const r=(l=(o=s==null?void 0:s.layerDefinition)==null?void 0:o.drawingInfo)==null?void 0:l.renderer;return ai(r,a)||void 0}async convertVectorFieldData(t,s){const{serviceRasterInfo:a}=this;if(t==null||!a)return null;const r=this._rasterJobHandler.instance,o=a.dataType;return r?r.convertVectorFieldData({pixelBlock:t,dataType:o},s):Bi(t,o)}async computeStatisticsHistograms(t,s){t=Le(oi,t).clone();const{serviceRasterInfo:a}=this,{geometry:r}=t;if(r==null)throw new O("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let o=r;const{spatialReference:l}=a;r.spatialReference.equals(l)||(await Je(),o=r.type==="extent"?ve(r,l):Ae(r,l));const c=t.pixelSize??new A({x:a.pixelSize.x,y:a.pixelSize.y,spatialReference:l}),{extent:h,width:u,height:m}=rs(a,o,c),f=await this.fetchPixels(h,u,m,{...s,interpolation:"nearest"});if(f.pixelBlock==null)throw new O("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const p=await ze(f.pixelBlock,h,o),g=this._rasterJobHandler.instance;return g?g.computeStatisticsHistograms({pixelBlock:p},s):Ge(p)}async createFlowMesh(t,s){const a=this._rasterJobHandler.instance;return a?a.createFlowMesh(t,s):Ei(t.meshType,t.simulationSettings,t.flowData,s.signal!=null?s.signal:new AbortController().signal)}normalizeRasterFetchOptions(t){var o,l;const{multidimensionalInfo:s}=this.serviceRasterInfo??{};if(s==null)return t;let a=t.multidimensionalDefinition||this.multidimensionalDefinition;a!=null&&a.length||(a=et(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset}));const r=t.timeExtent||this.timeExtent;if(a!=null&&r!=null&&(r.start!=null||r.end!=null)){a=a.map(y=>y.clone());const c=(l=(o=s.variables.find(({name:y})=>y===a[0].variableName))==null?void 0:o.dimensions)==null?void 0:l.find(({name:y})=>y==="StdTime"),h=a.find(({dimensionName:y})=>y==="StdTime");if(!c||!h)return{...t,multidimensionalDefinition:null};const{start:u,end:m}=r,f=u==null?null:u.getTime(),p=m==null?null:m.getTime(),g=f??p,d=p??f;if(c.values!=null){const y=c.values.filter(x=>{if(Array.isArray(x)){if(g===d)return x[0]<=g&&x[1]>=g;const w=x[0]<=g&&x[1]>g||x[0]=d,S=x[0]>=g&&x[1]<=d||x[0]d;return w||S}return g===d?x===g:x>=g&&x<=d});if(y.length){const x=y.sort((w,S)=>{const T=Array.isArray(w)?w[0]:w,b=Array.isArray(w)?w[1]:w,_=Array.isArray(S)?S[0]:S,k=Array.isArray(S)?S[1]:S;return g===d?T-_:Math.abs(b-d)-Math.abs(k-d)})[0];h.values=[x]}else a=null}else if(c.hasRegularIntervals&&c.extent){const[y,x]=c.extent;g>x||d1&&t.forEach(d=>f[d.url]=d);const p=wt(((u=r.functionDefinition)==null?void 0:u.toJSON())??r.toJSON(),f),g=new It({rasterFunction:p});g.rasterJobHandler=this._rasterJobHandler.instance,await g.open(),this._cachedRasterFunctionJson=(m=this.rasterFunction)==null?void 0:m.toJSON(),this.raster=g}else this.raster=s,this._cachedRasterFunctionJson=null,await s.when();if(this._cachedRendererJson=null,!a&&!r)return;const{bandIds:o}=this,{bandCount:l}=this.raster.rasterInfo,c=o!=null&&o.length?o.some(f=>f>=l):l>=3;o&&(c||this.renderer&&this.renderer.type!=="raster-stretch")&&this._set("bandIds",null),this._configDefaultRenderer("auto")}async updateRenderer(){const{loaded:t,symbolizer:s}=this;if(!t||!s||!this.renderer)return;const{rasterInfo:a}=this.raster,r=tt(a,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),o=r==null?void 0:r.name,l=Ke({...this.renderer.toJSON(),variableName:o});if(JSON.stringify(this._cachedRendererJson)===JSON.stringify(l))return;const c=this._rasterJobHandler.instance;c&&(s.rasterInfo=Qe(a,o),s.rendererJSON=l,s.bind(),await c.updateSymbolizer(s),this._cachedRendererJson=l)}async applyRenderer(t,s){const a=t==null?void 0:t.pixelBlock;if(!(a!=null&&a.pixels&&a.pixels.length>0))return null;let r;await this.updateRenderer();const o=this._rasterJobHandler.instance,l=this.bandIds??[];return r=o?await o.symbolize({...t,simpleStretchParams:s,bandIds:l}):this.symbolizer.symbolize({...t,simpleStretchParams:s,bandIds:l}),r}getTileUrl(t,s,a){return this.raster.datasetFormat==="RasterTileServer"?`${this.url}/tile/${t}/${s}/${a}`:""}getCompatibleTileInfo(t,s,a=!1){if(!this.loaded||s==null)return null;if(a&&t.equals(this.spatialReference))return this.tileInfo;const r=Ot(t);return te.create({size:256,spatialReference:t,origin:r?{x:r.origin[0],y:r.origin[1]}:{x:s.xmin,y:s.ymax}})}getCompatibleFullExtent(t){return this.loaded?(this._compatibleFullExtent&&this._compatibleFullExtent.spatialReference.equals(t)||(this._compatibleFullExtent=this.raster.computeExtent(t)),this._compatibleFullExtent):null}async fetchTile(t,s,a,r={}){var l;if(n(this),r.requestAsImageElement){const c=this.getTileUrl(t,s,a);return ft(c,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:r.signal}).then(h=>h.data)}const{serviceRasterInfo:o}=this;if(o.multidimensionalInfo!=null&&(r=this.normalizeRasterFetchOptions(r)).multidimensionalDefinition==null){const c=r.tileInfo||o.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(t,s,a,c),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),((l=this.renderer)==null?void 0:l.type)==="raster-shaded-relief"&&(r={...r,buffer:{cols:1,rows:1}}),this.raster.fetchTile(t,s,a,r)}async fetchPixels(t,s,a,r={}){return this.serviceRasterInfo.multidimensionalInfo!=null&&(r=this.normalizeRasterFetchOptions(r)).multidimensionalDefinition==null?{extent:t,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),s=Math.round(s),a=Math.round(a),this.raster.fetchPixels(t,s,a,r))}async identify(t,s={}){var l;const{raster:a,serviceRasterInfo:r}=this;if(r.multidimensionalInfo!=null&&!(r.hasMultidimensionalTranspose&&(yt(s.multidimensionalDefinition)||s.transposedVariableName||s.timeExtent))&&(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition==null)return{location:t,value:null};const o=(l=this.multidimensionalSubset)==null?void 0:l.areaOfInterest;if(o&&!o.contains(t))throw new O("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");return a.identify(t,s)}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}hasStandardTime(){var r,o,l;const t=(r=this.serviceRasterInfo)==null?void 0:r.multidimensionalInfo;if(t==null||((o=this.serviceRasterInfo)==null?void 0:o.dataType)!=="standard-time")return!1;const s=this.multidimensionalDefinition,a=(l=s==null?void 0:s[0])==null?void 0:l.variableName;return t.variables.some(c=>c.name===a&&(!(s!=null&&s[0].dimensionName)||c.dimensions.some(h=>h.name==="StdTime")))}getStandardTimeValue(t){return new Date(24*(t-25569)*3600*1e3).toString()}getMultidimensionalSubsetVariables(t){var a;const s=t??((a=this.serviceRasterInfo)==null?void 0:a.multidimensionalInfo);return gi(this.multidimensionalSubset,s)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=et(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&this.raster.datasetFormat==="Function"&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}_initJobHandler(){if(this._rasterJobHandler.connectionPromise!=null)return this._rasterJobHandler.connectionPromise;const t=new ui;return this._rasterJobHandler.connectionPromise=t.initialize().then(async()=>{n(this),this._rasterJobHandler.instance=t,this.raster.rasterJobHandler=t,this.raster.datasetFormat==="Function"&&this.raster.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch(()=>{}),this.renderer&&this.updateRenderer()}).catch(()=>{}),this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null,this.raster&&(this.raster.rasterJobHandler=null)}_configDefaultInterpolation(){var t;if(this.interpolation==null){n(this);const{raster:s}=this,a=li(s.rasterInfo,s.tileType,(t=this.sourceJSON)==null?void 0:t.defaultResamplingMethod);this._set("interpolation",a)}}_configDefaultRenderer(t="no"){var h,u;n(this);const{rasterInfo:s}=this.raster;!this.bandIds&&s.bandCount>1&&(this.bandIds=ci(s));const a=tt(s,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),r=a==null?void 0:a.name;if(!this.renderer||t==="override"){const m=Ze(s,{bandIds:this.bandIds,variableName:r}),f=s.statistics,p=f&&f.length>0?f[0]:null,g=(p==null?void 0:p.max)??0,d=(p==null?void 0:p.min)??0;this.raster.datasetFormat==="WCSServer"&&m.type==="raster-stretch"&&(g>1e24||d<-1e24)&&(m.dynamicRangeAdjustment=!0,m.statistics=null,m.stretchType==="none"&&(m.stretchType="min-max")),this.renderer=m}const o=Ke({...this.renderer.toJSON(),variableName:r}),l=Qe(s,r);this.symbolizer?(this.symbolizer.rendererJSON=o,this.symbolizer.rasterInfo=l):this.symbolizer=new wi({rendererJSON:o,rasterInfo:l});const c=this.symbolizer.bind();if(c.success){if(t==="auto"){const{colormap:m}=this.raster.rasterInfo,f=this.renderer;if(m!=null&&f.type==="raster-colormap"){const p=Ze(this.raster.rasterInfo);JSON.stringify(p)!==JSON.stringify(f)&&this._configDefaultRenderer("override")}else if(f.type==="raster-stretch"){const p=(h=this.bandIds)==null?void 0:h.length,g=(u=f.statistics)==null?void 0:u.length;!f.dynamicRangeAdjustment&&g&&p&&g!==p&&this._configDefaultRenderer("override")}}}else le.getLogger(this).warn("imagery-tile-mixin",c.error||"The given renderer is not supported by the layer."),t==="auto"&&this._configDefaultRenderer("override")}};function n(t){if(!t.raster||!t.serviceRasterInfo)throw new O("imagery-tile","no raster")}return I([v({clonable:!1})],e.prototype,"_cachedRendererJson",void 0),I([v({clonable:!1})],e.prototype,"_cachedRasterFunctionJson",void 0),I([v({clonable:!1})],e.prototype,"_compatibleFullExtent",void 0),I([v({clonable:!1})],e.prototype,"_isConstructedFromFunctionRaster",void 0),I([v({clonable:!1})],e.prototype,"_rasterJobHandler",void 0),I([v()],e.prototype,"bandIds",void 0),I([v({json:{origins:{service:{read:{source:"copyrightText"}}}}})],e.prototype,"copyright",void 0),I([v({json:{read:!1}})],e.prototype,"fullExtent",null),I([v()],e.prototype,"interpolation",void 0),I([v()],e.prototype,"ioConfig",void 0),I([v({type:[We],json:{write:!0}})],e.prototype,"multidimensionalDefinition",null),I([v({type:si,json:{write:!0}})],e.prototype,"multidimensionalSubset",void 0),I([v()],e.prototype,"raster",void 0),I([v({type:Ee,json:{name:"renderingRule",write:!0}})],e.prototype,"rasterFunction",null),I([v({readOnly:!0})],e.prototype,"rasterInfo",null),I([v()],e.prototype,"serviceRasterInfo",void 0),I([v()],e.prototype,"sourceJSON",void 0),I([v({readOnly:!0,type:L,json:{read:!1}})],e.prototype,"spatialReference",void 0),I([v({type:te})],e.prototype,"tileInfo",void 0),I([v(dt)],e.prototype,"url",null),I([v({types:ni,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){var s;const t=((s=this.renderer)==null?void 0:s.type)==="raster-stretch"&&this.renderer.stretchType==="none"&&!this.renderer.useGamma;return{enabled:!this.loaded||this.raster.tileType==="Raster"||!t}}},origins:{"web-scene":{types:ri,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:t=>({enabled:t&&t.type!=="vector-field"&&t.type!=="flow"})}}}}})],e.prototype,"renderer",null),I([Ct("renderer")],e.prototype,"readRenderer",null),I([v({clonable:!1})],e.prototype,"symbolizer",void 0),e=I([K("esri.layers.ImageryTileMixin")],e),e};function ls(i){const e=i.fields,n=i.records,t=e.some(c=>c.name.toLowerCase()==="oid")?"OBJECTID":"OID",s=[{name:t,type:"esriFieldTypeOID",alias:"OID"}].concat(e.map(c=>({name:c.name,type:"esriFieldType"+c.typeName,alias:c.name}))),a=s.map(c=>c.name),r=[];let o=0,l=0;return n.forEach(c=>{const h={};for(h[t]=o++,l=1;l0)for(;h.lengthr;){const m=[];n.getUint8(l)===32?(l+=1,c.forEach(f=>{if(f.type==="C")m.push(it(new Uint8Array(e,l,f.length)).trim());else if(f.type==="N")m.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,l,f.length)).trim(),10));else if(f.type==="F")m.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,l,f.length)).trim()));else if(f.type==="D"){const p=String.fromCharCode.apply(null,new Uint8Array(e,l,f.length)).trim();m.push(new Date(parseInt(p.substring(0,4),10),parseInt(p.substring(4,6),10)-1,parseInt(p.substring(6,8),10)))}l+=f.length}),h.push(m)):l+=r}}return{header:o,fields:c,records:h,recordSet:ls({fields:c,records:h})}}};const re=new Map;re.set("int16","esriFieldTypeSmallInteger"),re.set("int32","esriFieldTypeInteger"),re.set("int64","esriFieldTypeInteger"),re.set("float32","esriFieldTypeSingle"),re.set("float64","esriFieldTypeDouble"),re.set("text","esriFieldTypeString");const ct=8;let de=class extends se{constructor(){super(...arguments),this.storageInfo=null,this.datasetFormat="CRF"}async open(e){await this.init();const{data:n}=await this.request(this.url+"/conf.json",{signal:e==null?void 0:e.signal});if(!this._validateHeader(n))throw new O("cloudraster:open","Invalid or unsupported conf.json.");this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const{storageInfo:t,rasterInfo:s}=this._parseHeader(n);if(s.dataType==="thematic"){const a=await this._fetchAuxiliaryInformation();s.attributeTable=a}this._set("storageInfo",t),this._set("rasterInfo",s),this.ioConfig.retryCount=this.ioConfig.retryCount||0}async fetchRawTile(e,n,t,s={}){const{transposeInfo:a}=this.rasterInfo.storageInfo,{transposedVariableName:r}=s,o=!(!a||!r),l=o?0:this.rasterInfo.storageInfo.maximumPyramidLevel-e;if(l<0)return null;const c=this._buildCacheFilePath(l,n,t,s.multidimensionalDefinition,r),h=this._getIndexRecordFromBundle(n,t,o),u=await this.request(c,{range:{from:0,to:this.storageInfo.headerSize-1},responseType:"array-buffer",signal:s.signal});if(!u)return null;const m=new Uint8Array(u.data),f=this._getTileEndAndContentType(m,h);if(f.recordSize===0)return null;const p=await this.request(c,{range:{from:f.position,to:f.position+f.recordSize},responseType:"array-buffer",signal:s.signal});if(!p)return null;const[g,d]=this._getTileSize(o);return this.decodePixelBlock(p.data,{width:g,height:d,planes:null,pixelType:null,returnInterleaved:o})}_validateHeader(e){const n=["origin","extent","geodataXform","LODInfos","blockWidth","blockHeight","bandCount","pixelType","pixelSizeX","pixelSizeY","format","packetSize"];return e&&e.type==="RasterInfo"&&!n.some(t=>!e[t])}_parseHeader(e){var H,W,q,ee,U;const n=["u1","u2","u4","u8","s8","u16","s16","u32","s32","f32","f64"][e.pixelType],{bandCount:t,colormap:s,blockWidth:a,blockHeight:r,firstPyramidLevel:o,maximumPyramidLevel:l}=e,c=(H=e.statistics)==null?void 0:H.map(N=>({min:N.min,max:N.max,avg:N.mean,stddev:N.standardDeviation,median:N.median,mode:N.mode})),h=(ee=(q=(W=e.histograms)==null?void 0:W[0])==null?void 0:q.counts)!=null&&ee.length?e.histograms:null,u=e.extent.spatialReference,m=(U=e.geodataXform)==null?void 0:U.spatialReference,f=new L(u!=null&&u.wkid||u!=null&&u.wkt||u!=null&&u.wkt2?u:m);let p=new z({xmin:e.extent.xmin,ymin:e.extent.ymin,xmax:e.extent.xmax,ymax:e.extent.ymax,spatialReference:f});const g=new A({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:f}),d=Math.round((p.xmax-p.xmin)/g.x),y=Math.round((p.ymax-p.ymin)/g.y),x=this._parseTransform(e.geodataXform),w=x?p:null;x&&(p=x.forwardTransform(p),g.x=(p.xmax-p.xmin)/d,g.y=(p.ymax-p.ymin)/y);const S=e.properties??{},T=e.format.toLowerCase().replace("cache/",""),b=new A(e.origin.x,e.origin.y,f);let _,k,R,F;if(s!=null&&s.colors)for(_=[],k=0;k>>24,R<<8>>>24,R>>>24]);const M=e.LODInfos,P=[];for(k=0;k0)for(k=0;kr.data).catch(()=>null),t=this.request(this.url+"/conf.vat.dbf",{responseType:"array-buffer",signal:e}).then(r=>r.data).catch(()=>null),s=await Promise.all([n,t]);let a;if(s[0]){let r=s[0].fields;const o=s[0].values;if(r&&o){r=r.map(c=>({type:c.name==="OID"?"esriFieldTypeOID":re.get(c.type),name:c.name,alias:c.alias||c.name}));const l=o.map(c=>({attributes:c}));r&&o&&(a={fields:r,features:l})}}return!a&&s[1]&&(a=bt.parse(s[1]).recordSet),_e.fromJSON(a)}_buildCacheFilePath(e,n,t,s,a){const r=this._getPackageSize(!!a),o=Math.floor(n/r)*r,l=Math.floor(t/r)*r,c="R"+this._toHexString4(o)+"C"+this._toHexString4(l);let h="L";h+=e>=10?e.toString():"0"+e.toString();const{multidimensionalInfo:u}=this.rasterInfo,m=s==null?void 0:s[0];if(u==null||!m)return`${this.url}/_alllayers/${h}/${c}.bundle`;let f="_yxs";if(!a){f=u.variables.find(d=>d.name===m.variableName).dimensions[0].values.indexOf(m.values[0]).toString(16);const g=4-f.length;for(let d=0;d0;)n="0"+n}return n}};I([v({readOnly:!0})],de.prototype,"storageInfo",void 0),I([v({type:String,json:{write:!0}})],de.prototype,"datasetFormat",void 0),de=I([K("esri.layers.support.rasterDatasets.CloudRaster")],de);const cs=de;function St(i){return["x","e","east","long","longitude"].includes(i.toLowerCase())}function Rt(i){return["y","n","west","lat","latitude"].includes(i.toLowerCase())}function us(i){const{axes:e}=i.domain,n=Object.keys(e),t=[],s=[];let a=-1,r=-1,o=[];for(let x=0;xT.push(typeof _=="string"?new Date(_).getTime():_));const b=T[1]-T[0];t.push([T[0]-.5*b,T[T.length-1]+.5*b]),s.push(b)}else{const{start:b,stop:_,num:k}=S,R=(_-b)/(k-1);t.push([b-.5*R,_+.5*R]),s.push(R);for(let F=0;F-1&&r===-1?r=a===0?1:0:r>-1&&a===-1?a=r===0?1:0:r===-1&&a===-1&&(a=0,r=1),o=o.filter((x,w)=>!(w===a||w===r));const{referencing:l}=i.domain,c=l.find(x=>x.coordinates.includes(n[a])).system.id,h=c==null?void 0:c.slice(c.lastIndexOf("/")+1),u=h==null||h==="CRS84"?4326:Number(h),m=new L({wkid:u}),[f,p]=t[a],[g,d]=t[r],y=new z({xmin:f,xmax:p,ymin:g,ymax:d,spatialReference:m});return{width:Math.round(y.width/s[a]),height:Math.round(y.height/s[r]),extent:y,dimensions:o}}function Ce(i){const e=$t();return e?i[e]??Object.values(i)[0]:Object.values(i)[0]}function Pe(){return Math.round(255*Math.random())}function hs(i){var t,s;const e={},{parameters:n}=i;if(!n)return e;for(const[a,r]of Object.entries(n)){const{type:o,description:l,unit:c,categoryEncoding:h,observedProperty:u}=r;if(o==="Parameter"&&(e[a]={},l&&(e[a].description=Ce(l)),c&&(e[a].unit=c.label?Ce(c.label):null,e[a].symbol=(t=c.symbol)==null?void 0:t.value),h)){const m=Object.entries(h).map((g,d)=>({OID:d,Value:Number(g[1]),ClassName:g[0].slice(g[0].lastIndexOf("/")+1),Count:1}));let f=!1;(s=u==null?void 0:u.categories)!=null&&s.length&&(u.categories.forEach(g=>{if(!g.id)return;const d=g.id.slice(g.id.lastIndexOf("/")+1),y=m.find(w=>w.ClassName===d);if(!y)return;const x=g.label?Ce(g.label):null;if(y.Label=x,g.preferredColor){const w=Dt.fromHex(g.preferredColor);w&&(f=!0,y.Red=w.r,y.Green=w.g,y.Blue=w.b)}}),f&&m.forEach(g=>{g.Red==null&&(g.Red=Pe(),g.Green=Pe(),g.Blue=Pe())}));const p={objectIdFieldName:"",fields:[{name:"OID",type:"esriFieldTypeOID",alias:"OID",domain:null},{name:"Value",type:"esriFieldTypeInteger",alias:"Value",domain:null},{name:"Count",type:"esriFieldTypeDouble",alias:"Count",domain:null},{name:"ClassName",type:"esriFieldTypeString",alias:"ClassName",domain:null,length:50},{name:"Label",type:"esriFieldTypeString",alias:"Label",domain:null,length:50}],features:m.map(g=>({attributes:g}))};f&&p.fields.push({name:"Red",type:"esriFieldTypeInteger",alias:"Red",domain:null},{name:"Green",type:"esriFieldTypeInteger",alias:"Green",domain:null},{name:"Blue",type:"esriFieldTypeInteger",alias:"Blue",domain:null}),e[a].attributeTable=p}}return e}function fs(i){let e=Number.MAX_VALUE,n=-Number.MAX_VALUE;for(let t=0;tn&&(n=s))}return Ji(e,n)}function ms(i,e,n){const t=i.map((l,c)=>({name:l,count:e[c]})).sort((l,c)=>l.name>c.name?-1:1),s=(a=1,l=>a*=l.count);var a;const r=[...t.slice(1),{name:"",count:1}].reverse().map(s).reverse();let o=0;for(let l=i.length-1;l>=0;l--)o+=r[t.findIndex(({name:c})=>c===i[l])]*(n%e[l]),n=Math.floor(n/e[l]);return o}function ds(i){var m;const{width:e,height:n,extent:t,dimensions:s}=us(i),{ranges:a}=i,r=Object.keys(a).sort((f,p)=>fl[f.name]&&Object.assign(f,l[f.name]));const c=o.length?{variables:o}:void 0,h=[];for(let f=0;f2?f*x.slice(0,-2).reduce((R,F)=>R*F):0,S=y.slice(0,-2),T=x.slice(0,-2),b=d==="float"?"f32":fs(g),_=e*n,k=g.length/_;for(let R=0;Rf.attributeTable))==null?void 0:m.attributeTable;return{extent:t,pixelBlocks:h,multidimensionalInfo:c,attributeTable:u,bandNames:c?void 0:r}}let ce=class extends se{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.source=null}get url(){return""}async open(i){await this.init();const e=this.source,{pixelBlocks:n,attributeTable:t,statistics:s,histograms:a,name:r,nativeExtent:o,transform:l}=e,c=n[0],{width:h,height:u,pixelType:m}=c,f=e.extent??new z({xmin:-.5,ymin:.5,xmax:h-.5,ymax:u-.5,spatialReference:new L({wkid:3857})}),p=e.isPseudoSpatialReference??!e.extent,g={x:f.width/h,y:f.height/u},d={...e.keyProperties};t&&(d.DataType="Thematic");const y=new xe({width:h,height:u,pixelType:m,extent:f,nativeExtent:o,attributeTable:t,transform:l,pixelSize:g,spatialReference:f.spatialReference,bandCount:c.pixels.length,keyProperties:d,multidimensionalInfo:e.multidimensionalInfo,statistics:s,isPseudoSpatialReference:p,histograms:a});this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(y),this.createRemoteDatasetStorageInfo(y,512,512),this._set("rasterInfo",y),this.updateTileInfo(),y.multidimensionalInfo?await this._buildMDimStats(e.pixelBlocks,y.multidimensionalInfo):await this._buildInMemoryRaster(c,{width:512,height:512},i),y.multidimensionalInfo||(this.source=null),this.datasetName=r}fetchRawTile(i,e,n,t={}){if(!this._pixelBlockTiles){const{rasterInfo:a}=this,[r,o]=a.storageInfo.tileInfo.size,{sliceId:l}=t,{pixelBlocks:c}=this.source,h={pixelBlock:l==null?c[0]:c[l],useBilinear:a.dataType!=="thematic",tileSize:{width:r,height:o},level:i,row:e,col:n},u=this.rasterJobHandler?this.rasterJobHandler.clipTile(h,t):Ai(h);return Promise.resolve(u)}const s=this._pixelBlockTiles.get(`${i}/${e}/${n}`);return Promise.resolve(s)}async _buildInMemoryRaster(i,e,n){var u,m;const{rasterInfo:t}=this,s=t.storageInfo.maximumPyramidLevel??0,a=t.dataType!=="thematic",r=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:i,tileSize:e,maximumPyramidLevel:s,useBilinear:a},n):Promise.resolve(zi(i,e,s,a)),o=t.statistics!=null,l=t.histograms!=null,c=this.ioConfig.skipStatistics||o?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:i},n):Promise.resolve(Ii(i)),h=await pt([r,c]);if(!h[0].value&&h[1].value)throw new O("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=h[0].value,o||(t.statistics=(u=h[1].value)==null?void 0:u.statistics),l||(t.histograms=(m=h[1].value)==null?void 0:m.histograms)}async _buildMDimStats(i,e,n){for(let t=0;t{var h,u;return new We({variableName:s.name,dimensionName:c.name,values:[((h=c.values)==null?void 0:h[0])??((u=c.extent)==null?void 0:u[0])],isSlice:!0})}),r=gt(a,e),o=r==null?null:i[r];if(o==null)continue;const l=this.rasterJobHandler?await this.rasterJobHandler.computeStatisticsHistograms({pixelBlock:o},n):Ge(o);s.statistics=l.statistics,s.histograms||(s.histograms=l.histograms)}}};I([v({type:String,json:{write:!0}})],ce.prototype,"datasetFormat",void 0),I([v()],ce.prototype,"source",void 0),I([v()],ce.prototype,"url",null),ce=I([K("esri.layers.support.rasterDatasets.InMemoryRaster")],ce);const Ue=ce;let pe=class extends se{constructor(){super(...arguments),this.datasetFormat="CovJSON"}async open(e){await this.init();const{extent:n,pixelBlocks:t,multidimensionalInfo:s,attributeTable:a,bandNames:r}=await this._fetchData(e),{statistics:o,histograms:l}=Ge(t[0]),c=r==null?void 0:r.map(f=>({BandName:f})),h={DataType:a?"Thematic":s?"Scientific":"Generic",BandProperties:c},u=new Ue({source:{extent:n,pixelBlocks:t,attributeTable:a?_e.fromJSON(a):null,multidimensionalInfo:s,statistics:o,histograms:l,keyProperties:h,isPseudoSpatialReference:!1}});await u.open(),this._inMemoryRaster=u;const m=this.source?"":this.url.slice(this.url.lastIndexOf("/")+1);this._set("datasetName",m.slice(0,m.indexOf("."))),this._set("rasterInfo",u.rasterInfo)}fetchRawTile(e,n,t,s={}){return this._inMemoryRaster.fetchRawTile(e,n,t,s)}async _fetchData(e){var a,r,o,l;const n=this.source??(await this.request(this.url,{signal:e==null?void 0:e.signal})).data,t="imagery-tile-layer:open-coverage-json";if(((a=n.type)==null?void 0:a.toLowerCase())!=="coverage"||((o=(r=n.domain)==null?void 0:r.domainType)==null?void 0:o.toLowerCase())!=="grid")throw new O(t,"Only coverage with Grid domain type is supported");if(!n.ranges)throw new O(t,"Missing ranges in the grid coverage data");if(!((l=n.domain.referencing)!=null&&l.length))throw new O(t,"Missing domain referencing in the grid coverage data");const s=Object.values(n.ranges);for(let c=0;ct.push(o));return t}const s=i.getElementsByTagNameNS("*",n);if(!s||s.length===0)return[];for(let a=0;a0?e?V(t[0],e):t[0]:null}function Z(i,e=null){const n=e?V(i,e):i;let t;return n?(t=n.textContent||n.nodeValue,t?t.trim():null):null}function ys(i,e){const n=fe(i,e),t=[];let s;for(let a=0;aNumber(n))}function oe(i,e){const n=Z(i,e);return Number(n)}function Oe(i,e){var s;const n=(s=i==null?void 0:i.nodeName)==null?void 0:s.toLowerCase(),t=e.toLowerCase();return n.slice(n.lastIndexOf(":")+1)===t}function ut(i,e){if(!i||!e)return null;const n=[];for(let t=0;tNumber(f));let o,l,c,h;fe(i,"Metadata/MDI").forEach(f=>{const p=Number(f.textContent??f.nodeValue);switch(f.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":o=p;break;case"STATISTICS_MAXIMUM":l=p;break;case"STATISTICS_MEAN":c=p;break;case"STATISTICS_STDDEV":h=p}});const u=oe(i,"Metadata/SourceBandIndex");return{noDataValue:e,histogram:r!=null&&r.length&&t!=null&&s!=null?{min:t,max:s,size:a||r.length,counts:r}:null,sourceBandIndex:u,statistics:o!=null&&l!=null?{min:o,max:l,avg:c,stddev:h}:null}}function ke(i){if(!i)return null;let e=Number(i);if(!isNaN(e)&&e!==0)return new L({wkid:e});if(i=String(i).trim(),Nt(i))return new L({wkt2:i});const n=i.toUpperCase();if(n.startsWith("COMPD_CS")){if(!n.includes("VERTCS")||!n.includes("GEOGCS")&&!n.startsWith("PROJCS"))return null;const t=n.indexOf("VERTCS"),s=n.indexOf("PROJCS"),a=s>-1?s:n.indexOf("GEOGCS");if(a===-1)return null;const r=i.slice(a,i.lastIndexOf("]",t)+1).trim(),o=i.slice(t,i.lastIndexOf("]")).trim();e=De(r);const l=new L(e?{wkid:e}:{wkt:r}),c=De(o);return c&&(l.vcsWkid=c),l}return n.startsWith("GEOGCS")||n.startsWith("PROJCS")?(e=De(i),new L(e!==0?{wkid:e}:{wkt:i})):null}function De(i){var s;const e=i.replaceAll("]","[").replaceAll('"',"").split("[").map(a=>a.trim()).filter(a=>a!==""),n=e[e.length-1].split(","),t=(s=n[0])==null?void 0:s.toLowerCase();if((t==="epsg"||t==="esri")&&i.endsWith('"]]')){const a=Number(n[1]);if(!isNaN(a)&&a!==0)return a}return 0}function Ve(i){var t;if(((t=i==null?void 0:i.documentElement.tagName)==null?void 0:t.toLowerCase())!=="pamdataset")return{};const e={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};i.documentElement.childNodes.forEach(s=>{if(s.nodeType===1){if(Oe(s,"SRS")){if(!e.spatialReference){const a=Z(s);e.spatialReference=ke(a)}}else if(Oe(s,"Metadata"))if(s.getAttribute("domain")==="xml:ESRI"){const{spatialReference:a,transform:r}=gs(s);e.transform=r,e.spatialReference||(e.spatialReference=a)}else fe(s,"MDI").forEach(a=>e.metadata[a.getAttribute("key")]=Z(a));else if(Oe(s,"PAMRasterBand")){const a=xs(s);a.sourceBandIndex!=null&&e.rasterBands[a.sourceBandIndex]==null?e.rasterBands[a.sourceBandIndex]=a:e.rasterBands.push(a)}}});const n=e.rasterBands;if(n.length){const s=!!n[0].statistics;e.statistics=s?n.map(r=>r.statistics).filter(Be):null;const a=!!n[0].histogram;e.histograms=a?n.map(r=>r.histogram).filter(Be):null}return e}let Te=class extends se{async open(i){await this.init();const e=await this._fetchData(i);let{spatialReference:n,statistics:t,histograms:s,transform:a}=await this._fetchAuxiliaryData(i);const r=!n;r&&(n=new L({wkid:3857})),s!=null&&s.length&&t==null&&(t=je(s));const{width:o,height:l}=e;let c=new z({xmin:-.5,ymin:.5-l,xmax:o-.5,ymax:.5,spatialReference:n});const h=a?a.forwardTransform(c):c;let u=!0;if(a){const f=a.forwardCoefficients;u=f&&f[1]===0&&f[2]===0,u&&(a=null,c=h)}const m=new Ue({source:{extent:h,nativeExtent:c,transform:a,pixelBlocks:[e],statistics:t,histograms:s,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:r},ioConfig:{sampling:"closest",skipStatistics:!0}});this.ioConfig.skipMapInfo&&(m.ioConfig.skipMapInfo=!0),await m.open(),m.source=null,this._set("rasterInfo",m.rasterInfo),this._inMemoryRaster=m}fetchRawTile(i,e,n,t={}){return this._inMemoryRaster.fetchRawTile(i,e,n,t)}async _fetchData(i){const{data:e}=await this.request(this.url,{responseType:"array-buffer",signal:i==null?void 0:i.signal}),n=bi(e).toUpperCase();if(n!=="JPG"&&n!=="PNG"&&n!=="GIF"&&n!=="BMP")throw new O("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",n);const t=n.toLowerCase(),s=t==="gif"||t==="bmp"||!Bt("ios"),a=await this.decodePixelBlock(e,{format:t,useCanvas:s,hasNoZlibMask:!0});if(a==null)throw new O("image-aux-raster:open","the data cannot be decoded");return a}async _fetchAuxiliaryData(i){var h;const e=i==null?void 0:i.signal,{skipExtensions:n=[],skipMapInfo:t}=this.ioConfig,s=t||n.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:e}),a=this.datasetFormat,r=a==="JPG"?"jgw":a==="PNG"?"pgw":a==="BMP"?"bpw":null,o=r&&n.includes(r)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+r,{responseType:"text",signal:e}),l=await pt([s,o]);if(e!=null&&e.aborted)throw Et();const c=Ve((h=l[0].value)==null?void 0:h.data);if(!c.transform){const u=l[1].value?l[1].value.data.split(` -`).slice(0,6).map(m=>Number(m)):null;c.transform=(u==null?void 0:u.length)===6?new qe({forwardCoefficients:[u[4],u[5],u[0],-u[1],u[2],-u[3]]}):null}return c}};I([v({type:String,json:{write:!0}})],Te.prototype,"datasetFormat",void 0),Te=I([K("esri.layers.support.rasterDatasets.ImageAuxRaster")],Te);const Re=Te;let ye=class extends se{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async open(i){var _,k;await this.init();const e=i==null?void 0:i.signal,n=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:e});n.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const t=n.data;if(this.sourceJSON=t,!t)throw new O("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!t.tileInfo)throw new O("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo();const s=["jpg","jpeg","png","png8","png24","png32","mixed"];this.tileType=t.cacheType,this.tileType==null&&(s.includes(t.tileInfo.format.toLowerCase())?this.tileType="Map":t.tileInfo.format.toLowerCase()==="lerc"?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=((_=t.name)==null?void 0:_.slice(t.name.indexOf("/")+1))??"";const a=await this._fetchRasterInfo({signal:e});if(a==null)throw new O("image-server-raster:open","cannot initialize image service");hi(a,t);const r=this.tileType==="Map"?ws(t.tileInfo,t):te.fromJSON(t.tileInfo);Jt(r);const[o,l]=this._computeMinMaxLOD(a,r),{extent:c,pixelSize:h}=a,u=.5/a.width*h.x,m=Math.max(h.x,h.y),{lods:f}=r;(this.tileType!=="Map"&&t.maxScale!==0||Math.abs(h.x-h.y)>u||!f.some(R=>Math.abs(R.resolution-m){R.level>=l.level&&R.level<=o.level&&y.push({x:R.resolution,y:R.resolution}),FR.x-F.x);const w=this.computeBlockBoundary(c,g,d,r.origin,y,p),S=y.length>1?y.slice(1):null;let T;t.transposeInfo&&(T={tileSize:[t.transposeInfo.rows,t.transposeInfo.cols],packetSize:((k=a.keyProperties)==null?void 0:k._yxs.PacketSize)??0});const b=x.length<=1||x.length>=3&&x.slice(0,-1).every(R=>R===x[0])?x[0]??2:Math.round(10/(l.resolution/o.resolution)**(-1/p))/10;if(a.storageInfo=new ge({blockWidth:r.size[0],blockHeight:r.size[1],pyramidBlockWidth:r.size[0],pyramidBlockHeight:r.size[1],pyramidResolutions:S,pyramidScalingFactor:b,compression:r.format,origin:r.origin,firstPyramidLevel:1,maximumPyramidLevel:p,tileInfo:r,transposeInfo:T,blockBoundary:w}),this._fixGCSShift(a),this._set("rasterInfo",a),t.capabilities.toLowerCase().includes("tilemap")){const R={tileInfo:a.storageInfo.tileInfo,parsedUrl:At(this.url),url:this.url,tileServers:[]};this._tilemapCache=new zt({layer:R})}}async fetchRawTile(i,e,n,t={}){const{storageInfo:s,extent:a}=this.rasterInfo,{transposeInfo:r}=s,o=r!=null&&!!t.transposedVariableName;if(this._slices&&!o&&t.sliceId==null)return null;const l=o?0:s.maximumPyramidLevel-i+this._levelOffset,c=`${this.url}/tile/${l}/${e}/${n}`,h=this._slices?o?{variable:t.transposedVariableName}:{sliceId:t.sliceId||0}:null,{data:u}=await this.request(c,{query:h,responseType:"array-buffer",signal:t.signal});if(!u)return null;const m=o?r.tileSize:s.tileInfo.size,f=await this.decodePixelBlock(u,{width:m[0],height:m[1],planes:null,pixelType:null,isPoint:this.tileType==="Elevation",returnInterleaved:o,noDataValue:this.rasterInfo.noDataValue});if(f==null)return null;const p=s.blockBoundary[i];if(s.compression!=="jpg"||n>p.minCol&&np.minRow&&e{const a=e.find(r=>s.variableName===r.variableName&&r.dimensionName===s.dimensionName);return a?(Array.isArray(s.values[0])?`${s.values[0][0]}-${s.values[0][1]}`:s.values[0])!==(Array.isArray(a.values[0])?`${a.values[0][0]}-${a.values[0][1]}`:a.values[0]):!0}))return n}return null}async fetchVariableStatisticsHistograms(i,e){var a,r,o;const n=this.request(this.url+"/statistics",{query:{variable:i,f:"json"},signal:e}).then(l=>{var c;return(c=l.data)==null?void 0:c.statistics}),t=this.request(this.url+"/histograms",{query:{variable:i,f:"json"},signal:e}).then(l=>{var c;return(c=l.data)==null?void 0:c.histograms}),s=await Promise.all([n,t]);return s[0]&&s[0].forEach(l=>{l.avg=l.mean,l.stddev=l.standardDeviation}),(o=(r=(a=s[1])==null?void 0:a[0])==null?void 0:r.counts)!=null&&o.length||(s[1]=null),{statistics:s[0]||null,histograms:s[1]||null}}async computeBestPyramidLevelForLocation(i,e={}){if(!this._tilemapCache)return 0;let n=this.identifyPixelLocation(i,0,e.datumTransformation);if(n===null)return null;let t=0;const{maximumPyramidLevel:s}=this.rasterInfo.storageInfo;let a=s-t+this._levelOffset;const r=n.srcLocation;for(;a>=0;){try{if(await this._tilemapCache.fetchAvailability(a,n.row,n.col,e)==="available")break}catch{}if(a--,t++,n=this.identifyPixelLocation(r,t,e.datumTransformation),n===null)return null}return a===-1||n==null?null:t}async _fetchRasterInfo(i){const e=this.sourceJSON;if(this.tileType==="Map"){const r=e.fullExtent||e.extent,o=Math.ceil((r.xmax-r.xmin)/e.pixelSizeX-.1),l=Math.ceil((r.ymax-r.ymin)/e.pixelSizeY-.1),c=L.fromJSON(e.spatialReference||r.spatialReference),h=new A({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:c});return new xe({width:o,height:l,bandCount:3,extent:z.fromJSON(r),spatialReference:c,pixelSize:h,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const{signal:n}=i,t=fi(this.url,this.sourceJSON,{signal:n,query:this.ioConfig.customFetchParameters}),s=e.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:n}).then(r=>{var o;return(o=r.data)==null?void 0:o.slices}).catch(()=>null):null,a=await Promise.all([t,s]);return this._slices=a[1],a[0]}_fixScaleInServiceInfo(){const{sourceJSON:i}=this;i.minScale&&i.minScale<0&&(i.minScale=0),i.maxScale&&i.maxScale<0&&(i.maxScale=0)}_fixGCSShift(i){const{extent:e,spatialReference:n}=i;e.xmin>-1&&e.xmax>181&&(n!=null&&n.wkid)&&n.isGeographic&&(i.nativeExtent=i.extent,i.transform=new Vi,i.extent=i.transform.forwardTransform(e))}_computeMinMaxLOD(i,e){const{pixelSize:n}=i,t=.5/i.width*n.x,{lods:s}=e,a=e.lodAt(Math.max.apply(null,s.map(m=>m.level))),r=e.lodAt(Math.min.apply(null,s.map(m=>m.level))),{tileType:o}=this;if(o==="Map")return this._levelOffset=s[0].level,[a,r];if(o==="Raster")return[s.find(m=>m.resolution===n.x)??a,r];const{minScale:l,maxScale:c}=this.sourceJSON;let h=a;c>0&&(h=s.find(m=>Math.abs(m.scale-c)m.scale>c).sort((m,f)=>m.scale>f.scale?1:-1)[0]??a));let u=r;return l>0&&(u=s.find(m=>Math.abs(m.scale-l)r!=null&&r>=s&&r<=a)});if(n!==0&&t!==0){const r=c=>Math.round(1e4*c)/1e4,o=n?r(n):1/0,l=t?r(t):-1/0;return te.fromJSON({...i,lods:i.lods.filter(c=>{const h=r(c.scale);return h<=o&&h>=l})})}return te.fromJSON(i)}I([v({type:String,json:{write:!0}})],ye.prototype,"datasetFormat",void 0),I([v()],ye.prototype,"tileType",void 0),ye=I([K("esri.layers.support.rasterDatasets.ImageServerRaster")],ye);const Is=ye,Q=new Map;Q.set("Int8","s8"),Q.set("UInt8","u8"),Q.set("Int16","s16"),Q.set("UInt16","u16"),Q.set("Int32","s32"),Q.set("UInt32","u32"),Q.set("Float32","f32"),Q.set("Float64","f32"),Q.set("Double64","f32");const ie=new Map;ie.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),ie.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),ie.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),ie.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let ue=class extends se{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async open(i){await this.init(),this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const e=i?i.signal:null,n=await this.request(this.url,{responseType:"xml",signal:e}),{rasterInfo:t,files:s}=this._parseHeader(n.data),{skipMapInfo:a,skipExtensions:r=[]}=this.ioConfig;if(!r.includes("aux.xml")&&!a){const y=await this._fetchAuxiliaryData(i);y!=null&&(t.statistics=y.statistics??t.statistics,t.histograms=y.histograms,y.histograms&&t.statistics==null&&(t.statistics=je(y.histograms)))}a&&this.updateImageSpaceRasterInfo(t),this._set("rasterInfo",t),this._files=s;const o=await this.request(s.index,{responseType:"array-buffer",signal:e});this._storageIndex=this._parseIndex(o.data);const{blockWidth:l,blockHeight:c}=this.rasterInfo.storageInfo,h=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:u,height:m}=this.rasterInfo,f=[],p=this._getBandSegmentCount();let g=0,d=-1;for(;g0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=d),this.updateTileInfo()}async fetchRawTile(i,e,n,t={}){const{blockWidth:s,blockHeight:a,blockBoundary:r}=this.rasterInfo.storageInfo,o=r[i];if(!o||o.maxRowe||o.minCol>n)return null;const{bandCount:l,pixelType:c}=this.rasterInfo,{ranges:h,actualTileWidth:u,actualTileHeight:m}=this._getTileLocation(i,e,n);if(!h||h.length===0)return null;if(h[0].from===0&&h[0].to===0){const M=new Uint8Array(s*a);return new Y({width:s,height:a,pixels:null,mask:M,validPixelCount:0})}const{bandIds:f}=this.ioConfig,p=this._getBandSegmentCount(),g=[];let d=0;for(d=0;dM.data.byteLength).reduce((M,P)=>M+P),w=new Uint8Array(x),S=[];let T=0;for(d=0;d1e24)for(d=0;d1e-6&&(P[d]=1);else for(d=0;d0)throw new Error("invalid array buffer must be multiples of 16");let e,n,t,s,a,r;if(Si){for(n=new Uint8Array(i),s=new ArrayBuffer(i.byteLength),t=new Uint8Array(s),a=0;aparseFloat(M)))),V(i,"MRF_META/CachedSource"))throw new O("mrf:open","currently does not support MRF referencing other data files");const g=V(i,"MRF_META/GeoTags"),d=V(g,"BoundingBox");let y,x=!1;if(d!=null){const M=parseFloat(d.getAttribute("minx")),P=parseFloat(d.getAttribute("miny")),B=parseFloat(d.getAttribute("maxx")),C=parseFloat(d.getAttribute("maxy")),D=Z(g,"Projection")||"";let $=L.WGS84;if(D!=="LOCAL_CS[]")if(D.toLowerCase().startsWith("epsg:")){const E=Number(D.slice(5));isNaN(E)||E===0||($=new L({wkid:E}))}else $=ke(D)??L.WGS84;else x=!0,$=new L({wkid:3857});y=new z(M,P,B,C),y.spatialReference=$}else x=!0,y=new z({xmin:-.5,ymin:.5-s,xmax:t-.5,ymax:.5,spatialReference:new L({wkid:3857})});const w=V(i,"MRF_META/Rsets"),S=parseInt((w==null?void 0:w.getAttribute("scale"))||"2",10),T=y.spatialReference,b=new ge({origin:new A({x:y.xmin,y:y.ymax,spatialReference:T}),blockWidth:h,blockHeight:u,pyramidBlockWidth:h,pyramidBlockHeight:u,compression:r,pyramidScalingFactor:S}),_=new A({x:y.width/t,y:y.height/s,spatialReference:T}),k=new xe({width:t,height:s,extent:y,isPseudoSpatialReference:x,spatialReference:T,bandCount:a,pixelType:l,pixelSize:_,noDataValue:f,storageInfo:b}),R=Z(i,"datafile"),F=Z(i,"IndexFile");return{rasterInfo:k,files:{mrf:this.url,index:F||this.url.replace(".mrf",".idx"),data:R||this.url.replace(".mrf",ie.get(r).blobExtension)}}}async _fetchAuxiliaryData(i){try{const{data:e}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:i==null?void 0:i.signal});return Ve(e)}catch{return null}}};I([v()],ue.prototype,"_files",void 0),I([v()],ue.prototype,"_storageIndex",void 0),I([v({type:String,json:{write:!0}})],ue.prototype,"datasetFormat",void 0),ue=I([K("esri.layers.support.rasterIO.MRFRaster")],ue);const bs=ue,$e=(i,e)=>{var n;return(n=i.get(e))==null?void 0:n.values},me=(i,e)=>{var n,t;return(t=(n=i.get(e))==null?void 0:n.values)==null?void 0:t[0]};let ae=class extends se{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this.datasetFormat="TIFF"}async open(i){var g,d,y,x;await this.init();const e=i?i.signal:null,{data:n}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:e});if(!n)throw new O("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const{littleEndian:t,firstIFDPos:s,isBigTiff:a}=Ri(n),r=[];await this._readIFDs(r,n,t,s,0,a?8:4,e);const{imageInfo:o,rasterInfo:l}=this._parseIFDs(r),c=vi(r),h=Ti(r);if(this._headerInfo={littleEndian:t,isBigTiff:a,ifds:r,pyramidIFDs:c,maskIFDs:h,...o},this._set("rasterInfo",l),!o.isSupported)throw new O("tiffraster:open","this tiff is not supported: "+o.message);if(!o.tileWidth)throw new O("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");l.isPseudoSpatialReference&&le.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");const u=(d=(g=r[0].get("PREDICTOR"))==null?void 0:g.values)==null?void 0:d[0];if(((x=(y=r[0].get("SAMPLEFORMAT"))==null?void 0:y.values)==null?void 0:x[0])===3&&u===2)throw new O("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floating point data");const{skipMapInfo:f,skipExtensions:p=[]}=this.ioConfig;if(!p.includes("aux.xml")&&!f){const w=await this._fetchAuxiliaryMetaData(i);w!=null&&this._processPAMInfo(w,l)}p.includes("vat.dbf")||l.bandCount!==1||l.pixelType!=="u8"||f||(l.attributeTable=await this._fetchAuxiliaryTable(i),l.attributeTable!=null&&(l.keyProperties.DataType="thematic")),f&&this.updateImageSpaceRasterInfo(l),this.updateTileInfo()}async fetchRawTile(i,e,n,t={}){var a;if(!((a=this._headerInfo)!=null&&a.isSupported)||this.isBlockOutside(i,e,n))return null;const s=await this._fetchRawTiffTile(i,e,n,!1,t);if(s!=null&&this._headerInfo.hasMaskBand){const r=await this._fetchRawTiffTile(i,e,n,!0,t);r!=null&&r.pixels[0]instanceof Uint8Array&&(s.mask=r.pixels[0])}return s}_parseIFDs(i){var P,B;const e=_i(i),{width:n,height:t,tileWidth:s,tileHeight:a,planes:r,pixelType:o,compression:l,firstPyramidLevel:c,maximumPyramidLevel:h,pyramidBlockWidth:u,pyramidBlockHeight:m,tileBoundary:f,affine:p,metadata:g}=e,d=((P=e.extent.spatialReference)==null?void 0:P.wkt)||((B=e.extent.spatialReference)==null?void 0:B.wkid);let y=ke(d),x=!!e.isPseudoGeographic;y==null&&(x=!0,y=new L({wkid:3857}));const w=new z({...e.extent,spatialReference:y}),S=new A(w?{x:w.xmin,y:w.ymax,spatialReference:y}:{x:0,y:0}),T=new ge({blockWidth:s,blockHeight:a,pyramidBlockWidth:u,pyramidBlockHeight:m,compression:l,origin:S,firstPyramidLevel:c,maximumPyramidLevel:h,blockBoundary:f}),b=new A({x:(w.xmax-w.xmin)/n,y:(w.ymax-w.ymin)/t,spatialReference:y}),_=g?{BandProperties:g.bandProperties,DataType:g.dataType}:{};let k=null;const R=me(i[0],"PHOTOMETRICINTERPRETATION"),F=$e(i[0],"COLORMAP");if(R<=3&&(F==null?void 0:F.length)>3&&F.length%3==0){k=[];const C=F.length/3;for(let D=0;D>>8,F[D+C]>>>8,F[D+2*C]>>>8])}const M=new xe({width:n,height:t,bandCount:r,pixelType:o,pixelSize:b,storageInfo:T,spatialReference:y,isPseudoSpatialReference:x,keyProperties:_,extent:w,colormap:k,statistics:g?g.statistics:null});return p!=null&&p.length&&(M.nativeExtent=new z({xmin:-.5,ymin:.5-t,xmax:n-.5,ymax:.5,spatialReference:y}),M.transform=new qe({polynomialOrder:1,forwardCoefficients:[p[2]+p[0]/2,p[5]-p[3]/2,p[0],p[3],-p[1],-p[4]]}),M.extent=M.transform.forwardTransform(M.nativeExtent),M.pixelSize=new A({x:(w.xmax-w.xmin)/n,y:(w.ymax-w.ymin)/t,spatialReference:y}),T.origin.x=-.5,T.origin.y=.5),{imageInfo:e,rasterInfo:M}}_processPAMInfo(i,e){if(e.statistics=i.statistics??e.statistics,e.histograms=i.histograms,i.histograms&&e.statistics==null&&(e.statistics=je(i.histograms)),i.transform&&e.transform==null){e.transform=i.transform,e.nativeExtent=e.extent;const n=e.transform.forwardTransform(e.nativeExtent);e.pixelSize=new A({x:(n.xmax-n.xmin)/e.width,y:(n.ymax-n.ymin)/e.height,spatialReference:e.spatialReference}),e.extent=n}e.isPseudoSpatialReference&&i.spatialReference&&(e.spatialReference=i.spatialReference,e.extent.spatialReference=e.nativeExtent.spatialReference=e.storageInfo.origin.spatialReference=e.spatialReference)}async _readIFDs(i,e,n,t,s,a=4,r){if(!t)return null;(t>=e.byteLength||t<0)&&(e=(await this.request(this.url,{range:{from:t+s,to:t+s+this._bufferSize},responseType:"array-buffer",signal:r})).data,s=t+s,t=0);const o=await this._readIFD(e,n,t,s,we.tiffTags,a,r);if(i.push(o.ifd),!o.nextIFD)return null;await this._readIFDs(i,e,n,o.nextIFD-s,s,a,r)}async _readIFD(i,e,n,t,s=we.tiffTags,a=4,r){var l,c;if(!i)return null;const o=ki(i,e,n,t,s,a);if(o.success){const h=[];if((l=o.ifd)==null||l.forEach(u=>{u.values||h.push(u)}),h.length>0){const u=h.map(f=>f.offlineOffsetSize).filter(Be),m=Math.min.apply(null,u.map(f=>f[0]));if(Math.min.apply(null,u.map(f=>f[0]+f[1]))-m<=this._bufferSize){const{data:f}=await this.request(this.url,{range:{from:m,to:m+this._bufferSize},responseType:"array-buffer",signal:r});i=f,t=m,h.forEach(p=>Fi(i,e,p,t))}}if((c=o.ifd)!=null&&c.has("GEOKEYDIRECTORY")){const u=o.ifd.get("GEOKEYDIRECTORY"),m=u==null?void 0:u.values;if(m&&m.length>4){const f=m[0]+"."+m[1]+"."+m[2],p=await this._readIFD(i,e,u.valueOffset+6-t,t,we.geoKeys,2,r);u.data=p.ifd,u.data&&u.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[f]})}}return o}if(o.requiredBufferSize&&o.requiredBufferSize!==i.byteLength)return(i=(await this.request(this.url,{range:{from:t,to:t+o.requiredBufferSize+4},responseType:"array-buffer",signal:r})).data).byteLengththis.request(this.url,{range:b,responseType:"array-buffer",signal:s.signal})),u=await Promise.all(h),m=u.map(b=>b.data.byteLength).reduce((b,_)=>b+_),f=u.length===1?u[0].data:new ArrayBuffer(m),p=[0],g=[0];if(u.length>1){const b=new Uint8Array(f);for(let _=0,k=0;_p||n>g||ee.add(t)),e}static async open(e){var u;const{url:n,ioConfig:t,source:s,sourceJSON:a}=e;let r=e.datasetFormat??(t==null?void 0:t.datasetFormat);r==null&&(n.includes(".")?r=n.slice(n.lastIndexOf(".")+1).toUpperCase():((u=s==null?void 0:s.type)==null?void 0:u.toLowerCase())==="coverage"?r="CovJSON":s!=null&&s.extent&&s.pixelblocks&&(r="MEMORY")),r==="OVR"||r==="TIF"?r="TIFF":r==="JPG"||r==="JPEG"||r==="JFIF"?r="JPG":r==="COVJSON"&&(r="CovJSON"),n.toLowerCase().includes("/imageserver")&&!n.toLowerCase().includes("/wcsserver")&&(r="RasterTileServer");const o={url:n,source:s,sourceJSON:a,datasetFormat:r,ioConfig:t??{bandIds:null,sampling:null}};if(Object.keys(o).forEach(m=>{o[m]==null&&delete o[m]}),r){if(!this.supportedFormats.has(r))throw new O("rasterfactory:open","not a supported format "+r);if(r==="CRF"&&!(t!=null&&t.enableCRF))throw new O("rasterfactory:open",`cannot open raster: ${n}`);const m=new(j.get(r)).constructor(o);return await m.open({signal:e.signal}),m}const l=Array.from(j.keys()).filter(m=>m!=="CovJSON"&&m!=="Memory");let c=0;const h=()=>{if(r=l[c++],!r||r==="CRF"&&!(t!=null&&t.enableCRF))return null;const m=new(j.get(r)).constructor(o);return m.open({signal:e.signal}).then(()=>m).catch(()=>h())};return h()}static register(e,n,t){j.has(e.toUpperCase())||j.set(e.toUpperCase(),{desc:n,constructor:t})}}let J=class extends Lt(Ht(Wt(Gt(jt(os(Ki(qt(Yi(Ut(Vt(ii))))))))))){constructor(...i){super(...i),this._primaryRasters=[],this.bandIds=null,this.interpolation=null,this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this.source=void 0,this._debouncedSaveOperations=Xt(async(e,n,t)=>{const{save:s,saveAs:a}=await He(()=>import("./imageryUtils-Bct433Ji.js"),__vite__mapDeps([5,6,2,3,7,8,9,10]));switch(e){case be.SAVE:return s(this,n);case be.SAVE_AS:return a(this,t,n)}})}normalizeCtorArgs(i,e){return typeof i=="string"?{url:i,...e}:i}load(i){const e=i!=null?i.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},i).catch(Yt).then(()=>this._openRaster(e))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){var o;const i=[new he({name:"Raster.ServicePixelValue",alias:"Pixel Value",domain:null,editable:!1,length:50,type:"string"}),new he({name:"Raster.ServicePixelValue.Raw",alias:"Raw Pixel Value",domain:null,editable:!1,length:50,type:"string"})],{serviceRasterInfo:e}=this,n=e==null?void 0:e.attributeTable,t=n!=null?n.fields:null,s="Raster.";if(t){const l=t.filter(c=>c.type!=="oid"&&c.name.toLowerCase()!=="value").map(c=>{const h=c.clone();return h.name=s+c.name,h});i.push(...l)}const a=e==null?void 0:e.dataType,r=e==null?void 0:e.multidimensionalInfo;if((a==="vector-magdir"||a==="vector-uv")&&r!=null){const l=(o=r.variables[0].unit)==null?void 0:o.trim(),c="Magnitude"+(l?` (${l})`:"");i.push(new he({name:"Raster.Magnitude",alias:c,domain:null,editable:!1,type:"double"})),i.push(new he({name:"Raster.Direction",alias:"Direction (°)",domain:null,editable:!1,type:"double"}))}return i}createPopupTemplate(i){const{rasterFields:e}=this,n=new Set(e.map(({name:t})=>t).filter(t=>t.toLowerCase()!=="raster.servicepixelvalue.raw"));return Qi({fields:e,title:this.title},{...i,visibleFieldNames:n})}async generateRasterInfo(i,e){if(!(i=Le(Ee,i)))return this.serviceRasterInfo;try{const{rasterInfo:n}=await this._openFunctionRaster(i,e);return n}catch(n){throw n instanceof O?n:new O("imagery-tile-layer","the given raster function is not supported")}}async save(i){return this._debouncedSaveOperations(be.SAVE,i)}async saveAs(i,e){return this._debouncedSaveOperations(be.SAVE_AS,e,i)}write(i,e){const n=this._primaryRasters[0]??this.raster;if(this.loaded?n.datasetFormat==="RasterTileServer"&&(n.tileType==="Raster"||n.tileType==="Map"):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(i,e);if(e!=null&&e.messages){const t=`${e.origin}/${e.layerContainerType||"operational-layers"}`;e.messages.push(new O("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${t}'`,{layer:this}))}return null}async _openRaster(i){let e=!1;if(this.raster)await this._openFromRaster(this.raster,i),e=this.raster.datasetFormat==="Function";else{const{url:t,rasterFunction:s,source:a}=this;if(!t&&!a)throw new O("imagery-tile-layer:open","missing url or source parameter");a?await this._openFromSource(a,i):s?await this._openFromUrlWithRasterFunction(t,s,i):await this._openFromUrl(t,i)}const n=this.raster.rasterInfo;if(!n)throw new O("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("serviceRasterInfo",e?n:this._primaryRasters[0].rasterInfo),this._set("spatialReference",n.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,this.sourceJSON!=null){const t=this.raster.tileType==="Map"&&this.sourceJSON.minLOD!=null&&this.sourceJSON.maxLOD!=null?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(t,{origin:"service"})}else this.read({tileInfo:this.serviceRasterInfo.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),this.raster.tileType==="Map"&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles(Kt(()=>this.customParameters,t=>{this.raster&&(this.raster.ioConfig.customFetchParameters=t)}))}async _openFromRaster(i,e){i.rasterInfo||await i.open({signal:e}),this._primaryRasters=i.datasetFormat==="Function"?i.primaryRasters.rasters:[i],this.url||(this.url=this._primaryRasters[0].url)}async _openFromUrlWithRasterFunction(i,e,n){const t=[i];e&&Xi(e.toJSON(),t);const s=await Promise.all(t.map(r=>Ne.open({url:r,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:n}))),a=s.findIndex(r=>r==null);if(a>-1)throw new O("imagery-tile-layer:open",`cannot open raster: ${t[a]}`);return this._primaryRasters=s,this._initializeWithFunctionRaster(e)}async _openFromUrl(i,e){const n=await Ne.open({url:i,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e});if(n==null)throw new O("imagery-tile-layer:open",`cannot open raster: ${i}`);this._primaryRasters=[n],this.raster=n}async _openFromSource(i,e){var a;const n="the tiled imagery data source is not supported",t=((a=i.type)==null?void 0:a.toLowerCase())==="coverage"?"CovJSON":i.extent&&i.pixelBlock?"MEMORY":null;if(!t)throw new O("imagery-tile-layer:open",n);t==="MEMORY"&&(i={extent:i.extent,pixelBlocks:[i.pixelBlock]});const s=await Ne.open({url:"",source:i,datasetFormat:t,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e});if(s==null)throw new O("imagery-tile-layer:open",n);this._primaryRasters=[s],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=s}async _openFunctionRaster(i,e){var a;const n={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(r=>n[r.url]=r);const t=wt(((a=i.functionDefinition)==null?void 0:a.toJSON())??i.toJSON(),n),s=new It({rasterFunction:t});return await s.open(e),s}async _initializeWithFunctionRaster(i,e){try{this.raster=await this._openFunctionRaster(i,e)}catch(n){n instanceof O&&le.getLogger(this).error("imagery-tile-layer:open",n.message),le.getLogger(this).warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=this._primaryRasters[0]}}};I([v({clonable:!1})],J.prototype,"_primaryRasters",void 0),I([v({type:[Qt],json:{write:{overridePolicy(){var i;return{enabled:!this.loaded||this.raster.tileType==="Raster"||((i=this.bandIds)==null?void 0:i.join(","))!=="0,1,2"}}}}})],J.prototype,"bandIds",void 0),I([v({json:{write:{overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"||this.interpolation!=="bilinear"}}}}}),Zt(mi)],J.prototype,"interpolation",void 0),I([v(ei)],J.prototype,"legendEnabled",void 0),I([v({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],J.prototype,"isReference",void 0),I([v({type:["show","hide"]})],J.prototype,"listMode",void 0),I([v({json:{read:!0,write:!0}})],J.prototype,"blendMode",void 0),I([v()],J.prototype,"sourceJSON",void 0),I([v({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],J.prototype,"version",void 0),I([v({readOnly:!0,json:{read:!1}})],J.prototype,"type",void 0),I([v({type:["ArcGISTiledImageServiceLayer"]})],J.prototype,"operationalLayerType",void 0),I([v({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(i,e)=>!e.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"}},writer(i,e,n){e[n]=!i}}}})],J.prototype,"popupEnabled",void 0),I([v({type:ti,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"}}}}})],J.prototype,"popupTemplate",void 0),I([v({readOnly:!0})],J.prototype,"defaultPopupTemplate",null),I([v({readOnly:!0,type:[he]})],J.prototype,"fields",void 0),I([v({readOnly:!0,type:[he]})],J.prototype,"rasterFields",null),I([v({constructOnly:!0})],J.prototype,"source",void 0),J=I([K("esri.layers.ImageryTileLayer")],J);const Qs=J;export{Qs as default}; +import{hk as Tt,kg as _t,dZ as te,kh as ht,s as le,N as O,er as Le,aA as A,aE as z,M as ft,d_ as mt,aS as L,ia as kt,d as I,y as v,du as dt,f as K,aU as Ft,_ as He,bo as Ye,aB as Mt,aZ as Ct,jD as Pt,aj as Ot,a9 as Dt,ki as $t,dc as pt,kj as Nt,q as Be,E as Bt,jj as Et,ah as Jt,bW as At,kk as zt,bP as Lt,bQ as Ht,dp as Wt,dq as Gt,dO as jt,dM as qt,dr as Ut,b4 as Vt,k as Xt,ay as Yt,a_ as he,g as Kt,dS as Qt,c9 as Zt,dt as ei,i as ti,bT as ii}from"./index-BjUNJPVf.js";import{c as si,N as Ee,l as ni,d as ri,a as ai,h as oi,K as Ke,B as Qe,S as li,E as ci,V as Ze,t as ui,p as hi,m as fi,b as mi}from"./ImageHistogramParameters-DYfx5K-s.js";import{h as yt,D as gt,i as di,a as pi,p as We,d as et,o as yi,f as tt,g as gi}from"./multidimensionalUtils-u3oUX4w1.js";import{S as xi,n as ge,m as Ge,L as wi,r as it,a as xe,h as Ii,g as je,P as bi,b as Si,F as Ri,U as vi,N as Ti,R as _i,c as we,B as ki,d as Fi,D as Mi}from"./RasterSymbolizer-BN7ge8gb.js";import{i as st,m as nt,x as rt,h as Ci,s as Pi}from"./RawBlockCache-DNGqU_D7.js";import{U as Fe,D as xt,R as Oi,a as Di,l as $i,c as Ni,u as Y,f as Bi,s as Ei,d as Ji,E as Ai,W as zi,T as Li}from"./dataUtils-DzOfgSpi.js";import{T as Je,D as Ie,j as at,r as ot,o as Hi,V as Me,J as ve,e as Wi,Z as Gi,C as ji,U as Ae}from"./rasterProjectionHelper-CHkyWbma.js";import{d as _e}from"./FeatureSet-opEn8ou8.js";import{R as wt,f as qi,i as Ui,y as qe,c as Vi,N as Xi}from"./utils-CBTVfSGR.js";import{f as Yi}from"./RefreshableLayer-_r2TPtol.js";import{f as Ki}from"./TemporalLayer-CKICYnEl.js";import{p as Qi}from"./popupUtils-DlZin22m.js";import{A as be}from"./interfaces-CL2NbQte.js";import"./UniqueValueRenderer-7V9Bhr-D.js";import"./ColorStop-DCGjAKLC.js";import"./diffUtils-uUoMDFQS.js";import"./colorRamps-CcakIWlU.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-BX9G5gNQ.js";import"./jsonUtils-Ox5U0P0F.js";import"./styleUtils-DOUOskVZ.js";import"./utils-Dx_a2yJw.js";import"./utils-CuXO_Zzq.js";import"./ClassBreaksDefinition-Djcxa8Lp.js";import"./TimeInfo-DooETFWC.js";const lt=8,Zi=256;let es=0,G=class extends Tt(Ft){constructor(){super(...arguments),this._tileFetchQueue=new _t({concurrency:32,process:(i,e)=>this._fetchRawTile(i.pyramidLevel,i.row,i.col,{...i.options,signal:e})}),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}async init(){const i=Je();this.addResolvingPromise(i),await this.when()}normalizeCtorArgs(i){return i!=null&&i.ioConfig&&(i={...i,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:te.create(),...i.ioConfig}}),i}get _isGlobalWrappableSource(){const{rasterInfo:i}=this,e=Ie(i.spatialReference);return e!=null&&i.extent.width>=e/2}get _hasNoneOrGCSShiftTransform(){const{transform:i}=this.rasterInfo;return i==null||i.type==="gcs-shift"}set rasterJobHandler(i){var e,n;this._set("rasterJobHandler",i),this.datasetFormat==="Function"&&((n=(e=this.primaryRasters)==null?void 0:e.rasters)==null||n.forEach(t=>t.rasterJobHandler=i))}get rasterId(){return this.url||"rasterId-"+es++}set url(i){this._set("url",ht(i,le.getLogger(this)))}async open(i){throw new O("BaseRaster:open-not-implemented","open() is not implemented")}async fetchTile(i,e,n,t={}){const s=t.tileInfo||this.rasterInfo.storageInfo.tileInfo,a=this.getTileExtentFromTileInfo(i,e,n,s);return t={noClip:!0,...t},this.fetchPixels(a,s.size[0],s.size[1],t)}async identify(i,e={}){var M;i=Le(A,i).clone().normalize();const{multidimensionalDefinition:n,timeExtent:t}=e,{rasterInfo:s}=this,{hasMultidimensionalTranspose:a,multidimensionalInfo:r}=s;let{transposedVariableName:o}=e;const l=r!=null&&a&&(t!=null||yt(n));l&&!o&&(o=n!=null&&n.length>0?n[0].variableName??void 0:r.variables[0].name,e={...e,transposedVariableName:o}),e=this._getRequestOptionsWithSliceId(e);const{spatialReference:c,extent:h}=s,{datumTransformation:u}=e;let m=at(i,c,u);if(!h.intersects(m))return{location:m,value:null};if(s.transform!=null){const P=s.transform.inverseTransform(m);if(!s.nativeExtent.intersects(P))return{location:P,value:null};m=P}let f=0;const p=o!=null&&r!=null&&s.hasMultidimensionalTranspose;if(this.datasetFormat==="Function"){const P=this.primaryRasters.rasters[0];if(p)return P.identify(m,e);const{pixelSize:B}=s,C=3,D=B.x*C/2,$=B.y*C/2,E=new z({xmin:m.x-D,xmax:m.x+D,ymin:m.y-$,ymax:m.y+$,spatialReference:c}),X={interpolation:"nearest",multidimensionalDefinition:n,sliceId:e.sliceId},{pixelBlock:H}=await P.fetchPixels(E,C,C,X),{pixelBlock:W}=await this.fetchPixels(E,C,C,X);if(H==null)return{location:m,value:null};const q=Math.floor(C*C*.5),ee=!H.mask||H.mask[q]?H.pixels.map(N=>N[q]):null;let U;return W!=null&&(U=!W.mask||W.mask[q]?W.pixels.map(N=>N[q]):void 0),{location:m,value:ee,processedValue:U,pyramidLevel:0}}if(!p){if(e.srcResolution)f=ot(e.srcResolution,s,this.ioConfig.sampling).pyramidLevel;else if(f=await this.computeBestPyramidLevelForLocation(i,e),f==null)return{location:m,value:null}}const g=this.identifyPixelLocation(m,f,null,p);if(g===null)return{location:m,value:null};const{row:d,col:y,rowOffset:x,colOffset:w,blockWidth:S}=g,T=o??e.sliceId,b=st(this.rasterId,T),_=`${f}/${d}/${y}`;let k=nt(b,null,_);k==null&&(k=this.fetchRawTile(f,d,y,e),rt(b,null,_,k));const R=await k;if(!((M=R==null?void 0:R.pixels)!=null&&M.length))return{location:m,value:null};const F=x*S+w;return this._processIdentifyResult(R,{srcLocation:m,position:F,pyramidLevel:f,useTransposedTile:!!p,requestSomeSlices:l,identifyOptions:e})}async fetchPixels(i,e,n,t={}){i=Hi(i),t=this._getRequestOptionsWithSliceId(t);const{_hasNoneOrGCSShiftTransform:s}=this;if(t.requestRawData&&s)return this._fetchPixels(i,e,n,t);const a=Ie(i.spatialReference),r=Me(i);if(a==null||r===0||r===1&&this._isGlobalWrappableSource&&s)return this._fetchPixels(i,e,n,t);if(r>=3)return{extent:i,pixelBlock:null};const o=[],{xmin:l,xmax:c}=i,h=Math.round(a/(c-l)*e),u=h-Math.round((a/2-l)/(c-l)*e);let m=0;const f=[];for(let y=0;y<=r;y++){const x=new z({xmin:y===0?l:-a/2,xmax:y===r?c-a*y:a/2,ymin:i.ymin,ymax:i.ymax,spatialReference:i.spatialReference}),w=y===0?h-u:y===r?e-m:h;m+=w,f.push(w);const S=t.disableWrapAround&&y>0?null:this._fetchPixels(x,w,n,t);o.push(S)}const p=(await Promise.all(o)).map(y=>y==null?void 0:y.pixelBlock);let g=null;const d={width:e,height:n};return this.rasterJobHandler?g=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:p,srcMosaicSize:d,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:f},t)).pixelBlock:g=Fe(p,d,{blockWidths:f}),{extent:i,srcExtent:ve(i,this.rasterInfo.spatialReference,t.datumTransformation),pixelBlock:g}}async fetchRawPixels(i,e,n,t={}){e={x:Math.floor(e.x),y:Math.floor(e.y)};const s=await this._fetchRawTiles(i,e,n,t),{nativeExtent:a,nativePixelSize:r,storageInfo:o}=this.rasterInfo,l=2**i,c=r.x*l,h=r.y*l,u=new z({xmin:a.xmin+c*e.x,xmax:a.xmin+c*(e.x+n.width-1),ymin:a.ymax-h*(e.y+n.height-1),ymax:a.ymax-h*e.y,spatialReference:a.spatialReference});if(!s)return{extent:u,srcExtent:u,pixelBlock:null};const{pixelBlocks:m,mosaicSize:f}=s;if(m.length===1&&m[0]!=null&&m[0].width===n.width&&m[0].height===n.height)return{extent:u,srcExtent:u,pixelBlock:s.pixelBlocks[0]};const p=i>0?o.pyramidBlockWidth:o.blockWidth,g=i>0?o.pyramidBlockHeight:o.blockHeight,d={x:e.x%p,y:e.y%g};let y;return this.rasterJobHandler?y=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:m,srcMosaicSize:f,destDimension:n,clipOffset:d,clipSize:n,coefs:null,sampleSpacing:null,interpolation:t.interpolation,alignmentInfo:null,blockWidths:null},t)).pixelBlock:y=Fe(m,f,{clipOffset:d,clipSize:n}),{extent:u,srcExtent:u,pixelBlock:y}}fetchRawTile(i,e,n,t){throw new O("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(i){return ve(this.rasterInfo.extent,i)}decodePixelBlock(i,e){return!this.rasterJobHandler||e.useCanvas?xi(i,e):this.rasterJobHandler.decode({data:i,options:e})}async request(i,e,n=0){const{customFetchParameters:t}=this.ioConfig,{range:s,query:a,headers:r}=e;n=n??e.retryCount??this.ioConfig.retryCount;const o=s?{Range:`bytes=${s.from}-${s.to}`}:null;try{return await ft(i,{...e,query:{...a,...t},headers:{...r,...o}})}catch(l){if(n>0)return n--,this.request(i,e,n);throw l}}getSliceIndex(i){const{multidimensionalInfo:e}=this.rasterInfo;return e==null||i==null||i.length===0?null:gt(i,e)}getTileExtentFromTileInfo(i,e,n,t){const s=t.lodAt(i);return this.getTileExtent({x:s.resolution,y:s.resolution},e,n,t.origin,t.spatialReference,t.size)}updateTileInfo(){const{storageInfo:i,spatialReference:e,extent:n,pixelSize:t}=this.rasterInfo;if(!i.tileInfo){const s=[],a=i.maximumPyramidLevel||0;let r=Math.max(t.x,t.y),o=1/.0254*96*r;for(let c=0;c<=a;c++)s.unshift(new mt({level:a-c,resolution:r,scale:o})),r*=2,o*=2;const l=new A({x:n.xmin,y:n.ymax,spatialReference:e});i.tileInfo=new te({origin:l,size:[i.blockWidth,i.blockHeight],spatialReference:e,lods:s}),i.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(i,e=512,n=512,t){const{width:s,height:a,nativeExtent:r,pixelSize:o,spatialReference:l}=i,c=new A({x:r.xmin,y:r.ymax,spatialReference:l});t==null&&(t=Math.max(0,Math.round(Math.log(Math.max(s,a))/Math.LN2-8)));const h=this.computeBlockBoundary(r,512,512,{x:r.xmin,y:r.ymax},[o],t);i.storageInfo=new ge({blockWidth:e,blockHeight:n,pyramidBlockWidth:e,pyramidBlockHeight:n,origin:c,firstPyramidLevel:1,maximumPyramidLevel:t,blockBoundary:h})}async computeBestPyramidLevelForLocation(i,e={}){return 0}computeBlockBoundary(i,e,n,t,s,a=0,r=2){if(s.length===1&&a>0){s=[...s];let{x:h,y:u}=s[0];for(let m=0;mo)return null;const f=this.getPyramidPixelSize(e),{x:p,y:g}=f,d=(l.y-m.y)/g/u,y=(m.x-l.x)/p/h,x=Math.min(u-1,Math.floor((d-Math.floor(d))*u)),w=Math.min(h-1,Math.floor((y-Math.floor(y))*h));return{pyramidLevel:e,row:Math.floor(d),col:Math.floor(y),rowOffset:x,colOffset:w,blockWidth:h,srcLocation:m}}getTileExtent(i,e,n,t,s,a){const[r,o]=a,l=t.x+n*r*i.x,c=l+r*i.x,h=t.y-e*o*i.y,u=h-o*i.y;return new z({xmin:l,xmax:c,ymin:u,ymax:h,spatialReference:s})}getBlockWidthHeight(i){return{blockWidth:i>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:i>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(i,e,n){const t=this.rasterInfo.storageInfo.blockBoundary[i];return!t||t.maxRowe||t.minCol>n}updateImageSpaceRasterInfo(i){const{extent:e,pixelSize:n}=i;if(e.xmin===-.5&&e.ymax===.5&&n.x===1&&n.y===1&&i.transform==null)return;const{width:t,height:s}=i,a=L.WebMercator;i.spatialReference=a,i.extent=i.nativeExtent=new z({xmin:-.5,ymax:.5,xmax:t-.5,ymin:.5-s,spatialReference:a}),i.isPseudoSpatialReference=!0,i.transform=null,i.pixelSize=new A({x:1,y:1,spatialReference:a});const{extent:r,storageInfo:o}=i;if(o){o.origin=new A({x:r.xmin,y:r.ymax,spatialReference:a});const{tileInfo:l}=o;if(l){l.origin=o.origin;const c=(i.nativePixelSize.x+i.nativePixelSize.y)/2;l.lods.forEach((h,u)=>{h.resolution=c*2**u,h.scale=96*h.resolution/.0254})}}}async _fetchPixels(i,e,n,t={}){let s=Me(i);if(s>=2)return{extent:i,pixelBlock:null};const a=this._getSourceDataInfo(i,e,n,t),{pyramidLevel:r,srcResolution:o,srcExtent:l,srcWidth:c,srcHeight:h,ul:u}=a;if(c===0||h===0)return{extent:i,srcExtent:l,pixelBlock:null};const{rasterInfo:m}=this,f=m.transform,p=(f==null?void 0:f.type)==="gcs-shift",g=Ie(i.spatialReference)!=null;!p&&g||(s=Me(a.srcExtent,p));const d=await this._fetchRawTiles(r,u,{width:c,height:h,wrapCount:s},t);if(!d)return{extent:i,srcExtent:l,pixelBlock:null};const y=m.storageInfo,x=r>0?y.pyramidBlockWidth:y.blockWidth,w=r>0?y.pyramidBlockHeight:y.blockHeight;let{x:S,y:T}=m.pixelSize;if(r>0){const{pyramidResolutions:N,pyramidScalingFactor:vt}=y;if(N!=null&&N[r-1])({x:S,y:T}=N[r-1]);else{const Xe=vt**r;S*=Xe,T*=Xe}}const b=m.spatialReference,_=new A({x:S,y:T,spatialReference:b}),k=x===c&&w===h&&u.x%x==0&&u.y%w==0,R=new A({x:(i.xmax-i.xmin)/e,y:(i.ymax-i.ymin)/n,spatialReference:i.spatialReference}),F=!i.spatialReference.equals(b),M=b.isGeographic?1e-9:1e-4,{datumTransformation:P}=t;if(!F&&k&&d.pixelBlocks.length===1&&x===e&&w===n&&this._isSameResolution(o,R,M))return{extent:i,srcExtent:l,srcTilePixelSize:_,pixelBlock:d.pixelBlocks[0]};const B=g&&Ie(l.spatialReference)!=null&&this._hasNoneOrGCSShiftTransform,C=t.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");C&&!this.rasterJobHandler&&await Je();const D=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:i,srcBufferExtent:d.extent,pixelSize:R.toJSON(),datumTransformation:P,rasterTransform:f,hasWrapAround:s>0||B,isAdaptive:this.ioConfig.optimizeProjectionAccuracy!==!1,includeGCSGrid:C},t):Wi({projectedExtent:i,srcBufferExtent:d.extent,pixelSize:R,datumTransformation:P,rasterTransform:f,hasWrapAround:s>0||B,isAdaptive:!1,includeGCSGrid:C});let $;const E=!t.requestRawData,X={rows:D.spacing[0],cols:D.spacing[1]},H=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(r,d.extent.xmin):void 0,{pixelBlocks:W,mosaicSize:q,isPartiallyFilled:ee}=d;let U=null;if(this.rasterJobHandler)({pixelBlock:$,localNorthDirections:U}=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:W,srcMosaicSize:q,destDimension:E?{width:e,height:n}:null,coefs:E?D.coefficients:null,sampleSpacing:E?X:null,projectDirections:C,gcsGrid:C?D.gcsGrid:null,isUV:this.rasterInfo.dataType==="vector-uv",interpolation:t.interpolation,alignmentInfo:H,blockWidths:null},t));else{const N=Fe(W,q,{alignmentInfo:H});$=E?xt(N,{width:e,height:n},D.coefficients,X,t.interpolation):N,C&&D.gcsGrid&&(U=Oi({width:e,height:n},D.gcsGrid),$=Di($,this.rasterInfo.dataType,U))}return t.requestRawData||C?{extent:i,srcExtent:l,srcTilePixelSize:_,pixelBlock:$,transformGrid:D,localNorthDirections:U,isPartiallyFilled:ee}:{extent:i,srcExtent:l,srcTilePixelSize:_,pixelBlock:$}}async _fetchRawTiles(i,e,n,t){const{origin:s,blockBoundary:a}=this.rasterInfo.storageInfo,{blockWidth:r,blockHeight:o}=this.getBlockWidthHeight(i);let{x:l,y:c}=e,{width:h,height:u,wrapCount:m}=n;const f=this._getRasterTileAlignmentInfo(i,0);t.buffer&&(l-=t.buffer.cols,c-=t.buffer.rows,h+=2*t.buffer.cols,u+=2*t.buffer.rows);let p=0,g=0,d=0;m&&f!=null&&({worldColumnCountFromOrigin:g,originColumnOffset:d,rightPadding:p}=f,g*f.blockWidth-p>=l+h&&(p=0));const y=Math.floor(l/r),x=Math.floor(c/o),w=Math.floor((l+h+p-1)/r),S=Math.floor((c+u+p-1)/o),T=a[i];if(!T)return null;const{minRow:b,minCol:_,maxCol:k,maxRow:R}=T;if(m===0&&(SR||y>k))return null;const F=new Array;let M=!1;const P=this.ioConfig.allowPartialFill==null?t.allowPartialFill:this.ioConfig.allowPartialFill;for(let H=x;H<=S;H++)for(let W=y;W<=w;W++){let q=W;if(!t.disableWrapAround&&m&&f!=null&&g<=W&&(q=W-g-d),H>=b&&q>=_&&R>=H&&k>=q){const ee=this._tileFetchQueue.push({pyramidLevel:i,row:H,col:q,options:t},{signal:t.signal});P?F.push(new Promise(U=>{ee.then(N=>U(N)).catch(()=>{M=!0,U(null)})})):F.push(ee)}else F.push(Promise.resolve(null))}if(F.length===0)return null;const B=await Promise.all(F),C={height:(S-x+1)*o,width:(w-y+1)*r},{spatialReference:D}=this.rasterInfo,$=this.getPyramidPixelSize(i),{x:E,y:X}=$;return{extent:new z({xmin:s.x+y*r*E,xmax:s.x+(w+1)*r*E,ymin:s.y-(S+1)*o*X,ymax:s.y-x*o*X,spatialReference:D}),pixelBlocks:B,mosaicSize:C,isPartiallyFilled:M}}_isSameResolution(i,e,n){return Math.abs(i.x-e.x)l||n>o)return Promise.resolve(null);const c=st(this.rasterId,t.sliceId),h=`${i}/${e}/${n}`;let u=nt(c,t.registryId,h);if(u==null){const m=new AbortController;u=this.fetchRawTile(i,e,n,{...t,signal:m.signal}),rt(c,t.registryId,h,u,m),u.catch(()=>Ci(c,t.registryId,h))}return t.signal&&kt(t,()=>{Pi(c,t.registryId,h)}),u}_computeMagDirValues(i){var l;const{bandCount:e,dataType:n}=this.rasterInfo;if(!(e===2&&n==="vector-magdir"||n==="vector-uv")||(i==null?void 0:i.length)!==2||!((l=i[0])!=null&&l.length))return null;const t=i[0].length;if(n==="vector-magdir"){const c=i[1].map(h=>(h+360)%360);return[i[0],c]}const[s,a]=i,r=[],o=[];for(let c=0;c=16,m=l===a&&this._requireTooManySrcTiles(r,o,e,n);if(u||m||r===0||o===0){const f=new A({x:(i.xmax-i.xmin)/e,y:(i.ymax-i.ymin)/n,spatialReference:i.spatialReference});let p=ji(f,this.rasterInfo.spatialReference,i,s.datumTransformation);const g=!p||t.srcResolution&&p.x+p.y=d){const y=2**d;p={x:t.srcResolution.x*y,y:t.srcResolution.y*y}}}p&&(s.srcResolution=p,this._updateSourceDataInfo(i,s))}return this._requireTooManySrcTiles(s.srcWidth,s.srcHeight,e,n)&&(s.srcWidth=0,s.srcHeight=0),s}_requireTooManySrcTiles(i,e,n,t){const{tileInfo:s}=this.rasterInfo.storageInfo,a=Math.ceil(i/s.size[0])*Math.ceil(e/s.size[1]),r=i/n,o=e/t,l=Math.max(1,(n+t)/1024);return a>=Zi*l||r>lt||o>lt}_updateSourceDataInfo(i,e){e.srcWidth=0,e.srcHeight=0;const{rasterInfo:n}=this,t=n.spatialReference,{srcResolution:s,datumTransformation:a}=e,{pyramidLevel:r,pyramidResolution:o,excessiveReading:l}=ot(s,n,this.ioConfig.sampling);if(l)return;let c=e.srcExtent||ve(i,t,a);if(c==null)return;const h=n.transform;h&&(c=h.inverseTransform(c)),e.srcExtent=c;const{x:u,y:m}=n.storageInfo.origin,f=Math.floor((c.xmin-u)/o.x+.1),p=Math.floor((m-c.ymax)/o.y+.1),g=Math.floor((c.xmax-u)/o.x-.1),d=Math.floor((m-c.ymin)/o.y-.1),y=c.width<.1*o.x?0:g-f+1,x=c.height<.1*o.y?0:d-p+1;e.pyramidLevel=r,e.pyramidResolution=o,e.srcWidth=y,e.srcHeight=x,e.ul={x:f,y:p}}_getRequestOptionsWithSliceId(i){return this.rasterInfo.multidimensionalInfo!=null&&i.sliceId==null&&(i={...i,sliceId:this.getSliceIndex(i.multidimensionalDefinition)}),i}_processIdentifyResult(i,e){const{srcLocation:n,position:t,pyramidLevel:s,useTransposedTile:a}=e,r=i.pixels[0].length/i.width/i.height;if(!(!i.mask||i.mask[t]))return{location:n,value:null};const{multidimensionalInfo:o}=this.rasterInfo;if(o==null||!a){const d=i.pixels.map(w=>w[t]),y={location:n,value:d,pyramidLevel:s},x=this._computeMagDirValues(d.map(w=>[w]));return x!=null&&x.length&&(y.magdirValue=x.map(w=>w[0])),y}let l=i.pixels.map(d=>d.slice(t*r,t*r+r)),c=this._computeMagDirValues(l);const{requestSomeSlices:h,identifyOptions:u}=e;let m=di(o,u.transposedVariableName);if(h){const d=pi(m,u.multidimensionalDefinition,u.timeExtent);l=l.map(y=>d.map(x=>y[x])),c=c==null?void 0:c.map(y=>d.map(x=>y[x])),m=d.map(y=>m[y])}const f=i.noDataValues||this.rasterInfo.noDataValue,p={pixels:l,pixelType:i.pixelType};let g;return f!=null&&(Ni(p,f),g=p.mask),{location:n,value:null,dataSeries:m.map((d,y)=>{const x={value:(g==null?void 0:g[y])===0?null:l.map(w=>w[y]),multidimensionalDefinition:d.multidimensionalDefinition.map(w=>new We({...w,isSlice:!0}))};return c!=null&&c.length&&(x.magdirValue=[c[0][y],c[1][y]]),x}),pyramidLevel:s}}};I([v()],G.prototype,"_rasterTileAlignmentInfo",void 0),I([v()],G.prototype,"_tileFetchQueue",void 0),I([v({readOnly:!0})],G.prototype,"_isGlobalWrappableSource",null),I([v({readOnly:!0})],G.prototype,"_hasNoneOrGCSShiftTransform",null),I([v()],G.prototype,"rasterJobHandler",null),I([v({readOnly:!0})],G.prototype,"rasterId",null),I([v(dt)],G.prototype,"url",null),I([v({type:String,json:{write:!0}})],G.prototype,"datasetName",void 0),I([v({type:String,json:{write:!0}})],G.prototype,"datasetFormat",void 0),I([v()],G.prototype,"hasUniqueSourceStorageInfo",void 0),I([v()],G.prototype,"rasterInfo",void 0),I([v()],G.prototype,"ioConfig",void 0),I([v()],G.prototype,"sourceJSON",void 0),G=I([K("esri.layers.support.rasterDatasets.BaseRaster")],G);const se=G;function ts(i,e){if(i.spatialReference.equals(e))return i;const n=Ye(i.spatialReference),t=Ye(e);if(n===t)return i;const s=n/t;return{x:i.x*s,y:i.y*s}}async function ze(i,e,n){if(n.type==="extent")return ss(i,e,n);const{width:t,height:s}=i,a=new Uint8Array(t*s),{contains:r,intersects:o}=await He(()=>import("./geometryEngine-8LJe6rF3.js"),__vite__mapDeps([0,1,2,3,4]));return o(e,n)?n.type==="polyline"?ns(i,e,n):r(n,e)?i:is(i,e,n):new Y({pixelType:i.pixelType,width:t,height:s,mask:a,maskIsAlpha:!1,pixels:[...i.pixels]})}function is(i,e,n){if(!i)return i;const{width:t,height:s}=i,a=e.width/t,r=e.height/s,{xmin:o,ymax:l}=e;let c;if(n.type==="extent"){const d=(n.xmin-o)/a,y=(n.xmax-o)/a,x=(l-n.ymax)/r,w=(l-n.ymin)/r;c=[[[d,x],[d,w],[y,w],[y,x],[d,x]]]}else c=n.rings.map(d=>d.map(([y,x])=>[(y-o)/a,(l-x)/r]));const h=document.createElement("canvas");h.width=t,h.height=s;const u=h.getContext("2d");u.fillStyle="#f00",u.beginPath(),c.forEach(d=>{u.moveTo(d[0][0],d[0][1]);for(let y=0;y127?255:0);return new Y({pixelType:i.pixelType,width:t,height:s,mask:g,maskIsAlpha:!1,pixels:[...i.pixels]})}function ss(i,e,n){const{width:t,height:s}=i,a=new Uint8Array(t*s),r=e.width/t,o=e.height/s;if(n.width/r<.5||n.height/o<.5)return new Y({pixelType:i.pixelType,width:t,height:s,mask:a,pixels:[...i.pixels]});const{xmin:l,xmax:c,ymin:h,ymax:u}=e,{xmin:m,xmax:f,ymin:p,ymax:g}=n,d=Math.max(l,m),y=Math.min(c,f),x=Math.max(h,p),w=Math.min(u,g),S=.5*r,T=.5*o;if(y-dc-S||x>u-T||w.5&&_%1<.5||P===B&&k%1>.5&&R%1<.5)return new Y({pixelType:i.pixelType,width:t,height:s,mask:a,pixels:[...i.pixels]});if(F===0&&P===0&&M===t&&B===s)return i;const C=i.mask;for(let D=P;D<=B;D++)for(let $=F;$<=M;$++){const E=D*t+$;a[E]=C?C[E]:255}return new Y({pixelType:i.pixelType,width:t,height:s,mask:a,pixels:[...i.pixels]})}function ns(i,e,n){const{width:t,height:s}=i,a=new Uint8Array(t*s),r=e.width/t,o=e.height/s,{xmin:l,ymax:c}=e,{paths:h}=n,u=i.mask;for(let m=0;mg?a*Math.round((u-g)/a):0),f=d-(fg?a*Math.round((m-g)/a):0),p=d-(pg?a*Math.floor((u-g)/a+.1):0),f=d-(fp.rasterJobHandler=this.rasterJobHandler)));const{rasters:t,rasterIds:s}=this.primaryRasters,a=t.map(p=>p.rasterInfo?void 0:p.open(e));await Promise.all(a);const r=t.map(({rasterInfo:p})=>p),o=n.bind({rasterInfos:r,rasterIds:s});if(n.rawSourceRasterInfos=r,!o.success||r.length===0)throw new O("raster-function:open",`cannot bind the function: ${o.error??""}`);const l=n.functionName==="Table"?n:(f=n.functionArguments)==null?void 0:f.raster;(l==null?void 0:l.functionName)==="Table"&&(n.rasterInfo.attributeTable=_e.fromJSON(l.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const c=r[0];this.hasUniqueSourceStorageInfo=r.length===1||r.slice(1).every(p=>this._hasSameStorageInfo(p,c)),this.set("sourceJSON",t[0].sourceJSON),this.set("rasterInfo",n.rasterInfo),await this._updateClipGeometry()}async syncJobHandler(){var e;return(e=this.rasterJobHandler)==null?void 0:e.updateRasterFunction(this.rasterFunction)}async fetchPixels(e,n,t,s={}){var S,T;const{rasters:a,rasterIds:r}=this.primaryRasters;let o=!1;const{interpolation:l}=s,c=(S=this.rasterFunction.flatWebGLFunctionChain)==null?void 0:S.hasFocalFunction;!s.requestRawData&&c&&(o=a.length===1&&!s.skipRasterFunction,s={...s,interpolation:"bilinear",requestRawData:o});const h=a.map(b=>b.fetchPixels(e,n,t,s)),u=await Promise.all(h),m=u.map(b=>b.pixelBlock),f=o||s.requestRawData?u.map(b=>b.srcTilePixelSize):null;if(s.skipRasterFunction||m.every(b=>b==null))return u[0];const p=((T=u.find(b=>b.pixelBlock!=null))==null?void 0:T.extent)??e;let g=this.rasterJobHandler?await this.rasterJobHandler.process({extent:p,primaryPixelBlocks:m,primaryPixelSizes:f,primaryRasterIds:r}):this.rasterFunction.process({extent:p,primaryPixelBlocks:m,primaryPixelSizes:f,primaryRasterIds:r});const{transformGrid:d}=u[0];if(!o||g==null||d==null){const b=s.noClip?null:this.getClippingGeometry(p.spatialReference);return s.noClip||s.requestRawData||g==null||!b||(g=await ze(g,p,b)),{...u[0],pixelBlock:g}}const y={rows:d.spacing[0],cols:d.spacing[1]};let x;this.rasterJobHandler?x=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[g],srcMosaicSize:{width:g.width,height:g.height},destDimension:{width:n,height:t},coefs:d.coefficients,sampleSpacing:y,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:l,alignmentInfo:void 0,blockWidths:null},s)).pixelBlock:x=xt(g,{width:n,height:t},d.coefficients,y,l);const w=s.noClip?null:this.getClippingGeometry(e.spatialReference);return s.noClip||s.requestRawData||x==null||w==null||(x=await ze(x,e,w)),{extent:e,srcExtent:u[0].srcExtent,pixelBlock:x}}getClippingGeometry(e){const n=this._clippingGeometry.get("0");if(!e||!n)return n;const t=this._getSRKey(e);let s=this._clippingGeometry.get(t);return s!=null||(s=e.equals(n.spatialReference)?n:Ae(n,e),this._clippingGeometry.set(t,s)),s}_hasSameStorageInfo(e,n){const{storageInfo:t,pixelSize:s,spatialReference:a,extent:r}=e,{storageInfo:o,pixelSize:l,spatialReference:c,extent:h}=n;return s.x===l.x&&s.y===l.y&&a.equals(c)&&r.equals(h)&&t.blockHeight===o.blockHeight&&t.blockWidth===o.blockWidth&&t.maximumPyramidLevel===o.maximumPyramidLevel}async _updateClipGeometry(){const e=this.rasterFunction.getClippingGeometries()[0];let n=e==null?void 0:e.clippingGeometry;if(n&&e.clippingType==="inside"){const{extent:t}=this.rasterInfo,{difference:s,densify:a}=await He(()=>import("./geometryEngine-8LJe6rF3.js"),__vite__mapDeps([0,1,2,3,4]));let r=a(Mt.fromExtent(t),2*(t.width+t.height)/as);r=Ae(r,n.spatialReference),n=s(r,n)}this._clippingGeometry.clear(),n&&this._clippingGeometry.set("0",n)}_getSRKey(e){return String(e.wkid??e.wkt??e.wkt2)}};I([v({type:String,json:{write:!0}})],ne.prototype,"datasetFormat",void 0),I([v()],ne.prototype,"tileType",void 0),I([v()],ne.prototype,"rasterFunction",void 0),I([v()],ne.prototype,"primaryRasters",void 0),ne=I([K("esri.layers.support.rasterDatasets.FunctionRaster")],ne);const It=ne,os=i=>{let e=class extends i{constructor(...t){var s,a;super(...t),this._isConstructedFromFunctionRaster=!1,this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this.bandIds=null,this.copyright=null,this.interpolation="nearest",this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=((a=(s=t[0])==null?void 0:s.raster)==null?void 0:a.datasetFormat)==="Function"}get fullExtent(){var t;return(t=this.serviceRasterInfo)==null?void 0:t.extent}set multidimensionalDefinition(t){this._set("multidimensionalDefinition",t),this.updateRenderer()}set rasterFunction(t){var s;((s=t==null?void 0:t.functionName)==null?void 0:s.toLowerCase())==="none"&&(t=void 0),this._set("rasterFunction",t),this.updateRasterFunction()}get rasterInfo(){return Pt(le.getLogger(this),"rasterInfo",{replacement:"serviceRasterInfo",version:"4.29",warnOnce:!0}),this._get("serviceRasterInfo")}set url(t){this._set("url",ht(t,le.getLogger(this)))}set renderer(t){t==null&&this.rasterFunction==null?this._configDefaultRenderer("override"):(this._set("renderer",t),this.updateRenderer())}readRenderer(t,s,a){var o,l;const r=(l=(o=s==null?void 0:s.layerDefinition)==null?void 0:o.drawingInfo)==null?void 0:l.renderer;return ai(r,a)||void 0}async convertVectorFieldData(t,s){const{serviceRasterInfo:a}=this;if(t==null||!a)return null;const r=this._rasterJobHandler.instance,o=a.dataType;return r?r.convertVectorFieldData({pixelBlock:t,dataType:o},s):Bi(t,o)}async computeStatisticsHistograms(t,s){t=Le(oi,t).clone();const{serviceRasterInfo:a}=this,{geometry:r}=t;if(r==null)throw new O("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let o=r;const{spatialReference:l}=a;r.spatialReference.equals(l)||(await Je(),o=r.type==="extent"?ve(r,l):Ae(r,l));const c=t.pixelSize??new A({x:a.pixelSize.x,y:a.pixelSize.y,spatialReference:l}),{extent:h,width:u,height:m}=rs(a,o,c),f=await this.fetchPixels(h,u,m,{...s,interpolation:"nearest"});if(f.pixelBlock==null)throw new O("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const p=await ze(f.pixelBlock,h,o),g=this._rasterJobHandler.instance;return g?g.computeStatisticsHistograms({pixelBlock:p},s):Ge(p)}async createFlowMesh(t,s){const a=this._rasterJobHandler.instance;return a?a.createFlowMesh(t,s):Ei(t.meshType,t.simulationSettings,t.flowData,s.signal!=null?s.signal:new AbortController().signal)}normalizeRasterFetchOptions(t){var o,l;const{multidimensionalInfo:s}=this.serviceRasterInfo??{};if(s==null)return t;let a=t.multidimensionalDefinition||this.multidimensionalDefinition;a!=null&&a.length||(a=et(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset}));const r=t.timeExtent||this.timeExtent;if(a!=null&&r!=null&&(r.start!=null||r.end!=null)){a=a.map(y=>y.clone());const c=(l=(o=s.variables.find(({name:y})=>y===a[0].variableName))==null?void 0:o.dimensions)==null?void 0:l.find(({name:y})=>y==="StdTime"),h=a.find(({dimensionName:y})=>y==="StdTime");if(!c||!h)return{...t,multidimensionalDefinition:null};const{start:u,end:m}=r,f=u==null?null:u.getTime(),p=m==null?null:m.getTime(),g=f??p,d=p??f;if(c.values!=null){const y=c.values.filter(x=>{if(Array.isArray(x)){if(g===d)return x[0]<=g&&x[1]>=g;const w=x[0]<=g&&x[1]>g||x[0]=d,S=x[0]>=g&&x[1]<=d||x[0]d;return w||S}return g===d?x===g:x>=g&&x<=d});if(y.length){const x=y.sort((w,S)=>{const T=Array.isArray(w)?w[0]:w,b=Array.isArray(w)?w[1]:w,_=Array.isArray(S)?S[0]:S,k=Array.isArray(S)?S[1]:S;return g===d?T-_:Math.abs(b-d)-Math.abs(k-d)})[0];h.values=[x]}else a=null}else if(c.hasRegularIntervals&&c.extent){const[y,x]=c.extent;g>x||d1&&t.forEach(d=>f[d.url]=d);const p=wt(((u=r.functionDefinition)==null?void 0:u.toJSON())??r.toJSON(),f),g=new It({rasterFunction:p});g.rasterJobHandler=this._rasterJobHandler.instance,await g.open(),this._cachedRasterFunctionJson=(m=this.rasterFunction)==null?void 0:m.toJSON(),this.raster=g}else this.raster=s,this._cachedRasterFunctionJson=null,await s.when();if(this._cachedRendererJson=null,!a&&!r)return;const{bandIds:o}=this,{bandCount:l}=this.raster.rasterInfo,c=o!=null&&o.length?o.some(f=>f>=l):l>=3;o&&(c||this.renderer&&this.renderer.type!=="raster-stretch")&&this._set("bandIds",null),this._configDefaultRenderer("auto")}async updateRenderer(){const{loaded:t,symbolizer:s}=this;if(!t||!s||!this.renderer)return;const{rasterInfo:a}=this.raster,r=tt(a,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),o=r==null?void 0:r.name,l=Ke({...this.renderer.toJSON(),variableName:o});if(JSON.stringify(this._cachedRendererJson)===JSON.stringify(l))return;const c=this._rasterJobHandler.instance;c&&(s.rasterInfo=Qe(a,o),s.rendererJSON=l,s.bind(),await c.updateSymbolizer(s),this._cachedRendererJson=l)}async applyRenderer(t,s){const a=t==null?void 0:t.pixelBlock;if(!(a!=null&&a.pixels&&a.pixels.length>0))return null;let r;await this.updateRenderer();const o=this._rasterJobHandler.instance,l=this.bandIds??[];return r=o?await o.symbolize({...t,simpleStretchParams:s,bandIds:l}):this.symbolizer.symbolize({...t,simpleStretchParams:s,bandIds:l}),r}getTileUrl(t,s,a){return this.raster.datasetFormat==="RasterTileServer"?`${this.url}/tile/${t}/${s}/${a}`:""}getCompatibleTileInfo(t,s,a=!1){if(!this.loaded||s==null)return null;if(a&&t.equals(this.spatialReference))return this.tileInfo;const r=Ot(t);return te.create({size:256,spatialReference:t,origin:r?{x:r.origin[0],y:r.origin[1]}:{x:s.xmin,y:s.ymax}})}getCompatibleFullExtent(t){return this.loaded?(this._compatibleFullExtent&&this._compatibleFullExtent.spatialReference.equals(t)||(this._compatibleFullExtent=this.raster.computeExtent(t)),this._compatibleFullExtent):null}async fetchTile(t,s,a,r={}){var l;if(n(this),r.requestAsImageElement){const c=this.getTileUrl(t,s,a);return ft(c,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:r.signal}).then(h=>h.data)}const{serviceRasterInfo:o}=this;if(o.multidimensionalInfo!=null&&(r=this.normalizeRasterFetchOptions(r)).multidimensionalDefinition==null){const c=r.tileInfo||o.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(t,s,a,c),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),((l=this.renderer)==null?void 0:l.type)==="raster-shaded-relief"&&(r={...r,buffer:{cols:1,rows:1}}),this.raster.fetchTile(t,s,a,r)}async fetchPixels(t,s,a,r={}){return this.serviceRasterInfo.multidimensionalInfo!=null&&(r=this.normalizeRasterFetchOptions(r)).multidimensionalDefinition==null?{extent:t,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),s=Math.round(s),a=Math.round(a),this.raster.fetchPixels(t,s,a,r))}async identify(t,s={}){var l;const{raster:a,serviceRasterInfo:r}=this;if(r.multidimensionalInfo!=null&&!(r.hasMultidimensionalTranspose&&(yt(s.multidimensionalDefinition)||s.transposedVariableName||s.timeExtent))&&(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition==null)return{location:t,value:null};const o=(l=this.multidimensionalSubset)==null?void 0:l.areaOfInterest;if(o&&!o.contains(t))throw new O("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");return a.identify(t,s)}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}hasStandardTime(){var r,o,l;const t=(r=this.serviceRasterInfo)==null?void 0:r.multidimensionalInfo;if(t==null||((o=this.serviceRasterInfo)==null?void 0:o.dataType)!=="standard-time")return!1;const s=this.multidimensionalDefinition,a=(l=s==null?void 0:s[0])==null?void 0:l.variableName;return t.variables.some(c=>c.name===a&&(!(s!=null&&s[0].dimensionName)||c.dimensions.some(h=>h.name==="StdTime")))}getStandardTimeValue(t){return new Date(24*(t-25569)*3600*1e3).toString()}getMultidimensionalSubsetVariables(t){var a;const s=t??((a=this.serviceRasterInfo)==null?void 0:a.multidimensionalInfo);return gi(this.multidimensionalSubset,s)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=et(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&this.raster.datasetFormat==="Function"&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}_initJobHandler(){if(this._rasterJobHandler.connectionPromise!=null)return this._rasterJobHandler.connectionPromise;const t=new ui;return this._rasterJobHandler.connectionPromise=t.initialize().then(async()=>{n(this),this._rasterJobHandler.instance=t,this.raster.rasterJobHandler=t,this.raster.datasetFormat==="Function"&&this.raster.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch(()=>{}),this.renderer&&this.updateRenderer()}).catch(()=>{}),this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null,this.raster&&(this.raster.rasterJobHandler=null)}_configDefaultInterpolation(){var t;if(this.interpolation==null){n(this);const{raster:s}=this,a=li(s.rasterInfo,s.tileType,(t=this.sourceJSON)==null?void 0:t.defaultResamplingMethod);this._set("interpolation",a)}}_configDefaultRenderer(t="no"){var h,u;n(this);const{rasterInfo:s}=this.raster;!this.bandIds&&s.bandCount>1&&(this.bandIds=ci(s));const a=tt(s,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),r=a==null?void 0:a.name;if(!this.renderer||t==="override"){const m=Ze(s,{bandIds:this.bandIds,variableName:r}),f=s.statistics,p=f&&f.length>0?f[0]:null,g=(p==null?void 0:p.max)??0,d=(p==null?void 0:p.min)??0;this.raster.datasetFormat==="WCSServer"&&m.type==="raster-stretch"&&(g>1e24||d<-1e24)&&(m.dynamicRangeAdjustment=!0,m.statistics=null,m.stretchType==="none"&&(m.stretchType="min-max")),this.renderer=m}const o=Ke({...this.renderer.toJSON(),variableName:r}),l=Qe(s,r);this.symbolizer?(this.symbolizer.rendererJSON=o,this.symbolizer.rasterInfo=l):this.symbolizer=new wi({rendererJSON:o,rasterInfo:l});const c=this.symbolizer.bind();if(c.success){if(t==="auto"){const{colormap:m}=this.raster.rasterInfo,f=this.renderer;if(m!=null&&f.type==="raster-colormap"){const p=Ze(this.raster.rasterInfo);JSON.stringify(p)!==JSON.stringify(f)&&this._configDefaultRenderer("override")}else if(f.type==="raster-stretch"){const p=(h=this.bandIds)==null?void 0:h.length,g=(u=f.statistics)==null?void 0:u.length;!f.dynamicRangeAdjustment&&g&&p&&g!==p&&this._configDefaultRenderer("override")}}}else le.getLogger(this).warn("imagery-tile-mixin",c.error||"The given renderer is not supported by the layer."),t==="auto"&&this._configDefaultRenderer("override")}};function n(t){if(!t.raster||!t.serviceRasterInfo)throw new O("imagery-tile","no raster")}return I([v({clonable:!1})],e.prototype,"_cachedRendererJson",void 0),I([v({clonable:!1})],e.prototype,"_cachedRasterFunctionJson",void 0),I([v({clonable:!1})],e.prototype,"_compatibleFullExtent",void 0),I([v({clonable:!1})],e.prototype,"_isConstructedFromFunctionRaster",void 0),I([v({clonable:!1})],e.prototype,"_rasterJobHandler",void 0),I([v()],e.prototype,"bandIds",void 0),I([v({json:{origins:{service:{read:{source:"copyrightText"}}}}})],e.prototype,"copyright",void 0),I([v({json:{read:!1}})],e.prototype,"fullExtent",null),I([v()],e.prototype,"interpolation",void 0),I([v()],e.prototype,"ioConfig",void 0),I([v({type:[We],json:{write:!0}})],e.prototype,"multidimensionalDefinition",null),I([v({type:si,json:{write:!0}})],e.prototype,"multidimensionalSubset",void 0),I([v()],e.prototype,"raster",void 0),I([v({type:Ee,json:{name:"renderingRule",write:!0}})],e.prototype,"rasterFunction",null),I([v({readOnly:!0})],e.prototype,"rasterInfo",null),I([v()],e.prototype,"serviceRasterInfo",void 0),I([v()],e.prototype,"sourceJSON",void 0),I([v({readOnly:!0,type:L,json:{read:!1}})],e.prototype,"spatialReference",void 0),I([v({type:te})],e.prototype,"tileInfo",void 0),I([v(dt)],e.prototype,"url",null),I([v({types:ni,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){var s;const t=((s=this.renderer)==null?void 0:s.type)==="raster-stretch"&&this.renderer.stretchType==="none"&&!this.renderer.useGamma;return{enabled:!this.loaded||this.raster.tileType==="Raster"||!t}}},origins:{"web-scene":{types:ri,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:t=>({enabled:t&&t.type!=="vector-field"&&t.type!=="flow"})}}}}})],e.prototype,"renderer",null),I([Ct("renderer")],e.prototype,"readRenderer",null),I([v({clonable:!1})],e.prototype,"symbolizer",void 0),e=I([K("esri.layers.ImageryTileMixin")],e),e};function ls(i){const e=i.fields,n=i.records,t=e.some(c=>c.name.toLowerCase()==="oid")?"OBJECTID":"OID",s=[{name:t,type:"esriFieldTypeOID",alias:"OID"}].concat(e.map(c=>({name:c.name,type:"esriFieldType"+c.typeName,alias:c.name}))),a=s.map(c=>c.name),r=[];let o=0,l=0;return n.forEach(c=>{const h={};for(h[t]=o++,l=1;l0)for(;h.lengthr;){const m=[];n.getUint8(l)===32?(l+=1,c.forEach(f=>{if(f.type==="C")m.push(it(new Uint8Array(e,l,f.length)).trim());else if(f.type==="N")m.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,l,f.length)).trim(),10));else if(f.type==="F")m.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,l,f.length)).trim()));else if(f.type==="D"){const p=String.fromCharCode.apply(null,new Uint8Array(e,l,f.length)).trim();m.push(new Date(parseInt(p.substring(0,4),10),parseInt(p.substring(4,6),10)-1,parseInt(p.substring(6,8),10)))}l+=f.length}),h.push(m)):l+=r}}return{header:o,fields:c,records:h,recordSet:ls({fields:c,records:h})}}};const re=new Map;re.set("int16","esriFieldTypeSmallInteger"),re.set("int32","esriFieldTypeInteger"),re.set("int64","esriFieldTypeInteger"),re.set("float32","esriFieldTypeSingle"),re.set("float64","esriFieldTypeDouble"),re.set("text","esriFieldTypeString");const ct=8;let de=class extends se{constructor(){super(...arguments),this.storageInfo=null,this.datasetFormat="CRF"}async open(e){await this.init();const{data:n}=await this.request(this.url+"/conf.json",{signal:e==null?void 0:e.signal});if(!this._validateHeader(n))throw new O("cloudraster:open","Invalid or unsupported conf.json.");this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const{storageInfo:t,rasterInfo:s}=this._parseHeader(n);if(s.dataType==="thematic"){const a=await this._fetchAuxiliaryInformation();s.attributeTable=a}this._set("storageInfo",t),this._set("rasterInfo",s),this.ioConfig.retryCount=this.ioConfig.retryCount||0}async fetchRawTile(e,n,t,s={}){const{transposeInfo:a}=this.rasterInfo.storageInfo,{transposedVariableName:r}=s,o=!(!a||!r),l=o?0:this.rasterInfo.storageInfo.maximumPyramidLevel-e;if(l<0)return null;const c=this._buildCacheFilePath(l,n,t,s.multidimensionalDefinition,r),h=this._getIndexRecordFromBundle(n,t,o),u=await this.request(c,{range:{from:0,to:this.storageInfo.headerSize-1},responseType:"array-buffer",signal:s.signal});if(!u)return null;const m=new Uint8Array(u.data),f=this._getTileEndAndContentType(m,h);if(f.recordSize===0)return null;const p=await this.request(c,{range:{from:f.position,to:f.position+f.recordSize},responseType:"array-buffer",signal:s.signal});if(!p)return null;const[g,d]=this._getTileSize(o);return this.decodePixelBlock(p.data,{width:g,height:d,planes:null,pixelType:null,returnInterleaved:o})}_validateHeader(e){const n=["origin","extent","geodataXform","LODInfos","blockWidth","blockHeight","bandCount","pixelType","pixelSizeX","pixelSizeY","format","packetSize"];return e&&e.type==="RasterInfo"&&!n.some(t=>!e[t])}_parseHeader(e){var H,W,q,ee,U;const n=["u1","u2","u4","u8","s8","u16","s16","u32","s32","f32","f64"][e.pixelType],{bandCount:t,colormap:s,blockWidth:a,blockHeight:r,firstPyramidLevel:o,maximumPyramidLevel:l}=e,c=(H=e.statistics)==null?void 0:H.map(N=>({min:N.min,max:N.max,avg:N.mean,stddev:N.standardDeviation,median:N.median,mode:N.mode})),h=(ee=(q=(W=e.histograms)==null?void 0:W[0])==null?void 0:q.counts)!=null&&ee.length?e.histograms:null,u=e.extent.spatialReference,m=(U=e.geodataXform)==null?void 0:U.spatialReference,f=new L(u!=null&&u.wkid||u!=null&&u.wkt||u!=null&&u.wkt2?u:m);let p=new z({xmin:e.extent.xmin,ymin:e.extent.ymin,xmax:e.extent.xmax,ymax:e.extent.ymax,spatialReference:f});const g=new A({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:f}),d=Math.round((p.xmax-p.xmin)/g.x),y=Math.round((p.ymax-p.ymin)/g.y),x=this._parseTransform(e.geodataXform),w=x?p:null;x&&(p=x.forwardTransform(p),g.x=(p.xmax-p.xmin)/d,g.y=(p.ymax-p.ymin)/y);const S=e.properties??{},T=e.format.toLowerCase().replace("cache/",""),b=new A(e.origin.x,e.origin.y,f);let _,k,R,F;if(s!=null&&s.colors)for(_=[],k=0;k>>24,R<<8>>>24,R>>>24]);const M=e.LODInfos,P=[];for(k=0;k0)for(k=0;kr.data).catch(()=>null),t=this.request(this.url+"/conf.vat.dbf",{responseType:"array-buffer",signal:e}).then(r=>r.data).catch(()=>null),s=await Promise.all([n,t]);let a;if(s[0]){let r=s[0].fields;const o=s[0].values;if(r&&o){r=r.map(c=>({type:c.name==="OID"?"esriFieldTypeOID":re.get(c.type),name:c.name,alias:c.alias||c.name}));const l=o.map(c=>({attributes:c}));r&&o&&(a={fields:r,features:l})}}return!a&&s[1]&&(a=bt.parse(s[1]).recordSet),_e.fromJSON(a)}_buildCacheFilePath(e,n,t,s,a){const r=this._getPackageSize(!!a),o=Math.floor(n/r)*r,l=Math.floor(t/r)*r,c="R"+this._toHexString4(o)+"C"+this._toHexString4(l);let h="L";h+=e>=10?e.toString():"0"+e.toString();const{multidimensionalInfo:u}=this.rasterInfo,m=s==null?void 0:s[0];if(u==null||!m)return`${this.url}/_alllayers/${h}/${c}.bundle`;let f="_yxs";if(!a){f=u.variables.find(d=>d.name===m.variableName).dimensions[0].values.indexOf(m.values[0]).toString(16);const g=4-f.length;for(let d=0;d0;)n="0"+n}return n}};I([v({readOnly:!0})],de.prototype,"storageInfo",void 0),I([v({type:String,json:{write:!0}})],de.prototype,"datasetFormat",void 0),de=I([K("esri.layers.support.rasterDatasets.CloudRaster")],de);const cs=de;function St(i){return["x","e","east","long","longitude"].includes(i.toLowerCase())}function Rt(i){return["y","n","west","lat","latitude"].includes(i.toLowerCase())}function us(i){const{axes:e}=i.domain,n=Object.keys(e),t=[],s=[];let a=-1,r=-1,o=[];for(let x=0;xT.push(typeof _=="string"?new Date(_).getTime():_));const b=T[1]-T[0];t.push([T[0]-.5*b,T[T.length-1]+.5*b]),s.push(b)}else{const{start:b,stop:_,num:k}=S,R=(_-b)/(k-1);t.push([b-.5*R,_+.5*R]),s.push(R);for(let F=0;F-1&&r===-1?r=a===0?1:0:r>-1&&a===-1?a=r===0?1:0:r===-1&&a===-1&&(a=0,r=1),o=o.filter((x,w)=>!(w===a||w===r));const{referencing:l}=i.domain,c=l.find(x=>x.coordinates.includes(n[a])).system.id,h=c==null?void 0:c.slice(c.lastIndexOf("/")+1),u=h==null||h==="CRS84"?4326:Number(h),m=new L({wkid:u}),[f,p]=t[a],[g,d]=t[r],y=new z({xmin:f,xmax:p,ymin:g,ymax:d,spatialReference:m});return{width:Math.round(y.width/s[a]),height:Math.round(y.height/s[r]),extent:y,dimensions:o}}function Ce(i){const e=$t();return e?i[e]??Object.values(i)[0]:Object.values(i)[0]}function Pe(){return Math.round(255*Math.random())}function hs(i){var t,s;const e={},{parameters:n}=i;if(!n)return e;for(const[a,r]of Object.entries(n)){const{type:o,description:l,unit:c,categoryEncoding:h,observedProperty:u}=r;if(o==="Parameter"&&(e[a]={},l&&(e[a].description=Ce(l)),c&&(e[a].unit=c.label?Ce(c.label):null,e[a].symbol=(t=c.symbol)==null?void 0:t.value),h)){const m=Object.entries(h).map((g,d)=>({OID:d,Value:Number(g[1]),ClassName:g[0].slice(g[0].lastIndexOf("/")+1),Count:1}));let f=!1;(s=u==null?void 0:u.categories)!=null&&s.length&&(u.categories.forEach(g=>{if(!g.id)return;const d=g.id.slice(g.id.lastIndexOf("/")+1),y=m.find(w=>w.ClassName===d);if(!y)return;const x=g.label?Ce(g.label):null;if(y.Label=x,g.preferredColor){const w=Dt.fromHex(g.preferredColor);w&&(f=!0,y.Red=w.r,y.Green=w.g,y.Blue=w.b)}}),f&&m.forEach(g=>{g.Red==null&&(g.Red=Pe(),g.Green=Pe(),g.Blue=Pe())}));const p={objectIdFieldName:"",fields:[{name:"OID",type:"esriFieldTypeOID",alias:"OID",domain:null},{name:"Value",type:"esriFieldTypeInteger",alias:"Value",domain:null},{name:"Count",type:"esriFieldTypeDouble",alias:"Count",domain:null},{name:"ClassName",type:"esriFieldTypeString",alias:"ClassName",domain:null,length:50},{name:"Label",type:"esriFieldTypeString",alias:"Label",domain:null,length:50}],features:m.map(g=>({attributes:g}))};f&&p.fields.push({name:"Red",type:"esriFieldTypeInteger",alias:"Red",domain:null},{name:"Green",type:"esriFieldTypeInteger",alias:"Green",domain:null},{name:"Blue",type:"esriFieldTypeInteger",alias:"Blue",domain:null}),e[a].attributeTable=p}}return e}function fs(i){let e=Number.MAX_VALUE,n=-Number.MAX_VALUE;for(let t=0;tn&&(n=s))}return Ji(e,n)}function ms(i,e,n){const t=i.map((l,c)=>({name:l,count:e[c]})).sort((l,c)=>l.name>c.name?-1:1),s=(a=1,l=>a*=l.count);var a;const r=[...t.slice(1),{name:"",count:1}].reverse().map(s).reverse();let o=0;for(let l=i.length-1;l>=0;l--)o+=r[t.findIndex(({name:c})=>c===i[l])]*(n%e[l]),n=Math.floor(n/e[l]);return o}function ds(i){var m;const{width:e,height:n,extent:t,dimensions:s}=us(i),{ranges:a}=i,r=Object.keys(a).sort((f,p)=>fl[f.name]&&Object.assign(f,l[f.name]));const c=o.length?{variables:o}:void 0,h=[];for(let f=0;f2?f*x.slice(0,-2).reduce((R,F)=>R*F):0,S=y.slice(0,-2),T=x.slice(0,-2),b=d==="float"?"f32":fs(g),_=e*n,k=g.length/_;for(let R=0;Rf.attributeTable))==null?void 0:m.attributeTable;return{extent:t,pixelBlocks:h,multidimensionalInfo:c,attributeTable:u,bandNames:c?void 0:r}}let ce=class extends se{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.source=null}get url(){return""}async open(i){await this.init();const e=this.source,{pixelBlocks:n,attributeTable:t,statistics:s,histograms:a,name:r,nativeExtent:o,transform:l}=e,c=n[0],{width:h,height:u,pixelType:m}=c,f=e.extent??new z({xmin:-.5,ymin:.5,xmax:h-.5,ymax:u-.5,spatialReference:new L({wkid:3857})}),p=e.isPseudoSpatialReference??!e.extent,g={x:f.width/h,y:f.height/u},d={...e.keyProperties};t&&(d.DataType="Thematic");const y=new xe({width:h,height:u,pixelType:m,extent:f,nativeExtent:o,attributeTable:t,transform:l,pixelSize:g,spatialReference:f.spatialReference,bandCount:c.pixels.length,keyProperties:d,multidimensionalInfo:e.multidimensionalInfo,statistics:s,isPseudoSpatialReference:p,histograms:a});this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(y),this.createRemoteDatasetStorageInfo(y,512,512),this._set("rasterInfo",y),this.updateTileInfo(),y.multidimensionalInfo?await this._buildMDimStats(e.pixelBlocks,y.multidimensionalInfo):await this._buildInMemoryRaster(c,{width:512,height:512},i),y.multidimensionalInfo||(this.source=null),this.datasetName=r}fetchRawTile(i,e,n,t={}){if(!this._pixelBlockTiles){const{rasterInfo:a}=this,[r,o]=a.storageInfo.tileInfo.size,{sliceId:l}=t,{pixelBlocks:c}=this.source,h={pixelBlock:l==null?c[0]:c[l],useBilinear:a.dataType!=="thematic",tileSize:{width:r,height:o},level:i,row:e,col:n},u=this.rasterJobHandler?this.rasterJobHandler.clipTile(h,t):Ai(h);return Promise.resolve(u)}const s=this._pixelBlockTiles.get(`${i}/${e}/${n}`);return Promise.resolve(s)}async _buildInMemoryRaster(i,e,n){var u,m;const{rasterInfo:t}=this,s=t.storageInfo.maximumPyramidLevel??0,a=t.dataType!=="thematic",r=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:i,tileSize:e,maximumPyramidLevel:s,useBilinear:a},n):Promise.resolve(zi(i,e,s,a)),o=t.statistics!=null,l=t.histograms!=null,c=this.ioConfig.skipStatistics||o?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:i},n):Promise.resolve(Ii(i)),h=await pt([r,c]);if(!h[0].value&&h[1].value)throw new O("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=h[0].value,o||(t.statistics=(u=h[1].value)==null?void 0:u.statistics),l||(t.histograms=(m=h[1].value)==null?void 0:m.histograms)}async _buildMDimStats(i,e,n){for(let t=0;t{var h,u;return new We({variableName:s.name,dimensionName:c.name,values:[((h=c.values)==null?void 0:h[0])??((u=c.extent)==null?void 0:u[0])],isSlice:!0})}),r=gt(a,e),o=r==null?null:i[r];if(o==null)continue;const l=this.rasterJobHandler?await this.rasterJobHandler.computeStatisticsHistograms({pixelBlock:o},n):Ge(o);s.statistics=l.statistics,s.histograms||(s.histograms=l.histograms)}}};I([v({type:String,json:{write:!0}})],ce.prototype,"datasetFormat",void 0),I([v()],ce.prototype,"source",void 0),I([v()],ce.prototype,"url",null),ce=I([K("esri.layers.support.rasterDatasets.InMemoryRaster")],ce);const Ue=ce;let pe=class extends se{constructor(){super(...arguments),this.datasetFormat="CovJSON"}async open(e){await this.init();const{extent:n,pixelBlocks:t,multidimensionalInfo:s,attributeTable:a,bandNames:r}=await this._fetchData(e),{statistics:o,histograms:l}=Ge(t[0]),c=r==null?void 0:r.map(f=>({BandName:f})),h={DataType:a?"Thematic":s?"Scientific":"Generic",BandProperties:c},u=new Ue({source:{extent:n,pixelBlocks:t,attributeTable:a?_e.fromJSON(a):null,multidimensionalInfo:s,statistics:o,histograms:l,keyProperties:h,isPseudoSpatialReference:!1}});await u.open(),this._inMemoryRaster=u;const m=this.source?"":this.url.slice(this.url.lastIndexOf("/")+1);this._set("datasetName",m.slice(0,m.indexOf("."))),this._set("rasterInfo",u.rasterInfo)}fetchRawTile(e,n,t,s={}){return this._inMemoryRaster.fetchRawTile(e,n,t,s)}async _fetchData(e){var a,r,o,l;const n=this.source??(await this.request(this.url,{signal:e==null?void 0:e.signal})).data,t="imagery-tile-layer:open-coverage-json";if(((a=n.type)==null?void 0:a.toLowerCase())!=="coverage"||((o=(r=n.domain)==null?void 0:r.domainType)==null?void 0:o.toLowerCase())!=="grid")throw new O(t,"Only coverage with Grid domain type is supported");if(!n.ranges)throw new O(t,"Missing ranges in the grid coverage data");if(!((l=n.domain.referencing)!=null&&l.length))throw new O(t,"Missing domain referencing in the grid coverage data");const s=Object.values(n.ranges);for(let c=0;ct.push(o));return t}const s=i.getElementsByTagNameNS("*",n);if(!s||s.length===0)return[];for(let a=0;a0?e?V(t[0],e):t[0]:null}function Z(i,e=null){const n=e?V(i,e):i;let t;return n?(t=n.textContent||n.nodeValue,t?t.trim():null):null}function ys(i,e){const n=fe(i,e),t=[];let s;for(let a=0;aNumber(n))}function oe(i,e){const n=Z(i,e);return Number(n)}function Oe(i,e){var s;const n=(s=i==null?void 0:i.nodeName)==null?void 0:s.toLowerCase(),t=e.toLowerCase();return n.slice(n.lastIndexOf(":")+1)===t}function ut(i,e){if(!i||!e)return null;const n=[];for(let t=0;tNumber(f));let o,l,c,h;fe(i,"Metadata/MDI").forEach(f=>{const p=Number(f.textContent??f.nodeValue);switch(f.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":o=p;break;case"STATISTICS_MAXIMUM":l=p;break;case"STATISTICS_MEAN":c=p;break;case"STATISTICS_STDDEV":h=p}});const u=oe(i,"Metadata/SourceBandIndex");return{noDataValue:e,histogram:r!=null&&r.length&&t!=null&&s!=null?{min:t,max:s,size:a||r.length,counts:r}:null,sourceBandIndex:u,statistics:o!=null&&l!=null?{min:o,max:l,avg:c,stddev:h}:null}}function ke(i){if(!i)return null;let e=Number(i);if(!isNaN(e)&&e!==0)return new L({wkid:e});if(i=String(i).trim(),Nt(i))return new L({wkt2:i});const n=i.toUpperCase();if(n.startsWith("COMPD_CS")){if(!n.includes("VERTCS")||!n.includes("GEOGCS")&&!n.startsWith("PROJCS"))return null;const t=n.indexOf("VERTCS"),s=n.indexOf("PROJCS"),a=s>-1?s:n.indexOf("GEOGCS");if(a===-1)return null;const r=i.slice(a,i.lastIndexOf("]",t)+1).trim(),o=i.slice(t,i.lastIndexOf("]")).trim();e=De(r);const l=new L(e?{wkid:e}:{wkt:r}),c=De(o);return c&&(l.vcsWkid=c),l}return n.startsWith("GEOGCS")||n.startsWith("PROJCS")?(e=De(i),new L(e!==0?{wkid:e}:{wkt:i})):null}function De(i){var s;const e=i.replaceAll("]","[").replaceAll('"',"").split("[").map(a=>a.trim()).filter(a=>a!==""),n=e[e.length-1].split(","),t=(s=n[0])==null?void 0:s.toLowerCase();if((t==="epsg"||t==="esri")&&i.endsWith('"]]')){const a=Number(n[1]);if(!isNaN(a)&&a!==0)return a}return 0}function Ve(i){var t;if(((t=i==null?void 0:i.documentElement.tagName)==null?void 0:t.toLowerCase())!=="pamdataset")return{};const e={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};i.documentElement.childNodes.forEach(s=>{if(s.nodeType===1){if(Oe(s,"SRS")){if(!e.spatialReference){const a=Z(s);e.spatialReference=ke(a)}}else if(Oe(s,"Metadata"))if(s.getAttribute("domain")==="xml:ESRI"){const{spatialReference:a,transform:r}=gs(s);e.transform=r,e.spatialReference||(e.spatialReference=a)}else fe(s,"MDI").forEach(a=>e.metadata[a.getAttribute("key")]=Z(a));else if(Oe(s,"PAMRasterBand")){const a=xs(s);a.sourceBandIndex!=null&&e.rasterBands[a.sourceBandIndex]==null?e.rasterBands[a.sourceBandIndex]=a:e.rasterBands.push(a)}}});const n=e.rasterBands;if(n.length){const s=!!n[0].statistics;e.statistics=s?n.map(r=>r.statistics).filter(Be):null;const a=!!n[0].histogram;e.histograms=a?n.map(r=>r.histogram).filter(Be):null}return e}let Te=class extends se{async open(i){await this.init();const e=await this._fetchData(i);let{spatialReference:n,statistics:t,histograms:s,transform:a}=await this._fetchAuxiliaryData(i);const r=!n;r&&(n=new L({wkid:3857})),s!=null&&s.length&&t==null&&(t=je(s));const{width:o,height:l}=e;let c=new z({xmin:-.5,ymin:.5-l,xmax:o-.5,ymax:.5,spatialReference:n});const h=a?a.forwardTransform(c):c;let u=!0;if(a){const f=a.forwardCoefficients;u=f&&f[1]===0&&f[2]===0,u&&(a=null,c=h)}const m=new Ue({source:{extent:h,nativeExtent:c,transform:a,pixelBlocks:[e],statistics:t,histograms:s,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:r},ioConfig:{sampling:"closest",skipStatistics:!0}});this.ioConfig.skipMapInfo&&(m.ioConfig.skipMapInfo=!0),await m.open(),m.source=null,this._set("rasterInfo",m.rasterInfo),this._inMemoryRaster=m}fetchRawTile(i,e,n,t={}){return this._inMemoryRaster.fetchRawTile(i,e,n,t)}async _fetchData(i){const{data:e}=await this.request(this.url,{responseType:"array-buffer",signal:i==null?void 0:i.signal}),n=bi(e).toUpperCase();if(n!=="JPG"&&n!=="PNG"&&n!=="GIF"&&n!=="BMP")throw new O("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",n);const t=n.toLowerCase(),s=t==="gif"||t==="bmp"||!Bt("ios"),a=await this.decodePixelBlock(e,{format:t,useCanvas:s,hasNoZlibMask:!0});if(a==null)throw new O("image-aux-raster:open","the data cannot be decoded");return a}async _fetchAuxiliaryData(i){var h;const e=i==null?void 0:i.signal,{skipExtensions:n=[],skipMapInfo:t}=this.ioConfig,s=t||n.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:e}),a=this.datasetFormat,r=a==="JPG"?"jgw":a==="PNG"?"pgw":a==="BMP"?"bpw":null,o=r&&n.includes(r)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+r,{responseType:"text",signal:e}),l=await pt([s,o]);if(e!=null&&e.aborted)throw Et();const c=Ve((h=l[0].value)==null?void 0:h.data);if(!c.transform){const u=l[1].value?l[1].value.data.split(` +`).slice(0,6).map(m=>Number(m)):null;c.transform=(u==null?void 0:u.length)===6?new qe({forwardCoefficients:[u[4],u[5],u[0],-u[1],u[2],-u[3]]}):null}return c}};I([v({type:String,json:{write:!0}})],Te.prototype,"datasetFormat",void 0),Te=I([K("esri.layers.support.rasterDatasets.ImageAuxRaster")],Te);const Re=Te;let ye=class extends se{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async open(i){var _,k;await this.init();const e=i==null?void 0:i.signal,n=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:e});n.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const t=n.data;if(this.sourceJSON=t,!t)throw new O("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!t.tileInfo)throw new O("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo();const s=["jpg","jpeg","png","png8","png24","png32","mixed"];this.tileType=t.cacheType,this.tileType==null&&(s.includes(t.tileInfo.format.toLowerCase())?this.tileType="Map":t.tileInfo.format.toLowerCase()==="lerc"?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=((_=t.name)==null?void 0:_.slice(t.name.indexOf("/")+1))??"";const a=await this._fetchRasterInfo({signal:e});if(a==null)throw new O("image-server-raster:open","cannot initialize image service");hi(a,t);const r=this.tileType==="Map"?ws(t.tileInfo,t):te.fromJSON(t.tileInfo);Jt(r);const[o,l]=this._computeMinMaxLOD(a,r),{extent:c,pixelSize:h}=a,u=.5/a.width*h.x,m=Math.max(h.x,h.y),{lods:f}=r;(this.tileType!=="Map"&&t.maxScale!==0||Math.abs(h.x-h.y)>u||!f.some(R=>Math.abs(R.resolution-m){R.level>=l.level&&R.level<=o.level&&y.push({x:R.resolution,y:R.resolution}),FR.x-F.x);const w=this.computeBlockBoundary(c,g,d,r.origin,y,p),S=y.length>1?y.slice(1):null;let T;t.transposeInfo&&(T={tileSize:[t.transposeInfo.rows,t.transposeInfo.cols],packetSize:((k=a.keyProperties)==null?void 0:k._yxs.PacketSize)??0});const b=x.length<=1||x.length>=3&&x.slice(0,-1).every(R=>R===x[0])?x[0]??2:Math.round(10/(l.resolution/o.resolution)**(-1/p))/10;if(a.storageInfo=new ge({blockWidth:r.size[0],blockHeight:r.size[1],pyramidBlockWidth:r.size[0],pyramidBlockHeight:r.size[1],pyramidResolutions:S,pyramidScalingFactor:b,compression:r.format,origin:r.origin,firstPyramidLevel:1,maximumPyramidLevel:p,tileInfo:r,transposeInfo:T,blockBoundary:w}),this._fixGCSShift(a),this._set("rasterInfo",a),t.capabilities.toLowerCase().includes("tilemap")){const R={tileInfo:a.storageInfo.tileInfo,parsedUrl:At(this.url),url:this.url,tileServers:[]};this._tilemapCache=new zt({layer:R})}}async fetchRawTile(i,e,n,t={}){const{storageInfo:s,extent:a}=this.rasterInfo,{transposeInfo:r}=s,o=r!=null&&!!t.transposedVariableName;if(this._slices&&!o&&t.sliceId==null)return null;const l=o?0:s.maximumPyramidLevel-i+this._levelOffset,c=`${this.url}/tile/${l}/${e}/${n}`,h=this._slices?o?{variable:t.transposedVariableName}:{sliceId:t.sliceId||0}:null,{data:u}=await this.request(c,{query:h,responseType:"array-buffer",signal:t.signal});if(!u)return null;const m=o?r.tileSize:s.tileInfo.size,f=await this.decodePixelBlock(u,{width:m[0],height:m[1],planes:null,pixelType:null,isPoint:this.tileType==="Elevation",returnInterleaved:o,noDataValue:this.rasterInfo.noDataValue});if(f==null)return null;const p=s.blockBoundary[i];if(s.compression!=="jpg"||n>p.minCol&&np.minRow&&e{const a=e.find(r=>s.variableName===r.variableName&&r.dimensionName===s.dimensionName);return a?(Array.isArray(s.values[0])?`${s.values[0][0]}-${s.values[0][1]}`:s.values[0])!==(Array.isArray(a.values[0])?`${a.values[0][0]}-${a.values[0][1]}`:a.values[0]):!0}))return n}return null}async fetchVariableStatisticsHistograms(i,e){var a,r,o;const n=this.request(this.url+"/statistics",{query:{variable:i,f:"json"},signal:e}).then(l=>{var c;return(c=l.data)==null?void 0:c.statistics}),t=this.request(this.url+"/histograms",{query:{variable:i,f:"json"},signal:e}).then(l=>{var c;return(c=l.data)==null?void 0:c.histograms}),s=await Promise.all([n,t]);return s[0]&&s[0].forEach(l=>{l.avg=l.mean,l.stddev=l.standardDeviation}),(o=(r=(a=s[1])==null?void 0:a[0])==null?void 0:r.counts)!=null&&o.length||(s[1]=null),{statistics:s[0]||null,histograms:s[1]||null}}async computeBestPyramidLevelForLocation(i,e={}){if(!this._tilemapCache)return 0;let n=this.identifyPixelLocation(i,0,e.datumTransformation);if(n===null)return null;let t=0;const{maximumPyramidLevel:s}=this.rasterInfo.storageInfo;let a=s-t+this._levelOffset;const r=n.srcLocation;for(;a>=0;){try{if(await this._tilemapCache.fetchAvailability(a,n.row,n.col,e)==="available")break}catch{}if(a--,t++,n=this.identifyPixelLocation(r,t,e.datumTransformation),n===null)return null}return a===-1||n==null?null:t}async _fetchRasterInfo(i){const e=this.sourceJSON;if(this.tileType==="Map"){const r=e.fullExtent||e.extent,o=Math.ceil((r.xmax-r.xmin)/e.pixelSizeX-.1),l=Math.ceil((r.ymax-r.ymin)/e.pixelSizeY-.1),c=L.fromJSON(e.spatialReference||r.spatialReference),h=new A({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:c});return new xe({width:o,height:l,bandCount:3,extent:z.fromJSON(r),spatialReference:c,pixelSize:h,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const{signal:n}=i,t=fi(this.url,this.sourceJSON,{signal:n,query:this.ioConfig.customFetchParameters}),s=e.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:n}).then(r=>{var o;return(o=r.data)==null?void 0:o.slices}).catch(()=>null):null,a=await Promise.all([t,s]);return this._slices=a[1],a[0]}_fixScaleInServiceInfo(){const{sourceJSON:i}=this;i.minScale&&i.minScale<0&&(i.minScale=0),i.maxScale&&i.maxScale<0&&(i.maxScale=0)}_fixGCSShift(i){const{extent:e,spatialReference:n}=i;e.xmin>-1&&e.xmax>181&&(n!=null&&n.wkid)&&n.isGeographic&&(i.nativeExtent=i.extent,i.transform=new Vi,i.extent=i.transform.forwardTransform(e))}_computeMinMaxLOD(i,e){const{pixelSize:n}=i,t=.5/i.width*n.x,{lods:s}=e,a=e.lodAt(Math.max.apply(null,s.map(m=>m.level))),r=e.lodAt(Math.min.apply(null,s.map(m=>m.level))),{tileType:o}=this;if(o==="Map")return this._levelOffset=s[0].level,[a,r];if(o==="Raster")return[s.find(m=>m.resolution===n.x)??a,r];const{minScale:l,maxScale:c}=this.sourceJSON;let h=a;c>0&&(h=s.find(m=>Math.abs(m.scale-c)m.scale>c).sort((m,f)=>m.scale>f.scale?1:-1)[0]??a));let u=r;return l>0&&(u=s.find(m=>Math.abs(m.scale-l)r!=null&&r>=s&&r<=a)});if(n!==0&&t!==0){const r=c=>Math.round(1e4*c)/1e4,o=n?r(n):1/0,l=t?r(t):-1/0;return te.fromJSON({...i,lods:i.lods.filter(c=>{const h=r(c.scale);return h<=o&&h>=l})})}return te.fromJSON(i)}I([v({type:String,json:{write:!0}})],ye.prototype,"datasetFormat",void 0),I([v()],ye.prototype,"tileType",void 0),ye=I([K("esri.layers.support.rasterDatasets.ImageServerRaster")],ye);const Is=ye,Q=new Map;Q.set("Int8","s8"),Q.set("UInt8","u8"),Q.set("Int16","s16"),Q.set("UInt16","u16"),Q.set("Int32","s32"),Q.set("UInt32","u32"),Q.set("Float32","f32"),Q.set("Float64","f32"),Q.set("Double64","f32");const ie=new Map;ie.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),ie.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),ie.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),ie.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let ue=class extends se{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async open(i){await this.init(),this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const e=i?i.signal:null,n=await this.request(this.url,{responseType:"xml",signal:e}),{rasterInfo:t,files:s}=this._parseHeader(n.data),{skipMapInfo:a,skipExtensions:r=[]}=this.ioConfig;if(!r.includes("aux.xml")&&!a){const y=await this._fetchAuxiliaryData(i);y!=null&&(t.statistics=y.statistics??t.statistics,t.histograms=y.histograms,y.histograms&&t.statistics==null&&(t.statistics=je(y.histograms)))}a&&this.updateImageSpaceRasterInfo(t),this._set("rasterInfo",t),this._files=s;const o=await this.request(s.index,{responseType:"array-buffer",signal:e});this._storageIndex=this._parseIndex(o.data);const{blockWidth:l,blockHeight:c}=this.rasterInfo.storageInfo,h=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:u,height:m}=this.rasterInfo,f=[],p=this._getBandSegmentCount();let g=0,d=-1;for(;g0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=d),this.updateTileInfo()}async fetchRawTile(i,e,n,t={}){const{blockWidth:s,blockHeight:a,blockBoundary:r}=this.rasterInfo.storageInfo,o=r[i];if(!o||o.maxRowe||o.minCol>n)return null;const{bandCount:l,pixelType:c}=this.rasterInfo,{ranges:h,actualTileWidth:u,actualTileHeight:m}=this._getTileLocation(i,e,n);if(!h||h.length===0)return null;if(h[0].from===0&&h[0].to===0){const M=new Uint8Array(s*a);return new Y({width:s,height:a,pixels:null,mask:M,validPixelCount:0})}const{bandIds:f}=this.ioConfig,p=this._getBandSegmentCount(),g=[];let d=0;for(d=0;dM.data.byteLength).reduce((M,P)=>M+P),w=new Uint8Array(x),S=[];let T=0;for(d=0;d1e24)for(d=0;d1e-6&&(P[d]=1);else for(d=0;d0)throw new Error("invalid array buffer must be multiples of 16");let e,n,t,s,a,r;if(Si){for(n=new Uint8Array(i),s=new ArrayBuffer(i.byteLength),t=new Uint8Array(s),a=0;aparseFloat(M)))),V(i,"MRF_META/CachedSource"))throw new O("mrf:open","currently does not support MRF referencing other data files");const g=V(i,"MRF_META/GeoTags"),d=V(g,"BoundingBox");let y,x=!1;if(d!=null){const M=parseFloat(d.getAttribute("minx")),P=parseFloat(d.getAttribute("miny")),B=parseFloat(d.getAttribute("maxx")),C=parseFloat(d.getAttribute("maxy")),D=Z(g,"Projection")||"";let $=L.WGS84;if(D!=="LOCAL_CS[]")if(D.toLowerCase().startsWith("epsg:")){const E=Number(D.slice(5));isNaN(E)||E===0||($=new L({wkid:E}))}else $=ke(D)??L.WGS84;else x=!0,$=new L({wkid:3857});y=new z(M,P,B,C),y.spatialReference=$}else x=!0,y=new z({xmin:-.5,ymin:.5-s,xmax:t-.5,ymax:.5,spatialReference:new L({wkid:3857})});const w=V(i,"MRF_META/Rsets"),S=parseInt((w==null?void 0:w.getAttribute("scale"))||"2",10),T=y.spatialReference,b=new ge({origin:new A({x:y.xmin,y:y.ymax,spatialReference:T}),blockWidth:h,blockHeight:u,pyramidBlockWidth:h,pyramidBlockHeight:u,compression:r,pyramidScalingFactor:S}),_=new A({x:y.width/t,y:y.height/s,spatialReference:T}),k=new xe({width:t,height:s,extent:y,isPseudoSpatialReference:x,spatialReference:T,bandCount:a,pixelType:l,pixelSize:_,noDataValue:f,storageInfo:b}),R=Z(i,"datafile"),F=Z(i,"IndexFile");return{rasterInfo:k,files:{mrf:this.url,index:F||this.url.replace(".mrf",".idx"),data:R||this.url.replace(".mrf",ie.get(r).blobExtension)}}}async _fetchAuxiliaryData(i){try{const{data:e}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:i==null?void 0:i.signal});return Ve(e)}catch{return null}}};I([v()],ue.prototype,"_files",void 0),I([v()],ue.prototype,"_storageIndex",void 0),I([v({type:String,json:{write:!0}})],ue.prototype,"datasetFormat",void 0),ue=I([K("esri.layers.support.rasterIO.MRFRaster")],ue);const bs=ue,$e=(i,e)=>{var n;return(n=i.get(e))==null?void 0:n.values},me=(i,e)=>{var n,t;return(t=(n=i.get(e))==null?void 0:n.values)==null?void 0:t[0]};let ae=class extends se{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this.datasetFormat="TIFF"}async open(i){var g,d,y,x;await this.init();const e=i?i.signal:null,{data:n}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:e});if(!n)throw new O("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const{littleEndian:t,firstIFDPos:s,isBigTiff:a}=Ri(n),r=[];await this._readIFDs(r,n,t,s,0,a?8:4,e);const{imageInfo:o,rasterInfo:l}=this._parseIFDs(r),c=vi(r),h=Ti(r);if(this._headerInfo={littleEndian:t,isBigTiff:a,ifds:r,pyramidIFDs:c,maskIFDs:h,...o},this._set("rasterInfo",l),!o.isSupported)throw new O("tiffraster:open","this tiff is not supported: "+o.message);if(!o.tileWidth)throw new O("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");l.isPseudoSpatialReference&&le.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");const u=(d=(g=r[0].get("PREDICTOR"))==null?void 0:g.values)==null?void 0:d[0];if(((x=(y=r[0].get("SAMPLEFORMAT"))==null?void 0:y.values)==null?void 0:x[0])===3&&u===2)throw new O("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floating point data");const{skipMapInfo:f,skipExtensions:p=[]}=this.ioConfig;if(!p.includes("aux.xml")&&!f){const w=await this._fetchAuxiliaryMetaData(i);w!=null&&this._processPAMInfo(w,l)}p.includes("vat.dbf")||l.bandCount!==1||l.pixelType!=="u8"||f||(l.attributeTable=await this._fetchAuxiliaryTable(i),l.attributeTable!=null&&(l.keyProperties.DataType="thematic")),f&&this.updateImageSpaceRasterInfo(l),this.updateTileInfo()}async fetchRawTile(i,e,n,t={}){var a;if(!((a=this._headerInfo)!=null&&a.isSupported)||this.isBlockOutside(i,e,n))return null;const s=await this._fetchRawTiffTile(i,e,n,!1,t);if(s!=null&&this._headerInfo.hasMaskBand){const r=await this._fetchRawTiffTile(i,e,n,!0,t);r!=null&&r.pixels[0]instanceof Uint8Array&&(s.mask=r.pixels[0])}return s}_parseIFDs(i){var P,B;const e=_i(i),{width:n,height:t,tileWidth:s,tileHeight:a,planes:r,pixelType:o,compression:l,firstPyramidLevel:c,maximumPyramidLevel:h,pyramidBlockWidth:u,pyramidBlockHeight:m,tileBoundary:f,affine:p,metadata:g}=e,d=((P=e.extent.spatialReference)==null?void 0:P.wkt)||((B=e.extent.spatialReference)==null?void 0:B.wkid);let y=ke(d),x=!!e.isPseudoGeographic;y==null&&(x=!0,y=new L({wkid:3857}));const w=new z({...e.extent,spatialReference:y}),S=new A(w?{x:w.xmin,y:w.ymax,spatialReference:y}:{x:0,y:0}),T=new ge({blockWidth:s,blockHeight:a,pyramidBlockWidth:u,pyramidBlockHeight:m,compression:l,origin:S,firstPyramidLevel:c,maximumPyramidLevel:h,blockBoundary:f}),b=new A({x:(w.xmax-w.xmin)/n,y:(w.ymax-w.ymin)/t,spatialReference:y}),_=g?{BandProperties:g.bandProperties,DataType:g.dataType}:{};let k=null;const R=me(i[0],"PHOTOMETRICINTERPRETATION"),F=$e(i[0],"COLORMAP");if(R<=3&&(F==null?void 0:F.length)>3&&F.length%3==0){k=[];const C=F.length/3;for(let D=0;D>>8,F[D+C]>>>8,F[D+2*C]>>>8])}const M=new xe({width:n,height:t,bandCount:r,pixelType:o,pixelSize:b,storageInfo:T,spatialReference:y,isPseudoSpatialReference:x,keyProperties:_,extent:w,colormap:k,statistics:g?g.statistics:null});return p!=null&&p.length&&(M.nativeExtent=new z({xmin:-.5,ymin:.5-t,xmax:n-.5,ymax:.5,spatialReference:y}),M.transform=new qe({polynomialOrder:1,forwardCoefficients:[p[2]+p[0]/2,p[5]-p[3]/2,p[0],p[3],-p[1],-p[4]]}),M.extent=M.transform.forwardTransform(M.nativeExtent),M.pixelSize=new A({x:(w.xmax-w.xmin)/n,y:(w.ymax-w.ymin)/t,spatialReference:y}),T.origin.x=-.5,T.origin.y=.5),{imageInfo:e,rasterInfo:M}}_processPAMInfo(i,e){if(e.statistics=i.statistics??e.statistics,e.histograms=i.histograms,i.histograms&&e.statistics==null&&(e.statistics=je(i.histograms)),i.transform&&e.transform==null){e.transform=i.transform,e.nativeExtent=e.extent;const n=e.transform.forwardTransform(e.nativeExtent);e.pixelSize=new A({x:(n.xmax-n.xmin)/e.width,y:(n.ymax-n.ymin)/e.height,spatialReference:e.spatialReference}),e.extent=n}e.isPseudoSpatialReference&&i.spatialReference&&(e.spatialReference=i.spatialReference,e.extent.spatialReference=e.nativeExtent.spatialReference=e.storageInfo.origin.spatialReference=e.spatialReference)}async _readIFDs(i,e,n,t,s,a=4,r){if(!t)return null;(t>=e.byteLength||t<0)&&(e=(await this.request(this.url,{range:{from:t+s,to:t+s+this._bufferSize},responseType:"array-buffer",signal:r})).data,s=t+s,t=0);const o=await this._readIFD(e,n,t,s,we.tiffTags,a,r);if(i.push(o.ifd),!o.nextIFD)return null;await this._readIFDs(i,e,n,o.nextIFD-s,s,a,r)}async _readIFD(i,e,n,t,s=we.tiffTags,a=4,r){var l,c;if(!i)return null;const o=ki(i,e,n,t,s,a);if(o.success){const h=[];if((l=o.ifd)==null||l.forEach(u=>{u.values||h.push(u)}),h.length>0){const u=h.map(f=>f.offlineOffsetSize).filter(Be),m=Math.min.apply(null,u.map(f=>f[0]));if(Math.min.apply(null,u.map(f=>f[0]+f[1]))-m<=this._bufferSize){const{data:f}=await this.request(this.url,{range:{from:m,to:m+this._bufferSize},responseType:"array-buffer",signal:r});i=f,t=m,h.forEach(p=>Fi(i,e,p,t))}}if((c=o.ifd)!=null&&c.has("GEOKEYDIRECTORY")){const u=o.ifd.get("GEOKEYDIRECTORY"),m=u==null?void 0:u.values;if(m&&m.length>4){const f=m[0]+"."+m[1]+"."+m[2],p=await this._readIFD(i,e,u.valueOffset+6-t,t,we.geoKeys,2,r);u.data=p.ifd,u.data&&u.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[f]})}}return o}if(o.requiredBufferSize&&o.requiredBufferSize!==i.byteLength)return(i=(await this.request(this.url,{range:{from:t,to:t+o.requiredBufferSize+4},responseType:"array-buffer",signal:r})).data).byteLengththis.request(this.url,{range:b,responseType:"array-buffer",signal:s.signal})),u=await Promise.all(h),m=u.map(b=>b.data.byteLength).reduce((b,_)=>b+_),f=u.length===1?u[0].data:new ArrayBuffer(m),p=[0],g=[0];if(u.length>1){const b=new Uint8Array(f);for(let _=0,k=0;_p||n>g||ee.add(t)),e}static async open(e){var u;const{url:n,ioConfig:t,source:s,sourceJSON:a}=e;let r=e.datasetFormat??(t==null?void 0:t.datasetFormat);r==null&&(n.includes(".")?r=n.slice(n.lastIndexOf(".")+1).toUpperCase():((u=s==null?void 0:s.type)==null?void 0:u.toLowerCase())==="coverage"?r="CovJSON":s!=null&&s.extent&&s.pixelblocks&&(r="MEMORY")),r==="OVR"||r==="TIF"?r="TIFF":r==="JPG"||r==="JPEG"||r==="JFIF"?r="JPG":r==="COVJSON"&&(r="CovJSON"),n.toLowerCase().includes("/imageserver")&&!n.toLowerCase().includes("/wcsserver")&&(r="RasterTileServer");const o={url:n,source:s,sourceJSON:a,datasetFormat:r,ioConfig:t??{bandIds:null,sampling:null}};if(Object.keys(o).forEach(m=>{o[m]==null&&delete o[m]}),r){if(!this.supportedFormats.has(r))throw new O("rasterfactory:open","not a supported format "+r);if(r==="CRF"&&!(t!=null&&t.enableCRF))throw new O("rasterfactory:open",`cannot open raster: ${n}`);const m=new(j.get(r)).constructor(o);return await m.open({signal:e.signal}),m}const l=Array.from(j.keys()).filter(m=>m!=="CovJSON"&&m!=="Memory");let c=0;const h=()=>{if(r=l[c++],!r||r==="CRF"&&!(t!=null&&t.enableCRF))return null;const m=new(j.get(r)).constructor(o);return m.open({signal:e.signal}).then(()=>m).catch(()=>h())};return h()}static register(e,n,t){j.has(e.toUpperCase())||j.set(e.toUpperCase(),{desc:n,constructor:t})}}let J=class extends Lt(Ht(Wt(Gt(jt(os(Ki(qt(Yi(Ut(Vt(ii))))))))))){constructor(...i){super(...i),this._primaryRasters=[],this.bandIds=null,this.interpolation=null,this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this.source=void 0,this._debouncedSaveOperations=Xt(async(e,n,t)=>{const{save:s,saveAs:a}=await He(()=>import("./imageryUtils-CP_eOmeO.js"),__vite__mapDeps([5,6,2,3,7,8,9,10]));switch(e){case be.SAVE:return s(this,n);case be.SAVE_AS:return a(this,t,n)}})}normalizeCtorArgs(i,e){return typeof i=="string"?{url:i,...e}:i}load(i){const e=i!=null?i.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},i).catch(Yt).then(()=>this._openRaster(e))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){var o;const i=[new he({name:"Raster.ServicePixelValue",alias:"Pixel Value",domain:null,editable:!1,length:50,type:"string"}),new he({name:"Raster.ServicePixelValue.Raw",alias:"Raw Pixel Value",domain:null,editable:!1,length:50,type:"string"})],{serviceRasterInfo:e}=this,n=e==null?void 0:e.attributeTable,t=n!=null?n.fields:null,s="Raster.";if(t){const l=t.filter(c=>c.type!=="oid"&&c.name.toLowerCase()!=="value").map(c=>{const h=c.clone();return h.name=s+c.name,h});i.push(...l)}const a=e==null?void 0:e.dataType,r=e==null?void 0:e.multidimensionalInfo;if((a==="vector-magdir"||a==="vector-uv")&&r!=null){const l=(o=r.variables[0].unit)==null?void 0:o.trim(),c="Magnitude"+(l?` (${l})`:"");i.push(new he({name:"Raster.Magnitude",alias:c,domain:null,editable:!1,type:"double"})),i.push(new he({name:"Raster.Direction",alias:"Direction (°)",domain:null,editable:!1,type:"double"}))}return i}createPopupTemplate(i){const{rasterFields:e}=this,n=new Set(e.map(({name:t})=>t).filter(t=>t.toLowerCase()!=="raster.servicepixelvalue.raw"));return Qi({fields:e,title:this.title},{...i,visibleFieldNames:n})}async generateRasterInfo(i,e){if(!(i=Le(Ee,i)))return this.serviceRasterInfo;try{const{rasterInfo:n}=await this._openFunctionRaster(i,e);return n}catch(n){throw n instanceof O?n:new O("imagery-tile-layer","the given raster function is not supported")}}async save(i){return this._debouncedSaveOperations(be.SAVE,i)}async saveAs(i,e){return this._debouncedSaveOperations(be.SAVE_AS,e,i)}write(i,e){const n=this._primaryRasters[0]??this.raster;if(this.loaded?n.datasetFormat==="RasterTileServer"&&(n.tileType==="Raster"||n.tileType==="Map"):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(i,e);if(e!=null&&e.messages){const t=`${e.origin}/${e.layerContainerType||"operational-layers"}`;e.messages.push(new O("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${t}'`,{layer:this}))}return null}async _openRaster(i){let e=!1;if(this.raster)await this._openFromRaster(this.raster,i),e=this.raster.datasetFormat==="Function";else{const{url:t,rasterFunction:s,source:a}=this;if(!t&&!a)throw new O("imagery-tile-layer:open","missing url or source parameter");a?await this._openFromSource(a,i):s?await this._openFromUrlWithRasterFunction(t,s,i):await this._openFromUrl(t,i)}const n=this.raster.rasterInfo;if(!n)throw new O("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("serviceRasterInfo",e?n:this._primaryRasters[0].rasterInfo),this._set("spatialReference",n.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,this.sourceJSON!=null){const t=this.raster.tileType==="Map"&&this.sourceJSON.minLOD!=null&&this.sourceJSON.maxLOD!=null?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(t,{origin:"service"})}else this.read({tileInfo:this.serviceRasterInfo.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),this.raster.tileType==="Map"&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles(Kt(()=>this.customParameters,t=>{this.raster&&(this.raster.ioConfig.customFetchParameters=t)}))}async _openFromRaster(i,e){i.rasterInfo||await i.open({signal:e}),this._primaryRasters=i.datasetFormat==="Function"?i.primaryRasters.rasters:[i],this.url||(this.url=this._primaryRasters[0].url)}async _openFromUrlWithRasterFunction(i,e,n){const t=[i];e&&Xi(e.toJSON(),t);const s=await Promise.all(t.map(r=>Ne.open({url:r,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:n}))),a=s.findIndex(r=>r==null);if(a>-1)throw new O("imagery-tile-layer:open",`cannot open raster: ${t[a]}`);return this._primaryRasters=s,this._initializeWithFunctionRaster(e)}async _openFromUrl(i,e){const n=await Ne.open({url:i,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e});if(n==null)throw new O("imagery-tile-layer:open",`cannot open raster: ${i}`);this._primaryRasters=[n],this.raster=n}async _openFromSource(i,e){var a;const n="the tiled imagery data source is not supported",t=((a=i.type)==null?void 0:a.toLowerCase())==="coverage"?"CovJSON":i.extent&&i.pixelBlock?"MEMORY":null;if(!t)throw new O("imagery-tile-layer:open",n);t==="MEMORY"&&(i={extent:i.extent,pixelBlocks:[i.pixelBlock]});const s=await Ne.open({url:"",source:i,datasetFormat:t,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e});if(s==null)throw new O("imagery-tile-layer:open",n);this._primaryRasters=[s],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=s}async _openFunctionRaster(i,e){var a;const n={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(r=>n[r.url]=r);const t=wt(((a=i.functionDefinition)==null?void 0:a.toJSON())??i.toJSON(),n),s=new It({rasterFunction:t});return await s.open(e),s}async _initializeWithFunctionRaster(i,e){try{this.raster=await this._openFunctionRaster(i,e)}catch(n){n instanceof O&&le.getLogger(this).error("imagery-tile-layer:open",n.message),le.getLogger(this).warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=this._primaryRasters[0]}}};I([v({clonable:!1})],J.prototype,"_primaryRasters",void 0),I([v({type:[Qt],json:{write:{overridePolicy(){var i;return{enabled:!this.loaded||this.raster.tileType==="Raster"||((i=this.bandIds)==null?void 0:i.join(","))!=="0,1,2"}}}}})],J.prototype,"bandIds",void 0),I([v({json:{write:{overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"||this.interpolation!=="bilinear"}}}}}),Zt(mi)],J.prototype,"interpolation",void 0),I([v(ei)],J.prototype,"legendEnabled",void 0),I([v({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],J.prototype,"isReference",void 0),I([v({type:["show","hide"]})],J.prototype,"listMode",void 0),I([v({json:{read:!0,write:!0}})],J.prototype,"blendMode",void 0),I([v()],J.prototype,"sourceJSON",void 0),I([v({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],J.prototype,"version",void 0),I([v({readOnly:!0,json:{read:!1}})],J.prototype,"type",void 0),I([v({type:["ArcGISTiledImageServiceLayer"]})],J.prototype,"operationalLayerType",void 0),I([v({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(i,e)=>!e.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"}},writer(i,e,n){e[n]=!i}}}})],J.prototype,"popupEnabled",void 0),I([v({type:ti,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"}}}}})],J.prototype,"popupTemplate",void 0),I([v({readOnly:!0})],J.prototype,"defaultPopupTemplate",null),I([v({readOnly:!0,type:[he]})],J.prototype,"fields",void 0),I([v({readOnly:!0,type:[he]})],J.prototype,"rasterFields",null),I([v({constructOnly:!0})],J.prototype,"source",void 0),J=I([K("esri.layers.ImageryTileLayer")],J);const Qs=J;export{Qs as default}; diff --git a/assets/ImageryTileLayerView2D-CxFrn228.js b/assets/ImageryTileLayerView2D-DAJXGdeV.js similarity index 97% rename from assets/ImageryTileLayerView2D-CxFrn228.js rename to assets/ImageryTileLayerView2D-DAJXGdeV.js index 367ee95..c304f52 100644 --- a/assets/ImageryTileLayerView2D-CxFrn228.js +++ b/assets/ImageryTileLayerView2D-DAJXGdeV.js @@ -1 +1 @@ -import{fV as U,L as j,eO as z,eH as pe,eI as A,eJ as L,eK as fe,eL as ge,eM as ae,t as Q,l as _e,U as ye,D as xe,g4 as k,hf as H,ij as $,ai as ne,f$ as be,d as h,y as p,f as M,a7 as we,i0 as ve,k as Te,r as J,aE as Pe,la as Se,h as Re,m as Ie,dZ as K,aA as Ue,b as F,s as C,fl as $e,g as D,bK as Fe,N as Y,j as Ce,ez as ze,P as Me}from"./index-CEWggaxV.js";import{o as X}from"./multidimensionalUtils-uKyVhR8j.js";import{f as Ve,d as Be,a as Le}from"./RasterVFDisplayObject-boi924Q6.js";import{a as ke,m as De,u as Ge}from"./LayerView-BEFTHNYv.js";import{i as Oe,E as O,r as oe}from"./Container-CB7SlLB9.js";import{c as Ee,f as Ae,m as Z,O as I,h as v,_ as q,A as je,p as qe,l as We,T as Ne,g as Qe}from"./rasterUtils-Dgn5fnGK.js";import{e as He,m as Je}from"./Texture-DJgkMrSB.js";import{t as Ke,a as ee,r as le}from"./WGLContainer-B_Pv-8Yi.js";import{x as Ye}from"./Program-DLRmaKpw.js";import{i as ue}from"./TileContainer-Ci6dOowA.js";import{u as Xe,S as Ze}from"./dataUtils-BFJflGP5.js";import{g as te,a as se,i as et,u as tt}from"./RawBlockCache-D9cjIDVu.js";import{D as st,a as rt,s as re,v as it}from"./rasterProjectionHelper-Bwvi37wQ.js";import{p as at}from"./popupUtils-BovqErR_.js";import{i as nt}from"./RefreshableLayerView-C1-PEoNB.js";import"./ProgramTemplate-BICQrNzS.js";import"./LabelMetric-D2hbzzy_.js";import"./scaleUtils-Bqauo1zZ.js";import"./highlightReasons-DbgbcWKM.js";import"./config-MDUrh2eL.js";import"./earcut-hRlx3adE.js";import"./featureConversionUtils-CmP9mw0r.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";const ot={bandCount:3,outMin:0,outMax:1,minCutOff:[0,0,0],maxCutOff:[255,255,255],factor:[1/255,1/255,1/255],useGamma:!1,gamma:[1,1,1],gammaCorrection:[1,1,1],colormap:null,colormapOffset:null,stretchType:"none",type:"stretch"};class lt extends Oe{constructor(e=null,t=null,r=null){super(),this._textureInvalidated=!0,this._colormapTextureInvalidated=!0,this._rasterTexture=null,this._rasterTextureBandIds=null,this._transformGridTexture=null,this._colormapTexture=null,this._colormap=null,this._supportsBilinearTexture=!0,this._processedTexture=null,this.functionTextures=[],this.projected=!1,this.stencilRef=0,this.coordScale=[1,1],this._processed=!1,this._symbolizerParameters=null,this.height=null,this.isRendereredSource=!1,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this.rawPixelData=null,this._suspended=!1,this._bandIds=null,this._interpolation=null,this._transformGrid=null,this.width=null,this.x=0,this.y=0,this.source=e,this.transformGrid=t,this.interpolation=r}destroy(){this._disposeTextures()}get processedTexture(){return this._processedTexture}set processedTexture(e){this._processedTexture!==e&&(this._disposeTextures(!0),this._processedTexture=e)}get rasterTexture(){return this._rasterTexture}set rasterTexture(e){var t;this._rasterTexture!==e&&((t=this._rasterTexture)==null||t.dispose(),this._rasterTexture=e),e==null&&(this.projected=!1)}get processed(){return this._processed}set processed(e){this._processed=e,e||(U(this.processedTexture),this.invalidateTexture())}get symbolizerParameters(){return this._symbolizerParameters||ot}set symbolizerParameters(e){this._symbolizerParameters!==e&&(this._symbolizerParameters=e,this._colormapTextureInvalidated=!0,this.commonUniforms=null)}get source(){return this._source}set source(e){this._source!==e&&(this._source=e,this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this.commonUniforms=null,this.projected=!1,this.invalidateTexture())}get suspended(){return this._suspended}set suspended(e){this._suspended&&!e&&this.stage&&(this.ready(),this.requestRender()),this._suspended=e}get bandIds(){return this._bandIds}set bandIds(e){this._bandIds=e,this._isBandIdsChanged(e)&&(this.projected=!1,this.invalidateTexture())}get interpolation(){return this._interpolation||"nearest"}set interpolation(e){this._interpolation=e,this._rasterTexture&&this._rasterTexture.setSamplingMode(this._getTextureSamplingMethod(e||"nearest")==="bilinear"?j.LINEAR:j.NEAREST)}get transformGrid(){return this._transformGrid}set transformGrid(e){this._transformGrid!==e&&(this._transformGrid=e,this._transformGridTexture=U(this._transformGridTexture))}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRender())}getRasterTextureSize(e=!1){var r,i;const t=e||this.projected;return[t?this.width:((r=this.source)==null?void 0:r.width)||this.width,t?this.height:((i=this.source)==null?void 0:i.height)||this.height]}getRasterCellSize(){var i;const e=(i=this.rawPixelData)==null?void 0:i.srcPixelSize,{projected:t,resolution:r}=this;return e&&!t?[e.x,e.y]:[r,r]}_createTransforms(){return{displayViewScreenMat3:z()}}setTransform(e){const t=pe(this.transforms.displayViewScreenMat3),[r,i]=e.toScreenNoRotation([0,0],[this.x,this.y]),a=this.resolution/this.pixelRatio/e.resolution,n=a*this.width,o=a*this.height,l=Math.PI*this.rotation/180;A(t,t,L(r,i)),A(t,t,L(n/2,o/2)),fe(t,t,-l),A(t,t,L(-n/2,-o/2)),ge(t,t,L(n,o)),ae(this.transforms.displayViewScreenMat3,e.displayViewMat3,t)}getTextures({forProcessing:e=!1,useProcessedTexture:t=!1}={}){const r=t?this._processedTexture??this._rasterTexture:this._rasterTexture,i=[],a=[];return r?(this._transformGridTexture&&!this.projected&&(a.push(this._transformGridTexture),i.push("u_transformGrid")),t?(a.push(r),i.push("u_image"),this._colormapTexture&&(a.push(this._colormapTexture),i.push("u_colormap")),{names:i,textures:a}):(a.push(r),i.push("u_image"),this._colormapTexture&&!e&&(a.push(this._colormapTexture),i.push("u_colormap")),{names:i,textures:a})):{names:i,textures:a}}onAttach(){this.invalidateTexture()}onDetach(){this.invalidateTexture()}updateTexture({context:e}){if(!this.stage)return void this._disposeTextures();const t=this._isValidSource(this.source);t&&this._colormapTextureInvalidated&&(this._colormapTextureInvalidated=!1,this._updateColormapTexture(e)),this._textureInvalidated&&(this._textureInvalidated=!1,this._createOrDestroyRasterTexture(e),this._rasterTexture&&(t?this.transformGrid&&!this._transformGridTexture&&(this._transformGridTexture=Ee(e,this.transformGrid)):this._rasterTexture.setData(null)),this.suspended||(this.ready(),this.requestRender()))}updateProcessedTexture(){const{functionTextures:e}=this;e.length!==0&&(this.processedTexture=e.shift(),e.forEach(t=>t==null?void 0:t.dispose()),e.length=0)}_createOrDestroyRasterTexture(e){var n,o;const t=(n=this.source)==null?void 0:n.extractBands(this.bandIds);if(!this._isValidSource(t))return void(this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null));const r=!this._isBandIdsChanged(this.bandIds);if(this._rasterTexture){if(r)return;this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null}this._supportsBilinearTexture=!!((o=e.capabilities.textureFloat)!=null&&o.textureFloatLinear);const i=this._getTextureSamplingMethod(this.interpolation),a=this.isRendereredSource;this._rasterTexture=Ae(e,t,i,a),this.projected=!1,this._processed=!1,this._rasterTextureBandIds=this.bandIds?[...this.bandIds]:null}_isBandIdsChanged(e){const t=this._rasterTextureBandIds;return!(t==null&&e==null||t&&e&&t.join("")===e.join(""))}_isValidSource(e){var t;return e!=null&&((t=e.pixels)==null?void 0:t.length)>0}_getTextureSamplingMethod(e){const{type:t}=this.symbolizerParameters,r=t==="lut"||t==="hillshade"||t==="stretch"&&this.symbolizerParameters.bandCount===1;return!this._supportsBilinearTexture||r||e!=="bilinear"&&e!=="cubic"?"nearest":"bilinear"}_updateColormapTexture(e){const t=this._colormap,r=this.symbolizerParameters.colormap;return r?t?r.length!==t.length||r.some((i,a)=>i!==t[a])?(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),this._colormapTexture=Z(e,r),void(this._colormap=r)):void 0:(this._colormapTexture=Z(e,r),void(this._colormap=r)):(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),void(this._colormap=null))}_disposeTextures(e=!1){!this._transformGridTexture||e&&!this.projected||(this._transformGridTexture.dispose(),this._transformGridTexture=null),!e&&this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null,this._colormap=null,this._colormapTextureInvalidated=!0),!e&&this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this._processedTexture&&(this._processedTexture.dispose(),this._processedTexture=null)}}function ut(s){return s.source!=null}function W(s){const e=[];return s&&(e.push("applyProjection"),s.spacing[0]===1&&e.push("lookupProjection")),e}function ce(s,e,t){var a;const r=!((a=t.capabilities.textureFloat)!=null&&a.textureFloatLinear),i=[];return s==="cubic"?i.push("bicubic"):s==="bilinear"&&(e?(i.push("bilinear"),i.push("nnedge")):r&&i.push("bilinear")),i}const ct={vsPath:"raster/common",fsPath:"raster/lut",attributes:new Map([["a_position",0],["a_texcoord",1]])};function ht(s,e,t){const r=t?[]:W(e.transformGrid);return{defines:r,program:s.painter.materialManager.getProgram(ct,r)}}function dt(s,e,t,r,i=!1){const{names:a,textures:n}=t.getTextures({useProcessedTexture:i});I(s.context,e,a,n),v(e,r,t.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",t.transforms.displayViewScreenMat3);const{colormap:o,colormapOffset:l}=t.symbolizerParameters,u=q(o,l);v(e,r,u)}const mt={createProgram:ht,bindTextureAndUniforms:dt},pt={vsPath:"raster/common",fsPath:"raster/hillshade",attributes:new Map([["a_position",0],["a_texcoord",1]])};function ft(s,e,t){const{colormap:r}=e.symbolizerParameters,i=[...t?[]:W(e.transformGrid),...ce(e.interpolation,!0,s.context)];return r!=null&&i.push("applyColormap"),{defines:i,program:s.painter.materialManager.getProgram(pt,i)}}function gt(s,e,t,r,i=!1){const{names:a,textures:n}=t.getTextures({useProcessedTexture:i});I(s.context,e,a,n),v(e,r,t.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",t.transforms.displayViewScreenMat3);const o=t.symbolizerParameters,{colormap:l,colormapOffset:u}=o;if(l!=null){const d=q(l,u);v(e,r,d)}const m=je(o);v(e,r,m)}const _t={createProgram:ft,bindTextureAndUniforms:gt},yt={vsPath:"raster/common",fsPath:"raster/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};function xt(s,e,t){const{colormap:r,bandCount:i}=e.symbolizerParameters,a=[...t?[]:W(e.transformGrid),...ce(e.interpolation,i===1,s.context)];return e.isRendereredSource&&!t?a.push("noop"):r!=null&&a.push("applyColormap"),{defines:a,program:s.painter.materialManager.getProgram(yt,a)}}function bt(s,e,t,r,i=!1){const{names:a,textures:n}=t.getTextures({useProcessedTexture:i});I(s.context,e,a,n),v(e,r,t.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",t.transforms.displayViewScreenMat3);const o=t.symbolizerParameters,{colormap:l,colormapOffset:u}=o;if(l!=null){const d=q(l,u);v(e,r,d)}const m=qe(o);v(e,r,m)}const wt={createProgram:xt,bindTextureAndUniforms:bt},G=new Map;function vt(s){return G.get(s)}G.set("lut",mt),G.set("hillshade",_t),G.set("stretch",wt);const Tt=[1,1],Pt=[2,0,0,0,2,0,-1,-1,0];function b(s,e,t){const{context:r,rasterFunction:i,hasBranches:a}=s,{raster:n}=i.parameters,o=a?(n==null?void 0:n.id)??-1:0,l=t.functionTextures[o]??t.rasterTexture;I(r,e,["u_image"],[l])}function he(s,e,t){const{rasters:r}=s.rasterFunction.parameters;if(!r)return;if(r.length<2)return b(s,e,t);const i=r.filter(a=>a.name!=="Constant").map(a=>a.id!=null&&a.name!=="Identity"?t.functionTextures[a.id]:t.rasterTexture);if(I(s.context,e,["u_image","u_image1","u_image2"].slice(0,i.length),i),i.length!==r.length){if(r.length===2){const a=r.findIndex(l=>l.name==="Constant"),n=a===0?[0,1,0,1,0,0,0,0,0]:[1,0,0,0,1,0,0,0,0],{value:o}=r[a].parameters;e.setUniform1f("u_image1Const",o),e.setUniformMatrix3fv("u_imageSwap",n)}else if(r.length===3){const a=[];if(r.forEach((n,o)=>n.name==="Constant"&&a.push(o)),a.length===1){const{value:n}=r[a[0]].parameters;e.setUniform1f("u_image1Const",n);const o=a[0]===0?[0,1,0,0,0,1,1,0,0]:a[0]===1?[1,0,0,0,0,1,0,1,0]:[1,0,0,0,1,0,0,0,1];e.setUniformMatrix3fv("u_imageSwap",o)}else if(a.length===2){const{value:n}=r[a[0]].parameters;e.setUniform1f("u_image1Const",n);const{value:o}=r[a[1]].parameters;e.setUniform1f("u_image2Const",o);const l=r.findIndex(m=>m.name!=="Constant"),u=l===0?[1,0,0,0,1,0,0,0,1]:l===1?[0,1,0,1,0,0,0,0,1]:[0,0,1,1,0,0,0,1,0];e.setUniformMatrix3fv("u_imageSwap",u)}}}}function y(s){s.setUniform2fv("u_coordScale",Tt),s.setUniformMatrix3fv("u_dvsMat3",Pt)}const St={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/aspect",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Rt(s,e){return s.painter.materialManager.getProgram(St,[])}function It(s,e,t){b(s,e,t),y(e);const r=t.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",r);const i=t.getRasterCellSize();e.setUniform2fv("u_cellSize",i)}const Ut={createProgram:Rt,bindTextureAndUniforms:It},$t={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/bandarithmetic",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Ft(s,e){const{painter:t,rasterFunction:r}=s,{indexType:i}=r.parameters;return t.materialManager.getProgram($t,[i])}function Ct(s,e,t){b(s,e,t),y(e);const{bandIndexMat3:r}=s.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",r)}const zt={createProgram:Ft,bindTextureAndUniforms:Ct},Mt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/compositeband",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Vt(s,e){const t=s.rasterFunction.parameters.rasters.filter(i=>i.name==="Constant"),r=[];return t.length&&(r.push("oneConstant"),t.length===2&&r.push("twoConstant")),s.painter.materialManager.getProgram(Mt,r)}function Bt(s,e,t){he(s,e,t),y(e)}const Lt={createProgram:Vt,bindTextureAndUniforms:Bt},kt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/contrast",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Dt(s,e){return s.painter.materialManager.getProgram(kt,[])}function Gt(s,e,t){b(s,e,t),y(e);const{contrastOffset:r,brightnessOffset:i}=s.rasterFunction.parameters;e.setUniform1f("u_contrastOffset",r),e.setUniform1f("u_brightnessOffset",i)}const Ot={createProgram:Dt,bindTextureAndUniforms:Gt},Et={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/convolution",attributes:new Map([["a_position",0],["a_texcoord",1]])};function At(s,e){const{painter:t,rasterFunction:r}=s,{kernelRows:i,kernelCols:a}=r.parameters,n=[{name:"rows",value:i},{name:"cols",value:a}];return t.materialManager.getProgram(Et,n)}function jt(s,e,t){b(s,e,t),y(e),e.setUniform2fv("u_srcImageSize",[t.width,t.height]);const{kernel:r,clampRange:i}=s.rasterFunction.parameters;e.setUniform1fv("u_kernel",r),e.setUniform2fv("u_clampRange",i)}const qt={createProgram:At,bindTextureAndUniforms:jt},Wt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/curvature",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Nt(s,e){const{painter:t,rasterFunction:r}=s,{curvatureType:i}=r.parameters,a=[i];return t.materialManager.getProgram(Wt,a)}function Qt(s,e,t){b(s,e,t),y(e);const r=t.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",r);const{zFactor:i}=s.rasterFunction.parameters,a=t.getRasterCellSize();e.setUniform1f("u_zlFactor",200*i/a[0]/a[1])}const Ht={createProgram:Nt,bindTextureAndUniforms:Qt},Jt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/extractband",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Kt(s,e){return s.painter.materialManager.getProgram(Jt,[])}function Yt(s,e,t){b(s,e,t),y(e);const{bandIndexMat3:r}=s.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",r)}const Xt={createProgram:Kt,bindTextureAndUniforms:Yt},Zt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/focalstatistics",attributes:new Map([["a_position",0],["a_texcoord",1]])};function es(s,e){const{painter:t,rasterFunction:r}=s,{kernelRows:i,kernelCols:a,fillNoDataOnly:n,statisticsType:o}=r.parameters,l=[{name:"rows",value:i},{name:"cols",value:a},o];return n&&l.push("fill"),t.materialManager.getProgram(Zt,l)}function ts(s,e,t){b(s,e,t),y(e),e.setUniform2fv("u_srcImageSize",[t.width,t.height]);const{clampRange:r}=s.rasterFunction.parameters;e.setUniform2fv("u_clampRange",r)}const ss={createProgram:es,bindTextureAndUniforms:ts},rs={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/grayscale",attributes:new Map([["a_position",0],["a_texcoord",1]])};function is(s,e){return s.painter.materialManager.getProgram(rs,[])}function as(s,e,t){b(s,e,t),y(e);const{weights:r}=s.rasterFunction.parameters;e.setUniform3fv("u_weights",r)}const ns={createProgram:is,bindTextureAndUniforms:as},os={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/local",attributes:new Map([["a_position",0],["a_texcoord",1]])};function ls(s){const{painter:e,rasterFunction:t}=s,{imageCount:r,operationName:i,rasters:a,isOutputRounded:n}=t.parameters,o=[i.toLowerCase()];r===2&&o.push("twoImages");const l=a.filter(u=>u.name==="Constant");return l.length&&(o.push("oneConstant"),l.length===2&&o.push("twoConstant")),n&&o.push("roundOutput"),e.materialManager.getProgram(os,o)}function us(s,e,t){he(s,e,t),y(e);const{domainRange:r}=s.rasterFunction.parameters;e.setUniform2fv("u_domainRange",r)}const ie={createProgram:ls,bindTextureAndUniforms:us},cs={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/mask",attributes:new Map([["a_position",0],["a_texcoord",1]])};function hs(s,e){const{painter:t,rasterFunction:r}=s,i=r.parameters.bandCount>1?["multiBand"]:[];return t.materialManager.getProgram(cs,i)}function ds(s,e,t){b(s,e,t),y(e);const{includedRanges:r,noDataValues:i}=s.rasterFunction.parameters;e.setUniform1fv("u_includedRanges",r),e.setUniform1fv("u_noDataValues",i)}const ms={createProgram:hs,bindTextureAndUniforms:ds},ps={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/ndvi",attributes:new Map([["a_position",0],["a_texcoord",1]])};function fs(s,e){const{painter:t,rasterFunction:r}=s,i=r.parameters.scaled?["scaled"]:[];return t.materialManager.getProgram(ps,i)}function gs(s,e,t){b(s,e,t),y(e);const{bandIndexMat3:r}=s.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",r)}const _s={createProgram:fs,bindTextureAndUniforms:gs},ys={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/remap",attributes:new Map([["a_position",0],["a_texcoord",1]])};function xs(s,e){return s.painter.materialManager.getProgram(ys,[])}function bs(s,e,t){b(s,e,t),y(e);const{noDataRanges:r,rangeMaps:i,allowUnmatched:a,clampRange:n}=s.rasterFunction.parameters;e.setUniform1fv("u_noDataRanges",r),e.setUniform1fv("u_rangeMaps",i),e.setUniform1f("u_unmatchMask",a?1:0),e.setUniform2fv("u_clampRange",n)}const ws={createProgram:xs,bindTextureAndUniforms:bs},vs={vsPath:"raster/common",fsPath:"raster/reproject",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Ts(s,e){var o;const{painter:t}=s,r=[],{interpolation:i,transformGrid:a}=e,n=(o=s.rasterFunction)==null?void 0:o.parameters;return i==="cubic"?r.push("bicubic"):i==="bilinear"&&(r.push("bilinear"),n!=null&&n.requireNNEdge&&r.push("nnedge")),a&&(r.push("applyProjection"),a.spacing[0]===1&&r.push("lookupProjection")),t.materialManager.getProgram(vs,r)}function Ps(s,e,t){const{names:r,textures:i}=t.getTextures({forProcessing:!0});I(s.context,e,r,i),e.setUniform1f("u_scale",1),e.setUniform2fv("u_offset",[0,0]),e.setUniform2fv("u_coordScale",[1,1]),e.setUniformMatrix3fv("u_dvsMat3",[2,0,0,0,2,0,-1,-1,0]),e.setUniform1i("u_flipY",0),e.setUniform1f("u_opacity",1);const{width:a,height:n,source:o,transformGrid:l}=t;e.setUniform2fv("u_srcImageSize",[o.width,o.height]),e.setUniform2fv("u_targetImageSize",[a,n]),e.setUniform2fv("u_transformSpacing",l?l.spacing:Q),e.setUniform2fv("u_transformGridSize",l?l.size:Q)}const Ss={createProgram:Ts,bindTextureAndUniforms:Ps},Rs={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/slope",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Is(s,e){const{painter:t,rasterFunction:r}=s,{slopeType:i}=r.parameters,a=i==="percent-rise"?["percentRise"]:[];return t.materialManager.getProgram(Rs,a)}function Us(s,e,t){b(s,e,t),y(e);const r=t.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",r);const i=t.getRasterCellSize();e.setUniform2fv("u_cellSize",i);const{zFactor:a,slopeType:n,pixelSizePower:o,pixelSizeFactor:l}=s.rasterFunction.parameters;e.setUniform1f("u_zFactor",a),e.setUniform1f("u_pixelSizePower",n==="adjusted"?o:0),e.setUniform1f("u_pixelSizeFactor",n==="adjusted"?l:0)}const $s={createProgram:Is,bindTextureAndUniforms:Us},Fs={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Cs(s,e){const{useGamma:t,bandCount:r,isOutputRounded:i}=s.rasterFunction.parameters,a=[];return t&&a.push("useGamma"),r>1&&a.push("multiBand"),i&&a.push("roundOutput"),s.painter.materialManager.getProgram(Fs,a)}function zs(s,e,t){b(s,e,t),y(e);const{width:r,height:i}=t,a=s.rasterFunction.parameters;e.setUniform2fv("u_srcImageSize",[r,i]),e.setUniform1f("u_minOutput",a.outMin),e.setUniform1f("u_maxOutput",a.outMax),e.setUniform1fv("u_factor",a.factor),e.setUniform1fv("u_minCutOff",a.minCutOff),e.setUniform1fv("u_maxCutOff",a.maxCutOff),e.setUniform1fv("u_gamma",a.gamma),e.setUniform1fv("u_gammaCorrection",a.gammaCorrection)}const Ms={createProgram:Cs,bindTextureAndUniforms:zs},_=new Map;function de(s,e){const t=new He;return t.width=s,t.height=e,t.internalFormat=_e.RGBA32F,t.samplingMode=j.NEAREST,t.dataType=ye.FLOAT,t.isImmutable=!0,t.wrapMode=xe.CLAMP_TO_EDGE,t}function Vs(s,e,t,r){const{context:i,requestRender:a,allowDelayedRender:n}=s,o=r.createProgram(s,t);return n&&a!=null&&!o.compiled?(a(),null):(i.bindFramebuffer(e),i.setViewport(0,0,e.width,e.height),i.useProgram(o),o)}function Bs(s){return _.get(s.toLowerCase())}function Ls(s,e,t,r){const i=s.rasterFunction.name.toLowerCase(),a=i==="reproject"?Ss:Bs(i);if(a==null)return;const n=Vs(s,t,r,a);if(!n)return;a.bindTextureAndUniforms(s,n,r);const{interpolation:o}=r;i==="reproject"&&(r.interpolation="nearest"),e.draw();const[l,u]=r.getRasterTextureSize(i==="reproject"),m=de(l,u),d=new Je(s.context,m);if(t.copyToTexture(0,0,l,u,0,0,d),i==="reproject")r.rasterTexture=d,r.projected=!0,r.interpolation=o;else{const c=s.hasBranches?s.rasterFunction.id:0;r.functionTextures[c]=d}}_.set("arithmetic",ie),_.set("aspect",Ut),_.set("bandarithmetic",zt),_.set("compositeband",Lt),_.set("convolution",qt),_.set("contrastbrightness",Ot),_.set("curvature",Ht),_.set("extractband",Xt),_.set("statistics",ss),_.set("grayscale",ns),_.set("local",ie),_.set("mask",ms),_.set("ndvi",_s),_.set("remap",ws),_.set("slope",$s),_.set("stretch",Ms);class ks extends Ke{constructor(){super(...arguments),this.name="raster",this._quad=null,this._rendererUniformInfos=new Map,this._fbo=null}dispose(){U(this._quad),U(this._fbo)}prepareState(e){const{context:t,renderPass:r}=e,i=r==="raster";t.setBlendingEnabled(!i),t.setBlendFunctionSeparate(k.ONE,k.ONE_MINUS_SRC_ALPHA,k.ONE,k.ONE_MINUS_SRC_ALPHA),t.setColorMask(!0,!0,!0,!0),t.setStencilWriteMask(0),t.setStencilTestEnabled(!i)}draw(e,t){if(!ut(t)||t.suspended)return;const{renderPass:r}=e;if(r!=="raster-bitmap")return r==="raster"?this._process(e,t):void this._drawBitmap(e,t,!0);this._drawBitmap(e,t)}_process(e,t){const{rasterFunction:r}=e,i=r.name==="Reproject";if(!(i?!(t.rasterTexture&&t.projected):!t.processed))return;const{timeline:a,context:n}=e;a.begin(this.name);const o=n.getBoundFramebufferObject(),l=n.getViewport();i||(t.processedTexture=U(t.processedTexture)),n.setStencilFunction(H.EQUAL,t.stencilRef,255),t.updateTexture(e),this._initQuad(n);const[u,m]=t.getRasterTextureSize(i),{isStandardRasterTileSize:d,fbo:c}=this._getRasterFBO(n,u,m);Ls(e,this._quad,c,t),d||c.dispose(),n.bindFramebuffer(o),n.setViewport(l.x,l.y,l.width,l.height),a.end(this.name)}_drawBitmap(e,t,r=!1){const{timeline:i,context:a}=e;if(i.begin(this.name),a.setStencilFunction(H.EQUAL,t.stencilRef,255),t.updateTexture(e),r&&!t.processedTexture){if(t.updateProcessedTexture(),!t.processedTexture)return void i.end(this.name);t.processed=!0}this._initBitmapCommonUniforms(t);const n=t.symbolizerParameters.type,o=vt(n),{requestRender:l,allowDelayedRender:u}=e,{defines:m,program:d}=o.createProgram(e,t,t.projected&&r);if(u&&l!=null&&!d.compiled)return void l();a.useProgram(d);const c=this._getUniformInfos(n,a,d,m);this._quad||(this._quad=new ee(a,[0,0,1,0,0,1,1,1])),o.bindTextureAndUniforms(e,d,t,c,r),this._quad.draw(),i.end(this.name)}_initBitmapCommonUniforms(e){if(!e.commonUniforms){const t=Qe(1,[0,0]),{transformGrid:r,width:i,height:a}=e,n=We(r,[i,a],[e.source.width,e.source.height],1,!1);e.commonUniforms={...t,...n,u_coordScale:e.coordScale}}}_getRasterFBO(e,t,r){const i=t===$&&r===$;return i?(this._fbo||(this._fbo=this._createNewFBO(e,t,r)),{isStandardRasterTileSize:i,fbo:this._fbo}):{isStandardRasterTileSize:i,fbo:this._createNewFBO(e,t,r)}}_createNewFBO(e,t,r){const i=de(t,r);return new Ye(e,i)}_initQuad(e){this._quad||(this._quad=new ee(e,[0,0,1,0,0,1,1,1]))}_getUniformInfos(e,t,r,i){const a=i.length>0?e+"-"+i.join("-"):e;if(this._rendererUniformInfos.has(a))return this._rendererUniformInfos.get(a);const n=Ne(t,r);return this._rendererUniformInfos.set(a,n),n}}class Ds extends le{constructor(e,t,r,i,a,n,o=null){super(e,t,r,i,a,n),this.bitmap=null,this.bitmap=new lt(o,null,null),this.bitmap.coordScale=[a,n],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy(),this.bitmap=null,this.stage=null}set stencilRef(e){this.bitmap.stencilRef=e}get stencilRef(){return this.bitmap.stencilRef}setTransform(e){super.setTransform(e),this.bitmap.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z()}}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap.stage=null}}let Gs=class extends ue{constructor(){super(...arguments),this.isCustomTilingScheme=!1}createTile(e){const t=this._getTileBounds(e),[r,i]=this._tileInfoView.tileInfo.size,a=this._tileInfoView.getTileResolution(e.level);return new Ds(e,a,t[0],t[3],r,i)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"imagery (tile)",brushes:[ks],target:()=>this.children.map(r=>r.bitmap),drawPhase:O.MAP});return[...super.prepareRenderPasses(e),t]}doRender(e){if(!this.visible||e.drawPhase!==O.MAP)return;const{rasterFunctionChain:t}=this;if(!t)return e.renderPass="raster-bitmap",void super.doRender(e);if(!t.hasFocalFunction){const[r,i]=this._tileInfoView.tileInfo.size;e.renderPass="raster",e.rasterFunction={name:"Reproject",parameters:{targetImageSize:[r,i],requireNNEdge:t.isSourceSingleBand},pixelType:"f32",id:0,isNoopProcess:!1},super.doRender(e)}if(t!=null&&t.functions.length){const{functions:r,hasBranches:i}=t;for(let a=0;a{const e=this._rasterFunctionState;if(s.reprocess&&(await this._updatingHandles.addPromise(this.layer.updateRasterFunction()),this.updateRasterFunctionParameters()),!this.previousLOD||this.layerView.suspended)return;const t=this._rasterFunctionState,{type:r}=this;return s.refetch||r!=="raster"&&s.reprocess||t==="cpu"||e==="cpu"?this._updatingHandles.addPromise(this.doRefresh()):this._updatingHandles.addPromise(this._redrawImage(s.signal))})}destroy(){this._updatingHandles.destroy()}get useWebGLForProcessing(){return this._get("useWebGLForProcessing")??!0}set useWebGLForProcessing(s){this._set("useWebGLForProcessing",s)}get useProgressiveUpdate(){return this._get("useProgressiveUpdate")??!0}set useProgressiveUpdate(s){if(this._tileStrategy&&this.useProgressiveUpdate!==s){this._tileStrategy.destroy(),this.container.removeAllChildren();const e=this._getCacheSize(s);this._tileStrategy=new J({cachePolicy:"purge",acquireTile:t=>this.acquireTile(t),releaseTile:t=>this.releaseTile(t),cacheSize:e,tileInfoView:this._tileInfoView}),this._set("useProgressiveUpdate",s),this.layerView.requestUpdate()}}update(s){var a;this._fetchQueue.pause(),this._fetchQueue.state=s.state,this._tileStrategy.update(s),this._fetchQueue.resume();const{extent:e,resolution:t,scale:r}=s.state,i=this._tileInfoView.getClosestInfoForScale(r);if(this.layer.raster){if(!this.useProgressiveUpdate||this._needBlockCacheUpdate){const n=this._srcResolutions[i.level],o=e.toJSON?e:Pe.fromJSON(e);te(this._blockCacheRegistryUrl,this._blockCacheRegistryId,o,t,n,this.layer.raster.ioConfig.sampling)}this._needBlockCacheUpdate=!1,((a=this.previousLOD)==null?void 0:a.level)!==i.level&&(this.previousLOD=i,this._symbolizerParams==null||this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._tileStrategy.updateCacheSize(0))}}moveEnd(){!this.layerView.hasTilingEffects&&this.useProgressiveUpdate||(this._abortController&&this._abortController.abort(),this._abortController=new AbortController,this._fetchQueue.length===0&&this._redrawImage(this._abortController.signal).then(()=>{this._globalUpdateRequested=!1,this.layerView.requestUpdate()}));const s=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy.updateCacheSize(s),this.layerView.requestUpdate()}get updating(){var s;return this._globalUpdateRequested||((s=this._updatingHandles)==null?void 0:s.updating)}attach(){const s=Se();this._maxIndexedColormapSize=4*(s.maxTextureSize||4096),this._initializeTileInfo(),this._tileInfoView=new Re(this.layerView.tileInfo,this.layerView.fullExtent);const e=this._computeFetchConcurrency();this._fetchQueue=new Ie({tileInfoView:this._tileInfoView,concurrency:e,process:(r,i)=>this._fetchTile(r,i)});const t=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new J({cachePolicy:"purge",acquireTile:r=>this.acquireTile(r),releaseTile:r=>this.releaseTile(r),cacheSize:t,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}detach(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,se(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryUrl=this._blockCacheRegistryId=null}acquireTile(s){const e=this.container.createTile(s);return this._updatingHandles.addPromise(this._enqueueTileFetch(e)),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,e}releaseTile(s){this._fetchQueue.abort(s.key.id),this.container.removeChild(s),s.once("detach",()=>{s.destroy(),this.layerView.requestUpdate()}),this.layerView.requestUpdate()}createEmptyTilePixelBlock(s=null){const e=s==null||s.join(",")===this._tileInfoView.tileInfo.size.join(",");if(e&&this._emptyTilePixelBlock!=null)return this._emptyTilePixelBlock;s=s||this._tileInfoView.tileInfo.size;const[t,r]=s,i=new Xe({width:t,height:r,pixels:[new Uint8Array(t*r)],mask:new Uint8Array(t*r),pixelType:"u8"});return e&&(this._emptyTilePixelBlock=i),i}_getBandIds(){if(!("rasterFunctionChain"in this.container)||!this.container.rasterFunctionChain)return this.layer.bandIds;const{bandIds:s,raster:e}=this.layer,t="rasterFunction"in e?e.rasterFunction.rawInputBandIds:null;return s!=null&&s.length&&(t!=null&&t.length)&&e.rasterInfo.bandCount!==1?s.map(r=>t[Math.min(r,t.length-1)]):s||t}updateRasterFunctionParameters(){}_fetchTile(s,e){const t=e!=null?e.signal:null,r=this.canUseWebGLForProcessing(),{layerView:i}=this,{tileInfo:a}=i,n=!a.isWrappable&&st(i.view.spatialReference)!=null,o=r&&this.layer.raster.hasUniqueSourceStorageInfo,l={allowPartialFill:!0,datumTransformation:i.datumTransformation,interpolation:r?"nearest":this.layer.interpolation,registryId:this._blockCacheRegistryId,requestRawData:o,skipRasterFunction:this.type==="raster"&&this.container.rasterFunctionChain!=null,signal:t,srcResolution:this._srcResolutions[s.level],timeExtent:i.timeExtent,tileInfo:a,disableWrapAround:n};return this.fetchTile(s,l)}_getCacheSize(s){return s?40:0}_initializeTileInfo(){const{layerView:s}=this,e=s.view.spatialReference;if(this._canUseLayerLODs()){const{origin:u,lods:m}=this.layer.tileInfo,d=m.map(({scale:f})=>f),c=K.create({spatialReference:e,size:$,scales:d,origin:u});return s.set("tileInfo",c),void(this._srcResolutions=m.map(({resolution:f})=>({x:f,y:f})))}const{scales:t,srcResolutions:r,isCustomTilingScheme:i}=rt(this.layer.serviceRasterInfo,e,{tileSize:$,alignGlobalDatasetWithAGOL:!0,limitToSrcResolution:!1}),a=K.create({spatialReference:e,size:$,scales:t}),n=a.origin.x===0,{xmin:o,ymax:l}=s.fullExtent;(n||i&&a.origin.x>o)&&(a.origin=new Ue({x:o,y:l,spatialReference:e})),this._isCustomTilingScheme=i,s.set("tileInfo",a),this._srcResolutions=r??[]}_canUseLayerLODs(){var i;const{layer:s,layerView:e}=this;if(s.raster.tileType!=="Map")return!1;const{lods:t}=s.tileInfo,r=(i=e.view.constraints)==null?void 0:i.effectiveLODs;return(r==null?void 0:r.length)===t.length&&r.every(({scale:a},n)=>Math.abs(a-t[n].scale)<.001)}_computeFetchConcurrency(){const{blockBoundary:s}=this.layer.serviceRasterInfo.storageInfo,e=s[s.length-1];return(e.maxCol-e.minCol+1)*(e.maxRow-e.minRow+1)>64?2:10}async _enqueueTileFetch(s,e){var t;if(!this._fetchQueue.has(s.key.id)){try{const r=await this._fetchQueue.push(s.key),i=this._getBandIds();let a=!this.useProgressiveUpdate||this.layerView.hasTilingEffects&&!this._globalSymbolizerParams;if(this._globalUpdateRequested&&!this.layerView.moving&&this._fetchQueue.length===0){a=!1;try{await this._redrawImage((t=this._abortController)==null?void 0:t.signal)}catch(l){F(l)&&C.getLogger(this).error(l)}this._globalUpdateRequested=!1}!this.canUseWebGLForProcessing()&&this.type!=="rasterVF"||this.layerView.hasTilingEffects||this._symbolizerParams!=null||this._updateSymbolizerParams();const n=this._tileInfoView.getTileCoords(Os,s.key),o=this._tileInfoView.getTileResolution(s.key);await this.updateTileSource(s,{source:r,symbolizerParams:this._symbolizerParams,globalSymbolizerParams:this._globalSymbolizerParams,suspended:a,bandIds:i,coords:n,resolution:o}),s.once("attach",()=>this.layerView.requestUpdate()),this.container.addChild(s)}catch(r){F(r)||C.getLogger(this).error(r)}this.layerView.requestUpdate()}}async _redrawImage(s){if(this.container.children.length===0)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects?await this._updateGlobalSymbolizerParams(s):(this._updateSymbolizerParams(),this._globalSymbolizerParams=null);const e=this.container.children.map(async t=>this.updateTileSymbolizerParameters(t,{local:this._symbolizerParams,global:this._globalSymbolizerParams}));await Promise.allSettled(e),this.container.requestRender()}async _updateGlobalSymbolizerParams(s){const e={srcResolution:this._srcResolutions[this.previousLOD.level],registryId:this._blockCacheRegistryId,signal:s},t=await this.layer.fetchPixels(this.layerView.view.extent,this.layerView.view.width,this.layerView.view.height,e);if(!(t!=null&&t.pixelBlock))return;const{resolution:r}=this.previousLOD,i=this._getBandIds(),a=this.layer.symbolizer.generateWebGLParameters({pixelBlock:t.pixelBlock.extractBands(i),isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:r,y:r},bandIds:i});!this.canUseWebGLForProcessing()&&a&&a.type==="stretch"&&this.layer.renderer&&this.layer.renderer.type==="raster-stretch"&&(a.factor=a.factor.map(n=>255*n),a.outMin=Math.round(255*a.outMin),a.outMax=Math.round(255*a.outMax)),this._globalSymbolizerParams=a}_updateSymbolizerParams(){const{resolution:s}=this.previousLOD,e=this._getBandIds();this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:s,y:s},bandIds:e})}_updateBlockCacheRegistry(s=!1){const{layer:e,layerView:t}=this,{raster:r}=e,{multidimensionalDefinition:i}=e.normalizeRasterFetchOptions({multidimensionalDefinition:e.multidimensionalDefinition,timeExtent:t.timeExtent}),a=r.rasterInfo.multidimensionalInfo?r.getSliceIndex(i):null,n=et(r.rasterId,a);if(n!==this._blockCacheRegistryUrl){if(this._blockCacheRegistryUrl!=null&&se(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryId=tt(n,r.rasterInfo),s){const{view:o}=t,l=this._tileInfoView.getClosestInfoForScale(o.scale),u=this._srcResolutions[l.level];te(n,this._blockCacheRegistryId,o.extent,o.resolution,u,r.ioConfig.sampling)}this._blockCacheRegistryUrl=n}}async doRefresh(){if(!this.attached||!this.previousLOD||this.layerView.suspended)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._updateBlockCacheRegistry(!0),this._fetchQueue.reset();const s=[];this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,this._tileStrategy.refresh(e=>s.push(this._enqueueTileFetch(e))),await this._updatingHandles.addPromise(Promise.allSettled(s))}};h([p()],x.prototype,"_globalUpdateRequested",void 0),h([p()],x.prototype,"attached",void 0),h([p()],x.prototype,"container",void 0),h([p()],x.prototype,"layer",void 0),h([p()],x.prototype,"layerView",void 0),h([p()],x.prototype,"type",void 0),h([p()],x.prototype,"useWebGLForProcessing",null),h([p()],x.prototype,"useProgressiveUpdate",null),h([p()],x.prototype,"timeExtent",void 0),h([p()],x.prototype,"updating",null),x=h([M("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],x);let S=class extends x{constructor(){super(...arguments),this.type="raster"}attach(){super.attach(),this.container=new Gs(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this.updateRasterFunctionParameters()}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}canUseWebGLForProcessing(){var i,a;const{symbolizer:e}=this.layer,t=(a=(i=e.lookup)==null?void 0:i.colormapLut)==null?void 0:a.indexedColormap,r=t&&t.length>this._maxIndexedColormapSize;return this.useWebGLForProcessing&&e.canRenderInWebGL&&!r&&!(this.layer.interpolation==="majority"&&oe(this.layer))}fetchTile(e,t){return this.layer.fetchTile(e.level,e.row,e.col,t)}updateRasterFunctionParameters(){const{clips:e,view:t}=this.layerView;this._geometry!=null&&e.remove(this._geometry);const{raster:r,type:i}=this.layer;if(r.datasetFormat==="Function"){const w=r.getClippingGeometry(t.spatialReference);if(w){const g=new ke({geometry:w});e.add(g),this._geometry=g}}const{container:a}=this;if(r.datasetFormat!=="Function"||i==="wcs")return a.rasterFunctionChain=null,a.children.forEach(w=>{const{bitmap:g}=w;g&&(g.suspended=!0,g.processed=!1,g.projected&&(g.invalidateTexture(),g.rasterTexture=null))}),void(this._rasterFunctionState="na");const n=this._rasterFunctionState,{rasterFunction:o,primaryRasters:l}=r,u=o.supportsGPU&&(!l||l.rasters.length<=1),m=u?o.flatWebGLFunctionChain:null,{renderer:d}=this.layer,c=!u||!(m!=null&&m.functions.length)||(d==null?void 0:d.type)==="raster-stretch"&&d.dynamicRangeAdjustment||!this.canUseWebGLForProcessing();a.rasterFunctionChain=c?null:m;const f=o==null?"na":a.rasterFunctionChain?"gpu":"cpu";a.children.forEach(w=>{const{bitmap:g}=w;g&&(g.suspended=n!==f,g.processed=!1,g.processedTexture=null)}),this._rasterFunctionState=f}async updateTileSource(e,t){const r=this._getBandIds(),i=this._getLayerInterpolation(),a=this.canUseWebGLForProcessing(),{source:n,globalSymbolizerParams:o,suspended:l,coords:u,resolution:m}=t,d=this.layerView.hasTilingEffects?o:t.symbolizerParams,{bitmap:c}=e;if([c.x,c.y]=u,c.resolution=m,(n==null?void 0:n.pixelBlock)!=null){const f={extent:n.extent,pixelBlock:n.pixelBlock,srcPixelSize:n.srcTilePixelSize};if(c.rawPixelData=f,a)c.source=n.pixelBlock,c.isRendereredSource=!1;else{const w=await this.layer.applyRenderer(f,(o==null?void 0:o.type)==="stretch"?o:void 0);c.source=w,c.isRendereredSource=!0}c.symbolizerParameters=a?d:null,c.transformGrid=a?n.transformGrid:null}else{const f=this.createEmptyTilePixelBlock();c.source=f,c.symbolizerParameters=a?d:null,c.transformGrid=null}c.bandIds=a?r:null,c.width=this._tileInfoView.tileInfo.size[0],c.height=this._tileInfoView.tileInfo.size[1],c.interpolation=i,c.suspended=l,c.invalidateTexture()}async updateTileSymbolizerParameters(e,t){const{local:r,global:i}=t,a=this._getBandIds(),n=this._getLayerInterpolation(),o=this.canUseWebGLForProcessing(),{bitmap:l}=e,{rawPixelData:u}=l;o||u==null?(l.isRendereredSource&&u!=null&&(l.source=u.pixelBlock),l.isRendereredSource=!1):(l.source=await this.layer.applyRenderer(u,(i==null?void 0:i.type)==="stretch"?i:void 0),l.isRendereredSource=!0),l.symbolizerParameters=o?this.layerView.hasTilingEffects?i:r:null,l.bandIds=o?a:null,l.interpolation=n,l.suspended=!1}_getLayerInterpolation(){const{interpolation:e,renderer:t}=this.layer;if(!t)return e;const r=t.type;return r==="raster-colormap"||r==="unique-value"||r==="class-breaks"?"nearest":t.type==="raster-stretch"&&t.colorRamp!=null?e==="bilinear"||e==="cubic"?"bilinear":"nearest":e}};h([p()],S.prototype,"container",void 0),h([p()],S.prototype,"layer",void 0),h([p()],S.prototype,"type",void 0),S=h([M("esri.views.2d.layers.imagery.ImageryTileView2D")],S);const Es=S;class As extends le{constructor(e,t,r,i,a,n,o=null){super(e,t,r,i,a,n),this.tileData=new Ve(o),this.tileData.coordScale=[a,n],this.tileData.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.tileData.destroy(),this.tileData=null,this.stage=null}set stencilRef(e){this.tileData.stencilRef=e}get stencilRef(){return this.tileData.stencilRef}_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z()}}setTransform(e){super.setTransform(e);const t=this.resolution/(e.resolution*e.pixelRatio),r=this.transforms.tileMat3,[i,a]=this.tileData.offset,n=[this.x+i*this.resolution,this.y-a*this.resolution],[o,l]=e.toScreenNoRotation([0,0],n),{symbolTileSize:u}=this.tileData.symbolizerParameters,m=Math.round((this.width-this.tileData.offset[0])/u)*u,d=Math.round((this.height-this.tileData.offset[1])/u)*u,c=m/this.rangeX*t,f=d/this.rangeY*t;$e(r,c,0,0,0,f,0,o,l,1),ae(this.transforms.displayViewScreenMat3,e.displayViewMat3,r),this.tileData.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}onAttach(){this.tileData.stage=this.stage}onDetach(){this.tileData.stage=null}}class js extends ue{constructor(){super(...arguments),this.isCustomTilingScheme=!1,this.symbolTypes=["triangle"]}createTile(e){const t=this._tileInfoView.getTileBounds(ne(),e),[r,i]=this._tileInfoView.tileInfo.size,a=this._tileInfoView.getTileResolution(e.level);return new As(e,a,t[0],t[3],r,i)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"imagery (vf tile)",brushes:[Be],target:()=>this.children.map(r=>r.tileData),drawPhase:O.MAP});return[...super.prepareRenderPasses(e),t]}doRender(e){this.visible&&e.drawPhase===O.MAP&&this.symbolTypes.forEach(t=>{e.renderPass=t,super.doRender(e)})}}let R=class extends x{constructor(){super(...arguments),this._handle=null,this.type="rasterVF"}canUseWebGLForProcessing(){return!1}async fetchTile(s,e){e={...e,interpolation:"nearest",requestProjectedLocalDirections:!0};const t=await this.layer.fetchTile(s.level,s.row,s.col,e);return this.layer.serviceRasterInfo.dataType==="vector-magdir"&&(t!=null&&t.pixelBlock)&&(t.pixelBlock=await this.layer.convertVectorFieldData(t.pixelBlock,e)),t}updateTileSource(s,e){const t=e.symbolizerParams,{tileData:r}=s;r.key=s.key,r.width=this._tileInfoView.tileInfo.size[0],r.height=this._tileInfoView.tileInfo.size[1];const{symbolTileSize:i}=t,{source:a}=e;if(r.offset=this._getTileSymbolOffset(r.key,i),(a==null?void 0:a.pixelBlock)!=null){const n={extent:a.extent,pixelBlock:a.pixelBlock};r.rawPixelData=n,r.symbolizerParameters=t,r.source=this._sampleVectorFieldData(a.pixelBlock,t,r.offset)}else{const n=[Math.round((this._tileInfoView.tileInfo.size[0]-r.offset[0])/i),Math.round((this._tileInfoView.tileInfo.size[1]-r.offset[1])/i)],o=this.createEmptyTilePixelBlock(n);r.source=o,r.symbolizerParameters=t}return r.invalidateVAO(),Promise.resolve()}updateTileSymbolizerParameters(s,e){var o;const t=e.local,{symbolTileSize:r}=t,{tileData:i}=s;i.offset=this._getTileSymbolOffset(i.key,r);const a=i.symbolizerParameters.symbolTileSize;i.symbolizerParameters=t;const n=(o=i.rawPixelData)==null?void 0:o.pixelBlock;return n!=null&&a!==r&&(i.source=this._sampleVectorFieldData(n,i.symbolizerParameters,i.offset)),Promise.resolve()}attach(){super.attach(),this.container=new js(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this._updateSymbolType(this.layer.renderer),this._handle=D(()=>this.layer.renderer,s=>this._updateSymbolType(s))}detach(){var s;super.detach(),this.container.removeAllChildren(),(s=this._handle)==null||s.remove(),this._handle=null,this.container=null}_getTileSymbolOffset(s,e){const t=s.col*this._tileInfoView.tileInfo.size[0]%e,r=s.row*this._tileInfoView.tileInfo.size[1]%e;return[t>e/2?e-t:-t,r>e/2?e-r:-r]}_sampleVectorFieldData(s,e,t){const{symbolTileSize:r}=e;return Ze(s,"vector-uv",r,t)}_updateSymbolType(s){s.type==="vector-field"&&(this.container.symbolTypes=s.style==="wind-barb"?["scalar","triangle"]:s.style==="simple-scalar"?["scalar"]:["triangle"])}};h([p()],R.prototype,"container",void 0),h([p()],R.prototype,"layer",void 0),h([p()],R.prototype,"type",void 0),R=h([M("esri.views.2d.layers.imagery.VectorFieldTileView2D")],R);const qs=R,Ws=s=>{let e=class extends s{constructor(){super(...arguments),this._rasterFieldPrefix="Raster.",this.layer=null,this.view=null,this.tileInfo=null}get fullExtent(){return this._getfullExtent()}_getfullExtent(){return re(this.layer.serviceRasterInfo,this.view.spatialReference)}get hasTilingEffects(){return!!(this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment)}get datumTransformation(){return it(this.layer.fullExtent,this.view.spatialReference,!0)}supportsSpatialReference(t){return!!re(this.layer.serviceRasterInfo,t)}async fetchPopupFeaturesAtLocation(t,r){const{layer:i}=this;if(!t)throw new Y("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:i});const{popupEnabled:a}=i,n=at(i,r);if(!a||n==null)throw new Y("imageryTileLayerView:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:a,popupTemplate:n});const o=[],{value:l,magdirValue:u,processedValue:m}=await i.identify(t,{timeExtent:this.timeExtent,signal:r==null?void 0:r.signal});let d="";if(l&&l.length){d=i.type==="imagery-tile"&&i.hasStandardTime()&&l[0]!=null?l.map(E=>i.getStandardTimeValue(E)).join(", "):l.join(", ");const c={ObjectId:0},f="Raster.ServicePixelValue";c[f]=i.type==="imagery-tile"&&i.raster.datasetFormat==="Function"?m==null?void 0:m.join(", "):d,c[f+".Raw"]=d;const w=i.serviceRasterInfo.attributeTable;if(w!=null){const{fields:E,features:me}=w,N=E.find(({name:T})=>T.toLowerCase()==="value"),B=N?me.find(T=>String(T.attributes[N.name])===d):null;if(B)for(const T in B.attributes)B.attributes.hasOwnProperty(T)&&(c[this._rasterFieldPrefix+T]=B.attributes[T])}const g=i.serviceRasterInfo.dataType;g!=="vector-magdir"&&g!=="vector-uv"||(c["Raster.Magnitude"]=u==null?void 0:u[0],c["Raster.Direction"]=u==null?void 0:u[1]);const V=new Ce(this.fullExtent.clone(),null,c);V.layer=i,V.sourceLayer=V.layer,o.push(V)}return o}};return h([p()],e.prototype,"layer",void 0),h([p(Fe)],e.prototype,"timeExtent",void 0),h([p()],e.prototype,"view",void 0),h([p()],e.prototype,"fullExtent",null),h([p()],e.prototype,"tileInfo",void 0),h([p({readOnly:!0})],e.prototype,"hasTilingEffects",null),h([p()],e.prototype,"datumTransformation",null),e=h([M("esri.views.layers.ImageryTileLayerView")],e),e};let P=class extends Ws(nt(De(Ge))){constructor(){super(...arguments),this._useWebGLForProcessing=!0,this._useProgressiveUpdate=!0,this.subview=null}get useWebGLForProcessing(){return this._useWebGLForProcessing}set useWebGLForProcessing(s){this._useWebGLForProcessing=s,this.subview&&"useWebGLForProcessing"in this.subview&&(this.subview.useWebGLForProcessing=s)}get useProgressiveUpdate(){return this._useWebGLForProcessing}set useProgressiveUpdate(s){this._useProgressiveUpdate=s,this.subview&&"useProgressiveUpdate"in this.subview&&(this.subview.useProgressiveUpdate=s)}get displayParameters(){const{layer:s}=this,e=this._get("displayParameters");return s.renderer?{bandIds:s.bandIds,renderer:s.renderer,interpolation:s.interpolation,multidimensionalDefinition:s.multidimensionalDefinition,rasterFunction:s.type==="imagery-tile"?s.rasterFunction:null}:e}update(s){var e;(e=this.subview)==null||e.update(s),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage(),this._updateSubview(),this.addAttachHandles([D(()=>this.displayParameters,(s,e)=>{const t=s.interpolation!==(e==null?void 0:e.interpolation)&&(s.interpolation==="majority"||(e==null?void 0:e.interpolation)==="majority")&&oe(this.layer),r=s.renderer!==(e==null?void 0:e.renderer)&&this._getSubviewType(e==null?void 0:e.renderer)!==this._getSubviewType(s.renderer);r&&this._updateSubview();const i=s.multidimensionalDefinition!==(e==null?void 0:e.multidimensionalDefinition),a=s.rasterFunction!==(e==null?void 0:e.rasterFunction),n=a&&!this._useWebGLForProcessing,o=i||t||r||n;this.subview.redrawOrRefetch({refetch:o,reprocess:a}).catch(l=>{F(l)||C.getLogger(this).error(l)}),this.notifyChange("updating")}),D(()=>this.layer.multidimensionalSubset??null,(s,e)=>{const{multidimensionalDefinition:t}=this.layer;t!=null&&X(t,s)!==X(t,e)&&(this.subview.redrawOrRefetch({refetch:!0}).catch(r=>{F(r)||C.getLogger(this).error(r)}),this.notifyChange("updating"))},ze),D(()=>this.timeExtent,()=>{this.subview.timeExtent=this.timeExtent,this.subview.redrawOrRefetch({refetch:!0}).catch(s=>{F(s)||C.getLogger(this).error(s)})},Me)])}detach(){var s;this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),(s=this.subview)==null||s.destroy(),this.subview=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}doRefresh(){return this.subview?this.subview.doRefresh():Promise.resolve()}_updateSubview(){var i;const{renderer:s}=this.layer;if(!s)return;const e=this._getSubviewType(s);if(this.subview){if(this.subview.type===e)return void this._attachSubview(this.subview);this._detachSubview(this.subview),(i=this.subview)==null||i.destroy(),this.subview=null}const{layer:t}=this;let r;if(r=e==="rasterVF"?new qs({layer:t,layerView:this}):e==="flow"?new Le({layer:t,layerView:this}):new Es({layer:t,layerView:this}),"useWebGLForProcessing"in r&&(r.useWebGLForProcessing=this._useWebGLForProcessing),"useProgressiveUpdate"in r&&(r.useProgressiveUpdate=this._useProgressiveUpdate),"previousLOD"in r){const{subview:a}=this;r.previousLOD=a&&"previousLOD"in a?a.previousLOD:null}this._attachSubview(r),this.subview=r,this.requestUpdate()}_attachSubview(s){s&&!s.attached&&(s.attach(),s.attached=!0,this.container.addChildAt(s.container,0))}_detachSubview(s){s!=null&&s.attached&&(this.container.removeChild(s.container),s.detach(),s.attached=!1)}_getSubviewType(s){const e=s==null?void 0:s.type;return e==="vector-field"?"rasterVF":e==="flow"?"flow":"raster"}};h([p()],P.prototype,"subview",void 0),h([p()],P.prototype,"useWebGLForProcessing",null),h([p()],P.prototype,"useProgressiveUpdate",null),h([p({readOnly:!0})],P.prototype,"displayParameters",null),P=h([M("esri.views.2d.layers.ImageryTileLayerView2D")],P);const yr=P;export{yr as default}; +import{fV as U,L as j,eO as z,eH as pe,eI as A,eJ as L,eK as fe,eL as ge,eM as ae,t as Q,l as _e,U as ye,D as xe,g4 as k,hf as H,ij as $,ai as ne,f$ as be,d as h,y as p,f as M,a7 as we,i0 as ve,k as Te,r as J,aE as Pe,la as Se,h as Re,m as Ie,dZ as K,aA as Ue,b as F,s as C,fl as $e,g as D,bK as Fe,N as Y,j as Ce,ez as ze,P as Me}from"./index-BjUNJPVf.js";import{o as X}from"./multidimensionalUtils-u3oUX4w1.js";import{f as Ve,d as Be,a as Le}from"./RasterVFDisplayObject-DLrowEg_.js";import{a as ke,m as De,u as Ge}from"./LayerView-Bux7vAEn.js";import{i as Oe,E as O,r as oe}from"./Container-_n5wCgez.js";import{c as Ee,f as Ae,m as Z,O as I,h as v,_ as q,A as je,p as qe,l as We,T as Ne,g as Qe}from"./rasterUtils-DEPcL5Ca.js";import{e as He,m as Je}from"./Texture-S4dD-WHn.js";import{t as Ke,a as ee,r as le}from"./WGLContainer-DgZNq7b0.js";import{x as Ye}from"./Program-DBsYtQ00.js";import{i as ue}from"./TileContainer-Bs-vXdD_.js";import{u as Xe,S as Ze}from"./dataUtils-DzOfgSpi.js";import{g as te,a as se,i as et,u as tt}from"./RawBlockCache-DNGqU_D7.js";import{D as st,a as rt,s as re,v as it}from"./rasterProjectionHelper-CHkyWbma.js";import{p as at}from"./popupUtils-Do2GfZME.js";import{i as nt}from"./RefreshableLayerView-L9NGpXXI.js";import"./ProgramTemplate-Ck2I0bIi.js";import"./LabelMetric-BcUxDImF.js";import"./scaleUtils-DWXMiS7R.js";import"./highlightReasons-BOU4mnPE.js";import"./config-MDUrh2eL.js";import"./earcut-CWKXDqDj.js";import"./featureConversionUtils-BHhm7bvm.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";const ot={bandCount:3,outMin:0,outMax:1,minCutOff:[0,0,0],maxCutOff:[255,255,255],factor:[1/255,1/255,1/255],useGamma:!1,gamma:[1,1,1],gammaCorrection:[1,1,1],colormap:null,colormapOffset:null,stretchType:"none",type:"stretch"};class lt extends Oe{constructor(e=null,t=null,r=null){super(),this._textureInvalidated=!0,this._colormapTextureInvalidated=!0,this._rasterTexture=null,this._rasterTextureBandIds=null,this._transformGridTexture=null,this._colormapTexture=null,this._colormap=null,this._supportsBilinearTexture=!0,this._processedTexture=null,this.functionTextures=[],this.projected=!1,this.stencilRef=0,this.coordScale=[1,1],this._processed=!1,this._symbolizerParameters=null,this.height=null,this.isRendereredSource=!1,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this.rawPixelData=null,this._suspended=!1,this._bandIds=null,this._interpolation=null,this._transformGrid=null,this.width=null,this.x=0,this.y=0,this.source=e,this.transformGrid=t,this.interpolation=r}destroy(){this._disposeTextures()}get processedTexture(){return this._processedTexture}set processedTexture(e){this._processedTexture!==e&&(this._disposeTextures(!0),this._processedTexture=e)}get rasterTexture(){return this._rasterTexture}set rasterTexture(e){var t;this._rasterTexture!==e&&((t=this._rasterTexture)==null||t.dispose(),this._rasterTexture=e),e==null&&(this.projected=!1)}get processed(){return this._processed}set processed(e){this._processed=e,e||(U(this.processedTexture),this.invalidateTexture())}get symbolizerParameters(){return this._symbolizerParameters||ot}set symbolizerParameters(e){this._symbolizerParameters!==e&&(this._symbolizerParameters=e,this._colormapTextureInvalidated=!0,this.commonUniforms=null)}get source(){return this._source}set source(e){this._source!==e&&(this._source=e,this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this.commonUniforms=null,this.projected=!1,this.invalidateTexture())}get suspended(){return this._suspended}set suspended(e){this._suspended&&!e&&this.stage&&(this.ready(),this.requestRender()),this._suspended=e}get bandIds(){return this._bandIds}set bandIds(e){this._bandIds=e,this._isBandIdsChanged(e)&&(this.projected=!1,this.invalidateTexture())}get interpolation(){return this._interpolation||"nearest"}set interpolation(e){this._interpolation=e,this._rasterTexture&&this._rasterTexture.setSamplingMode(this._getTextureSamplingMethod(e||"nearest")==="bilinear"?j.LINEAR:j.NEAREST)}get transformGrid(){return this._transformGrid}set transformGrid(e){this._transformGrid!==e&&(this._transformGrid=e,this._transformGridTexture=U(this._transformGridTexture))}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRender())}getRasterTextureSize(e=!1){var r,i;const t=e||this.projected;return[t?this.width:((r=this.source)==null?void 0:r.width)||this.width,t?this.height:((i=this.source)==null?void 0:i.height)||this.height]}getRasterCellSize(){var i;const e=(i=this.rawPixelData)==null?void 0:i.srcPixelSize,{projected:t,resolution:r}=this;return e&&!t?[e.x,e.y]:[r,r]}_createTransforms(){return{displayViewScreenMat3:z()}}setTransform(e){const t=pe(this.transforms.displayViewScreenMat3),[r,i]=e.toScreenNoRotation([0,0],[this.x,this.y]),a=this.resolution/this.pixelRatio/e.resolution,n=a*this.width,o=a*this.height,l=Math.PI*this.rotation/180;A(t,t,L(r,i)),A(t,t,L(n/2,o/2)),fe(t,t,-l),A(t,t,L(-n/2,-o/2)),ge(t,t,L(n,o)),ae(this.transforms.displayViewScreenMat3,e.displayViewMat3,t)}getTextures({forProcessing:e=!1,useProcessedTexture:t=!1}={}){const r=t?this._processedTexture??this._rasterTexture:this._rasterTexture,i=[],a=[];return r?(this._transformGridTexture&&!this.projected&&(a.push(this._transformGridTexture),i.push("u_transformGrid")),t?(a.push(r),i.push("u_image"),this._colormapTexture&&(a.push(this._colormapTexture),i.push("u_colormap")),{names:i,textures:a}):(a.push(r),i.push("u_image"),this._colormapTexture&&!e&&(a.push(this._colormapTexture),i.push("u_colormap")),{names:i,textures:a})):{names:i,textures:a}}onAttach(){this.invalidateTexture()}onDetach(){this.invalidateTexture()}updateTexture({context:e}){if(!this.stage)return void this._disposeTextures();const t=this._isValidSource(this.source);t&&this._colormapTextureInvalidated&&(this._colormapTextureInvalidated=!1,this._updateColormapTexture(e)),this._textureInvalidated&&(this._textureInvalidated=!1,this._createOrDestroyRasterTexture(e),this._rasterTexture&&(t?this.transformGrid&&!this._transformGridTexture&&(this._transformGridTexture=Ee(e,this.transformGrid)):this._rasterTexture.setData(null)),this.suspended||(this.ready(),this.requestRender()))}updateProcessedTexture(){const{functionTextures:e}=this;e.length!==0&&(this.processedTexture=e.shift(),e.forEach(t=>t==null?void 0:t.dispose()),e.length=0)}_createOrDestroyRasterTexture(e){var n,o;const t=(n=this.source)==null?void 0:n.extractBands(this.bandIds);if(!this._isValidSource(t))return void(this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null));const r=!this._isBandIdsChanged(this.bandIds);if(this._rasterTexture){if(r)return;this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null}this._supportsBilinearTexture=!!((o=e.capabilities.textureFloat)!=null&&o.textureFloatLinear);const i=this._getTextureSamplingMethod(this.interpolation),a=this.isRendereredSource;this._rasterTexture=Ae(e,t,i,a),this.projected=!1,this._processed=!1,this._rasterTextureBandIds=this.bandIds?[...this.bandIds]:null}_isBandIdsChanged(e){const t=this._rasterTextureBandIds;return!(t==null&&e==null||t&&e&&t.join("")===e.join(""))}_isValidSource(e){var t;return e!=null&&((t=e.pixels)==null?void 0:t.length)>0}_getTextureSamplingMethod(e){const{type:t}=this.symbolizerParameters,r=t==="lut"||t==="hillshade"||t==="stretch"&&this.symbolizerParameters.bandCount===1;return!this._supportsBilinearTexture||r||e!=="bilinear"&&e!=="cubic"?"nearest":"bilinear"}_updateColormapTexture(e){const t=this._colormap,r=this.symbolizerParameters.colormap;return r?t?r.length!==t.length||r.some((i,a)=>i!==t[a])?(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),this._colormapTexture=Z(e,r),void(this._colormap=r)):void 0:(this._colormapTexture=Z(e,r),void(this._colormap=r)):(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),void(this._colormap=null))}_disposeTextures(e=!1){!this._transformGridTexture||e&&!this.projected||(this._transformGridTexture.dispose(),this._transformGridTexture=null),!e&&this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null,this._colormap=null,this._colormapTextureInvalidated=!0),!e&&this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this._processedTexture&&(this._processedTexture.dispose(),this._processedTexture=null)}}function ut(s){return s.source!=null}function W(s){const e=[];return s&&(e.push("applyProjection"),s.spacing[0]===1&&e.push("lookupProjection")),e}function ce(s,e,t){var a;const r=!((a=t.capabilities.textureFloat)!=null&&a.textureFloatLinear),i=[];return s==="cubic"?i.push("bicubic"):s==="bilinear"&&(e?(i.push("bilinear"),i.push("nnedge")):r&&i.push("bilinear")),i}const ct={vsPath:"raster/common",fsPath:"raster/lut",attributes:new Map([["a_position",0],["a_texcoord",1]])};function ht(s,e,t){const r=t?[]:W(e.transformGrid);return{defines:r,program:s.painter.materialManager.getProgram(ct,r)}}function dt(s,e,t,r,i=!1){const{names:a,textures:n}=t.getTextures({useProcessedTexture:i});I(s.context,e,a,n),v(e,r,t.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",t.transforms.displayViewScreenMat3);const{colormap:o,colormapOffset:l}=t.symbolizerParameters,u=q(o,l);v(e,r,u)}const mt={createProgram:ht,bindTextureAndUniforms:dt},pt={vsPath:"raster/common",fsPath:"raster/hillshade",attributes:new Map([["a_position",0],["a_texcoord",1]])};function ft(s,e,t){const{colormap:r}=e.symbolizerParameters,i=[...t?[]:W(e.transformGrid),...ce(e.interpolation,!0,s.context)];return r!=null&&i.push("applyColormap"),{defines:i,program:s.painter.materialManager.getProgram(pt,i)}}function gt(s,e,t,r,i=!1){const{names:a,textures:n}=t.getTextures({useProcessedTexture:i});I(s.context,e,a,n),v(e,r,t.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",t.transforms.displayViewScreenMat3);const o=t.symbolizerParameters,{colormap:l,colormapOffset:u}=o;if(l!=null){const d=q(l,u);v(e,r,d)}const m=je(o);v(e,r,m)}const _t={createProgram:ft,bindTextureAndUniforms:gt},yt={vsPath:"raster/common",fsPath:"raster/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};function xt(s,e,t){const{colormap:r,bandCount:i}=e.symbolizerParameters,a=[...t?[]:W(e.transformGrid),...ce(e.interpolation,i===1,s.context)];return e.isRendereredSource&&!t?a.push("noop"):r!=null&&a.push("applyColormap"),{defines:a,program:s.painter.materialManager.getProgram(yt,a)}}function bt(s,e,t,r,i=!1){const{names:a,textures:n}=t.getTextures({useProcessedTexture:i});I(s.context,e,a,n),v(e,r,t.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",t.transforms.displayViewScreenMat3);const o=t.symbolizerParameters,{colormap:l,colormapOffset:u}=o;if(l!=null){const d=q(l,u);v(e,r,d)}const m=qe(o);v(e,r,m)}const wt={createProgram:xt,bindTextureAndUniforms:bt},G=new Map;function vt(s){return G.get(s)}G.set("lut",mt),G.set("hillshade",_t),G.set("stretch",wt);const Tt=[1,1],Pt=[2,0,0,0,2,0,-1,-1,0];function b(s,e,t){const{context:r,rasterFunction:i,hasBranches:a}=s,{raster:n}=i.parameters,o=a?(n==null?void 0:n.id)??-1:0,l=t.functionTextures[o]??t.rasterTexture;I(r,e,["u_image"],[l])}function he(s,e,t){const{rasters:r}=s.rasterFunction.parameters;if(!r)return;if(r.length<2)return b(s,e,t);const i=r.filter(a=>a.name!=="Constant").map(a=>a.id!=null&&a.name!=="Identity"?t.functionTextures[a.id]:t.rasterTexture);if(I(s.context,e,["u_image","u_image1","u_image2"].slice(0,i.length),i),i.length!==r.length){if(r.length===2){const a=r.findIndex(l=>l.name==="Constant"),n=a===0?[0,1,0,1,0,0,0,0,0]:[1,0,0,0,1,0,0,0,0],{value:o}=r[a].parameters;e.setUniform1f("u_image1Const",o),e.setUniformMatrix3fv("u_imageSwap",n)}else if(r.length===3){const a=[];if(r.forEach((n,o)=>n.name==="Constant"&&a.push(o)),a.length===1){const{value:n}=r[a[0]].parameters;e.setUniform1f("u_image1Const",n);const o=a[0]===0?[0,1,0,0,0,1,1,0,0]:a[0]===1?[1,0,0,0,0,1,0,1,0]:[1,0,0,0,1,0,0,0,1];e.setUniformMatrix3fv("u_imageSwap",o)}else if(a.length===2){const{value:n}=r[a[0]].parameters;e.setUniform1f("u_image1Const",n);const{value:o}=r[a[1]].parameters;e.setUniform1f("u_image2Const",o);const l=r.findIndex(m=>m.name!=="Constant"),u=l===0?[1,0,0,0,1,0,0,0,1]:l===1?[0,1,0,1,0,0,0,0,1]:[0,0,1,1,0,0,0,1,0];e.setUniformMatrix3fv("u_imageSwap",u)}}}}function y(s){s.setUniform2fv("u_coordScale",Tt),s.setUniformMatrix3fv("u_dvsMat3",Pt)}const St={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/aspect",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Rt(s,e){return s.painter.materialManager.getProgram(St,[])}function It(s,e,t){b(s,e,t),y(e);const r=t.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",r);const i=t.getRasterCellSize();e.setUniform2fv("u_cellSize",i)}const Ut={createProgram:Rt,bindTextureAndUniforms:It},$t={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/bandarithmetic",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Ft(s,e){const{painter:t,rasterFunction:r}=s,{indexType:i}=r.parameters;return t.materialManager.getProgram($t,[i])}function Ct(s,e,t){b(s,e,t),y(e);const{bandIndexMat3:r}=s.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",r)}const zt={createProgram:Ft,bindTextureAndUniforms:Ct},Mt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/compositeband",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Vt(s,e){const t=s.rasterFunction.parameters.rasters.filter(i=>i.name==="Constant"),r=[];return t.length&&(r.push("oneConstant"),t.length===2&&r.push("twoConstant")),s.painter.materialManager.getProgram(Mt,r)}function Bt(s,e,t){he(s,e,t),y(e)}const Lt={createProgram:Vt,bindTextureAndUniforms:Bt},kt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/contrast",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Dt(s,e){return s.painter.materialManager.getProgram(kt,[])}function Gt(s,e,t){b(s,e,t),y(e);const{contrastOffset:r,brightnessOffset:i}=s.rasterFunction.parameters;e.setUniform1f("u_contrastOffset",r),e.setUniform1f("u_brightnessOffset",i)}const Ot={createProgram:Dt,bindTextureAndUniforms:Gt},Et={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/convolution",attributes:new Map([["a_position",0],["a_texcoord",1]])};function At(s,e){const{painter:t,rasterFunction:r}=s,{kernelRows:i,kernelCols:a}=r.parameters,n=[{name:"rows",value:i},{name:"cols",value:a}];return t.materialManager.getProgram(Et,n)}function jt(s,e,t){b(s,e,t),y(e),e.setUniform2fv("u_srcImageSize",[t.width,t.height]);const{kernel:r,clampRange:i}=s.rasterFunction.parameters;e.setUniform1fv("u_kernel",r),e.setUniform2fv("u_clampRange",i)}const qt={createProgram:At,bindTextureAndUniforms:jt},Wt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/curvature",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Nt(s,e){const{painter:t,rasterFunction:r}=s,{curvatureType:i}=r.parameters,a=[i];return t.materialManager.getProgram(Wt,a)}function Qt(s,e,t){b(s,e,t),y(e);const r=t.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",r);const{zFactor:i}=s.rasterFunction.parameters,a=t.getRasterCellSize();e.setUniform1f("u_zlFactor",200*i/a[0]/a[1])}const Ht={createProgram:Nt,bindTextureAndUniforms:Qt},Jt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/extractband",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Kt(s,e){return s.painter.materialManager.getProgram(Jt,[])}function Yt(s,e,t){b(s,e,t),y(e);const{bandIndexMat3:r}=s.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",r)}const Xt={createProgram:Kt,bindTextureAndUniforms:Yt},Zt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/focalstatistics",attributes:new Map([["a_position",0],["a_texcoord",1]])};function es(s,e){const{painter:t,rasterFunction:r}=s,{kernelRows:i,kernelCols:a,fillNoDataOnly:n,statisticsType:o}=r.parameters,l=[{name:"rows",value:i},{name:"cols",value:a},o];return n&&l.push("fill"),t.materialManager.getProgram(Zt,l)}function ts(s,e,t){b(s,e,t),y(e),e.setUniform2fv("u_srcImageSize",[t.width,t.height]);const{clampRange:r}=s.rasterFunction.parameters;e.setUniform2fv("u_clampRange",r)}const ss={createProgram:es,bindTextureAndUniforms:ts},rs={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/grayscale",attributes:new Map([["a_position",0],["a_texcoord",1]])};function is(s,e){return s.painter.materialManager.getProgram(rs,[])}function as(s,e,t){b(s,e,t),y(e);const{weights:r}=s.rasterFunction.parameters;e.setUniform3fv("u_weights",r)}const ns={createProgram:is,bindTextureAndUniforms:as},os={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/local",attributes:new Map([["a_position",0],["a_texcoord",1]])};function ls(s){const{painter:e,rasterFunction:t}=s,{imageCount:r,operationName:i,rasters:a,isOutputRounded:n}=t.parameters,o=[i.toLowerCase()];r===2&&o.push("twoImages");const l=a.filter(u=>u.name==="Constant");return l.length&&(o.push("oneConstant"),l.length===2&&o.push("twoConstant")),n&&o.push("roundOutput"),e.materialManager.getProgram(os,o)}function us(s,e,t){he(s,e,t),y(e);const{domainRange:r}=s.rasterFunction.parameters;e.setUniform2fv("u_domainRange",r)}const ie={createProgram:ls,bindTextureAndUniforms:us},cs={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/mask",attributes:new Map([["a_position",0],["a_texcoord",1]])};function hs(s,e){const{painter:t,rasterFunction:r}=s,i=r.parameters.bandCount>1?["multiBand"]:[];return t.materialManager.getProgram(cs,i)}function ds(s,e,t){b(s,e,t),y(e);const{includedRanges:r,noDataValues:i}=s.rasterFunction.parameters;e.setUniform1fv("u_includedRanges",r),e.setUniform1fv("u_noDataValues",i)}const ms={createProgram:hs,bindTextureAndUniforms:ds},ps={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/ndvi",attributes:new Map([["a_position",0],["a_texcoord",1]])};function fs(s,e){const{painter:t,rasterFunction:r}=s,i=r.parameters.scaled?["scaled"]:[];return t.materialManager.getProgram(ps,i)}function gs(s,e,t){b(s,e,t),y(e);const{bandIndexMat3:r}=s.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",r)}const _s={createProgram:fs,bindTextureAndUniforms:gs},ys={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/remap",attributes:new Map([["a_position",0],["a_texcoord",1]])};function xs(s,e){return s.painter.materialManager.getProgram(ys,[])}function bs(s,e,t){b(s,e,t),y(e);const{noDataRanges:r,rangeMaps:i,allowUnmatched:a,clampRange:n}=s.rasterFunction.parameters;e.setUniform1fv("u_noDataRanges",r),e.setUniform1fv("u_rangeMaps",i),e.setUniform1f("u_unmatchMask",a?1:0),e.setUniform2fv("u_clampRange",n)}const ws={createProgram:xs,bindTextureAndUniforms:bs},vs={vsPath:"raster/common",fsPath:"raster/reproject",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Ts(s,e){var o;const{painter:t}=s,r=[],{interpolation:i,transformGrid:a}=e,n=(o=s.rasterFunction)==null?void 0:o.parameters;return i==="cubic"?r.push("bicubic"):i==="bilinear"&&(r.push("bilinear"),n!=null&&n.requireNNEdge&&r.push("nnedge")),a&&(r.push("applyProjection"),a.spacing[0]===1&&r.push("lookupProjection")),t.materialManager.getProgram(vs,r)}function Ps(s,e,t){const{names:r,textures:i}=t.getTextures({forProcessing:!0});I(s.context,e,r,i),e.setUniform1f("u_scale",1),e.setUniform2fv("u_offset",[0,0]),e.setUniform2fv("u_coordScale",[1,1]),e.setUniformMatrix3fv("u_dvsMat3",[2,0,0,0,2,0,-1,-1,0]),e.setUniform1i("u_flipY",0),e.setUniform1f("u_opacity",1);const{width:a,height:n,source:o,transformGrid:l}=t;e.setUniform2fv("u_srcImageSize",[o.width,o.height]),e.setUniform2fv("u_targetImageSize",[a,n]),e.setUniform2fv("u_transformSpacing",l?l.spacing:Q),e.setUniform2fv("u_transformGridSize",l?l.size:Q)}const Ss={createProgram:Ts,bindTextureAndUniforms:Ps},Rs={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/slope",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Is(s,e){const{painter:t,rasterFunction:r}=s,{slopeType:i}=r.parameters,a=i==="percent-rise"?["percentRise"]:[];return t.materialManager.getProgram(Rs,a)}function Us(s,e,t){b(s,e,t),y(e);const r=t.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",r);const i=t.getRasterCellSize();e.setUniform2fv("u_cellSize",i);const{zFactor:a,slopeType:n,pixelSizePower:o,pixelSizeFactor:l}=s.rasterFunction.parameters;e.setUniform1f("u_zFactor",a),e.setUniform1f("u_pixelSizePower",n==="adjusted"?o:0),e.setUniform1f("u_pixelSizeFactor",n==="adjusted"?l:0)}const $s={createProgram:Is,bindTextureAndUniforms:Us},Fs={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Cs(s,e){const{useGamma:t,bandCount:r,isOutputRounded:i}=s.rasterFunction.parameters,a=[];return t&&a.push("useGamma"),r>1&&a.push("multiBand"),i&&a.push("roundOutput"),s.painter.materialManager.getProgram(Fs,a)}function zs(s,e,t){b(s,e,t),y(e);const{width:r,height:i}=t,a=s.rasterFunction.parameters;e.setUniform2fv("u_srcImageSize",[r,i]),e.setUniform1f("u_minOutput",a.outMin),e.setUniform1f("u_maxOutput",a.outMax),e.setUniform1fv("u_factor",a.factor),e.setUniform1fv("u_minCutOff",a.minCutOff),e.setUniform1fv("u_maxCutOff",a.maxCutOff),e.setUniform1fv("u_gamma",a.gamma),e.setUniform1fv("u_gammaCorrection",a.gammaCorrection)}const Ms={createProgram:Cs,bindTextureAndUniforms:zs},_=new Map;function de(s,e){const t=new He;return t.width=s,t.height=e,t.internalFormat=_e.RGBA32F,t.samplingMode=j.NEAREST,t.dataType=ye.FLOAT,t.isImmutable=!0,t.wrapMode=xe.CLAMP_TO_EDGE,t}function Vs(s,e,t,r){const{context:i,requestRender:a,allowDelayedRender:n}=s,o=r.createProgram(s,t);return n&&a!=null&&!o.compiled?(a(),null):(i.bindFramebuffer(e),i.setViewport(0,0,e.width,e.height),i.useProgram(o),o)}function Bs(s){return _.get(s.toLowerCase())}function Ls(s,e,t,r){const i=s.rasterFunction.name.toLowerCase(),a=i==="reproject"?Ss:Bs(i);if(a==null)return;const n=Vs(s,t,r,a);if(!n)return;a.bindTextureAndUniforms(s,n,r);const{interpolation:o}=r;i==="reproject"&&(r.interpolation="nearest"),e.draw();const[l,u]=r.getRasterTextureSize(i==="reproject"),m=de(l,u),d=new Je(s.context,m);if(t.copyToTexture(0,0,l,u,0,0,d),i==="reproject")r.rasterTexture=d,r.projected=!0,r.interpolation=o;else{const c=s.hasBranches?s.rasterFunction.id:0;r.functionTextures[c]=d}}_.set("arithmetic",ie),_.set("aspect",Ut),_.set("bandarithmetic",zt),_.set("compositeband",Lt),_.set("convolution",qt),_.set("contrastbrightness",Ot),_.set("curvature",Ht),_.set("extractband",Xt),_.set("statistics",ss),_.set("grayscale",ns),_.set("local",ie),_.set("mask",ms),_.set("ndvi",_s),_.set("remap",ws),_.set("slope",$s),_.set("stretch",Ms);class ks extends Ke{constructor(){super(...arguments),this.name="raster",this._quad=null,this._rendererUniformInfos=new Map,this._fbo=null}dispose(){U(this._quad),U(this._fbo)}prepareState(e){const{context:t,renderPass:r}=e,i=r==="raster";t.setBlendingEnabled(!i),t.setBlendFunctionSeparate(k.ONE,k.ONE_MINUS_SRC_ALPHA,k.ONE,k.ONE_MINUS_SRC_ALPHA),t.setColorMask(!0,!0,!0,!0),t.setStencilWriteMask(0),t.setStencilTestEnabled(!i)}draw(e,t){if(!ut(t)||t.suspended)return;const{renderPass:r}=e;if(r!=="raster-bitmap")return r==="raster"?this._process(e,t):void this._drawBitmap(e,t,!0);this._drawBitmap(e,t)}_process(e,t){const{rasterFunction:r}=e,i=r.name==="Reproject";if(!(i?!(t.rasterTexture&&t.projected):!t.processed))return;const{timeline:a,context:n}=e;a.begin(this.name);const o=n.getBoundFramebufferObject(),l=n.getViewport();i||(t.processedTexture=U(t.processedTexture)),n.setStencilFunction(H.EQUAL,t.stencilRef,255),t.updateTexture(e),this._initQuad(n);const[u,m]=t.getRasterTextureSize(i),{isStandardRasterTileSize:d,fbo:c}=this._getRasterFBO(n,u,m);Ls(e,this._quad,c,t),d||c.dispose(),n.bindFramebuffer(o),n.setViewport(l.x,l.y,l.width,l.height),a.end(this.name)}_drawBitmap(e,t,r=!1){const{timeline:i,context:a}=e;if(i.begin(this.name),a.setStencilFunction(H.EQUAL,t.stencilRef,255),t.updateTexture(e),r&&!t.processedTexture){if(t.updateProcessedTexture(),!t.processedTexture)return void i.end(this.name);t.processed=!0}this._initBitmapCommonUniforms(t);const n=t.symbolizerParameters.type,o=vt(n),{requestRender:l,allowDelayedRender:u}=e,{defines:m,program:d}=o.createProgram(e,t,t.projected&&r);if(u&&l!=null&&!d.compiled)return void l();a.useProgram(d);const c=this._getUniformInfos(n,a,d,m);this._quad||(this._quad=new ee(a,[0,0,1,0,0,1,1,1])),o.bindTextureAndUniforms(e,d,t,c,r),this._quad.draw(),i.end(this.name)}_initBitmapCommonUniforms(e){if(!e.commonUniforms){const t=Qe(1,[0,0]),{transformGrid:r,width:i,height:a}=e,n=We(r,[i,a],[e.source.width,e.source.height],1,!1);e.commonUniforms={...t,...n,u_coordScale:e.coordScale}}}_getRasterFBO(e,t,r){const i=t===$&&r===$;return i?(this._fbo||(this._fbo=this._createNewFBO(e,t,r)),{isStandardRasterTileSize:i,fbo:this._fbo}):{isStandardRasterTileSize:i,fbo:this._createNewFBO(e,t,r)}}_createNewFBO(e,t,r){const i=de(t,r);return new Ye(e,i)}_initQuad(e){this._quad||(this._quad=new ee(e,[0,0,1,0,0,1,1,1]))}_getUniformInfos(e,t,r,i){const a=i.length>0?e+"-"+i.join("-"):e;if(this._rendererUniformInfos.has(a))return this._rendererUniformInfos.get(a);const n=Ne(t,r);return this._rendererUniformInfos.set(a,n),n}}class Ds extends le{constructor(e,t,r,i,a,n,o=null){super(e,t,r,i,a,n),this.bitmap=null,this.bitmap=new lt(o,null,null),this.bitmap.coordScale=[a,n],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy(),this.bitmap=null,this.stage=null}set stencilRef(e){this.bitmap.stencilRef=e}get stencilRef(){return this.bitmap.stencilRef}setTransform(e){super.setTransform(e),this.bitmap.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z()}}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap.stage=null}}let Gs=class extends ue{constructor(){super(...arguments),this.isCustomTilingScheme=!1}createTile(e){const t=this._getTileBounds(e),[r,i]=this._tileInfoView.tileInfo.size,a=this._tileInfoView.getTileResolution(e.level);return new Ds(e,a,t[0],t[3],r,i)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"imagery (tile)",brushes:[ks],target:()=>this.children.map(r=>r.bitmap),drawPhase:O.MAP});return[...super.prepareRenderPasses(e),t]}doRender(e){if(!this.visible||e.drawPhase!==O.MAP)return;const{rasterFunctionChain:t}=this;if(!t)return e.renderPass="raster-bitmap",void super.doRender(e);if(!t.hasFocalFunction){const[r,i]=this._tileInfoView.tileInfo.size;e.renderPass="raster",e.rasterFunction={name:"Reproject",parameters:{targetImageSize:[r,i],requireNNEdge:t.isSourceSingleBand},pixelType:"f32",id:0,isNoopProcess:!1},super.doRender(e)}if(t!=null&&t.functions.length){const{functions:r,hasBranches:i}=t;for(let a=0;a{const e=this._rasterFunctionState;if(s.reprocess&&(await this._updatingHandles.addPromise(this.layer.updateRasterFunction()),this.updateRasterFunctionParameters()),!this.previousLOD||this.layerView.suspended)return;const t=this._rasterFunctionState,{type:r}=this;return s.refetch||r!=="raster"&&s.reprocess||t==="cpu"||e==="cpu"?this._updatingHandles.addPromise(this.doRefresh()):this._updatingHandles.addPromise(this._redrawImage(s.signal))})}destroy(){this._updatingHandles.destroy()}get useWebGLForProcessing(){return this._get("useWebGLForProcessing")??!0}set useWebGLForProcessing(s){this._set("useWebGLForProcessing",s)}get useProgressiveUpdate(){return this._get("useProgressiveUpdate")??!0}set useProgressiveUpdate(s){if(this._tileStrategy&&this.useProgressiveUpdate!==s){this._tileStrategy.destroy(),this.container.removeAllChildren();const e=this._getCacheSize(s);this._tileStrategy=new J({cachePolicy:"purge",acquireTile:t=>this.acquireTile(t),releaseTile:t=>this.releaseTile(t),cacheSize:e,tileInfoView:this._tileInfoView}),this._set("useProgressiveUpdate",s),this.layerView.requestUpdate()}}update(s){var a;this._fetchQueue.pause(),this._fetchQueue.state=s.state,this._tileStrategy.update(s),this._fetchQueue.resume();const{extent:e,resolution:t,scale:r}=s.state,i=this._tileInfoView.getClosestInfoForScale(r);if(this.layer.raster){if(!this.useProgressiveUpdate||this._needBlockCacheUpdate){const n=this._srcResolutions[i.level],o=e.toJSON?e:Pe.fromJSON(e);te(this._blockCacheRegistryUrl,this._blockCacheRegistryId,o,t,n,this.layer.raster.ioConfig.sampling)}this._needBlockCacheUpdate=!1,((a=this.previousLOD)==null?void 0:a.level)!==i.level&&(this.previousLOD=i,this._symbolizerParams==null||this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._tileStrategy.updateCacheSize(0))}}moveEnd(){!this.layerView.hasTilingEffects&&this.useProgressiveUpdate||(this._abortController&&this._abortController.abort(),this._abortController=new AbortController,this._fetchQueue.length===0&&this._redrawImage(this._abortController.signal).then(()=>{this._globalUpdateRequested=!1,this.layerView.requestUpdate()}));const s=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy.updateCacheSize(s),this.layerView.requestUpdate()}get updating(){var s;return this._globalUpdateRequested||((s=this._updatingHandles)==null?void 0:s.updating)}attach(){const s=Se();this._maxIndexedColormapSize=4*(s.maxTextureSize||4096),this._initializeTileInfo(),this._tileInfoView=new Re(this.layerView.tileInfo,this.layerView.fullExtent);const e=this._computeFetchConcurrency();this._fetchQueue=new Ie({tileInfoView:this._tileInfoView,concurrency:e,process:(r,i)=>this._fetchTile(r,i)});const t=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new J({cachePolicy:"purge",acquireTile:r=>this.acquireTile(r),releaseTile:r=>this.releaseTile(r),cacheSize:t,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}detach(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,se(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryUrl=this._blockCacheRegistryId=null}acquireTile(s){const e=this.container.createTile(s);return this._updatingHandles.addPromise(this._enqueueTileFetch(e)),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,e}releaseTile(s){this._fetchQueue.abort(s.key.id),this.container.removeChild(s),s.once("detach",()=>{s.destroy(),this.layerView.requestUpdate()}),this.layerView.requestUpdate()}createEmptyTilePixelBlock(s=null){const e=s==null||s.join(",")===this._tileInfoView.tileInfo.size.join(",");if(e&&this._emptyTilePixelBlock!=null)return this._emptyTilePixelBlock;s=s||this._tileInfoView.tileInfo.size;const[t,r]=s,i=new Xe({width:t,height:r,pixels:[new Uint8Array(t*r)],mask:new Uint8Array(t*r),pixelType:"u8"});return e&&(this._emptyTilePixelBlock=i),i}_getBandIds(){if(!("rasterFunctionChain"in this.container)||!this.container.rasterFunctionChain)return this.layer.bandIds;const{bandIds:s,raster:e}=this.layer,t="rasterFunction"in e?e.rasterFunction.rawInputBandIds:null;return s!=null&&s.length&&(t!=null&&t.length)&&e.rasterInfo.bandCount!==1?s.map(r=>t[Math.min(r,t.length-1)]):s||t}updateRasterFunctionParameters(){}_fetchTile(s,e){const t=e!=null?e.signal:null,r=this.canUseWebGLForProcessing(),{layerView:i}=this,{tileInfo:a}=i,n=!a.isWrappable&&st(i.view.spatialReference)!=null,o=r&&this.layer.raster.hasUniqueSourceStorageInfo,l={allowPartialFill:!0,datumTransformation:i.datumTransformation,interpolation:r?"nearest":this.layer.interpolation,registryId:this._blockCacheRegistryId,requestRawData:o,skipRasterFunction:this.type==="raster"&&this.container.rasterFunctionChain!=null,signal:t,srcResolution:this._srcResolutions[s.level],timeExtent:i.timeExtent,tileInfo:a,disableWrapAround:n};return this.fetchTile(s,l)}_getCacheSize(s){return s?40:0}_initializeTileInfo(){const{layerView:s}=this,e=s.view.spatialReference;if(this._canUseLayerLODs()){const{origin:u,lods:m}=this.layer.tileInfo,d=m.map(({scale:f})=>f),c=K.create({spatialReference:e,size:$,scales:d,origin:u});return s.set("tileInfo",c),void(this._srcResolutions=m.map(({resolution:f})=>({x:f,y:f})))}const{scales:t,srcResolutions:r,isCustomTilingScheme:i}=rt(this.layer.serviceRasterInfo,e,{tileSize:$,alignGlobalDatasetWithAGOL:!0,limitToSrcResolution:!1}),a=K.create({spatialReference:e,size:$,scales:t}),n=a.origin.x===0,{xmin:o,ymax:l}=s.fullExtent;(n||i&&a.origin.x>o)&&(a.origin=new Ue({x:o,y:l,spatialReference:e})),this._isCustomTilingScheme=i,s.set("tileInfo",a),this._srcResolutions=r??[]}_canUseLayerLODs(){var i;const{layer:s,layerView:e}=this;if(s.raster.tileType!=="Map")return!1;const{lods:t}=s.tileInfo,r=(i=e.view.constraints)==null?void 0:i.effectiveLODs;return(r==null?void 0:r.length)===t.length&&r.every(({scale:a},n)=>Math.abs(a-t[n].scale)<.001)}_computeFetchConcurrency(){const{blockBoundary:s}=this.layer.serviceRasterInfo.storageInfo,e=s[s.length-1];return(e.maxCol-e.minCol+1)*(e.maxRow-e.minRow+1)>64?2:10}async _enqueueTileFetch(s,e){var t;if(!this._fetchQueue.has(s.key.id)){try{const r=await this._fetchQueue.push(s.key),i=this._getBandIds();let a=!this.useProgressiveUpdate||this.layerView.hasTilingEffects&&!this._globalSymbolizerParams;if(this._globalUpdateRequested&&!this.layerView.moving&&this._fetchQueue.length===0){a=!1;try{await this._redrawImage((t=this._abortController)==null?void 0:t.signal)}catch(l){F(l)&&C.getLogger(this).error(l)}this._globalUpdateRequested=!1}!this.canUseWebGLForProcessing()&&this.type!=="rasterVF"||this.layerView.hasTilingEffects||this._symbolizerParams!=null||this._updateSymbolizerParams();const n=this._tileInfoView.getTileCoords(Os,s.key),o=this._tileInfoView.getTileResolution(s.key);await this.updateTileSource(s,{source:r,symbolizerParams:this._symbolizerParams,globalSymbolizerParams:this._globalSymbolizerParams,suspended:a,bandIds:i,coords:n,resolution:o}),s.once("attach",()=>this.layerView.requestUpdate()),this.container.addChild(s)}catch(r){F(r)||C.getLogger(this).error(r)}this.layerView.requestUpdate()}}async _redrawImage(s){if(this.container.children.length===0)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects?await this._updateGlobalSymbolizerParams(s):(this._updateSymbolizerParams(),this._globalSymbolizerParams=null);const e=this.container.children.map(async t=>this.updateTileSymbolizerParameters(t,{local:this._symbolizerParams,global:this._globalSymbolizerParams}));await Promise.allSettled(e),this.container.requestRender()}async _updateGlobalSymbolizerParams(s){const e={srcResolution:this._srcResolutions[this.previousLOD.level],registryId:this._blockCacheRegistryId,signal:s},t=await this.layer.fetchPixels(this.layerView.view.extent,this.layerView.view.width,this.layerView.view.height,e);if(!(t!=null&&t.pixelBlock))return;const{resolution:r}=this.previousLOD,i=this._getBandIds(),a=this.layer.symbolizer.generateWebGLParameters({pixelBlock:t.pixelBlock.extractBands(i),isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:r,y:r},bandIds:i});!this.canUseWebGLForProcessing()&&a&&a.type==="stretch"&&this.layer.renderer&&this.layer.renderer.type==="raster-stretch"&&(a.factor=a.factor.map(n=>255*n),a.outMin=Math.round(255*a.outMin),a.outMax=Math.round(255*a.outMax)),this._globalSymbolizerParams=a}_updateSymbolizerParams(){const{resolution:s}=this.previousLOD,e=this._getBandIds();this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:s,y:s},bandIds:e})}_updateBlockCacheRegistry(s=!1){const{layer:e,layerView:t}=this,{raster:r}=e,{multidimensionalDefinition:i}=e.normalizeRasterFetchOptions({multidimensionalDefinition:e.multidimensionalDefinition,timeExtent:t.timeExtent}),a=r.rasterInfo.multidimensionalInfo?r.getSliceIndex(i):null,n=et(r.rasterId,a);if(n!==this._blockCacheRegistryUrl){if(this._blockCacheRegistryUrl!=null&&se(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryId=tt(n,r.rasterInfo),s){const{view:o}=t,l=this._tileInfoView.getClosestInfoForScale(o.scale),u=this._srcResolutions[l.level];te(n,this._blockCacheRegistryId,o.extent,o.resolution,u,r.ioConfig.sampling)}this._blockCacheRegistryUrl=n}}async doRefresh(){if(!this.attached||!this.previousLOD||this.layerView.suspended)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._updateBlockCacheRegistry(!0),this._fetchQueue.reset();const s=[];this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,this._tileStrategy.refresh(e=>s.push(this._enqueueTileFetch(e))),await this._updatingHandles.addPromise(Promise.allSettled(s))}};h([p()],x.prototype,"_globalUpdateRequested",void 0),h([p()],x.prototype,"attached",void 0),h([p()],x.prototype,"container",void 0),h([p()],x.prototype,"layer",void 0),h([p()],x.prototype,"layerView",void 0),h([p()],x.prototype,"type",void 0),h([p()],x.prototype,"useWebGLForProcessing",null),h([p()],x.prototype,"useProgressiveUpdate",null),h([p()],x.prototype,"timeExtent",void 0),h([p()],x.prototype,"updating",null),x=h([M("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],x);let S=class extends x{constructor(){super(...arguments),this.type="raster"}attach(){super.attach(),this.container=new Gs(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this.updateRasterFunctionParameters()}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}canUseWebGLForProcessing(){var i,a;const{symbolizer:e}=this.layer,t=(a=(i=e.lookup)==null?void 0:i.colormapLut)==null?void 0:a.indexedColormap,r=t&&t.length>this._maxIndexedColormapSize;return this.useWebGLForProcessing&&e.canRenderInWebGL&&!r&&!(this.layer.interpolation==="majority"&&oe(this.layer))}fetchTile(e,t){return this.layer.fetchTile(e.level,e.row,e.col,t)}updateRasterFunctionParameters(){const{clips:e,view:t}=this.layerView;this._geometry!=null&&e.remove(this._geometry);const{raster:r,type:i}=this.layer;if(r.datasetFormat==="Function"){const w=r.getClippingGeometry(t.spatialReference);if(w){const g=new ke({geometry:w});e.add(g),this._geometry=g}}const{container:a}=this;if(r.datasetFormat!=="Function"||i==="wcs")return a.rasterFunctionChain=null,a.children.forEach(w=>{const{bitmap:g}=w;g&&(g.suspended=!0,g.processed=!1,g.projected&&(g.invalidateTexture(),g.rasterTexture=null))}),void(this._rasterFunctionState="na");const n=this._rasterFunctionState,{rasterFunction:o,primaryRasters:l}=r,u=o.supportsGPU&&(!l||l.rasters.length<=1),m=u?o.flatWebGLFunctionChain:null,{renderer:d}=this.layer,c=!u||!(m!=null&&m.functions.length)||(d==null?void 0:d.type)==="raster-stretch"&&d.dynamicRangeAdjustment||!this.canUseWebGLForProcessing();a.rasterFunctionChain=c?null:m;const f=o==null?"na":a.rasterFunctionChain?"gpu":"cpu";a.children.forEach(w=>{const{bitmap:g}=w;g&&(g.suspended=n!==f,g.processed=!1,g.processedTexture=null)}),this._rasterFunctionState=f}async updateTileSource(e,t){const r=this._getBandIds(),i=this._getLayerInterpolation(),a=this.canUseWebGLForProcessing(),{source:n,globalSymbolizerParams:o,suspended:l,coords:u,resolution:m}=t,d=this.layerView.hasTilingEffects?o:t.symbolizerParams,{bitmap:c}=e;if([c.x,c.y]=u,c.resolution=m,(n==null?void 0:n.pixelBlock)!=null){const f={extent:n.extent,pixelBlock:n.pixelBlock,srcPixelSize:n.srcTilePixelSize};if(c.rawPixelData=f,a)c.source=n.pixelBlock,c.isRendereredSource=!1;else{const w=await this.layer.applyRenderer(f,(o==null?void 0:o.type)==="stretch"?o:void 0);c.source=w,c.isRendereredSource=!0}c.symbolizerParameters=a?d:null,c.transformGrid=a?n.transformGrid:null}else{const f=this.createEmptyTilePixelBlock();c.source=f,c.symbolizerParameters=a?d:null,c.transformGrid=null}c.bandIds=a?r:null,c.width=this._tileInfoView.tileInfo.size[0],c.height=this._tileInfoView.tileInfo.size[1],c.interpolation=i,c.suspended=l,c.invalidateTexture()}async updateTileSymbolizerParameters(e,t){const{local:r,global:i}=t,a=this._getBandIds(),n=this._getLayerInterpolation(),o=this.canUseWebGLForProcessing(),{bitmap:l}=e,{rawPixelData:u}=l;o||u==null?(l.isRendereredSource&&u!=null&&(l.source=u.pixelBlock),l.isRendereredSource=!1):(l.source=await this.layer.applyRenderer(u,(i==null?void 0:i.type)==="stretch"?i:void 0),l.isRendereredSource=!0),l.symbolizerParameters=o?this.layerView.hasTilingEffects?i:r:null,l.bandIds=o?a:null,l.interpolation=n,l.suspended=!1}_getLayerInterpolation(){const{interpolation:e,renderer:t}=this.layer;if(!t)return e;const r=t.type;return r==="raster-colormap"||r==="unique-value"||r==="class-breaks"?"nearest":t.type==="raster-stretch"&&t.colorRamp!=null?e==="bilinear"||e==="cubic"?"bilinear":"nearest":e}};h([p()],S.prototype,"container",void 0),h([p()],S.prototype,"layer",void 0),h([p()],S.prototype,"type",void 0),S=h([M("esri.views.2d.layers.imagery.ImageryTileView2D")],S);const Es=S;class As extends le{constructor(e,t,r,i,a,n,o=null){super(e,t,r,i,a,n),this.tileData=new Ve(o),this.tileData.coordScale=[a,n],this.tileData.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.tileData.destroy(),this.tileData=null,this.stage=null}set stencilRef(e){this.tileData.stencilRef=e}get stencilRef(){return this.tileData.stencilRef}_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z()}}setTransform(e){super.setTransform(e);const t=this.resolution/(e.resolution*e.pixelRatio),r=this.transforms.tileMat3,[i,a]=this.tileData.offset,n=[this.x+i*this.resolution,this.y-a*this.resolution],[o,l]=e.toScreenNoRotation([0,0],n),{symbolTileSize:u}=this.tileData.symbolizerParameters,m=Math.round((this.width-this.tileData.offset[0])/u)*u,d=Math.round((this.height-this.tileData.offset[1])/u)*u,c=m/this.rangeX*t,f=d/this.rangeY*t;$e(r,c,0,0,0,f,0,o,l,1),ae(this.transforms.displayViewScreenMat3,e.displayViewMat3,r),this.tileData.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}onAttach(){this.tileData.stage=this.stage}onDetach(){this.tileData.stage=null}}class js extends ue{constructor(){super(...arguments),this.isCustomTilingScheme=!1,this.symbolTypes=["triangle"]}createTile(e){const t=this._tileInfoView.getTileBounds(ne(),e),[r,i]=this._tileInfoView.tileInfo.size,a=this._tileInfoView.getTileResolution(e.level);return new As(e,a,t[0],t[3],r,i)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"imagery (vf tile)",brushes:[Be],target:()=>this.children.map(r=>r.tileData),drawPhase:O.MAP});return[...super.prepareRenderPasses(e),t]}doRender(e){this.visible&&e.drawPhase===O.MAP&&this.symbolTypes.forEach(t=>{e.renderPass=t,super.doRender(e)})}}let R=class extends x{constructor(){super(...arguments),this._handle=null,this.type="rasterVF"}canUseWebGLForProcessing(){return!1}async fetchTile(s,e){e={...e,interpolation:"nearest",requestProjectedLocalDirections:!0};const t=await this.layer.fetchTile(s.level,s.row,s.col,e);return this.layer.serviceRasterInfo.dataType==="vector-magdir"&&(t!=null&&t.pixelBlock)&&(t.pixelBlock=await this.layer.convertVectorFieldData(t.pixelBlock,e)),t}updateTileSource(s,e){const t=e.symbolizerParams,{tileData:r}=s;r.key=s.key,r.width=this._tileInfoView.tileInfo.size[0],r.height=this._tileInfoView.tileInfo.size[1];const{symbolTileSize:i}=t,{source:a}=e;if(r.offset=this._getTileSymbolOffset(r.key,i),(a==null?void 0:a.pixelBlock)!=null){const n={extent:a.extent,pixelBlock:a.pixelBlock};r.rawPixelData=n,r.symbolizerParameters=t,r.source=this._sampleVectorFieldData(a.pixelBlock,t,r.offset)}else{const n=[Math.round((this._tileInfoView.tileInfo.size[0]-r.offset[0])/i),Math.round((this._tileInfoView.tileInfo.size[1]-r.offset[1])/i)],o=this.createEmptyTilePixelBlock(n);r.source=o,r.symbolizerParameters=t}return r.invalidateVAO(),Promise.resolve()}updateTileSymbolizerParameters(s,e){var o;const t=e.local,{symbolTileSize:r}=t,{tileData:i}=s;i.offset=this._getTileSymbolOffset(i.key,r);const a=i.symbolizerParameters.symbolTileSize;i.symbolizerParameters=t;const n=(o=i.rawPixelData)==null?void 0:o.pixelBlock;return n!=null&&a!==r&&(i.source=this._sampleVectorFieldData(n,i.symbolizerParameters,i.offset)),Promise.resolve()}attach(){super.attach(),this.container=new js(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this._updateSymbolType(this.layer.renderer),this._handle=D(()=>this.layer.renderer,s=>this._updateSymbolType(s))}detach(){var s;super.detach(),this.container.removeAllChildren(),(s=this._handle)==null||s.remove(),this._handle=null,this.container=null}_getTileSymbolOffset(s,e){const t=s.col*this._tileInfoView.tileInfo.size[0]%e,r=s.row*this._tileInfoView.tileInfo.size[1]%e;return[t>e/2?e-t:-t,r>e/2?e-r:-r]}_sampleVectorFieldData(s,e,t){const{symbolTileSize:r}=e;return Ze(s,"vector-uv",r,t)}_updateSymbolType(s){s.type==="vector-field"&&(this.container.symbolTypes=s.style==="wind-barb"?["scalar","triangle"]:s.style==="simple-scalar"?["scalar"]:["triangle"])}};h([p()],R.prototype,"container",void 0),h([p()],R.prototype,"layer",void 0),h([p()],R.prototype,"type",void 0),R=h([M("esri.views.2d.layers.imagery.VectorFieldTileView2D")],R);const qs=R,Ws=s=>{let e=class extends s{constructor(){super(...arguments),this._rasterFieldPrefix="Raster.",this.layer=null,this.view=null,this.tileInfo=null}get fullExtent(){return this._getfullExtent()}_getfullExtent(){return re(this.layer.serviceRasterInfo,this.view.spatialReference)}get hasTilingEffects(){return!!(this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment)}get datumTransformation(){return it(this.layer.fullExtent,this.view.spatialReference,!0)}supportsSpatialReference(t){return!!re(this.layer.serviceRasterInfo,t)}async fetchPopupFeaturesAtLocation(t,r){const{layer:i}=this;if(!t)throw new Y("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:i});const{popupEnabled:a}=i,n=at(i,r);if(!a||n==null)throw new Y("imageryTileLayerView:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:a,popupTemplate:n});const o=[],{value:l,magdirValue:u,processedValue:m}=await i.identify(t,{timeExtent:this.timeExtent,signal:r==null?void 0:r.signal});let d="";if(l&&l.length){d=i.type==="imagery-tile"&&i.hasStandardTime()&&l[0]!=null?l.map(E=>i.getStandardTimeValue(E)).join(", "):l.join(", ");const c={ObjectId:0},f="Raster.ServicePixelValue";c[f]=i.type==="imagery-tile"&&i.raster.datasetFormat==="Function"?m==null?void 0:m.join(", "):d,c[f+".Raw"]=d;const w=i.serviceRasterInfo.attributeTable;if(w!=null){const{fields:E,features:me}=w,N=E.find(({name:T})=>T.toLowerCase()==="value"),B=N?me.find(T=>String(T.attributes[N.name])===d):null;if(B)for(const T in B.attributes)B.attributes.hasOwnProperty(T)&&(c[this._rasterFieldPrefix+T]=B.attributes[T])}const g=i.serviceRasterInfo.dataType;g!=="vector-magdir"&&g!=="vector-uv"||(c["Raster.Magnitude"]=u==null?void 0:u[0],c["Raster.Direction"]=u==null?void 0:u[1]);const V=new Ce(this.fullExtent.clone(),null,c);V.layer=i,V.sourceLayer=V.layer,o.push(V)}return o}};return h([p()],e.prototype,"layer",void 0),h([p(Fe)],e.prototype,"timeExtent",void 0),h([p()],e.prototype,"view",void 0),h([p()],e.prototype,"fullExtent",null),h([p()],e.prototype,"tileInfo",void 0),h([p({readOnly:!0})],e.prototype,"hasTilingEffects",null),h([p()],e.prototype,"datumTransformation",null),e=h([M("esri.views.layers.ImageryTileLayerView")],e),e};let P=class extends Ws(nt(De(Ge))){constructor(){super(...arguments),this._useWebGLForProcessing=!0,this._useProgressiveUpdate=!0,this.subview=null}get useWebGLForProcessing(){return this._useWebGLForProcessing}set useWebGLForProcessing(s){this._useWebGLForProcessing=s,this.subview&&"useWebGLForProcessing"in this.subview&&(this.subview.useWebGLForProcessing=s)}get useProgressiveUpdate(){return this._useWebGLForProcessing}set useProgressiveUpdate(s){this._useProgressiveUpdate=s,this.subview&&"useProgressiveUpdate"in this.subview&&(this.subview.useProgressiveUpdate=s)}get displayParameters(){const{layer:s}=this,e=this._get("displayParameters");return s.renderer?{bandIds:s.bandIds,renderer:s.renderer,interpolation:s.interpolation,multidimensionalDefinition:s.multidimensionalDefinition,rasterFunction:s.type==="imagery-tile"?s.rasterFunction:null}:e}update(s){var e;(e=this.subview)==null||e.update(s),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage(),this._updateSubview(),this.addAttachHandles([D(()=>this.displayParameters,(s,e)=>{const t=s.interpolation!==(e==null?void 0:e.interpolation)&&(s.interpolation==="majority"||(e==null?void 0:e.interpolation)==="majority")&&oe(this.layer),r=s.renderer!==(e==null?void 0:e.renderer)&&this._getSubviewType(e==null?void 0:e.renderer)!==this._getSubviewType(s.renderer);r&&this._updateSubview();const i=s.multidimensionalDefinition!==(e==null?void 0:e.multidimensionalDefinition),a=s.rasterFunction!==(e==null?void 0:e.rasterFunction),n=a&&!this._useWebGLForProcessing,o=i||t||r||n;this.subview.redrawOrRefetch({refetch:o,reprocess:a}).catch(l=>{F(l)||C.getLogger(this).error(l)}),this.notifyChange("updating")}),D(()=>this.layer.multidimensionalSubset??null,(s,e)=>{const{multidimensionalDefinition:t}=this.layer;t!=null&&X(t,s)!==X(t,e)&&(this.subview.redrawOrRefetch({refetch:!0}).catch(r=>{F(r)||C.getLogger(this).error(r)}),this.notifyChange("updating"))},ze),D(()=>this.timeExtent,()=>{this.subview.timeExtent=this.timeExtent,this.subview.redrawOrRefetch({refetch:!0}).catch(s=>{F(s)||C.getLogger(this).error(s)})},Me)])}detach(){var s;this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),(s=this.subview)==null||s.destroy(),this.subview=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}doRefresh(){return this.subview?this.subview.doRefresh():Promise.resolve()}_updateSubview(){var i;const{renderer:s}=this.layer;if(!s)return;const e=this._getSubviewType(s);if(this.subview){if(this.subview.type===e)return void this._attachSubview(this.subview);this._detachSubview(this.subview),(i=this.subview)==null||i.destroy(),this.subview=null}const{layer:t}=this;let r;if(r=e==="rasterVF"?new qs({layer:t,layerView:this}):e==="flow"?new Le({layer:t,layerView:this}):new Es({layer:t,layerView:this}),"useWebGLForProcessing"in r&&(r.useWebGLForProcessing=this._useWebGLForProcessing),"useProgressiveUpdate"in r&&(r.useProgressiveUpdate=this._useProgressiveUpdate),"previousLOD"in r){const{subview:a}=this;r.previousLOD=a&&"previousLOD"in a?a.previousLOD:null}this._attachSubview(r),this.subview=r,this.requestUpdate()}_attachSubview(s){s&&!s.attached&&(s.attach(),s.attached=!0,this.container.addChildAt(s.container,0))}_detachSubview(s){s!=null&&s.attached&&(this.container.removeChild(s.container),s.detach(),s.attached=!1)}_getSubviewType(s){const e=s==null?void 0:s.type;return e==="vector-field"?"rasterVF":e==="flow"?"flow":"raster"}};h([p()],P.prototype,"subview",void 0),h([p()],P.prototype,"useWebGLForProcessing",null),h([p()],P.prototype,"useProgressiveUpdate",null),h([p({readOnly:!0})],P.prototype,"displayParameters",null),P=h([M("esri.views.2d.layers.ImageryTileLayerView2D")],P);const yr=P;export{yr as default}; diff --git a/assets/Indices-Dv-cCjFT.js b/assets/Indices-BRm9v2lM.js similarity index 94% rename from assets/Indices-Dv-cCjFT.js rename to assets/Indices-BRm9v2lM.js index 3e55305..8c480df 100644 --- a/assets/Indices-Dv-cCjFT.js +++ b/assets/Indices-BRm9v2lM.js @@ -1 +1 @@ -import{cg as u,ch as i}from"./index-CEWggaxV.js";function c(n){if(u(n)){if(n.length(r=r&&l===0,e=e&&l===y,!r&&!e)),r?U(n.length):e?w(n.length):u(n)||n.BYTES_PER_ELEMENT!==Uint16Array.BYTES_PER_ELEMENT?A(n):n}function A(n){let r=!0;for(const e of n){if(e>=65536)return u(n)?new Uint32Array(n):n;e>=256&&(r=!1)}return r?new Uint8Array(n):new Uint16Array(n)}function g(n){return n<=i?new Array(n):n<=65536?new Uint16Array(n):new Uint32Array(n)}let t=(()=>{const n=new Uint32Array(131072);for(let r=0;r{const n=new Uint16Array(65536);for(let r=0;rt.length){const r=Math.max(2*t.length,n);t=new Uint32Array(r);for(let e=0;ef.length){const r=Math.max(2*f.length,n);f=new Uint8Array(r)}return new Uint8Array(f.buffer,0,n)}export{g as i,w as l,c as t}; +import{cg as u,ch as i}from"./index-BjUNJPVf.js";function c(n){if(u(n)){if(n.length(r=r&&l===0,e=e&&l===y,!r&&!e)),r?U(n.length):e?w(n.length):u(n)||n.BYTES_PER_ELEMENT!==Uint16Array.BYTES_PER_ELEMENT?A(n):n}function A(n){let r=!0;for(const e of n){if(e>=65536)return u(n)?new Uint32Array(n):n;e>=256&&(r=!1)}return r?new Uint8Array(n):new Uint16Array(n)}function g(n){return n<=i?new Array(n):n<=65536?new Uint16Array(n):new Uint32Array(n)}let t=(()=>{const n=new Uint32Array(131072);for(let r=0;r{const n=new Uint16Array(65536);for(let r=0;rt.length){const r=Math.max(2*t.length,n);t=new Uint32Array(r);for(let e=0;ef.length){const r=Math.max(2*f.length,n);f=new Uint8Array(r)}return new Uint8Array(f.buffer,0,n)}export{g as i,w as l,c as t}; diff --git a/assets/IntegratedMesh3DTilesLayer-DO6ACvdE.js b/assets/IntegratedMesh3DTilesLayer-BxjpzO7W.js similarity index 97% rename from assets/IntegratedMesh3DTilesLayer-DO6ACvdE.js rename to assets/IntegratedMesh3DTilesLayer-BxjpzO7W.js index c9b2d97..c348b15 100644 --- a/assets/IntegratedMesh3DTilesLayer-DO6ACvdE.js +++ b/assets/IntegratedMesh3DTilesLayer-BxjpzO7W.js @@ -1 +1 @@ -import{dM as z,dp as V,dq as j,bQ as W,dr as X,dO as k,dN as q,aS as b,aE as w,cN as A,cz as x,cU as F,cX as y,e2 as I,cT as S,e3 as M,e4 as $,e5 as N,e6 as T,e7 as m,N as G,ay as D,M as K,s as R,d as f,y as u,e8 as O,du as P,f as Q,bT as Z,cy as g}from"./index-CEWggaxV.js";import{I as U,x as B,Z as C}from"./elevationInfoUtils-Dag_mzct.js";let p=class extends z(V(j(W(X(k(q(Z))))))){constructor(a){super(a),this.operationalLayerType="IntegratedMesh3DTilesLayer",this.spatialReference=new b({wkid:4326,vcsWkid:115700}),this.fullExtent=new w(-180,-90,180,90,this.spatialReference),this.url=null,this.type="integrated-mesh-3dtiles",this.path=null,this.minScale=0,this.maxScale=0}set elevationInfo(a){this._set("elevationInfo",a),this._validateElevationInfo()}_verifyArray(a,i){if(!Array.isArray(a)||a.length7972671&&t[7]>7972671&&t[11]>7945940)return}const o=(L=a.root)==null?void 0:L.transform,c=g();if(i.region&&this._verifyArray(i.region,6)){const t=i.region,l=A(t[0]),n=A(t[1]),r=t[4],s=A(t[2]),e=A(t[3]),d=t[5];this.fullExtent=new w({xmin:l,ymin:n,zmin:r,xmax:s,ymax:e,zmax:d,spatialReference:this.spatialReference})}else if(i.sphere&&this._verifyArray(i.sphere,4)){const t=i.sphere,l=x(t[0],t[1],t[2]),n=t[3]/Math.sqrt(3),r=g();F(r,l,x(-n,-n,-n));const s=g();if(y(s,l,x(n,n,n)),o&&this._verifyArray(o,16)){const v=o;I(c,r,v),S(r,c),I(c,s,v),S(s,c)}M(r,$,0,r,b.WGS84,0,1),M(s,$,0,s,b.WGS84,0,1);const e=g(),d=g();N(e,r,s),T(d,r,s),this.fullExtent=new w({xmin:e[0],ymin:e[1],zmin:e[2],xmax:d[0],ymax:d[1],zmax:d[2],spatialReference:this.spatialReference})}else if(i.box&&this._verifyArray(i.box,12)){const t=i.box,l=x(t[0],t[1],t[2]),n=x(t[3],t[4],t[5]),r=x(t[6],t[7],t[8]),s=x(t[9],t[10],t[11]),e=[];for(let h=0;h<8;++h)e.push(g());if(y(e[0],l,n),y(e[0],e[0],r),y(e[0],e[0],s),m(e[1],l,n),y(e[1],e[1],r),y(e[1],e[1],s),y(e[2],l,n),m(e[2],e[2],r),y(e[2],e[2],s),m(e[3],l,n),m(e[3],e[3],r),y(e[3],e[3],s),y(e[4],l,n),y(e[4],e[4],r),m(e[4],e[4],s),m(e[5],l,n),y(e[5],e[5],r),m(e[5],e[5],s),y(e[6],l,n),m(e[6],e[6],r),m(e[6],e[6],s),m(e[7],l,n),m(e[7],e[7],r),m(e[7],e[7],s),o&&this._verifyArray(o,16)){const h=o;for(let _=0;_<8;++_)I(e[_],e[_],h)}const d=x(Number.MIN_VALUE,Number.MIN_VALUE,Number.MIN_VALUE),v=x(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let h=0;h<8;++h)M(e[h],$,0,e[h],b.WGS84,0,1),N(v,v,e[h]),T(d,d,e[h]);this.fullExtent=new w({xmin:v[0],ymin:v[1],zmin:v[2],xmax:d[0],ymax:d[1],zmax:d[2],spatialReference:this.spatialReference})}}async load(a){return this.addResolvingPromise(this._doLoad(a)),this}async _doLoad(a){const i=a!=null?a.signal:null;try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:o=>{var c;if((c=o.typeKeywords)!=null&&c.includes("IntegratedMesh"))return!0;throw new G("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"})}},a)}catch(o){D(o)}this.url&&await K(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:i}).then(c=>{this._initFullExtent(c.data)},c=>{D(c)})}async fetchAttributionData(){return this.load().then(()=>({}))}_validateElevationInfo(){const a=this.elevationInfo,i="Integrated mesh 3d tiles layers";U(R.getLogger(this),B(i,"absolute-height",a)),U(R.getLogger(this),C(i,a))}};f([u({type:["IntegratedMesh3DTilesLayer"]})],p.prototype,"operationalLayerType",void 0),f([u({type:b})],p.prototype,"spatialReference",void 0),f([u({type:w})],p.prototype,"fullExtent",void 0),f([u(O)],p.prototype,"elevationInfo",null),f([u({type:["show","hide"]})],p.prototype,"listMode",void 0),f([u(P)],p.prototype,"url",void 0),f([u({readOnly:!0})],p.prototype,"type",void 0),f([u({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],p.prototype,"path",void 0),f([u({type:Number,json:{origins:{"web-scene":{name:"layerDefinition.minScale",write:()=>{},read:()=>{}},"portal-item":{name:"layerDefinition.minScale",write:()=>{},read:()=>{}}}}})],p.prototype,"minScale",void 0),f([u({type:Number,json:{origins:{"web-scene":{name:"layerDefinition.maxScale",write:()=>{},read:()=>{}},"portal-item":{name:"layerDefinition.maxScale",write:()=>{},read:()=>{}}}}})],p.prototype,"maxScale",void 0),p=f([Q("esri.layers.IntegratedMesh3DTilesLayer")],p);const Y=p;export{Y as default}; +import{dM as z,dp as V,dq as j,bQ as W,dr as X,dO as k,dN as q,aS as b,aE as w,cN as A,cz as x,cU as F,cX as y,e2 as I,cT as S,e3 as M,e4 as $,e5 as N,e6 as T,e7 as m,N as G,ay as D,M as K,s as R,d as f,y as u,e8 as O,du as P,f as Q,bT as Z,cy as g}from"./index-BjUNJPVf.js";import{I as U,x as B,Z as C}from"./elevationInfoUtils-DIYaTlLQ.js";let p=class extends z(V(j(W(X(k(q(Z))))))){constructor(a){super(a),this.operationalLayerType="IntegratedMesh3DTilesLayer",this.spatialReference=new b({wkid:4326,vcsWkid:115700}),this.fullExtent=new w(-180,-90,180,90,this.spatialReference),this.url=null,this.type="integrated-mesh-3dtiles",this.path=null,this.minScale=0,this.maxScale=0}set elevationInfo(a){this._set("elevationInfo",a),this._validateElevationInfo()}_verifyArray(a,i){if(!Array.isArray(a)||a.length7972671&&t[7]>7972671&&t[11]>7945940)return}const o=(L=a.root)==null?void 0:L.transform,c=g();if(i.region&&this._verifyArray(i.region,6)){const t=i.region,l=A(t[0]),n=A(t[1]),r=t[4],s=A(t[2]),e=A(t[3]),d=t[5];this.fullExtent=new w({xmin:l,ymin:n,zmin:r,xmax:s,ymax:e,zmax:d,spatialReference:this.spatialReference})}else if(i.sphere&&this._verifyArray(i.sphere,4)){const t=i.sphere,l=x(t[0],t[1],t[2]),n=t[3]/Math.sqrt(3),r=g();F(r,l,x(-n,-n,-n));const s=g();if(y(s,l,x(n,n,n)),o&&this._verifyArray(o,16)){const v=o;I(c,r,v),S(r,c),I(c,s,v),S(s,c)}M(r,$,0,r,b.WGS84,0,1),M(s,$,0,s,b.WGS84,0,1);const e=g(),d=g();N(e,r,s),T(d,r,s),this.fullExtent=new w({xmin:e[0],ymin:e[1],zmin:e[2],xmax:d[0],ymax:d[1],zmax:d[2],spatialReference:this.spatialReference})}else if(i.box&&this._verifyArray(i.box,12)){const t=i.box,l=x(t[0],t[1],t[2]),n=x(t[3],t[4],t[5]),r=x(t[6],t[7],t[8]),s=x(t[9],t[10],t[11]),e=[];for(let h=0;h<8;++h)e.push(g());if(y(e[0],l,n),y(e[0],e[0],r),y(e[0],e[0],s),m(e[1],l,n),y(e[1],e[1],r),y(e[1],e[1],s),y(e[2],l,n),m(e[2],e[2],r),y(e[2],e[2],s),m(e[3],l,n),m(e[3],e[3],r),y(e[3],e[3],s),y(e[4],l,n),y(e[4],e[4],r),m(e[4],e[4],s),m(e[5],l,n),y(e[5],e[5],r),m(e[5],e[5],s),y(e[6],l,n),m(e[6],e[6],r),m(e[6],e[6],s),m(e[7],l,n),m(e[7],e[7],r),m(e[7],e[7],s),o&&this._verifyArray(o,16)){const h=o;for(let _=0;_<8;++_)I(e[_],e[_],h)}const d=x(Number.MIN_VALUE,Number.MIN_VALUE,Number.MIN_VALUE),v=x(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let h=0;h<8;++h)M(e[h],$,0,e[h],b.WGS84,0,1),N(v,v,e[h]),T(d,d,e[h]);this.fullExtent=new w({xmin:v[0],ymin:v[1],zmin:v[2],xmax:d[0],ymax:d[1],zmax:d[2],spatialReference:this.spatialReference})}}async load(a){return this.addResolvingPromise(this._doLoad(a)),this}async _doLoad(a){const i=a!=null?a.signal:null;try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:o=>{var c;if((c=o.typeKeywords)!=null&&c.includes("IntegratedMesh"))return!0;throw new G("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"})}},a)}catch(o){D(o)}this.url&&await K(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:i}).then(c=>{this._initFullExtent(c.data)},c=>{D(c)})}async fetchAttributionData(){return this.load().then(()=>({}))}_validateElevationInfo(){const a=this.elevationInfo,i="Integrated mesh 3d tiles layers";U(R.getLogger(this),B(i,"absolute-height",a)),U(R.getLogger(this),C(i,a))}};f([u({type:["IntegratedMesh3DTilesLayer"]})],p.prototype,"operationalLayerType",void 0),f([u({type:b})],p.prototype,"spatialReference",void 0),f([u({type:w})],p.prototype,"fullExtent",void 0),f([u(O)],p.prototype,"elevationInfo",null),f([u({type:["show","hide"]})],p.prototype,"listMode",void 0),f([u(P)],p.prototype,"url",void 0),f([u({readOnly:!0})],p.prototype,"type",void 0),f([u({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],p.prototype,"path",void 0),f([u({type:Number,json:{origins:{"web-scene":{name:"layerDefinition.minScale",write:()=>{},read:()=>{}},"portal-item":{name:"layerDefinition.minScale",write:()=>{},read:()=>{}}}}})],p.prototype,"minScale",void 0),f([u({type:Number,json:{origins:{"web-scene":{name:"layerDefinition.maxScale",write:()=>{},read:()=>{}},"portal-item":{name:"layerDefinition.maxScale",write:()=>{},read:()=>{}}}}})],p.prototype,"maxScale",void 0),p=f([Q("esri.layers.IntegratedMesh3DTilesLayer")],p);const Y=p;export{Y as default}; diff --git a/assets/IntegratedMeshLayer-DkCYLSWg.js b/assets/IntegratedMeshLayer-D8IB-5_i.js similarity index 90% rename from assets/IntegratedMeshLayer-DkCYLSWg.js rename to assets/IntegratedMeshLayer-D8IB-5_i.js index 304848c..c1ed9f0 100644 --- a/assets/IntegratedMeshLayer-DkCYLSWg.js +++ b/assets/IntegratedMeshLayer-D8IB-5_i.js @@ -1 +1 @@ -import{d as i,y as a,aB as _,aR as O,f as u,aU as b,bw as x,au as L,h2 as N,aV as M,dm as R,V as j,bW as A,M as J,dM as P,dp as V,dq as $,bQ as U,dr as D,dO as E,dN as K,z,ez as q,d5 as C,ay as G,N as c,s as S,aZ as H,e8 as Z,bT as k}from"./index-CEWggaxV.js";import{j as h}from"./persistable-uPSrwVmW.js";import{L as B,P as w}from"./SceneService-l5OfqT0E.js";import{s as F,l as Q,u as W,m as X}from"./I3SLayerDefinitions-B6gGfNoh.js";import{I as T,x as Y,Z as ee}from"./elevationInfoUtils-Dag_mzct.js";import"./MD5-C9MwAd2G.js";import"./multiOriginJSONSupportUtils-C0wm8_Yw.js";import"./resourceExtension-orEjzZQo.js";import"./originUtils-D69mHv66.js";import"./resourceUtils-Cu1-5qu3.js";import"./resourceUtils-CjqYbm2Q.js";import"./saveAPIKeyUtils-BiX1lQSW.js";import"./saveUtils-BzCRy3uR.js";var f;let n=f=class extends b{constructor(e){super(e),this.geometry=null,this.type="clip"}writeGeometry(e,t,o,r){var l;if((l=r.layer)!=null&&l.spatialReference&&!r.layer.spatialReference.equals(this.geometry.spatialReference)){if(!x(e.spatialReference,r.layer.spatialReference))return void((r==null?void 0:r.messages)&&r.messages.push(new L("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:r.layer.spatialReference,context:r})));const y=new _;N(e,y,r.layer.spatialReference),t[o]=y.toJSON(r)}else t[o]=e.toJSON(r);delete t[o].spatialReference}clone(){return new f({geometry:M(this.geometry),type:this.type})}};i([a({type:_}),h()],n.prototype,"geometry",void 0),i([O(["web-scene","portal-item"],"geometry")],n.prototype,"writeGeometry",null),i([a({type:["clip","mask","replace"],nonNullable:!0}),h()],n.prototype,"type",void 0),n=f=i([u("esri.layers.support.SceneModification")],n);const m=n;var p;let d=p=class extends R(j.ofType(m)){constructor(e){super(e),this.url=null}clone(){return new p({url:this.url,items:this.items.map(e=>e.clone())})}toJSON(e){return this.toArray().map(t=>t.toJSON(e)).filter(t=>!!t.geometry)}static fromJSON(e,t){const o=new p;for(const r of e)o.add(m.fromJSON(r,t));return o}static async fromUrl(e,t,o){const r={url:A(e),origin:"service"},l=await J(e,{responseType:"json",signal:o==null?void 0:o.signal}),y=t.toJSON(),g=[];for(const v of l.data)g.push(m.fromJSON({...v,geometry:{...v.geometry,spatialReference:y}},r));return new p({url:e,items:g})}};i([a({type:String})],d.prototype,"url",void 0),d=p=i([u("esri.layers.support.SceneModifications")],d);const I=d;let s=class extends B(P(V($(U(D(E(K(k)))))))){constructor(...e){super(...e),this.geometryType="mesh",this.operationalLayerType="IntegratedMeshLayer",this.type="integrated-mesh",this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.profile="mesh-pyramids",this.modifications=null,this._modificationsSource=null,this.path=null}initialize(){this.addHandles(z(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,q))}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}readModifications(e,t,o){this._modificationsSource={url:C(e,o),context:o}}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const t=e==null?void 0:e.signal;try{await this.loadFromPortal({supportedTypes:["Scene Service"]},e)}catch(o){G(o)}if(await this._fetchService(t),this._modificationsSource!=null){const o=await I.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",o,this._modificationsSource.context.origin),this._modificationsSource=null}await this._fetchIndexAndUpdateExtent(this.nodePages,t)}beforeSave(){if(this._modificationsSource!=null)return this.load().then(()=>{},()=>{})}async saveAs(e,t){return this._debouncedSaveOperations(w.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"};return this._debouncedSaveOperations(w.SAVE,e)}validateLayer(e){if(e.layerType&&e.layerType!=="IntegratedMesh")throw new c("integrated-mesh-layer:layer-type-not-supported","IntegratedMeshLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new c("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});if(this.version.major>1)throw new c("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"})}_getTypeKeywords(){return["IntegratedMeshLayer"]}_validateElevationInfo(){const e=this.elevationInfo,t="Integrated mesh layers";T(S.getLogger(this),Y(t,"absolute-height",e)),T(S.getLogger(this),ee(t,e))}};i([a({type:String,readOnly:!0})],s.prototype,"geometryType",void 0),i([a({type:["show","hide"]})],s.prototype,"listMode",void 0),i([a({type:["IntegratedMeshLayer"]})],s.prototype,"operationalLayerType",void 0),i([a({json:{read:!1},readOnly:!0})],s.prototype,"type",void 0),i([a({type:F,readOnly:!0})],s.prototype,"nodePages",void 0),i([a({type:[Q],readOnly:!0})],s.prototype,"materialDefinitions",void 0),i([a({type:[W],readOnly:!0})],s.prototype,"textureSetDefinitions",void 0),i([a({type:[X],readOnly:!0})],s.prototype,"geometryDefinitions",void 0),i([a({readOnly:!0})],s.prototype,"serviceUpdateTimeStamp",void 0),i([a({type:I}),h({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],s.prototype,"modifications",void 0),i([H(["web-scene","portal-item"],"modifications")],s.prototype,"readModifications",null),i([a(Z)],s.prototype,"elevationInfo",null),i([a({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],s.prototype,"path",void 0),s=i([u("esri.layers.IntegratedMeshLayer")],s);const he=s;export{he as default}; +import{d as i,y as a,aB as _,aR as O,f as u,aU as b,bw as x,au as L,h2 as N,aV as M,dm as R,V as j,bW as A,M as J,dM as P,dp as V,dq as $,bQ as U,dr as D,dO as E,dN as K,z,ez as q,d5 as C,ay as G,N as c,s as S,aZ as H,e8 as Z,bT as k}from"./index-BjUNJPVf.js";import{j as h}from"./persistable-3OEDOKAC.js";import{L as B,P as w}from"./SceneService-DbS150xR.js";import{s as F,l as Q,u as W,m as X}from"./I3SLayerDefinitions-Bc0e5Sgz.js";import{I as T,x as Y,Z as ee}from"./elevationInfoUtils-DIYaTlLQ.js";import"./MD5-C9MwAd2G.js";import"./multiOriginJSONSupportUtils-C0wm8_Yw.js";import"./resourceExtension-CiV172Z4.js";import"./originUtils-D69mHv66.js";import"./resourceUtils-p9pTIVIi.js";import"./resourceUtils-CfE36DzP.js";import"./saveAPIKeyUtils-YRBbgdzi.js";import"./saveUtils-CGGzyvzv.js";var f;let n=f=class extends b{constructor(e){super(e),this.geometry=null,this.type="clip"}writeGeometry(e,t,o,r){var l;if((l=r.layer)!=null&&l.spatialReference&&!r.layer.spatialReference.equals(this.geometry.spatialReference)){if(!x(e.spatialReference,r.layer.spatialReference))return void((r==null?void 0:r.messages)&&r.messages.push(new L("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:r.layer.spatialReference,context:r})));const y=new _;N(e,y,r.layer.spatialReference),t[o]=y.toJSON(r)}else t[o]=e.toJSON(r);delete t[o].spatialReference}clone(){return new f({geometry:M(this.geometry),type:this.type})}};i([a({type:_}),h()],n.prototype,"geometry",void 0),i([O(["web-scene","portal-item"],"geometry")],n.prototype,"writeGeometry",null),i([a({type:["clip","mask","replace"],nonNullable:!0}),h()],n.prototype,"type",void 0),n=f=i([u("esri.layers.support.SceneModification")],n);const m=n;var p;let d=p=class extends R(j.ofType(m)){constructor(e){super(e),this.url=null}clone(){return new p({url:this.url,items:this.items.map(e=>e.clone())})}toJSON(e){return this.toArray().map(t=>t.toJSON(e)).filter(t=>!!t.geometry)}static fromJSON(e,t){const o=new p;for(const r of e)o.add(m.fromJSON(r,t));return o}static async fromUrl(e,t,o){const r={url:A(e),origin:"service"},l=await J(e,{responseType:"json",signal:o==null?void 0:o.signal}),y=t.toJSON(),g=[];for(const v of l.data)g.push(m.fromJSON({...v,geometry:{...v.geometry,spatialReference:y}},r));return new p({url:e,items:g})}};i([a({type:String})],d.prototype,"url",void 0),d=p=i([u("esri.layers.support.SceneModifications")],d);const I=d;let s=class extends B(P(V($(U(D(E(K(k)))))))){constructor(...e){super(...e),this.geometryType="mesh",this.operationalLayerType="IntegratedMeshLayer",this.type="integrated-mesh",this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.profile="mesh-pyramids",this.modifications=null,this._modificationsSource=null,this.path=null}initialize(){this.addHandles(z(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,q))}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}readModifications(e,t,o){this._modificationsSource={url:C(e,o),context:o}}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const t=e==null?void 0:e.signal;try{await this.loadFromPortal({supportedTypes:["Scene Service"]},e)}catch(o){G(o)}if(await this._fetchService(t),this._modificationsSource!=null){const o=await I.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",o,this._modificationsSource.context.origin),this._modificationsSource=null}await this._fetchIndexAndUpdateExtent(this.nodePages,t)}beforeSave(){if(this._modificationsSource!=null)return this.load().then(()=>{},()=>{})}async saveAs(e,t){return this._debouncedSaveOperations(w.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"};return this._debouncedSaveOperations(w.SAVE,e)}validateLayer(e){if(e.layerType&&e.layerType!=="IntegratedMesh")throw new c("integrated-mesh-layer:layer-type-not-supported","IntegratedMeshLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new c("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});if(this.version.major>1)throw new c("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"})}_getTypeKeywords(){return["IntegratedMeshLayer"]}_validateElevationInfo(){const e=this.elevationInfo,t="Integrated mesh layers";T(S.getLogger(this),Y(t,"absolute-height",e)),T(S.getLogger(this),ee(t,e))}};i([a({type:String,readOnly:!0})],s.prototype,"geometryType",void 0),i([a({type:["show","hide"]})],s.prototype,"listMode",void 0),i([a({type:["IntegratedMeshLayer"]})],s.prototype,"operationalLayerType",void 0),i([a({json:{read:!1},readOnly:!0})],s.prototype,"type",void 0),i([a({type:F,readOnly:!0})],s.prototype,"nodePages",void 0),i([a({type:[Q],readOnly:!0})],s.prototype,"materialDefinitions",void 0),i([a({type:[W],readOnly:!0})],s.prototype,"textureSetDefinitions",void 0),i([a({type:[X],readOnly:!0})],s.prototype,"geometryDefinitions",void 0),i([a({readOnly:!0})],s.prototype,"serviceUpdateTimeStamp",void 0),i([a({type:I}),h({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],s.prototype,"modifications",void 0),i([H(["web-scene","portal-item"],"modifications")],s.prototype,"readModifications",null),i([a(Z)],s.prototype,"elevationInfo",null),i([a({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],s.prototype,"path",void 0),s=i([u("esri.layers.IntegratedMeshLayer")],s);const he=s;export{he as default}; diff --git a/assets/InterleavedLayout-Dd1W8HCo.js b/assets/InterleavedLayout-Cinhb-cY.js similarity index 96% rename from assets/InterleavedLayout-Dd1W8HCo.js rename to assets/InterleavedLayout-Cinhb-cY.js index 4273452..cadde37 100644 --- a/assets/InterleavedLayout-Dd1W8HCo.js +++ b/assets/InterleavedLayout-Cinhb-cY.js @@ -1 +1 @@ -import{y as l,u as o,i as a,c as p,l as c,p as _,o as y,m as F,T as m,h as g,a as w,b,d as v,A as E,O as z,x as A,g as T,w as H,E as I,L as M,B as $,F as O,I as k,U as D,j as B,V as C,M as G,S as V,k as j,q as L,v as q,z as J,C as K,D as N,G as S,H as P}from"./BufferView-Ao_K-5Vg.js";import{e as f}from"./types-D0PSWh4d.js";import{s as Q}from"./Util-BS8sJGjF.js";class h{constructor(t,e){this.layout=t,this.buffer=typeof e=="number"?new ArrayBuffer(e*t.stride):e;for(const s of t.fields.keys()){const i=t.fields.get(s);this[s]=new i.constructor(this.buffer,i.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(t,e){const s=this[t];return s&&s.elementCount===e.ElementCount&&s.elementType===e.ElementType?s:null}slice(t,e){return new h(this.layout,this.buffer.slice(t*this.stride,e*this.stride))}copyFrom(t,e=0,s=0,i=t.count){const r=this.stride;if(r%4==0){const d=new Uint32Array(t.buffer,e*r,i*r/4);new Uint32Array(this.buffer,s*r,i*r/4).set(d)}else{const d=new Uint8Array(t.buffer,e*r,i*r);new Uint8Array(this.buffer,s*r,i*r).set(d)}return this}get usedMemory(){return this.byteLength}dispose(){}}class u{constructor(t=null){this._stride=0,this._lastAligned=0,this._fields=new Map,t&&(this._stride=t.stride,t.fields.forEach(e=>this._fields.set(e[0],{...e[1],constructor:W(e[1].constructor)})))}vec2f(t,e){return this._appendField(t,o,e),this}vec2f64(t,e){return this._appendField(t,F,e),this}vec3f(t,e){return this._appendField(t,a,e),this}vec3f64(t,e){return this._appendField(t,m,e),this}vec4f(t,e){return this._appendField(t,p,e),this}vec4f64(t,e){return this._appendField(t,g,e),this}mat3f(t,e){return this._appendField(t,c,e),this}mat3f64(t,e){return this._appendField(t,w,e),this}mat4f(t,e){return this._appendField(t,_,e),this}mat4f64(t,e){return this._appendField(t,b,e),this}vec4u8(t,e){return this._appendField(t,A,e),this}f32(t,e){return this._appendField(t,l,e),this}f64(t,e){return this._appendField(t,y,e),this}u8(t,e){return this._appendField(t,v,e),this}u16(t,e){return this._appendField(t,T,e),this}i8(t,e){return this._appendField(t,B,e),this}vec2i8(t,e){return this._appendField(t,C,e),this}vec2i16(t,e){return this._appendField(t,L,e),this}vec2u8(t,e){return this._appendField(t,E,e),this}vec4u16(t,e){return this._appendField(t,M,e),this}u32(t,e){return this._appendField(t,$,e),this}_appendField(t,e,s){if(this._fields.has(t))return void Q(!1,`${t} already added to vertex buffer layout`);const i=e.ElementCount*f(e.ElementType),r=this._stride;this._stride+=i,this._fields.set(t,{size:i,constructor:e,offset:r,optional:s})}createBuffer(t){return new h(this,t)}createView(t){return new h(this,t)}clone(){const t=new u;return t._stride=this._stride,t._fields=new Map,this._fields.forEach((e,s)=>t._fields.set(s,e)),t.BufferType=this.BufferType,t}get stride(){if(this._lastAligned!==this._fields.size){let t=1;this._fields.forEach(e=>t=Math.max(t,f(e.constructor.ElementType))),this._stride=Math.floor((this._stride+t-1)/t)*t,this._lastAligned=this._fields.size}return this._stride}get fields(){return this._fields}}function tt(){return new u}class et{constructor(t){this.fields=new Array,t.fields.forEach((e,s)=>{const i={...e,constructor:U(e.constructor)};this.fields.push([s,i])}),this.stride=t.stride}}const R=[l,o,a,p,c,_,y,F,m,g,w,b,v,E,z,A,T,H,I,M,$,O,k,D,B,C,G,V,j,L,q,J,K,N,S,P];function U(n){return`${n.ElementType}_${n.ElementCount}`}function W(n){return x.get(n)}const x=new Map;R.forEach(n=>x.set(U(n),n));export{tt as H,et as I}; +import{y as l,u as o,i as a,c as p,l as c,p as _,o as y,m as F,T as m,h as g,a as w,b,d as v,A as E,O as z,x as A,g as T,w as H,E as I,L as M,B as $,F as O,I as k,U as D,j as B,V as C,M as G,S as V,k as j,q as L,v as q,z as J,C as K,D as N,G as S,H as P}from"./BufferView-3om6S_aJ.js";import{e as f}from"./types-D0PSWh4d.js";import{s as Q}from"./Util-CS5u4Lec.js";class h{constructor(t,e){this.layout=t,this.buffer=typeof e=="number"?new ArrayBuffer(e*t.stride):e;for(const s of t.fields.keys()){const i=t.fields.get(s);this[s]=new i.constructor(this.buffer,i.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(t,e){const s=this[t];return s&&s.elementCount===e.ElementCount&&s.elementType===e.ElementType?s:null}slice(t,e){return new h(this.layout,this.buffer.slice(t*this.stride,e*this.stride))}copyFrom(t,e=0,s=0,i=t.count){const r=this.stride;if(r%4==0){const d=new Uint32Array(t.buffer,e*r,i*r/4);new Uint32Array(this.buffer,s*r,i*r/4).set(d)}else{const d=new Uint8Array(t.buffer,e*r,i*r);new Uint8Array(this.buffer,s*r,i*r).set(d)}return this}get usedMemory(){return this.byteLength}dispose(){}}class u{constructor(t=null){this._stride=0,this._lastAligned=0,this._fields=new Map,t&&(this._stride=t.stride,t.fields.forEach(e=>this._fields.set(e[0],{...e[1],constructor:W(e[1].constructor)})))}vec2f(t,e){return this._appendField(t,o,e),this}vec2f64(t,e){return this._appendField(t,F,e),this}vec3f(t,e){return this._appendField(t,a,e),this}vec3f64(t,e){return this._appendField(t,m,e),this}vec4f(t,e){return this._appendField(t,p,e),this}vec4f64(t,e){return this._appendField(t,g,e),this}mat3f(t,e){return this._appendField(t,c,e),this}mat3f64(t,e){return this._appendField(t,w,e),this}mat4f(t,e){return this._appendField(t,_,e),this}mat4f64(t,e){return this._appendField(t,b,e),this}vec4u8(t,e){return this._appendField(t,A,e),this}f32(t,e){return this._appendField(t,l,e),this}f64(t,e){return this._appendField(t,y,e),this}u8(t,e){return this._appendField(t,v,e),this}u16(t,e){return this._appendField(t,T,e),this}i8(t,e){return this._appendField(t,B,e),this}vec2i8(t,e){return this._appendField(t,C,e),this}vec2i16(t,e){return this._appendField(t,L,e),this}vec2u8(t,e){return this._appendField(t,E,e),this}vec4u16(t,e){return this._appendField(t,M,e),this}u32(t,e){return this._appendField(t,$,e),this}_appendField(t,e,s){if(this._fields.has(t))return void Q(!1,`${t} already added to vertex buffer layout`);const i=e.ElementCount*f(e.ElementType),r=this._stride;this._stride+=i,this._fields.set(t,{size:i,constructor:e,offset:r,optional:s})}createBuffer(t){return new h(this,t)}createView(t){return new h(this,t)}clone(){const t=new u;return t._stride=this._stride,t._fields=new Map,this._fields.forEach((e,s)=>t._fields.set(s,e)),t.BufferType=this.BufferType,t}get stride(){if(this._lastAligned!==this._fields.size){let t=1;this._fields.forEach(e=>t=Math.max(t,f(e.constructor.ElementType))),this._stride=Math.floor((this._stride+t-1)/t)*t,this._lastAligned=this._fields.size}return this._stride}get fields(){return this._fields}}function tt(){return new u}class et{constructor(t){this.fields=new Array,t.fields.forEach((e,s)=>{const i={...e,constructor:U(e.constructor)};this.fields.push([s,i])}),this.stride=t.stride}}const R=[l,o,a,p,c,_,y,F,m,g,w,b,v,E,z,A,T,H,I,M,$,O,k,D,B,C,G,V,j,L,q,J,K,N,S,P];function U(n){return`${n.ElementType}_${n.ElementCount}`}function W(n){return x.get(n)}const x=new Map;R.forEach(n=>x.set(U(n),n));export{tt as H,et as I}; diff --git a/assets/KMLLayer-D6CvdHt0.js b/assets/KMLLayer-dXg6eYPC.js similarity index 88% rename from assets/KMLLayer-D6CvdHt0.js rename to assets/KMLLayer-dXg6eYPC.js index d002c2e..b78568c 100644 --- a/assets/KMLLayer-D6CvdHt0.js +++ b/assets/KMLLayer-dXg6eYPC.js @@ -1 +1 @@ -import{ca as O,dm as _,z as v,ez as u,g as y,fK as m,aE as d,aT as F,V as b,d as s,y as l,fL as j,aZ as h,f as g,fw as M,bP as $,bQ as C,dp as T,dq as I,dr as K,C as P,aS as S,bV as R,ay as N,aR as z,du as J,bT as V}from"./index-CEWggaxV.js";import{f as A}from"./RefreshableLayer-1EkEhJeI.js";import{j as W,S as w,g as x,d as E}from"./kmlUtils-Dl7cXNEs.js";import"./jsonUtils-BseLl1fZ.js";import"./UniqueValueRenderer-BlkUix3g.js";import"./ColorStop-44hBlQ14.js";import"./diffUtils-B4YFa5Ju.js";import"./colorRamps-BJydlf0f.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-z2k12BH8.js";import"./jsonUtils-qYmXvGJ1.js";import"./styleUtils-CnV_Xzhi.js";import"./Version-Bd0QsIQ5.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./OverrideHelper-B4ryGWZb.js";import"./utils-p-5Bbga5.js";import"./quantizationUtils-CUjGHrU3.js";import"./heatmapUtils-Clt5rJzr.js";import"./FeatureSet-CYJUZgOk.js";var p;let a=p=class extends O.EventedMixin(_(M)){constructor(...e){super(...e),this.description=null,this.fullExtent=null,this.id=null,this.networkLink=null,this.parent=null,this.sublayers=null,this.title=null,this.sourceJSON=null,this.layer=null,this.addHandles([v(()=>this.sublayers,"after-add",({item:t})=>{t.parent=this,t.layer=this.layer},u),v(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=t.parent=null},u),y(()=>this.sublayers,(t,r)=>{if(r)for(const i of r)i.layer=i.parent=null;if(t)for(const i of t)i.parent=this,i.layer=this.layer},u),y(()=>this.layer,t=>{if(this.sublayers)for(const r of this.sublayers)r.layer=t},u)])}initialize(){m(()=>this.networkLink).then(()=>m(()=>this.visible===!0)).then(()=>this.load())}load(e){var i;if(!this.networkLink||this.networkLink.viewFormat)return;const t=e!=null?e.signal:null,r=this._fetchService(((i=this._get("networkLink"))==null?void 0:i.href)??"",t).then(n=>{var c;const L=W(n.sublayers);this.fullExtent=d.fromJSON(L),this.sourceJSON=n;const f=F(b.ofType(p),w(p,n));this.sublayers?this.sublayers.addMany(f):this.sublayers=f,(c=this.layer)==null||c.emit("sublayer-update"),this.layer&&this.layer.notifyChange("visibleSublayers")});return this.addResolvingPromise(r),Promise.resolve(this)}get visible(){return this._get("visible")}set visible(e){this._get("visible")!==e&&(this._set("visible",e),this.layer&&this.layer.notifyChange("visibleSublayers"))}readVisible(e,t){return!!t.visibility}_fetchService(e,t){return x(e,this.layer.outSpatialReference,this.layer.refreshInterval,t).then(r=>E(r.data))}};s([l()],a.prototype,"description",void 0),s([l({type:d})],a.prototype,"fullExtent",void 0),s([l()],a.prototype,"id",void 0),s([l({readOnly:!0,value:null})],a.prototype,"networkLink",void 0),s([l({json:{write:{allowNull:!0}}})],a.prototype,"parent",void 0),s([l({type:b.ofType(a),json:{write:{allowNull:!0}}})],a.prototype,"sublayers",void 0),s([l({value:null,json:{read:{source:"name",reader:e=>j(e)}}})],a.prototype,"title",void 0),s([l({value:!0})],a.prototype,"visible",null),s([h("visible",["visibility"])],a.prototype,"readVisible",null),s([l()],a.prototype,"sourceJSON",void 0),s([l()],a.prototype,"layer",void 0),a=p=s([g("esri.layers.support.KMLSublayer")],a);const k=a,H=["kml","xml"];let o=class extends $(A(C(T(I(K(V)))))){constructor(...e){super(...e),this._visibleFolders=[],this.allSublayers=new P({getCollections:()=>[this.sublayers],getChildrenFunction:t=>t.sublayers}),this.outSpatialReference=S.WGS84,this.path=null,this.legendEnabled=!1,this.operationalLayerType="KML",this.sublayers=null,this.type="kml",this.url=null}initialize(){this.addHandles([y(()=>this.sublayers,(e,t)=>{t&&t.forEach(r=>{r.parent=null,r.layer=null}),e&&e.forEach(r=>{r.parent=this,r.layer=this})},u),this.on("sublayer-update",()=>this.notifyChange("fullExtent"))])}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}readSublayersFromItemOrWebMap(e,t){this._visibleFolders=t.visibleFolders}readSublayers(e,t,r){return w(k,t,r,this._visibleFolders)}writeSublayers(e,t){const r=[],i=e.toArray();for(;i.length;){const n=i[0];n.networkLink||(n.visible&&r.push(n.id),n.sublayers&&i.push(...n.sublayers.toArray())),i.shift()}t.visibleFolders=r}get title(){const e=this._get("title");return e&&this.originOf("title")!=="defaults"?e:this.url?R(this.url,H)||"KML":e||""}set title(e){this._set("title",e)}get visibleSublayers(){const e=this.sublayers,t=[],r=i=>{i.visible&&(t.push(i),i.sublayers&&i.sublayers.forEach(r))};return e&&e.forEach(r),t}get fullExtent(){return this._recomputeFullExtent()}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["KML"],supportsData:!1},e).catch(N).then(()=>this._fetchService(t))),Promise.resolve(this)}destroy(){super.destroy(),this.allSublayers.destroy()}async _fetchService(e){const t=await Promise.resolve().then(()=>this.resourceInfo?{ssl:!1,data:this.resourceInfo}:x(this.url??"",this.outSpatialReference,this.refreshInterval,e)),r=E(t.data);r&&this.read(r,{origin:"service"})}_recomputeFullExtent(){let e=null;this.extent!=null&&(e=this.extent.clone());const t=r=>{if(r.sublayers)for(const i of r.sublayers.items)t(i),i.visible&&i.fullExtent&&(e!=null?e.union(i.fullExtent):e=i.fullExtent.clone())};return t(this),e}};s([l({readOnly:!0})],o.prototype,"allSublayers",void 0),s([l({type:S})],o.prototype,"outSpatialReference",void 0),s([l({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],o.prototype,"path",void 0),s([l({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"legendEnabled",void 0),s([l({type:["show","hide","hide-children"]})],o.prototype,"listMode",void 0),s([l({type:["KML"]})],o.prototype,"operationalLayerType",void 0),s([l({})],o.prototype,"resourceInfo",void 0),s([l({type:b.ofType(k),json:{write:{ignoreOrigin:!0}}})],o.prototype,"sublayers",void 0),s([h(["web-map","portal-item"],"sublayers",["visibleFolders"])],o.prototype,"readSublayersFromItemOrWebMap",null),s([h("service","sublayers",["sublayers"])],o.prototype,"readSublayers",null),s([z("sublayers")],o.prototype,"writeSublayers",null),s([l({readOnly:!0,json:{read:!1}})],o.prototype,"type",void 0),s([l({json:{origins:{"web-map":{read:{source:"title"}}},write:{ignoreOrigin:!0}}})],o.prototype,"title",null),s([l(J)],o.prototype,"url",void 0),s([l({readOnly:!0})],o.prototype,"visibleSublayers",null),s([l({type:d})],o.prototype,"extent",void 0),s([l()],o.prototype,"fullExtent",null),o=s([g("esri.layers.KMLLayer")],o);const ye=o;export{ye as default}; +import{ca as O,dm as _,z as v,ez as u,g as y,fK as m,aE as d,aT as F,V as b,d as s,y as l,fL as j,aZ as h,f as g,fw as M,bP as $,bQ as C,dp as T,dq as I,dr as K,C as P,aS as S,bV as R,ay as N,aR as z,du as J,bT as V}from"./index-BjUNJPVf.js";import{f as A}from"./RefreshableLayer-_r2TPtol.js";import{j as W,S as w,g as x,d as E}from"./kmlUtils-C6tn6hG1.js";import"./jsonUtils-Dw332y6z.js";import"./UniqueValueRenderer-7V9Bhr-D.js";import"./ColorStop-DCGjAKLC.js";import"./diffUtils-uUoMDFQS.js";import"./colorRamps-CcakIWlU.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-BX9G5gNQ.js";import"./jsonUtils-Ox5U0P0F.js";import"./styleUtils-DOUOskVZ.js";import"./Version-Dqq_CHBG.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./OverrideHelper-DxFZBnGL.js";import"./utils-CuXO_Zzq.js";import"./quantizationUtils-CfV316jZ.js";import"./heatmapUtils-BSteZBTj.js";import"./FeatureSet-opEn8ou8.js";var p;let a=p=class extends O.EventedMixin(_(M)){constructor(...e){super(...e),this.description=null,this.fullExtent=null,this.id=null,this.networkLink=null,this.parent=null,this.sublayers=null,this.title=null,this.sourceJSON=null,this.layer=null,this.addHandles([v(()=>this.sublayers,"after-add",({item:t})=>{t.parent=this,t.layer=this.layer},u),v(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=t.parent=null},u),y(()=>this.sublayers,(t,r)=>{if(r)for(const i of r)i.layer=i.parent=null;if(t)for(const i of t)i.parent=this,i.layer=this.layer},u),y(()=>this.layer,t=>{if(this.sublayers)for(const r of this.sublayers)r.layer=t},u)])}initialize(){m(()=>this.networkLink).then(()=>m(()=>this.visible===!0)).then(()=>this.load())}load(e){var i;if(!this.networkLink||this.networkLink.viewFormat)return;const t=e!=null?e.signal:null,r=this._fetchService(((i=this._get("networkLink"))==null?void 0:i.href)??"",t).then(n=>{var c;const L=W(n.sublayers);this.fullExtent=d.fromJSON(L),this.sourceJSON=n;const f=F(b.ofType(p),w(p,n));this.sublayers?this.sublayers.addMany(f):this.sublayers=f,(c=this.layer)==null||c.emit("sublayer-update"),this.layer&&this.layer.notifyChange("visibleSublayers")});return this.addResolvingPromise(r),Promise.resolve(this)}get visible(){return this._get("visible")}set visible(e){this._get("visible")!==e&&(this._set("visible",e),this.layer&&this.layer.notifyChange("visibleSublayers"))}readVisible(e,t){return!!t.visibility}_fetchService(e,t){return x(e,this.layer.outSpatialReference,this.layer.refreshInterval,t).then(r=>E(r.data))}};s([l()],a.prototype,"description",void 0),s([l({type:d})],a.prototype,"fullExtent",void 0),s([l()],a.prototype,"id",void 0),s([l({readOnly:!0,value:null})],a.prototype,"networkLink",void 0),s([l({json:{write:{allowNull:!0}}})],a.prototype,"parent",void 0),s([l({type:b.ofType(a),json:{write:{allowNull:!0}}})],a.prototype,"sublayers",void 0),s([l({value:null,json:{read:{source:"name",reader:e=>j(e)}}})],a.prototype,"title",void 0),s([l({value:!0})],a.prototype,"visible",null),s([h("visible",["visibility"])],a.prototype,"readVisible",null),s([l()],a.prototype,"sourceJSON",void 0),s([l()],a.prototype,"layer",void 0),a=p=s([g("esri.layers.support.KMLSublayer")],a);const k=a,H=["kml","xml"];let o=class extends $(A(C(T(I(K(V)))))){constructor(...e){super(...e),this._visibleFolders=[],this.allSublayers=new P({getCollections:()=>[this.sublayers],getChildrenFunction:t=>t.sublayers}),this.outSpatialReference=S.WGS84,this.path=null,this.legendEnabled=!1,this.operationalLayerType="KML",this.sublayers=null,this.type="kml",this.url=null}initialize(){this.addHandles([y(()=>this.sublayers,(e,t)=>{t&&t.forEach(r=>{r.parent=null,r.layer=null}),e&&e.forEach(r=>{r.parent=this,r.layer=this})},u),this.on("sublayer-update",()=>this.notifyChange("fullExtent"))])}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}readSublayersFromItemOrWebMap(e,t){this._visibleFolders=t.visibleFolders}readSublayers(e,t,r){return w(k,t,r,this._visibleFolders)}writeSublayers(e,t){const r=[],i=e.toArray();for(;i.length;){const n=i[0];n.networkLink||(n.visible&&r.push(n.id),n.sublayers&&i.push(...n.sublayers.toArray())),i.shift()}t.visibleFolders=r}get title(){const e=this._get("title");return e&&this.originOf("title")!=="defaults"?e:this.url?R(this.url,H)||"KML":e||""}set title(e){this._set("title",e)}get visibleSublayers(){const e=this.sublayers,t=[],r=i=>{i.visible&&(t.push(i),i.sublayers&&i.sublayers.forEach(r))};return e&&e.forEach(r),t}get fullExtent(){return this._recomputeFullExtent()}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["KML"],supportsData:!1},e).catch(N).then(()=>this._fetchService(t))),Promise.resolve(this)}destroy(){super.destroy(),this.allSublayers.destroy()}async _fetchService(e){const t=await Promise.resolve().then(()=>this.resourceInfo?{ssl:!1,data:this.resourceInfo}:x(this.url??"",this.outSpatialReference,this.refreshInterval,e)),r=E(t.data);r&&this.read(r,{origin:"service"})}_recomputeFullExtent(){let e=null;this.extent!=null&&(e=this.extent.clone());const t=r=>{if(r.sublayers)for(const i of r.sublayers.items)t(i),i.visible&&i.fullExtent&&(e!=null?e.union(i.fullExtent):e=i.fullExtent.clone())};return t(this),e}};s([l({readOnly:!0})],o.prototype,"allSublayers",void 0),s([l({type:S})],o.prototype,"outSpatialReference",void 0),s([l({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],o.prototype,"path",void 0),s([l({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"legendEnabled",void 0),s([l({type:["show","hide","hide-children"]})],o.prototype,"listMode",void 0),s([l({type:["KML"]})],o.prototype,"operationalLayerType",void 0),s([l({})],o.prototype,"resourceInfo",void 0),s([l({type:b.ofType(k),json:{write:{ignoreOrigin:!0}}})],o.prototype,"sublayers",void 0),s([h(["web-map","portal-item"],"sublayers",["visibleFolders"])],o.prototype,"readSublayersFromItemOrWebMap",null),s([h("service","sublayers",["sublayers"])],o.prototype,"readSublayers",null),s([z("sublayers")],o.prototype,"writeSublayers",null),s([l({readOnly:!0,json:{read:!1}})],o.prototype,"type",void 0),s([l({json:{origins:{"web-map":{read:{source:"title"}}},write:{ignoreOrigin:!0}}})],o.prototype,"title",null),s([l(J)],o.prototype,"url",void 0),s([l({readOnly:!0})],o.prototype,"visibleSublayers",null),s([l({type:d})],o.prototype,"extent",void 0),s([l()],o.prototype,"fullExtent",null),o=s([g("esri.layers.KMLLayer")],o);const ye=o;export{ye as default}; diff --git a/assets/KMLLayerView2D-B307IWZ8.js b/assets/KMLLayerView2D-BTxXwgAN.js similarity index 81% rename from assets/KMLLayerView2D-B307IWZ8.js rename to assets/KMLLayerView2D-BTxXwgAN.js index 95c3bf0..5a3db9b 100644 --- a/assets/KMLLayerView2D-B307IWZ8.js +++ b/assets/KMLLayerView2D-BTxXwgAN.js @@ -1 +1 @@ -import{eA as G,bv as k,aA as T,D as U,v as z,U as O,eB as $,M as F,c as I,V as N,g as W,eC as H,u as S,aE as A,bu as K,aS as E,eD as J,eE as L,aW as Y,e0 as Q,d as v,y as C,f as X}from"./index-CEWggaxV.js";import{b as P,g as Z,d as tt}from"./kmlUtils-Dl7cXNEs.js";import{g as et,f as it,b as at}from"./Bitmap--gOrgR8J.js";import{a as st}from"./BitmapContainer-Bq0Mk6_k.js";import{m as rt,u as ot}from"./LayerView-BEFTHNYv.js";import{t as M}from"./GraphicContainer-CbvswCG0.js";import{$ as R}from"./GraphicsView2D-DbbthiwV.js";import{C as nt,e as lt}from"./rasterProjectionHelper-Bwvi37wQ.js";import{a as ht}from"./WGLContainer-B_Pv-8Yi.js";import{w as pt,o as mt}from"./RenderingContext-2weDpoeh.js";import{x as ct}from"./Program-DLRmaKpw.js";import{c as dt}from"./rasterUtils-Dgn5fnGK.js";import{e as q,m as ut}from"./Texture-DJgkMrSB.js";import"./jsonUtils-BseLl1fZ.js";import"./UniqueValueRenderer-BlkUix3g.js";import"./ColorStop-44hBlQ14.js";import"./diffUtils-B4YFa5Ju.js";import"./colorRamps-BJydlf0f.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-z2k12BH8.js";import"./jsonUtils-qYmXvGJ1.js";import"./styleUtils-CnV_Xzhi.js";import"./Version-Bd0QsIQ5.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./OverrideHelper-B4ryGWZb.js";import"./utils-p-5Bbga5.js";import"./quantizationUtils-CUjGHrU3.js";import"./heatmapUtils-Clt5rJzr.js";import"./FeatureSet-CYJUZgOk.js";import"./Container-CB7SlLB9.js";import"./highlightReasons-DbgbcWKM.js";import"./scaleUtils-Bqauo1zZ.js";import"./AGraphicContainer-Dby-baET.js";import"./TechniqueInstance-CSsTmbek.js";import"./UpdateTracking2D-nj9Q-3df.js";import"./TurboLine-CkxIB4ZX.js";import"./earcut-hRlx3adE.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./Rect-CUzevAry.js";import"./LabelMetric-D2hbzzy_.js";import"./labelUtils-Dnqx6jl5.js";import"./defaultsJSON-CHAaurhX.js";import"./BindType-BmZEZMMh.js";import"./Util-BS8sJGjF.js";import"./constants-D5zmR9t2.js";import"./TileContainer-Ci6dOowA.js";import"./FeatureCommandQueue-Btq_FXyi.js";import"./ProgramTemplate-BICQrNzS.js";import"./vec3f32-nZdmKIgz.js";import"./AttributeStore-Ck-75lnq.js";import"./TimeOnly-Cm47ew5I.js";import"./timeSupport-BjRbXIpn.js";import"./featureConversionUtils-CmP9mw0r.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./json-Wa8cmqdu.js";import"./normalizeUtilsSync-B6VufdiX.js";import"./config-MDUrh2eL.js";import"./webglDeps-BqalI_vm.js";import"./NestedMap-DgiGbX8E.js";import"./OrderIndependentTransparency-C747AfeB.js";import"./basicInterfaces-GbxEOYtk.js";import"./testSVGPremultipliedAlpha-B0ipOzbU.js";import"./floatRGBA-BLm-Rhaq.js";import"./doublePrecisionUtils-B0owpBza.js";class p{constructor(t){if(this._ownsRctx=!1,t)this._ownsRctx=!1,this._rctx=t;else{if(p._instance)return p._instanceRefCount++,p._instance;p._instanceRefCount=1,p._instance=this,this._ownsRctx=!0;const i=document.createElement("canvas"),a=G(i);a.getExtension("OES_texture_float"),this._rctx=new pt(a,{})}const s={applyProjection:!0,bilinear:!1,bicubic:!1},r=mt("raster/reproject","raster/reproject",new Map([["a_position",0]]),s);this._program=this._rctx.programCache.acquire(r.shaders.vertexShader,r.shaders.fragmentShader,r.attributes),this._rctx.useProgram(this._program),this._program.setUniform1f("u_opacity",1),this._program.setUniform1i("u_image",0),this._program.setUniform1i("u_flipY",0),this._program.setUniform1i("u_transformGrid",1),this._quad=new ht(this._rctx,[0,0,1,0,0,1,1,1])}reprojectTexture(t,s,r=!1){const i=k(t.extent,s),a=new T({x:(t.extent.xmax-t.extent.xmin)/t.texture.descriptor.width,y:(t.extent.ymax-t.extent.ymin)/t.texture.descriptor.height,spatialReference:t.extent.spatialReference}),{x:o,y:h}=nt(a,s,t.extent);let n=(o+h)/2;const l=Math.round((i.xmax-i.xmin)/n),u=Math.round((i.ymax-i.ymin)/n);n=(i.width/l+i.height/u)/2;const D=new T({x:n,y:n,spatialReference:i.spatialReference}),_=lt({projectedExtent:i,srcBufferExtent:t.extent,pixelSize:D,hasWrapAround:!0,spacing:[16,16]}),w=dt(this._rctx,_),y=new q(l,u);y.wrapMode=U.CLAMP_TO_EDGE;const m=new ct(this._rctx,y);this._rctx.bindFramebuffer(m),this._rctx.setViewport(0,0,l,u),this._rctx.useProgram(this._program),this._rctx.bindTexture(t.texture,0),this._rctx.bindTexture(w,1),this._quad.bind();const{width:x=0,height:f=0}=t.texture.descriptor;if(this._program.setUniform2f("u_srcImageSize",x,f),this._program.setUniform2fv("u_transformSpacing",_.spacing),this._program.setUniform2fv("u_transformGridSize",_.size),this._program.setUniform2f("u_targetImageSize",l,u),this._quad.draw(),this._quad.unbind(),this._rctx.useProgram(null),this._rctx.bindFramebuffer(null),w.dispose(),r){const{width:c,height:V}=m,g=new ImageData(c??0,V??0);m.readPixels(0,0,c??0,V??0,z.RGBA,O.UNSIGNED_BYTE,g.data);const B=m.detachColorTexture($.COLOR_ATTACHMENT0);return m.dispose(),{texture:B,extent:i,imageData:g}}const b=m.detachColorTexture($.COLOR_ATTACHMENT0);return m.dispose(),{texture:b,extent:i}}reprojectBitmapData(t,s){const r=et(t.bitmapData)?it(t.bitmapData):t.bitmapData,i=new q;i.wrapMode=U.CLAMP_TO_EDGE,i.width=t.bitmapData.width,i.height=t.bitmapData.height;const a=new ut(this._rctx,i,r),o=this.reprojectTexture({texture:a,extent:t.extent},s,!0);o.texture.dispose();const h=document.createElement("canvas"),n=o.imageData;return h.width=n.width,h.height=n.height,h.getContext("2d").putImageData(n,0,0),{bitmapData:h,extent:o.extent}}async loadAndReprojectBitmapData(t,s,r){const i=(await F(t,{responseType:"image"})).data,a=document.createElement("canvas");a.width=i.width,a.height=i.height;const o=a.getContext("2d");o.drawImage(i,0,0);const h=o.getImageData(0,0,a.width,a.height);if(s.spatialReference.equals(r))return{bitmapData:h,extent:s};const n=this.reprojectBitmapData({bitmapData:h,extent:s},r);return{bitmapData:n.bitmapData,extent:n.extent}}destroy(){this._ownsRctx?(p._instanceRefCount--,p._instanceRefCount===0&&(this._quad.dispose(),this._program.dispose(),this._rctx.dispose(),p._instance=null)):(this._quad.dispose(),this._program.dispose())}}p._instanceRefCount=0;class j{constructor(){this.allSublayers=new Map,this.allPoints=[],this.allPolylines=[],this.allPolygons=[],this.allMapImages=[]}}let d=class extends rt(ot){constructor(){super(...arguments),this._bitmapIndex=new Map,this._mapImageContainer=new st,this._kmlVisualData=new j,this._fetchController=null,this.allVisiblePoints=new I,this.allVisiblePolylines=new I,this.allVisiblePolygons=new I,this.allVisibleMapImages=new N}async hitTest(e,t){var r,i,a;const s=this.layer;return[(r=this._pointsView)==null?void 0:r.hitTest(e),(i=this._polylinesView)==null?void 0:i.hitTest(e),(a=this._polygonsView)==null?void 0:a.hitTest(e)].flat().filter(Boolean).map(o=>(o.layer=s,o.sourceLayer=s,{type:"graphic",graphic:o,layer:s,mapPoint:e}))}update(e){this._polygonsView&&this._polygonsView.processUpdate(e),this._polylinesView&&this._polylinesView.processUpdate(e),this._pointsView&&this._pointsView.processUpdate(e)}attach(){this._fetchController=new AbortController,this.container.addChild(this._mapImageContainer),this._polygonsView=new R({view:this.view,graphics:this.allVisiblePolygons,requestUpdateCallback:()=>this.requestUpdate(),container:new M(this.view.featuresTilingScheme)}),this.container.addChild(this._polygonsView.container),this._polylinesView=new R({view:this.view,graphics:this.allVisiblePolylines,requestUpdateCallback:()=>this.requestUpdate(),container:new M(this.view.featuresTilingScheme)}),this.container.addChild(this._polylinesView.container),this._pointsView=new R({view:this.view,graphics:this.allVisiblePoints,requestUpdateCallback:()=>this.requestUpdate(),container:new M(this.view.featuresTilingScheme)}),this.container.addChild(this._pointsView.container),this.addAttachHandles([this.allVisibleMapImages.on("change",e=>{e.added.forEach(t=>this._addMapImage(t)),e.removed.forEach(t=>this._removeMapImage(t))}),W(()=>this.layer.visibleSublayers,e=>{for(const[t,s]of this._kmlVisualData.allSublayers)s.visibility=0;for(const t of e){const s=this._kmlVisualData.allSublayers.get(t.id);s&&(s.visibility=1)}this._refreshCollections()})]),this._updatingHandles.addPromise(this._fetchService(this._fetchController.signal)),this._imageReprojector=new p}detach(){this._fetchController=H(this._fetchController),this._mapImageContainer.removeAllChildren(),this.container.removeAllChildren(),this._bitmapIndex.clear(),this._polygonsView=S(this._polygonsView),this._polylinesView=S(this._polylinesView),this._pointsView=S(this._pointsView),this._imageReprojector=S(this._imageReprojector)}moveStart(){}viewChange(){this._polygonsView.viewChange(),this._polylinesView.viewChange(),this._pointsView.viewChange()}moveEnd(){}isUpdating(){return this._pointsView.updating||this._polygonsView.updating||this._polylinesView.updating}_addMapImage(e){var t,s;((t=this.view.spatialReference)!=null&&t.isWGS84||(s=this.view.spatialReference)!=null&&s.isWebMercator)&&this._imageReprojector.loadAndReprojectBitmapData(e.href,A.fromJSON(e.extent),this.view.spatialReference).then(r=>{const i=new at(r.bitmapData);i.x=r.extent.xmin,i.y=r.extent.ymax,i.resolution=r.extent.width/r.bitmapData.width,i.rotation=e.rotation,this._mapImageContainer.addChild(i),this._bitmapIndex.set(e,i)})}async _getViewDependentUrl(e,t){const{viewFormat:s,viewBoundScale:r,httpQuery:i}=e;if(s!=null){if(t==null)throw new Error("Loading this network link requires a view state.");let a;if(await K(),r!=null&&r!==1){const c=new A(t.extent);c.expand(r),a=c}else a=t.extent;a=k(a,E.WGS84);const o=k(a,E.WebMercator),h=a.xmin,n=a.xmax,l=a.ymin,u=a.ymax,D=t.size[0]*t.pixelRatio,_=t.size[1]*t.pixelRatio,w=Math.max(o.width,o.height),y={"[bboxWest]":h.toString(),"[bboxEast]":n.toString(),"[bboxSouth]":l.toString(),"[bboxNorth]":u.toString(),"[lookatLon]":a.center.x.toString(),"[lookatLat]":a.center.y.toString(),"[lookatRange]":w.toString(),"[lookatTilt]":"0","[lookatHeading]":t.rotation.toString(),"[lookatTerrainLon]":a.center.x.toString(),"[lookatTerrainLat]":a.center.y.toString(),"[lookatTerrainAlt]":"0","[cameraLon]":a.center.x.toString(),"[cameraLat]":a.center.y.toString(),"[cameraAlt]":w.toString(),"[horizFov]":"60","[vertFov]":"60","[horizPixels]":D.toString(),"[vertPixels]":_.toString(),"[terrainEnabled]":"0","[clientVersion]":J,"[kmlVersion]":"2.2","[clientName]":"ArcGIS API for JavaScript","[language]":"en-US"},m=c=>{for(const V in c){let g;for(g in y)c[V]=c[V].replace(g,y[g])}},x=L(s);m(x);let f={};i!=null&&(f=L(i),m(f));const b=Y(e.href);return b.query={...b.query,...x,...f},`${b.path}?${Q(x)}`}return e.href}async _fetchService(e){const t=new j;await this._loadVisualData(this.layer.url,t,e),this._kmlVisualData=t,this._refreshCollections()}_refreshCollections(){this.allVisiblePoints.removeAll(),this.allVisiblePolylines.removeAll(),this.allVisiblePolygons.removeAll(),this.allVisibleMapImages.removeAll(),this.allVisiblePoints.addMany(this._kmlVisualData.allPoints.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e)),this.allVisiblePolylines.addMany(this._kmlVisualData.allPolylines.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e)),this.allVisiblePolygons.addMany(this._kmlVisualData.allPolygons.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e)),this.allVisibleMapImages.addMany(this._kmlVisualData.allMapImages.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e))}_isSublayerVisible(e){const t=this._kmlVisualData.allSublayers.get(e);return!!(t!=null&&t.visibility)&&(t.parentFolderId===-1||this._isSublayerVisible(t.parentFolderId))}_loadVisualData(e,t,s){return this._fetchParsedKML(e,s).then(async r=>{for(const i of r.sublayers){t.allSublayers.set(i.id,i);const a=i.points?await P(i.points):[],o=i.polylines?await P(i.polylines):[],h=i.polygons?await P(i.polygons):[],n=i.mapImages||[];if(t.allPoints.push(...a.map(l=>({item:l,sublayerId:i.id}))),t.allPolylines.push(...o.map(l=>({item:l,sublayerId:i.id}))),t.allPolygons.push(...h.map(l=>({item:l,sublayerId:i.id}))),t.allMapImages.push(...n.map(l=>({item:l,sublayerId:i.id}))),i.networkLink){const l=await this._getViewDependentUrl(i.networkLink,this.view.state);await this._loadVisualData(l,t,s)}}})}_fetchParsedKML(e,t){return Z(e,this.layer.spatialReference,this.layer.refreshInterval,t).then(s=>tt(s.data))}_removeMapImage(e){const t=this._bitmapIndex.get(e);t&&(this._mapImageContainer.removeChild(t),this._bitmapIndex.delete(e))}};v([C()],d.prototype,"_pointsView",void 0),v([C()],d.prototype,"_polylinesView",void 0),v([C()],d.prototype,"_polygonsView",void 0),v([C()],d.prototype,"updating",void 0),d=v([X("esri.views.2d.layers.KMLLayerView2D")],d);const De=d;export{De as default}; +import{eA as G,bv as k,aA as T,D as U,v as z,U as O,eB as $,M as F,c as I,V as N,g as W,eC as H,u as S,aE as A,bu as K,aS as E,eD as J,eE as L,aW as Y,e0 as Q,d as v,y as C,f as X}from"./index-BjUNJPVf.js";import{b as P,g as Z,d as tt}from"./kmlUtils-C6tn6hG1.js";import{g as et,f as it,b as at}from"./Bitmap-DpyomsG7.js";import{a as st}from"./BitmapContainer-DD7rxH0u.js";import{m as rt,u as ot}from"./LayerView-Bux7vAEn.js";import{t as M}from"./GraphicContainer-Bue3JF2r.js";import{$ as R}from"./GraphicsView2D-B7H8XAnI.js";import{C as nt,e as lt}from"./rasterProjectionHelper-CHkyWbma.js";import{a as ht}from"./WGLContainer-DgZNq7b0.js";import{w as pt,o as mt}from"./RenderingContext-vSxDymNY.js";import{x as ct}from"./Program-DBsYtQ00.js";import{c as dt}from"./rasterUtils-DEPcL5Ca.js";import{e as q,m as ut}from"./Texture-S4dD-WHn.js";import"./jsonUtils-Dw332y6z.js";import"./UniqueValueRenderer-7V9Bhr-D.js";import"./ColorStop-DCGjAKLC.js";import"./diffUtils-uUoMDFQS.js";import"./colorRamps-CcakIWlU.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-BX9G5gNQ.js";import"./jsonUtils-Ox5U0P0F.js";import"./styleUtils-DOUOskVZ.js";import"./Version-Dqq_CHBG.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./OverrideHelper-DxFZBnGL.js";import"./utils-CuXO_Zzq.js";import"./quantizationUtils-CfV316jZ.js";import"./heatmapUtils-BSteZBTj.js";import"./FeatureSet-opEn8ou8.js";import"./Container-_n5wCgez.js";import"./highlightReasons-BOU4mnPE.js";import"./scaleUtils-DWXMiS7R.js";import"./AGraphicContainer-BXk7Eu6w.js";import"./TechniqueInstance-XtnK2qy2.js";import"./UpdateTracking2D-Ds_Gdrxd.js";import"./TurboLine-DNQdPIXo.js";import"./earcut-CWKXDqDj.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./Rect-CUzevAry.js";import"./LabelMetric-BcUxDImF.js";import"./labelUtils-3p0-m-Ee.js";import"./defaultsJSON-CHAaurhX.js";import"./BindType-BmZEZMMh.js";import"./Util-CS5u4Lec.js";import"./constants-D5zmR9t2.js";import"./TileContainer-Bs-vXdD_.js";import"./FeatureCommandQueue-DI81F3gA.js";import"./ProgramTemplate-Ck2I0bIi.js";import"./vec3f32-nZdmKIgz.js";import"./AttributeStore-Bm6hLtR1.js";import"./TimeOnly-BXSODLxA.js";import"./timeSupport-DXkhlToK.js";import"./featureConversionUtils-BHhm7bvm.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./json-Wa8cmqdu.js";import"./normalizeUtilsSync-73yZ0QwV.js";import"./config-MDUrh2eL.js";import"./webglDeps-Cjw3mzdd.js";import"./NestedMap-DgiGbX8E.js";import"./OrderIndependentTransparency-Btph8gYx.js";import"./basicInterfaces-GbxEOYtk.js";import"./testSVGPremultipliedAlpha-BUMQhQ4O.js";import"./floatRGBA-Cs54GdjG.js";import"./doublePrecisionUtils-B0owpBza.js";class p{constructor(t){if(this._ownsRctx=!1,t)this._ownsRctx=!1,this._rctx=t;else{if(p._instance)return p._instanceRefCount++,p._instance;p._instanceRefCount=1,p._instance=this,this._ownsRctx=!0;const i=document.createElement("canvas"),a=G(i);a.getExtension("OES_texture_float"),this._rctx=new pt(a,{})}const s={applyProjection:!0,bilinear:!1,bicubic:!1},r=mt("raster/reproject","raster/reproject",new Map([["a_position",0]]),s);this._program=this._rctx.programCache.acquire(r.shaders.vertexShader,r.shaders.fragmentShader,r.attributes),this._rctx.useProgram(this._program),this._program.setUniform1f("u_opacity",1),this._program.setUniform1i("u_image",0),this._program.setUniform1i("u_flipY",0),this._program.setUniform1i("u_transformGrid",1),this._quad=new ht(this._rctx,[0,0,1,0,0,1,1,1])}reprojectTexture(t,s,r=!1){const i=k(t.extent,s),a=new T({x:(t.extent.xmax-t.extent.xmin)/t.texture.descriptor.width,y:(t.extent.ymax-t.extent.ymin)/t.texture.descriptor.height,spatialReference:t.extent.spatialReference}),{x:o,y:h}=nt(a,s,t.extent);let n=(o+h)/2;const l=Math.round((i.xmax-i.xmin)/n),u=Math.round((i.ymax-i.ymin)/n);n=(i.width/l+i.height/u)/2;const D=new T({x:n,y:n,spatialReference:i.spatialReference}),_=lt({projectedExtent:i,srcBufferExtent:t.extent,pixelSize:D,hasWrapAround:!0,spacing:[16,16]}),w=dt(this._rctx,_),y=new q(l,u);y.wrapMode=U.CLAMP_TO_EDGE;const m=new ct(this._rctx,y);this._rctx.bindFramebuffer(m),this._rctx.setViewport(0,0,l,u),this._rctx.useProgram(this._program),this._rctx.bindTexture(t.texture,0),this._rctx.bindTexture(w,1),this._quad.bind();const{width:x=0,height:f=0}=t.texture.descriptor;if(this._program.setUniform2f("u_srcImageSize",x,f),this._program.setUniform2fv("u_transformSpacing",_.spacing),this._program.setUniform2fv("u_transformGridSize",_.size),this._program.setUniform2f("u_targetImageSize",l,u),this._quad.draw(),this._quad.unbind(),this._rctx.useProgram(null),this._rctx.bindFramebuffer(null),w.dispose(),r){const{width:c,height:V}=m,g=new ImageData(c??0,V??0);m.readPixels(0,0,c??0,V??0,z.RGBA,O.UNSIGNED_BYTE,g.data);const B=m.detachColorTexture($.COLOR_ATTACHMENT0);return m.dispose(),{texture:B,extent:i,imageData:g}}const b=m.detachColorTexture($.COLOR_ATTACHMENT0);return m.dispose(),{texture:b,extent:i}}reprojectBitmapData(t,s){const r=et(t.bitmapData)?it(t.bitmapData):t.bitmapData,i=new q;i.wrapMode=U.CLAMP_TO_EDGE,i.width=t.bitmapData.width,i.height=t.bitmapData.height;const a=new ut(this._rctx,i,r),o=this.reprojectTexture({texture:a,extent:t.extent},s,!0);o.texture.dispose();const h=document.createElement("canvas"),n=o.imageData;return h.width=n.width,h.height=n.height,h.getContext("2d").putImageData(n,0,0),{bitmapData:h,extent:o.extent}}async loadAndReprojectBitmapData(t,s,r){const i=(await F(t,{responseType:"image"})).data,a=document.createElement("canvas");a.width=i.width,a.height=i.height;const o=a.getContext("2d");o.drawImage(i,0,0);const h=o.getImageData(0,0,a.width,a.height);if(s.spatialReference.equals(r))return{bitmapData:h,extent:s};const n=this.reprojectBitmapData({bitmapData:h,extent:s},r);return{bitmapData:n.bitmapData,extent:n.extent}}destroy(){this._ownsRctx?(p._instanceRefCount--,p._instanceRefCount===0&&(this._quad.dispose(),this._program.dispose(),this._rctx.dispose(),p._instance=null)):(this._quad.dispose(),this._program.dispose())}}p._instanceRefCount=0;class j{constructor(){this.allSublayers=new Map,this.allPoints=[],this.allPolylines=[],this.allPolygons=[],this.allMapImages=[]}}let d=class extends rt(ot){constructor(){super(...arguments),this._bitmapIndex=new Map,this._mapImageContainer=new st,this._kmlVisualData=new j,this._fetchController=null,this.allVisiblePoints=new I,this.allVisiblePolylines=new I,this.allVisiblePolygons=new I,this.allVisibleMapImages=new N}async hitTest(e,t){var r,i,a;const s=this.layer;return[(r=this._pointsView)==null?void 0:r.hitTest(e),(i=this._polylinesView)==null?void 0:i.hitTest(e),(a=this._polygonsView)==null?void 0:a.hitTest(e)].flat().filter(Boolean).map(o=>(o.layer=s,o.sourceLayer=s,{type:"graphic",graphic:o,layer:s,mapPoint:e}))}update(e){this._polygonsView&&this._polygonsView.processUpdate(e),this._polylinesView&&this._polylinesView.processUpdate(e),this._pointsView&&this._pointsView.processUpdate(e)}attach(){this._fetchController=new AbortController,this.container.addChild(this._mapImageContainer),this._polygonsView=new R({view:this.view,graphics:this.allVisiblePolygons,requestUpdateCallback:()=>this.requestUpdate(),container:new M(this.view.featuresTilingScheme)}),this.container.addChild(this._polygonsView.container),this._polylinesView=new R({view:this.view,graphics:this.allVisiblePolylines,requestUpdateCallback:()=>this.requestUpdate(),container:new M(this.view.featuresTilingScheme)}),this.container.addChild(this._polylinesView.container),this._pointsView=new R({view:this.view,graphics:this.allVisiblePoints,requestUpdateCallback:()=>this.requestUpdate(),container:new M(this.view.featuresTilingScheme)}),this.container.addChild(this._pointsView.container),this.addAttachHandles([this.allVisibleMapImages.on("change",e=>{e.added.forEach(t=>this._addMapImage(t)),e.removed.forEach(t=>this._removeMapImage(t))}),W(()=>this.layer.visibleSublayers,e=>{for(const[t,s]of this._kmlVisualData.allSublayers)s.visibility=0;for(const t of e){const s=this._kmlVisualData.allSublayers.get(t.id);s&&(s.visibility=1)}this._refreshCollections()})]),this._updatingHandles.addPromise(this._fetchService(this._fetchController.signal)),this._imageReprojector=new p}detach(){this._fetchController=H(this._fetchController),this._mapImageContainer.removeAllChildren(),this.container.removeAllChildren(),this._bitmapIndex.clear(),this._polygonsView=S(this._polygonsView),this._polylinesView=S(this._polylinesView),this._pointsView=S(this._pointsView),this._imageReprojector=S(this._imageReprojector)}moveStart(){}viewChange(){this._polygonsView.viewChange(),this._polylinesView.viewChange(),this._pointsView.viewChange()}moveEnd(){}isUpdating(){return this._pointsView.updating||this._polygonsView.updating||this._polylinesView.updating}_addMapImage(e){var t,s;((t=this.view.spatialReference)!=null&&t.isWGS84||(s=this.view.spatialReference)!=null&&s.isWebMercator)&&this._imageReprojector.loadAndReprojectBitmapData(e.href,A.fromJSON(e.extent),this.view.spatialReference).then(r=>{const i=new at(r.bitmapData);i.x=r.extent.xmin,i.y=r.extent.ymax,i.resolution=r.extent.width/r.bitmapData.width,i.rotation=e.rotation,this._mapImageContainer.addChild(i),this._bitmapIndex.set(e,i)})}async _getViewDependentUrl(e,t){const{viewFormat:s,viewBoundScale:r,httpQuery:i}=e;if(s!=null){if(t==null)throw new Error("Loading this network link requires a view state.");let a;if(await K(),r!=null&&r!==1){const c=new A(t.extent);c.expand(r),a=c}else a=t.extent;a=k(a,E.WGS84);const o=k(a,E.WebMercator),h=a.xmin,n=a.xmax,l=a.ymin,u=a.ymax,D=t.size[0]*t.pixelRatio,_=t.size[1]*t.pixelRatio,w=Math.max(o.width,o.height),y={"[bboxWest]":h.toString(),"[bboxEast]":n.toString(),"[bboxSouth]":l.toString(),"[bboxNorth]":u.toString(),"[lookatLon]":a.center.x.toString(),"[lookatLat]":a.center.y.toString(),"[lookatRange]":w.toString(),"[lookatTilt]":"0","[lookatHeading]":t.rotation.toString(),"[lookatTerrainLon]":a.center.x.toString(),"[lookatTerrainLat]":a.center.y.toString(),"[lookatTerrainAlt]":"0","[cameraLon]":a.center.x.toString(),"[cameraLat]":a.center.y.toString(),"[cameraAlt]":w.toString(),"[horizFov]":"60","[vertFov]":"60","[horizPixels]":D.toString(),"[vertPixels]":_.toString(),"[terrainEnabled]":"0","[clientVersion]":J,"[kmlVersion]":"2.2","[clientName]":"ArcGIS API for JavaScript","[language]":"en-US"},m=c=>{for(const V in c){let g;for(g in y)c[V]=c[V].replace(g,y[g])}},x=L(s);m(x);let f={};i!=null&&(f=L(i),m(f));const b=Y(e.href);return b.query={...b.query,...x,...f},`${b.path}?${Q(x)}`}return e.href}async _fetchService(e){const t=new j;await this._loadVisualData(this.layer.url,t,e),this._kmlVisualData=t,this._refreshCollections()}_refreshCollections(){this.allVisiblePoints.removeAll(),this.allVisiblePolylines.removeAll(),this.allVisiblePolygons.removeAll(),this.allVisibleMapImages.removeAll(),this.allVisiblePoints.addMany(this._kmlVisualData.allPoints.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e)),this.allVisiblePolylines.addMany(this._kmlVisualData.allPolylines.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e)),this.allVisiblePolygons.addMany(this._kmlVisualData.allPolygons.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e)),this.allVisibleMapImages.addMany(this._kmlVisualData.allMapImages.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e))}_isSublayerVisible(e){const t=this._kmlVisualData.allSublayers.get(e);return!!(t!=null&&t.visibility)&&(t.parentFolderId===-1||this._isSublayerVisible(t.parentFolderId))}_loadVisualData(e,t,s){return this._fetchParsedKML(e,s).then(async r=>{for(const i of r.sublayers){t.allSublayers.set(i.id,i);const a=i.points?await P(i.points):[],o=i.polylines?await P(i.polylines):[],h=i.polygons?await P(i.polygons):[],n=i.mapImages||[];if(t.allPoints.push(...a.map(l=>({item:l,sublayerId:i.id}))),t.allPolylines.push(...o.map(l=>({item:l,sublayerId:i.id}))),t.allPolygons.push(...h.map(l=>({item:l,sublayerId:i.id}))),t.allMapImages.push(...n.map(l=>({item:l,sublayerId:i.id}))),i.networkLink){const l=await this._getViewDependentUrl(i.networkLink,this.view.state);await this._loadVisualData(l,t,s)}}})}_fetchParsedKML(e,t){return Z(e,this.layer.spatialReference,this.layer.refreshInterval,t).then(s=>tt(s.data))}_removeMapImage(e){const t=this._bitmapIndex.get(e);t&&(this._mapImageContainer.removeChild(t),this._bitmapIndex.delete(e))}};v([C()],d.prototype,"_pointsView",void 0),v([C()],d.prototype,"_polylinesView",void 0),v([C()],d.prototype,"_polygonsView",void 0),v([C()],d.prototype,"updating",void 0),d=v([X("esri.views.2d.layers.KMLLayerView2D")],d);const De=d;export{De as default}; diff --git a/assets/KnowledgeGraphLayerView2D-CuM0qoPc.js b/assets/KnowledgeGraphLayerView2D-DZm8ubx6.js similarity index 76% rename from assets/KnowledgeGraphLayerView2D-CuM0qoPc.js rename to assets/KnowledgeGraphLayerView2D-DZm8ubx6.js index a229970..06328c4 100644 --- a/assets/KnowledgeGraphLayerView2D-CuM0qoPc.js +++ b/assets/KnowledgeGraphLayerView2D-DZm8ubx6.js @@ -1 +1 @@ -import{V as i,w as n,d as s,y as a,x as l,f as o}from"./index-CEWggaxV.js";import{m as h,u as d}from"./LayerView-BEFTHNYv.js";import"./scaleUtils-Bqauo1zZ.js";import"./Container-CB7SlLB9.js";import"./highlightReasons-DbgbcWKM.js";import"./Texture-DJgkMrSB.js";let t=class extends h(d){constructor(e){super(e),this.layerViews=new i}set layerViews(e){this._set("layerViews",n(e,this._get("layerViews")))}get updatingProgress(){return this.layerViews.length===0?1:this.layerViews.reduce((e,r)=>e+r.updatingProgress,0)/this.layerViews.length}attach(){this._updateStageChildren(),this.addAttachHandles(this.layerViews.on("after-changes",()=>this._updateStageChildren()))}detach(){this.container.removeAllChildren()}update(e){}moveStart(){}viewChange(){}moveEnd(){}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((e,r)=>this.container.addChildAt(e.container,r))}};s([a({cast:l})],t.prototype,"layerViews",null),s([a({readOnly:!0})],t.prototype,"updatingProgress",null),t=s([o("esri.views.2d.layers.KnowledgeGraphLayerView2D")],t);const m=t;export{m as default}; +import{V as i,w as n,d as s,y as a,x as l,f as o}from"./index-BjUNJPVf.js";import{m as h,u as d}from"./LayerView-Bux7vAEn.js";import"./scaleUtils-DWXMiS7R.js";import"./Container-_n5wCgez.js";import"./highlightReasons-BOU4mnPE.js";import"./Texture-S4dD-WHn.js";let t=class extends h(d){constructor(e){super(e),this.layerViews=new i}set layerViews(e){this._set("layerViews",n(e,this._get("layerViews")))}get updatingProgress(){return this.layerViews.length===0?1:this.layerViews.reduce((e,r)=>e+r.updatingProgress,0)/this.layerViews.length}attach(){this._updateStageChildren(),this.addAttachHandles(this.layerViews.on("after-changes",()=>this._updateStageChildren()))}detach(){this.container.removeAllChildren()}update(e){}moveStart(){}viewChange(){}moveEnd(){}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((e,r)=>this.container.addChildAt(e.container,r))}};s([a({cast:l})],t.prototype,"layerViews",null),s([a({readOnly:!0})],t.prototype,"updatingProgress",null),t=s([o("esri.views.2d.layers.KnowledgeGraphLayerView2D")],t);const m=t;export{m as default}; diff --git a/assets/LabelClass-6cZokw8y.js b/assets/LabelClass-CeatfK8u.js similarity index 98% rename from assets/LabelClass-6cZokw8y.js rename to assets/LabelClass-CeatfK8u.js index 1341a8d..f77cb6e 100644 --- a/assets/LabelClass-6cZokw8y.js +++ b/assets/LabelClass-CeatfK8u.js @@ -1 +1 @@ -import{d as n,y as o,aZ as d,aR as c,f as x,aU as S,aY as E,f0 as A,f1 as j,f2 as C,f3 as I,aV as y}from"./index-CEWggaxV.js";import{w as h,a as B,u as N,_ as O,x as V,f as M,g as $}from"./labelUtils-Dnqx6jl5.js";import{i as f}from"./jsonUtils-qYmXvGJ1.js";var v;let a=v=class extends S{constructor(){super(...arguments),this.expression=null,this.title=null,this.value=null}readExpression(e,r){return r.value?h(r.value):e}writeExpression(e,r,t){this.value!=null&&(e=h(this.value)),e!=null&&(r[t]=e)}clone(){return new v({expression:this.expression,title:this.title,value:this.value})}};n([o({type:String,json:{write:{writerEnsuresNonNull:!0}}})],a.prototype,"expression",void 0),n([d("expression",["expression","value"])],a.prototype,"readExpression",null),n([c("expression")],a.prototype,"writeExpression",null),n([o({type:String,json:{write:!0,origins:{"web-scene":{write:!1}}}})],a.prototype,"title",void 0),n([o({json:{read:!1,write:!1}})],a.prototype,"value",void 0),a=v=n([x("esri.layers.support.LabelExpressionInfo")],a);const P=a;var w;const u=new E({esriServerPointLabelPlacementAboveCenter:"above-center",esriServerPointLabelPlacementAboveLeft:"above-left",esriServerPointLabelPlacementAboveRight:"above-right",esriServerPointLabelPlacementBelowCenter:"below-center",esriServerPointLabelPlacementBelowLeft:"below-left",esriServerPointLabelPlacementBelowRight:"below-right",esriServerPointLabelPlacementCenterCenter:"center-center",esriServerPointLabelPlacementCenterLeft:"center-left",esriServerPointLabelPlacementCenterRight:"center-right",esriServerLinePlacementAboveAfter:"above-after",esriServerLinePlacementAboveAlong:"above-along",esriServerLinePlacementAboveBefore:"above-before",esriServerLinePlacementAboveStart:"above-start",esriServerLinePlacementAboveEnd:"above-end",esriServerLinePlacementBelowAfter:"below-after",esriServerLinePlacementBelowAlong:"below-along",esriServerLinePlacementBelowBefore:"below-before",esriServerLinePlacementBelowStart:"below-start",esriServerLinePlacementBelowEnd:"below-end",esriServerLinePlacementCenterAfter:"center-after",esriServerLinePlacementCenterAlong:"center-along",esriServerLinePlacementCenterBefore:"center-before",esriServerLinePlacementCenterStart:"center-start",esriServerLinePlacementCenterEnd:"center-end",esriServerPolygonPlacementAlwaysHorizontal:"always-horizontal"},{ignoreUnknown:!0});function b(e,r,t){return{enabled:!I(t==null?void 0:t.layer)}}function g(e){var r;return!e||e.origin!=="service"&&((r=e.layer)==null?void 0:r.type)!=="map-image"}function D(e){return(e==null?void 0:e.type)==="map-image"}function L(e){var r,t;return!!D(e)&&!!((t=(r=e.capabilities)==null?void 0:r.exportMap)!=null&&t.supportsArcadeExpressionForLabeling)}function R(e){return g(e)||L(e==null?void 0:e.layer)}let l=w=class extends S{static evaluateWhere(e,r){const t=(i,p,s)=>{switch(p){case"=":return i==s;case"<>":return i!=s;case">":return i>s;case">=":return i>=s;case"<":return iR(t)?{allowNull:!0}:{enabled:!1}}}})],l.prototype,"labelExpressionInfo",void 0),n([c("labelExpressionInfo")],l.prototype,"writeLabelExpressionInfo",null),n([o({type:u.apiValues,json:{type:u.jsonValues,read:u.read,write:u.write}})],l.prototype,"labelPlacement",void 0),n([o({type:["curved","parallel"],json:{write:!0,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],l.prototype,"labelPosition",void 0),n([o({type:Number})],l.prototype,"maxScale",void 0),n([c("maxScale")],l.prototype,"writeMaxScale",null),n([o({type:Number})],l.prototype,"minScale",void 0),n([c("minScale")],l.prototype,"writeMinScale",null),n([o({type:Boolean,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:b}}}}})],l.prototype,"repeatLabel",void 0),n([o({type:Number,cast:A,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:b}}}}})],l.prototype,"repeatLabelDistance",void 0),n([o({types:j,json:{origins:{"web-scene":{types:C,write:f,default:null}},write:f,default:null}})],l.prototype,"symbol",void 0),n([o({type:Boolean,json:{write:!0}})],l.prototype,"useCodedValues",void 0),n([o({type:String,json:{write:!0}})],l.prototype,"where",void 0),l=w=n([x("esri.layers.support.LabelClass")],l);const U=l;export{U as C}; +import{d as n,y as o,aZ as d,aR as c,f as x,aU as S,aY as E,f0 as A,f1 as j,f2 as C,f3 as I,aV as y}from"./index-BjUNJPVf.js";import{w as h,a as B,u as N,_ as O,x as V,f as M,g as $}from"./labelUtils-3p0-m-Ee.js";import{i as f}from"./jsonUtils-Ox5U0P0F.js";var v;let a=v=class extends S{constructor(){super(...arguments),this.expression=null,this.title=null,this.value=null}readExpression(e,r){return r.value?h(r.value):e}writeExpression(e,r,t){this.value!=null&&(e=h(this.value)),e!=null&&(r[t]=e)}clone(){return new v({expression:this.expression,title:this.title,value:this.value})}};n([o({type:String,json:{write:{writerEnsuresNonNull:!0}}})],a.prototype,"expression",void 0),n([d("expression",["expression","value"])],a.prototype,"readExpression",null),n([c("expression")],a.prototype,"writeExpression",null),n([o({type:String,json:{write:!0,origins:{"web-scene":{write:!1}}}})],a.prototype,"title",void 0),n([o({json:{read:!1,write:!1}})],a.prototype,"value",void 0),a=v=n([x("esri.layers.support.LabelExpressionInfo")],a);const P=a;var w;const u=new E({esriServerPointLabelPlacementAboveCenter:"above-center",esriServerPointLabelPlacementAboveLeft:"above-left",esriServerPointLabelPlacementAboveRight:"above-right",esriServerPointLabelPlacementBelowCenter:"below-center",esriServerPointLabelPlacementBelowLeft:"below-left",esriServerPointLabelPlacementBelowRight:"below-right",esriServerPointLabelPlacementCenterCenter:"center-center",esriServerPointLabelPlacementCenterLeft:"center-left",esriServerPointLabelPlacementCenterRight:"center-right",esriServerLinePlacementAboveAfter:"above-after",esriServerLinePlacementAboveAlong:"above-along",esriServerLinePlacementAboveBefore:"above-before",esriServerLinePlacementAboveStart:"above-start",esriServerLinePlacementAboveEnd:"above-end",esriServerLinePlacementBelowAfter:"below-after",esriServerLinePlacementBelowAlong:"below-along",esriServerLinePlacementBelowBefore:"below-before",esriServerLinePlacementBelowStart:"below-start",esriServerLinePlacementBelowEnd:"below-end",esriServerLinePlacementCenterAfter:"center-after",esriServerLinePlacementCenterAlong:"center-along",esriServerLinePlacementCenterBefore:"center-before",esriServerLinePlacementCenterStart:"center-start",esriServerLinePlacementCenterEnd:"center-end",esriServerPolygonPlacementAlwaysHorizontal:"always-horizontal"},{ignoreUnknown:!0});function b(e,r,t){return{enabled:!I(t==null?void 0:t.layer)}}function g(e){var r;return!e||e.origin!=="service"&&((r=e.layer)==null?void 0:r.type)!=="map-image"}function D(e){return(e==null?void 0:e.type)==="map-image"}function L(e){var r,t;return!!D(e)&&!!((t=(r=e.capabilities)==null?void 0:r.exportMap)!=null&&t.supportsArcadeExpressionForLabeling)}function R(e){return g(e)||L(e==null?void 0:e.layer)}let l=w=class extends S{static evaluateWhere(e,r){const t=(i,p,s)=>{switch(p){case"=":return i==s;case"<>":return i!=s;case">":return i>s;case">=":return i>=s;case"<":return iR(t)?{allowNull:!0}:{enabled:!1}}}})],l.prototype,"labelExpressionInfo",void 0),n([c("labelExpressionInfo")],l.prototype,"writeLabelExpressionInfo",null),n([o({type:u.apiValues,json:{type:u.jsonValues,read:u.read,write:u.write}})],l.prototype,"labelPlacement",void 0),n([o({type:["curved","parallel"],json:{write:!0,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],l.prototype,"labelPosition",void 0),n([o({type:Number})],l.prototype,"maxScale",void 0),n([c("maxScale")],l.prototype,"writeMaxScale",null),n([o({type:Number})],l.prototype,"minScale",void 0),n([c("minScale")],l.prototype,"writeMinScale",null),n([o({type:Boolean,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:b}}}}})],l.prototype,"repeatLabel",void 0),n([o({type:Number,cast:A,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:b}}}}})],l.prototype,"repeatLabelDistance",void 0),n([o({types:j,json:{origins:{"web-scene":{types:C,write:f,default:null}},write:f,default:null}})],l.prototype,"symbol",void 0),n([o({type:Boolean,json:{write:!0}})],l.prototype,"useCodedValues",void 0),n([o({type:String,json:{write:!0}})],l.prototype,"where",void 0),l=w=n([x("esri.layers.support.LabelClass")],l);const U=l;export{U as C}; diff --git a/assets/LabelMetric-D2hbzzy_.js b/assets/LabelMetric-BcUxDImF.js similarity index 98% rename from assets/LabelMetric-D2hbzzy_.js rename to assets/LabelMetric-BcUxDImF.js index 7dd6bb3..4c67995 100644 --- a/assets/LabelMetric-D2hbzzy_.js +++ b/assets/LabelMetric-BcUxDImF.js @@ -1 +1 @@ -import{iU as _,eJ as N,iV as U,g5 as h,N as g,U as u,s as b,iv as A}from"./index-CEWggaxV.js";import{s as Y,e as B,m as L}from"./Texture-DJgkMrSB.js";import"./Program-DLRmaKpw.js";let m=class E{constructor(t,r,e,i,n,a,o){this.instanceId=t,this.textureKey=r,this.indexStart=e,this.indexCount=i,this.vertexStart=n,this.vertexCount=a,this.overlaps=o}updateBaseOffsets(t){this.vertexStart+=t.vertexFrom,this.indexStart+=t.indexFrom}clone(){return new E(this.instanceId,this.textureKey,this.indexStart,this.indexCount,this.vertexStart,this.vertexCount,this.overlaps)}static write(t,r,e,i,n,a,o,c){t.push(r),t.push(e),t.push(i),t.push(n),t.push(a),t.push(o),t.push(c)}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(t){const r=t.readInt32(),e=t.readInt32(),i=t.readInt32(),n=t.readInt32(),a=t.readInt32(),o=t.readInt32(),c=t.readInt32();return new E(r,e,i,n,a,o,c)}};m.byteSizeHint=7*Uint32Array.BYTES_PER_ELEMENT;function T(s,t){if(t!==null){s.push(t.length);for(const r of t)r.serialize(s);return s}s.push(0)}function I(s,t,r){const e=s.readInt32(),i=new Array(e);for(let n=0;n`${r}.${e}.${i}`).join(",");return _(t)}function f(s,t,r,e,i,n,a){if(s.primitiveName===t){for(const o in s)if(o===r){let c=e==null?void 0:e.readWithDefault(i,n,s[o]&&a);return s.type==="text"&&(c=c.toString()),void(s[o]=c)}}if("type"in s&&s.type!=null)switch(s.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(s.symbolLayers)for(const o of s.symbolLayers)f(o,t,r,e,i,n,a);break;case"CIMHatchFill":s.lineSymbol&&f(s.lineSymbol,t,r,e,i,n,a);break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if(s.type==="CIMVectorMarker"&&s.markerGraphics)for(const o of s.markerGraphics)f(o,t,r,e,i,n,a),f(o.symbol,t,r,e,i,n,a)}}function D(s){const t=s.width;return s.effects!=null?256:Math.max(1.25*t,8)}class l{constructor(t,r,e,i){this.computedX=0,this.computedY=0,this.center=N(t,r),this.centerT=U(),this.halfWidth=e/2,this.halfHeight=i/2,this.width=e,this.height=i}get x(){return this.center[0]}get y(){return this.center[1]}get blX(){return this.center[0]+this.halfWidth}get blY(){return this.center[1]+this.halfHeight}get trX(){return this.center[0]-this.halfWidth}get trY(){return this.center[1]-this.halfHeight}get xmin(){return this.x-this.halfWidth}get xmax(){return this.x+this.halfWidth}get ymin(){return this.y-this.halfHeight}get ymax(){return this.y+this.halfHeight}set x(t){this.center[0]=t}set y(t){this.center[1]=t}clone(){return new l(this.x,this.y,this.width,this.height)}serialize(t){return t.writeF32(this.center[0]),t.writeF32(this.center[1]),t.push(this.width),t.push(this.height),t}findCollisionDelta(t,r=4){const e=Math.abs(t.centerT[0]-this.centerT[0]),i=Math.abs(t.centerT[1]-this.centerT[1]),n=(t.halfWidth+this.halfWidth+r)/e,a=(t.halfHeight+this.halfHeight+r)/i,o=Math.min(n,a);return Math.log2(o)}extend(t){const r=Math.min(this.xmin,t.xmin),e=Math.min(this.ymin,t.ymin),i=Math.max(this.xmax,t.xmax)-r,n=Math.max(this.ymax,t.ymax)-e,a=r+i/2,o=e+n/2;this.width=i,this.height=n,this.halfWidth=i/2,this.halfHeight=n/2,this.x=a,this.y=o}static deserialize(t){const r=t.readF32(),e=t.readF32(),i=t.readInt32(),n=t.readInt32();return new l(r,e,i,n)}}const R=new Float32Array(1);new Uint32Array(R.buffer);function G(s,t){return 65535&s|t<<16}function $(s,t,r,e){const i=r.packPrecisionFactor??1;switch(r.type){case h.BYTE:if(r.count===1)s.setInt8(e+r.offset,t*i);else for(let n=0;nb.getLogger("esri.views.2d.engine.webgl.Utils");function X(s){switch(s){case u.UNSIGNED_BYTE:return 1;case u.UNSIGNED_SHORT_4_4_4_4:return 2;case u.FLOAT:return 4;default:return void S().error(new g("webgl-utils",`Unable to handle type ${s}`))}}function K(s){switch(s){case u.UNSIGNED_BYTE:return Uint8Array;case u.UNSIGNED_SHORT_4_4_4_4:return Uint16Array;case u.FLOAT:return Float32Array;default:return void S().error(new g("webgl-utils",`Unable to handle type ${s}`))}}function H(s){var r;const t={};for(const e in s){const i=s[e];let n=0;t[e]=i.map(a=>{const o=new A(a.name,a.count,a.type,n,0,a.normalized||!1);return n+=a.count*Y(a.type),o}),(r=t[e])==null||r.forEach(a=>a.stride=n)}return t}const P=s=>{const t=new Map;for(const r in s)for(const e of s[r])t.set(e.name,e.location);return t},v=s=>{const t={};for(const r in s){const e=s[r];t[r]=e!=null&&e.length?e[0].stride:0}return t},p=new Map,q=(s,t)=>{if(!p.has(s)){const r=H(t),e={strides:v(r),bufferLayouts:r,attributes:P(t)};p.set(s,e)}return p.get(s)},V=s=>s.includes("data:image/svg+xml");function j(s){const t=[];for(let r=0;r`${r}.${e}.${i}`).join(",");return _(t)}function f(s,t,r,e,i,n,a){if(s.primitiveName===t){for(const o in s)if(o===r){let c=e==null?void 0:e.readWithDefault(i,n,s[o]&&a);return s.type==="text"&&(c=c.toString()),void(s[o]=c)}}if("type"in s&&s.type!=null)switch(s.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(s.symbolLayers)for(const o of s.symbolLayers)f(o,t,r,e,i,n,a);break;case"CIMHatchFill":s.lineSymbol&&f(s.lineSymbol,t,r,e,i,n,a);break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if(s.type==="CIMVectorMarker"&&s.markerGraphics)for(const o of s.markerGraphics)f(o,t,r,e,i,n,a),f(o.symbol,t,r,e,i,n,a)}}function D(s){const t=s.width;return s.effects!=null?256:Math.max(1.25*t,8)}class l{constructor(t,r,e,i){this.computedX=0,this.computedY=0,this.center=N(t,r),this.centerT=U(),this.halfWidth=e/2,this.halfHeight=i/2,this.width=e,this.height=i}get x(){return this.center[0]}get y(){return this.center[1]}get blX(){return this.center[0]+this.halfWidth}get blY(){return this.center[1]+this.halfHeight}get trX(){return this.center[0]-this.halfWidth}get trY(){return this.center[1]-this.halfHeight}get xmin(){return this.x-this.halfWidth}get xmax(){return this.x+this.halfWidth}get ymin(){return this.y-this.halfHeight}get ymax(){return this.y+this.halfHeight}set x(t){this.center[0]=t}set y(t){this.center[1]=t}clone(){return new l(this.x,this.y,this.width,this.height)}serialize(t){return t.writeF32(this.center[0]),t.writeF32(this.center[1]),t.push(this.width),t.push(this.height),t}findCollisionDelta(t,r=4){const e=Math.abs(t.centerT[0]-this.centerT[0]),i=Math.abs(t.centerT[1]-this.centerT[1]),n=(t.halfWidth+this.halfWidth+r)/e,a=(t.halfHeight+this.halfHeight+r)/i,o=Math.min(n,a);return Math.log2(o)}extend(t){const r=Math.min(this.xmin,t.xmin),e=Math.min(this.ymin,t.ymin),i=Math.max(this.xmax,t.xmax)-r,n=Math.max(this.ymax,t.ymax)-e,a=r+i/2,o=e+n/2;this.width=i,this.height=n,this.halfWidth=i/2,this.halfHeight=n/2,this.x=a,this.y=o}static deserialize(t){const r=t.readF32(),e=t.readF32(),i=t.readInt32(),n=t.readInt32();return new l(r,e,i,n)}}const R=new Float32Array(1);new Uint32Array(R.buffer);function G(s,t){return 65535&s|t<<16}function $(s,t,r,e){const i=r.packPrecisionFactor??1;switch(r.type){case h.BYTE:if(r.count===1)s.setInt8(e+r.offset,t*i);else for(let n=0;nb.getLogger("esri.views.2d.engine.webgl.Utils");function X(s){switch(s){case u.UNSIGNED_BYTE:return 1;case u.UNSIGNED_SHORT_4_4_4_4:return 2;case u.FLOAT:return 4;default:return void S().error(new g("webgl-utils",`Unable to handle type ${s}`))}}function K(s){switch(s){case u.UNSIGNED_BYTE:return Uint8Array;case u.UNSIGNED_SHORT_4_4_4_4:return Uint16Array;case u.FLOAT:return Float32Array;default:return void S().error(new g("webgl-utils",`Unable to handle type ${s}`))}}function H(s){var r;const t={};for(const e in s){const i=s[e];let n=0;t[e]=i.map(a=>{const o=new A(a.name,a.count,a.type,n,0,a.normalized||!1);return n+=a.count*Y(a.type),o}),(r=t[e])==null||r.forEach(a=>a.stride=n)}return t}const P=s=>{const t=new Map;for(const r in s)for(const e of s[r])t.set(e.name,e.location);return t},v=s=>{const t={};for(const r in s){const e=s[r];t[r]=e!=null&&e.length?e[0].stride:0}return t},p=new Map,q=(s,t)=>{if(!p.has(s)){const r=H(t),e={strides:v(r),bufferLayouts:r,attributes:P(t)};p.set(s,e)}return p.get(s)},V=s=>s.includes("data:image/svg+xml");function j(s){const t=[];for(let r=0;r{let r=class extends e{constructor(){super(...arguments),this.attached=!1,this.clips=new m,this.lastUpdateId=-1,this.moving=!1,this.updateRequested=!1,this.visibleAtCurrentScale=!1,this.highlightOptions=null}initialize(){var l,c,b;const s=((l=this.view)==null?void 0:l.spatialReferenceLocked)??!0;((c=this.view)==null?void 0:c.spatialReference)&&s&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new I("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",{layer:this.layer}))):(this.container||(this.container=new k),this.container.fadeTransitionEnabled=!0,this.container.visible=!1,this.container.endTransitions(),this.addHandles([h(()=>this.suspended,a=>{this.container&&(this.container.visible=!a)},p),h(()=>this.updateSuspended,a=>{this.view&&!a&&this.updateRequested&&this.view.requestUpdate()},p),h(()=>{var a;return((a=this.layer)==null?void 0:a.opacity)??1},a=>{this.container&&(this.container.opacity=a)},p),h(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",a=>{this.container&&(this.container.blendMode=a)},p),h(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,a=>{this.container&&(this.container.effect=a)},p),h(()=>this.highlightOptions,a=>this.container.highlightOptions=a,p),U(()=>this.clips,"change",()=>{this.container&&(this.container.clips=this.clips)},p),h(()=>{var a;return{scale:(a=this.view)==null?void 0:a.scale,scaleRange:this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null}},({scale:a})=>{const R=a!=null&&this.isVisibleAtScale(a);R!==this.visibleAtCurrentScale&&this._set("visibleAtCurrentScale",R)},p)],"constructor"),(b=this.view)!=null&&b.whenLayerView?this.view.whenLayerView(this.layer).then(a=>{a===this&&this.processAttach()},()=>{}):this.when().then(()=>{this.processAttach()},()=>{}))}destroy(){this.processDetach(),this.updateRequested=!1}get spatialReferenceSupported(){var n;const s=(n=this.view)==null?void 0:n.spatialReference;return s==null||this.supportsSpatialReference(s)}get updateSuspended(){return this.suspended}get updating(){var s;return this.spatialReferenceSupported&&(!this.attached||!this.suspended&&(this.updateRequested||this.isUpdating())||!!((s=this._updatingHandles)!=null&&s.updating))}processAttach(){this.isResolved()&&!this.attached&&!this.destroyed&&this.spatialReferenceSupported&&(this.attach(),this.attached=!0,this.requestUpdate())}processDetach(){this.attached&&(this.attached=!1,this.removeHandles("attach"),this.detach(),this.updateRequested=!1)}isVisibleAtScale(s){const n=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;if(!n)return!0;const{minScale:l,maxScale:c}=n;return T(s,l,c)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.updateSuspended||this.view.requestUpdate())}processUpdate(s){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",s),this.updateRequested&&!this.updateSuspended&&(this.updateRequested=!1,this.update(s))):this.updateRequested=!1}hitTest(s,n){return Promise.resolve(null)}supportsSpatialReference(s){return!0}canResume(){return!!this.spatialReferenceSupported&&!!super.canResume()&&this.visibleAtCurrentScale}getSuspendInfo(){const s=super.getSuspendInfo(),n=!this.spatialReferenceSupported,l=this.visibleAtCurrentScale;return n&&(s.spatialReferenceNotSupported=n),l&&(s.outsideScaleRange=l),s}addAttachHandles(s){this.addHandles(s,"attach")}};return t([i()],r.prototype,"attached",void 0),t([i({type:m,set(s){const n=_(s,this._get("clips"),m);this._set("clips",n)}})],r.prototype,"clips",void 0),t([i()],r.prototype,"container",void 0),t([i()],r.prototype,"moving",void 0),t([i({readOnly:!0})],r.prototype,"spatialReferenceSupported",null),t([i({readOnly:!0})],r.prototype,"updateParameters",void 0),t([i()],r.prototype,"updateRequested",void 0),t([i()],r.prototype,"updateSuspended",null),t([i()],r.prototype,"updating",null),t([i()],r.prototype,"view",void 0),t([i({readOnly:!0})],r.prototype,"visibleAtCurrentScale",void 0),t([i({type:x})],r.prototype,"highlightOptions",void 0),r=t([u("esri.views.2d.layers.LayerView2D")],r),r};let o=class extends H(N(j.EventedMixin(C))){constructor(e){super(e),this._updatingHandles=new L,this.layer=null,this.parent=null}initialize(){this.when().catch(e=>{var r;if(e.name!=="layerview:create-error"){const s=this.layer&&this.layer.id||"no id",n=((r=this.layer)==null?void 0:r.title)||"no title";M.getLogger(this).error("#resolve()",`Failed to resolve layer view (layer title: '${n}', id: '${s}')`,e)}})}destroy(){this._updatingHandles=E(this._updatingHandles)}get fullOpacity(){var e,r;return(((e=this.layer)==null?void 0:e.opacity)??1)*(((r=this.parent)==null?void 0:r.fullOpacity)??1)}get suspended(){return!this.canResume()}get suspendInfo(){return this.getSuspendInfo()}get legendEnabled(){var e;return!this.suspended&&((e=this.layer)==null?void 0:e.legendEnabled)===!0}get updating(){var e;return!(!((e=this._updatingHandles)!=null&&e.updating)&&!this.isUpdating())}get updatingProgress(){return this.updating?0:1}get visible(){var e;return((e=this.layer)==null?void 0:e.visible)===!0}set visible(e){this._overrideIfSome("visible",e)}canResume(){var e,r,s;return this.visible&&((e=this.layer)==null?void 0:e.loaded)&&!((r=this.parent)!=null&&r.suspended)&&((s=this.view)==null?void 0:s.ready)||!1}getSuspendInfo(){var s,n;const e=(s=this.parent)!=null&&s.suspended?this.parent.suspendInfo:{};return(n=this.view)!=null&&n.ready||(e.viewNotReady=!0),this.layer&&this.layer.loaded||(e.layerNotLoaded=!0),this.visible||(e.layerInvisible=!0),e}isUpdating(){return!1}};t([i()],o.prototype,"fullOpacity",null),t([i()],o.prototype,"layer",void 0),t([i()],o.prototype,"parent",void 0),t([i({readOnly:!0})],o.prototype,"suspended",null),t([i({readOnly:!0})],o.prototype,"suspendInfo",null),t([i({readOnly:!0})],o.prototype,"legendEnabled",null),t([i({type:Boolean,readOnly:!0})],o.prototype,"updating",null),t([i({readOnly:!0})],o.prototype,"updatingProgress",null),t([i()],o.prototype,"visible",null),t([i()],o.prototype,"view",void 0),o=t([u("esri.views.layers.LayerView")],o);const W=o;export{B as a,Q as m,W as u}; +import{d as t,y as i,f as u,aU as $,b0 as P,et as q,aE as O,aB as A,V,w as _,a8 as x,N as I,g as h,fJ as p,z as U,dn as H,hk as N,ca as j,a7 as C,i0 as L,s as M,u as E}from"./index-BjUNJPVf.js";import{d as T}from"./scaleUtils-DWXMiS7R.js";import{h as k}from"./Container-_n5wCgez.js";let y=class extends ${get version(){return this.commitVersionProperties(),(this._get("version")||0)+1}};t([i({readOnly:!0})],y.prototype,"version",null),y=t([u("esri.views.layers.support.ClipArea")],y);const S=y;var f;let d=f=class extends S{constructor(e){super(e),this.type="rect",this.left=null,this.right=null,this.top=null,this.bottom=null}clone(){return new f({left:this.left,right:this.right,top:this.top,bottom:this.bottom})}commitVersionProperties(){this.commitProperty("left"),this.commitProperty("right"),this.commitProperty("top"),this.commitProperty("bottom")}};t([i({type:[Number,String],json:{write:!0}})],d.prototype,"left",void 0),t([i({type:[Number,String],json:{write:!0}})],d.prototype,"right",void 0),t([i({type:[Number,String],json:{write:!0}})],d.prototype,"top",void 0),t([i({type:[Number,String],json:{write:!0}})],d.prototype,"bottom",void 0),d=f=t([u("esri.views.layers.support.ClipRect")],d);const z=d;var w;const D={base:q,key:"type",typeMap:{extent:O,polygon:A}};let g=w=class extends S{constructor(e){super(e),this.type="geometry",this.geometry=null}clone(){var e;return new w({geometry:((e=this.geometry)==null?void 0:e.clone())??null})}commitVersionProperties(){this.commitProperty("geometry")}};t([i({types:D,json:{read:P,write:!0}})],g.prototype,"geometry",void 0),g=w=t([u("esri.views.layers.support.Geometry")],g);const B=g;let v=class extends S{constructor(e){super(e),this.type="path",this.path=[]}commitVersionProperties(){this.commitProperty("path")}};t([i({type:[[[Number]]],json:{write:!0}})],v.prototype,"path",void 0),v=t([u("esri.views.layers.support.Path")],v);const F=v,m=V.ofType({key:"type",base:null,typeMap:{rect:z,path:F,geometry:B}}),Q=e=>{let r=class extends e{constructor(){super(...arguments),this.attached=!1,this.clips=new m,this.lastUpdateId=-1,this.moving=!1,this.updateRequested=!1,this.visibleAtCurrentScale=!1,this.highlightOptions=null}initialize(){var l,c,b;const s=((l=this.view)==null?void 0:l.spatialReferenceLocked)??!0;((c=this.view)==null?void 0:c.spatialReference)&&s&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new I("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",{layer:this.layer}))):(this.container||(this.container=new k),this.container.fadeTransitionEnabled=!0,this.container.visible=!1,this.container.endTransitions(),this.addHandles([h(()=>this.suspended,a=>{this.container&&(this.container.visible=!a)},p),h(()=>this.updateSuspended,a=>{this.view&&!a&&this.updateRequested&&this.view.requestUpdate()},p),h(()=>{var a;return((a=this.layer)==null?void 0:a.opacity)??1},a=>{this.container&&(this.container.opacity=a)},p),h(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",a=>{this.container&&(this.container.blendMode=a)},p),h(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,a=>{this.container&&(this.container.effect=a)},p),h(()=>this.highlightOptions,a=>this.container.highlightOptions=a,p),U(()=>this.clips,"change",()=>{this.container&&(this.container.clips=this.clips)},p),h(()=>{var a;return{scale:(a=this.view)==null?void 0:a.scale,scaleRange:this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null}},({scale:a})=>{const R=a!=null&&this.isVisibleAtScale(a);R!==this.visibleAtCurrentScale&&this._set("visibleAtCurrentScale",R)},p)],"constructor"),(b=this.view)!=null&&b.whenLayerView?this.view.whenLayerView(this.layer).then(a=>{a===this&&this.processAttach()},()=>{}):this.when().then(()=>{this.processAttach()},()=>{}))}destroy(){this.processDetach(),this.updateRequested=!1}get spatialReferenceSupported(){var n;const s=(n=this.view)==null?void 0:n.spatialReference;return s==null||this.supportsSpatialReference(s)}get updateSuspended(){return this.suspended}get updating(){var s;return this.spatialReferenceSupported&&(!this.attached||!this.suspended&&(this.updateRequested||this.isUpdating())||!!((s=this._updatingHandles)!=null&&s.updating))}processAttach(){this.isResolved()&&!this.attached&&!this.destroyed&&this.spatialReferenceSupported&&(this.attach(),this.attached=!0,this.requestUpdate())}processDetach(){this.attached&&(this.attached=!1,this.removeHandles("attach"),this.detach(),this.updateRequested=!1)}isVisibleAtScale(s){const n=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;if(!n)return!0;const{minScale:l,maxScale:c}=n;return T(s,l,c)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.updateSuspended||this.view.requestUpdate())}processUpdate(s){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",s),this.updateRequested&&!this.updateSuspended&&(this.updateRequested=!1,this.update(s))):this.updateRequested=!1}hitTest(s,n){return Promise.resolve(null)}supportsSpatialReference(s){return!0}canResume(){return!!this.spatialReferenceSupported&&!!super.canResume()&&this.visibleAtCurrentScale}getSuspendInfo(){const s=super.getSuspendInfo(),n=!this.spatialReferenceSupported,l=this.visibleAtCurrentScale;return n&&(s.spatialReferenceNotSupported=n),l&&(s.outsideScaleRange=l),s}addAttachHandles(s){this.addHandles(s,"attach")}};return t([i()],r.prototype,"attached",void 0),t([i({type:m,set(s){const n=_(s,this._get("clips"),m);this._set("clips",n)}})],r.prototype,"clips",void 0),t([i()],r.prototype,"container",void 0),t([i()],r.prototype,"moving",void 0),t([i({readOnly:!0})],r.prototype,"spatialReferenceSupported",null),t([i({readOnly:!0})],r.prototype,"updateParameters",void 0),t([i()],r.prototype,"updateRequested",void 0),t([i()],r.prototype,"updateSuspended",null),t([i()],r.prototype,"updating",null),t([i()],r.prototype,"view",void 0),t([i({readOnly:!0})],r.prototype,"visibleAtCurrentScale",void 0),t([i({type:x})],r.prototype,"highlightOptions",void 0),r=t([u("esri.views.2d.layers.LayerView2D")],r),r};let o=class extends H(N(j.EventedMixin(C))){constructor(e){super(e),this._updatingHandles=new L,this.layer=null,this.parent=null}initialize(){this.when().catch(e=>{var r;if(e.name!=="layerview:create-error"){const s=this.layer&&this.layer.id||"no id",n=((r=this.layer)==null?void 0:r.title)||"no title";M.getLogger(this).error("#resolve()",`Failed to resolve layer view (layer title: '${n}', id: '${s}')`,e)}})}destroy(){this._updatingHandles=E(this._updatingHandles)}get fullOpacity(){var e,r;return(((e=this.layer)==null?void 0:e.opacity)??1)*(((r=this.parent)==null?void 0:r.fullOpacity)??1)}get suspended(){return!this.canResume()}get suspendInfo(){return this.getSuspendInfo()}get legendEnabled(){var e;return!this.suspended&&((e=this.layer)==null?void 0:e.legendEnabled)===!0}get updating(){var e;return!(!((e=this._updatingHandles)!=null&&e.updating)&&!this.isUpdating())}get updatingProgress(){return this.updating?0:1}get visible(){var e;return((e=this.layer)==null?void 0:e.visible)===!0}set visible(e){this._overrideIfSome("visible",e)}canResume(){var e,r,s;return this.visible&&((e=this.layer)==null?void 0:e.loaded)&&!((r=this.parent)!=null&&r.suspended)&&((s=this.view)==null?void 0:s.ready)||!1}getSuspendInfo(){var s,n;const e=(s=this.parent)!=null&&s.suspended?this.parent.suspendInfo:{};return(n=this.view)!=null&&n.ready||(e.viewNotReady=!0),this.layer&&this.layer.loaded||(e.layerNotLoaded=!0),this.visible||(e.layerInvisible=!0),e}isUpdating(){return!1}};t([i()],o.prototype,"fullOpacity",null),t([i()],o.prototype,"layer",void 0),t([i()],o.prototype,"parent",void 0),t([i({readOnly:!0})],o.prototype,"suspended",null),t([i({readOnly:!0})],o.prototype,"suspendInfo",null),t([i({readOnly:!0})],o.prototype,"legendEnabled",null),t([i({type:Boolean,readOnly:!0})],o.prototype,"updating",null),t([i({readOnly:!0})],o.prototype,"updatingProgress",null),t([i()],o.prototype,"visible",null),t([i()],o.prototype,"view",void 0),o=t([u("esri.views.layers.LayerView")],o);const W=o;export{B as a,Q as m,W as u}; diff --git a/assets/LercWorker-BiydENSI.js b/assets/LercWorker-BTGjGtNo.js similarity index 98% rename from assets/LercWorker-BiydENSI.js rename to assets/LercWorker-BTGjGtNo.js index 8054d6e..e0d421c 100644 --- a/assets/LercWorker-BiydENSI.js +++ b/assets/LercWorker-BTGjGtNo.js @@ -1 +1 @@ -import{cM as Y}from"./index-CEWggaxV.js";var A={};A.defaultNoDataValue=Y(-1/0),A.decode=function(i,t){var r=(t=t||{}).encodedMaskData||t.encodedMaskData===null,e=E(i,t.inputOffset||0,r),c=t.noDataValue!=null?Y(t.noDataValue):A.defaultNoDataValue,n=F(e,t.pixelType||Float32Array,t.encodedMaskData,c,t.returnMask),s={width:e.width,height:e.height,pixelData:n.resultPixels,minValue:e.pixels.minValue,maxValue:e.pixels.maxValue,noDataValue:c};return n.resultMask&&(s.maskData=n.resultMask),t.returnEncodedMask&&e.mask&&(s.encodedMaskData=e.mask.bitset?e.mask.bitset:null),t.returnFileInfo&&(s.fileInfo=b(e,c),t.computeUsedBitDepths&&(s.fileInfo.bitDepths=D(e))),s};var F=function(i,t,r,e,c){var n,s,d=0,m=i.pixels.numBlocksX,x=i.pixels.numBlocksY,y=Math.floor(i.width/m),v=Math.floor(i.height/x),p=2*i.maxZError;r=r||(i.mask?i.mask.bitset:null),n=new t(i.width*i.height),c&&r&&(s=new Uint8Array(i.width*i.height));for(var g,k,h=new Float32Array(y*v),I=0;I<=x;I++){var U=I!==x?v:i.height%x;if(U!==0)for(var B=0;B<=m;B++){var o=B!==m?y:i.width%m;if(o!==0){var P,a,f,w,l=I*i.width*v+B*y,M=i.width-o,u=i.pixels.blocks[d];if(u.encoding<2?(u.encoding===0?P=u.rawData:(S(u.stuffedData,u.bitsPerPixel,u.numValidPixels,u.offset,p,h,i.pixels.maxValue),P=h),a=0):f=u.encoding===2?0:u.offset,r)for(k=0;k>3],w<<=7&l),g=0;g>3]),128&w?(s&&(s[l]=1),n[l++]=u.encoding<2?P[a++]:f):(s&&(s[l]=0),n[l++]=e),w<<=1;l+=M}else if(u.encoding<2)for(k=0;k0){var s=new Uint8Array(Math.ceil(e.width*e.height/8)),d=(n=new DataView(i,t,e.mask.numBytes)).getInt16(0,!0),m=2,x=0;do{if(d>0)for(;d--;)s[x++]=n.getUint8(m++);else{var y=n.getUint8(m++);for(d=-d;d--;)s[x++]=y}d=n.getInt16(m,!0),m+=2}while(m0?1:0),k=p+(e.height%p>0?1:0);e.pixels.blocks=new Array(g*k);for(var h=1e9,I=0,U=0;U3)throw"Invalid block encoding ("+a.encoding+")";if(a.encoding!==2){if(f!==0&&f!==2){if(f>>=6,a.offsetType=f,f===2)a.offset=n.getInt8(1),o++;else if(f===1)a.offset=n.getInt16(1,!0),o+=2;else{if(f!==0)throw"Invalid block offset type";a.offset=n.getFloat32(1,!0),o+=4}if(h=Math.min(a.offset,h),a.encoding===1)if(f=n.getUint8(o),o++,a.bitsPerPixel=63&f,f>>=6,a.numValidPixelsType=f,f===2)a.numValidPixels=n.getUint8(o),o++;else if(f===1)a.numValidPixels=n.getUint16(o,!0),o+=2;else{if(f!==0)throw"Invalid valid pixel count type";a.numValidPixels=n.getUint32(o,!0),o+=4}}var w;if(t+=o,a.encoding!=3){if(a.encoding===0){var l=(e.pixels.numBytes-1)/4;if(l!==Math.floor(l))throw"uncompressed block has invalid length";w=new ArrayBuffer(4*l),new Uint8Array(w).set(new Uint8Array(i,t,4*l));for(var M=new Float32Array(w),u=0;u=t)m=x>>>p-t&y,p-=t;else{var h=t-p;m=(x&y)<>>(p=32-h)}n[d]=m>3],w<<=7&l),g=0;g>3]),128&w?(s&&(s[l]=1),n[l++]=u.encoding<2?P[a++]:f):(s&&(s[l]=0),n[l++]=e),w<<=1;l+=M}else if(u.encoding<2)for(k=0;k0){var s=new Uint8Array(Math.ceil(e.width*e.height/8)),d=(n=new DataView(i,t,e.mask.numBytes)).getInt16(0,!0),m=2,x=0;do{if(d>0)for(;d--;)s[x++]=n.getUint8(m++);else{var y=n.getUint8(m++);for(d=-d;d--;)s[x++]=y}d=n.getInt16(m,!0),m+=2}while(m0?1:0),k=p+(e.height%p>0?1:0);e.pixels.blocks=new Array(g*k);for(var h=1e9,I=0,U=0;U3)throw"Invalid block encoding ("+a.encoding+")";if(a.encoding!==2){if(f!==0&&f!==2){if(f>>=6,a.offsetType=f,f===2)a.offset=n.getInt8(1),o++;else if(f===1)a.offset=n.getInt16(1,!0),o+=2;else{if(f!==0)throw"Invalid block offset type";a.offset=n.getFloat32(1,!0),o+=4}if(h=Math.min(a.offset,h),a.encoding===1)if(f=n.getUint8(o),o++,a.bitsPerPixel=63&f,f>>=6,a.numValidPixelsType=f,f===2)a.numValidPixels=n.getUint8(o),o++;else if(f===1)a.numValidPixels=n.getUint16(o,!0),o+=2;else{if(f!==0)throw"Invalid valid pixel count type";a.numValidPixels=n.getUint32(o,!0),o+=4}}var w;if(t+=o,a.encoding!=3){if(a.encoding===0){var l=(e.pixels.numBytes-1)/4;if(l!==Math.floor(l))throw"uncompressed block has invalid length";w=new ArrayBuffer(4*l),new Uint8Array(w).set(new Uint8Array(i,t,4*l));for(var M=new Float32Array(w),u=0;u=t)m=x>>>p-t&y,p-=t;else{var h=t-p;m=(x&y)<>>(p=32-h)}n[d]=mthis._computeExtent(),e=>{(e==null?void 0:e.pending)==null&&this._set("extent",e!=null?e.extent:null)},L))}get targets(){return this._get("targets")||new g}set targets(e){this._set("targets",R(e,this.targets,g))}get spatialReference(){var e;return((e=this.observer)==null?void 0:e.position)!=null?this.observer.position.spatialReference:null}get requiredPropertiesForEditing(){var e;return[(e=this.observer)==null?void 0:e.position]}async waitComputeExtent(){const e=this._computeExtent();return e!=null?e.pending:Promise.resolve()}_computeExtent(){var m;const e=this.spatialReference;if(((m=this.observer)==null?void 0:m.position)==null||e==null)return null;const r=p=>D(p.position,p.elevationInfo)==="absolute-height",o=this.observer.position,b=C(o.x,o.y,o.z,o.x,o.y,o.z);for(const p of this.targets)if(p.position!=null){const y=H(p.position,e);if(y.pending!=null)return{pending:y.pending,extent:null};if(y.geometry!=null){const{x:A,y:T,z:q}=y.geometry;J(b,[A,T,q])}}const c=K(b,e);return r(this.observer)&&this.targets.every(r)||(c.zmin=void 0,c.zmax=void 0),{pending:null,extent:c}}clear(){this.observer=null,this.targets.removeAll()}};i([s({type:["line-of-sight"]})],l.prototype,"type",void 0),i([s({type:F,json:{read:!0,write:!0}})],l.prototype,"observer",void 0),i([s({cast:V,type:g,nonNullable:!0,json:{read:!0,write:!0}})],l.prototype,"targets",null),i([s({value:null,readOnly:!0})],l.prototype,"extent",void 0),i([s({readOnly:!0})],l.prototype,"spatialReference",null),i([s({readOnly:!0})],l.prototype,"requiredPropertiesForEditing",null),l=i([h("esri.analysis.LineOfSightAnalysis")],l);const x=l,W=v.ofType(z);let n=class extends M(U(k)){constructor(t){super(t),this.type="line-of-sight",this.operationalLayerType="LineOfSightLayer",this.analysis=new x,this.opacity=1}initialize(){this.addHandles($(()=>this.analysis,(t,e)=>{e!=null&&e.parent===this&&(e.parent=null),t!=null&&(t.parent=this)},L))}async load(){return this.analysis!=null&&this.addResolvingPromise(this.analysis.waitComputeExtent()),this}get observer(){var t;return(t=this.analysis)==null?void 0:t.observer}set observer(t){const{analysis:e}=this;e&&(e.observer=t)}get targets(){return this.analysis!=null?this.analysis.targets:new v}set targets(t){var e;R(t,(e=this.analysis)==null?void 0:e.targets)}get fullExtent(){return this.analysis!=null?this.analysis.extent:null}get spatialReference(){return this.analysis!=null?this.analysis.spatialReference:null}releaseAnalysis(t){this.analysis===t&&(this.analysis=new x)}};i([s({json:{read:!1},readOnly:!0})],n.prototype,"type",void 0),i([s({type:["LineOfSightLayer"]})],n.prototype,"operationalLayerType",void 0),i([s({type:F,json:{read:!0,write:{isRequired:!0,ignoreOrigin:!0}}})],n.prototype,"observer",null),i([s({type:W,json:{read:!0,write:{ignoreOrigin:!0}}})],n.prototype,"targets",null),i([s({nonNullable:!0,json:{read:!1,write:!1}})],n.prototype,"analysis",void 0),i([s({readOnly:!0})],n.prototype,"fullExtent",null),i([s({readOnly:!0})],n.prototype,"spatialReference",null),i([s({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],n.prototype,"opacity",void 0),i([s({type:["show","hide"]})],n.prototype,"listMode",void 0),n=i([h("esri.layers.LineOfSightLayer")],n);const lt=n;export{lt as default}; +import{dm as j,b4 as _,hS as d,d as i,y as s,aA as w,bR as O,f as h,a7 as N,hO as P,V as v,x as V,g as $,fJ as L,w as R,hT as C,dV as H,hU as J,hV as K,dp as M,dr as U,bT as k}from"./index-BjUNJPVf.js";import{c as B}from"./Analysis-yEzECn2p.js";import{j as f}from"./persistable-3OEDOKAC.js";import{i as D}from"./elevationInfoUtils-DIYaTlLQ.js";import"./MD5-C9MwAd2G.js";import"./multiOriginJSONSupportUtils-C0wm8_Yw.js";import"./resourceExtension-CiV172Z4.js";function S(t,e){return I(t)===I(e)}function I(t){if(t==null)return null;const e=t.layer!=null?t.layer.id:"";let r=null;return r=t.objectId!=null?t.objectId:t.layer!=null&&"objectIdField"in t.layer&&t.layer.objectIdField!=null&&t.attributes!=null?t.attributes[t.layer.objectIdField]:t.uid,r==null?null:`o-${e}-${r}`}const E={json:{write:{writer:G,target:{"feature.layerId":{type:[Number,String]},"feature.objectId":{type:[Number,String]}}},origins:{"web-scene":{read:Q}}}};function G(t,e){var r;((r=t==null?void 0:t.layer)==null?void 0:r.objectIdField)!=null&&t.attributes!=null&&(e.feature={layerId:t.layer.id,objectId:t.attributes[t.layer.objectIdField]})}function Q(t){if(t.layerId!=null&&t.objectId!=null)return{uid:null,layer:{id:t.layerId,objectIdField:"ObjectId"},attributes:{ObjectId:t.objectId}}}let a=class extends j(_(N)){constructor(e){super(e),this.position=null,this.elevationInfo=null,this.feature=null}equals(e){return d(this.position,e.position)&&d(this.elevationInfo,e.elevationInfo)&&S(this.feature,e.feature)}};i([s({type:w,json:{write:{isRequired:!0}}})],a.prototype,"position",void 0),i([s({type:O}),f()],a.prototype,"elevationInfo",void 0),i([s(E)],a.prototype,"feature",void 0),a=i([h("esri.analysis.LineOfSightAnalysisObserver")],a);const F=a;let u=class extends j(P){constructor(t){super(t),this.position=null,this.elevationInfo=null,this.feature=null}equals(t){return d(this.position,t.position)&&d(this.elevationInfo,t.elevationInfo)&&S(this.feature,t.feature)}};i([s({type:w}),f()],u.prototype,"position",void 0),i([s({type:O}),f()],u.prototype,"elevationInfo",void 0),i([s(E)],u.prototype,"feature",void 0),u=i([h("esri.analysis.LineOfSightAnalysisTarget")],u);const z=u,g=v.ofType(z);let l=class extends B{constructor(e){super(e),this.type="line-of-sight",this.observer=null,this.extent=null}initialize(){this.addHandles($(()=>this._computeExtent(),e=>{(e==null?void 0:e.pending)==null&&this._set("extent",e!=null?e.extent:null)},L))}get targets(){return this._get("targets")||new g}set targets(e){this._set("targets",R(e,this.targets,g))}get spatialReference(){var e;return((e=this.observer)==null?void 0:e.position)!=null?this.observer.position.spatialReference:null}get requiredPropertiesForEditing(){var e;return[(e=this.observer)==null?void 0:e.position]}async waitComputeExtent(){const e=this._computeExtent();return e!=null?e.pending:Promise.resolve()}_computeExtent(){var m;const e=this.spatialReference;if(((m=this.observer)==null?void 0:m.position)==null||e==null)return null;const r=p=>D(p.position,p.elevationInfo)==="absolute-height",o=this.observer.position,b=C(o.x,o.y,o.z,o.x,o.y,o.z);for(const p of this.targets)if(p.position!=null){const y=H(p.position,e);if(y.pending!=null)return{pending:y.pending,extent:null};if(y.geometry!=null){const{x:A,y:T,z:q}=y.geometry;J(b,[A,T,q])}}const c=K(b,e);return r(this.observer)&&this.targets.every(r)||(c.zmin=void 0,c.zmax=void 0),{pending:null,extent:c}}clear(){this.observer=null,this.targets.removeAll()}};i([s({type:["line-of-sight"]})],l.prototype,"type",void 0),i([s({type:F,json:{read:!0,write:!0}})],l.prototype,"observer",void 0),i([s({cast:V,type:g,nonNullable:!0,json:{read:!0,write:!0}})],l.prototype,"targets",null),i([s({value:null,readOnly:!0})],l.prototype,"extent",void 0),i([s({readOnly:!0})],l.prototype,"spatialReference",null),i([s({readOnly:!0})],l.prototype,"requiredPropertiesForEditing",null),l=i([h("esri.analysis.LineOfSightAnalysis")],l);const x=l,W=v.ofType(z);let n=class extends M(U(k)){constructor(t){super(t),this.type="line-of-sight",this.operationalLayerType="LineOfSightLayer",this.analysis=new x,this.opacity=1}initialize(){this.addHandles($(()=>this.analysis,(t,e)=>{e!=null&&e.parent===this&&(e.parent=null),t!=null&&(t.parent=this)},L))}async load(){return this.analysis!=null&&this.addResolvingPromise(this.analysis.waitComputeExtent()),this}get observer(){var t;return(t=this.analysis)==null?void 0:t.observer}set observer(t){const{analysis:e}=this;e&&(e.observer=t)}get targets(){return this.analysis!=null?this.analysis.targets:new v}set targets(t){var e;R(t,(e=this.analysis)==null?void 0:e.targets)}get fullExtent(){return this.analysis!=null?this.analysis.extent:null}get spatialReference(){return this.analysis!=null?this.analysis.spatialReference:null}releaseAnalysis(t){this.analysis===t&&(this.analysis=new x)}};i([s({json:{read:!1},readOnly:!0})],n.prototype,"type",void 0),i([s({type:["LineOfSightLayer"]})],n.prototype,"operationalLayerType",void 0),i([s({type:F,json:{read:!0,write:{isRequired:!0,ignoreOrigin:!0}}})],n.prototype,"observer",null),i([s({type:W,json:{read:!0,write:{ignoreOrigin:!0}}})],n.prototype,"targets",null),i([s({nonNullable:!0,json:{read:!1,write:!1}})],n.prototype,"analysis",void 0),i([s({readOnly:!0})],n.prototype,"fullExtent",null),i([s({readOnly:!0})],n.prototype,"spatialReference",null),i([s({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],n.prototype,"opacity",void 0),i([s({type:["show","hide"]})],n.prototype,"listMode",void 0),n=i([h("esri.layers.LineOfSightLayer")],n);const lt=n;export{lt as default}; diff --git a/assets/LinkChartLayer-BS3nw-u_.js b/assets/LinkChartLayer-B9wu3mvA.js similarity index 95% rename from assets/LinkChartLayer-BS3nw-u_.js rename to assets/LinkChartLayer-B9wu3mvA.js index 9efadee..4a2e719 100644 --- a/assets/LinkChartLayer-BS3nw-u_.js +++ b/assets/LinkChartLayer-B9wu3mvA.js @@ -1,7 +1,7 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/lclayout-BGy-0MYF.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css"] + __vite__mapDeps.viteFileDeps = ["assets/lclayout-QKV44p2z.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{b0 as dt,N as te,d as L,y as w,f as we,a7 as yt,s as de,Z as ae,aX as he,d2 as at,cB as ue,bv as Re,aE as ce,eZ as qe,aB as it,bP as nt,bQ as st,j4 as ut,d3 as le,a_ as Me,fA as ct,aC as ve,fD as mt,i as ft,bT as ot,_ as gt,gZ as Tt,V as Pe,at as bt,aA as je}from"./index-CEWggaxV.js";import{z as se}from"./geohashUtils-CTQSvgbV.js";import{o as ie}from"./featureConversionUtils-CmP9mw0r.js";import{t as Qe,e as Ue}from"./OptimizedGeometry-CQuTPb9g.js";import{G as be,p as Lt,t as kt,T as wt}from"./knowledgeGraphService-pVNmnapY.js";import{a as ye}from"./GraphQueryStreaming-ofadKoJ9.js";import"./UniqueValueRenderer-BlkUix3g.js";import{t as Ee,a as Ct}from"./jsonUtils-BseLl1fZ.js";import{m as Mt}from"./FeatureStore-CqSz6SOQ.js";import{$ as Et}from"./QueryEngine-RpcY23Sv.js";import{l as xt,o as xe}from"./clientSideDefaults-CgRgH99f.js";import{s as Dt}from"./fieldProperties-DMs4wT6-.js";import{c as It}from"./FeatureReductionLayer-DncGsNIN.js";import{f as Nt}from"./RefreshableLayer-1EkEhJeI.js";import{d as Rt}from"./FeatureSet-CYJUZgOk.js";import{p as vt}from"./popupUtils-DAFYyAvw.js";import"./timeSupport-BjRbXIpn.js";import"./json-Wa8cmqdu.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./ColorStop-44hBlQ14.js";import"./diffUtils-B4YFa5Ju.js";import"./colorRamps-BJydlf0f.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-z2k12BH8.js";import"./jsonUtils-qYmXvGJ1.js";import"./styleUtils-CnV_Xzhi.js";import"./Version-Bd0QsIQ5.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./OverrideHelper-B4ryGWZb.js";import"./utils-p-5Bbga5.js";import"./quantizationUtils-CUjGHrU3.js";import"./heatmapUtils-Clt5rJzr.js";import"./BoundsStore-DMoG4U0L.js";import"./PooledRBush-BsFBmw1o.js";import"./WhereClause-Dzgyc0wk.js";import"./TimeOnly-Cm47ew5I.js";import"./QueryEngineCapabilities-CTDe3LlQ.js";import"./utils-B8iadP2F.js";import"./utils-SjO_-1JL.js";import"./utils-GMt8_G3w.js";import"./ClassBreaksDefinition-D281x8Sj.js";import"./RenderState-DaVlEYWY.js";import"./defaultsJSON-CHAaurhX.js";import"./FeatureReductionSelection-BY3KVXac.js";import"./featureLayerUtils-BhDaw8pS.js";import"./AttachmentQuery-D61mmWw4.js";import"./RelationshipQuery-DDK72Kwc.js";import"./LabelClass-6cZokw8y.js";import"./labelUtils-Dnqx6jl5.js";import"./MD5-C9MwAd2G.js";const At="ESRI__DESTINATION_ID",_t="ESRI__ORIGIN_ID";let De=class ne{constructor(){this._featureLookup=new Map}static getInstance(){return ne.instance||(ne.instance=new ne),ne.instance}static resetInstance(){ne.instance&&(ne.instance=null)}deleteFromStore(a){a.forEach(t=>{this._featureLookup.delete(t)})}readFromStoreByList(a){const t=[];return a.forEach(s=>{const r=this.readFromStoreById(s);r&&t.push(r)}),t}readFromStoreById(a){return this._featureLookup.get(a)??null}writeToStore(a,t,s){const r=[];return a.forEach(o=>{if(!(o!=null&&o.id))return;o.properties||(o.properties=[]);let i,n=null;if(s&&o.properties[s]&&(n=ie(o.properties[s])),"originId"in o&&"destinationId"in o&&(o.properties[_t]=o.originId,o.properties[At]=o.destinationId),o.properties[t]=o.id,o.id&&this._featureLookup.has(o.id)&&this._featureLookup.get(o.id).attributes){const d=this._featureLookup.get(o.id),p=JSON.parse(JSON.stringify(Object.assign(d.attributes,o.properties)));s&&o.properties[s]&&(p[s]=dt(o.properties[s])),i=new Qe(n?JSON.parse(JSON.stringify(n)):d!=null&&d.geometry?JSON.parse(JSON.stringify(d.geometry)):null,p,null,o.properties[t])}else i=new Qe(n?JSON.parse(JSON.stringify(n)):null,o.properties,null,o.properties[t]);this._featureLookup.set(o.id,i),r.push(i)}),r}};var Le;(function(e){e.ELEMENTUID="ELEMENTUID",e.TYPENAME="TYPENAME"})(Le||(Le={}));Le.ELEMENTUID,Le.TYPENAME;var Be,He;(function(e){e[e.ELEMENTUID=0]="ELEMENTUID",e[e.TYPENAME=1]="TYPENAME"})(Be||(Be={})),function(e){e[e.ELEMENTUID=0]="ELEMENTUID",e[e.TYPENAME=1]="TYPENAME",e[e.FROMUID=2]="FROMUID",e[e.TOUID=3]="TOUID"}(He||(He={}));var Je,ze,Ye,Ve;(function(e){e[e.featureResult=0]="featureResult",e[e.countResult=1]="countResult",e[e.idsResult=2]="idsResult"})(Je||(Je={})),function(e){e[e.upperLeft=0]="upperLeft",e[e.lowerLeft=1]="lowerLeft"}(ze||(ze={})),function(e){e[e.sqlTypeBigInt=0]="sqlTypeBigInt",e[e.sqlTypeBinary=1]="sqlTypeBinary",e[e.sqlTypeBit=2]="sqlTypeBit",e[e.sqlTypeChar=3]="sqlTypeChar",e[e.sqlTypeDate=4]="sqlTypeDate",e[e.sqlTypeDecimal=5]="sqlTypeDecimal",e[e.sqlTypeDouble=6]="sqlTypeDouble",e[e.sqlTypeFloat=7]="sqlTypeFloat",e[e.sqlTypeGeometry=8]="sqlTypeGeometry",e[e.sqlTypeGUID=9]="sqlTypeGUID",e[e.sqlTypeInteger=10]="sqlTypeInteger",e[e.sqlTypeLongNVarchar=11]="sqlTypeLongNVarchar",e[e.sqlTypeLongVarbinary=12]="sqlTypeLongVarbinary",e[e.sqlTypeLongVarchar=13]="sqlTypeLongVarchar",e[e.sqlTypeNChar=14]="sqlTypeNChar",e[e.sqlTypeNVarChar=15]="sqlTypeNVarChar",e[e.sqlTypeOther=16]="sqlTypeOther",e[e.sqlTypeReal=17]="sqlTypeReal",e[e.sqlTypeSmallInt=18]="sqlTypeSmallInt",e[e.sqlTypeSqlXml=19]="sqlTypeSqlXml",e[e.sqlTypeTime=20]="sqlTypeTime",e[e.sqlTypeTimestamp=21]="sqlTypeTimestamp",e[e.sqlTypeTimestamp2=22]="sqlTypeTimestamp2",e[e.sqlTypeTinyInt=23]="sqlTypeTinyInt",e[e.sqlTypeVarbinary=24]="sqlTypeVarbinary",e[e.sqlTypeVarchar=25]="sqlTypeVarchar"}(Ye||(Ye={})),function(e){e[e.OID_ARRAY=0]="OID_ARRAY",e[e.GLOBALID_ARRAY=1]="GLOBALID_ARRAY",e[e.STRING_ARRAY=2]="STRING_ARRAY",e[e.IDENTIFIER_ARRAY=3]="IDENTIFIER_ARRAY"}(Ve||(Ve={}));function $t(e){if(!e.spatialReference.isWGS84)throw new te("knowledge-graph:layer-support-utils","The extentToInBoundsRings function only supports WGS84 spatial references.");let a;return a=e.xmax>180&&e.xmin<180?[[[e.xmin,e.ymin],[e.xmin,e.ymax],[180,e.ymax],[180,e.ymin],[e.xmin,e.ymin]],[[-180,e.ymin],[-180,e.ymax],[e.xmax-360,e.ymax],[e.xmax-360,e.ymin],[-180,e.ymin]]]:e.xmax>180&&e.xmin>180?[[[e.xmin-360,e.ymin],[e.xmin-360,e.ymax],[e.xmax-360,e.ymax],[e.xmax-360,e.ymin],[e.xmin-360,e.ymin]]]:e.xmax>-180&&e.xmin<-180?[[[e.xmin+360,e.ymin],[e.xmin+360,e.ymax],[180,e.ymax],[180,e.ymin],[e.xmin+360,e.ymin]],[[-180,e.ymin],[-180,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[-180,e.ymin]]]:e.xmax<-180&&e.xmin<-180?[[[e.xmin+360,e.ymin],[e.xmin+360,e.ymax],[e.xmax+360,e.ymax],[e.xmax+360,e.ymin],[e.xmin+360,e.ymin]]]:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]],a}async function St(e,a){var o,i;const t=[],s=new Map,r=[];if((o=a.dataModel)!=null&&o.relationshipTypes)for(const n of a.dataModel.relationshipTypes)n.name&&s.set(n.name,[]);for(const n of e)s.has(n.typeName)&&((i=s.get(n.typeName))==null||i.push(n.id));for(const[n,d]of s){if(d.length<1)continue;const p=new ye({openCypherQuery:`MATCH (n)-[r:${n}]->(m) WHERE id(r) in $ids RETURN id(n), labels(n)[0], id(m), labels(m)[0]`,bindParameters:{ids:d}});r.push(be(a,p).then(async m=>{const u=m.resultRowsStream.getReader();for(;;){const{done:g,value:b}=await u.read();if(g)break;for(const f of b)t.push({id:f[0],typeName:f[1]}),t.push({id:f[2],typeName:f[3]})}}))}return await Promise.all(r),t}const R="ESRI__ID",ge="ESRI__ORIGIN_ID",Te="ESRI__DESTINATION_ID",G="ESRI__LAYOUT_GEOMETRY",Ae="ESRI__AGGREGATION_COUNT",oe=12;let H=class extends yt{constructor(a){var s,r,o;super(a),this._processingCacheUpdatesLookup=new Map,this.knowledgeGraph=null,this.inclusionModeDefinition={generateAllSublayers:!0,namedTypeDefinitions:new Map},this.entityTypeNames=new Set,this.relationshipTypeNames=new Set,this.geographicLookup=new Map,this.sublayerCaches=new Map,this.nodeConnectionsLookup=new Map,this.relationshipConnectionsLookup=new Map,this.memberIdTypeLookup=new Map;const t=new Map;(s=a.knowledgeGraph.dataModel.entityTypes)==null||s.forEach(i=>{var n,d;i.name&&(t.set(i.name,"entity"),this._processingCacheUpdatesLookup.set(i.name,[]),a.inclusionModeDefinition&&!((n=a.inclusionModeDefinition)!=null&&n.generateAllSublayers)||this.entityTypeNames.add(i.name),(d=i.properties)==null||d.forEach(p=>{p.geometryType&&p.geometryType!=="esriGeometryNull"&&this.geographicLookup.set(i.name,{name:p.name??"",geometryType:p.geometryType})}))}),(r=a.knowledgeGraph.dataModel.relationshipTypes)==null||r.forEach(i=>{var n,d;i.name&&(t.set(i.name,"relationship"),this._processingCacheUpdatesLookup.set(i.name,[]),a.inclusionModeDefinition&&!((n=a.inclusionModeDefinition)!=null&&n.generateAllSublayers)||this.relationshipTypeNames.add(i.name),(d=i.properties)==null||d.forEach(p=>{p.geometryType&&p.geometryType!=="esriGeometryNull"&&this.geographicLookup.set(i.name,{name:p.name??"",geometryType:p.geometryType})}))}),(o=a.inclusionModeDefinition)==null||o.namedTypeDefinitions.forEach((i,n)=>{var p,m;if(t.get(n)==="entity")this.entityTypeNames.add(n);else{if(t.get(n)!=="relationship")return de.getLogger(this).warn(`A named type, ${n}, was in the inclusion list that wasn't in the data model and will be removed`),void((p=a.inclusionModeDefinition)==null?void 0:p.namedTypeDefinitions.delete(n));this.relationshipTypeNames.add(n)}const d=new Map;(m=i.members)==null||m.forEach(u=>{ae(this.memberIdTypeLookup,u.id,()=>new Set).add(n);const g=this.getById(u.id);g&&d.set(u.id,g)}),this.sublayerCaches.set(n,d)})}addToLayer(a){a.forEach(({typeName:t,id:s})=>{if(!this.inclusionModeDefinition)throw new te("knowledge-graph:layer-data-manager","You cannot add to a layer's exclusion list if it was not created with an exclusion list originally");if(this.inclusionModeDefinition.namedTypeDefinitions.has(t)){if(this.inclusionModeDefinition.namedTypeDefinitions.has(t)){const r=this.inclusionModeDefinition.namedTypeDefinitions.get(t);r.members||(r.members=new Map),r.members.set(s,{id:s}),ae(this.memberIdTypeLookup,s,()=>new Set).add(t)}}else{const r=new Map;r.set(s,{id:s}),this.inclusionModeDefinition.namedTypeDefinitions.set(t,{useAllData:!1,members:r}),ae(this.memberIdTypeLookup,s,()=>new Set).add(t)}})}getById(a){return De.getInstance().readFromStoreById(a)}async getData(a,t,s){var o,i;if(t.objectType.name&&((o=this.inclusionModeDefinition)!=null&&o.namedTypeDefinitions)&&this.inclusionModeDefinition.namedTypeDefinitions.size>0&&!this.inclusionModeDefinition.namedTypeDefinitions.has(t.objectType.name))return[];let r;if(r=a||new he({where:"1=1",outFields:["*"]}),t.parentCompositeLayer.type==="link-chart"){const n=t.parentCompositeLayer,d=this._processingCacheUpdatesLookup.get(t.objectType.name??""),p=r.outFields,m=r.geometry;let u="",g="";m&&m.extent&&(u=se(m.extent.ymin,m.extent.xmin,oe),g=se(m.extent.ymax,m.extent.xmax,oe)),p&&p.length===1&&p[0]===R&&r.where==="1=1"||await Promise.all(d??[]);const b=this.sublayerCaches.has(t.objectType.name??"")?Array.from((i=this.sublayerCaches.get(t.objectType.name))==null?void 0:i.values()):[],f=[];return b.forEach(M=>{if(this.relationshipTypeNames.has(t.objectType.name)?M.geometry=n.relationshipLinkChartDiagramLookup.get(M.attributes[t.objectIdField]):M.geometry=n.entityLinkChartDiagramLookup.get(M.attributes[t.objectIdField]),M.attributes[G]=M.geometry,u&&g){const h=n.linkChartGeohashLookup.get(M.attributes[t.objectIdField]);h?h>=u&&h<=g&&f.push(M):f.push(M)}else f.push(M)}),f}return this.retrieveDataFromService(r,t,s)}async getConnectedRecordIds(a,t){const s=[];let r="";const o=[],i=new Map;if(a.forEach(n=>{var d;if(this.memberIdTypeLookup.has(n))for(const p of this.memberIdTypeLookup.get(n)){if(!this.entityTypeNames.has(p))return;i.has(p)?(d=i.get(p))==null||d.push(n):i.set(p,[n])}}),t&&(t==null?void 0:t.length)!==0){for(const n of t)r=r+n+"|";r=r.slice(0,-1)}return i.forEach((n,d)=>{let p;p=t&&(t==null?void 0:t.length)!==0?`MATCH (n:${d})-[r:${r}]-(m) WHERE id(n) IN $ids RETURN id(r), type(r), id(m), labels(m)[0]`:`MATCH (n:${d})-[r]-(m) WHERE id(n) IN $ids RETURN id(r), type(r), id(m), labels(m)[0]`;const m=new Promise(u=>{(async()=>{const g=(await be(this.knowledgeGraph,new ye({openCypherQuery:p,bindParameters:{ids:n}}))).resultRowsStream.getReader();try{for(;;){const{done:b,value:f}=await g.read();if(b)break;for(let M=0;M{u()})});o.push(m)}),this.refreshCacheContent(),await Promise.all(o),s}async refreshCacheContent(a,t,s,r=!0){var p,m,u,g,b,f,M;const o=De.getInstance(),i=[],n=new Map,d=new Map;(p=this.knowledgeGraph.dataModel.entityTypes)==null||p.forEach(h=>{h.name&&d.set(h.name,h)}),(m=this.knowledgeGraph.dataModel.relationshipTypes)==null||m.forEach(h=>{h.name&&d.set(h.name,h)}),a||this.inclusionModeDefinition?a?a.forEach(h=>{var D;if(this.memberIdTypeLookup.has(h))for(const F of this.memberIdTypeLookup.get(h))n.has(F)?(D=n.get(F))==null||D.push(h):n.set(F,[h])}):(g=(u=this.inclusionModeDefinition)==null?void 0:u.namedTypeDefinitions)==null||g.forEach((h,D)=>{h.useAllData?n.set(D,null):h.members&&h.members.forEach(F=>{var E;n.has(D)&&n.get(D)!==null?(E=n.get(D))==null||E.push(F.id):n.set(D,[F.id])})}):((b=this.knowledgeGraph.dataModel.entityTypes)==null||b.forEach(h=>{h.name&&n.set(h.name,null)}),(f=this.knowledgeGraph.dataModel.entityTypes)==null||f.forEach(h=>{h.name&&n.set(h.name,null)}));for(const[h,D]of n){const F=new Promise(E=>{(async()=>{var z,V,W,Z,K,l,y;const U=new Set,B=[];let ee,v="",P=!1;if(t||((V=(z=d.get(h))==null?void 0:z.properties)==null||V.forEach(c=>{c.name&&U.add(c.name)})),s&&this.geographicLookup.has(h)){const c=(W=this.geographicLookup.get(h))==null?void 0:W.name;c&&U.add(c)}if(this.entityTypeNames.has(h))v=`MATCH (n:${h}) ${D?"WHERE id(n) IN $ids ":""}return ID(n)`,U.forEach(c=>{v+=`, n.${c}`,B.push(c)});else{if(!this.relationshipTypeNames.has(h))throw new te("knowledge-graph:layer-data-manager",`The graph type of ${h} could not be determined. Was this type set in the KG data model and inclusion definition?`);P=!0,v=`MATCH ()-[n:${h}]->() ${D?"WHERE id(n) IN $ids ":""}return ID(n), id(startNode(n)), id(endNode(n))`,U.forEach(c=>{v+=`, n.${c}`,B.push(c)})}ee=new ye(D?{openCypherQuery:v,bindParameters:{ids:D}}:{openCypherQuery:v});const J=(await be(this.knowledgeGraph,ee)).resultRowsStream.getReader();for(;;){const{done:c,value:I}=await J.read();if(c)break;const N=[];for(let x=0;xnew Set).add(j.id),ae(this.nodeConnectionsLookup,j.destinationId,()=>new Set).add(j.id),ae(this.relationshipConnectionsLookup,j.id,()=>[j.originId,j.destinationId]));A{var C,A;k==null||k.set(x.attributes[R],x),r&&!((C=this.inclusionModeDefinition)!=null&&C.namedTypeDefinitions.get(h).members.has(x.attributes[R]))&&((A=this.inclusionModeDefinition)==null||A.namedTypeDefinitions.get(h).members.set(x.attributes[R],{id:x.attributes[R]}),ae(this.memberIdTypeLookup,x.attributes[R],()=>new Set).add(h))})}})().then(()=>{E(null)})});i.push(F),(M=this._processingCacheUpdatesLookup.get(h))==null||M.push(F)}await Promise.all(i)}removeFromLayer(a){var r,o,i;const t=new Set,s=new Set(a.map(n=>n.id));for(const n of a)t.add(n.typeName),((r=this.memberIdTypeLookup.get(n.id))==null?void 0:r.size)===1?this.memberIdTypeLookup.delete(n.id):(o=this.memberIdTypeLookup.get(n.id))==null||o.delete(n.typeName),(i=this.inclusionModeDefinition)==null||i.namedTypeDefinitions.forEach((d,p)=>{var m;p===n.typeName&&((m=d.members)!=null&&m.has(n.id))&&d.members.delete(n.id)});t.forEach(n=>{var d;(d=this.sublayerCaches.get(n))==null||d.forEach((p,m)=>{var u;s.has(m)&&((u=this.sublayerCaches.get(n))==null||u.delete(m))})})}async retrieveDataFromService(a,t,s){var M,h,D,F,E,Q,U,B,ee,v,P,J,z,V,W,Z,K;const r=De.getInstance(),o=new Set,i=[];let n,d="",p=[];const m=t.graphType==="relationship",u=(D=(h=(M=this.inclusionModeDefinition)==null?void 0:M.namedTypeDefinitions)==null?void 0:h.get(t.objectType.name))==null?void 0:D.useAllData,g=t.parentCompositeLayer.sublayerIdsCache.get(t.objectType.name);let b=!u&&g?Array.from(g).sort():null;if((Q=(E=(F=this.inclusionModeDefinition)==null?void 0:F.namedTypeDefinitions)==null?void 0:E.get(t.objectType.name))!=null&&Q.useAllData)(ee=(B=(U=this.inclusionModeDefinition)==null?void 0:U.namedTypeDefinitions)==null?void 0:B.get(t.objectType.name))!=null&&ee.useAllData&&a.objectIds!=null&&(b=a.objectIds);else if(a.objectIds!=null&&b&&b.length>0){const l=a.objectIds;a.objectIds=b.filter(y=>l.includes(y))}else if(a.objectIds!=null)b=a.objectIds;else{if((v=this.inclusionModeDefinition)!=null&&v.namedTypeDefinitions.has(t.objectType.name)&&(!((P=this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name))!=null&&P.members)||((z=(J=this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name))==null?void 0:J.members)==null?void 0:z.size)<1))return a.objectIds=[],[];a.objectIds=b}if(a.outFields!=null){const l=a.outFields;l.includes("*")?t.fields.forEach(y=>{o.add(y.name)}):l.forEach(y=>{y!==R&&y!==t.geometryFieldName&&o.add(y)})}if(a.geometry!=null){const l=a.geometry;let y;const c=t.parentCompositeLayer.dataManager.knowledgeGraph.serviceDefinition,I=c==null?void 0:c.spatialReference,N=(V=c==null?void 0:c.serviceCapabilities)==null?void 0:V.geometryCapabilities;let T=N==null?void 0:N.geometryMaxBoundingRectangleSizeX,k=N==null?void 0:N.geometryMaxBoundingRectangleSizeY;if((W=l==null?void 0:l.extent)!=null&&W.spatialReference&&!((Z=l.spatialReference)!=null&&Z.isWGS84)?(await at(l.extent.spatialReference,ue),y=Re(l.extent,ue)):y=l.extent,T&&k&&I){if(I.wkid!==4326){const x=new ce({spatialReference:I,xmax:T,ymax:k}),C=Re(x,ue);T=C.xmax,k=C.ymax}if(y.xmax-y.xmin>T)throw new te("knowledge-graph:layer-data-manager",`Extent x bounds should be within ${T}° latitude, limit exceeded`);if(y.ymax-y.ymin>k)throw new te("knowledge-graph:layer-data-manager",`Extent y bounds should be within ${k}° longitude, limit exceeded`)}if(a.where!=null&&a.where!=="1=1"){const x=await qe(a.where.toUpperCase(),t.fieldsIndex);t.fields.forEach(C=>{x.fieldNames.includes(C.name)&&o.add(C.name)})}d=m?`Match ()-[n:${t.objectType.name}]->() WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n), id(startNode(r)), id(endNode(r))`:`Match (n:${t.objectType.name}) WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n)`,t.geometryFieldName&&o.add(t.geometryFieldName),o.forEach(x=>{d+=`, n.${x}`,i.push(x)}),n=new ye({openCypherQuery:d,bindParameters:{param_filter_geom:new it({rings:$t(y)})}})}else{let l="";if(a.where!=null&&a.where!=="1=1"){const I=await qe(a.where,t.fieldsIndex);t.fields.forEach(C=>{I.fieldNames.includes(C.name)&&o.add(C.name)});const N=new Set(["column-reference","string","number","binary-expression"]),T=new Set(["=","<","<=","<>",">",">=","AND","OR","LIKE"]);let k=!1;const x=C=>{if(C.type==="column-reference")return`n.${C.column}`;if(C.type==="string")return`'${C.value}'`;if(C.type==="number")return`${C.value}`;if(C.type==="binary-expression"&&N.has(C.left.type)&&N.has(C.right.type)&&T.has(C.operator))return`${x(C.left)} ${C.operator} ${x(C.right)}`;if(C.type==="binary-expression"&&C.operator==="LIKE"){let A="";if(C.left.type==="function"&&C.left.args.value[0].type==="column-reference")A+=`lower(n.${C.left.args.value[0].column})`;else{if(C.left.type!=="column-reference")return k=!0,"";A+=`lower(n.${C.left.column})`}if(A+=" CONTAINS (",C.right.type!=="string")return k=!0,"";{let O=C.right.value;O.charAt(0)==="%"&&(O=O.slice(1)),O.charAt(O.length-1)==="%"&&(O=O.slice(0,-1)),A+=`'${O.toLowerCase()}')`}return A}return k=!0,""};l=x(I.parseTree),k&&(l="")}let y="";y=m?`Match ()-[n:${t.objectType.name}]->()`:`Match (n:${t.objectType.name})`;let c=!1;b&&(c=!0,y+=" WHERE ID(n) IN $ids"),l&&(y+=c?" AND":" WHERE",y+=` ${l}`),y+=" return ID(n)",m&&(y+=", id(startNode(n)), id(endNode(n))"),a.returnGeometry&&t.geometryFieldName&&o.add(t.geometryFieldName),o.forEach(I=>{y+=`, n.${I}`,i.push(I)}),n=new ye(b?{openCypherQuery:y,bindParameters:{ids:b}}:{openCypherQuery:y})}const f=(await be(t.parentCompositeLayer.dataManager.knowledgeGraph,n,s)).resultRowsStream.getReader();for(;;){const{done:l,value:y}=await f.read();if(l)break;const c=[];for(let I=0;I{let a=class extends e{constructor(){super(...arguments),this.fields=[],this.fieldsIndex=null}};return L([w(We.fields)],a.prototype,"fields",void 0),L([w(We.fieldsIndex)],a.prototype,"fieldsIndex",void 0),a=L([we("esri.layers.knowledgeGraphLayer.KnowledgeGraphSublayerBase")],a),a};let _=class extends It(Gt(nt(st(Nt(ot))))){constructor(e){var a,t,s,r,o;if(super(e),this.capabilities=xt(!1,!1),this.definitionExpression="",this.displayField="",this.elevationInfo=null,this.geometryType=null,this.geometryFieldName=null,this.graphType=null,this.hasM=!1,this.hasZ=!1,this.labelsVisible=null,this.labelingInfo=null,this.objectIdField=R,this.objectType=null,this.parentCompositeLayer=null,this.popupEnabled=!0,this.popupTemplate=null,this.source={openPorts:()=>this.load().then(()=>{const i=new MessageChannel;return new ut(i.port1,{channel:i,client:{queryFeatures:(n,d={})=>{const p=he.fromJSON(n);return this.queryFeaturesJSON(p,d)}}}),[i.port2]})},this.type="knowledge-graph-sublayer",e.parentCompositeLayer.type==="link-chart")e.graphType==="relationship"?this.geometryType="polyline":this.geometryType="point",this.geometryFieldName=G;else if((a=e.parentCompositeLayer.dataManager.geographicLookup.get(e.objectType.name))!=null&&a.geometryType&&((t=e.parentCompositeLayer.dataManager.geographicLookup.get(e.objectType.name))==null?void 0:t.geometryType)!=="esriGeometryNull"){const i=e.parentCompositeLayer.dataManager.geographicLookup.get(e.objectType.name);this.geometryFieldName=(i==null?void 0:i.name)??null,this.geometryType=i!=null&&i.geometryType?le.fromJSON(i.geometryType):null;const n=i==null?void 0:i.name,d=n?(s=e.objectType.properties)==null?void 0:s[n]:null;d?(this.hasM=d.hasM??!1,this.hasZ=d.hasZ??!1):(this.hasM=!1,this.hasZ=!1)}else this.geometryType=null;(r=e.objectType.properties)==null||r.forEach(i=>{let n=null,d=i.fieldType;d==="esriFieldTypeOID"&&(d="esriFieldTypeInteger"),this.fields.push(Me.fromJSON({name:i.name,type:d,alias:i.alias,defaultValue:n,editable:i.editable,nullable:i.nullable}))}),this.fields.push(Me.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1})),this.fields.push(Me.fromJSON({name:Ae,type:"esriFieldTypeInteger",alias:Ae,editable:!1})),this._set("fields",[...this.fields]),(o=e.parentCompositeLayer.dataManager.knowledgeGraph.dataModel)!=null&&o.spatialReference&&(this.spatialReference=e.parentCompositeLayer.dataManager.knowledgeGraph.dataModel.spatialReference),e.parentCompositeLayer.type==="link-chart"?e.graphType==="relationship"?this.renderer=Ee(xe(le.toJSON("polyline")).renderer):this.renderer=Ee(xe(le.toJSON("point")).renderer):this.renderer=Ee(xe(le.toJSON(this.geometryType)).renderer)}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){ct(e,this.fieldsIndex),this._set("renderer",e)}createPopupTemplate(e){return vt(this,e)}createQuery(){return new he({where:"1=1",outFields:["*"]})}getField(e){for(let a=0;a{o.sourceLayer=this}),r}async queryFeaturesJSON(e,a){const{resolvedQuery:t,queryEngine:s}=await this._setupQueryObjects(e);return await s.executeQuery(t.toJSON(),a==null?void 0:a.signal)}async queryFeatureCount(e,a){const{resolvedQuery:t,queryEngine:s}=await this._setupQueryObjects(e);return s.executeQueryForCount(t.toJSON(),a==null?void 0:a.signal)}async queryExtent(e={},a){var n,d,p,m;const t={...e,returnGeometry:!0},{resolvedQuery:s,queryEngine:r}=await this._setupQueryObjects(t),o=await r.executeQueryForExtent(s.toJSON(),a==null?void 0:a.signal);let i;return i=((n=o.extent)==null?void 0:n.xmin)!=null&&((d=o.extent)==null?void 0:d.xmax)!=null&&((p=o.extent)==null?void 0:p.ymin)!=null&&((m=o.extent)==null?void 0:m.ymax)!=null?new ce(o.extent):new ce,{count:o.count,extent:i}}async queryObjectIds(e,a){const t=he.from(e);let s;if(this.parentCompositeLayer.type==="link-chart"&&this._cachedQueryEngine)s=this._cachedQueryEngine;else{const r=await this.parentCompositeLayer.dataManager.getData(t,this,a);s=this.loadQueryEngine(r)}return s.executeQueryForIds(t.toJSON(),a==null?void 0:a.signal)}loadQueryEngine(e){const a=new Mt({geometryType:le.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),t=new Et({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:le.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,objectIdField:this.objectIdField,spatialReference:this.spatialReference.toJSON(),timeInfo:null,featureStore:a});return t.featureStore.addMany(e),t}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new he({where:"1=1",outFields:[R]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}async _setupQueryObjects(e,a){var o;const t=he.from(e),s=t.geometry;let r;if(s&&!((o=s.spatialReference)!=null&&o.isWGS84)&&(await at(s.spatialReference,ue),t.geometry=Re(s instanceof it||s instanceof ve?s:s.extent,ue)),this.parentCompositeLayer.type==="link-chart"&&this._cachedQueryEngine)r=this._cachedQueryEngine;else{const i=await this.parentCompositeLayer.dataManager.getData(t,this,a);r=this.loadQueryEngine(i)}return{resolvedQuery:t,queryEngine:r}}};L([w()],_.prototype,"capabilities",void 0),L([w({readOnly:!0})],_.prototype,"defaultPopupTemplate",null),L([w()],_.prototype,"definitionExpression",void 0),L([w()],_.prototype,"displayField",void 0),L([w()],_.prototype,"elevationInfo",void 0),L([w()],_.prototype,"geometryType",void 0),L([w()],_.prototype,"geometryFieldName",void 0),L([w()],_.prototype,"graphType",void 0),L([w()],_.prototype,"hasM",void 0),L([w()],_.prototype,"hasZ",void 0),L([w()],_.prototype,"labelsVisible",void 0),L([w()],_.prototype,"labelingInfo",void 0),L([w()],_.prototype,"objectIdField",void 0),L([w()],_.prototype,"objectType",void 0),L([w()],_.prototype,"parentCompositeLayer",void 0),L([w(mt)],_.prototype,"popupEnabled",void 0),L([w({type:ft,json:{name:"popupInfo",write:!0}})],_.prototype,"popupTemplate",void 0),L([w({types:Ct,json:{write:{target:"layerDefinition.drawingInfo.renderer"}}})],_.prototype,"renderer",null),L([w()],_.prototype,"source",void 0),L([w({json:{read:!1}})],_.prototype,"type",void 0),_=L([we("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],_);const Ie=_;let Ne,$=null;function Ft(){return Ne||(Ne=gt(()=>import("./lclayout-BGy-0MYF.js"),__vite__mapDeps([0,1,2])).then(e=>e.l).then(({default:e})=>e({locateFile:a=>Tt(`esri/libs/linkchartlayout/${a}`)})).then(e=>{Ot(e)}),Ne)}function Ot(e){$=e}var X,ke;function pe(e,a,t,s,r,o){const i=t.length,n=r.length,d=Float64Array.BYTES_PER_ELEMENT,p=Uint32Array.BYTES_PER_ELEMENT,m=Uint8Array.BYTES_PER_ELEMENT,u=16,g=u-1+i*(m+2*d)+n*(2*p),b=$._malloc(g);try{const f=b+u-b%u,M=f+i*d,h=M+i*d,D=h+n*p,F=D+n*p,E=()=>[$.HEAPF64.subarray(f>>3,(f>>3)+i),$.HEAPF64.subarray(M>>3,(M>>3)+i),$.HEAPU32.subarray(h>>2,(h>>2)+n),$.HEAPU32.subarray(D>>2,(D>>2)+n),$.HEAPU8.subarray(F,F+i)],[Q,U,B,ee,v]=E();Q.set(t),U.set(s),B.set(r),ee.set(o),v.set(a);let P=e(i,F,f,M,n,h,D),J=null;if(P){const l=$.getLayoutLinksTypes(),y=$.getLayoutLinksVerticesEndIndices(),c=$.getLayoutLinksVertices(),I=$.countLayoutLinksVertices();!n||l&&y?I&&!c?P=!1:J={types:new Uint8Array($.HEAPU8.subarray(l,l+n)),vertexEndIndex:new Uint32Array($.HEAPU32.subarray(y>>2,(y>>2)+n)),vertices:new Float64Array($.HEAPF64.subarray(c>>3,(c>>3)+2*I))}:P=!1}const[z,V,W,Z,K]=E();return t.set(z),s.set(V),r.set(W),o.set(Z),a.set(K),{success:P,links:J}}finally{$._free(b),$.cleanupLayout()}}(function(e){e[e.None=0]="None",e[e.IsMovable=1]="IsMovable",e[e.IsGeographic=2]="IsGeographic",e[e.IsRoot=4]="IsRoot"})(X||(X={})),function(e){e[e.Regular=0]="Regular",e[e.Orthogonal=1]="Orthogonal",e[e.Curved=2]="Curved",e[e.Recursive=3]="Recursive"}(ke||(ke={}));const Ze=2,Ke=1,Xe=-1;var _e,$e,Se,Ge,Fe,Oe,et,tt;(function(e){function a(){return $.getMinIdealEdgeLength()}function t(s,r,o,i,n,d=Ze,p=Ke,m=Xe){return pe((u,g,b,f,M,h,D)=>$.applyForceDirectedLayout(u,g,b,f,M,h,D,d,p,m),s,r,o,i,n)}e.getMinIdealEdgeLength=a,e.apply=t})(_e||(_e={})),function(e){function a(t,s,r,o,i,n=Ze,d=Ke,p=Xe){return pe((m,u,g,b,f,M,h)=>$.applyCommunityLayout(m,u,g,b,f,M,h,n,d,p),t,s,r,o,i)}e.apply=a}($e||($e={})),function(e){function a(t,s,r,o,i){return pe($.applySimpleLayout,t,s,r,o,i)}e.apply=a}(Se||(Se={})),function(e){function a(t,s,r,o,i){return pe($.applyHierarchicalLayout,t,s,r,o,i)}e.apply=a}(Ge||(Ge={})),function(e){function a(t,s,r,o,i){return pe($.applyRadialTreeLayout,t,s,r,o,i)}e.apply=a}(Fe||(Fe={})),function(e){function a(t,s,r,o,i){return pe($.applySmartTreeLayout,t,s,r,o,i)}e.apply=a}(Oe||(Oe={})),function(e){e[e.Undirected=0]="Undirected",e[e.Directed=1]="Directed",e[e.Reversed=2]="Reversed"}(et||(et={})),function(e){e[e.ByCC_Raw=0]="ByCC_Raw",e[e.ByCC_NormalizeGlobally=1]="ByCC_NormalizeGlobally",e[e.ByCC_NormalizeByCC=2]="ByCC_NormalizeByCC"}(tt||(tt={}));const qt=(e,a,t)=>(e.has(a)||e.set(a,t()),e.get(a));let q=class extends nt(st(ot)){constructor(e){if(super(e),this.dataPreloadedInLocalCache=!1,this.defaultLinkChartConfig=null,this._currentLinkChartConfig={layoutMode:"RADIAL_TREE"},this._graphTypeLookup=new Map,this.dataManager=null,this.knowledgeGraph=null,this.layers=new Pe,this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map,this.linkChartExtent=new ce({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.linkChartGeohashLookup=new Map,this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.sublayerIdsCache=new Map,this.tables=new Pe,this.type="link-chart",this._originalInclusionList=e.inclusionModeDefinition,e.dataPreloadedInLocalCache&&!e.inclusionModeDefinition)throw new te("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it")}normalizeCtorArgs(e){return{url:e.url,title:e.title,dataPreloadedInLocalCache:e.dataPreloadedInLocalCache,defaultLinkChartConfig:e.defaultLinkChartConfig}}_initializeLayerProperties(e){var o,i,n,d,p,m;if(!this.title&&this.url){const u=this.url.split("/");this.title=u[u.length-2]}const a=new Set;let t=[],s=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new te("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");(o=e.knowledgeGraph.dataModel.entityTypes)==null||o.forEach(u=>{u.name&&this._graphTypeLookup.set(u.name,u)}),(i=e.knowledgeGraph.dataModel.relationshipTypes)==null||i.forEach(u=>{u.name&&this._graphTypeLookup.set(u.name,u)}),(n=e.inclusionModeDefinition)!=null&&n.generateAllSublayers?(t=e.knowledgeGraph.dataModel.entityTypes??[],s=e.knowledgeGraph.dataModel.relationshipTypes??[]):(d=e.inclusionModeDefinition)!=null&&d.namedTypeDefinitions&&((p=e.inclusionModeDefinition)==null?void 0:p.namedTypeDefinitions.size)>0?(m=e.inclusionModeDefinition)==null||m.namedTypeDefinitions.forEach((u,g)=>{var b,f;if(!this._graphTypeLookup.get(g))return de.getLogger(this).warn(`A named type, ${g}, was in the inclusion list that wasn't in the data model and will be removed`),void((b=e.inclusionModeDefinition)==null?void 0:b.namedTypeDefinitions.delete(g));this._graphTypeLookup.get(g)instanceof Lt||"strictOrigin"in this._graphTypeLookup.get(g)?a.has(g)||(a.add(g),s.push(this._graphTypeLookup.get(g))):this._graphTypeLookup.get(g)instanceof kt||"properties"in this._graphTypeLookup.get(g)?a.has(g)||(a.add(g),t.push(this._graphTypeLookup.get(g))):(de.getLogger(this).warn(`A named type, ${g}, was in the inclusion list that wasn't properly modeled and will be removed`),(f=e.inclusionModeDefinition)==null||f.namedTypeDefinitions.delete(g))}):(t=e.knowledgeGraph.dataModel.entityTypes??[],s=e.knowledgeGraph.dataModel.relationshipTypes??[]);const r=new H({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=t,this.memberRelationshipTypes=s,this.dataManager=r}load(e){return this.addResolvingPromise(new Promise(a=>{wt(this.url).then(t=>{var s,r,o,i,n,d;if(this._initializeLayerProperties({knowledgeGraph:t,inclusionModeDefinition:this._originalInclusionList}),(r=(s=this.dataManager.inclusionModeDefinition)==null?void 0:s.namedTypeDefinitions)!=null&&r.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},(o=this.dataManager.knowledgeGraph.dataModel.entityTypes)==null||o.forEach(p=>{var m;p.name&&((m=this.dataManager.inclusionModeDefinition)==null||m.namedTypeDefinitions.set(p.name,{useAllData:!0}))}),(i=this.dataManager.knowledgeGraph.dataModel.relationshipTypes)==null||i.forEach(p=>{var m;p.name&&((m=this.dataManager.inclusionModeDefinition)==null||m.namedTypeDefinitions.set(p.name,{useAllData:!0}))})),this.dataPreloadedInLocalCache)this.loadLayerAssumingLocalCache(),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),(n=this.dataManager.inclusionModeDefinition)==null||n.namedTypeDefinitions.forEach(p=>{var m;p.useAllData=!1,(m=p.members)==null||m.forEach(u=>{let g;g=u.linkChartLocation instanceof Ue?u.linkChartLocation:u.linkChartLocation?ie(u.linkChartLocation):null,g&&g.coords.length===2&&g.lengths.length===0?(this.linkChartGeohashLookup.set(u.id,se(g.coords[1],g.coords[0],oe)),this.entityLinkChartDiagramLookup.set(u.id,g)):(this.linkChartGeohashLookup.set(u.id,""),this.relationshipLinkChartDiagramLookup.set(u.id,g))}),this.addResolvingPromise(this._initializeDiagram().then(async()=>{this.layers.forEach(async u=>{await u.refreshCachedQueryEngine()}),this.tables.forEach(async u=>{await u.refreshCachedQueryEngine()})}))});else{const p=((d=this.defaultLinkChartConfig)==null?void 0:d.layoutMode)==="GEOGRAPHIC";this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,p,!0).then(async()=>{bt(e);const m=[],u=[];this.loadLayerAssumingLocalCache(),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1,this.dataManager.inclusionModeDefinition.namedTypeDefinitions.forEach(g=>{g.useAllData=!1})),await this._initializeDiagram(),this.layers.forEach(g=>{u.push(g.refreshCachedQueryEngine()),m.push(new Promise(b=>{g.on("layerview-create",()=>{b(null)})}))}),this.tables.forEach(g=>{u.push(g.refreshCachedQueryEngine())}),await Promise.all(u)}))}a(null)})})),Promise.resolve(this)}async addRecords(e,a){let t=[];a!=null&&a.cascadeAddRelationshipEndNodes&&this.dataManager.knowledgeGraph.dataModel&&(t=await St(e,this.dataManager.knowledgeGraph));const s=e.concat(t).filter(r=>{var o;return!((o=this.sublayerIdsCache.get(r.typeName))!=null&&o.has(r.id))});await this._handleNewRecords(s)}async removeRecords(e,{cascadeRemoveRelationships:a=!0,recalculateLayout:t=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1}){var o,i,n,d,p,m,u,g;let s=[];for(const b of e)((n=(i=(o=this.dataManager.inclusionModeDefinition)==null?void 0:o.namedTypeDefinitions)==null?void 0:i.get(b.typeName))==null?void 0:n.useAllData)===!1&&((u=(m=(p=(d=this.dataManager.inclusionModeDefinition)==null?void 0:d.namedTypeDefinitions)==null?void 0:p.get(b.typeName))==null?void 0:m.members)!=null&&u.has(b.id))&&s.push(b);if(a){const b=new Set,f=[];for(const M of s)if(this.dataManager.nodeConnectionsLookup.has(M.id))for(const h of this.dataManager.nodeConnectionsLookup.get(M.id))b.add(h);for(const M of b)if(this.dataManager.memberIdTypeLookup.has(M))for(const h of this.dataManager.memberIdTypeLookup.get(M))this.dataManager.relationshipTypeNames.has(h)&&f.push({id:M,typeName:h});s=s.concat(f)}this.dataManager.removeFromLayer(s);for(const b of s)(g=this.sublayerIdsCache.get(b.typeName))==null||g.delete(b.id),this.dataManager.relationshipTypeNames.has(b.typeName)?this.relationshipLinkChartDiagramLookup.delete(b.id):this.entityLinkChartDiagramLookup.delete(b.id);t&&await this.calculateLinkChartLayout(this._currentLinkChartConfig.layoutMode,{});const r=[];return this.layers.forEach(b=>{r.push(b.refreshCachedQueryEngine())}),await Promise.all(r),this._refreshNamedTypes(),s}async expand(e,a){const t=await this.dataManager.getConnectedRecordIds(e,a),s=t.filter(r=>{var o;return!((o=this.sublayerIdsCache.get(r.typeName))!=null&&o.has(r.id))});return await this._handleNewRecords(t),{records:s}}loadLayerAssumingLocalCache(){var e,a;this.memberRelationshipTypes.forEach(t=>{const s=new Ie({objectType:t,parentCompositeLayer:this,graphType:"relationship",title:t.name});s.geometryType?this.layers.push(s):this.tables.push(s),this.dataManager.sublayerCaches.has(t.name)||this.dataManager.sublayerCaches.set(t.name,new Map)}),this.memberEntityTypes.forEach(t=>{const s=new Ie({objectType:t,parentCompositeLayer:this,graphType:"entity",title:t.name});s.geometryType?this.layers.push(s):this.tables.push(s),this.dataManager.sublayerCaches.has(t.name)||this.dataManager.sublayerCaches.set(t.name,new Map)}),(e=this.dataManager.inclusionModeDefinition)!=null&&e.namedTypeDefinitions&&((a=this.dataManager.inclusionModeDefinition)==null||a.namedTypeDefinitions.forEach((t,s)=>{var o;const r=qt(this.sublayerIdsCache,s,()=>new Set);(o=t.members)==null||o.forEach(i=>{if(r.add(i.id),i.linkChartLocation)if(i.linkChartLocation instanceof Ue)this.dataManager.relationshipTypeNames.has(s)?this.relationshipLinkChartDiagramLookup.set(i.id,i.linkChartLocation):this.entityLinkChartDiagramLookup.set(i.id,i.linkChartLocation),i.linkChartLocation.coords.length===2&&i.linkChartLocation.lengths.length===0?this.linkChartGeohashLookup.set(i.id,se(i.linkChartLocation.coords[1],i.linkChartLocation.coords[0],oe)):this.linkChartGeohashLookup.set(i.id,"");else{const n=ie(i.linkChartLocation);this.dataManager.relationshipTypeNames.has(s)?this.relationshipLinkChartDiagramLookup.set(i.id,i.linkChartLocation?n:null):this.entityLinkChartDiagramLookup.set(i.id,i.linkChartLocation?n:null),"x"in i.linkChartLocation&&"y"in i.linkChartLocation?this.linkChartGeohashLookup.set(i.id,se(i.linkChartLocation.x,i.linkChartLocation.y,oe)):this.linkChartGeohashLookup.set(i.id,"")}})}))}async calculateLinkChartLayout(e="RADIAL_TREE",a){var W,Z,K;const t=[],s=[],r=[];this.dataManager.sublayerCaches.forEach((l,y)=>{this.dataManager.entityTypeNames.has(y)?l.forEach(c=>{t.push({typeName:y,feature:c})}):this.dataManager.relationshipTypeNames.has(y)&&l.forEach(c=>{s.push({typeName:y,feature:c})})}),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map;const o=new Map,i=new Map,n=new Map,d=new Map,p=new Uint8Array(t.length),m=new Float64Array(t.length),u=new Float64Array(t.length),g=new Uint32Array(s.length),b=new Uint32Array(s.length),f=[],M="FORCE_DIRECTED",h=new ce({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let D,F="FORCE_DIRECTED",E=0,Q=0;switch(F=e==="GEOGRAPHIC"?M:e,F){case"FORCE_DIRECTED":D=_e.apply;break;case"COMMUNITY":D=$e.apply;break;case"HIERARCHICAL":D=Ge.apply;break;case"RADIAL_TREE":D=Fe.apply;break;case"SMART_TREE":D=Oe.apply;break;default:D=Se.apply}t.forEach(({typeName:l,feature:y})=>{var c,I,N;if((c=a==null?void 0:a.lockedNodeLocations)!=null&&c.has(y.attributes[R])){e==="GEOGRAPHIC"&&this.dataManager.geographicLookup.has(l)?p[E]=X.IsGeographic:p[E]=X.None;const T=a.lockedNodeLocations.get(y.attributes[R]);m[E]=T.x,u[E]=T.y}else if(e==="GEOGRAPHIC"&&this.dataManager.geographicLookup.has(l)){p[E]=X.IsGeographic;let T=null;const k=y.attributes[this.dataManager.geographicLookup.get(l).name];switch((I=this.dataManager.geographicLookup.get(l))==null?void 0:I.geometryType){case"esriGeometryPoint":m[E]=k==null?void 0:k.x,u[E]=k==null?void 0:k.y;break;case"esriGeometryPolygon":T=k==null?void 0:k.centroid,(T==null?void 0:T.x)!=null&&(T==null?void 0:T.y)!=null?(m[E]=T.x,u[E]=T.y):p[E]=X.IsMovable;break;case"esriGeometryPolyline":case"esriGeometryMultipoint":T=(N=k==null?void 0:k.extent)==null?void 0:N.center,(T==null?void 0:T.x)!=null&&(T==null?void 0:T.y)!=null?(m[E]=T.x,u[E]=T.y):p[E]=X.IsMovable;break;default:p[E]=X.IsMovable}(m[E]==null||u[E]==null||Number.isNaN(m[E])||Number.isNaN(u[E]))&&(p[E]=X.IsMovable,m[E]=0,u[E]=0)}else p[E]=X.IsMovable,m[E]=0,u[E]=0;d.set(y.attributes[R],E),f[E]={feature:y,typeName:l},E++});let U=!1;const B=new Map;s.forEach(l=>{const y=l.feature.attributes[ge],c=l.feature.attributes[Te],I=d.get(y),N=d.get(c);if(I!==void 0&&N!==void 0){const T=y+"-"+c,k=B.get(T);(k==null?void 0:k.has(l.typeName))||(g[Q]=I,b[Q]=N,k===void 0?B.set(T,new Map([[l.typeName,Q]])):k.set(l.typeName,Q),Q++),r.push(l)}else U=!0,this.relationshipLinkChartDiagramLookup.set(y,null),this.linkChartGeohashLookup.set(y,null)}),U&&de.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null"),await Ft();const{success:ee,links:v}=D(p,m,u,g.subarray(0,Q),b.subarray(0,Q));if(!ee)throw new te("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");for(let l=0;l84.9999?u[l]=84.9999:u[l]<-84.9999&&(u[l]=-84.9999),m[l]>179.9999?m[l]=179.9999:m[l]<-179.9999&&(m[l]=-179.9999),f[l].feature.attributes[G]=new je(m[l],u[l]),o.has(f[l].typeName)){const c=o.get(f[l].typeName);c==null||c.set(f[l].feature.attributes[R],f[l].feature)}else{const c=new Map;c.set(f[l].feature.attributes[R],f[l].feature),o.set(f[l].typeName,c)}n.set(f[l].feature.attributes[R],f[l].feature);const y=ie(f[l].feature.attributes[G]);this.entityLinkChartDiagramLookup.set(f[l].feature.attributes[R],f[l].feature.attributes[G]?y:null),this.linkChartGeohashLookup.set(f[l].feature.attributes[R],se(f[l].feature.attributes[G].y,f[l].feature.attributes[G].x,oe)),f[l].feature.attributes[G].xh.xmax&&(h.xmax=f[l].feature.attributes[G].x),f[l].feature.attributes[G].yh.ymax&&(h.ymax=f[l].feature.attributes[G].y)}if(this.linkChartExtent.xmin=h.xmin,this.linkChartExtent.xmax=h.xmax,this.linkChartExtent.ymin=h.ymin,this.linkChartExtent.ymax=h.ymax,!v)throw new te("knowledge-graph:layout-failed","Attempting to retrieve link geometry from diagram engine failed");const P=new Map,J=new Map,z=new Map,V=new Set;for(let l=0;l85.5?y[S][1]=85.5:y[S][1]<-85.5&&(y[S][1]=-85.5),y[S][0]>179.9999?y[S][0]=179.9999:y[S][0]<-179.9999&&(y[S][0]=-179.9999);P.has(T)?P.get(T).push(y):P.set(T,[y])}const C=P.get(T);J.has(T)||(J.set(T,new Map),z.set(T,new Map));const A=J.get(T),O=z.get(T);A.has(c.typeName)||(A.set(c.typeName,C.shift()),O.set(c.typeName,0));const j=A.get(c.typeName);O.set(c.typeName,O.get(c.typeName)+1);const rt=new ve({paths:j});if(c.feature.attributes[G]=rt,i.has(c.typeName)){const Y=i.get(c.typeName);Y==null||Y.set(c.feature.attributes[R],c.feature)}else{const Y=new Map;Y.set(c.feature.attributes[R],c.feature),i.set(c.typeName,Y)}n.set(c.feature.attributes[R],c.feature);const lt=ie(c.feature.attributes[G]);this.relationshipLinkChartDiagramLookup.set(c.feature.attributes[R],c.feature.attributes[G]?lt:null),this.linkChartGeohashLookup.set(c.feature.attributes[R],"")}for(const l of r)l.feature.attributes[Ae]=((K=z.get(l.feature.attributes[ge]+"-"+l.feature.attributes[Te]))==null?void 0:K.get(l.typeName))??null;return this._currentLinkChartConfig={layoutMode:e},{nodes:o,links:i,idMap:n}}async applyNewLinkChartLayout(e="RADIAL_TREE",a){const t=[];await this.calculateLinkChartLayout(e,a),this.layers.forEach(s=>{t.push(s.refreshCachedQueryEngine())}),await Promise.all(t),this._refreshNamedTypes()}getCurrentNodeLocations(){var a,t;const e=new Map;return(t=(a=this.dataManager.inclusionModeDefinition)==null?void 0:a.namedTypeDefinitions)==null||t.forEach(s=>{var r;(r=s==null?void 0:s.members)==null||r.forEach(o=>{const i=o.linkChartLocation;let n;const d=o.id;i&&(n="x"in i?{x:i.x,y:i.y}:{x:i.coords[0],y:i.coords[1]},e.set(d,new je({x:n.x,y:n.y})))})}),e}async synchronizeInclusionListWithCache(){return new Promise(e=>{var a;(a=this.dataManager.inclusionModeDefinition)==null||a.namedTypeDefinitions.forEach((t,s)=>{if(t.useAllData=!1,t.members&&t.members.size>0){if(!this.dataManager.sublayerCaches.get(s))return;const r=new Set(Array.from(this.dataManager.sublayerCaches.get(s).keys()));Array.from(t.members.keys()).filter(o=>!r.has(o)).forEach(o=>{var i;(i=t.members)==null||i.delete(o)})}}),e()})}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const a=[];this.layers.forEach(t=>{a.push(t.refreshCachedQueryEngine())}),await Promise.all(a),this._refreshNamedTypes()}async _handleNewRecords(e){const a=[];this.dataManager.addToLayer(e);for(const t of e)this.sublayerIdsCache.has(t.typeName)||(this.sublayerIdsCache.set(t.typeName,new Set),a.push(t.typeName)),this.sublayerIdsCache.get(t.typeName).add(t.id);for(const t of a)if(this._graphTypeLookup.has(t)){const s=this._graphTypeLookup.get(t),r="endPoints"in s?"relationship":"entity",o=new Ie({objectType:s,parentCompositeLayer:this,graphType:r,title:t});r==="entity"?this.dataManager.entityTypeNames.add(t):this.dataManager.relationshipTypeNames.add(t),o.geometryType?this.layers.push(o):this.tables.push(o),this.dataManager.sublayerCaches.set(t,new Map)}await this.dataManager.refreshCacheContent(e.map(t=>t.id)),await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode)}async _initializeDiagram(){var e,a;this.defaultLinkChartConfig?this.defaultLinkChartConfig.doNotRecalculateLayout?((a=(e=this.dataManager.inclusionModeDefinition)==null?void 0:e.namedTypeDefinitions)==null||a.forEach((t,s)=>{var r;(r=t==null?void 0:t.members)==null||r.forEach(o=>{const i=o.linkChartLocation;let n;const d=o.id;if(!i)return;n="x"in i?{x:i.x,y:i.y}:{x:i.coords[0],y:i.coords[1]};const p=ie(n);this.dataManager.relationshipTypeNames.has(s)?this.relationshipLinkChartDiagramLookup.set(d,p):this.entityLinkChartDiagramLookup.set(d,p),this.linkChartGeohashLookup.set(d,se(n.x,n.y,oe)),this.linkChartExtent.xmin>n.x&&(this.linkChartExtent.xmin=n.x),this.linkChartExtent.xmaxn.y&&(this.linkChartExtent.ymin=n.y),this.linkChartExtent.ymax{var s;t.name&&((s=this.dataManager.sublayerCaches.get(t.name))==null||s.forEach(r=>{const o=this.relationshipLinkChartDiagramLookup.get(r.attributes[ge]),i=this.relationshipLinkChartDiagramLookup.get(r.attributes[Te]);if(o&&i){const n=ie(new ve({paths:[[o.coords[0],o.coords[1]],[i.coords[0],i.coords[1]]]}));this.relationshipLinkChartDiagramLookup.set(r.attributes[R],n)}else this.relationshipLinkChartDiagramLookup.set(r.attributes[R],null);this.linkChartGeohashLookup.set(r.attributes[R],"")}))})):await this.calculateLinkChartLayout(this.defaultLinkChartConfig.layoutMode,{lockedNodeLocations:this.getCurrentNodeLocations()}):await this.calculateLinkChartLayout("RADIAL_TREE",{lockedNodeLocations:this.getCurrentNodeLocations()})}_refreshNamedTypes(){for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}};L([w()],q.prototype,"dataPreloadedInLocalCache",void 0),L([w()],q.prototype,"defaultLinkChartConfig",void 0),L([w()],q.prototype,"dataManager",void 0),L([w()],q.prototype,"knowledgeGraph",void 0),L([w()],q.prototype,"layers",void 0),L([w()],q.prototype,"entityLinkChartDiagramLookup",void 0),L([w()],q.prototype,"relationshipLinkChartDiagramLookup",void 0),L([w()],q.prototype,"linkChartExtent",void 0),L([w()],q.prototype,"linkChartGeohashLookup",void 0),L([w()],q.prototype,"memberEntityTypes",void 0),L([w()],q.prototype,"memberRelationshipTypes",void 0),L([w()],q.prototype,"sublayerIdsCache",void 0),L([w()],q.prototype,"tables",void 0),L([w({json:{read:!1}})],q.prototype,"type",void 0),q=L([we("esri.layers.LinkChartLayer")],q);const Oa=q;export{Oa as default}; +import{b0 as dt,N as te,d as L,y as w,f as we,a7 as yt,s as de,Z as ae,aX as he,d2 as at,cB as ue,bv as Re,aE as ce,eZ as qe,aB as it,bP as nt,bQ as st,j4 as ut,d3 as le,a_ as Me,fA as ct,aC as ve,fD as mt,i as ft,bT as ot,_ as gt,gZ as Tt,V as Pe,at as bt,aA as je}from"./index-BjUNJPVf.js";import{z as se}from"./geohashUtils-DEscCvdk.js";import{o as ie}from"./featureConversionUtils-BHhm7bvm.js";import{t as Qe,e as Ue}from"./OptimizedGeometry-CQuTPb9g.js";import{G as be,p as Lt,t as kt,T as wt}from"./knowledgeGraphService-yi4prBvu.js";import{a as ye}from"./GraphQueryStreaming-BDRIPeal.js";import"./UniqueValueRenderer-7V9Bhr-D.js";import{t as Ee,a as Ct}from"./jsonUtils-Dw332y6z.js";import{m as Mt}from"./FeatureStore-CRMzrhIt.js";import{$ as Et}from"./QueryEngine-loUu1VUW.js";import{l as xt,o as xe}from"./clientSideDefaults-BQP5n3lX.js";import{s as Dt}from"./fieldProperties-DnrQXLBM.js";import{c as It}from"./FeatureReductionLayer-CK-tyM-9.js";import{f as Nt}from"./RefreshableLayer-_r2TPtol.js";import{d as Rt}from"./FeatureSet-opEn8ou8.js";import{p as vt}from"./popupUtils-DlZin22m.js";import"./timeSupport-DXkhlToK.js";import"./json-Wa8cmqdu.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./ColorStop-DCGjAKLC.js";import"./diffUtils-uUoMDFQS.js";import"./colorRamps-CcakIWlU.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-BX9G5gNQ.js";import"./jsonUtils-Ox5U0P0F.js";import"./styleUtils-DOUOskVZ.js";import"./Version-Dqq_CHBG.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./OverrideHelper-DxFZBnGL.js";import"./utils-CuXO_Zzq.js";import"./quantizationUtils-CfV316jZ.js";import"./heatmapUtils-BSteZBTj.js";import"./BoundsStore-DRDtG3Mk.js";import"./PooledRBush-BlFOlUgK.js";import"./WhereClause-Ctld7DSu.js";import"./TimeOnly-BXSODLxA.js";import"./QueryEngineCapabilities-CTDe3LlQ.js";import"./utils-BKh1cxpi.js";import"./utils-Bzmbfe7p.js";import"./utils-CY1ReiSd.js";import"./ClassBreaksDefinition-Djcxa8Lp.js";import"./RenderState-DaVlEYWY.js";import"./defaultsJSON-CHAaurhX.js";import"./FeatureReductionSelection-t3T7oa8H.js";import"./featureLayerUtils-lwqyOSrl.js";import"./AttachmentQuery-DmEAIZff.js";import"./RelationshipQuery-BDJrOxaX.js";import"./LabelClass-CeatfK8u.js";import"./labelUtils-3p0-m-Ee.js";import"./MD5-C9MwAd2G.js";const At="ESRI__DESTINATION_ID",_t="ESRI__ORIGIN_ID";let De=class ne{constructor(){this._featureLookup=new Map}static getInstance(){return ne.instance||(ne.instance=new ne),ne.instance}static resetInstance(){ne.instance&&(ne.instance=null)}deleteFromStore(a){a.forEach(t=>{this._featureLookup.delete(t)})}readFromStoreByList(a){const t=[];return a.forEach(s=>{const r=this.readFromStoreById(s);r&&t.push(r)}),t}readFromStoreById(a){return this._featureLookup.get(a)??null}writeToStore(a,t,s){const r=[];return a.forEach(o=>{if(!(o!=null&&o.id))return;o.properties||(o.properties=[]);let i,n=null;if(s&&o.properties[s]&&(n=ie(o.properties[s])),"originId"in o&&"destinationId"in o&&(o.properties[_t]=o.originId,o.properties[At]=o.destinationId),o.properties[t]=o.id,o.id&&this._featureLookup.has(o.id)&&this._featureLookup.get(o.id).attributes){const d=this._featureLookup.get(o.id),p=JSON.parse(JSON.stringify(Object.assign(d.attributes,o.properties)));s&&o.properties[s]&&(p[s]=dt(o.properties[s])),i=new Qe(n?JSON.parse(JSON.stringify(n)):d!=null&&d.geometry?JSON.parse(JSON.stringify(d.geometry)):null,p,null,o.properties[t])}else i=new Qe(n?JSON.parse(JSON.stringify(n)):null,o.properties,null,o.properties[t]);this._featureLookup.set(o.id,i),r.push(i)}),r}};var Le;(function(e){e.ELEMENTUID="ELEMENTUID",e.TYPENAME="TYPENAME"})(Le||(Le={}));Le.ELEMENTUID,Le.TYPENAME;var Be,He;(function(e){e[e.ELEMENTUID=0]="ELEMENTUID",e[e.TYPENAME=1]="TYPENAME"})(Be||(Be={})),function(e){e[e.ELEMENTUID=0]="ELEMENTUID",e[e.TYPENAME=1]="TYPENAME",e[e.FROMUID=2]="FROMUID",e[e.TOUID=3]="TOUID"}(He||(He={}));var Je,ze,Ye,Ve;(function(e){e[e.featureResult=0]="featureResult",e[e.countResult=1]="countResult",e[e.idsResult=2]="idsResult"})(Je||(Je={})),function(e){e[e.upperLeft=0]="upperLeft",e[e.lowerLeft=1]="lowerLeft"}(ze||(ze={})),function(e){e[e.sqlTypeBigInt=0]="sqlTypeBigInt",e[e.sqlTypeBinary=1]="sqlTypeBinary",e[e.sqlTypeBit=2]="sqlTypeBit",e[e.sqlTypeChar=3]="sqlTypeChar",e[e.sqlTypeDate=4]="sqlTypeDate",e[e.sqlTypeDecimal=5]="sqlTypeDecimal",e[e.sqlTypeDouble=6]="sqlTypeDouble",e[e.sqlTypeFloat=7]="sqlTypeFloat",e[e.sqlTypeGeometry=8]="sqlTypeGeometry",e[e.sqlTypeGUID=9]="sqlTypeGUID",e[e.sqlTypeInteger=10]="sqlTypeInteger",e[e.sqlTypeLongNVarchar=11]="sqlTypeLongNVarchar",e[e.sqlTypeLongVarbinary=12]="sqlTypeLongVarbinary",e[e.sqlTypeLongVarchar=13]="sqlTypeLongVarchar",e[e.sqlTypeNChar=14]="sqlTypeNChar",e[e.sqlTypeNVarChar=15]="sqlTypeNVarChar",e[e.sqlTypeOther=16]="sqlTypeOther",e[e.sqlTypeReal=17]="sqlTypeReal",e[e.sqlTypeSmallInt=18]="sqlTypeSmallInt",e[e.sqlTypeSqlXml=19]="sqlTypeSqlXml",e[e.sqlTypeTime=20]="sqlTypeTime",e[e.sqlTypeTimestamp=21]="sqlTypeTimestamp",e[e.sqlTypeTimestamp2=22]="sqlTypeTimestamp2",e[e.sqlTypeTinyInt=23]="sqlTypeTinyInt",e[e.sqlTypeVarbinary=24]="sqlTypeVarbinary",e[e.sqlTypeVarchar=25]="sqlTypeVarchar"}(Ye||(Ye={})),function(e){e[e.OID_ARRAY=0]="OID_ARRAY",e[e.GLOBALID_ARRAY=1]="GLOBALID_ARRAY",e[e.STRING_ARRAY=2]="STRING_ARRAY",e[e.IDENTIFIER_ARRAY=3]="IDENTIFIER_ARRAY"}(Ve||(Ve={}));function $t(e){if(!e.spatialReference.isWGS84)throw new te("knowledge-graph:layer-support-utils","The extentToInBoundsRings function only supports WGS84 spatial references.");let a;return a=e.xmax>180&&e.xmin<180?[[[e.xmin,e.ymin],[e.xmin,e.ymax],[180,e.ymax],[180,e.ymin],[e.xmin,e.ymin]],[[-180,e.ymin],[-180,e.ymax],[e.xmax-360,e.ymax],[e.xmax-360,e.ymin],[-180,e.ymin]]]:e.xmax>180&&e.xmin>180?[[[e.xmin-360,e.ymin],[e.xmin-360,e.ymax],[e.xmax-360,e.ymax],[e.xmax-360,e.ymin],[e.xmin-360,e.ymin]]]:e.xmax>-180&&e.xmin<-180?[[[e.xmin+360,e.ymin],[e.xmin+360,e.ymax],[180,e.ymax],[180,e.ymin],[e.xmin+360,e.ymin]],[[-180,e.ymin],[-180,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[-180,e.ymin]]]:e.xmax<-180&&e.xmin<-180?[[[e.xmin+360,e.ymin],[e.xmin+360,e.ymax],[e.xmax+360,e.ymax],[e.xmax+360,e.ymin],[e.xmin+360,e.ymin]]]:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]],a}async function St(e,a){var o,i;const t=[],s=new Map,r=[];if((o=a.dataModel)!=null&&o.relationshipTypes)for(const n of a.dataModel.relationshipTypes)n.name&&s.set(n.name,[]);for(const n of e)s.has(n.typeName)&&((i=s.get(n.typeName))==null||i.push(n.id));for(const[n,d]of s){if(d.length<1)continue;const p=new ye({openCypherQuery:`MATCH (n)-[r:${n}]->(m) WHERE id(r) in $ids RETURN id(n), labels(n)[0], id(m), labels(m)[0]`,bindParameters:{ids:d}});r.push(be(a,p).then(async m=>{const u=m.resultRowsStream.getReader();for(;;){const{done:g,value:b}=await u.read();if(g)break;for(const f of b)t.push({id:f[0],typeName:f[1]}),t.push({id:f[2],typeName:f[3]})}}))}return await Promise.all(r),t}const R="ESRI__ID",ge="ESRI__ORIGIN_ID",Te="ESRI__DESTINATION_ID",G="ESRI__LAYOUT_GEOMETRY",Ae="ESRI__AGGREGATION_COUNT",oe=12;let H=class extends yt{constructor(a){var s,r,o;super(a),this._processingCacheUpdatesLookup=new Map,this.knowledgeGraph=null,this.inclusionModeDefinition={generateAllSublayers:!0,namedTypeDefinitions:new Map},this.entityTypeNames=new Set,this.relationshipTypeNames=new Set,this.geographicLookup=new Map,this.sublayerCaches=new Map,this.nodeConnectionsLookup=new Map,this.relationshipConnectionsLookup=new Map,this.memberIdTypeLookup=new Map;const t=new Map;(s=a.knowledgeGraph.dataModel.entityTypes)==null||s.forEach(i=>{var n,d;i.name&&(t.set(i.name,"entity"),this._processingCacheUpdatesLookup.set(i.name,[]),a.inclusionModeDefinition&&!((n=a.inclusionModeDefinition)!=null&&n.generateAllSublayers)||this.entityTypeNames.add(i.name),(d=i.properties)==null||d.forEach(p=>{p.geometryType&&p.geometryType!=="esriGeometryNull"&&this.geographicLookup.set(i.name,{name:p.name??"",geometryType:p.geometryType})}))}),(r=a.knowledgeGraph.dataModel.relationshipTypes)==null||r.forEach(i=>{var n,d;i.name&&(t.set(i.name,"relationship"),this._processingCacheUpdatesLookup.set(i.name,[]),a.inclusionModeDefinition&&!((n=a.inclusionModeDefinition)!=null&&n.generateAllSublayers)||this.relationshipTypeNames.add(i.name),(d=i.properties)==null||d.forEach(p=>{p.geometryType&&p.geometryType!=="esriGeometryNull"&&this.geographicLookup.set(i.name,{name:p.name??"",geometryType:p.geometryType})}))}),(o=a.inclusionModeDefinition)==null||o.namedTypeDefinitions.forEach((i,n)=>{var p,m;if(t.get(n)==="entity")this.entityTypeNames.add(n);else{if(t.get(n)!=="relationship")return de.getLogger(this).warn(`A named type, ${n}, was in the inclusion list that wasn't in the data model and will be removed`),void((p=a.inclusionModeDefinition)==null?void 0:p.namedTypeDefinitions.delete(n));this.relationshipTypeNames.add(n)}const d=new Map;(m=i.members)==null||m.forEach(u=>{ae(this.memberIdTypeLookup,u.id,()=>new Set).add(n);const g=this.getById(u.id);g&&d.set(u.id,g)}),this.sublayerCaches.set(n,d)})}addToLayer(a){a.forEach(({typeName:t,id:s})=>{if(!this.inclusionModeDefinition)throw new te("knowledge-graph:layer-data-manager","You cannot add to a layer's exclusion list if it was not created with an exclusion list originally");if(this.inclusionModeDefinition.namedTypeDefinitions.has(t)){if(this.inclusionModeDefinition.namedTypeDefinitions.has(t)){const r=this.inclusionModeDefinition.namedTypeDefinitions.get(t);r.members||(r.members=new Map),r.members.set(s,{id:s}),ae(this.memberIdTypeLookup,s,()=>new Set).add(t)}}else{const r=new Map;r.set(s,{id:s}),this.inclusionModeDefinition.namedTypeDefinitions.set(t,{useAllData:!1,members:r}),ae(this.memberIdTypeLookup,s,()=>new Set).add(t)}})}getById(a){return De.getInstance().readFromStoreById(a)}async getData(a,t,s){var o,i;if(t.objectType.name&&((o=this.inclusionModeDefinition)!=null&&o.namedTypeDefinitions)&&this.inclusionModeDefinition.namedTypeDefinitions.size>0&&!this.inclusionModeDefinition.namedTypeDefinitions.has(t.objectType.name))return[];let r;if(r=a||new he({where:"1=1",outFields:["*"]}),t.parentCompositeLayer.type==="link-chart"){const n=t.parentCompositeLayer,d=this._processingCacheUpdatesLookup.get(t.objectType.name??""),p=r.outFields,m=r.geometry;let u="",g="";m&&m.extent&&(u=se(m.extent.ymin,m.extent.xmin,oe),g=se(m.extent.ymax,m.extent.xmax,oe)),p&&p.length===1&&p[0]===R&&r.where==="1=1"||await Promise.all(d??[]);const b=this.sublayerCaches.has(t.objectType.name??"")?Array.from((i=this.sublayerCaches.get(t.objectType.name))==null?void 0:i.values()):[],f=[];return b.forEach(M=>{if(this.relationshipTypeNames.has(t.objectType.name)?M.geometry=n.relationshipLinkChartDiagramLookup.get(M.attributes[t.objectIdField]):M.geometry=n.entityLinkChartDiagramLookup.get(M.attributes[t.objectIdField]),M.attributes[G]=M.geometry,u&&g){const h=n.linkChartGeohashLookup.get(M.attributes[t.objectIdField]);h?h>=u&&h<=g&&f.push(M):f.push(M)}else f.push(M)}),f}return this.retrieveDataFromService(r,t,s)}async getConnectedRecordIds(a,t){const s=[];let r="";const o=[],i=new Map;if(a.forEach(n=>{var d;if(this.memberIdTypeLookup.has(n))for(const p of this.memberIdTypeLookup.get(n)){if(!this.entityTypeNames.has(p))return;i.has(p)?(d=i.get(p))==null||d.push(n):i.set(p,[n])}}),t&&(t==null?void 0:t.length)!==0){for(const n of t)r=r+n+"|";r=r.slice(0,-1)}return i.forEach((n,d)=>{let p;p=t&&(t==null?void 0:t.length)!==0?`MATCH (n:${d})-[r:${r}]-(m) WHERE id(n) IN $ids RETURN id(r), type(r), id(m), labels(m)[0]`:`MATCH (n:${d})-[r]-(m) WHERE id(n) IN $ids RETURN id(r), type(r), id(m), labels(m)[0]`;const m=new Promise(u=>{(async()=>{const g=(await be(this.knowledgeGraph,new ye({openCypherQuery:p,bindParameters:{ids:n}}))).resultRowsStream.getReader();try{for(;;){const{done:b,value:f}=await g.read();if(b)break;for(let M=0;M{u()})});o.push(m)}),this.refreshCacheContent(),await Promise.all(o),s}async refreshCacheContent(a,t,s,r=!0){var p,m,u,g,b,f,M;const o=De.getInstance(),i=[],n=new Map,d=new Map;(p=this.knowledgeGraph.dataModel.entityTypes)==null||p.forEach(h=>{h.name&&d.set(h.name,h)}),(m=this.knowledgeGraph.dataModel.relationshipTypes)==null||m.forEach(h=>{h.name&&d.set(h.name,h)}),a||this.inclusionModeDefinition?a?a.forEach(h=>{var D;if(this.memberIdTypeLookup.has(h))for(const F of this.memberIdTypeLookup.get(h))n.has(F)?(D=n.get(F))==null||D.push(h):n.set(F,[h])}):(g=(u=this.inclusionModeDefinition)==null?void 0:u.namedTypeDefinitions)==null||g.forEach((h,D)=>{h.useAllData?n.set(D,null):h.members&&h.members.forEach(F=>{var E;n.has(D)&&n.get(D)!==null?(E=n.get(D))==null||E.push(F.id):n.set(D,[F.id])})}):((b=this.knowledgeGraph.dataModel.entityTypes)==null||b.forEach(h=>{h.name&&n.set(h.name,null)}),(f=this.knowledgeGraph.dataModel.entityTypes)==null||f.forEach(h=>{h.name&&n.set(h.name,null)}));for(const[h,D]of n){const F=new Promise(E=>{(async()=>{var z,V,W,Z,K,l,y;const U=new Set,B=[];let ee,v="",P=!1;if(t||((V=(z=d.get(h))==null?void 0:z.properties)==null||V.forEach(c=>{c.name&&U.add(c.name)})),s&&this.geographicLookup.has(h)){const c=(W=this.geographicLookup.get(h))==null?void 0:W.name;c&&U.add(c)}if(this.entityTypeNames.has(h))v=`MATCH (n:${h}) ${D?"WHERE id(n) IN $ids ":""}return ID(n)`,U.forEach(c=>{v+=`, n.${c}`,B.push(c)});else{if(!this.relationshipTypeNames.has(h))throw new te("knowledge-graph:layer-data-manager",`The graph type of ${h} could not be determined. Was this type set in the KG data model and inclusion definition?`);P=!0,v=`MATCH ()-[n:${h}]->() ${D?"WHERE id(n) IN $ids ":""}return ID(n), id(startNode(n)), id(endNode(n))`,U.forEach(c=>{v+=`, n.${c}`,B.push(c)})}ee=new ye(D?{openCypherQuery:v,bindParameters:{ids:D}}:{openCypherQuery:v});const J=(await be(this.knowledgeGraph,ee)).resultRowsStream.getReader();for(;;){const{done:c,value:I}=await J.read();if(c)break;const N=[];for(let x=0;xnew Set).add(j.id),ae(this.nodeConnectionsLookup,j.destinationId,()=>new Set).add(j.id),ae(this.relationshipConnectionsLookup,j.id,()=>[j.originId,j.destinationId]));A{var C,A;k==null||k.set(x.attributes[R],x),r&&!((C=this.inclusionModeDefinition)!=null&&C.namedTypeDefinitions.get(h).members.has(x.attributes[R]))&&((A=this.inclusionModeDefinition)==null||A.namedTypeDefinitions.get(h).members.set(x.attributes[R],{id:x.attributes[R]}),ae(this.memberIdTypeLookup,x.attributes[R],()=>new Set).add(h))})}})().then(()=>{E(null)})});i.push(F),(M=this._processingCacheUpdatesLookup.get(h))==null||M.push(F)}await Promise.all(i)}removeFromLayer(a){var r,o,i;const t=new Set,s=new Set(a.map(n=>n.id));for(const n of a)t.add(n.typeName),((r=this.memberIdTypeLookup.get(n.id))==null?void 0:r.size)===1?this.memberIdTypeLookup.delete(n.id):(o=this.memberIdTypeLookup.get(n.id))==null||o.delete(n.typeName),(i=this.inclusionModeDefinition)==null||i.namedTypeDefinitions.forEach((d,p)=>{var m;p===n.typeName&&((m=d.members)!=null&&m.has(n.id))&&d.members.delete(n.id)});t.forEach(n=>{var d;(d=this.sublayerCaches.get(n))==null||d.forEach((p,m)=>{var u;s.has(m)&&((u=this.sublayerCaches.get(n))==null||u.delete(m))})})}async retrieveDataFromService(a,t,s){var M,h,D,F,E,Q,U,B,ee,v,P,J,z,V,W,Z,K;const r=De.getInstance(),o=new Set,i=[];let n,d="",p=[];const m=t.graphType==="relationship",u=(D=(h=(M=this.inclusionModeDefinition)==null?void 0:M.namedTypeDefinitions)==null?void 0:h.get(t.objectType.name))==null?void 0:D.useAllData,g=t.parentCompositeLayer.sublayerIdsCache.get(t.objectType.name);let b=!u&&g?Array.from(g).sort():null;if((Q=(E=(F=this.inclusionModeDefinition)==null?void 0:F.namedTypeDefinitions)==null?void 0:E.get(t.objectType.name))!=null&&Q.useAllData)(ee=(B=(U=this.inclusionModeDefinition)==null?void 0:U.namedTypeDefinitions)==null?void 0:B.get(t.objectType.name))!=null&&ee.useAllData&&a.objectIds!=null&&(b=a.objectIds);else if(a.objectIds!=null&&b&&b.length>0){const l=a.objectIds;a.objectIds=b.filter(y=>l.includes(y))}else if(a.objectIds!=null)b=a.objectIds;else{if((v=this.inclusionModeDefinition)!=null&&v.namedTypeDefinitions.has(t.objectType.name)&&(!((P=this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name))!=null&&P.members)||((z=(J=this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name))==null?void 0:J.members)==null?void 0:z.size)<1))return a.objectIds=[],[];a.objectIds=b}if(a.outFields!=null){const l=a.outFields;l.includes("*")?t.fields.forEach(y=>{o.add(y.name)}):l.forEach(y=>{y!==R&&y!==t.geometryFieldName&&o.add(y)})}if(a.geometry!=null){const l=a.geometry;let y;const c=t.parentCompositeLayer.dataManager.knowledgeGraph.serviceDefinition,I=c==null?void 0:c.spatialReference,N=(V=c==null?void 0:c.serviceCapabilities)==null?void 0:V.geometryCapabilities;let T=N==null?void 0:N.geometryMaxBoundingRectangleSizeX,k=N==null?void 0:N.geometryMaxBoundingRectangleSizeY;if((W=l==null?void 0:l.extent)!=null&&W.spatialReference&&!((Z=l.spatialReference)!=null&&Z.isWGS84)?(await at(l.extent.spatialReference,ue),y=Re(l.extent,ue)):y=l.extent,T&&k&&I){if(I.wkid!==4326){const x=new ce({spatialReference:I,xmax:T,ymax:k}),C=Re(x,ue);T=C.xmax,k=C.ymax}if(y.xmax-y.xmin>T)throw new te("knowledge-graph:layer-data-manager",`Extent x bounds should be within ${T}° latitude, limit exceeded`);if(y.ymax-y.ymin>k)throw new te("knowledge-graph:layer-data-manager",`Extent y bounds should be within ${k}° longitude, limit exceeded`)}if(a.where!=null&&a.where!=="1=1"){const x=await qe(a.where.toUpperCase(),t.fieldsIndex);t.fields.forEach(C=>{x.fieldNames.includes(C.name)&&o.add(C.name)})}d=m?`Match ()-[n:${t.objectType.name}]->() WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n), id(startNode(r)), id(endNode(r))`:`Match (n:${t.objectType.name}) WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n)`,t.geometryFieldName&&o.add(t.geometryFieldName),o.forEach(x=>{d+=`, n.${x}`,i.push(x)}),n=new ye({openCypherQuery:d,bindParameters:{param_filter_geom:new it({rings:$t(y)})}})}else{let l="";if(a.where!=null&&a.where!=="1=1"){const I=await qe(a.where,t.fieldsIndex);t.fields.forEach(C=>{I.fieldNames.includes(C.name)&&o.add(C.name)});const N=new Set(["column-reference","string","number","binary-expression"]),T=new Set(["=","<","<=","<>",">",">=","AND","OR","LIKE"]);let k=!1;const x=C=>{if(C.type==="column-reference")return`n.${C.column}`;if(C.type==="string")return`'${C.value}'`;if(C.type==="number")return`${C.value}`;if(C.type==="binary-expression"&&N.has(C.left.type)&&N.has(C.right.type)&&T.has(C.operator))return`${x(C.left)} ${C.operator} ${x(C.right)}`;if(C.type==="binary-expression"&&C.operator==="LIKE"){let A="";if(C.left.type==="function"&&C.left.args.value[0].type==="column-reference")A+=`lower(n.${C.left.args.value[0].column})`;else{if(C.left.type!=="column-reference")return k=!0,"";A+=`lower(n.${C.left.column})`}if(A+=" CONTAINS (",C.right.type!=="string")return k=!0,"";{let O=C.right.value;O.charAt(0)==="%"&&(O=O.slice(1)),O.charAt(O.length-1)==="%"&&(O=O.slice(0,-1)),A+=`'${O.toLowerCase()}')`}return A}return k=!0,""};l=x(I.parseTree),k&&(l="")}let y="";y=m?`Match ()-[n:${t.objectType.name}]->()`:`Match (n:${t.objectType.name})`;let c=!1;b&&(c=!0,y+=" WHERE ID(n) IN $ids"),l&&(y+=c?" AND":" WHERE",y+=` ${l}`),y+=" return ID(n)",m&&(y+=", id(startNode(n)), id(endNode(n))"),a.returnGeometry&&t.geometryFieldName&&o.add(t.geometryFieldName),o.forEach(I=>{y+=`, n.${I}`,i.push(I)}),n=new ye(b?{openCypherQuery:y,bindParameters:{ids:b}}:{openCypherQuery:y})}const f=(await be(t.parentCompositeLayer.dataManager.knowledgeGraph,n,s)).resultRowsStream.getReader();for(;;){const{done:l,value:y}=await f.read();if(l)break;const c=[];for(let I=0;I{let a=class extends e{constructor(){super(...arguments),this.fields=[],this.fieldsIndex=null}};return L([w(We.fields)],a.prototype,"fields",void 0),L([w(We.fieldsIndex)],a.prototype,"fieldsIndex",void 0),a=L([we("esri.layers.knowledgeGraphLayer.KnowledgeGraphSublayerBase")],a),a};let _=class extends It(Gt(nt(st(Nt(ot))))){constructor(e){var a,t,s,r,o;if(super(e),this.capabilities=xt(!1,!1),this.definitionExpression="",this.displayField="",this.elevationInfo=null,this.geometryType=null,this.geometryFieldName=null,this.graphType=null,this.hasM=!1,this.hasZ=!1,this.labelsVisible=null,this.labelingInfo=null,this.objectIdField=R,this.objectType=null,this.parentCompositeLayer=null,this.popupEnabled=!0,this.popupTemplate=null,this.source={openPorts:()=>this.load().then(()=>{const i=new MessageChannel;return new ut(i.port1,{channel:i,client:{queryFeatures:(n,d={})=>{const p=he.fromJSON(n);return this.queryFeaturesJSON(p,d)}}}),[i.port2]})},this.type="knowledge-graph-sublayer",e.parentCompositeLayer.type==="link-chart")e.graphType==="relationship"?this.geometryType="polyline":this.geometryType="point",this.geometryFieldName=G;else if((a=e.parentCompositeLayer.dataManager.geographicLookup.get(e.objectType.name))!=null&&a.geometryType&&((t=e.parentCompositeLayer.dataManager.geographicLookup.get(e.objectType.name))==null?void 0:t.geometryType)!=="esriGeometryNull"){const i=e.parentCompositeLayer.dataManager.geographicLookup.get(e.objectType.name);this.geometryFieldName=(i==null?void 0:i.name)??null,this.geometryType=i!=null&&i.geometryType?le.fromJSON(i.geometryType):null;const n=i==null?void 0:i.name,d=n?(s=e.objectType.properties)==null?void 0:s[n]:null;d?(this.hasM=d.hasM??!1,this.hasZ=d.hasZ??!1):(this.hasM=!1,this.hasZ=!1)}else this.geometryType=null;(r=e.objectType.properties)==null||r.forEach(i=>{let n=null,d=i.fieldType;d==="esriFieldTypeOID"&&(d="esriFieldTypeInteger"),this.fields.push(Me.fromJSON({name:i.name,type:d,alias:i.alias,defaultValue:n,editable:i.editable,nullable:i.nullable}))}),this.fields.push(Me.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1})),this.fields.push(Me.fromJSON({name:Ae,type:"esriFieldTypeInteger",alias:Ae,editable:!1})),this._set("fields",[...this.fields]),(o=e.parentCompositeLayer.dataManager.knowledgeGraph.dataModel)!=null&&o.spatialReference&&(this.spatialReference=e.parentCompositeLayer.dataManager.knowledgeGraph.dataModel.spatialReference),e.parentCompositeLayer.type==="link-chart"?e.graphType==="relationship"?this.renderer=Ee(xe(le.toJSON("polyline")).renderer):this.renderer=Ee(xe(le.toJSON("point")).renderer):this.renderer=Ee(xe(le.toJSON(this.geometryType)).renderer)}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){ct(e,this.fieldsIndex),this._set("renderer",e)}createPopupTemplate(e){return vt(this,e)}createQuery(){return new he({where:"1=1",outFields:["*"]})}getField(e){for(let a=0;a{o.sourceLayer=this}),r}async queryFeaturesJSON(e,a){const{resolvedQuery:t,queryEngine:s}=await this._setupQueryObjects(e);return await s.executeQuery(t.toJSON(),a==null?void 0:a.signal)}async queryFeatureCount(e,a){const{resolvedQuery:t,queryEngine:s}=await this._setupQueryObjects(e);return s.executeQueryForCount(t.toJSON(),a==null?void 0:a.signal)}async queryExtent(e={},a){var n,d,p,m;const t={...e,returnGeometry:!0},{resolvedQuery:s,queryEngine:r}=await this._setupQueryObjects(t),o=await r.executeQueryForExtent(s.toJSON(),a==null?void 0:a.signal);let i;return i=((n=o.extent)==null?void 0:n.xmin)!=null&&((d=o.extent)==null?void 0:d.xmax)!=null&&((p=o.extent)==null?void 0:p.ymin)!=null&&((m=o.extent)==null?void 0:m.ymax)!=null?new ce(o.extent):new ce,{count:o.count,extent:i}}async queryObjectIds(e,a){const t=he.from(e);let s;if(this.parentCompositeLayer.type==="link-chart"&&this._cachedQueryEngine)s=this._cachedQueryEngine;else{const r=await this.parentCompositeLayer.dataManager.getData(t,this,a);s=this.loadQueryEngine(r)}return s.executeQueryForIds(t.toJSON(),a==null?void 0:a.signal)}loadQueryEngine(e){const a=new Mt({geometryType:le.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),t=new Et({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:le.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,objectIdField:this.objectIdField,spatialReference:this.spatialReference.toJSON(),timeInfo:null,featureStore:a});return t.featureStore.addMany(e),t}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new he({where:"1=1",outFields:[R]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}async _setupQueryObjects(e,a){var o;const t=he.from(e),s=t.geometry;let r;if(s&&!((o=s.spatialReference)!=null&&o.isWGS84)&&(await at(s.spatialReference,ue),t.geometry=Re(s instanceof it||s instanceof ve?s:s.extent,ue)),this.parentCompositeLayer.type==="link-chart"&&this._cachedQueryEngine)r=this._cachedQueryEngine;else{const i=await this.parentCompositeLayer.dataManager.getData(t,this,a);r=this.loadQueryEngine(i)}return{resolvedQuery:t,queryEngine:r}}};L([w()],_.prototype,"capabilities",void 0),L([w({readOnly:!0})],_.prototype,"defaultPopupTemplate",null),L([w()],_.prototype,"definitionExpression",void 0),L([w()],_.prototype,"displayField",void 0),L([w()],_.prototype,"elevationInfo",void 0),L([w()],_.prototype,"geometryType",void 0),L([w()],_.prototype,"geometryFieldName",void 0),L([w()],_.prototype,"graphType",void 0),L([w()],_.prototype,"hasM",void 0),L([w()],_.prototype,"hasZ",void 0),L([w()],_.prototype,"labelsVisible",void 0),L([w()],_.prototype,"labelingInfo",void 0),L([w()],_.prototype,"objectIdField",void 0),L([w()],_.prototype,"objectType",void 0),L([w()],_.prototype,"parentCompositeLayer",void 0),L([w(mt)],_.prototype,"popupEnabled",void 0),L([w({type:ft,json:{name:"popupInfo",write:!0}})],_.prototype,"popupTemplate",void 0),L([w({types:Ct,json:{write:{target:"layerDefinition.drawingInfo.renderer"}}})],_.prototype,"renderer",null),L([w()],_.prototype,"source",void 0),L([w({json:{read:!1}})],_.prototype,"type",void 0),_=L([we("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],_);const Ie=_;let Ne,$=null;function Ft(){return Ne||(Ne=gt(()=>import("./lclayout-QKV44p2z.js"),__vite__mapDeps([0,1,2])).then(e=>e.l).then(({default:e})=>e({locateFile:a=>Tt(`esri/libs/linkchartlayout/${a}`)})).then(e=>{Ot(e)}),Ne)}function Ot(e){$=e}var X,ke;function pe(e,a,t,s,r,o){const i=t.length,n=r.length,d=Float64Array.BYTES_PER_ELEMENT,p=Uint32Array.BYTES_PER_ELEMENT,m=Uint8Array.BYTES_PER_ELEMENT,u=16,g=u-1+i*(m+2*d)+n*(2*p),b=$._malloc(g);try{const f=b+u-b%u,M=f+i*d,h=M+i*d,D=h+n*p,F=D+n*p,E=()=>[$.HEAPF64.subarray(f>>3,(f>>3)+i),$.HEAPF64.subarray(M>>3,(M>>3)+i),$.HEAPU32.subarray(h>>2,(h>>2)+n),$.HEAPU32.subarray(D>>2,(D>>2)+n),$.HEAPU8.subarray(F,F+i)],[Q,U,B,ee,v]=E();Q.set(t),U.set(s),B.set(r),ee.set(o),v.set(a);let P=e(i,F,f,M,n,h,D),J=null;if(P){const l=$.getLayoutLinksTypes(),y=$.getLayoutLinksVerticesEndIndices(),c=$.getLayoutLinksVertices(),I=$.countLayoutLinksVertices();!n||l&&y?I&&!c?P=!1:J={types:new Uint8Array($.HEAPU8.subarray(l,l+n)),vertexEndIndex:new Uint32Array($.HEAPU32.subarray(y>>2,(y>>2)+n)),vertices:new Float64Array($.HEAPF64.subarray(c>>3,(c>>3)+2*I))}:P=!1}const[z,V,W,Z,K]=E();return t.set(z),s.set(V),r.set(W),o.set(Z),a.set(K),{success:P,links:J}}finally{$._free(b),$.cleanupLayout()}}(function(e){e[e.None=0]="None",e[e.IsMovable=1]="IsMovable",e[e.IsGeographic=2]="IsGeographic",e[e.IsRoot=4]="IsRoot"})(X||(X={})),function(e){e[e.Regular=0]="Regular",e[e.Orthogonal=1]="Orthogonal",e[e.Curved=2]="Curved",e[e.Recursive=3]="Recursive"}(ke||(ke={}));const Ze=2,Ke=1,Xe=-1;var _e,$e,Se,Ge,Fe,Oe,et,tt;(function(e){function a(){return $.getMinIdealEdgeLength()}function t(s,r,o,i,n,d=Ze,p=Ke,m=Xe){return pe((u,g,b,f,M,h,D)=>$.applyForceDirectedLayout(u,g,b,f,M,h,D,d,p,m),s,r,o,i,n)}e.getMinIdealEdgeLength=a,e.apply=t})(_e||(_e={})),function(e){function a(t,s,r,o,i,n=Ze,d=Ke,p=Xe){return pe((m,u,g,b,f,M,h)=>$.applyCommunityLayout(m,u,g,b,f,M,h,n,d,p),t,s,r,o,i)}e.apply=a}($e||($e={})),function(e){function a(t,s,r,o,i){return pe($.applySimpleLayout,t,s,r,o,i)}e.apply=a}(Se||(Se={})),function(e){function a(t,s,r,o,i){return pe($.applyHierarchicalLayout,t,s,r,o,i)}e.apply=a}(Ge||(Ge={})),function(e){function a(t,s,r,o,i){return pe($.applyRadialTreeLayout,t,s,r,o,i)}e.apply=a}(Fe||(Fe={})),function(e){function a(t,s,r,o,i){return pe($.applySmartTreeLayout,t,s,r,o,i)}e.apply=a}(Oe||(Oe={})),function(e){e[e.Undirected=0]="Undirected",e[e.Directed=1]="Directed",e[e.Reversed=2]="Reversed"}(et||(et={})),function(e){e[e.ByCC_Raw=0]="ByCC_Raw",e[e.ByCC_NormalizeGlobally=1]="ByCC_NormalizeGlobally",e[e.ByCC_NormalizeByCC=2]="ByCC_NormalizeByCC"}(tt||(tt={}));const qt=(e,a,t)=>(e.has(a)||e.set(a,t()),e.get(a));let q=class extends nt(st(ot)){constructor(e){if(super(e),this.dataPreloadedInLocalCache=!1,this.defaultLinkChartConfig=null,this._currentLinkChartConfig={layoutMode:"RADIAL_TREE"},this._graphTypeLookup=new Map,this.dataManager=null,this.knowledgeGraph=null,this.layers=new Pe,this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map,this.linkChartExtent=new ce({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.linkChartGeohashLookup=new Map,this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.sublayerIdsCache=new Map,this.tables=new Pe,this.type="link-chart",this._originalInclusionList=e.inclusionModeDefinition,e.dataPreloadedInLocalCache&&!e.inclusionModeDefinition)throw new te("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it")}normalizeCtorArgs(e){return{url:e.url,title:e.title,dataPreloadedInLocalCache:e.dataPreloadedInLocalCache,defaultLinkChartConfig:e.defaultLinkChartConfig}}_initializeLayerProperties(e){var o,i,n,d,p,m;if(!this.title&&this.url){const u=this.url.split("/");this.title=u[u.length-2]}const a=new Set;let t=[],s=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new te("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");(o=e.knowledgeGraph.dataModel.entityTypes)==null||o.forEach(u=>{u.name&&this._graphTypeLookup.set(u.name,u)}),(i=e.knowledgeGraph.dataModel.relationshipTypes)==null||i.forEach(u=>{u.name&&this._graphTypeLookup.set(u.name,u)}),(n=e.inclusionModeDefinition)!=null&&n.generateAllSublayers?(t=e.knowledgeGraph.dataModel.entityTypes??[],s=e.knowledgeGraph.dataModel.relationshipTypes??[]):(d=e.inclusionModeDefinition)!=null&&d.namedTypeDefinitions&&((p=e.inclusionModeDefinition)==null?void 0:p.namedTypeDefinitions.size)>0?(m=e.inclusionModeDefinition)==null||m.namedTypeDefinitions.forEach((u,g)=>{var b,f;if(!this._graphTypeLookup.get(g))return de.getLogger(this).warn(`A named type, ${g}, was in the inclusion list that wasn't in the data model and will be removed`),void((b=e.inclusionModeDefinition)==null?void 0:b.namedTypeDefinitions.delete(g));this._graphTypeLookup.get(g)instanceof Lt||"strictOrigin"in this._graphTypeLookup.get(g)?a.has(g)||(a.add(g),s.push(this._graphTypeLookup.get(g))):this._graphTypeLookup.get(g)instanceof kt||"properties"in this._graphTypeLookup.get(g)?a.has(g)||(a.add(g),t.push(this._graphTypeLookup.get(g))):(de.getLogger(this).warn(`A named type, ${g}, was in the inclusion list that wasn't properly modeled and will be removed`),(f=e.inclusionModeDefinition)==null||f.namedTypeDefinitions.delete(g))}):(t=e.knowledgeGraph.dataModel.entityTypes??[],s=e.knowledgeGraph.dataModel.relationshipTypes??[]);const r=new H({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=t,this.memberRelationshipTypes=s,this.dataManager=r}load(e){return this.addResolvingPromise(new Promise(a=>{wt(this.url).then(t=>{var s,r,o,i,n,d;if(this._initializeLayerProperties({knowledgeGraph:t,inclusionModeDefinition:this._originalInclusionList}),(r=(s=this.dataManager.inclusionModeDefinition)==null?void 0:s.namedTypeDefinitions)!=null&&r.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},(o=this.dataManager.knowledgeGraph.dataModel.entityTypes)==null||o.forEach(p=>{var m;p.name&&((m=this.dataManager.inclusionModeDefinition)==null||m.namedTypeDefinitions.set(p.name,{useAllData:!0}))}),(i=this.dataManager.knowledgeGraph.dataModel.relationshipTypes)==null||i.forEach(p=>{var m;p.name&&((m=this.dataManager.inclusionModeDefinition)==null||m.namedTypeDefinitions.set(p.name,{useAllData:!0}))})),this.dataPreloadedInLocalCache)this.loadLayerAssumingLocalCache(),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),(n=this.dataManager.inclusionModeDefinition)==null||n.namedTypeDefinitions.forEach(p=>{var m;p.useAllData=!1,(m=p.members)==null||m.forEach(u=>{let g;g=u.linkChartLocation instanceof Ue?u.linkChartLocation:u.linkChartLocation?ie(u.linkChartLocation):null,g&&g.coords.length===2&&g.lengths.length===0?(this.linkChartGeohashLookup.set(u.id,se(g.coords[1],g.coords[0],oe)),this.entityLinkChartDiagramLookup.set(u.id,g)):(this.linkChartGeohashLookup.set(u.id,""),this.relationshipLinkChartDiagramLookup.set(u.id,g))}),this.addResolvingPromise(this._initializeDiagram().then(async()=>{this.layers.forEach(async u=>{await u.refreshCachedQueryEngine()}),this.tables.forEach(async u=>{await u.refreshCachedQueryEngine()})}))});else{const p=((d=this.defaultLinkChartConfig)==null?void 0:d.layoutMode)==="GEOGRAPHIC";this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,p,!0).then(async()=>{bt(e);const m=[],u=[];this.loadLayerAssumingLocalCache(),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1,this.dataManager.inclusionModeDefinition.namedTypeDefinitions.forEach(g=>{g.useAllData=!1})),await this._initializeDiagram(),this.layers.forEach(g=>{u.push(g.refreshCachedQueryEngine()),m.push(new Promise(b=>{g.on("layerview-create",()=>{b(null)})}))}),this.tables.forEach(g=>{u.push(g.refreshCachedQueryEngine())}),await Promise.all(u)}))}a(null)})})),Promise.resolve(this)}async addRecords(e,a){let t=[];a!=null&&a.cascadeAddRelationshipEndNodes&&this.dataManager.knowledgeGraph.dataModel&&(t=await St(e,this.dataManager.knowledgeGraph));const s=e.concat(t).filter(r=>{var o;return!((o=this.sublayerIdsCache.get(r.typeName))!=null&&o.has(r.id))});await this._handleNewRecords(s)}async removeRecords(e,{cascadeRemoveRelationships:a=!0,recalculateLayout:t=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1}){var o,i,n,d,p,m,u,g;let s=[];for(const b of e)((n=(i=(o=this.dataManager.inclusionModeDefinition)==null?void 0:o.namedTypeDefinitions)==null?void 0:i.get(b.typeName))==null?void 0:n.useAllData)===!1&&((u=(m=(p=(d=this.dataManager.inclusionModeDefinition)==null?void 0:d.namedTypeDefinitions)==null?void 0:p.get(b.typeName))==null?void 0:m.members)!=null&&u.has(b.id))&&s.push(b);if(a){const b=new Set,f=[];for(const M of s)if(this.dataManager.nodeConnectionsLookup.has(M.id))for(const h of this.dataManager.nodeConnectionsLookup.get(M.id))b.add(h);for(const M of b)if(this.dataManager.memberIdTypeLookup.has(M))for(const h of this.dataManager.memberIdTypeLookup.get(M))this.dataManager.relationshipTypeNames.has(h)&&f.push({id:M,typeName:h});s=s.concat(f)}this.dataManager.removeFromLayer(s);for(const b of s)(g=this.sublayerIdsCache.get(b.typeName))==null||g.delete(b.id),this.dataManager.relationshipTypeNames.has(b.typeName)?this.relationshipLinkChartDiagramLookup.delete(b.id):this.entityLinkChartDiagramLookup.delete(b.id);t&&await this.calculateLinkChartLayout(this._currentLinkChartConfig.layoutMode,{});const r=[];return this.layers.forEach(b=>{r.push(b.refreshCachedQueryEngine())}),await Promise.all(r),this._refreshNamedTypes(),s}async expand(e,a){const t=await this.dataManager.getConnectedRecordIds(e,a),s=t.filter(r=>{var o;return!((o=this.sublayerIdsCache.get(r.typeName))!=null&&o.has(r.id))});return await this._handleNewRecords(t),{records:s}}loadLayerAssumingLocalCache(){var e,a;this.memberRelationshipTypes.forEach(t=>{const s=new Ie({objectType:t,parentCompositeLayer:this,graphType:"relationship",title:t.name});s.geometryType?this.layers.push(s):this.tables.push(s),this.dataManager.sublayerCaches.has(t.name)||this.dataManager.sublayerCaches.set(t.name,new Map)}),this.memberEntityTypes.forEach(t=>{const s=new Ie({objectType:t,parentCompositeLayer:this,graphType:"entity",title:t.name});s.geometryType?this.layers.push(s):this.tables.push(s),this.dataManager.sublayerCaches.has(t.name)||this.dataManager.sublayerCaches.set(t.name,new Map)}),(e=this.dataManager.inclusionModeDefinition)!=null&&e.namedTypeDefinitions&&((a=this.dataManager.inclusionModeDefinition)==null||a.namedTypeDefinitions.forEach((t,s)=>{var o;const r=qt(this.sublayerIdsCache,s,()=>new Set);(o=t.members)==null||o.forEach(i=>{if(r.add(i.id),i.linkChartLocation)if(i.linkChartLocation instanceof Ue)this.dataManager.relationshipTypeNames.has(s)?this.relationshipLinkChartDiagramLookup.set(i.id,i.linkChartLocation):this.entityLinkChartDiagramLookup.set(i.id,i.linkChartLocation),i.linkChartLocation.coords.length===2&&i.linkChartLocation.lengths.length===0?this.linkChartGeohashLookup.set(i.id,se(i.linkChartLocation.coords[1],i.linkChartLocation.coords[0],oe)):this.linkChartGeohashLookup.set(i.id,"");else{const n=ie(i.linkChartLocation);this.dataManager.relationshipTypeNames.has(s)?this.relationshipLinkChartDiagramLookup.set(i.id,i.linkChartLocation?n:null):this.entityLinkChartDiagramLookup.set(i.id,i.linkChartLocation?n:null),"x"in i.linkChartLocation&&"y"in i.linkChartLocation?this.linkChartGeohashLookup.set(i.id,se(i.linkChartLocation.x,i.linkChartLocation.y,oe)):this.linkChartGeohashLookup.set(i.id,"")}})}))}async calculateLinkChartLayout(e="RADIAL_TREE",a){var W,Z,K;const t=[],s=[],r=[];this.dataManager.sublayerCaches.forEach((l,y)=>{this.dataManager.entityTypeNames.has(y)?l.forEach(c=>{t.push({typeName:y,feature:c})}):this.dataManager.relationshipTypeNames.has(y)&&l.forEach(c=>{s.push({typeName:y,feature:c})})}),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map;const o=new Map,i=new Map,n=new Map,d=new Map,p=new Uint8Array(t.length),m=new Float64Array(t.length),u=new Float64Array(t.length),g=new Uint32Array(s.length),b=new Uint32Array(s.length),f=[],M="FORCE_DIRECTED",h=new ce({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let D,F="FORCE_DIRECTED",E=0,Q=0;switch(F=e==="GEOGRAPHIC"?M:e,F){case"FORCE_DIRECTED":D=_e.apply;break;case"COMMUNITY":D=$e.apply;break;case"HIERARCHICAL":D=Ge.apply;break;case"RADIAL_TREE":D=Fe.apply;break;case"SMART_TREE":D=Oe.apply;break;default:D=Se.apply}t.forEach(({typeName:l,feature:y})=>{var c,I,N;if((c=a==null?void 0:a.lockedNodeLocations)!=null&&c.has(y.attributes[R])){e==="GEOGRAPHIC"&&this.dataManager.geographicLookup.has(l)?p[E]=X.IsGeographic:p[E]=X.None;const T=a.lockedNodeLocations.get(y.attributes[R]);m[E]=T.x,u[E]=T.y}else if(e==="GEOGRAPHIC"&&this.dataManager.geographicLookup.has(l)){p[E]=X.IsGeographic;let T=null;const k=y.attributes[this.dataManager.geographicLookup.get(l).name];switch((I=this.dataManager.geographicLookup.get(l))==null?void 0:I.geometryType){case"esriGeometryPoint":m[E]=k==null?void 0:k.x,u[E]=k==null?void 0:k.y;break;case"esriGeometryPolygon":T=k==null?void 0:k.centroid,(T==null?void 0:T.x)!=null&&(T==null?void 0:T.y)!=null?(m[E]=T.x,u[E]=T.y):p[E]=X.IsMovable;break;case"esriGeometryPolyline":case"esriGeometryMultipoint":T=(N=k==null?void 0:k.extent)==null?void 0:N.center,(T==null?void 0:T.x)!=null&&(T==null?void 0:T.y)!=null?(m[E]=T.x,u[E]=T.y):p[E]=X.IsMovable;break;default:p[E]=X.IsMovable}(m[E]==null||u[E]==null||Number.isNaN(m[E])||Number.isNaN(u[E]))&&(p[E]=X.IsMovable,m[E]=0,u[E]=0)}else p[E]=X.IsMovable,m[E]=0,u[E]=0;d.set(y.attributes[R],E),f[E]={feature:y,typeName:l},E++});let U=!1;const B=new Map;s.forEach(l=>{const y=l.feature.attributes[ge],c=l.feature.attributes[Te],I=d.get(y),N=d.get(c);if(I!==void 0&&N!==void 0){const T=y+"-"+c,k=B.get(T);(k==null?void 0:k.has(l.typeName))||(g[Q]=I,b[Q]=N,k===void 0?B.set(T,new Map([[l.typeName,Q]])):k.set(l.typeName,Q),Q++),r.push(l)}else U=!0,this.relationshipLinkChartDiagramLookup.set(y,null),this.linkChartGeohashLookup.set(y,null)}),U&&de.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null"),await Ft();const{success:ee,links:v}=D(p,m,u,g.subarray(0,Q),b.subarray(0,Q));if(!ee)throw new te("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");for(let l=0;l84.9999?u[l]=84.9999:u[l]<-84.9999&&(u[l]=-84.9999),m[l]>179.9999?m[l]=179.9999:m[l]<-179.9999&&(m[l]=-179.9999),f[l].feature.attributes[G]=new je(m[l],u[l]),o.has(f[l].typeName)){const c=o.get(f[l].typeName);c==null||c.set(f[l].feature.attributes[R],f[l].feature)}else{const c=new Map;c.set(f[l].feature.attributes[R],f[l].feature),o.set(f[l].typeName,c)}n.set(f[l].feature.attributes[R],f[l].feature);const y=ie(f[l].feature.attributes[G]);this.entityLinkChartDiagramLookup.set(f[l].feature.attributes[R],f[l].feature.attributes[G]?y:null),this.linkChartGeohashLookup.set(f[l].feature.attributes[R],se(f[l].feature.attributes[G].y,f[l].feature.attributes[G].x,oe)),f[l].feature.attributes[G].xh.xmax&&(h.xmax=f[l].feature.attributes[G].x),f[l].feature.attributes[G].yh.ymax&&(h.ymax=f[l].feature.attributes[G].y)}if(this.linkChartExtent.xmin=h.xmin,this.linkChartExtent.xmax=h.xmax,this.linkChartExtent.ymin=h.ymin,this.linkChartExtent.ymax=h.ymax,!v)throw new te("knowledge-graph:layout-failed","Attempting to retrieve link geometry from diagram engine failed");const P=new Map,J=new Map,z=new Map,V=new Set;for(let l=0;l85.5?y[S][1]=85.5:y[S][1]<-85.5&&(y[S][1]=-85.5),y[S][0]>179.9999?y[S][0]=179.9999:y[S][0]<-179.9999&&(y[S][0]=-179.9999);P.has(T)?P.get(T).push(y):P.set(T,[y])}const C=P.get(T);J.has(T)||(J.set(T,new Map),z.set(T,new Map));const A=J.get(T),O=z.get(T);A.has(c.typeName)||(A.set(c.typeName,C.shift()),O.set(c.typeName,0));const j=A.get(c.typeName);O.set(c.typeName,O.get(c.typeName)+1);const rt=new ve({paths:j});if(c.feature.attributes[G]=rt,i.has(c.typeName)){const Y=i.get(c.typeName);Y==null||Y.set(c.feature.attributes[R],c.feature)}else{const Y=new Map;Y.set(c.feature.attributes[R],c.feature),i.set(c.typeName,Y)}n.set(c.feature.attributes[R],c.feature);const lt=ie(c.feature.attributes[G]);this.relationshipLinkChartDiagramLookup.set(c.feature.attributes[R],c.feature.attributes[G]?lt:null),this.linkChartGeohashLookup.set(c.feature.attributes[R],"")}for(const l of r)l.feature.attributes[Ae]=((K=z.get(l.feature.attributes[ge]+"-"+l.feature.attributes[Te]))==null?void 0:K.get(l.typeName))??null;return this._currentLinkChartConfig={layoutMode:e},{nodes:o,links:i,idMap:n}}async applyNewLinkChartLayout(e="RADIAL_TREE",a){const t=[];await this.calculateLinkChartLayout(e,a),this.layers.forEach(s=>{t.push(s.refreshCachedQueryEngine())}),await Promise.all(t),this._refreshNamedTypes()}getCurrentNodeLocations(){var a,t;const e=new Map;return(t=(a=this.dataManager.inclusionModeDefinition)==null?void 0:a.namedTypeDefinitions)==null||t.forEach(s=>{var r;(r=s==null?void 0:s.members)==null||r.forEach(o=>{const i=o.linkChartLocation;let n;const d=o.id;i&&(n="x"in i?{x:i.x,y:i.y}:{x:i.coords[0],y:i.coords[1]},e.set(d,new je({x:n.x,y:n.y})))})}),e}async synchronizeInclusionListWithCache(){return new Promise(e=>{var a;(a=this.dataManager.inclusionModeDefinition)==null||a.namedTypeDefinitions.forEach((t,s)=>{if(t.useAllData=!1,t.members&&t.members.size>0){if(!this.dataManager.sublayerCaches.get(s))return;const r=new Set(Array.from(this.dataManager.sublayerCaches.get(s).keys()));Array.from(t.members.keys()).filter(o=>!r.has(o)).forEach(o=>{var i;(i=t.members)==null||i.delete(o)})}}),e()})}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const a=[];this.layers.forEach(t=>{a.push(t.refreshCachedQueryEngine())}),await Promise.all(a),this._refreshNamedTypes()}async _handleNewRecords(e){const a=[];this.dataManager.addToLayer(e);for(const t of e)this.sublayerIdsCache.has(t.typeName)||(this.sublayerIdsCache.set(t.typeName,new Set),a.push(t.typeName)),this.sublayerIdsCache.get(t.typeName).add(t.id);for(const t of a)if(this._graphTypeLookup.has(t)){const s=this._graphTypeLookup.get(t),r="endPoints"in s?"relationship":"entity",o=new Ie({objectType:s,parentCompositeLayer:this,graphType:r,title:t});r==="entity"?this.dataManager.entityTypeNames.add(t):this.dataManager.relationshipTypeNames.add(t),o.geometryType?this.layers.push(o):this.tables.push(o),this.dataManager.sublayerCaches.set(t,new Map)}await this.dataManager.refreshCacheContent(e.map(t=>t.id)),await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode)}async _initializeDiagram(){var e,a;this.defaultLinkChartConfig?this.defaultLinkChartConfig.doNotRecalculateLayout?((a=(e=this.dataManager.inclusionModeDefinition)==null?void 0:e.namedTypeDefinitions)==null||a.forEach((t,s)=>{var r;(r=t==null?void 0:t.members)==null||r.forEach(o=>{const i=o.linkChartLocation;let n;const d=o.id;if(!i)return;n="x"in i?{x:i.x,y:i.y}:{x:i.coords[0],y:i.coords[1]};const p=ie(n);this.dataManager.relationshipTypeNames.has(s)?this.relationshipLinkChartDiagramLookup.set(d,p):this.entityLinkChartDiagramLookup.set(d,p),this.linkChartGeohashLookup.set(d,se(n.x,n.y,oe)),this.linkChartExtent.xmin>n.x&&(this.linkChartExtent.xmin=n.x),this.linkChartExtent.xmaxn.y&&(this.linkChartExtent.ymin=n.y),this.linkChartExtent.ymax{var s;t.name&&((s=this.dataManager.sublayerCaches.get(t.name))==null||s.forEach(r=>{const o=this.relationshipLinkChartDiagramLookup.get(r.attributes[ge]),i=this.relationshipLinkChartDiagramLookup.get(r.attributes[Te]);if(o&&i){const n=ie(new ve({paths:[[o.coords[0],o.coords[1]],[i.coords[0],i.coords[1]]]}));this.relationshipLinkChartDiagramLookup.set(r.attributes[R],n)}else this.relationshipLinkChartDiagramLookup.set(r.attributes[R],null);this.linkChartGeohashLookup.set(r.attributes[R],"")}))})):await this.calculateLinkChartLayout(this.defaultLinkChartConfig.layoutMode,{lockedNodeLocations:this.getCurrentNodeLocations()}):await this.calculateLinkChartLayout("RADIAL_TREE",{lockedNodeLocations:this.getCurrentNodeLocations()})}_refreshNamedTypes(){for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}};L([w()],q.prototype,"dataPreloadedInLocalCache",void 0),L([w()],q.prototype,"defaultLinkChartConfig",void 0),L([w()],q.prototype,"dataManager",void 0),L([w()],q.prototype,"knowledgeGraph",void 0),L([w()],q.prototype,"layers",void 0),L([w()],q.prototype,"entityLinkChartDiagramLookup",void 0),L([w()],q.prototype,"relationshipLinkChartDiagramLookup",void 0),L([w()],q.prototype,"linkChartExtent",void 0),L([w()],q.prototype,"linkChartGeohashLookup",void 0),L([w()],q.prototype,"memberEntityTypes",void 0),L([w()],q.prototype,"memberRelationshipTypes",void 0),L([w()],q.prototype,"sublayerIdsCache",void 0),L([w()],q.prototype,"tables",void 0),L([w({json:{read:!1}})],q.prototype,"type",void 0),q=L([we("esri.layers.LinkChartLayer")],q);const Oa=q;export{Oa as default}; diff --git a/assets/Lyr3DWorker-pyatxP09.js b/assets/Lyr3DWorker-DhzMvWrO.js similarity index 93% rename from assets/Lyr3DWorker-pyatxP09.js rename to assets/Lyr3DWorker-DhzMvWrO.js index 5067c3d..c0e1b13 100644 --- a/assets/Lyr3DWorker-pyatxP09.js +++ b/assets/Lyr3DWorker-DhzMvWrO.js @@ -1,7 +1,7 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/lyr3DWorker-BxsCtwuN.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css"] + __vite__mapDeps.viteFileDeps = ["assets/lyr3DWorker-CH63Ctm0.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{_ as M,gZ as y}from"./index-CEWggaxV.js";var p,g,N,f,d,m,S,b,I,U,L,h,R,T,a;(function(t){t.U8="U8",t.I8="I8",t.U16="U16",t.I16="I16",t.U32="U32",t.I32="I32",t.F32="F32",t.F64="F64",t.Utf8String="Utf8String",t.NotSet="NotSet"})(p||(p={})),function(t){t.Png="Png",t.Jpeg="Jpeg",t.Dds="Dds",t.Raw="Raw",t.Dxt1="Dxt1",t.Dxt5="Dxt5",t.Etc2="Etc2",t.Astc="Astc",t.Pvrtc="Pvrtc",t.NotSet="NotSet"}(g||(g={})),function(t){t.Rgb8="Rgb8",t.Rgba8="Rgba8",t.R8="R8",t.Bgr8="Bgr8",t.Bgra8="Bgra8",t.Rg8="Rg8",t.NotSet="NotSet"}(N||(N={})),function(t){t.Position="Position",t.Normal="Normal",t.TexCoord="TexCoord",t.Color="Color",t.Tangent="Tangent",t.FeatureIndex="FeatureIndex",t.UvRegion="UvRegion",t.NotSet="NotSet"}(f||(f={})),function(t){t.Opaque="Opaque",t.Mask="Mask",t.Blend="Blend"}(d||(d={})),function(t){t.None="None",t.Mask="Mask",t.Alpha="Alpha",t.PreMultAlpha="PreMultAlpha",t.NotSet="NotSet"}(m||(m={})),function(t){t.Points="Points",t.Lines="Lines",t.LineStrip="LineStrip",t.Triangles="Triangles",t.TriangleStrip="TriangleStrip",t.NotSet="NotSet"}(S||(S={})),function(t){t.None="None",t.WrapXBit="WrapXBit",t.WrapYBit="WrapYBit",t.WrapXy="WrapXy",t.NotSet="NotSet"}(b||(b={})),function(t){t.Linear="Linear",t.Nearest="Nearest",t.NotSet="NotSet"}(I||(I={})),function(t){t.Linear="Linear",t.Nearest="Nearest",t.NearestMipmapNearest="NearestMipmapNearest",t.LinearMipmapNearest="LinearMipmapNearest",t.NearestMipmapLinear="NearestMipmapLinear",t.LinearMipmapLinear="LinearMipmapLinear",t.NotSet="NotSet"}(U||(U={})),function(t){t.FeatureId="FeatureId",t.GlobalUid="GlobalUid",t.UnspecifiedDateTime="UnspecifiedDateTime",t.EcmaIso8601DateTime="EcmaIso8601DateTime",t.EcmaIso8601DateOnly="EcmaIso8601DateOnly",t.TimeOnly="TimeOnly",t.TimeStamp="TimeStamp",t.ColorRgb="ColorRgb",t.ColorRgba="ColorRgba",t.Unrecognized="Unrecognized",t.NotSet="NotSet"}(L||(L={})),function(t){t.Texture="Texture",t.VertexAtrb="VertexAtrb",t.Implicit="Implicit",t.NotSet="NotSet"}(h||(h={})),function(t){t.Front="Front",t.Back="Back",t.None="None",t.NotSet="NotSet"}(R||(R={})),function(t){t.Pbr="Pbr",t.Unlit="Unlit"}(T||(T={})),function(t){t[t.Succeeded=0]="Succeeded",t[t.Failed=1]="Failed",t[t.MissingInputs=2]="MissingInputs"}(a||(a={}));function D(){return new Promise(t=>M(()=>import("./lyr3DWorker-BxsCtwuN.js"),__vite__mapDeps([0,1,2])).then(r=>r.l).then(({default:r})=>{const n=r({locateFile:P,onRuntimeInitialized:()=>t(n)})})).catch(t=>{throw t})}function P(t){return y(`esri/libs/lyr3d/${t}`)}let o,e;async function x(t){if(await _(),t.inputs.length<1)return{result:{status:a.Failed,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[]},transferList:[]};const r={ptrs:[],sizes:[]};for(const i of t.inputs){const c=e._malloc(i.byteLength);new Uint8Array(e.HEAPU8.buffer,c,i.byteLength).set(new Uint8Array(i)),r.ptrs.push(c),r.sizes.push(i.byteLength)}const n=e.process(t.jobDescJson,r,t.isMissingResourceCase),l=n.status===a.Succeeded&&n.data,u=n.status===a.MissingInputs&&n.missingInputUrls.length>0;if(l){const i=n.data.slice();n.data=i}else u&&(n.jobDescJson=n.jobDescJson.slice(0),n.originalInputs=t.inputs);for(let i=0;i{e=t,e.initialize_lyr3d_worker_wasm(),o=null})),o)}export{A as destroyWasm,_ as initialize,x as process}; +import{_ as M,gZ as y}from"./index-BjUNJPVf.js";var p,g,N,f,d,m,S,b,I,U,L,h,R,T,a;(function(t){t.U8="U8",t.I8="I8",t.U16="U16",t.I16="I16",t.U32="U32",t.I32="I32",t.F32="F32",t.F64="F64",t.Utf8String="Utf8String",t.NotSet="NotSet"})(p||(p={})),function(t){t.Png="Png",t.Jpeg="Jpeg",t.Dds="Dds",t.Raw="Raw",t.Dxt1="Dxt1",t.Dxt5="Dxt5",t.Etc2="Etc2",t.Astc="Astc",t.Pvrtc="Pvrtc",t.NotSet="NotSet"}(g||(g={})),function(t){t.Rgb8="Rgb8",t.Rgba8="Rgba8",t.R8="R8",t.Bgr8="Bgr8",t.Bgra8="Bgra8",t.Rg8="Rg8",t.NotSet="NotSet"}(N||(N={})),function(t){t.Position="Position",t.Normal="Normal",t.TexCoord="TexCoord",t.Color="Color",t.Tangent="Tangent",t.FeatureIndex="FeatureIndex",t.UvRegion="UvRegion",t.NotSet="NotSet"}(f||(f={})),function(t){t.Opaque="Opaque",t.Mask="Mask",t.Blend="Blend"}(d||(d={})),function(t){t.None="None",t.Mask="Mask",t.Alpha="Alpha",t.PreMultAlpha="PreMultAlpha",t.NotSet="NotSet"}(m||(m={})),function(t){t.Points="Points",t.Lines="Lines",t.LineStrip="LineStrip",t.Triangles="Triangles",t.TriangleStrip="TriangleStrip",t.NotSet="NotSet"}(S||(S={})),function(t){t.None="None",t.WrapXBit="WrapXBit",t.WrapYBit="WrapYBit",t.WrapXy="WrapXy",t.NotSet="NotSet"}(b||(b={})),function(t){t.Linear="Linear",t.Nearest="Nearest",t.NotSet="NotSet"}(I||(I={})),function(t){t.Linear="Linear",t.Nearest="Nearest",t.NearestMipmapNearest="NearestMipmapNearest",t.LinearMipmapNearest="LinearMipmapNearest",t.NearestMipmapLinear="NearestMipmapLinear",t.LinearMipmapLinear="LinearMipmapLinear",t.NotSet="NotSet"}(U||(U={})),function(t){t.FeatureId="FeatureId",t.GlobalUid="GlobalUid",t.UnspecifiedDateTime="UnspecifiedDateTime",t.EcmaIso8601DateTime="EcmaIso8601DateTime",t.EcmaIso8601DateOnly="EcmaIso8601DateOnly",t.TimeOnly="TimeOnly",t.TimeStamp="TimeStamp",t.ColorRgb="ColorRgb",t.ColorRgba="ColorRgba",t.Unrecognized="Unrecognized",t.NotSet="NotSet"}(L||(L={})),function(t){t.Texture="Texture",t.VertexAtrb="VertexAtrb",t.Implicit="Implicit",t.NotSet="NotSet"}(h||(h={})),function(t){t.Front="Front",t.Back="Back",t.None="None",t.NotSet="NotSet"}(R||(R={})),function(t){t.Pbr="Pbr",t.Unlit="Unlit"}(T||(T={})),function(t){t[t.Succeeded=0]="Succeeded",t[t.Failed=1]="Failed",t[t.MissingInputs=2]="MissingInputs"}(a||(a={}));function D(){return new Promise(t=>M(()=>import("./lyr3DWorker-CH63Ctm0.js"),__vite__mapDeps([0,1,2])).then(r=>r.l).then(({default:r})=>{const n=r({locateFile:P,onRuntimeInitialized:()=>t(n)})})).catch(t=>{throw t})}function P(t){return y(`esri/libs/lyr3d/${t}`)}let o,e;async function x(t){if(await _(),t.inputs.length<1)return{result:{status:a.Failed,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[]},transferList:[]};const r={ptrs:[],sizes:[]};for(const i of t.inputs){const c=e._malloc(i.byteLength);new Uint8Array(e.HEAPU8.buffer,c,i.byteLength).set(new Uint8Array(i)),r.ptrs.push(c),r.sizes.push(i.byteLength)}const n=e.process(t.jobDescJson,r,t.isMissingResourceCase),l=n.status===a.Succeeded&&n.data,u=n.status===a.MissingInputs&&n.missingInputUrls.length>0;if(l){const i=n.data.slice();n.data=i}else u&&(n.jobDescJson=n.jobDescJson.slice(0),n.originalInputs=t.inputs);for(let i=0;i{e=t,e.initialize_lyr3d_worker_wasm(),o=null})),o)}export{A as destroyWasm,_ as initialize,x as process}; diff --git a/assets/MagnifierPrograms-B5-grLP-.js b/assets/MagnifierPrograms-Dy7jbVaV.js similarity index 99% rename from assets/MagnifierPrograms-B5-grLP-.js rename to assets/MagnifierPrograms-Dy7jbVaV.js index c763e6c..595eaf4 100644 --- a/assets/MagnifierPrograms-B5-grLP-.js +++ b/assets/MagnifierPrograms-Dy7jbVaV.js @@ -1,3 +1,3 @@ -import{c as b}from"./WGLContainer-B_Pv-8Yi.js";import{t as wt}from"./CircularArray-DfLrgW_-.js";import{E as ot,ca as yt,kl as B,I as x,iq as Mt,km as bt,a7 as E,d as _,y as v,f as R,kn as lt,fY as xt,cy as pt,fg as Tt,gL as $t,cW as gt,ko as H,aA as Q,p as vt,kp as X,kq as St,cz as Ct,fj as st,kr as Dt,ks as Vt,kt as zt,fU as q,ku as Et,kv as nt,kw as Rt,kx as Lt,u as O,ky as ut}from"./index-CEWggaxV.js";import{a as kt}from"./testSVGPremultipliedAlpha-B0ipOzbU.js";import{t as It}from"./AttributeStore-Ck-75lnq.js";import{e as At}from"./ProgramTemplate-BICQrNzS.js";const ie={shaders:{vertexShader:b("bitBlit/bitBlit.vert"),fragmentShader:b("bitBlit/bitBlit.frag")},attributes:new Map([["a_pos",0],["a_tex",1]])},se={shaders:{vertexShader:b("stencil/stencil.vert"),fragmentShader:b("stencil/stencil.frag")},attributes:new Map([["a_pos",0]])},ne={shaders:{vertexShader:b("highlight/textured.vert"),fragmentShader:b("highlight/highlight.frag")},attributes:new Map([["a_position",0],["a_texcoord",1]])},oe={shaders:{vertexShader:b("highlight/textured.vert"),fragmentShader:b("highlight/blur.frag")},attributes:new Map([["a_position",0],["a_texcoord",1]])},w=ot("esri-2d-profiler");let ae=class{constructor(t,e){if(this._events=new yt,this._entries=new Map,this._timings=new wt(10),this._currentContainer=null,this._currentPass=null,this._currentBrush=null,this._currentSummary=null,!w)return;this._ext=kt(t.gl,{}),this._debugOutput=e;const i=t.gl;if(!this.enableCommandLogging)return;let s;for(s in i)if(typeof i[s]=="function"){const n=i[s],r=s.includes("draw");i[s]=(...h)=>(this._events.emit("command",{container:this._currentContainer,pass:this._currentPass,brush:this._currentBrush,method:s,args:h,isDrawCommand:r}),this._currentSummary&&(this._currentSummary.commands++,r&&this._currentSummary.drawCommands++),n.apply(i,h))}}get enableCommandLogging(){return!(typeof w=="object"&&w.disableCommands)}recordContainerStart(t){w&&(this._currentContainer=t)}recordContainerEnd(){w&&(this._currentContainer=null)}recordPassStart(t){w&&(this._currentPass=t,this._initSummary())}recordPassEnd(){w&&(this._currentPass=null,this._emitSummary())}recordBrushStart(t){w&&(this._currentBrush=t)}recordBrushEnd(){w&&(this._currentBrush=null)}recordStart(t){if(w&&this._ext!=null){if(this._entries.has(t)){const i=this._entries.get(t),s=this._ext.resultAvailable(i.query),n=this._ext.disjoint();if(s&&!n){const r=this._ext.getResult(i.query)/1e6;let h=0;if(this._timings.enqueue(r)!=null){const l=this._timings.entries,c=l.length;let p=0;for(const m of l)p+=m;h=p/c}const o=r.toFixed(2),u=h?h.toFixed(2):"--";this.enableCommandLogging?(console.groupCollapsed(`Frame report for ${t}, ${o} ms (${u} last 10 avg) +import{c as b}from"./WGLContainer-DgZNq7b0.js";import{t as wt}from"./CircularArray-DfLrgW_-.js";import{E as ot,ca as yt,kl as B,I as x,iq as Mt,km as bt,a7 as E,d as _,y as v,f as R,kn as lt,fY as xt,cy as pt,fg as Tt,gL as $t,cW as gt,ko as H,aA as Q,p as vt,kp as X,kq as St,cz as Ct,fj as st,kr as Dt,ks as Vt,kt as zt,fU as q,ku as Et,kv as nt,kw as Rt,kx as Lt,u as O,ky as ut}from"./index-BjUNJPVf.js";import{a as kt}from"./testSVGPremultipliedAlpha-BUMQhQ4O.js";import{t as It}from"./AttributeStore-Bm6hLtR1.js";import{e as At}from"./ProgramTemplate-Ck2I0bIi.js";const ie={shaders:{vertexShader:b("bitBlit/bitBlit.vert"),fragmentShader:b("bitBlit/bitBlit.frag")},attributes:new Map([["a_pos",0],["a_tex",1]])},se={shaders:{vertexShader:b("stencil/stencil.vert"),fragmentShader:b("stencil/stencil.frag")},attributes:new Map([["a_pos",0]])},ne={shaders:{vertexShader:b("highlight/textured.vert"),fragmentShader:b("highlight/highlight.frag")},attributes:new Map([["a_position",0],["a_texcoord",1]])},oe={shaders:{vertexShader:b("highlight/textured.vert"),fragmentShader:b("highlight/blur.frag")},attributes:new Map([["a_position",0],["a_texcoord",1]])},w=ot("esri-2d-profiler");let ae=class{constructor(t,e){if(this._events=new yt,this._entries=new Map,this._timings=new wt(10),this._currentContainer=null,this._currentPass=null,this._currentBrush=null,this._currentSummary=null,!w)return;this._ext=kt(t.gl,{}),this._debugOutput=e;const i=t.gl;if(!this.enableCommandLogging)return;let s;for(s in i)if(typeof i[s]=="function"){const n=i[s],r=s.includes("draw");i[s]=(...h)=>(this._events.emit("command",{container:this._currentContainer,pass:this._currentPass,brush:this._currentBrush,method:s,args:h,isDrawCommand:r}),this._currentSummary&&(this._currentSummary.commands++,r&&this._currentSummary.drawCommands++),n.apply(i,h))}}get enableCommandLogging(){return!(typeof w=="object"&&w.disableCommands)}recordContainerStart(t){w&&(this._currentContainer=t)}recordContainerEnd(){w&&(this._currentContainer=null)}recordPassStart(t){w&&(this._currentPass=t,this._initSummary())}recordPassEnd(){w&&(this._currentPass=null,this._emitSummary())}recordBrushStart(t){w&&(this._currentBrush=t)}recordBrushEnd(){w&&(this._currentBrush=null)}recordStart(t){if(w&&this._ext!=null){if(this._entries.has(t)){const i=this._entries.get(t),s=this._ext.resultAvailable(i.query),n=this._ext.disjoint();if(s&&!n){const r=this._ext.getResult(i.query)/1e6;let h=0;if(this._timings.enqueue(r)!=null){const l=this._timings.entries,c=l.length;let p=0;for(const m of l)p+=m;h=p/c}const o=r.toFixed(2),u=h?h.toFixed(2):"--";this.enableCommandLogging?(console.groupCollapsed(`Frame report for ${t}, ${o} ms (${u} last 10 avg) ${i.commandsLen} Commands (${i.drawCommands} draw)`),console.log("RenderPass breakdown: "),console.table(i.summaries),console.log("Commands: ",i.commands),console.groupEnd()):console.log(`Frame report for ${t}, ${o} ms (${u} last 10 avg)`),this._debugOutput.innerHTML=`${o} (${u})`}for(const r of i.handles)r.remove();this._ext.deleteQuery(i.query),this._entries.delete(t)}const e={name:t,query:this._ext.createQuery(),commands:[],commandsLen:0,drawCommands:0,summaries:[],handles:[]};this.enableCommandLogging&&(e.handles.push(this._events.on("command",i=>{e.commandsLen++,e.commands.push(i),i.isDrawCommand&&e.drawCommands++})),e.handles.push(this._events.on("summary",i=>{e.summaries.push(i)}))),this._ext.beginTimeElapsed(e.query),this._entries.set(t,e)}}recordEnd(t){w&&this._ext!=null&&this._entries.has(t)&&this._ext.endTimeElapsed()}_initSummary(){this.enableCommandLogging&&(this._currentSummary={container:this._currentContainer,pass:this._currentPass,drawCommands:0,commands:0})}_emitSummary(){this.enableCommandLogging&&this._currentSummary&&this._events.emit("summary",this._currentSummary)}};const y=1,j=0,Z=1,N=2;let Ft=class{constructor(t,e,i){this._debugMap=new Map,this._width=t*i,this._height=e*i,this._pixelRatio=i;const s=Math.ceil(this._width/y),n=Math.ceil(this._height/y);this._cols=s,this._rows=n,this._cells=It.create(s*n)}insertMetrics(t){this._markMetrics(t)}hasCollision(t){let e=0;for(const{computedX:i,computedY:s,width:n,height:r}of t.bounds){const h=(n+B)*this._pixelRatio,o=(r+B)*this._pixelRatio;switch(this._collide(i,s,h,o)){case N:return N;case Z:e++}}return e===t.bounds.length?Z:j}getCellId(t,e){return t+e*this._cols}has(t){return this._cells.has(t)}hasRange(t,e){return this._cells.hasRange(t,e)}set(t){this._cells.set(t)}setRange(t,e){this._cells.setRange(t,e)}_collide(t,e,i,s){const n=t-i/2,r=e-s/2,h=n+i,o=r+s;if(h<0||o<0||n>this._width||r>this._height)return Z;const u=x(Math.floor(n/y),0,this._cols),l=x(Math.floor(r/y),0,this._rows),c=x(Math.ceil(h/y),0,this._cols),p=x(Math.ceil(o/y),0,this._rows);for(let m=l;m<=p;m++)for(let d=u;d<=c;d++){const g=this.getCellId(d,m);if(this.has(g))return N}return j}_mark(t,e,i,s,n){const r=t-i/2,h=e-s/2,o=r+i,u=h+s,l=x(Math.floor(r/y),0,this._cols),c=x(Math.floor(h/y),0,this._rows),p=x(Math.ceil(o/y),0,this._cols),m=x(Math.ceil(u/y),0,this._rows);for(let d=c;d<=m;d++)for(let g=l;g<=p;g++){const L=this.getCellId(g,d);this._debugMap.set(L,n),this.set(L)}return!1}_markMetrics(t){for(const{computedX:e,computedY:i,width:s,height:n}of t.bounds){const r=(s+B)*this._pixelRatio,h=(n+B)*this._pixelRatio;this._mark(e,i,r,h,t.entityTexel)}}};const k=254,U=255,I=0;function C(a,t){const e=a.children.slice();e.sort((i,s)=>i.tileAge-s.tileAge),e.forEach(i=>{i.labelMetrics!=null&&i.isReady&&t(i,i.labelMetrics)})}function mt(a,t){return(!a.minScale||a.minScale>=t)&&(!a.maxScale||a.maxScale<=t)}let Pt=class{run(t,e,i,s){var r;const n=[];for(let h=t.length-1;h>=0;h--){const o=t[h];(r=o.labelingCollisionInfos)!=null&&r.length&&n.push(...o.labelingCollisionInfos)}ot("esri-2d-update-debug")&&n.length&&console.debug("CollisionEngine.run"),this._transformMetrics(n),this._runCollision(n,e,i,s);for(const h of n)h.container.requestRender()}_runCollision(t,e,i,s){const[n,r]=e.state.size,h=new Ft(n,r,e.pixelRatio);for(const{container:o,deconflictionEnabled:u,visible:l}of t){const c=o.attributeView;u?l?(this._prepare(o),this._collideVisible(h,o,i,s),this._collideInvisible(h,o)):C(o,(p,m)=>{for(const d of m)c.setLabelMinZoom(d.entityTexel,U)}):C(o,(p,m)=>{for(const d of m)mt(d,i)?(c.setLabelMinZoom(d.entityTexel,I),l&&h.insertMetrics(d)):c.setLabelMinZoom(d.entityTexel,k)})}}_isFiltered(t,e,i){const s=e.getFilterFlags(t),n=!i.hasFilter||!!(s&Mt),r=i.featureEffect==null||i.featureEffect.excludedLabelsVisible||!!(s&bt);return!(n&&r)}_prepare(t){const e=t.attributeView,i=new Set;C(t,(s,n)=>{for(const r of n){const h=r.entityTexel;if(!i.has(h)){if(i.add(h),this._isFiltered(h,e,t.layerView)){e.setLabelMinZoom(h,k);continue}e.getLabelMinZoom(h)!==I?e.setLabelMinZoom(h,U):e.setLabelMinZoom(h,I)}}})}_collideVisible(t,e,i,s){const n=e.attributeView,r=new Set;C(e,(h,o)=>{for(let u=0;u{for(let h=0;h{var l;const h=e.attributeView,o=n.transforms.labelMat2d;o[4]=Math.round(o[4]),o[5]=Math.round(o[5]);const u=i==="polyline";for(const c of r){const{entityTexel:p,anchorX:m,anchorY:d}=c;let g=((l=c.referenceBounds)==null?void 0:l.size)??0;const L=s[0];if(L!=null){const f=L(h.getVVSize(p));g=isNaN(f)||f==null||f===1/0?g:f}const rt=c.directionX*(g/2),ht=c.directionY*(g/2);for(const f of c.bounds){let W=m,J=d;if(u){let $=W+f.x+rt,S=J+f.y+ht;$=o[0]*$+o[2]*S+o[4],S=o[1]*$+o[3]*S+o[5],f.computedX=Math.floor($),f.computedY=Math.floor(S)}else{W=o[0]*m+o[2]*d+o[4],J=o[1]*m+o[3]*d+o[5];const $=W+f.x+rt,S=J+f.y+ht;f.computedX=$,f.computedY=S}}}})}};const Zt=32;let A=class extends E{constructor(t){super(t),this._lastUpdate=0,this.collisionEngine=new Pt,this.lastUpdateId=-1,this.updateRequested=!1,this.view=null}get updating(){return ot("esri-2d-log-updating")&&console.log(`Updating LabelManager ${this.updateRequested}: -> updateRequested: ${this.updateRequested}`),this.updateRequested}update(t){const e=performance.now();e-this._lastUpdate>=Zt?(this._lastUpdate=e,this.doUpdate(t)):this.requestUpdate()}viewChange(){this.requestUpdate()}requestUpdate(){var t;this.updateRequested||(this.updateRequested=!0,(t=this.view)==null||t.requestUpdate())}processUpdate(t){this.updateRequested&&(this.updateRequested=!1,this.update(t))}doUpdate(t){const e=this.view;if(e)try{const i=t.state.scale,s=e.featuresTilingScheme.getClosestInfoForScale(i).level;this.collisionEngine.run(e.allLayerViews.items,t,i,s)}catch{}}};_([v()],A.prototype,"updateRequested",void 0),_([v()],A.prototype,"updating",null),_([v()],A.prototype,"view",void 0),A=_([R("esri.views.2d.LabelManager")],A);const G="esri-zoom-box",Y={container:`${G}__container`,overlay:`${G}__overlay`,background:`${G}__overlay-background`,box:`${G}__outline`},K={zoom:"Shift",counter:"Ctrl"};let F=class extends E{constructor(t){super(t),this._container=null,this._overlay=null,this._backgroundShape=null,this._boxShape=null,this._box={x:0,y:0,width:0,height:0},this._rafId=null,this._redraw=this._redraw.bind(this)}destroy(){this.view=null}set view(t){this.removeAllHandles(),this._destroyOverlay(),this._set("view",t),t&&this.addHandles([t.on("drag",[K.zoom],e=>this._handleDrag(e,1),lt.INTERNAL),t.on("drag",[K.zoom,K.counter],e=>this._handleDrag(e,-1),lt.INTERNAL)])}_start(){this._createContainer(),this._createOverlay(),this.navigation.begin()}_update(t,e,i,s){this._box.x=t,this._box.y=e,this._box.width=i,this._box.height=s,this._rafId||(this._rafId=requestAnimationFrame(this._redraw))}_end(t,e,i,s,n){const r=this.view,h=r.toMap(xt(t+.5*i,e+.5*s));let o=Math.max(i/r.width,s/r.height);n===-1&&(o=1/o),this._destroyOverlay(),this.navigation.end(),r.goTo({center:h,scale:r.scale*o})}_updateBox(t,e,i,s){const n=this._boxShape;n.setAttributeNS(null,"x",""+t),n.setAttributeNS(null,"y",""+e),n.setAttributeNS(null,"width",""+i),n.setAttributeNS(null,"height",""+s),n.setAttributeNS(null,"class",Y.box)}_updateBackground(t,e,i,s){this._backgroundShape.setAttributeNS(null,"d",this._toSVGPath(t,e,i,s,this.view.width,this.view.height))}_createContainer(){const t=document.createElement("div");t.className=Y.container,this.view.root.appendChild(t),this._container=t}_createOverlay(){const t=this.view.width,e=this.view.height,i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttributeNS(null,"d","M 0 0 L "+t+" 0 L "+t+" "+e+" L 0 "+e+" Z"),i.setAttributeNS(null,"class",Y.background);const s=document.createElementNS("http://www.w3.org/2000/svg","rect"),n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),n.setAttributeNS(null,"class",Y.overlay),n.appendChild(i),n.appendChild(s),this._container.appendChild(n),this._backgroundShape=i,this._boxShape=s,this._overlay=n}_destroyOverlay(){this._container&&this._container.parentNode&&this._container.parentNode.removeChild(this._container),this._container=this._backgroundShape=this._boxShape=this._overlay=null}_toSVGPath(t,e,i,s,n,r){const h=t+i,o=e+s;return"M 0 0 L "+n+" 0 L "+n+" "+r+" L 0 "+r+" ZM "+t+" "+e+" L "+t+" "+o+" L "+h+" "+o+" L "+h+" "+e+" Z"}_handleDrag(t,e){const i=t.x,s=t.y,n=t.origin.x,r=t.origin.y;let h,o,u,l;switch(i>n?(h=n,u=i-n):(h=i,u=n-i),s>r?(o=r,l=s-r):(o=s,l=r-s),t.action){case"start":this._start();break;case"update":this._update(h,o,u,l);break;case"end":this._end(h,o,u,l,e)}t.stopPropagation()}_redraw(){if(!this._rafId||(this._rafId=null,!this._overlay))return;const{x:t,y:e,width:i,height:s}=this._box;this._updateBox(t,e,i,s),this._updateBackground(t,e,i,s),this._rafId=requestAnimationFrame(this._redraw)}};_([v()],F.prototype,"navigation",void 0),_([v()],F.prototype,"view",null),F=_([R("esri.views.2d.navigation.ZoomBox")],F);const Nt=F;let T=class{constructor(t){this._gain=t,this.lastValue=void 0,this.filteredDelta=void 0}update(t){if(this.hasLastValue()){const e=this.computeDelta(t);this._updateDelta(e)}this.lastValue=t}reset(){this.lastValue=void 0,this.filteredDelta=void 0}hasLastValue(){return this.lastValue!==void 0}hasFilteredDelta(){return this.filteredDelta!==void 0}computeDelta(t){return this.lastValue===void 0?NaN:t-this.lastValue}_updateDelta(t){this.filteredDelta!==void 0?this.filteredDelta=(1-this._gain)*this.filteredDelta+this._gain*t:this.filteredDelta=t}},at=class{constructor(t,e,i){this._initialVelocity=t,this._stopVelocity=e,this._friction=i,this._duration=Math.abs(Math.log(Math.abs(this._initialVelocity)/this._stopVelocity)/Math.log(1-this._friction))}get duration(){return this._duration}isFinished(t){return t>this.duration}get friction(){return this._friction}value(t){return this.valueFromInitialVelocity(this._initialVelocity,t)}valueDelta(t,e){const i=this.value(t);return this.value(t+e)-i}valueFromInitialVelocity(t,e){e=Math.min(e,this.duration);const i=1-this.friction;return t*(i**e-1)/Math.log(i)}};class qt extends at{constructor(t,e,i,s,n){super(t,e,i),this._sceneVelocity=s,this.direction=n}value(t){return super.valueFromInitialVelocity(this._sceneVelocity,t)}}class Bt{constructor(t=300,e=12,i=.84){this._minimumInitialVelocity=t,this._stopVelocity=e,this._friction=i,this.enabled=!0,this._time=new T(.6),this._screen=[new T(.4),new T(.4)],this._scene=[new T(.6),new T(.6),new T(.6)],this._tmpDirection=pt()}add(t,e,i){if(this.enabled){if(this._time.hasLastValue()&&this._time.computeDelta(i)<.015)return;this._screen[0].update(t[0]),this._screen[1].update(t[1]),this._scene[0].update(e[0]),this._scene[1].update(e[1]),this._scene[2].update(e[2]),this._time.update(i)}}reset(){this._screen[0].reset(),this._screen[1].reset(),this._scene[0].reset(),this._scene[1].reset(),this._scene[2].reset(),this._time.reset()}evaluateMomentum(){if(!this.enabled||!this._screen[0].hasFilteredDelta()||!this._time.hasFilteredDelta())return null;const t=this._screen[0].filteredDelta,e=this._screen[1].filteredDelta,i=t==null||e==null?0:Math.sqrt(t*t+e*e),s=this._time.filteredDelta,n=s==null||i==null?0:i/s;return Math.abs(n)0&>(this._tmpDirection,this._tmpDirection,1/s);const n=this._time.filteredDelta;return new qt(t,e,i,n==null?0:s/n,this._tmpDirection)}}let V=class extends E{constructor(t){super(t),this.animationTime=0,this.momentumEstimator=new Bt(500,6,.92),this.momentum=null,this.tmpMomentum=pt(),this.momentumFinished=!1,this.viewpoint=new H({targetGeometry:new Q,scale:0,rotation:0}),this._previousDrag=null,vt(()=>this.momentumFinished,()=>this.navigation.stop())}begin(t,e){this.navigation.begin(),this.momentumEstimator.reset(),this.addToEstimator(e),this._previousDrag=e}update(t,e){this.addToEstimator(e);let i=e.center.x,s=e.center.y;const n=this._previousDrag;i=n?n.center.x-i:-i,s=n?s-n.center.y:s,t.viewpoint=X(this.viewpoint,t.viewpoint,[i||0,s||0]),this._previousDrag=e}end(t,e){this.addToEstimator(e);const i=t.navigation.momentumEnabled;this.momentum=i?this.momentumEstimator.evaluateMomentum():null,this.animationTime=0,this.momentum&&this.onAnimationUpdate(t),this._previousDrag=null,this.navigation.end()}addToEstimator(t){const e=t.center.x,i=t.center.y,s=St(-e,i),n=Ct(-e,i,0);this.momentumEstimator.add(s,n,.001*t.timestamp)}onAnimationUpdate(t){var e;(e=this.navigation.animationManager)==null||e.animateContinous(t.viewpoint,(i,s)=>{const{momentum:n,animationTime:r,tmpMomentum:h}=this,o=.001*s;if(!(this.momentumFinished=!n||n.isFinished(r))){const u=n.valueDelta(r,o);gt(h,n.direction,u),X(i,i,h),t.constraints.constrainByGeometry(i)}this.animationTime+=o})}stopMomentumNavigation(){this.momentum&&(this.momentumEstimator.reset(),this.momentum=null,this.navigation.stop())}};_([v()],V.prototype,"momentumFinished",void 0),_([v()],V.prototype,"viewpoint",void 0),_([v()],V.prototype,"navigation",void 0),V=_([R("esri.views.2d.navigation.actions.Pan")],V);const Ot=V;let ft=class{constructor(t=2.5,e=.01,i=.95,s=12){this._minimumInitialVelocity=t,this._stopVelocity=e,this._friction=i,this._maxVelocity=s,this.enabled=!0,this.value=new T(.8),this.time=new T(.3)}add(t,e){if(this.enabled&&e!=null){if(this.time.hasLastValue()){if(this.time.computeDelta(e)<.01)return;if(this.value.hasFilteredDelta()){const i=this.value.computeDelta(t);this.value.filteredDelta*i<0&&this.value.reset()}}this.time.update(e),this.value.update(t)}}reset(){this.value.reset(),this.time.reset()}evaluateMomentum(){if(!this.enabled||!this.value.hasFilteredDelta()||!this.time.hasFilteredDelta())return null;let t=this.value.filteredDelta/this.time.filteredDelta;return t=x(t,-this._maxVelocity,this._maxVelocity),Math.abs(t)Math.PI;)s-=2*Math.PI;for(;s<-Math.PI;)s+=2*Math.PI;t=i+s}super.add(t,e)}};class Gt extends at{constructor(t,e,i){super(t,e,i)}value(t){const e=super.value(t);return Math.exp(e)}valueDelta(t,e){const i=super.value(t),s=super.value(t+e)-i;return Math.exp(s)}}class Yt extends ft{constructor(t=2.5,e=.01,i=.95,s=12){super(t,e,i,s)}add(t,e){super.add(Math.log(t),e)}createMomentum(t,e,i){return new Gt(t,e,i)}}let z=class extends E{constructor(t){super(t),this._animationTime=0,this._momentumFinished=!1,this._previousAngle=0,this._previousRadius=0,this._previousCenter=null,this._rotationMomentumEstimator=new Ut(.6,.15,.95),this._rotationDirection=1,this._startAngle=0,this._startRadius=0,this._updateTimestamp=null,this._zoomDirection=1,this._zoomMomentumEstimator=new Yt,this._zoomOnly=null,this.zoomMomentum=null,this.rotateMomentum=null,this.viewpoint=new H({targetGeometry:new Q,scale:0,rotation:0}),this.addHandles(vt(()=>this._momentumFinished,()=>this.navigation.stop()))}begin(t,e){this.navigation.begin(),this._rotationMomentumEstimator.reset(),this._zoomMomentumEstimator.reset(),this._zoomOnly=null,this._previousAngle=this._startAngle=e.angle,this._previousRadius=this._startRadius=e.radius,this._previousCenter=e.center,this._updateTimestamp=null,t.constraints.rotationEnabled&&this.addToRotateEstimator(0,e.timestamp),this.addToZoomEstimator(e,1)}update(t,e){this._updateTimestamp===null&&(this._updateTimestamp=e.timestamp);const i=e.angle,s=e.radius,n=e.center,r=Math.abs(180*(i-this._startAngle)/Math.PI),h=Math.abs(s-this._startRadius),o=this._startRadius/s;if(this._previousRadius&&this._previousCenter){const u=s/this._previousRadius;let l=180*(i-this._previousAngle)/Math.PI;this._rotationDirection=l>=0?1:-1,this._zoomDirection=u>=1?1:-1,t.constraints.rotationEnabled?(this._zoomOnly===null&&e.timestamp-this._updateTimestamp>200&&(this._zoomOnly=h-r>0),this._zoomOnly===null||this._zoomOnly?l=0:this.addToRotateEstimator(i-this._startAngle,e.timestamp)):l=0,this.addToZoomEstimator(e,o),this.navigation.setViewpoint([n.x,n.y],1/u,l,[this._previousCenter.x-n.x,n.y-this._previousCenter.y])}this._previousAngle=i,this._previousRadius=s,this._previousCenter=n}end(t){this.rotateMomentum=this._rotationMomentumEstimator.evaluateMomentum(),this.zoomMomentum=this._zoomMomentumEstimator.evaluateMomentum(),this._animationTime=0,(this.rotateMomentum||this.zoomMomentum)&&this.onAnimationUpdate(t),this.navigation.end()}addToRotateEstimator(t,e){this._rotationMomentumEstimator.add(t,.001*e)}addToZoomEstimator(t,e){this._zoomMomentumEstimator.add(e,.001*t.timestamp)}canZoomIn(t){const e=t.scale,i=t.constraints.effectiveMaxScale;return i===0||e>i}canZoomOut(t){const e=t.scale,i=t.constraints.effectiveMinScale;return i===0||e{const n=!this.canZoomIn(t)&&this._zoomDirection>1||!this.canZoomOut(t)&&this._zoomDirection<1,r=!this.rotateMomentum||this.rotateMomentum.isFinished(this._animationTime),h=n||!this.zoomMomentum||this.zoomMomentum.isFinished(this._animationTime),o=.001*s;if(this._momentumFinished=r&&h,!this._momentumFinished){const u=this.rotateMomentum?Math.abs(this.rotateMomentum.valueDelta(this._animationTime,o))*this._rotationDirection*180/Math.PI:0;let l=this.zoomMomentum?Math.abs(this.zoomMomentum.valueDelta(this._animationTime,o)):1;const c=q(),p=q();if(this._previousCenter){st(c,this._previousCenter.x,this._previousCenter.y),Dt(p,t.size,t.padding),Vt(c,c,p);const{constraints:m,scale:d}=t,g=d*l;l<1&&!m.canZoomInTo(g)?(l=d/m.effectiveMaxScale,this.zoomMomentum=null,this.rotateMomentum=null):l>1&&!m.canZoomOutTo(g)&&(l=d/m.effectiveMinScale,this.zoomMomentum=null,this.rotateMomentum=null),zt(i,t.viewpoint,l,u,c,t.size),t.constraints.constrainByGeometry(i)}}this._animationTime+=o})}stopMomentumNavigation(){(this.rotateMomentum||this.zoomMomentum)&&(this.rotateMomentum&&(this._rotationMomentumEstimator.reset(),this.rotateMomentum=null),this.zoomMomentum&&(this._zoomMomentumEstimator.reset(),this.zoomMomentum=null),this.navigation.stop())}};_([v()],z.prototype,"_momentumFinished",void 0),_([v()],z.prototype,"viewpoint",void 0),_([v()],z.prototype,"navigation",void 0),z=_([R("esri.views.2d.navigation.actions.Pinch")],z);const Xt=z,tt=q(),ct=q();let P=class extends E{constructor(a){super(a),this._previousCenter=q(),this.viewpoint=new H({targetGeometry:new Q,scale:0,rotation:0})}begin(a,t){this.navigation.begin(),st(this._previousCenter,t.center.x,t.center.y)}update(a,t){const{state:{size:e,padding:i}}=a;st(tt,t.center.x,t.center.y),Et(ct,e,i),a.viewpoint=nt(this.viewpoint,a.state.paddedViewState.viewpoint,Rt(ct,this._previousCenter,tt)),Lt(this._previousCenter,tt)}end(){this.navigation.end()}};_([v()],P.prototype,"viewpoint",void 0),_([v()],P.prototype,"navigation",void 0),P=_([R("esri.views.2d.actions.Rotate")],P);const jt=P,D=10,dt=1,et=new H({targetGeometry:new Q}),it=[0,0],_t=250;let M=class extends E{constructor(a){super(a),this._endTimer=null,this._lastEventTimestamp=null,this.animationManager=null,this.interacting=!1}initialize(){this.pan=new Ot({navigation:this}),this.rotate=new jt({navigation:this}),this.pinch=new Xt({navigation:this}),this.zoomBox=new Nt({view:this.view,navigation:this})}destroy(){this.pan=O(this.pan),this.rotate=O(this.rotate),this.pinch=O(this.pinch),this.zoomBox=O(this.zoomBox),this.animationManager=null}begin(){this.stop(),this._set("interacting",!0)}end(){this._lastEventTimestamp=performance.now(),this._startTimer(_t)}async zoom(a,t=this._getDefaultAnchor()){if(this.begin(),this.view.constraints.snapToZoom&&this.view.constraints.effectiveLODs)return a<1?this.zoomIn(t):this.zoomOut(t);this.setViewpoint(t,a,0,[0,0])}async zoomIn(a){const t=this.view,e=t.constraints.snapToNextScale(t.scale);return this._zoomToScale(e,a)}async zoomOut(a){const t=this.view,e=t.constraints.snapToPreviousScale(t.scale);return this._zoomToScale(e,a)}setViewpoint(a,t,e,i){this.begin(),this.view.stateManager.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,a,t,e,i),this.end()}setViewpointImmediate(a,t=0,e=[0,0],i=this._getDefaultAnchor()){this.view.stateManager.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,i,a,t,e)}continousRotateClockwise(){var t;const a=this.view.viewpoint;(t=this.animationManager)==null||t.animateContinous(a,e=>{nt(e,e,-dt)})}continousRotateCounterclockwise(){var t;const a=this.view.viewpoint;(t=this.animationManager)==null||t.animateContinous(a,e=>{nt(e,e,dt)})}resetRotation(){this.view.constraints.rotationEnabled&&(this.view.rotation=0)}continousPanLeft(){this._continuousPan([-D,0])}continousPanRight(){this._continuousPan([D,0])}continousPanUp(){this._continuousPan([0,D])}continousPanDown(){this._continuousPan([0,-D])}continuousPanVector({x:a,y:t}){this._continuousPan([a*D,t*D])}stop(){var a;this.pan.stopMomentumNavigation(),(a=this.animationManager)==null||a.stop(),this.end(),this._endTimer!==null&&(clearTimeout(this._endTimer),this._endTimer=null,this._set("interacting",!1))}_continuousPan(a){var e;const t=this.view.viewpoint;(e=this.animationManager)==null||e.animateContinous(t,i=>{X(i,i,a),this.view.constraints.constrainByGeometry(i)})}_startTimer(a){return this._endTimer!==null||(this._endTimer=setTimeout(()=>{this._endTimer=null;const t=performance.now()-(this._lastEventTimestamp??0);t<_t?this._endTimer=this._startTimer(t):this._set("interacting",!1)},a)),this._endTimer}_getDefaultAnchor(){const{size:a,padding:{left:t,right:e,top:i,bottom:s}}=this.view;return it[0]=.5*(a[0]-e+t),it[1]=.5*(a[1]-s+i),it}async _zoomToScale(a,t=this._getDefaultAnchor()){const{view:e}=this,{constraints:i,scale:s,viewpoint:n,size:r,padding:h}=e,o=i.canZoomInTo(a),u=i.canZoomOutTo(a);if(!(as&&!u))return ut(et,n,a/s,0,t,r,h),i.constrainByGeometry(et),e.goTo(et,{animate:!0,pickClosestTarget:!1})}_scaleRotateTranslateViewpoint(a,t,e,i,s){const{view:n}=this,{size:r,padding:h,constraints:o,scale:u,viewpoint:l}=n,c=u*e,p=o.canZoomInTo(c),m=o.canZoomOutTo(c);return(e<1&&!p||e>1&&!m)&&(e=1),X(l,l,s),ut(a,l,e,i,t,r,h),o.constrainByGeometry(a)}};_([v()],M.prototype,"animationManager",void 0),_([v({type:Boolean,readOnly:!0})],M.prototype,"interacting",void 0),_([v()],M.prototype,"pan",void 0),_([v()],M.prototype,"pinch",void 0),_([v()],M.prototype,"rotate",void 0),_([v()],M.prototype,"view",void 0),_([v()],M.prototype,"zoomBox",void 0),M=_([R("esri.views.2d.navigation.MapViewNavigation")],M);const fe=M,Ht={shaders:{vertexShader:b("magnifier/magnifier.vert"),fragmentShader:b("magnifier/magnifier.frag")},attributes:new Map([["a_pos",0]])};function we(a){return At(a,Ht)}export{oe as a,we as b,Ht as c,A as d,ie as e,fe as f,ae as n,se as r,ne as t}; diff --git a/assets/MapImageLayer-DqX26yH_.js b/assets/MapImageLayer-l41pl51g.js similarity index 75% rename from assets/MapImageLayer-DqX26yH_.js rename to assets/MapImageLayer-l41pl51g.js index 1d1f3a3..76fbc75 100644 --- a/assets/MapImageLayer-DqX26yH_.js +++ b/assets/MapImageLayer-l41pl51g.js @@ -1 +1 @@ -import{bP as I,bQ as T,dM as $,dp as M,dq as O,dr as E,dN as R,dO as P,ay as F,dF as v,bs as f,dP as L,M as b,aE as N,b2 as j,dQ as U,N as x,b as q,d as s,y as p,dR as S,aZ as J,aR as A,du as _,f as k,bT as V,dS as Z}from"./index-CEWggaxV.js";import{i as z}from"./scaleUtils-Bqauo1zZ.js";import{m as B,f as C,Y as D}from"./SublayersOwner-CJjJUh6G.js";import{f as G}from"./RefreshableLayer-1EkEhJeI.js";import{f as H}from"./TemporalLayer-qq3v_i3q.js";import{m as K}from"./ExportImageParameters-DVsh-7G1.js";import{t as W}from"./imageBitmapUtils-C0nKXf5P.js";import{e as w}from"./sublayerUtils-BPYHHPMV.js";import{e as Q}from"./versionUtils-CaceEUVY.js";import"./Version-Bd0QsIQ5.js";import"./UniqueValueRenderer-BlkUix3g.js";import"./ColorStop-44hBlQ14.js";import"./diffUtils-B4YFa5Ju.js";import"./colorRamps-BJydlf0f.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-z2k12BH8.js";import"./jsonUtils-qYmXvGJ1.js";import"./styleUtils-CnV_Xzhi.js";import"./jsonUtils-BseLl1fZ.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./OverrideHelper-B4ryGWZb.js";import"./utils-p-5Bbga5.js";import"./quantizationUtils-CUjGHrU3.js";import"./heatmapUtils-Clt5rJzr.js";import"./QueryTask-CjHwD7wL.js";import"./infoFor3D-DsOdlPuA.js";import"./executeForIds-BjeEaIen.js";import"./query-BM8R3sQ6.js";import"./pbfQueryUtils-CLRSFGBm.js";import"./pbf-D9QZb8S8.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./queryZScale-DN4aFXYn.js";import"./executeQueryJSON-DngjHRnE.js";import"./FeatureSet-CYJUZgOk.js";import"./executeQueryPBF-BYY2Ipuh.js";import"./featureConversionUtils-CmP9mw0r.js";import"./FeatureType-By3BEr9z.js";import"./FeatureTemplate-DcprAdTM.js";import"./LabelClass-6cZokw8y.js";import"./labelUtils-Dnqx6jl5.js";import"./defaultsJSON-CHAaurhX.js";import"./labelingInfo-CijajRsc.js";import"./LayerFloorInfo-Cdq3ulNh.js";import"./serviceCapabilitiesUtils-t8SL4e_j.js";import"./AttachmentQuery-D61mmWw4.js";import"./popupUtils-DAFYyAvw.js";import"./TimeInfo-3TVmpFSA.js";import"./floorFilterUtils-DZ5C6FQv.js";let r=class extends I(H(T(B(C($(M(O(E(G(R(P(V)))))))))))){constructor(...e){super(...e),this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.dpi=96,this.gdbVersion=null,this.imageFormat="png24",this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.isReference=null,this.labelsVisible=!1,this.operationalLayerType="ArcGISMapServiceLayer",this.preferredTimeZone=null,this.sourceJSON=null,this.sublayers=null,this.type="map-image",this.url=null}normalizeCtorArgs(e,i){return typeof e=="string"?{url:e,...i}:e}load(e){const i=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(F).then(()=>this._fetchService(i))),Promise.resolve(this)}readImageFormat(e,i){const m=i.supportedImageFormatTypes;return m&&m.includes("PNG32")?"png32":"png24"}writeSublayers(e,i,m,t){var y,d,h;if(!this.loaded||!e)return;const a=e.slice().reverse().flatten(({sublayers:o})=>o&&o.toArray().reverse()).toArray();let n=!1;if((y=this.capabilities)!=null&&y.operations.supportsExportMap&&((h=(d=this.capabilities)==null?void 0:d.exportMap)!=null&&h.supportsDynamicLayers)){const o=v(t.origin);if(o===f.PORTAL_ITEM){const g=this.createSublayersForOrigin("service").sublayers;n=w(a,g,f.SERVICE)}else if(o>f.PORTAL_ITEM){const g=this.createSublayersForOrigin("portal-item");n=w(a,g.sublayers,v(g.origin))}}const l=[],u={writeSublayerStructure:n,...t};let c=n;a.forEach(o=>{const g=o.write({},u);l.push(g),c=c||o.originOf("visible")==="user"}),l.some(o=>Object.keys(o).length>1)&&(i.layers=l),c&&(i.visibleLayers=a.filter(o=>o.visible).map(o=>o.id))}createExportImageParameters(e,i,m,t){const a=(t==null?void 0:t.pixelRatio)||1;e&&this.version>=10&&(e=e.clone().shiftCentralMeridian());const n=new K({layer:this,floors:t==null?void 0:t.floors,scale:z({extent:e,width:i})*a}),l=n.toJSON();n.destroy();const u=!(t!=null&&t.rotation)||this.version<10.3?{}:{rotation:-t.rotation},c=e==null?void 0:e.spatialReference,y=L(c);l.dpi*=a;const d={};if(t!=null&&t.timeExtent){const{start:h,end:o}=t.timeExtent.toJSON();d.time=h&&o&&h===o?""+h:`${h??"null"},${o??"null"}`}else this.timeInfo&&!this.timeInfo.hasLiveData&&(d.time="null,null");return{bbox:e&&e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:y,imageSR:y,size:i+","+m,...l,...u,...d}}async fetchImage(e,i,m,t){const{data:a}=await this._fetchImage("image",e,i,m,t);return a}async fetchImageBitmap(e,i,m,t){const{data:a,url:n}=await this._fetchImage("blob",e,i,m,t);return W(a,n,t==null?void 0:t.signal)}async fetchRecomputedExtents(e={}){const i={...e,query:{returnUpdates:!0,f:"json",...this.customParameters,token:this.apiKey}},{data:m}=await b(this.url,i),{extent:t,fullExtent:a,timeExtent:n}=m,l=t||a;return{fullExtent:l&&N.fromJSON(l),timeExtent:n&&j.fromJSON({start:n[0],end:n[1]})}}loadAll(){return U(this,e=>{e(this.allSublayers)})}serviceSupportsSpatialReference(e){return Q(this,e)}async _fetchImage(e,i,m,t,a){var u,c,y;const n={responseType:e,signal:(a==null?void 0:a.signal)??null,query:{...this.parsedUrl.query,...this.createExportImageParameters(i,m,t,a),f:"image",...this.refreshParameters,...this.customParameters,token:this.apiKey}},l=this.parsedUrl.path+"/export";if(((u=n.query)==null?void 0:u.dynamicLayers)!=null&&!((y=(c=this.capabilities)==null?void 0:c.exportMap)!=null&&y.supportsDynamicLayers))throw new x("mapimagelayer:dynamiclayer-not-supported",`service ${this.url} doesn't support dynamic layers, which is required to be able to change the sublayer's order, rendering, labeling or source.`,{query:n.query});try{const{data:d}=await b(l,n);return{data:d,url:l}}catch(d){throw q(d)?d:new x("mapimagelayer:image-fetch-error",`Unable to load image: ${l}`,{error:d})}}async _fetchService(e){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:i,ssl:m}=await b(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},signal:e});m&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=i,this.read(i,{origin:"service",url:this.parsedUrl})}};s([p(S("dateFieldsTimeReference"))],r.prototype,"dateFieldsTimeZone",void 0),s([p({type:Boolean})],r.prototype,"datesInUnknownTimezone",void 0),s([p()],r.prototype,"dpi",void 0),s([p()],r.prototype,"gdbVersion",void 0),s([p()],r.prototype,"imageFormat",void 0),s([J("imageFormat",["supportedImageFormatTypes"])],r.prototype,"readImageFormat",null),s([p({json:{origins:{service:{read:{source:"maxImageHeight"}}}}})],r.prototype,"imageMaxHeight",void 0),s([p({json:{origins:{service:{read:{source:"maxImageWidth"}}}}})],r.prototype,"imageMaxWidth",void 0),s([p()],r.prototype,"imageTransparency",void 0),s([p({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],r.prototype,"isReference",void 0),s([p({json:{read:!1,write:!1}})],r.prototype,"labelsVisible",void 0),s([p({type:["ArcGISMapServiceLayer"]})],r.prototype,"operationalLayerType",void 0),s([p({json:{read:!1,write:!1}})],r.prototype,"popupEnabled",void 0),s([p(S("preferredTimeReference"))],r.prototype,"preferredTimeZone",void 0),s([p()],r.prototype,"sourceJSON",void 0),s([p({json:{write:{ignoreOrigin:!0}}})],r.prototype,"sublayers",void 0),s([A("sublayers",{layers:{type:[D]},visibleLayers:{type:[Z]}})],r.prototype,"writeSublayers",null),s([p({type:["show","hide","hide-children"]})],r.prototype,"listMode",void 0),s([p({json:{read:!1},readOnly:!0,value:"map-image"})],r.prototype,"type",void 0),s([p(_)],r.prototype,"url",void 0),r=s([k("esri.layers.MapImageLayer")],r);const He=r;export{He as default}; +import{bP as I,bQ as T,dM as $,dp as M,dq as O,dr as E,dN as R,dO as P,ay as F,dF as v,bs as f,dP as L,M as b,aE as N,b2 as j,dQ as U,N as x,b as q,d as s,y as p,dR as S,aZ as J,aR as A,du as _,f as k,bT as V,dS as Z}from"./index-BjUNJPVf.js";import{i as z}from"./scaleUtils-DWXMiS7R.js";import{m as B,f as C,Y as D}from"./SublayersOwner-CywL6RlY.js";import{f as G}from"./RefreshableLayer-_r2TPtol.js";import{f as H}from"./TemporalLayer-CKICYnEl.js";import{m as K}from"./ExportImageParameters-CXqmEVur.js";import{t as W}from"./imageBitmapUtils-BVxrhFkK.js";import{e as w}from"./sublayerUtils-GrJ1gnTG.js";import{e as Q}from"./versionUtils-BIAEZzrm.js";import"./Version-Dqq_CHBG.js";import"./UniqueValueRenderer-7V9Bhr-D.js";import"./ColorStop-DCGjAKLC.js";import"./diffUtils-uUoMDFQS.js";import"./colorRamps-CcakIWlU.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-BX9G5gNQ.js";import"./jsonUtils-Ox5U0P0F.js";import"./styleUtils-DOUOskVZ.js";import"./jsonUtils-Dw332y6z.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./OverrideHelper-DxFZBnGL.js";import"./utils-CuXO_Zzq.js";import"./quantizationUtils-CfV316jZ.js";import"./heatmapUtils-BSteZBTj.js";import"./QueryTask-Cl66pG_V.js";import"./infoFor3D-DsOdlPuA.js";import"./executeForIds-CZ3M8IZd.js";import"./query-Bk_ITqRK.js";import"./pbfQueryUtils-CSeFSIjv.js";import"./pbf-Du8sFEWo.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./queryZScale-Dwvn5BlQ.js";import"./executeQueryJSON-COxi_Fac.js";import"./FeatureSet-opEn8ou8.js";import"./executeQueryPBF-DROgTCuZ.js";import"./featureConversionUtils-BHhm7bvm.js";import"./FeatureType-CwUl8Nf5.js";import"./FeatureTemplate-FZNGA_Ik.js";import"./LabelClass-CeatfK8u.js";import"./labelUtils-3p0-m-Ee.js";import"./defaultsJSON-CHAaurhX.js";import"./labelingInfo-DqAUis6e.js";import"./LayerFloorInfo-DlYNbO-A.js";import"./serviceCapabilitiesUtils-DiP90Uds.js";import"./AttachmentQuery-DmEAIZff.js";import"./popupUtils-DlZin22m.js";import"./TimeInfo-DooETFWC.js";import"./floorFilterUtils-DZ5C6FQv.js";let r=class extends I(H(T(B(C($(M(O(E(G(R(P(V)))))))))))){constructor(...e){super(...e),this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.dpi=96,this.gdbVersion=null,this.imageFormat="png24",this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.isReference=null,this.labelsVisible=!1,this.operationalLayerType="ArcGISMapServiceLayer",this.preferredTimeZone=null,this.sourceJSON=null,this.sublayers=null,this.type="map-image",this.url=null}normalizeCtorArgs(e,i){return typeof e=="string"?{url:e,...i}:e}load(e){const i=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(F).then(()=>this._fetchService(i))),Promise.resolve(this)}readImageFormat(e,i){const m=i.supportedImageFormatTypes;return m&&m.includes("PNG32")?"png32":"png24"}writeSublayers(e,i,m,t){var y,d,h;if(!this.loaded||!e)return;const a=e.slice().reverse().flatten(({sublayers:o})=>o&&o.toArray().reverse()).toArray();let n=!1;if((y=this.capabilities)!=null&&y.operations.supportsExportMap&&((h=(d=this.capabilities)==null?void 0:d.exportMap)!=null&&h.supportsDynamicLayers)){const o=v(t.origin);if(o===f.PORTAL_ITEM){const g=this.createSublayersForOrigin("service").sublayers;n=w(a,g,f.SERVICE)}else if(o>f.PORTAL_ITEM){const g=this.createSublayersForOrigin("portal-item");n=w(a,g.sublayers,v(g.origin))}}const l=[],u={writeSublayerStructure:n,...t};let c=n;a.forEach(o=>{const g=o.write({},u);l.push(g),c=c||o.originOf("visible")==="user"}),l.some(o=>Object.keys(o).length>1)&&(i.layers=l),c&&(i.visibleLayers=a.filter(o=>o.visible).map(o=>o.id))}createExportImageParameters(e,i,m,t){const a=(t==null?void 0:t.pixelRatio)||1;e&&this.version>=10&&(e=e.clone().shiftCentralMeridian());const n=new K({layer:this,floors:t==null?void 0:t.floors,scale:z({extent:e,width:i})*a}),l=n.toJSON();n.destroy();const u=!(t!=null&&t.rotation)||this.version<10.3?{}:{rotation:-t.rotation},c=e==null?void 0:e.spatialReference,y=L(c);l.dpi*=a;const d={};if(t!=null&&t.timeExtent){const{start:h,end:o}=t.timeExtent.toJSON();d.time=h&&o&&h===o?""+h:`${h??"null"},${o??"null"}`}else this.timeInfo&&!this.timeInfo.hasLiveData&&(d.time="null,null");return{bbox:e&&e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:y,imageSR:y,size:i+","+m,...l,...u,...d}}async fetchImage(e,i,m,t){const{data:a}=await this._fetchImage("image",e,i,m,t);return a}async fetchImageBitmap(e,i,m,t){const{data:a,url:n}=await this._fetchImage("blob",e,i,m,t);return W(a,n,t==null?void 0:t.signal)}async fetchRecomputedExtents(e={}){const i={...e,query:{returnUpdates:!0,f:"json",...this.customParameters,token:this.apiKey}},{data:m}=await b(this.url,i),{extent:t,fullExtent:a,timeExtent:n}=m,l=t||a;return{fullExtent:l&&N.fromJSON(l),timeExtent:n&&j.fromJSON({start:n[0],end:n[1]})}}loadAll(){return U(this,e=>{e(this.allSublayers)})}serviceSupportsSpatialReference(e){return Q(this,e)}async _fetchImage(e,i,m,t,a){var u,c,y;const n={responseType:e,signal:(a==null?void 0:a.signal)??null,query:{...this.parsedUrl.query,...this.createExportImageParameters(i,m,t,a),f:"image",...this.refreshParameters,...this.customParameters,token:this.apiKey}},l=this.parsedUrl.path+"/export";if(((u=n.query)==null?void 0:u.dynamicLayers)!=null&&!((y=(c=this.capabilities)==null?void 0:c.exportMap)!=null&&y.supportsDynamicLayers))throw new x("mapimagelayer:dynamiclayer-not-supported",`service ${this.url} doesn't support dynamic layers, which is required to be able to change the sublayer's order, rendering, labeling or source.`,{query:n.query});try{const{data:d}=await b(l,n);return{data:d,url:l}}catch(d){throw q(d)?d:new x("mapimagelayer:image-fetch-error",`Unable to load image: ${l}`,{error:d})}}async _fetchService(e){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:i,ssl:m}=await b(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},signal:e});m&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=i,this.read(i,{origin:"service",url:this.parsedUrl})}};s([p(S("dateFieldsTimeReference"))],r.prototype,"dateFieldsTimeZone",void 0),s([p({type:Boolean})],r.prototype,"datesInUnknownTimezone",void 0),s([p()],r.prototype,"dpi",void 0),s([p()],r.prototype,"gdbVersion",void 0),s([p()],r.prototype,"imageFormat",void 0),s([J("imageFormat",["supportedImageFormatTypes"])],r.prototype,"readImageFormat",null),s([p({json:{origins:{service:{read:{source:"maxImageHeight"}}}}})],r.prototype,"imageMaxHeight",void 0),s([p({json:{origins:{service:{read:{source:"maxImageWidth"}}}}})],r.prototype,"imageMaxWidth",void 0),s([p()],r.prototype,"imageTransparency",void 0),s([p({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],r.prototype,"isReference",void 0),s([p({json:{read:!1,write:!1}})],r.prototype,"labelsVisible",void 0),s([p({type:["ArcGISMapServiceLayer"]})],r.prototype,"operationalLayerType",void 0),s([p({json:{read:!1,write:!1}})],r.prototype,"popupEnabled",void 0),s([p(S("preferredTimeReference"))],r.prototype,"preferredTimeZone",void 0),s([p()],r.prototype,"sourceJSON",void 0),s([p({json:{write:{ignoreOrigin:!0}}})],r.prototype,"sublayers",void 0),s([A("sublayers",{layers:{type:[D]},visibleLayers:{type:[Z]}})],r.prototype,"writeSublayers",null),s([p({type:["show","hide","hide-children"]})],r.prototype,"listMode",void 0),s([p({json:{read:!1},readOnly:!0,value:"map-image"})],r.prototype,"type",void 0),s([p(_)],r.prototype,"url",void 0),r=s([k("esri.layers.MapImageLayer")],r);const He=r;export{He as default}; diff --git a/assets/MapImageLayerView2D-iNdXAMVi.js b/assets/MapImageLayerView2D-Cq7vZ1xD.js similarity index 64% rename from assets/MapImageLayerView2D-iNdXAMVi.js rename to assets/MapImageLayerView2D-Cq7vZ1xD.js index 7b49305..d54d8b6 100644 --- a/assets/MapImageLayerView2D-iNdXAMVi.js +++ b/assets/MapImageLayerView2D-Cq7vZ1xD.js @@ -1 +1 @@ -import{d as r,y as o,bK as g,f as m,c as l,b as d,s as u,g as c}from"./index-CEWggaxV.js";import{a as y}from"./BitmapContainer-Bq0Mk6_k.js";import{m as f,u as x}from"./LayerView-BEFTHNYv.js";import{$ as w}from"./GraphicsView2D-DbbthiwV.js";import{h as _}from"./HighlightGraphicContainer-Cnwl0eCq.js";import{v}from"./ExportStrategy-fFnMYcIc.js";import{m as H}from"./ExportImageParameters-DVsh-7G1.js";import{i as I}from"./RefreshableLayerView-C1-PEoNB.js";import{U,r as V}from"./drapedUtils-CGrSPor9.js";import"./WGLContainer-B_Pv-8Yi.js";import"./LabelMetric-D2hbzzy_.js";import"./Texture-DJgkMrSB.js";import"./Program-DLRmaKpw.js";import"./ProgramTemplate-BICQrNzS.js";import"./Container-CB7SlLB9.js";import"./highlightReasons-DbgbcWKM.js";import"./config-MDUrh2eL.js";import"./earcut-hRlx3adE.js";import"./featureConversionUtils-CmP9mw0r.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./scaleUtils-Bqauo1zZ.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./UpdateTracking2D-nj9Q-3df.js";import"./TurboLine-CkxIB4ZX.js";import"./utils-p-5Bbga5.js";import"./Rect-CUzevAry.js";import"./labelUtils-Dnqx6jl5.js";import"./defaultsJSON-CHAaurhX.js";import"./BindType-BmZEZMMh.js";import"./Util-BS8sJGjF.js";import"./constants-D5zmR9t2.js";import"./OverrideHelper-B4ryGWZb.js";import"./quantizationUtils-CUjGHrU3.js";import"./AttributeStore-Ck-75lnq.js";import"./TimeOnly-Cm47ew5I.js";import"./timeSupport-BjRbXIpn.js";import"./json-Wa8cmqdu.js";import"./diffUtils-B4YFa5Ju.js";import"./FeatureCommandQueue-Btq_FXyi.js";import"./normalizeUtilsSync-B6VufdiX.js";import"./AGraphicContainer-Dby-baET.js";import"./TechniqueInstance-CSsTmbek.js";import"./TileContainer-Ci6dOowA.js";import"./vec3f32-nZdmKIgz.js";import"./Bitmap--gOrgR8J.js";import"./floorFilterUtils-DZ5C6FQv.js";import"./sublayerUtils-BPYHHPMV.js";import"./popupUtils-BovqErR_.js";const b=t=>{let e=class extends t{initialize(){this.exportImageParameters=new H({layer:this.layer})}destroy(){this.exportImageParameters.destroy(),this.exportImageParameters=null}get floors(){var i;return((i=this.view)==null?void 0:i.floors)??null}get exportImageVersion(){var i;return(i=this.exportImageParameters)==null||i.commitProperty("version"),this.commitProperty("timeExtent"),this.commitProperty("floors"),(this._get("exportImageVersion")||0)+1}canResume(){var i;return!!super.canResume()&&!((i=this.timeExtent)!=null&&i.isEmpty)}};return r([o()],e.prototype,"exportImageParameters",void 0),r([o({readOnly:!0})],e.prototype,"floors",null),r([o({readOnly:!0})],e.prototype,"exportImageVersion",null),r([o()],e.prototype,"layer",void 0),r([o()],e.prototype,"suspended",void 0),r([o(g)],e.prototype,"timeExtent",void 0),e=r([m("esri.views.layers.MapImageLayerView")],e),e};let a=class extends b(I(f(x))){constructor(){super(...arguments),this._highlightGraphics=new l,this._updateHash=""}fetchPopupFeaturesAtLocation(t,e){return this._popupHighlightHelper.fetchPopupFeaturesAtLocation(t,e)}update(t){const e=`${this.exportImageVersion}/${t.state.id}/${t.pixelRatio}/${t.stationary}`;this._updateHash!==e&&(this._updateHash=e,this.strategy.update(t).catch(i=>{d(i)||u.getLogger(this).error(i)}),t.stationary&&this._popupHighlightHelper.updateHighlightedFeatures(t.state.resolution)),this._highlightView.processUpdate(t)}attach(){const{imageMaxWidth:t,imageMaxHeight:e,version:i}=this.layer,s=i>=10.3,n=i>=10;this._bitmapContainer=new y,this.container.addChild(this._bitmapContainer),this._highlightView=new w({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new _(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1}),this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new U({createFetchPopupFeaturesQueryGeometry:(p,h)=>V(p,h,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:(p,h)=>{this._highlightView.graphicUpdateHandler({graphic:p,property:h})},layerView:this,updatingHandles:this._updatingHandles}),this.strategy=new v({container:this._bitmapContainer,fetchSource:this.fetchImageBitmap.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxWidth:t,imageMaxHeight:e,imageRotationSupported:s,imageNormalizationSupported:n,hidpi:!0}),this.addAttachHandles(c(()=>this.exportImageVersion,()=>this.requestUpdate())),this.requestUpdate()}detach(){this.strategy.destroy(),this.container.removeAllChildren(),this._bitmapContainer.removeAllChildren(),this._highlightView.destroy(),this._popupHighlightHelper.destroy()}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}supportsSpatialReference(t){return this.layer.serviceSupportsSpatialReference(t)}async doRefresh(){this._updateHash="",this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(t,e,i,s){return this.layer.fetchImage(t,e,i,{timeExtent:this.timeExtent,floors:this.floors,...s})}fetchImageBitmap(t,e,i,s){return this.layer.fetchImageBitmap(t,e,i,{timeExtent:this.timeExtent,floors:this.floors,...s})}highlight(t){return this._popupHighlightHelper.highlight(t)}};r([o()],a.prototype,"strategy",void 0),r([o()],a.prototype,"updating",void 0),a=r([m("esri.views.2d.layers.MapImageLayerView2D")],a);const It=a;export{It as default}; +import{d as r,y as o,bK as g,f as m,c as l,b as d,s as u,g as c}from"./index-BjUNJPVf.js";import{a as y}from"./BitmapContainer-DD7rxH0u.js";import{m as f,u as x}from"./LayerView-Bux7vAEn.js";import{$ as w}from"./GraphicsView2D-B7H8XAnI.js";import{h as _}from"./HighlightGraphicContainer-B5WIObEd.js";import{v}from"./ExportStrategy-SzILz8ne.js";import{m as H}from"./ExportImageParameters-CXqmEVur.js";import{i as I}from"./RefreshableLayerView-L9NGpXXI.js";import{U,r as V}from"./drapedUtils-DDBQ6RK5.js";import"./WGLContainer-DgZNq7b0.js";import"./LabelMetric-BcUxDImF.js";import"./Texture-S4dD-WHn.js";import"./Program-DBsYtQ00.js";import"./ProgramTemplate-Ck2I0bIi.js";import"./Container-_n5wCgez.js";import"./highlightReasons-BOU4mnPE.js";import"./config-MDUrh2eL.js";import"./earcut-CWKXDqDj.js";import"./featureConversionUtils-BHhm7bvm.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./scaleUtils-DWXMiS7R.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./UpdateTracking2D-Ds_Gdrxd.js";import"./TurboLine-DNQdPIXo.js";import"./utils-CuXO_Zzq.js";import"./Rect-CUzevAry.js";import"./labelUtils-3p0-m-Ee.js";import"./defaultsJSON-CHAaurhX.js";import"./BindType-BmZEZMMh.js";import"./Util-CS5u4Lec.js";import"./constants-D5zmR9t2.js";import"./OverrideHelper-DxFZBnGL.js";import"./quantizationUtils-CfV316jZ.js";import"./AttributeStore-Bm6hLtR1.js";import"./TimeOnly-BXSODLxA.js";import"./timeSupport-DXkhlToK.js";import"./json-Wa8cmqdu.js";import"./diffUtils-uUoMDFQS.js";import"./FeatureCommandQueue-DI81F3gA.js";import"./normalizeUtilsSync-73yZ0QwV.js";import"./AGraphicContainer-BXk7Eu6w.js";import"./TechniqueInstance-XtnK2qy2.js";import"./TileContainer-Bs-vXdD_.js";import"./vec3f32-nZdmKIgz.js";import"./Bitmap-DpyomsG7.js";import"./floorFilterUtils-DZ5C6FQv.js";import"./sublayerUtils-GrJ1gnTG.js";import"./popupUtils-Do2GfZME.js";const b=t=>{let e=class extends t{initialize(){this.exportImageParameters=new H({layer:this.layer})}destroy(){this.exportImageParameters.destroy(),this.exportImageParameters=null}get floors(){var i;return((i=this.view)==null?void 0:i.floors)??null}get exportImageVersion(){var i;return(i=this.exportImageParameters)==null||i.commitProperty("version"),this.commitProperty("timeExtent"),this.commitProperty("floors"),(this._get("exportImageVersion")||0)+1}canResume(){var i;return!!super.canResume()&&!((i=this.timeExtent)!=null&&i.isEmpty)}};return r([o()],e.prototype,"exportImageParameters",void 0),r([o({readOnly:!0})],e.prototype,"floors",null),r([o({readOnly:!0})],e.prototype,"exportImageVersion",null),r([o()],e.prototype,"layer",void 0),r([o()],e.prototype,"suspended",void 0),r([o(g)],e.prototype,"timeExtent",void 0),e=r([m("esri.views.layers.MapImageLayerView")],e),e};let a=class extends b(I(f(x))){constructor(){super(...arguments),this._highlightGraphics=new l,this._updateHash=""}fetchPopupFeaturesAtLocation(t,e){return this._popupHighlightHelper.fetchPopupFeaturesAtLocation(t,e)}update(t){const e=`${this.exportImageVersion}/${t.state.id}/${t.pixelRatio}/${t.stationary}`;this._updateHash!==e&&(this._updateHash=e,this.strategy.update(t).catch(i=>{d(i)||u.getLogger(this).error(i)}),t.stationary&&this._popupHighlightHelper.updateHighlightedFeatures(t.state.resolution)),this._highlightView.processUpdate(t)}attach(){const{imageMaxWidth:t,imageMaxHeight:e,version:i}=this.layer,s=i>=10.3,n=i>=10;this._bitmapContainer=new y,this.container.addChild(this._bitmapContainer),this._highlightView=new w({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new _(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1}),this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new U({createFetchPopupFeaturesQueryGeometry:(p,h)=>V(p,h,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:(p,h)=>{this._highlightView.graphicUpdateHandler({graphic:p,property:h})},layerView:this,updatingHandles:this._updatingHandles}),this.strategy=new v({container:this._bitmapContainer,fetchSource:this.fetchImageBitmap.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxWidth:t,imageMaxHeight:e,imageRotationSupported:s,imageNormalizationSupported:n,hidpi:!0}),this.addAttachHandles(c(()=>this.exportImageVersion,()=>this.requestUpdate())),this.requestUpdate()}detach(){this.strategy.destroy(),this.container.removeAllChildren(),this._bitmapContainer.removeAllChildren(),this._highlightView.destroy(),this._popupHighlightHelper.destroy()}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}supportsSpatialReference(t){return this.layer.serviceSupportsSpatialReference(t)}async doRefresh(){this._updateHash="",this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(t,e,i,s){return this.layer.fetchImage(t,e,i,{timeExtent:this.timeExtent,floors:this.floors,...s})}fetchImageBitmap(t,e,i,s){return this.layer.fetchImageBitmap(t,e,i,{timeExtent:this.timeExtent,floors:this.floors,...s})}highlight(t){return this._popupHighlightHelper.highlight(t)}};r([o()],a.prototype,"strategy",void 0),r([o()],a.prototype,"updating",void 0),a=r([m("esri.views.2d.layers.MapImageLayerView2D")],a);const It=a;export{It as default}; diff --git a/assets/MapNotesLayer-BXf_uYaT.js b/assets/MapNotesLayer-CPjCDXnt.js similarity index 83% rename from assets/MapNotesLayer-BXf_uYaT.js rename to assets/MapNotesLayer-CPjCDXnt.js index fc1fef7..28179fa 100644 --- a/assets/MapNotesLayer-BXf_uYaT.js +++ b/assets/MapNotesLayer-CPjCDXnt.js @@ -1 +1 @@ -import{a_ as C,d as i,y as s,f as M,dz as G,dw as B,dy as T,dT as F,bP as z,bQ as W,dp as k,dq as A,dr as U,aS as h,V as w,aV as N,cc as I,dU as J,dV as S,dW as $,dX as E,j as V,N as q,b1 as H,G as K,bw as Q,bt as X,bu as Y,bv as Z,dj as ee,au as L,aZ as f,aR as te,aE as re,dY as R,bT as oe}from"./index-CEWggaxV.js";import ie from"./FeatureLayer-D0kMrROG.js";import{h as le}from"./GraphicsLayer-CexPXXFK.js";import{n as ae}from"./objectIdUtils-4dd1rf9p.js";import"./UniqueValueRenderer-BlkUix3g.js";import"./ColorStop-44hBlQ14.js";import"./diffUtils-B4YFa5Ju.js";import"./colorRamps-BJydlf0f.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-z2k12BH8.js";import"./jsonUtils-qYmXvGJ1.js";import"./styleUtils-CnV_Xzhi.js";import"./jsonUtils-BseLl1fZ.js";import"./Version-Bd0QsIQ5.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./OverrideHelper-B4ryGWZb.js";import"./utils-p-5Bbga5.js";import"./quantizationUtils-CUjGHrU3.js";import"./heatmapUtils-Clt5rJzr.js";import"./FormTemplate-eV18QveB.js";import"./editsZScale-CQCGPEjO.js";import"./queryZScale-DN4aFXYn.js";import"./FeatureSet-CYJUZgOk.js";import"./EditBusLayer-SG7oYwiY.js";import"./FeatureEffectLayer-CLTrRFqx.js";import"./FeatureEffect-ByrbZlne.js";import"./FeatureLayerBase-DPJuwFpX.js";import"./featureLayerUtils-BhDaw8pS.js";import"./AttachmentQuery-D61mmWw4.js";import"./RelationshipQuery-DDK72Kwc.js";import"./LayerFloorInfo-Cdq3ulNh.js";import"./serviceCapabilitiesUtils-t8SL4e_j.js";import"./FeatureReductionLayer-DncGsNIN.js";import"./FeatureReductionSelection-BY3KVXac.js";import"./LabelClass-6cZokw8y.js";import"./labelUtils-Dnqx6jl5.js";import"./defaultsJSON-CHAaurhX.js";import"./MD5-C9MwAd2G.js";import"./OrderedLayer-Do089KpQ.js";import"./OrderByInfo-DKzv2-WS.js";import"./RefreshableLayer-1EkEhJeI.js";import"./TemporalLayer-qq3v_i3q.js";import"./TimeInfo-3TVmpFSA.js";import"./FeatureTemplate-DcprAdTM.js";import"./FeatureType-By3BEr9z.js";import"./fieldProperties-DMs4wT6-.js";import"./labelingInfo-CijajRsc.js";import"./versionUtils-CaceEUVY.js";import"./styleUtils-B_Iy1DTk.js";import"./TopFeaturesQuery-B8kC7n5h.js";import"./popupUtils-DAFYyAvw.js";import"./interfaces-CL2NbQte.js";function b(t){return t.featureCollectionType==="markup"||t.layers.some(e=>e.layerDefinition.visibilityField!=null||!D(e))}function D({layerDefinition:t,featureSet:e}){const r=t.geometryType??e.geometryType;return v.find(o=>{var l,n,p;return r===o.geometryTypeJSON&&((p=(n=(l=t.drawingInfo)==null?void 0:l.renderer)==null?void 0:n.symbol)==null?void 0:p.type)===o.identifyingSymbol.type})}function j(){return new re({xmin:-180,ymin:-90,xmax:180,ymax:90})}const x=new C({name:"OBJECTID",alias:"OBJECTID",type:"oid",nullable:!1,editable:!1}),ne=new C({name:"title",alias:"Title",type:"string",nullable:!0,editable:!0,length:255});let u=class extends le{constructor(t){super(t),this.visibilityMode="inherited"}initialize(){for(const t of this.graphics)t.sourceLayer=this.layer;this.graphics.on("after-add",t=>{t.item.sourceLayer=this.layer}),this.graphics.on("after-remove",t=>{t.item.sourceLayer=null})}get fullExtent(){var r;const t=(r=this.layer)==null?void 0:r.spatialReference,e=this.fullBounds;return t?e==null?S(j(),t).geometry:E(e,t):null}get fullBounds(){var r;const t=(r=this.layer)==null?void 0:r.spatialReference;if(!t)return null;const e=I();return this.graphics.forEach(o=>{const l=o.geometry!=null?S(o.geometry,t).geometry:null;l!=null&&J(e,l.type==="point"?l:l.extent,e)}),$(e,R)?null:e}get sublayers(){return this.graphics}};i([s({readOnly:!0})],u.prototype,"fullExtent",null),i([s({readOnly:!0})],u.prototype,"fullBounds",null),i([s({readOnly:!0})],u.prototype,"sublayers",null),i([s()],u.prototype,"layer",void 0),i([s()],u.prototype,"layerId",void 0),i([s({readOnly:!0})],u.prototype,"visibilityMode",void 0),u=i([M("esri.layers.MapNotesLayer.MapNotesSublayer")],u);const v=[{geometryType:"polygon",geometryTypeJSON:"esriGeometryPolygon",id:"polygonLayer",layerId:0,title:"Polygons",identifyingSymbol:new G().toJSON()},{geometryType:"polyline",geometryTypeJSON:"esriGeometryPolyline",id:"polylineLayer",layerId:1,title:"Polylines",identifyingSymbol:new B().toJSON()},{geometryType:"multipoint",geometryTypeJSON:"esriGeometryMultipoint",id:"multipointLayer",layerId:2,title:"Multipoints",identifyingSymbol:new T().toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"pointLayer",layerId:3,title:"Points",identifyingSymbol:new T().toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"textLayer",layerId:4,title:"Text",identifyingSymbol:new F().toJSON()}];let a=class extends z(W(k(A(U(oe))))){constructor(t){super(t),this.capabilities={operations:{supportsMapNotesEditing:!0}},this.featureCollections=null,this.featureCollectionJSON=null,this.featureCollectionType="notes",this.legendEnabled=!1,this.listMode="hide-children",this.minScale=0,this.maxScale=0,this.spatialReference=h.WGS84,this.sublayers=new w(v.map(e=>new u({id:e.id,layerId:e.layerId,title:e.title,layer:this}))),this.title="Map Notes",this.type="map-notes",this.visibilityMode="inherited"}readCapabilities(t,e,r){return{operations:{supportsMapNotesEditing:!b(e)&&(r==null?void 0:r.origin)!=="portal-item"}}}readFeatureCollections(t,e,r){if(!b(e))return null;const o=e.layers.map(l=>{const n=new ie;return n.read(l,r),n});return new w({items:o})}readLegacyfeatureCollectionJSON(t,e){return b(e)?N(e.featureCollection):null}get fullExtent(){var r;const t=this.spatialReference,e=I();return this.sublayers!=null?this.sublayers.forEach(({fullBounds:o})=>o!=null?J(e,o,e):e,e):(r=this.featureCollectionJSON)!=null&&r.layers.some(o=>o.layerDefinition.extent)&&this.featureCollectionJSON.layers.forEach(o=>{const l=S(o.layerDefinition.extent,t).geometry;l!=null&&J(e,l,e)}),$(e,R)?S(j(),t).geometry:E(e,t)}readMinScale(t,e){for(const r of e.layers)if(r.layerDefinition.minScale!=null)return r.layerDefinition.minScale;return 0}readMaxScale(t,e){for(const r of e.layers)if(r.layerDefinition.maxScale!=null)return r.layerDefinition.maxScale;return 0}get multipointLayer(){return this._findSublayer("multipointLayer")}get pointLayer(){return this._findSublayer("pointLayer")}get polygonLayer(){return this._findSublayer("polygonLayer")}get polylineLayer(){return this._findSublayer("polylineLayer")}readSpatialReference(t,e){return e.layers.length?h.fromJSON(e.layers[0].layerDefinition.spatialReference):h.WGS84}readSublayers(t,e,r){if(b(e))return null;const o=[];let l=e.layers.reduce((n,p)=>Math.max(n,p.layerDefinition.id??-1),-1)+1;for(const n of e.layers){const{layerDefinition:p,featureSet:y}=n,m=p.id??l++,d=D(n);if(d!=null){const c=new u({id:d.id,title:p.name,layerId:m,layer:this,graphics:y.features.map(({geometry:g,symbol:O,attributes:_,popupInfo:P})=>V.fromJSON({attributes:_,geometry:g,symbol:O,popupTemplate:P}))});o.push(c)}}return new w(o)}writeSublayers(t,e,r,o){var d;const{minScale:l,maxScale:n}=this;if(t==null)return;const p=t.some(c=>c.graphics.length>0);if(!this.capabilities.operations.supportsMapNotesEditing)return void(p&&((d=o==null?void 0:o.messages)==null?void 0:d.push(new q("map-notes-layer:editing-not-supported","New map notes cannot be added to this layer"))));const y=[];let m=this.spatialReference.toJSON();e:for(const c of t)for(const g of c.graphics)if(g.geometry!=null){m=g.geometry.spatialReference.toJSON();break e}for(const c of v){const g=t.find(O=>c.id===O.id);this._writeMapNoteSublayer(y,g,c,l,n,m,o)}H("featureCollection.layers",y,e)}get textLayer(){return this._findSublayer("textLayer")}load(t){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},t)),Promise.resolve(this)}read(t,e){"featureCollection"in t&&(t=N(t),Object.assign(t,t.featureCollection)),super.read(t,e)}async beforeSave(){if(this.sublayers==null)return;let t=null;const e=[];for(const o of this.sublayers)for(const l of o.graphics)if(l.geometry!=null){const n=l.geometry;t?K(n.spatialReference,t)||(Q(n.spatialReference,t)||X()||await Y(),l.geometry=Z(n,t)):t=n.spatialReference,e.push(l)}const r=await ee(e.map(o=>o.geometry));e.forEach((o,l)=>o.geometry=r[l])}_findSublayer(t){var e;return this.sublayers==null?null:((e=this.sublayers)==null?void 0:e.find(r=>r.id===t))??null}_writeMapNoteSublayer(t,e,r,o,l,n,p){const y=[];if(e!=null){for(const m of e.graphics)this._writeMapNote(y,m,r.geometryType,p);this._normalizeObjectIds(y,x),t.push({layerDefinition:{name:e.title,drawingInfo:{renderer:{type:"simple",symbol:N(r.identifyingSymbol)}},id:e.layerId,geometryType:r.geometryTypeJSON,minScale:o,maxScale:l,objectIdField:"OBJECTID",fields:[x.toJSON(),ne.toJSON()],spatialReference:n},featureSet:{features:y,geometryType:r.geometryTypeJSON}})}}_writeMapNote(t,e,r,o){var m,d;if(e==null)return;const{geometry:l,symbol:n,popupTemplate:p}=e;if(l==null)return;if(l.type!==r)return void((m=o==null?void 0:o.messages)==null?void 0:m.push(new L("map-notes-layer:invalid-geometry-type",`Geometry "${l.type}" cannot be saved in "${r}" layer`,{graphic:e})));if(n==null)return void((d=o==null?void 0:o.messages)==null?void 0:d.push(new L("map-notes-layer:no-symbol","Skipping map notes with no symbol",{graphic:e})));const y={attributes:{...e.attributes},geometry:l.toJSON(),symbol:n.toJSON()};p!=null&&(y.popupInfo=p.toJSON()),t.push(y)}_normalizeObjectIds(t,e){const r=e.name;let o=ae(r,t)+1;const l=new Set;for(const n of t){n.attributes||(n.attributes={});const{attributes:p}=n;(p[r]==null||l.has(p[r]))&&(p[r]=o++),l.add(p[r])}}};i([s({readOnly:!0})],a.prototype,"capabilities",void 0),i([f(["portal-item","web-map"],"capabilities",["layers"])],a.prototype,"readCapabilities",null),i([s({readOnly:!0})],a.prototype,"featureCollections",void 0),i([f(["web-map","portal-item"],"featureCollections",["layers"])],a.prototype,"readFeatureCollections",null),i([s({readOnly:!0,json:{origins:{"web-map":{write:{enabled:!0,target:"featureCollection"}}}}})],a.prototype,"featureCollectionJSON",void 0),i([f(["web-map","portal-item"],"featureCollectionJSON",["featureCollection"])],a.prototype,"readLegacyfeatureCollectionJSON",null),i([s({readOnly:!0,json:{read:!0,write:{enabled:!0,ignoreOrigin:!0}}})],a.prototype,"featureCollectionType",void 0),i([s({readOnly:!0})],a.prototype,"fullExtent",null),i([s({readOnly:!0,json:{origins:{"web-map":{write:{target:"featureCollection.showLegend",overridePolicy(){return{enabled:this.featureCollectionJSON!=null}}}}}}})],a.prototype,"legendEnabled",void 0),i([s({type:["show","hide","hide-children"]})],a.prototype,"listMode",void 0),i([s({type:Number,nonNullable:!0,json:{write:!1}})],a.prototype,"minScale",void 0),i([f(["web-map","portal-item"],"minScale",["layers"])],a.prototype,"readMinScale",null),i([s({type:Number,nonNullable:!0,json:{write:!1}})],a.prototype,"maxScale",void 0),i([f(["web-map","portal-item"],"maxScale",["layers"])],a.prototype,"readMaxScale",null),i([s({readOnly:!0})],a.prototype,"multipointLayer",null),i([s({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],a.prototype,"operationalLayerType",void 0),i([s({readOnly:!0})],a.prototype,"pointLayer",null),i([s({readOnly:!0})],a.prototype,"polygonLayer",null),i([s({readOnly:!0})],a.prototype,"polylineLayer",null),i([s({type:h})],a.prototype,"spatialReference",void 0),i([f(["web-map","portal-item"],"spatialReference",["layers"])],a.prototype,"readSpatialReference",null),i([s({readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],a.prototype,"sublayers",void 0),i([f("web-map","sublayers",["layers"])],a.prototype,"readSublayers",null),i([te("web-map","sublayers")],a.prototype,"writeSublayers",null),i([s({readOnly:!0})],a.prototype,"textLayer",null),i([s()],a.prototype,"title",void 0),i([s({readOnly:!0,json:{read:!1}})],a.prototype,"type",void 0),a=i([M("esri.layers.MapNotesLayer")],a);const nt=a;export{nt as default}; +import{a_ as C,d as i,y as s,f as M,dz as G,dw as B,dy as T,dT as F,bP as z,bQ as W,dp as k,dq as A,dr as U,aS as h,V as w,aV as N,cc as I,dU as J,dV as S,dW as $,dX as E,j as V,N as q,b1 as H,G as K,bw as Q,bt as X,bu as Y,bv as Z,dj as ee,au as L,aZ as f,aR as te,aE as re,dY as R,bT as oe}from"./index-BjUNJPVf.js";import ie from"./FeatureLayer-BHxNIHhy.js";import{h as le}from"./GraphicsLayer-g4hVfoZU.js";import{n as ae}from"./objectIdUtils-4dd1rf9p.js";import"./UniqueValueRenderer-7V9Bhr-D.js";import"./ColorStop-DCGjAKLC.js";import"./diffUtils-uUoMDFQS.js";import"./colorRamps-CcakIWlU.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-BX9G5gNQ.js";import"./jsonUtils-Ox5U0P0F.js";import"./styleUtils-DOUOskVZ.js";import"./jsonUtils-Dw332y6z.js";import"./Version-Dqq_CHBG.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./OverrideHelper-DxFZBnGL.js";import"./utils-CuXO_Zzq.js";import"./quantizationUtils-CfV316jZ.js";import"./heatmapUtils-BSteZBTj.js";import"./FormTemplate-BGxtsGX6.js";import"./editsZScale-Bfe6gH1b.js";import"./queryZScale-Dwvn5BlQ.js";import"./FeatureSet-opEn8ou8.js";import"./EditBusLayer-OslMX9fF.js";import"./FeatureEffectLayer-DarO4Ctx.js";import"./FeatureEffect-DBbkrS6j.js";import"./FeatureLayerBase-D0I-Escx.js";import"./featureLayerUtils-lwqyOSrl.js";import"./AttachmentQuery-DmEAIZff.js";import"./RelationshipQuery-BDJrOxaX.js";import"./LayerFloorInfo-DlYNbO-A.js";import"./serviceCapabilitiesUtils-DiP90Uds.js";import"./FeatureReductionLayer-CK-tyM-9.js";import"./FeatureReductionSelection-t3T7oa8H.js";import"./LabelClass-CeatfK8u.js";import"./labelUtils-3p0-m-Ee.js";import"./defaultsJSON-CHAaurhX.js";import"./MD5-C9MwAd2G.js";import"./OrderedLayer-dLoPhxcx.js";import"./OrderByInfo-DKyk5GLW.js";import"./RefreshableLayer-_r2TPtol.js";import"./TemporalLayer-CKICYnEl.js";import"./TimeInfo-DooETFWC.js";import"./FeatureTemplate-FZNGA_Ik.js";import"./FeatureType-CwUl8Nf5.js";import"./fieldProperties-DnrQXLBM.js";import"./labelingInfo-DqAUis6e.js";import"./versionUtils-BIAEZzrm.js";import"./styleUtils--I7zqeL6.js";import"./TopFeaturesQuery-CVQjqlfM.js";import"./popupUtils-DlZin22m.js";import"./interfaces-CL2NbQte.js";function b(t){return t.featureCollectionType==="markup"||t.layers.some(e=>e.layerDefinition.visibilityField!=null||!D(e))}function D({layerDefinition:t,featureSet:e}){const r=t.geometryType??e.geometryType;return v.find(o=>{var l,n,p;return r===o.geometryTypeJSON&&((p=(n=(l=t.drawingInfo)==null?void 0:l.renderer)==null?void 0:n.symbol)==null?void 0:p.type)===o.identifyingSymbol.type})}function j(){return new re({xmin:-180,ymin:-90,xmax:180,ymax:90})}const x=new C({name:"OBJECTID",alias:"OBJECTID",type:"oid",nullable:!1,editable:!1}),ne=new C({name:"title",alias:"Title",type:"string",nullable:!0,editable:!0,length:255});let u=class extends le{constructor(t){super(t),this.visibilityMode="inherited"}initialize(){for(const t of this.graphics)t.sourceLayer=this.layer;this.graphics.on("after-add",t=>{t.item.sourceLayer=this.layer}),this.graphics.on("after-remove",t=>{t.item.sourceLayer=null})}get fullExtent(){var r;const t=(r=this.layer)==null?void 0:r.spatialReference,e=this.fullBounds;return t?e==null?S(j(),t).geometry:E(e,t):null}get fullBounds(){var r;const t=(r=this.layer)==null?void 0:r.spatialReference;if(!t)return null;const e=I();return this.graphics.forEach(o=>{const l=o.geometry!=null?S(o.geometry,t).geometry:null;l!=null&&J(e,l.type==="point"?l:l.extent,e)}),$(e,R)?null:e}get sublayers(){return this.graphics}};i([s({readOnly:!0})],u.prototype,"fullExtent",null),i([s({readOnly:!0})],u.prototype,"fullBounds",null),i([s({readOnly:!0})],u.prototype,"sublayers",null),i([s()],u.prototype,"layer",void 0),i([s()],u.prototype,"layerId",void 0),i([s({readOnly:!0})],u.prototype,"visibilityMode",void 0),u=i([M("esri.layers.MapNotesLayer.MapNotesSublayer")],u);const v=[{geometryType:"polygon",geometryTypeJSON:"esriGeometryPolygon",id:"polygonLayer",layerId:0,title:"Polygons",identifyingSymbol:new G().toJSON()},{geometryType:"polyline",geometryTypeJSON:"esriGeometryPolyline",id:"polylineLayer",layerId:1,title:"Polylines",identifyingSymbol:new B().toJSON()},{geometryType:"multipoint",geometryTypeJSON:"esriGeometryMultipoint",id:"multipointLayer",layerId:2,title:"Multipoints",identifyingSymbol:new T().toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"pointLayer",layerId:3,title:"Points",identifyingSymbol:new T().toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"textLayer",layerId:4,title:"Text",identifyingSymbol:new F().toJSON()}];let a=class extends z(W(k(A(U(oe))))){constructor(t){super(t),this.capabilities={operations:{supportsMapNotesEditing:!0}},this.featureCollections=null,this.featureCollectionJSON=null,this.featureCollectionType="notes",this.legendEnabled=!1,this.listMode="hide-children",this.minScale=0,this.maxScale=0,this.spatialReference=h.WGS84,this.sublayers=new w(v.map(e=>new u({id:e.id,layerId:e.layerId,title:e.title,layer:this}))),this.title="Map Notes",this.type="map-notes",this.visibilityMode="inherited"}readCapabilities(t,e,r){return{operations:{supportsMapNotesEditing:!b(e)&&(r==null?void 0:r.origin)!=="portal-item"}}}readFeatureCollections(t,e,r){if(!b(e))return null;const o=e.layers.map(l=>{const n=new ie;return n.read(l,r),n});return new w({items:o})}readLegacyfeatureCollectionJSON(t,e){return b(e)?N(e.featureCollection):null}get fullExtent(){var r;const t=this.spatialReference,e=I();return this.sublayers!=null?this.sublayers.forEach(({fullBounds:o})=>o!=null?J(e,o,e):e,e):(r=this.featureCollectionJSON)!=null&&r.layers.some(o=>o.layerDefinition.extent)&&this.featureCollectionJSON.layers.forEach(o=>{const l=S(o.layerDefinition.extent,t).geometry;l!=null&&J(e,l,e)}),$(e,R)?S(j(),t).geometry:E(e,t)}readMinScale(t,e){for(const r of e.layers)if(r.layerDefinition.minScale!=null)return r.layerDefinition.minScale;return 0}readMaxScale(t,e){for(const r of e.layers)if(r.layerDefinition.maxScale!=null)return r.layerDefinition.maxScale;return 0}get multipointLayer(){return this._findSublayer("multipointLayer")}get pointLayer(){return this._findSublayer("pointLayer")}get polygonLayer(){return this._findSublayer("polygonLayer")}get polylineLayer(){return this._findSublayer("polylineLayer")}readSpatialReference(t,e){return e.layers.length?h.fromJSON(e.layers[0].layerDefinition.spatialReference):h.WGS84}readSublayers(t,e,r){if(b(e))return null;const o=[];let l=e.layers.reduce((n,p)=>Math.max(n,p.layerDefinition.id??-1),-1)+1;for(const n of e.layers){const{layerDefinition:p,featureSet:y}=n,m=p.id??l++,d=D(n);if(d!=null){const c=new u({id:d.id,title:p.name,layerId:m,layer:this,graphics:y.features.map(({geometry:g,symbol:O,attributes:_,popupInfo:P})=>V.fromJSON({attributes:_,geometry:g,symbol:O,popupTemplate:P}))});o.push(c)}}return new w(o)}writeSublayers(t,e,r,o){var d;const{minScale:l,maxScale:n}=this;if(t==null)return;const p=t.some(c=>c.graphics.length>0);if(!this.capabilities.operations.supportsMapNotesEditing)return void(p&&((d=o==null?void 0:o.messages)==null?void 0:d.push(new q("map-notes-layer:editing-not-supported","New map notes cannot be added to this layer"))));const y=[];let m=this.spatialReference.toJSON();e:for(const c of t)for(const g of c.graphics)if(g.geometry!=null){m=g.geometry.spatialReference.toJSON();break e}for(const c of v){const g=t.find(O=>c.id===O.id);this._writeMapNoteSublayer(y,g,c,l,n,m,o)}H("featureCollection.layers",y,e)}get textLayer(){return this._findSublayer("textLayer")}load(t){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},t)),Promise.resolve(this)}read(t,e){"featureCollection"in t&&(t=N(t),Object.assign(t,t.featureCollection)),super.read(t,e)}async beforeSave(){if(this.sublayers==null)return;let t=null;const e=[];for(const o of this.sublayers)for(const l of o.graphics)if(l.geometry!=null){const n=l.geometry;t?K(n.spatialReference,t)||(Q(n.spatialReference,t)||X()||await Y(),l.geometry=Z(n,t)):t=n.spatialReference,e.push(l)}const r=await ee(e.map(o=>o.geometry));e.forEach((o,l)=>o.geometry=r[l])}_findSublayer(t){var e;return this.sublayers==null?null:((e=this.sublayers)==null?void 0:e.find(r=>r.id===t))??null}_writeMapNoteSublayer(t,e,r,o,l,n,p){const y=[];if(e!=null){for(const m of e.graphics)this._writeMapNote(y,m,r.geometryType,p);this._normalizeObjectIds(y,x),t.push({layerDefinition:{name:e.title,drawingInfo:{renderer:{type:"simple",symbol:N(r.identifyingSymbol)}},id:e.layerId,geometryType:r.geometryTypeJSON,minScale:o,maxScale:l,objectIdField:"OBJECTID",fields:[x.toJSON(),ne.toJSON()],spatialReference:n},featureSet:{features:y,geometryType:r.geometryTypeJSON}})}}_writeMapNote(t,e,r,o){var m,d;if(e==null)return;const{geometry:l,symbol:n,popupTemplate:p}=e;if(l==null)return;if(l.type!==r)return void((m=o==null?void 0:o.messages)==null?void 0:m.push(new L("map-notes-layer:invalid-geometry-type",`Geometry "${l.type}" cannot be saved in "${r}" layer`,{graphic:e})));if(n==null)return void((d=o==null?void 0:o.messages)==null?void 0:d.push(new L("map-notes-layer:no-symbol","Skipping map notes with no symbol",{graphic:e})));const y={attributes:{...e.attributes},geometry:l.toJSON(),symbol:n.toJSON()};p!=null&&(y.popupInfo=p.toJSON()),t.push(y)}_normalizeObjectIds(t,e){const r=e.name;let o=ae(r,t)+1;const l=new Set;for(const n of t){n.attributes||(n.attributes={});const{attributes:p}=n;(p[r]==null||l.has(p[r]))&&(p[r]=o++),l.add(p[r])}}};i([s({readOnly:!0})],a.prototype,"capabilities",void 0),i([f(["portal-item","web-map"],"capabilities",["layers"])],a.prototype,"readCapabilities",null),i([s({readOnly:!0})],a.prototype,"featureCollections",void 0),i([f(["web-map","portal-item"],"featureCollections",["layers"])],a.prototype,"readFeatureCollections",null),i([s({readOnly:!0,json:{origins:{"web-map":{write:{enabled:!0,target:"featureCollection"}}}}})],a.prototype,"featureCollectionJSON",void 0),i([f(["web-map","portal-item"],"featureCollectionJSON",["featureCollection"])],a.prototype,"readLegacyfeatureCollectionJSON",null),i([s({readOnly:!0,json:{read:!0,write:{enabled:!0,ignoreOrigin:!0}}})],a.prototype,"featureCollectionType",void 0),i([s({readOnly:!0})],a.prototype,"fullExtent",null),i([s({readOnly:!0,json:{origins:{"web-map":{write:{target:"featureCollection.showLegend",overridePolicy(){return{enabled:this.featureCollectionJSON!=null}}}}}}})],a.prototype,"legendEnabled",void 0),i([s({type:["show","hide","hide-children"]})],a.prototype,"listMode",void 0),i([s({type:Number,nonNullable:!0,json:{write:!1}})],a.prototype,"minScale",void 0),i([f(["web-map","portal-item"],"minScale",["layers"])],a.prototype,"readMinScale",null),i([s({type:Number,nonNullable:!0,json:{write:!1}})],a.prototype,"maxScale",void 0),i([f(["web-map","portal-item"],"maxScale",["layers"])],a.prototype,"readMaxScale",null),i([s({readOnly:!0})],a.prototype,"multipointLayer",null),i([s({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],a.prototype,"operationalLayerType",void 0),i([s({readOnly:!0})],a.prototype,"pointLayer",null),i([s({readOnly:!0})],a.prototype,"polygonLayer",null),i([s({readOnly:!0})],a.prototype,"polylineLayer",null),i([s({type:h})],a.prototype,"spatialReference",void 0),i([f(["web-map","portal-item"],"spatialReference",["layers"])],a.prototype,"readSpatialReference",null),i([s({readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],a.prototype,"sublayers",void 0),i([f("web-map","sublayers",["layers"])],a.prototype,"readSublayers",null),i([te("web-map","sublayers")],a.prototype,"writeSublayers",null),i([s({readOnly:!0})],a.prototype,"textLayer",null),i([s()],a.prototype,"title",void 0),i([s({readOnly:!0,json:{read:!1}})],a.prototype,"type",void 0),a=i([M("esri.layers.MapNotesLayer")],a);const nt=a;export{nt as default}; diff --git a/assets/MapNotesLayerView2D-DxdmUoTh.js b/assets/MapNotesLayerView2D-DgCKO3Zc.js similarity index 71% rename from assets/MapNotesLayerView2D-DxdmUoTh.js rename to assets/MapNotesLayerView2D-DgCKO3Zc.js index b050100..98ae088 100644 --- a/assets/MapNotesLayerView2D-DxdmUoTh.js +++ b/assets/MapNotesLayerView2D-DgCKO3Zc.js @@ -1 +1 @@ -import{j as u,V as f,q as w,e as c,g as a,P as o,z as y,d as _,f as V}from"./index-CEWggaxV.js";import{t as v}from"./highlightReasons-DbgbcWKM.js";import{m as C,u as H}from"./LayerView-BEFTHNYv.js";import{t as g}from"./GraphicContainer-CbvswCG0.js";import{$ as d}from"./GraphicsView2D-DbbthiwV.js";import"./scaleUtils-Bqauo1zZ.js";import"./Container-CB7SlLB9.js";import"./Texture-DJgkMrSB.js";import"./AGraphicContainer-Dby-baET.js";import"./TechniqueInstance-CSsTmbek.js";import"./UpdateTracking2D-nj9Q-3df.js";import"./TurboLine-CkxIB4ZX.js";import"./earcut-hRlx3adE.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./utils-p-5Bbga5.js";import"./Rect-CUzevAry.js";import"./LabelMetric-D2hbzzy_.js";import"./Program-DLRmaKpw.js";import"./labelUtils-Dnqx6jl5.js";import"./defaultsJSON-CHAaurhX.js";import"./BindType-BmZEZMMh.js";import"./Util-BS8sJGjF.js";import"./constants-D5zmR9t2.js";import"./TileContainer-Ci6dOowA.js";import"./WGLContainer-B_Pv-8Yi.js";import"./ProgramTemplate-BICQrNzS.js";import"./config-MDUrh2eL.js";import"./featureConversionUtils-CmP9mw0r.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./FeatureCommandQueue-Btq_FXyi.js";import"./vec3f32-nZdmKIgz.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./OverrideHelper-B4ryGWZb.js";import"./quantizationUtils-CUjGHrU3.js";import"./AttributeStore-Ck-75lnq.js";import"./TimeOnly-Cm47ew5I.js";import"./timeSupport-BjRbXIpn.js";import"./json-Wa8cmqdu.js";import"./diffUtils-B4YFa5Ju.js";import"./normalizeUtilsSync-B6VufdiX.js";const m="sublayers",l="layerView";let n=class extends C(H){constructor(){super(...arguments),this._highlightIds=new Map}*graphicsViews(){this._graphicsViewsFeatureCollectionMap==null?this._graphicsViews==null?yield*[]:yield*this._graphicsViews:yield*this._graphicsViewsFeatureCollectionMap.keys()}async hitTest(i,t){return Array.from(this.graphicsViews(),e=>{const s=e.hitTest(i);if(this._graphicsViewsFeatureCollectionMap!=null){const h=this._graphicsViewsFeatureCollectionMap.get(e);for(const r of s)!r.popupTemplate&&h.popupTemplate&&(r.popupTemplate=h.popupTemplate),r.sourceLayer=r.layer=this.layer}return s}).flat().map(e=>({type:"graphic",graphic:e,layer:this.layer,mapPoint:i}))}highlight(i){let t;typeof i=="number"?t=[i]:i instanceof u?t=[i.uid]:Array.isArray(i)&&i.length>0?t=typeof i[0]=="number"?i:i.map(s=>s&&s.uid):f.isCollection(i)&&(t=i.map(s=>s&&s.uid).toArray());const e=t==null?void 0:t.filter(w);return e!=null&&e.length?(this._addHighlight(e),c(()=>this._removeHighlight(e))):c()}update(i){for(const t of this.graphicsViews())t.processUpdate(i)}attach(){const i=this.view,t=()=>this.requestUpdate(),e=this.layer.featureCollections;if(e!=null&&e.length){this._graphicsViewsFeatureCollectionMap=new Map;for(const s of e){const h=new g(this.view.featuresTilingScheme),r=new d({view:i,graphics:s.source,renderer:s.renderer,requestUpdateCallback:t,container:h});this._graphicsViewsFeatureCollectionMap.set(r,s),this.container.addChild(r.container),this.addHandles([a(()=>s.visible,p=>r.container.visible=p,o),a(()=>r.updating,()=>this.notifyChange("updating"),o)],l)}this._updateHighlight()}else this.layer.sublayers!=null&&this.addHandles(y(()=>this.layer.sublayers,"change",()=>this._createGraphicsViews(),{onListenerAdd:()=>this._createGraphicsViews(),onListenerRemove:()=>this._destroyGraphicsViews()}),m)}detach(){this._destroyGraphicsViews(),this.removeHandles(m)}moveStart(){}moveEnd(){}viewChange(){for(const i of this.graphicsViews())i.viewChange()}isUpdating(){for(const i of this.graphicsViews())if(i.updating)return!0;return!1}_destroyGraphicsViews(){this.container.removeAllChildren(),this.removeHandles(l);for(const i of this.graphicsViews())i.destroy();this._graphicsViews=null,this._graphicsViewsFeatureCollectionMap=null}_createGraphicsViews(){if(this._destroyGraphicsViews(),this.layer.sublayers==null)return;const i=[],t=this.view,e=()=>this.requestUpdate();for(const s of this.layer.sublayers){const h=new g(this.view.featuresTilingScheme);h.fadeTransitionEnabled=!0;const r=new d({view:t,graphics:s.graphics,requestUpdateCallback:e,container:h});this.addHandles([s.on("graphic-update",r.graphicUpdateHandler),a(()=>s.visible,p=>r.container.visible=p,o),a(()=>r.updating,()=>this.notifyChange("updating"),o)],l),this.container.addChild(r.container),i.push(r)}this._graphicsViews=i,this._updateHighlight()}_addHighlight(i){for(const t of i)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t);this._highlightIds.set(t,e+1)}else this._highlightIds.set(t,1);this._updateHighlight()}_removeHighlight(i){for(const t of i)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t)-1;e===0?this._highlightIds.delete(t):this._highlightIds.set(t,e)}this._updateHighlight()}_updateHighlight(){const i=Array.from(this._highlightIds.keys()),t=v("highlight");for(const e of this.graphicsViews())e.setHighlight(i.map(s=>({objectId:s,highlightFlags:t})))}};n=_([V("esri.views.2d.layers.MapNotesLayerView2D")],n);const ci=n;export{ci as default}; +import{j as u,V as f,q as w,e as c,g as a,P as o,z as y,d as _,f as V}from"./index-BjUNJPVf.js";import{t as v}from"./highlightReasons-BOU4mnPE.js";import{m as C,u as H}from"./LayerView-Bux7vAEn.js";import{t as g}from"./GraphicContainer-Bue3JF2r.js";import{$ as d}from"./GraphicsView2D-B7H8XAnI.js";import"./scaleUtils-DWXMiS7R.js";import"./Container-_n5wCgez.js";import"./Texture-S4dD-WHn.js";import"./AGraphicContainer-BXk7Eu6w.js";import"./TechniqueInstance-XtnK2qy2.js";import"./UpdateTracking2D-Ds_Gdrxd.js";import"./TurboLine-DNQdPIXo.js";import"./earcut-CWKXDqDj.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./utils-CuXO_Zzq.js";import"./Rect-CUzevAry.js";import"./LabelMetric-BcUxDImF.js";import"./Program-DBsYtQ00.js";import"./labelUtils-3p0-m-Ee.js";import"./defaultsJSON-CHAaurhX.js";import"./BindType-BmZEZMMh.js";import"./Util-CS5u4Lec.js";import"./constants-D5zmR9t2.js";import"./TileContainer-Bs-vXdD_.js";import"./WGLContainer-DgZNq7b0.js";import"./ProgramTemplate-Ck2I0bIi.js";import"./config-MDUrh2eL.js";import"./featureConversionUtils-BHhm7bvm.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./FeatureCommandQueue-DI81F3gA.js";import"./vec3f32-nZdmKIgz.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./OverrideHelper-DxFZBnGL.js";import"./quantizationUtils-CfV316jZ.js";import"./AttributeStore-Bm6hLtR1.js";import"./TimeOnly-BXSODLxA.js";import"./timeSupport-DXkhlToK.js";import"./json-Wa8cmqdu.js";import"./diffUtils-uUoMDFQS.js";import"./normalizeUtilsSync-73yZ0QwV.js";const m="sublayers",l="layerView";let n=class extends C(H){constructor(){super(...arguments),this._highlightIds=new Map}*graphicsViews(){this._graphicsViewsFeatureCollectionMap==null?this._graphicsViews==null?yield*[]:yield*this._graphicsViews:yield*this._graphicsViewsFeatureCollectionMap.keys()}async hitTest(i,t){return Array.from(this.graphicsViews(),e=>{const s=e.hitTest(i);if(this._graphicsViewsFeatureCollectionMap!=null){const h=this._graphicsViewsFeatureCollectionMap.get(e);for(const r of s)!r.popupTemplate&&h.popupTemplate&&(r.popupTemplate=h.popupTemplate),r.sourceLayer=r.layer=this.layer}return s}).flat().map(e=>({type:"graphic",graphic:e,layer:this.layer,mapPoint:i}))}highlight(i){let t;typeof i=="number"?t=[i]:i instanceof u?t=[i.uid]:Array.isArray(i)&&i.length>0?t=typeof i[0]=="number"?i:i.map(s=>s&&s.uid):f.isCollection(i)&&(t=i.map(s=>s&&s.uid).toArray());const e=t==null?void 0:t.filter(w);return e!=null&&e.length?(this._addHighlight(e),c(()=>this._removeHighlight(e))):c()}update(i){for(const t of this.graphicsViews())t.processUpdate(i)}attach(){const i=this.view,t=()=>this.requestUpdate(),e=this.layer.featureCollections;if(e!=null&&e.length){this._graphicsViewsFeatureCollectionMap=new Map;for(const s of e){const h=new g(this.view.featuresTilingScheme),r=new d({view:i,graphics:s.source,renderer:s.renderer,requestUpdateCallback:t,container:h});this._graphicsViewsFeatureCollectionMap.set(r,s),this.container.addChild(r.container),this.addHandles([a(()=>s.visible,p=>r.container.visible=p,o),a(()=>r.updating,()=>this.notifyChange("updating"),o)],l)}this._updateHighlight()}else this.layer.sublayers!=null&&this.addHandles(y(()=>this.layer.sublayers,"change",()=>this._createGraphicsViews(),{onListenerAdd:()=>this._createGraphicsViews(),onListenerRemove:()=>this._destroyGraphicsViews()}),m)}detach(){this._destroyGraphicsViews(),this.removeHandles(m)}moveStart(){}moveEnd(){}viewChange(){for(const i of this.graphicsViews())i.viewChange()}isUpdating(){for(const i of this.graphicsViews())if(i.updating)return!0;return!1}_destroyGraphicsViews(){this.container.removeAllChildren(),this.removeHandles(l);for(const i of this.graphicsViews())i.destroy();this._graphicsViews=null,this._graphicsViewsFeatureCollectionMap=null}_createGraphicsViews(){if(this._destroyGraphicsViews(),this.layer.sublayers==null)return;const i=[],t=this.view,e=()=>this.requestUpdate();for(const s of this.layer.sublayers){const h=new g(this.view.featuresTilingScheme);h.fadeTransitionEnabled=!0;const r=new d({view:t,graphics:s.graphics,requestUpdateCallback:e,container:h});this.addHandles([s.on("graphic-update",r.graphicUpdateHandler),a(()=>s.visible,p=>r.container.visible=p,o),a(()=>r.updating,()=>this.notifyChange("updating"),o)],l),this.container.addChild(r.container),i.push(r)}this._graphicsViews=i,this._updateHighlight()}_addHighlight(i){for(const t of i)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t);this._highlightIds.set(t,e+1)}else this._highlightIds.set(t,1);this._updateHighlight()}_removeHighlight(i){for(const t of i)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t)-1;e===0?this._highlightIds.delete(t):this._highlightIds.set(t,e)}this._updateHighlight()}_updateHighlight(){const i=Array.from(this._highlightIds.keys()),t=v("highlight");for(const e of this.graphicsViews())e.setHighlight(i.map(s=>({objectId:s,highlightFlags:t})))}};n=_([V("esri.views.2d.layers.MapNotesLayerView2D")],n);const ci=n;export{ci as default}; diff --git a/assets/MediaLayer-DrFcRt_9.js b/assets/MediaLayer-CdtBPk34.js similarity index 96% rename from assets/MediaLayer-DrFcRt_9.js rename to assets/MediaLayer-CdtBPk34.js index 38319c5..0277e92 100644 --- a/assets/MediaLayer-DrFcRt_9.js +++ b/assets/MediaLayer-CdtBPk34.js @@ -1,7 +1,7 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/mediaLayerUtils-LvFj83T-.js","assets/utils-2LBmsoaQ.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css","assets/originUtils-D69mHv66.js","assets/multiOriginJSONSupportUtils-C0wm8_Yw.js","assets/saveAPIKeyUtils-BiX1lQSW.js","assets/saveUtils-BzCRy3uR.js","assets/resourceUtils-Cu1-5qu3.js","assets/resourceUtils-CjqYbm2Q.js"] + __vite__mapDeps.viteFileDeps = ["assets/mediaLayerUtils-DFCF50LE.js","assets/utils-iOpWi7jV.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css","assets/originUtils-D69mHv66.js","assets/multiOriginJSONSupportUtils-C0wm8_Yw.js","assets/saveAPIKeyUtils-YRBbgdzi.js","assets/saveUtils-CGGzyvzv.js","assets/resourceUtils-p9pTIVIi.js","assets/resourceUtils-CfE36DzP.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{d as s,f as x,hO as Oe,dV as k,s as U,y as l,aA as m,dm as Me,aS as Pe,fj as A,N as D,fY as H,j5 as Ee,aZ as J,aR as ie,j6 as z,j7 as de,aB as ae,fU as w,a7 as Le,j8 as K,aE as le,cN as je,j9 as he,ja as Te,jb as He,dr as ve,fw as xe,dF as Ae,bs as ee,d5 as Ve,dD as me,dH as Ce,dE as We,dG as Ne,jc as we,dI as Ge,jd as ze,M as Ue,da as Be,b_ as Fe,je as ke,V as X,hk as De,ca as Je,g as qe,at as Ke,w as Ye,d2 as Ze,G as Qe,bv as Xe,ff as et,g1 as tt,bP as nt,bQ as ot,dp as rt,dq as st,k as it,e1 as at,bT as lt,_ as ct}from"./index-CEWggaxV.js";import{p as ut}from"./imageUtils-DNanu5Rn.js";import{p as R,j as Re,m as pt}from"./perspectiveUtils-24oy2YlR.js";import{t as dt,e as te}from"./mat3f64-q3fE-ZOt.js";import{p as ht}from"./resourceExtension-orEjzZQo.js";import{o as mt}from"./BoundsStore-DMoG4U0L.js";import{A as Y}from"./interfaces-CL2NbQte.js";import"./normalizeUtilsSync-B6VufdiX.js";import"./PooledRBush-BsFBmw1o.js";let re=class extends Oe{projectOrWarn(e,t){if(e==null)return e;const{geometry:n,pending:o}=k(e,t);return o?null:o||n?n:(U.getLogger(this).warn("geometry could not be projected to the spatial reference",{georeference:this,geometry:e,sourceSpatialReference:e.spatialReference,targetSpatialReference:t}),null)}};re=s([x("esri.layers.support.GeoreferenceBase")],re);const q=re,ne=te(),p=w();let F=class extends Le{constructor(){super(...arguments),this.sourcePoint=null,this.mapPoint=null}};s([l()],F.prototype,"sourcePoint",void 0),s([l({type:m})],F.prototype,"mapPoint",void 0),F=s([x("esri.layers.support.ControlPoint")],F);let P=class extends Me(q){constructor(t){super(t),this.controlPoints=null,this.height=0,this.type="control-points",this.width=0}readControlPoints(t,n){const o=Pe.fromJSON(n.spatialReference),r=dt(...n.coefficients,1);return t.map(i=>(A(p,i.x,i.y),R(p,p,r),{sourcePoint:i,mapPoint:new m({x:p[0],y:p[1],spatialReference:o})}))}writeControlPoints(t,n,o,r){if(this.transform!=null)t!=null&&y(t[0])&&(n.controlPoints=t.map(i=>{const a=i.sourcePoint;return{x:a.x,y:a.y}}),n.spatialReference=t[0].mapPoint.spatialReference.toJSON(),n.coefficients=this.transform.slice(0,8));else{const i=new D("web-document-write:invalid-georeference","Invalid 'controlPoints', 'width', 'height' configuration.",{layer:r==null?void 0:r.layer,georeference:this});r!=null&&r.messages?r.messages.push(i):U.getLogger(this).error(i.name,i.message)}}get coords(){if(this.controlPoints==null)return null;const t=this._updateTransform(ne);if(t==null||!y(this.controlPoints[0]))return null;const n=this.controlPoints[0].mapPoint.spatialReference;return vt(t,this.width,this.height,n)}set coords(t){if(this.controlPoints==null||!y(this.controlPoints[0]))return;const n=this.controlPoints[0].mapPoint.spatialReference;if((t=this.projectOrWarn(t,n))==null)return;const{width:o,height:r}=this,{rings:[[i,a,c,u]]}=t,f={sourcePoint:H(0,r),mapPoint:new m({x:i[0],y:i[1],spatialReference:n})},d={sourcePoint:H(0,0),mapPoint:new m({x:a[0],y:a[1],spatialReference:n})},g={sourcePoint:H(o,0),mapPoint:new m({x:c[0],y:c[1],spatialReference:n})},O={sourcePoint:H(o,r),mapPoint:new m({x:u[0],y:u[1],spatialReference:n})};y(f)&&y(d)&&y(g)&&y(O)&&(fe(ne,f,d,g,O),this.controlPoints=this.controlPoints.map(({sourcePoint:T})=>(A(p,T.x,T.y),R(p,p,ne),{sourcePoint:T,mapPoint:new m({x:p[0],y:p[1],spatialReference:n})})))}get inverseTransform(){return this.transform==null?null:Ee(te(),this.transform)}get transform(){return this._updateTransform()}toMap(t){if(t==null||this.transform==null||this.controlPoints==null||!y(this.controlPoints[0]))return null;A(p,t.x,t.y);const n=this.controlPoints[0].mapPoint.spatialReference;return R(p,p,this.transform),new m({x:p[0],y:p[1],spatialReference:n})}toSource(t){if(t==null||this.inverseTransform==null||this.controlPoints==null||!y(this.controlPoints[0]))return null;const n=this.controlPoints[0].mapPoint.spatialReference;return t=t.normalize(),(t=k(t,n).geometry)==null?null:(A(p,t.x,t.y),R(p,p,this.inverseTransform),H(p[0],p[1]))}toSourceNormalized(t){const n=this.toSource(t);return n!=null&&(n.x/=this.width,n.y/=this.height),n}_updateTransform(t){const{controlPoints:n,width:o,height:r}=this;if(!(n!=null&&o>0&&r>0))return null;const[i,a,c,u]=n;if(!y(i))return null;const f=i.mapPoint.spatialReference,d=this._projectControlPoint(a,f),g=this._projectControlPoint(c,f),O=this._projectControlPoint(u,f);if(!d.valid||!g.valid||!O.valid||!y(d.controlPoint))return null;t==null&&(t=te());let T=null;return T=y(g.controlPoint)&&y(O.controlPoint)?fe(t,i,d.controlPoint,g.controlPoint,O.controlPoint):y(g.controlPoint)?yt(t,i,d.controlPoint,g.controlPoint):ft(t,i,d.controlPoint),T.every($e=>$e===0)?null:T}_projectControlPoint(t,n){if(!y(t))return{valid:!0,controlPoint:t};const{sourcePoint:o,mapPoint:r}=t,{geometry:i,pending:a}=k(r,n);return a?{valid:!1,controlPoint:null}:a||i?{valid:!0,controlPoint:{sourcePoint:o,mapPoint:i}}:(U.getLogger(this).warn("map point could not be projected to the spatial reference",{georeference:this,controlPoint:t,sourceSpatialReference:r.spatialReference,targetSpatialReference:n}),{valid:!1,controlPoint:null})}};function y(e){return(e==null?void 0:e.sourcePoint)!=null&&e.mapPoint!=null}s([l({type:[F],json:{write:{allowNull:!1,isRequired:!0}}})],P.prototype,"controlPoints",void 0),s([J("controlPoints")],P.prototype,"readControlPoints",null),s([ie("controlPoints")],P.prototype,"writeControlPoints",null),s([l()],P.prototype,"coords",null),s([l({json:{write:!0}})],P.prototype,"height",void 0),s([l({readOnly:!0})],P.prototype,"inverseTransform",null),s([l({readOnly:!0})],P.prototype,"transform",null),s([l({json:{write:!0}})],P.prototype,"width",void 0),P=s([x("esri.layers.support.ControlPointsGeoreference")],P);const _=w(),b=w(),V=w(),L=w(),I=w(),S=w(),C=w(),j=w(),Z=Math.PI/2;function $(e,t,n){A(e,n.sourcePoint.x,n.sourcePoint.y),A(t,n.mapPoint.x,n.mapPoint.y)}function ft(e,t,n){return $(_,I,t),$(b,S,n),z(V,b,_,Z),z(L,_,b,Z),z(C,S,I,-Z),z(j,I,S,-Z),ce(e,_,b,V,L,I,S,C,j)}function yt(e,t,n,o){return $(_,I,t),$(b,S,n),$(V,C,o),de(L,_,b,.5),z(L,V,L,Math.PI),de(j,I,S,.5),z(j,C,j,Math.PI),ce(e,_,b,V,L,I,S,C,j)}function fe(e,t,n,o,r){return $(_,I,t),$(b,S,n),$(V,C,o),$(L,j,r),ce(e,_,b,V,L,I,S,C,j)}const gt=new Array(8).fill(0),Pt=new Array(8).fill(0);function ye(e,t,n,o,r){return e[0]=t[0],e[1]=t[1],e[2]=n[0],e[3]=n[1],e[4]=o[0],e[5]=o[1],e[6]=r[0],e[7]=r[1],e}function ce(e,t,n,o,r,i,a,c,u){return Re(e,ye(gt,t,n,o,r),ye(Pt,i,a,c,u))}function vt(e,t,n,o){const r=K(0,n),i=K(0,0),a=K(t,0),c=K(t,n);return R(r,r,e),R(i,i,e),R(a,a,e),R(c,c,e),new ae({rings:[[r,i,a,c,r]],spatialReference:o})}const ue=P,B=w();let M=class extends q{constructor(e){super(e),this.bottomLeft=null,this.bottomRight=null,this.topLeft=null,this.topRight=null,this.type="corners"}get coords(){let{topLeft:e,topRight:t,bottomLeft:n,bottomRight:o}=this;if(e==null||t==null||n==null||o==null)return null;const r=e.spatialReference;return t=this.projectOrWarn(t,r),n=this.projectOrWarn(n,r),o=this.projectOrWarn(o,r),t==null||n==null||o==null?null:new ae({rings:[[[n.x,n.y],[e.x,e.y],[t.x,t.y],[o.x,o.y],[n.x,n.y]]],spatialReference:r})}set coords(e){const{topLeft:t}=this;if(t==null)return;const n=t.spatialReference;if((e=this.projectOrWarn(e,n))==null)return;const{rings:[[o,r,i,a]]}=e;this.bottomLeft=new m({x:o[0],y:o[1],spatialReference:n}),this.topLeft=new m({x:r[0],y:r[1],spatialReference:n}),this.topRight=new m({x:i[0],y:i[1],spatialReference:n}),this.bottomRight=new m({x:a[0],y:a[1],spatialReference:n})}toSourceNormalized(e){const{topLeft:t,topRight:n,bottomRight:o,bottomLeft:r}=this;if(e==null||t==null||n==null||o==null||r==null)return null;const i=t.spatialReference;e=e.normalize();const a=k(e,i).geometry;if(a==null)return null;A(B,a.x,a.y);const c=Re(te(),[t.x,t.y,r.x,r.y,n.x,n.y,o.x,o.y],[0,0,0,1,1,0,1,1]);return R(B,B,c),H(B[0],B[1])}};s([l()],M.prototype,"coords",null),s([l({type:m})],M.prototype,"bottomLeft",void 0),s([l({type:m})],M.prototype,"bottomRight",void 0),s([l({type:m})],M.prototype,"topLeft",void 0),s([l({type:m})],M.prototype,"topRight",void 0),M=s([x("esri.layers.support.CornersGeoreference")],M);const xt=M;let W=class extends q{constructor(e){super(e),this.extent=null,this.rotation=0,this.type="extent-and-rotation"}get coords(){if(this.extent==null)return null;const{xmin:e,ymin:t,xmax:n,ymax:o,spatialReference:r}=this.extent;let i;if(this.rotation){const{x:a,y:c}=this.extent.center,u=oe(a,c,this.rotation);i=[u(e,t),u(e,o),u(n,o),u(n,t)],i.push(i[0])}else i=[[e,t],[e,o],[n,o],[n,t],[e,t]];return new ae({rings:[i],spatialReference:r})}set coords(e){if(e==null||this.extent==null)return;const t=this.extent.spatialReference;if(e=this.projectOrWarn(e,t),(e==null?void 0:e.extent)==null)return;const{rings:[[n,o,r]],extent:{center:{x:i,y:a}}}=e,c=je(Math.PI/2-Math.atan2(o[1]-n[1],o[0]-n[0])),u=oe(i,a,-c),[f,d]=u(n[0],n[1]),[g,O]=u(r[0],r[1]);this.extent=new le({xmin:f,ymin:d,xmax:g,ymax:O,spatialReference:t}),this.rotation=c}toSourceNormalized(e){const{extent:t,rotation:n}=this;if(e==null||t==null)return null;const{xmin:o,ymin:r,xmax:i,ymax:a,center:c,spatialReference:u}=t;e=e.normalize();const f=k(e,u).geometry;if(f==null)return null;let d=f.x,g=f.y;return n&&([d,g]=oe(c.x,c.y,-n)(d,g)),H(he(d,o,i,0,1),he(g,a,r,0,1))}};function oe(e,t,n){const o=Te(n),r=Math.cos(o),i=Math.sin(o);return(a,c)=>[r*(a-e)+i*(c-t)+e,r*(c-t)-i*(a-e)+t]}s([l()],W.prototype,"coords",null),s([l({type:le})],W.prototype,"extent",void 0),s([l({type:Number})],W.prototype,"rotation",void 0),W=s([x("esri.layers.support.ExtentAndRotationGeoreference")],W);const wt=W,Rt={key:"type",base:q,typeMap:{"control-points":ue,corners:xt,"extent-and-rotation":wt}},_t={key:"type",base:q,typeMap:{"control-points":ue}};let N=class extends He(ve(xe)){constructor(e){super(e),this.georeference=null,this.opacity=1}readGeoreference(e){return ue.fromJSON(e)}get contentWidth(){return 0}get contentHeight(){return 0}toSource(e){const{georeference:t,contentWidth:n,contentHeight:o}=this;if(e==null||t==null||n===0||o===0)return null;const r=t.toSourceNormalized(e);return r==null?null:(r.x*=n,r.y*=o,r)}};s([l({types:Rt,json:{write:!0,types:_t}})],N.prototype,"georeference",void 0),s([J("georeference")],N.prototype,"readGeoreference",null),s([l({json:{read:!1,write:!1}})],N.prototype,"opacity",void 0),N=s([x("esri.layers.support.MediaElementBase")],N);const pe=N;function bt(e){return(e==null?void 0:e.type)==="media"}function _e(e,t){const n=Ae(t);return bt(e)&&!!e.portalItem&&n!=null&&n>ee.PORTAL_ITEM}let v=class extends pe{constructor(t){super(t),this.animationOptions=null,this.content=null,this.image=null,this.type="image",this.image=null}load(){const t=this.image;if(typeof t=="string"){const n=ut(t).then(o=>{this._set("content",o)});this.addResolvingPromise(n)}else if(t instanceof HTMLImageElement){const n=t.decode().then(()=>{this._set("content",t)});this.addResolvingPromise(n)}else t?this._set("content",t):this.addResolvingPromise(Promise.reject(new D("image-element:invalid-image-type","Invalid image type",{image:t})));return Promise.resolve(this)}get contentWidth(){return this.content==null?0:this.content instanceof HTMLImageElement?this.content.naturalWidth:this.content.width}get contentHeight(){return this.content==null?0:this.content instanceof HTMLImageElement?this.content.naturalHeight:this.content.height}readImage(t,n,o){return Ve(n.url,o)}writeImage(t,n,o,r){if(t==null)return;const i=r==null?void 0:r.portalItem,a=r==null?void 0:r.resources;if(!i||!a)return void(typeof t=="string"&&(n[o]=me(t,r)));const c=It(t)?t:null;if(c){if(Ce(c)==null)return void(n[o]=c);const u=me(c,{...r,verifyItemRelativeUrls:r!=null&&r.verifyItemRelativeUrls?{writtenUrls:r.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},We.NO);if(i&&u&&!Ne(u))return a.toKeep.push({resource:i.resourceFromPath(u),compress:!1}),void(n[o]=u)}n[o]="",a.pendingOperations.push(St(t).then(u=>{const f=Ot(u,i);n[o]=f.itemRelativeUrl,a.toAdd.push({resource:f,content:{type:"blob",blob:u},compress:!1,finish:d=>{this.image=d.url}})}))}write(t,n){const o=super.write(t,n);return"mediaType"in o&&!o.url&&delete o.mediaType,o}};s([l()],v.prototype,"animationOptions",void 0),s([l({readOnly:!0})],v.prototype,"content",void 0),s([l({readOnly:!0})],v.prototype,"contentWidth",null),s([l({readOnly:!0})],v.prototype,"contentHeight",null),s([l({json:{name:"url",type:String,write:{overridePolicy:(e,t,n)=>({enabled:!_e(n==null?void 0:n.layer,n==null?void 0:n.origin)})}}})],v.prototype,"image",void 0),s([J("image",["url"])],v.prototype,"readImage",null),s([ie("image")],v.prototype,"writeImage",null),s([l({readOnly:!0,json:{read:!1,write:{target:"mediaType",ignoreOrigin:!0}}})],v.prototype,"type",void 0),v=s([x("esri.layers.support.ImageElement")],v);const be=v;function It(e){return typeof e=="string"&&!we(e)&&!Ge(e)}async function St(e){return typeof e=="string"?we(e)?ze(e):(await Ue(e,{responseType:"blob"})).data:new Promise(t=>$t(e).toBlob(t))}function $t(e){if(e instanceof HTMLCanvasElement)return e;const t=e instanceof HTMLImageElement?e.naturalWidth:e.width,n=e instanceof HTMLImageElement?e.naturalHeight:e.height,o=document.createElement("canvas"),r=o.getContext("2d");return o.width=t,o.height=n,e instanceof HTMLImageElement?r.drawImage(e,0,0,e.width,e.height):e instanceof ImageData&&r.putImageData(e,0,0),o}function Ot(e,t){const n=Be(),o=`${Fe("media",n)}.${ht({type:"blob",blob:e})}`;return t.resourceFromPath(o)}let E=class extends pe{constructor(e){super(e),this.autoplay=!0,this.content=null,this.type="video"}load(){const e=this.video;if(typeof e=="string"){const t=document.createElement("video");t.src=e,t.crossOrigin="anonymous",t.autoplay=!0,t.muted=!0,t.loop=!0,this.addResolvingPromise(this._loadVideo(t).then(()=>{this._set("content",t)}))}else e instanceof HTMLVideoElement?this.addResolvingPromise(this._loadVideo(e).then(()=>{this._set("content",e)})):this.addResolvingPromise(Promise.reject(new D("video-element:invalid-video-type","Invalid video type",{video:e})));return Promise.resolve(this)}get contentWidth(){var e;return((e=this.content)==null?void 0:e.videoWidth)??0}get contentHeight(){var e;return((e=this.content)==null?void 0:e.videoHeight)??0}set video(e){this.loadStatus==="not-loaded"?this._set("video",e):U.getLogger(this).error("#video","video cannot be changed after the element is loaded.")}_loadVideo(e){return new Promise((t,n)=>{var r;const o=ke(e,"canplay",()=>{this.removeHandles("canplay"),this.autoplay?e.play().then(t,n):t()});this.addHandles(o,"canplay"),e.crossOrigin!=="anonymous"&&(e.crossOrigin="anonymous",(r=e.src)!=null&&r.includes("blob:")||(e.src=e.src))})}};s([l()],E.prototype,"autoplay",void 0),s([l({readOnly:!0})],E.prototype,"content",void 0),s([l({readOnly:!0})],E.prototype,"contentWidth",null),s([l({readOnly:!0})],E.prototype,"contentHeight",null),s([l()],E.prototype,"video",null),E=s([x("esri.layers.support.VideoElement")],E);const Ie=E,Mt={key:"type",defaultKeyValue:"image",base:pe,typeMap:{image:be,video:Ie}},ge=X.ofType(Mt);let G=class extends xe.LoadableMixin(De(Je.EventedAccessor)){constructor(e){super(e),this._index=new mt,this._elementViewsMap=new Map,this._elementsIndexes=new Map,this._elementsChangedHandler=t=>{for(const o of t.removed){const r=this._elementViewsMap.get(o);this._elementViewsMap.delete(o),this._index.delete(r),this.removeHandles(r),r.destroy(),this.notifyChange("fullExtent")}const{spatialReference:n}=this;for(const o of t.added){if(this._elementViewsMap.get(o))continue;const r=new pt({spatialReference:n,element:o});this._elementViewsMap.set(o,r);const i=qe(()=>r.coords,()=>this._updateIndexForElement(r,!1));this._updateIndexForElement(r,!0),this.addHandles(i,r)}this._elementsIndexes.clear(),this.elements.forEach((o,r)=>this._elementsIndexes.set(o,r)),this.emit("refresh")},this.elements=new ge}async load(e){if(Ke(e),!this.spatialReference){const t=this.elements.find(n=>{var o;return((o=n.georeference)==null?void 0:o.coords)!=null});this._set("spatialReference",t?t.georeference.coords.spatialReference:Pe.WGS84)}return this._elementsChangedHandler({added:this.elements.items,removed:[]}),this.addHandles(this.elements.on("change",this._elementsChangedHandler)),this}destroy(){this._index.clear(),this._elementViewsMap.clear(),this._elementsIndexes.clear()}set elements(e){this._set("elements",Ye(e,this._get("elements"),ge))}get fullExtent(){if(this.loadStatus==="not-loaded")return null;const e=this._index.fullBounds;return e==null?null:new le({xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3],spatialReference:this.spatialReference})}set spatialReference(e){this.loadStatus==="not-loaded"?this._set("spatialReference",e):U.getLogger(this).error("#spatialReference","spatialReference cannot be changed after the source is loaded.")}async queryElements(e,t){await this.load(),await Ze(e.spatialReference,this.spatialReference,null,t);const n=Qe(e.spatialReference,this.spatialReference)?e:Xe(e,this.spatialReference);if(!n)return[];const o=n.normalize(),r=[];for(const i of o)this._index.forEachInBounds(et(i),({normalizedCoords:a,element:c})=>{a!=null&&tt(i,a)&&r.push(c)});return r.sort((i,a)=>this._elementsIndexes.get(i)-this._elementsIndexes.get(a)),r}_updateIndexForElement(e,t){const n=e.normalizedBounds,o=this._index.has(e),r=n!=null;this._index.delete(e),r&&this._index.set(e,n),this.notifyChange("fullExtent"),t||(o!==r?this.emit("refresh"):this.emit("change",{element:e.element}))}};s([l()],G.prototype,"elements",null),s([l({readOnly:!0})],G.prototype,"fullExtent",null),s([l()],G.prototype,"spatialReference",null),G=s([x("esri.layers.support.LocalMediaElementSource")],G);const Q=G;function se(e){return typeof e=="object"&&e!=null&&"type"in e}function Se(e){return se(e)&&e.type==="image"}let h=class extends nt(ot(rt(st(ve(lt))))){constructor(e){super(e),this.effectiveSource=null,this.georeference=null,this.copyright=null,this.operationalLayerType="MediaLayer",this.spatialReference=null,this.type="media",this._debouncedSaveOperations=it(async(t,n,o)=>{const{save:r,saveAs:i}=await ct(()=>import("./mediaLayerUtils-LvFj83T-.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));switch(t){case Y.SAVE:return r(this,n);case Y.SAVE_AS:return i(this,o,n)}}),this.source=new Q}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){await this.loadFromPortal({supportedTypes:["Media Layer"]},e);let t=this.source;if(!t)throw new D("media-layer:source-missing","Set 'MediaLayer.source' before loading the layer.");const n=this._getSourceOverride(t,this.georeference);n&&(this.setAtOrigin("source",n,"web-map"),t=n);const o=se(t)?new Q({elements:new X([t])}):t;this._set("effectiveSource",o),this.spatialReference&&(o.spatialReference=this.spatialReference),await o.load(e),this.spatialReference=o.spatialReference}destroy(){var e,t;(e=this.effectiveSource)==null||e.destroy(),(t=this.source)==null||t.destroy()}readGeoreference(e,t){return e&&"itemId"in t&&t.itemId?e:void 0}get fullExtent(){return this.loaded?this.effectiveSource.fullExtent:null}set source(e){this.loadStatus!=="loaded"&&this.loadStatus!=="failed"?this._set("source",e):U.getLogger(this).error("#source","source cannot be changed after the layer is loaded.")}castSource(e){return e?Array.isArray(e)?new Q({elements:new X(e)}):e instanceof X?new Q({elements:e}):e:null}readSource(e,t,n){if("itemId"in t&&t.itemId)return;const o=this._createSource(t);return o==null||o.read(t,n),o}writeSource(e,t,n,o){var r;Se(e)?e.write(t,o):o!=null&&o.messages&&((r=o==null?void 0:o.messages)==null||r.push(new D("media-layer:unsupported-source","source must be an 'ImageElement'")))}async save(e){return this._debouncedSaveOperations(Y.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(Y.SAVE_AS,t,e)}_createSource(e){if("mediaType"in e)switch(e.mediaType){case"image":return new be;case"video":return new Ie}return null}_getSourceOverride(e,t){if(se(e)&&this.originIdOf("source")===ee.PORTAL_ITEM&&t&&this.originIdOf("georeference")===ee.WEB_MAP){const n=e.toJSON(),o=this._createSource(n);return o.read({...n},{origin:"portal-item"}),o.read({georeference:t},{origin:"web-map"}),o}return null}};s([l({readOnly:!0})],h.prototype,"effectiveSource",void 0),s([l({readOnly:!0,json:{read:!1,write:!1,origins:{"web-map":{read:!0,write:!1}}}})],h.prototype,"georeference",void 0),s([J("web-map","georeference")],h.prototype,"readGeoreference",null),s([l({type:String})],h.prototype,"copyright",void 0),s([l({readOnly:!0})],h.prototype,"fullExtent",null),s([l({type:["MediaLayer"]})],h.prototype,"operationalLayerType",void 0),s([l({type:["show","hide"]})],h.prototype,"listMode",void 0),s([l({nonNullable:!0,json:{write:{enabled:!0,allowNull:!1,overridePolicy(e,t,n){return{enabled:!0,allowNull:!1,ignoreOrigin:_e(this,n==null?void 0:n.origin)&&Se(e)&&!!e.georeference&&e.originIdOf("georeference")>ee.PORTAL_ITEM}}}}})],h.prototype,"source",null),s([at("source")],h.prototype,"castSource",null),s([J("source",["url"])],h.prototype,"readSource",null),s([ie("source")],h.prototype,"writeSource",null),s([l()],h.prototype,"spatialReference",void 0),s([l({readOnly:!0})],h.prototype,"type",void 0),h=s([x("esri.layers.MediaLayer")],h);const Ut=h;export{Ut as default}; +import{d as s,f as x,hO as Oe,dV as k,s as U,y as l,aA as m,dm as Me,aS as Pe,fj as A,N as D,fY as H,j5 as Ee,aZ as J,aR as ie,j6 as z,j7 as de,aB as ae,fU as w,a7 as Le,j8 as K,aE as le,cN as je,j9 as he,ja as Te,jb as He,dr as ve,fw as xe,dF as Ae,bs as ee,d5 as Ve,dD as me,dH as Ce,dE as We,dG as Ne,jc as we,dI as Ge,jd as ze,M as Ue,da as Be,b_ as Fe,je as ke,V as X,hk as De,ca as Je,g as qe,at as Ke,w as Ye,d2 as Ze,G as Qe,bv as Xe,ff as et,g1 as tt,bP as nt,bQ as ot,dp as rt,dq as st,k as it,e1 as at,bT as lt,_ as ct}from"./index-BjUNJPVf.js";import{p as ut}from"./imageUtils-ChIDAvDr.js";import{p as R,j as Re,m as pt}from"./perspectiveUtils-DhC7L1B1.js";import{t as dt,e as te}from"./mat3f64-q3fE-ZOt.js";import{p as ht}from"./resourceExtension-CiV172Z4.js";import{o as mt}from"./BoundsStore-DRDtG3Mk.js";import{A as Y}from"./interfaces-CL2NbQte.js";import"./normalizeUtilsSync-73yZ0QwV.js";import"./PooledRBush-BlFOlUgK.js";let re=class extends Oe{projectOrWarn(e,t){if(e==null)return e;const{geometry:n,pending:o}=k(e,t);return o?null:o||n?n:(U.getLogger(this).warn("geometry could not be projected to the spatial reference",{georeference:this,geometry:e,sourceSpatialReference:e.spatialReference,targetSpatialReference:t}),null)}};re=s([x("esri.layers.support.GeoreferenceBase")],re);const q=re,ne=te(),p=w();let F=class extends Le{constructor(){super(...arguments),this.sourcePoint=null,this.mapPoint=null}};s([l()],F.prototype,"sourcePoint",void 0),s([l({type:m})],F.prototype,"mapPoint",void 0),F=s([x("esri.layers.support.ControlPoint")],F);let P=class extends Me(q){constructor(t){super(t),this.controlPoints=null,this.height=0,this.type="control-points",this.width=0}readControlPoints(t,n){const o=Pe.fromJSON(n.spatialReference),r=dt(...n.coefficients,1);return t.map(i=>(A(p,i.x,i.y),R(p,p,r),{sourcePoint:i,mapPoint:new m({x:p[0],y:p[1],spatialReference:o})}))}writeControlPoints(t,n,o,r){if(this.transform!=null)t!=null&&y(t[0])&&(n.controlPoints=t.map(i=>{const a=i.sourcePoint;return{x:a.x,y:a.y}}),n.spatialReference=t[0].mapPoint.spatialReference.toJSON(),n.coefficients=this.transform.slice(0,8));else{const i=new D("web-document-write:invalid-georeference","Invalid 'controlPoints', 'width', 'height' configuration.",{layer:r==null?void 0:r.layer,georeference:this});r!=null&&r.messages?r.messages.push(i):U.getLogger(this).error(i.name,i.message)}}get coords(){if(this.controlPoints==null)return null;const t=this._updateTransform(ne);if(t==null||!y(this.controlPoints[0]))return null;const n=this.controlPoints[0].mapPoint.spatialReference;return vt(t,this.width,this.height,n)}set coords(t){if(this.controlPoints==null||!y(this.controlPoints[0]))return;const n=this.controlPoints[0].mapPoint.spatialReference;if((t=this.projectOrWarn(t,n))==null)return;const{width:o,height:r}=this,{rings:[[i,a,c,u]]}=t,f={sourcePoint:H(0,r),mapPoint:new m({x:i[0],y:i[1],spatialReference:n})},d={sourcePoint:H(0,0),mapPoint:new m({x:a[0],y:a[1],spatialReference:n})},g={sourcePoint:H(o,0),mapPoint:new m({x:c[0],y:c[1],spatialReference:n})},O={sourcePoint:H(o,r),mapPoint:new m({x:u[0],y:u[1],spatialReference:n})};y(f)&&y(d)&&y(g)&&y(O)&&(fe(ne,f,d,g,O),this.controlPoints=this.controlPoints.map(({sourcePoint:T})=>(A(p,T.x,T.y),R(p,p,ne),{sourcePoint:T,mapPoint:new m({x:p[0],y:p[1],spatialReference:n})})))}get inverseTransform(){return this.transform==null?null:Ee(te(),this.transform)}get transform(){return this._updateTransform()}toMap(t){if(t==null||this.transform==null||this.controlPoints==null||!y(this.controlPoints[0]))return null;A(p,t.x,t.y);const n=this.controlPoints[0].mapPoint.spatialReference;return R(p,p,this.transform),new m({x:p[0],y:p[1],spatialReference:n})}toSource(t){if(t==null||this.inverseTransform==null||this.controlPoints==null||!y(this.controlPoints[0]))return null;const n=this.controlPoints[0].mapPoint.spatialReference;return t=t.normalize(),(t=k(t,n).geometry)==null?null:(A(p,t.x,t.y),R(p,p,this.inverseTransform),H(p[0],p[1]))}toSourceNormalized(t){const n=this.toSource(t);return n!=null&&(n.x/=this.width,n.y/=this.height),n}_updateTransform(t){const{controlPoints:n,width:o,height:r}=this;if(!(n!=null&&o>0&&r>0))return null;const[i,a,c,u]=n;if(!y(i))return null;const f=i.mapPoint.spatialReference,d=this._projectControlPoint(a,f),g=this._projectControlPoint(c,f),O=this._projectControlPoint(u,f);if(!d.valid||!g.valid||!O.valid||!y(d.controlPoint))return null;t==null&&(t=te());let T=null;return T=y(g.controlPoint)&&y(O.controlPoint)?fe(t,i,d.controlPoint,g.controlPoint,O.controlPoint):y(g.controlPoint)?yt(t,i,d.controlPoint,g.controlPoint):ft(t,i,d.controlPoint),T.every($e=>$e===0)?null:T}_projectControlPoint(t,n){if(!y(t))return{valid:!0,controlPoint:t};const{sourcePoint:o,mapPoint:r}=t,{geometry:i,pending:a}=k(r,n);return a?{valid:!1,controlPoint:null}:a||i?{valid:!0,controlPoint:{sourcePoint:o,mapPoint:i}}:(U.getLogger(this).warn("map point could not be projected to the spatial reference",{georeference:this,controlPoint:t,sourceSpatialReference:r.spatialReference,targetSpatialReference:n}),{valid:!1,controlPoint:null})}};function y(e){return(e==null?void 0:e.sourcePoint)!=null&&e.mapPoint!=null}s([l({type:[F],json:{write:{allowNull:!1,isRequired:!0}}})],P.prototype,"controlPoints",void 0),s([J("controlPoints")],P.prototype,"readControlPoints",null),s([ie("controlPoints")],P.prototype,"writeControlPoints",null),s([l()],P.prototype,"coords",null),s([l({json:{write:!0}})],P.prototype,"height",void 0),s([l({readOnly:!0})],P.prototype,"inverseTransform",null),s([l({readOnly:!0})],P.prototype,"transform",null),s([l({json:{write:!0}})],P.prototype,"width",void 0),P=s([x("esri.layers.support.ControlPointsGeoreference")],P);const _=w(),b=w(),V=w(),L=w(),I=w(),S=w(),C=w(),j=w(),Z=Math.PI/2;function $(e,t,n){A(e,n.sourcePoint.x,n.sourcePoint.y),A(t,n.mapPoint.x,n.mapPoint.y)}function ft(e,t,n){return $(_,I,t),$(b,S,n),z(V,b,_,Z),z(L,_,b,Z),z(C,S,I,-Z),z(j,I,S,-Z),ce(e,_,b,V,L,I,S,C,j)}function yt(e,t,n,o){return $(_,I,t),$(b,S,n),$(V,C,o),de(L,_,b,.5),z(L,V,L,Math.PI),de(j,I,S,.5),z(j,C,j,Math.PI),ce(e,_,b,V,L,I,S,C,j)}function fe(e,t,n,o,r){return $(_,I,t),$(b,S,n),$(V,C,o),$(L,j,r),ce(e,_,b,V,L,I,S,C,j)}const gt=new Array(8).fill(0),Pt=new Array(8).fill(0);function ye(e,t,n,o,r){return e[0]=t[0],e[1]=t[1],e[2]=n[0],e[3]=n[1],e[4]=o[0],e[5]=o[1],e[6]=r[0],e[7]=r[1],e}function ce(e,t,n,o,r,i,a,c,u){return Re(e,ye(gt,t,n,o,r),ye(Pt,i,a,c,u))}function vt(e,t,n,o){const r=K(0,n),i=K(0,0),a=K(t,0),c=K(t,n);return R(r,r,e),R(i,i,e),R(a,a,e),R(c,c,e),new ae({rings:[[r,i,a,c,r]],spatialReference:o})}const ue=P,B=w();let M=class extends q{constructor(e){super(e),this.bottomLeft=null,this.bottomRight=null,this.topLeft=null,this.topRight=null,this.type="corners"}get coords(){let{topLeft:e,topRight:t,bottomLeft:n,bottomRight:o}=this;if(e==null||t==null||n==null||o==null)return null;const r=e.spatialReference;return t=this.projectOrWarn(t,r),n=this.projectOrWarn(n,r),o=this.projectOrWarn(o,r),t==null||n==null||o==null?null:new ae({rings:[[[n.x,n.y],[e.x,e.y],[t.x,t.y],[o.x,o.y],[n.x,n.y]]],spatialReference:r})}set coords(e){const{topLeft:t}=this;if(t==null)return;const n=t.spatialReference;if((e=this.projectOrWarn(e,n))==null)return;const{rings:[[o,r,i,a]]}=e;this.bottomLeft=new m({x:o[0],y:o[1],spatialReference:n}),this.topLeft=new m({x:r[0],y:r[1],spatialReference:n}),this.topRight=new m({x:i[0],y:i[1],spatialReference:n}),this.bottomRight=new m({x:a[0],y:a[1],spatialReference:n})}toSourceNormalized(e){const{topLeft:t,topRight:n,bottomRight:o,bottomLeft:r}=this;if(e==null||t==null||n==null||o==null||r==null)return null;const i=t.spatialReference;e=e.normalize();const a=k(e,i).geometry;if(a==null)return null;A(B,a.x,a.y);const c=Re(te(),[t.x,t.y,r.x,r.y,n.x,n.y,o.x,o.y],[0,0,0,1,1,0,1,1]);return R(B,B,c),H(B[0],B[1])}};s([l()],M.prototype,"coords",null),s([l({type:m})],M.prototype,"bottomLeft",void 0),s([l({type:m})],M.prototype,"bottomRight",void 0),s([l({type:m})],M.prototype,"topLeft",void 0),s([l({type:m})],M.prototype,"topRight",void 0),M=s([x("esri.layers.support.CornersGeoreference")],M);const xt=M;let W=class extends q{constructor(e){super(e),this.extent=null,this.rotation=0,this.type="extent-and-rotation"}get coords(){if(this.extent==null)return null;const{xmin:e,ymin:t,xmax:n,ymax:o,spatialReference:r}=this.extent;let i;if(this.rotation){const{x:a,y:c}=this.extent.center,u=oe(a,c,this.rotation);i=[u(e,t),u(e,o),u(n,o),u(n,t)],i.push(i[0])}else i=[[e,t],[e,o],[n,o],[n,t],[e,t]];return new ae({rings:[i],spatialReference:r})}set coords(e){if(e==null||this.extent==null)return;const t=this.extent.spatialReference;if(e=this.projectOrWarn(e,t),(e==null?void 0:e.extent)==null)return;const{rings:[[n,o,r]],extent:{center:{x:i,y:a}}}=e,c=je(Math.PI/2-Math.atan2(o[1]-n[1],o[0]-n[0])),u=oe(i,a,-c),[f,d]=u(n[0],n[1]),[g,O]=u(r[0],r[1]);this.extent=new le({xmin:f,ymin:d,xmax:g,ymax:O,spatialReference:t}),this.rotation=c}toSourceNormalized(e){const{extent:t,rotation:n}=this;if(e==null||t==null)return null;const{xmin:o,ymin:r,xmax:i,ymax:a,center:c,spatialReference:u}=t;e=e.normalize();const f=k(e,u).geometry;if(f==null)return null;let d=f.x,g=f.y;return n&&([d,g]=oe(c.x,c.y,-n)(d,g)),H(he(d,o,i,0,1),he(g,a,r,0,1))}};function oe(e,t,n){const o=Te(n),r=Math.cos(o),i=Math.sin(o);return(a,c)=>[r*(a-e)+i*(c-t)+e,r*(c-t)-i*(a-e)+t]}s([l()],W.prototype,"coords",null),s([l({type:le})],W.prototype,"extent",void 0),s([l({type:Number})],W.prototype,"rotation",void 0),W=s([x("esri.layers.support.ExtentAndRotationGeoreference")],W);const wt=W,Rt={key:"type",base:q,typeMap:{"control-points":ue,corners:xt,"extent-and-rotation":wt}},_t={key:"type",base:q,typeMap:{"control-points":ue}};let N=class extends He(ve(xe)){constructor(e){super(e),this.georeference=null,this.opacity=1}readGeoreference(e){return ue.fromJSON(e)}get contentWidth(){return 0}get contentHeight(){return 0}toSource(e){const{georeference:t,contentWidth:n,contentHeight:o}=this;if(e==null||t==null||n===0||o===0)return null;const r=t.toSourceNormalized(e);return r==null?null:(r.x*=n,r.y*=o,r)}};s([l({types:Rt,json:{write:!0,types:_t}})],N.prototype,"georeference",void 0),s([J("georeference")],N.prototype,"readGeoreference",null),s([l({json:{read:!1,write:!1}})],N.prototype,"opacity",void 0),N=s([x("esri.layers.support.MediaElementBase")],N);const pe=N;function bt(e){return(e==null?void 0:e.type)==="media"}function _e(e,t){const n=Ae(t);return bt(e)&&!!e.portalItem&&n!=null&&n>ee.PORTAL_ITEM}let v=class extends pe{constructor(t){super(t),this.animationOptions=null,this.content=null,this.image=null,this.type="image",this.image=null}load(){const t=this.image;if(typeof t=="string"){const n=ut(t).then(o=>{this._set("content",o)});this.addResolvingPromise(n)}else if(t instanceof HTMLImageElement){const n=t.decode().then(()=>{this._set("content",t)});this.addResolvingPromise(n)}else t?this._set("content",t):this.addResolvingPromise(Promise.reject(new D("image-element:invalid-image-type","Invalid image type",{image:t})));return Promise.resolve(this)}get contentWidth(){return this.content==null?0:this.content instanceof HTMLImageElement?this.content.naturalWidth:this.content.width}get contentHeight(){return this.content==null?0:this.content instanceof HTMLImageElement?this.content.naturalHeight:this.content.height}readImage(t,n,o){return Ve(n.url,o)}writeImage(t,n,o,r){if(t==null)return;const i=r==null?void 0:r.portalItem,a=r==null?void 0:r.resources;if(!i||!a)return void(typeof t=="string"&&(n[o]=me(t,r)));const c=It(t)?t:null;if(c){if(Ce(c)==null)return void(n[o]=c);const u=me(c,{...r,verifyItemRelativeUrls:r!=null&&r.verifyItemRelativeUrls?{writtenUrls:r.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},We.NO);if(i&&u&&!Ne(u))return a.toKeep.push({resource:i.resourceFromPath(u),compress:!1}),void(n[o]=u)}n[o]="",a.pendingOperations.push(St(t).then(u=>{const f=Ot(u,i);n[o]=f.itemRelativeUrl,a.toAdd.push({resource:f,content:{type:"blob",blob:u},compress:!1,finish:d=>{this.image=d.url}})}))}write(t,n){const o=super.write(t,n);return"mediaType"in o&&!o.url&&delete o.mediaType,o}};s([l()],v.prototype,"animationOptions",void 0),s([l({readOnly:!0})],v.prototype,"content",void 0),s([l({readOnly:!0})],v.prototype,"contentWidth",null),s([l({readOnly:!0})],v.prototype,"contentHeight",null),s([l({json:{name:"url",type:String,write:{overridePolicy:(e,t,n)=>({enabled:!_e(n==null?void 0:n.layer,n==null?void 0:n.origin)})}}})],v.prototype,"image",void 0),s([J("image",["url"])],v.prototype,"readImage",null),s([ie("image")],v.prototype,"writeImage",null),s([l({readOnly:!0,json:{read:!1,write:{target:"mediaType",ignoreOrigin:!0}}})],v.prototype,"type",void 0),v=s([x("esri.layers.support.ImageElement")],v);const be=v;function It(e){return typeof e=="string"&&!we(e)&&!Ge(e)}async function St(e){return typeof e=="string"?we(e)?ze(e):(await Ue(e,{responseType:"blob"})).data:new Promise(t=>$t(e).toBlob(t))}function $t(e){if(e instanceof HTMLCanvasElement)return e;const t=e instanceof HTMLImageElement?e.naturalWidth:e.width,n=e instanceof HTMLImageElement?e.naturalHeight:e.height,o=document.createElement("canvas"),r=o.getContext("2d");return o.width=t,o.height=n,e instanceof HTMLImageElement?r.drawImage(e,0,0,e.width,e.height):e instanceof ImageData&&r.putImageData(e,0,0),o}function Ot(e,t){const n=Be(),o=`${Fe("media",n)}.${ht({type:"blob",blob:e})}`;return t.resourceFromPath(o)}let E=class extends pe{constructor(e){super(e),this.autoplay=!0,this.content=null,this.type="video"}load(){const e=this.video;if(typeof e=="string"){const t=document.createElement("video");t.src=e,t.crossOrigin="anonymous",t.autoplay=!0,t.muted=!0,t.loop=!0,this.addResolvingPromise(this._loadVideo(t).then(()=>{this._set("content",t)}))}else e instanceof HTMLVideoElement?this.addResolvingPromise(this._loadVideo(e).then(()=>{this._set("content",e)})):this.addResolvingPromise(Promise.reject(new D("video-element:invalid-video-type","Invalid video type",{video:e})));return Promise.resolve(this)}get contentWidth(){var e;return((e=this.content)==null?void 0:e.videoWidth)??0}get contentHeight(){var e;return((e=this.content)==null?void 0:e.videoHeight)??0}set video(e){this.loadStatus==="not-loaded"?this._set("video",e):U.getLogger(this).error("#video","video cannot be changed after the element is loaded.")}_loadVideo(e){return new Promise((t,n)=>{var r;const o=ke(e,"canplay",()=>{this.removeHandles("canplay"),this.autoplay?e.play().then(t,n):t()});this.addHandles(o,"canplay"),e.crossOrigin!=="anonymous"&&(e.crossOrigin="anonymous",(r=e.src)!=null&&r.includes("blob:")||(e.src=e.src))})}};s([l()],E.prototype,"autoplay",void 0),s([l({readOnly:!0})],E.prototype,"content",void 0),s([l({readOnly:!0})],E.prototype,"contentWidth",null),s([l({readOnly:!0})],E.prototype,"contentHeight",null),s([l()],E.prototype,"video",null),E=s([x("esri.layers.support.VideoElement")],E);const Ie=E,Mt={key:"type",defaultKeyValue:"image",base:pe,typeMap:{image:be,video:Ie}},ge=X.ofType(Mt);let G=class extends xe.LoadableMixin(De(Je.EventedAccessor)){constructor(e){super(e),this._index=new mt,this._elementViewsMap=new Map,this._elementsIndexes=new Map,this._elementsChangedHandler=t=>{for(const o of t.removed){const r=this._elementViewsMap.get(o);this._elementViewsMap.delete(o),this._index.delete(r),this.removeHandles(r),r.destroy(),this.notifyChange("fullExtent")}const{spatialReference:n}=this;for(const o of t.added){if(this._elementViewsMap.get(o))continue;const r=new pt({spatialReference:n,element:o});this._elementViewsMap.set(o,r);const i=qe(()=>r.coords,()=>this._updateIndexForElement(r,!1));this._updateIndexForElement(r,!0),this.addHandles(i,r)}this._elementsIndexes.clear(),this.elements.forEach((o,r)=>this._elementsIndexes.set(o,r)),this.emit("refresh")},this.elements=new ge}async load(e){if(Ke(e),!this.spatialReference){const t=this.elements.find(n=>{var o;return((o=n.georeference)==null?void 0:o.coords)!=null});this._set("spatialReference",t?t.georeference.coords.spatialReference:Pe.WGS84)}return this._elementsChangedHandler({added:this.elements.items,removed:[]}),this.addHandles(this.elements.on("change",this._elementsChangedHandler)),this}destroy(){this._index.clear(),this._elementViewsMap.clear(),this._elementsIndexes.clear()}set elements(e){this._set("elements",Ye(e,this._get("elements"),ge))}get fullExtent(){if(this.loadStatus==="not-loaded")return null;const e=this._index.fullBounds;return e==null?null:new le({xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3],spatialReference:this.spatialReference})}set spatialReference(e){this.loadStatus==="not-loaded"?this._set("spatialReference",e):U.getLogger(this).error("#spatialReference","spatialReference cannot be changed after the source is loaded.")}async queryElements(e,t){await this.load(),await Ze(e.spatialReference,this.spatialReference,null,t);const n=Qe(e.spatialReference,this.spatialReference)?e:Xe(e,this.spatialReference);if(!n)return[];const o=n.normalize(),r=[];for(const i of o)this._index.forEachInBounds(et(i),({normalizedCoords:a,element:c})=>{a!=null&&tt(i,a)&&r.push(c)});return r.sort((i,a)=>this._elementsIndexes.get(i)-this._elementsIndexes.get(a)),r}_updateIndexForElement(e,t){const n=e.normalizedBounds,o=this._index.has(e),r=n!=null;this._index.delete(e),r&&this._index.set(e,n),this.notifyChange("fullExtent"),t||(o!==r?this.emit("refresh"):this.emit("change",{element:e.element}))}};s([l()],G.prototype,"elements",null),s([l({readOnly:!0})],G.prototype,"fullExtent",null),s([l()],G.prototype,"spatialReference",null),G=s([x("esri.layers.support.LocalMediaElementSource")],G);const Q=G;function se(e){return typeof e=="object"&&e!=null&&"type"in e}function Se(e){return se(e)&&e.type==="image"}let h=class extends nt(ot(rt(st(ve(lt))))){constructor(e){super(e),this.effectiveSource=null,this.georeference=null,this.copyright=null,this.operationalLayerType="MediaLayer",this.spatialReference=null,this.type="media",this._debouncedSaveOperations=it(async(t,n,o)=>{const{save:r,saveAs:i}=await ct(()=>import("./mediaLayerUtils-DFCF50LE.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));switch(t){case Y.SAVE:return r(this,n);case Y.SAVE_AS:return i(this,o,n)}}),this.source=new Q}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){await this.loadFromPortal({supportedTypes:["Media Layer"]},e);let t=this.source;if(!t)throw new D("media-layer:source-missing","Set 'MediaLayer.source' before loading the layer.");const n=this._getSourceOverride(t,this.georeference);n&&(this.setAtOrigin("source",n,"web-map"),t=n);const o=se(t)?new Q({elements:new X([t])}):t;this._set("effectiveSource",o),this.spatialReference&&(o.spatialReference=this.spatialReference),await o.load(e),this.spatialReference=o.spatialReference}destroy(){var e,t;(e=this.effectiveSource)==null||e.destroy(),(t=this.source)==null||t.destroy()}readGeoreference(e,t){return e&&"itemId"in t&&t.itemId?e:void 0}get fullExtent(){return this.loaded?this.effectiveSource.fullExtent:null}set source(e){this.loadStatus!=="loaded"&&this.loadStatus!=="failed"?this._set("source",e):U.getLogger(this).error("#source","source cannot be changed after the layer is loaded.")}castSource(e){return e?Array.isArray(e)?new Q({elements:new X(e)}):e instanceof X?new Q({elements:e}):e:null}readSource(e,t,n){if("itemId"in t&&t.itemId)return;const o=this._createSource(t);return o==null||o.read(t,n),o}writeSource(e,t,n,o){var r;Se(e)?e.write(t,o):o!=null&&o.messages&&((r=o==null?void 0:o.messages)==null||r.push(new D("media-layer:unsupported-source","source must be an 'ImageElement'")))}async save(e){return this._debouncedSaveOperations(Y.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(Y.SAVE_AS,t,e)}_createSource(e){if("mediaType"in e)switch(e.mediaType){case"image":return new be;case"video":return new Ie}return null}_getSourceOverride(e,t){if(se(e)&&this.originIdOf("source")===ee.PORTAL_ITEM&&t&&this.originIdOf("georeference")===ee.WEB_MAP){const n=e.toJSON(),o=this._createSource(n);return o.read({...n},{origin:"portal-item"}),o.read({georeference:t},{origin:"web-map"}),o}return null}};s([l({readOnly:!0})],h.prototype,"effectiveSource",void 0),s([l({readOnly:!0,json:{read:!1,write:!1,origins:{"web-map":{read:!0,write:!1}}}})],h.prototype,"georeference",void 0),s([J("web-map","georeference")],h.prototype,"readGeoreference",null),s([l({type:String})],h.prototype,"copyright",void 0),s([l({readOnly:!0})],h.prototype,"fullExtent",null),s([l({type:["MediaLayer"]})],h.prototype,"operationalLayerType",void 0),s([l({type:["show","hide"]})],h.prototype,"listMode",void 0),s([l({nonNullable:!0,json:{write:{enabled:!0,allowNull:!1,overridePolicy(e,t,n){return{enabled:!0,allowNull:!1,ignoreOrigin:_e(this,n==null?void 0:n.origin)&&Se(e)&&!!e.georeference&&e.originIdOf("georeference")>ee.PORTAL_ITEM}}}}})],h.prototype,"source",null),s([at("source")],h.prototype,"castSource",null),s([J("source",["url"])],h.prototype,"readSource",null),s([ie("source")],h.prototype,"writeSource",null),s([l()],h.prototype,"spatialReference",void 0),s([l({readOnly:!0})],h.prototype,"type",void 0),h=s([x("esri.layers.MediaLayer")],h);const Ut=h;export{Ut as default}; diff --git a/assets/MediaLayerView2D-vpnVWbi-.js b/assets/MediaLayerView2D-CfaV01hI.js similarity index 83% rename from assets/MediaLayerView2D-vpnVWbi-.js rename to assets/MediaLayerView2D-CfaV01hI.js index 89cf047..7cf4b01 100644 --- a/assets/MediaLayerView2D-vpnVWbi-.js +++ b/assets/MediaLayerView2D-CfaV01hI.js @@ -1 +1 @@ -import{A as q,fU as K,g as A,P as M,fV as I,p as X,fW as ee,s as N,N as te,D as se,fX as U,fj as re,fY as ie,eO as ne,fZ as oe,eH as ae,eM as le,eI as he,eJ as me,f_ as pe,eK as de,aj as ce,f$ as ue,V as fe,z,m as ye,r as _e,g0 as ve,b as ge,aE as we,Z as Re,d as P,y as L,f as xe,ai as Me,g1 as $e}from"./index-CEWggaxV.js";import"./UniqueValueRenderer-BlkUix3g.js";import"./jsonUtils-BseLl1fZ.js";import{j as Ee,m as W}from"./perspectiveUtils-24oy2YlR.js";import"./UpdateTracking2D-nj9Q-3df.js";import"./labelUtils-Dnqx6jl5.js";import"./OverrideHelper-B4ryGWZb.js";import"./floatRGBA-BLm-Rhaq.js";import{i as Ve,E as be}from"./Container-CB7SlLB9.js";import{n as Te,h as Ce}from"./WGLContainer-B_Pv-8Yi.js";import{e as Se,m as Q}from"./Texture-DJgkMrSB.js";import{h as k}from"./Program-DLRmaKpw.js";import"./LabelMetric-D2hbzzy_.js";import"./MagnifierPrograms-B5-grLP-.js";import"./pbf-D9QZb8S8.js";import"./FeatureCommandQueue-Btq_FXyi.js";import"./OrderIndependentTransparency-C747AfeB.js";import"./testSVGPremultipliedAlpha-B0ipOzbU.js";import"./GraphicsView2D-DbbthiwV.js";import"./earcut-hRlx3adE.js";import{r as qe}from"./vec3f32-nZdmKIgz.js";import{e as Ae}from"./mat3f64-q3fE-ZOt.js";import{f as Pe}from"./utils-CJVw5T-r.js";import{o as De}from"./ProgramTemplate-BICQrNzS.js";import{m as Oe,u as Ge}from"./LayerView-BEFTHNYv.js";import"./ColorStop-44hBlQ14.js";import"./diffUtils-B4YFa5Ju.js";import"./colorRamps-BJydlf0f.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-z2k12BH8.js";import"./jsonUtils-qYmXvGJ1.js";import"./styleUtils-CnV_Xzhi.js";import"./Version-Bd0QsIQ5.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./utils-p-5Bbga5.js";import"./heatmapUtils-Clt5rJzr.js";import"./normalizeUtilsSync-B6VufdiX.js";import"./TurboLine-CkxIB4ZX.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./Rect-CUzevAry.js";import"./BindType-BmZEZMMh.js";import"./Util-BS8sJGjF.js";import"./highlightReasons-DbgbcWKM.js";import"./constants-D5zmR9t2.js";import"./defaultsJSON-CHAaurhX.js";import"./quantizationUtils-CUjGHrU3.js";import"./config-MDUrh2eL.js";import"./featureConversionUtils-CmP9mw0r.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./CircularArray-DfLrgW_-.js";import"./AttributeStore-Ck-75lnq.js";import"./TimeOnly-Cm47ew5I.js";import"./timeSupport-BjRbXIpn.js";import"./json-Wa8cmqdu.js";import"./basicInterfaces-GbxEOYtk.js";import"./scaleUtils-Bqauo1zZ.js";const y=Ae(),He={none:q.None,loop:q.Loop,oscillate:q.Oscillate};function je(s){return s?{...s,playAnimation:s.playing,repeatType:s.repeatType?He[s.repeatType]:void 0}:{}}class Ie extends Ve{constructor(e){super(),this.elementView=e,this.isWrapAround=!1,this.perspectiveTransform=K(),this._playHandle=null,this._vertices=new Float32Array(20),this._handles=[],this._handles.push(A(()=>this.elementView.element.opacity,t=>this.opacity=t,M),A(()=>[this.elementView.coords],()=>{this.requestRender()},M),A(()=>["animationOptions"in this.elementView.element&&this.elementView.element.animationOptions],()=>{var t;(t=this._playHandle)==null||t.remove(),this.texture=I(this.texture),this.requestRender()},M),X(()=>this.elementView.element.loaded,()=>{const t=this.elementView.element;this.ready(),t.type==="video"&&t.content!=null&&this._handles.push(ee(t.content,"play",()=>this.requestRender()))},M)),e.element.load().catch(t=>{N.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new te("element-load-error","Element cannot be displayed",{element:e,error:t}))})}getMesh(e){throw new Error("Method not implemented.")}destroy(){var e;(e=this._playHandle)==null||e.remove(),this._handles.forEach(t=>t.remove()),this.texture=I(this.texture)}get dvsMat3(){return this.parent.dvsMat3}beforeRender(e){const{context:t}=e,r=this.elementView.element.content;if(r!=null){const i=r instanceof HTMLImageElement,n=r instanceof HTMLVideoElement,h=i?r.naturalWidth:n?r.videoWidth:r.width,o=i?r.naturalHeight:n?r.videoHeight:r.height;if(this._updatePerspectiveTransform(h,o),this.texture)n&&!r.paused&&(this.texture.setData(r),this.requestRender(),this.texture.generateMipmap());else{const m=new Se;if(m.wrapMode=se.CLAMP_TO_EDGE,m.preMultiplyAlpha=!0,m.width=h,m.height=o,"getFrame"in r){const l=a=>{this.texture?this.texture.setData(a):this.texture=new Q(t,m,a),this.requestRender()};"animationOptions"in this.elementView.element&&(this._playHandle=Pe(r,je(this.elementView.element.animationOptions),null,l))}else this.texture=new Q(t,m,r);this.texture.generateMipmap(),n&&!r.paused&&this.requestRender()}}super.beforeRender(e)}_createTransforms(){return null}updateDrawCoords(e,t){const r=this.elementView.coords;if(r==null)return;const[i,n,h,o]=r.rings[0],m=this._vertices,{x:l,y:a}=e,c=t!==0;c?m.set([n[0]-l,n[1]-a,i[0]-l,i[1]-a,h[0]-l,h[1]-a,o[0]-l,o[1]-a,o[0]-l,o[1]-a,n[0]+t-l,n[1]-a,n[0]+t-l,n[1]-a,i[0]+t-l,i[1]-a,h[0]+t-l,h[1]-a,o[0]+t-l,o[1]-a]):m.set([n[0]-l,n[1]-a,i[0]-l,i[1]-a,h[0]-l,h[1]-a,o[0]-l,o[1]-a]),this.isWrapAround=c}getVAO(e,t,r){if(this.elementView.coords==null)return null;const i=this._vertices;if(this._vao)this._geometryVbo.setData(i);else{this._geometryVbo=k.createVertex(e,U.DYNAMIC_DRAW,i);const n=k.createVertex(e,U.STATIC_DRAW,new Uint16Array([0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,1,1,0,1,1]));this._vao=new De(e,r,t,{geometry:this._geometryVbo,tex:n})}return this._vao}_updatePerspectiveTransform(e,t){const r=this._vertices;Ee(y,[0,0,e,0,0,t,e,t],[r[0],r[1],r[4],r[5],r[2],r[3],r[6],r[7]]),re(this.perspectiveTransform,y[6]/y[8]*e,y[7]/y[8]*t)}}class Ue extends Te{constructor(){super(...arguments),this._localOrigin=ie(0,0),this._viewStateId=-1,this._dvsMat3=ne()}get dvsMat3(){return this._dvsMat3}beforeRender(e){this._updateMatrices(e),this._updateOverlays(e,this.children);for(const t of this.children)t.beforeRender(e)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"overlay",brushes:[Ce.overlay],target:()=>this.children,drawPhase:be.MAP});return[...super.prepareRenderPasses(e),t]}_updateMatrices(e){const{state:t}=e,{id:r,size:i,pixelRatio:n,resolution:h,rotation:o,viewpoint:m,displayMat3:l}=t;if(this._viewStateId===r)return;const a=Math.PI/180*o,c=n*i[0],f=n*i[1],{x:$,y:g}=m.targetGeometry,E=oe($,t.spatialReference);this._localOrigin.x=E,this._localOrigin.y=g;const V=h*c,w=h*f,p=ae(this._dvsMat3);le(p,p,l),he(p,p,me(c/2,f/2)),pe(p,p,qe(c/V,-f/w,1)),de(p,p,-a),this._viewStateId=r}_updateOverlays(e,t){const{state:r}=e,{rotation:i,spatialReference:n,worldScreenWidth:h,size:o,viewpoint:m}=r,l=this._localOrigin;let a=0;const c=ce(n);if(c&&n.isWrappable){const f=o[0],$=o[1],g=180/Math.PI*i,E=Math.abs(Math.cos(g)),V=Math.abs(Math.sin(g)),w=Math.round(f*E+$*V),[p,b]=c.valid,u=ue(n),{x:D,y:B}=m.targetGeometry,Y=[D,B],T=[0,0];r.toScreen(T,Y);const R=[0,0];let C;C=w>h?.5*h:.5*w;const O=Math.floor((D+.5*u)/u),Z=p+O*u,J=b+O*u,S=[T[0]+C,0];r.toMap(R,S),R[0]>J&&(a=u),S[0]=T[0]-C,r.toMap(R,S),R[0]p?x.updateDrawCoords(l,u):j>b&&Hthis.layer.effectiveSource,"refresh",()=>{this._tileStrategy.refresh(s=>this._updateTile(s)),this.requestUpdate()}),z(()=>this.layer.effectiveSource,"change",({element:s})=>this._elementUpdateHandler(s))]),this._overlayContainer=new Ue,this.container.addChild(this._overlayContainer),this._fetchQueue=new ye({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(s,e)=>this._queryElements(s,e)}),this._tileStrategy=new _e({cachePolicy:"purge",resampling:!0,acquireTile:s=>this._acquireTile(s),releaseTile:s=>this._releaseTile(s),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){var s;this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),(s=this._debugGraphicsView)==null||s.destroy()}supportsSpatialReference(s){return!0}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(s){var e;this._tileStrategy.update(s),(e=this._debugGraphicsView)==null||e.update(s)}async hitTest(s,e){const t=[],r=s.normalize(),i=[r.x,r.y];for(const{projectedElement:{normalizedCoords:n,element:h}}of this._elementReferences.values())n!=null&&ve(n.rings,i)&&t.push({type:"media",element:h,layer:this.layer,mapPoint:s,sourcePoint:h.toSource(s)});return t.reverse()}canResume(){return this.layer.source!=null&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(s=>this._updateTile(s))}_acquireTile(s){const e=new ze(s.clone());return this._updateTile(e),e}_updateTile(s){this._updatingHandles.addPromise(this._fetchQueue.push(s.key).then(e=>{const[t,r]=s.setElements(e);this._referenceElements(s,t),this._dereferenceElements(s,r),this.requestUpdate()},e=>{ge(e)||N.getLogger(this).error(e)}))}_releaseTile(s){this._fetchQueue.abort(s.key.id),s.elements&&this._dereferenceElements(s,s.elements),this.requestUpdate()}async _queryElements(s,e){const t=this.layer.effectiveSource;if(t==null)return[];this.view.featuresTilingScheme.getTileBounds(d,s,!0);const r=new we({xmin:d[0],ymin:d[1],xmax:d[2],ymax:d[3],spatialReference:this.view.spatialReference});return t.queryElements(r,e)}_referenceElements(s,e){if(this.layer.source!=null)for(const t of e)this._referenceElement(s,t)}_referenceElement(s,e){Re(this._elementReferences,e.uid,()=>{const t=new W({element:e,spatialReference:this.view.spatialReference}),r=new Ie(t);return this._overlayContainer.addChild(r),this.elements.add(e),{tiles:new Set,projectedElement:t,overlay:r,debugGraphic:null}}).tiles.add(s)}_dereferenceElements(s,e){for(const t of e)this._dereferenceElement(s,t)}_dereferenceElement(s,e){var r;const t=this._elementReferences.get(e.uid);t.tiles.delete(s),t.tiles.size||(this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.projectedElement.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),(r=this._debugGraphicsView)==null||r.graphics.remove(t.debugGraphic))}_elementUpdateHandler(s){var r;let e=this._elementReferences.get(s.uid);if(e){const i=e.projectedElement.normalizedCoords;if(i==null)return this._overlayContainer.removeChild(e.overlay),e.overlay.destroy(),e.projectedElement.destroy(),this._elementReferences.delete(s.uid),this.elements.remove(s),void((r=this._debugGraphicsView)==null?void 0:r.graphics.remove(e.debugGraphic));const n=[],h=[];for(const o of this._tileStrategy.tiles){const m=F(this.view.featuresTilingScheme,o,i);e.tiles.has(o)?m||h.push(o):m&&n.push(o)}for(const o of n)this._referenceElement(o,s);for(const o of h)this._dereferenceElement(o,s);return e=this._elementReferences.get(s.uid),void((e==null?void 0:e.debugGraphic)&&(e.debugGraphic.geometry=e.projectedElement.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:e.debugGraphic,property:"geometry"})))}const t=new W({element:s,spatialReference:this.view.spatialReference}).normalizedCoords;if(t!=null)for(const i of this._tileStrategy.tiles)F(this.view.featuresTilingScheme,i,t)&&this._referenceElement(i,s)}};P([L()],v.prototype,"layer",void 0),P([L({readOnly:!0})],v.prototype,"elements",void 0),v=P([xe("esri.views.2d.layers.MediaLayerView2D")],v);const d=Me(),_={xmin:0,ymin:0,xmax:0,ymax:0};function F(s,e,t){return s.getTileBounds(d,e.key,!0),_.xmin=d[0],_.ymin=d[1],_.xmax=d[2],_.ymax=d[3],$e(_,t)}class ze{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],r=new Set(this.elements);this.elements=e;for(const i of e)r.has(i)?r.delete(i):t.push(i);return this.isReady=!0,[t,Array.from(r)]}destroy(){}}const kt=v;export{kt as default}; +import{A as q,fU as K,g as A,P as M,fV as I,p as X,fW as ee,s as N,N as te,D as se,fX as U,fj as re,fY as ie,eO as ne,fZ as oe,eH as ae,eM as le,eI as he,eJ as me,f_ as pe,eK as de,aj as ce,f$ as ue,V as fe,z,m as ye,r as _e,g0 as ve,b as ge,aE as we,Z as Re,d as P,y as L,f as xe,ai as Me,g1 as $e}from"./index-BjUNJPVf.js";import"./UniqueValueRenderer-7V9Bhr-D.js";import"./jsonUtils-Dw332y6z.js";import{j as Ee,m as W}from"./perspectiveUtils-DhC7L1B1.js";import"./UpdateTracking2D-Ds_Gdrxd.js";import"./labelUtils-3p0-m-Ee.js";import"./OverrideHelper-DxFZBnGL.js";import"./floatRGBA-Cs54GdjG.js";import{i as Ve,E as be}from"./Container-_n5wCgez.js";import{n as Te,h as Ce}from"./WGLContainer-DgZNq7b0.js";import{e as Se,m as Q}from"./Texture-S4dD-WHn.js";import{h as k}from"./Program-DBsYtQ00.js";import"./LabelMetric-BcUxDImF.js";import"./MagnifierPrograms-Dy7jbVaV.js";import"./pbf-Du8sFEWo.js";import"./FeatureCommandQueue-DI81F3gA.js";import"./OrderIndependentTransparency-Btph8gYx.js";import"./testSVGPremultipliedAlpha-BUMQhQ4O.js";import"./GraphicsView2D-B7H8XAnI.js";import"./earcut-CWKXDqDj.js";import{r as qe}from"./vec3f32-nZdmKIgz.js";import{e as Ae}from"./mat3f64-q3fE-ZOt.js";import{f as Pe}from"./utils-D-nPH6yJ.js";import{o as De}from"./ProgramTemplate-Ck2I0bIi.js";import{m as Oe,u as Ge}from"./LayerView-Bux7vAEn.js";import"./ColorStop-DCGjAKLC.js";import"./diffUtils-uUoMDFQS.js";import"./colorRamps-CcakIWlU.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-BX9G5gNQ.js";import"./jsonUtils-Ox5U0P0F.js";import"./styleUtils-DOUOskVZ.js";import"./Version-Dqq_CHBG.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./utils-CuXO_Zzq.js";import"./heatmapUtils-BSteZBTj.js";import"./normalizeUtilsSync-73yZ0QwV.js";import"./TurboLine-DNQdPIXo.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./Rect-CUzevAry.js";import"./BindType-BmZEZMMh.js";import"./Util-CS5u4Lec.js";import"./highlightReasons-BOU4mnPE.js";import"./constants-D5zmR9t2.js";import"./defaultsJSON-CHAaurhX.js";import"./quantizationUtils-CfV316jZ.js";import"./config-MDUrh2eL.js";import"./featureConversionUtils-BHhm7bvm.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./CircularArray-DfLrgW_-.js";import"./AttributeStore-Bm6hLtR1.js";import"./TimeOnly-BXSODLxA.js";import"./timeSupport-DXkhlToK.js";import"./json-Wa8cmqdu.js";import"./basicInterfaces-GbxEOYtk.js";import"./scaleUtils-DWXMiS7R.js";const y=Ae(),He={none:q.None,loop:q.Loop,oscillate:q.Oscillate};function je(s){return s?{...s,playAnimation:s.playing,repeatType:s.repeatType?He[s.repeatType]:void 0}:{}}class Ie extends Ve{constructor(e){super(),this.elementView=e,this.isWrapAround=!1,this.perspectiveTransform=K(),this._playHandle=null,this._vertices=new Float32Array(20),this._handles=[],this._handles.push(A(()=>this.elementView.element.opacity,t=>this.opacity=t,M),A(()=>[this.elementView.coords],()=>{this.requestRender()},M),A(()=>["animationOptions"in this.elementView.element&&this.elementView.element.animationOptions],()=>{var t;(t=this._playHandle)==null||t.remove(),this.texture=I(this.texture),this.requestRender()},M),X(()=>this.elementView.element.loaded,()=>{const t=this.elementView.element;this.ready(),t.type==="video"&&t.content!=null&&this._handles.push(ee(t.content,"play",()=>this.requestRender()))},M)),e.element.load().catch(t=>{N.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new te("element-load-error","Element cannot be displayed",{element:e,error:t}))})}getMesh(e){throw new Error("Method not implemented.")}destroy(){var e;(e=this._playHandle)==null||e.remove(),this._handles.forEach(t=>t.remove()),this.texture=I(this.texture)}get dvsMat3(){return this.parent.dvsMat3}beforeRender(e){const{context:t}=e,r=this.elementView.element.content;if(r!=null){const i=r instanceof HTMLImageElement,n=r instanceof HTMLVideoElement,h=i?r.naturalWidth:n?r.videoWidth:r.width,o=i?r.naturalHeight:n?r.videoHeight:r.height;if(this._updatePerspectiveTransform(h,o),this.texture)n&&!r.paused&&(this.texture.setData(r),this.requestRender(),this.texture.generateMipmap());else{const m=new Se;if(m.wrapMode=se.CLAMP_TO_EDGE,m.preMultiplyAlpha=!0,m.width=h,m.height=o,"getFrame"in r){const l=a=>{this.texture?this.texture.setData(a):this.texture=new Q(t,m,a),this.requestRender()};"animationOptions"in this.elementView.element&&(this._playHandle=Pe(r,je(this.elementView.element.animationOptions),null,l))}else this.texture=new Q(t,m,r);this.texture.generateMipmap(),n&&!r.paused&&this.requestRender()}}super.beforeRender(e)}_createTransforms(){return null}updateDrawCoords(e,t){const r=this.elementView.coords;if(r==null)return;const[i,n,h,o]=r.rings[0],m=this._vertices,{x:l,y:a}=e,c=t!==0;c?m.set([n[0]-l,n[1]-a,i[0]-l,i[1]-a,h[0]-l,h[1]-a,o[0]-l,o[1]-a,o[0]-l,o[1]-a,n[0]+t-l,n[1]-a,n[0]+t-l,n[1]-a,i[0]+t-l,i[1]-a,h[0]+t-l,h[1]-a,o[0]+t-l,o[1]-a]):m.set([n[0]-l,n[1]-a,i[0]-l,i[1]-a,h[0]-l,h[1]-a,o[0]-l,o[1]-a]),this.isWrapAround=c}getVAO(e,t,r){if(this.elementView.coords==null)return null;const i=this._vertices;if(this._vao)this._geometryVbo.setData(i);else{this._geometryVbo=k.createVertex(e,U.DYNAMIC_DRAW,i);const n=k.createVertex(e,U.STATIC_DRAW,new Uint16Array([0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,1,1,0,1,1]));this._vao=new De(e,r,t,{geometry:this._geometryVbo,tex:n})}return this._vao}_updatePerspectiveTransform(e,t){const r=this._vertices;Ee(y,[0,0,e,0,0,t,e,t],[r[0],r[1],r[4],r[5],r[2],r[3],r[6],r[7]]),re(this.perspectiveTransform,y[6]/y[8]*e,y[7]/y[8]*t)}}class Ue extends Te{constructor(){super(...arguments),this._localOrigin=ie(0,0),this._viewStateId=-1,this._dvsMat3=ne()}get dvsMat3(){return this._dvsMat3}beforeRender(e){this._updateMatrices(e),this._updateOverlays(e,this.children);for(const t of this.children)t.beforeRender(e)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"overlay",brushes:[Ce.overlay],target:()=>this.children,drawPhase:be.MAP});return[...super.prepareRenderPasses(e),t]}_updateMatrices(e){const{state:t}=e,{id:r,size:i,pixelRatio:n,resolution:h,rotation:o,viewpoint:m,displayMat3:l}=t;if(this._viewStateId===r)return;const a=Math.PI/180*o,c=n*i[0],f=n*i[1],{x:$,y:g}=m.targetGeometry,E=oe($,t.spatialReference);this._localOrigin.x=E,this._localOrigin.y=g;const V=h*c,w=h*f,p=ae(this._dvsMat3);le(p,p,l),he(p,p,me(c/2,f/2)),pe(p,p,qe(c/V,-f/w,1)),de(p,p,-a),this._viewStateId=r}_updateOverlays(e,t){const{state:r}=e,{rotation:i,spatialReference:n,worldScreenWidth:h,size:o,viewpoint:m}=r,l=this._localOrigin;let a=0;const c=ce(n);if(c&&n.isWrappable){const f=o[0],$=o[1],g=180/Math.PI*i,E=Math.abs(Math.cos(g)),V=Math.abs(Math.sin(g)),w=Math.round(f*E+$*V),[p,b]=c.valid,u=ue(n),{x:D,y:B}=m.targetGeometry,Y=[D,B],T=[0,0];r.toScreen(T,Y);const R=[0,0];let C;C=w>h?.5*h:.5*w;const O=Math.floor((D+.5*u)/u),Z=p+O*u,J=b+O*u,S=[T[0]+C,0];r.toMap(R,S),R[0]>J&&(a=u),S[0]=T[0]-C,r.toMap(R,S),R[0]p?x.updateDrawCoords(l,u):j>b&&Hthis.layer.effectiveSource,"refresh",()=>{this._tileStrategy.refresh(s=>this._updateTile(s)),this.requestUpdate()}),z(()=>this.layer.effectiveSource,"change",({element:s})=>this._elementUpdateHandler(s))]),this._overlayContainer=new Ue,this.container.addChild(this._overlayContainer),this._fetchQueue=new ye({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(s,e)=>this._queryElements(s,e)}),this._tileStrategy=new _e({cachePolicy:"purge",resampling:!0,acquireTile:s=>this._acquireTile(s),releaseTile:s=>this._releaseTile(s),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){var s;this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),(s=this._debugGraphicsView)==null||s.destroy()}supportsSpatialReference(s){return!0}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(s){var e;this._tileStrategy.update(s),(e=this._debugGraphicsView)==null||e.update(s)}async hitTest(s,e){const t=[],r=s.normalize(),i=[r.x,r.y];for(const{projectedElement:{normalizedCoords:n,element:h}}of this._elementReferences.values())n!=null&&ve(n.rings,i)&&t.push({type:"media",element:h,layer:this.layer,mapPoint:s,sourcePoint:h.toSource(s)});return t.reverse()}canResume(){return this.layer.source!=null&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(s=>this._updateTile(s))}_acquireTile(s){const e=new ze(s.clone());return this._updateTile(e),e}_updateTile(s){this._updatingHandles.addPromise(this._fetchQueue.push(s.key).then(e=>{const[t,r]=s.setElements(e);this._referenceElements(s,t),this._dereferenceElements(s,r),this.requestUpdate()},e=>{ge(e)||N.getLogger(this).error(e)}))}_releaseTile(s){this._fetchQueue.abort(s.key.id),s.elements&&this._dereferenceElements(s,s.elements),this.requestUpdate()}async _queryElements(s,e){const t=this.layer.effectiveSource;if(t==null)return[];this.view.featuresTilingScheme.getTileBounds(d,s,!0);const r=new we({xmin:d[0],ymin:d[1],xmax:d[2],ymax:d[3],spatialReference:this.view.spatialReference});return t.queryElements(r,e)}_referenceElements(s,e){if(this.layer.source!=null)for(const t of e)this._referenceElement(s,t)}_referenceElement(s,e){Re(this._elementReferences,e.uid,()=>{const t=new W({element:e,spatialReference:this.view.spatialReference}),r=new Ie(t);return this._overlayContainer.addChild(r),this.elements.add(e),{tiles:new Set,projectedElement:t,overlay:r,debugGraphic:null}}).tiles.add(s)}_dereferenceElements(s,e){for(const t of e)this._dereferenceElement(s,t)}_dereferenceElement(s,e){var r;const t=this._elementReferences.get(e.uid);t.tiles.delete(s),t.tiles.size||(this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.projectedElement.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),(r=this._debugGraphicsView)==null||r.graphics.remove(t.debugGraphic))}_elementUpdateHandler(s){var r;let e=this._elementReferences.get(s.uid);if(e){const i=e.projectedElement.normalizedCoords;if(i==null)return this._overlayContainer.removeChild(e.overlay),e.overlay.destroy(),e.projectedElement.destroy(),this._elementReferences.delete(s.uid),this.elements.remove(s),void((r=this._debugGraphicsView)==null?void 0:r.graphics.remove(e.debugGraphic));const n=[],h=[];for(const o of this._tileStrategy.tiles){const m=F(this.view.featuresTilingScheme,o,i);e.tiles.has(o)?m||h.push(o):m&&n.push(o)}for(const o of n)this._referenceElement(o,s);for(const o of h)this._dereferenceElement(o,s);return e=this._elementReferences.get(s.uid),void((e==null?void 0:e.debugGraphic)&&(e.debugGraphic.geometry=e.projectedElement.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:e.debugGraphic,property:"geometry"})))}const t=new W({element:s,spatialReference:this.view.spatialReference}).normalizedCoords;if(t!=null)for(const i of this._tileStrategy.tiles)F(this.view.featuresTilingScheme,i,t)&&this._referenceElement(i,s)}};P([L()],v.prototype,"layer",void 0),P([L({readOnly:!0})],v.prototype,"elements",void 0),v=P([xe("esri.views.2d.layers.MediaLayerView2D")],v);const d=Me(),_={xmin:0,ymin:0,xmax:0,ymax:0};function F(s,e,t){return s.getTileBounds(d,e.key,!0),_.xmin=d[0],_.ymin=d[1],_.xmax=d[2],_.ymax=d[3],$e(_,t)}class ze{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],r=new Set(this.elements);this.elements=e;for(const i of e)r.has(i)?r.delete(i):t.push(i);return this.isReady=!0,[t,Array.from(r)]}destroy(){}}const kt=v;export{kt as default}; diff --git a/assets/MemorySourceWorker-CaK7s0IK.js b/assets/MemorySourceWorker-DFsRya29.js similarity index 89% rename from assets/MemorySourceWorker-CaK7s0IK.js rename to assets/MemorySourceWorker-DFsRya29.js index 718053c..7b83b0c 100644 --- a/assets/MemorySourceWorker-CaK7s0IK.js +++ b/assets/MemorySourceWorker-DFsRya29.js @@ -1 +1 @@ -import{N as I,cC as Q,cD as Z,T as A,W as C,cF as F,cB as S,aa as v}from"./index-CEWggaxV.js";import{e as O,n as k,t as P}from"./featureConversionUtils-CmP9mw0r.js";import{t as $,n as G}from"./objectIdUtils-4dd1rf9p.js";import{m as L}from"./FeatureStore-CqSz6SOQ.js";import{x as E,j as T}from"./timeSupport-BjRbXIpn.js";import{$ as W}from"./QueryEngine-RpcY23Sv.js";import{i as z,o as B,a as N}from"./clientSideDefaults-CgRgH99f.js";import{j as H,f as g,p as _,d as j,y as w}from"./sourceUtils-QX9lwl5p.js";import{Z as D}from"./FieldsIndex-CLgRNeJ_.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./BoundsStore-DMoG4U0L.js";import"./PooledRBush-BsFBmw1o.js";import"./json-Wa8cmqdu.js";import"./WhereClause-Dzgyc0wk.js";import"./TimeOnly-Cm47ew5I.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./QueryEngineCapabilities-CTDe3LlQ.js";import"./quantizationUtils-CUjGHrU3.js";import"./utils-B8iadP2F.js";import"./heatmapUtils-Clt5rJzr.js";import"./utils-SjO_-1JL.js";import"./utils-GMt8_G3w.js";import"./ClassBreaksDefinition-D281x8Sj.js";import"./RenderState-DaVlEYWY.js";import"./defaultsJSON-CHAaurhX.js";import"./date-M6n_RqpC.js";const U=S,J={xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:S},K={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!1,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0}};function V(h){return v(h)?h.z!=null:!!h.hasZ}function X(h){return v(h)?h.m!=null:!!h.hasM}class Re{constructor(){this._queryEngine=null,this._nextObjectId=null}destroy(){var e;(e=this._queryEngine)==null||e.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e){const i=[],{features:a}=e,n=this._inferLayerProperties(a,e.fields),l=e.fields||[],u=e.hasM!=null?e.hasM:!!n.hasM,f=e.hasZ!=null?e.hasZ:!!n.hasZ,p=!e.spatialReference&&!n.spatialReference,d=p?U:e.spatialReference||n.spatialReference,y=p?J:null,c=e.geometryType||n.geometryType,o=!c;let t=e.objectIdField||n.objectIdField,r=e.timeInfo;const m=new D(l);if(!o&&(p&&i.push({name:"feature-layer:spatial-reference-not-found",message:"Spatial reference not provided or found in features. Defaults to WGS84"}),!c))throw new I("feature-layer:missing-property","geometryType not set and couldn't be inferred from the provided features");if(!t)throw new I("feature-layer:missing-property","objectIdField not set and couldn't be found in the provided fields");if(n.objectIdField&&t!==n.objectIdField&&(i.push({name:"feature-layer:duplicated-oid-field",message:`Provided objectIdField "${t}" doesn't match the field name "${n.objectIdField}", found in the provided fields`}),t=n.objectIdField),t&&!n.objectIdField){const s=m.get(t);s?(t=s.name,s.type="esriFieldTypeOID",s.editable=!1,s.nullable=!1):l.unshift({alias:t,name:t,type:"esriFieldTypeOID",editable:!1,nullable:!1})}for(const s of l){if(s.name==null&&(s.name=s.alias),s.alias==null&&(s.alias=s.name),!s.name)throw new I("feature-layer:invalid-field-name","field name is missing",{field:s});if(s.name===t&&(s.type="esriFieldTypeOID"),!Q.jsonValues.includes(s.type))throw new I("feature-layer:invalid-field-type",`invalid type for field "${s.name}"`,{field:s});s.length==null&&(s.length=Z(s))}const b={};for(const s of l)if(s.type!=="esriFieldTypeOID"&&s.type!=="esriFieldTypeGlobalID"){const q=A(s);q!==void 0&&(b[s.name]=q)}if(r){if(r.startTimeField){const s=m.get(r.startTimeField);s?(r.startTimeField=s.name,s.type="esriFieldTypeDate"):r.startTimeField=null}if(r.endTimeField){const s=m.get(r.endTimeField);s?(r.endTimeField=s.name,s.type="esriFieldTypeDate"):r.endTimeField=null}if(r.trackIdField){const s=m.get(r.trackIdField);s?r.trackIdField=s.name:(r.trackIdField=null,i.push({name:"feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:r}}))}r.startTimeField||r.endTimeField||(i.push({name:"feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing or invalid",details:{timeInfo:r}}),r=null)}const x=m.dateFields.length?{timeZoneIANA:e.dateFieldsTimeZone??C}:null;this._createDefaultAttributes=z(b,t);const R={warnings:i,featureErrors:[],layerDefinition:{...K,drawingInfo:B(c),templates:N(b),extent:y,geometryType:c,objectIdField:t,fields:l,hasZ:f,hasM:u,timeInfo:r,dateFieldsTimeReference:x},assignedObjectIds:{}};if(this._queryEngine=new W({fieldsIndex:D.fromLayerJSON({fields:l,timeInfo:r,dateFieldsTimeReference:x}),geometryType:c,hasM:u,hasZ:f,objectIdField:t,spatialReference:d,featureStore:new L({geometryType:c,hasM:u,hasZ:f}),timeInfo:r,cacheSpatialQueries:!0}),!(a!=null&&a.length))return this._nextObjectId=$,R;const M=G(t,a);return this._nextObjectId=M+1,await E(a,d),this._loadInitialFeatures(R,a)}async applyEdits(e){const{spatialReference:i,geometryType:a}=this._queryEngine;return await Promise.all([H(i,a),E(e.adds,i),E(e.updates,i)]),this._applyEdits(e)}queryFeatures(e,i={}){return this._queryEngine.executeQuery(e,i.signal)}queryFeatureCount(e,i={}){return this._queryEngine.executeQueryForCount(e,i.signal)}queryObjectIds(e,i={}){return this._queryEngine.executeQueryForIds(e,i.signal)}queryExtent(e,i={}){return this._queryEngine.executeQueryForExtent(e,i.signal)}querySnapping(e,i={}){return this._queryEngine.executeQueryForSnapping(e,i.signal)}_inferLayerProperties(e,i){let a,n,l=null,u=null,f=null;for(const p of e){const d=p.geometry;if(d!=null&&(l||(l=F(d)),u||(u=d.spatialReference),a==null&&(a=V(d)),n==null&&(n=X(d)),l&&u&&a!=null&&n!=null))break}if(i&&i.length){let p=null;i.some(d=>{const y=d.type==="esriFieldTypeOID",c=!d.type&&d.name&&d.name.toLowerCase()==="objectid";return p=d,y||c})&&(f=p.name)}return{geometryType:l,spatialReference:u,objectIdField:f,hasM:n,hasZ:a}}async _loadInitialFeatures(e,i){const{geometryType:a,hasM:n,hasZ:l,objectIdField:u,spatialReference:f,featureStore:p,fieldsIndex:d}=this._queryEngine,y=[];for(const t of i){if(t.uid!=null&&(e.assignedObjectIds[t.uid]=-1),t.geometry&&a!==F(t.geometry)){e.featureErrors.push(g("Incorrect geometry type."));continue}const r=this._createDefaultAttributes(),m=_(d,r,t.attributes,!0);m?e.featureErrors.push(m):(this._assignObjectId(r,t.attributes,!0),t.attributes=r,t.uid!=null&&(e.assignedObjectIds[t.uid]=t.attributes[u]),t.geometry!=null&&(t.geometry=T(t.geometry,t.geometry.spatialReference,f)),y.push(t))}p.addMany(O([],y,a,l,n,u));const{fullExtent:c,timeExtent:o}=await this._queryEngine.fetchRecomputedExtents();if(e.layerDefinition.extent=c,o){const{start:t,end:r}=o;e.layerDefinition.timeInfo.timeExtent=[t,r]}return e}async _applyEdits(e){const{adds:i,updates:a,deletes:n}=e,l={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(i!=null&&i.length&&this._applyAddEdits(l,i),a!=null&&a.length&&this._applyUpdateEdits(l,a),n==null?void 0:n.length){for(const p of n)l.deleteResults.push(j(p));this._queryEngine.featureStore.removeManyById(n)}const{fullExtent:u,timeExtent:f}=await this._queryEngine.fetchRecomputedExtents();return{extent:u,timeExtent:f,featureEditResults:l}}_applyAddEdits(e,i){const{addResults:a}=e,{geometryType:n,hasM:l,hasZ:u,objectIdField:f,spatialReference:p,featureStore:d,fieldsIndex:y}=this._queryEngine,c=[];for(const o of i){if(o.geometry&&n!==F(o.geometry)){a.push(g("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),r=_(y,t,o.attributes);if(r)a.push(r);else{if(this._assignObjectId(t,o.attributes),o.attributes=t,o.uid!=null){const m=o.attributes[f];e.uidToObjectId[o.uid]=m}if(o.geometry!=null){const m=o.geometry.spatialReference??p;o.geometry=T(w(o.geometry,m),m,p)}c.push(o),a.push(j(o.attributes[f]))}}d.addMany(O([],c,n,u,l,f))}_applyUpdateEdits({updateResults:e},i){const{geometryType:a,hasM:n,hasZ:l,objectIdField:u,spatialReference:f,featureStore:p,fieldsIndex:d}=this._queryEngine;for(const y of i){const{attributes:c,geometry:o}=y,t=c==null?void 0:c[u];if(t==null){e.push(g(`Identifier field ${u} missing`));continue}if(!p.has(t)){e.push(g(`Feature with object id ${t} missing`));continue}const r=k(p.getFeature(t),a,l,n);if(o!=null){if(a!==F(o)){e.push(g("Incorrect geometry type."));continue}const m=o.spatialReference??f;r.geometry=T(w(o,m),m,f)}if(c){const m=_(d,r.attributes,c);if(m){e.push(m);continue}}p.add(P(r,a,l,n,u)),e.push(j(t))}}_assignObjectId(e,i,a=!1){const n=this._queryEngine.objectIdField;a&&i&&isFinite(i[n])?e[n]=i[n]:e[n]=this._nextObjectId++}}export{Re as default}; +import{N as I,cC as Q,cD as Z,T as A,W as C,cF as F,cB as S,aa as v}from"./index-BjUNJPVf.js";import{e as O,n as k,t as P}from"./featureConversionUtils-BHhm7bvm.js";import{t as $,n as G}from"./objectIdUtils-4dd1rf9p.js";import{m as L}from"./FeatureStore-CRMzrhIt.js";import{x as E,j as T}from"./timeSupport-DXkhlToK.js";import{$ as W}from"./QueryEngine-loUu1VUW.js";import{i as z,o as B,a as N}from"./clientSideDefaults-BQP5n3lX.js";import{j as H,f as g,p as _,d as j,y as w}from"./sourceUtils-BNTaqxhX.js";import{Z as D}from"./FieldsIndex-CK-0B5n9.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./BoundsStore-DRDtG3Mk.js";import"./PooledRBush-BlFOlUgK.js";import"./json-Wa8cmqdu.js";import"./WhereClause-Ctld7DSu.js";import"./TimeOnly-BXSODLxA.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./QueryEngineCapabilities-CTDe3LlQ.js";import"./quantizationUtils-CfV316jZ.js";import"./utils-BKh1cxpi.js";import"./heatmapUtils-BSteZBTj.js";import"./utils-Bzmbfe7p.js";import"./utils-CY1ReiSd.js";import"./ClassBreaksDefinition-Djcxa8Lp.js";import"./RenderState-DaVlEYWY.js";import"./defaultsJSON-CHAaurhX.js";import"./date-M6n_RqpC.js";const U=S,J={xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:S},K={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!1,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0}};function V(h){return v(h)?h.z!=null:!!h.hasZ}function X(h){return v(h)?h.m!=null:!!h.hasM}class Re{constructor(){this._queryEngine=null,this._nextObjectId=null}destroy(){var e;(e=this._queryEngine)==null||e.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e){const i=[],{features:a}=e,n=this._inferLayerProperties(a,e.fields),l=e.fields||[],u=e.hasM!=null?e.hasM:!!n.hasM,f=e.hasZ!=null?e.hasZ:!!n.hasZ,p=!e.spatialReference&&!n.spatialReference,d=p?U:e.spatialReference||n.spatialReference,y=p?J:null,c=e.geometryType||n.geometryType,o=!c;let t=e.objectIdField||n.objectIdField,r=e.timeInfo;const m=new D(l);if(!o&&(p&&i.push({name:"feature-layer:spatial-reference-not-found",message:"Spatial reference not provided or found in features. Defaults to WGS84"}),!c))throw new I("feature-layer:missing-property","geometryType not set and couldn't be inferred from the provided features");if(!t)throw new I("feature-layer:missing-property","objectIdField not set and couldn't be found in the provided fields");if(n.objectIdField&&t!==n.objectIdField&&(i.push({name:"feature-layer:duplicated-oid-field",message:`Provided objectIdField "${t}" doesn't match the field name "${n.objectIdField}", found in the provided fields`}),t=n.objectIdField),t&&!n.objectIdField){const s=m.get(t);s?(t=s.name,s.type="esriFieldTypeOID",s.editable=!1,s.nullable=!1):l.unshift({alias:t,name:t,type:"esriFieldTypeOID",editable:!1,nullable:!1})}for(const s of l){if(s.name==null&&(s.name=s.alias),s.alias==null&&(s.alias=s.name),!s.name)throw new I("feature-layer:invalid-field-name","field name is missing",{field:s});if(s.name===t&&(s.type="esriFieldTypeOID"),!Q.jsonValues.includes(s.type))throw new I("feature-layer:invalid-field-type",`invalid type for field "${s.name}"`,{field:s});s.length==null&&(s.length=Z(s))}const b={};for(const s of l)if(s.type!=="esriFieldTypeOID"&&s.type!=="esriFieldTypeGlobalID"){const q=A(s);q!==void 0&&(b[s.name]=q)}if(r){if(r.startTimeField){const s=m.get(r.startTimeField);s?(r.startTimeField=s.name,s.type="esriFieldTypeDate"):r.startTimeField=null}if(r.endTimeField){const s=m.get(r.endTimeField);s?(r.endTimeField=s.name,s.type="esriFieldTypeDate"):r.endTimeField=null}if(r.trackIdField){const s=m.get(r.trackIdField);s?r.trackIdField=s.name:(r.trackIdField=null,i.push({name:"feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:r}}))}r.startTimeField||r.endTimeField||(i.push({name:"feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing or invalid",details:{timeInfo:r}}),r=null)}const x=m.dateFields.length?{timeZoneIANA:e.dateFieldsTimeZone??C}:null;this._createDefaultAttributes=z(b,t);const R={warnings:i,featureErrors:[],layerDefinition:{...K,drawingInfo:B(c),templates:N(b),extent:y,geometryType:c,objectIdField:t,fields:l,hasZ:f,hasM:u,timeInfo:r,dateFieldsTimeReference:x},assignedObjectIds:{}};if(this._queryEngine=new W({fieldsIndex:D.fromLayerJSON({fields:l,timeInfo:r,dateFieldsTimeReference:x}),geometryType:c,hasM:u,hasZ:f,objectIdField:t,spatialReference:d,featureStore:new L({geometryType:c,hasM:u,hasZ:f}),timeInfo:r,cacheSpatialQueries:!0}),!(a!=null&&a.length))return this._nextObjectId=$,R;const M=G(t,a);return this._nextObjectId=M+1,await E(a,d),this._loadInitialFeatures(R,a)}async applyEdits(e){const{spatialReference:i,geometryType:a}=this._queryEngine;return await Promise.all([H(i,a),E(e.adds,i),E(e.updates,i)]),this._applyEdits(e)}queryFeatures(e,i={}){return this._queryEngine.executeQuery(e,i.signal)}queryFeatureCount(e,i={}){return this._queryEngine.executeQueryForCount(e,i.signal)}queryObjectIds(e,i={}){return this._queryEngine.executeQueryForIds(e,i.signal)}queryExtent(e,i={}){return this._queryEngine.executeQueryForExtent(e,i.signal)}querySnapping(e,i={}){return this._queryEngine.executeQueryForSnapping(e,i.signal)}_inferLayerProperties(e,i){let a,n,l=null,u=null,f=null;for(const p of e){const d=p.geometry;if(d!=null&&(l||(l=F(d)),u||(u=d.spatialReference),a==null&&(a=V(d)),n==null&&(n=X(d)),l&&u&&a!=null&&n!=null))break}if(i&&i.length){let p=null;i.some(d=>{const y=d.type==="esriFieldTypeOID",c=!d.type&&d.name&&d.name.toLowerCase()==="objectid";return p=d,y||c})&&(f=p.name)}return{geometryType:l,spatialReference:u,objectIdField:f,hasM:n,hasZ:a}}async _loadInitialFeatures(e,i){const{geometryType:a,hasM:n,hasZ:l,objectIdField:u,spatialReference:f,featureStore:p,fieldsIndex:d}=this._queryEngine,y=[];for(const t of i){if(t.uid!=null&&(e.assignedObjectIds[t.uid]=-1),t.geometry&&a!==F(t.geometry)){e.featureErrors.push(g("Incorrect geometry type."));continue}const r=this._createDefaultAttributes(),m=_(d,r,t.attributes,!0);m?e.featureErrors.push(m):(this._assignObjectId(r,t.attributes,!0),t.attributes=r,t.uid!=null&&(e.assignedObjectIds[t.uid]=t.attributes[u]),t.geometry!=null&&(t.geometry=T(t.geometry,t.geometry.spatialReference,f)),y.push(t))}p.addMany(O([],y,a,l,n,u));const{fullExtent:c,timeExtent:o}=await this._queryEngine.fetchRecomputedExtents();if(e.layerDefinition.extent=c,o){const{start:t,end:r}=o;e.layerDefinition.timeInfo.timeExtent=[t,r]}return e}async _applyEdits(e){const{adds:i,updates:a,deletes:n}=e,l={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(i!=null&&i.length&&this._applyAddEdits(l,i),a!=null&&a.length&&this._applyUpdateEdits(l,a),n==null?void 0:n.length){for(const p of n)l.deleteResults.push(j(p));this._queryEngine.featureStore.removeManyById(n)}const{fullExtent:u,timeExtent:f}=await this._queryEngine.fetchRecomputedExtents();return{extent:u,timeExtent:f,featureEditResults:l}}_applyAddEdits(e,i){const{addResults:a}=e,{geometryType:n,hasM:l,hasZ:u,objectIdField:f,spatialReference:p,featureStore:d,fieldsIndex:y}=this._queryEngine,c=[];for(const o of i){if(o.geometry&&n!==F(o.geometry)){a.push(g("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),r=_(y,t,o.attributes);if(r)a.push(r);else{if(this._assignObjectId(t,o.attributes),o.attributes=t,o.uid!=null){const m=o.attributes[f];e.uidToObjectId[o.uid]=m}if(o.geometry!=null){const m=o.geometry.spatialReference??p;o.geometry=T(w(o.geometry,m),m,p)}c.push(o),a.push(j(o.attributes[f]))}}d.addMany(O([],c,n,u,l,f))}_applyUpdateEdits({updateResults:e},i){const{geometryType:a,hasM:n,hasZ:l,objectIdField:u,spatialReference:f,featureStore:p,fieldsIndex:d}=this._queryEngine;for(const y of i){const{attributes:c,geometry:o}=y,t=c==null?void 0:c[u];if(t==null){e.push(g(`Identifier field ${u} missing`));continue}if(!p.has(t)){e.push(g(`Feature with object id ${t} missing`));continue}const r=k(p.getFeature(t),a,l,n);if(o!=null){if(a!==F(o)){e.push(g("Incorrect geometry type."));continue}const m=o.spatialReference??f;r.geometry=T(w(o,m),m,f)}if(c){const m=_(d,r.attributes,c);if(m){e.push(m);continue}}p.add(P(r,a,l,n,u)),e.push(j(t))}}_assignObjectId(e,i,a=!1){const n=this._queryEngine.objectIdField;a&&i&&isFinite(i[n])?e[n]=i[n]:e[n]=this._nextObjectId++}}export{Re as default}; diff --git a/assets/Mesh-9oOqPmbT.js b/assets/Mesh--rTzs1p1.js similarity index 95% rename from assets/Mesh-9oOqPmbT.js rename to assets/Mesh--rTzs1p1.js index 67bc695..fa8cbb3 100644 --- a/assets/Mesh-9oOqPmbT.js +++ b/assets/Mesh--rTzs1p1.js @@ -1,7 +1,7 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/loadGLTFMesh-CbP8-zjv.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css","assets/mat3f64-q3fE-ZOt.js","assets/BufferView-Ao_K-5Vg.js","assets/vec3-CjYmIfaa.js","assets/DefaultMaterial_COLOR_GAMMA-CWI-ZW7Q.js","assets/mat4f64-CSKppSlJ.js","assets/Version-Bd0QsIQ5.js","assets/quat-CoKEr4Zu.js","assets/quatf64-Bdb9ZJJK.js","assets/resourceUtils-BqKyAr0B.js","assets/basicInterfaces-GbxEOYtk.js","assets/Indices-Dv-cCjFT.js","assets/types-D0PSWh4d.js","assets/georeference-DtjTZVKi.js","assets/computeTranslationToOriginAndRotation-DOOKw0d1.js","assets/DoubleArray-DxyNBrRi.js","assets/meshVertexSpaceUtils-BFWpJFSd.js","assets/MeshLocalVertexSpace-Cltwu1Kq.js","assets/imageUtils-DNanu5Rn.js","assets/earcut-hRlx3adE.js","assets/deduplicate-Bk22TunD.js","assets/plane-py4f_JCU.js","assets/triangle-CU37cZF1.js","assets/Util-BS8sJGjF.js","assets/ObjectStack-CF0cQvd2.js","assets/lineSegment-B9UF3nEF.js","assets/VertexAttribute-BlT9lbVY.js","assets/External-DC51KyR4.js","assets/infoFor3D-DsOdlPuA.js","assets/gltfexport-D_QduVJ6.js"] + __vite__mapDeps.viteFileDeps = ["assets/loadGLTFMesh-DdWfwp7n.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css","assets/mat3f64-q3fE-ZOt.js","assets/BufferView-3om6S_aJ.js","assets/vec3-DdRUbala.js","assets/DefaultMaterial_COLOR_GAMMA-BQtlD4-o.js","assets/mat4f64-CSKppSlJ.js","assets/Version-Dqq_CHBG.js","assets/quat-C0wQB0HB.js","assets/quatf64-Bdb9ZJJK.js","assets/resourceUtils-BHmy1O5x.js","assets/basicInterfaces-GbxEOYtk.js","assets/Indices-BRm9v2lM.js","assets/types-D0PSWh4d.js","assets/georeference-DqFdARS7.js","assets/computeTranslationToOriginAndRotation-BeE3rOSz.js","assets/DoubleArray--0pYeNcV.js","assets/meshVertexSpaceUtils-DwMoblqo.js","assets/MeshLocalVertexSpace-DRvwbFTJ.js","assets/imageUtils-ChIDAvDr.js","assets/earcut-CWKXDqDj.js","assets/deduplicate-BR6i8Xk0.js","assets/plane-DxOTtTwj.js","assets/triangle-DmKBscqo.js","assets/Util-CS5u4Lec.js","assets/ObjectStack-BAIuPeIh.js","assets/lineSegment-BYtydnRZ.js","assets/VertexAttribute-BlT9lbVY.js","assets/External-DIoD7Bb4.js","assets/infoFor3D-DsOdlPuA.js","assets/gltfexport-BTAOUMHO.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{bw as Pt,e3 as Ut,kG as Wt,cy as S,d as u,y as f,fz as zt,aR as Vt,aZ as Ht,f as U,aU as ce,dD as Oe,er as Se,b4 as Bt,a9 as et,e1 as W,s as T,aV as F,N as ie,gz as Gt,gV as L,bo as Yt,bk as Xt,fg as me,kH as $e,kI as Zt,bF as qt,kJ as Kt,aE as tt,cU as nt,cX as Qt,fy as rt,_ as Re,at as Le,aA as N,d6 as Jt,kK as en,ke as tn,ib as nn,jj as rn,hO as on,V as sn,z as an,fh as je,cx as ln,hA as cn,e2 as ot,kL as st,gi as un,gB as we,hL as it,kM as at,hI as lt,kN as ct,kO as ut,hC as pn,gU as hn,cW as fn,fw as mn,hk as gn,g as dn,cz as be,aB as yn,kP as xn,et as wn}from"./index-CEWggaxV.js";import{G as vn,c as De,Q as $n,I as bn,V as Tn,_ as An,b as pt,d as ae,A as ht,y as ge,k as ft,a as mt,j as gt,h as dt,E as yt,e as xt,f as wt,w as Sn}from"./georeference-DtjTZVKi.js";import{c as Rn}from"./imageUtils-DNanu5Rn.js";import{i as _e,a as jn}from"./MeshLocalVertexSpace-Cltwu1Kq.js";import{g as de,p as vt,u as Pe,h as Ue,l as We}from"./meshVertexSpaceUtils-BFWpJFSd.js";import{i as _n}from"./earcut-hRlx3adE.js";import{a as In,e as Mn,t as $t}from"./DoubleArray-DxyNBrRi.js";import{t as bt}from"./Indices-Dv-cCjFT.js";import{e as ze}from"./deduplicate-Bk22TunD.js";import{E as Fn,F as Ln,X as Dn}from"./plane-py4f_JCU.js";import"./triangle-CU37cZF1.js";import{e as ve}from"./mat4f64-CSKppSlJ.js";import"./basicInterfaces-GbxEOYtk.js";import"./VertexAttribute-BlT9lbVY.js";import{u as Ve,y as Cn,h as kn}from"./External-DC51KyR4.js";import{e as Tt}from"./mat3f64-q3fE-ZOt.js";import{I as En}from"./quat-CoKEr4Zu.js";import{e as Nn,o as On}from"./quatf64-Bdb9ZJJK.js";import{a as Ce,R as At}from"./computeTranslationToOriginAndRotation-DOOKw0d1.js";function I(e,t,n,r){if(Pt(e.spatialReference,n)){ue[0]=e.x,ue[1]=e.y;const s=e.z;return ue[2]=s??r??0,Ut(ue,e.spatialReference,0,t,n,0,1)}const o=Wt(e,n);return!!o&&(t[0]=o==null?void 0:o.x,t[1]=o==null?void 0:o.y,t[2]=(o==null?void 0:o.z)??r??0,!0)}const ue=S();var G;const Te=new WeakMap;let Pn=0,k=G=class extends ce{constructor(e){super(e),this.wrap="repeat"}get url(){return this._get("url")||null}set url(e){this._set("url",e),e&&this._set("data",null)}get data(){return this._get("data")||null}set data(e){this._set("data",e),e&&this._set("url",null)}writeData(e,t,n,r){if(e instanceof HTMLImageElement){const o={type:"image-element",src:Oe(e.src,r),crossOrigin:e.crossOrigin};t[n]=o}else if(e instanceof HTMLCanvasElement){const o=e.getContext("2d").getImageData(0,0,e.width,e.height),s={type:"canvas-element",imageData:this._encodeImageData(o)};t[n]=s}else if(e instanceof HTMLVideoElement){const o={type:"video-element",src:Oe(e.src,r),autoplay:e.autoplay,loop:e.loop,muted:e.muted,crossOrigin:e.crossOrigin,preload:e.preload};t[n]=o}else if(e instanceof ImageData){const o={type:"image-data",imageData:this._encodeImageData(e)};t[n]=o}}readData(e){switch(e.type){case"image-element":{const t=new Image;return t.src=e.src,t.crossOrigin=e.crossOrigin,t}case"canvas-element":{const t=this._decodeImageData(e.imageData),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,n.getContext("2d").putImageData(t,0,0),n}case"image-data":return this._decodeImageData(e.imageData);case"video-element":{const t=document.createElement("video");return t.src=e.src,t.crossOrigin=e.crossOrigin,t.autoplay=e.autoplay,t.loop=e.loop,t.muted=e.muted,t.preload=e.preload,t}default:return}}get transparent(){const e=this.data,t=this.url;if(e instanceof HTMLCanvasElement)return this._imageDataContainsTransparent(e.getContext("2d").getImageData(0,0,e.width,e.height));if(e instanceof ImageData)return this._imageDataContainsTransparent(e);if(t){const n=t.substr(t.length-4,4).toLowerCase(),r=t.substr(0,15).toLocaleLowerCase();if(n===".png"||r==="data:image/png;")return!0}return!1}set transparent(e){this._overrideIfSome("transparent",e)}get contentHash(){const e=typeof this.wrap=="string"?this.wrap:typeof this.wrap=="object"?`${this.wrap.horizontal}/${this.wrap.vertical}`:"",t=(n="")=>`d:${n},t:${this.transparent},w:${e}`;return this.url!=null?t(this.url):this.data!=null?this.data instanceof HTMLImageElement||this.data instanceof HTMLVideoElement?t(this.data.src):(Te.has(this.data)||Te.set(this.data,++Pn),t(Te.get(this.data))):t()}get memoryUsage(){let e=0;if(e+=this.url!=null?this.url.length:0,this.data!=null){const t=this.data;"data"in t?e+=t.data.byteLength:t instanceof HTMLImageElement?e+=t.naturalWidth*t.naturalHeight*3:t instanceof HTMLCanvasElement&&(e+=t.width*t.height*3)}return e}clone(){const e={url:this.url,data:this.data,wrap:this._cloneWrap()};return new G(e)}cloneWithDeduplication(e){const t=e.get(this);if(t)return t;const n=this.clone();return e.set(this,n),n}_cloneWrap(){return typeof this.wrap=="string"?this.wrap:{horizontal:this.wrap.horizontal,vertical:this.wrap.vertical}}_encodeImageData(e){let t="";for(let n=0;n!Array.isArray(i[0]))(t)?(i,a)=>t[3*i+a]:(i,a)=>t[i][a],s=r?Yt(r)/Xt(r):1;return Dn(e,(i,a)=>me(i,o(a,0)*s,o(a,1)*s,o(a,2)),n)}function Gn(e,t,n){const r=Bn(Be,e,t,n)?Ln(Be):[0,0,1];return Math.abs(r[2])>Math.cos(Gt(80))?L.Z:Math.abs(r[1])>Math.abs(r[0])?L.Y:L.X}const Be=Fn();function Yn(e){const t=Zn(e.rings,e.hasZ,ye.CCW_IS_HOLE,e.spatialReference),n=new Array;let r=0,o=0;for(const a of t.polygons){const c=a.count,l=a.index,p=In(t.position,3*l,3*c),g=a.holeIndices.map(h=>h-l),m=bt(_n(p,g,3));n.push({position:p,faces:m}),r+=p.length,o+=m.length}const s=Xn(n,r,o),i=Array.isArray(s.position)?ze(s.position,3,{originalIndices:s.faces}):ze(s.position.buffer,6,{originalIndices:s.faces});return s.position=Mn(new Float64Array(i.buffer)),s.faces=i.indices,s}function Xn(e,t,n){if(e.length===1)return e[0];const r=$t(t),o=new Array(n);let s=0,i=0,a=0;for(const c of e){for(let l=0;l=0;d--){const y=e[d],A=n===ye.CCW_IS_HOLE&&qn(y,t,r);if(A&&o!==1)s[c++]=y;else{let D=y.length;for(let x=0;x0&&(a[p++]={index:h,count:y.length}),h=A?pe(y,y.length-1,-1,m,h,y.length,t):pe(y,0,1,m,h,y.length,t);for(let x=0;x0&&(a[p++]={index:h,count:R.length}),h=pe(R,0,1,m,h,R.length,t)}c=0,v.count>0&&(i[l++]=v)}}for(let d=0;d0&&(a[p++]={index:h,count:y.length}),h=pe(y,0,1,m,h,y.length,t)}return i.length=l,a.length=p,{position:m,polygons:i,outlines:a}}function pe(e,t,n,r,o,s,i){o*=3;for(let a=0;aimport("./loadGLTFMesh-CbP8-zjv.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30])),n),s=await ir(r,n);Le(n);const i=o(new N({x:0,y:0,z:0,spatialReference:e.spatialReference}),s.url,{resolveFile:sr(s),signal:n==null?void 0:n.signal,expectedType:s.type});i.then(()=>s.dispose(),()=>s.dispose());const{vertexAttributes:a,components:c}=await i;e.vertexAttributes=a,e.components=c}function sr(e){const t=Jt(e.url);return n=>{const r=en(n,t,t),o=r?r.replace(/^ *\.\//,""):null;return(o?e.files.get(o):null)??n}}async function ir(e,t){if(Array.isArray(e)){if(!e.length)throw new ie("mesh-load-external:missing-assets","There must be at least one file to load");return e[0]instanceof File?lr(e):cr(e,t)}return It(e)}async function ar(e,t){const{parts:n,assetMimeType:r,assetName:o}=e;if(n.length===1)return new J(n[0].partUrl);const s=await e.toBlob(t);return Le(t),J.fromBlob(s,Dt(o,r))}function It(e){return J.fromBlob(e,Dt(e.name,e.type))}function lr(e){return Lt(e.map(t=>({name:t.name,mimeType:t.type,source:It(t)})))}async function cr(e,t){const n=await tn(e.map(async r=>{const o=await ar(r);return Le(t),{name:r.assetName,mimeType:r.assetMimeType,source:o}}));if(nn(t))throw n.forEach(r=>r.source.dispose()),rn();return Lt(n)}const Mt=/^model\/gltf\+json$/,Ft=/^model\/gltf-binary$/,Fe=/\.gltf$/i,ur=/\.glb$/i;function Lt(e){const t=new Map;let n,r=null;for(const{name:o,mimeType:s,source:i}of e)r===null&&(Mt.test(s)||Fe.test(o)?(r=i.url,n="gltf"):(Ft.test(s)||ur.test(o))&&(r=i.url,n="glb")),t.set(o,i.url),i.files.forEach((a,c)=>t.set(c,a));if(r==null)throw new ie("mesh-load-external:missing-files","Missing files to load external mesh source");return new J(r,()=>e.forEach(({source:o})=>o.dispose()),t,n)}class J{constructor(t,n=()=>{},r=new Map,o){this.url=t,this.dispose=n,this.files=r,this.type=o}static fromBlob(t,n){const r=URL.createObjectURL(t);return new J(r,()=>URL.revokeObjectURL(r),void 0,n)}}function Dt(e,t){return Mt.test(t)||Fe.test(e)?"gltf":Ft.test(t)||Fe.test(e)?"glb":void 0}let P=class extends on{constructor(){super(),this.externalSources=new sn,this._explicitDisplaySource=null,this.addHandles(an(()=>this.externalSources,"after-remove",({item:e})=>{e===this._explicitDisplaySource&&(this._explicitDisplaySource=null)},{sync:!0,onListenerRemove:()=>this._explicitDisplaySource=null}))}get displaySource(){return this._explicitDisplaySource??this._implicitDisplaySource}set displaySource(e){if(e!=null&&!Ve(e))throw new Error("Cannot use this source for display: it is not in a supported format.");this._explicitDisplaySource=e,e&&this.externalSources.every(t=>!Cn(t,e))&&this.externalSources.add(e)}clearSources(){this.externalSources.removeAll()}getExternalSourcesOnService(e){return this.externalSources.items.filter(t=>kn(t,e))}get _implicitDisplaySource(){return this.externalSources.find(Ve)}};u([f()],P.prototype,"externalSources",void 0),u([f()],P.prototype,"displaySource",null),u([f()],P.prototype,"_implicitDisplaySource",null),u([f()],P.prototype,"_explicitDisplaySource",void 0),P=u([U("esri.geometry.support.meshUtils.Metadata")],P);function pr(){const{faceDescriptions:e,faceVertexOffsets:t,uvScales:n}=vr,r=4*e.length,o=new Float64Array(3*r),s=new Float32Array(3*r),i=new Float32Array(2*r),a=new Uint32Array(2*e.length*3);let c=0,l=0,p=0,g=0;for(let m=0;m=s&&p=4,A=h===2||h===4,D=d?n-1:n;for(let v=0;v<=D;v++){const x=v/D*2*Math.PI,R=d?0:.5;w[0]=R*Math.sin(x),w[1]=R*-Math.cos(x),w[2]=h<=2?.5:-.5;for(let z=0;z<3;z++)o[c++]=w[z],s[l++]=y?z===2?h<=1?1:-1:0:z===2?0:w[z]/R;i[p++]=(v+(d?.5:0))/n,i[p++]=h<=1?1*h/3:h<=3?1*(h-2)/3+1/3:1*(h-4)/3+2/3,A||h===0||v===n||(h!==5&&(a[g++]=m,a[g++]=m+1,a[g++]=m-n),h!==1&&(a[g++]=m,a[g++]=m-n,a[g++]=m-n-1)),m++}}return{position:o,normal:s,uv:i,faces:a}}function gr(e,t){const n=typeof t=="number"?t:t!=null?t.width:1,r=typeof t=="number"?t:t!=null?t.height:1;switch(e){case"up":case"down":return{width:n,depth:r};case"north":case"south":return{width:n,height:r};case"east":case"west":return{depth:n,height:r}}}function dr(e){const t=te.facingAxisOrderSwap[e],n=te.position,r=te.normal,o=new Float64Array(n.length),s=new Float32Array(r.length);let i=0;for(let a=0;a<4;a++){const c=i;for(let l=0;l<3;l++){const p=t[l],g=Math.abs(p)-1,m=p>=0?1:-1;o[i]=n[c+g]*m,s[i]=r[c+g]*m,i++}}return{position:o,normal:s,uv:new Float32Array(te.uv),faces:new Uint32Array(te.faces),isPlane:!0}}const V=1,H=2,B=3,te={position:[-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0],normal:[0,0,1,0,0,1,0,0,1,0,0,1],uv:[0,1,1,1,1,0,0,0],faces:[0,1,2,0,2,3],facingAxisOrderSwap:{east:[B,V,H],west:[-B,-V,H],north:[-V,B,H],south:[V,-B,H],up:[V,H,B],down:[V,-H,-B]}};function he(e,t,n){e.isPlane||yr(e),wr(e,xr(n==null?void 0:n.size,n==null?void 0:n.unit,t.spatialReference));const{vertexAttributes:r,vertexSpace:o,transform:s}=Tn(e,t,{vertexSpace:n==null?void 0:n.vertexSpace,geographic:n==null?void 0:n.geographic});return{vertexAttributes:new b({...r,uv:e.uv}),vertexSpace:o,transform:s,components:[new Q({faces:e.faces,material:(n==null?void 0:n.material)||null})],spatialReference:t.spatialReference}}function yr(e){for(let t=0;t{this.addHandles(dn(()=>{var e;return{vertexAttributes:this.vertexAttributes,components:(e=this.components)==null?void 0:e.map(t=>t.clone())}},()=>this._clearSources(),{once:!0,sync:!0}))})}get hasExtent(){var e;return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):((e=this.metadata.displaySource)==null?void 0:e.extent)!=null}get _transformedExtent(){const{components:e,spatialReference:t,vertexAttributes:n,vertexSpace:r}=this,o=n.position;if(o.length===0||e&&e.length===0)return new tt({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0,spatialReference:t});if(de(r)){const{_untransformedBounds:s,transform:i}=this;return Kn(s,i,r,t)}return Rt(o,t)}get _untransformedBounds(){return St(this.vertexAttributes.position)}get anchor(){const e=Pe(this.vertexSpace,this.spatialReference);if(e!=null)return e;const{center:t,zmin:n}=this._transformedExtent;return new N({x:t.x,y:t.y,z:n,spatialReference:this.spatialReference})}get origin(){const e=Pe(this.vertexSpace,this.spatialReference);return e??this._transformedExtent.center}get extent(){var e,t;return this.loaded||((t=(e=this.metadata)==null?void 0:e.displaySource)==null?void 0:t.extent)==null?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(e){this._checkIfLoaded("addComponent()")&&(this.components||(this.components=[]),this.components.push(Q.from(e)),this.notifyChange("components"))}removeComponent(e){if(this._checkIfLoaded("removeComponent()")){if(this.components){const t=this.components.indexOf(e);if(t!==-1)return this.components.splice(t,1),void this.notifyChange("components")}C().error("removeComponent()",Vn)}}rotate(e,t,n,r){return Sn(e,t,n,Je),br(this,Je,r),this}offset(e,t,n){if(!this._checkIfLoaded("offset()"))return this;const{vertexSpace:r,vertexAttributes:o}=this,s=o==null?void 0:o.position;if(!s)return this;if(de(r)){const[i,a,c]=r.origin;r.origin=be(i+e,a+t,c+n)}else{for(let i=0;ii.cloneWithDeduplication(o,s))}const n={components:t,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes.clone(),vertexSpace:e,transform:((r=this.transform)==null?void 0:r.clone())??null,metadata:this.metadata.clone()};return new _(n)}cloneShallow(){return new _({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const t=Re(()=>import("./gltfexport-D_QduVJ6.js"),__vite__mapDeps([31,1,2,7,9,3,10,19,15,16,17,18,5,4,11,12,20,21,13,22,23,24,25,26,27,28,29,30])),n=this.load(),r=await Promise.all([t,n]),{toBinaryGLTF:o}=r[0];return o(this,e)}get memoryUsage(){let e=0;if(e+=this.vertexAttributes.memoryUsage,this.components!=null)for(const t of this.components)e+=t.memoryUsage;return e}_clearSources(){this.metadata.clearSources()}_checkIfLoaded(e){return!!this.loaded||(C().error(e,zn),!1)}static createBox(e,t){if(!(e instanceof N))return C().error(".createBox()",re),null;const n=new _(he(pr(),e,t));return t!=null&&t.imageFace&&t.imageFace!=="all"?hr(n,t.imageFace):n}static createSphere(e,t){return e instanceof N?new _(he(fr((t==null?void 0:t.densificationFactor)||0),e,t)):(C().error(".createSphere()",re),null)}static createCylinder(e,t){return e instanceof N?new _(he(mr((t==null?void 0:t.densificationFactor)||0),e,t)):(C().error(".createCylinder()",re),null)}static createPlane(e,t){if(!(e instanceof N))return C().error(".createPlane()",re),null;const n=(t==null?void 0:t.facing)??"up",r=gr(n,t==null?void 0:t.size);return new _(he(dr(n),e,{...t,size:r}))}static createFromPolygon(e,t){if(!(e instanceof yn))return C().error(".createFromPolygon()",Hn),null;const n=Yn(e);return new _({vertexAttributes:new b({position:n.position}),components:[new Q({faces:n.faces,shading:"flat",material:(t==null?void 0:t.material)??null})],spatialReference:e.spatialReference,vertexSpace:new _e})}static async createFromGLTF(e,t,n){if(!(e instanceof N)){const o=new He;throw C().error(".createfromGLTF()",o.message),o}const{loadGLTFMesh:r}=await rt(Re(()=>import("./loadGLTFMesh-CbP8-zjv.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30])),n);return new _(await r(e,t,n))}static async createFromFiles(e,t,n){xn(C(),"`Mesh.createFromFiles` is deprecated in favor of 'SceneLayer.convertMesh'",{replacement:"SceneLayer.convertMesh",version:"4.29"});const r=o=>C().error(".createFromFiles()",o.message);if(!(e instanceof N)){const o=new He;throw r(o),o}if(!(n!=null&&n.layer))throw new ie("invalid:no-layer","SceneLayer required for file to mesh conversion.");return n.layer.convertMesh(t,{location:e,...n})}static createWithExternalSource(e,t,n){var h;const r=(n==null?void 0:n.extent)??null,{x:o,y:s,z:i,spatialReference:a}=e,c=((h=n==null?void 0:n.transform)==null?void 0:h.clone())??new ae,l=be(o,s,i??0),p=Ue((n==null?void 0:n.vertexSpace)??We(a),l),g={source:t,extent:r},m=new P;return m.externalSources.push(g),new _({metadata:m,transform:c,vertexSpace:p,spatialReference:a})}static createIncomplete(e,t){var p;const{x:n,y:r,z:o,spatialReference:s}=e,i=((p=t==null?void 0:t.transform)==null?void 0:p.clone())??new ae,a=be(n,r,o??0),c=Ue((t==null?void 0:t.vertexSpace)??We(s),a),l=new _({transform:i,vertexSpace:c,spatialReference:s});return l.addResolvingPromise(Promise.reject(new ie("mesh-incomplete","Mesh resources are not complete"))),l}};u([f({type:[Q],json:{write:!0}})],$.prototype,"components",void 0),u([f({nonNullable:!0,types:Fr,constructOnly:!0,json:{write:!0}})],$.prototype,"vertexSpace",void 0),u([f({type:ae,json:{write:!0}})],$.prototype,"transform",void 0),u([f({constructOnly:!0})],$.prototype,"metadata",void 0),u([f()],$.prototype,"hasExtent",null),u([f()],$.prototype,"_transformedExtent",null),u([f()],$.prototype,"_untransformedBounds",null),u([f()],$.prototype,"anchor",null),u([f()],$.prototype,"origin",null),u([f({readOnly:!0,json:{read:!1}})],$.prototype,"extent",null),u([f({readOnly:!0,json:{read:!1,write:!0,default:!0}})],$.prototype,"hasZ",void 0),u([f({readOnly:!0,json:{read:!1,write:!0,default:!1}})],$.prototype,"hasM",void 0),u([f({type:b,nonNullable:!0,json:{write:!0}})],$.prototype,"vertexAttributes",void 0),$=_=u([U(Ot)],$);const Je=pt(),Jr=$;export{Jr as $,Un as a,se as c,Q as h,b as l,oe as m}; +import{bw as Pt,e3 as Ut,kG as Wt,cy as S,d as u,y as f,fz as zt,aR as Vt,aZ as Ht,f as U,aU as ce,dD as Oe,er as Se,b4 as Bt,a9 as et,e1 as W,s as T,aV as F,N as ie,gz as Gt,gV as L,bo as Yt,bk as Xt,fg as me,kH as $e,kI as Zt,bF as qt,kJ as Kt,aE as tt,cU as nt,cX as Qt,fy as rt,_ as Re,at as Le,aA as N,d6 as Jt,kK as en,ke as tn,ib as nn,jj as rn,hO as on,V as sn,z as an,fh as je,cx as ln,hA as cn,e2 as ot,kL as st,gi as un,gB as we,hL as it,kM as at,hI as lt,kN as ct,kO as ut,hC as pn,gU as hn,cW as fn,fw as mn,hk as gn,g as dn,cz as be,aB as yn,kP as xn,et as wn}from"./index-BjUNJPVf.js";import{G as vn,c as De,Q as $n,I as bn,V as Tn,_ as An,b as pt,d as ae,A as ht,y as ge,k as ft,a as mt,j as gt,h as dt,E as yt,e as xt,f as wt,w as Sn}from"./georeference-DqFdARS7.js";import{c as Rn}from"./imageUtils-ChIDAvDr.js";import{i as _e,a as jn}from"./MeshLocalVertexSpace-DRvwbFTJ.js";import{g as de,p as vt,u as Pe,h as Ue,l as We}from"./meshVertexSpaceUtils-DwMoblqo.js";import{i as _n}from"./earcut-CWKXDqDj.js";import{a as In,e as Mn,t as $t}from"./DoubleArray--0pYeNcV.js";import{t as bt}from"./Indices-BRm9v2lM.js";import{e as ze}from"./deduplicate-BR6i8Xk0.js";import{E as Fn,F as Ln,X as Dn}from"./plane-DxOTtTwj.js";import"./triangle-DmKBscqo.js";import{e as ve}from"./mat4f64-CSKppSlJ.js";import"./basicInterfaces-GbxEOYtk.js";import"./VertexAttribute-BlT9lbVY.js";import{u as Ve,y as Cn,h as kn}from"./External-DIoD7Bb4.js";import{e as Tt}from"./mat3f64-q3fE-ZOt.js";import{I as En}from"./quat-C0wQB0HB.js";import{e as Nn,o as On}from"./quatf64-Bdb9ZJJK.js";import{a as Ce,R as At}from"./computeTranslationToOriginAndRotation-BeE3rOSz.js";function I(e,t,n,r){if(Pt(e.spatialReference,n)){ue[0]=e.x,ue[1]=e.y;const s=e.z;return ue[2]=s??r??0,Ut(ue,e.spatialReference,0,t,n,0,1)}const o=Wt(e,n);return!!o&&(t[0]=o==null?void 0:o.x,t[1]=o==null?void 0:o.y,t[2]=(o==null?void 0:o.z)??r??0,!0)}const ue=S();var G;const Te=new WeakMap;let Pn=0,k=G=class extends ce{constructor(e){super(e),this.wrap="repeat"}get url(){return this._get("url")||null}set url(e){this._set("url",e),e&&this._set("data",null)}get data(){return this._get("data")||null}set data(e){this._set("data",e),e&&this._set("url",null)}writeData(e,t,n,r){if(e instanceof HTMLImageElement){const o={type:"image-element",src:Oe(e.src,r),crossOrigin:e.crossOrigin};t[n]=o}else if(e instanceof HTMLCanvasElement){const o=e.getContext("2d").getImageData(0,0,e.width,e.height),s={type:"canvas-element",imageData:this._encodeImageData(o)};t[n]=s}else if(e instanceof HTMLVideoElement){const o={type:"video-element",src:Oe(e.src,r),autoplay:e.autoplay,loop:e.loop,muted:e.muted,crossOrigin:e.crossOrigin,preload:e.preload};t[n]=o}else if(e instanceof ImageData){const o={type:"image-data",imageData:this._encodeImageData(e)};t[n]=o}}readData(e){switch(e.type){case"image-element":{const t=new Image;return t.src=e.src,t.crossOrigin=e.crossOrigin,t}case"canvas-element":{const t=this._decodeImageData(e.imageData),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,n.getContext("2d").putImageData(t,0,0),n}case"image-data":return this._decodeImageData(e.imageData);case"video-element":{const t=document.createElement("video");return t.src=e.src,t.crossOrigin=e.crossOrigin,t.autoplay=e.autoplay,t.loop=e.loop,t.muted=e.muted,t.preload=e.preload,t}default:return}}get transparent(){const e=this.data,t=this.url;if(e instanceof HTMLCanvasElement)return this._imageDataContainsTransparent(e.getContext("2d").getImageData(0,0,e.width,e.height));if(e instanceof ImageData)return this._imageDataContainsTransparent(e);if(t){const n=t.substr(t.length-4,4).toLowerCase(),r=t.substr(0,15).toLocaleLowerCase();if(n===".png"||r==="data:image/png;")return!0}return!1}set transparent(e){this._overrideIfSome("transparent",e)}get contentHash(){const e=typeof this.wrap=="string"?this.wrap:typeof this.wrap=="object"?`${this.wrap.horizontal}/${this.wrap.vertical}`:"",t=(n="")=>`d:${n},t:${this.transparent},w:${e}`;return this.url!=null?t(this.url):this.data!=null?this.data instanceof HTMLImageElement||this.data instanceof HTMLVideoElement?t(this.data.src):(Te.has(this.data)||Te.set(this.data,++Pn),t(Te.get(this.data))):t()}get memoryUsage(){let e=0;if(e+=this.url!=null?this.url.length:0,this.data!=null){const t=this.data;"data"in t?e+=t.data.byteLength:t instanceof HTMLImageElement?e+=t.naturalWidth*t.naturalHeight*3:t instanceof HTMLCanvasElement&&(e+=t.width*t.height*3)}return e}clone(){const e={url:this.url,data:this.data,wrap:this._cloneWrap()};return new G(e)}cloneWithDeduplication(e){const t=e.get(this);if(t)return t;const n=this.clone();return e.set(this,n),n}_cloneWrap(){return typeof this.wrap=="string"?this.wrap:{horizontal:this.wrap.horizontal,vertical:this.wrap.vertical}}_encodeImageData(e){let t="";for(let n=0;n!Array.isArray(i[0]))(t)?(i,a)=>t[3*i+a]:(i,a)=>t[i][a],s=r?Yt(r)/Xt(r):1;return Dn(e,(i,a)=>me(i,o(a,0)*s,o(a,1)*s,o(a,2)),n)}function Gn(e,t,n){const r=Bn(Be,e,t,n)?Ln(Be):[0,0,1];return Math.abs(r[2])>Math.cos(Gt(80))?L.Z:Math.abs(r[1])>Math.abs(r[0])?L.Y:L.X}const Be=Fn();function Yn(e){const t=Zn(e.rings,e.hasZ,ye.CCW_IS_HOLE,e.spatialReference),n=new Array;let r=0,o=0;for(const a of t.polygons){const c=a.count,l=a.index,p=In(t.position,3*l,3*c),g=a.holeIndices.map(h=>h-l),m=bt(_n(p,g,3));n.push({position:p,faces:m}),r+=p.length,o+=m.length}const s=Xn(n,r,o),i=Array.isArray(s.position)?ze(s.position,3,{originalIndices:s.faces}):ze(s.position.buffer,6,{originalIndices:s.faces});return s.position=Mn(new Float64Array(i.buffer)),s.faces=i.indices,s}function Xn(e,t,n){if(e.length===1)return e[0];const r=$t(t),o=new Array(n);let s=0,i=0,a=0;for(const c of e){for(let l=0;l=0;d--){const y=e[d],A=n===ye.CCW_IS_HOLE&&qn(y,t,r);if(A&&o!==1)s[c++]=y;else{let D=y.length;for(let x=0;x0&&(a[p++]={index:h,count:y.length}),h=A?pe(y,y.length-1,-1,m,h,y.length,t):pe(y,0,1,m,h,y.length,t);for(let x=0;x0&&(a[p++]={index:h,count:R.length}),h=pe(R,0,1,m,h,R.length,t)}c=0,v.count>0&&(i[l++]=v)}}for(let d=0;d0&&(a[p++]={index:h,count:y.length}),h=pe(y,0,1,m,h,y.length,t)}return i.length=l,a.length=p,{position:m,polygons:i,outlines:a}}function pe(e,t,n,r,o,s,i){o*=3;for(let a=0;aimport("./loadGLTFMesh-DdWfwp7n.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30])),n),s=await ir(r,n);Le(n);const i=o(new N({x:0,y:0,z:0,spatialReference:e.spatialReference}),s.url,{resolveFile:sr(s),signal:n==null?void 0:n.signal,expectedType:s.type});i.then(()=>s.dispose(),()=>s.dispose());const{vertexAttributes:a,components:c}=await i;e.vertexAttributes=a,e.components=c}function sr(e){const t=Jt(e.url);return n=>{const r=en(n,t,t),o=r?r.replace(/^ *\.\//,""):null;return(o?e.files.get(o):null)??n}}async function ir(e,t){if(Array.isArray(e)){if(!e.length)throw new ie("mesh-load-external:missing-assets","There must be at least one file to load");return e[0]instanceof File?lr(e):cr(e,t)}return It(e)}async function ar(e,t){const{parts:n,assetMimeType:r,assetName:o}=e;if(n.length===1)return new J(n[0].partUrl);const s=await e.toBlob(t);return Le(t),J.fromBlob(s,Dt(o,r))}function It(e){return J.fromBlob(e,Dt(e.name,e.type))}function lr(e){return Lt(e.map(t=>({name:t.name,mimeType:t.type,source:It(t)})))}async function cr(e,t){const n=await tn(e.map(async r=>{const o=await ar(r);return Le(t),{name:r.assetName,mimeType:r.assetMimeType,source:o}}));if(nn(t))throw n.forEach(r=>r.source.dispose()),rn();return Lt(n)}const Mt=/^model\/gltf\+json$/,Ft=/^model\/gltf-binary$/,Fe=/\.gltf$/i,ur=/\.glb$/i;function Lt(e){const t=new Map;let n,r=null;for(const{name:o,mimeType:s,source:i}of e)r===null&&(Mt.test(s)||Fe.test(o)?(r=i.url,n="gltf"):(Ft.test(s)||ur.test(o))&&(r=i.url,n="glb")),t.set(o,i.url),i.files.forEach((a,c)=>t.set(c,a));if(r==null)throw new ie("mesh-load-external:missing-files","Missing files to load external mesh source");return new J(r,()=>e.forEach(({source:o})=>o.dispose()),t,n)}class J{constructor(t,n=()=>{},r=new Map,o){this.url=t,this.dispose=n,this.files=r,this.type=o}static fromBlob(t,n){const r=URL.createObjectURL(t);return new J(r,()=>URL.revokeObjectURL(r),void 0,n)}}function Dt(e,t){return Mt.test(t)||Fe.test(e)?"gltf":Ft.test(t)||Fe.test(e)?"glb":void 0}let P=class extends on{constructor(){super(),this.externalSources=new sn,this._explicitDisplaySource=null,this.addHandles(an(()=>this.externalSources,"after-remove",({item:e})=>{e===this._explicitDisplaySource&&(this._explicitDisplaySource=null)},{sync:!0,onListenerRemove:()=>this._explicitDisplaySource=null}))}get displaySource(){return this._explicitDisplaySource??this._implicitDisplaySource}set displaySource(e){if(e!=null&&!Ve(e))throw new Error("Cannot use this source for display: it is not in a supported format.");this._explicitDisplaySource=e,e&&this.externalSources.every(t=>!Cn(t,e))&&this.externalSources.add(e)}clearSources(){this.externalSources.removeAll()}getExternalSourcesOnService(e){return this.externalSources.items.filter(t=>kn(t,e))}get _implicitDisplaySource(){return this.externalSources.find(Ve)}};u([f()],P.prototype,"externalSources",void 0),u([f()],P.prototype,"displaySource",null),u([f()],P.prototype,"_implicitDisplaySource",null),u([f()],P.prototype,"_explicitDisplaySource",void 0),P=u([U("esri.geometry.support.meshUtils.Metadata")],P);function pr(){const{faceDescriptions:e,faceVertexOffsets:t,uvScales:n}=vr,r=4*e.length,o=new Float64Array(3*r),s=new Float32Array(3*r),i=new Float32Array(2*r),a=new Uint32Array(2*e.length*3);let c=0,l=0,p=0,g=0;for(let m=0;m=s&&p=4,A=h===2||h===4,D=d?n-1:n;for(let v=0;v<=D;v++){const x=v/D*2*Math.PI,R=d?0:.5;w[0]=R*Math.sin(x),w[1]=R*-Math.cos(x),w[2]=h<=2?.5:-.5;for(let z=0;z<3;z++)o[c++]=w[z],s[l++]=y?z===2?h<=1?1:-1:0:z===2?0:w[z]/R;i[p++]=(v+(d?.5:0))/n,i[p++]=h<=1?1*h/3:h<=3?1*(h-2)/3+1/3:1*(h-4)/3+2/3,A||h===0||v===n||(h!==5&&(a[g++]=m,a[g++]=m+1,a[g++]=m-n),h!==1&&(a[g++]=m,a[g++]=m-n,a[g++]=m-n-1)),m++}}return{position:o,normal:s,uv:i,faces:a}}function gr(e,t){const n=typeof t=="number"?t:t!=null?t.width:1,r=typeof t=="number"?t:t!=null?t.height:1;switch(e){case"up":case"down":return{width:n,depth:r};case"north":case"south":return{width:n,height:r};case"east":case"west":return{depth:n,height:r}}}function dr(e){const t=te.facingAxisOrderSwap[e],n=te.position,r=te.normal,o=new Float64Array(n.length),s=new Float32Array(r.length);let i=0;for(let a=0;a<4;a++){const c=i;for(let l=0;l<3;l++){const p=t[l],g=Math.abs(p)-1,m=p>=0?1:-1;o[i]=n[c+g]*m,s[i]=r[c+g]*m,i++}}return{position:o,normal:s,uv:new Float32Array(te.uv),faces:new Uint32Array(te.faces),isPlane:!0}}const V=1,H=2,B=3,te={position:[-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0],normal:[0,0,1,0,0,1,0,0,1,0,0,1],uv:[0,1,1,1,1,0,0,0],faces:[0,1,2,0,2,3],facingAxisOrderSwap:{east:[B,V,H],west:[-B,-V,H],north:[-V,B,H],south:[V,-B,H],up:[V,H,B],down:[V,-H,-B]}};function he(e,t,n){e.isPlane||yr(e),wr(e,xr(n==null?void 0:n.size,n==null?void 0:n.unit,t.spatialReference));const{vertexAttributes:r,vertexSpace:o,transform:s}=Tn(e,t,{vertexSpace:n==null?void 0:n.vertexSpace,geographic:n==null?void 0:n.geographic});return{vertexAttributes:new b({...r,uv:e.uv}),vertexSpace:o,transform:s,components:[new Q({faces:e.faces,material:(n==null?void 0:n.material)||null})],spatialReference:t.spatialReference}}function yr(e){for(let t=0;t{this.addHandles(dn(()=>{var e;return{vertexAttributes:this.vertexAttributes,components:(e=this.components)==null?void 0:e.map(t=>t.clone())}},()=>this._clearSources(),{once:!0,sync:!0}))})}get hasExtent(){var e;return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):((e=this.metadata.displaySource)==null?void 0:e.extent)!=null}get _transformedExtent(){const{components:e,spatialReference:t,vertexAttributes:n,vertexSpace:r}=this,o=n.position;if(o.length===0||e&&e.length===0)return new tt({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0,spatialReference:t});if(de(r)){const{_untransformedBounds:s,transform:i}=this;return Kn(s,i,r,t)}return Rt(o,t)}get _untransformedBounds(){return St(this.vertexAttributes.position)}get anchor(){const e=Pe(this.vertexSpace,this.spatialReference);if(e!=null)return e;const{center:t,zmin:n}=this._transformedExtent;return new N({x:t.x,y:t.y,z:n,spatialReference:this.spatialReference})}get origin(){const e=Pe(this.vertexSpace,this.spatialReference);return e??this._transformedExtent.center}get extent(){var e,t;return this.loaded||((t=(e=this.metadata)==null?void 0:e.displaySource)==null?void 0:t.extent)==null?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(e){this._checkIfLoaded("addComponent()")&&(this.components||(this.components=[]),this.components.push(Q.from(e)),this.notifyChange("components"))}removeComponent(e){if(this._checkIfLoaded("removeComponent()")){if(this.components){const t=this.components.indexOf(e);if(t!==-1)return this.components.splice(t,1),void this.notifyChange("components")}C().error("removeComponent()",Vn)}}rotate(e,t,n,r){return Sn(e,t,n,Je),br(this,Je,r),this}offset(e,t,n){if(!this._checkIfLoaded("offset()"))return this;const{vertexSpace:r,vertexAttributes:o}=this,s=o==null?void 0:o.position;if(!s)return this;if(de(r)){const[i,a,c]=r.origin;r.origin=be(i+e,a+t,c+n)}else{for(let i=0;ii.cloneWithDeduplication(o,s))}const n={components:t,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes.clone(),vertexSpace:e,transform:((r=this.transform)==null?void 0:r.clone())??null,metadata:this.metadata.clone()};return new _(n)}cloneShallow(){return new _({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const t=Re(()=>import("./gltfexport-BTAOUMHO.js"),__vite__mapDeps([31,1,2,7,9,3,10,19,15,16,17,18,5,4,11,12,20,21,13,22,23,24,25,26,27,28,29,30])),n=this.load(),r=await Promise.all([t,n]),{toBinaryGLTF:o}=r[0];return o(this,e)}get memoryUsage(){let e=0;if(e+=this.vertexAttributes.memoryUsage,this.components!=null)for(const t of this.components)e+=t.memoryUsage;return e}_clearSources(){this.metadata.clearSources()}_checkIfLoaded(e){return!!this.loaded||(C().error(e,zn),!1)}static createBox(e,t){if(!(e instanceof N))return C().error(".createBox()",re),null;const n=new _(he(pr(),e,t));return t!=null&&t.imageFace&&t.imageFace!=="all"?hr(n,t.imageFace):n}static createSphere(e,t){return e instanceof N?new _(he(fr((t==null?void 0:t.densificationFactor)||0),e,t)):(C().error(".createSphere()",re),null)}static createCylinder(e,t){return e instanceof N?new _(he(mr((t==null?void 0:t.densificationFactor)||0),e,t)):(C().error(".createCylinder()",re),null)}static createPlane(e,t){if(!(e instanceof N))return C().error(".createPlane()",re),null;const n=(t==null?void 0:t.facing)??"up",r=gr(n,t==null?void 0:t.size);return new _(he(dr(n),e,{...t,size:r}))}static createFromPolygon(e,t){if(!(e instanceof yn))return C().error(".createFromPolygon()",Hn),null;const n=Yn(e);return new _({vertexAttributes:new b({position:n.position}),components:[new Q({faces:n.faces,shading:"flat",material:(t==null?void 0:t.material)??null})],spatialReference:e.spatialReference,vertexSpace:new _e})}static async createFromGLTF(e,t,n){if(!(e instanceof N)){const o=new He;throw C().error(".createfromGLTF()",o.message),o}const{loadGLTFMesh:r}=await rt(Re(()=>import("./loadGLTFMesh-DdWfwp7n.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30])),n);return new _(await r(e,t,n))}static async createFromFiles(e,t,n){xn(C(),"`Mesh.createFromFiles` is deprecated in favor of 'SceneLayer.convertMesh'",{replacement:"SceneLayer.convertMesh",version:"4.29"});const r=o=>C().error(".createFromFiles()",o.message);if(!(e instanceof N)){const o=new He;throw r(o),o}if(!(n!=null&&n.layer))throw new ie("invalid:no-layer","SceneLayer required for file to mesh conversion.");return n.layer.convertMesh(t,{location:e,...n})}static createWithExternalSource(e,t,n){var h;const r=(n==null?void 0:n.extent)??null,{x:o,y:s,z:i,spatialReference:a}=e,c=((h=n==null?void 0:n.transform)==null?void 0:h.clone())??new ae,l=be(o,s,i??0),p=Ue((n==null?void 0:n.vertexSpace)??We(a),l),g={source:t,extent:r},m=new P;return m.externalSources.push(g),new _({metadata:m,transform:c,vertexSpace:p,spatialReference:a})}static createIncomplete(e,t){var p;const{x:n,y:r,z:o,spatialReference:s}=e,i=((p=t==null?void 0:t.transform)==null?void 0:p.clone())??new ae,a=be(n,r,o??0),c=Ue((t==null?void 0:t.vertexSpace)??We(s),a),l=new _({transform:i,vertexSpace:c,spatialReference:s});return l.addResolvingPromise(Promise.reject(new ie("mesh-incomplete","Mesh resources are not complete"))),l}};u([f({type:[Q],json:{write:!0}})],$.prototype,"components",void 0),u([f({nonNullable:!0,types:Fr,constructOnly:!0,json:{write:!0}})],$.prototype,"vertexSpace",void 0),u([f({type:ae,json:{write:!0}})],$.prototype,"transform",void 0),u([f({constructOnly:!0})],$.prototype,"metadata",void 0),u([f()],$.prototype,"hasExtent",null),u([f()],$.prototype,"_transformedExtent",null),u([f()],$.prototype,"_untransformedBounds",null),u([f()],$.prototype,"anchor",null),u([f()],$.prototype,"origin",null),u([f({readOnly:!0,json:{read:!1}})],$.prototype,"extent",null),u([f({readOnly:!0,json:{read:!1,write:!0,default:!0}})],$.prototype,"hasZ",void 0),u([f({readOnly:!0,json:{read:!1,write:!0,default:!1}})],$.prototype,"hasM",void 0),u([f({type:b,nonNullable:!0,json:{write:!0}})],$.prototype,"vertexAttributes",void 0),$=_=u([U(Ot)],$);const Je=pt(),Jr=$;export{Jr as $,Un as a,se as c,Q as h,b as l,oe as m}; diff --git a/assets/MeshLocalVertexSpace-Cltwu1Kq.js b/assets/MeshLocalVertexSpace-DRvwbFTJ.js similarity index 91% rename from assets/MeshLocalVertexSpace-Cltwu1Kq.js rename to assets/MeshLocalVertexSpace-DRvwbFTJ.js index 6c2b589..501dd45 100644 --- a/assets/MeshLocalVertexSpace-Cltwu1Kq.js +++ b/assets/MeshLocalVertexSpace-DRvwbFTJ.js @@ -1 +1 @@ -import{b4 as s,d as e,c9 as i,y as n,f as p,aU as c,cy as a}from"./index-CEWggaxV.js";let o=class extends s(c){constructor(t){super(t),this.type="georeferenced",this.origin=null}};e([i({georeferenced:"georeferenced"},{readOnly:!0})],o.prototype,"type",void 0),e([n({type:[Number],nonNullable:!1,json:{write:!0}})],o.prototype,"origin",void 0),o=e([p("esri.geometry.support.MeshGeoreferencedVertexSpace")],o);const y=o;let r=class extends s(c){constructor(t){super(t),this.type="local",this.origin=a()}};e([i({local:"local"},{readOnly:!0})],r.prototype,"type",void 0),e([n({type:[Number],nonNullable:!0,json:{write:!0}})],r.prototype,"origin",void 0),r=e([p("esri.geometry.support.MeshLocalVertexSpace")],r);const d=r;export{d as a,y as i}; +import{b4 as s,d as e,c9 as i,y as n,f as p,aU as c,cy as a}from"./index-BjUNJPVf.js";let o=class extends s(c){constructor(t){super(t),this.type="georeferenced",this.origin=null}};e([i({georeferenced:"georeferenced"},{readOnly:!0})],o.prototype,"type",void 0),e([n({type:[Number],nonNullable:!1,json:{write:!0}})],o.prototype,"origin",void 0),o=e([p("esri.geometry.support.MeshGeoreferencedVertexSpace")],o);const y=o;let r=class extends s(c){constructor(t){super(t),this.type="local",this.origin=a()}};e([i({local:"local"},{readOnly:!0})],r.prototype,"type",void 0),e([n({type:[Number],nonNullable:!0,json:{write:!0}})],r.prototype,"origin",void 0),r=e([p("esri.geometry.support.MeshLocalVertexSpace")],r);const d=r;export{d as a,y as i}; diff --git a/assets/OGCFeatureLayer-BfwwYuSp.js b/assets/OGCFeatureLayer-_EJqre42.js similarity index 84% rename from assets/OGCFeatureLayer-BfwwYuSp.js rename to assets/OGCFeatureLayer-_EJqre42.js index b7f8416..b552fd8 100644 --- a/assets/OGCFeatureLayer-BfwwYuSp.js +++ b/assets/OGCFeatureLayer-_EJqre42.js @@ -1 +1 @@ -import{d as r,y as s,f as $,fw as B,aS as b,fM as N,N as x,dN as L,dO as z,bP as H,bQ as J,dp as U,dq as Z,dr as V,fA as F,aX as I,b3 as k,e8 as W,a_ as K,aE as X,d3 as O,fB as Y,dt as ee,fD as te,i as re,fE as oe,du as se,bT as ie}from"./index-CEWggaxV.js";import"./UniqueValueRenderer-BlkUix3g.js";import{a as pe,u as ne}from"./jsonUtils-BseLl1fZ.js";import{R as ae,x as D,C as T,P as le,O as ue,N as de,q as ce,v as ye,k as me}from"./ogcFeatureUtils-D4df60hh.js";import{d as fe}from"./FeatureSet-CYJUZgOk.js";import{p as he}from"./FeatureEffectLayer-CLTrRFqx.js";import{c as ge}from"./FeatureReductionLayer-DncGsNIN.js";import{c as ve}from"./OrderedLayer-Do089KpQ.js";import{f as Se}from"./RefreshableLayer-1EkEhJeI.js";import{f as be}from"./TemporalLayer-qq3v_i3q.js";import{n as Ce}from"./FeatureType-By3BEr9z.js";import{s as we}from"./fieldProperties-DMs4wT6-.js";import{C as Re}from"./LabelClass-6cZokw8y.js";import{i as xe}from"./labelingInfo-CijajRsc.js";import{p as Fe}from"./popupUtils-DAFYyAvw.js";import"./ColorStop-44hBlQ14.js";import"./diffUtils-B4YFa5Ju.js";import"./colorRamps-BJydlf0f.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-z2k12BH8.js";import"./jsonUtils-qYmXvGJ1.js";import"./styleUtils-CnV_Xzhi.js";import"./Version-Bd0QsIQ5.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./OverrideHelper-B4ryGWZb.js";import"./utils-p-5Bbga5.js";import"./quantizationUtils-CUjGHrU3.js";import"./heatmapUtils-Clt5rJzr.js";import"./featureConversionUtils-CmP9mw0r.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./geojson-BLwRz6JF.js";import"./date-M6n_RqpC.js";import"./clientSideDefaults-CgRgH99f.js";import"./QueryEngineCapabilities-CTDe3LlQ.js";import"./defaultsJSON-CHAaurhX.js";import"./sourceUtils-QX9lwl5p.js";import"./FeatureEffect-ByrbZlne.js";import"./FeatureReductionSelection-BY3KVXac.js";import"./featureLayerUtils-BhDaw8pS.js";import"./AttachmentQuery-D61mmWw4.js";import"./RelationshipQuery-DDK72Kwc.js";import"./MD5-C9MwAd2G.js";import"./OrderByInfo-DKzv2-WS.js";import"./TimeInfo-3TVmpFSA.js";import"./FeatureTemplate-DcprAdTM.js";import"./labelUtils-Dnqx6jl5.js";let d=class extends B{constructor(){super(...arguments),this.featureDefinition=null,this.type="ogc-feature"}load(e){return this.addResolvingPromise(this._loadOGCServices(this.layer,e)),this.when()}getSource(){const{featureDefinition:{collection:e,layerDefinition:t,spatialReference:i,supportedCrs:p},layer:{apiKey:n,customParameters:l,effectiveMaxRecordCount:a}}=this;return{type:"ogc-source",collection:e,layerDefinition:t,maxRecordCount:a,queryParameters:{apiKey:n,customParameters:l},spatialReference:i,supportedCrs:p}}queryExtent(e,t={}){return null}queryFeatureCount(e,t={}){return null}queryFeatures(e,t={}){return this.queryFeaturesJSON(e,t).then(i=>fe.fromJSON(i))}queryFeaturesJSON(e,t={}){const i=this.getSource();return this.load(t).then(()=>ae(i,e,t))}queryObjectIds(e,t={}){return null}serviceSupportsSpatialReference(e){return!(!e.isWGS84&&!e.isWebMercator)||!!this.featureDefinition.supportedCrs[e.wkid]}_conformsToType(e,t){const i=new RegExp(`^${t}$`,"i");return e.conformsTo.some(p=>i.test(p))??!1}_getCapabilities(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:t,maxRecordCountFactor:void 0,standardMaxRecordCount:void 0,supportsCacheHint:!1,supportsCentroid:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsStatistics:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,supportsSqlExpression:!1,tileMaxRecordCount:void 0},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}_getMaxRecordCount(e){var i,p,n,l,a;const t=(i=e==null?void 0:e.components)==null?void 0:i.parameters;return((n=(p=t==null?void 0:t.limit)==null?void 0:p.schema)==null?void 0:n.maximum)??((a=(l=t==null?void 0:t.limitFeatures)==null?void 0:l.schema)==null?void 0:a.maximum)}_getStorageSpatialReference(e){const t=e.storageCrs??D,i=T(t);return i==null?b.WGS84:new b({wkid:i})}_getSupportedSpatialReferences(e,t){const i="#/crs",p=e.crs??[D],n=p.includes(i)?p.filter(a=>a!==i).concat(t.crs??[]):p,l=/^http:\/\/www\.opengis.net\/def\/crs\/epsg\/.*\/3785$/i;return n.filter(a=>!l.test(a))}async _loadOGCServices(e,t){const i=t!=null?t.signal:null,{apiKey:p,collectionId:n,customParameters:l,fields:a,geometryType:m,hasZ:f,objectIdField:j,timeInfo:h,url:P}=e,E={fields:a==null?void 0:a.map(u=>u.toJSON()),geometryType:N.toJSON(m),hasZ:f??!1,objectIdField:j,timeInfo:h==null?void 0:h.toJSON()},c={apiKey:p,customParameters:l,signal:i},g=await le(P,c),[C,w]=await Promise.all([ue(g,c),de(g,c)]);if(!this._conformsToType(C,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson"))throw new x("ogc-feature-layer:no-geojson-support","Server does not support geojson");const y=w.collections.find(({id:u})=>u===n);if(!y)throw new x("ogc-feature-layer:collection-not-found","Server does not contain the named collection");const _=this._conformsToType(C,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30")?await ce(g,c):null,R=await ye(y,E,c),q=this._getMaxRecordCount(_),A=this._getCapabilities(R.hasZ,q),M=this._getStorageSpatialReference(y).toJSON(),G=this._getSupportedSpatialReferences(y,w),Q=new RegExp(`^${me}`,"i"),v={};for(const u of G){const S=T(u);S!=null&&(v[S]||(v[S]=u.replace(Q,"")))}this.featureDefinition={capabilities:A,collection:y,layerDefinition:R,spatialReference:M,supportedCrs:v}}};r([s()],d.prototype,"featureDefinition",void 0),r([s({constructOnly:!0})],d.prototype,"layer",void 0),r([s()],d.prototype,"type",void 0),d=r([$("esri.layers.graphics.sources.OGCFeatureSource")],d);const Ie=we();let o=class extends L(z(ge(he(H(ve(be(J(U(Z(Se(V(ie)))))))))))){constructor(e){super(e),this.capabilities=null,this.collectionId=null,this.copyright=null,this.description=null,this.displayField=null,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.hasZ=void 0,this.labelingInfo=null,this.labelsVisible=!0,this.legendEnabled=!0,this.maxRecordCount=null,this.objectIdField=null,this.operationalLayerType="OGCFeatureLayer",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new d({layer:this}),this.spatialReference=null,this.title=null,this.type="ogc-feature",this.typeIdField=null,this.types=null,this.url=null}destroy(){var e;(e=this.source)==null||e.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["OGCFeatureServer"]},e).then(()=>this._fetchService(e))),this.when()}get defaultPopupTemplate(){return this.createPopupTemplate()}get effectiveMaxRecordCount(){var e;return this.maxRecordCount??((e=this.capabilities)==null?void 0:e.query.maxRecordCount)??5e3}get isTable(){return this.loaded&&this.geometryType==null}set renderer(e){F(e,this.fieldsIndex),this._set("renderer",e)}on(e,t){return super.on(e,t)}createPopupTemplate(e){return Fe(this,e)}createQuery(){return new I}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){var a;let i,p=!1;const n=(a=t==null?void 0:t.feature)==null?void 0:a.attributes,l=this.typeIdField&&(n==null?void 0:n[this.typeIdField]);return l!=null&&this.types&&(p=this.types.some(m=>{var f;return m.id==l&&(i=(f=m.domains)==null?void 0:f[e],(i==null?void 0:i.type)==="inherited"&&(i=this._getLayerDomain(e)),!0)})),p||i||(i=this._getLayerDomain(e)),i}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(I.from(e)||this.createQuery(),t)).then(i=>{var p;return(p=i==null?void 0:i.features)==null||p.forEach(n=>{n.layer=n.sourceLayer=this}),i})}serviceSupportsSpatialReference(e){var t;return((t=this.source)==null?void 0:t.serviceSupportsSpatialReference(e))??!1}async _fetchService(e){await this.source.load(e),this.read(this.source.featureDefinition,{origin:"service"}),F(this.renderer,this.fieldsIndex),k(this.timeInfo,this.fieldsIndex)}_getLayerDomain(e){if(!this.fields)return null;for(const t of this.fields)if(t.name===e&&t.domain)return t.domain;return null}};r([s({readOnly:!0,json:{origins:{service:{read:!0}}}})],o.prototype,"capabilities",void 0),r([s({type:String,json:{write:!0}})],o.prototype,"collectionId",void 0),r([s({type:String})],o.prototype,"copyright",void 0),r([s({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),r([s({readOnly:!0,type:String,json:{origins:{service:{name:"collection.description"}}}})],o.prototype,"description",void 0),r([s({type:String})],o.prototype,"displayField",void 0),r([s({type:Number})],o.prototype,"effectiveMaxRecordCount",null),r([s(W)],o.prototype,"elevationInfo",void 0),r([s({type:[K],json:{origins:{service:{name:"layerDefinition.fields"}}}})],o.prototype,"fields",void 0),r([s(Ie.fieldsIndex)],o.prototype,"fieldsIndex",void 0),r([s({readOnly:!0,type:X,json:{origins:{service:{name:"layerDefinition.extent"}}}})],o.prototype,"fullExtent",void 0),r([s({type:O.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:O.read}}}}})],o.prototype,"geometryType",void 0),r([s({type:Boolean,json:{origins:{service:{name:"layerDefinition.hasZ"}}}})],o.prototype,"hasZ",void 0),r([s({type:Boolean,readOnly:!0})],o.prototype,"isTable",null),r([s({type:[Re],json:{origins:{"web-document":{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:xe},write:!0}}}})],o.prototype,"labelingInfo",void 0),r([s(Y)],o.prototype,"labelsVisible",void 0),r([s(ee)],o.prototype,"legendEnabled",void 0),r([s({type:Number})],o.prototype,"maxRecordCount",void 0),r([s({type:String,json:{origins:{service:{name:"layerDefinition.objectIdField"}}}})],o.prototype,"objectIdField",void 0),r([s({type:["OGCFeatureLayer"]})],o.prototype,"operationalLayerType",void 0),r([s(te)],o.prototype,"popupEnabled",void 0),r([s({type:re,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),r([s({types:pe,json:{origins:{service:{name:"layerDefinition.drawingInfo.renderer",write:!1},"web-scene":{types:ne,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:!0}})],o.prototype,"renderer",null),r([s(oe)],o.prototype,"screenSizePerspectiveEnabled",void 0),r([s({readOnly:!0})],o.prototype,"source",void 0),r([s({readOnly:!0,type:b,json:{origins:{service:{read:!0}}}})],o.prototype,"spatialReference",void 0),r([s({type:String,json:{write:{enabled:!0,ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"collection.title"}}}})],o.prototype,"title",void 0),r([s({readOnly:!0,json:{read:!1}})],o.prototype,"type",void 0),r([s({type:String,readOnly:!0})],o.prototype,"typeIdField",void 0),r([s({type:[Ce]})],o.prototype,"types",void 0),r([s(se)],o.prototype,"url",void 0),o=r([$("esri.layers.OGCFeatureLayer")],o);const Ct=o;export{Ct as default}; +import{d as r,y as s,f as $,fw as B,aS as b,fM as N,N as x,dN as L,dO as z,bP as H,bQ as J,dp as U,dq as Z,dr as V,fA as F,aX as I,b3 as k,e8 as W,a_ as K,aE as X,d3 as O,fB as Y,dt as ee,fD as te,i as re,fE as oe,du as se,bT as ie}from"./index-BjUNJPVf.js";import"./UniqueValueRenderer-7V9Bhr-D.js";import{a as pe,u as ne}from"./jsonUtils-Dw332y6z.js";import{R as ae,x as D,C as T,P as le,O as ue,N as de,q as ce,v as ye,k as me}from"./ogcFeatureUtils-B_dc0icr.js";import{d as fe}from"./FeatureSet-opEn8ou8.js";import{p as he}from"./FeatureEffectLayer-DarO4Ctx.js";import{c as ge}from"./FeatureReductionLayer-CK-tyM-9.js";import{c as ve}from"./OrderedLayer-dLoPhxcx.js";import{f as Se}from"./RefreshableLayer-_r2TPtol.js";import{f as be}from"./TemporalLayer-CKICYnEl.js";import{n as Ce}from"./FeatureType-CwUl8Nf5.js";import{s as we}from"./fieldProperties-DnrQXLBM.js";import{C as Re}from"./LabelClass-CeatfK8u.js";import{i as xe}from"./labelingInfo-DqAUis6e.js";import{p as Fe}from"./popupUtils-DlZin22m.js";import"./ColorStop-DCGjAKLC.js";import"./diffUtils-uUoMDFQS.js";import"./colorRamps-CcakIWlU.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-BX9G5gNQ.js";import"./jsonUtils-Ox5U0P0F.js";import"./styleUtils-DOUOskVZ.js";import"./Version-Dqq_CHBG.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./OverrideHelper-DxFZBnGL.js";import"./utils-CuXO_Zzq.js";import"./quantizationUtils-CfV316jZ.js";import"./heatmapUtils-BSteZBTj.js";import"./featureConversionUtils-BHhm7bvm.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./geojson-AjfTISUf.js";import"./date-M6n_RqpC.js";import"./clientSideDefaults-BQP5n3lX.js";import"./QueryEngineCapabilities-CTDe3LlQ.js";import"./defaultsJSON-CHAaurhX.js";import"./sourceUtils-BNTaqxhX.js";import"./FeatureEffect-DBbkrS6j.js";import"./FeatureReductionSelection-t3T7oa8H.js";import"./featureLayerUtils-lwqyOSrl.js";import"./AttachmentQuery-DmEAIZff.js";import"./RelationshipQuery-BDJrOxaX.js";import"./MD5-C9MwAd2G.js";import"./OrderByInfo-DKyk5GLW.js";import"./TimeInfo-DooETFWC.js";import"./FeatureTemplate-FZNGA_Ik.js";import"./labelUtils-3p0-m-Ee.js";let d=class extends B{constructor(){super(...arguments),this.featureDefinition=null,this.type="ogc-feature"}load(e){return this.addResolvingPromise(this._loadOGCServices(this.layer,e)),this.when()}getSource(){const{featureDefinition:{collection:e,layerDefinition:t,spatialReference:i,supportedCrs:p},layer:{apiKey:n,customParameters:l,effectiveMaxRecordCount:a}}=this;return{type:"ogc-source",collection:e,layerDefinition:t,maxRecordCount:a,queryParameters:{apiKey:n,customParameters:l},spatialReference:i,supportedCrs:p}}queryExtent(e,t={}){return null}queryFeatureCount(e,t={}){return null}queryFeatures(e,t={}){return this.queryFeaturesJSON(e,t).then(i=>fe.fromJSON(i))}queryFeaturesJSON(e,t={}){const i=this.getSource();return this.load(t).then(()=>ae(i,e,t))}queryObjectIds(e,t={}){return null}serviceSupportsSpatialReference(e){return!(!e.isWGS84&&!e.isWebMercator)||!!this.featureDefinition.supportedCrs[e.wkid]}_conformsToType(e,t){const i=new RegExp(`^${t}$`,"i");return e.conformsTo.some(p=>i.test(p))??!1}_getCapabilities(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:t,maxRecordCountFactor:void 0,standardMaxRecordCount:void 0,supportsCacheHint:!1,supportsCentroid:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsStatistics:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,supportsSqlExpression:!1,tileMaxRecordCount:void 0},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}_getMaxRecordCount(e){var i,p,n,l,a;const t=(i=e==null?void 0:e.components)==null?void 0:i.parameters;return((n=(p=t==null?void 0:t.limit)==null?void 0:p.schema)==null?void 0:n.maximum)??((a=(l=t==null?void 0:t.limitFeatures)==null?void 0:l.schema)==null?void 0:a.maximum)}_getStorageSpatialReference(e){const t=e.storageCrs??D,i=T(t);return i==null?b.WGS84:new b({wkid:i})}_getSupportedSpatialReferences(e,t){const i="#/crs",p=e.crs??[D],n=p.includes(i)?p.filter(a=>a!==i).concat(t.crs??[]):p,l=/^http:\/\/www\.opengis.net\/def\/crs\/epsg\/.*\/3785$/i;return n.filter(a=>!l.test(a))}async _loadOGCServices(e,t){const i=t!=null?t.signal:null,{apiKey:p,collectionId:n,customParameters:l,fields:a,geometryType:m,hasZ:f,objectIdField:j,timeInfo:h,url:P}=e,E={fields:a==null?void 0:a.map(u=>u.toJSON()),geometryType:N.toJSON(m),hasZ:f??!1,objectIdField:j,timeInfo:h==null?void 0:h.toJSON()},c={apiKey:p,customParameters:l,signal:i},g=await le(P,c),[C,w]=await Promise.all([ue(g,c),de(g,c)]);if(!this._conformsToType(C,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson"))throw new x("ogc-feature-layer:no-geojson-support","Server does not support geojson");const y=w.collections.find(({id:u})=>u===n);if(!y)throw new x("ogc-feature-layer:collection-not-found","Server does not contain the named collection");const _=this._conformsToType(C,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30")?await ce(g,c):null,R=await ye(y,E,c),q=this._getMaxRecordCount(_),A=this._getCapabilities(R.hasZ,q),M=this._getStorageSpatialReference(y).toJSON(),G=this._getSupportedSpatialReferences(y,w),Q=new RegExp(`^${me}`,"i"),v={};for(const u of G){const S=T(u);S!=null&&(v[S]||(v[S]=u.replace(Q,"")))}this.featureDefinition={capabilities:A,collection:y,layerDefinition:R,spatialReference:M,supportedCrs:v}}};r([s()],d.prototype,"featureDefinition",void 0),r([s({constructOnly:!0})],d.prototype,"layer",void 0),r([s()],d.prototype,"type",void 0),d=r([$("esri.layers.graphics.sources.OGCFeatureSource")],d);const Ie=we();let o=class extends L(z(ge(he(H(ve(be(J(U(Z(Se(V(ie)))))))))))){constructor(e){super(e),this.capabilities=null,this.collectionId=null,this.copyright=null,this.description=null,this.displayField=null,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.hasZ=void 0,this.labelingInfo=null,this.labelsVisible=!0,this.legendEnabled=!0,this.maxRecordCount=null,this.objectIdField=null,this.operationalLayerType="OGCFeatureLayer",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new d({layer:this}),this.spatialReference=null,this.title=null,this.type="ogc-feature",this.typeIdField=null,this.types=null,this.url=null}destroy(){var e;(e=this.source)==null||e.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["OGCFeatureServer"]},e).then(()=>this._fetchService(e))),this.when()}get defaultPopupTemplate(){return this.createPopupTemplate()}get effectiveMaxRecordCount(){var e;return this.maxRecordCount??((e=this.capabilities)==null?void 0:e.query.maxRecordCount)??5e3}get isTable(){return this.loaded&&this.geometryType==null}set renderer(e){F(e,this.fieldsIndex),this._set("renderer",e)}on(e,t){return super.on(e,t)}createPopupTemplate(e){return Fe(this,e)}createQuery(){return new I}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){var a;let i,p=!1;const n=(a=t==null?void 0:t.feature)==null?void 0:a.attributes,l=this.typeIdField&&(n==null?void 0:n[this.typeIdField]);return l!=null&&this.types&&(p=this.types.some(m=>{var f;return m.id==l&&(i=(f=m.domains)==null?void 0:f[e],(i==null?void 0:i.type)==="inherited"&&(i=this._getLayerDomain(e)),!0)})),p||i||(i=this._getLayerDomain(e)),i}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(I.from(e)||this.createQuery(),t)).then(i=>{var p;return(p=i==null?void 0:i.features)==null||p.forEach(n=>{n.layer=n.sourceLayer=this}),i})}serviceSupportsSpatialReference(e){var t;return((t=this.source)==null?void 0:t.serviceSupportsSpatialReference(e))??!1}async _fetchService(e){await this.source.load(e),this.read(this.source.featureDefinition,{origin:"service"}),F(this.renderer,this.fieldsIndex),k(this.timeInfo,this.fieldsIndex)}_getLayerDomain(e){if(!this.fields)return null;for(const t of this.fields)if(t.name===e&&t.domain)return t.domain;return null}};r([s({readOnly:!0,json:{origins:{service:{read:!0}}}})],o.prototype,"capabilities",void 0),r([s({type:String,json:{write:!0}})],o.prototype,"collectionId",void 0),r([s({type:String})],o.prototype,"copyright",void 0),r([s({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),r([s({readOnly:!0,type:String,json:{origins:{service:{name:"collection.description"}}}})],o.prototype,"description",void 0),r([s({type:String})],o.prototype,"displayField",void 0),r([s({type:Number})],o.prototype,"effectiveMaxRecordCount",null),r([s(W)],o.prototype,"elevationInfo",void 0),r([s({type:[K],json:{origins:{service:{name:"layerDefinition.fields"}}}})],o.prototype,"fields",void 0),r([s(Ie.fieldsIndex)],o.prototype,"fieldsIndex",void 0),r([s({readOnly:!0,type:X,json:{origins:{service:{name:"layerDefinition.extent"}}}})],o.prototype,"fullExtent",void 0),r([s({type:O.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:O.read}}}}})],o.prototype,"geometryType",void 0),r([s({type:Boolean,json:{origins:{service:{name:"layerDefinition.hasZ"}}}})],o.prototype,"hasZ",void 0),r([s({type:Boolean,readOnly:!0})],o.prototype,"isTable",null),r([s({type:[Re],json:{origins:{"web-document":{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:xe},write:!0}}}})],o.prototype,"labelingInfo",void 0),r([s(Y)],o.prototype,"labelsVisible",void 0),r([s(ee)],o.prototype,"legendEnabled",void 0),r([s({type:Number})],o.prototype,"maxRecordCount",void 0),r([s({type:String,json:{origins:{service:{name:"layerDefinition.objectIdField"}}}})],o.prototype,"objectIdField",void 0),r([s({type:["OGCFeatureLayer"]})],o.prototype,"operationalLayerType",void 0),r([s(te)],o.prototype,"popupEnabled",void 0),r([s({type:re,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),r([s({types:pe,json:{origins:{service:{name:"layerDefinition.drawingInfo.renderer",write:!1},"web-scene":{types:ne,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:!0}})],o.prototype,"renderer",null),r([s(oe)],o.prototype,"screenSizePerspectiveEnabled",void 0),r([s({readOnly:!0})],o.prototype,"source",void 0),r([s({readOnly:!0,type:b,json:{origins:{service:{read:!0}}}})],o.prototype,"spatialReference",void 0),r([s({type:String,json:{write:{enabled:!0,ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"collection.title"}}}})],o.prototype,"title",void 0),r([s({readOnly:!0,json:{read:!1}})],o.prototype,"type",void 0),r([s({type:String,readOnly:!0})],o.prototype,"typeIdField",void 0),r([s({type:[Ce]})],o.prototype,"types",void 0),r([s(se)],o.prototype,"url",void 0),o=r([$("esri.layers.OGCFeatureLayer")],o);const Ct=o;export{Ct as default}; diff --git a/assets/OGCFeatureLayerView2D-BT1AiNl1.js b/assets/OGCFeatureLayerView2D-BT1AiNl1.js new file mode 100644 index 0000000..e94d175 --- /dev/null +++ b/assets/OGCFeatureLayerView2D-BT1AiNl1.js @@ -0,0 +1 @@ +import{d as t,y as p,f as e}from"./index-BjUNJPVf.js";import{X as a}from"./FeatureLayerView2D-B6lIa9Lt.js";import"./diffUtils-uUoMDFQS.js";import"./Container-_n5wCgez.js";import"./highlightReasons-BOU4mnPE.js";import"./Texture-S4dD-WHn.js";import"./FeatureEffect-DBbkrS6j.js";import"./FeatureSet-opEn8ou8.js";import"./LayerView-Bux7vAEn.js";import"./scaleUtils-DWXMiS7R.js";import"./TechniqueInstance-XtnK2qy2.js";import"./UpdateTracking2D-Ds_Gdrxd.js";import"./TurboLine-DNQdPIXo.js";import"./earcut-CWKXDqDj.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./utils-CuXO_Zzq.js";import"./Rect-CUzevAry.js";import"./LabelMetric-BcUxDImF.js";import"./Program-DBsYtQ00.js";import"./labelUtils-3p0-m-Ee.js";import"./defaultsJSON-CHAaurhX.js";import"./BindType-BmZEZMMh.js";import"./Util-CS5u4Lec.js";import"./constants-D5zmR9t2.js";import"./TileContainer-Bs-vXdD_.js";import"./WGLContainer-DgZNq7b0.js";import"./ProgramTemplate-Ck2I0bIi.js";import"./config-MDUrh2eL.js";import"./featureConversionUtils-BHhm7bvm.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./tileUtils-B7X19rIS.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./OrderByInfo-DKyk5GLW.js";import"./labelingInfo-DqAUis6e.js";import"./LabelClass-CeatfK8u.js";import"./jsonUtils-Ox5U0P0F.js";import"./heatmapUtils-BSteZBTj.js";import"./SDFHelper-kKuXhauo.js";import"./floatRGBA-Cs54GdjG.js";import"./FeatureCommandQueue-DI81F3gA.js";import"./HighlightCounter-qEuAaY1V.js";import"./floorFilterUtils-DZ5C6FQv.js";import"./popupUtils-Do2GfZME.js";import"./RefreshableLayerView-L9NGpXXI.js";const s=i=>{let r=class extends i{get availableFields(){return this.layer.fieldsIndex.fields.map(m=>m.name)}};return t([p()],r.prototype,"layer",void 0),t([p({readOnly:!0})],r.prototype,"availableFields",null),r=t([e("esri.views.layers.OGCFeatureLayerView")],r),r};let o=class extends s(a){supportsSpatialReference(i){return this.layer.serviceSupportsSpatialReference(i)}};o=t([e("esri.views.2d.layers.OGCFeatureLayerView2D")],o);const $=o;export{$ as default}; diff --git a/assets/OGCFeatureLayerView2D-DBRY7Ix7.js b/assets/OGCFeatureLayerView2D-DBRY7Ix7.js deleted file mode 100644 index bf16e67..0000000 --- a/assets/OGCFeatureLayerView2D-DBRY7Ix7.js +++ /dev/null @@ -1 +0,0 @@ -import{d as t,y as p,f as e}from"./index-CEWggaxV.js";import{X as a}from"./FeatureLayerView2D-Dw_5zj3d.js";import"./diffUtils-B4YFa5Ju.js";import"./Container-CB7SlLB9.js";import"./highlightReasons-DbgbcWKM.js";import"./Texture-DJgkMrSB.js";import"./FeatureEffect-ByrbZlne.js";import"./FeatureSet-CYJUZgOk.js";import"./LayerView-BEFTHNYv.js";import"./scaleUtils-Bqauo1zZ.js";import"./TechniqueInstance-CSsTmbek.js";import"./UpdateTracking2D-nj9Q-3df.js";import"./TurboLine-CkxIB4ZX.js";import"./earcut-hRlx3adE.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./utils-p-5Bbga5.js";import"./Rect-CUzevAry.js";import"./LabelMetric-D2hbzzy_.js";import"./Program-DLRmaKpw.js";import"./labelUtils-Dnqx6jl5.js";import"./defaultsJSON-CHAaurhX.js";import"./BindType-BmZEZMMh.js";import"./Util-BS8sJGjF.js";import"./constants-D5zmR9t2.js";import"./TileContainer-Ci6dOowA.js";import"./WGLContainer-B_Pv-8Yi.js";import"./ProgramTemplate-BICQrNzS.js";import"./config-MDUrh2eL.js";import"./featureConversionUtils-CmP9mw0r.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./tileUtils-B7X19rIS.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./OrderByInfo-DKzv2-WS.js";import"./labelingInfo-CijajRsc.js";import"./LabelClass-6cZokw8y.js";import"./jsonUtils-qYmXvGJ1.js";import"./heatmapUtils-Clt5rJzr.js";import"./SDFHelper-CSK796Wb.js";import"./floatRGBA-BLm-Rhaq.js";import"./FeatureCommandQueue-Btq_FXyi.js";import"./HighlightCounter-abgLEfgq.js";import"./floorFilterUtils-DZ5C6FQv.js";import"./popupUtils-BovqErR_.js";import"./RefreshableLayerView-C1-PEoNB.js";const s=i=>{let r=class extends i{get availableFields(){return this.layer.fieldsIndex.fields.map(m=>m.name)}};return t([p()],r.prototype,"layer",void 0),t([p({readOnly:!0})],r.prototype,"availableFields",null),r=t([e("esri.views.layers.OGCFeatureLayerView")],r),r};let o=class extends s(a){supportsSpatialReference(i){return this.layer.serviceSupportsSpatialReference(i)}};o=t([e("esri.views.2d.layers.OGCFeatureLayerView2D")],o);const $=o;export{$ as default}; diff --git a/assets/ObjectStack-CF0cQvd2.js b/assets/ObjectStack-BAIuPeIh.js similarity index 88% rename from assets/ObjectStack-CF0cQvd2.js rename to assets/ObjectStack-BAIuPeIh.js index 0bef964..3ae9cda 100644 --- a/assets/ObjectStack-CF0cQvd2.js +++ b/assets/ObjectStack-BAIuPeIh.js @@ -1 +1 @@ -import{cY as i}from"./index-CEWggaxV.js";class r{constructor(t){this._allocator=t,this._items=[],this._itemsPtr=0,this._grow()}get(){return this._itemsPtr===0&&i(()=>this._reset()),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){const t=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*s);this._items.length=Math.min(t,this._items.length),this._itemsPtr=0}_grow(){for(let t=0;tthis._reset()),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){const t=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*s);this._items.length=Math.min(t,this._items.length),this._itemsPtr=0}_grow(){for(let t=0;tt===u.Back?N:t===u.Front?D:null,nt={zNear:0,zFar:1},st={r:!0,g:!0,b:!0,a:!0};function R(t){return L.intern(t)}function y(t){return M.intern(t)}function $(t){return U.intern(t)}function m(t){return H.intern(t)}function F(t){return K.intern(t)}function E(t){return j.intern(t)}function P(t){return x.intern(t)}function k(t){return q.intern(t)}function z(t){return G.intern(t)}function lt(t){return Q.intern(t)}class s{constructor(e,n){this._makeKey=e,this._makeRef=n,this._interns=new Map}intern(e){if(!e)return null;const n=this._makeKey(e),i=this._interns;return i.has(n)||i.set(n,this._makeRef(e)),i.get(n)??null}}function l(t){return"["+t.join(",")+"]"}const L=new s(v,t=>({__tag:"Blending",...t}));function v(t){return t?l([t.srcRgb,t.srcAlpha,t.dstRgb,t.dstAlpha,t.opRgb,t.opAlpha,t.color.r,t.color.g,t.color.b,t.color.a]):null}const M=new s(S,t=>({__tag:"Culling",...t}));function S(t){return t?l([t.face,t.mode]):null}const U=new s(I,t=>({__tag:"PolygonOffset",...t}));function I(t){return t?l([t.factor,t.units]):null}const H=new s(W,t=>({__tag:"DepthTest",...t}));function W(t){return t?l([t.func]):null}const K=new s(b,t=>({__tag:"StencilTest",...t}));function b(t){return t?l([t.function.func,t.function.ref,t.function.mask,t.operation.fail,t.operation.zFail,t.operation.zPass]):null}const j=new s(T,t=>({__tag:"DepthWrite",...t}));function T(t){return t?l([t.zNear,t.zFar]):null}const x=new s(O,t=>({__tag:"ColorWrite",...t}));function O(t){return t?l([t.r,t.g,t.b,t.a]):null}const q=new s(w,t=>({__tag:"StencilWrite",...t}));function w(t){return t?l([t.mask]):null}const G=new s(A,t=>({__tag:"DrawBuffers",...t}));function A(t){return t?l(t.buffers):null}const Q=new s(Z,t=>({blending:R(t.blending),culling:y(t.culling),polygonOffset:$(t.polygonOffset),depthTest:m(t.depthTest),stencilTest:F(t.stencilTest),depthWrite:E(t.depthWrite),colorWrite:P(t.colorWrite),stencilWrite:k(t.stencilWrite),drawBuffers:z(t.drawBuffers)}));function Z(t){return t?l([v(t.blending),S(t.culling),I(t.polygonOffset),W(t.depthTest),b(t.stencilTest),T(t.depthWrite),O(t.colorWrite),w(t.stencilWrite),A(t.drawBuffers)]):null}class rt{constructor(e){this._pipelineInvalid=!0,this._blendingInvalid=!0,this._cullingInvalid=!0,this._polygonOffsetInvalid=!0,this._depthTestInvalid=!0,this._stencilTestInvalid=!0,this._depthWriteInvalid=!0,this._colorWriteInvalid=!0,this._stencilWriteInvalid=!0,this._drawBuffersInvalid=!0,this._stateSetters=e}setPipeline(e){(this._pipelineInvalid||e!==this._pipeline)&&(this._setBlending(e.blending),this._setCulling(e.culling),this._setPolygonOffset(e.polygonOffset),this._setDepthTest(e.depthTest),this._setStencilTest(e.stencilTest),this._setDepthWrite(e.depthWrite),this._setColorWrite(e.colorWrite),this._setStencilWrite(e.stencilWrite),this._setDrawBuffers(e.drawBuffers),this._pipeline=e),this._pipelineInvalid=!1}invalidateBlending(){this._blendingInvalid=!0,this._pipelineInvalid=!0}invalidateCulling(){this._cullingInvalid=!0,this._pipelineInvalid=!0}invalidatePolygonOffset(){this._polygonOffsetInvalid=!0,this._pipelineInvalid=!0}invalidateDepthTest(){this._depthTestInvalid=!0,this._pipelineInvalid=!0}invalidateStencilTest(){this._stencilTestInvalid=!0,this._pipelineInvalid=!0}invalidateDepthWrite(){this._depthWriteInvalid=!0,this._pipelineInvalid=!0}invalidateColorWrite(){this._colorWriteInvalid=!0,this._pipelineInvalid=!0}invalidateStencilWrite(){this._stencilTestInvalid=!0,this._pipelineInvalid=!0}invalidateDrawBuffers(){this._drawBuffersInvalid=!0,this._pipelineInvalid=!0}_setBlending(e){this._blending=this._setSubState(e,this._blending,this._blendingInvalid,this._stateSetters.setBlending),this._blendingInvalid=!1}_setCulling(e){this._culling=this._setSubState(e,this._culling,this._cullingInvalid,this._stateSetters.setCulling),this._cullingInvalid=!1}_setPolygonOffset(e){this._polygonOffset=this._setSubState(e,this._polygonOffset,this._polygonOffsetInvalid,this._stateSetters.setPolygonOffset),this._polygonOffsetInvalid=!1}_setDepthTest(e){this._depthTest=this._setSubState(e,this._depthTest,this._depthTestInvalid,this._stateSetters.setDepthTest),this._depthTestInvalid=!1}_setStencilTest(e){this._stencilTest=this._setSubState(e,this._stencilTest,this._stencilTestInvalid,this._stateSetters.setStencilTest),this._stencilTestInvalid=!1}_setDepthWrite(e){this._depthWrite=this._setSubState(e,this._depthWrite,this._depthWriteInvalid,this._stateSetters.setDepthWrite),this._depthWriteInvalid=!1}_setColorWrite(e){this._colorWrite=this._setSubState(e,this._colorWrite,this._colorWriteInvalid,this._stateSetters.setColorWrite),this._colorWriteInvalid=!1}_setStencilWrite(e){this._stencilWrite=this._setSubState(e,this._stencilWrite,this._stencilWriteInvalid,this._stateSetters.setStencilWrite),this._stencilTestInvalid=!1}_setDrawBuffers(e){this._drawBuffers=this._setSubState(e,this._drawBuffers,this._drawBuffersInvalid,this._stateSetters.setDrawBuffers),this._drawBuffersInvalid=!1}_setSubState(e,n,i,h){return(i||e!==n)&&(h(e),this._pipelineInvalid=!0),e}}class J{}const at=J;function d(t,...e){let n="";for(let i=0;it===u.Back?N:t===u.Front?D:null,nt={zNear:0,zFar:1},st={r:!0,g:!0,b:!0,a:!0};function R(t){return L.intern(t)}function y(t){return M.intern(t)}function $(t){return U.intern(t)}function m(t){return H.intern(t)}function F(t){return K.intern(t)}function E(t){return j.intern(t)}function P(t){return x.intern(t)}function k(t){return q.intern(t)}function z(t){return G.intern(t)}function lt(t){return Q.intern(t)}class s{constructor(e,n){this._makeKey=e,this._makeRef=n,this._interns=new Map}intern(e){if(!e)return null;const n=this._makeKey(e),i=this._interns;return i.has(n)||i.set(n,this._makeRef(e)),i.get(n)??null}}function l(t){return"["+t.join(",")+"]"}const L=new s(v,t=>({__tag:"Blending",...t}));function v(t){return t?l([t.srcRgb,t.srcAlpha,t.dstRgb,t.dstAlpha,t.opRgb,t.opAlpha,t.color.r,t.color.g,t.color.b,t.color.a]):null}const M=new s(S,t=>({__tag:"Culling",...t}));function S(t){return t?l([t.face,t.mode]):null}const U=new s(I,t=>({__tag:"PolygonOffset",...t}));function I(t){return t?l([t.factor,t.units]):null}const H=new s(W,t=>({__tag:"DepthTest",...t}));function W(t){return t?l([t.func]):null}const K=new s(b,t=>({__tag:"StencilTest",...t}));function b(t){return t?l([t.function.func,t.function.ref,t.function.mask,t.operation.fail,t.operation.zFail,t.operation.zPass]):null}const j=new s(T,t=>({__tag:"DepthWrite",...t}));function T(t){return t?l([t.zNear,t.zFar]):null}const x=new s(O,t=>({__tag:"ColorWrite",...t}));function O(t){return t?l([t.r,t.g,t.b,t.a]):null}const q=new s(w,t=>({__tag:"StencilWrite",...t}));function w(t){return t?l([t.mask]):null}const G=new s(A,t=>({__tag:"DrawBuffers",...t}));function A(t){return t?l(t.buffers):null}const Q=new s(Z,t=>({blending:R(t.blending),culling:y(t.culling),polygonOffset:$(t.polygonOffset),depthTest:m(t.depthTest),stencilTest:F(t.stencilTest),depthWrite:E(t.depthWrite),colorWrite:P(t.colorWrite),stencilWrite:k(t.stencilWrite),drawBuffers:z(t.drawBuffers)}));function Z(t){return t?l([v(t.blending),S(t.culling),I(t.polygonOffset),W(t.depthTest),b(t.stencilTest),T(t.depthWrite),O(t.colorWrite),w(t.stencilWrite),A(t.drawBuffers)]):null}class rt{constructor(e){this._pipelineInvalid=!0,this._blendingInvalid=!0,this._cullingInvalid=!0,this._polygonOffsetInvalid=!0,this._depthTestInvalid=!0,this._stencilTestInvalid=!0,this._depthWriteInvalid=!0,this._colorWriteInvalid=!0,this._stencilWriteInvalid=!0,this._drawBuffersInvalid=!0,this._stateSetters=e}setPipeline(e){(this._pipelineInvalid||e!==this._pipeline)&&(this._setBlending(e.blending),this._setCulling(e.culling),this._setPolygonOffset(e.polygonOffset),this._setDepthTest(e.depthTest),this._setStencilTest(e.stencilTest),this._setDepthWrite(e.depthWrite),this._setColorWrite(e.colorWrite),this._setStencilWrite(e.stencilWrite),this._setDrawBuffers(e.drawBuffers),this._pipeline=e),this._pipelineInvalid=!1}invalidateBlending(){this._blendingInvalid=!0,this._pipelineInvalid=!0}invalidateCulling(){this._cullingInvalid=!0,this._pipelineInvalid=!0}invalidatePolygonOffset(){this._polygonOffsetInvalid=!0,this._pipelineInvalid=!0}invalidateDepthTest(){this._depthTestInvalid=!0,this._pipelineInvalid=!0}invalidateStencilTest(){this._stencilTestInvalid=!0,this._pipelineInvalid=!0}invalidateDepthWrite(){this._depthWriteInvalid=!0,this._pipelineInvalid=!0}invalidateColorWrite(){this._colorWriteInvalid=!0,this._pipelineInvalid=!0}invalidateStencilWrite(){this._stencilTestInvalid=!0,this._pipelineInvalid=!0}invalidateDrawBuffers(){this._drawBuffersInvalid=!0,this._pipelineInvalid=!0}_setBlending(e){this._blending=this._setSubState(e,this._blending,this._blendingInvalid,this._stateSetters.setBlending),this._blendingInvalid=!1}_setCulling(e){this._culling=this._setSubState(e,this._culling,this._cullingInvalid,this._stateSetters.setCulling),this._cullingInvalid=!1}_setPolygonOffset(e){this._polygonOffset=this._setSubState(e,this._polygonOffset,this._polygonOffsetInvalid,this._stateSetters.setPolygonOffset),this._polygonOffsetInvalid=!1}_setDepthTest(e){this._depthTest=this._setSubState(e,this._depthTest,this._depthTestInvalid,this._stateSetters.setDepthTest),this._depthTestInvalid=!1}_setStencilTest(e){this._stencilTest=this._setSubState(e,this._stencilTest,this._stencilTestInvalid,this._stateSetters.setStencilTest),this._stencilTestInvalid=!1}_setDepthWrite(e){this._depthWrite=this._setSubState(e,this._depthWrite,this._depthWriteInvalid,this._stateSetters.setDepthWrite),this._depthWriteInvalid=!1}_setColorWrite(e){this._colorWrite=this._setSubState(e,this._colorWrite,this._colorWriteInvalid,this._stateSetters.setColorWrite),this._colorWriteInvalid=!1}_setStencilWrite(e){this._stencilWrite=this._setSubState(e,this._stencilWrite,this._stencilWriteInvalid,this._stateSetters.setStencilWrite),this._stencilTestInvalid=!1}_setDrawBuffers(e){this._drawBuffers=this._setSubState(e,this._drawBuffers,this._drawBuffersInvalid,this._stateSetters.setDrawBuffers),this._drawBuffersInvalid=!1}_setSubState(e,n,i,h){return(i||e!==n)&&(h(e),this._pipelineInvalid=!0),e}}class J{}const at=J;function d(t,...e){let n="";for(let i=0;i!!o.field);if(!i)return null;const t=new d;return t.read(i,n),[t]}function u(e,r,n,i){const t=e.find(o=>!!o.field);t&&f(n,[t.toJSON()],r)}const m=e=>{let r=class extends e{constructor(){super(...arguments),this.orderBy=null}};return s([c({type:[d],json:{origins:{"web-scene":{write:!1,read:!1}},read:{source:"layerDefinition.orderBy",reader:l},write:{target:"layerDefinition.orderBy",writer:u}}})],r.prototype,"orderBy",void 0),r=s([a("esri.layers.mixins.OrderedLayer")],r),r};export{m as c}; +import{d as s,y as c,f as a,b1 as f}from"./index-BjUNJPVf.js";import{c as d}from"./OrderByInfo-DKyk5GLW.js";function l(e,r,n){if(!e)return null;const i=e.find(o=>!!o.field);if(!i)return null;const t=new d;return t.read(i,n),[t]}function u(e,r,n,i){const t=e.find(o=>!!o.field);t&&f(n,[t.toJSON()],r)}const m=e=>{let r=class extends e{constructor(){super(...arguments),this.orderBy=null}};return s([c({type:[d],json:{origins:{"web-scene":{write:!1,read:!1}},read:{source:"layerDefinition.orderBy",reader:l},write:{target:"layerDefinition.orderBy",writer:u}}})],r.prototype,"orderBy",void 0),r=s([a("esri.layers.mixins.OrderedLayer")],r),r};export{m as c}; diff --git a/assets/OrientedImageryLayer-Cb-G1CjI.js b/assets/OrientedImageryLayer-DxeUAz8W.js similarity index 91% rename from assets/OrientedImageryLayer-Cb-G1CjI.js rename to assets/OrientedImageryLayer-DxeUAz8W.js index 445f27b..7045131 100644 --- a/assets/OrientedImageryLayer-Cb-G1CjI.js +++ b/assets/OrientedImageryLayer-DxeUAz8W.js @@ -1 +1 @@ -import{d as t,y as e,f as z,a7 as Q,b4 as k,dm as q,aU as G,aY as _,jf as I,e1 as X,N as Z}from"./index-CEWggaxV.js";import tt from"./FeatureLayer-D0kMrROG.js";import"./UniqueValueRenderer-BlkUix3g.js";import"./ColorStop-44hBlQ14.js";import"./diffUtils-B4YFa5Ju.js";import"./colorRamps-BJydlf0f.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-z2k12BH8.js";import"./jsonUtils-qYmXvGJ1.js";import"./styleUtils-CnV_Xzhi.js";import"./jsonUtils-BseLl1fZ.js";import"./Version-Bd0QsIQ5.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./OverrideHelper-B4ryGWZb.js";import"./utils-p-5Bbga5.js";import"./quantizationUtils-CUjGHrU3.js";import"./heatmapUtils-Clt5rJzr.js";import"./FormTemplate-eV18QveB.js";import"./editsZScale-CQCGPEjO.js";import"./queryZScale-DN4aFXYn.js";import"./FeatureSet-CYJUZgOk.js";import"./EditBusLayer-SG7oYwiY.js";import"./FeatureEffectLayer-CLTrRFqx.js";import"./FeatureEffect-ByrbZlne.js";import"./FeatureLayerBase-DPJuwFpX.js";import"./featureLayerUtils-BhDaw8pS.js";import"./AttachmentQuery-D61mmWw4.js";import"./RelationshipQuery-DDK72Kwc.js";import"./LayerFloorInfo-Cdq3ulNh.js";import"./serviceCapabilitiesUtils-t8SL4e_j.js";import"./FeatureReductionLayer-DncGsNIN.js";import"./FeatureReductionSelection-BY3KVXac.js";import"./LabelClass-6cZokw8y.js";import"./labelUtils-Dnqx6jl5.js";import"./defaultsJSON-CHAaurhX.js";import"./MD5-C9MwAd2G.js";import"./OrderedLayer-Do089KpQ.js";import"./OrderByInfo-DKzv2-WS.js";import"./RefreshableLayer-1EkEhJeI.js";import"./TemporalLayer-qq3v_i3q.js";import"./TimeInfo-3TVmpFSA.js";import"./FeatureTemplate-DcprAdTM.js";import"./FeatureType-By3BEr9z.js";import"./fieldProperties-DMs4wT6-.js";import"./labelingInfo-CijajRsc.js";import"./versionUtils-CaceEUVY.js";import"./styleUtils-B_Iy1DTk.js";import"./TopFeaturesQuery-B8kC7n5h.js";import"./popupUtils-DAFYyAvw.js";import"./interfaces-CL2NbQte.js";const et=[2155,2194,2204,2222,2223,2224,2225,2226,2227,2228,2229,2230,2231,2232,2233,2234,2235,2236,2237,2238,2239,2240,2241,2242,2243,2244,2245,2246,2247,2248,2249,2250,2251,2252,2253,2254,2255,2256,2257,2258,2259,2260,2261,2262,2263,2264,2265,2266,2267,2268,2269,2270,2271,2272,2273,2274,2275,2276,2277,2278,2279,2280,2281,2282,2283,2284,2285,2286,2287,2288,2289,2314,2867,2868,2869,2870,2871,2872,2873,2874,2875,2876,2877,2878,2879,2880,2881,2882,2883,2884,2885,2886,2887,2888,2889,2890,2891,2892,2893,2894,2895,2896,2897,2898,2899,2900,2901,2902,2903,2904,2905,2906,2907,2908,2909,2910,2911,2912,2913,2914,2915,2916,2917,2918,2919,2920,2921,2922,2923,2924,2925,2926,2927,2928,2929,2930,2964,2965,2966,2967,2968,2992,2994,3080,3089,3091,3102,3359,3359,3361,3363,3365,3366,3404,3407,3417,3418,3419,3420,3421,3422,3423,3424,3425,3426,3427,3428,3429,3430,3431,3432,3433,3434,3435,3436,3437,3438,3441,3442,3443,3444,3445,3446,3451,3452,3453,3454,3455,3456,3457,3458,3459,3479,3481,3483,3485,3487,3490,3492,3494,3496,3498,3500,3502,3504,3506,3508,3510,3512,3515,3517,3519,3521,3523,3525,3527,3529,3531,3533,3535,3537,3539,3541,3543,3545,3547,3549,3551,3553,3560,3561,3562,3563,3564,3565,3566,3567,3568,3569,3570,3582,3584,3586,3588,3590,3593,3598,3600,3605,3608,3610,3612,3614,3616,3618,3620,3622,3624,3626,3628,3630,3632,3634,3636,3640,3642,3644,3646,3648,3650,3652,3654,3656,3658,3660,3662,3664,3668,3670,3672,3674,3676,3677,3679,3680,3682,3683,3686,3688,3690,3692,3696,3698,3700,3728,3729,3730,3731,3732,3733,3734,3735,3736,3737,3738,3739,3753,3754,3755,3756,3757,3758,3759,3760,3991,3992,4217,4399,4400,4401,4402,4403,4404,4405,4406,4407,4408,4409,4410,4411,4412,4413,4418,4419,4420,4421,4422,4423,4424,4425,4426,4427,4428,4429,4430,4431,4432,4433,4438,4439,4455,4456,4457,5466,5588,5589,5623,5624,5625,5646,5654,5655,6128,6129,6141,6200,6201,6202,6391,6405,6407,6409,6411,6413,6416,6418,6420,6422,6424,6426,6428,6430,6432,6434,6436,6438,6441,6443,6445,6447,6449,6451,6453,6455,6457,6459,6461,6463,6465,6467,6469,6471,6473,6475,6477,6479,6484,6486,6488,6490,6492,6494,6496,6499,6501,6503,6505,6507,6510,6515,6517,6519,6521,6523,6525,6527,6529,6531,6533,6535,6537,6539,6541,6543,6545,6547,6549,6551,6553,6555,6557,6559,6561,6563,6565,6568,6570,6572,6574,6576,6578,6582,6584,6586,6588,6590,6593,6595,6597,6599,6601,6603,6605,6607,6609,6612,6614,6616,6618,6625,6626,6627,6633,6785,6787,6789,6791,6793,6795,6797,6799,6801,6803,6805,6807,6809,6811,6813,6815,6817,6819,6821,6823,6825,6827,6829,6831,6833,6835,6837,6839,6841,6843,6845,6847,6849,6851,6853,6855,6857,6859,6861,6863,6868,6880,6885,6887,6923,6925,6966,6997,7057,7058,7059,7060,7061,7062,7063,7064,7065,7066,7067,7068,7069,7070,7119,7120,7121,7122,7123,7124,7125,7126,7127,7128,7132,7258,7260,7262,7264,7266,7268,7270,7272,7274,7276,7278,7280,7282,7284,7286,7288,7290,7292,7294,7296,7298,7300,7302,7304,7306,7308,7310,7312,7314,7316,7318,7320,7322,7324,7326,7328,7330,7332,7334,7336,7338,7340,7342,7344,7346,7348,7350,7352,7354,7356,7358,7360,7362,7364,7366,7368,7370,7558,7587,7588,7589,7590,7591,7592,7593,7594,7595,7596,7597,7598,7599,7600,7601,7602,7603,7604,7605,7606,7607,7608,7609,7610,7611,7612,7613,7614,7615,7616,7617,7618,7619,7620,7621,7622,7623,7624,7625,7626,7627,7628,7629,7630,7631,7632,7633,7634,7635,7636,7637,7638,7639,7640,7641,7642,7643,7644,7645,24100,26729,26730,26731,26732,26733,26734,26735,26736,26737,26738,26739,26740,26741,26742,26743,26744,26745,26746,26747,26748,26749,26750,26751,26752,26753,26754,26755,26756,26757,26758,26759,26760,26766,26767,26768,26769,26770,26771,26772,26773,26774,26775,26776,26777,26778,26779,26780,26781,26782,26783,26784,26785,26786,26787,26791,26792,26793,26794,26795,26796,26797,26798,26799,26801,26802,26803,26811,26812,26813,26814,26815,26819,26820,26821,26822,26825,26826,26830,26831,26832,26833,26836,26837,26841,26842,26843,26844,26847,26848,26849,26850,26851,26852,26853,26854,26855,26856,26857,26858,26859,26860,26861,26862,26863,26864,26865,26866,26867,26868,26869,26870,32001,32002,32003,32005,32006,32007,32008,32009,32010,32011,32012,32013,32014,32015,32016,32017,32018,32019,32020,32021,32022,32023,32024,32025,32026,32027,32028,32029,32030,32031,32033,32034,32035,32036,32037,32038,32039,32040,32041,32042,32043,32044,32045,32046,32047,32048,32049,32050,32051,32052,32053,32054,32055,32056,32057,32058,32064,32065,32066,32067,32074,32075,32076,32077,32099,32164,32165,32166,32167,32664,32665,32666,32667,65061,102120,102121,102629,102630,102631,102632,102633,102634,102635,102636,102637,102638,102639,102640,102641,102642,102643,102644,102645,102646,102648,102649,102650,102651,102652,102653,102654,102655,102656,102657,102658,102659,102660,102661,102662,102663,102664,102665,102666,102667,102668,102669,102670,102671,102672,102673,102674,102675,102676,102677,102678,102679,102680,102681,102682,102683,102684,102685,102686,102687,102688,102689,102690,102691,102692,102693,102694,102695,102696,102697,102698,102700,102704,102707,102708,102709,102710,102711,102712,102713,102714,102715,102716,102717,102718,102719,102720,102721,102722,102723,102724,102725,102726,102727,102728,102729,102730,102733,102734,102735,102736,102737,102738,102739,102740,102741,102742,102743,102744,102745,102746,102747,102748,102749,102750,102751,102752,102753,102754,102755,102756,102757,102758,102761,102766],it=[5614,5702,6130,6131,6132,6358,6359,6360],ot=[115700,4326];function J(i){return et.includes(i)?"feet":"meters"}function rt(i,o){return typeof i=="number"?it.includes(i)?"feet":"meters":J(o)}function nt(i,o){return i&&ot.includes(i)||o===4326?"ellipsoidal":"gravity-related-height"}let N=class extends Q{constructor(){super(...arguments),this.verticalWKID=null}get isAdvanced(){const{affineTransformations:o,focalLength:r,principalOffsetPoint:n,radialDistortionCoefficients:l,tangentialDistortionCoefficients:u}=this;return(o==null?void 0:o.length)>1&&!Number.isNaN(r)&&(n==null?void 0:n.length)>1&&(l==null?void 0:l.length)>1&&(u==null?void 0:u.length)>1}get unitAndHeightInfo(){const{horizontalWKID:o,verticalWKID:r}=this;let n=o,l=r;const u=this;if(u.type===4){const{properties:g}=u;n=4326,l=g.verticalWKID}return{heightModel:nt(l,n),heightUnit:rt(l,n),horizontalUnit:J(n)}}};t([e({json:{write:!0}})],N.prototype,"affineTransformations",void 0),t([e({json:{write:!0}})],N.prototype,"focalLength",void 0),t([e({json:{write:!0}})],N.prototype,"principalOffsetPoint",void 0),t([e({json:{write:!0}})],N.prototype,"radialDistortionCoefficients",void 0),t([e({json:{write:!0}})],N.prototype,"tangentialDistortionCoefficients",void 0),t([e({json:{write:!0}})],N.prototype,"horizontalWKID",void 0),t([e({json:{write:!0}})],N.prototype,"verticalWKID",void 0),t([e({json:{write:!0}})],N.prototype,"x",void 0),t([e({json:{write:!0}})],N.prototype,"y",void 0),t([e({json:{write:!0}})],N.prototype,"z",void 0),t([e({json:{write:!0}})],N.prototype,"type",void 0),t([e({readOnly:!0})],N.prototype,"unitAndHeightInfo",null),N=t([z("esri.layers.orientedImagery.core.CameraOrientation")],N);const B=N;let d=class extends k(q(B)){constructor(){super(...arguments),this.type=1}toString(){const{type:o,horizontalWKID:r,verticalWKID:n,x:l,y:u,z:g,heading:P,pitch:x,roll:b,affineTransformations:j,focalLength:D,principalOffsetPoint:m,radialDistortionCoefficients:f,tangentialDistortionCoefficients:c}=this,p=[o,r,n,l,u,g,P,x,b];return this.isAdvanced&&(j==null||j.forEach(s=>p.push(s)),p.push(D),m==null||m.forEach(s=>p.push(s)),f==null||f.forEach(s=>p.push(s)),c==null||c.forEach(s=>p.push(s))),p.map(s=>Number.isNaN(s)?"":s).join("|")}};t([e({json:{write:!0}})],d.prototype,"type",void 0),t([e({type:[Number],json:{write:!0}})],d.prototype,"affineTransformations",void 0),t([e({type:Number,json:{write:!0}})],d.prototype,"focalLength",void 0),t([e({type:[Number],json:{write:!0}})],d.prototype,"principalOffsetPoint",void 0),t([e({type:[Number],json:{write:!0}})],d.prototype,"radialDistortionCoefficients",void 0),t([e({type:[Number],json:{write:!0}})],d.prototype,"tangentialDistortionCoefficients",void 0),t([e({type:Number,json:{write:!0}})],d.prototype,"heading",void 0),t([e({type:Number,json:{write:!0}})],d.prototype,"pitch",void 0),t([e({type:Number,json:{write:!0}})],d.prototype,"roll",void 0),t([e({type:Number,json:{write:!0}})],d.prototype,"horizontalWKID",void 0),t([e({type:Number,json:{write:!0}})],d.prototype,"verticalWKID",void 0),t([e({type:Number,json:{write:!0}})],d.prototype,"x",void 0),t([e({type:Number,json:{write:!0}})],d.prototype,"y",void 0),t([e({type:Number,json:{write:!0}})],d.prototype,"z",void 0),d=t([z("esri.layers.orientedImagery.core.CameraOrientationHPR")],d);const at=d;let h=class extends k(q(B)){constructor(){super(...arguments),this.type=2,this.verticalWKID=null}toString(){const{type:i,horizontalWKID:o,verticalWKID:r,x:n,y:l,z:u,omega:g,phi:P,kappa:x,affineTransformations:b,focalLength:j,principalOffsetPoint:D,radialDistortionCoefficients:m,tangentialDistortionCoefficients:f}=this,c=[i,o,r,n,l,u,g,P,x];return this.isAdvanced&&(b==null||b.forEach(p=>c.push(p)),c.push(j),D==null||D.forEach(p=>c.push(p)),m==null||m.forEach(p=>c.push(p)),f==null||f.forEach(p=>c.push(p))),c.map(p=>isNaN(p)?"":p).join("|")}};t([e({json:{write:!0}})],h.prototype,"type",void 0),t([e({type:[Number],json:{write:!0}})],h.prototype,"affineTransformations",void 0),t([e({type:Number,json:{write:!0}})],h.prototype,"focalLength",void 0),t([e({type:[Number],json:{write:!0}})],h.prototype,"principalOffsetPoint",void 0),t([e({type:[Number],json:{write:!0}})],h.prototype,"radialDistortionCoefficients",void 0),t([e({type:[Number],json:{write:!0}})],h.prototype,"tangentialDistortionCoefficients",void 0),t([e({type:Number,json:{write:!0}})],h.prototype,"omega",void 0),t([e({type:Number,json:{write:!0}})],h.prototype,"phi",void 0),t([e({type:Number,json:{write:!0}})],h.prototype,"kappa",void 0),t([e({type:Number,json:{write:!0}})],h.prototype,"horizontalWKID",void 0),t([e({type:Number,json:{write:!0}})],h.prototype,"verticalWKID",void 0),t([e({type:Number,json:{write:!0}})],h.prototype,"x",void 0),t([e({type:Number,json:{write:!0}})],h.prototype,"y",void 0),t([e({type:Number,json:{write:!0}})],h.prototype,"z",void 0),h=t([z("esri.layers.orientedImagery.core.CameraOrientationOPK")],h);const pt=h;let v=class extends k(q(B)){constructor(){super(...arguments),this.type=3}get isAdvanced(){const{affineTransformations:o,focalLength:r,principalOffsetPoint:n,radialDistortionCoefficients:l,tangentialDistortionCoefficients:u}=this;return(o==null?void 0:o.length)>1||!Number.isNaN(r)||(n==null?void 0:n.length)>1||(l==null?void 0:l.length)>1||(u==null?void 0:u.length)>1}toString(){const{type:o,horizontalWKID:r,verticalWKID:n,x:l,y:u,z:g,yaw:P,pitch:x,roll:b,affineTransformations:j,focalLength:D,principalOffsetPoint:m,radialDistortionCoefficients:f,tangentialDistortionCoefficients:c}=this,p=[o,r,n,l,u,g,P,x,b];return this.isAdvanced&&(j==null||j.forEach(s=>p.push(s)),p.push(D),m==null||m.forEach(s=>p.push(s)),m==null||m.forEach(s=>p.push(s)),f==null||f.forEach(s=>p.push(s)),c==null||c.forEach(s=>p.push(s))),p.map(s=>Number.isNaN(s)?"":s).join("|")}};t([e({json:{write:!0}})],v.prototype,"type",void 0),t([e({type:[Number],json:{write:!0}})],v.prototype,"affineTransformations",void 0),t([e({type:Number,json:{write:!0}})],v.prototype,"focalLength",void 0),t([e({type:[Number],json:{write:!0}})],v.prototype,"principalOffsetPoint",void 0),t([e({type:[Number],json:{write:!0}})],v.prototype,"radialDistortionCoefficients",void 0),t([e({type:[Number],json:{write:!0}})],v.prototype,"tangentialDistortionCoefficients",void 0),t([e({type:Number,json:{write:!0}})],v.prototype,"yaw",void 0),t([e({type:Number,json:{write:!0}})],v.prototype,"pitch",void 0),t([e({type:Number,json:{write:!0}})],v.prototype,"roll",void 0),t([e({type:Number,json:{write:!0}})],v.prototype,"horizontalWKID",void 0),t([e({type:Number,json:{write:!0}})],v.prototype,"verticalWKID",void 0),t([e({type:Number,json:{write:!0}})],v.prototype,"x",void 0),t([e({type:Number,json:{write:!0}})],v.prototype,"y",void 0),t([e({type:Number,json:{write:!0}})],v.prototype,"z",void 0),v=t([z("esri.layers.orientedImagery.core.CameraOrientationYPR")],v);const st=v;let W=class extends G{constructor(){super(...arguments),this.url=null}};t([e({type:Number,json:{write:!0}})],W.prototype,"lod",void 0),t([e({type:String,json:{write:!0}})],W.prototype,"rasterFunction",void 0),t([e({type:String,json:{write:!0}})],W.prototype,"url",void 0),W=t([z("esri.layers.orientedImagery.core.ElevationSourceDefinitions.ElevationSource")],W);let A=class extends G{constructor(){super(...arguments),this.constantElevation=null}};t([e({type:Number,json:{write:!0}})],A.prototype,"constantElevation",void 0),A=t([z("esri.layers.orientedImagery.cor.ElevationSourceDefinitions.ConstantElevation")],A);const lt=i=>i!=null&&"constantElevation"in i&&typeof i.constantElevation=="number";var O;(function(i){i[i.HPR=1]="HPR",i[i.OPK=2]="OPK",i[i.YPR=3]="YPR",i[i.LTP=4]="LTP"})(O||(O={}));function ut(i,o,r){return o&&(i=`${o}${i}`),r&&(i+=`${r}`),i}function yt(i,o,r){let{url:n}=i;return n?(n=ut(n,o,r),new W({...i,url:n})):null}function mt(i,o,r){return i&&(lt(i)?new A(i):yt(i,o,r))}const V=new _({Minutes:"minutes",Hours:"hours",Days:"days",Weeks:"weeks",Months:"months",Years:"years"}),F=new _({360:"360",Horizontal:"horizontal",Inspection:"inspection",Nadir:"nadir",Oblique:"oblique","":null}),Y=new Map;Y.set(`${O.OPK}`,{desc:"Using Omega Phi Kappa",constructor:pt}),Y.set(`${O.HPR}`,{desc:"Using Heading, Pitch and Roll",constructor:at}),Y.set(`${O.YPR}`,{desc:"Using Yaw, Pitch and Roll",constructor:st});const M=new Map;function ct(i){const[o,r,n,l,u,g,P,x,b,j,D,m,f,c,p,s,E,L,T,R,H,U]=i.slice(1),$=[b,j,D,m,f,c].map(w=>Number(w)),S=[s,E].map(w=>Number(w)),K=[L,T,R].map(w=>Number(w)),C=[H,U].map(w=>Number(w));return{horizontalWKID:o,verticalWKID:r,x:n,y:l,z:u,omega:g,phi:P,kappa:x,affineTransformations:$.filter(I).length===6?$:null,focalLength:p,principalOffsetPoint:S.filter(I).length!==2?null:S,radialDistortionCoefficients:K.filter(I).length!==3?[0,0,0]:K,tangentialDistortionCoefficients:C.filter(I).length!==2?[0,0]:C}}function ft(i){const[o,r,n,l,u,g,P,x,b,j,D,m,f,c,p,s,E,L,T,R,H,U]=i.slice(1),$=[b,j,D,m,f,c].map(w=>Number(w)),S=[s,E].map(w=>Number(w)),K=[L,T,R],C=[H,U];return{horizontalWKID:o,verticalWKID:r,x:n,y:l,z:u,heading:g,pitch:P,roll:x,affineTransformations:$.filter(I).length===6?$:null,focalLength:p,principalOffsetPoint:S.filter(I).length!==2?null:S,radialDistortionCoefficients:K.filter(I).length!==3?null:K,tangentialDistortionCoefficients:C.filter(I).length!==2?null:C}}function dt(i){const[o,r,n,l,u,g,P,x,b,j,D,m,f,c,p,s,E,L,T,R,H,U]=i.slice(1),$=[b,j,D,m,f,c].map(w=>Number(w)),S=[s,E].map(w=>Number(w)),K=[L,T,R],C=[H,U];return{horizontalWKID:o,verticalWKID:r,x:n,y:l,z:u,yaw:g,pitch:P,roll:x,affineTransformations:$.filter(I).length===6?$:null,focalLength:p,principalOffsetPoint:S.filter(I).length!==2?null:S,radialDistortionCoefficients:K.filter(I).length!==3?null:K,tangentialDistortionCoefficients:C.filter(I).length!==2?null:C}}function ht(i){const[o,r,n,l,u,...g]=i.slice(1),P=M.get(u);return P?{latitude:o,longitude:r,ellipsoidRadius:n,squaredEccentricity:l,properties:P([u,"",...g])}:null}M.set(`${O.HPR}`,ft),M.set(`${O.YPR}`,dt),M.set(`${O.OPK}`,ct),M.set(`${O.LTP}`,ht);function y(i,o,r){return{name:`orientedImageryProperties.${i}`,write:!o||{target:`orientedImageryProperties.${i}`,writer:o},origins:{service:{name:`orientedImageryInfo.orientedImageryProperties.${i}`,write:o,read:r}}}}let a=class extends tt{constructor(){super(...arguments),this.cameraHeading=null,this.cameraHeight=null,this.cameraPitch=null,this.cameraRoll=null,this.coveragePercent=null,this.demPathPrefix=null,this.demPathSuffix=null,this.depthImagePathPrefix=null,this.depthImagePathSuffix=null,this.elevationSource=null,this.farDistance=null,this.geometryType="point",this.horizontalFieldOfView=null,this.horizontalMeasurementUnit=null,this.imagePathPrefix=null,this.imagePathSuffix=null,this.imageRotation=null,this.maximumDistance=null,this.nearDistance=null,this.operationalLayerType="OrientedImageryLayer",this.orientationAccuracy=null,this.orientedImageryType=null,this.type="oriented-imagery",this.timeIntervalUnit=null,this.verticalFieldOfView=null,this.verticalMeasurementUnit=null,this.videoPathPrefix=null,this.videoPathSuffix=null}get effectiveElevationSource(){const{elevationSource:i,demPathPrefix:o,demPathSuffix:r}=this;return mt(i,o,r)}findFirstValidLayerId(i){var o,r;return(r=(o=i.layers)==null?void 0:o.find(n=>n.type==="Oriented Imagery Layer"))==null?void 0:r.id}_verifySource(){if(super._verifySource(),this.geometryType!=="point")throw new Z("oriented-imagery-layer:invalid-geometry-type","OrientedImageryLayer only supports point geometry type")}};t([e({type:Number,json:y("cameraHeading")})],a.prototype,"cameraHeading",void 0),t([e({type:Number,json:y("cameraHeight")})],a.prototype,"cameraHeight",void 0),t([e({type:Number,json:y("cameraPitch")})],a.prototype,"cameraPitch",void 0),t([e({type:Number,json:y("cameraRoll")})],a.prototype,"cameraRoll",void 0),t([e({type:Number,json:y("coveragePercent")})],a.prototype,"coveragePercent",void 0),t([e({type:String,json:y("demPathPrefix")})],a.prototype,"demPathPrefix",void 0),t([e({type:String,json:y("demPathSuffix")})],a.prototype,"demPathSuffix",void 0),t([e({type:String,json:y("depthImagePathPrefix")})],a.prototype,"depthImagePathPrefix",void 0),t([e({type:String,json:y("depthImagePathSuffix")})],a.prototype,"depthImagePathSuffix",void 0),t([e({type:Object,json:y("elevationSource")})],a.prototype,"elevationSource",void 0),t([e()],a.prototype,"effectiveElevationSource",null),t([e({type:Number,json:y("farDistance")})],a.prototype,"farDistance",void 0),t([e({json:{write:!0}})],a.prototype,"geometryType",void 0),t([e({type:Number,json:y("horizontalFieldOfView")})],a.prototype,"horizontalFieldOfView",void 0),t([e({type:String,json:y("horizontalMeasurementUnit")})],a.prototype,"horizontalMeasurementUnit",void 0),t([e({type:String,json:y("imagePathPrefix")})],a.prototype,"imagePathPrefix",void 0),t([e({type:String,json:y("imagePathSuffix")})],a.prototype,"imagePathSuffix",void 0),t([e({type:Number,json:y("imageRotation")})],a.prototype,"imageRotation",void 0),t([e({type:Number,json:y("maximumDistance")})],a.prototype,"maximumDistance",void 0),t([e({type:Number,json:y("nearDistance")})],a.prototype,"nearDistance",void 0),t([e({type:["OrientedImageryLayer"]})],a.prototype,"operationalLayerType",void 0),t([e({json:y("orientationAccuracy",(i,o)=>{i&&(o.orientationAccuracy=i.join(","))})}),X(i=>i?i.trim().split(",").map(Number):null)],a.prototype,"orientationAccuracy",void 0),t([e({json:{...y("orientedImageryType",F.write,F.read),type:F.apiValues}})],a.prototype,"orientedImageryType",void 0),t([e({json:{read:!1},value:"oriented-imagery",readOnly:!0})],a.prototype,"type",void 0),t([e({json:{...y("timeIntervalUnit",V.write,V.read),type:V.apiValues}})],a.prototype,"timeIntervalUnit",void 0),t([e({type:Number,json:y("verticalFieldOfView")})],a.prototype,"verticalFieldOfView",void 0),t([e({json:{...y("verticalMeasurementUnit"),type:new _({Feet:"feet",Meter:"meter"}).apiValues}})],a.prototype,"verticalMeasurementUnit",void 0),t([e({type:String,json:y("videoPathPrefix")})],a.prototype,"videoPathPrefix",void 0),t([e({type:String,json:y("videoPathSuffix")})],a.prototype,"videoPathSuffix",void 0),a=t([z("esri.layers.OrientedImageryLayer")],a);const ge=a;export{ge as default}; +import{d as t,y as e,f as z,a7 as Q,b4 as k,dm as q,aU as G,aY as _,jf as I,e1 as X,N as Z}from"./index-BjUNJPVf.js";import tt from"./FeatureLayer-BHxNIHhy.js";import"./UniqueValueRenderer-7V9Bhr-D.js";import"./ColorStop-DCGjAKLC.js";import"./diffUtils-uUoMDFQS.js";import"./colorRamps-CcakIWlU.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-BX9G5gNQ.js";import"./jsonUtils-Ox5U0P0F.js";import"./styleUtils-DOUOskVZ.js";import"./jsonUtils-Dw332y6z.js";import"./Version-Dqq_CHBG.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./OverrideHelper-DxFZBnGL.js";import"./utils-CuXO_Zzq.js";import"./quantizationUtils-CfV316jZ.js";import"./heatmapUtils-BSteZBTj.js";import"./FormTemplate-BGxtsGX6.js";import"./editsZScale-Bfe6gH1b.js";import"./queryZScale-Dwvn5BlQ.js";import"./FeatureSet-opEn8ou8.js";import"./EditBusLayer-OslMX9fF.js";import"./FeatureEffectLayer-DarO4Ctx.js";import"./FeatureEffect-DBbkrS6j.js";import"./FeatureLayerBase-D0I-Escx.js";import"./featureLayerUtils-lwqyOSrl.js";import"./AttachmentQuery-DmEAIZff.js";import"./RelationshipQuery-BDJrOxaX.js";import"./LayerFloorInfo-DlYNbO-A.js";import"./serviceCapabilitiesUtils-DiP90Uds.js";import"./FeatureReductionLayer-CK-tyM-9.js";import"./FeatureReductionSelection-t3T7oa8H.js";import"./LabelClass-CeatfK8u.js";import"./labelUtils-3p0-m-Ee.js";import"./defaultsJSON-CHAaurhX.js";import"./MD5-C9MwAd2G.js";import"./OrderedLayer-dLoPhxcx.js";import"./OrderByInfo-DKyk5GLW.js";import"./RefreshableLayer-_r2TPtol.js";import"./TemporalLayer-CKICYnEl.js";import"./TimeInfo-DooETFWC.js";import"./FeatureTemplate-FZNGA_Ik.js";import"./FeatureType-CwUl8Nf5.js";import"./fieldProperties-DnrQXLBM.js";import"./labelingInfo-DqAUis6e.js";import"./versionUtils-BIAEZzrm.js";import"./styleUtils--I7zqeL6.js";import"./TopFeaturesQuery-CVQjqlfM.js";import"./popupUtils-DlZin22m.js";import"./interfaces-CL2NbQte.js";const et=[2155,2194,2204,2222,2223,2224,2225,2226,2227,2228,2229,2230,2231,2232,2233,2234,2235,2236,2237,2238,2239,2240,2241,2242,2243,2244,2245,2246,2247,2248,2249,2250,2251,2252,2253,2254,2255,2256,2257,2258,2259,2260,2261,2262,2263,2264,2265,2266,2267,2268,2269,2270,2271,2272,2273,2274,2275,2276,2277,2278,2279,2280,2281,2282,2283,2284,2285,2286,2287,2288,2289,2314,2867,2868,2869,2870,2871,2872,2873,2874,2875,2876,2877,2878,2879,2880,2881,2882,2883,2884,2885,2886,2887,2888,2889,2890,2891,2892,2893,2894,2895,2896,2897,2898,2899,2900,2901,2902,2903,2904,2905,2906,2907,2908,2909,2910,2911,2912,2913,2914,2915,2916,2917,2918,2919,2920,2921,2922,2923,2924,2925,2926,2927,2928,2929,2930,2964,2965,2966,2967,2968,2992,2994,3080,3089,3091,3102,3359,3359,3361,3363,3365,3366,3404,3407,3417,3418,3419,3420,3421,3422,3423,3424,3425,3426,3427,3428,3429,3430,3431,3432,3433,3434,3435,3436,3437,3438,3441,3442,3443,3444,3445,3446,3451,3452,3453,3454,3455,3456,3457,3458,3459,3479,3481,3483,3485,3487,3490,3492,3494,3496,3498,3500,3502,3504,3506,3508,3510,3512,3515,3517,3519,3521,3523,3525,3527,3529,3531,3533,3535,3537,3539,3541,3543,3545,3547,3549,3551,3553,3560,3561,3562,3563,3564,3565,3566,3567,3568,3569,3570,3582,3584,3586,3588,3590,3593,3598,3600,3605,3608,3610,3612,3614,3616,3618,3620,3622,3624,3626,3628,3630,3632,3634,3636,3640,3642,3644,3646,3648,3650,3652,3654,3656,3658,3660,3662,3664,3668,3670,3672,3674,3676,3677,3679,3680,3682,3683,3686,3688,3690,3692,3696,3698,3700,3728,3729,3730,3731,3732,3733,3734,3735,3736,3737,3738,3739,3753,3754,3755,3756,3757,3758,3759,3760,3991,3992,4217,4399,4400,4401,4402,4403,4404,4405,4406,4407,4408,4409,4410,4411,4412,4413,4418,4419,4420,4421,4422,4423,4424,4425,4426,4427,4428,4429,4430,4431,4432,4433,4438,4439,4455,4456,4457,5466,5588,5589,5623,5624,5625,5646,5654,5655,6128,6129,6141,6200,6201,6202,6391,6405,6407,6409,6411,6413,6416,6418,6420,6422,6424,6426,6428,6430,6432,6434,6436,6438,6441,6443,6445,6447,6449,6451,6453,6455,6457,6459,6461,6463,6465,6467,6469,6471,6473,6475,6477,6479,6484,6486,6488,6490,6492,6494,6496,6499,6501,6503,6505,6507,6510,6515,6517,6519,6521,6523,6525,6527,6529,6531,6533,6535,6537,6539,6541,6543,6545,6547,6549,6551,6553,6555,6557,6559,6561,6563,6565,6568,6570,6572,6574,6576,6578,6582,6584,6586,6588,6590,6593,6595,6597,6599,6601,6603,6605,6607,6609,6612,6614,6616,6618,6625,6626,6627,6633,6785,6787,6789,6791,6793,6795,6797,6799,6801,6803,6805,6807,6809,6811,6813,6815,6817,6819,6821,6823,6825,6827,6829,6831,6833,6835,6837,6839,6841,6843,6845,6847,6849,6851,6853,6855,6857,6859,6861,6863,6868,6880,6885,6887,6923,6925,6966,6997,7057,7058,7059,7060,7061,7062,7063,7064,7065,7066,7067,7068,7069,7070,7119,7120,7121,7122,7123,7124,7125,7126,7127,7128,7132,7258,7260,7262,7264,7266,7268,7270,7272,7274,7276,7278,7280,7282,7284,7286,7288,7290,7292,7294,7296,7298,7300,7302,7304,7306,7308,7310,7312,7314,7316,7318,7320,7322,7324,7326,7328,7330,7332,7334,7336,7338,7340,7342,7344,7346,7348,7350,7352,7354,7356,7358,7360,7362,7364,7366,7368,7370,7558,7587,7588,7589,7590,7591,7592,7593,7594,7595,7596,7597,7598,7599,7600,7601,7602,7603,7604,7605,7606,7607,7608,7609,7610,7611,7612,7613,7614,7615,7616,7617,7618,7619,7620,7621,7622,7623,7624,7625,7626,7627,7628,7629,7630,7631,7632,7633,7634,7635,7636,7637,7638,7639,7640,7641,7642,7643,7644,7645,24100,26729,26730,26731,26732,26733,26734,26735,26736,26737,26738,26739,26740,26741,26742,26743,26744,26745,26746,26747,26748,26749,26750,26751,26752,26753,26754,26755,26756,26757,26758,26759,26760,26766,26767,26768,26769,26770,26771,26772,26773,26774,26775,26776,26777,26778,26779,26780,26781,26782,26783,26784,26785,26786,26787,26791,26792,26793,26794,26795,26796,26797,26798,26799,26801,26802,26803,26811,26812,26813,26814,26815,26819,26820,26821,26822,26825,26826,26830,26831,26832,26833,26836,26837,26841,26842,26843,26844,26847,26848,26849,26850,26851,26852,26853,26854,26855,26856,26857,26858,26859,26860,26861,26862,26863,26864,26865,26866,26867,26868,26869,26870,32001,32002,32003,32005,32006,32007,32008,32009,32010,32011,32012,32013,32014,32015,32016,32017,32018,32019,32020,32021,32022,32023,32024,32025,32026,32027,32028,32029,32030,32031,32033,32034,32035,32036,32037,32038,32039,32040,32041,32042,32043,32044,32045,32046,32047,32048,32049,32050,32051,32052,32053,32054,32055,32056,32057,32058,32064,32065,32066,32067,32074,32075,32076,32077,32099,32164,32165,32166,32167,32664,32665,32666,32667,65061,102120,102121,102629,102630,102631,102632,102633,102634,102635,102636,102637,102638,102639,102640,102641,102642,102643,102644,102645,102646,102648,102649,102650,102651,102652,102653,102654,102655,102656,102657,102658,102659,102660,102661,102662,102663,102664,102665,102666,102667,102668,102669,102670,102671,102672,102673,102674,102675,102676,102677,102678,102679,102680,102681,102682,102683,102684,102685,102686,102687,102688,102689,102690,102691,102692,102693,102694,102695,102696,102697,102698,102700,102704,102707,102708,102709,102710,102711,102712,102713,102714,102715,102716,102717,102718,102719,102720,102721,102722,102723,102724,102725,102726,102727,102728,102729,102730,102733,102734,102735,102736,102737,102738,102739,102740,102741,102742,102743,102744,102745,102746,102747,102748,102749,102750,102751,102752,102753,102754,102755,102756,102757,102758,102761,102766],it=[5614,5702,6130,6131,6132,6358,6359,6360],ot=[115700,4326];function J(i){return et.includes(i)?"feet":"meters"}function rt(i,o){return typeof i=="number"?it.includes(i)?"feet":"meters":J(o)}function nt(i,o){return i&&ot.includes(i)||o===4326?"ellipsoidal":"gravity-related-height"}let N=class extends Q{constructor(){super(...arguments),this.verticalWKID=null}get isAdvanced(){const{affineTransformations:o,focalLength:r,principalOffsetPoint:n,radialDistortionCoefficients:l,tangentialDistortionCoefficients:u}=this;return(o==null?void 0:o.length)>1&&!Number.isNaN(r)&&(n==null?void 0:n.length)>1&&(l==null?void 0:l.length)>1&&(u==null?void 0:u.length)>1}get unitAndHeightInfo(){const{horizontalWKID:o,verticalWKID:r}=this;let n=o,l=r;const u=this;if(u.type===4){const{properties:g}=u;n=4326,l=g.verticalWKID}return{heightModel:nt(l,n),heightUnit:rt(l,n),horizontalUnit:J(n)}}};t([e({json:{write:!0}})],N.prototype,"affineTransformations",void 0),t([e({json:{write:!0}})],N.prototype,"focalLength",void 0),t([e({json:{write:!0}})],N.prototype,"principalOffsetPoint",void 0),t([e({json:{write:!0}})],N.prototype,"radialDistortionCoefficients",void 0),t([e({json:{write:!0}})],N.prototype,"tangentialDistortionCoefficients",void 0),t([e({json:{write:!0}})],N.prototype,"horizontalWKID",void 0),t([e({json:{write:!0}})],N.prototype,"verticalWKID",void 0),t([e({json:{write:!0}})],N.prototype,"x",void 0),t([e({json:{write:!0}})],N.prototype,"y",void 0),t([e({json:{write:!0}})],N.prototype,"z",void 0),t([e({json:{write:!0}})],N.prototype,"type",void 0),t([e({readOnly:!0})],N.prototype,"unitAndHeightInfo",null),N=t([z("esri.layers.orientedImagery.core.CameraOrientation")],N);const B=N;let d=class extends k(q(B)){constructor(){super(...arguments),this.type=1}toString(){const{type:o,horizontalWKID:r,verticalWKID:n,x:l,y:u,z:g,heading:P,pitch:x,roll:b,affineTransformations:j,focalLength:D,principalOffsetPoint:m,radialDistortionCoefficients:f,tangentialDistortionCoefficients:c}=this,p=[o,r,n,l,u,g,P,x,b];return this.isAdvanced&&(j==null||j.forEach(s=>p.push(s)),p.push(D),m==null||m.forEach(s=>p.push(s)),f==null||f.forEach(s=>p.push(s)),c==null||c.forEach(s=>p.push(s))),p.map(s=>Number.isNaN(s)?"":s).join("|")}};t([e({json:{write:!0}})],d.prototype,"type",void 0),t([e({type:[Number],json:{write:!0}})],d.prototype,"affineTransformations",void 0),t([e({type:Number,json:{write:!0}})],d.prototype,"focalLength",void 0),t([e({type:[Number],json:{write:!0}})],d.prototype,"principalOffsetPoint",void 0),t([e({type:[Number],json:{write:!0}})],d.prototype,"radialDistortionCoefficients",void 0),t([e({type:[Number],json:{write:!0}})],d.prototype,"tangentialDistortionCoefficients",void 0),t([e({type:Number,json:{write:!0}})],d.prototype,"heading",void 0),t([e({type:Number,json:{write:!0}})],d.prototype,"pitch",void 0),t([e({type:Number,json:{write:!0}})],d.prototype,"roll",void 0),t([e({type:Number,json:{write:!0}})],d.prototype,"horizontalWKID",void 0),t([e({type:Number,json:{write:!0}})],d.prototype,"verticalWKID",void 0),t([e({type:Number,json:{write:!0}})],d.prototype,"x",void 0),t([e({type:Number,json:{write:!0}})],d.prototype,"y",void 0),t([e({type:Number,json:{write:!0}})],d.prototype,"z",void 0),d=t([z("esri.layers.orientedImagery.core.CameraOrientationHPR")],d);const at=d;let h=class extends k(q(B)){constructor(){super(...arguments),this.type=2,this.verticalWKID=null}toString(){const{type:i,horizontalWKID:o,verticalWKID:r,x:n,y:l,z:u,omega:g,phi:P,kappa:x,affineTransformations:b,focalLength:j,principalOffsetPoint:D,radialDistortionCoefficients:m,tangentialDistortionCoefficients:f}=this,c=[i,o,r,n,l,u,g,P,x];return this.isAdvanced&&(b==null||b.forEach(p=>c.push(p)),c.push(j),D==null||D.forEach(p=>c.push(p)),m==null||m.forEach(p=>c.push(p)),f==null||f.forEach(p=>c.push(p))),c.map(p=>isNaN(p)?"":p).join("|")}};t([e({json:{write:!0}})],h.prototype,"type",void 0),t([e({type:[Number],json:{write:!0}})],h.prototype,"affineTransformations",void 0),t([e({type:Number,json:{write:!0}})],h.prototype,"focalLength",void 0),t([e({type:[Number],json:{write:!0}})],h.prototype,"principalOffsetPoint",void 0),t([e({type:[Number],json:{write:!0}})],h.prototype,"radialDistortionCoefficients",void 0),t([e({type:[Number],json:{write:!0}})],h.prototype,"tangentialDistortionCoefficients",void 0),t([e({type:Number,json:{write:!0}})],h.prototype,"omega",void 0),t([e({type:Number,json:{write:!0}})],h.prototype,"phi",void 0),t([e({type:Number,json:{write:!0}})],h.prototype,"kappa",void 0),t([e({type:Number,json:{write:!0}})],h.prototype,"horizontalWKID",void 0),t([e({type:Number,json:{write:!0}})],h.prototype,"verticalWKID",void 0),t([e({type:Number,json:{write:!0}})],h.prototype,"x",void 0),t([e({type:Number,json:{write:!0}})],h.prototype,"y",void 0),t([e({type:Number,json:{write:!0}})],h.prototype,"z",void 0),h=t([z("esri.layers.orientedImagery.core.CameraOrientationOPK")],h);const pt=h;let v=class extends k(q(B)){constructor(){super(...arguments),this.type=3}get isAdvanced(){const{affineTransformations:o,focalLength:r,principalOffsetPoint:n,radialDistortionCoefficients:l,tangentialDistortionCoefficients:u}=this;return(o==null?void 0:o.length)>1||!Number.isNaN(r)||(n==null?void 0:n.length)>1||(l==null?void 0:l.length)>1||(u==null?void 0:u.length)>1}toString(){const{type:o,horizontalWKID:r,verticalWKID:n,x:l,y:u,z:g,yaw:P,pitch:x,roll:b,affineTransformations:j,focalLength:D,principalOffsetPoint:m,radialDistortionCoefficients:f,tangentialDistortionCoefficients:c}=this,p=[o,r,n,l,u,g,P,x,b];return this.isAdvanced&&(j==null||j.forEach(s=>p.push(s)),p.push(D),m==null||m.forEach(s=>p.push(s)),m==null||m.forEach(s=>p.push(s)),f==null||f.forEach(s=>p.push(s)),c==null||c.forEach(s=>p.push(s))),p.map(s=>Number.isNaN(s)?"":s).join("|")}};t([e({json:{write:!0}})],v.prototype,"type",void 0),t([e({type:[Number],json:{write:!0}})],v.prototype,"affineTransformations",void 0),t([e({type:Number,json:{write:!0}})],v.prototype,"focalLength",void 0),t([e({type:[Number],json:{write:!0}})],v.prototype,"principalOffsetPoint",void 0),t([e({type:[Number],json:{write:!0}})],v.prototype,"radialDistortionCoefficients",void 0),t([e({type:[Number],json:{write:!0}})],v.prototype,"tangentialDistortionCoefficients",void 0),t([e({type:Number,json:{write:!0}})],v.prototype,"yaw",void 0),t([e({type:Number,json:{write:!0}})],v.prototype,"pitch",void 0),t([e({type:Number,json:{write:!0}})],v.prototype,"roll",void 0),t([e({type:Number,json:{write:!0}})],v.prototype,"horizontalWKID",void 0),t([e({type:Number,json:{write:!0}})],v.prototype,"verticalWKID",void 0),t([e({type:Number,json:{write:!0}})],v.prototype,"x",void 0),t([e({type:Number,json:{write:!0}})],v.prototype,"y",void 0),t([e({type:Number,json:{write:!0}})],v.prototype,"z",void 0),v=t([z("esri.layers.orientedImagery.core.CameraOrientationYPR")],v);const st=v;let W=class extends G{constructor(){super(...arguments),this.url=null}};t([e({type:Number,json:{write:!0}})],W.prototype,"lod",void 0),t([e({type:String,json:{write:!0}})],W.prototype,"rasterFunction",void 0),t([e({type:String,json:{write:!0}})],W.prototype,"url",void 0),W=t([z("esri.layers.orientedImagery.core.ElevationSourceDefinitions.ElevationSource")],W);let A=class extends G{constructor(){super(...arguments),this.constantElevation=null}};t([e({type:Number,json:{write:!0}})],A.prototype,"constantElevation",void 0),A=t([z("esri.layers.orientedImagery.cor.ElevationSourceDefinitions.ConstantElevation")],A);const lt=i=>i!=null&&"constantElevation"in i&&typeof i.constantElevation=="number";var O;(function(i){i[i.HPR=1]="HPR",i[i.OPK=2]="OPK",i[i.YPR=3]="YPR",i[i.LTP=4]="LTP"})(O||(O={}));function ut(i,o,r){return o&&(i=`${o}${i}`),r&&(i+=`${r}`),i}function yt(i,o,r){let{url:n}=i;return n?(n=ut(n,o,r),new W({...i,url:n})):null}function mt(i,o,r){return i&&(lt(i)?new A(i):yt(i,o,r))}const V=new _({Minutes:"minutes",Hours:"hours",Days:"days",Weeks:"weeks",Months:"months",Years:"years"}),F=new _({360:"360",Horizontal:"horizontal",Inspection:"inspection",Nadir:"nadir",Oblique:"oblique","":null}),Y=new Map;Y.set(`${O.OPK}`,{desc:"Using Omega Phi Kappa",constructor:pt}),Y.set(`${O.HPR}`,{desc:"Using Heading, Pitch and Roll",constructor:at}),Y.set(`${O.YPR}`,{desc:"Using Yaw, Pitch and Roll",constructor:st});const M=new Map;function ct(i){const[o,r,n,l,u,g,P,x,b,j,D,m,f,c,p,s,E,L,T,R,H,U]=i.slice(1),$=[b,j,D,m,f,c].map(w=>Number(w)),S=[s,E].map(w=>Number(w)),K=[L,T,R].map(w=>Number(w)),C=[H,U].map(w=>Number(w));return{horizontalWKID:o,verticalWKID:r,x:n,y:l,z:u,omega:g,phi:P,kappa:x,affineTransformations:$.filter(I).length===6?$:null,focalLength:p,principalOffsetPoint:S.filter(I).length!==2?null:S,radialDistortionCoefficients:K.filter(I).length!==3?[0,0,0]:K,tangentialDistortionCoefficients:C.filter(I).length!==2?[0,0]:C}}function ft(i){const[o,r,n,l,u,g,P,x,b,j,D,m,f,c,p,s,E,L,T,R,H,U]=i.slice(1),$=[b,j,D,m,f,c].map(w=>Number(w)),S=[s,E].map(w=>Number(w)),K=[L,T,R],C=[H,U];return{horizontalWKID:o,verticalWKID:r,x:n,y:l,z:u,heading:g,pitch:P,roll:x,affineTransformations:$.filter(I).length===6?$:null,focalLength:p,principalOffsetPoint:S.filter(I).length!==2?null:S,radialDistortionCoefficients:K.filter(I).length!==3?null:K,tangentialDistortionCoefficients:C.filter(I).length!==2?null:C}}function dt(i){const[o,r,n,l,u,g,P,x,b,j,D,m,f,c,p,s,E,L,T,R,H,U]=i.slice(1),$=[b,j,D,m,f,c].map(w=>Number(w)),S=[s,E].map(w=>Number(w)),K=[L,T,R],C=[H,U];return{horizontalWKID:o,verticalWKID:r,x:n,y:l,z:u,yaw:g,pitch:P,roll:x,affineTransformations:$.filter(I).length===6?$:null,focalLength:p,principalOffsetPoint:S.filter(I).length!==2?null:S,radialDistortionCoefficients:K.filter(I).length!==3?null:K,tangentialDistortionCoefficients:C.filter(I).length!==2?null:C}}function ht(i){const[o,r,n,l,u,...g]=i.slice(1),P=M.get(u);return P?{latitude:o,longitude:r,ellipsoidRadius:n,squaredEccentricity:l,properties:P([u,"",...g])}:null}M.set(`${O.HPR}`,ft),M.set(`${O.YPR}`,dt),M.set(`${O.OPK}`,ct),M.set(`${O.LTP}`,ht);function y(i,o,r){return{name:`orientedImageryProperties.${i}`,write:!o||{target:`orientedImageryProperties.${i}`,writer:o},origins:{service:{name:`orientedImageryInfo.orientedImageryProperties.${i}`,write:o,read:r}}}}let a=class extends tt{constructor(){super(...arguments),this.cameraHeading=null,this.cameraHeight=null,this.cameraPitch=null,this.cameraRoll=null,this.coveragePercent=null,this.demPathPrefix=null,this.demPathSuffix=null,this.depthImagePathPrefix=null,this.depthImagePathSuffix=null,this.elevationSource=null,this.farDistance=null,this.geometryType="point",this.horizontalFieldOfView=null,this.horizontalMeasurementUnit=null,this.imagePathPrefix=null,this.imagePathSuffix=null,this.imageRotation=null,this.maximumDistance=null,this.nearDistance=null,this.operationalLayerType="OrientedImageryLayer",this.orientationAccuracy=null,this.orientedImageryType=null,this.type="oriented-imagery",this.timeIntervalUnit=null,this.verticalFieldOfView=null,this.verticalMeasurementUnit=null,this.videoPathPrefix=null,this.videoPathSuffix=null}get effectiveElevationSource(){const{elevationSource:i,demPathPrefix:o,demPathSuffix:r}=this;return mt(i,o,r)}findFirstValidLayerId(i){var o,r;return(r=(o=i.layers)==null?void 0:o.find(n=>n.type==="Oriented Imagery Layer"))==null?void 0:r.id}_verifySource(){if(super._verifySource(),this.geometryType!=="point")throw new Z("oriented-imagery-layer:invalid-geometry-type","OrientedImageryLayer only supports point geometry type")}};t([e({type:Number,json:y("cameraHeading")})],a.prototype,"cameraHeading",void 0),t([e({type:Number,json:y("cameraHeight")})],a.prototype,"cameraHeight",void 0),t([e({type:Number,json:y("cameraPitch")})],a.prototype,"cameraPitch",void 0),t([e({type:Number,json:y("cameraRoll")})],a.prototype,"cameraRoll",void 0),t([e({type:Number,json:y("coveragePercent")})],a.prototype,"coveragePercent",void 0),t([e({type:String,json:y("demPathPrefix")})],a.prototype,"demPathPrefix",void 0),t([e({type:String,json:y("demPathSuffix")})],a.prototype,"demPathSuffix",void 0),t([e({type:String,json:y("depthImagePathPrefix")})],a.prototype,"depthImagePathPrefix",void 0),t([e({type:String,json:y("depthImagePathSuffix")})],a.prototype,"depthImagePathSuffix",void 0),t([e({type:Object,json:y("elevationSource")})],a.prototype,"elevationSource",void 0),t([e()],a.prototype,"effectiveElevationSource",null),t([e({type:Number,json:y("farDistance")})],a.prototype,"farDistance",void 0),t([e({json:{write:!0}})],a.prototype,"geometryType",void 0),t([e({type:Number,json:y("horizontalFieldOfView")})],a.prototype,"horizontalFieldOfView",void 0),t([e({type:String,json:y("horizontalMeasurementUnit")})],a.prototype,"horizontalMeasurementUnit",void 0),t([e({type:String,json:y("imagePathPrefix")})],a.prototype,"imagePathPrefix",void 0),t([e({type:String,json:y("imagePathSuffix")})],a.prototype,"imagePathSuffix",void 0),t([e({type:Number,json:y("imageRotation")})],a.prototype,"imageRotation",void 0),t([e({type:Number,json:y("maximumDistance")})],a.prototype,"maximumDistance",void 0),t([e({type:Number,json:y("nearDistance")})],a.prototype,"nearDistance",void 0),t([e({type:["OrientedImageryLayer"]})],a.prototype,"operationalLayerType",void 0),t([e({json:y("orientationAccuracy",(i,o)=>{i&&(o.orientationAccuracy=i.join(","))})}),X(i=>i?i.trim().split(",").map(Number):null)],a.prototype,"orientationAccuracy",void 0),t([e({json:{...y("orientedImageryType",F.write,F.read),type:F.apiValues}})],a.prototype,"orientedImageryType",void 0),t([e({json:{read:!1},value:"oriented-imagery",readOnly:!0})],a.prototype,"type",void 0),t([e({json:{...y("timeIntervalUnit",V.write,V.read),type:V.apiValues}})],a.prototype,"timeIntervalUnit",void 0),t([e({type:Number,json:y("verticalFieldOfView")})],a.prototype,"verticalFieldOfView",void 0),t([e({json:{...y("verticalMeasurementUnit"),type:new _({Feet:"feet",Meter:"meter"}).apiValues}})],a.prototype,"verticalMeasurementUnit",void 0),t([e({type:String,json:y("videoPathPrefix")})],a.prototype,"videoPathPrefix",void 0),t([e({type:String,json:y("videoPathSuffix")})],a.prototype,"videoPathSuffix",void 0),a=t([z("esri.layers.OrientedImageryLayer")],a);const ge=a;export{ge as default}; diff --git a/assets/OverrideHelper-B4ryGWZb.js b/assets/OverrideHelper-DxFZBnGL.js similarity index 96% rename from assets/OverrideHelper-B4ryGWZb.js rename to assets/OverrideHelper-DxFZBnGL.js index 2d62bab..87b0100 100644 --- a/assets/OverrideHelper-B4ryGWZb.js +++ b/assets/OverrideHelper-DxFZBnGL.js @@ -1 +1 @@ -import{s as M,N as C,aV as d,eP as I,eQ as x,a9 as k}from"./index-CEWggaxV.js";import{j as O,z as b,G as h,s as S,l as N}from"./utils-p-5Bbga5.js";import{U as g,v as P,q as w,k as G}from"./quantizationUtils-CUjGHrU3.js";function T(c,e,r,t,i){if(c==null)return null;const s=c.referencesGeometry()&&i?$(e,t,i):e,n=c.repurposeFeature(s);try{return c.evaluate({...r,$feature:n},c.services)}catch(o){return M.getLogger("esri.views.2d.support.arcadeOnDemand").warn("Feature arcade evaluation failed:",o),null}}const y=new Map;function $(c,e,r){const{transform:t,hasZ:i,hasM:s}=r;y.has(e)||y.set(e,E(e));const n=y.get(e)(c.geometry,t,i,s);return{...c,geometry:n}}function E(c){const e={};switch(c){case"esriGeometryPoint":return(r,t,i,s)=>G(t,e,r,i,s);case"esriGeometryPolygon":return(r,t,i,s)=>w(t,e,r,i,s);case"esriGeometryPolyline":return(r,t,i,s)=>P(t,e,r,i,s);case"esriGeometryMultipoint":return(r,t,i,s)=>g(t,e,r,i,s);default:return M.getLogger("esri.views.2d.support.arcadeOnDemand").error(new C("mapview-arcade",`Unable to handle geometryType: ${c}`)),r=>r}}const A=c=>{if(!c)return[0,0,0,0];const{r:e,g:r,b:t,a:i}=c;return[e,r,t,255*i]};class a{static findApplicableOverrides(e,r,t){if(e&&r){if(e.primitiveName){let i=!1;for(const s of t)if(s.primitiveName===e.primitiveName){i=!0;break}if(!i)for(const s of r)s.primitiveName===e.primitiveName&&t.push(s)}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const i of e.effects)a.findApplicableOverrides(i,r,t);if(e.symbolLayers)for(const i of e.symbolLayers)a.findApplicableOverrides(i,r,t);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":case"CIMVectorMarker":case"CIMCharacterMarker":case"CIMPictureMarker":if(e.effects)for(const i of e.effects)a.findApplicableOverrides(i,r,t);if(e.markerPlacement&&a.findApplicableOverrides(e.markerPlacement,r,t),e.type==="CIMVectorMarker"){if(e.markerGraphics)for(const i of e.markerGraphics)a.findApplicableOverrides(i,r,t),a.findApplicableOverrides(i.symbol,r,t)}else e.type==="CIMCharacterMarker"?a.findApplicableOverrides(e.symbol,r,t):e.type==="CIMHatchFill"?a.findApplicableOverrides(e.lineSymbol,r,t):e.type==="CIMPictureMarker"&&a.findApplicableOverrides(e.animatedSymbolProperties,r,t)}}}static findEffectOverrides(e,r){if(!e)return null;if(e.type==="CIMGeometricEffectDashes"&&O(e),!r||!e.primitiveName)return{type:"cim-effect-info",effect:e,overrides:[]};const t=e.primitiveName,i=[];for(const s of r)s.primitiveName===t&&i.push({...s,propertyName:b(s.propertyName)});return{type:"cim-effect-info",effect:e,overrides:i}}static async resolveSymbolOverrides(e,r,t,i,s,n,o){if(!(e!=null&&e.symbol))return null;let{symbol:p,primitiveOverrides:l}=e;const u=!!l;if(!u&&!i)return p;p=d(p),l=d(l);let v=!0;if(r||(r={attributes:{}},v=!1),u){if(v||(l=l.filter(f=>{var m;return!((m=f.valueExpressionInfo)!=null&&m.expression.includes("$feature"))})),o||(l=l.filter(f=>{var m;return!((m=f.valueExpressionInfo)!=null&&m.expression.includes("$view"))})),l.length>0){const f={spatialReference:t,fields:h(r.attributes),geometryType:s};await a.createRenderExpressions(l,f),a.evaluateOverrides(l,r,s??"esriGeometryPoint",n,o)}a.applyOverrides(p,l)}return i&&a.applyDictionaryTextOverrides(p,r,i,null),p}static async createRenderExpressions(e,r){const t=[];for(const i of e){const s=i.valueExpressionInfo;if(!s||a._expressionToRenderExpression.has(s.expression))continue;const n=I(s.expression,r.spatialReference,r.fields);t.push(n),n.then(o=>a._expressionToRenderExpression.set(s.expression,o))}t.length>0&&await Promise.all(t)}static evaluateOverrides(e,r,t,i,s){const n={$view:{scale:s==null?void 0:s.scale}};for(const o of e){o.value&&typeof o.value=="object"&&x(o.value)&&(o.propertyName==="Color"||o.propertyName==="StrokeColor")&&(o.value=A(o.value));const p=o.valueExpressionInfo;if(!p)continue;const l=a._expressionToRenderExpression.get(p.expression);l&&(o.value=T(l,r,n,t,i))}}static applyDictionaryTextOverrides(e,r,t,i,s="Normal"){if(e!=null&&e.type)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":case"CIMTextSymbol":{const n=e.symbolLayers;if(!n)return;for(const o of n)o&&o.type==="CIMVectorMarker"&&a.applyDictionaryTextOverrides(o,r,t,i,e.type==="CIMTextSymbol"?e.textCase:s)}break;case"CIMVectorMarker":{const n=e.markerGraphics;if(!n)return;for(const o of n)o&&a.applyDictionaryTextOverrides(o,r,t,i)}break;case"CIMMarkerGraphic":{const n=e.textString;if(n&&n.includes("[")){const o=S(n,t);e.textString=N(r,o,i,s)}}}}static applyOverrides(e,r,t,i){if(e.primitiveName){for(const s of r)if(s.primitiveName===e.primitiveName){const n=b(s.propertyName);if(i&&i.push({cim:e,nocapPropertyName:n,value:e[n]}),t){let o=!1;for(const p of t)p.primitiveName===e.primitiveName&&(o=!0);o||t.push(s)}s.value!=null&&(e[n]=s.value)}}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const s of e.effects)a.applyOverrides(s,r,t,i);if(e.symbolLayers)for(const s of e.symbolLayers)a.applyOverrides(s,r,t,i);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if(e.effects)for(const s of e.effects)a.applyOverrides(s,r,t,i);if(e.type==="CIMVectorMarker"&&e.markerGraphics)for(const s of e.markerGraphics)a.applyOverrides(s,r,t,i),a.applyOverrides(s.symbol,r,t,i)}}static restoreOverrides(e){for(const r of e)r.cim[r.nocapPropertyName]=r.value}static buildOverrideKey(e){let r="";for(const t of e)t.value!==void 0&&(r+=`${t.primitiveName}${t.propertyName}${JSON.stringify(t.value)}`);return r}static toValue(e,r){if(e==="DashTemplate")return r.split(" ").map(t=>Number(t));if(e==="Color"){const t=new k(r).toRgba();return t[3]*=255,t}return r}}a._expressionToRenderExpression=new Map;export{a as f}; +import{s as M,N as C,aV as d,eP as I,eQ as x,a9 as k}from"./index-BjUNJPVf.js";import{j as O,z as b,G as h,s as S,l as N}from"./utils-CuXO_Zzq.js";import{U as g,v as P,q as w,k as G}from"./quantizationUtils-CfV316jZ.js";function T(c,e,r,t,i){if(c==null)return null;const s=c.referencesGeometry()&&i?$(e,t,i):e,n=c.repurposeFeature(s);try{return c.evaluate({...r,$feature:n},c.services)}catch(o){return M.getLogger("esri.views.2d.support.arcadeOnDemand").warn("Feature arcade evaluation failed:",o),null}}const y=new Map;function $(c,e,r){const{transform:t,hasZ:i,hasM:s}=r;y.has(e)||y.set(e,E(e));const n=y.get(e)(c.geometry,t,i,s);return{...c,geometry:n}}function E(c){const e={};switch(c){case"esriGeometryPoint":return(r,t,i,s)=>G(t,e,r,i,s);case"esriGeometryPolygon":return(r,t,i,s)=>w(t,e,r,i,s);case"esriGeometryPolyline":return(r,t,i,s)=>P(t,e,r,i,s);case"esriGeometryMultipoint":return(r,t,i,s)=>g(t,e,r,i,s);default:return M.getLogger("esri.views.2d.support.arcadeOnDemand").error(new C("mapview-arcade",`Unable to handle geometryType: ${c}`)),r=>r}}const A=c=>{if(!c)return[0,0,0,0];const{r:e,g:r,b:t,a:i}=c;return[e,r,t,255*i]};class a{static findApplicableOverrides(e,r,t){if(e&&r){if(e.primitiveName){let i=!1;for(const s of t)if(s.primitiveName===e.primitiveName){i=!0;break}if(!i)for(const s of r)s.primitiveName===e.primitiveName&&t.push(s)}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const i of e.effects)a.findApplicableOverrides(i,r,t);if(e.symbolLayers)for(const i of e.symbolLayers)a.findApplicableOverrides(i,r,t);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":case"CIMVectorMarker":case"CIMCharacterMarker":case"CIMPictureMarker":if(e.effects)for(const i of e.effects)a.findApplicableOverrides(i,r,t);if(e.markerPlacement&&a.findApplicableOverrides(e.markerPlacement,r,t),e.type==="CIMVectorMarker"){if(e.markerGraphics)for(const i of e.markerGraphics)a.findApplicableOverrides(i,r,t),a.findApplicableOverrides(i.symbol,r,t)}else e.type==="CIMCharacterMarker"?a.findApplicableOverrides(e.symbol,r,t):e.type==="CIMHatchFill"?a.findApplicableOverrides(e.lineSymbol,r,t):e.type==="CIMPictureMarker"&&a.findApplicableOverrides(e.animatedSymbolProperties,r,t)}}}static findEffectOverrides(e,r){if(!e)return null;if(e.type==="CIMGeometricEffectDashes"&&O(e),!r||!e.primitiveName)return{type:"cim-effect-info",effect:e,overrides:[]};const t=e.primitiveName,i=[];for(const s of r)s.primitiveName===t&&i.push({...s,propertyName:b(s.propertyName)});return{type:"cim-effect-info",effect:e,overrides:i}}static async resolveSymbolOverrides(e,r,t,i,s,n,o){if(!(e!=null&&e.symbol))return null;let{symbol:p,primitiveOverrides:l}=e;const u=!!l;if(!u&&!i)return p;p=d(p),l=d(l);let v=!0;if(r||(r={attributes:{}},v=!1),u){if(v||(l=l.filter(f=>{var m;return!((m=f.valueExpressionInfo)!=null&&m.expression.includes("$feature"))})),o||(l=l.filter(f=>{var m;return!((m=f.valueExpressionInfo)!=null&&m.expression.includes("$view"))})),l.length>0){const f={spatialReference:t,fields:h(r.attributes),geometryType:s};await a.createRenderExpressions(l,f),a.evaluateOverrides(l,r,s??"esriGeometryPoint",n,o)}a.applyOverrides(p,l)}return i&&a.applyDictionaryTextOverrides(p,r,i,null),p}static async createRenderExpressions(e,r){const t=[];for(const i of e){const s=i.valueExpressionInfo;if(!s||a._expressionToRenderExpression.has(s.expression))continue;const n=I(s.expression,r.spatialReference,r.fields);t.push(n),n.then(o=>a._expressionToRenderExpression.set(s.expression,o))}t.length>0&&await Promise.all(t)}static evaluateOverrides(e,r,t,i,s){const n={$view:{scale:s==null?void 0:s.scale}};for(const o of e){o.value&&typeof o.value=="object"&&x(o.value)&&(o.propertyName==="Color"||o.propertyName==="StrokeColor")&&(o.value=A(o.value));const p=o.valueExpressionInfo;if(!p)continue;const l=a._expressionToRenderExpression.get(p.expression);l&&(o.value=T(l,r,n,t,i))}}static applyDictionaryTextOverrides(e,r,t,i,s="Normal"){if(e!=null&&e.type)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":case"CIMTextSymbol":{const n=e.symbolLayers;if(!n)return;for(const o of n)o&&o.type==="CIMVectorMarker"&&a.applyDictionaryTextOverrides(o,r,t,i,e.type==="CIMTextSymbol"?e.textCase:s)}break;case"CIMVectorMarker":{const n=e.markerGraphics;if(!n)return;for(const o of n)o&&a.applyDictionaryTextOverrides(o,r,t,i)}break;case"CIMMarkerGraphic":{const n=e.textString;if(n&&n.includes("[")){const o=S(n,t);e.textString=N(r,o,i,s)}}}}static applyOverrides(e,r,t,i){if(e.primitiveName){for(const s of r)if(s.primitiveName===e.primitiveName){const n=b(s.propertyName);if(i&&i.push({cim:e,nocapPropertyName:n,value:e[n]}),t){let o=!1;for(const p of t)p.primitiveName===e.primitiveName&&(o=!0);o||t.push(s)}s.value!=null&&(e[n]=s.value)}}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const s of e.effects)a.applyOverrides(s,r,t,i);if(e.symbolLayers)for(const s of e.symbolLayers)a.applyOverrides(s,r,t,i);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if(e.effects)for(const s of e.effects)a.applyOverrides(s,r,t,i);if(e.type==="CIMVectorMarker"&&e.markerGraphics)for(const s of e.markerGraphics)a.applyOverrides(s,r,t,i),a.applyOverrides(s.symbol,r,t,i)}}static restoreOverrides(e){for(const r of e)r.cim[r.nocapPropertyName]=r.value}static buildOverrideKey(e){let r="";for(const t of e)t.value!==void 0&&(r+=`${t.primitiveName}${t.propertyName}${JSON.stringify(t.value)}`);return r}static toValue(e,r){if(e==="DashTemplate")return r.split(" ").map(t=>Number(t));if(e==="Color"){const t=new k(r).toRgba();return t[3]*=255,t}return r}}a._expressionToRenderExpression=new Map;export{a as f}; diff --git a/assets/PBFDecoderWorker-C5tQTeCI.js b/assets/PBFDecoderWorker-DLXRZcsS.js similarity index 95% rename from assets/PBFDecoderWorker-C5tQTeCI.js rename to assets/PBFDecoderWorker-DLXRZcsS.js index a58df49..1fa3797 100644 --- a/assets/PBFDecoderWorker-C5tQTeCI.js +++ b/assets/PBFDecoderWorker-DLXRZcsS.js @@ -1 +1 @@ -import{bl as c,aS as d,a_ as p,bm as f,gA as m}from"./index-CEWggaxV.js";import{p as y,r as _}from"./featureConversionUtils-CmP9mw0r.js";import{t as g}from"./pbfQueryUtils-CLRSFGBm.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./pbf-D9QZb8S8.js";let b=class{constructor(t,e,s){this.uid=t,this.geometry=e,this.attributes=s,this.visible=!0,this.objectId=null,this.centroid=null}};class P{constructor(){this.exceededTransferLimit=!1,this.features=[],this.fields=[],this.hasM=!1,this.hasZ=!1,this.geometryType=null,this.objectIdFieldName=null,this.globalIdFieldName=null,this.geometryProperties=null,this.geohashFieldName=null,this.spatialReference=null,this.transform=null}}function C(i,t,e,s){if(t!=null&&t.size&&e!=null&&i)for(const r in i){if(!t.has(r))continue;const n=i[r];typeof n=="string"&&n.length>e&&(s(r),i[r]="")}}function A(i,t){return t}function l(i,t,e,s){switch(e){case 0:return h(i,t+s,0);case 1:return i.originPosition==="lowerLeft"?h(i,t+s,1):M(i,t+s,1)}}function u(i,t,e,s){return e===2?h(i,t,2):l(i,t,e,s)}function G(i,t,e,s){return e===2?h(i,t,3):l(i,t,e,s)}function v(i,t,e,s){return e===3?h(i,t,3):u(i,t,e,s)}function h({translate:i,scale:t},e,s){return i[s]+e*t[s]}function M({translate:i,scale:t},e,s){return i[s]-e*t[s]}class T{constructor(t){this._options=t,this.geometryTypes=["point","multipoint","polyline","polygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=A,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{},this._missingAttributes=[]}get missingAttributes(){return this._missingAttributes}createFeatureResult(){return new P}finishFeatureResult(t){if(this._options.applyTransform&&(t.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!t.hasZ)return;const e=c(t.geometryType,this._options.sourceSpatialReference,t.spatialReference);if(e!=null)for(const s of t.features)e(s.geometry)}createSpatialReference(){return new d}addField(t,e){t.fields.push(p.fromJSON(e));const s=t.fields.map(r=>r.name);this._attributesConstructor=function(){for(const r of s)this[r]=null}}addFeature(t,e){const s=this._options.maxStringAttributeLength,r=this._options.maxStringAttributeFields;C(e.attributes,r,s,n=>{const o=e.attributes[t.objectIdFieldName];o!=null&&this._missingAttributes.push({objectId:o,attribute:n})}),t.features.push(e)}addQueryGeometry(t,e){const{queryGeometry:s,queryGeometryType:r}=e,n=y(s.clone(),s,!1,!1,this._transform),o=_(n,r,!1,!1);let a=null;switch(r){case"esriGeometryPoint":a="point";break;case"esriGeometryPolygon":a="polygon";break;case"esriGeometryPolyline":a="polyline";break;case"esriGeometryMultipoint":a="multipoint"}o.type=a,t.queryGeometryType=r,t.queryGeometry=o}prepareFeatures(t){switch(this._transform=t.transform??null,this._options.applyTransform&&t.transform&&(this._applyTransform=this._deriveApplyTransform(t)),this._vertexDimension=2,t.hasZ&&this._vertexDimension++,t.hasM&&this._vertexDimension++,t.geometryType){case"point":this.addCoordinate=(e,s,r)=>this.addCoordinatePoint(e,s,r),this.createGeometry=e=>this.createPointGeometry(e);break;case"polygon":this.addCoordinate=(e,s,r)=>this._addCoordinatePolygon(e,s,r),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"polyline":this.addCoordinate=(e,s,r)=>this._addCoordinatePolyline(e,s,r),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"multipoint":this.addCoordinate=(e,s,r)=>this._addCoordinateMultipoint(e,s,r),this.createGeometry=e=>this._createMultipointGeometry(e);break;case"mesh":case"extent":break;default:f(t.geometryType)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,new b(m(),null,new this._attributesConstructor)}allocateCoordinates(){const t=this._lengths.reduce((e,s)=>e+s,0);this._coordinateBuffer=new Float64Array(t*this._vertexDimension),this._coordinateBufferPtr=0}addLength(t,e){this._lengths.length===0&&(this._toAddInCurrentPath=e),this._lengths.push(e)}createPointGeometry(t){const e={type:"point",x:0,y:0,spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM};return e.hasZ&&(e.z=0),e.hasM&&(e.m=0),e}addCoordinatePoint(t,e,s){const r=this._transform?this._applyTransform(this._transform,e,s,0):e;if(r!=null)switch(s){case 0:t.x=r;break;case 1:t.y=r;break;case 2:t.hasZ?t.z=r:t.m=r;break;case 3:t.m=r}}_transformPathLikeValue(t,e){let s=0;return e<=1&&(s=this._previousCoordinate[e],this._previousCoordinate[e]+=t),this._transform?this._applyTransform(this._transform,t,e,s):t}_addCoordinatePolyline(t,e,s){this._dehydratedAddPointsCoordinate(t.paths,e,s)}_addCoordinatePolygon(t,e,s){this._dehydratedAddPointsCoordinate(t.rings,e,s)}_addCoordinateMultipoint(t,e,s){s===0&&t.points.push([]);const r=this._transformPathLikeValue(e,s);t.points[t.points.length-1].push(r)}_createPolygonGeometry(t){return{type:"polygon",rings:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createPolylineGeometry(t){return{type:"polyline",paths:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createMultipointGeometry(t){return{type:"multipoint",points:[],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_dehydratedAddPointsCoordinate(t,e,s){s===0&&this._toAddInCurrentPath--==0&&(t.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const r=this._transformPathLikeValue(e,s),n=t[t.length-1],o=this._coordinateBuffer;if(o){if(s===0){const a=this._coordinateBufferPtr*Float64Array.BYTES_PER_ELEMENT;n.push(new Float64Array(o.buffer,a,this._vertexDimension))}o[this._coordinateBufferPtr++]=r}}_deriveApplyTransform(t){const{hasZ:e,hasM:s}=t;return e&&s?v:e?u:s?G:l}}class R{_parseFeatureQuery(t){var n;const e=new T(t.options),s=g(t.buffer,e),r={...s,spatialReference:(n=s.spatialReference)==null?void 0:n.toJSON(),fields:s.fields?s.fields.map(o=>o.toJSON()):void 0,missingAttributes:e.missingAttributes};return Promise.resolve(r)}}function B(){return new R}export{B as default}; +import{bl as c,aS as d,a_ as p,bm as f,gA as m}from"./index-BjUNJPVf.js";import{p as y,r as _}from"./featureConversionUtils-BHhm7bvm.js";import{t as g}from"./pbfQueryUtils-CSeFSIjv.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./pbf-Du8sFEWo.js";let b=class{constructor(t,e,s){this.uid=t,this.geometry=e,this.attributes=s,this.visible=!0,this.objectId=null,this.centroid=null}};class P{constructor(){this.exceededTransferLimit=!1,this.features=[],this.fields=[],this.hasM=!1,this.hasZ=!1,this.geometryType=null,this.objectIdFieldName=null,this.globalIdFieldName=null,this.geometryProperties=null,this.geohashFieldName=null,this.spatialReference=null,this.transform=null}}function C(i,t,e,s){if(t!=null&&t.size&&e!=null&&i)for(const r in i){if(!t.has(r))continue;const n=i[r];typeof n=="string"&&n.length>e&&(s(r),i[r]="")}}function A(i,t){return t}function l(i,t,e,s){switch(e){case 0:return h(i,t+s,0);case 1:return i.originPosition==="lowerLeft"?h(i,t+s,1):M(i,t+s,1)}}function u(i,t,e,s){return e===2?h(i,t,2):l(i,t,e,s)}function G(i,t,e,s){return e===2?h(i,t,3):l(i,t,e,s)}function v(i,t,e,s){return e===3?h(i,t,3):u(i,t,e,s)}function h({translate:i,scale:t},e,s){return i[s]+e*t[s]}function M({translate:i,scale:t},e,s){return i[s]-e*t[s]}class T{constructor(t){this._options=t,this.geometryTypes=["point","multipoint","polyline","polygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=A,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{},this._missingAttributes=[]}get missingAttributes(){return this._missingAttributes}createFeatureResult(){return new P}finishFeatureResult(t){if(this._options.applyTransform&&(t.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!t.hasZ)return;const e=c(t.geometryType,this._options.sourceSpatialReference,t.spatialReference);if(e!=null)for(const s of t.features)e(s.geometry)}createSpatialReference(){return new d}addField(t,e){t.fields.push(p.fromJSON(e));const s=t.fields.map(r=>r.name);this._attributesConstructor=function(){for(const r of s)this[r]=null}}addFeature(t,e){const s=this._options.maxStringAttributeLength,r=this._options.maxStringAttributeFields;C(e.attributes,r,s,n=>{const o=e.attributes[t.objectIdFieldName];o!=null&&this._missingAttributes.push({objectId:o,attribute:n})}),t.features.push(e)}addQueryGeometry(t,e){const{queryGeometry:s,queryGeometryType:r}=e,n=y(s.clone(),s,!1,!1,this._transform),o=_(n,r,!1,!1);let a=null;switch(r){case"esriGeometryPoint":a="point";break;case"esriGeometryPolygon":a="polygon";break;case"esriGeometryPolyline":a="polyline";break;case"esriGeometryMultipoint":a="multipoint"}o.type=a,t.queryGeometryType=r,t.queryGeometry=o}prepareFeatures(t){switch(this._transform=t.transform??null,this._options.applyTransform&&t.transform&&(this._applyTransform=this._deriveApplyTransform(t)),this._vertexDimension=2,t.hasZ&&this._vertexDimension++,t.hasM&&this._vertexDimension++,t.geometryType){case"point":this.addCoordinate=(e,s,r)=>this.addCoordinatePoint(e,s,r),this.createGeometry=e=>this.createPointGeometry(e);break;case"polygon":this.addCoordinate=(e,s,r)=>this._addCoordinatePolygon(e,s,r),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"polyline":this.addCoordinate=(e,s,r)=>this._addCoordinatePolyline(e,s,r),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"multipoint":this.addCoordinate=(e,s,r)=>this._addCoordinateMultipoint(e,s,r),this.createGeometry=e=>this._createMultipointGeometry(e);break;case"mesh":case"extent":break;default:f(t.geometryType)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,new b(m(),null,new this._attributesConstructor)}allocateCoordinates(){const t=this._lengths.reduce((e,s)=>e+s,0);this._coordinateBuffer=new Float64Array(t*this._vertexDimension),this._coordinateBufferPtr=0}addLength(t,e){this._lengths.length===0&&(this._toAddInCurrentPath=e),this._lengths.push(e)}createPointGeometry(t){const e={type:"point",x:0,y:0,spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM};return e.hasZ&&(e.z=0),e.hasM&&(e.m=0),e}addCoordinatePoint(t,e,s){const r=this._transform?this._applyTransform(this._transform,e,s,0):e;if(r!=null)switch(s){case 0:t.x=r;break;case 1:t.y=r;break;case 2:t.hasZ?t.z=r:t.m=r;break;case 3:t.m=r}}_transformPathLikeValue(t,e){let s=0;return e<=1&&(s=this._previousCoordinate[e],this._previousCoordinate[e]+=t),this._transform?this._applyTransform(this._transform,t,e,s):t}_addCoordinatePolyline(t,e,s){this._dehydratedAddPointsCoordinate(t.paths,e,s)}_addCoordinatePolygon(t,e,s){this._dehydratedAddPointsCoordinate(t.rings,e,s)}_addCoordinateMultipoint(t,e,s){s===0&&t.points.push([]);const r=this._transformPathLikeValue(e,s);t.points[t.points.length-1].push(r)}_createPolygonGeometry(t){return{type:"polygon",rings:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createPolylineGeometry(t){return{type:"polyline",paths:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createMultipointGeometry(t){return{type:"multipoint",points:[],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_dehydratedAddPointsCoordinate(t,e,s){s===0&&this._toAddInCurrentPath--==0&&(t.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const r=this._transformPathLikeValue(e,s),n=t[t.length-1],o=this._coordinateBuffer;if(o){if(s===0){const a=this._coordinateBufferPtr*Float64Array.BYTES_PER_ELEMENT;n.push(new Float64Array(o.buffer,a,this._vertexDimension))}o[this._coordinateBufferPtr++]=r}}_deriveApplyTransform(t){const{hasZ:e,hasM:s}=t;return e&&s?v:e?u:s?G:l}}class R{_parseFeatureQuery(t){var n;const e=new T(t.options),s=g(t.buffer,e),r={...s,spatialReference:(n=s.spatialReference)==null?void 0:n.toJSON(),fields:s.fields?s.fields.map(o=>o.toJSON()):void 0,missingAttributes:e.missingAttributes};return Promise.resolve(r)}}function B(){return new R}export{B as default}; diff --git a/assets/PointCloudLayer-ClQsf0Mo.js b/assets/PointCloudLayer-CsBDV7DT.js similarity index 93% rename from assets/PointCloudLayer-ClQsf0Mo.js rename to assets/PointCloudLayer-CsBDV7DT.js index 7080880..c451554 100644 --- a/assets/PointCloudLayer-ClQsf0Mo.js +++ b/assets/PointCloudLayer-CsBDV7DT.js @@ -1,4 +1,4 @@ -import{d as r,y as i,f as y,aU as B,dS as x,c9 as m,aV as u,dM as N,dp as _,dq as V,bQ as L,dr as O,dO as E,dN as A,a_ as b,b1 as D,ay as M,iN as C,N as l,b_ as K,M as k,s as T,fD as G,i as U,aZ as Z,e8 as z,dt as Q,aR as H,bT as J}from"./index-CEWggaxV.js";import{L as W,P}from"./SceneService-l5OfqT0E.js";import{s as X}from"./fieldProperties-DMs4wT6-.js";import{c as q,d as Y,b as ee,a as te}from"./PointCloudUniqueValueRenderer-CdXEaMW5.js";import{I as F,x as re,Z as ie}from"./elevationInfoUtils-Dag_mzct.js";import{p as oe}from"./popupUtils-DAFYyAvw.js";import"./originUtils-D69mHv66.js";import"./multiOriginJSONSupportUtils-C0wm8_Yw.js";import"./resourceUtils-Cu1-5qu3.js";import"./resourceUtils-CjqYbm2Q.js";import"./saveAPIKeyUtils-BiX1lQSW.js";import"./saveUtils-BzCRy3uR.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./ColorStop-44hBlQ14.js";let f=class extends B{constructor(e){super(e),this.field=null,this.type=null}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}};r([i({type:String,json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"field",void 0),r([i({readOnly:!0,nonNullable:!0,json:{read:!1}})],f.prototype,"type",void 0),f=r([y("esri.layers.pointCloudFilters.PointCloudFilter")],f);const g=f;var w;let d=w=class extends g{constructor(e){super(e),this.requiredClearBits=null,this.requiredSetBits=null,this.type="bitfield"}clone(){return new w({field:this.field,requiredClearBits:u(this.requiredClearBits),requiredSetBits:u(this.requiredSetBits)})}};r([i({type:[x],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredSetBits}}}}})],d.prototype,"requiredClearBits",void 0),r([i({type:[x],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredClearBits}}}}})],d.prototype,"requiredSetBits",void 0),r([m({pointCloudBitfieldFilter:"bitfield"})],d.prototype,"type",void 0),d=w=r([y("esri.layers.pointCloudFilters.PointCloudBitfieldFilter")],d);const se=d;var I;let h=I=class extends g{constructor(e){super(e),this.includedReturns=[],this.type="return"}clone(){return new I({field:this.field,includedReturns:u(this.includedReturns)})}};r([i({type:[["firstOfMany","last","lastOfMany","single"]],json:{write:{enabled:!0,isRequired:!0}}})],h.prototype,"includedReturns",void 0),r([m({pointCloudReturnFilter:"return"})],h.prototype,"type",void 0),h=I=r([y("esri.layers.pointCloudFilters.PointCloudReturnFilter")],h);const ne=h;var $;let p=$=class extends g{constructor(e){super(e),this.mode="exclude",this.type="value",this.values=[]}clone(){return new $({field:this.field,mode:this.mode,values:u(this.values)})}};r([i({type:["exclude","include"],json:{write:{enabled:!0,isRequired:!0}}})],p.prototype,"mode",void 0),r([m({pointCloudValueFilter:"value"})],p.prototype,"type",void 0),r([i({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],p.prototype,"values",void 0),p=$=r([y("esri.layers.pointCloudFilters.PointCloudValueFilter")],p);const ae=p,le={key:"type",base:g,typeMap:{value:ae,bitfield:se,return:ne}};var S;let v=S=class extends q{constructor(e){super(e),this.type="point-cloud-rgb",this.field=null}clone(){return new S({...this.cloneProperties(),field:u(this.field)})}};r([m({pointCloudRGBRenderer:"point-cloud-rgb"})],v.prototype,"type",void 0),r([i({type:String,json:{write:!0}})],v.prototype,"field",void 0),v=S=r([y("esri.renderers.PointCloudRGBRenderer")],v);const de=v,R={key:"type",base:q,typeMap:{"point-cloud-class-breaks":Y,"point-cloud-rgb":de,"point-cloud-stretch":ee,"point-cloud-unique-value":te},errorContext:"renderer"},j=X();let o=class extends W(N(_(V(L(O(E(A(J)))))))){constructor(...e){super(...e),this.operationalLayerType="PointCloudLayer",this.popupEnabled=!0,this.popupTemplate=null,this.opacity=1,this.filters=[],this.fields=null,this.fieldsIndex=null,this.outFields=null,this.path=null,this.legendEnabled=!0,this.renderer=null,this.type="point-cloud"}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}get defaultPopupTemplate(){return this.attributeStorageInfo?this.createPopupTemplate():null}getFieldDomain(e){const t=this.fieldsIndex.get(e);return t!=null&&t.domain?t.domain:null}readServiceFields(e,t,n){return Array.isArray(e)?e.map(s=>{const a=new b;return s.type==="FieldTypeInteger"&&((s=u(s)).type="esriFieldTypeInteger"),a.read(s,n),a}):Array.isArray(t.attributeStorageInfo)?t.attributeStorageInfo.map(s=>new b({name:s.name,type:s.name==="ELEVATION"?"double":"integer"})):null}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}writeRenderer(e,t,n,s){D("layerDefinition.drawingInfo.renderer",e.write({},s),t)}load(e){const t=e!=null?e.signal:null,n=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(M).then(()=>this._fetchService(t));return this.addResolvingPromise(n),Promise.resolve(this)}createPopupTemplate(e){const t=oe(this,e);return t&&(this._formatPopupTemplateReturnsField(t),this._formatPopupTemplateRGBField(t)),t}_formatPopupTemplateReturnsField(e){var a;const t=this.fieldsIndex.get("RETURNS");if(!t)return;const n=(a=e.fieldInfos)==null?void 0:a.find(c=>c.fieldName===t.name);if(!n)return;const s=new C({name:"pcl-returns-decoded",title:t.alias||t.name,expression:` +import{d as r,y as i,f as y,aU as B,dS as x,c9 as m,aV as u,dM as N,dp as _,dq as V,bQ as L,dr as O,dO as E,dN as A,a_ as b,b1 as D,ay as M,iN as C,N as l,b_ as K,M as k,s as T,fD as G,i as U,aZ as Z,e8 as z,dt as Q,aR as H,bT as J}from"./index-BjUNJPVf.js";import{L as W,P}from"./SceneService-DbS150xR.js";import{s as X}from"./fieldProperties-DnrQXLBM.js";import{c as q,d as Y,b as ee,a as te}from"./PointCloudUniqueValueRenderer-DGqW3DIg.js";import{I as F,x as re,Z as ie}from"./elevationInfoUtils-DIYaTlLQ.js";import{p as oe}from"./popupUtils-DlZin22m.js";import"./originUtils-D69mHv66.js";import"./multiOriginJSONSupportUtils-C0wm8_Yw.js";import"./resourceUtils-p9pTIVIi.js";import"./resourceUtils-CfE36DzP.js";import"./saveAPIKeyUtils-YRBbgdzi.js";import"./saveUtils-CGGzyvzv.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./ColorStop-DCGjAKLC.js";let f=class extends B{constructor(e){super(e),this.field=null,this.type=null}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}};r([i({type:String,json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"field",void 0),r([i({readOnly:!0,nonNullable:!0,json:{read:!1}})],f.prototype,"type",void 0),f=r([y("esri.layers.pointCloudFilters.PointCloudFilter")],f);const g=f;var w;let d=w=class extends g{constructor(e){super(e),this.requiredClearBits=null,this.requiredSetBits=null,this.type="bitfield"}clone(){return new w({field:this.field,requiredClearBits:u(this.requiredClearBits),requiredSetBits:u(this.requiredSetBits)})}};r([i({type:[x],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredSetBits}}}}})],d.prototype,"requiredClearBits",void 0),r([i({type:[x],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredClearBits}}}}})],d.prototype,"requiredSetBits",void 0),r([m({pointCloudBitfieldFilter:"bitfield"})],d.prototype,"type",void 0),d=w=r([y("esri.layers.pointCloudFilters.PointCloudBitfieldFilter")],d);const se=d;var I;let h=I=class extends g{constructor(e){super(e),this.includedReturns=[],this.type="return"}clone(){return new I({field:this.field,includedReturns:u(this.includedReturns)})}};r([i({type:[["firstOfMany","last","lastOfMany","single"]],json:{write:{enabled:!0,isRequired:!0}}})],h.prototype,"includedReturns",void 0),r([m({pointCloudReturnFilter:"return"})],h.prototype,"type",void 0),h=I=r([y("esri.layers.pointCloudFilters.PointCloudReturnFilter")],h);const ne=h;var $;let p=$=class extends g{constructor(e){super(e),this.mode="exclude",this.type="value",this.values=[]}clone(){return new $({field:this.field,mode:this.mode,values:u(this.values)})}};r([i({type:["exclude","include"],json:{write:{enabled:!0,isRequired:!0}}})],p.prototype,"mode",void 0),r([m({pointCloudValueFilter:"value"})],p.prototype,"type",void 0),r([i({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],p.prototype,"values",void 0),p=$=r([y("esri.layers.pointCloudFilters.PointCloudValueFilter")],p);const ae=p,le={key:"type",base:g,typeMap:{value:ae,bitfield:se,return:ne}};var S;let v=S=class extends q{constructor(e){super(e),this.type="point-cloud-rgb",this.field=null}clone(){return new S({...this.cloneProperties(),field:u(this.field)})}};r([m({pointCloudRGBRenderer:"point-cloud-rgb"})],v.prototype,"type",void 0),r([i({type:String,json:{write:!0}})],v.prototype,"field",void 0),v=S=r([y("esri.renderers.PointCloudRGBRenderer")],v);const de=v,R={key:"type",base:q,typeMap:{"point-cloud-class-breaks":Y,"point-cloud-rgb":de,"point-cloud-stretch":ee,"point-cloud-unique-value":te},errorContext:"renderer"},j=X();let o=class extends W(N(_(V(L(O(E(A(J)))))))){constructor(...e){super(...e),this.operationalLayerType="PointCloudLayer",this.popupEnabled=!0,this.popupTemplate=null,this.opacity=1,this.filters=[],this.fields=null,this.fieldsIndex=null,this.outFields=null,this.path=null,this.legendEnabled=!0,this.renderer=null,this.type="point-cloud"}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}get defaultPopupTemplate(){return this.attributeStorageInfo?this.createPopupTemplate():null}getFieldDomain(e){const t=this.fieldsIndex.get(e);return t!=null&&t.domain?t.domain:null}readServiceFields(e,t,n){return Array.isArray(e)?e.map(s=>{const a=new b;return s.type==="FieldTypeInteger"&&((s=u(s)).type="esriFieldTypeInteger"),a.read(s,n),a}):Array.isArray(t.attributeStorageInfo)?t.attributeStorageInfo.map(s=>new b({name:s.name,type:s.name==="ELEVATION"?"double":"integer"})):null}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}writeRenderer(e,t,n,s){D("layerDefinition.drawingInfo.renderer",e.write({},s),t)}load(e){const t=e!=null?e.signal:null,n=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(M).then(()=>this._fetchService(t));return this.addResolvingPromise(n),Promise.resolve(this)}createPopupTemplate(e){const t=oe(this,e);return t&&(this._formatPopupTemplateReturnsField(t),this._formatPopupTemplateRGBField(t)),t}_formatPopupTemplateReturnsField(e){var a;const t=this.fieldsIndex.get("RETURNS");if(!t)return;const n=(a=e.fieldInfos)==null?void 0:a.find(c=>c.fieldName===t.name);if(!n)return;const s=new C({name:"pcl-returns-decoded",title:t.alias||t.name,expression:` var returnValue = $feature.${t.name}; return (returnValue % 16) + " / " + Floor(returnValue / 16); `});e.expressionInfos=[...e.expressionInfos||[],s],n.fieldName="expression/pcl-returns-decoded"}_formatPopupTemplateRGBField(e){var a;const t=this.fieldsIndex.get("RGB");if(!t)return;const n=(a=e.fieldInfos)==null?void 0:a.find(c=>c.fieldName===t.name);if(!n)return;const s=new C({name:"pcl-rgb-decoded",title:t.alias||t.name,expression:` diff --git a/assets/PointCloudUniqueValueRenderer-CdXEaMW5.js b/assets/PointCloudUniqueValueRenderer-DGqW3DIg.js similarity index 98% rename from assets/PointCloudUniqueValueRenderer-CdXEaMW5.js rename to assets/PointCloudUniqueValueRenderer-DGqW3DIg.js index eeda72c..a8416b1 100644 --- a/assets/PointCloudUniqueValueRenderer-CdXEaMW5.js +++ b/assets/PointCloudUniqueValueRenderer-DGqW3DIg.js @@ -1 +1 @@ -import{d as e,y as t,f as r,aU as f,aY as P,c9 as m,gk as k,aV as o,a9 as I,dS as N}from"./index-CEWggaxV.js";import{p as z,a as D}from"./ColorStop-44hBlQ14.js";var w;let c=w=class extends f{constructor(){super(...arguments),this.field=null,this.minValue=0,this.maxValue=255}clone(){return new w({field:this.field,minValue:this.minValue,maxValue:this.maxValue})}};e([t({type:String,json:{write:!0}})],c.prototype,"field",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],c.prototype,"minValue",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],c.prototype,"maxValue",void 0),c=w=e([r("esri.renderers.support.pointCloud.ColorModulation")],c);const K=c,v=new P({pointCloudFixedSizeAlgorithm:"fixed-size",pointCloudSplatAlgorithm:"splat"});let b=class extends f{};e([t({type:v.apiValues,readOnly:!0,nonNullable:!0,json:{type:v.jsonValues,read:!1,write:v.write}})],b.prototype,"type",void 0),b=e([r("esri.renderers.support.pointCloud.PointSizeAlgorithm")],b);const R=b;var g;let y=g=class extends R{constructor(){super(...arguments),this.type="fixed-size",this.size=0,this.useRealWorldSymbolSizes=null}clone(){return new g({size:this.size,useRealWorldSymbolSizes:this.useRealWorldSymbolSizes})}};e([m({pointCloudFixedSizeAlgorithm:"fixed-size"})],y.prototype,"type",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],y.prototype,"size",void 0),e([t({type:Boolean,json:{write:!0}})],y.prototype,"useRealWorldSymbolSizes",void 0),y=g=e([r("esri.renderers.support.pointCloud.PointSizeFixedSizeAlgorithm")],y);const B=y;var V;let h=V=class extends R{constructor(){super(...arguments),this.type="splat",this.scaleFactor=1}clone(){return new V({scaleFactor:this.scaleFactor})}};e([m({pointCloudSplatAlgorithm:"splat"})],h.prototype,"type",void 0),e([t({type:Number,value:1,nonNullable:!0,json:{write:!0}})],h.prototype,"scaleFactor",void 0),h=V=e([r("esri.renderers.support.pointCloud.PointSizeSplatAlgorithm")],h);const q=h,A={key:"type",base:R,typeMap:{"fixed-size":B,splat:q}},T=k()({pointCloudClassBreaksRenderer:"point-cloud-class-breaks",pointCloudRGBRenderer:"point-cloud-rgb",pointCloudStretchRenderer:"point-cloud-stretch",pointCloudUniqueValueRenderer:"point-cloud-unique-value"});let l=class extends f{constructor(O){super(O),this.type=void 0,this.pointSizeAlgorithm=null,this.colorModulation=null,this.pointsPerInch=10}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}cloneProperties(){return{pointSizeAlgorithm:o(this.pointSizeAlgorithm),colorModulation:o(this.colorModulation),pointsPerInch:o(this.pointsPerInch)}}};e([t({type:T.apiValues,readOnly:!0,nonNullable:!0,json:{type:T.jsonValues,read:!1,write:T.write}})],l.prototype,"type",void 0),e([t({types:A,json:{write:!0}})],l.prototype,"pointSizeAlgorithm",void 0),e([t({type:K,json:{write:!0}})],l.prototype,"colorModulation",void 0),e([t({json:{write:!0},nonNullable:!0,type:Number})],l.prototype,"pointsPerInch",void 0),l=e([r("esri.renderers.PointCloudRenderer")],l),function(s){s.fieldTransformTypeKebabDict=new P({none:"none",lowFourBit:"low-four-bit",highFourBit:"high-four-bit",absoluteValue:"absolute-value",moduloTen:"modulo-ten"})}(l||(l={}));const i=l;var j;let n=j=class extends f{constructor(){super(...arguments),this.description=null,this.label=null,this.minValue=0,this.maxValue=0,this.color=null}clone(){return new j({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,color:o(this.color)})}};e([t({type:String,json:{write:!0}})],n.prototype,"description",void 0),e([t({type:String,json:{write:!0}})],n.prototype,"label",void 0),e([t({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],n.prototype,"minValue",void 0),e([t({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],n.prototype,"maxValue",void 0),e([t({type:I,json:{type:[N],write:!0}})],n.prototype,"color",void 0),n=j=e([r("esri.renderers.support.pointCloud.ColorClassBreakInfo")],n);const M=n;var S;let p=S=class extends i{constructor(s){super(s),this.type="point-cloud-class-breaks",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.colorClassBreakInfos=null}clone(){return new S({...this.cloneProperties(),field:this.field,fieldTransformType:this.fieldTransformType,colorClassBreakInfos:o(this.colorClassBreakInfos),legendOptions:o(this.legendOptions)})}};e([m({pointCloudClassBreaksRenderer:"point-cloud-class-breaks"})],p.prototype,"type",void 0),e([t({json:{write:!0},type:String})],p.prototype,"field",void 0),e([t({type:z,json:{write:!0}})],p.prototype,"legendOptions",void 0),e([t({type:i.fieldTransformTypeKebabDict.apiValues,json:{type:i.fieldTransformTypeKebabDict.jsonValues,read:i.fieldTransformTypeKebabDict.read,write:i.fieldTransformTypeKebabDict.write}})],p.prototype,"fieldTransformType",void 0),e([t({type:[M],json:{write:!0}})],p.prototype,"colorClassBreakInfos",void 0),p=S=e([r("esri.renderers.PointCloudClassBreaksRenderer")],p);const E=p;var C;let a=C=class extends i{constructor(s){super(s),this.type="point-cloud-stretch",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.stops=null}clone(){return new C({...this.cloneProperties(),field:o(this.field),fieldTransformType:o(this.fieldTransformType),stops:o(this.stops),legendOptions:o(this.legendOptions)})}};e([m({pointCloudStretchRenderer:"point-cloud-stretch"})],a.prototype,"type",void 0),e([t({json:{write:!0},type:String})],a.prototype,"field",void 0),e([t({type:z,json:{write:!0}})],a.prototype,"legendOptions",void 0),e([t({type:i.fieldTransformTypeKebabDict.apiValues,json:{type:i.fieldTransformTypeKebabDict.jsonValues,read:i.fieldTransformTypeKebabDict.read,write:i.fieldTransformTypeKebabDict.write}})],a.prototype,"fieldTransformType",void 0),e([t({type:[D],json:{write:!0}})],a.prototype,"stops",void 0),a=C=e([r("esri.renderers.PointCloudStretchRenderer")],a);const H=a;var $;let u=$=class extends f{constructor(){super(...arguments),this.description=null,this.label=null,this.values=null,this.color=null}clone(){return new $({description:this.description,label:this.label,values:o(this.values),color:o(this.color)})}};e([t({type:String,json:{write:!0}})],u.prototype,"description",void 0),e([t({type:String,json:{write:!0}})],u.prototype,"label",void 0),e([t({type:[String],json:{write:!0}})],u.prototype,"values",void 0),e([t({type:I,json:{type:[N],write:!0}})],u.prototype,"color",void 0),u=$=e([r("esri.renderers.support.pointCloud.ColorUniqueValueInfo")],u);const F=u;var x;let d=x=class extends i{constructor(s){super(s),this.type="point-cloud-unique-value",this.field=null,this.fieldTransformType=null,this.colorUniqueValueInfos=null,this.legendOptions=null}clone(){return new x({...this.cloneProperties(),field:o(this.field),fieldTransformType:o(this.fieldTransformType),colorUniqueValueInfos:o(this.colorUniqueValueInfos),legendOptions:o(this.legendOptions)})}};e([m({pointCloudUniqueValueRenderer:"point-cloud-unique-value"})],d.prototype,"type",void 0),e([t({json:{write:!0},type:String})],d.prototype,"field",void 0),e([t({type:i.fieldTransformTypeKebabDict.apiValues,json:{type:i.fieldTransformTypeKebabDict.jsonValues,read:i.fieldTransformTypeKebabDict.read,write:i.fieldTransformTypeKebabDict.write}})],d.prototype,"fieldTransformType",void 0),e([t({type:[F],json:{write:!0}})],d.prototype,"colorUniqueValueInfos",void 0),e([t({type:z,json:{write:!0}})],d.prototype,"legendOptions",void 0),d=x=e([r("esri.renderers.PointCloudUniqueValueRenderer")],d);const J=d;export{J as a,H as b,i as c,E as d}; +import{d as e,y as t,f as r,aU as f,aY as P,c9 as m,gk as k,aV as o,a9 as I,dS as N}from"./index-BjUNJPVf.js";import{p as z,a as D}from"./ColorStop-DCGjAKLC.js";var w;let c=w=class extends f{constructor(){super(...arguments),this.field=null,this.minValue=0,this.maxValue=255}clone(){return new w({field:this.field,minValue:this.minValue,maxValue:this.maxValue})}};e([t({type:String,json:{write:!0}})],c.prototype,"field",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],c.prototype,"minValue",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],c.prototype,"maxValue",void 0),c=w=e([r("esri.renderers.support.pointCloud.ColorModulation")],c);const K=c,v=new P({pointCloudFixedSizeAlgorithm:"fixed-size",pointCloudSplatAlgorithm:"splat"});let b=class extends f{};e([t({type:v.apiValues,readOnly:!0,nonNullable:!0,json:{type:v.jsonValues,read:!1,write:v.write}})],b.prototype,"type",void 0),b=e([r("esri.renderers.support.pointCloud.PointSizeAlgorithm")],b);const R=b;var g;let y=g=class extends R{constructor(){super(...arguments),this.type="fixed-size",this.size=0,this.useRealWorldSymbolSizes=null}clone(){return new g({size:this.size,useRealWorldSymbolSizes:this.useRealWorldSymbolSizes})}};e([m({pointCloudFixedSizeAlgorithm:"fixed-size"})],y.prototype,"type",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],y.prototype,"size",void 0),e([t({type:Boolean,json:{write:!0}})],y.prototype,"useRealWorldSymbolSizes",void 0),y=g=e([r("esri.renderers.support.pointCloud.PointSizeFixedSizeAlgorithm")],y);const B=y;var V;let h=V=class extends R{constructor(){super(...arguments),this.type="splat",this.scaleFactor=1}clone(){return new V({scaleFactor:this.scaleFactor})}};e([m({pointCloudSplatAlgorithm:"splat"})],h.prototype,"type",void 0),e([t({type:Number,value:1,nonNullable:!0,json:{write:!0}})],h.prototype,"scaleFactor",void 0),h=V=e([r("esri.renderers.support.pointCloud.PointSizeSplatAlgorithm")],h);const q=h,A={key:"type",base:R,typeMap:{"fixed-size":B,splat:q}},T=k()({pointCloudClassBreaksRenderer:"point-cloud-class-breaks",pointCloudRGBRenderer:"point-cloud-rgb",pointCloudStretchRenderer:"point-cloud-stretch",pointCloudUniqueValueRenderer:"point-cloud-unique-value"});let l=class extends f{constructor(O){super(O),this.type=void 0,this.pointSizeAlgorithm=null,this.colorModulation=null,this.pointsPerInch=10}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}cloneProperties(){return{pointSizeAlgorithm:o(this.pointSizeAlgorithm),colorModulation:o(this.colorModulation),pointsPerInch:o(this.pointsPerInch)}}};e([t({type:T.apiValues,readOnly:!0,nonNullable:!0,json:{type:T.jsonValues,read:!1,write:T.write}})],l.prototype,"type",void 0),e([t({types:A,json:{write:!0}})],l.prototype,"pointSizeAlgorithm",void 0),e([t({type:K,json:{write:!0}})],l.prototype,"colorModulation",void 0),e([t({json:{write:!0},nonNullable:!0,type:Number})],l.prototype,"pointsPerInch",void 0),l=e([r("esri.renderers.PointCloudRenderer")],l),function(s){s.fieldTransformTypeKebabDict=new P({none:"none",lowFourBit:"low-four-bit",highFourBit:"high-four-bit",absoluteValue:"absolute-value",moduloTen:"modulo-ten"})}(l||(l={}));const i=l;var j;let n=j=class extends f{constructor(){super(...arguments),this.description=null,this.label=null,this.minValue=0,this.maxValue=0,this.color=null}clone(){return new j({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,color:o(this.color)})}};e([t({type:String,json:{write:!0}})],n.prototype,"description",void 0),e([t({type:String,json:{write:!0}})],n.prototype,"label",void 0),e([t({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],n.prototype,"minValue",void 0),e([t({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],n.prototype,"maxValue",void 0),e([t({type:I,json:{type:[N],write:!0}})],n.prototype,"color",void 0),n=j=e([r("esri.renderers.support.pointCloud.ColorClassBreakInfo")],n);const M=n;var S;let p=S=class extends i{constructor(s){super(s),this.type="point-cloud-class-breaks",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.colorClassBreakInfos=null}clone(){return new S({...this.cloneProperties(),field:this.field,fieldTransformType:this.fieldTransformType,colorClassBreakInfos:o(this.colorClassBreakInfos),legendOptions:o(this.legendOptions)})}};e([m({pointCloudClassBreaksRenderer:"point-cloud-class-breaks"})],p.prototype,"type",void 0),e([t({json:{write:!0},type:String})],p.prototype,"field",void 0),e([t({type:z,json:{write:!0}})],p.prototype,"legendOptions",void 0),e([t({type:i.fieldTransformTypeKebabDict.apiValues,json:{type:i.fieldTransformTypeKebabDict.jsonValues,read:i.fieldTransformTypeKebabDict.read,write:i.fieldTransformTypeKebabDict.write}})],p.prototype,"fieldTransformType",void 0),e([t({type:[M],json:{write:!0}})],p.prototype,"colorClassBreakInfos",void 0),p=S=e([r("esri.renderers.PointCloudClassBreaksRenderer")],p);const E=p;var C;let a=C=class extends i{constructor(s){super(s),this.type="point-cloud-stretch",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.stops=null}clone(){return new C({...this.cloneProperties(),field:o(this.field),fieldTransformType:o(this.fieldTransformType),stops:o(this.stops),legendOptions:o(this.legendOptions)})}};e([m({pointCloudStretchRenderer:"point-cloud-stretch"})],a.prototype,"type",void 0),e([t({json:{write:!0},type:String})],a.prototype,"field",void 0),e([t({type:z,json:{write:!0}})],a.prototype,"legendOptions",void 0),e([t({type:i.fieldTransformTypeKebabDict.apiValues,json:{type:i.fieldTransformTypeKebabDict.jsonValues,read:i.fieldTransformTypeKebabDict.read,write:i.fieldTransformTypeKebabDict.write}})],a.prototype,"fieldTransformType",void 0),e([t({type:[D],json:{write:!0}})],a.prototype,"stops",void 0),a=C=e([r("esri.renderers.PointCloudStretchRenderer")],a);const H=a;var $;let u=$=class extends f{constructor(){super(...arguments),this.description=null,this.label=null,this.values=null,this.color=null}clone(){return new $({description:this.description,label:this.label,values:o(this.values),color:o(this.color)})}};e([t({type:String,json:{write:!0}})],u.prototype,"description",void 0),e([t({type:String,json:{write:!0}})],u.prototype,"label",void 0),e([t({type:[String],json:{write:!0}})],u.prototype,"values",void 0),e([t({type:I,json:{type:[N],write:!0}})],u.prototype,"color",void 0),u=$=e([r("esri.renderers.support.pointCloud.ColorUniqueValueInfo")],u);const F=u;var x;let d=x=class extends i{constructor(s){super(s),this.type="point-cloud-unique-value",this.field=null,this.fieldTransformType=null,this.colorUniqueValueInfos=null,this.legendOptions=null}clone(){return new x({...this.cloneProperties(),field:o(this.field),fieldTransformType:o(this.fieldTransformType),colorUniqueValueInfos:o(this.colorUniqueValueInfos),legendOptions:o(this.legendOptions)})}};e([m({pointCloudUniqueValueRenderer:"point-cloud-unique-value"})],d.prototype,"type",void 0),e([t({json:{write:!0},type:String})],d.prototype,"field",void 0),e([t({type:i.fieldTransformTypeKebabDict.apiValues,json:{type:i.fieldTransformTypeKebabDict.jsonValues,read:i.fieldTransformTypeKebabDict.read,write:i.fieldTransformTypeKebabDict.write}})],d.prototype,"fieldTransformType",void 0),e([t({type:[F],json:{write:!0}})],d.prototype,"colorUniqueValueInfos",void 0),e([t({type:z,json:{write:!0}})],d.prototype,"legendOptions",void 0),d=x=e([r("esri.renderers.PointCloudUniqueValueRenderer")],d);const J=d;export{J as a,H as b,i as c,E as d}; diff --git a/assets/PointCloudWorker-BVcb1Zzd.js b/assets/PointCloudWorker-RLZ1Rh8W.js similarity index 92% rename from assets/PointCloudWorker-BVcb1Zzd.js rename to assets/PointCloudWorker-RLZ1Rh8W.js index 116b51d..b6eebc0 100644 --- a/assets/PointCloudWorker-BVcb1Zzd.js +++ b/assets/PointCloudWorker-RLZ1Rh8W.js @@ -1 +1 @@ -import{fp as S,q as D,aS as v,e3 as C,fq as x}from"./index-CEWggaxV.js";import{O as k}from"./quat-CoKEr4Zu.js";import{e as F}from"./quatf64-Bdb9ZJJK.js";import{t as A,n as w}from"./vec3f32-nZdmKIgz.js";import{a as R,b as U,d as q}from"./PointCloudUniqueValueRenderer-CdXEaMW5.js";import{w as B,l as J,c as N,I as V}from"./I3SBinaryReader-N_Is4gxa.js";import{O as T}from"./orientedBoundingBox-BQdJNYvE.js";import"./mat3f64-q3fE-ZOt.js";import"./ColorStop-44hBlQ14.js";import"./VertexAttribute-BlT9lbVY.js";import"./mat4f64-CSKppSlJ.js";import"./computeTranslationToOriginAndRotation-DOOKw0d1.js";import"./plane-py4f_JCU.js";function _(c,t,s,n){const{rendererJSON:i,isRGBRenderer:p}=c;let r=null,a=null;if(t&&p)r=t;else if(t&&(i==null?void 0:i.type)==="pointCloudUniqueValueRenderer"){a=R.fromJSON(i);const e=a.colorUniqueValueInfos;r=new Uint8Array(3*n);const f=g(a.fieldTransformType);for(let o=0;o=e[l].value)r[3*o]=e[l].color.r,r[3*o+1]=e[l].color.g,r[3*o+2]=e[l].color.b;else for(let b=1;b=e[l].minValue&&u<=e[l].maxValue){r[3*o]=e[l].color.r,r[3*o+1]=e[l].color.g,r[3*o+2]=e[l].color.b;break}}}else r=new Uint8Array(3*n).fill(255);if(s&&(a!=null&&a.colorModulation)){const e=a.colorModulation.minValue,f=a.colorModulation.maxValue,o=.3;for(let u=0;u=f?1:l<=e?o:o+(1-o)*(l-e)/(f-e);r[3*u]=b*r[3*u],r[3*u+1]=b*r[3*u+1],r[3*u+2]=b*r[3*u+2]}}return r}function E(c,t){if(c.encoding==null||c.encoding===""){const s=B(t,c);if(s.vertexAttributes.position==null)return;const n=J(t,s.vertexAttributes.position),i=s.header.fields,p=[i.offsetX,i.offsetY,i.offsetZ],r=[i.scaleX,i.scaleY,i.scaleZ],a=n.length/3,e=new Float64Array(3*a);for(let f=0;f>>4&15,m=b>1,$=l===1,I=l===b;let y=!1;for(const d of o.includedReturns)if(d==="last"&&I||d==="firstOfMany"&&$&&m||d==="lastOfMany"&&I&&m||d==="single"&&!m){y=!0;break}y||(e=!1);break}}}e&&(s[r]=a,c[3*r]=c[3*a],c[3*r+1]=c[3*a+1],c[3*r+2]=c[3*a+2],t[3*r]=t[3*a],t[3*r+1]=t[3*a+1],t[3*r+2]=t[3*a+2],r++)}return r}function g(c){switch(c){default:case null:case"none":return t=>t;case"low-four-bit":return t=>15&t;case"high-four-bit":return t=>(240&t)>>4;case"absolute-value":return t=>Math.abs(t);case"modulo-ten":return t=>t%10}}function M(c){let t=0;for(const s of c||[])t|=1<0&&t.filterAttributesData!=null){const o=t.filterAttributesData.filter(D).map(u=>{const l=h(u,s,n),b={attributeInfo:u.attributeInfo,values:l};return p.push(b),b});i=new Uint32Array(n),n=P(s,e,i,t.filterInfo,o)}for(const o of t.userAttributesData){const u=h(o,s,n);p.push({attributeInfo:o.attributeInfo,values:u})}3*n=e[l].value)r[3*o]=e[l].color.r,r[3*o+1]=e[l].color.g,r[3*o+2]=e[l].color.b;else for(let b=1;b=e[l].minValue&&u<=e[l].maxValue){r[3*o]=e[l].color.r,r[3*o+1]=e[l].color.g,r[3*o+2]=e[l].color.b;break}}}else r=new Uint8Array(3*n).fill(255);if(s&&(a!=null&&a.colorModulation)){const e=a.colorModulation.minValue,f=a.colorModulation.maxValue,o=.3;for(let u=0;u=f?1:l<=e?o:o+(1-o)*(l-e)/(f-e);r[3*u]=b*r[3*u],r[3*u+1]=b*r[3*u+1],r[3*u+2]=b*r[3*u+2]}}return r}function E(c,t){if(c.encoding==null||c.encoding===""){const s=B(t,c);if(s.vertexAttributes.position==null)return;const n=J(t,s.vertexAttributes.position),i=s.header.fields,p=[i.offsetX,i.offsetY,i.offsetZ],r=[i.scaleX,i.scaleY,i.scaleZ],a=n.length/3,e=new Float64Array(3*a);for(let f=0;f>>4&15,m=b>1,$=l===1,I=l===b;let y=!1;for(const d of o.includedReturns)if(d==="last"&&I||d==="firstOfMany"&&$&&m||d==="lastOfMany"&&I&&m||d==="single"&&!m){y=!0;break}y||(e=!1);break}}}e&&(s[r]=a,c[3*r]=c[3*a],c[3*r+1]=c[3*a+1],c[3*r+2]=c[3*a+2],t[3*r]=t[3*a],t[3*r+1]=t[3*a+1],t[3*r+2]=t[3*a+2],r++)}return r}function g(c){switch(c){default:case null:case"none":return t=>t;case"low-four-bit":return t=>15&t;case"high-four-bit":return t=>(240&t)>>4;case"absolute-value":return t=>Math.abs(t);case"modulo-ten":return t=>t%10}}function M(c){let t=0;for(const s of c||[])t|=1<0&&t.filterAttributesData!=null){const o=t.filterAttributesData.filter(D).map(u=>{const l=h(u,s,n),b={attributeInfo:u.attributeInfo,values:l};return p.push(b),b});i=new Uint32Array(n),n=P(s,e,i,t.filterInfo,o)}for(const o of t.userAttributesData){const u=h(o,s,n);p.push({attributeInfo:o.attributeInfo,values:u})}3*ne,this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),n&&(typeof n=="function"?this._toBBox=n:this._initFormat(n)),this.clear()}destroy(){this.clear(),_.prune(),X.prune(),d.prune(),Y.prune()}all(t){this._all(this._data,t)}search(t,n){let e=this._data;const i=this._toBBox;if(M(t,e))for(_.clear();e;){for(let s=0,a=e.children.length;s0;){if(e||(e=d.pop(),i=d.data[d.length-1],s=Y.pop()??0,a=!0),e.leaf&&(n=F(e.children,t,e.children.length,e.indexHint),n!==-1))return e.children.splice(n,1),d.push(e),this._condense(d),this;a||e.leaf||!E(e,r)?i?(s++,e=i.children[s],a=!1):e=null:(d.push(e),Y.push(s),s=0,i=e,e=e.children[0])}return this}toJSON(){return this._data}fromJSON(t){return this._data=t,this}_all(t,n){let e=t;for(X.clear();e;){if(e.leaf===!0)for(const i of e.children)n(i);else X.pushArray(e.children);e=X.pop()??null}}_build(t,n,e,i){const s=e-n+1;let a=this._maxEntries;if(s<=a){const l=new B(t.slice(n,e+1));return x(l,this._toBBox),l}i||(i=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/a**(i-1)));const r=new S([]);r.height=i;const o=Math.ceil(s/a),c=o*Math.ceil(Math.sqrt(a));R(t,n,e,c,this._compareMinX);for(let l=n;l<=e;l+=c){const m=Math.min(l+c-1,e);R(t,l,m,o,this._compareMinY);for(let u=l;u<=m;u+=o){const A=Math.min(u+o-1,m);r.children.push(this._build(t,u,A,i-1))}}return x(r,this._toBBox),r}_chooseSubtree(t,n,e,i){for(;i.push(n),n.leaf!==!0&&i.length-1!==e;){let s,a=1/0,r=1/0;for(let o=0,c=n.children.length;o=0&&d.data[n].children.length>this._maxEntries;)this._split(d,n),n--;this._adjustParentBBoxes(s,d,n)}_split(t,n){const e=t.data[n],i=e.children.length,s=this._minEntries;this._chooseSplitAxis(e,s,i);const a=this._chooseSplitIndex(e,s,i);if(!a)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const r=e.children.splice(a,e.children.length-a),o=e.leaf?new B(r):new S(r);o.height=e.height,x(e,this._toBBox),x(o,this._toBBox),n?t.data[n-1].children.push(o):this._splitRoot(e,o)}_splitRoot(t,n){this._data=new S([t,n]),this._data.height=t.height+1,x(this._data,this._toBBox)}_chooseSplitIndex(t,n,e){let i,s,a;i=s=1/0;for(let r=n;r<=e-n;r++){const o=f(t,0,r,this._toBBox),c=f(t,r,e,this._toBBox),l=O(o,c),m=b(o)+b(c);l=n;c--){const l=t.children[c];p(r,t.leaf?s(l):l),o+=g(r)}return o}_adjustParentBBoxes(t,n,e){for(let i=e;i>=0;i--)p(n.data[i],t)}_condense(t){for(let n=t.length-1;n>=0;n--){const e=t.data[n];if(e.children.length===0)if(n>0){const i=t.data[n-1],s=i.children;s.splice(F(s,e,s.length,i.indexHint),1)}else this.clear();else x(e,this._toBBox)}}_initFormat(t){const n=["return a"," - b",";"];this._compareMinX=new Function("a","b",n.join(t[0])),this._compareMinY=new Function("a","b",n.join(t[1])),this._toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}function x(h,t){f(h,0,h.children.length,t,h)}function f(h,t,n,e,i){i||(i=new B([])),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let s,a=t;a=h.minX&&t.maxY>=h.minY}function R(h,t,n,e,i){const s=[t,n];for(;s.length;){const a=s.pop(),r=s.pop();if(a-r<=e)continue;const o=r+Math.ceil((a-r)/e/2)*e;D(h,o,r,a,i),s.push(r,o,o,a)}}const _=new w,X=new w,d=new w,Y=new w({deallocator:void 0});class P{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class y extends P{constructor(){super(...arguments),this.height=1,this.indexHint=new H}}class B extends y{constructor(t){super(),this.children=t,this.leaf=!0}}class S extends y{constructor(t){super(),this.children=t,this.leaf=!1}}export{I as s}; +import{bL as w,bM as F,bN as D,bO as H}from"./index-BjUNJPVf.js";class I{constructor(t=9,n){this._compareMinX=j,this._compareMinY=v,this._toBBox=e=>e,this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),n&&(typeof n=="function"?this._toBBox=n:this._initFormat(n)),this.clear()}destroy(){this.clear(),_.prune(),X.prune(),d.prune(),Y.prune()}all(t){this._all(this._data,t)}search(t,n){let e=this._data;const i=this._toBBox;if(M(t,e))for(_.clear();e;){for(let s=0,a=e.children.length;s0;){if(e||(e=d.pop(),i=d.data[d.length-1],s=Y.pop()??0,a=!0),e.leaf&&(n=F(e.children,t,e.children.length,e.indexHint),n!==-1))return e.children.splice(n,1),d.push(e),this._condense(d),this;a||e.leaf||!E(e,r)?i?(s++,e=i.children[s],a=!1):e=null:(d.push(e),Y.push(s),s=0,i=e,e=e.children[0])}return this}toJSON(){return this._data}fromJSON(t){return this._data=t,this}_all(t,n){let e=t;for(X.clear();e;){if(e.leaf===!0)for(const i of e.children)n(i);else X.pushArray(e.children);e=X.pop()??null}}_build(t,n,e,i){const s=e-n+1;let a=this._maxEntries;if(s<=a){const l=new B(t.slice(n,e+1));return x(l,this._toBBox),l}i||(i=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/a**(i-1)));const r=new S([]);r.height=i;const o=Math.ceil(s/a),c=o*Math.ceil(Math.sqrt(a));R(t,n,e,c,this._compareMinX);for(let l=n;l<=e;l+=c){const m=Math.min(l+c-1,e);R(t,l,m,o,this._compareMinY);for(let u=l;u<=m;u+=o){const A=Math.min(u+o-1,m);r.children.push(this._build(t,u,A,i-1))}}return x(r,this._toBBox),r}_chooseSubtree(t,n,e,i){for(;i.push(n),n.leaf!==!0&&i.length-1!==e;){let s,a=1/0,r=1/0;for(let o=0,c=n.children.length;o=0&&d.data[n].children.length>this._maxEntries;)this._split(d,n),n--;this._adjustParentBBoxes(s,d,n)}_split(t,n){const e=t.data[n],i=e.children.length,s=this._minEntries;this._chooseSplitAxis(e,s,i);const a=this._chooseSplitIndex(e,s,i);if(!a)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const r=e.children.splice(a,e.children.length-a),o=e.leaf?new B(r):new S(r);o.height=e.height,x(e,this._toBBox),x(o,this._toBBox),n?t.data[n-1].children.push(o):this._splitRoot(e,o)}_splitRoot(t,n){this._data=new S([t,n]),this._data.height=t.height+1,x(this._data,this._toBBox)}_chooseSplitIndex(t,n,e){let i,s,a;i=s=1/0;for(let r=n;r<=e-n;r++){const o=f(t,0,r,this._toBBox),c=f(t,r,e,this._toBBox),l=O(o,c),m=b(o)+b(c);l=n;c--){const l=t.children[c];p(r,t.leaf?s(l):l),o+=g(r)}return o}_adjustParentBBoxes(t,n,e){for(let i=e;i>=0;i--)p(n.data[i],t)}_condense(t){for(let n=t.length-1;n>=0;n--){const e=t.data[n];if(e.children.length===0)if(n>0){const i=t.data[n-1],s=i.children;s.splice(F(s,e,s.length,i.indexHint),1)}else this.clear();else x(e,this._toBBox)}}_initFormat(t){const n=["return a"," - b",";"];this._compareMinX=new Function("a","b",n.join(t[0])),this._compareMinY=new Function("a","b",n.join(t[1])),this._toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}function x(h,t){f(h,0,h.children.length,t,h)}function f(h,t,n,e,i){i||(i=new B([])),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let s,a=t;a=h.minX&&t.maxY>=h.minY}function R(h,t,n,e,i){const s=[t,n];for(;s.length;){const a=s.pop(),r=s.pop();if(a-r<=e)continue;const o=r+Math.ceil((a-r)/e/2)*e;D(h,o,r,a,i),s.push(r,o,o,a)}}const _=new w,X=new w,d=new w,Y=new w({deallocator:void 0});class P{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class y extends P{constructor(){super(...arguments),this.height=1,this.indexHint=new H}}class B extends y{constructor(t){super(),this.children=t,this.leaf=!0}}class S extends y{constructor(t){super(),this.children=t,this.leaf=!1}}export{I as s}; diff --git a/assets/Popup-CMTUSIYl.js b/assets/Popup-DSVql8fN.js similarity index 95% rename from assets/Popup-CMTUSIYl.js rename to assets/Popup-DSVql8fN.js index 14b74fb..bc043ea 100644 --- a/assets/Popup-CMTUSIYl.js +++ b/assets/Popup-DSVql8fN.js @@ -1,8 +1,8 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/calcite-icon-CHcIXU52.js","assets/icon-BuW41TqN.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css","assets/dom-DPsTWDAQ.js","assets/guid-DQtJl1SZ.js","assets/observers-MZ9Ss0UR.js","assets/visualVariableUtils-z2k12BH8.js","assets/sizeVariableUtils-Cmcuvw-4.js","assets/chartUtilsAm5-DYfwNDSz.js","assets/Theme-Bdh3gaKt.js","assets/Tooltip-CVjHQVY5.js","assets/DefaultTheme-QXTOOsyZ.js","assets/chartCommon-DeDLy4W7.js","assets/Button-BD3vvwHs.js","assets/ColorSet-DDQ4d9ui.js","assets/pieChart-D4IZYqRN.js","assets/Tick-B3uT4_8g.js","assets/xyChart-CZRgKOoN.js","assets/arcade-DTRx7SKL.js","assets/TimeOnly-Cm47ew5I.js","assets/UnknownTimeZone-DF0BqWCR.js","assets/ImmutableArray-BlMso3qf.js","assets/FeatureLayer-D0kMrROG.js","assets/UniqueValueRenderer-BlkUix3g.js","assets/ColorStop-44hBlQ14.js","assets/diffUtils-B4YFa5Ju.js","assets/colorRamps-BJydlf0f.js","assets/jsonUtils-qYmXvGJ1.js","assets/styleUtils-CnV_Xzhi.js","assets/jsonUtils-BseLl1fZ.js","assets/Version-Bd0QsIQ5.js","assets/FieldsIndex-CLgRNeJ_.js","assets/OverrideHelper-B4ryGWZb.js","assets/utils-p-5Bbga5.js","assets/quantizationUtils-CUjGHrU3.js","assets/heatmapUtils-Clt5rJzr.js","assets/FormTemplate-eV18QveB.js","assets/editsZScale-CQCGPEjO.js","assets/queryZScale-DN4aFXYn.js","assets/FeatureSet-CYJUZgOk.js","assets/EditBusLayer-SG7oYwiY.js","assets/FeatureEffectLayer-CLTrRFqx.js","assets/FeatureEffect-ByrbZlne.js","assets/FeatureLayerBase-DPJuwFpX.js","assets/featureLayerUtils-BhDaw8pS.js","assets/AttachmentQuery-D61mmWw4.js","assets/RelationshipQuery-DDK72Kwc.js","assets/LayerFloorInfo-Cdq3ulNh.js","assets/serviceCapabilitiesUtils-t8SL4e_j.js","assets/FeatureReductionLayer-DncGsNIN.js","assets/FeatureReductionSelection-BY3KVXac.js","assets/LabelClass-6cZokw8y.js","assets/labelUtils-Dnqx6jl5.js","assets/defaultsJSON-CHAaurhX.js","assets/MD5-C9MwAd2G.js","assets/OrderedLayer-Do089KpQ.js","assets/OrderByInfo-DKzv2-WS.js","assets/RefreshableLayer-1EkEhJeI.js","assets/TemporalLayer-qq3v_i3q.js","assets/TimeInfo-3TVmpFSA.js","assets/FeatureTemplate-DcprAdTM.js","assets/FeatureType-By3BEr9z.js","assets/fieldProperties-DMs4wT6-.js","assets/labelingInfo-CijajRsc.js","assets/versionUtils-CaceEUVY.js","assets/styleUtils-B_Iy1DTk.js","assets/TopFeaturesQuery-B8kC7n5h.js","assets/popupUtils-DAFYyAvw.js","assets/interfaces-CL2NbQte.js","assets/calcite-list-D9nZpOdw.js","assets/interactive-BR2V27xp.js","assets/utils3-D-MRQhiW.js","assets/loadable-DylQ3Aza.js","assets/t9n-gKZJT8eY.js","assets/debounce-CYvLhpWS.js","assets/input2-BT_6gQkP.js","assets/form-D5ySy5kP.js","assets/label2-BT0TPJM3.js","assets/component-WqEOSVCt.js","assets/loader-DQtzvvHl.js","assets/scrim-DPpUFS3O.js","assets/calcite-list-item-BBiyp6uG.js","assets/action-Ccs4b7Ti.js","assets/calcite-notice-CHsdelpI.js","assets/conditionalSlot-D3Ya1Vfj.js","assets/openCloseComponent-CP78bYQO.js","assets/calcite-action-CEYA6ZsJ.js","assets/calcite-flow-item-B7iK8dgk.js","assets/action-menu-CYcibT5U.js","assets/focusTrapComponent-C_xT3REh.js","assets/geometryEngineAsync-B-ooCYDN.js","assets/calcite-action-bar-C5PvC65D.js","assets/action-group-CACOwGqI.js","assets/calcite-action-group-oGHjFsjn.js","assets/calcite-button-CMjDkjDb.js","assets/calcite-flow-AUD7SkeM.js","assets/calcite-list-item-group-BIMGmmtA.js","assets/calcite-loader-CzxKWzLl.js"] + __vite__mapDeps.viteFileDeps = ["assets/calcite-icon-BCYnyK8T.js","assets/icon-BXpWZdRl.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css","assets/dom-DPsTWDAQ.js","assets/guid-DQtJl1SZ.js","assets/observers-B6R0JooC.js","assets/visualVariableUtils-BX9G5gNQ.js","assets/sizeVariableUtils-Cmcuvw-4.js","assets/chartUtilsAm5-D5owA826.js","assets/Theme-6HY29PEY.js","assets/Tooltip-C7eoaNP4.js","assets/DefaultTheme-Ze4cVXuP.js","assets/chartCommon-HGSAjsjY.js","assets/Button-D2RihRUZ.js","assets/ColorSet-wEWjQ87p.js","assets/pieChart-BW1iYy_W.js","assets/Tick-DedlQq8S.js","assets/xyChart-Dpn5biYD.js","assets/arcade-D78QfcWG.js","assets/TimeOnly-BXSODLxA.js","assets/UnknownTimeZone-CK7VjgF3.js","assets/ImmutableArray-BlMso3qf.js","assets/FeatureLayer-BHxNIHhy.js","assets/UniqueValueRenderer-7V9Bhr-D.js","assets/ColorStop-DCGjAKLC.js","assets/diffUtils-uUoMDFQS.js","assets/colorRamps-CcakIWlU.js","assets/jsonUtils-Ox5U0P0F.js","assets/styleUtils-DOUOskVZ.js","assets/jsonUtils-Dw332y6z.js","assets/Version-Dqq_CHBG.js","assets/FieldsIndex-CK-0B5n9.js","assets/OverrideHelper-DxFZBnGL.js","assets/utils-CuXO_Zzq.js","assets/quantizationUtils-CfV316jZ.js","assets/heatmapUtils-BSteZBTj.js","assets/FormTemplate-BGxtsGX6.js","assets/editsZScale-Bfe6gH1b.js","assets/queryZScale-Dwvn5BlQ.js","assets/FeatureSet-opEn8ou8.js","assets/EditBusLayer-OslMX9fF.js","assets/FeatureEffectLayer-DarO4Ctx.js","assets/FeatureEffect-DBbkrS6j.js","assets/FeatureLayerBase-D0I-Escx.js","assets/featureLayerUtils-lwqyOSrl.js","assets/AttachmentQuery-DmEAIZff.js","assets/RelationshipQuery-BDJrOxaX.js","assets/LayerFloorInfo-DlYNbO-A.js","assets/serviceCapabilitiesUtils-DiP90Uds.js","assets/FeatureReductionLayer-CK-tyM-9.js","assets/FeatureReductionSelection-t3T7oa8H.js","assets/LabelClass-CeatfK8u.js","assets/labelUtils-3p0-m-Ee.js","assets/defaultsJSON-CHAaurhX.js","assets/MD5-C9MwAd2G.js","assets/OrderedLayer-dLoPhxcx.js","assets/OrderByInfo-DKyk5GLW.js","assets/RefreshableLayer-_r2TPtol.js","assets/TemporalLayer-CKICYnEl.js","assets/TimeInfo-DooETFWC.js","assets/FeatureTemplate-FZNGA_Ik.js","assets/FeatureType-CwUl8Nf5.js","assets/fieldProperties-DnrQXLBM.js","assets/labelingInfo-DqAUis6e.js","assets/versionUtils-BIAEZzrm.js","assets/styleUtils--I7zqeL6.js","assets/TopFeaturesQuery-CVQjqlfM.js","assets/popupUtils-DlZin22m.js","assets/interfaces-CL2NbQte.js","assets/calcite-list-CAcrc3c7.js","assets/interactive-5-lo-GR7.js","assets/utils3-DOn9OzWH.js","assets/loadable-CreDQ1Dd.js","assets/t9n-pVz2fW_o.js","assets/debounce-CYvLhpWS.js","assets/input2-D8djCUJ5.js","assets/form-BC9xTZIq.js","assets/label2-BT0TPJM3.js","assets/component-WqEOSVCt.js","assets/loader-Bjz1lIB0.js","assets/scrim-CUXJVHyU.js","assets/calcite-list-item-JeWmt-sE.js","assets/action-DE-UH85X.js","assets/calcite-notice-Bu--C1Vt.js","assets/conditionalSlot-DMpb3OPD.js","assets/openCloseComponent-7TDD8Qsp.js","assets/calcite-action-xwwomTuE.js","assets/calcite-flow-item-aWVm4yY6.js","assets/action-menu-B2VkSdfS.js","assets/focusTrapComponent-C_xT3REh.js","assets/geometryEngineAsync-wvmuP1s9.js","assets/calcite-action-bar-glrD7fhe.js","assets/action-group-Cz5uoTMD.js","assets/calcite-action-group-DMHrkhqu.js","assets/calcite-button-CWS09kHr.js","assets/calcite-flow-cUQQQwo9.js","assets/calcite-list-item-group-tUNZxrA0.js","assets/calcite-loader-ijl1xz1O.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{l_ as zt,i$ as ni,aH as xe,aF as De,I as zi,aL as As,aI as ri,dh as Cs,lg as Es,s as z,aM as $s,a1 as xs,c8 as Wi,ba as oi,l$ as ot,V as Be,d as a,y as l,e1 as qe,j as ze,f as N,a7 as fe,g as _,P,N as R,gZ as Ts,i4 as te,i5 as ie,z as Te,i6 as We,_ as E,i7 as h,m0 as I,m1 as ai,m2 as li,m3 as ke,m4 as re,m5 as ks,iN as Ls,b8 as Hi,a9 as ji,m6 as Wt,Z as Rs,fy as Ps,dc as Le,jt as Os,aX as _t,Q as Ns,M as Vs,q as ht,m7 as Ss,m8 as Ds,m9 as Bs,aA as Ht,ma as qs,mb as Ui,bc as zs,mc as di,b4 as Ws,dn as Zi,eW as yt,k as tt,u as Hs,fx as Qi,l4 as js,b as Pt,ca as Us,p as at,dV as Zs,md as Qs,me as Gs,mf as ve,E as Gi,mg as Xs,mh as Ys,mi as Xe,mj as Xi,eN as Ks,mk as Js,dz as en,bv as tn,ez as sn,ew as nn,d2 as rn,bT as ci,jD as Pe,fK as on}from"./index-CEWggaxV.js";import{s as ce}from"./substitute-DxAztrfK.js";import{a as an}from"./AttachmentInfo-DEdzaB9S.js";import{c as ui}from"./AttachmentQuery-D61mmWw4.js";import{Z as ln,N as jt}from"./utils-SjO_-1JL.js";import"./ColorStop-44hBlQ14.js";import{h as Oe,N as dn,g as vt,R as cn,D as un}from"./utils-kx2f2Fff.js";import{l as hn}from"./jsonUtils-BseLl1fZ.js";import{s as wt}from"./executeQueryJSON-DngjHRnE.js";import"./pbf-D9QZb8S8.js";import"./FeatureSet-CYJUZgOk.js";import Ot from"./RelationshipQuery-DDK72Kwc.js";import"./TopFeaturesQuery-B8kC7n5h.js";import pn from"./FeatureLayer-D0kMrROG.js";import"./styleUtils-CnV_Xzhi.js";import"./utils-p-5Bbga5.js";import"./UniqueValueRenderer-BlkUix3g.js";import"./diffUtils-B4YFa5Ju.js";import"./colorRamps-BJydlf0f.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-z2k12BH8.js";import"./jsonUtils-qYmXvGJ1.js";import"./Version-Bd0QsIQ5.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./OverrideHelper-B4ryGWZb.js";import"./quantizationUtils-CUjGHrU3.js";import"./heatmapUtils-Clt5rJzr.js";import"./query-BM8R3sQ6.js";import"./pbfQueryUtils-CLRSFGBm.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./queryZScale-DN4aFXYn.js";import"./FormTemplate-eV18QveB.js";import"./editsZScale-CQCGPEjO.js";import"./EditBusLayer-SG7oYwiY.js";import"./FeatureEffectLayer-CLTrRFqx.js";import"./FeatureEffect-ByrbZlne.js";import"./FeatureLayerBase-DPJuwFpX.js";import"./featureLayerUtils-BhDaw8pS.js";import"./LayerFloorInfo-Cdq3ulNh.js";import"./serviceCapabilitiesUtils-t8SL4e_j.js";import"./FeatureReductionLayer-DncGsNIN.js";import"./FeatureReductionSelection-BY3KVXac.js";import"./LabelClass-6cZokw8y.js";import"./labelUtils-Dnqx6jl5.js";import"./defaultsJSON-CHAaurhX.js";import"./MD5-C9MwAd2G.js";import"./OrderedLayer-Do089KpQ.js";import"./OrderByInfo-DKzv2-WS.js";import"./RefreshableLayer-1EkEhJeI.js";import"./TemporalLayer-qq3v_i3q.js";import"./TimeInfo-3TVmpFSA.js";import"./FeatureTemplate-DcprAdTM.js";import"./FeatureType-By3BEr9z.js";import"./fieldProperties-DMs4wT6-.js";import"./labelingInfo-CijajRsc.js";import"./versionUtils-CaceEUVY.js";import"./styleUtils-B_Iy1DTk.js";import"./popupUtils-DAFYyAvw.js";import"./interfaces-CL2NbQte.js";function lt(t,e,i,s){let n=null,r=1e3;typeof e=="number"?(r=e,s=i):(n=e??null,r=i);let o,d=0;const c=()=>{d=0,t.apply(s,o)},u=(...p)=>{n&&n.apply(s,p),o=p,r?d||(d=setTimeout(c,r)):c()};return u.remove=()=>{d&&(clearTimeout(d),d=0)},u.forceUpdate=()=>{d&&(clearTimeout(d),c())},u.hasPendingUpdates=()=>!!d,u}function Nt(t){var e;switch(t==null?void 0:t.type){case"point":return t;case"extent":return t.center;case"polygon":return t.centroid;case"multipoint":case"polyline":return(e=t.extent)==null?void 0:e.center;default:return null}}function mn(t){return t?{backgroundImage:`url(${t})`}:{}}function fn({action:t,feature:e}){const i=e==null?void 0:e.attributes,s="image"in t?t.image:void 0;return s&&i?ce(s,i):s??""}function gn(t,e){return{type:zt(e),value:t,unit:e}}function _n(t,e){return{type:zt(e),value:t,unit:e}}function Ut(t,e,i="arithmetic"){return{type:zt(e),value:t,unit:e,rotationType:i}}gn(0,"meters");_n(0,"square-meters");Ut(0,"radians");Ut(0,"degrees");Ut(0,"degrees","geographic");const hi=["B","kB","MB","GB","TB"];function yn(t,e){let i=(e=Math.round(e))===0?0:Math.floor(Math.log(e)/Math.log(ni.KILOBYTES));i=zi(i,0,hi.length-1);const s=xe(e/ni.KILOBYTES**i,{maximumFractionDigits:2});return De(t.units.bytes[hi[i]],{fileSize:s})}const vn="esri.widgets.Feature.support.featureUtils",pi=()=>z.getLogger(vn),wn=/href=(""|'')/gi,bn=/(\{([^\{\r\n]+)\})/g,Mn=/\'/g,Yi=/^\s*expression\//i,In=/(\n)/gi,Fn=/[\u00A0-\u9999<>\&]/gim,An=/href\s*=\s*(?:\"([^\"]+)\"|\'([^\']+)\')/gi,Cn=/^(?:mailto:|tel:)/,Ki="relationships/",mi=$s("short-date-short-time");function Ji(t){if(t!=null)return(t.sourceLayer||t.layer)??void 0}async function dt(t,e){return typeof t=="function"?t(e):t}function es(t=""){if(t)return!Cn.test(t.trim().toLowerCase())}function Zt(t){return!!t&&Yi.test(t)}function En(t,e){if(!Zt(e)||!t)return;const i=e.replace(Yi,"").toLowerCase();return t.find(({name:s})=>s.toLowerCase()===i)}function ts(t,e){const i=En(e,t==null?void 0:t.fieldName);return i?i.title||null:t?t.label||t.fieldName:null}function $n(t,e){const i=e.get(t.toLowerCase());return`{${(i==null?void 0:i.fieldName)||t}}`}function xn(t){return t.replaceAll(wn,"")}function Ge(t,e){const i=Qt(e,t);return i?i.name:t}function Tn(t,e){return t&&t.map(i=>Ge(i,e))}function Qt(t,e){return t&&typeof t.getField=="function"&&e?t.getField(e)??null:null}function is(t){return`${t}`.trim()}function Ae({attributes:t,globalAttributes:e,layer:i,text:s,expressionAttributes:n,fieldInfoMap:r}){return s?Vt({formattedAttributes:e,template:Pn(s,{...e,...n,...t},i),fieldInfoMap:r}):""}function Vt({formattedAttributes:t,template:e,fieldInfoMap:i}){return is(xn(De(De(e,s=>$n(s,i)),t)))}function kn(t,e,i=!1){const s=e[t];if(typeof s=="string"){const n="%27",r=(i?encodeURIComponent(s):s).replaceAll(Mn,n);e[t]=r}}function Ln(t,e=!1){const i={...t};return Object.keys(i).forEach(s=>kn(s,i,e)),i}function Rn(t,e,i){const s=(e=is(e))&&e[0]!=="{";return De(t,Ln(i,s||!1))}function St(t,e){return t.replaceAll(bn,(i,s,n)=>{const r=Qt(e,n);return r?`{${r.name}}`:s})}function Pn(t,e,i){const s=St(t,i);return s&&s.replaceAll(An,(n,r,o)=>Rn(n,r||o,e))}function On(t,e){if(typeof t=="string"&&e&&e.dateFormat==null&&(e.places!=null||e.digitSeparator!=null)){const i=Number(t);if(!isNaN(i))return i}return t}function Nn(t){return t!=null&&typeof t=="object"&&"fieldsIndex"in t&&"geometryType"in t&&"getField"in t&&"load"in t&&"loaded"in t&&"objectIdField"in t&&"spatialReference"in t&&"type"in t&&(t.type==="feature"||t.type==="scene")&&"when"in t}function Vn(t){return t!=null&&typeof t=="object"&&"createQuery"in t&&"queryFeatureCount"in t&&"queryObjectIds"in t&&"queryRelatedFeatures"in t&&"queryRelatedFeaturesCount"in t&&"relationships"in t}function ss(t){return Nn(t)&&Vn(t)}function Sn(t,e){var p;const{fieldInfos:i,fieldName:s,preventPlacesFormatting:n,layer:r,timeZone:o}=e,d=ns(i,s),c=Qt(r,s);if(d&&!oi(s)){const m=c==null?void 0:c.type,f=(p=d.format)==null?void 0:p.dateFormat;if(m==="date"||m==="date-only"||m==="time-only"||m==="timestamp-offset"||f)return jt(t,{format:f,fieldType:m,timeZoneOptions:{layerTimeZone:r&&"preferredTimeZone"in r?r.preferredTimeZone:null,viewTimeZone:o,datesInUnknownTimezone:!(!r||!("datesInUnknownTimezone"in r))&&!!r.datesInUnknownTimezone}})}const u=d==null?void 0:d.format;return typeof t=="string"&&oi(s)&&u?Dn(t,u):typeof(t=On(t,u))=="string"||t==null||u==null?Ye(t):xe(t,n?{...ot(u),minimumFractionDigits:0,maximumFractionDigits:20}:ot(u))}function Dn(t,e){return t=t.trim(),/\d{2}-\d{2}/.test(t)?t:t.includes(",")?bt(t,",",", ",e):t.includes(";")?bt(t,";","; ",e):t.includes(" ")?bt(t," "," ",e):xe(Number(t),ot(e))}function bt(t,e,i,s){return t.trim().split(e).map(n=>xe(Number(n),ot(s))).join(i)}function ns(t,e){if(t!=null&&t.length&&e)return t.find(i=>{var s;return((s=i.fieldName)==null?void 0:s.toLowerCase())===e.toLowerCase()})}function Bn({fieldName:t,graphic:e,layer:i}){if(me(t)||!i||typeof i.getFeatureType!="function")return null;const{typeIdField:s}=i;if(!s||t!==s)return null;const n=i.getFeatureType(e);return n?n.name:null}function qn({fieldName:t,value:e,graphic:i,layer:s}){if(me(t)||!s||typeof s.getFieldDomain!="function")return null;const n=i&&s.getFieldDomain(t,{feature:i});return n&&n.type==="coded-value"?n.getName(e):null}function zn(t,e,i,s){const{creatorField:n,creationDateField:r,editorField:o,editDateField:d}=t;if(!e)return;const c=As(s&&"preferredTimeZone"in s?s.preferredTimeZone:null,!(!s||!("datesInUnknownTimezone"in s))&&!!s.datesInUnknownTimezone,i,mi,"date"),u={...mi,...c},p=e[d];if(typeof p=="number"){const f=e[o];return{type:"edit",date:ri(p,u),user:f}}const m=e[r];if(typeof m=="number"){const f=e[n];return{type:"create",date:ri(m,u),user:f}}return null}function Wn(t,e){const i=new Map;return t&&t.forEach(s=>{const n=Ge(s.fieldName,e);s.fieldName=n,i.set(n.toLowerCase(),s)}),i}function fi(t){const e=[];if(!t)return e;const{fieldInfos:i,content:s}=t;return i&&e.push(...i),s&&Array.isArray(s)&&s.forEach(n=>{if(n.type==="fields"){const r=n==null?void 0:n.fieldInfos;r&&e.push(...r)}}),e}function Gt(t){return t.replaceAll(Fn,e=>`&#${e.charCodeAt(0)};`)}function Ye(t){return typeof t=="string"?t.replaceAll(In,'
'):t}function rs(t){var m;const{value:e,fieldName:i,fieldInfos:s,fieldInfoMap:n,layer:r,graphic:o,timeZone:d}=t;if(e==null)return"";const c=qn({fieldName:i,value:e,graphic:o,layer:r});if(c)return c;const u=Bn({fieldName:i,graphic:o,layer:r});if(u)return u;if(n.get(i.toLowerCase()))return Sn(e,{fieldInfos:s||Array.from(n.values()),fieldName:i,layer:r,timeZone:d});const p=(m=r==null?void 0:r.fieldsIndex)==null?void 0:m.get(i);return p&&(ln(p)||xs(p))?jt(e,{fieldType:p.type,timeZoneOptions:{layerTimeZone:r&&"preferredTimeZone"in r?r.preferredTimeZone:null,viewTimeZone:d,datesInUnknownTimezone:!(!r||!("datesInUnknownTimezone"in r))&&!!r.datesInUnknownTimezone}}):Ye(e)}function Mt({fieldInfos:t,attributes:e,layer:i,graphic:s,fieldInfoMap:n,relatedInfos:r,timeZone:o}){const d={};return r==null||r.forEach(c=>Zn({attributes:d,relatedInfo:c,fieldInfoMap:n,fieldInfos:t,layer:i,timeZone:o})),e&&Object.keys(e).forEach(c=>{const u=e[c];d[c]=rs({fieldName:c,fieldInfos:t,fieldInfoMap:n,layer:i,value:u,graphic:s,timeZone:o})}),d}async function os(t,e){var p,m;const{layer:i,graphic:s,outFields:n,objectIds:r,returnGeometry:o,spatialReference:d}=t,c=r[0];if(typeof c!="number"&&typeof c!="string"){const f="Could not query required fields for the specified feature. The feature's ID is invalid.",g={layer:i,graphic:s,objectId:c,requiredFields:n};return pi().warn(f,g),null}if(!((m=(p=Cs(i))==null?void 0:p.operations)!=null&&m.supportsQuery)){const f="The specified layer cannot be queried. The following fields will not be available.",g={layer:i,graphic:s,requiredFields:n,returnGeometry:o};return pi().warn(f,g),null}const u=i.createQuery();return u.objectIds=r,u.outFields=n!=null&&n.length?n:[i.objectIdField],u.returnGeometry=!!o,u.returnZ=!!o,u.returnM=!!o,u.outSpatialReference=d,(await i.queryFeatures(u,e)).features[0]}async function Hn(t){var s;if(!((s=t.expressionInfos)!=null&&s.length))return!1;const e=await Wi(),{arcadeUtils:{hasGeometryFunctions:i}}=e;return i(t)}async function jn({graphic:t,popupTemplate:e,layer:i,spatialReference:s},n){if(!i||!e||(typeof i.load=="function"&&await i.load(n),!t.attributes))return;const r=t.attributes[i.objectIdField];if(r==null)return;const o=[r],d=await e.getRequiredFields(i.fieldsIndex),c=Es(d,t),u=c?[]:d,p=e.returnGeometry||await Hn(e);if(c&&!p)return;const m=await os({layer:i,graphic:t,outFields:u,objectIds:o,returnGeometry:p,spatialReference:s},n);m&&(m.geometry&&(t.geometry=m.geometry),m.attributes&&(t.attributes={...t.attributes,...m.attributes}))}function me(t=""){return!!t&&t.includes(Ki)}function Un(t){return t?`${Ki}${t.layerId}/${t.fieldName}`:""}function gi({attributes:t,graphic:e,relatedInfo:i,fieldInfos:s,fieldInfoMap:n,layer:r,timeZone:o}){t&&e&&i&&Object.keys(e.attributes).forEach(d=>{const c=Un({layerId:i.relation.id.toString(),fieldName:d}),u=e.attributes[d];t[c]=rs({fieldName:c,fieldInfos:s,fieldInfoMap:n,layer:r,value:u,graphic:e,timeZone:o})})}function Zn({attributes:t,relatedInfo:e,fieldInfoMap:i,fieldInfos:s,layer:n,timeZone:r}){var o,d;t&&e&&((o=e.relatedFeatures)==null||o.forEach(c=>gi({attributes:t,graphic:c,relatedInfo:e,fieldInfoMap:i,fieldInfos:s,layer:n,timeZone:r})),(d=e.relatedStatsFeatures)==null||d.forEach(c=>gi({attributes:t,graphic:c,relatedInfo:e,fieldInfoMap:i,fieldInfos:s,layer:n,timeZone:r})))}const _i=t=>{if(!t)return!1;const e=t.toUpperCase();return e.includes("CURRENT_TIMESTAMP")||e.includes("CURRENT_DATE")||e.includes("CURRENT_TIME")},as=({layer:t,method:e,query:i,definitionExpression:s})=>{var o,d;if(!((d=(o=t.capabilities)==null?void 0:o.query)!=null&&d.supportsCacheHint)||e==="attachments")return;const n=i.where!=null?i.where:null,r=i.geometry!=null?i.geometry:null;_i(s)||_i(n)||(r==null?void 0:r.type)==="extent"||i.resultType==="tile"||(i.cacheHint=!0)},Qn=({query:t,layer:e,method:i})=>{as({layer:e,method:i,query:t,definitionExpression:`${e.definitionExpression} ${e.serviceDefinitionExpression}`})},Gn=({queryPayload:t,layer:e,method:i})=>{as({layer:e,method:i,query:t,definitionExpression:`${e.definitionExpression} ${e.serviceDefinitionExpression}`})};function Xn(t,e,i){return t&&e&&i?yi(t.allLayers,e,i)||yi(t.allTables,e,i):null}function yi(t,e,{relatedTableId:i}){const s=e.type==="scene"&&e.associatedLayer?e.associatedLayer.url:e.url;return t.filter(ss).find(n=>n!==e&&n.url===s&&n.layerId===i)}const vi={editing:!1,operations:{add:!0,update:!0,delete:!0}},ls=Be.ofType(an);let Y=class extends fe{constructor(e){super(e),this._getAttachmentsPromise=null,this._attachmentLayer=null,this.capabilities={...vi},this.activeAttachmentInfo=null,this.activeFileInfo=null,this.attachmentInfos=new ls,this.fileInfos=new Be,this.graphic=null,this.mode="view",this.filesEnabled=!1,this.addHandles(_(()=>this.graphic,()=>this._graphicChanged(),P))}destroy(){this._attachmentLayer=null,this.graphic=null}castCapabilities(e){return{...vi,...e}}get state(){return this._getAttachmentsPromise?"loading":this.graphic?"ready":"disabled"}get supportsResizeAttachments(){const{graphic:e}=this;if(!e)return!1;const i=e.layer||e.sourceLayer;return(i==null?void 0:i.loaded)&&"capabilities"in i&&i.capabilities&&"operations"in i.capabilities&&"supportsResizeAttachments"in i.capabilities.operations&&i.capabilities.operations.supportsResizeAttachments||!1}async getAttachments(){const{_attachmentLayer:e,attachmentInfos:i}=this;if(!e||typeof e.queryAttachments!="function")throw new R("invalid-layer","getAttachments(): A valid layer is required.");const s=this._getObjectId(),n=new ui({objectIds:[s],returnMetadata:!0}),r=[],o=e.queryAttachments(n).then(c=>c[s]||r).catch(()=>r);this._getAttachmentsPromise=o,this.notifyChange("state");const d=await o;return i.removeAll(),d.length&&i.addMany(d),this._getAttachmentsPromise=null,this.notifyChange("state"),d}async addAttachment(e,i=this.graphic){var c;const{_attachmentLayer:s,attachmentInfos:n,capabilities:r}=this;if(!i)throw new R("invalid-graphic","addAttachment(): A valid graphic is required.",{graphic:i});if(!e)throw new R("invalid-attachment","addAttachment(): An attachment is required.",{attachment:e});if(!((c=r.operations)!=null&&c.add))throw new R("invalid-capabilities","addAttachment(): add capabilities are required.");if(!s||typeof s.addAttachment!="function")throw new R("invalid-layer","addAttachment(): A valid layer is required.");const o=s.addAttachment(i,e).then(u=>this._queryAttachment(u.objectId,i)),d=await o;return n.add(d),d}async deleteAttachment(e){var c;const{_attachmentLayer:i,attachmentInfos:s,graphic:n,capabilities:r}=this;if(!e)throw new R("invalid-attachment-info","deleteAttachment(): An attachmentInfo is required.",{attachmentInfo:e});if(!((c=r.operations)!=null&&c.delete))throw new R("invalid-capabilities","deleteAttachment(): delete capabilities are required.");if(!i||typeof i.deleteAttachments!="function")throw new R("invalid-layer","deleteAttachment(): A valid layer is required.");if(!n)throw new R("invalid-graphic","deleteAttachment(): A graphic is required.");const o=i.deleteAttachments(n,[e.id]).then(()=>e),d=await o;return s.remove(d),d}async updateAttachment(e,i=this.activeAttachmentInfo){var p;const{_attachmentLayer:s,attachmentInfos:n,graphic:r,capabilities:o}=this;if(!e)throw new R("invalid-attachment","updateAttachment(): An attachment is required.",{attachment:e});if(!i)throw new R("invalid-attachment-info","updateAttachment(): An attachmentInfo is required.",{attachmentInfo:i});if(!((p=o.operations)!=null&&p.update))throw new R("invalid-capabilities","updateAttachment(): Update capabilities are required.");const d=n.indexOf(i);if(!s||typeof s.updateAttachment!="function")throw new R("invalid-layer","updateAttachment(): A valid layer is required.");if(!r)throw new R("invalid-graphic","updateAttachment(): A graphic is required.");const c=s.updateAttachment(r,i.id,e).then(m=>this._queryAttachment(m.objectId)),u=await c;return n.splice(d,1,u),u}async commitFiles(){return await Promise.all(this.fileInfos.items.map(e=>this.addAttachment(e.form))),this.fileInfos.removeAll(),this.getAttachments()}addFile(e,i){if(!e||!i)return null;const s={file:e,form:i};return this.fileInfos.add(s),s}updateFile(e,i,s=this.activeFileInfo){if(!e||!i||!s)return null;const n=this.fileInfos.indexOf(s);return n>-1&&this.fileInfos.splice(n,1,{file:e,form:i}),this.fileInfos.items[n]}deleteFile(e){const i=this.fileInfos.find(s=>s.file===e);return i?(this.fileInfos.remove(i),i):null}async _queryAttachment(e,i){const{_attachmentLayer:s}=this;if(!e||!(s!=null&&s.queryAttachments))throw new R("invalid-attachment-id","Could not query attachment.");const n=this._getObjectId(i),r=new ui({objectIds:[n],attachmentsWhere:`AttachmentId=${e}`,returnMetadata:!0});return s.queryAttachments(r).then(o=>o[n][0])}_getObjectId(e=this.graphic){return(e==null?void 0:e.getObjectId())??null}_graphicChanged(){this.graphic&&(this._setAttachmentLayer(),this.getAttachments().catch(()=>{}))}_setAttachmentLayer(){const{graphic:e}=this,i=Ji(e);this._attachmentLayer=i?i.type==="scene"&&i.associatedLayer!=null?i.associatedLayer:i:null}};a([l()],Y.prototype,"capabilities",void 0),a([qe("capabilities")],Y.prototype,"castCapabilities",null),a([l()],Y.prototype,"activeAttachmentInfo",void 0),a([l()],Y.prototype,"activeFileInfo",void 0),a([l({readOnly:!0,type:ls})],Y.prototype,"attachmentInfos",void 0),a([l()],Y.prototype,"fileInfos",void 0),a([l({type:ze})],Y.prototype,"graphic",void 0),a([l()],Y.prototype,"mode",void 0),a([l({readOnly:!0})],Y.prototype,"state",null),a([l()],Y.prototype,"filesEnabled",void 0),a([l({readOnly:!0})],Y.prototype,"supportsResizeAttachments",null),Y=a([N("esri.widgets.Attachments.AttachmentsViewModel")],Y);const Xt=Y;function wi(t){const e=t.toLowerCase();return e==="image/bmp"||e==="image/emf"||e==="image/exif"||e==="image/gif"||e==="image/x-icon"||e==="image/jpeg"||e==="image/png"||e==="image/tiff"||e==="image/x-wmf"}function Yn(t){const e=Ts("esri/themes/base/images/files/");return t?t==="text/plain"?`${e}text-32.svg`:t==="application/pdf"?`${e}pdf-32.svg`:t==="text/csv"?`${e}csv-32.svg`:t==="application/gpx+xml"?`${e}gpx-32.svg`:t==="application/x-dwf"?`${e}cad-32.svg`:t==="application/postscript"||t==="application/json"||t==="text/xml"||t==="model/vrml"?`${e}code-32.svg`:t==="application/x-zip-compressed"||t==="application/x-7z-compressed"||t==="application/x-gzip"||t==="application/x-tar"||t==="application/x-gtar"||t==="application/x-bzip2"||t==="application/gzip"||t==="application/x-compress"||t==="application/x-apple-diskimage"||t==="application/x-rar-compressed"||t==="application/zip"?`${e}zip-32.svg`:t.includes("image/")?`${e}image-32.svg`:t.includes("audio/")?`${e}sound-32.svg`:t.includes("video/")?`${e}video-32.svg`:t.includes("msexcel")||t.includes("ms-excel")||t.includes("spreadsheetml")?`${e}excel-32.svg`:t.includes("msword")||t.includes("ms-word")||t.includes("wordprocessingml")?`${e}word-32.svg`:t.includes("powerpoint")||t.includes("presentationml")?`${e}report-32.svg`:`${e}generic-32.svg`:`${e}generic-32.svg`}const bi={addButton:!0,addSubmitButton:!0,cancelAddButton:!0,cancelUpdateButton:!0,deleteButton:!0,errorMessage:!0,progressBar:!0,updateButton:!0},x="esri-attachments",b={base:x,loaderContainer:`${x}__loader-container`,loader:`${x}__loader`,fadeIn:`${x}--fade-in`,container:`${x}__container`,containerList:`${x}__container--list`,containerPreview:`${x}__container--preview`,actions:`${x}__actions`,deleteButton:`${x}__delete-button`,addAttachmentButton:`${x}__add-attachment-button`,errorMessage:`${x}__error-message`,items:`${x}__items`,item:`${x}__item`,itemButton:`${x}__item-button`,itemMask:`${x}__item-mask`,itemMaskIcon:`${x}__item-mask--icon`,itemImage:`${x}__image`,itemImageResizable:`${x}__image--resizable`,itemLabel:`${x}__label`,itemFilename:`${x}__filename`,itemChevronIcon:`${x}__item-chevron-icon`,itemLink:`${x}__item-link`,itemLinkOverlay:`${x}__item-link-overlay`,itemLinkOverlayIcon:`${x}__item-link-overlay-icon`,itemEditIcon:`${x}__item-edit-icon`,itemAddIcon:`${x}__item-add-icon`,itemAddButton:`${x}__item-add-button`,formNode:`${x}__form-node`,fileFieldset:`${x}__file-fieldset`,fileLabel:`${x}__file-label`,fileName:`${x}__file-name`,fileInput:`${x}__file-input`,metadata:`${x}__metadata`,metadataFieldset:`${x}__metadata-fieldset`,progressBar:`${x}__progress-bar`},It=window.CSS;let Z=class extends ie{constructor(e,i){super(e,i),this.displayType="auto",this.messages=null,this.messagesUnits=null,this.selectedFile=null,this.submitting=!1,this.viewModel=null,this.visibleElements={...bi},this._supportsImageOrientation=It&&It.supports&&It.supports("image-orientation","from-image"),this._addAttachmentForm=null,this._updateAttachmentForm=null}normalizeCtorArgs(e){return e!=null&&e.viewModel||(e={viewModel:new Xt,...e}),e}initialize(){this.addHandles([Te(()=>{var e;return(e=this.viewModel)==null?void 0:e.attachmentInfos},"change",()=>this.scheduleRender()),Te(()=>{var e;return(e=this.viewModel)==null?void 0:e.fileInfos},"change",()=>this.scheduleRender()),_(()=>{var e;return(e=this.viewModel)==null?void 0:e.mode},()=>this._modeChanged(),P)])}loadDependencies(){return We({icon:()=>E(()=>import("./calcite-icon-CHcIXU52.js"),__vite__mapDeps([0,1,2,3,4,5,6]))})}get capabilities(){return this.viewModel.capabilities}set capabilities(e){this.viewModel.capabilities=e}get effectiveDisplayType(){const{displayType:e}=this;return e&&e!=="auto"?e:this.viewModel.supportsResizeAttachments?"preview":"list"}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get label(){var e;return((e=this.messages)==null?void 0:e.widgetLabel)??""}set label(e){this._overrideIfSome("label",e)}castVisibleElements(e){return{...bi,...e}}addAttachment(){const{_addAttachmentForm:e,viewModel:i}=this;return this._set("submitting",!0),this._set("error",null),i.addAttachment(e).then(s=>(this._set("submitting",!1),this._set("error",null),i.mode="view",s)).catch(s=>{throw this._set("submitting",!1),this._set("error",new R("attachments:add-attachment",this.messages.addErrorMessage,s)),s})}deleteAttachment(e){const{viewModel:i}=this;return this._set("submitting",!0),this._set("error",null),i.deleteAttachment(e).then(s=>(this._set("submitting",!1),this._set("error",null),i.mode="view",s)).catch(s=>{throw this._set("submitting",!1),this._set("error",new R("attachments:delete-attachment",this.messages.deleteErrorMessage,s)),s})}updateAttachment(){const{viewModel:e}=this,{_updateAttachmentForm:i}=this;return this._set("submitting",!0),this._set("error",null),e.updateAttachment(i).then(s=>(this._set("submitting",!1),this._set("error",null),e.mode="view",s)).catch(s=>{throw this._set("submitting",!1),this._set("error",new R("attachments:update-attachment",this.messages.updateErrorMessage,s)),s})}addFile(){const e=this.viewModel.addFile(this.selectedFile,this._addAttachmentForm);return this.viewModel.mode="view",e}updateFile(){const{viewModel:e}=this,i=e.updateFile(this.selectedFile,this._updateAttachmentForm,e.activeFileInfo);return e.mode="view",i}deleteFile(e){var s;const i=this.viewModel.deleteFile(e||((s=this.viewModel.activeFileInfo)==null?void 0:s.file));return this.viewModel.mode="view",i}render(){const{submitting:e,viewModel:i}=this,{state:s}=i;return h("div",{class:this.classes(b.base,I.widget)},e?this._renderProgressBar():null,s==="loading"?this._renderLoading():this._renderAttachments(),this._renderErrorMessage())}_renderErrorMessage(){const{error:e,visibleElements:i}=this;return e&&i.errorMessage?h("div",{class:b.errorMessage,key:"error-message"},e.message):null}_renderAttachments(){const{activeFileInfo:e,mode:i,activeAttachmentInfo:s}=this.viewModel;return i==="add"?this._renderAddForm():i==="edit"?this._renderDetailsForm(s||e):this._renderAttachmentContainer()}_renderLoading(){return h("div",{class:b.loaderContainer,key:"loader"},h("div",{class:b.loader}))}_renderProgressBar(){return this.visibleElements.progressBar?h("div",{class:b.progressBar,key:"progress-bar"}):null}_renderAddForm(){const{submitting:e,selectedFile:i}=this,s=e||!i,n=this.visibleElements.cancelAddButton?h("button",{bind:this,class:this.classes(I.button,I.buttonTertiary,I.buttonSmall,I.buttonHalf,e&&I.buttonDisabled),disabled:e,onclick:this._cancelForm,type:"button"},this.messages.cancel):null,r=this.visibleElements.addSubmitButton?h("button",{class:this.classes(I.button,I.buttonSecondary,I.buttonSmall,I.buttonHalf,{[I.buttonDisabled]:s}),disabled:s,type:"submit"},this.messages.add):null,o=i?h("span",{class:b.fileName,key:"file-name"},i.name):null,d=h("form",{afterCreate:ai,afterRemoved:li,bind:this,"data-node-ref":"_addAttachmentForm",onsubmit:this._submitAddAttachment},h("fieldset",{class:b.fileFieldset},o,h("label",{class:this.classes(b.fileLabel,I.button,I.buttonSecondary)},i?this.messages.changeFile:this.messages.selectFile,h("input",{bind:this,class:b.fileInput,name:"attachment",onchange:this._handleFileInputChange,type:"file"}))),r,n);return h("div",{class:b.formNode,key:"add-form-container"},d)}_renderDetailsForm(e){var M,oe,J;const{visibleElements:i,viewModel:s,selectedFile:n,submitting:r}=this,{capabilities:o}=s,d=r||!n;let c,u,p,m;n?(c=n.type,u=n.name,p=n.size):e&&"file"in e?(c=e.file.type,u=e.file.name,p=e.file.size):e&&"contentType"in e&&(c=e.contentType,u=e.name,p=e.size,m=e.url);const f=o.editing&&((M=o.operations)!=null&&M.delete)&&i.deleteButton?h("button",{bind:this,class:this.classes(I.button,I.buttonSmall,I.buttonTertiary,b.deleteButton,{[I.buttonDisabled]:r}),disabled:r,key:"delete-button",onclick:se=>this._submitDeleteAttachment(se,e),type:"button"},this.messages.delete):void 0,g=o.editing&&((oe=o.operations)!=null&&oe.update)&&i.updateButton?h("button",{class:this.classes(I.button,I.buttonSmall,I.buttonThird,{[I.buttonDisabled]:d}),disabled:d,key:"update-button",type:"submit"},this.messages.update):void 0,y=this.visibleElements.cancelUpdateButton?h("button",{bind:this,class:this.classes(I.button,I.buttonSmall,I.buttonTertiary,I.buttonThird,{[I.buttonDisabled]:r}),disabled:r,key:"cancel-button",onclick:this._cancelForm,type:"button"},this.messages.cancel):void 0,v=o.editing&&((J=o.operations)!=null&&J.update)?h("fieldset",{class:b.fileFieldset,key:"file"},h("span",{class:b.fileName,key:"file-name"},u),h("label",{class:this.classes(b.fileLabel,I.button,I.buttonSecondary)},this.messages.changeFile,h("input",{bind:this,class:b.fileInput,name:"attachment",onchange:this._handleFileInputChange,type:"file"}))):void 0,F=h("fieldset",{class:b.metadataFieldset,key:"size"},h("label",null,yn(this.messagesUnits,p??0))),w=h("fieldset",{class:b.metadataFieldset,key:"content-type"},h("label",null,c)),C=m!=null?h("a",{class:b.itemLink,href:m,rel:"noreferrer",target:"_blank"},this._renderImageMask(e,400),h("div",{class:b.itemLinkOverlay},h("span",{class:b.itemLinkOverlayIcon},h("calcite-icon",{icon:"launch"})))):this._renderImageMask(e,400),k=h("form",{afterCreate:ai,afterRemoved:li,bind:this,"data-node-ref":"_updateAttachmentForm",onsubmit:se=>this._submitUpdateAttachment(se,e)},h("div",{class:b.metadata},F,w),v,h("div",{class:b.actions},f,y,g));return h("div",{class:b.formNode,key:"edit-form-container"},C,k)}_renderImageMask(e,i){return e?"file"in e?this._renderGenericImageMask(e.file.name,e.file.type):this._renderImageMaskForAttachment(e,i):null}_renderGenericImageMask(e,i){const{supportsResizeAttachments:s}=this.viewModel,n=Yn(i),r={[b.itemImageResizable]:s};return h("div",{class:this.classes(b.itemMaskIcon,b.itemMask),key:n},h("img",{alt:e,class:this.classes(r,b.itemImage),src:n,title:e}))}_renderImageMaskForAttachment(e,i){const{supportsResizeAttachments:s}=this.viewModel;if(!e)return null;const{contentType:n,name:r,url:o}=e;if(!s||!wi(n))return this._renderGenericImageMask(r,n);const d=this._getCSSTransform(e),c=d?{transform:d,"image-orientation":"none"}:{},u=`${o}${o!=null&&o.includes("?")?"&":"?"}w=${i}`,p={[b.itemImageResizable]:s};return h("div",{class:this.classes(b.itemMask),key:u},h("img",{alt:r,class:this.classes(p,b.itemImage),src:u,styles:c,title:r}))}_renderFile(e){const{file:i}=e;return h("li",{class:b.item,key:i},h("button",{"aria-label":this.messages.attachmentDetails,bind:this,class:b.itemButton,key:"details-button",onclick:()=>this._startEditFile(e),title:this.messages.attachmentDetails,type:"button"},this._renderImageMask(e),h("label",{class:b.itemLabel},h("span",{class:b.itemFilename},i.name||this.messages.noTitle),h("span",{"aria-hidden":"true",class:this.classes(b.itemChevronIcon,ke(this.container)?re.left:re.right)}))))}_renderAttachmentInfo({attachmentInfo:e,displayType:i}){const{viewModel:s,effectiveDisplayType:n}=this,{capabilities:r,supportsResizeAttachments:o}=s,{contentType:d,name:c,url:u}=e,p=this._renderImageMask(e,i==="list"?48:400),m=r.editing?h("span",{"aria-hidden":"true",class:this.classes(b.itemChevronIcon,ke(this.container)?re.left:re.right)}):null,f=[p,n==="preview"&&o&&wi(d)?null:h("label",{class:b.itemLabel},h("span",{class:b.itemFilename},c||this.messages.noTitle),m)],g=r.editing?h("button",{"aria-label":this.messages.attachmentDetails,bind:this,class:b.itemButton,"data-attachment-info-id":e.id,key:"details-button",onclick:()=>this._startEditAttachment(e),title:this.messages.attachmentDetails,type:"button"},f):h("a",{class:b.itemButton,href:u??void 0,key:"details-link",target:"_blank"},f);return h("li",{class:b.item,key:e},g)}_renderAttachmentContainer(){var y;const{effectiveDisplayType:e,viewModel:i,visibleElements:s}=this,{attachmentInfos:n,capabilities:r,fileInfos:o}=i,d=!!(n!=null&&n.length),c=!!(o!=null&&o.length),u={[b.containerList]:e!=="preview",[b.containerPreview]:e==="preview"},p=r.editing&&((y=r.operations)!=null&&y.add)&&s.addButton?h("button",{bind:this,class:this.classes(I.button,I.buttonTertiary,b.addAttachmentButton),onclick:()=>this._startAddAttachment(),type:"button"},h("span",{"aria-hidden":"true",class:this.classes(b.itemAddIcon,re.plus)}),this.messages.add):void 0,m=d?h("ul",{class:b.items,key:"attachments-list"},n.toArray().map(v=>this._renderAttachmentInfo({attachmentInfo:v,displayType:e}))):void 0,f=c?h("ul",{class:b.items,key:"file-list"},o.toArray().map(v=>this._renderFile(v))):void 0,g=c||d?void 0:h("div",{class:I.empty},this.messages.noAttachments);return h("div",{class:this.classes(b.container,u),key:"attachments-container"},m,f,g,p)}_modeChanged(){this._set("error",null),this._set("selectedFile",null)}_handleFileInputChange(e){var n;const i=e.target,s=(n=i.files)==null?void 0:n.item(0);this._set("selectedFile",s)}_submitDeleteAttachment(e,i){e.preventDefault(),i&&("file"in i?this.deleteFile(i.file):i&&this.deleteAttachment(i))}_submitAddAttachment(e){e.preventDefault(),this.viewModel.filesEnabled?this.addFile():this.addAttachment()}_submitUpdateAttachment(e,i){e.preventDefault(),i&&"file"in i?this.updateFile():this.updateAttachment()}_startEditAttachment(e){const{viewModel:i}=this;i.activeFileInfo=null,i.activeAttachmentInfo=e,i.mode="edit"}_startEditFile(e){const{viewModel:i}=this;i.activeAttachmentInfo=null,i.activeFileInfo=e,i.mode="edit"}_startAddAttachment(){this.viewModel.mode="add"}_cancelForm(e){e.preventDefault(),this.viewModel.mode="view"}_getCSSTransform(e){const{orientationInfo:i}=e;return!this._supportsImageOrientation&&i?[i.rotation?`rotate(${i.rotation}deg)`:"",i.mirrored?"scaleX(-1)":""].join(" "):""}};a([l()],Z.prototype,"capabilities",null),a([l()],Z.prototype,"displayType",void 0),a([l({readOnly:!0})],Z.prototype,"effectiveDisplayType",null),a([l()],Z.prototype,"graphic",null),a([l()],Z.prototype,"label",null),a([l(),te("esri/widgets/Attachments/t9n/Attachments")],Z.prototype,"messages",void 0),a([l(),te("esri/core/t9n/Units")],Z.prototype,"messagesUnits",void 0),a([l({readOnly:!0})],Z.prototype,"selectedFile",void 0),a([l({readOnly:!0})],Z.prototype,"submitting",void 0),a([l({readOnly:!0})],Z.prototype,"error",void 0),a([l({type:Xt})],Z.prototype,"viewModel",void 0),a([l()],Z.prototype,"visibleElements",void 0),a([qe("visibleElements")],Z.prototype,"castVisibleElements",null),Z=a([N("esri.widgets.Attachments")],Z);const Kn=Z;let Ue=class extends Xt{constructor(e){super(e),this.description=null,this.title=null}};a([l()],Ue.prototype,"description",void 0),a([l()],Ue.prototype,"title",void 0),Ue=a([N("esri.widgets.Feature.FeatureAttachments.FeatureAttachmentsViewModel")],Ue);const Yt=Ue;function Kt({level:t,class:e,...i},s){const n=Jn(t);return h(`h${n}`,{...i,"aria-level":String(n),class:ks(I.heading,e),role:"heading"},s)}function Jn(t){return zi(Math.ceil(t),1,6)}const Ft="esri-feature-element-info",At={base:Ft,title:`${Ft}__title`,description:`${Ft}__description`};let Ne=class extends ie{constructor(e,i){super(e,i),this.description=null,this.headingLevel=2,this.title=null}render(){return h("div",{class:At.base},this._renderTitle(),this._renderDescription())}_renderTitle(){const{title:e}=this;return e?h(Kt,{class:At.title,level:this.headingLevel},e):null}_renderDescription(){const{description:e}=this;return e?h("div",{class:At.description,key:"description"},e):null}};a([l()],Ne.prototype,"description",void 0),a([l()],Ne.prototype,"headingLevel",void 0),a([l()],Ne.prototype,"title",void 0),Ne=a([N("esri.widgets.Feature.support.FeatureElementInfo")],Ne);const pt=Ne,er={base:"esri-feature-attachments"};let le=class extends ie{constructor(e,i){super(e,i),this._featureElementInfo=null,this.attachmentsWidget=new Kn,this.headingLevel=2,this.viewModel=new Yt}initialize(){this._featureElementInfo=new pt,this.addHandles([_(()=>{var e,i;return[(e=this.viewModel)==null?void 0:e.description,(i=this.viewModel)==null?void 0:i.title,this.headingLevel]},()=>this._setupFeatureElementInfo(),P),_(()=>this.viewModel,e=>this.attachmentsWidget.viewModel=e,P)])}destroy(){var e;this.attachmentsWidget.viewModel=null,this.attachmentsWidget.destroy(),(e=this._featureElementInfo)==null||e.destroy()}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get displayType(){return this.attachmentsWidget.displayType}set displayType(e){this.attachmentsWidget.displayType=e}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){var i;const{attachmentsWidget:e}=this;return h("div",{class:er.base},(i=this._featureElementInfo)==null?void 0:i.render(),e==null?void 0:e.render())}_setupFeatureElementInfo(){var n;const{description:e,title:i,headingLevel:s}=this;(n=this._featureElementInfo)==null||n.set({description:e,title:i,headingLevel:s})}};a([l({readOnly:!0})],le.prototype,"attachmentsWidget",void 0),a([l()],le.prototype,"description",null),a([l()],le.prototype,"displayType",null),a([l()],le.prototype,"graphic",null),a([l()],le.prototype,"headingLevel",void 0),a([l()],le.prototype,"title",null),a([l({type:Yt})],le.prototype,"viewModel",void 0),le=a([N("esri.widgets.Feature.FeatureAttachments")],le);const tr=le;let _e=class extends fe{constructor(e){super(e),this._loadingPromise=null,this.created=null,this.creator=null,this.destroyer=null,this.graphic=null,this.addHandles(_(()=>this.creator,i=>{this._destroyContent(),this._createContent(i)},P))}destroy(){this._destroyContent()}get state(){return this._loadingPromise?"loading":"ready"}_destroyContent(){const{created:e,graphic:i,destroyer:s}=this;e&&i&&(dt(s,{graphic:i}).catch(()=>null),this._set("created",null))}async _createContent(e){const i=this.graphic;if(!i||!e)return;const s=dt(e,{graphic:i}).catch(()=>null);this._loadingPromise=s,this.notifyChange("state");const n=await s;s===this._loadingPromise&&(this._loadingPromise=null,this.notifyChange("state"),this._set("created",n))}};a([l({readOnly:!0})],_e.prototype,"created",void 0),a([l()],_e.prototype,"creator",void 0),a([l()],_e.prototype,"destroyer",void 0),a([l({type:ze})],_e.prototype,"graphic",void 0),a([l({readOnly:!0})],_e.prototype,"state",null),_e=a([N("esri.widgets.Feature.FeatureContent.FeatureContentViewModel")],_e);const ct=_e;function ds(t){return e=>{e.hasOwnProperty("_delegatedEventNames")||(e._delegatedEventNames=e._delegatedEventNames?e._delegatedEventNames.slice():[]);const i=e._delegatedEventNames,s=Array.isArray(t)?t:ir(t);i.push(...s)}}function ir(t){return t.split(",").map(e=>e.trim())}function cs(t){return t&&typeof t.render=="function"}function sr(t){return t&&typeof t.postMixInProperties=="function"&&typeof t.buildRendering=="function"&&typeof t.postCreate=="function"&&typeof t.startup=="function"}const Ct="esri-feature-content",Et={base:Ct,loaderContainer:`${Ct}__loader-container`,loader:`${Ct}__loader`};let Ve=class extends ie{constructor(e,i){super(e,i),this.viewModel=null,this._addTargetToAnchors=s=>{Array.from(s.querySelectorAll("a")).forEach(n=>{es(n.href)&&!n.hasAttribute("target")&&n.setAttribute("target","_blank")})}}get creator(){var e;return(e=this.viewModel)==null?void 0:e.creator}set creator(e){this.viewModel&&(this.viewModel.creator=e)}get graphic(){var e;return(e=this.viewModel)==null?void 0:e.graphic}set graphic(e){this.viewModel&&(this.viewModel.graphic=e)}render(){var i;const e=(i=this.viewModel)==null?void 0:i.state;return h("div",{class:Et.base},e==="loading"?this._renderLoading():this._renderCreated())}_renderLoading(){return h("div",{class:Et.loaderContainer,key:"loader"},h("div",{class:Et.loader}))}_renderCreated(){var i;const e=(i=this.viewModel)==null?void 0:i.created;return e?e instanceof HTMLElement?h("div",{afterCreate:this._attachToNode,bind:e,key:e}):cs(e)?h("div",{key:e},!e.destroyed&&e.render()):h("div",{afterCreate:this._addTargetToAnchors,innerHTML:e,key:e}):null}_attachToNode(e){const i=this;e.appendChild(i)}};a([l()],Ve.prototype,"creator",null),a([l()],Ve.prototype,"graphic",null),a([l({type:ct})],Ve.prototype,"viewModel",void 0),Ve=a([N("esri.widgets.Feature.FeatureContent")],Ve);const it=Ve;let he=class extends fe{constructor(e){super(e),this.attributes=null,this.expressionInfos=null,this.description=null,this.fieldInfos=null,this.title=null}get formattedFieldInfos(){const{expressionInfos:e,fieldInfos:i}=this,s=[];return i==null||i.forEach(n=>{if(!(!n.hasOwnProperty("visible")||n.visible))return;const r=n.clone();r.label=ts(r,e),s.push(r)}),s}};a([l()],he.prototype,"attributes",void 0),a([l({type:[Ls]})],he.prototype,"expressionInfos",void 0),a([l()],he.prototype,"description",void 0),a([l({type:[Hi]})],he.prototype,"fieldInfos",void 0),a([l({readOnly:!0})],he.prototype,"formattedFieldInfos",null),a([l()],he.prototype,"title",void 0),he=a([N("esri.widgets.Feature.FeatureFields.FeatureFieldsViewModel")],he);const mt=he,nr=[{pattern:/^\s*(https?:\/\/([^\s]+))\s*$/i,target:"_blank",label:"{messages.view}"},{pattern:/^\s*(tel:([^\s]+))\s*$/i,label:"{hierPart}"},{pattern:/^\s*(mailto:([^\s]+))\s*$/i,label:"{hierPart}"},{pattern:/^\s*(arcgis-appstudio-player:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"App Studio Player"},{pattern:/^\s*(arcgis-collector:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Collector"},{pattern:/^\s*(arcgis-explorer:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Explorer"},{pattern:/^\s*(arcgis-navigator:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Navigator"},{pattern:/^\s*(arcgis-survey123:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Survey123"},{pattern:/^\s*(arcgis-trek2there:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Trek2There"},{pattern:/^\s*(arcgis-workforce:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Workforce"},{pattern:/^\s*(iform:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"iForm"},{pattern:/^\s*(flow:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"FlowFinity"},{pattern:/^\s*(lfmobile:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Laserfische"},{pattern:/^\s*(mspbi:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Microsoft Power Bi"}];function rr(t,e){if(typeof e!="string"||!e)return e;const i=nr.find(c=>c.pattern.test(e));if(!i)return e;const s=e.match(i.pattern),n=s&&s[2],r=De(De(i.label,{messages:t,hierPart:n}),{appName:i.appName}),o=i.target?` target="${i.target}"`:"",d=i.target==="_blank"?' rel="noreferrer"':"";return e.replace(i.pattern,`${r}`)}const Ke="esri-feature-fields",Je={base:Ke,fieldHeader:`${Ke}__field-header`,fieldData:`${Ke}__field-data`,fieldDataDate:`${Ke}__field-data--date`};let ae=class extends ie{constructor(e,i){super(e,i),this._featureElementInfo=null,this.viewModel=new mt,this.messages=null,this.messagesURIUtils=null}initialize(){this._featureElementInfo=new pt,this.addHandles(_(()=>{var e,i;return[(e=this.viewModel)==null?void 0:e.description,(i=this.viewModel)==null?void 0:i.title]},()=>this._setupFeatureElementInfo(),P))}destroy(){var e;(e=this._featureElementInfo)==null||e.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get expressionInfos(){return this.viewModel.expressionInfos}set expressionInfos(e){this.viewModel.expressionInfos=e}get fieldInfos(){return this.viewModel.fieldInfos}set fieldInfos(e){this.viewModel.fieldInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){var e;return h("div",{class:Je.base},(e=this._featureElementInfo)==null?void 0:e.render(),this._renderFields())}_renderFieldInfo(e,i){const{attributes:s}=this.viewModel,n=e.fieldName,r=e.label||n,o=s?s[n]==null?"":s[n]:"",d=!(!e.format||!e.format.dateFormat),c=typeof o=="number"&&!d?this._forceLTR(o):rr(this.messagesURIUtils,o),u={[Je.fieldDataDate]:d};return h("tr",{key:`fields-element-info-row-${n}-${i}`},h("th",{class:Je.fieldHeader,innerHTML:r,key:`fields-element-info-row-header-${n}-${i}`}),h("td",{class:this.classes(Je.fieldData,u),innerHTML:c,key:`fields-element-info-row-data-${n}-${i}`}))}_renderFields(){const{formattedFieldInfos:e}=this.viewModel;return e!=null&&e.length?h("table",{class:I.table,summary:this.messages.fieldsSummary},h("tbody",null,e.map((i,s)=>this._renderFieldInfo(i,s)))):null}_setupFeatureElementInfo(){var s;const{description:e,title:i}=this;(s=this._featureElementInfo)==null||s.set({description:e,title:i})}_forceLTR(e){return`‎${e}`}};a([l()],ae.prototype,"attributes",null),a([l()],ae.prototype,"description",null),a([l()],ae.prototype,"expressionInfos",null),a([l()],ae.prototype,"fieldInfos",null),a([l()],ae.prototype,"title",null),a([l({type:mt,nonNullable:!0})],ae.prototype,"viewModel",void 0),a([l(),te("esri/widgets/Feature/t9n/Feature")],ae.prototype,"messages",void 0),a([l(),te("esri/widgets/support/t9n/uriUtils")],ae.prototype,"messagesURIUtils",void 0),ae=a([N("esri.widgets.Feature.FeatureFields")],ae);const us=ae,or=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,ar={maximumFractionDigits:20};function lr(t){return xe(t,ar)}const dr="<",cr=">";function ur(t,e,i,s){let n="";return e===0?n=`${dr} `:e===i&&(n=`${cr} `),n+(s?jt(t,s):lr(t))}const hr=new ji([64,64,64]);function pr(t,e){const i=[],s=t.length-1;return t.length===5?i.push(0,2,4):i.push(0,s),t.map((n,r)=>i.includes(r)?ur(n,r,s,e):null)}async function mr(t,e,i){let s=!1,n=[],r=[];if(t.stops){const u=t.stops;n=u.map(p=>p.value),s=u.some(p=>!!p.label),s&&(r=u.map(p=>p.label))}const o=n[0],d=n[n.length-1];if(o==null&&d==null)return null;const c=s?null:pr(n,i);return(await Promise.all(n.map(async(u,p)=>({value:u,color:t.type==="opacity"?await fr(u,t,e):(await E(()=>import("./visualVariableUtils-z2k12BH8.js"),__vite__mapDeps([7,2,3,8]))).getColor(t,u),label:s?r[p]:(c==null?void 0:c[p])??""})))).reverse()}async function fr(t,e,i){const s=new ji(i??hr),n=(await E(()=>import("./visualVariableUtils-z2k12BH8.js"),__vite__mapDeps([7,2,3,8]))).getOpacity(e,t);return n!=null&&(s.a=n),s}function gr(t){if(!t.colorStops)return[];const e=[...t.colorStops].filter(s=>{var n;return((n=s.color)==null?void 0:n.a)>0});let i=e.length-1;if(e&&e[0]){const s=e[i];s&&s.ratio!==1&&(e.push(new hn({ratio:1,color:s.color})),i++)}return e.map((s,n)=>{var o,d;let r="";return n===0?r=((o=t.legendOptions)==null?void 0:o.minLabel)||"low":n===i&&(r=((d=t.legendOptions)==null?void 0:d.maxLabel)||"high"),{color:s.color,label:r,ratio:s.ratio}}).reverse()}async function ee(t,e,i){Rs(t,e,()=>[]).push(...i)}async function _r(t){var i,s;const e=new Map;if(!t)return e;if("visualVariables"in t&&t.visualVariables){const n=t.visualVariables.filter(r=>r.type==="color");for(const r of n){const o=(await mr(r)??[]).map(d=>d.color);await ee(e,r.field||r.valueExpression,o)}}if(t.type==="heatmap"){const n=gr(t).map(r=>r.color);await ee(e,t.field||t.valueExpression,n)}else if(t.type==="pie-chart"){for(const n of t.attributes)await ee(e,n.field||n.valueExpression,[n.color]);await ee(e,"default",[(i=t==null?void 0:t.othersCategory)==null?void 0:i.color,Oe(t.backgroundFillSymbol,null)])}else if(t.type==="dot-density"){for(const n of t.attributes)await ee(e,n.field||n.valueExpression,[n.color]);await ee(e,"default",[t.backgroundColor])}else if(t.type==="unique-value")if(((s=t.authoringInfo)==null?void 0:s.type)==="predominance")for(const n of t.uniqueValueInfos??[])await ee(e,n.value.toString(),[Oe(n.symbol,null)]);else{const n=(t.uniqueValueInfos??[]).map(u=>Oe(u.symbol,null)),{field:r,field2:o,field3:d,valueExpression:c}=t;(r||c)&&await ee(e,r||c,n),o&&await ee(e,o,n),d&&await ee(e,d,n)}else if(t.type==="class-breaks"){const n=t.classBreakInfos.map(d=>Oe(d.symbol,null)),{field:r,valueExpression:o}=t;await ee(e,r??o,n)}else t.type==="simple"&&await ee(e,"default",[Oe(t.symbol,null)]);return"defaultSymbol"in t&&t.defaultSymbol&&await ee(e,"default",[Oe(t.defaultSymbol,null)]),e.forEach((n,r)=>{const o=Wt(n.filter(Boolean),(d,c)=>JSON.stringify(d)===JSON.stringify(c));e.set(r,o)}),e}const yr="esri.widgets.Feature.support.relatedFeatureUtils",Mi=()=>z.getLogger(yr),Ii=new Map;function st(t){if(!me(t))return null;const[e,i]=t.split("/").slice(1);return{layerId:e,fieldName:i}}function vr(t,e){if(!e.relationships)return null;let i=null;const{relationships:s}=e;return s.some(n=>n.id===parseInt(t,10)&&(i=n,!0)),i}function wr({originRelationship:t,relationships:e,layerId:i}){return e.find(({relatedTableId:s,id:n})=>`${s}`===i&&n===(t==null?void 0:t.id))??null}function br(t,e){const i=e.toLowerCase();for(const s in t)if(s.toLowerCase()===i)return t[s];return null}function Mr(t,e){const i=vr(t,e);if(i)return{url:`${e.url}/${i.relatedTableId}`,sourceSpatialReference:e.spatialReference,relation:i,relatedFields:[],outStatistics:[]}}function Ir(t,e){if(!e||!t)return;const{features:i,statsFeatures:s}=t,n=i==null?void 0:i.value;e.relatedFeatures=n?n.features:[];const r=s==null?void 0:s.value;e.relatedStatsFeatures=r?r.features:[]}function Fr(t,e,i,s){var r;const n=new Ot;return n.outFields=["*"],n.relationshipId=typeof e.id=="number"?e.id:parseInt(e.id,10),n.objectIds=[t.attributes[i.objectIdField]],((r=i.queryRelatedFeatures)==null?void 0:r.call(i,n,s))??Promise.resolve({})}function Ar(t,e,i){let s=0;const n=[];for(;sJSON.stringify(e.toJSON())===JSON.stringify(i.toJSON())):void 0}async function $r(t,e,i,s){const n=i.layerId.toString(),{layerInfo:r,relation:o,relatedFields:d,outStatistics:c,url:u,sourceSpatialReference:p}=e,m=Cr(d),f=Er(c);if(!r||!o)return null;const g=wr({originRelationship:o,relationships:r.relationships,layerId:n});if(g!=null&&g.relationshipTableId&&g.keyFieldInRelationshipTable){const v=(await Fr(t,g,i,s))[t.attributes[i.objectIdField]];if(!v)return null;const F=v.features.map(w=>w.attributes[r.objectIdField]);if(f!=null&&f.length&&r.supportsStatistics){const w=new _t;w.where=Ar(r.objectIdField,F,1e3),w.outFields=m,w.outStatistics=f,w.sourceSpatialReference=p;const C={features:Promise.resolve(v),statsFeatures:wt(u,w)};return Le(C)}}const y=g==null?void 0:g.keyField;if(y){const v=Ns(Rr(r.fields,y)),F=br(t.attributes,o.keyField),w=v?`${y}=${F}`:`${y}='${F}'`,C=wt(u,new _t({where:w,outFields:m,sourceSpatialReference:p}),s),k=f!=null&&f.length&&r.supportsStatistics?wt(u,new _t({where:w,outFields:m,outStatistics:f,sourceSpatialReference:p}),s):null,M={features:C};return k&&(M.statsFeatures=k),Le(M)}return null}function xr(t,e){return Vs(t,{query:{f:"json"},signal:e==null?void 0:e.signal})}function Tr({relatedInfos:t,layer:e},i){const s={};return t.forEach((n,r)=>{const{relation:o}=n;if(!o){const m=new R("relation-required","A relation is required on a layer to retrieve related records.");throw Mi().error(m),m}const{relatedTableId:d}=o;if(typeof d!="number"){const m=new R("A related table ID is required on a layer to retrieve related records.");throw Mi().error(m),m}const c=`${e.url}/${d}`,u=Ii.get(c),p=u??xr(c);u||Ii.set(c,p),s[r]=p}),Ps(Le(s),i)}function kr({graphic:t,relatedInfos:e,layer:i},s){const n={};return e.forEach((r,o)=>{r.layerInfo&&(n[o]=$r(t,r,i,s))}),Le(n)}function Lr({relatedInfo:t,fieldName:e,fieldInfo:i}){var s,n;if((s=t.relatedFields)==null||s.push(e),i.statisticType){const r=new Os({statisticType:i.statisticType,onStatisticField:e,outStatisticFieldName:e});(n=t.outStatistics)==null||n.push(r)}}function Rr(t,e){if(t!=null){e=e.toLowerCase();for(const i of t)if(i&&i.name.toLowerCase()===e)return i}return null}const Fi={chartAnimation:!0};let B=class extends fe{constructor(e){super(e),this.abilities={...Fi},this.activeMediaInfoIndex=0,this.attributes=null,this.description=null,this.fieldInfoMap=null,this.formattedAttributes=null,this.expressionAttributes=null,this.isAggregate=!1,this.layer=null,this.mediaInfos=null,this.popupTemplate=null,this.relatedInfos=null,this.title=null}castAbilities(e){return{...Fi,...e}}get activeMediaInfo(){return this.formattedMediaInfos[this.activeMediaInfoIndex]||null}get formattedMediaInfos(){return this._formatMediaInfos()||[]}get formattedMediaInfoCount(){return this.formattedMediaInfos.length}setActiveMedia(e){this._setContentElementMedia(e)}next(){this._pageContentElementMedia(1)}previous(){this._pageContentElementMedia(-1)}_setContentElementMedia(e){const{formattedMediaInfoCount:i}=this,s=(e+i)%i;this.activeMediaInfoIndex=s}_pageContentElementMedia(e){const{activeMediaInfoIndex:i}=this,s=i+e;this._setContentElementMedia(s)}_formatMediaInfos(){const{mediaInfos:e,layer:i}=this,s=this.attributes??{},n=this.formattedAttributes??{},r=this.expressionAttributes??{},o=this.fieldInfoMap??new Map;return(e==null?void 0:e.map(d=>{const c=d==null?void 0:d.clone();if(!c)return null;if(c.title=Ae({attributes:s,fieldInfoMap:o,globalAttributes:n,expressionAttributes:r,layer:i,text:c.title}),c.caption=Ae({attributes:s,fieldInfoMap:o,globalAttributes:n,expressionAttributes:r,layer:i,text:c.caption}),c.altText=Ae({attributes:s,fieldInfoMap:o,globalAttributes:n,expressionAttributes:r,layer:i,text:c.altText}),c.type==="image"){const{value:u}=c;return this._setImageValue({value:u,formattedAttributes:n,layer:i}),c.value.sourceURL?c:void 0}if(c.type==="pie-chart"||c.type==="line-chart"||c.type==="column-chart"||c.type==="bar-chart"){const{value:u}=c;return this._setChartValue({value:u,chartType:c.type,attributes:s,formattedAttributes:n,layer:i,expressionAttributes:r}),c}return null}).filter(ht))??[]}_setImageValue(e){const i=this.fieldInfoMap??new Map,{value:s,formattedAttributes:n,layer:r}=e,{linkURL:o,sourceURL:d}=s;if(d){const c=St(d,r);s.sourceURL=Vt({formattedAttributes:n,template:c,fieldInfoMap:i})}if(o){const c=St(o,r);s.linkURL=Vt({formattedAttributes:n,template:c,fieldInfoMap:i})}}_setChartValue(e){const{value:i,attributes:s,formattedAttributes:n,chartType:r,layer:o,expressionAttributes:d}=e,{popupTemplate:c,relatedInfos:u}=this,{fields:p,normalizeField:m}=i,f=o;if(i.fields=Tn(p,f),m&&(i.normalizeField=Ge(m,f)),!p.some(y=>!!(n[y]!=null||me(y)&&(u!=null&&u.size))))return;const g=(c==null?void 0:c.fieldInfos)??[];p.forEach((y,v)=>{var C;const F=(C=i.colors)==null?void 0:C[v];if(me(y))return void(i.series=[...i.series,...this._getRelatedChartInfos({fieldInfos:g,fieldName:y,formattedAttributes:n,chartType:r,value:i,color:F})]);const w=this._getChartOption({value:i,attributes:s,chartType:r,formattedAttributes:n,expressionAttributes:d,fieldName:y,fieldInfos:g,color:F});i.series.push(w)})}_getRelatedChartInfos(e){var y;const{fieldInfos:i,fieldName:s,formattedAttributes:n,chartType:r,value:o,color:d}=e,c=[],u=st(s),p=u&&((y=this.relatedInfos)==null?void 0:y.get(u.layerId.toString()));if(!p)return c;const{relatedFeatures:m,relation:f}=p;if(!f||!m)return c;const{cardinality:g}=f;return m.forEach(v=>{const{attributes:F}=v;F&&Object.keys(F).forEach(w=>{w===u.fieldName&&c.push(this._getChartOption({value:o,attributes:F,formattedAttributes:n,fieldName:s,chartType:r,relatedFieldName:w,hasMultipleRelatedFeatures:(m==null?void 0:m.length)>1,fieldInfos:i,color:d}))})}),g==="one-to-many"||g==="many-to-many"?c:[c[0]]}_getTooltip({label:e,value:i,chartType:s}){return s==="pie-chart"?`${e}`:`${e}: ${i}`}_getChartOption(e){var se;const{value:i,attributes:s,formattedAttributes:n,expressionAttributes:r,fieldName:o,relatedFieldName:d,fieldInfos:c,chartType:u,hasMultipleRelatedFeatures:p,color:m}=e,f=this.layer,g=this.fieldInfoMap??new Map,{normalizeField:y,tooltipField:v}=i,F=y?me(y)?s[st(y).fieldName]:s[y]:null,w=Zt(o)&&r&&r[o]!==void 0?r[o]:d&&s[d]!==void 0?s[d]:s[o]!==void 0?s[o]:n[o],C=new Ss({fieldName:o,color:m,value:w===void 0?null:w&&F?w/F:w});if(me(o)){const j=g.get(o.toLowerCase()),ft=v&&g.get(v.toLowerCase()),Ms=(j==null?void 0:j.fieldName)??o,gt=p&&v?st(v).fieldName:(ft==null?void 0:ft.fieldName)??v,Is=p&>?s[gt]:n[gt]??(j==null?void 0:j.label)??(j==null?void 0:j.fieldName)??d,Fs=p&&d?s[d]:n[Ms];return C.tooltip=this._getTooltip({label:Is,value:Fs,chartType:u}),C}const k=ns(c,o),M=Ge(o,f),oe=v&&n[v]!==void 0?n[v]:ts(k||new Hi({fieldName:M}),(se=this.popupTemplate)==null?void 0:se.expressionInfos),J=n[M];return C.tooltip=this._getTooltip({label:oe,value:J,chartType:u}),C}};a([l()],B.prototype,"abilities",void 0),a([qe("abilities")],B.prototype,"castAbilities",null),a([l()],B.prototype,"activeMediaInfoIndex",void 0),a([l({readOnly:!0})],B.prototype,"activeMediaInfo",null),a([l()],B.prototype,"attributes",void 0),a([l()],B.prototype,"description",void 0),a([l()],B.prototype,"fieldInfoMap",void 0),a([l()],B.prototype,"formattedAttributes",void 0),a([l()],B.prototype,"expressionAttributes",void 0),a([l({readOnly:!0})],B.prototype,"formattedMediaInfos",null),a([l()],B.prototype,"isAggregate",void 0),a([l()],B.prototype,"layer",void 0),a([l({readOnly:!0})],B.prototype,"formattedMediaInfoCount",null),a([l()],B.prototype,"mediaInfos",void 0),a([l()],B.prototype,"popupTemplate",void 0),a([l()],B.prototype,"relatedInfos",void 0),a([l()],B.prototype,"title",void 0),B=a([N("esri.widgets.Feature.FeatureMedia.FeatureMediaViewModel")],B);const Ce=B,S="esri-feature-media",Q={base:S,mediaContainer:`${S}__container`,mediaItemContainer:`${S}__item-container`,mediaItem:`${S}__item`,mediaItemText:`${S}__item-text`,mediaItemTitle:`${S}__item-title`,mediaItemCaption:`${S}__item-caption`,mediaNavigation:`${S}__item-navigation`,mediaPagination:`${S}__pagination`,mediaPaginationText:`${S}__pagination-text`,mediaPrevious:`${S}__previous`,mediaPreviousIconLTR:`${S}__previous-icon`,mediaPreviousIconRTL:`${S}__previous-icon--rtl`,mediaNext:`${S}__next`,mediaNextIconLTR:`${S}__next-icon`,mediaNextIconRTL:`${S}__next-icon--rtl`,mediaChart:`${S}__chart`,mediaPaginationButton:`${S}__pagination-button`,mediaPaginationIcon:`${S}__pagination-icon`,mediaChartRendered:`${S}__chart--rendered`},$t=15,ge="category",He="value",Pr="rgba(50, 50, 50, 1)",Or=250,Nr=500,Vr=200;let G=class extends ie{constructor(e,i){super(e,i),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this._chartRootMap=new WeakMap,this.viewModel=new Ce,this.messages=null,this._disposeChart=s=>{var n;(n=this._chartRootMap.get(s))==null||n.dispose(),this._chartRootMap.delete(s)},this._createChart=async s=>{const{destroyed:n,viewModel:r}=this;if(n||!r||!s)return;const{createRoot:o}=await E(()=>import("./chartUtilsAm5-DYfwNDSz.js"),__vite__mapDeps([9,2,3,10,11,12])),d=await o(s);this._chartRootMap.set(s,d),this._renderChart({mediaInfo:r.activeMediaInfo,root:d})}}initialize(){this._featureElementInfo=new pt,this.addHandles([_(()=>{var e,i;return[(e=this.viewModel)==null?void 0:e.activeMediaInfo,(i=this.viewModel)==null?void 0:i.activeMediaInfoIndex]},()=>this._setupMediaRefreshTimer(),P),_(()=>{var e,i;return[(e=this.viewModel)==null?void 0:e.description,(i=this.viewModel)==null?void 0:i.title]},()=>this._setupFeatureElementInfo(),P)])}loadDependencies(){return We({icon:()=>E(()=>import("./calcite-icon-CHcIXU52.js"),__vite__mapDeps([0,1,2,3,4,5,6]))})}destroy(){var e;this._clearMediaRefreshTimer(),(e=this._featureElementInfo)==null||e.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get activeMediaInfoIndex(){return this.viewModel.activeMediaInfoIndex}set activeMediaInfoIndex(e){this.viewModel.activeMediaInfoIndex=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get fieldInfoMap(){return this.viewModel.fieldInfoMap}set fieldInfoMap(e){this.viewModel.fieldInfoMap=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get mediaInfos(){return this.viewModel.mediaInfos}set mediaInfos(e){this.viewModel.mediaInfos=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get relatedInfos(){return this.viewModel.relatedInfos}set relatedInfos(e){this.viewModel.relatedInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){var e;return h("div",{bind:this,class:Q.base,onkeyup:this._handleMediaKeyup},(e=this._featureElementInfo)==null?void 0:e.render(),this._renderMedia())}_renderMedia(){const{formattedMediaInfoCount:e,activeMediaInfoIndex:i}=this.viewModel,s=this._renderMediaText();return e?h("div",{class:Q.mediaContainer,key:"media-element-container"},this._renderMediaInfo(),h("div",{class:Q.mediaNavigation},s,e>1?h("div",{class:Q.mediaPagination},this._renderMediaPageButton("previous"),h("span",{class:Q.mediaPaginationText},ce(this.messages.pageText,{index:i+1,total:e})),this._renderMediaPageButton("next")):null)):null}_renderMediaText(){const{activeMediaInfo:e}=this.viewModel;if(!e)return null;const i=e&&e.title?h("div",{class:Q.mediaItemTitle,innerHTML:e.title,key:"media-title"}):null,s=e&&e.caption?h("div",{class:Q.mediaItemCaption,innerHTML:e.caption,key:"media-caption"}):null;return i||s?h("div",{class:Q.mediaItemText,key:"media-text"},i,s):null}_renderImageMediaInfo(e){const{_refreshIntervalInfo:i}=this,{activeMediaInfoIndex:s,formattedMediaInfoCount:n}=this.viewModel,{value:r,refreshInterval:o,altText:d,title:c,type:u}=e,{sourceURL:p,linkURL:m}=r,f=es(m??void 0)?"_blank":"_self",g=f==="_blank"?"noreferrer":"",y=o?i:null,v=y?y.timestamp:0,F=y?y.sourceURL:p,w=h("img",{alt:d||c,key:`media-${u}-${s}-${n}-${v}`,src:F??void 0});return(m?h("a",{href:m,rel:g,target:f,title:c},w):null)??w}_renderChartMediaInfo(e){const{activeMediaInfoIndex:i,formattedMediaInfoCount:s}=this.viewModel;return h("div",{afterCreate:this._createChart,afterRemoved:this._disposeChart,bind:this,class:Q.mediaChart,key:`media-${e.type}-${i}-${s}`})}_renderMediaInfoType(){const{activeMediaInfo:e}=this.viewModel;return e?e.type==="image"?this._renderImageMediaInfo(e):e.type.includes("chart")?this._renderChartMediaInfo(e):null:null}_renderMediaInfo(){const{activeMediaInfo:e}=this.viewModel;return e?h("div",{class:Q.mediaItemContainer,key:"media-container"},h("div",{class:Q.mediaItem,key:"media-item-container"},this._renderMediaInfoType())):null}_renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const i=e==="previous",s=i?this.messages.previous:this.messages.next,n=i?"chevron-left":"chevron-right",r=i?"media-previous":"media-next",o=i?this._previous:this._next;return h("button",{"aria-label":s,bind:this,class:Q.mediaPaginationButton,key:r,onclick:o,tabIndex:0,title:s,type:"button"},h("calcite-icon",{class:Q.mediaPaginationIcon,icon:n,scale:"s"}))}_setupFeatureElementInfo(){var s;const{description:e,title:i}=this;(s=this._featureElementInfo)==null||s.set({description:e,title:i})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){if(!this.viewModel)return;const{isAggregate:e,layer:i}=this.viewModel;return e&&(i!=null&&i.featureReduction)&&"renderer"in i.featureReduction?i.featureReduction.renderer:i==null?void 0:i.renderer}async _getSeriesColors(e){const{colorAm5:i}=await E(()=>import("./chartCommon-DeDLy4W7.js"),__vite__mapDeps([13,10,2,3,14,11,15])),s=new Map;return e.forEach(n=>{n.color&&s.set(n,i(n.color.toCss(!0)))}),s}async _getRendererColors(){const{colorAm5:e}=await E(()=>import("./chartCommon-DeDLy4W7.js"),__vite__mapDeps([13,10,2,3,14,11,15])),i=new Map,s=this._getRenderer(),n="default";if(!s)return i;const r=await _r(s);return r.delete(n),Array.from(r.values()).every(o=>(o==null?void 0:o.length)===1)&&Array.from(r.keys()).forEach(o=>{var c,u;const d=(u=(c=r.get(o))==null?void 0:c[0])==null?void 0:u.toCss(!0);d&&i.set(o,e(d))}),i}_handleMediaKeyup(e){const{key:i}=e;i==="ArrowLeft"&&(e.stopPropagation(),this.viewModel.previous()),i==="ArrowRight"&&(e.stopPropagation(),this.viewModel.next())}_canAnimateChart(){return!!this.viewModel&&!!this.viewModel.abilities.chartAnimation&&!or()}_getChartAnimationMS(){return this._canAnimateChart()?Or:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?Nr:0}async _renderChart(e){const{root:i,mediaInfo:s}=e,{value:n,type:r}=s,{ResponsiveThemeAm5:o,DarkThemeAm5:d,AnimatedThemeAm5:c,ColorSetAm5:u,ThemeAm5:p,esriChartColorSet:m}=await E(()=>import("./chartCommon-DeDLy4W7.js"),__vite__mapDeps([13,10,2,3,14,11,15])),f=p.new(i);f.rule("ColorSet").set("colors",m),f.rule("ColorSet").set("reuse",!0);const g=[o.new(i),f];Ds()&&g.push(d.new(i)),this._canAnimateChart()&&g.push(c.new(i)),i.setThemes(g);const y=await this._getRendererColors(),v=await this._getSeriesColors(n.series),F=u.new(i,{}),w=v.get(n.series[0]),C=w?{lineSettings:{stroke:w}}:void 0,k=n.series.map((M,oe)=>{const J=v.get(M)||y.get(M.fieldName)||F.getIndex(oe);return{[ge]:M.tooltip,[He]:M.value,columnSettings:{fill:J,stroke:J},...C}}).filter(M=>r!=="pie-chart"||M.value!=null&&M.value>0);r==="pie-chart"?this._createPieChart(e,k):this._createXYChart(e,k)}_getDirection(){return ke(this.container)?"rtl":"ltr"}_isInversed(){return!!ke(this.container)}async _customizeChartTooltip(e,i="horizontal"){var n;const{colorAm5:s}=await E(()=>import("./chartCommon-DeDLy4W7.js"),__vite__mapDeps([13,10,2,3,14,11,15]));e.setAll({pointerOrientation:i}),(n=e.get("background"))==null||n.setAll({stroke:s(Pr)}),e.label.setAll({direction:this._getDirection(),oversizedBehavior:"wrap",maxWidth:Vr})}async _createPieChart(e,i){const{TooltipAm5:s}=await E(()=>import("./chartCommon-DeDLy4W7.js"),__vite__mapDeps([13,10,2,3,14,11,15])),{PieChartAm5:n,PieSeriesAm5:r}=await E(()=>import("./pieChart-D4IZYqRN.js"),__vite__mapDeps([16,2,3,17,10,15,12])),{mediaInfo:o,root:d}=e,{title:c}=o,u=5,p=(o==null?void 0:o.altText)||(o==null?void 0:o.title)||"",m=d.container.children.push(n.new(d,{ariaLabel:p,focusable:!0,paddingBottom:u,paddingTop:u,paddingLeft:u,paddingRight:u})),f=`{category}: {valuePercentTotal.formatNumber('0.00')}% - ({value})`,g=s.new(d,{labelText:f}),y=m.series.push(r.new(d,{name:c,valueField:He,categoryField:ge,tooltip:g}));y.ticks.template.set("forceHidden",!0),y.labels.template.set("forceHidden",!0),y.slices.template.states.create("active",{shiftRadius:u}),this._customizeChartTooltip(g),y.slices.template.setAll({ariaLabel:f,focusable:!0,templateField:"columnSettings"}),y.data.setAll(i),y.appear(this._getChartSeriesAnimationMS()),m.appear(this._getChartAnimationMS()),m.root.dom.classList.toggle(Q.mediaChartRendered,!0)}_getMinSeriesValue(e){let i=0;return e.forEach(s=>i=Math.min(s.value,i)),i}async _createColumnChart(e,i,s){const{TooltipAm5:n,ScrollbarAm5:r}=await E(()=>import("./chartCommon-DeDLy4W7.js"),__vite__mapDeps([13,10,2,3,14,11,15])),{CategoryAxisAm5:o,AxisRendererXAm5:d,ValueAxisAm5:c,AxisRendererYAm5:u,ColumnSeriesAm5:p}=await E(()=>import("./xyChart-CZRgKOoN.js"),__vite__mapDeps([18,10,2,3,15,12,17,14])),{mediaInfo:m,root:f}=i,{value:g,title:y}=m;e.setAll({wheelX:"panX",wheelY:"zoomX"});const v=e.xAxes.push(o.new(f,{renderer:d.new(f,{inversed:this._isInversed()}),categoryField:ge}));v.get("renderer").labels.template.setAll({forceHidden:!0});const F=e.yAxes.push(c.new(f,{renderer:u.new(f,{inside:!1}),min:this._getMinSeriesValue(g.series)}));F.get("renderer").labels.template.setAll({direction:this._getDirection()});const w="{categoryX}",C=n.new(f,{labelText:w}),k=e.series.push(p.new(f,{name:y,xAxis:v,yAxis:F,valueYField:He,categoryXField:ge,tooltip:C}));this._customizeChartTooltip(C),k.columns.template.setAll({ariaLabel:w,focusable:!0,templateField:"columnSettings"}),g.series.length>$t&&e.set("scrollbarX",r.new(f,{orientation:"horizontal"})),v.data.setAll(s),k.data.setAll(s),k.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createBarChart(e,i,s){const{TooltipAm5:n,ScrollbarAm5:r}=await E(()=>import("./chartCommon-DeDLy4W7.js"),__vite__mapDeps([13,10,2,3,14,11,15])),{CategoryAxisAm5:o,AxisRendererXAm5:d,ValueAxisAm5:c,AxisRendererYAm5:u,ColumnSeriesAm5:p}=await E(()=>import("./xyChart-CZRgKOoN.js"),__vite__mapDeps([18,10,2,3,15,12,17,14])),{mediaInfo:m,root:f}=i,{value:g,title:y}=m;e.setAll({wheelX:"panY",wheelY:"zoomY"});const v=e.yAxes.push(o.new(f,{renderer:u.new(f,{inversed:!0}),categoryField:ge}));v.get("renderer").labels.template.setAll({forceHidden:!0});const F=e.xAxes.push(c.new(f,{renderer:d.new(f,{inside:!1,inversed:this._isInversed()}),min:this._getMinSeriesValue(g.series)}));F.get("renderer").labels.template.setAll({direction:this._getDirection()});const w="{categoryY}",C=n.new(f,{labelText:w}),k=e.series.push(p.new(f,{name:y,xAxis:F,yAxis:v,valueXField:He,categoryYField:ge,tooltip:C}));this._customizeChartTooltip(C,"vertical"),k.columns.template.setAll({ariaLabel:w,focusable:!0,templateField:"columnSettings"}),g.series.length>$t&&e.set("scrollbarY",r.new(f,{orientation:"vertical"})),v.data.setAll(s),k.data.setAll(s),k.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createLineChart(e,i,s){var oe,J,se;const{TooltipAm5:n,ScrollbarAm5:r}=await E(()=>import("./chartCommon-DeDLy4W7.js"),__vite__mapDeps([13,10,2,3,14,11,15])),{CategoryAxisAm5:o,AxisRendererXAm5:d,ValueAxisAm5:c,AxisRendererYAm5:u,LineSeriesAm5:p}=await E(()=>import("./xyChart-CZRgKOoN.js"),__vite__mapDeps([18,10,2,3,15,12,17,14])),{root:m,mediaInfo:f}=i,{value:g,title:y}=f;e.setAll({wheelX:"panX",wheelY:"zoomX"});const v=e.xAxes.push(o.new(m,{renderer:d.new(m,{inversed:this._isInversed()}),categoryField:ge}));v.get("renderer").labels.template.setAll({forceHidden:!0});const F=e.yAxes.push(c.new(m,{renderer:u.new(m,{inside:!1}),min:this._getMinSeriesValue(g.series)}));F.get("renderer").labels.template.setAll({direction:this._getDirection()});const w="{categoryX}",C=(J=(oe=s[0])==null?void 0:oe.lineSettings)==null?void 0:J.stroke,k=n.new(m,{getFillFromSprite:!C,labelText:w});C&&((se=k.get("background"))==null||se.setAll({fill:C}));const M=e.series.push(p.new(m,{name:y,xAxis:v,yAxis:F,valueYField:He,categoryXField:ge,tooltip:k}));M.strokes.template.setAll({templateField:"lineSettings"}),this._customizeChartTooltip(k,"vertical"),g.series.length>$t&&e.set("scrollbarX",r.new(m,{orientation:"horizontal"})),v.data.setAll(s),M.data.setAll(s),M.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createXYChart(e,i){const{XYChartAm5:s,XYCursorAm5:n}=await E(()=>import("./xyChart-CZRgKOoN.js"),__vite__mapDeps([18,10,2,3,15,12,17,14])),{root:r,mediaInfo:o}=e,{type:d}=o,c=(o==null?void 0:o.altText)||(o==null?void 0:o.title)||"",u=r.container.children.push(s.new(r,{ariaLabel:c,focusable:!0,panX:!0,panY:!0}));u.set("cursor",n.new(r,{})),d==="column-chart"&&await this._createColumnChart(u,e,i),d==="bar-chart"&&await this._createBarChart(u,e,i),d==="line-chart"&&await this._createLineChart(u,e,i),u.root.dom.classList.toggle(Q.mediaChartRendered,!0)}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const i=Date.now();this._refreshIntervalInfo={timestamp:i,sourceURL:e&&this._getImageSource(e,i)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;e&&e.type==="image"&&e.refreshInterval&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:i,value:s}=e;if(!i)return;const n=6e4*i;this._updateMediaInfoTimestamp(s.sourceURL);const r=setInterval(()=>{this._updateMediaInfoTimestamp(s.sourceURL)},n);this._refreshTimer=r}_getImageSource(e,i){const s=e.includes("?")?"&":"?",[n,r=""]=e.split("#");return`${n}${s}timestamp=${i}${r?"#":""}${r}`}};a([l()],G.prototype,"_refreshIntervalInfo",void 0),a([l()],G.prototype,"attributes",null),a([l()],G.prototype,"activeMediaInfoIndex",null),a([l()],G.prototype,"description",null),a([l()],G.prototype,"fieldInfoMap",null),a([l()],G.prototype,"layer",null),a([l()],G.prototype,"mediaInfos",null),a([l()],G.prototype,"popupTemplate",null),a([l()],G.prototype,"relatedInfos",null),a([l()],G.prototype,"title",null),a([l({type:Ce})],G.prototype,"viewModel",void 0),a([l(),te("esri/widgets/Feature/t9n/Feature")],G.prototype,"messages",void 0),G=a([N("esri.widgets.Feature.FeatureMedia")],G);const hs=G,Sr="esri.widgets.Feature.support.arcadeFeatureUtils",Ai=()=>z.getLogger(Sr);function Dr(t){return typeof t=="string"?Ye(Gt(t)):Array.isArray(t)?Br(t):(t==null?void 0:t.declaredClass)==="esri.arcade.Dictionary"?qr(t):t}function Br(t){return`
    ${t.map(e=>`
  • ${typeof e=="string"?Ye(Gt(e)):e}
  • `).join("")}
`}function qr(t){const e=t.keys().map(i=>{const s=t.field(i);return`${i}${typeof s=="string"?Ye(Gt(s)):s}`}).join("");return`${e}
`}function ps(){return E(()=>import("./arcade-DTRx7SKL.js"),__vite__mapDeps([19,2,3,20,21,22,23,24,25,26,27,8,7,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69]))}function zr(t){return"createQuery"in t&&"queryFeatures"in t}async function Wr({graphic:t,view:e,options:i}){const{isAggregate:s,layer:n}=t;if(!s||!n||(e==null?void 0:e.type)!=="2d")return[];const r=await e.whenLayerView(n);if(!zr(r))return[];const o=r.createQuery(),d=t.getObjectId();o.aggregateIds=d!=null?[d]:[];const{features:c}=await r.queryFeatures(o,i);return c}function Hr({layer:t,aggregatedFeatures:e,interceptor:i}){const{fields:s,objectIdField:n,geometryType:r,spatialReference:o,displayField:d}=t;return new pn({fields:s,objectIdField:n,geometryType:r,spatialReference:o,displayField:d,interceptor:i,...t.type==="feature"?{templates:t.templates,typeIdField:t.typeIdField,types:t.types}:null,source:e})}async function ms({expressionInfo:t,arcade:e,interceptor:i,spatialReference:s,map:n,graphic:r,location:o,view:d,options:c}){var k;if(!(t!=null&&t.expression))return null;const{isAggregate:u}=r,p=(r.sourceLayer||r.layer)??void 0,m=u?"feature-reduction-popup":"popup",f=e.createArcadeProfile(m),g=e.createArcadeExecutor(t.expression,f).catch(M=>Ai().error("arcade-executor-error",{error:M,expressionInfo:t})),[y,v]=await Promise.all([Wr({graphic:r,view:d,options:c}),g]);if(!v)return null;const F=m==="feature-reduction-popup"?Hr({layer:p,aggregatedFeatures:y,interceptor:i}):void 0,w={...m==="feature-reduction-popup"?{$aggregatedFeatures:F}:{$datastore:p==null?void 0:p.url,$layer:(p==null?void 0:p.type)==="feature"||(p==null?void 0:p.type)==="subtype-sublayer"?p:(p==null?void 0:p.type)==="scene"&&p.associatedLayer!=null?p.associatedLayer:void 0,$map:n,$userInput:o,$graph:(p==null?void 0:p.type)==="knowledge-graph-sublayer"?(k=p==null?void 0:p.parentCompositeLayer)==null?void 0:k.knowledgeGraph:void 0},$feature:r},C={abortSignal:(c==null?void 0:c.signal)??void 0,interceptor:i??void 0,rawOutput:!0,spatialReference:s??void 0,timeZone:d==null?void 0:d.timeZone};return await v.executeAsync(w,C).catch(M=>Ai().error("arcade-execution-error",{error:M,graphic:r,expressionInfo:t})).finally(()=>F==null?void 0:F.destroy())}async function jr({expressionInfos:t,spatialReference:e,graphic:i,interceptor:s,map:n,view:r,location:o,options:d}){if(!(t!=null&&t.length))return{};const c=await ps(),u={};for(const f of t)u[`expression/${f.name}`]=ms({expressionInfo:f,arcade:c,interceptor:s,spatialReference:e,map:n,graphic:i,location:o,view:r,options:d});const p=await Le(u),m={};for(const f in p)m[f]=Dr(p[f].value);return m}const Ur=1;let K=class extends fe{constructor(e){super(e),this._abortController=null,this.expressionInfo=null,this.graphic=null,this.contentElement=null,this.contentElementViewModel=null,this.interceptor=null,this.location=null,this.view=null,this._cancelQuery=()=>{const{_abortController:i}=this;i&&i.abort(),this._abortController=null},this._createVM=()=>{var n,r;const i=(n=this.contentElement)==null?void 0:n.type;(r=this.contentElementViewModel)==null||r.destroy();const s=i==="fields"?new mt:i==="media"?new Ce:i==="text"?new ct:null;this._set("contentElementViewModel",s)},this._compile=async()=>{this._cancelQuery();const i=new AbortController;this._abortController=i,await this._compileExpression(),this._abortController===i&&(this._abortController=null)},this._compileThrottled=lt(this._compile,Ur,this),this._compileExpression=async()=>{const{expressionInfo:i,graphic:s,interceptor:n,spatialReference:r,map:o,location:d,view:c,_abortController:u}=this;if(!i||!s)return void this._set("contentElement",null);const p=await ps();if(u!==this._abortController)return;const m=await ms({arcade:p,expressionInfo:i,graphic:s,location:d,interceptor:n,map:o,spatialReference:r,view:c});if(!m||m.declaredClass!=="esri.arcade.Dictionary")return void this._set("contentElement",null);const f=await m.castAsJsonAsync(u==null?void 0:u.signal),g=f==null?void 0:f.type,y=g==="media"?qs.fromJSON(f):g==="text"?Ui.fromJSON(f):g==="fields"?zs.fromJSON(f):null;this._set("contentElement",y)},this.addHandles([_(()=>[this.expressionInfo,this.graphic,this.map,this.spatialReference,this.view],()=>this._compileThrottled(),P),_(()=>[this.contentElement],()=>this._createVM(),P)])}initialize(){this.addHandles(this._compileThrottled)}destroy(){var e;this._cancelQuery(),(e=this.contentElementViewModel)==null||e.destroy(),this._set("contentElementViewModel",null),this._set("contentElement",null)}get spatialReference(){var e;return((e=this.view)==null?void 0:e.spatialReference)??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{_abortController:e,contentElement:i,contentElementViewModel:s}=this;return e?"loading":i||s?"ready":"disabled"}get map(){var e;return((e=this.view)==null?void 0:e.map)??null}set map(e){this._override("map",e)}};a([l()],K.prototype,"_abortController",void 0),a([l({type:Bs})],K.prototype,"expressionInfo",void 0),a([l({type:ze})],K.prototype,"graphic",void 0),a([l({readOnly:!0})],K.prototype,"contentElement",void 0),a([l({readOnly:!0})],K.prototype,"contentElementViewModel",void 0),a([l()],K.prototype,"interceptor",void 0),a([l({type:Ht})],K.prototype,"location",void 0),a([l()],K.prototype,"spatialReference",null),a([l({readOnly:!0})],K.prototype,"state",null),a([l()],K.prototype,"map",null),a([l()],K.prototype,"view",void 0),K=a([N("esri.widgets.Feature.FeatureExpression.FeatureExpressionViewModel")],K);const Jt=K,xt="esri-feature",Tt={base:`${xt}-expression`,loadingSpinnerContainer:`${xt}__loading-container`,spinner:`${xt}__loading-spinner`};let nt=class extends ie{constructor(e,i){super(e,i),this._contentWidget=null,this.viewModel=new Jt}initialize(){this.addHandles(_(()=>{var e;return(e=this.viewModel)==null?void 0:e.contentElementViewModel},()=>this._setupExpressionWidget(),P))}destroy(){this._destroyContentWidget()}render(){var i;const{state:e}=this.viewModel;return h("div",{class:Tt.base},e==="loading"?this._renderLoading():e==="disabled"?null:(i=this._contentWidget)==null?void 0:i.render())}_renderLoading(){return h("div",{class:Tt.loadingSpinnerContainer,key:"loading-container"},h("span",{class:this.classes(re.loadingIndicator,I.rotating,Tt.spinner)}))}_destroyContentWidget(){const{_contentWidget:e}=this;e&&(e.viewModel=null,e.destroy()),this._contentWidget=null}_setupExpressionWidget(){const{contentElementViewModel:e,contentElement:i}=this.viewModel,s=i==null?void 0:i.type;this._destroyContentWidget();const n=e?s==="fields"?new us({viewModel:e}):s==="media"?new hs({viewModel:e}):s==="text"?new it({viewModel:e}):null:null;this._contentWidget=n,this.scheduleRender()}};a([l({type:Jt})],nt.prototype,"viewModel",void 0),nt=a([N("esri.widgets.Feature.FeatureExpression")],nt);const Zr=nt;var Ci;(function(t){t.TOO_SHORT="length-validation-error::too-short"})(Ci||(Ci={}));const Qr=t=>{var i;const e=[];if(t.formTemplate){const{description:s,title:n}=t.formTemplate;(i=t.fields)==null||i.forEach(r=>{const o=n&&di(n,r.name),d=s&&di(s,r.name);(o||d)&&e.push(r.name)})}return e},kt=100;let L=class extends Ws(Zi(fe)){constructor(e){super(e),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.featuresPerPage=10,this.description=null,this.graphic=null,this.layer=null,this.map=null,this.orderByFields=null,this.featureCount=0,this.relationshipId=null,this.showAllEnabled=!1,this.title=null,this._cancelQuery=()=>{const{_queryAbortController:i}=this;i&&i.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:i}=this;i&&i.abort(),this._queryFeatureCountAbortController=null},this._cancelQueryPage=()=>{const{_queryPageAbortController:i}=this;i&&i.abort(),this._queryPageAbortController=null},this._queryController=async()=>{this._cancelQuery();const i=new AbortController;this._queryAbortController=i,await yt(this._query()),this._queryAbortController===i&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const i=new AbortController;this._queryFeatureCountAbortController=i,await yt(this._queryFeatureCount()),this._queryFeatureCountAbortController===i&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryPageController=async()=>{const i=new AbortController;this._queryPageAbortController=i,await yt(this._queryPage()),this._queryPageAbortController===i&&(this._queryPageAbortController=null)},this._queryDebounced=tt(this._queryController,kt),this._queryFeatureCountDebounced=tt(this._queryFeatureCountController,kt),this._queryPageDebounced=tt(this._queryPageController,kt),this._query=async()=>{const{_queryAbortController:i,relatedFeatures:s}=this;this.featureCount&&(this._destroyRelatedFeatureViewModels(),this.featurePage=1,s.removeAll(),this.destroyed||s.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:i==null?void 0:i.signal}))))},this.addHandles([_(()=>{var i;return[this.displayCount,this.graphic,this.layer,(i=this.layer)==null?void 0:i.loaded,this.map,this.orderByFields,this.relationshipId,this.featuresPerPage,this.showAllEnabled,this.canQuery,this.featureCount]},()=>this._queryDebounced(),P),_(()=>[this.featurePage,this.showAllEnabled],()=>this._queryPageDebounced()),_(()=>[this.layer,this.relationshipId,this.objectId,this.canQuery],()=>this._queryFeatureCountDebounced())])}destroy(){this._destroyRelatedFeatureViewModels(),this.relatedFeatures.removeAll(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage()}set featurePage(e){const{featuresPerPage:i,featureCount:s}=this,n=1,r=Math.ceil(s/i)||1;this._set("featurePage",Math.min(Math.max(e,n),r))}get featurePage(){return this._get("featurePage")}get orderByFieldsFixedCasing(){const{orderByFields:e,relatedLayer:i}=this;return e&&(i!=null&&i.loaded)?e.map(s=>{const n=s.clone();return n.field=Ge(s.field,i),n}):e??[]}get supportsCacheHint(){var e,i,s;return!!((s=(i=(e=this.layer)==null?void 0:e.capabilities)==null?void 0:i.queryRelated)!=null&&s.supportsCacheHint)}get canLoad(){return!!this.map&&typeof this.relationshipId=="number"&&typeof this.objectId=="number"}get canQuery(){var i,s;const e=(s=(i=this.layer)==null?void 0:i.capabilities)==null?void 0:s.queryRelated;return!!(this.relatedLayer&&this.relationship&&typeof this.relationshipId=="number"&&typeof this.objectId=="number"&&(e!=null&&e.supportsCount)&&(e!=null&&e.supportsPagination))}get itemDescriptionFieldName(){var e;return((e=this.orderByFieldsFixedCasing[0])==null?void 0:e.field)||null}set displayCount(e){this._set("displayCount",Math.min(Math.max(e,0),10))}get displayCount(){return this._get("displayCount")}get objectId(){var e,i;return(this.objectIdField&&((i=(e=this.graphic)==null?void 0:e.attributes)==null?void 0:i[this.objectIdField]))??null}get objectIdField(){var e;return((e=this.layer)==null?void 0:e.objectIdField)||null}get relatedFeatures(){return this._get("relatedFeatures")||new Be}get relatedLayer(){const{layer:e,map:i,relationship:s}=this;return e!=null&&e.loaded&&i&&s?Xn(i,e,s)??null:null}get relationship(){var s;const{relationshipId:e,layer:i}=this;return typeof e=="number"?((s=i==null?void 0:i.relationships)==null?void 0:s.find(({id:n})=>n===e))??null:null}get relatedFeatureViewModels(){return this._get("relatedFeatureViewModels")||new Be}get state(){const{_queryAbortController:e,_queryFeatureCountAbortController:i,_queryPageAbortController:s,canQuery:n,_loaded:r,canLoad:o}=this;return i||o&&!r?"loading":e||s?"querying":n?"ready":"disabled"}getRelatedFeatureByObjectId(e){return this.relatedFeatures.find(i=>i.getObjectId()===e)}refresh(){this._queryFeatureCountDebounced()}_destroyRelatedFeatureViewModels(){var e;(e=this.relatedFeatureViewModels)==null||e.forEach(i=>!i.destroyed&&i.destroy()),this.relatedFeatureViewModels.removeAll()}async _queryFeatureCount(){const{layer:e,relatedLayer:i,relationshipId:s,objectId:n,_queryFeatureCountAbortController:r,canQuery:o,supportsCacheHint:d}=this;if(await(e==null?void 0:e.load()),await(i==null?void 0:i.load()),!o||!e||!i)return void this._set("featureCount",0);const c=i.createQuery(),u=new Ot({cacheHint:d,relationshipId:s,returnGeometry:!1,objectIds:[n],where:c.where??void 0}),p=await e.queryRelatedFeaturesCount(u,{signal:r==null?void 0:r.signal});this._set("featureCount",p[n]||0)}_sliceFeatures(e){const{showAllEnabled:i,displayCount:s}=this;return i?e:s?e.slice(0,s):[]}async _queryPage(){const{relatedFeatures:e,featurePage:i,showAllEnabled:s,_queryPageAbortController:n,featureCount:r}=this;!s||i<2||!r||e.addMany(await this._queryRelatedFeatures({signal:n==null?void 0:n.signal}))}async _queryRelatedFeatures(e){var se;const{orderByFieldsFixedCasing:i,showAllEnabled:s,featuresPerPage:n,displayCount:r,layer:o,relationshipId:d,featurePage:c,featureCount:u,relatedLayer:p,supportsCacheHint:m}=this,{canQuery:f,objectId:g}=this;if(!f||!o||!p)return[];const y=s?((c-1)*n+u)%u:0,v=s?n:r,F=p.objectIdField,w=[...i.map(j=>j.field),...Qr(p),F].filter(ht),C=i.map(j=>`${j.field} ${j.order}`),k=p.createQuery(),M=new Ot({orderByFields:C,start:y,num:v,outFields:w,cacheHint:m,relationshipId:d,returnGeometry:!1,objectIds:[g],where:k.where??void 0}),oe=await o.queryRelatedFeatures(M,{signal:e==null?void 0:e.signal}),J=((se=oe[g])==null?void 0:se.features)||[];return J.forEach(j=>{j.sourceLayer=p,j.layer=p}),J}};a([l()],L.prototype,"_loaded",void 0),a([l()],L.prototype,"_queryAbortController",void 0),a([l()],L.prototype,"_queryPageAbortController",void 0),a([l()],L.prototype,"_queryFeatureCountAbortController",void 0),a([l({value:1})],L.prototype,"featurePage",null),a([l()],L.prototype,"featuresPerPage",void 0),a([l({readOnly:!0})],L.prototype,"orderByFieldsFixedCasing",null),a([l({readOnly:!0})],L.prototype,"supportsCacheHint",null),a([l({readOnly:!0})],L.prototype,"canLoad",null),a([l({readOnly:!0})],L.prototype,"canQuery",null),a([l()],L.prototype,"description",void 0),a([l({readOnly:!0})],L.prototype,"itemDescriptionFieldName",null),a([l({value:3})],L.prototype,"displayCount",null),a([l({type:ze})],L.prototype,"graphic",void 0),a([l()],L.prototype,"layer",void 0),a([l()],L.prototype,"map",void 0),a([l({readOnly:!0})],L.prototype,"objectId",null),a([l({readOnly:!0})],L.prototype,"objectIdField",null),a([l()],L.prototype,"orderByFields",void 0),a([l({readOnly:!0})],L.prototype,"relatedFeatures",null),a([l({readOnly:!0})],L.prototype,"relatedLayer",null),a([l({readOnly:!0})],L.prototype,"relationship",null),a([l()],L.prototype,"featureCount",void 0),a([l({readOnly:!0})],L.prototype,"relatedFeatureViewModels",null),a([l()],L.prototype,"relationshipId",void 0),a([l()],L.prototype,"showAllEnabled",void 0),a([l()],L.prototype,"state",null),a([l()],L.prototype,"title",void 0),L=a([N("esri.widgets.Feature.FeatureRelationship.FeatureRelationshipViewModel")],L);const ei=L,Ze="esri-feature",je=`${Ze}-relationship`,ue={base:je,listContainer:`${je}__list`,listItem:`${je}__list-item`,listItemHidden:`${je}__list-item--hidden`,listContainerQuerying:`${je}__list--querying`,featureObserver:`${Ze}__feature-observer`,stickySpinnerContainer:`${Ze}__sticky-loading-container`,loadingSpinnerContainer:`${Ze}__loading-container`,spinner:`${Ze}__loading-spinner`},Ei={title:!0,description:!0};let X=class extends ie{constructor(t,e){super(t,e),this._featureElementInfo=null,this._relatedFeatureIntersectionObserverNode=null,this._relatedFeatureIntersectionObserver=new IntersectionObserver(([i])=>{i!=null&&i.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this.headingLevel=2,this.viewModel=new ei,this.messages=null,this.messagesCommon=null,this.visibleElements={...Ei},this._increaseFeaturePage=()=>{const{state:i,showAllEnabled:s,relatedFeatures:n,featuresPerPage:r,featurePage:o}=this.viewModel;i==="ready"&&s&&n.length>=r*o&&this.viewModel.featurePage++}}initialize(){this._featureElementInfo=new pt,this.addHandles([_(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),P),_(()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode],()=>this._handleRelatedFeatureObserverChange()),Te(()=>this.viewModel.relatedFeatureViewModels,"change",()=>this._setupRelatedFeatureViewModels())])}loadDependencies(){return We({icon:()=>E(()=>import("./calcite-icon-CHcIXU52.js"),__vite__mapDeps([0,1,2,3,4,5,6])),list:()=>E(()=>import("./calcite-list-D9nZpOdw.js"),__vite__mapDeps([70,2,3,4,5,71,6,72,73,74,75,1,76,77,78,79,80,81])),"list-item":()=>E(()=>import("./calcite-list-item-BBiyp6uG.js"),__vite__mapDeps([82,2,3,4,5,71,72,74,6,73,83,79,1,80])),notice:()=>E(()=>import("./calcite-notice-CHsdelpI.js"),__vite__mapDeps([84,2,3,85,6,4,5,73,74,86,79,1]))})}destroy(){this._unobserveRelatedFeatureObserver(),this._featureElementInfo=Hs(this._featureElementInfo)}get displayShowAllButton(){const{showAllEnabled:t,featureCount:e,displayCount:i,state:s}=this.viewModel;return!t&&!!e&&s==="ready"&&(e>i||i===0)}get displayListItems(){return this.displayShowAllButton||this.viewModel.relatedFeatureViewModels.length>0}get description(){return this.viewModel.description}set description(t){this.viewModel.description=t}get featureCountDescription(){const{messages:t}=this,{featureCount:e}=this.viewModel;return ce(t==null?void 0:t.numberRecords,{number:e})}get title(){return this.viewModel.title}set title(t){this.viewModel.title=t}castVisibleElements(t){return{...Ei,...t}}render(){var e;const{state:t}=this.viewModel;return h("div",{class:this.classes(ue.base,I.widget)},(e=this._featureElementInfo)==null?void 0:e.render(),t==="loading"?this._renderLoading():t==="disabled"?this._renderRelationshipNotFound():this._renderRelatedFeatures())}_renderStickyLoading(){return this.viewModel.state==="querying"?h("div",{class:ue.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return h("span",{class:this.classes(re.loadingIndicator,I.rotating,ue.spinner)})}_renderLoading(){return h("div",{class:ue.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderShowAllIconNode(){return h("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})}_renderChevronIconNode(){const t=ke(this.container)?"chevron-left":"chevron-right";return h("calcite-icon",{icon:t,scale:"s",slot:"content-end"})}_renderRelatedFeature(t){var n;const{itemDescriptionFieldName:e}=this.viewModel,i=t.title;t.description=e&&((n=t.formattedAttributes)==null?void 0:n.global[e]);const s=t.state==="loading";return h("calcite-list-item",{class:this.classes(ue.listItem,{[ue.listItemHidden]:s}),description:t.description??"",key:t.uid,label:i,onCalciteListItemSelect:()=>this.emit("select-record",{featureViewModel:t})},this._renderChevronIconNode())}_renderShowAllListItem(){var t;return this.displayShowAllButton?h("calcite-list-item",{description:this.featureCountDescription,key:"show-all-item",label:(t=this.messages)==null?void 0:t.showAll,onCalciteListItemSelect:()=>this.emit("show-all-records")},this._renderShowAllIconNode()):null}_renderNoRelatedFeaturesMessage(){var t;return h("calcite-notice",{icon:"information",key:"no-related-features-message",kind:"brand",open:!0,scale:"s",width:"full"},h("div",{slot:"message"},(t=this.messages)==null?void 0:t.noRelatedFeatures))}_renderFeatureObserver(){return h("div",{afterCreate:this._relatedFeatureIntersectionObserverCreated,bind:this,class:ue.featureObserver,key:"feature-observer"})}_renderList(){const{relatedFeatureViewModels:t}=this.viewModel;return h("calcite-list",null,t.toArray().map(e=>this._renderRelatedFeature(e)),this._renderShowAllListItem())}_renderRelatedFeatures(){const{displayListItems:t}=this,{state:e}=this.viewModel;return h("div",{class:this.classes(ue.listContainer,{[ue.listContainerQuerying]:e==="querying"}),key:"list-container"},t?this._renderList():e==="ready"?this._renderNoRelatedFeaturesMessage():null,this._renderStickyLoading(),this._renderFeatureObserver())}_renderRelationshipNotFound(){var t;return h("calcite-notice",{icon:"exclamation-mark-triangle",key:"relationship-not-found",kind:"danger",open:!0,scale:"s",width:"full"},h("div",{slot:"message"},(t=this.messages)==null?void 0:t.relationshipNotFound))}_setupRelatedFeatureViewModels(){const{relatedFeatureViewModels:t}=this.viewModel,e="related-feature-viewmodels";this.removeHandles(e),t==null||t.forEach(i=>{this.addHandles(_(()=>[i.title,i.state],()=>this.scheduleRender(),P),e)}),this.scheduleRender()}_setupFeatureElementInfo(){var n;const{headingLevel:t,visibleElements:e}=this,i=e.description&&this.description,s=e.title&&this.title;(n=this._featureElementInfo)==null||n.set({description:i,title:s,headingLevel:t})}async _handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();const{state:t,showAllEnabled:e}=this.viewModel;await Qi(0),this._relatedFeatureIntersectionObserverNode&&t==="ready"&&e&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode)}_relatedFeatureIntersectionObserverCreated(t){this._relatedFeatureIntersectionObserverNode=t}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode)}};a([l()],X.prototype,"_relatedFeatureIntersectionObserverNode",void 0),a([l({readOnly:!0})],X.prototype,"displayShowAllButton",null),a([l({readOnly:!0})],X.prototype,"displayListItems",null),a([l()],X.prototype,"description",null),a([l({readOnly:!0})],X.prototype,"featureCountDescription",null),a([l()],X.prototype,"headingLevel",void 0),a([l()],X.prototype,"title",null),a([l({type:ei})],X.prototype,"viewModel",void 0),a([l(),te("esri/widgets/Feature/t9n/Feature")],X.prototype,"messages",void 0),a([l(),te("esri/t9n/common")],X.prototype,"messagesCommon",void 0),a([l()],X.prototype,"visibleElements",void 0),a([qe("visibleElements")],X.prototype,"castVisibleElements",null),X=a([N("esri.widgets.Feature.FeatureRelationship")],X);const $i=X;let Gr=class{constructor(e,i){this.preLayerQueryCallback=e,this.preRequestCallback=i,this.preLayerQueryCallback||(this.preLayerQueryCallback=s=>{}),this.preRequestCallback||(this.preLayerQueryCallback=s=>{})}};var Qe;const Xr=1,xi="content-view-models",Ti="relationship-view-models",ki={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0};let O=Qe=class extends Zi(fe){constructor(t){super(t),this._error=null,this._featureAbortController=null,this._graphicChangedThrottled=lt(this._graphicChanged,Xr,this),this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities={...ki},this.content=null,this.contentViewModels=[],this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.title="",this.view=null,this._isAllowedContentType=e=>{const{abilities:i}=this;return e.type==="attachments"&&!!i.attachmentsContent||e.type==="custom"&&!!i.customContent||e.type==="fields"&&!!i.fieldsContent||e.type==="media"&&!!i.mediaContent||e.type==="text"&&!!i.textContent||e.type==="expression"&&!!i.expressionContent||e.type==="relationship"&&!!i.relationshipContent},this.addHandles(_(()=>[this.graphic,this._effectivePopupTemplate,this.abilities,this.timeZone],()=>this._graphicChangedThrottled(),P))}initialize(){this.addHandles(this._graphicChangedThrottled)}destroy(){this._clear(),this._cancelFeatureQuery(),this._error=null,this.graphic=null,this._destroyContentViewModels(),this.relatedInfos.clear()}get _effectivePopupTemplate(){return this.graphic!=null?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return Wn(fi(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return Ji(this.graphic)}castAbilities(t){return{...ki,...t}}get isTable(){var t;return((t=this._sourceLayer)==null?void 0:t.isTable)||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}set graphic(t){this._set("graphic",(t==null?void 0:t.clone())??null)}get spatialReference(){var t;return((t=this.view)==null?void 0:t.spatialReference)??null}set spatialReference(t){this._override("spatialReference",t)}get timeZone(){var t;return((t=this.view)==null?void 0:t.timeZone)??js}set timeZone(t){this._overrideIfSome("timeZone",t)}get map(){var t;return((t=this.view)==null?void 0:t.map)||null}set map(t){this._override("map",t)}get waitingForContent(){return!!this._featureAbortController}setActiveMedia(t,e){const i=this.contentViewModels[t];i instanceof Ce&&i.setActiveMedia(e)}nextMedia(t){const e=this.contentViewModels[t];e instanceof Ce&&e.next()}previousMedia(t){const e=this.contentViewModels[t];e instanceof Ce&&e.previous()}async updateGeometry(){var o;const{graphic:t,spatialReference:e,_sourceLayer:i}=this;await(i==null?void 0:i.load());const s=i==null?void 0:i.objectIdField;if(!s||!t||!i)return;const n=(o=t==null?void 0:t.attributes)==null?void 0:o[s];if(n==null)return;const r=[n];if(!t.geometry){const d=await os({layer:i,graphic:t,outFields:[],objectIds:r,returnGeometry:!0,spatialReference:e}),c=d==null?void 0:d.geometry;c&&(t.geometry=c)}}_clear(){this._set("title",""),this._set("content",null),this._set("formattedAttributes",null)}async _graphicChanged(){this._cancelFeatureQuery(),this._error=null,this._clear();const{graphic:t}=this;if(!t)return;const e=new AbortController;this._featureAbortController=e;try{await this._queryFeature({signal:e.signal})}catch(i){Pt(i)||(this._error=i,z.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:i,graphic:t,popupTemplate:this._effectivePopupTemplate}))}this._featureAbortController===e&&(this._featureAbortController=null)}_cancelFeatureQuery(){const{_featureAbortController:t}=this;t&&t.abort(),this._featureAbortController=null}_compileContentElement(t,e){return t.type==="attachments"?this._compileAttachments(t,e):t.type==="custom"?this._compileCustom(t,e):t.type==="fields"?this._compileFields(t,e):t.type==="media"?this._compileMedia(t,e):t.type==="text"?this._compileText(t,e):t.type==="expression"?this._compileExpression(t,e):t.type==="relationship"?this._compileRelationship(t,e):void 0}_compileContent(t){if(this._destroyContentViewModels(),this.graphic)return Array.isArray(t)?t.filter(this._isAllowedContentType).map((e,i)=>this._compileContentElement(e,i)).filter(ht):typeof t=="string"?this._compileText(new Ui({text:t}),0).text:t}_destroyContentViewModels(){this.removeHandles(Ti),this.removeHandles(xi),this.contentViewModels.forEach(t=>t&&!t.destroyed&&t.destroy()),this._set("contentViewModels",[])}_matchesFeature(t,e){var n;const i=(n=t==null?void 0:t.graphic)==null?void 0:n.getObjectId(),s=e==null?void 0:e.getObjectId();return i!=null&&s!=null&&i===s}_setRelatedFeaturesViewModels({relatedFeatureViewModels:t,relatedFeatures:e,map:i}){const{view:s,spatialReference:n}=this;e==null||e.filter(Boolean).forEach(r=>{t.some(o=>this._matchesFeature(o,r))||t.add(new Qe({abilities:{relationshipContent:!1},map:i,view:s,spatialReference:n,graphic:r}))}),t.forEach(r=>{(e==null?void 0:e.find(d=>this._matchesFeature(r,d)))||t.remove(r)})}_setExpressionContentVM(t,e){const i=this.formattedAttributes,{contentElement:s,contentElementViewModel:n}=t,r=s==null?void 0:s.type;n&&r&&(r==="fields"&&(this._createFieldsFormattedAttributes({contentElement:s,contentElementIndex:e,formattedAttributes:i}),n.set(this._createFieldsVMParams(s,e))),r==="media"&&(this._createMediaFormattedAttributes({contentElement:s,contentElementIndex:e,formattedAttributes:i}),n.set(this._createMediaVMParams(s,e))),r==="text"&&n.set(this._createTextVMParams(s)))}_compileRelationship(t,e){const{displayCount:i,orderByFields:s,relationshipId:n,title:r,description:o}=t,{_sourceLayer:d,graphic:c,map:u}=this;if(!ss(d))return;const p=new ei({displayCount:i,graphic:c,orderByFields:s,relationshipId:n,layer:d,map:u,...this._compileTitleAndDesc({title:r,description:o})});return this.contentViewModels[e]=p,this.addHandles(Te(()=>p.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels(p)),Ti),t}_compileExpression(t,e){const{expressionInfo:i}=t,{graphic:s,map:n,spatialReference:r,view:o,location:d}=this,c=new Jt({expressionInfo:i,graphic:s,interceptor:Qe.interceptor,map:n,spatialReference:r,view:o,location:d});return this.contentViewModels[e]=c,this.addHandles(_(()=>c.contentElementViewModel,()=>this._setExpressionContentVM(c,e),P),xi),t}_compileAttachments(t,e){const{graphic:i}=this,{description:s,title:n}=t;return this.contentViewModels[e]=new Yt({graphic:i,...this._compileTitleAndDesc({title:n,description:s})}),t}_compileCustom(t,e){const{graphic:i}=this,{creator:s,destroyer:n}=t;return this.contentViewModels[e]=new ct({graphic:i,creator:s,destroyer:n}),t}_compileTitleAndDesc({title:t,description:e}){const{_fieldInfoMap:i,_sourceLayer:s,graphic:n,formattedAttributes:r}=this,o=n==null?void 0:n.attributes,d=this._expressionAttributes,c=r.global;return{title:Ae({attributes:o,fieldInfoMap:i,globalAttributes:c,expressionAttributes:d,layer:s,text:t}),description:Ae({attributes:o,fieldInfoMap:i,globalAttributes:c,expressionAttributes:d,layer:s,text:e})}}_createFieldsVMParams(t,e){const i=this._effectivePopupTemplate,s=this.formattedAttributes,n={...s==null?void 0:s.global,...s==null?void 0:s.content[e]},r=(t==null?void 0:t.fieldInfos)||(i==null?void 0:i.fieldInfos),o=r==null?void 0:r.filter(({fieldName:p})=>Zt(p)||me(p)||n.hasOwnProperty(p)),d=i==null?void 0:i.expressionInfos,{description:c,title:u}=t;return{attributes:n,expressionInfos:d,fieldInfos:o,...this._compileTitleAndDesc({title:u,description:c})}}_compileFields(t,e){const i=t.clone(),s=new mt(this._createFieldsVMParams(t,e));return this.contentViewModels[e]=s,i.fieldInfos=s.formattedFieldInfos.slice(0),i}_createMediaVMParams(t,e){const{abilities:i,graphic:s,_fieldInfoMap:n,_effectivePopupTemplate:r,relatedInfos:o,_sourceLayer:d,_expressionAttributes:c}=this,u=this.formattedAttributes,p=(s==null?void 0:s.attributes)??{},{description:m,mediaInfos:f,title:g}=t;return{abilities:{chartAnimation:i.chartAnimation},activeMediaInfoIndex:t.activeMediaInfoIndex||0,attributes:p,isAggregate:s==null?void 0:s.isAggregate,layer:d,fieldInfoMap:n,formattedAttributes:{...u==null?void 0:u.global,...u==null?void 0:u.content[e]},expressionAttributes:c,mediaInfos:f,popupTemplate:r,relatedInfos:o,...this._compileTitleAndDesc({title:g,description:m})}}_compileMedia(t,e){const i=t.clone(),s=new Ce(this._createMediaVMParams(t,e));return i.mediaInfos=s.formattedMediaInfos.slice(0),this.contentViewModels[e]=s,i}_createTextVMParams(t){var r;const{graphic:e,_fieldInfoMap:i,_sourceLayer:s,_expressionAttributes:n}=this;if(t&&t.text){const o=(e==null?void 0:e.attributes)??{},d=((r=this.formattedAttributes)==null?void 0:r.global)??{};t.text=Ae({attributes:o,fieldInfoMap:i,globalAttributes:d,expressionAttributes:n,layer:s,text:t.text})}return{graphic:e,creator:t.text}}_compileText(t,e){const i=t.clone();return this.contentViewModels[e]=new ct(this._createTextVMParams(i)),i}_compileLastEditInfo(){const{_effectivePopupTemplate:t,_sourceLayer:e,graphic:i,timeZone:s}=this;if(!t)return;const{lastEditInfoEnabled:n}=t,r=e==null?void 0:e.editFieldsInfo;return n&&r?zn(r,i==null?void 0:i.attributes,s,e):void 0}_compileTitle(t){var d;const{_fieldInfoMap:e,_sourceLayer:i,graphic:s,_expressionAttributes:n}=this,r=(s==null?void 0:s.attributes)??{},o=((d=this.formattedAttributes)==null?void 0:d.global)??{};return Ae({attributes:r,fieldInfoMap:e,globalAttributes:o,expressionAttributes:n,layer:i,text:t})}async _getTitle(){const{_effectivePopupTemplate:t,graphic:e}=this;if(!e)return null;const i=t==null?void 0:t.title;return dt(i,{graphic:e})}async _getContent(){const{_effectivePopupTemplate:t,graphic:e}=this;if(!e)return null;const i=t==null?void 0:t.content;return dt(i,{graphic:e})}async _queryFeature(t){const{_featureAbortController:e,_sourceLayer:i,graphic:s,_effectivePopupTemplate:n}=this,r=this.map,o=this.view,d=this.spatialReference,c=this.location;if(e!==this._featureAbortController||!s)return;await jn({graphic:s,popupTemplate:n,layer:i,spatialReference:d},t);const{content:{value:u},title:{value:p}}=await Le({content:this._getContent(),title:this._getTitle()}),{expressionAttributes:{value:m}}=await Le({checkForRelatedFeatures:this._checkForRelatedFeatures(t),expressionAttributes:jr({expressionInfos:n==null?void 0:n.expressionInfos,spatialReference:d,graphic:s,map:r,interceptor:Qe.interceptor,view:o,options:t,location:c})});e===this._featureAbortController&&s&&(this._expressionAttributes=m,this._graphicExpressionAttributes={...s.attributes,...m},this._set("formattedAttributes",this._createFormattedAttributes(u)),this._set("title",this._compileTitle(p)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(u)||null))}_createMediaFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:i}){const{_effectivePopupTemplate:s,graphic:n,relatedInfos:r,_sourceLayer:o,_fieldInfoMap:d,_graphicExpressionAttributes:c,timeZone:u}=this;i.content[e]=Mt({fieldInfos:s==null?void 0:s.fieldInfos,graphic:n,attributes:{...c,...t.attributes},layer:o,fieldInfoMap:d,relatedInfos:r,timeZone:u})}_createFieldsFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:i}){if(t.fieldInfos){const{graphic:s,relatedInfos:n,_sourceLayer:r,_fieldInfoMap:o,_graphicExpressionAttributes:d,timeZone:c}=this;i.content[e]=Mt({fieldInfos:t.fieldInfos,graphic:s,attributes:{...d,...t.attributes},layer:r,fieldInfoMap:o,relatedInfos:n,timeZone:c})}}_createFormattedAttributes(t){const{_effectivePopupTemplate:e,graphic:i,relatedInfos:s,_sourceLayer:n,_fieldInfoMap:r,_graphicExpressionAttributes:o,timeZone:d}=this,c=e==null?void 0:e.fieldInfos,u={global:Mt({fieldInfos:c,graphic:i,attributes:o,layer:n,fieldInfoMap:r,relatedInfos:s,timeZone:d}),content:[]};return Array.isArray(t)&&t.forEach((p,m)=>{p.type==="fields"&&this._createFieldsFormattedAttributes({contentElement:p,contentElementIndex:m,formattedAttributes:u}),p.type==="media"&&this._createMediaFormattedAttributes({contentElement:p,contentElementIndex:m,formattedAttributes:u})}),u}_checkForRelatedFeatures(t){const{graphic:e,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(e,fi(i),t)}async _queryRelatedInfos(t,e,i){const{relatedInfos:s,_sourceLayer:n}=this;s.clear();const r=(n==null?void 0:n.associatedLayer)!=null?await(n==null?void 0:n.associatedLayer.load(i)):n;if(!r||!t)return;const o=e.filter(u=>u&&me(u.fieldName));if(!(o!=null&&o.length))return;e.forEach(u=>this._configureRelatedInfo(u,r));const d=await Tr({relatedInfos:s,layer:r},i);Object.keys(d).forEach(u=>{var f;const p=s.get(u.toString()),m=(f=d[u])==null?void 0:f.value;p&&m&&(p.layerInfo=m.data)});const c=await kr({graphic:t,relatedInfos:s,layer:r},i);Object.keys(c).forEach(u=>{var p;Ir((p=c[u])==null?void 0:p.value,s.get(u.toString()))})}_configureRelatedInfo(t,e){const{relatedInfos:i}=this,s=st(t.fieldName);if(!s)return;const{layerId:n,fieldName:r}=s;if(!n)return;const o=i.get(n.toString())||Mr(n,e);o&&(Lr({relatedInfo:o,fieldName:r,fieldInfo:t}),this.relatedInfos.set(n,o))}};O.interceptor=new Gr(Qn,Gn),a([l()],O.prototype,"_error",void 0),a([l()],O.prototype,"_featureAbortController",void 0),a([l({readOnly:!0})],O.prototype,"_effectivePopupTemplate",null),a([l({readOnly:!0})],O.prototype,"_fieldInfoMap",null),a([l({readOnly:!0})],O.prototype,"_sourceLayer",null),a([l()],O.prototype,"abilities",void 0),a([qe("abilities")],O.prototype,"castAbilities",null),a([l({readOnly:!0})],O.prototype,"content",void 0),a([l({readOnly:!0})],O.prototype,"contentViewModels",void 0),a([l()],O.prototype,"description",void 0),a([l({type:Boolean})],O.prototype,"defaultPopupTemplateEnabled",void 0),a([l({readOnly:!0})],O.prototype,"isTable",null),a([l({readOnly:!0})],O.prototype,"state",null),a([l({readOnly:!0})],O.prototype,"formattedAttributes",void 0),a([l({type:ze,value:null})],O.prototype,"graphic",null),a([l({readOnly:!0})],O.prototype,"lastEditInfo",void 0),a([l({type:Ht})],O.prototype,"location",void 0),a([l({readOnly:!0})],O.prototype,"relatedInfos",void 0),a([l()],O.prototype,"spatialReference",null),a([l()],O.prototype,"timeZone",null),a([l({readOnly:!0})],O.prototype,"title",void 0),a([l()],O.prototype,"map",null),a([l({readOnly:!0})],O.prototype,"waitingForContent",null),a([l()],O.prototype,"view",void 0),O=Qe=a([N("esri.widgets.Feature.FeatureViewModel")],O);const ti=O,W="esri-feature",V={base:W,container:`${W}__size-container`,title:`${W}__title`,main:`${W}__main-container`,btn:`${W}__button`,icon:`${W}__icon`,content:`${W}__content`,contentNode:`${W}__content-node`,contentNodeText:`${W}__content-node--text`,contentElement:`${W}__content-element`,text:`${W}__text`,lastEditedInfo:`${W}__last-edited-info`,fields:`${W}__fields`,fieldHeader:`${W}__field-header`,fieldData:`${W}__field-data`,fieldDataDate:`${W}__field-data--date`,loadingSpinnerContainer:`${W}__loading-container`,spinner:`${W}__loading-spinner`},fs=t=>{let e=class extends t{constructor(){super(...arguments),this.renderNodeContent=i=>cs(i)&&!i.destroyed?h("div",{class:V.contentNode,key:i},i.render()):i instanceof HTMLElement?h("div",{afterCreate:this._attachToNode,bind:i,class:V.contentNode,key:i}):sr(i)?h("div",{afterCreate:this._attachToNode,bind:i.domNode,class:V.contentNode,key:i}):null}_attachToNode(i){const s=this;i.appendChild(s)}};return e=a([N("esri.widgets.Feature.ContentMixin")],e),e};var Dt;const Li={title:!0,content:!0,lastEditedInfo:!0},Ri="relationship-handles";let q=Dt=class extends fs(ie){constructor(t,e){super(t,e),this._contentWidgets=[],this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.visibleElements={...Li},this.viewModel=new ti}initialize(){this.addHandles(_(()=>{var t;return(t=this.viewModel)==null?void 0:t.contentViewModels},()=>this._setupContentWidgets(),P))}loadDependencies(){return We({notice:()=>E(()=>import("./calcite-notice-CHsdelpI.js"),__vite__mapDeps([84,2,3,85,6,4,5,73,74,86,79,1]))})}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(t){this.viewModel.graphic=t}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(t){this.viewModel.defaultPopupTemplateEnabled=t}get isTable(){return this.viewModel.isTable}get label(){var t;return((t=this.messages)==null?void 0:t.widgetLabel)??""}set label(t){this._overrideIfSome("label",t)}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(t){this.viewModel.spatialReference=t}get timeZone(){return this.viewModel.timeZone}set timeZone(t){this.viewModel.timeZone=t}get title(){return this.viewModel.title}castVisibleElements(t){return{...Li,...t}}get map(){return this.viewModel.map}set map(t){this.viewModel.map=t}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}setActiveMedia(t,e){return this.viewModel.setActiveMedia(t,e)}nextMedia(t){return this.viewModel.nextMedia(t)}previousMedia(t){return this.viewModel.previousMedia(t)}render(){const{state:t}=this.viewModel,e=h("div",{class:V.container,key:"container"},this._renderTitle(),t==="error"?this._renderError():t==="loading"?this._renderLoading():this._renderContentContainer());return h("div",{class:this.classes(V.base,I.widget)},e)}_renderError(){const{messagesCommon:t,messages:e,visibleElements:i}=this;return h("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0,scale:"s"},i.title?h("div",{key:"error-title",slot:"title"},t.errorMessage):null,h("div",{key:"error-message",slot:"message"},e.loadingError))}_renderLoading(){return h("div",{class:V.loadingSpinnerContainer,key:"loading-container"},h("span",{class:this.classes(re.loadingIndicator,I.rotating,V.spinner)}))}_renderContentContainer(){const{visibleElements:t}=this;return t.content?h("div",{class:V.main},[this._renderContent(),this._renderLastEditInfo()]):null}_renderTitle(){const{visibleElements:t,title:e}=this;return t.title?h(Kt,{class:V.title,innerHTML:e,level:this.headingLevel}):null}_renderContent(){const t=this.viewModel.content,e="content";if(!t)return null;if(Array.isArray(t))return t.length?h("div",{class:V.contentNode,key:`${e}-content-elements`},t.map(this._renderContentElement,this)):null;if(typeof t=="string"){const i=this._contentWidgets[0];return!i||i.destroyed?null:h("div",{class:this.classes(V.contentNode,V.contentNodeText),key:`${e}-content`},i.render())}return this.renderNodeContent(t)}_renderContentElement(t,e){var s;const{visibleElements:i}=this;if(typeof i.content!="boolean"&&!((s=i.content)!=null&&s[t.type]))return null;switch(t.type){case"attachments":return this._renderAttachments(e);case"custom":return this._renderCustom(t,e);case"fields":return this._renderFields(e);case"media":return this._renderMedia(e);case"text":return this._renderText(t,e);case"expression":return this._renderExpression(e);case"relationship":return this._renderRelationship(e);default:return null}}_renderAttachments(t){const e=this._contentWidgets[t];if(!e||e.destroyed)return null;const{state:i,attachmentInfos:s}=e.viewModel;return i==="loading"||s.length>0?h("div",{class:this.classes(V.contentElement),key:this._buildKey("attachments-element",t)},e.render()):null}_renderRelationship(t){const e=this._contentWidgets[t];return e&&!e.destroyed&&this.flowItems?h("div",{class:V.contentElement,key:this._buildKey("relationship-element",t)},e.render()):null}_renderExpression(t){const e=this._contentWidgets[t];return!e||e.destroyed?null:h("div",{class:V.contentElement,key:this._buildKey("expression-element",t)},e.render())}_renderCustom(t,e){const{creator:i}=t,s=this._contentWidgets[e];return!s||s.destroyed?null:i?h("div",{class:V.contentElement,key:this._buildKey("custom-element",e)},s.render()):null}_renderFields(t){const e=this._contentWidgets[t];return!e||e.destroyed?null:h("div",{class:V.contentElement,key:this._buildKey("fields-element",t)},e.render())}_renderMedia(t){const e=this._contentWidgets[t];return!e||e.destroyed?null:h("div",{class:V.contentElement,key:this._buildKey("media-element",t)},e.render())}_renderLastEditInfo(){const{visibleElements:t,messages:e}=this,{lastEditInfo:i}=this.viewModel;if(!i||!t.lastEditedInfo)return null;const{date:s,user:n}=i,r=i.type==="edit"?n?e.lastEditedByUser:e.lastEdited:n?e.lastCreatedByUser:e.lastCreated,o=ce(r,{date:s,user:n});return h("div",{class:this.classes(V.lastEditedInfo,V.contentElement),key:"edit-info-element"},o)}_renderText(t,e){const i=t.text,s=this._contentWidgets[e];return!s||s.destroyed?null:i?h("div",{class:this.classes(V.contentElement,V.text),key:this._buildKey("text-element",e)},s.render()):null}_buildKey(t,...e){var i,s;return`${t}__${((s=(i=this.viewModel)==null?void 0:i.graphic)==null?void 0:s.uid)||"0"}-${e.join("-")}`}_destroyContentWidget(t){t&&(t.viewModel=null,!t.destroyed&&t.destroy())}_destroyContentWidgets(){this.removeHandles(Ri),this._contentWidgets.forEach(t=>this._destroyContentWidget(t)),this._contentWidgets=[]}_addFeatureRelationshipHandles(t){const{flowItems:e,visibleElements:i}=this;this.addHandles([Te(()=>t,"select-record",({featureViewModel:s})=>{e&&(s.abilities={relationshipContent:!0},e.push(new Dt({flowItems:e,viewModel:s,visibleElements:i})))}),Te(()=>t,"show-all-records",()=>{if(!e)return;const{viewModel:s}=t;s.showAllEnabled=!0;const n=new $i({visibleElements:{title:!1,description:!1},viewModel:s});this._addFeatureRelationshipHandles(n),e.push(n)})],Ri)}_setupContentWidgets(){var n;this._destroyContentWidgets();const{headingLevel:t,visibleElements:e}=this,i=(n=this.viewModel)==null?void 0:n.content,{contentViewModels:s}=this.viewModel;if(Array.isArray(i))i.forEach((r,o)=>{if(r.type==="attachments"&&(this._contentWidgets[o]=new tr({displayType:r.displayType,headingLevel:e.title?t+1:t,viewModel:s[o]})),r.type==="fields"&&(this._contentWidgets[o]=new us({viewModel:s[o]})),r.type==="media"&&(this._contentWidgets[o]=new hs({viewModel:s[o]})),r.type==="text"&&(this._contentWidgets[o]=new it({viewModel:s[o]})),r.type==="custom"&&(this._contentWidgets[o]=new it({viewModel:s[o]})),r.type==="expression"&&(this._contentWidgets[o]=new Zr({viewModel:s[o]})),r.type==="relationship"){const d=new $i({viewModel:s[o]});this._addFeatureRelationshipHandles(d),this._contentWidgets[o]=d}},this);else{const r=s[0];r&&!r.destroyed&&(this._contentWidgets[0]=new it({viewModel:r}))}this.scheduleRender()}};a([l()],q.prototype,"graphic",null),a([l()],q.prototype,"defaultPopupTemplateEnabled",null),a([l()],q.prototype,"flowItems",void 0),a([l()],q.prototype,"headingLevel",void 0),a([l({readOnly:!0})],q.prototype,"isTable",null),a([l()],q.prototype,"label",null),a([l(),te("esri/widgets/Feature/t9n/Feature")],q.prototype,"messages",void 0),a([l(),te("esri/t9n/common")],q.prototype,"messagesCommon",void 0),a([l()],q.prototype,"spatialReference",null),a([l()],q.prototype,"timeZone",null),a([l({readOnly:!0})],q.prototype,"title",null),a([l()],q.prototype,"visibleElements",void 0),a([qe("visibleElements")],q.prototype,"castVisibleElements",null),a([l()],q.prototype,"map",null),a([l()],q.prototype,"view",null),a([l({type:ti})],q.prototype,"viewModel",void 0),q=Dt=a([N("esri.widgets.Feature")],q);const Yr=q;let be=class extends Us.EventedAccessor{constructor(e){super(e),this.location=null,this.screenLocationEnabled=!1,this.view=null,this.addHandles([at(()=>{const i=this.screenLocationEnabled?this.view:null;return i?[i.size,i.type==="3d"?i.camera:i.viewpoint]:null},()=>this.notifyChange("screenLocation")),_(()=>this.screenLocation,(i,s)=>{i!=null&&s!=null&&this.emit("view-change")})])}destroy(){this.view=null}get screenLocation(){const{location:e,view:i,screenLocationEnabled:s}=this,n=i==null?void 0:i.spatialReference,r=n?Zs(e,n).geometry:null;return s&&r&&(i!=null&&i.ready)?i.toScreen(r):null}};a([l()],be.prototype,"location",void 0),a([l()],be.prototype,"screenLocation",null),a([l()],be.prototype,"screenLocationEnabled",void 0),a([l()],be.prototype,"view",void 0),be=a([N("esri.widgets.support.AnchorElementViewModel")],be);const gs=be,Kr="esri.widgets.CompassViewModel";let rt=class extends gs{constructor(e){super(e),this.visible=!1}};a([l()],rt.prototype,"visible",void 0),rt=a([N(Kr)],rt);const _s=rt,Lt="esri-spinner",Rt={base:Lt,spinnerStart:`${Lt}--start`,spinnerFinish:`${Lt}--finish`};let Me=class extends ie{constructor(e,i){super(e,i),this._animationDelay=500,this._animationPromise=null,this.viewModel=new _s}initialize(){this.addHandles(_(()=>this.visible,e=>this._visibleChange(e)))}destroy(){this._animationPromise=null}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}show(e){const{location:i,promise:s}=e??{};i&&(this.viewModel.location=i),this.visible=!0;const n=()=>this.hide();s&&s.catch(()=>{}).then(n)}hide(){this.visible=!1}render(){const{visible:e}=this,{screenLocation:i}=this.viewModel,s=!!i,n=e&&s,r=!e&&s,o={[Rt.spinnerStart]:n,[Rt.spinnerFinish]:r},d=this._getPositionStyles();return h("div",{class:this.classes(Rt.base,o),styles:d})}_visibleChange(e){if(e)return void(this.viewModel.screenLocationEnabled=!0);const i=Qi(this._animationDelay);this._animationPromise=i,i.catch(()=>{}).then(()=>{this._animationPromise===i&&(this.viewModel.screenLocationEnabled=!1,this._animationPromise=null)})}_getPositionStyles(){const{screenLocation:e,view:i}=this.viewModel;if(i==null||e==null)return{};const{padding:s}=i;return{left:e.x-s.left+"px",top:e.y-s.top+"px"}}};a([l()],Me.prototype,"location",null),a([l()],Me.prototype,"view",null),a([l({type:_s})],Me.prototype,"viewModel",void 0),a([l()],Me.prototype,"visible",null),Me=a([N("esri.widgets.Spinner")],Me);const Jr=Me,U="esri-features",H={icon:`${U}__icon`,actionImage:`${U}__action-image`,base:U,container:`${U}__container`,contentContainer:`${U}__content-container`,contentFeature:`${U}__content-feature`,flowItemCollapsed:`${U}__flow-item--collapsed`,header:`${U}__header`,footer:`${U}__footer`,featureMenuObserver:`${U}__feature-menu-observer`,actionExit:`${U}__action--exit`,loader:`${U}__loader`,featuresHeading:`${U}__heading`,paginationActionBar:`${U}__pagination-action-bar`,paginationPrevious:`${U}__pagination-previous`,paginationNext:`${U}__pagination-next`};let Ie=class extends ie{constructor(e,i){super(e,i),this.messages=null,this.closed=!1,this.closable=!0,this._handleOpenRelatedFeature=s=>{this.emit("open-related-feature",{feature:s})}}loadDependencies(){return We({action:()=>E(()=>import("./calcite-action-CEYA6ZsJ.js"),__vite__mapDeps([87,83,2,3,4,5,71,73,74,6,79,1,80])),"flow-item":()=>E(()=>import("./calcite-flow-item-B7iK8dgk.js"),__vite__mapDeps([88,2,3,4,5,71,73,74,6,89,83,79,1,80,75,90,86,81]))})}render(){const{flowItems:e}=this,i=e==null?void 0:e.toArray();return h(Qs,null,i==null?void 0:i.map(s=>this._renderRelatedRecordsFlowItem(s)))}_handleCloseClick(){this.emit("close")}_handleExitClick(){this.emit("exit")}_handleRelatedRecordsBackClick(){var i;const e=(i=this.flowItems)==null?void 0:i.pop();e&&("showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e&&(e.viewModel=null,e.destroy()))}_renderRelatedRecordsFlowItem(e){const{messages:i,closable:s,closed:n}=this,r="graphic"in e&&!e.isTable;return h("calcite-flow-item",{bind:this,closable:s,closed:n,description:this._getRelatedRecordsFlowItemDescription(e),heading:e.title??"",key:`flow-item-${e.viewModel.uid}`,onCalciteFlowItemBack:o=>{o.preventDefault(),this._handleRelatedRecordsBackClick()},onCalciteFlowItemClose:this._handleCloseClick},h("calcite-action",{appearance:"transparent",bind:this,class:H.actionExit,icon:"move-up",key:"exit-related-records-action",label:i.exitRelatedRecords,onclick:this._handleExitClick,scale:"m",slot:"header-actions-start",text:i.exitRelatedRecords,title:i.exitRelatedRecords}),r?h("calcite-action",{appearance:"transparent",bind:this,icon:"zoom-to-object",key:"open-related-feature-action",label:i.selectFeature,onclick:()=>this._handleOpenRelatedFeature(e),scale:"m",slot:"header-actions-end",text:i.selectFeature,title:i.selectFeature}):null,h("div",{class:H.container},e.render()))}_getRelatedRecordsFlowItemDescription(e){return"featureCountDescription"in e?e.featureCountDescription:e.viewModel.description??""}};a([l()],Ie.prototype,"flowItems",void 0),a([l(),te("esri/widgets/Features/t9n/Features")],Ie.prototype,"messages",void 0),a([l()],Ie.prototype,"closed",void 0),a([l()],Ie.prototype,"closable",void 0),Ie=a([N("esri.widgets.Features.FeaturesRelatedRecords")],Ie);const eo=Ie;let to=class{constructor(e){this._observable=new Gs,this._set=new Set(e)}get size(){return ve(this._observable),this._set.size}add(e){const i=this._set.size;return this._set.add(e),this._set.size!==i&&this._observable.notify(),this}clear(){this._set.size>0&&(this._set.clear(),this._observable.notify())}delete(e){const i=this._set.delete(e);return i&&this._observable.notify(),i}entries(){return ve(this._observable),this._set.entries()}forEach(e,i){ve(this._observable),this._set.forEach((s,n)=>e.call(i,s,n,this),i)}has(e){return ve(this._observable),this._set.has(e)}keys(){return ve(this._observable),this._set.keys()}values(){return ve(this._observable),this._set.values()}[Symbol.iterator](){return ve(this._observable),this._set[Symbol.iterator]()}get[Symbol.toStringTag](){return this._set[Symbol.toStringTag]}};const Pi="OBJECTID";var Re;(function(t){t[t.size=22]="size",t[t.lineWidth=50]="lineWidth",t[t.maxSize=120]="maxSize",t[t.maxOutlineSize=80]="maxOutlineSize",t[t.tallSymbolWidth=20]="tallSymbolWidth"})(Re||(Re={}));const Oi=Gi("android");Gi("chrome")||Oi&&Oi>=4;Xs();Re.size;Re.maxSize;Re.maxOutlineSize;Re.lineWidth;Re.tallSymbolWidth;function ys(t){return t&&"opacity"in t?t.opacity*ys(t.parent):1}async function Ni(t,e){var k;if(!t)return;const i=t.sourceLayer,s=(e!=null&&e.useSourceLayer?i:t.layer)??i,n=ys(s);if(t.symbol!=null&&(e==null||e.ignoreGraphicSymbol!==!0)){const M=t.symbol.type==="web-style"?await dn(t.symbol,{...e,cache:e!=null?e.webStyleCache:null}):t.symbol.clone();return vt(M,null,n),M}const r=(e==null?void 0:e.renderer)??io(s);let o=r&&"getSymbolAsync"in r?await r.getSymbolAsync(t,e):null;if(!o)return;if(o=o.type==="web-style"?await o.fetchSymbol({...e,cache:e!=null?e.webStyleCache:null}):o.clone(),!r||!("visualVariables"in r)||!((k=r.visualVariables)!=null&&k.length))return vt(o,null,n),o;if("arcadeRequiredForVisualVariables"in r&&r.arcadeRequiredForVisualVariables&&(e==null?void 0:e.arcade)==null){const M={...e};M.arcade=await Wi(),e=M}const{getColor:d,getOpacity:c,getAllSizes:u,getRotationAngle:p}=await E(()=>import("./visualVariableUtils-z2k12BH8.js"),__vite__mapDeps([7,2,3,8])),m=[],f=[],g=[],y=[];for(const M of r.visualVariables)switch(M.type){case"color":m.push(M);break;case"opacity":f.push(M);break;case"rotation":y.push(M);break;case"size":M.target||g.push(M)}const v=!!m.length&&m[m.length-1],F=v?d(v,t,e):null,w=!!f.length&&f[f.length-1];let C=w?c(w,t,e):null;if(n!=null&&(C=C!=null?C*n:n),vt(o,F,C),g.length){const M=u(g,t,e);await cn(o,M)}for(const M of y)un(o,p(M,t,e),M.axis);return o}function io(t){if(t)return"renderer"in t?t.renderer:void 0}function Vi(t){return t&&typeof t.highlight=="function"}const $e=Be.ofType({key:"type",defaultKeyValue:"button",base:Ys,typeMap:{button:Xe,toggle:Xi}}),Ee=new Xe({icon:"magnifying-glass-plus",id:"zoom-to-feature",title:"{messages.zoom}",className:re.zoomInMagnifyingGlass}),Si=new Xe({icon:"trash",id:"remove-selected-feature",title:"{messages.remove}",className:re.trash}),Se=new Xe({icon:"magnifying-glass-plus",id:"zoom-to-clustered-features",title:"{messages.zoom}",className:re.zoomInMagnifyingGlass}),ye=new Xi({icon:"table",id:"browse-clustered-features",title:"{messages.browseClusteredFeatures}",className:re.table,value:!1}),so="esri.widgets.Popup.PopupViewModel",ut=()=>z.getLogger(so),no=t=>{const{event:e,view:i,viewModel:s}=t,{action:n}=e;if(!n)return Promise.reject(new R("trigger-action:missing-arguments","Event has no action"));const{disabled:r,id:o}=n;if(!o)return Promise.reject(new R("trigger-action:invalid-action","action.id is missing"));if(r)return Promise.reject(new R("trigger-action:invalid-action","Action is disabled"));if(o===Ee.id)return oo(s).catch(Ks);if(o===Se.id)return ao(s);if(o===ye.id)return s.browseClusterEnabled=!s.browseClusterEnabled,s.featureMenuOpen=s.browseClusterEnabled,Promise.resolve();if(o===Si.id){s.visible=!1;const{selectedFeature:d}=s;if(!d)return Promise.reject(new R(`trigger-action:${Si.id}`,"selectedFeature is required",{selectedFeature:d}));const{sourceLayer:c}=d;return c?c.remove(d):i==null||i.graphics.remove(d),Promise.resolve()}return Promise.resolve()};function vs(t){const{selectedFeature:e,location:i,view:s}=t;return s?e??i??null:null}function Fe(t){var e,i;return!!t&&t.isAggregate&&((i=(e=t.sourceLayer)==null?void 0:e.featureReduction)==null?void 0:i.type)==="cluster"}async function ro(t,e){if((e==null?void 0:e.type)!=="3d"||!t||t.declaredClass!=="esri.Graphic")return!0;const i=e.getViewForGraphic(t);if(i&&"whenGraphicBounds"in i){let s=null;try{s=await i.whenGraphicBounds(t,{useViewElevation:!0})}catch{}return!s||!s.boundingBox||s.boundingBox[0]===s.boundingBox[3]&&s.boundingBox[1]===s.boundingBox[4]&&s.boundingBox[2]===s.boundingBox[5]}return!0}async function oo(t){var p;const{location:e,selectedFeature:i,view:s,zoomFactor:n}=t,r=vs(t);if(!s||!r){const m=new R("zoom-to:invalid-target-or-view","Cannot zoom to location without a target and view.",{target:r,view:s});throw ut().error(m),m}const o=s.scale/n,d=(p=t.selectedFeature)==null?void 0:p.geometry,c=d??e,u=c!=null&&c.type==="point"&&await ro(i,s);Ee.active=!0,Ee.disabled=!0;try{await t.zoomTo({target:{target:r,scale:u?o:void 0}})}catch{const f=new R("zoom-to:invalid-graphic","Could not zoom to the location of the graphic.",{graphic:i});ut().error(f)}finally{Ee.active=!1,Ee.disabled=!1,t.zoomToLocation=null,u&&(t.location=c)}}async function ao(t){const{selectedFeature:e,view:i}=t;if((i==null?void 0:i.type)!=="2d"){const o=new R("zoomToCluster:invalid-view","View must be 2d MapView.",{view:i});throw ut().error(o),o}if(!e||!Fe(e)){const o=new R("zoomToCluster:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:e});throw ut().error(o),o}const[s,n]=await ii(i,e);Se.active=!0,Se.disabled=!0;const{extent:r}=await s.queryExtent(n);r&&await t.zoomTo({target:r}),Se.active=!1,Se.disabled=!1}async function lo(t){const{view:e,selectedFeature:i}=t;if(!e||!i)return;const[s,n]=await ii(e,i),{extent:r}=await s.queryExtent(n);t.selectedClusterBoundaryFeature.geometry=r,e.graphics.add(t.selectedClusterBoundaryFeature)}async function co(t){const{selectedFeature:e,view:i}=t;if(!i||!e)return;const[s,n]=await ii(i,e);ye.active=!0,ye.disabled=!0;const{features:r}=await s.queryFeatures(n);ye.active=!1,ye.disabled=!1,ye.value=!0,t==null||t.open({features:[e].concat(r),featureMenuOpen:!0})}async function ii(t,e){const i=await t.whenLayerView(e.sourceLayer),s=i.createQuery(),n=e.getObjectId();return s.aggregateIds=n!=null?[n]:[],[i,s]}function uo(t){ye.value=!1;const e=t.features.filter(i=>Fe(i));e.length&&(t.features=e)}const ho=()=>[Ee.clone()],po=()=>[Se.clone(),ye.clone()];let et=null;function mo(t,e){return t==="building-scene"||e==="2d"&&(t==="map-image"||t==="tile"||t==="imagery"||t==="imagery-tile")}let A=class extends Js(gs){constructor(t){super(t),this._pendingPromises=new to,this._fetchFeaturesController=null,this._highlightSelectedFeaturePromise=null,this._highlightActiveFeaturePromise=null,this._selectedClusterFeature=null,this._locationScaleHandle=null,this.actions=new $e,this.activeFeature=null,this.autoCloseEnabled=!1,this.autoOpenEnabled=!0,this.browseClusterEnabled=!1,this.content=null,this.defaultPopupTemplateEnabled=!1,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureViewModelAbilities=null,this.featureViewModels=[],this.highlightEnabled=!0,this.includeDefaultActions=!0,this.selectedClusterBoundaryFeature=new ze({symbol:new en({outline:{width:1.5,color:"cyan"},style:"none"})}),this.title=null,this.updateLocationEnabled=!1,this.view=null,this.visible=!1,this.zoomFactor=4,this.zoomToLocation=null,this._debouncedLocationUpdate=tt(async e=>{var r,o,d;const{view:i}=this,s=(o=(r=this.selectedFeature)==null?void 0:r.geometry)==null?void 0:o.type,n=this.location??e;if(s!=="mesh"&&i&&n&&this.selectedFeature)if(s!=="point")try{const{pendingFeatures:c}=await this._fetchFeaturesWithController({mapPoint:n}),u=(await Promise.all(c)).flat().filter(Boolean);if(!u.length)return;if(u.length!==this.features.length){const g=this._getHighlightLayer(this.selectedFeature),y=(g==null?void 0:g.type)==="imagery"?void 0:g&&"objectIdField"in g?g.objectIdField||Pi:null;if(y){const v=this.selectedFeature.getObjectId(),F=u.findIndex(w=>{const C=this._getHighlightLayer(w);return(C==null?void 0:C.uid)===(g==null?void 0:g.uid)&&w.attributes[y]===v});this.features=u,this.selectedFeatureIndex=F}}const p=(d=u[this.selectedFeatureIndex])==null?void 0:d.geometry,m=((p==null?void 0:p.type)!=="mesh"?p:null)??this.selectedFeature.geometry,f=m?tn(m,i.spatialReference):null;if(!f)return;et||(et=await E(()=>import("./geometryEngineAsync-B-ooCYDN.js"),__vite__mapDeps([91,2,3]))),await et.intersects(f,n)||(this.location=(await et.nearestCoordinate(f,n)).coordinate??n)}catch(c){Pt(c)||z.getLogger(this).error(c)}else this.location=Nt(this.selectedFeature.geometry)??n})}initialize(){this.addHandles([this.on("view-change",()=>this._autoClose()),_(()=>[this.highlightEnabled,this.selectedFeature,this.visible,this.view],()=>this._highlightSelectedFeature()),_(()=>[this.highlightEnabled,this.activeFeature,this.visible,this.view],()=>this._highlightActiveFeature()),_(()=>{var t,e;return(e=(t=this.view)==null?void 0:t.animation)==null?void 0:e.state},t=>this._animationStateChange(t)),_(()=>this.location,t=>this._locationChange(t)),_(()=>this.selectedFeature,t=>this._selectedFeatureChange(t)),_(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),_(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureViewModels],()=>this._setGraphicOnFeatureViewModels()),_(()=>this.featureViewModels,()=>this._featureViewModelsChange()),this.on("trigger-action",t=>no({event:t,viewModel:this,view:this.view})),at(()=>!this.waitingForResult,()=>this._waitingForResultChange(),sn),_(()=>{var t,e,i;return[this.features,(t=this.view)==null?void 0:t.map,(e=this.view)==null?void 0:e.spatialReference,(i=this.view)==null?void 0:i.timeZone]},()=>this._updateFeatureVMs()),_(()=>{var t;return(t=this.view)==null?void 0:t.scale},()=>this._viewScaleChange()),at(()=>!this.visible,()=>this.browseClusterEnabled=!1),_(()=>this.browseClusterEnabled,t=>t?this.enableClusterBrowsing():this.disableClusterBrowsing())])}destroy(){var t;this._cancelFetchingFeatures(),this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null,(t=this._locationScaleHandle)==null||t.remove(),this._locationScaleHandle=null}get active(){return!(!this.visible||this.waitingForResult)}get allActions(){const t=this._get("allActions")||new $e;t.removeAll();const{actions:e,defaultActions:i,defaultPopupTemplateEnabled:s,includeDefaultActions:n,selectedFeature:r}=this,o=n?i.concat(e):e,d=r&&(typeof r.getEffectivePopupTemplate=="function"&&r.getEffectivePopupTemplate(s)||r.popupTemplate),c=d==null?void 0:d.actions,u=d!=null&&d.overwriteActions?c:(c==null?void 0:c.concat(o))??o;return u==null||u.filter(Boolean).forEach(p=>t.add(p)),t}get defaultActions(){const t=this._get("defaultActions")||new $e;return t.removeAll(),t.addMany(Fe(this.selectedFeature)?po():ho()),t}get featureCount(){return this.features.length}set features(t){const e=t||[];this._set("features",e);const{pendingPromisesCount:i,promiseCount:s,selectedFeatureIndex:n}=this,r=s&&e.length;r&&i&&n===-1?this.selectedFeatureIndex=0:r&&n!==-1||(this.selectedFeatureIndex=e.length?0:-1)}set location(t){var n,r,o;let e=t;const i=(r=(n=this.view)==null?void 0:n.spatialReference)==null?void 0:r.isWebMercator;((o=t==null?void 0:t.spatialReference)==null?void 0:o.isWGS84)&&i&&(e=nn(t)),this._set("location",e)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(t){this._pendingPromises.clear(),this.features=[],Array.isArray(t)&&t.length?(this._set("promises",t),(t=t.slice(0)).forEach(e=>this._pendingPromises.add(e)),t.reduce((e,i)=>e.finally(()=>i.then(s=>{this._pendingPromises.has(i)&&this._updateFeatures(s)}).finally(()=>this._pendingPromises.delete(i)).catch(()=>{})),Promise.resolve())):this._set("promises",[])}get selectedFeature(){const{features:t,selectedFeatureIndex:e}=this;return e===-1?null:t[e]||null}get selectedFeatureIndex(){const t=this._get("selectedFeatureIndex");return typeof t=="number"?t:-1}set selectedFeatureIndex(t){const{featureCount:e}=this;t=isNaN(t)||t<-1||!e?-1:(t+e)%e,this.activeFeature=null,this._set("selectedFeatureIndex",t)}get selectedFeatureViewModel(){return this.featureViewModels[this.selectedFeatureIndex]||null}get state(){var t;return(t=this.view)!=null&&t.ready?"ready":"disabled"}get waitingForContents(){return this.featureViewModels.some(t=>t.waitingForContent)}get waitingForResult(){return!(!(this._fetchFeaturesController||this.pendingPromisesCount>0)||this.featureCount!==0)}centerAtLocation(){const{view:t}=this,e=vs(this);return e&&t?this.callGoTo({target:{target:e,scale:t.scale}}):Promise.reject(new R("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:e,view:t}))}zoomTo(t){return this.callGoTo(t)}clear(){this.set({promises:[],features:[],content:null,title:null,location:null,activeFeature:null})}fetchFeatures(t,e){var s;const{view:i}=this;if(!i||!t)throw new R("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:t,view:i});return i.fetchPopupFeatures(t,{pointerType:(s=e==null?void 0:e.event)==null?void 0:s.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:e==null?void 0:e.signal})}open(t){const e={updateLocationEnabled:!1,promises:[],fetchFeatures:!1,...t,visible:!0},{fetchFeatures:i}=e;delete e.fetchFeatures,i&&this._setFetchFeaturesPromises(e.location);const s=["actionsMenuOpen","collapsed"];for(const n of s)delete e[n];this.set(e)}triggerAction(t){const e=this.allActions.at(t);e&&!e.disabled&&this.emit("trigger-action",{action:e})}next(){return this.selectedFeatureIndex++,this}previous(){return this.selectedFeatureIndex--,this}disableClusterBrowsing(){uo(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){const{view:t,selectedFeature:e}=this;(t==null?void 0:t.type)==="2d"?Fe(e)?(await lo(this),await co(this)):z.getLogger(this).warn("enableClusterBrowsing:invalid-selectedFeature: Selected feature must represent an aggregate/cluster graphic.",e):z.getLogger(this).warn("enableClusterBrowsing:invalid-view: View must be 2d MapView.",e)}handleViewClick(t){this.autoOpenEnabled&&this._fetchFeaturesAndOpen(t)}_animationStateChange(t){this.zoomToLocation||(Ee.disabled=t==="waiting-for-target")}_clearBrowsedClusterGraphics(){var e,i;const t=[this.selectedClusterBoundaryFeature,this._selectedClusterFeature].filter(ht);(i=(e=this.view)==null?void 0:e.graphics)==null||i.removeMany(t),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){if(Fe(this.selectedFeature))return this.browseClusterEnabled=!1,this.visible=!1,void this.clear();this.browseClusterEnabled&&(this.features=this.selectedFeature?[this.selectedFeature]:[])}_locationChange(t){const{selectedFeature:e,updateLocationEnabled:i}=this;i&&t&&(!e||e.geometry)&&this.centerAtLocation()}_selectedFeatureIndexChange(){this.featurePage=this.featureCount>1?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null}_featureViewModelsChange(){this.featurePage=this.featureCount>1?1:null}_setGraphicOnFeatureViewModels(){const{features:t,featureCount:e,featurePage:i,featuresPerPage:s,featureViewModels:n}=this;if(i===null)return;const r=((i-1)*s+e)%e,o=r+s;n.slice(r,o).forEach((d,c)=>{d&&(d.graphic??(d.graphic=t[r+c]))})}async _selectedFeatureChange(t){var n;const{location:e,updateLocationEnabled:i,view:s}=this;if(t&&s){if(this.browseClusterEnabled)return this._selectedClusterFeature&&(s.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),Fe(t)?void 0:(t.symbol=await Ni(t),this._selectedClusterFeature=t,void s.graphics.add(this._selectedClusterFeature));if(t.symbol=await Ni(t),!i&&e||!t.geometry){if(i&&!t.geometry){await this.centerAtLocation();const r=(n=s.center)==null?void 0:n.clone();r&&(this.location=r)}}else this.location=Nt(t.geometry)}}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.visible=!1)}async _setFetchFeaturesPromises(t){const{pendingFeatures:e}=await this._fetchFeaturesWithController({mapPoint:t});this.promises=e}_destroyFeatureVMs(){this.featureViewModels.forEach(t=>t&&!t.destroyed&&t.destroy()),this._set("featureViewModels",[])}_updateFeatureVMs(){const{selectedFeature:t,features:e,featureViewModels:i,view:s}=this;if(Fe(t)||(this.browseClusterEnabled=!1),this._destroyFeatureVMs(),!(e!=null&&e.length))return;const n=i.slice(0),r=[];e.forEach((o,d)=>{if(!o)return;let c=null;if(n.some((u,p)=>(u&&u.graphic===o&&(c=u,n.splice(p,1)),!!c)),c)r[d]=c;else{const u=new ti({abilities:this.featureViewModelAbilities,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:s==null?void 0:s.spatialReference,graphic:o===t?o:null,location:this.location,map:s==null?void 0:s.map,view:s});r[d]=u}}),n.forEach(o=>o&&!o.destroyed&&o.destroy()),this._set("featureViewModels",r)}async _getScreenPoint(t,e){const{view:i}=this;await(i==null?void 0:i.when());const s=t==null?void 0:t.spatialReference,n=i==null?void 0:i.spatialReference;return s&&n?(await rn(s,n,null,e),i.toScreen(t)):null}_cancelFetchingFeatures(){const t=this._fetchFeaturesController;t&&t.abort(),this._fetchFeaturesController=null}async _projectScreenPointAndFetchFeatures({mapPoint:t,screenPoint:e,event:i,signal:s}){return this.fetchFeatures(e??await this._getScreenPoint(t??this.location,{signal:s}),{signal:s,event:i})}_fetchFeaturesWithController({mapPoint:t,screenPoint:e,event:i}){this._cancelFetchingFeatures();const s=new AbortController,{signal:n}=s;this._fetchFeaturesController=s;const r=this._projectScreenPointAndFetchFeatures({mapPoint:t,screenPoint:e,signal:n,event:i});return r.catch(()=>{}).then(()=>{this._fetchFeaturesController=null}),r}async _fetchFeaturesAndOpen(t){var r;const{mapPoint:e,screenPoint:i}=t,{view:s}=this;(r=this._locationScaleHandle)==null||r.remove(),this._locationScaleHandle=_(()=>{var o;return(o=this.view)==null?void 0:o.scale},()=>this._debouncedLocationUpdate(e).catch(o=>{Pt(o)||z.getLogger(this).error(o)}));const{pendingFeatures:n}=await this._fetchFeaturesWithController({mapPoint:e,screenPoint:i,event:t});s!=null&&s.popup&&"open"in s.popup&&s.popup.open({location:e??void 0,promises:n})}_autoClose(){this.autoCloseEnabled&&(this.visible=!1)}async _getLayerView(t,e){return await t.when(),t.whenLayerView(e)}_getHighlightLayer(t){const{layer:e,sourceLayer:i}=t;return i&&"layer"in i&&i.layer?i.layer:(i==null?void 0:i.type)==="map-notes"||(i==null?void 0:i.type)==="subtype-group"?i:e}_getHighlightTarget(t,e,i){if(mo(e.type,i))return t;const s=t.getObjectId();if(s!=null)return s;const n=e.type==="imagery"?void 0:"objectIdField"in e?e.objectIdField||Pi:null,r=t.attributes;return r&&n&&r[n]||t}_mapIncludesLayer(t){var e,i,s;return!!((s=(i=(e=this.view)==null?void 0:e.map)==null?void 0:i.allLayers)!=null&&s.includes(t))}async _highlightActiveFeature(){const t="highlight-active-feature";this.removeHandles(t);const{highlightEnabled:e,view:i,activeFeature:s,visible:n}=this;if(!(s&&i&&e&&n))return;const r=this._getHighlightLayer(s);if(!(r&&r instanceof ci&&this._mapIncludesLayer(r)))return;const o=this._getLayerView(i,r);this._highlightActiveFeaturePromise=o;const d=await o;if(!(d&&Vi(d)&&this._highlightActiveFeaturePromise===o&&this.activeFeature&&this.highlightEnabled))return;const c=d.highlight(this._getHighlightTarget(s,r,i.type));this.addHandles(c,t)}async _highlightSelectedFeature(){const t="highlight-selected-feature";this.removeHandles(t);const{selectedFeature:e,highlightEnabled:i,view:s,visible:n}=this;if(!(e&&s&&i&&n))return;const r=this._getHighlightLayer(e);if(!(r&&r instanceof ci&&this._mapIncludesLayer(r)))return;const o=this._getLayerView(s,r);this._highlightSelectedFeaturePromise=o;const d=await o;if(!(d&&Vi(d)&&this._highlightSelectedFeaturePromise===o&&this.selectedFeature&&this.highlightEnabled&&this.visible))return;const c=d.highlight(this._getHighlightTarget(e,r,s.type));this.addHandles(c,t)}_updateFeatures(t){const{features:e}=this,i=t.filter(s=>!e.includes(s));i!=null&&i.length&&(this.features=e.concat(i))}};a([l()],A.prototype,"_fetchFeaturesController",void 0),a([l({type:$e})],A.prototype,"actions",void 0),a([l({readOnly:!0})],A.prototype,"active",null),a([l()],A.prototype,"activeFeature",void 0),a([l({readOnly:!0})],A.prototype,"allActions",null),a([l()],A.prototype,"autoCloseEnabled",void 0),a([l()],A.prototype,"autoOpenEnabled",void 0),a([l()],A.prototype,"browseClusterEnabled",void 0),a([l()],A.prototype,"content",void 0),a([l({type:$e,readOnly:!0})],A.prototype,"defaultActions",null),a([l({type:Boolean})],A.prototype,"defaultPopupTemplateEnabled",void 0),a([l({readOnly:!0})],A.prototype,"featureCount",null),a([l()],A.prototype,"featurePage",void 0),a([l({value:[]})],A.prototype,"features",null),a([l()],A.prototype,"featuresPerPage",void 0),a([l()],A.prototype,"featureMenuOpen",void 0),a([l()],A.prototype,"featureViewModelAbilities",void 0),a([l({readOnly:!0})],A.prototype,"featureViewModels",void 0),a([l()],A.prototype,"highlightEnabled",void 0),a([l()],A.prototype,"includeDefaultActions",void 0),a([l({type:Ht})],A.prototype,"location",null),a([l({readOnly:!0})],A.prototype,"pendingPromisesCount",null),a([l({readOnly:!0})],A.prototype,"promiseCount",null),a([l()],A.prototype,"promises",null),a([l({readOnly:!0})],A.prototype,"selectedClusterBoundaryFeature",void 0),a([l({value:null,readOnly:!0})],A.prototype,"selectedFeature",null),a([l({value:-1})],A.prototype,"selectedFeatureIndex",null),a([l({readOnly:!0})],A.prototype,"selectedFeatureViewModel",null),a([l({readOnly:!0})],A.prototype,"state",null),a([l()],A.prototype,"title",void 0),a([l()],A.prototype,"updateLocationEnabled",void 0),a([l()],A.prototype,"view",void 0),a([l()],A.prototype,"visible",void 0),a([l({readOnly:!0})],A.prototype,"waitingForContents",null),a([l({readOnly:!0})],A.prototype,"waitingForResult",null),a([l()],A.prototype,"zoomFactor",void 0),a([l()],A.prototype,"zoomToLocation",void 0),a([l()],A.prototype,"centerAtLocation",null),A=a([N("esri.widgets.Features.FeaturesViewModel")],A);const si=A;let de=class extends fe{constructor(){super(...arguments),this.actionBar=!0,this.closeButton=!0,this.collapseButton=!1,this.featureNavigation=!0,this.flow=!0,this.heading=!0,this.spinner=!0}};a([l({type:Boolean,nonNullable:!0})],de.prototype,"actionBar",void 0),a([l({type:Boolean,nonNullable:!0})],de.prototype,"closeButton",void 0),a([l({type:Boolean,nonNullable:!0})],de.prototype,"collapseButton",void 0),a([l({type:Boolean,nonNullable:!0})],de.prototype,"featureNavigation",void 0),a([l({type:Boolean,nonNullable:!0})],de.prototype,"flow",void 0),a([l({type:Boolean,nonNullable:!0})],de.prototype,"heading",void 0),a([l({type:Boolean,nonNullable:!0})],de.prototype,"spinner",void 0),de=a([N("esri.widgets.Features.FeaturesVisibleElements")],de);const ws=de,Di="selected-index",fo=0,Bi="features-spinner",go=50;let T=class extends fs(ie){constructor(t,e){super(t,e),this._featureMenuIntersectionObserverCallback=([i])=>{i!=null&&i.isIntersecting&&this.viewModel.featurePage!=null&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._focusOn=null,this._spinner=null,this._feature=null,this._relatedRecordsFlowItems=new Be,this._relatedRecordsWidget=new eo({flowItems:this._relatedRecordsFlowItems}),this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._actionBarMenuNode=null,this.collapsed=!1,this.icon=null,this.featureNavigationTop=!1,this.headerActions=new $e,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new si,this.visibleElements=new ws,this._renderAction=(i,s)=>{const n=this._getActionTitle(i),{type:r,active:o,uid:d,disabled:c,indicator:u}=i;return i.visible?h("calcite-action",{active:r==="toggle"&&i.value,appearance:"solid",bind:this,"data-action-uid":d,disabled:c,icon:this._getActionIcon(i),indicator:u,key:`action-${s}`,loading:o,onclick:this._triggerAction,scale:"s",text:n,title:this._hideActionText?n:void 0},this._getFallbackIcon(i)):null},this._openFeatureMenu=()=>{this.featureMenuOpen=!0,this._focusOn="menu-flow-item"},this._previousFeature=()=>{this.viewModel.selectedFeatureIndex--},this._nextFeature=()=>{this.viewModel.selectedFeatureIndex++},this._handleFeatureMenuBack=()=>{this.featureMenuOpen&&(this._focusOn="root-flow-item",this.featureMenuOpen=!1)},this._focusFlowItemNode=i=>{this._focusOn===i&&requestAnimationFrame(async()=>{var s,n;switch(i){case"menu-flow-item":await((s=this._featureMenuViewportNode)==null?void 0:s.setFocus());break;case"root-flow-item":await((n=this._rootFlowItemNode)==null?void 0:n.setFocus())}this._focusOn=null})},this._focusFlowItemNodeThrottled=lt(this._focusFlowItemNode,go),this._displaySpinnerThrottled=lt(()=>this._displaySpinner(),fo),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,this._focusFlowItemNodeThrottled,_(()=>{var i;return(i=this.viewModel)==null?void 0:i.active},()=>this._toggleScreenLocationEnabled()),_(()=>{var i;return(i=this.viewModel)==null?void 0:i.active},i=>this._relatedRecordsWidget.closed=!i),_(()=>{var i;return(i=this.visibleElements)==null?void 0:i.closeButton},i=>this._relatedRecordsWidget.closable=i),_(()=>{var i;return(i=this.visibleElements)==null?void 0:i.spinner},i=>this._spinnerEnabledChange(i)),_(()=>{var i;return(i=this.viewModel)==null?void 0:i.view},(i,s)=>this._viewChange(i,s)),_(()=>{var i,s;return(s=(i=this.viewModel)==null?void 0:i.view)==null?void 0:s.ready},(i,s)=>this._viewReadyChange(i??!1,s??!1)),_(()=>{var i,s;return[(i=this.viewModel)==null?void 0:i.waitingForResult,(s=this.viewModel)==null?void 0:s.location]},()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),_(()=>{var i;return(i=this.viewModel)==null?void 0:i.screenLocation},()=>this._closeOpenActionMenu()),_(()=>this.selectedFeatureWidget,()=>this._destroyRelatedRecordsFlowItemWidgets()),_(()=>{var s;const i=(s=this.selectedFeatureWidget)==null?void 0:s.viewModel;return[i==null?void 0:i.title,i==null?void 0:i.state]},()=>this._setTitleFromFeatureWidget()),_(()=>{var s;const i=(s=this.selectedFeatureWidget)==null?void 0:s.viewModel;return[i==null?void 0:i.content,i==null?void 0:i.state]},()=>this._setContentFromFeatureWidget()),_(()=>{var i;return(i=this.viewModel)==null?void 0:i.featureViewModels},()=>this._featureMenuViewportScrollTop()),this._relatedRecordsWidget.on("close",()=>this.close()),this._relatedRecordsWidget.on("exit",()=>this._destroyRelatedRecordsFlowItemWidgets()),this._relatedRecordsWidget.on("open-related-feature",({feature:i})=>this._openRelatedFeature(i))])}loadDependencies(){return We({action:()=>E(()=>import("./calcite-action-CEYA6ZsJ.js"),__vite__mapDeps([87,83,2,3,4,5,71,73,74,6,79,1,80])),"action-bar":()=>E(()=>import("./calcite-action-bar-C5PvC65D.js"),__vite__mapDeps([92,2,3,85,6,4,5,73,74,93,89,83,71,79,1,80,75,90,86])),"action-group":()=>E(()=>import("./calcite-action-group-oGHjFsjn.js"),__vite__mapDeps([94,93,2,3,85,6,73,74,4,5,89,83,71,79,1,80,75,90,86])),button:()=>E(()=>import("./calcite-button-CMjDkjDb.js"),__vite__mapDeps([95,2,3,77,4,5,71,78,79,73,74,6,1,80])),flow:()=>E(()=>import("./calcite-flow-AUD7SkeM.js"),__vite__mapDeps([96,2,3,6,73])),"flow-item":()=>E(()=>import("./calcite-flow-item-B7iK8dgk.js"),__vite__mapDeps([88,2,3,4,5,71,73,74,6,89,83,79,1,80,75,90,86,81])),list:()=>E(()=>import("./calcite-list-D9nZpOdw.js"),__vite__mapDeps([70,2,3,4,5,71,6,72,73,74,75,1,76,77,78,79,80,81])),"list-item":()=>E(()=>import("./calcite-list-item-BBiyp6uG.js"),__vite__mapDeps([82,2,3,4,5,71,72,74,6,73,83,79,1,80])),"list-item-group":()=>E(()=>import("./calcite-list-item-group-BIMGmmtA.js"),__vite__mapDeps([97,2,3,71,72])),loader:()=>E(()=>import("./calcite-loader-CzxKWzLl.js"),__vite__mapDeps([98,80,2,3,5]))})}destroy(){var t,e;this._destroyRelatedRecordsFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),(t=this._featureMenuIntersectionObserver)==null||t.disconnect(),(e=this._relatedRecordsWidget)==null||e.destroy()}get _hideActionText(){var e;if(!this.responsiveActionsEnabled)return!1;const t=(e=this.view)==null?void 0:e.widthBreakpoint;return t==="xsmall"||t==="small"||t==="medium"}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&this.visibleElements.featureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.visibleElements.collapseButton&&!!this.title&&!!this.content}get content(){return this.viewModel.content}set content(t){this.viewModel.content=t}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(t){this.viewModel.featureMenuOpen=t}get features(){return this.viewModel.features}set features(t){this.viewModel.features=t}get location(){return this.viewModel.location}set location(t){this.viewModel.location=t}get label(){var t;return((t=this.messages)==null?void 0:t.widgetLabel)??""}set label(t){this._overrideIfSome("label",t)}get promises(){return this.viewModel.promises}set promises(t){this.viewModel.promises=t}get selectedFeature(){return this.viewModel.selectedFeature}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(t){this.viewModel.selectedFeatureIndex=t}get selectedFeatureWidget(){const{_feature:t,headingLevel:e,_relatedRecordsFlowItems:i}=this,{selectedFeatureViewModel:s}=this.viewModel,n={title:!1};return s?(t?(t.viewModel=s,t.visibleElements=n):this._feature=new Yr({flowItems:i,headingLevel:e+1,viewModel:s,visibleElements:n}),this._feature):null}get title(){return this.viewModel.title}set title(t){this.viewModel.title=t}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(t){this.viewModel.updateLocationEnabled=t}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}get visible(){return this.viewModel.visible}set visible(t){this.viewModel.visible=t}blur(){var e;const{active:t}=this.viewModel;t?(e=this._rootFlowItemNode)==null||e.blur():z.getLogger(this).warn("Features can only be blurred when currently active.")}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(t,e){return this.viewModel.fetchFeatures(t,e)}focus(){const{active:t}=this.viewModel;t?this._setFocusOn():z.getLogger(this).warn("Features can only be focused when currently active.")}next(){return this.viewModel.next()}open(t){this.removeHandles(Di);const e={collapsed:(t==null?void 0:t.collapsed)??!1};this.set(e),this.viewModel.open(t),this.addHandles(at(()=>!this.viewModel.waitingForResult,()=>this._addSelectedFeatureIndexHandle(),{once:!0}))}previous(){return this.viewModel.previous()}triggerAction(t){return this.viewModel.triggerAction(t)}render(){return h("div",{bind:this,class:this.classes(H.base,I.widget,I.panel),onkeydown:this._onMainKeydown},this._renderHeader(),this._renderContentContainer())}_renderFeatureNavigation(){return[this._renderPagination(),this._renderFeatureMenuButton()]}_renderHeader(){return!this.featureMenuOpen&&this.featureNavigationTop&&this._featureNavigationVisible?h("div",{class:H.header,key:"header-actions"},this._renderFeatureNavigation()):null}_renderFooter(){return this.featureMenuOpen||this.featureNavigationTop||!this._featureNavigationVisible?null:h("div",{class:H.footer,key:"footer-actions",slot:"footer"},this._renderFeatureNavigation())}_renderFeatureMenuButton(){const{messages:t,viewModel:e}=this,{featureCount:i,selectedFeatureIndex:s,pendingPromisesCount:n}=e;return h("calcite-action",{appearance:"solid",bind:this,icon:"list",key:"feature-menu-button",label:t.selectFeature,loading:n>0,onclick:this._openFeatureMenu,scale:"s",text:ce(t.pageText,{index:xe(s+1),total:xe(i)}),textEnabled:!0,title:t.selectFeature})}_renderPagination(){const{previous:t,next:e}=this.messagesCommon.pagination;return h("calcite-action-bar",{class:H.paginationActionBar,expandDisabled:!0,key:"pagination-action-bar",layout:"horizontal",overflowActionsDisabled:!0,scale:"s"},h("calcite-action-group",{scale:"s"},h("calcite-action",{appearance:"solid",class:H.paginationPrevious,icon:"chevron-left",iconFlipRtl:!0,label:t,onclick:this._previousFeature,scale:"s",text:t,title:t}),h("calcite-action",{appearance:"solid",icon:"chevron-right",iconFlipRtl:!0,label:e,onclick:this._nextFeature,scale:"s",text:e,title:e})))}_renderFeatureMenuItem(t){const{selectedFeatureViewModel:e,featureViewModels:i}=this.viewModel,s=t===e,n=i.indexOf(t);return h("calcite-list-item",{bind:this,"data-feature-index":n,key:`feature-menu-item-${t.uid}`,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onmouseleave:this._removeActiveFeature,onmouseover:this._setActiveFeature,selected:s,onCalciteListItemSelect:this._selectFeature},h("span",{innerHTML:t.title||this.messagesCommon.untitled,slot:"content"}))}_groupResultsByLayer(){const{featureViewModels:t}=this.viewModel,e=new Map;return t.forEach(i=>{const s=i==null?void 0:i.graphic;if(!s)return;const n=s.sourceLayer??s.layer,r=e.get(n)??[];e.set(n,[...r,i])}),e}_renderFeatureMenu(){const{featureViewModels:t}=this.viewModel,e=this._groupResultsByLayer();return t.length?h("calcite-list",{selectionAppearance:"icon",selectionMode:"single"},Array.from(e.keys()).map(i=>{var s;return h("calcite-list-item-group",{heading:(i==null?void 0:i.title)??this.messagesCommon.untitled,key:(i==null?void 0:i.uid)||"untitled"},(s=e.get(i))==null?void 0:s.map(n=>this._renderFeatureMenuItem(n)))})):null}_renderHeaderAction(t,e){return t.visible?h("calcite-action",{active:t.type==="toggle"&&t.value,appearance:"solid",bind:this,"data-action-uid":t.uid,disabled:t.disabled,icon:t.icon||"",indicator:t.indicator,key:`header-action-${e}`,loading:t.active,onclick:this._triggerHeaderAction,scale:"m",slot:"header-actions-end",text:t.title||"",title:t.title||""}):null}_renderHeaderActions(){return this.headerActions.map((t,e)=>this._renderHeaderAction(t,e)).toArray()}_renderContentFeature(){const{headingLevel:t,visibleElements:e,_isCollapsed:i,_collapseEnabled:s,featureNavigationTop:n}=this,{title:r,active:o}=this.viewModel,d=e.heading&&r?r:"";return h("calcite-flow-item",{afterCreate:this._storeRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,class:this.classes({[H.contentFeature]:!0,[H.flowItemCollapsed]:i}),closable:e.closeButton,closed:!o,collapsed:i,collapseDirection:n?"down":"up",collapsible:s,headingLevel:t,key:"root-flow-item",onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},d?h(Kt,{class:this.classes(H.featuresHeading,I.heading),innerHTML:d,key:"header-content",level:this.headingLevel,slot:"header-content"}):null,this._renderHeaderActions(),this._renderActionBar(),i?null:h("div",{class:this.classes(H.container,H.contentContainer)},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){const{viewModel:t,featureMenuOpen:e,messages:i,messagesCommon:s}=this,{active:n,featureViewModels:r,pendingPromisesCount:o}=t;return e?h("calcite-flow-item",{afterCreate:this._storeFeatureMenuFlowItemNode,afterUpdate:this._focusFeatureMenuFlowItemNode,bind:this,closable:!1,closed:!n,description:ce(i.total,{total:r.length}),heading:i.selectFeature,key:"feature-menu",loading:t.waitingForContents,onCalciteFlowItemBack:d=>{d.preventDefault(),this._handleFeatureMenuBack()}},o>0?h("calcite-loader",{class:H.loader,inline:!0,key:"feature-menu-loader",label:s.loading,scale:"m",slot:"header-actions-end"}):null,h("div",{class:H.container},this._renderFeatureMenu()),h("div",{afterCreate:this._featureMenuIntersectionObserverCreated,bind:this,class:H.featureMenuObserver}),h("calcite-button",{appearance:"transparent",onclick:this._handleFeatureMenuBack,slot:"footer-actions",width:"full"},s.back)):null}_renderContentContainer(){const t=[this._renderContentFeature(),this._renderFeatureMenuContainer(),this._relatedRecordsWidget.render()];return this.visibleElements.flow?h("calcite-flow",{key:"content-container"},t):t}_getFallbackIcon(t){const{className:e,icon:i}=t;if(i)return null;const s=fn({action:t,feature:this.selectedFeature}),n={[H.icon]:!!e,[H.actionImage]:!!s};return e&&(n[e]=!0),s||e?h("span",{"aria-hidden":"true",class:this.classes(H.icon,n),key:"icon",styles:mn(s)}):null}_renderActionBar(){var t;return!this._isCollapsed&&this.visibleElements.actionBar&&((t=this.viewModel.allActions)!=null&&t.length)?h("calcite-action-bar",{expandDisabled:!0,expanded:!this._hideActionText,key:"header-action-bar",scale:"s",slot:"action-bar"},h("calcite-action-group",{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:"fixed",scale:"s"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map(this._renderAction)}_renderContent(){var e;const t=(e=this.viewModel)==null?void 0:e.content;return t?typeof t=="string"?h("div",{class:V.contentNode,innerHTML:t,key:t}):this.renderNodeContent(t):null}_setFocusOn(){this.renderNow(),requestAnimationFrame(()=>{this._focusOn=this.featureMenuOpen?"menu-flow-item":"root-flow-item"})}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(t){await t.viewModel.updateGeometry();const e=t.graphic,i=e==null?void 0:e.geometry;if(i==null||e==null)return;this._destroyRelatedRecordsFlowItemWidgets(),await this.viewModel.zoomTo({target:i});const s=Nt(i);this.open({features:[e],location:s??void 0})}_focusRootFlowItemNode(){this._focusFlowItemNodeThrottled("root-flow-item")}_focusFeatureMenuFlowItemNode(){this._focusFlowItemNodeThrottled("menu-flow-item")}_storeRootFlowItemNode(t){this._rootFlowItemNode=t,this._focusFlowItemNodeThrottled("root-flow-item")}_storeFeatureMenuFlowItemNode(t){this._featureMenuViewportNode=t,this._focusFlowItemNodeThrottled("menu-flow-item")}_setActiveFeature(t){var s;const{viewModel:e}=this,i=t.currentTarget["data-feature-index"];e.activeFeature=((s=e.features)==null?void 0:s[i])||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(t){const e=t.currentTarget["data-feature-index"];isNaN(e)||(this.viewModel.selectedFeatureIndex=e),this._handleFeatureMenuBack()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(t){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(t),this._featureMenuIntersectionObserverNode=t}_getActionIcon(t){return t.icon?t.icon:t.image||t.className?void 0:"question"}_getActionTitle(t){const{messages:e,selectedFeature:i,messagesCommon:s}=this,{id:n}=t,r=i==null?void 0:i.attributes,o=t.title??"",d=n==="zoom-to-feature"?ce(o,{messages:e}):n==="remove-selected-feature"?ce(o,{messages:s}):n==="zoom-to-clustered-features"||n==="browse-clustered-features"?ce(o,{messages:e}):t.title;return d&&r?ce(d,r):d??""}_onMainKeydown(t){const{key:e}=t;e==="ArrowLeft"&&(t.stopPropagation(),this._handleFeatureMenuBack(),this.previous()),e==="ArrowRight"&&(t.stopPropagation(),this._handleFeatureMenuBack(),this.next())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&this._featureMenuViewportNode.scrollContentTo({top:0})}_setContentFromFeatureWidget(){const{selectedFeatureWidget:t}=this;t&&(this.viewModel.content=t)}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:t,messagesCommon:e}=this,i=t==null?void 0:t.viewModel;t&&(this.viewModel.title=(i==null?void 0:i.state)==="error"?e==null?void 0:e.errorMessage:(i==null?void 0:i.title)||"")}_addSelectedFeatureIndexHandle(){const t=_(()=>{var e;return(e=this.viewModel)==null?void 0:e.selectedFeatureIndex},(e,i)=>this._selectedFeatureIndexUpdated(e,i));this.addHandles(t,Di)}_selectedFeatureIndexUpdated(t,e){const{featureCount:i}=this.viewModel;i&&t!==e&&t!==-1&&(this._destroyRelatedRecordsFlowItemWidgets(),this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_triggerHeaderAction(t){const e=t.currentTarget;if(e.disabled)return;const i=e.dataset.actionUid,s=this.headerActions.find(({uid:n})=>n===i);s&&!s.disabled&&((s==null?void 0:s.type)==="toggle"&&(s.value=!s.value),this.emit("trigger-header-action",{action:s}))}_triggerAction(t){const e=t.currentTarget;if(e.disabled)return;const i=e.dataset.actionUid,{allActions:s}=this.viewModel,n=s.findIndex(o=>o.uid===i),r=s.at(n);r&&r.type==="toggle"&&(r.value=!r.value),this.viewModel.triggerAction(n)}_createSpinner(t){t&&(this._spinner=new Jr({view:t}),t.ui.add(this._spinner,{key:Bi,position:"manual",internal:!0}))}_wireUpView(t){var e;this._destroySpinner(),t&&((e=this.visibleElements)!=null&&e.spinner)&&this._createSpinner(t)}_hideSpinner(){const{_spinner:t}=this;t&&(t.location=null,t.hide())}_viewReadyChange(t,e){var i;t?this._wireUpView((i=this.viewModel)==null?void 0:i.view):e&&this.viewModel.clear()}_viewChange(t,e){t&&e&&this.viewModel.clear()}_destroySelectedFeatureWidget(){const{_feature:t}=this;t&&(t.viewModel=null,!t.destroyed&&t.destroy()),this._feature=null}_closeOpenActionMenu(){const{_actionBarMenuNode:t}=this;t&&(t.menuOpen=!1)}_destroyRelatedRecordsFlowItemWidgets(){this._relatedRecordsFlowItems.removeAll().forEach(t=>{"showAllEnabled"in t.viewModel&&(t.viewModel.showAllEnabled=!1),t.viewModel=null,t.destroy()})}_toggleScreenLocationEnabled(){const{viewModel:t}=this;t&&(t.screenLocationEnabled=t.active)}_displaySpinner(){const{_spinner:t}=this;if(!t)return;const{location:e,waitingForResult:i}=this.viewModel;i&&e?t.show({location:e}):t.hide()}_destroySpinner(){var i;const{_spinner:t,view:e}=this;t&&((i=e==null?void 0:e.ui)==null||i.remove(t,Bi),t.destroy(),this._spinner=null)}_spinnerEnabledChange(t){var e;this._destroySpinner(),t&&this._createSpinner((e=this.viewModel)==null?void 0:e.view)}};a([l()],T.prototype,"_focusOn",void 0),a([l()],T.prototype,"_relatedRecordsFlowItems",void 0),a([l()],T.prototype,"_hideActionText",null),a([l()],T.prototype,"_featureNavigationVisible",null),a([l()],T.prototype,"_isCollapsed",null),a([l()],T.prototype,"_collapseEnabled",null),a([l()],T.prototype,"collapsed",void 0),a([l()],T.prototype,"content",null),a([l()],T.prototype,"icon",void 0),a([l()],T.prototype,"featureMenuOpen",null),a([l()],T.prototype,"featureNavigationTop",void 0),a([l()],T.prototype,"features",null),a([l({type:$e})],T.prototype,"headerActions",void 0),a([l()],T.prototype,"headingLevel",void 0),a([l()],T.prototype,"location",null),a([l()],T.prototype,"label",null),a([l(),te("esri/widgets/Features/t9n/Features")],T.prototype,"messages",void 0),a([l(),te("esri/t9n/common")],T.prototype,"messagesCommon",void 0),a([l()],T.prototype,"promises",null),a([l()],T.prototype,"responsiveActionsEnabled",void 0),a([l({readOnly:!0})],T.prototype,"selectedFeature",null),a([l()],T.prototype,"selectedFeatureIndex",null),a([l({readOnly:!0})],T.prototype,"selectedFeatureWidget",null),a([l()],T.prototype,"title",null),a([l()],T.prototype,"updateLocationEnabled",null),a([l()],T.prototype,"view",null),a([l({type:si}),ds(["triggerAction","trigger-action"])],T.prototype,"viewModel",void 0),a([l({type:ws,nonNullable:!0})],T.prototype,"visibleElements",void 0),a([l()],T.prototype,"visible",null),T=a([N("esri.widgets.Features")],T);const _o=T,ne="esri-popup",we=`${ne}--is-docked`,D={base:ne,main:`${ne}__main-container`,shadow:`${ne}--shadow`,isDocked:we,isDockedTopLeft:`${we}-top-left`,isDockedTopCenter:`${we}-top-center`,isDockedTopRight:`${we}-top-right`,isDockedBottomLeft:`${we}-bottom-left`,isDockedBottomCenter:`${we}-bottom-center`,isDockedBottomRight:`${we}-bottom-right`,alignTopCenter:`${ne}--aligned-top-center`,alignBottomCenter:`${ne}--aligned-bottom-center`,alignTopLeft:`${ne}--aligned-top-left`,alignBottomLeft:`${ne}--aligned-bottom-left`,alignTopRight:`${ne}--aligned-top-right`,alignBottomRight:`${ne}--aligned-bottom-right`,pointer:`${ne}__pointer`,pointerDirection:`${ne}__pointer-direction`};let Bt=class extends si{constructor(t){super(t)}};Bt=a([N("esri.widgets.Popup.PopupViewModel")],Bt);const bs=Bt;let pe=class extends fe{constructor(){super(...arguments),this.actionBar=!0,this.closeButton=!0,this.collapseButton=!0,this.featureNavigation=!0,this.heading=!0,this.spinner=!0}};a([l({type:Boolean,nonNullable:!0})],pe.prototype,"actionBar",void 0),a([l({type:Boolean,nonNullable:!0})],pe.prototype,"closeButton",void 0),a([l({type:Boolean,nonNullable:!0})],pe.prototype,"collapseButton",void 0),a([l({type:Boolean,nonNullable:!0})],pe.prototype,"featureNavigation",void 0),a([l({type:Boolean,nonNullable:!0})],pe.prototype,"heading",void 0),a([l({type:Boolean,nonNullable:!0})],pe.prototype,"spinner",void 0),pe=a([N("esri.widgets.Features.PopupVisibleElements")],pe);const qt=pe,qi={buttonEnabled:!0,position:"auto",breakpoint:{width:544}};let $=class extends ie{constructor(t,e){super(t,e),this._dockAction=new Xe({id:"popup-dock-action"}),this._featuresWidget=new _o({responsiveActionsEnabled:!0}),this._containerNode=null,this._mainContainerNode=null,this._pointerOffsetInPx=16,this.alignment="auto",this.collapsed=!1,this.dockEnabled=!1,this.headingLevel=2,this.messages=null,this.viewModel=new bs,this.visibleElements=new qt}initialize(){this.addHandles([_(()=>{var t,e;return[(e=(t=this.viewModel)==null?void 0:t.view)==null?void 0:e.widthBreakpoint,this.dockEnabled]},()=>this._handleDockIcon(),P),_(()=>{var t,e;return[this.dockEnabled,(t=this.messages)==null?void 0:t.undock,(e=this.messages)==null?void 0:e.dock]},()=>this._handleDockEnabled(),P),_(()=>this.dockOptions,t=>{const{_dockAction:e}=this,i=this._featuresWidget.headerActions;i.remove(e),t.buttonEnabled&&i.add(e)},P),_(()=>{var t;return(t=this.viewModel)==null?void 0:t.screenLocation},()=>this._positionContainer()),_(()=>{var t;return[(t=this.viewModel)==null?void 0:t.active,this.dockEnabled]},()=>this._toggleScreenLocationEnabled()),_(()=>{var t,e,i,s,n,r,o;return[(t=this.viewModel)==null?void 0:t.screenLocation,(i=(e=this.viewModel)==null?void 0:e.view)==null?void 0:i.padding,(n=(s=this.viewModel)==null?void 0:s.view)==null?void 0:n.size,(r=this.viewModel)==null?void 0:r.active,(o=this.viewModel)==null?void 0:o.location,this.alignment]},()=>this.reposition()),_(()=>{var t,e;return(e=(t=this.viewModel)==null?void 0:t.view)==null?void 0:e.size},(t,e)=>this._updateDockEnabledForViewSize(t,e)),_(()=>{var t;return(t=this.viewModel)==null?void 0:t.view},(t,e)=>this._viewChange(t,e)),_(()=>{var t,e;return(e=(t=this.viewModel)==null?void 0:t.view)==null?void 0:e.ready},(t,e)=>this._viewReadyChange(t??!1,e??!1)),_(()=>this.viewModel,()=>this._featuresWidget.viewModel=this.viewModel,P),_(()=>this._featureNavigationTop,t=>this._featuresWidget.featureNavigationTop=t,P),_(()=>this.headingLevel,t=>this._featuresWidget.headingLevel=t,P),_(()=>this.collapsed,t=>this._featuresWidget.collapsed=t,P),_(()=>this.visibleElements.actionBar,t=>this._featuresWidget.visibleElements.actionBar=!!t,P),_(()=>this.visibleElements.closeButton,t=>this._featuresWidget.visibleElements.closeButton=!!t,P),_(()=>this.visibleElements.collapseButton,t=>this._featuresWidget.visibleElements.collapseButton=!!t,P),_(()=>this.visibleElements.heading,t=>this._featuresWidget.visibleElements.heading=!!t,P),_(()=>this.visibleElements.spinner,t=>this._featuresWidget.visibleElements.spinner=!!t,P),_(()=>this.visibleElements.featureNavigation,t=>this._featuresWidget.visibleElements.featureNavigation=!!t,P),Te(()=>this._featuresWidget,"trigger-header-action",t=>{t.action===this._dockAction&&(this.dockEnabled=!this.dockEnabled)})])}normalizeCtorArgs(t){const e={...t};return(t==null?void 0:t.visibleElements)!=null&&(e.visibleElements=new qt(t.visibleElements),t.collapseEnabled!=null&&(e.visibleElements.collapseButton=t.collapseEnabled),t.spinnerEnabled!=null&&(e.visibleElements.spinner=t.spinnerEnabled)),e}destroy(){var t;this._dockAction.destroy(),(t=this._featuresWidget)==null||t.destroy()}get _featureNavigationTop(){const{currentAlignment:t,currentDockPosition:e}=this;return t==="bottom-left"||t==="bottom-center"||t==="bottom-right"||e==="top-left"||e==="top-center"||e==="top-right"}get actions(){return this.viewModel.actions}set actions(t){this.viewModel.actions=t}get autoCloseEnabled(){return this.viewModel.autoCloseEnabled}set autoCloseEnabled(t){this.viewModel.autoCloseEnabled=t}get autoOpenEnabled(){return Pe(z.getLogger(this),"autoOpenEnabled",{replacement:"MapView/SceneView.popupEnabled",version:"4.27"}),this.viewModel.autoOpenEnabled}set autoOpenEnabled(t){Pe(z.getLogger(this),"autoOpenEnabled",{replacement:"MapView/SceneView.popupEnabled",version:"4.27"}),this.viewModel.autoOpenEnabled=t}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(t){this.viewModel.defaultPopupTemplateEnabled=t}get content(){return this.viewModel.content}set content(t){this.viewModel.content=t}get collapseEnabled(){return Pe(z.getLogger(this),"collapseEnabled",{replacement:"PopupVisibleElements.collapseButton",version:"4.29"}),this.visibleElements.collapseButton}set collapseEnabled(t){Pe(z.getLogger(this),"collapseEnabled",{replacement:"PopupVisibleElements.collapseButton",version:"4.29"}),this.visibleElements.collapseButton=t}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._get("dockOptions")||qi}set dockOptions(t){var d,c;const e={...qi},i=(c=(d=this.viewModel)==null?void 0:d.view)==null?void 0:c.breakpoints,s={};i&&(s.width=i.xsmall,s.height=i.xsmall);const n={...e,...t},r={...e.breakpoint,...s},{breakpoint:o}=n;typeof o=="object"?n.breakpoint={...r,...o}:o&&(n.breakpoint=r),this._set("dockOptions",n),this._setCurrentDockPosition(),this.reposition()}get featureCount(){return this.viewModel.featureCount}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(t){this.viewModel.featureMenuOpen=t}get features(){return this.viewModel.features}set features(t){this.viewModel.features=t}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(t){this.viewModel.goToOverride=t}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(t){this.viewModel.highlightEnabled=t}get location(){return this.viewModel.location}set location(t){this.viewModel.location=t}get label(){var t;return((t=this.messages)==null?void 0:t.widgetLabel)??""}set label(t){this._overrideIfSome("label",t)}get promises(){return this.viewModel.promises}set promises(t){this.viewModel.promises=t}get selectedFeature(){return this.viewModel.selectedFeature}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(t){this.viewModel.selectedFeatureIndex=t}get selectedFeatureWidget(){return this._featuresWidget.selectedFeatureWidget}get spinnerEnabled(){return Pe(z.getLogger(this),"spinnerEnabled",{replacement:"PopupVisibleElements.spinner",version:"4.29"}),this.visibleElements.spinner}set spinnerEnabled(t){Pe(z.getLogger(this),"spinnerEnabled",{replacement:"PopupVisibleElements.spinner",version:"4.29"}),this.visibleElements.spinner=t}get title(){return this.viewModel.title}set title(t){this.viewModel.title=t}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(t){this.viewModel.updateLocationEnabled=t}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}get visible(){return this.viewModel.visible}set visible(t){this.viewModel.visible=t}blur(){const{active:t}=this.viewModel;t||z.getLogger(this).warn("Popup can only be blurred when currently active."),this._featuresWidget.blur()}clear(){return this.viewModel.clear()}close(){this.visible=!1}fetchFeatures(t,e){return this.viewModel.fetchFeatures(t,e)}focus(){const{active:t}=this.viewModel;t||z.getLogger(this).warn("Popup can only be focused when currently active."),this.reposition(),requestAnimationFrame(()=>{this._featuresWidget.focus()})}next(){return this.viewModel.next()}open(t){const e=!!t&&!!t.featureMenuOpen,i={collapsed:!!t&&!!t.collapsed,featureMenuOpen:e};this.set(i),this.viewModel.open(t),this._shouldFocus(t)}previous(){return this.viewModel.previous()}reposition(){this.renderNow(),this._positionContainer(),this._setCurrentAlignment()}triggerAction(t){return this.viewModel.triggerAction(t)}render(){var u,p,m,f;const{dockEnabled:t,currentAlignment:e,currentDockPosition:i}=this,{active:s}=this.viewModel,n=s&&t,r=s&&!t,o=(p=(u=this.selectedFeature)==null?void 0:u.layer)==null?void 0:p.title,d=(f=(m=this.selectedFeature)==null?void 0:m.layer)==null?void 0:f.id,c={[D.alignTopCenter]:e==="top-center",[D.alignBottomCenter]:e==="bottom-center",[D.alignTopLeft]:e==="top-left",[D.alignBottomLeft]:e==="bottom-left",[D.alignTopRight]:e==="top-right",[D.alignBottomRight]:e==="bottom-right",[D.isDocked]:n,[D.shadow]:r,[D.isDockedTopLeft]:i==="top-left",[D.isDockedTopCenter]:i==="top-center",[D.isDockedTopRight]:i==="top-right",[D.isDockedBottomLeft]:i==="bottom-left",[D.isDockedBottomCenter]:i==="bottom-center",[D.isDockedBottomRight]:i==="bottom-right"};return h("div",{afterCreate:this._positionContainer,afterUpdate:this._positionContainer,bind:this,class:this.classes(D.base,c),"data-layer-id":d,"data-layer-title":o,role:"presentation"},s?[this._renderMainContainer(),this._renderPointer()]:null)}_renderPointer(){return this.dockEnabled?null:h("div",{class:D.pointer,key:"popup-pointer",role:"presentation"},h("div",{class:this.classes(D.pointerDirection,D.shadow)}))}_renderMainContainer(){const{dockEnabled:t}=this,e={[D.shadow]:t};return h("div",{afterCreate:this._setMainContainerNode,afterUpdate:this._setMainContainerNode,bind:this,class:this.classes(D.main,I.widget,e)},this._featuresWidget.render())}async _shouldFocus(t){t!=null&&t.shouldFocus&&(await on(()=>{var e;return((e=this.viewModel)==null?void 0:e.active)===!0}),this.focus())}_isOutsideView(t){const{popupHeight:e,popupWidth:i,screenLocation:s,side:n,view:r}=t;if(isNaN(i)||isNaN(e)||!r||!s)return!1;const o=r.padding;return n==="right"&&s.x+i/2>r.width-o.right||n==="left"&&s.x-i/2r.height-o.bottom}_calculateAutoAlignment(t){if(t!=="auto")return t;const{_pointerOffsetInPx:e,_containerNode:i,_mainContainerNode:s,viewModel:n}=this,{screenLocation:r,view:o}=n;if(r==null||!o||!i)return"top-center";function d(k){return parseInt(k.replaceAll(/[^-\d\.]/g,""),10)}const c=s?window.getComputedStyle(s,null):null,u=c?d(c.getPropertyValue("max-height")):0,p=c?d(c.getPropertyValue("height")):0,{height:m,width:f}=i.getBoundingClientRect(),g=f+e,y=Math.max(m,u,p)+e,v=this._isOutsideView({popupHeight:y,popupWidth:g,screenLocation:r,side:"right",view:o}),F=this._isOutsideView({popupHeight:y,popupWidth:g,screenLocation:r,side:"left",view:o}),w=this._isOutsideView({popupHeight:y,popupWidth:g,screenLocation:r,side:"top",view:o}),C=this._isOutsideView({popupHeight:y,popupWidth:g,screenLocation:r,side:"bottom",view:o});return F?w?"bottom-right":"top-right":v?w?"bottom-left":"top-left":w?C?"top-center":"bottom-center":"top-center"}_callCurrentAlignment(t){return typeof t=="function"?t.call(this):t}_getCurrentAlignment(){const{alignment:t,dockEnabled:e}=this;return e||!this.viewModel.active?null:this._calculatePositionResult(this._calculateAutoAlignment(this._callCurrentAlignment(t)))}_setCurrentAlignment(){this._set("currentAlignment",this._getCurrentAlignment())}_setCurrentDockPosition(){this._set("currentDockPosition",this._getCurrentDockPosition())}_calculatePositionResult(t){const e=["left","right"];return ke(this.container)&&e.reverse(),t==null?void 0:t.replace(/leading/gi,e[0]).replaceAll(/trailing/gi,e[1])}_callDockPosition(t){return typeof t=="function"?t.call(this):t}_getDockPosition(){var t;return this._calculatePositionResult(this._calculateAutoDockPosition(this._callDockPosition((t=this.dockOptions)==null?void 0:t.position)))}_getCurrentDockPosition(){return this.dockEnabled&&this.viewModel.active?this._getDockPosition():null}_calculateAutoDockPosition(t){var o;if(t!=="auto")return t;const e=(o=this.viewModel)==null?void 0:o.view,i=ke(this.container)?"top-left":"top-right";if(!e)return i;const s=e.padding||{left:0,right:0,top:0,bottom:0},n=e.width-s.left-s.right,{breakpoints:r}=e;return r&&n<=r.xsmall?"bottom-center":i}_getDockIcon(){const t=this._getDockPosition();if(this.dockEnabled)return"minimize";switch(t){case"top-left":case"bottom-left":return"dock-left";case"top-center":return"maximize";case"bottom-center":return"dock-bottom";default:return"dock-right"}}_handleDockIcon(){this._dockAction.icon=this._getDockIcon()}_handleDockEnabled(){var t,e;this._dockAction.title=this.dockEnabled?(t=this.messages)==null?void 0:t.undock:(e=this.messages)==null?void 0:e.dock}_setMainContainerNode(t){this._mainContainerNode=t}_positionContainer(t=this._containerNode){if(t&&(this._containerNode=t),!this._containerNode)return;const{screenLocation:e}=this.viewModel,{width:i}=this._containerNode.getBoundingClientRect(),s=this._calculatePositionStyle(e,i);s&&Object.assign(this._containerNode.style,s)}_calculateFullWidth(t){const{currentAlignment:e,_pointerOffsetInPx:i}=this;return e==="top-left"||e==="bottom-left"||e==="top-right"||e==="bottom-right"?t+i:t}_calculateAlignmentPosition(t,e,i,s){const{currentAlignment:n,_pointerOffsetInPx:r}=this;if(!i)return;const{padding:o}=i,d=s/2,c=i.height-e,u=i.width-t;return n==="bottom-center"?{top:e+r-o.top,left:t-d-o.left}:n==="top-left"?{bottom:c+r-o.bottom,right:u+r-o.right}:n==="bottom-left"?{top:e+r-o.top,right:u+r-o.right}:n==="top-right"?{bottom:c+r-o.bottom,left:t+r-o.left}:n==="bottom-right"?{top:e+r-o.top,left:t+r-o.left}:n==="top-center"?{bottom:c+r-o.bottom,left:t-d-o.left}:void 0}_calculatePositionStyle(t,e){const{dockEnabled:i,view:s}=this;if(!s)return;if(i)return{left:"",top:"",right:"",bottom:""};if(t==null||!e)return;const n=this._calculateFullWidth(e),r=this._calculateAlignmentPosition(t.x,t.y,s,n);return r?{top:r.top!==void 0?`${r.top}px`:"auto",left:r.left!==void 0?`${r.left}px`:"auto",bottom:r.bottom!==void 0?`${r.bottom}px`:"auto",right:r.right!==void 0?`${r.right}px`:"auto"}:void 0}_viewChange(t,e){t&&e&&(this.close(),this.clear())}_viewReadyChange(t,e){t?this._wireUpView():e&&(this.close(),this.clear())}_wireUpView(){this._setDockEnabledForViewSize(this.dockOptions)}_dockingThresholdCrossed(t,e,i){const[s,n]=t,[r,o]=e,{width:d=0,height:c=0}=i??{};return s<=d&&r>d||s>d&&r<=d||n<=c&&o>c||n>c&&o<=c}_updateDockEnabledForViewSize(t,e){var u,p;if(!t||!e)return;const i=((p=(u=this.viewModel)==null?void 0:u.view)==null?void 0:p.padding)||{left:0,right:0,top:0,bottom:0},s=i.left+i.right,n=i.top+i.bottom,r=[],o=[];r[0]=t[0]-s,r[1]=t[1]-n,o[0]=e[0]-s,o[1]=e[1]-n;const{dockOptions:d}=this,c=d.breakpoint;this._dockingThresholdCrossed(r,o,c)&&this._setDockEnabledForViewSize(d),this._setCurrentDockPosition()}_toggleScreenLocationEnabled(){const{dockEnabled:t,viewModel:e}=this;if(!e)return;const i=e.active&&!t;e.screenLocationEnabled=i}_shouldDockAtCurrentViewSize(t){var d,c;const e=t.breakpoint,i=(c=(d=this.viewModel)==null?void 0:d.view)==null?void 0:c.ui;if(!i)return!1;const{width:s,height:n}=i;if(isNaN(s)||isNaN(n)||!e)return!1;const r=e.hasOwnProperty("width")&&s<=(e.width??0),o=e.hasOwnProperty("height")&&n<=(e.height??0);return r||o}_setDockEnabledForViewSize(t){t.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(t))}};a([l({readOnly:!0})],$.prototype,"_featureNavigationTop",null),a([l()],$.prototype,"actions",null),a([l()],$.prototype,"alignment",void 0),a([l()],$.prototype,"autoCloseEnabled",null),a([l()],$.prototype,"autoOpenEnabled",null),a([l()],$.prototype,"defaultPopupTemplateEnabled",null),a([l()],$.prototype,"content",null),a([l()],$.prototype,"collapsed",void 0),a([l()],$.prototype,"collapseEnabled",null),a([l({readOnly:!0})],$.prototype,"currentAlignment",null),a([l({readOnly:!0})],$.prototype,"currentDockPosition",null),a([l()],$.prototype,"dockOptions",null),a([l()],$.prototype,"dockEnabled",void 0),a([l({readOnly:!0})],$.prototype,"featureCount",null),a([l()],$.prototype,"featureMenuOpen",null),a([l()],$.prototype,"features",null),a([l()],$.prototype,"goToOverride",null),a([l()],$.prototype,"headingLevel",void 0),a([l()],$.prototype,"highlightEnabled",null),a([l()],$.prototype,"location",null),a([l()],$.prototype,"label",null),a([l(),te("esri/widgets/Popup/t9n/Popup")],$.prototype,"messages",void 0),a([l()],$.prototype,"promises",null),a([l({readOnly:!0})],$.prototype,"selectedFeature",null),a([l()],$.prototype,"selectedFeatureIndex",null),a([l({readOnly:!0})],$.prototype,"selectedFeatureWidget",null),a([l()],$.prototype,"spinnerEnabled",null),a([l()],$.prototype,"title",null),a([l()],$.prototype,"updateLocationEnabled",null),a([l()],$.prototype,"view",null),a([l({type:bs}),ds(["triggerAction","trigger-action"])],$.prototype,"viewModel",void 0),a([l()],$.prototype,"visible",null),a([l({type:qt,nonNullable:!0})],$.prototype,"visibleElements",void 0),$=a([N("esri.widgets.Popup")],$);const Ua=$;export{Ua as default}; +import{l_ as zt,i$ as ni,aH as xe,aF as De,I as zi,aL as As,aI as ri,dh as Cs,lg as Es,s as z,aM as $s,a1 as xs,c8 as Wi,ba as oi,l$ as ot,V as Be,d as a,y as l,e1 as qe,j as ze,f as N,a7 as fe,g as _,P,N as R,gZ as Ts,i4 as te,i5 as ie,z as Te,i6 as We,_ as E,i7 as h,m0 as I,m1 as ai,m2 as li,m3 as ke,m4 as re,m5 as ks,iN as Ls,b8 as Hi,a9 as ji,m6 as Wt,Z as Rs,fy as Ps,dc as Le,jt as Os,aX as _t,Q as Ns,M as Vs,q as ht,m7 as Ss,m8 as Ds,m9 as Bs,aA as Ht,ma as qs,mb as Ui,bc as zs,mc as di,b4 as Ws,dn as Zi,eW as yt,k as tt,u as Hs,fx as Qi,l4 as js,b as Pt,ca as Us,p as at,dV as Zs,md as Qs,me as Gs,mf as ve,E as Gi,mg as Xs,mh as Ys,mi as Xe,mj as Xi,eN as Ks,mk as Js,dz as en,bv as tn,ez as sn,ew as nn,d2 as rn,bT as ci,jD as Pe,fK as on}from"./index-BjUNJPVf.js";import{s as ce}from"./substitute-Bz_UrLGp.js";import{a as an}from"./AttachmentInfo-Cm6dhnUr.js";import{c as ui}from"./AttachmentQuery-DmEAIZff.js";import{Z as ln,N as jt}from"./utils-Bzmbfe7p.js";import"./ColorStop-DCGjAKLC.js";import{h as Oe,N as dn,g as vt,R as cn,D as un}from"./utils-Dx_a2yJw.js";import{l as hn}from"./jsonUtils-Dw332y6z.js";import{s as wt}from"./executeQueryJSON-COxi_Fac.js";import"./pbf-Du8sFEWo.js";import"./FeatureSet-opEn8ou8.js";import Ot from"./RelationshipQuery-BDJrOxaX.js";import"./TopFeaturesQuery-CVQjqlfM.js";import pn from"./FeatureLayer-BHxNIHhy.js";import"./styleUtils-DOUOskVZ.js";import"./utils-CuXO_Zzq.js";import"./UniqueValueRenderer-7V9Bhr-D.js";import"./diffUtils-uUoMDFQS.js";import"./colorRamps-CcakIWlU.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-BX9G5gNQ.js";import"./jsonUtils-Ox5U0P0F.js";import"./Version-Dqq_CHBG.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./OverrideHelper-DxFZBnGL.js";import"./quantizationUtils-CfV316jZ.js";import"./heatmapUtils-BSteZBTj.js";import"./query-Bk_ITqRK.js";import"./pbfQueryUtils-CSeFSIjv.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./queryZScale-Dwvn5BlQ.js";import"./FormTemplate-BGxtsGX6.js";import"./editsZScale-Bfe6gH1b.js";import"./EditBusLayer-OslMX9fF.js";import"./FeatureEffectLayer-DarO4Ctx.js";import"./FeatureEffect-DBbkrS6j.js";import"./FeatureLayerBase-D0I-Escx.js";import"./featureLayerUtils-lwqyOSrl.js";import"./LayerFloorInfo-DlYNbO-A.js";import"./serviceCapabilitiesUtils-DiP90Uds.js";import"./FeatureReductionLayer-CK-tyM-9.js";import"./FeatureReductionSelection-t3T7oa8H.js";import"./LabelClass-CeatfK8u.js";import"./labelUtils-3p0-m-Ee.js";import"./defaultsJSON-CHAaurhX.js";import"./MD5-C9MwAd2G.js";import"./OrderedLayer-dLoPhxcx.js";import"./OrderByInfo-DKyk5GLW.js";import"./RefreshableLayer-_r2TPtol.js";import"./TemporalLayer-CKICYnEl.js";import"./TimeInfo-DooETFWC.js";import"./FeatureTemplate-FZNGA_Ik.js";import"./FeatureType-CwUl8Nf5.js";import"./fieldProperties-DnrQXLBM.js";import"./labelingInfo-DqAUis6e.js";import"./versionUtils-BIAEZzrm.js";import"./styleUtils--I7zqeL6.js";import"./popupUtils-DlZin22m.js";import"./interfaces-CL2NbQte.js";function lt(t,e,i,s){let n=null,r=1e3;typeof e=="number"?(r=e,s=i):(n=e??null,r=i);let o,d=0;const c=()=>{d=0,t.apply(s,o)},u=(...p)=>{n&&n.apply(s,p),o=p,r?d||(d=setTimeout(c,r)):c()};return u.remove=()=>{d&&(clearTimeout(d),d=0)},u.forceUpdate=()=>{d&&(clearTimeout(d),c())},u.hasPendingUpdates=()=>!!d,u}function Nt(t){var e;switch(t==null?void 0:t.type){case"point":return t;case"extent":return t.center;case"polygon":return t.centroid;case"multipoint":case"polyline":return(e=t.extent)==null?void 0:e.center;default:return null}}function mn(t){return t?{backgroundImage:`url(${t})`}:{}}function fn({action:t,feature:e}){const i=e==null?void 0:e.attributes,s="image"in t?t.image:void 0;return s&&i?ce(s,i):s??""}function gn(t,e){return{type:zt(e),value:t,unit:e}}function _n(t,e){return{type:zt(e),value:t,unit:e}}function Ut(t,e,i="arithmetic"){return{type:zt(e),value:t,unit:e,rotationType:i}}gn(0,"meters");_n(0,"square-meters");Ut(0,"radians");Ut(0,"degrees");Ut(0,"degrees","geographic");const hi=["B","kB","MB","GB","TB"];function yn(t,e){let i=(e=Math.round(e))===0?0:Math.floor(Math.log(e)/Math.log(ni.KILOBYTES));i=zi(i,0,hi.length-1);const s=xe(e/ni.KILOBYTES**i,{maximumFractionDigits:2});return De(t.units.bytes[hi[i]],{fileSize:s})}const vn="esri.widgets.Feature.support.featureUtils",pi=()=>z.getLogger(vn),wn=/href=(""|'')/gi,bn=/(\{([^\{\r\n]+)\})/g,Mn=/\'/g,Yi=/^\s*expression\//i,In=/(\n)/gi,Fn=/[\u00A0-\u9999<>\&]/gim,An=/href\s*=\s*(?:\"([^\"]+)\"|\'([^\']+)\')/gi,Cn=/^(?:mailto:|tel:)/,Ki="relationships/",mi=$s("short-date-short-time");function Ji(t){if(t!=null)return(t.sourceLayer||t.layer)??void 0}async function dt(t,e){return typeof t=="function"?t(e):t}function es(t=""){if(t)return!Cn.test(t.trim().toLowerCase())}function Zt(t){return!!t&&Yi.test(t)}function En(t,e){if(!Zt(e)||!t)return;const i=e.replace(Yi,"").toLowerCase();return t.find(({name:s})=>s.toLowerCase()===i)}function ts(t,e){const i=En(e,t==null?void 0:t.fieldName);return i?i.title||null:t?t.label||t.fieldName:null}function $n(t,e){const i=e.get(t.toLowerCase());return`{${(i==null?void 0:i.fieldName)||t}}`}function xn(t){return t.replaceAll(wn,"")}function Ge(t,e){const i=Qt(e,t);return i?i.name:t}function Tn(t,e){return t&&t.map(i=>Ge(i,e))}function Qt(t,e){return t&&typeof t.getField=="function"&&e?t.getField(e)??null:null}function is(t){return`${t}`.trim()}function Ae({attributes:t,globalAttributes:e,layer:i,text:s,expressionAttributes:n,fieldInfoMap:r}){return s?Vt({formattedAttributes:e,template:Pn(s,{...e,...n,...t},i),fieldInfoMap:r}):""}function Vt({formattedAttributes:t,template:e,fieldInfoMap:i}){return is(xn(De(De(e,s=>$n(s,i)),t)))}function kn(t,e,i=!1){const s=e[t];if(typeof s=="string"){const n="%27",r=(i?encodeURIComponent(s):s).replaceAll(Mn,n);e[t]=r}}function Ln(t,e=!1){const i={...t};return Object.keys(i).forEach(s=>kn(s,i,e)),i}function Rn(t,e,i){const s=(e=is(e))&&e[0]!=="{";return De(t,Ln(i,s||!1))}function St(t,e){return t.replaceAll(bn,(i,s,n)=>{const r=Qt(e,n);return r?`{${r.name}}`:s})}function Pn(t,e,i){const s=St(t,i);return s&&s.replaceAll(An,(n,r,o)=>Rn(n,r||o,e))}function On(t,e){if(typeof t=="string"&&e&&e.dateFormat==null&&(e.places!=null||e.digitSeparator!=null)){const i=Number(t);if(!isNaN(i))return i}return t}function Nn(t){return t!=null&&typeof t=="object"&&"fieldsIndex"in t&&"geometryType"in t&&"getField"in t&&"load"in t&&"loaded"in t&&"objectIdField"in t&&"spatialReference"in t&&"type"in t&&(t.type==="feature"||t.type==="scene")&&"when"in t}function Vn(t){return t!=null&&typeof t=="object"&&"createQuery"in t&&"queryFeatureCount"in t&&"queryObjectIds"in t&&"queryRelatedFeatures"in t&&"queryRelatedFeaturesCount"in t&&"relationships"in t}function ss(t){return Nn(t)&&Vn(t)}function Sn(t,e){var p;const{fieldInfos:i,fieldName:s,preventPlacesFormatting:n,layer:r,timeZone:o}=e,d=ns(i,s),c=Qt(r,s);if(d&&!oi(s)){const m=c==null?void 0:c.type,f=(p=d.format)==null?void 0:p.dateFormat;if(m==="date"||m==="date-only"||m==="time-only"||m==="timestamp-offset"||f)return jt(t,{format:f,fieldType:m,timeZoneOptions:{layerTimeZone:r&&"preferredTimeZone"in r?r.preferredTimeZone:null,viewTimeZone:o,datesInUnknownTimezone:!(!r||!("datesInUnknownTimezone"in r))&&!!r.datesInUnknownTimezone}})}const u=d==null?void 0:d.format;return typeof t=="string"&&oi(s)&&u?Dn(t,u):typeof(t=On(t,u))=="string"||t==null||u==null?Ye(t):xe(t,n?{...ot(u),minimumFractionDigits:0,maximumFractionDigits:20}:ot(u))}function Dn(t,e){return t=t.trim(),/\d{2}-\d{2}/.test(t)?t:t.includes(",")?bt(t,",",", ",e):t.includes(";")?bt(t,";","; ",e):t.includes(" ")?bt(t," "," ",e):xe(Number(t),ot(e))}function bt(t,e,i,s){return t.trim().split(e).map(n=>xe(Number(n),ot(s))).join(i)}function ns(t,e){if(t!=null&&t.length&&e)return t.find(i=>{var s;return((s=i.fieldName)==null?void 0:s.toLowerCase())===e.toLowerCase()})}function Bn({fieldName:t,graphic:e,layer:i}){if(me(t)||!i||typeof i.getFeatureType!="function")return null;const{typeIdField:s}=i;if(!s||t!==s)return null;const n=i.getFeatureType(e);return n?n.name:null}function qn({fieldName:t,value:e,graphic:i,layer:s}){if(me(t)||!s||typeof s.getFieldDomain!="function")return null;const n=i&&s.getFieldDomain(t,{feature:i});return n&&n.type==="coded-value"?n.getName(e):null}function zn(t,e,i,s){const{creatorField:n,creationDateField:r,editorField:o,editDateField:d}=t;if(!e)return;const c=As(s&&"preferredTimeZone"in s?s.preferredTimeZone:null,!(!s||!("datesInUnknownTimezone"in s))&&!!s.datesInUnknownTimezone,i,mi,"date"),u={...mi,...c},p=e[d];if(typeof p=="number"){const f=e[o];return{type:"edit",date:ri(p,u),user:f}}const m=e[r];if(typeof m=="number"){const f=e[n];return{type:"create",date:ri(m,u),user:f}}return null}function Wn(t,e){const i=new Map;return t&&t.forEach(s=>{const n=Ge(s.fieldName,e);s.fieldName=n,i.set(n.toLowerCase(),s)}),i}function fi(t){const e=[];if(!t)return e;const{fieldInfos:i,content:s}=t;return i&&e.push(...i),s&&Array.isArray(s)&&s.forEach(n=>{if(n.type==="fields"){const r=n==null?void 0:n.fieldInfos;r&&e.push(...r)}}),e}function Gt(t){return t.replaceAll(Fn,e=>`&#${e.charCodeAt(0)};`)}function Ye(t){return typeof t=="string"?t.replaceAll(In,'
'):t}function rs(t){var m;const{value:e,fieldName:i,fieldInfos:s,fieldInfoMap:n,layer:r,graphic:o,timeZone:d}=t;if(e==null)return"";const c=qn({fieldName:i,value:e,graphic:o,layer:r});if(c)return c;const u=Bn({fieldName:i,graphic:o,layer:r});if(u)return u;if(n.get(i.toLowerCase()))return Sn(e,{fieldInfos:s||Array.from(n.values()),fieldName:i,layer:r,timeZone:d});const p=(m=r==null?void 0:r.fieldsIndex)==null?void 0:m.get(i);return p&&(ln(p)||xs(p))?jt(e,{fieldType:p.type,timeZoneOptions:{layerTimeZone:r&&"preferredTimeZone"in r?r.preferredTimeZone:null,viewTimeZone:d,datesInUnknownTimezone:!(!r||!("datesInUnknownTimezone"in r))&&!!r.datesInUnknownTimezone}}):Ye(e)}function Mt({fieldInfos:t,attributes:e,layer:i,graphic:s,fieldInfoMap:n,relatedInfos:r,timeZone:o}){const d={};return r==null||r.forEach(c=>Zn({attributes:d,relatedInfo:c,fieldInfoMap:n,fieldInfos:t,layer:i,timeZone:o})),e&&Object.keys(e).forEach(c=>{const u=e[c];d[c]=rs({fieldName:c,fieldInfos:t,fieldInfoMap:n,layer:i,value:u,graphic:s,timeZone:o})}),d}async function os(t,e){var p,m;const{layer:i,graphic:s,outFields:n,objectIds:r,returnGeometry:o,spatialReference:d}=t,c=r[0];if(typeof c!="number"&&typeof c!="string"){const f="Could not query required fields for the specified feature. The feature's ID is invalid.",g={layer:i,graphic:s,objectId:c,requiredFields:n};return pi().warn(f,g),null}if(!((m=(p=Cs(i))==null?void 0:p.operations)!=null&&m.supportsQuery)){const f="The specified layer cannot be queried. The following fields will not be available.",g={layer:i,graphic:s,requiredFields:n,returnGeometry:o};return pi().warn(f,g),null}const u=i.createQuery();return u.objectIds=r,u.outFields=n!=null&&n.length?n:[i.objectIdField],u.returnGeometry=!!o,u.returnZ=!!o,u.returnM=!!o,u.outSpatialReference=d,(await i.queryFeatures(u,e)).features[0]}async function Hn(t){var s;if(!((s=t.expressionInfos)!=null&&s.length))return!1;const e=await Wi(),{arcadeUtils:{hasGeometryFunctions:i}}=e;return i(t)}async function jn({graphic:t,popupTemplate:e,layer:i,spatialReference:s},n){if(!i||!e||(typeof i.load=="function"&&await i.load(n),!t.attributes))return;const r=t.attributes[i.objectIdField];if(r==null)return;const o=[r],d=await e.getRequiredFields(i.fieldsIndex),c=Es(d,t),u=c?[]:d,p=e.returnGeometry||await Hn(e);if(c&&!p)return;const m=await os({layer:i,graphic:t,outFields:u,objectIds:o,returnGeometry:p,spatialReference:s},n);m&&(m.geometry&&(t.geometry=m.geometry),m.attributes&&(t.attributes={...t.attributes,...m.attributes}))}function me(t=""){return!!t&&t.includes(Ki)}function Un(t){return t?`${Ki}${t.layerId}/${t.fieldName}`:""}function gi({attributes:t,graphic:e,relatedInfo:i,fieldInfos:s,fieldInfoMap:n,layer:r,timeZone:o}){t&&e&&i&&Object.keys(e.attributes).forEach(d=>{const c=Un({layerId:i.relation.id.toString(),fieldName:d}),u=e.attributes[d];t[c]=rs({fieldName:c,fieldInfos:s,fieldInfoMap:n,layer:r,value:u,graphic:e,timeZone:o})})}function Zn({attributes:t,relatedInfo:e,fieldInfoMap:i,fieldInfos:s,layer:n,timeZone:r}){var o,d;t&&e&&((o=e.relatedFeatures)==null||o.forEach(c=>gi({attributes:t,graphic:c,relatedInfo:e,fieldInfoMap:i,fieldInfos:s,layer:n,timeZone:r})),(d=e.relatedStatsFeatures)==null||d.forEach(c=>gi({attributes:t,graphic:c,relatedInfo:e,fieldInfoMap:i,fieldInfos:s,layer:n,timeZone:r})))}const _i=t=>{if(!t)return!1;const e=t.toUpperCase();return e.includes("CURRENT_TIMESTAMP")||e.includes("CURRENT_DATE")||e.includes("CURRENT_TIME")},as=({layer:t,method:e,query:i,definitionExpression:s})=>{var o,d;if(!((d=(o=t.capabilities)==null?void 0:o.query)!=null&&d.supportsCacheHint)||e==="attachments")return;const n=i.where!=null?i.where:null,r=i.geometry!=null?i.geometry:null;_i(s)||_i(n)||(r==null?void 0:r.type)==="extent"||i.resultType==="tile"||(i.cacheHint=!0)},Qn=({query:t,layer:e,method:i})=>{as({layer:e,method:i,query:t,definitionExpression:`${e.definitionExpression} ${e.serviceDefinitionExpression}`})},Gn=({queryPayload:t,layer:e,method:i})=>{as({layer:e,method:i,query:t,definitionExpression:`${e.definitionExpression} ${e.serviceDefinitionExpression}`})};function Xn(t,e,i){return t&&e&&i?yi(t.allLayers,e,i)||yi(t.allTables,e,i):null}function yi(t,e,{relatedTableId:i}){const s=e.type==="scene"&&e.associatedLayer?e.associatedLayer.url:e.url;return t.filter(ss).find(n=>n!==e&&n.url===s&&n.layerId===i)}const vi={editing:!1,operations:{add:!0,update:!0,delete:!0}},ls=Be.ofType(an);let Y=class extends fe{constructor(e){super(e),this._getAttachmentsPromise=null,this._attachmentLayer=null,this.capabilities={...vi},this.activeAttachmentInfo=null,this.activeFileInfo=null,this.attachmentInfos=new ls,this.fileInfos=new Be,this.graphic=null,this.mode="view",this.filesEnabled=!1,this.addHandles(_(()=>this.graphic,()=>this._graphicChanged(),P))}destroy(){this._attachmentLayer=null,this.graphic=null}castCapabilities(e){return{...vi,...e}}get state(){return this._getAttachmentsPromise?"loading":this.graphic?"ready":"disabled"}get supportsResizeAttachments(){const{graphic:e}=this;if(!e)return!1;const i=e.layer||e.sourceLayer;return(i==null?void 0:i.loaded)&&"capabilities"in i&&i.capabilities&&"operations"in i.capabilities&&"supportsResizeAttachments"in i.capabilities.operations&&i.capabilities.operations.supportsResizeAttachments||!1}async getAttachments(){const{_attachmentLayer:e,attachmentInfos:i}=this;if(!e||typeof e.queryAttachments!="function")throw new R("invalid-layer","getAttachments(): A valid layer is required.");const s=this._getObjectId(),n=new ui({objectIds:[s],returnMetadata:!0}),r=[],o=e.queryAttachments(n).then(c=>c[s]||r).catch(()=>r);this._getAttachmentsPromise=o,this.notifyChange("state");const d=await o;return i.removeAll(),d.length&&i.addMany(d),this._getAttachmentsPromise=null,this.notifyChange("state"),d}async addAttachment(e,i=this.graphic){var c;const{_attachmentLayer:s,attachmentInfos:n,capabilities:r}=this;if(!i)throw new R("invalid-graphic","addAttachment(): A valid graphic is required.",{graphic:i});if(!e)throw new R("invalid-attachment","addAttachment(): An attachment is required.",{attachment:e});if(!((c=r.operations)!=null&&c.add))throw new R("invalid-capabilities","addAttachment(): add capabilities are required.");if(!s||typeof s.addAttachment!="function")throw new R("invalid-layer","addAttachment(): A valid layer is required.");const o=s.addAttachment(i,e).then(u=>this._queryAttachment(u.objectId,i)),d=await o;return n.add(d),d}async deleteAttachment(e){var c;const{_attachmentLayer:i,attachmentInfos:s,graphic:n,capabilities:r}=this;if(!e)throw new R("invalid-attachment-info","deleteAttachment(): An attachmentInfo is required.",{attachmentInfo:e});if(!((c=r.operations)!=null&&c.delete))throw new R("invalid-capabilities","deleteAttachment(): delete capabilities are required.");if(!i||typeof i.deleteAttachments!="function")throw new R("invalid-layer","deleteAttachment(): A valid layer is required.");if(!n)throw new R("invalid-graphic","deleteAttachment(): A graphic is required.");const o=i.deleteAttachments(n,[e.id]).then(()=>e),d=await o;return s.remove(d),d}async updateAttachment(e,i=this.activeAttachmentInfo){var p;const{_attachmentLayer:s,attachmentInfos:n,graphic:r,capabilities:o}=this;if(!e)throw new R("invalid-attachment","updateAttachment(): An attachment is required.",{attachment:e});if(!i)throw new R("invalid-attachment-info","updateAttachment(): An attachmentInfo is required.",{attachmentInfo:i});if(!((p=o.operations)!=null&&p.update))throw new R("invalid-capabilities","updateAttachment(): Update capabilities are required.");const d=n.indexOf(i);if(!s||typeof s.updateAttachment!="function")throw new R("invalid-layer","updateAttachment(): A valid layer is required.");if(!r)throw new R("invalid-graphic","updateAttachment(): A graphic is required.");const c=s.updateAttachment(r,i.id,e).then(m=>this._queryAttachment(m.objectId)),u=await c;return n.splice(d,1,u),u}async commitFiles(){return await Promise.all(this.fileInfos.items.map(e=>this.addAttachment(e.form))),this.fileInfos.removeAll(),this.getAttachments()}addFile(e,i){if(!e||!i)return null;const s={file:e,form:i};return this.fileInfos.add(s),s}updateFile(e,i,s=this.activeFileInfo){if(!e||!i||!s)return null;const n=this.fileInfos.indexOf(s);return n>-1&&this.fileInfos.splice(n,1,{file:e,form:i}),this.fileInfos.items[n]}deleteFile(e){const i=this.fileInfos.find(s=>s.file===e);return i?(this.fileInfos.remove(i),i):null}async _queryAttachment(e,i){const{_attachmentLayer:s}=this;if(!e||!(s!=null&&s.queryAttachments))throw new R("invalid-attachment-id","Could not query attachment.");const n=this._getObjectId(i),r=new ui({objectIds:[n],attachmentsWhere:`AttachmentId=${e}`,returnMetadata:!0});return s.queryAttachments(r).then(o=>o[n][0])}_getObjectId(e=this.graphic){return(e==null?void 0:e.getObjectId())??null}_graphicChanged(){this.graphic&&(this._setAttachmentLayer(),this.getAttachments().catch(()=>{}))}_setAttachmentLayer(){const{graphic:e}=this,i=Ji(e);this._attachmentLayer=i?i.type==="scene"&&i.associatedLayer!=null?i.associatedLayer:i:null}};a([l()],Y.prototype,"capabilities",void 0),a([qe("capabilities")],Y.prototype,"castCapabilities",null),a([l()],Y.prototype,"activeAttachmentInfo",void 0),a([l()],Y.prototype,"activeFileInfo",void 0),a([l({readOnly:!0,type:ls})],Y.prototype,"attachmentInfos",void 0),a([l()],Y.prototype,"fileInfos",void 0),a([l({type:ze})],Y.prototype,"graphic",void 0),a([l()],Y.prototype,"mode",void 0),a([l({readOnly:!0})],Y.prototype,"state",null),a([l()],Y.prototype,"filesEnabled",void 0),a([l({readOnly:!0})],Y.prototype,"supportsResizeAttachments",null),Y=a([N("esri.widgets.Attachments.AttachmentsViewModel")],Y);const Xt=Y;function wi(t){const e=t.toLowerCase();return e==="image/bmp"||e==="image/emf"||e==="image/exif"||e==="image/gif"||e==="image/x-icon"||e==="image/jpeg"||e==="image/png"||e==="image/tiff"||e==="image/x-wmf"}function Yn(t){const e=Ts("esri/themes/base/images/files/");return t?t==="text/plain"?`${e}text-32.svg`:t==="application/pdf"?`${e}pdf-32.svg`:t==="text/csv"?`${e}csv-32.svg`:t==="application/gpx+xml"?`${e}gpx-32.svg`:t==="application/x-dwf"?`${e}cad-32.svg`:t==="application/postscript"||t==="application/json"||t==="text/xml"||t==="model/vrml"?`${e}code-32.svg`:t==="application/x-zip-compressed"||t==="application/x-7z-compressed"||t==="application/x-gzip"||t==="application/x-tar"||t==="application/x-gtar"||t==="application/x-bzip2"||t==="application/gzip"||t==="application/x-compress"||t==="application/x-apple-diskimage"||t==="application/x-rar-compressed"||t==="application/zip"?`${e}zip-32.svg`:t.includes("image/")?`${e}image-32.svg`:t.includes("audio/")?`${e}sound-32.svg`:t.includes("video/")?`${e}video-32.svg`:t.includes("msexcel")||t.includes("ms-excel")||t.includes("spreadsheetml")?`${e}excel-32.svg`:t.includes("msword")||t.includes("ms-word")||t.includes("wordprocessingml")?`${e}word-32.svg`:t.includes("powerpoint")||t.includes("presentationml")?`${e}report-32.svg`:`${e}generic-32.svg`:`${e}generic-32.svg`}const bi={addButton:!0,addSubmitButton:!0,cancelAddButton:!0,cancelUpdateButton:!0,deleteButton:!0,errorMessage:!0,progressBar:!0,updateButton:!0},x="esri-attachments",b={base:x,loaderContainer:`${x}__loader-container`,loader:`${x}__loader`,fadeIn:`${x}--fade-in`,container:`${x}__container`,containerList:`${x}__container--list`,containerPreview:`${x}__container--preview`,actions:`${x}__actions`,deleteButton:`${x}__delete-button`,addAttachmentButton:`${x}__add-attachment-button`,errorMessage:`${x}__error-message`,items:`${x}__items`,item:`${x}__item`,itemButton:`${x}__item-button`,itemMask:`${x}__item-mask`,itemMaskIcon:`${x}__item-mask--icon`,itemImage:`${x}__image`,itemImageResizable:`${x}__image--resizable`,itemLabel:`${x}__label`,itemFilename:`${x}__filename`,itemChevronIcon:`${x}__item-chevron-icon`,itemLink:`${x}__item-link`,itemLinkOverlay:`${x}__item-link-overlay`,itemLinkOverlayIcon:`${x}__item-link-overlay-icon`,itemEditIcon:`${x}__item-edit-icon`,itemAddIcon:`${x}__item-add-icon`,itemAddButton:`${x}__item-add-button`,formNode:`${x}__form-node`,fileFieldset:`${x}__file-fieldset`,fileLabel:`${x}__file-label`,fileName:`${x}__file-name`,fileInput:`${x}__file-input`,metadata:`${x}__metadata`,metadataFieldset:`${x}__metadata-fieldset`,progressBar:`${x}__progress-bar`},It=window.CSS;let Z=class extends ie{constructor(e,i){super(e,i),this.displayType="auto",this.messages=null,this.messagesUnits=null,this.selectedFile=null,this.submitting=!1,this.viewModel=null,this.visibleElements={...bi},this._supportsImageOrientation=It&&It.supports&&It.supports("image-orientation","from-image"),this._addAttachmentForm=null,this._updateAttachmentForm=null}normalizeCtorArgs(e){return e!=null&&e.viewModel||(e={viewModel:new Xt,...e}),e}initialize(){this.addHandles([Te(()=>{var e;return(e=this.viewModel)==null?void 0:e.attachmentInfos},"change",()=>this.scheduleRender()),Te(()=>{var e;return(e=this.viewModel)==null?void 0:e.fileInfos},"change",()=>this.scheduleRender()),_(()=>{var e;return(e=this.viewModel)==null?void 0:e.mode},()=>this._modeChanged(),P)])}loadDependencies(){return We({icon:()=>E(()=>import("./calcite-icon-BCYnyK8T.js"),__vite__mapDeps([0,1,2,3,4,5,6]))})}get capabilities(){return this.viewModel.capabilities}set capabilities(e){this.viewModel.capabilities=e}get effectiveDisplayType(){const{displayType:e}=this;return e&&e!=="auto"?e:this.viewModel.supportsResizeAttachments?"preview":"list"}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get label(){var e;return((e=this.messages)==null?void 0:e.widgetLabel)??""}set label(e){this._overrideIfSome("label",e)}castVisibleElements(e){return{...bi,...e}}addAttachment(){const{_addAttachmentForm:e,viewModel:i}=this;return this._set("submitting",!0),this._set("error",null),i.addAttachment(e).then(s=>(this._set("submitting",!1),this._set("error",null),i.mode="view",s)).catch(s=>{throw this._set("submitting",!1),this._set("error",new R("attachments:add-attachment",this.messages.addErrorMessage,s)),s})}deleteAttachment(e){const{viewModel:i}=this;return this._set("submitting",!0),this._set("error",null),i.deleteAttachment(e).then(s=>(this._set("submitting",!1),this._set("error",null),i.mode="view",s)).catch(s=>{throw this._set("submitting",!1),this._set("error",new R("attachments:delete-attachment",this.messages.deleteErrorMessage,s)),s})}updateAttachment(){const{viewModel:e}=this,{_updateAttachmentForm:i}=this;return this._set("submitting",!0),this._set("error",null),e.updateAttachment(i).then(s=>(this._set("submitting",!1),this._set("error",null),e.mode="view",s)).catch(s=>{throw this._set("submitting",!1),this._set("error",new R("attachments:update-attachment",this.messages.updateErrorMessage,s)),s})}addFile(){const e=this.viewModel.addFile(this.selectedFile,this._addAttachmentForm);return this.viewModel.mode="view",e}updateFile(){const{viewModel:e}=this,i=e.updateFile(this.selectedFile,this._updateAttachmentForm,e.activeFileInfo);return e.mode="view",i}deleteFile(e){var s;const i=this.viewModel.deleteFile(e||((s=this.viewModel.activeFileInfo)==null?void 0:s.file));return this.viewModel.mode="view",i}render(){const{submitting:e,viewModel:i}=this,{state:s}=i;return h("div",{class:this.classes(b.base,I.widget)},e?this._renderProgressBar():null,s==="loading"?this._renderLoading():this._renderAttachments(),this._renderErrorMessage())}_renderErrorMessage(){const{error:e,visibleElements:i}=this;return e&&i.errorMessage?h("div",{class:b.errorMessage,key:"error-message"},e.message):null}_renderAttachments(){const{activeFileInfo:e,mode:i,activeAttachmentInfo:s}=this.viewModel;return i==="add"?this._renderAddForm():i==="edit"?this._renderDetailsForm(s||e):this._renderAttachmentContainer()}_renderLoading(){return h("div",{class:b.loaderContainer,key:"loader"},h("div",{class:b.loader}))}_renderProgressBar(){return this.visibleElements.progressBar?h("div",{class:b.progressBar,key:"progress-bar"}):null}_renderAddForm(){const{submitting:e,selectedFile:i}=this,s=e||!i,n=this.visibleElements.cancelAddButton?h("button",{bind:this,class:this.classes(I.button,I.buttonTertiary,I.buttonSmall,I.buttonHalf,e&&I.buttonDisabled),disabled:e,onclick:this._cancelForm,type:"button"},this.messages.cancel):null,r=this.visibleElements.addSubmitButton?h("button",{class:this.classes(I.button,I.buttonSecondary,I.buttonSmall,I.buttonHalf,{[I.buttonDisabled]:s}),disabled:s,type:"submit"},this.messages.add):null,o=i?h("span",{class:b.fileName,key:"file-name"},i.name):null,d=h("form",{afterCreate:ai,afterRemoved:li,bind:this,"data-node-ref":"_addAttachmentForm",onsubmit:this._submitAddAttachment},h("fieldset",{class:b.fileFieldset},o,h("label",{class:this.classes(b.fileLabel,I.button,I.buttonSecondary)},i?this.messages.changeFile:this.messages.selectFile,h("input",{bind:this,class:b.fileInput,name:"attachment",onchange:this._handleFileInputChange,type:"file"}))),r,n);return h("div",{class:b.formNode,key:"add-form-container"},d)}_renderDetailsForm(e){var M,oe,J;const{visibleElements:i,viewModel:s,selectedFile:n,submitting:r}=this,{capabilities:o}=s,d=r||!n;let c,u,p,m;n?(c=n.type,u=n.name,p=n.size):e&&"file"in e?(c=e.file.type,u=e.file.name,p=e.file.size):e&&"contentType"in e&&(c=e.contentType,u=e.name,p=e.size,m=e.url);const f=o.editing&&((M=o.operations)!=null&&M.delete)&&i.deleteButton?h("button",{bind:this,class:this.classes(I.button,I.buttonSmall,I.buttonTertiary,b.deleteButton,{[I.buttonDisabled]:r}),disabled:r,key:"delete-button",onclick:se=>this._submitDeleteAttachment(se,e),type:"button"},this.messages.delete):void 0,g=o.editing&&((oe=o.operations)!=null&&oe.update)&&i.updateButton?h("button",{class:this.classes(I.button,I.buttonSmall,I.buttonThird,{[I.buttonDisabled]:d}),disabled:d,key:"update-button",type:"submit"},this.messages.update):void 0,y=this.visibleElements.cancelUpdateButton?h("button",{bind:this,class:this.classes(I.button,I.buttonSmall,I.buttonTertiary,I.buttonThird,{[I.buttonDisabled]:r}),disabled:r,key:"cancel-button",onclick:this._cancelForm,type:"button"},this.messages.cancel):void 0,v=o.editing&&((J=o.operations)!=null&&J.update)?h("fieldset",{class:b.fileFieldset,key:"file"},h("span",{class:b.fileName,key:"file-name"},u),h("label",{class:this.classes(b.fileLabel,I.button,I.buttonSecondary)},this.messages.changeFile,h("input",{bind:this,class:b.fileInput,name:"attachment",onchange:this._handleFileInputChange,type:"file"}))):void 0,F=h("fieldset",{class:b.metadataFieldset,key:"size"},h("label",null,yn(this.messagesUnits,p??0))),w=h("fieldset",{class:b.metadataFieldset,key:"content-type"},h("label",null,c)),C=m!=null?h("a",{class:b.itemLink,href:m,rel:"noreferrer",target:"_blank"},this._renderImageMask(e,400),h("div",{class:b.itemLinkOverlay},h("span",{class:b.itemLinkOverlayIcon},h("calcite-icon",{icon:"launch"})))):this._renderImageMask(e,400),k=h("form",{afterCreate:ai,afterRemoved:li,bind:this,"data-node-ref":"_updateAttachmentForm",onsubmit:se=>this._submitUpdateAttachment(se,e)},h("div",{class:b.metadata},F,w),v,h("div",{class:b.actions},f,y,g));return h("div",{class:b.formNode,key:"edit-form-container"},C,k)}_renderImageMask(e,i){return e?"file"in e?this._renderGenericImageMask(e.file.name,e.file.type):this._renderImageMaskForAttachment(e,i):null}_renderGenericImageMask(e,i){const{supportsResizeAttachments:s}=this.viewModel,n=Yn(i),r={[b.itemImageResizable]:s};return h("div",{class:this.classes(b.itemMaskIcon,b.itemMask),key:n},h("img",{alt:e,class:this.classes(r,b.itemImage),src:n,title:e}))}_renderImageMaskForAttachment(e,i){const{supportsResizeAttachments:s}=this.viewModel;if(!e)return null;const{contentType:n,name:r,url:o}=e;if(!s||!wi(n))return this._renderGenericImageMask(r,n);const d=this._getCSSTransform(e),c=d?{transform:d,"image-orientation":"none"}:{},u=`${o}${o!=null&&o.includes("?")?"&":"?"}w=${i}`,p={[b.itemImageResizable]:s};return h("div",{class:this.classes(b.itemMask),key:u},h("img",{alt:r,class:this.classes(p,b.itemImage),src:u,styles:c,title:r}))}_renderFile(e){const{file:i}=e;return h("li",{class:b.item,key:i},h("button",{"aria-label":this.messages.attachmentDetails,bind:this,class:b.itemButton,key:"details-button",onclick:()=>this._startEditFile(e),title:this.messages.attachmentDetails,type:"button"},this._renderImageMask(e),h("label",{class:b.itemLabel},h("span",{class:b.itemFilename},i.name||this.messages.noTitle),h("span",{"aria-hidden":"true",class:this.classes(b.itemChevronIcon,ke(this.container)?re.left:re.right)}))))}_renderAttachmentInfo({attachmentInfo:e,displayType:i}){const{viewModel:s,effectiveDisplayType:n}=this,{capabilities:r,supportsResizeAttachments:o}=s,{contentType:d,name:c,url:u}=e,p=this._renderImageMask(e,i==="list"?48:400),m=r.editing?h("span",{"aria-hidden":"true",class:this.classes(b.itemChevronIcon,ke(this.container)?re.left:re.right)}):null,f=[p,n==="preview"&&o&&wi(d)?null:h("label",{class:b.itemLabel},h("span",{class:b.itemFilename},c||this.messages.noTitle),m)],g=r.editing?h("button",{"aria-label":this.messages.attachmentDetails,bind:this,class:b.itemButton,"data-attachment-info-id":e.id,key:"details-button",onclick:()=>this._startEditAttachment(e),title:this.messages.attachmentDetails,type:"button"},f):h("a",{class:b.itemButton,href:u??void 0,key:"details-link",target:"_blank"},f);return h("li",{class:b.item,key:e},g)}_renderAttachmentContainer(){var y;const{effectiveDisplayType:e,viewModel:i,visibleElements:s}=this,{attachmentInfos:n,capabilities:r,fileInfos:o}=i,d=!!(n!=null&&n.length),c=!!(o!=null&&o.length),u={[b.containerList]:e!=="preview",[b.containerPreview]:e==="preview"},p=r.editing&&((y=r.operations)!=null&&y.add)&&s.addButton?h("button",{bind:this,class:this.classes(I.button,I.buttonTertiary,b.addAttachmentButton),onclick:()=>this._startAddAttachment(),type:"button"},h("span",{"aria-hidden":"true",class:this.classes(b.itemAddIcon,re.plus)}),this.messages.add):void 0,m=d?h("ul",{class:b.items,key:"attachments-list"},n.toArray().map(v=>this._renderAttachmentInfo({attachmentInfo:v,displayType:e}))):void 0,f=c?h("ul",{class:b.items,key:"file-list"},o.toArray().map(v=>this._renderFile(v))):void 0,g=c||d?void 0:h("div",{class:I.empty},this.messages.noAttachments);return h("div",{class:this.classes(b.container,u),key:"attachments-container"},m,f,g,p)}_modeChanged(){this._set("error",null),this._set("selectedFile",null)}_handleFileInputChange(e){var n;const i=e.target,s=(n=i.files)==null?void 0:n.item(0);this._set("selectedFile",s)}_submitDeleteAttachment(e,i){e.preventDefault(),i&&("file"in i?this.deleteFile(i.file):i&&this.deleteAttachment(i))}_submitAddAttachment(e){e.preventDefault(),this.viewModel.filesEnabled?this.addFile():this.addAttachment()}_submitUpdateAttachment(e,i){e.preventDefault(),i&&"file"in i?this.updateFile():this.updateAttachment()}_startEditAttachment(e){const{viewModel:i}=this;i.activeFileInfo=null,i.activeAttachmentInfo=e,i.mode="edit"}_startEditFile(e){const{viewModel:i}=this;i.activeAttachmentInfo=null,i.activeFileInfo=e,i.mode="edit"}_startAddAttachment(){this.viewModel.mode="add"}_cancelForm(e){e.preventDefault(),this.viewModel.mode="view"}_getCSSTransform(e){const{orientationInfo:i}=e;return!this._supportsImageOrientation&&i?[i.rotation?`rotate(${i.rotation}deg)`:"",i.mirrored?"scaleX(-1)":""].join(" "):""}};a([l()],Z.prototype,"capabilities",null),a([l()],Z.prototype,"displayType",void 0),a([l({readOnly:!0})],Z.prototype,"effectiveDisplayType",null),a([l()],Z.prototype,"graphic",null),a([l()],Z.prototype,"label",null),a([l(),te("esri/widgets/Attachments/t9n/Attachments")],Z.prototype,"messages",void 0),a([l(),te("esri/core/t9n/Units")],Z.prototype,"messagesUnits",void 0),a([l({readOnly:!0})],Z.prototype,"selectedFile",void 0),a([l({readOnly:!0})],Z.prototype,"submitting",void 0),a([l({readOnly:!0})],Z.prototype,"error",void 0),a([l({type:Xt})],Z.prototype,"viewModel",void 0),a([l()],Z.prototype,"visibleElements",void 0),a([qe("visibleElements")],Z.prototype,"castVisibleElements",null),Z=a([N("esri.widgets.Attachments")],Z);const Kn=Z;let Ue=class extends Xt{constructor(e){super(e),this.description=null,this.title=null}};a([l()],Ue.prototype,"description",void 0),a([l()],Ue.prototype,"title",void 0),Ue=a([N("esri.widgets.Feature.FeatureAttachments.FeatureAttachmentsViewModel")],Ue);const Yt=Ue;function Kt({level:t,class:e,...i},s){const n=Jn(t);return h(`h${n}`,{...i,"aria-level":String(n),class:ks(I.heading,e),role:"heading"},s)}function Jn(t){return zi(Math.ceil(t),1,6)}const Ft="esri-feature-element-info",At={base:Ft,title:`${Ft}__title`,description:`${Ft}__description`};let Ne=class extends ie{constructor(e,i){super(e,i),this.description=null,this.headingLevel=2,this.title=null}render(){return h("div",{class:At.base},this._renderTitle(),this._renderDescription())}_renderTitle(){const{title:e}=this;return e?h(Kt,{class:At.title,level:this.headingLevel},e):null}_renderDescription(){const{description:e}=this;return e?h("div",{class:At.description,key:"description"},e):null}};a([l()],Ne.prototype,"description",void 0),a([l()],Ne.prototype,"headingLevel",void 0),a([l()],Ne.prototype,"title",void 0),Ne=a([N("esri.widgets.Feature.support.FeatureElementInfo")],Ne);const pt=Ne,er={base:"esri-feature-attachments"};let le=class extends ie{constructor(e,i){super(e,i),this._featureElementInfo=null,this.attachmentsWidget=new Kn,this.headingLevel=2,this.viewModel=new Yt}initialize(){this._featureElementInfo=new pt,this.addHandles([_(()=>{var e,i;return[(e=this.viewModel)==null?void 0:e.description,(i=this.viewModel)==null?void 0:i.title,this.headingLevel]},()=>this._setupFeatureElementInfo(),P),_(()=>this.viewModel,e=>this.attachmentsWidget.viewModel=e,P)])}destroy(){var e;this.attachmentsWidget.viewModel=null,this.attachmentsWidget.destroy(),(e=this._featureElementInfo)==null||e.destroy()}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get displayType(){return this.attachmentsWidget.displayType}set displayType(e){this.attachmentsWidget.displayType=e}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){var i;const{attachmentsWidget:e}=this;return h("div",{class:er.base},(i=this._featureElementInfo)==null?void 0:i.render(),e==null?void 0:e.render())}_setupFeatureElementInfo(){var n;const{description:e,title:i,headingLevel:s}=this;(n=this._featureElementInfo)==null||n.set({description:e,title:i,headingLevel:s})}};a([l({readOnly:!0})],le.prototype,"attachmentsWidget",void 0),a([l()],le.prototype,"description",null),a([l()],le.prototype,"displayType",null),a([l()],le.prototype,"graphic",null),a([l()],le.prototype,"headingLevel",void 0),a([l()],le.prototype,"title",null),a([l({type:Yt})],le.prototype,"viewModel",void 0),le=a([N("esri.widgets.Feature.FeatureAttachments")],le);const tr=le;let _e=class extends fe{constructor(e){super(e),this._loadingPromise=null,this.created=null,this.creator=null,this.destroyer=null,this.graphic=null,this.addHandles(_(()=>this.creator,i=>{this._destroyContent(),this._createContent(i)},P))}destroy(){this._destroyContent()}get state(){return this._loadingPromise?"loading":"ready"}_destroyContent(){const{created:e,graphic:i,destroyer:s}=this;e&&i&&(dt(s,{graphic:i}).catch(()=>null),this._set("created",null))}async _createContent(e){const i=this.graphic;if(!i||!e)return;const s=dt(e,{graphic:i}).catch(()=>null);this._loadingPromise=s,this.notifyChange("state");const n=await s;s===this._loadingPromise&&(this._loadingPromise=null,this.notifyChange("state"),this._set("created",n))}};a([l({readOnly:!0})],_e.prototype,"created",void 0),a([l()],_e.prototype,"creator",void 0),a([l()],_e.prototype,"destroyer",void 0),a([l({type:ze})],_e.prototype,"graphic",void 0),a([l({readOnly:!0})],_e.prototype,"state",null),_e=a([N("esri.widgets.Feature.FeatureContent.FeatureContentViewModel")],_e);const ct=_e;function ds(t){return e=>{e.hasOwnProperty("_delegatedEventNames")||(e._delegatedEventNames=e._delegatedEventNames?e._delegatedEventNames.slice():[]);const i=e._delegatedEventNames,s=Array.isArray(t)?t:ir(t);i.push(...s)}}function ir(t){return t.split(",").map(e=>e.trim())}function cs(t){return t&&typeof t.render=="function"}function sr(t){return t&&typeof t.postMixInProperties=="function"&&typeof t.buildRendering=="function"&&typeof t.postCreate=="function"&&typeof t.startup=="function"}const Ct="esri-feature-content",Et={base:Ct,loaderContainer:`${Ct}__loader-container`,loader:`${Ct}__loader`};let Ve=class extends ie{constructor(e,i){super(e,i),this.viewModel=null,this._addTargetToAnchors=s=>{Array.from(s.querySelectorAll("a")).forEach(n=>{es(n.href)&&!n.hasAttribute("target")&&n.setAttribute("target","_blank")})}}get creator(){var e;return(e=this.viewModel)==null?void 0:e.creator}set creator(e){this.viewModel&&(this.viewModel.creator=e)}get graphic(){var e;return(e=this.viewModel)==null?void 0:e.graphic}set graphic(e){this.viewModel&&(this.viewModel.graphic=e)}render(){var i;const e=(i=this.viewModel)==null?void 0:i.state;return h("div",{class:Et.base},e==="loading"?this._renderLoading():this._renderCreated())}_renderLoading(){return h("div",{class:Et.loaderContainer,key:"loader"},h("div",{class:Et.loader}))}_renderCreated(){var i;const e=(i=this.viewModel)==null?void 0:i.created;return e?e instanceof HTMLElement?h("div",{afterCreate:this._attachToNode,bind:e,key:e}):cs(e)?h("div",{key:e},!e.destroyed&&e.render()):h("div",{afterCreate:this._addTargetToAnchors,innerHTML:e,key:e}):null}_attachToNode(e){const i=this;e.appendChild(i)}};a([l()],Ve.prototype,"creator",null),a([l()],Ve.prototype,"graphic",null),a([l({type:ct})],Ve.prototype,"viewModel",void 0),Ve=a([N("esri.widgets.Feature.FeatureContent")],Ve);const it=Ve;let he=class extends fe{constructor(e){super(e),this.attributes=null,this.expressionInfos=null,this.description=null,this.fieldInfos=null,this.title=null}get formattedFieldInfos(){const{expressionInfos:e,fieldInfos:i}=this,s=[];return i==null||i.forEach(n=>{if(!(!n.hasOwnProperty("visible")||n.visible))return;const r=n.clone();r.label=ts(r,e),s.push(r)}),s}};a([l()],he.prototype,"attributes",void 0),a([l({type:[Ls]})],he.prototype,"expressionInfos",void 0),a([l()],he.prototype,"description",void 0),a([l({type:[Hi]})],he.prototype,"fieldInfos",void 0),a([l({readOnly:!0})],he.prototype,"formattedFieldInfos",null),a([l()],he.prototype,"title",void 0),he=a([N("esri.widgets.Feature.FeatureFields.FeatureFieldsViewModel")],he);const mt=he,nr=[{pattern:/^\s*(https?:\/\/([^\s]+))\s*$/i,target:"_blank",label:"{messages.view}"},{pattern:/^\s*(tel:([^\s]+))\s*$/i,label:"{hierPart}"},{pattern:/^\s*(mailto:([^\s]+))\s*$/i,label:"{hierPart}"},{pattern:/^\s*(arcgis-appstudio-player:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"App Studio Player"},{pattern:/^\s*(arcgis-collector:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Collector"},{pattern:/^\s*(arcgis-explorer:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Explorer"},{pattern:/^\s*(arcgis-navigator:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Navigator"},{pattern:/^\s*(arcgis-survey123:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Survey123"},{pattern:/^\s*(arcgis-trek2there:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Trek2There"},{pattern:/^\s*(arcgis-workforce:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Workforce"},{pattern:/^\s*(iform:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"iForm"},{pattern:/^\s*(flow:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"FlowFinity"},{pattern:/^\s*(lfmobile:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Laserfische"},{pattern:/^\s*(mspbi:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Microsoft Power Bi"}];function rr(t,e){if(typeof e!="string"||!e)return e;const i=nr.find(c=>c.pattern.test(e));if(!i)return e;const s=e.match(i.pattern),n=s&&s[2],r=De(De(i.label,{messages:t,hierPart:n}),{appName:i.appName}),o=i.target?` target="${i.target}"`:"",d=i.target==="_blank"?' rel="noreferrer"':"";return e.replace(i.pattern,`${r}`)}const Ke="esri-feature-fields",Je={base:Ke,fieldHeader:`${Ke}__field-header`,fieldData:`${Ke}__field-data`,fieldDataDate:`${Ke}__field-data--date`};let ae=class extends ie{constructor(e,i){super(e,i),this._featureElementInfo=null,this.viewModel=new mt,this.messages=null,this.messagesURIUtils=null}initialize(){this._featureElementInfo=new pt,this.addHandles(_(()=>{var e,i;return[(e=this.viewModel)==null?void 0:e.description,(i=this.viewModel)==null?void 0:i.title]},()=>this._setupFeatureElementInfo(),P))}destroy(){var e;(e=this._featureElementInfo)==null||e.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get expressionInfos(){return this.viewModel.expressionInfos}set expressionInfos(e){this.viewModel.expressionInfos=e}get fieldInfos(){return this.viewModel.fieldInfos}set fieldInfos(e){this.viewModel.fieldInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){var e;return h("div",{class:Je.base},(e=this._featureElementInfo)==null?void 0:e.render(),this._renderFields())}_renderFieldInfo(e,i){const{attributes:s}=this.viewModel,n=e.fieldName,r=e.label||n,o=s?s[n]==null?"":s[n]:"",d=!(!e.format||!e.format.dateFormat),c=typeof o=="number"&&!d?this._forceLTR(o):rr(this.messagesURIUtils,o),u={[Je.fieldDataDate]:d};return h("tr",{key:`fields-element-info-row-${n}-${i}`},h("th",{class:Je.fieldHeader,innerHTML:r,key:`fields-element-info-row-header-${n}-${i}`}),h("td",{class:this.classes(Je.fieldData,u),innerHTML:c,key:`fields-element-info-row-data-${n}-${i}`}))}_renderFields(){const{formattedFieldInfos:e}=this.viewModel;return e!=null&&e.length?h("table",{class:I.table,summary:this.messages.fieldsSummary},h("tbody",null,e.map((i,s)=>this._renderFieldInfo(i,s)))):null}_setupFeatureElementInfo(){var s;const{description:e,title:i}=this;(s=this._featureElementInfo)==null||s.set({description:e,title:i})}_forceLTR(e){return`‎${e}`}};a([l()],ae.prototype,"attributes",null),a([l()],ae.prototype,"description",null),a([l()],ae.prototype,"expressionInfos",null),a([l()],ae.prototype,"fieldInfos",null),a([l()],ae.prototype,"title",null),a([l({type:mt,nonNullable:!0})],ae.prototype,"viewModel",void 0),a([l(),te("esri/widgets/Feature/t9n/Feature")],ae.prototype,"messages",void 0),a([l(),te("esri/widgets/support/t9n/uriUtils")],ae.prototype,"messagesURIUtils",void 0),ae=a([N("esri.widgets.Feature.FeatureFields")],ae);const us=ae,or=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,ar={maximumFractionDigits:20};function lr(t){return xe(t,ar)}const dr="<",cr=">";function ur(t,e,i,s){let n="";return e===0?n=`${dr} `:e===i&&(n=`${cr} `),n+(s?jt(t,s):lr(t))}const hr=new ji([64,64,64]);function pr(t,e){const i=[],s=t.length-1;return t.length===5?i.push(0,2,4):i.push(0,s),t.map((n,r)=>i.includes(r)?ur(n,r,s,e):null)}async function mr(t,e,i){let s=!1,n=[],r=[];if(t.stops){const u=t.stops;n=u.map(p=>p.value),s=u.some(p=>!!p.label),s&&(r=u.map(p=>p.label))}const o=n[0],d=n[n.length-1];if(o==null&&d==null)return null;const c=s?null:pr(n,i);return(await Promise.all(n.map(async(u,p)=>({value:u,color:t.type==="opacity"?await fr(u,t,e):(await E(()=>import("./visualVariableUtils-BX9G5gNQ.js"),__vite__mapDeps([7,2,3,8]))).getColor(t,u),label:s?r[p]:(c==null?void 0:c[p])??""})))).reverse()}async function fr(t,e,i){const s=new ji(i??hr),n=(await E(()=>import("./visualVariableUtils-BX9G5gNQ.js"),__vite__mapDeps([7,2,3,8]))).getOpacity(e,t);return n!=null&&(s.a=n),s}function gr(t){if(!t.colorStops)return[];const e=[...t.colorStops].filter(s=>{var n;return((n=s.color)==null?void 0:n.a)>0});let i=e.length-1;if(e&&e[0]){const s=e[i];s&&s.ratio!==1&&(e.push(new hn({ratio:1,color:s.color})),i++)}return e.map((s,n)=>{var o,d;let r="";return n===0?r=((o=t.legendOptions)==null?void 0:o.minLabel)||"low":n===i&&(r=((d=t.legendOptions)==null?void 0:d.maxLabel)||"high"),{color:s.color,label:r,ratio:s.ratio}}).reverse()}async function ee(t,e,i){Rs(t,e,()=>[]).push(...i)}async function _r(t){var i,s;const e=new Map;if(!t)return e;if("visualVariables"in t&&t.visualVariables){const n=t.visualVariables.filter(r=>r.type==="color");for(const r of n){const o=(await mr(r)??[]).map(d=>d.color);await ee(e,r.field||r.valueExpression,o)}}if(t.type==="heatmap"){const n=gr(t).map(r=>r.color);await ee(e,t.field||t.valueExpression,n)}else if(t.type==="pie-chart"){for(const n of t.attributes)await ee(e,n.field||n.valueExpression,[n.color]);await ee(e,"default",[(i=t==null?void 0:t.othersCategory)==null?void 0:i.color,Oe(t.backgroundFillSymbol,null)])}else if(t.type==="dot-density"){for(const n of t.attributes)await ee(e,n.field||n.valueExpression,[n.color]);await ee(e,"default",[t.backgroundColor])}else if(t.type==="unique-value")if(((s=t.authoringInfo)==null?void 0:s.type)==="predominance")for(const n of t.uniqueValueInfos??[])await ee(e,n.value.toString(),[Oe(n.symbol,null)]);else{const n=(t.uniqueValueInfos??[]).map(u=>Oe(u.symbol,null)),{field:r,field2:o,field3:d,valueExpression:c}=t;(r||c)&&await ee(e,r||c,n),o&&await ee(e,o,n),d&&await ee(e,d,n)}else if(t.type==="class-breaks"){const n=t.classBreakInfos.map(d=>Oe(d.symbol,null)),{field:r,valueExpression:o}=t;await ee(e,r??o,n)}else t.type==="simple"&&await ee(e,"default",[Oe(t.symbol,null)]);return"defaultSymbol"in t&&t.defaultSymbol&&await ee(e,"default",[Oe(t.defaultSymbol,null)]),e.forEach((n,r)=>{const o=Wt(n.filter(Boolean),(d,c)=>JSON.stringify(d)===JSON.stringify(c));e.set(r,o)}),e}const yr="esri.widgets.Feature.support.relatedFeatureUtils",Mi=()=>z.getLogger(yr),Ii=new Map;function st(t){if(!me(t))return null;const[e,i]=t.split("/").slice(1);return{layerId:e,fieldName:i}}function vr(t,e){if(!e.relationships)return null;let i=null;const{relationships:s}=e;return s.some(n=>n.id===parseInt(t,10)&&(i=n,!0)),i}function wr({originRelationship:t,relationships:e,layerId:i}){return e.find(({relatedTableId:s,id:n})=>`${s}`===i&&n===(t==null?void 0:t.id))??null}function br(t,e){const i=e.toLowerCase();for(const s in t)if(s.toLowerCase()===i)return t[s];return null}function Mr(t,e){const i=vr(t,e);if(i)return{url:`${e.url}/${i.relatedTableId}`,sourceSpatialReference:e.spatialReference,relation:i,relatedFields:[],outStatistics:[]}}function Ir(t,e){if(!e||!t)return;const{features:i,statsFeatures:s}=t,n=i==null?void 0:i.value;e.relatedFeatures=n?n.features:[];const r=s==null?void 0:s.value;e.relatedStatsFeatures=r?r.features:[]}function Fr(t,e,i,s){var r;const n=new Ot;return n.outFields=["*"],n.relationshipId=typeof e.id=="number"?e.id:parseInt(e.id,10),n.objectIds=[t.attributes[i.objectIdField]],((r=i.queryRelatedFeatures)==null?void 0:r.call(i,n,s))??Promise.resolve({})}function Ar(t,e,i){let s=0;const n=[];for(;sJSON.stringify(e.toJSON())===JSON.stringify(i.toJSON())):void 0}async function $r(t,e,i,s){const n=i.layerId.toString(),{layerInfo:r,relation:o,relatedFields:d,outStatistics:c,url:u,sourceSpatialReference:p}=e,m=Cr(d),f=Er(c);if(!r||!o)return null;const g=wr({originRelationship:o,relationships:r.relationships,layerId:n});if(g!=null&&g.relationshipTableId&&g.keyFieldInRelationshipTable){const v=(await Fr(t,g,i,s))[t.attributes[i.objectIdField]];if(!v)return null;const F=v.features.map(w=>w.attributes[r.objectIdField]);if(f!=null&&f.length&&r.supportsStatistics){const w=new _t;w.where=Ar(r.objectIdField,F,1e3),w.outFields=m,w.outStatistics=f,w.sourceSpatialReference=p;const C={features:Promise.resolve(v),statsFeatures:wt(u,w)};return Le(C)}}const y=g==null?void 0:g.keyField;if(y){const v=Ns(Rr(r.fields,y)),F=br(t.attributes,o.keyField),w=v?`${y}=${F}`:`${y}='${F}'`,C=wt(u,new _t({where:w,outFields:m,sourceSpatialReference:p}),s),k=f!=null&&f.length&&r.supportsStatistics?wt(u,new _t({where:w,outFields:m,outStatistics:f,sourceSpatialReference:p}),s):null,M={features:C};return k&&(M.statsFeatures=k),Le(M)}return null}function xr(t,e){return Vs(t,{query:{f:"json"},signal:e==null?void 0:e.signal})}function Tr({relatedInfos:t,layer:e},i){const s={};return t.forEach((n,r)=>{const{relation:o}=n;if(!o){const m=new R("relation-required","A relation is required on a layer to retrieve related records.");throw Mi().error(m),m}const{relatedTableId:d}=o;if(typeof d!="number"){const m=new R("A related table ID is required on a layer to retrieve related records.");throw Mi().error(m),m}const c=`${e.url}/${d}`,u=Ii.get(c),p=u??xr(c);u||Ii.set(c,p),s[r]=p}),Ps(Le(s),i)}function kr({graphic:t,relatedInfos:e,layer:i},s){const n={};return e.forEach((r,o)=>{r.layerInfo&&(n[o]=$r(t,r,i,s))}),Le(n)}function Lr({relatedInfo:t,fieldName:e,fieldInfo:i}){var s,n;if((s=t.relatedFields)==null||s.push(e),i.statisticType){const r=new Os({statisticType:i.statisticType,onStatisticField:e,outStatisticFieldName:e});(n=t.outStatistics)==null||n.push(r)}}function Rr(t,e){if(t!=null){e=e.toLowerCase();for(const i of t)if(i&&i.name.toLowerCase()===e)return i}return null}const Fi={chartAnimation:!0};let B=class extends fe{constructor(e){super(e),this.abilities={...Fi},this.activeMediaInfoIndex=0,this.attributes=null,this.description=null,this.fieldInfoMap=null,this.formattedAttributes=null,this.expressionAttributes=null,this.isAggregate=!1,this.layer=null,this.mediaInfos=null,this.popupTemplate=null,this.relatedInfos=null,this.title=null}castAbilities(e){return{...Fi,...e}}get activeMediaInfo(){return this.formattedMediaInfos[this.activeMediaInfoIndex]||null}get formattedMediaInfos(){return this._formatMediaInfos()||[]}get formattedMediaInfoCount(){return this.formattedMediaInfos.length}setActiveMedia(e){this._setContentElementMedia(e)}next(){this._pageContentElementMedia(1)}previous(){this._pageContentElementMedia(-1)}_setContentElementMedia(e){const{formattedMediaInfoCount:i}=this,s=(e+i)%i;this.activeMediaInfoIndex=s}_pageContentElementMedia(e){const{activeMediaInfoIndex:i}=this,s=i+e;this._setContentElementMedia(s)}_formatMediaInfos(){const{mediaInfos:e,layer:i}=this,s=this.attributes??{},n=this.formattedAttributes??{},r=this.expressionAttributes??{},o=this.fieldInfoMap??new Map;return(e==null?void 0:e.map(d=>{const c=d==null?void 0:d.clone();if(!c)return null;if(c.title=Ae({attributes:s,fieldInfoMap:o,globalAttributes:n,expressionAttributes:r,layer:i,text:c.title}),c.caption=Ae({attributes:s,fieldInfoMap:o,globalAttributes:n,expressionAttributes:r,layer:i,text:c.caption}),c.altText=Ae({attributes:s,fieldInfoMap:o,globalAttributes:n,expressionAttributes:r,layer:i,text:c.altText}),c.type==="image"){const{value:u}=c;return this._setImageValue({value:u,formattedAttributes:n,layer:i}),c.value.sourceURL?c:void 0}if(c.type==="pie-chart"||c.type==="line-chart"||c.type==="column-chart"||c.type==="bar-chart"){const{value:u}=c;return this._setChartValue({value:u,chartType:c.type,attributes:s,formattedAttributes:n,layer:i,expressionAttributes:r}),c}return null}).filter(ht))??[]}_setImageValue(e){const i=this.fieldInfoMap??new Map,{value:s,formattedAttributes:n,layer:r}=e,{linkURL:o,sourceURL:d}=s;if(d){const c=St(d,r);s.sourceURL=Vt({formattedAttributes:n,template:c,fieldInfoMap:i})}if(o){const c=St(o,r);s.linkURL=Vt({formattedAttributes:n,template:c,fieldInfoMap:i})}}_setChartValue(e){const{value:i,attributes:s,formattedAttributes:n,chartType:r,layer:o,expressionAttributes:d}=e,{popupTemplate:c,relatedInfos:u}=this,{fields:p,normalizeField:m}=i,f=o;if(i.fields=Tn(p,f),m&&(i.normalizeField=Ge(m,f)),!p.some(y=>!!(n[y]!=null||me(y)&&(u!=null&&u.size))))return;const g=(c==null?void 0:c.fieldInfos)??[];p.forEach((y,v)=>{var C;const F=(C=i.colors)==null?void 0:C[v];if(me(y))return void(i.series=[...i.series,...this._getRelatedChartInfos({fieldInfos:g,fieldName:y,formattedAttributes:n,chartType:r,value:i,color:F})]);const w=this._getChartOption({value:i,attributes:s,chartType:r,formattedAttributes:n,expressionAttributes:d,fieldName:y,fieldInfos:g,color:F});i.series.push(w)})}_getRelatedChartInfos(e){var y;const{fieldInfos:i,fieldName:s,formattedAttributes:n,chartType:r,value:o,color:d}=e,c=[],u=st(s),p=u&&((y=this.relatedInfos)==null?void 0:y.get(u.layerId.toString()));if(!p)return c;const{relatedFeatures:m,relation:f}=p;if(!f||!m)return c;const{cardinality:g}=f;return m.forEach(v=>{const{attributes:F}=v;F&&Object.keys(F).forEach(w=>{w===u.fieldName&&c.push(this._getChartOption({value:o,attributes:F,formattedAttributes:n,fieldName:s,chartType:r,relatedFieldName:w,hasMultipleRelatedFeatures:(m==null?void 0:m.length)>1,fieldInfos:i,color:d}))})}),g==="one-to-many"||g==="many-to-many"?c:[c[0]]}_getTooltip({label:e,value:i,chartType:s}){return s==="pie-chart"?`${e}`:`${e}: ${i}`}_getChartOption(e){var se;const{value:i,attributes:s,formattedAttributes:n,expressionAttributes:r,fieldName:o,relatedFieldName:d,fieldInfos:c,chartType:u,hasMultipleRelatedFeatures:p,color:m}=e,f=this.layer,g=this.fieldInfoMap??new Map,{normalizeField:y,tooltipField:v}=i,F=y?me(y)?s[st(y).fieldName]:s[y]:null,w=Zt(o)&&r&&r[o]!==void 0?r[o]:d&&s[d]!==void 0?s[d]:s[o]!==void 0?s[o]:n[o],C=new Ss({fieldName:o,color:m,value:w===void 0?null:w&&F?w/F:w});if(me(o)){const j=g.get(o.toLowerCase()),ft=v&&g.get(v.toLowerCase()),Ms=(j==null?void 0:j.fieldName)??o,gt=p&&v?st(v).fieldName:(ft==null?void 0:ft.fieldName)??v,Is=p&>?s[gt]:n[gt]??(j==null?void 0:j.label)??(j==null?void 0:j.fieldName)??d,Fs=p&&d?s[d]:n[Ms];return C.tooltip=this._getTooltip({label:Is,value:Fs,chartType:u}),C}const k=ns(c,o),M=Ge(o,f),oe=v&&n[v]!==void 0?n[v]:ts(k||new Hi({fieldName:M}),(se=this.popupTemplate)==null?void 0:se.expressionInfos),J=n[M];return C.tooltip=this._getTooltip({label:oe,value:J,chartType:u}),C}};a([l()],B.prototype,"abilities",void 0),a([qe("abilities")],B.prototype,"castAbilities",null),a([l()],B.prototype,"activeMediaInfoIndex",void 0),a([l({readOnly:!0})],B.prototype,"activeMediaInfo",null),a([l()],B.prototype,"attributes",void 0),a([l()],B.prototype,"description",void 0),a([l()],B.prototype,"fieldInfoMap",void 0),a([l()],B.prototype,"formattedAttributes",void 0),a([l()],B.prototype,"expressionAttributes",void 0),a([l({readOnly:!0})],B.prototype,"formattedMediaInfos",null),a([l()],B.prototype,"isAggregate",void 0),a([l()],B.prototype,"layer",void 0),a([l({readOnly:!0})],B.prototype,"formattedMediaInfoCount",null),a([l()],B.prototype,"mediaInfos",void 0),a([l()],B.prototype,"popupTemplate",void 0),a([l()],B.prototype,"relatedInfos",void 0),a([l()],B.prototype,"title",void 0),B=a([N("esri.widgets.Feature.FeatureMedia.FeatureMediaViewModel")],B);const Ce=B,S="esri-feature-media",Q={base:S,mediaContainer:`${S}__container`,mediaItemContainer:`${S}__item-container`,mediaItem:`${S}__item`,mediaItemText:`${S}__item-text`,mediaItemTitle:`${S}__item-title`,mediaItemCaption:`${S}__item-caption`,mediaNavigation:`${S}__item-navigation`,mediaPagination:`${S}__pagination`,mediaPaginationText:`${S}__pagination-text`,mediaPrevious:`${S}__previous`,mediaPreviousIconLTR:`${S}__previous-icon`,mediaPreviousIconRTL:`${S}__previous-icon--rtl`,mediaNext:`${S}__next`,mediaNextIconLTR:`${S}__next-icon`,mediaNextIconRTL:`${S}__next-icon--rtl`,mediaChart:`${S}__chart`,mediaPaginationButton:`${S}__pagination-button`,mediaPaginationIcon:`${S}__pagination-icon`,mediaChartRendered:`${S}__chart--rendered`},$t=15,ge="category",He="value",Pr="rgba(50, 50, 50, 1)",Or=250,Nr=500,Vr=200;let G=class extends ie{constructor(e,i){super(e,i),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this._chartRootMap=new WeakMap,this.viewModel=new Ce,this.messages=null,this._disposeChart=s=>{var n;(n=this._chartRootMap.get(s))==null||n.dispose(),this._chartRootMap.delete(s)},this._createChart=async s=>{const{destroyed:n,viewModel:r}=this;if(n||!r||!s)return;const{createRoot:o}=await E(()=>import("./chartUtilsAm5-D5owA826.js"),__vite__mapDeps([9,2,3,10,11,12])),d=await o(s);this._chartRootMap.set(s,d),this._renderChart({mediaInfo:r.activeMediaInfo,root:d})}}initialize(){this._featureElementInfo=new pt,this.addHandles([_(()=>{var e,i;return[(e=this.viewModel)==null?void 0:e.activeMediaInfo,(i=this.viewModel)==null?void 0:i.activeMediaInfoIndex]},()=>this._setupMediaRefreshTimer(),P),_(()=>{var e,i;return[(e=this.viewModel)==null?void 0:e.description,(i=this.viewModel)==null?void 0:i.title]},()=>this._setupFeatureElementInfo(),P)])}loadDependencies(){return We({icon:()=>E(()=>import("./calcite-icon-BCYnyK8T.js"),__vite__mapDeps([0,1,2,3,4,5,6]))})}destroy(){var e;this._clearMediaRefreshTimer(),(e=this._featureElementInfo)==null||e.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get activeMediaInfoIndex(){return this.viewModel.activeMediaInfoIndex}set activeMediaInfoIndex(e){this.viewModel.activeMediaInfoIndex=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get fieldInfoMap(){return this.viewModel.fieldInfoMap}set fieldInfoMap(e){this.viewModel.fieldInfoMap=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get mediaInfos(){return this.viewModel.mediaInfos}set mediaInfos(e){this.viewModel.mediaInfos=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get relatedInfos(){return this.viewModel.relatedInfos}set relatedInfos(e){this.viewModel.relatedInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){var e;return h("div",{bind:this,class:Q.base,onkeyup:this._handleMediaKeyup},(e=this._featureElementInfo)==null?void 0:e.render(),this._renderMedia())}_renderMedia(){const{formattedMediaInfoCount:e,activeMediaInfoIndex:i}=this.viewModel,s=this._renderMediaText();return e?h("div",{class:Q.mediaContainer,key:"media-element-container"},this._renderMediaInfo(),h("div",{class:Q.mediaNavigation},s,e>1?h("div",{class:Q.mediaPagination},this._renderMediaPageButton("previous"),h("span",{class:Q.mediaPaginationText},ce(this.messages.pageText,{index:i+1,total:e})),this._renderMediaPageButton("next")):null)):null}_renderMediaText(){const{activeMediaInfo:e}=this.viewModel;if(!e)return null;const i=e&&e.title?h("div",{class:Q.mediaItemTitle,innerHTML:e.title,key:"media-title"}):null,s=e&&e.caption?h("div",{class:Q.mediaItemCaption,innerHTML:e.caption,key:"media-caption"}):null;return i||s?h("div",{class:Q.mediaItemText,key:"media-text"},i,s):null}_renderImageMediaInfo(e){const{_refreshIntervalInfo:i}=this,{activeMediaInfoIndex:s,formattedMediaInfoCount:n}=this.viewModel,{value:r,refreshInterval:o,altText:d,title:c,type:u}=e,{sourceURL:p,linkURL:m}=r,f=es(m??void 0)?"_blank":"_self",g=f==="_blank"?"noreferrer":"",y=o?i:null,v=y?y.timestamp:0,F=y?y.sourceURL:p,w=h("img",{alt:d||c,key:`media-${u}-${s}-${n}-${v}`,src:F??void 0});return(m?h("a",{href:m,rel:g,target:f,title:c},w):null)??w}_renderChartMediaInfo(e){const{activeMediaInfoIndex:i,formattedMediaInfoCount:s}=this.viewModel;return h("div",{afterCreate:this._createChart,afterRemoved:this._disposeChart,bind:this,class:Q.mediaChart,key:`media-${e.type}-${i}-${s}`})}_renderMediaInfoType(){const{activeMediaInfo:e}=this.viewModel;return e?e.type==="image"?this._renderImageMediaInfo(e):e.type.includes("chart")?this._renderChartMediaInfo(e):null:null}_renderMediaInfo(){const{activeMediaInfo:e}=this.viewModel;return e?h("div",{class:Q.mediaItemContainer,key:"media-container"},h("div",{class:Q.mediaItem,key:"media-item-container"},this._renderMediaInfoType())):null}_renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const i=e==="previous",s=i?this.messages.previous:this.messages.next,n=i?"chevron-left":"chevron-right",r=i?"media-previous":"media-next",o=i?this._previous:this._next;return h("button",{"aria-label":s,bind:this,class:Q.mediaPaginationButton,key:r,onclick:o,tabIndex:0,title:s,type:"button"},h("calcite-icon",{class:Q.mediaPaginationIcon,icon:n,scale:"s"}))}_setupFeatureElementInfo(){var s;const{description:e,title:i}=this;(s=this._featureElementInfo)==null||s.set({description:e,title:i})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){if(!this.viewModel)return;const{isAggregate:e,layer:i}=this.viewModel;return e&&(i!=null&&i.featureReduction)&&"renderer"in i.featureReduction?i.featureReduction.renderer:i==null?void 0:i.renderer}async _getSeriesColors(e){const{colorAm5:i}=await E(()=>import("./chartCommon-HGSAjsjY.js"),__vite__mapDeps([13,10,2,3,14,11,15])),s=new Map;return e.forEach(n=>{n.color&&s.set(n,i(n.color.toCss(!0)))}),s}async _getRendererColors(){const{colorAm5:e}=await E(()=>import("./chartCommon-HGSAjsjY.js"),__vite__mapDeps([13,10,2,3,14,11,15])),i=new Map,s=this._getRenderer(),n="default";if(!s)return i;const r=await _r(s);return r.delete(n),Array.from(r.values()).every(o=>(o==null?void 0:o.length)===1)&&Array.from(r.keys()).forEach(o=>{var c,u;const d=(u=(c=r.get(o))==null?void 0:c[0])==null?void 0:u.toCss(!0);d&&i.set(o,e(d))}),i}_handleMediaKeyup(e){const{key:i}=e;i==="ArrowLeft"&&(e.stopPropagation(),this.viewModel.previous()),i==="ArrowRight"&&(e.stopPropagation(),this.viewModel.next())}_canAnimateChart(){return!!this.viewModel&&!!this.viewModel.abilities.chartAnimation&&!or()}_getChartAnimationMS(){return this._canAnimateChart()?Or:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?Nr:0}async _renderChart(e){const{root:i,mediaInfo:s}=e,{value:n,type:r}=s,{ResponsiveThemeAm5:o,DarkThemeAm5:d,AnimatedThemeAm5:c,ColorSetAm5:u,ThemeAm5:p,esriChartColorSet:m}=await E(()=>import("./chartCommon-HGSAjsjY.js"),__vite__mapDeps([13,10,2,3,14,11,15])),f=p.new(i);f.rule("ColorSet").set("colors",m),f.rule("ColorSet").set("reuse",!0);const g=[o.new(i),f];Ds()&&g.push(d.new(i)),this._canAnimateChart()&&g.push(c.new(i)),i.setThemes(g);const y=await this._getRendererColors(),v=await this._getSeriesColors(n.series),F=u.new(i,{}),w=v.get(n.series[0]),C=w?{lineSettings:{stroke:w}}:void 0,k=n.series.map((M,oe)=>{const J=v.get(M)||y.get(M.fieldName)||F.getIndex(oe);return{[ge]:M.tooltip,[He]:M.value,columnSettings:{fill:J,stroke:J},...C}}).filter(M=>r!=="pie-chart"||M.value!=null&&M.value>0);r==="pie-chart"?this._createPieChart(e,k):this._createXYChart(e,k)}_getDirection(){return ke(this.container)?"rtl":"ltr"}_isInversed(){return!!ke(this.container)}async _customizeChartTooltip(e,i="horizontal"){var n;const{colorAm5:s}=await E(()=>import("./chartCommon-HGSAjsjY.js"),__vite__mapDeps([13,10,2,3,14,11,15]));e.setAll({pointerOrientation:i}),(n=e.get("background"))==null||n.setAll({stroke:s(Pr)}),e.label.setAll({direction:this._getDirection(),oversizedBehavior:"wrap",maxWidth:Vr})}async _createPieChart(e,i){const{TooltipAm5:s}=await E(()=>import("./chartCommon-HGSAjsjY.js"),__vite__mapDeps([13,10,2,3,14,11,15])),{PieChartAm5:n,PieSeriesAm5:r}=await E(()=>import("./pieChart-BW1iYy_W.js"),__vite__mapDeps([16,2,3,17,10,15,12])),{mediaInfo:o,root:d}=e,{title:c}=o,u=5,p=(o==null?void 0:o.altText)||(o==null?void 0:o.title)||"",m=d.container.children.push(n.new(d,{ariaLabel:p,focusable:!0,paddingBottom:u,paddingTop:u,paddingLeft:u,paddingRight:u})),f=`{category}: {valuePercentTotal.formatNumber('0.00')}% + ({value})`,g=s.new(d,{labelText:f}),y=m.series.push(r.new(d,{name:c,valueField:He,categoryField:ge,tooltip:g}));y.ticks.template.set("forceHidden",!0),y.labels.template.set("forceHidden",!0),y.slices.template.states.create("active",{shiftRadius:u}),this._customizeChartTooltip(g),y.slices.template.setAll({ariaLabel:f,focusable:!0,templateField:"columnSettings"}),y.data.setAll(i),y.appear(this._getChartSeriesAnimationMS()),m.appear(this._getChartAnimationMS()),m.root.dom.classList.toggle(Q.mediaChartRendered,!0)}_getMinSeriesValue(e){let i=0;return e.forEach(s=>i=Math.min(s.value,i)),i}async _createColumnChart(e,i,s){const{TooltipAm5:n,ScrollbarAm5:r}=await E(()=>import("./chartCommon-HGSAjsjY.js"),__vite__mapDeps([13,10,2,3,14,11,15])),{CategoryAxisAm5:o,AxisRendererXAm5:d,ValueAxisAm5:c,AxisRendererYAm5:u,ColumnSeriesAm5:p}=await E(()=>import("./xyChart-Dpn5biYD.js"),__vite__mapDeps([18,10,2,3,15,12,17,14])),{mediaInfo:m,root:f}=i,{value:g,title:y}=m;e.setAll({wheelX:"panX",wheelY:"zoomX"});const v=e.xAxes.push(o.new(f,{renderer:d.new(f,{inversed:this._isInversed()}),categoryField:ge}));v.get("renderer").labels.template.setAll({forceHidden:!0});const F=e.yAxes.push(c.new(f,{renderer:u.new(f,{inside:!1}),min:this._getMinSeriesValue(g.series)}));F.get("renderer").labels.template.setAll({direction:this._getDirection()});const w="{categoryX}",C=n.new(f,{labelText:w}),k=e.series.push(p.new(f,{name:y,xAxis:v,yAxis:F,valueYField:He,categoryXField:ge,tooltip:C}));this._customizeChartTooltip(C),k.columns.template.setAll({ariaLabel:w,focusable:!0,templateField:"columnSettings"}),g.series.length>$t&&e.set("scrollbarX",r.new(f,{orientation:"horizontal"})),v.data.setAll(s),k.data.setAll(s),k.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createBarChart(e,i,s){const{TooltipAm5:n,ScrollbarAm5:r}=await E(()=>import("./chartCommon-HGSAjsjY.js"),__vite__mapDeps([13,10,2,3,14,11,15])),{CategoryAxisAm5:o,AxisRendererXAm5:d,ValueAxisAm5:c,AxisRendererYAm5:u,ColumnSeriesAm5:p}=await E(()=>import("./xyChart-Dpn5biYD.js"),__vite__mapDeps([18,10,2,3,15,12,17,14])),{mediaInfo:m,root:f}=i,{value:g,title:y}=m;e.setAll({wheelX:"panY",wheelY:"zoomY"});const v=e.yAxes.push(o.new(f,{renderer:u.new(f,{inversed:!0}),categoryField:ge}));v.get("renderer").labels.template.setAll({forceHidden:!0});const F=e.xAxes.push(c.new(f,{renderer:d.new(f,{inside:!1,inversed:this._isInversed()}),min:this._getMinSeriesValue(g.series)}));F.get("renderer").labels.template.setAll({direction:this._getDirection()});const w="{categoryY}",C=n.new(f,{labelText:w}),k=e.series.push(p.new(f,{name:y,xAxis:F,yAxis:v,valueXField:He,categoryYField:ge,tooltip:C}));this._customizeChartTooltip(C,"vertical"),k.columns.template.setAll({ariaLabel:w,focusable:!0,templateField:"columnSettings"}),g.series.length>$t&&e.set("scrollbarY",r.new(f,{orientation:"vertical"})),v.data.setAll(s),k.data.setAll(s),k.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createLineChart(e,i,s){var oe,J,se;const{TooltipAm5:n,ScrollbarAm5:r}=await E(()=>import("./chartCommon-HGSAjsjY.js"),__vite__mapDeps([13,10,2,3,14,11,15])),{CategoryAxisAm5:o,AxisRendererXAm5:d,ValueAxisAm5:c,AxisRendererYAm5:u,LineSeriesAm5:p}=await E(()=>import("./xyChart-Dpn5biYD.js"),__vite__mapDeps([18,10,2,3,15,12,17,14])),{root:m,mediaInfo:f}=i,{value:g,title:y}=f;e.setAll({wheelX:"panX",wheelY:"zoomX"});const v=e.xAxes.push(o.new(m,{renderer:d.new(m,{inversed:this._isInversed()}),categoryField:ge}));v.get("renderer").labels.template.setAll({forceHidden:!0});const F=e.yAxes.push(c.new(m,{renderer:u.new(m,{inside:!1}),min:this._getMinSeriesValue(g.series)}));F.get("renderer").labels.template.setAll({direction:this._getDirection()});const w="{categoryX}",C=(J=(oe=s[0])==null?void 0:oe.lineSettings)==null?void 0:J.stroke,k=n.new(m,{getFillFromSprite:!C,labelText:w});C&&((se=k.get("background"))==null||se.setAll({fill:C}));const M=e.series.push(p.new(m,{name:y,xAxis:v,yAxis:F,valueYField:He,categoryXField:ge,tooltip:k}));M.strokes.template.setAll({templateField:"lineSettings"}),this._customizeChartTooltip(k,"vertical"),g.series.length>$t&&e.set("scrollbarX",r.new(m,{orientation:"horizontal"})),v.data.setAll(s),M.data.setAll(s),M.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createXYChart(e,i){const{XYChartAm5:s,XYCursorAm5:n}=await E(()=>import("./xyChart-Dpn5biYD.js"),__vite__mapDeps([18,10,2,3,15,12,17,14])),{root:r,mediaInfo:o}=e,{type:d}=o,c=(o==null?void 0:o.altText)||(o==null?void 0:o.title)||"",u=r.container.children.push(s.new(r,{ariaLabel:c,focusable:!0,panX:!0,panY:!0}));u.set("cursor",n.new(r,{})),d==="column-chart"&&await this._createColumnChart(u,e,i),d==="bar-chart"&&await this._createBarChart(u,e,i),d==="line-chart"&&await this._createLineChart(u,e,i),u.root.dom.classList.toggle(Q.mediaChartRendered,!0)}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const i=Date.now();this._refreshIntervalInfo={timestamp:i,sourceURL:e&&this._getImageSource(e,i)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;e&&e.type==="image"&&e.refreshInterval&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:i,value:s}=e;if(!i)return;const n=6e4*i;this._updateMediaInfoTimestamp(s.sourceURL);const r=setInterval(()=>{this._updateMediaInfoTimestamp(s.sourceURL)},n);this._refreshTimer=r}_getImageSource(e,i){const s=e.includes("?")?"&":"?",[n,r=""]=e.split("#");return`${n}${s}timestamp=${i}${r?"#":""}${r}`}};a([l()],G.prototype,"_refreshIntervalInfo",void 0),a([l()],G.prototype,"attributes",null),a([l()],G.prototype,"activeMediaInfoIndex",null),a([l()],G.prototype,"description",null),a([l()],G.prototype,"fieldInfoMap",null),a([l()],G.prototype,"layer",null),a([l()],G.prototype,"mediaInfos",null),a([l()],G.prototype,"popupTemplate",null),a([l()],G.prototype,"relatedInfos",null),a([l()],G.prototype,"title",null),a([l({type:Ce})],G.prototype,"viewModel",void 0),a([l(),te("esri/widgets/Feature/t9n/Feature")],G.prototype,"messages",void 0),G=a([N("esri.widgets.Feature.FeatureMedia")],G);const hs=G,Sr="esri.widgets.Feature.support.arcadeFeatureUtils",Ai=()=>z.getLogger(Sr);function Dr(t){return typeof t=="string"?Ye(Gt(t)):Array.isArray(t)?Br(t):(t==null?void 0:t.declaredClass)==="esri.arcade.Dictionary"?qr(t):t}function Br(t){return`
    ${t.map(e=>`
  • ${typeof e=="string"?Ye(Gt(e)):e}
  • `).join("")}
`}function qr(t){const e=t.keys().map(i=>{const s=t.field(i);return`${i}${typeof s=="string"?Ye(Gt(s)):s}`}).join("");return`${e}
`}function ps(){return E(()=>import("./arcade-D78QfcWG.js"),__vite__mapDeps([19,2,3,20,21,22,23,24,25,26,27,8,7,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69]))}function zr(t){return"createQuery"in t&&"queryFeatures"in t}async function Wr({graphic:t,view:e,options:i}){const{isAggregate:s,layer:n}=t;if(!s||!n||(e==null?void 0:e.type)!=="2d")return[];const r=await e.whenLayerView(n);if(!zr(r))return[];const o=r.createQuery(),d=t.getObjectId();o.aggregateIds=d!=null?[d]:[];const{features:c}=await r.queryFeatures(o,i);return c}function Hr({layer:t,aggregatedFeatures:e,interceptor:i}){const{fields:s,objectIdField:n,geometryType:r,spatialReference:o,displayField:d}=t;return new pn({fields:s,objectIdField:n,geometryType:r,spatialReference:o,displayField:d,interceptor:i,...t.type==="feature"?{templates:t.templates,typeIdField:t.typeIdField,types:t.types}:null,source:e})}async function ms({expressionInfo:t,arcade:e,interceptor:i,spatialReference:s,map:n,graphic:r,location:o,view:d,options:c}){var k;if(!(t!=null&&t.expression))return null;const{isAggregate:u}=r,p=(r.sourceLayer||r.layer)??void 0,m=u?"feature-reduction-popup":"popup",f=e.createArcadeProfile(m),g=e.createArcadeExecutor(t.expression,f).catch(M=>Ai().error("arcade-executor-error",{error:M,expressionInfo:t})),[y,v]=await Promise.all([Wr({graphic:r,view:d,options:c}),g]);if(!v)return null;const F=m==="feature-reduction-popup"?Hr({layer:p,aggregatedFeatures:y,interceptor:i}):void 0,w={...m==="feature-reduction-popup"?{$aggregatedFeatures:F}:{$datastore:p==null?void 0:p.url,$layer:(p==null?void 0:p.type)==="feature"||(p==null?void 0:p.type)==="subtype-sublayer"?p:(p==null?void 0:p.type)==="scene"&&p.associatedLayer!=null?p.associatedLayer:void 0,$map:n,$userInput:o,$graph:(p==null?void 0:p.type)==="knowledge-graph-sublayer"?(k=p==null?void 0:p.parentCompositeLayer)==null?void 0:k.knowledgeGraph:void 0},$feature:r},C={abortSignal:(c==null?void 0:c.signal)??void 0,interceptor:i??void 0,rawOutput:!0,spatialReference:s??void 0,timeZone:d==null?void 0:d.timeZone};return await v.executeAsync(w,C).catch(M=>Ai().error("arcade-execution-error",{error:M,graphic:r,expressionInfo:t})).finally(()=>F==null?void 0:F.destroy())}async function jr({expressionInfos:t,spatialReference:e,graphic:i,interceptor:s,map:n,view:r,location:o,options:d}){if(!(t!=null&&t.length))return{};const c=await ps(),u={};for(const f of t)u[`expression/${f.name}`]=ms({expressionInfo:f,arcade:c,interceptor:s,spatialReference:e,map:n,graphic:i,location:o,view:r,options:d});const p=await Le(u),m={};for(const f in p)m[f]=Dr(p[f].value);return m}const Ur=1;let K=class extends fe{constructor(e){super(e),this._abortController=null,this.expressionInfo=null,this.graphic=null,this.contentElement=null,this.contentElementViewModel=null,this.interceptor=null,this.location=null,this.view=null,this._cancelQuery=()=>{const{_abortController:i}=this;i&&i.abort(),this._abortController=null},this._createVM=()=>{var n,r;const i=(n=this.contentElement)==null?void 0:n.type;(r=this.contentElementViewModel)==null||r.destroy();const s=i==="fields"?new mt:i==="media"?new Ce:i==="text"?new ct:null;this._set("contentElementViewModel",s)},this._compile=async()=>{this._cancelQuery();const i=new AbortController;this._abortController=i,await this._compileExpression(),this._abortController===i&&(this._abortController=null)},this._compileThrottled=lt(this._compile,Ur,this),this._compileExpression=async()=>{const{expressionInfo:i,graphic:s,interceptor:n,spatialReference:r,map:o,location:d,view:c,_abortController:u}=this;if(!i||!s)return void this._set("contentElement",null);const p=await ps();if(u!==this._abortController)return;const m=await ms({arcade:p,expressionInfo:i,graphic:s,location:d,interceptor:n,map:o,spatialReference:r,view:c});if(!m||m.declaredClass!=="esri.arcade.Dictionary")return void this._set("contentElement",null);const f=await m.castAsJsonAsync(u==null?void 0:u.signal),g=f==null?void 0:f.type,y=g==="media"?qs.fromJSON(f):g==="text"?Ui.fromJSON(f):g==="fields"?zs.fromJSON(f):null;this._set("contentElement",y)},this.addHandles([_(()=>[this.expressionInfo,this.graphic,this.map,this.spatialReference,this.view],()=>this._compileThrottled(),P),_(()=>[this.contentElement],()=>this._createVM(),P)])}initialize(){this.addHandles(this._compileThrottled)}destroy(){var e;this._cancelQuery(),(e=this.contentElementViewModel)==null||e.destroy(),this._set("contentElementViewModel",null),this._set("contentElement",null)}get spatialReference(){var e;return((e=this.view)==null?void 0:e.spatialReference)??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{_abortController:e,contentElement:i,contentElementViewModel:s}=this;return e?"loading":i||s?"ready":"disabled"}get map(){var e;return((e=this.view)==null?void 0:e.map)??null}set map(e){this._override("map",e)}};a([l()],K.prototype,"_abortController",void 0),a([l({type:Bs})],K.prototype,"expressionInfo",void 0),a([l({type:ze})],K.prototype,"graphic",void 0),a([l({readOnly:!0})],K.prototype,"contentElement",void 0),a([l({readOnly:!0})],K.prototype,"contentElementViewModel",void 0),a([l()],K.prototype,"interceptor",void 0),a([l({type:Ht})],K.prototype,"location",void 0),a([l()],K.prototype,"spatialReference",null),a([l({readOnly:!0})],K.prototype,"state",null),a([l()],K.prototype,"map",null),a([l()],K.prototype,"view",void 0),K=a([N("esri.widgets.Feature.FeatureExpression.FeatureExpressionViewModel")],K);const Jt=K,xt="esri-feature",Tt={base:`${xt}-expression`,loadingSpinnerContainer:`${xt}__loading-container`,spinner:`${xt}__loading-spinner`};let nt=class extends ie{constructor(e,i){super(e,i),this._contentWidget=null,this.viewModel=new Jt}initialize(){this.addHandles(_(()=>{var e;return(e=this.viewModel)==null?void 0:e.contentElementViewModel},()=>this._setupExpressionWidget(),P))}destroy(){this._destroyContentWidget()}render(){var i;const{state:e}=this.viewModel;return h("div",{class:Tt.base},e==="loading"?this._renderLoading():e==="disabled"?null:(i=this._contentWidget)==null?void 0:i.render())}_renderLoading(){return h("div",{class:Tt.loadingSpinnerContainer,key:"loading-container"},h("span",{class:this.classes(re.loadingIndicator,I.rotating,Tt.spinner)}))}_destroyContentWidget(){const{_contentWidget:e}=this;e&&(e.viewModel=null,e.destroy()),this._contentWidget=null}_setupExpressionWidget(){const{contentElementViewModel:e,contentElement:i}=this.viewModel,s=i==null?void 0:i.type;this._destroyContentWidget();const n=e?s==="fields"?new us({viewModel:e}):s==="media"?new hs({viewModel:e}):s==="text"?new it({viewModel:e}):null:null;this._contentWidget=n,this.scheduleRender()}};a([l({type:Jt})],nt.prototype,"viewModel",void 0),nt=a([N("esri.widgets.Feature.FeatureExpression")],nt);const Zr=nt;var Ci;(function(t){t.TOO_SHORT="length-validation-error::too-short"})(Ci||(Ci={}));const Qr=t=>{var i;const e=[];if(t.formTemplate){const{description:s,title:n}=t.formTemplate;(i=t.fields)==null||i.forEach(r=>{const o=n&&di(n,r.name),d=s&&di(s,r.name);(o||d)&&e.push(r.name)})}return e},kt=100;let L=class extends Ws(Zi(fe)){constructor(e){super(e),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.featuresPerPage=10,this.description=null,this.graphic=null,this.layer=null,this.map=null,this.orderByFields=null,this.featureCount=0,this.relationshipId=null,this.showAllEnabled=!1,this.title=null,this._cancelQuery=()=>{const{_queryAbortController:i}=this;i&&i.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:i}=this;i&&i.abort(),this._queryFeatureCountAbortController=null},this._cancelQueryPage=()=>{const{_queryPageAbortController:i}=this;i&&i.abort(),this._queryPageAbortController=null},this._queryController=async()=>{this._cancelQuery();const i=new AbortController;this._queryAbortController=i,await yt(this._query()),this._queryAbortController===i&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const i=new AbortController;this._queryFeatureCountAbortController=i,await yt(this._queryFeatureCount()),this._queryFeatureCountAbortController===i&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryPageController=async()=>{const i=new AbortController;this._queryPageAbortController=i,await yt(this._queryPage()),this._queryPageAbortController===i&&(this._queryPageAbortController=null)},this._queryDebounced=tt(this._queryController,kt),this._queryFeatureCountDebounced=tt(this._queryFeatureCountController,kt),this._queryPageDebounced=tt(this._queryPageController,kt),this._query=async()=>{const{_queryAbortController:i,relatedFeatures:s}=this;this.featureCount&&(this._destroyRelatedFeatureViewModels(),this.featurePage=1,s.removeAll(),this.destroyed||s.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:i==null?void 0:i.signal}))))},this.addHandles([_(()=>{var i;return[this.displayCount,this.graphic,this.layer,(i=this.layer)==null?void 0:i.loaded,this.map,this.orderByFields,this.relationshipId,this.featuresPerPage,this.showAllEnabled,this.canQuery,this.featureCount]},()=>this._queryDebounced(),P),_(()=>[this.featurePage,this.showAllEnabled],()=>this._queryPageDebounced()),_(()=>[this.layer,this.relationshipId,this.objectId,this.canQuery],()=>this._queryFeatureCountDebounced())])}destroy(){this._destroyRelatedFeatureViewModels(),this.relatedFeatures.removeAll(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage()}set featurePage(e){const{featuresPerPage:i,featureCount:s}=this,n=1,r=Math.ceil(s/i)||1;this._set("featurePage",Math.min(Math.max(e,n),r))}get featurePage(){return this._get("featurePage")}get orderByFieldsFixedCasing(){const{orderByFields:e,relatedLayer:i}=this;return e&&(i!=null&&i.loaded)?e.map(s=>{const n=s.clone();return n.field=Ge(s.field,i),n}):e??[]}get supportsCacheHint(){var e,i,s;return!!((s=(i=(e=this.layer)==null?void 0:e.capabilities)==null?void 0:i.queryRelated)!=null&&s.supportsCacheHint)}get canLoad(){return!!this.map&&typeof this.relationshipId=="number"&&typeof this.objectId=="number"}get canQuery(){var i,s;const e=(s=(i=this.layer)==null?void 0:i.capabilities)==null?void 0:s.queryRelated;return!!(this.relatedLayer&&this.relationship&&typeof this.relationshipId=="number"&&typeof this.objectId=="number"&&(e!=null&&e.supportsCount)&&(e!=null&&e.supportsPagination))}get itemDescriptionFieldName(){var e;return((e=this.orderByFieldsFixedCasing[0])==null?void 0:e.field)||null}set displayCount(e){this._set("displayCount",Math.min(Math.max(e,0),10))}get displayCount(){return this._get("displayCount")}get objectId(){var e,i;return(this.objectIdField&&((i=(e=this.graphic)==null?void 0:e.attributes)==null?void 0:i[this.objectIdField]))??null}get objectIdField(){var e;return((e=this.layer)==null?void 0:e.objectIdField)||null}get relatedFeatures(){return this._get("relatedFeatures")||new Be}get relatedLayer(){const{layer:e,map:i,relationship:s}=this;return e!=null&&e.loaded&&i&&s?Xn(i,e,s)??null:null}get relationship(){var s;const{relationshipId:e,layer:i}=this;return typeof e=="number"?((s=i==null?void 0:i.relationships)==null?void 0:s.find(({id:n})=>n===e))??null:null}get relatedFeatureViewModels(){return this._get("relatedFeatureViewModels")||new Be}get state(){const{_queryAbortController:e,_queryFeatureCountAbortController:i,_queryPageAbortController:s,canQuery:n,_loaded:r,canLoad:o}=this;return i||o&&!r?"loading":e||s?"querying":n?"ready":"disabled"}getRelatedFeatureByObjectId(e){return this.relatedFeatures.find(i=>i.getObjectId()===e)}refresh(){this._queryFeatureCountDebounced()}_destroyRelatedFeatureViewModels(){var e;(e=this.relatedFeatureViewModels)==null||e.forEach(i=>!i.destroyed&&i.destroy()),this.relatedFeatureViewModels.removeAll()}async _queryFeatureCount(){const{layer:e,relatedLayer:i,relationshipId:s,objectId:n,_queryFeatureCountAbortController:r,canQuery:o,supportsCacheHint:d}=this;if(await(e==null?void 0:e.load()),await(i==null?void 0:i.load()),!o||!e||!i)return void this._set("featureCount",0);const c=i.createQuery(),u=new Ot({cacheHint:d,relationshipId:s,returnGeometry:!1,objectIds:[n],where:c.where??void 0}),p=await e.queryRelatedFeaturesCount(u,{signal:r==null?void 0:r.signal});this._set("featureCount",p[n]||0)}_sliceFeatures(e){const{showAllEnabled:i,displayCount:s}=this;return i?e:s?e.slice(0,s):[]}async _queryPage(){const{relatedFeatures:e,featurePage:i,showAllEnabled:s,_queryPageAbortController:n,featureCount:r}=this;!s||i<2||!r||e.addMany(await this._queryRelatedFeatures({signal:n==null?void 0:n.signal}))}async _queryRelatedFeatures(e){var se;const{orderByFieldsFixedCasing:i,showAllEnabled:s,featuresPerPage:n,displayCount:r,layer:o,relationshipId:d,featurePage:c,featureCount:u,relatedLayer:p,supportsCacheHint:m}=this,{canQuery:f,objectId:g}=this;if(!f||!o||!p)return[];const y=s?((c-1)*n+u)%u:0,v=s?n:r,F=p.objectIdField,w=[...i.map(j=>j.field),...Qr(p),F].filter(ht),C=i.map(j=>`${j.field} ${j.order}`),k=p.createQuery(),M=new Ot({orderByFields:C,start:y,num:v,outFields:w,cacheHint:m,relationshipId:d,returnGeometry:!1,objectIds:[g],where:k.where??void 0}),oe=await o.queryRelatedFeatures(M,{signal:e==null?void 0:e.signal}),J=((se=oe[g])==null?void 0:se.features)||[];return J.forEach(j=>{j.sourceLayer=p,j.layer=p}),J}};a([l()],L.prototype,"_loaded",void 0),a([l()],L.prototype,"_queryAbortController",void 0),a([l()],L.prototype,"_queryPageAbortController",void 0),a([l()],L.prototype,"_queryFeatureCountAbortController",void 0),a([l({value:1})],L.prototype,"featurePage",null),a([l()],L.prototype,"featuresPerPage",void 0),a([l({readOnly:!0})],L.prototype,"orderByFieldsFixedCasing",null),a([l({readOnly:!0})],L.prototype,"supportsCacheHint",null),a([l({readOnly:!0})],L.prototype,"canLoad",null),a([l({readOnly:!0})],L.prototype,"canQuery",null),a([l()],L.prototype,"description",void 0),a([l({readOnly:!0})],L.prototype,"itemDescriptionFieldName",null),a([l({value:3})],L.prototype,"displayCount",null),a([l({type:ze})],L.prototype,"graphic",void 0),a([l()],L.prototype,"layer",void 0),a([l()],L.prototype,"map",void 0),a([l({readOnly:!0})],L.prototype,"objectId",null),a([l({readOnly:!0})],L.prototype,"objectIdField",null),a([l()],L.prototype,"orderByFields",void 0),a([l({readOnly:!0})],L.prototype,"relatedFeatures",null),a([l({readOnly:!0})],L.prototype,"relatedLayer",null),a([l({readOnly:!0})],L.prototype,"relationship",null),a([l()],L.prototype,"featureCount",void 0),a([l({readOnly:!0})],L.prototype,"relatedFeatureViewModels",null),a([l()],L.prototype,"relationshipId",void 0),a([l()],L.prototype,"showAllEnabled",void 0),a([l()],L.prototype,"state",null),a([l()],L.prototype,"title",void 0),L=a([N("esri.widgets.Feature.FeatureRelationship.FeatureRelationshipViewModel")],L);const ei=L,Ze="esri-feature",je=`${Ze}-relationship`,ue={base:je,listContainer:`${je}__list`,listItem:`${je}__list-item`,listItemHidden:`${je}__list-item--hidden`,listContainerQuerying:`${je}__list--querying`,featureObserver:`${Ze}__feature-observer`,stickySpinnerContainer:`${Ze}__sticky-loading-container`,loadingSpinnerContainer:`${Ze}__loading-container`,spinner:`${Ze}__loading-spinner`},Ei={title:!0,description:!0};let X=class extends ie{constructor(t,e){super(t,e),this._featureElementInfo=null,this._relatedFeatureIntersectionObserverNode=null,this._relatedFeatureIntersectionObserver=new IntersectionObserver(([i])=>{i!=null&&i.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this.headingLevel=2,this.viewModel=new ei,this.messages=null,this.messagesCommon=null,this.visibleElements={...Ei},this._increaseFeaturePage=()=>{const{state:i,showAllEnabled:s,relatedFeatures:n,featuresPerPage:r,featurePage:o}=this.viewModel;i==="ready"&&s&&n.length>=r*o&&this.viewModel.featurePage++}}initialize(){this._featureElementInfo=new pt,this.addHandles([_(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),P),_(()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode],()=>this._handleRelatedFeatureObserverChange()),Te(()=>this.viewModel.relatedFeatureViewModels,"change",()=>this._setupRelatedFeatureViewModels())])}loadDependencies(){return We({icon:()=>E(()=>import("./calcite-icon-BCYnyK8T.js"),__vite__mapDeps([0,1,2,3,4,5,6])),list:()=>E(()=>import("./calcite-list-CAcrc3c7.js"),__vite__mapDeps([70,2,3,4,5,71,6,72,73,74,75,1,76,77,78,79,80,81])),"list-item":()=>E(()=>import("./calcite-list-item-JeWmt-sE.js"),__vite__mapDeps([82,2,3,4,5,71,72,74,6,73,83,79,1,80])),notice:()=>E(()=>import("./calcite-notice-Bu--C1Vt.js"),__vite__mapDeps([84,2,3,85,6,4,5,73,74,86,79,1]))})}destroy(){this._unobserveRelatedFeatureObserver(),this._featureElementInfo=Hs(this._featureElementInfo)}get displayShowAllButton(){const{showAllEnabled:t,featureCount:e,displayCount:i,state:s}=this.viewModel;return!t&&!!e&&s==="ready"&&(e>i||i===0)}get displayListItems(){return this.displayShowAllButton||this.viewModel.relatedFeatureViewModels.length>0}get description(){return this.viewModel.description}set description(t){this.viewModel.description=t}get featureCountDescription(){const{messages:t}=this,{featureCount:e}=this.viewModel;return ce(t==null?void 0:t.numberRecords,{number:e})}get title(){return this.viewModel.title}set title(t){this.viewModel.title=t}castVisibleElements(t){return{...Ei,...t}}render(){var e;const{state:t}=this.viewModel;return h("div",{class:this.classes(ue.base,I.widget)},(e=this._featureElementInfo)==null?void 0:e.render(),t==="loading"?this._renderLoading():t==="disabled"?this._renderRelationshipNotFound():this._renderRelatedFeatures())}_renderStickyLoading(){return this.viewModel.state==="querying"?h("div",{class:ue.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return h("span",{class:this.classes(re.loadingIndicator,I.rotating,ue.spinner)})}_renderLoading(){return h("div",{class:ue.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderShowAllIconNode(){return h("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})}_renderChevronIconNode(){const t=ke(this.container)?"chevron-left":"chevron-right";return h("calcite-icon",{icon:t,scale:"s",slot:"content-end"})}_renderRelatedFeature(t){var n;const{itemDescriptionFieldName:e}=this.viewModel,i=t.title;t.description=e&&((n=t.formattedAttributes)==null?void 0:n.global[e]);const s=t.state==="loading";return h("calcite-list-item",{class:this.classes(ue.listItem,{[ue.listItemHidden]:s}),description:t.description??"",key:t.uid,label:i,onCalciteListItemSelect:()=>this.emit("select-record",{featureViewModel:t})},this._renderChevronIconNode())}_renderShowAllListItem(){var t;return this.displayShowAllButton?h("calcite-list-item",{description:this.featureCountDescription,key:"show-all-item",label:(t=this.messages)==null?void 0:t.showAll,onCalciteListItemSelect:()=>this.emit("show-all-records")},this._renderShowAllIconNode()):null}_renderNoRelatedFeaturesMessage(){var t;return h("calcite-notice",{icon:"information",key:"no-related-features-message",kind:"brand",open:!0,scale:"s",width:"full"},h("div",{slot:"message"},(t=this.messages)==null?void 0:t.noRelatedFeatures))}_renderFeatureObserver(){return h("div",{afterCreate:this._relatedFeatureIntersectionObserverCreated,bind:this,class:ue.featureObserver,key:"feature-observer"})}_renderList(){const{relatedFeatureViewModels:t}=this.viewModel;return h("calcite-list",null,t.toArray().map(e=>this._renderRelatedFeature(e)),this._renderShowAllListItem())}_renderRelatedFeatures(){const{displayListItems:t}=this,{state:e}=this.viewModel;return h("div",{class:this.classes(ue.listContainer,{[ue.listContainerQuerying]:e==="querying"}),key:"list-container"},t?this._renderList():e==="ready"?this._renderNoRelatedFeaturesMessage():null,this._renderStickyLoading(),this._renderFeatureObserver())}_renderRelationshipNotFound(){var t;return h("calcite-notice",{icon:"exclamation-mark-triangle",key:"relationship-not-found",kind:"danger",open:!0,scale:"s",width:"full"},h("div",{slot:"message"},(t=this.messages)==null?void 0:t.relationshipNotFound))}_setupRelatedFeatureViewModels(){const{relatedFeatureViewModels:t}=this.viewModel,e="related-feature-viewmodels";this.removeHandles(e),t==null||t.forEach(i=>{this.addHandles(_(()=>[i.title,i.state],()=>this.scheduleRender(),P),e)}),this.scheduleRender()}_setupFeatureElementInfo(){var n;const{headingLevel:t,visibleElements:e}=this,i=e.description&&this.description,s=e.title&&this.title;(n=this._featureElementInfo)==null||n.set({description:i,title:s,headingLevel:t})}async _handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();const{state:t,showAllEnabled:e}=this.viewModel;await Qi(0),this._relatedFeatureIntersectionObserverNode&&t==="ready"&&e&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode)}_relatedFeatureIntersectionObserverCreated(t){this._relatedFeatureIntersectionObserverNode=t}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode)}};a([l()],X.prototype,"_relatedFeatureIntersectionObserverNode",void 0),a([l({readOnly:!0})],X.prototype,"displayShowAllButton",null),a([l({readOnly:!0})],X.prototype,"displayListItems",null),a([l()],X.prototype,"description",null),a([l({readOnly:!0})],X.prototype,"featureCountDescription",null),a([l()],X.prototype,"headingLevel",void 0),a([l()],X.prototype,"title",null),a([l({type:ei})],X.prototype,"viewModel",void 0),a([l(),te("esri/widgets/Feature/t9n/Feature")],X.prototype,"messages",void 0),a([l(),te("esri/t9n/common")],X.prototype,"messagesCommon",void 0),a([l()],X.prototype,"visibleElements",void 0),a([qe("visibleElements")],X.prototype,"castVisibleElements",null),X=a([N("esri.widgets.Feature.FeatureRelationship")],X);const $i=X;let Gr=class{constructor(e,i){this.preLayerQueryCallback=e,this.preRequestCallback=i,this.preLayerQueryCallback||(this.preLayerQueryCallback=s=>{}),this.preRequestCallback||(this.preLayerQueryCallback=s=>{})}};var Qe;const Xr=1,xi="content-view-models",Ti="relationship-view-models",ki={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0};let O=Qe=class extends Zi(fe){constructor(t){super(t),this._error=null,this._featureAbortController=null,this._graphicChangedThrottled=lt(this._graphicChanged,Xr,this),this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities={...ki},this.content=null,this.contentViewModels=[],this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.title="",this.view=null,this._isAllowedContentType=e=>{const{abilities:i}=this;return e.type==="attachments"&&!!i.attachmentsContent||e.type==="custom"&&!!i.customContent||e.type==="fields"&&!!i.fieldsContent||e.type==="media"&&!!i.mediaContent||e.type==="text"&&!!i.textContent||e.type==="expression"&&!!i.expressionContent||e.type==="relationship"&&!!i.relationshipContent},this.addHandles(_(()=>[this.graphic,this._effectivePopupTemplate,this.abilities,this.timeZone],()=>this._graphicChangedThrottled(),P))}initialize(){this.addHandles(this._graphicChangedThrottled)}destroy(){this._clear(),this._cancelFeatureQuery(),this._error=null,this.graphic=null,this._destroyContentViewModels(),this.relatedInfos.clear()}get _effectivePopupTemplate(){return this.graphic!=null?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return Wn(fi(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return Ji(this.graphic)}castAbilities(t){return{...ki,...t}}get isTable(){var t;return((t=this._sourceLayer)==null?void 0:t.isTable)||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}set graphic(t){this._set("graphic",(t==null?void 0:t.clone())??null)}get spatialReference(){var t;return((t=this.view)==null?void 0:t.spatialReference)??null}set spatialReference(t){this._override("spatialReference",t)}get timeZone(){var t;return((t=this.view)==null?void 0:t.timeZone)??js}set timeZone(t){this._overrideIfSome("timeZone",t)}get map(){var t;return((t=this.view)==null?void 0:t.map)||null}set map(t){this._override("map",t)}get waitingForContent(){return!!this._featureAbortController}setActiveMedia(t,e){const i=this.contentViewModels[t];i instanceof Ce&&i.setActiveMedia(e)}nextMedia(t){const e=this.contentViewModels[t];e instanceof Ce&&e.next()}previousMedia(t){const e=this.contentViewModels[t];e instanceof Ce&&e.previous()}async updateGeometry(){var o;const{graphic:t,spatialReference:e,_sourceLayer:i}=this;await(i==null?void 0:i.load());const s=i==null?void 0:i.objectIdField;if(!s||!t||!i)return;const n=(o=t==null?void 0:t.attributes)==null?void 0:o[s];if(n==null)return;const r=[n];if(!t.geometry){const d=await os({layer:i,graphic:t,outFields:[],objectIds:r,returnGeometry:!0,spatialReference:e}),c=d==null?void 0:d.geometry;c&&(t.geometry=c)}}_clear(){this._set("title",""),this._set("content",null),this._set("formattedAttributes",null)}async _graphicChanged(){this._cancelFeatureQuery(),this._error=null,this._clear();const{graphic:t}=this;if(!t)return;const e=new AbortController;this._featureAbortController=e;try{await this._queryFeature({signal:e.signal})}catch(i){Pt(i)||(this._error=i,z.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:i,graphic:t,popupTemplate:this._effectivePopupTemplate}))}this._featureAbortController===e&&(this._featureAbortController=null)}_cancelFeatureQuery(){const{_featureAbortController:t}=this;t&&t.abort(),this._featureAbortController=null}_compileContentElement(t,e){return t.type==="attachments"?this._compileAttachments(t,e):t.type==="custom"?this._compileCustom(t,e):t.type==="fields"?this._compileFields(t,e):t.type==="media"?this._compileMedia(t,e):t.type==="text"?this._compileText(t,e):t.type==="expression"?this._compileExpression(t,e):t.type==="relationship"?this._compileRelationship(t,e):void 0}_compileContent(t){if(this._destroyContentViewModels(),this.graphic)return Array.isArray(t)?t.filter(this._isAllowedContentType).map((e,i)=>this._compileContentElement(e,i)).filter(ht):typeof t=="string"?this._compileText(new Ui({text:t}),0).text:t}_destroyContentViewModels(){this.removeHandles(Ti),this.removeHandles(xi),this.contentViewModels.forEach(t=>t&&!t.destroyed&&t.destroy()),this._set("contentViewModels",[])}_matchesFeature(t,e){var n;const i=(n=t==null?void 0:t.graphic)==null?void 0:n.getObjectId(),s=e==null?void 0:e.getObjectId();return i!=null&&s!=null&&i===s}_setRelatedFeaturesViewModels({relatedFeatureViewModels:t,relatedFeatures:e,map:i}){const{view:s,spatialReference:n}=this;e==null||e.filter(Boolean).forEach(r=>{t.some(o=>this._matchesFeature(o,r))||t.add(new Qe({abilities:{relationshipContent:!1},map:i,view:s,spatialReference:n,graphic:r}))}),t.forEach(r=>{(e==null?void 0:e.find(d=>this._matchesFeature(r,d)))||t.remove(r)})}_setExpressionContentVM(t,e){const i=this.formattedAttributes,{contentElement:s,contentElementViewModel:n}=t,r=s==null?void 0:s.type;n&&r&&(r==="fields"&&(this._createFieldsFormattedAttributes({contentElement:s,contentElementIndex:e,formattedAttributes:i}),n.set(this._createFieldsVMParams(s,e))),r==="media"&&(this._createMediaFormattedAttributes({contentElement:s,contentElementIndex:e,formattedAttributes:i}),n.set(this._createMediaVMParams(s,e))),r==="text"&&n.set(this._createTextVMParams(s)))}_compileRelationship(t,e){const{displayCount:i,orderByFields:s,relationshipId:n,title:r,description:o}=t,{_sourceLayer:d,graphic:c,map:u}=this;if(!ss(d))return;const p=new ei({displayCount:i,graphic:c,orderByFields:s,relationshipId:n,layer:d,map:u,...this._compileTitleAndDesc({title:r,description:o})});return this.contentViewModels[e]=p,this.addHandles(Te(()=>p.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels(p)),Ti),t}_compileExpression(t,e){const{expressionInfo:i}=t,{graphic:s,map:n,spatialReference:r,view:o,location:d}=this,c=new Jt({expressionInfo:i,graphic:s,interceptor:Qe.interceptor,map:n,spatialReference:r,view:o,location:d});return this.contentViewModels[e]=c,this.addHandles(_(()=>c.contentElementViewModel,()=>this._setExpressionContentVM(c,e),P),xi),t}_compileAttachments(t,e){const{graphic:i}=this,{description:s,title:n}=t;return this.contentViewModels[e]=new Yt({graphic:i,...this._compileTitleAndDesc({title:n,description:s})}),t}_compileCustom(t,e){const{graphic:i}=this,{creator:s,destroyer:n}=t;return this.contentViewModels[e]=new ct({graphic:i,creator:s,destroyer:n}),t}_compileTitleAndDesc({title:t,description:e}){const{_fieldInfoMap:i,_sourceLayer:s,graphic:n,formattedAttributes:r}=this,o=n==null?void 0:n.attributes,d=this._expressionAttributes,c=r.global;return{title:Ae({attributes:o,fieldInfoMap:i,globalAttributes:c,expressionAttributes:d,layer:s,text:t}),description:Ae({attributes:o,fieldInfoMap:i,globalAttributes:c,expressionAttributes:d,layer:s,text:e})}}_createFieldsVMParams(t,e){const i=this._effectivePopupTemplate,s=this.formattedAttributes,n={...s==null?void 0:s.global,...s==null?void 0:s.content[e]},r=(t==null?void 0:t.fieldInfos)||(i==null?void 0:i.fieldInfos),o=r==null?void 0:r.filter(({fieldName:p})=>Zt(p)||me(p)||n.hasOwnProperty(p)),d=i==null?void 0:i.expressionInfos,{description:c,title:u}=t;return{attributes:n,expressionInfos:d,fieldInfos:o,...this._compileTitleAndDesc({title:u,description:c})}}_compileFields(t,e){const i=t.clone(),s=new mt(this._createFieldsVMParams(t,e));return this.contentViewModels[e]=s,i.fieldInfos=s.formattedFieldInfos.slice(0),i}_createMediaVMParams(t,e){const{abilities:i,graphic:s,_fieldInfoMap:n,_effectivePopupTemplate:r,relatedInfos:o,_sourceLayer:d,_expressionAttributes:c}=this,u=this.formattedAttributes,p=(s==null?void 0:s.attributes)??{},{description:m,mediaInfos:f,title:g}=t;return{abilities:{chartAnimation:i.chartAnimation},activeMediaInfoIndex:t.activeMediaInfoIndex||0,attributes:p,isAggregate:s==null?void 0:s.isAggregate,layer:d,fieldInfoMap:n,formattedAttributes:{...u==null?void 0:u.global,...u==null?void 0:u.content[e]},expressionAttributes:c,mediaInfos:f,popupTemplate:r,relatedInfos:o,...this._compileTitleAndDesc({title:g,description:m})}}_compileMedia(t,e){const i=t.clone(),s=new Ce(this._createMediaVMParams(t,e));return i.mediaInfos=s.formattedMediaInfos.slice(0),this.contentViewModels[e]=s,i}_createTextVMParams(t){var r;const{graphic:e,_fieldInfoMap:i,_sourceLayer:s,_expressionAttributes:n}=this;if(t&&t.text){const o=(e==null?void 0:e.attributes)??{},d=((r=this.formattedAttributes)==null?void 0:r.global)??{};t.text=Ae({attributes:o,fieldInfoMap:i,globalAttributes:d,expressionAttributes:n,layer:s,text:t.text})}return{graphic:e,creator:t.text}}_compileText(t,e){const i=t.clone();return this.contentViewModels[e]=new ct(this._createTextVMParams(i)),i}_compileLastEditInfo(){const{_effectivePopupTemplate:t,_sourceLayer:e,graphic:i,timeZone:s}=this;if(!t)return;const{lastEditInfoEnabled:n}=t,r=e==null?void 0:e.editFieldsInfo;return n&&r?zn(r,i==null?void 0:i.attributes,s,e):void 0}_compileTitle(t){var d;const{_fieldInfoMap:e,_sourceLayer:i,graphic:s,_expressionAttributes:n}=this,r=(s==null?void 0:s.attributes)??{},o=((d=this.formattedAttributes)==null?void 0:d.global)??{};return Ae({attributes:r,fieldInfoMap:e,globalAttributes:o,expressionAttributes:n,layer:i,text:t})}async _getTitle(){const{_effectivePopupTemplate:t,graphic:e}=this;if(!e)return null;const i=t==null?void 0:t.title;return dt(i,{graphic:e})}async _getContent(){const{_effectivePopupTemplate:t,graphic:e}=this;if(!e)return null;const i=t==null?void 0:t.content;return dt(i,{graphic:e})}async _queryFeature(t){const{_featureAbortController:e,_sourceLayer:i,graphic:s,_effectivePopupTemplate:n}=this,r=this.map,o=this.view,d=this.spatialReference,c=this.location;if(e!==this._featureAbortController||!s)return;await jn({graphic:s,popupTemplate:n,layer:i,spatialReference:d},t);const{content:{value:u},title:{value:p}}=await Le({content:this._getContent(),title:this._getTitle()}),{expressionAttributes:{value:m}}=await Le({checkForRelatedFeatures:this._checkForRelatedFeatures(t),expressionAttributes:jr({expressionInfos:n==null?void 0:n.expressionInfos,spatialReference:d,graphic:s,map:r,interceptor:Qe.interceptor,view:o,options:t,location:c})});e===this._featureAbortController&&s&&(this._expressionAttributes=m,this._graphicExpressionAttributes={...s.attributes,...m},this._set("formattedAttributes",this._createFormattedAttributes(u)),this._set("title",this._compileTitle(p)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(u)||null))}_createMediaFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:i}){const{_effectivePopupTemplate:s,graphic:n,relatedInfos:r,_sourceLayer:o,_fieldInfoMap:d,_graphicExpressionAttributes:c,timeZone:u}=this;i.content[e]=Mt({fieldInfos:s==null?void 0:s.fieldInfos,graphic:n,attributes:{...c,...t.attributes},layer:o,fieldInfoMap:d,relatedInfos:r,timeZone:u})}_createFieldsFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:i}){if(t.fieldInfos){const{graphic:s,relatedInfos:n,_sourceLayer:r,_fieldInfoMap:o,_graphicExpressionAttributes:d,timeZone:c}=this;i.content[e]=Mt({fieldInfos:t.fieldInfos,graphic:s,attributes:{...d,...t.attributes},layer:r,fieldInfoMap:o,relatedInfos:n,timeZone:c})}}_createFormattedAttributes(t){const{_effectivePopupTemplate:e,graphic:i,relatedInfos:s,_sourceLayer:n,_fieldInfoMap:r,_graphicExpressionAttributes:o,timeZone:d}=this,c=e==null?void 0:e.fieldInfos,u={global:Mt({fieldInfos:c,graphic:i,attributes:o,layer:n,fieldInfoMap:r,relatedInfos:s,timeZone:d}),content:[]};return Array.isArray(t)&&t.forEach((p,m)=>{p.type==="fields"&&this._createFieldsFormattedAttributes({contentElement:p,contentElementIndex:m,formattedAttributes:u}),p.type==="media"&&this._createMediaFormattedAttributes({contentElement:p,contentElementIndex:m,formattedAttributes:u})}),u}_checkForRelatedFeatures(t){const{graphic:e,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(e,fi(i),t)}async _queryRelatedInfos(t,e,i){const{relatedInfos:s,_sourceLayer:n}=this;s.clear();const r=(n==null?void 0:n.associatedLayer)!=null?await(n==null?void 0:n.associatedLayer.load(i)):n;if(!r||!t)return;const o=e.filter(u=>u&&me(u.fieldName));if(!(o!=null&&o.length))return;e.forEach(u=>this._configureRelatedInfo(u,r));const d=await Tr({relatedInfos:s,layer:r},i);Object.keys(d).forEach(u=>{var f;const p=s.get(u.toString()),m=(f=d[u])==null?void 0:f.value;p&&m&&(p.layerInfo=m.data)});const c=await kr({graphic:t,relatedInfos:s,layer:r},i);Object.keys(c).forEach(u=>{var p;Ir((p=c[u])==null?void 0:p.value,s.get(u.toString()))})}_configureRelatedInfo(t,e){const{relatedInfos:i}=this,s=st(t.fieldName);if(!s)return;const{layerId:n,fieldName:r}=s;if(!n)return;const o=i.get(n.toString())||Mr(n,e);o&&(Lr({relatedInfo:o,fieldName:r,fieldInfo:t}),this.relatedInfos.set(n,o))}};O.interceptor=new Gr(Qn,Gn),a([l()],O.prototype,"_error",void 0),a([l()],O.prototype,"_featureAbortController",void 0),a([l({readOnly:!0})],O.prototype,"_effectivePopupTemplate",null),a([l({readOnly:!0})],O.prototype,"_fieldInfoMap",null),a([l({readOnly:!0})],O.prototype,"_sourceLayer",null),a([l()],O.prototype,"abilities",void 0),a([qe("abilities")],O.prototype,"castAbilities",null),a([l({readOnly:!0})],O.prototype,"content",void 0),a([l({readOnly:!0})],O.prototype,"contentViewModels",void 0),a([l()],O.prototype,"description",void 0),a([l({type:Boolean})],O.prototype,"defaultPopupTemplateEnabled",void 0),a([l({readOnly:!0})],O.prototype,"isTable",null),a([l({readOnly:!0})],O.prototype,"state",null),a([l({readOnly:!0})],O.prototype,"formattedAttributes",void 0),a([l({type:ze,value:null})],O.prototype,"graphic",null),a([l({readOnly:!0})],O.prototype,"lastEditInfo",void 0),a([l({type:Ht})],O.prototype,"location",void 0),a([l({readOnly:!0})],O.prototype,"relatedInfos",void 0),a([l()],O.prototype,"spatialReference",null),a([l()],O.prototype,"timeZone",null),a([l({readOnly:!0})],O.prototype,"title",void 0),a([l()],O.prototype,"map",null),a([l({readOnly:!0})],O.prototype,"waitingForContent",null),a([l()],O.prototype,"view",void 0),O=Qe=a([N("esri.widgets.Feature.FeatureViewModel")],O);const ti=O,W="esri-feature",V={base:W,container:`${W}__size-container`,title:`${W}__title`,main:`${W}__main-container`,btn:`${W}__button`,icon:`${W}__icon`,content:`${W}__content`,contentNode:`${W}__content-node`,contentNodeText:`${W}__content-node--text`,contentElement:`${W}__content-element`,text:`${W}__text`,lastEditedInfo:`${W}__last-edited-info`,fields:`${W}__fields`,fieldHeader:`${W}__field-header`,fieldData:`${W}__field-data`,fieldDataDate:`${W}__field-data--date`,loadingSpinnerContainer:`${W}__loading-container`,spinner:`${W}__loading-spinner`},fs=t=>{let e=class extends t{constructor(){super(...arguments),this.renderNodeContent=i=>cs(i)&&!i.destroyed?h("div",{class:V.contentNode,key:i},i.render()):i instanceof HTMLElement?h("div",{afterCreate:this._attachToNode,bind:i,class:V.contentNode,key:i}):sr(i)?h("div",{afterCreate:this._attachToNode,bind:i.domNode,class:V.contentNode,key:i}):null}_attachToNode(i){const s=this;i.appendChild(s)}};return e=a([N("esri.widgets.Feature.ContentMixin")],e),e};var Dt;const Li={title:!0,content:!0,lastEditedInfo:!0},Ri="relationship-handles";let q=Dt=class extends fs(ie){constructor(t,e){super(t,e),this._contentWidgets=[],this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.visibleElements={...Li},this.viewModel=new ti}initialize(){this.addHandles(_(()=>{var t;return(t=this.viewModel)==null?void 0:t.contentViewModels},()=>this._setupContentWidgets(),P))}loadDependencies(){return We({notice:()=>E(()=>import("./calcite-notice-Bu--C1Vt.js"),__vite__mapDeps([84,2,3,85,6,4,5,73,74,86,79,1]))})}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(t){this.viewModel.graphic=t}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(t){this.viewModel.defaultPopupTemplateEnabled=t}get isTable(){return this.viewModel.isTable}get label(){var t;return((t=this.messages)==null?void 0:t.widgetLabel)??""}set label(t){this._overrideIfSome("label",t)}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(t){this.viewModel.spatialReference=t}get timeZone(){return this.viewModel.timeZone}set timeZone(t){this.viewModel.timeZone=t}get title(){return this.viewModel.title}castVisibleElements(t){return{...Li,...t}}get map(){return this.viewModel.map}set map(t){this.viewModel.map=t}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}setActiveMedia(t,e){return this.viewModel.setActiveMedia(t,e)}nextMedia(t){return this.viewModel.nextMedia(t)}previousMedia(t){return this.viewModel.previousMedia(t)}render(){const{state:t}=this.viewModel,e=h("div",{class:V.container,key:"container"},this._renderTitle(),t==="error"?this._renderError():t==="loading"?this._renderLoading():this._renderContentContainer());return h("div",{class:this.classes(V.base,I.widget)},e)}_renderError(){const{messagesCommon:t,messages:e,visibleElements:i}=this;return h("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0,scale:"s"},i.title?h("div",{key:"error-title",slot:"title"},t.errorMessage):null,h("div",{key:"error-message",slot:"message"},e.loadingError))}_renderLoading(){return h("div",{class:V.loadingSpinnerContainer,key:"loading-container"},h("span",{class:this.classes(re.loadingIndicator,I.rotating,V.spinner)}))}_renderContentContainer(){const{visibleElements:t}=this;return t.content?h("div",{class:V.main},[this._renderContent(),this._renderLastEditInfo()]):null}_renderTitle(){const{visibleElements:t,title:e}=this;return t.title?h(Kt,{class:V.title,innerHTML:e,level:this.headingLevel}):null}_renderContent(){const t=this.viewModel.content,e="content";if(!t)return null;if(Array.isArray(t))return t.length?h("div",{class:V.contentNode,key:`${e}-content-elements`},t.map(this._renderContentElement,this)):null;if(typeof t=="string"){const i=this._contentWidgets[0];return!i||i.destroyed?null:h("div",{class:this.classes(V.contentNode,V.contentNodeText),key:`${e}-content`},i.render())}return this.renderNodeContent(t)}_renderContentElement(t,e){var s;const{visibleElements:i}=this;if(typeof i.content!="boolean"&&!((s=i.content)!=null&&s[t.type]))return null;switch(t.type){case"attachments":return this._renderAttachments(e);case"custom":return this._renderCustom(t,e);case"fields":return this._renderFields(e);case"media":return this._renderMedia(e);case"text":return this._renderText(t,e);case"expression":return this._renderExpression(e);case"relationship":return this._renderRelationship(e);default:return null}}_renderAttachments(t){const e=this._contentWidgets[t];if(!e||e.destroyed)return null;const{state:i,attachmentInfos:s}=e.viewModel;return i==="loading"||s.length>0?h("div",{class:this.classes(V.contentElement),key:this._buildKey("attachments-element",t)},e.render()):null}_renderRelationship(t){const e=this._contentWidgets[t];return e&&!e.destroyed&&this.flowItems?h("div",{class:V.contentElement,key:this._buildKey("relationship-element",t)},e.render()):null}_renderExpression(t){const e=this._contentWidgets[t];return!e||e.destroyed?null:h("div",{class:V.contentElement,key:this._buildKey("expression-element",t)},e.render())}_renderCustom(t,e){const{creator:i}=t,s=this._contentWidgets[e];return!s||s.destroyed?null:i?h("div",{class:V.contentElement,key:this._buildKey("custom-element",e)},s.render()):null}_renderFields(t){const e=this._contentWidgets[t];return!e||e.destroyed?null:h("div",{class:V.contentElement,key:this._buildKey("fields-element",t)},e.render())}_renderMedia(t){const e=this._contentWidgets[t];return!e||e.destroyed?null:h("div",{class:V.contentElement,key:this._buildKey("media-element",t)},e.render())}_renderLastEditInfo(){const{visibleElements:t,messages:e}=this,{lastEditInfo:i}=this.viewModel;if(!i||!t.lastEditedInfo)return null;const{date:s,user:n}=i,r=i.type==="edit"?n?e.lastEditedByUser:e.lastEdited:n?e.lastCreatedByUser:e.lastCreated,o=ce(r,{date:s,user:n});return h("div",{class:this.classes(V.lastEditedInfo,V.contentElement),key:"edit-info-element"},o)}_renderText(t,e){const i=t.text,s=this._contentWidgets[e];return!s||s.destroyed?null:i?h("div",{class:this.classes(V.contentElement,V.text),key:this._buildKey("text-element",e)},s.render()):null}_buildKey(t,...e){var i,s;return`${t}__${((s=(i=this.viewModel)==null?void 0:i.graphic)==null?void 0:s.uid)||"0"}-${e.join("-")}`}_destroyContentWidget(t){t&&(t.viewModel=null,!t.destroyed&&t.destroy())}_destroyContentWidgets(){this.removeHandles(Ri),this._contentWidgets.forEach(t=>this._destroyContentWidget(t)),this._contentWidgets=[]}_addFeatureRelationshipHandles(t){const{flowItems:e,visibleElements:i}=this;this.addHandles([Te(()=>t,"select-record",({featureViewModel:s})=>{e&&(s.abilities={relationshipContent:!0},e.push(new Dt({flowItems:e,viewModel:s,visibleElements:i})))}),Te(()=>t,"show-all-records",()=>{if(!e)return;const{viewModel:s}=t;s.showAllEnabled=!0;const n=new $i({visibleElements:{title:!1,description:!1},viewModel:s});this._addFeatureRelationshipHandles(n),e.push(n)})],Ri)}_setupContentWidgets(){var n;this._destroyContentWidgets();const{headingLevel:t,visibleElements:e}=this,i=(n=this.viewModel)==null?void 0:n.content,{contentViewModels:s}=this.viewModel;if(Array.isArray(i))i.forEach((r,o)=>{if(r.type==="attachments"&&(this._contentWidgets[o]=new tr({displayType:r.displayType,headingLevel:e.title?t+1:t,viewModel:s[o]})),r.type==="fields"&&(this._contentWidgets[o]=new us({viewModel:s[o]})),r.type==="media"&&(this._contentWidgets[o]=new hs({viewModel:s[o]})),r.type==="text"&&(this._contentWidgets[o]=new it({viewModel:s[o]})),r.type==="custom"&&(this._contentWidgets[o]=new it({viewModel:s[o]})),r.type==="expression"&&(this._contentWidgets[o]=new Zr({viewModel:s[o]})),r.type==="relationship"){const d=new $i({viewModel:s[o]});this._addFeatureRelationshipHandles(d),this._contentWidgets[o]=d}},this);else{const r=s[0];r&&!r.destroyed&&(this._contentWidgets[0]=new it({viewModel:r}))}this.scheduleRender()}};a([l()],q.prototype,"graphic",null),a([l()],q.prototype,"defaultPopupTemplateEnabled",null),a([l()],q.prototype,"flowItems",void 0),a([l()],q.prototype,"headingLevel",void 0),a([l({readOnly:!0})],q.prototype,"isTable",null),a([l()],q.prototype,"label",null),a([l(),te("esri/widgets/Feature/t9n/Feature")],q.prototype,"messages",void 0),a([l(),te("esri/t9n/common")],q.prototype,"messagesCommon",void 0),a([l()],q.prototype,"spatialReference",null),a([l()],q.prototype,"timeZone",null),a([l({readOnly:!0})],q.prototype,"title",null),a([l()],q.prototype,"visibleElements",void 0),a([qe("visibleElements")],q.prototype,"castVisibleElements",null),a([l()],q.prototype,"map",null),a([l()],q.prototype,"view",null),a([l({type:ti})],q.prototype,"viewModel",void 0),q=Dt=a([N("esri.widgets.Feature")],q);const Yr=q;let be=class extends Us.EventedAccessor{constructor(e){super(e),this.location=null,this.screenLocationEnabled=!1,this.view=null,this.addHandles([at(()=>{const i=this.screenLocationEnabled?this.view:null;return i?[i.size,i.type==="3d"?i.camera:i.viewpoint]:null},()=>this.notifyChange("screenLocation")),_(()=>this.screenLocation,(i,s)=>{i!=null&&s!=null&&this.emit("view-change")})])}destroy(){this.view=null}get screenLocation(){const{location:e,view:i,screenLocationEnabled:s}=this,n=i==null?void 0:i.spatialReference,r=n?Zs(e,n).geometry:null;return s&&r&&(i!=null&&i.ready)?i.toScreen(r):null}};a([l()],be.prototype,"location",void 0),a([l()],be.prototype,"screenLocation",null),a([l()],be.prototype,"screenLocationEnabled",void 0),a([l()],be.prototype,"view",void 0),be=a([N("esri.widgets.support.AnchorElementViewModel")],be);const gs=be,Kr="esri.widgets.CompassViewModel";let rt=class extends gs{constructor(e){super(e),this.visible=!1}};a([l()],rt.prototype,"visible",void 0),rt=a([N(Kr)],rt);const _s=rt,Lt="esri-spinner",Rt={base:Lt,spinnerStart:`${Lt}--start`,spinnerFinish:`${Lt}--finish`};let Me=class extends ie{constructor(e,i){super(e,i),this._animationDelay=500,this._animationPromise=null,this.viewModel=new _s}initialize(){this.addHandles(_(()=>this.visible,e=>this._visibleChange(e)))}destroy(){this._animationPromise=null}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}show(e){const{location:i,promise:s}=e??{};i&&(this.viewModel.location=i),this.visible=!0;const n=()=>this.hide();s&&s.catch(()=>{}).then(n)}hide(){this.visible=!1}render(){const{visible:e}=this,{screenLocation:i}=this.viewModel,s=!!i,n=e&&s,r=!e&&s,o={[Rt.spinnerStart]:n,[Rt.spinnerFinish]:r},d=this._getPositionStyles();return h("div",{class:this.classes(Rt.base,o),styles:d})}_visibleChange(e){if(e)return void(this.viewModel.screenLocationEnabled=!0);const i=Qi(this._animationDelay);this._animationPromise=i,i.catch(()=>{}).then(()=>{this._animationPromise===i&&(this.viewModel.screenLocationEnabled=!1,this._animationPromise=null)})}_getPositionStyles(){const{screenLocation:e,view:i}=this.viewModel;if(i==null||e==null)return{};const{padding:s}=i;return{left:e.x-s.left+"px",top:e.y-s.top+"px"}}};a([l()],Me.prototype,"location",null),a([l()],Me.prototype,"view",null),a([l({type:_s})],Me.prototype,"viewModel",void 0),a([l()],Me.prototype,"visible",null),Me=a([N("esri.widgets.Spinner")],Me);const Jr=Me,U="esri-features",H={icon:`${U}__icon`,actionImage:`${U}__action-image`,base:U,container:`${U}__container`,contentContainer:`${U}__content-container`,contentFeature:`${U}__content-feature`,flowItemCollapsed:`${U}__flow-item--collapsed`,header:`${U}__header`,footer:`${U}__footer`,featureMenuObserver:`${U}__feature-menu-observer`,actionExit:`${U}__action--exit`,loader:`${U}__loader`,featuresHeading:`${U}__heading`,paginationActionBar:`${U}__pagination-action-bar`,paginationPrevious:`${U}__pagination-previous`,paginationNext:`${U}__pagination-next`};let Ie=class extends ie{constructor(e,i){super(e,i),this.messages=null,this.closed=!1,this.closable=!0,this._handleOpenRelatedFeature=s=>{this.emit("open-related-feature",{feature:s})}}loadDependencies(){return We({action:()=>E(()=>import("./calcite-action-xwwomTuE.js"),__vite__mapDeps([87,83,2,3,4,5,71,73,74,6,79,1,80])),"flow-item":()=>E(()=>import("./calcite-flow-item-aWVm4yY6.js"),__vite__mapDeps([88,2,3,4,5,71,73,74,6,89,83,79,1,80,75,90,86,81]))})}render(){const{flowItems:e}=this,i=e==null?void 0:e.toArray();return h(Qs,null,i==null?void 0:i.map(s=>this._renderRelatedRecordsFlowItem(s)))}_handleCloseClick(){this.emit("close")}_handleExitClick(){this.emit("exit")}_handleRelatedRecordsBackClick(){var i;const e=(i=this.flowItems)==null?void 0:i.pop();e&&("showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e&&(e.viewModel=null,e.destroy()))}_renderRelatedRecordsFlowItem(e){const{messages:i,closable:s,closed:n}=this,r="graphic"in e&&!e.isTable;return h("calcite-flow-item",{bind:this,closable:s,closed:n,description:this._getRelatedRecordsFlowItemDescription(e),heading:e.title??"",key:`flow-item-${e.viewModel.uid}`,onCalciteFlowItemBack:o=>{o.preventDefault(),this._handleRelatedRecordsBackClick()},onCalciteFlowItemClose:this._handleCloseClick},h("calcite-action",{appearance:"transparent",bind:this,class:H.actionExit,icon:"move-up",key:"exit-related-records-action",label:i.exitRelatedRecords,onclick:this._handleExitClick,scale:"m",slot:"header-actions-start",text:i.exitRelatedRecords,title:i.exitRelatedRecords}),r?h("calcite-action",{appearance:"transparent",bind:this,icon:"zoom-to-object",key:"open-related-feature-action",label:i.selectFeature,onclick:()=>this._handleOpenRelatedFeature(e),scale:"m",slot:"header-actions-end",text:i.selectFeature,title:i.selectFeature}):null,h("div",{class:H.container},e.render()))}_getRelatedRecordsFlowItemDescription(e){return"featureCountDescription"in e?e.featureCountDescription:e.viewModel.description??""}};a([l()],Ie.prototype,"flowItems",void 0),a([l(),te("esri/widgets/Features/t9n/Features")],Ie.prototype,"messages",void 0),a([l()],Ie.prototype,"closed",void 0),a([l()],Ie.prototype,"closable",void 0),Ie=a([N("esri.widgets.Features.FeaturesRelatedRecords")],Ie);const eo=Ie;let to=class{constructor(e){this._observable=new Gs,this._set=new Set(e)}get size(){return ve(this._observable),this._set.size}add(e){const i=this._set.size;return this._set.add(e),this._set.size!==i&&this._observable.notify(),this}clear(){this._set.size>0&&(this._set.clear(),this._observable.notify())}delete(e){const i=this._set.delete(e);return i&&this._observable.notify(),i}entries(){return ve(this._observable),this._set.entries()}forEach(e,i){ve(this._observable),this._set.forEach((s,n)=>e.call(i,s,n,this),i)}has(e){return ve(this._observable),this._set.has(e)}keys(){return ve(this._observable),this._set.keys()}values(){return ve(this._observable),this._set.values()}[Symbol.iterator](){return ve(this._observable),this._set[Symbol.iterator]()}get[Symbol.toStringTag](){return this._set[Symbol.toStringTag]}};const Pi="OBJECTID";var Re;(function(t){t[t.size=22]="size",t[t.lineWidth=50]="lineWidth",t[t.maxSize=120]="maxSize",t[t.maxOutlineSize=80]="maxOutlineSize",t[t.tallSymbolWidth=20]="tallSymbolWidth"})(Re||(Re={}));const Oi=Gi("android");Gi("chrome")||Oi&&Oi>=4;Xs();Re.size;Re.maxSize;Re.maxOutlineSize;Re.lineWidth;Re.tallSymbolWidth;function ys(t){return t&&"opacity"in t?t.opacity*ys(t.parent):1}async function Ni(t,e){var k;if(!t)return;const i=t.sourceLayer,s=(e!=null&&e.useSourceLayer?i:t.layer)??i,n=ys(s);if(t.symbol!=null&&(e==null||e.ignoreGraphicSymbol!==!0)){const M=t.symbol.type==="web-style"?await dn(t.symbol,{...e,cache:e!=null?e.webStyleCache:null}):t.symbol.clone();return vt(M,null,n),M}const r=(e==null?void 0:e.renderer)??io(s);let o=r&&"getSymbolAsync"in r?await r.getSymbolAsync(t,e):null;if(!o)return;if(o=o.type==="web-style"?await o.fetchSymbol({...e,cache:e!=null?e.webStyleCache:null}):o.clone(),!r||!("visualVariables"in r)||!((k=r.visualVariables)!=null&&k.length))return vt(o,null,n),o;if("arcadeRequiredForVisualVariables"in r&&r.arcadeRequiredForVisualVariables&&(e==null?void 0:e.arcade)==null){const M={...e};M.arcade=await Wi(),e=M}const{getColor:d,getOpacity:c,getAllSizes:u,getRotationAngle:p}=await E(()=>import("./visualVariableUtils-BX9G5gNQ.js"),__vite__mapDeps([7,2,3,8])),m=[],f=[],g=[],y=[];for(const M of r.visualVariables)switch(M.type){case"color":m.push(M);break;case"opacity":f.push(M);break;case"rotation":y.push(M);break;case"size":M.target||g.push(M)}const v=!!m.length&&m[m.length-1],F=v?d(v,t,e):null,w=!!f.length&&f[f.length-1];let C=w?c(w,t,e):null;if(n!=null&&(C=C!=null?C*n:n),vt(o,F,C),g.length){const M=u(g,t,e);await cn(o,M)}for(const M of y)un(o,p(M,t,e),M.axis);return o}function io(t){if(t)return"renderer"in t?t.renderer:void 0}function Vi(t){return t&&typeof t.highlight=="function"}const $e=Be.ofType({key:"type",defaultKeyValue:"button",base:Ys,typeMap:{button:Xe,toggle:Xi}}),Ee=new Xe({icon:"magnifying-glass-plus",id:"zoom-to-feature",title:"{messages.zoom}",className:re.zoomInMagnifyingGlass}),Si=new Xe({icon:"trash",id:"remove-selected-feature",title:"{messages.remove}",className:re.trash}),Se=new Xe({icon:"magnifying-glass-plus",id:"zoom-to-clustered-features",title:"{messages.zoom}",className:re.zoomInMagnifyingGlass}),ye=new Xi({icon:"table",id:"browse-clustered-features",title:"{messages.browseClusteredFeatures}",className:re.table,value:!1}),so="esri.widgets.Popup.PopupViewModel",ut=()=>z.getLogger(so),no=t=>{const{event:e,view:i,viewModel:s}=t,{action:n}=e;if(!n)return Promise.reject(new R("trigger-action:missing-arguments","Event has no action"));const{disabled:r,id:o}=n;if(!o)return Promise.reject(new R("trigger-action:invalid-action","action.id is missing"));if(r)return Promise.reject(new R("trigger-action:invalid-action","Action is disabled"));if(o===Ee.id)return oo(s).catch(Ks);if(o===Se.id)return ao(s);if(o===ye.id)return s.browseClusterEnabled=!s.browseClusterEnabled,s.featureMenuOpen=s.browseClusterEnabled,Promise.resolve();if(o===Si.id){s.visible=!1;const{selectedFeature:d}=s;if(!d)return Promise.reject(new R(`trigger-action:${Si.id}`,"selectedFeature is required",{selectedFeature:d}));const{sourceLayer:c}=d;return c?c.remove(d):i==null||i.graphics.remove(d),Promise.resolve()}return Promise.resolve()};function vs(t){const{selectedFeature:e,location:i,view:s}=t;return s?e??i??null:null}function Fe(t){var e,i;return!!t&&t.isAggregate&&((i=(e=t.sourceLayer)==null?void 0:e.featureReduction)==null?void 0:i.type)==="cluster"}async function ro(t,e){if((e==null?void 0:e.type)!=="3d"||!t||t.declaredClass!=="esri.Graphic")return!0;const i=e.getViewForGraphic(t);if(i&&"whenGraphicBounds"in i){let s=null;try{s=await i.whenGraphicBounds(t,{useViewElevation:!0})}catch{}return!s||!s.boundingBox||s.boundingBox[0]===s.boundingBox[3]&&s.boundingBox[1]===s.boundingBox[4]&&s.boundingBox[2]===s.boundingBox[5]}return!0}async function oo(t){var p;const{location:e,selectedFeature:i,view:s,zoomFactor:n}=t,r=vs(t);if(!s||!r){const m=new R("zoom-to:invalid-target-or-view","Cannot zoom to location without a target and view.",{target:r,view:s});throw ut().error(m),m}const o=s.scale/n,d=(p=t.selectedFeature)==null?void 0:p.geometry,c=d??e,u=c!=null&&c.type==="point"&&await ro(i,s);Ee.active=!0,Ee.disabled=!0;try{await t.zoomTo({target:{target:r,scale:u?o:void 0}})}catch{const f=new R("zoom-to:invalid-graphic","Could not zoom to the location of the graphic.",{graphic:i});ut().error(f)}finally{Ee.active=!1,Ee.disabled=!1,t.zoomToLocation=null,u&&(t.location=c)}}async function ao(t){const{selectedFeature:e,view:i}=t;if((i==null?void 0:i.type)!=="2d"){const o=new R("zoomToCluster:invalid-view","View must be 2d MapView.",{view:i});throw ut().error(o),o}if(!e||!Fe(e)){const o=new R("zoomToCluster:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:e});throw ut().error(o),o}const[s,n]=await ii(i,e);Se.active=!0,Se.disabled=!0;const{extent:r}=await s.queryExtent(n);r&&await t.zoomTo({target:r}),Se.active=!1,Se.disabled=!1}async function lo(t){const{view:e,selectedFeature:i}=t;if(!e||!i)return;const[s,n]=await ii(e,i),{extent:r}=await s.queryExtent(n);t.selectedClusterBoundaryFeature.geometry=r,e.graphics.add(t.selectedClusterBoundaryFeature)}async function co(t){const{selectedFeature:e,view:i}=t;if(!i||!e)return;const[s,n]=await ii(i,e);ye.active=!0,ye.disabled=!0;const{features:r}=await s.queryFeatures(n);ye.active=!1,ye.disabled=!1,ye.value=!0,t==null||t.open({features:[e].concat(r),featureMenuOpen:!0})}async function ii(t,e){const i=await t.whenLayerView(e.sourceLayer),s=i.createQuery(),n=e.getObjectId();return s.aggregateIds=n!=null?[n]:[],[i,s]}function uo(t){ye.value=!1;const e=t.features.filter(i=>Fe(i));e.length&&(t.features=e)}const ho=()=>[Ee.clone()],po=()=>[Se.clone(),ye.clone()];let et=null;function mo(t,e){return t==="building-scene"||e==="2d"&&(t==="map-image"||t==="tile"||t==="imagery"||t==="imagery-tile")}let A=class extends Js(gs){constructor(t){super(t),this._pendingPromises=new to,this._fetchFeaturesController=null,this._highlightSelectedFeaturePromise=null,this._highlightActiveFeaturePromise=null,this._selectedClusterFeature=null,this._locationScaleHandle=null,this.actions=new $e,this.activeFeature=null,this.autoCloseEnabled=!1,this.autoOpenEnabled=!0,this.browseClusterEnabled=!1,this.content=null,this.defaultPopupTemplateEnabled=!1,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureViewModelAbilities=null,this.featureViewModels=[],this.highlightEnabled=!0,this.includeDefaultActions=!0,this.selectedClusterBoundaryFeature=new ze({symbol:new en({outline:{width:1.5,color:"cyan"},style:"none"})}),this.title=null,this.updateLocationEnabled=!1,this.view=null,this.visible=!1,this.zoomFactor=4,this.zoomToLocation=null,this._debouncedLocationUpdate=tt(async e=>{var r,o,d;const{view:i}=this,s=(o=(r=this.selectedFeature)==null?void 0:r.geometry)==null?void 0:o.type,n=this.location??e;if(s!=="mesh"&&i&&n&&this.selectedFeature)if(s!=="point")try{const{pendingFeatures:c}=await this._fetchFeaturesWithController({mapPoint:n}),u=(await Promise.all(c)).flat().filter(Boolean);if(!u.length)return;if(u.length!==this.features.length){const g=this._getHighlightLayer(this.selectedFeature),y=(g==null?void 0:g.type)==="imagery"?void 0:g&&"objectIdField"in g?g.objectIdField||Pi:null;if(y){const v=this.selectedFeature.getObjectId(),F=u.findIndex(w=>{const C=this._getHighlightLayer(w);return(C==null?void 0:C.uid)===(g==null?void 0:g.uid)&&w.attributes[y]===v});this.features=u,this.selectedFeatureIndex=F}}const p=(d=u[this.selectedFeatureIndex])==null?void 0:d.geometry,m=((p==null?void 0:p.type)!=="mesh"?p:null)??this.selectedFeature.geometry,f=m?tn(m,i.spatialReference):null;if(!f)return;et||(et=await E(()=>import("./geometryEngineAsync-wvmuP1s9.js"),__vite__mapDeps([91,2,3]))),await et.intersects(f,n)||(this.location=(await et.nearestCoordinate(f,n)).coordinate??n)}catch(c){Pt(c)||z.getLogger(this).error(c)}else this.location=Nt(this.selectedFeature.geometry)??n})}initialize(){this.addHandles([this.on("view-change",()=>this._autoClose()),_(()=>[this.highlightEnabled,this.selectedFeature,this.visible,this.view],()=>this._highlightSelectedFeature()),_(()=>[this.highlightEnabled,this.activeFeature,this.visible,this.view],()=>this._highlightActiveFeature()),_(()=>{var t,e;return(e=(t=this.view)==null?void 0:t.animation)==null?void 0:e.state},t=>this._animationStateChange(t)),_(()=>this.location,t=>this._locationChange(t)),_(()=>this.selectedFeature,t=>this._selectedFeatureChange(t)),_(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),_(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureViewModels],()=>this._setGraphicOnFeatureViewModels()),_(()=>this.featureViewModels,()=>this._featureViewModelsChange()),this.on("trigger-action",t=>no({event:t,viewModel:this,view:this.view})),at(()=>!this.waitingForResult,()=>this._waitingForResultChange(),sn),_(()=>{var t,e,i;return[this.features,(t=this.view)==null?void 0:t.map,(e=this.view)==null?void 0:e.spatialReference,(i=this.view)==null?void 0:i.timeZone]},()=>this._updateFeatureVMs()),_(()=>{var t;return(t=this.view)==null?void 0:t.scale},()=>this._viewScaleChange()),at(()=>!this.visible,()=>this.browseClusterEnabled=!1),_(()=>this.browseClusterEnabled,t=>t?this.enableClusterBrowsing():this.disableClusterBrowsing())])}destroy(){var t;this._cancelFetchingFeatures(),this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null,(t=this._locationScaleHandle)==null||t.remove(),this._locationScaleHandle=null}get active(){return!(!this.visible||this.waitingForResult)}get allActions(){const t=this._get("allActions")||new $e;t.removeAll();const{actions:e,defaultActions:i,defaultPopupTemplateEnabled:s,includeDefaultActions:n,selectedFeature:r}=this,o=n?i.concat(e):e,d=r&&(typeof r.getEffectivePopupTemplate=="function"&&r.getEffectivePopupTemplate(s)||r.popupTemplate),c=d==null?void 0:d.actions,u=d!=null&&d.overwriteActions?c:(c==null?void 0:c.concat(o))??o;return u==null||u.filter(Boolean).forEach(p=>t.add(p)),t}get defaultActions(){const t=this._get("defaultActions")||new $e;return t.removeAll(),t.addMany(Fe(this.selectedFeature)?po():ho()),t}get featureCount(){return this.features.length}set features(t){const e=t||[];this._set("features",e);const{pendingPromisesCount:i,promiseCount:s,selectedFeatureIndex:n}=this,r=s&&e.length;r&&i&&n===-1?this.selectedFeatureIndex=0:r&&n!==-1||(this.selectedFeatureIndex=e.length?0:-1)}set location(t){var n,r,o;let e=t;const i=(r=(n=this.view)==null?void 0:n.spatialReference)==null?void 0:r.isWebMercator;((o=t==null?void 0:t.spatialReference)==null?void 0:o.isWGS84)&&i&&(e=nn(t)),this._set("location",e)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(t){this._pendingPromises.clear(),this.features=[],Array.isArray(t)&&t.length?(this._set("promises",t),(t=t.slice(0)).forEach(e=>this._pendingPromises.add(e)),t.reduce((e,i)=>e.finally(()=>i.then(s=>{this._pendingPromises.has(i)&&this._updateFeatures(s)}).finally(()=>this._pendingPromises.delete(i)).catch(()=>{})),Promise.resolve())):this._set("promises",[])}get selectedFeature(){const{features:t,selectedFeatureIndex:e}=this;return e===-1?null:t[e]||null}get selectedFeatureIndex(){const t=this._get("selectedFeatureIndex");return typeof t=="number"?t:-1}set selectedFeatureIndex(t){const{featureCount:e}=this;t=isNaN(t)||t<-1||!e?-1:(t+e)%e,this.activeFeature=null,this._set("selectedFeatureIndex",t)}get selectedFeatureViewModel(){return this.featureViewModels[this.selectedFeatureIndex]||null}get state(){var t;return(t=this.view)!=null&&t.ready?"ready":"disabled"}get waitingForContents(){return this.featureViewModels.some(t=>t.waitingForContent)}get waitingForResult(){return!(!(this._fetchFeaturesController||this.pendingPromisesCount>0)||this.featureCount!==0)}centerAtLocation(){const{view:t}=this,e=vs(this);return e&&t?this.callGoTo({target:{target:e,scale:t.scale}}):Promise.reject(new R("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:e,view:t}))}zoomTo(t){return this.callGoTo(t)}clear(){this.set({promises:[],features:[],content:null,title:null,location:null,activeFeature:null})}fetchFeatures(t,e){var s;const{view:i}=this;if(!i||!t)throw new R("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:t,view:i});return i.fetchPopupFeatures(t,{pointerType:(s=e==null?void 0:e.event)==null?void 0:s.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:e==null?void 0:e.signal})}open(t){const e={updateLocationEnabled:!1,promises:[],fetchFeatures:!1,...t,visible:!0},{fetchFeatures:i}=e;delete e.fetchFeatures,i&&this._setFetchFeaturesPromises(e.location);const s=["actionsMenuOpen","collapsed"];for(const n of s)delete e[n];this.set(e)}triggerAction(t){const e=this.allActions.at(t);e&&!e.disabled&&this.emit("trigger-action",{action:e})}next(){return this.selectedFeatureIndex++,this}previous(){return this.selectedFeatureIndex--,this}disableClusterBrowsing(){uo(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){const{view:t,selectedFeature:e}=this;(t==null?void 0:t.type)==="2d"?Fe(e)?(await lo(this),await co(this)):z.getLogger(this).warn("enableClusterBrowsing:invalid-selectedFeature: Selected feature must represent an aggregate/cluster graphic.",e):z.getLogger(this).warn("enableClusterBrowsing:invalid-view: View must be 2d MapView.",e)}handleViewClick(t){this.autoOpenEnabled&&this._fetchFeaturesAndOpen(t)}_animationStateChange(t){this.zoomToLocation||(Ee.disabled=t==="waiting-for-target")}_clearBrowsedClusterGraphics(){var e,i;const t=[this.selectedClusterBoundaryFeature,this._selectedClusterFeature].filter(ht);(i=(e=this.view)==null?void 0:e.graphics)==null||i.removeMany(t),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){if(Fe(this.selectedFeature))return this.browseClusterEnabled=!1,this.visible=!1,void this.clear();this.browseClusterEnabled&&(this.features=this.selectedFeature?[this.selectedFeature]:[])}_locationChange(t){const{selectedFeature:e,updateLocationEnabled:i}=this;i&&t&&(!e||e.geometry)&&this.centerAtLocation()}_selectedFeatureIndexChange(){this.featurePage=this.featureCount>1?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null}_featureViewModelsChange(){this.featurePage=this.featureCount>1?1:null}_setGraphicOnFeatureViewModels(){const{features:t,featureCount:e,featurePage:i,featuresPerPage:s,featureViewModels:n}=this;if(i===null)return;const r=((i-1)*s+e)%e,o=r+s;n.slice(r,o).forEach((d,c)=>{d&&(d.graphic??(d.graphic=t[r+c]))})}async _selectedFeatureChange(t){var n;const{location:e,updateLocationEnabled:i,view:s}=this;if(t&&s){if(this.browseClusterEnabled)return this._selectedClusterFeature&&(s.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),Fe(t)?void 0:(t.symbol=await Ni(t),this._selectedClusterFeature=t,void s.graphics.add(this._selectedClusterFeature));if(t.symbol=await Ni(t),!i&&e||!t.geometry){if(i&&!t.geometry){await this.centerAtLocation();const r=(n=s.center)==null?void 0:n.clone();r&&(this.location=r)}}else this.location=Nt(t.geometry)}}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.visible=!1)}async _setFetchFeaturesPromises(t){const{pendingFeatures:e}=await this._fetchFeaturesWithController({mapPoint:t});this.promises=e}_destroyFeatureVMs(){this.featureViewModels.forEach(t=>t&&!t.destroyed&&t.destroy()),this._set("featureViewModels",[])}_updateFeatureVMs(){const{selectedFeature:t,features:e,featureViewModels:i,view:s}=this;if(Fe(t)||(this.browseClusterEnabled=!1),this._destroyFeatureVMs(),!(e!=null&&e.length))return;const n=i.slice(0),r=[];e.forEach((o,d)=>{if(!o)return;let c=null;if(n.some((u,p)=>(u&&u.graphic===o&&(c=u,n.splice(p,1)),!!c)),c)r[d]=c;else{const u=new ti({abilities:this.featureViewModelAbilities,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:s==null?void 0:s.spatialReference,graphic:o===t?o:null,location:this.location,map:s==null?void 0:s.map,view:s});r[d]=u}}),n.forEach(o=>o&&!o.destroyed&&o.destroy()),this._set("featureViewModels",r)}async _getScreenPoint(t,e){const{view:i}=this;await(i==null?void 0:i.when());const s=t==null?void 0:t.spatialReference,n=i==null?void 0:i.spatialReference;return s&&n?(await rn(s,n,null,e),i.toScreen(t)):null}_cancelFetchingFeatures(){const t=this._fetchFeaturesController;t&&t.abort(),this._fetchFeaturesController=null}async _projectScreenPointAndFetchFeatures({mapPoint:t,screenPoint:e,event:i,signal:s}){return this.fetchFeatures(e??await this._getScreenPoint(t??this.location,{signal:s}),{signal:s,event:i})}_fetchFeaturesWithController({mapPoint:t,screenPoint:e,event:i}){this._cancelFetchingFeatures();const s=new AbortController,{signal:n}=s;this._fetchFeaturesController=s;const r=this._projectScreenPointAndFetchFeatures({mapPoint:t,screenPoint:e,signal:n,event:i});return r.catch(()=>{}).then(()=>{this._fetchFeaturesController=null}),r}async _fetchFeaturesAndOpen(t){var r;const{mapPoint:e,screenPoint:i}=t,{view:s}=this;(r=this._locationScaleHandle)==null||r.remove(),this._locationScaleHandle=_(()=>{var o;return(o=this.view)==null?void 0:o.scale},()=>this._debouncedLocationUpdate(e).catch(o=>{Pt(o)||z.getLogger(this).error(o)}));const{pendingFeatures:n}=await this._fetchFeaturesWithController({mapPoint:e,screenPoint:i,event:t});s!=null&&s.popup&&"open"in s.popup&&s.popup.open({location:e??void 0,promises:n})}_autoClose(){this.autoCloseEnabled&&(this.visible=!1)}async _getLayerView(t,e){return await t.when(),t.whenLayerView(e)}_getHighlightLayer(t){const{layer:e,sourceLayer:i}=t;return i&&"layer"in i&&i.layer?i.layer:(i==null?void 0:i.type)==="map-notes"||(i==null?void 0:i.type)==="subtype-group"?i:e}_getHighlightTarget(t,e,i){if(mo(e.type,i))return t;const s=t.getObjectId();if(s!=null)return s;const n=e.type==="imagery"?void 0:"objectIdField"in e?e.objectIdField||Pi:null,r=t.attributes;return r&&n&&r[n]||t}_mapIncludesLayer(t){var e,i,s;return!!((s=(i=(e=this.view)==null?void 0:e.map)==null?void 0:i.allLayers)!=null&&s.includes(t))}async _highlightActiveFeature(){const t="highlight-active-feature";this.removeHandles(t);const{highlightEnabled:e,view:i,activeFeature:s,visible:n}=this;if(!(s&&i&&e&&n))return;const r=this._getHighlightLayer(s);if(!(r&&r instanceof ci&&this._mapIncludesLayer(r)))return;const o=this._getLayerView(i,r);this._highlightActiveFeaturePromise=o;const d=await o;if(!(d&&Vi(d)&&this._highlightActiveFeaturePromise===o&&this.activeFeature&&this.highlightEnabled))return;const c=d.highlight(this._getHighlightTarget(s,r,i.type));this.addHandles(c,t)}async _highlightSelectedFeature(){const t="highlight-selected-feature";this.removeHandles(t);const{selectedFeature:e,highlightEnabled:i,view:s,visible:n}=this;if(!(e&&s&&i&&n))return;const r=this._getHighlightLayer(e);if(!(r&&r instanceof ci&&this._mapIncludesLayer(r)))return;const o=this._getLayerView(s,r);this._highlightSelectedFeaturePromise=o;const d=await o;if(!(d&&Vi(d)&&this._highlightSelectedFeaturePromise===o&&this.selectedFeature&&this.highlightEnabled&&this.visible))return;const c=d.highlight(this._getHighlightTarget(e,r,s.type));this.addHandles(c,t)}_updateFeatures(t){const{features:e}=this,i=t.filter(s=>!e.includes(s));i!=null&&i.length&&(this.features=e.concat(i))}};a([l()],A.prototype,"_fetchFeaturesController",void 0),a([l({type:$e})],A.prototype,"actions",void 0),a([l({readOnly:!0})],A.prototype,"active",null),a([l()],A.prototype,"activeFeature",void 0),a([l({readOnly:!0})],A.prototype,"allActions",null),a([l()],A.prototype,"autoCloseEnabled",void 0),a([l()],A.prototype,"autoOpenEnabled",void 0),a([l()],A.prototype,"browseClusterEnabled",void 0),a([l()],A.prototype,"content",void 0),a([l({type:$e,readOnly:!0})],A.prototype,"defaultActions",null),a([l({type:Boolean})],A.prototype,"defaultPopupTemplateEnabled",void 0),a([l({readOnly:!0})],A.prototype,"featureCount",null),a([l()],A.prototype,"featurePage",void 0),a([l({value:[]})],A.prototype,"features",null),a([l()],A.prototype,"featuresPerPage",void 0),a([l()],A.prototype,"featureMenuOpen",void 0),a([l()],A.prototype,"featureViewModelAbilities",void 0),a([l({readOnly:!0})],A.prototype,"featureViewModels",void 0),a([l()],A.prototype,"highlightEnabled",void 0),a([l()],A.prototype,"includeDefaultActions",void 0),a([l({type:Ht})],A.prototype,"location",null),a([l({readOnly:!0})],A.prototype,"pendingPromisesCount",null),a([l({readOnly:!0})],A.prototype,"promiseCount",null),a([l()],A.prototype,"promises",null),a([l({readOnly:!0})],A.prototype,"selectedClusterBoundaryFeature",void 0),a([l({value:null,readOnly:!0})],A.prototype,"selectedFeature",null),a([l({value:-1})],A.prototype,"selectedFeatureIndex",null),a([l({readOnly:!0})],A.prototype,"selectedFeatureViewModel",null),a([l({readOnly:!0})],A.prototype,"state",null),a([l()],A.prototype,"title",void 0),a([l()],A.prototype,"updateLocationEnabled",void 0),a([l()],A.prototype,"view",void 0),a([l()],A.prototype,"visible",void 0),a([l({readOnly:!0})],A.prototype,"waitingForContents",null),a([l({readOnly:!0})],A.prototype,"waitingForResult",null),a([l()],A.prototype,"zoomFactor",void 0),a([l()],A.prototype,"zoomToLocation",void 0),a([l()],A.prototype,"centerAtLocation",null),A=a([N("esri.widgets.Features.FeaturesViewModel")],A);const si=A;let de=class extends fe{constructor(){super(...arguments),this.actionBar=!0,this.closeButton=!0,this.collapseButton=!1,this.featureNavigation=!0,this.flow=!0,this.heading=!0,this.spinner=!0}};a([l({type:Boolean,nonNullable:!0})],de.prototype,"actionBar",void 0),a([l({type:Boolean,nonNullable:!0})],de.prototype,"closeButton",void 0),a([l({type:Boolean,nonNullable:!0})],de.prototype,"collapseButton",void 0),a([l({type:Boolean,nonNullable:!0})],de.prototype,"featureNavigation",void 0),a([l({type:Boolean,nonNullable:!0})],de.prototype,"flow",void 0),a([l({type:Boolean,nonNullable:!0})],de.prototype,"heading",void 0),a([l({type:Boolean,nonNullable:!0})],de.prototype,"spinner",void 0),de=a([N("esri.widgets.Features.FeaturesVisibleElements")],de);const ws=de,Di="selected-index",fo=0,Bi="features-spinner",go=50;let T=class extends fs(ie){constructor(t,e){super(t,e),this._featureMenuIntersectionObserverCallback=([i])=>{i!=null&&i.isIntersecting&&this.viewModel.featurePage!=null&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._focusOn=null,this._spinner=null,this._feature=null,this._relatedRecordsFlowItems=new Be,this._relatedRecordsWidget=new eo({flowItems:this._relatedRecordsFlowItems}),this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._actionBarMenuNode=null,this.collapsed=!1,this.icon=null,this.featureNavigationTop=!1,this.headerActions=new $e,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new si,this.visibleElements=new ws,this._renderAction=(i,s)=>{const n=this._getActionTitle(i),{type:r,active:o,uid:d,disabled:c,indicator:u}=i;return i.visible?h("calcite-action",{active:r==="toggle"&&i.value,appearance:"solid",bind:this,"data-action-uid":d,disabled:c,icon:this._getActionIcon(i),indicator:u,key:`action-${s}`,loading:o,onclick:this._triggerAction,scale:"s",text:n,title:this._hideActionText?n:void 0},this._getFallbackIcon(i)):null},this._openFeatureMenu=()=>{this.featureMenuOpen=!0,this._focusOn="menu-flow-item"},this._previousFeature=()=>{this.viewModel.selectedFeatureIndex--},this._nextFeature=()=>{this.viewModel.selectedFeatureIndex++},this._handleFeatureMenuBack=()=>{this.featureMenuOpen&&(this._focusOn="root-flow-item",this.featureMenuOpen=!1)},this._focusFlowItemNode=i=>{this._focusOn===i&&requestAnimationFrame(async()=>{var s,n;switch(i){case"menu-flow-item":await((s=this._featureMenuViewportNode)==null?void 0:s.setFocus());break;case"root-flow-item":await((n=this._rootFlowItemNode)==null?void 0:n.setFocus())}this._focusOn=null})},this._focusFlowItemNodeThrottled=lt(this._focusFlowItemNode,go),this._displaySpinnerThrottled=lt(()=>this._displaySpinner(),fo),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,this._focusFlowItemNodeThrottled,_(()=>{var i;return(i=this.viewModel)==null?void 0:i.active},()=>this._toggleScreenLocationEnabled()),_(()=>{var i;return(i=this.viewModel)==null?void 0:i.active},i=>this._relatedRecordsWidget.closed=!i),_(()=>{var i;return(i=this.visibleElements)==null?void 0:i.closeButton},i=>this._relatedRecordsWidget.closable=i),_(()=>{var i;return(i=this.visibleElements)==null?void 0:i.spinner},i=>this._spinnerEnabledChange(i)),_(()=>{var i;return(i=this.viewModel)==null?void 0:i.view},(i,s)=>this._viewChange(i,s)),_(()=>{var i,s;return(s=(i=this.viewModel)==null?void 0:i.view)==null?void 0:s.ready},(i,s)=>this._viewReadyChange(i??!1,s??!1)),_(()=>{var i,s;return[(i=this.viewModel)==null?void 0:i.waitingForResult,(s=this.viewModel)==null?void 0:s.location]},()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),_(()=>{var i;return(i=this.viewModel)==null?void 0:i.screenLocation},()=>this._closeOpenActionMenu()),_(()=>this.selectedFeatureWidget,()=>this._destroyRelatedRecordsFlowItemWidgets()),_(()=>{var s;const i=(s=this.selectedFeatureWidget)==null?void 0:s.viewModel;return[i==null?void 0:i.title,i==null?void 0:i.state]},()=>this._setTitleFromFeatureWidget()),_(()=>{var s;const i=(s=this.selectedFeatureWidget)==null?void 0:s.viewModel;return[i==null?void 0:i.content,i==null?void 0:i.state]},()=>this._setContentFromFeatureWidget()),_(()=>{var i;return(i=this.viewModel)==null?void 0:i.featureViewModels},()=>this._featureMenuViewportScrollTop()),this._relatedRecordsWidget.on("close",()=>this.close()),this._relatedRecordsWidget.on("exit",()=>this._destroyRelatedRecordsFlowItemWidgets()),this._relatedRecordsWidget.on("open-related-feature",({feature:i})=>this._openRelatedFeature(i))])}loadDependencies(){return We({action:()=>E(()=>import("./calcite-action-xwwomTuE.js"),__vite__mapDeps([87,83,2,3,4,5,71,73,74,6,79,1,80])),"action-bar":()=>E(()=>import("./calcite-action-bar-glrD7fhe.js"),__vite__mapDeps([92,2,3,85,6,4,5,73,74,93,89,83,71,79,1,80,75,90,86])),"action-group":()=>E(()=>import("./calcite-action-group-DMHrkhqu.js"),__vite__mapDeps([94,93,2,3,85,6,73,74,4,5,89,83,71,79,1,80,75,90,86])),button:()=>E(()=>import("./calcite-button-CWS09kHr.js"),__vite__mapDeps([95,2,3,77,4,5,71,78,79,73,74,6,1,80])),flow:()=>E(()=>import("./calcite-flow-cUQQQwo9.js"),__vite__mapDeps([96,2,3,6,73])),"flow-item":()=>E(()=>import("./calcite-flow-item-aWVm4yY6.js"),__vite__mapDeps([88,2,3,4,5,71,73,74,6,89,83,79,1,80,75,90,86,81])),list:()=>E(()=>import("./calcite-list-CAcrc3c7.js"),__vite__mapDeps([70,2,3,4,5,71,6,72,73,74,75,1,76,77,78,79,80,81])),"list-item":()=>E(()=>import("./calcite-list-item-JeWmt-sE.js"),__vite__mapDeps([82,2,3,4,5,71,72,74,6,73,83,79,1,80])),"list-item-group":()=>E(()=>import("./calcite-list-item-group-tUNZxrA0.js"),__vite__mapDeps([97,2,3,71,72])),loader:()=>E(()=>import("./calcite-loader-ijl1xz1O.js"),__vite__mapDeps([98,80,2,3,5]))})}destroy(){var t,e;this._destroyRelatedRecordsFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),(t=this._featureMenuIntersectionObserver)==null||t.disconnect(),(e=this._relatedRecordsWidget)==null||e.destroy()}get _hideActionText(){var e;if(!this.responsiveActionsEnabled)return!1;const t=(e=this.view)==null?void 0:e.widthBreakpoint;return t==="xsmall"||t==="small"||t==="medium"}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&this.visibleElements.featureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.visibleElements.collapseButton&&!!this.title&&!!this.content}get content(){return this.viewModel.content}set content(t){this.viewModel.content=t}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(t){this.viewModel.featureMenuOpen=t}get features(){return this.viewModel.features}set features(t){this.viewModel.features=t}get location(){return this.viewModel.location}set location(t){this.viewModel.location=t}get label(){var t;return((t=this.messages)==null?void 0:t.widgetLabel)??""}set label(t){this._overrideIfSome("label",t)}get promises(){return this.viewModel.promises}set promises(t){this.viewModel.promises=t}get selectedFeature(){return this.viewModel.selectedFeature}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(t){this.viewModel.selectedFeatureIndex=t}get selectedFeatureWidget(){const{_feature:t,headingLevel:e,_relatedRecordsFlowItems:i}=this,{selectedFeatureViewModel:s}=this.viewModel,n={title:!1};return s?(t?(t.viewModel=s,t.visibleElements=n):this._feature=new Yr({flowItems:i,headingLevel:e+1,viewModel:s,visibleElements:n}),this._feature):null}get title(){return this.viewModel.title}set title(t){this.viewModel.title=t}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(t){this.viewModel.updateLocationEnabled=t}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}get visible(){return this.viewModel.visible}set visible(t){this.viewModel.visible=t}blur(){var e;const{active:t}=this.viewModel;t?(e=this._rootFlowItemNode)==null||e.blur():z.getLogger(this).warn("Features can only be blurred when currently active.")}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(t,e){return this.viewModel.fetchFeatures(t,e)}focus(){const{active:t}=this.viewModel;t?this._setFocusOn():z.getLogger(this).warn("Features can only be focused when currently active.")}next(){return this.viewModel.next()}open(t){this.removeHandles(Di);const e={collapsed:(t==null?void 0:t.collapsed)??!1};this.set(e),this.viewModel.open(t),this.addHandles(at(()=>!this.viewModel.waitingForResult,()=>this._addSelectedFeatureIndexHandle(),{once:!0}))}previous(){return this.viewModel.previous()}triggerAction(t){return this.viewModel.triggerAction(t)}render(){return h("div",{bind:this,class:this.classes(H.base,I.widget,I.panel),onkeydown:this._onMainKeydown},this._renderHeader(),this._renderContentContainer())}_renderFeatureNavigation(){return[this._renderPagination(),this._renderFeatureMenuButton()]}_renderHeader(){return!this.featureMenuOpen&&this.featureNavigationTop&&this._featureNavigationVisible?h("div",{class:H.header,key:"header-actions"},this._renderFeatureNavigation()):null}_renderFooter(){return this.featureMenuOpen||this.featureNavigationTop||!this._featureNavigationVisible?null:h("div",{class:H.footer,key:"footer-actions",slot:"footer"},this._renderFeatureNavigation())}_renderFeatureMenuButton(){const{messages:t,viewModel:e}=this,{featureCount:i,selectedFeatureIndex:s,pendingPromisesCount:n}=e;return h("calcite-action",{appearance:"solid",bind:this,icon:"list",key:"feature-menu-button",label:t.selectFeature,loading:n>0,onclick:this._openFeatureMenu,scale:"s",text:ce(t.pageText,{index:xe(s+1),total:xe(i)}),textEnabled:!0,title:t.selectFeature})}_renderPagination(){const{previous:t,next:e}=this.messagesCommon.pagination;return h("calcite-action-bar",{class:H.paginationActionBar,expandDisabled:!0,key:"pagination-action-bar",layout:"horizontal",overflowActionsDisabled:!0,scale:"s"},h("calcite-action-group",{scale:"s"},h("calcite-action",{appearance:"solid",class:H.paginationPrevious,icon:"chevron-left",iconFlipRtl:!0,label:t,onclick:this._previousFeature,scale:"s",text:t,title:t}),h("calcite-action",{appearance:"solid",icon:"chevron-right",iconFlipRtl:!0,label:e,onclick:this._nextFeature,scale:"s",text:e,title:e})))}_renderFeatureMenuItem(t){const{selectedFeatureViewModel:e,featureViewModels:i}=this.viewModel,s=t===e,n=i.indexOf(t);return h("calcite-list-item",{bind:this,"data-feature-index":n,key:`feature-menu-item-${t.uid}`,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onmouseleave:this._removeActiveFeature,onmouseover:this._setActiveFeature,selected:s,onCalciteListItemSelect:this._selectFeature},h("span",{innerHTML:t.title||this.messagesCommon.untitled,slot:"content"}))}_groupResultsByLayer(){const{featureViewModels:t}=this.viewModel,e=new Map;return t.forEach(i=>{const s=i==null?void 0:i.graphic;if(!s)return;const n=s.sourceLayer??s.layer,r=e.get(n)??[];e.set(n,[...r,i])}),e}_renderFeatureMenu(){const{featureViewModels:t}=this.viewModel,e=this._groupResultsByLayer();return t.length?h("calcite-list",{selectionAppearance:"icon",selectionMode:"single"},Array.from(e.keys()).map(i=>{var s;return h("calcite-list-item-group",{heading:(i==null?void 0:i.title)??this.messagesCommon.untitled,key:(i==null?void 0:i.uid)||"untitled"},(s=e.get(i))==null?void 0:s.map(n=>this._renderFeatureMenuItem(n)))})):null}_renderHeaderAction(t,e){return t.visible?h("calcite-action",{active:t.type==="toggle"&&t.value,appearance:"solid",bind:this,"data-action-uid":t.uid,disabled:t.disabled,icon:t.icon||"",indicator:t.indicator,key:`header-action-${e}`,loading:t.active,onclick:this._triggerHeaderAction,scale:"m",slot:"header-actions-end",text:t.title||"",title:t.title||""}):null}_renderHeaderActions(){return this.headerActions.map((t,e)=>this._renderHeaderAction(t,e)).toArray()}_renderContentFeature(){const{headingLevel:t,visibleElements:e,_isCollapsed:i,_collapseEnabled:s,featureNavigationTop:n}=this,{title:r,active:o}=this.viewModel,d=e.heading&&r?r:"";return h("calcite-flow-item",{afterCreate:this._storeRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,class:this.classes({[H.contentFeature]:!0,[H.flowItemCollapsed]:i}),closable:e.closeButton,closed:!o,collapsed:i,collapseDirection:n?"down":"up",collapsible:s,headingLevel:t,key:"root-flow-item",onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},d?h(Kt,{class:this.classes(H.featuresHeading,I.heading),innerHTML:d,key:"header-content",level:this.headingLevel,slot:"header-content"}):null,this._renderHeaderActions(),this._renderActionBar(),i?null:h("div",{class:this.classes(H.container,H.contentContainer)},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){const{viewModel:t,featureMenuOpen:e,messages:i,messagesCommon:s}=this,{active:n,featureViewModels:r,pendingPromisesCount:o}=t;return e?h("calcite-flow-item",{afterCreate:this._storeFeatureMenuFlowItemNode,afterUpdate:this._focusFeatureMenuFlowItemNode,bind:this,closable:!1,closed:!n,description:ce(i.total,{total:r.length}),heading:i.selectFeature,key:"feature-menu",loading:t.waitingForContents,onCalciteFlowItemBack:d=>{d.preventDefault(),this._handleFeatureMenuBack()}},o>0?h("calcite-loader",{class:H.loader,inline:!0,key:"feature-menu-loader",label:s.loading,scale:"m",slot:"header-actions-end"}):null,h("div",{class:H.container},this._renderFeatureMenu()),h("div",{afterCreate:this._featureMenuIntersectionObserverCreated,bind:this,class:H.featureMenuObserver}),h("calcite-button",{appearance:"transparent",onclick:this._handleFeatureMenuBack,slot:"footer-actions",width:"full"},s.back)):null}_renderContentContainer(){const t=[this._renderContentFeature(),this._renderFeatureMenuContainer(),this._relatedRecordsWidget.render()];return this.visibleElements.flow?h("calcite-flow",{key:"content-container"},t):t}_getFallbackIcon(t){const{className:e,icon:i}=t;if(i)return null;const s=fn({action:t,feature:this.selectedFeature}),n={[H.icon]:!!e,[H.actionImage]:!!s};return e&&(n[e]=!0),s||e?h("span",{"aria-hidden":"true",class:this.classes(H.icon,n),key:"icon",styles:mn(s)}):null}_renderActionBar(){var t;return!this._isCollapsed&&this.visibleElements.actionBar&&((t=this.viewModel.allActions)!=null&&t.length)?h("calcite-action-bar",{expandDisabled:!0,expanded:!this._hideActionText,key:"header-action-bar",scale:"s",slot:"action-bar"},h("calcite-action-group",{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:"fixed",scale:"s"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map(this._renderAction)}_renderContent(){var e;const t=(e=this.viewModel)==null?void 0:e.content;return t?typeof t=="string"?h("div",{class:V.contentNode,innerHTML:t,key:t}):this.renderNodeContent(t):null}_setFocusOn(){this.renderNow(),requestAnimationFrame(()=>{this._focusOn=this.featureMenuOpen?"menu-flow-item":"root-flow-item"})}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(t){await t.viewModel.updateGeometry();const e=t.graphic,i=e==null?void 0:e.geometry;if(i==null||e==null)return;this._destroyRelatedRecordsFlowItemWidgets(),await this.viewModel.zoomTo({target:i});const s=Nt(i);this.open({features:[e],location:s??void 0})}_focusRootFlowItemNode(){this._focusFlowItemNodeThrottled("root-flow-item")}_focusFeatureMenuFlowItemNode(){this._focusFlowItemNodeThrottled("menu-flow-item")}_storeRootFlowItemNode(t){this._rootFlowItemNode=t,this._focusFlowItemNodeThrottled("root-flow-item")}_storeFeatureMenuFlowItemNode(t){this._featureMenuViewportNode=t,this._focusFlowItemNodeThrottled("menu-flow-item")}_setActiveFeature(t){var s;const{viewModel:e}=this,i=t.currentTarget["data-feature-index"];e.activeFeature=((s=e.features)==null?void 0:s[i])||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(t){const e=t.currentTarget["data-feature-index"];isNaN(e)||(this.viewModel.selectedFeatureIndex=e),this._handleFeatureMenuBack()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(t){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(t),this._featureMenuIntersectionObserverNode=t}_getActionIcon(t){return t.icon?t.icon:t.image||t.className?void 0:"question"}_getActionTitle(t){const{messages:e,selectedFeature:i,messagesCommon:s}=this,{id:n}=t,r=i==null?void 0:i.attributes,o=t.title??"",d=n==="zoom-to-feature"?ce(o,{messages:e}):n==="remove-selected-feature"?ce(o,{messages:s}):n==="zoom-to-clustered-features"||n==="browse-clustered-features"?ce(o,{messages:e}):t.title;return d&&r?ce(d,r):d??""}_onMainKeydown(t){const{key:e}=t;e==="ArrowLeft"&&(t.stopPropagation(),this._handleFeatureMenuBack(),this.previous()),e==="ArrowRight"&&(t.stopPropagation(),this._handleFeatureMenuBack(),this.next())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&this._featureMenuViewportNode.scrollContentTo({top:0})}_setContentFromFeatureWidget(){const{selectedFeatureWidget:t}=this;t&&(this.viewModel.content=t)}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:t,messagesCommon:e}=this,i=t==null?void 0:t.viewModel;t&&(this.viewModel.title=(i==null?void 0:i.state)==="error"?e==null?void 0:e.errorMessage:(i==null?void 0:i.title)||"")}_addSelectedFeatureIndexHandle(){const t=_(()=>{var e;return(e=this.viewModel)==null?void 0:e.selectedFeatureIndex},(e,i)=>this._selectedFeatureIndexUpdated(e,i));this.addHandles(t,Di)}_selectedFeatureIndexUpdated(t,e){const{featureCount:i}=this.viewModel;i&&t!==e&&t!==-1&&(this._destroyRelatedRecordsFlowItemWidgets(),this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_triggerHeaderAction(t){const e=t.currentTarget;if(e.disabled)return;const i=e.dataset.actionUid,s=this.headerActions.find(({uid:n})=>n===i);s&&!s.disabled&&((s==null?void 0:s.type)==="toggle"&&(s.value=!s.value),this.emit("trigger-header-action",{action:s}))}_triggerAction(t){const e=t.currentTarget;if(e.disabled)return;const i=e.dataset.actionUid,{allActions:s}=this.viewModel,n=s.findIndex(o=>o.uid===i),r=s.at(n);r&&r.type==="toggle"&&(r.value=!r.value),this.viewModel.triggerAction(n)}_createSpinner(t){t&&(this._spinner=new Jr({view:t}),t.ui.add(this._spinner,{key:Bi,position:"manual",internal:!0}))}_wireUpView(t){var e;this._destroySpinner(),t&&((e=this.visibleElements)!=null&&e.spinner)&&this._createSpinner(t)}_hideSpinner(){const{_spinner:t}=this;t&&(t.location=null,t.hide())}_viewReadyChange(t,e){var i;t?this._wireUpView((i=this.viewModel)==null?void 0:i.view):e&&this.viewModel.clear()}_viewChange(t,e){t&&e&&this.viewModel.clear()}_destroySelectedFeatureWidget(){const{_feature:t}=this;t&&(t.viewModel=null,!t.destroyed&&t.destroy()),this._feature=null}_closeOpenActionMenu(){const{_actionBarMenuNode:t}=this;t&&(t.menuOpen=!1)}_destroyRelatedRecordsFlowItemWidgets(){this._relatedRecordsFlowItems.removeAll().forEach(t=>{"showAllEnabled"in t.viewModel&&(t.viewModel.showAllEnabled=!1),t.viewModel=null,t.destroy()})}_toggleScreenLocationEnabled(){const{viewModel:t}=this;t&&(t.screenLocationEnabled=t.active)}_displaySpinner(){const{_spinner:t}=this;if(!t)return;const{location:e,waitingForResult:i}=this.viewModel;i&&e?t.show({location:e}):t.hide()}_destroySpinner(){var i;const{_spinner:t,view:e}=this;t&&((i=e==null?void 0:e.ui)==null||i.remove(t,Bi),t.destroy(),this._spinner=null)}_spinnerEnabledChange(t){var e;this._destroySpinner(),t&&this._createSpinner((e=this.viewModel)==null?void 0:e.view)}};a([l()],T.prototype,"_focusOn",void 0),a([l()],T.prototype,"_relatedRecordsFlowItems",void 0),a([l()],T.prototype,"_hideActionText",null),a([l()],T.prototype,"_featureNavigationVisible",null),a([l()],T.prototype,"_isCollapsed",null),a([l()],T.prototype,"_collapseEnabled",null),a([l()],T.prototype,"collapsed",void 0),a([l()],T.prototype,"content",null),a([l()],T.prototype,"icon",void 0),a([l()],T.prototype,"featureMenuOpen",null),a([l()],T.prototype,"featureNavigationTop",void 0),a([l()],T.prototype,"features",null),a([l({type:$e})],T.prototype,"headerActions",void 0),a([l()],T.prototype,"headingLevel",void 0),a([l()],T.prototype,"location",null),a([l()],T.prototype,"label",null),a([l(),te("esri/widgets/Features/t9n/Features")],T.prototype,"messages",void 0),a([l(),te("esri/t9n/common")],T.prototype,"messagesCommon",void 0),a([l()],T.prototype,"promises",null),a([l()],T.prototype,"responsiveActionsEnabled",void 0),a([l({readOnly:!0})],T.prototype,"selectedFeature",null),a([l()],T.prototype,"selectedFeatureIndex",null),a([l({readOnly:!0})],T.prototype,"selectedFeatureWidget",null),a([l()],T.prototype,"title",null),a([l()],T.prototype,"updateLocationEnabled",null),a([l()],T.prototype,"view",null),a([l({type:si}),ds(["triggerAction","trigger-action"])],T.prototype,"viewModel",void 0),a([l({type:ws,nonNullable:!0})],T.prototype,"visibleElements",void 0),a([l()],T.prototype,"visible",null),T=a([N("esri.widgets.Features")],T);const _o=T,ne="esri-popup",we=`${ne}--is-docked`,D={base:ne,main:`${ne}__main-container`,shadow:`${ne}--shadow`,isDocked:we,isDockedTopLeft:`${we}-top-left`,isDockedTopCenter:`${we}-top-center`,isDockedTopRight:`${we}-top-right`,isDockedBottomLeft:`${we}-bottom-left`,isDockedBottomCenter:`${we}-bottom-center`,isDockedBottomRight:`${we}-bottom-right`,alignTopCenter:`${ne}--aligned-top-center`,alignBottomCenter:`${ne}--aligned-bottom-center`,alignTopLeft:`${ne}--aligned-top-left`,alignBottomLeft:`${ne}--aligned-bottom-left`,alignTopRight:`${ne}--aligned-top-right`,alignBottomRight:`${ne}--aligned-bottom-right`,pointer:`${ne}__pointer`,pointerDirection:`${ne}__pointer-direction`};let Bt=class extends si{constructor(t){super(t)}};Bt=a([N("esri.widgets.Popup.PopupViewModel")],Bt);const bs=Bt;let pe=class extends fe{constructor(){super(...arguments),this.actionBar=!0,this.closeButton=!0,this.collapseButton=!0,this.featureNavigation=!0,this.heading=!0,this.spinner=!0}};a([l({type:Boolean,nonNullable:!0})],pe.prototype,"actionBar",void 0),a([l({type:Boolean,nonNullable:!0})],pe.prototype,"closeButton",void 0),a([l({type:Boolean,nonNullable:!0})],pe.prototype,"collapseButton",void 0),a([l({type:Boolean,nonNullable:!0})],pe.prototype,"featureNavigation",void 0),a([l({type:Boolean,nonNullable:!0})],pe.prototype,"heading",void 0),a([l({type:Boolean,nonNullable:!0})],pe.prototype,"spinner",void 0),pe=a([N("esri.widgets.Features.PopupVisibleElements")],pe);const qt=pe,qi={buttonEnabled:!0,position:"auto",breakpoint:{width:544}};let $=class extends ie{constructor(t,e){super(t,e),this._dockAction=new Xe({id:"popup-dock-action"}),this._featuresWidget=new _o({responsiveActionsEnabled:!0}),this._containerNode=null,this._mainContainerNode=null,this._pointerOffsetInPx=16,this.alignment="auto",this.collapsed=!1,this.dockEnabled=!1,this.headingLevel=2,this.messages=null,this.viewModel=new bs,this.visibleElements=new qt}initialize(){this.addHandles([_(()=>{var t,e;return[(e=(t=this.viewModel)==null?void 0:t.view)==null?void 0:e.widthBreakpoint,this.dockEnabled]},()=>this._handleDockIcon(),P),_(()=>{var t,e;return[this.dockEnabled,(t=this.messages)==null?void 0:t.undock,(e=this.messages)==null?void 0:e.dock]},()=>this._handleDockEnabled(),P),_(()=>this.dockOptions,t=>{const{_dockAction:e}=this,i=this._featuresWidget.headerActions;i.remove(e),t.buttonEnabled&&i.add(e)},P),_(()=>{var t;return(t=this.viewModel)==null?void 0:t.screenLocation},()=>this._positionContainer()),_(()=>{var t;return[(t=this.viewModel)==null?void 0:t.active,this.dockEnabled]},()=>this._toggleScreenLocationEnabled()),_(()=>{var t,e,i,s,n,r,o;return[(t=this.viewModel)==null?void 0:t.screenLocation,(i=(e=this.viewModel)==null?void 0:e.view)==null?void 0:i.padding,(n=(s=this.viewModel)==null?void 0:s.view)==null?void 0:n.size,(r=this.viewModel)==null?void 0:r.active,(o=this.viewModel)==null?void 0:o.location,this.alignment]},()=>this.reposition()),_(()=>{var t,e;return(e=(t=this.viewModel)==null?void 0:t.view)==null?void 0:e.size},(t,e)=>this._updateDockEnabledForViewSize(t,e)),_(()=>{var t;return(t=this.viewModel)==null?void 0:t.view},(t,e)=>this._viewChange(t,e)),_(()=>{var t,e;return(e=(t=this.viewModel)==null?void 0:t.view)==null?void 0:e.ready},(t,e)=>this._viewReadyChange(t??!1,e??!1)),_(()=>this.viewModel,()=>this._featuresWidget.viewModel=this.viewModel,P),_(()=>this._featureNavigationTop,t=>this._featuresWidget.featureNavigationTop=t,P),_(()=>this.headingLevel,t=>this._featuresWidget.headingLevel=t,P),_(()=>this.collapsed,t=>this._featuresWidget.collapsed=t,P),_(()=>this.visibleElements.actionBar,t=>this._featuresWidget.visibleElements.actionBar=!!t,P),_(()=>this.visibleElements.closeButton,t=>this._featuresWidget.visibleElements.closeButton=!!t,P),_(()=>this.visibleElements.collapseButton,t=>this._featuresWidget.visibleElements.collapseButton=!!t,P),_(()=>this.visibleElements.heading,t=>this._featuresWidget.visibleElements.heading=!!t,P),_(()=>this.visibleElements.spinner,t=>this._featuresWidget.visibleElements.spinner=!!t,P),_(()=>this.visibleElements.featureNavigation,t=>this._featuresWidget.visibleElements.featureNavigation=!!t,P),Te(()=>this._featuresWidget,"trigger-header-action",t=>{t.action===this._dockAction&&(this.dockEnabled=!this.dockEnabled)})])}normalizeCtorArgs(t){const e={...t};return(t==null?void 0:t.visibleElements)!=null&&(e.visibleElements=new qt(t.visibleElements),t.collapseEnabled!=null&&(e.visibleElements.collapseButton=t.collapseEnabled),t.spinnerEnabled!=null&&(e.visibleElements.spinner=t.spinnerEnabled)),e}destroy(){var t;this._dockAction.destroy(),(t=this._featuresWidget)==null||t.destroy()}get _featureNavigationTop(){const{currentAlignment:t,currentDockPosition:e}=this;return t==="bottom-left"||t==="bottom-center"||t==="bottom-right"||e==="top-left"||e==="top-center"||e==="top-right"}get actions(){return this.viewModel.actions}set actions(t){this.viewModel.actions=t}get autoCloseEnabled(){return this.viewModel.autoCloseEnabled}set autoCloseEnabled(t){this.viewModel.autoCloseEnabled=t}get autoOpenEnabled(){return Pe(z.getLogger(this),"autoOpenEnabled",{replacement:"MapView/SceneView.popupEnabled",version:"4.27"}),this.viewModel.autoOpenEnabled}set autoOpenEnabled(t){Pe(z.getLogger(this),"autoOpenEnabled",{replacement:"MapView/SceneView.popupEnabled",version:"4.27"}),this.viewModel.autoOpenEnabled=t}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(t){this.viewModel.defaultPopupTemplateEnabled=t}get content(){return this.viewModel.content}set content(t){this.viewModel.content=t}get collapseEnabled(){return Pe(z.getLogger(this),"collapseEnabled",{replacement:"PopupVisibleElements.collapseButton",version:"4.29"}),this.visibleElements.collapseButton}set collapseEnabled(t){Pe(z.getLogger(this),"collapseEnabled",{replacement:"PopupVisibleElements.collapseButton",version:"4.29"}),this.visibleElements.collapseButton=t}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._get("dockOptions")||qi}set dockOptions(t){var d,c;const e={...qi},i=(c=(d=this.viewModel)==null?void 0:d.view)==null?void 0:c.breakpoints,s={};i&&(s.width=i.xsmall,s.height=i.xsmall);const n={...e,...t},r={...e.breakpoint,...s},{breakpoint:o}=n;typeof o=="object"?n.breakpoint={...r,...o}:o&&(n.breakpoint=r),this._set("dockOptions",n),this._setCurrentDockPosition(),this.reposition()}get featureCount(){return this.viewModel.featureCount}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(t){this.viewModel.featureMenuOpen=t}get features(){return this.viewModel.features}set features(t){this.viewModel.features=t}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(t){this.viewModel.goToOverride=t}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(t){this.viewModel.highlightEnabled=t}get location(){return this.viewModel.location}set location(t){this.viewModel.location=t}get label(){var t;return((t=this.messages)==null?void 0:t.widgetLabel)??""}set label(t){this._overrideIfSome("label",t)}get promises(){return this.viewModel.promises}set promises(t){this.viewModel.promises=t}get selectedFeature(){return this.viewModel.selectedFeature}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(t){this.viewModel.selectedFeatureIndex=t}get selectedFeatureWidget(){return this._featuresWidget.selectedFeatureWidget}get spinnerEnabled(){return Pe(z.getLogger(this),"spinnerEnabled",{replacement:"PopupVisibleElements.spinner",version:"4.29"}),this.visibleElements.spinner}set spinnerEnabled(t){Pe(z.getLogger(this),"spinnerEnabled",{replacement:"PopupVisibleElements.spinner",version:"4.29"}),this.visibleElements.spinner=t}get title(){return this.viewModel.title}set title(t){this.viewModel.title=t}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(t){this.viewModel.updateLocationEnabled=t}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}get visible(){return this.viewModel.visible}set visible(t){this.viewModel.visible=t}blur(){const{active:t}=this.viewModel;t||z.getLogger(this).warn("Popup can only be blurred when currently active."),this._featuresWidget.blur()}clear(){return this.viewModel.clear()}close(){this.visible=!1}fetchFeatures(t,e){return this.viewModel.fetchFeatures(t,e)}focus(){const{active:t}=this.viewModel;t||z.getLogger(this).warn("Popup can only be focused when currently active."),this.reposition(),requestAnimationFrame(()=>{this._featuresWidget.focus()})}next(){return this.viewModel.next()}open(t){const e=!!t&&!!t.featureMenuOpen,i={collapsed:!!t&&!!t.collapsed,featureMenuOpen:e};this.set(i),this.viewModel.open(t),this._shouldFocus(t)}previous(){return this.viewModel.previous()}reposition(){this.renderNow(),this._positionContainer(),this._setCurrentAlignment()}triggerAction(t){return this.viewModel.triggerAction(t)}render(){var u,p,m,f;const{dockEnabled:t,currentAlignment:e,currentDockPosition:i}=this,{active:s}=this.viewModel,n=s&&t,r=s&&!t,o=(p=(u=this.selectedFeature)==null?void 0:u.layer)==null?void 0:p.title,d=(f=(m=this.selectedFeature)==null?void 0:m.layer)==null?void 0:f.id,c={[D.alignTopCenter]:e==="top-center",[D.alignBottomCenter]:e==="bottom-center",[D.alignTopLeft]:e==="top-left",[D.alignBottomLeft]:e==="bottom-left",[D.alignTopRight]:e==="top-right",[D.alignBottomRight]:e==="bottom-right",[D.isDocked]:n,[D.shadow]:r,[D.isDockedTopLeft]:i==="top-left",[D.isDockedTopCenter]:i==="top-center",[D.isDockedTopRight]:i==="top-right",[D.isDockedBottomLeft]:i==="bottom-left",[D.isDockedBottomCenter]:i==="bottom-center",[D.isDockedBottomRight]:i==="bottom-right"};return h("div",{afterCreate:this._positionContainer,afterUpdate:this._positionContainer,bind:this,class:this.classes(D.base,c),"data-layer-id":d,"data-layer-title":o,role:"presentation"},s?[this._renderMainContainer(),this._renderPointer()]:null)}_renderPointer(){return this.dockEnabled?null:h("div",{class:D.pointer,key:"popup-pointer",role:"presentation"},h("div",{class:this.classes(D.pointerDirection,D.shadow)}))}_renderMainContainer(){const{dockEnabled:t}=this,e={[D.shadow]:t};return h("div",{afterCreate:this._setMainContainerNode,afterUpdate:this._setMainContainerNode,bind:this,class:this.classes(D.main,I.widget,e)},this._featuresWidget.render())}async _shouldFocus(t){t!=null&&t.shouldFocus&&(await on(()=>{var e;return((e=this.viewModel)==null?void 0:e.active)===!0}),this.focus())}_isOutsideView(t){const{popupHeight:e,popupWidth:i,screenLocation:s,side:n,view:r}=t;if(isNaN(i)||isNaN(e)||!r||!s)return!1;const o=r.padding;return n==="right"&&s.x+i/2>r.width-o.right||n==="left"&&s.x-i/2r.height-o.bottom}_calculateAutoAlignment(t){if(t!=="auto")return t;const{_pointerOffsetInPx:e,_containerNode:i,_mainContainerNode:s,viewModel:n}=this,{screenLocation:r,view:o}=n;if(r==null||!o||!i)return"top-center";function d(k){return parseInt(k.replaceAll(/[^-\d\.]/g,""),10)}const c=s?window.getComputedStyle(s,null):null,u=c?d(c.getPropertyValue("max-height")):0,p=c?d(c.getPropertyValue("height")):0,{height:m,width:f}=i.getBoundingClientRect(),g=f+e,y=Math.max(m,u,p)+e,v=this._isOutsideView({popupHeight:y,popupWidth:g,screenLocation:r,side:"right",view:o}),F=this._isOutsideView({popupHeight:y,popupWidth:g,screenLocation:r,side:"left",view:o}),w=this._isOutsideView({popupHeight:y,popupWidth:g,screenLocation:r,side:"top",view:o}),C=this._isOutsideView({popupHeight:y,popupWidth:g,screenLocation:r,side:"bottom",view:o});return F?w?"bottom-right":"top-right":v?w?"bottom-left":"top-left":w?C?"top-center":"bottom-center":"top-center"}_callCurrentAlignment(t){return typeof t=="function"?t.call(this):t}_getCurrentAlignment(){const{alignment:t,dockEnabled:e}=this;return e||!this.viewModel.active?null:this._calculatePositionResult(this._calculateAutoAlignment(this._callCurrentAlignment(t)))}_setCurrentAlignment(){this._set("currentAlignment",this._getCurrentAlignment())}_setCurrentDockPosition(){this._set("currentDockPosition",this._getCurrentDockPosition())}_calculatePositionResult(t){const e=["left","right"];return ke(this.container)&&e.reverse(),t==null?void 0:t.replace(/leading/gi,e[0]).replaceAll(/trailing/gi,e[1])}_callDockPosition(t){return typeof t=="function"?t.call(this):t}_getDockPosition(){var t;return this._calculatePositionResult(this._calculateAutoDockPosition(this._callDockPosition((t=this.dockOptions)==null?void 0:t.position)))}_getCurrentDockPosition(){return this.dockEnabled&&this.viewModel.active?this._getDockPosition():null}_calculateAutoDockPosition(t){var o;if(t!=="auto")return t;const e=(o=this.viewModel)==null?void 0:o.view,i=ke(this.container)?"top-left":"top-right";if(!e)return i;const s=e.padding||{left:0,right:0,top:0,bottom:0},n=e.width-s.left-s.right,{breakpoints:r}=e;return r&&n<=r.xsmall?"bottom-center":i}_getDockIcon(){const t=this._getDockPosition();if(this.dockEnabled)return"minimize";switch(t){case"top-left":case"bottom-left":return"dock-left";case"top-center":return"maximize";case"bottom-center":return"dock-bottom";default:return"dock-right"}}_handleDockIcon(){this._dockAction.icon=this._getDockIcon()}_handleDockEnabled(){var t,e;this._dockAction.title=this.dockEnabled?(t=this.messages)==null?void 0:t.undock:(e=this.messages)==null?void 0:e.dock}_setMainContainerNode(t){this._mainContainerNode=t}_positionContainer(t=this._containerNode){if(t&&(this._containerNode=t),!this._containerNode)return;const{screenLocation:e}=this.viewModel,{width:i}=this._containerNode.getBoundingClientRect(),s=this._calculatePositionStyle(e,i);s&&Object.assign(this._containerNode.style,s)}_calculateFullWidth(t){const{currentAlignment:e,_pointerOffsetInPx:i}=this;return e==="top-left"||e==="bottom-left"||e==="top-right"||e==="bottom-right"?t+i:t}_calculateAlignmentPosition(t,e,i,s){const{currentAlignment:n,_pointerOffsetInPx:r}=this;if(!i)return;const{padding:o}=i,d=s/2,c=i.height-e,u=i.width-t;return n==="bottom-center"?{top:e+r-o.top,left:t-d-o.left}:n==="top-left"?{bottom:c+r-o.bottom,right:u+r-o.right}:n==="bottom-left"?{top:e+r-o.top,right:u+r-o.right}:n==="top-right"?{bottom:c+r-o.bottom,left:t+r-o.left}:n==="bottom-right"?{top:e+r-o.top,left:t+r-o.left}:n==="top-center"?{bottom:c+r-o.bottom,left:t-d-o.left}:void 0}_calculatePositionStyle(t,e){const{dockEnabled:i,view:s}=this;if(!s)return;if(i)return{left:"",top:"",right:"",bottom:""};if(t==null||!e)return;const n=this._calculateFullWidth(e),r=this._calculateAlignmentPosition(t.x,t.y,s,n);return r?{top:r.top!==void 0?`${r.top}px`:"auto",left:r.left!==void 0?`${r.left}px`:"auto",bottom:r.bottom!==void 0?`${r.bottom}px`:"auto",right:r.right!==void 0?`${r.right}px`:"auto"}:void 0}_viewChange(t,e){t&&e&&(this.close(),this.clear())}_viewReadyChange(t,e){t?this._wireUpView():e&&(this.close(),this.clear())}_wireUpView(){this._setDockEnabledForViewSize(this.dockOptions)}_dockingThresholdCrossed(t,e,i){const[s,n]=t,[r,o]=e,{width:d=0,height:c=0}=i??{};return s<=d&&r>d||s>d&&r<=d||n<=c&&o>c||n>c&&o<=c}_updateDockEnabledForViewSize(t,e){var u,p;if(!t||!e)return;const i=((p=(u=this.viewModel)==null?void 0:u.view)==null?void 0:p.padding)||{left:0,right:0,top:0,bottom:0},s=i.left+i.right,n=i.top+i.bottom,r=[],o=[];r[0]=t[0]-s,r[1]=t[1]-n,o[0]=e[0]-s,o[1]=e[1]-n;const{dockOptions:d}=this,c=d.breakpoint;this._dockingThresholdCrossed(r,o,c)&&this._setDockEnabledForViewSize(d),this._setCurrentDockPosition()}_toggleScreenLocationEnabled(){const{dockEnabled:t,viewModel:e}=this;if(!e)return;const i=e.active&&!t;e.screenLocationEnabled=i}_shouldDockAtCurrentViewSize(t){var d,c;const e=t.breakpoint,i=(c=(d=this.viewModel)==null?void 0:d.view)==null?void 0:c.ui;if(!i)return!1;const{width:s,height:n}=i;if(isNaN(s)||isNaN(n)||!e)return!1;const r=e.hasOwnProperty("width")&&s<=(e.width??0),o=e.hasOwnProperty("height")&&n<=(e.height??0);return r||o}_setDockEnabledForViewSize(t){t.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(t))}};a([l({readOnly:!0})],$.prototype,"_featureNavigationTop",null),a([l()],$.prototype,"actions",null),a([l()],$.prototype,"alignment",void 0),a([l()],$.prototype,"autoCloseEnabled",null),a([l()],$.prototype,"autoOpenEnabled",null),a([l()],$.prototype,"defaultPopupTemplateEnabled",null),a([l()],$.prototype,"content",null),a([l()],$.prototype,"collapsed",void 0),a([l()],$.prototype,"collapseEnabled",null),a([l({readOnly:!0})],$.prototype,"currentAlignment",null),a([l({readOnly:!0})],$.prototype,"currentDockPosition",null),a([l()],$.prototype,"dockOptions",null),a([l()],$.prototype,"dockEnabled",void 0),a([l({readOnly:!0})],$.prototype,"featureCount",null),a([l()],$.prototype,"featureMenuOpen",null),a([l()],$.prototype,"features",null),a([l()],$.prototype,"goToOverride",null),a([l()],$.prototype,"headingLevel",void 0),a([l()],$.prototype,"highlightEnabled",null),a([l()],$.prototype,"location",null),a([l()],$.prototype,"label",null),a([l(),te("esri/widgets/Popup/t9n/Popup")],$.prototype,"messages",void 0),a([l()],$.prototype,"promises",null),a([l({readOnly:!0})],$.prototype,"selectedFeature",null),a([l()],$.prototype,"selectedFeatureIndex",null),a([l({readOnly:!0})],$.prototype,"selectedFeatureWidget",null),a([l()],$.prototype,"spinnerEnabled",null),a([l()],$.prototype,"title",null),a([l()],$.prototype,"updateLocationEnabled",null),a([l()],$.prototype,"view",null),a([l({type:bs}),ds(["triggerAction","trigger-action"])],$.prototype,"viewModel",void 0),a([l()],$.prototype,"visible",null),a([l({type:qt,nonNullable:!0})],$.prototype,"visibleElements",void 0),$=a([N("esri.widgets.Popup")],$);const Ua=$;export{Ua as default}; diff --git a/assets/Program-DLRmaKpw.js b/assets/Program-DBsYtQ00.js similarity index 99% rename from assets/Program-DLRmaKpw.js rename to assets/Program-DBsYtQ00.js index 124131c..f1278d0 100644 --- a/assets/Program-DLRmaKpw.js +++ b/assets/Program-DBsYtQ00.js @@ -1,4 +1,4 @@ -import{iy as _,fX as L,gf as g,g5 as y,iz as De,iA as Re,iB as Fe,s as X,eB as E,v as K,U as Me,iC as W,iD as U,it as S,fV as q,is as R,ar as V,iE as T}from"./index-CEWggaxV.js";import{u as I,a as ye,b as N,m as C,c as Ue,d as j}from"./Texture-DJgkMrSB.js";const A=()=>X.getLogger("esri.views.webgl.BufferObject");let Ce=class F{static createIndex(e,r,t){return new F(e,_.ELEMENT_ARRAY_BUFFER,r,t)}static createVertex(e,r,t){return new F(e,_.ARRAY_BUFFER,r,t)}static createUniform(e,r,t){return new F(e,_.UNIFORM_BUFFER,r,t)}static createPixelPack(e,r=L.STREAM_READ,t){const n=new F(e,_.PIXEL_PACK_BUFFER,r);return t&&n.setSize(t),n}static createPixelUnpack(e,r=L.STREAM_DRAW,t){return new F(e,_.PIXEL_UNPACK_BUFFER,r,t)}static createTransformFeedback(e,r=L.STATIC_DRAW,t){const n=new F(e,_.TRANSFORM_FEEDBACK_BUFFER,r);return n.setSize(t),n}constructor(e,r,t,n){this._context=e,this.bufferType=r,this.usage=t,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(g.BufferObject,this),this._glName=this._context.gl.createBuffer(),I(this._context.gl),n&&this.setData(n)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get usedMemory(){return this.bufferType===_.ELEMENT_ARRAY_BUFFER?this._indexType===y.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===_.ELEMENT_ARRAY_BUFFER||this.bufferType===_.ARRAY_BUFFER}dispose(){var e;(e=this._context)!=null&&e.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(g.BufferObject,this),this._context=null):this._glName&&A().warn("Leaked WebGL buffer object")}setSize(e,r=null){if(e<=0&&A().error("Buffer size needs to be positive!"),this.bufferType===_.ELEMENT_ARRAY_BUFFER&&r!=null)switch(this._indexType=r,r){case y.UNSIGNED_SHORT:e*=2;break;case y.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let r=e.byteLength;this.bufferType===_.ELEMENT_ARRAY_BUFFER&&(De(e)&&(r/=2,this._indexType=y.UNSIGNED_SHORT),Re(e)&&(r/=4,this._indexType=y.UNSIGNED_INT)),this._setBufferData(r,e)}_setBufferData(e,r=null){this._size=e;const t=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const n=this._context.gl;r!=null?n.bufferData(this.bufferType,r,this.usage):n.bufferData(this.bufferType,e,this.usage),I(n),this._isVAOAware&&this._context.bindVAO(t)}setSubData(e,r,t,n){if(!e)return;(r<0||r*e.BYTES_PER_ELEMENT>=this.usedMemory)&&A().error("offset is out of range!"),t>=n&&A().error("end must be bigger than start!"),(r+(n-t))*e.BYTES_PER_ELEMENT>this.usedMemory&&A().error("An attempt to write beyond the end of the buffer!");const s=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:o}=this._context;o.bufferSubData(this.bufferType,r*e.BYTES_PER_ELEMENT,e,t,n-t),I(o),this._isVAOAware&&this._context.bindVAO(s)}getSubData(e,r=0,t,n){if(t<0||n<0)return void A().error("Problem getting subdata: offset and length were less than zero!");const s=ve(e)?e.BYTES_PER_ELEMENT:1;if(s*((t??0)+(n??0))>e.byteLength)return void A().error("Problem getting subdata: offset and length exceeded destination size!");r+s*(n??0)>this.usedMemory&&A().warn("Potential problem getting subdata: requested data exceeds buffer size!");const o=this._context.gl;this.bufferType===_.TRANSFORM_FEEDBACK_BUFFER?(this._context.bindBuffer(this,_.TRANSFORM_FEEDBACK_BUFFER),o.getBufferSubData(_.TRANSFORM_FEEDBACK_BUFFER,r,e,t,n),this._context.unbindBuffer(_.TRANSFORM_FEEDBACK_BUFFER)):(this._context.bindBuffer(this,_.COPY_READ_BUFFER),o.getBufferSubData(_.COPY_READ_BUFFER,r,e,t,n),this._context.unbindBuffer(_.COPY_READ_BUFFER))}async getSubDataAsync(e,r=0,t,n){await this._context.clientWaitAsync(),this.getSubData(e,r,t,n)}};function ve(i){return Fe(i)}let ht=class{constructor(e,r,t=r){this.internalFormat=e,this.width=r,this.height=t,this.multisampled=!1,this.samples=1}};function we(i){return i.width<=0||i.height<=0||i.internalFormat==null?0:i.width*i.height*ye(i.internalFormat)}let Ne=class{constructor(e,r){this._context=e,this._descriptor=r,this.type=N.RenderBuffer,this._context.instanceCounter.increment(g.Renderbuffer,this);const t=this._context.gl;this.glName=t.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:n,height:s,internalFormat:o,multisampled:h}=r;h?t.renderbufferStorageMultisample(t.RENDERBUFFER,this.samples,o,n,s):t.renderbufferStorage(t.RENDERBUFFER,o,n,s)}get descriptor(){return this._descriptor}get samples(){const e=this._descriptor.samples,r=this._context.parameters.maxSamples;return e?Math.min(e,r):r}get usedMemory(){return we(this._descriptor)}resize(e,r){const t=this._descriptor;if(t.width===e&&t.height===r)return;t.width=e,t.height=r;const n=this._context.gl;this._context.bindRenderbuffer(this),t.multisampled?n.renderbufferStorageMultisample(n.RENDERBUFFER,this.samples,t.internalFormat,t.width,t.height):n.renderbufferStorage(n.RENDERBUFFER,t.internalFormat,t.width,t.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(g.Renderbuffer,this),this._context=null)}};const Be=()=>X.getLogger("esri.views.webgl.FramebufferObject");let Pe=class v{constructor(e,r,t=null){this._context=e,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,e.instanceCounter.increment(g.FramebufferObject,this);const n=O(r)?r:new C(this._context,r);if(this._colorAttachments.set(E.COLOR_ATTACHMENT0,n),this._validateTextureDescriptor(n.descriptor),this._validateColorAttachmentPoint(E.COLOR_ATTACHMENT0),t!=null)if(Oe(t))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),this._depthStencilTexture=O(t)?t:new C(this._context,t),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const s=Le(t)?t:new Ne(this._context,t);this._depthStencilBuffer=s,this._validateRenderBufferDescriptor(s.descriptor)}}dispose(){var r,t;if(this._colorAttachments.size===0&&!this._glName)return;const e=this._context.getBoundFramebufferObject();this._colorAttachments.forEach((n,s)=>{var o;return(o=this.detachColorTexture(s))==null?void 0:o.dispose()}),(r=this.detachDepthStencilBuffer())==null||r.dispose(),(t=this.detachDepthStencilTexture())==null||t.dispose(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(e),this._context.instanceCounter.decrement(g.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(E.COLOR_ATTACHMENT0)}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){var r;const e=this._colorAttachments.get(E.COLOR_ATTACHMENT0);return((r=e==null?void 0:e.descriptor)==null?void 0:r.width)??0}get height(){var r;const e=this._colorAttachments.get(E.COLOR_ATTACHMENT0);return((r=e==null?void 0:e.descriptor)==null?void 0:r.height)??0}get usedMemory(){var e;return[...this._colorAttachments].reduce((r,[t,n])=>r+n.usedMemory,((e=this.depthStencil)==null?void 0:e.usedMemory)??0)}getColorTexture(e){const r=this._colorAttachments.get(e);return r&&O(r)?r:null}get colorAttachments(){return[...this._colorAttachments.keys()]}attachColorTexture(e,r=E.COLOR_ATTACHMENT0){var n;if(!e)return;this._validateColorAttachmentPoint(r);const t=e.descriptor;this._validateTextureDescriptor(t),(n=this.detachColorTexture(r))==null||n.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,r)),this._colorAttachments.set(r,e)}detachColorTexture(e=E.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(e);if(r){if(this._initialized){const t=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e),this._context.bindFramebuffer(t)}return this._colorAttachments.delete(e),r}}setColorTextureTarget(e,r=E.COLOR_ATTACHMENT0){const t=this._colorAttachments.get(r);t&&this._framebufferTexture2D(t.glName,r,e)}attachDepthStencil(e){if(e)switch(e.type){case N.Texture:return this._attachDepthStencilTexture(e);case N.RenderBuffer:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){var t;if(e==null)return;const r=e.descriptor;r.pixelFormat!==K.DEPTH_STENCIL&&r.pixelFormat!==K.DEPTH24_STENCIL8&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),r.dataType!==Me.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),this._validateTextureDescriptor(r),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,W)),(t=this._depthStencilTexture)==null||t.dispose(),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,W)),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(e==null)return;const r=e.descriptor;if(this._validateRenderBufferDescriptor(r),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const t=this._context.gl,n=this._getGLAttachmentPoint(r);t.framebufferRenderbuffer(U.FRAMEBUFFER,n,t.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){const e=this._depthStencilBuffer;if(e&&this._initialized){this._context.bindFramebuffer(this);const r=this._context.gl,t=this._getGLAttachmentPoint(e.descriptor);r.framebufferRenderbuffer(U.FRAMEBUFFER,t,r.RENDERBUFFER,null)}return this._depthStencilBuffer=null,e}copyToTexture(e,r,t,n,s,o,h){(e<0||r<0||s<0||o<0)&&console.error("Offsets cannot be negative!"),(t<=0||n<=0)&&console.error("Copy width and height must be greater than zero!");const a=h.descriptor;h.descriptor.target!==S.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),((a==null?void 0:a.width)==null||(a==null?void 0:a.height)==null||e+t>this.width||r+n>this.height||s+t>a.width||o+n>a.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const l=this._context,c=l.bindTexture(h,C.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(C.TEXTURE_UNIT_FOR_UPDATES),l.bindFramebuffer(this),l.gl.copyTexSubImage2D(S.TEXTURE_2D,0,s,o,e,r,t,n),l.bindTexture(c,C.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,r,t,n,s,o,h){(t<=0||n<=0)&&console.error("Copy width and height must be greater than zero!"),h||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,r,t,n,s,o,h)}async readPixelsAsync(e,r,t,n,s,o,h){const{gl:a}=this._context,l=Ce.createPixelPack(this._context,L.STREAM_READ,h.byteLength);this._context.bindBuffer(l),this._context.bindFramebuffer(this),a.readPixels(e,r,t,n,s,o,0),this._context.unbindBuffer(_.PIXEL_PACK_BUFFER),await l.getSubDataAsync(h),l.dispose()}resize(e,r){var n,s;if(this.width===e&&this.height===r)return;const t={width:e,height:r};B(t,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(o=>o.resize(t.width,t.height)),(n=this._depthStencilTexture)==null||n.resize(t.width,t.height),this._initialized&&(B(t,this._context.parameters.maxRenderbufferSize),(s=this._depthStencilBuffer)==null||s.resize(t.width,t.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}initializeAndBind(e=U.FRAMEBUFFER){const r=this._context.gl;if(this._initialized)return void r.bindFramebuffer(e,this.glName);this._glName&&r.deleteFramebuffer(this._glName);const t=r.createFramebuffer();if(r.bindFramebuffer(e,t),this._colorAttachments.forEach((n,s)=>this._framebufferTexture2D(n.glName,s,Q(n),e)),this._depthStencilBuffer){const n=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);r.framebufferRenderbuffer(e,n,r.RENDERBUFFER,this._depthStencilBuffer.glName)}else this._depthStencilTexture&&this._framebufferTexture2D(this._depthStencilTexture.glName,r.DEPTH_STENCIL_ATTACHMENT,Q(this._depthStencilTexture),e);Ue()&&r.checkFramebufferStatus(e)!==r.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=t,this._initialized=!0}_framebufferTexture2D(e,r=E.COLOR_ATTACHMENT0,t=S.TEXTURE_2D,n=U.FRAMEBUFFER,s=0){this._context.gl.framebufferTexture2D(n,r,t,e,s)}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const r=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(U.FRAMEBUFFER,r,e.RENDERBUFFER,null)}this._depthStencilBuffer=q(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture=q(this._depthStencilTexture))}_validateTextureDescriptor(e){e.target!==S.TEXTURE_2D&&e.target!==S.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),B(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderBufferDescriptor(e){B(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width===e.width&&this.height===e.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(e){switch(e.internalFormat){case R.DEPTH_COMPONENT16:case R.DEPTH_COMPONENT24:case R.DEPTH_COMPONENT32F:return this._context.gl.DEPTH_ATTACHMENT;case R.DEPTH24_STENCIL8:case R.DEPTH32F_STENCIL8:case R.DEPTH_STENCIL:return this._context.gl.DEPTH_STENCIL_ATTACHMENT;case R.STENCIL_INDEX8:return this._context.gl.STENCIL_ATTACHMENT}}_validateColorAttachmentPoint(e){if(v._MAX_COLOR_ATTACHMENTS===-1){const{gl:t}=this._context;v._MAX_COLOR_ATTACHMENTS=t.getParameter(t.MAX_COLOR_ATTACHMENTS)}const r=e-E.COLOR_ATTACHMENT0;r+1>v._MAX_COLOR_ATTACHMENTS&&X.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${r+1}. Implementation supports up to ${v._MAX_COLOR_ATTACHMENTS} color attachments`)}};function O(i){return i!=null&&"type"in i&&i.type===N.Texture}function Le(i){return i!=null&&"type"in i&&i.type===N.RenderBuffer}function Oe(i){return O(i)||i!=null&&"pixelFormat"in i}function B(i,e){const r=Math.max(i.width,i.height);if(r>e){Be().warn(`Resizing FBO attachment size ${i.width}x${i.height} to device limit ${e}`);const t=e/r;return i.width=Math.round(i.width*t),i.height=Math.round(i.height*t),!1}return!0}function Q(i){return i.descriptor.target===S.TEXTURE_CUBE_MAP?S.TEXTURE_CUBE_MAP_POSITIVE_X:S.TEXTURE_2D}Pe._MAX_COLOR_ATTACHMENTS=-1;const ke=["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"];var Z,ce={exports:{}};(Z=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"])!==void 0&&(ce.exports=Z);const Ie=V(ce.exports);var J,le={exports:{}};J=le,function(i){var e=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"];e!==void 0&&(J.exports=e)}();const ee=V(le.exports);var ue={exports:{}};(function(i){(function(e){var r=function(){return["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT","textureSize","texelFetch"]}();r!==void 0&&(i.exports=r)})()})(ue);const $e=V(ue.exports);var x=999,te=9999,$=0,z=1,re=2,ie=3,ne=4,P=5,ze=6,He=7,je=8,se=9,Xe=10,oe=11,Ve=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function Ge(){var i,e,r,t=0,n=0,s=x,o=[],h=[],a=1,l=0,c=0,f=!1,d=!1,p="";return function(u){return h=[],u!==null?_e(u.replace?u.replace(/\r\n/g,` +import{iy as _,fX as L,gf as g,g5 as y,iz as De,iA as Re,iB as Fe,s as X,eB as E,v as K,U as Me,iC as W,iD as U,it as S,fV as q,is as R,ar as V,iE as T}from"./index-BjUNJPVf.js";import{u as I,a as ye,b as N,m as C,c as Ue,d as j}from"./Texture-S4dD-WHn.js";const A=()=>X.getLogger("esri.views.webgl.BufferObject");let Ce=class F{static createIndex(e,r,t){return new F(e,_.ELEMENT_ARRAY_BUFFER,r,t)}static createVertex(e,r,t){return new F(e,_.ARRAY_BUFFER,r,t)}static createUniform(e,r,t){return new F(e,_.UNIFORM_BUFFER,r,t)}static createPixelPack(e,r=L.STREAM_READ,t){const n=new F(e,_.PIXEL_PACK_BUFFER,r);return t&&n.setSize(t),n}static createPixelUnpack(e,r=L.STREAM_DRAW,t){return new F(e,_.PIXEL_UNPACK_BUFFER,r,t)}static createTransformFeedback(e,r=L.STATIC_DRAW,t){const n=new F(e,_.TRANSFORM_FEEDBACK_BUFFER,r);return n.setSize(t),n}constructor(e,r,t,n){this._context=e,this.bufferType=r,this.usage=t,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(g.BufferObject,this),this._glName=this._context.gl.createBuffer(),I(this._context.gl),n&&this.setData(n)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get usedMemory(){return this.bufferType===_.ELEMENT_ARRAY_BUFFER?this._indexType===y.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===_.ELEMENT_ARRAY_BUFFER||this.bufferType===_.ARRAY_BUFFER}dispose(){var e;(e=this._context)!=null&&e.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(g.BufferObject,this),this._context=null):this._glName&&A().warn("Leaked WebGL buffer object")}setSize(e,r=null){if(e<=0&&A().error("Buffer size needs to be positive!"),this.bufferType===_.ELEMENT_ARRAY_BUFFER&&r!=null)switch(this._indexType=r,r){case y.UNSIGNED_SHORT:e*=2;break;case y.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let r=e.byteLength;this.bufferType===_.ELEMENT_ARRAY_BUFFER&&(De(e)&&(r/=2,this._indexType=y.UNSIGNED_SHORT),Re(e)&&(r/=4,this._indexType=y.UNSIGNED_INT)),this._setBufferData(r,e)}_setBufferData(e,r=null){this._size=e;const t=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const n=this._context.gl;r!=null?n.bufferData(this.bufferType,r,this.usage):n.bufferData(this.bufferType,e,this.usage),I(n),this._isVAOAware&&this._context.bindVAO(t)}setSubData(e,r,t,n){if(!e)return;(r<0||r*e.BYTES_PER_ELEMENT>=this.usedMemory)&&A().error("offset is out of range!"),t>=n&&A().error("end must be bigger than start!"),(r+(n-t))*e.BYTES_PER_ELEMENT>this.usedMemory&&A().error("An attempt to write beyond the end of the buffer!");const s=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:o}=this._context;o.bufferSubData(this.bufferType,r*e.BYTES_PER_ELEMENT,e,t,n-t),I(o),this._isVAOAware&&this._context.bindVAO(s)}getSubData(e,r=0,t,n){if(t<0||n<0)return void A().error("Problem getting subdata: offset and length were less than zero!");const s=ve(e)?e.BYTES_PER_ELEMENT:1;if(s*((t??0)+(n??0))>e.byteLength)return void A().error("Problem getting subdata: offset and length exceeded destination size!");r+s*(n??0)>this.usedMemory&&A().warn("Potential problem getting subdata: requested data exceeds buffer size!");const o=this._context.gl;this.bufferType===_.TRANSFORM_FEEDBACK_BUFFER?(this._context.bindBuffer(this,_.TRANSFORM_FEEDBACK_BUFFER),o.getBufferSubData(_.TRANSFORM_FEEDBACK_BUFFER,r,e,t,n),this._context.unbindBuffer(_.TRANSFORM_FEEDBACK_BUFFER)):(this._context.bindBuffer(this,_.COPY_READ_BUFFER),o.getBufferSubData(_.COPY_READ_BUFFER,r,e,t,n),this._context.unbindBuffer(_.COPY_READ_BUFFER))}async getSubDataAsync(e,r=0,t,n){await this._context.clientWaitAsync(),this.getSubData(e,r,t,n)}};function ve(i){return Fe(i)}let ht=class{constructor(e,r,t=r){this.internalFormat=e,this.width=r,this.height=t,this.multisampled=!1,this.samples=1}};function we(i){return i.width<=0||i.height<=0||i.internalFormat==null?0:i.width*i.height*ye(i.internalFormat)}let Ne=class{constructor(e,r){this._context=e,this._descriptor=r,this.type=N.RenderBuffer,this._context.instanceCounter.increment(g.Renderbuffer,this);const t=this._context.gl;this.glName=t.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:n,height:s,internalFormat:o,multisampled:h}=r;h?t.renderbufferStorageMultisample(t.RENDERBUFFER,this.samples,o,n,s):t.renderbufferStorage(t.RENDERBUFFER,o,n,s)}get descriptor(){return this._descriptor}get samples(){const e=this._descriptor.samples,r=this._context.parameters.maxSamples;return e?Math.min(e,r):r}get usedMemory(){return we(this._descriptor)}resize(e,r){const t=this._descriptor;if(t.width===e&&t.height===r)return;t.width=e,t.height=r;const n=this._context.gl;this._context.bindRenderbuffer(this),t.multisampled?n.renderbufferStorageMultisample(n.RENDERBUFFER,this.samples,t.internalFormat,t.width,t.height):n.renderbufferStorage(n.RENDERBUFFER,t.internalFormat,t.width,t.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(g.Renderbuffer,this),this._context=null)}};const Be=()=>X.getLogger("esri.views.webgl.FramebufferObject");let Pe=class v{constructor(e,r,t=null){this._context=e,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,e.instanceCounter.increment(g.FramebufferObject,this);const n=O(r)?r:new C(this._context,r);if(this._colorAttachments.set(E.COLOR_ATTACHMENT0,n),this._validateTextureDescriptor(n.descriptor),this._validateColorAttachmentPoint(E.COLOR_ATTACHMENT0),t!=null)if(Oe(t))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),this._depthStencilTexture=O(t)?t:new C(this._context,t),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const s=Le(t)?t:new Ne(this._context,t);this._depthStencilBuffer=s,this._validateRenderBufferDescriptor(s.descriptor)}}dispose(){var r,t;if(this._colorAttachments.size===0&&!this._glName)return;const e=this._context.getBoundFramebufferObject();this._colorAttachments.forEach((n,s)=>{var o;return(o=this.detachColorTexture(s))==null?void 0:o.dispose()}),(r=this.detachDepthStencilBuffer())==null||r.dispose(),(t=this.detachDepthStencilTexture())==null||t.dispose(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(e),this._context.instanceCounter.decrement(g.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(E.COLOR_ATTACHMENT0)}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){var r;const e=this._colorAttachments.get(E.COLOR_ATTACHMENT0);return((r=e==null?void 0:e.descriptor)==null?void 0:r.width)??0}get height(){var r;const e=this._colorAttachments.get(E.COLOR_ATTACHMENT0);return((r=e==null?void 0:e.descriptor)==null?void 0:r.height)??0}get usedMemory(){var e;return[...this._colorAttachments].reduce((r,[t,n])=>r+n.usedMemory,((e=this.depthStencil)==null?void 0:e.usedMemory)??0)}getColorTexture(e){const r=this._colorAttachments.get(e);return r&&O(r)?r:null}get colorAttachments(){return[...this._colorAttachments.keys()]}attachColorTexture(e,r=E.COLOR_ATTACHMENT0){var n;if(!e)return;this._validateColorAttachmentPoint(r);const t=e.descriptor;this._validateTextureDescriptor(t),(n=this.detachColorTexture(r))==null||n.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,r)),this._colorAttachments.set(r,e)}detachColorTexture(e=E.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(e);if(r){if(this._initialized){const t=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e),this._context.bindFramebuffer(t)}return this._colorAttachments.delete(e),r}}setColorTextureTarget(e,r=E.COLOR_ATTACHMENT0){const t=this._colorAttachments.get(r);t&&this._framebufferTexture2D(t.glName,r,e)}attachDepthStencil(e){if(e)switch(e.type){case N.Texture:return this._attachDepthStencilTexture(e);case N.RenderBuffer:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){var t;if(e==null)return;const r=e.descriptor;r.pixelFormat!==K.DEPTH_STENCIL&&r.pixelFormat!==K.DEPTH24_STENCIL8&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),r.dataType!==Me.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),this._validateTextureDescriptor(r),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,W)),(t=this._depthStencilTexture)==null||t.dispose(),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,W)),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(e==null)return;const r=e.descriptor;if(this._validateRenderBufferDescriptor(r),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const t=this._context.gl,n=this._getGLAttachmentPoint(r);t.framebufferRenderbuffer(U.FRAMEBUFFER,n,t.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){const e=this._depthStencilBuffer;if(e&&this._initialized){this._context.bindFramebuffer(this);const r=this._context.gl,t=this._getGLAttachmentPoint(e.descriptor);r.framebufferRenderbuffer(U.FRAMEBUFFER,t,r.RENDERBUFFER,null)}return this._depthStencilBuffer=null,e}copyToTexture(e,r,t,n,s,o,h){(e<0||r<0||s<0||o<0)&&console.error("Offsets cannot be negative!"),(t<=0||n<=0)&&console.error("Copy width and height must be greater than zero!");const a=h.descriptor;h.descriptor.target!==S.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),((a==null?void 0:a.width)==null||(a==null?void 0:a.height)==null||e+t>this.width||r+n>this.height||s+t>a.width||o+n>a.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const l=this._context,c=l.bindTexture(h,C.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(C.TEXTURE_UNIT_FOR_UPDATES),l.bindFramebuffer(this),l.gl.copyTexSubImage2D(S.TEXTURE_2D,0,s,o,e,r,t,n),l.bindTexture(c,C.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,r,t,n,s,o,h){(t<=0||n<=0)&&console.error("Copy width and height must be greater than zero!"),h||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,r,t,n,s,o,h)}async readPixelsAsync(e,r,t,n,s,o,h){const{gl:a}=this._context,l=Ce.createPixelPack(this._context,L.STREAM_READ,h.byteLength);this._context.bindBuffer(l),this._context.bindFramebuffer(this),a.readPixels(e,r,t,n,s,o,0),this._context.unbindBuffer(_.PIXEL_PACK_BUFFER),await l.getSubDataAsync(h),l.dispose()}resize(e,r){var n,s;if(this.width===e&&this.height===r)return;const t={width:e,height:r};B(t,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(o=>o.resize(t.width,t.height)),(n=this._depthStencilTexture)==null||n.resize(t.width,t.height),this._initialized&&(B(t,this._context.parameters.maxRenderbufferSize),(s=this._depthStencilBuffer)==null||s.resize(t.width,t.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}initializeAndBind(e=U.FRAMEBUFFER){const r=this._context.gl;if(this._initialized)return void r.bindFramebuffer(e,this.glName);this._glName&&r.deleteFramebuffer(this._glName);const t=r.createFramebuffer();if(r.bindFramebuffer(e,t),this._colorAttachments.forEach((n,s)=>this._framebufferTexture2D(n.glName,s,Q(n),e)),this._depthStencilBuffer){const n=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);r.framebufferRenderbuffer(e,n,r.RENDERBUFFER,this._depthStencilBuffer.glName)}else this._depthStencilTexture&&this._framebufferTexture2D(this._depthStencilTexture.glName,r.DEPTH_STENCIL_ATTACHMENT,Q(this._depthStencilTexture),e);Ue()&&r.checkFramebufferStatus(e)!==r.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=t,this._initialized=!0}_framebufferTexture2D(e,r=E.COLOR_ATTACHMENT0,t=S.TEXTURE_2D,n=U.FRAMEBUFFER,s=0){this._context.gl.framebufferTexture2D(n,r,t,e,s)}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const r=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(U.FRAMEBUFFER,r,e.RENDERBUFFER,null)}this._depthStencilBuffer=q(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture=q(this._depthStencilTexture))}_validateTextureDescriptor(e){e.target!==S.TEXTURE_2D&&e.target!==S.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),B(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderBufferDescriptor(e){B(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width===e.width&&this.height===e.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(e){switch(e.internalFormat){case R.DEPTH_COMPONENT16:case R.DEPTH_COMPONENT24:case R.DEPTH_COMPONENT32F:return this._context.gl.DEPTH_ATTACHMENT;case R.DEPTH24_STENCIL8:case R.DEPTH32F_STENCIL8:case R.DEPTH_STENCIL:return this._context.gl.DEPTH_STENCIL_ATTACHMENT;case R.STENCIL_INDEX8:return this._context.gl.STENCIL_ATTACHMENT}}_validateColorAttachmentPoint(e){if(v._MAX_COLOR_ATTACHMENTS===-1){const{gl:t}=this._context;v._MAX_COLOR_ATTACHMENTS=t.getParameter(t.MAX_COLOR_ATTACHMENTS)}const r=e-E.COLOR_ATTACHMENT0;r+1>v._MAX_COLOR_ATTACHMENTS&&X.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${r+1}. Implementation supports up to ${v._MAX_COLOR_ATTACHMENTS} color attachments`)}};function O(i){return i!=null&&"type"in i&&i.type===N.Texture}function Le(i){return i!=null&&"type"in i&&i.type===N.RenderBuffer}function Oe(i){return O(i)||i!=null&&"pixelFormat"in i}function B(i,e){const r=Math.max(i.width,i.height);if(r>e){Be().warn(`Resizing FBO attachment size ${i.width}x${i.height} to device limit ${e}`);const t=e/r;return i.width=Math.round(i.width*t),i.height=Math.round(i.height*t),!1}return!0}function Q(i){return i.descriptor.target===S.TEXTURE_CUBE_MAP?S.TEXTURE_CUBE_MAP_POSITIVE_X:S.TEXTURE_2D}Pe._MAX_COLOR_ATTACHMENTS=-1;const ke=["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"];var Z,ce={exports:{}};(Z=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"])!==void 0&&(ce.exports=Z);const Ie=V(ce.exports);var J,le={exports:{}};J=le,function(i){var e=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"];e!==void 0&&(J.exports=e)}();const ee=V(le.exports);var ue={exports:{}};(function(i){(function(e){var r=function(){return["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT","textureSize","texelFetch"]}();r!==void 0&&(i.exports=r)})()})(ue);const $e=V(ue.exports);var x=999,te=9999,$=0,z=1,re=2,ie=3,ne=4,P=5,ze=6,He=7,je=8,se=9,Xe=10,oe=11,Ve=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function Ge(){var i,e,r,t=0,n=0,s=x,o=[],h=[],a=1,l=0,c=0,f=!1,d=!1,p="";return function(u){return h=[],u!==null?_e(u.replace?u.replace(/\r\n/g,` `):u):de()};function m(u){u.length&&h.push({type:Ve[s],data:u,position:c,line:a,column:l})}function _e(u){var D;for(t=0,r=(p+=u).length;i=p[t],t0)continue;M=u.slice(0,1).join("")}return m(M),c+=M.length,(o=o.slice(M.length)).length}}function Ee(){return/[^a-fA-F0-9]/.test(i)?(m(o.join("")),s=x,t):(o.push(i),e=i,t+1)}function be(){return i==="."||/[eE]/.test(i)?(o.push(i),s=P,e=i,t+1):i==="x"&&o.length===1&&o[0]==="0"?(s=oe,o.push(i),e=i,t+1):/[^\d]/.test(i)?(m(o.join("")),s=x,t):(o.push(i),e=i,t+1)}function Ae(){return i==="f"&&(o.push(i),e=i,t+=1),/[eE]/.test(i)||i==="-"&&/[eE]/.test(e)?(o.push(i),e=i,t+1):/[^\d]/.test(i)?(m(o.join("")),s=x,t):(o.push(i),e=i,t+1)}function Se(){if(/[^\d\w_]/.test(i)){var u=o.join("");return s=Ie.indexOf(u)>-1?je:$e.indexOf(u)>-1?He:ze,m(o.join("")),s=x,t}return o.push(i),e=i,t+1}}function Ye(i){var e=Ge(),r=[];return r=(r=r.concat(e(i))).concat(e(null))}function Ke(i){return Ye(i)}function We(i){return i.map(e=>e.type!=="eof"?e.data:"").join("")}const H=new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]);function qe(i,e="100",r="300 es"){const t=/^\s*\#version\s+([0-9]+(\s+[a-zA-Z]+)?)\s*/;for(const n of i)if(n.type==="preprocessor"){const s=t.exec(n.data);if(s){const o=s[1].replaceAll(/\s\s+/g," ");if(o===r)return o;if(o===e)return n.data="#version "+r,e;throw new Error("unknown glsl version: "+o)}}return i.splice(0,0,{type:"preprocessor",data:"#version "+r},{type:"whitespace",data:` diff --git a/assets/ProgramTemplate-BICQrNzS.js b/assets/ProgramTemplate-Ck2I0bIi.js similarity index 93% rename from assets/ProgramTemplate-BICQrNzS.js rename to assets/ProgramTemplate-Ck2I0bIi.js index 2ce1b3f..704885a 100644 --- a/assets/ProgramTemplate-BICQrNzS.js +++ b/assets/ProgramTemplate-Ck2I0bIi.js @@ -1 +1 @@ -import{ge as c,fV as _,gf as f,s as d}from"./index-CEWggaxV.js";import{E as x}from"./Texture-DJgkMrSB.js";import{r as g}from"./Program-DLRmaKpw.js";let V=class{constructor(e){this._readFile=e}resolveIncludes(e){return this._resolve(e)}_resolve(e,r=new Map){if(r.has(e))return r.get(e);const i=this._read(e);if(!i)throw new Error(`cannot find shader file ${e}`);const n=/^[^\S\n]*#include\s+<(\S+)>[^\S\n]?/gm;let s=n.exec(i);const o=[];for(;s!=null;)o.push({path:s[1],start:s.index,length:s[0].length}),s=n.exec(i);let u=0,l="";return o.forEach(h=>{l+=i.slice(u,h.start),l+=r.has(h.path)?"":this._resolve(h.path,r),u=h.start+h.length}),l+=i.slice(u),r.set(e,l),l}_read(e){return this._readFile(e)}};const a=()=>d.getLogger("esri.views.webgl.VertexArrayObject");let A=class{constructor(t,e,r,i,n=null){this._context=t,this._locations=e,this._layout=r,this._buffers=i,this._indexBuffer=n,this._glName=null,this._initialized=!1}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get byteSize(){return Object.keys(this._buffers).reduce((t,e)=>t+this._buffers[e].usedMemory,this._indexBuffer!=null?this._indexBuffer.usedMemory:0)}get layout(){return this._layout}get locations(){return this._locations}get usedMemory(){return this.byteSize+(Object.keys(this._buffers).length+(this._indexBuffer?1:0))*c}dispose(){var t;if(this._context){this._context.getBoundVAO()===this&&this._context.bindVAO(null);for(const e in this._buffers)(t=this._buffers[e])==null||t.dispose(),delete this._buffers[e];this._indexBuffer=_(this._indexBuffer),this.disposeVAOOnly()}else(this._glName||Object.getOwnPropertyNames(this._buffers).length>0)&&a().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._glName&&(this._context.gl.deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(f.VertexArrayObject,this)),this._context=null}initialize(){if(this._initialized)return;const{gl:t}=this._context,e=t.createVertexArray();t.bindVertexArray(e),this._bindLayout(),t.bindVertexArray(null),this._glName=e,this._context.instanceCounter.increment(f.VertexArrayObject,this),this._initialized=!0}bind(){this.initialize(),this._context.gl.bindVertexArray(this.glName)}_bindLayout(){const{_buffers:t,_layout:e,_indexBuffer:r}=this;t||a().error("Vertex buffer dictionary is empty!");const i=this._context.gl;for(const n in t){const s=t[n];s||a().error("Vertex buffer is uninitialized!");const o=e[n];o||a().error("Vertex element descriptor is empty!"),x(this._context,this._locations,s,o)}r!=null&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,r.glName)}unbind(){this.initialize(),this._context.gl.bindVertexArray(null)}};function O(t,e,r=""){return new g(t,r+e.shaders.vertexShader,r+e.shaders.fragmentShader,e.attributes)}export{V as a,O as e,A as o}; +import{ge as c,fV as _,gf as f,s as d}from"./index-BjUNJPVf.js";import{E as x}from"./Texture-S4dD-WHn.js";import{r as g}from"./Program-DBsYtQ00.js";let V=class{constructor(e){this._readFile=e}resolveIncludes(e){return this._resolve(e)}_resolve(e,r=new Map){if(r.has(e))return r.get(e);const i=this._read(e);if(!i)throw new Error(`cannot find shader file ${e}`);const n=/^[^\S\n]*#include\s+<(\S+)>[^\S\n]?/gm;let s=n.exec(i);const o=[];for(;s!=null;)o.push({path:s[1],start:s.index,length:s[0].length}),s=n.exec(i);let u=0,l="";return o.forEach(h=>{l+=i.slice(u,h.start),l+=r.has(h.path)?"":this._resolve(h.path,r),u=h.start+h.length}),l+=i.slice(u),r.set(e,l),l}_read(e){return this._readFile(e)}};const a=()=>d.getLogger("esri.views.webgl.VertexArrayObject");let A=class{constructor(t,e,r,i,n=null){this._context=t,this._locations=e,this._layout=r,this._buffers=i,this._indexBuffer=n,this._glName=null,this._initialized=!1}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get byteSize(){return Object.keys(this._buffers).reduce((t,e)=>t+this._buffers[e].usedMemory,this._indexBuffer!=null?this._indexBuffer.usedMemory:0)}get layout(){return this._layout}get locations(){return this._locations}get usedMemory(){return this.byteSize+(Object.keys(this._buffers).length+(this._indexBuffer?1:0))*c}dispose(){var t;if(this._context){this._context.getBoundVAO()===this&&this._context.bindVAO(null);for(const e in this._buffers)(t=this._buffers[e])==null||t.dispose(),delete this._buffers[e];this._indexBuffer=_(this._indexBuffer),this.disposeVAOOnly()}else(this._glName||Object.getOwnPropertyNames(this._buffers).length>0)&&a().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._glName&&(this._context.gl.deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(f.VertexArrayObject,this)),this._context=null}initialize(){if(this._initialized)return;const{gl:t}=this._context,e=t.createVertexArray();t.bindVertexArray(e),this._bindLayout(),t.bindVertexArray(null),this._glName=e,this._context.instanceCounter.increment(f.VertexArrayObject,this),this._initialized=!0}bind(){this.initialize(),this._context.gl.bindVertexArray(this.glName)}_bindLayout(){const{_buffers:t,_layout:e,_indexBuffer:r}=this;t||a().error("Vertex buffer dictionary is empty!");const i=this._context.gl;for(const n in t){const s=t[n];s||a().error("Vertex buffer is uninitialized!");const o=e[n];o||a().error("Vertex element descriptor is empty!"),x(this._context,this._locations,s,o)}r!=null&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,r.glName)}unbind(){this.initialize(),this._context.gl.bindVertexArray(null)}};function O(t,e,r=""){return new g(t,r+e.shaders.vertexShader,r+e.shaders.fragmentShader,e.attributes)}export{V as a,O as e,A as o}; diff --git a/assets/QueryEngine-RpcY23Sv.js b/assets/QueryEngine-loUu1VUW.js similarity index 98% rename from assets/QueryEngine-RpcY23Sv.js rename to assets/QueryEngine-loUu1VUW.js index 8a1272a..69456b6 100644 --- a/assets/QueryEngine-RpcY23Sv.js +++ b/assets/QueryEngine-loUu1VUW.js @@ -1,7 +1,7 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/geometryEngineJSON-D-7-cYHZ.js","assets/geometryEngineBase-C5__2Su1.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css","assets/json-Wa8cmqdu.js"] + __vite__mapDeps.viteFileDeps = ["assets/geometryEngineJSON-BfS7Q-po.js","assets/geometryEngineBase-CDbTTSsS.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css","assets/json-Wa8cmqdu.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{n as ct,a as Z,h as H,j as V,y as ne,P as Je,x as Te,g as U,b as dt,c as mt,S as Se,v as j,t as ft,I as Re,d as gt}from"./timeSupport-BjRbXIpn.js";import{t as _t,e as pt}from"./OptimizedGeometry-CQuTPb9g.js";import{ee as be,N as A,cC as we,aJ as me,aK as fe,a1 as Xe,c8 as Ke,cL as ge,G as D,O as Ae,cJ as le,_ as yt,jg as Tt,iH as Ce,il as Et,jh as xt,aV as te,ji as _e,ib as et,jj as se,eu as It,d as oe,y as ve,f as Ft,a7 as St,jk as ue,bL as he,g as Rt,P as bt,jl as pe,B as N,s as wt,jm as At,p as Ct,jn as vt,jo as Nt,jp as Ot,a2 as Pt,u as $t,jq as C,dj as Ne,b0 as Oe,at as kt,jr as Dt,bF as Lt,bI as Qt,bo as ce,bM as Vt,bC as Gt,F as Mt,ag as Pe,ab as Ut,am as qt,ai as zt,bG as jt,bO as Bt}from"./index-CEWggaxV.js";import{o as Zt}from"./featureConversionUtils-CmP9mw0r.js";import{x as Ht}from"./WhereClause-Dzgyc0wk.js";import{t as Yt}from"./QueryEngineCapabilities-CTDe3LlQ.js";import{m as $e}from"./quantizationUtils-CUjGHrU3.js";import{w as Wt}from"./utils-B8iadP2F.js";import{c as de,B as Jt,f as Xt,d as ke,p as De,C as Kt,k as es,$ as ts,E as ss,P as is,U as as,T as rs,v as ns}from"./utils-GMt8_G3w.js";import{Z as ls}from"./FieldsIndex-CLgRNeJ_.js";import{I as v}from"./RenderState-DaVlEYWY.js";const Vs={getObjectId:l=>l.objectId,getAttributes:l=>l.attributes,getAttribute:(l,e)=>l.attributes[e],cloneWithGeometry:(l,e)=>new _t(e,l.attributes,null,l.objectId),getGeometry:l=>l.geometry,getCentroid:(l,e)=>(l.centroid==null&&(l.centroid=ct(new pt,l.geometry,e.hasZ,e.hasM)),l.centroid)};class os{constructor(e,t){this._cache=new be(e),this._invalidCache=new be(t)}get(e,t){const i=`${t.uid}:${e}`,a=this._cache.get(i);if(a)return a;if(this._invalidCache.get(i)!=null)return null;try{const s=Ht.create(e,t);return this._cache.put(i,s),s}catch(s){return this._invalidCache.put(i,s),null}}getError(e,t){const i=`${t.uid}:${e}`;return this._invalidCache.get(i)??null}}const tt=new os(50,500),Y="unsupported-query",st=" as ",it=new Set(["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeBigInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong"]),at=new Set(["esriFieldTypeDate","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]),us=new Set(["esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...it,...at]);function Ee(l,e,t={}){const i=G(e,l);if(!i){const s=tt.getError(e,l);throw new A(Y,"invalid SQL expression",{expression:e,error:s})}const a=t.expressionName||"expression";if(t.validateStandardized&&!i.isStandardized)throw new A(Y,`${a} is not standard`,{expression:e});if(t.validateAggregate&&!i.isAggregate)throw new A(Y,`${a} does not contain a valid aggregate function`,{expression:e});return i.fieldNames}function hs(l,e,t,i){if(!t)return!0;const a="where clause";return L(l,e,Ee(l,t,{validateStandardized:!0,expressionName:a}),{expressionName:a,query:i}),!0}function cs(l,e,t,i,a){if(!t)return!0;const s="having clause",r=Ee(l,t,{validateAggregate:!0,expressionName:s});L(l,e,r,{expressionName:s,query:a});const n=G(t,l);if(!(n==null?void 0:n.getExpressions().every(u=>{var m;const{aggregateType:h,field:c}=u,f=(m=l.get(c))==null?void 0:m.name;return i.some(_=>{var S;const{onStatisticField:d,statisticType:x}=_;return((S=l.get(d))==null?void 0:S.name)===f&&x.toLowerCase().trim()===h})})))throw new A(Y,"expressions in having clause should also exist in outStatistics",{having:t});return!0}function G(l,e){return l?tt.get(l,e):null}function rt(l){return/\((.*?)\)/.test(l)?l:l.split(st)[0]}function ds(l){return l.split(st)[1]}function L(l,e,t,i={}){const a=new Map;if(ms(a,l,e,i.allowedFieldTypes??us,t),a.size){const s=i.expressionName??"expression";throw new A(Y,`${s} contains invalid or missing fields`,{errors:Array.from(a.values()),query:i.query})}}function ms(l,e,t,i,a){const s=a.includes("*")?[...t,...a.filter(r=>r!=="*")]:a;for(const r of s)if(e.get(r))Le(l,e,t,i,r);else try{const n=Ee(e,rt(r),{validateStandardized:!0});for(const o of n)Le(l,e,t,i,o)}catch(n){l.set(r,{type:"expression-error",expression:r,error:n})}}function Le(l,e,t,i,a){const s=e.get(a);s?t.has(s.name)?i!=="all"&&(i==null?void 0:i.has(s.type))===!1&&l.set(a,{type:"invalid-type",fieldName:s.name,fieldType:we.fromJSON(s.type),allowedFieldTypes:Array.from(i,r=>we.fromJSON(r))}):l.set(a,{type:"missing-field",fieldName:s.name}):l.set(a,{type:"invalid-field",fieldName:a})}let ee=class{constructor(e,t,i){this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=e.returnDistinctValues??!1,this.fieldsIndex=i,this.featureAdapter=t;const a=e.outFields;if(a&&!a.includes("*")){this.outFields=a;let s=0;for(const r of a){const n=rt(r),o=this.fieldsIndex.get(n),u=o?null:G(n,i),h=o?o.name:ds(r)||"FIELD_EXP_"+s++;this._fieldDataCache.set(r,{alias:h,clause:u})}}}countDistinctValues(e){return this.returnDistinctValues?(e.forEach(t=>this.getAttributes(t)),this._returnDistinctMap.size):e.length}getAttributes(e){const t=this._processAttributesForOutFields(e);return this._processAttributesForDistinctValues(t)}getFieldValue(e,t,i){var r;const a=i?i.name:t;let s=null;return this._fieldDataCache.has(a)?s=(r=this._fieldDataCache.get(a))==null?void 0:r.clause:i||(s=G(t,this.fieldsIndex),this._fieldDataCache.set(a,{alias:a,clause:s})),i?this.featureAdapter.getAttribute(e,a):s==null?void 0:s.calculateValue(e,this.featureAdapter)}getDataValues(e,t,i=!0){const a=t.normalizationType,s=t.normalizationTotal,r=this.fieldsIndex.get(t.field),n=me(r)||fe(r),o=Xe(r);return e.map(u=>{let h=t.field&&this.getFieldValue(u,t.field,this.fieldsIndex.get(t.field));if(t.field2?(h=`${de(h)}${t.fieldDelimiter}${de(this.getFieldValue(u,t.field2,this.fieldsIndex.get(t.field2)))}`,t.field3&&(h=`${h}${t.fieldDelimiter}${de(this.getFieldValue(u,t.field3,this.fieldsIndex.get(t.field3)))}`)):typeof h=="string"&&i&&(n?h=h?new Date(h).getTime():null:o&&(h=h?Wt(h):null)),a&&Number.isFinite(h)){const c=a==="field"&&t.normalizationField?this.getFieldValue(u,t.normalizationField,this.fieldsIndex.get(t.normalizationField)):null;h=Jt(h,a,c,s)}return h})}async getExpressionValues(e,t,i,a,s){const{arcadeUtils:r}=await Ke(),n=r.hasGeometryOperations(t);n&&await r.enableGeometryOperations();const o=r.createFunction(t),u=r.getViewInfo(i),h={fields:this.fieldsIndex.fields};return e.map(c=>{const f={attributes:this.featureAdapter.getAttributes(c),layer:h,geometry:n?{...Z(a.geometryType,a.hasZ,a.hasM,this.featureAdapter.getGeometry(c)),spatialReference:i==null?void 0:i.spatialReference}:null},m=r.createExecContext(f,u,s);return r.executeFunction(o,m)})}validateItem(e,t){var i,a;return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:G(t,this.fieldsIndex)}),((a=(i=this._fieldDataCache.get(t))==null?void 0:i.clause)==null?void 0:a.testFeature(e,this.featureAdapter))??!1}validateItems(e,t){var i,a;return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:G(t,this.fieldsIndex)}),((a=(i=this._fieldDataCache.get(t))==null?void 0:i.clause)==null?void 0:a.testSet(e,this.featureAdapter))??!1}_processAttributesForOutFields(e){const t=this.outFields;if(!(t!=null&&t.length))return this.featureAdapter.getAttributes(e);const i={};for(const a of t){const{alias:s,clause:r}=this._fieldDataCache.get(a);i[s]=r?r.calculateValue(e,this.featureAdapter):this.featureAdapter.getAttribute(e,s)}return i}_processAttributesForDistinctValues(e){if(e==null||!this.returnDistinctValues)return e;const t=this.outFields,i=[];if(t)for(const r of t){const{alias:n}=this._fieldDataCache.get(r);i.push(e[n])}else for(const r in e)i.push(e[r]);const a=`${(t||["*"]).join(",")}=${i.join(",")}`;let s=this._returnDistinctMap.get(a)||0;return this._returnDistinctMap.set(a,++s),s>1?null:e}};function Qe(l,e,t){return{objectId:l,target:e,distance:t,type:"vertex"}}function fs(l,e,t,i,a,s=!1){return{objectId:l,target:e,distance:t,type:"edge",start:i,end:a,draped:s}}class w{constructor(e,t,i){this.items=e,this.query=t,this.geometryType=i.geometryType,this.hasM=i.hasM,this.hasZ=i.hasZ,this.fieldsIndex=i.fieldsIndex,this.objectIdField=i.objectIdField,this.spatialReference=i.spatialReference,this.featureAdapter=i.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new ee(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:i,outStatistics:a}=this.query;if(!(t==null?void 0:t.length))return 1;const r=new Map,n=new Map,o=new Set;for(const u of a){const{statisticType:h}=u,c=h!=="exceedslimit"?u.onStatisticField:void 0;if(!n.has(c)){const m=[];for(const _ of t){const d=this._getAttributeValues(e,_,r);m.push(d)}n.set(c,this._calculateUniqueValues(m,e.returnDistinctValues))}const f=n.get(c);for(const m in f){const{data:_,items:d}=f[m],x=_.join(",");i&&!e.validateItems(d,i)||o.add(x)}}return o.size}async createQueryResponse(){let e;if(this.query.outStatistics?e=this.query.outStatistics.some(t=>t.statisticType==="exceedslimit")?this._createExceedsLimitQueryResponse(this.query):await this._createStatisticsQueryResponse(this.query):e=this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry){const t=this.query.geometry;ge(this.query.outSR)&&!D(t.spatialReference,this.query.outSR)?e.queryGeometry=H({spatialReference:this.query.outSR,...V(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=H({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t){const i=this.featureAdapter,a=Ve(this.hasZ,this.hasM),{point:s,mode:r}=e,n=typeof e.distance=="number"?e.distance:e.distance.x,o=typeof e.distance=="number"?e.distance:e.distance.y,u={candidates:[]},h=this.geometryType==="esriGeometryPolygon",c=this._getPointCreator(r,this.spatialReference,t),f=new Ge(null,0),m=new Ge(null,0),_={x:0,y:0,z:0};for(const d of this.items){const x=i.getGeometry(d);if(x==null)continue;const{coords:E,lengths:S}=x;if(f.coords=E,m.coords=E,e.returnEdge){let R=0;for(let p=0;pd.distance-x.distance),u}_getPointCreator(e,t,i){const a=i==null||D(t,i)?n=>n:n=>V(n,t,i),{hasZ:s}=this,r=0;return e==="3d"?s?({x:n,y:o,z:u})=>a({x:n,y:o,z:u}):({x:n,y:o})=>a({x:n,y:o,z:r}):({x:n,y:o})=>a({x:n,y:o})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:i,normalizationField:a,normalizationType:s,normalizationTotal:r,minValue:n,maxValue:o,scale:u,timeZone:h}=e,c=this.fieldsIndex.get(t),f=Ae(c)||me(c)||fe(c),m=await this._getDataValues({field:t,valueExpression:i,normalizationField:a,normalizationType:s,normalizationTotal:r,scale:u,timeZone:h}),_=Xt({normalizationType:s,normalizationField:a,minValue:n,maxValue:o}),d={value:.5,fieldType:c==null?void 0:c.type},x=le(c)?ke({values:m,supportsNullCount:_,percentileParams:d}):De({values:m,minValue:n,maxValue:o,useSampleStdDev:!s,supportsNullCount:_,percentileParams:d});return Kt(x,f)}async createUniqueValuesResponse(e){const{field:t,valueExpression:i,domains:a,returnAllCodedValues:s,scale:r,timeZone:n}=e,o=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:i,scale:r,timeZone:n},!1),u=es(o);return ts(u,a,s,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:i,normalizationField:a,normalizationType:s,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:u,maxValue:h,numClasses:c,scale:f,timeZone:m}=e,_=await this._getDataValues({field:t,valueExpression:i,normalizationField:a,normalizationType:s,normalizationTotal:r,scale:f,timeZone:m}),d=ss(_,{field:t,normalizationField:a,normalizationType:s,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:u,maxValue:h,numClasses:c});return is(d,n)}async createHistogramResponse(e){const{field:t,valueExpression:i,normalizationField:a,normalizationType:s,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:u,maxValue:h,numBins:c,scale:f,timeZone:m}=e,_=await this._getDataValues({field:t,valueExpression:i,normalizationField:a,normalizationType:s,normalizationTotal:r,scale:f,timeZone:m});return as(_,{field:t,normalizationField:a,normalizationType:s,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:u,maxValue:h,numBins:c})}_sortFeatures(e,t,i){if(e.length>1&&(t!=null&&t.length))for(const a of t.reverse()){const s=a.split(" "),r=s[0],n=this.fieldsIndex.get(r),o=!!s[1]&&s[1].toLowerCase()==="desc",u=rs(n==null?void 0:n.type,o);e.sort((h,c)=>{const f=i(h,r,n),m=i(c,r,n);return u(f,m)})}}_createFeatureQueryResponse(e){const t=this.items,{geometryType:i,hasM:a,hasZ:s,objectIdField:r,spatialReference:n}=this,{outFields:o,outSR:u,quantizationParameters:h,resultRecordCount:c,resultOffset:f,returnZ:m,returnM:_}=e,d=c!=null&&t.length>(f||0)+c,x=o&&(o.includes("*")?[...this.fieldsIndex.fields]:o.map(E=>this.fieldsIndex.get(E)));return{exceededTransferLimit:d,features:this._createFeatures(e,t),fields:x,geometryType:i,hasM:a&&_,hasZ:s&&m,objectIdFieldName:r,spatialReference:H(u||n),transform:h&&$e(h)||null}}_createFeatures(e,t){const i=new ee(e,this.featureAdapter,this.fieldsIndex),{hasM:a,hasZ:s}=this,{orderByFields:r,quantizationParameters:n,returnGeometry:o,returnCentroid:u,maxAllowableOffset:h,resultOffset:c,resultRecordCount:f,returnZ:m=!1,returnM:_=!1}=e,d=s&&m,x=a&&_;let E=[],S=0;const R=[...t];if(this._sortFeatures(R,r,(y,I,T)=>i.getFieldValue(y,I,T)),this.geometryType&&(o||u)){const y=$e(n)??void 0,I=this.geometryType==="esriGeometryPolygon"||this.geometryType==="esriGeometryPolyline";if(o&&!u)for(const T of R){const F=this.featureAdapter.getGeometry(T),b={attributes:i.getAttributes(T),geometry:Z(this.geometryType,this.hasZ,this.hasM,F,h,y,d,x)};I&&F&&!b.geometry&&(b.centroid=ne(this,this.featureAdapter.getCentroid(T,this),y)),E[S++]=b}else if(!o&&u)for(const T of R)E[S++]={attributes:i.getAttributes(T),centroid:ne(this,this.featureAdapter.getCentroid(T,this),y)};else for(const T of R)E[S++]={attributes:i.getAttributes(T),centroid:ne(this,this.featureAdapter.getCentroid(T,this),y),geometry:Z(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(T),h,y,d,x)}}else for(const y of R){const I=i.getAttributes(y);I&&(E[S++]={attributes:I})}const p=c||0;if(f!=null){const y=p+f;E=E.slice(p,Math.min(E.length,y))}return E}_createExceedsLimitQueryResponse(e){let t=!1,i=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;for(const r of e.outStatistics??[])if(r.statisticType==="exceedslimit"){i=r.maxPointCount!=null?r.maxPointCount:Number.POSITIVE_INFINITY,a=r.maxRecordCount!=null?r.maxRecordCount:Number.POSITIVE_INFINITY,s=r.maxVertexCount!=null?r.maxVertexCount:Number.POSITIVE_INFINITY;break}if(this.geometryType==="esriGeometryPoint")t=this.items.length>i;else if(this.items.length>a)t=!0;else{const r=Ve(this.hasZ,this.hasM),n=this.featureAdapter;t=this.items.reduce((o,u)=>{const h=n.getGeometry(u);return o+(h!=null&&h.coords.length||0)},0)/r>s}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(t)}}]}}async _createStatisticsQueryResponse(e){var R;const t={attributes:{}},i=[],a=new Map,s=new Map,r=new Map,n=new Map,o=new ee(e,this.featureAdapter,this.fieldsIndex),u=e.outStatistics,{groupByFieldsForStatistics:h,having:c,orderByFields:f,resultRecordCount:m}=e,_=h==null?void 0:h.length,d=!!_,x=d?h[0]:null,E=d&&!this.fieldsIndex.get(x);for(const p of u??[]){const{outStatisticFieldName:y,statisticType:I}=p,T=p,F=I!=="exceedslimit"?p.onStatisticField:void 0,b=I==="percentile_disc"||I==="percentile_cont",P=I==="EnvelopeAggregate"||I==="CentroidAggregate"||I==="ConvexHullAggregate",W=d&&_===1&&(F===x||E)&&I==="count";if(d){if(!r.has(F)){const X=[];for(const re of h){const K=this._getAttributeValues(o,re,a);X.push(K)}r.set(F,this._calculateUniqueValues(X,!P&&o.returnDistinctValues))}const $=r.get(F);if(!$)continue;const ae=Object.keys($);for(const X of ae){const{count:re,data:K,items:xe,itemPositions:ot}=$[X],Ie=K.join(",");if(!c||o.validateItems(xe,c)){const M=n.get(Ie)||{attributes:{}};if(P){M.aggregateGeometries||(M.aggregateGeometries={});const{aggregateGeometries:k,outStatisticFieldName:z}=await this._getAggregateGeometry(T,xe);M.aggregateGeometries[z]=k}else{let k=null;if(W)k=re;else{const z=this._getAttributeValues(o,F,a),Fe=ot.map(ht=>z[ht]);k=b&&"statisticParameters"in T?this._getPercentileValue(T,Fe):this._getStatisticValue(T,Fe,null,o.returnDistinctValues)}M.attributes[y]=k}let ut=0;h.forEach((k,z)=>M.attributes[this.fieldsIndex.get(k)?k:"EXPR_"+ ++ut]=K[z]),n.set(Ie,M)}}}else if(P){t.aggregateGeometries||(t.aggregateGeometries={});const{aggregateGeometries:$,outStatisticFieldName:ae}=await this._getAggregateGeometry(T,this.items);t.aggregateGeometries[ae]=$}else{const $=this._getAttributeValues(o,F,a);t.attributes[y]=b&&"statisticParameters"in T?this._getPercentileValue(T,$):this._getStatisticValue(T,$,s,o.returnDistinctValues)}const J=I!=="min"&&I!=="max"||!le(this.fieldsIndex.get(F))&&!this._isAnyDateField(F)?null:(R=this.fieldsIndex.get(F))==null?void 0:R.type;i.push({name:y,alias:y,type:J||"esriFieldTypeDouble"})}const S=d?Array.from(n.values()):[t];return this._sortFeatures(S,f,(p,y)=>p.attributes[y]),m&&(S.length=Math.min(m,S.length)),{fields:i,features:S}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return Ae(t)||me(t)||fe(t)||Xe(t)}async _getAggregateGeometry(e,t){const{convexHull:i,union:a}=await yt(()=>import("./geometryEngineJSON-D-7-cYHZ.js").then(d=>d.g),__vite__mapDeps([0,1,2,3,4])),{statisticType:s,outStatisticFieldName:r}=e,{featureAdapter:n,spatialReference:o,geometryType:u,hasZ:h,hasM:c}=this,f=t.map(d=>Z(u,h,c,n.getGeometry(d))),m=i(o,f,!0)[0],_={aggregateGeometries:null,outStatisticFieldName:null};if(s==="EnvelopeAggregate"){const d=m?Tt(m):Ce(a(o,f));_.aggregateGeometries={...d,spatialReference:o},_.outStatisticFieldName=r||"extent"}else if(s==="CentroidAggregate"){const d=m?Et(m):xt(Ce(a(o,f)));_.aggregateGeometries={x:d[0],y:d[1],spatialReference:o},_.outStatisticFieldName=r||"centroid"}else s==="ConvexHullAggregate"&&(_.aggregateGeometries=m,_.outStatisticFieldName=r||"convexHull");return _}_getStatisticValue(e,t,i,a){const{onStatisticField:s,statisticType:r}=e;let n=null;return n=i!=null&&i.has(s)?i.get(s):le(this.fieldsIndex.get(s))||this._isAnyDateField(s)?ke({values:t,returnDistinct:a}):De({values:a?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),i&&i.set(s,n),n[r==="var"?"variance":r]}_getPercentileValue(e,t){const{onStatisticField:i,statisticParameters:a,statisticType:s}=e,{value:r,orderBy:n}=a,o=this.fieldsIndex.get(i);return ns(t,{value:r,orderBy:n,fieldType:o==null?void 0:o.type,isDiscrete:s==="percentile_disc"})}_getAttributeValues(e,t,i){if(i.has(t))return i.get(t);const a=this.fieldsIndex.get(t),s=this.items.map(r=>e.getFieldValue(r,t,a));return i.set(t,s),s}_calculateUniqueValues(e,t){const i={},a=this.items,s=a.length;for(let r=0;rl)}function nt(l,e,t){const{outFields:i,orderByFields:a,returnDistinctValues:s,outStatistics:r}=t,n=r?r.map(o=>o.outStatisticFieldName&&o.outStatisticFieldName.toLowerCase()).filter(Boolean):[];if(a&&a.length>0){const o=" asc",u=" desc",h=a.map(c=>{const f=c.toLowerCase();return f.includes(o)?f.split(o)[0]:f.includes(u)?f.split(u)[0]:c}).filter(c=>!n.includes(c));L(l,e,h,{expressionName:"orderByFields",query:t})}if(i&&i.length>0)L(l,e,i,{expressionName:"outFields",query:t,allowedFieldTypes:"all"});else if(s)throw new A(q,"outFields should be specified for returnDistinctValues",{query:t});hs(l,e,t.where,t)}const _s=new Set([...it,...at]);function ps(l,e,t){const{outStatistics:i,groupByFieldsForStatistics:a,having:s}=t,r=a==null?void 0:a.length,n=i==null?void 0:i.length;if(s){if(!r||!n)throw new A(q,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:t});cs(l,e,s,i,t)}if(n){if(!Es(i))return;const o=i.map(u=>u.onStatisticField).filter(Boolean);L(l,e,o,{expressionName:"onStatisticFields",query:t}),r&&L(l,e,a,{expressionName:"groupByFieldsForStatistics",query:t});for(const u of i){const{onStatisticField:h,statisticType:c}=u;if((c==="percentile_disc"||c==="percentile_cont")&&"statisticParameters"in u){const{statisticParameters:f}=u;if(!f)throw new A(q,"statisticParameters should be set for percentile type",{definition:u,query:t})}else l.get(h)&&c!=="count"&&c!=="min"&&c!=="max"&&L(l,e,[h],{expressionName:`outStatistics with '${c}' statistic type`,allowedFieldTypes:_s,query:t})}}}async function ys(l,e,{fieldsIndex:t,geometryType:i,spatialReference:a,availableFields:s}){if((l.distance??0)<0||l.geometryPrecision!=null||l.multipatchOption||l.pixelSize||l.relationParam||l.text||l.outStatistics||l.groupByFieldsForStatistics||l.having||l.orderByFields)throw new A(q,"Unsupported query options",{query:l});return nt(t,s,l),Promise.all([Ts(t,s,e,l),Je(l,i,a),Te(a,l.outSR)]).then(()=>l)}async function Ts(l,e,t,i){let a=[];if(t.valueExpression){const{arcadeUtils:s}=await Ke();a=s.extractFieldNames(t.valueExpression)}if(t.field&&a.push(t.field),t.field2&&a.push(t.field2),t.field3&&a.push(t.field3),t.normalizationField&&a.push(t.normalizationField),!a.length&&!t.valueExpression)throw new A(q,"field or valueExpression is required",{params:t});L(l,e,a,{expressionName:"statistics",query:i})}function Es(l){return l!=null&&l.every(e=>e.statisticType!=="exceedslimit")}const lt=Symbol("Yield");class xs{constructor(){this._tasks=new Array,this._runningTasks=_e(0)}get length(){return this._tasks.length}get running(){return this._runningTasks.value>0}destroy(){this.cancelAll()}runTask(e){if(this.length===0)return lt;for(;!e.done&&this._process(e);)e.madeProgress()}push(e,t,i){return++this._runningTasks.value,new Promise((a,s)=>this._tasks.push(new Ue(a,s,e,t,i))).finally(()=>--this._runningTasks.value)}unshift(e,t,i){return++this._runningTasks.value,new Promise((a,s)=>this._tasks.unshift(new Ue(a,s,e,t,i))).finally(()=>--this._runningTasks.value)}_process(e){var i;if(this._tasks.length===0)return!1;const t=this._tasks.shift();try{const a=et(t.signal);if(a&&!t.abortCallback)t.reject(se());else{const s=a?(i=t.abortCallback)==null?void 0:i.call(t,se()):t.callback(e);It(s)?s.then(t.resolve,t.reject):t.resolve(s)}}catch(a){t.reject(a)}return!0}cancelAll(){const e=se();for(const t of this._tasks)if(t.abortCallback){const i=t.abortCallback(e);t.resolve(i)}else t.reject(e);this._tasks.length=0}}class Ue{constructor(e,t,i,a=void 0,s=void 0){this.resolve=e,this.reject=t,this.callback=i,this.signal=a,this.abortCallback=s}}let B=class extends St{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};oe([ve()],B.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),oe([ve()],B.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),B=oe([Ft("esri.views.support.DebugFlags")],B);const Is=new B;var g;(function(l){l.RESOURCE_CONTROLLER_IMMEDIATE="immediate",l.RESOURCE_CONTROLLER="schedule",l.SLIDE="slide",l.STREAM_DATA_LOADER="stream loader",l.ELEVATION_QUERY="elevation query",l.TERRAIN_SURFACE="terrain",l.SURFACE_GEOMETRY_UPDATES="surface geometry updates",l.LOD_RENDERER="LoD renderer",l.GRAPHICS_CORE="Graphics3D",l.I3S_CONTROLLER="I3S",l.POINT_CLOUD_LAYER="point cloud",l.FEATURE_TILE_FETCHER="feature fetcher",l.OVERLAY="overlay",l.STAGE="stage",l.GRAPHICS_DECONFLICTOR="graphics deconflictor",l.FILTER_VISIBILITY="Graphics3D filter visibility",l.SCALE_VISIBILITY="Graphics3D scale visibility",l.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",l.POINT_OF_INTEREST_FREQUENT="POI frequent",l.POINT_OF_INTEREST_INFREQUENT="POI infrequent",l.LABELER="labeler",l.FEATURE_QUERY_ENGINE="feature query",l.FEATURE_TILE_TREE="feature tile tree",l.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",l.ELEVATION_ALIGNMENT="elevation alignment",l.ELEVATION_ALIGNMENT_SCENE="elevation alignment scene",l.TEXT_TEXTURE_ATLAS="text texture atlas",l.TEXTURE_UNLOAD="texture unload",l.LINE_OF_SIGHT_TOOL="line of sight tool",l.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",l.ELEVATION_PROFILE="elevation profile",l.SNAPPING="snapping",l.SHADOW_ACCUMULATOR="shadow accumulator",l.CLOUDS_GENERATOR="clouds generator",l[l.NONE=0]="NONE",l[l.TEST_PRIO=1]="TEST_PRIO"})(g||(g={}));const O=0,qe=new Map([[g.RESOURCE_CONTROLLER_IMMEDIATE,O],[g.RESOURCE_CONTROLLER,4],[g.SLIDE,O],[g.STREAM_DATA_LOADER,O],[g.ELEVATION_QUERY,O],[g.TERRAIN_SURFACE,1],[g.SURFACE_GEOMETRY_UPDATES,1],[g.LOD_RENDERER,2],[g.GRAPHICS_CORE,2],[g.I3S_CONTROLLER,2],[g.POINT_CLOUD_LAYER,2],[g.FEATURE_TILE_FETCHER,2],[g.OVERLAY,4],[g.STAGE,4],[g.GRAPHICS_DECONFLICTOR,4],[g.FILTER_VISIBILITY,4],[g.SCALE_VISIBILITY,4],[g.FRUSTUM_VISIBILITY,4],[g.CLOUDS_GENERATOR,4],[g.POINT_OF_INTEREST_FREQUENT,6],[g.POINT_OF_INTEREST_INFREQUENT,30],[g.LABELER,8],[g.FEATURE_QUERY_ENGINE,8],[g.FEATURE_TILE_TREE,16],[g.FEATURE_TILE_TREE_ACTIVE,O],[g.ELEVATION_ALIGNMENT,12],[g.ELEVATION_ALIGNMENT_SCENE,14],[g.TEXT_TEXTURE_ATLAS,12],[g.TEXTURE_UNLOAD,12],[g.LINE_OF_SIGHT_TOOL,16],[g.LINE_OF_SIGHT_TOOL_INTERACTIVE,O],[g.SNAPPING,O],[g.SHADOW_ACCUMULATOR,30]]);function ze(l){return qe.has(l)?qe.get(l):typeof l=="number"?l:1}const je=N(6.5),Be=N(1),Fs=N(30),Ze=N(1e3/30),He=N(100),Ye=.9;var ye,Q;(function(l){class e{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some(s=>s.needsUpdate)}constructor(){this._updating=_e(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new ue("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new i,this._state=v.INTERACTING,this._tasks=new he,this._runQueue=new he,this._load=0,this._idleStateCallbacks=new he,this._idleUpdatesStartFired=!1,this._forceTask=!1,this._debug=!1,this._debugHandle=Rt(()=>Is.SCHEDULER_LOG_SLOW_TASKS,r=>this._debug=r,bt);for(const r of Object.keys(g))this.performanceInfo.tasks.set(g[r],new ue(g[r]));const s=this;this._test={FRAME_SAFETY_BUDGET:je,INTERACTING_BUDGET:Ze,IDLE_BUDGET:He,get availableBudget(){return s._budget.budget},usedBudget:0,getBudget:()=>s._budget,setBudget:r=>s._budget=r,updateTask:r=>this._updateTask(r),getState:r=>this._getState(r),getRuntime:r=>this._getRuntime(r),frameTaskTimes:this._frameTaskTimes,resetRuntimes:()=>this._resetRuntimes(),getRunning:()=>this._getRunning()}}destroy(){this._tasks.toArray().forEach(s=>s.remove()),this._tasks.clear(),pe(this._debugHandle),this._microTaskQueued=!1,this._updatingChanged()}taskRunningChanged(s){this._updatingChanged(),s&&this._budget.remaining>0&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask(()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.remaining>0&&this._schedule()&&this.frame())}))}registerTask(s,r){const n=new t(this,s,r);return this._tasks.push(n),this._updatingChanged(),this.performanceInfo.tasks.has(s)||this.performanceInfo.tasks.set(s,new ue(s)),n}registerIdleStateCallbacks(s,r){const n={idleBegin:s,idleEnd:r};this._idleStateCallbacks.push(n),this.state===v.IDLE&&this._idleUpdatesStartFired&&n.idleBegin();const o=this;return{remove:()=>this._removeIdleStateCallbacks(n),set idleBegin(u){o._idleUpdatesStartFired&&(n.idleEnd(),o._state===v.IDLE&&u()),n.idleBegin=u},set idleEnd(u){n.idleEnd=u}}}get load(){return this._load}set state(s){this._state!==s&&(this._state=s,this.state!==v.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll(r=>r.idleEnd())))}get state(){return this._state}updateBudget(s){this._test.usedBudget=0,++this._frameNumber;let r=je,n=s.frameDuration,o=Be;switch(this.state){case v.IDLE:r=N(0),n=N(Math.max(He,s.frameDuration)),o=Fs;break;case v.INTERACTING:n=N(Math.max(Ze,s.frameDuration));case v.ANIMATING:}return n=N(n-s.elapsedFrameTime-r),this.state!==v.IDLE&&ns.idleBegin())),this._runIdle();break;case v.INTERACTING:this._runInteracting();break;default:this._runAnimating()}this._test.usedBudget=this._budget.elapsed}stopFrame(){this._budget.reset(N(0),this._state),this._budget.madeProgress()}_removeIdleStateCallbacks(s){this._idleUpdatesStartFired&&s.idleEnd(),this._idleStateCallbacks.removeUnordered(s)}removeTask(s){this._tasks.removeUnordered(s),this._runQueue.removeUnordered(s),this._updatingChanged()}_updateTask(s){this._tasks.forAll(r=>{r.name===s&&r.setPriority(s)})}_getState(s){if(this._runQueue.some(n=>n.name===s))return Q.SCHEDULED;let r=Q.IDLE;return this._tasks.forAll(n=>{n.name===s&&n.needsUpdate&&(n.schedulePriority<=1?r=Q.READY:r!==Q.READY&&(r=Q.WAITING))}),r}_getRuntime(s){let r=0;return this._tasks.forAll(n=>{n.name===s&&(r+=n.runtime)}),r}_resetRuntimes(){this._tasks.forAll(s=>s.runtime=0)}_getRunning(){const s=new Map;if(this._tasks.forAll(n=>{n.needsUpdate&&s.set(n.name,(s.get(n.name)||0)+1)}),s.size===0)return null;let r="";return s.forEach((n,o)=>{r+=n>1?` ${n}x ${o}`:` ${o}`}),r}_runIdle(){this._run()}_runInteracting(){this._run()}_runAnimating(){this._run()}_updateLoad(){const s=this._tasks.reduce((r,n)=>n.needsUpdate?++r:r,0);this._load=this._load*Ye+s*(1-Ye)}_schedule(){for(this._runQueue.filterInPlace(s=>!!s.needsUpdate||(s.schedulePriority=s.basePriority,!1)),this._tasks.forAll(s=>{s.basePriority===O&&s.needsUpdate&&!this._runQueue.includes(s)&&s.blockFrame!==this._frameNumber&&this._runQueue.unshift(s)});this._runQueue.length===0;){let s=!1,r=0;if(this._tasks.forAll(n=>{n.needsUpdate&&n.schedulePriority!==0&&n.basePriority!==O&&n.blockFrame!==this._frameNumber&&(s=!0,r=Math.max(r,n.basePriority),n.schedulePriority===1?(n.schedulePriority=0,this._runQueue.push(n)):--n.schedulePriority)}),!s)return this._updatingChanged(),!1}return this._updatingChanged(),!0}_run(){const s=this._budget.now();this._startFrameTaskTimes();do for(;this._runQueue.length>0;){const r=this._budget.now(),n=this._runQueue.pop();this._budget.resetProgress();try{n.task.runTask(this._budget)===lt&&(n.blockFrame=this._frameNumber)}catch(u){wt.getLogger("esri.views.support.Scheduler").error(`Exception in task "${n.name}"`,u),n.blockFrame=this._frameNumber}!this._budget.hasProgressed&&n.blockFrame!==this._frameNumber&&n.needsUpdate&&(n.name,g.I3S_CONTROLLER,n.blockFrame=this._frameNumber),n.schedulePriority=n.basePriority;const o=this._budget.now()-r;if(n.runtime+=o,this._frameTaskTimes.set(n.priority,this._frameTaskTimes.get(n.priority)+o),this._debug&&o>2*this._budget.budget&&console.log("Task",n.name,"used",o,"of max",this._budget.budget,"ms"),this._budget.remaining<=0)return this._updatingChanged(),void this._recordFrameTaskTimes(this._budget.now()-s)}while(this._schedule());this._updatingChanged(),this._recordFrameTaskTimes(this._budget.now()-s)}_startFrameTaskTimes(){for(const s of Object.keys(g))this._frameTaskTimes.set(g[s],0)}_recordFrameTaskTimes(s){this._frameTaskTimes.forEach((r,n)=>this.performanceInfo.tasks.get(n).record(r)),this.performanceInfo.total.record(s)}get test(){return this._test}}l.Scheduler=e;class t{get task(){return this._task.value}get updating(){return this._queue.running}constructor(s,r,n){this._scheduler=s,this.name=r,this.blockFrame=0,this.runtime=0,this._queue=new xs,this._handles=new At,this._basePriority=ze(r),this.schedulePriority=this._basePriority,this._task=_e(n??this._queue),this._handles.add(Ct(()=>this.task.running,o=>s.taskRunningChanged(o)))}remove(){this.processQueue(ie),this._scheduler.removeTask(this),this.schedule=We.schedule,this.reschedule=We.reschedule,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(s){if(this.name===s)return;this.name=s;const r=ze(s);this._basePriority!==O&&this.schedulePriority===0||(this.schedulePriority=r),this._basePriority=r}get priority(){return this.name}set priority(s){this.setPriority(s)}get needsUpdate(){return this.updating||this.task.running}schedule(s,r,n){return this._queue.push(s,r,n)}reschedule(s,r,n){return this._queue.unshift(s,r,n)}processQueue(s){return this._queue.runTask(s)}}class i{constructor(){this._begin=typeof performance<"u"?performance.now():0,this._budget=0,this._state=v.IDLE,this._done=!1,this._progressed=!1,this._enabled=!0}run(s){return!this.done&&(s()===!0&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get state(){return this._state}get enabled(){return this._enabled}set enabled(s){this._enabled=s}reset(s,r){this._begin=this.now(),this._budget=s,this._state=r,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return performance.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}}l.Budget=i})(ye||(ye={})),function(l){l.SCHEDULED="s",l.READY="r",l.WAITING="w",l.IDLE="i"}(Q||(Q={}));const ie=(()=>{const l=new ye.Budget;return l.enabled=!1,l})();class Ss{remove(){}processQueue(){}schedule(e,t,i){try{if(et(t)){const a=se();return i?Promise.resolve(i(a)):Promise.reject(a)}return vt(e(ie))}catch(a){return Promise.reject(a)}}reschedule(e,t,i){return this.schedule(e,t,i)}}const We=new Ss,Rs="unsupported-query",bs=new Nt(2e6);let ws=0;class Ms{constructor(e){this._geometryQueryCache=null,this._changeHandle=null,this.capabilities={query:Yt},this.geometryType=e.geometryType,this.hasM=!!e.hasM,this.hasZ=!!e.hasZ,this.objectIdField=e.objectIdField,this.spatialReference=e.spatialReference,this.definitionExpression=e.definitionExpression,this.featureStore=e.featureStore,this.aggregateAdapter=e.aggregateAdapter,this._changeHandle=this.featureStore.events.on("changed",()=>this.clearCache()),this.timeInfo=e.timeInfo,e.cacheSpatialQueries&&(this._geometryQueryCache=new Ot(ws+++"$$",bs)),this.fieldsIndex=Pt(e.fieldsIndex)?e.fieldsIndex:ls.fromJSON(e.fieldsIndex),!e.availableFields||e.availableFields.length===1&&e.availableFields[0]==="*"?this.availableFields=new Set(this.fieldsIndex.fields.map(t=>t.name)):this.availableFields=new Set(e.availableFields.map(t=>{var i;return(i=this.fieldsIndex.get(t))==null?void 0:i.name}).filter(t=>t!=null)),e.scheduler&&e.priority&&(this._frameTask=e.scheduler.registerTask(e.priority))}destroy(){this._frameTask=pe(this._frameTask),this.clearCache(),$t(this._geometryQueryCache),this._changeHandle=pe(this._changeHandle)}get featureAdapter(){return this.featureStore.featureAdapter}clearCache(){var e;(e=this._geometryQueryCache)==null||e.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null,this._fullExtentPromise=null}async executeQuery(e,t){const i=C(t);try{return(await this._executeQuery(e,{},i)).createQueryResponse()}catch(a){if(a!==U)throw a;return new w([],e,this).createQueryResponse()}}async executeQueryForCount(e={},t){const i=C(t);try{return(await this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null},i)).createQueryResponseForCount()}catch(a){if(a!==U)throw a;return 0}}async executeQueryForExtent(e,t){const i=C(t),a=e.outSR;try{const s=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},i),r=s.size;return r?{count:r,extent:await this._getBounds(s.items,s.spatialReference,a||this.spatialReference)}:{count:0,extent:null}}catch(s){if(s===U)return{count:0,extent:null};throw s}}async executeQueryForIds(e,t){return this.executeQueryForIdSet(e,t).then(i=>Array.from(i))}async executeQueryForIdSet(e,t){const i=C(t);try{const a=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},i),s=a.items,r=new Set;return await this._reschedule(()=>{for(const n of s)r.add(a.featureAdapter.getObjectId(n))},i),r}catch(a){if(a===U)return new Set;throw a}}async executeQueryForSnapping(e,t){const i=C(t),{point:a,distance:s,returnEdge:r,vertexMode:n}=e;if(!r&&n==="none")return{candidates:[]};let o=te(e.query);o=await this._schedule(()=>dt(o,this.definitionExpression,this.spatialReference),i),o=await this._reschedule(()=>Me(o,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),i);const u=!D(a.spatialReference,this.spatialReference);u&&await Te(a.spatialReference,this.spatialReference);const h=typeof s=="number"?s:s.x,c=typeof s=="number"?s:s.y,f={xmin:a.x-h,xmax:a.x+h,ymin:a.y-c,ymax:a.y+c,spatialReference:a.spatialReference},m=u?V(f,this.spatialReference):f;if(!m)return{candidates:[]};const _=(await Ne(Oe(a),null,{signal:i}))[0],d=(await Ne(Oe(m),null,{signal:i}))[0];if(_==null||d==null)return{candidates:[]};const x=new w(await this._reschedule(()=>this._searchFeatures(this._getQueryBBoxes(d.toJSON())),i),o,this);await this._reschedule(()=>this._executeObjectIdsQuery(x),i),await this._reschedule(()=>this._executeTimeQuery(x),i),await this._reschedule(()=>this._executeAttributesQuery(x),i),await this._reschedule(()=>this._executeGeometryQueryForSnapping(x,i),i);const E=_.toJSON(),S=u?V(E,this.spatialReference):E,R=u?Math.max(m.xmax-m.xmin,m.ymax-m.ymin)/2:s;return x.createSnappingResponse({...e,point:S,distance:R},a.spatialReference)}async executeQueryForLatestObservations(e,t){var a;const i=C(t);if(!((a=this.timeInfo)!=null&&a.trackIdField))throw new A(Rs,"Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});try{const s=await this._executeQuery(e,{},i);return await this._reschedule(()=>this._filterLatest(s),i),s.createQueryResponse()}catch(s){if(s!==U)throw s;return new w([],e,this).createQueryResponse()}}async executeQueryForSummaryStatistics(e={},t,i){const a=C(i),{field:s,normalizationField:r,valueExpression:n}=t;return(await this._executeQueryForStatistics(e,{field:s,normalizationField:r,valueExpression:n},a)).createSummaryStatisticsResponse(t)}async executeQueryForUniqueValues(e={},t,i){const a=C(i),{field:s,field2:r,field3:n,valueExpression:o}=t;return(await this._executeQueryForStatistics(e,{field:s,field2:r,field3:n,valueExpression:o},a)).createUniqueValuesResponse(t)}async executeQueryForClassBreaks(e={},t,i){const a=C(i),{field:s,normalizationField:r,valueExpression:n}=t;return(await this._executeQueryForStatistics(e,{field:s,normalizationField:r,valueExpression:n},a)).createClassBreaksResponse(t)}async executeQueryForHistogram(e={},t,i){const a=C(i),{field:s,normalizationField:r,valueExpression:n}=t;return(await this._executeQueryForStatistics(e,{field:s,normalizationField:r,valueExpression:n},a)).createHistogramResponse(t)}async fetchRecomputedExtents(e){const t=C(e);this._timeExtentPromise||(this._timeExtentPromise=mt(this.timeInfo,this.featureStore));const[i,a]=await Promise.all([this._getFullExtent(),this._timeExtentPromise]);return kt(t),{fullExtent:i,timeExtent:a}}async _getBounds(e,t,i){const a=Dt(Lt(),jt);await this.featureStore.forEachBounds(e,n=>Qt(a,n));const s={xmin:a[0],ymin:a[1],xmax:a[3],ymax:a[4],spatialReference:H(this.spatialReference)};this.hasZ&&isFinite(a[2])&&isFinite(a[5])&&(s.zmin=a[2],s.zmax=a[5]);const r=V(s,t,i);if(r.spatialReference=H(i),r.xmax-r.xmin==0){const n=ce(r.spatialReference);r.xmin-=n,r.xmax+=n}if(r.ymax-r.ymin==0){const n=ce(r.spatialReference);r.ymin-=n,r.ymax+=n}if(this.hasZ&&r.zmin!=null&&r.zmax!=null&&r.zmax-r.zmin==0){const n=ce(r.spatialReference);r.zmin-=n,r.zmax+=n}return r}_getFullExtent(){return this._fullExtentPromise||(this._fullExtentPromise="getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getAllFeatures().then(e=>this._getBounds(e,this.spatialReference,this.spatialReference))),this._fullExtentPromise}async _schedule(e,t){return this._frameTask!=null?this._frameTask.schedule(e,t):e(ie)}async _reschedule(e,t){return this._frameTask!=null?this._frameTask.reschedule(e,t):e(ie)}async _getAllFeaturesQueryEngineResult(e){return new w(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(this._allFeaturesPromise==null){const i=[];this._allFeaturesPromise=(async()=>{await this.featureStore.forEach(a=>i.push(a))})().then(()=>i)}const e=this._allFeaturesPromise,t=await e;return e===this._allFeaturesPromise?t.slice():this._getAllFeatures()}async _executeQuery(e,t,i){e=te(e),e=await this._schedule(()=>Se(e,this.definitionExpression,this.spatialReference),i),e=await this._reschedule(()=>Me(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),i),e={...e,...t};const a=await this._reschedule(()=>this._executeSceneFilterQuery(e,i),i),s=await this._reschedule(()=>this._executeGeometryQuery(e,a,i),i);return await this._reschedule(()=>this._executeAggregateIdsQuery(s),i),await this._reschedule(()=>this._executeObjectIdsQuery(s),i),await this._reschedule(()=>this._executeTimeQuery(s),i),await this._reschedule(()=>this._executeAttributesQuery(s),i),s}async _executeSceneFilterQuery(e,t){if(e.sceneFilter==null)return null;const{outSR:i,returnGeometry:a,returnCentroid:s}=e,r=this.featureStore.featureSpatialReference,n=e.sceneFilter.geometry,o=r==null||D(r,n.spatialReference)?n:V(n,r);if(!o)return null;const u=a||s,h=ge(i)&&!D(this.spatialReference,i)&&u?async d=>this._project(d,i):d=>d,c=this.featureAdapter,f=await this._reschedule(()=>this._searchFeatures(this._getQueryBBoxes(o)),t);if(e.sceneFilter.spatialRelationship==="disjoint"){if(!f.length)return null;const d=new Set;for(const S of f)d.add(c.getObjectId(S));const x=await this._reschedule(()=>this._getAllFeatures(),t),E=await this._reschedule(async()=>{const S=await j("esriSpatialRelDisjoint",o,this.geometryType,this.hasZ,this.hasM),R=y=>!d.has(c.getObjectId(y))||S(c.getGeometry(y)),p=await this._runSpatialFilter(x,R,t);return new w(p,e,this)},t);return h(E)}if(!f.length)return new w([],e,this);if(this._canExecuteSinglePass(o,e))return h(new w(f,e,this));const m=await j("esriSpatialRelContains",o,this.geometryType,this.hasZ,this.hasM),_=await this._runSpatialFilter(f,d=>m(c.getGeometry(d)),t);return h(new w(_,e,this))}async _executeGeometryQuery(e,t,i){if(t!=null&&t.items.length===0)return t;e=t!=null?t.query:e;const{geometry:a,outSR:s,spatialRel:r,returnGeometry:n,returnCentroid:o}=e,u=this.featureStore.featureSpatialReference,h=!a||u==null||D(u,a.spatialReference)?a:V(a,u),c=n||o,f=ge(s)&&!D(this.spatialReference,s),m=this._geometryQueryCache&&t==null?JSON.stringify(f&&c?{originalFilterGeometry:a,spatialRelationship:r,outSpatialReference:s}:{originalFilterGeometry:a,spatialRelationship:r}):null,_=m?this._geometryQueryCache.get(m):null;if(_!=null)return new w(_,e,this);const d=async p=>(f&&c&&await this._project(p,s),m&&this._geometryQueryCache.put(m,p.items,p.items.length+1),p);if(!h)return d(t??await this._getAllFeaturesQueryEngineResult(e));const x=this.featureAdapter;let E=await this._reschedule(()=>this._searchFeatures(this._getQueryBBoxes(a)),i);if(r==="esriSpatialRelDisjoint"){if(!E.length)return d(t??await this._getAllFeaturesQueryEngineResult(e));const p=new Set;for(const T of E)p.add(x.getObjectId(T));const y=t!=null?t.items:await this._reschedule(()=>this._getAllFeatures(),i),I=await this._reschedule(async()=>{const T=await j(r,h,this.geometryType,this.hasZ,this.hasM),F=P=>!p.has(x.getObjectId(P))||T(x.getGeometry(P)),b=await this._runSpatialFilter(y,F,i);return new w(b,e,this)},i);return d(I)}if(t!=null){const p=new Bt;E=E.filter(y=>Vt(t.items,y,t.items.length,p)>=0)}if(!E.length){const p=new w([],e,this);return m&&this._geometryQueryCache.put(m,p.items,1),p}if(this._canExecuteSinglePass(h,e))return d(new w(E,e,this));const S=await j(r,h,this.geometryType,this.hasZ,this.hasM),R=await this._runSpatialFilter(E,p=>S(x.getGeometry(p)),i);return d(new w(R,e,this))}async _executeGeometryQueryForSnapping(e,t){var n;const{query:i}=e,{spatialRel:a}=i;if(!((n=e==null?void 0:e.items)!=null&&n.length)||!i.geometry||!a)return;const s=await j(a,i.geometry,this.geometryType,this.hasZ,this.hasM),r=await this._runSpatialFilter(e.items,o=>s(o.geometry),t);e.items=r}_executeAggregateIdsQuery(e){var a;if(e.items.length===0||!((a=e.query.aggregateIds)!=null&&a.length)||this.aggregateAdapter==null)return;const t=new Set;for(const s of e.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(s).forEach(r=>t.add(r));const i=this.featureAdapter.getObjectId;e.items=e.items.filter(s=>t.has(i(s)))}_executeObjectIdsQuery(e){var a;if(e.items.length===0||!((a=e.query.objectIds)!=null&&a.length))return;const t=new Set(e.query.objectIds),i=this.featureAdapter.getObjectId;e.items=e.items.filter(s=>t.has(i(s)))}_executeTimeQuery(e){if(e.items.length===0)return;const t=ft(this.timeInfo,e.query.timeExtent,this.featureAdapter);t!=null&&(e.items=e.items.filter(t))}_executeAttributesQuery(e){if(e.items.length===0)return;const t=G(e.query.where,this.fieldsIndex);if(t){if(!t.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter(i=>t.testFeature(i,this.featureAdapter))}}async _runSpatialFilter(e,t,i){if(!t)return e;if(this._frameTask==null)return e.filter(n=>t(n));let a=0;const s=new Array,r=async n=>{for(;ar(u),i)}};return this._reschedule(n=>r(n),i).then(()=>s)}_filterLatest(e){const{trackIdField:t,startTimeField:i,endTimeField:a}=this.timeInfo,s=a||i,r=new Map,n=this.featureAdapter.getAttribute;for(const o of e.items){const u=n(o,t),h=n(o,s),c=r.get(u);(!c||h>n(c,s))&&r.set(u,o)}e.items=Array.from(r.values())}_canExecuteSinglePass(e,t){const{spatialRel:i}=t;return Re(e)&&(i==="esriSpatialRelEnvelopeIntersects"||this.geometryType==="esriGeometryPoint"&&(i==="esriSpatialRelIntersects"||i==="esriSpatialRelContains"))}async _project(e,t){if(!t||D(this.spatialReference,t))return e;const i=this.featureAdapter;let a;try{const r=await this._getFullExtent();a=Gt(this.spatialReference,t,r)}catch{}const s=await gt(e.items.map(r=>Z(this.geometryType,this.hasZ,this.hasM,i.getGeometry(r))),this.spatialReference,t,a);return e.items=s.map((r,n)=>i.cloneWithGeometry(e.items[n],Zt(r,this.hasZ,this.hasM))),e}_getQueryBBoxes(e){if(Re(e)){if(Mt(e))return[Pe(Math.min(e.xmin,e.xmax),Math.min(e.ymin,e.ymax),Math.max(e.xmin,e.xmax),Math.max(e.ymin,e.ymax))];if(Ut(e))return e.rings.map(t=>Pe(Math.min(t[0][0],t[2][0]),Math.min(t[0][1],t[2][1]),Math.max(t[0][0],t[2][0]),Math.max(t[0][1],t[2][1])))}return[qt(zt(),e)]}async _searchFeatures(e){const t=new Set;await Promise.all(e.map(a=>this.featureStore.forEachInBounds(a,s=>t.add(s))));const i=Array.from(t.values());return t.clear(),i}async _executeQueryForStatistics(e,t,i){e=te(e);try{e=await this._schedule(()=>Se(e,this.definitionExpression,this.spatialReference),i),e=await this._reschedule(()=>ys(e,t,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),i);const a=await this._reschedule(()=>this._executeSceneFilterQuery(e,i),i),s=await this._reschedule(()=>this._executeGeometryQuery(e,a,i),i);return await this._reschedule(()=>this._executeAggregateIdsQuery(s),i),await this._reschedule(()=>this._executeObjectIdsQuery(s),i),await this._reschedule(()=>this._executeTimeQuery(s),i),await this._reschedule(()=>this._executeAttributesQuery(s),i),s}catch(a){if(a!==U)throw a;return new w([],e,this)}}}export{Ms as $,Vs as o}; +import{n as ct,a as Z,h as H,j as V,y as ne,P as Je,x as Te,g as U,b as dt,c as mt,S as Se,v as j,t as ft,I as Re,d as gt}from"./timeSupport-DXkhlToK.js";import{t as _t,e as pt}from"./OptimizedGeometry-CQuTPb9g.js";import{ee as be,N as A,cC as we,aJ as me,aK as fe,a1 as Xe,c8 as Ke,cL as ge,G as D,O as Ae,cJ as le,_ as yt,jg as Tt,iH as Ce,il as Et,jh as xt,aV as te,ji as _e,ib as et,jj as se,eu as It,d as oe,y as ve,f as Ft,a7 as St,jk as ue,bL as he,g as Rt,P as bt,jl as pe,B as N,s as wt,jm as At,p as Ct,jn as vt,jo as Nt,jp as Ot,a2 as Pt,u as $t,jq as C,dj as Ne,b0 as Oe,at as kt,jr as Dt,bF as Lt,bI as Qt,bo as ce,bM as Vt,bC as Gt,F as Mt,ag as Pe,ab as Ut,am as qt,ai as zt,bG as jt,bO as Bt}from"./index-BjUNJPVf.js";import{o as Zt}from"./featureConversionUtils-BHhm7bvm.js";import{x as Ht}from"./WhereClause-Ctld7DSu.js";import{t as Yt}from"./QueryEngineCapabilities-CTDe3LlQ.js";import{m as $e}from"./quantizationUtils-CfV316jZ.js";import{w as Wt}from"./utils-BKh1cxpi.js";import{c as de,B as Jt,f as Xt,d as ke,p as De,C as Kt,k as es,$ as ts,E as ss,P as is,U as as,T as rs,v as ns}from"./utils-CY1ReiSd.js";import{Z as ls}from"./FieldsIndex-CK-0B5n9.js";import{I as v}from"./RenderState-DaVlEYWY.js";const Vs={getObjectId:l=>l.objectId,getAttributes:l=>l.attributes,getAttribute:(l,e)=>l.attributes[e],cloneWithGeometry:(l,e)=>new _t(e,l.attributes,null,l.objectId),getGeometry:l=>l.geometry,getCentroid:(l,e)=>(l.centroid==null&&(l.centroid=ct(new pt,l.geometry,e.hasZ,e.hasM)),l.centroid)};class os{constructor(e,t){this._cache=new be(e),this._invalidCache=new be(t)}get(e,t){const i=`${t.uid}:${e}`,a=this._cache.get(i);if(a)return a;if(this._invalidCache.get(i)!=null)return null;try{const s=Ht.create(e,t);return this._cache.put(i,s),s}catch(s){return this._invalidCache.put(i,s),null}}getError(e,t){const i=`${t.uid}:${e}`;return this._invalidCache.get(i)??null}}const tt=new os(50,500),Y="unsupported-query",st=" as ",it=new Set(["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeBigInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong"]),at=new Set(["esriFieldTypeDate","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]),us=new Set(["esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...it,...at]);function Ee(l,e,t={}){const i=G(e,l);if(!i){const s=tt.getError(e,l);throw new A(Y,"invalid SQL expression",{expression:e,error:s})}const a=t.expressionName||"expression";if(t.validateStandardized&&!i.isStandardized)throw new A(Y,`${a} is not standard`,{expression:e});if(t.validateAggregate&&!i.isAggregate)throw new A(Y,`${a} does not contain a valid aggregate function`,{expression:e});return i.fieldNames}function hs(l,e,t,i){if(!t)return!0;const a="where clause";return L(l,e,Ee(l,t,{validateStandardized:!0,expressionName:a}),{expressionName:a,query:i}),!0}function cs(l,e,t,i,a){if(!t)return!0;const s="having clause",r=Ee(l,t,{validateAggregate:!0,expressionName:s});L(l,e,r,{expressionName:s,query:a});const n=G(t,l);if(!(n==null?void 0:n.getExpressions().every(u=>{var m;const{aggregateType:h,field:c}=u,f=(m=l.get(c))==null?void 0:m.name;return i.some(_=>{var S;const{onStatisticField:d,statisticType:x}=_;return((S=l.get(d))==null?void 0:S.name)===f&&x.toLowerCase().trim()===h})})))throw new A(Y,"expressions in having clause should also exist in outStatistics",{having:t});return!0}function G(l,e){return l?tt.get(l,e):null}function rt(l){return/\((.*?)\)/.test(l)?l:l.split(st)[0]}function ds(l){return l.split(st)[1]}function L(l,e,t,i={}){const a=new Map;if(ms(a,l,e,i.allowedFieldTypes??us,t),a.size){const s=i.expressionName??"expression";throw new A(Y,`${s} contains invalid or missing fields`,{errors:Array.from(a.values()),query:i.query})}}function ms(l,e,t,i,a){const s=a.includes("*")?[...t,...a.filter(r=>r!=="*")]:a;for(const r of s)if(e.get(r))Le(l,e,t,i,r);else try{const n=Ee(e,rt(r),{validateStandardized:!0});for(const o of n)Le(l,e,t,i,o)}catch(n){l.set(r,{type:"expression-error",expression:r,error:n})}}function Le(l,e,t,i,a){const s=e.get(a);s?t.has(s.name)?i!=="all"&&(i==null?void 0:i.has(s.type))===!1&&l.set(a,{type:"invalid-type",fieldName:s.name,fieldType:we.fromJSON(s.type),allowedFieldTypes:Array.from(i,r=>we.fromJSON(r))}):l.set(a,{type:"missing-field",fieldName:s.name}):l.set(a,{type:"invalid-field",fieldName:a})}let ee=class{constructor(e,t,i){this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=e.returnDistinctValues??!1,this.fieldsIndex=i,this.featureAdapter=t;const a=e.outFields;if(a&&!a.includes("*")){this.outFields=a;let s=0;for(const r of a){const n=rt(r),o=this.fieldsIndex.get(n),u=o?null:G(n,i),h=o?o.name:ds(r)||"FIELD_EXP_"+s++;this._fieldDataCache.set(r,{alias:h,clause:u})}}}countDistinctValues(e){return this.returnDistinctValues?(e.forEach(t=>this.getAttributes(t)),this._returnDistinctMap.size):e.length}getAttributes(e){const t=this._processAttributesForOutFields(e);return this._processAttributesForDistinctValues(t)}getFieldValue(e,t,i){var r;const a=i?i.name:t;let s=null;return this._fieldDataCache.has(a)?s=(r=this._fieldDataCache.get(a))==null?void 0:r.clause:i||(s=G(t,this.fieldsIndex),this._fieldDataCache.set(a,{alias:a,clause:s})),i?this.featureAdapter.getAttribute(e,a):s==null?void 0:s.calculateValue(e,this.featureAdapter)}getDataValues(e,t,i=!0){const a=t.normalizationType,s=t.normalizationTotal,r=this.fieldsIndex.get(t.field),n=me(r)||fe(r),o=Xe(r);return e.map(u=>{let h=t.field&&this.getFieldValue(u,t.field,this.fieldsIndex.get(t.field));if(t.field2?(h=`${de(h)}${t.fieldDelimiter}${de(this.getFieldValue(u,t.field2,this.fieldsIndex.get(t.field2)))}`,t.field3&&(h=`${h}${t.fieldDelimiter}${de(this.getFieldValue(u,t.field3,this.fieldsIndex.get(t.field3)))}`)):typeof h=="string"&&i&&(n?h=h?new Date(h).getTime():null:o&&(h=h?Wt(h):null)),a&&Number.isFinite(h)){const c=a==="field"&&t.normalizationField?this.getFieldValue(u,t.normalizationField,this.fieldsIndex.get(t.normalizationField)):null;h=Jt(h,a,c,s)}return h})}async getExpressionValues(e,t,i,a,s){const{arcadeUtils:r}=await Ke(),n=r.hasGeometryOperations(t);n&&await r.enableGeometryOperations();const o=r.createFunction(t),u=r.getViewInfo(i),h={fields:this.fieldsIndex.fields};return e.map(c=>{const f={attributes:this.featureAdapter.getAttributes(c),layer:h,geometry:n?{...Z(a.geometryType,a.hasZ,a.hasM,this.featureAdapter.getGeometry(c)),spatialReference:i==null?void 0:i.spatialReference}:null},m=r.createExecContext(f,u,s);return r.executeFunction(o,m)})}validateItem(e,t){var i,a;return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:G(t,this.fieldsIndex)}),((a=(i=this._fieldDataCache.get(t))==null?void 0:i.clause)==null?void 0:a.testFeature(e,this.featureAdapter))??!1}validateItems(e,t){var i,a;return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:G(t,this.fieldsIndex)}),((a=(i=this._fieldDataCache.get(t))==null?void 0:i.clause)==null?void 0:a.testSet(e,this.featureAdapter))??!1}_processAttributesForOutFields(e){const t=this.outFields;if(!(t!=null&&t.length))return this.featureAdapter.getAttributes(e);const i={};for(const a of t){const{alias:s,clause:r}=this._fieldDataCache.get(a);i[s]=r?r.calculateValue(e,this.featureAdapter):this.featureAdapter.getAttribute(e,s)}return i}_processAttributesForDistinctValues(e){if(e==null||!this.returnDistinctValues)return e;const t=this.outFields,i=[];if(t)for(const r of t){const{alias:n}=this._fieldDataCache.get(r);i.push(e[n])}else for(const r in e)i.push(e[r]);const a=`${(t||["*"]).join(",")}=${i.join(",")}`;let s=this._returnDistinctMap.get(a)||0;return this._returnDistinctMap.set(a,++s),s>1?null:e}};function Qe(l,e,t){return{objectId:l,target:e,distance:t,type:"vertex"}}function fs(l,e,t,i,a,s=!1){return{objectId:l,target:e,distance:t,type:"edge",start:i,end:a,draped:s}}class w{constructor(e,t,i){this.items=e,this.query=t,this.geometryType=i.geometryType,this.hasM=i.hasM,this.hasZ=i.hasZ,this.fieldsIndex=i.fieldsIndex,this.objectIdField=i.objectIdField,this.spatialReference=i.spatialReference,this.featureAdapter=i.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new ee(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:i,outStatistics:a}=this.query;if(!(t==null?void 0:t.length))return 1;const r=new Map,n=new Map,o=new Set;for(const u of a){const{statisticType:h}=u,c=h!=="exceedslimit"?u.onStatisticField:void 0;if(!n.has(c)){const m=[];for(const _ of t){const d=this._getAttributeValues(e,_,r);m.push(d)}n.set(c,this._calculateUniqueValues(m,e.returnDistinctValues))}const f=n.get(c);for(const m in f){const{data:_,items:d}=f[m],x=_.join(",");i&&!e.validateItems(d,i)||o.add(x)}}return o.size}async createQueryResponse(){let e;if(this.query.outStatistics?e=this.query.outStatistics.some(t=>t.statisticType==="exceedslimit")?this._createExceedsLimitQueryResponse(this.query):await this._createStatisticsQueryResponse(this.query):e=this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry){const t=this.query.geometry;ge(this.query.outSR)&&!D(t.spatialReference,this.query.outSR)?e.queryGeometry=H({spatialReference:this.query.outSR,...V(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=H({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t){const i=this.featureAdapter,a=Ve(this.hasZ,this.hasM),{point:s,mode:r}=e,n=typeof e.distance=="number"?e.distance:e.distance.x,o=typeof e.distance=="number"?e.distance:e.distance.y,u={candidates:[]},h=this.geometryType==="esriGeometryPolygon",c=this._getPointCreator(r,this.spatialReference,t),f=new Ge(null,0),m=new Ge(null,0),_={x:0,y:0,z:0};for(const d of this.items){const x=i.getGeometry(d);if(x==null)continue;const{coords:E,lengths:S}=x;if(f.coords=E,m.coords=E,e.returnEdge){let R=0;for(let p=0;pd.distance-x.distance),u}_getPointCreator(e,t,i){const a=i==null||D(t,i)?n=>n:n=>V(n,t,i),{hasZ:s}=this,r=0;return e==="3d"?s?({x:n,y:o,z:u})=>a({x:n,y:o,z:u}):({x:n,y:o})=>a({x:n,y:o,z:r}):({x:n,y:o})=>a({x:n,y:o})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:i,normalizationField:a,normalizationType:s,normalizationTotal:r,minValue:n,maxValue:o,scale:u,timeZone:h}=e,c=this.fieldsIndex.get(t),f=Ae(c)||me(c)||fe(c),m=await this._getDataValues({field:t,valueExpression:i,normalizationField:a,normalizationType:s,normalizationTotal:r,scale:u,timeZone:h}),_=Xt({normalizationType:s,normalizationField:a,minValue:n,maxValue:o}),d={value:.5,fieldType:c==null?void 0:c.type},x=le(c)?ke({values:m,supportsNullCount:_,percentileParams:d}):De({values:m,minValue:n,maxValue:o,useSampleStdDev:!s,supportsNullCount:_,percentileParams:d});return Kt(x,f)}async createUniqueValuesResponse(e){const{field:t,valueExpression:i,domains:a,returnAllCodedValues:s,scale:r,timeZone:n}=e,o=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:i,scale:r,timeZone:n},!1),u=es(o);return ts(u,a,s,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:i,normalizationField:a,normalizationType:s,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:u,maxValue:h,numClasses:c,scale:f,timeZone:m}=e,_=await this._getDataValues({field:t,valueExpression:i,normalizationField:a,normalizationType:s,normalizationTotal:r,scale:f,timeZone:m}),d=ss(_,{field:t,normalizationField:a,normalizationType:s,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:u,maxValue:h,numClasses:c});return is(d,n)}async createHistogramResponse(e){const{field:t,valueExpression:i,normalizationField:a,normalizationType:s,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:u,maxValue:h,numBins:c,scale:f,timeZone:m}=e,_=await this._getDataValues({field:t,valueExpression:i,normalizationField:a,normalizationType:s,normalizationTotal:r,scale:f,timeZone:m});return as(_,{field:t,normalizationField:a,normalizationType:s,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:u,maxValue:h,numBins:c})}_sortFeatures(e,t,i){if(e.length>1&&(t!=null&&t.length))for(const a of t.reverse()){const s=a.split(" "),r=s[0],n=this.fieldsIndex.get(r),o=!!s[1]&&s[1].toLowerCase()==="desc",u=rs(n==null?void 0:n.type,o);e.sort((h,c)=>{const f=i(h,r,n),m=i(c,r,n);return u(f,m)})}}_createFeatureQueryResponse(e){const t=this.items,{geometryType:i,hasM:a,hasZ:s,objectIdField:r,spatialReference:n}=this,{outFields:o,outSR:u,quantizationParameters:h,resultRecordCount:c,resultOffset:f,returnZ:m,returnM:_}=e,d=c!=null&&t.length>(f||0)+c,x=o&&(o.includes("*")?[...this.fieldsIndex.fields]:o.map(E=>this.fieldsIndex.get(E)));return{exceededTransferLimit:d,features:this._createFeatures(e,t),fields:x,geometryType:i,hasM:a&&_,hasZ:s&&m,objectIdFieldName:r,spatialReference:H(u||n),transform:h&&$e(h)||null}}_createFeatures(e,t){const i=new ee(e,this.featureAdapter,this.fieldsIndex),{hasM:a,hasZ:s}=this,{orderByFields:r,quantizationParameters:n,returnGeometry:o,returnCentroid:u,maxAllowableOffset:h,resultOffset:c,resultRecordCount:f,returnZ:m=!1,returnM:_=!1}=e,d=s&&m,x=a&&_;let E=[],S=0;const R=[...t];if(this._sortFeatures(R,r,(y,I,T)=>i.getFieldValue(y,I,T)),this.geometryType&&(o||u)){const y=$e(n)??void 0,I=this.geometryType==="esriGeometryPolygon"||this.geometryType==="esriGeometryPolyline";if(o&&!u)for(const T of R){const F=this.featureAdapter.getGeometry(T),b={attributes:i.getAttributes(T),geometry:Z(this.geometryType,this.hasZ,this.hasM,F,h,y,d,x)};I&&F&&!b.geometry&&(b.centroid=ne(this,this.featureAdapter.getCentroid(T,this),y)),E[S++]=b}else if(!o&&u)for(const T of R)E[S++]={attributes:i.getAttributes(T),centroid:ne(this,this.featureAdapter.getCentroid(T,this),y)};else for(const T of R)E[S++]={attributes:i.getAttributes(T),centroid:ne(this,this.featureAdapter.getCentroid(T,this),y),geometry:Z(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(T),h,y,d,x)}}else for(const y of R){const I=i.getAttributes(y);I&&(E[S++]={attributes:I})}const p=c||0;if(f!=null){const y=p+f;E=E.slice(p,Math.min(E.length,y))}return E}_createExceedsLimitQueryResponse(e){let t=!1,i=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;for(const r of e.outStatistics??[])if(r.statisticType==="exceedslimit"){i=r.maxPointCount!=null?r.maxPointCount:Number.POSITIVE_INFINITY,a=r.maxRecordCount!=null?r.maxRecordCount:Number.POSITIVE_INFINITY,s=r.maxVertexCount!=null?r.maxVertexCount:Number.POSITIVE_INFINITY;break}if(this.geometryType==="esriGeometryPoint")t=this.items.length>i;else if(this.items.length>a)t=!0;else{const r=Ve(this.hasZ,this.hasM),n=this.featureAdapter;t=this.items.reduce((o,u)=>{const h=n.getGeometry(u);return o+(h!=null&&h.coords.length||0)},0)/r>s}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(t)}}]}}async _createStatisticsQueryResponse(e){var R;const t={attributes:{}},i=[],a=new Map,s=new Map,r=new Map,n=new Map,o=new ee(e,this.featureAdapter,this.fieldsIndex),u=e.outStatistics,{groupByFieldsForStatistics:h,having:c,orderByFields:f,resultRecordCount:m}=e,_=h==null?void 0:h.length,d=!!_,x=d?h[0]:null,E=d&&!this.fieldsIndex.get(x);for(const p of u??[]){const{outStatisticFieldName:y,statisticType:I}=p,T=p,F=I!=="exceedslimit"?p.onStatisticField:void 0,b=I==="percentile_disc"||I==="percentile_cont",P=I==="EnvelopeAggregate"||I==="CentroidAggregate"||I==="ConvexHullAggregate",W=d&&_===1&&(F===x||E)&&I==="count";if(d){if(!r.has(F)){const X=[];for(const re of h){const K=this._getAttributeValues(o,re,a);X.push(K)}r.set(F,this._calculateUniqueValues(X,!P&&o.returnDistinctValues))}const $=r.get(F);if(!$)continue;const ae=Object.keys($);for(const X of ae){const{count:re,data:K,items:xe,itemPositions:ot}=$[X],Ie=K.join(",");if(!c||o.validateItems(xe,c)){const M=n.get(Ie)||{attributes:{}};if(P){M.aggregateGeometries||(M.aggregateGeometries={});const{aggregateGeometries:k,outStatisticFieldName:z}=await this._getAggregateGeometry(T,xe);M.aggregateGeometries[z]=k}else{let k=null;if(W)k=re;else{const z=this._getAttributeValues(o,F,a),Fe=ot.map(ht=>z[ht]);k=b&&"statisticParameters"in T?this._getPercentileValue(T,Fe):this._getStatisticValue(T,Fe,null,o.returnDistinctValues)}M.attributes[y]=k}let ut=0;h.forEach((k,z)=>M.attributes[this.fieldsIndex.get(k)?k:"EXPR_"+ ++ut]=K[z]),n.set(Ie,M)}}}else if(P){t.aggregateGeometries||(t.aggregateGeometries={});const{aggregateGeometries:$,outStatisticFieldName:ae}=await this._getAggregateGeometry(T,this.items);t.aggregateGeometries[ae]=$}else{const $=this._getAttributeValues(o,F,a);t.attributes[y]=b&&"statisticParameters"in T?this._getPercentileValue(T,$):this._getStatisticValue(T,$,s,o.returnDistinctValues)}const J=I!=="min"&&I!=="max"||!le(this.fieldsIndex.get(F))&&!this._isAnyDateField(F)?null:(R=this.fieldsIndex.get(F))==null?void 0:R.type;i.push({name:y,alias:y,type:J||"esriFieldTypeDouble"})}const S=d?Array.from(n.values()):[t];return this._sortFeatures(S,f,(p,y)=>p.attributes[y]),m&&(S.length=Math.min(m,S.length)),{fields:i,features:S}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return Ae(t)||me(t)||fe(t)||Xe(t)}async _getAggregateGeometry(e,t){const{convexHull:i,union:a}=await yt(()=>import("./geometryEngineJSON-BfS7Q-po.js").then(d=>d.g),__vite__mapDeps([0,1,2,3,4])),{statisticType:s,outStatisticFieldName:r}=e,{featureAdapter:n,spatialReference:o,geometryType:u,hasZ:h,hasM:c}=this,f=t.map(d=>Z(u,h,c,n.getGeometry(d))),m=i(o,f,!0)[0],_={aggregateGeometries:null,outStatisticFieldName:null};if(s==="EnvelopeAggregate"){const d=m?Tt(m):Ce(a(o,f));_.aggregateGeometries={...d,spatialReference:o},_.outStatisticFieldName=r||"extent"}else if(s==="CentroidAggregate"){const d=m?Et(m):xt(Ce(a(o,f)));_.aggregateGeometries={x:d[0],y:d[1],spatialReference:o},_.outStatisticFieldName=r||"centroid"}else s==="ConvexHullAggregate"&&(_.aggregateGeometries=m,_.outStatisticFieldName=r||"convexHull");return _}_getStatisticValue(e,t,i,a){const{onStatisticField:s,statisticType:r}=e;let n=null;return n=i!=null&&i.has(s)?i.get(s):le(this.fieldsIndex.get(s))||this._isAnyDateField(s)?ke({values:t,returnDistinct:a}):De({values:a?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),i&&i.set(s,n),n[r==="var"?"variance":r]}_getPercentileValue(e,t){const{onStatisticField:i,statisticParameters:a,statisticType:s}=e,{value:r,orderBy:n}=a,o=this.fieldsIndex.get(i);return ns(t,{value:r,orderBy:n,fieldType:o==null?void 0:o.type,isDiscrete:s==="percentile_disc"})}_getAttributeValues(e,t,i){if(i.has(t))return i.get(t);const a=this.fieldsIndex.get(t),s=this.items.map(r=>e.getFieldValue(r,t,a));return i.set(t,s),s}_calculateUniqueValues(e,t){const i={},a=this.items,s=a.length;for(let r=0;rl)}function nt(l,e,t){const{outFields:i,orderByFields:a,returnDistinctValues:s,outStatistics:r}=t,n=r?r.map(o=>o.outStatisticFieldName&&o.outStatisticFieldName.toLowerCase()).filter(Boolean):[];if(a&&a.length>0){const o=" asc",u=" desc",h=a.map(c=>{const f=c.toLowerCase();return f.includes(o)?f.split(o)[0]:f.includes(u)?f.split(u)[0]:c}).filter(c=>!n.includes(c));L(l,e,h,{expressionName:"orderByFields",query:t})}if(i&&i.length>0)L(l,e,i,{expressionName:"outFields",query:t,allowedFieldTypes:"all"});else if(s)throw new A(q,"outFields should be specified for returnDistinctValues",{query:t});hs(l,e,t.where,t)}const _s=new Set([...it,...at]);function ps(l,e,t){const{outStatistics:i,groupByFieldsForStatistics:a,having:s}=t,r=a==null?void 0:a.length,n=i==null?void 0:i.length;if(s){if(!r||!n)throw new A(q,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:t});cs(l,e,s,i,t)}if(n){if(!Es(i))return;const o=i.map(u=>u.onStatisticField).filter(Boolean);L(l,e,o,{expressionName:"onStatisticFields",query:t}),r&&L(l,e,a,{expressionName:"groupByFieldsForStatistics",query:t});for(const u of i){const{onStatisticField:h,statisticType:c}=u;if((c==="percentile_disc"||c==="percentile_cont")&&"statisticParameters"in u){const{statisticParameters:f}=u;if(!f)throw new A(q,"statisticParameters should be set for percentile type",{definition:u,query:t})}else l.get(h)&&c!=="count"&&c!=="min"&&c!=="max"&&L(l,e,[h],{expressionName:`outStatistics with '${c}' statistic type`,allowedFieldTypes:_s,query:t})}}}async function ys(l,e,{fieldsIndex:t,geometryType:i,spatialReference:a,availableFields:s}){if((l.distance??0)<0||l.geometryPrecision!=null||l.multipatchOption||l.pixelSize||l.relationParam||l.text||l.outStatistics||l.groupByFieldsForStatistics||l.having||l.orderByFields)throw new A(q,"Unsupported query options",{query:l});return nt(t,s,l),Promise.all([Ts(t,s,e,l),Je(l,i,a),Te(a,l.outSR)]).then(()=>l)}async function Ts(l,e,t,i){let a=[];if(t.valueExpression){const{arcadeUtils:s}=await Ke();a=s.extractFieldNames(t.valueExpression)}if(t.field&&a.push(t.field),t.field2&&a.push(t.field2),t.field3&&a.push(t.field3),t.normalizationField&&a.push(t.normalizationField),!a.length&&!t.valueExpression)throw new A(q,"field or valueExpression is required",{params:t});L(l,e,a,{expressionName:"statistics",query:i})}function Es(l){return l!=null&&l.every(e=>e.statisticType!=="exceedslimit")}const lt=Symbol("Yield");class xs{constructor(){this._tasks=new Array,this._runningTasks=_e(0)}get length(){return this._tasks.length}get running(){return this._runningTasks.value>0}destroy(){this.cancelAll()}runTask(e){if(this.length===0)return lt;for(;!e.done&&this._process(e);)e.madeProgress()}push(e,t,i){return++this._runningTasks.value,new Promise((a,s)=>this._tasks.push(new Ue(a,s,e,t,i))).finally(()=>--this._runningTasks.value)}unshift(e,t,i){return++this._runningTasks.value,new Promise((a,s)=>this._tasks.unshift(new Ue(a,s,e,t,i))).finally(()=>--this._runningTasks.value)}_process(e){var i;if(this._tasks.length===0)return!1;const t=this._tasks.shift();try{const a=et(t.signal);if(a&&!t.abortCallback)t.reject(se());else{const s=a?(i=t.abortCallback)==null?void 0:i.call(t,se()):t.callback(e);It(s)?s.then(t.resolve,t.reject):t.resolve(s)}}catch(a){t.reject(a)}return!0}cancelAll(){const e=se();for(const t of this._tasks)if(t.abortCallback){const i=t.abortCallback(e);t.resolve(i)}else t.reject(e);this._tasks.length=0}}class Ue{constructor(e,t,i,a=void 0,s=void 0){this.resolve=e,this.reject=t,this.callback=i,this.signal=a,this.abortCallback=s}}let B=class extends St{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};oe([ve()],B.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),oe([ve()],B.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),B=oe([Ft("esri.views.support.DebugFlags")],B);const Is=new B;var g;(function(l){l.RESOURCE_CONTROLLER_IMMEDIATE="immediate",l.RESOURCE_CONTROLLER="schedule",l.SLIDE="slide",l.STREAM_DATA_LOADER="stream loader",l.ELEVATION_QUERY="elevation query",l.TERRAIN_SURFACE="terrain",l.SURFACE_GEOMETRY_UPDATES="surface geometry updates",l.LOD_RENDERER="LoD renderer",l.GRAPHICS_CORE="Graphics3D",l.I3S_CONTROLLER="I3S",l.POINT_CLOUD_LAYER="point cloud",l.FEATURE_TILE_FETCHER="feature fetcher",l.OVERLAY="overlay",l.STAGE="stage",l.GRAPHICS_DECONFLICTOR="graphics deconflictor",l.FILTER_VISIBILITY="Graphics3D filter visibility",l.SCALE_VISIBILITY="Graphics3D scale visibility",l.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",l.POINT_OF_INTEREST_FREQUENT="POI frequent",l.POINT_OF_INTEREST_INFREQUENT="POI infrequent",l.LABELER="labeler",l.FEATURE_QUERY_ENGINE="feature query",l.FEATURE_TILE_TREE="feature tile tree",l.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",l.ELEVATION_ALIGNMENT="elevation alignment",l.ELEVATION_ALIGNMENT_SCENE="elevation alignment scene",l.TEXT_TEXTURE_ATLAS="text texture atlas",l.TEXTURE_UNLOAD="texture unload",l.LINE_OF_SIGHT_TOOL="line of sight tool",l.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",l.ELEVATION_PROFILE="elevation profile",l.SNAPPING="snapping",l.SHADOW_ACCUMULATOR="shadow accumulator",l.CLOUDS_GENERATOR="clouds generator",l[l.NONE=0]="NONE",l[l.TEST_PRIO=1]="TEST_PRIO"})(g||(g={}));const O=0,qe=new Map([[g.RESOURCE_CONTROLLER_IMMEDIATE,O],[g.RESOURCE_CONTROLLER,4],[g.SLIDE,O],[g.STREAM_DATA_LOADER,O],[g.ELEVATION_QUERY,O],[g.TERRAIN_SURFACE,1],[g.SURFACE_GEOMETRY_UPDATES,1],[g.LOD_RENDERER,2],[g.GRAPHICS_CORE,2],[g.I3S_CONTROLLER,2],[g.POINT_CLOUD_LAYER,2],[g.FEATURE_TILE_FETCHER,2],[g.OVERLAY,4],[g.STAGE,4],[g.GRAPHICS_DECONFLICTOR,4],[g.FILTER_VISIBILITY,4],[g.SCALE_VISIBILITY,4],[g.FRUSTUM_VISIBILITY,4],[g.CLOUDS_GENERATOR,4],[g.POINT_OF_INTEREST_FREQUENT,6],[g.POINT_OF_INTEREST_INFREQUENT,30],[g.LABELER,8],[g.FEATURE_QUERY_ENGINE,8],[g.FEATURE_TILE_TREE,16],[g.FEATURE_TILE_TREE_ACTIVE,O],[g.ELEVATION_ALIGNMENT,12],[g.ELEVATION_ALIGNMENT_SCENE,14],[g.TEXT_TEXTURE_ATLAS,12],[g.TEXTURE_UNLOAD,12],[g.LINE_OF_SIGHT_TOOL,16],[g.LINE_OF_SIGHT_TOOL_INTERACTIVE,O],[g.SNAPPING,O],[g.SHADOW_ACCUMULATOR,30]]);function ze(l){return qe.has(l)?qe.get(l):typeof l=="number"?l:1}const je=N(6.5),Be=N(1),Fs=N(30),Ze=N(1e3/30),He=N(100),Ye=.9;var ye,Q;(function(l){class e{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some(s=>s.needsUpdate)}constructor(){this._updating=_e(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new ue("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new i,this._state=v.INTERACTING,this._tasks=new he,this._runQueue=new he,this._load=0,this._idleStateCallbacks=new he,this._idleUpdatesStartFired=!1,this._forceTask=!1,this._debug=!1,this._debugHandle=Rt(()=>Is.SCHEDULER_LOG_SLOW_TASKS,r=>this._debug=r,bt);for(const r of Object.keys(g))this.performanceInfo.tasks.set(g[r],new ue(g[r]));const s=this;this._test={FRAME_SAFETY_BUDGET:je,INTERACTING_BUDGET:Ze,IDLE_BUDGET:He,get availableBudget(){return s._budget.budget},usedBudget:0,getBudget:()=>s._budget,setBudget:r=>s._budget=r,updateTask:r=>this._updateTask(r),getState:r=>this._getState(r),getRuntime:r=>this._getRuntime(r),frameTaskTimes:this._frameTaskTimes,resetRuntimes:()=>this._resetRuntimes(),getRunning:()=>this._getRunning()}}destroy(){this._tasks.toArray().forEach(s=>s.remove()),this._tasks.clear(),pe(this._debugHandle),this._microTaskQueued=!1,this._updatingChanged()}taskRunningChanged(s){this._updatingChanged(),s&&this._budget.remaining>0&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask(()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.remaining>0&&this._schedule()&&this.frame())}))}registerTask(s,r){const n=new t(this,s,r);return this._tasks.push(n),this._updatingChanged(),this.performanceInfo.tasks.has(s)||this.performanceInfo.tasks.set(s,new ue(s)),n}registerIdleStateCallbacks(s,r){const n={idleBegin:s,idleEnd:r};this._idleStateCallbacks.push(n),this.state===v.IDLE&&this._idleUpdatesStartFired&&n.idleBegin();const o=this;return{remove:()=>this._removeIdleStateCallbacks(n),set idleBegin(u){o._idleUpdatesStartFired&&(n.idleEnd(),o._state===v.IDLE&&u()),n.idleBegin=u},set idleEnd(u){n.idleEnd=u}}}get load(){return this._load}set state(s){this._state!==s&&(this._state=s,this.state!==v.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll(r=>r.idleEnd())))}get state(){return this._state}updateBudget(s){this._test.usedBudget=0,++this._frameNumber;let r=je,n=s.frameDuration,o=Be;switch(this.state){case v.IDLE:r=N(0),n=N(Math.max(He,s.frameDuration)),o=Fs;break;case v.INTERACTING:n=N(Math.max(Ze,s.frameDuration));case v.ANIMATING:}return n=N(n-s.elapsedFrameTime-r),this.state!==v.IDLE&&ns.idleBegin())),this._runIdle();break;case v.INTERACTING:this._runInteracting();break;default:this._runAnimating()}this._test.usedBudget=this._budget.elapsed}stopFrame(){this._budget.reset(N(0),this._state),this._budget.madeProgress()}_removeIdleStateCallbacks(s){this._idleUpdatesStartFired&&s.idleEnd(),this._idleStateCallbacks.removeUnordered(s)}removeTask(s){this._tasks.removeUnordered(s),this._runQueue.removeUnordered(s),this._updatingChanged()}_updateTask(s){this._tasks.forAll(r=>{r.name===s&&r.setPriority(s)})}_getState(s){if(this._runQueue.some(n=>n.name===s))return Q.SCHEDULED;let r=Q.IDLE;return this._tasks.forAll(n=>{n.name===s&&n.needsUpdate&&(n.schedulePriority<=1?r=Q.READY:r!==Q.READY&&(r=Q.WAITING))}),r}_getRuntime(s){let r=0;return this._tasks.forAll(n=>{n.name===s&&(r+=n.runtime)}),r}_resetRuntimes(){this._tasks.forAll(s=>s.runtime=0)}_getRunning(){const s=new Map;if(this._tasks.forAll(n=>{n.needsUpdate&&s.set(n.name,(s.get(n.name)||0)+1)}),s.size===0)return null;let r="";return s.forEach((n,o)=>{r+=n>1?` ${n}x ${o}`:` ${o}`}),r}_runIdle(){this._run()}_runInteracting(){this._run()}_runAnimating(){this._run()}_updateLoad(){const s=this._tasks.reduce((r,n)=>n.needsUpdate?++r:r,0);this._load=this._load*Ye+s*(1-Ye)}_schedule(){for(this._runQueue.filterInPlace(s=>!!s.needsUpdate||(s.schedulePriority=s.basePriority,!1)),this._tasks.forAll(s=>{s.basePriority===O&&s.needsUpdate&&!this._runQueue.includes(s)&&s.blockFrame!==this._frameNumber&&this._runQueue.unshift(s)});this._runQueue.length===0;){let s=!1,r=0;if(this._tasks.forAll(n=>{n.needsUpdate&&n.schedulePriority!==0&&n.basePriority!==O&&n.blockFrame!==this._frameNumber&&(s=!0,r=Math.max(r,n.basePriority),n.schedulePriority===1?(n.schedulePriority=0,this._runQueue.push(n)):--n.schedulePriority)}),!s)return this._updatingChanged(),!1}return this._updatingChanged(),!0}_run(){const s=this._budget.now();this._startFrameTaskTimes();do for(;this._runQueue.length>0;){const r=this._budget.now(),n=this._runQueue.pop();this._budget.resetProgress();try{n.task.runTask(this._budget)===lt&&(n.blockFrame=this._frameNumber)}catch(u){wt.getLogger("esri.views.support.Scheduler").error(`Exception in task "${n.name}"`,u),n.blockFrame=this._frameNumber}!this._budget.hasProgressed&&n.blockFrame!==this._frameNumber&&n.needsUpdate&&(n.name,g.I3S_CONTROLLER,n.blockFrame=this._frameNumber),n.schedulePriority=n.basePriority;const o=this._budget.now()-r;if(n.runtime+=o,this._frameTaskTimes.set(n.priority,this._frameTaskTimes.get(n.priority)+o),this._debug&&o>2*this._budget.budget&&console.log("Task",n.name,"used",o,"of max",this._budget.budget,"ms"),this._budget.remaining<=0)return this._updatingChanged(),void this._recordFrameTaskTimes(this._budget.now()-s)}while(this._schedule());this._updatingChanged(),this._recordFrameTaskTimes(this._budget.now()-s)}_startFrameTaskTimes(){for(const s of Object.keys(g))this._frameTaskTimes.set(g[s],0)}_recordFrameTaskTimes(s){this._frameTaskTimes.forEach((r,n)=>this.performanceInfo.tasks.get(n).record(r)),this.performanceInfo.total.record(s)}get test(){return this._test}}l.Scheduler=e;class t{get task(){return this._task.value}get updating(){return this._queue.running}constructor(s,r,n){this._scheduler=s,this.name=r,this.blockFrame=0,this.runtime=0,this._queue=new xs,this._handles=new At,this._basePriority=ze(r),this.schedulePriority=this._basePriority,this._task=_e(n??this._queue),this._handles.add(Ct(()=>this.task.running,o=>s.taskRunningChanged(o)))}remove(){this.processQueue(ie),this._scheduler.removeTask(this),this.schedule=We.schedule,this.reschedule=We.reschedule,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(s){if(this.name===s)return;this.name=s;const r=ze(s);this._basePriority!==O&&this.schedulePriority===0||(this.schedulePriority=r),this._basePriority=r}get priority(){return this.name}set priority(s){this.setPriority(s)}get needsUpdate(){return this.updating||this.task.running}schedule(s,r,n){return this._queue.push(s,r,n)}reschedule(s,r,n){return this._queue.unshift(s,r,n)}processQueue(s){return this._queue.runTask(s)}}class i{constructor(){this._begin=typeof performance<"u"?performance.now():0,this._budget=0,this._state=v.IDLE,this._done=!1,this._progressed=!1,this._enabled=!0}run(s){return!this.done&&(s()===!0&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get state(){return this._state}get enabled(){return this._enabled}set enabled(s){this._enabled=s}reset(s,r){this._begin=this.now(),this._budget=s,this._state=r,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return performance.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}}l.Budget=i})(ye||(ye={})),function(l){l.SCHEDULED="s",l.READY="r",l.WAITING="w",l.IDLE="i"}(Q||(Q={}));const ie=(()=>{const l=new ye.Budget;return l.enabled=!1,l})();class Ss{remove(){}processQueue(){}schedule(e,t,i){try{if(et(t)){const a=se();return i?Promise.resolve(i(a)):Promise.reject(a)}return vt(e(ie))}catch(a){return Promise.reject(a)}}reschedule(e,t,i){return this.schedule(e,t,i)}}const We=new Ss,Rs="unsupported-query",bs=new Nt(2e6);let ws=0;class Ms{constructor(e){this._geometryQueryCache=null,this._changeHandle=null,this.capabilities={query:Yt},this.geometryType=e.geometryType,this.hasM=!!e.hasM,this.hasZ=!!e.hasZ,this.objectIdField=e.objectIdField,this.spatialReference=e.spatialReference,this.definitionExpression=e.definitionExpression,this.featureStore=e.featureStore,this.aggregateAdapter=e.aggregateAdapter,this._changeHandle=this.featureStore.events.on("changed",()=>this.clearCache()),this.timeInfo=e.timeInfo,e.cacheSpatialQueries&&(this._geometryQueryCache=new Ot(ws+++"$$",bs)),this.fieldsIndex=Pt(e.fieldsIndex)?e.fieldsIndex:ls.fromJSON(e.fieldsIndex),!e.availableFields||e.availableFields.length===1&&e.availableFields[0]==="*"?this.availableFields=new Set(this.fieldsIndex.fields.map(t=>t.name)):this.availableFields=new Set(e.availableFields.map(t=>{var i;return(i=this.fieldsIndex.get(t))==null?void 0:i.name}).filter(t=>t!=null)),e.scheduler&&e.priority&&(this._frameTask=e.scheduler.registerTask(e.priority))}destroy(){this._frameTask=pe(this._frameTask),this.clearCache(),$t(this._geometryQueryCache),this._changeHandle=pe(this._changeHandle)}get featureAdapter(){return this.featureStore.featureAdapter}clearCache(){var e;(e=this._geometryQueryCache)==null||e.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null,this._fullExtentPromise=null}async executeQuery(e,t){const i=C(t);try{return(await this._executeQuery(e,{},i)).createQueryResponse()}catch(a){if(a!==U)throw a;return new w([],e,this).createQueryResponse()}}async executeQueryForCount(e={},t){const i=C(t);try{return(await this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null},i)).createQueryResponseForCount()}catch(a){if(a!==U)throw a;return 0}}async executeQueryForExtent(e,t){const i=C(t),a=e.outSR;try{const s=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},i),r=s.size;return r?{count:r,extent:await this._getBounds(s.items,s.spatialReference,a||this.spatialReference)}:{count:0,extent:null}}catch(s){if(s===U)return{count:0,extent:null};throw s}}async executeQueryForIds(e,t){return this.executeQueryForIdSet(e,t).then(i=>Array.from(i))}async executeQueryForIdSet(e,t){const i=C(t);try{const a=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},i),s=a.items,r=new Set;return await this._reschedule(()=>{for(const n of s)r.add(a.featureAdapter.getObjectId(n))},i),r}catch(a){if(a===U)return new Set;throw a}}async executeQueryForSnapping(e,t){const i=C(t),{point:a,distance:s,returnEdge:r,vertexMode:n}=e;if(!r&&n==="none")return{candidates:[]};let o=te(e.query);o=await this._schedule(()=>dt(o,this.definitionExpression,this.spatialReference),i),o=await this._reschedule(()=>Me(o,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),i);const u=!D(a.spatialReference,this.spatialReference);u&&await Te(a.spatialReference,this.spatialReference);const h=typeof s=="number"?s:s.x,c=typeof s=="number"?s:s.y,f={xmin:a.x-h,xmax:a.x+h,ymin:a.y-c,ymax:a.y+c,spatialReference:a.spatialReference},m=u?V(f,this.spatialReference):f;if(!m)return{candidates:[]};const _=(await Ne(Oe(a),null,{signal:i}))[0],d=(await Ne(Oe(m),null,{signal:i}))[0];if(_==null||d==null)return{candidates:[]};const x=new w(await this._reschedule(()=>this._searchFeatures(this._getQueryBBoxes(d.toJSON())),i),o,this);await this._reschedule(()=>this._executeObjectIdsQuery(x),i),await this._reschedule(()=>this._executeTimeQuery(x),i),await this._reschedule(()=>this._executeAttributesQuery(x),i),await this._reschedule(()=>this._executeGeometryQueryForSnapping(x,i),i);const E=_.toJSON(),S=u?V(E,this.spatialReference):E,R=u?Math.max(m.xmax-m.xmin,m.ymax-m.ymin)/2:s;return x.createSnappingResponse({...e,point:S,distance:R},a.spatialReference)}async executeQueryForLatestObservations(e,t){var a;const i=C(t);if(!((a=this.timeInfo)!=null&&a.trackIdField))throw new A(Rs,"Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});try{const s=await this._executeQuery(e,{},i);return await this._reschedule(()=>this._filterLatest(s),i),s.createQueryResponse()}catch(s){if(s!==U)throw s;return new w([],e,this).createQueryResponse()}}async executeQueryForSummaryStatistics(e={},t,i){const a=C(i),{field:s,normalizationField:r,valueExpression:n}=t;return(await this._executeQueryForStatistics(e,{field:s,normalizationField:r,valueExpression:n},a)).createSummaryStatisticsResponse(t)}async executeQueryForUniqueValues(e={},t,i){const a=C(i),{field:s,field2:r,field3:n,valueExpression:o}=t;return(await this._executeQueryForStatistics(e,{field:s,field2:r,field3:n,valueExpression:o},a)).createUniqueValuesResponse(t)}async executeQueryForClassBreaks(e={},t,i){const a=C(i),{field:s,normalizationField:r,valueExpression:n}=t;return(await this._executeQueryForStatistics(e,{field:s,normalizationField:r,valueExpression:n},a)).createClassBreaksResponse(t)}async executeQueryForHistogram(e={},t,i){const a=C(i),{field:s,normalizationField:r,valueExpression:n}=t;return(await this._executeQueryForStatistics(e,{field:s,normalizationField:r,valueExpression:n},a)).createHistogramResponse(t)}async fetchRecomputedExtents(e){const t=C(e);this._timeExtentPromise||(this._timeExtentPromise=mt(this.timeInfo,this.featureStore));const[i,a]=await Promise.all([this._getFullExtent(),this._timeExtentPromise]);return kt(t),{fullExtent:i,timeExtent:a}}async _getBounds(e,t,i){const a=Dt(Lt(),jt);await this.featureStore.forEachBounds(e,n=>Qt(a,n));const s={xmin:a[0],ymin:a[1],xmax:a[3],ymax:a[4],spatialReference:H(this.spatialReference)};this.hasZ&&isFinite(a[2])&&isFinite(a[5])&&(s.zmin=a[2],s.zmax=a[5]);const r=V(s,t,i);if(r.spatialReference=H(i),r.xmax-r.xmin==0){const n=ce(r.spatialReference);r.xmin-=n,r.xmax+=n}if(r.ymax-r.ymin==0){const n=ce(r.spatialReference);r.ymin-=n,r.ymax+=n}if(this.hasZ&&r.zmin!=null&&r.zmax!=null&&r.zmax-r.zmin==0){const n=ce(r.spatialReference);r.zmin-=n,r.zmax+=n}return r}_getFullExtent(){return this._fullExtentPromise||(this._fullExtentPromise="getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getAllFeatures().then(e=>this._getBounds(e,this.spatialReference,this.spatialReference))),this._fullExtentPromise}async _schedule(e,t){return this._frameTask!=null?this._frameTask.schedule(e,t):e(ie)}async _reschedule(e,t){return this._frameTask!=null?this._frameTask.reschedule(e,t):e(ie)}async _getAllFeaturesQueryEngineResult(e){return new w(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(this._allFeaturesPromise==null){const i=[];this._allFeaturesPromise=(async()=>{await this.featureStore.forEach(a=>i.push(a))})().then(()=>i)}const e=this._allFeaturesPromise,t=await e;return e===this._allFeaturesPromise?t.slice():this._getAllFeatures()}async _executeQuery(e,t,i){e=te(e),e=await this._schedule(()=>Se(e,this.definitionExpression,this.spatialReference),i),e=await this._reschedule(()=>Me(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),i),e={...e,...t};const a=await this._reschedule(()=>this._executeSceneFilterQuery(e,i),i),s=await this._reschedule(()=>this._executeGeometryQuery(e,a,i),i);return await this._reschedule(()=>this._executeAggregateIdsQuery(s),i),await this._reschedule(()=>this._executeObjectIdsQuery(s),i),await this._reschedule(()=>this._executeTimeQuery(s),i),await this._reschedule(()=>this._executeAttributesQuery(s),i),s}async _executeSceneFilterQuery(e,t){if(e.sceneFilter==null)return null;const{outSR:i,returnGeometry:a,returnCentroid:s}=e,r=this.featureStore.featureSpatialReference,n=e.sceneFilter.geometry,o=r==null||D(r,n.spatialReference)?n:V(n,r);if(!o)return null;const u=a||s,h=ge(i)&&!D(this.spatialReference,i)&&u?async d=>this._project(d,i):d=>d,c=this.featureAdapter,f=await this._reschedule(()=>this._searchFeatures(this._getQueryBBoxes(o)),t);if(e.sceneFilter.spatialRelationship==="disjoint"){if(!f.length)return null;const d=new Set;for(const S of f)d.add(c.getObjectId(S));const x=await this._reschedule(()=>this._getAllFeatures(),t),E=await this._reschedule(async()=>{const S=await j("esriSpatialRelDisjoint",o,this.geometryType,this.hasZ,this.hasM),R=y=>!d.has(c.getObjectId(y))||S(c.getGeometry(y)),p=await this._runSpatialFilter(x,R,t);return new w(p,e,this)},t);return h(E)}if(!f.length)return new w([],e,this);if(this._canExecuteSinglePass(o,e))return h(new w(f,e,this));const m=await j("esriSpatialRelContains",o,this.geometryType,this.hasZ,this.hasM),_=await this._runSpatialFilter(f,d=>m(c.getGeometry(d)),t);return h(new w(_,e,this))}async _executeGeometryQuery(e,t,i){if(t!=null&&t.items.length===0)return t;e=t!=null?t.query:e;const{geometry:a,outSR:s,spatialRel:r,returnGeometry:n,returnCentroid:o}=e,u=this.featureStore.featureSpatialReference,h=!a||u==null||D(u,a.spatialReference)?a:V(a,u),c=n||o,f=ge(s)&&!D(this.spatialReference,s),m=this._geometryQueryCache&&t==null?JSON.stringify(f&&c?{originalFilterGeometry:a,spatialRelationship:r,outSpatialReference:s}:{originalFilterGeometry:a,spatialRelationship:r}):null,_=m?this._geometryQueryCache.get(m):null;if(_!=null)return new w(_,e,this);const d=async p=>(f&&c&&await this._project(p,s),m&&this._geometryQueryCache.put(m,p.items,p.items.length+1),p);if(!h)return d(t??await this._getAllFeaturesQueryEngineResult(e));const x=this.featureAdapter;let E=await this._reschedule(()=>this._searchFeatures(this._getQueryBBoxes(a)),i);if(r==="esriSpatialRelDisjoint"){if(!E.length)return d(t??await this._getAllFeaturesQueryEngineResult(e));const p=new Set;for(const T of E)p.add(x.getObjectId(T));const y=t!=null?t.items:await this._reschedule(()=>this._getAllFeatures(),i),I=await this._reschedule(async()=>{const T=await j(r,h,this.geometryType,this.hasZ,this.hasM),F=P=>!p.has(x.getObjectId(P))||T(x.getGeometry(P)),b=await this._runSpatialFilter(y,F,i);return new w(b,e,this)},i);return d(I)}if(t!=null){const p=new Bt;E=E.filter(y=>Vt(t.items,y,t.items.length,p)>=0)}if(!E.length){const p=new w([],e,this);return m&&this._geometryQueryCache.put(m,p.items,1),p}if(this._canExecuteSinglePass(h,e))return d(new w(E,e,this));const S=await j(r,h,this.geometryType,this.hasZ,this.hasM),R=await this._runSpatialFilter(E,p=>S(x.getGeometry(p)),i);return d(new w(R,e,this))}async _executeGeometryQueryForSnapping(e,t){var n;const{query:i}=e,{spatialRel:a}=i;if(!((n=e==null?void 0:e.items)!=null&&n.length)||!i.geometry||!a)return;const s=await j(a,i.geometry,this.geometryType,this.hasZ,this.hasM),r=await this._runSpatialFilter(e.items,o=>s(o.geometry),t);e.items=r}_executeAggregateIdsQuery(e){var a;if(e.items.length===0||!((a=e.query.aggregateIds)!=null&&a.length)||this.aggregateAdapter==null)return;const t=new Set;for(const s of e.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(s).forEach(r=>t.add(r));const i=this.featureAdapter.getObjectId;e.items=e.items.filter(s=>t.has(i(s)))}_executeObjectIdsQuery(e){var a;if(e.items.length===0||!((a=e.query.objectIds)!=null&&a.length))return;const t=new Set(e.query.objectIds),i=this.featureAdapter.getObjectId;e.items=e.items.filter(s=>t.has(i(s)))}_executeTimeQuery(e){if(e.items.length===0)return;const t=ft(this.timeInfo,e.query.timeExtent,this.featureAdapter);t!=null&&(e.items=e.items.filter(t))}_executeAttributesQuery(e){if(e.items.length===0)return;const t=G(e.query.where,this.fieldsIndex);if(t){if(!t.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter(i=>t.testFeature(i,this.featureAdapter))}}async _runSpatialFilter(e,t,i){if(!t)return e;if(this._frameTask==null)return e.filter(n=>t(n));let a=0;const s=new Array,r=async n=>{for(;ar(u),i)}};return this._reschedule(n=>r(n),i).then(()=>s)}_filterLatest(e){const{trackIdField:t,startTimeField:i,endTimeField:a}=this.timeInfo,s=a||i,r=new Map,n=this.featureAdapter.getAttribute;for(const o of e.items){const u=n(o,t),h=n(o,s),c=r.get(u);(!c||h>n(c,s))&&r.set(u,o)}e.items=Array.from(r.values())}_canExecuteSinglePass(e,t){const{spatialRel:i}=t;return Re(e)&&(i==="esriSpatialRelEnvelopeIntersects"||this.geometryType==="esriGeometryPoint"&&(i==="esriSpatialRelIntersects"||i==="esriSpatialRelContains"))}async _project(e,t){if(!t||D(this.spatialReference,t))return e;const i=this.featureAdapter;let a;try{const r=await this._getFullExtent();a=Gt(this.spatialReference,t,r)}catch{}const s=await gt(e.items.map(r=>Z(this.geometryType,this.hasZ,this.hasM,i.getGeometry(r))),this.spatialReference,t,a);return e.items=s.map((r,n)=>i.cloneWithGeometry(e.items[n],Zt(r,this.hasZ,this.hasM))),e}_getQueryBBoxes(e){if(Re(e)){if(Mt(e))return[Pe(Math.min(e.xmin,e.xmax),Math.min(e.ymin,e.ymax),Math.max(e.xmin,e.xmax),Math.max(e.ymin,e.ymax))];if(Ut(e))return e.rings.map(t=>Pe(Math.min(t[0][0],t[2][0]),Math.min(t[0][1],t[2][1]),Math.max(t[0][0],t[2][0]),Math.max(t[0][1],t[2][1])))}return[qt(zt(),e)]}async _searchFeatures(e){const t=new Set;await Promise.all(e.map(a=>this.featureStore.forEachInBounds(a,s=>t.add(s))));const i=Array.from(t.values());return t.clear(),i}async _executeQueryForStatistics(e,t,i){e=te(e);try{e=await this._schedule(()=>Se(e,this.definitionExpression,this.spatialReference),i),e=await this._reschedule(()=>ys(e,t,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),i);const a=await this._reschedule(()=>this._executeSceneFilterQuery(e,i),i),s=await this._reschedule(()=>this._executeGeometryQuery(e,a,i),i);return await this._reschedule(()=>this._executeAggregateIdsQuery(s),i),await this._reschedule(()=>this._executeObjectIdsQuery(s),i),await this._reschedule(()=>this._executeTimeQuery(s),i),await this._reschedule(()=>this._executeAttributesQuery(s),i),s}catch(a){if(a!==U)throw a;return new w([],e,this)}}}export{Ms as $,Vs as o}; diff --git a/assets/QueryTask-CjHwD7wL.js b/assets/QueryTask-Cl66pG_V.js similarity index 68% rename from assets/QueryTask-CjHwD7wL.js rename to assets/QueryTask-Cl66pG_V.js index 20a9fd0..10c7658 100644 --- a/assets/QueryTask-CjHwD7wL.js +++ b/assets/QueryTask-Cl66pG_V.js @@ -1,7 +1,7 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/meshFeatureSet-DmiifJYC.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css","assets/Mesh-9oOqPmbT.js","assets/georeference-DtjTZVKi.js","assets/mat3f64-q3fE-ZOt.js","assets/mat4f64-CSKppSlJ.js","assets/computeTranslationToOriginAndRotation-DOOKw0d1.js","assets/DoubleArray-DxyNBrRi.js","assets/quat-CoKEr4Zu.js","assets/quatf64-Bdb9ZJJK.js","assets/meshVertexSpaceUtils-BFWpJFSd.js","assets/MeshLocalVertexSpace-Cltwu1Kq.js","assets/vec3-CjYmIfaa.js","assets/BufferView-Ao_K-5Vg.js","assets/imageUtils-DNanu5Rn.js","assets/earcut-hRlx3adE.js","assets/Indices-Dv-cCjFT.js","assets/deduplicate-Bk22TunD.js","assets/plane-py4f_JCU.js","assets/triangle-CU37cZF1.js","assets/Util-BS8sJGjF.js","assets/ObjectStack-CF0cQvd2.js","assets/lineSegment-B9UF3nEF.js","assets/basicInterfaces-GbxEOYtk.js","assets/VertexAttribute-BlT9lbVY.js","assets/External-DC51KyR4.js","assets/infoFor3D-DsOdlPuA.js","assets/FeatureSet-CYJUZgOk.js","assets/RelationshipQuery-DDK72Kwc.js","assets/executeRelationshipQuery-DbtTkmN8.js","assets/query-BM8R3sQ6.js","assets/pbfQueryUtils-CLRSFGBm.js","assets/pbf-D9QZb8S8.js","assets/OptimizedGeometry-CQuTPb9g.js","assets/OptimizedFeatureSet-Blu9Ckm7.js","assets/queryZScale-DN4aFXYn.js","assets/queryAttachments-COJi206A.js","assets/AttachmentInfo-DEdzaB9S.js","assets/executeTopFeaturesQuery-9oGsFDn1.js","assets/queryTopFeatures-CtNPRLBc.js","assets/TopFeaturesQuery-B8kC7n5h.js","assets/executeForTopIds-CLsxKpmx.js","assets/executeForTopExtents-BWFPmLVe.js","assets/executeForTopCount-P_PtmMoE.js"] + __vite__mapDeps.viteFileDeps = ["assets/meshFeatureSet-BCixIf_6.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css","assets/Mesh--rTzs1p1.js","assets/georeference-DqFdARS7.js","assets/mat3f64-q3fE-ZOt.js","assets/mat4f64-CSKppSlJ.js","assets/computeTranslationToOriginAndRotation-BeE3rOSz.js","assets/DoubleArray--0pYeNcV.js","assets/quat-C0wQB0HB.js","assets/quatf64-Bdb9ZJJK.js","assets/meshVertexSpaceUtils-DwMoblqo.js","assets/MeshLocalVertexSpace-DRvwbFTJ.js","assets/vec3-DdRUbala.js","assets/BufferView-3om6S_aJ.js","assets/imageUtils-ChIDAvDr.js","assets/earcut-CWKXDqDj.js","assets/Indices-BRm9v2lM.js","assets/deduplicate-BR6i8Xk0.js","assets/plane-DxOTtTwj.js","assets/triangle-DmKBscqo.js","assets/Util-CS5u4Lec.js","assets/ObjectStack-BAIuPeIh.js","assets/lineSegment-BYtydnRZ.js","assets/basicInterfaces-GbxEOYtk.js","assets/VertexAttribute-BlT9lbVY.js","assets/External-DIoD7Bb4.js","assets/infoFor3D-DsOdlPuA.js","assets/FeatureSet-opEn8ou8.js","assets/RelationshipQuery-BDJrOxaX.js","assets/executeRelationshipQuery-BRG4cb0K.js","assets/query-Bk_ITqRK.js","assets/pbfQueryUtils-CSeFSIjv.js","assets/pbf-Du8sFEWo.js","assets/OptimizedGeometry-CQuTPb9g.js","assets/OptimizedFeatureSet-Blu9Ckm7.js","assets/queryZScale-Dwvn5BlQ.js","assets/queryAttachments-DEPYJe-j.js","assets/AttachmentInfo-Cm6dhnUr.js","assets/executeTopFeaturesQuery-DpUwEjEz.js","assets/queryTopFeatures-BZWuOU3o.js","assets/TopFeaturesQuery-CVQjqlfM.js","assets/executeForTopIds-B6SIZ04E.js","assets/executeForTopExtents-C_oYktcC.js","assets/executeForTopCount-DDGFKOhN.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{aW as h,aX as _,aE as T,d as a,y as l,aQ as S,f as A,a7 as N,bW as w,E as Q,fy as d,_ as n,N as P}from"./index-CEWggaxV.js";import{u as f,i as y}from"./infoFor3D-DsOdlPuA.js";import{n as j,s as q}from"./executeForIds-BjeEaIen.js";import{x as L}from"./query-BM8R3sQ6.js";import{a as J}from"./executeQueryJSON-DngjHRnE.js";import{n as z}from"./executeQueryPBF-BYY2Ipuh.js";import{d as $}from"./FeatureSet-CYJUZgOk.js";async function C(e,t,r){const o=h(e),u=await L(o,_.from(t),{...r}),i=u.data.extent;return!i||isNaN(i.xmin)||isNaN(i.ymin)||isNaN(i.xmax)||isNaN(i.ymax)?{count:u.data.count,extent:null}:{count:u.data.count,extent:T.fromJSON(i)}}let s=class extends N{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.queryAttachmentsSupported=!1,this.sourceSpatialReference=null,this.url=null}get parsedUrl(){return w(this.url)}async execute(e,t){const r=await this.executeJSON(e,t);return this.featureSetFromJSON(e,r,t)}async executeJSON(e,t){var c;const r=this._normalizeQuery(e),o=((c=e.outStatistics)==null?void 0:c[0])!=null,u=Q("featurelayer-pbf-statistics"),i=!o||u;let p;if(this.pbfSupported&&i)try{p=await z(this.url,r,t)}catch(m){if(m.name!=="query:parsing-pbf")throw m;this.pbfSupported=!1}return this.pbfSupported&&i||(p=await J(this.url,r,t)),this._normalizeFields(p.fields),p}async featureSetFromJSON(e,t,r){if(!this._queryIs3DObjectFormat(e)||this.infoFor3D==null||!t.features)return $.fromJSON(t);const{meshFeatureSetFromJSON:o}=await d(n(()=>import("./meshFeatureSet-DmiifJYC.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28])),r);return o(e,this.infoFor3D,t)}executeForCount(e,t){return j(this.url,this._normalizeQuery(e),t)}executeForExtent(e,t){return C(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return q(this.url,this._normalizeQuery(e),t)}async executeRelationshipQuery(e,t){const[{default:r},{executeRelationshipQuery:o}]=await d(Promise.all([n(()=>import("./RelationshipQuery-DDK72Kwc.js"),__vite__mapDeps([29,1,2])),n(()=>import("./executeRelationshipQuery-DbtTkmN8.js"),__vite__mapDeps([30,1,2,31,32,33,34,35,36,28,29]))]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),o(this.url,e,t)}async executeRelationshipQueryForCount(e,t){const[{default:r},{executeRelationshipQueryForCount:o}]=await d(Promise.all([n(()=>import("./RelationshipQuery-DDK72Kwc.js"),__vite__mapDeps([29,1,2])),n(()=>import("./executeRelationshipQuery-DbtTkmN8.js"),__vite__mapDeps([30,1,2,31,32,33,34,35,36,28,29]))]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),o(this.url,e,t)}async executeAttachmentQuery(e,t){const{executeAttachmentQuery:r,fetchAttachments:o,processAttachmentQueryResult:u}=await d(n(()=>import("./queryAttachments-COJi206A.js"),__vite__mapDeps([37,1,2,31,32,33,34,35,36,38])),t),i=h(this.url);return u(i,await(this.queryAttachmentsSupported?r(i,e,t):o(i,e,t)))}async executeTopFeaturesQuery(e,t){const{executeTopFeaturesQuery:r}=await d(n(()=>import("./executeTopFeaturesQuery-9oGsFDn1.js"),__vite__mapDeps([39,1,2,40,31,32,33,34,35,36,28,41])),t);return r(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){const{executeForTopIds:r}=await d(n(()=>import("./executeForTopIds-CLsxKpmx.js"),__vite__mapDeps([42,1,2,40,31,32,33,34,35,36,41])),t);return r(this.parsedUrl,e,t)}async executeForTopExtents(e,t){const{executeForTopExtents:r}=await d(n(()=>import("./executeForTopExtents-BWFPmLVe.js"),__vite__mapDeps([43,1,2,40,31,32,33,34,35,36,41])),t);return r(this.parsedUrl,e,t)}async executeForTopCount(e,t){const{executeForTopCount:r}=await d(n(()=>import("./executeForTopCount-P_PtmMoE.js"),__vite__mapDeps([44,1,2,40,31,32,33,34,35,36,41])),t);return r(this.parsedUrl,e,t)}_normalizeQuery(e){let t=_.from(e);t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource?S.from(e.dynamicDataSource):this.dynamicDataSource);const{infoFor3D:r}=this;if(r!=null&&this._queryIs3DObjectFormat(e)){t=t===e?t.clone():t,t.formatOf3DObjects=null;const{supportedFormats:o,queryFormats:u}=r,i=f("model/gltf-binary",o)??y("glb",o),p=f("model/gltf+json",o)??y("gltf",o);for(const c of u){if(c===i){t.formatOf3DObjects=c;break}c!==p||t.formatOf3DObjects||(t.formatOf3DObjects=c)}if(!t.formatOf3DObjects)throw new P("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(t.outFields==null||!t.outFields.includes("*")){t=t===e?t.clone():t,t.outFields==null&&(t.outFields=[]);const{originX:c,originY:m,originZ:D,translationX:x,translationY:b,translationZ:F,scaleX:O,scaleY:g,scaleZ:E,rotationX:V,rotationY:R,rotationZ:I,rotationDeg:v}=r.transformFieldRoles;t.outFields.push(c,m,D,x,b,F,O,g,E,V,R,I,v)}}return t}_normalizeFields(e){if(this.fieldsIndex!=null&&e!=null)for(const t of e){const r=this.fieldsIndex.get(t.name);r&&Object.assign(t,r.toJSON())}}_queryIs3DObjectFormat(e){return this.infoFor3D!=null&&e.returnGeometry===!0&&e.multipatchOption!=="xyFootprint"&&!e.outStatistics}};a([l({type:S})],s.prototype,"dynamicDataSource",void 0),a([l()],s.prototype,"fieldsIndex",void 0),a([l()],s.prototype,"gdbVersion",void 0),a([l()],s.prototype,"infoFor3D",void 0),a([l({readOnly:!0})],s.prototype,"parsedUrl",null),a([l()],s.prototype,"pbfSupported",void 0),a([l()],s.prototype,"queryAttachmentsSupported",void 0),a([l()],s.prototype,"sourceSpatialReference",void 0),a([l({type:String})],s.prototype,"url",void 0),s=a([A("esri.tasks.QueryTask")],s);const K=s;export{K as x}; +import{aW as h,aX as _,aE as T,d as a,y as l,aQ as S,f as A,a7 as N,bW as w,E as Q,fy as d,_ as n,N as P}from"./index-BjUNJPVf.js";import{u as f,i as y}from"./infoFor3D-DsOdlPuA.js";import{n as j,s as q}from"./executeForIds-CZ3M8IZd.js";import{x as L}from"./query-Bk_ITqRK.js";import{a as J}from"./executeQueryJSON-COxi_Fac.js";import{n as z}from"./executeQueryPBF-DROgTCuZ.js";import{d as $}from"./FeatureSet-opEn8ou8.js";async function C(e,t,r){const o=h(e),u=await L(o,_.from(t),{...r}),i=u.data.extent;return!i||isNaN(i.xmin)||isNaN(i.ymin)||isNaN(i.xmax)||isNaN(i.ymax)?{count:u.data.count,extent:null}:{count:u.data.count,extent:T.fromJSON(i)}}let s=class extends N{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.queryAttachmentsSupported=!1,this.sourceSpatialReference=null,this.url=null}get parsedUrl(){return w(this.url)}async execute(e,t){const r=await this.executeJSON(e,t);return this.featureSetFromJSON(e,r,t)}async executeJSON(e,t){var c;const r=this._normalizeQuery(e),o=((c=e.outStatistics)==null?void 0:c[0])!=null,u=Q("featurelayer-pbf-statistics"),i=!o||u;let p;if(this.pbfSupported&&i)try{p=await z(this.url,r,t)}catch(m){if(m.name!=="query:parsing-pbf")throw m;this.pbfSupported=!1}return this.pbfSupported&&i||(p=await J(this.url,r,t)),this._normalizeFields(p.fields),p}async featureSetFromJSON(e,t,r){if(!this._queryIs3DObjectFormat(e)||this.infoFor3D==null||!t.features)return $.fromJSON(t);const{meshFeatureSetFromJSON:o}=await d(n(()=>import("./meshFeatureSet-BCixIf_6.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28])),r);return o(e,this.infoFor3D,t)}executeForCount(e,t){return j(this.url,this._normalizeQuery(e),t)}executeForExtent(e,t){return C(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return q(this.url,this._normalizeQuery(e),t)}async executeRelationshipQuery(e,t){const[{default:r},{executeRelationshipQuery:o}]=await d(Promise.all([n(()=>import("./RelationshipQuery-BDJrOxaX.js"),__vite__mapDeps([29,1,2])),n(()=>import("./executeRelationshipQuery-BRG4cb0K.js"),__vite__mapDeps([30,1,2,31,32,33,34,35,36,28,29]))]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),o(this.url,e,t)}async executeRelationshipQueryForCount(e,t){const[{default:r},{executeRelationshipQueryForCount:o}]=await d(Promise.all([n(()=>import("./RelationshipQuery-BDJrOxaX.js"),__vite__mapDeps([29,1,2])),n(()=>import("./executeRelationshipQuery-BRG4cb0K.js"),__vite__mapDeps([30,1,2,31,32,33,34,35,36,28,29]))]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),o(this.url,e,t)}async executeAttachmentQuery(e,t){const{executeAttachmentQuery:r,fetchAttachments:o,processAttachmentQueryResult:u}=await d(n(()=>import("./queryAttachments-DEPYJe-j.js"),__vite__mapDeps([37,1,2,31,32,33,34,35,36,38])),t),i=h(this.url);return u(i,await(this.queryAttachmentsSupported?r(i,e,t):o(i,e,t)))}async executeTopFeaturesQuery(e,t){const{executeTopFeaturesQuery:r}=await d(n(()=>import("./executeTopFeaturesQuery-DpUwEjEz.js"),__vite__mapDeps([39,1,2,40,31,32,33,34,35,36,28,41])),t);return r(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){const{executeForTopIds:r}=await d(n(()=>import("./executeForTopIds-B6SIZ04E.js"),__vite__mapDeps([42,1,2,40,31,32,33,34,35,36,41])),t);return r(this.parsedUrl,e,t)}async executeForTopExtents(e,t){const{executeForTopExtents:r}=await d(n(()=>import("./executeForTopExtents-C_oYktcC.js"),__vite__mapDeps([43,1,2,40,31,32,33,34,35,36,41])),t);return r(this.parsedUrl,e,t)}async executeForTopCount(e,t){const{executeForTopCount:r}=await d(n(()=>import("./executeForTopCount-DDGFKOhN.js"),__vite__mapDeps([44,1,2,40,31,32,33,34,35,36,41])),t);return r(this.parsedUrl,e,t)}_normalizeQuery(e){let t=_.from(e);t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource?S.from(e.dynamicDataSource):this.dynamicDataSource);const{infoFor3D:r}=this;if(r!=null&&this._queryIs3DObjectFormat(e)){t=t===e?t.clone():t,t.formatOf3DObjects=null;const{supportedFormats:o,queryFormats:u}=r,i=f("model/gltf-binary",o)??y("glb",o),p=f("model/gltf+json",o)??y("gltf",o);for(const c of u){if(c===i){t.formatOf3DObjects=c;break}c!==p||t.formatOf3DObjects||(t.formatOf3DObjects=c)}if(!t.formatOf3DObjects)throw new P("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(t.outFields==null||!t.outFields.includes("*")){t=t===e?t.clone():t,t.outFields==null&&(t.outFields=[]);const{originX:c,originY:m,originZ:D,translationX:x,translationY:b,translationZ:F,scaleX:O,scaleY:g,scaleZ:E,rotationX:V,rotationY:R,rotationZ:I,rotationDeg:v}=r.transformFieldRoles;t.outFields.push(c,m,D,x,b,F,O,g,E,V,R,I,v)}}return t}_normalizeFields(e){if(this.fieldsIndex!=null&&e!=null)for(const t of e){const r=this.fieldsIndex.get(t.name);r&&Object.assign(t,r.toJSON())}}_queryIs3DObjectFormat(e){return this.infoFor3D!=null&&e.returnGeometry===!0&&e.multipatchOption!=="xyFootprint"&&!e.outStatistics}};a([l({type:S})],s.prototype,"dynamicDataSource",void 0),a([l()],s.prototype,"fieldsIndex",void 0),a([l()],s.prototype,"gdbVersion",void 0),a([l()],s.prototype,"infoFor3D",void 0),a([l({readOnly:!0})],s.prototype,"parsedUrl",null),a([l()],s.prototype,"pbfSupported",void 0),a([l()],s.prototype,"queryAttachmentsSupported",void 0),a([l()],s.prototype,"sourceSpatialReference",void 0),a([l({type:String})],s.prototype,"url",void 0),s=a([A("esri.tasks.QueryTask")],s);const K=s;export{K as x}; diff --git a/assets/RasterSymbolizer-D7OwkKeP.js b/assets/RasterSymbolizer-BN7ge8gb.js similarity index 99% rename from assets/RasterSymbolizer-D7OwkKeP.js rename to assets/RasterSymbolizer-BN7ge8gb.js index f68fac7..40ad221 100644 --- a/assets/RasterSymbolizer-D7OwkKeP.js +++ b/assets/RasterSymbolizer-BN7ge8gb.js @@ -1,7 +1,7 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/lerc-wasm-IbDLBMkK.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css"] + __vite__mapDeps.viteFileDeps = ["assets/lerc-wasm-lV1hYBlU.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{ar as $t,N as pe,ib as ur,jj as cr,_ as hr,gZ as fr,ah as $e,d as D,y as B,f as Oe,aU as De,aZ as dr,aR as pr,aA as mr,aV as Q,aE as gt,aS as gr,aY as Vt,a2 as yr,kV as yt,kW as _e,kX as Ct,kY as Cr,a9 as bt,s as wt}from"./index-CEWggaxV.js";import{c as ut,u as ee,o as Se,i as br,j as qe,k as wr,n as vt,q as Re}from"./dataUtils-BFJflGP5.js";var Je,St,Tt,_t={exports:{}};St=_t,Je=function(){function e(){this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=null}return e.prototype={ensureBuffer:function(t){var r=this.buffer,o=r?r.byteLength:0;if(tu&&(o=u)}else{for(;!this.eof;)this.readBlock();o=this.bufferLength}return this.pos=o,this.buffer.subarray(r,o)},lookChar:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(t,r,o){for(var u=t+r;this.bufferLength<=u&&!this.eof;)this.readBlock();return new Stream(this.buffer,t,r,o)},skip:function(t){t||(t=1),this.pos+=t},reset:function(){this.pos=0}},e}(),(Tt=function(){if(!self||!self.Uint32Array)return null;var e=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),t=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),r=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),o=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],u=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];function i(n){throw new Error(n)}function f(n){var s=0,l=n[s++],a=n[s++];l!=-1&&a!=-1||i("Invalid header in flate stream"),(15&l)!=8&&i("Unknown compression method in flate stream"),((l<<8)+a)%31!=0&&i("Bad FCHECK in flate stream"),32&a&&i("FDICT bit set in flate stream"),this.bytes=n,this.bytesPos=s,this.codeSize=0,this.codeBuf=0,Je.call(this)}return f.prototype=Object.create(Je.prototype),f.prototype.getBits=function(n){for(var s,l=this.codeSize,a=this.codeBuf,c=this.bytes,d=this.bytesPos;l>n,this.codeSize=l-=n,this.bytesPos=d,s},f.prototype.getCode=function(n){for(var s=n[0],l=n[1],a=this.codeSize,c=this.codeBuf,d=this.bytes,C=this.bytesPos;a>16,h=65535&b;return(a==0||a>S,this.codeSize=a-S,this.bytesPos=C,h},f.prototype.generateHuffmanTable=function(n){for(var s=n.length,l=0,a=0;al&&(l=n[a]);for(var c=1<>=1;for(a=h;a0;)W[b++]=j}var s=this.getBits(3);if(1&s&&(this.eof=!0),(s>>=1)!=0){var l,a;if(s==1)l=o,a=u;else if(s==2){for(var c=this.getBits(5)+257,d=this.getBits(5)+1,C=this.getBits(4)+4,y=Array(e.length),b=0;b=w&&(w=(M=this.ensureBuffer(k+1)).length),M[k++]=v;else{if(v==256)return void(this.bufferLength=k);var I=(v=t[v-=257])>>16;I>0&&(I=this.getBits(I)),h=(65535&v)+I,v=this.getCode(a),(I=(v=r[v])>>16)>0&&(I=this.getBits(I));var T=(65535&v)+I;k+h>=w&&(w=(M=this.ensureBuffer(k+h)).length);for(var E=0;E{let a=null;f==="jpg"&&n&&(a=jt._getMask(t,{width:u,height:i}));const c=new Blob([new Uint8Array(t)],{type:"image/"+f=="jpg"?"jpeg":f}),d=URL.createObjectURL(c),C=new Image;let y;C.src=d,C.onload=()=>{if(URL.revokeObjectURL(d),ur(o))return void l(cr());u=C.width,i=C.height,this._canvas&&this._ctx?(this._canvas.width===u&&this._canvas.height===i||(this._canvas.width=u,this._canvas.height=i),this._ctx.clearRect(0,0,u,i)):(this._canvas=document.createElement("canvas"),this._canvas.width=u,this._canvas.height=i,this._ctx=this._canvas.getContext("2d")),this._ctx.drawImage(C,0,0);const b=this._ctx.getImageData(0,0,u,i);let S;if(y=b.data,r.renderOnCanvas){if(a)for(S=0;S{URL.revokeObjectURL(d),l("cannot load image")}})}static _getMask(t,r){let o=null;try{const u=new Uint8Array(t),i=Math.ceil(u.length/2);let f=0;const n=u.length-2;for(f=i;f=0;c--)o[l++]=s[a]>>c&1}}catch{}return o}};var kt,It,xt,zt={exports:{}};kt=zt,It=function(){var e=function(){function t(r){this.message="JPEG error: "+r}return t.prototype=new Error,t.prototype.name="JpegError",t.constructor=t,t}();return function(){if(!self||!self.Uint8ClampedArray)return null;var t=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),r=4017,o=799,u=3406,i=2276,f=1567,n=3784,s=5793,l=2896;function a(){this.decodeTransform=null,this.colorTransform=-1}function c(h,p){for(var m,g,w=0,k=[],v=16;v>0&&!h[v-1];)v--;k.push({children:[],index:0});var I,T=k[0];for(m=0;m0;)T=k.pop();for(T.index++,k.push(T);k.length<=m;)k.push(I={children:[],index:0}),T.children[T.index]=I.children,T=I;w++}m+10)return O--,P>>O&1;if((P=h[p++])===255){var U=h[p++];if(U)throw new e("unexpected marker "+(P<<8|U).toString(16))}return O=7,P>>>7}function N(U){for(var z=U;;){if(typeof(z=z[R()])=="number")return z;if(typeof z!="object")throw new e("invalid huffman sequence")}}function M(U){for(var z=0;U>0;)z=z<<1|R(),U--;return z}function _(U){if(U===1)return R()===1?1:-1;var z=M(U);return z>=1<>4;if(X!==0){var lr=t[re+=ne];U.blockData[z+lr]=_(X),re++}else{if(ne<15)break;re+=16}}}function L(U,z){var H=N(U.huffmanTableDC),Y=H===0?0:_(H)<0)$--;else for(var H=k,Y=v;H<=Y;){var re=N(U.huffmanTableAC),le=15&re,X=re>>4;if(le!==0){var ne=t[H+=X];U.blockData[z+ne]=_(le)*(1<>4,(H=15&Y)==0)X<15?($=M(X)+(1<=65488&&Ce<=65495))break;p+=2}return(se=S(h,p))&&se.invalid&&(console.log("decodeScan - unexpected Scan data, next marker is: "+se.invalid),p=se.offset),p-A}function y(h,p,m){var g,w,k,v,I,T,E,x,A,P,O,R,N,M,_,G,L,W=h.quantizationTable,$=h.blockData;if(!W)throw new e("missing required Quantization Table.");for(var F=0;F<64;F+=8)A=$[p+F],P=$[p+F+1],O=$[p+F+2],R=$[p+F+3],N=$[p+F+4],M=$[p+F+5],_=$[p+F+6],G=$[p+F+7],A*=W[F],P|O|R|N|M|_|G?(P*=W[F+1],O*=W[F+2],R*=W[F+3],N*=W[F+4],M*=W[F+5],_*=W[F+6],G*=W[F+7],w=(g=(g=s*A+128>>8)+(w=s*N+128>>8)+1>>1)-w,L=(k=O)*n+(v=_)*f+128>>8,k=k*f-v*n+128>>8,E=(I=(I=l*(P-G)+128>>8)+(E=M<<4)+1>>1)-E,T=(x=(x=l*(P+G)+128>>8)+(T=R<<4)+1>>1)-T,v=(g=g+(v=L)+1>>1)-v,k=(w=w+k+1>>1)-k,L=I*i+x*u+2048>>12,I=I*u-x*i+2048>>12,x=L,L=T*o+E*r+2048>>12,T=T*r-E*o+2048>>12,E=L,m[F]=g+x,m[F+7]=g-x,m[F+1]=w+E,m[F+6]=w-E,m[F+2]=k+T,m[F+5]=k-T,m[F+3]=v+I,m[F+4]=v-I):(L=s*A+512>>10,m[F]=L,m[F+1]=L,m[F+2]=L,m[F+3]=L,m[F+4]=L,m[F+5]=L,m[F+6]=L,m[F+7]=L);for(var j=0;j<8;++j)A=m[j],(P=m[j+8])|(O=m[j+16])|(R=m[j+24])|(N=m[j+32])|(M=m[j+40])|(_=m[j+48])|(G=m[j+56])?(w=(g=4112+((g=s*A+2048>>12)+(w=s*N+2048>>12)+1>>1))-w,L=(k=O)*n+(v=_)*f+2048>>12,k=k*f-v*n+2048>>12,v=L,E=(I=(I=l*(P-G)+2048>>12)+(E=M)+1>>1)-E,T=(x=(x=l*(P+G)+2048>>12)+(T=R)+1>>1)-T,L=I*i+x*u+2048>>12,I=I*u-x*i+2048>>12,x=L,L=T*o+E*r+2048>>12,T=T*r-E*o+2048>>12,A=(A=(g=g+v+1>>1)+x)<16?0:A>=4080?255:A>>4,P=(P=(w=w+k+1>>1)+(E=L))<16?0:P>=4080?255:P>>4,O=(O=(k=w-k)+T)<16?0:O>=4080?255:O>>4,R=(R=(v=g-v)+I)<16?0:R>=4080?255:R>>4,N=(N=v-I)<16?0:N>=4080?255:N>>4,M=(M=k-T)<16?0:M>=4080?255:M>>4,_=(_=w-E)<16?0:_>=4080?255:_>>4,G=(G=g-x)<16?0:G>=4080?255:G>>4,$[p+j]=A,$[p+j+8]=P,$[p+j+16]=O,$[p+j+24]=R,$[p+j+32]=N,$[p+j+40]=M,$[p+j+48]=_,$[p+j+56]=G):(L=(L=s*A+8192>>14)<-2040?0:L>=2024?255:L+2056>>4,$[p+j]=L,$[p+j+8]=L,$[p+j+16]=L,$[p+j+24]=L,$[p+j+32]=L,$[p+j+40]=L,$[p+j+48]=L,$[p+j+56]=L)}function b(h,p){for(var m=p.blocksPerLine,g=p.blocksPerColumn,w=new Int16Array(64),k=0;k=w)return null;var v=g(p);if(v>=65472&&v<=65534)return{invalid:null,marker:v,offset:p};for(var I=g(k);!(I>=65472&&I<=65534);){if(++k>=w)return null;I=g(k)}return{invalid:v.toString(16),marker:I,offset:k}}return a.prototype={parse:function(h){function p(){var U=h[v]<<8|h[v+1];return v+=2,U}function m(){var U=p(),z=v+U-2,H=S(h,z,v);H&&H.invalid&&(console.log("readDataBlock - incorrect length, next marker is: "+H.invalid),z=H.offset);var Y=h.subarray(v,z);return v+=Y.length,Y}function g(U){for(var z=Math.ceil(U.samplesPerLine/8/U.maxH),H=Math.ceil(U.scanLines/8/U.maxV),Y=0;Y>4){if(G>>4!=1)throw new e("DQT - invalid table spec");for(R=0;R<64;R++)L[t[R]]=p()}else for(R=0;R<64;R++)L[t[R]]=h[v++];E[15&G]=L}break;case 65472:case 65473:case 65474:if(w)throw new e("Only single frame JPEGs supported");p(),(w={}).extended=P===65473,w.progressive=P===65474,w.precision=h[v++],w.scanLines=p(),w.samplesPerLine=p(),w.components=[],w.componentIds={};var W,$=h[v++],F=0,j=0;for(O=0;O<$;O++){W=h[v];var J=h[v+1]>>4,oe=15&h[v+1];F>4?x:A)[15&ce]=c(ie,me)}break;case 65501:p(),k=p();break;case 65498:p();var q,Pe=h[v++],ge=[];for(O=0;O>4],q.huffmanTableAC=x[15&ye],ge.push(q)}var Ge=h[v++],Ne=h[v++],fe=h[v++],Be=C(h,v,w,ge,k,Ge,Ne,fe>>4,15&fe);v+=Be;break;case 65535:h[v]!==255&&v--;break;default:if(h[v-3]===255&&h[v-2]>=192&&h[v-2]<=254){v-=3;break}throw new e("unknown marker "+P.toString(16))}P=p()}for(this.width=w.samplesPerLine,this.height=w.scanLines,this.jfif=I,this.eof=v,this.adobe=T,this.components=[],O=0;O>8)+$[x+1];return G},_isColorConversionNeeded:function(){return this.adobe?!!this.adobe.transformCode:this.numComponents===3?this.colorTransform!==0:this.colorTransform===1},_convertYccToRgb:function(h){for(var p,m,g,w=0,k=h.length;w4)throw new e("Unsupported color mode");var g=this._getLinearizedBlockData(h,p);if(this.numComponents===1&&m){for(var w=g.length,k=new Uint8ClampedArray(3*w),v=0,I=0;I=0;b--)d[h++]=S[C]>>b&1}catch{}if(n===1&&l.length===i*f){const S=new Uint8Array(l.buffer);c=[S,S,S]}else{for(c=[],C=0;C<3;C++)c.push(new Uint8Array(a));for(b=0,y=0;yimport("./lerc-wasm-IbDLBMkK.js"),__vite__mapDeps([0,1,2])).then(e=>e.l).then(({default:e})=>e({locateFile:t=>fr(`esri/layers/support/rasterFormats/${t}`)})).then(e=>{kr(e)}),Ye)}const je={getBlobInfo:null,decode:null};function Tr(e){return 16+(e>>3<<3)}function de(e,t,r){r.set(e.slice(t,t+r.length))}function kr(e){const{_malloc:t,_free:r,_lerc_getBlobInfo:o,_lerc_getDataRanges:u,_lerc_decode_4D:i,asm:f}=e;let n;const s=Object.values(f).find(a=>a&&"buffer"in a&&a.buffer===e.HEAPU8.buffer),l=a=>{const c=a.map(b=>Tr(b)),d=c.reduce((b,S)=>b+S),C=t(d);n=new Uint8Array(s.buffer);let y=c[0];c[0]=C;for(let b=1;b{const C=new Uint8Array(48),y=new Uint8Array(8*3),[b,S,h]=l([a.length,C.length,y.length]);n.set(a,b),n.set(C,S),n.set(y,h);let p=o(b,a.length,S,h,12,3);if(p)throw r(b),new Error(`lerc-getBlobInfo: error code is ${p}`);n=new Uint8Array(s.buffer),de(n,S,C),de(n,h,y);const m=new Uint32Array(C.buffer),g=new Float64Array(y.buffer),[w,k,,v,I,T,E,x,A,P,O]=m,R={version:w,depthCount:P,width:v,height:I,validPixelCount:E,bandCount:T,blobSize:x,maskCount:A,dataType:k,minValue:g[0],maxValue:g[1],maxZerror:g[2],statistics:[],bandCountWithNoData:O};if(O&&P>1)return r(b),R;if(P===1&&T===1)return r(b),R.statistics.push({minValue:g[0],maxValue:g[1]}),R;const N=P*T*8,M=new Uint8Array(N),_=new Uint8Array(N);let G=b,L=0,W=0,$=!1;if(n.byteLength1){const Te=F.slice(oe*P,(oe+1)*P),ke=j.slice(oe*P,(oe+1)*P),ce=Math.min.apply(null,Te),ie=Math.max.apply(null,ke);J.push({minValue:ce,maxValue:ie,depthStats:{minValues:Te,maxValues:ke}})}else J.push({minValue:F[oe],maxValue:j[oe]});return r(G),$||r(L),R},je.decode=(a,c)=>{const{maskCount:d,depthCount:C,bandCount:y,width:b,height:S,dataType:h,bandCountWithNoData:p}=c,m=Ht[h],g=b*S,w=new Uint8Array(g*y),k=g*C*y*m.size,v=new Uint8Array(k),I=new Uint8Array(y),T=new Uint8Array(8*y),[E,x,A,P,O]=l([a.length,w.length,v.length,I.length,T.length]);n.set(a,E),n.set(w,x),n.set(v,A),n.set(I,P),n.set(T,O);const R=i(E,a.length,d,x,C,b,S,y,h,A,P,O);if(R)throw r(E),new Error(`lerc-decode: error code is ${R}`);n=new Uint8Array(s.buffer),de(n,A,v),de(n,x,w);let N=null;if(p){de(n,P,I),de(n,O,T),N=[];const M=new Float64Array(T.buffer);for(let _=0;_1){w.set(p[0]);for(let E=1;E=k;if(C>0&&v)for(let E=0;E1?p:null,{pixelType:T}=b;return{width:s,height:l,bandCount:a,pixelType:T,depthCount:c,statistics:y,pixels:h,mask:w,bandMasks:I,noDataValues:n}}function xr(e,t,r,o=!0){if(t%4!=0||r%4!=0){const u=new ArrayBuffer(4*Math.ceil(r/4)),i=new Uint8Array(u),f=new Uint8Array(e,t,r);if(o)for(let n=0;n=i)n-=i,d=c>>>32-i,c<<=i;else{d=c>>>32-n,c=u[a++];const h=i-n;n=32-h,d=(d<>>n),c<<=h}if(d===257)break;if(d===256){i=9,f=At(),s=f.length,l=[];continue}const S=f[d];if(S==null){if(d>f.length)throw new Error("data integrity issue: code does not exist on code page");l.push(l[0]),f[s++]=l.slice(),Et(b,l)}else Et(b,S),l.push(S[0]),l.length>1&&(f[s++]=l.slice()),l=S.slice();if(Ie.has(s)&&i++,n===0&&(c=u[a++],n=32),a>C||a===C&&n<=y)break}return new Uint8Array(b)}Ie.add(511),Ie.add(1023),Ie.add(2047),Ie.add(4095),Ie.add(8191);const Pt=(e,t)=>{const r=t.width*t.height,o=t.pixelType;return Math.floor(e.byteLength/(r*Jt(o)))},Jt=e=>{let t=1;switch(e){case Uint8Array:case Int8Array:t=1;break;case Uint16Array:case Int16Array:t=2;break;case Uint32Array:case Int32Array:case Float32Array:t=4;break;case Float64Array:t=8}return t},Ar=(e,t)=>{if(8*e.byteLength=0;n--)o[u++]=i>>n&1;for(n=7;u>n&1,n--;return o};let Er=class{static decode(t,r){const o=r.pixelType,u=[],i=r.width*r.height,f=Pt(t,r),{bandIds:n,format:s}=r,l=(n==null?void 0:n.length)||Pt(t,r),a=t.byteLength-t.byteLength%(i*Jt(o)),c=new o(t,0,i*f);let d,C,y,b,S=null;if(s==="bip")for(d=0;d>4,u<8?u=1:u===15?(u=4,i=(7&i)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++]):u===14?(u=3,i=(15&i)<<12|(63&e[r++])<<6|63&e[r++]):(u=2,i=(31&i)<<6|63&e[r++]),(i!==0||t)&&(o+=String.fromCharCode(i));return o}const ht=(()=>{const e=[];return e[254]="NEWSUBFILETYPE",e[255]="SUBFILETYPE",e[256]="IMAGEWIDTH",e[257]="IMAGELENGTH",e[258]="BITSPERSAMPLE",e[259]="COMPRESSION",e[262]="PHOTOMETRICINTERPRETATION",e[263]="THRESHHOLDING",e[264]="CELLWIDTH",e[265]="CELLLENGTH",e[266]="FILLORDER",e[269]="DOCUMENTNAME",e[270]="IMAGEDESCRIPTION",e[271]="MAKE",e[272]="MODEL",e[273]="STRIPOFFSETS",e[274]="ORIENTATION",e[277]="SAMPLESPERPIXEL",e[278]="ROWSPERSTRIP",e[279]="STRIPBYTECOUNTS",e[280]="MINSAMPLEVALUE",e[281]="MAXSAMPLEVALUE",e[282]="XRESOLUTION",e[283]="YRESOLUTION",e[284]="PLANARCONFIGURATION",e[285]="PAGENAME",e[286]="XPOSITION",e[287]="YPOSITION",e[288]="FREEOFFSETS",e[289]="FREEBYTECOUNTS",e[290]="GRAYRESPONSEUNIT",e[291]="GRAYRESPONSECURVE",e[292]="T4OPTIONS",e[293]="T6OPTIONS",e[296]="RESOLUTIONUNIT",e[297]="PAGENUMBER",e[300]="COLORRESPONSEUNIT",e[301]="TRANSFERFUNCTION",e[305]="SOFTWARE",e[306]="DATETIME",e[315]="ARTIST",e[316]="HOSTCOMPUTER",e[317]="PREDICTOR",e[318]="WHITEPOINT",e[319]="PRIMARYCHROMATICITIES",e[320]="COLORMAP",e[321]="HALFTONEHINTS",e[322]="TILEWIDTH",e[323]="TILELENGTH",e[324]="TILEOFFSETS",e[325]="TILEBYTECOUNTS",e[326]="BADFAXLINES",e[327]="CLEANFAXDATA",e[328]="CONSECUTIVEBADFAXLINES",e[330]="SUBIFD",e[332]="INKSET",e[333]="INKNAMES",e[334]="NUMBEROFINKS",e[336]="DOTRANGE",e[337]="TARGETPRINTER",e[338]="EXTRASAMPLES",e[339]="SAMPLEFORMAT",e[340]="SMINSAMPLEVALUE",e[341]="SMAXSAMPLEVALUE",e[342]="TRANSFERRANGE",e[347]="JPEGTABLES",e[512]="JPEGPROC",e[513]="JPEGIFOFFSET",e[514]="JPEGIFBYTECOUNT",e[515]="JPEGRESTARTINTERVAL",e[517]="JPEGLOSSLESSPREDICTORS",e[518]="JPEGPOINTTRANSFORM",e[519]="JPEGQTABLES",e[520]="JPEGDCTABLES",e[521]="JPEGACTABLES",e[529]="YCBCRCOEFFICIENTS",e[530]="YCBCRSUBSAMPLING",e[531]="YCBCRPOSITIONING",e[532]="REFERENCEBLACKWHITE",e[700]="XMP",e[33550]="GEOPIXELSCALE",e[33922]="GEOTIEPOINTS",e[33432]="COPYRIGHT",e[42112]="GDAL_METADATA",e[42113]="GDAL_NODATA",e[50844]="RPCCOEFFICIENT",e[34264]="GEOTRANSMATRIX",e[34735]="GEOKEYDIRECTORY",e[34736]="GEODOUBLEPARAMS",e[34737]="GEOASCIIPARAMS",e[34665]="EXIFIFD",e[34853]="GPSIFD",e[40965]="INTEROPERABILITYIFD",e})(),Rr=(()=>{const e=ht.slice();return e[36864]="ExifVersion",e[40960]="FlashpixVersion",e[40961]="ColorSpace",e[42240]="Gamma",e[37121]="ComponentsConfiguration",e[37122]="CompressedBitsPerPixel",e[40962]="PixelXDimension",e[40963]="PixelYDimension",e[37500]="MakerNote",e[37510]="UserComment",e[40964]="RelatedSoundFile",e[36867]="DateTimeOriginal",e[36868]="DateTimeDigitized",e[36880]="OffsetTime",e[36881]="OffsetTimeOriginal",e[36882]="OffsetTimeDigitized",e[37520]="SubSecTime",e[37521]="SubSecTimeOriginal",e[37522]="SubSecTimeDigitized",e[37888]="Temperature",e[37889]="Humidity",e[37890]="Pressure",e[37891]="WaterDepth",e[37892]="Acceleration",e[37893]="CameraElevationAngle",e[42016]="ImageUniqueID",e[42032]="CameraOwnerName",e[42033]="BodySerialNumber",e[42034]="LensSpecification",e[42035]="LensMake",e[42036]="LensModel",e[42037]="LensSerialNumber",e[33434]="ExposureTime",e[33437]="FNumber",e[34850]="ExposureProgram",e[34852]="SpectralSensitivity",e[34855]="PhotographicSensitivity",e[34856]="OECF",e[34864]="SensitivityType",e[34865]="StandardOutputSensitivity",e[34866]="RecommendedExposureIndex",e[34867]="ISOSpeed",e[34868]="ISOSpeedLatitudeyyy",e[34869]="ISOSpeedLatitudezzz",e[37377]="ShutterSpeedValue",e[37378]="ApertureValue",e[37379]="BrightnessValue",e[37380]="ExposureBiasValue",e[37381]="MaxApertureValue",e[37382]="SubjectDistance",e[37383]="MeteringMode",e[37384]="LightSource",e[37385]="Flash",e[37386]="FocalLength",e[37396]="SubjectArea",e[41483]="FlashEnergy",e[41484]="SpatialFrequencyResponse",e[41486]="FocalPlaneXResolution",e[41487]="FocalPlaneYResolution",e[41488]="FocalPlaneResolutionUnit",e[41492]="SubjectLocation",e[41493]="ExposureIndex",e[41495]="SensingMethod",e[41728]="FileSource",e[41729]="SceneType",e[41730]="CFAPattern",e[41985]="CustomRendered",e[41986]="ExposureMode",e[41987]="WhiteBalance",e[41988]="DigitalZoomRatio",e[41989]="FocalLengthIn35mmFilm",e[41990]="SceneCaptureType",e[41991]="GainControl",e[41992]="Contrast",e[41993]="Saturation",e[41994]="Sharpness",e[41995]="DeviceSettingDescription",e[41996]="SubjectDistanceRange",e})(),Mr=["GPSVersionID","GPSLatitudeRef","GPSLatitude","GPSLongitudeRef","GPSLongitude","GPSAltitudeRef","GPSAltitude","GPSTimeStamp","GPSSatellites","GPSStatus","GPSMeasureMode","GPSDOP","GPSSpeedRef","GPSSpeed","GPSTrackRef","GPSTrack","GPSImgDirectionRef","GPSImgDirection","GPSMapDatum","GPSDestLatitudeRef","GPSDestLatitude","GPSDestLongitudeRef","GPSDestLongitude","GPSDestBearingRef","GPSDestBearing","GPSDestDistanceRef","GPSDestDistance","GPSProcessingMethod","GPSAreaInformation","GPSDateStamp","GPSDifferential","GPSHPositioningError"],Lr=(()=>{const e=[];return e[1024]="GTModelTypeGeoKey",e[1025]="GTRasterTypeGeoKey",e[1026]="GTCitationGeoKey",e[2048]="GeographicTypeGeoKey",e[2049]="GeogCitationGeoKey",e[2050]="GeogGeodeticDatumGeoKey",e[2051]="GeogPrimeMeridianGeoKey",e[2052]="GeogLinearUnitsGeoKey",e[2053]="GeogLinearUnitSizeGeoKey",e[2054]="GeogAngularUnitsGeoKey",e[2055]="GeogAngularUnitSizeGeoKey",e[2056]="GeogEllipsoidGeoKey",e[2057]="GeogSemiMajorAxisGeoKey",e[2058]="GeogSemiMinorAxisGeoKey",e[2059]="GeogInvFlatteningGeoKey",e[2061]="GeogPrimeMeridianLongGeoKey",e[2060]="GeogAzimuthUnitsGeoKey",e[3072]="ProjectedCSTypeGeoKey",e[3073]="PCSCitationGeoKey",e[3074]="ProjectionGeoKey",e[3075]="ProjCoordTransGeoKey",e[3076]="ProjLinearUnitsGeoKey",e[3077]="ProjLinearUnitSizeGeoKey",e[3078]="ProjStdParallel1GeoKey",e[3079]="ProjStdParallel2GeoKey",e[3080]="ProjNatOriginLongGeoKey",e[3081]="ProjNatOriginLatGeoKey",e[3082]="ProjFalseEastingGeoKey",e[3083]="ProjFalseNorthingGeoKey",e[3084]="ProjFalseOriginLongGeoKey",e[3085]="ProjFalseOriginLatGeoKey",e[3086]="ProjFalseOriginEastingGeoKey",e[3087]="ProjFalseOriginNorthingGeoKey",e[3088]="ProjCenterLongGeoKey",e[3090]="ProjCenterEastingGeoKey",e[3091]="ProjCenterNorthingGeoKey",e[3092]="ProjScaleAtNatOriginGeoKey",e[3093]="ProjScaleAtCenterGeoKey",e[3094]="ProjAzimuthAngleGeoKey",e[3095]="ProjStraightVertPoleLongGeoKey",e[4096]="VerticalCSTypeGeoKey",e[4097]="VerticalCitationGeoKey",e[4098]="VerticalDatumGeoKey",e[4099]="VerticalUnitsGeoKey",e})(),Or=(e,t)=>{let r=(t||ht)[e];return r===void 0&&(r="unknown"+String(e)),r},et=new Map;et.set("EXIFIFD",Rr),et.set("GPSIFD",Mr);const Ae={tiffTags:ht,ifdTags:et,geoKeys:Lr,getTagName:Or},ft=(()=>{const e=new ArrayBuffer(4),t=new Uint8Array(e);return new Uint32Array(e)[0]=1,t[0]===1})(),Rt=[0,1,1,2,4,8,1,1,2,4,8,4,8,-1,-1,-1,8,8,8],Ee=4294967296,Dr=new Set([1,5,6,7,8,34712,34887]);function dt(e,t){let r="unknown";return e===3?r=t===64?"f64":"f32":e===1?t===1?r="u1":t===2?r="u2":t===4?r="u4":t<=8?r="u8":t<=16?r="u16":t<=32&&(r="u32"):e===2&&(t<=8?r="s8":t<=16?r="s16":t<=32&&(r="s32")),r}function ze(e){let t=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":t=Uint8Array;break;case"u16":t=Uint16Array;break;case"u32":t=Uint32Array;break;case"s8":t=Int8Array;break;case"s16":t=Int16Array;break;case"s32":t=Int32Array;break;case"f64":t=Float64Array;break;default:t=Float32Array}return t}function Ur(e,t){return{x:t[0]*e.x+t[1]*e.y+t[2],y:t[3]*e.x+t[4]*e.y+t[5]}}function Yt(e,t){var r;return(r=e.get(t))==null?void 0:r.values}function ve(e,t){var r;return(r=e.get(t))==null?void 0:r.values}function Mt(e,t){var r,o;return(o=(r=e.get(t))==null?void 0:r.values)==null?void 0:o[0]}function V(e,t){var r,o;return(o=(r=e.get(t))==null?void 0:r.values)==null?void 0:o[0]}function Xe(e,t,r,o=0,u=Ae.tiffTags,i=4){const f=i===8,n=f?mt(new DataView(e,r,8),0,t):new DataView(e,r,2).getUint16(0,t),s=4+2*i,l=f?8:2,a=l+n*s;if(r+a>e.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:a};const c=r+a+4<=e.byteLength?Ve(new DataView(e,r+a,i===8?8:4),0,t,i===8):null,d=r+l,C=new Map;let y,b,S,h,p,m=0,g=0;for(let w=0;wqt(e,{inputOffset:t}).pixels[0];function tt(e,t){if(t!==1&&t!==2&&t!==4)return e;const r=new Uint8Array(e),o=8/t,u=new Uint8Array(e.byteLength*o);let i=0;const f=2**t-1;for(let n=0;n>>8-t&f}return u.buffer}function rt(e,t,r){const o=new Wt;o.parse(e),o.colorTransform=r===6?-1:0;const u=o.getData(o.width,o.height,t!==1&&t!==4);return new Uint8Array(u.buffer)}function ot(e){const t=new Ue(e).getBytes(),r=new ArrayBuffer(t.length),o=new Uint8Array(r);return o.set(t),o}async function nt(e,t,r,o,u){const i=ft===t,f=V(r,"BITSPERSAMPLE"),n=V(r,"SAMPLESPERPIXEL")??1,s=V(r,"PHOTOMETRICINTERPRETATION"),l=V(r,"SAMPLEFORMAT")??1,a=dt(l,f),c=V(r,"COMPRESSION")??1,d=ze(a);let C,y,b;if(c===34887)return await Kt(),Gr(e,o);if(c===1)C=e.slice(o,o+u),y=new Uint8Array(C);else if(c===8||c===32946)y=new Uint8Array(e,o,u),y=ot(y),C=y.buffer;else if(c===6)y=new Uint8Array(e,o,u),y=rt(y,n,s),C=y.buffer;else if(c===7){const m=r.get("JPEGTABLES").values,g=m.length-2;y=new Uint8Array(g+u-2);for(let k=0;k1&&(c===5||c===8||c===32946)&&h&&p){const m=We(r),g=new d(b.length);g.set(b),b=Hr(g,p,h,l===3&&S===3,m?1:n)}return b}async function Nr(e,t,r){const o=ve(r,"TILEOFFSETS");if(o===void 0)return null;const u=ve(r,"TILEBYTECOUNTS"),{width:i,height:f,pixelType:n,tileWidth:s,tileHeight:l}=pt([r]),a=We(r,t),c=V(r,"SAMPLESPERPIXEL")||t.planes,d=i*f,C=V(r,"BITSPERSAMPLE"),y=(V(r,"COMPRESSION")??1)===34887,b=ze(n),S=[];for(let M=0;M1){const M=Math.round(o.length/c);for(h=0;h{const o=ft===t.littleEndian,u=ve(r,"STRIPOFFSETS");if(u===void 0)return null;const{width:i,height:f,pixelType:n}=pt([r]),s=V(r,"SAMPLESPERPIXEL")||t.planes,l=V(r,"PHOTOMETRICINTERPRETATION"),a=i*f,c=V(r,"BITSPERSAMPLE"),d=ze(n),C=new d(a*s),y=ve(r,"STRIPBYTECOUNTS"),b=V(r,"ROWSPERSTRIP"),S=V(r,"COMPRESSION")??1;let h,p,m,g,w,k,v,I,T,E=b;if(c%8==0)for(h=0;hf?f-h*b:b,n==="u8"||n==="s8"||o)S===8||S===32946?(v=new Uint8Array(e,u[h],y[h]),v=ot(v),k=v.buffer):S===6?(v=new Uint8Array(e,u[h],y[h]),v=rt(v,s,l),k=v.buffer):S===5?(v=ct(e,u[h],y[h],t.littleEndian),k=v.buffer):(y[h]!==E*i*s*c/8&&console.log("strip byte counts is different than expected"),k=e.slice(u[h],u[h]+y[h])),k=tt(k,c),g=new d(k);else{switch(S===6||S===8||S===32946?(v=new Uint8Array(e,u[h],y[h]),I=ot(v),k=I.buffer):(y[h]!==E*i*s*c/8&&console.log("strip byte counts is different than expected"),k=new ArrayBuffer(y[h]),v=new Uint8Array(e,u[h],y[h]),I=new Uint8Array(k)),n){case"u16":case"s16":for(m=0;m{if(!(e&&e.length>0&&t&&r))return null;let o,u,i;const f=e[0].length,n=e.length,s=new Uint8Array(f);for(let l=0;li?0:1;else for(let a=0;ai?0:1);return s},$r=e=>{if(!e)return null;const t=e.match(//gi);if(!t||t.length===0)return null;const r=new Map;let o,u,i,f,n;for(let h=0;h")),f=o.indexOf("sample="),f>-1&&(n=o.slice(f+8,o.indexOf('"',f+8))),f=o.indexOf("name="),f>-1&&(u=o.slice(f+6,o.indexOf('"',f+6))),u&&(i=o.slice(o.indexOf(">")+1,o.indexOf("")).trim(),n!=null?r.has(u)?r.get(u)[n]=i:r.set(u,[i]):r.set(u,i)),n=null;const s=r.get("STATISTICS_MINIMUM"),l=r.get("STATISTICS_MAXIMUM"),a=r.get("STATISTICS_MEAN"),c=r.get("STATISTICS_STDDEV");let d=null;if(s&&l){d=[];for(let h=0;hS&&d>(u?e.byteLength:e?e.byteLength-s+o:0))return r.offlineOffsetSize=[s,d],r.values=null,!1;if(C<=S){if(!t)if(S<=32)s>>>=32-C;else{const p=h!=null&&h.length?h[0]:s>>>0,m=h!=null&&h.length?h[1]:Math.round((s-p)/Ee);C<=32?(s=p>>>32-C,h[0]=s):(s=p*2**(32-C)+(m>>>32-C),h[0]=p,h[1]=m>>>32-C)}if(n===1&&c===S)l=[s];else if(S===64){const p=h!=null&&h.length?h[0]:s>>>0,m=h!=null&&h.length?h[1]:Math.round((s-p)/Ee);let g=p,w=32;for(b=1;b<=n;b++){const k=32-c*b%32;if(w>>32-w,I=m<<32-w>>>32-w;g=m,l.push(v+I*2**(c-w)),w-=32-(c-w)}else l.push(g<>>32-c),w-=c;w===0&&(w=32,g=m)}}else for(b=1;b<=n;b++){const p=32-c*b;l.push(s<

>>32-c)}}else{s-=o,u&&(s=0);for(let p=s;pparseFloat(G)),d.some(G=>isNaN(G))&&(d=null));const C=V(t,"COMPRESSION")??1;let y;switch(C){case 1:y="NONE";break;case 2:case 3:case 4:case 32771:y="CCITT";break;case 5:y="LZW";break;case 6:case 7:y="JPEG";break;case 32773:y="PACKBITS";break;case 8:case 32946:y="DEFLATE";break;case 34712:y="JPEG2000";break;case 34887:y="LERC";break;default:y=String(C)}let b=!0,S="";Dr.has(C)||(b=!1,S+="unsupported tag compression "+C),s>3&&(b=!1,S+="unsupported tag sampleFormat "+s),f!==1&&f!==2&&f!==4&&f%8!=0&&(b=!1,S+="unsupported tag bitsPerSample "+f);const h=Mt(t,"GEOASCIIPARAMS");let p;if(h){const G=h.split("|").find(W=>W.includes("ESRI PE String = ")),L=G?G.replace("ESRI PE String = ",""):"";p=L.startsWith("COMPD_CS")||L.startsWith("PROJCS")||L.startsWith("GEOGCS")?{wkid:null,wkt:L}:null}const m=ve(t,"GEOTIEPOINTS"),g=ve(t,"GEOPIXELSCALE"),w=ve(t,"GEOTRANSMATRIX"),k=t.has("GEOKEYDIRECTORY")?t.get("GEOKEYDIRECTORY").data:null;let v,I,T=!1,E=!1;if(k){T=V(k,"GTRasterTypeGeoKey")===2;const G=V(k,"GTModelTypeGeoKey");if(G===2){const L=V(k,"GeographicTypeGeoKey");L>=1024&&L<=32766&&(p={wkid:L}),p||L!==32767||(E=!0,p={wkid:4326})}else if(G===1){const L=V(k,"ProjectedCSTypeGeoKey");L>=1024&&L<=32766&&(p={wkid:L})}}if(g&&m&&m.length>=6?(v=[g[0],0,m[3]-m[0]*g[0],0,-Math.abs(g[1]),m[4]-m[1]*g[1]],T&&(v[2]-=.5*v[0]+.5*v[1],v[5]-=.5*v[3]+.5*v[4])):w&&w.length===16&&(v=T?[w[0],w[1],w[3]-.5*w[0],w[4],w[5],w[7]-.5*w[5]]:[w[0],w[1],w[3],w[4],w[5],w[7]]),v){const G=[{x:0,y:i},{x:0,y:0},{x:u,y:i},{x:u,y:0}];let L,W=Number.POSITIVE_INFINITY,$=Number.POSITIVE_INFINITY,F=Number.NEGATIVE_INFINITY,j=Number.NEGATIVE_INFINITY;for(let J=0;JW?W:L.x,F=L.x$?$:L.y,j=L.y400||Math.max(Math.abs(I.xmin),Math.abs(I.xmax))>361)&&(p=null,I.spatialReference=null);const x=Xt(e);let A,P,O,R,N;if(x.length>0){O=Math.round(Math.log(u/V(x[0],"IMAGEWIDTH"))/Math.LN2);const G=x[x.length-1];R=Math.round(Math.log(u/V(G,"IMAGEWIDTH"))/Math.LN2),A=V(G,"TILEWIDTH"),P=V(G,"TILELENGTH")}A=R!=null&&R>0?A||r:null,P=R!=null&&R>0?P||o:null,r&&(N=[{maxCol:Math.ceil(u/r)-1,maxRow:Math.ceil(i/o)-1,minRow:0,minCol:0}],x.forEach(G=>{N.push({maxCol:Math.ceil(V(G,"IMAGEWIDTH")/V(G,"TILEWIDTH"))-1,maxRow:Math.ceil(V(G,"IMAGELENGTH")/V(G,"TILELENGTH"))-1,minRow:0,minCol:0})}));const M=Mt(e[0],"GDAL_METADATA"),_=$r(M);return S+=" "+Qt({width:u,height:i,tileWidth:r,tileHeight:o,planes:n,ifds:e}),{width:u,height:i,tileWidth:r,tileHeight:o,planes:n,isBSQ:a,pixelType:l,compression:y,noData:d,hasMaskBand:Zt(e).length===x.length+1,isSupported:b,message:S,extent:I,isPseudoGeographic:E,affine:g?null:v,firstPyramidLevel:O,maximumPyramidLevel:R,pyramidBlockWidth:A,pyramidBlockHeight:P,tileBoundary:N,metadata:_}}function We(e,t){const r=Yt(e,"PLANARCONFIGURATION");return r?r[0]===2:!!t&&t.isBSQ}function Xt(e){return e.filter(t=>V(t,"NEWSUBFILETYPE")===1)}function Zt(e){return e.filter(t=>{const r=(4&(V(t,"NEWSUBFILETYPE")??0))==4,o=V(t,"PHOTOMETRICINTERPRETATION")===4;return r&&o})}function _r(e){const{littleEndian:t,isBigTiff:r,firstIFDPos:o}=zr(e);let u=o;const i=[];do{const f=Wr(e,t,u,0,Ae.tiffTags,r?8:4);if(!f.success)break;i.push(f.ifd),u=f.nextIFD}while(u>0);return{...pt(i),littleEndian:t,isBigTiff:r,ifds:i,pyramidIFDs:Xt(i),maskIFDs:Zt(i)}}function mt(e,t,r){const o=e.getUint32(t,r),u=e.getUint32(t+4,r);return r?u*Ee+o:o*Ee+u}function jr(e,t,r){let o=r?e.getInt32(t,r):e.getUint32(t,r),u=r?e.getUint32(t+4,r):e.getInt32(t+4,r);const i=(r?o:u)>=0?1:-1;return r?o*=i:u*=i,i*(r?u*Ee+o:o*Ee+u)}function Ve(e,t,r,o){return o?mt(e,t,r):e.getUint32(t,r)}function zr(e){const t=new DataView(e,0,16),r=t.getUint16(0,!1);let o=null;if(r===18761)o=!0;else{if(r!==19789)throw new Error("unexpected endianess byte");o=!1}const u=t.getUint16(2,o);if(u!==42&&u!==43)throw new Error("unexpected tiff identifier");let i=4;const f=u===43;if(f){const n=t.getUint16(i,o);if(i+=2,n!==8)throw new Error("unsupported bigtiff version");if(t.getUint16(i,o)!==0)throw new Error("unsupported bigtiff version");i+=2}return{littleEndian:o,isBigTiff:f,firstIFDPos:Ve(t,i,o,f)}}function Wr(e,t,r,o=0,u=Ae.tiffTags,i=4){const f=Xe(e,t,r,o,u,i);let n;const s=f.ifd;if(s){if(Ae.ifdTags.forEach((l,a)=>{s.has(a)&&(n=s.get(a),n.data=Xe(e,t,n.valueOffset-o,o,l).ifd)}),s.has("GEOKEYDIRECTORY")){n=s.get("GEOKEYDIRECTORY");const l=n.values;if(l&&l.length>4){const a=l[0]+"."+l[1]+"."+l[2];n.data=Xe(e,t,n.valueOffset+6-o,o,Ae.geoKeys,2).ifd,n.data&&n.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[a]})}}if(s.has("XMP")){n=s.get("XMP");const l=n.values;typeof l[0]=="number"&&n.type===7&&(n.values=[Pr(new Uint8Array(l))])}}return f}function Qt(e){const{width:t,height:r,tileHeight:o,tileWidth:u}=e,i=e.planes,f=u?u*o:t*r,n=V(e.ifds[0],"BITSPERSAMPLE");let s="";return f*i>2**30/(n>8?n/8:1)&&(s=u?"tiled tiff exceeding 1 gigabits per tile is not supported":"scanline tiff exceeding 1 gigabits is not supported"),s}function Hr(e,t,r,o,u){const i=o?4:1,f=r*i*u;o&&(e=new Uint8Array(e.buffer));for(let l=0;lT.min):null,v=w?w.map(T=>T.max):null,I={pixelType:l,width:d,height:C,pixels:h,noDataValue:g};return g!=null?ut(I,g):k&&v&&t.applyMinMaxConstraint&&(I.mask=Fr(h,k,v)),I}async function qr(e,t={}){const r=t.pyramidLevel||0,o=t.headerInfo||_r(e),{ifds:u,noData:i}=o;if(u.length===0)throw new Error("no valid image file directory");const f=Qt(o);if(f)throw f;let n=null;const s=r===-1?u[u.length-1]:u[r],l=i??t.noDataValue;return n=o.tileWidth?await Nr(e,o,s):Br(e,o,s),n&&(l!=null&&ut(n,l),n)}var Jr=function(e){var t,r,o,u,i,f;function n(s){var l,a,c,d,C,y,b,S,h,p,m,g,w;for(this.data=s,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},C=null;;){switch(l=this.readUInt32(),S=(function(){var k,v;for(v=[],k=0;k<4;++k)v.push(String.fromCharCode(this.data[this.pos++]));return v}).call(this).join(""),S){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(l);break;case"fcTL":C&&this.animation.frames.push(C),this.pos+=4,C={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},d=this.readUInt16(),c=this.readUInt16()||100,C.delay=1e3*d/c,C.disposeOp=this.data[this.pos++],C.blendOp=this.data[this.pos++],C.data=[];break;case"IDAT":case"fdAT":for(S==="fdAT"&&(this.pos+=4,l-=4),s=(C!=null?C.data:void 0)||this.imgData,m=0;0<=l?ml;0<=l?++m:--m)s.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(this.transparency.indexed=this.read(l),(h=255-this.transparency.indexed.length)>0)for(g=0;0<=h?gh;0<=h?++g:--g)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(l)[0];break;case 2:this.transparency.rgb=this.read(l)}break;case"tEXt":y=(p=this.read(l)).indexOf(0),b=String.fromCharCode.apply(String,p.slice(0,y)),this.text[b]=String.fromCharCode.apply(String,p.slice(y+1));break;case"IEND":return C&&this.animation.frames.push(C),this.colors=(function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}).call(this),this.hasAlphaChannel=(w=this.colorType)===4||w===6,a=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*a,this.colorSpace=(function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}).call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=l}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}return n.load=function(s,l,a){var c;return typeof l=="function"&&(a=l),(c=new XMLHttpRequest).open("GET",s,!0),c.responseType="arraybuffer",c.onload=function(){var d;return d=new n(new Uint8Array(c.response||c.mozResponseArrayBuffer)),typeof(l!=null?l.getContext:void 0)=="function"&&d.render(l),typeof a=="function"?a(d):void 0},c.send(null)},r=1,o=2,t=0,n.prototype.read=function(s){var l,a;for(a=[],l=0;0<=s?ls;0<=s?++l:--l)a.push(this.data[this.pos++]);return a},n.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},n.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},n.prototype.decodePixels=function(s){var l,a,c,d,C,y,b,S,h,p,m,g,w,k,v,I,T,E,x,A,P,O,R;if(s==null&&(s=this.imgData),s.length===0)return new Uint8Array(0);for(s=(s=new Ue(s)).getBytes(),I=(g=this.pixelBitlength/8)*this.width,w=new Uint8Array(I*this.height),y=s.length,v=0,k=0,a=0;k1&&a/dro(r,o,e);break;case"tiff":t=Zr;break;case"deflate":t=eo;break;case"lzw":t=to;break;case"error":t=()=>{throw new pe("rasterCodec:decode","input data contains error")};break;default:t=()=>{throw new pe("rasterCodec:decode","unsupported raster format")}}return t}function so(e){let t=null,r=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":r=255,t=Uint8Array;break;case"u16":r=r||65535,t=Uint16Array;break;case"u32":r=r||2**32-1,t=Uint32Array;break;case"s8":r=r||-128,t=Int8Array;break;case"s16":r=r||-32768,t=Int16Array;break;case"s32":r=r||0-2**31,t=Int32Array;break;default:t=Float32Array}return{pixelTypeCtor:t,noDataValue:r}}function lo(e,t=1){if(!e)return;const{pixels:r,width:o,height:u,mask:i}=e;if(!r||r.length===0)return;const f=r.length,n=o-1,s=u-1,l=[];let a,c,d,C,y,b,S=null;const h=ee.getPixelArrayConstructor(e.pixelType);if(t===0){for(a=0;a1){const s=f.map((c,d)=>u(e.slice(c,f[d+1]),t)),l=await Promise.all(s);i=l[0],i.pixels=l.map(c=>c.pixels[0]);const a=l.map(c=>c.mask);l.some(c=>c!=null)&&(a.forEach((c,d)=>{c==null&&(a[d]=new Uint8Array(i.width*i.height).fill(255))}),i.bandMasks=a,i.mask=ee.combineBandMasks(a)),i.updateStatistics()}else i=await u(e,{...t,offset:(f==null?void 0:f[0])??t.offset});return o!=="jpg"&&t.noDataValue!=null&&i.depthCount===1&&ut(i,t.noDataValue,{customFloatTolerance:t.tolerance}),t.isPoint&&lo(i),i}var it;function be(e){return e=Number(e),isNaN(e)?void 0:e}let ue=it=class extends De{constructor(){super(...arguments),this.name=null,this.minWavelength=void 0,this.maxWavelength=void 0,this.radianceBias=void 0,this.radianceGain=void 0,this.reflectanceBias=void 0,this.reflectanceGain=void 0,this.solarIrradiance=void 0}clone(){return new it({name:this.name,minWavelength:this.minWavelength,maxWavelength:this.maxWavelength,radianceBias:this.radianceBias,radianceGain:this.radianceGain,reflectanceBias:this.reflectanceBias,reflectanceGain:this.reflectanceGain,solarIrradiance:this.solarIrradiance})}};D([B({json:{name:"BandName",write:!0}})],ue.prototype,"name",void 0),D([B({json:{name:"WavelengthMin",read:{reader:be},write:!0}})],ue.prototype,"minWavelength",void 0),D([B({json:{name:"WavelengthMax",read:{reader:be},write:!0}})],ue.prototype,"maxWavelength",void 0),D([B({json:{name:"RadianceBias",read:{reader:be},write:!0}})],ue.prototype,"radianceBias",void 0),D([B({json:{name:"RadianceGain",read:{reader:be},write:!0}})],ue.prototype,"radianceGain",void 0),D([B({json:{name:"ReflectanceBias",read:{reader:be},write:!0}})],ue.prototype,"reflectanceBias",void 0),D([B({json:{name:"ReflectanceGain",read:{reader:be},write:!0}})],ue.prototype,"reflectanceGain",void 0),D([B({json:{name:"SolarIrradiance",read:{reader:be},write:!0}})],ue.prototype,"solarIrradiance",void 0),ue=it=D([Oe("esri.layers.support.RasterBandInfo")],ue);const Lt=ue;var at;function Me(e){return e=Number(e),isNaN(e)?void 0:e}let ae=at=class extends De{constructor(){super(...arguments),this.acquisitionDate=void 0,this.cloudCover=void 0,this.productName=void 0,this.sensorName=null,this.sensorAzimuth=void 0,this.sensorElevation=void 0,this.sunAzimuth=void 0,this.sunElevation=void 0}readAcquisitionDate(e){return new Date(e)}writeAcquisitionDate(e,t){t.AcquisitionDate=e.getTime()}clone(){return new at({acquisitionDate:this.acquisitionDate,cloudCover:this.cloudCover,productName:this.productName,sensorName:this.sensorName,sensorAzimuth:this.sensorAzimuth,sensorElevation:this.sensorElevation,sunAzimuth:this.sunAzimuth,sunElevation:this.sunElevation})}};D([B({json:{name:"AcquisitionDate",write:!0}})],ae.prototype,"acquisitionDate",void 0),D([dr("acquisitionDate")],ae.prototype,"readAcquisitionDate",null),D([pr("acquisitionDate")],ae.prototype,"writeAcquisitionDate",null),D([B({json:{name:"CloudCover",read:{reader:Me},write:!0}})],ae.prototype,"cloudCover",void 0),D([B({json:{name:"ProductName",write:!0}})],ae.prototype,"productName",void 0),D([B({json:{name:"SensorName",write:!0}})],ae.prototype,"sensorName",void 0),D([B({json:{name:"SensorAzimuth",read:{reader:Me},write:!0}})],ae.prototype,"sensorAzimuth",void 0),D([B({json:{name:"SensorElevation",read:{reader:Me},write:!0}})],ae.prototype,"sensorElevation",void 0),D([B({json:{name:"SunAzimuth",read:{reader:Me},write:!0}})],ae.prototype,"sunAzimuth",void 0),D([B({json:{name:"SunElevation",read:{reader:Me},write:!0}})],ae.prototype,"sunElevation",void 0),ae=at=D([Oe("esri.layers.support.RasterSensorInfo")],ae);const uo=ae;var st;let Z=st=class extends De{constructor(){super(...arguments),this.blockWidth=void 0,this.blockHeight=void 0,this.compression=null,this.origin=null,this.firstPyramidLevel=null,this.maximumPyramidLevel=null,this.pyramidScalingFactor=2,this.pyramidBlockWidth=null,this.pyramidBlockHeight=null,this.isVirtualTileInfo=!1,this.tileInfo=null,this.transposeInfo=null,this.blockBoundary=null}clone(){return new st({blockWidth:this.blockWidth,blockHeight:this.blockHeight,compression:this.compression,origin:Q(this.origin),firstPyramidLevel:this.firstPyramidLevel,maximumPyramidLevel:this.maximumPyramidLevel,pyramidResolutions:Q(this.pyramidResolutions),pyramidScalingFactor:this.pyramidScalingFactor,pyramidBlockWidth:this.pyramidBlockWidth,pyramidBlockHeight:this.pyramidBlockHeight,isVirtualTileInfo:this.isVirtualTileInfo,tileInfo:Q(this.tileInfo),transposeInfo:Q(this.transposeInfo),blockBoundary:Q(this.blockBoundary)})}};D([B({type:Number,json:{write:!0}})],Z.prototype,"blockWidth",void 0),D([B({type:Number,json:{write:!0}})],Z.prototype,"blockHeight",void 0),D([B({type:String,json:{write:!0}})],Z.prototype,"compression",void 0),D([B({type:mr,json:{write:!0}})],Z.prototype,"origin",void 0),D([B({type:Number,json:{write:!0}})],Z.prototype,"firstPyramidLevel",void 0),D([B({type:Number,json:{write:!0}})],Z.prototype,"maximumPyramidLevel",void 0),D([B({json:{write:!0}})],Z.prototype,"pyramidResolutions",void 0),D([B({type:Number,json:{write:!0}})],Z.prototype,"pyramidScalingFactor",void 0),D([B({type:Number,json:{write:!0}})],Z.prototype,"pyramidBlockWidth",void 0),D([B({type:Number,json:{write:!0}})],Z.prototype,"pyramidBlockHeight",void 0),D([B({type:Boolean,json:{write:!0}})],Z.prototype,"isVirtualTileInfo",void 0),D([B({json:{write:!0}})],Z.prototype,"tileInfo",void 0),D([B()],Z.prototype,"transposeInfo",void 0),D([B()],Z.prototype,"blockBoundary",void 0),Z=st=D([Oe("esri.layers.support.RasterStorageInfo")],Z);const co=Z;var lt;let K=lt=class extends De{constructor(e){super(e),this.attributeTable=null,this.bandCount=null,this.colormap=null,this.extent=null,this.format=void 0,this.height=null,this.width=null,this.histograms=null,this.keyProperties={},this.multidimensionalInfo=null,this.noDataValue=null,this.pixelSize=null,this.pixelType=null,this.isPseudoSpatialReference=!1,this.spatialReference=null,this.statistics=null,this.storageInfo=null,this.transform=null}get bandInfos(){const e=this.keyProperties.BandProperties,{bandCount:t}=this;if(!(e!=null&&e.length)||e.lengthLt.fromJSON(o));for(let o=0;o.001&&(d/=xe,C/=xe),f==="adjusted")if(n){const A=a*xe,P=c*xe;d=(l+A**u*i)/(8*A),C=(l+P**u*i)/(8*P)}else d=(l+a**u*i)/(8*a),C=(l+c**u*i)/(8*c);let y=(90-t)*Math.PI/180,b=Math.cos(y),S=(360-r+90)*Math.PI/180,h=Math.sin(y)*Math.cos(S),p=Math.sin(y)*Math.sin(S);const m=[315,270,225,360,180,0],g=[60,60,60,60,60,90],w=new Float32Array([3,5,3,2,1,4]),k=w.reduce((A,P)=>A+P),v=w.map(A=>A/k),I=o==="multi-directional"?m.length:1,T=new Float32Array(6),E=new Float32Array(6),x=new Float32Array(6);if(o==="multi-directional")for(let A=0;Ay?y:S],m=f[b],g=m*p,w=g*(1-Math.abs(h%2-1)),k=m-g;switch(Math.floor(h)){case 0:c[b]=g+k,d[b]=w+k,C[b]=k;break;case 1:c[b]=w+k,d[b]=g+k,C[b]=k;break;case 2:c[b]=k,d[b]=g+k,C[b]=w+k;break;case 3:c[b]=k,d[b]=w+k,C[b]=g+k;break;case 4:c[b]=w+k,d[b]=k,C[b]=g+k;break;case 5:case 6:c[b]=g+k,d[b]=k,C[b]=w+k}}e.pixels=[c,d,C],e.updateStatistics()}function _o(e,t){if(!Se(e))return e;const r=t.zFactor,o=t.pixelSizePower??1,u=t.pixelSizeFactor??1,i=t.slopeType,f=t.isGCS,{x:n,y:s}=t.resolution;let l=r/(8*n),a=r/(8*s);f&&Math.abs(r-1)<1e-4&&(l/=xe,a/=xe),i==="adjusted"&&(l=(r+n**o*u)/(8*n),a=(r+s**o*u)/(8*s));const{dzxs:c,dzys:d,outMask:C}=He(e),{width:y,height:b}=e,S=new Float32Array(y*b);for(let p=te;p360&&(h%=360)),a[d+C]=h}}}return Ke(a,s,l),new ee({width:s,height:l,pixels:[a],mask:n,pixelType:"f32",validPixelCount:e.validPixelCount,statistics:[{minValue:-1,maxValue:360}]})}function zo(e,t){if(!Se(e))return e;const{curvatures:r,outMask:o}=He(e,t),{width:u,height:i}=e;Ke(r,u,i);const f=new ee({width:u,height:i,pixels:[r],mask:o,pixelType:"f32",validPixelCount:e.validPixelCount});return f.updateStatistics(),f}const Wo=["random","ndvi","ndvi2","ndvi3","elevation","gray","hillshade"],or=[{id:"aspect",type:"multipart",colorRamps:[{fromColor:[190,190,190],toColor:[255,45,8]},{fromColor:[255,45,8],toColor:[255,181,61]},{fromColor:[255,181,61],toColor:[255,254,52]},{fromColor:[255,254,52],toColor:[0,251,50]},{fromColor:[0,251,50],toColor:[255,254,52]},{fromColor:[0,253,255],toColor:[0,181,255]},{fromColor:[0,181,255],toColor:[26,35,253]},{fromColor:[26,35,253],toColor:[255,57,251]},{fromColor:[255,57,251],toColor:[255,45,8]}]},{id:"black-to-white",fromColor:[0,0,0],toColor:[255,255,255]},{id:"blue-bright",fromColor:[204,204,255],toColor:[0,0,224]},{id:"blue-light-to-dark",fromColor:[211,229,232],toColor:[46,100,140]},{id:"blue-green-bright",fromColor:[203,245,234],toColor:[48,207,146]},{id:"blue-green-light-to-dark",fromColor:[216,242,237],toColor:[21,79,74]},{id:"brown-light-to-dark",fromColor:[240,236,170],toColor:[102,72,48]},{id:"brown-to-blue-green-diverging-right",type:"multipart",colorRamps:[{fromColor:[156,85,31],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[33,130,145]}]},{id:"brown-to-blue-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[110,70,45],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[48,100,102]}]},{id:"coefficient-bias",fromColor:[214,214,255],toColor:[0,57,148]},{id:"cold-to-hot-diverging",type:"multipart",colorRamps:[{fromColor:[69,117,181],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[214,47,39]}]},{id:"condition-number",type:"multipart",colorRamps:[{fromColor:[0,97,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,34,0]}]},{id:"cyan-to-purple",type:"multipart",colorRamps:[{fromColor:[0,245,245],toColor:[0,0,245]},{fromColor:[0,0,245],toColor:[245,0,245]}]},{id:"cyan-light-to-blue-dark",type:"multipart",colorRamps:[{fromColor:[182,237,240],toColor:[31,131,224]},{fromColor:[31,131,224],toColor:[9,9,145]}]},{id:"distance",fromColor:[255,200,0],toColor:[0,0,255]},{id:"elevation1",type:"multipart",colorRamps:[{fromColor:[175,240,233],toColor:[255,255,179]},{fromColor:[255,255,179],toColor:[0,128,64]},{fromColor:[0,128,64],toColor:[252,186,3]},{fromColor:[252,186,3],toColor:[128,0,0]},{fromColor:[120,0,0],toColor:[105,48,13]},{fromColor:[105,48,13],toColor:[171,171,171]},{fromColor:[171,171,171],toColor:[255,252,255]}]},{id:"elevation2",type:"multipart",colorRamps:[{fromColor:[118,219,211],toColor:[255,255,199]},{fromColor:[255,255,199],toColor:[255,255,128]},{fromColor:[255,255,128],toColor:[217,194,121]},{fromColor:[217,194,121],toColor:[135,96,38]},{fromColor:[135,96,38],toColor:[150,150,181]},{fromColor:[150,150,181],toColor:[181,150,181]},{fromColor:[181,150,181],toColor:[255,252,255]}]},{id:"errors",fromColor:[255,235,214],toColor:[196,10,10]},{id:"gray-light-to-dark",fromColor:[219,219,219],toColor:[69,69,69]},{id:"green-bright",fromColor:[204,255,204],toColor:[14,204,14]},{id:"green-light-to-dark",fromColor:[220,245,233],toColor:[34,102,51]},{id:"green-to-blue",type:"multipart",colorRamps:[{fromColor:[32,204,16],toColor:[0,242,242]},{fromColor:[0,242,242],toColor:[2,33,227]}]},{id:"orange-bright",fromColor:[255,235,204],toColor:[240,118,5]},{id:"orange-light-to-dark",fromColor:[250,233,212],toColor:[171,65,36]},{id:"partial-spectrum",type:"multipart",colorRamps:[{fromColor:[242,241,162],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]},{fromColor:[252,3,69],toColor:[176,7,237]},{fromColor:[176,7,237],toColor:[2,29,173]}]},{id:"partial-spectrum-1-diverging",type:"multipart",colorRamps:[{fromColor:[135,38,38],toColor:[240,149,12]},{fromColor:[240,149,12],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[74,80,181]},{fromColor:[74,80,181],toColor:[39,32,122]}]},{id:"partial-spectrum-2-diverging",type:"multipart",colorRamps:[{fromColor:[115,77,42],toColor:[201,137,52]},{fromColor:[201,137,52],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[91,63,176]},{fromColor:[91,63,176],toColor:[81,13,97]}]},{id:"pink-to-yellow-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[158,30,113],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[99,110,45]}]},{id:"pink-to-yellow-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[97,47,73],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[22,59,15]}]},{id:"precipitation",type:"multipart",colorRamps:[{fromColor:[194,82,60],toColor:[237,161,19]},{fromColor:[237,161,19],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,219,0]},{fromColor:[0,219,0],toColor:[32,153,143]},{fromColor:[32,153,143],toColor:[11,44,122]}]},{id:"prediction",type:"multipart",colorRamps:[{fromColor:[40,146,199],toColor:[250,250,100]},{fromColor:[250,250,100],toColor:[232,16,20]}]},{id:"purple-bright",fromColor:[255,204,255],toColor:[199,0,199]},{id:"purple-to-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[77,32,150],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[20,122,11]}]},{id:"purple-to-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[67,14,89],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[24,79,15]}]},{id:"purple-blue-bright",fromColor:[223,184,230],toColor:[112,12,242]},{id:"purple-blue-light-to-dark",fromColor:[229,213,242],toColor:[93,44,112]},{id:"purple-red-bright",fromColor:[255,204,225],toColor:[199,0,99]},{id:"purple-red-light-to-dark",fromColor:[250,215,246],toColor:[143,17,57]},{id:"red-bright",fromColor:[255,204,204],toColor:[219,0,0]},{id:"red-light-to-dark",fromColor:[255,224,224],toColor:[143,10,10]},{id:"red-to-blue-diverging-bright",type:"multipart",colorRamps:[{fromColor:[196,69,57],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[48,95,207]}]},{id:"red-to-blue-diverging-dark",type:"multipart",colorRamps:[{fromColor:[107,13,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[13,53,97]}]},{id:"red-to-green",type:"multipart",colorRamps:[{fromColor:[245,0,0],toColor:[245,245,0]},{fromColor:[245,245,0],toColor:[0,245,0]}]},{id:"red-to-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[186,20,20],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[54,145,33]}]},{id:"red-to-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[97,21,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[16,69,16]}]},{id:"slope",type:"multipart",colorRamps:[{fromColor:[56,168,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]},{id:"spectrum-full-bright",type:"multipart",colorRamps:[{fromColor:[255,0,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,0,255]}]},{id:"spectrum-full-dark",type:"multipart",colorRamps:[{fromColor:[153,0,0],toColor:[153,153,0]},{fromColor:[153,153,0],toColor:[0,153,153]},{fromColor:[0,153,153],toColor:[0,0,153]}]},{id:"spectrum-full-light",type:"multipart",colorRamps:[{fromColor:[255,153,153],toColor:[255,255,153]},{fromColor:[255,255,153],toColor:[153,255,255]},{fromColor:[153,255,255],toColor:[153,153,255]}]},{id:"surface",type:"multipart",colorRamps:[{fromColor:[112,153,89],toColor:[242,238,162]},{fromColor:[242,238,162],toColor:[242,206,133]},{fromColor:[242,206,133],toColor:[194,140,124]},{fromColor:[194,140,124],toColor:[255,242,255]}]},{id:"temperature",type:"multipart",colorRamps:[{fromColor:[255,252,255],toColor:[255,0,255]},{fromColor:[255,0,255],toColor:[0,0,255]},{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,255,0]},{fromColor:[0,255,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,128,0]},{fromColor:[255,128,0],toColor:[128,0,0]}]},{id:"white-to-black",fromColor:[255,255,255],toColor:[0,0,0]},{id:"yellow-to-dark-red",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[242,167,46]},{fromColor:[242,167,46],toColor:[107,0,0]}]},{id:"yellow-to-green-to-dark-blue",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[56,224,9]},{fromColor:[56,224,9],toColor:[26,147,171]},{fromColor:[26,147,171],toColor:[12,16,120]}]},{id:"yellow-to-red",fromColor:[245,245,0],toColor:[255,0,0]},{id:"yellow-green-bright",fromColor:[236,252,204],toColor:[157,204,16]},{id:"yellow-green-light-to-dark",fromColor:[215,240,175],toColor:[96,107,45]}],mo=new Vt({Aspect:"aspect","Black to White":"black-to-white","Blue Bright":"blue-bright","Blue Light to Dark":"blue-light-to-dark","Blue-Green Bright":"blue-green-bright","Blue-Green Light to Dark":"blue-green-light-to-dark","Brown Light to Dark":"brown-light-to-dark","Brown to Blue Green Diverging, Bright":"brown-to-blue-green-diverging-right","Brown to Blue Green Diverging, Dark":"brown-to-blue-green-diverging-dark","Coefficient Bias":"coefficient-bias","Cold to Hot Diverging":"cold-to-hot-diverging","Condition Number":"condition-number","Cyan to Purple":"cyan-to-purple","Cyan-Light to Blue-Dark":"cyan-light-to-blue-dark",Distance:"distance","Elevation #1":"elevation1","Elevation #2":"elevation2",Errors:"errors","Gray Light to Dark":"gray-light-to-dark","Green Bright":"green-bright","Green Light to Dark":"green-light-to-dark","Green to Blue":"green-to-blue","Orange Bright":"orange-bright","Orange Light to Dark":"orange-light-to-dark","Partial Spectrum":"partial-spectrum","Partial Spectrum 1 Diverging":"partial-spectrum-1-diverging","Partial Spectrum 2 Diverging":"partial-spectrum-2-diverging","Pink to YellowGreen Diverging, Bright":"pink-to-yellow-green-diverging-bright","Pink to YellowGreen Diverging, Dark":"pink-to-yellow-green-diverging-dark",Precipitation:"precipitation",Prediction:"prediction","Purple Bright":"purple-bright","Purple to Green Diverging, Bright":"purple-to-green-diverging-bright","Purple to Green Diverging, Dark":"purple-to-green-diverging-dark","Purple-Blue Bright":"purple-blue-bright","Purple-Blue Light to Dark":"purple-blue-light-to-dark","Purple-Red Bright":"purple-red-bright","Purple-Red Light to Dark":"purple-red-light-to-dark","Red Bright":"red-bright","Red Light to Dark":"red-light-to-dark","Red to Blue Diverging, Bright":"red-to-blue-diverging-bright","Red to Blue Diverging, Dark":"red-to-blue-diverging-dark","Red to Green":"red-to-green","Red to Green Diverging, Bright":"red-to-green-diverging-bright","Red to Green Diverging, Dark":"red-to-green-diverging-dark",Slope:"slope","Spectrum-Full Bright":"spectrum-full-bright","Spectrum-Full Dark":"spectrum-full-dark","Spectrum-Full Light":"spectrum-full-light",Surface:"surface",Temperature:"temperature","White to Black":"white-to-black","Yellow to Dark Red":"yellow-to-dark-red","Yellow to Green to Dark Blue":"yellow-to-green-to-dark-blue","Yellow to Red":"yellow-to-red","Yellow-Green Bright":"yellow-green-bright","Yellow-Green Light to Dark":"yellow-green-light-to-dark"});function Fe(e,t){if(!e||!t||e.length!==t.length)return!1;for(let r=0;rt[r]+2||e[r]Ot(o))),r}return Ot(e)}function Dt(e,t){if(!e)return;const r=t??or;let o=null;return e.type==="algorithmic"?r.some(u=>{if(Fe(e.fromColor.toRgb(),u.fromColor)&&Fe(e.toColor.toRgb(),u.toColor))return o=u.id,!0}):e.type==="multipart"&&r.some(u=>{const i=e.colorRamps,f=u.colorRamps;if(i&&f&&i.length===f.length&&!f.some((n,s)=>{if(!Fe(i[s].fromColor.toRgb(),new bt(n.fromColor).toRgb())||!Fe(i[s].toColor.toRgb(),new bt(n.toColor).toRgb()))return!0})){if(o)return!0;o=u.id}}),o}function yo(e,t,r=!1){if(!e)return;let o=!1,u=Dt(e,t);return u!=null||r||(o=!0,u=Dt(e=go(e),t)),u?{id:u,inverted:o}:void 0}function Co(e,t=!1){var o;const r=typeof e=="string"?e:(o=yo(e,void 0,t))==null?void 0:o.id;return r?mo.toJSON(r):null}function Ho(e,t="esriCIELabAlgorithm"){const r=or.find(({id:o})=>o===e);return r?r.colorRamps?{type:"multipart",colorRamps:r.colorRamps.map(o=>({type:"algorithmic",algorithm:t,fromColor:[...o.fromColor],toColor:[...o.toColor]}))}:{type:"algorithmic",algorithm:t,fromColor:[...r.fromColor],toColor:[...r.toColor]}:null}function nr(e){const t=(e=e||{}).numColors||256,r=e.distanceOffset||0,o=e.isCustomInterval!=null?e.isCustomInterval:e.distanceInterval!==null&&e.distanceInterval!==1/(t-1),u=e.distanceInterval||1/(t-1);return{...e,numColors:t,distanceOffset:r,interpolateAlpha:!!e.interpolateAlpha,distanceInterval:u,isCustomInterval:o,weights:e.weights}}function bo(e,t,r){const{numColors:o,distanceOffset:u,distanceInterval:i,isCustomInterval:f}=r,n=e.s===0,s=t.s===0;let l=e.h,a=t.h;n&&!s?l=a:s&&!n&&(t={...t,h:l},a=l);let c,d=Math.abs(a-l);const C=360;da?d*i:-d*i);const y=(t.s-e.s)*i,b=(t.v-e.v)*i;let{s:S,v:h}=e,p=l;if(u){const g=u/i;p=(p+g*c+C)%C,S+=g*y,h+=g*b}const m=[];for(let g=0;gd+C);u=u.map(d=>d/c)}else{u=[];for(let c=0;c{u.unshift(i),o||u.pop()}),r}function Gt(e){const t=_e(e);return{type:"HsvColor",Hue:t.h,Saturation:t.s,Value:t.v,AlphaValue:255}}function Nt(e){const t=e.toJSON();return{Algorithm:(t==null?void 0:t.Algorithm)||"esriHSVAlgorithm",type:"AlgorithmicColorRamp",FromColor:Gt(e.fromColor),ToColor:Gt(e.toColor)}}function Ko(e){const t=Co(e);if(!t)return null;if(e.type==="algorithmic")return{...Nt(e),Name:t};if(e.colorRamps){const r=e.colorRamps.map(Nt);return{type:"MultiPartColorRamp",NumColorRamps:r.length,ArrayOfColorRamp:r,Name:t}}return null}function qo(e){const t=e.reverse().map(r=>{const o=r.toString(16);return o.length<2?"0"+o:o});return 4294967295&Number.parseInt(t.join(""),16)}const Jo=new Vt({none:"none",standardDeviation:"standard-deviation",histogramEqualization:"histogram-equalization",minMax:"min-max",percentClip:"percent-clip",sigmoid:"sigmoid"}),ko={0:"none",3:"standardDeviation",4:"histogramEqualization",5:"minMax",6:"percentClip",9:"sigmoid"},Ze=1,Io=[.299,.587,.114];function ar(e,t=256){t=Math.min(t,256);const{size:r,counts:o}=e,u=new Uint8Array(r),i=o.reduce((a,c)=>a+c/t,0);let f=0,n=0,s=0,l=i;for(let a=0;a=s){const w=sr(s,o);for(l=0;l1&&(m-=(1/b)**(S*w[l])),pt[l]){const k=m*b*S**(1/o[l])+f;g[a]=i==="floor"?Math.floor(k):i==="round"?Math.round(k):k}else p>=r[l]?g[a]=n:g[a]=f;else g[a]=f;h[l]=g}}else for(l=0;l=r[l])g[a]=n;else{const w=(p-t[l])*C[l]+f;g[a]=i==="floor"?Math.floor(w):i==="round"?Math.round(w):w}h[l]=g}if(e.contrastOffset!=null){const w=xo(e.contrastOffset,e.brightnessOffset);for(l=0;l0&&r<100?n=(200*f-100*u+2*u*o)/(2*(100-r))+i:r<=0&&r>-100?n=(200*f-100*u+2*u*o)*(100+r)/2e4+i:r===100?(n=200*f-100*u+(u+1)*(100-r)+2*u*o,n=n>0?u:0):r===-100&&(n=i),s[f]=n>u?u:n<0?0:n;return s}function Ao(e,t,r){const o=[];for(let u=0;u=255)return Ze;let t=0;e!==150&&(t=e<=150?45*Math.cos(.01047*e):17*Math.sin(.021*e));const r=255,o=e+t,u=Math.log(e/r),i=Math.log(o/r);if(i===0)return Ze;const f=u/i;return isNaN(f)?Ze:Math.min(9.9,Math.max(.01,f))}function Po(e,t,r,o){let u=1/0,i=-1/0,f=0,n=0,s=0,l=0;const a=e.length,c=new Map,d=[];for(let v=0;vl&&(l=T,s=I),u=Ii?I:i,f+=I,n++}}if(n===0)return{statistics:{min:0,max:0,avg:0,stddev:0,mode:0,median:0},histogram:null};const C=f/n;let y=0;for(let v=0;vv).length:a,S=b<=1?0:Math.sqrt(y/(b-1));d.sort((v,I)=>v-I);const h=n>>>1,p={min:u,max:i,avg:C,stddev:S,mode:s,median:n%2?d[Math.floor(h)]:(d[h-1]+d[h])/2};if(!o)return{statistics:p,histogram:null};if(["u8","s8","u4","u2","u1"].includes(r)){const v=i-u+1,I=new Uint32Array(v);for(let T=0;TPo(f,(u==null?void 0:u[n])??r,o,!0));return{statistics:i.map(({statistics:f})=>f),histograms:i.map(({histogram:f})=>f)}}function Ro(e){var y;if(!((y=e==null?void 0:e.pixels)!=null&&y.length))return null;const{pixels:t,mask:r,bandMasks:o,pixelType:u}=e,i=e.width*e.height,f=t.length,n=[],s=[],l=256;let a,c,d,C;for(let b=0;bc?P:c,d[P]++}}else for(let A=0;Ac?P:c,d[P]++}d=d.slice(a,c+1)}else{let A=!1;e.statistics||(e.updateStatistics(),A=!0);const P=e.statistics;a=P[b].minValue,c=P[b].maxValue;const O=(c-a)/l;if(O===0){!P||e.validPixelCount||A||e.updateStatistics();const R=(e.validPixelCount||e.width*e.height)/l;for(let N=0;N[x.minValue,x.maxValue,0,0]);else{const x=Ro(r);f=x!=null?x.statistics:null,n=x!=null?x.histograms:null}else f=(E=e.statistics)!=null&&E.length?e.statistics:i.statistics,n="histograms"in e?e.histograms:void 0,n||(n=i.histograms);s!=="percentClip"&&s!=="histogramEqualization"||n!=null&&n.length||(s="minMax");const l=(f==null?void 0:f.length)||(n==null?void 0:n.length)||i.bandCount,a=[],c=[];let d,C,y,b,S,h,p,m,g;f&&!Array.isArray(f[0])&&(f=f.map(x=>[x.min,x.max,x.avg,x.stddev]));const[w,k]=br(i.pixelType);if(!(f!=null&&f.length)){for(f=[],m=0;mA[1]&&(c[m]=A[1])}}break;case"histogramEqualization":for($e(n),m=0;m=20&&(b[0]=b[1]=b[2]=b[b.length-1]=b[b.length-2]=0),y=0,C=(d.max-d.min)/d.size,p=d.min===-.5&&C===1?.5:0,g=0;gh){a[m]=d.min+C*(g+p);break}for(h=(1-(e.maxPercent||0)/100)*y,c[m]=d.max+p,g=d.size-2;g>=0;g--)if(S[g]ar(x)))):(I=e.max||255,v=e.min||0),Mo({minCutOff:a,maxCutOff:c,outMax:I,outMin:v,histogramLut:T},o)}function Mo(e,t){if(t==null||t.length===0)return e;const r=Math.max.apply(null,t),{minCutOff:o,maxCutOff:u,outMin:i,outMax:f,histogramLut:n}=e;return o.length===t.length||o.length<=r?e:{minCutOff:t.map(s=>o[s]),maxCutOff:t.map(s=>u[s]),histogramLut:n?t.map(s=>n[s]):null,outMin:i,outMax:f}}function sr(e,t){const r=new Float32Array(e);for(let o=0;o1?t[o]>2?r[o]=6.5+(t[o]-2)**2.5:r[o]=6.5+100*(2-t[o])**4:r[o]=1;return r}function Qe(e,t){var v;if(!((v=e==null?void 0:e.pixels)!=null&&v.length))return e;const{mask:r,bandMasks:o,width:u,height:i,pixels:f}=e,{minCutOff:n,maxCutOff:s,gamma:l}=t,a=t.outMin||0,c=t.outMax||255,d=u*i,C=t.outputPixelType||"u8",y=e.pixels.map(()=>ee.createEmptyBand(C,d)),b=y.length,S=c-a,h=[],p=[];for(let I=0;I=b,w=!!t.isRenderer;if(g){const I=sr(b,l);for(let T=0;T1&&(O-=(1/S)**(P*I[T])),An[T]){const R=O*S*P**(1/l[T])+a;y[T][x]=w?Math.floor(R):m?Math.round(R):R}else A>=s[T]?y[T][x]=c:y[T][x]=a}}}else for(let I=0;In[I]){const A=(x-n[I])*h[I]+a;y[I][E]=w?Math.floor(A):m?Math.round(A):A}else x>=s[I]?y[I][E]=c:y[I][E]=a}}const k=new ee({width:u,height:i,mask:r,bandMasks:o,pixels:y,pixelType:C});return k.updateStatistics(),k}function Lo(e){var t,r,o;return["u8","s8"].includes(e.pixelType)&&((r=(t=e.statistics)==null?void 0:t[0])==null?void 0:r.min)!=null&&((o=e.statistics[0])==null?void 0:o.max)!=null&&e.bandCount===1}function Oo(e,t){const{attributeTable:r,bandCount:o}=e;return r==null&&Lo(e)?!0:!(r==null||o>1||t&&r.fields.find(u=>u.name.toLowerCase()===t.toLowerCase())==null)}function Do(e){const{bandCount:t,dataType:r,pixelType:o}=e;return r==="elevation"||r==="generic"&&t===1&&(o==="s16"||o==="s32"||o==="f32"||o==="f64")}function Uo(e,t=!1){const{bandCount:r,colormap:o,pixelType:u}=e;return r===1&&(!!(o!=null&&o.length)||!t&&u==="u8")}function Zo(e,t=!1){const{attributeTable:r,bandCount:o}=e;return o===1&&(!t||r!=null||e.histograms!=null)}function Qo(e){const{dataType:t}=e;return t==="vector-uv"||t==="vector-magdir"}function en(e){const{dataType:t}=e;return t==="vector-uv"||t==="vector-magdir"}let we=class extends De{constructor(e){super(e)}bind(){const{rendererJSON:e}=this;if(!e)return{success:!1};let t;switch(this.lookup={rendererJSON:{}},e.type){case"uniqueValue":t=this._updateUVRenderer(e);break;case"rasterColormap":t=this._updateColormapRenderer(e);break;case"rasterStretch":t=this._updateStretchRenderer(e);break;case"classBreaks":t=this._updateClassBreaksRenderer(e);break;case"rasterShadedRelief":t=this._updateShadedReliefRenderer(e);break;case"vectorField":t=this._updateVectorFieldRenderer();break;case"flowRenderer":t=this._updateFlowRenderer()}return t}symbolize(e){let t=e==null?void 0:e.pixelBlock;if(!Ft(t))return t;if(e.simpleStretchParams&&this.rendererJSON.type==="rasterStretch")return this.simpleStretch(t,e.simpleStretchParams);try{let r;switch(t.pixels.length>3&&(t=t.extractBands(e.bandIds??[0,1,2])),this.rendererJSON.type){case"uniqueValue":case"rasterColormap":r=this._symbolizeColormap(t);break;case"classBreaks":r=this._symbolizeClassBreaks(t);break;case"rasterStretch":r=this._symbolizeStretch(t,e.bandIds);break;case"rasterShadedRelief":{const o=e.extent,u=o.spatialReference.isGeographic,i={x:(o.xmax-o.xmin)/t.width,y:(o.ymax-o.ymin)/t.height};r=this._symbolizeShadedRelief(t,{isGCS:u,resolution:i});break}}return r}catch(r){return wt.getLogger(this).error("symbolize",r.message),t}}simpleStretch(e,t){if(!Ft(e))return e;try{return e.pixels.length>3&&(e=e.extractBands([0,1,2])),Qe(e,{...t,isRenderer:!0})}catch(r){return wt.getLogger(this).error("symbolize",r.message),e}}generateWebGLParameters(e){if(["uniqueValue","rasterColormap","classBreaks"].includes(this.rendererJSON.type)){const{indexedColormap:f,offset:n}=this.lookup.colormapLut||{};return{colormap:f,colormapOffset:n,type:"lut"}}const{pixelBlock:t,isGCS:r,resolution:o,bandIds:u}=e,{rendererJSON:i}=this;return i.type==="rasterStretch"?this._generateStretchWebGLParams(t,i,u):i.type==="rasterShadedRelief"?this._generateShadedReliefWebGLParams(i,r,o??void 0):i.type==="vectorField"?this._generateVectorFieldWebGLParams(i):null}_isLUTChanged(e){if(!this.lookup||!this.lookup.rendererJSON)return!0;if("colorRamp"in this.rendererJSON){const t=this.rendererJSON.colorRamp;return e?JSON.stringify(t)!==JSON.stringify(this.lookup.rendererJSON.colorRamp):(this.rendererJSON,this.lookup.rendererJSON,JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON))}return JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON)}_symbolizeColormap(e){return this._isLUTChanged()&&!this.bind().success?e:qe(e,this.lookup.colormapLut)}_symbolizeClassBreaks(e){const{canUseIndexedLUT:t}=this._analyzeClassBreaks(this.rendererJSON);return this._isLUTChanged()&&!this.bind().success?e:t?qe(e,this.lookup.colormapLut):wr(e,this.lookup.remapLut??[])}_symbolizeStretch(e,t){var c,d;const{rasterInfo:r}=this,{pixelType:o,bandCount:u}=r,i=this.rendererJSON,f=["u8","u16","s8","s16"].includes(o);let n,s;const{dra:l}=i,{gamma:a}=this.lookup;if(i.stretchType==="histogramEqualization"){const C=l?null:(c=this.lookup)==null?void 0:c.histogramLut,y=Le(i,{rasterInfo:r,pixelBlock:e,bandIds:t,returnHistogramLut:!C}),b=Qe(e,{...y,gamma:a,isRenderer:!0});s=vt(b,{lut:l?y.histogramLut:C,offset:0})}else if(f){if(l){const C=Le(i,{rasterInfo:r,pixelBlock:e,bandIds:t});n=Bt({pixelType:o,...C,gamma:a,rounding:"floor"})}else if(this._isLUTChanged()){if(!this.bind().success)return e;n=this.lookup?this.lookup.stretchLut:null}else n=this.lookup?this.lookup.stretchLut:null;if(!n)return e;u>1&&t!=null&&t.length===(e==null?void 0:e.pixels.length)&&(n==null?void 0:n.lut.length)===u&&(n={lut:t.map(C=>n.lut[C]),offset:n.offset}),s=vt(e,n)}else{const C=Le(i,{rasterInfo:r,pixelBlock:e,bandIds:t});s=Qe(e,{...C,gamma:a,isRenderer:!0})}if(i.colorRamp){if(this._isLUTChanged(!0)&&!this.bind().success)return e;s=qe(s,(d=this.lookup)==null?void 0:d.colormapLut)}return s}_symbolizeShadedRelief(e,t){var n;const r=this.rendererJSON,o={...r,...t},u=fo(e,o);if(!r.colorRamp)return u;let i;if(this._isLUTChanged(!0)){if(!this.bind().success)return u;i=this.lookup?this.lookup.hsvMap:null}else i=this.lookup?this.lookup.hsvMap:null;if(!i)return u;const f=((n=this.rasterInfo.statistics)==null?void 0:n[0])??{min:0,max:8e3};return po(u,e,i,f),u}_isVectorFieldData(){const{bandCount:e,dataType:t}=this.rasterInfo;return e===2&&(t==="vector-magdir"||t==="vector-uv")}_updateVectorFieldRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; VectorFieldRenderer only supports "vector-magdir" and "vector-uv".`}}_updateFlowRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; FlowRenderer only supports "vector-magdir" and "vector-uv".`}}_updateUVRenderer(e){var l;const{bandCount:t,attributeTable:r,pixelType:o}=this.rasterInfo,u=e.field1;if(!u)return{success:!1,error:"Unsupported renderer; missing UniqueValueRenderer.field."};const i=e.defaultSymbol,f=t===1&&["u8","s8"].includes(o);if(!Oo(this.rasterInfo,u)&&!f)return{success:!1,error:"Unsupported data; UniqueValueRenderer is only supported on single band data with a valid raster attribute table."};const n=[];if(r!=null){const a=r.fields.find(c=>c.name.toLowerCase()==="value");if(!a)return{success:!1,error:"Unsupported data; the data's raster attribute table does not have a value field."};r.features.forEach(c=>{var y,b;const d=(y=e.uniqueValueInfos)==null?void 0:y.find(S=>String(S.value)===String(c.attributes[u])),C=(b=d==null?void 0:d.symbol)==null?void 0:b.color;C?n.push([c.attributes[a.name]].concat(C)):i&&n.push([c.attributes[a.name]].concat(i.color))})}else{if(u.toLowerCase()!=="value")return{success:!1,error:'Unsupported renderer; UniqueValueRenderer.field must be "Value" when raster attribute table is not availalbe.'};(l=e.uniqueValueInfos)==null||l.forEach(a=>{var d;const c=(d=a==null?void 0:a.symbol)==null?void 0:d.color;c?n.push([parseInt(""+a.value,10)].concat(c)):i&&n.push([parseInt(""+a.value,10)].concat(i==null?void 0:i.color))})}if(n.length===0)return{success:!1,error:"Invalid UniqueValueRenderer. Cannot find matching records in the raster attribute table."};const s=Re({colormap:n});return this.lookup={rendererJSON:e,colormapLut:s},this.canRenderInWebGL=this._isColormapSupportedByWebGL(s==null?void 0:s.indexedColormap),{success:!0}}_updateColormapRenderer(e){if(!Uo(this.rasterInfo))return{success:!1,error:"Unsupported data; the data source does not have a colormap."};const t=e.colormapInfos.map(o=>[o.value].concat(o.color)).sort((o,u)=>o[0]-u[0]);if(!t||t.length===0)return{success:!1,error:"Unsupported renderer; ColormapRenderer must have meaningful colormapInfos."};const r=Re({colormap:t});return this.lookup={rendererJSON:e,colormapLut:r},this.canRenderInWebGL=this._isColormapSupportedByWebGL(r==null?void 0:r.indexedColormap),{success:!0}}_updateShadedReliefRenderer(e){if(!Do(this.rasterInfo))return{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; ShadedReliefRenderer only supports "elevation", or single band float/s16 data.`};if(e.colorRamp){const t=Ut(e.colorRamp,{interpolateAlpha:!0}),r=Re({colormap:t}),o=[],u=r.indexedColormap;for(let i=0;if.name.toLowerCase()==="value"):null,u=t!=null?t.fields.find(f=>f.name.toLowerCase()===e.field.toLowerCase()):null,i=o!=null&&u!==null;return{canUseIndexedLUT:["u8","u16","s8","s16"].includes(r)||i,tableValueField:o,tableBreakField:u}}_updateClassBreaksRenderer(e){const{attributeTable:t}=this.rasterInfo,{canUseIndexedLUT:r,tableValueField:o,tableBreakField:u}=this._analyzeClassBreaks(e),i=e.classBreakInfos;if(!(i!=null&&i.length))return{success:!1,error:"Unsupported renderer; missing or invalid ClassBreaksRenderer.classBreakInfos."};const f=i.sort((c,d)=>c.classMaxValue-d.classMaxValue),n=f[f.length-1];let s=e.minValue;if(!r){const c=[];for(let d=0;dm>h);p&&l.push([S].concat(p.symbol.color))}}else{s=Math.floor(e.minValue);for(let c=0;c0&&e[0].min!=null&&e[0].max!=null}_updateStretchRenderer(e){var a,c;let{stretchType:t,dra:r}=e;if(!(t==="none"||(a=e.statistics)!=null&&a.length||this._isValidRasterStatistics(this.rasterInfo.statistics)||r))return{success:!1,error:"Unsupported renderer; StretchRenderer.statistics is required when dynamic range adjustment is not used."};const o=e.histograms||this.rasterInfo.histograms;!this._isHistogramRequired(e.stretchType)||o!=null&&o.length||r||(t="minMax");const{computeGamma:u,useGamma:i,colorRamp:f}=e;let{gamma:n}=e;if(i&&u&&!(n!=null&&n.length)){const d=(c=e.statistics)!=null&&c.length?e.statistics:this.rasterInfo.statistics;n=Ao(this.rasterInfo.pixelType,d)}const s=this.rasterInfo.pixelType,l=!r&&["u8","u16","s8","s16"].includes(s);if(t==="histogramEqualization"){const d=o.map(C=>ar(C));this.lookup={rendererJSON:e,histogramLut:d}}else if(l){const d=Le(e,{rasterInfo:this.rasterInfo}),C=Bt({pixelType:s,...d,gamma:i?n:null,rounding:"floor"});this.lookup={rendererJSON:e,stretchLut:C}}if(f&&!this._isStretchColorRampNoop(f)){const d=Ut(f,{interpolateAlpha:!0});this.lookup||(this.lookup={rendererJSON:e}),this.lookup.colormapLut=Re({colormap:d}),this.lookup.rendererJSON=e}return this.lookup.gamma=i&&(n!=null&&n.length)?n:null,this.canRenderInWebGL=!0,{success:!0}}_isStretchColorRampNoop(e){return e.type==="algorithmic"&&["0,0,0,255","0,0,0"].includes(e.fromColor.join(","))&&["255,255,255,255","255,255,255"].includes(e.toColor.join(","))}_generateStretchWebGLParams(e,t,r){var m;let o=null,u=null;const i=(m=this.lookup)==null?void 0:m.colormapLut;t.colorRamp&&i&&(o=i.indexedColormap,u=i.offset),t.stretchType==="histogramEqualization"&&(t={...t,stretchType:"minMax"});const{gamma:f}=this.lookup,n=!!(t.useGamma&&f&&f.some(g=>g!==1)),{minCutOff:s,maxCutOff:l,outMin:a,outMax:c}=Le(t,{rasterInfo:this.rasterInfo,pixelBlock:e,bandIds:r});let d=0;e!=null&&(d=e.getPlaneCount(),d===2&&((e=e.clone()).statistics=[e.statistics[0]],e.pixels=[e.pixels[0]]));const{bandCount:C}=this.rasterInfo,y=Math.min(3,(r==null?void 0:r.length)||d||C,C),b=new Float32Array(y),S=o||n?1:255;let h;for(h=0;h1?f[h]>2?p[h]=6.5+(f[h]-2)**2.5:p[h]=6.5+100*(2-f[h])**4:p[h]=1;return{bandCount:y,outMin:a/S,outMax:c/S,minCutOff:s,maxCutOff:l,factor:b,useGamma:n,gamma:n?f:[1,1,1],gammaCorrection:n?p:[1,1,1],colormap:o,colormapOffset:u,stretchType:t.stretchType,type:"stretch"}}_generateShadedReliefWebGLParams(e,t=!1,r={x:0,y:0}){var l,a;let o=null,u=null;const i=(l=this.lookup)==null?void 0:l.colormapLut;e.colorRamp&&i&&(o=i.indexedColormap,u=i.offset);const f={...e,isGCS:t,resolution:r},n=rr(f),s=(a=this.rasterInfo.statistics)==null?void 0:a[0];return{...n,minValue:(s==null?void 0:s.min)??0,maxValue:(s==null?void 0:s.max)??8e3,hillshadeType:e.hillshadeType==="traditional"?0:1,type:"hillshade",colormap:o,colormapOffset:u}}_generateVectorFieldWebGLParams(e){var h,p,m;const{style:t,inputUnit:r,outputUnit:o,visualVariables:u,symbolTileSize:i,flowRepresentation:f}=e;let n;const s=((h=this.rasterInfo.statistics)==null?void 0:h[0].min)??0,l=((p=this.rasterInfo.statistics)==null?void 0:p[0].max)??50,a=(u==null?void 0:u.find(g=>g.type==="sizeInfo"))??{type:"sizeInfo",field:"Magnitude",maxDataValue:l,maxSize:.8*i,minDataValue:s,minSize:.2*i},c=a.minDataValue??s,d=a.maxDataValue??l,C=a.maxSize!=null&&a.minSize!=null?[a.minSize/i,a.maxSize/i]:[.2,.8];if(t==="wind_speed"){const g=(C[0]+C[1])/2;C[0]=C[1]=g}const y=c!=null&&d!=null?[c,d]:null;if(t==="classified_arrow")if(c!=null&&d!=null&&a!=null){n=[];const g=(a.maxDataValue-a.minDataValue)/5;for(let w=0;w<6;w++)n.push(a.minDataValue+g*w)}else n=[0,1e-6,3.5,7,10.5,14];const b=f==="flow_to"==(t==="ocean_current_kn"||t==="ocean_current_m")?0:Math.PI,S=u==null?void 0:u.find(g=>g.type==="rotationInfo");return{breakValues:n,dataRange:y,inputUnit:r,outputUnit:o,symbolTileSize:i,symbolPercentRange:C,style:t||"single_arrow",rotation:b,rotationType:(m=this.rasterInfo.storageInfo)!=null&&m.tileInfo&&this.rasterInfo.dataType==="vector-uv"?"geographic":(S==null?void 0:S.rotationType)||e.rotationType,type:"vectorField"}}};function Ft(e){return Se(e)&&e.validPixelCount!==0}D([B({json:{write:!0}})],we.prototype,"rendererJSON",void 0),D([B({type:ho,json:{write:!0}})],we.prototype,"rasterInfo",void 0),D([B({json:{write:!0}})],we.prototype,"lookup",void 0),D([B()],we.prototype,"canRenderInWebGL",void 0),we=D([Oe("esri.renderers.support.RasterSymbolizer")],we);const tn=we;export{qo as A,Wr as B,Wo as C,We as D,zo as E,zr as F,Ko as G,_o as H,Le as I,Bt as J,sr as K,tn as L,Qe as M,Zt as N,$o as P,pt as R,Vo as S,Xt as U,ho as a,ft as b,Ae as c,Vr as d,Ut as e,Jo as f,Xo as g,Ro as h,ko as i,or as j,Zo as k,Do as l,Yo as m,co as n,Qo as o,en as p,Co as q,Pr as r,jo as s,Oo as t,Uo as u,mo as v,To as w,Ho as x,xo as y,xe as z}; +import{ar as $t,N as pe,ib as ur,jj as cr,_ as hr,gZ as fr,ah as $e,d as D,y as B,f as Oe,aU as De,aZ as dr,aR as pr,aA as mr,aV as Q,aE as gt,aS as gr,aY as Vt,a2 as yr,kV as yt,kW as _e,kX as Ct,kY as Cr,a9 as bt,s as wt}from"./index-BjUNJPVf.js";import{c as ut,u as ee,o as Se,i as br,j as qe,k as wr,n as vt,q as Re}from"./dataUtils-DzOfgSpi.js";var Je,St,Tt,_t={exports:{}};St=_t,Je=function(){function e(){this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=null}return e.prototype={ensureBuffer:function(t){var r=this.buffer,o=r?r.byteLength:0;if(tu&&(o=u)}else{for(;!this.eof;)this.readBlock();o=this.bufferLength}return this.pos=o,this.buffer.subarray(r,o)},lookChar:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(t,r,o){for(var u=t+r;this.bufferLength<=u&&!this.eof;)this.readBlock();return new Stream(this.buffer,t,r,o)},skip:function(t){t||(t=1),this.pos+=t},reset:function(){this.pos=0}},e}(),(Tt=function(){if(!self||!self.Uint32Array)return null;var e=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),t=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),r=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),o=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],u=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];function i(n){throw new Error(n)}function f(n){var s=0,l=n[s++],a=n[s++];l!=-1&&a!=-1||i("Invalid header in flate stream"),(15&l)!=8&&i("Unknown compression method in flate stream"),((l<<8)+a)%31!=0&&i("Bad FCHECK in flate stream"),32&a&&i("FDICT bit set in flate stream"),this.bytes=n,this.bytesPos=s,this.codeSize=0,this.codeBuf=0,Je.call(this)}return f.prototype=Object.create(Je.prototype),f.prototype.getBits=function(n){for(var s,l=this.codeSize,a=this.codeBuf,c=this.bytes,d=this.bytesPos;l>n,this.codeSize=l-=n,this.bytesPos=d,s},f.prototype.getCode=function(n){for(var s=n[0],l=n[1],a=this.codeSize,c=this.codeBuf,d=this.bytes,C=this.bytesPos;a>16,h=65535&b;return(a==0||a>S,this.codeSize=a-S,this.bytesPos=C,h},f.prototype.generateHuffmanTable=function(n){for(var s=n.length,l=0,a=0;al&&(l=n[a]);for(var c=1<>=1;for(a=h;a0;)W[b++]=j}var s=this.getBits(3);if(1&s&&(this.eof=!0),(s>>=1)!=0){var l,a;if(s==1)l=o,a=u;else if(s==2){for(var c=this.getBits(5)+257,d=this.getBits(5)+1,C=this.getBits(4)+4,y=Array(e.length),b=0;b=w&&(w=(M=this.ensureBuffer(k+1)).length),M[k++]=v;else{if(v==256)return void(this.bufferLength=k);var I=(v=t[v-=257])>>16;I>0&&(I=this.getBits(I)),h=(65535&v)+I,v=this.getCode(a),(I=(v=r[v])>>16)>0&&(I=this.getBits(I));var T=(65535&v)+I;k+h>=w&&(w=(M=this.ensureBuffer(k+h)).length);for(var E=0;E{let a=null;f==="jpg"&&n&&(a=jt._getMask(t,{width:u,height:i}));const c=new Blob([new Uint8Array(t)],{type:"image/"+f=="jpg"?"jpeg":f}),d=URL.createObjectURL(c),C=new Image;let y;C.src=d,C.onload=()=>{if(URL.revokeObjectURL(d),ur(o))return void l(cr());u=C.width,i=C.height,this._canvas&&this._ctx?(this._canvas.width===u&&this._canvas.height===i||(this._canvas.width=u,this._canvas.height=i),this._ctx.clearRect(0,0,u,i)):(this._canvas=document.createElement("canvas"),this._canvas.width=u,this._canvas.height=i,this._ctx=this._canvas.getContext("2d")),this._ctx.drawImage(C,0,0);const b=this._ctx.getImageData(0,0,u,i);let S;if(y=b.data,r.renderOnCanvas){if(a)for(S=0;S{URL.revokeObjectURL(d),l("cannot load image")}})}static _getMask(t,r){let o=null;try{const u=new Uint8Array(t),i=Math.ceil(u.length/2);let f=0;const n=u.length-2;for(f=i;f=0;c--)o[l++]=s[a]>>c&1}}catch{}return o}};var kt,It,xt,zt={exports:{}};kt=zt,It=function(){var e=function(){function t(r){this.message="JPEG error: "+r}return t.prototype=new Error,t.prototype.name="JpegError",t.constructor=t,t}();return function(){if(!self||!self.Uint8ClampedArray)return null;var t=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),r=4017,o=799,u=3406,i=2276,f=1567,n=3784,s=5793,l=2896;function a(){this.decodeTransform=null,this.colorTransform=-1}function c(h,p){for(var m,g,w=0,k=[],v=16;v>0&&!h[v-1];)v--;k.push({children:[],index:0});var I,T=k[0];for(m=0;m0;)T=k.pop();for(T.index++,k.push(T);k.length<=m;)k.push(I={children:[],index:0}),T.children[T.index]=I.children,T=I;w++}m+10)return O--,P>>O&1;if((P=h[p++])===255){var U=h[p++];if(U)throw new e("unexpected marker "+(P<<8|U).toString(16))}return O=7,P>>>7}function N(U){for(var z=U;;){if(typeof(z=z[R()])=="number")return z;if(typeof z!="object")throw new e("invalid huffman sequence")}}function M(U){for(var z=0;U>0;)z=z<<1|R(),U--;return z}function _(U){if(U===1)return R()===1?1:-1;var z=M(U);return z>=1<>4;if(X!==0){var lr=t[re+=ne];U.blockData[z+lr]=_(X),re++}else{if(ne<15)break;re+=16}}}function L(U,z){var H=N(U.huffmanTableDC),Y=H===0?0:_(H)<0)$--;else for(var H=k,Y=v;H<=Y;){var re=N(U.huffmanTableAC),le=15&re,X=re>>4;if(le!==0){var ne=t[H+=X];U.blockData[z+ne]=_(le)*(1<>4,(H=15&Y)==0)X<15?($=M(X)+(1<=65488&&Ce<=65495))break;p+=2}return(se=S(h,p))&&se.invalid&&(console.log("decodeScan - unexpected Scan data, next marker is: "+se.invalid),p=se.offset),p-A}function y(h,p,m){var g,w,k,v,I,T,E,x,A,P,O,R,N,M,_,G,L,W=h.quantizationTable,$=h.blockData;if(!W)throw new e("missing required Quantization Table.");for(var F=0;F<64;F+=8)A=$[p+F],P=$[p+F+1],O=$[p+F+2],R=$[p+F+3],N=$[p+F+4],M=$[p+F+5],_=$[p+F+6],G=$[p+F+7],A*=W[F],P|O|R|N|M|_|G?(P*=W[F+1],O*=W[F+2],R*=W[F+3],N*=W[F+4],M*=W[F+5],_*=W[F+6],G*=W[F+7],w=(g=(g=s*A+128>>8)+(w=s*N+128>>8)+1>>1)-w,L=(k=O)*n+(v=_)*f+128>>8,k=k*f-v*n+128>>8,E=(I=(I=l*(P-G)+128>>8)+(E=M<<4)+1>>1)-E,T=(x=(x=l*(P+G)+128>>8)+(T=R<<4)+1>>1)-T,v=(g=g+(v=L)+1>>1)-v,k=(w=w+k+1>>1)-k,L=I*i+x*u+2048>>12,I=I*u-x*i+2048>>12,x=L,L=T*o+E*r+2048>>12,T=T*r-E*o+2048>>12,E=L,m[F]=g+x,m[F+7]=g-x,m[F+1]=w+E,m[F+6]=w-E,m[F+2]=k+T,m[F+5]=k-T,m[F+3]=v+I,m[F+4]=v-I):(L=s*A+512>>10,m[F]=L,m[F+1]=L,m[F+2]=L,m[F+3]=L,m[F+4]=L,m[F+5]=L,m[F+6]=L,m[F+7]=L);for(var j=0;j<8;++j)A=m[j],(P=m[j+8])|(O=m[j+16])|(R=m[j+24])|(N=m[j+32])|(M=m[j+40])|(_=m[j+48])|(G=m[j+56])?(w=(g=4112+((g=s*A+2048>>12)+(w=s*N+2048>>12)+1>>1))-w,L=(k=O)*n+(v=_)*f+2048>>12,k=k*f-v*n+2048>>12,v=L,E=(I=(I=l*(P-G)+2048>>12)+(E=M)+1>>1)-E,T=(x=(x=l*(P+G)+2048>>12)+(T=R)+1>>1)-T,L=I*i+x*u+2048>>12,I=I*u-x*i+2048>>12,x=L,L=T*o+E*r+2048>>12,T=T*r-E*o+2048>>12,A=(A=(g=g+v+1>>1)+x)<16?0:A>=4080?255:A>>4,P=(P=(w=w+k+1>>1)+(E=L))<16?0:P>=4080?255:P>>4,O=(O=(k=w-k)+T)<16?0:O>=4080?255:O>>4,R=(R=(v=g-v)+I)<16?0:R>=4080?255:R>>4,N=(N=v-I)<16?0:N>=4080?255:N>>4,M=(M=k-T)<16?0:M>=4080?255:M>>4,_=(_=w-E)<16?0:_>=4080?255:_>>4,G=(G=g-x)<16?0:G>=4080?255:G>>4,$[p+j]=A,$[p+j+8]=P,$[p+j+16]=O,$[p+j+24]=R,$[p+j+32]=N,$[p+j+40]=M,$[p+j+48]=_,$[p+j+56]=G):(L=(L=s*A+8192>>14)<-2040?0:L>=2024?255:L+2056>>4,$[p+j]=L,$[p+j+8]=L,$[p+j+16]=L,$[p+j+24]=L,$[p+j+32]=L,$[p+j+40]=L,$[p+j+48]=L,$[p+j+56]=L)}function b(h,p){for(var m=p.blocksPerLine,g=p.blocksPerColumn,w=new Int16Array(64),k=0;k=w)return null;var v=g(p);if(v>=65472&&v<=65534)return{invalid:null,marker:v,offset:p};for(var I=g(k);!(I>=65472&&I<=65534);){if(++k>=w)return null;I=g(k)}return{invalid:v.toString(16),marker:I,offset:k}}return a.prototype={parse:function(h){function p(){var U=h[v]<<8|h[v+1];return v+=2,U}function m(){var U=p(),z=v+U-2,H=S(h,z,v);H&&H.invalid&&(console.log("readDataBlock - incorrect length, next marker is: "+H.invalid),z=H.offset);var Y=h.subarray(v,z);return v+=Y.length,Y}function g(U){for(var z=Math.ceil(U.samplesPerLine/8/U.maxH),H=Math.ceil(U.scanLines/8/U.maxV),Y=0;Y>4){if(G>>4!=1)throw new e("DQT - invalid table spec");for(R=0;R<64;R++)L[t[R]]=p()}else for(R=0;R<64;R++)L[t[R]]=h[v++];E[15&G]=L}break;case 65472:case 65473:case 65474:if(w)throw new e("Only single frame JPEGs supported");p(),(w={}).extended=P===65473,w.progressive=P===65474,w.precision=h[v++],w.scanLines=p(),w.samplesPerLine=p(),w.components=[],w.componentIds={};var W,$=h[v++],F=0,j=0;for(O=0;O<$;O++){W=h[v];var J=h[v+1]>>4,oe=15&h[v+1];F>4?x:A)[15&ce]=c(ie,me)}break;case 65501:p(),k=p();break;case 65498:p();var q,Pe=h[v++],ge=[];for(O=0;O>4],q.huffmanTableAC=x[15&ye],ge.push(q)}var Ge=h[v++],Ne=h[v++],fe=h[v++],Be=C(h,v,w,ge,k,Ge,Ne,fe>>4,15&fe);v+=Be;break;case 65535:h[v]!==255&&v--;break;default:if(h[v-3]===255&&h[v-2]>=192&&h[v-2]<=254){v-=3;break}throw new e("unknown marker "+P.toString(16))}P=p()}for(this.width=w.samplesPerLine,this.height=w.scanLines,this.jfif=I,this.eof=v,this.adobe=T,this.components=[],O=0;O>8)+$[x+1];return G},_isColorConversionNeeded:function(){return this.adobe?!!this.adobe.transformCode:this.numComponents===3?this.colorTransform!==0:this.colorTransform===1},_convertYccToRgb:function(h){for(var p,m,g,w=0,k=h.length;w4)throw new e("Unsupported color mode");var g=this._getLinearizedBlockData(h,p);if(this.numComponents===1&&m){for(var w=g.length,k=new Uint8ClampedArray(3*w),v=0,I=0;I=0;b--)d[h++]=S[C]>>b&1}catch{}if(n===1&&l.length===i*f){const S=new Uint8Array(l.buffer);c=[S,S,S]}else{for(c=[],C=0;C<3;C++)c.push(new Uint8Array(a));for(b=0,y=0;yimport("./lerc-wasm-lV1hYBlU.js"),__vite__mapDeps([0,1,2])).then(e=>e.l).then(({default:e})=>e({locateFile:t=>fr(`esri/layers/support/rasterFormats/${t}`)})).then(e=>{kr(e)}),Ye)}const je={getBlobInfo:null,decode:null};function Tr(e){return 16+(e>>3<<3)}function de(e,t,r){r.set(e.slice(t,t+r.length))}function kr(e){const{_malloc:t,_free:r,_lerc_getBlobInfo:o,_lerc_getDataRanges:u,_lerc_decode_4D:i,asm:f}=e;let n;const s=Object.values(f).find(a=>a&&"buffer"in a&&a.buffer===e.HEAPU8.buffer),l=a=>{const c=a.map(b=>Tr(b)),d=c.reduce((b,S)=>b+S),C=t(d);n=new Uint8Array(s.buffer);let y=c[0];c[0]=C;for(let b=1;b{const C=new Uint8Array(48),y=new Uint8Array(8*3),[b,S,h]=l([a.length,C.length,y.length]);n.set(a,b),n.set(C,S),n.set(y,h);let p=o(b,a.length,S,h,12,3);if(p)throw r(b),new Error(`lerc-getBlobInfo: error code is ${p}`);n=new Uint8Array(s.buffer),de(n,S,C),de(n,h,y);const m=new Uint32Array(C.buffer),g=new Float64Array(y.buffer),[w,k,,v,I,T,E,x,A,P,O]=m,R={version:w,depthCount:P,width:v,height:I,validPixelCount:E,bandCount:T,blobSize:x,maskCount:A,dataType:k,minValue:g[0],maxValue:g[1],maxZerror:g[2],statistics:[],bandCountWithNoData:O};if(O&&P>1)return r(b),R;if(P===1&&T===1)return r(b),R.statistics.push({minValue:g[0],maxValue:g[1]}),R;const N=P*T*8,M=new Uint8Array(N),_=new Uint8Array(N);let G=b,L=0,W=0,$=!1;if(n.byteLength1){const Te=F.slice(oe*P,(oe+1)*P),ke=j.slice(oe*P,(oe+1)*P),ce=Math.min.apply(null,Te),ie=Math.max.apply(null,ke);J.push({minValue:ce,maxValue:ie,depthStats:{minValues:Te,maxValues:ke}})}else J.push({minValue:F[oe],maxValue:j[oe]});return r(G),$||r(L),R},je.decode=(a,c)=>{const{maskCount:d,depthCount:C,bandCount:y,width:b,height:S,dataType:h,bandCountWithNoData:p}=c,m=Ht[h],g=b*S,w=new Uint8Array(g*y),k=g*C*y*m.size,v=new Uint8Array(k),I=new Uint8Array(y),T=new Uint8Array(8*y),[E,x,A,P,O]=l([a.length,w.length,v.length,I.length,T.length]);n.set(a,E),n.set(w,x),n.set(v,A),n.set(I,P),n.set(T,O);const R=i(E,a.length,d,x,C,b,S,y,h,A,P,O);if(R)throw r(E),new Error(`lerc-decode: error code is ${R}`);n=new Uint8Array(s.buffer),de(n,A,v),de(n,x,w);let N=null;if(p){de(n,P,I),de(n,O,T),N=[];const M=new Float64Array(T.buffer);for(let _=0;_1){w.set(p[0]);for(let E=1;E=k;if(C>0&&v)for(let E=0;E1?p:null,{pixelType:T}=b;return{width:s,height:l,bandCount:a,pixelType:T,depthCount:c,statistics:y,pixels:h,mask:w,bandMasks:I,noDataValues:n}}function xr(e,t,r,o=!0){if(t%4!=0||r%4!=0){const u=new ArrayBuffer(4*Math.ceil(r/4)),i=new Uint8Array(u),f=new Uint8Array(e,t,r);if(o)for(let n=0;n=i)n-=i,d=c>>>32-i,c<<=i;else{d=c>>>32-n,c=u[a++];const h=i-n;n=32-h,d=(d<>>n),c<<=h}if(d===257)break;if(d===256){i=9,f=At(),s=f.length,l=[];continue}const S=f[d];if(S==null){if(d>f.length)throw new Error("data integrity issue: code does not exist on code page");l.push(l[0]),f[s++]=l.slice(),Et(b,l)}else Et(b,S),l.push(S[0]),l.length>1&&(f[s++]=l.slice()),l=S.slice();if(Ie.has(s)&&i++,n===0&&(c=u[a++],n=32),a>C||a===C&&n<=y)break}return new Uint8Array(b)}Ie.add(511),Ie.add(1023),Ie.add(2047),Ie.add(4095),Ie.add(8191);const Pt=(e,t)=>{const r=t.width*t.height,o=t.pixelType;return Math.floor(e.byteLength/(r*Jt(o)))},Jt=e=>{let t=1;switch(e){case Uint8Array:case Int8Array:t=1;break;case Uint16Array:case Int16Array:t=2;break;case Uint32Array:case Int32Array:case Float32Array:t=4;break;case Float64Array:t=8}return t},Ar=(e,t)=>{if(8*e.byteLength=0;n--)o[u++]=i>>n&1;for(n=7;u>n&1,n--;return o};let Er=class{static decode(t,r){const o=r.pixelType,u=[],i=r.width*r.height,f=Pt(t,r),{bandIds:n,format:s}=r,l=(n==null?void 0:n.length)||Pt(t,r),a=t.byteLength-t.byteLength%(i*Jt(o)),c=new o(t,0,i*f);let d,C,y,b,S=null;if(s==="bip")for(d=0;d>4,u<8?u=1:u===15?(u=4,i=(7&i)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++]):u===14?(u=3,i=(15&i)<<12|(63&e[r++])<<6|63&e[r++]):(u=2,i=(31&i)<<6|63&e[r++]),(i!==0||t)&&(o+=String.fromCharCode(i));return o}const ht=(()=>{const e=[];return e[254]="NEWSUBFILETYPE",e[255]="SUBFILETYPE",e[256]="IMAGEWIDTH",e[257]="IMAGELENGTH",e[258]="BITSPERSAMPLE",e[259]="COMPRESSION",e[262]="PHOTOMETRICINTERPRETATION",e[263]="THRESHHOLDING",e[264]="CELLWIDTH",e[265]="CELLLENGTH",e[266]="FILLORDER",e[269]="DOCUMENTNAME",e[270]="IMAGEDESCRIPTION",e[271]="MAKE",e[272]="MODEL",e[273]="STRIPOFFSETS",e[274]="ORIENTATION",e[277]="SAMPLESPERPIXEL",e[278]="ROWSPERSTRIP",e[279]="STRIPBYTECOUNTS",e[280]="MINSAMPLEVALUE",e[281]="MAXSAMPLEVALUE",e[282]="XRESOLUTION",e[283]="YRESOLUTION",e[284]="PLANARCONFIGURATION",e[285]="PAGENAME",e[286]="XPOSITION",e[287]="YPOSITION",e[288]="FREEOFFSETS",e[289]="FREEBYTECOUNTS",e[290]="GRAYRESPONSEUNIT",e[291]="GRAYRESPONSECURVE",e[292]="T4OPTIONS",e[293]="T6OPTIONS",e[296]="RESOLUTIONUNIT",e[297]="PAGENUMBER",e[300]="COLORRESPONSEUNIT",e[301]="TRANSFERFUNCTION",e[305]="SOFTWARE",e[306]="DATETIME",e[315]="ARTIST",e[316]="HOSTCOMPUTER",e[317]="PREDICTOR",e[318]="WHITEPOINT",e[319]="PRIMARYCHROMATICITIES",e[320]="COLORMAP",e[321]="HALFTONEHINTS",e[322]="TILEWIDTH",e[323]="TILELENGTH",e[324]="TILEOFFSETS",e[325]="TILEBYTECOUNTS",e[326]="BADFAXLINES",e[327]="CLEANFAXDATA",e[328]="CONSECUTIVEBADFAXLINES",e[330]="SUBIFD",e[332]="INKSET",e[333]="INKNAMES",e[334]="NUMBEROFINKS",e[336]="DOTRANGE",e[337]="TARGETPRINTER",e[338]="EXTRASAMPLES",e[339]="SAMPLEFORMAT",e[340]="SMINSAMPLEVALUE",e[341]="SMAXSAMPLEVALUE",e[342]="TRANSFERRANGE",e[347]="JPEGTABLES",e[512]="JPEGPROC",e[513]="JPEGIFOFFSET",e[514]="JPEGIFBYTECOUNT",e[515]="JPEGRESTARTINTERVAL",e[517]="JPEGLOSSLESSPREDICTORS",e[518]="JPEGPOINTTRANSFORM",e[519]="JPEGQTABLES",e[520]="JPEGDCTABLES",e[521]="JPEGACTABLES",e[529]="YCBCRCOEFFICIENTS",e[530]="YCBCRSUBSAMPLING",e[531]="YCBCRPOSITIONING",e[532]="REFERENCEBLACKWHITE",e[700]="XMP",e[33550]="GEOPIXELSCALE",e[33922]="GEOTIEPOINTS",e[33432]="COPYRIGHT",e[42112]="GDAL_METADATA",e[42113]="GDAL_NODATA",e[50844]="RPCCOEFFICIENT",e[34264]="GEOTRANSMATRIX",e[34735]="GEOKEYDIRECTORY",e[34736]="GEODOUBLEPARAMS",e[34737]="GEOASCIIPARAMS",e[34665]="EXIFIFD",e[34853]="GPSIFD",e[40965]="INTEROPERABILITYIFD",e})(),Rr=(()=>{const e=ht.slice();return e[36864]="ExifVersion",e[40960]="FlashpixVersion",e[40961]="ColorSpace",e[42240]="Gamma",e[37121]="ComponentsConfiguration",e[37122]="CompressedBitsPerPixel",e[40962]="PixelXDimension",e[40963]="PixelYDimension",e[37500]="MakerNote",e[37510]="UserComment",e[40964]="RelatedSoundFile",e[36867]="DateTimeOriginal",e[36868]="DateTimeDigitized",e[36880]="OffsetTime",e[36881]="OffsetTimeOriginal",e[36882]="OffsetTimeDigitized",e[37520]="SubSecTime",e[37521]="SubSecTimeOriginal",e[37522]="SubSecTimeDigitized",e[37888]="Temperature",e[37889]="Humidity",e[37890]="Pressure",e[37891]="WaterDepth",e[37892]="Acceleration",e[37893]="CameraElevationAngle",e[42016]="ImageUniqueID",e[42032]="CameraOwnerName",e[42033]="BodySerialNumber",e[42034]="LensSpecification",e[42035]="LensMake",e[42036]="LensModel",e[42037]="LensSerialNumber",e[33434]="ExposureTime",e[33437]="FNumber",e[34850]="ExposureProgram",e[34852]="SpectralSensitivity",e[34855]="PhotographicSensitivity",e[34856]="OECF",e[34864]="SensitivityType",e[34865]="StandardOutputSensitivity",e[34866]="RecommendedExposureIndex",e[34867]="ISOSpeed",e[34868]="ISOSpeedLatitudeyyy",e[34869]="ISOSpeedLatitudezzz",e[37377]="ShutterSpeedValue",e[37378]="ApertureValue",e[37379]="BrightnessValue",e[37380]="ExposureBiasValue",e[37381]="MaxApertureValue",e[37382]="SubjectDistance",e[37383]="MeteringMode",e[37384]="LightSource",e[37385]="Flash",e[37386]="FocalLength",e[37396]="SubjectArea",e[41483]="FlashEnergy",e[41484]="SpatialFrequencyResponse",e[41486]="FocalPlaneXResolution",e[41487]="FocalPlaneYResolution",e[41488]="FocalPlaneResolutionUnit",e[41492]="SubjectLocation",e[41493]="ExposureIndex",e[41495]="SensingMethod",e[41728]="FileSource",e[41729]="SceneType",e[41730]="CFAPattern",e[41985]="CustomRendered",e[41986]="ExposureMode",e[41987]="WhiteBalance",e[41988]="DigitalZoomRatio",e[41989]="FocalLengthIn35mmFilm",e[41990]="SceneCaptureType",e[41991]="GainControl",e[41992]="Contrast",e[41993]="Saturation",e[41994]="Sharpness",e[41995]="DeviceSettingDescription",e[41996]="SubjectDistanceRange",e})(),Mr=["GPSVersionID","GPSLatitudeRef","GPSLatitude","GPSLongitudeRef","GPSLongitude","GPSAltitudeRef","GPSAltitude","GPSTimeStamp","GPSSatellites","GPSStatus","GPSMeasureMode","GPSDOP","GPSSpeedRef","GPSSpeed","GPSTrackRef","GPSTrack","GPSImgDirectionRef","GPSImgDirection","GPSMapDatum","GPSDestLatitudeRef","GPSDestLatitude","GPSDestLongitudeRef","GPSDestLongitude","GPSDestBearingRef","GPSDestBearing","GPSDestDistanceRef","GPSDestDistance","GPSProcessingMethod","GPSAreaInformation","GPSDateStamp","GPSDifferential","GPSHPositioningError"],Lr=(()=>{const e=[];return e[1024]="GTModelTypeGeoKey",e[1025]="GTRasterTypeGeoKey",e[1026]="GTCitationGeoKey",e[2048]="GeographicTypeGeoKey",e[2049]="GeogCitationGeoKey",e[2050]="GeogGeodeticDatumGeoKey",e[2051]="GeogPrimeMeridianGeoKey",e[2052]="GeogLinearUnitsGeoKey",e[2053]="GeogLinearUnitSizeGeoKey",e[2054]="GeogAngularUnitsGeoKey",e[2055]="GeogAngularUnitSizeGeoKey",e[2056]="GeogEllipsoidGeoKey",e[2057]="GeogSemiMajorAxisGeoKey",e[2058]="GeogSemiMinorAxisGeoKey",e[2059]="GeogInvFlatteningGeoKey",e[2061]="GeogPrimeMeridianLongGeoKey",e[2060]="GeogAzimuthUnitsGeoKey",e[3072]="ProjectedCSTypeGeoKey",e[3073]="PCSCitationGeoKey",e[3074]="ProjectionGeoKey",e[3075]="ProjCoordTransGeoKey",e[3076]="ProjLinearUnitsGeoKey",e[3077]="ProjLinearUnitSizeGeoKey",e[3078]="ProjStdParallel1GeoKey",e[3079]="ProjStdParallel2GeoKey",e[3080]="ProjNatOriginLongGeoKey",e[3081]="ProjNatOriginLatGeoKey",e[3082]="ProjFalseEastingGeoKey",e[3083]="ProjFalseNorthingGeoKey",e[3084]="ProjFalseOriginLongGeoKey",e[3085]="ProjFalseOriginLatGeoKey",e[3086]="ProjFalseOriginEastingGeoKey",e[3087]="ProjFalseOriginNorthingGeoKey",e[3088]="ProjCenterLongGeoKey",e[3090]="ProjCenterEastingGeoKey",e[3091]="ProjCenterNorthingGeoKey",e[3092]="ProjScaleAtNatOriginGeoKey",e[3093]="ProjScaleAtCenterGeoKey",e[3094]="ProjAzimuthAngleGeoKey",e[3095]="ProjStraightVertPoleLongGeoKey",e[4096]="VerticalCSTypeGeoKey",e[4097]="VerticalCitationGeoKey",e[4098]="VerticalDatumGeoKey",e[4099]="VerticalUnitsGeoKey",e})(),Or=(e,t)=>{let r=(t||ht)[e];return r===void 0&&(r="unknown"+String(e)),r},et=new Map;et.set("EXIFIFD",Rr),et.set("GPSIFD",Mr);const Ae={tiffTags:ht,ifdTags:et,geoKeys:Lr,getTagName:Or},ft=(()=>{const e=new ArrayBuffer(4),t=new Uint8Array(e);return new Uint32Array(e)[0]=1,t[0]===1})(),Rt=[0,1,1,2,4,8,1,1,2,4,8,4,8,-1,-1,-1,8,8,8],Ee=4294967296,Dr=new Set([1,5,6,7,8,34712,34887]);function dt(e,t){let r="unknown";return e===3?r=t===64?"f64":"f32":e===1?t===1?r="u1":t===2?r="u2":t===4?r="u4":t<=8?r="u8":t<=16?r="u16":t<=32&&(r="u32"):e===2&&(t<=8?r="s8":t<=16?r="s16":t<=32&&(r="s32")),r}function ze(e){let t=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":t=Uint8Array;break;case"u16":t=Uint16Array;break;case"u32":t=Uint32Array;break;case"s8":t=Int8Array;break;case"s16":t=Int16Array;break;case"s32":t=Int32Array;break;case"f64":t=Float64Array;break;default:t=Float32Array}return t}function Ur(e,t){return{x:t[0]*e.x+t[1]*e.y+t[2],y:t[3]*e.x+t[4]*e.y+t[5]}}function Yt(e,t){var r;return(r=e.get(t))==null?void 0:r.values}function ve(e,t){var r;return(r=e.get(t))==null?void 0:r.values}function Mt(e,t){var r,o;return(o=(r=e.get(t))==null?void 0:r.values)==null?void 0:o[0]}function V(e,t){var r,o;return(o=(r=e.get(t))==null?void 0:r.values)==null?void 0:o[0]}function Xe(e,t,r,o=0,u=Ae.tiffTags,i=4){const f=i===8,n=f?mt(new DataView(e,r,8),0,t):new DataView(e,r,2).getUint16(0,t),s=4+2*i,l=f?8:2,a=l+n*s;if(r+a>e.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:a};const c=r+a+4<=e.byteLength?Ve(new DataView(e,r+a,i===8?8:4),0,t,i===8):null,d=r+l,C=new Map;let y,b,S,h,p,m=0,g=0;for(let w=0;wqt(e,{inputOffset:t}).pixels[0];function tt(e,t){if(t!==1&&t!==2&&t!==4)return e;const r=new Uint8Array(e),o=8/t,u=new Uint8Array(e.byteLength*o);let i=0;const f=2**t-1;for(let n=0;n>>8-t&f}return u.buffer}function rt(e,t,r){const o=new Wt;o.parse(e),o.colorTransform=r===6?-1:0;const u=o.getData(o.width,o.height,t!==1&&t!==4);return new Uint8Array(u.buffer)}function ot(e){const t=new Ue(e).getBytes(),r=new ArrayBuffer(t.length),o=new Uint8Array(r);return o.set(t),o}async function nt(e,t,r,o,u){const i=ft===t,f=V(r,"BITSPERSAMPLE"),n=V(r,"SAMPLESPERPIXEL")??1,s=V(r,"PHOTOMETRICINTERPRETATION"),l=V(r,"SAMPLEFORMAT")??1,a=dt(l,f),c=V(r,"COMPRESSION")??1,d=ze(a);let C,y,b;if(c===34887)return await Kt(),Gr(e,o);if(c===1)C=e.slice(o,o+u),y=new Uint8Array(C);else if(c===8||c===32946)y=new Uint8Array(e,o,u),y=ot(y),C=y.buffer;else if(c===6)y=new Uint8Array(e,o,u),y=rt(y,n,s),C=y.buffer;else if(c===7){const m=r.get("JPEGTABLES").values,g=m.length-2;y=new Uint8Array(g+u-2);for(let k=0;k1&&(c===5||c===8||c===32946)&&h&&p){const m=We(r),g=new d(b.length);g.set(b),b=Hr(g,p,h,l===3&&S===3,m?1:n)}return b}async function Nr(e,t,r){const o=ve(r,"TILEOFFSETS");if(o===void 0)return null;const u=ve(r,"TILEBYTECOUNTS"),{width:i,height:f,pixelType:n,tileWidth:s,tileHeight:l}=pt([r]),a=We(r,t),c=V(r,"SAMPLESPERPIXEL")||t.planes,d=i*f,C=V(r,"BITSPERSAMPLE"),y=(V(r,"COMPRESSION")??1)===34887,b=ze(n),S=[];for(let M=0;M1){const M=Math.round(o.length/c);for(h=0;h{const o=ft===t.littleEndian,u=ve(r,"STRIPOFFSETS");if(u===void 0)return null;const{width:i,height:f,pixelType:n}=pt([r]),s=V(r,"SAMPLESPERPIXEL")||t.planes,l=V(r,"PHOTOMETRICINTERPRETATION"),a=i*f,c=V(r,"BITSPERSAMPLE"),d=ze(n),C=new d(a*s),y=ve(r,"STRIPBYTECOUNTS"),b=V(r,"ROWSPERSTRIP"),S=V(r,"COMPRESSION")??1;let h,p,m,g,w,k,v,I,T,E=b;if(c%8==0)for(h=0;hf?f-h*b:b,n==="u8"||n==="s8"||o)S===8||S===32946?(v=new Uint8Array(e,u[h],y[h]),v=ot(v),k=v.buffer):S===6?(v=new Uint8Array(e,u[h],y[h]),v=rt(v,s,l),k=v.buffer):S===5?(v=ct(e,u[h],y[h],t.littleEndian),k=v.buffer):(y[h]!==E*i*s*c/8&&console.log("strip byte counts is different than expected"),k=e.slice(u[h],u[h]+y[h])),k=tt(k,c),g=new d(k);else{switch(S===6||S===8||S===32946?(v=new Uint8Array(e,u[h],y[h]),I=ot(v),k=I.buffer):(y[h]!==E*i*s*c/8&&console.log("strip byte counts is different than expected"),k=new ArrayBuffer(y[h]),v=new Uint8Array(e,u[h],y[h]),I=new Uint8Array(k)),n){case"u16":case"s16":for(m=0;m{if(!(e&&e.length>0&&t&&r))return null;let o,u,i;const f=e[0].length,n=e.length,s=new Uint8Array(f);for(let l=0;li?0:1;else for(let a=0;ai?0:1);return s},$r=e=>{if(!e)return null;const t=e.match(//gi);if(!t||t.length===0)return null;const r=new Map;let o,u,i,f,n;for(let h=0;h")),f=o.indexOf("sample="),f>-1&&(n=o.slice(f+8,o.indexOf('"',f+8))),f=o.indexOf("name="),f>-1&&(u=o.slice(f+6,o.indexOf('"',f+6))),u&&(i=o.slice(o.indexOf(">")+1,o.indexOf("")).trim(),n!=null?r.has(u)?r.get(u)[n]=i:r.set(u,[i]):r.set(u,i)),n=null;const s=r.get("STATISTICS_MINIMUM"),l=r.get("STATISTICS_MAXIMUM"),a=r.get("STATISTICS_MEAN"),c=r.get("STATISTICS_STDDEV");let d=null;if(s&&l){d=[];for(let h=0;hS&&d>(u?e.byteLength:e?e.byteLength-s+o:0))return r.offlineOffsetSize=[s,d],r.values=null,!1;if(C<=S){if(!t)if(S<=32)s>>>=32-C;else{const p=h!=null&&h.length?h[0]:s>>>0,m=h!=null&&h.length?h[1]:Math.round((s-p)/Ee);C<=32?(s=p>>>32-C,h[0]=s):(s=p*2**(32-C)+(m>>>32-C),h[0]=p,h[1]=m>>>32-C)}if(n===1&&c===S)l=[s];else if(S===64){const p=h!=null&&h.length?h[0]:s>>>0,m=h!=null&&h.length?h[1]:Math.round((s-p)/Ee);let g=p,w=32;for(b=1;b<=n;b++){const k=32-c*b%32;if(w>>32-w,I=m<<32-w>>>32-w;g=m,l.push(v+I*2**(c-w)),w-=32-(c-w)}else l.push(g<>>32-c),w-=c;w===0&&(w=32,g=m)}}else for(b=1;b<=n;b++){const p=32-c*b;l.push(s<

>>32-c)}}else{s-=o,u&&(s=0);for(let p=s;pparseFloat(G)),d.some(G=>isNaN(G))&&(d=null));const C=V(t,"COMPRESSION")??1;let y;switch(C){case 1:y="NONE";break;case 2:case 3:case 4:case 32771:y="CCITT";break;case 5:y="LZW";break;case 6:case 7:y="JPEG";break;case 32773:y="PACKBITS";break;case 8:case 32946:y="DEFLATE";break;case 34712:y="JPEG2000";break;case 34887:y="LERC";break;default:y=String(C)}let b=!0,S="";Dr.has(C)||(b=!1,S+="unsupported tag compression "+C),s>3&&(b=!1,S+="unsupported tag sampleFormat "+s),f!==1&&f!==2&&f!==4&&f%8!=0&&(b=!1,S+="unsupported tag bitsPerSample "+f);const h=Mt(t,"GEOASCIIPARAMS");let p;if(h){const G=h.split("|").find(W=>W.includes("ESRI PE String = ")),L=G?G.replace("ESRI PE String = ",""):"";p=L.startsWith("COMPD_CS")||L.startsWith("PROJCS")||L.startsWith("GEOGCS")?{wkid:null,wkt:L}:null}const m=ve(t,"GEOTIEPOINTS"),g=ve(t,"GEOPIXELSCALE"),w=ve(t,"GEOTRANSMATRIX"),k=t.has("GEOKEYDIRECTORY")?t.get("GEOKEYDIRECTORY").data:null;let v,I,T=!1,E=!1;if(k){T=V(k,"GTRasterTypeGeoKey")===2;const G=V(k,"GTModelTypeGeoKey");if(G===2){const L=V(k,"GeographicTypeGeoKey");L>=1024&&L<=32766&&(p={wkid:L}),p||L!==32767||(E=!0,p={wkid:4326})}else if(G===1){const L=V(k,"ProjectedCSTypeGeoKey");L>=1024&&L<=32766&&(p={wkid:L})}}if(g&&m&&m.length>=6?(v=[g[0],0,m[3]-m[0]*g[0],0,-Math.abs(g[1]),m[4]-m[1]*g[1]],T&&(v[2]-=.5*v[0]+.5*v[1],v[5]-=.5*v[3]+.5*v[4])):w&&w.length===16&&(v=T?[w[0],w[1],w[3]-.5*w[0],w[4],w[5],w[7]-.5*w[5]]:[w[0],w[1],w[3],w[4],w[5],w[7]]),v){const G=[{x:0,y:i},{x:0,y:0},{x:u,y:i},{x:u,y:0}];let L,W=Number.POSITIVE_INFINITY,$=Number.POSITIVE_INFINITY,F=Number.NEGATIVE_INFINITY,j=Number.NEGATIVE_INFINITY;for(let J=0;JW?W:L.x,F=L.x$?$:L.y,j=L.y400||Math.max(Math.abs(I.xmin),Math.abs(I.xmax))>361)&&(p=null,I.spatialReference=null);const x=Xt(e);let A,P,O,R,N;if(x.length>0){O=Math.round(Math.log(u/V(x[0],"IMAGEWIDTH"))/Math.LN2);const G=x[x.length-1];R=Math.round(Math.log(u/V(G,"IMAGEWIDTH"))/Math.LN2),A=V(G,"TILEWIDTH"),P=V(G,"TILELENGTH")}A=R!=null&&R>0?A||r:null,P=R!=null&&R>0?P||o:null,r&&(N=[{maxCol:Math.ceil(u/r)-1,maxRow:Math.ceil(i/o)-1,minRow:0,minCol:0}],x.forEach(G=>{N.push({maxCol:Math.ceil(V(G,"IMAGEWIDTH")/V(G,"TILEWIDTH"))-1,maxRow:Math.ceil(V(G,"IMAGELENGTH")/V(G,"TILELENGTH"))-1,minRow:0,minCol:0})}));const M=Mt(e[0],"GDAL_METADATA"),_=$r(M);return S+=" "+Qt({width:u,height:i,tileWidth:r,tileHeight:o,planes:n,ifds:e}),{width:u,height:i,tileWidth:r,tileHeight:o,planes:n,isBSQ:a,pixelType:l,compression:y,noData:d,hasMaskBand:Zt(e).length===x.length+1,isSupported:b,message:S,extent:I,isPseudoGeographic:E,affine:g?null:v,firstPyramidLevel:O,maximumPyramidLevel:R,pyramidBlockWidth:A,pyramidBlockHeight:P,tileBoundary:N,metadata:_}}function We(e,t){const r=Yt(e,"PLANARCONFIGURATION");return r?r[0]===2:!!t&&t.isBSQ}function Xt(e){return e.filter(t=>V(t,"NEWSUBFILETYPE")===1)}function Zt(e){return e.filter(t=>{const r=(4&(V(t,"NEWSUBFILETYPE")??0))==4,o=V(t,"PHOTOMETRICINTERPRETATION")===4;return r&&o})}function _r(e){const{littleEndian:t,isBigTiff:r,firstIFDPos:o}=zr(e);let u=o;const i=[];do{const f=Wr(e,t,u,0,Ae.tiffTags,r?8:4);if(!f.success)break;i.push(f.ifd),u=f.nextIFD}while(u>0);return{...pt(i),littleEndian:t,isBigTiff:r,ifds:i,pyramidIFDs:Xt(i),maskIFDs:Zt(i)}}function mt(e,t,r){const o=e.getUint32(t,r),u=e.getUint32(t+4,r);return r?u*Ee+o:o*Ee+u}function jr(e,t,r){let o=r?e.getInt32(t,r):e.getUint32(t,r),u=r?e.getUint32(t+4,r):e.getInt32(t+4,r);const i=(r?o:u)>=0?1:-1;return r?o*=i:u*=i,i*(r?u*Ee+o:o*Ee+u)}function Ve(e,t,r,o){return o?mt(e,t,r):e.getUint32(t,r)}function zr(e){const t=new DataView(e,0,16),r=t.getUint16(0,!1);let o=null;if(r===18761)o=!0;else{if(r!==19789)throw new Error("unexpected endianess byte");o=!1}const u=t.getUint16(2,o);if(u!==42&&u!==43)throw new Error("unexpected tiff identifier");let i=4;const f=u===43;if(f){const n=t.getUint16(i,o);if(i+=2,n!==8)throw new Error("unsupported bigtiff version");if(t.getUint16(i,o)!==0)throw new Error("unsupported bigtiff version");i+=2}return{littleEndian:o,isBigTiff:f,firstIFDPos:Ve(t,i,o,f)}}function Wr(e,t,r,o=0,u=Ae.tiffTags,i=4){const f=Xe(e,t,r,o,u,i);let n;const s=f.ifd;if(s){if(Ae.ifdTags.forEach((l,a)=>{s.has(a)&&(n=s.get(a),n.data=Xe(e,t,n.valueOffset-o,o,l).ifd)}),s.has("GEOKEYDIRECTORY")){n=s.get("GEOKEYDIRECTORY");const l=n.values;if(l&&l.length>4){const a=l[0]+"."+l[1]+"."+l[2];n.data=Xe(e,t,n.valueOffset+6-o,o,Ae.geoKeys,2).ifd,n.data&&n.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[a]})}}if(s.has("XMP")){n=s.get("XMP");const l=n.values;typeof l[0]=="number"&&n.type===7&&(n.values=[Pr(new Uint8Array(l))])}}return f}function Qt(e){const{width:t,height:r,tileHeight:o,tileWidth:u}=e,i=e.planes,f=u?u*o:t*r,n=V(e.ifds[0],"BITSPERSAMPLE");let s="";return f*i>2**30/(n>8?n/8:1)&&(s=u?"tiled tiff exceeding 1 gigabits per tile is not supported":"scanline tiff exceeding 1 gigabits is not supported"),s}function Hr(e,t,r,o,u){const i=o?4:1,f=r*i*u;o&&(e=new Uint8Array(e.buffer));for(let l=0;lT.min):null,v=w?w.map(T=>T.max):null,I={pixelType:l,width:d,height:C,pixels:h,noDataValue:g};return g!=null?ut(I,g):k&&v&&t.applyMinMaxConstraint&&(I.mask=Fr(h,k,v)),I}async function qr(e,t={}){const r=t.pyramidLevel||0,o=t.headerInfo||_r(e),{ifds:u,noData:i}=o;if(u.length===0)throw new Error("no valid image file directory");const f=Qt(o);if(f)throw f;let n=null;const s=r===-1?u[u.length-1]:u[r],l=i??t.noDataValue;return n=o.tileWidth?await Nr(e,o,s):Br(e,o,s),n&&(l!=null&&ut(n,l),n)}var Jr=function(e){var t,r,o,u,i,f;function n(s){var l,a,c,d,C,y,b,S,h,p,m,g,w;for(this.data=s,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},C=null;;){switch(l=this.readUInt32(),S=(function(){var k,v;for(v=[],k=0;k<4;++k)v.push(String.fromCharCode(this.data[this.pos++]));return v}).call(this).join(""),S){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(l);break;case"fcTL":C&&this.animation.frames.push(C),this.pos+=4,C={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},d=this.readUInt16(),c=this.readUInt16()||100,C.delay=1e3*d/c,C.disposeOp=this.data[this.pos++],C.blendOp=this.data[this.pos++],C.data=[];break;case"IDAT":case"fdAT":for(S==="fdAT"&&(this.pos+=4,l-=4),s=(C!=null?C.data:void 0)||this.imgData,m=0;0<=l?ml;0<=l?++m:--m)s.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(this.transparency.indexed=this.read(l),(h=255-this.transparency.indexed.length)>0)for(g=0;0<=h?gh;0<=h?++g:--g)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(l)[0];break;case 2:this.transparency.rgb=this.read(l)}break;case"tEXt":y=(p=this.read(l)).indexOf(0),b=String.fromCharCode.apply(String,p.slice(0,y)),this.text[b]=String.fromCharCode.apply(String,p.slice(y+1));break;case"IEND":return C&&this.animation.frames.push(C),this.colors=(function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}).call(this),this.hasAlphaChannel=(w=this.colorType)===4||w===6,a=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*a,this.colorSpace=(function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}).call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=l}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}return n.load=function(s,l,a){var c;return typeof l=="function"&&(a=l),(c=new XMLHttpRequest).open("GET",s,!0),c.responseType="arraybuffer",c.onload=function(){var d;return d=new n(new Uint8Array(c.response||c.mozResponseArrayBuffer)),typeof(l!=null?l.getContext:void 0)=="function"&&d.render(l),typeof a=="function"?a(d):void 0},c.send(null)},r=1,o=2,t=0,n.prototype.read=function(s){var l,a;for(a=[],l=0;0<=s?ls;0<=s?++l:--l)a.push(this.data[this.pos++]);return a},n.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},n.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},n.prototype.decodePixels=function(s){var l,a,c,d,C,y,b,S,h,p,m,g,w,k,v,I,T,E,x,A,P,O,R;if(s==null&&(s=this.imgData),s.length===0)return new Uint8Array(0);for(s=(s=new Ue(s)).getBytes(),I=(g=this.pixelBitlength/8)*this.width,w=new Uint8Array(I*this.height),y=s.length,v=0,k=0,a=0;k1&&a/dro(r,o,e);break;case"tiff":t=Zr;break;case"deflate":t=eo;break;case"lzw":t=to;break;case"error":t=()=>{throw new pe("rasterCodec:decode","input data contains error")};break;default:t=()=>{throw new pe("rasterCodec:decode","unsupported raster format")}}return t}function so(e){let t=null,r=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":r=255,t=Uint8Array;break;case"u16":r=r||65535,t=Uint16Array;break;case"u32":r=r||2**32-1,t=Uint32Array;break;case"s8":r=r||-128,t=Int8Array;break;case"s16":r=r||-32768,t=Int16Array;break;case"s32":r=r||0-2**31,t=Int32Array;break;default:t=Float32Array}return{pixelTypeCtor:t,noDataValue:r}}function lo(e,t=1){if(!e)return;const{pixels:r,width:o,height:u,mask:i}=e;if(!r||r.length===0)return;const f=r.length,n=o-1,s=u-1,l=[];let a,c,d,C,y,b,S=null;const h=ee.getPixelArrayConstructor(e.pixelType);if(t===0){for(a=0;a1){const s=f.map((c,d)=>u(e.slice(c,f[d+1]),t)),l=await Promise.all(s);i=l[0],i.pixels=l.map(c=>c.pixels[0]);const a=l.map(c=>c.mask);l.some(c=>c!=null)&&(a.forEach((c,d)=>{c==null&&(a[d]=new Uint8Array(i.width*i.height).fill(255))}),i.bandMasks=a,i.mask=ee.combineBandMasks(a)),i.updateStatistics()}else i=await u(e,{...t,offset:(f==null?void 0:f[0])??t.offset});return o!=="jpg"&&t.noDataValue!=null&&i.depthCount===1&&ut(i,t.noDataValue,{customFloatTolerance:t.tolerance}),t.isPoint&&lo(i),i}var it;function be(e){return e=Number(e),isNaN(e)?void 0:e}let ue=it=class extends De{constructor(){super(...arguments),this.name=null,this.minWavelength=void 0,this.maxWavelength=void 0,this.radianceBias=void 0,this.radianceGain=void 0,this.reflectanceBias=void 0,this.reflectanceGain=void 0,this.solarIrradiance=void 0}clone(){return new it({name:this.name,minWavelength:this.minWavelength,maxWavelength:this.maxWavelength,radianceBias:this.radianceBias,radianceGain:this.radianceGain,reflectanceBias:this.reflectanceBias,reflectanceGain:this.reflectanceGain,solarIrradiance:this.solarIrradiance})}};D([B({json:{name:"BandName",write:!0}})],ue.prototype,"name",void 0),D([B({json:{name:"WavelengthMin",read:{reader:be},write:!0}})],ue.prototype,"minWavelength",void 0),D([B({json:{name:"WavelengthMax",read:{reader:be},write:!0}})],ue.prototype,"maxWavelength",void 0),D([B({json:{name:"RadianceBias",read:{reader:be},write:!0}})],ue.prototype,"radianceBias",void 0),D([B({json:{name:"RadianceGain",read:{reader:be},write:!0}})],ue.prototype,"radianceGain",void 0),D([B({json:{name:"ReflectanceBias",read:{reader:be},write:!0}})],ue.prototype,"reflectanceBias",void 0),D([B({json:{name:"ReflectanceGain",read:{reader:be},write:!0}})],ue.prototype,"reflectanceGain",void 0),D([B({json:{name:"SolarIrradiance",read:{reader:be},write:!0}})],ue.prototype,"solarIrradiance",void 0),ue=it=D([Oe("esri.layers.support.RasterBandInfo")],ue);const Lt=ue;var at;function Me(e){return e=Number(e),isNaN(e)?void 0:e}let ae=at=class extends De{constructor(){super(...arguments),this.acquisitionDate=void 0,this.cloudCover=void 0,this.productName=void 0,this.sensorName=null,this.sensorAzimuth=void 0,this.sensorElevation=void 0,this.sunAzimuth=void 0,this.sunElevation=void 0}readAcquisitionDate(e){return new Date(e)}writeAcquisitionDate(e,t){t.AcquisitionDate=e.getTime()}clone(){return new at({acquisitionDate:this.acquisitionDate,cloudCover:this.cloudCover,productName:this.productName,sensorName:this.sensorName,sensorAzimuth:this.sensorAzimuth,sensorElevation:this.sensorElevation,sunAzimuth:this.sunAzimuth,sunElevation:this.sunElevation})}};D([B({json:{name:"AcquisitionDate",write:!0}})],ae.prototype,"acquisitionDate",void 0),D([dr("acquisitionDate")],ae.prototype,"readAcquisitionDate",null),D([pr("acquisitionDate")],ae.prototype,"writeAcquisitionDate",null),D([B({json:{name:"CloudCover",read:{reader:Me},write:!0}})],ae.prototype,"cloudCover",void 0),D([B({json:{name:"ProductName",write:!0}})],ae.prototype,"productName",void 0),D([B({json:{name:"SensorName",write:!0}})],ae.prototype,"sensorName",void 0),D([B({json:{name:"SensorAzimuth",read:{reader:Me},write:!0}})],ae.prototype,"sensorAzimuth",void 0),D([B({json:{name:"SensorElevation",read:{reader:Me},write:!0}})],ae.prototype,"sensorElevation",void 0),D([B({json:{name:"SunAzimuth",read:{reader:Me},write:!0}})],ae.prototype,"sunAzimuth",void 0),D([B({json:{name:"SunElevation",read:{reader:Me},write:!0}})],ae.prototype,"sunElevation",void 0),ae=at=D([Oe("esri.layers.support.RasterSensorInfo")],ae);const uo=ae;var st;let Z=st=class extends De{constructor(){super(...arguments),this.blockWidth=void 0,this.blockHeight=void 0,this.compression=null,this.origin=null,this.firstPyramidLevel=null,this.maximumPyramidLevel=null,this.pyramidScalingFactor=2,this.pyramidBlockWidth=null,this.pyramidBlockHeight=null,this.isVirtualTileInfo=!1,this.tileInfo=null,this.transposeInfo=null,this.blockBoundary=null}clone(){return new st({blockWidth:this.blockWidth,blockHeight:this.blockHeight,compression:this.compression,origin:Q(this.origin),firstPyramidLevel:this.firstPyramidLevel,maximumPyramidLevel:this.maximumPyramidLevel,pyramidResolutions:Q(this.pyramidResolutions),pyramidScalingFactor:this.pyramidScalingFactor,pyramidBlockWidth:this.pyramidBlockWidth,pyramidBlockHeight:this.pyramidBlockHeight,isVirtualTileInfo:this.isVirtualTileInfo,tileInfo:Q(this.tileInfo),transposeInfo:Q(this.transposeInfo),blockBoundary:Q(this.blockBoundary)})}};D([B({type:Number,json:{write:!0}})],Z.prototype,"blockWidth",void 0),D([B({type:Number,json:{write:!0}})],Z.prototype,"blockHeight",void 0),D([B({type:String,json:{write:!0}})],Z.prototype,"compression",void 0),D([B({type:mr,json:{write:!0}})],Z.prototype,"origin",void 0),D([B({type:Number,json:{write:!0}})],Z.prototype,"firstPyramidLevel",void 0),D([B({type:Number,json:{write:!0}})],Z.prototype,"maximumPyramidLevel",void 0),D([B({json:{write:!0}})],Z.prototype,"pyramidResolutions",void 0),D([B({type:Number,json:{write:!0}})],Z.prototype,"pyramidScalingFactor",void 0),D([B({type:Number,json:{write:!0}})],Z.prototype,"pyramidBlockWidth",void 0),D([B({type:Number,json:{write:!0}})],Z.prototype,"pyramidBlockHeight",void 0),D([B({type:Boolean,json:{write:!0}})],Z.prototype,"isVirtualTileInfo",void 0),D([B({json:{write:!0}})],Z.prototype,"tileInfo",void 0),D([B()],Z.prototype,"transposeInfo",void 0),D([B()],Z.prototype,"blockBoundary",void 0),Z=st=D([Oe("esri.layers.support.RasterStorageInfo")],Z);const co=Z;var lt;let K=lt=class extends De{constructor(e){super(e),this.attributeTable=null,this.bandCount=null,this.colormap=null,this.extent=null,this.format=void 0,this.height=null,this.width=null,this.histograms=null,this.keyProperties={},this.multidimensionalInfo=null,this.noDataValue=null,this.pixelSize=null,this.pixelType=null,this.isPseudoSpatialReference=!1,this.spatialReference=null,this.statistics=null,this.storageInfo=null,this.transform=null}get bandInfos(){const e=this.keyProperties.BandProperties,{bandCount:t}=this;if(!(e!=null&&e.length)||e.lengthLt.fromJSON(o));for(let o=0;o.001&&(d/=xe,C/=xe),f==="adjusted")if(n){const A=a*xe,P=c*xe;d=(l+A**u*i)/(8*A),C=(l+P**u*i)/(8*P)}else d=(l+a**u*i)/(8*a),C=(l+c**u*i)/(8*c);let y=(90-t)*Math.PI/180,b=Math.cos(y),S=(360-r+90)*Math.PI/180,h=Math.sin(y)*Math.cos(S),p=Math.sin(y)*Math.sin(S);const m=[315,270,225,360,180,0],g=[60,60,60,60,60,90],w=new Float32Array([3,5,3,2,1,4]),k=w.reduce((A,P)=>A+P),v=w.map(A=>A/k),I=o==="multi-directional"?m.length:1,T=new Float32Array(6),E=new Float32Array(6),x=new Float32Array(6);if(o==="multi-directional")for(let A=0;Ay?y:S],m=f[b],g=m*p,w=g*(1-Math.abs(h%2-1)),k=m-g;switch(Math.floor(h)){case 0:c[b]=g+k,d[b]=w+k,C[b]=k;break;case 1:c[b]=w+k,d[b]=g+k,C[b]=k;break;case 2:c[b]=k,d[b]=g+k,C[b]=w+k;break;case 3:c[b]=k,d[b]=w+k,C[b]=g+k;break;case 4:c[b]=w+k,d[b]=k,C[b]=g+k;break;case 5:case 6:c[b]=g+k,d[b]=k,C[b]=w+k}}e.pixels=[c,d,C],e.updateStatistics()}function _o(e,t){if(!Se(e))return e;const r=t.zFactor,o=t.pixelSizePower??1,u=t.pixelSizeFactor??1,i=t.slopeType,f=t.isGCS,{x:n,y:s}=t.resolution;let l=r/(8*n),a=r/(8*s);f&&Math.abs(r-1)<1e-4&&(l/=xe,a/=xe),i==="adjusted"&&(l=(r+n**o*u)/(8*n),a=(r+s**o*u)/(8*s));const{dzxs:c,dzys:d,outMask:C}=He(e),{width:y,height:b}=e,S=new Float32Array(y*b);for(let p=te;p360&&(h%=360)),a[d+C]=h}}}return Ke(a,s,l),new ee({width:s,height:l,pixels:[a],mask:n,pixelType:"f32",validPixelCount:e.validPixelCount,statistics:[{minValue:-1,maxValue:360}]})}function zo(e,t){if(!Se(e))return e;const{curvatures:r,outMask:o}=He(e,t),{width:u,height:i}=e;Ke(r,u,i);const f=new ee({width:u,height:i,pixels:[r],mask:o,pixelType:"f32",validPixelCount:e.validPixelCount});return f.updateStatistics(),f}const Wo=["random","ndvi","ndvi2","ndvi3","elevation","gray","hillshade"],or=[{id:"aspect",type:"multipart",colorRamps:[{fromColor:[190,190,190],toColor:[255,45,8]},{fromColor:[255,45,8],toColor:[255,181,61]},{fromColor:[255,181,61],toColor:[255,254,52]},{fromColor:[255,254,52],toColor:[0,251,50]},{fromColor:[0,251,50],toColor:[255,254,52]},{fromColor:[0,253,255],toColor:[0,181,255]},{fromColor:[0,181,255],toColor:[26,35,253]},{fromColor:[26,35,253],toColor:[255,57,251]},{fromColor:[255,57,251],toColor:[255,45,8]}]},{id:"black-to-white",fromColor:[0,0,0],toColor:[255,255,255]},{id:"blue-bright",fromColor:[204,204,255],toColor:[0,0,224]},{id:"blue-light-to-dark",fromColor:[211,229,232],toColor:[46,100,140]},{id:"blue-green-bright",fromColor:[203,245,234],toColor:[48,207,146]},{id:"blue-green-light-to-dark",fromColor:[216,242,237],toColor:[21,79,74]},{id:"brown-light-to-dark",fromColor:[240,236,170],toColor:[102,72,48]},{id:"brown-to-blue-green-diverging-right",type:"multipart",colorRamps:[{fromColor:[156,85,31],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[33,130,145]}]},{id:"brown-to-blue-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[110,70,45],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[48,100,102]}]},{id:"coefficient-bias",fromColor:[214,214,255],toColor:[0,57,148]},{id:"cold-to-hot-diverging",type:"multipart",colorRamps:[{fromColor:[69,117,181],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[214,47,39]}]},{id:"condition-number",type:"multipart",colorRamps:[{fromColor:[0,97,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,34,0]}]},{id:"cyan-to-purple",type:"multipart",colorRamps:[{fromColor:[0,245,245],toColor:[0,0,245]},{fromColor:[0,0,245],toColor:[245,0,245]}]},{id:"cyan-light-to-blue-dark",type:"multipart",colorRamps:[{fromColor:[182,237,240],toColor:[31,131,224]},{fromColor:[31,131,224],toColor:[9,9,145]}]},{id:"distance",fromColor:[255,200,0],toColor:[0,0,255]},{id:"elevation1",type:"multipart",colorRamps:[{fromColor:[175,240,233],toColor:[255,255,179]},{fromColor:[255,255,179],toColor:[0,128,64]},{fromColor:[0,128,64],toColor:[252,186,3]},{fromColor:[252,186,3],toColor:[128,0,0]},{fromColor:[120,0,0],toColor:[105,48,13]},{fromColor:[105,48,13],toColor:[171,171,171]},{fromColor:[171,171,171],toColor:[255,252,255]}]},{id:"elevation2",type:"multipart",colorRamps:[{fromColor:[118,219,211],toColor:[255,255,199]},{fromColor:[255,255,199],toColor:[255,255,128]},{fromColor:[255,255,128],toColor:[217,194,121]},{fromColor:[217,194,121],toColor:[135,96,38]},{fromColor:[135,96,38],toColor:[150,150,181]},{fromColor:[150,150,181],toColor:[181,150,181]},{fromColor:[181,150,181],toColor:[255,252,255]}]},{id:"errors",fromColor:[255,235,214],toColor:[196,10,10]},{id:"gray-light-to-dark",fromColor:[219,219,219],toColor:[69,69,69]},{id:"green-bright",fromColor:[204,255,204],toColor:[14,204,14]},{id:"green-light-to-dark",fromColor:[220,245,233],toColor:[34,102,51]},{id:"green-to-blue",type:"multipart",colorRamps:[{fromColor:[32,204,16],toColor:[0,242,242]},{fromColor:[0,242,242],toColor:[2,33,227]}]},{id:"orange-bright",fromColor:[255,235,204],toColor:[240,118,5]},{id:"orange-light-to-dark",fromColor:[250,233,212],toColor:[171,65,36]},{id:"partial-spectrum",type:"multipart",colorRamps:[{fromColor:[242,241,162],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]},{fromColor:[252,3,69],toColor:[176,7,237]},{fromColor:[176,7,237],toColor:[2,29,173]}]},{id:"partial-spectrum-1-diverging",type:"multipart",colorRamps:[{fromColor:[135,38,38],toColor:[240,149,12]},{fromColor:[240,149,12],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[74,80,181]},{fromColor:[74,80,181],toColor:[39,32,122]}]},{id:"partial-spectrum-2-diverging",type:"multipart",colorRamps:[{fromColor:[115,77,42],toColor:[201,137,52]},{fromColor:[201,137,52],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[91,63,176]},{fromColor:[91,63,176],toColor:[81,13,97]}]},{id:"pink-to-yellow-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[158,30,113],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[99,110,45]}]},{id:"pink-to-yellow-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[97,47,73],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[22,59,15]}]},{id:"precipitation",type:"multipart",colorRamps:[{fromColor:[194,82,60],toColor:[237,161,19]},{fromColor:[237,161,19],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,219,0]},{fromColor:[0,219,0],toColor:[32,153,143]},{fromColor:[32,153,143],toColor:[11,44,122]}]},{id:"prediction",type:"multipart",colorRamps:[{fromColor:[40,146,199],toColor:[250,250,100]},{fromColor:[250,250,100],toColor:[232,16,20]}]},{id:"purple-bright",fromColor:[255,204,255],toColor:[199,0,199]},{id:"purple-to-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[77,32,150],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[20,122,11]}]},{id:"purple-to-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[67,14,89],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[24,79,15]}]},{id:"purple-blue-bright",fromColor:[223,184,230],toColor:[112,12,242]},{id:"purple-blue-light-to-dark",fromColor:[229,213,242],toColor:[93,44,112]},{id:"purple-red-bright",fromColor:[255,204,225],toColor:[199,0,99]},{id:"purple-red-light-to-dark",fromColor:[250,215,246],toColor:[143,17,57]},{id:"red-bright",fromColor:[255,204,204],toColor:[219,0,0]},{id:"red-light-to-dark",fromColor:[255,224,224],toColor:[143,10,10]},{id:"red-to-blue-diverging-bright",type:"multipart",colorRamps:[{fromColor:[196,69,57],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[48,95,207]}]},{id:"red-to-blue-diverging-dark",type:"multipart",colorRamps:[{fromColor:[107,13,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[13,53,97]}]},{id:"red-to-green",type:"multipart",colorRamps:[{fromColor:[245,0,0],toColor:[245,245,0]},{fromColor:[245,245,0],toColor:[0,245,0]}]},{id:"red-to-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[186,20,20],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[54,145,33]}]},{id:"red-to-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[97,21,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[16,69,16]}]},{id:"slope",type:"multipart",colorRamps:[{fromColor:[56,168,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]},{id:"spectrum-full-bright",type:"multipart",colorRamps:[{fromColor:[255,0,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,0,255]}]},{id:"spectrum-full-dark",type:"multipart",colorRamps:[{fromColor:[153,0,0],toColor:[153,153,0]},{fromColor:[153,153,0],toColor:[0,153,153]},{fromColor:[0,153,153],toColor:[0,0,153]}]},{id:"spectrum-full-light",type:"multipart",colorRamps:[{fromColor:[255,153,153],toColor:[255,255,153]},{fromColor:[255,255,153],toColor:[153,255,255]},{fromColor:[153,255,255],toColor:[153,153,255]}]},{id:"surface",type:"multipart",colorRamps:[{fromColor:[112,153,89],toColor:[242,238,162]},{fromColor:[242,238,162],toColor:[242,206,133]},{fromColor:[242,206,133],toColor:[194,140,124]},{fromColor:[194,140,124],toColor:[255,242,255]}]},{id:"temperature",type:"multipart",colorRamps:[{fromColor:[255,252,255],toColor:[255,0,255]},{fromColor:[255,0,255],toColor:[0,0,255]},{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,255,0]},{fromColor:[0,255,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,128,0]},{fromColor:[255,128,0],toColor:[128,0,0]}]},{id:"white-to-black",fromColor:[255,255,255],toColor:[0,0,0]},{id:"yellow-to-dark-red",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[242,167,46]},{fromColor:[242,167,46],toColor:[107,0,0]}]},{id:"yellow-to-green-to-dark-blue",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[56,224,9]},{fromColor:[56,224,9],toColor:[26,147,171]},{fromColor:[26,147,171],toColor:[12,16,120]}]},{id:"yellow-to-red",fromColor:[245,245,0],toColor:[255,0,0]},{id:"yellow-green-bright",fromColor:[236,252,204],toColor:[157,204,16]},{id:"yellow-green-light-to-dark",fromColor:[215,240,175],toColor:[96,107,45]}],mo=new Vt({Aspect:"aspect","Black to White":"black-to-white","Blue Bright":"blue-bright","Blue Light to Dark":"blue-light-to-dark","Blue-Green Bright":"blue-green-bright","Blue-Green Light to Dark":"blue-green-light-to-dark","Brown Light to Dark":"brown-light-to-dark","Brown to Blue Green Diverging, Bright":"brown-to-blue-green-diverging-right","Brown to Blue Green Diverging, Dark":"brown-to-blue-green-diverging-dark","Coefficient Bias":"coefficient-bias","Cold to Hot Diverging":"cold-to-hot-diverging","Condition Number":"condition-number","Cyan to Purple":"cyan-to-purple","Cyan-Light to Blue-Dark":"cyan-light-to-blue-dark",Distance:"distance","Elevation #1":"elevation1","Elevation #2":"elevation2",Errors:"errors","Gray Light to Dark":"gray-light-to-dark","Green Bright":"green-bright","Green Light to Dark":"green-light-to-dark","Green to Blue":"green-to-blue","Orange Bright":"orange-bright","Orange Light to Dark":"orange-light-to-dark","Partial Spectrum":"partial-spectrum","Partial Spectrum 1 Diverging":"partial-spectrum-1-diverging","Partial Spectrum 2 Diverging":"partial-spectrum-2-diverging","Pink to YellowGreen Diverging, Bright":"pink-to-yellow-green-diverging-bright","Pink to YellowGreen Diverging, Dark":"pink-to-yellow-green-diverging-dark",Precipitation:"precipitation",Prediction:"prediction","Purple Bright":"purple-bright","Purple to Green Diverging, Bright":"purple-to-green-diverging-bright","Purple to Green Diverging, Dark":"purple-to-green-diverging-dark","Purple-Blue Bright":"purple-blue-bright","Purple-Blue Light to Dark":"purple-blue-light-to-dark","Purple-Red Bright":"purple-red-bright","Purple-Red Light to Dark":"purple-red-light-to-dark","Red Bright":"red-bright","Red Light to Dark":"red-light-to-dark","Red to Blue Diverging, Bright":"red-to-blue-diverging-bright","Red to Blue Diverging, Dark":"red-to-blue-diverging-dark","Red to Green":"red-to-green","Red to Green Diverging, Bright":"red-to-green-diverging-bright","Red to Green Diverging, Dark":"red-to-green-diverging-dark",Slope:"slope","Spectrum-Full Bright":"spectrum-full-bright","Spectrum-Full Dark":"spectrum-full-dark","Spectrum-Full Light":"spectrum-full-light",Surface:"surface",Temperature:"temperature","White to Black":"white-to-black","Yellow to Dark Red":"yellow-to-dark-red","Yellow to Green to Dark Blue":"yellow-to-green-to-dark-blue","Yellow to Red":"yellow-to-red","Yellow-Green Bright":"yellow-green-bright","Yellow-Green Light to Dark":"yellow-green-light-to-dark"});function Fe(e,t){if(!e||!t||e.length!==t.length)return!1;for(let r=0;rt[r]+2||e[r]Ot(o))),r}return Ot(e)}function Dt(e,t){if(!e)return;const r=t??or;let o=null;return e.type==="algorithmic"?r.some(u=>{if(Fe(e.fromColor.toRgb(),u.fromColor)&&Fe(e.toColor.toRgb(),u.toColor))return o=u.id,!0}):e.type==="multipart"&&r.some(u=>{const i=e.colorRamps,f=u.colorRamps;if(i&&f&&i.length===f.length&&!f.some((n,s)=>{if(!Fe(i[s].fromColor.toRgb(),new bt(n.fromColor).toRgb())||!Fe(i[s].toColor.toRgb(),new bt(n.toColor).toRgb()))return!0})){if(o)return!0;o=u.id}}),o}function yo(e,t,r=!1){if(!e)return;let o=!1,u=Dt(e,t);return u!=null||r||(o=!0,u=Dt(e=go(e),t)),u?{id:u,inverted:o}:void 0}function Co(e,t=!1){var o;const r=typeof e=="string"?e:(o=yo(e,void 0,t))==null?void 0:o.id;return r?mo.toJSON(r):null}function Ho(e,t="esriCIELabAlgorithm"){const r=or.find(({id:o})=>o===e);return r?r.colorRamps?{type:"multipart",colorRamps:r.colorRamps.map(o=>({type:"algorithmic",algorithm:t,fromColor:[...o.fromColor],toColor:[...o.toColor]}))}:{type:"algorithmic",algorithm:t,fromColor:[...r.fromColor],toColor:[...r.toColor]}:null}function nr(e){const t=(e=e||{}).numColors||256,r=e.distanceOffset||0,o=e.isCustomInterval!=null?e.isCustomInterval:e.distanceInterval!==null&&e.distanceInterval!==1/(t-1),u=e.distanceInterval||1/(t-1);return{...e,numColors:t,distanceOffset:r,interpolateAlpha:!!e.interpolateAlpha,distanceInterval:u,isCustomInterval:o,weights:e.weights}}function bo(e,t,r){const{numColors:o,distanceOffset:u,distanceInterval:i,isCustomInterval:f}=r,n=e.s===0,s=t.s===0;let l=e.h,a=t.h;n&&!s?l=a:s&&!n&&(t={...t,h:l},a=l);let c,d=Math.abs(a-l);const C=360;da?d*i:-d*i);const y=(t.s-e.s)*i,b=(t.v-e.v)*i;let{s:S,v:h}=e,p=l;if(u){const g=u/i;p=(p+g*c+C)%C,S+=g*y,h+=g*b}const m=[];for(let g=0;gd+C);u=u.map(d=>d/c)}else{u=[];for(let c=0;c{u.unshift(i),o||u.pop()}),r}function Gt(e){const t=_e(e);return{type:"HsvColor",Hue:t.h,Saturation:t.s,Value:t.v,AlphaValue:255}}function Nt(e){const t=e.toJSON();return{Algorithm:(t==null?void 0:t.Algorithm)||"esriHSVAlgorithm",type:"AlgorithmicColorRamp",FromColor:Gt(e.fromColor),ToColor:Gt(e.toColor)}}function Ko(e){const t=Co(e);if(!t)return null;if(e.type==="algorithmic")return{...Nt(e),Name:t};if(e.colorRamps){const r=e.colorRamps.map(Nt);return{type:"MultiPartColorRamp",NumColorRamps:r.length,ArrayOfColorRamp:r,Name:t}}return null}function qo(e){const t=e.reverse().map(r=>{const o=r.toString(16);return o.length<2?"0"+o:o});return 4294967295&Number.parseInt(t.join(""),16)}const Jo=new Vt({none:"none",standardDeviation:"standard-deviation",histogramEqualization:"histogram-equalization",minMax:"min-max",percentClip:"percent-clip",sigmoid:"sigmoid"}),ko={0:"none",3:"standardDeviation",4:"histogramEqualization",5:"minMax",6:"percentClip",9:"sigmoid"},Ze=1,Io=[.299,.587,.114];function ar(e,t=256){t=Math.min(t,256);const{size:r,counts:o}=e,u=new Uint8Array(r),i=o.reduce((a,c)=>a+c/t,0);let f=0,n=0,s=0,l=i;for(let a=0;a=s){const w=sr(s,o);for(l=0;l1&&(m-=(1/b)**(S*w[l])),pt[l]){const k=m*b*S**(1/o[l])+f;g[a]=i==="floor"?Math.floor(k):i==="round"?Math.round(k):k}else p>=r[l]?g[a]=n:g[a]=f;else g[a]=f;h[l]=g}}else for(l=0;l=r[l])g[a]=n;else{const w=(p-t[l])*C[l]+f;g[a]=i==="floor"?Math.floor(w):i==="round"?Math.round(w):w}h[l]=g}if(e.contrastOffset!=null){const w=xo(e.contrastOffset,e.brightnessOffset);for(l=0;l0&&r<100?n=(200*f-100*u+2*u*o)/(2*(100-r))+i:r<=0&&r>-100?n=(200*f-100*u+2*u*o)*(100+r)/2e4+i:r===100?(n=200*f-100*u+(u+1)*(100-r)+2*u*o,n=n>0?u:0):r===-100&&(n=i),s[f]=n>u?u:n<0?0:n;return s}function Ao(e,t,r){const o=[];for(let u=0;u=255)return Ze;let t=0;e!==150&&(t=e<=150?45*Math.cos(.01047*e):17*Math.sin(.021*e));const r=255,o=e+t,u=Math.log(e/r),i=Math.log(o/r);if(i===0)return Ze;const f=u/i;return isNaN(f)?Ze:Math.min(9.9,Math.max(.01,f))}function Po(e,t,r,o){let u=1/0,i=-1/0,f=0,n=0,s=0,l=0;const a=e.length,c=new Map,d=[];for(let v=0;vl&&(l=T,s=I),u=Ii?I:i,f+=I,n++}}if(n===0)return{statistics:{min:0,max:0,avg:0,stddev:0,mode:0,median:0},histogram:null};const C=f/n;let y=0;for(let v=0;vv).length:a,S=b<=1?0:Math.sqrt(y/(b-1));d.sort((v,I)=>v-I);const h=n>>>1,p={min:u,max:i,avg:C,stddev:S,mode:s,median:n%2?d[Math.floor(h)]:(d[h-1]+d[h])/2};if(!o)return{statistics:p,histogram:null};if(["u8","s8","u4","u2","u1"].includes(r)){const v=i-u+1,I=new Uint32Array(v);for(let T=0;TPo(f,(u==null?void 0:u[n])??r,o,!0));return{statistics:i.map(({statistics:f})=>f),histograms:i.map(({histogram:f})=>f)}}function Ro(e){var y;if(!((y=e==null?void 0:e.pixels)!=null&&y.length))return null;const{pixels:t,mask:r,bandMasks:o,pixelType:u}=e,i=e.width*e.height,f=t.length,n=[],s=[],l=256;let a,c,d,C;for(let b=0;bc?P:c,d[P]++}}else for(let A=0;Ac?P:c,d[P]++}d=d.slice(a,c+1)}else{let A=!1;e.statistics||(e.updateStatistics(),A=!0);const P=e.statistics;a=P[b].minValue,c=P[b].maxValue;const O=(c-a)/l;if(O===0){!P||e.validPixelCount||A||e.updateStatistics();const R=(e.validPixelCount||e.width*e.height)/l;for(let N=0;N[x.minValue,x.maxValue,0,0]);else{const x=Ro(r);f=x!=null?x.statistics:null,n=x!=null?x.histograms:null}else f=(E=e.statistics)!=null&&E.length?e.statistics:i.statistics,n="histograms"in e?e.histograms:void 0,n||(n=i.histograms);s!=="percentClip"&&s!=="histogramEqualization"||n!=null&&n.length||(s="minMax");const l=(f==null?void 0:f.length)||(n==null?void 0:n.length)||i.bandCount,a=[],c=[];let d,C,y,b,S,h,p,m,g;f&&!Array.isArray(f[0])&&(f=f.map(x=>[x.min,x.max,x.avg,x.stddev]));const[w,k]=br(i.pixelType);if(!(f!=null&&f.length)){for(f=[],m=0;mA[1]&&(c[m]=A[1])}}break;case"histogramEqualization":for($e(n),m=0;m=20&&(b[0]=b[1]=b[2]=b[b.length-1]=b[b.length-2]=0),y=0,C=(d.max-d.min)/d.size,p=d.min===-.5&&C===1?.5:0,g=0;gh){a[m]=d.min+C*(g+p);break}for(h=(1-(e.maxPercent||0)/100)*y,c[m]=d.max+p,g=d.size-2;g>=0;g--)if(S[g]ar(x)))):(I=e.max||255,v=e.min||0),Mo({minCutOff:a,maxCutOff:c,outMax:I,outMin:v,histogramLut:T},o)}function Mo(e,t){if(t==null||t.length===0)return e;const r=Math.max.apply(null,t),{minCutOff:o,maxCutOff:u,outMin:i,outMax:f,histogramLut:n}=e;return o.length===t.length||o.length<=r?e:{minCutOff:t.map(s=>o[s]),maxCutOff:t.map(s=>u[s]),histogramLut:n?t.map(s=>n[s]):null,outMin:i,outMax:f}}function sr(e,t){const r=new Float32Array(e);for(let o=0;o1?t[o]>2?r[o]=6.5+(t[o]-2)**2.5:r[o]=6.5+100*(2-t[o])**4:r[o]=1;return r}function Qe(e,t){var v;if(!((v=e==null?void 0:e.pixels)!=null&&v.length))return e;const{mask:r,bandMasks:o,width:u,height:i,pixels:f}=e,{minCutOff:n,maxCutOff:s,gamma:l}=t,a=t.outMin||0,c=t.outMax||255,d=u*i,C=t.outputPixelType||"u8",y=e.pixels.map(()=>ee.createEmptyBand(C,d)),b=y.length,S=c-a,h=[],p=[];for(let I=0;I=b,w=!!t.isRenderer;if(g){const I=sr(b,l);for(let T=0;T1&&(O-=(1/S)**(P*I[T])),An[T]){const R=O*S*P**(1/l[T])+a;y[T][x]=w?Math.floor(R):m?Math.round(R):R}else A>=s[T]?y[T][x]=c:y[T][x]=a}}}else for(let I=0;In[I]){const A=(x-n[I])*h[I]+a;y[I][E]=w?Math.floor(A):m?Math.round(A):A}else x>=s[I]?y[I][E]=c:y[I][E]=a}}const k=new ee({width:u,height:i,mask:r,bandMasks:o,pixels:y,pixelType:C});return k.updateStatistics(),k}function Lo(e){var t,r,o;return["u8","s8"].includes(e.pixelType)&&((r=(t=e.statistics)==null?void 0:t[0])==null?void 0:r.min)!=null&&((o=e.statistics[0])==null?void 0:o.max)!=null&&e.bandCount===1}function Oo(e,t){const{attributeTable:r,bandCount:o}=e;return r==null&&Lo(e)?!0:!(r==null||o>1||t&&r.fields.find(u=>u.name.toLowerCase()===t.toLowerCase())==null)}function Do(e){const{bandCount:t,dataType:r,pixelType:o}=e;return r==="elevation"||r==="generic"&&t===1&&(o==="s16"||o==="s32"||o==="f32"||o==="f64")}function Uo(e,t=!1){const{bandCount:r,colormap:o,pixelType:u}=e;return r===1&&(!!(o!=null&&o.length)||!t&&u==="u8")}function Zo(e,t=!1){const{attributeTable:r,bandCount:o}=e;return o===1&&(!t||r!=null||e.histograms!=null)}function Qo(e){const{dataType:t}=e;return t==="vector-uv"||t==="vector-magdir"}function en(e){const{dataType:t}=e;return t==="vector-uv"||t==="vector-magdir"}let we=class extends De{constructor(e){super(e)}bind(){const{rendererJSON:e}=this;if(!e)return{success:!1};let t;switch(this.lookup={rendererJSON:{}},e.type){case"uniqueValue":t=this._updateUVRenderer(e);break;case"rasterColormap":t=this._updateColormapRenderer(e);break;case"rasterStretch":t=this._updateStretchRenderer(e);break;case"classBreaks":t=this._updateClassBreaksRenderer(e);break;case"rasterShadedRelief":t=this._updateShadedReliefRenderer(e);break;case"vectorField":t=this._updateVectorFieldRenderer();break;case"flowRenderer":t=this._updateFlowRenderer()}return t}symbolize(e){let t=e==null?void 0:e.pixelBlock;if(!Ft(t))return t;if(e.simpleStretchParams&&this.rendererJSON.type==="rasterStretch")return this.simpleStretch(t,e.simpleStretchParams);try{let r;switch(t.pixels.length>3&&(t=t.extractBands(e.bandIds??[0,1,2])),this.rendererJSON.type){case"uniqueValue":case"rasterColormap":r=this._symbolizeColormap(t);break;case"classBreaks":r=this._symbolizeClassBreaks(t);break;case"rasterStretch":r=this._symbolizeStretch(t,e.bandIds);break;case"rasterShadedRelief":{const o=e.extent,u=o.spatialReference.isGeographic,i={x:(o.xmax-o.xmin)/t.width,y:(o.ymax-o.ymin)/t.height};r=this._symbolizeShadedRelief(t,{isGCS:u,resolution:i});break}}return r}catch(r){return wt.getLogger(this).error("symbolize",r.message),t}}simpleStretch(e,t){if(!Ft(e))return e;try{return e.pixels.length>3&&(e=e.extractBands([0,1,2])),Qe(e,{...t,isRenderer:!0})}catch(r){return wt.getLogger(this).error("symbolize",r.message),e}}generateWebGLParameters(e){if(["uniqueValue","rasterColormap","classBreaks"].includes(this.rendererJSON.type)){const{indexedColormap:f,offset:n}=this.lookup.colormapLut||{};return{colormap:f,colormapOffset:n,type:"lut"}}const{pixelBlock:t,isGCS:r,resolution:o,bandIds:u}=e,{rendererJSON:i}=this;return i.type==="rasterStretch"?this._generateStretchWebGLParams(t,i,u):i.type==="rasterShadedRelief"?this._generateShadedReliefWebGLParams(i,r,o??void 0):i.type==="vectorField"?this._generateVectorFieldWebGLParams(i):null}_isLUTChanged(e){if(!this.lookup||!this.lookup.rendererJSON)return!0;if("colorRamp"in this.rendererJSON){const t=this.rendererJSON.colorRamp;return e?JSON.stringify(t)!==JSON.stringify(this.lookup.rendererJSON.colorRamp):(this.rendererJSON,this.lookup.rendererJSON,JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON))}return JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON)}_symbolizeColormap(e){return this._isLUTChanged()&&!this.bind().success?e:qe(e,this.lookup.colormapLut)}_symbolizeClassBreaks(e){const{canUseIndexedLUT:t}=this._analyzeClassBreaks(this.rendererJSON);return this._isLUTChanged()&&!this.bind().success?e:t?qe(e,this.lookup.colormapLut):wr(e,this.lookup.remapLut??[])}_symbolizeStretch(e,t){var c,d;const{rasterInfo:r}=this,{pixelType:o,bandCount:u}=r,i=this.rendererJSON,f=["u8","u16","s8","s16"].includes(o);let n,s;const{dra:l}=i,{gamma:a}=this.lookup;if(i.stretchType==="histogramEqualization"){const C=l?null:(c=this.lookup)==null?void 0:c.histogramLut,y=Le(i,{rasterInfo:r,pixelBlock:e,bandIds:t,returnHistogramLut:!C}),b=Qe(e,{...y,gamma:a,isRenderer:!0});s=vt(b,{lut:l?y.histogramLut:C,offset:0})}else if(f){if(l){const C=Le(i,{rasterInfo:r,pixelBlock:e,bandIds:t});n=Bt({pixelType:o,...C,gamma:a,rounding:"floor"})}else if(this._isLUTChanged()){if(!this.bind().success)return e;n=this.lookup?this.lookup.stretchLut:null}else n=this.lookup?this.lookup.stretchLut:null;if(!n)return e;u>1&&t!=null&&t.length===(e==null?void 0:e.pixels.length)&&(n==null?void 0:n.lut.length)===u&&(n={lut:t.map(C=>n.lut[C]),offset:n.offset}),s=vt(e,n)}else{const C=Le(i,{rasterInfo:r,pixelBlock:e,bandIds:t});s=Qe(e,{...C,gamma:a,isRenderer:!0})}if(i.colorRamp){if(this._isLUTChanged(!0)&&!this.bind().success)return e;s=qe(s,(d=this.lookup)==null?void 0:d.colormapLut)}return s}_symbolizeShadedRelief(e,t){var n;const r=this.rendererJSON,o={...r,...t},u=fo(e,o);if(!r.colorRamp)return u;let i;if(this._isLUTChanged(!0)){if(!this.bind().success)return u;i=this.lookup?this.lookup.hsvMap:null}else i=this.lookup?this.lookup.hsvMap:null;if(!i)return u;const f=((n=this.rasterInfo.statistics)==null?void 0:n[0])??{min:0,max:8e3};return po(u,e,i,f),u}_isVectorFieldData(){const{bandCount:e,dataType:t}=this.rasterInfo;return e===2&&(t==="vector-magdir"||t==="vector-uv")}_updateVectorFieldRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; VectorFieldRenderer only supports "vector-magdir" and "vector-uv".`}}_updateFlowRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; FlowRenderer only supports "vector-magdir" and "vector-uv".`}}_updateUVRenderer(e){var l;const{bandCount:t,attributeTable:r,pixelType:o}=this.rasterInfo,u=e.field1;if(!u)return{success:!1,error:"Unsupported renderer; missing UniqueValueRenderer.field."};const i=e.defaultSymbol,f=t===1&&["u8","s8"].includes(o);if(!Oo(this.rasterInfo,u)&&!f)return{success:!1,error:"Unsupported data; UniqueValueRenderer is only supported on single band data with a valid raster attribute table."};const n=[];if(r!=null){const a=r.fields.find(c=>c.name.toLowerCase()==="value");if(!a)return{success:!1,error:"Unsupported data; the data's raster attribute table does not have a value field."};r.features.forEach(c=>{var y,b;const d=(y=e.uniqueValueInfos)==null?void 0:y.find(S=>String(S.value)===String(c.attributes[u])),C=(b=d==null?void 0:d.symbol)==null?void 0:b.color;C?n.push([c.attributes[a.name]].concat(C)):i&&n.push([c.attributes[a.name]].concat(i.color))})}else{if(u.toLowerCase()!=="value")return{success:!1,error:'Unsupported renderer; UniqueValueRenderer.field must be "Value" when raster attribute table is not availalbe.'};(l=e.uniqueValueInfos)==null||l.forEach(a=>{var d;const c=(d=a==null?void 0:a.symbol)==null?void 0:d.color;c?n.push([parseInt(""+a.value,10)].concat(c)):i&&n.push([parseInt(""+a.value,10)].concat(i==null?void 0:i.color))})}if(n.length===0)return{success:!1,error:"Invalid UniqueValueRenderer. Cannot find matching records in the raster attribute table."};const s=Re({colormap:n});return this.lookup={rendererJSON:e,colormapLut:s},this.canRenderInWebGL=this._isColormapSupportedByWebGL(s==null?void 0:s.indexedColormap),{success:!0}}_updateColormapRenderer(e){if(!Uo(this.rasterInfo))return{success:!1,error:"Unsupported data; the data source does not have a colormap."};const t=e.colormapInfos.map(o=>[o.value].concat(o.color)).sort((o,u)=>o[0]-u[0]);if(!t||t.length===0)return{success:!1,error:"Unsupported renderer; ColormapRenderer must have meaningful colormapInfos."};const r=Re({colormap:t});return this.lookup={rendererJSON:e,colormapLut:r},this.canRenderInWebGL=this._isColormapSupportedByWebGL(r==null?void 0:r.indexedColormap),{success:!0}}_updateShadedReliefRenderer(e){if(!Do(this.rasterInfo))return{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; ShadedReliefRenderer only supports "elevation", or single band float/s16 data.`};if(e.colorRamp){const t=Ut(e.colorRamp,{interpolateAlpha:!0}),r=Re({colormap:t}),o=[],u=r.indexedColormap;for(let i=0;if.name.toLowerCase()==="value"):null,u=t!=null?t.fields.find(f=>f.name.toLowerCase()===e.field.toLowerCase()):null,i=o!=null&&u!==null;return{canUseIndexedLUT:["u8","u16","s8","s16"].includes(r)||i,tableValueField:o,tableBreakField:u}}_updateClassBreaksRenderer(e){const{attributeTable:t}=this.rasterInfo,{canUseIndexedLUT:r,tableValueField:o,tableBreakField:u}=this._analyzeClassBreaks(e),i=e.classBreakInfos;if(!(i!=null&&i.length))return{success:!1,error:"Unsupported renderer; missing or invalid ClassBreaksRenderer.classBreakInfos."};const f=i.sort((c,d)=>c.classMaxValue-d.classMaxValue),n=f[f.length-1];let s=e.minValue;if(!r){const c=[];for(let d=0;dm>h);p&&l.push([S].concat(p.symbol.color))}}else{s=Math.floor(e.minValue);for(let c=0;c0&&e[0].min!=null&&e[0].max!=null}_updateStretchRenderer(e){var a,c;let{stretchType:t,dra:r}=e;if(!(t==="none"||(a=e.statistics)!=null&&a.length||this._isValidRasterStatistics(this.rasterInfo.statistics)||r))return{success:!1,error:"Unsupported renderer; StretchRenderer.statistics is required when dynamic range adjustment is not used."};const o=e.histograms||this.rasterInfo.histograms;!this._isHistogramRequired(e.stretchType)||o!=null&&o.length||r||(t="minMax");const{computeGamma:u,useGamma:i,colorRamp:f}=e;let{gamma:n}=e;if(i&&u&&!(n!=null&&n.length)){const d=(c=e.statistics)!=null&&c.length?e.statistics:this.rasterInfo.statistics;n=Ao(this.rasterInfo.pixelType,d)}const s=this.rasterInfo.pixelType,l=!r&&["u8","u16","s8","s16"].includes(s);if(t==="histogramEqualization"){const d=o.map(C=>ar(C));this.lookup={rendererJSON:e,histogramLut:d}}else if(l){const d=Le(e,{rasterInfo:this.rasterInfo}),C=Bt({pixelType:s,...d,gamma:i?n:null,rounding:"floor"});this.lookup={rendererJSON:e,stretchLut:C}}if(f&&!this._isStretchColorRampNoop(f)){const d=Ut(f,{interpolateAlpha:!0});this.lookup||(this.lookup={rendererJSON:e}),this.lookup.colormapLut=Re({colormap:d}),this.lookup.rendererJSON=e}return this.lookup.gamma=i&&(n!=null&&n.length)?n:null,this.canRenderInWebGL=!0,{success:!0}}_isStretchColorRampNoop(e){return e.type==="algorithmic"&&["0,0,0,255","0,0,0"].includes(e.fromColor.join(","))&&["255,255,255,255","255,255,255"].includes(e.toColor.join(","))}_generateStretchWebGLParams(e,t,r){var m;let o=null,u=null;const i=(m=this.lookup)==null?void 0:m.colormapLut;t.colorRamp&&i&&(o=i.indexedColormap,u=i.offset),t.stretchType==="histogramEqualization"&&(t={...t,stretchType:"minMax"});const{gamma:f}=this.lookup,n=!!(t.useGamma&&f&&f.some(g=>g!==1)),{minCutOff:s,maxCutOff:l,outMin:a,outMax:c}=Le(t,{rasterInfo:this.rasterInfo,pixelBlock:e,bandIds:r});let d=0;e!=null&&(d=e.getPlaneCount(),d===2&&((e=e.clone()).statistics=[e.statistics[0]],e.pixels=[e.pixels[0]]));const{bandCount:C}=this.rasterInfo,y=Math.min(3,(r==null?void 0:r.length)||d||C,C),b=new Float32Array(y),S=o||n?1:255;let h;for(h=0;h1?f[h]>2?p[h]=6.5+(f[h]-2)**2.5:p[h]=6.5+100*(2-f[h])**4:p[h]=1;return{bandCount:y,outMin:a/S,outMax:c/S,minCutOff:s,maxCutOff:l,factor:b,useGamma:n,gamma:n?f:[1,1,1],gammaCorrection:n?p:[1,1,1],colormap:o,colormapOffset:u,stretchType:t.stretchType,type:"stretch"}}_generateShadedReliefWebGLParams(e,t=!1,r={x:0,y:0}){var l,a;let o=null,u=null;const i=(l=this.lookup)==null?void 0:l.colormapLut;e.colorRamp&&i&&(o=i.indexedColormap,u=i.offset);const f={...e,isGCS:t,resolution:r},n=rr(f),s=(a=this.rasterInfo.statistics)==null?void 0:a[0];return{...n,minValue:(s==null?void 0:s.min)??0,maxValue:(s==null?void 0:s.max)??8e3,hillshadeType:e.hillshadeType==="traditional"?0:1,type:"hillshade",colormap:o,colormapOffset:u}}_generateVectorFieldWebGLParams(e){var h,p,m;const{style:t,inputUnit:r,outputUnit:o,visualVariables:u,symbolTileSize:i,flowRepresentation:f}=e;let n;const s=((h=this.rasterInfo.statistics)==null?void 0:h[0].min)??0,l=((p=this.rasterInfo.statistics)==null?void 0:p[0].max)??50,a=(u==null?void 0:u.find(g=>g.type==="sizeInfo"))??{type:"sizeInfo",field:"Magnitude",maxDataValue:l,maxSize:.8*i,minDataValue:s,minSize:.2*i},c=a.minDataValue??s,d=a.maxDataValue??l,C=a.maxSize!=null&&a.minSize!=null?[a.minSize/i,a.maxSize/i]:[.2,.8];if(t==="wind_speed"){const g=(C[0]+C[1])/2;C[0]=C[1]=g}const y=c!=null&&d!=null?[c,d]:null;if(t==="classified_arrow")if(c!=null&&d!=null&&a!=null){n=[];const g=(a.maxDataValue-a.minDataValue)/5;for(let w=0;w<6;w++)n.push(a.minDataValue+g*w)}else n=[0,1e-6,3.5,7,10.5,14];const b=f==="flow_to"==(t==="ocean_current_kn"||t==="ocean_current_m")?0:Math.PI,S=u==null?void 0:u.find(g=>g.type==="rotationInfo");return{breakValues:n,dataRange:y,inputUnit:r,outputUnit:o,symbolTileSize:i,symbolPercentRange:C,style:t||"single_arrow",rotation:b,rotationType:(m=this.rasterInfo.storageInfo)!=null&&m.tileInfo&&this.rasterInfo.dataType==="vector-uv"?"geographic":(S==null?void 0:S.rotationType)||e.rotationType,type:"vectorField"}}};function Ft(e){return Se(e)&&e.validPixelCount!==0}D([B({json:{write:!0}})],we.prototype,"rendererJSON",void 0),D([B({type:ho,json:{write:!0}})],we.prototype,"rasterInfo",void 0),D([B({json:{write:!0}})],we.prototype,"lookup",void 0),D([B()],we.prototype,"canRenderInWebGL",void 0),we=D([Oe("esri.renderers.support.RasterSymbolizer")],we);const tn=we;export{qo as A,Wr as B,Wo as C,We as D,zo as E,zr as F,Ko as G,_o as H,Le as I,Bt as J,sr as K,tn as L,Qe as M,Zt as N,$o as P,pt as R,Vo as S,Xt as U,ho as a,ft as b,Ae as c,Vr as d,Ut as e,Jo as f,Xo as g,Ro as h,ko as i,or as j,Zo as k,Do as l,Yo as m,co as n,Qo as o,en as p,Co as q,Pr as r,jo as s,Oo as t,Uo as u,mo as v,To as w,Ho as x,xo as y,xe as z}; diff --git a/assets/RasterVFDisplayObject-boi924Q6.js b/assets/RasterVFDisplayObject-DLrowEg_.js similarity index 98% rename from assets/RasterVFDisplayObject-boi924Q6.js rename to assets/RasterVFDisplayObject-DLrowEg_.js index 61df0a3..108738f 100644 --- a/assets/RasterVFDisplayObject-boi924Q6.js +++ b/assets/RasterVFDisplayObject-DLrowEg_.js @@ -1 +1 @@ -import{bh as z,iv as v,g5 as p,at as W,g4 as w,g3 as E,fX as A,v as mt,D as pt,eO as F,hf as Y,s as tt,gz as G,ju as ft,f_ as j,eI as I,eK as et,d as f,y,f as at,a7 as st,b as _t,aA as yt,aE as gt,g as O,j as vt,iS as L,eH as wt,eJ as P,eL as xt,eM as St}from"./index-CEWggaxV.js";import{h as D}from"./Program-DLRmaKpw.js";import{e as bt,m as At}from"./Texture-DJgkMrSB.js";import{o as k}from"./ProgramTemplate-BICQrNzS.js";import{g as B,b as Z,_ as J}from"./dataUtils-BFJflGP5.js";import{t as it,n as Dt}from"./WGLContainer-B_Pv-8Yi.js";import{E as Mt,i as rt}from"./Container-CB7SlLB9.js";import{b as Rt}from"./LabelMetric-D2hbzzy_.js";function zt(s){const t=ot(q(s)),e=t,a=!0,i=Math.max(t/2,5),r=Math.round(z(s.maxPathLength)/i)+1,o=10,{density:n}=s;return{smoothing:z(s.smoothing),interpolate:!0,velocityScale:s.flowRepresentation==="flow-from"?1:-1,verticesPerLine:r,minSpeedThreshold:.001,segmentLength:i,maxTurnAngle:1,collisions:a,lineCollisionWidth:e,lineSpacing:o,density:n}}function ot(s){return s.kind==="constant"?s.value[0]:s.values[s.values.length-1]}function K(s){const t=s.toRgba();return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function $t(s){return{kind:"constant",value:[.1,.1,.1,1]}}function q(s){if(!s.hasVisualVariables("size"))return{kind:"constant",value:[z(s.trailWidth)]};const t=s.getVisualVariablesForType("size")[0],e=[],a=[];let i;if(t.stops){for(const r of t.stops)e.push(r.value),a.push(z(r.size));i=t.stops.length}else e.push(t.minDataValue,t.maxDataValue),a.push(z(t.minSize),z(t.maxSize)),i=2;return{kind:"ramp",stops:e,values:a,count:i}}function Vt(s){if(!s.hasVisualVariables("color"))return{kind:"constant",value:K(s.color)};const t=s.getVisualVariablesForType("color")[0],e=[],a=[];for(const i of t.stops)e.push(i.value),Array.prototype.push.apply(a,K(i.color));return{kind:"ramp",stops:e,values:a,count:t.stops.length}}function Tt(s){if(!s.hasVisualVariables("opacity"))return{kind:"constant",value:[1]};const t=s.getVisualVariablesForType("opacity")[0],e=[],a=[];for(const i of t.stops)e.push(i.value),a.push(i.opacity);return{kind:"ramp",stops:e,values:a,count:t.stops.length}}function N(s,t,e,a){switch(t){case"int":s.setUniform1iv(e,a);break;case"float":s.setUniform1fv(e,a);break;case"vec2":s.setUniform2fv(e,a);break;case"vec3":s.setUniform3fv(e,a);break;case"vec4":s.setUniform4fv(e,a)}}function b(s,t,e,a){a.kind==="constant"?N(s,e,`u_${t}`,a.value):(N(s,"float",`u_${t}_stops`,a.stops),N(s,e,`u_${t}_values`,a.values),s.setUniform1i(`u_${t}_count`,a.count))}function Et(s,t){let e=!0;return e=e&&s.collisions===t.collisions,e=e&&s.density===t.density,e=e&&s.interpolate===t.interpolate,e=e&&s.lineCollisionWidth===t.lineCollisionWidth,e=e&&s.lineSpacing===t.lineSpacing,e=e&&s.maxTurnAngle===t.maxTurnAngle,e=e&&s.minSpeedThreshold===t.minSpeedThreshold,e=e&&s.segmentLength===t.segmentLength,e=e&&s.smoothing===t.smoothing,e=e&&s.velocityScale===t.velocityScale,e=e&&s.verticesPerLine===t.verticesPerLine,e}function nt(s,t){return s===t||s!=null&&t!=null&&s.equals(t)}function lt(s,t){if(!Et(s.simulationSettings,t.simulationSettings)||!nt(s.timeExtent,t.timeExtent))return!1;let e=!0;return e=e&&s.loadImagery===t.loadImagery,e=e&&s.createFlowMesh===t.createFlowMesh,e=e&&s.color.kind===t.color.kind,e=e&&s.opacity.kind===t.opacity.kind,e=e&&s.size.kind===t.size.kind,e}let Ot=class ct{constructor(t){this._params=t,this.animated=!1}isCompatible(t){if(!(t instanceof ct)||!nt(this._params.timeExtent,t._params.timeExtent))return!1;let e=!0;return e=e&&this._params.loadImagery===t._params.loadImagery,e=e&&this._params.color.kind===t._params.color.kind,e=e&&this._params.opacity.kind===t._params.opacity.kind,e}async load(t,e){const{extent:a,size:i}=t;W(e);const r=await this._params.loadImagery(a,i[0],i[1],this._params.timeExtent,e);return new It(r,{color:this._params.color,opacity:this._params.opacity})}render(t,e,a){const{context:i}=t,{program:r}=a;i.setFaceCullingEnabled(!1),i.setBlendingEnabled(!0),i.setBlendFunction(w.ONE,w.ONE_MINUS_SRC_ALPHA),i.useProgram(r),r.setUniformMatrix3fv("u_dvsMat3",e.dvsMat3),i.bindTexture(a.texture,0),r.setUniform1i("u_texture",0),r.setUniform1f("u_Min",a.min),r.setUniform1f("u_Max",a.max),b(r,"color","vec4",this._params.color),b(r,"opacity","float",this._params.opacity),i.bindVAO(a.vertexArray),i.drawArrays(E.TRIANGLE_STRIP,0,4)}};const C=new Map;C.set("a_position",0),C.set("a_texcoord",1);const Pt={geometry:[new v("a_position",2,p.UNSIGNED_SHORT,0,8),new v("a_texcoord",2,p.UNSIGNED_SHORT,4,8)]},Ut={vsPath:"raster/flow/imagery",fsPath:"raster/flow/imagery",attributes:C};class It{constructor(t,e){this._flowData=t,this._values=e}attach(t){const{context:e}=t,{width:a,height:i}=this._flowData,r=D.createVertex(e,A.STATIC_DRAW,new Uint16Array([0,0,0,1,a,0,1,1,0,i,0,0,a,i,1,0])),o=new k(e,C,Pt,{geometry:r}),n=[];this._values.color.kind==="ramp"&&n.push("vvColor"),this._values.opacity.kind==="ramp"&&n.push("vvOpacity");const c=t.painter.materialManager.getProgram(Ut,n);let h=1e6,m=-1e6;for(let d=0;d0}isCompatible(t){return t instanceof ht&<(this._params,t._params)}async load(t,e){const{extent:a,size:i}=t;W(e);const r=await this._params.loadImagery(a,i[0],i[1],this._params.timeExtent,e),{vertexData:o,indexData:n}=await this._params.createFlowMesh("Particles",this._params.simulationSettings,r,e);return new Lt(o,n,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(t,e,a){const{context:i}=t,{program:r}=a;i.setFaceCullingEnabled(!1),i.setBlendingEnabled(!0),i.setBlendFunction(w.ONE,w.ONE_MINUS_SRC_ALPHA),i.useProgram(r),r.setUniform1f("u_time",e.time),r.setUniform1f("u_trailLength",this._params.trailLength),r.setUniform1f("u_flowSpeed",this._params.flowSpeed),r.setUniform1f("u_featheringSize",this._params.featheringSize),r.setUniform1f("u_featheringOffset",this._params.featheringOffset),r.setUniform1f("u_introFade",this._params.introFade?1:0),r.setUniform1f("u_fadeToZero",this._params.fadeToZero?1:0),r.setUniform1f("u_decayRate",this._params.decayRate),r.setUniformMatrix3fv("u_dvsMat3",e.dvsMat3),r.setUniformMatrix3fv("u_displayViewMat3",e.displayViewMat3),b(r,"color","vec4",this._params.color),b(r,"opacity","float",this._params.opacity),b(r,"size","float",this._params.size),i.bindVAO(a.vertexArray),i.drawElements(E.TRIANGLES,a.indexCount,p.UNSIGNED_INT,0)}};const $=new Map;$.set("a_xyts0",0),$.set("a_xyts1",1),$.set("a_typeIdDurationSeed",2),$.set("a_extrudeInfo",3);const Ct={geometry:[new v("a_xyts0",4,p.FLOAT,0,64),new v("a_xyts1",4,p.FLOAT,16,64),new v("a_typeIdDurationSeed",4,p.FLOAT,32,64),new v("a_extrudeInfo",4,p.FLOAT,48,64)]},kt={vsPath:"raster/flow/particles",fsPath:"raster/flow/particles",attributes:$};let Lt=class{constructor(t,e,a){this._vertexData=t,this._indexData=e,this._values=a}attach(t){const{context:e}=t,a=D.createVertex(e,A.STATIC_DRAW,this._vertexData),i=D.createIndex(e,A.STATIC_DRAW,this._indexData),r=new k(e,$,Ct,{geometry:a},i),o=[];this._values.color.kind==="ramp"&&o.push("vvColor"),this._values.opacity.kind==="ramp"&&o.push("vvOpacity"),this._values.size.kind==="ramp"&&o.push("vvSize");const n=t.painter.materialManager.getProgram(kt,o);this.vertexArray=r,this.program=n,this.indexCount=this._indexData.length,this._vertexData=null,this._indexData=null}detach(){this.vertexArray.dispose()}get ready(){return this.program.compiled}},Nt=class dt{constructor(t){this._styles=t}get animated(){return this._styles.reduce((t,e)=>t||e.animated,!1)}isCompatible(t){if(!(t instanceof dt)||this._styles.length!==t._styles.length)return!1;const e=this._styles.length;for(let a=0;ai.load(t,e)));return new Gt(a)}render(t,e,a){for(let i=0;it&&e.ready,!0)}};class H{constructor(t){this._params=t}get animated(){return this._params.flowSpeed>0}isCompatible(t){return t instanceof H&<(this._params,t._params)}async load(t,e){const{extent:a,size:i}=t;W(e);const r=await this._params.loadImagery(a,i[0],i[1],this._params.timeExtent,e),{vertexData:o,indexData:n}=await this._params.createFlowMesh("Streamlines",this._params.simulationSettings,r,e);return new Ht(o,n,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(t,e,a){const{context:i}=t,{program:r}=a;i.setFaceCullingEnabled(!1),i.setBlendingEnabled(!0),i.setBlendFunction(w.ONE,w.ONE_MINUS_SRC_ALPHA),i.useProgram(r),r.setUniform1f("u_time",e.time),r.setUniform1f("u_trailLength",this._params.trailLength),r.setUniform1f("u_flowSpeed",this._params.flowSpeed),r.setUniform1f("u_featheringSize",this._params.featheringSize),r.setUniform1f("u_featheringOffset",this._params.featheringOffset),r.setUniform1f("u_introFade",this._params.introFade?1:0),r.setUniform1f("u_fadeToZero",this._params.fadeToZero?1:0),r.setUniform1f("u_decayRate",this._params.decayRate),r.setUniformMatrix3fv("u_dvsMat3",e.dvsMat3),r.setUniformMatrix3fv("u_displayViewMat3",e.displayViewMat3),b(r,"color","vec4",this._params.color),b(r,"opacity","float",this._params.opacity),b(r,"size","float",this._params.size),i.bindVAO(a.vertexArray),i.drawElements(E.TRIANGLES,a.indexCount,p.UNSIGNED_INT,0)}}const V=new Map;V.set("a_positionAndSide",0),V.set("a_timeInfo",1),V.set("a_extrude",2),V.set("a_speed",3);const qt={geometry:[new v("a_positionAndSide",3,p.FLOAT,0,36),new v("a_timeInfo",3,p.FLOAT,12,36),new v("a_extrude",2,p.FLOAT,24,36),new v("a_speed",1,p.FLOAT,32,36)]},Wt={vsPath:"raster/flow/streamlines",fsPath:"raster/flow/streamlines",attributes:V};let Ht=class{constructor(t,e,a){this._vertexData=t,this._indexData=e,this._values=a}attach(t){const{context:e}=t,a=D.createVertex(e,A.STATIC_DRAW,this._vertexData),i=D.createIndex(e,A.STATIC_DRAW,this._indexData),r=new k(e,V,qt,{geometry:a},i),o=[];this._values.color.kind==="ramp"&&o.push("vvColor"),this._values.opacity.kind==="ramp"&&o.push("vvOpacity"),this._values.size.kind==="ramp"&&o.push("vvSize");const n=t.painter.materialManager.getProgram(Wt,o);this.vertexArray=r,this.program=n,this.indexCount=this._indexData.length,this._vertexData=null,this._indexData=null}detach(){this.vertexArray.dispose()}get ready(){return this.program.compiled}};const jt=4,Bt=1,Zt=.5,Jt=!0,Kt=!0,Qt=2.3;function Xt(s,t){const{flowSpeed:e,trailLength:a}=s,i=zt(s);let r=null;const o={opacity:Tt(s),size:q(s)};let n=Vt(s);if(s.background==="none")o.color=n;else{n.kind==="constant"&&(n={kind:"ramp",stops:[0,1],values:[0,0,0,1,n.value[0],n.value[1],n.value[2],n.value[3]],count:2});const m={loadImagery:t.loadImagery,timeExtent:t.timeExtent,color:n,opacity:{kind:"constant",value:[1]}};r=new Ot(m),o.color=$t()}const c={loadImagery:t.loadImagery,createFlowMesh:t.createFlowMesh,simulationSettings:i,timeExtent:t.timeExtent,trailLength:a,flowSpeed:e,featheringSize:Bt,featheringOffset:Zt,introFade:Jt,fadeToZero:Kt,decayRate:Qt,color:o.color,opacity:o.opacity,size:o.size},h=s.trailCap==="butt"||ot(q(s))<=jt?new H(c):new Ft(c);return r!=null?new Nt([r,h]):h}class Yt extends it{constructor(){super(...arguments),this._visualState={time:0,dvsMat3:F(),displayViewMat3:F()}}dispose(){}prepareState(t){const{context:e}=t;e.setColorMask(!0,!0,!0,!0),e.setStencilFunction(Y.EQUAL,0,255)}draw(t,e){const{requestRender:a,allowDelayedRender:i}=t,{displayData:r}=e;if(r==null||(r.state.name==="loaded"&&r.attach(t),r.state.name!=="attached"))return;const o=r.state.resources;!i||o.ready||a==null?(this._visualState.time=t.time/1e3,this._visualState.dvsMat3=e.transforms.displayViewScreenMat3,this._visualState.displayViewMat3=t.state.displayViewMat3,r.flowStyle.render(t,this._visualState,o),r.flowStyle.animated&&a!=null&&a()):a()}}class te extends Dt{constructor(){super(...arguments),this.flowStyle=null}doRender(t){super.doRender(t)}prepareRenderPasses(t){const e=t.registerRenderPass({name:"flow",brushes:[Yt],target:()=>this.children,drawPhase:Mt.MAP});return[...super.prepareRenderPasses(t),e]}}class ee{constructor(t,e,a,i){this.state={name:"created"},this.flowStyle=t,this.extent=e,this.size=a,this.pixelRatio=i}async load(){const t=new AbortController;this.state={name:"loading",abortController:t};const e={extent:this.extent,size:this.size,pixelRatio:this.pixelRatio},a=await this.flowStyle.load(e,t.signal);this.state={name:"loaded",resources:a}}attach(t){if(this.state.name!=="loaded")return void tt.getLogger("esri.views.2d.engine.flow.FlowDisplayData").error("Only loaded resources can be attached.");const e=this.state.resources;e.attach(t),this.state={name:"attached",resources:e}}detach(){if(this.state.name==="loading")return this.state.abortController.abort(),void(this.state={name:"detached"});this.state.name==="attached"&&(this.state.resources.detach(),this.state={name:"detached"})}update(t){return this.flowStyle.isCompatible(t.flowStyle)?!(!this.extent.equals(t.extent)||this.size[0]!==t.size[0]||this.size[1]!==t.size[1]||this.pixelRatio!==t.pixelRatio)&&(this.flowStyle=t.flowStyle,!0):!1}}class ae extends rt{constructor(){super(...arguments),this._displayData=null}get displayData(){return this._displayData}set displayData(t){this._displayData=t,this.requestRender()}clear(){this._displayData!=null&&(this._displayData.detach(),this._displayData=null,this.requestRender())}setTransform(t){const{displayData:e}=this;if(e==null)return;const a=e.extent.xmin,i=e.extent.ymax,r=[0,0];t.toScreen(r,[a,i]);const o=(e.extent.xmax-e.extent.xmin)/e.size[0]/t.resolution,n=G(t.rotation),{displayViewScreenMat3:c}=this.transforms;ft(c,[-1,1,0]),j(c,c,[2/(t.size[0]*t.pixelRatio),-2/(t.size[1]*t.pixelRatio),1]),I(c,c,[r[0],r[1],0]),et(c,c,n),j(c,c,[o*t.pixelRatio,o*t.pixelRatio,1])}_createTransforms(){return{displayViewScreenMat3:F()}}}const se=1.15;let R=class extends st{constructor(t){super(t),this._flowDisplayObject=new ae,this._loading=null}initialize(){this.flowContainer.addChild(this._flowDisplayObject)}destroy(){this._clear(),this.flowContainer.removeAllChildren()}get updating(){return this._loading!=null}update(t){const{flowStyle:e}=this.flowContainer;if(e==null)return void this._clear();const{extent:a,rotation:i,resolution:r,pixelRatio:o}=t.state,n=re(a,i);n.expand(se);const c=[Math.round((n.xmax-n.xmin)/r),Math.round((n.ymax-n.ymin)/r)],h=new ee(e,n,c,o);if(this._loading!=null){if(this._loading.update(h))return;this._loading.detach(),this._loading=null}this._flowDisplayObject.displayData!=null&&this._flowDisplayObject.displayData.update(h)||(h.load().then(()=>{this._flowDisplayObject.clear(),this._flowDisplayObject.displayData=this._loading,this._loading=null},m=>{_t(m)||(tt.getLogger(this).error("A resource failed to load.",m),this._loading=null)}),this._loading=h)}_clear(){this._flowDisplayObject.clear(),this._loading!=null&&(this._loading.detach(),this._loading=null)}};f([y()],R.prototype,"_loading",void 0),f([y()],R.prototype,"flowContainer",void 0),f([y()],R.prototype,"updating",null),R=f([at("esri.views.2d.engine.flow.FlowStrategy")],R);const ie=R;function re(s,t){const e=new yt({x:(s.xmax+s.xmin)/2,y:(s.ymax+s.ymin)/2,spatialReference:s.spatialReference}),a=s.xmax-s.xmin,i=s.ymax-s.ymin,r=Math.abs(Math.cos(G(t))),o=Math.abs(Math.sin(G(t))),n=r*a+o*i,c=o*a+r*i,h=new gt({xmin:e.x-n/2,ymin:e.y-c/2,xmax:e.x+n/2,ymax:e.y+c/2,spatialReference:s.spatialReference});return h.centerAt(e),h}let _=class extends st{constructor(){super(...arguments),this._loadImagery=(s,t,e,a,i)=>B(this.layer,s,t,e,a,i),this._createFlowMesh=(s,t,e,a)=>this.layer.createFlowMesh({meshType:s,flowData:e,simulationSettings:t},{signal:a}),this.attached=!1,this.type="flow",this.timeExtent=null,this.redrawOrRefetch=async()=>{this._updateVisualization()}}get updating(){return!this.attached||this._strategy.updating}attach(){const{layer:s}=this,t=()=>{this._loadImagery=(e,a,i,r,o)=>B(s,e,a,i,r,o),this._updateVisualization()};"multidimensionalDefinition"in s?this.addHandles(O(()=>s.multidimensionalDefinition,t)):this.addHandles([O(()=>s.mosaicRule,t),O(()=>s.rasterFunction,t),O(()=>s.definitionExpression,t)]),this.container=new te,this._strategy=new ie({flowContainer:this.container}),this._updateVisualization()}detach(){var s;this._strategy.destroy(),(s=this.container)==null||s.removeAllChildren(),this.container=null,this.removeHandles()}update(s){s.stationary?this._strategy.update(s):this.layerView.requestUpdate()}hitTest(s){return new vt({attributes:{},geometry:s.clone(),layer:this.layer})}moveEnd(){}async doRefresh(){}_updateVisualization(){const s=this.layer.renderer;if(s==null||s.type!=="flow")return;const t=Xt(s,{loadImagery:this._loadImagery,createFlowMesh:this._createFlowMesh,timeExtent:this.timeExtent});this.container.flowStyle=t,this.layerView.requestUpdate()}};f([y()],_.prototype,"_strategy",void 0),f([y()],_.prototype,"attached",void 0),f([y()],_.prototype,"container",void 0),f([y()],_.prototype,"layer",void 0),f([y()],_.prototype,"layerView",void 0),f([y()],_.prototype,"type",void 0),f([y()],_.prototype,"updating",null),f([y()],_.prototype,"timeExtent",void 0),_=f([at("esri.views.2d.engine.flow.FlowView2D")],_);const ve=_,U=new Float32Array([.27058823529411763,.4588235294117647,.7098039215686275,1,.396078431372549,.5372549019607843,.7215686274509804,1,.5176470588235295,.6196078431372549,.7294117647058823,1,.6352941176470588,.7058823529411765,.7411764705882353,1,.7529411764705882,.8,.7450980392156863,1,.8705882352941177,.8901960784313725,.7490196078431373,1,1,1,.7490196078431373,1,1,.8627450980392157,.6313725490196078,1,.9803921568627451,.7254901960784313,.5176470588235295,1,.9607843137254902,.596078431372549,.4117647058823529,1,.9294117647058824,.4588235294117647,.3176470588235294,1,.9098039215686274,.08235294117647059,.08235294117647059,1]),Q=new Float32Array([0,92/255,230/255,1]),oe={beaufort_ft:U,beaufort_m:U,beaufort_km:U,beaufort_mi:U,beaufort_kn:new Float32Array([.1568627450980392,.5725490196078431,.7803921568627451,1,.34901960784313724,.6352941176470588,.7294117647058823,1,.5058823529411764,.7019607843137254,.6705882352941176,1,.6274509803921569,.7607843137254902,.6078431372549019,1,.7490196078431373,.8313725490196079,.5411764705882353,1,.8549019607843137,.9019607843137255,.4666666666666667,1,.9803921568627451,.9803921568627451,.39215686274509803,1,.9882352941176471,.8352941176470589,.3254901960784314,1,.9882352941176471,.7019607843137254,.4,1,.9803921568627451,.5529411764705883,.20392156862745098,1,.9686274509803922,.43137254901960786,.16470588235294117,1,.9411764705882353,.2784313725490196,.11372549019607843,1]),classified_arrow:new Float32Array([.2196078431372549,.6588235294117647,0,1,.5450980392156862,1.2117647058823529,0,1,1,1,0,1,1,.5019607843137255,0,1,1,0,0,1]),ocean_current_m:new Float32Array([.3058823529411765,.10196078431372549,.6,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),ocean_current_kn:new Float32Array([0,0,0,1,0,.1450980392156863,.39215686274509803,1,.3058823529411765,.10196078431372549,.6,1,.592156862745098,0,.39215686274509803,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.6941176470588235,.3058823529411765,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,1,.6941176470588235,.7019607843137254,.20392156862745098,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),simple_scalar:Q,single_arrow:Q,wind_speed:new Float32Array([0,0,0,1])},X=[0,20];class we extends it{constructor(){super(...arguments),this._desc={magdir:{vsPath:"raster/magdir",fsPath:"raster/magdir",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])},scalar:{vsPath:"raster/scalar",fsPath:"raster/scalar",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])}}}dispose(){}prepareState({context:t}){t.setBlendingEnabled(!0),t.setBlendFunctionSeparate(w.ONE,w.ONE_MINUS_SRC_ALPHA,w.ONE,w.ONE_MINUS_SRC_ALPHA),t.setColorMask(!0,!0,!0,!0),t.setStencilWriteMask(0),t.setStencilTestEnabled(!0),t.setStencilOp(L.KEEP,L.KEEP,L.REPLACE)}draw(t,e){if(e.source==null||e.source.validPixelCount===0)return;const{context:a,timeline:i}=t;if(i.begin(this.name),a.setStencilFunction(Y.EQUAL,e.stencilRef,255),e.updateVectorFieldVAO(t),t.renderPass==="scalar"){const r=e.vaoData.scalar;r&&this._drawScalars(t,e,r.vao,r.elementCount)}else{const r=e.vaoData.magdir;r&&this._drawTriangles(t,e,r.vao,r.elementCount)}i.end(this.name)}_drawTriangles(t,e,a,i){const{context:r,painter:o,requestRender:n,allowDelayedRender:c}=t,{symbolizerParameters:h}=e,m=h.dataRange?["dataRange"]:[];h.rotationType==="geographic"&&m.push("rotationGeographic");const l=o.materialManager.getProgram(this._desc.magdir,m);if(c&&n!=null&&!l.compiled)return void n();r.useProgram(l);const{coordScale:g,opacity:T,transforms:d}=e;l.setUniform2fv("u_coordScale",g),l.setUniform1f("u_opacity",T),l.setUniformMatrix3fv("u_dvsMat3",d.displayViewScreenMat3);const{style:u,dataRange:x,rotation:S,symbolPercentRange:M}=h;l.setUniform4fv("u_colors",oe[u]),l.setUniform2fv("u_dataRange",x||X),l.setUniform1f("u_rotation",S),l.setUniform2fv("u_symbolPercentRange",M);const ut=this._getSymbolSize(t,e);l.setUniform2fv("u_symbolSize",ut),r.bindVAO(a),r.drawElements(E.TRIANGLES,i,p.UNSIGNED_INT,0)}_drawScalars(t,e,a,i){const{context:r,painter:o,requestRender:n,allowDelayedRender:c}=t,{symbolizerParameters:h}=e,m=[];h.style==="wind_speed"?m.push("innerCircle"):h.dataRange&&m.push("dataRange"),h.rotationType==="geographic"&&m.push("rotationGeographic");const l=o.materialManager.getProgram(this._desc.scalar,m);if(c&&n!=null&&!l.compiled)return void n();r.useProgram(l);const{coordScale:g,opacity:T,transforms:d}=e;l.setUniform2fv("u_coordScale",g),l.setUniform1f("u_opacity",T),l.setUniformMatrix3fv("u_dvsMat3",d.displayViewScreenMat3);const{dataRange:u,symbolPercentRange:x}=h;l.setUniform2fv("u_dataRange",u||X),l.setUniform2fv("u_symbolPercentRange",x);const S=this._getSymbolSize(t,e);l.setUniform2fv("u_symbolSize",S),r.bindVAO(a),r.drawElements(E.TRIANGLES,i,p.UNSIGNED_INT,0)}_getSymbolSize(t,e){const a=e.key?2**(t.displayLevel-e.key.level):e.resolution/t.state.resolution,{symbolTileSize:i}=e.symbolizerParameters;return[i/(Math.round((e.width-e.offset[0])/i)*i)/a,i/(Math.round((e.height-e.offset[1])/i)*i)/a]}}class xe extends rt{constructor(t=null){super(),this._source=null,this._symbolizerParameters=null,this._vaoInvalidated=!0,this.coordScale=[1,1],this.height=null,this.key=null,this.offset=null,this.stencilRef=0,this.resolution=null,this.pixelRatio=1,this.x=0,this.y=0,this.rotation=0,this.rawPixelData=null,this.vaoData=null,this.width=null,this.source=t}destroy(){var t,e;this.vaoData!=null&&((t=this.vaoData.magdir)==null||t.vao.dispose(),(e=this.vaoData.scalar)==null||e.vao.dispose(),this.vaoData=null)}get symbolizerParameters(){return this._symbolizerParameters}set symbolizerParameters(t){JSON.stringify(this._symbolizerParameters)!==JSON.stringify(t)&&(this._symbolizerParameters=t,this.invalidateVAO())}get source(){return this._source}set source(t){this._source=t,this.invalidateVAO()}invalidateVAO(){var t,e;this._vaoInvalidated||this.vaoData==null||((t=this.vaoData.magdir)==null||t.vao.dispose(),(e=this.vaoData.scalar)==null||e.vao.dispose(),this.vaoData=null,this._vaoInvalidated=!0,this.requestRender())}updateVectorFieldVAO(t){if(this._vaoInvalidated){if(this._vaoInvalidated=!1,this.source!=null&&this.vaoData==null){const{style:e}=this.symbolizerParameters;switch(e){case"beaufort_ft":case"beaufort_km":case"beaufort_kn":case"beaufort_m":case"beaufort_mi":case"classified_arrow":case"ocean_current_kn":case"ocean_current_m":case"single_arrow":{const a=Z(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,a);this.vaoData={magdir:i}}break;case"simple_scalar":{const a=J(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,a);this.vaoData={scalar:i}}break;case"wind_speed":{const a=Z(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,a),r=J(this.source,this.symbolizerParameters),o=this._createVectorFieldVAO(t.context,r);this.vaoData={magdir:i,scalar:o}}}}this.ready(),this.requestRender()}}_createTransforms(){return{displayViewScreenMat3:F()}}setTransform(t){const e=wt(this.transforms.displayViewScreenMat3),[a,i]=t.toScreenNoRotation([0,0],[this.x,this.y]),r=this.resolution/this.pixelRatio/t.resolution,o=r*this.width,n=r*this.height,c=Math.PI*this.rotation/180;I(e,e,P(a,i)),I(e,e,P(o/2,n/2)),et(e,e,-c),I(e,e,P(-o/2,-n/2)),xt(e,e,P(o,n)),St(this.transforms.displayViewScreenMat3,t.displayViewMat3,e)}onAttach(){this.invalidateVAO()}onDetach(){this.invalidateVAO()}_createVectorFieldVAO(t,e){const{vertexData:a,indexData:i}=e,r=D.createVertex(t,A.STATIC_DRAW,new Float32Array(a)),o=D.createIndex(t,A.STATIC_DRAW,new Uint32Array(i)),n=Rt("vector-field",{geometry:[{location:0,name:"a_pos",count:2,type:p.FLOAT,normalized:!1},{location:1,name:"a_offset",count:2,type:p.FLOAT,normalized:!1},{location:2,name:"a_vv",count:2,type:p.FLOAT,normalized:!1}]});return{vao:new k(t,n.attributes,n.bufferLayouts,{geometry:r},o),elementCount:i.length}}}export{ve as a,we as d,xe as f}; +import{bh as z,iv as v,g5 as p,at as W,g4 as w,g3 as E,fX as A,v as mt,D as pt,eO as F,hf as Y,s as tt,gz as G,ju as ft,f_ as j,eI as I,eK as et,d as f,y,f as at,a7 as st,b as _t,aA as yt,aE as gt,g as O,j as vt,iS as L,eH as wt,eJ as P,eL as xt,eM as St}from"./index-BjUNJPVf.js";import{h as D}from"./Program-DBsYtQ00.js";import{e as bt,m as At}from"./Texture-S4dD-WHn.js";import{o as k}from"./ProgramTemplate-Ck2I0bIi.js";import{g as B,b as Z,_ as J}from"./dataUtils-DzOfgSpi.js";import{t as it,n as Dt}from"./WGLContainer-DgZNq7b0.js";import{E as Mt,i as rt}from"./Container-_n5wCgez.js";import{b as Rt}from"./LabelMetric-BcUxDImF.js";function zt(s){const t=ot(q(s)),e=t,a=!0,i=Math.max(t/2,5),r=Math.round(z(s.maxPathLength)/i)+1,o=10,{density:n}=s;return{smoothing:z(s.smoothing),interpolate:!0,velocityScale:s.flowRepresentation==="flow-from"?1:-1,verticesPerLine:r,minSpeedThreshold:.001,segmentLength:i,maxTurnAngle:1,collisions:a,lineCollisionWidth:e,lineSpacing:o,density:n}}function ot(s){return s.kind==="constant"?s.value[0]:s.values[s.values.length-1]}function K(s){const t=s.toRgba();return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function $t(s){return{kind:"constant",value:[.1,.1,.1,1]}}function q(s){if(!s.hasVisualVariables("size"))return{kind:"constant",value:[z(s.trailWidth)]};const t=s.getVisualVariablesForType("size")[0],e=[],a=[];let i;if(t.stops){for(const r of t.stops)e.push(r.value),a.push(z(r.size));i=t.stops.length}else e.push(t.minDataValue,t.maxDataValue),a.push(z(t.minSize),z(t.maxSize)),i=2;return{kind:"ramp",stops:e,values:a,count:i}}function Vt(s){if(!s.hasVisualVariables("color"))return{kind:"constant",value:K(s.color)};const t=s.getVisualVariablesForType("color")[0],e=[],a=[];for(const i of t.stops)e.push(i.value),Array.prototype.push.apply(a,K(i.color));return{kind:"ramp",stops:e,values:a,count:t.stops.length}}function Tt(s){if(!s.hasVisualVariables("opacity"))return{kind:"constant",value:[1]};const t=s.getVisualVariablesForType("opacity")[0],e=[],a=[];for(const i of t.stops)e.push(i.value),a.push(i.opacity);return{kind:"ramp",stops:e,values:a,count:t.stops.length}}function N(s,t,e,a){switch(t){case"int":s.setUniform1iv(e,a);break;case"float":s.setUniform1fv(e,a);break;case"vec2":s.setUniform2fv(e,a);break;case"vec3":s.setUniform3fv(e,a);break;case"vec4":s.setUniform4fv(e,a)}}function b(s,t,e,a){a.kind==="constant"?N(s,e,`u_${t}`,a.value):(N(s,"float",`u_${t}_stops`,a.stops),N(s,e,`u_${t}_values`,a.values),s.setUniform1i(`u_${t}_count`,a.count))}function Et(s,t){let e=!0;return e=e&&s.collisions===t.collisions,e=e&&s.density===t.density,e=e&&s.interpolate===t.interpolate,e=e&&s.lineCollisionWidth===t.lineCollisionWidth,e=e&&s.lineSpacing===t.lineSpacing,e=e&&s.maxTurnAngle===t.maxTurnAngle,e=e&&s.minSpeedThreshold===t.minSpeedThreshold,e=e&&s.segmentLength===t.segmentLength,e=e&&s.smoothing===t.smoothing,e=e&&s.velocityScale===t.velocityScale,e=e&&s.verticesPerLine===t.verticesPerLine,e}function nt(s,t){return s===t||s!=null&&t!=null&&s.equals(t)}function lt(s,t){if(!Et(s.simulationSettings,t.simulationSettings)||!nt(s.timeExtent,t.timeExtent))return!1;let e=!0;return e=e&&s.loadImagery===t.loadImagery,e=e&&s.createFlowMesh===t.createFlowMesh,e=e&&s.color.kind===t.color.kind,e=e&&s.opacity.kind===t.opacity.kind,e=e&&s.size.kind===t.size.kind,e}let Ot=class ct{constructor(t){this._params=t,this.animated=!1}isCompatible(t){if(!(t instanceof ct)||!nt(this._params.timeExtent,t._params.timeExtent))return!1;let e=!0;return e=e&&this._params.loadImagery===t._params.loadImagery,e=e&&this._params.color.kind===t._params.color.kind,e=e&&this._params.opacity.kind===t._params.opacity.kind,e}async load(t,e){const{extent:a,size:i}=t;W(e);const r=await this._params.loadImagery(a,i[0],i[1],this._params.timeExtent,e);return new It(r,{color:this._params.color,opacity:this._params.opacity})}render(t,e,a){const{context:i}=t,{program:r}=a;i.setFaceCullingEnabled(!1),i.setBlendingEnabled(!0),i.setBlendFunction(w.ONE,w.ONE_MINUS_SRC_ALPHA),i.useProgram(r),r.setUniformMatrix3fv("u_dvsMat3",e.dvsMat3),i.bindTexture(a.texture,0),r.setUniform1i("u_texture",0),r.setUniform1f("u_Min",a.min),r.setUniform1f("u_Max",a.max),b(r,"color","vec4",this._params.color),b(r,"opacity","float",this._params.opacity),i.bindVAO(a.vertexArray),i.drawArrays(E.TRIANGLE_STRIP,0,4)}};const C=new Map;C.set("a_position",0),C.set("a_texcoord",1);const Pt={geometry:[new v("a_position",2,p.UNSIGNED_SHORT,0,8),new v("a_texcoord",2,p.UNSIGNED_SHORT,4,8)]},Ut={vsPath:"raster/flow/imagery",fsPath:"raster/flow/imagery",attributes:C};class It{constructor(t,e){this._flowData=t,this._values=e}attach(t){const{context:e}=t,{width:a,height:i}=this._flowData,r=D.createVertex(e,A.STATIC_DRAW,new Uint16Array([0,0,0,1,a,0,1,1,0,i,0,0,a,i,1,0])),o=new k(e,C,Pt,{geometry:r}),n=[];this._values.color.kind==="ramp"&&n.push("vvColor"),this._values.opacity.kind==="ramp"&&n.push("vvOpacity");const c=t.painter.materialManager.getProgram(Ut,n);let h=1e6,m=-1e6;for(let d=0;d0}isCompatible(t){return t instanceof ht&<(this._params,t._params)}async load(t,e){const{extent:a,size:i}=t;W(e);const r=await this._params.loadImagery(a,i[0],i[1],this._params.timeExtent,e),{vertexData:o,indexData:n}=await this._params.createFlowMesh("Particles",this._params.simulationSettings,r,e);return new Lt(o,n,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(t,e,a){const{context:i}=t,{program:r}=a;i.setFaceCullingEnabled(!1),i.setBlendingEnabled(!0),i.setBlendFunction(w.ONE,w.ONE_MINUS_SRC_ALPHA),i.useProgram(r),r.setUniform1f("u_time",e.time),r.setUniform1f("u_trailLength",this._params.trailLength),r.setUniform1f("u_flowSpeed",this._params.flowSpeed),r.setUniform1f("u_featheringSize",this._params.featheringSize),r.setUniform1f("u_featheringOffset",this._params.featheringOffset),r.setUniform1f("u_introFade",this._params.introFade?1:0),r.setUniform1f("u_fadeToZero",this._params.fadeToZero?1:0),r.setUniform1f("u_decayRate",this._params.decayRate),r.setUniformMatrix3fv("u_dvsMat3",e.dvsMat3),r.setUniformMatrix3fv("u_displayViewMat3",e.displayViewMat3),b(r,"color","vec4",this._params.color),b(r,"opacity","float",this._params.opacity),b(r,"size","float",this._params.size),i.bindVAO(a.vertexArray),i.drawElements(E.TRIANGLES,a.indexCount,p.UNSIGNED_INT,0)}};const $=new Map;$.set("a_xyts0",0),$.set("a_xyts1",1),$.set("a_typeIdDurationSeed",2),$.set("a_extrudeInfo",3);const Ct={geometry:[new v("a_xyts0",4,p.FLOAT,0,64),new v("a_xyts1",4,p.FLOAT,16,64),new v("a_typeIdDurationSeed",4,p.FLOAT,32,64),new v("a_extrudeInfo",4,p.FLOAT,48,64)]},kt={vsPath:"raster/flow/particles",fsPath:"raster/flow/particles",attributes:$};let Lt=class{constructor(t,e,a){this._vertexData=t,this._indexData=e,this._values=a}attach(t){const{context:e}=t,a=D.createVertex(e,A.STATIC_DRAW,this._vertexData),i=D.createIndex(e,A.STATIC_DRAW,this._indexData),r=new k(e,$,Ct,{geometry:a},i),o=[];this._values.color.kind==="ramp"&&o.push("vvColor"),this._values.opacity.kind==="ramp"&&o.push("vvOpacity"),this._values.size.kind==="ramp"&&o.push("vvSize");const n=t.painter.materialManager.getProgram(kt,o);this.vertexArray=r,this.program=n,this.indexCount=this._indexData.length,this._vertexData=null,this._indexData=null}detach(){this.vertexArray.dispose()}get ready(){return this.program.compiled}},Nt=class dt{constructor(t){this._styles=t}get animated(){return this._styles.reduce((t,e)=>t||e.animated,!1)}isCompatible(t){if(!(t instanceof dt)||this._styles.length!==t._styles.length)return!1;const e=this._styles.length;for(let a=0;ai.load(t,e)));return new Gt(a)}render(t,e,a){for(let i=0;it&&e.ready,!0)}};class H{constructor(t){this._params=t}get animated(){return this._params.flowSpeed>0}isCompatible(t){return t instanceof H&<(this._params,t._params)}async load(t,e){const{extent:a,size:i}=t;W(e);const r=await this._params.loadImagery(a,i[0],i[1],this._params.timeExtent,e),{vertexData:o,indexData:n}=await this._params.createFlowMesh("Streamlines",this._params.simulationSettings,r,e);return new Ht(o,n,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(t,e,a){const{context:i}=t,{program:r}=a;i.setFaceCullingEnabled(!1),i.setBlendingEnabled(!0),i.setBlendFunction(w.ONE,w.ONE_MINUS_SRC_ALPHA),i.useProgram(r),r.setUniform1f("u_time",e.time),r.setUniform1f("u_trailLength",this._params.trailLength),r.setUniform1f("u_flowSpeed",this._params.flowSpeed),r.setUniform1f("u_featheringSize",this._params.featheringSize),r.setUniform1f("u_featheringOffset",this._params.featheringOffset),r.setUniform1f("u_introFade",this._params.introFade?1:0),r.setUniform1f("u_fadeToZero",this._params.fadeToZero?1:0),r.setUniform1f("u_decayRate",this._params.decayRate),r.setUniformMatrix3fv("u_dvsMat3",e.dvsMat3),r.setUniformMatrix3fv("u_displayViewMat3",e.displayViewMat3),b(r,"color","vec4",this._params.color),b(r,"opacity","float",this._params.opacity),b(r,"size","float",this._params.size),i.bindVAO(a.vertexArray),i.drawElements(E.TRIANGLES,a.indexCount,p.UNSIGNED_INT,0)}}const V=new Map;V.set("a_positionAndSide",0),V.set("a_timeInfo",1),V.set("a_extrude",2),V.set("a_speed",3);const qt={geometry:[new v("a_positionAndSide",3,p.FLOAT,0,36),new v("a_timeInfo",3,p.FLOAT,12,36),new v("a_extrude",2,p.FLOAT,24,36),new v("a_speed",1,p.FLOAT,32,36)]},Wt={vsPath:"raster/flow/streamlines",fsPath:"raster/flow/streamlines",attributes:V};let Ht=class{constructor(t,e,a){this._vertexData=t,this._indexData=e,this._values=a}attach(t){const{context:e}=t,a=D.createVertex(e,A.STATIC_DRAW,this._vertexData),i=D.createIndex(e,A.STATIC_DRAW,this._indexData),r=new k(e,V,qt,{geometry:a},i),o=[];this._values.color.kind==="ramp"&&o.push("vvColor"),this._values.opacity.kind==="ramp"&&o.push("vvOpacity"),this._values.size.kind==="ramp"&&o.push("vvSize");const n=t.painter.materialManager.getProgram(Wt,o);this.vertexArray=r,this.program=n,this.indexCount=this._indexData.length,this._vertexData=null,this._indexData=null}detach(){this.vertexArray.dispose()}get ready(){return this.program.compiled}};const jt=4,Bt=1,Zt=.5,Jt=!0,Kt=!0,Qt=2.3;function Xt(s,t){const{flowSpeed:e,trailLength:a}=s,i=zt(s);let r=null;const o={opacity:Tt(s),size:q(s)};let n=Vt(s);if(s.background==="none")o.color=n;else{n.kind==="constant"&&(n={kind:"ramp",stops:[0,1],values:[0,0,0,1,n.value[0],n.value[1],n.value[2],n.value[3]],count:2});const m={loadImagery:t.loadImagery,timeExtent:t.timeExtent,color:n,opacity:{kind:"constant",value:[1]}};r=new Ot(m),o.color=$t()}const c={loadImagery:t.loadImagery,createFlowMesh:t.createFlowMesh,simulationSettings:i,timeExtent:t.timeExtent,trailLength:a,flowSpeed:e,featheringSize:Bt,featheringOffset:Zt,introFade:Jt,fadeToZero:Kt,decayRate:Qt,color:o.color,opacity:o.opacity,size:o.size},h=s.trailCap==="butt"||ot(q(s))<=jt?new H(c):new Ft(c);return r!=null?new Nt([r,h]):h}class Yt extends it{constructor(){super(...arguments),this._visualState={time:0,dvsMat3:F(),displayViewMat3:F()}}dispose(){}prepareState(t){const{context:e}=t;e.setColorMask(!0,!0,!0,!0),e.setStencilFunction(Y.EQUAL,0,255)}draw(t,e){const{requestRender:a,allowDelayedRender:i}=t,{displayData:r}=e;if(r==null||(r.state.name==="loaded"&&r.attach(t),r.state.name!=="attached"))return;const o=r.state.resources;!i||o.ready||a==null?(this._visualState.time=t.time/1e3,this._visualState.dvsMat3=e.transforms.displayViewScreenMat3,this._visualState.displayViewMat3=t.state.displayViewMat3,r.flowStyle.render(t,this._visualState,o),r.flowStyle.animated&&a!=null&&a()):a()}}class te extends Dt{constructor(){super(...arguments),this.flowStyle=null}doRender(t){super.doRender(t)}prepareRenderPasses(t){const e=t.registerRenderPass({name:"flow",brushes:[Yt],target:()=>this.children,drawPhase:Mt.MAP});return[...super.prepareRenderPasses(t),e]}}class ee{constructor(t,e,a,i){this.state={name:"created"},this.flowStyle=t,this.extent=e,this.size=a,this.pixelRatio=i}async load(){const t=new AbortController;this.state={name:"loading",abortController:t};const e={extent:this.extent,size:this.size,pixelRatio:this.pixelRatio},a=await this.flowStyle.load(e,t.signal);this.state={name:"loaded",resources:a}}attach(t){if(this.state.name!=="loaded")return void tt.getLogger("esri.views.2d.engine.flow.FlowDisplayData").error("Only loaded resources can be attached.");const e=this.state.resources;e.attach(t),this.state={name:"attached",resources:e}}detach(){if(this.state.name==="loading")return this.state.abortController.abort(),void(this.state={name:"detached"});this.state.name==="attached"&&(this.state.resources.detach(),this.state={name:"detached"})}update(t){return this.flowStyle.isCompatible(t.flowStyle)?!(!this.extent.equals(t.extent)||this.size[0]!==t.size[0]||this.size[1]!==t.size[1]||this.pixelRatio!==t.pixelRatio)&&(this.flowStyle=t.flowStyle,!0):!1}}class ae extends rt{constructor(){super(...arguments),this._displayData=null}get displayData(){return this._displayData}set displayData(t){this._displayData=t,this.requestRender()}clear(){this._displayData!=null&&(this._displayData.detach(),this._displayData=null,this.requestRender())}setTransform(t){const{displayData:e}=this;if(e==null)return;const a=e.extent.xmin,i=e.extent.ymax,r=[0,0];t.toScreen(r,[a,i]);const o=(e.extent.xmax-e.extent.xmin)/e.size[0]/t.resolution,n=G(t.rotation),{displayViewScreenMat3:c}=this.transforms;ft(c,[-1,1,0]),j(c,c,[2/(t.size[0]*t.pixelRatio),-2/(t.size[1]*t.pixelRatio),1]),I(c,c,[r[0],r[1],0]),et(c,c,n),j(c,c,[o*t.pixelRatio,o*t.pixelRatio,1])}_createTransforms(){return{displayViewScreenMat3:F()}}}const se=1.15;let R=class extends st{constructor(t){super(t),this._flowDisplayObject=new ae,this._loading=null}initialize(){this.flowContainer.addChild(this._flowDisplayObject)}destroy(){this._clear(),this.flowContainer.removeAllChildren()}get updating(){return this._loading!=null}update(t){const{flowStyle:e}=this.flowContainer;if(e==null)return void this._clear();const{extent:a,rotation:i,resolution:r,pixelRatio:o}=t.state,n=re(a,i);n.expand(se);const c=[Math.round((n.xmax-n.xmin)/r),Math.round((n.ymax-n.ymin)/r)],h=new ee(e,n,c,o);if(this._loading!=null){if(this._loading.update(h))return;this._loading.detach(),this._loading=null}this._flowDisplayObject.displayData!=null&&this._flowDisplayObject.displayData.update(h)||(h.load().then(()=>{this._flowDisplayObject.clear(),this._flowDisplayObject.displayData=this._loading,this._loading=null},m=>{_t(m)||(tt.getLogger(this).error("A resource failed to load.",m),this._loading=null)}),this._loading=h)}_clear(){this._flowDisplayObject.clear(),this._loading!=null&&(this._loading.detach(),this._loading=null)}};f([y()],R.prototype,"_loading",void 0),f([y()],R.prototype,"flowContainer",void 0),f([y()],R.prototype,"updating",null),R=f([at("esri.views.2d.engine.flow.FlowStrategy")],R);const ie=R;function re(s,t){const e=new yt({x:(s.xmax+s.xmin)/2,y:(s.ymax+s.ymin)/2,spatialReference:s.spatialReference}),a=s.xmax-s.xmin,i=s.ymax-s.ymin,r=Math.abs(Math.cos(G(t))),o=Math.abs(Math.sin(G(t))),n=r*a+o*i,c=o*a+r*i,h=new gt({xmin:e.x-n/2,ymin:e.y-c/2,xmax:e.x+n/2,ymax:e.y+c/2,spatialReference:s.spatialReference});return h.centerAt(e),h}let _=class extends st{constructor(){super(...arguments),this._loadImagery=(s,t,e,a,i)=>B(this.layer,s,t,e,a,i),this._createFlowMesh=(s,t,e,a)=>this.layer.createFlowMesh({meshType:s,flowData:e,simulationSettings:t},{signal:a}),this.attached=!1,this.type="flow",this.timeExtent=null,this.redrawOrRefetch=async()=>{this._updateVisualization()}}get updating(){return!this.attached||this._strategy.updating}attach(){const{layer:s}=this,t=()=>{this._loadImagery=(e,a,i,r,o)=>B(s,e,a,i,r,o),this._updateVisualization()};"multidimensionalDefinition"in s?this.addHandles(O(()=>s.multidimensionalDefinition,t)):this.addHandles([O(()=>s.mosaicRule,t),O(()=>s.rasterFunction,t),O(()=>s.definitionExpression,t)]),this.container=new te,this._strategy=new ie({flowContainer:this.container}),this._updateVisualization()}detach(){var s;this._strategy.destroy(),(s=this.container)==null||s.removeAllChildren(),this.container=null,this.removeHandles()}update(s){s.stationary?this._strategy.update(s):this.layerView.requestUpdate()}hitTest(s){return new vt({attributes:{},geometry:s.clone(),layer:this.layer})}moveEnd(){}async doRefresh(){}_updateVisualization(){const s=this.layer.renderer;if(s==null||s.type!=="flow")return;const t=Xt(s,{loadImagery:this._loadImagery,createFlowMesh:this._createFlowMesh,timeExtent:this.timeExtent});this.container.flowStyle=t,this.layerView.requestUpdate()}};f([y()],_.prototype,"_strategy",void 0),f([y()],_.prototype,"attached",void 0),f([y()],_.prototype,"container",void 0),f([y()],_.prototype,"layer",void 0),f([y()],_.prototype,"layerView",void 0),f([y()],_.prototype,"type",void 0),f([y()],_.prototype,"updating",null),f([y()],_.prototype,"timeExtent",void 0),_=f([at("esri.views.2d.engine.flow.FlowView2D")],_);const ve=_,U=new Float32Array([.27058823529411763,.4588235294117647,.7098039215686275,1,.396078431372549,.5372549019607843,.7215686274509804,1,.5176470588235295,.6196078431372549,.7294117647058823,1,.6352941176470588,.7058823529411765,.7411764705882353,1,.7529411764705882,.8,.7450980392156863,1,.8705882352941177,.8901960784313725,.7490196078431373,1,1,1,.7490196078431373,1,1,.8627450980392157,.6313725490196078,1,.9803921568627451,.7254901960784313,.5176470588235295,1,.9607843137254902,.596078431372549,.4117647058823529,1,.9294117647058824,.4588235294117647,.3176470588235294,1,.9098039215686274,.08235294117647059,.08235294117647059,1]),Q=new Float32Array([0,92/255,230/255,1]),oe={beaufort_ft:U,beaufort_m:U,beaufort_km:U,beaufort_mi:U,beaufort_kn:new Float32Array([.1568627450980392,.5725490196078431,.7803921568627451,1,.34901960784313724,.6352941176470588,.7294117647058823,1,.5058823529411764,.7019607843137254,.6705882352941176,1,.6274509803921569,.7607843137254902,.6078431372549019,1,.7490196078431373,.8313725490196079,.5411764705882353,1,.8549019607843137,.9019607843137255,.4666666666666667,1,.9803921568627451,.9803921568627451,.39215686274509803,1,.9882352941176471,.8352941176470589,.3254901960784314,1,.9882352941176471,.7019607843137254,.4,1,.9803921568627451,.5529411764705883,.20392156862745098,1,.9686274509803922,.43137254901960786,.16470588235294117,1,.9411764705882353,.2784313725490196,.11372549019607843,1]),classified_arrow:new Float32Array([.2196078431372549,.6588235294117647,0,1,.5450980392156862,1.2117647058823529,0,1,1,1,0,1,1,.5019607843137255,0,1,1,0,0,1]),ocean_current_m:new Float32Array([.3058823529411765,.10196078431372549,.6,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),ocean_current_kn:new Float32Array([0,0,0,1,0,.1450980392156863,.39215686274509803,1,.3058823529411765,.10196078431372549,.6,1,.592156862745098,0,.39215686274509803,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.6941176470588235,.3058823529411765,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,1,.6941176470588235,.7019607843137254,.20392156862745098,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),simple_scalar:Q,single_arrow:Q,wind_speed:new Float32Array([0,0,0,1])},X=[0,20];class we extends it{constructor(){super(...arguments),this._desc={magdir:{vsPath:"raster/magdir",fsPath:"raster/magdir",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])},scalar:{vsPath:"raster/scalar",fsPath:"raster/scalar",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])}}}dispose(){}prepareState({context:t}){t.setBlendingEnabled(!0),t.setBlendFunctionSeparate(w.ONE,w.ONE_MINUS_SRC_ALPHA,w.ONE,w.ONE_MINUS_SRC_ALPHA),t.setColorMask(!0,!0,!0,!0),t.setStencilWriteMask(0),t.setStencilTestEnabled(!0),t.setStencilOp(L.KEEP,L.KEEP,L.REPLACE)}draw(t,e){if(e.source==null||e.source.validPixelCount===0)return;const{context:a,timeline:i}=t;if(i.begin(this.name),a.setStencilFunction(Y.EQUAL,e.stencilRef,255),e.updateVectorFieldVAO(t),t.renderPass==="scalar"){const r=e.vaoData.scalar;r&&this._drawScalars(t,e,r.vao,r.elementCount)}else{const r=e.vaoData.magdir;r&&this._drawTriangles(t,e,r.vao,r.elementCount)}i.end(this.name)}_drawTriangles(t,e,a,i){const{context:r,painter:o,requestRender:n,allowDelayedRender:c}=t,{symbolizerParameters:h}=e,m=h.dataRange?["dataRange"]:[];h.rotationType==="geographic"&&m.push("rotationGeographic");const l=o.materialManager.getProgram(this._desc.magdir,m);if(c&&n!=null&&!l.compiled)return void n();r.useProgram(l);const{coordScale:g,opacity:T,transforms:d}=e;l.setUniform2fv("u_coordScale",g),l.setUniform1f("u_opacity",T),l.setUniformMatrix3fv("u_dvsMat3",d.displayViewScreenMat3);const{style:u,dataRange:x,rotation:S,symbolPercentRange:M}=h;l.setUniform4fv("u_colors",oe[u]),l.setUniform2fv("u_dataRange",x||X),l.setUniform1f("u_rotation",S),l.setUniform2fv("u_symbolPercentRange",M);const ut=this._getSymbolSize(t,e);l.setUniform2fv("u_symbolSize",ut),r.bindVAO(a),r.drawElements(E.TRIANGLES,i,p.UNSIGNED_INT,0)}_drawScalars(t,e,a,i){const{context:r,painter:o,requestRender:n,allowDelayedRender:c}=t,{symbolizerParameters:h}=e,m=[];h.style==="wind_speed"?m.push("innerCircle"):h.dataRange&&m.push("dataRange"),h.rotationType==="geographic"&&m.push("rotationGeographic");const l=o.materialManager.getProgram(this._desc.scalar,m);if(c&&n!=null&&!l.compiled)return void n();r.useProgram(l);const{coordScale:g,opacity:T,transforms:d}=e;l.setUniform2fv("u_coordScale",g),l.setUniform1f("u_opacity",T),l.setUniformMatrix3fv("u_dvsMat3",d.displayViewScreenMat3);const{dataRange:u,symbolPercentRange:x}=h;l.setUniform2fv("u_dataRange",u||X),l.setUniform2fv("u_symbolPercentRange",x);const S=this._getSymbolSize(t,e);l.setUniform2fv("u_symbolSize",S),r.bindVAO(a),r.drawElements(E.TRIANGLES,i,p.UNSIGNED_INT,0)}_getSymbolSize(t,e){const a=e.key?2**(t.displayLevel-e.key.level):e.resolution/t.state.resolution,{symbolTileSize:i}=e.symbolizerParameters;return[i/(Math.round((e.width-e.offset[0])/i)*i)/a,i/(Math.round((e.height-e.offset[1])/i)*i)/a]}}class xe extends rt{constructor(t=null){super(),this._source=null,this._symbolizerParameters=null,this._vaoInvalidated=!0,this.coordScale=[1,1],this.height=null,this.key=null,this.offset=null,this.stencilRef=0,this.resolution=null,this.pixelRatio=1,this.x=0,this.y=0,this.rotation=0,this.rawPixelData=null,this.vaoData=null,this.width=null,this.source=t}destroy(){var t,e;this.vaoData!=null&&((t=this.vaoData.magdir)==null||t.vao.dispose(),(e=this.vaoData.scalar)==null||e.vao.dispose(),this.vaoData=null)}get symbolizerParameters(){return this._symbolizerParameters}set symbolizerParameters(t){JSON.stringify(this._symbolizerParameters)!==JSON.stringify(t)&&(this._symbolizerParameters=t,this.invalidateVAO())}get source(){return this._source}set source(t){this._source=t,this.invalidateVAO()}invalidateVAO(){var t,e;this._vaoInvalidated||this.vaoData==null||((t=this.vaoData.magdir)==null||t.vao.dispose(),(e=this.vaoData.scalar)==null||e.vao.dispose(),this.vaoData=null,this._vaoInvalidated=!0,this.requestRender())}updateVectorFieldVAO(t){if(this._vaoInvalidated){if(this._vaoInvalidated=!1,this.source!=null&&this.vaoData==null){const{style:e}=this.symbolizerParameters;switch(e){case"beaufort_ft":case"beaufort_km":case"beaufort_kn":case"beaufort_m":case"beaufort_mi":case"classified_arrow":case"ocean_current_kn":case"ocean_current_m":case"single_arrow":{const a=Z(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,a);this.vaoData={magdir:i}}break;case"simple_scalar":{const a=J(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,a);this.vaoData={scalar:i}}break;case"wind_speed":{const a=Z(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,a),r=J(this.source,this.symbolizerParameters),o=this._createVectorFieldVAO(t.context,r);this.vaoData={magdir:i,scalar:o}}}}this.ready(),this.requestRender()}}_createTransforms(){return{displayViewScreenMat3:F()}}setTransform(t){const e=wt(this.transforms.displayViewScreenMat3),[a,i]=t.toScreenNoRotation([0,0],[this.x,this.y]),r=this.resolution/this.pixelRatio/t.resolution,o=r*this.width,n=r*this.height,c=Math.PI*this.rotation/180;I(e,e,P(a,i)),I(e,e,P(o/2,n/2)),et(e,e,-c),I(e,e,P(-o/2,-n/2)),xt(e,e,P(o,n)),St(this.transforms.displayViewScreenMat3,t.displayViewMat3,e)}onAttach(){this.invalidateVAO()}onDetach(){this.invalidateVAO()}_createVectorFieldVAO(t,e){const{vertexData:a,indexData:i}=e,r=D.createVertex(t,A.STATIC_DRAW,new Float32Array(a)),o=D.createIndex(t,A.STATIC_DRAW,new Uint32Array(i)),n=Rt("vector-field",{geometry:[{location:0,name:"a_pos",count:2,type:p.FLOAT,normalized:!1},{location:1,name:"a_offset",count:2,type:p.FLOAT,normalized:!1},{location:2,name:"a_vv",count:2,type:p.FLOAT,normalized:!1}]});return{vao:new k(t,n.attributes,n.bufferLayouts,{geometry:r},o),elementCount:i.length}}}export{ve as a,we as d,xe as f}; diff --git a/assets/RasterWorker-DIZgcx97.js b/assets/RasterWorker-CzY22QDJ.js similarity index 90% rename from assets/RasterWorker-DIZgcx97.js rename to assets/RasterWorker-CzY22QDJ.js index 554905b..12e2720 100644 --- a/assets/RasterWorker-DIZgcx97.js +++ b/assets/RasterWorker-CzY22QDJ.js @@ -1 +1 @@ -import{aE as a,aA as l,cR as c}from"./index-CEWggaxV.js";import{u as i,f as m,W as f,E as u,U as p,D as S,R as d,a as x,s as O}from"./dataUtils-BFJflGP5.js";import{m as y,S as h,L as J,h as N}from"./RasterSymbolizer-D7OwkKeP.js";import{R as B,i as P}from"./utils-CMvkNhle.js";import{M as k,T as b,e as g}from"./rasterProjectionHelper-Bwvi37wQ.js";import"./colorRamps-BJydlf0f.js";class E{convertVectorFieldData(e){const t=i.fromJSON(e.pixelBlock),s=m(t,e.type);return Promise.resolve(s!=null?s.toJSON():null)}computeStatisticsHistograms(e){const t=i.fromJSON(e.pixelBlock),s=y(t);return Promise.resolve(s)}async decode(e){const t=await h(e.data,e.options);return t&&t.toJSON()}symbolize(e){e.pixelBlock=i.fromJSON(e.pixelBlock),e.extent=e.extent?a.fromJSON(e.extent):null;const t=this.symbolizer.symbolize(e);return Promise.resolve(t!=null?t.toJSON():null)}async updateSymbolizer(e){var t;this.symbolizer=J.fromJSON(e.symbolizerJSON),e.histograms&&((t=this.symbolizer)==null?void 0:t.rendererJSON.type)==="rasterStretch"&&(this.symbolizer.rendererJSON.histograms=e.histograms)}async updateRasterFunction(e){this.rasterFunction=B(e.rasterFunctionJSON)}async process(e){var s;const t=this.rasterFunction.process({extent:a.fromJSON(e.extent),primaryPixelBlocks:e.primaryPixelBlocks.map(o=>o!=null?i.fromJSON(o):null),primaryPixelSizes:(s=e.primaryPixelSizes)==null?void 0:s.map(o=>o!=null?l.fromJSON(o):null),primaryRasterIds:e.primaryRasterIds});return t!=null?t.toJSON():null}stretch(e){const t=this.symbolizer.simpleStretch(i.fromJSON(e.srcPixelBlock),e.stretchParams);return Promise.resolve(t==null?void 0:t.toJSON())}estimateStatisticsHistograms(e){const t=N(i.fromJSON(e.srcPixelBlock));return Promise.resolve(t)}split(e){const t=f(i.fromJSON(e.srcPixelBlock),e.tileSize,e.maximumPyramidLevel??0,e.useBilinear===!1);return t&&t.forEach((s,o)=>{t.set(o,s==null?void 0:s.toJSON())}),Promise.resolve(t)}clipTile(e){const t=i.fromJSON(e.pixelBlock),s=u({...e,pixelBlock:t});return Promise.resolve(s==null?void 0:s.toJSON())}async mosaicAndTransform(e){const t=e.srcPixelBlocks.map(n=>n?new i(n):null),s=p(t,e.srcMosaicSize,{blockWidths:e.blockWidths,alignmentInfo:e.alignmentInfo,clipOffset:e.clipOffset,clipSize:e.clipSize});let o,r=s;return e.coefs&&(r=S(s,e.destDimension,e.coefs,e.sampleSpacing,e.interpolation)),e.projectDirections&&e.gcsGrid&&(o=d(e.destDimension,e.gcsGrid),r=x(r,e.isUV?"vector-uv":"vector-magdir",o)),{pixelBlock:r==null?void 0:r.toJSON(),localNorthDirections:o}}async createFlowMesh(e,t){const s={data:new Float32Array(e.flowData.buffer),mask:new Uint8Array(e.flowData.maskBuffer),width:e.flowData.width,height:e.flowData.height},{vertexData:o,indexData:r}=await O(e.meshType,e.simulationSettings,s,t.signal);return{result:{vertexBuffer:o.buffer,indexBuffer:r.buffer},transferList:[o.buffer,r.buffer]}}async getProjectionOffsetGrid(e){const t=a.fromJSON(e.projectedExtent),s=a.fromJSON(e.srcBufferExtent);let o=null;e.datumTransformationSteps&&(o=new c({steps:e.datumTransformationSteps})),(e.includeGCSGrid||k(t.spatialReference,s.spatialReference,o))&&await b();const r=e.rasterTransform?P(e.rasterTransform):null;return g({...e,projectedExtent:t,srcBufferExtent:s,datumTransformation:o,rasterTransform:r})}}export{E as default}; +import{aE as a,aA as l,cR as c}from"./index-BjUNJPVf.js";import{u as i,f as m,W as f,E as u,U as p,D as S,R as d,a as x,s as O}from"./dataUtils-DzOfgSpi.js";import{m as y,S as h,L as J,h as N}from"./RasterSymbolizer-BN7ge8gb.js";import{R as B,i as P}from"./utils-CBTVfSGR.js";import{M as k,T as b,e as g}from"./rasterProjectionHelper-CHkyWbma.js";import"./colorRamps-CcakIWlU.js";class E{convertVectorFieldData(e){const t=i.fromJSON(e.pixelBlock),s=m(t,e.type);return Promise.resolve(s!=null?s.toJSON():null)}computeStatisticsHistograms(e){const t=i.fromJSON(e.pixelBlock),s=y(t);return Promise.resolve(s)}async decode(e){const t=await h(e.data,e.options);return t&&t.toJSON()}symbolize(e){e.pixelBlock=i.fromJSON(e.pixelBlock),e.extent=e.extent?a.fromJSON(e.extent):null;const t=this.symbolizer.symbolize(e);return Promise.resolve(t!=null?t.toJSON():null)}async updateSymbolizer(e){var t;this.symbolizer=J.fromJSON(e.symbolizerJSON),e.histograms&&((t=this.symbolizer)==null?void 0:t.rendererJSON.type)==="rasterStretch"&&(this.symbolizer.rendererJSON.histograms=e.histograms)}async updateRasterFunction(e){this.rasterFunction=B(e.rasterFunctionJSON)}async process(e){var s;const t=this.rasterFunction.process({extent:a.fromJSON(e.extent),primaryPixelBlocks:e.primaryPixelBlocks.map(o=>o!=null?i.fromJSON(o):null),primaryPixelSizes:(s=e.primaryPixelSizes)==null?void 0:s.map(o=>o!=null?l.fromJSON(o):null),primaryRasterIds:e.primaryRasterIds});return t!=null?t.toJSON():null}stretch(e){const t=this.symbolizer.simpleStretch(i.fromJSON(e.srcPixelBlock),e.stretchParams);return Promise.resolve(t==null?void 0:t.toJSON())}estimateStatisticsHistograms(e){const t=N(i.fromJSON(e.srcPixelBlock));return Promise.resolve(t)}split(e){const t=f(i.fromJSON(e.srcPixelBlock),e.tileSize,e.maximumPyramidLevel??0,e.useBilinear===!1);return t&&t.forEach((s,o)=>{t.set(o,s==null?void 0:s.toJSON())}),Promise.resolve(t)}clipTile(e){const t=i.fromJSON(e.pixelBlock),s=u({...e,pixelBlock:t});return Promise.resolve(s==null?void 0:s.toJSON())}async mosaicAndTransform(e){const t=e.srcPixelBlocks.map(n=>n?new i(n):null),s=p(t,e.srcMosaicSize,{blockWidths:e.blockWidths,alignmentInfo:e.alignmentInfo,clipOffset:e.clipOffset,clipSize:e.clipSize});let o,r=s;return e.coefs&&(r=S(s,e.destDimension,e.coefs,e.sampleSpacing,e.interpolation)),e.projectDirections&&e.gcsGrid&&(o=d(e.destDimension,e.gcsGrid),r=x(r,e.isUV?"vector-uv":"vector-magdir",o)),{pixelBlock:r==null?void 0:r.toJSON(),localNorthDirections:o}}async createFlowMesh(e,t){const s={data:new Float32Array(e.flowData.buffer),mask:new Uint8Array(e.flowData.maskBuffer),width:e.flowData.width,height:e.flowData.height},{vertexData:o,indexData:r}=await O(e.meshType,e.simulationSettings,s,t.signal);return{result:{vertexBuffer:o.buffer,indexBuffer:r.buffer},transferList:[o.buffer,r.buffer]}}async getProjectionOffsetGrid(e){const t=a.fromJSON(e.projectedExtent),s=a.fromJSON(e.srcBufferExtent);let o=null;e.datumTransformationSteps&&(o=new c({steps:e.datumTransformationSteps})),(e.includeGCSGrid||k(t.spatialReference,s.spatialReference,o))&&await b();const r=e.rasterTransform?P(e.rasterTransform):null;return g({...e,projectedExtent:t,srcBufferExtent:s,datumTransformation:o,rasterTransform:r})}}export{E as default}; diff --git a/assets/RawBlockCache-D9cjIDVu.js b/assets/RawBlockCache-DNGqU_D7.js similarity index 97% rename from assets/RawBlockCache-D9cjIDVu.js rename to assets/RawBlockCache-DNGqU_D7.js index 306723f..6fa94b6 100644 --- a/assets/RawBlockCache-D9cjIDVu.js +++ b/assets/RawBlockCache-DNGqU_D7.js @@ -1 +1 @@ -import{aA as W}from"./index-CEWggaxV.js";import{J,C as L,r as q}from"./rasterProjectionHelper-Bwvi37wQ.js";class F{constructor(n=15e3,e=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=n,this._interval=Math.min(n,e)}decreaseRefCount(n,e){const t=n+"/"+e,r=this._cachedBlocks;if(r.has(t)){const l=r.get(t);return l.refCount--,l.refCount<=0&&(r.delete(t),l.controller&&l.controller.abort()),l.refCount}return 0}getBlock(n,e){const t=n+"/"+e,r=this._cachedBlocks;if(r.has(t)){const l=r.get(t);return l.ts=Date.now(),l.refCount++,r.delete(t),r.set(t,l),l.block}return null}putBlock(n,e,t,r){const l=this._cachedBlocks,i=n+"/"+e;if(l.has(i)){const c=l.get(i);c.ts=Date.now(),c.refCount++}else l.set(i,{block:t,ts:Date.now(),refCount:1,controller:r});this._trim(),this._updateTimer()}deleteBlock(n,e){const t=this._cachedBlocks,r=n+"/"+e;t.has(r)&&t.delete(r)}updateMaxSize(n){this._size=n,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(this._timer!=null)return;const n=this._cachedBlocks;this._timer=setInterval(()=>{const e=Array.from(n),t=Date.now();for(let r=0;r=n.size)return;const e=Array.from(n);for(let t=0;tt!=null)||f.delete(o))}function U(o,n,e){var i,c;const t=f.get(o);if(!t)return n==null?d.decreaseRefCount(o,e):0;if(n==null||t[n]==null)return d.decreaseRefCount(o,e);const r=(i=t[n])==null?void 0:i.cache,l=r==null?void 0:r.get(e);if(r&&l){if(l.refCount--,l.refCount===0){r.delete(e);for(let s=0;si.isResolved=!0).catch(()=>i.isRejected=!0),(c=l[n])==null||c.cache.set(e,i)}function Y(o,n,e){var r;const t=f.get(o);t?n!=null&&t[n]!=null?(r=t[n])==null||r.cache.delete(e):d.deleteBlock(o,e):n==null&&d.deleteBlock(o,e)}function G(o,n){const e=f.get(o);return e?e[n]??null:null}function Z(o,n,e,t,r,l,i=null){const c=G(o,n);if(!c)return;const s=c.extent,{cache:a,rasterInfo:m}=c;if(s&&s.xmin===e.xmin&&s.xmax===e.xmax&&s.ymin===e.ymin&&s.ymax===e.ymax)return;t=t??0;const M=e.clone().normalize(),{spatialReference:R,transform:v}=m,b=new Set;for(let g=0;g0?x.pyramidBlockWidth:x.blockWidth,$=p>0?x.pyramidBlockHeight:x.blockHeight,y=1,A=Math.max(0,Math.floor(k.x/z)-y),H=Math.max(0,Math.floor(k.y/$)-y),S=Math.floor((k.x+j-1)/z)+y,E=Math.floor((k.y+D-1)/$)+y;for(let B=H;B<=E;B++)for(let C=A;C<=S;C++)b.add(`${p}/${B}/${C}`)}a.forEach((g,h)=>{if(!b.has(h)){const u=a.get(h);(u==null||u.isResolved||u.isRejected)&&a.delete(h)}}),c.extent={xmin:e.xmin,ymin:e.ymin,xmax:e.xmax,ymax:e.ymax}}export{Q as a,Z as g,Y as h,O as i,V as m,U as s,P as u,X as x}; +import{aA as W}from"./index-BjUNJPVf.js";import{J,C as L,r as q}from"./rasterProjectionHelper-CHkyWbma.js";class F{constructor(n=15e3,e=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=n,this._interval=Math.min(n,e)}decreaseRefCount(n,e){const t=n+"/"+e,r=this._cachedBlocks;if(r.has(t)){const l=r.get(t);return l.refCount--,l.refCount<=0&&(r.delete(t),l.controller&&l.controller.abort()),l.refCount}return 0}getBlock(n,e){const t=n+"/"+e,r=this._cachedBlocks;if(r.has(t)){const l=r.get(t);return l.ts=Date.now(),l.refCount++,r.delete(t),r.set(t,l),l.block}return null}putBlock(n,e,t,r){const l=this._cachedBlocks,i=n+"/"+e;if(l.has(i)){const c=l.get(i);c.ts=Date.now(),c.refCount++}else l.set(i,{block:t,ts:Date.now(),refCount:1,controller:r});this._trim(),this._updateTimer()}deleteBlock(n,e){const t=this._cachedBlocks,r=n+"/"+e;t.has(r)&&t.delete(r)}updateMaxSize(n){this._size=n,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(this._timer!=null)return;const n=this._cachedBlocks;this._timer=setInterval(()=>{const e=Array.from(n),t=Date.now();for(let r=0;r=n.size)return;const e=Array.from(n);for(let t=0;tt!=null)||f.delete(o))}function U(o,n,e){var i,c;const t=f.get(o);if(!t)return n==null?d.decreaseRefCount(o,e):0;if(n==null||t[n]==null)return d.decreaseRefCount(o,e);const r=(i=t[n])==null?void 0:i.cache,l=r==null?void 0:r.get(e);if(r&&l){if(l.refCount--,l.refCount===0){r.delete(e);for(let s=0;si.isResolved=!0).catch(()=>i.isRejected=!0),(c=l[n])==null||c.cache.set(e,i)}function Y(o,n,e){var r;const t=f.get(o);t?n!=null&&t[n]!=null?(r=t[n])==null||r.cache.delete(e):d.deleteBlock(o,e):n==null&&d.deleteBlock(o,e)}function G(o,n){const e=f.get(o);return e?e[n]??null:null}function Z(o,n,e,t,r,l,i=null){const c=G(o,n);if(!c)return;const s=c.extent,{cache:a,rasterInfo:m}=c;if(s&&s.xmin===e.xmin&&s.xmax===e.xmax&&s.ymin===e.ymin&&s.ymax===e.ymax)return;t=t??0;const M=e.clone().normalize(),{spatialReference:R,transform:v}=m,b=new Set;for(let g=0;g0?x.pyramidBlockWidth:x.blockWidth,$=p>0?x.pyramidBlockHeight:x.blockHeight,y=1,A=Math.max(0,Math.floor(k.x/z)-y),H=Math.max(0,Math.floor(k.y/$)-y),S=Math.floor((k.x+j-1)/z)+y,E=Math.floor((k.y+D-1)/$)+y;for(let B=H;B<=E;B++)for(let C=A;C<=S;C++)b.add(`${p}/${B}/${C}`)}a.forEach((g,h)=>{if(!b.has(h)){const u=a.get(h);(u==null||u.isResolved||u.isRejected)&&a.delete(h)}}),c.extent={xmin:e.xmin,ymin:e.ymin,xmax:e.xmax,ymax:e.ymax}}export{Q as a,Z as g,Y as h,O as i,V as m,U as s,P as u,X as x}; diff --git a/assets/RefreshableLayer-1EkEhJeI.js b/assets/RefreshableLayer-_r2TPtol.js similarity index 96% rename from assets/RefreshableLayer-1EkEhJeI.js rename to assets/RefreshableLayer-_r2TPtol.js index 972a801..d423d5c 100644 --- a/assets/RefreshableLayer-1EkEhJeI.js +++ b/assets/RefreshableLayer-_r2TPtol.js @@ -1 +1 @@ -import{V as d,eU as u,d as a,y as h,eV as m,e1 as p,f as v,k as y,eW as g,s as I}from"./index-CEWggaxV.js";const n=new d,o=new WeakMap;function w(t){C(t)&&n.push(new WeakRef(t))}function b(t){const e=n.find(s=>s.deref()===t);e&&n.remove(e)}function C(t){return t!=null&&typeof t=="object"&&"refreshInterval"in t&&"refresh"in t}function c(t,e){return Number.isFinite(t)&&Number.isFinite(e)?e<=0?t:c(e,t%e):0}let f=0,i=0;function D(){const t=Date.now();let e=!1;for(const s of n){const r=s.deref();r?r.refreshInterval&&t-(o.get(r)??0)+5>=6e4*r.refreshInterval&&(o.set(r,t),r.refresh(t)):e=!0}if(e)for(let s=n.length-1;s>=0;s--)n.at(s).deref()||n.removeAt(s)}u(()=>{const t=Date.now();let e=0;for(const s of n){const r=s.deref();r&&(e=c(Math.round(6e4*r.refreshInterval),e),r.refreshInterval?o.get(r)||o.set(r,t):o.delete(r))}if(e!==i){if(i=e,clearInterval(f),i===0)return void(f=0);f=setInterval(D,i)}});const l=.1,T=t=>{let e=class extends t{constructor(...s){super(...s),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=y(()=>this.hasDataChanged()),this.when().then(()=>{this.destroyed||w(this)},()=>{})}destroy(){b(this)}castRefreshInterval(s){return s>=l?s:s<=0?0:l}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(s=Date.now()){g(this._debounceHasDataChanged()).then(r=>{r&&this._set("refreshTimestamp",s),this.emit("refresh",{dataChanged:r})},r=>{I.getLogger(this).error(r),this.emit("refresh",{dataChanged:!1,error:r})})}async hasDataChanged(){return!0}get test(){const s=this;return{set refreshInterval(r){s._set("refreshInterval",r)}}}};return a([h({type:Number,json:{write:!0,origins:{"web-scene":{write:{enabled:!0,layerContainerTypes:m}}}}})],e.prototype,"refreshInterval",void 0),a([p("refreshInterval")],e.prototype,"castRefreshInterval",null),a([h({readOnly:!0})],e.prototype,"refreshTimestamp",void 0),a([h({readOnly:!0})],e.prototype,"refreshParameters",null),e=a([v("esri.layers.mixins.RefreshableLayer")],e),e};export{T as f}; +import{V as d,eU as u,d as a,y as h,eV as m,e1 as p,f as v,k as y,eW as g,s as I}from"./index-BjUNJPVf.js";const n=new d,o=new WeakMap;function w(t){C(t)&&n.push(new WeakRef(t))}function b(t){const e=n.find(s=>s.deref()===t);e&&n.remove(e)}function C(t){return t!=null&&typeof t=="object"&&"refreshInterval"in t&&"refresh"in t}function c(t,e){return Number.isFinite(t)&&Number.isFinite(e)?e<=0?t:c(e,t%e):0}let f=0,i=0;function D(){const t=Date.now();let e=!1;for(const s of n){const r=s.deref();r?r.refreshInterval&&t-(o.get(r)??0)+5>=6e4*r.refreshInterval&&(o.set(r,t),r.refresh(t)):e=!0}if(e)for(let s=n.length-1;s>=0;s--)n.at(s).deref()||n.removeAt(s)}u(()=>{const t=Date.now();let e=0;for(const s of n){const r=s.deref();r&&(e=c(Math.round(6e4*r.refreshInterval),e),r.refreshInterval?o.get(r)||o.set(r,t):o.delete(r))}if(e!==i){if(i=e,clearInterval(f),i===0)return void(f=0);f=setInterval(D,i)}});const l=.1,T=t=>{let e=class extends t{constructor(...s){super(...s),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=y(()=>this.hasDataChanged()),this.when().then(()=>{this.destroyed||w(this)},()=>{})}destroy(){b(this)}castRefreshInterval(s){return s>=l?s:s<=0?0:l}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(s=Date.now()){g(this._debounceHasDataChanged()).then(r=>{r&&this._set("refreshTimestamp",s),this.emit("refresh",{dataChanged:r})},r=>{I.getLogger(this).error(r),this.emit("refresh",{dataChanged:!1,error:r})})}async hasDataChanged(){return!0}get test(){const s=this;return{set refreshInterval(r){s._set("refreshInterval",r)}}}};return a([h({type:Number,json:{write:!0,origins:{"web-scene":{write:{enabled:!0,layerContainerTypes:m}}}}})],e.prototype,"refreshInterval",void 0),a([p("refreshInterval")],e.prototype,"castRefreshInterval",null),a([h({readOnly:!0})],e.prototype,"refreshTimestamp",void 0),a([h({readOnly:!0})],e.prototype,"refreshParameters",null),e=a([v("esri.layers.mixins.RefreshableLayer")],e),e};export{T as f}; diff --git a/assets/RefreshableLayerView-C1-PEoNB.js b/assets/RefreshableLayerView-L9NGpXXI.js similarity index 81% rename from assets/RefreshableLayerView-C1-PEoNB.js rename to assets/RefreshableLayerView-L9NGpXXI.js index 7d081f3..00fecd6 100644 --- a/assets/RefreshableLayerView-C1-PEoNB.js +++ b/assets/RefreshableLayerView-L9NGpXXI.js @@ -1 +1 @@ -import{d as i,f as t,z as h,b as d,s as l}from"./index-CEWggaxV.js";const o=a=>{let e=class extends a{initialize(){this.addHandles(h(()=>this.layer,"refresh",r=>{this.doRefresh(r.dataChanged).catch(s=>{d(s)||l.getLogger(this).error(s)})}),"RefreshableLayerView")}};return e=i([t("esri.layers.mixins.RefreshableLayerView")],e),e};export{o as i}; +import{d as i,f as t,z as h,b as d,s as l}from"./index-BjUNJPVf.js";const o=a=>{let e=class extends a{initialize(){this.addHandles(h(()=>this.layer,"refresh",r=>{this.doRefresh(r.dataChanged).catch(s=>{d(s)||l.getLogger(this).error(s)})}),"RefreshableLayerView")}};return e=i([t("esri.layers.mixins.RefreshableLayerView")],e),e};export{o as i}; diff --git a/assets/RelationshipQuery-DDK72Kwc.js b/assets/RelationshipQuery-BDJrOxaX.js similarity index 97% rename from assets/RelationshipQuery-DDK72Kwc.js rename to assets/RelationshipQuery-BDJrOxaX.js index 2ddd97b..5423e4b 100644 --- a/assets/RelationshipQuery-DDK72Kwc.js +++ b/assets/RelationshipQuery-BDJrOxaX.js @@ -1 +1 @@ -import{d as e,y as o,aQ as a,aR as s,aS as d,f as p,aT as l,aU as u,aV as h}from"./index-CEWggaxV.js";var n;let t=n=class extends u{constructor(i){super(i),this.cacheHint=void 0,this.dynamicDataSource=void 0,this.gdbVersion=null,this.geometryPrecision=void 0,this.historicMoment=null,this.maxAllowableOffset=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.relationshipId=void 0,this.start=void 0,this.num=void 0,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.where=null}_writeHistoricMoment(i,r){r.historicMoment=i&&i.getTime()}writeStart(i,r){r.resultOffset=this.start,r.resultRecordCount=this.num||10,this.start>0&&this.where==null&&(r.definitionExpression="1=1")}clone(){return new n(h({cacheHint:this.cacheHint,dynamicDataSource:this.dynamicDataSource,gdbVersion:this.gdbVersion,geometryPrecision:this.geometryPrecision,historicMoment:this.historicMoment&&new Date(this.historicMoment.getTime()),maxAllowableOffset:this.maxAllowableOffset,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,relationshipId:this.relationshipId,start:this.start,num:this.num,returnGeometry:this.returnGeometry,where:this.where,returnZ:this.returnZ,returnM:this.returnM}))}};e([o({type:Boolean,json:{write:!0}})],t.prototype,"cacheHint",void 0),e([o({type:a,json:{write:!0}})],t.prototype,"dynamicDataSource",void 0),e([o({type:String,json:{write:!0}})],t.prototype,"gdbVersion",void 0),e([o({type:Number,json:{write:!0}})],t.prototype,"geometryPrecision",void 0),e([o({type:Date})],t.prototype,"historicMoment",void 0),e([s("historicMoment")],t.prototype,"_writeHistoricMoment",null),e([o({type:Number,json:{write:!0}})],t.prototype,"maxAllowableOffset",void 0),e([o({type:[Number],json:{write:!0}})],t.prototype,"objectIds",void 0),e([o({type:[String],json:{write:!0}})],t.prototype,"orderByFields",void 0),e([o({type:[String],json:{write:!0}})],t.prototype,"outFields",void 0),e([o({type:d,json:{read:{source:"outSR"},write:{target:"outSR"}}})],t.prototype,"outSpatialReference",void 0),e([o({json:{write:!0}})],t.prototype,"relationshipId",void 0),e([o({type:Number,json:{read:{source:"resultOffset"}}})],t.prototype,"start",void 0),e([s("start"),s("num")],t.prototype,"writeStart",null),e([o({type:Number,json:{read:{source:"resultRecordCount"}}})],t.prototype,"num",void 0),e([o({json:{write:!0}})],t.prototype,"returnGeometry",void 0),e([o({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],t.prototype,"returnM",void 0),e([o({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],t.prototype,"returnZ",void 0),e([o({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],t.prototype,"where",void 0),t=n=e([p("esri.rest.support.RelationshipQuery")],t),t.from=l(t);const c=t;export{c as default}; +import{d as e,y as o,aQ as a,aR as s,aS as d,f as p,aT as l,aU as u,aV as h}from"./index-BjUNJPVf.js";var n;let t=n=class extends u{constructor(i){super(i),this.cacheHint=void 0,this.dynamicDataSource=void 0,this.gdbVersion=null,this.geometryPrecision=void 0,this.historicMoment=null,this.maxAllowableOffset=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.relationshipId=void 0,this.start=void 0,this.num=void 0,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.where=null}_writeHistoricMoment(i,r){r.historicMoment=i&&i.getTime()}writeStart(i,r){r.resultOffset=this.start,r.resultRecordCount=this.num||10,this.start>0&&this.where==null&&(r.definitionExpression="1=1")}clone(){return new n(h({cacheHint:this.cacheHint,dynamicDataSource:this.dynamicDataSource,gdbVersion:this.gdbVersion,geometryPrecision:this.geometryPrecision,historicMoment:this.historicMoment&&new Date(this.historicMoment.getTime()),maxAllowableOffset:this.maxAllowableOffset,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,relationshipId:this.relationshipId,start:this.start,num:this.num,returnGeometry:this.returnGeometry,where:this.where,returnZ:this.returnZ,returnM:this.returnM}))}};e([o({type:Boolean,json:{write:!0}})],t.prototype,"cacheHint",void 0),e([o({type:a,json:{write:!0}})],t.prototype,"dynamicDataSource",void 0),e([o({type:String,json:{write:!0}})],t.prototype,"gdbVersion",void 0),e([o({type:Number,json:{write:!0}})],t.prototype,"geometryPrecision",void 0),e([o({type:Date})],t.prototype,"historicMoment",void 0),e([s("historicMoment")],t.prototype,"_writeHistoricMoment",null),e([o({type:Number,json:{write:!0}})],t.prototype,"maxAllowableOffset",void 0),e([o({type:[Number],json:{write:!0}})],t.prototype,"objectIds",void 0),e([o({type:[String],json:{write:!0}})],t.prototype,"orderByFields",void 0),e([o({type:[String],json:{write:!0}})],t.prototype,"outFields",void 0),e([o({type:d,json:{read:{source:"outSR"},write:{target:"outSR"}}})],t.prototype,"outSpatialReference",void 0),e([o({json:{write:!0}})],t.prototype,"relationshipId",void 0),e([o({type:Number,json:{read:{source:"resultOffset"}}})],t.prototype,"start",void 0),e([s("start"),s("num")],t.prototype,"writeStart",null),e([o({type:Number,json:{read:{source:"resultRecordCount"}}})],t.prototype,"num",void 0),e([o({json:{write:!0}})],t.prototype,"returnGeometry",void 0),e([o({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],t.prototype,"returnM",void 0),e([o({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],t.prototype,"returnZ",void 0),e([o({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],t.prototype,"where",void 0),t=n=e([p("esri.rest.support.RelationshipQuery")],t),t.from=l(t);const c=t;export{c as default}; diff --git a/assets/RenderingContext-2weDpoeh.js b/assets/RenderingContext-vSxDymNY.js similarity index 98% rename from assets/RenderingContext-2weDpoeh.js rename to assets/RenderingContext-vSxDymNY.js index 863c266..c607844 100644 --- a/assets/RenderingContext-2weDpoeh.js +++ b/assets/RenderingContext-vSxDymNY.js @@ -1,4 +1,4 @@ -import{c as V}from"./WGLContainer-B_Pv-8Yi.js";import{glslifyDefineMap as it,ProgramCache as rt}from"./webglDeps-BqalI_vm.js";import{g4 as m,he as D,hc as R,hd as et,hf as v,iS as T,gf as B,fX as A,iy as l,g3 as d,g5 as x,E as y,D as P,L as S,v as G,U,fV as k,iv as L,cz as Y,l as nt,s as at,jv as lt,eB as z,jw as I,g2 as b,iD as E,jx as ot,jy as q,fx as ht,B as _t,it as O}from"./index-CEWggaxV.js";import{e as w,m as st,c as F,u as H,o as ut}from"./Texture-DJgkMrSB.js";import{o as K,S as ft,s as ct,G as dt}from"./OrderIndependentTransparency-C747AfeB.js";import{h as C,x as M}from"./Program-DLRmaKpw.js";import{t as N,f as gt,a as Et}from"./testSVGPremultipliedAlpha-B0ipOzbU.js";import{r as pt}from"./floatRGBA-BLm-Rhaq.js";import{t as j}from"./doublePrecisionUtils-B0owpBza.js";import{o as X}from"./ProgramTemplate-BICQrNzS.js";const bt=n=>{let t="";t+=n[0].toUpperCase();for(let e=1;e{const t={};for(const e in n)t[bt(e)]=n[e];return it(t)},Vt=(n,t,e,s)=>{const i=n+n.substring(n.lastIndexOf("/")),r=t+t.substring(t.lastIndexOf("/")),a=Ft(s);return{attributes:e,shaders:{vertexShader:a+V(`${i}.vert`),fragmentShader:a+V(`${r}.frag`)}}};let Z=class{constructor(){this.blend=!1,this.blendColor={r:0,g:0,b:0,a:0},this.blendFunction={srcRGB:m.ONE,dstRGB:m.ZERO,srcAlpha:m.ONE,dstAlpha:m.ZERO},this.blendEquation={mode:D.ADD,modeAlpha:D.ADD},this.colorMask={r:!0,g:!0,b:!0,a:!0},this.faceCulling=!1,this.cullFace=R.BACK,this.frontFace=et.CCW,this.scissorTest=!1,this.scissorRect={x:0,y:0,width:0,height:0},this.depthTest=!1,this.depthFunction=v.LESS,this.clearDepth=1,this.depthWrite=!0,this.depthRange={zNear:0,zFar:1},this.viewport=null,this.stencilTest=!1,this.polygonOffsetFill=!1,this.polygonOffset=[0,0],this.stencilFunction={face:R.FRONT_AND_BACK,func:v.ALWAYS,ref:0,mask:1},this.clearStencil=0,this.stencilWriteMask=1,this.stencilOperation={face:R.FRONT_AND_BACK,fail:T.KEEP,zFail:T.KEEP,zPass:T.KEEP},this.clearColor={r:0,g:0,b:0,a:0},this.program=null,this.vertexBuffer=null,this.indexBuffer=null,this.uniformBuffer=null,this.pixelPackBuffer=null,this.pixelUnpackBuffer=null,this.copyReadBuffer=null,this.copyWriteBuffer=null,this.transformFeedbackBuffer=null,this.uniformBufferBindingPoints=new Array,this.transformBufferBindingPoints=new Array,this.readFramebuffer=null,this.drawFramebuffer=null,this.renderbuffer=null,this.activeTexture=0,this.textureUnitMap=new Array,this.vertexArrayObject=null}},Rt=class{constructor(){for(this._current=new Array,this._allocations=null;this._current.lengtht+(s0){t+=`Live objects: +import{c as V}from"./WGLContainer-DgZNq7b0.js";import{glslifyDefineMap as it,ProgramCache as rt}from"./webglDeps-Cjw3mzdd.js";import{g4 as m,he as D,hc as R,hd as et,hf as v,iS as T,gf as B,fX as A,iy as l,g3 as d,g5 as x,E as y,D as P,L as S,v as G,U,fV as k,iv as L,cz as Y,l as nt,s as at,jv as lt,eB as z,jw as I,g2 as b,iD as E,jx as ot,jy as q,fx as ht,B as _t,it as O}from"./index-BjUNJPVf.js";import{e as w,m as st,c as F,u as H,o as ut}from"./Texture-S4dD-WHn.js";import{o as K,S as ft,s as ct,G as dt}from"./OrderIndependentTransparency-Btph8gYx.js";import{h as C,x as M}from"./Program-DBsYtQ00.js";import{t as N,f as gt,a as Et}from"./testSVGPremultipliedAlpha-BUMQhQ4O.js";import{r as pt}from"./floatRGBA-Cs54GdjG.js";import{t as j}from"./doublePrecisionUtils-B0owpBza.js";import{o as X}from"./ProgramTemplate-Ck2I0bIi.js";const bt=n=>{let t="";t+=n[0].toUpperCase();for(let e=1;e{const t={};for(const e in n)t[bt(e)]=n[e];return it(t)},Vt=(n,t,e,s)=>{const i=n+n.substring(n.lastIndexOf("/")),r=t+t.substring(t.lastIndexOf("/")),a=Ft(s);return{attributes:e,shaders:{vertexShader:a+V(`${i}.vert`),fragmentShader:a+V(`${r}.frag`)}}};let Z=class{constructor(){this.blend=!1,this.blendColor={r:0,g:0,b:0,a:0},this.blendFunction={srcRGB:m.ONE,dstRGB:m.ZERO,srcAlpha:m.ONE,dstAlpha:m.ZERO},this.blendEquation={mode:D.ADD,modeAlpha:D.ADD},this.colorMask={r:!0,g:!0,b:!0,a:!0},this.faceCulling=!1,this.cullFace=R.BACK,this.frontFace=et.CCW,this.scissorTest=!1,this.scissorRect={x:0,y:0,width:0,height:0},this.depthTest=!1,this.depthFunction=v.LESS,this.clearDepth=1,this.depthWrite=!0,this.depthRange={zNear:0,zFar:1},this.viewport=null,this.stencilTest=!1,this.polygonOffsetFill=!1,this.polygonOffset=[0,0],this.stencilFunction={face:R.FRONT_AND_BACK,func:v.ALWAYS,ref:0,mask:1},this.clearStencil=0,this.stencilWriteMask=1,this.stencilOperation={face:R.FRONT_AND_BACK,fail:T.KEEP,zFail:T.KEEP,zPass:T.KEEP},this.clearColor={r:0,g:0,b:0,a:0},this.program=null,this.vertexBuffer=null,this.indexBuffer=null,this.uniformBuffer=null,this.pixelPackBuffer=null,this.pixelUnpackBuffer=null,this.copyReadBuffer=null,this.copyWriteBuffer=null,this.transformFeedbackBuffer=null,this.uniformBufferBindingPoints=new Array,this.transformBufferBindingPoints=new Array,this.readFramebuffer=null,this.drawFramebuffer=null,this.renderbuffer=null,this.activeTexture=0,this.textureUnitMap=new Array,this.vertexArrayObject=null}},Rt=class{constructor(){for(this._current=new Array,this._allocations=null;this._current.lengtht+(s0){t+=`Live objects: `;for(let s=0;s0&&(t+=`${B[s]}: ${i} `)}}return t+=(e=this._allocations)==null?void 0:e.resetLog(),t}},mt=class{constructor(t,e,s){const i=e.textureFilterAnisotropic,r=s.maxAnisotropy??1/0;this.versionString=t.getParameter(t.VERSION),this.maxVertexTextureImageUnits=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),this.maxVertexAttributes=t.getParameter(t.MAX_VERTEX_ATTRIBS),this.maxMaxAnisotropy=i?Math.min(t.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY),r):1,this.maxTextureImageUnits=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),this.maxRenderbufferSize=t.getParameter(t.MAX_RENDERBUFFER_SIZE),this.maxViewportDims=t.getParameter(t.MAX_VIEWPORT_DIMS),this.maxUniformBufferBindings=t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS),this.maxVertexUniformBlocks=t.getParameter(t.MAX_VERTEX_UNIFORM_BLOCKS),this.maxFragmentUniformBlocks=t.getParameter(t.MAX_FRAGMENT_UNIFORM_BLOCKS),this.maxUniformBlockSize=t.getParameter(t.MAX_UNIFORM_BLOCK_SIZE),this.uniformBufferOffsetAlignment=t.getParameter(t.UNIFORM_BUFFER_OFFSET_ALIGNMENT),this.maxArrayTextureLayers=t.getParameter(t.MAX_ARRAY_TEXTURE_LAYERS),this.maxSamples=t.getParameter(t.MAX_SAMPLES)}};class W{constructor(t){this._rctx=t,this._indexBuffer=this._createIndexbuffer(),this._program=this._createHelperProgram()}static getShaderSources(){return{vertex:`#version 300 es precision highp float; diff --git a/assets/RouteLayer-Ba4tA3kd.js b/assets/RouteLayer-DIjUW0_h.js similarity index 98% rename from assets/RouteLayer-Ba4tA3kd.js rename to assets/RouteLayer-DIjUW0_h.js index 00ad49f..64b524e 100644 --- a/assets/RouteLayer-Ba4tA3kd.js +++ b/assets/RouteLayer-DIjUW0_h.js @@ -1,2 +1,2 @@ -import{d as r,y as s,hm as k,f as A,aU as L,dy as z,dw as he,dz as it,c9 as I,aZ as P,aR as q,N as M,ep as fe,M as re,kQ as Se,aG as nt,aW as We,s as Ze,aY as ze,aA as Ve,j as K,aC as be,aE as Ke,aS as W,q as Qe,dj as at,kR as lt,b4 as Pe,a$ as ut,b0 as pt,er as ct,V as O,bP as yt,bQ as dt,dp as mt,dq as ft,dr as ht,z as vt,b1 as wt,aD as gt,cB as ke,bE as Ce,kh as St,bW as bt,aw as Tt,ax as Bt,el as Nt,b as Pt,i as Rt,d2 as $t,bv as It,hJ as At,bT as Ot}from"./index-CEWggaxV.js";import"./UniqueValueRenderer-BlkUix3g.js";import{o as jt}from"./jsonUtils-BseLl1fZ.js";import{i as Lt}from"./originUtils-D69mHv66.js";import{U as Q,y as Re,s as Dt,R as Mt,r as He,b as $e,d as kt,n as Ct,o as Jt,w as _t,S as xt,D as Je,e as Ft,k as Et,i as Ut,h as Gt,l as qt,m as oe,c as se,O as Y,f as X,j as ee,a as te,g as le,p as Wt}from"./Stop-VHT4QwcG.js";import{d as E}from"./FeatureSet-CYJUZgOk.js";import"./ColorStop-44hBlQ14.js";import"./diffUtils-B4YFa5Ju.js";import"./colorRamps-BJydlf0f.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-z2k12BH8.js";import"./jsonUtils-qYmXvGJ1.js";import"./styleUtils-CnV_Xzhi.js";import"./Version-Bd0QsIQ5.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./OverrideHelper-B4ryGWZb.js";import"./utils-p-5Bbga5.js";import"./quantizationUtils-CUjGHrU3.js";import"./heatmapUtils-Clt5rJzr.js";import"./multiOriginJSONSupportUtils-C0wm8_Yw.js";let U=class extends L{constructor(t){super(t),this.break=new z({color:[255,255,255],size:12,outline:{color:[0,122,194],width:3}}),this.first=new z({color:[0,255,0],size:20,outline:{color:[255,255,255],width:4}}),this.unlocated=new z({color:[255,0,0],size:12,outline:{color:[255,255,255],width:3}}),this.last=new z({color:[255,0,0],size:20,outline:{color:[255,255,255],width:4}}),this.middle=new z({color:[51,51,51],size:12,outline:{color:[0,122,194],width:3}}),this.waypoint=new z({color:[255,255,255],size:12,outline:{color:[0,122,194],width:3}})}};r([s({types:k})],U.prototype,"break",void 0),r([s({types:k})],U.prototype,"first",void 0),r([s({types:k})],U.prototype,"unlocated",void 0),r([s({types:k})],U.prototype,"last",void 0),r([s({types:k})],U.prototype,"middle",void 0),r([s({types:k})],U.prototype,"waypoint",void 0),U=r([A("esri.layers.support.RouteStopSymbols")],U);const Ye=U;let x=class extends L{constructor(t){super(t),this.directionLines=new he({color:[0,122,194],width:6}),this.directionPoints=new z({color:[255,255,255],size:6,outline:{color:[0,122,194],width:2}}),this.pointBarriers=new z({style:"x",size:10,outline:{color:[255,0,0],width:3}}),this.polygonBarriers=new it({color:[255,170,0,.6],outline:{width:7.5,color:[255,0,0,.6]}}),this.polylineBarriers=new he({width:7.5,color:[255,85,0,.7]}),this.routeInfo=new he({width:8,color:[20,89,127]}),this.stops=new Ye}};r([s({types:k})],x.prototype,"directionLines",void 0),r([s({types:k})],x.prototype,"directionPoints",void 0),r([s({types:k})],x.prototype,"pointBarriers",void 0),r([s({types:k})],x.prototype,"polygonBarriers",void 0),r([s({types:k})],x.prototype,"polylineBarriers",void 0),r([s({types:k})],x.prototype,"routeInfo",void 0),r([s({type:Ye})],x.prototype,"stops",void 0),x=r([A("esri.layers.support.RouteSymbols")],x);const Xe=x;let J=class extends L{constructor(t){super(t),this.dataType=null,this.name=null,this.parameterNames=null,this.restrictionUsageParameterName=null,this.timeNeutralAttributeName=null,this.trafficSupport=null,this.units=null,this.usageType=null}};r([s({type:String})],J.prototype,"dataType",void 0),r([I(Q,{ignoreUnknown:!1})],J.prototype,"name",void 0),r([s({type:[String]})],J.prototype,"parameterNames",void 0),r([s({type:String})],J.prototype,"restrictionUsageParameterName",void 0),r([I(Re,{ignoreUnknown:!1})],J.prototype,"timeNeutralAttributeName",void 0),r([s({type:String})],J.prototype,"trafficSupport",void 0),r([I(Dt)],J.prototype,"units",void 0),r([I(Mt)],J.prototype,"usageType",void 0),J=r([A("esri.rest.support.NetworkAttribute")],J);const Zt=J;let Z=class extends L{constructor(t){super(t),this.buildTime=null,this.name=null,this.networkAttributes=null,this.networkSources=null,this.state=null}};r([s({type:Number})],Z.prototype,"buildTime",void 0),r([s({type:String})],Z.prototype,"name",void 0),r([s({type:[Zt]})],Z.prototype,"networkAttributes",void 0),r([s()],Z.prototype,"networkSources",void 0),r([s({type:String})],Z.prototype,"state",void 0),Z=r([A("esri.rest.support.NetworkDataset")],Z);const zt=Z;let $=class extends L{constructor(t){super(t),this.accumulateAttributeNames=null,this.attributeParameterValues=null,this.currentVersion=null,this.defaultTravelMode=null,this.directionsLanguage=null,this.directionsLengthUnits=null,this.directionsSupportedLanguages=null,this.directionsTimeAttribute=null,this.hasZ=null,this.impedance=null,this.networkDataset=null,this.supportedTravelModes=null}readAccumulateAttributes(t){return t==null?null:t.map(o=>Q.fromJSON(o))}writeAccumulateAttributes(t,o,i){t!=null&&t.length&&(o[i]=t.map(n=>Q.toJSON(n)))}get capabilities(){return{supportsNow:(this.currentVersion??10)>=10.81}}readDefaultTravelMode(t,o){var n,p;const i=((n=o.supportedTravelModes)==null?void 0:n.find(({id:l})=>l===o.defaultTravelMode))??((p=o.supportedTravelModes)==null?void 0:p.find(({itemId:l})=>l===o.defaultTravelMode));return i?$e.fromJSON(i):null}};r([s()],$.prototype,"accumulateAttributeNames",void 0),r([P("accumulateAttributeNames")],$.prototype,"readAccumulateAttributes",null),r([q("accumulateAttributeNames")],$.prototype,"writeAccumulateAttributes",null),r([s()],$.prototype,"attributeParameterValues",void 0),r([s()],$.prototype,"capabilities",null),r([s()],$.prototype,"currentVersion",void 0),r([s()],$.prototype,"defaultTravelMode",void 0),r([P("defaultTravelMode",["defaultTravelMode","supportedTravelModes"])],$.prototype,"readDefaultTravelMode",null),r([s()],$.prototype,"directionsLanguage",void 0),r([I(He)],$.prototype,"directionsLengthUnits",void 0),r([s()],$.prototype,"directionsSupportedLanguages",void 0),r([I(Re,{ignoreUnknown:!1})],$.prototype,"directionsTimeAttribute",void 0),r([s()],$.prototype,"hasZ",void 0),r([I(Q,{ignoreUnknown:!1})],$.prototype,"impedance",void 0),r([s({type:zt})],$.prototype,"networkDataset",void 0),r([s({type:[$e]})],$.prototype,"supportedTravelModes",void 0),$=r([A("esri.rest.support.NetworkServiceDescription")],$);const Vt=$,Kt=()=>Ze.getLogger("esri.rest.networkService");function ue(e,t,o,i){i[o]=[t.length,t.length+e.length],e.forEach(n=>{t.push(n.geometry)})}function Qt(e,t){for(let o=0;oQ.fromJSON(o))}writeAccumulateAttributes(t,o,i){t!=null&&t.length&&(o[i]=t.map(n=>Q.toJSON(n)))}get capabilities(){return{supportsNow:(this.currentVersion??10)>=10.81}}readDefaultTravelMode(t,o){var n,p;const i=((n=o.supportedTravelModes)==null?void 0:n.find(({id:l})=>l===o.defaultTravelMode))??((p=o.supportedTravelModes)==null?void 0:p.find(({itemId:l})=>l===o.defaultTravelMode));return i?$e.fromJSON(i):null}};r([s()],$.prototype,"accumulateAttributeNames",void 0),r([P("accumulateAttributeNames")],$.prototype,"readAccumulateAttributes",null),r([q("accumulateAttributeNames")],$.prototype,"writeAccumulateAttributes",null),r([s()],$.prototype,"attributeParameterValues",void 0),r([s()],$.prototype,"capabilities",null),r([s()],$.prototype,"currentVersion",void 0),r([s()],$.prototype,"defaultTravelMode",void 0),r([P("defaultTravelMode",["defaultTravelMode","supportedTravelModes"])],$.prototype,"readDefaultTravelMode",null),r([s()],$.prototype,"directionsLanguage",void 0),r([I(He)],$.prototype,"directionsLengthUnits",void 0),r([s()],$.prototype,"directionsSupportedLanguages",void 0),r([I(Re,{ignoreUnknown:!1})],$.prototype,"directionsTimeAttribute",void 0),r([s()],$.prototype,"hasZ",void 0),r([I(Q,{ignoreUnknown:!1})],$.prototype,"impedance",void 0),r([s({type:zt})],$.prototype,"networkDataset",void 0),r([s({type:[$e]})],$.prototype,"supportedTravelModes",void 0),$=r([A("esri.rest.support.NetworkServiceDescription")],$);const Vt=$,Kt=()=>Ze.getLogger("esri.rest.networkService");function ue(e,t,o,i){i[o]=[t.length,t.length+e.length],e.forEach(n=>{t.push(n.geometry)})}function Qt(e,t){for(let o=0;o=10.4?Xt(e,t,o):Yt(e,o),{defaultTravelMode:l,supportedTravelModes:c}=await p;return n.defaultTravelMode=l,n.supportedTravelModes=c,Vt.fromJSON(n)}async function Yt(e,t){var w,f,a;const o=fe({f:"json"},t),{data:i}=await re(e.replace(/\/rest\/.*$/i,"/info"),o);if(!(i!=null&&i.owningSystemUrl))return{supportedTravelModes:[],defaultTravelMode:null};const{owningSystemUrl:n}=i,p=Se(n)+"/sharing/rest/portals/self",{data:l}=await re(p,o),c=nt("helperServices.routingUtilities.url",l);if(!c)return{supportedTravelModes:[],defaultTravelMode:null};const v=We(n),S=/\/solve$/i.test(v.path)?"Route":/\/solveclosestfacility$/i.test(v.path)?"ClosestFacility":"ServiceAreas",u=fe({f:"json",serviceName:S},t),b=Se(c)+"/GetTravelModes/execute",B=await re(b,u),N=[];let h=null;if((f=(w=B==null?void 0:B.data)==null?void 0:w.results)!=null&&f.length){const T=B.data.results;for(const m of T)if(m.paramName==="supportedTravelModes"){if((a=m.value)!=null&&a.features){for(const{attributes:R}of m.value.features)if(R){const C=JSON.parse(R.TravelMode);N.push(C)}}}else m.paramName==="defaultTravelMode"&&(h=m.value)}return{supportedTravelModes:N,defaultTravelMode:h}}async function Xt(e,t,o){try{const i=fe({f:"json",token:t},o),n=Se(e)+"/retrieveTravelModes",{data:{supportedTravelModes:p,defaultTravelMode:l}}=await re(n,i);return{supportedTravelModes:p,defaultTravelMode:l}}catch(i){throw new M("network-service:retrieveTravelModes","Could not get to the NAServer's retrieveTravelModes.",{error:i})}}const _e=new ze({esriJobMessageTypeInformative:"informative",esriJobMessageTypeProcessDefinition:"process-definition",esriJobMessageTypeProcessStart:"process-start",esriJobMessageTypeProcessStop:"process-stop",esriJobMessageTypeWarning:"warning",esriJobMessageTypeError:"error",esriJobMessageTypeEmpty:"empty",esriJobMessageTypeAbort:"abort"});let ie=class extends L{constructor(t){super(t),this.description=null,this.type=null}};r([s({type:String,json:{write:!0}})],ie.prototype,"description",void 0),r([s({type:String,json:{read:_e.read,write:_e.write}})],ie.prototype,"type",void 0),ie=r([A("esri.rest.support.GPMessage")],ie);const er=ie,xe=new ze({0:"informative",1:"process-definition",2:"process-start",3:"process-stop",50:"warning",100:"error",101:"empty",200:"abort"});let de=class extends er{constructor(t){super(t),this.type=null}};r([s({type:String,json:{read:xe.read,write:xe.write}})],de.prototype,"type",void 0),de=r([A("esri.rest.support.NAMessage")],de);const tr=de;let ne=class extends L{constructor(t){super(t)}};r([s({json:{read:{source:"string"}}})],ne.prototype,"text",void 0),r([I(kt,{name:"stringType"})],ne.prototype,"type",void 0),ne=r([A("esri.rest.support.DirectionsString")],ne);const tt=ne;let G=class extends L{constructor(t){super(t),this.arriveTime=null,this.arriveTimeOffset=null,this.geometry=null,this.strings=null}readArriveTimeOffset(t,o){return Ct(o.ETA,o.arriveTimeUTC)}readGeometry(t,o){return Ve.fromJSON(o.point)}};r([s({type:Date,json:{read:{source:"arriveTimeUTC"}}})],G.prototype,"arriveTime",void 0),r([s()],G.prototype,"arriveTimeOffset",void 0),r([P("arriveTimeOffset",["arriveTimeUTC","ETA"])],G.prototype,"readArriveTimeOffset",null),r([s({type:Ve})],G.prototype,"geometry",void 0),r([P("geometry",["point"])],G.prototype,"readGeometry",null),r([s({type:[tt]})],G.prototype,"strings",void 0),G=r([A("esri.rest.support.DirectionsEvent")],G);const rr=G;function or(e){if(e==null||e==="")return null;let t=0,o=0,i=0,n=0;const p=[];let l,c,v,S,u,b,B,N,h=0,w=0,f=0;if(u=e.match(/((\+|\-)[^\+\-\|]+|\|)/g),u||(u=[]),parseInt(u[h],32)===0){h=2;const a=parseInt(u[h],32);h++,b=parseInt(u[h],32),h++,1&a&&(w=u.indexOf("|")+1,B=parseInt(u[w],32),w++),2&a&&(f=u.indexOf("|",w)+1,N=parseInt(u[f],32),f++)}else b=parseInt(u[h],32),h++;for(;h0,hasM:f>0}}let H=class extends K{constructor(e){super(e),this.events=null,this.strings=null}readGeometry(e,t){const o=or(t.compressedGeometry);return o!=null?be.fromJSON(o):null}};r([s({type:[rr]})],H.prototype,"events",void 0),r([P("geometry",["compressedGeometry"])],H.prototype,"readGeometry",null),r([s({type:[tt]})],H.prototype,"strings",void 0),H=r([A("esri.rest.support.DirectionsFeature")],H);const sr=H;function ir(e,t){if(e.length===0)return new be({spatialReference:t});const o=[];for(const l of e)for(const c of l.paths)o.push(...c);const i=[];o.forEach((l,c)=>{c!==0&&l[0]===o[c-1][0]&&l[1]===o[c-1][1]||i.push(l)});const{hasM:n,hasZ:p}=e[0];return new be({hasM:n,hasZ:p,paths:[i],spatialReference:t})}let j=class extends E{constructor(t){super(t),this.extent=null,this.features=[],this.geometryType="polyline",this.routeId=null,this.routeName=null,this.totalDriveTime=null,this.totalLength=null,this.totalTime=null}readFeatures(t,o){if(!t)return[];const i=o.summary.envelope.spatialReference??o.spatialReference,n=i&&W.fromJSON(i);return t.map(p=>{const l=sr.fromJSON(p);if(l.geometry!=null&&(l.geometry.spatialReference=n),l.events!=null)for(const c of l.events)c.geometry!=null&&(c.geometry.spatialReference=n);return l})}get mergedGeometry(){return this.features?ir(this.features.map(({geometry:t})=>t),this.extent.spatialReference):null}get strings(){return this.features.flatMap(({strings:t})=>t).filter(Qe)}};r([s({type:Ke,json:{read:{source:"summary.envelope"}}})],j.prototype,"extent",void 0),r([s({nonNullable:!0})],j.prototype,"features",void 0),r([P("features")],j.prototype,"readFeatures",null),r([s()],j.prototype,"geometryType",void 0),r([s({readOnly:!0})],j.prototype,"mergedGeometry",null),r([s()],j.prototype,"routeId",void 0),r([s()],j.prototype,"routeName",void 0),r([s({value:null,readOnly:!0})],j.prototype,"strings",null),r([s({json:{read:{source:"summary.totalDriveTime"}}})],j.prototype,"totalDriveTime",void 0),r([s({json:{read:{source:"summary.totalLength"}}})],j.prototype,"totalLength",void 0),r([s({json:{read:{source:"summary.totalTime"}}})],j.prototype,"totalTime",void 0),j=r([A("esri.rest.support.DirectionsFeatureSet")],j);const nr=j;let D=class extends L{constructor(e){super(e),this.directionLines=null,this.directionPoints=null,this.directions=null,this.route=null,this.routeName=null,this.stops=null,this.traversedEdges=null,this.traversedJunctions=null,this.traversedTurns=null}};r([s({type:E,json:{write:!0}})],D.prototype,"directionLines",void 0),r([s({type:E,json:{write:!0}})],D.prototype,"directionPoints",void 0),r([s({type:nr,json:{write:!0}})],D.prototype,"directions",void 0),r([s({type:K,json:{write:!0}})],D.prototype,"route",void 0),r([s({type:String,json:{write:!0}})],D.prototype,"routeName",void 0),r([s({type:[K],json:{write:!0}})],D.prototype,"stops",void 0),r([s({type:E,json:{write:!0}})],D.prototype,"traversedEdges",void 0),r([s({type:E,json:{write:!0}})],D.prototype,"traversedJunctions",void 0),r([s({type:E,json:{write:!0}})],D.prototype,"traversedTurns",void 0),D=r([A("esri.rest.support.RouteResult")],D);const ar=D;function ve(e){return e?E.fromJSON(e).features.filter(Qe):[]}let _=class extends L{constructor(t){super(t),this.messages=null,this.pointBarriers=null,this.polylineBarriers=null,this.polygonBarriers=null,this.routeResults=null}readPointBarriers(t,o){return ve(o.barriers)}readPolylineBarriers(t){return ve(t)}readPolygonBarriers(t){return ve(t)}};r([s({type:[tr]})],_.prototype,"messages",void 0),r([s({type:[K]})],_.prototype,"pointBarriers",void 0),r([P("pointBarriers",["barriers"])],_.prototype,"readPointBarriers",null),r([s({type:[K]})],_.prototype,"polylineBarriers",void 0),r([P("polylineBarriers")],_.prototype,"readPolylineBarriers",null),r([s({type:[K]})],_.prototype,"polygonBarriers",void 0),r([P("polygonBarriers")],_.prototype,"readPolygonBarriers",null),r([s({type:[ar]})],_.prototype,"routeResults",void 0),_=r([A("esri.rest.support.RouteSolveResult")],_);const lr=_;function pe(e){return e instanceof E}async function ur(e,t,o){const i=[],n=[],p={},l={},c=We(e),{path:v}=c;pe(t.stops)&&ue(t.stops.features,n,"stops.features",p),pe(t.pointBarriers)&&ue(t.pointBarriers.features,n,"pointBarriers.features",p),pe(t.polylineBarriers)&&ue(t.polylineBarriers.features,n,"polylineBarriers.features",p),pe(t.polygonBarriers)&&ue(t.polygonBarriers.features,n,"polygonBarriers.features",p);const S=await at(n);for(const N in p){const h=p[N];i.push(N),l[N]=S.slice(h[0],h[1])}if(Ht(l,i)){let N=null;try{N=await et(v,t.apiKey,o)}catch{}N&&!N.hasZ&&Qt(l,i)}for(const N in l)l[N].forEach((h,w)=>{lt(t,N)[w].geometry=h});const u={...o,query:{...c.query,...Jt(t),f:"json"}},b=v.endsWith("/solve")?v:`${v}/solve`,{data:B}=await re(b,u);return pr(B)}function pr(e){const{barriers:t,directionLines:o,directionPoints:i,directions:n,messages:p,polygonBarriers:l,polylineBarriers:c,routes:v,stops:S,traversedEdges:u,traversedJunctions:b,traversedTurns:B}=e,N=a=>{const T=w.find(R=>R.routeName===a);if(T!=null)return T;const m={routeId:w.length+1,routeName:a};return w.push(m),m},h=a=>{const T=w.find(R=>R.routeId===a);if(T!=null)return T;const m={routeId:a,routeName:null};return w.push(m),m},w=[];v==null||v.features.forEach((a,T)=>{a.geometry.spatialReference=v.spatialReference??void 0;const m=a.attributes.Name,R=T+1;w.push({routeId:R,routeName:m,route:a})}),n==null||n.forEach(a=>{const{routeName:T}=a;N(T).directions=a});const f=((S==null?void 0:S.features.every(a=>a.attributes.RouteName==null))??!1)&&w.length>0?w[0].routeName:null;return S==null||S.features.forEach(a=>{var R;a.geometry&&((R=a.geometry).spatialReference??(R.spatialReference=S.spatialReference??void 0));const T=f??a.attributes.RouteName,m=N(T);m.stops??(m.stops=[]),m.stops.push(a)}),o==null||o.features.forEach(a=>{const T=a.attributes.RouteID,m=h(T),{geometryType:R,spatialReference:C}=o;m.directionLines??(m.directionLines={features:[],geometryType:R,spatialReference:C}),m.directionLines.features.push(a)}),i==null||i.features.forEach(a=>{const T=a.attributes.RouteID,m=h(T),{geometryType:R,spatialReference:C}=i;m.directionPoints??(m.directionPoints={features:[],geometryType:R,spatialReference:C}),m.directionPoints.features.push(a)}),u==null||u.features.forEach(a=>{const T=a.attributes.RouteID,m=h(T),{geometryType:R,spatialReference:C}=u;m.traversedEdges??(m.traversedEdges={features:[],geometryType:R,spatialReference:C}),m.traversedEdges.features.push(a)}),b==null||b.features.forEach(a=>{const T=a.attributes.RouteID,m=h(T),{geometryType:R,spatialReference:C}=b;m.traversedJunctions??(m.traversedJunctions={features:[],geometryType:R,spatialReference:C}),m.traversedJunctions.features.push(a)}),B==null||B.features.forEach(a=>{const T=a.attributes.RouteID,m=h(T);m.traversedTurns??(m.traversedTurns={features:[]}),m.traversedTurns.features.push(a)}),lr.fromJSON({routeResults:w,barriers:t,polygonBarriers:l,polylineBarriers:c,messages:p})}const cr={type:String,json:{read:{source:"token"},write:{target:"token"}}};let F=class extends Pe(L){constructor(e){super(e),this.doNotLocateOnRestrictedElements=null,this.geometry=null,this.geometryType=null,this.name=null,this.spatialRelationship=null,this.type="layer",this.where=null}};r([s({type:Boolean,json:{write:!0}})],F.prototype,"doNotLocateOnRestrictedElements",void 0),r([s({types:ut,json:{read:pt,write:!0}})],F.prototype,"geometry",void 0),r([I(_t)],F.prototype,"geometryType",void 0),r([s({type:String,json:{name:"layerName",write:!0}})],F.prototype,"name",void 0),r([I(xt,{name:"spatialRel"})],F.prototype,"spatialRelationship",void 0),r([s({type:String,json:{write:!0}})],F.prototype,"type",void 0),r([s({type:String,json:{write:!0}})],F.prototype,"where",void 0),F=r([A("esri.rest.support.DataLayer")],F);const yr=F;var Te;let me=Te=class extends E{constructor(e){super(e),this.doNotLocateOnRestrictedElements=null}clone(){return new Te({doNotLocateOnRestrictedElements:this.doNotLocateOnRestrictedElements,...this.cloneProperties()})}};r([s({type:Boolean,json:{write:!0}})],me.prototype,"doNotLocateOnRestrictedElements",void 0),me=Te=r([A("esri.rest.support.NetworkFeatureSet")],me);const dr=me;let ae=class extends Pe(L){constructor(e){super(e),this.doNotLocateOnRestrictedElements=null,this.url=null}};r([s({type:Boolean,json:{write:!0}})],ae.prototype,"doNotLocateOnRestrictedElements",void 0),r([s({type:String,json:{write:!0}})],ae.prototype,"url",void 0),ae=r([A("esri.rest.support.NetworkUrl")],ae);const mr=ae;var Be;let y=Be=class extends Pe(L){constructor(e){super(e),this.accumulateAttributes=null,this.apiKey=null,this.attributeParameterValues=null,this.directionsLanguage=null,this.directionsLengthUnits=null,this.directionsOutputType=null,this.directionsStyleName=null,this.directionsTimeAttribute=null,this.findBestSequence=null,this.geometryPrecision=null,this.geometryPrecisionM=null,this.geometryPrecisionZ=null,this.ignoreInvalidLocations=null,this.impedanceAttribute=null,this.outputGeometryPrecision=null,this.outputGeometryPrecisionUnits=null,this.outputLines="true-shape",this.outSpatialReference=null,this.overrides=null,this.pointBarriers=null,this.polygonBarriers=null,this.polylineBarriers=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.preserveObjectID=null,this.restrictionAttributes=null,this.restrictUTurns=null,this.returnBarriers=!1,this.returnDirections=!1,this.returnPolygonBarriers=!1,this.returnPolylineBarriers=!1,this.returnRoutes=!0,this.returnStops=!1,this.returnTraversedEdges=null,this.returnTraversedJunctions=null,this.returnTraversedTurns=null,this.returnZ=!0,this.startTime=null,this.startTimeIsUTC=!0,this.stops=null,this.timeWindowsAreUTC=null,this.travelMode=null,this.useHierarchy=null,this.useTimeWindows=null}static from(e){return ct(Be,e)}readAccumulateAttributes(e){return e==null?null:e.map(t=>Q.fromJSON(t))}writeAccumulateAttributes(e,t,o){e!=null&&e.length&&(t[o]=e.map(i=>Q.toJSON(i)))}writePointBarriers(e,t,o){ce(e,t,o)}writePolygonBarrier(e,t,o){ce(e,t,o)}writePolylineBarrier(e,t,o){ce(e,t,o)}readRestrictionAttributes(e){return e==null?null:e.map(t=>Je.fromJSON(t))}writeRestrictionAttributes(e,t,o){e!=null&&e.length&&(t[o]=e.map(i=>Je.toJSON(i)))}readStartTime(e,t){const{startTime:o}=t;return o==null?null:o==="now"?"now":new Date(o)}writeStartTime(e,t){e!=null&&(t.startTime=e==="now"?"now":e.getTime())}readStops(e,t){return Sr(t.stops)}writeStops(e,t,o){ce(e,t,o)}};r([s({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],y.prototype,"accumulateAttributes",void 0),r([P("accumulateAttributes")],y.prototype,"readAccumulateAttributes",null),r([q("accumulateAttributes")],y.prototype,"writeAccumulateAttributes",null),r([s(cr)],y.prototype,"apiKey",void 0),r([s({json:{write:!0}})],y.prototype,"attributeParameterValues",void 0),r([s({type:String,json:{write:!0}})],y.prototype,"directionsLanguage",void 0),r([I(He)],y.prototype,"directionsLengthUnits",void 0),r([I(Ft)],y.prototype,"directionsOutputType",void 0),r([I(Et)],y.prototype,"directionsStyleName",void 0),r([I(Re,{name:"directionsTimeAttributeName",ignoreUnknown:!1})],y.prototype,"directionsTimeAttribute",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"findBestSequence",void 0),r([s({type:Number,json:{write:!0}})],y.prototype,"geometryPrecision",void 0),r([s({type:Number,json:{write:!0}})],y.prototype,"geometryPrecisionM",void 0),r([s({type:Number,json:{write:!0}})],y.prototype,"geometryPrecisionZ",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"ignoreInvalidLocations",void 0),r([I(Q,{name:"impedanceAttributeName",ignoreUnknown:!1})],y.prototype,"impedanceAttribute",void 0),r([s({type:Number,json:{write:!0}})],y.prototype,"outputGeometryPrecision",void 0),r([I(Ut)],y.prototype,"outputGeometryPrecisionUnits",void 0),r([I(Gt)],y.prototype,"outputLines",void 0),r([s({type:W,json:{name:"outSR",write:!0}})],y.prototype,"outSpatialReference",void 0),r([s({json:{write:!0}})],y.prototype,"overrides",void 0),r([s({json:{name:"barriers",write:!0}})],y.prototype,"pointBarriers",void 0),r([q("pointBarriers")],y.prototype,"writePointBarriers",null),r([s({json:{write:!0}})],y.prototype,"polygonBarriers",void 0),r([q("polygonBarriers")],y.prototype,"writePolygonBarrier",null),r([s({json:{write:!0}})],y.prototype,"polylineBarriers",void 0),r([q("polylineBarriers")],y.prototype,"writePolylineBarrier",null),r([s({type:Boolean,json:{write:!0}})],y.prototype,"preserveFirstStop",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"preserveLastStop",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"preserveObjectID",void 0),r([s({type:[String],json:{name:"restrictionAttributeNames",write:!0}})],y.prototype,"restrictionAttributes",void 0),r([P("restrictionAttributes")],y.prototype,"readRestrictionAttributes",null),r([q("restrictionAttributes")],y.prototype,"writeRestrictionAttributes",null),r([I(qt)],y.prototype,"restrictUTurns",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"returnBarriers",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"returnDirections",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"returnPolygonBarriers",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"returnPolylineBarriers",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"returnRoutes",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"returnStops",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"returnTraversedEdges",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"returnTraversedJunctions",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"returnTraversedTurns",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"returnZ",void 0),r([s({json:{write:!0}})],y.prototype,"startTime",void 0),r([P("startTime")],y.prototype,"readStartTime",null),r([q("startTime")],y.prototype,"writeStartTime",null),r([s({type:Boolean,json:{write:!0}})],y.prototype,"startTimeIsUTC",void 0),r([s({json:{write:!0}})],y.prototype,"stops",void 0),r([P("stops")],y.prototype,"readStops",null),r([q("stops")],y.prototype,"writeStops",null),r([s({type:Boolean,json:{write:!0}})],y.prototype,"timeWindowsAreUTC",void 0),r([s({type:$e,json:{write:!0}})],y.prototype,"travelMode",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"useHierarchy",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"useTimeWindows",void 0),y=Be=r([A("esri.rest.support.RouteParameters")],y);const fr=y;function hr(e){return e&&"type"in e}function vr(e){return e&&"features"in e&&"doNotLocateOnRestrictedElements"in e}function wr(e){return e&&"url"in e}function gr(e){return e&&"features"in e}function Sr(e){return hr(e)?yr.fromJSON(e):wr(e)?mr.fromJSON(e):vr(e)?dr.fromJSON(e):gr(e)?E.fromJSON(e):null}function ce(e,t,o){e!=null&&(t[o]=O.isCollection(e)?{features:e.toArray().map(i=>i.toJSON())}:e.toJSON())}function we(e){return e.length?e:null}function Ne(e){switch(e){case"esriGeometryPoint":return{type:"esriSMS",style:"esriSMSCircle",size:12,color:[0,0,0,0],outline:Ne("esriGeometryPolyline")};case"esriGeometryPolyline":return{type:"esriSLS",style:"esriSLSSolid",width:1,color:[0,0,0,0]};case"esriGeometryPolygon":return{type:"esriSFS",style:"esriSFSNull",outline:Ne("esriGeometryPolyline")}}}function ye(e){return"layers"in e}function br(e){return e.declaredClass==="esri.rest.support.FeatureSet"}function Tr(e){return e.declaredClass==="esri.rest.support.NetworkFeatureSet"}function Br(e,t,o){var Ie,Ae,Oe,je,Le,De;const i=(Ie=t.networkDataset)==null?void 0:Ie.networkAttributes,n=(i==null?void 0:i.filter(({usageType:d})=>d==="cost"))??[],p=o.travelMode??t.defaultTravelMode;if(p==null)return void ot().warn("route-layer:missing-travel-mode","The routing service must have a default travel mode or one must be specified in the route parameter.");const{timeAttributeName:l,distanceAttributeName:c}=p,v=n.find(({name:d})=>d===l),S=n.find(({name:d})=>d===c),u=((Ae=o.travelMode)==null?void 0:Ae.impedanceAttributeName)??o.impedanceAttribute??t.impedance,b=v==null?void 0:v.units,B=S==null?void 0:S.units;if(!b||!B)throw new M("routelayer:unknown-impedance-units","the units of either the distance or time impedance are unknown");const N=o.directionsLanguage??t.directionsLanguage,h=o.accumulateAttributes??t.accumulateAttributeNames??[],w=new Set(n.filter(({name:d})=>d===l||d===c||d===u||d!=null&&h.includes(d)).map(({name:d})=>d)),f=d=>{for(const Me in d)w.has(Me)||delete d[Me]};for(const d of e.pointBarriers)d.costs!=null&&(d.addedCost=d.costs[u]??0,f(d.costs));for(const d of e.polygonBarriers)d.costs!=null&&(d.scaleFactor=d.costs[u]??1,f(d.costs));for(const d of e.polylineBarriers)d.costs!=null&&(d.scaleFactor=d.costs[u]??1,f(d.costs));const{routeInfo:a}=e,{findBestSequence:T,preserveFirstStop:m,preserveLastStop:R,startTimeIsUTC:C,timeWindowsAreUTC:st}=o;a.analysisSettings=new Wt({accumulateAttributes:h,directionsLanguage:N,findBestSequence:T,preserveFirstStop:m,preserveLastStop:R,startTimeIsUTC:C,timeWindowsAreUTC:st,travelMode:p}),a.totalDuration=V(((Oe=a.totalCosts)==null?void 0:Oe[l])??0,b),a.totalDistance=ge(((je=a.totalCosts)==null?void 0:je[c])??0,B),a.totalLateDuration=V(((Le=a.totalViolations)==null?void 0:Le[l])??0,b),a.totalWaitDuration=V(((De=a.totalWait)==null?void 0:De[l])??0,b),a.totalCosts!=null&&f(a.totalCosts),a.totalViolations!=null&&f(a.totalViolations),a.totalWait!=null&&f(a.totalWait);for(const d of e.stops)d.serviceCosts!=null&&(d.serviceDuration=V(d.serviceCosts[l]??0,b),d.serviceDistance=ge(d.serviceCosts[c]??0,B),f(d.serviceCosts)),d.cumulativeCosts!=null&&(d.cumulativeDuration=V(d.cumulativeCosts[l]??0,b),d.cumulativeDistance=ge(d.cumulativeCosts[c]??0,B),f(d.cumulativeCosts)),d.violations!=null&&(d.lateDuration=V(d.violations[l]??0,b),f(d.violations)),d.wait!=null&&(d.waitDuration=V(d.wait[l]??0,b),f(d.wait))}async function Fe(e){const t=W.WGS84;return await $t(e.spatialReference,t),It(e,t)}function V(e,t){switch(t){case"seconds":return e/60;case"hours":return 60*e;case"days":return 60*e*24;default:return e}}function ge(e,t){return t==="decimal-degrees"||t==="points"||t==="unknown"?e:At(e,t,"meters")}function Nr(e){const{attributes:t,geometry:o,popupTemplate:i,symbol:n}=e.toGraphic().toJSON();return{attributes:t,geometry:o,popupInfo:i,symbol:n}}const Pr=O.ofType(oe),Rr=O.ofType(se),Ee=O.ofType(Y),Ue=O.ofType(X),Ge=O.ofType(ee),qe=O.ofType(te),rt="esri.layers.RouteLayer",ot=()=>Ze.getLogger(rt);let g=class extends yt(dt(mt(ft(ht(Ot))))){constructor(e){super(e),this._cachedServiceDescription=null,this._featureCollection=null,this._type="Feature Collection",this.defaultSymbols=new Xe,this.directionLines=null,this.directionPoints=null,this.featureCollectionType="route",this.legendEnabled=!1,this.maxScale=0,this.minScale=0,this.pointBarriers=new Ee,this.polygonBarriers=new Ue,this.polylineBarriers=new Ge,this.routeInfo=null,this.spatialReference=W.WGS84,this.stops=new qe,this.type="route";const t=()=>{this._setStopSymbol(this.stops)};this.addHandles(vt(()=>this.stops,"change",t,{sync:!0,onListenerAdd:t}))}writeFeatureCollectionWebmap(e,t,o,i){const n=[this._writePolygonBarriers(),this._writePolylineBarriers(),this._writePointBarriers(),this._writeRouteInfo(),this._writeDirectionLines(),this._writeDirectionPoints(),this._writeStops()].filter(c=>!!c),p=n.map((c,v)=>v),l=i.origin==="web-map"?"featureCollection.layers":"layers";wt(l,n,t),t.opacity=this.opacity,t.visibility=this.visible,t.visibleLayers=p}readDirectionLines(e,t){return this._getNetworkFeatures(t,"DirectionLines",o=>oe.fromGraphic(o))}readDirectionPoints(e,t){return this._getNetworkFeatures(t,"DirectionPoints",o=>se.fromGraphic(o))}get fullExtent(){var n;const e=new Ke({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:W.WGS84});if(((n=this.routeInfo)==null?void 0:n.geometry)!=null)return this.routeInfo.geometry.extent??e;if(this.stops==null)return e;const t=this.stops.filter(p=>p.geometry!=null);if(t.length<2)return e;const{spatialReference:o}=t.at(0).geometry;if(o==null)return e;const i=t.toArray().map(p=>{const l=p.geometry;return[l.x,l.y]});return new gt({points:i,spatialReference:o}).extent}readMaxScale(e,t){var n;const o=ye(t)?t.layers:(n=t.featureCollection)==null?void 0:n.layers,i=o==null?void 0:o.find(p=>p.layerDefinition.maxScale!=null);return(i==null?void 0:i.layerDefinition.maxScale)??0}readMinScale(e,t){var n;const o=ye(t)?t.layers:(n=t.featureCollection)==null?void 0:n.layers,i=o==null?void 0:o.find(p=>p.layerDefinition.minScale!=null);return(i==null?void 0:i.layerDefinition.minScale)??0}readPointBarriers(e,t){return this._getNetworkFeatures(t,"Barriers",o=>Y.fromGraphic(o))}readPolygonBarriers(e,t){return this._getNetworkFeatures(t,"PolygonBarriers",o=>X.fromGraphic(o))}readPolylineBarriers(e,t){return this._getNetworkFeatures(t,"PolylineBarriers",o=>ee.fromGraphic(o))}readRouteInfo(e,t){const o=this._getNetworkFeatures(t,"RouteInfo",i=>le.fromGraphic(i));return o.length>0?o.at(0):null}readSpatialReference(e,t){var c,v;const o=ye(t)?t.layers:(c=t.featureCollection)==null?void 0:c.layers;if(!(o!=null&&o.length))return W.WGS84;const{layerDefinition:i,featureSet:n}=o[0],p=n.features[0],l=((v=p==null?void 0:p.geometry)==null?void 0:v.spatialReference)??n.spatialReference??i.spatialReference??i.extent.spatialReference??ke;return W.fromJSON(l)}readStops(e,t){return this._getNetworkFeatures(t,"Stops",o=>te.fromGraphic(o),o=>this._setStopSymbol(o))}get title(){var e;return((e=this.routeInfo)==null?void 0:e.name)!=null?this.routeInfo.name:"Route"}set title(e){this._overrideIfSome("title",e)}get url(){return Ce.routeServiceUrl}set url(e){e!=null?this._set("url",St(e,ot())):this._set("url",Ce.routeServiceUrl)}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},e)),Promise.resolve(this)}removeAll(){this.removeResult(),this.pointBarriers.removeAll(),this.polygonBarriers.removeAll(),this.polylineBarriers.removeAll(),this.stops.removeAll()}removeResult(){this.directionLines!=null&&(this.directionLines.removeAll(),this._set("directionLines",null)),this.directionPoints!=null&&(this.directionPoints.removeAll(),this._set("directionPoints",null)),this.routeInfo!=null&&this._set("routeInfo",null)}async save(){await this.load();const{fullExtent:e,portalItem:t}=this;if(!t)throw new M("routelayer:portal-item-not-set","save() requires to the layer to have a portal item");if(!t.id)throw new M("routelayer:portal-item-not-saved","Please use saveAs() first to save the routelayer");if(t.type!=="Feature Collection")throw new M("routelayer:portal-item-wrong-type",'Portal item needs to have type "Feature Collection"');if(this.routeInfo==null)throw new M("routelayer:route-unsolved","save() requires a solved route");const{portal:o}=t;await o.signIn(),o.user||await t.reload();const{itemUrl:i,itemControl:n}=t;if(n!=="admin"&&n!=="update")throw new M("routelayer:insufficient-permissions","To save this layer, you need to be the owner or an administrator of your organization");const p={messages:[],origin:"portal-item",portal:o,url:i?bt(i):void 0,writtenProperties:[]},l=this.write(void 0,p);return t.extent=await Fe(e),t.title=this.title,await t.update({data:l}),t}async saveAs(e,t={}){var c;if(await this.load(),this.routeInfo==null)throw new M("routelayer:route-unsolved","saveAs() requires a solved route");const o=Tt.from(e).clone();o.extent??(o.extent=await Fe(this.fullExtent)),o.id=null,o.portal??(o.portal=Bt.getDefault()),o.title??(o.title=this.title),o.type="Feature Collection",o.typeKeywords=["Data","Feature Collection",Nt.MULTI_LAYER,"Route Layer"];const{portal:i}=o,n={messages:[],origin:"portal-item",portal:i,url:null,writtenProperties:[]};await i.signIn();const p=t==null?void 0:t.folder,l=this.write(void 0,n);return await((c=i.user)==null?void 0:c.addItem({item:o,folder:p,data:l})),this.portalItem=o,Lt(n),n.portalItem=o,o}async solve(e,t){const o=(e==null?void 0:e.stops)??this.stops,i=(e==null?void 0:e.pointBarriers)??we(this.pointBarriers),n=(e==null?void 0:e.polylineBarriers)??we(this.polylineBarriers),p=(e==null?void 0:e.polygonBarriers)??we(this.polygonBarriers);if(o==null)throw new M("routelayer:undefined-stops","the route layer must have stops defined in the route parameters.");if((br(o)||Tr(o))&&o.features.length<2||O.isCollection(o)&&o.length<2)throw new M("routelayer:insufficent-stops","the route layer must have two or more stops to solve a route.");if(O.isCollection(o))for(const w of o)w.routeName=null;const l=e==null?void 0:e.apiKey,c=this.url,v=await this._getServiceDescription(c,l,t),S=(e==null?void 0:e.travelMode)??v.defaultTravelMode,u=(e==null?void 0:e.accumulateAttributes)??[];S!=null&&(u.push(S.distanceAttributeName),S.timeAttributeName&&u.push(S.timeAttributeName));const b={accumulateAttributes:u,directionsOutputType:"featuresets",ignoreInvalidLocations:!0,pointBarriers:i,polylineBarriers:n,polygonBarriers:p,preserveFirstStop:!0,preserveLastStop:!0,returnBarriers:!!i,returnDirections:!0,returnPolygonBarriers:!!p,returnPolylineBarriers:!!n,returnRoutes:!0,returnStops:!0,stops:o},B=fr.from(e??{});let N;B.set(b);try{N=await ur(c,B,t)}catch(w){throw Pt(w)?w:new M("routelayer:failed-route-request","the routing request failed",{error:w})}const h=this._toRouteLayerSolution(N);return this._isOverridden("title")||(this.title=h.routeInfo.name??"Route"),Br(h,v,B),h}update(e){const{stops:t,directionLines:o,directionPoints:i,pointBarriers:n,polylineBarriers:p,polygonBarriers:l,routeInfo:c}=e;this.set({stops:t,pointBarriers:n,polylineBarriers:p,polygonBarriers:l}),this._set("directionLines",o),this._set("directionPoints",i),this._set("routeInfo",c),c.geometry!=null&&(this.spatialReference=c.geometry.spatialReference)}_getNetworkFeatures(e,t,o,i){var w;const n=ye(e)?e.layers:(w=e.featureCollection)==null?void 0:w.layers,p=n==null?void 0:n.find(f=>f.layerDefinition.name===t);if(p==null)return new O;const{layerDefinition:l,popupInfo:c,featureSet:v}=p,S=l.drawingInfo.renderer,{features:u}=v,b=v.spatialReference??l.spatialReference??l.extent.spatialReference??ke,B=S&&jt(S),N=W.fromJSON(b),h=u.map(f=>{const a=K.fromJSON(f);a.geometry!=null&&f.geometry!=null&&f.geometry.spatialReference==null&&(a.geometry.spatialReference=N);const T=o(a);return T.symbol??(T.symbol=(B==null?void 0:B.getSymbol(a))??this._getNetworkSymbol(t)),T.popupTemplate??(T.popupTemplate=c&&Rt.fromJSON(c)),T});return i&&h.some(f=>!f.symbol)&&i(h),new O(h)}_getNetworkSymbol(e){switch(e){case"Barriers":return this.defaultSymbols.pointBarriers;case"DirectionPoints":return this.defaultSymbols.directionPoints;case"DirectionLines":return this.defaultSymbols.directionLines;case"PolylineBarriers":return this.defaultSymbols.polylineBarriers;case"PolygonBarriers":return this.defaultSymbols.polygonBarriers;case"RouteInfo":return this.defaultSymbols.routeInfo;case"Stops":return null}}async _getServiceDescription(e,t,o){if(this._cachedServiceDescription!=null&&this._cachedServiceDescription.url===e)return this._cachedServiceDescription.serviceDescription;const i=await et(e,t,o);return this._cachedServiceDescription={serviceDescription:i,url:e},i}_setStopSymbol(e){if(!e||e.length===0||this.defaultSymbols.stops==null||e.every(({symbol:u})=>u!=null))return;const{first:t,last:o,middle:i,unlocated:n,waypoint:p,break:l}=this.defaultSymbols.stops;if(this.routeInfo==null||e.length===1)return void e.forEach((u,b)=>{switch(b){case 0:u.symbol=t;break;case e.length-1:u.symbol=o;break;default:u.symbol=i}});const c=e.map(({sequence:u})=>u).filter(u=>u!=null),v=Math.min(...c),S=Math.max(...c);for(const u of e)u.sequence!==v?u.sequence!==S?u.status==="ok"||u.status==="not-located-on-closest"?u.locationType!=="waypoint"?u.locationType!=="break"?u.symbol=i:u.symbol=l:u.symbol=p:u.symbol=n:u.symbol=o:u.symbol=t}_toRouteLayerSolution(e){var S,u,b,B,N,h,w;const t=(S=e.routeResults[0].stops)==null?void 0:S.map(f=>te.fromJSON(f.toJSON()));this._setStopSymbol(t);const o=new qe(t),i=new Ue((u=e.polygonBarriers)==null?void 0:u.map(f=>{const a=X.fromJSON(f.toJSON());return a.symbol=this.defaultSymbols.polygonBarriers,a})),n=new Ge((b=e.polylineBarriers)==null?void 0:b.map(f=>{const a=ee.fromJSON(f.toJSON());return a.symbol=this.defaultSymbols.polylineBarriers,a})),p=new Ee((B=e.pointBarriers)==null?void 0:B.map(f=>{const a=Y.fromJSON(f.toJSON());return a.symbol=this.defaultSymbols.pointBarriers,a})),l=(N=e.routeResults[0].route)==null?void 0:N.toJSON(),c=le.fromJSON(l);c.symbol=this.defaultSymbols.routeInfo;const v=new Rr((h=e.routeResults[0].directionPoints)==null?void 0:h.features.map(f=>{const a=se.fromJSON(f.toJSON());return a.symbol=this.defaultSymbols.directionPoints,a}));return{directionLines:new Pr((w=e.routeResults[0].directionLines)==null?void 0:w.features.map(f=>{const a=oe.fromJSON(f.toJSON());return a.symbol=this.defaultSymbols.directionLines,a})),directionPoints:v,pointBarriers:p,polygonBarriers:i,polylineBarriers:n,routeInfo:c,stops:o}}_writeDirectionLines(){return this._writeNetworkFeatures(this.directionLines,this.defaultSymbols.directionLines,"esriGeometryPolyline",oe.fields,oe.popupInfo,"DirectionLines","Direction Lines")}_writeDirectionPoints(){return this._writeNetworkFeatures(this.directionPoints,this.defaultSymbols.directionPoints,"esriGeometryPoint",se.fields,se.popupInfo,"DirectionPoints","Direction Points")}_writeNetworkFeatures(e,t,o,i,n,p,l){if(!(e!=null&&e.length))return null;const c=this.spatialReference.toJSON(),{fullExtent:v,maxScale:S,minScale:u}=this;return{featureSet:{features:e.toArray().map(b=>Nr(b)),geometryType:o,spatialReference:c},layerDefinition:{capabilities:"Query,Update,Editing",drawingInfo:{renderer:{type:"simple",symbol:t!=null?t.toJSON():Ne(o)}},extent:v.toJSON(),fields:i,geometryType:o,hasM:!1,hasZ:!1,maxScale:S,minScale:u,name:p,objectIdField:"ObjectID",spatialReference:c,title:l,type:"Feature Layer",typeIdField:""},popupInfo:n}}_writePointBarriers(){return this._writeNetworkFeatures(this.pointBarriers,this.defaultSymbols.pointBarriers,"esriGeometryPoint",Y.fields,Y.popupInfo,"Barriers","Point Barriers")}_writePolygonBarriers(){return this._writeNetworkFeatures(this.polygonBarriers,this.defaultSymbols.polygonBarriers,"esriGeometryPolygon",X.fields,X.popupInfo,"PolygonBarriers","Polygon Barriers")}_writePolylineBarriers(){return this._writeNetworkFeatures(this.polylineBarriers,this.defaultSymbols.polylineBarriers,"esriGeometryPolyline",ee.fields,ee.popupInfo,"PolylineBarriers","Line Barriers")}_writeRouteInfo(){return this._writeNetworkFeatures(this.routeInfo!=null?new O([this.routeInfo]):null,this.defaultSymbols.routeInfo,"esriGeometryPolyline",le.fields,le.popupInfo,"RouteInfo","Route Details")}_writeStops(){var p,l,c;const e=this._writeNetworkFeatures(this.stops,null,"esriGeometryPoint",te.fields,te.popupInfo,"Stops","Stops");if(e==null)return null;const{stops:t}=this.defaultSymbols,o=(p=t==null?void 0:t.first)==null?void 0:p.toJSON(),i=(l=t==null?void 0:t.middle)==null?void 0:l.toJSON(),n=(c=t==null?void 0:t.last)==null?void 0:c.toJSON();return e.layerDefinition.drawingInfo.renderer={type:"uniqueValue",field1:"Sequence",defaultSymbol:i,uniqueValueInfos:[{value:"1",symbol:o,label:"First Stop"},{value:`${this.stops.length}`,symbol:n,label:"Last Stop"}]},e}};r([s({readOnly:!0,json:{read:!1,origins:{"portal-item":{write:{allowNull:!0,ignoreOrigin:!0}},"web-map":{write:{overridePolicy(){return{allowNull:!0,ignoreOrigin:this.portalItem==null}}}}}}})],g.prototype,"_featureCollection",void 0),r([q(["web-map","portal-item"],"_featureCollection")],g.prototype,"writeFeatureCollectionWebmap",null),r([s({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{target:"type",overridePolicy(){return{ignoreOrigin:this.portalItem!=null}}}}}}})],g.prototype,"_type",void 0),r([s({nonNullable:!0,type:Xe})],g.prototype,"defaultSymbols",void 0),r([s({readOnly:!0})],g.prototype,"directionLines",void 0),r([P(["web-map","portal-item"],"directionLines",["layers","featureCollection.layers"])],g.prototype,"readDirectionLines",null),r([s({readOnly:!0})],g.prototype,"directionPoints",void 0),r([P(["web-map","portal-item"],"directionPoints",["layers","featureCollection.layers"])],g.prototype,"readDirectionPoints",null),r([s({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],g.prototype,"featureCollectionType",void 0),r([s({readOnly:!0})],g.prototype,"fullExtent",null),r([s({json:{origins:{"web-map":{name:"featureCollection.showLegend"}},write:!0}})],g.prototype,"legendEnabled",void 0),r([s({type:["show","hide"]})],g.prototype,"listMode",void 0),r([s({type:Number,nonNullable:!0,json:{write:!1}})],g.prototype,"maxScale",void 0),r([P(["web-map","portal-item"],"maxScale",["layers","featureCollection.layers"])],g.prototype,"readMaxScale",null),r([s({type:Number,nonNullable:!0,json:{write:!1}})],g.prototype,"minScale",void 0),r([P(["web-map","portal-item"],"minScale",["layers","featureCollection.layers"])],g.prototype,"readMinScale",null),r([s({type:["ArcGISFeatureLayer"],value:"ArcGISFeatureLayer"})],g.prototype,"operationalLayerType",void 0),r([s({nonNullable:!0,type:O.ofType(Y)})],g.prototype,"pointBarriers",void 0),r([P(["web-map","portal-item"],"pointBarriers",["layers","featureCollection.layers"])],g.prototype,"readPointBarriers",null),r([s({nonNullable:!0,type:O.ofType(X)})],g.prototype,"polygonBarriers",void 0),r([P(["web-map","portal-item"],"polygonBarriers",["layers","featureCollection.layers"])],g.prototype,"readPolygonBarriers",null),r([s({nonNullable:!0,type:O.ofType(ee)})],g.prototype,"polylineBarriers",void 0),r([P(["web-map","portal-item"],"polylineBarriers",["layers","featureCollection.layers"])],g.prototype,"readPolylineBarriers",null),r([s({readOnly:!0})],g.prototype,"routeInfo",void 0),r([P(["web-map","portal-item"],"routeInfo",["layers","featureCollection.layers"])],g.prototype,"readRouteInfo",null),r([s({type:W})],g.prototype,"spatialReference",void 0),r([P(["web-map","portal-item"],"spatialReference",["layers","featureCollection.layers"])],g.prototype,"readSpatialReference",null),r([s({nonNullable:!0,type:O.ofType(te)})],g.prototype,"stops",void 0),r([P(["web-map","portal-item"],"stops",["layers","featureCollection.layers"])],g.prototype,"readStops",null),r([s()],g.prototype,"title",null),r([s({readOnly:!0,json:{read:!1}})],g.prototype,"type",void 0),r([s()],g.prototype,"url",null),g=r([A(rt)],g);const io=g;export{io as default}; diff --git a/assets/RouteLayerView2D-CcISu94y.js b/assets/RouteLayerView2D-CjJummeL.js similarity index 74% rename from assets/RouteLayerView2D-CcISu94y.js rename to assets/RouteLayerView2D-CjJummeL.js index 9f2471e..7599254 100644 --- a/assets/RouteLayerView2D-CcISu94y.js +++ b/assets/RouteLayerView2D-CjJummeL.js @@ -1 +1 @@ -import{V as l,C as m,P as _,q as n,e as c,g as d,d as p,y as u,f as w}from"./index-CEWggaxV.js";import{m as y,c as f,O as k,f as M,j as V,g as v,a as I}from"./Stop-VHT4QwcG.js";import{t as G}from"./highlightReasons-DbgbcWKM.js";import{m as F,u as H}from"./LayerView-BEFTHNYv.js";import{t as C}from"./GraphicContainer-CbvswCG0.js";import{$}from"./GraphicsView2D-DbbthiwV.js";import"./scaleUtils-Bqauo1zZ.js";import"./Container-CB7SlLB9.js";import"./Texture-DJgkMrSB.js";import"./AGraphicContainer-Dby-baET.js";import"./TechniqueInstance-CSsTmbek.js";import"./UpdateTracking2D-nj9Q-3df.js";import"./TurboLine-CkxIB4ZX.js";import"./earcut-hRlx3adE.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./utils-p-5Bbga5.js";import"./Rect-CUzevAry.js";import"./LabelMetric-D2hbzzy_.js";import"./Program-DLRmaKpw.js";import"./labelUtils-Dnqx6jl5.js";import"./defaultsJSON-CHAaurhX.js";import"./BindType-BmZEZMMh.js";import"./Util-BS8sJGjF.js";import"./constants-D5zmR9t2.js";import"./TileContainer-Ci6dOowA.js";import"./WGLContainer-B_Pv-8Yi.js";import"./ProgramTemplate-BICQrNzS.js";import"./config-MDUrh2eL.js";import"./featureConversionUtils-CmP9mw0r.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./FeatureCommandQueue-Btq_FXyi.js";import"./vec3f32-nZdmKIgz.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./OverrideHelper-B4ryGWZb.js";import"./quantizationUtils-CUjGHrU3.js";import"./AttributeStore-Ck-75lnq.js";import"./TimeOnly-Cm47ew5I.js";import"./timeSupport-BjRbXIpn.js";import"./json-Wa8cmqdu.js";import"./diffUtils-B4YFa5Ju.js";import"./normalizeUtilsSync-B6VufdiX.js";const U=["route-info","direction-line","direction-point","polygon-barrier","polyline-barrier","point-barrier","stop"],a={graphic:null,property:null,oldValue:null,newValue:null};function g(t){return t instanceof y||t instanceof f||t instanceof k||t instanceof M||t instanceof V||t instanceof v||t instanceof I}function b(t){return l.isCollection(t)&&t.length&&g(t.at(0))}function O(t){return Array.isArray(t)&&t.length>0&&g(t[0])}let h=class extends F(H){constructor(){super(...arguments),this._graphics=new l,this._highlightIds=new Map,this._networkFeatureMap=new Map,this._networkGraphicMap=new Map}get _routeItems(){return new m({getCollections:()=>this.layer==null||this.destroyed?[]:[this.layer.routeInfo!=null?new l([this.layer.routeInfo]):null,this.layer.directionLines,this.layer.directionPoints,this.layer.polygonBarriers,this.layer.polylineBarriers,this.layer.pointBarriers,this.layer.stops]})}initialize(){this._updatingHandles.addOnCollectionChange(()=>this._routeItems,t=>this._routeItemsChanged(t),_)}destroy(){var t;this._networkFeatureMap.clear(),this._networkGraphicMap.clear(),this._graphics.removeAll(),(t=this._get("_routeItems"))==null||t.destroy()}attach(){this._createGraphicsView()}detach(){this._destroyGraphicsView()}async fetchPopupFeaturesAtLocation(t,e){return this._graphicsView.hitTest(t).filter(({popupTemplate:i})=>!!i)}highlight(t){let e;e=g(t)?[this._getNetworkFeatureUid(t)]:O(t)?t.map(r=>this._getNetworkFeatureUid(r)):b(t)?t.map(r=>this._getNetworkFeatureUid(r)).toArray():[t.uid];const i=e.filter(n);return i.length?(this._addHighlight(i),c(()=>this._removeHighlight(i))):c()}async hitTest(t,e){if(this.suspended)return null;const i=this._graphicsView.hitTest(t).filter(n).map(s=>this._networkGraphicMap.get(s));if(!i.length)return null;const{layer:r}=this;return i.reverse().map(s=>({type:"route",layer:r,mapPoint:t,networkFeature:s}))}isUpdating(){return this._graphicsView.updating}moveStart(){}moveEnd(){}update(t){this._graphicsView.processUpdate(t)}viewChange(){this._graphicsView.viewChange()}_addHighlight(t){for(const e of t)if(this._highlightIds.has(e)){const i=this._highlightIds.get(e);this._highlightIds.set(e,i+1)}else this._highlightIds.set(e,1);this._updateHighlight()}_createGraphic(t){const e=t.toGraphic();return e.layer=this.layer,e.sourceLayer=this.layer,e}_createGraphicsView(){const t=this.view,e=()=>this.requestUpdate(),i=new C(t.featuresTilingScheme);this._graphicsView=new $({container:i,graphics:this._graphics,requestUpdateCallback:e,view:t}),this.container.addChild(i),this._updateHighlight()}_destroyGraphicsView(){this.container.removeChild(this._graphicsView.container),this._graphicsView.destroy()}_getDrawOrder(t){const e=this._networkGraphicMap.get(t);return U.indexOf(e.type)}_getNetworkFeatureUid(t){return this._networkFeatureMap.has(t)?this._networkFeatureMap.get(t).uid:null}_removeHighlight(t){for(const e of t)if(this._highlightIds.has(e)){const i=this._highlightIds.get(e)-1;i===0?this._highlightIds.delete(e):this._highlightIds.set(e,i)}this._updateHighlight()}_routeItemsChanged(t){if(t.removed.length){this._graphics.removeMany(t.removed.map(e=>{const i=this._networkFeatureMap.get(e);return this._networkFeatureMap.delete(e),this._networkGraphicMap.delete(i),i}));for(const e of t.removed)this.removeHandles(e)}if(t.added.length){this._graphics.addMany(t.added.map(e=>{const i=this._createGraphic(e);return i.symbol==null?null:(this._networkFeatureMap.set(e,i),this._networkGraphicMap.set(i,e),i)}).filter(n));for(const e of t.added)this.addHandles([d(()=>e.geometry,(i,r)=>{this._updateGraphic(e,"geometry",i,r)}),d(()=>e.symbol,(i,r)=>{this._updateGraphic(e,"symbol",i,r)})],e);this._graphics.sort((e,i)=>this._getDrawOrder(e)-this._getDrawOrder(i))}}_updateGraphic(t,e,i,r){if(!this._networkFeatureMap.has(t)){const o=this._createGraphic(t);return this._networkFeatureMap.set(t,o),this._networkGraphicMap.set(o,t),void this._graphics.add(o)}const s=this._networkFeatureMap.get(t);s[e]=i,a.graphic=s,a.property=e,a.oldValue=r,a.newValue=i,this._graphicsView.graphicUpdateHandler(a)}_updateHighlight(){const t=Array.from(this._highlightIds.keys()),e=G("highlight");this._graphicsView.setHighlight(t.map(i=>({objectId:i,highlightFlags:e})))}};p([u()],h.prototype,"_graphics",void 0),p([u()],h.prototype,"_routeItems",null),h=p([w("esri.views.2d.layers.RouteLayerView2D")],h);const Mt=h;export{Mt as default}; +import{V as l,C as m,P as _,q as n,e as c,g as d,d as p,y as u,f as w}from"./index-BjUNJPVf.js";import{m as y,c as f,O as k,f as M,j as V,g as v,a as I}from"./Stop-D_lBQff2.js";import{t as G}from"./highlightReasons-BOU4mnPE.js";import{m as F,u as H}from"./LayerView-Bux7vAEn.js";import{t as C}from"./GraphicContainer-Bue3JF2r.js";import{$}from"./GraphicsView2D-B7H8XAnI.js";import"./scaleUtils-DWXMiS7R.js";import"./Container-_n5wCgez.js";import"./Texture-S4dD-WHn.js";import"./AGraphicContainer-BXk7Eu6w.js";import"./TechniqueInstance-XtnK2qy2.js";import"./UpdateTracking2D-Ds_Gdrxd.js";import"./TurboLine-DNQdPIXo.js";import"./earcut-CWKXDqDj.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./utils-CuXO_Zzq.js";import"./Rect-CUzevAry.js";import"./LabelMetric-BcUxDImF.js";import"./Program-DBsYtQ00.js";import"./labelUtils-3p0-m-Ee.js";import"./defaultsJSON-CHAaurhX.js";import"./BindType-BmZEZMMh.js";import"./Util-CS5u4Lec.js";import"./constants-D5zmR9t2.js";import"./TileContainer-Bs-vXdD_.js";import"./WGLContainer-DgZNq7b0.js";import"./ProgramTemplate-Ck2I0bIi.js";import"./config-MDUrh2eL.js";import"./featureConversionUtils-BHhm7bvm.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./FeatureCommandQueue-DI81F3gA.js";import"./vec3f32-nZdmKIgz.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./OverrideHelper-DxFZBnGL.js";import"./quantizationUtils-CfV316jZ.js";import"./AttributeStore-Bm6hLtR1.js";import"./TimeOnly-BXSODLxA.js";import"./timeSupport-DXkhlToK.js";import"./json-Wa8cmqdu.js";import"./diffUtils-uUoMDFQS.js";import"./normalizeUtilsSync-73yZ0QwV.js";const U=["route-info","direction-line","direction-point","polygon-barrier","polyline-barrier","point-barrier","stop"],a={graphic:null,property:null,oldValue:null,newValue:null};function g(t){return t instanceof y||t instanceof f||t instanceof k||t instanceof M||t instanceof V||t instanceof v||t instanceof I}function b(t){return l.isCollection(t)&&t.length&&g(t.at(0))}function O(t){return Array.isArray(t)&&t.length>0&&g(t[0])}let h=class extends F(H){constructor(){super(...arguments),this._graphics=new l,this._highlightIds=new Map,this._networkFeatureMap=new Map,this._networkGraphicMap=new Map}get _routeItems(){return new m({getCollections:()=>this.layer==null||this.destroyed?[]:[this.layer.routeInfo!=null?new l([this.layer.routeInfo]):null,this.layer.directionLines,this.layer.directionPoints,this.layer.polygonBarriers,this.layer.polylineBarriers,this.layer.pointBarriers,this.layer.stops]})}initialize(){this._updatingHandles.addOnCollectionChange(()=>this._routeItems,t=>this._routeItemsChanged(t),_)}destroy(){var t;this._networkFeatureMap.clear(),this._networkGraphicMap.clear(),this._graphics.removeAll(),(t=this._get("_routeItems"))==null||t.destroy()}attach(){this._createGraphicsView()}detach(){this._destroyGraphicsView()}async fetchPopupFeaturesAtLocation(t,e){return this._graphicsView.hitTest(t).filter(({popupTemplate:i})=>!!i)}highlight(t){let e;e=g(t)?[this._getNetworkFeatureUid(t)]:O(t)?t.map(r=>this._getNetworkFeatureUid(r)):b(t)?t.map(r=>this._getNetworkFeatureUid(r)).toArray():[t.uid];const i=e.filter(n);return i.length?(this._addHighlight(i),c(()=>this._removeHighlight(i))):c()}async hitTest(t,e){if(this.suspended)return null;const i=this._graphicsView.hitTest(t).filter(n).map(s=>this._networkGraphicMap.get(s));if(!i.length)return null;const{layer:r}=this;return i.reverse().map(s=>({type:"route",layer:r,mapPoint:t,networkFeature:s}))}isUpdating(){return this._graphicsView.updating}moveStart(){}moveEnd(){}update(t){this._graphicsView.processUpdate(t)}viewChange(){this._graphicsView.viewChange()}_addHighlight(t){for(const e of t)if(this._highlightIds.has(e)){const i=this._highlightIds.get(e);this._highlightIds.set(e,i+1)}else this._highlightIds.set(e,1);this._updateHighlight()}_createGraphic(t){const e=t.toGraphic();return e.layer=this.layer,e.sourceLayer=this.layer,e}_createGraphicsView(){const t=this.view,e=()=>this.requestUpdate(),i=new C(t.featuresTilingScheme);this._graphicsView=new $({container:i,graphics:this._graphics,requestUpdateCallback:e,view:t}),this.container.addChild(i),this._updateHighlight()}_destroyGraphicsView(){this.container.removeChild(this._graphicsView.container),this._graphicsView.destroy()}_getDrawOrder(t){const e=this._networkGraphicMap.get(t);return U.indexOf(e.type)}_getNetworkFeatureUid(t){return this._networkFeatureMap.has(t)?this._networkFeatureMap.get(t).uid:null}_removeHighlight(t){for(const e of t)if(this._highlightIds.has(e)){const i=this._highlightIds.get(e)-1;i===0?this._highlightIds.delete(e):this._highlightIds.set(e,i)}this._updateHighlight()}_routeItemsChanged(t){if(t.removed.length){this._graphics.removeMany(t.removed.map(e=>{const i=this._networkFeatureMap.get(e);return this._networkFeatureMap.delete(e),this._networkGraphicMap.delete(i),i}));for(const e of t.removed)this.removeHandles(e)}if(t.added.length){this._graphics.addMany(t.added.map(e=>{const i=this._createGraphic(e);return i.symbol==null?null:(this._networkFeatureMap.set(e,i),this._networkGraphicMap.set(i,e),i)}).filter(n));for(const e of t.added)this.addHandles([d(()=>e.geometry,(i,r)=>{this._updateGraphic(e,"geometry",i,r)}),d(()=>e.symbol,(i,r)=>{this._updateGraphic(e,"symbol",i,r)})],e);this._graphics.sort((e,i)=>this._getDrawOrder(e)-this._getDrawOrder(i))}}_updateGraphic(t,e,i,r){if(!this._networkFeatureMap.has(t)){const o=this._createGraphic(t);return this._networkFeatureMap.set(t,o),this._networkGraphicMap.set(o,t),void this._graphics.add(o)}const s=this._networkFeatureMap.get(t);s[e]=i,a.graphic=s,a.property=e,a.oldValue=r,a.newValue=i,this._graphicsView.graphicUpdateHandler(a)}_updateHighlight(){const t=Array.from(this._highlightIds.keys()),e=G("highlight");this._graphicsView.setHighlight(t.map(i=>({objectId:i,highlightFlags:e})))}};p([u()],h.prototype,"_graphics",void 0),p([u()],h.prototype,"_routeItems",null),h=p([w("esri.views.2d.layers.RouteLayerView2D")],h);const Mt=h;export{Mt as default}; diff --git a/assets/SDFHelper-CSK796Wb.js b/assets/SDFHelper-kKuXhauo.js similarity index 94% rename from assets/SDFHelper-CSK796Wb.js rename to assets/SDFHelper-kKuXhauo.js index a7bf60e..20f50cc 100644 --- a/assets/SDFHelper-CSK796Wb.js +++ b/assets/SDFHelper-kKuXhauo.js @@ -1 +1 @@ -import{o as q}from"./floatRGBA-BLm-Rhaq.js";import{F as G,$ as V}from"./index-CEWggaxV.js";import{t as U}from"./UpdateTracking2D-nj9Q-3df.js";function $(n){var o;switch(n.type){case"CIMPointSymbol":{const r=n.symbolLayers;if(!r||r.length!==1)return null;const t=r[0];return t.type!=="CIMVectorMarker"?null:$(t)}case"CIMVectorMarker":{const r=n.markerGraphics;if(!r||r.length!==1)return null;const t=r[0];if(!t)return null;const i=t.geometry;if(!i)return null;const l=t.symbol;return!l||l.type!=="CIMPolygonSymbol"&&l.type!=="CIMLineSymbol"||(o=l.symbolLayers)!=null&&o.some(e=>!!e.effects)?null:{type:"sdf",geom:i,asFill:l.type==="CIMPolygonSymbol"}}}}function j(n){return n?n.rings?n.rings:n.paths?n.paths:n.xmin!==void 0&&n.ymin!==void 0&&n.xmax!==void 0&&n.ymax!==void 0?[[[n.xmin,n.ymin],[n.xmin,n.ymax],[n.xmax,n.ymax],[n.xmax,n.ymin],[n.xmin,n.ymin]]]:null:null}function z(n){let o=1/0,r=-1/0,t=1/0,i=-1/0;for(const l of n)for(const e of l)e[0]r&&(r=e[0]),e[1]i&&(i=e[1]);return new U(o,t,r-o,i-t)}function A(n){let o=1/0,r=-1/0,t=1/0,i=-1/0;for(const l of n)for(const e of l)e[0]r&&(r=e[0]),e[1]i&&(i=e[1]);return[o,t,r,i]}function N(n){return n?n.rings?A(n.rings):n.paths?A(n.paths):G(n)?[n.xmin,n.ymin,n.xmax,n.ymax]:null:null}function O(n,o,r,t,i){const[l,e,s,u]=n;if(s0&&(y=(o.xmax-o.xmin)/(o.ymax-o.ymin),x=t.x/(r*y),p=t.y/r):(x=t.x,p=t.y)),o&&(x=.5*(o.xmax+o.xmin)+x*(o.xmax-o.xmin),p=.5*(o.ymax+o.ymin)+p*(o.ymax-o.ymin)),x-=l,p-=e,x*=h,p*=h,x+=M,p+=M;let w=x/g-.5,F=p/d-.5;return i&&r&&(w*=r*y,F*=r),[b,w,F,y]}function Q(n){const o=j(n.geom),r=z(o),t=128,i=V,l=Math.floor(.5*(.5*t-i)),e=(t-2*(l+i))/Math.max(r.width,r.height),s=Math.round(r.width*e)+2*l,u=Math.round(r.height*e)+2*l,a=[];for(const m of o)if(m&&m.length>1){const c=[];for(const M of m){let[h,g]=M;h-=r.x,g-=r.y,h*=e,g*=e,h+=l-.5,g+=l-.5,n.asFill?c.push([h,g]):c.push([Math.round(h),Math.round(g)])}if(n.asFill){const M=c.length-1;c[0][0]===c[M][0]&&c[0][1]===c[M][1]||c.push(c[0])}a.push(c)}const f=B(a,s,u,l);return n.asFill&&D(a,s,u,l,f),[E(f,l),s,u]}function B(n,o,r,t){const i=o*r,l=new Array(i),e=t*t+1;for(let s=0;so&&(b=o),x<0&&(x=0),p>r&&(p=r);const y=m[0]-f[0],w=m[1]-f[1],F=y*y+w*w;for(let C=d;CF?(v=m[0],S=m[1]):(k/=F,v=f[0]+k*y,S=f[1]+k*w);const L=(C-v)*(C-v)+(I-S)*(I-S),P=(r-I-1)*o+C;Lo-t&&(g=o-t),dr-t&&(b=r-t);for(let x=d;xx==a[1]>x)continue;const p=(r-x-1)*o;for(let y=h;y!!e.effects)?null:{type:"sdf",geom:i,asFill:l.type==="CIMPolygonSymbol"}}}}function j(n){return n?n.rings?n.rings:n.paths?n.paths:n.xmin!==void 0&&n.ymin!==void 0&&n.xmax!==void 0&&n.ymax!==void 0?[[[n.xmin,n.ymin],[n.xmin,n.ymax],[n.xmax,n.ymax],[n.xmax,n.ymin],[n.xmin,n.ymin]]]:null:null}function z(n){let o=1/0,r=-1/0,t=1/0,i=-1/0;for(const l of n)for(const e of l)e[0]r&&(r=e[0]),e[1]i&&(i=e[1]);return new U(o,t,r-o,i-t)}function A(n){let o=1/0,r=-1/0,t=1/0,i=-1/0;for(const l of n)for(const e of l)e[0]r&&(r=e[0]),e[1]i&&(i=e[1]);return[o,t,r,i]}function N(n){return n?n.rings?A(n.rings):n.paths?A(n.paths):G(n)?[n.xmin,n.ymin,n.xmax,n.ymax]:null:null}function O(n,o,r,t,i){const[l,e,s,u]=n;if(s0&&(y=(o.xmax-o.xmin)/(o.ymax-o.ymin),x=t.x/(r*y),p=t.y/r):(x=t.x,p=t.y)),o&&(x=.5*(o.xmax+o.xmin)+x*(o.xmax-o.xmin),p=.5*(o.ymax+o.ymin)+p*(o.ymax-o.ymin)),x-=l,p-=e,x*=h,p*=h,x+=M,p+=M;let w=x/g-.5,F=p/d-.5;return i&&r&&(w*=r*y,F*=r),[b,w,F,y]}function Q(n){const o=j(n.geom),r=z(o),t=128,i=V,l=Math.floor(.5*(.5*t-i)),e=(t-2*(l+i))/Math.max(r.width,r.height),s=Math.round(r.width*e)+2*l,u=Math.round(r.height*e)+2*l,a=[];for(const m of o)if(m&&m.length>1){const c=[];for(const M of m){let[h,g]=M;h-=r.x,g-=r.y,h*=e,g*=e,h+=l-.5,g+=l-.5,n.asFill?c.push([h,g]):c.push([Math.round(h),Math.round(g)])}if(n.asFill){const M=c.length-1;c[0][0]===c[M][0]&&c[0][1]===c[M][1]||c.push(c[0])}a.push(c)}const f=B(a,s,u,l);return n.asFill&&D(a,s,u,l,f),[E(f,l),s,u]}function B(n,o,r,t){const i=o*r,l=new Array(i),e=t*t+1;for(let s=0;so&&(b=o),x<0&&(x=0),p>r&&(p=r);const y=m[0]-f[0],w=m[1]-f[1],F=y*y+w*w;for(let C=d;CF?(v=m[0],S=m[1]):(k/=F,v=f[0]+k*y,S=f[1]+k*w);const L=(C-v)*(C-v)+(I-S)*(I-S),P=(r-I-1)*o+C;Lo-t&&(g=o-t),dr-t&&(b=r-t);for(let x=d;xx==a[1]>x)continue;const p=(r-x-1)*o;for(let y=h;y __vite__mapDeps.viteFileDeps[i]) } -import{d as s,y as o,f as L,aU as Q,dm as X,V as j,aB as _,bw as Y,au as P,h2 as ee,aZ as g,z as te,ez as re,d5 as ie,M as V,aV as se,_ as k,dM as ae,dp as oe,dq as ne,bQ as le,dr as pe,dO as de,dN as ye,b4 as ue,fA as x,s as f,ay as ce,aX as he,N as d,hW as fe,j as me,b_ as ge,b7 as T,aA as ve,a6 as R,bs as $,b as we,fK as be,e8 as Ie,fB as Le,dt as Fe,hX as Se,fD as _e,i as $e,fE as Ee,bT as Oe}from"./index-CEWggaxV.js";import"./UniqueValueRenderer-BlkUix3g.js";import{u as je}from"./jsonUtils-BseLl1fZ.js";import{$ as Ae}from"./Mesh-9oOqPmbT.js";import{i as Pe,m as xe}from"./uploadAssetErrors-D_dYSFa_.js";import{F as Te}from"./EditBusLayer-SG7oYwiY.js";import{L as Re,P as D}from"./SceneService-l5OfqT0E.js";import{m as De,s as qe}from"./capabilities-BQHqqlJu.js";import{s as Ne}from"./associatedFeatureServiceUtils-BIEHgyxo.js";import{T as Ue,V as Ce}from"./featureLayerUtils-BhDaw8pS.js";import{t as Ge,p as Qe}from"./FeatureReductionSelection-BY3KVXac.js";import{s as Ve}from"./fieldProperties-DMs4wT6-.js";import{Z as ke}from"./FieldsIndex-CLgRNeJ_.js";import{s as M,l as Me,u as Je,m as Ke}from"./I3SLayerDefinitions-B6gGfNoh.js";import{r as He,t as We}from"./infoFor3D-DsOdlPuA.js";import{C as ze}from"./LabelClass-6cZokw8y.js";import{i as q}from"./labelingInfo-CijajRsc.js";import{p as Ze}from"./LayerFloorInfo-Cdq3ulNh.js";import{a as Be}from"./lazyLayerLoader-s-GqbiwM.js";import{j as Xe}from"./persistable-uPSrwVmW.js";import{t as Ye}from"./styleUtils-B_Iy1DTk.js";import{I as N,y as et,Z as tt}from"./elevationInfoUtils-Dag_mzct.js";import{n as U}from"./styleUtils-CnV_Xzhi.js";import{p as rt}from"./popupUtils-DAFYyAvw.js";import{$ as it}from"./I3SUtil-DxFIPSkh.js";import{n as st,p as at}from"./popupUtils-BovqErR_.js";import"./ColorStop-44hBlQ14.js";import"./diffUtils-B4YFa5Ju.js";import"./colorRamps-BJydlf0f.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-z2k12BH8.js";import"./jsonUtils-qYmXvGJ1.js";import"./Version-Bd0QsIQ5.js";import"./OverrideHelper-B4ryGWZb.js";import"./utils-p-5Bbga5.js";import"./quantizationUtils-CUjGHrU3.js";import"./heatmapUtils-Clt5rJzr.js";import"./georeference-DtjTZVKi.js";import"./mat3f64-q3fE-ZOt.js";import"./mat4f64-CSKppSlJ.js";import"./computeTranslationToOriginAndRotation-DOOKw0d1.js";import"./DoubleArray-DxyNBrRi.js";import"./quat-CoKEr4Zu.js";import"./quatf64-Bdb9ZJJK.js";import"./meshVertexSpaceUtils-BFWpJFSd.js";import"./MeshLocalVertexSpace-Cltwu1Kq.js";import"./vec3-CjYmIfaa.js";import"./BufferView-Ao_K-5Vg.js";import"./imageUtils-DNanu5Rn.js";import"./earcut-hRlx3adE.js";import"./Indices-Dv-cCjFT.js";import"./deduplicate-Bk22TunD.js";import"./plane-py4f_JCU.js";import"./triangle-CU37cZF1.js";import"./Util-BS8sJGjF.js";import"./ObjectStack-CF0cQvd2.js";import"./lineSegment-B9UF3nEF.js";import"./basicInterfaces-GbxEOYtk.js";import"./VertexAttribute-BlT9lbVY.js";import"./External-DC51KyR4.js";import"./originUtils-D69mHv66.js";import"./multiOriginJSONSupportUtils-C0wm8_Yw.js";import"./resourceUtils-Cu1-5qu3.js";import"./resourceUtils-CjqYbm2Q.js";import"./saveAPIKeyUtils-BiX1lQSW.js";import"./saveUtils-BzCRy3uR.js";import"./TimeInfo-3TVmpFSA.js";import"./AttachmentQuery-D61mmWw4.js";import"./RelationshipQuery-DDK72Kwc.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./labelUtils-Dnqx6jl5.js";import"./defaultsJSON-CHAaurhX.js";import"./MD5-C9MwAd2G.js";import"./resourceExtension-orEjzZQo.js";import"./sphere-DHd2K2LR.js";import"./I3SBinaryReader-N_Is4gxa.js";import"./symbolColorUtils-D_minlYz.js";import"./orientedBoundingBox-BQdJNYvE.js";let m=class extends Q{constructor(){super(...arguments),this.name=null,this.field=null,this.currentRangeExtent=null,this.fullRangeExtent=null,this.type="rangeInfo"}};s([o({type:String,json:{read:!0,write:!0}})],m.prototype,"name",void 0),s([o({type:String,json:{read:!0,write:!0}})],m.prototype,"field",void 0),s([o({type:[Number],json:{read:!0,write:!0}})],m.prototype,"currentRangeExtent",void 0),s([o({type:[Number],json:{read:!0,write:!0}})],m.prototype,"fullRangeExtent",void 0),s([o({type:["rangeInfo"],readOnly:!0,json:{read:!1,write:!0}})],m.prototype,"type",void 0),m=s([L("esri.layers.support.RangeInfo")],m);var b;let E=b=class extends X(j.ofType(_)){constructor(e){super(e)}clone(){return new b(this.items.map(e=>e.clone()))}write(e,t){return this.toJSON(t)}toJSON(e){var r;const t=(r=e==null?void 0:e.layer)==null?void 0:r.spatialReference;return t?this.toArray().map(i=>{if(!t.equals(i.spatialReference)){if(!Y(i.spatialReference,t))return e!=null&&e.messages&&e.messages.push(new P("scenefilter:unsupported","Scene filters with incompatible spatial references are not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),null;const l=new _;ee(i,l,t),i=l}const n=i.toJSON(e);return delete n.spatialReference,n}).filter(i=>i!=null):(e!=null&&e.messages&&e.messages.push(new P("scenefilter:unsupported","Writing Scene filters without context layer is not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),this.toArray().map(i=>i.toJSON(e)))}static fromJSON(e,t){const r=new b;return e.forEach(i=>r.add(_.fromJSON(i,t))),r}};E=b=s([L("esri.layers.support.PolygonCollection")],E);const I=E;var O;let v=O=class extends Q{constructor(e){super(e),this.spatialRelationship="disjoint",this.geometries=new I,this._geometriesSource=null}initialize(){this.addHandles(te(()=>this.geometries,"after-changes",()=>this.geometries=this.geometries,re))}readGeometries(e,t,r){Array.isArray(e)?this.geometries=I.fromJSON(e,r):this._geometriesSource={url:ie(e,r),context:r}}async loadGeometries(e,t){if(this._geometriesSource==null)return;const{url:r,context:i}=this._geometriesSource,n=await V(r,{responseType:"json",signal:t==null?void 0:t.signal}),l=e.toJSON(),p=n.data.map(y=>({...y,spatialReference:l}));this.geometries=I.fromJSON(p,i),this._geometriesSource=null}clone(){const e=new O({geometries:se(this.geometries),spatialRelationship:this.spatialRelationship});return e._geometriesSource=this._geometriesSource,e}};s([o({type:["disjoint","contains"],nonNullable:!0,json:{write:!0}})],v.prototype,"spatialRelationship",void 0),s([o({type:I,nonNullable:!0,json:{write:!0}}),Xe({origins:["web-scene","portal-item"],type:"resource",prefix:"geometries",contentAddressed:!0})],v.prototype,"geometries",void 0),s([g(["web-scene","portal-item"],"geometries")],v.prototype,"readGeometries",null),v=O=s([L("esri.layers.support.SceneFilter")],v);const ot=v;async function nt(e){const t=[];for(const r of e)r.name.toLowerCase().endsWith(".zip")?t.push(lt(r)):t.push(Promise.resolve(r));return(await Promise.all(t)).flat()}async function lt(e){const{BlobReader:t,ZipReader:r,BlobWriter:i}=await k(()=>import("./zipjs-wrapper-Ccj19yUd.js"),[]),n=[];return(await new r(new t(e)).getEntries()).forEach(p=>{var c;if(p.directory||/^__MACOS/i.test(p.filename))return;const y=new i,u=(c=p.getData)==null?void 0:c.call(p,y).then(h=>new File([h],p.filename));u&&n.push(u)}),Promise.all(n)}const pt=new Set(["3DObject","Point"]),C=Ve();let a=class extends De(Te(Re(ae(oe(ne(le(pe(de(ye(ue(Oe))))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new j,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}destroy(){this._set("renderer",null)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){var i,n,l;const r=(n=(i=this.getFeatureType(t==null?void 0:t.feature))==null?void 0:i.domains)==null?void 0:n[e];return r&&r.type!=="inherited"?r:((l=this.getField(e))==null?void 0:l.domain)??null}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){var e;return((e=this.associatedLayer)==null?void 0:e.types)??[]}get typeIdField(){var e;return((e=this.associatedLayer)==null?void 0:e.typeIdField)??null}get templates(){var e;return((e=this.associatedLayer)==null?void 0:e.templates)??null}get formTemplate(){var e;return((e=this.associatedLayer)==null?void 0:e.formTemplate)??null}get fieldsIndex(){return new ke(this.fields)}readNodePages(e,t,r){return t.layerType==="Point"&&(e=t.pointNodePages),e==null||typeof e!="object"?null:M.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){var e;return this._capabilitiesFromAssociatedFeatureLayer((e=this.associatedLayer)==null?void 0:e.effectiveCapabilities)}get effectiveEditingEnabled(){return this.associatedLayer!=null&&Ue(this.associatedLayer)}get geometryType(){return dt[this.profile]||"mesh"}set renderer(e){x(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return e!=null&&typeof e=="object"||(e={}),e.color==null&&(e.color=!1),e}get capabilities(){var e;return this._capabilitiesFromAssociatedFeatureLayer((e=this.associatedLayer)==null?void 0:e.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){var A;e=e??qe;const{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsRollbackOnFailure:n,supportsUploadWithItemId:l,supportsGeometryUpdate:p,supportsReturnServiceEditsInSourceSpatialReference:y},data:{supportsZ:u,supportsM:c,isVersioned:h,supportsAttachment:F},operations:{supportsEditing:J,supportsAdd:K,supportsUpdate:H,supportsDelete:W,supportsQuery:z,supportsQueryAttachments:Z,supportsAsyncConvert3D:B}}=e,w=e.operations.supportsChangeTracking,S=!!((A=this.associatedLayer)!=null&&A.infoFor3D)&&U();return{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsReturnServiceEditsInSourceSpatialReference:y,supportsRollbackOnFailure:n,supportsGeometryUpdate:S&&p,supportsUploadWithItemId:l},data:{supportsAttachment:F,supportsZ:u,supportsM:c,isVersioned:h},operations:{supportsQuery:z,supportsQueryAttachments:Z,supportsEditing:J&&w,supportsAdd:S&&K&&w,supportsDelete:S&&W&&w,supportsUpdate:H&&w,supportsAsyncConvert3D:B}}}get editingEnabled(){var e;return this._isOverridden("editingEnabled")?this._get("editingEnabled"):((e=this.associatedLayer)==null?void 0:e.editingEnabled)??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){var e;return((e=this.associatedLayer)==null?void 0:e.infoFor3D)??null}get relationships(){var e;return(e=this.associatedLayer)==null?void 0:e.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(r=>(r.type==="esriFieldTypeOID"&&(e=r.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(r=>(r.type==="esriFieldTypeGlobalID"&&(e=r.name),!!e)),e||void 0}get displayField(){var e;return((e=this.associatedLayer)==null?void 0:e.displayField)??null}readProfile(e,t){const r=t.store.profile;return r!=null&&G[r]?G[r]:(f.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=e!=null?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(ce),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await Ye(this,{origin:"service"},t),x(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){this.filter!=null&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){f.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new he;return this.geometryType!=="mesh"&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatures(e||this.createQuery(),t)).then(r=>{if(r!=null&&r.features)for(const i of r.features)i.layer=this,i.sourceLayer=this;return r})}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new d("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new d("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=fe(this.fieldsIndex,await st(this,at(this)));return it(this.parsedUrl.path,this.attributeStorageInfo??[],e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,t){const r=await this.queryCachedAttributes(e,[t]);if(!r||r.length===0)throw new d("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const i=new me;return i.attributes=r[0],i.layer=this,i.sourceLayer=this,i}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryAttachments(e,t))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(f.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return rt(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e!=null&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new d("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new d("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return this.statisticsInfo!=null&&this.statisticsInfo.some(t=>t.name===e)}async queryCachedStatistics(e,t){if(await this.load(t),!this.statisticsInfo)throw new d("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const r=this.fieldsIndex.get(e);if(!r)throw new d("scenelayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const i of this.statisticsInfo)if(i.name===r.name){const n=ge(this.parsedUrl.path,i.href);return V(n,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:t?t.signal:null}).then(l=>l.data)}throw new d("scenelayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,t){return this._debouncedSaveOperations(D.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(D.SAVE,e)}async applyEdits(e,t){const{applyEdits:r}=await k(()=>import("./editingSupport-DWTRjmy9.js"),__vite__mapDeps([0,1,2,3,4]));let i=t;await this.load();const n=this.associatedLayer;if(!n)throw new d(`${this.type}-layer:not-editable`,"Service is not editable");await n.load();const{globalIdField:l}=n,p=!!n.infoFor3D,y=(i==null?void 0:i.globalIdUsed)??!0;if(p&&l==null)throw new d(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(p&&!y)throw new d(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return T(n.url)&&p&&e.deleteFeatures!=null&&l!=null&&(i={...i,globalIdToObjectId:await Ce(n,e.deleteFeatures,l)}),r(this,n.source,e,i)}async uploadAssets(e,t){if(await this.load(),this.associatedLayer==null)throw new d(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}on(e,t){return super.on(e,t)}async convertMesh(e,t){const r=h=>{throw f.getLogger(this).error(".convertMesh()",h.message),h};await this.load(),this.infoFor3D||r(new d("invalid:layer","SceneLayer has no capability for mesh conversion"));const i=await this.extractAndFilterFiles(e),n=i.reduce((h,F)=>He(this.infoFor3D,F)?h+1:h,0);n===0&&r(new Pe),n>1&&r(new xe);const l=this.spatialReference,p=(t==null?void 0:t.location)??new ve({x:0,y:0,z:0,spatialReference:l}),y=p.spatialReference.isGeographic?"local":"georeferenced",u=Ae.createWithExternalSource(p,i,{vertexSpace:y}),[c]=await this.uploadAssets([u],t);return c}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;return t?(await nt(e)).filter(r=>We(t,r)):e}validateLayer(e){if(e.layerType&&!pt.has(e.layerType))throw new d("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new d("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new d("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(r,i){let n=!1,l=!1;if(r==null)n=!0,l=!0;else{const p=i&&i.isGeographic;switch(r){case"east-north-up":case"earth-centered":n=!0,l=p;break;case"vertex-reference-frame":n=!0,l=!p;break;default:n=!1}}if(!n)throw new d("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!l)throw new d("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if(this.profile==="points")e.push("Point");else{if(this.profile!=="mesh-pyramids")throw new d("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){var e,t;if(this._fieldUsageInfo={},this.fields)for(const r of this.fields){const i=!(!this.attributeStorageInfo||!this.attributeStorageInfo.some(p=>p.name===r.name)),n=!!((t=(e=this.associatedLayer)==null?void 0:e.fields)!=null&&t.some(p=>p&&r.name===p.name)),l={supportsLabelingInfo:i,supportsRenderer:i,supportsPopupTemplate:i||n,supportsLayerQuery:n};this._fieldUsageInfo[r.name]=l}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){var t;if(!((t=this.associatedLayer)!=null&&t.fields))return;let e=null;for(const r of this.associatedLayer.fields){const i=this.getField(r.name);i?(!i.domain&&r.domain&&(i.domain=r.domain.clone()),i.editable=r.editable,i.nullable=r.nullable,i.length=r.length):(e||(e=this.fields?this.fields.slice():[]),e.push(r.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPopupOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled"],t=R(this);for(let r=0;rthis.popupEnabled&&this.popupTemplate!=null);const e=`this SceneLayer: ${this.title}`;this.attributeStorageInfo==null?f.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):f.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;this.profile==="mesh-pyramids"&&N(f.getLogger(this),et("Mesh scene layers","relative-to-scene",e)),N(f.getLogger(this),tt("Scene layers",e))}};s([o({types:{key:"type",base:Ge,typeMap:{selection:Qe}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],a.prototype,"featureReduction",void 0),s([o({type:[m],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],a.prototype,"rangeInfos",void 0),s([o({json:{read:!1}})],a.prototype,"associatedLayer",void 0),s([o({type:["show","hide"]})],a.prototype,"listMode",void 0),s([o({type:["ArcGISSceneServiceLayer"]})],a.prototype,"operationalLayerType",void 0),s([o({json:{read:!1},readOnly:!0})],a.prototype,"type",void 0),s([o({...C.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],a.prototype,"fields",void 0),s([o()],a.prototype,"types",null),s([o()],a.prototype,"typeIdField",null),s([o()],a.prototype,"templates",null),s([o()],a.prototype,"formTemplate",null),s([o({readOnly:!0,clonable:!1})],a.prototype,"fieldsIndex",null),s([o({type:Ze,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],a.prototype,"floorInfo",void 0),s([o(C.outFields)],a.prototype,"outFields",void 0),s([o({type:M,readOnly:!0,json:{read:!1}})],a.prototype,"nodePages",void 0),s([g("service","nodePages",["nodePages","pointNodePages"])],a.prototype,"readNodePages",null),s([o({type:[Me],readOnly:!0})],a.prototype,"materialDefinitions",void 0),s([o({type:[Je],readOnly:!0})],a.prototype,"textureSetDefinitions",void 0),s([o({type:[Ke],readOnly:!0})],a.prototype,"geometryDefinitions",void 0),s([o({readOnly:!0})],a.prototype,"serviceUpdateTimeStamp",void 0),s([o({readOnly:!0})],a.prototype,"attributeStorageInfo",void 0),s([o({readOnly:!0})],a.prototype,"statisticsInfo",void 0),s([o({type:j.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],a.prototype,"excludeObjectIds",void 0),s([o({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],a.prototype,"definitionExpression",void 0),s([o({type:ot,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],a.prototype,"filter",void 0),s([o({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],a.prototype,"path",void 0),s([o(Ie)],a.prototype,"elevationInfo",null),s([o({readOnly:!0,json:{read:!1}})],a.prototype,"effectiveCapabilities",null),s([o({readOnly:!0})],a.prototype,"effectiveEditingEnabled",null),s([o({type:String})],a.prototype,"geometryType",null),s([o(Le)],a.prototype,"labelsVisible",void 0),s([o({type:[ze],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:q},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:q},write:!0}})],a.prototype,"labelingInfo",void 0),s([o(Fe)],a.prototype,"legendEnabled",void 0),s([o({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){var i,n;if(typeof e=="number"&&e>=0&&e<=1)return e;const r=(n=(i=t.layerDefinition)==null?void 0:i.drawingInfo)==null?void 0:n.transparency;return r!==void 0?Se(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],a.prototype,"opacity",void 0),s([o({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],a.prototype,"priority",void 0),s([o({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],a.prototype,"semantic",void 0),s([o({types:je,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],a.prototype,"renderer",null),s([o({json:{read:!1}})],a.prototype,"cachedDrawingInfo",void 0),s([g("service","cachedDrawingInfo")],a.prototype,"readCachedDrawingInfo",null),s([o({readOnly:!0,json:{read:!1}})],a.prototype,"capabilities",null),s([o({type:Boolean,json:{read:!1}})],a.prototype,"editingEnabled",null),s([o({readOnly:!0,json:{write:!1,read:!1}})],a.prototype,"infoFor3D",null),s([o({readOnly:!0,json:{write:!1,read:!1}})],a.prototype,"relationships",null),s([o(_e)],a.prototype,"popupEnabled",void 0),s([o({type:$e,json:{name:"popupInfo",write:!0}})],a.prototype,"popupTemplate",void 0),s([o({readOnly:!0,json:{read:!1}})],a.prototype,"defaultPopupTemplate",null),s([o({type:String,json:{read:!1}})],a.prototype,"objectIdField",void 0),s([g("service","objectIdField",["objectIdField","fields"])],a.prototype,"readObjectIdField",null),s([o({type:String,json:{read:!1}})],a.prototype,"globalIdField",void 0),s([g("service","globalIdField",["globalIdField","fields"])],a.prototype,"readGlobalIdField",null),s([o({readOnly:!0,type:String,json:{read:!1}})],a.prototype,"displayField",null),s([o({type:String,json:{read:!1}})],a.prototype,"profile",void 0),s([g("service","profile",["store.profile"])],a.prototype,"readProfile",null),s([o({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],a.prototype,"normalReferenceFrame",void 0),s([o(Ee)],a.prototype,"screenSizePerspectiveEnabled",void 0),s([o({json:{read:!1,origins:{service:{read:!0}}}})],a.prototype,"serviceItemId",void 0),a=s([L("esri.layers.SceneLayer")],a);const G={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},dt={"mesh-pyramids":"mesh",points:"point",lines:"polyline",polygons:"polygon"},Dr=a;export{Dr as default}; +import{d as s,y as o,f as L,aU as Q,dm as X,V as j,aB as _,bw as Y,au as P,h2 as ee,aZ as g,z as te,ez as re,d5 as ie,M as V,aV as se,_ as k,dM as ae,dp as oe,dq as ne,bQ as le,dr as pe,dO as de,dN as ye,b4 as ue,fA as x,s as f,ay as ce,aX as he,N as d,hW as fe,j as me,b_ as ge,b7 as T,aA as ve,a6 as R,bs as $,b as we,fK as be,e8 as Ie,fB as Le,dt as Fe,hX as Se,fD as _e,i as $e,fE as Ee,bT as Oe}from"./index-BjUNJPVf.js";import"./UniqueValueRenderer-7V9Bhr-D.js";import{u as je}from"./jsonUtils-Dw332y6z.js";import{$ as Ae}from"./Mesh--rTzs1p1.js";import{i as Pe,m as xe}from"./uploadAssetErrors-DCHo_tDX.js";import{F as Te}from"./EditBusLayer-OslMX9fF.js";import{L as Re,P as D}from"./SceneService-DbS150xR.js";import{m as De,s as qe}from"./capabilities-DXGHT-QH.js";import{s as Ne}from"./associatedFeatureServiceUtils-nLeTqfYC.js";import{T as Ue,V as Ce}from"./featureLayerUtils-lwqyOSrl.js";import{t as Ge,p as Qe}from"./FeatureReductionSelection-t3T7oa8H.js";import{s as Ve}from"./fieldProperties-DnrQXLBM.js";import{Z as ke}from"./FieldsIndex-CK-0B5n9.js";import{s as M,l as Me,u as Je,m as Ke}from"./I3SLayerDefinitions-Bc0e5Sgz.js";import{r as He,t as We}from"./infoFor3D-DsOdlPuA.js";import{C as ze}from"./LabelClass-CeatfK8u.js";import{i as q}from"./labelingInfo-DqAUis6e.js";import{p as Ze}from"./LayerFloorInfo-DlYNbO-A.js";import{a as Be}from"./lazyLayerLoader-Cu0XtDD2.js";import{j as Xe}from"./persistable-3OEDOKAC.js";import{t as Ye}from"./styleUtils--I7zqeL6.js";import{I as N,y as et,Z as tt}from"./elevationInfoUtils-DIYaTlLQ.js";import{n as U}from"./styleUtils-DOUOskVZ.js";import{p as rt}from"./popupUtils-DlZin22m.js";import{$ as it}from"./I3SUtil-Bs1mZiKI.js";import{n as st,p as at}from"./popupUtils-Do2GfZME.js";import"./ColorStop-DCGjAKLC.js";import"./diffUtils-uUoMDFQS.js";import"./colorRamps-CcakIWlU.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-BX9G5gNQ.js";import"./jsonUtils-Ox5U0P0F.js";import"./Version-Dqq_CHBG.js";import"./OverrideHelper-DxFZBnGL.js";import"./utils-CuXO_Zzq.js";import"./quantizationUtils-CfV316jZ.js";import"./heatmapUtils-BSteZBTj.js";import"./georeference-DqFdARS7.js";import"./mat3f64-q3fE-ZOt.js";import"./mat4f64-CSKppSlJ.js";import"./computeTranslationToOriginAndRotation-BeE3rOSz.js";import"./DoubleArray--0pYeNcV.js";import"./quat-C0wQB0HB.js";import"./quatf64-Bdb9ZJJK.js";import"./meshVertexSpaceUtils-DwMoblqo.js";import"./MeshLocalVertexSpace-DRvwbFTJ.js";import"./vec3-DdRUbala.js";import"./BufferView-3om6S_aJ.js";import"./imageUtils-ChIDAvDr.js";import"./earcut-CWKXDqDj.js";import"./Indices-BRm9v2lM.js";import"./deduplicate-BR6i8Xk0.js";import"./plane-DxOTtTwj.js";import"./triangle-DmKBscqo.js";import"./Util-CS5u4Lec.js";import"./ObjectStack-BAIuPeIh.js";import"./lineSegment-BYtydnRZ.js";import"./basicInterfaces-GbxEOYtk.js";import"./VertexAttribute-BlT9lbVY.js";import"./External-DIoD7Bb4.js";import"./originUtils-D69mHv66.js";import"./multiOriginJSONSupportUtils-C0wm8_Yw.js";import"./resourceUtils-p9pTIVIi.js";import"./resourceUtils-CfE36DzP.js";import"./saveAPIKeyUtils-YRBbgdzi.js";import"./saveUtils-CGGzyvzv.js";import"./TimeInfo-DooETFWC.js";import"./AttachmentQuery-DmEAIZff.js";import"./RelationshipQuery-BDJrOxaX.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./labelUtils-3p0-m-Ee.js";import"./defaultsJSON-CHAaurhX.js";import"./MD5-C9MwAd2G.js";import"./resourceExtension-CiV172Z4.js";import"./sphere-F1imyuMS.js";import"./I3SBinaryReader-Bg6QQKyW.js";import"./symbolColorUtils-C9Wp-TPe.js";import"./orientedBoundingBox-sJmHxD3E.js";let m=class extends Q{constructor(){super(...arguments),this.name=null,this.field=null,this.currentRangeExtent=null,this.fullRangeExtent=null,this.type="rangeInfo"}};s([o({type:String,json:{read:!0,write:!0}})],m.prototype,"name",void 0),s([o({type:String,json:{read:!0,write:!0}})],m.prototype,"field",void 0),s([o({type:[Number],json:{read:!0,write:!0}})],m.prototype,"currentRangeExtent",void 0),s([o({type:[Number],json:{read:!0,write:!0}})],m.prototype,"fullRangeExtent",void 0),s([o({type:["rangeInfo"],readOnly:!0,json:{read:!1,write:!0}})],m.prototype,"type",void 0),m=s([L("esri.layers.support.RangeInfo")],m);var b;let E=b=class extends X(j.ofType(_)){constructor(e){super(e)}clone(){return new b(this.items.map(e=>e.clone()))}write(e,t){return this.toJSON(t)}toJSON(e){var r;const t=(r=e==null?void 0:e.layer)==null?void 0:r.spatialReference;return t?this.toArray().map(i=>{if(!t.equals(i.spatialReference)){if(!Y(i.spatialReference,t))return e!=null&&e.messages&&e.messages.push(new P("scenefilter:unsupported","Scene filters with incompatible spatial references are not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),null;const l=new _;ee(i,l,t),i=l}const n=i.toJSON(e);return delete n.spatialReference,n}).filter(i=>i!=null):(e!=null&&e.messages&&e.messages.push(new P("scenefilter:unsupported","Writing Scene filters without context layer is not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),this.toArray().map(i=>i.toJSON(e)))}static fromJSON(e,t){const r=new b;return e.forEach(i=>r.add(_.fromJSON(i,t))),r}};E=b=s([L("esri.layers.support.PolygonCollection")],E);const I=E;var O;let v=O=class extends Q{constructor(e){super(e),this.spatialRelationship="disjoint",this.geometries=new I,this._geometriesSource=null}initialize(){this.addHandles(te(()=>this.geometries,"after-changes",()=>this.geometries=this.geometries,re))}readGeometries(e,t,r){Array.isArray(e)?this.geometries=I.fromJSON(e,r):this._geometriesSource={url:ie(e,r),context:r}}async loadGeometries(e,t){if(this._geometriesSource==null)return;const{url:r,context:i}=this._geometriesSource,n=await V(r,{responseType:"json",signal:t==null?void 0:t.signal}),l=e.toJSON(),p=n.data.map(y=>({...y,spatialReference:l}));this.geometries=I.fromJSON(p,i),this._geometriesSource=null}clone(){const e=new O({geometries:se(this.geometries),spatialRelationship:this.spatialRelationship});return e._geometriesSource=this._geometriesSource,e}};s([o({type:["disjoint","contains"],nonNullable:!0,json:{write:!0}})],v.prototype,"spatialRelationship",void 0),s([o({type:I,nonNullable:!0,json:{write:!0}}),Xe({origins:["web-scene","portal-item"],type:"resource",prefix:"geometries",contentAddressed:!0})],v.prototype,"geometries",void 0),s([g(["web-scene","portal-item"],"geometries")],v.prototype,"readGeometries",null),v=O=s([L("esri.layers.support.SceneFilter")],v);const ot=v;async function nt(e){const t=[];for(const r of e)r.name.toLowerCase().endsWith(".zip")?t.push(lt(r)):t.push(Promise.resolve(r));return(await Promise.all(t)).flat()}async function lt(e){const{BlobReader:t,ZipReader:r,BlobWriter:i}=await k(()=>import("./zipjs-wrapper-Ccj19yUd.js"),[]),n=[];return(await new r(new t(e)).getEntries()).forEach(p=>{var c;if(p.directory||/^__MACOS/i.test(p.filename))return;const y=new i,u=(c=p.getData)==null?void 0:c.call(p,y).then(h=>new File([h],p.filename));u&&n.push(u)}),Promise.all(n)}const pt=new Set(["3DObject","Point"]),C=Ve();let a=class extends De(Te(Re(ae(oe(ne(le(pe(de(ye(ue(Oe))))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new j,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}destroy(){this._set("renderer",null)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){var i,n,l;const r=(n=(i=this.getFeatureType(t==null?void 0:t.feature))==null?void 0:i.domains)==null?void 0:n[e];return r&&r.type!=="inherited"?r:((l=this.getField(e))==null?void 0:l.domain)??null}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){var e;return((e=this.associatedLayer)==null?void 0:e.types)??[]}get typeIdField(){var e;return((e=this.associatedLayer)==null?void 0:e.typeIdField)??null}get templates(){var e;return((e=this.associatedLayer)==null?void 0:e.templates)??null}get formTemplate(){var e;return((e=this.associatedLayer)==null?void 0:e.formTemplate)??null}get fieldsIndex(){return new ke(this.fields)}readNodePages(e,t,r){return t.layerType==="Point"&&(e=t.pointNodePages),e==null||typeof e!="object"?null:M.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){var e;return this._capabilitiesFromAssociatedFeatureLayer((e=this.associatedLayer)==null?void 0:e.effectiveCapabilities)}get effectiveEditingEnabled(){return this.associatedLayer!=null&&Ue(this.associatedLayer)}get geometryType(){return dt[this.profile]||"mesh"}set renderer(e){x(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return e!=null&&typeof e=="object"||(e={}),e.color==null&&(e.color=!1),e}get capabilities(){var e;return this._capabilitiesFromAssociatedFeatureLayer((e=this.associatedLayer)==null?void 0:e.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){var A;e=e??qe;const{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsRollbackOnFailure:n,supportsUploadWithItemId:l,supportsGeometryUpdate:p,supportsReturnServiceEditsInSourceSpatialReference:y},data:{supportsZ:u,supportsM:c,isVersioned:h,supportsAttachment:F},operations:{supportsEditing:J,supportsAdd:K,supportsUpdate:H,supportsDelete:W,supportsQuery:z,supportsQueryAttachments:Z,supportsAsyncConvert3D:B}}=e,w=e.operations.supportsChangeTracking,S=!!((A=this.associatedLayer)!=null&&A.infoFor3D)&&U();return{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsReturnServiceEditsInSourceSpatialReference:y,supportsRollbackOnFailure:n,supportsGeometryUpdate:S&&p,supportsUploadWithItemId:l},data:{supportsAttachment:F,supportsZ:u,supportsM:c,isVersioned:h},operations:{supportsQuery:z,supportsQueryAttachments:Z,supportsEditing:J&&w,supportsAdd:S&&K&&w,supportsDelete:S&&W&&w,supportsUpdate:H&&w,supportsAsyncConvert3D:B}}}get editingEnabled(){var e;return this._isOverridden("editingEnabled")?this._get("editingEnabled"):((e=this.associatedLayer)==null?void 0:e.editingEnabled)??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){var e;return((e=this.associatedLayer)==null?void 0:e.infoFor3D)??null}get relationships(){var e;return(e=this.associatedLayer)==null?void 0:e.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(r=>(r.type==="esriFieldTypeOID"&&(e=r.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(r=>(r.type==="esriFieldTypeGlobalID"&&(e=r.name),!!e)),e||void 0}get displayField(){var e;return((e=this.associatedLayer)==null?void 0:e.displayField)??null}readProfile(e,t){const r=t.store.profile;return r!=null&&G[r]?G[r]:(f.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=e!=null?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(ce),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await Ye(this,{origin:"service"},t),x(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){this.filter!=null&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){f.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new he;return this.geometryType!=="mesh"&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatures(e||this.createQuery(),t)).then(r=>{if(r!=null&&r.features)for(const i of r.features)i.layer=this,i.sourceLayer=this;return r})}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new d("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new d("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=fe(this.fieldsIndex,await st(this,at(this)));return it(this.parsedUrl.path,this.attributeStorageInfo??[],e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,t){const r=await this.queryCachedAttributes(e,[t]);if(!r||r.length===0)throw new d("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const i=new me;return i.attributes=r[0],i.layer=this,i.sourceLayer=this,i}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryAttachments(e,t))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(f.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return rt(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e!=null&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new d("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new d("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return this.statisticsInfo!=null&&this.statisticsInfo.some(t=>t.name===e)}async queryCachedStatistics(e,t){if(await this.load(t),!this.statisticsInfo)throw new d("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const r=this.fieldsIndex.get(e);if(!r)throw new d("scenelayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const i of this.statisticsInfo)if(i.name===r.name){const n=ge(this.parsedUrl.path,i.href);return V(n,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:t?t.signal:null}).then(l=>l.data)}throw new d("scenelayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,t){return this._debouncedSaveOperations(D.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(D.SAVE,e)}async applyEdits(e,t){const{applyEdits:r}=await k(()=>import("./editingSupport-4MwIplWk.js"),__vite__mapDeps([0,1,2,3,4]));let i=t;await this.load();const n=this.associatedLayer;if(!n)throw new d(`${this.type}-layer:not-editable`,"Service is not editable");await n.load();const{globalIdField:l}=n,p=!!n.infoFor3D,y=(i==null?void 0:i.globalIdUsed)??!0;if(p&&l==null)throw new d(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(p&&!y)throw new d(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return T(n.url)&&p&&e.deleteFeatures!=null&&l!=null&&(i={...i,globalIdToObjectId:await Ce(n,e.deleteFeatures,l)}),r(this,n.source,e,i)}async uploadAssets(e,t){if(await this.load(),this.associatedLayer==null)throw new d(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}on(e,t){return super.on(e,t)}async convertMesh(e,t){const r=h=>{throw f.getLogger(this).error(".convertMesh()",h.message),h};await this.load(),this.infoFor3D||r(new d("invalid:layer","SceneLayer has no capability for mesh conversion"));const i=await this.extractAndFilterFiles(e),n=i.reduce((h,F)=>He(this.infoFor3D,F)?h+1:h,0);n===0&&r(new Pe),n>1&&r(new xe);const l=this.spatialReference,p=(t==null?void 0:t.location)??new ve({x:0,y:0,z:0,spatialReference:l}),y=p.spatialReference.isGeographic?"local":"georeferenced",u=Ae.createWithExternalSource(p,i,{vertexSpace:y}),[c]=await this.uploadAssets([u],t);return c}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;return t?(await nt(e)).filter(r=>We(t,r)):e}validateLayer(e){if(e.layerType&&!pt.has(e.layerType))throw new d("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new d("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new d("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(r,i){let n=!1,l=!1;if(r==null)n=!0,l=!0;else{const p=i&&i.isGeographic;switch(r){case"east-north-up":case"earth-centered":n=!0,l=p;break;case"vertex-reference-frame":n=!0,l=!p;break;default:n=!1}}if(!n)throw new d("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!l)throw new d("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if(this.profile==="points")e.push("Point");else{if(this.profile!=="mesh-pyramids")throw new d("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){var e,t;if(this._fieldUsageInfo={},this.fields)for(const r of this.fields){const i=!(!this.attributeStorageInfo||!this.attributeStorageInfo.some(p=>p.name===r.name)),n=!!((t=(e=this.associatedLayer)==null?void 0:e.fields)!=null&&t.some(p=>p&&r.name===p.name)),l={supportsLabelingInfo:i,supportsRenderer:i,supportsPopupTemplate:i||n,supportsLayerQuery:n};this._fieldUsageInfo[r.name]=l}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){var t;if(!((t=this.associatedLayer)!=null&&t.fields))return;let e=null;for(const r of this.associatedLayer.fields){const i=this.getField(r.name);i?(!i.domain&&r.domain&&(i.domain=r.domain.clone()),i.editable=r.editable,i.nullable=r.nullable,i.length=r.length):(e||(e=this.fields?this.fields.slice():[]),e.push(r.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPopupOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled"],t=R(this);for(let r=0;rthis.popupEnabled&&this.popupTemplate!=null);const e=`this SceneLayer: ${this.title}`;this.attributeStorageInfo==null?f.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):f.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;this.profile==="mesh-pyramids"&&N(f.getLogger(this),et("Mesh scene layers","relative-to-scene",e)),N(f.getLogger(this),tt("Scene layers",e))}};s([o({types:{key:"type",base:Ge,typeMap:{selection:Qe}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],a.prototype,"featureReduction",void 0),s([o({type:[m],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],a.prototype,"rangeInfos",void 0),s([o({json:{read:!1}})],a.prototype,"associatedLayer",void 0),s([o({type:["show","hide"]})],a.prototype,"listMode",void 0),s([o({type:["ArcGISSceneServiceLayer"]})],a.prototype,"operationalLayerType",void 0),s([o({json:{read:!1},readOnly:!0})],a.prototype,"type",void 0),s([o({...C.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],a.prototype,"fields",void 0),s([o()],a.prototype,"types",null),s([o()],a.prototype,"typeIdField",null),s([o()],a.prototype,"templates",null),s([o()],a.prototype,"formTemplate",null),s([o({readOnly:!0,clonable:!1})],a.prototype,"fieldsIndex",null),s([o({type:Ze,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],a.prototype,"floorInfo",void 0),s([o(C.outFields)],a.prototype,"outFields",void 0),s([o({type:M,readOnly:!0,json:{read:!1}})],a.prototype,"nodePages",void 0),s([g("service","nodePages",["nodePages","pointNodePages"])],a.prototype,"readNodePages",null),s([o({type:[Me],readOnly:!0})],a.prototype,"materialDefinitions",void 0),s([o({type:[Je],readOnly:!0})],a.prototype,"textureSetDefinitions",void 0),s([o({type:[Ke],readOnly:!0})],a.prototype,"geometryDefinitions",void 0),s([o({readOnly:!0})],a.prototype,"serviceUpdateTimeStamp",void 0),s([o({readOnly:!0})],a.prototype,"attributeStorageInfo",void 0),s([o({readOnly:!0})],a.prototype,"statisticsInfo",void 0),s([o({type:j.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],a.prototype,"excludeObjectIds",void 0),s([o({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],a.prototype,"definitionExpression",void 0),s([o({type:ot,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],a.prototype,"filter",void 0),s([o({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],a.prototype,"path",void 0),s([o(Ie)],a.prototype,"elevationInfo",null),s([o({readOnly:!0,json:{read:!1}})],a.prototype,"effectiveCapabilities",null),s([o({readOnly:!0})],a.prototype,"effectiveEditingEnabled",null),s([o({type:String})],a.prototype,"geometryType",null),s([o(Le)],a.prototype,"labelsVisible",void 0),s([o({type:[ze],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:q},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:q},write:!0}})],a.prototype,"labelingInfo",void 0),s([o(Fe)],a.prototype,"legendEnabled",void 0),s([o({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){var i,n;if(typeof e=="number"&&e>=0&&e<=1)return e;const r=(n=(i=t.layerDefinition)==null?void 0:i.drawingInfo)==null?void 0:n.transparency;return r!==void 0?Se(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],a.prototype,"opacity",void 0),s([o({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],a.prototype,"priority",void 0),s([o({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],a.prototype,"semantic",void 0),s([o({types:je,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],a.prototype,"renderer",null),s([o({json:{read:!1}})],a.prototype,"cachedDrawingInfo",void 0),s([g("service","cachedDrawingInfo")],a.prototype,"readCachedDrawingInfo",null),s([o({readOnly:!0,json:{read:!1}})],a.prototype,"capabilities",null),s([o({type:Boolean,json:{read:!1}})],a.prototype,"editingEnabled",null),s([o({readOnly:!0,json:{write:!1,read:!1}})],a.prototype,"infoFor3D",null),s([o({readOnly:!0,json:{write:!1,read:!1}})],a.prototype,"relationships",null),s([o(_e)],a.prototype,"popupEnabled",void 0),s([o({type:$e,json:{name:"popupInfo",write:!0}})],a.prototype,"popupTemplate",void 0),s([o({readOnly:!0,json:{read:!1}})],a.prototype,"defaultPopupTemplate",null),s([o({type:String,json:{read:!1}})],a.prototype,"objectIdField",void 0),s([g("service","objectIdField",["objectIdField","fields"])],a.prototype,"readObjectIdField",null),s([o({type:String,json:{read:!1}})],a.prototype,"globalIdField",void 0),s([g("service","globalIdField",["globalIdField","fields"])],a.prototype,"readGlobalIdField",null),s([o({readOnly:!0,type:String,json:{read:!1}})],a.prototype,"displayField",null),s([o({type:String,json:{read:!1}})],a.prototype,"profile",void 0),s([g("service","profile",["store.profile"])],a.prototype,"readProfile",null),s([o({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],a.prototype,"normalReferenceFrame",void 0),s([o(Ee)],a.prototype,"screenSizePerspectiveEnabled",void 0),s([o({json:{read:!1,origins:{service:{read:!0}}}})],a.prototype,"serviceItemId",void 0),a=s([L("esri.layers.SceneLayer")],a);const G={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},dt={"mesh-pyramids":"mesh",points:"point",lines:"polyline",polygons:"polygon"},Dr=a;export{Dr as default}; diff --git a/assets/SceneLayerSnappingSourceWorker-BIrjnrGh.js b/assets/SceneLayerSnappingSourceWorker-HITRlJJU.js similarity index 96% rename from assets/SceneLayerSnappingSourceWorker-BIrjnrGh.js rename to assets/SceneLayerSnappingSourceWorker-HITRlJJU.js index fc58282..9c579d8 100644 --- a/assets/SceneLayerSnappingSourceWorker-BIrjnrGh.js +++ b/assets/SceneLayerSnappingSourceWorker-HITRlJJU.js @@ -1 +1 @@ -import{aq as Tt,bL as L,cW as G,cX as M,gX as Z,cT as Q,gY as Ot,cy as S,cz as p,gM as tt,gT as K,d as bt,f as gt,at as Rt,cS as z}from"./index-CEWggaxV.js";import{v as Et,b as Nt,j as At}from"./lineSegment-B9UF3nEF.js";import{d as et,O as H,p as nt,Z as _,V as $,I as ot,w as j,s as st}from"./sphere-DHd2K2LR.js";import{s as ut}from"./ObjectStack-CF0cQvd2.js";import"./plane-py4f_JCU.js";import{i as it}from"./Util-BS8sJGjF.js";import{m as St}from"./edgeProcessing-Cvxjjjkp.js";import"./mat3f64-q3fE-ZOt.js";import"./mat4f64-CSKppSlJ.js";import"./quatf64-Bdb9ZJJK.js";import"./deduplicate-Bk22TunD.js";import"./Indices-Dv-cCjFT.js";import"./InterleavedLayout-Dd1W8HCo.js";import"./BufferView-Ao_K-5Vg.js";import"./types-D0PSWh4d.js";import"./VertexAttribute-BlT9lbVY.js";function lt(o){return o?{ray:et(o.ray),c0:o.c0,c1:o.c1}:{ray:et(),c0:0,c1:Number.MAX_VALUE}}new ut(()=>lt());function C(o,t){for(let e=0;e=t[3])return!1}return!0}var rt,c;(function(o){o[o.LEFT=0]="LEFT",o[o.RIGHT=1]="RIGHT",o[o.BOTTOM=2]="BOTTOM",o[o.TOP=3]="TOP",o[o.NEAR=4]="NEAR",o[o.FAR=5]="FAR"})(rt||(rt={})),function(o){o[o.NEAR_BOTTOM_LEFT=0]="NEAR_BOTTOM_LEFT",o[o.NEAR_BOTTOM_RIGHT=1]="NEAR_BOTTOM_RIGHT",o[o.NEAR_TOP_RIGHT=2]="NEAR_TOP_RIGHT",o[o.NEAR_TOP_LEFT=3]="NEAR_TOP_LEFT",o[o.FAR_BOTTOM_LEFT=4]="FAR_BOTTOM_LEFT",o[o.FAR_BOTTOM_RIGHT=5]="FAR_BOTTOM_RIGHT",o[o.FAR_TOP_RIGHT=6]="FAR_TOP_RIGHT",o[o.FAR_TOP_LEFT=7]="FAR_TOP_LEFT"}(c||(c={}));c.FAR_BOTTOM_RIGHT,c.NEAR_BOTTOM_RIGHT,c.NEAR_BOTTOM_LEFT,c.FAR_BOTTOM_LEFT,c.NEAR_BOTTOM_LEFT,c.NEAR_BOTTOM_RIGHT,c.NEAR_TOP_RIGHT,c.NEAR_TOP_LEFT,c.FAR_BOTTOM_RIGHT,c.FAR_BOTTOM_LEFT,c.FAR_TOP_LEFT,c.FAR_TOP_RIGHT,c.NEAR_BOTTOM_RIGHT,c.FAR_BOTTOM_RIGHT,c.FAR_TOP_RIGHT,c.NEAR_TOP_RIGHT,c.FAR_BOTTOM_LEFT,c.NEAR_BOTTOM_LEFT,c.NEAR_TOP_LEFT,c.FAR_TOP_LEFT,c.FAR_TOP_LEFT,c.NEAR_TOP_LEFT,c.NEAR_TOP_RIGHT,c.FAR_TOP_RIGHT;const Ft=6;new ut(lt);let J=class D{get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}constructor(t,e){this.objectToBoundingSphere=t,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new u,this._objectCount=0,e&&(e.maximumObjectsPerNode!==void 0&&(this._maximumObjectsPerNode=e.maximumObjectsPerNode),e.maximumDepth!==void 0&&(this._maximumDepth=e.maximumDepth))}destroy(){this._degenerateObjects.clear(),u.clearPool(),X[0]=null,F.prune(),x.prune()}add(t,e=t.length){this._objectCount+=e,this._grow(t,e);const n=u.acquire();for(let s=0;s{if(!this._intersectsNode(s,i))return!1;const h=i.node;return h.terminals.forAll(d=>{this._intersectsObject(s,d)&&n(d)}),h.residents!==null&&h.residents.forAll(d=>{this._intersectsObject(s,d)&&n(d)}),!0})}forEachAlongRayWithVerticalOffset(t,e,n,s){const i=nt(t,e);this._forEachNode(this._root,h=>{if(!this._intersectsNodeWithOffset(i,h,s))return!1;const d=h.node;return d.terminals.forAll(r=>{this._intersectsObjectWithOffset(i,r,s)&&n(r)}),d.residents!==null&&d.residents.forAll(r=>{this._intersectsObjectWithOffset(i,r,s)&&n(r)}),!0})}forEach(t){this._forEachNode(this._root,e=>{const n=e.node;return n.terminals.forAll(t),n.residents!==null&&n.residents.forAll(t),!0}),this._degenerateObjects.forEach(t)}forEachDegenerateObject(t){this._degenerateObjects.forEach(t)}findClosest(t,e,n,s=()=>!0,i=1/0){let h=1/0,d=1/0,r=null;const a=q(t,e),m=l=>{if(--i,!s(l))return;const T=this.objectToBoundingSphere(l);if(!C(n,T))return;const R=A(t,e,_(T)),B=R-T[3],f=R+T[3];B{if(i<=0||!C(n,l.bounds)||(G(g,a,l.halfSize),M(g,g,_(l.bounds)),A(t,e,g)>d))return!1;const T=l.node;return T.terminals.forAll(R=>m(R)),T.residents!==null&&T.residents.forAll(R=>m(R)),!0},t,e),r}forEachInDepthRange(t,e,n,s,i,h,d){let r=-1/0,a=1/0;const m={setRange:f=>{n===D.DepthOrder.FRONT_TO_BACK?(r=Math.max(r,f.near),a=Math.min(a,f.far)):(r=Math.max(r,-f.far),a=Math.min(a,-f.near))}};m.setRange(s);const l=A(e,n,t),T=q(e,n),R=q(e,-n),B=f=>{if(!d(f))return;const N=this.objectToBoundingSphere(f),P=_(N),Y=A(e,n,P)-l,ft=Y-N[3],pt=Y+N[3];ft>a||pt{if(!C(h,f.bounds)||(G(g,T,f.halfSize),M(g,g,_(f.bounds)),A(e,n,g)-l>a)||(G(g,R,f.halfSize),M(g,g,_(f.bounds)),A(e,n,g)-lB(P)),N.residents!==null&&N.residents.forAll(P=>B(P)),!0},e,n)}forEachNode(t){this._forEachNode(this._root,e=>t(e.node,e.bounds,e.halfSize,e.depth))}forEachNeighbor(t,e){const n=$(e),s=_(e),i=r=>{const a=this.objectToBoundingSphere(r),m=$(a),l=n+m;return!(Z(_(a),s)-l*l<=0)||t(r)};let h=!0;const d=r=>{h&&(h=i(r))};this._forEachNode(this._root,r=>{const a=$(r.bounds),m=n+a;if(Z(_(r.bounds),s)-m*m>0)return!1;const l=r.node;return l.terminals.forAll(d),h&&l.residents!==null&&l.residents.forAll(d),h}),h&&this.forEachDegenerateObject(d)}_intersectsNode(t,e){return v(_(e.bounds),2*-e.halfSize,O),v(_(e.bounds),2*e.halfSize,b),it(t.origin,t.direction,O,b)}_intersectsNodeWithOffset(t,e,n){return v(_(e.bounds),2*-e.halfSize,O),v(_(e.bounds),2*e.halfSize,b),n.applyToMinMax(O,b),it(t.origin,t.direction,O,b)}_intersectsObject(t,e){const n=this.objectToBoundingSphere(e);return!(n[3]>0)||ot(n,t)}_intersectsObjectWithOffset(t,e,n){const s=this.objectToBoundingSphere(e);return!(s[3]>0)||ot(n.applyToBoundingSphere(s),t)}_forEachNode(t,e){let n=u.acquire().init(t);const s=[n];for(;s.length!==0;){if(n=s.pop(),e(n)&&!n.isLeaf())for(let i=0;i=0;--d){const r=at[d];i.node.children[r]&&h.push(u.acquire().init(i).advance(r))}u.release(i)}}_remove(t,e,n){F.clear();const s=n.advanceTo(e,(i,h)=>{F.push(i.node),F.push(h)})?n.node.terminals:n.node.residents;if(s.removeUnordered(t),s.length===0)for(let i=F.length-2;i>=0;i-=2){const h=F.data[i],d=F.data[i+1];if(!this._purge(h,d))break}}_nodeIsEmpty(t){if(t.terminals.length!==0)return!1;if(t.residents!==null)return t.residents.length===0;for(let e=0;e=0&&(t.children[e]=null),!!this._nodeIsEmpty(t)&&(t.residents===null&&(t.residents=new L({shrink:!0})),!0)}_add(t,e){e.advanceTo(this.objectToBoundingSphere(t))?e.node.terminals.push(t):(e.node.residents.push(t),e.node.residents.length>this._maximumObjectsPerNode&&e.depththis.objectToBoundingSphere(n),E),I(E[3])&&!this._fitsInsideTree(E)))if(this._nodeIsEmpty(this._root.node))H(E,this._root.bounds),this._root.halfSize=1.25*this._root.bounds[3],this._root.updateBoundsRadiusFromHalfSize();else{const n=this._rootBoundsForRootAsSubNode(E);this._placingRootViolatesMaxDepth(n)?this._rebuildTree(E,n):this._growRootAsSubNode(n),u.release(n)}}_rebuildTree(t,e){Q(_(k),_(e.bounds)),k[3]=e.halfSize,ht([t,k],2,s=>s,W);const n=u.acquire().init(this._root);this._root.initFrom(null,W,W[3]),this._root.increaseHalfSize(1.25),this._forEachNode(n,s=>(this.add(s.node.terminals.data,s.node.terminals.length),s.node.residents!==null&&this.add(s.node.residents.data,s.node.residents.length),!0)),u.release(n)}_placingRootViolatesMaxDepth(t){const e=Math.log(t.halfSize/this._root.halfSize)*Math.LOG2E;let n=0;return this._forEachNode(this._root,s=>(n=Math.max(n,s.depth),n+e<=this._maximumDepth)),n+e>this._maximumDepth}_rootBoundsForRootAsSubNode(t){const e=t[3],n=t;let s=-1/0;const i=this._root.bounds,h=this._root.halfSize;for(let r=0;r<3;r++){const a=i[r]-h-(n[r]-e),m=n[r]+e-(i[r]+h),l=Math.max(0,Math.ceil(a/(2*h))),T=Math.max(0,Math.ceil(m/(2*h)))+1,R=2**Math.ceil(Math.log(l+T)*Math.LOG2E);s=Math.max(s,R),w[r].min=l,w[r].max=T}for(let r=0;r<3;r++){let a=w[r].min,m=w[r].max;const l=(s-(a+m))/2;a+=Math.ceil(l),m+=Math.floor(l);const T=i[r]-h-a*h*2;V[r]=T+(m+a)*h}const d=s*h;return V[3]=d*mt,u.acquire().initFrom(null,V,d,0)}_growRootAsSubNode(t){const e=this._root.node;Q(_(E),_(this._root.bounds)),E[3]=this._root.halfSize,this._root.init(t),t.advanceTo(E,null,!0),t.node.children=e.children,t.node.residents=e.residents,t.node.terminals=e.terminals}_shrink(){for(;;){const t=this._findShrinkIndex();if(t===-1)break;this._root.advance(t),this._root.depth=0}}_findShrinkIndex(){if(this._root.node.terminals.length!==0||this._root.isLeaf())return-1;let t=null;const e=this._root.node.children;let n=0,s=0;for(;s=e[0]-n&&t[0]<=e[0]+n&&t[1]>=e[1]-n&&t[1]<=e[1]+n&&t[2]>=e[2]-n&&t[2]<=e[2]+n}toJSON(){const{maximumDepth:t,maximumObjectsPerNode:e,_objectCount:n}=this,s=this._nodeToJSON(this._root.node);return{maximumDepth:t,maximumObjectsPerNode:e,objectCount:n,root:{bounds:this._root.bounds,halfSize:this._root.halfSize,depth:this._root.depth,node:s}}}_nodeToJSON(t){var i,h;const e=t.children.map(d=>d?this._nodeToJSON(d):null),n=(i=t.residents)==null?void 0:i.map(d=>this.objectToBoundingSphere(d)),s=(h=t.terminals)==null?void 0:h.map(d=>this.objectToBoundingSphere(d));return{children:e,residents:n,terminals:s}}static fromJSON(t){const e=new D(n=>n,{maximumDepth:t.maximumDepth,maximumObjectsPerNode:t.maximumObjectsPerNode});return e._objectCount=t.objectCount,e._root.initFrom(t.root.node,t.root.bounds,t.root.halfSize,t.root.depth),e}};class u{constructor(){this.bounds=j(),this.halfSize=0,this.initFrom(null,null,0,0)}init(t){return this.initFrom(t.node,t.bounds,t.halfSize,t.depth)}initFrom(t,e,n,s=this.depth){return this.node=t??u.createEmptyNode(),e&&H(e,this.bounds),this.halfSize=n,this.depth=s,this}increaseHalfSize(t){this.halfSize*=t,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds[3]=this.halfSize*mt}advance(t){let e=this.node.children[t];e||(e=u.createEmptyNode(),this.node.children[t]=e),this.node=e,this.halfSize/=2,this.depth++;const n=_t[t];return this.bounds[0]+=n[0]*this.halfSize,this.bounds[1]+=n[1]*this.halfSize,this.bounds[2]+=n[2]*this.halfSize,this.updateBoundsRadiusFromHalfSize(),this}advanceTo(t,e,n=!1){for(;;){if(this.isTerminalFor(t))return e&&e(this,-1),!0;if(this.isLeaf()){if(!n)return e&&e(this,-1),!1;this.node.residents=null}const s=this._childIndex(t);e&&e(this,s),this.advance(s)}}isLeaf(){return this.node.residents!=null}isTerminalFor(t){return t[3]>this.halfSize/2}_childIndex(t){const e=this.bounds;return(e[0]n.distance-s.distance);for(let n=0;n<8;++n)e[n]=x.data[n].index}function q(o,t){let e,n=1/0;for(let s=0;s<8;++s){const i=A(o,t,dt[s]);i0}u._pool=new Tt(u),function(o){var t;(t=o.DepthOrder||(o.DepthOrder={}))[t.FRONT_TO_BACK=1]="FRONT_TO_BACK",t[t.BACK_TO_FRONT=-1]="BACK_TO_FRONT"}(J||(J={}));const _t=[p(-1,-1,-1),p(1,-1,-1),p(-1,1,-1),p(1,1,-1),p(-1,-1,1),p(1,-1,1),p(-1,1,1),p(1,1,1)],dt=[p(-1,-1,-1),p(-1,-1,1),p(-1,1,-1),p(-1,1,1),p(1,-1,-1),p(1,-1,1),p(1,1,-1),p(1,1,1)],mt=Math.sqrt(3),X=[null];function Bt(o){return X[0]=o,X}const V=j(),g=S(),O=S(),b=S(),F=new L,Pt=j(),E=j(),k=j(),W=j(),w=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],x=new L,at=[0,0,0,0,0,0,0,0],ct=J,It=1e3;function Lt(o,t,e){const n=j(),s=_(n);return tt(s,s,o,.5),tt(s,s,t,.5),n[3]=K(s,o),M(s,s,e),n}let U=class{constructor(){this._idToComponent=new Map,this._components=new ct(o=>o.bounds),this._edges=new ct(o=>o.bounds),this._tmpLineSegment=Et(),this._tmpP1=S(),this._tmpP2=S(),this._tmpP3=S(),this.remoteClient=null}async fetchCandidates(o,t){await Promise.resolve(),Rt(t),await this._ensureEdgeLocations(o,t);const e=[];return this._edges.forEachNeighbor(n=>(this._addCandidates(o,n,e),e.length{if(i.info==null){const{id:h,uid:d}=i;e.push({id:h,uid:d})}return!0},o.bounds),!e.length)return;const n={components:e},s=await this.remoteClient.invoke("fetchAllEdgeLocations",n,t??{});for(const i of s.components)this._setFetchEdgeLocations(i)}async add(o){const t=new y(o.id,o.bounds);return this._idToComponent.set(t.id,t),this._components.add([t]),{result:{}}}async remove(o){const t=this._idToComponent.get(o.id);if(t){const e=[];this._edges.forEachNeighbor(n=>(n.component===t&&e.push(n),!0),t.bounds),this._edges.remove(e),this._components.remove([t]),this._idToComponent.delete(t.id)}return{result:{}}}_setFetchEdgeLocations(o){const t=this._idToComponent.get(o.id);if(t==null||o.uid!==t.uid)return;const e=St.createView(o.locations),n=new Array(e.count),s=S(),i=S();for(let r=0;rlt());function C(o,t){for(let e=0;e=t[3])return!1}return!0}var rt,c;(function(o){o[o.LEFT=0]="LEFT",o[o.RIGHT=1]="RIGHT",o[o.BOTTOM=2]="BOTTOM",o[o.TOP=3]="TOP",o[o.NEAR=4]="NEAR",o[o.FAR=5]="FAR"})(rt||(rt={})),function(o){o[o.NEAR_BOTTOM_LEFT=0]="NEAR_BOTTOM_LEFT",o[o.NEAR_BOTTOM_RIGHT=1]="NEAR_BOTTOM_RIGHT",o[o.NEAR_TOP_RIGHT=2]="NEAR_TOP_RIGHT",o[o.NEAR_TOP_LEFT=3]="NEAR_TOP_LEFT",o[o.FAR_BOTTOM_LEFT=4]="FAR_BOTTOM_LEFT",o[o.FAR_BOTTOM_RIGHT=5]="FAR_BOTTOM_RIGHT",o[o.FAR_TOP_RIGHT=6]="FAR_TOP_RIGHT",o[o.FAR_TOP_LEFT=7]="FAR_TOP_LEFT"}(c||(c={}));c.FAR_BOTTOM_RIGHT,c.NEAR_BOTTOM_RIGHT,c.NEAR_BOTTOM_LEFT,c.FAR_BOTTOM_LEFT,c.NEAR_BOTTOM_LEFT,c.NEAR_BOTTOM_RIGHT,c.NEAR_TOP_RIGHT,c.NEAR_TOP_LEFT,c.FAR_BOTTOM_RIGHT,c.FAR_BOTTOM_LEFT,c.FAR_TOP_LEFT,c.FAR_TOP_RIGHT,c.NEAR_BOTTOM_RIGHT,c.FAR_BOTTOM_RIGHT,c.FAR_TOP_RIGHT,c.NEAR_TOP_RIGHT,c.FAR_BOTTOM_LEFT,c.NEAR_BOTTOM_LEFT,c.NEAR_TOP_LEFT,c.FAR_TOP_LEFT,c.FAR_TOP_LEFT,c.NEAR_TOP_LEFT,c.NEAR_TOP_RIGHT,c.FAR_TOP_RIGHT;const Ft=6;new ut(lt);let J=class D{get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}constructor(t,e){this.objectToBoundingSphere=t,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new u,this._objectCount=0,e&&(e.maximumObjectsPerNode!==void 0&&(this._maximumObjectsPerNode=e.maximumObjectsPerNode),e.maximumDepth!==void 0&&(this._maximumDepth=e.maximumDepth))}destroy(){this._degenerateObjects.clear(),u.clearPool(),X[0]=null,F.prune(),x.prune()}add(t,e=t.length){this._objectCount+=e,this._grow(t,e);const n=u.acquire();for(let s=0;s{if(!this._intersectsNode(s,i))return!1;const h=i.node;return h.terminals.forAll(d=>{this._intersectsObject(s,d)&&n(d)}),h.residents!==null&&h.residents.forAll(d=>{this._intersectsObject(s,d)&&n(d)}),!0})}forEachAlongRayWithVerticalOffset(t,e,n,s){const i=nt(t,e);this._forEachNode(this._root,h=>{if(!this._intersectsNodeWithOffset(i,h,s))return!1;const d=h.node;return d.terminals.forAll(r=>{this._intersectsObjectWithOffset(i,r,s)&&n(r)}),d.residents!==null&&d.residents.forAll(r=>{this._intersectsObjectWithOffset(i,r,s)&&n(r)}),!0})}forEach(t){this._forEachNode(this._root,e=>{const n=e.node;return n.terminals.forAll(t),n.residents!==null&&n.residents.forAll(t),!0}),this._degenerateObjects.forEach(t)}forEachDegenerateObject(t){this._degenerateObjects.forEach(t)}findClosest(t,e,n,s=()=>!0,i=1/0){let h=1/0,d=1/0,r=null;const a=q(t,e),m=l=>{if(--i,!s(l))return;const T=this.objectToBoundingSphere(l);if(!C(n,T))return;const R=A(t,e,_(T)),B=R-T[3],f=R+T[3];B{if(i<=0||!C(n,l.bounds)||(G(g,a,l.halfSize),M(g,g,_(l.bounds)),A(t,e,g)>d))return!1;const T=l.node;return T.terminals.forAll(R=>m(R)),T.residents!==null&&T.residents.forAll(R=>m(R)),!0},t,e),r}forEachInDepthRange(t,e,n,s,i,h,d){let r=-1/0,a=1/0;const m={setRange:f=>{n===D.DepthOrder.FRONT_TO_BACK?(r=Math.max(r,f.near),a=Math.min(a,f.far)):(r=Math.max(r,-f.far),a=Math.min(a,-f.near))}};m.setRange(s);const l=A(e,n,t),T=q(e,n),R=q(e,-n),B=f=>{if(!d(f))return;const N=this.objectToBoundingSphere(f),P=_(N),Y=A(e,n,P)-l,ft=Y-N[3],pt=Y+N[3];ft>a||pt{if(!C(h,f.bounds)||(G(g,T,f.halfSize),M(g,g,_(f.bounds)),A(e,n,g)-l>a)||(G(g,R,f.halfSize),M(g,g,_(f.bounds)),A(e,n,g)-lB(P)),N.residents!==null&&N.residents.forAll(P=>B(P)),!0},e,n)}forEachNode(t){this._forEachNode(this._root,e=>t(e.node,e.bounds,e.halfSize,e.depth))}forEachNeighbor(t,e){const n=$(e),s=_(e),i=r=>{const a=this.objectToBoundingSphere(r),m=$(a),l=n+m;return!(Z(_(a),s)-l*l<=0)||t(r)};let h=!0;const d=r=>{h&&(h=i(r))};this._forEachNode(this._root,r=>{const a=$(r.bounds),m=n+a;if(Z(_(r.bounds),s)-m*m>0)return!1;const l=r.node;return l.terminals.forAll(d),h&&l.residents!==null&&l.residents.forAll(d),h}),h&&this.forEachDegenerateObject(d)}_intersectsNode(t,e){return v(_(e.bounds),2*-e.halfSize,O),v(_(e.bounds),2*e.halfSize,b),it(t.origin,t.direction,O,b)}_intersectsNodeWithOffset(t,e,n){return v(_(e.bounds),2*-e.halfSize,O),v(_(e.bounds),2*e.halfSize,b),n.applyToMinMax(O,b),it(t.origin,t.direction,O,b)}_intersectsObject(t,e){const n=this.objectToBoundingSphere(e);return!(n[3]>0)||ot(n,t)}_intersectsObjectWithOffset(t,e,n){const s=this.objectToBoundingSphere(e);return!(s[3]>0)||ot(n.applyToBoundingSphere(s),t)}_forEachNode(t,e){let n=u.acquire().init(t);const s=[n];for(;s.length!==0;){if(n=s.pop(),e(n)&&!n.isLeaf())for(let i=0;i=0;--d){const r=at[d];i.node.children[r]&&h.push(u.acquire().init(i).advance(r))}u.release(i)}}_remove(t,e,n){F.clear();const s=n.advanceTo(e,(i,h)=>{F.push(i.node),F.push(h)})?n.node.terminals:n.node.residents;if(s.removeUnordered(t),s.length===0)for(let i=F.length-2;i>=0;i-=2){const h=F.data[i],d=F.data[i+1];if(!this._purge(h,d))break}}_nodeIsEmpty(t){if(t.terminals.length!==0)return!1;if(t.residents!==null)return t.residents.length===0;for(let e=0;e=0&&(t.children[e]=null),!!this._nodeIsEmpty(t)&&(t.residents===null&&(t.residents=new L({shrink:!0})),!0)}_add(t,e){e.advanceTo(this.objectToBoundingSphere(t))?e.node.terminals.push(t):(e.node.residents.push(t),e.node.residents.length>this._maximumObjectsPerNode&&e.depththis.objectToBoundingSphere(n),E),I(E[3])&&!this._fitsInsideTree(E)))if(this._nodeIsEmpty(this._root.node))H(E,this._root.bounds),this._root.halfSize=1.25*this._root.bounds[3],this._root.updateBoundsRadiusFromHalfSize();else{const n=this._rootBoundsForRootAsSubNode(E);this._placingRootViolatesMaxDepth(n)?this._rebuildTree(E,n):this._growRootAsSubNode(n),u.release(n)}}_rebuildTree(t,e){Q(_(k),_(e.bounds)),k[3]=e.halfSize,ht([t,k],2,s=>s,W);const n=u.acquire().init(this._root);this._root.initFrom(null,W,W[3]),this._root.increaseHalfSize(1.25),this._forEachNode(n,s=>(this.add(s.node.terminals.data,s.node.terminals.length),s.node.residents!==null&&this.add(s.node.residents.data,s.node.residents.length),!0)),u.release(n)}_placingRootViolatesMaxDepth(t){const e=Math.log(t.halfSize/this._root.halfSize)*Math.LOG2E;let n=0;return this._forEachNode(this._root,s=>(n=Math.max(n,s.depth),n+e<=this._maximumDepth)),n+e>this._maximumDepth}_rootBoundsForRootAsSubNode(t){const e=t[3],n=t;let s=-1/0;const i=this._root.bounds,h=this._root.halfSize;for(let r=0;r<3;r++){const a=i[r]-h-(n[r]-e),m=n[r]+e-(i[r]+h),l=Math.max(0,Math.ceil(a/(2*h))),T=Math.max(0,Math.ceil(m/(2*h)))+1,R=2**Math.ceil(Math.log(l+T)*Math.LOG2E);s=Math.max(s,R),w[r].min=l,w[r].max=T}for(let r=0;r<3;r++){let a=w[r].min,m=w[r].max;const l=(s-(a+m))/2;a+=Math.ceil(l),m+=Math.floor(l);const T=i[r]-h-a*h*2;V[r]=T+(m+a)*h}const d=s*h;return V[3]=d*mt,u.acquire().initFrom(null,V,d,0)}_growRootAsSubNode(t){const e=this._root.node;Q(_(E),_(this._root.bounds)),E[3]=this._root.halfSize,this._root.init(t),t.advanceTo(E,null,!0),t.node.children=e.children,t.node.residents=e.residents,t.node.terminals=e.terminals}_shrink(){for(;;){const t=this._findShrinkIndex();if(t===-1)break;this._root.advance(t),this._root.depth=0}}_findShrinkIndex(){if(this._root.node.terminals.length!==0||this._root.isLeaf())return-1;let t=null;const e=this._root.node.children;let n=0,s=0;for(;s=e[0]-n&&t[0]<=e[0]+n&&t[1]>=e[1]-n&&t[1]<=e[1]+n&&t[2]>=e[2]-n&&t[2]<=e[2]+n}toJSON(){const{maximumDepth:t,maximumObjectsPerNode:e,_objectCount:n}=this,s=this._nodeToJSON(this._root.node);return{maximumDepth:t,maximumObjectsPerNode:e,objectCount:n,root:{bounds:this._root.bounds,halfSize:this._root.halfSize,depth:this._root.depth,node:s}}}_nodeToJSON(t){var i,h;const e=t.children.map(d=>d?this._nodeToJSON(d):null),n=(i=t.residents)==null?void 0:i.map(d=>this.objectToBoundingSphere(d)),s=(h=t.terminals)==null?void 0:h.map(d=>this.objectToBoundingSphere(d));return{children:e,residents:n,terminals:s}}static fromJSON(t){const e=new D(n=>n,{maximumDepth:t.maximumDepth,maximumObjectsPerNode:t.maximumObjectsPerNode});return e._objectCount=t.objectCount,e._root.initFrom(t.root.node,t.root.bounds,t.root.halfSize,t.root.depth),e}};class u{constructor(){this.bounds=j(),this.halfSize=0,this.initFrom(null,null,0,0)}init(t){return this.initFrom(t.node,t.bounds,t.halfSize,t.depth)}initFrom(t,e,n,s=this.depth){return this.node=t??u.createEmptyNode(),e&&H(e,this.bounds),this.halfSize=n,this.depth=s,this}increaseHalfSize(t){this.halfSize*=t,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds[3]=this.halfSize*mt}advance(t){let e=this.node.children[t];e||(e=u.createEmptyNode(),this.node.children[t]=e),this.node=e,this.halfSize/=2,this.depth++;const n=_t[t];return this.bounds[0]+=n[0]*this.halfSize,this.bounds[1]+=n[1]*this.halfSize,this.bounds[2]+=n[2]*this.halfSize,this.updateBoundsRadiusFromHalfSize(),this}advanceTo(t,e,n=!1){for(;;){if(this.isTerminalFor(t))return e&&e(this,-1),!0;if(this.isLeaf()){if(!n)return e&&e(this,-1),!1;this.node.residents=null}const s=this._childIndex(t);e&&e(this,s),this.advance(s)}}isLeaf(){return this.node.residents!=null}isTerminalFor(t){return t[3]>this.halfSize/2}_childIndex(t){const e=this.bounds;return(e[0]n.distance-s.distance);for(let n=0;n<8;++n)e[n]=x.data[n].index}function q(o,t){let e,n=1/0;for(let s=0;s<8;++s){const i=A(o,t,dt[s]);i0}u._pool=new Tt(u),function(o){var t;(t=o.DepthOrder||(o.DepthOrder={}))[t.FRONT_TO_BACK=1]="FRONT_TO_BACK",t[t.BACK_TO_FRONT=-1]="BACK_TO_FRONT"}(J||(J={}));const _t=[p(-1,-1,-1),p(1,-1,-1),p(-1,1,-1),p(1,1,-1),p(-1,-1,1),p(1,-1,1),p(-1,1,1),p(1,1,1)],dt=[p(-1,-1,-1),p(-1,-1,1),p(-1,1,-1),p(-1,1,1),p(1,-1,-1),p(1,-1,1),p(1,1,-1),p(1,1,1)],mt=Math.sqrt(3),X=[null];function Bt(o){return X[0]=o,X}const V=j(),g=S(),O=S(),b=S(),F=new L,Pt=j(),E=j(),k=j(),W=j(),w=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],x=new L,at=[0,0,0,0,0,0,0,0],ct=J,It=1e3;function Lt(o,t,e){const n=j(),s=_(n);return tt(s,s,o,.5),tt(s,s,t,.5),n[3]=K(s,o),M(s,s,e),n}let U=class{constructor(){this._idToComponent=new Map,this._components=new ct(o=>o.bounds),this._edges=new ct(o=>o.bounds),this._tmpLineSegment=Et(),this._tmpP1=S(),this._tmpP2=S(),this._tmpP3=S(),this.remoteClient=null}async fetchCandidates(o,t){await Promise.resolve(),Rt(t),await this._ensureEdgeLocations(o,t);const e=[];return this._edges.forEachNeighbor(n=>(this._addCandidates(o,n,e),e.length{if(i.info==null){const{id:h,uid:d}=i;e.push({id:h,uid:d})}return!0},o.bounds),!e.length)return;const n={components:e},s=await this.remoteClient.invoke("fetchAllEdgeLocations",n,t??{});for(const i of s.components)this._setFetchEdgeLocations(i)}async add(o){const t=new y(o.id,o.bounds);return this._idToComponent.set(t.id,t),this._components.add([t]),{result:{}}}async remove(o){const t=this._idToComponent.get(o.id);if(t){const e=[];this._edges.forEachNeighbor(n=>(n.component===t&&e.push(n),!0),t.bounds),this._edges.remove(e),this._components.remove([t]),this._idToComponent.delete(t.id)}return{result:{}}}_setFetchEdgeLocations(o){const t=this._idToComponent.get(o.id);if(t==null||o.uid!==t.uid)return;const e=St.createView(o.locations),n=new Array(e.count),s=S(),i=S();for(let r=0;r __vite__mapDeps.viteFileDeps[i]) } -import{_ as L,gZ as K,aS as $}from"./index-CEWggaxV.js";import{y as Q}from"./DoubleArray-DxyNBrRi.js";import{i as W,a as X}from"./MeshLocalVertexSpace-Cltwu1Kq.js";import{n as ee,s as te}from"./vec3-CjYmIfaa.js";import"./sphere-DHd2K2LR.js";import"./I3SUtil-DxFIPSkh.js";import"./ObjectStack-CF0cQvd2.js";import"./plane-py4f_JCU.js";import"./mat3f64-q3fE-ZOt.js";import"./mat4f64-CSKppSlJ.js";import"./quatf64-Bdb9ZJJK.js";import"./computeTranslationToOriginAndRotation-DOOKw0d1.js";import"./I3SBinaryReader-N_Is4gxa.js";import"./VertexAttribute-BlT9lbVY.js";import"./symbolColorUtils-D_minlYz.js";import"./orientedBoundingBox-BQdJNYvE.js";import"./quat-CoKEr4Zu.js";var R,B;(function(e){e[e.None=0]="None",e[e.Int16=1]="Int16",e[e.Int32=2]="Int32"})(R||(R={})),function(e){e[e.Replace=0]="Replace",e[e.Outside=1]="Outside",e[e.Inside=2]="Inside",e[e.Finished=3]="Finished"}(B||(B={}));function ne(){return v||(v=new Promise(e=>L(()=>import("./i3s-DgwnR-Am.js"),__vite__mapDeps([0,1,2])).then(t=>t.i).then(({default:t})=>{const n=t({locateFile:oe,onRuntimeInitialized:()=>e(n)});delete n.then})).catch(e=>{throw e})),v}function oe(e){return K(`esri/libs/i3s/${e}`)}let v;var j,g,k,H,V;(function(e){e[e.Unmodified=0]="Unmodified",e[e.Culled=1]="Culled",e[e.NotChecked=2]="NotChecked"})(j||(j={})),function(e){e[e.Unmodified=0]="Unmodified",e[e.PotentiallyModified=1]="PotentiallyModified",e[e.Culled=2]="Culled",e[e.Unknown=3]="Unknown",e[e.NotChecked=4]="NotChecked"}(g||(g={}));(function(e){e[e.Unknown=0]="Unknown",e[e.Uncached=1]="Uncached",e[e.Cached=2]="Cached"})(k||(k={})),function(e){e[e.None=0]="None",e[e.MaxScreenThreshold=1]="MaxScreenThreshold",e[e.ScreenSpaceRelative=2]="ScreenSpaceRelative",e[e.RemovedFeatureDiameter=3]="RemovedFeatureDiameter",e[e.DistanceRangeFromDefaultCamera=4]="DistanceRangeFromDefaultCamera"}(H||(H={})),function(e){e[e.Hole=0]="Hole",e[e.Leaf=1]="Leaf"}(V||(V={}));async function Ae(e){r=await _();const t=[e.geometryBuffer];return{result:Y(r,e,t),transferList:t}}async function Le(e){var m;r=await _();const t=[e.geometryBuffer],{geometryBuffer:n}=e,a=n.byteLength,i=r._malloc(a),u=new Uint8Array(r.HEAPU8.buffer,i,a);u.set(new Uint8Array(n));const f=r.dracoDecompressPointCloudData(i,u.byteLength);if(r._free(i),f.error.length>0)throw new Error(`i3s.wasm: ${f.error}`);const l=((m=f.featureIds)==null?void 0:m.length)>0?f.featureIds.slice():null,s=f.positions.slice();return l&&t.push(l.buffer),t.push(s.buffer),{result:{positions:s,featureIds:l},transferList:t}}async function Re(e){await _(),ie(e);const t={buffer:e.buffer};return{result:t,transferList:[t.buffer]}}async function Se(e){await _(),re(e)}async function Pe(e){r=await _(),r.setLegacySchema(e.context,e.jsonSchema)}async function Ue(e){const{localMatrix:t,origin:n,positions:a,vertexSpace:i,localMode:u}=e,f=$.fromJSON(e.inSpatialReference),l=$.fromJSON(e.outSpatialReference);let s;if(i.type==="georeferenced"&&i.origin==null){const[{projectBuffer:c},{initializeProjection:b}]=await Promise.all([L(()=>import("./index-CEWggaxV.js").then(d=>d.na),__vite__mapDeps([1,2])),L(()=>import("./index-CEWggaxV.js").then(d=>d.nb),__vite__mapDeps([1,2]))]);await b(f,l),s=new Float64Array(a.length),c(a,f,0,s,l,0,s.length/3)}else{const c=i.type==="georeferenced"?W.fromJSON(i):X.fromJSON(i),{project:b}=await L(()=>import("./georeference-DtjTZVKi.js").then(d=>d.g),__vite__mapDeps([3,1,2,4,5,6,7,8,9,10,11,12,13]));s=Q(b({positions:a,transform:t?{localMatrix:t}:void 0,vertexSpace:c,inSpatialReference:f,outSpatialReference:l,localMode:u}))}const m=s.length,[S,P,U]=n;for(let c=0;ch.some(p=>p.name==="color")),normal:t.needNormals&&t.layouts.some(h=>h.some(p=>p.name==="normalCompressed")),uv0:t.layouts.some(h=>h.some(p=>p.name==="uv0")),uvRegion:t.layouts.some(h=>h.some(p=>p.name==="uvRegion")),featureIndex:x.featureIndex},o=e.process(a,!!t.obbData,c,T.byteLength,x,z,d,s,P,U,t.normalReferenceFrame);if(e._free(d),e._free(c),o.error.length>0)throw new Error(`i3s.wasm: ${o.error}`);if(o.discarded)return null;const O=o.componentOffsets.length>0?o.componentOffsets.slice():null,M=o.featureIds.length>0?o.featureIds.slice():null,G=o.anchorIds.length>0?Array.from(o.anchorIds):null,Z=o.anchors.length>0?Array.from(o.anchors):null,D=o.interleavedVertedData.slice().buffer,F=o.indicesType===R.Int16?new Uint16Array(o.indices.buffer,o.indices.byteOffset,o.indices.byteLength/2).slice():new Uint32Array(o.indices.buffer,o.indices.byteOffset,o.indices.byteLength/4).slice(),C=o.positions.slice(),N=o.positionIndicesType===R.Int16?new Uint16Array(o.positionIndices.buffer,o.positionIndices.byteOffset,o.positionIndices.byteLength/2).slice():new Uint32Array(o.positionIndices.buffer,o.positionIndices.byteOffset,o.positionIndices.byteLength/4).slice(),q={layout:t.layouts[0],interleavedVertexData:D,indices:F,hasColors:o.hasColors,hasModifications:o.hasModifications,positionData:{data:C,indices:N}};return M&&n.push(M.buffer),O&&n.push(O.buffer),n.push(D),n.push(F.buffer),n.push(C.buffer),n.push(N.buffer),{componentOffsets:O,featureIds:M,anchorIds:G,anchors:Z,transformedGeometry:q,obb:o.obb}}function ve(e){return e===0?g.Unmodified:e===1?g.PotentiallyModified:e===2?g.Culled:g.Unknown}function ie(e){if(!r)return;const{context:t,buffer:n}=e,a=r._malloc(n.byteLength),i=n.byteLength/Float64Array.BYTES_PER_ELEMENT,u=new Float64Array(r.HEAPU8.buffer,a,i),f=new Float64Array(n);u.set(f),r.filterOBBs(t,a,i),f.set(u),r._free(a)}function J(e){r&&r.destroy(e)===0&&(r=null)}function A(e,t){for(let n=0;n(r=e,I=null,r))),I)}const xe={transform:(e,t)=>r&&Y(r,e,t),destroy:J};export{Me as destroyContext,Le as dracoDecompressPointCloudData,Re as filterObbsForModifications,ie as filterObbsForModificationsSync,Te as initialize,ve as interpretObbModificationResults,Ae as process,Ue as project,Pe as setLegacySchema,Se as setModifications,re as setModificationsSync,xe as test,Oe as transformNormals}; +import{_ as L,gZ as K,aS as $}from"./index-BjUNJPVf.js";import{y as Q}from"./DoubleArray--0pYeNcV.js";import{i as W,a as X}from"./MeshLocalVertexSpace-DRvwbFTJ.js";import{n as ee,s as te}from"./vec3-DdRUbala.js";import"./sphere-F1imyuMS.js";import"./I3SUtil-Bs1mZiKI.js";import"./ObjectStack-BAIuPeIh.js";import"./plane-DxOTtTwj.js";import"./mat3f64-q3fE-ZOt.js";import"./mat4f64-CSKppSlJ.js";import"./quatf64-Bdb9ZJJK.js";import"./computeTranslationToOriginAndRotation-BeE3rOSz.js";import"./I3SBinaryReader-Bg6QQKyW.js";import"./VertexAttribute-BlT9lbVY.js";import"./symbolColorUtils-C9Wp-TPe.js";import"./orientedBoundingBox-sJmHxD3E.js";import"./quat-C0wQB0HB.js";var R,B;(function(e){e[e.None=0]="None",e[e.Int16=1]="Int16",e[e.Int32=2]="Int32"})(R||(R={})),function(e){e[e.Replace=0]="Replace",e[e.Outside=1]="Outside",e[e.Inside=2]="Inside",e[e.Finished=3]="Finished"}(B||(B={}));function ne(){return v||(v=new Promise(e=>L(()=>import("./i3s-DvXaSYJ6.js"),__vite__mapDeps([0,1,2])).then(t=>t.i).then(({default:t})=>{const n=t({locateFile:oe,onRuntimeInitialized:()=>e(n)});delete n.then})).catch(e=>{throw e})),v}function oe(e){return K(`esri/libs/i3s/${e}`)}let v;var j,g,k,H,V;(function(e){e[e.Unmodified=0]="Unmodified",e[e.Culled=1]="Culled",e[e.NotChecked=2]="NotChecked"})(j||(j={})),function(e){e[e.Unmodified=0]="Unmodified",e[e.PotentiallyModified=1]="PotentiallyModified",e[e.Culled=2]="Culled",e[e.Unknown=3]="Unknown",e[e.NotChecked=4]="NotChecked"}(g||(g={}));(function(e){e[e.Unknown=0]="Unknown",e[e.Uncached=1]="Uncached",e[e.Cached=2]="Cached"})(k||(k={})),function(e){e[e.None=0]="None",e[e.MaxScreenThreshold=1]="MaxScreenThreshold",e[e.ScreenSpaceRelative=2]="ScreenSpaceRelative",e[e.RemovedFeatureDiameter=3]="RemovedFeatureDiameter",e[e.DistanceRangeFromDefaultCamera=4]="DistanceRangeFromDefaultCamera"}(H||(H={})),function(e){e[e.Hole=0]="Hole",e[e.Leaf=1]="Leaf"}(V||(V={}));async function Ae(e){r=await _();const t=[e.geometryBuffer];return{result:Y(r,e,t),transferList:t}}async function Le(e){var m;r=await _();const t=[e.geometryBuffer],{geometryBuffer:n}=e,a=n.byteLength,i=r._malloc(a),u=new Uint8Array(r.HEAPU8.buffer,i,a);u.set(new Uint8Array(n));const f=r.dracoDecompressPointCloudData(i,u.byteLength);if(r._free(i),f.error.length>0)throw new Error(`i3s.wasm: ${f.error}`);const l=((m=f.featureIds)==null?void 0:m.length)>0?f.featureIds.slice():null,s=f.positions.slice();return l&&t.push(l.buffer),t.push(s.buffer),{result:{positions:s,featureIds:l},transferList:t}}async function Re(e){await _(),ie(e);const t={buffer:e.buffer};return{result:t,transferList:[t.buffer]}}async function Se(e){await _(),re(e)}async function Pe(e){r=await _(),r.setLegacySchema(e.context,e.jsonSchema)}async function Ue(e){const{localMatrix:t,origin:n,positions:a,vertexSpace:i,localMode:u}=e,f=$.fromJSON(e.inSpatialReference),l=$.fromJSON(e.outSpatialReference);let s;if(i.type==="georeferenced"&&i.origin==null){const[{projectBuffer:c},{initializeProjection:b}]=await Promise.all([L(()=>import("./index-BjUNJPVf.js").then(d=>d.na),__vite__mapDeps([1,2])),L(()=>import("./index-BjUNJPVf.js").then(d=>d.nb),__vite__mapDeps([1,2]))]);await b(f,l),s=new Float64Array(a.length),c(a,f,0,s,l,0,s.length/3)}else{const c=i.type==="georeferenced"?W.fromJSON(i):X.fromJSON(i),{project:b}=await L(()=>import("./georeference-DqFdARS7.js").then(d=>d.g),__vite__mapDeps([3,1,2,4,5,6,7,8,9,10,11,12,13]));s=Q(b({positions:a,transform:t?{localMatrix:t}:void 0,vertexSpace:c,inSpatialReference:f,outSpatialReference:l,localMode:u}))}const m=s.length,[S,P,U]=n;for(let c=0;ch.some(p=>p.name==="color")),normal:t.needNormals&&t.layouts.some(h=>h.some(p=>p.name==="normalCompressed")),uv0:t.layouts.some(h=>h.some(p=>p.name==="uv0")),uvRegion:t.layouts.some(h=>h.some(p=>p.name==="uvRegion")),featureIndex:x.featureIndex},o=e.process(a,!!t.obbData,c,T.byteLength,x,z,d,s,P,U,t.normalReferenceFrame);if(e._free(d),e._free(c),o.error.length>0)throw new Error(`i3s.wasm: ${o.error}`);if(o.discarded)return null;const O=o.componentOffsets.length>0?o.componentOffsets.slice():null,M=o.featureIds.length>0?o.featureIds.slice():null,G=o.anchorIds.length>0?Array.from(o.anchorIds):null,Z=o.anchors.length>0?Array.from(o.anchors):null,D=o.interleavedVertedData.slice().buffer,F=o.indicesType===R.Int16?new Uint16Array(o.indices.buffer,o.indices.byteOffset,o.indices.byteLength/2).slice():new Uint32Array(o.indices.buffer,o.indices.byteOffset,o.indices.byteLength/4).slice(),C=o.positions.slice(),N=o.positionIndicesType===R.Int16?new Uint16Array(o.positionIndices.buffer,o.positionIndices.byteOffset,o.positionIndices.byteLength/2).slice():new Uint32Array(o.positionIndices.buffer,o.positionIndices.byteOffset,o.positionIndices.byteLength/4).slice(),q={layout:t.layouts[0],interleavedVertexData:D,indices:F,hasColors:o.hasColors,hasModifications:o.hasModifications,positionData:{data:C,indices:N}};return M&&n.push(M.buffer),O&&n.push(O.buffer),n.push(D),n.push(F.buffer),n.push(C.buffer),n.push(N.buffer),{componentOffsets:O,featureIds:M,anchorIds:G,anchors:Z,transformedGeometry:q,obb:o.obb}}function ve(e){return e===0?g.Unmodified:e===1?g.PotentiallyModified:e===2?g.Culled:g.Unknown}function ie(e){if(!r)return;const{context:t,buffer:n}=e,a=r._malloc(n.byteLength),i=n.byteLength/Float64Array.BYTES_PER_ELEMENT,u=new Float64Array(r.HEAPU8.buffer,a,i),f=new Float64Array(n);u.set(f),r.filterOBBs(t,a,i),f.set(u),r._free(a)}function J(e){r&&r.destroy(e)===0&&(r=null)}function A(e,t){for(let n=0;n(r=e,I=null,r))),I)}const xe={transform:(e,t)=>r&&Y(r,e,t),destroy:J};export{Me as destroyContext,Le as dracoDecompressPointCloudData,Re as filterObbsForModifications,ie as filterObbsForModificationsSync,Te as initialize,ve as interpretObbModificationResults,Ae as process,Ue as project,Pe as setLegacySchema,Se as setModifications,re as setModificationsSync,xe as test,Oe as transformNormals}; diff --git a/assets/SceneService-l5OfqT0E.js b/assets/SceneService-DbS150xR.js similarity index 97% rename from assets/SceneService-l5OfqT0E.js rename to assets/SceneService-DbS150xR.js index 5898fdf..e14460d 100644 --- a/assets/SceneService-l5OfqT0E.js +++ b/assets/SceneService-DbS150xR.js @@ -1,3 +1,3 @@ -import{M as f,N as y,d as n,y as d,ds as j,aS as S,aZ as m,aE as w,g_ as P,du as L,aR as O,f as $,k as K,fS as U,av as V,g$ as M,h0 as q,s as x,h1 as C,bW as k,aw as z,ax as F,eo as E}from"./index-CEWggaxV.js";import{i as R}from"./originUtils-D69mHv66.js";import{p as J,n as B}from"./resourceUtils-Cu1-5qu3.js";import{i as T}from"./saveAPIKeyUtils-BiX1lQSW.js";import{t as D}from"./saveUtils-BzCRy3uR.js";async function Z(c,a,e,t,i,r,o){let s=null;if(e!=null){const h=`${c}/nodepages/`,b=h+Math.floor(e.rootIndex/e.nodesPerPage);try{return{type:"page",rootPage:(await f(b,{query:{f:"json",...t,token:i},responseType:"json",signal:o})).data,rootIndex:e.rootIndex,pageSize:e.nodesPerPage,lodMetric:e.lodSelectionMetricType,urlPrefix:h}}catch(N){r!=null&&r.warn("#fetchIndexInfo()","Failed to load root node page. Falling back to node documents.",b,N),s=N}}if(!a)return null;const l=a==null?void 0:a.split("/").pop(),p=`${c}/nodes/`,u=p+l;try{return{type:"node",rootNode:(await f(u,{query:{f:"json",...t,token:i},responseType:"json",signal:o})).data,urlPrefix:p}}catch(h){throw new y("sceneservice:root-node-missing","Root node missing.",{pageError:s,nodeError:h,url:u})}}let H=null;function Q(){return H}const te=c=>{let a=class extends c{constructor(){super(...arguments),this.spatialReference=null,this.fullExtent=null,this.heightModelInfo=null,this.minScale=0,this.maxScale=0,this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.copyright=null,this.sublayerTitleMode="item-title",this.title=null,this.layerId=null,this.indexInfo=null,this._debouncedSaveOperations=K(async(e,t,i)=>{switch(e){case v.SAVE:return this._save(t);case v.SAVE_AS:return this._saveAs(i,t)}})}readSpatialReference(e,t){return this._readSpatialReference(t)}_readSpatialReference(e){if(e.spatialReference!=null)return S.fromJSON(e.spatialReference);const t=e.store,i=t.indexCRS||t.geographicCRS,r=i&&parseInt(i.substring(i.lastIndexOf("/")+1,i.length),10);return r!=null?new S(r):null}readFullExtent(e,t,i){if(e!=null&&typeof e=="object"){const s=e.spatialReference==null?{...e,spatialReference:this._readSpatialReference(t)}:e;return w.fromJSON(s,i)}const r=t.store,o=this._readSpatialReference(t);return o==null||(r==null?void 0:r.extent)==null||!Array.isArray(r.extent)||r.extent.some(s=>s=2&&(t.major=parseInt(i[0],10),t.minor=parseInt(i[1],10)),t}readVersion(e,t){const i=t.store,r=i.version!=null?i.version.toString():"";return this.parseVersionString(r)}readTitlePortalItem(e){return this.sublayerTitleMode!=="item-title"?void 0:e}readTitleService(e,t){var o;const i=(o=this.portalItem)==null?void 0:o.title;if(this.sublayerTitleMode==="item-title")return U(this.url,t.name);let r=t.name;if(!r&&this.url){const s=V(this.url);s!=null&&(r=s.title)}return this.sublayerTitleMode==="item-title-and-service-name"&&i&&(r=i+" - "+r),M(r)}set url(e){const t=q({layer:this,url:e,nonStandardUrlAllowed:!1,logger:x.getLogger(this)});this._set("url",t.url),t.layerId!=null&&this._set("layerId",t.layerId)}writeUrl(e,t,i,r){C(this,e,"layers",t,r)}get parsedUrl(){const e=this._get("url"),t=k(e);return this.layerId!=null&&(t.path=`${t.path}/layers/${this.layerId}`),t}async _fetchIndexAndUpdateExtent(e,t){this.indexInfo=Z(this.parsedUrl.path,this.rootNode,e,this.customParameters,this.apiKey,x.getLogger(this),t),this.fullExtent==null||this.fullExtent.hasZ||this._updateExtent(await this.indexInfo)}_updateExtent(e){var t,i,r,o;if((e==null?void 0:e.type)==="page"){const s=e.rootIndex%e.pageSize,l=(i=(t=e.rootPage)==null?void 0:t.nodes)==null?void 0:i[s];if(((r=l==null?void 0:l.obb)==null?void 0:r.center)==null||l.obb.halfSize==null)throw new y("sceneservice:invalid-node-page","Invalid node page.");if(l.obb.center[0]0)return t.data.layers[0].id}async _fetchServiceLayer(e){var o;const t=await f(((o=this.parsedUrl)==null?void 0:o.path)??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});t.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));let i=!1;if(t.data.layerType&&t.data.layerType==="Voxel"&&(i=!0),i)return this._fetchVoxelServiceLayer();const r=t.data;this.read(r,this._getServiceContext()),this.validateLayer(r)}async _fetchVoxelServiceLayer(e){var i;const t=(await f(((i=this.parsedUrl)==null?void 0:i.path)+"/layer",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e})).data;this.read(t,this._getServiceContext()),this.validateLayer(t)}_getServiceContext(){var e;return{origin:"service",portalItem:this.portalItem,portal:(e=this.portalItem)==null?void 0:e.portal,url:this.parsedUrl}}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&typeof this.beforeSave=="function"&&await this.beforeSave()}validateLayer(e){}_updateTypeKeywords(e,t,i){e.typeKeywords||(e.typeKeywords=[]);const r=t.getTypeKeywords();for(const o of r)e.typeKeywords.push(o);e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((o,s,l)=>l.indexOf(o)===s),i===g.newItem&&(e.typeKeywords=e.typeKeywords.filter(o=>o!=="Hosted Service")))}async _saveAs(e,t){var p;const i={...A,...t};let r=z.from(e);if(!r)throw new y("sceneservice:portal-item-required","_saveAs() requires a portal item to save to");T(r),r.id&&(r=r.clone(),r.id=null);const o=r.portal||F.getDefault();await this._ensureLoadBeforeSave(),r.type=_,r.portal=o;const s=E(r,"portal-item",!0),l={layers:[this.write({},s)]};return await Promise.all(s.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(l,s,i),r.url=this.url,r.title||(r.title=this.title),this._updateTypeKeywords(r,i,g.newItem),await o.signIn(),await((p=o.user)==null?void 0:p.addItem({item:r,folder:i==null?void 0:i.folder,data:l})),await J(this.resourceReferences,s),this.portalItem=r,R(s),s.portalItem=r,r}async _save(e){const t={...A,...e};if(!this.portalItem)throw new y("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");if(T(this.portalItem),this.portalItem.type!==_)throw new y("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${_}"`);await this._ensureLoadBeforeSave();const i=E(this.portalItem,"portal-item",!0),r={layers:[this.write({},i)]};return await Promise.all(i.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(r,i,t),this.portalItem.url=this.url,this.portalItem.title||(this.portalItem.title=this.title),this._updateTypeKeywords(this.portalItem,t,g.existingItem),await B(this.portalItem,r,this.resourceReferences,i),R(i),this.portalItem}async _validateAgainstJSONSchema(e,t,i){const r=i==null?void 0:i.validationOptions;D(t,{errorName:"sceneservice:save"},{ignoreUnsupported:r==null?void 0:r.ignoreUnsupported,supplementalUnsupportedErrors:["scenemodification:unsupported"]});const o=r==null?void 0:r.enabled,s=Q();if(o&&s){const l=(await s()).validate(e,i.portalItemLayerType);if(!l.length)return;const p=`Layer item did not validate: +import{M as f,N as y,d as n,y as d,ds as j,aS as S,aZ as m,aE as w,g_ as P,du as L,aR as O,f as $,k as K,fS as U,av as V,g$ as M,h0 as q,s as x,h1 as C,bW as k,aw as z,ax as F,eo as E}from"./index-BjUNJPVf.js";import{i as R}from"./originUtils-D69mHv66.js";import{p as J,n as B}from"./resourceUtils-p9pTIVIi.js";import{i as T}from"./saveAPIKeyUtils-YRBbgdzi.js";import{t as D}from"./saveUtils-CGGzyvzv.js";async function Z(c,a,e,t,i,r,o){let s=null;if(e!=null){const h=`${c}/nodepages/`,b=h+Math.floor(e.rootIndex/e.nodesPerPage);try{return{type:"page",rootPage:(await f(b,{query:{f:"json",...t,token:i},responseType:"json",signal:o})).data,rootIndex:e.rootIndex,pageSize:e.nodesPerPage,lodMetric:e.lodSelectionMetricType,urlPrefix:h}}catch(N){r!=null&&r.warn("#fetchIndexInfo()","Failed to load root node page. Falling back to node documents.",b,N),s=N}}if(!a)return null;const l=a==null?void 0:a.split("/").pop(),p=`${c}/nodes/`,u=p+l;try{return{type:"node",rootNode:(await f(u,{query:{f:"json",...t,token:i},responseType:"json",signal:o})).data,urlPrefix:p}}catch(h){throw new y("sceneservice:root-node-missing","Root node missing.",{pageError:s,nodeError:h,url:u})}}let H=null;function Q(){return H}const te=c=>{let a=class extends c{constructor(){super(...arguments),this.spatialReference=null,this.fullExtent=null,this.heightModelInfo=null,this.minScale=0,this.maxScale=0,this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.copyright=null,this.sublayerTitleMode="item-title",this.title=null,this.layerId=null,this.indexInfo=null,this._debouncedSaveOperations=K(async(e,t,i)=>{switch(e){case v.SAVE:return this._save(t);case v.SAVE_AS:return this._saveAs(i,t)}})}readSpatialReference(e,t){return this._readSpatialReference(t)}_readSpatialReference(e){if(e.spatialReference!=null)return S.fromJSON(e.spatialReference);const t=e.store,i=t.indexCRS||t.geographicCRS,r=i&&parseInt(i.substring(i.lastIndexOf("/")+1,i.length),10);return r!=null?new S(r):null}readFullExtent(e,t,i){if(e!=null&&typeof e=="object"){const s=e.spatialReference==null?{...e,spatialReference:this._readSpatialReference(t)}:e;return w.fromJSON(s,i)}const r=t.store,o=this._readSpatialReference(t);return o==null||(r==null?void 0:r.extent)==null||!Array.isArray(r.extent)||r.extent.some(s=>s=2&&(t.major=parseInt(i[0],10),t.minor=parseInt(i[1],10)),t}readVersion(e,t){const i=t.store,r=i.version!=null?i.version.toString():"";return this.parseVersionString(r)}readTitlePortalItem(e){return this.sublayerTitleMode!=="item-title"?void 0:e}readTitleService(e,t){var o;const i=(o=this.portalItem)==null?void 0:o.title;if(this.sublayerTitleMode==="item-title")return U(this.url,t.name);let r=t.name;if(!r&&this.url){const s=V(this.url);s!=null&&(r=s.title)}return this.sublayerTitleMode==="item-title-and-service-name"&&i&&(r=i+" - "+r),M(r)}set url(e){const t=q({layer:this,url:e,nonStandardUrlAllowed:!1,logger:x.getLogger(this)});this._set("url",t.url),t.layerId!=null&&this._set("layerId",t.layerId)}writeUrl(e,t,i,r){C(this,e,"layers",t,r)}get parsedUrl(){const e=this._get("url"),t=k(e);return this.layerId!=null&&(t.path=`${t.path}/layers/${this.layerId}`),t}async _fetchIndexAndUpdateExtent(e,t){this.indexInfo=Z(this.parsedUrl.path,this.rootNode,e,this.customParameters,this.apiKey,x.getLogger(this),t),this.fullExtent==null||this.fullExtent.hasZ||this._updateExtent(await this.indexInfo)}_updateExtent(e){var t,i,r,o;if((e==null?void 0:e.type)==="page"){const s=e.rootIndex%e.pageSize,l=(i=(t=e.rootPage)==null?void 0:t.nodes)==null?void 0:i[s];if(((r=l==null?void 0:l.obb)==null?void 0:r.center)==null||l.obb.halfSize==null)throw new y("sceneservice:invalid-node-page","Invalid node page.");if(l.obb.center[0]0)return t.data.layers[0].id}async _fetchServiceLayer(e){var o;const t=await f(((o=this.parsedUrl)==null?void 0:o.path)??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});t.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));let i=!1;if(t.data.layerType&&t.data.layerType==="Voxel"&&(i=!0),i)return this._fetchVoxelServiceLayer();const r=t.data;this.read(r,this._getServiceContext()),this.validateLayer(r)}async _fetchVoxelServiceLayer(e){var i;const t=(await f(((i=this.parsedUrl)==null?void 0:i.path)+"/layer",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e})).data;this.read(t,this._getServiceContext()),this.validateLayer(t)}_getServiceContext(){var e;return{origin:"service",portalItem:this.portalItem,portal:(e=this.portalItem)==null?void 0:e.portal,url:this.parsedUrl}}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&typeof this.beforeSave=="function"&&await this.beforeSave()}validateLayer(e){}_updateTypeKeywords(e,t,i){e.typeKeywords||(e.typeKeywords=[]);const r=t.getTypeKeywords();for(const o of r)e.typeKeywords.push(o);e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((o,s,l)=>l.indexOf(o)===s),i===g.newItem&&(e.typeKeywords=e.typeKeywords.filter(o=>o!=="Hosted Service")))}async _saveAs(e,t){var p;const i={...A,...t};let r=z.from(e);if(!r)throw new y("sceneservice:portal-item-required","_saveAs() requires a portal item to save to");T(r),r.id&&(r=r.clone(),r.id=null);const o=r.portal||F.getDefault();await this._ensureLoadBeforeSave(),r.type=_,r.portal=o;const s=E(r,"portal-item",!0),l={layers:[this.write({},s)]};return await Promise.all(s.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(l,s,i),r.url=this.url,r.title||(r.title=this.title),this._updateTypeKeywords(r,i,g.newItem),await o.signIn(),await((p=o.user)==null?void 0:p.addItem({item:r,folder:i==null?void 0:i.folder,data:l})),await J(this.resourceReferences,s),this.portalItem=r,R(s),s.portalItem=r,r}async _save(e){const t={...A,...e};if(!this.portalItem)throw new y("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");if(T(this.portalItem),this.portalItem.type!==_)throw new y("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${_}"`);await this._ensureLoadBeforeSave();const i=E(this.portalItem,"portal-item",!0),r={layers:[this.write({},i)]};return await Promise.all(i.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(r,i,t),this.portalItem.url=this.url,this.portalItem.title||(this.portalItem.title=this.title),this._updateTypeKeywords(this.portalItem,t,g.existingItem),await B(this.portalItem,r,this.resourceReferences,i),R(i),this.portalItem}async _validateAgainstJSONSchema(e,t,i){const r=i==null?void 0:i.validationOptions;D(t,{errorName:"sceneservice:save"},{ignoreUnsupported:r==null?void 0:r.ignoreUnsupported,supplementalUnsupportedErrors:["scenemodification:unsupported"]});const o=r==null?void 0:r.enabled,s=Q();if(o&&s){const l=(await s()).validate(e,i.portalItemLayerType);if(!l.length)return;const p=`Layer item did not validate: ${l.join(` `)}`;if(x.getLogger(this).error(`_validateAgainstJSONSchema(): ${p}`),r.failPolicy==="throw"){const u=l.map(h=>new y("sceneservice:schema-validation",h));throw new y("sceneservice-validate:error","Failed to save layer item due to schema validation, see `details.errors`.",{validationErrors:u})}}}};return n([d(j)],a.prototype,"id",void 0),n([d({type:S})],a.prototype,"spatialReference",void 0),n([m("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],a.prototype,"readSpatialReference",null),n([d({type:w})],a.prototype,"fullExtent",void 0),n([m("fullExtent",["fullExtent","store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],a.prototype,"readFullExtent",null),n([d({readOnly:!0,type:P})],a.prototype,"heightModelInfo",void 0),n([d({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],a.prototype,"minScale",void 0),n([d({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],a.prototype,"maxScale",void 0),n([d({readOnly:!0})],a.prototype,"version",void 0),n([m("version",["store.version"])],a.prototype,"readVersion",null),n([d({type:String,json:{read:{source:"copyrightText"}}})],a.prototype,"copyright",void 0),n([d({type:String,json:{read:!1}})],a.prototype,"sublayerTitleMode",void 0),n([d({type:String})],a.prototype,"title",void 0),n([m("portal-item","title")],a.prototype,"readTitlePortalItem",null),n([m("service","title",["name"])],a.prototype,"readTitleService",null),n([d({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],a.prototype,"layerId",void 0),n([d(L)],a.prototype,"url",null),n([O("url")],a.prototype,"writeUrl",null),n([d()],a.prototype,"parsedUrl",null),n([d({readOnly:!0})],a.prototype,"store",void 0),n([d({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],a.prototype,"rootNode",void 0),a=n([$("esri.layers.mixins.SceneService")],a),a},I=-1e38;var g;(function(c){c[c.existingItem=0]="existingItem",c[c.newItem=1]="newItem"})(g||(g={}));const _="Scene Service",A={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}};var v;(function(c){c[c.SAVE=0]="SAVE",c[c.SAVE_AS=1]="SAVE_AS"})(v||(v={}));export{te as L,v as P,Z as r}; diff --git a/assets/SourceLayerData-2rdvzlLE.js b/assets/SourceLayerData-CTiUdlGY.js similarity index 96% rename from assets/SourceLayerData-2rdvzlLE.js rename to assets/SourceLayerData-CTiUdlGY.js index 0fcf9ea..a64e81e 100644 --- a/assets/SourceLayerData-2rdvzlLE.js +++ b/assets/SourceLayerData-CTiUdlGY.js @@ -1 +1 @@ -import{fm as g}from"./index-CEWggaxV.js";var u;(function(c){c[c.moveTo=1]="moveTo",c[c.lineTo=2]="lineTo",c[c.close=7]="close"})(u||(u={}));class m{constructor(e,t,o=0){this.values={},this._geometry=void 0,this._pbfGeometry=null,this.featureIndex=o;const s=t.keys,l=t.values,r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:this.id=r.getUInt64();break;case 2:{const i=r.getMessage().asUnsafe(),a=this.values;for(;!i.empty();){const n=i.getUInt32(),h=i.getUInt32();a[s[n]]=l[h]}i.release();break}case 3:this.type=r.getUInt32();break;case 4:this._pbfGeometry=r.getMessage();break;default:r.skip()}}getGeometry(e){if(this._geometry!==void 0)return this._geometry;if(!this._pbfGeometry)return null;const t=this._pbfGeometry.asUnsafe();let o,s;this._pbfGeometry=null,e?e.reset(this.type):o=[];let l,r=u.moveTo,i=0,a=0,n=0;for(;!t.empty();){if(i===0){const h=t.getUInt32();r=7&h,i=h>>3}switch(i--,r){case u.moveTo:a+=t.getSInt32(),n+=t.getSInt32(),e?e.moveTo(a,n):o&&(s&&o.push(s),s=[],s.push(new g(a,n)));break;case u.lineTo:a+=t.getSInt32(),n+=t.getSInt32(),e?e.lineTo(a,n):s&&s.push(new g(a,n));break;case u.close:e?e.close():s&&!s[0].equals(a,n)&&s.push(s[0].clone());break;default:throw t.release(),new Error("Invalid path operation")}}return e?l=e.result():o&&(s&&o.push(s),l=o),t.release(),this._geometry=l,l}}class p{constructor(e){this.extent=4096,this.keys=[],this.values=[],this._pbfLayer=e.clone();const t=e.asUnsafe();for(;t.next();)switch(t.tag()){case 1:this.name=t.getString();break;case 3:this.keys.push(t.getString());break;case 4:this.values.push(t.processMessage(p._parseValue));break;case 5:this.extent=t.getUInt32();break;default:t.skip()}}getData(){return this._pbfLayer}static _parseValue(e){for(;e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getInt64();case 5:return e.getUInt64();case 6:return e.getSInt64();case 7:return e.getBool();default:e.skip()}return null}}export{p as e,m as s}; +import{fm as g}from"./index-BjUNJPVf.js";var u;(function(c){c[c.moveTo=1]="moveTo",c[c.lineTo=2]="lineTo",c[c.close=7]="close"})(u||(u={}));class m{constructor(e,t,o=0){this.values={},this._geometry=void 0,this._pbfGeometry=null,this.featureIndex=o;const s=t.keys,l=t.values,r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:this.id=r.getUInt64();break;case 2:{const i=r.getMessage().asUnsafe(),a=this.values;for(;!i.empty();){const n=i.getUInt32(),h=i.getUInt32();a[s[n]]=l[h]}i.release();break}case 3:this.type=r.getUInt32();break;case 4:this._pbfGeometry=r.getMessage();break;default:r.skip()}}getGeometry(e){if(this._geometry!==void 0)return this._geometry;if(!this._pbfGeometry)return null;const t=this._pbfGeometry.asUnsafe();let o,s;this._pbfGeometry=null,e?e.reset(this.type):o=[];let l,r=u.moveTo,i=0,a=0,n=0;for(;!t.empty();){if(i===0){const h=t.getUInt32();r=7&h,i=h>>3}switch(i--,r){case u.moveTo:a+=t.getSInt32(),n+=t.getSInt32(),e?e.moveTo(a,n):o&&(s&&o.push(s),s=[],s.push(new g(a,n)));break;case u.lineTo:a+=t.getSInt32(),n+=t.getSInt32(),e?e.lineTo(a,n):s&&s.push(new g(a,n));break;case u.close:e?e.close():s&&!s[0].equals(a,n)&&s.push(s[0].clone());break;default:throw t.release(),new Error("Invalid path operation")}}return e?l=e.result():o&&(s&&o.push(s),l=o),t.release(),this._geometry=l,l}}class p{constructor(e){this.extent=4096,this.keys=[],this.values=[],this._pbfLayer=e.clone();const t=e.asUnsafe();for(;t.next();)switch(t.tag()){case 1:this.name=t.getString();break;case 3:this.keys.push(t.getString());break;case 4:this.values.push(t.processMessage(p._parseValue));break;case 5:this.extent=t.getUInt32();break;default:t.skip()}}getData(){return this._pbfLayer}static _parseValue(e){for(;e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getInt64();case 5:return e.getUInt64();case 6:return e.getSInt64();case 7:return e.getBool();default:e.skip()}return null}}export{p as e,m as s}; diff --git a/assets/SpatialFilter-C4Il3spK.js b/assets/SpatialFilter-D9TNROUn.js similarity index 99% rename from assets/SpatialFilter-C4Il3spK.js rename to assets/SpatialFilter-D9TNROUn.js index 38cf1aa..2daeb00 100644 --- a/assets/SpatialFilter-C4Il3spK.js +++ b/assets/SpatialFilter-D9TNROUn.js @@ -1 +1 @@ -import{x as T,n as f,t as g,s as m,a as y,r as J}from"./WhereClause-Dzgyc0wk.js";import{D as X,an as h,ao as P,ap as k,aq as L,ar as x,as as O,at as ee,au as te,av as ne,aw as ae,ax as F,ay as re,az as se,aA as G,aB as B,aC as H}from"./arcadeUtils-BoaybaAR.js";import{n as M,m as ie,a as W}from"./TimeOnly-Cm47ew5I.js";import{hj as le,aS as oe,eu as Z}from"./index-CEWggaxV.js";import{union as ue,geodesicArea as ce,planarArea as he,geodesicLength as de,planarLength as pe,relate as _e,crosses as fe,touches as ge,within as me,overlaps as ye,contains as Se,intersects as Y}from"./geometryEngineAsync-B-ooCYDN.js";import{Z as we}from"./FieldsIndex-CLgRNeJ_.js";class E{constructor(){this._databaseTypeMetaData={},this._layerInfo={}}clearDatabaseType(e){this._databaseTypeMetaData[e]===void 0&&delete this._databaseTypeMetaData[e]}getDatabaseType(e){return e==="MUSTBESET"||this._databaseTypeMetaData[e]===void 0?null:this._databaseTypeMetaData[e]}setDatabaseType(e,t){this._databaseTypeMetaData[e]=t}getLayerInfo(e){return this._layerInfo[e]===void 0?null:this._layerInfo[e]}setLayerInfo(e,t){this._layerInfo[e]=t}clearLayerInfo(e){this._layerInfo[e]!==void 0&&delete this._layerInfo[e]}}E.applicationCache=null;class Te{constructor(e,t){this._lastId=-1,this._progress=t,this._parent=e}reset(){this._lastId=-1}async nextBatchAsArcadeFeatures(e,t){const n=await this.nextBatch(e);return n===null?n:n.map(a=>X.createFromGraphicLikeObject(a.geometry,a.attributes,this._parent,t))}nextBatch(e){if(this._parent._mainSetInUse!==null)return this._parent._mainSetInUse.then(a=>this.nextBatch(e),a=>this.nextBatch(e));const t={returnpromise:null,hasset:!1},n=[];return t.returnpromise=new Promise((a,s)=>{this._parent._getSet(this._progress).then(i=>{const l=i._known;let o=l.length-1;if(l[l.length-1]==="GETPAGES"&&(o-=1),this._lastId+e>o&&l.length>0&&l[l.length-1]==="GETPAGES")return void this._parent._expandPagedSet(i,this._parent._maxQueryRate(),0,0,this._progress).then(c=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(a,s)},c=>{t.hasset=!0,this._parent._mainSetInUse=null,s(c)});const u=i._candidates;if(o>=this._lastId+e||u.length===0){for(let c=0;c=l.length)break;n[c]=l[p]}return this._lastId+=n.length,n.length===0&&(t.hasset=!0,this._parent._mainSetInUse=null,a([])),void this._parent._getFeatureBatch(n,this._progress).then(c=>{t.hasset=!0,this._parent._mainSetInUse=null,a(c)},c=>{t.hasset=!0,this._parent._mainSetInUse=null,s(c)})}this._parent._refineSetBlock(i,this._parent._maxProcessingRate(),this._progress).then(()=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(a,s)},c=>{t.hasset=!0,this._parent._mainSetInUse=null,s(c)})},i=>{t.hasset=!0,this._parent._mainSetInUse=null,s(i)})}),t.hasset===!1&&(this._parent._mainSetInUse=t.returnpromise,t.hasset=!0),t.returnpromise}next(){if(this._parent._mainSetInUse!==null)return this._parent._mainSetInUse.then(t=>this.next(),t=>this.next());const e={returnpromise:null,hasset:!1};return e.returnpromise=new Promise((t,n)=>{this._parent._getSet(this._progress).then(a=>{const s=a._known;this._lastId(e.hasset=!0,this._parent._mainSetInUse=null,this.next())).then(t,n):(this._lastId+=1,this._parent._getFeature(a,s[this._lastId],this._progress).then(i=>{e.hasset=!0,this._parent._mainSetInUse=null,t(i)},i=>{e.hasset=!0,this._parent._mainSetInUse=null,n(i)})):a._candidates.length>0?this._parent._refineSetBlock(a,this._parent._maxProcessingRate(),this._progress).then(()=>{e.hasset=!0,this._parent._mainSetInUse=null,this.next().then(t,n)},i=>{e.hasset=!0,this._parent._mainSetInUse=null,n(i)}):(e.hasset=!0,this._parent._mainSetInUse=null,t(null))},a=>{e.hasset=!0,this._parent._mainSetInUse=null,n(a)})}),e.hasset===!1&&(this._parent._mainSetInUse=e.returnpromise,e.hasset=!0),e.returnpromise}async count(){if(this._parent._totalCount!==-1)return this._parent._totalCount;const e=await this._parent._getSet(this._progress),t=await this._refineAllSets(e);return this._parent._totalCount=t._known.length,this._parent._totalCount}async _refineAllSets(e){if(e._known.length>0&&e._known[e._known.length-1]==="GETPAGES")return await this._parent._expandPagedSet(e,this._parent._maxQueryRate(),0,1,this._progress),this._refineAllSets(e);if(e._candidates.length>0){if(e._known[e._candidates.length-1]==="GETPAGES")return await this._parent._expandPagedSet(e,this._parent._maxQueryRate(),0,2,this._progress),this._refineAllSets(e);const t=await this._parent._refineSetBlock(e,this._parent._maxProcessingRate(),this._progress);return t._candidates.length>0?this._refineAllSets(t):t}return e}}class D{constructor(e,t,n,a){this._lastFetchedIndex=0,this._ordered=!1,this.pagesDefinition=null,this._candidates=e,this._known=t,this._ordered=n,this.pagesDefinition=a}}function K(r,e){return d(r==null?void 0:r.parseTree,e,r==null?void 0:r.parameters)}function Ye(r,e,t){return d(r,e,t)}function Ke(r,e,t,n){return T.create(d(r.parseTree,h.Standardised,r.parameters,e,t),n,r.timeZone)}function Qe(r,e,t="AND"){return T.create("(("+K(r,h.Standardised)+")"+t+"("+K(e,h.Standardised)+"))",r.fieldsIndex,r.timeZone)}function d(r,e,t,n=null,a=null){let s,i,l,o;switch(r.type){case"interval":return Ee(d(r.value,e,t,n,a),r.qualifier,r.op);case"case-expression":{let u=" CASE ";r.format==="simple"&&(u+=d(r.operand,e,t,n,a));for(let c=0;c":case"<":case">":case">=":case"<=":case"=":case"*":case"-":case"+":case"/":return" ("+d(r.left,e,t,n,a)+" "+r.operator+" "+d(r.right,e,t,n,a)+") ";case"||":return" ("+d(r.left,e,t,n,a)+" "+(e===h.SqlServer?"+":r.operator)+" "+d(r.right,e,t,n,a)+") "}throw new f(g.UnsupportedOperator,{operator:r.operator});case"null":return"null";case"boolean":return r.value===!0?"1":"0";case"string":return"'"+r.value.toString().replaceAll("'","''")+"'";case"timestamp":return`timestamp '${r.value}'`;case"date":return`date '${r.value}'`;case"time":return`time '${r.value}'`;case"number":return r.value.toString();case"current-time":return Fe(r.mode==="date",e);case"column-reference":return n?n.toLowerCase()===r.column.toLowerCase()?"("+a+")":r.delimited===!0?`"${r.column.split('"').join('""')}"`:r.column:r.column;case"data-type":return r.value;case"function":{const u=d(r.args,e,t,n,a);return Ie(r.name,u,e)}}throw new f(g.UnsupportedSyntax,{node:r.type})}function Ie(r,e,t){switch(r.toLowerCase().trim()){case"cos":case"sin":case"tan":case"cosh":case"tanh":case"sinh":case"acos":case"asin":case"atan":case"floor":case"log10":case"log":case"abs":if(e.length!==1)throw new f(g.InvalidFunctionParameters,{function:r.toLowerCase().trim()});return`${r.toUpperCase().trim()}(${e[0]})`;case"ceiling":case"ceil":if(e.length!==1)throw new f(g.InvalidFunctionParameters,{function:"ceiling"});switch(t){case h.Standardised:case h.StandardisedNoInterval:}return"CEILING("+e[0]+")";case"mod":case"power":case"nullif":if(e.length!==2)throw new f(g.InvalidFunctionParameters,{function:r.toLowerCase().trim()});return`${r.toUpperCase().trim()}(${e[0]},${e[1]})`;case"round":if(e.length===2)return"ROUND("+e[0]+","+e[1]+")";if(e.length===1)return"ROUND("+e[0]+")";throw new f(g.InvalidFunctionParameters,{function:"round"});case"truncate":if(e.length<1||e.length>2)throw new f(g.InvalidFunctionParameters,{function:"truncate"});return t===h.SqlServer?"ROUND("+e[0]+(e.length===1?"0":","+e[1])+",1)":"TRUNCATE("+e[0]+(e.length===1?")":","+e[1]+")");case"char_length":case"len":if(e.length!==1)throw new f(g.InvalidFunctionParameters,{function:"char_length"});switch(t){case h.SqlServer:return"LEN("+e[0]+")";case h.Oracle:return"LENGTH("+e[0]+")";default:return"CHAR_LENGTH("+e[0]+")"}case"coalesce":case"concat":{if(e.length<1)throw new f(g.InvalidFunctionParameters,{function:r.toLowerCase()});let n=r.toUpperCase().trim()+"(";for(let a=0;a":case"<":case">":case">=":case"<=":case"=":return"boolean";case"IS":case"ISNOT":if(e.right.type!=="null")throw new f(g.UnsupportedIsRhs);return"boolean";case"*":case"-":case"+":case"/":return C([S(r,e.left,t,n),S(r,e.right,t,n)]);case"||":return"string";default:throw new f(g.UnsupportedOperator,{operator:e.operator})}case"null":return"";case"boolean":return"boolean";case"string":return"string";case"number":return e.value===null?"":e.value%1==0?"integer":"double";case"date":return"date";case"timestamp":return e.withtimezone?"timestamp-offset":"date";case"time":return"time-only";case"current-time":return"date";case"column-reference":{const c=r[e.column.toLowerCase()];return c===void 0?"":c}case"function":switch(e.name.toLowerCase()){case"cast":switch(((i=(s=e.args)==null?void 0:s.value[1])==null?void 0:i.value.type)??""){case"integer":case"smallint":return"integer";case"real":case"float":return"double";case"date":case"timestamp":return((u=(o=(l=e.args)==null?void 0:l.value[1])==null?void 0:o.value)==null?void 0:u.withtimezone)===!0?"timestamp-offset":"date";case"time":return"time-only";case"varchar":return"string";default:return""}case"position":case"extract":case"char_length":case"mod":return"integer";case"round":if(a=S(r,e.args,t,n),a instanceof Array){if(a.length<=0)return"double";a=a[0]}return a;case"sign":return"integer";case"ceiling":case"floor":case"abs":return a=S(r,e.args,t,n),a instanceof Array&&(a=C(a)),a==="integer"||a==="double"?a:"double";case"area":case"length":case"log":case"log10":case"sin":case"cos":case"tan":case"asin":case"acos":case"atan":case"cosh":case"sinh":case"tanh":case"power":return"double";case"substring":case"trim":case"concat":case"lower":case"upper":return"string";case"truncate":return"double";case"nullif":case"coalesce":return a=S(r,e.args,t,n),a instanceof Array?a.length>0?a[0]:"":a}return""}throw new f(g.UnsupportedSyntax,{node:e.type})}const V={boolean:1,string:2,integer:3,double:4,date:5};function C(r){if(r){let e="";for(const t of r)t!==""&&(e=e===""||V[e]=e&&e!==-1)return t}return t}function Ve(r){switch(r.toLowerCase()){case"distinct":return"distinct";case"avg":case"mean":return"avg";case"min":return"min";case"sum":return"sum";case"max":return"max";case"stdev":case"stddev":return"stddev";case"var":case"variance":return"var";case"count":return"count"}return""}function je(r,e,t=1e3){switch(r.toLowerCase()){case"distinct":return Ae(e,t);case"avg":case"mean":return A(e);case"min":return Math.min.apply(Math,e);case"sum":return $(e);case"max":return Math.max.apply(Math,e);case"stdev":case"stddev":return Math.sqrt(j(e));case"var":case"variance":return j(e);case"count":return e.length}return 0}async function Re(r,e,t){const n=await v(r,e,t,!0);return n.length===0?null:Math.min.apply(Math,n)}async function Ce(r,e,t){const n=await v(r,e,t,!0);return n.length===0?null:Math.max.apply(Math,n)}async function Ne(r,e,t){let n="";e&&!De(e)&&(n=be(e,r.fields));const a=await v(r,e,t,!0);if(a.length===0)return null;const s=A(a);return s===null?s:n==="integer"?ve(s):s}async function Pe(r,e,t){const n=await v(r,e,t,!0);return n.length===0?null:z(n)}async function ke(r,e,t){const n=await v(r,e,t,!0);return n.length===0?null:Math.sqrt(z(n))}async function Le(r,e,t){const n=await v(r,e,t,!0);return n.length===0?null:$(n)}async function xe(r,e){return r.iterator(e).count()}async function v(r,e,t,n=!1){const a=r.iterator(t),s=[],i={ticker:0};let l=await a.next();for(;l!==null;){if(i.ticker++,t.aborted)throw new m(y.Cancelled);i.ticker%100==0&&(i.ticker=0,await new Promise(u=>{setTimeout(u,0)}));const o=e==null?void 0:e.calculateValue(l);o===null?n===!1&&(s[s.length]=o):s[s.length]=o instanceof W||o instanceof M?o.toNumber():o instanceof J?o.toMilliseconds():o,l=await a.next()}return s}async function Oe(r,e,t=1e3,n=null){const a=r.iterator(n),s=[],i={},l={ticker:0};let o=await a.next();for(;o!==null;){if(l.ticker++,n&&n.aborted)throw new m(y.Cancelled);l.ticker%100==0&&(l.ticker=0,await new Promise(p=>{setTimeout(p,0)}));const u=e==null?void 0:e.calculateValue(o);let c=u;if(u instanceof W?c="!!DATEONLY!!-"+u.toString():u instanceof J?c="!!TSOFFSETONLY!!-"+u.toString():u instanceof M?c="!!TIMEONLY!!-"+u.toString():u instanceof Date&&(c="!!DATE!!-"+u.toString()),u!=null&&i[c]===void 0&&(s.push(u),i[c]=1),s.length>=t&&t!==-1)return s;o=await a.next()}return s}class _{constructor(e){this.recentlyUsedQueries=null,this.featureSetQueryInterceptor=null,this._idstates=[],this._parent=null,this._wset=null,this._mainSetInUse=null,this._maxProcessing=200,this._maxQuery=500,this._totalCount=-1,this._databaseType=h.NotEvaluated,this._databaseTypeProbed=null,this.declaredRootClass="esri.arcade.featureset.support.FeatureSet",this._featureCache=[],this.typeIdField=null,this.types=null,this.subtypeField=null,this.subtypes=null,this.fields=null,this.geometryType="",this.objectIdField="",this.globalIdField="",this.spatialReference=null,this.hasM=!1,this.hasZ=!1,this._transparent=!1,this.loaded=!1,this._loadPromise=null,this._fieldsIndex=null,this.fsetInfo=null,e!=null&&e.lrucache&&(this.recentlyUsedQueries=e.lrucache),e!=null&&e.interceptor&&(this.featureSetQueryInterceptor=e.interceptor)}optimisePagingFeatureQueries(e){this._parent&&this._parent.optimisePagingFeatureQueries(e)}_hasMemorySource(){return!0}prop(e,t){return t===void 0?this[e]:(this[e]!==void 0&&(this[e]=t),this)}end(){return this._parent!==null&&this._parent._transparent===!0?this._parent.end():this._parent}_ensureLoaded(){return this.load()}load(){return this._loadPromise===null&&(this._loadPromise=this.loadImpl()),this._loadPromise}async loadImpl(){var e,t;return((e=this._parent)==null?void 0:e.loaded)===!0?(this._initialiseFeatureSet(),this):(await((t=this._parent)==null?void 0:t.load()),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){this._parent!==null?(this.fields=this._parent.fields.slice(0),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types,this.subtypeField=this._parent.subtypeField,this.subtypes=this._parent.subtypes):(this.fields=[],this.typeIdField="",this.subtypeField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new oe({wkid:4326}),this.geometryType=ae.point)}getField(e,t){let n;return(t=t||this.fields)&&(e=e.toLowerCase(),t.some(a=>(a&&a.name.toLowerCase()===e&&(n=a),!!n))),n}getFieldsIndex(){return this._fieldsIndex===null&&(this._fieldsIndex=we.fromLayer({timeInfo:this.timeInfo,editFieldsInfo:this.editFieldsInfo,dateFieldsTimeZone:this.dateFieldsTimeZone,datesInUnknownTimezone:this.datesInUnknownTimezone,fields:this.fields})),this._fieldsIndex}_maxProcessingRate(){return this._parent!==null?Math.min(this._maxProcessing,this._parent._maxProcessingRate()):Math.min(this._maxProcessing,this._maxQueryRate())}_maxQueryRate(){return this._parent!==null?Math.max(this._maxQuery,this._parent._maxQueryRate()):this._maxQuery}_checkCancelled(e){if(e!=null&&e.aborted)throw new m(y.Cancelled)}nativeCapabilities(){return this._parent.nativeCapabilities()}async _canDoAggregates(e,t,n,a,s){return this._parent!==null&&this._parent._canDoAggregates(e,t,n,a,s)}async _getAggregatePagesDataSourceDefinition(e,t,n,a,s,i,l){if(this._parent===null)throw new m(y.NeverReach);return this._parent._getAggregatePagesDataSourceDefinition(e,t,n,a,s,i,l)}async _getAgregagtePhysicalPage(e,t,n){if(this._parent===null)throw new m(y.NeverReach);return this._parent._getAgregagtePhysicalPage(e,t,n)}async databaseType(){if(this._databaseType===h.NotEvaluated){if(E.applicationCache!==null){const e=E.applicationCache.getDatabaseType(this._cacheableFeatureSetSourceKey());if(e!==null)return e}if(this._databaseTypeProbed!==null)return this._databaseTypeProbed;try{this._databaseTypeProbed=this._getDatabaseTypeImpl(),E.applicationCache!==null&&E.applicationCache.setDatabaseType(this._cacheableFeatureSetSourceKey(),this._databaseTypeProbed)}catch(e){throw E.applicationCache!==null&&E.applicationCache.clearDatabaseType(this._cacheableFeatureSetSourceKey()),e}return this._databaseTypeProbed}return this._databaseType}async _getDatabaseTypeImpl(){const e=[{thetype:h.SqlServer,testwhere:"(CAST( '2015-01-01' as DATETIME) = CAST( '2015-01-01' as DATETIME)) AND OBJECTID<0"},{thetype:h.Oracle,testwhere:"(TO_DATE('2003-11-18','YYYY-MM-DD') = TO_DATE('2003-11-18','YYYY-MM-DD')) AND OBJECTID<0"},{thetype:h.StandardisedNoInterval,testwhere:"(date '2015-01-01 10:10:10' = date '2015-01-01 10:10:10') AND OBJECTID<0"}];for(const t of e)if(await this._runDatabaseProbe(t.testwhere)===!0)return t.thetype;return h.StandardisedNoInterval}_cacheableFeatureSetSourceKey(){return"MUSTBESET"}async _runDatabaseProbe(e){if(this._parent!==null)return this._parent._runDatabaseProbe(e);throw new m(y.NotImplemented)}isTable(){var e;return((e=this._parent)==null?void 0:e.isTable())??!1}_featureFromCache(e){if(this._featureCache[e]!==void 0)return this._featureCache[e]}_isInFeatureSet(e){return F.Unknown}_getSet(e){throw new m(y.NotImplemented)}async _getFeature(e,t,n){if(this._checkCancelled(n),this._featureFromCache(t)!==void 0)return this._featureFromCache(t);if(await this._getFeatures(e,t,this._maxProcessingRate(),n),this._checkCancelled(n),this._featureFromCache(t)!==void 0)return this._featureFromCache(t);throw new m(y.MissingFeatures)}async _getFeatureBatch(e,t){this._checkCancelled(t);const n=new D([],e,!1,null),a=[];await this._getFeatures(n,-1,e.length,t),this._checkCancelled(t);for(const s of e)this._featureFromCache(s)!==void 0&&a.push(this._featureFromCache(s));return a}async _getFeatures(e,t,n,a){return"success"}_getFilteredSet(e,t,n,a,s){throw new m(y.NotImplemented)}async _refineSetBlock(e,t,n){if(this._checkIfNeedToExpandCandidatePage(e,this._maxQueryRate())===!0)return await this._expandPagedSet(e,this._maxQueryRate(),0,0,n),this._refineSetBlock(e,t,n);this._checkCancelled(n);const a=e._candidates.length;this._refineKnowns(e,t);let s=a-e._candidates.length;if(e._candidates.length===0||s>=t)return e;if(await this._refineIfParentKnown(e,t-s,n),this._checkCancelled(n),this._refineKnowns(e,t-s),s=a-e._candidates.length,s0){const i=t-s,l=this._prepareFetchAndRefineSet(e._candidates);return await this._fetchAndRefineFeatures(l,l.length>i?i:e._candidates.length,n),this._checkCancelled(n),this._refineKnowns(e,t-s),e}return e}_fetchAndRefineFeatures(e,t,n){return null}_prepareFetchAndRefineSet(e){const t=[];for(let n=0;n=t)break}a!==null&&s.push(a);for(let i=s.length-1;i>=0;i--)e._candidates.splice(s[i].start,s[i].end-s[i].start+1)}_refineIfParentKnown(e,t,n){const a=new D([],[],e._ordered,null);return a._candidates=e._candidates.slice(0),this._parent._refineSetBlock(a,t,n)}_candidateIdTransform(e){return this._parent._candidateIdTransform(e)}_checkIfNeedToExpandKnownPage(e,t){if(e.pagesDefinition===null)return!1;let n=0;for(let a=e._lastFetchedIndex;a=t))break}return!1}_checkIfNeedToExpandCandidatePage(e,t){if(e.pagesDefinition===null)return!1;let n=0;for(let a=0;a=t)break}return!1}async _expandPagedSet(e,t,n,a,s){if(this._parent===null)throw new m(y.NotImplemented);return this._parent._expandPagedSet(e,t,n,a,s)}async _expandPagedSetFeatureSet(e,t,n,a,s){if(e._known.length>0&&e._known[e._known.length-1]==="GETPAGES"&&(a=1),a===0&&e._candidates.length>0&&e._candidates[e._candidates.length-1]==="GETPAGES"&&(a=2),a===0)return"finished";const i=await this._getPage(e,a,s);return n+ie.pagesDefinition.resultOffset||e.pagesDefinition.internal.fullyResolved===!0){a.length=a.length-1;let s=0;for(let l=0;l=e.pagesDefinition.internal.set.length);l++)a[a.length]=e.pagesDefinition.internal.set[e.pagesDefinition.resultOffset+l],s++;e.pagesDefinition.resultOffset+=s;let i=!1;return e.pagesDefinition.internal.fullyResolved===!0&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset&&(i=!0),i===!1&&a.push("GETPAGES"),s}return await this._getPhysicalPage(e,t,n),this._getPage(e,t,n)}_getPhysicalPage(e,t,n){return null}_clonePageDefinition(e){return this._parent===null?null:this._parent._clonePageDefinition(e)}_first(e){return this.iterator(e).next()}first(e){return this._first(e)}async calculateStatistic(e,t,n,a){await this._ensureLoaded();let s=await this._stat(e,t,"",null,null,n,a);return s.calculated===!1&&(s=await this._manualStat(e,t,n,a)),s.result}async _manualStat(e,t,n,a){let s=null;switch(e.toLowerCase()){case"count":return s=await xe(this,a),{calculated:!0,result:s};case"distinct":return s=await Oe(this,t,n,a),{calculated:!0,result:s};case"avg":case"mean":return s=await Ne(this,t,a),{calculated:!0,result:s};case"stdev":return s=await ke(this,t,a),{calculated:!0,result:s};case"variance":return s=await Pe(this,t,a),{calculated:!0,result:s};case"sum":return s=await Le(this,t,a),{calculated:!0,result:s};case"min":return s=await Re(this,t,a),{calculated:!0,result:s};case"max":return s=await Ce(this,t,a),{calculated:!0,result:s};default:return{calculated:!0,result:0}}}async _stat(e,t,n,a,s,i,l){const o=await this._parent._stat(e,t,n,a,s,i,l);return o.calculated===!1?s===null&&n===""&&a===null?this._manualStat(e,t,i,l):{calculated:!1}:o}_unionAllGeomSelf(e){const t=this.iterator(this._defaultTracker(e)),n=[];return new Promise((a,s)=>{this._unionShapeInBatches(n,t,a,s)})}_unionAllGeom(e){return new Promise((t,n)=>{const a=this.iterator(this._defaultTracker(e)),s=[];this._unionShapeInBatches(s,a,t,n)})}_unionShapeInBatches(e,t,n,a){t.next().then(s=>{try{s!==null&&s.geometry!==null&&e.push(s.geometry),e.length>30||s===null&&e.length>1?ue(e).then(i=>{try{s===null?n(i):(e=[i],this._unionShapeInBatches(e,t,n,a))}catch(l){a(l)}},a):s===null?e.length===1?n(e[0]):n(null):this._unionShapeInBatches(e,t,n,a)}catch(i){a(i)}},a)}iterator(e){return new Te(this,e)}intersection(e,t=!1){return _._featuresetFunctions.intersection.bind(this)(e,t)}difference(e,t=!1,n=!0){return _._featuresetFunctions.difference.bind(this)(e,t,n)}symmetricDifference(e,t=!1,n=!0){return _._featuresetFunctions.symmetricDifference.bind(this)(e,t,n)}morphShape(e,t,n="unknown",a=null){return _._featuresetFunctions.morphShape.bind(this)(e,t,n,a)}morphShapeAndAttributes(e,t,n="unknown"){return _._featuresetFunctions.morphShapeAndAttributes.bind(this)(e,t,n)}union(e,t=!1){return _._featuresetFunctions.union.bind(this)(e,t)}intersects(e){return _._featuresetFunctions.intersects.bind(this)(e)}envelopeIntersects(e){return _._featuresetFunctions.envelopeIntersects.bind(this)(e)}contains(e){return _._featuresetFunctions.contains.bind(this)(e)}overlaps(e){return _._featuresetFunctions.overlaps.bind(this)(e)}relate(e,t){return _._featuresetFunctions.relate.bind(this)(e,t)}within(e){return _._featuresetFunctions.within.bind(this)(e)}touches(e){return _._featuresetFunctions.touches.bind(this)(e)}top(e){return _._featuresetFunctions.top.bind(this)(e)}crosses(e){return _._featuresetFunctions.crosses.bind(this)(e)}buffer(e,t,n,a=!0){return _._featuresetFunctions.buffer.bind(this)(e,t,n,a)}filter(e,t=null){return _._featuresetFunctions.filter.bind(this)(e,t)}orderBy(e){return _._featuresetFunctions.orderBy.bind(this)(e)}dissolve(e,t){return _._featuresetFunctions.dissolve.bind(this)(e,t)}groupby(e,t){return _._featuresetFunctions.groupby.bind(this)(e,t)}reduce(e,t=null,n){return new Promise((a,s)=>{this._reduceImpl(this.iterator(this._defaultTracker(n)),e,t,0,a,s,0)})}_reduceImpl(e,t,n,a,s,i,l){try{if(++l>1e3)return void setTimeout(()=>{l=0,this._reduceImpl(e,t,n,a,s,i,l)});e.next().then(o=>{try{if(o===null)s(n);else{const u=t(n,o,a,this);Z(u)?u.then(c=>{this._reduceImpl(e,t,c,a+1,s,i,l)},i):this._reduceImpl(e,t,u,a+1,s,i,l)}}catch(u){i(u)}},i)}catch(o){i(o)}}removeField(e){return _._featuresetFunctions.removeField.bind(this)(e)}addField(e,t,n=null){return _._featuresetFunctions.addField.bind(this)(e,t,n)}sumArea(e,t=!1,n){const a=re(e);return this.reduce((s,i)=>i.geometry===null?0:t?ce(i.geometry,a).then(l=>s+l):he(i.geometry,a).then(l=>s+l),0,n)}sumLength(e,t=!1,n){const a=se(e);return this.reduce((s,i)=>i.geometry===null?0:t?de(i.geometry,a).then(l=>s+l):pe(i.geometry,a).then(l=>s+l),0,n)}_substituteVars(e,t){if(t!==null){const n={};for(const a in t)n[a.toLowerCase()]=t[a];e.parameters=n}}async distinct(e,t=1e3,n=null,a){await this.load();const s=T.create(e,this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC);return this._substituteVars(s,n),this.calculateStatistic("distinct",s,t,this._defaultTracker(a))}async min(e,t=null,n){await this.load();const a=T.create(e,this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC);return this._substituteVars(a,t),this.calculateStatistic("min",a,-1,this._defaultTracker(n))}async max(e,t=null,n){await this.load();const a=T.create(e,this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC);return this._substituteVars(a,t),this.calculateStatistic("max",a,-1,this._defaultTracker(n))}async avg(e,t=null,n){await this.load();const a=T.create(e,this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC);return this._substituteVars(a,t),this.calculateStatistic("avg",a,-1,this._defaultTracker(n))}async sum(e,t=null,n){await this.load();const a=T.create(e,this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC);return this._substituteVars(a,t),this.calculateStatistic("sum",a,-1,this._defaultTracker(n))}async stdev(e,t=null,n){await this.load();const a=T.create(e,this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC);return this._substituteVars(a,t),this.calculateStatistic("stdev",a,-1,this._defaultTracker(n))}async variance(e,t=null,n){await this.load();const a=T.create(e,this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC);return this._substituteVars(a,t),this.calculateStatistic("variance",a,-1,this._defaultTracker(n))}async count(e){return await this.load(),this.calculateStatistic("count",T.create("1",this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC),-1,this._defaultTracker(e))}_defaultTracker(e){return e??{aborted:!1}}forEach(e,t){return new Promise((n,a)=>{this._forEachImpl(this.iterator(this._defaultTracker(t)),e,this,n,a,0)})}_forEachImpl(e,t,n,a,s,i){try{if(++i>1e3)return void setTimeout(()=>{i=0,this._forEachImpl(e,t,n,a,s,i)},0);e.next().then(l=>{try{if(l===null)a(n);else{const o=t(l);o==null?this._forEachImpl(e,t,n,a,s,i):Z(o)?o.then(()=>{try{this._forEachImpl(e,t,n,a,s,i)}catch(u){s(u)}},s):this._forEachImpl(e,t,n,a,s,i)}}catch(o){s(o)}},s)}catch(l){s(l)}}convertToJSON(e){const t={layerDefinition:{geometryType:this.geometryType,fields:[]},featureSet:{features:[],geometryType:this.geometryType}};for(let n=0;n{var i;const s={geometry:(i=a.geometry)==null?void 0:i.toJSON(),attributes:{}};for(const l in a.attributes)s.attributes[l]=a.attributes[l];return t.featureSet.features.push(s),1},0,e).then(()=>t)}castToText(e=!1){return"object, FeatureSet"}queryAttachments(e,t,n,a,s){return this._parent.queryAttachments(e,t,n,a,s)}serviceUrl(){return this._parent.serviceUrl()}subtypeMetaData(){return this.subtypeField&&this.subtypes?{subtypeField:this.subtypeField,subtypes:this.subtypes?this.subtypes.map(e=>({name:e.name,code:e.code})):[]}:this.typeIdField?{subtypeField:this.typeIdField,subtypes:this.types?this.types.map(e=>({name:e.name,code:e.id})):[]}:null}relationshipMetaData(){return this._parent.relationshipMetaData()}get gdbVersion(){return this._parent?this._parent.gdbVersion:""}schema(){const e=[];for(const t of this.fields)e.push(G(t));return{objectIdField:this.objectIdField,globalIdField:this.globalIdField,geometryType:B[this.geometryType]===void 0?"esriGeometryNull":B[this.geometryType],fields:e}}async convertToText(e,t){if(e==="schema")return await this._ensureLoaded(),JSON.stringify(this.schema());if(e==="featureset"){await this._ensureLoaded();const n=[];await this.reduce((s,i)=>{const l={geometry:i.geometry?i.geometry.toJSON():null,attributes:i.attributes};return l.geometry!==null&&l.geometry.spatialReference&&delete l.geometry.spatialReference,n.push(l),1},0,t);const a=this.schema();return a.features=n,a.spatialReference=this.spatialReference.toJSON(),JSON.stringify(a)}return this.castToText()}getFeatureByObjectId(e,t){return this._parent.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._parent.getOwningSystemUrl()}getIdentityUser(){return this._parent.getIdentityUser()}getRootFeatureSet(){return this._parent!==null?this._parent.getRootFeatureSet():this}getDataSourceFeatureSet(){return this._parent!==null?this._parent.getDataSourceFeatureSet():this}castAsJson(e=null){return(e==null?void 0:e.featureset)==="keeptype"?this:(e==null?void 0:e.featureset)==="none"?null:{type:"FeatureSet"}}async castAsJsonAsync(e=null,t=null){var s;if((t==null?void 0:t.featureset)==="keeptype")return this;if((t==null?void 0:t.featureset)==="schema")return await this._ensureLoaded(),JSON.parse(JSON.stringify(this.schema()));if((t==null?void 0:t.featureset)==="none")return null;await this._ensureLoaded();const n=[];await this.reduce((i,l)=>{const o={geometry:l.geometry?(t==null?void 0:t.keepGeometryType)===!0?l.geometry:l.geometry.toJSON():null,attributes:l.attributes};return o.geometry!==null&&o.geometry.spatialReference&&(t==null?void 0:t.keepGeometryType)!==!0&&delete o.geometry.spatialReference,n.push(o),1},0,e);const a=this.schema();return a.features=n,a.spatialReference=(t==null?void 0:t.keepGeometryType)===!0?this.spatialReference:(s=this.spatialReference)==null?void 0:s.toJSON(),a}fieldTimeZone(e){return this.getFieldsIndex().getTimeZone(e)}get preferredTimeZone(){var e;return((e=this._parent)==null?void 0:e.preferredTimeZone)??null}get dateFieldsTimeZone(){var e;return((e=this._parent)==null?void 0:e.dateFieldsTimeZone)??null}get dateFieldsTimeZoneDefaultUTC(){if(this.datesInUnknownTimezone)return"unknown";const e=this.dateFieldsTimeZone??"UTC";return e===""?"UTC":e}get datesInUnknownTimezone(){return this._parent.datesInUnknownTimezone}get editFieldsInfo(){var e;return((e=this._parent)==null?void 0:e.editFieldsInfo)??null}get timeInfo(){var e;return((e=this._parent)==null?void 0:e.timeInfo)??null}set featureSetInfo(e){this.fsetInfo=e}async getFeatureSetInfo(){var e;return this.fsetInfo??await((e=this._parent)==null?void 0:e.getFeatureSetInfo())??null}}_._featuresetFunctions={};class b extends _{constructor(e){super(e),this.declaredClass="esri.layers.featureset.sources.Empty",this._maxProcessing=1e3,this._wset=new D([],[],!1,null),this._parent=e.parentfeatureset,this._databaseType=h.Standardised}async _getSet(){return this._wset}optimisePagingFeatureQueries(){}_isInFeatureSet(){return F.NotInFeatureSet}async _getFeature(){throw new m(y.NeverReach)}async queryAttachments(){return[]}async _getFeatures(){return"success"}_featureFromCache(){return null}async _fetchAndRefineFeatures(){throw new m(y.NeverReach)}async _getFilteredSet(){return new D([],[],!1,null)}_stat(e,t,n,a,s,i,l){return this._manualStat(e,t,i,l)}async _canDoAggregates(){return!1}}class I extends _{constructor(e){super(e),this._relation="",this._relationGeom=null,this._relationString="",this.declaredClass="esri.arcade.featureset.actions.SpatialFilter",this._relationString=e.relationString,this._parent=e.parentfeatureset,this._maxProcessing=40,this._relation=e.relation,this._relationGeom=e.relationGeom}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._parent._getFilteredSet(this._relation!=="esriSpatialRelRelation"?this._relation:this._relation+":"+this._relationString,this._relationGeom,null,null,e);return this._checkCancelled(e),this._wset=new D(t._candidates.slice(0),t._known.slice(0),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){let t=this._parent._isInFeatureSet(e);return t===F.NotInFeatureSet?t:(t=this._idstates[e],t===void 0?F.Unknown:t)}_getFeature(e,t,n){return this._parent._getFeature(e,t,n)}_getFeatures(e,t,n,a){return this._parent._getFeatures(e,t,n,a)}_featureFromCache(e){return this._parent._featureFromCache(e)}async executeSpatialRelationTest(e){if(e.geometry===null)return!1;switch(this._relation){case"esriSpatialRelEnvelopeIntersects":return Y(H(this._relationGeom),H(e.geometry));case"esriSpatialRelIntersects":return Y(this._relationGeom,e.geometry);case"esriSpatialRelContains":return Se(this._relationGeom,e.geometry);case"esriSpatialRelOverlaps":return ye(this._relationGeom,e.geometry);case"esriSpatialRelWithin":return me(this._relationGeom,e.geometry);case"esriSpatialRelTouches":return ge(this._relationGeom,e.geometry);case"esriSpatialRelCrosses":return fe(this._relationGeom,e.geometry);case"esriSpatialRelRelation":return _e(this._relationGeom,e.geometry,this._relationString??"")}}async _fetchAndRefineFeatures(e,t,n){var l;const a=new D([],e,!1,null),s=Math.min(t,e.length);await((l=this._parent)==null?void 0:l._getFeatures(a,-1,s,n)),this._checkCancelled(n);const i=[];for(let o=0;oX.createFromGraphicLikeObject(a.geometry,a.attributes,this._parent,t))}nextBatch(e){if(this._parent._mainSetInUse!==null)return this._parent._mainSetInUse.then(a=>this.nextBatch(e),a=>this.nextBatch(e));const t={returnpromise:null,hasset:!1},n=[];return t.returnpromise=new Promise((a,s)=>{this._parent._getSet(this._progress).then(i=>{const l=i._known;let o=l.length-1;if(l[l.length-1]==="GETPAGES"&&(o-=1),this._lastId+e>o&&l.length>0&&l[l.length-1]==="GETPAGES")return void this._parent._expandPagedSet(i,this._parent._maxQueryRate(),0,0,this._progress).then(c=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(a,s)},c=>{t.hasset=!0,this._parent._mainSetInUse=null,s(c)});const u=i._candidates;if(o>=this._lastId+e||u.length===0){for(let c=0;c=l.length)break;n[c]=l[p]}return this._lastId+=n.length,n.length===0&&(t.hasset=!0,this._parent._mainSetInUse=null,a([])),void this._parent._getFeatureBatch(n,this._progress).then(c=>{t.hasset=!0,this._parent._mainSetInUse=null,a(c)},c=>{t.hasset=!0,this._parent._mainSetInUse=null,s(c)})}this._parent._refineSetBlock(i,this._parent._maxProcessingRate(),this._progress).then(()=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(a,s)},c=>{t.hasset=!0,this._parent._mainSetInUse=null,s(c)})},i=>{t.hasset=!0,this._parent._mainSetInUse=null,s(i)})}),t.hasset===!1&&(this._parent._mainSetInUse=t.returnpromise,t.hasset=!0),t.returnpromise}next(){if(this._parent._mainSetInUse!==null)return this._parent._mainSetInUse.then(t=>this.next(),t=>this.next());const e={returnpromise:null,hasset:!1};return e.returnpromise=new Promise((t,n)=>{this._parent._getSet(this._progress).then(a=>{const s=a._known;this._lastId(e.hasset=!0,this._parent._mainSetInUse=null,this.next())).then(t,n):(this._lastId+=1,this._parent._getFeature(a,s[this._lastId],this._progress).then(i=>{e.hasset=!0,this._parent._mainSetInUse=null,t(i)},i=>{e.hasset=!0,this._parent._mainSetInUse=null,n(i)})):a._candidates.length>0?this._parent._refineSetBlock(a,this._parent._maxProcessingRate(),this._progress).then(()=>{e.hasset=!0,this._parent._mainSetInUse=null,this.next().then(t,n)},i=>{e.hasset=!0,this._parent._mainSetInUse=null,n(i)}):(e.hasset=!0,this._parent._mainSetInUse=null,t(null))},a=>{e.hasset=!0,this._parent._mainSetInUse=null,n(a)})}),e.hasset===!1&&(this._parent._mainSetInUse=e.returnpromise,e.hasset=!0),e.returnpromise}async count(){if(this._parent._totalCount!==-1)return this._parent._totalCount;const e=await this._parent._getSet(this._progress),t=await this._refineAllSets(e);return this._parent._totalCount=t._known.length,this._parent._totalCount}async _refineAllSets(e){if(e._known.length>0&&e._known[e._known.length-1]==="GETPAGES")return await this._parent._expandPagedSet(e,this._parent._maxQueryRate(),0,1,this._progress),this._refineAllSets(e);if(e._candidates.length>0){if(e._known[e._candidates.length-1]==="GETPAGES")return await this._parent._expandPagedSet(e,this._parent._maxQueryRate(),0,2,this._progress),this._refineAllSets(e);const t=await this._parent._refineSetBlock(e,this._parent._maxProcessingRate(),this._progress);return t._candidates.length>0?this._refineAllSets(t):t}return e}}class D{constructor(e,t,n,a){this._lastFetchedIndex=0,this._ordered=!1,this.pagesDefinition=null,this._candidates=e,this._known=t,this._ordered=n,this.pagesDefinition=a}}function K(r,e){return d(r==null?void 0:r.parseTree,e,r==null?void 0:r.parameters)}function Ye(r,e,t){return d(r,e,t)}function Ke(r,e,t,n){return T.create(d(r.parseTree,h.Standardised,r.parameters,e,t),n,r.timeZone)}function Qe(r,e,t="AND"){return T.create("(("+K(r,h.Standardised)+")"+t+"("+K(e,h.Standardised)+"))",r.fieldsIndex,r.timeZone)}function d(r,e,t,n=null,a=null){let s,i,l,o;switch(r.type){case"interval":return Ee(d(r.value,e,t,n,a),r.qualifier,r.op);case"case-expression":{let u=" CASE ";r.format==="simple"&&(u+=d(r.operand,e,t,n,a));for(let c=0;c":case"<":case">":case">=":case"<=":case"=":case"*":case"-":case"+":case"/":return" ("+d(r.left,e,t,n,a)+" "+r.operator+" "+d(r.right,e,t,n,a)+") ";case"||":return" ("+d(r.left,e,t,n,a)+" "+(e===h.SqlServer?"+":r.operator)+" "+d(r.right,e,t,n,a)+") "}throw new f(g.UnsupportedOperator,{operator:r.operator});case"null":return"null";case"boolean":return r.value===!0?"1":"0";case"string":return"'"+r.value.toString().replaceAll("'","''")+"'";case"timestamp":return`timestamp '${r.value}'`;case"date":return`date '${r.value}'`;case"time":return`time '${r.value}'`;case"number":return r.value.toString();case"current-time":return Fe(r.mode==="date",e);case"column-reference":return n?n.toLowerCase()===r.column.toLowerCase()?"("+a+")":r.delimited===!0?`"${r.column.split('"').join('""')}"`:r.column:r.column;case"data-type":return r.value;case"function":{const u=d(r.args,e,t,n,a);return Ie(r.name,u,e)}}throw new f(g.UnsupportedSyntax,{node:r.type})}function Ie(r,e,t){switch(r.toLowerCase().trim()){case"cos":case"sin":case"tan":case"cosh":case"tanh":case"sinh":case"acos":case"asin":case"atan":case"floor":case"log10":case"log":case"abs":if(e.length!==1)throw new f(g.InvalidFunctionParameters,{function:r.toLowerCase().trim()});return`${r.toUpperCase().trim()}(${e[0]})`;case"ceiling":case"ceil":if(e.length!==1)throw new f(g.InvalidFunctionParameters,{function:"ceiling"});switch(t){case h.Standardised:case h.StandardisedNoInterval:}return"CEILING("+e[0]+")";case"mod":case"power":case"nullif":if(e.length!==2)throw new f(g.InvalidFunctionParameters,{function:r.toLowerCase().trim()});return`${r.toUpperCase().trim()}(${e[0]},${e[1]})`;case"round":if(e.length===2)return"ROUND("+e[0]+","+e[1]+")";if(e.length===1)return"ROUND("+e[0]+")";throw new f(g.InvalidFunctionParameters,{function:"round"});case"truncate":if(e.length<1||e.length>2)throw new f(g.InvalidFunctionParameters,{function:"truncate"});return t===h.SqlServer?"ROUND("+e[0]+(e.length===1?"0":","+e[1])+",1)":"TRUNCATE("+e[0]+(e.length===1?")":","+e[1]+")");case"char_length":case"len":if(e.length!==1)throw new f(g.InvalidFunctionParameters,{function:"char_length"});switch(t){case h.SqlServer:return"LEN("+e[0]+")";case h.Oracle:return"LENGTH("+e[0]+")";default:return"CHAR_LENGTH("+e[0]+")"}case"coalesce":case"concat":{if(e.length<1)throw new f(g.InvalidFunctionParameters,{function:r.toLowerCase()});let n=r.toUpperCase().trim()+"(";for(let a=0;a":case"<":case">":case">=":case"<=":case"=":return"boolean";case"IS":case"ISNOT":if(e.right.type!=="null")throw new f(g.UnsupportedIsRhs);return"boolean";case"*":case"-":case"+":case"/":return C([S(r,e.left,t,n),S(r,e.right,t,n)]);case"||":return"string";default:throw new f(g.UnsupportedOperator,{operator:e.operator})}case"null":return"";case"boolean":return"boolean";case"string":return"string";case"number":return e.value===null?"":e.value%1==0?"integer":"double";case"date":return"date";case"timestamp":return e.withtimezone?"timestamp-offset":"date";case"time":return"time-only";case"current-time":return"date";case"column-reference":{const c=r[e.column.toLowerCase()];return c===void 0?"":c}case"function":switch(e.name.toLowerCase()){case"cast":switch(((i=(s=e.args)==null?void 0:s.value[1])==null?void 0:i.value.type)??""){case"integer":case"smallint":return"integer";case"real":case"float":return"double";case"date":case"timestamp":return((u=(o=(l=e.args)==null?void 0:l.value[1])==null?void 0:o.value)==null?void 0:u.withtimezone)===!0?"timestamp-offset":"date";case"time":return"time-only";case"varchar":return"string";default:return""}case"position":case"extract":case"char_length":case"mod":return"integer";case"round":if(a=S(r,e.args,t,n),a instanceof Array){if(a.length<=0)return"double";a=a[0]}return a;case"sign":return"integer";case"ceiling":case"floor":case"abs":return a=S(r,e.args,t,n),a instanceof Array&&(a=C(a)),a==="integer"||a==="double"?a:"double";case"area":case"length":case"log":case"log10":case"sin":case"cos":case"tan":case"asin":case"acos":case"atan":case"cosh":case"sinh":case"tanh":case"power":return"double";case"substring":case"trim":case"concat":case"lower":case"upper":return"string";case"truncate":return"double";case"nullif":case"coalesce":return a=S(r,e.args,t,n),a instanceof Array?a.length>0?a[0]:"":a}return""}throw new f(g.UnsupportedSyntax,{node:e.type})}const V={boolean:1,string:2,integer:3,double:4,date:5};function C(r){if(r){let e="";for(const t of r)t!==""&&(e=e===""||V[e]=e&&e!==-1)return t}return t}function Ve(r){switch(r.toLowerCase()){case"distinct":return"distinct";case"avg":case"mean":return"avg";case"min":return"min";case"sum":return"sum";case"max":return"max";case"stdev":case"stddev":return"stddev";case"var":case"variance":return"var";case"count":return"count"}return""}function je(r,e,t=1e3){switch(r.toLowerCase()){case"distinct":return Ae(e,t);case"avg":case"mean":return A(e);case"min":return Math.min.apply(Math,e);case"sum":return $(e);case"max":return Math.max.apply(Math,e);case"stdev":case"stddev":return Math.sqrt(j(e));case"var":case"variance":return j(e);case"count":return e.length}return 0}async function Re(r,e,t){const n=await v(r,e,t,!0);return n.length===0?null:Math.min.apply(Math,n)}async function Ce(r,e,t){const n=await v(r,e,t,!0);return n.length===0?null:Math.max.apply(Math,n)}async function Ne(r,e,t){let n="";e&&!De(e)&&(n=be(e,r.fields));const a=await v(r,e,t,!0);if(a.length===0)return null;const s=A(a);return s===null?s:n==="integer"?ve(s):s}async function Pe(r,e,t){const n=await v(r,e,t,!0);return n.length===0?null:z(n)}async function ke(r,e,t){const n=await v(r,e,t,!0);return n.length===0?null:Math.sqrt(z(n))}async function Le(r,e,t){const n=await v(r,e,t,!0);return n.length===0?null:$(n)}async function xe(r,e){return r.iterator(e).count()}async function v(r,e,t,n=!1){const a=r.iterator(t),s=[],i={ticker:0};let l=await a.next();for(;l!==null;){if(i.ticker++,t.aborted)throw new m(y.Cancelled);i.ticker%100==0&&(i.ticker=0,await new Promise(u=>{setTimeout(u,0)}));const o=e==null?void 0:e.calculateValue(l);o===null?n===!1&&(s[s.length]=o):s[s.length]=o instanceof W||o instanceof M?o.toNumber():o instanceof J?o.toMilliseconds():o,l=await a.next()}return s}async function Oe(r,e,t=1e3,n=null){const a=r.iterator(n),s=[],i={},l={ticker:0};let o=await a.next();for(;o!==null;){if(l.ticker++,n&&n.aborted)throw new m(y.Cancelled);l.ticker%100==0&&(l.ticker=0,await new Promise(p=>{setTimeout(p,0)}));const u=e==null?void 0:e.calculateValue(o);let c=u;if(u instanceof W?c="!!DATEONLY!!-"+u.toString():u instanceof J?c="!!TSOFFSETONLY!!-"+u.toString():u instanceof M?c="!!TIMEONLY!!-"+u.toString():u instanceof Date&&(c="!!DATE!!-"+u.toString()),u!=null&&i[c]===void 0&&(s.push(u),i[c]=1),s.length>=t&&t!==-1)return s;o=await a.next()}return s}class _{constructor(e){this.recentlyUsedQueries=null,this.featureSetQueryInterceptor=null,this._idstates=[],this._parent=null,this._wset=null,this._mainSetInUse=null,this._maxProcessing=200,this._maxQuery=500,this._totalCount=-1,this._databaseType=h.NotEvaluated,this._databaseTypeProbed=null,this.declaredRootClass="esri.arcade.featureset.support.FeatureSet",this._featureCache=[],this.typeIdField=null,this.types=null,this.subtypeField=null,this.subtypes=null,this.fields=null,this.geometryType="",this.objectIdField="",this.globalIdField="",this.spatialReference=null,this.hasM=!1,this.hasZ=!1,this._transparent=!1,this.loaded=!1,this._loadPromise=null,this._fieldsIndex=null,this.fsetInfo=null,e!=null&&e.lrucache&&(this.recentlyUsedQueries=e.lrucache),e!=null&&e.interceptor&&(this.featureSetQueryInterceptor=e.interceptor)}optimisePagingFeatureQueries(e){this._parent&&this._parent.optimisePagingFeatureQueries(e)}_hasMemorySource(){return!0}prop(e,t){return t===void 0?this[e]:(this[e]!==void 0&&(this[e]=t),this)}end(){return this._parent!==null&&this._parent._transparent===!0?this._parent.end():this._parent}_ensureLoaded(){return this.load()}load(){return this._loadPromise===null&&(this._loadPromise=this.loadImpl()),this._loadPromise}async loadImpl(){var e,t;return((e=this._parent)==null?void 0:e.loaded)===!0?(this._initialiseFeatureSet(),this):(await((t=this._parent)==null?void 0:t.load()),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){this._parent!==null?(this.fields=this._parent.fields.slice(0),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types,this.subtypeField=this._parent.subtypeField,this.subtypes=this._parent.subtypes):(this.fields=[],this.typeIdField="",this.subtypeField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new oe({wkid:4326}),this.geometryType=ae.point)}getField(e,t){let n;return(t=t||this.fields)&&(e=e.toLowerCase(),t.some(a=>(a&&a.name.toLowerCase()===e&&(n=a),!!n))),n}getFieldsIndex(){return this._fieldsIndex===null&&(this._fieldsIndex=we.fromLayer({timeInfo:this.timeInfo,editFieldsInfo:this.editFieldsInfo,dateFieldsTimeZone:this.dateFieldsTimeZone,datesInUnknownTimezone:this.datesInUnknownTimezone,fields:this.fields})),this._fieldsIndex}_maxProcessingRate(){return this._parent!==null?Math.min(this._maxProcessing,this._parent._maxProcessingRate()):Math.min(this._maxProcessing,this._maxQueryRate())}_maxQueryRate(){return this._parent!==null?Math.max(this._maxQuery,this._parent._maxQueryRate()):this._maxQuery}_checkCancelled(e){if(e!=null&&e.aborted)throw new m(y.Cancelled)}nativeCapabilities(){return this._parent.nativeCapabilities()}async _canDoAggregates(e,t,n,a,s){return this._parent!==null&&this._parent._canDoAggregates(e,t,n,a,s)}async _getAggregatePagesDataSourceDefinition(e,t,n,a,s,i,l){if(this._parent===null)throw new m(y.NeverReach);return this._parent._getAggregatePagesDataSourceDefinition(e,t,n,a,s,i,l)}async _getAgregagtePhysicalPage(e,t,n){if(this._parent===null)throw new m(y.NeverReach);return this._parent._getAgregagtePhysicalPage(e,t,n)}async databaseType(){if(this._databaseType===h.NotEvaluated){if(E.applicationCache!==null){const e=E.applicationCache.getDatabaseType(this._cacheableFeatureSetSourceKey());if(e!==null)return e}if(this._databaseTypeProbed!==null)return this._databaseTypeProbed;try{this._databaseTypeProbed=this._getDatabaseTypeImpl(),E.applicationCache!==null&&E.applicationCache.setDatabaseType(this._cacheableFeatureSetSourceKey(),this._databaseTypeProbed)}catch(e){throw E.applicationCache!==null&&E.applicationCache.clearDatabaseType(this._cacheableFeatureSetSourceKey()),e}return this._databaseTypeProbed}return this._databaseType}async _getDatabaseTypeImpl(){const e=[{thetype:h.SqlServer,testwhere:"(CAST( '2015-01-01' as DATETIME) = CAST( '2015-01-01' as DATETIME)) AND OBJECTID<0"},{thetype:h.Oracle,testwhere:"(TO_DATE('2003-11-18','YYYY-MM-DD') = TO_DATE('2003-11-18','YYYY-MM-DD')) AND OBJECTID<0"},{thetype:h.StandardisedNoInterval,testwhere:"(date '2015-01-01 10:10:10' = date '2015-01-01 10:10:10') AND OBJECTID<0"}];for(const t of e)if(await this._runDatabaseProbe(t.testwhere)===!0)return t.thetype;return h.StandardisedNoInterval}_cacheableFeatureSetSourceKey(){return"MUSTBESET"}async _runDatabaseProbe(e){if(this._parent!==null)return this._parent._runDatabaseProbe(e);throw new m(y.NotImplemented)}isTable(){var e;return((e=this._parent)==null?void 0:e.isTable())??!1}_featureFromCache(e){if(this._featureCache[e]!==void 0)return this._featureCache[e]}_isInFeatureSet(e){return F.Unknown}_getSet(e){throw new m(y.NotImplemented)}async _getFeature(e,t,n){if(this._checkCancelled(n),this._featureFromCache(t)!==void 0)return this._featureFromCache(t);if(await this._getFeatures(e,t,this._maxProcessingRate(),n),this._checkCancelled(n),this._featureFromCache(t)!==void 0)return this._featureFromCache(t);throw new m(y.MissingFeatures)}async _getFeatureBatch(e,t){this._checkCancelled(t);const n=new D([],e,!1,null),a=[];await this._getFeatures(n,-1,e.length,t),this._checkCancelled(t);for(const s of e)this._featureFromCache(s)!==void 0&&a.push(this._featureFromCache(s));return a}async _getFeatures(e,t,n,a){return"success"}_getFilteredSet(e,t,n,a,s){throw new m(y.NotImplemented)}async _refineSetBlock(e,t,n){if(this._checkIfNeedToExpandCandidatePage(e,this._maxQueryRate())===!0)return await this._expandPagedSet(e,this._maxQueryRate(),0,0,n),this._refineSetBlock(e,t,n);this._checkCancelled(n);const a=e._candidates.length;this._refineKnowns(e,t);let s=a-e._candidates.length;if(e._candidates.length===0||s>=t)return e;if(await this._refineIfParentKnown(e,t-s,n),this._checkCancelled(n),this._refineKnowns(e,t-s),s=a-e._candidates.length,s0){const i=t-s,l=this._prepareFetchAndRefineSet(e._candidates);return await this._fetchAndRefineFeatures(l,l.length>i?i:e._candidates.length,n),this._checkCancelled(n),this._refineKnowns(e,t-s),e}return e}_fetchAndRefineFeatures(e,t,n){return null}_prepareFetchAndRefineSet(e){const t=[];for(let n=0;n=t)break}a!==null&&s.push(a);for(let i=s.length-1;i>=0;i--)e._candidates.splice(s[i].start,s[i].end-s[i].start+1)}_refineIfParentKnown(e,t,n){const a=new D([],[],e._ordered,null);return a._candidates=e._candidates.slice(0),this._parent._refineSetBlock(a,t,n)}_candidateIdTransform(e){return this._parent._candidateIdTransform(e)}_checkIfNeedToExpandKnownPage(e,t){if(e.pagesDefinition===null)return!1;let n=0;for(let a=e._lastFetchedIndex;a=t))break}return!1}_checkIfNeedToExpandCandidatePage(e,t){if(e.pagesDefinition===null)return!1;let n=0;for(let a=0;a=t)break}return!1}async _expandPagedSet(e,t,n,a,s){if(this._parent===null)throw new m(y.NotImplemented);return this._parent._expandPagedSet(e,t,n,a,s)}async _expandPagedSetFeatureSet(e,t,n,a,s){if(e._known.length>0&&e._known[e._known.length-1]==="GETPAGES"&&(a=1),a===0&&e._candidates.length>0&&e._candidates[e._candidates.length-1]==="GETPAGES"&&(a=2),a===0)return"finished";const i=await this._getPage(e,a,s);return n+ie.pagesDefinition.resultOffset||e.pagesDefinition.internal.fullyResolved===!0){a.length=a.length-1;let s=0;for(let l=0;l=e.pagesDefinition.internal.set.length);l++)a[a.length]=e.pagesDefinition.internal.set[e.pagesDefinition.resultOffset+l],s++;e.pagesDefinition.resultOffset+=s;let i=!1;return e.pagesDefinition.internal.fullyResolved===!0&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset&&(i=!0),i===!1&&a.push("GETPAGES"),s}return await this._getPhysicalPage(e,t,n),this._getPage(e,t,n)}_getPhysicalPage(e,t,n){return null}_clonePageDefinition(e){return this._parent===null?null:this._parent._clonePageDefinition(e)}_first(e){return this.iterator(e).next()}first(e){return this._first(e)}async calculateStatistic(e,t,n,a){await this._ensureLoaded();let s=await this._stat(e,t,"",null,null,n,a);return s.calculated===!1&&(s=await this._manualStat(e,t,n,a)),s.result}async _manualStat(e,t,n,a){let s=null;switch(e.toLowerCase()){case"count":return s=await xe(this,a),{calculated:!0,result:s};case"distinct":return s=await Oe(this,t,n,a),{calculated:!0,result:s};case"avg":case"mean":return s=await Ne(this,t,a),{calculated:!0,result:s};case"stdev":return s=await ke(this,t,a),{calculated:!0,result:s};case"variance":return s=await Pe(this,t,a),{calculated:!0,result:s};case"sum":return s=await Le(this,t,a),{calculated:!0,result:s};case"min":return s=await Re(this,t,a),{calculated:!0,result:s};case"max":return s=await Ce(this,t,a),{calculated:!0,result:s};default:return{calculated:!0,result:0}}}async _stat(e,t,n,a,s,i,l){const o=await this._parent._stat(e,t,n,a,s,i,l);return o.calculated===!1?s===null&&n===""&&a===null?this._manualStat(e,t,i,l):{calculated:!1}:o}_unionAllGeomSelf(e){const t=this.iterator(this._defaultTracker(e)),n=[];return new Promise((a,s)=>{this._unionShapeInBatches(n,t,a,s)})}_unionAllGeom(e){return new Promise((t,n)=>{const a=this.iterator(this._defaultTracker(e)),s=[];this._unionShapeInBatches(s,a,t,n)})}_unionShapeInBatches(e,t,n,a){t.next().then(s=>{try{s!==null&&s.geometry!==null&&e.push(s.geometry),e.length>30||s===null&&e.length>1?ue(e).then(i=>{try{s===null?n(i):(e=[i],this._unionShapeInBatches(e,t,n,a))}catch(l){a(l)}},a):s===null?e.length===1?n(e[0]):n(null):this._unionShapeInBatches(e,t,n,a)}catch(i){a(i)}},a)}iterator(e){return new Te(this,e)}intersection(e,t=!1){return _._featuresetFunctions.intersection.bind(this)(e,t)}difference(e,t=!1,n=!0){return _._featuresetFunctions.difference.bind(this)(e,t,n)}symmetricDifference(e,t=!1,n=!0){return _._featuresetFunctions.symmetricDifference.bind(this)(e,t,n)}morphShape(e,t,n="unknown",a=null){return _._featuresetFunctions.morphShape.bind(this)(e,t,n,a)}morphShapeAndAttributes(e,t,n="unknown"){return _._featuresetFunctions.morphShapeAndAttributes.bind(this)(e,t,n)}union(e,t=!1){return _._featuresetFunctions.union.bind(this)(e,t)}intersects(e){return _._featuresetFunctions.intersects.bind(this)(e)}envelopeIntersects(e){return _._featuresetFunctions.envelopeIntersects.bind(this)(e)}contains(e){return _._featuresetFunctions.contains.bind(this)(e)}overlaps(e){return _._featuresetFunctions.overlaps.bind(this)(e)}relate(e,t){return _._featuresetFunctions.relate.bind(this)(e,t)}within(e){return _._featuresetFunctions.within.bind(this)(e)}touches(e){return _._featuresetFunctions.touches.bind(this)(e)}top(e){return _._featuresetFunctions.top.bind(this)(e)}crosses(e){return _._featuresetFunctions.crosses.bind(this)(e)}buffer(e,t,n,a=!0){return _._featuresetFunctions.buffer.bind(this)(e,t,n,a)}filter(e,t=null){return _._featuresetFunctions.filter.bind(this)(e,t)}orderBy(e){return _._featuresetFunctions.orderBy.bind(this)(e)}dissolve(e,t){return _._featuresetFunctions.dissolve.bind(this)(e,t)}groupby(e,t){return _._featuresetFunctions.groupby.bind(this)(e,t)}reduce(e,t=null,n){return new Promise((a,s)=>{this._reduceImpl(this.iterator(this._defaultTracker(n)),e,t,0,a,s,0)})}_reduceImpl(e,t,n,a,s,i,l){try{if(++l>1e3)return void setTimeout(()=>{l=0,this._reduceImpl(e,t,n,a,s,i,l)});e.next().then(o=>{try{if(o===null)s(n);else{const u=t(n,o,a,this);Z(u)?u.then(c=>{this._reduceImpl(e,t,c,a+1,s,i,l)},i):this._reduceImpl(e,t,u,a+1,s,i,l)}}catch(u){i(u)}},i)}catch(o){i(o)}}removeField(e){return _._featuresetFunctions.removeField.bind(this)(e)}addField(e,t,n=null){return _._featuresetFunctions.addField.bind(this)(e,t,n)}sumArea(e,t=!1,n){const a=re(e);return this.reduce((s,i)=>i.geometry===null?0:t?ce(i.geometry,a).then(l=>s+l):he(i.geometry,a).then(l=>s+l),0,n)}sumLength(e,t=!1,n){const a=se(e);return this.reduce((s,i)=>i.geometry===null?0:t?de(i.geometry,a).then(l=>s+l):pe(i.geometry,a).then(l=>s+l),0,n)}_substituteVars(e,t){if(t!==null){const n={};for(const a in t)n[a.toLowerCase()]=t[a];e.parameters=n}}async distinct(e,t=1e3,n=null,a){await this.load();const s=T.create(e,this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC);return this._substituteVars(s,n),this.calculateStatistic("distinct",s,t,this._defaultTracker(a))}async min(e,t=null,n){await this.load();const a=T.create(e,this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC);return this._substituteVars(a,t),this.calculateStatistic("min",a,-1,this._defaultTracker(n))}async max(e,t=null,n){await this.load();const a=T.create(e,this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC);return this._substituteVars(a,t),this.calculateStatistic("max",a,-1,this._defaultTracker(n))}async avg(e,t=null,n){await this.load();const a=T.create(e,this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC);return this._substituteVars(a,t),this.calculateStatistic("avg",a,-1,this._defaultTracker(n))}async sum(e,t=null,n){await this.load();const a=T.create(e,this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC);return this._substituteVars(a,t),this.calculateStatistic("sum",a,-1,this._defaultTracker(n))}async stdev(e,t=null,n){await this.load();const a=T.create(e,this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC);return this._substituteVars(a,t),this.calculateStatistic("stdev",a,-1,this._defaultTracker(n))}async variance(e,t=null,n){await this.load();const a=T.create(e,this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC);return this._substituteVars(a,t),this.calculateStatistic("variance",a,-1,this._defaultTracker(n))}async count(e){return await this.load(),this.calculateStatistic("count",T.create("1",this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC),-1,this._defaultTracker(e))}_defaultTracker(e){return e??{aborted:!1}}forEach(e,t){return new Promise((n,a)=>{this._forEachImpl(this.iterator(this._defaultTracker(t)),e,this,n,a,0)})}_forEachImpl(e,t,n,a,s,i){try{if(++i>1e3)return void setTimeout(()=>{i=0,this._forEachImpl(e,t,n,a,s,i)},0);e.next().then(l=>{try{if(l===null)a(n);else{const o=t(l);o==null?this._forEachImpl(e,t,n,a,s,i):Z(o)?o.then(()=>{try{this._forEachImpl(e,t,n,a,s,i)}catch(u){s(u)}},s):this._forEachImpl(e,t,n,a,s,i)}}catch(o){s(o)}},s)}catch(l){s(l)}}convertToJSON(e){const t={layerDefinition:{geometryType:this.geometryType,fields:[]},featureSet:{features:[],geometryType:this.geometryType}};for(let n=0;n{var i;const s={geometry:(i=a.geometry)==null?void 0:i.toJSON(),attributes:{}};for(const l in a.attributes)s.attributes[l]=a.attributes[l];return t.featureSet.features.push(s),1},0,e).then(()=>t)}castToText(e=!1){return"object, FeatureSet"}queryAttachments(e,t,n,a,s){return this._parent.queryAttachments(e,t,n,a,s)}serviceUrl(){return this._parent.serviceUrl()}subtypeMetaData(){return this.subtypeField&&this.subtypes?{subtypeField:this.subtypeField,subtypes:this.subtypes?this.subtypes.map(e=>({name:e.name,code:e.code})):[]}:this.typeIdField?{subtypeField:this.typeIdField,subtypes:this.types?this.types.map(e=>({name:e.name,code:e.id})):[]}:null}relationshipMetaData(){return this._parent.relationshipMetaData()}get gdbVersion(){return this._parent?this._parent.gdbVersion:""}schema(){const e=[];for(const t of this.fields)e.push(G(t));return{objectIdField:this.objectIdField,globalIdField:this.globalIdField,geometryType:B[this.geometryType]===void 0?"esriGeometryNull":B[this.geometryType],fields:e}}async convertToText(e,t){if(e==="schema")return await this._ensureLoaded(),JSON.stringify(this.schema());if(e==="featureset"){await this._ensureLoaded();const n=[];await this.reduce((s,i)=>{const l={geometry:i.geometry?i.geometry.toJSON():null,attributes:i.attributes};return l.geometry!==null&&l.geometry.spatialReference&&delete l.geometry.spatialReference,n.push(l),1},0,t);const a=this.schema();return a.features=n,a.spatialReference=this.spatialReference.toJSON(),JSON.stringify(a)}return this.castToText()}getFeatureByObjectId(e,t){return this._parent.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._parent.getOwningSystemUrl()}getIdentityUser(){return this._parent.getIdentityUser()}getRootFeatureSet(){return this._parent!==null?this._parent.getRootFeatureSet():this}getDataSourceFeatureSet(){return this._parent!==null?this._parent.getDataSourceFeatureSet():this}castAsJson(e=null){return(e==null?void 0:e.featureset)==="keeptype"?this:(e==null?void 0:e.featureset)==="none"?null:{type:"FeatureSet"}}async castAsJsonAsync(e=null,t=null){var s;if((t==null?void 0:t.featureset)==="keeptype")return this;if((t==null?void 0:t.featureset)==="schema")return await this._ensureLoaded(),JSON.parse(JSON.stringify(this.schema()));if((t==null?void 0:t.featureset)==="none")return null;await this._ensureLoaded();const n=[];await this.reduce((i,l)=>{const o={geometry:l.geometry?(t==null?void 0:t.keepGeometryType)===!0?l.geometry:l.geometry.toJSON():null,attributes:l.attributes};return o.geometry!==null&&o.geometry.spatialReference&&(t==null?void 0:t.keepGeometryType)!==!0&&delete o.geometry.spatialReference,n.push(o),1},0,e);const a=this.schema();return a.features=n,a.spatialReference=(t==null?void 0:t.keepGeometryType)===!0?this.spatialReference:(s=this.spatialReference)==null?void 0:s.toJSON(),a}fieldTimeZone(e){return this.getFieldsIndex().getTimeZone(e)}get preferredTimeZone(){var e;return((e=this._parent)==null?void 0:e.preferredTimeZone)??null}get dateFieldsTimeZone(){var e;return((e=this._parent)==null?void 0:e.dateFieldsTimeZone)??null}get dateFieldsTimeZoneDefaultUTC(){if(this.datesInUnknownTimezone)return"unknown";const e=this.dateFieldsTimeZone??"UTC";return e===""?"UTC":e}get datesInUnknownTimezone(){return this._parent.datesInUnknownTimezone}get editFieldsInfo(){var e;return((e=this._parent)==null?void 0:e.editFieldsInfo)??null}get timeInfo(){var e;return((e=this._parent)==null?void 0:e.timeInfo)??null}set featureSetInfo(e){this.fsetInfo=e}async getFeatureSetInfo(){var e;return this.fsetInfo??await((e=this._parent)==null?void 0:e.getFeatureSetInfo())??null}}_._featuresetFunctions={};class b extends _{constructor(e){super(e),this.declaredClass="esri.layers.featureset.sources.Empty",this._maxProcessing=1e3,this._wset=new D([],[],!1,null),this._parent=e.parentfeatureset,this._databaseType=h.Standardised}async _getSet(){return this._wset}optimisePagingFeatureQueries(){}_isInFeatureSet(){return F.NotInFeatureSet}async _getFeature(){throw new m(y.NeverReach)}async queryAttachments(){return[]}async _getFeatures(){return"success"}_featureFromCache(){return null}async _fetchAndRefineFeatures(){throw new m(y.NeverReach)}async _getFilteredSet(){return new D([],[],!1,null)}_stat(e,t,n,a,s,i,l){return this._manualStat(e,t,i,l)}async _canDoAggregates(){return!1}}class I extends _{constructor(e){super(e),this._relation="",this._relationGeom=null,this._relationString="",this.declaredClass="esri.arcade.featureset.actions.SpatialFilter",this._relationString=e.relationString,this._parent=e.parentfeatureset,this._maxProcessing=40,this._relation=e.relation,this._relationGeom=e.relationGeom}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._parent._getFilteredSet(this._relation!=="esriSpatialRelRelation"?this._relation:this._relation+":"+this._relationString,this._relationGeom,null,null,e);return this._checkCancelled(e),this._wset=new D(t._candidates.slice(0),t._known.slice(0),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){let t=this._parent._isInFeatureSet(e);return t===F.NotInFeatureSet?t:(t=this._idstates[e],t===void 0?F.Unknown:t)}_getFeature(e,t,n){return this._parent._getFeature(e,t,n)}_getFeatures(e,t,n,a){return this._parent._getFeatures(e,t,n,a)}_featureFromCache(e){return this._parent._featureFromCache(e)}async executeSpatialRelationTest(e){if(e.geometry===null)return!1;switch(this._relation){case"esriSpatialRelEnvelopeIntersects":return Y(H(this._relationGeom),H(e.geometry));case"esriSpatialRelIntersects":return Y(this._relationGeom,e.geometry);case"esriSpatialRelContains":return Se(this._relationGeom,e.geometry);case"esriSpatialRelOverlaps":return ye(this._relationGeom,e.geometry);case"esriSpatialRelWithin":return me(this._relationGeom,e.geometry);case"esriSpatialRelTouches":return ge(this._relationGeom,e.geometry);case"esriSpatialRelCrosses":return fe(this._relationGeom,e.geometry);case"esriSpatialRelRelation":return _e(this._relationGeom,e.geometry,this._relationString??"")}}async _fetchAndRefineFeatures(e,t,n){var l;const a=new D([],e,!1,null),s=Math.min(t,e.length);await((l=this._parent)==null?void 0:l._getFeatures(a,-1,s,n)),this._checkCancelled(n);const i=[];for(let o=0;oZ.fromJSON(m))}writeRestrictionAttributes(e,a,s){e!=null&&(a[s]=e.map(m=>Z.toJSON(m)))}};t([i({type:[Object],json:{write:!0}})],d.prototype,"attributeParameterValues",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"description",void 0),t([x(te,{ignoreUnknown:!1})],d.prototype,"distanceAttributeName",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"id",void 0),t([p("id",["id","itemId"])],d.prototype,"readId",null),t([x(C,{ignoreUnknown:!1})],d.prototype,"impedanceAttributeName",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"name",void 0),t([i({type:[String],json:{write:!0}})],d.prototype,"restrictionAttributeNames",void 0),t([p("restrictionAttributeNames")],d.prototype,"readRestrictionAttributes",null),t([D("restrictionAttributeNames")],d.prototype,"writeRestrictionAttributes",null),t([i({type:Number,json:{write:{allowNull:!0}}})],d.prototype,"simplificationTolerance",void 0),t([x(Q)],d.prototype,"simplificationToleranceUnits",void 0),t([x(ie,{ignoreUnknown:!1})],d.prototype,"timeAttributeName",void 0),t([x(ee)],d.prototype,"type",void 0),t([i({type:Boolean,json:{write:!0}})],d.prototype,"useHierarchy",void 0),t([x($)],d.prototype,"uturnAtJunctions",void 0),d=t([g("esri.rest.support.TravelMode")],d);const ae=d;let v=class extends S{constructor(e){super(e),this.accumulateAttributes=null,this.directionsLanguage=null,this.findBestSequence=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.startTimeIsUTC=null,this.timeWindowsAreUTC=null,this.travelMode=null}readAccumulateAttributes(e){return e==null?null:e.map(a=>C.fromJSON(a))}writeAccumulateAttributes(e,a,s){e!=null&&e.length&&(a[s]=e.map(m=>C.toJSON(m)))}};t([i({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],v.prototype,"accumulateAttributes",void 0),t([p("accumulateAttributes")],v.prototype,"readAccumulateAttributes",null),t([D("accumulateAttributes")],v.prototype,"writeAccumulateAttributes",null),t([i({type:String,json:{write:!0}})],v.prototype,"directionsLanguage",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"findBestSequence",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"preserveFirstStop",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"preserveLastStop",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"startTimeIsUTC",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"timeWindowsAreUTC",void 0),t([i({type:ae,json:{write:!0}})],v.prototype,"travelMode",void 0),v=t([g("esri.layers.support.RouteSettings")],v);const re=v;var K;let l=K=class extends A(S){constructor(e){super(e),this.analysisSettings=null,this.endTime=null,this.endTimeOffset=null,this.firstStopId=null,this.geometry=null,this.lastStopId=null,this.messages=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.startTime=null,this.startTimeOffset=null,this.stopCount=null,this.symbol=null,this.totalCosts=null,this.totalDistance=null,this.totalDuration=null,this.totalLateDuration=null,this.totalViolations=null,this.totalWait=null,this.totalWaitDuration=null,this.type="route-info",this.version="1.0.0"}readEndTime(e,a){return a.attributes.EndTimeUTC!=null?new Date(a.attributes.EndTimeUTC):null}readEndTimeOffset(e,a){return B(a.attributes.EndTime,a.attributes.EndTimeUTC)}readStartTime(e,a){return a.attributes.StartTimeUTC!=null?new Date(a.attributes.StartTimeUTC):null}readStartTimeOffset(e,a){return B(a.attributes.StartTime,a.attributes.StartTimeUTC)}readTotalCosts(e,a){return f(a.attributes,"Total_")}readTotalViolations(e,a){return f(a.attributes,"TotalViolation_")}readTotalWait(e,a){return f(a.attributes,"TotalWait_")}static fromGraphic(e){return new K({analysisSettings:e.attributes.AnalysisSettings!=null?re.fromJSON(JSON.parse(e.attributes.AnalysisSettings)):null,endTime:e.attributes.EndTime!=null?new Date(e.attributes.EndTime):null,endTimeOffset:e.attributes.EndUTCOffset??null,geometry:e.geometry,messages:e.attributes.Messages!=null?JSON.parse(e.attributes.Messages):null,name:e.attributes.RouteName,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,startTime:e.attributes.StartTime!=null?new Date(e.attributes.StartTime):null,startTimeOffset:e.attributes.StartUTCOffset??null,symbol:e.symbol,totalCosts:e.attributes.TotalCosts!=null?E(JSON.parse(e.attributes.TotalCosts)):null,totalDistance:e.attributes.TotalMeters??null,totalDuration:e.attributes.TotalMinutes??null,totalLateDuration:e.attributes.TotalLateMinutes??null,totalWaitDuration:e.attributes.TotalWaitMinutes??null,version:e.attributes.Version})}toGraphic(){const e={ObjectID:this.objectId,AnalysisSettings:this.analysisSettings!=null?JSON.stringify(this.analysisSettings.toJSON()):null,EndTime:this.endTime!=null?this.endTime.getTime():null,EndUTCOffset:this.endTimeOffset,Messages:this.messages!=null?JSON.stringify(this.messages):null,RouteName:this.name,StartTime:this.startTime!=null?this.startTime.getTime():null,StartUTCOffset:this.startTimeOffset,TotalCosts:this.totalCosts!=null?JSON.stringify(j(this.totalCosts)):null,TotalLateMinutes:this.totalLateDuration,TotalMeters:this.totalDistance,TotalMinutes:this.totalDuration,TotalWaitMinutes:this.totalWaitDuration,Version:this.version};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};l.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"AnalysisSettings",alias:"Analysis Settings",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"EndTime",alias:"End Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"EndUTCOffset",alias:"End Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"Messages",alias:"Analysis Messages",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString",length:1024,editable:!0,nullable:!0,visible:!0,domain:null},{name:"StartTime",alias:"Start Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"StartUTCOffset",alias:"Start Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"TotalCosts",alias:"Total Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"TotalLateMinutes",alias:"Total Late Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"TotalMeters",alias:"Total Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"TotalMinutes",alias:"Total Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"TotalWaitMinutes",alias:"Total Wait Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"Version",alias:"Version",type:"esriFieldTypeString",length:16,editable:!0,nullable:!0,visible:!0,domain:null}],l.popupInfo={title:"Route Details",fieldInfos:[{fieldName:"RouteName",label:"Route Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"TotalMinutes",label:"Total Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalMeters",label:"Total Meters",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalLateMinutes",label:"Total Late Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalWaitMinutes",label:"Total Wait Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalCosts",label:"Total Costs",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"StartTime",label:"Start Time",isEditable:!1,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"StartUTCOffset",label:"Start Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"EndTime",label:"End Time",isEditable:!1,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"EndUTCOffset",label:"End Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Messages",label:"Analysis Messages",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"AnalysisSettings",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"Version",label:"Version",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([i()],l.prototype,"analysisSettings",void 0),t([i()],l.prototype,"endTime",void 0),t([p("endTime",["attributes.EndTimeUTC"])],l.prototype,"readEndTime",null),t([i()],l.prototype,"endTimeOffset",void 0),t([p("endTimeOffset",["attributes.EndTime","attributes.EndTimeUTC"])],l.prototype,"readEndTimeOffset",null),t([i({json:{read:{source:"attributes.FirstStopID"}}})],l.prototype,"firstStopId",void 0),t([i({type:z})],l.prototype,"geometry",void 0),t([i({json:{read:{source:"attributes.LastStopID"}}})],l.prototype,"lastStopId",void 0),t([i()],l.prototype,"messages",void 0),t([i({json:{read:{source:"attributes.Name"}}})],l.prototype,"name",void 0),t([i({json:{read:{source:"attributes.ObjectID"}}})],l.prototype,"objectId",void 0),t([i({type:I})],l.prototype,"popupTemplate",void 0),t([i()],l.prototype,"startTime",void 0),t([p("startTime",["attributes.StartTimeUTC"])],l.prototype,"readStartTime",null),t([i()],l.prototype,"startTimeOffset",void 0),t([p("startTimeOffset",["attributes.StartTime","attributes.StartTimeUTC"])],l.prototype,"readStartTimeOffset",null),t([i({json:{read:{source:"attributes.StopCount"}}})],l.prototype,"stopCount",void 0),t([i({types:F})],l.prototype,"symbol",void 0),t([i()],l.prototype,"totalCosts",void 0),t([p("totalCosts",["attributes"])],l.prototype,"readTotalCosts",null),t([i()],l.prototype,"totalDistance",void 0),t([i()],l.prototype,"totalDuration",void 0),t([i()],l.prototype,"totalLateDuration",void 0),t([i()],l.prototype,"totalViolations",void 0),t([p("totalViolations",["attributes"])],l.prototype,"readTotalViolations",null),t([i()],l.prototype,"totalWait",void 0),t([p("totalWait",["attributes"])],l.prototype,"readTotalWait",null),t([i()],l.prototype,"totalWaitDuration",void 0),t([i({readOnly:!0,json:{read:!1}})],l.prototype,"type",void 0),t([i()],l.prototype,"version",void 0),l=K=t([g("esri.rest.support.RouteInfo")],l);const Se=l;var G;let r=G=class extends A(S){constructor(e){super(e),this.arriveCurbApproach=null,this.arriveTime=null,this.arriveTimeOffset=null,this.bearing=null,this.bearingTol=null,this.cumulativeCosts=null,this.cumulativeDistance=null,this.cumulativeDuration=null,this.curbApproach=null,this.departCurbApproach=null,this.departTime=null,this.departTimeOffset=null,this.distanceToNetworkInMeters=null,this.geometry=null,this.lateDuration=null,this.locationType=null,this.name=null,this.navLatency=null,this.objectId=null,this.popupTemplate=null,this.posAlong=null,this.routeName=null,this.serviceCosts=null,this.serviceDistance=null,this.serviceDuration=null,this.sequence=null,this.sideOfEdge=null,this.snapX=null,this.snapY=null,this.snapZ=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.timeWindowEnd=null,this.timeWindowEndOffset=null,this.timeWindowStart=null,this.timeWindowStartOffset=null,this.type="stop",this.violations=null,this.waitDuration=null,this.wait=null}readArriveTimeOffset(e,a){return B(a.attributes.ArriveTime,a.attributes.ArriveTimeUTC)}readCumulativeCosts(e,a){return f(a.attributes,"Cumul_")}readDepartTimeOffset(e,a){return B(a.attributes.DepartTime,a.attributes.DepartTimeUTC)}readServiceCosts(e,a){return f(a.attributes,"Attr_")}writeServiceCosts(e,a){Y(e,a,"Attr_")}writeTimeWindowEnd(e,a){e!=null&&(a.attributes||(a.attributes={}),a.attributes.TimeWindowEnd=e.getTime())}writeTimeWindowStart(e,a){e!=null&&(a.attributes||(a.attributes={}),a.attributes.TimeWindowStart=e.getTime())}readViolations(e,a){return f(a.attributes,"Violation_")}readWait(e,a){return f(a.attributes,"Wait_")}static fromGraphic(e){return new G({arriveCurbApproach:e.attributes.ArrivalCurbApproach!=null?b.fromJSON(e.attributes.ArrivalCurbApproach):null,arriveTime:e.attributes.ArrivalTime!=null?new Date(e.attributes.ArrivalTime):null,arriveTimeOffset:e.attributes.ArrivalUTCOffset,cumulativeCosts:e.attributes.CumulativeCosts!=null?E(JSON.parse(e.attributes.CumulativeCosts)):null,cumulativeDistance:e.attributes.CumulativeMeters??null,cumulativeDuration:e.attributes.CumulativeMinutes??null,curbApproach:e.attributes.CurbApproach!=null?b.fromJSON(e.attributes.CurbApproach):null,departCurbApproach:e.attributes.DepartureCurbApproach!=null?b.fromJSON(e.attributes.DepartureCurbApproach):null,departTime:e.attributes.DepartureTime!=null?new Date(e.attributes.DepartureTime):null,departTimeOffset:e.attributes.DepartureUTCOffset??null,geometry:e.geometry,lateDuration:e.attributes.LateMinutes??null,locationType:e.attributes.LocationType!=null?M.fromJSON(e.attributes.LocationType):null,name:e.attributes.Name,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,routeName:e.attributes.RouteName,sequence:e.attributes.Sequence??null,serviceCosts:e.attributes.ServiceCosts!=null?E(JSON.parse(e.attributes.ServiceCosts)):null,serviceDistance:e.attributes.ServiceMeters??null,serviceDuration:e.attributes.ServiceMinutes??null,status:e.attributes.Status!=null?O.fromJSON(e.attributes.Status):null,symbol:e.symbol,timeWindowEnd:e.attributes.TimeWindowEnd!=null?new Date(e.attributes.TimeWindowEnd):null,timeWindowEndOffset:e.attributes.TimeWindowEndUTCOffset??null,timeWindowStart:e.attributes.TimeWindowStart!=null?new Date(e.attributes.TimeWindowStart):null,timeWindowStartOffset:e.attributes.TimeWindowStartUTCOffset??null,waitDuration:e.attributes.WaitMinutes??null})}toGraphic(){const e={ObjectID:this.objectId,ArrivalCurbApproach:this.arriveCurbApproach!=null?b.toJSON(this.arriveCurbApproach):null,ArrivalTime:this.arriveTime!=null?this.arriveTime.getTime():null,ArrivalUTCOffset:this.arriveTimeOffset,CumulativeCosts:this.cumulativeCosts!=null?JSON.stringify(j(this.cumulativeCosts)):null,CumulativeMeters:this.cumulativeDistance,CumulativeMinutes:this.cumulativeDuration,CurbApproach:this.curbApproach!=null?b.toJSON(this.curbApproach):null,DepartureCurbApproach:this.departCurbApproach!=null?b.toJSON(this.departCurbApproach):null,DepartureTime:this.departTime!=null?this.departTime.getTime():null,DepartureUTCOffset:this.departTimeOffset,LateMinutes:this.lateDuration,LocationType:this.locationType!=null?M.toJSON(this.locationType):null,Name:this.name,RouteName:this.routeName,Sequence:this.sequence,ServiceCosts:this.serviceCosts!=null?JSON.stringify(j(this.serviceCosts)):null,ServiceMeters:this.serviceDistance,ServiceMinutes:this.serviceDuration,Status:this.status!=null?O.toJSON(this.status):null,TimeWindowEnd:this.timeWindowEnd!=null?this.timeWindowEnd.getTime():null,TimeWindowEndUTCOffset:this.timeWindowEndOffset??this.arriveTimeOffset,TimeWindowStart:this.timeWindowStart!=null?this.timeWindowStart.getTime():null,TimeWindowStartUTCOffset:this.timeWindowStartOffset??this.arriveTimeOffset,WaitMinutes:this.waitDuration};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};r.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"ArrivalCurbApproach",alias:"Arrival Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"ArrivalTime",alias:"Arrival Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"ArrivalUTCOffset",alias:"Arrival Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"CumulativeCosts",alias:"Cumulative Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"CumulativeMeters",alias:"Cumulative Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"CumulativeMinutes",alias:"Cumulative Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"DepartureCurbApproach",alias:"Departure Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"DepartureTime",alias:"Departure Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"DepartureUTCOffset",alias:"Departure Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"LateMinutes",alias:"Minutes Late",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"LocationType",alias:"Location Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNALocationType",codedValues:[{name:"Stop",code:0},{name:"Waypoint",code:1}]}},{name:"Name",alias:"Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"ServiceCosts",alias:"Service Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"ServiceMeters",alias:"Service Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"ServiceMinutes",alias:"Service Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"Status",alias:"Status",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNAObjectStatus",codedValues:[{name:"OK",code:0},{name:"Not Located on Network",code:1},{name:"Network Unbuilt",code:2},{name:"Prohibited Street",code:3},{name:"Invalid Field Values",code:4},{name:"Cannot Reach",code:5},{name:"Time Window Violation",code:6}]}},{name:"TimeWindowEnd",alias:"Time Window End",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!1},{name:"TimeWindowEndUTCOffset",alias:"Time Window End: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"TimeWindowStart",alias:"Time Window Start",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!1},{name:"TimeWindowStartUTCOffset",alias:"Time Window Start: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"WaitMinutes",alias:"Minutes Early",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1}],r.popupInfo={title:"{Name}",fieldInfos:[{fieldName:"Name",label:"Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"RouteName",label:"Route Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"Sequence",label:"Sequence",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalTime",label:"Arrival Time",isEditable:!0,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"ArrivalUTCOffset",label:"Arrival Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DepartureTime",label:"Departure Time",isEditable:!0,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"DepartureUTCOffset",label:"Departure Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CurbApproach",label:"Curb Approach",isEditable:!0,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalCurbApproach",label:"Arrival Curb Approach",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DepartureCurbApproach",label:"Departure Curb Approach",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Status",label:"Status",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"LocationType",label:"Location Type",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TimeWindowStart",label:"Time Window Start",isEditable:!0,tooltip:"",visible:!1,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"TimeWindowStartUTCOffset",label:"Time Window Start: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TimeWindowEnd",label:"Time Window End",isEditable:!0,tooltip:"",visible:!1,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"TimeWindowEndUTCOffset",label:"Time Window End: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceMinutes",label:"Service Minutes",isEditable:!0,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceMeters",label:"Service Meters",isEditable:!0,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceCosts",label:"Service Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"CumulativeMinutes",label:"Cumulative Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CumulativeMeters",label:"Cumulative Meters",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CumulativeCosts",label:"Cumulative Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"LateMinutes",label:"Minutes Late",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"WaitMinutes",label:"Minutes Early",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([i({type:b.apiValues,json:{read:{source:"attributes.ArrivalCurbApproach",reader:b.read}}})],r.prototype,"arriveCurbApproach",void 0),t([i({type:Date,json:{read:{source:"attributes.ArriveTimeUTC"}}})],r.prototype,"arriveTime",void 0),t([i()],r.prototype,"arriveTimeOffset",void 0),t([p("arriveTimeOffset",["attributes.ArriveTime","attributes.ArriveTimeUTC"])],r.prototype,"readArriveTimeOffset",null),t([i({json:{name:"attributes.Bearing",read:!1,write:!0}})],r.prototype,"bearing",void 0),t([i({json:{name:"attributes.BearingTol",read:!1,write:!0}})],r.prototype,"bearingTol",void 0),t([i()],r.prototype,"cumulativeCosts",void 0),t([p("cumulativeCosts",["attributes"])],r.prototype,"readCumulativeCosts",null),t([i()],r.prototype,"cumulativeDistance",void 0),t([i()],r.prototype,"cumulativeDuration",void 0),t([i({type:b.apiValues,json:{name:"attributes.CurbApproach",read:{reader:b.read},write:{writer:b.write}}})],r.prototype,"curbApproach",void 0),t([i({type:b.apiValues,json:{read:{source:"attributes.DepartCurbApproach",reader:b.read}}})],r.prototype,"departCurbApproach",void 0),t([i({type:Date,json:{read:{source:"attributes.DepartTimeUTC"}}})],r.prototype,"departTime",void 0),t([i()],r.prototype,"departTimeOffset",void 0),t([p("departTimeOffset",["attributes.DepartTime","attributes.DepartTimeUTC"])],r.prototype,"readDepartTimeOffset",null),t([i({json:{read:{source:"attributes.DistanceToNetworkInMeters"}}})],r.prototype,"distanceToNetworkInMeters",void 0),t([i({type:H,json:{write:!0}})],r.prototype,"geometry",void 0),t([i()],r.prototype,"lateDuration",void 0),t([i({type:M.apiValues,json:{name:"attributes.LocationType",read:{reader:M.read},write:{writer:M.write}}})],r.prototype,"locationType",void 0),t([i({json:{name:"attributes.Name"}})],r.prototype,"name",void 0),t([i({json:{name:"attributes.NavLatency",read:!1,write:!0}})],r.prototype,"navLatency",void 0),t([i({json:{name:"attributes.ObjectID"}})],r.prototype,"objectId",void 0),t([i({type:I})],r.prototype,"popupTemplate",void 0),t([i({json:{read:{source:"attributes.PosAlong"}}})],r.prototype,"posAlong",void 0),t([i({json:{name:"attributes.RouteName"}})],r.prototype,"routeName",void 0),t([i()],r.prototype,"serviceCosts",void 0),t([p("serviceCosts",["attributes"])],r.prototype,"readServiceCosts",null),t([D("serviceCosts")],r.prototype,"writeServiceCosts",null),t([i()],r.prototype,"serviceDistance",void 0),t([i()],r.prototype,"serviceDuration",void 0),t([i({json:{name:"attributes.Sequence"}})],r.prototype,"sequence",void 0),t([i({type:L.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:L.read}}})],r.prototype,"sideOfEdge",void 0),t([i({json:{read:{source:"attributes.SnapX"}}})],r.prototype,"snapX",void 0),t([i({json:{read:{source:"attributes.SnapY"}}})],r.prototype,"snapY",void 0),t([i({json:{read:{source:"attributes.SnapZ"}}})],r.prototype,"snapZ",void 0),t([i({json:{read:{source:"attributes.SourceID"}}})],r.prototype,"sourceId",void 0),t([i({json:{read:{source:"attributes.SourceOID"}}})],r.prototype,"sourceOid",void 0),t([i({type:O.apiValues,json:{read:{source:"attributes.Status",reader:O.read}}})],r.prototype,"status",void 0),t([i({types:F})],r.prototype,"symbol",void 0),t([i({type:Date,json:{name:"attributes.TimeWindowEnd"}})],r.prototype,"timeWindowEnd",void 0),t([D("timeWindowEnd")],r.prototype,"writeTimeWindowEnd",null),t([i()],r.prototype,"timeWindowEndOffset",void 0),t([i({type:Date,json:{name:"attributes.TimeWindowStart"}})],r.prototype,"timeWindowStart",void 0),t([D("timeWindowStart")],r.prototype,"writeTimeWindowStart",null),t([i()],r.prototype,"timeWindowStartOffset",void 0),t([i({readOnly:!0,json:{read:!1}})],r.prototype,"type",void 0),t([i()],r.prototype,"violations",void 0),t([p("violations",["attributes"])],r.prototype,"readViolations",null),t([i()],r.prototype,"waitDuration",void 0),t([i()],r.prototype,"wait",void 0),t([p("wait",["attributes"])],r.prototype,"readWait",null),r=G=t([g("esri.rest.support.Stop")],r);const Ne=r;export{Z as D,ve as O,be as R,de as S,C as U,Ne as a,ae as b,Te as c,ce as d,ne as e,fe as f,Se as g,ue as h,Q as i,ge as j,pe as k,$ as l,ye as m,B as n,he as o,re as p,le as r,oe as s,me as w,ie as y}; +import{gk as o,b4 as A,j as w,d as t,y as i,aC as z,i as I,hm as F,f as g,aU as S,aZ as p,aA as H,aR as D,aB as X,c9 as x}from"./index-BjUNJPVf.js";const Q=o()({esriCentimeters:"centimeters",esriDecimalDegrees:"decimal-degrees",esriDecimeters:"decimeters",esriFeet:"feet",esriInches:"inches",esriKilometers:"kilometers",esriMeters:"meters",esriMiles:"miles",esriMillimeters:"millimeters",esriNauticalMiles:"nautical-miles",esriPoints:"points",esriUnknownUnits:"unknown",esriYards:"yards"}),le=o()({esriNAUCentimeters:"centimeters",esriNAUDecimalDegrees:"decimal-degrees",esriNAUDecimeters:"decimeters",esriNAUFeet:"feet",esriNAUInches:"inches",esriNAUKilometers:"kilometers",esriNAUMeters:"meters",esriNAUMiles:"miles",esriNAUMillimeters:"millimeters",esriNAUNauticalMiles:"nautical-miles",esriNAUPoints:"points",esriNAUYards:"yards"});o()({esriNAUDays:"days",esriNAUHours:"hours",esriNAUMinutes:"minutes",esriNAUSeconds:"seconds"});const oe=o()({esriNAUCentimeters:"centimeters",esriNAUDecimalDegrees:"decimal-degrees",esriNAUDecimeters:"decimeters",esriNAUFeet:"feet",esriNAUInches:"inches",esriNAUKilometers:"kilometers",esriNAUMeters:"meters",esriNAUMiles:"miles",esriNAUMillimeters:"millimeters",esriNAUNauticalMiles:"nautical-miles",esriNAUPoints:"points",esriNAUYards:"yards",esriNAUDays:"days",esriNAUHours:"hours",esriNAUMinutes:"minutes",esriNAUSeconds:"seconds",esriNAUKilometersPerHour:"kilometers-per-hour",esriNAUMilesPerHour:"miles-per-hour",esriNAUUnknown:"unknown"}),ne=o()({esriDOTComplete:"complete",esriDOTCompleteNoEvents:"complete-no-events",esriDOTFeatureSets:"featuresets",esriDOTInstructionsOnly:"instructions-only",esriDOTStandard:"standard",esriDOTSummaryOnly:"summary-only"}),ue=o()({esriNAOutputLineNone:"none",esriNAOutputLineStraight:"straight",esriNAOutputLineTrueShape:"true-shape",esriNAOutputLineTrueShapeWithMeasure:"true-shape-with-measure"});o()({esriNAOutputPolygonNone:"none",esriNAOutputPolygonSimplified:"simplified",esriNAOutputPolygonDetailed:"detailed"});const $=o()({esriNFSBAllowBacktrack:"allow-backtrack",esriNFSBAtDeadEndsOnly:"at-dead-ends-only",esriNFSBNoBacktrack:"no-backtrack",esriNFSBAtDeadEndsAndIntersections:"at-dead-ends-and-intersections"});o()({esriNATravelDirectionFromFacility:"from-facility",esriNATravelDirectionToFacility:"to-facility"});o()({esriNATimeOfDayNotUsed:"not-used",esriNATimeOfDayUseAsStartTime:"start",esriNATimeOfDayUseAsEndTime:"end"});const ee=o()({AUTOMOBILE:"automobile",TRUCK:"truck",WALK:"walk",OTHER:"other"}),b=o()({0:"either-side-of-vehicle",1:"right-side-of-vehicle",2:"left-side-of-vehicle",3:"no-u-turn"},{useNumericKeys:!0}),M=o()({0:"stop",1:"waypoint",2:"break"},{useNumericKeys:!0}),O=o()({0:"ok",1:"not-located",2:"network-element-not-located",3:"element-not-traversable",4:"invalid-field-values",5:"not-reached",6:"time-window-violation",7:"not-located-on-closest"},{useNumericKeys:!0}),L=o()({1:"right",2:"left"},{useNumericKeys:!0}),h=o()({0:"restriction",1:"scaled-cost",2:"added-cost"},{useNumericKeys:!0}),U=o()({0:"permit",1:"restrict"},{useNumericKeys:!0}),W=o()({1:"header",50:"arrive",51:"depart",52:"straight",100:"on-ferry",101:"off-ferry",102:"central-fork",103:"roundabout",104:"u-turn",150:"door",151:"stairs",152:"elevator",153:"escalator",154:"pedestrian-ramp",200:"left-fork",201:"left-ramp",202:"clockwise-roundabout",203:"left-handed-u-turn",204:"bear-left",205:"left-turn",206:"sharp-left",207:"left-turn-and-immediate-left-turn",208:"left-turn-and-immediate-right-turn",300:"right-fork",301:"right-ramp",302:"counter-clockwise-roundabout",303:"right-handed-u-turn",304:"bear-right",305:"right-turn",306:"sharp-right",307:"right-turn-and-immediate-left-turn",308:"right-turn-and-immediate-right-turn",400:"up-elevator",401:"up-escalator",402:"up-stairs",500:"down-elevator",501:"down-escalator",502:"down-stairs",1e3:"general-event",1001:"landmark",1002:"time-zone-change",1003:"traffic-event",1004:"scaled-cost-barrier-event",1005:"boundary-crossing",1006:"restriction-violation",1007:"lane"},{useNumericKeys:!0}),V=o()({0:"unknown",1:"segment",2:"maneuver-segment",3:"restriction-violation",4:"scaled-cost-barrier",5:"heavy-traffic",6:"slow-traffic",7:"moderate-traffic"},{useNumericKeys:!0}),pe=o()({"NA Campus":"campus","NA Desktop":"desktop","NA Navigation":"navigation"}),te=o()({Kilometers:"kilometers",Miles:"miles",Meters:"meters"},{ignoreUnknown:!1}),ie=o()({Minutes:"minutes",TimeAt1KPH:"time-at-1-kph",TravelTime:"travel-time",TruckMinutes:"truck-minutes",TruckTravelTime:"truck-travel-time",WalkTime:"walk-time"},{ignoreUnknown:!1}),C=o()({Kilometers:"kilometers",Miles:"miles",Meters:"meters",Minutes:"minutes",TimeAt1KPH:"time-at-1-kph",TravelTime:"travel-time",TruckMinutes:"truck-minutes",TruckTravelTime:"truck-travel-time",WalkTime:"walk-time"},{ignoreUnknown:!1}),Z=o()({"Any Hazmat Prohibited":"any-hazmat-prohibited","Avoid Carpool Roads":"avoid-carpool-roads","Avoid Express Lanes":"avoid-express-lanes","Avoid Ferries":"avoid-ferries","Avoid Gates":"avoid-gates","Avoid Limited Access Roads":"avoid-limited-access-roads","Avoid Private Roads":"avoid-private-roads","Avoid Roads Unsuitable for Pedestrians":"avoid-roads-unsuitable-for-pedestrians","Avoid Stairways":"avoid-stairways","Avoid Toll Roads":"avoid-toll-roads","Avoid Toll Roads for Trucks":"avoid-toll-roads-for-trucks","Avoid Truck Restricted Roads":"avoid-truck-restricted-roads","Avoid Unpaved Roads":"avoid-unpaved-roads","Axle Count Restriction":"axle-count-restriction","Driving a Bus":"driving-a-bus","Driving a Taxi":"driving-a-taxi","Driving a Truck":"driving-a-truck","Driving an Automobile":"driving-an-automobile","Driving an Emergency Vehicle":"driving-an-emergency-vehicle","Height Restriction":"height-restriction","Kingpin to Rear Axle Length Restriction":"kingpin-to-rear-axle-length-restriction","Length Restriction":"length-restriction","Preferred for Pedestrians":"preferred-for-pedestrians","Riding a Motorcycle":"riding-a-motorcycle","Roads Under Construction Prohibited":"roads-under-construction-prohibited","Semi or Tractor with One or More Trailers Prohibited":"semi-or-tractor-with-one-or-more-trailers-prohibited","Single Axle Vehicles Prohibited":"single-axle-vehicles-prohibited","Tandem Axle Vehicles Prohibited":"tandem-axle-vehicles-prohibited","Through Traffic Prohibited":"through-traffic-prohibited","Truck with Trailers Restriction":"truck-with-trailers-restriction","Use Preferred Hazmat Routes":"use-preferred-hazmat-routes","Use Preferred Truck Routes":"use-preferred-truck-routes",Walking:"walking","Weight Restriction":"weight-restriction"},{ignoreUnknown:!1}),de=o()({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),me=o()({esriGeometryPoint:"point",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"envelope",esriGeometryMultipoint:"multipoint"}),be=o()({esriNAUTCost:"cost",esriNAUTDescriptor:"descriptor",esriNAUTRestriction:"restriction",esriNAUTHierarchy:"hierarchy"}),ce=o()({esriDSTAltName:"alt-name",esriDSTArrive:"arrive",esriDSTBranch:"branch",esriDSTCrossStreet:"cross-street",esriDSTCumulativeLength:"cumulative-length",esriDSTDepart:"depart",esriDSTEstimatedArrivalTime:"estimated-arrival-time",esriDSTExit:"exit",esriDSTGeneral:"general",esriDSTLength:"length",esriDSTServiceTime:"service-time",esriDSTStreetName:"street-name",esriDSTSummary:"summary",esriDSTTime:"time",esriDSTTimeWindow:"time-window",esriDSTToward:"toward",esriDSTViolationTime:"violation-time",esriDSTWaitTime:"wait-time"});var J;let c=J=class extends A(S){constructor(e){super(e),this.directionLineType=null,this.directionPointId=null,this.distance=null,this.duration=null,this.fromLevel=null,this.geometry=null,this.objectId=null,this.popupTemplate=null,this.symbol=null,this.toLevel=null,this.type="direction-line"}static fromGraphic(e){return new J({directionLineType:V.fromJSON(e.attributes.DirectionLineType),directionPointId:e.attributes.DirectionPointID,distance:e.attributes.Meters,duration:e.attributes.Minutes,fromLevel:e.attributes.FromLevel??null,geometry:e.geometry,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,symbol:e.symbol,toLevel:e.attributes.ToLevel??null})}toGraphic(){const e={ObjectID:this.objectId,DirectionLineType:this.directionLineType!=null?V.toJSON(this.directionLineType):null,DirectionPointID:this.directionPointId,Meters:this.distance,Minutes:this.duration};return this.fromLevel!=null&&(e.FromLevel=this.fromLevel),this.toLevel!=null&&(e.ToLevel=this.toLevel),new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};c.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"DirectionLineType",alias:"Line Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriDirectionsLineType",codedValues:[{name:"Unknown",code:0},{name:"Segment",code:1},{name:"Maneuver Segment",code:2},{name:"Restriction violation",code:3},{name:"Scale cost barrier crossing",code:4},{name:"Heavy Traffic",code:5},{name:"Slow Traffic",code:6},{name:"Moderate Traffic",code:7}]}},{name:"DirectionPointID",alias:"Direction Point ID",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1},{name:"FromLevel",alias:"Start from 3D Level",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1},{name:"Meters",alias:"Length in Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"Minutes",alias:"Duration in Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"ToLevel",alias:"End at 3D Level",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1}],c.popupInfo={title:"Direction Lines",fieldInfos:[{fieldName:"DirectionLineType",label:"Line Type",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"Meters",label:"Length in Meters",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Minutes",label:"Duration in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DirectionPointID",label:"Direction Point ID",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"FromLevel",label:"Start from 3D Level",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ToLevel",label:"End at 3D Level",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([i({type:V.apiValues,json:{read:{source:"attributes.DirectionLineType",reader:V.read}}})],c.prototype,"directionLineType",void 0),t([i({json:{read:{source:"attributes.DirectionPointID"}}})],c.prototype,"directionPointId",void 0),t([i({json:{read:{source:"attributes.Meters"}}})],c.prototype,"distance",void 0),t([i({json:{read:{source:"attributes.Minutes"}}})],c.prototype,"duration",void 0),t([i({json:{read:{source:"attributes.FromLevel"}}})],c.prototype,"fromLevel",void 0),t([i({type:z})],c.prototype,"geometry",void 0),t([i({json:{read:{source:"attributes.ObjectID"}}})],c.prototype,"objectId",void 0),t([i({type:I})],c.prototype,"popupTemplate",void 0),t([i({types:F})],c.prototype,"symbol",void 0),t([i({json:{read:{source:"attributes.ToLevel"}}})],c.prototype,"toLevel",void 0),t([i({readOnly:!0,json:{read:!1}})],c.prototype,"type",void 0),c=J=t([g("esri.rest.support.DirectionLine")],c);const ye=c;var R;let n=R=class extends A(S){constructor(e){super(e),this.alternateName=null,this.arrivalTime=null,this.arrivalTimeOffset=null,this.azimuth=null,this.branchName=null,this.directionPointType=null,this.displayText=null,this.exitName=null,this.geometry=null,this.intersectingName=null,this.level=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.sequence=null,this.shortVoiceInstruction=null,this.stopId=null,this.symbol=null,this.towardName=null,this.type="direction-point",this.voiceInstruction=null}readArrivalTime(e,a){return a.attributes.ArrivalTime!=null?new Date(a.attributes.ArrivalTime):null}static fromGraphic(e){return new R({alternateName:e.attributes.AlternateName??null,arrivalTime:e.attributes.ArrivalTime!=null?new Date(e.attributes.ArrivalTime):null,arrivalTimeOffset:e.attributes.ArrivalUTCOffset??null,azimuth:e.attributes.Azimuth??null,branchName:e.attributes.BranchName??null,directionPointType:W.fromJSON(e.attributes.DirectionPointType),displayText:e.attributes.DisplayText??null,exitName:e.attributes.ExitName??null,geometry:e.geometry,intersectingName:e.attributes.IntersectingName??null,level:e.attributes.Level??null,name:e.attributes.Name??null,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,sequence:e.attributes.Sequence,shortVoiceInstruction:e.attributes.ShortVoiceInstruction??null,stopId:e.attributes.StopID??null,symbol:e.symbol,towardName:e.attributes.TowardName??null,voiceInstruction:e.attributes.VoiceInstruction??null})}toGraphic(){const e={ObjectID:this.objectId,DirectionPointType:this.directionPointType!=null?W.toJSON(this.directionPointType):null,Sequence:this.sequence,StopID:this.stopId};return this.alternateName!=null&&(e.AlternateName=this.alternateName),this.arrivalTime!=null&&(e.ArrivalTime=this.arrivalTime.getTime()),this.arrivalTimeOffset!=null&&(e.ArrivalUTCOffset=this.arrivalTimeOffset),this.azimuth!=null&&(e.Azimuth=this.azimuth),this.branchName!=null&&(e.BranchName=this.branchName),this.displayText!=null&&(e.DisplayText=this.displayText),this.exitName!=null&&(e.ExitName=this.exitName),this.intersectingName!=null&&(e.IntersectingName=this.intersectingName),this.level!=null&&(e.Level=this.level),this.name!=null&&(e.Name=this.name),this.shortVoiceInstruction!=null&&(e.ShortVoiceInstruction=this.shortVoiceInstruction),this.towardName!=null&&(e.TowardName=this.towardName),this.voiceInstruction!=null&&(e.VoiceInstruction=this.voiceInstruction),new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};n.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"AlternateName",alias:"Alternative Feature Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"ArrivalTime",alias:"Maneuver Starts at",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"ArrivalUTCOffset",alias:"Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"Azimuth",alias:"Azimuth",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"BranchName",alias:"Signpost Branch Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"DirectionPointType",alias:"Directions Item Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriDirectionPointType",codedValues:[{name:"Unknown",code:0},{name:"",code:1},{name:"Arrive at stop",code:50},{name:"Depart at stop",code:51},{name:"Go straight",code:52},{name:"Take ferry",code:100},{name:"Take off ferry",code:101},{name:"Keep center at fork",code:102},{name:"Take roundabout",code:103},{name:"Make U-Turn",code:104},{name:"Pass the door",code:150},{name:"Take stairs",code:151},{name:"",code:152},{name:"Take escalator",code:153},{name:"Take pedestrian ramp",code:154},{name:"Keep left at fork",code:200},{name:"Ramp left",code:201},{name:"Take left-handed roundabout",code:202},{name:"Make left-handed U-Turn",code:203},{name:"Bear left",code:204},{name:"Turn left",code:205},{name:"Make sharp left",code:206},{name:"Turn left, followed by turn left",code:207},{name:"Turn left, followed by turn right",code:208},{name:"Keep right at fork",code:300},{name:"Ramp right",code:301},{name:"Take right-handed roundabout",code:302},{name:"Make right-handed U-Turn",code:303},{name:"Bear right",code:304},{name:"Turn right",code:305},{name:"Make sharp right",code:306},{name:"Turn right, followed by turn left",code:307},{name:"Turn right, followed by turn right",code:308},{name:"Indicates up direction of elevator",code:400},{name:"Indicates up direction of escalator",code:401},{name:"Take up-stairs",code:402},{name:"Indicates down direction of elevator",code:500},{name:"Indicates down direction of escalator",code:501},{name:"Take down-stairs",code:502},{name:"General event",code:1e3},{name:"Landmark",code:1001},{name:"Time zone change",code:1002},{name:"Heavy traffic segment",code:1003},{name:"Scale cost barrier crossing",code:1004},{name:"Administrative Border crossing",code:1005},{name:"Restriction violation",code:1006}]}},{name:"DisplayText",alias:"Text to Display",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"ExitName",alias:"Highway Exit Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"IntersectingName",alias:"Intersecting Feature Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"Level",alias:"3D Logical Level",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"Name",alias:"Primary Feature Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"ShortVoiceInstruction",alias:"Voice Instruction",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"StopID",alias:"Stop ID",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"TowardName",alias:"Signpost Toward Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"VoiceInstruction",alias:"Voice Full Instruction",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null}],n.popupInfo={title:"{DisplayText}",fieldInfos:[{fieldName:"DirectionPointType",label:"Directions Item Type",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"DisplayText",label:"Text to Display",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"Sequence",label:"Sequence",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"StopID",label:"Stop ID",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalTime",label:"Maneuver Starts at",isEditable:!0,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"ArrivalUTCOffset",label:"Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Azimuth",label:"Azimuth",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Name",label:"Primary Feature Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"AlternateName",label:"Alternative Feature Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"ExitName",label:"Highway Exit Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"IntersectingName",label:"Intersecting Feature Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"BranchName",label:"Signpost Branch Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"TowardName",label:"Signpost Toward Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"ShortVoiceInstruction",label:"Voice Instruction",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"VoiceInstruction",label:"Voice Full Instruction",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([i({json:{read:{source:"attributes.AlternateName"}}})],n.prototype,"alternateName",void 0),t([i()],n.prototype,"arrivalTime",void 0),t([p("arrivalTime",["attributes.ArrivalTime"])],n.prototype,"readArrivalTime",null),t([i({json:{read:{source:"attributes.ArrivalUTCOffset"}}})],n.prototype,"arrivalTimeOffset",void 0),t([i({json:{read:{source:"attributes.Azimuth"}}})],n.prototype,"azimuth",void 0),t([i({json:{read:{source:"attributes.BranchName"}}})],n.prototype,"branchName",void 0),t([i({type:W.apiValues,json:{read:{source:"attributes.DirectionPointType",reader:W.read}}})],n.prototype,"directionPointType",void 0),t([i({json:{read:{source:"attributes.DisplayText"}}})],n.prototype,"displayText",void 0),t([i({json:{read:{source:"attributes.ExitName"}}})],n.prototype,"exitName",void 0),t([i({type:H})],n.prototype,"geometry",void 0),t([i({json:{read:{source:"attributes.IntersectingName"}}})],n.prototype,"intersectingName",void 0),t([i()],n.prototype,"level",void 0),t([i({json:{read:{source:"attributes.Name"}}})],n.prototype,"name",void 0),t([i({json:{read:{source:"attributes.ObjectID"}}})],n.prototype,"objectId",void 0),t([i({type:I})],n.prototype,"popupTemplate",void 0),t([i({json:{read:{source:"attributes.Sequence"}}})],n.prototype,"sequence",void 0),t([i({json:{read:{source:"attributes.ShortVoiceInstruction"}}})],n.prototype,"shortVoiceInstruction",void 0),t([i({json:{read:{source:"attributes.StopID"}}})],n.prototype,"stopId",void 0),t([i({types:F})],n.prototype,"symbol",void 0),t([i({json:{read:{source:"attributes.TowardName"}}})],n.prototype,"towardName",void 0),t([i({readOnly:!0,json:{read:!1}})],n.prototype,"type",void 0),t([i({json:{read:{source:"attributes.VoiceInstruction"}}})],n.prototype,"voiceInstruction",void 0),n=R=t([g("esri.rest.support.DirectionPoint")],n);const Te=n;function f(e,a){if(e==null)return null;const s={},m=new RegExp(`^${a}`,"i");for(const N of Object.keys(e))if(m.test(N)){const k=N.substring(a.length);s[C.fromJSON(k)]=e[N]}return s}function Y(e,a,s){if(e!=null){a.attributes||(a.attributes={});for(const m in e){const N=C.toJSON(m);a.attributes[`${s}${N}`]=e[m]}}}function E(e){const a={};for(const s of Object.keys(e)){const m=s;a[C.fromJSON(m)]=e[s]}return a}function j(e){const a={};for(const s of Object.keys(e)){const m=s;a[C.toJSON(m)]=e[s]}return a}function B(e,a){return e==null||a==null?null:Math.round((e-a)/6e4)}function he(e){var m,N,k;const a=e.toJSON(),s=a;return s.accumulateAttributeNames&&(s.accumulateAttributeNames=(m=a.accumulateAttributeNames)==null?void 0:m.join()),s.attributeParameterValues&&(s.attributeParameterValues=JSON.stringify(a.attributeParameterValues)),s.barriers&&(s.barriers=JSON.stringify(a.barriers)),s.outSR&&(s.outSR=(N=a.outSR)==null?void 0:N.wkid),s.overrides&&(s.overrides=JSON.stringify(a.overrides)),s.polygonBarriers&&(s.polygonBarriers=JSON.stringify(a.polygonBarriers)),s.polylineBarriers&&(s.polylineBarriers=JSON.stringify(a.polylineBarriers)),s.restrictionAttributeNames&&(s.restrictionAttributeNames=(k=a.restrictionAttributeNames)==null?void 0:k.join()),s.stops&&(s.stops=JSON.stringify(a.stops)),s.travelMode&&(s.travelMode=JSON.stringify(a.travelMode)),s}var P;let u=P=class extends A(S){constructor(e){super(e),this.addedCost=null,this.barrierType=null,this.costs=null,this.curbApproach=null,this.fullEdge=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.sideOfEdge=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.type="point-barrier"}readCosts(e,a){return f(a.attributes,"Attr_")}writeCosts(e,a){Y(e,a,"Attr_")}static fromGraphic(e){return new P({addedCost:e.attributes.AddedCost??null,barrierType:e.attributes.BarrierType!=null?h.fromJSON(e.attributes.BarrierType):null,costs:e.attributes.Costs!=null?E(JSON.parse(e.attributes.Costs)):null,curbApproach:e.attributes.CurbApproach!=null?b.fromJSON(e.attributes.CurbApproach):null,fullEdge:e.attributes.FullEdge!=null?U.fromJSON(e.attributes.FullEdge):null,geometry:e.geometry,name:e.attributes.Name??null,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,status:e.attributes.Status!=null?O.fromJSON(e.attributes.Status):null,symbol:e.symbol})}toGraphic(){const e={ObjectID:this.objectId,AddedCost:this.addedCost,BarrierType:this.barrierType!=null?h.toJSON(this.barrierType):null,Costs:this.costs!=null?JSON.stringify(j(this.costs)):null,CurbApproach:this.curbApproach!=null?b.toJSON(this.curbApproach):null,FullEdge:this.fullEdge!=null?U.toJSON(this.fullEdge):null,Name:this.name,Status:this.status!=null?O.toJSON(this.status):null};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};u.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"AddedCost",alias:"Added Cost",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0,domain:null},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNABarrierType",codedValues:[{name:"Restriction",code:0},{name:"Scaled Cost",code:1},{name:"Added Cost",code:2}]}},{name:"Costs",alias:"Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"FullEdge",alias:"Full Edge",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNAIntYesNo",codedValues:[{name:"No",code:0},{name:"Yes",code:1}]}},{name:"Name",alias:"Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"Status",alias:"Status",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNAObjectStatus",codedValues:[{name:"OK",code:0},{name:"Not Located on Network",code:1},{name:"Network Unbuilt",code:2},{name:"Prohibited Street",code:3},{name:"Invalid Field Values",code:4},{name:"Cannot Reach",code:5},{name:"Time Window Violation",code:6}]}}],u.popupInfo={title:"Point Barriers",fieldInfos:[{fieldName:"Name",label:"Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"BarrierType",label:"Barrier Type",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"AddedCost",label:"Added Cost",isEditable:!0,tooltip:"",visible:!0,format:{places:3,digitSeparator:!0},stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([i()],u.prototype,"addedCost",void 0),t([i({type:h.apiValues,json:{name:"attributes.BarrierType",read:{reader:h.read},write:{writer:h.write}}})],u.prototype,"barrierType",void 0),t([i()],u.prototype,"costs",void 0),t([p("costs",["attributes"])],u.prototype,"readCosts",null),t([D("costs")],u.prototype,"writeCosts",null),t([i({constructOnly:!0,type:b.apiValues,json:{read:{source:"attributes.CurbApproach",reader:b.read}}})],u.prototype,"curbApproach",void 0),t([i({type:U.apiValues,json:{name:"attributes.FullEdge",read:{reader:U.read},write:{writer:U.write}}})],u.prototype,"fullEdge",void 0),t([i({type:H,json:{write:!0}})],u.prototype,"geometry",void 0),t([i({json:{name:"attributes.Name"}})],u.prototype,"name",void 0),t([i({json:{name:"attributes.ObjectID"}})],u.prototype,"objectId",void 0),t([i({type:I})],u.prototype,"popupTemplate",void 0),t([i({type:L.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:L.read}}})],u.prototype,"sideOfEdge",void 0),t([i({json:{read:{source:"attributes.SourceID"}}})],u.prototype,"sourceId",void 0),t([i({json:{read:{source:"attributes.SourceOID"}}})],u.prototype,"sourceOid",void 0),t([i({type:O.apiValues,json:{read:{source:"attributes.Status",reader:O.read}}})],u.prototype,"status",void 0),t([i({types:F})],u.prototype,"symbol",void 0),t([i({readOnly:!0,json:{read:!1}})],u.prototype,"type",void 0),u=P=t([g("esri.rest.support.PointBarrier")],u);const ve=u;var _;let y=_=class extends A(S){constructor(e){super(e),this.barrierType=null,this.costs=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.scaleFactor=null,this.symbol=null,this.type="polygon-barrier"}readCosts(e,a){return f(a.attributes,"Attr_")}writeCosts(e,a){Y(e,a,"Attr_")}static fromGraphic(e){return new _({barrierType:e.attributes.BarrierType!=null?h.fromJSON(e.attributes.BarrierType):null,costs:e.attributes.Costs!=null?E(JSON.parse(e.attributes.Costs)):null,geometry:e.geometry,name:e.attributes.Name??null,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,scaleFactor:e.attributes.ScaleFactor??null,symbol:e.symbol})}toGraphic(){const e={ObjectID:this.objectId,BarrierType:this.barrierType!=null?h.toJSON(this.barrierType):null,Costs:this.costs!=null?JSON.stringify(j(this.costs)):null,Name:this.name??null,ScaleFactor:this.scaleFactor??null};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};y.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNABarrierType",codedValues:[{name:"Restriction",code:0},{name:"Scaled Cost",code:1},{name:"Added Cost",code:2}]}},{name:"Costs",alias:"Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"Name",alias:"Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"ScaleFactor",alias:"Scale Factor",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0}],y.popupInfo={title:"Polygon Barriers",fieldInfos:[{fieldName:"Name",label:"Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"BarrierType",label:"Barrier Type",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"ScaleFactor",isEditable:!0,tooltip:"",visible:!0,format:{places:3,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Costs",label:"Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([i({type:h.apiValues,json:{name:"attributes.BarrierType",read:{reader:h.read},write:{writer:h.write}}})],y.prototype,"barrierType",void 0),t([i()],y.prototype,"costs",void 0),t([p("costs",["attributes"])],y.prototype,"readCosts",null),t([D("costs")],y.prototype,"writeCosts",null),t([i({type:X,json:{write:!0}})],y.prototype,"geometry",void 0),t([i({json:{name:"attributes.Name"}})],y.prototype,"name",void 0),t([i({json:{name:"attributes.ObjectID"}})],y.prototype,"objectId",void 0),t([i({type:I})],y.prototype,"popupTemplate",void 0),t([i()],y.prototype,"scaleFactor",void 0),t([i({types:F})],y.prototype,"symbol",void 0),t([i({readOnly:!0,json:{read:!1}})],y.prototype,"type",void 0),y=_=t([g("esri.rest.support.PolygonBarrier")],y);const fe=y;var q;let T=q=class extends A(S){constructor(e){super(e),this.barrierType=null,this.costs=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.scaleFactor=null,this.symbol=null,this.type="polyline-barrier"}readCosts(e,a){return f(a.attributes,"Attr_")}static fromGraphic(e){return new q({barrierType:e.attributes.BarrierType!=null?h.fromJSON(e.attributes.BarrierType):null,costs:e.attributes.Costs!=null?E(JSON.parse(e.attributes.Costs)):null,geometry:e.geometry,name:e.attributes.Name??null,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,scaleFactor:e.attributes.ScaleFactor??null,symbol:e.symbol})}toGraphic(){const e={ObjectID:this.objectId,BarrierType:this.barrierType!=null?h.toJSON(this.barrierType):null,Costs:this.costs!=null?JSON.stringify(j(this.costs)):null,Name:this.name,ScaleFactor:this.scaleFactor};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};T.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNABarrierType",codedValues:[{name:"Restriction",code:0},{name:"Scaled Cost",code:1},{name:"Added Cost",code:2}]}},{name:"Costs",alias:"Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"Name",alias:"Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"ScaleFactor",alias:"Scale Factor",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0}],T.popupInfo={title:"Line Barriers",fieldInfos:[{fieldName:"Name",label:"Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"BarrierType",label:"Barrier Type",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"ScaleFactor",isEditable:!0,tooltip:"",visible:!0,format:{places:3,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Costs",label:"Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([i({type:h.apiValues,json:{read:{source:"attributes.BarrierType",reader:h.read}}})],T.prototype,"barrierType",void 0),t([i()],T.prototype,"costs",void 0),t([p("costs",["attributes"])],T.prototype,"readCosts",null),t([i({type:z,json:{write:!0}})],T.prototype,"geometry",void 0),t([i({json:{name:"attributes.Name"}})],T.prototype,"name",void 0),t([i({json:{name:"attributes.ObjectID"}})],T.prototype,"objectId",void 0),t([i({type:I})],T.prototype,"popupTemplate",void 0),t([i()],T.prototype,"scaleFactor",void 0),t([i({types:F})],T.prototype,"symbol",void 0),t([i({readOnly:!0,json:{read:!1}})],T.prototype,"type",void 0),T=q=t([g("esri.rest.support.PolylineBarrier")],T);const ge=T;let d=class extends A(S){constructor(e){super(e),this.attributeParameterValues=null,this.description=null,this.distanceAttributeName=null,this.id=null,this.impedanceAttributeName=null,this.name=null,this.restrictionAttributeNames=null,this.simplificationTolerance=null,this.simplificationToleranceUnits=null,this.timeAttributeName=null,this.type=null,this.useHierarchy=null,this.uturnAtJunctions=null}readId(e,a){return a.id??a.itemId??null}readRestrictionAttributes(e,a){const{restrictionAttributeNames:s}=a;return s==null?null:s.map(m=>Z.fromJSON(m))}writeRestrictionAttributes(e,a,s){e!=null&&(a[s]=e.map(m=>Z.toJSON(m)))}};t([i({type:[Object],json:{write:!0}})],d.prototype,"attributeParameterValues",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"description",void 0),t([x(te,{ignoreUnknown:!1})],d.prototype,"distanceAttributeName",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"id",void 0),t([p("id",["id","itemId"])],d.prototype,"readId",null),t([x(C,{ignoreUnknown:!1})],d.prototype,"impedanceAttributeName",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"name",void 0),t([i({type:[String],json:{write:!0}})],d.prototype,"restrictionAttributeNames",void 0),t([p("restrictionAttributeNames")],d.prototype,"readRestrictionAttributes",null),t([D("restrictionAttributeNames")],d.prototype,"writeRestrictionAttributes",null),t([i({type:Number,json:{write:{allowNull:!0}}})],d.prototype,"simplificationTolerance",void 0),t([x(Q)],d.prototype,"simplificationToleranceUnits",void 0),t([x(ie,{ignoreUnknown:!1})],d.prototype,"timeAttributeName",void 0),t([x(ee)],d.prototype,"type",void 0),t([i({type:Boolean,json:{write:!0}})],d.prototype,"useHierarchy",void 0),t([x($)],d.prototype,"uturnAtJunctions",void 0),d=t([g("esri.rest.support.TravelMode")],d);const ae=d;let v=class extends S{constructor(e){super(e),this.accumulateAttributes=null,this.directionsLanguage=null,this.findBestSequence=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.startTimeIsUTC=null,this.timeWindowsAreUTC=null,this.travelMode=null}readAccumulateAttributes(e){return e==null?null:e.map(a=>C.fromJSON(a))}writeAccumulateAttributes(e,a,s){e!=null&&e.length&&(a[s]=e.map(m=>C.toJSON(m)))}};t([i({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],v.prototype,"accumulateAttributes",void 0),t([p("accumulateAttributes")],v.prototype,"readAccumulateAttributes",null),t([D("accumulateAttributes")],v.prototype,"writeAccumulateAttributes",null),t([i({type:String,json:{write:!0}})],v.prototype,"directionsLanguage",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"findBestSequence",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"preserveFirstStop",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"preserveLastStop",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"startTimeIsUTC",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"timeWindowsAreUTC",void 0),t([i({type:ae,json:{write:!0}})],v.prototype,"travelMode",void 0),v=t([g("esri.layers.support.RouteSettings")],v);const re=v;var K;let l=K=class extends A(S){constructor(e){super(e),this.analysisSettings=null,this.endTime=null,this.endTimeOffset=null,this.firstStopId=null,this.geometry=null,this.lastStopId=null,this.messages=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.startTime=null,this.startTimeOffset=null,this.stopCount=null,this.symbol=null,this.totalCosts=null,this.totalDistance=null,this.totalDuration=null,this.totalLateDuration=null,this.totalViolations=null,this.totalWait=null,this.totalWaitDuration=null,this.type="route-info",this.version="1.0.0"}readEndTime(e,a){return a.attributes.EndTimeUTC!=null?new Date(a.attributes.EndTimeUTC):null}readEndTimeOffset(e,a){return B(a.attributes.EndTime,a.attributes.EndTimeUTC)}readStartTime(e,a){return a.attributes.StartTimeUTC!=null?new Date(a.attributes.StartTimeUTC):null}readStartTimeOffset(e,a){return B(a.attributes.StartTime,a.attributes.StartTimeUTC)}readTotalCosts(e,a){return f(a.attributes,"Total_")}readTotalViolations(e,a){return f(a.attributes,"TotalViolation_")}readTotalWait(e,a){return f(a.attributes,"TotalWait_")}static fromGraphic(e){return new K({analysisSettings:e.attributes.AnalysisSettings!=null?re.fromJSON(JSON.parse(e.attributes.AnalysisSettings)):null,endTime:e.attributes.EndTime!=null?new Date(e.attributes.EndTime):null,endTimeOffset:e.attributes.EndUTCOffset??null,geometry:e.geometry,messages:e.attributes.Messages!=null?JSON.parse(e.attributes.Messages):null,name:e.attributes.RouteName,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,startTime:e.attributes.StartTime!=null?new Date(e.attributes.StartTime):null,startTimeOffset:e.attributes.StartUTCOffset??null,symbol:e.symbol,totalCosts:e.attributes.TotalCosts!=null?E(JSON.parse(e.attributes.TotalCosts)):null,totalDistance:e.attributes.TotalMeters??null,totalDuration:e.attributes.TotalMinutes??null,totalLateDuration:e.attributes.TotalLateMinutes??null,totalWaitDuration:e.attributes.TotalWaitMinutes??null,version:e.attributes.Version})}toGraphic(){const e={ObjectID:this.objectId,AnalysisSettings:this.analysisSettings!=null?JSON.stringify(this.analysisSettings.toJSON()):null,EndTime:this.endTime!=null?this.endTime.getTime():null,EndUTCOffset:this.endTimeOffset,Messages:this.messages!=null?JSON.stringify(this.messages):null,RouteName:this.name,StartTime:this.startTime!=null?this.startTime.getTime():null,StartUTCOffset:this.startTimeOffset,TotalCosts:this.totalCosts!=null?JSON.stringify(j(this.totalCosts)):null,TotalLateMinutes:this.totalLateDuration,TotalMeters:this.totalDistance,TotalMinutes:this.totalDuration,TotalWaitMinutes:this.totalWaitDuration,Version:this.version};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};l.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"AnalysisSettings",alias:"Analysis Settings",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"EndTime",alias:"End Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"EndUTCOffset",alias:"End Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"Messages",alias:"Analysis Messages",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString",length:1024,editable:!0,nullable:!0,visible:!0,domain:null},{name:"StartTime",alias:"Start Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"StartUTCOffset",alias:"Start Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"TotalCosts",alias:"Total Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"TotalLateMinutes",alias:"Total Late Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"TotalMeters",alias:"Total Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"TotalMinutes",alias:"Total Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"TotalWaitMinutes",alias:"Total Wait Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"Version",alias:"Version",type:"esriFieldTypeString",length:16,editable:!0,nullable:!0,visible:!0,domain:null}],l.popupInfo={title:"Route Details",fieldInfos:[{fieldName:"RouteName",label:"Route Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"TotalMinutes",label:"Total Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalMeters",label:"Total Meters",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalLateMinutes",label:"Total Late Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalWaitMinutes",label:"Total Wait Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalCosts",label:"Total Costs",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"StartTime",label:"Start Time",isEditable:!1,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"StartUTCOffset",label:"Start Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"EndTime",label:"End Time",isEditable:!1,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"EndUTCOffset",label:"End Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Messages",label:"Analysis Messages",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"AnalysisSettings",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"Version",label:"Version",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([i()],l.prototype,"analysisSettings",void 0),t([i()],l.prototype,"endTime",void 0),t([p("endTime",["attributes.EndTimeUTC"])],l.prototype,"readEndTime",null),t([i()],l.prototype,"endTimeOffset",void 0),t([p("endTimeOffset",["attributes.EndTime","attributes.EndTimeUTC"])],l.prototype,"readEndTimeOffset",null),t([i({json:{read:{source:"attributes.FirstStopID"}}})],l.prototype,"firstStopId",void 0),t([i({type:z})],l.prototype,"geometry",void 0),t([i({json:{read:{source:"attributes.LastStopID"}}})],l.prototype,"lastStopId",void 0),t([i()],l.prototype,"messages",void 0),t([i({json:{read:{source:"attributes.Name"}}})],l.prototype,"name",void 0),t([i({json:{read:{source:"attributes.ObjectID"}}})],l.prototype,"objectId",void 0),t([i({type:I})],l.prototype,"popupTemplate",void 0),t([i()],l.prototype,"startTime",void 0),t([p("startTime",["attributes.StartTimeUTC"])],l.prototype,"readStartTime",null),t([i()],l.prototype,"startTimeOffset",void 0),t([p("startTimeOffset",["attributes.StartTime","attributes.StartTimeUTC"])],l.prototype,"readStartTimeOffset",null),t([i({json:{read:{source:"attributes.StopCount"}}})],l.prototype,"stopCount",void 0),t([i({types:F})],l.prototype,"symbol",void 0),t([i()],l.prototype,"totalCosts",void 0),t([p("totalCosts",["attributes"])],l.prototype,"readTotalCosts",null),t([i()],l.prototype,"totalDistance",void 0),t([i()],l.prototype,"totalDuration",void 0),t([i()],l.prototype,"totalLateDuration",void 0),t([i()],l.prototype,"totalViolations",void 0),t([p("totalViolations",["attributes"])],l.prototype,"readTotalViolations",null),t([i()],l.prototype,"totalWait",void 0),t([p("totalWait",["attributes"])],l.prototype,"readTotalWait",null),t([i()],l.prototype,"totalWaitDuration",void 0),t([i({readOnly:!0,json:{read:!1}})],l.prototype,"type",void 0),t([i()],l.prototype,"version",void 0),l=K=t([g("esri.rest.support.RouteInfo")],l);const Se=l;var G;let r=G=class extends A(S){constructor(e){super(e),this.arriveCurbApproach=null,this.arriveTime=null,this.arriveTimeOffset=null,this.bearing=null,this.bearingTol=null,this.cumulativeCosts=null,this.cumulativeDistance=null,this.cumulativeDuration=null,this.curbApproach=null,this.departCurbApproach=null,this.departTime=null,this.departTimeOffset=null,this.distanceToNetworkInMeters=null,this.geometry=null,this.lateDuration=null,this.locationType=null,this.name=null,this.navLatency=null,this.objectId=null,this.popupTemplate=null,this.posAlong=null,this.routeName=null,this.serviceCosts=null,this.serviceDistance=null,this.serviceDuration=null,this.sequence=null,this.sideOfEdge=null,this.snapX=null,this.snapY=null,this.snapZ=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.timeWindowEnd=null,this.timeWindowEndOffset=null,this.timeWindowStart=null,this.timeWindowStartOffset=null,this.type="stop",this.violations=null,this.waitDuration=null,this.wait=null}readArriveTimeOffset(e,a){return B(a.attributes.ArriveTime,a.attributes.ArriveTimeUTC)}readCumulativeCosts(e,a){return f(a.attributes,"Cumul_")}readDepartTimeOffset(e,a){return B(a.attributes.DepartTime,a.attributes.DepartTimeUTC)}readServiceCosts(e,a){return f(a.attributes,"Attr_")}writeServiceCosts(e,a){Y(e,a,"Attr_")}writeTimeWindowEnd(e,a){e!=null&&(a.attributes||(a.attributes={}),a.attributes.TimeWindowEnd=e.getTime())}writeTimeWindowStart(e,a){e!=null&&(a.attributes||(a.attributes={}),a.attributes.TimeWindowStart=e.getTime())}readViolations(e,a){return f(a.attributes,"Violation_")}readWait(e,a){return f(a.attributes,"Wait_")}static fromGraphic(e){return new G({arriveCurbApproach:e.attributes.ArrivalCurbApproach!=null?b.fromJSON(e.attributes.ArrivalCurbApproach):null,arriveTime:e.attributes.ArrivalTime!=null?new Date(e.attributes.ArrivalTime):null,arriveTimeOffset:e.attributes.ArrivalUTCOffset,cumulativeCosts:e.attributes.CumulativeCosts!=null?E(JSON.parse(e.attributes.CumulativeCosts)):null,cumulativeDistance:e.attributes.CumulativeMeters??null,cumulativeDuration:e.attributes.CumulativeMinutes??null,curbApproach:e.attributes.CurbApproach!=null?b.fromJSON(e.attributes.CurbApproach):null,departCurbApproach:e.attributes.DepartureCurbApproach!=null?b.fromJSON(e.attributes.DepartureCurbApproach):null,departTime:e.attributes.DepartureTime!=null?new Date(e.attributes.DepartureTime):null,departTimeOffset:e.attributes.DepartureUTCOffset??null,geometry:e.geometry,lateDuration:e.attributes.LateMinutes??null,locationType:e.attributes.LocationType!=null?M.fromJSON(e.attributes.LocationType):null,name:e.attributes.Name,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,routeName:e.attributes.RouteName,sequence:e.attributes.Sequence??null,serviceCosts:e.attributes.ServiceCosts!=null?E(JSON.parse(e.attributes.ServiceCosts)):null,serviceDistance:e.attributes.ServiceMeters??null,serviceDuration:e.attributes.ServiceMinutes??null,status:e.attributes.Status!=null?O.fromJSON(e.attributes.Status):null,symbol:e.symbol,timeWindowEnd:e.attributes.TimeWindowEnd!=null?new Date(e.attributes.TimeWindowEnd):null,timeWindowEndOffset:e.attributes.TimeWindowEndUTCOffset??null,timeWindowStart:e.attributes.TimeWindowStart!=null?new Date(e.attributes.TimeWindowStart):null,timeWindowStartOffset:e.attributes.TimeWindowStartUTCOffset??null,waitDuration:e.attributes.WaitMinutes??null})}toGraphic(){const e={ObjectID:this.objectId,ArrivalCurbApproach:this.arriveCurbApproach!=null?b.toJSON(this.arriveCurbApproach):null,ArrivalTime:this.arriveTime!=null?this.arriveTime.getTime():null,ArrivalUTCOffset:this.arriveTimeOffset,CumulativeCosts:this.cumulativeCosts!=null?JSON.stringify(j(this.cumulativeCosts)):null,CumulativeMeters:this.cumulativeDistance,CumulativeMinutes:this.cumulativeDuration,CurbApproach:this.curbApproach!=null?b.toJSON(this.curbApproach):null,DepartureCurbApproach:this.departCurbApproach!=null?b.toJSON(this.departCurbApproach):null,DepartureTime:this.departTime!=null?this.departTime.getTime():null,DepartureUTCOffset:this.departTimeOffset,LateMinutes:this.lateDuration,LocationType:this.locationType!=null?M.toJSON(this.locationType):null,Name:this.name,RouteName:this.routeName,Sequence:this.sequence,ServiceCosts:this.serviceCosts!=null?JSON.stringify(j(this.serviceCosts)):null,ServiceMeters:this.serviceDistance,ServiceMinutes:this.serviceDuration,Status:this.status!=null?O.toJSON(this.status):null,TimeWindowEnd:this.timeWindowEnd!=null?this.timeWindowEnd.getTime():null,TimeWindowEndUTCOffset:this.timeWindowEndOffset??this.arriveTimeOffset,TimeWindowStart:this.timeWindowStart!=null?this.timeWindowStart.getTime():null,TimeWindowStartUTCOffset:this.timeWindowStartOffset??this.arriveTimeOffset,WaitMinutes:this.waitDuration};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};r.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"ArrivalCurbApproach",alias:"Arrival Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"ArrivalTime",alias:"Arrival Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"ArrivalUTCOffset",alias:"Arrival Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"CumulativeCosts",alias:"Cumulative Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"CumulativeMeters",alias:"Cumulative Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"CumulativeMinutes",alias:"Cumulative Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"DepartureCurbApproach",alias:"Departure Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"DepartureTime",alias:"Departure Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"DepartureUTCOffset",alias:"Departure Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"LateMinutes",alias:"Minutes Late",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"LocationType",alias:"Location Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNALocationType",codedValues:[{name:"Stop",code:0},{name:"Waypoint",code:1}]}},{name:"Name",alias:"Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"ServiceCosts",alias:"Service Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"ServiceMeters",alias:"Service Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"ServiceMinutes",alias:"Service Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"Status",alias:"Status",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNAObjectStatus",codedValues:[{name:"OK",code:0},{name:"Not Located on Network",code:1},{name:"Network Unbuilt",code:2},{name:"Prohibited Street",code:3},{name:"Invalid Field Values",code:4},{name:"Cannot Reach",code:5},{name:"Time Window Violation",code:6}]}},{name:"TimeWindowEnd",alias:"Time Window End",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!1},{name:"TimeWindowEndUTCOffset",alias:"Time Window End: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"TimeWindowStart",alias:"Time Window Start",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!1},{name:"TimeWindowStartUTCOffset",alias:"Time Window Start: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"WaitMinutes",alias:"Minutes Early",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1}],r.popupInfo={title:"{Name}",fieldInfos:[{fieldName:"Name",label:"Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"RouteName",label:"Route Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"Sequence",label:"Sequence",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalTime",label:"Arrival Time",isEditable:!0,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"ArrivalUTCOffset",label:"Arrival Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DepartureTime",label:"Departure Time",isEditable:!0,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"DepartureUTCOffset",label:"Departure Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CurbApproach",label:"Curb Approach",isEditable:!0,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalCurbApproach",label:"Arrival Curb Approach",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DepartureCurbApproach",label:"Departure Curb Approach",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Status",label:"Status",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"LocationType",label:"Location Type",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TimeWindowStart",label:"Time Window Start",isEditable:!0,tooltip:"",visible:!1,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"TimeWindowStartUTCOffset",label:"Time Window Start: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TimeWindowEnd",label:"Time Window End",isEditable:!0,tooltip:"",visible:!1,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"TimeWindowEndUTCOffset",label:"Time Window End: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceMinutes",label:"Service Minutes",isEditable:!0,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceMeters",label:"Service Meters",isEditable:!0,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceCosts",label:"Service Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"CumulativeMinutes",label:"Cumulative Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CumulativeMeters",label:"Cumulative Meters",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CumulativeCosts",label:"Cumulative Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"LateMinutes",label:"Minutes Late",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"WaitMinutes",label:"Minutes Early",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([i({type:b.apiValues,json:{read:{source:"attributes.ArrivalCurbApproach",reader:b.read}}})],r.prototype,"arriveCurbApproach",void 0),t([i({type:Date,json:{read:{source:"attributes.ArriveTimeUTC"}}})],r.prototype,"arriveTime",void 0),t([i()],r.prototype,"arriveTimeOffset",void 0),t([p("arriveTimeOffset",["attributes.ArriveTime","attributes.ArriveTimeUTC"])],r.prototype,"readArriveTimeOffset",null),t([i({json:{name:"attributes.Bearing",read:!1,write:!0}})],r.prototype,"bearing",void 0),t([i({json:{name:"attributes.BearingTol",read:!1,write:!0}})],r.prototype,"bearingTol",void 0),t([i()],r.prototype,"cumulativeCosts",void 0),t([p("cumulativeCosts",["attributes"])],r.prototype,"readCumulativeCosts",null),t([i()],r.prototype,"cumulativeDistance",void 0),t([i()],r.prototype,"cumulativeDuration",void 0),t([i({type:b.apiValues,json:{name:"attributes.CurbApproach",read:{reader:b.read},write:{writer:b.write}}})],r.prototype,"curbApproach",void 0),t([i({type:b.apiValues,json:{read:{source:"attributes.DepartCurbApproach",reader:b.read}}})],r.prototype,"departCurbApproach",void 0),t([i({type:Date,json:{read:{source:"attributes.DepartTimeUTC"}}})],r.prototype,"departTime",void 0),t([i()],r.prototype,"departTimeOffset",void 0),t([p("departTimeOffset",["attributes.DepartTime","attributes.DepartTimeUTC"])],r.prototype,"readDepartTimeOffset",null),t([i({json:{read:{source:"attributes.DistanceToNetworkInMeters"}}})],r.prototype,"distanceToNetworkInMeters",void 0),t([i({type:H,json:{write:!0}})],r.prototype,"geometry",void 0),t([i()],r.prototype,"lateDuration",void 0),t([i({type:M.apiValues,json:{name:"attributes.LocationType",read:{reader:M.read},write:{writer:M.write}}})],r.prototype,"locationType",void 0),t([i({json:{name:"attributes.Name"}})],r.prototype,"name",void 0),t([i({json:{name:"attributes.NavLatency",read:!1,write:!0}})],r.prototype,"navLatency",void 0),t([i({json:{name:"attributes.ObjectID"}})],r.prototype,"objectId",void 0),t([i({type:I})],r.prototype,"popupTemplate",void 0),t([i({json:{read:{source:"attributes.PosAlong"}}})],r.prototype,"posAlong",void 0),t([i({json:{name:"attributes.RouteName"}})],r.prototype,"routeName",void 0),t([i()],r.prototype,"serviceCosts",void 0),t([p("serviceCosts",["attributes"])],r.prototype,"readServiceCosts",null),t([D("serviceCosts")],r.prototype,"writeServiceCosts",null),t([i()],r.prototype,"serviceDistance",void 0),t([i()],r.prototype,"serviceDuration",void 0),t([i({json:{name:"attributes.Sequence"}})],r.prototype,"sequence",void 0),t([i({type:L.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:L.read}}})],r.prototype,"sideOfEdge",void 0),t([i({json:{read:{source:"attributes.SnapX"}}})],r.prototype,"snapX",void 0),t([i({json:{read:{source:"attributes.SnapY"}}})],r.prototype,"snapY",void 0),t([i({json:{read:{source:"attributes.SnapZ"}}})],r.prototype,"snapZ",void 0),t([i({json:{read:{source:"attributes.SourceID"}}})],r.prototype,"sourceId",void 0),t([i({json:{read:{source:"attributes.SourceOID"}}})],r.prototype,"sourceOid",void 0),t([i({type:O.apiValues,json:{read:{source:"attributes.Status",reader:O.read}}})],r.prototype,"status",void 0),t([i({types:F})],r.prototype,"symbol",void 0),t([i({type:Date,json:{name:"attributes.TimeWindowEnd"}})],r.prototype,"timeWindowEnd",void 0),t([D("timeWindowEnd")],r.prototype,"writeTimeWindowEnd",null),t([i()],r.prototype,"timeWindowEndOffset",void 0),t([i({type:Date,json:{name:"attributes.TimeWindowStart"}})],r.prototype,"timeWindowStart",void 0),t([D("timeWindowStart")],r.prototype,"writeTimeWindowStart",null),t([i()],r.prototype,"timeWindowStartOffset",void 0),t([i({readOnly:!0,json:{read:!1}})],r.prototype,"type",void 0),t([i()],r.prototype,"violations",void 0),t([p("violations",["attributes"])],r.prototype,"readViolations",null),t([i()],r.prototype,"waitDuration",void 0),t([i()],r.prototype,"wait",void 0),t([p("wait",["attributes"])],r.prototype,"readWait",null),r=G=t([g("esri.rest.support.Stop")],r);const Ne=r;export{Z as D,ve as O,be as R,de as S,C as U,Ne as a,ae as b,Te as c,ce as d,ne as e,fe as f,Se as g,ue as h,Q as i,ge as j,pe as k,$ as l,ye as m,B as n,he as o,re as p,le as r,oe as s,me as w,ie as y}; diff --git a/assets/StreamLayer-BoGXecN6.js b/assets/StreamLayer-CxayZLf7.js similarity index 84% rename from assets/StreamLayer-BoGXecN6.js rename to assets/StreamLayer-CxayZLf7.js index 90378e2..3e28e78 100644 --- a/assets/StreamLayer-BoGXecN6.js +++ b/assets/StreamLayer-CxayZLf7.js @@ -1,7 +1,7 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/streamLayerUtils-w4YrSJTy.js","assets/utils-2LBmsoaQ.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css","assets/originUtils-D69mHv66.js","assets/multiOriginJSONSupportUtils-C0wm8_Yw.js","assets/saveAPIKeyUtils-BiX1lQSW.js","assets/saveUtils-BzCRy3uR.js","assets/createConnection-BxU4QDA7.js","assets/query-BM8R3sQ6.js","assets/pbfQueryUtils-CLRSFGBm.js","assets/pbf-D9QZb8S8.js","assets/OptimizedGeometry-CQuTPb9g.js","assets/OptimizedFeatureSet-Blu9Ckm7.js","assets/queryZScale-DN4aFXYn.js"] + __vite__mapDeps.viteFileDeps = ["assets/streamLayerUtils-i1YzXlx2.js","assets/utils-iOpWi7jV.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css","assets/originUtils-D69mHv66.js","assets/multiOriginJSONSupportUtils-C0wm8_Yw.js","assets/saveAPIKeyUtils-YRBbgdzi.js","assets/saveUtils-CGGzyvzv.js","assets/createConnection-BvioR9C8.js","assets/query-Bk_ITqRK.js","assets/pbfQueryUtils-CSeFSIjv.js","assets/pbf-Du8sFEWo.js","assets/OptimizedGeometry-CQuTPb9g.js","assets/OptimizedFeatureSet-Blu9Ckm7.js","assets/queryZScale-Dwvn5BlQ.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{d as t,y as r,f as I,aU as P,bP as F,bQ as E,dM as A,dp as O,dq as D,dr as k,dO as U,b4 as N,aS as R,k as C,N as d,ay as V,fA as f,s as L,_ as v,d3 as y,eF as M,aX as G,M as J,a_ as z,b3 as q,bR as Q,aE as W,fB as Z,dt as B,dS as g,fQ as X,fR as Y,fD as H,i as K,aZ as b,aV as ee,fE as te,du as ie,bT as re}from"./index-CEWggaxV.js";import"./UniqueValueRenderer-BlkUix3g.js";import{o as oe,a as se,u as ne}from"./jsonUtils-BseLl1fZ.js";import{p as ae}from"./FeatureEffectLayer-CLTrRFqx.js";import{c as pe}from"./FeatureReductionLayer-DncGsNIN.js";import{f as le}from"./RefreshableLayer-1EkEhJeI.js";import{f as de}from"./TemporalLayer-qq3v_i3q.js";import{D as me}from"./featureLayerUtils-BhDaw8pS.js";import{s as ce}from"./fieldProperties-DMs4wT6-.js";import{C as ue}from"./LabelClass-6cZokw8y.js";import{i as ye}from"./labelingInfo-CijajRsc.js";import{t as he}from"./styleUtils-B_Iy1DTk.js";import{p as fe}from"./popupUtils-DAFYyAvw.js";import{A as c}from"./interfaces-CL2NbQte.js";import"./ColorStop-44hBlQ14.js";import"./diffUtils-B4YFa5Ju.js";import"./colorRamps-BJydlf0f.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-z2k12BH8.js";import"./jsonUtils-qYmXvGJ1.js";import"./styleUtils-CnV_Xzhi.js";import"./Version-Bd0QsIQ5.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./OverrideHelper-B4ryGWZb.js";import"./utils-p-5Bbga5.js";import"./quantizationUtils-CUjGHrU3.js";import"./heatmapUtils-Clt5rJzr.js";import"./FeatureEffect-ByrbZlne.js";import"./FeatureReductionSelection-BY3KVXac.js";import"./MD5-C9MwAd2G.js";import"./TimeInfo-3TVmpFSA.js";import"./AttachmentQuery-D61mmWw4.js";import"./RelationshipQuery-DDK72Kwc.js";import"./labelUtils-Dnqx6jl5.js";import"./defaultsJSON-CHAaurhX.js";var h;let l=h=class extends P{constructor(){super(...arguments),this.age=null,this.ageReceived=null,this.displayCount=null,this.maxObservations=1}clone(){return new h({age:this.age,ageReceived:this.ageReceived,displayCount:this.displayCount,maxObservations:this.maxObservations})}};t([r({type:Number,json:{write:!0}})],l.prototype,"age",void 0),t([r({type:Number,json:{write:!0}})],l.prototype,"ageReceived",void 0),t([r({type:Number,json:{write:!0}})],l.prototype,"displayCount",void 0),t([r({type:Number,json:{write:!0}})],l.prototype,"maxObservations",void 0),l=h=t([I("esri.layers.support.PurgeOptions")],l);const x=l,w=ce();function S(e,o){return new d("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${o}`,{layer:e})}let i=class extends pe(ae(F(de(E(le(A(O(D(k(U(N(re)))))))))))){constructor(...e){super(...e),this.copyright=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.geometryDefinition=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.maxReconnectionAttempts=0,this.maxReconnectionInterval=20,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.operationalLayerType="ArcGISStreamLayer",this.outFields=["*"],this.popupEnabled=!0,this.popupTemplate=null,this.purgeOptions=new x,this.refreshInterval=0,this.screenSizePerspectiveEnabled=!0,this.sourceJSON=null,this.spatialReference=R.WGS84,this.type="stream",this.url=null,this.updateInterval=300,this.useViewTime=!0,this.webSocketUrl=null,this._debouncedSaveOperations=C(async(o,s,a)=>{const{save:n,saveAs:p}=await v(()=>import("./streamLayerUtils-w4YrSJTy.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]));switch(o){case c.SAVE:return n(this,s);case c.SAVE_AS:return p(this,a,s)}})}normalizeCtorArgs(e,o){return typeof e=="string"?{url:e,...o}:e}load(e){if(!("WebSocket"in globalThis))return this.addResolvingPromise(Promise.reject(new d("stream-layer:websocket-unsupported","WebSocket is not supported in this browser. StreamLayer will not have real-time connection with the stream service."))),Promise.resolve(this);const o=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Stream Service","Feed"]},e).catch(V).then(()=>this._fetchService(o))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const o=this._normalizeFeatureReduction(e);this._set("featureReduction",o)}set renderer(e){f(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,o,s){var n;o=o.layerDefinition||o;const a=(n=o.drawingInfo)==null?void 0:n.renderer;if(a){const p=oe(a,o,s)||void 0;return p||L.getLogger(this).error("Failed to create renderer",{rendererDefinition:o.drawingInfo.renderer,layer:this,context:s}),p}return me(o,s)}async connect(e){const[{createConnection:o}]=await Promise.all([v(()=>import("./createConnection-BxU4QDA7.js"),__vite__mapDeps([8,2,3,9,10,11,12,13,14])),this.load()]),s=this.geometryType?y.toJSON(this.geometryType):null,{customParameters:a=null,definitionExpression:n=null,geometryDefinition:p=null,maxReconnectionAttempts:$=0,maxReconnectionInterval:T=20,spatialReference:j=this.spatialReference}=e||this.createConnectionParameters(),m=o(this.parsedUrl,this.spatialReference,j,s,n,p,$,T,a??void 0),_=M([this.on("send-message-to-socket",u=>m.sendMessageToSocket(u)),this.on("send-message-to-client",u=>m.sendMessageToClient(u))]);return m.once("destroy",_.remove),m}createConnectionParameters(){return{spatialReference:this.spatialReference,customParameters:this.customParameters,definitionExpression:this.definitionExpression,geometryDefinition:this.geometryDefinition,maxReconnectionAttempts:this.maxReconnectionAttempts,maxReconnectionInterval:this.maxReconnectionInterval}}createPopupTemplate(e){return fe(this,e)}createQuery(){const e=new G;return e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1",e}getFieldDomain(e,o){if(!this.fields)return null;let s=null;return this.fields.some(a=>(a.name===e&&(s=a.domain),!!s)),s}getField(e){return this.fieldsIndex.get(e)}serviceSupportsSpatialReference(e){return!0}sendMessageToSocket(e){this.emit("send-message-to-socket",e)}sendMessageToClient(e){this.emit("send-message-to-client",e)}async save(e){return this._debouncedSaveOperations(c.SAVE,e)}async saveAs(e,o){return this._debouncedSaveOperations(c.SAVE_AS,o,e)}write(e,o){const s=o==null?void 0:o.messages;return this.webSocketUrl?(s==null||s.push(S(this,"using a custom websocket connection cannot be written to web scenes and web maps")),null):this.parsedUrl?super.write(e,o):(s==null||s.push(S(this,"using a client-side only connection without a url cannot be written to web scenes and web maps")),null)}async _fetchService(e){var o,s,a;if(!this.webSocketUrl&&this.parsedUrl){if(!this.sourceJSON){const{data:n}=await J(this.parsedUrl.path,{query:{f:"json",...this.customParameters,...this.parsedUrl.query},responseType:"json",signal:e});this.sourceJSON=n}}else{if(!((o=this.timeInfo)!=null&&o.trackIdField))throw new d("stream-layer:missing-metadata","The stream layer trackIdField must be specified.");if(!this.objectIdField){const n=(s=this.fields.find(p=>p.type==="oid"))==null?void 0:s.name;if(!n)throw new d("stream-layer:missing-metadata","The stream layer objectIdField must be specified.");this.objectIdField=n}if(!this.fields)throw new d("stream-layer:missing-metadata","The stream layer fields must be specified.");if(this.fields.some(n=>n.name===this.objectIdField)||this.fields.push(new z({name:this.objectIdField,alias:this.objectIdField,type:"oid"})),!this.geometryType)throw new d("stream-layer:missing-metadata","The stream layer geometryType must be specified.");this.webSocketUrl&&(this.url=this.webSocketUrl)}return this.read(this.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:(a=this.portalItem)==null?void 0:a.portal,url:this.parsedUrl}),f(this.renderer,this.fieldsIndex),q(this.timeInfo,this.fieldsIndex),this.objectIdField||(this.objectIdField="__esri_stream_id__"),he(this,{origin:"service"})}};t([r({type:String})],i.prototype,"copyright",void 0),t([r({readOnly:!0})],i.prototype,"defaultPopupTemplate",null),t([r({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),t([r({type:String})],i.prototype,"displayField",void 0),t([r({type:Q})],i.prototype,"elevationInfo",void 0),t([r({json:{origins:{"web-map":{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-scene":{read:!1,write:!1}}}})],i.prototype,"featureReduction",null),t([r(w.fields)],i.prototype,"fields",void 0),t([r(w.fieldsIndex)],i.prototype,"fieldsIndex",void 0),t([r({type:W,json:{name:"layerDefinition.definitionGeometry",write:!0}})],i.prototype,"geometryDefinition",void 0),t([r({type:y.apiValues,json:{read:{reader:y.read}}})],i.prototype,"geometryType",void 0),t([r(Z)],i.prototype,"labelsVisible",void 0),t([r({type:[ue],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:ye},write:!0}})],i.prototype,"labelingInfo",void 0),t([r(B)],i.prototype,"legendEnabled",void 0),t([r({type:["show","hide"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],i.prototype,"listMode",void 0),t([r({type:g})],i.prototype,"maxReconnectionAttempts",void 0),t([r({type:g})],i.prototype,"maxReconnectionInterval",void 0),t([r(X)],i.prototype,"maxScale",void 0),t([r(Y)],i.prototype,"minScale",void 0),t([r({type:String})],i.prototype,"objectIdField",void 0),t([r({value:"ArcGISStreamLayer",type:["ArcGISStreamLayer"]})],i.prototype,"operationalLayerType",void 0),t([r({readOnly:!0})],i.prototype,"outFields",void 0),t([r(H)],i.prototype,"popupEnabled",void 0),t([r({type:K,json:{name:"popupInfo",write:!0}})],i.prototype,"popupTemplate",void 0),t([r({type:x})],i.prototype,"purgeOptions",void 0),t([r({json:{read:!1,write:!1}})],i.prototype,"refreshInterval",void 0),t([r({types:se,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{name:"layerDefinition.drawingInfo.renderer",types:ne,write:!0}},write:{target:"layerDefinition.drawingInfo.renderer"}}})],i.prototype,"renderer",null),t([b("service","renderer",["drawingInfo.renderer","defaultSymbol"]),b("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],i.prototype,"readRenderer",null),t([r((()=>{const e=ee(te);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],i.prototype,"screenSizePerspectiveEnabled",void 0),t([r()],i.prototype,"sourceJSON",void 0),t([r({type:R,json:{origins:{service:{read:{source:"spatialReference"}}}}})],i.prototype,"spatialReference",void 0),t([r({json:{read:!1}})],i.prototype,"type",void 0),t([r(ie)],i.prototype,"url",void 0),t([r({type:Number})],i.prototype,"updateInterval",void 0),t([r({json:{read:!1,write:!1}})],i.prototype,"useViewTime",void 0),t([r({type:String})],i.prototype,"webSocketUrl",void 0),i=t([I("esri.layers.StreamLayer")],i);const Ke=i;export{Ke as default}; +import{d as t,y as r,f as I,aU as P,bP as F,bQ as E,dM as A,dp as O,dq as D,dr as k,dO as U,b4 as N,aS as R,k as C,N as d,ay as V,fA as f,s as L,_ as v,d3 as y,eF as M,aX as G,M as J,a_ as z,b3 as q,bR as Q,aE as W,fB as Z,dt as B,dS as g,fQ as X,fR as Y,fD as H,i as K,aZ as b,aV as ee,fE as te,du as ie,bT as re}from"./index-BjUNJPVf.js";import"./UniqueValueRenderer-7V9Bhr-D.js";import{o as oe,a as se,u as ne}from"./jsonUtils-Dw332y6z.js";import{p as ae}from"./FeatureEffectLayer-DarO4Ctx.js";import{c as pe}from"./FeatureReductionLayer-CK-tyM-9.js";import{f as le}from"./RefreshableLayer-_r2TPtol.js";import{f as de}from"./TemporalLayer-CKICYnEl.js";import{D as me}from"./featureLayerUtils-lwqyOSrl.js";import{s as ce}from"./fieldProperties-DnrQXLBM.js";import{C as ue}from"./LabelClass-CeatfK8u.js";import{i as ye}from"./labelingInfo-DqAUis6e.js";import{t as he}from"./styleUtils--I7zqeL6.js";import{p as fe}from"./popupUtils-DlZin22m.js";import{A as c}from"./interfaces-CL2NbQte.js";import"./ColorStop-DCGjAKLC.js";import"./diffUtils-uUoMDFQS.js";import"./colorRamps-CcakIWlU.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-BX9G5gNQ.js";import"./jsonUtils-Ox5U0P0F.js";import"./styleUtils-DOUOskVZ.js";import"./Version-Dqq_CHBG.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./OverrideHelper-DxFZBnGL.js";import"./utils-CuXO_Zzq.js";import"./quantizationUtils-CfV316jZ.js";import"./heatmapUtils-BSteZBTj.js";import"./FeatureEffect-DBbkrS6j.js";import"./FeatureReductionSelection-t3T7oa8H.js";import"./MD5-C9MwAd2G.js";import"./TimeInfo-DooETFWC.js";import"./AttachmentQuery-DmEAIZff.js";import"./RelationshipQuery-BDJrOxaX.js";import"./labelUtils-3p0-m-Ee.js";import"./defaultsJSON-CHAaurhX.js";var h;let l=h=class extends P{constructor(){super(...arguments),this.age=null,this.ageReceived=null,this.displayCount=null,this.maxObservations=1}clone(){return new h({age:this.age,ageReceived:this.ageReceived,displayCount:this.displayCount,maxObservations:this.maxObservations})}};t([r({type:Number,json:{write:!0}})],l.prototype,"age",void 0),t([r({type:Number,json:{write:!0}})],l.prototype,"ageReceived",void 0),t([r({type:Number,json:{write:!0}})],l.prototype,"displayCount",void 0),t([r({type:Number,json:{write:!0}})],l.prototype,"maxObservations",void 0),l=h=t([I("esri.layers.support.PurgeOptions")],l);const x=l,w=ce();function S(e,o){return new d("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${o}`,{layer:e})}let i=class extends pe(ae(F(de(E(le(A(O(D(k(U(N(re)))))))))))){constructor(...e){super(...e),this.copyright=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.geometryDefinition=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.maxReconnectionAttempts=0,this.maxReconnectionInterval=20,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.operationalLayerType="ArcGISStreamLayer",this.outFields=["*"],this.popupEnabled=!0,this.popupTemplate=null,this.purgeOptions=new x,this.refreshInterval=0,this.screenSizePerspectiveEnabled=!0,this.sourceJSON=null,this.spatialReference=R.WGS84,this.type="stream",this.url=null,this.updateInterval=300,this.useViewTime=!0,this.webSocketUrl=null,this._debouncedSaveOperations=C(async(o,s,a)=>{const{save:n,saveAs:p}=await v(()=>import("./streamLayerUtils-i1YzXlx2.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]));switch(o){case c.SAVE:return n(this,s);case c.SAVE_AS:return p(this,a,s)}})}normalizeCtorArgs(e,o){return typeof e=="string"?{url:e,...o}:e}load(e){if(!("WebSocket"in globalThis))return this.addResolvingPromise(Promise.reject(new d("stream-layer:websocket-unsupported","WebSocket is not supported in this browser. StreamLayer will not have real-time connection with the stream service."))),Promise.resolve(this);const o=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Stream Service","Feed"]},e).catch(V).then(()=>this._fetchService(o))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const o=this._normalizeFeatureReduction(e);this._set("featureReduction",o)}set renderer(e){f(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,o,s){var n;o=o.layerDefinition||o;const a=(n=o.drawingInfo)==null?void 0:n.renderer;if(a){const p=oe(a,o,s)||void 0;return p||L.getLogger(this).error("Failed to create renderer",{rendererDefinition:o.drawingInfo.renderer,layer:this,context:s}),p}return me(o,s)}async connect(e){const[{createConnection:o}]=await Promise.all([v(()=>import("./createConnection-BvioR9C8.js"),__vite__mapDeps([8,2,3,9,10,11,12,13,14])),this.load()]),s=this.geometryType?y.toJSON(this.geometryType):null,{customParameters:a=null,definitionExpression:n=null,geometryDefinition:p=null,maxReconnectionAttempts:$=0,maxReconnectionInterval:T=20,spatialReference:j=this.spatialReference}=e||this.createConnectionParameters(),m=o(this.parsedUrl,this.spatialReference,j,s,n,p,$,T,a??void 0),_=M([this.on("send-message-to-socket",u=>m.sendMessageToSocket(u)),this.on("send-message-to-client",u=>m.sendMessageToClient(u))]);return m.once("destroy",_.remove),m}createConnectionParameters(){return{spatialReference:this.spatialReference,customParameters:this.customParameters,definitionExpression:this.definitionExpression,geometryDefinition:this.geometryDefinition,maxReconnectionAttempts:this.maxReconnectionAttempts,maxReconnectionInterval:this.maxReconnectionInterval}}createPopupTemplate(e){return fe(this,e)}createQuery(){const e=new G;return e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1",e}getFieldDomain(e,o){if(!this.fields)return null;let s=null;return this.fields.some(a=>(a.name===e&&(s=a.domain),!!s)),s}getField(e){return this.fieldsIndex.get(e)}serviceSupportsSpatialReference(e){return!0}sendMessageToSocket(e){this.emit("send-message-to-socket",e)}sendMessageToClient(e){this.emit("send-message-to-client",e)}async save(e){return this._debouncedSaveOperations(c.SAVE,e)}async saveAs(e,o){return this._debouncedSaveOperations(c.SAVE_AS,o,e)}write(e,o){const s=o==null?void 0:o.messages;return this.webSocketUrl?(s==null||s.push(S(this,"using a custom websocket connection cannot be written to web scenes and web maps")),null):this.parsedUrl?super.write(e,o):(s==null||s.push(S(this,"using a client-side only connection without a url cannot be written to web scenes and web maps")),null)}async _fetchService(e){var o,s,a;if(!this.webSocketUrl&&this.parsedUrl){if(!this.sourceJSON){const{data:n}=await J(this.parsedUrl.path,{query:{f:"json",...this.customParameters,...this.parsedUrl.query},responseType:"json",signal:e});this.sourceJSON=n}}else{if(!((o=this.timeInfo)!=null&&o.trackIdField))throw new d("stream-layer:missing-metadata","The stream layer trackIdField must be specified.");if(!this.objectIdField){const n=(s=this.fields.find(p=>p.type==="oid"))==null?void 0:s.name;if(!n)throw new d("stream-layer:missing-metadata","The stream layer objectIdField must be specified.");this.objectIdField=n}if(!this.fields)throw new d("stream-layer:missing-metadata","The stream layer fields must be specified.");if(this.fields.some(n=>n.name===this.objectIdField)||this.fields.push(new z({name:this.objectIdField,alias:this.objectIdField,type:"oid"})),!this.geometryType)throw new d("stream-layer:missing-metadata","The stream layer geometryType must be specified.");this.webSocketUrl&&(this.url=this.webSocketUrl)}return this.read(this.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:(a=this.portalItem)==null?void 0:a.portal,url:this.parsedUrl}),f(this.renderer,this.fieldsIndex),q(this.timeInfo,this.fieldsIndex),this.objectIdField||(this.objectIdField="__esri_stream_id__"),he(this,{origin:"service"})}};t([r({type:String})],i.prototype,"copyright",void 0),t([r({readOnly:!0})],i.prototype,"defaultPopupTemplate",null),t([r({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),t([r({type:String})],i.prototype,"displayField",void 0),t([r({type:Q})],i.prototype,"elevationInfo",void 0),t([r({json:{origins:{"web-map":{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-scene":{read:!1,write:!1}}}})],i.prototype,"featureReduction",null),t([r(w.fields)],i.prototype,"fields",void 0),t([r(w.fieldsIndex)],i.prototype,"fieldsIndex",void 0),t([r({type:W,json:{name:"layerDefinition.definitionGeometry",write:!0}})],i.prototype,"geometryDefinition",void 0),t([r({type:y.apiValues,json:{read:{reader:y.read}}})],i.prototype,"geometryType",void 0),t([r(Z)],i.prototype,"labelsVisible",void 0),t([r({type:[ue],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:ye},write:!0}})],i.prototype,"labelingInfo",void 0),t([r(B)],i.prototype,"legendEnabled",void 0),t([r({type:["show","hide"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],i.prototype,"listMode",void 0),t([r({type:g})],i.prototype,"maxReconnectionAttempts",void 0),t([r({type:g})],i.prototype,"maxReconnectionInterval",void 0),t([r(X)],i.prototype,"maxScale",void 0),t([r(Y)],i.prototype,"minScale",void 0),t([r({type:String})],i.prototype,"objectIdField",void 0),t([r({value:"ArcGISStreamLayer",type:["ArcGISStreamLayer"]})],i.prototype,"operationalLayerType",void 0),t([r({readOnly:!0})],i.prototype,"outFields",void 0),t([r(H)],i.prototype,"popupEnabled",void 0),t([r({type:K,json:{name:"popupInfo",write:!0}})],i.prototype,"popupTemplate",void 0),t([r({type:x})],i.prototype,"purgeOptions",void 0),t([r({json:{read:!1,write:!1}})],i.prototype,"refreshInterval",void 0),t([r({types:se,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{name:"layerDefinition.drawingInfo.renderer",types:ne,write:!0}},write:{target:"layerDefinition.drawingInfo.renderer"}}})],i.prototype,"renderer",null),t([b("service","renderer",["drawingInfo.renderer","defaultSymbol"]),b("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],i.prototype,"readRenderer",null),t([r((()=>{const e=ee(te);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],i.prototype,"screenSizePerspectiveEnabled",void 0),t([r()],i.prototype,"sourceJSON",void 0),t([r({type:R,json:{origins:{service:{read:{source:"spatialReference"}}}}})],i.prototype,"spatialReference",void 0),t([r({json:{read:!1}})],i.prototype,"type",void 0),t([r(ie)],i.prototype,"url",void 0),t([r({type:Number})],i.prototype,"updateInterval",void 0),t([r({json:{read:!1,write:!1}})],i.prototype,"useViewTime",void 0),t([r({type:String})],i.prototype,"webSocketUrl",void 0),i=t([I("esri.layers.StreamLayer")],i);const Ke=i;export{Ke as default}; diff --git a/assets/StreamLayerView2D-Be7jZFcL.js b/assets/StreamLayerView2D-DqZHXc4V.js similarity index 71% rename from assets/StreamLayerView2D-Be7jZFcL.js rename to assets/StreamLayerView2D-DqZHXc4V.js index 42c2017..8807dda 100644 --- a/assets/StreamLayerView2D-Be7jZFcL.js +++ b/assets/StreamLayerView2D-DqZHXc4V.js @@ -1 +1 @@ -import{d as s,y as o,f as h,g as m,N as l,eF as _,e as y}from"./index-CEWggaxV.js";import{d as c}from"./FeatureSet-CYJUZgOk.js";import{n as f,X as g}from"./FeatureLayerView2D-Dw_5zj3d.js";import{d as v}from"./FeatureEffect-ByrbZlne.js";import"./diffUtils-B4YFa5Ju.js";import"./Container-CB7SlLB9.js";import"./highlightReasons-DbgbcWKM.js";import"./Texture-DJgkMrSB.js";import"./LayerView-BEFTHNYv.js";import"./scaleUtils-Bqauo1zZ.js";import"./TechniqueInstance-CSsTmbek.js";import"./UpdateTracking2D-nj9Q-3df.js";import"./TurboLine-CkxIB4ZX.js";import"./earcut-hRlx3adE.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./utils-p-5Bbga5.js";import"./Rect-CUzevAry.js";import"./LabelMetric-D2hbzzy_.js";import"./Program-DLRmaKpw.js";import"./labelUtils-Dnqx6jl5.js";import"./defaultsJSON-CHAaurhX.js";import"./BindType-BmZEZMMh.js";import"./Util-BS8sJGjF.js";import"./constants-D5zmR9t2.js";import"./TileContainer-Ci6dOowA.js";import"./WGLContainer-B_Pv-8Yi.js";import"./ProgramTemplate-BICQrNzS.js";import"./config-MDUrh2eL.js";import"./featureConversionUtils-CmP9mw0r.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./tileUtils-B7X19rIS.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./OrderByInfo-DKzv2-WS.js";import"./labelingInfo-CijajRsc.js";import"./LabelClass-6cZokw8y.js";import"./jsonUtils-qYmXvGJ1.js";import"./heatmapUtils-Clt5rJzr.js";import"./SDFHelper-CSK796Wb.js";import"./floatRGBA-BLm-Rhaq.js";import"./FeatureCommandQueue-Btq_FXyi.js";import"./HighlightCounter-abgLEfgq.js";import"./floorFilterUtils-DZ5C6FQv.js";import"./popupUtils-BovqErR_.js";import"./RefreshableLayerView-C1-PEoNB.js";const S=e=>{let t=class extends e{resume(){this._isUserPaused=!1,this.suspended||this._doResume()}pause(){this._isUserPaused=!0,this.suspended||this._doPause()}disconnect(){this._doDisconnect()}connect(){this._doConnect()}clear(){this._doClear()}constructor(...r){super(...r),this._isUserPaused=!1,this.filter=null}get connectionStatus(){return(this._isUserPaused||this.suspended)&&this._streamConnectionStatus==="connected"?"paused":this._streamConnectionStatus}_onSuspendedChange(r){r?this._doPause():this._isUserPaused||this._doResume()}};return s([o()],t.prototype,"_isUserPaused",void 0),s([o({readOnly:!0})],t.prototype,"connectionStatus",null),s([o({type:v})],t.prototype,"filter",void 0),t=s([h("esri.layers.mixins.StreamLayerView")],t),t};let i=class extends S(g){constructor(){super(...arguments),this.pipelineConnectionStatus="disconnected",this.pipelineErrorString=null}initialize(){this.addHandles([m(()=>this.layer.customParameters,e=>this._worker.streamMessenger.updateCustomParameters(e)),this.layer.on("send-message-to-socket",e=>this._worker.streamMessenger.sendMessageToSocket(e)),this.layer.on("send-message-to-client",e=>{this._worker.streamMessenger.sendMessageToClient(e),this._isUserPaused&&"type"in e&&e.type==="clear"&&this.incrementSourceRefreshVersion()}),m(()=>this.layer.purgeOptions,()=>this._update()),m(()=>this.suspended,this._onSuspendedChange.bind(this))],"constructor"),this._doResume()}destroy(){this._doPause()}get connectionError(){return this.pipelineErrorString?new l("stream-controller",this.pipelineErrorString):null}on(e,t){if(Array.isArray(e))return _(e.map(p=>this.on(p,t)));const r=["data-received","message-received"].includes(e);r&&this._worker.streamMessenger.enableEvent(e,!0);const a=super.on(e,t),n=this;return y(()=>{a.remove(),r&&(n._worker.closed||n.hasEventListener(e)||n._worker.streamMessenger.enableEvent(e,!1))})}queryLatestObservations(e,t){var r,a,n;if(!((r=this.layer.timeInfo)!=null&&r.endField||(a=this.layer.timeInfo)!=null&&a.startField||(n=this.layer.timeInfo)!=null&&n.trackIdField))throw new l("streamlayer-no-timeField","queryLatestObservation can only be used with services that define a TrackIdField");return f(this._worker.features.executeQueryForLatestObservations(this._cleanUpQuery(e),t).then(p=>{const u=c.fromJSON(p);return u.features.forEach(d=>{d.layer=this.layer,d.sourceLayer=this.layer}),u}),new c({features:[]}))}detach(){super.detach(),this.pipelineConnectionStatus="disconnected"}get _streamConnectionStatus(){return this.pipelineConnectionStatus}_doPause(){this._refreshInterval!=null&&(clearInterval(this._refreshInterval),this._refreshInterval=null)}_doResume(){this._refreshInterval=setInterval(()=>this.incrementSourceRefreshVersion(),this.layer.updateInterval)}_doDisconnect(){this._worker.streamMessenger.disconnect(),this._doPause()}_doConnect(){this._worker.streamMessenger.connect(),this.resume()}_doClear(){this._worker.streamMessenger.clear(),this._refreshInterval==null&&this.incrementSourceRefreshVersion()}_createClientOptions(){const e=super._createClientOptions(),t=this;return{...e,get container(){return t.featureContainer},setProperty:r=>{this.set(r.propertyName,r.value)}}}};s([o()],i.prototype,"pipelineConnectionStatus",void 0),s([o()],i.prototype,"pipelineErrorString",void 0),s([o({readOnly:!0})],i.prototype,"connectionError",null),s([o({readOnly:!0})],i.prototype,"_streamConnectionStatus",null),i=s([h("esri.views.2d.layers.StreamLayerView2D")],i);const de=i;export{de as default}; +import{d as s,y as o,f as h,g as m,N as l,eF as _,e as y}from"./index-BjUNJPVf.js";import{d as c}from"./FeatureSet-opEn8ou8.js";import{n as f,X as g}from"./FeatureLayerView2D-B6lIa9Lt.js";import{d as v}from"./FeatureEffect-DBbkrS6j.js";import"./diffUtils-uUoMDFQS.js";import"./Container-_n5wCgez.js";import"./highlightReasons-BOU4mnPE.js";import"./Texture-S4dD-WHn.js";import"./LayerView-Bux7vAEn.js";import"./scaleUtils-DWXMiS7R.js";import"./TechniqueInstance-XtnK2qy2.js";import"./UpdateTracking2D-Ds_Gdrxd.js";import"./TurboLine-DNQdPIXo.js";import"./earcut-CWKXDqDj.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./utils-CuXO_Zzq.js";import"./Rect-CUzevAry.js";import"./LabelMetric-BcUxDImF.js";import"./Program-DBsYtQ00.js";import"./labelUtils-3p0-m-Ee.js";import"./defaultsJSON-CHAaurhX.js";import"./BindType-BmZEZMMh.js";import"./Util-CS5u4Lec.js";import"./constants-D5zmR9t2.js";import"./TileContainer-Bs-vXdD_.js";import"./WGLContainer-DgZNq7b0.js";import"./ProgramTemplate-Ck2I0bIi.js";import"./config-MDUrh2eL.js";import"./featureConversionUtils-BHhm7bvm.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./tileUtils-B7X19rIS.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./OrderByInfo-DKyk5GLW.js";import"./labelingInfo-DqAUis6e.js";import"./LabelClass-CeatfK8u.js";import"./jsonUtils-Ox5U0P0F.js";import"./heatmapUtils-BSteZBTj.js";import"./SDFHelper-kKuXhauo.js";import"./floatRGBA-Cs54GdjG.js";import"./FeatureCommandQueue-DI81F3gA.js";import"./HighlightCounter-qEuAaY1V.js";import"./floorFilterUtils-DZ5C6FQv.js";import"./popupUtils-Do2GfZME.js";import"./RefreshableLayerView-L9NGpXXI.js";const S=e=>{let t=class extends e{resume(){this._isUserPaused=!1,this.suspended||this._doResume()}pause(){this._isUserPaused=!0,this.suspended||this._doPause()}disconnect(){this._doDisconnect()}connect(){this._doConnect()}clear(){this._doClear()}constructor(...r){super(...r),this._isUserPaused=!1,this.filter=null}get connectionStatus(){return(this._isUserPaused||this.suspended)&&this._streamConnectionStatus==="connected"?"paused":this._streamConnectionStatus}_onSuspendedChange(r){r?this._doPause():this._isUserPaused||this._doResume()}};return s([o()],t.prototype,"_isUserPaused",void 0),s([o({readOnly:!0})],t.prototype,"connectionStatus",null),s([o({type:v})],t.prototype,"filter",void 0),t=s([h("esri.layers.mixins.StreamLayerView")],t),t};let i=class extends S(g){constructor(){super(...arguments),this.pipelineConnectionStatus="disconnected",this.pipelineErrorString=null}initialize(){this.addHandles([m(()=>this.layer.customParameters,e=>this._worker.streamMessenger.updateCustomParameters(e)),this.layer.on("send-message-to-socket",e=>this._worker.streamMessenger.sendMessageToSocket(e)),this.layer.on("send-message-to-client",e=>{this._worker.streamMessenger.sendMessageToClient(e),this._isUserPaused&&"type"in e&&e.type==="clear"&&this.incrementSourceRefreshVersion()}),m(()=>this.layer.purgeOptions,()=>this._update()),m(()=>this.suspended,this._onSuspendedChange.bind(this))],"constructor"),this._doResume()}destroy(){this._doPause()}get connectionError(){return this.pipelineErrorString?new l("stream-controller",this.pipelineErrorString):null}on(e,t){if(Array.isArray(e))return _(e.map(p=>this.on(p,t)));const r=["data-received","message-received"].includes(e);r&&this._worker.streamMessenger.enableEvent(e,!0);const a=super.on(e,t),n=this;return y(()=>{a.remove(),r&&(n._worker.closed||n.hasEventListener(e)||n._worker.streamMessenger.enableEvent(e,!1))})}queryLatestObservations(e,t){var r,a,n;if(!((r=this.layer.timeInfo)!=null&&r.endField||(a=this.layer.timeInfo)!=null&&a.startField||(n=this.layer.timeInfo)!=null&&n.trackIdField))throw new l("streamlayer-no-timeField","queryLatestObservation can only be used with services that define a TrackIdField");return f(this._worker.features.executeQueryForLatestObservations(this._cleanUpQuery(e),t).then(p=>{const u=c.fromJSON(p);return u.features.forEach(d=>{d.layer=this.layer,d.sourceLayer=this.layer}),u}),new c({features:[]}))}detach(){super.detach(),this.pipelineConnectionStatus="disconnected"}get _streamConnectionStatus(){return this.pipelineConnectionStatus}_doPause(){this._refreshInterval!=null&&(clearInterval(this._refreshInterval),this._refreshInterval=null)}_doResume(){this._refreshInterval=setInterval(()=>this.incrementSourceRefreshVersion(),this.layer.updateInterval)}_doDisconnect(){this._worker.streamMessenger.disconnect(),this._doPause()}_doConnect(){this._worker.streamMessenger.connect(),this.resume()}_doClear(){this._worker.streamMessenger.clear(),this._refreshInterval==null&&this.incrementSourceRefreshVersion()}_createClientOptions(){const e=super._createClientOptions(),t=this;return{...e,get container(){return t.featureContainer},setProperty:r=>{this.set(r.propertyName,r.value)}}}};s([o()],i.prototype,"pipelineConnectionStatus",void 0),s([o()],i.prototype,"pipelineErrorString",void 0),s([o({readOnly:!0})],i.prototype,"connectionError",null),s([o({readOnly:!0})],i.prototype,"_streamConnectionStatus",null),i=s([h("esri.views.2d.layers.StreamLayerView2D")],i);const de=i;export{de as default}; diff --git a/assets/SublayersOwner-CJjJUh6G.js b/assets/SublayersOwner-CywL6RlY.js similarity index 91% rename from assets/SublayersOwner-CJjJUh6G.js rename to assets/SublayersOwner-CywL6RlY.js index e0adb07..61ddb7c 100644 --- a/assets/SublayersOwner-CJjJUh6G.js +++ b/assets/SublayersOwner-CywL6RlY.js @@ -1,7 +1,7 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/FeatureLayer-D0kMrROG.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css","assets/UniqueValueRenderer-BlkUix3g.js","assets/ColorStop-44hBlQ14.js","assets/diffUtils-B4YFa5Ju.js","assets/colorRamps-BJydlf0f.js","assets/sizeVariableUtils-Cmcuvw-4.js","assets/visualVariableUtils-z2k12BH8.js","assets/jsonUtils-qYmXvGJ1.js","assets/styleUtils-CnV_Xzhi.js","assets/jsonUtils-BseLl1fZ.js","assets/Version-Bd0QsIQ5.js","assets/FieldsIndex-CLgRNeJ_.js","assets/UnknownTimeZone-DF0BqWCR.js","assets/OverrideHelper-B4ryGWZb.js","assets/utils-p-5Bbga5.js","assets/quantizationUtils-CUjGHrU3.js","assets/heatmapUtils-Clt5rJzr.js","assets/FormTemplate-eV18QveB.js","assets/editsZScale-CQCGPEjO.js","assets/queryZScale-DN4aFXYn.js","assets/FeatureSet-CYJUZgOk.js","assets/EditBusLayer-SG7oYwiY.js","assets/FeatureEffectLayer-CLTrRFqx.js","assets/FeatureEffect-ByrbZlne.js","assets/FeatureLayerBase-DPJuwFpX.js","assets/featureLayerUtils-BhDaw8pS.js","assets/AttachmentQuery-D61mmWw4.js","assets/RelationshipQuery-DDK72Kwc.js","assets/LayerFloorInfo-Cdq3ulNh.js","assets/serviceCapabilitiesUtils-t8SL4e_j.js","assets/FeatureReductionLayer-DncGsNIN.js","assets/FeatureReductionSelection-BY3KVXac.js","assets/LabelClass-6cZokw8y.js","assets/labelUtils-Dnqx6jl5.js","assets/defaultsJSON-CHAaurhX.js","assets/MD5-C9MwAd2G.js","assets/OrderedLayer-Do089KpQ.js","assets/OrderByInfo-DKzv2-WS.js","assets/RefreshableLayer-1EkEhJeI.js","assets/TemporalLayer-qq3v_i3q.js","assets/TimeInfo-3TVmpFSA.js","assets/FeatureTemplate-DcprAdTM.js","assets/FeatureType-By3BEr9z.js","assets/fieldProperties-DMs4wT6-.js","assets/labelingInfo-CijajRsc.js","assets/versionUtils-CaceEUVY.js","assets/styleUtils-B_Iy1DTk.js","assets/TopFeaturesQuery-B8kC7n5h.js","assets/popupUtils-DAFYyAvw.js","assets/interfaces-CL2NbQte.js"] + __vite__mapDeps.viteFileDeps = ["assets/FeatureLayer-BHxNIHhy.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css","assets/UniqueValueRenderer-7V9Bhr-D.js","assets/ColorStop-DCGjAKLC.js","assets/diffUtils-uUoMDFQS.js","assets/colorRamps-CcakIWlU.js","assets/sizeVariableUtils-Cmcuvw-4.js","assets/visualVariableUtils-BX9G5gNQ.js","assets/jsonUtils-Ox5U0P0F.js","assets/styleUtils-DOUOskVZ.js","assets/jsonUtils-Dw332y6z.js","assets/Version-Dqq_CHBG.js","assets/FieldsIndex-CK-0B5n9.js","assets/UnknownTimeZone-CK7VjgF3.js","assets/OverrideHelper-DxFZBnGL.js","assets/utils-CuXO_Zzq.js","assets/quantizationUtils-CfV316jZ.js","assets/heatmapUtils-BSteZBTj.js","assets/FormTemplate-BGxtsGX6.js","assets/editsZScale-Bfe6gH1b.js","assets/queryZScale-Dwvn5BlQ.js","assets/FeatureSet-opEn8ou8.js","assets/EditBusLayer-OslMX9fF.js","assets/FeatureEffectLayer-DarO4Ctx.js","assets/FeatureEffect-DBbkrS6j.js","assets/FeatureLayerBase-D0I-Escx.js","assets/featureLayerUtils-lwqyOSrl.js","assets/AttachmentQuery-DmEAIZff.js","assets/RelationshipQuery-BDJrOxaX.js","assets/LayerFloorInfo-DlYNbO-A.js","assets/serviceCapabilitiesUtils-DiP90Uds.js","assets/FeatureReductionLayer-CK-tyM-9.js","assets/FeatureReductionSelection-t3T7oa8H.js","assets/LabelClass-CeatfK8u.js","assets/labelUtils-3p0-m-Ee.js","assets/defaultsJSON-CHAaurhX.js","assets/MD5-C9MwAd2G.js","assets/OrderedLayer-dLoPhxcx.js","assets/OrderByInfo-DKyk5GLW.js","assets/RefreshableLayer-_r2TPtol.js","assets/TemporalLayer-CKICYnEl.js","assets/TimeInfo-DooETFWC.js","assets/FeatureTemplate-FZNGA_Ik.js","assets/FeatureType-CwUl8Nf5.js","assets/fieldProperties-DnrQXLBM.js","assets/labelingInfo-DqAUis6e.js","assets/versionUtils-BIAEZzrm.js","assets/styleUtils--I7zqeL6.js","assets/TopFeaturesQuery-CVQjqlfM.js","assets/popupUtils-DlZin22m.js","assets/interfaces-CL2NbQte.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{d as s,y as n,aZ as g,aE as z,ds as Y,fD as ee,aS as te,f as k,h3 as J,at as Q,bs as u,b_ as W,M as $,av as H,Z as re,dr as ie,dn as ae,N as S,aW as se,h4 as le,E as oe,d7 as ne,s as E,h5 as R,aT as ye,V as U,e0 as pe,a6 as P,aX as ue,_ as de,aV as _,n as ce,d3 as q,a_ as he,dS as V,aR as w,i as fe,aQ as G,er as K,e1 as be,dF as L,fw as me,C as ge,g as Se,ez as Ie,h6 as ve}from"./index-CEWggaxV.js";import{r as we}from"./Version-Bd0QsIQ5.js";import"./UniqueValueRenderer-BlkUix3g.js";import{a as Ee,u as Le}from"./jsonUtils-BseLl1fZ.js";import{x as xe}from"./QueryTask-CjHwD7wL.js";import{n as Oe}from"./FeatureType-By3BEr9z.js";import{Z as Te}from"./FieldsIndex-CLgRNeJ_.js";import{C as De}from"./LabelClass-6cZokw8y.js";import{c as _e}from"./labelingInfo-CijajRsc.js";import{p as Fe}from"./LayerFloorInfo-Cdq3ulNh.js";import{a as Pe}from"./serviceCapabilitiesUtils-t8SL4e_j.js";import{c as Ae}from"./AttachmentQuery-D61mmWw4.js";import{p as Ve}from"./popupUtils-DAFYyAvw.js";import{o as Me}from"./sublayerUtils-BPYHHPMV.js";const Xe=r=>{let e=class extends r{constructor(){super(...arguments),this.capabilities=void 0,this.copyright=null,this.fullExtent=null,this.legendEnabled=!0,this.spatialReference=null,this.version=void 0,this._allLayersAndTablesMap=null}readCapabilities(t,i){const a=i.capabilities&&i.capabilities.split(",").map(Z=>Z.toLowerCase().trim());if(!a)return{operations:{supportsExportMap:!1,supportsExportTiles:!1,supportsIdentify:!1,supportsQuery:!1,supportsTileMap:!1},exportMap:null,exportTiles:null};const l=this.type,y=l!=="tile"&&!!i.supportsDynamicLayers,p=a.includes("query"),d=a.includes("map"),c=!!i.exportTilesAllowed,b=a.includes("tilemap"),I=a.includes("data"),x=l!=="tile"&&(!i.tileInfo||y),O=l!=="tile"&&(!i.tileInfo||y),h=l!=="tile",f=i.cimVersion&&we.parse(i.cimVersion),T=(f==null?void 0:f.since(1,4))??!1,D=(f==null?void 0:f.since(2,0))??!1;return{operations:{supportsExportMap:d,supportsExportTiles:c,supportsIdentify:p,supportsQuery:I,supportsTileMap:b},exportMap:d?{supportsArcadeExpressionForLabeling:T,supportsSublayersChanges:h,supportsDynamicLayers:y,supportsSublayerVisibility:x,supportsSublayerDefinitionExpression:O,supportsCIMSymbols:D}:null,exportTiles:c?{maxExportTilesCount:+i.maxExportTilesCount}:null}}readVersion(t,i){let a=i.currentVersion;return a||(a=i.hasOwnProperty("capabilities")||i.hasOwnProperty("tables")?10:i.hasOwnProperty("supportedImageFormatTypes")?9.31:9.3),a}async fetchRelatedService(t){const i=this.portalItem;if(!i||!J(i))return null;this._relatedFeatureServicePromise||(this._relatedFeatureServicePromise=i.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},t).then(l=>l.find(y=>y.type==="Feature Service")??null,()=>null));const a=await this._relatedFeatureServicePromise;return Q(t),a?{itemId:a.id,url:a.url}:null}async fetchSublayerInfo(t,i){var p;const{source:a}=t;if(this!=null&&this.portalItem&&this.type==="tile"&&(a==null?void 0:a.type)==="map-layer"&&J(this.portalItem)&&t.originIdOf("url")u.SERVICE)try{const d=await this._fetchAllLayersAndTablesFromService(l),c=((p=H(l))==null?void 0:p.sublayer)??a.mapLayerId;y=d.get(c)}catch{}else{let d=t.id;(a==null?void 0:a.type)==="map-layer"&&(d=a.mapLayerId);try{y=(await this.fetchAllLayersAndTables(i)).get(d)}catch{}}return y}async fetchAllLayersAndTables(t){var i;return this._fetchAllLayersAndTablesFromService((i=this.parsedUrl)==null?void 0:i.path,t)}async _fetchAllLayersAndTablesFromService(t,i){await this.load(i),this._allLayersAndTablesMap||(this._allLayersAndTablesMap=new Map);const a=H(t),l=re(this._allLayersAndTablesMap,a==null?void 0:a.url.path,()=>$(W(a==null?void 0:a.url.path,"/layers"),{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey}}).then(p=>{const d=new Map;for(const c of p.data.layers)d.set(c.id,c);return{result:d}},p=>({error:p}))),y=await l;if(Q(i),"result"in y)return y.result;throw y.error}};return s([n({readOnly:!0})],e.prototype,"capabilities",void 0),s([g("service","capabilities",["capabilities","exportTilesAllowed","maxExportTilesCount","supportsDynamicLayers","tileInfo"])],e.prototype,"readCapabilities",null),s([n({json:{read:{source:"copyrightText"}}})],e.prototype,"copyright",void 0),s([n({type:z})],e.prototype,"fullExtent",void 0),s([n(Y)],e.prototype,"id",void 0),s([n({type:Boolean,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend"}}})],e.prototype,"legendEnabled",void 0),s([n(ee)],e.prototype,"popupEnabled",void 0),s([n({type:te})],e.prototype,"spatialReference",void 0),s([n({readOnly:!0})],e.prototype,"version",void 0),s([g("version",["currentVersion","capabilities","tables","supportedImageFormatTypes"])],e.prototype,"readVersion",null),e=s([k("esri.layers.mixins.ArcGISMapService")],e),e};var A;function M(r){return r!=null&&r.type==="esriSMS"}function j(r,e,t){var a;const i=this.originIdOf(e)>=L(t.origin);return{ignoreOrigin:!0,allowNull:i,enabled:!!t&&((a=t.layer)==null?void 0:a.type)==="map-image"&&(t.writeSublayerStructure||i)}}function C(r,e,t){var i;return{enabled:!!t&&((i=t.layer)==null?void 0:i.type)==="tile"&&(t.origin&&this.originIdOf(e)>=L(t.origin)||this._isOverridden(e))}}function m(r,e,t){return{ignoreOrigin:!0,enabled:t&&t.writeSublayerStructure||!1}}function F(r,e,t){return{ignoreOrigin:!0,enabled:!!t&&(t.writeSublayerStructure||this.originIdOf(e)>=L(t.origin))}}let je=0;const v=new Set;v.add("layer"),v.add("parent"),v.add("loaded"),v.add("loadStatus"),v.add("loadError"),v.add("loadWarnings");let o=A=class extends ie(ae(me)){constructor(r){super(r),this.capabilities=void 0,this.maxScaleRange={minScale:0,maxScale:0},this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.legendEnabled=!0,this.objectIdField=null,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.sourceJSON=null,this.title=null,this.typeIdField=null,this.type="sublayer",this.types=null,this._lastParsedUrl=null}async load(r){return this.addResolvingPromise((async()=>{const{layer:e,url:t}=this;if(!e&&!t)throw new S("sublayer:missing-layer","Sublayer can't be loaded without being part of a layer",{sublayer:this});const i=e?await e.fetchSublayerInfo(this,r):(await $(t,{responseType:"json",query:{f:"json"},...r})).data;i&&(this.sourceJSON=i,this.read({layerDefinition:i},{origin:"service",layer:e,url:se(t)}))})()),this}readCapabilities(r,e){e=e.layerDefinition||e;const{operations:{supportsQuery:t,supportsQueryAttachments:i},query:{supportsFormatPBF:a},data:{supportsAttachment:l},queryRelated:y}=Pe(e,this.url);return{exportMap:{supportsModification:!!e.canModifyLayer},operations:{supportsQuery:t,supportsQueryAttachments:i},data:{supportsAttachment:l},query:{supportsFormatPBF:a},queryRelated:y}}get defaultPopupTemplate(){return this.createPopupTemplate()}set definitionExpression(r){this._setAndNotifyLayer("definitionExpression",r)}get effectiveScaleRange(){const{minScale:r,maxScale:e}=this;return{minScale:r,maxScale:e}}readMaxScaleRange(r,e){return{minScale:(e=e.layerDefinition||e).minScale??0,maxScale:e.maxScale??0}}get fieldsIndex(){return new Te(this.fields||[])}set floorInfo(r){this._setAndNotifyLayer("floorInfo",r)}readGlobalIdFieldFromService(r,e){if((e=e.layerDefinition||e).globalIdField)return e.globalIdField;if(e.fields){for(const t of e.fields)if(t.type==="esriFieldTypeGlobalID")return t.name}}get id(){return this._get("id")??je++}set id(r){var e,t,i;this._get("id")!==r&&(((i=(t=(e=this.layer)==null?void 0:e.capabilities)==null?void 0:t.exportMap)==null?void 0:i.supportsDynamicLayers)!==!1?this._set("id",r):this._logLockedError("id","capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"))}set labelingInfo(r){this._setAndNotifyLayer("labelingInfo",r)}writeLabelingInfo(r,e,t,i){r&&r.length&&(e.layerDefinition={drawingInfo:{labelingInfo:r.map(a=>a.write({},i))}})}set labelsVisible(r){this._setAndNotifyLayer("labelsVisible",r)}set layer(r){this._set("layer",r),this.sublayers&&this.sublayers.forEach(e=>e.layer=r)}set listMode(r){this._set("listMode",r)}set minScale(r){this._setAndNotifyLayer("minScale",r)}readMinScale(r,e){var t;return e.minScale||((t=e.layerDefinition)==null?void 0:t.minScale)||0}set maxScale(r){this._setAndNotifyLayer("maxScale",r)}readMaxScale(r,e){var t;return e.maxScale||((t=e.layerDefinition)==null?void 0:t.maxScale)||0}readObjectIdFieldFromService(r,e){if((e=e.layerDefinition||e).objectIdField)return e.objectIdField;if(e.fields){for(const t of e.fields)if(t.type==="esriFieldTypeOID")return t.name}}set opacity(r){this._setAndNotifyLayer("opacity",r)}readOpacity(r,e){var i;const t=e.layerDefinition;return 1-.01*(((t==null?void 0:t.transparency)!=null?t.transparency:(i=t==null?void 0:t.drawingInfo)==null?void 0:i.transparency)??0)}writeOpacity(r,e,t,i){e.layerDefinition={drawingInfo:{transparency:100-100*r}}}writeParent(r,e){this.parent&&this.parent!==this.layer?e.parentLayerId=le(this.parent.id):e.parentLayerId=-1}get queryTask(){var y;if(!this.layer)return null;const{spatialReference:r}=this.layer,e="gdbVersion"in this.layer?this.layer.gdbVersion:void 0,{capabilities:t,fieldsIndex:i}=this,a=oe("featurelayer-pbf")&&(t==null?void 0:t.query.supportsFormatPBF),l=((y=t==null?void 0:t.operations)==null?void 0:y.supportsQueryAttachments)??!1;return new xe({url:this.url,pbfSupported:a,fieldsIndex:i,gdbVersion:e,sourceSpatialReference:r,queryAttachmentsSupported:l})}set renderer(r){if(r){for(const e of r.getSymbols())if(ne(e)){E.getLogger(this).warn("Sublayer renderer should use 2D symbols");break}}this._setAndNotifyLayer("renderer",r)}get source(){return this._get("source")||new R({mapLayerId:this.id})}set source(r){this._setAndNotifyLayer("source",r)}set sublayers(r){this._handleSublayersChange(r,this._get("sublayers")),this._set("sublayers",r)}castSublayers(r){return ye(U.ofType(A),r)}writeSublayers(r,e,t){var i;(i=this.sublayers)!=null&&i.length&&(e[t]=this.sublayers.map(a=>a.id).toArray().reverse())}readTitle(r,e){var t;return((t=e.layerDefinition)==null?void 0:t.name)??e.name}readTypeIdField(r,e){let t=(e=e.layerDefinition||e).typeIdField;if(t&&e.fields){t=t.toLowerCase();const i=e.fields.find(a=>a.name.toLowerCase()===t);i&&(t=i.name)}return t}get url(){var i;const r=((i=this.layer)==null?void 0:i.parsedUrl)??this._lastParsedUrl,e=this.source;if(!r)return null;if(this._lastParsedUrl=r,(e==null?void 0:e.type)==="map-layer")return`${r.path}/${e.mapLayerId}`;const t={layer:JSON.stringify({source:this.source})};return`${r.path}/dynamicLayer?${pe(t)}`}set url(r){this._overrideIfSome("url",r)}set visible(r){this._setAndNotifyLayer("visible",r)}writeVisible(r,e,t,i){e[t]=this.getAtOrigin("defaultVisibility","service")||r}clone(){const{store:r}=P(this),e=new A;return P(e).store=r.clone(v),this.commitProperty("url"),e._lastParsedUrl=this._lastParsedUrl,e}createPopupTemplate(r){return Ve(this,r)}createQuery(){return new ue({returnGeometry:!0,where:this.definitionExpression||"1=1"})}async createFeatureLayer(){var a;if(this.hasOwnProperty("sublayers"))return null;const r=(await de(()=>import("./FeatureLayer-D0kMrROG.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51]))).default,{layer:e,url:t}=this;let i;if(t&&this.originIdOf("url")>u.SERVICE)i=new r({url:t});else{if(!(e!=null&&e.parsedUrl))throw new S("createFeatureLayer:missing-information","Cannot create a FeatureLayer without a url or a parent layer");{const l=e.parsedUrl;i=new r({url:l.path}),l&&this.source&&(this.source.type==="map-layer"?i.layerId=this.source.mapLayerId:i.dynamicDataSource=this.source)}}return(e==null?void 0:e.refreshInterval)!=null&&(i.refreshInterval=e.refreshInterval),this.definitionExpression&&(i.definitionExpression=this.definitionExpression),this.floorInfo&&(i.floorInfo=_(this.floorInfo)),this.originIdOf("labelingInfo")>u.SERVICE&&(i.labelingInfo=_(this.labelingInfo)),this.originIdOf("labelsVisible")>u.DEFAULTS&&(i.labelsVisible=this.labelsVisible),this.originIdOf("legendEnabled")>u.DEFAULTS&&(i.legendEnabled=this.legendEnabled),this.originIdOf("visible")>u.DEFAULTS&&(i.visible=this.visible),this.originIdOf("minScale")>u.DEFAULTS&&(i.minScale=this.minScale),this.originIdOf("maxScale")>u.DEFAULTS&&(i.maxScale=this.maxScale),this.originIdOf("opacity")>u.DEFAULTS&&(i.opacity=this.opacity),this.originIdOf("popupTemplate")>u.DEFAULTS&&(i.popupTemplate=_(this.popupTemplate)),this.originIdOf("renderer")>u.SERVICE&&(i.renderer=_(this.renderer)),((a=this.source)==null?void 0:a.type)==="data-layer"&&(i.dynamicDataSource=this.source.clone()),this.originIdOf("title")>u.DEFAULTS&&(i.title=this.title),(e==null?void 0:e.type)==="map-image"&&e.originIdOf("customParameters")>u.DEFAULTS&&(i.customParameters=e.customParameters),(e==null?void 0:e.type)==="tile"&&e.originIdOf("customParameters")>u.DEFAULTS&&(i.customParameters=e.customParameters),i}getField(r){return this.fieldsIndex.get(r)}getFeatureType(r){const{typeIdField:e,types:t}=this;if(!e||!r)return null;const i=r.attributes?r.attributes[e]:void 0;if(i==null)return null;let a=null;return t==null||t.some(l=>{const{id:y}=l;return y!=null&&(y.toString()===i.toString()&&(a=l),!!a)}),a}getFieldDomain(r,e){const t=e==null?void 0:e.feature,i=this.getFeatureType(t);if(i){const a=i.domains&&i.domains[r];if(a&&a.type!=="inherited")return a}return this._getLayerDomain(r)}async queryAttachments(r,e){var b,I;await this.load(),r=Ae.from(r);const t=this.capabilities;if(!((b=t==null?void 0:t.data)!=null&&b.supportsAttachment))throw new S("queryAttachments:not-supported","this layer doesn't support attachments");const{attachmentTypes:i,objectIds:a,globalIds:l,num:y,size:p,start:d,where:c}=r;if(!((I=t==null?void 0:t.operations)!=null&&I.supportsQueryAttachments)&&((i==null?void 0:i.length)>0||(l==null?void 0:l.length)>0||(p==null?void 0:p.length)>0||y||d||c))throw new S("queryAttachments:option-not-supported","when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",r);if(!(a!=null&&a.length||l!=null&&l.length||c))throw new S("queryAttachments:invalid-query","'objectIds', 'globalIds', or 'where' are required to perform attachment query",r);return this.queryTask.executeAttachmentQuery(r,e)}async queryFeatures(r=this.createQuery(),e){var i,a;if(await this.load(),!this.capabilities.operations.supportsQuery)throw new S("queryFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new S("queryFeatures:not-supported","this layer has no url.");const t=await this.queryTask.execute(r,{...e,query:{...(i=this.layer)==null?void 0:i.customParameters,token:(a=this.layer)==null?void 0:a.apiKey}});if(t!=null&&t.features)for(const l of t.features)l.sourceLayer=this;return t}toExportImageJSON(r){var l,y;const e={id:this.id,source:((l=this.source)==null?void 0:l.toJSON())||{mapLayerId:this.id,type:"mapLayer"}},t=ce(r,this.definitionExpression);t!=null&&(e.definitionExpression=t);const i=["renderer","labelingInfo","opacity","labelsVisible"].reduce((p,d)=>(p[d]=this.originIdOf(d),p),{});if(Object.keys(i).some(p=>i[p]>u.SERVICE)){const p=e.drawingInfo={};if(i.renderer>u.SERVICE&&(p.renderer=this.renderer?this.renderer.toJSON():null),i.labelsVisible>u.SERVICE&&(p.showLabels=this.labelsVisible),this.labelsVisible&&i.labelingInfo>u.SERVICE)if(this.labelingInfo){!this.loaded&&((y=this.labelingInfo)!=null&&y.some(c=>!c.labelPlacement))&&E.getLogger(this).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`,{sublayer:this});let d=this.labelingInfo;this.geometryType!=null&&(d=_e(this.labelingInfo,q.toJSON(this.geometryType))),p.showLabels=!0,p.labelingInfo=d.filter(c=>c.labelPlacement).map(c=>c.toJSON({origin:"service",layer:this.layer}))}else p.showLabels=!1;i.opacity>u.SERVICE&&(p.transparency=100-100*this.opacity),this._assignDefaultSymbolColors(p.renderer)}return e}_assignDefaultSymbolColors(r){this._forEachSimpleMarkerSymbols(r,e=>{var t;e.color||e.style!=="esriSMSX"&&e.style!=="esriSMSCross"||((t=e.outline)!=null&&t.color?e.color=e.outline.color:e.color=[0,0,0,0])})}_forEachSimpleMarkerSymbols(r,e){if(r){const t=("uniqueValueInfos"in r?r.uniqueValueInfos:"classBreakInfos"in r?r.classBreakInfos:null)??[];for(const i of t)M(i.symbol)&&e(i.symbol);"symbol"in r&&M(r.symbol)&&e(r.symbol),"defaultSymbol"in r&&M(r.defaultSymbol)&&e(r.defaultSymbol)}}_setAndNotifyLayer(r,e){var p,d,c,b;const t=this.layer,i=this._get(r);let a,l;switch(r){case"definitionExpression":case"floorInfo":a="supportsSublayerDefinitionExpression";break;case"minScale":case"maxScale":case"visible":a="supportsSublayerVisibility";break;case"labelingInfo":case"labelsVisible":case"opacity":case"renderer":case"source":a="supportsDynamicLayers",l="supportsModification"}const y=P(this).getDefaultOrigin();if(y!=="service"){if(a&&((c=(d=(p=this.layer)==null?void 0:p.capabilities)==null?void 0:d.exportMap)==null?void 0:c[a])===!1)return void this._logLockedError(r,`capability not available 'layer.capabilities.exportMap.${a}'`);if(l&&((b=this.capabilities)==null?void 0:b.exportMap[l])===!1)return void this._logLockedError(r,`capability not available 'capabilities.exportMap.${l}'`)}r!=="source"||this.loadStatus==="not-loaded"?(this._set(r,e),y!=="service"&&i!==e&&t&&t.emit&&t.emit("sublayer-update",{propertyName:r,target:this})):this._logLockedError(r,"'source' can't be changed after calling sublayer.load()")}_handleSublayersChange(r,e){e&&(e.forEach(t=>{t.parent=null,t.layer=null}),this.removeAllHandles()),r&&(r.forEach(t=>{t.parent=this,t.layer=this.layer}),this.addHandles([r.on("after-add",({item:t})=>{t.parent=this,t.layer=this.layer}),r.on("after-remove",({item:t})=>{t.parent=null,t.layer=null}),r.on("before-changes",t=>{var a,l,y;const i=(y=(l=(a=this.layer)==null?void 0:a.capabilities)==null?void 0:l.exportMap)==null?void 0:y.supportsSublayersChanges;i==null||i||(E.getLogger(this).error(new S("sublayer:sublayers-non-modifiable","Sublayer can't be added, moved, or removed from the layer's sublayers",{sublayer:this,layer:this.layer})),t.preventDefault())})]))}_logLockedError(r,e){const{layer:t,declaredClass:i}=this;E.getLogger(i).error(new S("sublayer:locked",`Property '${String(r)}' can't be changed on Sublayer from the layer '${t==null?void 0:t.id}'`,{reason:e,sublayer:this,layer:t}))}_getLayerDomain(r){const e=this.fieldsIndex.get(r);return e?e.domain:null}};o.test={isMapImageLayerOverridePolicy:r=>r===m||r===j,isTileImageLayerOverridePolicy:r=>r===C},s([n({readOnly:!0})],o.prototype,"capabilities",void 0),s([g("service","capabilities",["layerDefinition.canModifyLayer","layerDefinition.capabilities"])],o.prototype,"readCapabilities",null),s([n()],o.prototype,"defaultPopupTemplate",null),s([n({type:String,value:null,json:{name:"layerDefinition.definitionExpression",write:{allowNull:!0,overridePolicy:j}}})],o.prototype,"definitionExpression",null),s([n({readOnly:!0})],o.prototype,"effectiveScaleRange",null),s([g("service","maxScaleRange",["minScale","maxScale"])],o.prototype,"readMaxScaleRange",null),s([n({type:[he],json:{origins:{service:{read:{source:"layerDefinition.fields"}}}}})],o.prototype,"fields",void 0),s([n({readOnly:!0})],o.prototype,"fieldsIndex",null),s([n({type:Fe,value:null,json:{name:"layerDefinition.floorInfo",read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo",overridePolicy:j},origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"floorInfo",null),s([n({type:z,json:{read:{source:"layerDefinition.extent"}}})],o.prototype,"fullExtent",void 0),s([n({type:q.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:q.read}}}}})],o.prototype,"geometryType",void 0),s([n({type:String})],o.prototype,"globalIdField",void 0),s([g("service","globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],o.prototype,"readGlobalIdFieldFromService",null),s([n({type:V,json:{write:{ignoreOrigin:!0}}})],o.prototype,"id",null),s([n({value:null,type:[De],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo"},write:{target:"layerDefinition.drawingInfo.labelingInfo",overridePolicy:m}}})],o.prototype,"labelingInfo",null),s([w("labelingInfo")],o.prototype,"writeLabelingInfo",null),s([n({type:Boolean,value:!0,json:{read:{source:"layerDefinition.drawingInfo.showLabels"},write:{target:"layerDefinition.drawingInfo.showLabels",overridePolicy:m}}})],o.prototype,"labelsVisible",null),s([n({value:null})],o.prototype,"layer",null),s([n({type:String,json:{write:{overridePolicy:C}}})],o.prototype,"layerItemId",void 0),s([n({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend",overridePolicy:F}}})],o.prototype,"legendEnabled",void 0),s([n({type:["show","hide","hide-children"],value:"show",json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],o.prototype,"listMode",null),s([n({type:Number,value:0,json:{write:{overridePolicy:m}}})],o.prototype,"minScale",null),s([g("minScale",["minScale","layerDefinition.minScale"])],o.prototype,"readMinScale",null),s([n({type:Number,value:0,json:{write:{overridePolicy:m}}})],o.prototype,"maxScale",null),s([g("maxScale",["maxScale","layerDefinition.maxScale"])],o.prototype,"readMaxScale",null),s([n({type:String})],o.prototype,"objectIdField",void 0),s([g("service","objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],o.prototype,"readObjectIdFieldFromService",null),s([n({type:Number,value:1,json:{write:{target:"layerDefinition.drawingInfo.transparency",overridePolicy:m}}})],o.prototype,"opacity",null),s([g("opacity",["layerDefinition.drawingInfo.transparency","layerDefinition.transparency"])],o.prototype,"readOpacity",null),s([w("opacity")],o.prototype,"writeOpacity",null),s([n({json:{type:V,write:{target:"parentLayerId",writerEnsuresNonNull:!0,overridePolicy:m}}})],o.prototype,"parent",void 0),s([w("parent")],o.prototype,"writeParent",null),s([n({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(r,e)=>!e.disablePopup},write:{target:"disablePopup",overridePolicy:F,writer(r,e,t){e[t]=!r}}}})],o.prototype,"popupEnabled",void 0),s([n({type:fe,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy:F}}})],o.prototype,"popupTemplate",void 0),s([n({readOnly:!0})],o.prototype,"queryTask",null),s([n({types:Ee,value:null,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:m},origins:{"web-scene":{types:Le,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:m}}}}})],o.prototype,"renderer",null),s([n({types:{key:"type",base:null,typeMap:{"data-layer":G,"map-layer":R}},cast(r){if(r){if("mapLayerId"in r)return K(R,r);if("dataSource"in r)return K(G,r)}return r},json:{name:"layerDefinition.source",write:{overridePolicy:m}}})],o.prototype,"source",null),s([n()],o.prototype,"sourceJSON",void 0),s([n({value:null,json:{type:[V],write:{target:"subLayerIds",allowNull:!0,overridePolicy:m}}})],o.prototype,"sublayers",null),s([be("sublayers")],o.prototype,"castSublayers",null),s([w("sublayers")],o.prototype,"writeSublayers",null),s([n({type:String,json:{name:"name",write:{overridePolicy:F}}})],o.prototype,"title",void 0),s([g("service","title",["name","layerDefinition.name"])],o.prototype,"readTitle",null),s([n({type:String})],o.prototype,"typeIdField",void 0),s([n({json:{read:!1},readOnly:!0,value:"sublayer"})],o.prototype,"type",void 0),s([g("typeIdField",["layerDefinition.typeIdField"])],o.prototype,"readTypeIdField",null),s([n({type:[Oe],json:{origins:{service:{read:{source:"layerDefinition.types"}}}}})],o.prototype,"types",void 0),s([n({type:String,json:{name:"layerUrl",write:{overridePolicy:C}}})],o.prototype,"url",null),s([n({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"},write:{target:"defaultVisibility",overridePolicy:m}}})],o.prototype,"visible",null),s([w("visible")],o.prototype,"writeVisible",null),o=A=s([k("esri.layers.support.Sublayer")],o);const B=o;function Ce(r,e){const t=[],i={};return r&&r.forEach(a=>{const l=new B;if(l.read(a,e),i[l.id]=l,a.parentLayerId!=null&&a.parentLayerId!==-1){const y=i[a.parentLayerId];y.sublayers||(y.sublayers=[]),y.sublayers.unshift(l)}else t.unshift(l)}),t}const N=U.ofType(B);function X(r,e){r&&r.forEach(t=>{e(t),t.sublayers&&t.sublayers.length&&X(t.sublayers,e)})}const Ze=r=>{let e=class extends r{constructor(...t){super(...t),this.allSublayers=new ge({getCollections:()=>[this.sublayers],getChildrenFunction:i=>i.sublayers}),this.sublayersSourceJSON={[u.SERVICE]:{},[u.PORTAL_ITEM]:{},[u.WEB_SCENE]:{},[u.WEB_MAP]:{}},this.addHandles(Se(()=>this.sublayers,(i,a)=>this._handleSublayersChange(i,a),Ie))}destroy(){this.allSublayers.destroy()}readSublayers(t,i){if(!i||!t)return;const{sublayersSourceJSON:a}=this,l=L(i.origin);if(lu.SERVICE))return;this._set("serviceSublayers",this.createSublayersForOrigin("service").sublayers);const{sublayers:y,origin:p}=this.createSublayersForOrigin("web-document"),d=P(this);d.setDefaultOrigin(p),this._set("sublayers",new N(y)),d.setDefaultOrigin("user")}findSublayerById(t){return this.allSublayers.find(i=>i.id===t)}createServiceSublayers(){return this.createSublayersForOrigin("service").sublayers}createSublayersForOrigin(t){const i=L(t==="web-document"?"web-map":t);let a=u.SERVICE,l=this.sublayersSourceJSON[u.SERVICE].layers,y=this.sublayersSourceJSON[u.SERVICE].context,p=null;const d=[u.PORTAL_ITEM,u.WEB_SCENE,u.WEB_MAP].filter(h=>h<=i);for(const h of d){const f=this.sublayersSourceJSON[h];Me(f.layers)&&(a=h,l=f.layers,y=f.context,f.visibleLayers&&(p={visibleLayers:f.visibleLayers,context:f.context}))}const c=[u.PORTAL_ITEM,u.WEB_SCENE,u.WEB_MAP].filter(h=>h>a&&h<=i);let b=null;for(const h of c){const{layers:f,visibleLayers:T,context:D}=this.sublayersSourceJSON[h];f&&(b={layers:f,context:D}),T&&(p={visibleLayers:T,context:D})}const I=Ce(l,y),x=new Map,O=new Set;if(b)for(const h of b.layers)x.set(h.id,h);if(p!=null&&p.visibleLayers)for(const h of p.visibleLayers)O.add(h);return X(I,h=>{b&&h.read(x.get(h.id),b.context),p&&h.read({defaultVisibility:O.has(h.id)},p.context)}),{origin:ve(a),sublayers:new N({items:I})}}read(t,i){super.read(t,i),this.readSublayers(t,i)}_handleSublayersChange(t,i){i&&(i.forEach(a=>{a.parent=null,a.layer=null}),this.removeHandles("sublayers-owner")),t&&(t.forEach(a=>{a.parent=this,a.layer=this}),this.addHandles([t.on("after-add",({item:a})=>{a.parent=this,a.layer=this}),t.on("after-remove",({item:a})=>{a.parent=null,a.layer=null})],"sublayers-owner"),this.type==="tile"&&this.addHandles(t.on("before-changes",a=>{E.getLogger("esri.layers.TileLayer").error(new S("tilelayer:sublayers-non-modifiable","ISublayer can't be added, moved, or removed from the layer's sublayers",{layer:this})),a.preventDefault()}),"sublayers-owner"))}};return s([n({readOnly:!0})],e.prototype,"allSublayers",void 0),s([n({readOnly:!0,type:U.ofType(B)})],e.prototype,"serviceSublayers",void 0),s([n({value:null,type:N,json:{read:!1,write:{allowNull:!0,ignoreOrigin:!0}}})],e.prototype,"sublayers",void 0),s([n({readOnly:!0})],e.prototype,"sublayersSourceJSON",void 0),e=s([k("esri.layers.mixins.SublayersOwner")],e),e};export{B as Y,Xe as f,Ze as m}; +import{d as s,y as n,aZ as g,aE as z,ds as Y,fD as ee,aS as te,f as k,h3 as J,at as Q,bs as u,b_ as W,M as $,av as H,Z as re,dr as ie,dn as ae,N as S,aW as se,h4 as le,E as oe,d7 as ne,s as E,h5 as R,aT as ye,V as U,e0 as pe,a6 as P,aX as ue,_ as de,aV as _,n as ce,d3 as q,a_ as he,dS as V,aR as w,i as fe,aQ as G,er as K,e1 as be,dF as L,fw as me,C as ge,g as Se,ez as Ie,h6 as ve}from"./index-BjUNJPVf.js";import{r as we}from"./Version-Dqq_CHBG.js";import"./UniqueValueRenderer-7V9Bhr-D.js";import{a as Ee,u as Le}from"./jsonUtils-Dw332y6z.js";import{x as xe}from"./QueryTask-Cl66pG_V.js";import{n as Oe}from"./FeatureType-CwUl8Nf5.js";import{Z as Te}from"./FieldsIndex-CK-0B5n9.js";import{C as De}from"./LabelClass-CeatfK8u.js";import{c as _e}from"./labelingInfo-DqAUis6e.js";import{p as Fe}from"./LayerFloorInfo-DlYNbO-A.js";import{a as Pe}from"./serviceCapabilitiesUtils-DiP90Uds.js";import{c as Ae}from"./AttachmentQuery-DmEAIZff.js";import{p as Ve}from"./popupUtils-DlZin22m.js";import{o as Me}from"./sublayerUtils-GrJ1gnTG.js";const Xe=r=>{let e=class extends r{constructor(){super(...arguments),this.capabilities=void 0,this.copyright=null,this.fullExtent=null,this.legendEnabled=!0,this.spatialReference=null,this.version=void 0,this._allLayersAndTablesMap=null}readCapabilities(t,i){const a=i.capabilities&&i.capabilities.split(",").map(Z=>Z.toLowerCase().trim());if(!a)return{operations:{supportsExportMap:!1,supportsExportTiles:!1,supportsIdentify:!1,supportsQuery:!1,supportsTileMap:!1},exportMap:null,exportTiles:null};const l=this.type,y=l!=="tile"&&!!i.supportsDynamicLayers,p=a.includes("query"),d=a.includes("map"),c=!!i.exportTilesAllowed,b=a.includes("tilemap"),I=a.includes("data"),x=l!=="tile"&&(!i.tileInfo||y),O=l!=="tile"&&(!i.tileInfo||y),h=l!=="tile",f=i.cimVersion&&we.parse(i.cimVersion),T=(f==null?void 0:f.since(1,4))??!1,D=(f==null?void 0:f.since(2,0))??!1;return{operations:{supportsExportMap:d,supportsExportTiles:c,supportsIdentify:p,supportsQuery:I,supportsTileMap:b},exportMap:d?{supportsArcadeExpressionForLabeling:T,supportsSublayersChanges:h,supportsDynamicLayers:y,supportsSublayerVisibility:x,supportsSublayerDefinitionExpression:O,supportsCIMSymbols:D}:null,exportTiles:c?{maxExportTilesCount:+i.maxExportTilesCount}:null}}readVersion(t,i){let a=i.currentVersion;return a||(a=i.hasOwnProperty("capabilities")||i.hasOwnProperty("tables")?10:i.hasOwnProperty("supportedImageFormatTypes")?9.31:9.3),a}async fetchRelatedService(t){const i=this.portalItem;if(!i||!J(i))return null;this._relatedFeatureServicePromise||(this._relatedFeatureServicePromise=i.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},t).then(l=>l.find(y=>y.type==="Feature Service")??null,()=>null));const a=await this._relatedFeatureServicePromise;return Q(t),a?{itemId:a.id,url:a.url}:null}async fetchSublayerInfo(t,i){var p;const{source:a}=t;if(this!=null&&this.portalItem&&this.type==="tile"&&(a==null?void 0:a.type)==="map-layer"&&J(this.portalItem)&&t.originIdOf("url")u.SERVICE)try{const d=await this._fetchAllLayersAndTablesFromService(l),c=((p=H(l))==null?void 0:p.sublayer)??a.mapLayerId;y=d.get(c)}catch{}else{let d=t.id;(a==null?void 0:a.type)==="map-layer"&&(d=a.mapLayerId);try{y=(await this.fetchAllLayersAndTables(i)).get(d)}catch{}}return y}async fetchAllLayersAndTables(t){var i;return this._fetchAllLayersAndTablesFromService((i=this.parsedUrl)==null?void 0:i.path,t)}async _fetchAllLayersAndTablesFromService(t,i){await this.load(i),this._allLayersAndTablesMap||(this._allLayersAndTablesMap=new Map);const a=H(t),l=re(this._allLayersAndTablesMap,a==null?void 0:a.url.path,()=>$(W(a==null?void 0:a.url.path,"/layers"),{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey}}).then(p=>{const d=new Map;for(const c of p.data.layers)d.set(c.id,c);return{result:d}},p=>({error:p}))),y=await l;if(Q(i),"result"in y)return y.result;throw y.error}};return s([n({readOnly:!0})],e.prototype,"capabilities",void 0),s([g("service","capabilities",["capabilities","exportTilesAllowed","maxExportTilesCount","supportsDynamicLayers","tileInfo"])],e.prototype,"readCapabilities",null),s([n({json:{read:{source:"copyrightText"}}})],e.prototype,"copyright",void 0),s([n({type:z})],e.prototype,"fullExtent",void 0),s([n(Y)],e.prototype,"id",void 0),s([n({type:Boolean,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend"}}})],e.prototype,"legendEnabled",void 0),s([n(ee)],e.prototype,"popupEnabled",void 0),s([n({type:te})],e.prototype,"spatialReference",void 0),s([n({readOnly:!0})],e.prototype,"version",void 0),s([g("version",["currentVersion","capabilities","tables","supportedImageFormatTypes"])],e.prototype,"readVersion",null),e=s([k("esri.layers.mixins.ArcGISMapService")],e),e};var A;function M(r){return r!=null&&r.type==="esriSMS"}function j(r,e,t){var a;const i=this.originIdOf(e)>=L(t.origin);return{ignoreOrigin:!0,allowNull:i,enabled:!!t&&((a=t.layer)==null?void 0:a.type)==="map-image"&&(t.writeSublayerStructure||i)}}function C(r,e,t){var i;return{enabled:!!t&&((i=t.layer)==null?void 0:i.type)==="tile"&&(t.origin&&this.originIdOf(e)>=L(t.origin)||this._isOverridden(e))}}function m(r,e,t){return{ignoreOrigin:!0,enabled:t&&t.writeSublayerStructure||!1}}function F(r,e,t){return{ignoreOrigin:!0,enabled:!!t&&(t.writeSublayerStructure||this.originIdOf(e)>=L(t.origin))}}let je=0;const v=new Set;v.add("layer"),v.add("parent"),v.add("loaded"),v.add("loadStatus"),v.add("loadError"),v.add("loadWarnings");let o=A=class extends ie(ae(me)){constructor(r){super(r),this.capabilities=void 0,this.maxScaleRange={minScale:0,maxScale:0},this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.legendEnabled=!0,this.objectIdField=null,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.sourceJSON=null,this.title=null,this.typeIdField=null,this.type="sublayer",this.types=null,this._lastParsedUrl=null}async load(r){return this.addResolvingPromise((async()=>{const{layer:e,url:t}=this;if(!e&&!t)throw new S("sublayer:missing-layer","Sublayer can't be loaded without being part of a layer",{sublayer:this});const i=e?await e.fetchSublayerInfo(this,r):(await $(t,{responseType:"json",query:{f:"json"},...r})).data;i&&(this.sourceJSON=i,this.read({layerDefinition:i},{origin:"service",layer:e,url:se(t)}))})()),this}readCapabilities(r,e){e=e.layerDefinition||e;const{operations:{supportsQuery:t,supportsQueryAttachments:i},query:{supportsFormatPBF:a},data:{supportsAttachment:l},queryRelated:y}=Pe(e,this.url);return{exportMap:{supportsModification:!!e.canModifyLayer},operations:{supportsQuery:t,supportsQueryAttachments:i},data:{supportsAttachment:l},query:{supportsFormatPBF:a},queryRelated:y}}get defaultPopupTemplate(){return this.createPopupTemplate()}set definitionExpression(r){this._setAndNotifyLayer("definitionExpression",r)}get effectiveScaleRange(){const{minScale:r,maxScale:e}=this;return{minScale:r,maxScale:e}}readMaxScaleRange(r,e){return{minScale:(e=e.layerDefinition||e).minScale??0,maxScale:e.maxScale??0}}get fieldsIndex(){return new Te(this.fields||[])}set floorInfo(r){this._setAndNotifyLayer("floorInfo",r)}readGlobalIdFieldFromService(r,e){if((e=e.layerDefinition||e).globalIdField)return e.globalIdField;if(e.fields){for(const t of e.fields)if(t.type==="esriFieldTypeGlobalID")return t.name}}get id(){return this._get("id")??je++}set id(r){var e,t,i;this._get("id")!==r&&(((i=(t=(e=this.layer)==null?void 0:e.capabilities)==null?void 0:t.exportMap)==null?void 0:i.supportsDynamicLayers)!==!1?this._set("id",r):this._logLockedError("id","capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"))}set labelingInfo(r){this._setAndNotifyLayer("labelingInfo",r)}writeLabelingInfo(r,e,t,i){r&&r.length&&(e.layerDefinition={drawingInfo:{labelingInfo:r.map(a=>a.write({},i))}})}set labelsVisible(r){this._setAndNotifyLayer("labelsVisible",r)}set layer(r){this._set("layer",r),this.sublayers&&this.sublayers.forEach(e=>e.layer=r)}set listMode(r){this._set("listMode",r)}set minScale(r){this._setAndNotifyLayer("minScale",r)}readMinScale(r,e){var t;return e.minScale||((t=e.layerDefinition)==null?void 0:t.minScale)||0}set maxScale(r){this._setAndNotifyLayer("maxScale",r)}readMaxScale(r,e){var t;return e.maxScale||((t=e.layerDefinition)==null?void 0:t.maxScale)||0}readObjectIdFieldFromService(r,e){if((e=e.layerDefinition||e).objectIdField)return e.objectIdField;if(e.fields){for(const t of e.fields)if(t.type==="esriFieldTypeOID")return t.name}}set opacity(r){this._setAndNotifyLayer("opacity",r)}readOpacity(r,e){var i;const t=e.layerDefinition;return 1-.01*(((t==null?void 0:t.transparency)!=null?t.transparency:(i=t==null?void 0:t.drawingInfo)==null?void 0:i.transparency)??0)}writeOpacity(r,e,t,i){e.layerDefinition={drawingInfo:{transparency:100-100*r}}}writeParent(r,e){this.parent&&this.parent!==this.layer?e.parentLayerId=le(this.parent.id):e.parentLayerId=-1}get queryTask(){var y;if(!this.layer)return null;const{spatialReference:r}=this.layer,e="gdbVersion"in this.layer?this.layer.gdbVersion:void 0,{capabilities:t,fieldsIndex:i}=this,a=oe("featurelayer-pbf")&&(t==null?void 0:t.query.supportsFormatPBF),l=((y=t==null?void 0:t.operations)==null?void 0:y.supportsQueryAttachments)??!1;return new xe({url:this.url,pbfSupported:a,fieldsIndex:i,gdbVersion:e,sourceSpatialReference:r,queryAttachmentsSupported:l})}set renderer(r){if(r){for(const e of r.getSymbols())if(ne(e)){E.getLogger(this).warn("Sublayer renderer should use 2D symbols");break}}this._setAndNotifyLayer("renderer",r)}get source(){return this._get("source")||new R({mapLayerId:this.id})}set source(r){this._setAndNotifyLayer("source",r)}set sublayers(r){this._handleSublayersChange(r,this._get("sublayers")),this._set("sublayers",r)}castSublayers(r){return ye(U.ofType(A),r)}writeSublayers(r,e,t){var i;(i=this.sublayers)!=null&&i.length&&(e[t]=this.sublayers.map(a=>a.id).toArray().reverse())}readTitle(r,e){var t;return((t=e.layerDefinition)==null?void 0:t.name)??e.name}readTypeIdField(r,e){let t=(e=e.layerDefinition||e).typeIdField;if(t&&e.fields){t=t.toLowerCase();const i=e.fields.find(a=>a.name.toLowerCase()===t);i&&(t=i.name)}return t}get url(){var i;const r=((i=this.layer)==null?void 0:i.parsedUrl)??this._lastParsedUrl,e=this.source;if(!r)return null;if(this._lastParsedUrl=r,(e==null?void 0:e.type)==="map-layer")return`${r.path}/${e.mapLayerId}`;const t={layer:JSON.stringify({source:this.source})};return`${r.path}/dynamicLayer?${pe(t)}`}set url(r){this._overrideIfSome("url",r)}set visible(r){this._setAndNotifyLayer("visible",r)}writeVisible(r,e,t,i){e[t]=this.getAtOrigin("defaultVisibility","service")||r}clone(){const{store:r}=P(this),e=new A;return P(e).store=r.clone(v),this.commitProperty("url"),e._lastParsedUrl=this._lastParsedUrl,e}createPopupTemplate(r){return Ve(this,r)}createQuery(){return new ue({returnGeometry:!0,where:this.definitionExpression||"1=1"})}async createFeatureLayer(){var a;if(this.hasOwnProperty("sublayers"))return null;const r=(await de(()=>import("./FeatureLayer-BHxNIHhy.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51]))).default,{layer:e,url:t}=this;let i;if(t&&this.originIdOf("url")>u.SERVICE)i=new r({url:t});else{if(!(e!=null&&e.parsedUrl))throw new S("createFeatureLayer:missing-information","Cannot create a FeatureLayer without a url or a parent layer");{const l=e.parsedUrl;i=new r({url:l.path}),l&&this.source&&(this.source.type==="map-layer"?i.layerId=this.source.mapLayerId:i.dynamicDataSource=this.source)}}return(e==null?void 0:e.refreshInterval)!=null&&(i.refreshInterval=e.refreshInterval),this.definitionExpression&&(i.definitionExpression=this.definitionExpression),this.floorInfo&&(i.floorInfo=_(this.floorInfo)),this.originIdOf("labelingInfo")>u.SERVICE&&(i.labelingInfo=_(this.labelingInfo)),this.originIdOf("labelsVisible")>u.DEFAULTS&&(i.labelsVisible=this.labelsVisible),this.originIdOf("legendEnabled")>u.DEFAULTS&&(i.legendEnabled=this.legendEnabled),this.originIdOf("visible")>u.DEFAULTS&&(i.visible=this.visible),this.originIdOf("minScale")>u.DEFAULTS&&(i.minScale=this.minScale),this.originIdOf("maxScale")>u.DEFAULTS&&(i.maxScale=this.maxScale),this.originIdOf("opacity")>u.DEFAULTS&&(i.opacity=this.opacity),this.originIdOf("popupTemplate")>u.DEFAULTS&&(i.popupTemplate=_(this.popupTemplate)),this.originIdOf("renderer")>u.SERVICE&&(i.renderer=_(this.renderer)),((a=this.source)==null?void 0:a.type)==="data-layer"&&(i.dynamicDataSource=this.source.clone()),this.originIdOf("title")>u.DEFAULTS&&(i.title=this.title),(e==null?void 0:e.type)==="map-image"&&e.originIdOf("customParameters")>u.DEFAULTS&&(i.customParameters=e.customParameters),(e==null?void 0:e.type)==="tile"&&e.originIdOf("customParameters")>u.DEFAULTS&&(i.customParameters=e.customParameters),i}getField(r){return this.fieldsIndex.get(r)}getFeatureType(r){const{typeIdField:e,types:t}=this;if(!e||!r)return null;const i=r.attributes?r.attributes[e]:void 0;if(i==null)return null;let a=null;return t==null||t.some(l=>{const{id:y}=l;return y!=null&&(y.toString()===i.toString()&&(a=l),!!a)}),a}getFieldDomain(r,e){const t=e==null?void 0:e.feature,i=this.getFeatureType(t);if(i){const a=i.domains&&i.domains[r];if(a&&a.type!=="inherited")return a}return this._getLayerDomain(r)}async queryAttachments(r,e){var b,I;await this.load(),r=Ae.from(r);const t=this.capabilities;if(!((b=t==null?void 0:t.data)!=null&&b.supportsAttachment))throw new S("queryAttachments:not-supported","this layer doesn't support attachments");const{attachmentTypes:i,objectIds:a,globalIds:l,num:y,size:p,start:d,where:c}=r;if(!((I=t==null?void 0:t.operations)!=null&&I.supportsQueryAttachments)&&((i==null?void 0:i.length)>0||(l==null?void 0:l.length)>0||(p==null?void 0:p.length)>0||y||d||c))throw new S("queryAttachments:option-not-supported","when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",r);if(!(a!=null&&a.length||l!=null&&l.length||c))throw new S("queryAttachments:invalid-query","'objectIds', 'globalIds', or 'where' are required to perform attachment query",r);return this.queryTask.executeAttachmentQuery(r,e)}async queryFeatures(r=this.createQuery(),e){var i,a;if(await this.load(),!this.capabilities.operations.supportsQuery)throw new S("queryFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new S("queryFeatures:not-supported","this layer has no url.");const t=await this.queryTask.execute(r,{...e,query:{...(i=this.layer)==null?void 0:i.customParameters,token:(a=this.layer)==null?void 0:a.apiKey}});if(t!=null&&t.features)for(const l of t.features)l.sourceLayer=this;return t}toExportImageJSON(r){var l,y;const e={id:this.id,source:((l=this.source)==null?void 0:l.toJSON())||{mapLayerId:this.id,type:"mapLayer"}},t=ce(r,this.definitionExpression);t!=null&&(e.definitionExpression=t);const i=["renderer","labelingInfo","opacity","labelsVisible"].reduce((p,d)=>(p[d]=this.originIdOf(d),p),{});if(Object.keys(i).some(p=>i[p]>u.SERVICE)){const p=e.drawingInfo={};if(i.renderer>u.SERVICE&&(p.renderer=this.renderer?this.renderer.toJSON():null),i.labelsVisible>u.SERVICE&&(p.showLabels=this.labelsVisible),this.labelsVisible&&i.labelingInfo>u.SERVICE)if(this.labelingInfo){!this.loaded&&((y=this.labelingInfo)!=null&&y.some(c=>!c.labelPlacement))&&E.getLogger(this).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`,{sublayer:this});let d=this.labelingInfo;this.geometryType!=null&&(d=_e(this.labelingInfo,q.toJSON(this.geometryType))),p.showLabels=!0,p.labelingInfo=d.filter(c=>c.labelPlacement).map(c=>c.toJSON({origin:"service",layer:this.layer}))}else p.showLabels=!1;i.opacity>u.SERVICE&&(p.transparency=100-100*this.opacity),this._assignDefaultSymbolColors(p.renderer)}return e}_assignDefaultSymbolColors(r){this._forEachSimpleMarkerSymbols(r,e=>{var t;e.color||e.style!=="esriSMSX"&&e.style!=="esriSMSCross"||((t=e.outline)!=null&&t.color?e.color=e.outline.color:e.color=[0,0,0,0])})}_forEachSimpleMarkerSymbols(r,e){if(r){const t=("uniqueValueInfos"in r?r.uniqueValueInfos:"classBreakInfos"in r?r.classBreakInfos:null)??[];for(const i of t)M(i.symbol)&&e(i.symbol);"symbol"in r&&M(r.symbol)&&e(r.symbol),"defaultSymbol"in r&&M(r.defaultSymbol)&&e(r.defaultSymbol)}}_setAndNotifyLayer(r,e){var p,d,c,b;const t=this.layer,i=this._get(r);let a,l;switch(r){case"definitionExpression":case"floorInfo":a="supportsSublayerDefinitionExpression";break;case"minScale":case"maxScale":case"visible":a="supportsSublayerVisibility";break;case"labelingInfo":case"labelsVisible":case"opacity":case"renderer":case"source":a="supportsDynamicLayers",l="supportsModification"}const y=P(this).getDefaultOrigin();if(y!=="service"){if(a&&((c=(d=(p=this.layer)==null?void 0:p.capabilities)==null?void 0:d.exportMap)==null?void 0:c[a])===!1)return void this._logLockedError(r,`capability not available 'layer.capabilities.exportMap.${a}'`);if(l&&((b=this.capabilities)==null?void 0:b.exportMap[l])===!1)return void this._logLockedError(r,`capability not available 'capabilities.exportMap.${l}'`)}r!=="source"||this.loadStatus==="not-loaded"?(this._set(r,e),y!=="service"&&i!==e&&t&&t.emit&&t.emit("sublayer-update",{propertyName:r,target:this})):this._logLockedError(r,"'source' can't be changed after calling sublayer.load()")}_handleSublayersChange(r,e){e&&(e.forEach(t=>{t.parent=null,t.layer=null}),this.removeAllHandles()),r&&(r.forEach(t=>{t.parent=this,t.layer=this.layer}),this.addHandles([r.on("after-add",({item:t})=>{t.parent=this,t.layer=this.layer}),r.on("after-remove",({item:t})=>{t.parent=null,t.layer=null}),r.on("before-changes",t=>{var a,l,y;const i=(y=(l=(a=this.layer)==null?void 0:a.capabilities)==null?void 0:l.exportMap)==null?void 0:y.supportsSublayersChanges;i==null||i||(E.getLogger(this).error(new S("sublayer:sublayers-non-modifiable","Sublayer can't be added, moved, or removed from the layer's sublayers",{sublayer:this,layer:this.layer})),t.preventDefault())})]))}_logLockedError(r,e){const{layer:t,declaredClass:i}=this;E.getLogger(i).error(new S("sublayer:locked",`Property '${String(r)}' can't be changed on Sublayer from the layer '${t==null?void 0:t.id}'`,{reason:e,sublayer:this,layer:t}))}_getLayerDomain(r){const e=this.fieldsIndex.get(r);return e?e.domain:null}};o.test={isMapImageLayerOverridePolicy:r=>r===m||r===j,isTileImageLayerOverridePolicy:r=>r===C},s([n({readOnly:!0})],o.prototype,"capabilities",void 0),s([g("service","capabilities",["layerDefinition.canModifyLayer","layerDefinition.capabilities"])],o.prototype,"readCapabilities",null),s([n()],o.prototype,"defaultPopupTemplate",null),s([n({type:String,value:null,json:{name:"layerDefinition.definitionExpression",write:{allowNull:!0,overridePolicy:j}}})],o.prototype,"definitionExpression",null),s([n({readOnly:!0})],o.prototype,"effectiveScaleRange",null),s([g("service","maxScaleRange",["minScale","maxScale"])],o.prototype,"readMaxScaleRange",null),s([n({type:[he],json:{origins:{service:{read:{source:"layerDefinition.fields"}}}}})],o.prototype,"fields",void 0),s([n({readOnly:!0})],o.prototype,"fieldsIndex",null),s([n({type:Fe,value:null,json:{name:"layerDefinition.floorInfo",read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo",overridePolicy:j},origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"floorInfo",null),s([n({type:z,json:{read:{source:"layerDefinition.extent"}}})],o.prototype,"fullExtent",void 0),s([n({type:q.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:q.read}}}}})],o.prototype,"geometryType",void 0),s([n({type:String})],o.prototype,"globalIdField",void 0),s([g("service","globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],o.prototype,"readGlobalIdFieldFromService",null),s([n({type:V,json:{write:{ignoreOrigin:!0}}})],o.prototype,"id",null),s([n({value:null,type:[De],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo"},write:{target:"layerDefinition.drawingInfo.labelingInfo",overridePolicy:m}}})],o.prototype,"labelingInfo",null),s([w("labelingInfo")],o.prototype,"writeLabelingInfo",null),s([n({type:Boolean,value:!0,json:{read:{source:"layerDefinition.drawingInfo.showLabels"},write:{target:"layerDefinition.drawingInfo.showLabels",overridePolicy:m}}})],o.prototype,"labelsVisible",null),s([n({value:null})],o.prototype,"layer",null),s([n({type:String,json:{write:{overridePolicy:C}}})],o.prototype,"layerItemId",void 0),s([n({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend",overridePolicy:F}}})],o.prototype,"legendEnabled",void 0),s([n({type:["show","hide","hide-children"],value:"show",json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],o.prototype,"listMode",null),s([n({type:Number,value:0,json:{write:{overridePolicy:m}}})],o.prototype,"minScale",null),s([g("minScale",["minScale","layerDefinition.minScale"])],o.prototype,"readMinScale",null),s([n({type:Number,value:0,json:{write:{overridePolicy:m}}})],o.prototype,"maxScale",null),s([g("maxScale",["maxScale","layerDefinition.maxScale"])],o.prototype,"readMaxScale",null),s([n({type:String})],o.prototype,"objectIdField",void 0),s([g("service","objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],o.prototype,"readObjectIdFieldFromService",null),s([n({type:Number,value:1,json:{write:{target:"layerDefinition.drawingInfo.transparency",overridePolicy:m}}})],o.prototype,"opacity",null),s([g("opacity",["layerDefinition.drawingInfo.transparency","layerDefinition.transparency"])],o.prototype,"readOpacity",null),s([w("opacity")],o.prototype,"writeOpacity",null),s([n({json:{type:V,write:{target:"parentLayerId",writerEnsuresNonNull:!0,overridePolicy:m}}})],o.prototype,"parent",void 0),s([w("parent")],o.prototype,"writeParent",null),s([n({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(r,e)=>!e.disablePopup},write:{target:"disablePopup",overridePolicy:F,writer(r,e,t){e[t]=!r}}}})],o.prototype,"popupEnabled",void 0),s([n({type:fe,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy:F}}})],o.prototype,"popupTemplate",void 0),s([n({readOnly:!0})],o.prototype,"queryTask",null),s([n({types:Ee,value:null,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:m},origins:{"web-scene":{types:Le,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:m}}}}})],o.prototype,"renderer",null),s([n({types:{key:"type",base:null,typeMap:{"data-layer":G,"map-layer":R}},cast(r){if(r){if("mapLayerId"in r)return K(R,r);if("dataSource"in r)return K(G,r)}return r},json:{name:"layerDefinition.source",write:{overridePolicy:m}}})],o.prototype,"source",null),s([n()],o.prototype,"sourceJSON",void 0),s([n({value:null,json:{type:[V],write:{target:"subLayerIds",allowNull:!0,overridePolicy:m}}})],o.prototype,"sublayers",null),s([be("sublayers")],o.prototype,"castSublayers",null),s([w("sublayers")],o.prototype,"writeSublayers",null),s([n({type:String,json:{name:"name",write:{overridePolicy:F}}})],o.prototype,"title",void 0),s([g("service","title",["name","layerDefinition.name"])],o.prototype,"readTitle",null),s([n({type:String})],o.prototype,"typeIdField",void 0),s([n({json:{read:!1},readOnly:!0,value:"sublayer"})],o.prototype,"type",void 0),s([g("typeIdField",["layerDefinition.typeIdField"])],o.prototype,"readTypeIdField",null),s([n({type:[Oe],json:{origins:{service:{read:{source:"layerDefinition.types"}}}}})],o.prototype,"types",void 0),s([n({type:String,json:{name:"layerUrl",write:{overridePolicy:C}}})],o.prototype,"url",null),s([n({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"},write:{target:"defaultVisibility",overridePolicy:m}}})],o.prototype,"visible",null),s([w("visible")],o.prototype,"writeVisible",null),o=A=s([k("esri.layers.support.Sublayer")],o);const B=o;function Ce(r,e){const t=[],i={};return r&&r.forEach(a=>{const l=new B;if(l.read(a,e),i[l.id]=l,a.parentLayerId!=null&&a.parentLayerId!==-1){const y=i[a.parentLayerId];y.sublayers||(y.sublayers=[]),y.sublayers.unshift(l)}else t.unshift(l)}),t}const N=U.ofType(B);function X(r,e){r&&r.forEach(t=>{e(t),t.sublayers&&t.sublayers.length&&X(t.sublayers,e)})}const Ze=r=>{let e=class extends r{constructor(...t){super(...t),this.allSublayers=new ge({getCollections:()=>[this.sublayers],getChildrenFunction:i=>i.sublayers}),this.sublayersSourceJSON={[u.SERVICE]:{},[u.PORTAL_ITEM]:{},[u.WEB_SCENE]:{},[u.WEB_MAP]:{}},this.addHandles(Se(()=>this.sublayers,(i,a)=>this._handleSublayersChange(i,a),Ie))}destroy(){this.allSublayers.destroy()}readSublayers(t,i){if(!i||!t)return;const{sublayersSourceJSON:a}=this,l=L(i.origin);if(lu.SERVICE))return;this._set("serviceSublayers",this.createSublayersForOrigin("service").sublayers);const{sublayers:y,origin:p}=this.createSublayersForOrigin("web-document"),d=P(this);d.setDefaultOrigin(p),this._set("sublayers",new N(y)),d.setDefaultOrigin("user")}findSublayerById(t){return this.allSublayers.find(i=>i.id===t)}createServiceSublayers(){return this.createSublayersForOrigin("service").sublayers}createSublayersForOrigin(t){const i=L(t==="web-document"?"web-map":t);let a=u.SERVICE,l=this.sublayersSourceJSON[u.SERVICE].layers,y=this.sublayersSourceJSON[u.SERVICE].context,p=null;const d=[u.PORTAL_ITEM,u.WEB_SCENE,u.WEB_MAP].filter(h=>h<=i);for(const h of d){const f=this.sublayersSourceJSON[h];Me(f.layers)&&(a=h,l=f.layers,y=f.context,f.visibleLayers&&(p={visibleLayers:f.visibleLayers,context:f.context}))}const c=[u.PORTAL_ITEM,u.WEB_SCENE,u.WEB_MAP].filter(h=>h>a&&h<=i);let b=null;for(const h of c){const{layers:f,visibleLayers:T,context:D}=this.sublayersSourceJSON[h];f&&(b={layers:f,context:D}),T&&(p={visibleLayers:T,context:D})}const I=Ce(l,y),x=new Map,O=new Set;if(b)for(const h of b.layers)x.set(h.id,h);if(p!=null&&p.visibleLayers)for(const h of p.visibleLayers)O.add(h);return X(I,h=>{b&&h.read(x.get(h.id),b.context),p&&h.read({defaultVisibility:O.has(h.id)},p.context)}),{origin:ve(a),sublayers:new N({items:I})}}read(t,i){super.read(t,i),this.readSublayers(t,i)}_handleSublayersChange(t,i){i&&(i.forEach(a=>{a.parent=null,a.layer=null}),this.removeHandles("sublayers-owner")),t&&(t.forEach(a=>{a.parent=this,a.layer=this}),this.addHandles([t.on("after-add",({item:a})=>{a.parent=this,a.layer=this}),t.on("after-remove",({item:a})=>{a.parent=null,a.layer=null})],"sublayers-owner"),this.type==="tile"&&this.addHandles(t.on("before-changes",a=>{E.getLogger("esri.layers.TileLayer").error(new S("tilelayer:sublayers-non-modifiable","ISublayer can't be added, moved, or removed from the layer's sublayers",{layer:this})),a.preventDefault()}),"sublayers-owner"))}};return s([n({readOnly:!0})],e.prototype,"allSublayers",void 0),s([n({readOnly:!0,type:U.ofType(B)})],e.prototype,"serviceSublayers",void 0),s([n({value:null,type:N,json:{read:!1,write:{allowNull:!0,ignoreOrigin:!0}}})],e.prototype,"sublayers",void 0),s([n({readOnly:!0})],e.prototype,"sublayersSourceJSON",void 0),e=s([k("esri.layers.mixins.SublayersOwner")],e),e};export{B as Y,Xe as f,Ze as m}; diff --git a/assets/SubtypeGroupLayer-DOR5l1_M.js b/assets/SubtypeGroupLayer-DoVLJ5RR.js similarity index 85% rename from assets/SubtypeGroupLayer-DOR5l1_M.js rename to assets/SubtypeGroupLayer-DoVLJ5RR.js index cf35398..fd4fd71 100644 --- a/assets/SubtypeGroupLayer-DOR5l1_M.js +++ b/assets/SubtypeGroupLayer-DoVLJ5RR.js @@ -1,7 +1,7 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/featureLayerUtils-SShyxaG9.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css","assets/originUtils-D69mHv66.js","assets/multiOriginJSONSupportUtils-C0wm8_Yw.js","assets/utils-2LBmsoaQ.js","assets/saveAPIKeyUtils-BiX1lQSW.js","assets/saveUtils-BzCRy3uR.js","assets/fetchService-C38RarY2.js","assets/lazyLayerLoader-s-GqbiwM.js","assets/FeatureLayerSource-BeuGtrZI.js","assets/meshVertexSpaceUtils-BFWpJFSd.js","assets/MeshLocalVertexSpace-Cltwu1Kq.js","assets/vec3-CjYmIfaa.js","assets/External-DC51KyR4.js","assets/infoFor3D-DsOdlPuA.js","assets/editingSupport-DWTRjmy9.js","assets/EditBusLayer-SG7oYwiY.js","assets/clientSideDefaults-CgRgH99f.js","assets/QueryEngineCapabilities-CTDe3LlQ.js","assets/defaultsJSON-CHAaurhX.js","assets/QueryTask-CjHwD7wL.js","assets/executeForIds-BjeEaIen.js","assets/query-BM8R3sQ6.js","assets/pbfQueryUtils-CLRSFGBm.js","assets/pbf-D9QZb8S8.js","assets/OptimizedGeometry-CQuTPb9g.js","assets/OptimizedFeatureSet-Blu9Ckm7.js","assets/queryZScale-DN4aFXYn.js","assets/executeQueryJSON-DngjHRnE.js","assets/FeatureSet-CYJUZgOk.js","assets/executeQueryPBF-BYY2Ipuh.js","assets/featureConversionUtils-CmP9mw0r.js","assets/featureLayerUtils-BhDaw8pS.js","assets/jsonUtils-BseLl1fZ.js","assets/UniqueValueRenderer-BlkUix3g.js","assets/ColorStop-44hBlQ14.js","assets/diffUtils-B4YFa5Ju.js","assets/colorRamps-BJydlf0f.js","assets/sizeVariableUtils-Cmcuvw-4.js","assets/visualVariableUtils-z2k12BH8.js","assets/jsonUtils-qYmXvGJ1.js","assets/styleUtils-CnV_Xzhi.js","assets/Version-Bd0QsIQ5.js","assets/FieldsIndex-CLgRNeJ_.js","assets/UnknownTimeZone-DF0BqWCR.js","assets/OverrideHelper-B4ryGWZb.js","assets/utils-p-5Bbga5.js","assets/quantizationUtils-CUjGHrU3.js","assets/heatmapUtils-Clt5rJzr.js","assets/AttachmentQuery-D61mmWw4.js","assets/RelationshipQuery-DDK72Kwc.js","assets/editsZScale-CQCGPEjO.js"] + __vite__mapDeps.viteFileDeps = ["assets/featureLayerUtils-D4E7zCBj.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css","assets/originUtils-D69mHv66.js","assets/multiOriginJSONSupportUtils-C0wm8_Yw.js","assets/utils-iOpWi7jV.js","assets/saveAPIKeyUtils-YRBbgdzi.js","assets/saveUtils-CGGzyvzv.js","assets/fetchService-Crgml5qT.js","assets/lazyLayerLoader-Cu0XtDD2.js","assets/FeatureLayerSource-3cjHhwgM.js","assets/meshVertexSpaceUtils-DwMoblqo.js","assets/MeshLocalVertexSpace-DRvwbFTJ.js","assets/vec3-DdRUbala.js","assets/External-DIoD7Bb4.js","assets/infoFor3D-DsOdlPuA.js","assets/editingSupport-4MwIplWk.js","assets/EditBusLayer-OslMX9fF.js","assets/clientSideDefaults-BQP5n3lX.js","assets/QueryEngineCapabilities-CTDe3LlQ.js","assets/defaultsJSON-CHAaurhX.js","assets/QueryTask-Cl66pG_V.js","assets/executeForIds-CZ3M8IZd.js","assets/query-Bk_ITqRK.js","assets/pbfQueryUtils-CSeFSIjv.js","assets/pbf-Du8sFEWo.js","assets/OptimizedGeometry-CQuTPb9g.js","assets/OptimizedFeatureSet-Blu9Ckm7.js","assets/queryZScale-Dwvn5BlQ.js","assets/executeQueryJSON-COxi_Fac.js","assets/FeatureSet-opEn8ou8.js","assets/executeQueryPBF-DROgTCuZ.js","assets/featureConversionUtils-BHhm7bvm.js","assets/featureLayerUtils-lwqyOSrl.js","assets/jsonUtils-Dw332y6z.js","assets/UniqueValueRenderer-7V9Bhr-D.js","assets/ColorStop-DCGjAKLC.js","assets/diffUtils-uUoMDFQS.js","assets/colorRamps-CcakIWlU.js","assets/sizeVariableUtils-Cmcuvw-4.js","assets/visualVariableUtils-BX9G5gNQ.js","assets/jsonUtils-Ox5U0P0F.js","assets/styleUtils-DOUOskVZ.js","assets/Version-Dqq_CHBG.js","assets/FieldsIndex-CK-0B5n9.js","assets/UnknownTimeZone-CK7VjgF3.js","assets/OverrideHelper-DxFZBnGL.js","assets/utils-CuXO_Zzq.js","assets/quantizationUtils-CfV316jZ.js","assets/heatmapUtils-BSteZBTj.js","assets/AttachmentQuery-DmEAIZff.js","assets/RelationshipQuery-BDJrOxaX.js","assets/editsZScale-Bfe6gH1b.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{eX as W,dr as D,b4 as N,dn as Z,fA as P,aV as S,b1 as K,s as Y,N as m,n as C,aX as k,d as i,y as s,aR as ee,fB as te,dt as re,fR as ie,fQ as se,fD as ne,i as oe,aZ as $,f as Q,fw as ae,bP as le,bQ as pe,dM as ue,dp as de,dq as ye,dO as ce,dN as he,V as A,k as me,g as be,ez as fe,ay as ge,bW as ve,b_ as we,fS as Se,fy as Fe,_ as x,dQ as Ie,b3 as $e,ds as Oe,bT as je}from"./index-CEWggaxV.js";import{F as Ee}from"./EditBusLayer-SG7oYwiY.js";import{D as Te}from"./FeatureLayerBase-DPJuwFpX.js";import{f as _e}from"./RefreshableLayer-1EkEhJeI.js";import{f as Ae}from"./TemporalLayer-qq3v_i3q.js";import{x as M,Q as Ce,T as Le,m as Pe,w as xe,b as Ge,j as Ve,I as qe,q as Re,F as De,A as Ne,O as ke,P as Qe,E as Me,S as He}from"./featureLayerUtils-BhDaw8pS.js";import{s as H}from"./fieldProperties-DMs4wT6-.js";import{p as Ue,A as Be,w as ze}from"./UniqueValueRenderer-BlkUix3g.js";import{m as L}from"./jsonUtils-BseLl1fZ.js";import{y as Je}from"./FormTemplate-eV18QveB.js";import{p as U}from"./FeatureTemplate-DcprAdTM.js";import{C as Xe}from"./LabelClass-6cZokw8y.js";import{i as We}from"./labelingInfo-CijajRsc.js";import{p as Ze}from"./popupUtils-DAFYyAvw.js";import{c as Ke,b as Ye,S as et}from"./labelUtils-Dnqx6jl5.js";import{d as tt}from"./TimeInfo-3TVmpFSA.js";import{e as rt}from"./versionUtils-CaceEUVY.js";import{A as E}from"./interfaces-CL2NbQte.js";import"./LayerFloorInfo-Cdq3ulNh.js";import"./serviceCapabilitiesUtils-t8SL4e_j.js";import"./AttachmentQuery-D61mmWw4.js";import"./RelationshipQuery-DDK72Kwc.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./ColorStop-44hBlQ14.js";import"./diffUtils-B4YFa5Ju.js";import"./colorRamps-BJydlf0f.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-z2k12BH8.js";import"./jsonUtils-qYmXvGJ1.js";import"./styleUtils-CnV_Xzhi.js";import"./Version-Bd0QsIQ5.js";import"./OverrideHelper-B4ryGWZb.js";import"./utils-p-5Bbga5.js";import"./quantizationUtils-CUjGHrU3.js";import"./heatmapUtils-Clt5rJzr.js";import"./defaultsJSON-CHAaurhX.js";const B={key:"type",base:Ue,errorContext:"renderer",typeMap:{simple:L,"unique-value":Be,"class-breaks":ze}},G=H(),V=W({types:B});let it=0;function I(e){const t=e.json.write;return typeof t=="object"?t.ignoreOrigin=!0:e.json.write={ignoreOrigin:!0},e}function st(e){return new L({symbol:nt(e)})}function nt(e){switch(e){case"point":case"multipoint":return et.clone();case"polyline":return Ye.clone();case"polygon":case"multipatch":return Ke.clone();default:return null}}function ot(e,t){return!!t&&(e==null?void 0:e.type)==="unique-value"&&typeof e.field=="string"&&e.field.toLowerCase()===t.toLowerCase()&&!e.field2&&!e.field3&&!e.valueExpression}function z(e,t){var r;return e==null?null:(r=t.subtypes)==null?void 0:r.find(n=>n.code===e)}function at(e,t){let r=null;switch(t.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":r="point";break;case"esriGeometryPolyline":r="line";break;case"esriGeometryPolygon":case"esriGeometryMultiPatch":r="polygon";break;default:t.type,r=null}const n={},a=z(e,t);if(a!=null){const{defaultValues:l}=a;for(const p in l)n[p]=l[p]}return n[t.subtypeField]=e,new U({name:"New Feature",drawingTool:r,prototype:{attributes:n}})}const J="esri.layers.support.SubtypeSublayer";let o=class extends D(N(Z(ae))){constructor(e){super(e),this.charts=null,this.editingEnabled=!0,this.fieldOverrides=null,this.fieldsIndex=null,this.formTemplate=null,this.id=`${Date.now().toString(16)}-subtype-sublayer-${it++}`,this.type="subtype-sublayer",this.labelsVisible=!0,this.labelingInfo=null,this.layerType="ArcGISFeatureLayer",this.legendEnabled=!0,this.listMode="show",this.minScale=0,this.maxScale=0,this.opacity=1,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.subtypeCode=null,this.templates=null,this.title=null,this.visible=!0}load(e){return P(this.renderer,this.fieldsIndex),Promise.resolve(this)}get capabilities(){var e;return(e=this.parent)==null?void 0:e.capabilities}get effectiveCapabilities(){var e;return(e=this.parent)==null?void 0:e.effectiveCapabilities}get effectiveEditingEnabled(){const{parent:e}=this;return e?e.effectiveEditingEnabled&&this.editingEnabled:this.editingEnabled}get elevationInfo(){var e;return(e=this.parent)==null?void 0:e.elevationInfo}writeFieldOverrides(e,t,r){const{fields:n,parent:a}=this;let l;if(n){l=[];let p=0;n.forEach(({name:y,alias:c,editable:f,visible:g})=>{var O;if(!g)return;const d=(O=a==null?void 0:a.fields)==null?void 0:O.find(F=>F.name===y);if(!d)return;const b={name:y};let w=!1;c!==d.alias&&(b.alias=c,w=!0),f!==d.editable&&(b.editable=f,w=!0),l.push(b),w&&p++}),p===0&&l.length===n.length&&(l=null)}else l=S(e);l!=null&&l.length&&K(r,l,t)}get fields(){const{parent:e,fieldOverrides:t,subtypeCode:r}=this,n=e==null?void 0:e.fields;if(!e||!(n!=null&&n.length))return null;const{subtypes:a,subtypeField:l}=e,p=a==null?void 0:a.find(g=>g.code===r),y=p==null?void 0:p.defaultValues,c=p==null?void 0:p.domains,f=[];for(const g of n){const d=g.clone(),{name:b}=d,w=t==null?void 0:t.find(j=>j.name===b);if(d.visible=!t||!!w,w){const{alias:j,editable:X}=w;j&&(d.alias=j),X===!1&&(d.editable=!1)}const O=(y==null?void 0:y[b])??null;d.defaultValue=b===l?r:O;const F=(c==null?void 0:c[b])??null;d.domain=b===l?null:F?F.type==="inherited"?d.domain:F.clone():null,f.push(d)}return f}get floorInfo(){var e;return(e=this.parent)==null?void 0:e.floorInfo}get geometryType(){var e;return(e=this.parent)==null?void 0:e.geometryType}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}get objectIdField(){var e;return this.parent||Y.getLogger(J).error(v("objectIdField")),(e=this.parent)==null?void 0:e.objectIdField}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){P(e,this.fieldsIndex),this._override("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const{parent:e}=this;return e&&!e.isTable&&e.geometryType!=="mesh"?st(e.geometryType):null}readRendererFromService(e,t,r){var y,c,f;if(t.type==="Table")return null;const n=(y=t.drawingInfo)==null?void 0:y.renderer,a=V(n,t,r);let l;const{subtypeCode:p}=this;if(p!=null&&ot(a,t.subtypeField)){const g=(c=a.uniqueValueInfos)==null?void 0:c.find(({value:d})=>(d=typeof d=="number"?String(d):d)===String(p));g&&(l=new L({symbol:g.symbol}))}else(a==null?void 0:a.type)!=="simple"||(f=a.visualVariables)!=null&&f.length||(l=a);return l}readRenderer(e,t,r){var l,p,y;const n=(p=(l=t==null?void 0:t.layerDefinition)==null?void 0:l.drawingInfo)==null?void 0:p.renderer;return n?((y=n.visualVariables)==null?void 0:y.some(c=>c.type!=="rotationInfo"))?void 0:V(n,t,r)||void 0:void 0}get spatialReference(){var e;return(e=this.parent)==null?void 0:e.spatialReference}get subtypeField(){var e;return(e=this.parent)==null?void 0:e.subtypeField}readTemplatesFromService(e,t){return[at(this.subtypeCode,t)]}readTitleFromService(e,t){const r=z(this.subtypeCode,t);return r!=null?r.name:null}get url(){var e;return(e=this.parent)==null?void 0:e.url}get userHasUpdateItemPrivileges(){var e;return!!((e=this.parent)!=null&&e.userHasUpdateItemPrivileges)}async addAttachment(e,t){const{parent:r}=this;if(!r)throw v("addAttachment");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new m("subtype-sublayer:addAttachment","The feature provided does not belong to this SubtypeSublayer");return r.addAttachment(e,t)}async updateAttachment(e,t,r){const{parent:n}=this;if(!n)throw v("updateAttachment");if(e.getAttribute(n.subtypeField)!==this.subtypeCode)throw new m("subtype-sublayer:updateAttachment","The feature provided does not belong to this SubtypeSublayer");return n.updateAttachment(e,t,r)}async deleteAttachments(e,t){const{parent:r}=this;if(!r)throw v("deleteAttachments");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new m("subtype-sublayer:deleteAttachments","The feature provided does not belong to this SubtypeSublayer");return r.deleteAttachments(e,t)}async applyEdits(e,t){if(!this.parent)throw v("applyEdits");return this.parent.applyEdits(e,t)}createPopupTemplate(e){let t=this;const{parent:r,fields:n,title:a}=this;if(r){const{displayField:l,editFieldsInfo:p,objectIdField:y}=r;t={displayField:l,editFieldsInfo:p,fields:n,objectIdField:y,title:a}}return Ze(t,e)}createQuery(){if(!this.parent)throw v("createQuery");const e=M(this.parent),t=`${this.parent.subtypeField}=${this.subtypeCode}`;return e.where=C(t,this.parent.definitionExpression),e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e){return this._getLayerDomain(e)}async queryAttachments(e,t){const r=await this.load();if(!r.parent)throw v("queryAttachments");const n=e.clone();return n.where=q(n.where,r.parent.subtypeField,r.subtypeCode),r.parent.queryAttachments(e,t)}async queryFeatures(e,t){const r=await this.load();if(!r.parent)throw v("queryFeatures");const n=k.from(e)??r.createQuery();return e!=null&&(n.where=q(n.where,r.parent.subtypeField,r.subtypeCode)),r.parent.queryFeatures(n,t)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}};i([s({readOnly:!0,json:{read:!1}})],o.prototype,"capabilities",null),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"effectiveCapabilities",null),i([s({json:{write:{ignoreOrigin:!0}}})],o.prototype,"charts",void 0),i([s({type:Boolean,nonNullable:!0,json:{name:"enableEditing",write:{ignoreOrigin:!0}}})],o.prototype,"editingEnabled",void 0),i([s({type:Boolean,readOnly:!0})],o.prototype,"effectiveEditingEnabled",null),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"elevationInfo",null),i([s({json:{name:"layerDefinition.fieldOverrides",origins:{service:{read:!1}},write:{ignoreOrigin:!0,allowNull:!0}}})],o.prototype,"fieldOverrides",void 0),i([ee("fieldOverrides")],o.prototype,"writeFieldOverrides",null),i([s({...G.fields,readOnly:!0,json:{read:!1}})],o.prototype,"fields",null),i([s(G.fieldsIndex)],o.prototype,"fieldsIndex",void 0),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"floorInfo",null),i([s({type:Je,json:{name:"formInfo",write:{ignoreOrigin:!0}}})],o.prototype,"formTemplate",void 0),i([s({type:String,clonable:!1,readOnly:!0,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],o.prototype,"id",void 0),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"geometryType",null),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"type",void 0),i([s(I(S(te)))],o.prototype,"labelsVisible",void 0),i([s({type:[Xe],json:{name:"layerDefinition.drawingInfo.labelingInfo",origins:{service:{read:!1}},read:{reader:We},write:{ignoreOrigin:!0}}})],o.prototype,"labelingInfo",void 0),i([s({type:["ArcGISFeatureLayer"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],o.prototype,"layerType",void 0),i([s(I(S(re)))],o.prototype,"legendEnabled",void 0),i([s({type:["show","hide"]})],o.prototype,"listMode",void 0),i([s((()=>{const e=S(ie);return e.json.origins.service.read=!1,I(e)})())],o.prototype,"minScale",void 0),i([s((()=>{const e=S(se);return e.json.origins.service.read=!1,I(e)})())],o.prototype,"maxScale",void 0),i([s({readOnly:!0})],o.prototype,"effectiveScaleRange",null),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"objectIdField",null),i([s({type:Number,range:{min:0,max:1},nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],o.prototype,"opacity",void 0),i([s({clonable:!1})],o.prototype,"parent",void 0),i([s(I(S(ne)))],o.prototype,"popupEnabled",void 0),i([s({type:oe,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],o.prototype,"popupTemplate",void 0),i([s({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),i([s({types:B,json:{write:{target:"layerDefinition.drawingInfo.renderer",ignoreOrigin:!0}}})],o.prototype,"renderer",null),i([$("service","renderer",["drawingInfo.renderer","subtypeField","type"])],o.prototype,"readRendererFromService",null),i([$("renderer",["layerDefinition.drawingInfo.renderer"])],o.prototype,"readRenderer",null),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"spatialReference",null),i([s({type:Number,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],o.prototype,"subtypeCode",void 0),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"subtypeField",null),i([s({type:[U],json:{name:"layerDefinition.templates",write:{ignoreOrigin:!0}}})],o.prototype,"templates",void 0),i([$("service","templates",["geometryType","subtypeField","subtypes","type"])],o.prototype,"readTemplatesFromService",null),i([s({type:String,json:{write:{ignoreOrigin:!0}}})],o.prototype,"title",void 0),i([$("service","title",["subtypes"])],o.prototype,"readTitleFromService",null),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"url",null),i([s({readOnly:!0})],o.prototype,"userHasUpdateItemPrivileges",null),i([s({type:Boolean,nonNullable:!0,json:{name:"visibility",write:{ignoreOrigin:!0}}})],o.prototype,"visible",void 0),o=i([Q(J)],o);const q=(e,t,r)=>{const n=new RegExp(`${t}\\s*=\\s*\\d+`),a=`${t}=${r}`,l=e??"";return n.test(l)?l.replace(n,a):C(a,l)},v=e=>new m(`This sublayer must have a parent SubtypeGroupLayer in order to use ${e}`),T=o,h="SubtypeGroupLayer",lt="esri.layers.SubtypeGroupLayer";function R(e,t){return new m("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}const _=H();let u=class extends Te(Ee(le(Ae(pe(_e(ue(de(ye(D(ce(he(N(je))))))))))))){constructor(...e){super(...e),this._sublayerLookup=new Map,this.fields=null,this.fieldsIndex=null,this.outFields=null,this.sublayers=new(A.ofType(T)),this.timeInfo=null,this.title="Layer",this.type="subtype-group",this._debouncedSaveOperations=me(async(t,r,n)=>{const{save:a,saveAs:l}=await x(()=>import("./featureLayerUtils-SShyxaG9.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));switch(t){case E.SAVE:return a(this,r);case E.SAVE_AS:return l(this,n,r)}}),this.addHandles(be(()=>this.sublayers,(t,r)=>this._handleSublayersChange(t,r),fe))}destroy(){var e;(e=this.source)==null||e.destroy()}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=e!=null?e.signal:null,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(ge).then(async()=>{if(!this.url)throw new m("subtype-grouplayer:missing-url-or-source","SubtypeGroupLayer must be created with either a url or a portal item");if(this.layerId==null)throw new m("subtype-grouplayer:missing-layerid","layerId is required for a SubtypeGroupLayer created with url");return this._initLayerProperties(await this.createGraphicsSource(t))}).then(()=>Ce(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&this.capabilities!=null&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return Le(this)}get parsedUrl(){const e=ve(this.url);return e!=null&&this.layerId!=null&&(e.path=we(e.path,this.layerId.toString())),e}set source(e){this._get("source")!==e&&this._set("source",e)}readTitleFromService(e,{name:t}){return this.url?Se(this.url,t):t}async addAttachment(e,t){return Pe(this,e,t,h)}async updateAttachment(e,t,r){return xe(this,e,t,r,h)}async applyEdits(e,t){return Ge(this,e,t)}on(e,t){return super.on(e,t)}async createGraphicsSource(e){const{default:t}=await Fe(x(()=>import("./FeatureLayerSource-BeuGtrZI.js"),__vite__mapDeps([10,1,2,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52])),e);return new t({layer:this}).load({signal:e})}createQuery(){const e=M(this),t=this.sublayers.map(r=>r.subtypeCode);return e.where=C(`${this.subtypeField} IN (${t.join(",")})`,this.definitionExpression),e}async deleteAttachments(e,t){return Ve(this,e,t,h)}async fetchRecomputedExtents(e){return qe(this,e,h)}findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.findSublayerForSubtypeCode(r)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}loadAll(){return Ie(this,e=>{e(this.sublayers)})}async queryAttachments(e,t){return Re(this,e,t,h)}async queryFeatures(e,t){const r=await this.load(),n=k.from(e)??r.createQuery(),a=n.outFields??[];a.includes(this.subtypeField)||(a.push(this.subtypeField),n.outFields=a);const l=await r.source.queryFeatures(n,t);if(l!=null&&l.features)for(const p of l.features)p.layer=p.sourceLayer=this.findSublayerForFeature(p);return l}async queryObjectIds(e,t){return De(this,e,t,h)}async queryFeatureCount(e,t){return Ne(this,e,t,h)}async queryExtent(e,t){return ke(this,e,t,h)}async queryRelatedFeatures(e,t){return Qe(this,e,t,h)}async queryRelatedFeaturesCount(e,t){return Me(this,e,t,h)}async save(e){return this._debouncedSaveOperations(E.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(E.SAVE_AS,t,e)}write(e,t){var l;const{origin:r,layerContainerType:n,messages:a}=t;if(this.isTable){if(r==="web-scene"||r==="web-map"&&n!=="tables")return a==null||a.push(R(this,"using a table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&r==="web-map"&&n==="tables")return a==null||a.push(R(this,"using a non-table source cannot be written to tables in web maps")),null;return(l=this.sublayers)!=null&&l.length?super.write(e,t):(a==null||a.push(new m("web-document-write:invalid-property",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' has invalid value for 'sublayers' property. 'sublayers' collection should contain at least one sublayer`,{layer:this})),null)}serviceSupportsSpatialReference(e){return!!this.loaded&&rt(this,e)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}async _initLayerProperties(e){var r;this._set("source",e);const{sourceJSON:t}=e;if(t&&(this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})),this.isTable)throw new m("subtype-grouplayer:unsupported-source","SubtypeGroupLayer cannot be created using a layer with table source");if(!((r=this.subtypes)!=null&&r.length))throw new m("subtype-grouplayer:missing-subtypes","SubtypeGroupLayer must be created using a layer with subtypes");this._verifyFields(),$e(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return He(this)}_verifyFields(){var t,r;const e=((t=this.parsedUrl)==null?void 0:t.path)??"undefined";this.objectIdField||console.log("SubtypeGroupLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||e.search(/\/FeatureServer\//i)!==-1||(r=this.fields)!=null&&r.some(n=>n.type==="geometry")||console.log("SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_handleSublayersChange(e,t){t&&(t.forEach(r=>{r.parent=null}),this.removeHandles("sublayers-owner"),this._sublayerLookup.clear()),e&&(e.forEach(r=>{r.parent=this,this._sublayerLookup.set(r.subtypeCode,r)}),this.addHandles([e.on("after-add",({item:r})=>{r.parent=this,this._sublayerLookup.set(r.subtypeCode,r)}),e.on("after-remove",({item:r})=>{r.parent=null,this._sublayerLookup.delete(r.subtypeCode)})],"sublayers-owner"))}};i([s({readOnly:!0})],u.prototype,"createQueryVersion",null),i([s({readOnly:!0})],u.prototype,"editingEnabled",null),i([s({readOnly:!0})],u.prototype,"effectiveEditingEnabled",null),i([s({..._.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],u.prototype,"fields",void 0),i([s(_.fieldsIndex)],u.prototype,"fieldsIndex",void 0),i([s(Oe)],u.prototype,"id",void 0),i([s({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],u.prototype,"listMode",void 0),i([s({value:"SubtypeGroupLayer",type:["SubtypeGroupLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],u.prototype,"operationalLayerType",void 0),i([s(_.outFields)],u.prototype,"outFields",void 0),i([s({readOnly:!0})],u.prototype,"parsedUrl",null),i([s({clonable:!1})],u.prototype,"source",null),i([s({type:A.ofType(T),json:{origins:{service:{read:{source:"subtypes",reader:(e,t,r)=>{const n=e.map(({code:a})=>{const l=new T({subtypeCode:a});return l.read(t,r),l});return new(A.ofType(T))(n)}}}},name:"layers",write:{ignoreOrigin:!0}}})],u.prototype,"sublayers",void 0),i([s({type:tt})],u.prototype,"timeInfo",void 0),i([s({json:{origins:{"portal-item":{write:{enabled:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}}}})],u.prototype,"title",void 0),i([$("service","title",["name"])],u.prototype,"readTitleFromService",null),i([s({json:{read:!1}})],u.prototype,"type",void 0),u=i([Q(lt)],u);const Bt=u;export{Bt as default}; +import{eX as W,dr as D,b4 as N,dn as Z,fA as P,aV as S,b1 as K,s as Y,N as m,n as C,aX as k,d as i,y as s,aR as ee,fB as te,dt as re,fR as ie,fQ as se,fD as ne,i as oe,aZ as $,f as Q,fw as ae,bP as le,bQ as pe,dM as ue,dp as de,dq as ye,dO as ce,dN as he,V as A,k as me,g as be,ez as fe,ay as ge,bW as ve,b_ as we,fS as Se,fy as Fe,_ as x,dQ as Ie,b3 as $e,ds as Oe,bT as je}from"./index-BjUNJPVf.js";import{F as Ee}from"./EditBusLayer-OslMX9fF.js";import{D as Te}from"./FeatureLayerBase-D0I-Escx.js";import{f as _e}from"./RefreshableLayer-_r2TPtol.js";import{f as Ae}from"./TemporalLayer-CKICYnEl.js";import{x as M,Q as Ce,T as Le,m as Pe,w as xe,b as Ge,j as Ve,I as qe,q as Re,F as De,A as Ne,O as ke,P as Qe,E as Me,S as He}from"./featureLayerUtils-lwqyOSrl.js";import{s as H}from"./fieldProperties-DnrQXLBM.js";import{p as Ue,A as Be,w as ze}from"./UniqueValueRenderer-7V9Bhr-D.js";import{m as L}from"./jsonUtils-Dw332y6z.js";import{y as Je}from"./FormTemplate-BGxtsGX6.js";import{p as U}from"./FeatureTemplate-FZNGA_Ik.js";import{C as Xe}from"./LabelClass-CeatfK8u.js";import{i as We}from"./labelingInfo-DqAUis6e.js";import{p as Ze}from"./popupUtils-DlZin22m.js";import{c as Ke,b as Ye,S as et}from"./labelUtils-3p0-m-Ee.js";import{d as tt}from"./TimeInfo-DooETFWC.js";import{e as rt}from"./versionUtils-BIAEZzrm.js";import{A as E}from"./interfaces-CL2NbQte.js";import"./LayerFloorInfo-DlYNbO-A.js";import"./serviceCapabilitiesUtils-DiP90Uds.js";import"./AttachmentQuery-DmEAIZff.js";import"./RelationshipQuery-BDJrOxaX.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./ColorStop-DCGjAKLC.js";import"./diffUtils-uUoMDFQS.js";import"./colorRamps-CcakIWlU.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-BX9G5gNQ.js";import"./jsonUtils-Ox5U0P0F.js";import"./styleUtils-DOUOskVZ.js";import"./Version-Dqq_CHBG.js";import"./OverrideHelper-DxFZBnGL.js";import"./utils-CuXO_Zzq.js";import"./quantizationUtils-CfV316jZ.js";import"./heatmapUtils-BSteZBTj.js";import"./defaultsJSON-CHAaurhX.js";const B={key:"type",base:Ue,errorContext:"renderer",typeMap:{simple:L,"unique-value":Be,"class-breaks":ze}},G=H(),V=W({types:B});let it=0;function I(e){const t=e.json.write;return typeof t=="object"?t.ignoreOrigin=!0:e.json.write={ignoreOrigin:!0},e}function st(e){return new L({symbol:nt(e)})}function nt(e){switch(e){case"point":case"multipoint":return et.clone();case"polyline":return Ye.clone();case"polygon":case"multipatch":return Ke.clone();default:return null}}function ot(e,t){return!!t&&(e==null?void 0:e.type)==="unique-value"&&typeof e.field=="string"&&e.field.toLowerCase()===t.toLowerCase()&&!e.field2&&!e.field3&&!e.valueExpression}function z(e,t){var r;return e==null?null:(r=t.subtypes)==null?void 0:r.find(n=>n.code===e)}function at(e,t){let r=null;switch(t.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":r="point";break;case"esriGeometryPolyline":r="line";break;case"esriGeometryPolygon":case"esriGeometryMultiPatch":r="polygon";break;default:t.type,r=null}const n={},a=z(e,t);if(a!=null){const{defaultValues:l}=a;for(const p in l)n[p]=l[p]}return n[t.subtypeField]=e,new U({name:"New Feature",drawingTool:r,prototype:{attributes:n}})}const J="esri.layers.support.SubtypeSublayer";let o=class extends D(N(Z(ae))){constructor(e){super(e),this.charts=null,this.editingEnabled=!0,this.fieldOverrides=null,this.fieldsIndex=null,this.formTemplate=null,this.id=`${Date.now().toString(16)}-subtype-sublayer-${it++}`,this.type="subtype-sublayer",this.labelsVisible=!0,this.labelingInfo=null,this.layerType="ArcGISFeatureLayer",this.legendEnabled=!0,this.listMode="show",this.minScale=0,this.maxScale=0,this.opacity=1,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.subtypeCode=null,this.templates=null,this.title=null,this.visible=!0}load(e){return P(this.renderer,this.fieldsIndex),Promise.resolve(this)}get capabilities(){var e;return(e=this.parent)==null?void 0:e.capabilities}get effectiveCapabilities(){var e;return(e=this.parent)==null?void 0:e.effectiveCapabilities}get effectiveEditingEnabled(){const{parent:e}=this;return e?e.effectiveEditingEnabled&&this.editingEnabled:this.editingEnabled}get elevationInfo(){var e;return(e=this.parent)==null?void 0:e.elevationInfo}writeFieldOverrides(e,t,r){const{fields:n,parent:a}=this;let l;if(n){l=[];let p=0;n.forEach(({name:y,alias:c,editable:f,visible:g})=>{var O;if(!g)return;const d=(O=a==null?void 0:a.fields)==null?void 0:O.find(F=>F.name===y);if(!d)return;const b={name:y};let w=!1;c!==d.alias&&(b.alias=c,w=!0),f!==d.editable&&(b.editable=f,w=!0),l.push(b),w&&p++}),p===0&&l.length===n.length&&(l=null)}else l=S(e);l!=null&&l.length&&K(r,l,t)}get fields(){const{parent:e,fieldOverrides:t,subtypeCode:r}=this,n=e==null?void 0:e.fields;if(!e||!(n!=null&&n.length))return null;const{subtypes:a,subtypeField:l}=e,p=a==null?void 0:a.find(g=>g.code===r),y=p==null?void 0:p.defaultValues,c=p==null?void 0:p.domains,f=[];for(const g of n){const d=g.clone(),{name:b}=d,w=t==null?void 0:t.find(j=>j.name===b);if(d.visible=!t||!!w,w){const{alias:j,editable:X}=w;j&&(d.alias=j),X===!1&&(d.editable=!1)}const O=(y==null?void 0:y[b])??null;d.defaultValue=b===l?r:O;const F=(c==null?void 0:c[b])??null;d.domain=b===l?null:F?F.type==="inherited"?d.domain:F.clone():null,f.push(d)}return f}get floorInfo(){var e;return(e=this.parent)==null?void 0:e.floorInfo}get geometryType(){var e;return(e=this.parent)==null?void 0:e.geometryType}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}get objectIdField(){var e;return this.parent||Y.getLogger(J).error(v("objectIdField")),(e=this.parent)==null?void 0:e.objectIdField}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){P(e,this.fieldsIndex),this._override("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const{parent:e}=this;return e&&!e.isTable&&e.geometryType!=="mesh"?st(e.geometryType):null}readRendererFromService(e,t,r){var y,c,f;if(t.type==="Table")return null;const n=(y=t.drawingInfo)==null?void 0:y.renderer,a=V(n,t,r);let l;const{subtypeCode:p}=this;if(p!=null&&ot(a,t.subtypeField)){const g=(c=a.uniqueValueInfos)==null?void 0:c.find(({value:d})=>(d=typeof d=="number"?String(d):d)===String(p));g&&(l=new L({symbol:g.symbol}))}else(a==null?void 0:a.type)!=="simple"||(f=a.visualVariables)!=null&&f.length||(l=a);return l}readRenderer(e,t,r){var l,p,y;const n=(p=(l=t==null?void 0:t.layerDefinition)==null?void 0:l.drawingInfo)==null?void 0:p.renderer;return n?((y=n.visualVariables)==null?void 0:y.some(c=>c.type!=="rotationInfo"))?void 0:V(n,t,r)||void 0:void 0}get spatialReference(){var e;return(e=this.parent)==null?void 0:e.spatialReference}get subtypeField(){var e;return(e=this.parent)==null?void 0:e.subtypeField}readTemplatesFromService(e,t){return[at(this.subtypeCode,t)]}readTitleFromService(e,t){const r=z(this.subtypeCode,t);return r!=null?r.name:null}get url(){var e;return(e=this.parent)==null?void 0:e.url}get userHasUpdateItemPrivileges(){var e;return!!((e=this.parent)!=null&&e.userHasUpdateItemPrivileges)}async addAttachment(e,t){const{parent:r}=this;if(!r)throw v("addAttachment");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new m("subtype-sublayer:addAttachment","The feature provided does not belong to this SubtypeSublayer");return r.addAttachment(e,t)}async updateAttachment(e,t,r){const{parent:n}=this;if(!n)throw v("updateAttachment");if(e.getAttribute(n.subtypeField)!==this.subtypeCode)throw new m("subtype-sublayer:updateAttachment","The feature provided does not belong to this SubtypeSublayer");return n.updateAttachment(e,t,r)}async deleteAttachments(e,t){const{parent:r}=this;if(!r)throw v("deleteAttachments");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new m("subtype-sublayer:deleteAttachments","The feature provided does not belong to this SubtypeSublayer");return r.deleteAttachments(e,t)}async applyEdits(e,t){if(!this.parent)throw v("applyEdits");return this.parent.applyEdits(e,t)}createPopupTemplate(e){let t=this;const{parent:r,fields:n,title:a}=this;if(r){const{displayField:l,editFieldsInfo:p,objectIdField:y}=r;t={displayField:l,editFieldsInfo:p,fields:n,objectIdField:y,title:a}}return Ze(t,e)}createQuery(){if(!this.parent)throw v("createQuery");const e=M(this.parent),t=`${this.parent.subtypeField}=${this.subtypeCode}`;return e.where=C(t,this.parent.definitionExpression),e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e){return this._getLayerDomain(e)}async queryAttachments(e,t){const r=await this.load();if(!r.parent)throw v("queryAttachments");const n=e.clone();return n.where=q(n.where,r.parent.subtypeField,r.subtypeCode),r.parent.queryAttachments(e,t)}async queryFeatures(e,t){const r=await this.load();if(!r.parent)throw v("queryFeatures");const n=k.from(e)??r.createQuery();return e!=null&&(n.where=q(n.where,r.parent.subtypeField,r.subtypeCode)),r.parent.queryFeatures(n,t)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}};i([s({readOnly:!0,json:{read:!1}})],o.prototype,"capabilities",null),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"effectiveCapabilities",null),i([s({json:{write:{ignoreOrigin:!0}}})],o.prototype,"charts",void 0),i([s({type:Boolean,nonNullable:!0,json:{name:"enableEditing",write:{ignoreOrigin:!0}}})],o.prototype,"editingEnabled",void 0),i([s({type:Boolean,readOnly:!0})],o.prototype,"effectiveEditingEnabled",null),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"elevationInfo",null),i([s({json:{name:"layerDefinition.fieldOverrides",origins:{service:{read:!1}},write:{ignoreOrigin:!0,allowNull:!0}}})],o.prototype,"fieldOverrides",void 0),i([ee("fieldOverrides")],o.prototype,"writeFieldOverrides",null),i([s({...G.fields,readOnly:!0,json:{read:!1}})],o.prototype,"fields",null),i([s(G.fieldsIndex)],o.prototype,"fieldsIndex",void 0),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"floorInfo",null),i([s({type:Je,json:{name:"formInfo",write:{ignoreOrigin:!0}}})],o.prototype,"formTemplate",void 0),i([s({type:String,clonable:!1,readOnly:!0,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],o.prototype,"id",void 0),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"geometryType",null),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"type",void 0),i([s(I(S(te)))],o.prototype,"labelsVisible",void 0),i([s({type:[Xe],json:{name:"layerDefinition.drawingInfo.labelingInfo",origins:{service:{read:!1}},read:{reader:We},write:{ignoreOrigin:!0}}})],o.prototype,"labelingInfo",void 0),i([s({type:["ArcGISFeatureLayer"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],o.prototype,"layerType",void 0),i([s(I(S(re)))],o.prototype,"legendEnabled",void 0),i([s({type:["show","hide"]})],o.prototype,"listMode",void 0),i([s((()=>{const e=S(ie);return e.json.origins.service.read=!1,I(e)})())],o.prototype,"minScale",void 0),i([s((()=>{const e=S(se);return e.json.origins.service.read=!1,I(e)})())],o.prototype,"maxScale",void 0),i([s({readOnly:!0})],o.prototype,"effectiveScaleRange",null),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"objectIdField",null),i([s({type:Number,range:{min:0,max:1},nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],o.prototype,"opacity",void 0),i([s({clonable:!1})],o.prototype,"parent",void 0),i([s(I(S(ne)))],o.prototype,"popupEnabled",void 0),i([s({type:oe,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],o.prototype,"popupTemplate",void 0),i([s({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),i([s({types:B,json:{write:{target:"layerDefinition.drawingInfo.renderer",ignoreOrigin:!0}}})],o.prototype,"renderer",null),i([$("service","renderer",["drawingInfo.renderer","subtypeField","type"])],o.prototype,"readRendererFromService",null),i([$("renderer",["layerDefinition.drawingInfo.renderer"])],o.prototype,"readRenderer",null),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"spatialReference",null),i([s({type:Number,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],o.prototype,"subtypeCode",void 0),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"subtypeField",null),i([s({type:[U],json:{name:"layerDefinition.templates",write:{ignoreOrigin:!0}}})],o.prototype,"templates",void 0),i([$("service","templates",["geometryType","subtypeField","subtypes","type"])],o.prototype,"readTemplatesFromService",null),i([s({type:String,json:{write:{ignoreOrigin:!0}}})],o.prototype,"title",void 0),i([$("service","title",["subtypes"])],o.prototype,"readTitleFromService",null),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"url",null),i([s({readOnly:!0})],o.prototype,"userHasUpdateItemPrivileges",null),i([s({type:Boolean,nonNullable:!0,json:{name:"visibility",write:{ignoreOrigin:!0}}})],o.prototype,"visible",void 0),o=i([Q(J)],o);const q=(e,t,r)=>{const n=new RegExp(`${t}\\s*=\\s*\\d+`),a=`${t}=${r}`,l=e??"";return n.test(l)?l.replace(n,a):C(a,l)},v=e=>new m(`This sublayer must have a parent SubtypeGroupLayer in order to use ${e}`),T=o,h="SubtypeGroupLayer",lt="esri.layers.SubtypeGroupLayer";function R(e,t){return new m("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}const _=H();let u=class extends Te(Ee(le(Ae(pe(_e(ue(de(ye(D(ce(he(N(je))))))))))))){constructor(...e){super(...e),this._sublayerLookup=new Map,this.fields=null,this.fieldsIndex=null,this.outFields=null,this.sublayers=new(A.ofType(T)),this.timeInfo=null,this.title="Layer",this.type="subtype-group",this._debouncedSaveOperations=me(async(t,r,n)=>{const{save:a,saveAs:l}=await x(()=>import("./featureLayerUtils-D4E7zCBj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));switch(t){case E.SAVE:return a(this,r);case E.SAVE_AS:return l(this,n,r)}}),this.addHandles(be(()=>this.sublayers,(t,r)=>this._handleSublayersChange(t,r),fe))}destroy(){var e;(e=this.source)==null||e.destroy()}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=e!=null?e.signal:null,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(ge).then(async()=>{if(!this.url)throw new m("subtype-grouplayer:missing-url-or-source","SubtypeGroupLayer must be created with either a url or a portal item");if(this.layerId==null)throw new m("subtype-grouplayer:missing-layerid","layerId is required for a SubtypeGroupLayer created with url");return this._initLayerProperties(await this.createGraphicsSource(t))}).then(()=>Ce(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&this.capabilities!=null&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return Le(this)}get parsedUrl(){const e=ve(this.url);return e!=null&&this.layerId!=null&&(e.path=we(e.path,this.layerId.toString())),e}set source(e){this._get("source")!==e&&this._set("source",e)}readTitleFromService(e,{name:t}){return this.url?Se(this.url,t):t}async addAttachment(e,t){return Pe(this,e,t,h)}async updateAttachment(e,t,r){return xe(this,e,t,r,h)}async applyEdits(e,t){return Ge(this,e,t)}on(e,t){return super.on(e,t)}async createGraphicsSource(e){const{default:t}=await Fe(x(()=>import("./FeatureLayerSource-3cjHhwgM.js"),__vite__mapDeps([10,1,2,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52])),e);return new t({layer:this}).load({signal:e})}createQuery(){const e=M(this),t=this.sublayers.map(r=>r.subtypeCode);return e.where=C(`${this.subtypeField} IN (${t.join(",")})`,this.definitionExpression),e}async deleteAttachments(e,t){return Ve(this,e,t,h)}async fetchRecomputedExtents(e){return qe(this,e,h)}findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.findSublayerForSubtypeCode(r)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}loadAll(){return Ie(this,e=>{e(this.sublayers)})}async queryAttachments(e,t){return Re(this,e,t,h)}async queryFeatures(e,t){const r=await this.load(),n=k.from(e)??r.createQuery(),a=n.outFields??[];a.includes(this.subtypeField)||(a.push(this.subtypeField),n.outFields=a);const l=await r.source.queryFeatures(n,t);if(l!=null&&l.features)for(const p of l.features)p.layer=p.sourceLayer=this.findSublayerForFeature(p);return l}async queryObjectIds(e,t){return De(this,e,t,h)}async queryFeatureCount(e,t){return Ne(this,e,t,h)}async queryExtent(e,t){return ke(this,e,t,h)}async queryRelatedFeatures(e,t){return Qe(this,e,t,h)}async queryRelatedFeaturesCount(e,t){return Me(this,e,t,h)}async save(e){return this._debouncedSaveOperations(E.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(E.SAVE_AS,t,e)}write(e,t){var l;const{origin:r,layerContainerType:n,messages:a}=t;if(this.isTable){if(r==="web-scene"||r==="web-map"&&n!=="tables")return a==null||a.push(R(this,"using a table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&r==="web-map"&&n==="tables")return a==null||a.push(R(this,"using a non-table source cannot be written to tables in web maps")),null;return(l=this.sublayers)!=null&&l.length?super.write(e,t):(a==null||a.push(new m("web-document-write:invalid-property",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' has invalid value for 'sublayers' property. 'sublayers' collection should contain at least one sublayer`,{layer:this})),null)}serviceSupportsSpatialReference(e){return!!this.loaded&&rt(this,e)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}async _initLayerProperties(e){var r;this._set("source",e);const{sourceJSON:t}=e;if(t&&(this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})),this.isTable)throw new m("subtype-grouplayer:unsupported-source","SubtypeGroupLayer cannot be created using a layer with table source");if(!((r=this.subtypes)!=null&&r.length))throw new m("subtype-grouplayer:missing-subtypes","SubtypeGroupLayer must be created using a layer with subtypes");this._verifyFields(),$e(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return He(this)}_verifyFields(){var t,r;const e=((t=this.parsedUrl)==null?void 0:t.path)??"undefined";this.objectIdField||console.log("SubtypeGroupLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||e.search(/\/FeatureServer\//i)!==-1||(r=this.fields)!=null&&r.some(n=>n.type==="geometry")||console.log("SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_handleSublayersChange(e,t){t&&(t.forEach(r=>{r.parent=null}),this.removeHandles("sublayers-owner"),this._sublayerLookup.clear()),e&&(e.forEach(r=>{r.parent=this,this._sublayerLookup.set(r.subtypeCode,r)}),this.addHandles([e.on("after-add",({item:r})=>{r.parent=this,this._sublayerLookup.set(r.subtypeCode,r)}),e.on("after-remove",({item:r})=>{r.parent=null,this._sublayerLookup.delete(r.subtypeCode)})],"sublayers-owner"))}};i([s({readOnly:!0})],u.prototype,"createQueryVersion",null),i([s({readOnly:!0})],u.prototype,"editingEnabled",null),i([s({readOnly:!0})],u.prototype,"effectiveEditingEnabled",null),i([s({..._.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],u.prototype,"fields",void 0),i([s(_.fieldsIndex)],u.prototype,"fieldsIndex",void 0),i([s(Oe)],u.prototype,"id",void 0),i([s({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],u.prototype,"listMode",void 0),i([s({value:"SubtypeGroupLayer",type:["SubtypeGroupLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],u.prototype,"operationalLayerType",void 0),i([s(_.outFields)],u.prototype,"outFields",void 0),i([s({readOnly:!0})],u.prototype,"parsedUrl",null),i([s({clonable:!1})],u.prototype,"source",null),i([s({type:A.ofType(T),json:{origins:{service:{read:{source:"subtypes",reader:(e,t,r)=>{const n=e.map(({code:a})=>{const l=new T({subtypeCode:a});return l.read(t,r),l});return new(A.ofType(T))(n)}}}},name:"layers",write:{ignoreOrigin:!0}}})],u.prototype,"sublayers",void 0),i([s({type:tt})],u.prototype,"timeInfo",void 0),i([s({json:{origins:{"portal-item":{write:{enabled:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}}}})],u.prototype,"title",void 0),i([$("service","title",["name"])],u.prototype,"readTitleFromService",null),i([s({json:{read:!1}})],u.prototype,"type",void 0),u=i([Q(lt)],u);const Bt=u;export{Bt as default}; diff --git a/assets/SubtypeGroupLayerView2D-BzijIwec.js b/assets/SubtypeGroupLayerView2D-BzijIwec.js deleted file mode 100644 index 0b1497b..0000000 --- a/assets/SubtypeGroupLayerView2D-BzijIwec.js +++ /dev/null @@ -1,7 +0,0 @@ -import{d as a,f as n,g as d,P as u,E as l}from"./index-CEWggaxV.js";import{X as g}from"./FeatureLayerView2D-Dw_5zj3d.js";import"./diffUtils-B4YFa5Ju.js";import"./Container-CB7SlLB9.js";import"./highlightReasons-DbgbcWKM.js";import"./Texture-DJgkMrSB.js";import"./FeatureEffect-ByrbZlne.js";import"./FeatureSet-CYJUZgOk.js";import"./LayerView-BEFTHNYv.js";import"./scaleUtils-Bqauo1zZ.js";import"./TechniqueInstance-CSsTmbek.js";import"./UpdateTracking2D-nj9Q-3df.js";import"./TurboLine-CkxIB4ZX.js";import"./earcut-hRlx3adE.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./utils-p-5Bbga5.js";import"./Rect-CUzevAry.js";import"./LabelMetric-D2hbzzy_.js";import"./Program-DLRmaKpw.js";import"./labelUtils-Dnqx6jl5.js";import"./defaultsJSON-CHAaurhX.js";import"./BindType-BmZEZMMh.js";import"./Util-BS8sJGjF.js";import"./constants-D5zmR9t2.js";import"./TileContainer-Ci6dOowA.js";import"./WGLContainer-B_Pv-8Yi.js";import"./ProgramTemplate-BICQrNzS.js";import"./config-MDUrh2eL.js";import"./featureConversionUtils-CmP9mw0r.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./tileUtils-B7X19rIS.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./OrderByInfo-DKzv2-WS.js";import"./labelingInfo-CijajRsc.js";import"./LabelClass-6cZokw8y.js";import"./jsonUtils-qYmXvGJ1.js";import"./heatmapUtils-Clt5rJzr.js";import"./SDFHelper-CSK796Wb.js";import"./floatRGBA-BLm-Rhaq.js";import"./FeatureCommandQueue-Btq_FXyi.js";import"./HighlightCounter-abgLEfgq.js";import"./floorFilterUtils-DZ5C6FQv.js";import"./popupUtils-BovqErR_.js";import"./RefreshableLayerView-C1-PEoNB.js";let i=class extends g{initialize(){this.addHandles([d(()=>this.view.scale,()=>this._update(),u)],"constructor")}isUpdating(){const t=this.layer.sublayers.some(s=>s.renderer!=null),r=this._commandsQueue.updateTracking.updating,o=this._updatingRequiredFieldsPromise!=null,p=!this._worker,m=this.dataUpdating,e=t&&(r||o||p||m);return l("esri-2d-log-updating")&&console.log(`Updating FLV2D: ${e} - -> hasRenderer ${t} - -> hasPendingCommand ${r} - -> updatingRequiredFields ${o} - -> updatingProxy ${p} - -> updatingPipeline ${m} -`),e}};i=a([n("esri.views.2d.layers.SubtypeGroupLayerView2D")],i);const pi=i;export{pi as default}; diff --git a/assets/SubtypeGroupLayerView2D-DykSTPs3.js b/assets/SubtypeGroupLayerView2D-DykSTPs3.js new file mode 100644 index 0000000..d741146 --- /dev/null +++ b/assets/SubtypeGroupLayerView2D-DykSTPs3.js @@ -0,0 +1,7 @@ +import{d as a,f as n,g as d,P as u,E as l}from"./index-BjUNJPVf.js";import{X as g}from"./FeatureLayerView2D-B6lIa9Lt.js";import"./diffUtils-uUoMDFQS.js";import"./Container-_n5wCgez.js";import"./highlightReasons-BOU4mnPE.js";import"./Texture-S4dD-WHn.js";import"./FeatureEffect-DBbkrS6j.js";import"./FeatureSet-opEn8ou8.js";import"./LayerView-Bux7vAEn.js";import"./scaleUtils-DWXMiS7R.js";import"./TechniqueInstance-XtnK2qy2.js";import"./UpdateTracking2D-Ds_Gdrxd.js";import"./TurboLine-DNQdPIXo.js";import"./earcut-CWKXDqDj.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./utils-CuXO_Zzq.js";import"./Rect-CUzevAry.js";import"./LabelMetric-BcUxDImF.js";import"./Program-DBsYtQ00.js";import"./labelUtils-3p0-m-Ee.js";import"./defaultsJSON-CHAaurhX.js";import"./BindType-BmZEZMMh.js";import"./Util-CS5u4Lec.js";import"./constants-D5zmR9t2.js";import"./TileContainer-Bs-vXdD_.js";import"./WGLContainer-DgZNq7b0.js";import"./ProgramTemplate-Ck2I0bIi.js";import"./config-MDUrh2eL.js";import"./featureConversionUtils-BHhm7bvm.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./tileUtils-B7X19rIS.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./OrderByInfo-DKyk5GLW.js";import"./labelingInfo-DqAUis6e.js";import"./LabelClass-CeatfK8u.js";import"./jsonUtils-Ox5U0P0F.js";import"./heatmapUtils-BSteZBTj.js";import"./SDFHelper-kKuXhauo.js";import"./floatRGBA-Cs54GdjG.js";import"./FeatureCommandQueue-DI81F3gA.js";import"./HighlightCounter-qEuAaY1V.js";import"./floorFilterUtils-DZ5C6FQv.js";import"./popupUtils-Do2GfZME.js";import"./RefreshableLayerView-L9NGpXXI.js";let i=class extends g{initialize(){this.addHandles([d(()=>this.view.scale,()=>this._update(),u)],"constructor")}isUpdating(){const t=this.layer.sublayers.some(s=>s.renderer!=null),r=this._commandsQueue.updateTracking.updating,o=this._updatingRequiredFieldsPromise!=null,p=!this._worker,m=this.dataUpdating,e=t&&(r||o||p||m);return l("esri-2d-log-updating")&&console.log(`Updating FLV2D: ${e} + -> hasRenderer ${t} + -> hasPendingCommand ${r} + -> updatingRequiredFields ${o} + -> updatingProxy ${p} + -> updatingPipeline ${m} +`),e}};i=a([n("esri.views.2d.layers.SubtypeGroupLayerView2D")],i);const pi=i;export{pi as default}; diff --git a/assets/TechniqueInstance-CSsTmbek.js b/assets/TechniqueInstance-XtnK2qy2.js similarity index 94% rename from assets/TechniqueInstance-CSsTmbek.js rename to assets/TechniqueInstance-XtnK2qy2.js index 3b4ee25..95f337f 100644 --- a/assets/TechniqueInstance-CSsTmbek.js +++ b/assets/TechniqueInstance-XtnK2qy2.js @@ -1 +1 @@ -import{E as c,g6 as d,df as v,g7 as V,g8 as U,g9 as M,ga as $,gb as k,gc as B,gd as F,D as w,L as z,N as L,s as R}from"./index-CEWggaxV.js";import{f as m,n as I}from"./UpdateTracking2D-nj9Q-3df.js";import{d as g,c as O}from"./LabelMetric-D2hbzzy_.js";import{x as P}from"./Program-DLRmaKpw.js";import{e as D,m as A}from"./Texture-DJgkMrSB.js";import{i as N}from"./TileContainer-Ci6dOowA.js";const C=()=>R.getLogger("esri.views.2d.engine.webgl.AttributeStoreView");class T{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(){var t;(t=this._texture)==null||t.dispose();for(const e in this._fbos){const i=this._fbos[e];i&&(e==="0"&&i.detachColorTexture(),i.dispose()),this._fbos[e]=null}this._texture=null}get _textureDesc(){const t=new D;return t.wrapMode=w.CLAMP_TO_EDGE,t.samplingMode=z.NEAREST,t.dataType=this.pixelType,t.width=this.size,t.height=this.size,t}setData(t,e,i){const s=m(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(this.data==null)return null;const i=m(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=e===0?this.getTexture(t):this._textureDesc;this._fbos[e]=new P(t,i)}return this._fbos[e]}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(t,e){try{const i=this.dirtyStart,s=this.dirtyEnd;if(!this.hasDirty)return;c("esri-2d-update-debug")&&console.debug(`Version[${e}] AttributeStoreView.updateTexture`,{start:i,end:s,firstBytes:new Uint8Array(this.data.buffer.slice(0,16)),block:this}),this._resetRange();const r=this.data.buffer,a=this.getTexture(t),n=4,u=(i-i%this.size)/this.size,h=(s-s%this.size)/this.size,o=u,l=this.size,p=h,_=u*this.size*n,f=(l+p*this.size)*n-_,b=g(this.pixelType),E=new b(r,_*b.BYTES_PER_ELEMENT,f),S=this.size,y=p-o+1;if(y>this.size)return void C().error(new L("mapview-webgl","Out-of-bounds index when updating AttributeData"));a.updateData(0,0,o,S,y,E)}catch{}}update(t){const{data:e,start:i,end:s}=t;if(e!=null&&this.data!=null){const r=this.data,a=i*this.texelSize;for(let n=0;ni!=null?new T(i,this.size,s):null);else for(let i=0;i{c("esri-2d-update-debug")&&console.error("AttributeStoreView.requestUpdate rejected",i)}),this._version=t.version,this._pendingAttributeUpdates.push({inner:t,resolver:e}),c("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{inner:e,resolver:i}of t){const{blockData:s,initArgs:r,sendUpdateEpoch:a,version:n}=e;c("esri-2d-update-debug")&&console.debug(`Version[${this._version}] Epoch[${a}] AttributeStoreView.applyUpdate`),this._version=n,this._epoch=a,r!=null&&this._initialize(r);const u=this._data;for(let h=0;ht.destroy()),this.removeAllChildren(),this.attributeView.destroy()}doRender(t){t.context.capabilities.enable("textureFloat"),super.doRender(t)}createRenderParams(t){const e=super.createRenderParams(t);return e.attributeView=this.attributeView,e.instanceStore=this._instanceStore,e.statisticsByLevel=this._statisticsByLevel,e}}class K{constructor(t,e,i,s,r){this._instanceId=t,this.techniqueRef=e,this._meshWriterName=i,this._input=s,this.optionalAttributes=r}get instanceId(){return I(this._instanceId)}createMeshInfo(t){return{id:this._instanceId,meshWriterName:this._meshWriterName,options:t,optionalAttributes:this.optionalAttributes}}getInput(){return this._input}setInput(t){this._input=t}}export{K as i,J as r}; +import{E as c,g6 as d,df as v,g7 as V,g8 as U,g9 as M,ga as $,gb as k,gc as B,gd as F,D as w,L as z,N as L,s as R}from"./index-BjUNJPVf.js";import{f as m,n as I}from"./UpdateTracking2D-Ds_Gdrxd.js";import{d as g,c as O}from"./LabelMetric-BcUxDImF.js";import{x as P}from"./Program-DBsYtQ00.js";import{e as D,m as A}from"./Texture-S4dD-WHn.js";import{i as N}from"./TileContainer-Bs-vXdD_.js";const C=()=>R.getLogger("esri.views.2d.engine.webgl.AttributeStoreView");class T{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(){var t;(t=this._texture)==null||t.dispose();for(const e in this._fbos){const i=this._fbos[e];i&&(e==="0"&&i.detachColorTexture(),i.dispose()),this._fbos[e]=null}this._texture=null}get _textureDesc(){const t=new D;return t.wrapMode=w.CLAMP_TO_EDGE,t.samplingMode=z.NEAREST,t.dataType=this.pixelType,t.width=this.size,t.height=this.size,t}setData(t,e,i){const s=m(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(this.data==null)return null;const i=m(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=e===0?this.getTexture(t):this._textureDesc;this._fbos[e]=new P(t,i)}return this._fbos[e]}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(t,e){try{const i=this.dirtyStart,s=this.dirtyEnd;if(!this.hasDirty)return;c("esri-2d-update-debug")&&console.debug(`Version[${e}] AttributeStoreView.updateTexture`,{start:i,end:s,firstBytes:new Uint8Array(this.data.buffer.slice(0,16)),block:this}),this._resetRange();const r=this.data.buffer,a=this.getTexture(t),n=4,u=(i-i%this.size)/this.size,h=(s-s%this.size)/this.size,o=u,l=this.size,p=h,_=u*this.size*n,f=(l+p*this.size)*n-_,b=g(this.pixelType),E=new b(r,_*b.BYTES_PER_ELEMENT,f),S=this.size,y=p-o+1;if(y>this.size)return void C().error(new L("mapview-webgl","Out-of-bounds index when updating AttributeData"));a.updateData(0,0,o,S,y,E)}catch{}}update(t){const{data:e,start:i,end:s}=t;if(e!=null&&this.data!=null){const r=this.data,a=i*this.texelSize;for(let n=0;ni!=null?new T(i,this.size,s):null);else for(let i=0;i{c("esri-2d-update-debug")&&console.error("AttributeStoreView.requestUpdate rejected",i)}),this._version=t.version,this._pendingAttributeUpdates.push({inner:t,resolver:e}),c("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{inner:e,resolver:i}of t){const{blockData:s,initArgs:r,sendUpdateEpoch:a,version:n}=e;c("esri-2d-update-debug")&&console.debug(`Version[${this._version}] Epoch[${a}] AttributeStoreView.applyUpdate`),this._version=n,this._epoch=a,r!=null&&this._initialize(r);const u=this._data;for(let h=0;ht.destroy()),this.removeAllChildren(),this.attributeView.destroy()}doRender(t){t.context.capabilities.enable("textureFloat"),super.doRender(t)}createRenderParams(t){const e=super.createRenderParams(t);return e.attributeView=this.attributeView,e.instanceStore=this._instanceStore,e.statisticsByLevel=this._statisticsByLevel,e}}class K{constructor(t,e,i,s,r){this._instanceId=t,this.techniqueRef=e,this._meshWriterName=i,this._input=s,this.optionalAttributes=r}get instanceId(){return I(this._instanceId)}createMeshInfo(t){return{id:this._instanceId,meshWriterName:this._meshWriterName,options:t,optionalAttributes:this.optionalAttributes}}getInput(){return this._input}setInput(t){this._input=t}}export{K as i,J as r}; diff --git a/assets/TemporalLayer-qq3v_i3q.js b/assets/TemporalLayer-CKICYnEl.js similarity index 88% rename from assets/TemporalLayer-qq3v_i3q.js rename to assets/TemporalLayer-CKICYnEl.js index 457b7bd..391c513 100644 --- a/assets/TemporalLayer-qq3v_i3q.js +++ b/assets/TemporalLayer-CKICYnEl.js @@ -1 +1 @@ -import{d as t,y as i,b2 as l,aZ as p,f as u,b3 as d}from"./index-CEWggaxV.js";import{l as m,d as c,e as y}from"./TimeInfo-3TVmpFSA.js";const x=a=>{let e=class extends a{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(o,f){const s=f.timeInfo.exportOptions;if(!s)return null;const r=s.timeOffset,n=y.fromJSON(s.timeOffsetUnits);return r&&n?new m({value:r,unit:n}):null}set timeInfo(o){d(o,this.fieldsIndex),this._set("timeInfo",o)}};return t([i({type:l,json:{write:!1}})],e.prototype,"timeExtent",void 0),t([i({type:m})],e.prototype,"timeOffset",void 0),t([p("service","timeOffset",["timeInfo.exportOptions"])],e.prototype,"readOffset",null),t([i({value:null,type:c,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],e.prototype,"timeInfo",null),t([i({type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation"},origins:{"web-scene":{read:!1,write:!1}}}})],e.prototype,"useViewTime",void 0),e=t([u("esri.layers.mixins.TemporalLayer")],e),e};export{x as f}; +import{d as t,y as i,b2 as l,aZ as p,f as u,b3 as d}from"./index-BjUNJPVf.js";import{l as m,d as c,e as y}from"./TimeInfo-DooETFWC.js";const x=a=>{let e=class extends a{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(o,f){const s=f.timeInfo.exportOptions;if(!s)return null;const r=s.timeOffset,n=y.fromJSON(s.timeOffsetUnits);return r&&n?new m({value:r,unit:n}):null}set timeInfo(o){d(o,this.fieldsIndex),this._set("timeInfo",o)}};return t([i({type:l,json:{write:!1}})],e.prototype,"timeExtent",void 0),t([i({type:m})],e.prototype,"timeOffset",void 0),t([p("service","timeOffset",["timeInfo.exportOptions"])],e.prototype,"readOffset",null),t([i({value:null,type:c,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],e.prototype,"timeInfo",null),t([i({type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation"},origins:{"web-scene":{read:!1,write:!1}}}})],e.prototype,"useViewTime",void 0),e=t([u("esri.layers.mixins.TemporalLayer")],e),e};export{x as f}; diff --git a/assets/Texture-DJgkMrSB.js b/assets/Texture-S4dD-WHn.js similarity index 99% rename from assets/Texture-DJgkMrSB.js rename to assets/Texture-S4dD-WHn.js index d05b1f0..b76c5fd 100644 --- a/assets/Texture-DJgkMrSB.js +++ b/assets/Texture-S4dD-WHn.js @@ -1 +1 @@ -import{E as Y,N as m,s as k,g5 as x,ir as T,l as i,is as M,v as d,it as I,U as G,L as R,D as K,gf as C}from"./index-CEWggaxV.js";const q=()=>k.getLogger("esri.views.webgl.checkWebGLError");function j(t,e){switch(e){case t.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case t.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case t.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case t.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case t.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case t.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const H=!!Y("enable-feature:webgl-debug");function $(){return H}function ce(){return H}function S(t){if($()){const e=t.getError();if(e){const r=j(t,e),a=new Error().stack;q().error(new m("webgl-error","WebGL error occurred",{message:r,stack:a}))}}}var O;(function(t){t[t.Texture=0]="Texture",t[t.RenderBuffer=1]="RenderBuffer"})(O||(O={}));function Z(t){switch(t){case x.BYTE:case x.UNSIGNED_BYTE:return 1;case x.SHORT:case x.UNSIGNED_SHORT:return 2;case x.FLOAT:case x.INT:case x.UNSIGNED_INT:return 4}}function J(t){const e=t.gl;switch(e.getError()){case e.NO_ERROR:return null;case e.INVALID_ENUM:return"An unacceptable value has been specified for an enumerated argument";case e.INVALID_VALUE:return"An unacceptable value has been specified for an argument";case e.INVALID_OPERATION:return"The specified command is not allowed for the current state";case e.INVALID_FRAMEBUFFER_OPERATION:return"The currently bound framebuffer is not framebuffer complete";case e.OUT_OF_MEMORY:return"Not enough memory is left to execute the command";case e.CONTEXT_LOST_WEBGL:return"WebGL context is lost"}return"Unknown error"}function le(t,e,r,a,s=0){var l;const c=t.gl;t.bindBuffer(r);for(const n of a){const o=e.get(n.name);if(o===void 0){console.warn(`There is no location for vertex attribute '${n.name}' defined.`);continue}const _=s*n.stride;if(n.count<=4)c.vertexAttribPointer(o,n.count,n.type,n.normalized,n.stride,n.offset+_),c.enableVertexAttribArray(o),n.divisor>0&&t.gl.vertexAttribDivisor(o,n.divisor);else if(n.count===9)for(let h=0;h<3;h++)c.vertexAttribPointer(o+h,3,n.type,n.normalized,n.stride,n.offset+12*h+_),c.enableVertexAttribArray(o+h),n.divisor>0&&t.gl.vertexAttribDivisor(o+h,n.divisor);else if(n.count===16)for(let h=0;h<4;h++)c.vertexAttribPointer(o+h,4,n.type,n.normalized,n.stride,n.offset+16*h+_),c.enableVertexAttribArray(o+h),n.divisor>0&&((l=t.gl)==null||l.vertexAttribDivisor(o+h,n.divisor));else console.error("Unsupported vertex attribute element count: "+n.count);if($()){const h=J(t),u=Z(n.type),p=n.offset,E=Math.round(u/p)!==u/p?`. Offset not a multiple of stride. DataType requires ${u} bytes, but descriptor has an offset of ${p}`:"";h&&console.error(`Unable to bind vertex attribute "${n.name}" with baseInstanceOffset ${_}${E}:`,h,n)}}}function Q(t){switch(t){case d.ALPHA:case d.LUMINANCE:case d.RED:case d.RED_INTEGER:case i.R8:case i.R8I:case i.R8UI:case i.R8_SNORM:case M.STENCIL_INDEX8:return 1;case d.LUMINANCE_ALPHA:case d.RG:case d.RG_INTEGER:case i.RGBA4:case i.R16F:case i.R16I:case i.R16UI:case i.RG8:case i.RG8I:case i.RG8UI:case i.RG8_SNORM:case i.RGB565:case i.RGB5_A1:case M.DEPTH_COMPONENT16:return 2;case d.DEPTH_COMPONENT:case d.RGB:case d.RGB_INTEGER:case i.RGB8:case i.RGB8I:case i.RGB8UI:case i.RGB8_SNORM:case i.SRGB8:case M.DEPTH_COMPONENT24:return 3;case d.DEPTH_STENCIL:case d.DEPTH24_STENCIL8:case d.RGBA:case d.RGBA_INTEGER:case i.RGBA8:case i.R32F:case i.R11F_G11F_B10F:case i.RG16F:case i.R32I:case i.R32UI:case i.RG16I:case i.RG16UI:case i.RGBA8I:case i.RGBA8UI:case i.RGBA8_SNORM:case i.SRGB8_ALPHA8:case i.RGB9_E5:case i.RGB10_A2UI:case i.RGB10_A2:case M.DEPTH_STENCIL:case M.DEPTH_COMPONENT32F:case M.DEPTH24_STENCIL8:return 4;case M.DEPTH32F_STENCIL8:return 5;case i.RGB16F:case i.RGB16I:case i.RGB16UI:return 6;case i.RG32F:case i.RG32I:case i.RG32UI:case i.RGBA16F:case i.RGBA16I:case i.RGBA16UI:return 8;case i.RGB32F:case i.RGB32I:case i.RGB32UI:return 12;case i.RGBA32F:case i.RGBA32I:case i.RGBA32UI:return 16;case T.COMPRESSED_RGB_S3TC_DXT1_EXT:case T.COMPRESSED_RGBA_S3TC_DXT1_EXT:return .5;case T.COMPRESSED_RGBA_S3TC_DXT3_EXT:case T.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case T.COMPRESSED_R11_EAC:case T.COMPRESSED_SIGNED_R11_EAC:case T.COMPRESSED_RGB8_ETC2:case T.COMPRESSED_SRGB8_ETC2:case T.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case T.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return .5;case T.COMPRESSED_RG11_EAC:case T.COMPRESSED_SIGNED_RG11_EAC:case T.COMPRESSED_RGBA8_ETC2_EAC:case T.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}class ee{constructor(e=0,r=e){this.width=e,this.height=r,this.target=I.TEXTURE_2D,this.pixelFormat=d.RGBA,this.dataType=G.UNSIGNED_BYTE,this.samplingMode=R.LINEAR,this.wrapMode=K.REPEAT,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.depth=1,this.isImmutable=!1}}function te(t){return t.width<=0||t.height<=0?0:Math.round(t.width*t.height*(t.hasMipmap?4/3:1)*(t.internalFormat==null?4:Q(t.internalFormat)))}class B extends ee{constructor(e,r){switch(super(),this.context=e,Object.assign(this,r),this.internalFormat){case i.R16F:case i.R16I:case i.R16UI:case i.R32F:case i.R32I:case i.R32UI:case i.R8_SNORM:case i.R8:case i.R8I:case i.R8UI:this.pixelFormat=d.RED}}static validate(e,r){return new B(e,r)}}const F=4;let re=class A{constructor(e,r=null,a=null){if(this.type=O.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,a=r;else{const s=B.validate(e,r);if(!s)throw new m("Texture descriptor invalid");this._descriptor=s}this._descriptor.target===I.TEXTURE_CUBE_MAP?this._setDataCubeMap(a):this.setData(a)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return te(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._glName&&this._descriptor.context.instanceCounter.decrement(C.Texture,this),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,r){const a=this._descriptor;if(a.width!==e||a.height!==r){if(this._wasImmutablyAllocated)throw new m("Immutable textures can't be resized!");a.width=e,a.height=r,this._descriptor.target===I.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let r=I.TEXTURE_CUBE_MAP_POSITIVE_X;r<=I.TEXTURE_CUBE_MAP_NEGATIVE_Z;r++)this._setData(e,r)}setData(e){this._setData(e)}_setData(e,r){var _;if(!((_=this._descriptor.context)!=null&&_.gl))return;const a=this._descriptor.context.gl;S(a),this._glName||(this._glName=a.createTexture(),this._glName&&this._descriptor.context.instanceCounter.increment(C.Texture,this)),e===void 0&&(e=null);const s=this._descriptor,c=r??s.target,l=P(c);e===null&&(s.width=s.width||F,s.height=s.height||F,l&&(s.depth=s.depth??1));const n=this._descriptor.context.bindTexture(this,A.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(A.TEXTURE_UNIT_FOR_UPDATES),w(s),this._configurePixelStorage(),S(a);const o=this._deriveInternalFormat();if(v(e)){let h="width"in e?e.width:e.codedWidth,u="height"in e?e.height:e.codedHeight;const p=1;e instanceof HTMLVideoElement&&(h=e.videoWidth,u=e.videoHeight),s.width&&s.height,l&&s.depth,s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(c,o,s.hasMipmap,h,u,p),this._texImage(c,0,o,h,u,p,e),S(a),s.hasMipmap&&this.generateMipmap(),s.width||(s.width=h),s.height||(s.height=u),l&&!s.depth&&(s.depth=p)}else{const{width:h,height:u,depth:p}=s;if(h==null||u==null)throw new m("Width and height must be specified!");if(l&&p==null)throw new m("Depth must be specified!");if(s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(c,o,s.hasMipmap,h,u,p),U(e)){const E=e.levels,N=X(c,h,u,p),f=Math.min(N-1,E.length-1);a.texParameteri(s.target,this._descriptor.context.gl.TEXTURE_MAX_LEVEL,f);const g=o;if(!ae(g))throw new m("Attempting to use compressed data with an uncompressed format!");this._forEachMipmapLevel((D,b,V,W)=>{const z=E[Math.min(D,E.length-1)];this._compressedTexImage(c,D,g,b,V,W,z)},f)}else this._texImage(c,0,o,h,u,p,e),S(a),s.hasMipmap&&this.generateMipmap()}L(a,this._descriptor),y(a,this._descriptor),se(this._descriptor.context,this._descriptor),S(a),this._descriptor.context.bindTexture(n,A.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,r,a,s,c,l,n=0){l||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const o=this._descriptor,_=this._deriveInternalFormat(),{context:h,pixelFormat:u,dataType:p,target:E,isImmutable:N}=o;if(N&&!this._wasImmutablyAllocated)throw new m("Cannot update immutable texture before allocation!");const f=h.bindTexture(this,A.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||a<0||s>o.width||c>o.height||r+s>o.width||a+c>o.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:g}=h;n&&g.pixelStorei(g.UNPACK_SKIP_ROWS,n),v(l)?g.texSubImage2D(E,e,r,a,s,c,u,p,l):U(l)?g.compressedTexSubImage2D(E,e,r,a,s,c,_,l.levels[e]):g.texSubImage2D(E,e,r,a,s,c,u,p,l),n&&g.pixelStorei(g.UNPACK_SKIP_ROWS,0),h.bindTexture(f,A.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,r,a,s,c,l,n,o){o||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const _=this._descriptor,h=this._deriveInternalFormat(),{context:u,pixelFormat:p,dataType:E,isImmutable:N,target:f}=_;if(N&&!this._wasImmutablyAllocated)throw new m("Cannot update immutable texture before allocation!");P(f)||console.warn("Attempting to set 3D texture data on a non-3D texture");const g=u.bindTexture(this,A.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(A.TEXTURE_UNIT_FOR_UPDATES),(r<0||a<0||s<0||c>_.width||l>_.height||n>_.depth||r+c>_.width||a+l>_.height||s+n>_.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:D}=u;if(U(o))o=o.levels[e],D.compressedTexSubImage3D(f,e,r,a,s,c,l,n,h,o);else{const b=o;D.texSubImage3D(f,e,r,a,s,c,l,n,p,E,b)}u.bindTexture(g,A.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new m("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,w(e)}e.samplingMode===R.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=R.LINEAR_MIPMAP_NEAREST):e.samplingMode===R.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=R.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,A.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(A.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(r,A.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,w(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._descriptor,r=e.context.gl;this._samplingModeDirty&&(L(r,e),this._samplingModeDirty=!1),this._wrapModeDirty&&(y(r,e),this._wrapModeDirty=!1)}_deriveInternalFormat(){if(this._descriptor.internalFormat!=null)return this._descriptor.internalFormat===d.DEPTH_STENCIL&&(this._descriptor.internalFormat=d.DEPTH24_STENCIL8),this._descriptor.internalFormat;switch(this._descriptor.dataType){case G.FLOAT:switch(this._descriptor.pixelFormat){case d.RGBA:return this._descriptor.internalFormat=i.RGBA32F;case d.RGB:return this._descriptor.internalFormat=i.RGB32F;default:throw new m("Unable to derive format")}case G.UNSIGNED_BYTE:switch(this._descriptor.pixelFormat){case d.RGBA:return this._descriptor.internalFormat=i.RGBA8;case d.RGB:return this._descriptor.internalFormat=i.RGB8}}return this._descriptor.internalFormat=this._descriptor.pixelFormat===d.DEPTH_STENCIL?d.DEPTH24_STENCIL8:this._descriptor.pixelFormat}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:r,flipped:a,preMultiplyAlpha:s}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,r),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,a?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s?1:0)}_texStorage(e,r,a,s,c,l){const{gl:n}=this._descriptor.context;if(!ie(r))throw new m("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const o=a?X(e,s,c,l):1;if(P(e)){if(l==null)throw new m("Missing depth dimension for 3D texture upload");n.texStorage3D(e,o,r,s,c,l)}else n.texStorage2D(e,o,r,s,c);this._wasImmutablyAllocated=!0}_texImage(e,r,a,s,c,l,n){const o=this._descriptor.context.gl,_=P(e),{isImmutable:h,pixelFormat:u,dataType:p}=this._descriptor;if(h){if(n!=null){const E=n;if(_){if(l==null)throw new m("Missing depth dimension for 3D texture upload");o.texSubImage3D(e,r,0,0,0,s,c,l,u,p,E)}else o.texSubImage2D(e,r,0,0,s,c,u,p,E)}}else{const E=n;if(_){if(l==null)throw new m("Missing depth dimension for 3D texture upload");o.texImage3D(e,r,a,s,c,l,0,u,p,E)}else o.texImage2D(e,r,a,s,c,0,u,p,E)}}_compressedTexImage(e,r,a,s,c,l,n){const o=this._descriptor.context.gl,_=P(e);if(this._descriptor.isImmutable){if(n!=null)if(_){if(l==null)throw new m("Missing depth dimension for 3D texture upload");o.compressedTexSubImage3D(e,r,0,0,0,s,c,l,a,n)}else o.compressedTexSubImage2D(e,r,0,0,s,c,a,n)}else if(_){if(l==null)throw new m("Missing depth dimension for 3D texture upload");o.compressedTexImage3D(e,r,a,s,c,l,0,n)}else o.compressedTexImage2D(e,r,a,s,c,0,n)}_forEachMipmapLevel(e,r=1/0){let{width:a,height:s,depth:c,hasMipmap:l,target:n}=this._descriptor;const o=n===I.TEXTURE_3D;if(a==null||s==null||o&&c==null)throw new m("Missing texture dimensions for mipmap calculation");for(let _=0;e(_,a,s,c),l&&(a!==1||s!==1||o&&c!==1)&&!(_>=r);++_)a=Math.max(1,a>>1),s=Math.max(1,s>>1),o&&(c=Math.max(1,c>>1))}};function w(t){(t.width!=null&&t.width<0||t.height!=null&&t.height<0||t.depth!=null&&t.depth<0)&&console.error("Negative dimension parameters are not allowed!")}function L(t,e){let r=e.samplingMode,a=e.samplingMode;r===R.LINEAR_MIPMAP_NEAREST||r===R.LINEAR_MIPMAP_LINEAR?(r=R.LINEAR,e.hasMipmap||(a=R.LINEAR)):r!==R.NEAREST_MIPMAP_NEAREST&&r!==R.NEAREST_MIPMAP_LINEAR||(r=R.NEAREST,e.hasMipmap||(a=R.NEAREST)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,a)}function y(t,e){typeof e.wrapMode=="number"?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}function se(t,e){const r=t.capabilities.textureFilterAnisotropic;r&&t.gl.texParameterf(e.target,r.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}function ie(t){return t in i}function ae(t){return t in T}function U(t){return t!=null&&"type"in t&&t.type==="compressed"}function ne(t){return t!=null&&"byteLength"in t}function v(t){return t!=null&&!U(t)&&!ne(t)}function P(t){return t===I.TEXTURE_3D||t===I.TEXTURE_2D_ARRAY}function X(t,e,r,a=1){let s=Math.max(e,r);return t===I.TEXTURE_3D&&(s=Math.max(s,a)),Math.round(Math.log(s)/Math.LN2)+1}re.TEXTURE_UNIT_FOR_UPDATES=0;export{le as E,Q as a,O as b,$ as c,ce as d,ee as e,re as m,J as o,Z as s,S as u}; +import{E as Y,N as m,s as k,g5 as x,ir as T,l as i,is as M,v as d,it as I,U as G,L as R,D as K,gf as C}from"./index-BjUNJPVf.js";const q=()=>k.getLogger("esri.views.webgl.checkWebGLError");function j(t,e){switch(e){case t.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case t.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case t.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case t.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case t.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case t.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const H=!!Y("enable-feature:webgl-debug");function $(){return H}function ce(){return H}function S(t){if($()){const e=t.getError();if(e){const r=j(t,e),a=new Error().stack;q().error(new m("webgl-error","WebGL error occurred",{message:r,stack:a}))}}}var O;(function(t){t[t.Texture=0]="Texture",t[t.RenderBuffer=1]="RenderBuffer"})(O||(O={}));function Z(t){switch(t){case x.BYTE:case x.UNSIGNED_BYTE:return 1;case x.SHORT:case x.UNSIGNED_SHORT:return 2;case x.FLOAT:case x.INT:case x.UNSIGNED_INT:return 4}}function J(t){const e=t.gl;switch(e.getError()){case e.NO_ERROR:return null;case e.INVALID_ENUM:return"An unacceptable value has been specified for an enumerated argument";case e.INVALID_VALUE:return"An unacceptable value has been specified for an argument";case e.INVALID_OPERATION:return"The specified command is not allowed for the current state";case e.INVALID_FRAMEBUFFER_OPERATION:return"The currently bound framebuffer is not framebuffer complete";case e.OUT_OF_MEMORY:return"Not enough memory is left to execute the command";case e.CONTEXT_LOST_WEBGL:return"WebGL context is lost"}return"Unknown error"}function le(t,e,r,a,s=0){var l;const c=t.gl;t.bindBuffer(r);for(const n of a){const o=e.get(n.name);if(o===void 0){console.warn(`There is no location for vertex attribute '${n.name}' defined.`);continue}const _=s*n.stride;if(n.count<=4)c.vertexAttribPointer(o,n.count,n.type,n.normalized,n.stride,n.offset+_),c.enableVertexAttribArray(o),n.divisor>0&&t.gl.vertexAttribDivisor(o,n.divisor);else if(n.count===9)for(let h=0;h<3;h++)c.vertexAttribPointer(o+h,3,n.type,n.normalized,n.stride,n.offset+12*h+_),c.enableVertexAttribArray(o+h),n.divisor>0&&t.gl.vertexAttribDivisor(o+h,n.divisor);else if(n.count===16)for(let h=0;h<4;h++)c.vertexAttribPointer(o+h,4,n.type,n.normalized,n.stride,n.offset+16*h+_),c.enableVertexAttribArray(o+h),n.divisor>0&&((l=t.gl)==null||l.vertexAttribDivisor(o+h,n.divisor));else console.error("Unsupported vertex attribute element count: "+n.count);if($()){const h=J(t),u=Z(n.type),p=n.offset,E=Math.round(u/p)!==u/p?`. Offset not a multiple of stride. DataType requires ${u} bytes, but descriptor has an offset of ${p}`:"";h&&console.error(`Unable to bind vertex attribute "${n.name}" with baseInstanceOffset ${_}${E}:`,h,n)}}}function Q(t){switch(t){case d.ALPHA:case d.LUMINANCE:case d.RED:case d.RED_INTEGER:case i.R8:case i.R8I:case i.R8UI:case i.R8_SNORM:case M.STENCIL_INDEX8:return 1;case d.LUMINANCE_ALPHA:case d.RG:case d.RG_INTEGER:case i.RGBA4:case i.R16F:case i.R16I:case i.R16UI:case i.RG8:case i.RG8I:case i.RG8UI:case i.RG8_SNORM:case i.RGB565:case i.RGB5_A1:case M.DEPTH_COMPONENT16:return 2;case d.DEPTH_COMPONENT:case d.RGB:case d.RGB_INTEGER:case i.RGB8:case i.RGB8I:case i.RGB8UI:case i.RGB8_SNORM:case i.SRGB8:case M.DEPTH_COMPONENT24:return 3;case d.DEPTH_STENCIL:case d.DEPTH24_STENCIL8:case d.RGBA:case d.RGBA_INTEGER:case i.RGBA8:case i.R32F:case i.R11F_G11F_B10F:case i.RG16F:case i.R32I:case i.R32UI:case i.RG16I:case i.RG16UI:case i.RGBA8I:case i.RGBA8UI:case i.RGBA8_SNORM:case i.SRGB8_ALPHA8:case i.RGB9_E5:case i.RGB10_A2UI:case i.RGB10_A2:case M.DEPTH_STENCIL:case M.DEPTH_COMPONENT32F:case M.DEPTH24_STENCIL8:return 4;case M.DEPTH32F_STENCIL8:return 5;case i.RGB16F:case i.RGB16I:case i.RGB16UI:return 6;case i.RG32F:case i.RG32I:case i.RG32UI:case i.RGBA16F:case i.RGBA16I:case i.RGBA16UI:return 8;case i.RGB32F:case i.RGB32I:case i.RGB32UI:return 12;case i.RGBA32F:case i.RGBA32I:case i.RGBA32UI:return 16;case T.COMPRESSED_RGB_S3TC_DXT1_EXT:case T.COMPRESSED_RGBA_S3TC_DXT1_EXT:return .5;case T.COMPRESSED_RGBA_S3TC_DXT3_EXT:case T.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case T.COMPRESSED_R11_EAC:case T.COMPRESSED_SIGNED_R11_EAC:case T.COMPRESSED_RGB8_ETC2:case T.COMPRESSED_SRGB8_ETC2:case T.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case T.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return .5;case T.COMPRESSED_RG11_EAC:case T.COMPRESSED_SIGNED_RG11_EAC:case T.COMPRESSED_RGBA8_ETC2_EAC:case T.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}class ee{constructor(e=0,r=e){this.width=e,this.height=r,this.target=I.TEXTURE_2D,this.pixelFormat=d.RGBA,this.dataType=G.UNSIGNED_BYTE,this.samplingMode=R.LINEAR,this.wrapMode=K.REPEAT,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.depth=1,this.isImmutable=!1}}function te(t){return t.width<=0||t.height<=0?0:Math.round(t.width*t.height*(t.hasMipmap?4/3:1)*(t.internalFormat==null?4:Q(t.internalFormat)))}class B extends ee{constructor(e,r){switch(super(),this.context=e,Object.assign(this,r),this.internalFormat){case i.R16F:case i.R16I:case i.R16UI:case i.R32F:case i.R32I:case i.R32UI:case i.R8_SNORM:case i.R8:case i.R8I:case i.R8UI:this.pixelFormat=d.RED}}static validate(e,r){return new B(e,r)}}const F=4;let re=class A{constructor(e,r=null,a=null){if(this.type=O.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,a=r;else{const s=B.validate(e,r);if(!s)throw new m("Texture descriptor invalid");this._descriptor=s}this._descriptor.target===I.TEXTURE_CUBE_MAP?this._setDataCubeMap(a):this.setData(a)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return te(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._glName&&this._descriptor.context.instanceCounter.decrement(C.Texture,this),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,r){const a=this._descriptor;if(a.width!==e||a.height!==r){if(this._wasImmutablyAllocated)throw new m("Immutable textures can't be resized!");a.width=e,a.height=r,this._descriptor.target===I.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let r=I.TEXTURE_CUBE_MAP_POSITIVE_X;r<=I.TEXTURE_CUBE_MAP_NEGATIVE_Z;r++)this._setData(e,r)}setData(e){this._setData(e)}_setData(e,r){var _;if(!((_=this._descriptor.context)!=null&&_.gl))return;const a=this._descriptor.context.gl;S(a),this._glName||(this._glName=a.createTexture(),this._glName&&this._descriptor.context.instanceCounter.increment(C.Texture,this)),e===void 0&&(e=null);const s=this._descriptor,c=r??s.target,l=P(c);e===null&&(s.width=s.width||F,s.height=s.height||F,l&&(s.depth=s.depth??1));const n=this._descriptor.context.bindTexture(this,A.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(A.TEXTURE_UNIT_FOR_UPDATES),w(s),this._configurePixelStorage(),S(a);const o=this._deriveInternalFormat();if(v(e)){let h="width"in e?e.width:e.codedWidth,u="height"in e?e.height:e.codedHeight;const p=1;e instanceof HTMLVideoElement&&(h=e.videoWidth,u=e.videoHeight),s.width&&s.height,l&&s.depth,s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(c,o,s.hasMipmap,h,u,p),this._texImage(c,0,o,h,u,p,e),S(a),s.hasMipmap&&this.generateMipmap(),s.width||(s.width=h),s.height||(s.height=u),l&&!s.depth&&(s.depth=p)}else{const{width:h,height:u,depth:p}=s;if(h==null||u==null)throw new m("Width and height must be specified!");if(l&&p==null)throw new m("Depth must be specified!");if(s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(c,o,s.hasMipmap,h,u,p),U(e)){const E=e.levels,N=X(c,h,u,p),f=Math.min(N-1,E.length-1);a.texParameteri(s.target,this._descriptor.context.gl.TEXTURE_MAX_LEVEL,f);const g=o;if(!ae(g))throw new m("Attempting to use compressed data with an uncompressed format!");this._forEachMipmapLevel((D,b,V,W)=>{const z=E[Math.min(D,E.length-1)];this._compressedTexImage(c,D,g,b,V,W,z)},f)}else this._texImage(c,0,o,h,u,p,e),S(a),s.hasMipmap&&this.generateMipmap()}L(a,this._descriptor),y(a,this._descriptor),se(this._descriptor.context,this._descriptor),S(a),this._descriptor.context.bindTexture(n,A.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,r,a,s,c,l,n=0){l||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const o=this._descriptor,_=this._deriveInternalFormat(),{context:h,pixelFormat:u,dataType:p,target:E,isImmutable:N}=o;if(N&&!this._wasImmutablyAllocated)throw new m("Cannot update immutable texture before allocation!");const f=h.bindTexture(this,A.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||a<0||s>o.width||c>o.height||r+s>o.width||a+c>o.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:g}=h;n&&g.pixelStorei(g.UNPACK_SKIP_ROWS,n),v(l)?g.texSubImage2D(E,e,r,a,s,c,u,p,l):U(l)?g.compressedTexSubImage2D(E,e,r,a,s,c,_,l.levels[e]):g.texSubImage2D(E,e,r,a,s,c,u,p,l),n&&g.pixelStorei(g.UNPACK_SKIP_ROWS,0),h.bindTexture(f,A.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,r,a,s,c,l,n,o){o||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const _=this._descriptor,h=this._deriveInternalFormat(),{context:u,pixelFormat:p,dataType:E,isImmutable:N,target:f}=_;if(N&&!this._wasImmutablyAllocated)throw new m("Cannot update immutable texture before allocation!");P(f)||console.warn("Attempting to set 3D texture data on a non-3D texture");const g=u.bindTexture(this,A.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(A.TEXTURE_UNIT_FOR_UPDATES),(r<0||a<0||s<0||c>_.width||l>_.height||n>_.depth||r+c>_.width||a+l>_.height||s+n>_.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:D}=u;if(U(o))o=o.levels[e],D.compressedTexSubImage3D(f,e,r,a,s,c,l,n,h,o);else{const b=o;D.texSubImage3D(f,e,r,a,s,c,l,n,p,E,b)}u.bindTexture(g,A.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new m("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,w(e)}e.samplingMode===R.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=R.LINEAR_MIPMAP_NEAREST):e.samplingMode===R.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=R.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,A.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(A.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(r,A.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,w(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._descriptor,r=e.context.gl;this._samplingModeDirty&&(L(r,e),this._samplingModeDirty=!1),this._wrapModeDirty&&(y(r,e),this._wrapModeDirty=!1)}_deriveInternalFormat(){if(this._descriptor.internalFormat!=null)return this._descriptor.internalFormat===d.DEPTH_STENCIL&&(this._descriptor.internalFormat=d.DEPTH24_STENCIL8),this._descriptor.internalFormat;switch(this._descriptor.dataType){case G.FLOAT:switch(this._descriptor.pixelFormat){case d.RGBA:return this._descriptor.internalFormat=i.RGBA32F;case d.RGB:return this._descriptor.internalFormat=i.RGB32F;default:throw new m("Unable to derive format")}case G.UNSIGNED_BYTE:switch(this._descriptor.pixelFormat){case d.RGBA:return this._descriptor.internalFormat=i.RGBA8;case d.RGB:return this._descriptor.internalFormat=i.RGB8}}return this._descriptor.internalFormat=this._descriptor.pixelFormat===d.DEPTH_STENCIL?d.DEPTH24_STENCIL8:this._descriptor.pixelFormat}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:r,flipped:a,preMultiplyAlpha:s}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,r),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,a?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s?1:0)}_texStorage(e,r,a,s,c,l){const{gl:n}=this._descriptor.context;if(!ie(r))throw new m("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const o=a?X(e,s,c,l):1;if(P(e)){if(l==null)throw new m("Missing depth dimension for 3D texture upload");n.texStorage3D(e,o,r,s,c,l)}else n.texStorage2D(e,o,r,s,c);this._wasImmutablyAllocated=!0}_texImage(e,r,a,s,c,l,n){const o=this._descriptor.context.gl,_=P(e),{isImmutable:h,pixelFormat:u,dataType:p}=this._descriptor;if(h){if(n!=null){const E=n;if(_){if(l==null)throw new m("Missing depth dimension for 3D texture upload");o.texSubImage3D(e,r,0,0,0,s,c,l,u,p,E)}else o.texSubImage2D(e,r,0,0,s,c,u,p,E)}}else{const E=n;if(_){if(l==null)throw new m("Missing depth dimension for 3D texture upload");o.texImage3D(e,r,a,s,c,l,0,u,p,E)}else o.texImage2D(e,r,a,s,c,0,u,p,E)}}_compressedTexImage(e,r,a,s,c,l,n){const o=this._descriptor.context.gl,_=P(e);if(this._descriptor.isImmutable){if(n!=null)if(_){if(l==null)throw new m("Missing depth dimension for 3D texture upload");o.compressedTexSubImage3D(e,r,0,0,0,s,c,l,a,n)}else o.compressedTexSubImage2D(e,r,0,0,s,c,a,n)}else if(_){if(l==null)throw new m("Missing depth dimension for 3D texture upload");o.compressedTexImage3D(e,r,a,s,c,l,0,n)}else o.compressedTexImage2D(e,r,a,s,c,0,n)}_forEachMipmapLevel(e,r=1/0){let{width:a,height:s,depth:c,hasMipmap:l,target:n}=this._descriptor;const o=n===I.TEXTURE_3D;if(a==null||s==null||o&&c==null)throw new m("Missing texture dimensions for mipmap calculation");for(let _=0;e(_,a,s,c),l&&(a!==1||s!==1||o&&c!==1)&&!(_>=r);++_)a=Math.max(1,a>>1),s=Math.max(1,s>>1),o&&(c=Math.max(1,c>>1))}};function w(t){(t.width!=null&&t.width<0||t.height!=null&&t.height<0||t.depth!=null&&t.depth<0)&&console.error("Negative dimension parameters are not allowed!")}function L(t,e){let r=e.samplingMode,a=e.samplingMode;r===R.LINEAR_MIPMAP_NEAREST||r===R.LINEAR_MIPMAP_LINEAR?(r=R.LINEAR,e.hasMipmap||(a=R.LINEAR)):r!==R.NEAREST_MIPMAP_NEAREST&&r!==R.NEAREST_MIPMAP_LINEAR||(r=R.NEAREST,e.hasMipmap||(a=R.NEAREST)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,a)}function y(t,e){typeof e.wrapMode=="number"?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}function se(t,e){const r=t.capabilities.textureFilterAnisotropic;r&&t.gl.texParameterf(e.target,r.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}function ie(t){return t in i}function ae(t){return t in T}function U(t){return t!=null&&"type"in t&&t.type==="compressed"}function ne(t){return t!=null&&"byteLength"in t}function v(t){return t!=null&&!U(t)&&!ne(t)}function P(t){return t===I.TEXTURE_3D||t===I.TEXTURE_2D_ARRAY}function X(t,e,r,a=1){let s=Math.max(e,r);return t===I.TEXTURE_3D&&(s=Math.max(s,a)),Math.round(Math.log(s)/Math.LN2)+1}re.TEXTURE_UNIT_FOR_UPDATES=0;export{le as E,Q as a,O as b,$ as c,ce as d,ee as e,re as m,J as o,Z as s,S as u}; diff --git a/assets/Theme-Bdh3gaKt.js b/assets/Theme-6HY29PEY.js similarity index 99% rename from assets/Theme-Bdh3gaKt.js rename to assets/Theme-6HY29PEY.js index f6bba2f..0006c4e 100644 --- a/assets/Theme-Bdh3gaKt.js +++ b/assets/Theme-6HY29PEY.js @@ -1 +1 @@ -import{ed as ee}from"./index-CEWggaxV.js";class f{constructor(e){Object.defineProperty(this,"_value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._value=e}get value(){return this._value/100}get percent(){return this._value}toString(){return this._value+"%"}interpolate(e,t){return e+this.value*(t-e)}static normalize(e,t,i){return e instanceof f?e:new f(t===i?0:100*Math.min(Math.max(1/(i-t)*(e-t),0),1))}}function ke(s){return new f(s)}ke(0);const Je=ke(100),qe=ke(50);function Oe(s){return Number(s)!==s}function Qe(s){return{}.toString.call(s)}function _e(s){if(s!=null&&!g(s)){let e=Number(s);return Oe(e)&&Ne(s)&&s!=""?_e(s.replace(/[^0-9.\-]+/g,"")):e}return s}function et(s){if(me(s))return new Date(s);if(g(s))return new Date(s);{let e=Number(s);return g(e)?new Date(e):new Date(s)}}function Wt(s){if(Oe(s))return"NaN";if(s===1/0)return"Infinity";if(s===-1/0)return"-Infinity";if(s===0&&1/s==-1/0)return"-0";let e=s<0;s=Math.abs(s);let t,i=/^([0-9]+)(?:\.([0-9]+))?(?:e[\+\-]([0-9]+))?$/.exec(""+s),r=i[1],a=i[2]||"";if(i[3]===void 0)t=a===""?r:r+"."+a;else{let n=+i[3];if(s<1)t="0."+je("0",n-1)+r+a;else{let o=n-a.length;t=o===0?r+a:o<0?r+a.slice(0,o)+"."+a.slice(o):r+a+je("0",o)}}return e?"-"+t:t}function je(s,e){return new Array(e+1).join(s)}function me(s){return Qe(s)==="[object Date]"}function Ne(s){return typeof s=="string"}function g(s){return typeof s=="number"&&Number(s)==s}function Re(s){return typeof s=="object"&&s!==null}const Ee="__§§§__",Vt="__§§§§__";function re(s,e){const t=s.length;for(let i=0;i0;)--t,e(s[t],t)}function Kt(s,e){const t=s.length;for(let i=0;i0;)if(--t,e(s[t],t))return t;return-1}function st(s,e){const t=We(s,e);if(t!==-1)return s[t]}function rt(s,e){const t=it(s,e);if(t!==-1)return s[t]}function at(s,e){let t=0,i=s.length,r=!1;for(;t>1,n=e(s[a]);n<0?t=a+1:n===0?(r=!0,t=a+1):i=a}return{found:r,index:r?t-1:t}}function nt(s,e){let t=0,i=s.length,r=!1;for(;t>1,n=e(s[a]);n<0?t=a+1:(n===0&&(r=!0),i=a)}return{found:r,index:t}}function Yt(s,e){let t=s.length;for(;t>0;)--t,e(s[t])||s.splice(t,1)}function T(s){return Object.keys(s)}function ot(s,e){return T(s).sort(e)}function Xt(s){return Object.assign({},s)}function y(s,e){T(s).forEach(t=>{e(t,s[t])})}function $t(s,e){for(let t in s)if(ht(s,t)&&!e(t,s[t]))break}function ht(s,e){return{}.hasOwnProperty.call(s,e)}class Ve{constructor(){Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposed=!1}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class P{constructor(e){Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dispose",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposed=!1,this._dispose=e}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class Zt extends Ve{constructor(){super(...arguments),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}_dispose(){_(this._disposers,e=>{e.dispose()})}}class k extends Ve{constructor(e){super(),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposers=e}_dispose(){_(this._disposers,e=>{e.dispose()})}get disposers(){return this._disposers}}class lt extends P{constructor(){super(...arguments),Object.defineProperty(this,"_counter",{enumerable:!0,configurable:!0,writable:!0,value:0})}increment(){return++this._counter,new P(()=>{--this._counter,this._counter===0&&this.dispose()})}}function Jt(s){s.parentNode&&s.parentNode.removeChild(s)}function Ue(s,e,t,i){return s.addEventListener(e,t,i||!1),new P(()=>{s.removeEventListener(e,t,i||!1)})}function qt(s){return Ue(window,"resize",e=>{s()})}function de(s){switch(s){case"touchevents":return window.hasOwnProperty("TouchEvent");case"pointerevents":return window.hasOwnProperty("PointerEvent");case"mouseevents":return window.hasOwnProperty("MouseEvent");case"wheelevents":return window.hasOwnProperty("WheelEvent");case"keyboardevents":return window.hasOwnProperty("KeyboardEvent")}return!1}function ue(s){return s.pointerId||0}function Qt(){if(document.activeElement&&document.activeElement!=document.body)if(document.activeElement.blur)document.activeElement.blur();else{let s=document.createElement("button");s.style.position="fixed",s.style.top="0px",s.style.left="-10000px",document.body.appendChild(s),s.focus(),s.blur(),document.body.removeChild(s)}}function ei(s){s&&s.focus()}function ti(s){if(de("pointerevents"))return s;if(de("touchevents"))switch(s){case"pointerover":case"pointerdown":return"touchstart";case"pointerout":case"pointerleave":case"pointerup":return"touchend";case"pointermove":return"touchmove";case"click":return"click";case"dblclick":return"dblclick"}else if(de("mouseevents"))switch(s){case"pointerover":return"mouseover";case"pointerout":return"mouseout";case"pointerleave":return"mouseleave";case"pointerdown":return"mousedown";case"pointermove":return"mousemove";case"pointerup":return"mouseup";case"click":return"click";case"dblclick":return"dblclick"}return s}function Me(s){if(typeof Touch<"u"&&s instanceof Touch)return!0;if(typeof PointerEvent<"u"&&s instanceof PointerEvent&&s.pointerType!=null)switch(s.pointerType){case"touch":case"pen":case 2:return!0;case"mouse":case 4:return!1;default:return!(s instanceof MouseEvent)}else if(s.type!=null&&s.type.match(/^mouse/))return!1;return!0}function ii(s,e,t){s.style[e]=t}function si(s,e){return s.style[e]}function ri(s){if(s.composedPath){const e=s.composedPath();return e.length===0?null:e[0]}return s.target}function dt(s,e){let t=e;for(;;){if(s===t)return!0;if(t.parentNode===null){if(t.host==null)return!1;t=t.host}else t=t.parentNode}}function ut(s,e){return s.target&&dt(e.root.dom,s.target)}function ai(s,e){s.style.pointerEvents=e?"auto":"none"}function pt(){return/apple/i.test(navigator.vendor)&&"ontouchend"in document}function ni(){return pt()?1:void 0}function M(s,e){return g(s)?s:s!=null&&g(s.value)&&g(e)?e*s.value:0}function oi(s){let e=(""+s).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return e?Math.max(0,(e[1]?e[1].length:0)-(e[2]?+e[2]:0)):0}function pe(s,e=0,t="0"){return typeof s!="string"&&(s=s.toString()),e>s.length?Array(e-s.length+1).join(t)+s:s}function ct(s){return s.replace(/^[\s]*/,"")}function gt(s){return s.replace(/[\s]*$/,"")}function be(s){return ct(gt(s))}function _t(s,e,t=!1,i="..."){if(s.length>e){let r=e-1;for(;r>=0&&s.charAt(r).match(/\w/);)r--;return r>=0&&t==0?s.substring(0,r+1)+"...":s.substring(0,e)+i}return s}function mt(s){if(s===void 0)return"string";let e=(s=(s=(s=s.toLowerCase().replace(/^\[[^\]]*\]/,"")).replace(/\[[^\]]+\]/,"")).trim()).match(/\/(date|number|duration)$/);return e?e[1]:s==="number"?"number":s==="date"?"date":s==="duration"?"duration":s.match(/[#0]/)?"number":s.match(/[ymwdhnsqaxkzgtei]/)?"date":"string"}function hi(s){return s.replace(/\/(date|number|duration)$/i,"")}function li(s){return s&&s.replace(/<[^>]*>/g,"")}function di(s){return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function ui(s,e=!1){const t=new Date(s.getFullYear(),0,0),i=s.getTime()-t.getTime()+60*(t.getTimezoneOffset()-s.getTimezoneOffset())*1e3;return Math.floor(i/864e5)}function Be(s,e=!1){const t=new Date(Date.UTC(s.getFullYear(),s.getMonth(),s.getDate())),i=t.getUTCDay()||7;t.setUTCDate(t.getUTCDate()+4-i);const r=new Date(Date.UTC(t.getUTCFullYear(),0,1));return Math.ceil(((t.getTime()-r.getTime())/864e5+1)/7)}function pi(s,e=!1){const t=new Date(Date.UTC(s.getFullYear(),s.getMonth(),s.getDate())),i=t.getUTCDay()||7;return t.setUTCDate(t.getUTCDate()+4-i),new Date(Date.UTC(t.getUTCFullYear(),0,1)).getFullYear()}function ci(s,e=!1){const t=Be(new Date(s.getFullYear(),s.getMonth(),1),e);let i=Be(s,e);return i==1&&(i=53),i-t+1}function gi(s,e,t=1,i=!1){let r=new Date(e,0,4,0,0,0,0);return i&&r.setUTCFullYear(e),7*s+t-((r.getDay()||7)+3)}function _i(s,e){return s>12?s-=12:s===0&&(s=12),e!=null?s+(e-1):s}function mi(s,e=!1,t=!1,i=!1,r){if(i)return e?"Coordinated Universal Time":"UTC";if(r){const o=s.toLocaleString("en-US",{timeZone:r});return be(s.toLocaleString("en-US",{timeZone:r,timeZoneName:e?"long":"short"}).substr(o.length))}let a=s.toLocaleString("UTC"),n=s.toLocaleString("UTC",{timeZoneName:e?"long":"short"}).substr(a.length);return t===!1&&(n=n.replace(/ (standard|daylight|summer|winter) /i," ")),be(n)}function fi(s){const e=new Date(Date.UTC(2012,0,1,0,0,0,0)),t=new Date(e.toLocaleString("en-US",{timeZone:"UTC"}));return(new Date(e.toLocaleString("en-US",{timeZone:s})).getTime()-t.getTime())/6e4*-1}function bi(s){return s.charAt(0).toUpperCase()+s.slice(1)}function Ke(s){let e,t,i,r=s.h,a=s.s,n=s.l;if(a==0)e=t=i=n;else{let o=function(d,p,u){return u<0&&(u+=1),u>1&&(u-=1),u<.16666666666666666?d+6*(p-d)*u:u<.5?p:u<.6666666666666666?d+(p-d)*(.6666666666666666-u)*6:d},h=n<.5?n*(1+a):n+a-n*a,l=2*n-h;e=o(l,h,r+1/3),t=o(l,h,r),i=o(l,h,r-1/3)}return{r:Math.round(255*e),g:Math.round(255*t),b:Math.round(255*i)}}function Ge(s){let e=s.r/255,t=s.g/255,i=s.b/255,r=Math.max(e,t,i),a=Math.min(e,t,i),n=0,o=0,h=(r+a)/2;if(r===a)n=o=0;else{let l=r-a;switch(o=h>.5?l/(2-r-a):l/(r+a),r){case e:n=(t-i)/l+(t0?255-s:s;return Math.round(t*e)}function bt(s,e){if(s){let t=ie(Math.min(Math.max(s.r,s.g,s.b),230),e);return{r:Math.max(0,Math.min(255,Math.round(s.r+t))),g:Math.max(0,Math.min(255,Math.round(s.g+t))),b:Math.max(0,Math.min(255,Math.round(s.b+t))),a:s.a}}return s}function Ae(s){return(299*s.r+587*s.g+114*s.b)/1e3>=128}function vt(s,e){if(s===void 0||e==1)return s;let t=Ge(s);return t.s=e,Ke(t)}function yt(s,e={r:255,g:255,b:255},t={r:255,g:255,b:255}){let i=e,r=t;return Ae(t)&&(i=t,r=e),Ae(s)?r:i}function vi(s,e){return s||(s=[]),[...s,...e].filter((t,i,r)=>r.indexOf(t)===i)}function yi(s,e){return!!e&&s.left==e.left&&s.right==e.right&&s.top==e.top&&s.bottom==e.bottom}function ze(s){return s[0]==="#"&&(s=s.substr(1)),s.length==3&&(s=s[0].repeat(2)+s[1].repeat(2)+s[2].repeat(2)),parseInt(s,16)}function wt(s){let e=(s=s.replace(/[ ]/g,"")).match(/^rgb\(([0-9]*),([0-9]*),([0-9]*)\)/i);if(e)e.push("1");else if(e=s.match(/^rgba\(([0-9]*),([0-9]*),([0-9]*),([.0-9]*)\)/i),!e)return 0;let t="";for(let i=1;i<=3;i++){let r=parseInt(e[i]).toString(16);r.length==1&&(r="0"+r),t+=r}return ze(t)}function wi(s){return v.fromAny(s)}class v{constructor(e){Object.defineProperty(this,"_hex",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hex=0|e}get hex(){return this._hex}get r(){return this._hex>>>16}get g(){return this._hex>>8&255}get b(){return 255&this._hex}toCSS(e=1){return"rgba("+this.r+", "+this.g+", "+this.b+", "+e+")"}toCSSHex(){return"#"+pe(this.r.toString(16),2)+pe(this.g.toString(16),2)+pe(this.b.toString(16),2)}toHSL(e=1){return Ge({r:this.r,g:this.g,b:this.b,a:e})}static fromHSL(e,t,i){const r=Ke({h:e,s:t,l:i});return this.fromRGB(r.r,r.g,r.b)}toString(){return this.toCSSHex()}static fromHex(e){return new v(e)}static fromRGB(e,t,i){return new v((0|i)+(t<<8)+(e<<16))}static fromString(e){return new v(ze(e))}static fromCSS(e){return new v(wt(e))}static fromAny(e){if(Ne(e)){if(e[0]=="#")return v.fromString(e);if(e.substr(0,3)=="rgb")return v.fromCSS(e)}else{if(g(e))return v.fromHex(e);if(e instanceof v)return v.fromHex(e.hex)}throw new Error("Unknown color syntax: "+e)}static alternative(e,t,i){const r=yt({r:e.r,g:e.g,b:e.b},t?{r:t.r,g:t.g,b:t.b}:void 0,i?{r:i.r,g:i.g,b:i.b}:void 0);return this.fromRGB(r.r,r.g,r.b)}static interpolate(e,t,i,r="rgb"){if(r=="hsl"){const a=t.toHSL(),n=i.toHSL();return v.fromHSL(B(e,a.h,n.h),B(e,a.s,n.s),B(e,a.l,n.l))}return v.fromRGB(B(e,t.r,i.r),B(e,t.g,i.g),B(e,t.b,i.b))}static lighten(e,t){const i=ft({r:e.r,g:e.g,b:e.b},t);return v.fromRGB(i.r,i.g,i.b)}static brighten(e,t){const i=bt({r:e.r,g:e.g,b:e.b},t);return v.fromRGB(i.r,i.g,i.b)}static saturate(e,t){const i=vt({r:e.r,g:e.g,b:e.b},t);return v.fromRGB(i.r,i.g,i.b)}}class q{constructor(){Object.defineProperty(this,"_listeners",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_killed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_iterating",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_enabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._listeners=[],this._killed=[],this._disabled={},this._iterating=0,this._enabled=!0,this._disposed=!1}isDisposed(){return this._disposed}dispose(){if(!this._disposed){this._disposed=!0;const e=this._listeners;this._iterating=1,this._listeners=null,this._disabled=null;try{_(e,t=>{t.disposer.dispose()})}finally{this._killed=null,this._iterating=null}}}hasListeners(){return this._listeners.length!==0}hasListenersByType(e){return tt(this._listeners,t=>(t.type===null||t.type===e)&&!t.killed)}enable(){this._enabled=!0}disable(){this._enabled=!1}enableType(e){delete this._disabled[e]}disableType(e,t=1/0){this._disabled[e]=t}_removeListener(e){if(this._iterating===0){const t=this._listeners.indexOf(e);if(t===-1)throw new Error("Invalid state: could not remove listener");this._listeners.splice(t,1)}else this._killed.push(e)}_removeExistingListener(e,t,i,r){if(this._disposed)throw new Error("EventDispatcher is disposed");this._eachListener(a=>{a.once!==e||a.type!==t||i!==void 0&&a.callback!==i||a.context!==r||a.disposer.dispose()})}isEnabled(e){if(this._disposed)throw new Error("EventDispatcher is disposed");return this._enabled&&this._listeners.length>0&&this.hasListenersByType(e)&&this._disabled[e]===void 0}removeType(e){if(this._disposed)throw new Error("EventDispatcher is disposed");this._eachListener(t=>{t.type===e&&t.disposer.dispose()})}has(e,t,i){return We(this._listeners,r=>r.once!==!0&&r.type===e&&(t===void 0||r.callback===t)&&r.context===i)!==-1}_shouldDispatch(e){if(this._disposed)throw new Error("EventDispatcher is disposed");const t=this._disabled[e];return g(t)?(t<=1?delete this._disabled[e]:--this._disabled[e],!1):this._enabled}_eachListener(e){++this._iterating;try{_(this._listeners,e)}finally{--this._iterating,this._iterating===0&&this._killed.length!==0&&(_(this._killed,t=>{this._removeListener(t)}),this._killed.length=0)}}dispatch(e,t){this._shouldDispatch(e)&&this._eachListener(i=>{i.killed||i.type!==null&&i.type!==e||i.dispatch(e,t)})}_on(e,t,i,r,a,n){if(this._disposed)throw new Error("EventDispatcher is disposed");this._removeExistingListener(e,t,i,r);const o={type:t,callback:i,context:r,shouldClone:a,dispatch:n,killed:!1,once:e,disposer:new P(()=>{o.killed=!0,this._removeListener(o)})};return this._listeners.push(o),o}onAll(e,t,i=!0){return this._on(!1,null,e,t,i,(r,a)=>e.call(t,a)).disposer}on(e,t,i,r=!0){return this._on(!1,e,t,i,r,(a,n)=>t.call(i,n)).disposer}once(e,t,i,r=!0){const a=this._on(!0,e,t,i,r,(n,o)=>{a.disposer.dispose(),t.call(i,o)});return a.disposer}off(e,t,i){this._removeExistingListener(!1,e,t,i)}copyFrom(e){if(this._disposed)throw new Error("EventDispatcher is disposed");if(e===this)throw new Error("Cannot copyFrom the same TargetedEventDispatcher");const t=[];return _(e._listeners,i=>{!i.killed&&i.shouldClone&&(i.type===null?t.push(this.onAll(i.callback,i.context)):i.once?t.push(this.once(i.type,i.callback,i.context)):t.push(this.on(i.type,i.callback,i.context)))}),new k(t)}}function He(s){return ee(this,void 0,void 0,function*(){if(s!==void 0){const e=[];y(s,(t,i)=>{e.push(i.waitForStop())}),yield Promise.all(e)}})}function B(s,e,t){return e+s*(t-e)}function Pt(s,e,t){return s>=1?t:e}function Dt(s,e,t){return new f(B(s,e.percent,t.percent))}function xt(s,e,t){return v.interpolate(s,e,t)}function kt(s,e){return typeof s=="number"&&typeof e=="number"?B:s instanceof f&&e instanceof f?Dt:s instanceof v&&e instanceof v?xt:Pt}var U;function W(s,e){if(!(s>=0&&s=0&&e{this.push(t)})}copyFrom(e){this.pushAll(e._values)}pop(){return this._values.length-1<0?void 0:this.removeIndex(this._values.length-1)}shift(){return this._values.length?this.removeIndex(0):void 0}setAll(e){const t=this._values;this._values=[],this._onClear(t),_(e,i=>{this._values.push(i),this._onPush(i)})}clear(){this.setAll([])}*[Symbol.iterator](){const e=this._values.length;for(let t=0;t{t.dispose()}),super._onClear(e)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this.autoDispose&&_(this._values,e=>{e.dispose()}))}}class Pi extends Ot{constructor(e,t){super(),Object.defineProperty(this,"template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"make",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.template=e,this.make=t}}class Tt extends Ye{constructor(e){super(),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_events",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._container=e,this._events=this.events.onAll(t=>{if(t.type==="clear")_(t.oldValues,i=>{this._onRemoved(i)});else if(t.type==="push")this._onInserted(t.newValue);else if(t.type==="setIndex")this._onRemoved(t.oldValue),this._onInserted(t.newValue,t.index);else if(t.type==="insertIndex")this._onInserted(t.newValue,t.index);else if(t.type==="removeIndex")this._onRemoved(t.oldValue);else{if(t.type!=="moveIndex")throw new Error("Unknown IListEvent type");this._onRemoved(t.value),this._onInserted(t.value,t.newIndex)}})}_onInserted(e,t){e._setParent(this._container,!0);const i=this._container._childrenDisplay;t===void 0?i.addChild(e._display):i.addChildAt(e._display,t)}_onRemoved(e){this._container._childrenDisplay.removeChild(e._display),this._container.markDirtyBounds(),this._container.markDirty()}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._events.dispose(),_(this.values,e=>{e.dispose()}))}}const Xe=Math.PI,$e=Xe/180,Di=180/Xe;function xi(s,e,t){if(!g(e)||e<=0){let i=Math.round(s);return t&&i-s==.5&&i--,i}{let i=Math.pow(10,e);return Math.round(s*i)/i}}function ki(s,e){if(!g(e)||e<=0)return Math.ceil(s);{let t=Math.pow(10,e);return Math.ceil(s*t)/t}}function Ie(s,e,t){return Math.min(Math.max(s,e),t)}function ve(s){return Math.sin($e*s)}function ye(s){return Math.cos($e*s)}function Oi(s){return(s%=360)<0&&(s+=360),s}function Ti(s,e,t,i,r){let a=Number.MAX_VALUE,n=Number.MAX_VALUE,o=-Number.MAX_VALUE,h=-Number.MAX_VALUE,l=[];l.push(ce(r,t)),l.push(ce(r,i));let d=Math.min(90*Math.floor(t/90),90*Math.floor(i/90)),p=Math.max(90*Math.ceil(t/90),90*Math.ceil(i/90));for(let u=d;u<=p;u+=90)u>=t&&u<=i&&l.push(ce(r,u));for(let u=0;uo&&(o=c.x),c.y>h&&(h=c.y)}return{left:s+a,top:e+n,right:s+o,bottom:e+h}}function ce(s,e){return{x:s*ye(e),y:s*ve(e)}}function Si(s){const e=s.length;if(e>0){let t=s[0],i=t.left,r=t.top,a=t.right,n=t.bottom;if(e>1)for(let o=1;o=e.left&&s.y>=e.top&&s.x<=e.right&&s.y<=e.bottom}function Le(s){return s}function jt(s){return s*s*s}function ji(s){return function(e){return 1-s(1-e)}}class Et{constructor(e,t){Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._entity=e,this._settings=t,y(t,i=>{this._userSettings[i]=!0})}get(e,t){const i=this._settings[e];return i!==void 0?i:t}setRaw(e,t){this._settings[e]=t}set(e,t){this._userSettings[e]=!0,this.setRaw(e,t)}remove(e){delete this._userSettings[e],delete this._settings[e]}setAll(e){T(e).forEach(t=>{this.set(t,e[t])})}_eachSetting(e){y(this._settings,e)}apply(){const e={stateAnimationEasing:!0,stateAnimationDuration:!0},t=this._entity.states.lookup("default");this._eachSetting((i,r)=>{e[i]||(e[i]=!0,this!==t&&(i in t._settings||(t._settings[i]=this._entity.get(i))),this._entity.set(i,r))})}applyAnimate(e){e==null&&(e=this._settings.stateAnimationDuration),e==null&&(e=this.get("stateAnimationDuration",this._entity.get("stateAnimationDuration",0)));let t=this._settings.stateAnimationEasing;t==null&&(t=this.get("stateAnimationEasing",this._entity.get("stateAnimationEasing",jt)));const i=this._entity.states.lookup("default"),r={stateAnimationEasing:!0,stateAnimationDuration:!0},a={};return this._eachSetting((n,o)=>{if(!r[n]){r[n]=!0,this!=i&&(n in i._settings||(i._settings[n]=this._entity.get(n)));const h=this._entity.animate({key:n,to:o,duration:e,easing:t});h&&(a[n]=h)}}),a}}class Ct{constructor(e){Object.defineProperty(this,"_states",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._entity=e}lookup(e){return this._states[e]}create(e,t){const i=this._states[e];if(i)return i.setAll(t),i;{const r=new Et(this._entity,t);return this._states[e]=r,r}}remove(e){delete this._states[e]}apply(e){const t=this._states[e];t&&t.apply(),this._entity._applyState(e)}applyAnimate(e,t){let i;const r=this._states[e];return r&&(i=r.applyAnimate(t)),this._entity._applyStateAnimated(e,t),i}}class Mt{constructor(){Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.8.0"}),Object.defineProperty(this,"licenses",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"entitiesById",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"rootElements",{enumerable:!0,configurable:!0,writable:!0,value:[]})}}const R=new Mt;function Ei(s){R.licenses.push(s)}function F(s,e){return s===e?0:s{O(i,t)&&this._entity._markDirtyKey(e)})}remove(e){const t=this._callbacks[e];t!==void 0&&(delete this._callbacks[e],t.length!==0&&this._entity._markDirtyKey(e))}enable(e){this._disabled[e]&&(delete this._disabled[e],this._entity._markDirtyKey(e))}disable(e){this._disabled[e]||(this._disabled[e]=!0,this._entity._markDirtyKey(e))}fold(e,t){if(!this._disabled[e]){const i=this._callbacks[e];if(i!==void 0)for(let r=0,a=i.length;r{if(this._stopped)e();else{const i=()=>{r.dispose(),e()},r=this.events.on("stopped",i)}})}_checkEnded(){return!(this._loops>1)||(--this._loops,!1)}_run(e){this._oldTime!==null&&(this._time+=e-this._oldTime,this._time>this._duration&&(this._time=this._duration)),this._oldTime=e}_reset(e){this._oldTime=e,this._time=0}_value(e){return this._interpolate(this._easing(e),this._from,this._to)}}let At=0;class Ht{constructor(e){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:++At}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_privateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_settingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_privateSettingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_prevSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_prevPrivateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_animatingSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_animatingPrivateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_userProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._settings=e}_checkDirty(){T(this._settings).forEach(e=>{this._userProperties[e]=!0,this._markDirtyKey(e)})}resetUserSettings(){this._userProperties={}}_runAnimation(e){let t=U.Stopped;if(!this.isDisposed()){let i=!1,r=!1;y(this._animatingSettings,(a,n)=>{if(n.stopped)this._stopAnimation(a);else if(n.playing){n._run(e);const o=n.percentage;o>=1?n._checkEnded()?this.set(a,n._value(1)):(i=!0,n._reset(e),this._set(a,n._value(1))):(i=!0,this._set(a,n._value(o)))}else r=!0}),y(this._animatingPrivateSettings,(a,n)=>{if(n.stopped)this._stopAnimationPrivate(a);else if(n.playing){n._run(e);const o=n.percentage;o>=1?n._checkEnded()?this.setPrivate(a,n._value(1)):(i=!0,n._reset(e),this._setPrivate(a,n._value(1))):(i=!0,this._setPrivate(a,n._value(o)))}else r=!0}),i?t=U.Playing:r&&(t=U.Paused)}return t}_markDirtyKey(e){this.markDirty()}_markDirtyPrivateKey(e){this.markDirty()}on(e,t){let i=this._settingEvents[e];return i===void 0&&(i=this._settingEvents[e]=[]),i.push(t),new P(()=>{O(i,t),i.length===0&&delete this._settingEvents[e]})}onPrivate(e,t){let i=this._privateSettingEvents[e];return i===void 0&&(i=this._privateSettingEvents[e]=[]),i.push(t),new P(()=>{O(i,t),i.length===0&&delete this._privateSettingEvents[e]})}getRaw(e,t){const i=this._settings[e];return i!==void 0?i:t}get(e,t){return this.getRaw(e,t)}_sendKeyEvent(e,t){const i=this._settingEvents[e];i!==void 0&&_(i,r=>{r(t,this,e)})}_sendPrivateKeyEvent(e,t){const i=this._privateSettingEvents[e];i!==void 0&&_(i,r=>{r(t,this,e)})}_setRaw(e,t,i){this._prevSettings[e]=t,this._sendKeyEvent(e,i)}setRaw(e,t){const i=this._settings[e];this._settings[e]=t,i!==t&&this._setRaw(e,i,t)}_set(e,t){const i=this._settings[e];this._settings[e]=t,i!==t&&(this._setRaw(e,i,t),this._markDirtyKey(e))}_stopAnimation(e){const t=this._animatingSettings[e];t&&(delete this._animatingSettings[e],t.stop())}set(e,t){return this._set(e,t),this._stopAnimation(e),t}remove(e){e in this._settings&&(this._prevSettings[e]=this._settings[e],delete this._settings[e],this._sendKeyEvent(e,void 0),this._markDirtyKey(e)),this._stopAnimation(e)}removeAll(){_(T(this._settings),e=>{this.remove(e)})}getPrivate(e,t){const i=this._privateSettings[e];return i!==void 0?i:t}_setPrivateRaw(e,t,i){this._prevPrivateSettings[e]=t,this._sendPrivateKeyEvent(e,i)}setPrivateRaw(e,t){const i=this._privateSettings[e];this._privateSettings[e]=t,i!==t&&this._setPrivateRaw(e,i,t)}_setPrivate(e,t){const i=this._privateSettings[e];this._privateSettings[e]=t,i!==t&&(this._setPrivateRaw(e,i,t),this._markDirtyPrivateKey(e))}_stopAnimationPrivate(e){const t=this._animatingPrivateSettings[e];t&&(t.stop(),delete this._animatingPrivateSettings[e])}setPrivate(e,t){return this._setPrivate(e,t),this._stopAnimationPrivate(e),t}removePrivate(e){e in this._privateSettings&&(this._prevPrivateSettings[e]=this._privateSettings[e],delete this._privateSettings[e],this._markDirtyPrivateKey(e)),this._stopAnimationPrivate(e)}setAll(e){y(e,(t,i)=>{this.set(t,i)})}animate(e){const t=e.key,i=e.to,r=e.duration||0,a=e.loops||1,n=e.from===void 0?this.get(t):e.from,o=e.easing===void 0?Le:e.easing;if(r===0)this.set(t,i);else{if(n!==void 0&&n!==i){this.set(t,n);const l=this._animatingSettings[t]=new Q(this,n,i,r,o,a,this._animationTime());return this._startAnimation(),l}this.set(t,i)}const h=new Q(this,n,i,r,o,a,null);return h.stop(),h}animatePrivate(e){const t=e.key,i=e.to,r=e.duration||0,a=e.loops||1,n=e.from===void 0?this.getPrivate(t):e.from,o=e.easing===void 0?Le:e.easing;if(r===0)this.setPrivate(t,i);else{if(n!==void 0&&n!==i){this.setPrivate(t,n);const l=this._animatingPrivateSettings[t]=new Q(this,n,i,r,o,a,this._animationTime());return this._startAnimation(),l}this.setPrivate(t,i)}const h=new Q(this,n,i,r,o,a,null);return h.stop(),h}_dispose(){}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class A extends Ht{constructor(e,t,i,r=[]){if(super(t),Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_user_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"states",{enumerable:!0,configurable:!0,writable:!0,value:new Ct(this)}),Object.defineProperty(this,"adapters",{enumerable:!0,configurable:!0,writable:!0,value:new Bt(this)}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:this._createEvents()}),Object.defineProperty(this,"_userPrivateProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirty",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyPrivate",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_templates",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_internalTemplates",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_defaultThemes",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_templateDisposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_runSetup",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_disposerProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),!i)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this._root=e,this._internalTemplates=r,t.id&&this._registerId(t.id)}static new(e,t,i){const r=new this(e,t,!0);return r._template=i,r._afterNew(),r}static _new(e,t,i=[]){const r=new this(e,t,!0,i);return r._afterNew(),r}_afterNew(){this._checkDirty();let e=!1;const t=this._template;t&&(e=!0,t._setObjectTemplate(this)),_(this._internalTemplates,i=>{e=!0,i._setObjectTemplate(this)}),e&&this._applyTemplates(!1),this.states.create("default",{}),this._setDefaults()}_afterNewApplyThemes(){this._checkDirty();const e=this._template;e&&e._setObjectTemplate(this),_(this._internalTemplates,t=>{t._setObjectTemplate(this)}),this.states.create("default",{}),this._setDefaults(),this._applyThemes()}_createEvents(){return new q}get classNames(){return this.constructor.classNames}get className(){return this.constructor.className}_setDefaults(){}_setDefault(e,t){e in this._settings||super.set(e,t)}_setRawDefault(e,t){e in this._settings||super.setRaw(e,t)}_clearDirty(){T(this._dirty).forEach(e=>{this._dirty[e]=!1}),T(this._dirtyPrivate).forEach(e=>{this._dirtyPrivate[e]=!1})}isDirty(e){return!!this._dirty[e]}isPrivateDirty(e){return!!this._dirtyPrivate[e]}_markDirtyKey(e){this._dirty[e]=!0,super._markDirtyKey(e)}_markDirtyPrivateKey(e){this._dirtyPrivate[e]=!0,super._markDirtyKey(e)}isType(e){return this.classNames.indexOf(e)!==-1}_pushPropertyDisposer(e,t){let i=this._disposerProperties[e];return i===void 0&&(i=this._disposerProperties[e]=[]),i.push(t),t}_disposeProperty(e){const t=this._disposerProperties[e];t!==void 0&&(_(t,i=>{i.dispose()}),delete this._disposerProperties[e])}set template(e){const t=this._template;t!==e&&(this._template=e,t&&t._removeObjectTemplate(this),e&&e._setObjectTemplate(this),this._applyTemplates())}get template(){return this._template}markDirty(){this._root._addDirtyEntity(this)}_startAnimation(){this._root._addAnimation(this)}_animationTime(){return this._root.animationTime}_applyState(e){}_applyStateAnimated(e,t){}get(e,t){const i=this.adapters.fold(e,this._settings[e]);return i!==void 0?i:t}isUserSetting(e){return this._userProperties[e]||!1}set(e,t){return this._userProperties[e]=!0,super.set(e,t)}setRaw(e,t){this._userProperties[e]=!0,super.setRaw(e,t)}_setSoft(e,t){return this._userProperties[e]?t:super.set(e,t)}remove(e){delete this._userProperties[e],this._removeTemplateProperty(e)}setPrivate(e,t){return this._userPrivateProperties[e]=!0,super.setPrivate(e,t)}setPrivateRaw(e,t){this._userPrivateProperties[e]=!0,super.setPrivateRaw(e,t)}removePrivate(e){delete this._userPrivateProperties[e],this._removeTemplatePrivateProperty(e)}_setTemplateProperty(e,t,i){this._userProperties[t]||e===this._findTemplateByKey(t)&&super.set(t,i)}_setTemplatePrivateProperty(e,t,i){this._userPrivateProperties[t]||e===this._findTemplateByPrivateKey(t)&&super.setPrivate(t,i)}_removeTemplateProperty(e){if(!this._userProperties[e]){const t=this._findTemplateByKey(e);t?super.set(e,t._settings[e]):super.remove(e)}}_removeTemplatePrivateProperty(e){if(!this._userPrivateProperties[e]){const t=this._findTemplateByPrivateKey(e);t?super.setPrivate(e,t._privateSettings[e]):super.removePrivate(e)}}_walkParents(e){e(this._root._rootContainer),e(this)}_applyStateByKey(e){const t=this.states.create(e,{}),i={};this._eachTemplate(r=>{const a=r.states.lookup(e);a&&a._apply(t,i)}),y(t._settings,r=>{i[r]||t._userSettings[r]||t.remove(r)})}_applyTemplate(e,t){this._templateDisposers.push(e._apply(this,t)),y(e._settings,(i,r)=>{t.settings[i]||this._userProperties[i]||(t.settings[i]=!0,super.set(i,r))}),y(e._privateSettings,(i,r)=>{t.privateSettings[i]||this._userPrivateProperties[i]||(t.privateSettings[i]=!0,super.setPrivate(i,r))}),this._runSetup&&e.setup&&(this._runSetup=!1,e.setup(this))}_findStaticTemplate(e){if(this._template&&e(this._template))return this._template}_eachTemplate(e){this._findStaticTemplate(t=>(e(t),!1)),V(this._internalTemplates,e),_(this._templates,e)}_applyTemplates(e=!0){e&&this._disposeTemplates();const t={settings:{},privateSettings:{},states:{}};this._eachTemplate(i=>{this._applyTemplate(i,t)}),e&&(y(this._settings,i=>{this._userProperties[i]||t.settings[i]||super.remove(i)}),y(this._privateSettings,i=>{this._userPrivateProperties[i]||t.privateSettings[i]||super.removePrivate(i)}))}_findTemplate(e){const t=this._findStaticTemplate(e);if(t===void 0){const i=rt(this._internalTemplates,e);return i===void 0?st(this._templates,e):i}return t}_findTemplateByKey(e){return this._findTemplate(t=>e in t._settings)}_findTemplateByPrivateKey(e){return this._findTemplate(t=>e in t._privateSettings)}_disposeTemplates(){_(this._templateDisposers,e=>{e.dispose()}),this._templateDisposers.length=0}_removeTemplates(){_(this._templates,e=>{e._removeObjectTemplate(this)}),this._templates.length=0}_applyThemes(e=!1){let t=!1;const i=[];let r=[];const a=new Set,n=this.get("themeTagsSelf");return n&&_(n,o=>{a.add(o)}),this._walkParents(o=>{o===this._root._rootContainer&&(t=!0),o._defaultThemes.length>0&&i.push(o._defaultThemes);const h=o.get("themes");h&&r.push(h);const l=o.get("themeTags");l&&_(l,d=>{a.add(d)})}),r=i.concat(r),this._removeTemplates(),(t||e)&&V(this.classNames,o=>{const h=[];_(r,l=>{_(l,d=>{const p=d._lookupRules(o);p&&V(p,u=>{if(u.tags.every(c=>a.has(c))){const c=nt(h,m=>{const b=F(u.tags.length,m.tags.length);return b===0?Ze(u.tags,m.tags,F):b});h.splice(c.index,0,u)}})})}),_(h,l=>{this._templates.push(l.template),l.template._setObjectTemplate(this)})}),this._applyTemplates(),(t||e)&&(this._runSetup=!1),t||e}_changed(){}_beforeChanged(){if(this.isDirty("id")){const e=this.get("id");e&&this._registerId(e);const t=this._prevSettings.id;t&&delete R.entitiesById[t]}}_registerId(e){if(R.entitiesById[e]&&R.entitiesById[e]!==this)throw new Error('An entity with id "'+e+'" already exists.');R.entitiesById[e]=this}_afterChanged(){}addDisposer(e){return this._disposers.push(e),e}_dispose(){super._dispose();const e=this._template;e&&e._removeObjectTemplate(this),_(this._internalTemplates,i=>{i._removeObjectTemplate(this)}),this._removeTemplates(),this._disposeTemplates(),this.events.dispose(),this._disposers.forEach(i=>{i.dispose()}),y(this._disposerProperties,(i,r)=>{_(r,a=>{a.dispose()})});const t=this.get("id");t&&delete R.entitiesById[t]}setTimeout(e,t){const i=setTimeout(()=>{this.removeDispose(r),e()},t),r=new P(()=>{clearTimeout(i)});return this._disposers.push(r),r}removeDispose(e){if(!this.isDisposed()){let t=re(this._disposers,e);t>-1&&this._disposers.splice(t,1)}e.dispose()}hasTag(e){return re(this.get("themeTags",[]),e)!==-1}addTag(e){if(!this.hasTag(e)){const t=this.get("themeTags",[]);t.push(e),this.set("themeTags",t)}}removeTag(e){if(this.hasTag(e)){const t=this.get("themeTags",[]);Fe(t,e),this.set("themeTags",t)}}_t(e,t,...i){return this._root.language.translate(e,t,...i)}get root(){return this._root}}Object.defineProperty(A,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Entity"}),Object.defineProperty(A,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:["Entity"]});class It{constructor(e,t,i){Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._name=e,this._template=t,this._settings=i}get(e,t){const i=this._settings[e];return i!==void 0?i:t}set(e,t){this._settings[e]=t,this._template._stateChanged(this._name)}remove(e){delete this._settings[e],this._template._stateChanged(this._name)}setAll(e){T(e).forEach(t=>{this._settings[t]=e[t]}),this._template._stateChanged(this._name)}_apply(e,t){y(this._settings,(i,r)=>{t[i]||e._userSettings[i]||(t[i]=!0,e.setRaw(i,r))})}}class Lt{constructor(e){Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_states",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._template=e}lookup(e){return this._states[e]}create(e,t){const i=this._states[e];if(i)return i.setAll(t),i;{const r=new It(e,this._template,t);return this._states[e]=r,this._template._stateChanged(e),r}}remove(e){delete this._states[e],this._template._stateChanged(e)}_apply(e,t){y(this._states,(i,r)=>{let a=t.states[i];a==null&&(a=t.states[i]={});const n=e.states.create(i,{});r._apply(n,a)})}}class Nt{constructor(){Object.defineProperty(this,"_callbacks",{enumerable:!0,configurable:!0,writable:!0,value:{}})}add(e,t){let i=this._callbacks[e];return i===void 0&&(i=this._callbacks[e]=[]),i.push(t),new P(()=>{O(i,t),i.length===0&&delete this._callbacks[e]})}remove(e){this._callbacks[e]!==void 0&&delete this._callbacks[e]}_apply(e){const t=[];return y(this._callbacks,(i,r)=>{_(r,a=>{t.push(e.adapters.add(i,a))})}),new k(t)}}class J{constructor(e,t){if(Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_privateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_settingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_privateSettingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_entities",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"states",{enumerable:!0,configurable:!0,writable:!0,value:new Lt(this)}),Object.defineProperty(this,"adapters",{enumerable:!0,configurable:!0,writable:!0,value:new Nt}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new q}),Object.defineProperty(this,"setup",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!t)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this._settings=e}static new(e){return new J(e,!0)}get entities(){return this._entities}get(e,t){const i=this._settings[e];return i!==void 0?i:t}setRaw(e,t){this._settings[e]=t}set(e,t){this._settings[e]!==t&&(this.setRaw(e,t),this._entities.forEach(i=>{i._setTemplateProperty(this,e,t)}))}remove(e){e in this._settings&&(delete this._settings[e],this._entities.forEach(t=>{t._removeTemplateProperty(e)}))}removeAll(){y(this._settings,(e,t)=>{this.remove(e)})}getPrivate(e,t){const i=this._privateSettings[e];return i!==void 0?i:t}setPrivateRaw(e,t){return this._privateSettings[e]=t,t}setPrivate(e,t){return this._privateSettings[e]!==t&&(this.setPrivateRaw(e,t),this._entities.forEach(i=>{i._setTemplatePrivateProperty(this,e,t)})),t}removePrivate(e){e in this._privateSettings&&(delete this._privateSettings[e],this._entities.forEach(t=>{t._removeTemplatePrivateProperty(e)}))}setAll(e){y(e,(t,i)=>{this.set(t,i)})}on(e,t){let i=this._settingEvents[e];return i===void 0&&(i=this._settingEvents[e]=[]),i.push(t),new P(()=>{O(i,t),i.length===0&&delete this._settingEvents[e]})}onPrivate(e,t){let i=this._privateSettingEvents[e];return i===void 0&&(i=this._privateSettingEvents[e]=[]),i.push(t),new P(()=>{O(i,t),i.length===0&&delete this._privateSettingEvents[e]})}_apply(e,t){const i=[];return y(this._settingEvents,(r,a)=>{_(a,n=>{i.push(e.on(r,n))})}),y(this._privateSettingEvents,(r,a)=>{_(a,n=>{i.push(e.onPrivate(r,n))})}),this.states._apply(e,t),i.push(this.adapters._apply(e)),i.push(e.events.copyFrom(this.events)),new k(i)}_setObjectTemplate(e){this._entities.push(e)}_removeObjectTemplate(e){Fe(this._entities,e)}_stateChanged(e){this._entities.forEach(t=>{t._applyStateByKey(e)})}}class ae extends q{constructor(e){super(),Object.defineProperty(this,"_sprite",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rendererDisposers",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dispatchParents",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this._sprite=e}_makePointerEvent(e,t){return{type:e,originalEvent:t.event,point:t.point,simulated:t.simulated,native:t.native,target:this._sprite}}_onRenderer(e,t){this._sprite.set("interactive",!0),this._sprite._display.interactive=!0;let i=this._rendererDisposers[e];if(i===void 0){const r=this._sprite._display.on(e,a=>{t.call(this,a)});i=this._rendererDisposers[e]=new lt(()=>{delete this._rendererDisposers[e],r.dispose()})}return i.increment()}_on(e,t,i,r,a,n){const o=super._on(e,t,i,r,a,n),h=ae.RENDERER_EVENTS[t];return h!==void 0&&(o.disposer=new k([o.disposer,this._onRenderer(t,h)])),o}stopParentDispatch(){this._dispatchParents=!1}dispatchParents(e,t){const i=this._dispatchParents;this._dispatchParents=!0;try{this.dispatch(e,t),this._dispatchParents&&this._sprite.parent&&this._sprite.parent.events.dispatchParents(e,t)}finally{this._dispatchParents=i}}}Object.defineProperty(ae,"RENDERER_EVENTS",{enumerable:!0,configurable:!0,writable:!0,value:{click:function(s){this.isEnabled("click")&&!this._sprite.isDragging()&&this._sprite._hasDown()&&!this._sprite._hasMoved(this._makePointerEvent("click",s))&&this.dispatch("click",this._makePointerEvent("click",s))},rightclick:function(s){this.isEnabled("rightclick")&&this.dispatch("rightclick",this._makePointerEvent("rightclick",s))},middleclick:function(s){this.isEnabled("middleclick")&&this.dispatch("middleclick",this._makePointerEvent("middleclick",s))},dblclick:function(s){this.dispatchParents("dblclick",this._makePointerEvent("dblclick",s))},pointerover:function(s){const e=this._sprite;let t=!0;if(e.getPrivate("trustBounds")){e._getBounds();const i=e.globalBounds();St(s.point,i)||(t=!1,e._root._renderer.removeHovering(e._display))}t&&this.isEnabled("pointerover")&&this.dispatch("pointerover",this._makePointerEvent("pointerover",s))},pointerout:function(s){this.isEnabled("pointerout")&&this.dispatch("pointerout",this._makePointerEvent("pointerout",s))},pointerdown:function(s){this.dispatchParents("pointerdown",this._makePointerEvent("pointerdown",s))},pointerup:function(s){this.isEnabled("pointerup")&&this.dispatch("pointerup",this._makePointerEvent("pointerup",s))},globalpointerup:function(s){this.isEnabled("globalpointerup")&&this.dispatch("globalpointerup",this._makePointerEvent("globalpointerup",s))},globalpointermove:function(s){this.isEnabled("globalpointermove")&&this.dispatch("globalpointermove",this._makePointerEvent("globalpointermove",s))},wheel:function(s){this.dispatchParents("wheel",{type:"wheel",target:this._sprite,originalEvent:s.event,point:s.point})}}});class x extends A{constructor(){super(...arguments),Object.defineProperty(this,"_adjustedLocalBounds",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_localBounds",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dataItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_templateField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_sizeDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDragging",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dragEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dragPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isHidden",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isShowing",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isHiding",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_downPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downPoints",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_toggleDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dragDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_hoverDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_focusDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipMoveDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipPointerDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_statesHandled",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this.setPrivateRaw("visible",!0),super._afterNew()}_markDirtyKey(e){super._markDirtyKey(e),e!="x"&&e!="y"&&e!="dx"&&e!="dy"||(this.markDirtyBounds(),this._addPercentagePositionChildren(),this.markDirtyPosition())}_markDirtyPrivateKey(e){super._markDirtyPrivateKey(e),e!="x"&&e!="y"||this.markDirtyPosition()}_removeTemplateField(){this._templateField&&this._templateField._removeObjectTemplate(this)}_createEvents(){return new ae(this)}_processTemplateField(){let e;const t=this.get("templateField");if(t){const i=this.dataItem;if(i){const r=i.dataContext;r&&(e=r[t],e instanceof J||!e||(e=J.new(e)))}}this._templateField!==e&&(this._removeTemplateField(),this._templateField=e,e&&e._setObjectTemplate(this),this._applyTemplates())}_setDataItem(e){const t=this._dataItem;this._dataItem=e,this._processTemplateField();const i="dataitemchanged";e!=t&&this.events.isEnabled(i)&&this.events.dispatch(i,{type:i,target:this,oldDataItem:t,newDataItem:e})}set dataItem(e){this._setDataItem(e)}get dataItem(){if(this._dataItem)return this._dataItem;{let e=this._parent;for(;e;){if(e._dataItem)return e._dataItem;e=e._parent}}}_addPercentageSizeChildren(){let e=this.parent;e&&(this.get("width")instanceof f||this.get("height")instanceof f?Ce(e._percentageSizeChildren,this):O(e._percentageSizeChildren,this))}_addPercentagePositionChildren(){let e=this.parent;e&&(this.get("x")instanceof f||this.get("y")instanceof f?Ce(e._percentagePositionChildren,this):O(e._percentagePositionChildren,this))}markDirtyPosition(){this._root._addDirtyPosition(this)}updatePivotPoint(){const e=this._localBounds;if(e){const t=this.get("centerX");t!=null&&(this._display.pivot.x=e.left+M(t,e.right-e.left));const i=this.get("centerY");i!=null&&(this._display.pivot.y=e.top+M(i,e.bottom-e.top))}}_beforeChanged(){if(super._beforeChanged(),this._handleStates(),this.isDirty("tooltip")){const e=this._prevSettings.tooltip;e&&e.dispose()}if((this.isDirty("layer")||this.isDirty("layerMargin"))&&(this._display.setLayer(this.get("layer"),this.get("layerMargin")),this.markDirtyLayer()),this.isDirty("tooltipPosition")){const e=this._tooltipMoveDp;e&&(e.dispose(),this._tooltipMoveDp=void 0);const t=this._tooltipPointerDp;t&&(t.dispose(),this._tooltipPointerDp=void 0),this.get("tooltipPosition")=="pointer"&&(this.isHover()&&(this._tooltipMoveDp=this.events.on("globalpointermove",i=>{this.showTooltip(i.point)})),this._tooltipPointerDp=new k([this.events.on("pointerover",()=>{this._tooltipMoveDp=this.events.on("globalpointermove",i=>{this.showTooltip(i.point)})}),this.events.on("pointerout",()=>{const i=this._tooltipMoveDp;i&&(i.dispose(),this._tooltipMoveDp=void 0)})]))}}_handleStates(){this._statesHandled||(this.isDirty("active")&&(this.get("active")?(this.states.applyAnimate("active"),this.set("ariaChecked",!0)):(this.isHidden()||this.states.applyAnimate("default"),this.set("ariaChecked",!1)),this.markDirtyAccessibility()),this.isDirty("disabled")&&(this.get("disabled")?(this.states.applyAnimate("disabled"),this.set("ariaChecked",!1)):(this.isHidden()||this.states.applyAnimate("default"),this.set("ariaChecked",!0)),this.markDirtyAccessibility()),this._statesHandled=!0)}_changed(){super._changed();const e=this._display,t=this.events;if(this.isDirty("draggable")){const r=this.get("draggable");r?(this.set("interactive",!0),this._dragDp=new k([t.on("pointerdown",a=>{this.dragStart(a)}),t.on("globalpointermove",a=>{this.dragMove(a)}),t.on("globalpointerup",a=>{this.dragStop(a)})])):this._dragDp&&(this._dragDp.dispose(),this._dragDp=void 0),e.cancelTouch=!!r}if(this.isDirty("tooltipText")||this.isDirty("tooltipHTML")||this.isDirty("showTooltipOn")){const r=this.get("tooltipText"),a=this.get("tooltipHTML"),n=this.get("showTooltipOn","hover");this._tooltipDp&&(this._tooltipDp.dispose(),this._tooltipDp=void 0),(r||a)&&(n=="click"?(this._tooltipDp=new k([t.on("click",()=>{this.setTimeout(()=>this.showTooltip(),10)}),Ue(document,"click",o=>{this.hideTooltip()})]),this._disposers.push(this._tooltipDp)):n=="always"||(this._tooltipDp=new k([t.on("pointerover",()=>{this.showTooltip()}),t.on("pointerout",()=>{this.hideTooltip()})]),this._disposers.push(this._tooltipDp)))}if(this.isDirty("toggleKey")){let r=this.get("toggleKey");r&&r!="none"?this._toggleDp=t.on("click",()=>{this._isDragging||this.set(r,!this.get(r))}):this._toggleDp&&(this._toggleDp.dispose(),this._toggleDp=void 0)}if(this.isDirty("opacity")&&(e.alpha=Math.max(0,this.get("opacity",1)),this.get("focusable")&&this.markDirtyAccessibility()),this.isDirty("rotation")&&(this.markDirtyBounds(),e.angle=this.get("rotation",0)),this.isDirty("scale")&&(this.markDirtyBounds(),e.scale=this.get("scale",0)),(this.isDirty("centerX")||this.isDirty("centerY"))&&(this.markDirtyBounds(),this.updatePivotPoint()),(this.isDirty("visible")||this.isPrivateDirty("visible")||this.isDirty("forceHidden"))&&(this.get("visible")&&this.getPrivate("visible")&&!this.get("forceHidden")?e.visible=!0:(e.visible=!1,this.hideTooltip()),this.markDirtyBounds(),this.get("focusable")&&this.markDirtyAccessibility()),this.isDirty("width")||this.isDirty("height")){this.markDirtyBounds(),this._addPercentageSizeChildren();const r=this.parent;r&&(this.isDirty("width")&&this.get("width")instanceof f||this.isDirty("height")&&this.get("height")instanceof f)&&(r.markDirty(),r._prevWidth=0),this._sizeDirty=!0}if((this.isDirty("maxWidth")||this.isDirty("maxHeight")||this.isPrivateDirty("width")||this.isPrivateDirty("height")||this.isDirty("minWidth")||this.isDirty("minHeight")||this.isPrivateDirty("maxWidth")||this.isPrivateDirty("maxHeight")||this.isPrivateDirty("minWidth")||this.isPrivateDirty("minHeight"))&&(this.markDirtyBounds(),this._sizeDirty=!0),this._sizeDirty&&this._updateSize(),this.isDirty("wheelable")){const r=this.get("wheelable");r&&this.set("interactive",!0),e.wheelable=!!r}(this.isDirty("tabindexOrder")||this.isDirty("focusableGroup"))&&(this.get("focusable")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this)),this.isDirty("filter")&&(e.filter=this.get("filter"));let i=this.get("filter","");if(this.isDirty("blur")){const r=this.get("blur",0);r!=0&&(i+=" blur("+r+"px)")}if(this.isDirty("saturate")){const r=this.get("saturate",1);r!=1&&(i+=" saturate("+r+")")}if(this.isDirty("brightness")){const r=this.get("brightness",1);r!=1&&(i+=" brightness("+r+")")}if(this.isDirty("contrast")){const r=this.get("contrast",1);r!=1&&(i+=" contrast("+r+")")}if(this.isDirty("sepia")){const r=this.get("sepia",0);r!=0&&(i+=" sepia("+r+")")}if(this.isDirty("hue")){const r=this.get("hue",0);r!=0&&(i+=" hue-rotate("+r+"deg)")}if(this.isDirty("invert")){const r=this.get("invert",0);r!=0&&(i+=" invert("+r+")")}if(i&&(e.filter=i),this.isDirty("cursorOverStyle")&&(e.cursorOverStyle=this.get("cursorOverStyle")),this.isDirty("hoverOnFocus")&&(this.get("hoverOnFocus")?this._focusDp=new k([t.on("focus",()=>{this.showTooltip()}),t.on("blur",()=>{this.hideTooltip()})]):this._focusDp&&(this._focusDp.dispose(),this._focusDp=void 0)),this.isDirty("focusable")&&(this.get("focusable")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this),this.markDirtyAccessibility()),this.isPrivateDirty("focusable")&&this.markDirtyAccessibility(),(this.isDirty("role")||this.isDirty("ariaLive")||this.isDirty("ariaChecked")||this.isDirty("ariaHidden")||this.isDirty("ariaOrientation")||this.isDirty("ariaValueNow")||this.isDirty("ariaValueMin")||this.isDirty("ariaValueMax")||this.isDirty("ariaValueText")||this.isDirty("ariaLabel")||this.isDirty("ariaControls"))&&this.markDirtyAccessibility(),this.isDirty("exportable")&&(e.exportable=this.get("exportable")),this.isDirty("interactive")){const r=this.events;this.get("interactive")?this._hoverDp=new k([r.on("click",a=>{Me(a.originalEvent)&&(this.getPrivate("touchHovering")||this.setTimeout(()=>{this._handleOver(),(this.get("tooltipText")||this.get("tooltipHTML"))&&this.showTooltip(),this.setPrivateRaw("touchHovering",!0),this.events.dispatch("pointerover",{type:"pointerover",target:a.target,originalEvent:a.originalEvent,point:a.point,simulated:a.simulated})},10))}),r.on("globalpointerup",a=>{Me(a.originalEvent)&&this.getPrivate("touchHovering")&&(this._handleOut(),(this.get("tooltipText")||this.get("tooltipHTML"))&&this.hideTooltip(),this.setPrivateRaw("touchHovering",!1),this.events.dispatch("pointerout",{type:"pointerout",target:a.target,originalEvent:a.originalEvent,point:a.point,simulated:a.simulated})),this._isDown&&this._handleUp(a)}),r.on("pointerover",()=>{this._handleOver()}),r.on("pointerout",()=>{this._handleOut()}),r.on("pointerdown",a=>{this._handleDown(a)})]):(this._display.interactive=!1,this._hoverDp&&(this._hoverDp.dispose(),this._hoverDp=void 0))}this.isDirty("forceInactive")&&(this._display.inactive=this.get("forceInactive",null)),this.get("showTooltipOn")=="always"&&this._display.visible&&this.showTooltip()}dragStart(e){this._dragEvent=e,this.events.stopParentDispatch()}dragStop(e){if(this._dragEvent=void 0,this._dragPoint=void 0,this.events.stopParentDispatch(),this._isDragging){this._isDragging=!1;const t="dragstop";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this,originalEvent:e.originalEvent,point:e.point,simulated:e.simulated})}}_handleOver(){this.isHidden()||(this.get("active")&&this.states.lookup("hoverActive")?this.states.applyAnimate("hoverActive"):this.get("disabled")&&this.states.lookup("hoverDisabled")?this.states.applyAnimate("hoverDisabled"):this.states.applyAnimate("hover"),this.get("draggable")&&this._isDown&&this.states.lookup("down")&&this.states.applyAnimate("down"))}_handleOut(){this.isHidden()||(this.get("active")&&this.states.lookup("active")?this.states.applyAnimate("active"):this.get("disabled")&&this.states.lookup("disabled")?this.states.applyAnimate("disabled"):(this.states.lookup("hover")||this.states.lookup("hoverActive"))&&this.states.applyAnimate("default"),this.get("draggable")&&this._isDown&&this.states.lookup("down")&&this.states.applyAnimate("down"))}_handleUp(e){if(!this.isHidden()){this.get("active")&&this.states.lookup("active")?this.states.applyAnimate("active"):this.get("disabled")&&this.states.lookup("disabled")?this.states.applyAnimate("disabled"):this.states.lookup("down")&&(this.isHover()?this.states.applyAnimate("hover"):this.states.applyAnimate("default")),this._downPoint=void 0;const t=ue(e.originalEvent);delete this._downPoints[t],T(this._downPoints).length==0&&(this._isDown=!1)}}_hasMoved(e){const t=ue(e.originalEvent),i=this._downPoints[t];if(i){const r=Math.abs(i.x-e.point.x),a=Math.abs(i.y-e.point.y);return r>5||a>5}return!1}_hasDown(){return T(this._downPoints).length>0}_handleDown(e){const t=this.parent;if(t&&!this.get("draggable")&&t._handleDown(e),this.get("interactive")&&!this.isHidden()){this.states.lookup("down")&&this.states.applyAnimate("down"),this._downPoint={x:e.point.x,y:e.point.y},this._isDown=!0;const i=ue(e.originalEvent);this._downPoints[i]={x:e.point.x,y:e.point.y}}}dragMove(e){let t=this._dragEvent;if(t){if(t.simulated&&!e.simulated)return!0;let i=0,r=this.parent,a=1;for(;r!=null;)i+=r.get("rotation",0),r=r.parent,r&&(a*=r.get("scale",1));let n=(e.point.x-t.point.x)/a,o=(e.point.y-t.point.y)/a;const h=this.events;if(t.simulated&&!this._isDragging){this._isDragging=!0,this._dragEvent=e,this._dragPoint={x:this.x(),y:this.y()};const l="dragstart";h.isEnabled(l)&&h.dispatch(l,{type:l,target:this,originalEvent:e.originalEvent,point:e.point,simulated:e.simulated})}if(this._isDragging){let l=this._dragPoint;this.set("x",l.x+n*ye(i)+o*ve(i)),this.set("y",l.y+o*ye(i)-n*ve(i));const d="dragged";h.isEnabled(d)&&h.dispatch(d,{type:d,target:this,originalEvent:e.originalEvent,point:e.point,simulated:e.simulated})}else if(Math.hypot(n,o)>5){this._isDragging=!0,this._dragEvent=e,this._dragPoint={x:this.x(),y:this.y()};const l="dragstart";h.isEnabled(l)&&h.dispatch(l,{type:l,target:this,originalEvent:e.originalEvent,point:e.point,simulated:e.simulated})}}}_updateSize(){}_getBounds(){this._localBounds=this._display.getLocalBounds()}depth(){let e=this.parent,t=0;for(;;){if(!e)return t;++t,e=e.parent}}markDirtySize(){this._sizeDirty=!0,this.markDirty()}markDirtyBounds(){const e=this._display;if(this.get("isMeasured")){this._root._addDirtyBounds(this),e.isMeasured=!0,e.invalidateBounds();const t=this.parent;t&&this.get("position")!="absolute"&&(t.get("width")==null||t.get("height")==null||t.get("layout"))&&t.markDirtyBounds(),this.get("focusable")&&this.isFocus()&&this.markDirtyAccessibility()}}markDirtyAccessibility(){this._root._invalidateAccessibility(this)}markDirtyLayer(){this._display.markDirtyLayer(!0)}markDirty(){super.markDirty(),this.markDirtyLayer()}_updateBounds(){const e=this._adjustedLocalBounds;let t;if(this.get("visible")&&this.getPrivate("visible")&&!this.get("forceHidden")?(this._getBounds(),this._fixMinBounds(this._localBounds),this.updatePivotPoint(),this._adjustedLocalBounds=this._display.getAdjustedBounds(this._localBounds),t=this._adjustedLocalBounds):(t={left:0,right:0,top:0,bottom:0},this._localBounds=t,this._adjustedLocalBounds=t),!e||e.left!==t.left||e.top!==t.top||e.right!==t.right||e.bottom!==t.bottom){const i="boundschanged";this.events.isEnabled(i)&&this.events.dispatch(i,{type:i,target:this}),this.parent&&(this.parent.markDirty(),this.parent.markDirtyBounds())}}_fixMinBounds(e){let t=this.get("minWidth",this.getPrivate("minWidth")),i=this.get("minHeight",this.getPrivate("minHeight"));g(t)&&e.right-e.left0?e.right=e.left+r:e.left=e.right+r),g(a)&&(a>0?e.bottom=e.top+a:e.top=e.bottom+a)}_removeParent(e){e&&(e.children.removeValue(this),O(e._percentageSizeChildren,this),O(e._percentagePositionChildren,this))}_clearDirty(){super._clearDirty(),this._sizeDirty=!1,this._statesHandled=!1}hover(){this.showTooltip(),this._handleOver()}unhover(){this.hideTooltip(),this._handleOut()}showTooltip(e){const t=this.getTooltip(),i=this.get("tooltipText"),r=this.get("tooltipHTML");if((i||r)&&t){const a=this.get("tooltipPosition"),n=this.getPrivate("tooltipTarget",this);a!="fixed"&&e||(this._display._setMatrix(),e=this.toGlobal(n._getTooltipPoint())),t.set("pointTo",e),t.set("tooltipTarget",n),t.get("x")||t.set("x",e.x),t.get("y")||t.set("y",e.y),i&&t.label.set("text",i),r&&t.label.set("html",r);const o=this.dataItem;if(o&&t.label._setDataItem(o),this.get("showTooltipOn")=="always"&&(e.x<0||e.x>this._root.width()||e.y<0||e.y>this._root.height()))return void this.hideTooltip();t.label.text.markDirtyText();const h=t.show();return this.setPrivateRaw("showingTooltip",!0),h}}hideTooltip(){const e=this.getTooltip();if(e&&(e.get("tooltipTarget")==this.getPrivate("tooltipTarget",this)||this.get("tooltip")==e)){let t=e.get("keepTargetHover")&&e.get("stateAnimationDuration",0)==0?400:void 0;const i=e.hide(t);return this.setPrivateRaw("showingTooltip",!1),i}}_getTooltipPoint(){const e=this._localBounds;if(e){let t=0,i=0;return this.get("isMeasured")?(t=e.left+M(this.get("tooltipX",0),e.right-e.left),i=e.top+M(this.get("tooltipY",0),e.bottom-e.top)):(t=M(this.get("tooltipX",0),this.width()),i=M(this.get("tooltipY",0),this.height())),{x:t,y:i}}return{x:0,y:0}}getTooltip(){let e=this.get("tooltip");if(e)return e;{let t=this.parent;if(t)return t.getTooltip()}}_updatePosition(){const e=this.parent;let t=this.get("dx",0),i=this.get("dy",0),r=this.get("x"),a=this.getPrivate("x"),n=0,o=0;const h=this.get("position");r instanceof f&&(r=e?e.innerWidth()*r.value+e.get("paddingLeft",0):0),g(r)?n=r+t:a!=null?n=a:e&&h=="relative"&&(n=e.get("paddingLeft",0)+t);let l=this.get("y"),d=this.getPrivate("y");l instanceof f&&(l=e?e.innerHeight()*l.value+e.get("paddingTop",0):0),g(l)?o=l+i:d!=null?o=d:e&&h=="relative"&&(o=e.get("paddingTop",0)+i);const p=this._display;if(p.x!=n||p.y!=o){p.invalidateBounds(),p.x=n,p.y=o;const u="positionchanged";this.events.isEnabled(u)&&this.events.dispatch(u,{type:u,target:this})}this.getPrivate("showingTooltip")&&this.showTooltip()}x(){let e=this.get("x"),t=this.getPrivate("x");const i=this.parent;return i?e instanceof f?M(e,i.innerWidth())+i.get("paddingLeft",0):g(e)?e:t??i.get("paddingLeft",this._display.x):this._display.x}y(){let e=this.getPrivate("y");if(e!=null)return e;let t=this.get("y");const i=this.parent;return i?t instanceof f?M(t,i.innerHeight())+i.get("paddingTop",0):g(t)?t:e??i.get("paddingTop",this._display.y):this._display.y}_dispose(){super._dispose(),this._display.dispose(),this._removeTemplateField(),this._removeParent(this.parent),this._root._removeFocusElement(this);const e=this.get("tooltip");e&&e.dispose(),this.markDirty()}adjustedLocalBounds(){return this._fixMinBounds(this._adjustedLocalBounds),this._adjustedLocalBounds}localBounds(){return this._localBounds}bounds(){const e=this._adjustedLocalBounds,t=this.x(),i=this.y();return{left:e.left+t,right:e.right+t,top:e.top+i,bottom:e.bottom+i}}globalBounds(){const e=this.localBounds(),t=this.toGlobal({x:e.left,y:e.top}),i=this.toGlobal({x:e.right,y:e.top}),r=this.toGlobal({x:e.right,y:e.bottom}),a=this.toGlobal({x:e.left,y:e.bottom});return{left:Math.min(t.x,i.x,r.x,a.x),top:Math.min(t.y,i.y,r.y,a.y),right:Math.max(t.x,i.x,r.x,a.x),bottom:Math.max(t.y,i.y,r.y,a.y)}}_onShow(e){}_onHide(e){}appear(e,t){return ee(this,void 0,void 0,function*(){return yield this.hide(0),t?new Promise((i,r)=>{this.setTimeout(()=>{i(this.show(e))},t)}):this.show(e)})}show(e){return ee(this,void 0,void 0,function*(){if(!this._isShowing){this._isHidden=!1,this._isShowing=!0,this._isHiding=!1,this.states.lookup("default").get("visible")&&this.set("visible",!0),this._onShow(e);const t=this.states.applyAnimate("default",e);yield He(t),this._isShowing=!1}})}hide(e){return ee(this,void 0,void 0,function*(){if(!this._isHiding&&!this._isHidden){this._isHiding=!0,this._isShowing=!1;let t=this.states.lookup("hidden");t||(t=this.states.create("hidden",{opacity:0,visible:!1})),this._isHidden=!0,this._onHide(e);const i=this.states.applyAnimate("hidden",e);yield He(i),this._isHiding=!1}})}isHidden(){return this._isHidden}isShowing(){return this._isShowing}isHiding(){return this._isHiding}isHover(){return this._display.hovering()}isFocus(){return this._root.focused(this)}isDragging(){return this._isDragging}isVisible(){return!(!this.get("visible")||!this.getPrivate("visible")||this.get("forceHidden"))}isVisibleDeep(){return this._parent?this._parent.isVisibleDeep()&&this.isVisible():this.isVisible()}compositeOpacity(){const e=this.get("opacity",1);return this._parent?this._parent.compositeOpacity()*e:e}width(){let e=this.get("width"),t=this.get("maxWidth",this.getPrivate("maxWidth")),i=this.get("minWidth",this.getPrivate("minWidth")),r=this.getPrivate("width"),a=0;if(g(r))a=r;else if(e==null)this._adjustedLocalBounds&&(a=this._adjustedLocalBounds.right-this._adjustedLocalBounds.left);else if(e instanceof f){const n=this.parent;a=n?n.innerWidth()*e.value:this._root.width()*e.value}else g(e)&&(a=e);return g(i)&&(a=Math.max(i,a)),g(t)&&(a=Math.min(t,a)),a}maxWidth(){let e=this.get("maxWidth",this.getPrivate("maxWidth"));if(g(e))return e;{let i=this.get("width");if(g(i))return i}const t=this.parent;return t?t.innerWidth():this._root.width()}maxHeight(){let e=this.get("maxHeight",this.getPrivate("maxHeight"));if(g(e))return e;{let i=this.get("height");if(g(i))return i}const t=this.parent;return t?t.innerHeight():this._root.height()}height(){let e=this.get("height"),t=this.get("maxHeight",this.getPrivate("maxHeight")),i=this.get("minHeight",this.getPrivate("minHeight")),r=this.getPrivate("height"),a=0;if(g(r))a=r;else if(e==null)this._adjustedLocalBounds&&(a=this._adjustedLocalBounds.bottom-this._adjustedLocalBounds.top);else if(e instanceof f){const n=this.parent;a=n?n.innerHeight()*e.value:this._root.height()*e.value}else g(e)&&(a=e);return g(i)&&(a=Math.max(i,a)),g(t)&&(a=Math.min(t,a)),a}_findStaticTemplate(e){return this._templateField&&e(this._templateField)?this._templateField:super._findStaticTemplate(e)}_walkParents(e){this._parent&&this._walkParent(e)}_walkParent(e){this._parent&&this._parent._walkParent(e),e(this)}get parent(){return this._parent}_setParent(e,t=!1){const i=this._parent;e!==i&&(this.markDirtyBounds(),e.markDirty(),this._parent=e,t&&(this._removeParent(i),e&&(this._addPercentageSizeChildren(),this._addPercentagePositionChildren())),this.markDirtyPosition(),this._applyThemes())}getNumberFormatter(){return this.get("numberFormatter",this._root.numberFormatter)}getDateFormatter(){return this.get("dateFormatter",this._root.dateFormatter)}getDurationFormatter(){return this.get("durationFormatter",this._root.durationFormatter)}toGlobal(e){return this._display.toGlobal(e)}toLocal(e){return this._display.toLocal(e)}_getDownPoint(){const e=this._getDownPointId();if(e)return this._downPoints[e]}_getDownPointId(){if(this._downPoints)return ot(this._downPoints,(e,t)=>e>t?1:e0&&(n.beginFill(r,a),n.drawRect(0,0,t,i),n.endFill()),o.angle=this.get("rotation",0),this._draw(),this._pattern=this._root._renderer.createPattern(o,n,e,t,i)}this._clear=!1}}Object.defineProperty(K,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Pattern"}),Object.defineProperty(K,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:A.classNames.concat([K.className])});class G extends K{constructor(){super(...arguments),Object.defineProperty(this,"_image",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_beforeChanged(){super._beforeChanged(),this._clear=!0,this.isDirty("src")&&this._load();const e=this.get("canvas");e&&(this.set("width",e.width),this.set("height",e.height))}_draw(){super._draw();const e=this._image;if(e){const i=this.get("width",100),r=this.get("height",100),a=this.get("fit","image");let n=0,o=0;a=="pattern"?(n=i,o=r):(n=e.width,o=e.height,a=="image"&&(this.set("width",n),this.set("height",o)));let h=0,l=0;this.get("centered",!0)&&(h=i/2-n/2,l=r/2-o/2),this._display.image(e,n,o,h,l)}const t=this.get("canvas");t&&this._display.image(t,t.width,t.height,0,0)}_load(){const e=this.get("src");if(e){const t=new Image;t.src=e,t.decode().then(()=>{this._image=t,this._draw(),this.events.isEnabled("loaded")&&this.events.dispatch("loaded",{type:"loaded",target:this})}).catch(i=>{})}}}var we;Object.defineProperty(G,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PicturePattern"}),Object.defineProperty(G,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:K.classNames.concat([G.className])}),function(s){s.ADD="lighter",s.COLOR="color",s.COLOR_BURN="color-burn",s.COLOR_DODGE="color-dodge",s.DARKEN="darken",s.DIFFERENCE="difference",s.DST_OVER="destination-over",s.EXCLUSION="exclusion",s.HARD_LIGHT="hard-light",s.HUE="hue",s.LIGHTEN="lighten",s.LUMINOSITY="luminosity",s.MULTIPLY="multiply",s.NORMAL="source-over",s.OVERLAY="overlay",s.SATURATION="saturation",s.SCREEN="screen",s.SOFT_LIGHT="soft-light",s.SRC_ATOP="source-atop",s.XOR="xor"}(we||(we={}));const Mi=["fill","fillOpacity","stroke","strokeWidth","strokeOpacity","fillPattern","strokePattern","fillGradient","strokeGradient","strokeDasharray","strokeDashoffset","shadowBlur","shadowColor","shadowOpacity","shadowOffsetX","shadowOffsetY","blur","sepia","invert","brightness","hue","contrast","saturate"];class z extends x{constructor(){super(...arguments),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeGraphics()}),Object.defineProperty(this,"_clear",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_beforeChanged(){if(super._beforeChanged(),(this.isDirty("draw")||this.isDirty("svgPath"))&&this.markDirtyBounds(),(this.isDirty("fill")||this.isDirty("stroke")||this.isDirty("visible")||this.isDirty("forceHidden")||this.isDirty("scale")||this.isDirty("fillGradient")||this.isDirty("strokeGradient")||this.isDirty("fillPattern")||this.isDirty("strokePattern")||this.isDirty("fillOpacity")||this.isDirty("strokeOpacity")||this.isDirty("strokeWidth")||this.isDirty("draw")||this.isDirty("blendMode")||this.isDirty("strokeDasharray")||this.isDirty("strokeDashoffset")||this.isDirty("svgPath")||this.isDirty("lineJoin")||this.isDirty("shadowColor")||this.isDirty("shadowBlur")||this.isDirty("shadowOffsetX")||this.isDirty("shadowOffsetY"))&&(this._clear=!0),this._display.crisp=this.get("crisp",!1),this.isDirty("fillGradient")){const e=this.get("fillGradient");if(e){this._display.isMeasured=!0;const t=e.get("target");t&&(this._disposers.push(t.events.on("boundschanged",()=>{this._markDirtyKey("fill")})),this._disposers.push(t.events.on("positionchanged",()=>{this._markDirtyKey("fill")})))}}if(this.isDirty("strokeGradient")){const e=this.get("strokeGradient");if(e){this._display.isMeasured=!0;const t=e.get("target");t&&(this._disposers.push(t.events.on("boundschanged",()=>{this._markDirtyKey("stroke")})),this._disposers.push(t.events.on("positionchanged",()=>{this._markDirtyKey("stroke")})))}}}_changed(){if(super._changed(),this._clear){this.markDirtyBounds(),this.markDirtyLayer(),this._display.clear();let e=this.get("strokeDasharray");g(e)&&(e=e<.5?[0]:[e]),this._display.setLineDash(e);const t=this.get("strokeDashoffset");t&&this._display.setLineDashOffset(t);const i=this.get("blendMode",we.NORMAL);this._display.blendMode=i;const r=this.get("draw");r&&r(this._display,this);const a=this.get("svgPath");a!=null&&this._display.svgPath(a)}}_afterChanged(){if(super._afterChanged(),this._clear){const e=this.get("fill"),t=this.get("fillGradient"),i=this.get("fillPattern"),r=this.get("fillOpacity"),a=this.get("stroke"),n=this.get("strokeGradient"),o=this.get("strokePattern"),h=this.get("shadowColor"),l=this.get("shadowBlur"),d=this.get("shadowOffsetX"),p=this.get("shadowOffsetY"),u=this.get("shadowOpacity");if(h&&(l||d||p)&&this._display.shadow(h,l,d,p,u),e&&!t&&(this._display.beginFill(e,r),this._display.endFill()),t){if(e){const m=t.get("stops",[]);m.length&&_(m,b=>{b.color&&!b.colorInherited||!e||(b.color=e,b.colorInherited=!0),(b.opacity==null||b.opacityInherited)&&(b.opacity=r,b.opacityInherited=!0)})}const c=t.getFill(this);c&&(this._display.beginFill(c,r),this._display.endFill())}if(i){const c=i.pattern;c&&(this._display.beginFill(c,r),this._display.endFill(),i instanceof G&&i.events.once("loaded",()=>{this._clear=!0,this.markDirty()}))}if(a||n||o){const c=this.get("strokeOpacity");let m=this.get("strokeWidth",1);this.get("nonScalingStroke")&&(m/=this.get("scale",1)),this.get("crisp")&&(m/=this._root._renderer.resolution);const b=this.get("lineJoin");if(a&&!n&&(this._display.lineStyle(m,a,c,b),this._display.endStroke()),n){const S=n.get("stops",[]);S.length&&_(S,w=>{w.color&&!w.colorInherited||!a||(w.color=a,w.colorInherited=!0),(w.opacity==null||w.opacityInherited)&&(w.opacity=c,w.opacityInherited=!0)});const H=n.getFill(this);H&&(this._display.lineStyle(m,H,c,b),this._display.endStroke())}if(o){let S=o.pattern;S&&(this._display.lineStyle(m,S,c,b),this._display.endStroke(),o instanceof G&&o.events.once("loaded",()=>{this._clear=!0,this.markDirty()}))}}this.getPrivate("showingTooltip")&&this.showTooltip()}this._clear=!1}}Object.defineProperty(z,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Graphics"}),Object.defineProperty(z,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:x.classNames.concat([z.className])});class Y extends z{_afterNew(){super._afterNew(),this._display.isMeasured=!0,this.setPrivateRaw("trustBounds",!0)}_beforeChanged(){super._beforeChanged(),(this.isDirty("width")||this.isDirty("height")||this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&(this._clear=!0)}_changed(){super._changed(),this._clear&&!this.get("draw")&&this._draw()}_draw(){this._display.drawRect(0,0,this.width(),this.height())}_updateSize(){this.markDirty(),this._clear=!0}}function j(s,e){s.get("reverseChildren",!1)?s.children.eachReverse(e):s.children.each(e)}Object.defineProperty(Y,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Rectangle"}),Object.defineProperty(Y,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:z.classNames.concat([Y.className])});class E extends A{}Object.defineProperty(E,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Layout"}),Object.defineProperty(E,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:A.classNames.concat([E.className])});class X extends E{updateContainer(e){let t=e.get("paddingLeft",0),i=e.innerWidth(),r=0;j(e,n=>{if(n.isVisible()&&n.get("position")=="relative"){let o=n.get("width");if(o instanceof f){r+=o.value;let h=i*o.value,l=n.get("minWidth",n.getPrivate("minWidth",-1/0));l>h&&(i-=l,r-=o.value);let d=n.get("maxWidth",n.getPrivate("maxWidth",1/0));h>d&&(i-=d,r-=o.value)}else g(o)||(o=n.width()),i-=o+n.get("marginLeft",0)+n.get("marginRight",0)}}),(i<=0||i==1/0)&&(i=.1),j(e,n=>{if(n.isVisible()&&n.get("position")=="relative"){let o=n.get("width");if(o instanceof f){let h=i*o.value/r-n.get("marginLeft",0)-n.get("marginRight",0),l=n.get("minWidth",n.getPrivate("minWidth",-1/0)),d=n.get("maxWidth",n.getPrivate("maxWidth",1/0));h=Math.min(Math.max(l,h),d),n.setPrivate("width",h)}else n._prevSettings.width instanceof f&&n.setPrivate("width",void 0)}});let a=t;j(e,n=>{if(n.get("position")=="relative")if(n.isVisible()){let o=n.adjustedLocalBounds(),h=n.get("marginLeft",0),l=n.get("marginRight",0),d=n.get("maxWidth"),p=o.left,u=o.right;d&&u-p>d&&(u=p+d);let c=a+h-p;n.setPrivate("x",c),a=c+u+l}else n.setPrivate("x",void 0)})}}Object.defineProperty(X,"className",{enumerable:!0,configurable:!0,writable:!0,value:"HorizontalLayout"}),Object.defineProperty(X,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([X.className])});class $ extends E{updateContainer(e){let t=e.get("paddingTop",0),i=e.innerHeight(),r=0;j(e,n=>{if(n.isVisible()&&n.get("position")=="relative"){let o=n.get("height");if(o instanceof f){r+=o.value;let h=i*o.value,l=n.get("minHeight",n.getPrivate("minHeight",-1/0));l>h&&(i-=l,r-=o.value);let d=n.get("maxHeight",n.getPrivate("maxHeight",1/0));h>d&&(i-=d,r-=o.value)}else g(o)||(o=n.height()),i-=o+n.get("marginTop",0)+n.get("marginBottom",0)}}),(i<=0||i==1/0)&&(i=.1),j(e,n=>{if(n.isVisible()&&n.get("position")=="relative"){let o=n.get("height");if(o instanceof f){let h=i*o.value/r-n.get("marginTop",0)-n.get("marginBottom",0),l=n.get("minHeight",n.getPrivate("minHeight",-1/0)),d=n.get("maxHeight",n.getPrivate("maxHeight",1/0));h=Math.min(Math.max(l,h),d),n.setPrivate("height",h)}else n._prevSettings.height instanceof f&&n.setPrivate("height",void 0)}});let a=t;j(e,n=>{if(n.get("position")=="relative")if(n.isVisible()){let o=n.adjustedLocalBounds(),h=n.get("marginTop",0),l=o.top,d=o.bottom,p=n.get("maxHeight");p&&d-l>p&&(d=l+p);let u=n.get("marginBottom",0),c=a+h-l;n.setPrivate("y",c),a=c+d+u}else n.setPrivate("y",void 0)})}}Object.defineProperty($,"className",{enumerable:!0,configurable:!0,writable:!0,value:"VerticalLayout"}),Object.defineProperty($,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([$.className])});class Z extends E{_afterNew(){this._setRawDefault("maxColumns",Number.MAX_VALUE),super._afterNew()}updateContainer(e){let t=e.get("paddingLeft",0),i=e.get("paddingRight",0),r=e.get("paddingTop",0),a=e.maxWidth()-t-i,n=a,o=1;j(e,m=>{if(m.get("visible")&&m.getPrivate("visible")&&!m.get("forceHidden")&&m.get("position")!="absolute"){let b=m.width();bo&&(o=b)}}),n=Ie(n,1,a),o=Ie(o,1,a);let h=1;h=this.get("fixedWidthGrid")?a/o:a/n,h=Math.max(1,Math.floor(h)),h=Math.min(this.get("maxColumns",Number.MAX_VALUE),h);let l=this.getColumnWidths(e,h,o,a),d=r,p=0,u=0;h=l.length;let c=t;j(e,m=>{if(m.get("position")=="relative"&&m.isVisible()){const b=m.get("marginTop",0),S=m.get("marginBottom",0);let H=m.adjustedLocalBounds(),w=m.get("marginLeft",0),C=m.get("marginRight",0),D=c+w-H.left,N=d+b-H.top;m.setPrivate("x",D),m.setPrivate("y",N),c+=l[p]+C,u=Math.max(u,m.height()+b+S),p++,p>=h&&(p=0,c=t,d+=u)}})}getColumnWidths(e,t,i,r){let a=0,n=[],o=0;return j(e,h=>{let l=h.adjustedLocalBounds();h.get("position")!="absolute"&&h.isVisible()&&(this.get("fixedWidthGrid")?n[o]=i:n[o]=Math.max(0|n[o],l.right-l.left+h.get("marginLeft",0)+h.get("marginRight",0)),o{a+=h}),a>r?t>2?(t-=1,this.getColumnWidths(e,t,i,r)):[r]:n}}Object.defineProperty(Z,"className",{enumerable:!0,configurable:!0,writable:!0,value:"GridLayout"}),Object.defineProperty(Z,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([Z.className])});class Pe{static escape(e){return e.replace(/\[\[/g,this.prefix+"1").replace(/([^\/\]]{1})\]\]/g,"$1"+this.prefix+"2").replace(/\]\]/g,this.prefix+"2").replace(/\{\{/g,this.prefix+"3").replace(/\}\}/g,this.prefix+"4").replace(/\'\'/g,this.prefix+"5")}static unescape(e){return e.replace(new RegExp(this.prefix+"1","g"),"[[").replace(new RegExp(this.prefix+"2","g"),"]]").replace(new RegExp(this.prefix+"3","g"),"{{").replace(new RegExp(this.prefix+"4","g"),"}}").replace(new RegExp(this.prefix+"5","g"),"''")}static cleanUp(e){return e.replace(/\[\[/g,"[").replace(/\]\]/g,"]").replace(/\{\{/g,"{").replace(/\}\}/g,"}").replace(/\'\'/g,"'")}static chunk(e,t=!1,i=!1){let r=[];e=this.escape(e);let a=t?e.split("'"):[e];for(let n=0;n{e.dispose()}),this.getPrivate("htmlElement")&&this._root._removeHTMLContent(this),super._dispose()}_changed(){if(super._changed(),this.isDirty("interactiveChildren")&&(this._display.interactiveChildren=this.get("interactiveChildren",!1)),this.isDirty("layout")&&(this._prevWidth=0,this._prevHeight=0,this.markDirtyBounds(),this._prevSettings.layout&&this.children.each(e=>{e.removePrivate("x"),e.removePrivate("y")})),(this.isDirty("paddingTop")||this.isDirty("paddingBottom")||this.isDirty("paddingLeft")||this.isDirty("paddingRight"))&&this.children.each(e=>{e.markDirtyPosition()}),this.isDirty("maskContent")){const e=this._childrenDisplay;let t=this._contentMask;this.get("maskContent")?t||(t=Y.new(this._root,{x:-.5,y:-.5,width:this.width()+1,height:this.height()+1}),this._contentMask=t,e.addChildAt(t._display,0),e.mask=t._display):t&&(e.removeChild(t._display),e.mask=null,t.dispose(),this._contentMask=void 0)}}_updateSize(){super._updateSize(),_(this._percentageSizeChildren,e=>{e._updateSize()}),_(this._percentagePositionChildren,e=>{e.markDirtyPosition(),e._updateSize()}),this.updateBackground()}updateBackground(){const e=this.get("background");let t=this._localBounds;if(t&&!this.isHidden()){let i=t.left,r=t.top,a=t.right-i,n=t.bottom-r,o=this.get("maxWidth"),h=this.get("maxHeight");h&&n>h&&(n=h),o&&a>o&&(a=o);let l=this.width(),d=this.height();e&&(e.setAll({width:a,height:n,x:i,y:r}),this._display.interactive&&(e._display.interactive=!0));const p=this._contentMask;p&&p.setAll({width:l+1,height:d+1});const u=this.get("verticalScrollbar");if(u){u.set("height",d),u.set("x",l-u.width()-u.get("marginRight",0)),u.set("end",u.get("start",0)+d/this._contentHeight);const c=u.get("background");c&&c.setAll({width:u.width(),height:d});let m=!0;this._contentHeight<=d&&(m=!1),u.setPrivate("visible",m)}}}_applyThemes(e=!1){return!!super._applyThemes(e)&&(this.eachChildren(t=>{t._applyThemes(e)}),!0)}_applyState(e){super._applyState(e),this.get("setStateOnChildren")&&this.eachChildren(t=>{t.states.apply(e)})}_applyStateAnimated(e,t){super._applyStateAnimated(e,t),this.get("setStateOnChildren")&&this.eachChildren(i=>{i.states.applyAnimate(e,t)})}innerWidth(){return this.width()-this.get("paddingRight",0)-this.get("paddingLeft",0)}innerHeight(){return this.height()-this.get("paddingTop",0)-this.get("paddingBottom",0)}_getBounds(){let e=this.get("width"),t=this.get("height"),i=this.getPrivate("width"),r=this.getPrivate("height"),a={left:0,top:0,right:this.width(),bottom:this.height()},n=this.get("layout"),o=!1,h=!1;if((n instanceof X||n instanceof Z)&&(o=!0),n instanceof $&&(h=!0),e==null&&i==null||t==null&&r==null||this.get("verticalScrollbar")){let l=Number.MAX_VALUE,d=l,p=-l,u=l,c=-l;const m=this.get("paddingLeft",0),b=this.get("paddingTop",0),S=this.get("paddingRight",0),H=this.get("paddingBottom",0);this.children.each(D=>{if(D.get("position")!="absolute"&&D.get("isMeasured")){let N=D.adjustedLocalBounds(),Te=D.x(),Se=D.y(),ne=Te+N.left,oe=Te+N.right,he=Se+N.top,le=Se+N.bottom;o&&(ne-=D.get("marginLeft",0),oe+=D.get("marginRight",0)),h&&(he-=D.get("marginTop",0),le+=D.get("marginBottom",0)),nep&&(p=oe),hec&&(c=le)}}),d==l&&(d=0),p==-l&&(p=0),u==l&&(u=0),c==-l&&(c=0),a.left=d-m,a.top=u-b,a.right=p+S,a.bottom=c+H;const w=this.get("minWidth");g(w)&&w>0&&a.right-a.left=w?a.left=a.right-w:a.right=a.left+w);const C=this.get("minHeight");g(C)&&C>0&&a.bottom-a.top=C?a.top=a.bottom-C:a.bottom=a.top+C)}this._contentWidth=a.right-a.left,this._contentHeight=a.bottom-a.top,g(e)&&(a.left=0,a.right=e),g(i)&&(a.left=0,a.right=i),g(t)&&(a.top=0,a.bottom=t),g(r)&&(a.top=0,a.bottom=r),this._localBounds=a}_updateBounds(){const e=this.get("layout");e&&e.updateContainer(this),super._updateBounds(),this.updateBackground()}markDirty(){super.markDirty(),this._root._addDirtyParent(this)}_prepareChildren(){const e=this.innerWidth(),t=this.innerHeight();if(e!=this._prevWidth||t!=this._prevHeight){let i=this.get("layout"),r=!1,a=!1;i&&((i instanceof X||i instanceof Z)&&(r=!0),i instanceof $&&(a=!0)),_(this._percentageSizeChildren,n=>{if(!r){let o=n.get("width");o instanceof f&&n.setPrivate("width",o.value*e)}if(!a){let o=n.get("height");o instanceof f&&n.setPrivate("height",o.value*t)}}),_(this._percentagePositionChildren,n=>{n.markDirtyPosition(),n.markDirtyBounds()}),this._prevWidth=e,this._prevHeight=t,this._sizeDirty=!0,this.updateBackground()}this._handleStates()}_updateChildren(){if(this.isDirty("html")){const e=this.get("html");e&&e!==""?this._root._setHTMLContent(this,De(this,this.get("html",""))):this._root._removeHTMLContent(this),this._root._positionHTMLElement(this)}if(this.isDirty("verticalScrollbar")){const e=this.get("verticalScrollbar");if(e){e._setParent(this),e.startGrip.setPrivate("visible",!1),e.endGrip.setPrivate("visible",!1),this.set("maskContent",!0),this.set("paddingRight",e.width()+e.get("marginRight",0)+e.get("marginLeft",0));let t=this.get("background");t||(t=this.set("background",Y.new(this._root,{themeTags:["background"],fillOpacity:0,fill:this._root.interfaceColors.get("alternativeBackground")}))),this._vsbd0=this.events.on("wheel",i=>{const r=i.originalEvent;if(!ut(r,this))return;r.preventDefault();let a=r.deltaY/5e3;const n=e.get("start",0),o=e.get("end",1);n+a<=0&&(a=-n),o+a>=1&&(a=1-o),n+a>=0&&o+a<=1&&(e.set("start",n+a),e.set("end",o+a))}),this._disposers.push(this._vsbd0),this._vsbd1=e.events.on("rangechanged",()=>{let i=this._contentHeight;const r=this._childrenDisplay,a=this._contentMask;r.y=-e.get("start",0)*i,r.markDirtyLayer(),a&&(a._display.y=-r.y,r.mask=a._display)}),this._disposers.push(this._vsbd1),this._display.addChild(e._display)}else{const t=this._prevSettings.verticalScrollbar;t&&(this._display.removeChild(t._display),this._vsbd0&&this._vsbd0.dispose(),this._vsbd1&&this._vsbd1.dispose(),this._childrenDisplay.y=0,this.setPrivate("height",void 0),this.set("maskContent",!1),this.set("paddingRight",void 0))}}if(this.isDirty("background")){const e=this._prevSettings.background;e&&this._display.removeChild(e._display);const t=this.get("background");t instanceof x&&(t.set("isMeasured",!1),t._setParent(this),this._display.addChildAt(t._display,0))}if(this.isDirty("mask")){const e=this.get("mask"),t=this._prevSettings.mask;if(t&&(this._display.removeChild(t._display),t!=e&&t.dispose()),e){const i=e.parent;i&&i.children.removeValue(e),e._setParent(this),this._display.addChildAt(e._display,0),this._childrenDisplay.mask=e._display}}}_processTemplateField(){super._processTemplateField(),this.children.each(e=>{e._processTemplateField()})}walkChildren(e){this.children.each(t=>{t instanceof L&&t.walkChildren(e),e(t)})}eachChildren(e){const t=this.get("background");t&&e(t);const i=this.get("verticalScrollbar");i&&e(i);const r=this.get("mask");r&&e(r),this.children.values.forEach(a=>{e(a)})}allChildren(){const e=[];return this.eachChildren(t=>{e.push(t)}),e}_setDataItem(e){const t=e!==this._dataItem;super._setDataItem(e);const i=this.get("html","");i&&i!==""&&t&&this._root._setHTMLContent(this,De(this,i))}}Object.defineProperty(L,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Container"}),Object.defineProperty(L,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:x.classNames.concat([L.className])});class se extends x{constructor(){super(...arguments),Object.defineProperty(this,"textStyle",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeTextStyle()}),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeText("",this.textStyle)}),Object.defineProperty(this,"_textStyles",{enumerable:!0,configurable:!0,writable:!0,value:["textAlign","fontFamily","fontSize","fontStyle","fontWeight","fontStyle","fontVariant","textDecoration","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","shadowOpacity","lineHeight","baselineRatio","direction","textBaseline","oversizedBehavior","breakWords","ellipsis","minScale","maxChars"]}),Object.defineProperty(this,"_originalScale",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_updateBounds(){if(this.get("text"))super._updateBounds();else{let e={left:0,right:0,top:0,bottom:0};this._adjustedLocalBounds=e}}_changed(){super._changed(),this._display.clear();let e=this.textStyle;if(this.isDirty("opacity")){let t=this.get("opacity",1);this._display.alpha=t}if((this.isDirty("text")||this.isDirty("populateText"))&&(this._display.text=this._getText(),this.markDirtyBounds(),this.get("role")=="tooltip"&&this._root.updateTooltip(this)),this.isPrivateDirty("tooltipElement")&&this.getPrivate("tooltipElement")&&this._disposers.push(new P(()=>{this._root._removeTooltipElement(this)})),this.isDirty("width")&&(e.wordWrapWidth=this.width(),this.markDirtyBounds()),this.isDirty("oversizedBehavior")&&(e.oversizedBehavior=this.get("oversizedBehavior","none"),this.markDirtyBounds()),this.isDirty("breakWords")&&(e.breakWords=this.get("breakWords",!1),this.markDirtyBounds()),this.isDirty("ellipsis")&&(e.ellipsis=this.get("ellipsis"),this.markDirtyBounds()),this.isDirty("ignoreFormatting")&&(e.ignoreFormatting=this.get("ignoreFormatting",!1),this.markDirtyBounds()),this.isDirty("minScale")&&(e.minScale=this.get("minScale",0),this.markDirtyBounds()),this.isDirty("fill")){let t=this.get("fill");t&&(e.fill=t)}if(this.isDirty("fillOpacity")){let t=this.get("fillOpacity",1);t&&(e.fillOpacity=t)}(this.isDirty("maxWidth")||this.isPrivateDirty("maxWidth"))&&(e.maxWidth=this.get("maxWidth",this.getPrivate("maxWidth")),this.markDirtyBounds()),(this.isDirty("maxHeight")||this.isPrivateDirty("maxHeight"))&&(e.maxHeight=this.get("maxHeight",this.getPrivate("maxHeight")),this.markDirtyBounds()),_(this._textStyles,t=>{this._dirty[t]&&(e[t]=this.get(t),this.markDirtyBounds())}),e.fontSize=this.get("fontSize"),e.fontFamily=this.get("fontFamily"),this._display.style=e,this.isDirty("role")&&this.get("role")=="tooltip"&&this._root.updateTooltip(this)}_getText(){let e=this.get("text","");return this.get("maxChars")&&(e=_t(e,this.get("maxChars",1e8),this.get("breakWords"),this.get("ellipsis"))),this.get("populateText")?De(this,e):e}markDirtyText(){this._display.text=this._getText(),this.get("role")=="tooltip"&&this._root.updateTooltip(this),this.markDirtyBounds(),this.markDirty()}_setDataItem(e){super._setDataItem(e),this.get("populateText")&&this.markDirtyText()}getNumberFormatter(){return this.parent?this.parent.getNumberFormatter():super.getNumberFormatter()}getDateFormatter(){return this.parent?this.parent.getDateFormatter():super.getDateFormatter()}getDurationFormatter(){return this.parent?this.parent.getDurationFormatter():super.getDurationFormatter()}}Object.defineProperty(se,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Text"}),Object.defineProperty(se,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:x.classNames.concat([se.className])});class ge extends L{constructor(){super(...arguments),Object.defineProperty(this,"_text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_textKeys",{enumerable:!0,configurable:!0,writable:!0,value:["text","fill","fillOpacity","textAlign","fontFamily","fontSize","fontStyle","fontWeight","fontStyle","fontVariant","textDecoration","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","shadowOpacity","lineHeight","baselineRatio","direction","textBaseline","oversizedBehavior","breakWords","ellipsis","minScale","populateText","role","ignoreFormatting","maxChars"]})}get text(){return this._text}_afterNew(){super._afterNew(),this._makeText(),_(this._textKeys,e=>{const t=this.get(e);t!=null&&this._text.set(e,t)}),this.get("html","")!==""&&this._text.set("text",""),this.onPrivate("maxWidth",()=>{this._setMaxDimentions()}),this.onPrivate("maxHeight",()=>{this._setMaxDimentions()})}_makeText(){this._text=this.children.push(se.new(this._root,{}))}_updateChildren(){if(super._updateChildren(),_(this._textKeys,e=>{this._text.set(e,this.get(e))}),this.isDirty("maxWidth")&&this._setMaxDimentions(),this.isDirty("maxHeight")&&this._setMaxDimentions(),this.isDirty("rotation")&&this._setMaxDimentions(),this.get("html","")!==""?this._text.set("text",""):this._text.set("text",this.get("text")),this.isDirty("textAlign")||this.isDirty("width")){const e=this.get("textAlign");let t;this.get("width")!=null?t=e=="right"?Je:e=="center"?qe:0:e=="left"||e=="start"?t=this.get("paddingLeft"):e!="right"&&e!="end"||(t=-this.get("paddingRight")),this.text.set("x",t)}}_setMaxDimentions(){const e=this.get("rotation"),t=e==90||e==270||e==-90,i=this.get("maxWidth",this.getPrivate("maxWidth",1/0));g(i)?this.text.set(t?"maxHeight":"maxWidth",i-this.get("paddingLeft",0)-this.get("paddingRight",0)):this.text.set(t?"maxHeight":"maxWidth",void 0);const r=this.get("maxHeight",this.getPrivate("maxHeight",1/0));g(r)?this.text.set(t?"maxWidth":"maxHeight",r-this.get("paddingTop",0)-this.get("paddingBottom",0)):this.text.set(t?"maxWidth":"maxHeight",void 0)}_setDataItem(e){super._setDataItem(e),this._markDirtyKey("text"),this.text.get("populateText")&&this.text.markDirtyText()}getText(){return this._text._getText()}}Object.defineProperty(ge,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Label"}),Object.defineProperty(ge,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:L.classNames.concat([ge.className])});class Bi{constructor(e,t){if(Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rules",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._root=e,!t)throw new Error("You cannot use `new Class()`, instead use `Class.new()`")}static new(e){const t=new this(e,!0);return t.setupDefaultRules(),t}setupDefaultRules(){}_lookupRules(e){return this._rules[e]}ruleRaw(e,t=[]){let i=this._rules[e];i||(i=this._rules[e]=[]),t.sort(F);const{index:r,found:a}=at(i,n=>{const o=F(n.tags.length,t.length);return o===0?Ze(n.tags,t,F):o});if(a)return i[r].template;{const n=J.new({});return i.splice(r,0,{tags:t,template:n}),n}}rule(e,t=[]){return this.ruleRaw(e,t)}}export{$,Wt as A,A as B,g as C,pe as D,fi as E,Xt as F,q as G,mi as H,ui as I,qt as J,wi as K,Yt as L,ci as M,T as N,F as O,Be as P,pi as Q,gi as R,_i as S,Ce as T,_e as U,di as V,y as W,X,$t as Y,Z,Re as _,ke as a,Ut as a0,Zt as a1,re as a2,v as a3,ii as a4,lt as a5,k as a6,ti as a7,ri as a8,U as a9,Ye as aA,st as aB,Dt as aC,Ot as aD,ut as aE,Gt as aF,Ci as aG,xi as aH,Me as aI,oi as aJ,yi as aK,Oe as aL,bi as aM,ki as aN,zt as aa,we as ab,Kt as ac,f as ad,Oi as ae,si as af,Ve as ag,Ti as ah,Di as ai,be as aj,vi as ak,ge as al,Ie as am,Bi as an,ji as ao,qe as ap,jt as aq,M as ar,Si as as,Pi as at,J as au,ye as av,ve as aw,$e as ax,Mi as ay,Ht as az,z as b,Ue as c,P as d,ei as e,O as f,Jt as g,Fe as h,L as i,li as j,Ei as k,ai as l,De as m,Ne as n,Ee as o,Vt as p,de as q,Je as r,se as s,Qt as t,ni as u,Pe as v,_ as w,R as x,hi as y,Y as z}; +import{ed as ee}from"./index-BjUNJPVf.js";class f{constructor(e){Object.defineProperty(this,"_value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._value=e}get value(){return this._value/100}get percent(){return this._value}toString(){return this._value+"%"}interpolate(e,t){return e+this.value*(t-e)}static normalize(e,t,i){return e instanceof f?e:new f(t===i?0:100*Math.min(Math.max(1/(i-t)*(e-t),0),1))}}function ke(s){return new f(s)}ke(0);const Je=ke(100),qe=ke(50);function Oe(s){return Number(s)!==s}function Qe(s){return{}.toString.call(s)}function _e(s){if(s!=null&&!g(s)){let e=Number(s);return Oe(e)&&Ne(s)&&s!=""?_e(s.replace(/[^0-9.\-]+/g,"")):e}return s}function et(s){if(me(s))return new Date(s);if(g(s))return new Date(s);{let e=Number(s);return g(e)?new Date(e):new Date(s)}}function Wt(s){if(Oe(s))return"NaN";if(s===1/0)return"Infinity";if(s===-1/0)return"-Infinity";if(s===0&&1/s==-1/0)return"-0";let e=s<0;s=Math.abs(s);let t,i=/^([0-9]+)(?:\.([0-9]+))?(?:e[\+\-]([0-9]+))?$/.exec(""+s),r=i[1],a=i[2]||"";if(i[3]===void 0)t=a===""?r:r+"."+a;else{let n=+i[3];if(s<1)t="0."+je("0",n-1)+r+a;else{let o=n-a.length;t=o===0?r+a:o<0?r+a.slice(0,o)+"."+a.slice(o):r+a+je("0",o)}}return e?"-"+t:t}function je(s,e){return new Array(e+1).join(s)}function me(s){return Qe(s)==="[object Date]"}function Ne(s){return typeof s=="string"}function g(s){return typeof s=="number"&&Number(s)==s}function Re(s){return typeof s=="object"&&s!==null}const Ee="__§§§__",Vt="__§§§§__";function re(s,e){const t=s.length;for(let i=0;i0;)--t,e(s[t],t)}function Kt(s,e){const t=s.length;for(let i=0;i0;)if(--t,e(s[t],t))return t;return-1}function st(s,e){const t=We(s,e);if(t!==-1)return s[t]}function rt(s,e){const t=it(s,e);if(t!==-1)return s[t]}function at(s,e){let t=0,i=s.length,r=!1;for(;t>1,n=e(s[a]);n<0?t=a+1:n===0?(r=!0,t=a+1):i=a}return{found:r,index:r?t-1:t}}function nt(s,e){let t=0,i=s.length,r=!1;for(;t>1,n=e(s[a]);n<0?t=a+1:(n===0&&(r=!0),i=a)}return{found:r,index:t}}function Yt(s,e){let t=s.length;for(;t>0;)--t,e(s[t])||s.splice(t,1)}function T(s){return Object.keys(s)}function ot(s,e){return T(s).sort(e)}function Xt(s){return Object.assign({},s)}function y(s,e){T(s).forEach(t=>{e(t,s[t])})}function $t(s,e){for(let t in s)if(ht(s,t)&&!e(t,s[t]))break}function ht(s,e){return{}.hasOwnProperty.call(s,e)}class Ve{constructor(){Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposed=!1}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class P{constructor(e){Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dispose",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposed=!1,this._dispose=e}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class Zt extends Ve{constructor(){super(...arguments),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}_dispose(){_(this._disposers,e=>{e.dispose()})}}class k extends Ve{constructor(e){super(),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposers=e}_dispose(){_(this._disposers,e=>{e.dispose()})}get disposers(){return this._disposers}}class lt extends P{constructor(){super(...arguments),Object.defineProperty(this,"_counter",{enumerable:!0,configurable:!0,writable:!0,value:0})}increment(){return++this._counter,new P(()=>{--this._counter,this._counter===0&&this.dispose()})}}function Jt(s){s.parentNode&&s.parentNode.removeChild(s)}function Ue(s,e,t,i){return s.addEventListener(e,t,i||!1),new P(()=>{s.removeEventListener(e,t,i||!1)})}function qt(s){return Ue(window,"resize",e=>{s()})}function de(s){switch(s){case"touchevents":return window.hasOwnProperty("TouchEvent");case"pointerevents":return window.hasOwnProperty("PointerEvent");case"mouseevents":return window.hasOwnProperty("MouseEvent");case"wheelevents":return window.hasOwnProperty("WheelEvent");case"keyboardevents":return window.hasOwnProperty("KeyboardEvent")}return!1}function ue(s){return s.pointerId||0}function Qt(){if(document.activeElement&&document.activeElement!=document.body)if(document.activeElement.blur)document.activeElement.blur();else{let s=document.createElement("button");s.style.position="fixed",s.style.top="0px",s.style.left="-10000px",document.body.appendChild(s),s.focus(),s.blur(),document.body.removeChild(s)}}function ei(s){s&&s.focus()}function ti(s){if(de("pointerevents"))return s;if(de("touchevents"))switch(s){case"pointerover":case"pointerdown":return"touchstart";case"pointerout":case"pointerleave":case"pointerup":return"touchend";case"pointermove":return"touchmove";case"click":return"click";case"dblclick":return"dblclick"}else if(de("mouseevents"))switch(s){case"pointerover":return"mouseover";case"pointerout":return"mouseout";case"pointerleave":return"mouseleave";case"pointerdown":return"mousedown";case"pointermove":return"mousemove";case"pointerup":return"mouseup";case"click":return"click";case"dblclick":return"dblclick"}return s}function Me(s){if(typeof Touch<"u"&&s instanceof Touch)return!0;if(typeof PointerEvent<"u"&&s instanceof PointerEvent&&s.pointerType!=null)switch(s.pointerType){case"touch":case"pen":case 2:return!0;case"mouse":case 4:return!1;default:return!(s instanceof MouseEvent)}else if(s.type!=null&&s.type.match(/^mouse/))return!1;return!0}function ii(s,e,t){s.style[e]=t}function si(s,e){return s.style[e]}function ri(s){if(s.composedPath){const e=s.composedPath();return e.length===0?null:e[0]}return s.target}function dt(s,e){let t=e;for(;;){if(s===t)return!0;if(t.parentNode===null){if(t.host==null)return!1;t=t.host}else t=t.parentNode}}function ut(s,e){return s.target&&dt(e.root.dom,s.target)}function ai(s,e){s.style.pointerEvents=e?"auto":"none"}function pt(){return/apple/i.test(navigator.vendor)&&"ontouchend"in document}function ni(){return pt()?1:void 0}function M(s,e){return g(s)?s:s!=null&&g(s.value)&&g(e)?e*s.value:0}function oi(s){let e=(""+s).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return e?Math.max(0,(e[1]?e[1].length:0)-(e[2]?+e[2]:0)):0}function pe(s,e=0,t="0"){return typeof s!="string"&&(s=s.toString()),e>s.length?Array(e-s.length+1).join(t)+s:s}function ct(s){return s.replace(/^[\s]*/,"")}function gt(s){return s.replace(/[\s]*$/,"")}function be(s){return ct(gt(s))}function _t(s,e,t=!1,i="..."){if(s.length>e){let r=e-1;for(;r>=0&&s.charAt(r).match(/\w/);)r--;return r>=0&&t==0?s.substring(0,r+1)+"...":s.substring(0,e)+i}return s}function mt(s){if(s===void 0)return"string";let e=(s=(s=(s=s.toLowerCase().replace(/^\[[^\]]*\]/,"")).replace(/\[[^\]]+\]/,"")).trim()).match(/\/(date|number|duration)$/);return e?e[1]:s==="number"?"number":s==="date"?"date":s==="duration"?"duration":s.match(/[#0]/)?"number":s.match(/[ymwdhnsqaxkzgtei]/)?"date":"string"}function hi(s){return s.replace(/\/(date|number|duration)$/i,"")}function li(s){return s&&s.replace(/<[^>]*>/g,"")}function di(s){return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function ui(s,e=!1){const t=new Date(s.getFullYear(),0,0),i=s.getTime()-t.getTime()+60*(t.getTimezoneOffset()-s.getTimezoneOffset())*1e3;return Math.floor(i/864e5)}function Be(s,e=!1){const t=new Date(Date.UTC(s.getFullYear(),s.getMonth(),s.getDate())),i=t.getUTCDay()||7;t.setUTCDate(t.getUTCDate()+4-i);const r=new Date(Date.UTC(t.getUTCFullYear(),0,1));return Math.ceil(((t.getTime()-r.getTime())/864e5+1)/7)}function pi(s,e=!1){const t=new Date(Date.UTC(s.getFullYear(),s.getMonth(),s.getDate())),i=t.getUTCDay()||7;return t.setUTCDate(t.getUTCDate()+4-i),new Date(Date.UTC(t.getUTCFullYear(),0,1)).getFullYear()}function ci(s,e=!1){const t=Be(new Date(s.getFullYear(),s.getMonth(),1),e);let i=Be(s,e);return i==1&&(i=53),i-t+1}function gi(s,e,t=1,i=!1){let r=new Date(e,0,4,0,0,0,0);return i&&r.setUTCFullYear(e),7*s+t-((r.getDay()||7)+3)}function _i(s,e){return s>12?s-=12:s===0&&(s=12),e!=null?s+(e-1):s}function mi(s,e=!1,t=!1,i=!1,r){if(i)return e?"Coordinated Universal Time":"UTC";if(r){const o=s.toLocaleString("en-US",{timeZone:r});return be(s.toLocaleString("en-US",{timeZone:r,timeZoneName:e?"long":"short"}).substr(o.length))}let a=s.toLocaleString("UTC"),n=s.toLocaleString("UTC",{timeZoneName:e?"long":"short"}).substr(a.length);return t===!1&&(n=n.replace(/ (standard|daylight|summer|winter) /i," ")),be(n)}function fi(s){const e=new Date(Date.UTC(2012,0,1,0,0,0,0)),t=new Date(e.toLocaleString("en-US",{timeZone:"UTC"}));return(new Date(e.toLocaleString("en-US",{timeZone:s})).getTime()-t.getTime())/6e4*-1}function bi(s){return s.charAt(0).toUpperCase()+s.slice(1)}function Ke(s){let e,t,i,r=s.h,a=s.s,n=s.l;if(a==0)e=t=i=n;else{let o=function(d,p,u){return u<0&&(u+=1),u>1&&(u-=1),u<.16666666666666666?d+6*(p-d)*u:u<.5?p:u<.6666666666666666?d+(p-d)*(.6666666666666666-u)*6:d},h=n<.5?n*(1+a):n+a-n*a,l=2*n-h;e=o(l,h,r+1/3),t=o(l,h,r),i=o(l,h,r-1/3)}return{r:Math.round(255*e),g:Math.round(255*t),b:Math.round(255*i)}}function Ge(s){let e=s.r/255,t=s.g/255,i=s.b/255,r=Math.max(e,t,i),a=Math.min(e,t,i),n=0,o=0,h=(r+a)/2;if(r===a)n=o=0;else{let l=r-a;switch(o=h>.5?l/(2-r-a):l/(r+a),r){case e:n=(t-i)/l+(t0?255-s:s;return Math.round(t*e)}function bt(s,e){if(s){let t=ie(Math.min(Math.max(s.r,s.g,s.b),230),e);return{r:Math.max(0,Math.min(255,Math.round(s.r+t))),g:Math.max(0,Math.min(255,Math.round(s.g+t))),b:Math.max(0,Math.min(255,Math.round(s.b+t))),a:s.a}}return s}function Ae(s){return(299*s.r+587*s.g+114*s.b)/1e3>=128}function vt(s,e){if(s===void 0||e==1)return s;let t=Ge(s);return t.s=e,Ke(t)}function yt(s,e={r:255,g:255,b:255},t={r:255,g:255,b:255}){let i=e,r=t;return Ae(t)&&(i=t,r=e),Ae(s)?r:i}function vi(s,e){return s||(s=[]),[...s,...e].filter((t,i,r)=>r.indexOf(t)===i)}function yi(s,e){return!!e&&s.left==e.left&&s.right==e.right&&s.top==e.top&&s.bottom==e.bottom}function ze(s){return s[0]==="#"&&(s=s.substr(1)),s.length==3&&(s=s[0].repeat(2)+s[1].repeat(2)+s[2].repeat(2)),parseInt(s,16)}function wt(s){let e=(s=s.replace(/[ ]/g,"")).match(/^rgb\(([0-9]*),([0-9]*),([0-9]*)\)/i);if(e)e.push("1");else if(e=s.match(/^rgba\(([0-9]*),([0-9]*),([0-9]*),([.0-9]*)\)/i),!e)return 0;let t="";for(let i=1;i<=3;i++){let r=parseInt(e[i]).toString(16);r.length==1&&(r="0"+r),t+=r}return ze(t)}function wi(s){return v.fromAny(s)}class v{constructor(e){Object.defineProperty(this,"_hex",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hex=0|e}get hex(){return this._hex}get r(){return this._hex>>>16}get g(){return this._hex>>8&255}get b(){return 255&this._hex}toCSS(e=1){return"rgba("+this.r+", "+this.g+", "+this.b+", "+e+")"}toCSSHex(){return"#"+pe(this.r.toString(16),2)+pe(this.g.toString(16),2)+pe(this.b.toString(16),2)}toHSL(e=1){return Ge({r:this.r,g:this.g,b:this.b,a:e})}static fromHSL(e,t,i){const r=Ke({h:e,s:t,l:i});return this.fromRGB(r.r,r.g,r.b)}toString(){return this.toCSSHex()}static fromHex(e){return new v(e)}static fromRGB(e,t,i){return new v((0|i)+(t<<8)+(e<<16))}static fromString(e){return new v(ze(e))}static fromCSS(e){return new v(wt(e))}static fromAny(e){if(Ne(e)){if(e[0]=="#")return v.fromString(e);if(e.substr(0,3)=="rgb")return v.fromCSS(e)}else{if(g(e))return v.fromHex(e);if(e instanceof v)return v.fromHex(e.hex)}throw new Error("Unknown color syntax: "+e)}static alternative(e,t,i){const r=yt({r:e.r,g:e.g,b:e.b},t?{r:t.r,g:t.g,b:t.b}:void 0,i?{r:i.r,g:i.g,b:i.b}:void 0);return this.fromRGB(r.r,r.g,r.b)}static interpolate(e,t,i,r="rgb"){if(r=="hsl"){const a=t.toHSL(),n=i.toHSL();return v.fromHSL(B(e,a.h,n.h),B(e,a.s,n.s),B(e,a.l,n.l))}return v.fromRGB(B(e,t.r,i.r),B(e,t.g,i.g),B(e,t.b,i.b))}static lighten(e,t){const i=ft({r:e.r,g:e.g,b:e.b},t);return v.fromRGB(i.r,i.g,i.b)}static brighten(e,t){const i=bt({r:e.r,g:e.g,b:e.b},t);return v.fromRGB(i.r,i.g,i.b)}static saturate(e,t){const i=vt({r:e.r,g:e.g,b:e.b},t);return v.fromRGB(i.r,i.g,i.b)}}class q{constructor(){Object.defineProperty(this,"_listeners",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_killed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_iterating",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_enabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._listeners=[],this._killed=[],this._disabled={},this._iterating=0,this._enabled=!0,this._disposed=!1}isDisposed(){return this._disposed}dispose(){if(!this._disposed){this._disposed=!0;const e=this._listeners;this._iterating=1,this._listeners=null,this._disabled=null;try{_(e,t=>{t.disposer.dispose()})}finally{this._killed=null,this._iterating=null}}}hasListeners(){return this._listeners.length!==0}hasListenersByType(e){return tt(this._listeners,t=>(t.type===null||t.type===e)&&!t.killed)}enable(){this._enabled=!0}disable(){this._enabled=!1}enableType(e){delete this._disabled[e]}disableType(e,t=1/0){this._disabled[e]=t}_removeListener(e){if(this._iterating===0){const t=this._listeners.indexOf(e);if(t===-1)throw new Error("Invalid state: could not remove listener");this._listeners.splice(t,1)}else this._killed.push(e)}_removeExistingListener(e,t,i,r){if(this._disposed)throw new Error("EventDispatcher is disposed");this._eachListener(a=>{a.once!==e||a.type!==t||i!==void 0&&a.callback!==i||a.context!==r||a.disposer.dispose()})}isEnabled(e){if(this._disposed)throw new Error("EventDispatcher is disposed");return this._enabled&&this._listeners.length>0&&this.hasListenersByType(e)&&this._disabled[e]===void 0}removeType(e){if(this._disposed)throw new Error("EventDispatcher is disposed");this._eachListener(t=>{t.type===e&&t.disposer.dispose()})}has(e,t,i){return We(this._listeners,r=>r.once!==!0&&r.type===e&&(t===void 0||r.callback===t)&&r.context===i)!==-1}_shouldDispatch(e){if(this._disposed)throw new Error("EventDispatcher is disposed");const t=this._disabled[e];return g(t)?(t<=1?delete this._disabled[e]:--this._disabled[e],!1):this._enabled}_eachListener(e){++this._iterating;try{_(this._listeners,e)}finally{--this._iterating,this._iterating===0&&this._killed.length!==0&&(_(this._killed,t=>{this._removeListener(t)}),this._killed.length=0)}}dispatch(e,t){this._shouldDispatch(e)&&this._eachListener(i=>{i.killed||i.type!==null&&i.type!==e||i.dispatch(e,t)})}_on(e,t,i,r,a,n){if(this._disposed)throw new Error("EventDispatcher is disposed");this._removeExistingListener(e,t,i,r);const o={type:t,callback:i,context:r,shouldClone:a,dispatch:n,killed:!1,once:e,disposer:new P(()=>{o.killed=!0,this._removeListener(o)})};return this._listeners.push(o),o}onAll(e,t,i=!0){return this._on(!1,null,e,t,i,(r,a)=>e.call(t,a)).disposer}on(e,t,i,r=!0){return this._on(!1,e,t,i,r,(a,n)=>t.call(i,n)).disposer}once(e,t,i,r=!0){const a=this._on(!0,e,t,i,r,(n,o)=>{a.disposer.dispose(),t.call(i,o)});return a.disposer}off(e,t,i){this._removeExistingListener(!1,e,t,i)}copyFrom(e){if(this._disposed)throw new Error("EventDispatcher is disposed");if(e===this)throw new Error("Cannot copyFrom the same TargetedEventDispatcher");const t=[];return _(e._listeners,i=>{!i.killed&&i.shouldClone&&(i.type===null?t.push(this.onAll(i.callback,i.context)):i.once?t.push(this.once(i.type,i.callback,i.context)):t.push(this.on(i.type,i.callback,i.context)))}),new k(t)}}function He(s){return ee(this,void 0,void 0,function*(){if(s!==void 0){const e=[];y(s,(t,i)=>{e.push(i.waitForStop())}),yield Promise.all(e)}})}function B(s,e,t){return e+s*(t-e)}function Pt(s,e,t){return s>=1?t:e}function Dt(s,e,t){return new f(B(s,e.percent,t.percent))}function xt(s,e,t){return v.interpolate(s,e,t)}function kt(s,e){return typeof s=="number"&&typeof e=="number"?B:s instanceof f&&e instanceof f?Dt:s instanceof v&&e instanceof v?xt:Pt}var U;function W(s,e){if(!(s>=0&&s=0&&e{this.push(t)})}copyFrom(e){this.pushAll(e._values)}pop(){return this._values.length-1<0?void 0:this.removeIndex(this._values.length-1)}shift(){return this._values.length?this.removeIndex(0):void 0}setAll(e){const t=this._values;this._values=[],this._onClear(t),_(e,i=>{this._values.push(i),this._onPush(i)})}clear(){this.setAll([])}*[Symbol.iterator](){const e=this._values.length;for(let t=0;t{t.dispose()}),super._onClear(e)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this.autoDispose&&_(this._values,e=>{e.dispose()}))}}class Pi extends Ot{constructor(e,t){super(),Object.defineProperty(this,"template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"make",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.template=e,this.make=t}}class Tt extends Ye{constructor(e){super(),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_events",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._container=e,this._events=this.events.onAll(t=>{if(t.type==="clear")_(t.oldValues,i=>{this._onRemoved(i)});else if(t.type==="push")this._onInserted(t.newValue);else if(t.type==="setIndex")this._onRemoved(t.oldValue),this._onInserted(t.newValue,t.index);else if(t.type==="insertIndex")this._onInserted(t.newValue,t.index);else if(t.type==="removeIndex")this._onRemoved(t.oldValue);else{if(t.type!=="moveIndex")throw new Error("Unknown IListEvent type");this._onRemoved(t.value),this._onInserted(t.value,t.newIndex)}})}_onInserted(e,t){e._setParent(this._container,!0);const i=this._container._childrenDisplay;t===void 0?i.addChild(e._display):i.addChildAt(e._display,t)}_onRemoved(e){this._container._childrenDisplay.removeChild(e._display),this._container.markDirtyBounds(),this._container.markDirty()}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._events.dispose(),_(this.values,e=>{e.dispose()}))}}const Xe=Math.PI,$e=Xe/180,Di=180/Xe;function xi(s,e,t){if(!g(e)||e<=0){let i=Math.round(s);return t&&i-s==.5&&i--,i}{let i=Math.pow(10,e);return Math.round(s*i)/i}}function ki(s,e){if(!g(e)||e<=0)return Math.ceil(s);{let t=Math.pow(10,e);return Math.ceil(s*t)/t}}function Ie(s,e,t){return Math.min(Math.max(s,e),t)}function ve(s){return Math.sin($e*s)}function ye(s){return Math.cos($e*s)}function Oi(s){return(s%=360)<0&&(s+=360),s}function Ti(s,e,t,i,r){let a=Number.MAX_VALUE,n=Number.MAX_VALUE,o=-Number.MAX_VALUE,h=-Number.MAX_VALUE,l=[];l.push(ce(r,t)),l.push(ce(r,i));let d=Math.min(90*Math.floor(t/90),90*Math.floor(i/90)),p=Math.max(90*Math.ceil(t/90),90*Math.ceil(i/90));for(let u=d;u<=p;u+=90)u>=t&&u<=i&&l.push(ce(r,u));for(let u=0;uo&&(o=c.x),c.y>h&&(h=c.y)}return{left:s+a,top:e+n,right:s+o,bottom:e+h}}function ce(s,e){return{x:s*ye(e),y:s*ve(e)}}function Si(s){const e=s.length;if(e>0){let t=s[0],i=t.left,r=t.top,a=t.right,n=t.bottom;if(e>1)for(let o=1;o=e.left&&s.y>=e.top&&s.x<=e.right&&s.y<=e.bottom}function Le(s){return s}function jt(s){return s*s*s}function ji(s){return function(e){return 1-s(1-e)}}class Et{constructor(e,t){Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._entity=e,this._settings=t,y(t,i=>{this._userSettings[i]=!0})}get(e,t){const i=this._settings[e];return i!==void 0?i:t}setRaw(e,t){this._settings[e]=t}set(e,t){this._userSettings[e]=!0,this.setRaw(e,t)}remove(e){delete this._userSettings[e],delete this._settings[e]}setAll(e){T(e).forEach(t=>{this.set(t,e[t])})}_eachSetting(e){y(this._settings,e)}apply(){const e={stateAnimationEasing:!0,stateAnimationDuration:!0},t=this._entity.states.lookup("default");this._eachSetting((i,r)=>{e[i]||(e[i]=!0,this!==t&&(i in t._settings||(t._settings[i]=this._entity.get(i))),this._entity.set(i,r))})}applyAnimate(e){e==null&&(e=this._settings.stateAnimationDuration),e==null&&(e=this.get("stateAnimationDuration",this._entity.get("stateAnimationDuration",0)));let t=this._settings.stateAnimationEasing;t==null&&(t=this.get("stateAnimationEasing",this._entity.get("stateAnimationEasing",jt)));const i=this._entity.states.lookup("default"),r={stateAnimationEasing:!0,stateAnimationDuration:!0},a={};return this._eachSetting((n,o)=>{if(!r[n]){r[n]=!0,this!=i&&(n in i._settings||(i._settings[n]=this._entity.get(n)));const h=this._entity.animate({key:n,to:o,duration:e,easing:t});h&&(a[n]=h)}}),a}}class Ct{constructor(e){Object.defineProperty(this,"_states",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._entity=e}lookup(e){return this._states[e]}create(e,t){const i=this._states[e];if(i)return i.setAll(t),i;{const r=new Et(this._entity,t);return this._states[e]=r,r}}remove(e){delete this._states[e]}apply(e){const t=this._states[e];t&&t.apply(),this._entity._applyState(e)}applyAnimate(e,t){let i;const r=this._states[e];return r&&(i=r.applyAnimate(t)),this._entity._applyStateAnimated(e,t),i}}class Mt{constructor(){Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.8.0"}),Object.defineProperty(this,"licenses",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"entitiesById",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"rootElements",{enumerable:!0,configurable:!0,writable:!0,value:[]})}}const R=new Mt;function Ei(s){R.licenses.push(s)}function F(s,e){return s===e?0:s{O(i,t)&&this._entity._markDirtyKey(e)})}remove(e){const t=this._callbacks[e];t!==void 0&&(delete this._callbacks[e],t.length!==0&&this._entity._markDirtyKey(e))}enable(e){this._disabled[e]&&(delete this._disabled[e],this._entity._markDirtyKey(e))}disable(e){this._disabled[e]||(this._disabled[e]=!0,this._entity._markDirtyKey(e))}fold(e,t){if(!this._disabled[e]){const i=this._callbacks[e];if(i!==void 0)for(let r=0,a=i.length;r{if(this._stopped)e();else{const i=()=>{r.dispose(),e()},r=this.events.on("stopped",i)}})}_checkEnded(){return!(this._loops>1)||(--this._loops,!1)}_run(e){this._oldTime!==null&&(this._time+=e-this._oldTime,this._time>this._duration&&(this._time=this._duration)),this._oldTime=e}_reset(e){this._oldTime=e,this._time=0}_value(e){return this._interpolate(this._easing(e),this._from,this._to)}}let At=0;class Ht{constructor(e){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:++At}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_privateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_settingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_privateSettingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_prevSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_prevPrivateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_animatingSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_animatingPrivateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_userProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._settings=e}_checkDirty(){T(this._settings).forEach(e=>{this._userProperties[e]=!0,this._markDirtyKey(e)})}resetUserSettings(){this._userProperties={}}_runAnimation(e){let t=U.Stopped;if(!this.isDisposed()){let i=!1,r=!1;y(this._animatingSettings,(a,n)=>{if(n.stopped)this._stopAnimation(a);else if(n.playing){n._run(e);const o=n.percentage;o>=1?n._checkEnded()?this.set(a,n._value(1)):(i=!0,n._reset(e),this._set(a,n._value(1))):(i=!0,this._set(a,n._value(o)))}else r=!0}),y(this._animatingPrivateSettings,(a,n)=>{if(n.stopped)this._stopAnimationPrivate(a);else if(n.playing){n._run(e);const o=n.percentage;o>=1?n._checkEnded()?this.setPrivate(a,n._value(1)):(i=!0,n._reset(e),this._setPrivate(a,n._value(1))):(i=!0,this._setPrivate(a,n._value(o)))}else r=!0}),i?t=U.Playing:r&&(t=U.Paused)}return t}_markDirtyKey(e){this.markDirty()}_markDirtyPrivateKey(e){this.markDirty()}on(e,t){let i=this._settingEvents[e];return i===void 0&&(i=this._settingEvents[e]=[]),i.push(t),new P(()=>{O(i,t),i.length===0&&delete this._settingEvents[e]})}onPrivate(e,t){let i=this._privateSettingEvents[e];return i===void 0&&(i=this._privateSettingEvents[e]=[]),i.push(t),new P(()=>{O(i,t),i.length===0&&delete this._privateSettingEvents[e]})}getRaw(e,t){const i=this._settings[e];return i!==void 0?i:t}get(e,t){return this.getRaw(e,t)}_sendKeyEvent(e,t){const i=this._settingEvents[e];i!==void 0&&_(i,r=>{r(t,this,e)})}_sendPrivateKeyEvent(e,t){const i=this._privateSettingEvents[e];i!==void 0&&_(i,r=>{r(t,this,e)})}_setRaw(e,t,i){this._prevSettings[e]=t,this._sendKeyEvent(e,i)}setRaw(e,t){const i=this._settings[e];this._settings[e]=t,i!==t&&this._setRaw(e,i,t)}_set(e,t){const i=this._settings[e];this._settings[e]=t,i!==t&&(this._setRaw(e,i,t),this._markDirtyKey(e))}_stopAnimation(e){const t=this._animatingSettings[e];t&&(delete this._animatingSettings[e],t.stop())}set(e,t){return this._set(e,t),this._stopAnimation(e),t}remove(e){e in this._settings&&(this._prevSettings[e]=this._settings[e],delete this._settings[e],this._sendKeyEvent(e,void 0),this._markDirtyKey(e)),this._stopAnimation(e)}removeAll(){_(T(this._settings),e=>{this.remove(e)})}getPrivate(e,t){const i=this._privateSettings[e];return i!==void 0?i:t}_setPrivateRaw(e,t,i){this._prevPrivateSettings[e]=t,this._sendPrivateKeyEvent(e,i)}setPrivateRaw(e,t){const i=this._privateSettings[e];this._privateSettings[e]=t,i!==t&&this._setPrivateRaw(e,i,t)}_setPrivate(e,t){const i=this._privateSettings[e];this._privateSettings[e]=t,i!==t&&(this._setPrivateRaw(e,i,t),this._markDirtyPrivateKey(e))}_stopAnimationPrivate(e){const t=this._animatingPrivateSettings[e];t&&(t.stop(),delete this._animatingPrivateSettings[e])}setPrivate(e,t){return this._setPrivate(e,t),this._stopAnimationPrivate(e),t}removePrivate(e){e in this._privateSettings&&(this._prevPrivateSettings[e]=this._privateSettings[e],delete this._privateSettings[e],this._markDirtyPrivateKey(e)),this._stopAnimationPrivate(e)}setAll(e){y(e,(t,i)=>{this.set(t,i)})}animate(e){const t=e.key,i=e.to,r=e.duration||0,a=e.loops||1,n=e.from===void 0?this.get(t):e.from,o=e.easing===void 0?Le:e.easing;if(r===0)this.set(t,i);else{if(n!==void 0&&n!==i){this.set(t,n);const l=this._animatingSettings[t]=new Q(this,n,i,r,o,a,this._animationTime());return this._startAnimation(),l}this.set(t,i)}const h=new Q(this,n,i,r,o,a,null);return h.stop(),h}animatePrivate(e){const t=e.key,i=e.to,r=e.duration||0,a=e.loops||1,n=e.from===void 0?this.getPrivate(t):e.from,o=e.easing===void 0?Le:e.easing;if(r===0)this.setPrivate(t,i);else{if(n!==void 0&&n!==i){this.setPrivate(t,n);const l=this._animatingPrivateSettings[t]=new Q(this,n,i,r,o,a,this._animationTime());return this._startAnimation(),l}this.setPrivate(t,i)}const h=new Q(this,n,i,r,o,a,null);return h.stop(),h}_dispose(){}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class A extends Ht{constructor(e,t,i,r=[]){if(super(t),Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_user_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"states",{enumerable:!0,configurable:!0,writable:!0,value:new Ct(this)}),Object.defineProperty(this,"adapters",{enumerable:!0,configurable:!0,writable:!0,value:new Bt(this)}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:this._createEvents()}),Object.defineProperty(this,"_userPrivateProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirty",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyPrivate",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_templates",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_internalTemplates",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_defaultThemes",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_templateDisposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_runSetup",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_disposerProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),!i)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this._root=e,this._internalTemplates=r,t.id&&this._registerId(t.id)}static new(e,t,i){const r=new this(e,t,!0);return r._template=i,r._afterNew(),r}static _new(e,t,i=[]){const r=new this(e,t,!0,i);return r._afterNew(),r}_afterNew(){this._checkDirty();let e=!1;const t=this._template;t&&(e=!0,t._setObjectTemplate(this)),_(this._internalTemplates,i=>{e=!0,i._setObjectTemplate(this)}),e&&this._applyTemplates(!1),this.states.create("default",{}),this._setDefaults()}_afterNewApplyThemes(){this._checkDirty();const e=this._template;e&&e._setObjectTemplate(this),_(this._internalTemplates,t=>{t._setObjectTemplate(this)}),this.states.create("default",{}),this._setDefaults(),this._applyThemes()}_createEvents(){return new q}get classNames(){return this.constructor.classNames}get className(){return this.constructor.className}_setDefaults(){}_setDefault(e,t){e in this._settings||super.set(e,t)}_setRawDefault(e,t){e in this._settings||super.setRaw(e,t)}_clearDirty(){T(this._dirty).forEach(e=>{this._dirty[e]=!1}),T(this._dirtyPrivate).forEach(e=>{this._dirtyPrivate[e]=!1})}isDirty(e){return!!this._dirty[e]}isPrivateDirty(e){return!!this._dirtyPrivate[e]}_markDirtyKey(e){this._dirty[e]=!0,super._markDirtyKey(e)}_markDirtyPrivateKey(e){this._dirtyPrivate[e]=!0,super._markDirtyKey(e)}isType(e){return this.classNames.indexOf(e)!==-1}_pushPropertyDisposer(e,t){let i=this._disposerProperties[e];return i===void 0&&(i=this._disposerProperties[e]=[]),i.push(t),t}_disposeProperty(e){const t=this._disposerProperties[e];t!==void 0&&(_(t,i=>{i.dispose()}),delete this._disposerProperties[e])}set template(e){const t=this._template;t!==e&&(this._template=e,t&&t._removeObjectTemplate(this),e&&e._setObjectTemplate(this),this._applyTemplates())}get template(){return this._template}markDirty(){this._root._addDirtyEntity(this)}_startAnimation(){this._root._addAnimation(this)}_animationTime(){return this._root.animationTime}_applyState(e){}_applyStateAnimated(e,t){}get(e,t){const i=this.adapters.fold(e,this._settings[e]);return i!==void 0?i:t}isUserSetting(e){return this._userProperties[e]||!1}set(e,t){return this._userProperties[e]=!0,super.set(e,t)}setRaw(e,t){this._userProperties[e]=!0,super.setRaw(e,t)}_setSoft(e,t){return this._userProperties[e]?t:super.set(e,t)}remove(e){delete this._userProperties[e],this._removeTemplateProperty(e)}setPrivate(e,t){return this._userPrivateProperties[e]=!0,super.setPrivate(e,t)}setPrivateRaw(e,t){this._userPrivateProperties[e]=!0,super.setPrivateRaw(e,t)}removePrivate(e){delete this._userPrivateProperties[e],this._removeTemplatePrivateProperty(e)}_setTemplateProperty(e,t,i){this._userProperties[t]||e===this._findTemplateByKey(t)&&super.set(t,i)}_setTemplatePrivateProperty(e,t,i){this._userPrivateProperties[t]||e===this._findTemplateByPrivateKey(t)&&super.setPrivate(t,i)}_removeTemplateProperty(e){if(!this._userProperties[e]){const t=this._findTemplateByKey(e);t?super.set(e,t._settings[e]):super.remove(e)}}_removeTemplatePrivateProperty(e){if(!this._userPrivateProperties[e]){const t=this._findTemplateByPrivateKey(e);t?super.setPrivate(e,t._privateSettings[e]):super.removePrivate(e)}}_walkParents(e){e(this._root._rootContainer),e(this)}_applyStateByKey(e){const t=this.states.create(e,{}),i={};this._eachTemplate(r=>{const a=r.states.lookup(e);a&&a._apply(t,i)}),y(t._settings,r=>{i[r]||t._userSettings[r]||t.remove(r)})}_applyTemplate(e,t){this._templateDisposers.push(e._apply(this,t)),y(e._settings,(i,r)=>{t.settings[i]||this._userProperties[i]||(t.settings[i]=!0,super.set(i,r))}),y(e._privateSettings,(i,r)=>{t.privateSettings[i]||this._userPrivateProperties[i]||(t.privateSettings[i]=!0,super.setPrivate(i,r))}),this._runSetup&&e.setup&&(this._runSetup=!1,e.setup(this))}_findStaticTemplate(e){if(this._template&&e(this._template))return this._template}_eachTemplate(e){this._findStaticTemplate(t=>(e(t),!1)),V(this._internalTemplates,e),_(this._templates,e)}_applyTemplates(e=!0){e&&this._disposeTemplates();const t={settings:{},privateSettings:{},states:{}};this._eachTemplate(i=>{this._applyTemplate(i,t)}),e&&(y(this._settings,i=>{this._userProperties[i]||t.settings[i]||super.remove(i)}),y(this._privateSettings,i=>{this._userPrivateProperties[i]||t.privateSettings[i]||super.removePrivate(i)}))}_findTemplate(e){const t=this._findStaticTemplate(e);if(t===void 0){const i=rt(this._internalTemplates,e);return i===void 0?st(this._templates,e):i}return t}_findTemplateByKey(e){return this._findTemplate(t=>e in t._settings)}_findTemplateByPrivateKey(e){return this._findTemplate(t=>e in t._privateSettings)}_disposeTemplates(){_(this._templateDisposers,e=>{e.dispose()}),this._templateDisposers.length=0}_removeTemplates(){_(this._templates,e=>{e._removeObjectTemplate(this)}),this._templates.length=0}_applyThemes(e=!1){let t=!1;const i=[];let r=[];const a=new Set,n=this.get("themeTagsSelf");return n&&_(n,o=>{a.add(o)}),this._walkParents(o=>{o===this._root._rootContainer&&(t=!0),o._defaultThemes.length>0&&i.push(o._defaultThemes);const h=o.get("themes");h&&r.push(h);const l=o.get("themeTags");l&&_(l,d=>{a.add(d)})}),r=i.concat(r),this._removeTemplates(),(t||e)&&V(this.classNames,o=>{const h=[];_(r,l=>{_(l,d=>{const p=d._lookupRules(o);p&&V(p,u=>{if(u.tags.every(c=>a.has(c))){const c=nt(h,m=>{const b=F(u.tags.length,m.tags.length);return b===0?Ze(u.tags,m.tags,F):b});h.splice(c.index,0,u)}})})}),_(h,l=>{this._templates.push(l.template),l.template._setObjectTemplate(this)})}),this._applyTemplates(),(t||e)&&(this._runSetup=!1),t||e}_changed(){}_beforeChanged(){if(this.isDirty("id")){const e=this.get("id");e&&this._registerId(e);const t=this._prevSettings.id;t&&delete R.entitiesById[t]}}_registerId(e){if(R.entitiesById[e]&&R.entitiesById[e]!==this)throw new Error('An entity with id "'+e+'" already exists.');R.entitiesById[e]=this}_afterChanged(){}addDisposer(e){return this._disposers.push(e),e}_dispose(){super._dispose();const e=this._template;e&&e._removeObjectTemplate(this),_(this._internalTemplates,i=>{i._removeObjectTemplate(this)}),this._removeTemplates(),this._disposeTemplates(),this.events.dispose(),this._disposers.forEach(i=>{i.dispose()}),y(this._disposerProperties,(i,r)=>{_(r,a=>{a.dispose()})});const t=this.get("id");t&&delete R.entitiesById[t]}setTimeout(e,t){const i=setTimeout(()=>{this.removeDispose(r),e()},t),r=new P(()=>{clearTimeout(i)});return this._disposers.push(r),r}removeDispose(e){if(!this.isDisposed()){let t=re(this._disposers,e);t>-1&&this._disposers.splice(t,1)}e.dispose()}hasTag(e){return re(this.get("themeTags",[]),e)!==-1}addTag(e){if(!this.hasTag(e)){const t=this.get("themeTags",[]);t.push(e),this.set("themeTags",t)}}removeTag(e){if(this.hasTag(e)){const t=this.get("themeTags",[]);Fe(t,e),this.set("themeTags",t)}}_t(e,t,...i){return this._root.language.translate(e,t,...i)}get root(){return this._root}}Object.defineProperty(A,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Entity"}),Object.defineProperty(A,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:["Entity"]});class It{constructor(e,t,i){Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._name=e,this._template=t,this._settings=i}get(e,t){const i=this._settings[e];return i!==void 0?i:t}set(e,t){this._settings[e]=t,this._template._stateChanged(this._name)}remove(e){delete this._settings[e],this._template._stateChanged(this._name)}setAll(e){T(e).forEach(t=>{this._settings[t]=e[t]}),this._template._stateChanged(this._name)}_apply(e,t){y(this._settings,(i,r)=>{t[i]||e._userSettings[i]||(t[i]=!0,e.setRaw(i,r))})}}class Lt{constructor(e){Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_states",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._template=e}lookup(e){return this._states[e]}create(e,t){const i=this._states[e];if(i)return i.setAll(t),i;{const r=new It(e,this._template,t);return this._states[e]=r,this._template._stateChanged(e),r}}remove(e){delete this._states[e],this._template._stateChanged(e)}_apply(e,t){y(this._states,(i,r)=>{let a=t.states[i];a==null&&(a=t.states[i]={});const n=e.states.create(i,{});r._apply(n,a)})}}class Nt{constructor(){Object.defineProperty(this,"_callbacks",{enumerable:!0,configurable:!0,writable:!0,value:{}})}add(e,t){let i=this._callbacks[e];return i===void 0&&(i=this._callbacks[e]=[]),i.push(t),new P(()=>{O(i,t),i.length===0&&delete this._callbacks[e]})}remove(e){this._callbacks[e]!==void 0&&delete this._callbacks[e]}_apply(e){const t=[];return y(this._callbacks,(i,r)=>{_(r,a=>{t.push(e.adapters.add(i,a))})}),new k(t)}}class J{constructor(e,t){if(Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_privateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_settingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_privateSettingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_entities",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"states",{enumerable:!0,configurable:!0,writable:!0,value:new Lt(this)}),Object.defineProperty(this,"adapters",{enumerable:!0,configurable:!0,writable:!0,value:new Nt}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new q}),Object.defineProperty(this,"setup",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!t)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this._settings=e}static new(e){return new J(e,!0)}get entities(){return this._entities}get(e,t){const i=this._settings[e];return i!==void 0?i:t}setRaw(e,t){this._settings[e]=t}set(e,t){this._settings[e]!==t&&(this.setRaw(e,t),this._entities.forEach(i=>{i._setTemplateProperty(this,e,t)}))}remove(e){e in this._settings&&(delete this._settings[e],this._entities.forEach(t=>{t._removeTemplateProperty(e)}))}removeAll(){y(this._settings,(e,t)=>{this.remove(e)})}getPrivate(e,t){const i=this._privateSettings[e];return i!==void 0?i:t}setPrivateRaw(e,t){return this._privateSettings[e]=t,t}setPrivate(e,t){return this._privateSettings[e]!==t&&(this.setPrivateRaw(e,t),this._entities.forEach(i=>{i._setTemplatePrivateProperty(this,e,t)})),t}removePrivate(e){e in this._privateSettings&&(delete this._privateSettings[e],this._entities.forEach(t=>{t._removeTemplatePrivateProperty(e)}))}setAll(e){y(e,(t,i)=>{this.set(t,i)})}on(e,t){let i=this._settingEvents[e];return i===void 0&&(i=this._settingEvents[e]=[]),i.push(t),new P(()=>{O(i,t),i.length===0&&delete this._settingEvents[e]})}onPrivate(e,t){let i=this._privateSettingEvents[e];return i===void 0&&(i=this._privateSettingEvents[e]=[]),i.push(t),new P(()=>{O(i,t),i.length===0&&delete this._privateSettingEvents[e]})}_apply(e,t){const i=[];return y(this._settingEvents,(r,a)=>{_(a,n=>{i.push(e.on(r,n))})}),y(this._privateSettingEvents,(r,a)=>{_(a,n=>{i.push(e.onPrivate(r,n))})}),this.states._apply(e,t),i.push(this.adapters._apply(e)),i.push(e.events.copyFrom(this.events)),new k(i)}_setObjectTemplate(e){this._entities.push(e)}_removeObjectTemplate(e){Fe(this._entities,e)}_stateChanged(e){this._entities.forEach(t=>{t._applyStateByKey(e)})}}class ae extends q{constructor(e){super(),Object.defineProperty(this,"_sprite",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rendererDisposers",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dispatchParents",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this._sprite=e}_makePointerEvent(e,t){return{type:e,originalEvent:t.event,point:t.point,simulated:t.simulated,native:t.native,target:this._sprite}}_onRenderer(e,t){this._sprite.set("interactive",!0),this._sprite._display.interactive=!0;let i=this._rendererDisposers[e];if(i===void 0){const r=this._sprite._display.on(e,a=>{t.call(this,a)});i=this._rendererDisposers[e]=new lt(()=>{delete this._rendererDisposers[e],r.dispose()})}return i.increment()}_on(e,t,i,r,a,n){const o=super._on(e,t,i,r,a,n),h=ae.RENDERER_EVENTS[t];return h!==void 0&&(o.disposer=new k([o.disposer,this._onRenderer(t,h)])),o}stopParentDispatch(){this._dispatchParents=!1}dispatchParents(e,t){const i=this._dispatchParents;this._dispatchParents=!0;try{this.dispatch(e,t),this._dispatchParents&&this._sprite.parent&&this._sprite.parent.events.dispatchParents(e,t)}finally{this._dispatchParents=i}}}Object.defineProperty(ae,"RENDERER_EVENTS",{enumerable:!0,configurable:!0,writable:!0,value:{click:function(s){this.isEnabled("click")&&!this._sprite.isDragging()&&this._sprite._hasDown()&&!this._sprite._hasMoved(this._makePointerEvent("click",s))&&this.dispatch("click",this._makePointerEvent("click",s))},rightclick:function(s){this.isEnabled("rightclick")&&this.dispatch("rightclick",this._makePointerEvent("rightclick",s))},middleclick:function(s){this.isEnabled("middleclick")&&this.dispatch("middleclick",this._makePointerEvent("middleclick",s))},dblclick:function(s){this.dispatchParents("dblclick",this._makePointerEvent("dblclick",s))},pointerover:function(s){const e=this._sprite;let t=!0;if(e.getPrivate("trustBounds")){e._getBounds();const i=e.globalBounds();St(s.point,i)||(t=!1,e._root._renderer.removeHovering(e._display))}t&&this.isEnabled("pointerover")&&this.dispatch("pointerover",this._makePointerEvent("pointerover",s))},pointerout:function(s){this.isEnabled("pointerout")&&this.dispatch("pointerout",this._makePointerEvent("pointerout",s))},pointerdown:function(s){this.dispatchParents("pointerdown",this._makePointerEvent("pointerdown",s))},pointerup:function(s){this.isEnabled("pointerup")&&this.dispatch("pointerup",this._makePointerEvent("pointerup",s))},globalpointerup:function(s){this.isEnabled("globalpointerup")&&this.dispatch("globalpointerup",this._makePointerEvent("globalpointerup",s))},globalpointermove:function(s){this.isEnabled("globalpointermove")&&this.dispatch("globalpointermove",this._makePointerEvent("globalpointermove",s))},wheel:function(s){this.dispatchParents("wheel",{type:"wheel",target:this._sprite,originalEvent:s.event,point:s.point})}}});class x extends A{constructor(){super(...arguments),Object.defineProperty(this,"_adjustedLocalBounds",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_localBounds",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dataItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_templateField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_sizeDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDragging",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dragEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dragPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isHidden",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isShowing",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isHiding",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_downPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downPoints",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_toggleDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dragDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_hoverDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_focusDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipMoveDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipPointerDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_statesHandled",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this.setPrivateRaw("visible",!0),super._afterNew()}_markDirtyKey(e){super._markDirtyKey(e),e!="x"&&e!="y"&&e!="dx"&&e!="dy"||(this.markDirtyBounds(),this._addPercentagePositionChildren(),this.markDirtyPosition())}_markDirtyPrivateKey(e){super._markDirtyPrivateKey(e),e!="x"&&e!="y"||this.markDirtyPosition()}_removeTemplateField(){this._templateField&&this._templateField._removeObjectTemplate(this)}_createEvents(){return new ae(this)}_processTemplateField(){let e;const t=this.get("templateField");if(t){const i=this.dataItem;if(i){const r=i.dataContext;r&&(e=r[t],e instanceof J||!e||(e=J.new(e)))}}this._templateField!==e&&(this._removeTemplateField(),this._templateField=e,e&&e._setObjectTemplate(this),this._applyTemplates())}_setDataItem(e){const t=this._dataItem;this._dataItem=e,this._processTemplateField();const i="dataitemchanged";e!=t&&this.events.isEnabled(i)&&this.events.dispatch(i,{type:i,target:this,oldDataItem:t,newDataItem:e})}set dataItem(e){this._setDataItem(e)}get dataItem(){if(this._dataItem)return this._dataItem;{let e=this._parent;for(;e;){if(e._dataItem)return e._dataItem;e=e._parent}}}_addPercentageSizeChildren(){let e=this.parent;e&&(this.get("width")instanceof f||this.get("height")instanceof f?Ce(e._percentageSizeChildren,this):O(e._percentageSizeChildren,this))}_addPercentagePositionChildren(){let e=this.parent;e&&(this.get("x")instanceof f||this.get("y")instanceof f?Ce(e._percentagePositionChildren,this):O(e._percentagePositionChildren,this))}markDirtyPosition(){this._root._addDirtyPosition(this)}updatePivotPoint(){const e=this._localBounds;if(e){const t=this.get("centerX");t!=null&&(this._display.pivot.x=e.left+M(t,e.right-e.left));const i=this.get("centerY");i!=null&&(this._display.pivot.y=e.top+M(i,e.bottom-e.top))}}_beforeChanged(){if(super._beforeChanged(),this._handleStates(),this.isDirty("tooltip")){const e=this._prevSettings.tooltip;e&&e.dispose()}if((this.isDirty("layer")||this.isDirty("layerMargin"))&&(this._display.setLayer(this.get("layer"),this.get("layerMargin")),this.markDirtyLayer()),this.isDirty("tooltipPosition")){const e=this._tooltipMoveDp;e&&(e.dispose(),this._tooltipMoveDp=void 0);const t=this._tooltipPointerDp;t&&(t.dispose(),this._tooltipPointerDp=void 0),this.get("tooltipPosition")=="pointer"&&(this.isHover()&&(this._tooltipMoveDp=this.events.on("globalpointermove",i=>{this.showTooltip(i.point)})),this._tooltipPointerDp=new k([this.events.on("pointerover",()=>{this._tooltipMoveDp=this.events.on("globalpointermove",i=>{this.showTooltip(i.point)})}),this.events.on("pointerout",()=>{const i=this._tooltipMoveDp;i&&(i.dispose(),this._tooltipMoveDp=void 0)})]))}}_handleStates(){this._statesHandled||(this.isDirty("active")&&(this.get("active")?(this.states.applyAnimate("active"),this.set("ariaChecked",!0)):(this.isHidden()||this.states.applyAnimate("default"),this.set("ariaChecked",!1)),this.markDirtyAccessibility()),this.isDirty("disabled")&&(this.get("disabled")?(this.states.applyAnimate("disabled"),this.set("ariaChecked",!1)):(this.isHidden()||this.states.applyAnimate("default"),this.set("ariaChecked",!0)),this.markDirtyAccessibility()),this._statesHandled=!0)}_changed(){super._changed();const e=this._display,t=this.events;if(this.isDirty("draggable")){const r=this.get("draggable");r?(this.set("interactive",!0),this._dragDp=new k([t.on("pointerdown",a=>{this.dragStart(a)}),t.on("globalpointermove",a=>{this.dragMove(a)}),t.on("globalpointerup",a=>{this.dragStop(a)})])):this._dragDp&&(this._dragDp.dispose(),this._dragDp=void 0),e.cancelTouch=!!r}if(this.isDirty("tooltipText")||this.isDirty("tooltipHTML")||this.isDirty("showTooltipOn")){const r=this.get("tooltipText"),a=this.get("tooltipHTML"),n=this.get("showTooltipOn","hover");this._tooltipDp&&(this._tooltipDp.dispose(),this._tooltipDp=void 0),(r||a)&&(n=="click"?(this._tooltipDp=new k([t.on("click",()=>{this.setTimeout(()=>this.showTooltip(),10)}),Ue(document,"click",o=>{this.hideTooltip()})]),this._disposers.push(this._tooltipDp)):n=="always"||(this._tooltipDp=new k([t.on("pointerover",()=>{this.showTooltip()}),t.on("pointerout",()=>{this.hideTooltip()})]),this._disposers.push(this._tooltipDp)))}if(this.isDirty("toggleKey")){let r=this.get("toggleKey");r&&r!="none"?this._toggleDp=t.on("click",()=>{this._isDragging||this.set(r,!this.get(r))}):this._toggleDp&&(this._toggleDp.dispose(),this._toggleDp=void 0)}if(this.isDirty("opacity")&&(e.alpha=Math.max(0,this.get("opacity",1)),this.get("focusable")&&this.markDirtyAccessibility()),this.isDirty("rotation")&&(this.markDirtyBounds(),e.angle=this.get("rotation",0)),this.isDirty("scale")&&(this.markDirtyBounds(),e.scale=this.get("scale",0)),(this.isDirty("centerX")||this.isDirty("centerY"))&&(this.markDirtyBounds(),this.updatePivotPoint()),(this.isDirty("visible")||this.isPrivateDirty("visible")||this.isDirty("forceHidden"))&&(this.get("visible")&&this.getPrivate("visible")&&!this.get("forceHidden")?e.visible=!0:(e.visible=!1,this.hideTooltip()),this.markDirtyBounds(),this.get("focusable")&&this.markDirtyAccessibility()),this.isDirty("width")||this.isDirty("height")){this.markDirtyBounds(),this._addPercentageSizeChildren();const r=this.parent;r&&(this.isDirty("width")&&this.get("width")instanceof f||this.isDirty("height")&&this.get("height")instanceof f)&&(r.markDirty(),r._prevWidth=0),this._sizeDirty=!0}if((this.isDirty("maxWidth")||this.isDirty("maxHeight")||this.isPrivateDirty("width")||this.isPrivateDirty("height")||this.isDirty("minWidth")||this.isDirty("minHeight")||this.isPrivateDirty("maxWidth")||this.isPrivateDirty("maxHeight")||this.isPrivateDirty("minWidth")||this.isPrivateDirty("minHeight"))&&(this.markDirtyBounds(),this._sizeDirty=!0),this._sizeDirty&&this._updateSize(),this.isDirty("wheelable")){const r=this.get("wheelable");r&&this.set("interactive",!0),e.wheelable=!!r}(this.isDirty("tabindexOrder")||this.isDirty("focusableGroup"))&&(this.get("focusable")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this)),this.isDirty("filter")&&(e.filter=this.get("filter"));let i=this.get("filter","");if(this.isDirty("blur")){const r=this.get("blur",0);r!=0&&(i+=" blur("+r+"px)")}if(this.isDirty("saturate")){const r=this.get("saturate",1);r!=1&&(i+=" saturate("+r+")")}if(this.isDirty("brightness")){const r=this.get("brightness",1);r!=1&&(i+=" brightness("+r+")")}if(this.isDirty("contrast")){const r=this.get("contrast",1);r!=1&&(i+=" contrast("+r+")")}if(this.isDirty("sepia")){const r=this.get("sepia",0);r!=0&&(i+=" sepia("+r+")")}if(this.isDirty("hue")){const r=this.get("hue",0);r!=0&&(i+=" hue-rotate("+r+"deg)")}if(this.isDirty("invert")){const r=this.get("invert",0);r!=0&&(i+=" invert("+r+")")}if(i&&(e.filter=i),this.isDirty("cursorOverStyle")&&(e.cursorOverStyle=this.get("cursorOverStyle")),this.isDirty("hoverOnFocus")&&(this.get("hoverOnFocus")?this._focusDp=new k([t.on("focus",()=>{this.showTooltip()}),t.on("blur",()=>{this.hideTooltip()})]):this._focusDp&&(this._focusDp.dispose(),this._focusDp=void 0)),this.isDirty("focusable")&&(this.get("focusable")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this),this.markDirtyAccessibility()),this.isPrivateDirty("focusable")&&this.markDirtyAccessibility(),(this.isDirty("role")||this.isDirty("ariaLive")||this.isDirty("ariaChecked")||this.isDirty("ariaHidden")||this.isDirty("ariaOrientation")||this.isDirty("ariaValueNow")||this.isDirty("ariaValueMin")||this.isDirty("ariaValueMax")||this.isDirty("ariaValueText")||this.isDirty("ariaLabel")||this.isDirty("ariaControls"))&&this.markDirtyAccessibility(),this.isDirty("exportable")&&(e.exportable=this.get("exportable")),this.isDirty("interactive")){const r=this.events;this.get("interactive")?this._hoverDp=new k([r.on("click",a=>{Me(a.originalEvent)&&(this.getPrivate("touchHovering")||this.setTimeout(()=>{this._handleOver(),(this.get("tooltipText")||this.get("tooltipHTML"))&&this.showTooltip(),this.setPrivateRaw("touchHovering",!0),this.events.dispatch("pointerover",{type:"pointerover",target:a.target,originalEvent:a.originalEvent,point:a.point,simulated:a.simulated})},10))}),r.on("globalpointerup",a=>{Me(a.originalEvent)&&this.getPrivate("touchHovering")&&(this._handleOut(),(this.get("tooltipText")||this.get("tooltipHTML"))&&this.hideTooltip(),this.setPrivateRaw("touchHovering",!1),this.events.dispatch("pointerout",{type:"pointerout",target:a.target,originalEvent:a.originalEvent,point:a.point,simulated:a.simulated})),this._isDown&&this._handleUp(a)}),r.on("pointerover",()=>{this._handleOver()}),r.on("pointerout",()=>{this._handleOut()}),r.on("pointerdown",a=>{this._handleDown(a)})]):(this._display.interactive=!1,this._hoverDp&&(this._hoverDp.dispose(),this._hoverDp=void 0))}this.isDirty("forceInactive")&&(this._display.inactive=this.get("forceInactive",null)),this.get("showTooltipOn")=="always"&&this._display.visible&&this.showTooltip()}dragStart(e){this._dragEvent=e,this.events.stopParentDispatch()}dragStop(e){if(this._dragEvent=void 0,this._dragPoint=void 0,this.events.stopParentDispatch(),this._isDragging){this._isDragging=!1;const t="dragstop";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this,originalEvent:e.originalEvent,point:e.point,simulated:e.simulated})}}_handleOver(){this.isHidden()||(this.get("active")&&this.states.lookup("hoverActive")?this.states.applyAnimate("hoverActive"):this.get("disabled")&&this.states.lookup("hoverDisabled")?this.states.applyAnimate("hoverDisabled"):this.states.applyAnimate("hover"),this.get("draggable")&&this._isDown&&this.states.lookup("down")&&this.states.applyAnimate("down"))}_handleOut(){this.isHidden()||(this.get("active")&&this.states.lookup("active")?this.states.applyAnimate("active"):this.get("disabled")&&this.states.lookup("disabled")?this.states.applyAnimate("disabled"):(this.states.lookup("hover")||this.states.lookup("hoverActive"))&&this.states.applyAnimate("default"),this.get("draggable")&&this._isDown&&this.states.lookup("down")&&this.states.applyAnimate("down"))}_handleUp(e){if(!this.isHidden()){this.get("active")&&this.states.lookup("active")?this.states.applyAnimate("active"):this.get("disabled")&&this.states.lookup("disabled")?this.states.applyAnimate("disabled"):this.states.lookup("down")&&(this.isHover()?this.states.applyAnimate("hover"):this.states.applyAnimate("default")),this._downPoint=void 0;const t=ue(e.originalEvent);delete this._downPoints[t],T(this._downPoints).length==0&&(this._isDown=!1)}}_hasMoved(e){const t=ue(e.originalEvent),i=this._downPoints[t];if(i){const r=Math.abs(i.x-e.point.x),a=Math.abs(i.y-e.point.y);return r>5||a>5}return!1}_hasDown(){return T(this._downPoints).length>0}_handleDown(e){const t=this.parent;if(t&&!this.get("draggable")&&t._handleDown(e),this.get("interactive")&&!this.isHidden()){this.states.lookup("down")&&this.states.applyAnimate("down"),this._downPoint={x:e.point.x,y:e.point.y},this._isDown=!0;const i=ue(e.originalEvent);this._downPoints[i]={x:e.point.x,y:e.point.y}}}dragMove(e){let t=this._dragEvent;if(t){if(t.simulated&&!e.simulated)return!0;let i=0,r=this.parent,a=1;for(;r!=null;)i+=r.get("rotation",0),r=r.parent,r&&(a*=r.get("scale",1));let n=(e.point.x-t.point.x)/a,o=(e.point.y-t.point.y)/a;const h=this.events;if(t.simulated&&!this._isDragging){this._isDragging=!0,this._dragEvent=e,this._dragPoint={x:this.x(),y:this.y()};const l="dragstart";h.isEnabled(l)&&h.dispatch(l,{type:l,target:this,originalEvent:e.originalEvent,point:e.point,simulated:e.simulated})}if(this._isDragging){let l=this._dragPoint;this.set("x",l.x+n*ye(i)+o*ve(i)),this.set("y",l.y+o*ye(i)-n*ve(i));const d="dragged";h.isEnabled(d)&&h.dispatch(d,{type:d,target:this,originalEvent:e.originalEvent,point:e.point,simulated:e.simulated})}else if(Math.hypot(n,o)>5){this._isDragging=!0,this._dragEvent=e,this._dragPoint={x:this.x(),y:this.y()};const l="dragstart";h.isEnabled(l)&&h.dispatch(l,{type:l,target:this,originalEvent:e.originalEvent,point:e.point,simulated:e.simulated})}}}_updateSize(){}_getBounds(){this._localBounds=this._display.getLocalBounds()}depth(){let e=this.parent,t=0;for(;;){if(!e)return t;++t,e=e.parent}}markDirtySize(){this._sizeDirty=!0,this.markDirty()}markDirtyBounds(){const e=this._display;if(this.get("isMeasured")){this._root._addDirtyBounds(this),e.isMeasured=!0,e.invalidateBounds();const t=this.parent;t&&this.get("position")!="absolute"&&(t.get("width")==null||t.get("height")==null||t.get("layout"))&&t.markDirtyBounds(),this.get("focusable")&&this.isFocus()&&this.markDirtyAccessibility()}}markDirtyAccessibility(){this._root._invalidateAccessibility(this)}markDirtyLayer(){this._display.markDirtyLayer(!0)}markDirty(){super.markDirty(),this.markDirtyLayer()}_updateBounds(){const e=this._adjustedLocalBounds;let t;if(this.get("visible")&&this.getPrivate("visible")&&!this.get("forceHidden")?(this._getBounds(),this._fixMinBounds(this._localBounds),this.updatePivotPoint(),this._adjustedLocalBounds=this._display.getAdjustedBounds(this._localBounds),t=this._adjustedLocalBounds):(t={left:0,right:0,top:0,bottom:0},this._localBounds=t,this._adjustedLocalBounds=t),!e||e.left!==t.left||e.top!==t.top||e.right!==t.right||e.bottom!==t.bottom){const i="boundschanged";this.events.isEnabled(i)&&this.events.dispatch(i,{type:i,target:this}),this.parent&&(this.parent.markDirty(),this.parent.markDirtyBounds())}}_fixMinBounds(e){let t=this.get("minWidth",this.getPrivate("minWidth")),i=this.get("minHeight",this.getPrivate("minHeight"));g(t)&&e.right-e.left0?e.right=e.left+r:e.left=e.right+r),g(a)&&(a>0?e.bottom=e.top+a:e.top=e.bottom+a)}_removeParent(e){e&&(e.children.removeValue(this),O(e._percentageSizeChildren,this),O(e._percentagePositionChildren,this))}_clearDirty(){super._clearDirty(),this._sizeDirty=!1,this._statesHandled=!1}hover(){this.showTooltip(),this._handleOver()}unhover(){this.hideTooltip(),this._handleOut()}showTooltip(e){const t=this.getTooltip(),i=this.get("tooltipText"),r=this.get("tooltipHTML");if((i||r)&&t){const a=this.get("tooltipPosition"),n=this.getPrivate("tooltipTarget",this);a!="fixed"&&e||(this._display._setMatrix(),e=this.toGlobal(n._getTooltipPoint())),t.set("pointTo",e),t.set("tooltipTarget",n),t.get("x")||t.set("x",e.x),t.get("y")||t.set("y",e.y),i&&t.label.set("text",i),r&&t.label.set("html",r);const o=this.dataItem;if(o&&t.label._setDataItem(o),this.get("showTooltipOn")=="always"&&(e.x<0||e.x>this._root.width()||e.y<0||e.y>this._root.height()))return void this.hideTooltip();t.label.text.markDirtyText();const h=t.show();return this.setPrivateRaw("showingTooltip",!0),h}}hideTooltip(){const e=this.getTooltip();if(e&&(e.get("tooltipTarget")==this.getPrivate("tooltipTarget",this)||this.get("tooltip")==e)){let t=e.get("keepTargetHover")&&e.get("stateAnimationDuration",0)==0?400:void 0;const i=e.hide(t);return this.setPrivateRaw("showingTooltip",!1),i}}_getTooltipPoint(){const e=this._localBounds;if(e){let t=0,i=0;return this.get("isMeasured")?(t=e.left+M(this.get("tooltipX",0),e.right-e.left),i=e.top+M(this.get("tooltipY",0),e.bottom-e.top)):(t=M(this.get("tooltipX",0),this.width()),i=M(this.get("tooltipY",0),this.height())),{x:t,y:i}}return{x:0,y:0}}getTooltip(){let e=this.get("tooltip");if(e)return e;{let t=this.parent;if(t)return t.getTooltip()}}_updatePosition(){const e=this.parent;let t=this.get("dx",0),i=this.get("dy",0),r=this.get("x"),a=this.getPrivate("x"),n=0,o=0;const h=this.get("position");r instanceof f&&(r=e?e.innerWidth()*r.value+e.get("paddingLeft",0):0),g(r)?n=r+t:a!=null?n=a:e&&h=="relative"&&(n=e.get("paddingLeft",0)+t);let l=this.get("y"),d=this.getPrivate("y");l instanceof f&&(l=e?e.innerHeight()*l.value+e.get("paddingTop",0):0),g(l)?o=l+i:d!=null?o=d:e&&h=="relative"&&(o=e.get("paddingTop",0)+i);const p=this._display;if(p.x!=n||p.y!=o){p.invalidateBounds(),p.x=n,p.y=o;const u="positionchanged";this.events.isEnabled(u)&&this.events.dispatch(u,{type:u,target:this})}this.getPrivate("showingTooltip")&&this.showTooltip()}x(){let e=this.get("x"),t=this.getPrivate("x");const i=this.parent;return i?e instanceof f?M(e,i.innerWidth())+i.get("paddingLeft",0):g(e)?e:t??i.get("paddingLeft",this._display.x):this._display.x}y(){let e=this.getPrivate("y");if(e!=null)return e;let t=this.get("y");const i=this.parent;return i?t instanceof f?M(t,i.innerHeight())+i.get("paddingTop",0):g(t)?t:e??i.get("paddingTop",this._display.y):this._display.y}_dispose(){super._dispose(),this._display.dispose(),this._removeTemplateField(),this._removeParent(this.parent),this._root._removeFocusElement(this);const e=this.get("tooltip");e&&e.dispose(),this.markDirty()}adjustedLocalBounds(){return this._fixMinBounds(this._adjustedLocalBounds),this._adjustedLocalBounds}localBounds(){return this._localBounds}bounds(){const e=this._adjustedLocalBounds,t=this.x(),i=this.y();return{left:e.left+t,right:e.right+t,top:e.top+i,bottom:e.bottom+i}}globalBounds(){const e=this.localBounds(),t=this.toGlobal({x:e.left,y:e.top}),i=this.toGlobal({x:e.right,y:e.top}),r=this.toGlobal({x:e.right,y:e.bottom}),a=this.toGlobal({x:e.left,y:e.bottom});return{left:Math.min(t.x,i.x,r.x,a.x),top:Math.min(t.y,i.y,r.y,a.y),right:Math.max(t.x,i.x,r.x,a.x),bottom:Math.max(t.y,i.y,r.y,a.y)}}_onShow(e){}_onHide(e){}appear(e,t){return ee(this,void 0,void 0,function*(){return yield this.hide(0),t?new Promise((i,r)=>{this.setTimeout(()=>{i(this.show(e))},t)}):this.show(e)})}show(e){return ee(this,void 0,void 0,function*(){if(!this._isShowing){this._isHidden=!1,this._isShowing=!0,this._isHiding=!1,this.states.lookup("default").get("visible")&&this.set("visible",!0),this._onShow(e);const t=this.states.applyAnimate("default",e);yield He(t),this._isShowing=!1}})}hide(e){return ee(this,void 0,void 0,function*(){if(!this._isHiding&&!this._isHidden){this._isHiding=!0,this._isShowing=!1;let t=this.states.lookup("hidden");t||(t=this.states.create("hidden",{opacity:0,visible:!1})),this._isHidden=!0,this._onHide(e);const i=this.states.applyAnimate("hidden",e);yield He(i),this._isHiding=!1}})}isHidden(){return this._isHidden}isShowing(){return this._isShowing}isHiding(){return this._isHiding}isHover(){return this._display.hovering()}isFocus(){return this._root.focused(this)}isDragging(){return this._isDragging}isVisible(){return!(!this.get("visible")||!this.getPrivate("visible")||this.get("forceHidden"))}isVisibleDeep(){return this._parent?this._parent.isVisibleDeep()&&this.isVisible():this.isVisible()}compositeOpacity(){const e=this.get("opacity",1);return this._parent?this._parent.compositeOpacity()*e:e}width(){let e=this.get("width"),t=this.get("maxWidth",this.getPrivate("maxWidth")),i=this.get("minWidth",this.getPrivate("minWidth")),r=this.getPrivate("width"),a=0;if(g(r))a=r;else if(e==null)this._adjustedLocalBounds&&(a=this._adjustedLocalBounds.right-this._adjustedLocalBounds.left);else if(e instanceof f){const n=this.parent;a=n?n.innerWidth()*e.value:this._root.width()*e.value}else g(e)&&(a=e);return g(i)&&(a=Math.max(i,a)),g(t)&&(a=Math.min(t,a)),a}maxWidth(){let e=this.get("maxWidth",this.getPrivate("maxWidth"));if(g(e))return e;{let i=this.get("width");if(g(i))return i}const t=this.parent;return t?t.innerWidth():this._root.width()}maxHeight(){let e=this.get("maxHeight",this.getPrivate("maxHeight"));if(g(e))return e;{let i=this.get("height");if(g(i))return i}const t=this.parent;return t?t.innerHeight():this._root.height()}height(){let e=this.get("height"),t=this.get("maxHeight",this.getPrivate("maxHeight")),i=this.get("minHeight",this.getPrivate("minHeight")),r=this.getPrivate("height"),a=0;if(g(r))a=r;else if(e==null)this._adjustedLocalBounds&&(a=this._adjustedLocalBounds.bottom-this._adjustedLocalBounds.top);else if(e instanceof f){const n=this.parent;a=n?n.innerHeight()*e.value:this._root.height()*e.value}else g(e)&&(a=e);return g(i)&&(a=Math.max(i,a)),g(t)&&(a=Math.min(t,a)),a}_findStaticTemplate(e){return this._templateField&&e(this._templateField)?this._templateField:super._findStaticTemplate(e)}_walkParents(e){this._parent&&this._walkParent(e)}_walkParent(e){this._parent&&this._parent._walkParent(e),e(this)}get parent(){return this._parent}_setParent(e,t=!1){const i=this._parent;e!==i&&(this.markDirtyBounds(),e.markDirty(),this._parent=e,t&&(this._removeParent(i),e&&(this._addPercentageSizeChildren(),this._addPercentagePositionChildren())),this.markDirtyPosition(),this._applyThemes())}getNumberFormatter(){return this.get("numberFormatter",this._root.numberFormatter)}getDateFormatter(){return this.get("dateFormatter",this._root.dateFormatter)}getDurationFormatter(){return this.get("durationFormatter",this._root.durationFormatter)}toGlobal(e){return this._display.toGlobal(e)}toLocal(e){return this._display.toLocal(e)}_getDownPoint(){const e=this._getDownPointId();if(e)return this._downPoints[e]}_getDownPointId(){if(this._downPoints)return ot(this._downPoints,(e,t)=>e>t?1:e0&&(n.beginFill(r,a),n.drawRect(0,0,t,i),n.endFill()),o.angle=this.get("rotation",0),this._draw(),this._pattern=this._root._renderer.createPattern(o,n,e,t,i)}this._clear=!1}}Object.defineProperty(K,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Pattern"}),Object.defineProperty(K,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:A.classNames.concat([K.className])});class G extends K{constructor(){super(...arguments),Object.defineProperty(this,"_image",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_beforeChanged(){super._beforeChanged(),this._clear=!0,this.isDirty("src")&&this._load();const e=this.get("canvas");e&&(this.set("width",e.width),this.set("height",e.height))}_draw(){super._draw();const e=this._image;if(e){const i=this.get("width",100),r=this.get("height",100),a=this.get("fit","image");let n=0,o=0;a=="pattern"?(n=i,o=r):(n=e.width,o=e.height,a=="image"&&(this.set("width",n),this.set("height",o)));let h=0,l=0;this.get("centered",!0)&&(h=i/2-n/2,l=r/2-o/2),this._display.image(e,n,o,h,l)}const t=this.get("canvas");t&&this._display.image(t,t.width,t.height,0,0)}_load(){const e=this.get("src");if(e){const t=new Image;t.src=e,t.decode().then(()=>{this._image=t,this._draw(),this.events.isEnabled("loaded")&&this.events.dispatch("loaded",{type:"loaded",target:this})}).catch(i=>{})}}}var we;Object.defineProperty(G,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PicturePattern"}),Object.defineProperty(G,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:K.classNames.concat([G.className])}),function(s){s.ADD="lighter",s.COLOR="color",s.COLOR_BURN="color-burn",s.COLOR_DODGE="color-dodge",s.DARKEN="darken",s.DIFFERENCE="difference",s.DST_OVER="destination-over",s.EXCLUSION="exclusion",s.HARD_LIGHT="hard-light",s.HUE="hue",s.LIGHTEN="lighten",s.LUMINOSITY="luminosity",s.MULTIPLY="multiply",s.NORMAL="source-over",s.OVERLAY="overlay",s.SATURATION="saturation",s.SCREEN="screen",s.SOFT_LIGHT="soft-light",s.SRC_ATOP="source-atop",s.XOR="xor"}(we||(we={}));const Mi=["fill","fillOpacity","stroke","strokeWidth","strokeOpacity","fillPattern","strokePattern","fillGradient","strokeGradient","strokeDasharray","strokeDashoffset","shadowBlur","shadowColor","shadowOpacity","shadowOffsetX","shadowOffsetY","blur","sepia","invert","brightness","hue","contrast","saturate"];class z extends x{constructor(){super(...arguments),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeGraphics()}),Object.defineProperty(this,"_clear",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_beforeChanged(){if(super._beforeChanged(),(this.isDirty("draw")||this.isDirty("svgPath"))&&this.markDirtyBounds(),(this.isDirty("fill")||this.isDirty("stroke")||this.isDirty("visible")||this.isDirty("forceHidden")||this.isDirty("scale")||this.isDirty("fillGradient")||this.isDirty("strokeGradient")||this.isDirty("fillPattern")||this.isDirty("strokePattern")||this.isDirty("fillOpacity")||this.isDirty("strokeOpacity")||this.isDirty("strokeWidth")||this.isDirty("draw")||this.isDirty("blendMode")||this.isDirty("strokeDasharray")||this.isDirty("strokeDashoffset")||this.isDirty("svgPath")||this.isDirty("lineJoin")||this.isDirty("shadowColor")||this.isDirty("shadowBlur")||this.isDirty("shadowOffsetX")||this.isDirty("shadowOffsetY"))&&(this._clear=!0),this._display.crisp=this.get("crisp",!1),this.isDirty("fillGradient")){const e=this.get("fillGradient");if(e){this._display.isMeasured=!0;const t=e.get("target");t&&(this._disposers.push(t.events.on("boundschanged",()=>{this._markDirtyKey("fill")})),this._disposers.push(t.events.on("positionchanged",()=>{this._markDirtyKey("fill")})))}}if(this.isDirty("strokeGradient")){const e=this.get("strokeGradient");if(e){this._display.isMeasured=!0;const t=e.get("target");t&&(this._disposers.push(t.events.on("boundschanged",()=>{this._markDirtyKey("stroke")})),this._disposers.push(t.events.on("positionchanged",()=>{this._markDirtyKey("stroke")})))}}}_changed(){if(super._changed(),this._clear){this.markDirtyBounds(),this.markDirtyLayer(),this._display.clear();let e=this.get("strokeDasharray");g(e)&&(e=e<.5?[0]:[e]),this._display.setLineDash(e);const t=this.get("strokeDashoffset");t&&this._display.setLineDashOffset(t);const i=this.get("blendMode",we.NORMAL);this._display.blendMode=i;const r=this.get("draw");r&&r(this._display,this);const a=this.get("svgPath");a!=null&&this._display.svgPath(a)}}_afterChanged(){if(super._afterChanged(),this._clear){const e=this.get("fill"),t=this.get("fillGradient"),i=this.get("fillPattern"),r=this.get("fillOpacity"),a=this.get("stroke"),n=this.get("strokeGradient"),o=this.get("strokePattern"),h=this.get("shadowColor"),l=this.get("shadowBlur"),d=this.get("shadowOffsetX"),p=this.get("shadowOffsetY"),u=this.get("shadowOpacity");if(h&&(l||d||p)&&this._display.shadow(h,l,d,p,u),e&&!t&&(this._display.beginFill(e,r),this._display.endFill()),t){if(e){const m=t.get("stops",[]);m.length&&_(m,b=>{b.color&&!b.colorInherited||!e||(b.color=e,b.colorInherited=!0),(b.opacity==null||b.opacityInherited)&&(b.opacity=r,b.opacityInherited=!0)})}const c=t.getFill(this);c&&(this._display.beginFill(c,r),this._display.endFill())}if(i){const c=i.pattern;c&&(this._display.beginFill(c,r),this._display.endFill(),i instanceof G&&i.events.once("loaded",()=>{this._clear=!0,this.markDirty()}))}if(a||n||o){const c=this.get("strokeOpacity");let m=this.get("strokeWidth",1);this.get("nonScalingStroke")&&(m/=this.get("scale",1)),this.get("crisp")&&(m/=this._root._renderer.resolution);const b=this.get("lineJoin");if(a&&!n&&(this._display.lineStyle(m,a,c,b),this._display.endStroke()),n){const S=n.get("stops",[]);S.length&&_(S,w=>{w.color&&!w.colorInherited||!a||(w.color=a,w.colorInherited=!0),(w.opacity==null||w.opacityInherited)&&(w.opacity=c,w.opacityInherited=!0)});const H=n.getFill(this);H&&(this._display.lineStyle(m,H,c,b),this._display.endStroke())}if(o){let S=o.pattern;S&&(this._display.lineStyle(m,S,c,b),this._display.endStroke(),o instanceof G&&o.events.once("loaded",()=>{this._clear=!0,this.markDirty()}))}}this.getPrivate("showingTooltip")&&this.showTooltip()}this._clear=!1}}Object.defineProperty(z,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Graphics"}),Object.defineProperty(z,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:x.classNames.concat([z.className])});class Y extends z{_afterNew(){super._afterNew(),this._display.isMeasured=!0,this.setPrivateRaw("trustBounds",!0)}_beforeChanged(){super._beforeChanged(),(this.isDirty("width")||this.isDirty("height")||this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&(this._clear=!0)}_changed(){super._changed(),this._clear&&!this.get("draw")&&this._draw()}_draw(){this._display.drawRect(0,0,this.width(),this.height())}_updateSize(){this.markDirty(),this._clear=!0}}function j(s,e){s.get("reverseChildren",!1)?s.children.eachReverse(e):s.children.each(e)}Object.defineProperty(Y,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Rectangle"}),Object.defineProperty(Y,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:z.classNames.concat([Y.className])});class E extends A{}Object.defineProperty(E,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Layout"}),Object.defineProperty(E,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:A.classNames.concat([E.className])});class X extends E{updateContainer(e){let t=e.get("paddingLeft",0),i=e.innerWidth(),r=0;j(e,n=>{if(n.isVisible()&&n.get("position")=="relative"){let o=n.get("width");if(o instanceof f){r+=o.value;let h=i*o.value,l=n.get("minWidth",n.getPrivate("minWidth",-1/0));l>h&&(i-=l,r-=o.value);let d=n.get("maxWidth",n.getPrivate("maxWidth",1/0));h>d&&(i-=d,r-=o.value)}else g(o)||(o=n.width()),i-=o+n.get("marginLeft",0)+n.get("marginRight",0)}}),(i<=0||i==1/0)&&(i=.1),j(e,n=>{if(n.isVisible()&&n.get("position")=="relative"){let o=n.get("width");if(o instanceof f){let h=i*o.value/r-n.get("marginLeft",0)-n.get("marginRight",0),l=n.get("minWidth",n.getPrivate("minWidth",-1/0)),d=n.get("maxWidth",n.getPrivate("maxWidth",1/0));h=Math.min(Math.max(l,h),d),n.setPrivate("width",h)}else n._prevSettings.width instanceof f&&n.setPrivate("width",void 0)}});let a=t;j(e,n=>{if(n.get("position")=="relative")if(n.isVisible()){let o=n.adjustedLocalBounds(),h=n.get("marginLeft",0),l=n.get("marginRight",0),d=n.get("maxWidth"),p=o.left,u=o.right;d&&u-p>d&&(u=p+d);let c=a+h-p;n.setPrivate("x",c),a=c+u+l}else n.setPrivate("x",void 0)})}}Object.defineProperty(X,"className",{enumerable:!0,configurable:!0,writable:!0,value:"HorizontalLayout"}),Object.defineProperty(X,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([X.className])});class $ extends E{updateContainer(e){let t=e.get("paddingTop",0),i=e.innerHeight(),r=0;j(e,n=>{if(n.isVisible()&&n.get("position")=="relative"){let o=n.get("height");if(o instanceof f){r+=o.value;let h=i*o.value,l=n.get("minHeight",n.getPrivate("minHeight",-1/0));l>h&&(i-=l,r-=o.value);let d=n.get("maxHeight",n.getPrivate("maxHeight",1/0));h>d&&(i-=d,r-=o.value)}else g(o)||(o=n.height()),i-=o+n.get("marginTop",0)+n.get("marginBottom",0)}}),(i<=0||i==1/0)&&(i=.1),j(e,n=>{if(n.isVisible()&&n.get("position")=="relative"){let o=n.get("height");if(o instanceof f){let h=i*o.value/r-n.get("marginTop",0)-n.get("marginBottom",0),l=n.get("minHeight",n.getPrivate("minHeight",-1/0)),d=n.get("maxHeight",n.getPrivate("maxHeight",1/0));h=Math.min(Math.max(l,h),d),n.setPrivate("height",h)}else n._prevSettings.height instanceof f&&n.setPrivate("height",void 0)}});let a=t;j(e,n=>{if(n.get("position")=="relative")if(n.isVisible()){let o=n.adjustedLocalBounds(),h=n.get("marginTop",0),l=o.top,d=o.bottom,p=n.get("maxHeight");p&&d-l>p&&(d=l+p);let u=n.get("marginBottom",0),c=a+h-l;n.setPrivate("y",c),a=c+d+u}else n.setPrivate("y",void 0)})}}Object.defineProperty($,"className",{enumerable:!0,configurable:!0,writable:!0,value:"VerticalLayout"}),Object.defineProperty($,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([$.className])});class Z extends E{_afterNew(){this._setRawDefault("maxColumns",Number.MAX_VALUE),super._afterNew()}updateContainer(e){let t=e.get("paddingLeft",0),i=e.get("paddingRight",0),r=e.get("paddingTop",0),a=e.maxWidth()-t-i,n=a,o=1;j(e,m=>{if(m.get("visible")&&m.getPrivate("visible")&&!m.get("forceHidden")&&m.get("position")!="absolute"){let b=m.width();bo&&(o=b)}}),n=Ie(n,1,a),o=Ie(o,1,a);let h=1;h=this.get("fixedWidthGrid")?a/o:a/n,h=Math.max(1,Math.floor(h)),h=Math.min(this.get("maxColumns",Number.MAX_VALUE),h);let l=this.getColumnWidths(e,h,o,a),d=r,p=0,u=0;h=l.length;let c=t;j(e,m=>{if(m.get("position")=="relative"&&m.isVisible()){const b=m.get("marginTop",0),S=m.get("marginBottom",0);let H=m.adjustedLocalBounds(),w=m.get("marginLeft",0),C=m.get("marginRight",0),D=c+w-H.left,N=d+b-H.top;m.setPrivate("x",D),m.setPrivate("y",N),c+=l[p]+C,u=Math.max(u,m.height()+b+S),p++,p>=h&&(p=0,c=t,d+=u)}})}getColumnWidths(e,t,i,r){let a=0,n=[],o=0;return j(e,h=>{let l=h.adjustedLocalBounds();h.get("position")!="absolute"&&h.isVisible()&&(this.get("fixedWidthGrid")?n[o]=i:n[o]=Math.max(0|n[o],l.right-l.left+h.get("marginLeft",0)+h.get("marginRight",0)),o{a+=h}),a>r?t>2?(t-=1,this.getColumnWidths(e,t,i,r)):[r]:n}}Object.defineProperty(Z,"className",{enumerable:!0,configurable:!0,writable:!0,value:"GridLayout"}),Object.defineProperty(Z,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([Z.className])});class Pe{static escape(e){return e.replace(/\[\[/g,this.prefix+"1").replace(/([^\/\]]{1})\]\]/g,"$1"+this.prefix+"2").replace(/\]\]/g,this.prefix+"2").replace(/\{\{/g,this.prefix+"3").replace(/\}\}/g,this.prefix+"4").replace(/\'\'/g,this.prefix+"5")}static unescape(e){return e.replace(new RegExp(this.prefix+"1","g"),"[[").replace(new RegExp(this.prefix+"2","g"),"]]").replace(new RegExp(this.prefix+"3","g"),"{{").replace(new RegExp(this.prefix+"4","g"),"}}").replace(new RegExp(this.prefix+"5","g"),"''")}static cleanUp(e){return e.replace(/\[\[/g,"[").replace(/\]\]/g,"]").replace(/\{\{/g,"{").replace(/\}\}/g,"}").replace(/\'\'/g,"'")}static chunk(e,t=!1,i=!1){let r=[];e=this.escape(e);let a=t?e.split("'"):[e];for(let n=0;n{e.dispose()}),this.getPrivate("htmlElement")&&this._root._removeHTMLContent(this),super._dispose()}_changed(){if(super._changed(),this.isDirty("interactiveChildren")&&(this._display.interactiveChildren=this.get("interactiveChildren",!1)),this.isDirty("layout")&&(this._prevWidth=0,this._prevHeight=0,this.markDirtyBounds(),this._prevSettings.layout&&this.children.each(e=>{e.removePrivate("x"),e.removePrivate("y")})),(this.isDirty("paddingTop")||this.isDirty("paddingBottom")||this.isDirty("paddingLeft")||this.isDirty("paddingRight"))&&this.children.each(e=>{e.markDirtyPosition()}),this.isDirty("maskContent")){const e=this._childrenDisplay;let t=this._contentMask;this.get("maskContent")?t||(t=Y.new(this._root,{x:-.5,y:-.5,width:this.width()+1,height:this.height()+1}),this._contentMask=t,e.addChildAt(t._display,0),e.mask=t._display):t&&(e.removeChild(t._display),e.mask=null,t.dispose(),this._contentMask=void 0)}}_updateSize(){super._updateSize(),_(this._percentageSizeChildren,e=>{e._updateSize()}),_(this._percentagePositionChildren,e=>{e.markDirtyPosition(),e._updateSize()}),this.updateBackground()}updateBackground(){const e=this.get("background");let t=this._localBounds;if(t&&!this.isHidden()){let i=t.left,r=t.top,a=t.right-i,n=t.bottom-r,o=this.get("maxWidth"),h=this.get("maxHeight");h&&n>h&&(n=h),o&&a>o&&(a=o);let l=this.width(),d=this.height();e&&(e.setAll({width:a,height:n,x:i,y:r}),this._display.interactive&&(e._display.interactive=!0));const p=this._contentMask;p&&p.setAll({width:l+1,height:d+1});const u=this.get("verticalScrollbar");if(u){u.set("height",d),u.set("x",l-u.width()-u.get("marginRight",0)),u.set("end",u.get("start",0)+d/this._contentHeight);const c=u.get("background");c&&c.setAll({width:u.width(),height:d});let m=!0;this._contentHeight<=d&&(m=!1),u.setPrivate("visible",m)}}}_applyThemes(e=!1){return!!super._applyThemes(e)&&(this.eachChildren(t=>{t._applyThemes(e)}),!0)}_applyState(e){super._applyState(e),this.get("setStateOnChildren")&&this.eachChildren(t=>{t.states.apply(e)})}_applyStateAnimated(e,t){super._applyStateAnimated(e,t),this.get("setStateOnChildren")&&this.eachChildren(i=>{i.states.applyAnimate(e,t)})}innerWidth(){return this.width()-this.get("paddingRight",0)-this.get("paddingLeft",0)}innerHeight(){return this.height()-this.get("paddingTop",0)-this.get("paddingBottom",0)}_getBounds(){let e=this.get("width"),t=this.get("height"),i=this.getPrivate("width"),r=this.getPrivate("height"),a={left:0,top:0,right:this.width(),bottom:this.height()},n=this.get("layout"),o=!1,h=!1;if((n instanceof X||n instanceof Z)&&(o=!0),n instanceof $&&(h=!0),e==null&&i==null||t==null&&r==null||this.get("verticalScrollbar")){let l=Number.MAX_VALUE,d=l,p=-l,u=l,c=-l;const m=this.get("paddingLeft",0),b=this.get("paddingTop",0),S=this.get("paddingRight",0),H=this.get("paddingBottom",0);this.children.each(D=>{if(D.get("position")!="absolute"&&D.get("isMeasured")){let N=D.adjustedLocalBounds(),Te=D.x(),Se=D.y(),ne=Te+N.left,oe=Te+N.right,he=Se+N.top,le=Se+N.bottom;o&&(ne-=D.get("marginLeft",0),oe+=D.get("marginRight",0)),h&&(he-=D.get("marginTop",0),le+=D.get("marginBottom",0)),nep&&(p=oe),hec&&(c=le)}}),d==l&&(d=0),p==-l&&(p=0),u==l&&(u=0),c==-l&&(c=0),a.left=d-m,a.top=u-b,a.right=p+S,a.bottom=c+H;const w=this.get("minWidth");g(w)&&w>0&&a.right-a.left=w?a.left=a.right-w:a.right=a.left+w);const C=this.get("minHeight");g(C)&&C>0&&a.bottom-a.top=C?a.top=a.bottom-C:a.bottom=a.top+C)}this._contentWidth=a.right-a.left,this._contentHeight=a.bottom-a.top,g(e)&&(a.left=0,a.right=e),g(i)&&(a.left=0,a.right=i),g(t)&&(a.top=0,a.bottom=t),g(r)&&(a.top=0,a.bottom=r),this._localBounds=a}_updateBounds(){const e=this.get("layout");e&&e.updateContainer(this),super._updateBounds(),this.updateBackground()}markDirty(){super.markDirty(),this._root._addDirtyParent(this)}_prepareChildren(){const e=this.innerWidth(),t=this.innerHeight();if(e!=this._prevWidth||t!=this._prevHeight){let i=this.get("layout"),r=!1,a=!1;i&&((i instanceof X||i instanceof Z)&&(r=!0),i instanceof $&&(a=!0)),_(this._percentageSizeChildren,n=>{if(!r){let o=n.get("width");o instanceof f&&n.setPrivate("width",o.value*e)}if(!a){let o=n.get("height");o instanceof f&&n.setPrivate("height",o.value*t)}}),_(this._percentagePositionChildren,n=>{n.markDirtyPosition(),n.markDirtyBounds()}),this._prevWidth=e,this._prevHeight=t,this._sizeDirty=!0,this.updateBackground()}this._handleStates()}_updateChildren(){if(this.isDirty("html")){const e=this.get("html");e&&e!==""?this._root._setHTMLContent(this,De(this,this.get("html",""))):this._root._removeHTMLContent(this),this._root._positionHTMLElement(this)}if(this.isDirty("verticalScrollbar")){const e=this.get("verticalScrollbar");if(e){e._setParent(this),e.startGrip.setPrivate("visible",!1),e.endGrip.setPrivate("visible",!1),this.set("maskContent",!0),this.set("paddingRight",e.width()+e.get("marginRight",0)+e.get("marginLeft",0));let t=this.get("background");t||(t=this.set("background",Y.new(this._root,{themeTags:["background"],fillOpacity:0,fill:this._root.interfaceColors.get("alternativeBackground")}))),this._vsbd0=this.events.on("wheel",i=>{const r=i.originalEvent;if(!ut(r,this))return;r.preventDefault();let a=r.deltaY/5e3;const n=e.get("start",0),o=e.get("end",1);n+a<=0&&(a=-n),o+a>=1&&(a=1-o),n+a>=0&&o+a<=1&&(e.set("start",n+a),e.set("end",o+a))}),this._disposers.push(this._vsbd0),this._vsbd1=e.events.on("rangechanged",()=>{let i=this._contentHeight;const r=this._childrenDisplay,a=this._contentMask;r.y=-e.get("start",0)*i,r.markDirtyLayer(),a&&(a._display.y=-r.y,r.mask=a._display)}),this._disposers.push(this._vsbd1),this._display.addChild(e._display)}else{const t=this._prevSettings.verticalScrollbar;t&&(this._display.removeChild(t._display),this._vsbd0&&this._vsbd0.dispose(),this._vsbd1&&this._vsbd1.dispose(),this._childrenDisplay.y=0,this.setPrivate("height",void 0),this.set("maskContent",!1),this.set("paddingRight",void 0))}}if(this.isDirty("background")){const e=this._prevSettings.background;e&&this._display.removeChild(e._display);const t=this.get("background");t instanceof x&&(t.set("isMeasured",!1),t._setParent(this),this._display.addChildAt(t._display,0))}if(this.isDirty("mask")){const e=this.get("mask"),t=this._prevSettings.mask;if(t&&(this._display.removeChild(t._display),t!=e&&t.dispose()),e){const i=e.parent;i&&i.children.removeValue(e),e._setParent(this),this._display.addChildAt(e._display,0),this._childrenDisplay.mask=e._display}}}_processTemplateField(){super._processTemplateField(),this.children.each(e=>{e._processTemplateField()})}walkChildren(e){this.children.each(t=>{t instanceof L&&t.walkChildren(e),e(t)})}eachChildren(e){const t=this.get("background");t&&e(t);const i=this.get("verticalScrollbar");i&&e(i);const r=this.get("mask");r&&e(r),this.children.values.forEach(a=>{e(a)})}allChildren(){const e=[];return this.eachChildren(t=>{e.push(t)}),e}_setDataItem(e){const t=e!==this._dataItem;super._setDataItem(e);const i=this.get("html","");i&&i!==""&&t&&this._root._setHTMLContent(this,De(this,i))}}Object.defineProperty(L,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Container"}),Object.defineProperty(L,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:x.classNames.concat([L.className])});class se extends x{constructor(){super(...arguments),Object.defineProperty(this,"textStyle",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeTextStyle()}),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeText("",this.textStyle)}),Object.defineProperty(this,"_textStyles",{enumerable:!0,configurable:!0,writable:!0,value:["textAlign","fontFamily","fontSize","fontStyle","fontWeight","fontStyle","fontVariant","textDecoration","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","shadowOpacity","lineHeight","baselineRatio","direction","textBaseline","oversizedBehavior","breakWords","ellipsis","minScale","maxChars"]}),Object.defineProperty(this,"_originalScale",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_updateBounds(){if(this.get("text"))super._updateBounds();else{let e={left:0,right:0,top:0,bottom:0};this._adjustedLocalBounds=e}}_changed(){super._changed(),this._display.clear();let e=this.textStyle;if(this.isDirty("opacity")){let t=this.get("opacity",1);this._display.alpha=t}if((this.isDirty("text")||this.isDirty("populateText"))&&(this._display.text=this._getText(),this.markDirtyBounds(),this.get("role")=="tooltip"&&this._root.updateTooltip(this)),this.isPrivateDirty("tooltipElement")&&this.getPrivate("tooltipElement")&&this._disposers.push(new P(()=>{this._root._removeTooltipElement(this)})),this.isDirty("width")&&(e.wordWrapWidth=this.width(),this.markDirtyBounds()),this.isDirty("oversizedBehavior")&&(e.oversizedBehavior=this.get("oversizedBehavior","none"),this.markDirtyBounds()),this.isDirty("breakWords")&&(e.breakWords=this.get("breakWords",!1),this.markDirtyBounds()),this.isDirty("ellipsis")&&(e.ellipsis=this.get("ellipsis"),this.markDirtyBounds()),this.isDirty("ignoreFormatting")&&(e.ignoreFormatting=this.get("ignoreFormatting",!1),this.markDirtyBounds()),this.isDirty("minScale")&&(e.minScale=this.get("minScale",0),this.markDirtyBounds()),this.isDirty("fill")){let t=this.get("fill");t&&(e.fill=t)}if(this.isDirty("fillOpacity")){let t=this.get("fillOpacity",1);t&&(e.fillOpacity=t)}(this.isDirty("maxWidth")||this.isPrivateDirty("maxWidth"))&&(e.maxWidth=this.get("maxWidth",this.getPrivate("maxWidth")),this.markDirtyBounds()),(this.isDirty("maxHeight")||this.isPrivateDirty("maxHeight"))&&(e.maxHeight=this.get("maxHeight",this.getPrivate("maxHeight")),this.markDirtyBounds()),_(this._textStyles,t=>{this._dirty[t]&&(e[t]=this.get(t),this.markDirtyBounds())}),e.fontSize=this.get("fontSize"),e.fontFamily=this.get("fontFamily"),this._display.style=e,this.isDirty("role")&&this.get("role")=="tooltip"&&this._root.updateTooltip(this)}_getText(){let e=this.get("text","");return this.get("maxChars")&&(e=_t(e,this.get("maxChars",1e8),this.get("breakWords"),this.get("ellipsis"))),this.get("populateText")?De(this,e):e}markDirtyText(){this._display.text=this._getText(),this.get("role")=="tooltip"&&this._root.updateTooltip(this),this.markDirtyBounds(),this.markDirty()}_setDataItem(e){super._setDataItem(e),this.get("populateText")&&this.markDirtyText()}getNumberFormatter(){return this.parent?this.parent.getNumberFormatter():super.getNumberFormatter()}getDateFormatter(){return this.parent?this.parent.getDateFormatter():super.getDateFormatter()}getDurationFormatter(){return this.parent?this.parent.getDurationFormatter():super.getDurationFormatter()}}Object.defineProperty(se,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Text"}),Object.defineProperty(se,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:x.classNames.concat([se.className])});class ge extends L{constructor(){super(...arguments),Object.defineProperty(this,"_text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_textKeys",{enumerable:!0,configurable:!0,writable:!0,value:["text","fill","fillOpacity","textAlign","fontFamily","fontSize","fontStyle","fontWeight","fontStyle","fontVariant","textDecoration","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","shadowOpacity","lineHeight","baselineRatio","direction","textBaseline","oversizedBehavior","breakWords","ellipsis","minScale","populateText","role","ignoreFormatting","maxChars"]})}get text(){return this._text}_afterNew(){super._afterNew(),this._makeText(),_(this._textKeys,e=>{const t=this.get(e);t!=null&&this._text.set(e,t)}),this.get("html","")!==""&&this._text.set("text",""),this.onPrivate("maxWidth",()=>{this._setMaxDimentions()}),this.onPrivate("maxHeight",()=>{this._setMaxDimentions()})}_makeText(){this._text=this.children.push(se.new(this._root,{}))}_updateChildren(){if(super._updateChildren(),_(this._textKeys,e=>{this._text.set(e,this.get(e))}),this.isDirty("maxWidth")&&this._setMaxDimentions(),this.isDirty("maxHeight")&&this._setMaxDimentions(),this.isDirty("rotation")&&this._setMaxDimentions(),this.get("html","")!==""?this._text.set("text",""):this._text.set("text",this.get("text")),this.isDirty("textAlign")||this.isDirty("width")){const e=this.get("textAlign");let t;this.get("width")!=null?t=e=="right"?Je:e=="center"?qe:0:e=="left"||e=="start"?t=this.get("paddingLeft"):e!="right"&&e!="end"||(t=-this.get("paddingRight")),this.text.set("x",t)}}_setMaxDimentions(){const e=this.get("rotation"),t=e==90||e==270||e==-90,i=this.get("maxWidth",this.getPrivate("maxWidth",1/0));g(i)?this.text.set(t?"maxHeight":"maxWidth",i-this.get("paddingLeft",0)-this.get("paddingRight",0)):this.text.set(t?"maxHeight":"maxWidth",void 0);const r=this.get("maxHeight",this.getPrivate("maxHeight",1/0));g(r)?this.text.set(t?"maxWidth":"maxHeight",r-this.get("paddingTop",0)-this.get("paddingBottom",0)):this.text.set(t?"maxWidth":"maxHeight",void 0)}_setDataItem(e){super._setDataItem(e),this._markDirtyKey("text"),this.text.get("populateText")&&this.text.markDirtyText()}getText(){return this._text._getText()}}Object.defineProperty(ge,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Label"}),Object.defineProperty(ge,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:L.classNames.concat([ge.className])});class Bi{constructor(e,t){if(Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rules",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._root=e,!t)throw new Error("You cannot use `new Class()`, instead use `Class.new()`")}static new(e){const t=new this(e,!0);return t.setupDefaultRules(),t}setupDefaultRules(){}_lookupRules(e){return this._rules[e]}ruleRaw(e,t=[]){let i=this._rules[e];i||(i=this._rules[e]=[]),t.sort(F);const{index:r,found:a}=at(i,n=>{const o=F(n.tags.length,t.length);return o===0?Ze(n.tags,t,F):o});if(a)return i[r].template;{const n=J.new({});return i.splice(r,0,{tags:t,template:n}),n}}rule(e,t=[]){return this.ruleRaw(e,t)}}export{$,Wt as A,A as B,g as C,pe as D,fi as E,Xt as F,q as G,mi as H,ui as I,qt as J,wi as K,Yt as L,ci as M,T as N,F as O,Be as P,pi as Q,gi as R,_i as S,Ce as T,_e as U,di as V,y as W,X,$t as Y,Z,Re as _,ke as a,Ut as a0,Zt as a1,re as a2,v as a3,ii as a4,lt as a5,k as a6,ti as a7,ri as a8,U as a9,Ye as aA,st as aB,Dt as aC,Ot as aD,ut as aE,Gt as aF,Ci as aG,xi as aH,Me as aI,oi as aJ,yi as aK,Oe as aL,bi as aM,ki as aN,zt as aa,we as ab,Kt as ac,f as ad,Oi as ae,si as af,Ve as ag,Ti as ah,Di as ai,be as aj,vi as ak,ge as al,Ie as am,Bi as an,ji as ao,qe as ap,jt as aq,M as ar,Si as as,Pi as at,J as au,ye as av,ve as aw,$e as ax,Mi as ay,Ht as az,z as b,Ue as c,P as d,ei as e,O as f,Jt as g,Fe as h,L as i,li as j,Ei as k,ai as l,De as m,Ne as n,Ee as o,Vt as p,de as q,Je as r,se as s,Qt as t,ni as u,Pe as v,_ as w,R as x,hi as y,Y as z}; diff --git a/assets/Tick-B3uT4_8g.js b/assets/Tick-DedlQq8S.js similarity index 99% rename from assets/Tick-B3uT4_8g.js rename to assets/Tick-DedlQq8S.js index ddec058..63d70fa 100644 --- a/assets/Tick-B3uT4_8g.js +++ b/assets/Tick-DedlQq8S.js @@ -1 +1 @@ -import{ed as O}from"./index-CEWggaxV.js";import{i as C,b as q,az as Z,w as y,N as Q,aA as X,r as P,aB as W,C as M,a3 as E,ad as J,aC as ee,al as H,aD as te,a0 as z}from"./Theme-Bdh3gaKt.js";class ie extends X{constructor(){super(...arguments),Object.defineProperty(this,"processor",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}incrementRef(){}decrementRef(){}_onPush(e){this.processor&&this.processor.processRow(e),super._onPush(e)}_onInsertIndex(e,t){this.processor&&this.processor.processRow(t),super._onInsertIndex(e,t)}_onSetIndex(e,t,i){this.processor&&this.processor.processRow(i),super._onSetIndex(e,t,i)}}class R extends Z{constructor(e,t,i){super(i),Object.defineProperty(this,"component",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dataContext",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bullets",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"open",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"close",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.dataContext=t,this.component=e,this._settings.visible=!0,this._checkDirty()}markDirty(){this.component.markDirtyValues(this)}_startAnimation(){this.component._root._addAnimation(this)}_animationTime(){return this.component._root.animationTime}_dispose(){this.component&&this.component.disposeDataItem(this),super._dispose()}show(e){this.setRaw("visible",!0),this.component&&this.component.showDataItem(this,e)}hide(e){this.setRaw("visible",!1),this.component&&this.component.hideDataItem(this,e)}isHidden(){return!this.get("visible")}}class S extends C{constructor(){super(...arguments),Object.defineProperty(this,"_data",{enumerable:!0,configurable:!0,writable:!0,value:new ie}),Object.defineProperty(this,"_dataItems",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_mainDataItems",{enumerable:!0,configurable:!0,writable:!0,value:this._dataItems}),Object.defineProperty(this,"valueFields",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"fields",{enumerable:!0,configurable:!0,writable:!0,value:["id"]}),Object.defineProperty(this,"_valueFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueFieldsF",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fieldsF",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valuesDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataChanged",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataGrouped",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"inited",{enumerable:!0,configurable:!0,writable:!0,value:!1})}set data(e){e.incrementRef(),this._data.decrementRef(),this._data=e}get data(){return this._data}_dispose(){super._dispose(),this._data.decrementRef()}_onDataClear(){}_afterNew(){super._afterNew(),this._data.incrementRef(),this._updateFields(),this._disposers.push(this.data.events.onAll(e=>{const t=this._mainDataItems;if(this.markDirtyValues(),this._markDirtyGroup(),this._dataChanged=!0,e.type==="clear")y(t,i=>{i.dispose()}),t.length=0,this._onDataClear();else if(e.type==="push"){const i=new R(this,e.newValue,this._makeDataItem(e.newValue));t.push(i),this.processDataItem(i)}else if(e.type==="setIndex"){const i=t[e.index],s=this._makeDataItem(e.newValue);i.bullets&&i.bullets.length==0&&(i.bullets=void 0),Q(s).forEach(l=>{i.animate({key:l,to:s[l],duration:this.get("interpolationDuration",0),easing:this.get("interpolationEasing")})}),i.dataContext=e.newValue}else if(e.type==="insertIndex"){const i=new R(this,e.newValue,this._makeDataItem(e.newValue));t.splice(e.index,0,i),this.processDataItem(i)}else if(e.type==="removeIndex")t[e.index].dispose(),t.splice(e.index,1);else{if(e.type!=="moveIndex")throw new Error("Unknown IStreamEvent type");{const i=t[e.oldIndex];t.splice(e.oldIndex,1),t.splice(e.newIndex,0,i)}}this._afterDataChange()}))}_updateFields(){this.valueFields&&(this._valueFields=[],this._valueFieldsF={},y(this.valueFields,e=>{this.get(e+"Field")&&(this._valueFields.push(e),this._valueFieldsF[e]={fieldKey:e+"Field",workingKey:e+"Working"})})),this.fields&&(this._fields=[],this._fieldsF={},y(this.fields,e=>{this.get(e+"Field")&&(this._fields.push(e),this._fieldsF[e]=e+"Field")}))}get dataItems(){return this._dataItems}processDataItem(e){}_makeDataItem(e){const t={};return this._valueFields&&y(this._valueFields,i=>{const s=this.get(this._valueFieldsF[i].fieldKey);t[i]=e[s],t[this._valueFieldsF[i].workingKey]=t[i]}),this._fields&&y(this._fields,i=>{const s=this.get(this._fieldsF[i]);t[i]=e[s]}),t}makeDataItem(e){let t=new R(this,void 0,e);return this.processDataItem(t),t}pushDataItem(e){const t=this.makeDataItem(e);return this._mainDataItems.push(t),t}disposeDataItem(e){}showDataItem(e,t){return O(this,void 0,void 0,function*(){e.set("visible",!0)})}hideDataItem(e,t){return O(this,void 0,void 0,function*(){e.set("visible",!1)})}_clearDirty(){super._clearDirty(),this._valuesDirty=!1}_afterDataChange(){}_afterChanged(){if(super._afterChanged(),this._dataChanged){const e="datavalidated";this.events.isEnabled(e)&&this.events.dispatch(e,{type:e,target:this}),this._dataChanged=!1}this.inited=!0}markDirtyValues(e){this.markDirty(),this._valuesDirty=!0}_markDirtyGroup(){this._dataGrouped=!1}markDirtySize(){this._sizeDirty=!0,this.markDirty()}}function se(r){return new Promise((e,t)=>{setTimeout(e,r)})}Object.defineProperty(S,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Component"}),Object.defineProperty(S,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:C.classNames.concat([S.className])});let ae={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2629742400,year:31536e6};function j(r,e){return e==null&&(e=1),ae[r]*e}function G(r,e,t,i,s,l,o){if(!o||s){let h=0;switch(s||e=="millisecond"||(h=r.getTimezoneOffset(),r.setUTCMinutes(r.getUTCMinutes()-h)),e){case"day":let d=r.getUTCDate();if(t>1){if(l){l=G(l,"day",1);let D=r.getTime()-l.getTime(),v=Math.floor(D/j("day")/t),x=j("day",v*t);r.setTime(l.getTime()+x-h*j("minute"))}}else r.setUTCDate(d);r.setUTCHours(0,0,0,0);break;case"second":let n=r.getUTCSeconds();t>1&&(n=Math.floor(n/t)*t),r.setUTCSeconds(n,0);break;case"millisecond":if(t==1)return r;let m=r.getUTCMilliseconds();m=Math.floor(m/t)*t,r.setUTCMilliseconds(m);break;case"hour":let g=r.getUTCHours();t>1&&(g=Math.floor(g/t)*t),r.setUTCHours(g,0,0,0);break;case"minute":let u=r.getUTCMinutes();t>1&&(u=Math.floor(u/t)*t),r.setUTCMinutes(u,0,0);break;case"month":let a=r.getUTCMonth();t>1&&(a=Math.floor(a/t)*t),r.setUTCMonth(a,1),r.setUTCHours(0,0,0,0);break;case"year":let f=r.getUTCFullYear();t>1&&(f=Math.floor(f/t)*t),r.setUTCFullYear(f,0,1),r.setUTCHours(0,0,0,0);break;case"week":let _=r.getUTCDate(),b=r.getUTCDay();M(i)||(i=1),_=b>=i?_-b+i:_-(7+b)+i,r.setUTCDate(_),r.setUTCHours(0,0,0,0)}if(!s&&e!="millisecond"&&(r.setUTCMinutes(r.getUTCMinutes()+h),e=="day"||e=="week"||e=="month"||e=="year")){let d=r.getTimezoneOffset();if(d!=h){let n=d-h;r.setUTCMinutes(r.getUTCMinutes()+n)}}return r}{if(isNaN(r.getTime()))return r;let h=o.offsetUTC(r),d=r.getTimezoneOffset(),n=o.parseDate(r),m=n.year,g=n.month,u=n.day,a=n.hour,f=n.minute,_=n.second,b=n.millisecond,D=n.weekday,v=h-d;switch(e){case"day":if(t>1&&l){l=G(l,"day",1,i,s,void 0,o);let k=r.getTime()-l.getTime(),N=Math.floor(k/j("day")/t),I=j("day",N*t);r.setTime(l.getTime()+I),n=o.parseDate(r),m=n.year,g=n.month,u=n.day}a=0,f=v,_=0,b=0;break;case"second":f+=v,t>1&&(_=Math.floor(_/t)*t),b=0;break;case"millisecond":f+=v,t>1&&(b=Math.floor(b/t)*t);break;case"hour":t>1&&(a=Math.floor(a/t)*t),f=v,_=0,b=0;break;case"minute":t>1&&(f=Math.floor(f/t)*t),f+=v,_=0,b=0;break;case"month":t>1&&(g=Math.floor(g/t)*t),u=1,a=0,f=v,_=0,b=0;break;case"year":t>1&&(m=Math.floor(m/t)*t),g=0,u=1,a=0,f=v,_=0,b=0;break;case"week":M(i)||(i=1),u=D>=i?u-D+i:u-(7+D)+i,a=0,f=v,_=0,b=0}let x=(r=new Date(m,g,u,a,f,_,b)).getTimezoneOffset(),c=o.offsetUTC(r)-x;return c!=v&&r.setTime(r.getTime()+6e4*(c-v)),r}}class $ extends S{constructor(){super(...arguments),Object.defineProperty(this,"_aggregatesCalculated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_selectionAggregatesCalculated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataProcessed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_psi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pei",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"chart",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bullets",{enumerable:!0,configurable:!0,writable:!0,value:new X}),Object.defineProperty(this,"bulletsContainer",{enumerable:!0,configurable:!0,writable:!0,value:C.new(this._root,{width:P,height:P,position:"absolute"})})}_afterNew(){this.valueFields.push("value","customValue"),super._afterNew(),this.setPrivate("customData",{}),this._disposers.push(this.bullets.events.onAll(e=>{if(e.type==="clear")this._handleBullets(this.dataItems);else if(e.type==="push")this._handleBullets(this.dataItems);else if(e.type==="setIndex")this._handleBullets(this.dataItems);else if(e.type==="insertIndex")this._handleBullets(this.dataItems);else if(e.type==="removeIndex")this._handleBullets(this.dataItems);else{if(e.type!=="moveIndex")throw new Error("Unknown IListEvent type");this._handleBullets(this.dataItems)}}))}_dispose(){this.bulletsContainer.dispose(),super._dispose()}startIndex(){let e=this.dataItems.length;return Math.min(this.getPrivate("startIndex",0),e)}endIndex(){let e=this.dataItems.length;return Math.min(this.getPrivate("endIndex",e),e)}_handleBullets(e){y(e,t=>{const i=t.bullets;i&&(y(i,s=>{s.dispose()}),t.bullets=void 0)}),this.markDirtyValues()}getDataItemById(e){return W(this.dataItems,t=>t.get("id")==e)}_makeBullets(e){this._shouldMakeBullet(e)&&(e.bullets=[],this.bullets.each(t=>{this._makeBullet(e,t)}))}_shouldMakeBullet(e){return!0}_makeBullet(e,t,i){const s=t(this._root,this,e);return s&&(s._index=i,this._makeBulletReal(e,s)),s}_makeBulletReal(e,t){let i=t.get("sprite");i&&(i._setDataItem(e),i.setRaw("position","absolute"),this.bulletsContainer.children.push(i)),t.series=this,e.bullets.push(t)}addBullet(e,t){e.bullets||(e.bullets=[]),t&&this._makeBulletReal(e,t)}_clearDirty(){super._clearDirty(),this._aggregatesCalculated=!1,this._selectionAggregatesCalculated=!1}_prepareChildren(){super._prepareChildren();let e=this.startIndex(),t=this.endIndex();if(this.isDirty("name")&&this.updateLegendValue(),this.isDirty("heatRules")&&(this._valuesDirty=!0),this.isPrivateDirty("baseValueSeries")){const i=this.getPrivate("baseValueSeries");i&&this._disposers.push(i.onPrivate("startIndex",()=>{this.markDirtyValues()}))}if(this.get("calculateAggregates")&&(this._valuesDirty&&!this._dataProcessed&&(this._aggregatesCalculated||(this._calculateAggregates(0,this.dataItems.length),this._aggregatesCalculated=!0,e!=0&&(this._psi=void 0))),this._psi==e&&this._pei==t&&!this.isPrivateDirty("adjustedStartIndex")||this._selectionAggregatesCalculated||(e===0&&t===this.dataItems.length&&this._aggregatesCalculated||this._calculateAggregates(e,t),this._selectionAggregatesCalculated=!0)),this.isDirty("tooltip")){let i=this.get("tooltip");i&&(i.hide(0),i.set("tooltipTarget",this))}if(this.isDirty("fill")||this.isDirty("stroke")){let i;const s=this.get("legendDataItem");if(s&&(i=s.get("markerRectangle"),i&&this.isVisible())){if(this.isDirty("stroke")){let l=this.get("stroke");i.set("stroke",l)}if(this.isDirty("fill")){let l=this.get("fill");i.set("fill",l)}}this.updateLegendMarker(void 0)}if(this.bullets.length>0){let i=this.startIndex(),s=this.endIndex();s{s[a]=0,l[a]=0,o[a]=0}),y(i,a=>{let f=a+"Change",_=a+"ChangePercent",b=a+"ChangePrevious",D=a+"ChangePreviousPercent",v=a+"ChangeSelection",x=a+"ChangeSelectionPercent",c="valueY";a!="valueX"&&a!="openValueX"&&a!="lowValueX"&&a!="highValueX"||(c="valueX");const k=this.getPrivate("baseValueSeries"),N=this.getPrivate("adjustedStartIndex",e);for(let I=N;Ip||h[a]==null)&&(h[a]=p),(d[a]0&&e--,delete u[a];for(let I=e;I{this.setPrivate(a+"AverageSelection",g[a]),this.setPrivate(a+"CountSelection",o[a]),this.setPrivate(a+"SumSelection",s[a]),this.setPrivate(a+"AbsoluteSumSelection",l[a]),this.setPrivate(a+"LowSelection",h[a]),this.setPrivate(a+"HighSelection",d[a]),this.setPrivate(a+"OpenSelection",n[a]),this.setPrivate(a+"CloseSelection",m[a])}),e===0&&t===this.dataItems.length&&y(i,a=>{this.setPrivate(a+"Average",g[a]),this.setPrivate(a+"Count",o[a]),this.setPrivate(a+"Sum",s[a]),this.setPrivate(a+"AbsoluteSum",l[a]),this.setPrivate(a+"Low",h[a]),this.setPrivate(a+"High",d[a]),this.setPrivate(a+"Open",n[a]),this.setPrivate(a+"Close",m[a])})}_updateChildren(){super._updateChildren(),this._psi=this.startIndex(),this._pei=this.endIndex(),this.isDirty("visible")&&this.bulletsContainer.set("visible",this.get("visible"));const e=this.get("heatRules");if(this._valuesDirty&&e&&e.length>0&&y(e,t=>{const i=t.minValue||this.getPrivate(t.dataField+"Low")||0,s=t.maxValue||this.getPrivate(t.dataField+"High")||0;y(t.target._entities,l=>{const o=l.dataItem.get(t.dataField);if(M(o))if(t.customFunction)t.customFunction.call(this,l,i,s,o);else{let h,d;h=t.logarithmic?(Math.log(o)*Math.LOG10E-Math.log(i)*Math.LOG10E)/(Math.log(s)*Math.LOG10E-Math.log(i)*Math.LOG10E):(o-i)/(s-i),!M(o)||M(h)&&Math.abs(h)!=1/0||(h=.5),M(t.min)?d=t.min+(t.max-t.min)*h:t.min instanceof E?d=E.interpolate(h,t.min,t.max):t.min instanceof J&&(d=ee(h,t.min,t.max)),l.set(t.key,d);const n=l.states;if(n){const m=n.lookup("default");m&&m.set(t.key,d)}}else{t.neutral&&l.set(t.key,t.neutral);const h=l.states;if(h){const d=h.lookup("default");d&&d.set(t.key,t.neutral)}}})}),this.get("visible")){let t=this.dataItems.length,i=this.startIndex(),s=this.endIndex();s0&&i--;for(let l=0;l{this._positionBullet(t);const i=t.get("sprite");t.get("dynamic")&&(i&&(i._markDirtyKey("fill"),i.markDirtySize()),i instanceof C&&i.walkChildren(s=>{s._markDirtyKey("fill"),s.markDirtySize(),s instanceof H&&s.text.markDirtyText()})),i instanceof H&&i.get("populateText")&&i.text.markDirtyText()})}_hideBullets(e){e.bullets&&y(e.bullets,t=>{let i=t.get("sprite");i&&i.setPrivate("visible",!1)})}_positionBullet(e){}_placeBulletsContainer(e){e.bulletsContainer.children.moveValue(this.bulletsContainer)}_removeBulletsContainer(){const e=this.bulletsContainer;e.parent&&e.parent.children.removeValue(e)}disposeDataItem(e){const t=e.bullets;t&&y(t,i=>{i.dispose()})}_getItemReaderLabel(){return""}showDataItem(e,t){const i=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return O(this,void 0,void 0,function*(){const s=[i.showDataItem.call(this,e,t)],l=e.bullets;l&&y(l,o=>{const h=o.get("sprite");h&&s.push(h.show(t))}),yield Promise.all(s)})}hideDataItem(e,t){const i=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return O(this,void 0,void 0,function*(){const s=[i.hideDataItem.call(this,e,t)],l=e.bullets;l&&y(l,o=>{const h=o.get("sprite");h&&s.push(h.hide(t))}),yield Promise.all(s)})}_sequencedShowHide(e,t){return O(this,void 0,void 0,function*(){if(this.get("sequencedInterpolation"))if(M(t)||(t=this.get("interpolationDuration",0)),t>0){const i=this.startIndex(),s=this.endIndex();yield Promise.all(z(this.dataItems,(l,o)=>O(this,void 0,void 0,function*(){let h=t||0;(os+10)&&(h=0);let d=this.get("sequencedDelay",0)+h/(s-i);yield se(d*(o-i)),e?yield this.showDataItem(l,h):yield this.hideDataItem(l,h)})))}else yield Promise.all(z(this.dataItems,i=>e?this.showDataItem(i,0):this.hideDataItem(i,0)))})}updateLegendValue(e){if(e){const t=e.get("legendDataItem");if(t){const i=t.get("valueLabel");if(i){const l=i.text;let o="";i._setDataItem(e),o=this.get("legendValueText",l.get("text","")),i.set("text",o),l.markDirtyText()}const s=t.get("label");if(s){const l=s.text;let o="";s._setDataItem(e),o=this.get("legendLabelText",l.get("text","")),s.set("text",o),l.markDirtyText()}}}}updateLegendMarker(e){}_onHide(){super._onHide();const e=this.getTooltip();e&&e.hide()}hoverDataItem(e){}unhoverDataItem(e){}_getBase(e){const t=this.dataItems[this.startIndex()];return t?t.get(e):0}}function K(r,e){for(let t=0,i=e.length;t0){let l=s[0];if(l.length>0){let o=l[0];r.moveTo(o.x,o.y);for(let h=0,d=s.length;h0){let i=e[0];this._display.moveTo(i.x,i.y),K(this._display,[[e]])}else if(t)K(this._display,t);else if(!this.get("draw")){let i=this.width(),s=this.height();this._display.moveTo(0,0),this._display.lineTo(i,s)}}}}function de(r){return function(){return r}}Object.defineProperty(F,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Line"}),Object.defineProperty(F,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:q.classNames.concat([F.className])});const A=Math.PI,L=2*A,T=1e-6,re=L-T;function Y(r){this._+=r[0];for(let e=1,t=r.length;e=0))throw new Error(`invalid digits: ${r}`);if(e>15)return Y;const t=10**e;return function(i){this._+=i[0];for(let s=1,l=i.length;sT)if(Math.abs(g*d-n*m)>T&&l){let a=i-o,f=s-h,_=d*d+n*n,b=a*a+f*f,D=Math.sqrt(_),v=Math.sqrt(u),x=l*Math.tan((A-Math.acos((_+u-b)/(2*D*v)))/2),c=x/v,k=x/D;Math.abs(c-1)>T&&this._append`L${e+c*m},${t+c*g}`,this._append`A${l},${l},0,0,${+(g*a>m*f)},${this._x1=e+k*d},${this._y1=t+k*n}`}else this._append`L${this._x1=e},${this._y1=t}`}arc(e,t,i,s,l,o){if(e=+e,t=+t,o=!!o,(i=+i)<0)throw new Error(`negative radius: ${i}`);let h=i*Math.cos(s),d=i*Math.sin(s),n=e+h,m=t+d,g=1^o,u=o?s-l:l-s;this._x1===null?this._append`M${n},${m}`:(Math.abs(this._x1-n)>T||Math.abs(this._y1-m)>T)&&this._append`L${n},${m}`,i&&(u<0&&(u=u%L+L),u>re?this._append`A${i},${i},0,1,${g},${e-h},${t-d}A${i},${i},0,1,${g},${this._x1=n},${this._y1=m}`:u>T&&this._append`A${i},${i},0,${+(u>=A)},${g},${this._x1=e+i*Math.cos(l)},${this._y1=t+i*Math.sin(l)}`)}rect(e,t,i,s){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${i=+i}v${+s}h${-i}Z`}toString(){return this._}}function ce(r){let e=3;return r.digits=function(t){if(!arguments.length)return e;if(t==null)e=null;else{const i=Math.floor(t);if(!(i>=0))throw new RangeError(`invalid digits: ${t}`);e=i}return r},()=>new oe(e)}class V extends C{constructor(){super(...arguments),Object.defineProperty(this,"chartContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(C.new(this._root,{width:P,height:P,interactiveChildren:!1}))}),Object.defineProperty(this,"bulletsContainer",{enumerable:!0,configurable:!0,writable:!0,value:C.new(this._root,{interactiveChildren:!1,isMeasured:!1,position:"absolute",width:P,height:P})})}}Object.defineProperty(V,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Chart"}),Object.defineProperty(V,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:C.classNames.concat([V.className])});class B extends V{constructor(){super(...arguments),Object.defineProperty(this,"seriesContainer",{enumerable:!0,configurable:!0,writable:!0,value:C.new(this._root,{width:P,height:P,isMeasured:!1})}),Object.defineProperty(this,"series",{enumerable:!0,configurable:!0,writable:!0,value:new te})}_afterNew(){super._afterNew(),this._disposers.push(this.series);const e=this.seriesContainer.children;this._disposers.push(this.series.events.onAll(t=>{if(t.type==="clear"){y(t.oldValues,s=>{this._removeSeries(s)});const i=this.get("colors");i&&i.reset()}else if(t.type==="push")e.moveValue(t.newValue),this._processSeries(t.newValue);else if(t.type==="setIndex")e.setIndex(t.index,t.newValue),this._processSeries(t.newValue);else if(t.type==="insertIndex")e.insertIndex(t.index,t.newValue),this._processSeries(t.newValue);else if(t.type==="removeIndex")this._removeSeries(t.oldValue);else{if(t.type!=="moveIndex")throw new Error("Unknown IListEvent type");e.moveValue(t.value,t.newIndex),this._processSeries(t.value)}}))}_processSeries(e){e.chart=this,e._placeBulletsContainer(this)}_removeSeries(e){e.isDisposed()||(this.seriesContainer.children.removeValue(e),e._removeBulletsContainer())}}Object.defineProperty(B,"className",{enumerable:!0,configurable:!0,writable:!0,value:"SerialChart"}),Object.defineProperty(B,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:V.classNames.concat([B.className])});class U extends F{}Object.defineProperty(U,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Tick"}),Object.defineProperty(U,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:F.classNames.concat([U.className])});export{$ as D,G as I,B as R,U,ce as V,S as _,R as g,de as k}; +import{ed as O}from"./index-BjUNJPVf.js";import{i as C,b as q,az as Z,w as y,N as Q,aA as X,r as P,aB as W,C as M,a3 as E,ad as J,aC as ee,al as H,aD as te,a0 as z}from"./Theme-6HY29PEY.js";class ie extends X{constructor(){super(...arguments),Object.defineProperty(this,"processor",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}incrementRef(){}decrementRef(){}_onPush(e){this.processor&&this.processor.processRow(e),super._onPush(e)}_onInsertIndex(e,t){this.processor&&this.processor.processRow(t),super._onInsertIndex(e,t)}_onSetIndex(e,t,i){this.processor&&this.processor.processRow(i),super._onSetIndex(e,t,i)}}class R extends Z{constructor(e,t,i){super(i),Object.defineProperty(this,"component",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dataContext",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bullets",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"open",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"close",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.dataContext=t,this.component=e,this._settings.visible=!0,this._checkDirty()}markDirty(){this.component.markDirtyValues(this)}_startAnimation(){this.component._root._addAnimation(this)}_animationTime(){return this.component._root.animationTime}_dispose(){this.component&&this.component.disposeDataItem(this),super._dispose()}show(e){this.setRaw("visible",!0),this.component&&this.component.showDataItem(this,e)}hide(e){this.setRaw("visible",!1),this.component&&this.component.hideDataItem(this,e)}isHidden(){return!this.get("visible")}}class S extends C{constructor(){super(...arguments),Object.defineProperty(this,"_data",{enumerable:!0,configurable:!0,writable:!0,value:new ie}),Object.defineProperty(this,"_dataItems",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_mainDataItems",{enumerable:!0,configurable:!0,writable:!0,value:this._dataItems}),Object.defineProperty(this,"valueFields",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"fields",{enumerable:!0,configurable:!0,writable:!0,value:["id"]}),Object.defineProperty(this,"_valueFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueFieldsF",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fieldsF",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valuesDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataChanged",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataGrouped",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"inited",{enumerable:!0,configurable:!0,writable:!0,value:!1})}set data(e){e.incrementRef(),this._data.decrementRef(),this._data=e}get data(){return this._data}_dispose(){super._dispose(),this._data.decrementRef()}_onDataClear(){}_afterNew(){super._afterNew(),this._data.incrementRef(),this._updateFields(),this._disposers.push(this.data.events.onAll(e=>{const t=this._mainDataItems;if(this.markDirtyValues(),this._markDirtyGroup(),this._dataChanged=!0,e.type==="clear")y(t,i=>{i.dispose()}),t.length=0,this._onDataClear();else if(e.type==="push"){const i=new R(this,e.newValue,this._makeDataItem(e.newValue));t.push(i),this.processDataItem(i)}else if(e.type==="setIndex"){const i=t[e.index],s=this._makeDataItem(e.newValue);i.bullets&&i.bullets.length==0&&(i.bullets=void 0),Q(s).forEach(l=>{i.animate({key:l,to:s[l],duration:this.get("interpolationDuration",0),easing:this.get("interpolationEasing")})}),i.dataContext=e.newValue}else if(e.type==="insertIndex"){const i=new R(this,e.newValue,this._makeDataItem(e.newValue));t.splice(e.index,0,i),this.processDataItem(i)}else if(e.type==="removeIndex")t[e.index].dispose(),t.splice(e.index,1);else{if(e.type!=="moveIndex")throw new Error("Unknown IStreamEvent type");{const i=t[e.oldIndex];t.splice(e.oldIndex,1),t.splice(e.newIndex,0,i)}}this._afterDataChange()}))}_updateFields(){this.valueFields&&(this._valueFields=[],this._valueFieldsF={},y(this.valueFields,e=>{this.get(e+"Field")&&(this._valueFields.push(e),this._valueFieldsF[e]={fieldKey:e+"Field",workingKey:e+"Working"})})),this.fields&&(this._fields=[],this._fieldsF={},y(this.fields,e=>{this.get(e+"Field")&&(this._fields.push(e),this._fieldsF[e]=e+"Field")}))}get dataItems(){return this._dataItems}processDataItem(e){}_makeDataItem(e){const t={};return this._valueFields&&y(this._valueFields,i=>{const s=this.get(this._valueFieldsF[i].fieldKey);t[i]=e[s],t[this._valueFieldsF[i].workingKey]=t[i]}),this._fields&&y(this._fields,i=>{const s=this.get(this._fieldsF[i]);t[i]=e[s]}),t}makeDataItem(e){let t=new R(this,void 0,e);return this.processDataItem(t),t}pushDataItem(e){const t=this.makeDataItem(e);return this._mainDataItems.push(t),t}disposeDataItem(e){}showDataItem(e,t){return O(this,void 0,void 0,function*(){e.set("visible",!0)})}hideDataItem(e,t){return O(this,void 0,void 0,function*(){e.set("visible",!1)})}_clearDirty(){super._clearDirty(),this._valuesDirty=!1}_afterDataChange(){}_afterChanged(){if(super._afterChanged(),this._dataChanged){const e="datavalidated";this.events.isEnabled(e)&&this.events.dispatch(e,{type:e,target:this}),this._dataChanged=!1}this.inited=!0}markDirtyValues(e){this.markDirty(),this._valuesDirty=!0}_markDirtyGroup(){this._dataGrouped=!1}markDirtySize(){this._sizeDirty=!0,this.markDirty()}}function se(r){return new Promise((e,t)=>{setTimeout(e,r)})}Object.defineProperty(S,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Component"}),Object.defineProperty(S,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:C.classNames.concat([S.className])});let ae={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2629742400,year:31536e6};function j(r,e){return e==null&&(e=1),ae[r]*e}function G(r,e,t,i,s,l,o){if(!o||s){let h=0;switch(s||e=="millisecond"||(h=r.getTimezoneOffset(),r.setUTCMinutes(r.getUTCMinutes()-h)),e){case"day":let d=r.getUTCDate();if(t>1){if(l){l=G(l,"day",1);let D=r.getTime()-l.getTime(),v=Math.floor(D/j("day")/t),x=j("day",v*t);r.setTime(l.getTime()+x-h*j("minute"))}}else r.setUTCDate(d);r.setUTCHours(0,0,0,0);break;case"second":let n=r.getUTCSeconds();t>1&&(n=Math.floor(n/t)*t),r.setUTCSeconds(n,0);break;case"millisecond":if(t==1)return r;let m=r.getUTCMilliseconds();m=Math.floor(m/t)*t,r.setUTCMilliseconds(m);break;case"hour":let g=r.getUTCHours();t>1&&(g=Math.floor(g/t)*t),r.setUTCHours(g,0,0,0);break;case"minute":let u=r.getUTCMinutes();t>1&&(u=Math.floor(u/t)*t),r.setUTCMinutes(u,0,0);break;case"month":let a=r.getUTCMonth();t>1&&(a=Math.floor(a/t)*t),r.setUTCMonth(a,1),r.setUTCHours(0,0,0,0);break;case"year":let f=r.getUTCFullYear();t>1&&(f=Math.floor(f/t)*t),r.setUTCFullYear(f,0,1),r.setUTCHours(0,0,0,0);break;case"week":let _=r.getUTCDate(),b=r.getUTCDay();M(i)||(i=1),_=b>=i?_-b+i:_-(7+b)+i,r.setUTCDate(_),r.setUTCHours(0,0,0,0)}if(!s&&e!="millisecond"&&(r.setUTCMinutes(r.getUTCMinutes()+h),e=="day"||e=="week"||e=="month"||e=="year")){let d=r.getTimezoneOffset();if(d!=h){let n=d-h;r.setUTCMinutes(r.getUTCMinutes()+n)}}return r}{if(isNaN(r.getTime()))return r;let h=o.offsetUTC(r),d=r.getTimezoneOffset(),n=o.parseDate(r),m=n.year,g=n.month,u=n.day,a=n.hour,f=n.minute,_=n.second,b=n.millisecond,D=n.weekday,v=h-d;switch(e){case"day":if(t>1&&l){l=G(l,"day",1,i,s,void 0,o);let k=r.getTime()-l.getTime(),N=Math.floor(k/j("day")/t),I=j("day",N*t);r.setTime(l.getTime()+I),n=o.parseDate(r),m=n.year,g=n.month,u=n.day}a=0,f=v,_=0,b=0;break;case"second":f+=v,t>1&&(_=Math.floor(_/t)*t),b=0;break;case"millisecond":f+=v,t>1&&(b=Math.floor(b/t)*t);break;case"hour":t>1&&(a=Math.floor(a/t)*t),f=v,_=0,b=0;break;case"minute":t>1&&(f=Math.floor(f/t)*t),f+=v,_=0,b=0;break;case"month":t>1&&(g=Math.floor(g/t)*t),u=1,a=0,f=v,_=0,b=0;break;case"year":t>1&&(m=Math.floor(m/t)*t),g=0,u=1,a=0,f=v,_=0,b=0;break;case"week":M(i)||(i=1),u=D>=i?u-D+i:u-(7+D)+i,a=0,f=v,_=0,b=0}let x=(r=new Date(m,g,u,a,f,_,b)).getTimezoneOffset(),c=o.offsetUTC(r)-x;return c!=v&&r.setTime(r.getTime()+6e4*(c-v)),r}}class $ extends S{constructor(){super(...arguments),Object.defineProperty(this,"_aggregatesCalculated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_selectionAggregatesCalculated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataProcessed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_psi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pei",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"chart",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bullets",{enumerable:!0,configurable:!0,writable:!0,value:new X}),Object.defineProperty(this,"bulletsContainer",{enumerable:!0,configurable:!0,writable:!0,value:C.new(this._root,{width:P,height:P,position:"absolute"})})}_afterNew(){this.valueFields.push("value","customValue"),super._afterNew(),this.setPrivate("customData",{}),this._disposers.push(this.bullets.events.onAll(e=>{if(e.type==="clear")this._handleBullets(this.dataItems);else if(e.type==="push")this._handleBullets(this.dataItems);else if(e.type==="setIndex")this._handleBullets(this.dataItems);else if(e.type==="insertIndex")this._handleBullets(this.dataItems);else if(e.type==="removeIndex")this._handleBullets(this.dataItems);else{if(e.type!=="moveIndex")throw new Error("Unknown IListEvent type");this._handleBullets(this.dataItems)}}))}_dispose(){this.bulletsContainer.dispose(),super._dispose()}startIndex(){let e=this.dataItems.length;return Math.min(this.getPrivate("startIndex",0),e)}endIndex(){let e=this.dataItems.length;return Math.min(this.getPrivate("endIndex",e),e)}_handleBullets(e){y(e,t=>{const i=t.bullets;i&&(y(i,s=>{s.dispose()}),t.bullets=void 0)}),this.markDirtyValues()}getDataItemById(e){return W(this.dataItems,t=>t.get("id")==e)}_makeBullets(e){this._shouldMakeBullet(e)&&(e.bullets=[],this.bullets.each(t=>{this._makeBullet(e,t)}))}_shouldMakeBullet(e){return!0}_makeBullet(e,t,i){const s=t(this._root,this,e);return s&&(s._index=i,this._makeBulletReal(e,s)),s}_makeBulletReal(e,t){let i=t.get("sprite");i&&(i._setDataItem(e),i.setRaw("position","absolute"),this.bulletsContainer.children.push(i)),t.series=this,e.bullets.push(t)}addBullet(e,t){e.bullets||(e.bullets=[]),t&&this._makeBulletReal(e,t)}_clearDirty(){super._clearDirty(),this._aggregatesCalculated=!1,this._selectionAggregatesCalculated=!1}_prepareChildren(){super._prepareChildren();let e=this.startIndex(),t=this.endIndex();if(this.isDirty("name")&&this.updateLegendValue(),this.isDirty("heatRules")&&(this._valuesDirty=!0),this.isPrivateDirty("baseValueSeries")){const i=this.getPrivate("baseValueSeries");i&&this._disposers.push(i.onPrivate("startIndex",()=>{this.markDirtyValues()}))}if(this.get("calculateAggregates")&&(this._valuesDirty&&!this._dataProcessed&&(this._aggregatesCalculated||(this._calculateAggregates(0,this.dataItems.length),this._aggregatesCalculated=!0,e!=0&&(this._psi=void 0))),this._psi==e&&this._pei==t&&!this.isPrivateDirty("adjustedStartIndex")||this._selectionAggregatesCalculated||(e===0&&t===this.dataItems.length&&this._aggregatesCalculated||this._calculateAggregates(e,t),this._selectionAggregatesCalculated=!0)),this.isDirty("tooltip")){let i=this.get("tooltip");i&&(i.hide(0),i.set("tooltipTarget",this))}if(this.isDirty("fill")||this.isDirty("stroke")){let i;const s=this.get("legendDataItem");if(s&&(i=s.get("markerRectangle"),i&&this.isVisible())){if(this.isDirty("stroke")){let l=this.get("stroke");i.set("stroke",l)}if(this.isDirty("fill")){let l=this.get("fill");i.set("fill",l)}}this.updateLegendMarker(void 0)}if(this.bullets.length>0){let i=this.startIndex(),s=this.endIndex();s{s[a]=0,l[a]=0,o[a]=0}),y(i,a=>{let f=a+"Change",_=a+"ChangePercent",b=a+"ChangePrevious",D=a+"ChangePreviousPercent",v=a+"ChangeSelection",x=a+"ChangeSelectionPercent",c="valueY";a!="valueX"&&a!="openValueX"&&a!="lowValueX"&&a!="highValueX"||(c="valueX");const k=this.getPrivate("baseValueSeries"),N=this.getPrivate("adjustedStartIndex",e);for(let I=N;Ip||h[a]==null)&&(h[a]=p),(d[a]0&&e--,delete u[a];for(let I=e;I{this.setPrivate(a+"AverageSelection",g[a]),this.setPrivate(a+"CountSelection",o[a]),this.setPrivate(a+"SumSelection",s[a]),this.setPrivate(a+"AbsoluteSumSelection",l[a]),this.setPrivate(a+"LowSelection",h[a]),this.setPrivate(a+"HighSelection",d[a]),this.setPrivate(a+"OpenSelection",n[a]),this.setPrivate(a+"CloseSelection",m[a])}),e===0&&t===this.dataItems.length&&y(i,a=>{this.setPrivate(a+"Average",g[a]),this.setPrivate(a+"Count",o[a]),this.setPrivate(a+"Sum",s[a]),this.setPrivate(a+"AbsoluteSum",l[a]),this.setPrivate(a+"Low",h[a]),this.setPrivate(a+"High",d[a]),this.setPrivate(a+"Open",n[a]),this.setPrivate(a+"Close",m[a])})}_updateChildren(){super._updateChildren(),this._psi=this.startIndex(),this._pei=this.endIndex(),this.isDirty("visible")&&this.bulletsContainer.set("visible",this.get("visible"));const e=this.get("heatRules");if(this._valuesDirty&&e&&e.length>0&&y(e,t=>{const i=t.minValue||this.getPrivate(t.dataField+"Low")||0,s=t.maxValue||this.getPrivate(t.dataField+"High")||0;y(t.target._entities,l=>{const o=l.dataItem.get(t.dataField);if(M(o))if(t.customFunction)t.customFunction.call(this,l,i,s,o);else{let h,d;h=t.logarithmic?(Math.log(o)*Math.LOG10E-Math.log(i)*Math.LOG10E)/(Math.log(s)*Math.LOG10E-Math.log(i)*Math.LOG10E):(o-i)/(s-i),!M(o)||M(h)&&Math.abs(h)!=1/0||(h=.5),M(t.min)?d=t.min+(t.max-t.min)*h:t.min instanceof E?d=E.interpolate(h,t.min,t.max):t.min instanceof J&&(d=ee(h,t.min,t.max)),l.set(t.key,d);const n=l.states;if(n){const m=n.lookup("default");m&&m.set(t.key,d)}}else{t.neutral&&l.set(t.key,t.neutral);const h=l.states;if(h){const d=h.lookup("default");d&&d.set(t.key,t.neutral)}}})}),this.get("visible")){let t=this.dataItems.length,i=this.startIndex(),s=this.endIndex();s0&&i--;for(let l=0;l{this._positionBullet(t);const i=t.get("sprite");t.get("dynamic")&&(i&&(i._markDirtyKey("fill"),i.markDirtySize()),i instanceof C&&i.walkChildren(s=>{s._markDirtyKey("fill"),s.markDirtySize(),s instanceof H&&s.text.markDirtyText()})),i instanceof H&&i.get("populateText")&&i.text.markDirtyText()})}_hideBullets(e){e.bullets&&y(e.bullets,t=>{let i=t.get("sprite");i&&i.setPrivate("visible",!1)})}_positionBullet(e){}_placeBulletsContainer(e){e.bulletsContainer.children.moveValue(this.bulletsContainer)}_removeBulletsContainer(){const e=this.bulletsContainer;e.parent&&e.parent.children.removeValue(e)}disposeDataItem(e){const t=e.bullets;t&&y(t,i=>{i.dispose()})}_getItemReaderLabel(){return""}showDataItem(e,t){const i=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return O(this,void 0,void 0,function*(){const s=[i.showDataItem.call(this,e,t)],l=e.bullets;l&&y(l,o=>{const h=o.get("sprite");h&&s.push(h.show(t))}),yield Promise.all(s)})}hideDataItem(e,t){const i=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return O(this,void 0,void 0,function*(){const s=[i.hideDataItem.call(this,e,t)],l=e.bullets;l&&y(l,o=>{const h=o.get("sprite");h&&s.push(h.hide(t))}),yield Promise.all(s)})}_sequencedShowHide(e,t){return O(this,void 0,void 0,function*(){if(this.get("sequencedInterpolation"))if(M(t)||(t=this.get("interpolationDuration",0)),t>0){const i=this.startIndex(),s=this.endIndex();yield Promise.all(z(this.dataItems,(l,o)=>O(this,void 0,void 0,function*(){let h=t||0;(os+10)&&(h=0);let d=this.get("sequencedDelay",0)+h/(s-i);yield se(d*(o-i)),e?yield this.showDataItem(l,h):yield this.hideDataItem(l,h)})))}else yield Promise.all(z(this.dataItems,i=>e?this.showDataItem(i,0):this.hideDataItem(i,0)))})}updateLegendValue(e){if(e){const t=e.get("legendDataItem");if(t){const i=t.get("valueLabel");if(i){const l=i.text;let o="";i._setDataItem(e),o=this.get("legendValueText",l.get("text","")),i.set("text",o),l.markDirtyText()}const s=t.get("label");if(s){const l=s.text;let o="";s._setDataItem(e),o=this.get("legendLabelText",l.get("text","")),s.set("text",o),l.markDirtyText()}}}}updateLegendMarker(e){}_onHide(){super._onHide();const e=this.getTooltip();e&&e.hide()}hoverDataItem(e){}unhoverDataItem(e){}_getBase(e){const t=this.dataItems[this.startIndex()];return t?t.get(e):0}}function K(r,e){for(let t=0,i=e.length;t0){let l=s[0];if(l.length>0){let o=l[0];r.moveTo(o.x,o.y);for(let h=0,d=s.length;h0){let i=e[0];this._display.moveTo(i.x,i.y),K(this._display,[[e]])}else if(t)K(this._display,t);else if(!this.get("draw")){let i=this.width(),s=this.height();this._display.moveTo(0,0),this._display.lineTo(i,s)}}}}function de(r){return function(){return r}}Object.defineProperty(F,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Line"}),Object.defineProperty(F,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:q.classNames.concat([F.className])});const A=Math.PI,L=2*A,T=1e-6,re=L-T;function Y(r){this._+=r[0];for(let e=1,t=r.length;e=0))throw new Error(`invalid digits: ${r}`);if(e>15)return Y;const t=10**e;return function(i){this._+=i[0];for(let s=1,l=i.length;sT)if(Math.abs(g*d-n*m)>T&&l){let a=i-o,f=s-h,_=d*d+n*n,b=a*a+f*f,D=Math.sqrt(_),v=Math.sqrt(u),x=l*Math.tan((A-Math.acos((_+u-b)/(2*D*v)))/2),c=x/v,k=x/D;Math.abs(c-1)>T&&this._append`L${e+c*m},${t+c*g}`,this._append`A${l},${l},0,0,${+(g*a>m*f)},${this._x1=e+k*d},${this._y1=t+k*n}`}else this._append`L${this._x1=e},${this._y1=t}`}arc(e,t,i,s,l,o){if(e=+e,t=+t,o=!!o,(i=+i)<0)throw new Error(`negative radius: ${i}`);let h=i*Math.cos(s),d=i*Math.sin(s),n=e+h,m=t+d,g=1^o,u=o?s-l:l-s;this._x1===null?this._append`M${n},${m}`:(Math.abs(this._x1-n)>T||Math.abs(this._y1-m)>T)&&this._append`L${n},${m}`,i&&(u<0&&(u=u%L+L),u>re?this._append`A${i},${i},0,1,${g},${e-h},${t-d}A${i},${i},0,1,${g},${this._x1=n},${this._y1=m}`:u>T&&this._append`A${i},${i},0,${+(u>=A)},${g},${this._x1=e+i*Math.cos(l)},${this._y1=t+i*Math.sin(l)}`)}rect(e,t,i,s){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${i=+i}v${+s}h${-i}Z`}toString(){return this._}}function ce(r){let e=3;return r.digits=function(t){if(!arguments.length)return e;if(t==null)e=null;else{const i=Math.floor(t);if(!(i>=0))throw new RangeError(`invalid digits: ${t}`);e=i}return r},()=>new oe(e)}class V extends C{constructor(){super(...arguments),Object.defineProperty(this,"chartContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(C.new(this._root,{width:P,height:P,interactiveChildren:!1}))}),Object.defineProperty(this,"bulletsContainer",{enumerable:!0,configurable:!0,writable:!0,value:C.new(this._root,{interactiveChildren:!1,isMeasured:!1,position:"absolute",width:P,height:P})})}}Object.defineProperty(V,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Chart"}),Object.defineProperty(V,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:C.classNames.concat([V.className])});class B extends V{constructor(){super(...arguments),Object.defineProperty(this,"seriesContainer",{enumerable:!0,configurable:!0,writable:!0,value:C.new(this._root,{width:P,height:P,isMeasured:!1})}),Object.defineProperty(this,"series",{enumerable:!0,configurable:!0,writable:!0,value:new te})}_afterNew(){super._afterNew(),this._disposers.push(this.series);const e=this.seriesContainer.children;this._disposers.push(this.series.events.onAll(t=>{if(t.type==="clear"){y(t.oldValues,s=>{this._removeSeries(s)});const i=this.get("colors");i&&i.reset()}else if(t.type==="push")e.moveValue(t.newValue),this._processSeries(t.newValue);else if(t.type==="setIndex")e.setIndex(t.index,t.newValue),this._processSeries(t.newValue);else if(t.type==="insertIndex")e.insertIndex(t.index,t.newValue),this._processSeries(t.newValue);else if(t.type==="removeIndex")this._removeSeries(t.oldValue);else{if(t.type!=="moveIndex")throw new Error("Unknown IListEvent type");e.moveValue(t.value,t.newIndex),this._processSeries(t.value)}}))}_processSeries(e){e.chart=this,e._placeBulletsContainer(this)}_removeSeries(e){e.isDisposed()||(this.seriesContainer.children.removeValue(e),e._removeBulletsContainer())}}Object.defineProperty(B,"className",{enumerable:!0,configurable:!0,writable:!0,value:"SerialChart"}),Object.defineProperty(B,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:V.classNames.concat([B.className])});class U extends F{}Object.defineProperty(U,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Tick"}),Object.defineProperty(U,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:F.classNames.concat([U.className])});export{$ as D,G as I,B as R,U,ce as V,S as _,R as g,de as k}; diff --git a/assets/TileContainer-Ci6dOowA.js b/assets/TileContainer-Bs-vXdD_.js similarity index 82% rename from assets/TileContainer-Ci6dOowA.js rename to assets/TileContainer-Bs-vXdD_.js index 90feeb9..7a88ba3 100644 --- a/assets/TileContainer-Ci6dOowA.js +++ b/assets/TileContainer-Bs-vXdD_.js @@ -1 +1 @@ -import{E as l}from"./index-CEWggaxV.js";import{E as n}from"./Container-CB7SlLB9.js";import{n as i,_ as o,y as a}from"./WGLContainer-B_Pv-8Yi.js";const c=(s,e)=>s.key.level-e.key.level!=0?s.key.level-e.key.level:s.key.row-e.key.row!=0?s.key.row-e.key.row:s.key.col-e.key.col;class f extends i{constructor(e){super(),this._tileInfoView=e}renderChildren(e){this.sortChildren(c),this.setStencilReference(e),super.renderChildren(e)}createRenderParams(e){const{state:r}=e,t=super.createRenderParams(e);return t.requiredLevel=this._tileInfoView.getClosestInfoForScale(r.scale).level,t.displayLevel=this._tileInfoView.tileInfo.scaleToZoom(r.scale),t}prepareRenderPasses(e){const r=super.prepareRenderPasses(e);return r.push(e.registerRenderPass({name:"stencil",brushes:[o],drawPhase:n.DEBUG|n.MAP|n.HIGHLIGHT|n.LABEL,target:()=>this.getStencilTarget()})),l("esri-tiles-debug")&&r.push(e.registerRenderPass({name:"tileInfo",brushes:[a],drawPhase:n.DEBUG,target:()=>this.children})),r}getStencilTarget(){return this.children}setStencilReference(e){let r=1;for(const t of this.children)t.stencilRef=r++}}export{f as i}; +import{E as l}from"./index-BjUNJPVf.js";import{E as n}from"./Container-_n5wCgez.js";import{n as i,_ as o,y as a}from"./WGLContainer-DgZNq7b0.js";const c=(s,e)=>s.key.level-e.key.level!=0?s.key.level-e.key.level:s.key.row-e.key.row!=0?s.key.row-e.key.row:s.key.col-e.key.col;class f extends i{constructor(e){super(),this._tileInfoView=e}renderChildren(e){this.sortChildren(c),this.setStencilReference(e),super.renderChildren(e)}createRenderParams(e){const{state:r}=e,t=super.createRenderParams(e);return t.requiredLevel=this._tileInfoView.getClosestInfoForScale(r.scale).level,t.displayLevel=this._tileInfoView.tileInfo.scaleToZoom(r.scale),t}prepareRenderPasses(e){const r=super.prepareRenderPasses(e);return r.push(e.registerRenderPass({name:"stencil",brushes:[o],drawPhase:n.DEBUG|n.MAP|n.HIGHLIGHT|n.LABEL,target:()=>this.getStencilTarget()})),l("esri-tiles-debug")&&r.push(e.registerRenderPass({name:"tileInfo",brushes:[a],drawPhase:n.DEBUG,target:()=>this.children})),r}getStencilTarget(){return this.children}setStencilReference(e){let r=1;for(const t of this.children)t.stencilRef=r++}}export{f as i}; diff --git a/assets/TileLayer-CULgL3B_.js b/assets/TileLayer-MOTdXvSA.js similarity index 78% rename from assets/TileLayer-CULgL3B_.js rename to assets/TileLayer-MOTdXvSA.js index ba35242..a5e34a3 100644 --- a/assets/TileLayer-CULgL3B_.js +++ b/assets/TileLayer-MOTdXvSA.js @@ -1 +1 @@ -import{bP as _,bQ as S,d$ as T,dp as b,dq as w,dM as O,dr as $,dN as R,dO as W,ay as P,aS as v,bW as U,M as u,e0 as M,dQ as N,N as h,av as j,b7 as L,d4 as A,cP as B,d as a,y as o,aZ as I,aR as C,e1 as k,du as D,f as J,bT as q}from"./index-CEWggaxV.js";import{m as G,f as V,Y as E}from"./SublayersOwner-CJjJUh6G.js";import{f as x}from"./RefreshableLayer-1EkEhJeI.js";import{o as y}from"./imageBitmapUtils-C0nKXf5P.js";import"./Version-Bd0QsIQ5.js";import"./UniqueValueRenderer-BlkUix3g.js";import"./ColorStop-44hBlQ14.js";import"./diffUtils-B4YFa5Ju.js";import"./colorRamps-BJydlf0f.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-z2k12BH8.js";import"./jsonUtils-qYmXvGJ1.js";import"./styleUtils-CnV_Xzhi.js";import"./jsonUtils-BseLl1fZ.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./OverrideHelper-B4ryGWZb.js";import"./utils-p-5Bbga5.js";import"./quantizationUtils-CUjGHrU3.js";import"./heatmapUtils-Clt5rJzr.js";import"./QueryTask-CjHwD7wL.js";import"./infoFor3D-DsOdlPuA.js";import"./executeForIds-BjeEaIen.js";import"./query-BM8R3sQ6.js";import"./pbfQueryUtils-CLRSFGBm.js";import"./pbf-D9QZb8S8.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./queryZScale-DN4aFXYn.js";import"./executeQueryJSON-DngjHRnE.js";import"./FeatureSet-CYJUZgOk.js";import"./executeQueryPBF-BYY2Ipuh.js";import"./featureConversionUtils-CmP9mw0r.js";import"./FeatureType-By3BEr9z.js";import"./FeatureTemplate-DcprAdTM.js";import"./LabelClass-6cZokw8y.js";import"./labelUtils-Dnqx6jl5.js";import"./defaultsJSON-CHAaurhX.js";import"./labelingInfo-CijajRsc.js";import"./LayerFloorInfo-Cdq3ulNh.js";import"./serviceCapabilitiesUtils-t8SL4e_j.js";import"./AttachmentQuery-D61mmWw4.js";import"./popupUtils-DAFYyAvw.js";import"./sublayerUtils-BPYHHPMV.js";var m;const f=["Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Elevation/World_Hillshade","Elevation/World_Hillshade_Dark","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Ocean_Basemap","Reference/World_Boundaries_and_Places","Reference/World_Boundaries_and_Places_Alternate","Reference/World_Transportation","World_Imagery","World_Street_Map","World_Topo_Map"];let i=m=class extends _(S(G(T(V(b(w(O($(x(R(W(q)))))))))))){constructor(...e){super(...e),this.listMode="show",this.isReference=null,this.operationalLayerType="ArcGISTiledMapServiceLayer",this.resampling=!0,this.sourceJSON=null,this.spatialReference=null,this.path=null,this.sublayers=null,this.type="tile",this.url=null}normalizeCtorArgs(e,r){return typeof e=="string"?{url:e,...r}:e}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(P).then(()=>this._fetchService(r))),Promise.resolve(this)}get attributionDataUrl(){var r;const e=(r=this.parsedUrl)==null?void 0:r.path.toLowerCase();return e?this._getDefaultAttribution(this._getMapName(e)):null}readSpatialReference(e,r){var t;return(e=e||((t=r.tileInfo)==null?void 0:t.spatialReference))&&v.fromJSON(e)}writeSublayers(e,r,t,s){if(!this.loaded||!e)return;const p=e.slice().reverse().flatten(({sublayers:l})=>l&&l.toArray().reverse()).toArray(),n=[],c={writeSublayerStructure:!1,...s};p.forEach(l=>{const d=l.write({},c);n.push(d)}),n.some(l=>Object.keys(l).length>1)&&(r.layers=n)}get tileServers(){var e;return this._getDefaultTileServers((e=this.parsedUrl)==null?void 0:e.path)}castTileServers(e){return Array.isArray(e)?e.map(r=>U(r).path):null}fetchTile(e,r,t,s={}){const{signal:p}=s,n=this.getTileUrl(e,r,t),c={responseType:"image",signal:p,query:{...this.refreshParameters}};return u(n,c).then(l=>l.data)}async fetchImageBitmapTile(e,r,t,s={}){const{signal:p}=s;if(this.fetchTile!==m.prototype.fetchTile){const d=await this.fetchTile(e,r,t,s);return y(d,e,r,t,p)}const n=this.getTileUrl(e,r,t),c={responseType:"blob",signal:p,query:{...this.refreshParameters}},{data:l}=await u(n,c);return y(l,e,r,t,p)}getTileUrl(e,r,t){var c,l;const s=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,p=M({...(c=this.parsedUrl)==null?void 0:c.query,blankTile:!s&&null,...this.customParameters,token:this.apiKey}),n=this.tileServers;return`${n&&n.length?n[r%n.length]:(l=this.parsedUrl)==null?void 0:l.path}/tile/${e}/${r}/${t}${p?"?"+p:""}`}loadAll(){return N(this,e=>{e(this.allSublayers)})}_fetchService(e){return new Promise((r,t)=>{if(this.sourceJSON){if(this.sourceJSON.bandCount!=null&&this.sourceJSON.pixelSizeX!=null)throw new h("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");return void r({data:this.sourceJSON})}if(!this.parsedUrl)throw new h("tile-layer:undefined-url","layer's url is not defined");const s=j(this.parsedUrl.path);if(s!=null&&s.serverType==="ImageServer")throw new h("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");u(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(r,t)}).then(r=>{let t=this.url;if(r.ssl&&(t=this.url=t.replace(/^http:/i,"https:")),this.sourceJSON=r.data,this.read(r.data,{origin:"service",url:this.parsedUrl}),this.version===10.1&&!L(t))return this._fetchServerVersion(t,e).then(s=>{this.read({currentVersion:s})}).catch(()=>{})})}_fetchServerVersion(e,r){if(!A(e))return Promise.reject();const t=e.replace(/(.*\/rest)\/.*/i,"$1")+"/info";return u(t,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:r}).then(s=>{if(s.data&&s.data.currentVersion)return s.data.currentVersion;throw new h("tile-layer:version-not-available")})}_getMapName(e){const r=e.match(/^(?:https?:)?\/\/(server\.arcgisonline\.com|services\.arcgisonline\.com|ibasemaps-api\.arcgis\.com)\/arcgis\/rest\/services\/([^\/]+(\/[^\/]+)*)\/mapserver/i);return r?r[2]:void 0}_getDefaultAttribution(e){if(e==null)return null;let r;e=e.toLowerCase();for(let t=0,s=f.length;t({enabled:!1})}}})],i.prototype,"isReference",void 0),a([o({readOnly:!0,type:["ArcGISTiledMapServiceLayer"]})],i.prototype,"operationalLayerType",void 0),a([o({type:Boolean})],i.prototype,"resampling",void 0),a([o()],i.prototype,"sourceJSON",void 0),a([o({type:v})],i.prototype,"spatialReference",void 0),a([I("spatialReference",["spatialReference","tileInfo"])],i.prototype,"readSpatialReference",null),a([o({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],i.prototype,"path",void 0),a([o({readOnly:!0})],i.prototype,"sublayers",void 0),a([C("sublayers",{layers:{type:[E]}})],i.prototype,"writeSublayers",null),a([o({json:{read:!1,write:!1}})],i.prototype,"popupEnabled",void 0),a([o()],i.prototype,"tileServers",null),a([k("tileServers")],i.prototype,"castTileServers",null),a([o({readOnly:!0,json:{read:!1}})],i.prototype,"type",void 0),a([o(D)],i.prototype,"url",void 0),i=m=a([J("esri.layers.TileLayer")],i);const g=Symbol("default-fetch-tile");i.prototype.fetchTile[g]=!0;const Ie=i;export{Ie as default}; +import{bP as _,bQ as S,d$ as T,dp as b,dq as w,dM as O,dr as $,dN as R,dO as W,ay as P,aS as v,bW as U,M as u,e0 as M,dQ as N,N as h,av as j,b7 as L,d4 as A,cP as B,d as a,y as o,aZ as I,aR as C,e1 as k,du as D,f as J,bT as q}from"./index-BjUNJPVf.js";import{m as G,f as V,Y as E}from"./SublayersOwner-CywL6RlY.js";import{f as x}from"./RefreshableLayer-_r2TPtol.js";import{o as y}from"./imageBitmapUtils-BVxrhFkK.js";import"./Version-Dqq_CHBG.js";import"./UniqueValueRenderer-7V9Bhr-D.js";import"./ColorStop-DCGjAKLC.js";import"./diffUtils-uUoMDFQS.js";import"./colorRamps-CcakIWlU.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-BX9G5gNQ.js";import"./jsonUtils-Ox5U0P0F.js";import"./styleUtils-DOUOskVZ.js";import"./jsonUtils-Dw332y6z.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./OverrideHelper-DxFZBnGL.js";import"./utils-CuXO_Zzq.js";import"./quantizationUtils-CfV316jZ.js";import"./heatmapUtils-BSteZBTj.js";import"./QueryTask-Cl66pG_V.js";import"./infoFor3D-DsOdlPuA.js";import"./executeForIds-CZ3M8IZd.js";import"./query-Bk_ITqRK.js";import"./pbfQueryUtils-CSeFSIjv.js";import"./pbf-Du8sFEWo.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./queryZScale-Dwvn5BlQ.js";import"./executeQueryJSON-COxi_Fac.js";import"./FeatureSet-opEn8ou8.js";import"./executeQueryPBF-DROgTCuZ.js";import"./featureConversionUtils-BHhm7bvm.js";import"./FeatureType-CwUl8Nf5.js";import"./FeatureTemplate-FZNGA_Ik.js";import"./LabelClass-CeatfK8u.js";import"./labelUtils-3p0-m-Ee.js";import"./defaultsJSON-CHAaurhX.js";import"./labelingInfo-DqAUis6e.js";import"./LayerFloorInfo-DlYNbO-A.js";import"./serviceCapabilitiesUtils-DiP90Uds.js";import"./AttachmentQuery-DmEAIZff.js";import"./popupUtils-DlZin22m.js";import"./sublayerUtils-GrJ1gnTG.js";var m;const f=["Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Elevation/World_Hillshade","Elevation/World_Hillshade_Dark","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Ocean_Basemap","Reference/World_Boundaries_and_Places","Reference/World_Boundaries_and_Places_Alternate","Reference/World_Transportation","World_Imagery","World_Street_Map","World_Topo_Map"];let i=m=class extends _(S(G(T(V(b(w(O($(x(R(W(q)))))))))))){constructor(...e){super(...e),this.listMode="show",this.isReference=null,this.operationalLayerType="ArcGISTiledMapServiceLayer",this.resampling=!0,this.sourceJSON=null,this.spatialReference=null,this.path=null,this.sublayers=null,this.type="tile",this.url=null}normalizeCtorArgs(e,r){return typeof e=="string"?{url:e,...r}:e}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(P).then(()=>this._fetchService(r))),Promise.resolve(this)}get attributionDataUrl(){var r;const e=(r=this.parsedUrl)==null?void 0:r.path.toLowerCase();return e?this._getDefaultAttribution(this._getMapName(e)):null}readSpatialReference(e,r){var t;return(e=e||((t=r.tileInfo)==null?void 0:t.spatialReference))&&v.fromJSON(e)}writeSublayers(e,r,t,s){if(!this.loaded||!e)return;const p=e.slice().reverse().flatten(({sublayers:l})=>l&&l.toArray().reverse()).toArray(),n=[],c={writeSublayerStructure:!1,...s};p.forEach(l=>{const d=l.write({},c);n.push(d)}),n.some(l=>Object.keys(l).length>1)&&(r.layers=n)}get tileServers(){var e;return this._getDefaultTileServers((e=this.parsedUrl)==null?void 0:e.path)}castTileServers(e){return Array.isArray(e)?e.map(r=>U(r).path):null}fetchTile(e,r,t,s={}){const{signal:p}=s,n=this.getTileUrl(e,r,t),c={responseType:"image",signal:p,query:{...this.refreshParameters}};return u(n,c).then(l=>l.data)}async fetchImageBitmapTile(e,r,t,s={}){const{signal:p}=s;if(this.fetchTile!==m.prototype.fetchTile){const d=await this.fetchTile(e,r,t,s);return y(d,e,r,t,p)}const n=this.getTileUrl(e,r,t),c={responseType:"blob",signal:p,query:{...this.refreshParameters}},{data:l}=await u(n,c);return y(l,e,r,t,p)}getTileUrl(e,r,t){var c,l;const s=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,p=M({...(c=this.parsedUrl)==null?void 0:c.query,blankTile:!s&&null,...this.customParameters,token:this.apiKey}),n=this.tileServers;return`${n&&n.length?n[r%n.length]:(l=this.parsedUrl)==null?void 0:l.path}/tile/${e}/${r}/${t}${p?"?"+p:""}`}loadAll(){return N(this,e=>{e(this.allSublayers)})}_fetchService(e){return new Promise((r,t)=>{if(this.sourceJSON){if(this.sourceJSON.bandCount!=null&&this.sourceJSON.pixelSizeX!=null)throw new h("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");return void r({data:this.sourceJSON})}if(!this.parsedUrl)throw new h("tile-layer:undefined-url","layer's url is not defined");const s=j(this.parsedUrl.path);if(s!=null&&s.serverType==="ImageServer")throw new h("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");u(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(r,t)}).then(r=>{let t=this.url;if(r.ssl&&(t=this.url=t.replace(/^http:/i,"https:")),this.sourceJSON=r.data,this.read(r.data,{origin:"service",url:this.parsedUrl}),this.version===10.1&&!L(t))return this._fetchServerVersion(t,e).then(s=>{this.read({currentVersion:s})}).catch(()=>{})})}_fetchServerVersion(e,r){if(!A(e))return Promise.reject();const t=e.replace(/(.*\/rest)\/.*/i,"$1")+"/info";return u(t,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:r}).then(s=>{if(s.data&&s.data.currentVersion)return s.data.currentVersion;throw new h("tile-layer:version-not-available")})}_getMapName(e){const r=e.match(/^(?:https?:)?\/\/(server\.arcgisonline\.com|services\.arcgisonline\.com|ibasemaps-api\.arcgis\.com)\/arcgis\/rest\/services\/([^\/]+(\/[^\/]+)*)\/mapserver/i);return r?r[2]:void 0}_getDefaultAttribution(e){if(e==null)return null;let r;e=e.toLowerCase();for(let t=0,s=f.length;t({enabled:!1})}}})],i.prototype,"isReference",void 0),a([o({readOnly:!0,type:["ArcGISTiledMapServiceLayer"]})],i.prototype,"operationalLayerType",void 0),a([o({type:Boolean})],i.prototype,"resampling",void 0),a([o()],i.prototype,"sourceJSON",void 0),a([o({type:v})],i.prototype,"spatialReference",void 0),a([I("spatialReference",["spatialReference","tileInfo"])],i.prototype,"readSpatialReference",null),a([o({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],i.prototype,"path",void 0),a([o({readOnly:!0})],i.prototype,"sublayers",void 0),a([C("sublayers",{layers:{type:[E]}})],i.prototype,"writeSublayers",null),a([o({json:{read:!1,write:!1}})],i.prototype,"popupEnabled",void 0),a([o()],i.prototype,"tileServers",null),a([k("tileServers")],i.prototype,"castTileServers",null),a([o({readOnly:!0,json:{read:!1}})],i.prototype,"type",void 0),a([o(D)],i.prototype,"url",void 0),i=m=a([J("esri.layers.TileLayer")],i);const g=Symbol("default-fetch-tile");i.prototype.fetchTile[g]=!0;const Ie=i;export{Ie as default}; diff --git a/assets/TileLayerView2D-BnlmUfzg.js b/assets/TileLayerView2D-CoWYvoLX.js similarity index 70% rename from assets/TileLayerView2D-BnlmUfzg.js rename to assets/TileLayerView2D-CoWYvoLX.js index 865671d..51d4b5b 100644 --- a/assets/TileLayerView2D-BnlmUfzg.js +++ b/assets/TileLayerView2D-CoWYvoLX.js @@ -1 +1 @@ -import{c as w,h as y,m as I,r as V,e as v,G as H,b as o,a as u,s as T,d as n,y as g,f as q}from"./index-CEWggaxV.js";import"./UpdateTracking2D-nj9Q-3df.js";import"./labelUtils-Dnqx6jl5.js";import"./OverrideHelper-B4ryGWZb.js";import"./floatRGBA-BLm-Rhaq.js";import"./Container-CB7SlLB9.js";import"./WGLContainer-B_Pv-8Yi.js";import"./Texture-DJgkMrSB.js";import"./Program-DLRmaKpw.js";import"./LabelMetric-D2hbzzy_.js";import"./MagnifierPrograms-B5-grLP-.js";import"./pbf-D9QZb8S8.js";import"./FeatureCommandQueue-Btq_FXyi.js";import"./OrderIndependentTransparency-C747AfeB.js";import"./testSVGPremultipliedAlpha-B0ipOzbU.js";import{$ as U}from"./GraphicsView2D-DbbthiwV.js";import"./earcut-hRlx3adE.js";import"./vec3f32-nZdmKIgz.js";import{r as b,o as f,n as d}from"./imageUtils-D_EPf7De.js";import{m as S,u as C}from"./LayerView-BEFTHNYv.js";import{h as Q}from"./HighlightGraphicContainer-Cnwl0eCq.js";import{i as $}from"./RefreshableLayerView-C1-PEoNB.js";import{S as L,U as P,r as k}from"./drapedUtils-CGrSPor9.js";import"./TurboLine-CkxIB4ZX.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./utils-p-5Bbga5.js";import"./Rect-CUzevAry.js";import"./BindType-BmZEZMMh.js";import"./Util-BS8sJGjF.js";import"./highlightReasons-DbgbcWKM.js";import"./constants-D5zmR9t2.js";import"./defaultsJSON-CHAaurhX.js";import"./quantizationUtils-CUjGHrU3.js";import"./ProgramTemplate-BICQrNzS.js";import"./config-MDUrh2eL.js";import"./featureConversionUtils-CmP9mw0r.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./CircularArray-DfLrgW_-.js";import"./AttributeStore-Ck-75lnq.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./TimeOnly-Cm47ew5I.js";import"./timeSupport-BjRbXIpn.js";import"./json-Wa8cmqdu.js";import"./diffUtils-B4YFa5Ju.js";import"./basicInterfaces-GbxEOYtk.js";import"./normalizeUtilsSync-B6VufdiX.js";import"./Bitmap--gOrgR8J.js";import"./TileContainer-Ci6dOowA.js";import"./scaleUtils-Bqauo1zZ.js";import"./AGraphicContainer-Dby-baET.js";import"./TechniqueInstance-CSsTmbek.js";import"./floorFilterUtils-DZ5C6FQv.js";import"./sublayerUtils-BPYHHPMV.js";import"./popupUtils-BovqErR_.js";const F=[0,0];let a=class extends $(b(S(C))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new w,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||this.layer.resampling!==!1}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(t){var e;this._fetchQueue.pause(),this._fetchQueue.state=t.state,this._tileStrategy.update(t),this._fetchQueue.resume(),(e=this._highlightView)==null||e.processUpdate(t)}attach(){const t="tileServers"in this.layer?this.layer.tileServers:null,e=this.tilemapCache;if(this._tileInfoView=new y(this.layer.tileInfo,this.layer.fullExtent,e==null?void 0:e.effectiveMinLOD,e==null?void 0:e.effectiveMaxLOD),this._fetchQueue=new I({tileInfoView:this._tileInfoView,concurrency:t&&10*t.length||10,process:(i,h)=>this.fetchTile(i,h)}),this._tileStrategy=new V({cachePolicy:"keep",resampling:this.resampling,acquireTile:i=>this.acquireTile(i),releaseTile:i=>this.releaseTile(i),tileInfoView:this._tileInfoView}),L(this,this.layer)){const i=this._highlightView=new U({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new Q(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new P({createFetchPopupFeaturesQueryGeometry:(h,r)=>k(h,r,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:(h,r)=>{i.graphicUpdateHandler({graphic:h,property:r})},layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){var t,e;super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),(t=this._popupHighlightHelper)==null||t.destroy(),(e=this._highlightView)==null||e.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtLocation(t,e){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtLocation(t,e):[]}highlight(t){return this._popupHighlightHelper?this._popupHighlightHelper.highlight(t):v()}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(t){var e;return H((e=this.layer.tileInfo)==null?void 0:e.spatialReference,t)}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(t=>this._updatingHandles.addPromise(this._enqueueTileFetch(t)))}}acquireTile(t){const e=this._bitmapView.createTile(t),i=e.bitmap;return[i.x,i.y]=this._tileInfoView.getTileCoords(F,e.key),i.resolution=this._tileInfoView.getTileResolution(e.key),[i.width,i.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(e)),this._bitmapView.addChild(e),this.requestUpdate(),e}releaseTile(t){this._fetchQueue.abort(t.key.id),this._bitmapView.removeChild(t),t.once("detach",()=>t.destroy()),this.requestUpdate()}async fetchTile(t,e={}){const i=this.tilemapCache,{signal:h,resamplingLevel:r=0}=e;if(!i)try{return await this._fetchImage(t,h)}catch(s){if(!o(s)&&!this.resampling)return f(this._tileInfoView.tileInfo.size);if(r<3){const m=this._tileInfoView.getTileParentId(t.id);if(m){const c=new u(m),_=await this.fetchTile(c,{...e,resamplingLevel:r+1});return d(this._tileInfoView,_,c,t)}}throw s}const l=new u(0,0,0,0);let p;try{if(await i.fetchAvailabilityUpsample(t.level,t.row,t.col,l,{signal:h}),l.level!==t.level&&!this.resampling)return f(this._tileInfoView.tileInfo.size);p=await this._fetchImage(l,h)}catch(s){if(o(s))throw s;p=await this._fetchImage(t,h)}return this.resampling?d(this._tileInfoView,p,l,t):p}async _enqueueTileFetch(t){if(!this._fetchQueue.has(t.key.id)){try{const e=await this._fetchQueue.push(t.key);t.bitmap.source=e,t.bitmap.width=this._tileInfoView.tileInfo.size[0],t.bitmap.height=this._tileInfoView.tileInfo.size[1],t.once("attach",()=>this.requestUpdate())}catch(e){o(e)||T.getLogger(this).error(e)}this.requestUpdate()}}async _fetchImage(t,e){return this.layer.fetchImageBitmapTile(t.level,t.row,t.col,{signal:e})}};n([g()],a.prototype,"resampling",null),n([g()],a.prototype,"tilemapCache",null),a=n([q("esri.views.2d.layers.TileLayerView2D")],a);const xt=a;export{xt as default}; +import{c as w,h as y,m as I,r as V,e as v,G as H,b as o,a as u,s as T,d as n,y as g,f as q}from"./index-BjUNJPVf.js";import"./UpdateTracking2D-Ds_Gdrxd.js";import"./labelUtils-3p0-m-Ee.js";import"./OverrideHelper-DxFZBnGL.js";import"./floatRGBA-Cs54GdjG.js";import"./Container-_n5wCgez.js";import"./WGLContainer-DgZNq7b0.js";import"./Texture-S4dD-WHn.js";import"./Program-DBsYtQ00.js";import"./LabelMetric-BcUxDImF.js";import"./MagnifierPrograms-Dy7jbVaV.js";import"./pbf-Du8sFEWo.js";import"./FeatureCommandQueue-DI81F3gA.js";import"./OrderIndependentTransparency-Btph8gYx.js";import"./testSVGPremultipliedAlpha-BUMQhQ4O.js";import{$ as U}from"./GraphicsView2D-B7H8XAnI.js";import"./earcut-CWKXDqDj.js";import"./vec3f32-nZdmKIgz.js";import{r as b,o as f,n as d}from"./imageUtils-BNh57Y88.js";import{m as S,u as C}from"./LayerView-Bux7vAEn.js";import{h as Q}from"./HighlightGraphicContainer-B5WIObEd.js";import{i as $}from"./RefreshableLayerView-L9NGpXXI.js";import{S as L,U as P,r as k}from"./drapedUtils-DDBQ6RK5.js";import"./TurboLine-DNQdPIXo.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./utils-CuXO_Zzq.js";import"./Rect-CUzevAry.js";import"./BindType-BmZEZMMh.js";import"./Util-CS5u4Lec.js";import"./highlightReasons-BOU4mnPE.js";import"./constants-D5zmR9t2.js";import"./defaultsJSON-CHAaurhX.js";import"./quantizationUtils-CfV316jZ.js";import"./ProgramTemplate-Ck2I0bIi.js";import"./config-MDUrh2eL.js";import"./featureConversionUtils-BHhm7bvm.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./CircularArray-DfLrgW_-.js";import"./AttributeStore-Bm6hLtR1.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./TimeOnly-BXSODLxA.js";import"./timeSupport-DXkhlToK.js";import"./json-Wa8cmqdu.js";import"./diffUtils-uUoMDFQS.js";import"./basicInterfaces-GbxEOYtk.js";import"./normalizeUtilsSync-73yZ0QwV.js";import"./Bitmap-DpyomsG7.js";import"./TileContainer-Bs-vXdD_.js";import"./scaleUtils-DWXMiS7R.js";import"./AGraphicContainer-BXk7Eu6w.js";import"./TechniqueInstance-XtnK2qy2.js";import"./floorFilterUtils-DZ5C6FQv.js";import"./sublayerUtils-GrJ1gnTG.js";import"./popupUtils-Do2GfZME.js";const F=[0,0];let a=class extends $(b(S(C))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new w,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||this.layer.resampling!==!1}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(t){var e;this._fetchQueue.pause(),this._fetchQueue.state=t.state,this._tileStrategy.update(t),this._fetchQueue.resume(),(e=this._highlightView)==null||e.processUpdate(t)}attach(){const t="tileServers"in this.layer?this.layer.tileServers:null,e=this.tilemapCache;if(this._tileInfoView=new y(this.layer.tileInfo,this.layer.fullExtent,e==null?void 0:e.effectiveMinLOD,e==null?void 0:e.effectiveMaxLOD),this._fetchQueue=new I({tileInfoView:this._tileInfoView,concurrency:t&&10*t.length||10,process:(i,h)=>this.fetchTile(i,h)}),this._tileStrategy=new V({cachePolicy:"keep",resampling:this.resampling,acquireTile:i=>this.acquireTile(i),releaseTile:i=>this.releaseTile(i),tileInfoView:this._tileInfoView}),L(this,this.layer)){const i=this._highlightView=new U({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new Q(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new P({createFetchPopupFeaturesQueryGeometry:(h,r)=>k(h,r,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:(h,r)=>{i.graphicUpdateHandler({graphic:h,property:r})},layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){var t,e;super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),(t=this._popupHighlightHelper)==null||t.destroy(),(e=this._highlightView)==null||e.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtLocation(t,e){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtLocation(t,e):[]}highlight(t){return this._popupHighlightHelper?this._popupHighlightHelper.highlight(t):v()}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(t){var e;return H((e=this.layer.tileInfo)==null?void 0:e.spatialReference,t)}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(t=>this._updatingHandles.addPromise(this._enqueueTileFetch(t)))}}acquireTile(t){const e=this._bitmapView.createTile(t),i=e.bitmap;return[i.x,i.y]=this._tileInfoView.getTileCoords(F,e.key),i.resolution=this._tileInfoView.getTileResolution(e.key),[i.width,i.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(e)),this._bitmapView.addChild(e),this.requestUpdate(),e}releaseTile(t){this._fetchQueue.abort(t.key.id),this._bitmapView.removeChild(t),t.once("detach",()=>t.destroy()),this.requestUpdate()}async fetchTile(t,e={}){const i=this.tilemapCache,{signal:h,resamplingLevel:r=0}=e;if(!i)try{return await this._fetchImage(t,h)}catch(s){if(!o(s)&&!this.resampling)return f(this._tileInfoView.tileInfo.size);if(r<3){const m=this._tileInfoView.getTileParentId(t.id);if(m){const c=new u(m),_=await this.fetchTile(c,{...e,resamplingLevel:r+1});return d(this._tileInfoView,_,c,t)}}throw s}const l=new u(0,0,0,0);let p;try{if(await i.fetchAvailabilityUpsample(t.level,t.row,t.col,l,{signal:h}),l.level!==t.level&&!this.resampling)return f(this._tileInfoView.tileInfo.size);p=await this._fetchImage(l,h)}catch(s){if(o(s))throw s;p=await this._fetchImage(t,h)}return this.resampling?d(this._tileInfoView,p,l,t):p}async _enqueueTileFetch(t){if(!this._fetchQueue.has(t.key.id)){try{const e=await this._fetchQueue.push(t.key);t.bitmap.source=e,t.bitmap.width=this._tileInfoView.tileInfo.size[0],t.bitmap.height=this._tileInfoView.tileInfo.size[1],t.once("attach",()=>this.requestUpdate())}catch(e){o(e)||T.getLogger(this).error(e)}this.requestUpdate()}}async _fetchImage(t,e){return this.layer.fetchImageBitmapTile(t.level,t.row,t.col,{signal:e})}};n([g()],a.prototype,"resampling",null),n([g()],a.prototype,"tilemapCache",null),a=n([q("esri.views.2d.layers.TileLayerView2D")],a);const xt=a;export{xt as default}; diff --git a/assets/TimeInfo-3TVmpFSA.js b/assets/TimeInfo-DooETFWC.js similarity index 97% rename from assets/TimeInfo-3TVmpFSA.js rename to assets/TimeInfo-DooETFWC.js index 27bdee5..60b8b1f 100644 --- a/assets/TimeInfo-3TVmpFSA.js +++ b/assets/TimeInfo-DooETFWC.js @@ -1 +1 @@ -import{gk as c,b4 as u,gl as w,d as i,c9 as I,y as l,f as m,aU as d,b2 as p,aZ as r,aR as a,dR as x}from"./index-CEWggaxV.js";const U=c()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0});let s=class extends u(d){constructor(t){super(t),this.unit="milliseconds",this.value=0}toMilliseconds(){return w(this.value,this.unit,"milliseconds")}};i([I(U,{nonNullable:!0})],s.prototype,"unit",void 0),i([l({type:Number,json:{write:!0},nonNullable:!0})],s.prototype,"value",void 0),s=i([m("esri.TimeInterval")],s);const v=s;function o(t,e){return v.fromJSON({value:t,unit:e})}let n=class extends u(d){constructor(t){super(t),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeZone=null,this.trackIdField=null,this.useTime=!0}readFullTimeExtent(t,e){if(!e.timeExtent||!Array.isArray(e.timeExtent)||e.timeExtent.length!==2)return null;const T=new Date(e.timeExtent[0]),y=new Date(e.timeExtent[1]);return new p({start:T,end:y})}writeFullTimeExtent(t,e){(t==null?void 0:t.start)!=null&&t.end!=null?e.timeExtent=[t.start.getTime(),t.end.getTime()]:e.timeExtent=null}readInterval(t,e){return e.timeInterval&&e.timeIntervalUnits?o(e.timeInterval,e.timeIntervalUnits):e.defaultTimeInterval&&e.defaultTimeIntervalUnits?o(e.defaultTimeInterval,e.defaultTimeIntervalUnits):null}writeInterval(t,e){e.timeInterval=(t==null?void 0:t.toJSON().value)??null,e.timeIntervalUnits=(t==null?void 0:t.toJSON().unit)??null}};i([l({type:Boolean,json:{name:"exportOptions.timeDataCumulative",write:!0}})],n.prototype,"cumulative",void 0),i([l({type:String,json:{name:"endTimeField",write:{enabled:!0,allowNull:!0}}})],n.prototype,"endField",void 0),i([l({type:p,json:{write:{enabled:!0,allowNull:!0}}})],n.prototype,"fullTimeExtent",void 0),i([r("fullTimeExtent",["timeExtent"])],n.prototype,"readFullTimeExtent",null),i([a("fullTimeExtent")],n.prototype,"writeFullTimeExtent",null),i([l({type:Boolean,json:{write:!0}})],n.prototype,"hasLiveData",void 0),i([l({type:v,json:{write:{enabled:!0,allowNull:!0}}})],n.prototype,"interval",void 0),i([r("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],n.prototype,"readInterval",null),i([a("interval")],n.prototype,"writeInterval",null),i([l({type:String,json:{name:"startTimeField",write:{enabled:!0,allowNull:!0}}})],n.prototype,"startField",void 0),i([l(x("timeReference",!0))],n.prototype,"timeZone",void 0),i([l({type:String,json:{write:{enabled:!0,allowNull:!0}}})],n.prototype,"trackIdField",void 0),i([l({type:Boolean,json:{name:"exportOptions.useTime",write:!0}})],n.prototype,"useTime",void 0),n=i([m("esri.layers.support.TimeInfo")],n);const f=n;export{f as d,U as e,v as l}; +import{gk as c,b4 as u,gl as w,d as i,c9 as I,y as l,f as m,aU as d,b2 as p,aZ as r,aR as a,dR as x}from"./index-BjUNJPVf.js";const U=c()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0});let s=class extends u(d){constructor(t){super(t),this.unit="milliseconds",this.value=0}toMilliseconds(){return w(this.value,this.unit,"milliseconds")}};i([I(U,{nonNullable:!0})],s.prototype,"unit",void 0),i([l({type:Number,json:{write:!0},nonNullable:!0})],s.prototype,"value",void 0),s=i([m("esri.TimeInterval")],s);const v=s;function o(t,e){return v.fromJSON({value:t,unit:e})}let n=class extends u(d){constructor(t){super(t),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeZone=null,this.trackIdField=null,this.useTime=!0}readFullTimeExtent(t,e){if(!e.timeExtent||!Array.isArray(e.timeExtent)||e.timeExtent.length!==2)return null;const T=new Date(e.timeExtent[0]),y=new Date(e.timeExtent[1]);return new p({start:T,end:y})}writeFullTimeExtent(t,e){(t==null?void 0:t.start)!=null&&t.end!=null?e.timeExtent=[t.start.getTime(),t.end.getTime()]:e.timeExtent=null}readInterval(t,e){return e.timeInterval&&e.timeIntervalUnits?o(e.timeInterval,e.timeIntervalUnits):e.defaultTimeInterval&&e.defaultTimeIntervalUnits?o(e.defaultTimeInterval,e.defaultTimeIntervalUnits):null}writeInterval(t,e){e.timeInterval=(t==null?void 0:t.toJSON().value)??null,e.timeIntervalUnits=(t==null?void 0:t.toJSON().unit)??null}};i([l({type:Boolean,json:{name:"exportOptions.timeDataCumulative",write:!0}})],n.prototype,"cumulative",void 0),i([l({type:String,json:{name:"endTimeField",write:{enabled:!0,allowNull:!0}}})],n.prototype,"endField",void 0),i([l({type:p,json:{write:{enabled:!0,allowNull:!0}}})],n.prototype,"fullTimeExtent",void 0),i([r("fullTimeExtent",["timeExtent"])],n.prototype,"readFullTimeExtent",null),i([a("fullTimeExtent")],n.prototype,"writeFullTimeExtent",null),i([l({type:Boolean,json:{write:!0}})],n.prototype,"hasLiveData",void 0),i([l({type:v,json:{write:{enabled:!0,allowNull:!0}}})],n.prototype,"interval",void 0),i([r("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],n.prototype,"readInterval",null),i([a("interval")],n.prototype,"writeInterval",null),i([l({type:String,json:{name:"startTimeField",write:{enabled:!0,allowNull:!0}}})],n.prototype,"startField",void 0),i([l(x("timeReference",!0))],n.prototype,"timeZone",void 0),i([l({type:String,json:{write:{enabled:!0,allowNull:!0}}})],n.prototype,"trackIdField",void 0),i([l({type:Boolean,json:{name:"exportOptions.useTime",write:!0}})],n.prototype,"useTime",void 0),n=i([m("esri.layers.support.TimeInfo")],n);const f=n;export{f as d,U as e,v as l}; diff --git a/assets/TimeOnly-Cm47ew5I.js b/assets/TimeOnly-BXSODLxA.js similarity index 99% rename from assets/TimeOnly-Cm47ew5I.js rename to assets/TimeOnly-BXSODLxA.js index e01f05d..4162ab1 100644 --- a/assets/TimeOnly-Cm47ew5I.js +++ b/assets/TimeOnly-BXSODLxA.js @@ -1 +1 @@ -import{hj as i,a5 as M,Y as g,a0 as Z,aF as q,cd as U,aE as b}from"./index-CEWggaxV.js";import{t as l}from"./UnknownTimeZone-DF0BqWCR.js";var y;(function(r){r.TimeZoneNotRecognized="TimeZoneNotRecognized"})(y||(y={}));const N={[y.TimeZoneNotRecognized]:"Timezone identifier has not been recognized."};class p extends Error{constructor(e,t){super(q(N[e],t)),this.declaredRootClass="esri.arcade.arcadedate.dateerror",Error.captureStackTrace&&Error.captureStackTrace(this,p)}}function h(r,e,t){return rt?r-t:0}function d(r,e,t){return rt?t:r}class n{constructor(e){this._date=e,this.declaredRootClass="esri.arcade.arcadedate"}static fromParts(e=0,t=1,s=1,a=0,o=0,T=0,S=0,L){if(isNaN(e)||isNaN(t)||isNaN(s)||isNaN(a)||isNaN(o)||isNaN(T)||isNaN(S))return null;const w=i.local(e,t).daysInMonth;let D=i.fromObject({day:d(s,1,w),year:e,month:d(t,1,12),hour:d(a,0,23),minute:d(o,0,59),second:d(T,0,59),millisecond:d(S,0,999)},{zone:m(L)});return D=D.plus({months:h(t,1,12),days:h(s,1,w),hours:h(a,0,23),minutes:h(o,0,59),seconds:h(T,0,59),milliseconds:h(S,0,999)}),new n(D)}static get systemTimeZoneCanonicalName(){return Intl.DateTimeFormat().resolvedOptions().timeZone??"system"}static arcadeDateAndZoneToArcadeDate(e,t){const s=m(t);return e.isUnknownTimeZone||s===l.instance?n.fromParts(e.year,e.monthJS+1,e.day,e.hour,e.minute,e.second,e.millisecond,s):new n(e._date.setZone(s))}static dateJSToArcadeDate(e){return new n(i.fromJSDate(e,{zone:"system"}))}static dateJSAndZoneToArcadeDate(e,t="system"){const s=m(t);return new n(i.fromJSDate(e,{zone:s}))}static unknownEpochToArcadeDate(e){return new n(i.fromMillis(e,{zone:l.instance}))}static unknownDateJSToArcadeDate(e){return new n(i.fromMillis(e.getTime(),{zone:l.instance}))}static epochToArcadeDate(e,t="system"){const s=m(t);return new n(i.fromMillis(e,{zone:s}))}static dateTimeToArcadeDate(e){return new n(e)}clone(){return new n(this._date)}changeTimeZone(e){const t=m(e);return n.dateTimeToArcadeDate(this._date.setZone(t))}static dateTimeAndZoneToArcadeDate(e,t){const s=m(t);return e.zone===l.instance||s===l.instance?n.fromParts(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond,s):new n(e.setZone(s))}static nowToArcadeDate(e){const t=m(e);return new n(i.fromJSDate(new Date,{zone:t}))}static nowUTCToArcadeDate(){return new n(i.utc())}get isSystem(){return this.timeZone==="system"||this.timeZone===n.systemTimeZoneCanonicalName}equals(e){return this.isSystem&&e.isSystem?this.toNumber()===e.toNumber():this.isUnknownTimeZone===e.isUnknownTimeZone&&this._date.equals(e._date)}get isUnknownTimeZone(){return this._date.zone===l.instance}get isValid(){return this._date.isValid}get hour(){return this._date.hour}get second(){return this._date.second}get day(){return this._date.day}get dayOfWeekISO(){return this._date.weekday}get dayOfWeekJS(){let e=this._date.weekday;return e>6&&(e=0),e}get millisecond(){return this._date.millisecond}get monthISO(){return this._date.month}get weekISO(){return this._date.weekNumber}get yearISO(){return this._date.weekYear}get monthJS(){return this._date.month-1}get year(){return this._date.year}get minute(){return this._date.minute}get zone(){return this._date.zone}get timeZoneOffset(){return this.isUnknownTimeZone?0:this._date.offset}get timeZone(){if(this.isUnknownTimeZone)return"unknown";if(this._date.zone.type==="system")return"system";const e=this.zone;return e.type==="fixed"?e.fixed===0?"UTC":e.formatOffset(0,"short"):e.name}stringify(){return JSON.stringify(this.toJSDate())}plus(e){return new n(this._date.plus(e))}diff(e,t="milliseconds"){return this._date.diff(e._date,t)[t]}toISODate(){return this._date.toISODate()}toISOString(e){return e?this._date.toISO({suppressMilliseconds:!0,includeOffset:!this.isUnknownTimeZone}):this._date.toISO({includeOffset:!this.isUnknownTimeZone})}toISOTime(e,t){return this._date.toISOTime({suppressMilliseconds:e,includeOffset:t&&!this.isUnknownTimeZone})}toFormat(e,t){return this.isUnknownTimeZone&&(e=e.replaceAll("Z","")),this._date.toFormat(e,t)}toJSDate(){return this._date.toJSDate()}toSQLValue(){return this._date.toFormat("yyyy-LL-dd HH:mm:ss")}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}toDateTime(){return this._date}toNumber(){return this._date.toMillis()}getTime(){return this._date.toMillis()}toUTC(){return new n(this._date.toUTC())}toLocal(){return new n(this._date.toLocal())}toString(){return this.toISOString(!0)}static fromReaderAsTimeStampOffset(e){if(!e)return null;const t=i.fromISO(e,{setZone:!0});return new n(t)}}function m(r,e=!0){if(r instanceof M)return r;if(r.toLowerCase()==="system")return"system";if(r.toLowerCase()==="utc")return"UTC";if(r.toLowerCase()==="unknown")return l.instance;if(/^[\+\-]?[0-9]{1,2}([:][0-9]{2})?$/.test(r)){const s=g.parseSpecifier("UTC"+(r.startsWith("+")||r.startsWith("-")?"":"+")+r);if(s)return s}const t=Z.create(r);if(!t.isValid){if(e)throw new p(y.TimeZoneNotRecognized);return null}return t}function k(r){r=r.replaceAll(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let e="";const t=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const s of r.match(t)||[])switch(s){case"D":e+="d";break;case"DD":e+="dd";break;case"DDD":e+="o";break;case"d":e+="c";break;case"ddd":e+="ccc";break;case"dddd":e+="cccc";break;case"M":e+="L";break;case"MM":e+="LL";break;case"MMM":e+="LLL";break;case"MMMM":e+="LLLL";break;case"YY":e+="yy";break;case"Y":case"YYYY":e+="yyyy";break;case"Q":e+="q";break;case"X":case"x":e+=s;break;default:s.length>=2&&s.slice(0,1)==="["&&s.slice(-1)==="]"?e+=`'${s.slice(1,-1)}'`:e+=`'${s}'`}return e}let Y=class c{constructor(e,t,s){this._year=e,this._month=t,this._day=s,this.declaredRootClass="esri.core.sql.dateonly"}get month(){return this._month}get monthJS(){return this._month-1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(e){return e instanceof c&&e.day===this.day&&e.month===this.month&&e.year===this.year}clone(){return new c(this._year,this._month,this._day)}toDateTime(e){return i.fromObject({day:this.day,month:this.month,year:this.year},{zone:m(e)})}toDateTimeLuxon(e){return i.fromObject({day:this.day,month:this.month,year:this.year},{zone:m(e)})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(e=null,t=!0){if(e===null||e==="")return this.toString();if(t&&(e=k(e)),!e)return"";const s=this.toDateTime("unknown");return n.dateTimeToArcadeDate(s).toFormat(e,{locale:U(),numberingSystem:"latn"})}toArcadeDate(){const e=this.toDateTime("unknown");return n.dateTimeToArcadeDate(e)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd",!1)}toSQLValue(){return this.toFormat("yyyy-LL-dd",!1)}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd",!1)+"'"}plus(e,t){return c.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}toUTCDateTime(){return i.utc(this.year,this.month,this.day,0,0,0,0)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return t==="M"?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}static fromMilliseconds(e){const t=i.fromMillis(e,{zone:g.utcInstance});return t.isValid?c.fromParts(t.year,t.month,t.day):null}static fromSeconds(e){const t=i.fromSeconds(e,{zone:g.utcInstance});return t.isValid?c.fromParts(t.year,t.month,t.day):null}static fromReader(e){if(!e)return null;const t=e.split("-");return t.length!==3?null:new c(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10))}static fromParts(e,t,s){const a=new c(e,t,s);return a.isValid===!1?null:a}static fromDateJS(e){return c.fromParts(e.getFullYear(),e.getMonth()+1,e.getDay())}static fromDateTime(e){return c.fromParts(e.year,e.month,e.day)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(e===""||e===null)return null;const s=[];if(t)(t=k(t))&&s.push(t);else if(t===null||t===""){const a=i.fromISO(e,{setZone:!0});return a.isValid?c.fromParts(a.year,a.month,a.day):null}for(const a of s){const o=i.fromFormat(e,t??a);if(o.isValid)return new c(o.year,o.month,o.day)}return null}static fromNow(e="system"){const t=i.fromJSDate(new Date).setZone(m(e));return new c(t.year,t.month,t.day)}};function $(r){if(r==null)return null;if(typeof r=="number")return r;let e=r.toLowerCase();switch(e=e.replaceAll(/\s/g,""),e=e.replaceAll("-",""),e){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 109404;case"miles":case"mile":case"squaremile":case"squaremiles":return 109439;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 109414;case"acres":case"acre":case"ac":return 109402;case"hectares":case"hectare":case"ha":return 109401;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 109442;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 109405;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 109409}return null}function z(r){if(r==null)return null;switch(r.type){case"polygon":case"multipoint":case"polyline":return r.extent;case"point":return new b({xmin:r.x,ymin:r.y,xmax:r.x,ymax:r.y,spatialReference:r.spatialReference});case"extent":return r}return null}function I(r){if(r==null)return null;if(typeof r=="number")return r;let e=r.toLowerCase();switch(e=e.replaceAll(/\s/g,""),e=e.replaceAll("-",""),e){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 9001;case"miles":case"mile":case"squaremile":case"squaremiles":return 9093;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 9036;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 9096;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 9002;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 9030}return null}function _(r){if(r==null)return null;const e=r.clone();return r.cache._geVersion!==void 0&&(e.cache._geVersion=r.cache._geVersion),e}function f(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r}function C(r){if(!r)return"";const e=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g;let t="";for(const s of r.match(e)||[])switch(s){case"SSS":case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":t+=s;break;case"A":case"a":t+="a";break;default:t+=`'${s}'`}return t}class u{constructor(e,t,s,a){this._hour=e,this._minute=t,this._second=s,this._millisecond=a,this.declaredRootClass="esri.core.sql.timeonly"}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(e){return e instanceof u&&e.hour===this.hour&&e.minute===this.minute&&e.second===this.second&&e.millisecond===this.millisecond}clone(){return new u(this.hour,this.minute,this.second,this.millisecond)}isValid(){return f(this.hour)&&f(this.minute)&&f(this.second)&&f(this.millisecond)&&this.hour>=0&&this.hour<24&&this.minute>=0&&this.minute<60&&this.second>=0&&this.second<60&&this.millisecond>=0&&this.millisecond<1e3}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`+(this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):"")}toSQLValue(){return this.toString()}toSQLWithKeyword(){return`time '${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):""}'`}toStorageString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`}toFormat(e=null){return e===null||e===""?this.toString():(e=C(e))?i.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(e,{locale:U(),numberingSystem:"latn"}):""}toNumber(){return this.millisecond+1e3*this.second+1e3*this.minute*60+60*this.hour*60*1e3}static fromParts(e,t,s,a){const o=new u(e,t,s,a);return o.isValid()?o:null}static fromReader(e){if(!e)return null;const t=e.split(":");return t.length!==3?null:new u(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),0)}static fromMilliseconds(e){if(e>864e5||e<0)return null;const t=Math.floor(e/1e3%60),s=Math.floor(e/6e4%60),a=Math.floor(e/36e5%24),o=Math.floor(e%1e3);return new u(a,s,t,o)}static fromDateJS(e){return new u(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}static fromDateTime(e){return new u(e.hour,e.minute,e.second,e.millisecond)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(e===""||e===null)return null;const s=[];t?(t=C(t))&&s.push(t):t!==null&&t!==""||(s.push("HH:mm:ss"),s.push("HH:mm:ss.SSS"),s.push("hh:mm:ss a"),s.push("hh:mm:ss.SSS a"),s.push("HH:mm"),s.push("hh:mm a"),s.push("H:mm"),s.push("h:mm a"),s.push("H:mm:ss"),s.push("h:mm:ss a"),s.push("H:mm:ss.SSS"),s.push("h:mm:ss.SSS a"));for(const a of s){const o=i.fromFormat(e,a);if(o.isValid)return new u(o.hour,o.minute,o.second,o.millisecond)}return null}plus(e,t){switch(e){case"days":case"years":case"months":return this.clone();case"hours":case"minutes":case"seconds":case"milliseconds":return u.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}return null}toUTCDateTime(){return i.utc(1970,1,1,this.hour,this.minute,this.second,this.millisecond)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return t==="M"?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}}export{Y as a,I as b,_ as c,m as h,n as m,u as n,$ as r,z as s}; +import{hj as i,a5 as M,Y as g,a0 as Z,aF as q,cd as U,aE as b}from"./index-BjUNJPVf.js";import{t as l}from"./UnknownTimeZone-CK7VjgF3.js";var y;(function(r){r.TimeZoneNotRecognized="TimeZoneNotRecognized"})(y||(y={}));const N={[y.TimeZoneNotRecognized]:"Timezone identifier has not been recognized."};class p extends Error{constructor(e,t){super(q(N[e],t)),this.declaredRootClass="esri.arcade.arcadedate.dateerror",Error.captureStackTrace&&Error.captureStackTrace(this,p)}}function h(r,e,t){return rt?r-t:0}function d(r,e,t){return rt?t:r}class n{constructor(e){this._date=e,this.declaredRootClass="esri.arcade.arcadedate"}static fromParts(e=0,t=1,s=1,a=0,o=0,T=0,S=0,L){if(isNaN(e)||isNaN(t)||isNaN(s)||isNaN(a)||isNaN(o)||isNaN(T)||isNaN(S))return null;const w=i.local(e,t).daysInMonth;let D=i.fromObject({day:d(s,1,w),year:e,month:d(t,1,12),hour:d(a,0,23),minute:d(o,0,59),second:d(T,0,59),millisecond:d(S,0,999)},{zone:m(L)});return D=D.plus({months:h(t,1,12),days:h(s,1,w),hours:h(a,0,23),minutes:h(o,0,59),seconds:h(T,0,59),milliseconds:h(S,0,999)}),new n(D)}static get systemTimeZoneCanonicalName(){return Intl.DateTimeFormat().resolvedOptions().timeZone??"system"}static arcadeDateAndZoneToArcadeDate(e,t){const s=m(t);return e.isUnknownTimeZone||s===l.instance?n.fromParts(e.year,e.monthJS+1,e.day,e.hour,e.minute,e.second,e.millisecond,s):new n(e._date.setZone(s))}static dateJSToArcadeDate(e){return new n(i.fromJSDate(e,{zone:"system"}))}static dateJSAndZoneToArcadeDate(e,t="system"){const s=m(t);return new n(i.fromJSDate(e,{zone:s}))}static unknownEpochToArcadeDate(e){return new n(i.fromMillis(e,{zone:l.instance}))}static unknownDateJSToArcadeDate(e){return new n(i.fromMillis(e.getTime(),{zone:l.instance}))}static epochToArcadeDate(e,t="system"){const s=m(t);return new n(i.fromMillis(e,{zone:s}))}static dateTimeToArcadeDate(e){return new n(e)}clone(){return new n(this._date)}changeTimeZone(e){const t=m(e);return n.dateTimeToArcadeDate(this._date.setZone(t))}static dateTimeAndZoneToArcadeDate(e,t){const s=m(t);return e.zone===l.instance||s===l.instance?n.fromParts(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond,s):new n(e.setZone(s))}static nowToArcadeDate(e){const t=m(e);return new n(i.fromJSDate(new Date,{zone:t}))}static nowUTCToArcadeDate(){return new n(i.utc())}get isSystem(){return this.timeZone==="system"||this.timeZone===n.systemTimeZoneCanonicalName}equals(e){return this.isSystem&&e.isSystem?this.toNumber()===e.toNumber():this.isUnknownTimeZone===e.isUnknownTimeZone&&this._date.equals(e._date)}get isUnknownTimeZone(){return this._date.zone===l.instance}get isValid(){return this._date.isValid}get hour(){return this._date.hour}get second(){return this._date.second}get day(){return this._date.day}get dayOfWeekISO(){return this._date.weekday}get dayOfWeekJS(){let e=this._date.weekday;return e>6&&(e=0),e}get millisecond(){return this._date.millisecond}get monthISO(){return this._date.month}get weekISO(){return this._date.weekNumber}get yearISO(){return this._date.weekYear}get monthJS(){return this._date.month-1}get year(){return this._date.year}get minute(){return this._date.minute}get zone(){return this._date.zone}get timeZoneOffset(){return this.isUnknownTimeZone?0:this._date.offset}get timeZone(){if(this.isUnknownTimeZone)return"unknown";if(this._date.zone.type==="system")return"system";const e=this.zone;return e.type==="fixed"?e.fixed===0?"UTC":e.formatOffset(0,"short"):e.name}stringify(){return JSON.stringify(this.toJSDate())}plus(e){return new n(this._date.plus(e))}diff(e,t="milliseconds"){return this._date.diff(e._date,t)[t]}toISODate(){return this._date.toISODate()}toISOString(e){return e?this._date.toISO({suppressMilliseconds:!0,includeOffset:!this.isUnknownTimeZone}):this._date.toISO({includeOffset:!this.isUnknownTimeZone})}toISOTime(e,t){return this._date.toISOTime({suppressMilliseconds:e,includeOffset:t&&!this.isUnknownTimeZone})}toFormat(e,t){return this.isUnknownTimeZone&&(e=e.replaceAll("Z","")),this._date.toFormat(e,t)}toJSDate(){return this._date.toJSDate()}toSQLValue(){return this._date.toFormat("yyyy-LL-dd HH:mm:ss")}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}toDateTime(){return this._date}toNumber(){return this._date.toMillis()}getTime(){return this._date.toMillis()}toUTC(){return new n(this._date.toUTC())}toLocal(){return new n(this._date.toLocal())}toString(){return this.toISOString(!0)}static fromReaderAsTimeStampOffset(e){if(!e)return null;const t=i.fromISO(e,{setZone:!0});return new n(t)}}function m(r,e=!0){if(r instanceof M)return r;if(r.toLowerCase()==="system")return"system";if(r.toLowerCase()==="utc")return"UTC";if(r.toLowerCase()==="unknown")return l.instance;if(/^[\+\-]?[0-9]{1,2}([:][0-9]{2})?$/.test(r)){const s=g.parseSpecifier("UTC"+(r.startsWith("+")||r.startsWith("-")?"":"+")+r);if(s)return s}const t=Z.create(r);if(!t.isValid){if(e)throw new p(y.TimeZoneNotRecognized);return null}return t}function k(r){r=r.replaceAll(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let e="";const t=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const s of r.match(t)||[])switch(s){case"D":e+="d";break;case"DD":e+="dd";break;case"DDD":e+="o";break;case"d":e+="c";break;case"ddd":e+="ccc";break;case"dddd":e+="cccc";break;case"M":e+="L";break;case"MM":e+="LL";break;case"MMM":e+="LLL";break;case"MMMM":e+="LLLL";break;case"YY":e+="yy";break;case"Y":case"YYYY":e+="yyyy";break;case"Q":e+="q";break;case"X":case"x":e+=s;break;default:s.length>=2&&s.slice(0,1)==="["&&s.slice(-1)==="]"?e+=`'${s.slice(1,-1)}'`:e+=`'${s}'`}return e}let Y=class c{constructor(e,t,s){this._year=e,this._month=t,this._day=s,this.declaredRootClass="esri.core.sql.dateonly"}get month(){return this._month}get monthJS(){return this._month-1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(e){return e instanceof c&&e.day===this.day&&e.month===this.month&&e.year===this.year}clone(){return new c(this._year,this._month,this._day)}toDateTime(e){return i.fromObject({day:this.day,month:this.month,year:this.year},{zone:m(e)})}toDateTimeLuxon(e){return i.fromObject({day:this.day,month:this.month,year:this.year},{zone:m(e)})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(e=null,t=!0){if(e===null||e==="")return this.toString();if(t&&(e=k(e)),!e)return"";const s=this.toDateTime("unknown");return n.dateTimeToArcadeDate(s).toFormat(e,{locale:U(),numberingSystem:"latn"})}toArcadeDate(){const e=this.toDateTime("unknown");return n.dateTimeToArcadeDate(e)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd",!1)}toSQLValue(){return this.toFormat("yyyy-LL-dd",!1)}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd",!1)+"'"}plus(e,t){return c.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}toUTCDateTime(){return i.utc(this.year,this.month,this.day,0,0,0,0)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return t==="M"?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}static fromMilliseconds(e){const t=i.fromMillis(e,{zone:g.utcInstance});return t.isValid?c.fromParts(t.year,t.month,t.day):null}static fromSeconds(e){const t=i.fromSeconds(e,{zone:g.utcInstance});return t.isValid?c.fromParts(t.year,t.month,t.day):null}static fromReader(e){if(!e)return null;const t=e.split("-");return t.length!==3?null:new c(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10))}static fromParts(e,t,s){const a=new c(e,t,s);return a.isValid===!1?null:a}static fromDateJS(e){return c.fromParts(e.getFullYear(),e.getMonth()+1,e.getDay())}static fromDateTime(e){return c.fromParts(e.year,e.month,e.day)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(e===""||e===null)return null;const s=[];if(t)(t=k(t))&&s.push(t);else if(t===null||t===""){const a=i.fromISO(e,{setZone:!0});return a.isValid?c.fromParts(a.year,a.month,a.day):null}for(const a of s){const o=i.fromFormat(e,t??a);if(o.isValid)return new c(o.year,o.month,o.day)}return null}static fromNow(e="system"){const t=i.fromJSDate(new Date).setZone(m(e));return new c(t.year,t.month,t.day)}};function $(r){if(r==null)return null;if(typeof r=="number")return r;let e=r.toLowerCase();switch(e=e.replaceAll(/\s/g,""),e=e.replaceAll("-",""),e){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 109404;case"miles":case"mile":case"squaremile":case"squaremiles":return 109439;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 109414;case"acres":case"acre":case"ac":return 109402;case"hectares":case"hectare":case"ha":return 109401;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 109442;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 109405;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 109409}return null}function z(r){if(r==null)return null;switch(r.type){case"polygon":case"multipoint":case"polyline":return r.extent;case"point":return new b({xmin:r.x,ymin:r.y,xmax:r.x,ymax:r.y,spatialReference:r.spatialReference});case"extent":return r}return null}function I(r){if(r==null)return null;if(typeof r=="number")return r;let e=r.toLowerCase();switch(e=e.replaceAll(/\s/g,""),e=e.replaceAll("-",""),e){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 9001;case"miles":case"mile":case"squaremile":case"squaremiles":return 9093;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 9036;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 9096;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 9002;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 9030}return null}function _(r){if(r==null)return null;const e=r.clone();return r.cache._geVersion!==void 0&&(e.cache._geVersion=r.cache._geVersion),e}function f(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r}function C(r){if(!r)return"";const e=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g;let t="";for(const s of r.match(e)||[])switch(s){case"SSS":case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":t+=s;break;case"A":case"a":t+="a";break;default:t+=`'${s}'`}return t}class u{constructor(e,t,s,a){this._hour=e,this._minute=t,this._second=s,this._millisecond=a,this.declaredRootClass="esri.core.sql.timeonly"}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(e){return e instanceof u&&e.hour===this.hour&&e.minute===this.minute&&e.second===this.second&&e.millisecond===this.millisecond}clone(){return new u(this.hour,this.minute,this.second,this.millisecond)}isValid(){return f(this.hour)&&f(this.minute)&&f(this.second)&&f(this.millisecond)&&this.hour>=0&&this.hour<24&&this.minute>=0&&this.minute<60&&this.second>=0&&this.second<60&&this.millisecond>=0&&this.millisecond<1e3}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`+(this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):"")}toSQLValue(){return this.toString()}toSQLWithKeyword(){return`time '${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):""}'`}toStorageString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`}toFormat(e=null){return e===null||e===""?this.toString():(e=C(e))?i.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(e,{locale:U(),numberingSystem:"latn"}):""}toNumber(){return this.millisecond+1e3*this.second+1e3*this.minute*60+60*this.hour*60*1e3}static fromParts(e,t,s,a){const o=new u(e,t,s,a);return o.isValid()?o:null}static fromReader(e){if(!e)return null;const t=e.split(":");return t.length!==3?null:new u(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),0)}static fromMilliseconds(e){if(e>864e5||e<0)return null;const t=Math.floor(e/1e3%60),s=Math.floor(e/6e4%60),a=Math.floor(e/36e5%24),o=Math.floor(e%1e3);return new u(a,s,t,o)}static fromDateJS(e){return new u(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}static fromDateTime(e){return new u(e.hour,e.minute,e.second,e.millisecond)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(e===""||e===null)return null;const s=[];t?(t=C(t))&&s.push(t):t!==null&&t!==""||(s.push("HH:mm:ss"),s.push("HH:mm:ss.SSS"),s.push("hh:mm:ss a"),s.push("hh:mm:ss.SSS a"),s.push("HH:mm"),s.push("hh:mm a"),s.push("H:mm"),s.push("h:mm a"),s.push("H:mm:ss"),s.push("h:mm:ss a"),s.push("H:mm:ss.SSS"),s.push("h:mm:ss.SSS a"));for(const a of s){const o=i.fromFormat(e,a);if(o.isValid)return new u(o.hour,o.minute,o.second,o.millisecond)}return null}plus(e,t){switch(e){case"days":case"years":case"months":return this.clone();case"hours":case"minutes":case"seconds":case"milliseconds":return u.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}return null}toUTCDateTime(){return i.utc(1970,1,1,this.hour,this.minute,this.second,this.millisecond)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return t==="M"?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}}export{Y as a,I as b,_ as c,m as h,n as m,u as n,$ as r,z as s}; diff --git a/assets/Tooltip-CVjHQVY5.js b/assets/Tooltip-C7eoaNP4.js similarity index 99% rename from assets/Tooltip-CVjHQVY5.js rename to assets/Tooltip-C7eoaNP4.js index 6a6cee4..0d151a2 100644 --- a/assets/Tooltip-CVjHQVY5.js +++ b/assets/Tooltip-C7eoaNP4.js @@ -1 +1 @@ -import{b as M,i as N,ak as E,al as L,c as x,h as Y,a6 as W,a3 as j,ad as B,am as u}from"./Theme-Bdh3gaKt.js";class D extends M{_beforeChanged(){super._beforeChanged(),(this.isDirty("pointerBaseWidth")||this.isDirty("cornerRadius")||this.isDirty("pointerLength")||this.isDirty("pointerX")||this.isDirty("pointerY")||this.isDirty("width")||this.isDirty("height"))&&(this._clear=!0)}_changed(){if(super._changed(),this._clear){this.markDirtyBounds();let t=this.width(),i=this.height();if(t>0&&i>0){let e=this.get("cornerRadius",8);e=u(e,0,Math.min(t/2,i/2));let l=this.get("pointerX",0),o=this.get("pointerY",0),a=this.get("pointerBaseWidth",15)/2,T=0,_=0,f=0,c=(l-T)*(i-_)-(o-_)*(t-T),n=(l-f)*(0-i)-(o-i)*(t-f);const s=this._display;if(s.moveTo(e,0),c>0&&n>0){let r=Math.round(u(l,e+a,t-a-e));o=u(o,-1/0,0),s.lineTo(r-a,0),s.lineTo(l,o),s.lineTo(r+a,0)}if(s.lineTo(t-e,0),s.arcTo(t,0,t,e,e),c>0&&n<0){let r=Math.round(u(o,e+a,i-a-e));l=u(l,t,1/0),s.lineTo(t,e),s.lineTo(t,Math.max(r-a,e)),s.lineTo(l,o),s.lineTo(t,r+a)}if(s.lineTo(t,i-e),s.arcTo(t,i,t-e,i,e),c<0&&n<0){let r=Math.round(u(l,e+a,t-a-e));o=u(o,i,1/0),s.lineTo(t-e,i),s.lineTo(r+a,i),s.lineTo(l,o),s.lineTo(r-a,i)}if(s.lineTo(e,i),s.arcTo(0,i,0,i-e,e),c<0&&n>0){let r=Math.round(u(o,e+a,i-e-a));l=u(l,-1/0,0),s.lineTo(0,i-e),s.lineTo(0,r+a),s.lineTo(l,o),s.lineTo(0,Math.max(r-a,e))}s.lineTo(0,e),s.arcTo(0,0,e,0,e),s.closePath()}}}}Object.defineProperty(D,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PointedRectangle"}),Object.defineProperty(D,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:M.classNames.concat([D.className])});class P extends N{constructor(t,i,e,l=[]){super(t,i,e,l),Object.defineProperty(this,"_fx",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_fy",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_label",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fillDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_labelDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_w",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_h",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_keepHoverDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_htmlContentHovered",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this._settings.themeTags=E(this._settings.themeTags,["tooltip"]),super._afterNew(),this.set("background",D.new(this._root,{themeTags:["tooltip","background"]})),this._label=this.children.push(L.new(this._root,{})),this._disposers.push(this._label.events.on("boundschanged",()=>{this._updateBackground()})),this._disposers.push(this.on("bounds",()=>{this._updateBackground()})),this._updateTextColor(),this._root.tooltipContainer.children.push(this),this.hide(0),this._disposers.push(this.label.onPrivate("htmlElement",t=>{t&&(x(t,"pointerover",i=>{this._htmlContentHovered=!0}),x(t,"pointerout",i=>{this._htmlContentHovered=!1}))})),this._root._tooltips.push(this)}get label(){return this._label}dispose(){super.dispose(),Y(this._root._tooltips,this)}_updateChildren(){super._updateChildren(),(this.isDirty("pointerOrientation")||this.isPrivateDirty("minWidth")||this.isPrivateDirty("minHeight"))&&this.get("background")._markDirtyKey("width"),this.get("labelText")!=null&&this.label.set("text",this.get("labelText")),this.get("labelHTML")!=null&&this.label.set("html",this.get("labelHTML"))}_changed(){if(super._changed(),(this.isDirty("pointTo")||this.isDirty("pointerOrientation"))&&this._updateBackground(),this.isDirty("tooltipTarget")&&this.updateBackgroundColor(),this.isDirty("keepTargetHover"))if(this.get("keepTargetHover")){const t=this.get("background");this._keepHoverDp=new W([t.events.on("pointerover",i=>{let e=this.get("tooltipTarget");e&&(e.parent&&e.parent.getPrivate("tooltipTarget")==e&&(e=e.parent),e.hover())}),t.events.on("pointerout",i=>{let e=this.get("tooltipTarget");e&&(e.parent&&e.parent.getPrivate("tooltipTarget")==e&&(e=e.parent),this._htmlContentHovered||e.unhover())})]),this.label.onPrivate("htmlElement",i=>{this._keepHoverDp&&i&&this._keepHoverDp.disposers.push(x(i,"pointerleave",e=>{const l=this.root._renderer.getEvent(e);t.events.dispatch("pointerout",{type:"pointerout",originalEvent:l.event,point:l.point,simulated:!1,target:t})}))})}else this._keepHoverDp&&(this._keepHoverDp.dispose(),this._keepHoverDp=void 0)}_onShow(){super._onShow(),this.updateBackgroundColor()}updateBackgroundColor(){let t=this.get("tooltipTarget");const i=this.get("background");let e,l;t&&i&&(e=t.get("fill"),l=t.get("stroke"),e==null&&(e=l),this.get("getFillFromSprite")&&(this._fillDp&&this._fillDp.dispose(),e!=null&&i.set("fill",e),this._fillDp=t.on("fill",o=>{o!=null&&(i.set("fill",o),this._updateTextColor(o))}),this._disposers.push(this._fillDp)),this.get("getStrokeFromSprite")&&(this._strokeDp&&this._strokeDp.dispose(),e!=null&&i.set("stroke",e),this._strokeDp=t.on("fill",o=>{o!=null&&i.set("stroke",o)}),this._disposers.push(this._strokeDp)),this.get("getLabelFillFromSprite")&&(this._labelDp&&this._labelDp.dispose(),e!=null&&this.label.set("fill",e),this._labelDp=t.on("fill",o=>{o!=null&&this.label.set("fill",o)}),this._disposers.push(this._labelDp))),this._updateTextColor(e)}_updateTextColor(t){this.get("autoTextColor")&&(t==null&&(t=this.get("background").get("fill")),t==null&&(t=this._root.interfaceColors.get("background")),t instanceof j&&this.label.set("fill",j.alternative(t,this._root.interfaceColors.get("alternativeText"),this._root.interfaceColors.get("text"))))}_setDataItem(t){super._setDataItem(t),this.label._setDataItem(t)}_updateBackground(){super.updateBackground();const t=this._root.container;if(t){let i=.5,e=.5,l=this.get("centerX");l instanceof B&&(i=l.value);let o=this.get("centerY");o instanceof B&&(e=o.value);let a=t.width(),T=t.height(),_=this.parent,f=0,c=0;if(_){f=_.x(),c=_.y();const d=_.get("layerMargin");d&&(f+=d.left||0,c+=d.top||0,a+=(d.left||0)+(d.right||0),T+=(d.top||0)+(d.bottom||0))}const n=this.get("bounds",{left:-f,top:-c,right:a-f,bottom:T-c});this._updateBounds();let s=this.width(),r=this.height();s===0&&(s=this._w),r===0&&(r=this._h);let k=this.get("pointTo",{x:a/2,y:T/2}),h=k.x,p=k.y,m=this.get("pointerOrientation"),b=this.get("background"),g=0,v=0,y=0;b instanceof D&&(g=b.get("pointerLength",0),v=b.get("strokeWidth",0)/2,y=v,b.set("width",s),b.set("height",r));let C=0,O=0,H=n.right-n.left,S=n.bottom-n.top;m=="horizontal"||m=="left"||m=="right"?(v=0,m=="horizontal"?h>n.left+H/2?(h-=s*(1-i)+g,y*=-1):h+=s*i+g:m=="left"?h+=s*(1-i)+g:(h-=s*i+g,y*=-1)):(y=0,m=="vertical"?p>n.top+r/2+g?p-=r*(1-e)+g:(p+=r*e+g,v*=-1):m=="down"?p-=r*(1-e)+g:(p+=r*e+g,v*=-1)),h=u(h,n.left+s*i,n.left+H-s*(1-i))+y,p=u(p,n.top+r*e,n.top+S-r*(1-e))-v,C=k.x-h+s*i+y,O=k.y-p+r*e-v,this._fx=h,this._fy=p;const w=this.get("animationDuration",0);if(w>0&&this.get("visible")&&this.get("opacity")>.1){const d=this.get("animationEasing");this.animate({key:"x",to:h,duration:w,easing:d}),this.animate({key:"y",to:p,duration:w,easing:d})}else this.set("x",h),this.set("y",p);b instanceof D&&(b.set("pointerX",C),b.set("pointerY",O)),s>0&&(this._w=s),r>0&&(this._h=r)}}}Object.defineProperty(P,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Tooltip"}),Object.defineProperty(P,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:N.classNames.concat([P.className])});export{P as u}; +import{b as M,i as N,ak as E,al as L,c as x,h as Y,a6 as W,a3 as j,ad as B,am as u}from"./Theme-6HY29PEY.js";class D extends M{_beforeChanged(){super._beforeChanged(),(this.isDirty("pointerBaseWidth")||this.isDirty("cornerRadius")||this.isDirty("pointerLength")||this.isDirty("pointerX")||this.isDirty("pointerY")||this.isDirty("width")||this.isDirty("height"))&&(this._clear=!0)}_changed(){if(super._changed(),this._clear){this.markDirtyBounds();let t=this.width(),i=this.height();if(t>0&&i>0){let e=this.get("cornerRadius",8);e=u(e,0,Math.min(t/2,i/2));let l=this.get("pointerX",0),o=this.get("pointerY",0),a=this.get("pointerBaseWidth",15)/2,T=0,_=0,f=0,c=(l-T)*(i-_)-(o-_)*(t-T),n=(l-f)*(0-i)-(o-i)*(t-f);const s=this._display;if(s.moveTo(e,0),c>0&&n>0){let r=Math.round(u(l,e+a,t-a-e));o=u(o,-1/0,0),s.lineTo(r-a,0),s.lineTo(l,o),s.lineTo(r+a,0)}if(s.lineTo(t-e,0),s.arcTo(t,0,t,e,e),c>0&&n<0){let r=Math.round(u(o,e+a,i-a-e));l=u(l,t,1/0),s.lineTo(t,e),s.lineTo(t,Math.max(r-a,e)),s.lineTo(l,o),s.lineTo(t,r+a)}if(s.lineTo(t,i-e),s.arcTo(t,i,t-e,i,e),c<0&&n<0){let r=Math.round(u(l,e+a,t-a-e));o=u(o,i,1/0),s.lineTo(t-e,i),s.lineTo(r+a,i),s.lineTo(l,o),s.lineTo(r-a,i)}if(s.lineTo(e,i),s.arcTo(0,i,0,i-e,e),c<0&&n>0){let r=Math.round(u(o,e+a,i-e-a));l=u(l,-1/0,0),s.lineTo(0,i-e),s.lineTo(0,r+a),s.lineTo(l,o),s.lineTo(0,Math.max(r-a,e))}s.lineTo(0,e),s.arcTo(0,0,e,0,e),s.closePath()}}}}Object.defineProperty(D,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PointedRectangle"}),Object.defineProperty(D,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:M.classNames.concat([D.className])});class P extends N{constructor(t,i,e,l=[]){super(t,i,e,l),Object.defineProperty(this,"_fx",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_fy",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_label",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fillDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_labelDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_w",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_h",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_keepHoverDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_htmlContentHovered",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this._settings.themeTags=E(this._settings.themeTags,["tooltip"]),super._afterNew(),this.set("background",D.new(this._root,{themeTags:["tooltip","background"]})),this._label=this.children.push(L.new(this._root,{})),this._disposers.push(this._label.events.on("boundschanged",()=>{this._updateBackground()})),this._disposers.push(this.on("bounds",()=>{this._updateBackground()})),this._updateTextColor(),this._root.tooltipContainer.children.push(this),this.hide(0),this._disposers.push(this.label.onPrivate("htmlElement",t=>{t&&(x(t,"pointerover",i=>{this._htmlContentHovered=!0}),x(t,"pointerout",i=>{this._htmlContentHovered=!1}))})),this._root._tooltips.push(this)}get label(){return this._label}dispose(){super.dispose(),Y(this._root._tooltips,this)}_updateChildren(){super._updateChildren(),(this.isDirty("pointerOrientation")||this.isPrivateDirty("minWidth")||this.isPrivateDirty("minHeight"))&&this.get("background")._markDirtyKey("width"),this.get("labelText")!=null&&this.label.set("text",this.get("labelText")),this.get("labelHTML")!=null&&this.label.set("html",this.get("labelHTML"))}_changed(){if(super._changed(),(this.isDirty("pointTo")||this.isDirty("pointerOrientation"))&&this._updateBackground(),this.isDirty("tooltipTarget")&&this.updateBackgroundColor(),this.isDirty("keepTargetHover"))if(this.get("keepTargetHover")){const t=this.get("background");this._keepHoverDp=new W([t.events.on("pointerover",i=>{let e=this.get("tooltipTarget");e&&(e.parent&&e.parent.getPrivate("tooltipTarget")==e&&(e=e.parent),e.hover())}),t.events.on("pointerout",i=>{let e=this.get("tooltipTarget");e&&(e.parent&&e.parent.getPrivate("tooltipTarget")==e&&(e=e.parent),this._htmlContentHovered||e.unhover())})]),this.label.onPrivate("htmlElement",i=>{this._keepHoverDp&&i&&this._keepHoverDp.disposers.push(x(i,"pointerleave",e=>{const l=this.root._renderer.getEvent(e);t.events.dispatch("pointerout",{type:"pointerout",originalEvent:l.event,point:l.point,simulated:!1,target:t})}))})}else this._keepHoverDp&&(this._keepHoverDp.dispose(),this._keepHoverDp=void 0)}_onShow(){super._onShow(),this.updateBackgroundColor()}updateBackgroundColor(){let t=this.get("tooltipTarget");const i=this.get("background");let e,l;t&&i&&(e=t.get("fill"),l=t.get("stroke"),e==null&&(e=l),this.get("getFillFromSprite")&&(this._fillDp&&this._fillDp.dispose(),e!=null&&i.set("fill",e),this._fillDp=t.on("fill",o=>{o!=null&&(i.set("fill",o),this._updateTextColor(o))}),this._disposers.push(this._fillDp)),this.get("getStrokeFromSprite")&&(this._strokeDp&&this._strokeDp.dispose(),e!=null&&i.set("stroke",e),this._strokeDp=t.on("fill",o=>{o!=null&&i.set("stroke",o)}),this._disposers.push(this._strokeDp)),this.get("getLabelFillFromSprite")&&(this._labelDp&&this._labelDp.dispose(),e!=null&&this.label.set("fill",e),this._labelDp=t.on("fill",o=>{o!=null&&this.label.set("fill",o)}),this._disposers.push(this._labelDp))),this._updateTextColor(e)}_updateTextColor(t){this.get("autoTextColor")&&(t==null&&(t=this.get("background").get("fill")),t==null&&(t=this._root.interfaceColors.get("background")),t instanceof j&&this.label.set("fill",j.alternative(t,this._root.interfaceColors.get("alternativeText"),this._root.interfaceColors.get("text"))))}_setDataItem(t){super._setDataItem(t),this.label._setDataItem(t)}_updateBackground(){super.updateBackground();const t=this._root.container;if(t){let i=.5,e=.5,l=this.get("centerX");l instanceof B&&(i=l.value);let o=this.get("centerY");o instanceof B&&(e=o.value);let a=t.width(),T=t.height(),_=this.parent,f=0,c=0;if(_){f=_.x(),c=_.y();const d=_.get("layerMargin");d&&(f+=d.left||0,c+=d.top||0,a+=(d.left||0)+(d.right||0),T+=(d.top||0)+(d.bottom||0))}const n=this.get("bounds",{left:-f,top:-c,right:a-f,bottom:T-c});this._updateBounds();let s=this.width(),r=this.height();s===0&&(s=this._w),r===0&&(r=this._h);let k=this.get("pointTo",{x:a/2,y:T/2}),h=k.x,p=k.y,m=this.get("pointerOrientation"),b=this.get("background"),g=0,v=0,y=0;b instanceof D&&(g=b.get("pointerLength",0),v=b.get("strokeWidth",0)/2,y=v,b.set("width",s),b.set("height",r));let C=0,O=0,H=n.right-n.left,S=n.bottom-n.top;m=="horizontal"||m=="left"||m=="right"?(v=0,m=="horizontal"?h>n.left+H/2?(h-=s*(1-i)+g,y*=-1):h+=s*i+g:m=="left"?h+=s*(1-i)+g:(h-=s*i+g,y*=-1)):(y=0,m=="vertical"?p>n.top+r/2+g?p-=r*(1-e)+g:(p+=r*e+g,v*=-1):m=="down"?p-=r*(1-e)+g:(p+=r*e+g,v*=-1)),h=u(h,n.left+s*i,n.left+H-s*(1-i))+y,p=u(p,n.top+r*e,n.top+S-r*(1-e))-v,C=k.x-h+s*i+y,O=k.y-p+r*e-v,this._fx=h,this._fy=p;const w=this.get("animationDuration",0);if(w>0&&this.get("visible")&&this.get("opacity")>.1){const d=this.get("animationEasing");this.animate({key:"x",to:h,duration:w,easing:d}),this.animate({key:"y",to:p,duration:w,easing:d})}else this.set("x",h),this.set("y",p);b instanceof D&&(b.set("pointerX",C),b.set("pointerY",O)),s>0&&(this._w=s),r>0&&(this._h=r)}}}Object.defineProperty(P,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Tooltip"}),Object.defineProperty(P,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:N.classNames.concat([P.className])});export{P as u}; diff --git a/assets/TopFeaturesQuery-B8kC7n5h.js b/assets/TopFeaturesQuery-CVQjqlfM.js similarity index 98% rename from assets/TopFeaturesQuery-B8kC7n5h.js rename to assets/TopFeaturesQuery-CVQjqlfM.js index 65481cf..cbd8620 100644 --- a/assets/TopFeaturesQuery-B8kC7n5h.js +++ b/assets/TopFeaturesQuery-CVQjqlfM.js @@ -1 +1 @@ -import{d as t,y as i,f as u,aU as y,aY as h,a$ as c,b0 as v,aS as m,aR as a,b2 as w,aT as S,aV as R}from"./index-CEWggaxV.js";var o;let s=o=class extends y{constructor(r){super(r),this.groupByFields=void 0,this.topCount=void 0,this.orderByFields=void 0}clone(){return new o({groupByFields:this.groupByFields,topCount:this.topCount,orderByFields:this.orderByFields})}};t([i({type:[String],json:{write:!0}})],s.prototype,"groupByFields",void 0),t([i({type:Number,json:{write:!0}})],s.prototype,"topCount",void 0),t([i({type:[String],json:{write:!0}})],s.prototype,"orderByFields",void 0),s=o=t([u("esri.rest.support.TopFilter")],s);const j=s;var n;const p=new h({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),d=new h({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let e=n=class extends y{constructor(r){super(r),this.cacheHint=void 0,this.distance=void 0,this.geometry=null,this.geometryPrecision=void 0,this.maxAllowableOffset=void 0,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.resultType=null,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.start=void 0,this.spatialRelationship="intersects",this.timeExtent=null,this.topFilter=void 0,this.units=null,this.where="1=1"}writeStart(r,l){l.resultOffset=this.start,l.resultRecordCount=this.num||10}clone(){return new n(R({cacheHint:this.cacheHint,distance:this.distance,geometry:this.geometry,geometryPrecision:this.geometryPrecision,maxAllowableOffset:this.maxAllowableOffset,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,resultType:this.resultType,returnGeometry:this.returnGeometry,returnZ:this.returnZ,returnM:this.returnM,start:this.start,spatialRelationship:this.spatialRelationship,timeExtent:this.timeExtent,topFilter:this.topFilter,units:this.units,where:this.where}))}};t([i({type:Boolean,json:{write:!0}})],e.prototype,"cacheHint",void 0),t([i({type:Number,json:{write:{overridePolicy:r=>({enabled:r>0})}}})],e.prototype,"distance",void 0),t([i({types:c,json:{read:v,write:!0}})],e.prototype,"geometry",void 0),t([i({type:Number,json:{write:!0}})],e.prototype,"geometryPrecision",void 0),t([i({type:Number,json:{write:!0}})],e.prototype,"maxAllowableOffset",void 0),t([i({type:Number,json:{read:{source:"resultRecordCount"}}})],e.prototype,"num",void 0),t([i({json:{write:!0}})],e.prototype,"objectIds",void 0),t([i({type:[String],json:{write:!0}})],e.prototype,"orderByFields",void 0),t([i({type:[String],json:{write:!0}})],e.prototype,"outFields",void 0),t([i({type:m,json:{read:{source:"outSR"},write:{target:"outSR"}}})],e.prototype,"outSpatialReference",void 0),t([i({type:String,json:{write:!0}})],e.prototype,"resultType",void 0),t([i({json:{write:!0}})],e.prototype,"returnGeometry",void 0),t([i({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],e.prototype,"returnM",void 0),t([i({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],e.prototype,"returnZ",void 0),t([i({type:Number,json:{read:{source:"resultOffset"}}})],e.prototype,"start",void 0),t([a("start"),a("num")],e.prototype,"writeStart",null),t([i({type:String,json:{read:{source:"spatialRel",reader:p.read},write:{target:"spatialRel",writer:p.write}}})],e.prototype,"spatialRelationship",void 0),t([i({type:w,json:{write:!0}})],e.prototype,"timeExtent",void 0),t([i({type:j,json:{write:!0}})],e.prototype,"topFilter",void 0),t([i({type:String,json:{read:d.read,write:{writer:d.write,overridePolicy(r){return{enabled:r!=null&&this.distance!=null&&this.distance>0}}}}})],e.prototype,"units",void 0),t([i({type:String,json:{write:!0}})],e.prototype,"where",void 0),e=n=t([u("esri.rest.support.TopFeaturesQuery")],e),e.from=S(e);const f=e;export{f as S}; +import{d as t,y as i,f as u,aU as y,aY as h,a$ as c,b0 as v,aS as m,aR as a,b2 as w,aT as S,aV as R}from"./index-BjUNJPVf.js";var o;let s=o=class extends y{constructor(r){super(r),this.groupByFields=void 0,this.topCount=void 0,this.orderByFields=void 0}clone(){return new o({groupByFields:this.groupByFields,topCount:this.topCount,orderByFields:this.orderByFields})}};t([i({type:[String],json:{write:!0}})],s.prototype,"groupByFields",void 0),t([i({type:Number,json:{write:!0}})],s.prototype,"topCount",void 0),t([i({type:[String],json:{write:!0}})],s.prototype,"orderByFields",void 0),s=o=t([u("esri.rest.support.TopFilter")],s);const j=s;var n;const p=new h({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),d=new h({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let e=n=class extends y{constructor(r){super(r),this.cacheHint=void 0,this.distance=void 0,this.geometry=null,this.geometryPrecision=void 0,this.maxAllowableOffset=void 0,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.resultType=null,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.start=void 0,this.spatialRelationship="intersects",this.timeExtent=null,this.topFilter=void 0,this.units=null,this.where="1=1"}writeStart(r,l){l.resultOffset=this.start,l.resultRecordCount=this.num||10}clone(){return new n(R({cacheHint:this.cacheHint,distance:this.distance,geometry:this.geometry,geometryPrecision:this.geometryPrecision,maxAllowableOffset:this.maxAllowableOffset,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,resultType:this.resultType,returnGeometry:this.returnGeometry,returnZ:this.returnZ,returnM:this.returnM,start:this.start,spatialRelationship:this.spatialRelationship,timeExtent:this.timeExtent,topFilter:this.topFilter,units:this.units,where:this.where}))}};t([i({type:Boolean,json:{write:!0}})],e.prototype,"cacheHint",void 0),t([i({type:Number,json:{write:{overridePolicy:r=>({enabled:r>0})}}})],e.prototype,"distance",void 0),t([i({types:c,json:{read:v,write:!0}})],e.prototype,"geometry",void 0),t([i({type:Number,json:{write:!0}})],e.prototype,"geometryPrecision",void 0),t([i({type:Number,json:{write:!0}})],e.prototype,"maxAllowableOffset",void 0),t([i({type:Number,json:{read:{source:"resultRecordCount"}}})],e.prototype,"num",void 0),t([i({json:{write:!0}})],e.prototype,"objectIds",void 0),t([i({type:[String],json:{write:!0}})],e.prototype,"orderByFields",void 0),t([i({type:[String],json:{write:!0}})],e.prototype,"outFields",void 0),t([i({type:m,json:{read:{source:"outSR"},write:{target:"outSR"}}})],e.prototype,"outSpatialReference",void 0),t([i({type:String,json:{write:!0}})],e.prototype,"resultType",void 0),t([i({json:{write:!0}})],e.prototype,"returnGeometry",void 0),t([i({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],e.prototype,"returnM",void 0),t([i({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],e.prototype,"returnZ",void 0),t([i({type:Number,json:{read:{source:"resultOffset"}}})],e.prototype,"start",void 0),t([a("start"),a("num")],e.prototype,"writeStart",null),t([i({type:String,json:{read:{source:"spatialRel",reader:p.read},write:{target:"spatialRel",writer:p.write}}})],e.prototype,"spatialRelationship",void 0),t([i({type:w,json:{write:!0}})],e.prototype,"timeExtent",void 0),t([i({type:j,json:{write:!0}})],e.prototype,"topFilter",void 0),t([i({type:String,json:{read:d.read,write:{writer:d.write,overridePolicy(r){return{enabled:r!=null&&this.distance!=null&&this.distance>0}}}}})],e.prototype,"units",void 0),t([i({type:String,json:{write:!0}})],e.prototype,"where",void 0),e=n=t([u("esri.rest.support.TopFeaturesQuery")],e),e.from=S(e);const f=e;export{f as S}; diff --git a/assets/TurboLine-CkxIB4ZX.js b/assets/TurboLine-DNQdPIXo.js similarity index 98% rename from assets/TurboLine-CkxIB4ZX.js rename to assets/TurboLine-DNQdPIXo.js index 0dbfe4e..4f7c7a5 100644 --- a/assets/TurboLine-CkxIB4ZX.js +++ b/assets/TurboLine-DNQdPIXo.js @@ -1,7 +1,7 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/libtess-asm-DL92duA_.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css","assets/libtess-CR3C3MJB.js"] + __vite__mapDeps.viteFileDeps = ["assets/libtess-asm-rVi5NxzN.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css","assets/libtess-B_UHPwdK.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{E as ue,_ as Qt,gZ as he,hg as ce,hh as st,hi as J}from"./index-CEWggaxV.js";const xe=128e3;let jt=null,re=null;async function ir(){return jt||(jt=fe()),jt}async function fe(){re=await(ue("esri-csp-restrictions")?await Qt(()=>import("./libtess-asm-DL92duA_.js"),__vite__mapDeps([0,1,2])).then(i=>i.l):await Qt(()=>import("./libtess-CR3C3MJB.js"),__vite__mapDeps([3,1,2])).then(i=>i.l)).default({locateFile:i=>he(`esri/core/libs/libtess/${i}`)})}function nr(s,i){const o=Math.max(s.length,xe);return re.triangulate(s,i,o)}const St=[["(",")"],[")","("],["<",">"],[">","<"],["[","]"],["]","["],["{","}"],["}","{"],["«","»"],["»","«"],["‹","›"],["›","‹"],["⁽","⁾"],["⁾","⁽"],["₍","₎"],["₎","₍"],["≤","≥"],["≥","≤"],["〈","〉"],["〉","〈"],["﹙","﹚"],["﹚","﹙"],["﹛","﹜"],["﹜","﹛"],["﹝","﹞"],["﹞","﹝"],["﹤","﹥"],["﹥","﹤"]],At=["آ","أ","إ","ا"],ye=["ﻵ","ﻷ","ﻹ","ﻻ"],_e=["ﻶ","ﻸ","ﻺ","ﻼ"],kt=["ا","ب","ت","ث","ج","ح","خ","د","ذ","ر","ز","س","ش","ص","ض","ط","ظ","ع","غ","ف","ق","ك","ل","م","ن","ه","و","ي","إ","أ","آ","ة","ى","ل","م","ن","ه","و","ي","إ","أ","آ","ة","ى","ی","ئ","ؤ"],Te=["ﺍ","ﺏ","ﺕ","ﺙ","ﺝ","ﺡ","ﺥ","ﺩ","ﺫ","ﺭ","ﺯ","ﺱ","ﺵ","ﺹ","ﺽ","ﻁ","ﻅ","ﻉ","ﻍ","ﻑ","ﻕ","ﻙ","ﻝ","ﻡ","ﻥ","ﻩ","ﻭ","ﻱ","ﺇ","ﺃ","ﺁ","ﺓ","ﻯ","ﯼ","ﺉ","ﺅ","ﹰ","ﹲ","ﹴ","ﹶ","ﹸ","ﹺ","ﹼ","ﹾ","ﺀ","ﺉ","ﺅ"],de=["ﺎ","ﺐ","ﺖ","ﺚ","ﺞ","ﺢ","ﺦ","ﺪ","ﺬ","ﺮ","ﺰ","ﺲ","ﺶ","ﺺ","ﺾ","ﻂ","ﻆ","ﻊ","ﻎ","ﻒ","ﻖ","ﻚ","ﻞ","ﻢ","ﻦ","ﻪ","ﻮ","ﻲ","ﺈ","ﺄ","ﺂ","ﺔ","ﻰ","ﯽ","ﺊ","ﺆ","ﹰ","ﹲ","ﹴ","ﹶ","ﹸ","ﹺ","ﹼ","ﹾ","ﺀ","ﺊ","ﺆ"],ge=["ﺎ","ﺒ","ﺘ","ﺜ","ﺠ","ﺤ","ﺨ","ﺪ","ﺬ","ﺮ","ﺰ","ﺴ","ﺸ","ﺼ","ﻀ","ﻄ","ﻈ","ﻌ","ﻐ","ﻔ","ﻘ","ﻜ","ﻠ","ﻤ","ﻨ","ﻬ","ﻮ","ﻴ","ﺈ","ﺄ","ﺂ","ﺔ","ﻰ","ﯿ","ﺌ","ﺆ","ﹱ","ﹲ","ﹴ","ﹷ","ﹹ","ﹻ","ﹽ","ﹿ","ﺀ","ﺌ","ﺆ"],Ae=["ﺍ","ﺑ","ﺗ","ﺛ","ﺟ","ﺣ","ﺧ","ﺩ","ﺫ","ﺭ","ﺯ","ﺳ","ﺷ","ﺻ","ﺿ","ﻃ","ﻇ","ﻋ","ﻏ","ﻓ","ﻗ","ﻛ","ﻟ","ﻣ","ﻧ","ﻫ","ﻭ","ﻳ","ﺇ","ﺃ","ﺁ","ﺓ","ﻯ","ﯾ","ﺋ","ﺅ","ﹰ","ﹲ","ﹴ","ﹶ","ﹸ","ﹺ","ﹼ","ﹾ","ﺀ","ﺋ","ﺅ"],Yt=["ء","آ","أ","ؤ","إ","ا","ة","د","ذ","ر","ز","و","ى"],Le=["ً","ً","ٌ","؟","ٍ","؟","َ","َ","ُ","ُ","ِ","ِ","ّ","ّ","ْ","ْ","ء","آ","آ","أ","أ","ؤ","ؤ","إ","إ","ئ","ئ","ئ","ئ","ا","ا","ب","ب","ب","ب","ة","ة","ت","ت","ت","ت","ث","ث","ث","ث","ج","ج","ج","ج","ح","ح","ح","ح","خ","خ","خ","خ","د","د","ذ","ذ","ر","ر","ز","ز","س","س","س","س","ش","ش","ش","ش","ص","ص","ص","ص","ض","ض","ض","ض","ط","ط","ط","ط","ظ","ظ","ظ","ظ","ع","ع","ع","ع","غ","غ","غ","غ","ف","ف","ف","ف","ق","ق","ق","ق","ك","ك","ك","ك","ل","ل","ل","ل","م","م","م","م","ن","ن","ن","ن","ه","ه","ه","ه","و","و","ى","ى","ي","ي","ي","ي","ﻵ","ﻶ","ﻷ","ﻸ","ﻹ","ﻺ","ﻻ","ﻼ","؟","؟","؟"],Zt=["ء","ف"],me=["غ","ي"],we=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],ve=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],r=0,l=1,_=2,b=3,t=4,tt=5,$t=6,e=7,O=8,j=9,Z=10,d=11,n=12,Re=13,Ue=14,be=15,Be=16,pe=17,f=18,Ne=["UBAT_L","UBAT_R","UBAT_EN","UBAT_AN","UBAT_ON","UBAT_B","UBAT_S","UBAT_AL","UBAT_WS","UBAT_CS","UBAT_ES","UBAT_ET","UBAT_NSM","UBAT_LRE","UBAT_RLE","UBAT_PDF","UBAT_LRO","UBAT_RLO","UBAT_BN"],K=100,Fe=[K+0,r,r,r,r,K+1,K+2,K+3,l,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,K+4,t,t,t,r,t,r,t,r,t,t,t,r,r,t,t,r,r,r,r,r,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,r,r,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,r,r,r,r,r,r,r,r,r,r,r,r,r,r,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,r,r,t,t,r,r,t,t,r,r,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,r,r,r,K+5,e,e,K+6,K+7],Ve=[[f,f,f,f,f,f,f,f,f,$t,tt,$t,O,tt,f,f,f,f,f,f,f,f,f,f,f,f,f,f,tt,tt,tt,$t,O,t,t,d,d,d,t,t,t,t,t,Z,j,Z,j,j,_,_,_,_,_,_,_,_,_,_,j,t,t,t,t,t,t,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,t,t,t,t,t,t,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,t,t,t,t,f,f,f,f,f,f,tt,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,j,t,d,d,d,d,t,t,t,t,r,t,t,f,t,t,d,d,_,_,t,r,t,t,t,_,r,t,t,t,t,t,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,t,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,t,r,r,r,r,r,r,r,r],[r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,t,t,t,t,t,t,t,t,t,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,t,t,r,r,r,r,r,r,r,t,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,t,r,t,t,t,t,t,t,t,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,l,n,l,n,n,l,n,n,l,n,t,t,t,t,t,t,t,t,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,t,t,t,t,t,l,l,l,l,l,t,t,t,t,t,t,t,t,t,t,t],[b,b,b,b,t,t,t,t,e,d,d,e,j,e,t,t,n,n,n,n,n,n,n,n,n,n,n,e,t,t,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,b,b,b,b,b,b,b,b,b,b,d,b,b,e,e,e,n,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,n,n,n,n,n,n,n,b,t,n,n,n,n,n,n,e,e,n,n,t,n,n,n,n,e,e,_,_,_,_,_,_,_,_,_,_,e,e,e,e,e,e],[e,e,e,e,e,e,e,e,e,e,e,e,e,e,t,e,e,n,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,t,t,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,n,n,n,n,n,n,n,n,n,n,n,e,t,t,t,t,t,t,t,t,t,t,t,t,t,t,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,n,n,n,n,n,n,n,n,n,l,l,t,t,t,t,l,t,t,t,t,t],[O,O,O,O,O,O,O,O,O,O,O,f,f,f,r,l,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,O,tt,Re,Ue,be,Be,pe,j,d,d,d,d,d,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,j,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,O,f,f,f,f,f,t,t,t,t,t,f,f,f,f,f,f,_,r,t,t,_,_,_,_,_,_,Z,Z,t,t,t,r,_,_,_,_,_,_,_,_,_,_,Z,Z,t,t,t,t,r,r,r,r,r,r,r,r,r,r,r,r,r,t,t,t,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t],[r,r,r,r,r,r,r,t,t,t,t,t,t,t,t,t,t,t,t,r,r,r,r,r,t,t,t,t,t,l,n,l,l,l,l,l,l,l,l,l,l,Z,l,l,l,l,l,l,l,l,l,l,l,l,l,t,l,l,l,l,l,t,l,t,l,l,t,l,l,t,l,l,l,l,l,l,l,l,l,l,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e],[n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,n,n,n,n,n,n,n,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,j,t,j,t,t,j,t,t,t,t,t,t,t,t,t,d,t,t,Z,Z,t,t,t,t,t,d,d,t,t,t,t,t,e,e,e,e,e,t,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,t,t,f],[t,t,t,d,d,d,t,t,t,t,t,Z,j,Z,j,j,_,_,_,_,_,_,_,_,_,_,j,t,t,t,t,t,t,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,t,t,t,t,t,t,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,t,t,t,t,t,t,t,t,t,t,t,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,t,t,t,r,r,r,r,r,r,t,t,r,r,r,r,r,r,t,t,r,r,r,r,r,r,t,t,r,r,r,t,t,t,d,d,t,t,t,d,d,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]];class sr{constructor(){this.inputFormat="ILYNN",this.outputFormat="VLNNN",this.sourceToTarget=[],this.targetToSource=[],this.levels=[]}bidiTransform(i,o,a){if(this.sourceToTarget=[],this.targetToSource=[],!i)return"";if(Ye(this.sourceToTarget,this.targetToSource,i.length),!this.checkParameters(o,a))return i;o=this.inputFormat,a=this.outputFormat;let u=i;const x=Ge,T=Jt(o.charAt(1)),y=Jt(a.charAt(1)),g=(o.charAt(0)==="I"?"L":o.charAt(0))+T,A=(a.charAt(0)==="I"?"L":a.charAt(0))+y,m=o.charAt(2)+a.charAt(2);x.defInFormat=g,x.defOutFormat=A,x.defSwap=m;const D=wt(i,g,A,m,x);let B=!1;return a.charAt(1)==="R"?B=!0:a.charAt(1)!=="C"&&a.charAt(1)!=="D"||(B=this.checkContextual(D)==="rtl"),this.sourceToTarget=X,this.targetToSource=Ze(this.sourceToTarget),Mt=this.targetToSource,u=o.charAt(3)===a.charAt(3)?D:a.charAt(3)==="S"?Se(B,D,!0):Ce(D,B,!0),this.sourceToTarget=X,this.targetToSource=Mt,this.levels=Dt,u}_inputFormatSetter(i){if(!Kt.test(i))throw new Error("dojox/string/BidiEngine: the bidi layout string is wrong!");this.inputFormat=i}_outputFormatSetter(i){if(!Kt.test(i))throw new Error("dojox/string/BidiEngine: the bidi layout string is wrong!");this.outputFormat=i}checkParameters(i,o){return i?this._inputFormatSetter(i):i=this.inputFormat,o?this._outputFormatSetter(o):o=this.outputFormat,i!==o}checkContextual(i){let o=Ct(i);if(o!=="ltr"&&o!=="rtl"){try{o=document.dir.toLowerCase()}catch{}o!=="ltr"&&o!=="rtl"&&(o="ltr")}return o}hasBidiChar(i){return Ke.test(i)}}function wt(s,i,o,a,u){const x=Ee(s,{inFormat:i,outFormat:o,swap:a},u);if(x.inFormat===x.outFormat)return s;i=x.inFormat,o=x.outFormat,a=x.swap;const T=i.substring(0,1),y=i.substring(1,4),g=o.substring(0,1),A=o.substring(1,4);if(u.inFormat=i,u.outFormat=o,u.swap=a,T==="L"&&o==="VLTR"){if(y==="LTR")return u.dir=dt,ut(s,u);if(y==="RTL")return u.dir=vt,ut(s,u)}if(T==="V"&&g==="V")return u.dir=y==="RTL"?vt:dt,Wt(s,u);if(T==="L"&&o==="VRTL")return y==="LTR"?(u.dir=dt,s=ut(s,u)):(u.dir=vt,s=ut(s,u)),Wt(s);if(i==="VLTR"&&o==="LLTR")return u.dir=dt,ut(s,u);if(T==="V"&&g==="L"&&y!==A)return s=Wt(s),y==="RTL"?wt(s,"LLTR","VLTR",a,u):wt(s,"LRTL","VRTL",a,u);if(i==="VRTL"&&o==="LRTL")return wt(s,"LRTL","VRTL",a,u);if(T==="L"&&g==="L"){const m=u.swap;return u.swap=m.substr(0,1)+"N",y==="RTL"?(u.dir=vt,s=ut(s,u),u.swap="N"+m.substr(1,2),u.dir=dt,s=ut(s,u)):(u.dir=dt,s=ut(s,u),u.swap="N"+m.substr(1,2),s=wt(s,"VLTR","LRTL",u.swap,u)),s}return s}function Ee(s,i,o){if(i.inFormat===void 0&&(i.inFormat=o.defInFormat),i.outFormat===void 0&&(i.outFormat=o.defOutFormat),i.swap===void 0&&(i.swap=o.defSwap),i.inFormat===i.outFormat)return i;const a=i.inFormat.substring(0,1),u=i.outFormat.substring(0,1);let x,T=i.inFormat.substring(1,4),y=i.outFormat.substring(1,4);return T.charAt(0)==="C"&&(x=Ct(s),T=x==="ltr"||x==="rtl"?x.toUpperCase():i.inFormat.charAt(2)==="L"?"LTR":"RTL",i.inFormat=a+T),y.charAt(0)==="C"&&(x=Ct(s),x==="rtl"?y="RTL":x==="ltr"?(x=ke(s),y=x.toUpperCase()):y=i.outFormat.charAt(2)==="L"?"LTR":"RTL",i.outFormat=u+y),i}function Se(s,i,o){if(i.length===0)return"";s===void 0&&(s=!0),o===void 0&&(o=!0);const a=(i=String(i)).split("");let u=0,x=1,T=a.length;s||(u=a.length-1,x=-1,T=1);const y=$e(a,u,x,T,o);let g="";for(let A=0;A-1?(se(Mt,A,!s,-1),X.splice(A,1)):g+=a[A];return g}function $e(s,i,o,a,u){let x=0;const T=[];let y=0;for(let g=i;g*o="ﹰ"&&u[x]<"\uFEFF"){const y=s.charCodeAt(x);u[x]>="ﻵ"&&u[x]<="ﻼ"?(i?(x>0&&o&&u[x-1]===" "?a=a.substring(0,a.length-1)+"ل":(a+="ل",T=!0),a+=At[(y-65269)/2]):(a+=At[(y-65269)/2],a+="ل",x+10)if(B===16){for(let v=T;v-1){for(let v=T;v=0&&s[x]===O;x--)i[x]=a.dir}}function De(s,i,o){if(o.hiLevel!==0&&o.swap.substr(0,1)!==o.swap.substr(1,2))for(let a=0;a>8];return o=Zt[i]&&s<=me[i])return!0;return!1}function Gt(s,i,o,a){for(;i*o=s){for(x=m+1;x=s;)x++;for(T=m,y=x-1;T(u.lastArabic=!1,r),UBAT_R:()=>(u.lastArabic=!1,l),UBAT_ON:()=>t,UBAT_AN:()=>b,UBAT_EN:()=>u.lastArabic?b:_,UBAT_AL:()=>(u.lastArabic=!0,u.hasUbatAl=!0,l),UBAT_WS:()=>t,UBAT_CS:()=>{let T,y;return a<1||a+1>=i.length||(T=o[a-1])!==_&&T!==b||(y=i[a+1])!==_&&y!==b?t:(u.lastArabic&&(y=b),y===T?y:t)},UBAT_ES:()=>(a>0?o[a-1]:tt)===_&&a+1{if(a>0&&o[a-1]===_)return _;if(u.lastArabic)return t;let T=a+1;const y=i.length;for(;T{if(u.inFormat==="VLTR"){const T=i.length;let y=a+1;for(;y=1425&&g<=2303||g===64286,m=i[y];if(A&&(m===l||m===e))return l}}return a<1||i[a-1]===tt?t:o[a-1]},UBAT_B:()=>(u.lastArabic=!0,u.hasUbatB=!0,u.dir),UBAT_S:()=>(u.hasUbatS=!0,t),UBAT_LRE:()=>(u.lastArabic=!1,t),UBAT_RLE:()=>(u.lastArabic=!1,t),UBAT_LRO:()=>(u.lastArabic=!1,t),UBAT_RLO:()=>(u.lastArabic=!1,t),UBAT_PDF:()=>(u.lastArabic=!1,t),UBAT_BN:()=>t}[Ne[x]]()}function We(s){let i,o=0,a=St.length-1;for(;o<=a;)if(i=Math.floor((o+a)/2),sSt[i][0]))return St[i][1];o=i+1}return s}function Xe(s){for(let i=0;i="ً"&&s<="ٕ"}function Jt(s){return s==="L"?"LTR":s==="R"?"RTL":s==="C"?"CLR":s==="D"?"CRL":""}function ze(s,i,o,a){for(;i*oi||!o&&s[u]===i)&&(s[u]+=a)}let X=[],Mt=[],Dt=[];const Ge={dir:0,defInFormat:"LLTR",defoutFormat:"VLTR",defSwap:"YN",inFormat:"LLTR",outFormat:"VLTR",swap:"YN",hiLevel:0,lastArabic:!1,hasUbatAl:!1,hasBlockSep:!1,hasSegSep:!1,defOutFormat:""},He=5,Je=6,dt=0,vt=1,Kt=/^[(I|V)][(L|R|C|D)][(Y|N)][(S|N)][N]$/,Ke=/[\u0591-\u06ff\ufb1d-\ufefc]/;function oe(s,i){return s.x===i.x&&s.y===i.y}function tr(s){if(!s)return;const i=s.length;if(i<=1)return;let o=0;for(let a=1;aa){x=!0;const h=(a-u)/v;v=a-u,m=(1-h)*T+h*m,D=(1-h)*y+h*D,--A}const p=this._writeVertex(T,y,0,0,B,R,R,-B,0,-1,u),U=this._writeVertex(T,y,0,0,B,R,-R,B,0,1,u);u+=v;const ht=this._writeVertex(m,D,0,0,B,R,R,-B,0,-1,u),c=this._writeVertex(m,D,0,0,B,R,-R,B,0,1,u);this._writeTriangle(p,U,ht),this._writeTriangle(U,ht,c),T=m,y=D}}_tessellate(i,o){const a=i[0],u=i[i.length-1],x=oe(a,u),T=x?3:2;if(i.length{const rt=ae(p,U,E,S,ct,I,z,Bt,H,et,F);return $>=0&&N>=0&&rt>=0&&le($,N,rt),$=N,N=rt,rt};x&&(v=i[i.length-2],h.x=u.x-v.x,h.y=u.y-v.y,ot=zt(h),h.x/=ot,h.y/=ot);let yt=!1;for(let z=0;zOt&&(yt=!0)),yt){const L=(Ot-F)/ft;ft=Ot-F,v={x:(1-L)*v.x+L*i[z].x,y:(1-L)*v.y+L*i[z].y},--z}else v=i[z];p=v.x,U=v.y;const Bt=z<=0&&!yt,ct=z===i.length-1;if(Bt||(F+=ft),ht=ct?x?i[1]:null:i[z+1],ht?(h.x=ht.x-p,h.y=ht.y-U,ot=zt(h),h.x/=ot,h.y/=ot):(h.x=void 0,h.y=void 0),!x){if(Bt){q(w,h),E=w.x,S=w.y,g===st.SQUARE&&(k(-h.y-h.x,h.x-h.y,h.x,h.y,0,-1),k(h.y-h.x,-h.x-h.y,h.x,h.y,0,1)),g===st.ROUND&&(k(-h.y-h.x,h.x-h.y,h.x,h.y,-1,-1),k(h.y-h.x,-h.x-h.y,h.x,h.y,-1,1)),g!==st.ROUND&&g!==st.BUTT||(k(-h.y,h.x,h.x,h.y,0,-1),k(h.y,-h.x,h.x,h.y,0,1));continue}if(ct){G(w,c),E=w.x,S=w.y,g!==st.ROUND&&g!==st.BUTT||(k(c.y,-c.x,-c.x,-c.y,0,-1),k(-c.y,c.x,-c.x,-c.y,0,1)),g===st.SQUARE&&(k(c.y-c.x,-c.x-c.y,-c.x,-c.y,0,-1),k(-c.y-c.x,c.x-c.y,-c.x,-c.y,0,1)),g===st.ROUND&&(k(c.y-c.x,-c.x-c.y,-c.x,-c.y,1,-1),k(-c.y-c.x,c.x-c.y,-c.x,-c.y,1,1));continue}}let I,H,et=-er(c,h);if(Math.abs(et)<.01)ee(c,h)>0?(w.x=c.x,w.y=c.y,et=1,I=Number.MAX_VALUE,H=!0):(q(w,h),et=1,I=1,H=!1);else{w.x=(c.x+h.x)/et,w.y=(c.y+h.y)/et,I=zt(w);const L=(I-1)*B*y;H=I>4||L>ft&&L>ot}E=w.x,S=w.y;let rt=A;switch(A){case J.BEVEL:I<1.05&&(rt=J.MITER);break;case J.ROUND:Im&&(rt=J.BEVEL)}switch(rt){case J.MITER:if(k(w.x,w.y,-c.x,-c.y,0,-1),k(-w.x,-w.y,-c.x,-c.y,0,1),ct)break;if(R){const L=yt?0:F;$=this._writeVertex(p,U,E,S,h.x,h.y,w.x,w.y,0,-1,L),N=this._writeVertex(p,U,E,S,h.x,h.y,-w.x,-w.y,0,1,L)}break;case J.BEVEL:{const L=et<0;let M,P,at,Q;if(L){const V=$;$=N,N=V,M=Ut,P=bt}else M=bt,P=Ut;if(H)at=L?q(this._innerPrev,c):G(this._innerPrev,c),Q=L?G(this._innerNext,h):q(this._innerNext,h);else{const V=L?qt(this._inner,w):te(this._inner,w);at=V,Q=V}const Y=L?G(this._bevelStart,c):q(this._bevelStart,c);k(at.x,at.y,-c.x,-c.y,M.x,M.y);const pt=k(Y.x,Y.y,-c.x,-c.y,P.x,P.y);if(ct)break;const it=L?q(this._bevelEnd,h):G(this._bevelEnd,h);if(H){const V=this._writeVertex(p,U,E,S,-c.x,-c.y,0,0,0,0,F);$=this._writeVertex(p,U,E,S,h.x,h.y,Q.x,Q.y,M.x,M.y,F),N=this._writeVertex(p,U,E,S,h.x,h.y,it.x,it.y,P.x,P.y,F),this._writeTriangle(pt,V,N)}else{if(R){const V=this._bevelMiddle;V.x=(Y.x+it.x)/2,V.y=(Y.y+it.y)/2,gt(C,V,-c.x,-c.y),k(V.x,V.y,-c.x,-c.y,C.x,C.y),gt(C,V,h.x,h.y),$=this._writeVertex(p,U,E,S,h.x,h.y,V.x,V.y,C.x,C.y,F),N=this._writeVertex(p,U,E,S,h.x,h.y,Q.x,Q.y,M.x,M.y,F)}else{const V=$;$=N,N=V}k(it.x,it.y,h.x,h.y,P.x,P.y)}if(L){const V=$;$=N,N=V}break}case J.ROUND:{const L=et<0;let M,P;if(L){const W=$;$=N,N=W,M=Ut,P=bt}else M=bt,P=Ut;const at=L?qt(this._inner,w):te(this._inner,w);let Q,Y;H?(Q=L?q(this._innerPrev,c):G(this._innerPrev,c),Y=L?G(this._innerNext,h):q(this._innerNext,h)):(Q=at,Y=at);const pt=L?G(this._roundStart,c):q(this._roundStart,c),it=L?q(this._roundEnd,h):G(this._roundEnd,h),V=k(Q.x,Q.y,-c.x,-c.y,M.x,M.y),Nt=k(pt.x,pt.y,-c.x,-c.y,P.x,P.y);if(ct)break;const lt=this._writeVertex(p,U,E,S,-c.x,-c.y,0,0,0,0,F);H||this._writeTriangle($,N,lt);const nt=qt(this._outer,at),xt=this._writeVertex(p,U,E,S,h.x,h.y,it.x,it.y,P.x,P.y,F);let _t,Tt;const Ft=I>2;if(Ft){let W;I!==Number.MAX_VALUE?(nt.x/=I,nt.y/=I,W=ee(c,nt),W=(I*(W*W-1)+1)/W):W=-1,_t=L?G(this._startBreak,c):q(this._startBreak,c),_t.x+=c.x*W,_t.y+=c.y*W,Tt=L?q(this._endBreak,h):G(this._endBreak,h),Tt.x+=h.x*W,Tt.y+=h.y*W}gt(C,nt,-c.x,-c.y);const Vt=this._writeVertex(p,U,E,S,-c.x,-c.y,nt.x,nt.y,C.x,C.y,F);gt(C,nt,h.x,h.y);const It=R?this._writeVertex(p,U,E,S,h.x,h.y,nt.x,nt.y,C.x,C.y,F):Vt,Pt=lt,Et=R?this._writeVertex(p,U,E,S,h.x,h.y,0,0,0,0,F):lt;let Lt=-1,mt=-1;if(Ft&&(gt(C,_t,-c.x,-c.y),Lt=this._writeVertex(p,U,E,S,-c.x,-c.y,_t.x,_t.y,C.x,C.y,F),gt(C,Tt,h.x,h.y),mt=this._writeVertex(p,U,E,S,h.x,h.y,Tt.x,Tt.y,C.x,C.y,F)),R?Ft?(this._writeTriangle(Pt,Nt,Lt),this._writeTriangle(Pt,Lt,Vt),this._writeTriangle(Et,It,mt),this._writeTriangle(Et,mt,xt)):(this._writeTriangle(Pt,Nt,Vt),this._writeTriangle(Et,It,xt)):Ft?(this._writeTriangle(lt,Nt,Lt),this._writeTriangle(lt,Lt,mt),this._writeTriangle(lt,mt,xt)):(this._writeTriangle(lt,Nt,Vt),this._writeTriangle(lt,It,xt)),H?($=this._writeVertex(p,U,E,S,h.x,h.y,Y.x,Y.y,M.x,M.y,F),N=xt):($=R?this._writeVertex(p,U,E,S,h.x,h.y,Y.x,Y.y,M.x,M.y,F):V,this._writeTriangle($,Et,xt),N=xt),L){const W=$;$=N,N=W}break}}}}}export{sr as C,nr as a,or as c,ir as i}; +import{E as ue,_ as Qt,gZ as he,hg as ce,hh as st,hi as J}from"./index-BjUNJPVf.js";const xe=128e3;let jt=null,re=null;async function ir(){return jt||(jt=fe()),jt}async function fe(){re=await(ue("esri-csp-restrictions")?await Qt(()=>import("./libtess-asm-rVi5NxzN.js"),__vite__mapDeps([0,1,2])).then(i=>i.l):await Qt(()=>import("./libtess-B_UHPwdK.js"),__vite__mapDeps([3,1,2])).then(i=>i.l)).default({locateFile:i=>he(`esri/core/libs/libtess/${i}`)})}function nr(s,i){const o=Math.max(s.length,xe);return re.triangulate(s,i,o)}const St=[["(",")"],[")","("],["<",">"],[">","<"],["[","]"],["]","["],["{","}"],["}","{"],["«","»"],["»","«"],["‹","›"],["›","‹"],["⁽","⁾"],["⁾","⁽"],["₍","₎"],["₎","₍"],["≤","≥"],["≥","≤"],["〈","〉"],["〉","〈"],["﹙","﹚"],["﹚","﹙"],["﹛","﹜"],["﹜","﹛"],["﹝","﹞"],["﹞","﹝"],["﹤","﹥"],["﹥","﹤"]],At=["آ","أ","إ","ا"],ye=["ﻵ","ﻷ","ﻹ","ﻻ"],_e=["ﻶ","ﻸ","ﻺ","ﻼ"],kt=["ا","ب","ت","ث","ج","ح","خ","د","ذ","ر","ز","س","ش","ص","ض","ط","ظ","ع","غ","ف","ق","ك","ل","م","ن","ه","و","ي","إ","أ","آ","ة","ى","ل","م","ن","ه","و","ي","إ","أ","آ","ة","ى","ی","ئ","ؤ"],Te=["ﺍ","ﺏ","ﺕ","ﺙ","ﺝ","ﺡ","ﺥ","ﺩ","ﺫ","ﺭ","ﺯ","ﺱ","ﺵ","ﺹ","ﺽ","ﻁ","ﻅ","ﻉ","ﻍ","ﻑ","ﻕ","ﻙ","ﻝ","ﻡ","ﻥ","ﻩ","ﻭ","ﻱ","ﺇ","ﺃ","ﺁ","ﺓ","ﻯ","ﯼ","ﺉ","ﺅ","ﹰ","ﹲ","ﹴ","ﹶ","ﹸ","ﹺ","ﹼ","ﹾ","ﺀ","ﺉ","ﺅ"],de=["ﺎ","ﺐ","ﺖ","ﺚ","ﺞ","ﺢ","ﺦ","ﺪ","ﺬ","ﺮ","ﺰ","ﺲ","ﺶ","ﺺ","ﺾ","ﻂ","ﻆ","ﻊ","ﻎ","ﻒ","ﻖ","ﻚ","ﻞ","ﻢ","ﻦ","ﻪ","ﻮ","ﻲ","ﺈ","ﺄ","ﺂ","ﺔ","ﻰ","ﯽ","ﺊ","ﺆ","ﹰ","ﹲ","ﹴ","ﹶ","ﹸ","ﹺ","ﹼ","ﹾ","ﺀ","ﺊ","ﺆ"],ge=["ﺎ","ﺒ","ﺘ","ﺜ","ﺠ","ﺤ","ﺨ","ﺪ","ﺬ","ﺮ","ﺰ","ﺴ","ﺸ","ﺼ","ﻀ","ﻄ","ﻈ","ﻌ","ﻐ","ﻔ","ﻘ","ﻜ","ﻠ","ﻤ","ﻨ","ﻬ","ﻮ","ﻴ","ﺈ","ﺄ","ﺂ","ﺔ","ﻰ","ﯿ","ﺌ","ﺆ","ﹱ","ﹲ","ﹴ","ﹷ","ﹹ","ﹻ","ﹽ","ﹿ","ﺀ","ﺌ","ﺆ"],Ae=["ﺍ","ﺑ","ﺗ","ﺛ","ﺟ","ﺣ","ﺧ","ﺩ","ﺫ","ﺭ","ﺯ","ﺳ","ﺷ","ﺻ","ﺿ","ﻃ","ﻇ","ﻋ","ﻏ","ﻓ","ﻗ","ﻛ","ﻟ","ﻣ","ﻧ","ﻫ","ﻭ","ﻳ","ﺇ","ﺃ","ﺁ","ﺓ","ﻯ","ﯾ","ﺋ","ﺅ","ﹰ","ﹲ","ﹴ","ﹶ","ﹸ","ﹺ","ﹼ","ﹾ","ﺀ","ﺋ","ﺅ"],Yt=["ء","آ","أ","ؤ","إ","ا","ة","د","ذ","ر","ز","و","ى"],Le=["ً","ً","ٌ","؟","ٍ","؟","َ","َ","ُ","ُ","ِ","ِ","ّ","ّ","ْ","ْ","ء","آ","آ","أ","أ","ؤ","ؤ","إ","إ","ئ","ئ","ئ","ئ","ا","ا","ب","ب","ب","ب","ة","ة","ت","ت","ت","ت","ث","ث","ث","ث","ج","ج","ج","ج","ح","ح","ح","ح","خ","خ","خ","خ","د","د","ذ","ذ","ر","ر","ز","ز","س","س","س","س","ش","ش","ش","ش","ص","ص","ص","ص","ض","ض","ض","ض","ط","ط","ط","ط","ظ","ظ","ظ","ظ","ع","ع","ع","ع","غ","غ","غ","غ","ف","ف","ف","ف","ق","ق","ق","ق","ك","ك","ك","ك","ل","ل","ل","ل","م","م","م","م","ن","ن","ن","ن","ه","ه","ه","ه","و","و","ى","ى","ي","ي","ي","ي","ﻵ","ﻶ","ﻷ","ﻸ","ﻹ","ﻺ","ﻻ","ﻼ","؟","؟","؟"],Zt=["ء","ف"],me=["غ","ي"],we=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],ve=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],r=0,l=1,_=2,b=3,t=4,tt=5,$t=6,e=7,O=8,j=9,Z=10,d=11,n=12,Re=13,Ue=14,be=15,Be=16,pe=17,f=18,Ne=["UBAT_L","UBAT_R","UBAT_EN","UBAT_AN","UBAT_ON","UBAT_B","UBAT_S","UBAT_AL","UBAT_WS","UBAT_CS","UBAT_ES","UBAT_ET","UBAT_NSM","UBAT_LRE","UBAT_RLE","UBAT_PDF","UBAT_LRO","UBAT_RLO","UBAT_BN"],K=100,Fe=[K+0,r,r,r,r,K+1,K+2,K+3,l,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,K+4,t,t,t,r,t,r,t,r,t,t,t,r,r,t,t,r,r,r,r,r,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,r,r,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,r,r,r,r,r,r,r,r,r,r,r,r,r,r,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,r,r,t,t,r,r,t,t,r,r,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,r,r,r,K+5,e,e,K+6,K+7],Ve=[[f,f,f,f,f,f,f,f,f,$t,tt,$t,O,tt,f,f,f,f,f,f,f,f,f,f,f,f,f,f,tt,tt,tt,$t,O,t,t,d,d,d,t,t,t,t,t,Z,j,Z,j,j,_,_,_,_,_,_,_,_,_,_,j,t,t,t,t,t,t,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,t,t,t,t,t,t,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,t,t,t,t,f,f,f,f,f,f,tt,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,j,t,d,d,d,d,t,t,t,t,r,t,t,f,t,t,d,d,_,_,t,r,t,t,t,_,r,t,t,t,t,t,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,t,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,t,r,r,r,r,r,r,r,r],[r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,t,t,t,t,t,t,t,t,t,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,t,t,r,r,r,r,r,r,r,t,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,t,r,t,t,t,t,t,t,t,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,l,n,l,n,n,l,n,n,l,n,t,t,t,t,t,t,t,t,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,t,t,t,t,t,l,l,l,l,l,t,t,t,t,t,t,t,t,t,t,t],[b,b,b,b,t,t,t,t,e,d,d,e,j,e,t,t,n,n,n,n,n,n,n,n,n,n,n,e,t,t,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,b,b,b,b,b,b,b,b,b,b,d,b,b,e,e,e,n,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,n,n,n,n,n,n,n,b,t,n,n,n,n,n,n,e,e,n,n,t,n,n,n,n,e,e,_,_,_,_,_,_,_,_,_,_,e,e,e,e,e,e],[e,e,e,e,e,e,e,e,e,e,e,e,e,e,t,e,e,n,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,t,t,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,n,n,n,n,n,n,n,n,n,n,n,e,t,t,t,t,t,t,t,t,t,t,t,t,t,t,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,n,n,n,n,n,n,n,n,n,l,l,t,t,t,t,l,t,t,t,t,t],[O,O,O,O,O,O,O,O,O,O,O,f,f,f,r,l,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,O,tt,Re,Ue,be,Be,pe,j,d,d,d,d,d,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,j,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,O,f,f,f,f,f,t,t,t,t,t,f,f,f,f,f,f,_,r,t,t,_,_,_,_,_,_,Z,Z,t,t,t,r,_,_,_,_,_,_,_,_,_,_,Z,Z,t,t,t,t,r,r,r,r,r,r,r,r,r,r,r,r,r,t,t,t,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t],[r,r,r,r,r,r,r,t,t,t,t,t,t,t,t,t,t,t,t,r,r,r,r,r,t,t,t,t,t,l,n,l,l,l,l,l,l,l,l,l,l,Z,l,l,l,l,l,l,l,l,l,l,l,l,l,t,l,l,l,l,l,t,l,t,l,l,t,l,l,t,l,l,l,l,l,l,l,l,l,l,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e],[n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,n,n,n,n,n,n,n,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,j,t,j,t,t,j,t,t,t,t,t,t,t,t,t,d,t,t,Z,Z,t,t,t,t,t,d,d,t,t,t,t,t,e,e,e,e,e,t,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,t,t,f],[t,t,t,d,d,d,t,t,t,t,t,Z,j,Z,j,j,_,_,_,_,_,_,_,_,_,_,j,t,t,t,t,t,t,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,t,t,t,t,t,t,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,t,t,t,t,t,t,t,t,t,t,t,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,t,t,t,r,r,r,r,r,r,t,t,r,r,r,r,r,r,t,t,r,r,r,r,r,r,t,t,r,r,r,t,t,t,d,d,t,t,t,d,d,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t]];class sr{constructor(){this.inputFormat="ILYNN",this.outputFormat="VLNNN",this.sourceToTarget=[],this.targetToSource=[],this.levels=[]}bidiTransform(i,o,a){if(this.sourceToTarget=[],this.targetToSource=[],!i)return"";if(Ye(this.sourceToTarget,this.targetToSource,i.length),!this.checkParameters(o,a))return i;o=this.inputFormat,a=this.outputFormat;let u=i;const x=Ge,T=Jt(o.charAt(1)),y=Jt(a.charAt(1)),g=(o.charAt(0)==="I"?"L":o.charAt(0))+T,A=(a.charAt(0)==="I"?"L":a.charAt(0))+y,m=o.charAt(2)+a.charAt(2);x.defInFormat=g,x.defOutFormat=A,x.defSwap=m;const D=wt(i,g,A,m,x);let B=!1;return a.charAt(1)==="R"?B=!0:a.charAt(1)!=="C"&&a.charAt(1)!=="D"||(B=this.checkContextual(D)==="rtl"),this.sourceToTarget=X,this.targetToSource=Ze(this.sourceToTarget),Mt=this.targetToSource,u=o.charAt(3)===a.charAt(3)?D:a.charAt(3)==="S"?Se(B,D,!0):Ce(D,B,!0),this.sourceToTarget=X,this.targetToSource=Mt,this.levels=Dt,u}_inputFormatSetter(i){if(!Kt.test(i))throw new Error("dojox/string/BidiEngine: the bidi layout string is wrong!");this.inputFormat=i}_outputFormatSetter(i){if(!Kt.test(i))throw new Error("dojox/string/BidiEngine: the bidi layout string is wrong!");this.outputFormat=i}checkParameters(i,o){return i?this._inputFormatSetter(i):i=this.inputFormat,o?this._outputFormatSetter(o):o=this.outputFormat,i!==o}checkContextual(i){let o=Ct(i);if(o!=="ltr"&&o!=="rtl"){try{o=document.dir.toLowerCase()}catch{}o!=="ltr"&&o!=="rtl"&&(o="ltr")}return o}hasBidiChar(i){return Ke.test(i)}}function wt(s,i,o,a,u){const x=Ee(s,{inFormat:i,outFormat:o,swap:a},u);if(x.inFormat===x.outFormat)return s;i=x.inFormat,o=x.outFormat,a=x.swap;const T=i.substring(0,1),y=i.substring(1,4),g=o.substring(0,1),A=o.substring(1,4);if(u.inFormat=i,u.outFormat=o,u.swap=a,T==="L"&&o==="VLTR"){if(y==="LTR")return u.dir=dt,ut(s,u);if(y==="RTL")return u.dir=vt,ut(s,u)}if(T==="V"&&g==="V")return u.dir=y==="RTL"?vt:dt,Wt(s,u);if(T==="L"&&o==="VRTL")return y==="LTR"?(u.dir=dt,s=ut(s,u)):(u.dir=vt,s=ut(s,u)),Wt(s);if(i==="VLTR"&&o==="LLTR")return u.dir=dt,ut(s,u);if(T==="V"&&g==="L"&&y!==A)return s=Wt(s),y==="RTL"?wt(s,"LLTR","VLTR",a,u):wt(s,"LRTL","VRTL",a,u);if(i==="VRTL"&&o==="LRTL")return wt(s,"LRTL","VRTL",a,u);if(T==="L"&&g==="L"){const m=u.swap;return u.swap=m.substr(0,1)+"N",y==="RTL"?(u.dir=vt,s=ut(s,u),u.swap="N"+m.substr(1,2),u.dir=dt,s=ut(s,u)):(u.dir=dt,s=ut(s,u),u.swap="N"+m.substr(1,2),s=wt(s,"VLTR","LRTL",u.swap,u)),s}return s}function Ee(s,i,o){if(i.inFormat===void 0&&(i.inFormat=o.defInFormat),i.outFormat===void 0&&(i.outFormat=o.defOutFormat),i.swap===void 0&&(i.swap=o.defSwap),i.inFormat===i.outFormat)return i;const a=i.inFormat.substring(0,1),u=i.outFormat.substring(0,1);let x,T=i.inFormat.substring(1,4),y=i.outFormat.substring(1,4);return T.charAt(0)==="C"&&(x=Ct(s),T=x==="ltr"||x==="rtl"?x.toUpperCase():i.inFormat.charAt(2)==="L"?"LTR":"RTL",i.inFormat=a+T),y.charAt(0)==="C"&&(x=Ct(s),x==="rtl"?y="RTL":x==="ltr"?(x=ke(s),y=x.toUpperCase()):y=i.outFormat.charAt(2)==="L"?"LTR":"RTL",i.outFormat=u+y),i}function Se(s,i,o){if(i.length===0)return"";s===void 0&&(s=!0),o===void 0&&(o=!0);const a=(i=String(i)).split("");let u=0,x=1,T=a.length;s||(u=a.length-1,x=-1,T=1);const y=$e(a,u,x,T,o);let g="";for(let A=0;A-1?(se(Mt,A,!s,-1),X.splice(A,1)):g+=a[A];return g}function $e(s,i,o,a,u){let x=0;const T=[];let y=0;for(let g=i;g*o="ﹰ"&&u[x]<"\uFEFF"){const y=s.charCodeAt(x);u[x]>="ﻵ"&&u[x]<="ﻼ"?(i?(x>0&&o&&u[x-1]===" "?a=a.substring(0,a.length-1)+"ل":(a+="ل",T=!0),a+=At[(y-65269)/2]):(a+=At[(y-65269)/2],a+="ل",x+10)if(B===16){for(let v=T;v-1){for(let v=T;v=0&&s[x]===O;x--)i[x]=a.dir}}function De(s,i,o){if(o.hiLevel!==0&&o.swap.substr(0,1)!==o.swap.substr(1,2))for(let a=0;a>8];return o=Zt[i]&&s<=me[i])return!0;return!1}function Gt(s,i,o,a){for(;i*o=s){for(x=m+1;x=s;)x++;for(T=m,y=x-1;T(u.lastArabic=!1,r),UBAT_R:()=>(u.lastArabic=!1,l),UBAT_ON:()=>t,UBAT_AN:()=>b,UBAT_EN:()=>u.lastArabic?b:_,UBAT_AL:()=>(u.lastArabic=!0,u.hasUbatAl=!0,l),UBAT_WS:()=>t,UBAT_CS:()=>{let T,y;return a<1||a+1>=i.length||(T=o[a-1])!==_&&T!==b||(y=i[a+1])!==_&&y!==b?t:(u.lastArabic&&(y=b),y===T?y:t)},UBAT_ES:()=>(a>0?o[a-1]:tt)===_&&a+1{if(a>0&&o[a-1]===_)return _;if(u.lastArabic)return t;let T=a+1;const y=i.length;for(;T{if(u.inFormat==="VLTR"){const T=i.length;let y=a+1;for(;y=1425&&g<=2303||g===64286,m=i[y];if(A&&(m===l||m===e))return l}}return a<1||i[a-1]===tt?t:o[a-1]},UBAT_B:()=>(u.lastArabic=!0,u.hasUbatB=!0,u.dir),UBAT_S:()=>(u.hasUbatS=!0,t),UBAT_LRE:()=>(u.lastArabic=!1,t),UBAT_RLE:()=>(u.lastArabic=!1,t),UBAT_LRO:()=>(u.lastArabic=!1,t),UBAT_RLO:()=>(u.lastArabic=!1,t),UBAT_PDF:()=>(u.lastArabic=!1,t),UBAT_BN:()=>t}[Ne[x]]()}function We(s){let i,o=0,a=St.length-1;for(;o<=a;)if(i=Math.floor((o+a)/2),sSt[i][0]))return St[i][1];o=i+1}return s}function Xe(s){for(let i=0;i="ً"&&s<="ٕ"}function Jt(s){return s==="L"?"LTR":s==="R"?"RTL":s==="C"?"CLR":s==="D"?"CRL":""}function ze(s,i,o,a){for(;i*oi||!o&&s[u]===i)&&(s[u]+=a)}let X=[],Mt=[],Dt=[];const Ge={dir:0,defInFormat:"LLTR",defoutFormat:"VLTR",defSwap:"YN",inFormat:"LLTR",outFormat:"VLTR",swap:"YN",hiLevel:0,lastArabic:!1,hasUbatAl:!1,hasBlockSep:!1,hasSegSep:!1,defOutFormat:""},He=5,Je=6,dt=0,vt=1,Kt=/^[(I|V)][(L|R|C|D)][(Y|N)][(S|N)][N]$/,Ke=/[\u0591-\u06ff\ufb1d-\ufefc]/;function oe(s,i){return s.x===i.x&&s.y===i.y}function tr(s){if(!s)return;const i=s.length;if(i<=1)return;let o=0;for(let a=1;aa){x=!0;const h=(a-u)/v;v=a-u,m=(1-h)*T+h*m,D=(1-h)*y+h*D,--A}const p=this._writeVertex(T,y,0,0,B,R,R,-B,0,-1,u),U=this._writeVertex(T,y,0,0,B,R,-R,B,0,1,u);u+=v;const ht=this._writeVertex(m,D,0,0,B,R,R,-B,0,-1,u),c=this._writeVertex(m,D,0,0,B,R,-R,B,0,1,u);this._writeTriangle(p,U,ht),this._writeTriangle(U,ht,c),T=m,y=D}}_tessellate(i,o){const a=i[0],u=i[i.length-1],x=oe(a,u),T=x?3:2;if(i.length{const rt=ae(p,U,E,S,ct,I,z,Bt,H,et,F);return $>=0&&N>=0&&rt>=0&&le($,N,rt),$=N,N=rt,rt};x&&(v=i[i.length-2],h.x=u.x-v.x,h.y=u.y-v.y,ot=zt(h),h.x/=ot,h.y/=ot);let yt=!1;for(let z=0;zOt&&(yt=!0)),yt){const L=(Ot-F)/ft;ft=Ot-F,v={x:(1-L)*v.x+L*i[z].x,y:(1-L)*v.y+L*i[z].y},--z}else v=i[z];p=v.x,U=v.y;const Bt=z<=0&&!yt,ct=z===i.length-1;if(Bt||(F+=ft),ht=ct?x?i[1]:null:i[z+1],ht?(h.x=ht.x-p,h.y=ht.y-U,ot=zt(h),h.x/=ot,h.y/=ot):(h.x=void 0,h.y=void 0),!x){if(Bt){q(w,h),E=w.x,S=w.y,g===st.SQUARE&&(k(-h.y-h.x,h.x-h.y,h.x,h.y,0,-1),k(h.y-h.x,-h.x-h.y,h.x,h.y,0,1)),g===st.ROUND&&(k(-h.y-h.x,h.x-h.y,h.x,h.y,-1,-1),k(h.y-h.x,-h.x-h.y,h.x,h.y,-1,1)),g!==st.ROUND&&g!==st.BUTT||(k(-h.y,h.x,h.x,h.y,0,-1),k(h.y,-h.x,h.x,h.y,0,1));continue}if(ct){G(w,c),E=w.x,S=w.y,g!==st.ROUND&&g!==st.BUTT||(k(c.y,-c.x,-c.x,-c.y,0,-1),k(-c.y,c.x,-c.x,-c.y,0,1)),g===st.SQUARE&&(k(c.y-c.x,-c.x-c.y,-c.x,-c.y,0,-1),k(-c.y-c.x,c.x-c.y,-c.x,-c.y,0,1)),g===st.ROUND&&(k(c.y-c.x,-c.x-c.y,-c.x,-c.y,1,-1),k(-c.y-c.x,c.x-c.y,-c.x,-c.y,1,1));continue}}let I,H,et=-er(c,h);if(Math.abs(et)<.01)ee(c,h)>0?(w.x=c.x,w.y=c.y,et=1,I=Number.MAX_VALUE,H=!0):(q(w,h),et=1,I=1,H=!1);else{w.x=(c.x+h.x)/et,w.y=(c.y+h.y)/et,I=zt(w);const L=(I-1)*B*y;H=I>4||L>ft&&L>ot}E=w.x,S=w.y;let rt=A;switch(A){case J.BEVEL:I<1.05&&(rt=J.MITER);break;case J.ROUND:Im&&(rt=J.BEVEL)}switch(rt){case J.MITER:if(k(w.x,w.y,-c.x,-c.y,0,-1),k(-w.x,-w.y,-c.x,-c.y,0,1),ct)break;if(R){const L=yt?0:F;$=this._writeVertex(p,U,E,S,h.x,h.y,w.x,w.y,0,-1,L),N=this._writeVertex(p,U,E,S,h.x,h.y,-w.x,-w.y,0,1,L)}break;case J.BEVEL:{const L=et<0;let M,P,at,Q;if(L){const V=$;$=N,N=V,M=Ut,P=bt}else M=bt,P=Ut;if(H)at=L?q(this._innerPrev,c):G(this._innerPrev,c),Q=L?G(this._innerNext,h):q(this._innerNext,h);else{const V=L?qt(this._inner,w):te(this._inner,w);at=V,Q=V}const Y=L?G(this._bevelStart,c):q(this._bevelStart,c);k(at.x,at.y,-c.x,-c.y,M.x,M.y);const pt=k(Y.x,Y.y,-c.x,-c.y,P.x,P.y);if(ct)break;const it=L?q(this._bevelEnd,h):G(this._bevelEnd,h);if(H){const V=this._writeVertex(p,U,E,S,-c.x,-c.y,0,0,0,0,F);$=this._writeVertex(p,U,E,S,h.x,h.y,Q.x,Q.y,M.x,M.y,F),N=this._writeVertex(p,U,E,S,h.x,h.y,it.x,it.y,P.x,P.y,F),this._writeTriangle(pt,V,N)}else{if(R){const V=this._bevelMiddle;V.x=(Y.x+it.x)/2,V.y=(Y.y+it.y)/2,gt(C,V,-c.x,-c.y),k(V.x,V.y,-c.x,-c.y,C.x,C.y),gt(C,V,h.x,h.y),$=this._writeVertex(p,U,E,S,h.x,h.y,V.x,V.y,C.x,C.y,F),N=this._writeVertex(p,U,E,S,h.x,h.y,Q.x,Q.y,M.x,M.y,F)}else{const V=$;$=N,N=V}k(it.x,it.y,h.x,h.y,P.x,P.y)}if(L){const V=$;$=N,N=V}break}case J.ROUND:{const L=et<0;let M,P;if(L){const W=$;$=N,N=W,M=Ut,P=bt}else M=bt,P=Ut;const at=L?qt(this._inner,w):te(this._inner,w);let Q,Y;H?(Q=L?q(this._innerPrev,c):G(this._innerPrev,c),Y=L?G(this._innerNext,h):q(this._innerNext,h)):(Q=at,Y=at);const pt=L?G(this._roundStart,c):q(this._roundStart,c),it=L?q(this._roundEnd,h):G(this._roundEnd,h),V=k(Q.x,Q.y,-c.x,-c.y,M.x,M.y),Nt=k(pt.x,pt.y,-c.x,-c.y,P.x,P.y);if(ct)break;const lt=this._writeVertex(p,U,E,S,-c.x,-c.y,0,0,0,0,F);H||this._writeTriangle($,N,lt);const nt=qt(this._outer,at),xt=this._writeVertex(p,U,E,S,h.x,h.y,it.x,it.y,P.x,P.y,F);let _t,Tt;const Ft=I>2;if(Ft){let W;I!==Number.MAX_VALUE?(nt.x/=I,nt.y/=I,W=ee(c,nt),W=(I*(W*W-1)+1)/W):W=-1,_t=L?G(this._startBreak,c):q(this._startBreak,c),_t.x+=c.x*W,_t.y+=c.y*W,Tt=L?q(this._endBreak,h):G(this._endBreak,h),Tt.x+=h.x*W,Tt.y+=h.y*W}gt(C,nt,-c.x,-c.y);const Vt=this._writeVertex(p,U,E,S,-c.x,-c.y,nt.x,nt.y,C.x,C.y,F);gt(C,nt,h.x,h.y);const It=R?this._writeVertex(p,U,E,S,h.x,h.y,nt.x,nt.y,C.x,C.y,F):Vt,Pt=lt,Et=R?this._writeVertex(p,U,E,S,h.x,h.y,0,0,0,0,F):lt;let Lt=-1,mt=-1;if(Ft&&(gt(C,_t,-c.x,-c.y),Lt=this._writeVertex(p,U,E,S,-c.x,-c.y,_t.x,_t.y,C.x,C.y,F),gt(C,Tt,h.x,h.y),mt=this._writeVertex(p,U,E,S,h.x,h.y,Tt.x,Tt.y,C.x,C.y,F)),R?Ft?(this._writeTriangle(Pt,Nt,Lt),this._writeTriangle(Pt,Lt,Vt),this._writeTriangle(Et,It,mt),this._writeTriangle(Et,mt,xt)):(this._writeTriangle(Pt,Nt,Vt),this._writeTriangle(Et,It,xt)):Ft?(this._writeTriangle(lt,Nt,Lt),this._writeTriangle(lt,Lt,mt),this._writeTriangle(lt,mt,xt)):(this._writeTriangle(lt,Nt,Vt),this._writeTriangle(lt,It,xt)),H?($=this._writeVertex(p,U,E,S,h.x,h.y,Y.x,Y.y,M.x,M.y,F),N=xt):($=R?this._writeVertex(p,U,E,S,h.x,h.y,Y.x,Y.y,M.x,M.y,F):V,this._writeTriangle($,Et,xt),N=xt),L){const W=$;$=N,N=W}break}}}}}export{sr as C,nr as a,or as c,ir as i}; diff --git a/assets/UniqueValueRenderer-BlkUix3g.js b/assets/UniqueValueRenderer-7V9Bhr-D.js similarity index 99% rename from assets/UniqueValueRenderer-BlkUix3g.js rename to assets/UniqueValueRenderer-7V9Bhr-D.js index 303fee9..65f43cc 100644 --- a/assets/UniqueValueRenderer-BlkUix3g.js +++ b/assets/UniqueValueRenderer-7V9Bhr-D.js @@ -1 +1 @@ -import{d as i,y as a,f as d,aU as V,aV as v,aY as I,e1 as B,aZ as _,dS as st,s as w,jC as Ne,aR as G,hX as Vt,ho as St,N as Re,f0 as it,a7 as xt,au as It,jE as U,jB as Ce,eY as _t,l0 as Le,eX as $t,l1 as lt,dv as zt,hm as ve,fa as jt,aT as at,l2 as rt,c8 as ce,hQ as Ft,c9 as ot,b4 as Ge,q as Et,ax as Ve,d5 as qt,dD as Tt,f6 as kt,g as be}from"./index-CEWggaxV.js";import{p as Ae,a as Ot}from"./ColorStop-44hBlQ14.js";import{m as Ut}from"./diffUtils-B4YFa5Ju.js";import{m as Bt,p as Dt}from"./colorRamps-BJydlf0f.js";import{e as W,t as Mt,a as Nt,i as He}from"./sizeVariableUtils-Cmcuvw-4.js";import{viewScaleRE as Rt}from"./visualVariableUtils-z2k12BH8.js";import{l as ye}from"./jsonUtils-qYmXvGJ1.js";import{c as Ct}from"./styleUtils-CnV_Xzhi.js";var Se;let Q=Se=class extends V{constructor(e){super(e),this.minValue=0,this.maxValue=0}clone(){return new Se({minValue:this.minValue,maxValue:this.maxValue})}};i([a({type:Number,json:{write:!0}})],Q.prototype,"minValue",void 0),i([a({type:Number,json:{write:!0}})],Q.prototype,"maxValue",void 0),Q=Se=i([d("esri.renderer.support.AuthoringInfoClassBreakInfo")],Q);var xe;let O=xe=class extends V{constructor(e){super(e),this.field="",this.normalizationField="",this.label="",this.classBreakInfos=[]}clone(){return new xe({field:this.field,normalizationField:this.normalizationField,label:this.label,classBreakInfos:v(this.classBreakInfos)})}};i([a({type:String,json:{write:!0}})],O.prototype,"field",void 0),i([a({type:String,json:{write:!0}})],O.prototype,"normalizationField",void 0),i([a({type:String,json:{write:!0}})],O.prototype,"label",void 0),i([a({type:[Q],json:{write:!0}})],O.prototype,"classBreakInfos",void 0),O=xe=i([d("esri.renderers.support.AuthoringInfoFieldInfo")],O);var Ie;const se=new I({percentTotal:"percent-of-total",ratio:"ratio",percent:"percent"}),ie=new I({sizeInfo:"size",colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation"}),Pe={key:e=>typeof e=="number"?"number":"string",typeMap:{number:Number,string:String},base:null},Je=["high-to-low","above-and-below","centered-on","extremes"],We=[...new Set(["high-to-low","above-and-below","centered-on","extremes","90-10","above","below","high-to-low","above-and-below","90-10","above","below"])],Qe=["seconds","minutes","hours","days","months","years"];let b=Ie=class extends V{constructor(e){super(e),this.endTime=null,this.field=null,this.maxSliderValue=null,this.minSliderValue=null,this.startTime=null,this.type=null,this.units=null}castEndTime(e){return typeof e=="string"||typeof e=="number"?e:null}castStartTime(e){return typeof e=="string"||typeof e=="number"?e:null}get style(){return this.type==="color"?this._get("style"):null}set style(e){this._set("style",e)}get theme(){return this.type==="color"||this.type==="size"?this._get("theme")||"high-to-low":null}set theme(e){this._set("theme",e)}clone(){return new Ie({endTime:this.endTime,field:this.field,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,startTime:this.startTime,style:this.style,theme:this.theme,type:this.type,units:this.units})}};i([a({types:Pe,json:{write:!0}})],b.prototype,"endTime",void 0),i([B("endTime")],b.prototype,"castEndTime",null),i([a({type:String,json:{write:!0}})],b.prototype,"field",void 0),i([a({type:Number,json:{write:!0}})],b.prototype,"maxSliderValue",void 0),i([a({type:Number,json:{write:!0}})],b.prototype,"minSliderValue",void 0),i([a({types:Pe,json:{write:!0}})],b.prototype,"startTime",void 0),i([B("startTime")],b.prototype,"castStartTime",null),i([a({type:se.apiValues,value:null,json:{type:se.jsonValues,read:se.read,write:se.write}})],b.prototype,"style",null),i([a({type:We,value:null,json:{type:We,origins:{"web-scene":{type:Je,write:{writer:(e,t)=>{Je.includes(e)&&(t.theme=e)}}}},write:!0}})],b.prototype,"theme",null),i([a({type:ie.apiValues,json:{type:ie.jsonValues,read:ie.read,write:ie.write}})],b.prototype,"type",void 0),i([a({type:Qe,json:{type:Qe,write:!0}})],b.prototype,"units",void 0),b=Ie=i([d("esri.renderers.support.AuthoringInfoVisualVariable")],b);const Gt=b;var _e;const M=new I({esriClassifyDefinedInterval:"defined-interval",esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation"}),le=new I({pieChart:"pie-chart",classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density",flow:"flow"}),Ze=new I({classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density"}),Xe=["inches","feet","yards","miles","nautical-miles","millimeters","centimeters","decimeters","meters","kilometers","decimal-degrees"],At=["high-to-low","above-and-below","above","below","90-10"],Lt=["flow-line","wave-front"],Ht=["caret","circle-caret","arrow","circle-arrow","plus-minus","circle-plus-minus","square","circle","triangle","happy-sad","thumb","custom"];let h=_e=class extends V{constructor(e){super(e),this.colorRamp=null,this.fadeRatio=null,this.isAutoGenerated=!1,this.lengthUnit=null,this.maxSliderValue=null,this.minSliderValue=null,this.visualVariables=null}get classificationMethod(){const e=this._get("classificationMethod"),t=this.type;return t&&t!=="relationship"?t==="class-breaks-size"||t==="class-breaks-color"?e||"manual":null:e}set classificationMethod(e){this._set("classificationMethod",e)}readColorRamp(e){return e?Dt(e):void 0}get fields(){return this.type&&this.type!=="predominance"?null:this._get("fields")}set fields(e){this._set("fields",e)}get field1(){return this.type&&this.type!=="relationship"?null:this._get("field1")}set field1(e){this._set("field1",e)}get field2(){return this.type&&this.type!=="relationship"?null:this._get("field2")}set field2(e){this._set("field2",e)}get flowTheme(){return this.type==="flow"?this._get("flowTheme"):null}set flowTheme(e){this._set("flowTheme",e)}get focus(){return this.type&&this.type!=="relationship"?null:this._get("focus")}set focus(e){this._set("focus",e)}get numClasses(){return this.type&&this.type!=="relationship"?null:this._get("numClasses")}set numClasses(e){this._set("numClasses",e)}get statistics(){return this.type==="univariate-color-size"&&this.univariateTheme==="above-and-below"?this._get("statistics"):null}set statistics(e){this._set("statistics",e)}get standardDeviationInterval(){const e=this.type;return e&&e!=="relationship"&&e!=="class-breaks-size"&&e!=="class-breaks-color"||this.classificationMethod&&this.classificationMethod!=="standard-deviation"?null:this._get("standardDeviationInterval")}set standardDeviationInterval(e){this._set("standardDeviationInterval",e)}get type(){return this._get("type")}set type(e){let t=e;e==="classed-size"?t="class-breaks-size":e==="classed-color"&&(t="class-breaks-color"),this._set("type",t)}get univariateSymbolStyle(){return this.type==="univariate-color-size"&&this.univariateTheme==="above-and-below"?this._get("univariateSymbolStyle"):null}set univariateSymbolStyle(e){this._set("univariateSymbolStyle",e)}get univariateTheme(){return this.type==="univariate-color-size"?this._get("univariateTheme"):null}set univariateTheme(e){this._set("univariateTheme",e)}clone(){var e;return new _e({classificationMethod:this.classificationMethod,colorRamp:v(this.colorRamp),fadeRatio:v(this.fadeRatio),fields:(e=this.fields)==null?void 0:e.slice(0),field1:v(this.field1),field2:v(this.field2),isAutoGenerated:this.isAutoGenerated,focus:this.focus,numClasses:this.numClasses,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,lengthUnit:this.lengthUnit,statistics:this.statistics,standardDeviationInterval:this.standardDeviationInterval,type:this.type,visualVariables:this.visualVariables&&this.visualVariables.map(t=>t.clone()),univariateSymbolStyle:this.univariateSymbolStyle,univariateTheme:this.univariateTheme,flowTheme:this.flowTheme})}};i([a({type:M.apiValues,value:null,json:{type:M.jsonValues,read:M.read,write:M.write,origins:{"web-document":{default:"manual",type:M.jsonValues,read:M.read,write:M.write}}}})],h.prototype,"classificationMethod",null),i([a({types:Bt,json:{write:!0}})],h.prototype,"colorRamp",void 0),i([_("colorRamp")],h.prototype,"readColorRamp",null),i([a({json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],h.prototype,"fadeRatio",void 0),i([a({type:[String],value:null,json:{write:!0}})],h.prototype,"fields",null),i([a({type:O,value:null,json:{write:!0}})],h.prototype,"field1",null),i([a({type:O,value:null,json:{write:!0}})],h.prototype,"field2",null),i([a({type:Lt,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],h.prototype,"flowTheme",null),i([a({type:["HH","HL","LH","LL"],value:null,json:{write:!0}})],h.prototype,"focus",null),i([a({type:Boolean,json:{write:!0,default:!1,origins:{"web-scene":{write:!1}}}})],h.prototype,"isAutoGenerated",void 0),i([a({type:Number,value:null,json:{type:st,write:!0}})],h.prototype,"numClasses",null),i([a({type:Xe,json:{type:Xe,read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],h.prototype,"lengthUnit",void 0),i([a({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],h.prototype,"maxSliderValue",void 0),i([a({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],h.prototype,"minSliderValue",void 0),i([a({type:Object,value:null,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],h.prototype,"statistics",null),i([a({type:[.25,.33,.5,1],value:null,json:{type:[.25,.33,.5,1],write:!0}})],h.prototype,"standardDeviationInterval",null),i([a({type:le.apiValues,value:null,json:{type:le.jsonValues,read:le.read,write:le.write,origins:{"web-scene":{type:Ze.jsonValues,write:{writer:Ze.write,overridePolicy:e=>({enabled:e!=="flow"})}}}}})],h.prototype,"type",null),i([a({type:[Gt],json:{write:!0}})],h.prototype,"visualVariables",void 0),i([a({type:Ht,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],h.prototype,"univariateSymbolStyle",null),i([a({type:At,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],h.prototype,"univariateTheme",null),h=_e=i([d("esri.renderers.support.AuthoringInfo")],h);const Pt=h,ge=new I({simple:"simple",uniqueValue:"unique-value",classBreaks:"class-breaks",heatmap:"heatmap",dotDensity:"dot-density",dictionary:"dictionary",pieChart:"pie-chart"},{ignoreUnknown:!0});let Z=class extends V{constructor(t){super(t),this.authoringInfo=null,this.type=null}async getRequiredFields(t){if(!this.collectRequiredFields)return[];const s=new Set;return await this.collectRequiredFields(s,t),Array.from(s).sort()}getSymbol(t,s){}async getSymbolAsync(t,s){}getSymbols(){return[]}getAttributeHash(){return JSON.stringify(this)}getMeshHash(){return JSON.stringify(this)}};i([a({type:Pt,json:{write:!0}})],Z.prototype,"authoringInfo",void 0),i([a({type:ge.apiValues,readOnly:!0,json:{type:ge.jsonValues,read:!1,write:{writer:ge.write,ignoreOrigin:!0}}})],Z.prototype,"type",void 0),Z=i([d("esri.renderers.Renderer")],Z);const nt=Z;function Jt(e){var t,s;return((s=(t=e.match(Wt))==null?void 0:t[1])==null?void 0:s.replace(/\\'/g,"'"))??null}const Wt=/^hash\(\$feature\['((\\'|[^'])+)'\]\) \* 8\.381e-8$/;var $e;let oe=$e=class extends Ae{constructor(){super(...arguments),this.showLegend=null}clone(){return new $e({title:this.title,showLegend:this.showLegend})}};i([a({type:Boolean,json:{write:!0}})],oe.prototype,"showLegend",void 0),oe=$e=i([d("esri.renderers.visualVariables.support.VisualVariableLegendOptions")],oe);const ut=oe,we=new I({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"});let x=class extends V{constructor(t){super(t),this.index=null,this.type=null,this.field=null,this.valueExpression=null,this.valueExpressionTitle=null,this.legendOptions=null}castField(t){return t==null?t:typeof t=="function"?(w.getLogger(this).error(".field: field must be a string value"),null):Ne(t)}get arcadeRequired(){return!!this.valueExpression}clone(){}getAttributeHash(){return`${this.type}-${this.field}-${this.valueExpression}`}};i([a()],x.prototype,"index",void 0),i([a({type:we.apiValues,readOnly:!0,json:{read:we.read,write:we.write}})],x.prototype,"type",void 0),i([a({type:String,json:{write:!0}})],x.prototype,"field",void 0),i([B("field")],x.prototype,"castField",null),i([a({type:String,json:{write:!0}})],x.prototype,"valueExpression",void 0),i([a({type:String,json:{write:!0}})],x.prototype,"valueExpressionTitle",void 0),i([a({readOnly:!0})],x.prototype,"arcadeRequired",null),i([a({type:ut,json:{write:!0}})],x.prototype,"legendOptions",void 0),x=i([d("esri.renderers.visualVariables.VisualVariable")],x);const ee=x;var ze;let N=ze=class extends ee{constructor(e){super(e),this.type="color",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(e){e&&Array.isArray(e)&&(e=e.filter(t=>!!t)).sort((t,s)=>t.value-s.value),this._set("stops",e)}clone(){var e;return new ze({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(t=>t.clone()),legendOptions:(e=this.legendOptions)==null?void 0:e.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(e=>e.value||0)}};i([a({readOnly:!0})],N.prototype,"cache",null),i([a({type:["color"],json:{type:["colorInfo"]}})],N.prototype,"type",void 0),i([a({type:String,json:{write:!0}})],N.prototype,"normalizationField",void 0),i([a({type:[Ot],json:{write:!0}})],N.prototype,"stops",null),N=ze=i([d("esri.renderers.visualVariables.ColorVariable")],N);const pt=N;var je;let E=je=class extends V{constructor(e){super(e),this.label=null,this.opacity=null,this.value=null}readOpacity(e,t){return Vt(t.transparency)}writeOpacity(e,t,s){t[s]=St(e)}clone(){return new je({label:this.label,opacity:this.opacity,value:this.value})}};i([a({type:String,json:{write:!0}})],E.prototype,"label",void 0),i([a({type:Number,json:{type:st,write:{target:"transparency"}}})],E.prototype,"opacity",void 0),i([_("opacity",["transparency"])],E.prototype,"readOpacity",null),i([G("opacity")],E.prototype,"writeOpacity",null),i([a({type:Number,json:{write:!0}})],E.prototype,"value",void 0),E=je=i([d("esri.renderers.visualVariables.support.OpacityStop")],E);const Qt=E;var Fe;let R=Fe=class extends ee{constructor(e){super(e),this.type="opacity",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(e){e&&Array.isArray(e)&&(e=e.filter(t=>!!t)).sort((t,s)=>t.value-s.value),this._set("stops",e)}clone(){var e;return new Fe({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(t=>t.clone()),legendOptions:(e=this.legendOptions)==null?void 0:e.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(e=>e.value||0)}};i([a({readOnly:!0})],R.prototype,"cache",null),i([a({type:["opacity"],json:{type:["transparencyInfo"]}})],R.prototype,"type",void 0),i([a({type:String,json:{write:!0}})],R.prototype,"normalizationField",void 0),i([a({type:[Qt],json:{write:!0}})],R.prototype,"stops",null),R=Fe=i([d("esri.renderers.visualVariables.OpacityVariable")],R);const ht=R;var Ee;let $=Ee=class extends ee{constructor(e){super(e),this.axis=null,this.type="rotation",this.rotationType="geographic",this.valueExpressionTitle=null}get cache(){return{hasExpression:!!this.valueExpression,compiledFunc:null}}writeValueExpressionTitleWebScene(e,t,s,l){if(l!=null&&l.messages){const r=`visualVariables[${this.index}]`;l.messages.push(new Re("property:unsupported",this.type+"VisualVariable.valueExpressionTitle is not supported in Web Scene. Please remove this property to save the Web Scene.",{instance:this,propertyName:r+".valueExpressionTitle",context:l}))}}clone(){var e;return new Ee({axis:this.axis,rotationType:this.rotationType,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,legendOptions:(e=this.legendOptions)==null?void 0:e.clone()})}};i([a({readOnly:!0})],$.prototype,"cache",null),i([a({type:["heading","tilt","roll"],json:{origins:{"web-scene":{default:"heading",write:!0}}}})],$.prototype,"axis",void 0),i([a({type:["rotation"],json:{type:["rotationInfo"]}})],$.prototype,"type",void 0),i([a({type:["geographic","arithmetic"],json:{write:!0,origins:{"web-document":{write:!0,default:"geographic"}}}})],$.prototype,"rotationType",void 0),i([a({type:String,json:{write:!0}})],$.prototype,"valueExpressionTitle",void 0),i([G("web-scene","valueExpressionTitle")],$.prototype,"writeValueExpressionTitleWebScene",null),$=Ee=i([d("esri.renderers.visualVariables.RotationVariable")],$);const dt=$;var qe;let q=qe=class extends V{constructor(e){super(e),this.label=null,this.size=null,this.value=null,this.useMinValue=null,this.useMaxValue=null}clone(){return new qe({label:this.label,size:this.size,value:this.value,useMaxValue:this.useMaxValue,useMinValue:this.useMinValue})}};i([a({type:String,json:{write:!0}})],q.prototype,"label",void 0),i([a({type:Number,cast:it,json:{write:!0}})],q.prototype,"size",void 0),i([a({type:Number,json:{write:!0}})],q.prototype,"value",void 0),i([a({type:Boolean,json:{write:!1}})],q.prototype,"useMinValue",void 0),i([a({type:Boolean,json:{write:!1}})],q.prototype,"useMaxValue",void 0),q=qe=i([d("esri.renderers.visualVariables.support.SizeStop")],q);const Zt=q;var Te;let ne=Te=class extends ut{constructor(){super(...arguments),this.customValues=null}clone(){var e;return new Te({title:this.title,showLegend:this.showLegend,customValues:(e=this.customValues)==null?void 0:e.slice(0)})}};i([a({type:[Number],json:{write:!0}})],ne.prototype,"customValues",void 0),ne=Te=i([d("esri.renderers.visualVariables.support.SizeVariableLegendOptions")],ne);const Xt=ne;var ke;const ae=new I({width:"width",depth:"depth",height:"height",widthAndDepth:"width-and-depth",all:"all"}),Oe=new I({unknown:"unknown",inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers","decimal-degree":"decimal-degrees"});function Ye(e){if(e!=null)return typeof e=="string"||typeof e=="number"?it(e):e.type==="size"?W(e)?e:(delete(e={...e}).type,new n(e)):void 0}function Ke(e,t,s){if(typeof e!="object")return e;const l=new n;return l.read(e,s),l}let n=ke=class extends ee{constructor(e){super(e),this.axis=null,this.legendOptions=null,this.normalizationField=null,this.scaleBy=null,this.target=null,this.type="size",this.useSymbolValue=null,this.valueExpression=null,this.valueRepresentation=null,this.valueUnit=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null,isScaleDriven:this.valueExpression!=null&&Rt.test(this.valueExpression)}}set expression(e){w.getLogger(this).warn("'expression' is deprecated since version 4.2. Use 'valueExpression' instead. The only supported expression is 'view.scale'."),e==="view.scale"?(this.valueExpression="$view.scale",this._set("expression",e)):this._set("expression",null)}set index(e){W(this.maxSize)&&(this.maxSize.index=`visualVariables[${e}].maxSize`),W(this.minSize)&&(this.minSize.index=`visualVariables[${e}].minSize`),this._set("index",e)}get inputValueType(){return Mt(this)}set maxDataValue(e){e&&this.stops&&(w.getLogger(this).warn("cannot set maxDataValue when stops is not null."),e=null),this._set("maxDataValue",e)}set maxSize(e){e&&this.stops&&(w.getLogger(this).warn("cannot set maxSize when stops is not null."),e=null),this._set("maxSize",e)}castMaxSize(e){return Ye(e)}readMaxSize(e,t,s){return Ke(e,t,s)}set minDataValue(e){e&&this.stops&&(w.getLogger(this).warn("cannot set minDataValue when stops is not null."),e=null),this._set("minDataValue",e)}set minSize(e){e&&this.stops&&(w.getLogger(this).warn("cannot set minSize when stops is not null."),e=null),this._set("minSize",e)}castMinSize(e){return Ye(e)}readMinSize(e,t,s){return Ke(e,t,s)}get arcadeRequired(){return!!this.valueExpression||this.minSize!=null&&typeof this.minSize=="object"&&this.minSize.arcadeRequired||this.maxSize!=null&&typeof this.maxSize=="object"&&this.maxSize.arcadeRequired}set stops(e){this.minDataValue==null&&this.maxDataValue==null&&this.minSize==null&&this.maxSize==null?e&&Array.isArray(e)&&(e=e.filter(t=>!!t)).sort((t,s)=>t.value-s.value):e&&(w.getLogger(this).warn("cannot set stops when one of minDataValue, maxDataValue, minSize or maxSize is not null."),e=null),this._set("stops",e)}get transformationType(){return Nt(this,this.inputValueType)}readValueExpression(e,t){return e||t.expression&&"$view.scale"}writeValueExpressionWebScene(e,t,s,l){if(e==="$view.scale"){if(l!=null&&l.messages){const r=this.index,o=typeof r=="string"?r:`visualVariables[${r}]`;l.messages.push(new Re("property:unsupported",this.type+"VisualVariable.valueExpression = '$view.scale' is not supported in Web Scene. Please remove this property to save the Web Scene.",{instance:this,propertyName:o+".valueExpression",context:l}))}}else t[s]=e}readValueUnit(e){return e?Oe.read(e):null}clone(){var e,t;return new ke({axis:this.axis,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,maxDataValue:this.maxDataValue,maxSize:W(this.maxSize)?this.maxSize.clone():this.maxSize,minDataValue:this.minDataValue,minSize:W(this.minSize)?this.minSize.clone():this.minSize,normalizationField:this.normalizationField,stops:(e=this.stops)==null?void 0:e.map(s=>s.clone()),target:this.target,useSymbolValue:this.useSymbolValue,valueRepresentation:this.valueRepresentation,valueUnit:this.valueUnit,legendOptions:(t=this.legendOptions)==null?void 0:t.clone()})}flipSizes(){if(this.transformationType===He.ClampedLinear){const{minSize:e,maxSize:t}=this;return this.minSize=t,this.maxSize=e,this}if(this.transformationType===He.Stops){const e=this.stops;if(!e)return this;const t=e.map(l=>l.size).reverse(),s=e.length;for(let l=0;lt.value||0)}};i([a({readOnly:!0})],n.prototype,"cache",null),i([a({type:ae.apiValues,json:{type:ae.jsonValues,origins:{"web-map":{read:!1}},read:ae.read,write:ae.write}})],n.prototype,"axis",void 0),i([a({type:String,value:null,json:{read:!1}})],n.prototype,"expression",null),i([a()],n.prototype,"index",null),i([a({type:String,readOnly:!0})],n.prototype,"inputValueType",null),i([a({type:Xt,json:{write:!0}})],n.prototype,"legendOptions",void 0),i([a({type:Number,value:null,json:{write:!0}})],n.prototype,"maxDataValue",null),i([a({type:Number,value:null,json:{write:!0}})],n.prototype,"maxSize",null),i([B("maxSize")],n.prototype,"castMaxSize",null),i([_("maxSize")],n.prototype,"readMaxSize",null),i([a({type:Number,value:null,json:{write:!0}})],n.prototype,"minDataValue",null),i([a({type:Number,value:null,json:{write:!0}})],n.prototype,"minSize",null),i([B("minSize")],n.prototype,"castMinSize",null),i([_("minSize")],n.prototype,"readMinSize",null),i([a({type:String,json:{write:!0}})],n.prototype,"normalizationField",void 0),i([a({readOnly:!0})],n.prototype,"arcadeRequired",null),i([a({type:String})],n.prototype,"scaleBy",void 0),i([a({type:[Zt],value:null,json:{write:!0}})],n.prototype,"stops",null),i([a({type:["outline"],json:{write:!0}})],n.prototype,"target",void 0),i([a({type:String,readOnly:!0})],n.prototype,"transformationType",null),i([a({type:["size"],json:{type:["sizeInfo"]}})],n.prototype,"type",void 0),i([a({type:Boolean,json:{write:!0,origins:{"web-map":{read:!1}}}})],n.prototype,"useSymbolValue",void 0),i([a({type:String,json:{write:!0}})],n.prototype,"valueExpression",void 0),i([_("valueExpression",["valueExpression","expression"])],n.prototype,"readValueExpression",null),i([G("web-scene","valueExpression")],n.prototype,"writeValueExpressionWebScene",null),i([a({type:["radius","diameter","area","width","distance"],json:{write:!0}})],n.prototype,"valueRepresentation",void 0),i([a({type:Oe.apiValues,json:{write:Oe.write,origins:{"web-map":{read:!1},"web-scene":{write:!0},"portal-item":{write:!0}}}})],n.prototype,"valueUnit",void 0),i([_("valueUnit")],n.prototype,"readValueUnit",null),n=ke=i([d("esri.renderers.visualVariables.SizeVariable")],n);const ct=n,Yt={color:pt,size:ct,opacity:ht,rotation:dt},Kt=new I({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"}),es=/^\[([^\]]+)\]$/i;let ue=class extends xt{constructor(){super(...arguments),this.colorVariables=null,this.opacityVariables=null,this.rotationVariables=null,this.sizeVariables=null}set visualVariables(t){if(this._resetVariables(),t=t&&t.filter(s=>!!s),t==null?void 0:t.length){for(const s of t)switch(s.type){case"color":this.colorVariables.push(s);break;case"opacity":this.opacityVariables.push(s);break;case"rotation":this.rotationVariables.push(s);break;case"size":this.sizeVariables.push(s)}this.sizeVariables.length&&this.sizeVariables.some(s=>!!s.target)&&t.sort((s,l)=>{let r=null;return r=s.target===l.target?0:s.target?1:-1,r});for(let s=0;s{const f=Kt.read(c.type),S=Yt[f];S||(w.getLogger(this).warn(`Unknown variable type: ${f}`),l!=null&&l.messages&&l.messages.push(new It("visual-variable:unsupported",`visualVariable of type '${f}' is not supported`,{definition:c,context:l})));const g=new S;return g.read(c,l),g})}writeVariables(t,s){const l=[];for(const r of t){const o=r.toJSON(s);o&&l.push(o)}return l}_resetVariables(){this.colorVariables=[],this.opacityVariables=[],this.rotationVariables=[],this.sizeVariables=[]}};i([a()],ue.prototype,"visualVariables",null),ue=i([d("esri.renderers.visualVariables.VisualVariableFactory")],ue);const ts=ue,ss={base:ee,key:"type",typeMap:{opacity:ht,color:pt,rotation:dt,size:ct}},yt=e=>{let t=class extends e{constructor(){super(...arguments),this._vvFactory=new ts}set visualVariables(s){this._vvFactory.visualVariables=s,this._set("visualVariables",this._vvFactory.visualVariables)}readVisualVariables(s,l,r){return this._vvFactory.readVariables(s,l,r)}writeVisualVariables(s,l,r,o){l[r]=this._vvFactory.writeVariables(s,o)}get arcadeRequiredForVisualVariables(){if(!this.visualVariables)return!1;for(const s of this.visualVariables)if(s.arcadeRequired)return!0;return!1}hasVisualVariables(s,l){return s?this.getVisualVariablesForType(s,l).length>0:this.getVisualVariablesForType("size",l).length>0||this.getVisualVariablesForType("color",l).length>0||this.getVisualVariablesForType("opacity",l).length>0||this.getVisualVariablesForType("rotation",l).length>0}getVisualVariablesForType(s,l){const r=this.visualVariables;return r?r.filter(o=>o.type===s&&(typeof l=="string"?o.target===l:l!==!1||!o.target)):[]}async collectVVRequiredFields(s,l){let r=[];this.visualVariables&&(r=r.concat(this.visualVariables));for(const o of r)o&&(o.field&&U(s,l,o.field),o.normalizationField&&U(s,l,o.normalizationField),o.valueExpression&&(is(o.valueExpression,s,l)||await Ce(s,l,o.valueExpression)))}};return i([a({types:[ss],value:null,json:{write:!0}})],t.prototype,"visualVariables",null),i([_("visualVariables",["visualVariables","rotationType","rotationExpression"])],t.prototype,"readVisualVariables",null),i([G("visualVariables")],t.prototype,"writeVisualVariables",null),t=i([d("esri.renderers.mixins.VisualVariablesMixin")],t),t};function is(e,t,s){const l=Jt(e);return l!=null&&(U(t,s,l),!0)}const fe={types:_t,json:{write:{writer:ye},origins:{"web-scene":{types:Le,write:{writer:ye},read:{reader:$t({types:Le})}}}}},mt=lt({json:{origins:{"web-scene":{write:{isRequired:!0}}}}},fe),ft={types:{base:zt,key:"type",typeMap:{"simple-fill":ve.typeMap["simple-fill"],"picture-fill":ve.typeMap["picture-fill"],"polygon-3d":ve.typeMap["polygon-3d"]}},json:{write:{writer:ye},origins:{"web-scene":{type:jt,write:{writer:ye}}}}},pe={cast:e=>e==null||typeof e=="string"||typeof e=="number"?e:`${e}`,json:{type:String,write:{writer:(e,t)=>{t.value=e==null?void 0:e.toString()}}}};var Ue;let T=Ue=class extends V{constructor(e){super(e),this.description=null,this.label=null,this.minValue=null,this.maxValue=0,this.symbol=null}clone(){return new Ue({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,symbol:this.symbol?this.symbol.clone():null})}getMeshHash(){const e=JSON.stringify(this.symbol);return`${this.minValue}.${this.maxValue}.${e}`}};i([a({type:String,json:{write:!0}})],T.prototype,"description",void 0),i([a({type:String,json:{write:!0}})],T.prototype,"label",void 0),i([a({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],T.prototype,"minValue",void 0),i([a({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],T.prototype,"maxValue",void 0),i([a(mt)],T.prototype,"symbol",void 0),T=Ue=i([d("esri.renderers.support.ClassBreakInfo")],T);const me=T;var Be;const vt="log",he="percent-of-total",de="field",re=new I({esriNormalizeByLog:vt,esriNormalizeByPercentOfTotal:he,esriNormalizeByField:de}),ls=at(me);let y=Be=class extends yt(nt){constructor(e){super(e),this._compiledValueExpression={valueExpression:null,compiledFunction:null},this.backgroundFillSymbol=null,this.classBreakInfos=null,this.defaultLabel=null,this.defaultSymbol=null,this.field=null,this.isMaxInclusive=!0,this.legendOptions=null,this.normalizationField=null,this.normalizationTotal=null,this.type="class-breaks",this.valueExpression=null,this.valueExpressionTitle=null,this._set("classBreakInfos",[])}readClassBreakInfos(e,t,s){if(!Array.isArray(e))return;let l=t.minValue;return e.map(r=>{const o=new me;return o.read(r,s),o.minValue==null&&(o.minValue=l),o.maxValue==null&&(o.maxValue=o.minValue),l=o.maxValue,o})}writeClassBreakInfos(e,t,s,l){const r=e.map(o=>o.write({},l));this._areClassBreaksConsecutive()&&r.forEach(o=>delete o.classMinValue),t[s]=r}castField(e){return e==null?e:typeof e=="function"?(w.getLogger(this).error(".field: field must be a string value"),null):Ne(e)}get minValue(){return this.classBreakInfos&&this.classBreakInfos[0]&&this.classBreakInfos[0].minValue||0}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,s=this.normalizationTotal!=null;return t||s?(e=t&&de||s&&he||null,t&&s&&w.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==de&&e!==he||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}addClassBreakInfo(e,t,s){let l=null;l=typeof e=="number"?new me({minValue:e,maxValue:t,symbol:rt(s)}):ls(v(e)),this.classBreakInfos.push(l),this.classBreakInfos.length===1&&this.notifyChange("minValue")}removeClassBreakInfo(e,t){const s=this.classBreakInfos.length;for(let l=0;l-1?this.classBreakInfos[s].symbol:this.defaultSymbol}async getSymbolAsync(e,t){let s=t;if(this.valueExpression&&(t==null?void 0:t.arcade)==null){const r=await ce(),{arcadeUtils:o}=r;o.hasGeometryOperations(this.valueExpression)&&await o.enableGeometryOperations(),s={...s,arcade:r}}const l=this.getBreakIndex(e,s);return l>-1?this.classBreakInfos[l].symbol:this.defaultSymbol}getSymbols(){const e=[];return this.classBreakInfos.forEach(t=>{t.symbol&&e.push(t.symbol)}),this.defaultSymbol&&e.push(this.defaultSymbol),e}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((e,t)=>e+t.getAttributeHash(),"")}getMeshHash(){const e=JSON.stringify(this.backgroundFillSymbol),t=JSON.stringify(this.defaultSymbol),s=`${this.normalizationField}.${this.normalizationType}.${this.normalizationTotal}`;return`${e}.${t}.${this.classBreakInfos.reduce((l,r)=>l+r.getMeshHash(),"")}.${s}.${this.field}.${this.valueExpression}`}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}clone(){var e,t;return new Be({field:this.field,backgroundFillSymbol:(e=this.backgroundFillSymbol)==null?void 0:e.clone(),defaultLabel:this.defaultLabel,defaultSymbol:(t=this.defaultSymbol)==null?void 0:t.clone(),valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,classBreakInfos:v(this.classBreakInfos),isMaxInclusive:this.isMaxInclusive,normalizationField:this.normalizationField,normalizationTotal:this.normalizationTotal,normalizationType:this.normalizationType,visualVariables:v(this.visualVariables),legendOptions:v(this.legendOptions),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}async collectRequiredFields(e,t){const s=[this.collectVVRequiredFields(e,t),this.collectSymbolFields(e,t)];await Promise.all(s)}async collectSymbolFields(e,t){const s=[...this.getSymbols().map(l=>l.collectRequiredFields(e,t)),Ce(e,t,this.valueExpression)];U(e,t,this.field),U(e,t,this.normalizationField),await Promise.all(s)}_getBreakIndexForExpression(e,t){const{viewingMode:s,scale:l,spatialReference:r,arcade:o,timeZone:u}=t??{},{valueExpression:m}=this;let c=this._compiledValueExpression.valueExpression===m?this._compiledValueExpression.compiledFunction:null;const f=o.arcadeUtils;if(!c){const g=f.createSyntaxTree(m);c=f.createFunction(g),this._compiledValueExpression.compiledFunction=c}this._compiledValueExpression.valueExpression=m;const S=f.executeFunction(c,f.createExecContext(e,f.getViewInfo({viewingMode:s,scale:l,spatialReference:r}),u));return this._getBreakIndexfromInfos(S)}_getBreakIndexForField(e){const t=this.field,s=e.attributes,l=this.normalizationType;let r=parseFloat(s[t]);if(l){const o=this.normalizationTotal,u=parseFloat(this.normalizationField?s[this.normalizationField]:void 0);if(l===vt)r=Math.log(r)*Math.LOG10E;else if(l!==he||o==null||isNaN(o)){if(l===de&&!isNaN(u)){if(isNaN(r)||isNaN(u))return-1;r/=u}}else r=r/o*100}return this._getBreakIndexfromInfos(r)}_getBreakIndexfromInfos(e){const t=this.isMaxInclusive;if(e!=null&&typeof e=="number"&&!isNaN(e))for(let s=0;sFt(e),json:{write:!0}})],y.prototype,"normalizationTotal",void 0),i([a({type:re.apiValues,value:null,json:{type:re.jsonValues,read:re.read,write:re.write}})],y.prototype,"normalizationType",null),i([ot({classBreaks:"class-breaks"})],y.prototype,"type",void 0),i([a({type:String,json:{write:!0}})],y.prototype,"valueExpression",void 0),i([a({type:String,json:{write:!0}})],y.prototype,"valueExpressionTitle",void 0),y=Be=i([d("esri.renderers.ClassBreaksRenderer")],y);const gs=y;let A=class extends Ge(V){constructor(t){super(t),this.value=null,this.value2=null,this.value3=null}};i([a(pe)],A.prototype,"value",void 0),i([a(pe)],A.prototype,"value2",void 0),i([a(pe)],A.prototype,"value3",void 0),A=i([d("esri.renderers.support.UniqueValue")],A);const L=A;let k=class extends Ge(V){constructor(t){super(t),this.description=null,this.label=null,this.symbol=null,this.values=null}castValues(t){if(t==null)return null;const s=typeof(t=Array.isArray(t)?t:[t])[0];return s==="string"||s==="number"?t.map(l=>new L({value:l})):s==="object"?t[0]instanceof L?t:t.map(l=>new L(l)):null}};i([a({type:String,json:{write:!0}})],k.prototype,"description",void 0),i([a({type:String,json:{write:!0}})],k.prototype,"label",void 0),i([a(fe)],k.prototype,"symbol",void 0),i([a({type:[L],json:{type:[[String]],read:{reader:e=>e?e.map(t=>new L({value:t[0],value2:t[1],value3:t[2]})):null},write:{writer:(e,t)=>{const s=[];for(const l of e){const r=[l.value,l.value2,l.value3].filter(Et).map(o=>o.toString());s.push(r)}t.values=s}}}})],k.prototype,"values",void 0),i([B("values")],k.prototype,"castValues",null),k=i([d("esri.renderers.support.UniqueValueClass")],k);const bt=k;let X=class extends Ge(V){constructor(e){super(e),this.heading=null,this.classes=null}};i([a({type:String,json:{write:!0}})],X.prototype,"heading",void 0),i([a({type:[bt],json:{write:!0}})],X.prototype,"classes",void 0),X=i([d("esri.renderers.support.UniqueValueGroup")],X);const De=X;var Me;let C=Me=class extends V{constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.value=null}clone(){return new Me({value:this.value,description:this.description,label:this.label,symbol:this.symbol?this.symbol.clone():null})}getMeshHash(){var t;const e=JSON.stringify((t=this.symbol)==null?void 0:t.toJSON());return`${this.value}.${e}`}};i([a({type:String,json:{write:!0}})],C.prototype,"description",void 0),i([a({type:String,json:{write:!0}})],C.prototype,"label",void 0),i([a(mt)],C.prototype,"symbol",void 0),i([a(pe)],C.prototype,"value",void 0),C=Me=i([d("esri.renderers.support.UniqueValueInfo")],C);const K=C;var Y;const gt="esri.renderers.UniqueValueRenderer",F=()=>w.getLogger(gt),et="uvInfos-watcher",tt="uvGroups-watcher",as=",",rs=at(K);function os(e){const{field1:t,field2:s,field3:l,fieldDelimiter:r,uniqueValueInfos:o,valueExpression:u}=e,m=!(!t||!s);return[{classes:(o??[]).map(c=>{var D;const{symbol:f,label:S,value:g,description:z}=c,[H,P,J]=m?((D=g==null?void 0:g.toString())==null?void 0:D.split(r||""))||[]:[g],j=[];return(t||u)&&j.push(H),s&&j.push(P),l&&j.push(J),{symbol:f,label:S,values:[j],description:z}})}]}let p=Y=class extends yt(nt){constructor(e){super(e),this._valueInfoMap={},this._isDefaultSymbolDerived=!1,this._isInfosSource=null,this.type="unique-value",this.backgroundFillSymbol=null,this.orderByClassesEnabled=!1,this.valueExpressionTitle=null,this.legendOptions=null,this.defaultLabel=null,this.portal=null,this.styleOrigin=null,this.diff={uniqueValueInfos(t,s){if(!t&&!s)return;if(!t||!s)return{type:"complete",oldValue:t,newValue:s};let l=!1;const r={type:"collection",added:[],removed:[],changed:[],unchanged:[]};for(let o=0;om.value===s[o].value);u?Ut(u,s[o])?(r.changed.push({type:"complete",oldValue:u,newValue:s[o]}),l=!0):r.unchanged.push({oldValue:u,newValue:s[o]}):(r.added.push(s[o]),l=!0)}for(let o=0;ou.value===t[o].value)||(r.removed.push(t[o]),l=!0);return l?r:void 0}},this._set("uniqueValueInfos",[]),this._set("uniqueValueGroups",[])}get _cache(){return{compiledFunc:null}}set field(e){this._set("field",e),this._updateFieldDelimiter(),this._updateUniqueValues()}castField(e){return e==null||typeof e=="function"?e:Ne(e)}writeField(e,t,s,l){typeof e=="string"?t[s]=e:l!=null&&l.messages?l.messages.push(new Re("property:unsupported","UniqueValueRenderer.field set to a function cannot be written to JSON")):F().error(".field: cannot write field to JSON since it's not a string value")}set field2(e){this._set("field2",e),this._updateFieldDelimiter(),this._updateUniqueValues()}set field3(e){this._set("field3",e),this._updateUniqueValues()}set valueExpression(e){this._set("valueExpression",e),this._updateUniqueValues()}set defaultSymbol(e){this._isDefaultSymbolDerived=!1,this._set("defaultSymbol",e)}set fieldDelimiter(e){this._set("fieldDelimiter",e),this._updateUniqueValues()}readPortal(e,t,s){return s.portal||Ve.getDefault()}readStyleOrigin(e,t,s){if(t.styleName)return Object.freeze({styleName:t.styleName});if(t.styleUrl){const l=qt(t.styleUrl,s);return Object.freeze({styleUrl:l})}}writeStyleOrigin(e,t,s,l){e.styleName?t.styleName=e.styleName:e.styleUrl&&(t.styleUrl=Tt(e.styleUrl,l))}set uniqueValueGroups(e){this.styleOrigin?F().error("#uniqueValueGroups=","Cannot modify unique value groups of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueGroups",e),this._updateInfosFromGroups(),this._isInfosSource=!1,this._watchUniqueValueGroups())}set uniqueValueInfos(e){this.styleOrigin?F().error("#uniqueValueInfos=","Cannot modify unique value infos of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueInfos",e),this._updateValueInfoMap(),this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos())}addUniqueValueInfo(e,t){var l;if(this.styleOrigin)return void F().error("#addUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");let s;s=typeof e=="object"?rs(e):new K({value:e,symbol:rt(t)}),(l=this.uniqueValueInfos)==null||l.push(s),this._valueInfoMap[s.value]=s,this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos()}removeUniqueValueInfo(e){if(this.styleOrigin)return void F().error("#removeUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");const t=this.uniqueValueInfos;if(t)for(let s=0;se+t.getAttributeHash(),"")}getMeshHash(){var l;const e=JSON.stringify(this.backgroundFillSymbol),t=JSON.stringify(this.defaultSymbol),s=(l=this.uniqueValueInfos)==null?void 0:l.reduce((r,o)=>r+o.getMeshHash(),"");return`${e}.${t}.${s}.${`${this.field}.${this.field2}.${this.field3}.${this.fieldDelimiter}`}.${this.valueExpression}`}clone(){const e=new Y({field:this.field,field2:this.field2,field3:this.field3,defaultLabel:this.defaultLabel,defaultSymbol:v(this.defaultSymbol),orderByClassesEnabled:this.orderByClassesEnabled,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,fieldDelimiter:this.fieldDelimiter,visualVariables:v(this.visualVariables),legendOptions:v(this.legendOptions),authoringInfo:this.authoringInfo&&this.authoringInfo.clone(),backgroundFillSymbol:v(this.backgroundFillSymbol)});this._isDefaultSymbolDerived&&(e._isDefaultSymbolDerived=!0),e._set("portal",this.portal);const t=v(this.uniqueValueInfos),s=v(this.uniqueValueGroups);return this.styleOrigin&&(e._set("styleOrigin",Object.freeze(v(this.styleOrigin))),Object.freeze(t),Object.freeze(s)),e._set("uniqueValueInfos",t),e._updateValueInfoMap(),e._set("uniqueValueGroups",s),e._isInfosSource=this._isInfosSource,e._watchUniqueValueInfosAndGroups(),e}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}async collectRequiredFields(e,t){const s=[this.collectVVRequiredFields(e,t),this.collectSymbolFields(e,t)];await Promise.all(s)}async collectSymbolFields(e,t){const s=[...this.getSymbols().map(l=>l.collectRequiredFields(e,t)),Ce(e,t,this.valueExpression)];U(e,t,this.field),U(e,t,this.field2),U(e,t,this.field3),await Promise.all(s)}populateFromStyle(){return Ct(this.styleOrigin,{portal:this.portal}).then(e=>{var s;const t=[];return this._valueInfoMap={},e&&e.data&&Array.isArray(e.data.items)&&e.data.items.forEach(l=>{const r=new kt({styleUrl:e.styleUrl,styleName:e.styleName,portal:this.portal,name:l.name});this.defaultSymbol||l.name!==e.data.defaultItem||(this.defaultSymbol=r,this._isDefaultSymbolDerived=!0);const o=new K({value:l.name,symbol:r});t.push(o),this._valueInfoMap[l.name]=o}),this._set("uniqueValueInfos",Object.freeze(t)),this._updateGroupsFromInfos(!0),this._isInfosSource=null,this._watchUniqueValueInfos(),!this.defaultSymbol&&((s=this.uniqueValueInfos)!=null&&s.length)&&(this.defaultSymbol=this.uniqueValueInfos[0].symbol,this._isDefaultSymbolDerived=!0),this})}_updateFieldDelimiter(){this.field&&this.field2&&!this.fieldDelimiter&&this._set("fieldDelimiter",as)}_updateUniqueValues(){this._isInfosSource!=null&&(this._isInfosSource?this._updateGroupsFromInfos():this._updateInfosFromGroups())}_updateValueInfoMap(){this._valueInfoMap={};const{uniqueValueInfos:e}=this;if(e)for(const t of e)this._valueInfoMap[t.value+""]=t}_watchUniqueValueInfosAndGroups(){this._watchUniqueValueInfos(),this._watchUniqueValueGroups()}_watchUniqueValueInfos(){this.removeHandles(et);const{uniqueValueInfos:e}=this;if(e){const t=[];for(const s of e)t.push(be(()=>({symbol:s.symbol,value:s.value,label:s.label,description:s.description}),(l,r)=>{l!==r&&(this._updateGroupsFromInfos(),this._isInfosSource=!0)},{sync:!0}));this.addHandles(t,et)}}_watchUniqueValueGroups(){this.removeHandles(tt);const{uniqueValueGroups:e}=this;if(e){const t=[];for(const s of e){t.push(be(()=>({classes:s.classes}),(l,r)=>{l!==r&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}));for(const l of s.classes??[])t.push(be(()=>({symbol:l.symbol,values:l.values,label:l.label,description:l.description}),(r,o)=>{r!==o&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}))}this.addHandles(t,tt)}}_updateInfosFromGroups(){if(!this.uniqueValueGroups)return this._set("uniqueValueInfos",null),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const e=[],{field:t,field2:s,field3:l,fieldDelimiter:r,uniqueValueGroups:o,valueExpression:u}=this;if(!t&&!u)return this._set("uniqueValueInfos",e),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const m=!(!t||!s);for(const c of o)for(const f of c.classes??[]){const{symbol:S,label:g,values:z,description:H}=f;for(const P of z??[]){const{value:J,value2:j,value3:D}=P,te=[J];s&&te.push(j),l&&te.push(D);const wt=m?te.join(r||""):te[0];e.push(new K({symbol:S,label:g,value:wt,description:H}))}}this._set("uniqueValueInfos",e),this._updateValueInfoMap(),this._watchUniqueValueInfos()}_updateGroupsFromInfos(e=!1){if(!this.uniqueValueInfos)return this._set("uniqueValueGroups",null),void this._watchUniqueValueGroups();const{field:t,field2:s,valueExpression:l,fieldDelimiter:r,uniqueValueInfos:o}=this;if(!t&&!l||!o.length)return this._set("uniqueValueGroups",[]),void this._watchUniqueValueGroups();const u=!(!t||!s),m=o.map(f=>{var D;const{symbol:S,label:g,value:z,description:H}=f,[P,J,j]=u?((D=z==null?void 0:z.toString())==null?void 0:D.split(r||""))||[]:[z];return new bt({symbol:S,label:g,description:H,values:[new L({value:P,value2:J,value3:j})]})}),c=[new De({classes:m})];e&&Object.freeze(c),this._set("uniqueValueGroups",c),this._watchUniqueValueGroups()}_getUniqueValueInfo(e,t){return this.valueExpression?this._getUnqiueValueInfoForExpression(e,t):this._getUnqiueValueInfoForFields(e)}_getUnqiueValueInfoForExpression(e,t){const{viewingMode:s,scale:l,spatialReference:r,arcade:o,timeZone:u}=t??{};let m=this._cache.compiledFunc;const c=o.arcadeUtils;if(!m){const S=c.createSyntaxTree(this.valueExpression);m=c.createFunction(S),this._cache.compiledFunc=m}const f=c.executeFunction(m,c.createExecContext(e,c.getViewInfo({viewingMode:s,scale:l,spatialReference:r}),u));return this._valueInfoMap[f+""]}_getUnqiueValueInfoForFields(e){const t=this.field,s=e.attributes;let l;if(typeof t!="function"&&this.field2){const r=this.field2,o=this.field3,u=[];t&&u.push(s[t]),r&&u.push(s[r]),o&&u.push(s[o]),l=u.join(this.fieldDelimiter||"")}else typeof t=="function"?l=t(e):t&&(l=s[t]);return this._valueInfoMap[l+""]}static fromPortalStyle(e,t){const s=new Y(t==null?void 0:t.properties);s._set("styleOrigin",Object.freeze({styleName:e})),s._set("portal",(t==null?void 0:t.portal)||Ve.getDefault());const l=s.populateFromStyle();return l.catch(r=>{F().error(`#fromPortalStyle('${e}'[, ...])`,"Failed to create unique value renderer from style name",r)}),l}static fromStyleUrl(e,t){const s=new Y(t==null?void 0:t.properties);s._set("styleOrigin",Object.freeze({styleUrl:e}));const l=s.populateFromStyle();return l.catch(r=>{F().error(`#fromStyleUrl('${e}'[, ...])`,"Failed to create unique value renderer from style URL",r)}),l}};i([a({readOnly:!0})],p.prototype,"_cache",null),i([ot({uniqueValue:"unique-value"})],p.prototype,"type",void 0),i([a(ft)],p.prototype,"backgroundFillSymbol",void 0),i([a({value:null,json:{type:String,read:{source:"field1"},write:{target:"field1"}}})],p.prototype,"field",null),i([B("field")],p.prototype,"castField",null),i([G("field")],p.prototype,"writeField",null),i([a({type:String,value:null,json:{write:!0}})],p.prototype,"field2",null),i([a({type:String,value:null,json:{write:!0}})],p.prototype,"field3",null),i([a({type:Boolean,json:{name:"drawInClassOrder",default:!1,write:!0,origins:{"web-scene":{write:!1}}}})],p.prototype,"orderByClassesEnabled",void 0),i([a({type:String,value:null,json:{write:!0}})],p.prototype,"valueExpression",null),i([a({type:String,json:{write:!0}})],p.prototype,"valueExpressionTitle",void 0),i([a({type:Ae,json:{write:!0}})],p.prototype,"legendOptions",void 0),i([a({type:String,json:{write:!0}})],p.prototype,"defaultLabel",void 0),i([a(lt({...fe},{json:{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}},origins:{"web-scene":{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}}}}}}))],p.prototype,"defaultSymbol",null),i([a({type:String,value:null,json:{write:!0}})],p.prototype,"fieldDelimiter",null),i([a({type:Ve,readOnly:!0})],p.prototype,"portal",void 0),i([_("portal",["styleName"])],p.prototype,"readPortal",null),i([a({readOnly:!0,json:{write:{enabled:!1,overridePolicy:()=>({enabled:!0})}}})],p.prototype,"styleOrigin",void 0),i([_("styleOrigin",["styleName","styleUrl"])],p.prototype,"readStyleOrigin",null),i([G("styleOrigin",{styleName:{type:String},styleUrl:{type:String}})],p.prototype,"writeStyleOrigin",null),i([a({type:[De],json:{read:{source:["uniqueValueGroups","uniqueValueInfos"],reader:(e,t,s)=>(t.uniqueValueGroups||os(t)).map(l=>De.fromJSON(l,s))},write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],p.prototype,"uniqueValueGroups",null),i([a({type:[K],json:{read:!1,write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],p.prototype,"uniqueValueInfos",null),p=Y=i([d(gt)],p);const Ss=p;export{Ss as A,Zt as a,ct as b,dt as c,me as d,K as e,Pt as j,mt as n,nt as p,yt as v,gs as w}; +import{d as i,y as a,f as d,aU as V,aV as v,aY as I,e1 as B,aZ as _,dS as st,s as w,jC as Ne,aR as G,hX as Vt,ho as St,N as Re,f0 as it,a7 as xt,au as It,jE as U,jB as Ce,eY as _t,l0 as Le,eX as $t,l1 as lt,dv as zt,hm as ve,fa as jt,aT as at,l2 as rt,c8 as ce,hQ as Ft,c9 as ot,b4 as Ge,q as Et,ax as Ve,d5 as qt,dD as Tt,f6 as kt,g as be}from"./index-BjUNJPVf.js";import{p as Ae,a as Ot}from"./ColorStop-DCGjAKLC.js";import{m as Ut}from"./diffUtils-uUoMDFQS.js";import{m as Bt,p as Dt}from"./colorRamps-CcakIWlU.js";import{e as W,t as Mt,a as Nt,i as He}from"./sizeVariableUtils-Cmcuvw-4.js";import{viewScaleRE as Rt}from"./visualVariableUtils-BX9G5gNQ.js";import{l as ye}from"./jsonUtils-Ox5U0P0F.js";import{c as Ct}from"./styleUtils-DOUOskVZ.js";var Se;let Q=Se=class extends V{constructor(e){super(e),this.minValue=0,this.maxValue=0}clone(){return new Se({minValue:this.minValue,maxValue:this.maxValue})}};i([a({type:Number,json:{write:!0}})],Q.prototype,"minValue",void 0),i([a({type:Number,json:{write:!0}})],Q.prototype,"maxValue",void 0),Q=Se=i([d("esri.renderer.support.AuthoringInfoClassBreakInfo")],Q);var xe;let O=xe=class extends V{constructor(e){super(e),this.field="",this.normalizationField="",this.label="",this.classBreakInfos=[]}clone(){return new xe({field:this.field,normalizationField:this.normalizationField,label:this.label,classBreakInfos:v(this.classBreakInfos)})}};i([a({type:String,json:{write:!0}})],O.prototype,"field",void 0),i([a({type:String,json:{write:!0}})],O.prototype,"normalizationField",void 0),i([a({type:String,json:{write:!0}})],O.prototype,"label",void 0),i([a({type:[Q],json:{write:!0}})],O.prototype,"classBreakInfos",void 0),O=xe=i([d("esri.renderers.support.AuthoringInfoFieldInfo")],O);var Ie;const se=new I({percentTotal:"percent-of-total",ratio:"ratio",percent:"percent"}),ie=new I({sizeInfo:"size",colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation"}),Pe={key:e=>typeof e=="number"?"number":"string",typeMap:{number:Number,string:String},base:null},Je=["high-to-low","above-and-below","centered-on","extremes"],We=[...new Set(["high-to-low","above-and-below","centered-on","extremes","90-10","above","below","high-to-low","above-and-below","90-10","above","below"])],Qe=["seconds","minutes","hours","days","months","years"];let b=Ie=class extends V{constructor(e){super(e),this.endTime=null,this.field=null,this.maxSliderValue=null,this.minSliderValue=null,this.startTime=null,this.type=null,this.units=null}castEndTime(e){return typeof e=="string"||typeof e=="number"?e:null}castStartTime(e){return typeof e=="string"||typeof e=="number"?e:null}get style(){return this.type==="color"?this._get("style"):null}set style(e){this._set("style",e)}get theme(){return this.type==="color"||this.type==="size"?this._get("theme")||"high-to-low":null}set theme(e){this._set("theme",e)}clone(){return new Ie({endTime:this.endTime,field:this.field,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,startTime:this.startTime,style:this.style,theme:this.theme,type:this.type,units:this.units})}};i([a({types:Pe,json:{write:!0}})],b.prototype,"endTime",void 0),i([B("endTime")],b.prototype,"castEndTime",null),i([a({type:String,json:{write:!0}})],b.prototype,"field",void 0),i([a({type:Number,json:{write:!0}})],b.prototype,"maxSliderValue",void 0),i([a({type:Number,json:{write:!0}})],b.prototype,"minSliderValue",void 0),i([a({types:Pe,json:{write:!0}})],b.prototype,"startTime",void 0),i([B("startTime")],b.prototype,"castStartTime",null),i([a({type:se.apiValues,value:null,json:{type:se.jsonValues,read:se.read,write:se.write}})],b.prototype,"style",null),i([a({type:We,value:null,json:{type:We,origins:{"web-scene":{type:Je,write:{writer:(e,t)=>{Je.includes(e)&&(t.theme=e)}}}},write:!0}})],b.prototype,"theme",null),i([a({type:ie.apiValues,json:{type:ie.jsonValues,read:ie.read,write:ie.write}})],b.prototype,"type",void 0),i([a({type:Qe,json:{type:Qe,write:!0}})],b.prototype,"units",void 0),b=Ie=i([d("esri.renderers.support.AuthoringInfoVisualVariable")],b);const Gt=b;var _e;const M=new I({esriClassifyDefinedInterval:"defined-interval",esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation"}),le=new I({pieChart:"pie-chart",classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density",flow:"flow"}),Ze=new I({classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density"}),Xe=["inches","feet","yards","miles","nautical-miles","millimeters","centimeters","decimeters","meters","kilometers","decimal-degrees"],At=["high-to-low","above-and-below","above","below","90-10"],Lt=["flow-line","wave-front"],Ht=["caret","circle-caret","arrow","circle-arrow","plus-minus","circle-plus-minus","square","circle","triangle","happy-sad","thumb","custom"];let h=_e=class extends V{constructor(e){super(e),this.colorRamp=null,this.fadeRatio=null,this.isAutoGenerated=!1,this.lengthUnit=null,this.maxSliderValue=null,this.minSliderValue=null,this.visualVariables=null}get classificationMethod(){const e=this._get("classificationMethod"),t=this.type;return t&&t!=="relationship"?t==="class-breaks-size"||t==="class-breaks-color"?e||"manual":null:e}set classificationMethod(e){this._set("classificationMethod",e)}readColorRamp(e){return e?Dt(e):void 0}get fields(){return this.type&&this.type!=="predominance"?null:this._get("fields")}set fields(e){this._set("fields",e)}get field1(){return this.type&&this.type!=="relationship"?null:this._get("field1")}set field1(e){this._set("field1",e)}get field2(){return this.type&&this.type!=="relationship"?null:this._get("field2")}set field2(e){this._set("field2",e)}get flowTheme(){return this.type==="flow"?this._get("flowTheme"):null}set flowTheme(e){this._set("flowTheme",e)}get focus(){return this.type&&this.type!=="relationship"?null:this._get("focus")}set focus(e){this._set("focus",e)}get numClasses(){return this.type&&this.type!=="relationship"?null:this._get("numClasses")}set numClasses(e){this._set("numClasses",e)}get statistics(){return this.type==="univariate-color-size"&&this.univariateTheme==="above-and-below"?this._get("statistics"):null}set statistics(e){this._set("statistics",e)}get standardDeviationInterval(){const e=this.type;return e&&e!=="relationship"&&e!=="class-breaks-size"&&e!=="class-breaks-color"||this.classificationMethod&&this.classificationMethod!=="standard-deviation"?null:this._get("standardDeviationInterval")}set standardDeviationInterval(e){this._set("standardDeviationInterval",e)}get type(){return this._get("type")}set type(e){let t=e;e==="classed-size"?t="class-breaks-size":e==="classed-color"&&(t="class-breaks-color"),this._set("type",t)}get univariateSymbolStyle(){return this.type==="univariate-color-size"&&this.univariateTheme==="above-and-below"?this._get("univariateSymbolStyle"):null}set univariateSymbolStyle(e){this._set("univariateSymbolStyle",e)}get univariateTheme(){return this.type==="univariate-color-size"?this._get("univariateTheme"):null}set univariateTheme(e){this._set("univariateTheme",e)}clone(){var e;return new _e({classificationMethod:this.classificationMethod,colorRamp:v(this.colorRamp),fadeRatio:v(this.fadeRatio),fields:(e=this.fields)==null?void 0:e.slice(0),field1:v(this.field1),field2:v(this.field2),isAutoGenerated:this.isAutoGenerated,focus:this.focus,numClasses:this.numClasses,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,lengthUnit:this.lengthUnit,statistics:this.statistics,standardDeviationInterval:this.standardDeviationInterval,type:this.type,visualVariables:this.visualVariables&&this.visualVariables.map(t=>t.clone()),univariateSymbolStyle:this.univariateSymbolStyle,univariateTheme:this.univariateTheme,flowTheme:this.flowTheme})}};i([a({type:M.apiValues,value:null,json:{type:M.jsonValues,read:M.read,write:M.write,origins:{"web-document":{default:"manual",type:M.jsonValues,read:M.read,write:M.write}}}})],h.prototype,"classificationMethod",null),i([a({types:Bt,json:{write:!0}})],h.prototype,"colorRamp",void 0),i([_("colorRamp")],h.prototype,"readColorRamp",null),i([a({json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],h.prototype,"fadeRatio",void 0),i([a({type:[String],value:null,json:{write:!0}})],h.prototype,"fields",null),i([a({type:O,value:null,json:{write:!0}})],h.prototype,"field1",null),i([a({type:O,value:null,json:{write:!0}})],h.prototype,"field2",null),i([a({type:Lt,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],h.prototype,"flowTheme",null),i([a({type:["HH","HL","LH","LL"],value:null,json:{write:!0}})],h.prototype,"focus",null),i([a({type:Boolean,json:{write:!0,default:!1,origins:{"web-scene":{write:!1}}}})],h.prototype,"isAutoGenerated",void 0),i([a({type:Number,value:null,json:{type:st,write:!0}})],h.prototype,"numClasses",null),i([a({type:Xe,json:{type:Xe,read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],h.prototype,"lengthUnit",void 0),i([a({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],h.prototype,"maxSliderValue",void 0),i([a({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],h.prototype,"minSliderValue",void 0),i([a({type:Object,value:null,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],h.prototype,"statistics",null),i([a({type:[.25,.33,.5,1],value:null,json:{type:[.25,.33,.5,1],write:!0}})],h.prototype,"standardDeviationInterval",null),i([a({type:le.apiValues,value:null,json:{type:le.jsonValues,read:le.read,write:le.write,origins:{"web-scene":{type:Ze.jsonValues,write:{writer:Ze.write,overridePolicy:e=>({enabled:e!=="flow"})}}}}})],h.prototype,"type",null),i([a({type:[Gt],json:{write:!0}})],h.prototype,"visualVariables",void 0),i([a({type:Ht,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],h.prototype,"univariateSymbolStyle",null),i([a({type:At,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],h.prototype,"univariateTheme",null),h=_e=i([d("esri.renderers.support.AuthoringInfo")],h);const Pt=h,ge=new I({simple:"simple",uniqueValue:"unique-value",classBreaks:"class-breaks",heatmap:"heatmap",dotDensity:"dot-density",dictionary:"dictionary",pieChart:"pie-chart"},{ignoreUnknown:!0});let Z=class extends V{constructor(t){super(t),this.authoringInfo=null,this.type=null}async getRequiredFields(t){if(!this.collectRequiredFields)return[];const s=new Set;return await this.collectRequiredFields(s,t),Array.from(s).sort()}getSymbol(t,s){}async getSymbolAsync(t,s){}getSymbols(){return[]}getAttributeHash(){return JSON.stringify(this)}getMeshHash(){return JSON.stringify(this)}};i([a({type:Pt,json:{write:!0}})],Z.prototype,"authoringInfo",void 0),i([a({type:ge.apiValues,readOnly:!0,json:{type:ge.jsonValues,read:!1,write:{writer:ge.write,ignoreOrigin:!0}}})],Z.prototype,"type",void 0),Z=i([d("esri.renderers.Renderer")],Z);const nt=Z;function Jt(e){var t,s;return((s=(t=e.match(Wt))==null?void 0:t[1])==null?void 0:s.replace(/\\'/g,"'"))??null}const Wt=/^hash\(\$feature\['((\\'|[^'])+)'\]\) \* 8\.381e-8$/;var $e;let oe=$e=class extends Ae{constructor(){super(...arguments),this.showLegend=null}clone(){return new $e({title:this.title,showLegend:this.showLegend})}};i([a({type:Boolean,json:{write:!0}})],oe.prototype,"showLegend",void 0),oe=$e=i([d("esri.renderers.visualVariables.support.VisualVariableLegendOptions")],oe);const ut=oe,we=new I({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"});let x=class extends V{constructor(t){super(t),this.index=null,this.type=null,this.field=null,this.valueExpression=null,this.valueExpressionTitle=null,this.legendOptions=null}castField(t){return t==null?t:typeof t=="function"?(w.getLogger(this).error(".field: field must be a string value"),null):Ne(t)}get arcadeRequired(){return!!this.valueExpression}clone(){}getAttributeHash(){return`${this.type}-${this.field}-${this.valueExpression}`}};i([a()],x.prototype,"index",void 0),i([a({type:we.apiValues,readOnly:!0,json:{read:we.read,write:we.write}})],x.prototype,"type",void 0),i([a({type:String,json:{write:!0}})],x.prototype,"field",void 0),i([B("field")],x.prototype,"castField",null),i([a({type:String,json:{write:!0}})],x.prototype,"valueExpression",void 0),i([a({type:String,json:{write:!0}})],x.prototype,"valueExpressionTitle",void 0),i([a({readOnly:!0})],x.prototype,"arcadeRequired",null),i([a({type:ut,json:{write:!0}})],x.prototype,"legendOptions",void 0),x=i([d("esri.renderers.visualVariables.VisualVariable")],x);const ee=x;var ze;let N=ze=class extends ee{constructor(e){super(e),this.type="color",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(e){e&&Array.isArray(e)&&(e=e.filter(t=>!!t)).sort((t,s)=>t.value-s.value),this._set("stops",e)}clone(){var e;return new ze({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(t=>t.clone()),legendOptions:(e=this.legendOptions)==null?void 0:e.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(e=>e.value||0)}};i([a({readOnly:!0})],N.prototype,"cache",null),i([a({type:["color"],json:{type:["colorInfo"]}})],N.prototype,"type",void 0),i([a({type:String,json:{write:!0}})],N.prototype,"normalizationField",void 0),i([a({type:[Ot],json:{write:!0}})],N.prototype,"stops",null),N=ze=i([d("esri.renderers.visualVariables.ColorVariable")],N);const pt=N;var je;let E=je=class extends V{constructor(e){super(e),this.label=null,this.opacity=null,this.value=null}readOpacity(e,t){return Vt(t.transparency)}writeOpacity(e,t,s){t[s]=St(e)}clone(){return new je({label:this.label,opacity:this.opacity,value:this.value})}};i([a({type:String,json:{write:!0}})],E.prototype,"label",void 0),i([a({type:Number,json:{type:st,write:{target:"transparency"}}})],E.prototype,"opacity",void 0),i([_("opacity",["transparency"])],E.prototype,"readOpacity",null),i([G("opacity")],E.prototype,"writeOpacity",null),i([a({type:Number,json:{write:!0}})],E.prototype,"value",void 0),E=je=i([d("esri.renderers.visualVariables.support.OpacityStop")],E);const Qt=E;var Fe;let R=Fe=class extends ee{constructor(e){super(e),this.type="opacity",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(e){e&&Array.isArray(e)&&(e=e.filter(t=>!!t)).sort((t,s)=>t.value-s.value),this._set("stops",e)}clone(){var e;return new Fe({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(t=>t.clone()),legendOptions:(e=this.legendOptions)==null?void 0:e.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(e=>e.value||0)}};i([a({readOnly:!0})],R.prototype,"cache",null),i([a({type:["opacity"],json:{type:["transparencyInfo"]}})],R.prototype,"type",void 0),i([a({type:String,json:{write:!0}})],R.prototype,"normalizationField",void 0),i([a({type:[Qt],json:{write:!0}})],R.prototype,"stops",null),R=Fe=i([d("esri.renderers.visualVariables.OpacityVariable")],R);const ht=R;var Ee;let $=Ee=class extends ee{constructor(e){super(e),this.axis=null,this.type="rotation",this.rotationType="geographic",this.valueExpressionTitle=null}get cache(){return{hasExpression:!!this.valueExpression,compiledFunc:null}}writeValueExpressionTitleWebScene(e,t,s,l){if(l!=null&&l.messages){const r=`visualVariables[${this.index}]`;l.messages.push(new Re("property:unsupported",this.type+"VisualVariable.valueExpressionTitle is not supported in Web Scene. Please remove this property to save the Web Scene.",{instance:this,propertyName:r+".valueExpressionTitle",context:l}))}}clone(){var e;return new Ee({axis:this.axis,rotationType:this.rotationType,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,legendOptions:(e=this.legendOptions)==null?void 0:e.clone()})}};i([a({readOnly:!0})],$.prototype,"cache",null),i([a({type:["heading","tilt","roll"],json:{origins:{"web-scene":{default:"heading",write:!0}}}})],$.prototype,"axis",void 0),i([a({type:["rotation"],json:{type:["rotationInfo"]}})],$.prototype,"type",void 0),i([a({type:["geographic","arithmetic"],json:{write:!0,origins:{"web-document":{write:!0,default:"geographic"}}}})],$.prototype,"rotationType",void 0),i([a({type:String,json:{write:!0}})],$.prototype,"valueExpressionTitle",void 0),i([G("web-scene","valueExpressionTitle")],$.prototype,"writeValueExpressionTitleWebScene",null),$=Ee=i([d("esri.renderers.visualVariables.RotationVariable")],$);const dt=$;var qe;let q=qe=class extends V{constructor(e){super(e),this.label=null,this.size=null,this.value=null,this.useMinValue=null,this.useMaxValue=null}clone(){return new qe({label:this.label,size:this.size,value:this.value,useMaxValue:this.useMaxValue,useMinValue:this.useMinValue})}};i([a({type:String,json:{write:!0}})],q.prototype,"label",void 0),i([a({type:Number,cast:it,json:{write:!0}})],q.prototype,"size",void 0),i([a({type:Number,json:{write:!0}})],q.prototype,"value",void 0),i([a({type:Boolean,json:{write:!1}})],q.prototype,"useMinValue",void 0),i([a({type:Boolean,json:{write:!1}})],q.prototype,"useMaxValue",void 0),q=qe=i([d("esri.renderers.visualVariables.support.SizeStop")],q);const Zt=q;var Te;let ne=Te=class extends ut{constructor(){super(...arguments),this.customValues=null}clone(){var e;return new Te({title:this.title,showLegend:this.showLegend,customValues:(e=this.customValues)==null?void 0:e.slice(0)})}};i([a({type:[Number],json:{write:!0}})],ne.prototype,"customValues",void 0),ne=Te=i([d("esri.renderers.visualVariables.support.SizeVariableLegendOptions")],ne);const Xt=ne;var ke;const ae=new I({width:"width",depth:"depth",height:"height",widthAndDepth:"width-and-depth",all:"all"}),Oe=new I({unknown:"unknown",inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers","decimal-degree":"decimal-degrees"});function Ye(e){if(e!=null)return typeof e=="string"||typeof e=="number"?it(e):e.type==="size"?W(e)?e:(delete(e={...e}).type,new n(e)):void 0}function Ke(e,t,s){if(typeof e!="object")return e;const l=new n;return l.read(e,s),l}let n=ke=class extends ee{constructor(e){super(e),this.axis=null,this.legendOptions=null,this.normalizationField=null,this.scaleBy=null,this.target=null,this.type="size",this.useSymbolValue=null,this.valueExpression=null,this.valueRepresentation=null,this.valueUnit=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null,isScaleDriven:this.valueExpression!=null&&Rt.test(this.valueExpression)}}set expression(e){w.getLogger(this).warn("'expression' is deprecated since version 4.2. Use 'valueExpression' instead. The only supported expression is 'view.scale'."),e==="view.scale"?(this.valueExpression="$view.scale",this._set("expression",e)):this._set("expression",null)}set index(e){W(this.maxSize)&&(this.maxSize.index=`visualVariables[${e}].maxSize`),W(this.minSize)&&(this.minSize.index=`visualVariables[${e}].minSize`),this._set("index",e)}get inputValueType(){return Mt(this)}set maxDataValue(e){e&&this.stops&&(w.getLogger(this).warn("cannot set maxDataValue when stops is not null."),e=null),this._set("maxDataValue",e)}set maxSize(e){e&&this.stops&&(w.getLogger(this).warn("cannot set maxSize when stops is not null."),e=null),this._set("maxSize",e)}castMaxSize(e){return Ye(e)}readMaxSize(e,t,s){return Ke(e,t,s)}set minDataValue(e){e&&this.stops&&(w.getLogger(this).warn("cannot set minDataValue when stops is not null."),e=null),this._set("minDataValue",e)}set minSize(e){e&&this.stops&&(w.getLogger(this).warn("cannot set minSize when stops is not null."),e=null),this._set("minSize",e)}castMinSize(e){return Ye(e)}readMinSize(e,t,s){return Ke(e,t,s)}get arcadeRequired(){return!!this.valueExpression||this.minSize!=null&&typeof this.minSize=="object"&&this.minSize.arcadeRequired||this.maxSize!=null&&typeof this.maxSize=="object"&&this.maxSize.arcadeRequired}set stops(e){this.minDataValue==null&&this.maxDataValue==null&&this.minSize==null&&this.maxSize==null?e&&Array.isArray(e)&&(e=e.filter(t=>!!t)).sort((t,s)=>t.value-s.value):e&&(w.getLogger(this).warn("cannot set stops when one of minDataValue, maxDataValue, minSize or maxSize is not null."),e=null),this._set("stops",e)}get transformationType(){return Nt(this,this.inputValueType)}readValueExpression(e,t){return e||t.expression&&"$view.scale"}writeValueExpressionWebScene(e,t,s,l){if(e==="$view.scale"){if(l!=null&&l.messages){const r=this.index,o=typeof r=="string"?r:`visualVariables[${r}]`;l.messages.push(new Re("property:unsupported",this.type+"VisualVariable.valueExpression = '$view.scale' is not supported in Web Scene. Please remove this property to save the Web Scene.",{instance:this,propertyName:o+".valueExpression",context:l}))}}else t[s]=e}readValueUnit(e){return e?Oe.read(e):null}clone(){var e,t;return new ke({axis:this.axis,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,maxDataValue:this.maxDataValue,maxSize:W(this.maxSize)?this.maxSize.clone():this.maxSize,minDataValue:this.minDataValue,minSize:W(this.minSize)?this.minSize.clone():this.minSize,normalizationField:this.normalizationField,stops:(e=this.stops)==null?void 0:e.map(s=>s.clone()),target:this.target,useSymbolValue:this.useSymbolValue,valueRepresentation:this.valueRepresentation,valueUnit:this.valueUnit,legendOptions:(t=this.legendOptions)==null?void 0:t.clone()})}flipSizes(){if(this.transformationType===He.ClampedLinear){const{minSize:e,maxSize:t}=this;return this.minSize=t,this.maxSize=e,this}if(this.transformationType===He.Stops){const e=this.stops;if(!e)return this;const t=e.map(l=>l.size).reverse(),s=e.length;for(let l=0;lt.value||0)}};i([a({readOnly:!0})],n.prototype,"cache",null),i([a({type:ae.apiValues,json:{type:ae.jsonValues,origins:{"web-map":{read:!1}},read:ae.read,write:ae.write}})],n.prototype,"axis",void 0),i([a({type:String,value:null,json:{read:!1}})],n.prototype,"expression",null),i([a()],n.prototype,"index",null),i([a({type:String,readOnly:!0})],n.prototype,"inputValueType",null),i([a({type:Xt,json:{write:!0}})],n.prototype,"legendOptions",void 0),i([a({type:Number,value:null,json:{write:!0}})],n.prototype,"maxDataValue",null),i([a({type:Number,value:null,json:{write:!0}})],n.prototype,"maxSize",null),i([B("maxSize")],n.prototype,"castMaxSize",null),i([_("maxSize")],n.prototype,"readMaxSize",null),i([a({type:Number,value:null,json:{write:!0}})],n.prototype,"minDataValue",null),i([a({type:Number,value:null,json:{write:!0}})],n.prototype,"minSize",null),i([B("minSize")],n.prototype,"castMinSize",null),i([_("minSize")],n.prototype,"readMinSize",null),i([a({type:String,json:{write:!0}})],n.prototype,"normalizationField",void 0),i([a({readOnly:!0})],n.prototype,"arcadeRequired",null),i([a({type:String})],n.prototype,"scaleBy",void 0),i([a({type:[Zt],value:null,json:{write:!0}})],n.prototype,"stops",null),i([a({type:["outline"],json:{write:!0}})],n.prototype,"target",void 0),i([a({type:String,readOnly:!0})],n.prototype,"transformationType",null),i([a({type:["size"],json:{type:["sizeInfo"]}})],n.prototype,"type",void 0),i([a({type:Boolean,json:{write:!0,origins:{"web-map":{read:!1}}}})],n.prototype,"useSymbolValue",void 0),i([a({type:String,json:{write:!0}})],n.prototype,"valueExpression",void 0),i([_("valueExpression",["valueExpression","expression"])],n.prototype,"readValueExpression",null),i([G("web-scene","valueExpression")],n.prototype,"writeValueExpressionWebScene",null),i([a({type:["radius","diameter","area","width","distance"],json:{write:!0}})],n.prototype,"valueRepresentation",void 0),i([a({type:Oe.apiValues,json:{write:Oe.write,origins:{"web-map":{read:!1},"web-scene":{write:!0},"portal-item":{write:!0}}}})],n.prototype,"valueUnit",void 0),i([_("valueUnit")],n.prototype,"readValueUnit",null),n=ke=i([d("esri.renderers.visualVariables.SizeVariable")],n);const ct=n,Yt={color:pt,size:ct,opacity:ht,rotation:dt},Kt=new I({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"}),es=/^\[([^\]]+)\]$/i;let ue=class extends xt{constructor(){super(...arguments),this.colorVariables=null,this.opacityVariables=null,this.rotationVariables=null,this.sizeVariables=null}set visualVariables(t){if(this._resetVariables(),t=t&&t.filter(s=>!!s),t==null?void 0:t.length){for(const s of t)switch(s.type){case"color":this.colorVariables.push(s);break;case"opacity":this.opacityVariables.push(s);break;case"rotation":this.rotationVariables.push(s);break;case"size":this.sizeVariables.push(s)}this.sizeVariables.length&&this.sizeVariables.some(s=>!!s.target)&&t.sort((s,l)=>{let r=null;return r=s.target===l.target?0:s.target?1:-1,r});for(let s=0;s{const f=Kt.read(c.type),S=Yt[f];S||(w.getLogger(this).warn(`Unknown variable type: ${f}`),l!=null&&l.messages&&l.messages.push(new It("visual-variable:unsupported",`visualVariable of type '${f}' is not supported`,{definition:c,context:l})));const g=new S;return g.read(c,l),g})}writeVariables(t,s){const l=[];for(const r of t){const o=r.toJSON(s);o&&l.push(o)}return l}_resetVariables(){this.colorVariables=[],this.opacityVariables=[],this.rotationVariables=[],this.sizeVariables=[]}};i([a()],ue.prototype,"visualVariables",null),ue=i([d("esri.renderers.visualVariables.VisualVariableFactory")],ue);const ts=ue,ss={base:ee,key:"type",typeMap:{opacity:ht,color:pt,rotation:dt,size:ct}},yt=e=>{let t=class extends e{constructor(){super(...arguments),this._vvFactory=new ts}set visualVariables(s){this._vvFactory.visualVariables=s,this._set("visualVariables",this._vvFactory.visualVariables)}readVisualVariables(s,l,r){return this._vvFactory.readVariables(s,l,r)}writeVisualVariables(s,l,r,o){l[r]=this._vvFactory.writeVariables(s,o)}get arcadeRequiredForVisualVariables(){if(!this.visualVariables)return!1;for(const s of this.visualVariables)if(s.arcadeRequired)return!0;return!1}hasVisualVariables(s,l){return s?this.getVisualVariablesForType(s,l).length>0:this.getVisualVariablesForType("size",l).length>0||this.getVisualVariablesForType("color",l).length>0||this.getVisualVariablesForType("opacity",l).length>0||this.getVisualVariablesForType("rotation",l).length>0}getVisualVariablesForType(s,l){const r=this.visualVariables;return r?r.filter(o=>o.type===s&&(typeof l=="string"?o.target===l:l!==!1||!o.target)):[]}async collectVVRequiredFields(s,l){let r=[];this.visualVariables&&(r=r.concat(this.visualVariables));for(const o of r)o&&(o.field&&U(s,l,o.field),o.normalizationField&&U(s,l,o.normalizationField),o.valueExpression&&(is(o.valueExpression,s,l)||await Ce(s,l,o.valueExpression)))}};return i([a({types:[ss],value:null,json:{write:!0}})],t.prototype,"visualVariables",null),i([_("visualVariables",["visualVariables","rotationType","rotationExpression"])],t.prototype,"readVisualVariables",null),i([G("visualVariables")],t.prototype,"writeVisualVariables",null),t=i([d("esri.renderers.mixins.VisualVariablesMixin")],t),t};function is(e,t,s){const l=Jt(e);return l!=null&&(U(t,s,l),!0)}const fe={types:_t,json:{write:{writer:ye},origins:{"web-scene":{types:Le,write:{writer:ye},read:{reader:$t({types:Le})}}}}},mt=lt({json:{origins:{"web-scene":{write:{isRequired:!0}}}}},fe),ft={types:{base:zt,key:"type",typeMap:{"simple-fill":ve.typeMap["simple-fill"],"picture-fill":ve.typeMap["picture-fill"],"polygon-3d":ve.typeMap["polygon-3d"]}},json:{write:{writer:ye},origins:{"web-scene":{type:jt,write:{writer:ye}}}}},pe={cast:e=>e==null||typeof e=="string"||typeof e=="number"?e:`${e}`,json:{type:String,write:{writer:(e,t)=>{t.value=e==null?void 0:e.toString()}}}};var Ue;let T=Ue=class extends V{constructor(e){super(e),this.description=null,this.label=null,this.minValue=null,this.maxValue=0,this.symbol=null}clone(){return new Ue({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,symbol:this.symbol?this.symbol.clone():null})}getMeshHash(){const e=JSON.stringify(this.symbol);return`${this.minValue}.${this.maxValue}.${e}`}};i([a({type:String,json:{write:!0}})],T.prototype,"description",void 0),i([a({type:String,json:{write:!0}})],T.prototype,"label",void 0),i([a({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],T.prototype,"minValue",void 0),i([a({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],T.prototype,"maxValue",void 0),i([a(mt)],T.prototype,"symbol",void 0),T=Ue=i([d("esri.renderers.support.ClassBreakInfo")],T);const me=T;var Be;const vt="log",he="percent-of-total",de="field",re=new I({esriNormalizeByLog:vt,esriNormalizeByPercentOfTotal:he,esriNormalizeByField:de}),ls=at(me);let y=Be=class extends yt(nt){constructor(e){super(e),this._compiledValueExpression={valueExpression:null,compiledFunction:null},this.backgroundFillSymbol=null,this.classBreakInfos=null,this.defaultLabel=null,this.defaultSymbol=null,this.field=null,this.isMaxInclusive=!0,this.legendOptions=null,this.normalizationField=null,this.normalizationTotal=null,this.type="class-breaks",this.valueExpression=null,this.valueExpressionTitle=null,this._set("classBreakInfos",[])}readClassBreakInfos(e,t,s){if(!Array.isArray(e))return;let l=t.minValue;return e.map(r=>{const o=new me;return o.read(r,s),o.minValue==null&&(o.minValue=l),o.maxValue==null&&(o.maxValue=o.minValue),l=o.maxValue,o})}writeClassBreakInfos(e,t,s,l){const r=e.map(o=>o.write({},l));this._areClassBreaksConsecutive()&&r.forEach(o=>delete o.classMinValue),t[s]=r}castField(e){return e==null?e:typeof e=="function"?(w.getLogger(this).error(".field: field must be a string value"),null):Ne(e)}get minValue(){return this.classBreakInfos&&this.classBreakInfos[0]&&this.classBreakInfos[0].minValue||0}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,s=this.normalizationTotal!=null;return t||s?(e=t&&de||s&&he||null,t&&s&&w.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==de&&e!==he||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}addClassBreakInfo(e,t,s){let l=null;l=typeof e=="number"?new me({minValue:e,maxValue:t,symbol:rt(s)}):ls(v(e)),this.classBreakInfos.push(l),this.classBreakInfos.length===1&&this.notifyChange("minValue")}removeClassBreakInfo(e,t){const s=this.classBreakInfos.length;for(let l=0;l-1?this.classBreakInfos[s].symbol:this.defaultSymbol}async getSymbolAsync(e,t){let s=t;if(this.valueExpression&&(t==null?void 0:t.arcade)==null){const r=await ce(),{arcadeUtils:o}=r;o.hasGeometryOperations(this.valueExpression)&&await o.enableGeometryOperations(),s={...s,arcade:r}}const l=this.getBreakIndex(e,s);return l>-1?this.classBreakInfos[l].symbol:this.defaultSymbol}getSymbols(){const e=[];return this.classBreakInfos.forEach(t=>{t.symbol&&e.push(t.symbol)}),this.defaultSymbol&&e.push(this.defaultSymbol),e}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((e,t)=>e+t.getAttributeHash(),"")}getMeshHash(){const e=JSON.stringify(this.backgroundFillSymbol),t=JSON.stringify(this.defaultSymbol),s=`${this.normalizationField}.${this.normalizationType}.${this.normalizationTotal}`;return`${e}.${t}.${this.classBreakInfos.reduce((l,r)=>l+r.getMeshHash(),"")}.${s}.${this.field}.${this.valueExpression}`}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}clone(){var e,t;return new Be({field:this.field,backgroundFillSymbol:(e=this.backgroundFillSymbol)==null?void 0:e.clone(),defaultLabel:this.defaultLabel,defaultSymbol:(t=this.defaultSymbol)==null?void 0:t.clone(),valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,classBreakInfos:v(this.classBreakInfos),isMaxInclusive:this.isMaxInclusive,normalizationField:this.normalizationField,normalizationTotal:this.normalizationTotal,normalizationType:this.normalizationType,visualVariables:v(this.visualVariables),legendOptions:v(this.legendOptions),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}async collectRequiredFields(e,t){const s=[this.collectVVRequiredFields(e,t),this.collectSymbolFields(e,t)];await Promise.all(s)}async collectSymbolFields(e,t){const s=[...this.getSymbols().map(l=>l.collectRequiredFields(e,t)),Ce(e,t,this.valueExpression)];U(e,t,this.field),U(e,t,this.normalizationField),await Promise.all(s)}_getBreakIndexForExpression(e,t){const{viewingMode:s,scale:l,spatialReference:r,arcade:o,timeZone:u}=t??{},{valueExpression:m}=this;let c=this._compiledValueExpression.valueExpression===m?this._compiledValueExpression.compiledFunction:null;const f=o.arcadeUtils;if(!c){const g=f.createSyntaxTree(m);c=f.createFunction(g),this._compiledValueExpression.compiledFunction=c}this._compiledValueExpression.valueExpression=m;const S=f.executeFunction(c,f.createExecContext(e,f.getViewInfo({viewingMode:s,scale:l,spatialReference:r}),u));return this._getBreakIndexfromInfos(S)}_getBreakIndexForField(e){const t=this.field,s=e.attributes,l=this.normalizationType;let r=parseFloat(s[t]);if(l){const o=this.normalizationTotal,u=parseFloat(this.normalizationField?s[this.normalizationField]:void 0);if(l===vt)r=Math.log(r)*Math.LOG10E;else if(l!==he||o==null||isNaN(o)){if(l===de&&!isNaN(u)){if(isNaN(r)||isNaN(u))return-1;r/=u}}else r=r/o*100}return this._getBreakIndexfromInfos(r)}_getBreakIndexfromInfos(e){const t=this.isMaxInclusive;if(e!=null&&typeof e=="number"&&!isNaN(e))for(let s=0;sFt(e),json:{write:!0}})],y.prototype,"normalizationTotal",void 0),i([a({type:re.apiValues,value:null,json:{type:re.jsonValues,read:re.read,write:re.write}})],y.prototype,"normalizationType",null),i([ot({classBreaks:"class-breaks"})],y.prototype,"type",void 0),i([a({type:String,json:{write:!0}})],y.prototype,"valueExpression",void 0),i([a({type:String,json:{write:!0}})],y.prototype,"valueExpressionTitle",void 0),y=Be=i([d("esri.renderers.ClassBreaksRenderer")],y);const gs=y;let A=class extends Ge(V){constructor(t){super(t),this.value=null,this.value2=null,this.value3=null}};i([a(pe)],A.prototype,"value",void 0),i([a(pe)],A.prototype,"value2",void 0),i([a(pe)],A.prototype,"value3",void 0),A=i([d("esri.renderers.support.UniqueValue")],A);const L=A;let k=class extends Ge(V){constructor(t){super(t),this.description=null,this.label=null,this.symbol=null,this.values=null}castValues(t){if(t==null)return null;const s=typeof(t=Array.isArray(t)?t:[t])[0];return s==="string"||s==="number"?t.map(l=>new L({value:l})):s==="object"?t[0]instanceof L?t:t.map(l=>new L(l)):null}};i([a({type:String,json:{write:!0}})],k.prototype,"description",void 0),i([a({type:String,json:{write:!0}})],k.prototype,"label",void 0),i([a(fe)],k.prototype,"symbol",void 0),i([a({type:[L],json:{type:[[String]],read:{reader:e=>e?e.map(t=>new L({value:t[0],value2:t[1],value3:t[2]})):null},write:{writer:(e,t)=>{const s=[];for(const l of e){const r=[l.value,l.value2,l.value3].filter(Et).map(o=>o.toString());s.push(r)}t.values=s}}}})],k.prototype,"values",void 0),i([B("values")],k.prototype,"castValues",null),k=i([d("esri.renderers.support.UniqueValueClass")],k);const bt=k;let X=class extends Ge(V){constructor(e){super(e),this.heading=null,this.classes=null}};i([a({type:String,json:{write:!0}})],X.prototype,"heading",void 0),i([a({type:[bt],json:{write:!0}})],X.prototype,"classes",void 0),X=i([d("esri.renderers.support.UniqueValueGroup")],X);const De=X;var Me;let C=Me=class extends V{constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.value=null}clone(){return new Me({value:this.value,description:this.description,label:this.label,symbol:this.symbol?this.symbol.clone():null})}getMeshHash(){var t;const e=JSON.stringify((t=this.symbol)==null?void 0:t.toJSON());return`${this.value}.${e}`}};i([a({type:String,json:{write:!0}})],C.prototype,"description",void 0),i([a({type:String,json:{write:!0}})],C.prototype,"label",void 0),i([a(mt)],C.prototype,"symbol",void 0),i([a(pe)],C.prototype,"value",void 0),C=Me=i([d("esri.renderers.support.UniqueValueInfo")],C);const K=C;var Y;const gt="esri.renderers.UniqueValueRenderer",F=()=>w.getLogger(gt),et="uvInfos-watcher",tt="uvGroups-watcher",as=",",rs=at(K);function os(e){const{field1:t,field2:s,field3:l,fieldDelimiter:r,uniqueValueInfos:o,valueExpression:u}=e,m=!(!t||!s);return[{classes:(o??[]).map(c=>{var D;const{symbol:f,label:S,value:g,description:z}=c,[H,P,J]=m?((D=g==null?void 0:g.toString())==null?void 0:D.split(r||""))||[]:[g],j=[];return(t||u)&&j.push(H),s&&j.push(P),l&&j.push(J),{symbol:f,label:S,values:[j],description:z}})}]}let p=Y=class extends yt(nt){constructor(e){super(e),this._valueInfoMap={},this._isDefaultSymbolDerived=!1,this._isInfosSource=null,this.type="unique-value",this.backgroundFillSymbol=null,this.orderByClassesEnabled=!1,this.valueExpressionTitle=null,this.legendOptions=null,this.defaultLabel=null,this.portal=null,this.styleOrigin=null,this.diff={uniqueValueInfos(t,s){if(!t&&!s)return;if(!t||!s)return{type:"complete",oldValue:t,newValue:s};let l=!1;const r={type:"collection",added:[],removed:[],changed:[],unchanged:[]};for(let o=0;om.value===s[o].value);u?Ut(u,s[o])?(r.changed.push({type:"complete",oldValue:u,newValue:s[o]}),l=!0):r.unchanged.push({oldValue:u,newValue:s[o]}):(r.added.push(s[o]),l=!0)}for(let o=0;ou.value===t[o].value)||(r.removed.push(t[o]),l=!0);return l?r:void 0}},this._set("uniqueValueInfos",[]),this._set("uniqueValueGroups",[])}get _cache(){return{compiledFunc:null}}set field(e){this._set("field",e),this._updateFieldDelimiter(),this._updateUniqueValues()}castField(e){return e==null||typeof e=="function"?e:Ne(e)}writeField(e,t,s,l){typeof e=="string"?t[s]=e:l!=null&&l.messages?l.messages.push(new Re("property:unsupported","UniqueValueRenderer.field set to a function cannot be written to JSON")):F().error(".field: cannot write field to JSON since it's not a string value")}set field2(e){this._set("field2",e),this._updateFieldDelimiter(),this._updateUniqueValues()}set field3(e){this._set("field3",e),this._updateUniqueValues()}set valueExpression(e){this._set("valueExpression",e),this._updateUniqueValues()}set defaultSymbol(e){this._isDefaultSymbolDerived=!1,this._set("defaultSymbol",e)}set fieldDelimiter(e){this._set("fieldDelimiter",e),this._updateUniqueValues()}readPortal(e,t,s){return s.portal||Ve.getDefault()}readStyleOrigin(e,t,s){if(t.styleName)return Object.freeze({styleName:t.styleName});if(t.styleUrl){const l=qt(t.styleUrl,s);return Object.freeze({styleUrl:l})}}writeStyleOrigin(e,t,s,l){e.styleName?t.styleName=e.styleName:e.styleUrl&&(t.styleUrl=Tt(e.styleUrl,l))}set uniqueValueGroups(e){this.styleOrigin?F().error("#uniqueValueGroups=","Cannot modify unique value groups of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueGroups",e),this._updateInfosFromGroups(),this._isInfosSource=!1,this._watchUniqueValueGroups())}set uniqueValueInfos(e){this.styleOrigin?F().error("#uniqueValueInfos=","Cannot modify unique value infos of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueInfos",e),this._updateValueInfoMap(),this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos())}addUniqueValueInfo(e,t){var l;if(this.styleOrigin)return void F().error("#addUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");let s;s=typeof e=="object"?rs(e):new K({value:e,symbol:rt(t)}),(l=this.uniqueValueInfos)==null||l.push(s),this._valueInfoMap[s.value]=s,this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos()}removeUniqueValueInfo(e){if(this.styleOrigin)return void F().error("#removeUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");const t=this.uniqueValueInfos;if(t)for(let s=0;se+t.getAttributeHash(),"")}getMeshHash(){var l;const e=JSON.stringify(this.backgroundFillSymbol),t=JSON.stringify(this.defaultSymbol),s=(l=this.uniqueValueInfos)==null?void 0:l.reduce((r,o)=>r+o.getMeshHash(),"");return`${e}.${t}.${s}.${`${this.field}.${this.field2}.${this.field3}.${this.fieldDelimiter}`}.${this.valueExpression}`}clone(){const e=new Y({field:this.field,field2:this.field2,field3:this.field3,defaultLabel:this.defaultLabel,defaultSymbol:v(this.defaultSymbol),orderByClassesEnabled:this.orderByClassesEnabled,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,fieldDelimiter:this.fieldDelimiter,visualVariables:v(this.visualVariables),legendOptions:v(this.legendOptions),authoringInfo:this.authoringInfo&&this.authoringInfo.clone(),backgroundFillSymbol:v(this.backgroundFillSymbol)});this._isDefaultSymbolDerived&&(e._isDefaultSymbolDerived=!0),e._set("portal",this.portal);const t=v(this.uniqueValueInfos),s=v(this.uniqueValueGroups);return this.styleOrigin&&(e._set("styleOrigin",Object.freeze(v(this.styleOrigin))),Object.freeze(t),Object.freeze(s)),e._set("uniqueValueInfos",t),e._updateValueInfoMap(),e._set("uniqueValueGroups",s),e._isInfosSource=this._isInfosSource,e._watchUniqueValueInfosAndGroups(),e}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}async collectRequiredFields(e,t){const s=[this.collectVVRequiredFields(e,t),this.collectSymbolFields(e,t)];await Promise.all(s)}async collectSymbolFields(e,t){const s=[...this.getSymbols().map(l=>l.collectRequiredFields(e,t)),Ce(e,t,this.valueExpression)];U(e,t,this.field),U(e,t,this.field2),U(e,t,this.field3),await Promise.all(s)}populateFromStyle(){return Ct(this.styleOrigin,{portal:this.portal}).then(e=>{var s;const t=[];return this._valueInfoMap={},e&&e.data&&Array.isArray(e.data.items)&&e.data.items.forEach(l=>{const r=new kt({styleUrl:e.styleUrl,styleName:e.styleName,portal:this.portal,name:l.name});this.defaultSymbol||l.name!==e.data.defaultItem||(this.defaultSymbol=r,this._isDefaultSymbolDerived=!0);const o=new K({value:l.name,symbol:r});t.push(o),this._valueInfoMap[l.name]=o}),this._set("uniqueValueInfos",Object.freeze(t)),this._updateGroupsFromInfos(!0),this._isInfosSource=null,this._watchUniqueValueInfos(),!this.defaultSymbol&&((s=this.uniqueValueInfos)!=null&&s.length)&&(this.defaultSymbol=this.uniqueValueInfos[0].symbol,this._isDefaultSymbolDerived=!0),this})}_updateFieldDelimiter(){this.field&&this.field2&&!this.fieldDelimiter&&this._set("fieldDelimiter",as)}_updateUniqueValues(){this._isInfosSource!=null&&(this._isInfosSource?this._updateGroupsFromInfos():this._updateInfosFromGroups())}_updateValueInfoMap(){this._valueInfoMap={};const{uniqueValueInfos:e}=this;if(e)for(const t of e)this._valueInfoMap[t.value+""]=t}_watchUniqueValueInfosAndGroups(){this._watchUniqueValueInfos(),this._watchUniqueValueGroups()}_watchUniqueValueInfos(){this.removeHandles(et);const{uniqueValueInfos:e}=this;if(e){const t=[];for(const s of e)t.push(be(()=>({symbol:s.symbol,value:s.value,label:s.label,description:s.description}),(l,r)=>{l!==r&&(this._updateGroupsFromInfos(),this._isInfosSource=!0)},{sync:!0}));this.addHandles(t,et)}}_watchUniqueValueGroups(){this.removeHandles(tt);const{uniqueValueGroups:e}=this;if(e){const t=[];for(const s of e){t.push(be(()=>({classes:s.classes}),(l,r)=>{l!==r&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}));for(const l of s.classes??[])t.push(be(()=>({symbol:l.symbol,values:l.values,label:l.label,description:l.description}),(r,o)=>{r!==o&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}))}this.addHandles(t,tt)}}_updateInfosFromGroups(){if(!this.uniqueValueGroups)return this._set("uniqueValueInfos",null),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const e=[],{field:t,field2:s,field3:l,fieldDelimiter:r,uniqueValueGroups:o,valueExpression:u}=this;if(!t&&!u)return this._set("uniqueValueInfos",e),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const m=!(!t||!s);for(const c of o)for(const f of c.classes??[]){const{symbol:S,label:g,values:z,description:H}=f;for(const P of z??[]){const{value:J,value2:j,value3:D}=P,te=[J];s&&te.push(j),l&&te.push(D);const wt=m?te.join(r||""):te[0];e.push(new K({symbol:S,label:g,value:wt,description:H}))}}this._set("uniqueValueInfos",e),this._updateValueInfoMap(),this._watchUniqueValueInfos()}_updateGroupsFromInfos(e=!1){if(!this.uniqueValueInfos)return this._set("uniqueValueGroups",null),void this._watchUniqueValueGroups();const{field:t,field2:s,valueExpression:l,fieldDelimiter:r,uniqueValueInfos:o}=this;if(!t&&!l||!o.length)return this._set("uniqueValueGroups",[]),void this._watchUniqueValueGroups();const u=!(!t||!s),m=o.map(f=>{var D;const{symbol:S,label:g,value:z,description:H}=f,[P,J,j]=u?((D=z==null?void 0:z.toString())==null?void 0:D.split(r||""))||[]:[z];return new bt({symbol:S,label:g,description:H,values:[new L({value:P,value2:J,value3:j})]})}),c=[new De({classes:m})];e&&Object.freeze(c),this._set("uniqueValueGroups",c),this._watchUniqueValueGroups()}_getUniqueValueInfo(e,t){return this.valueExpression?this._getUnqiueValueInfoForExpression(e,t):this._getUnqiueValueInfoForFields(e)}_getUnqiueValueInfoForExpression(e,t){const{viewingMode:s,scale:l,spatialReference:r,arcade:o,timeZone:u}=t??{};let m=this._cache.compiledFunc;const c=o.arcadeUtils;if(!m){const S=c.createSyntaxTree(this.valueExpression);m=c.createFunction(S),this._cache.compiledFunc=m}const f=c.executeFunction(m,c.createExecContext(e,c.getViewInfo({viewingMode:s,scale:l,spatialReference:r}),u));return this._valueInfoMap[f+""]}_getUnqiueValueInfoForFields(e){const t=this.field,s=e.attributes;let l;if(typeof t!="function"&&this.field2){const r=this.field2,o=this.field3,u=[];t&&u.push(s[t]),r&&u.push(s[r]),o&&u.push(s[o]),l=u.join(this.fieldDelimiter||"")}else typeof t=="function"?l=t(e):t&&(l=s[t]);return this._valueInfoMap[l+""]}static fromPortalStyle(e,t){const s=new Y(t==null?void 0:t.properties);s._set("styleOrigin",Object.freeze({styleName:e})),s._set("portal",(t==null?void 0:t.portal)||Ve.getDefault());const l=s.populateFromStyle();return l.catch(r=>{F().error(`#fromPortalStyle('${e}'[, ...])`,"Failed to create unique value renderer from style name",r)}),l}static fromStyleUrl(e,t){const s=new Y(t==null?void 0:t.properties);s._set("styleOrigin",Object.freeze({styleUrl:e}));const l=s.populateFromStyle();return l.catch(r=>{F().error(`#fromStyleUrl('${e}'[, ...])`,"Failed to create unique value renderer from style URL",r)}),l}};i([a({readOnly:!0})],p.prototype,"_cache",null),i([ot({uniqueValue:"unique-value"})],p.prototype,"type",void 0),i([a(ft)],p.prototype,"backgroundFillSymbol",void 0),i([a({value:null,json:{type:String,read:{source:"field1"},write:{target:"field1"}}})],p.prototype,"field",null),i([B("field")],p.prototype,"castField",null),i([G("field")],p.prototype,"writeField",null),i([a({type:String,value:null,json:{write:!0}})],p.prototype,"field2",null),i([a({type:String,value:null,json:{write:!0}})],p.prototype,"field3",null),i([a({type:Boolean,json:{name:"drawInClassOrder",default:!1,write:!0,origins:{"web-scene":{write:!1}}}})],p.prototype,"orderByClassesEnabled",void 0),i([a({type:String,value:null,json:{write:!0}})],p.prototype,"valueExpression",null),i([a({type:String,json:{write:!0}})],p.prototype,"valueExpressionTitle",void 0),i([a({type:Ae,json:{write:!0}})],p.prototype,"legendOptions",void 0),i([a({type:String,json:{write:!0}})],p.prototype,"defaultLabel",void 0),i([a(lt({...fe},{json:{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}},origins:{"web-scene":{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}}}}}}))],p.prototype,"defaultSymbol",null),i([a({type:String,value:null,json:{write:!0}})],p.prototype,"fieldDelimiter",null),i([a({type:Ve,readOnly:!0})],p.prototype,"portal",void 0),i([_("portal",["styleName"])],p.prototype,"readPortal",null),i([a({readOnly:!0,json:{write:{enabled:!1,overridePolicy:()=>({enabled:!0})}}})],p.prototype,"styleOrigin",void 0),i([_("styleOrigin",["styleName","styleUrl"])],p.prototype,"readStyleOrigin",null),i([G("styleOrigin",{styleName:{type:String},styleUrl:{type:String}})],p.prototype,"writeStyleOrigin",null),i([a({type:[De],json:{read:{source:["uniqueValueGroups","uniqueValueInfos"],reader:(e,t,s)=>(t.uniqueValueGroups||os(t)).map(l=>De.fromJSON(l,s))},write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],p.prototype,"uniqueValueGroups",null),i([a({type:[K],json:{read:!1,write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],p.prototype,"uniqueValueInfos",null),p=Y=i([d(gt)],p);const Ss=p;export{Ss as A,Zt as a,ct as b,dt as c,me as d,K as e,Pt as j,mt as n,nt as p,yt as v,gs as w}; diff --git a/assets/UnknownLayer-BeNlyNrR.js b/assets/UnknownLayer-BSjgqi4d.js similarity index 91% rename from assets/UnknownLayer-BeNlyNrR.js rename to assets/UnknownLayer-BSjgqi4d.js index 97a1865..996a9e2 100644 --- a/assets/UnknownLayer-BeNlyNrR.js +++ b/assets/UnknownLayer-BSjgqi4d.js @@ -1 +1 @@ -import{dq as i,dr as y,e9 as l,d as s,y as t,f as p,bT as d,N as u}from"./index-CEWggaxV.js";let e=class extends i(y(d)){constructor(r){super(r),this.resourceInfo=null,this.type="unknown"}initialize(){this.addResolvingPromise(new Promise((r,o)=>{l(()=>{const n=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let a="Unknown layer type";n&&(a+=" "+n),o(new u("layer:unknown-layer-type",a,{layerType:n}))})}))}read(r,o){super.read({resourceInfo:r},o)}write(r,o){return null}};s([t({readOnly:!0})],e.prototype,"resourceInfo",void 0),s([t({type:["show","hide"]})],e.prototype,"listMode",void 0),s([t({json:{read:!1},readOnly:!0,value:"unknown"})],e.prototype,"type",void 0),e=s([p("esri.layers.UnknownLayer")],e);const f=e;export{f as default}; +import{dq as i,dr as y,e9 as l,d as s,y as t,f as p,bT as d,N as u}from"./index-BjUNJPVf.js";let e=class extends i(y(d)){constructor(r){super(r),this.resourceInfo=null,this.type="unknown"}initialize(){this.addResolvingPromise(new Promise((r,o)=>{l(()=>{const n=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let a="Unknown layer type";n&&(a+=" "+n),o(new u("layer:unknown-layer-type",a,{layerType:n}))})}))}read(r,o){super.read({resourceInfo:r},o)}write(r,o){return null}};s([t({readOnly:!0})],e.prototype,"resourceInfo",void 0),s([t({type:["show","hide"]})],e.prototype,"listMode",void 0),s([t({json:{read:!1},readOnly:!0,value:"unknown"})],e.prototype,"type",void 0),e=s([p("esri.layers.UnknownLayer")],e);const f=e;export{f as default}; diff --git a/assets/UnknownTimeZone-DF0BqWCR.js b/assets/UnknownTimeZone-CK7VjgF3.js similarity index 75% rename from assets/UnknownTimeZone-DF0BqWCR.js rename to assets/UnknownTimeZone-CK7VjgF3.js index 9e3fdc4..79a8f16 100644 --- a/assets/UnknownTimeZone-DF0BqWCR.js +++ b/assets/UnknownTimeZone-CK7VjgF3.js @@ -1 +1 @@ -import{a0 as e,a5 as o}from"./index-CEWggaxV.js";class n{}function a(t){return t instanceof o?t===n.instance:(t==null?void 0:t.toString().toLowerCase())==="unknown"}function i(t){return a(t)?n.instance:t}n.instance=new e("Etc/UTC");export{i,a as r,n as t}; +import{a0 as e,a5 as o}from"./index-BjUNJPVf.js";class n{}function a(t){return t instanceof o?t===n.instance:(t==null?void 0:t.toString().toLowerCase())==="unknown"}function i(t){return a(t)?n.instance:t}n.instance=new e("Etc/UTC");export{i,a as r,n as t}; diff --git a/assets/UnsupportedLayer-bFwEkP2I.js b/assets/UnsupportedLayer-CYwmIZG0.js similarity index 93% rename from assets/UnsupportedLayer-bFwEkP2I.js rename to assets/UnsupportedLayer-CYwmIZG0.js index 1b57976..c754eed 100644 --- a/assets/UnsupportedLayer-bFwEkP2I.js +++ b/assets/UnsupportedLayer-CYwmIZG0.js @@ -1 +1 @@ -import{dq as p,dr as a,e9 as d,d as t,y as i,f as l,bT as u,N as y}from"./index-CEWggaxV.js";let r=class extends p(a(u)){constructor(e){super(e),this.resourceInfo=null,this.persistenceEnabled=!0,this.type="unsupported"}initialize(){this.addResolvingPromise(new Promise((e,o)=>{d(()=>{const s=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let n="Unsupported layer type";s&&(n+=" "+s),o(new y("layer:unsupported-layer-type",n,{layerType:s}))})}))}read(e,o){const s={resourceInfo:e};e.id!=null&&(s.id=e.id),e.title!=null&&(s.title=e.title),super.read(s,o)}write(e,o){return Object.assign(e||{},this.resourceInfo,{id:this.id})}};t([i({readOnly:!0})],r.prototype,"resourceInfo",void 0),t([i({type:["show","hide"]})],r.prototype,"listMode",void 0),t([i({type:Boolean,readOnly:!1})],r.prototype,"persistenceEnabled",void 0),t([i({json:{read:!1},readOnly:!0,value:"unsupported"})],r.prototype,"type",void 0),r=t([l("esri.layers.UnsupportedLayer")],r);const h=r;export{h as default}; +import{dq as p,dr as a,e9 as d,d as t,y as i,f as l,bT as u,N as y}from"./index-BjUNJPVf.js";let r=class extends p(a(u)){constructor(e){super(e),this.resourceInfo=null,this.persistenceEnabled=!0,this.type="unsupported"}initialize(){this.addResolvingPromise(new Promise((e,o)=>{d(()=>{const s=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let n="Unsupported layer type";s&&(n+=" "+s),o(new y("layer:unsupported-layer-type",n,{layerType:s}))})}))}read(e,o){const s={resourceInfo:e};e.id!=null&&(s.id=e.id),e.title!=null&&(s.title=e.title),super.read(s,o)}write(e,o){return Object.assign(e||{},this.resourceInfo,{id:this.id})}};t([i({readOnly:!0})],r.prototype,"resourceInfo",void 0),t([i({type:["show","hide"]})],r.prototype,"listMode",void 0),t([i({type:Boolean,readOnly:!1})],r.prototype,"persistenceEnabled",void 0),t([i({json:{read:!1},readOnly:!0,value:"unsupported"})],r.prototype,"type",void 0),r=t([l("esri.layers.UnsupportedLayer")],r);const h=r;export{h as default}; diff --git a/assets/UpdateTracking2D-nj9Q-3df.js b/assets/UpdateTracking2D-Ds_Gdrxd.js similarity index 99% rename from assets/UpdateTracking2D-nj9Q-3df.js rename to assets/UpdateTracking2D-Ds_Gdrxd.js index 48bcb4f..bba316c 100644 --- a/assets/UpdateTracking2D-nj9Q-3df.js +++ b/assets/UpdateTracking2D-Ds_Gdrxd.js @@ -1,10 +1,10 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/geometryEngineJSON-D-7-cYHZ.js","assets/geometryEngineBase-C5__2Su1.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css","assets/json-Wa8cmqdu.js"] + __vite__mapDeps.viteFileDeps = ["assets/geometryEngineJSON-BfS7Q-po.js","assets/geometryEngineBase-CDbTTSsS.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css","assets/json-Wa8cmqdu.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{ij as $i,j_ as tn,jW as ki,ml as Es,ab as ht,ac as wt,ad as li,F as mt,aa as fr,aV as Ie,mm as oe,mn as ci,mo as le,aS as en,mp as T,mq as K,mr as Be,ms as Vi,mt as Ds,mu as Ct,l9 as Xt,mv as tr,i3 as go,mw as Ve,mx as fh,my as mh,ai as ze,mz as _h,ly as gh,mA as Gs,mB as yh,bE as xh,bh as I,mC as bh,s as me,lk as ce,mD as Yi,ll as mr,mE as Ph,mF as vt,fj as Bs,iV as En,lE as ui,lD as _r,ag as wh,E as ue,bg as de,mG as sn,mH as rn,mI as tt,mJ as ct,aq as Sh,il as vh,am as yo,mK as Vs,mL as Mh,mM as Ch,mN as $h,mO as kh,mP as Ih,mQ as Nn,mR as Th,mS as zh,mT as Lh,jJ as Ys,mU as Hs,lA as Eh,_ as Nh,g5 as S,a9 as Ah,N as nn,hh as er,hi as sr,lw as Hi,$ as Le,mV as Fh,mW as Ii,mX as on,hg as Rh,d as x,aG as Oh,mY as ir,iU as Dh,lt as B,I as An,mZ as Gh,l8 as xo,lH as Bh,lB as Vh,y as Fn,f as Yh,a7 as Hh,i0 as Uh,l6 as Xh,g as Wh}from"./index-CEWggaxV.js";import{a as qh,C as Zh,i as jh,c as Kh}from"./TurboLine-CkxIB4ZX.js";import"./earcut-hRlx3adE.js";import{e as Ti}from"./OptimizedGeometry-CQuTPb9g.js";import{j as Jh,I as $,t as Rt,C as Qh,B as tl,N as xe,w as bo,P as Po,A as el,F as sl,L as rr,x as il,T as rl,S as nl,g as ol,d as al,k as hl,O as wo}from"./utils-p-5Bbga5.js";import{t as ll}from"./Rect-CUzevAry.js";import{i as Ce,a as cl,f as ul,w as pl,g as So,T as dl,r as Us}from"./LabelMetric-D2hbzzy_.js";import{b as fl}from"./labelUtils-Dnqx6jl5.js";import{a as Xs}from"./BindType-BmZEZMMh.js";import{s as ml}from"./Util-BS8sJGjF.js";import"./Texture-DJgkMrSB.js";import{r as _l}from"./Program-DLRmaKpw.js";import{l as vo}from"./highlightReasons-DbgbcWKM.js";import{t as Wt}from"./constants-D5zmR9t2.js";function Ad(i){return i}function Fd(i){return i}function gl(i,t,e,s,r,n,o){xr=0;const a=(s-e)*n,h=r&&r.length,l=h?(r[0]-e)*n:a;let c,u,d,p,m,f=Mo(t,e,s,0,l,n,!0);if(f&&f.next!==f.prev){if(h&&(f=Pl(t,e,s,r,f,n)),a>80*n){c=d=t[0+e*n],u=p=t[1+e*n];for(let _=n;_0)for(let h=s;h=s;h-=n)a=Rn(h+t*n,i[h+t*n],i[h+1+t*n],a);return a&&ae(a,a.next)&&($s(a),a=a.next),a}function Ms(i,t=i){if(!i)return i;let e,s=i;do if(e=!1,s.steiner||!ae(s,s.next)&&Z(s.prev,s,s.next)!==0)s=s.next;else{if($s(s),s=t=s.prev,s===s.next)break;e=!0}while(e||s!==t);return t}function Cs(i,t,e,s,r,n,o,a){if(!i)return;!a&&n&&(i=Co(i,s,r,n));let h=i;for(;i.prev!==i.next;){const l=i.prev,c=i.next;if(n?xl(i,s,r,n):yl(i))t.push(l.index/e+o),t.push(i.index/e+o),t.push(c.index/e+o),$s(i),i=c.next,h=c.next;else if((i=c)===h){a?a===1?Cs(i=kl(i,t,e,o),t,e,s,r,n,o,2):a===2&&Il(i,t,e,s,r,n,o):Cs(Ms(i),t,e,s,r,n,o,1);break}}}function yl(i){const t=i.prev,e=i,s=i.next;if(Z(t,e,s)>=0)return!1;let r=i.next.next;const n=r;let o=0;for(;r!==i.prev&&(o===0||r!==n);){if(o++,$e(t.x,t.y,e.x,e.y,s.x,s.y,r.x,r.y)&&Z(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function xl(i,t,e,s){const r=i.prev,n=i,o=i.next;if(Z(r,n,o)>=0)return!1;const a=r.xn.x?r.x>o.x?r.x:o.x:n.x>o.x?n.x:o.x,c=r.y>n.y?r.y>o.y?r.y:o.y:n.y>o.y?n.y:o.y,u=gr(a,h,t,e,s),d=gr(l,c,t,e,s);let p=i.prevZ,m=i.nextZ;for(;p&&p.z>=u&&m&&m.z<=d;){if(p!==i.prev&&p!==i.next&&$e(r.x,r.y,n.x,n.y,o.x,o.y,p.x,p.y)&&Z(p.prev,p,p.next)>=0||(p=p.prevZ,m!==i.prev&&m!==i.next&&$e(r.x,r.y,n.x,n.y,o.x,o.y,m.x,m.y)&&Z(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;p&&p.z>=u;){if(p!==i.prev&&p!==i.next&&$e(r.x,r.y,n.x,n.y,o.x,o.y,p.x,p.y)&&Z(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;m&&m.z<=d;){if(m!==i.prev&&m!==i.next&&$e(r.x,r.y,n.x,n.y,o.x,o.y,m.x,m.y)&&Z(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function Rn(i,t,e,s){const r=zi.create(i,t,e);return s?(r.next=s.next,r.prev=s,s.next.prev=r,s.next=r):(r.prev=r,r.next=r),r}function $s(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function bl(i){let t=i,e=i;do(t.x=e.next.y&&e.next.y!==e.y){const d=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(d<=s&&d>o){if(o=d,d===s){if(r===e.y)return e;if(r===e.next.y)return e.next}n=e.x=e.x&&e.x>=h&&s!==e.x&&$e(rn.x)&&ks(e,i)&&(n=e,u=c)),e=e.next;return n}function Co(i,t,e,s){let r;for(;r!==i;r=r.next){if(r=r||i,r.z===null&&(r.z=gr(r.x,r.y,t,e,s)),r.prev.next!==r||r.next.prev!==r)return r.prev.next=r,r.next.prev=r,Co(i,t,e,s);r.prevZ=r.prev,r.nextZ=r.next}return i.prevZ.nextZ=null,i.prevZ=null,vl(i)}function vl(i){let t,e=1;for(;;){let s,r=i;i=null,t=null;let n=0;for(;r;){n++,s=r;let o=0;for(;o0||a>0&&s;){let h;o===0?(h=s,s=s.nextZ,a--):a!==0&&s?r.z<=s.z?(h=r,r=r.nextZ,o--):(h=s,s=s.nextZ,a--):(h=r,r=r.nextZ,o--),t?t.nextZ=h:i=h,h.prevZ=t,t=h}r=s}if(t.nextZ=null,e*=2,n<2)return i}}function Z(i,t,e){return(t.y-i.y)*(e.x-t.x)-(t.x-i.x)*(e.y-t.y)}function $o(i,t,e,s){return!!(ae(i,t)&&ae(e,s)||ae(i,s)&&ae(e,t))||Z(i,t,e)>0!=Z(i,t,s)>0&&Z(e,s,i)>0!=Z(e,s,t)>0}function Ml(i,t){let e=i;do{if(e.index!==i.index&&e.next.index!==i.index&&e.index!==t.index&&e.next.index!==t.index&&$o(e,e.next,i,t))return!0;e=e.next}while(e!==i);return!1}function Cl(i,t,e,s,r,n){let o=0;for(let a=s,h=r-n;a=0&&(i-o)*(s-a)-(e-o)*(t-a)>=0&&(e-o)*(n-a)-(r-o)*(s-a)>=0}function ks(i,t){return Z(i.prev,i,i.next)<0?Z(i,t,i.next)>=0&&Z(i,i.prev,t)>=0:Z(i,t,i.prev)<0||Z(i,i.next,t)<0}function gr(i,t,e,s,r){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=32767*(i-e)*r)|i<<8))|i<<4))|i<<2))|i<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-s)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function ae(i,t){return i.x===t.x&&i.y===t.y}function $l(i,t){return i.x-t.x}function kl(i,t,e,s){let r=i;do{const n=r.prev,o=r.next.next;!ae(n,o)&&$o(n,r,r.next,o)&&ks(n,o)&&ks(o,n)&&(t.push(n.index/e+s),t.push(r.index/e+s),t.push(o.index/e+s),$s(r),$s(r.next),r=i=o),r=r.next}while(r!==i);return r}function Il(i,t,e,s,r,n,o){let a=i;do{let h=a.next.next;for(;h!==a.prev;){if(a.index!==h.index&&Tl(a,h)){let l=ko(a,h);return a=Ms(a,a.next),l=Ms(l,l.next),Cs(a,t,e,s,r,n,o,0),void Cs(l,t,e,s,r,n,o,0)}h=h.next}a=a.next}while(a!==i)}function Tl(i,t){return i.next.index!==t.index&&i.prev.index!==t.index&&!Ml(i,t)&&ks(i,t)&&ks(t,i)&&zl(i,t)}function zl(i,t){let e=i,s=!1;const r=(i.x+t.x)/2,n=(i.y+t.y)/2;do e.y>n!=e.next.y>n&&e.next.y!==e.y&&r<(e.next.x-e.x)*(n-e.y)/(e.next.y-e.y)+e.x&&(s=!s),e=e.next;while(e!==i);return s}function ko(i,t){const e=zi.create(i.index,i.x,i.y),s=zi.create(t.index,t.x,t.y),r=i.next,n=t.prev;return i.next=t,t.prev=i,e.next=r,r.prev=e,s.next=e,e.prev=s,n.next=s,s.prev=n,s}let zi=class Io{constructor(){this.index=0,this.x=0,this.y=0,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}static create(t,e,s){const r=xr0))break;u+=g,d.push(a+c),c+=_}const p=o.length;gl(o,e,a,a+c,d,2,n);const m=Nl(o,e,p,o.length,n),f=Math.abs(u);if(Math.abs((m-f)/Math.max(1e-7,f))>El)return o.length=0,!1;h=l,a+=c}return!0}function Fl(i){const{coords:t,lengths:e}=i,{buffer:s}=qh(t,e);return s}function Rl(i,t,e){let s=0;for(let r=0;re||he)return!0}s+=n}return!1}function To(i,t){if(i==null)return null;if(!Rl(i,-128,$i+128))return i;Qt.setPixelMargin(t),Qt.reset(ki.Polygon);let e=0;for(let o=0;or||cr){o=!0;continue}h.push({x:l,y:c})}let u=!1;for(;i.nextPoint();)if(l=i.x,c=i.y,o)e.lineTo(l,c);else{if(lr||cr){u=!0;break}h.push({x:l,y:c})}if(u)o=!0;else{if(o){const d=e.resultWithStarts();if(d)for(const p of d)n.push(p)}else n.push({line:h,start:0});a=i.nextPath(),o=!1}}return n=n.filter(h=>h.line.length>1),n.length===0?null:n}Qt.setExtent($i),br.setExtent($i);let N=class{static fromOptimized(t,e,s=!1,r=!1,n=1){return new Pr().initialize(t,e,s,r,n)}static fromJSON(t,e=!1,s=!1){const[r,n]=Dn(t);return new wr().initialize(r,n,e,s,1)}static fromOptimizedCIM(t,e,s=!1,r=!1,n=1){return new Gn().initialize(t,e,s,r,n)}static fromJSONCIM(t,e=!1,s=!1,r=1){const[n,o]=Dn(t);return new Bn().initialize(n,o,e,s,r)}static fromFeatureSetReader(t){const e=t.readGeometryForDisplay(),s=t.geometryType;return e&&s?this.fromOptimized(e,s):null}static fromFeatureSetReaderCIM(t){const e=t.readGeometryForDisplay(),s=t.geometryType;return e&&s?this.fromOptimizedCIM(e,s):null}static createEmptyOptimized(t,e=!1,s=!1,r=1){return new Pr().initialize(new Ti,t,e,s,r)}static createEmptyJSON(t,e=!1,s=!1){return new wr().initialize([],t,e,s,1)}static createEmptyOptimizedCIM(t,e=!1,s=!1,r=1){return new Gn().initialize(new Ti,t,e,s,r)}static createEmptyJSONCIM(t,e=!1,s=!1,r=1){return new Bn().initialize([],t,e,s,r)}asJSON(){const t=Es(this);return this.geometryType==="esriGeometryEnvelope"?{xmin:t[0][0][0],ymin:t[0][0][1],xmax:t[0][2][0],ymax:t[0][2][1]}:this.geometryType==="esriGeometryMultipoint"?{points:t.flat()}:this.geometryType==="esriGeometryPoint"?{x:t[0][0][0],y:t[0][0][1]}:this.geometryType==="esriGeometryPolygon"?{rings:t}:{paths:t}}getCurrentRingArea(){if(this.pathSize<3)return 0;let t,e,s=0;if(this.seekPathStart(),!this.nextPoint())return 0;t=this.x,e=this.y;const r=t,n=e;for(;this.nextPoint();)s+=(t-this.x)*(e+this.y),t=this.x,e=this.y;return s+=(t-r)*(e+n),-.5*s}invertY(){this.yFactor*=-1}},Pr=class zo extends N{constructor(){super(...arguments),this._end=-1}initialize(t,e,s,r,n){return this.hasZ=s,this.hasM=r,this.geometryType=e,this._stride=2+Number(s)+Number(r),this._geometry=t,this._pathIndex=-1,this._pathOffset=0,this._pointOffset=-this._stride,this._end=-1,this.yFactor=n,this}reset(){this.initialize(this._geometry,this.geometryType,this.hasZ,this.hasM,this.yFactor)}seekPath(t){if(t>=0&&tt)for(;this._pathIndex>t&&this.prevPath(););return!0}return!1}seekPathStart(){this._pointOffset=this._pathOffset-this._stride}seekPathEnd(){this._pointOffset=this._end}seekInPath(t){const e=this._pathOffset+t*this._stride;return e>=0&&e=this._pathOffset}nextPath(){return!(this.pathIndex>=this.totalSize-1)&&(this._pathIndex>=0&&(this._pathOffset+=this._stride*this.pathSize),this._pathIndex++,this._pointOffset=this._pathOffset-this._stride,this._end=this._pointOffset+this._stride+this._stride*this.pathSize,!0)}prevPath(){return!(this.pathIndex<=0)&&(this._pathIndex--,this._end=this._pathOffset,this._pathOffset-=this._stride*this.pathSize,this._pointOffset=this._pathOffset-this._stride,!0)}pathLength(){const t=this._end,e=this._stride,s=this._geometry.coords;let r=0;for(let n=this._pathOffset+e;nt+e)}get pathSize(){const{lengths:t}=this._geometry;return this._pathIndex<0||this._pathIndex>t.length-1?0:this._geometry.isPoint?1:t[this._pathIndex]}get totalSize(){return this._geometry.lengths.length}get x(){return this._geometry.coords[this._pointOffset]}set x(t){this._geometry.coords[this._pointOffset]=t}get y(){return this.yFactor*this._geometry.coords[this._pointOffset+1]}set y(t){this._geometry.coords[this._pointOffset+1]=this.yFactor*t}get z(){return this._geometry.coords[this._pointOffset+2]}set z(t){this._geometry.coords[this._pointOffset+2]=t}get m(){const t=this.hasZ?3:2;return this._geometry.coords[this._pointOffset+t]}set m(t){this._geometry.coords[this._pointOffset+3]=t}get pathIndex(){return this._pathIndex}get _coordIndex(){return this._pointOffset/this._stride}};function Dl(i){const t=[i.x,i.y];return i.z&&t.push(i.z),i.m&&t.push(i.m),t}function Dn(i){return ht(i)?[i.rings,"esriGeometryPolygon"]:wt(i)?[i.paths,"esriGeometryPolyline"]:li(i)?[[i.points],"esriGeometryMultipoint"]:mt(i)?[[[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]],"esriGeometryEnvelope"]:fr(i)?[[[Dl(i)]],"esriGeometryPoint"]:[[],"esriGeometryPolyline"]}let wr=class Lo extends N{initialize(t,e,s,r,n){return this._paths=t,this.geometryType=e,this.hasZ=s,this.hasM=r,this._pathIndex=this._pointIndex=-1,this.yFactor=n,this._mIndex=this.hasZ?3:2,this}reset(){this._pathIndex=this._pointIndex=-1}seekPath(t){return this._pathIndex=t,this._pointIndex=-1,t>=0&&t=0&&t=0}nextPath(){return this._pointIndex=-1,this._currentPath=this._paths[++this._pathIndex],this._pathIndex0&&(this._pointIndex=-1,this._pathIndex--,this._currentPath=this._paths[this._pathIndex],!0)}pathLength(){const t=this._currentPath.length,e=this._currentPath;let s=0;for(let r=1;rt.length).reduce((t,e)=>t+e)}get pathSize(){return this._pathIndex<0||this._pathIndex>this.totalSize-1?-1:this._paths[this._pathIndex].length}get totalSize(){return this._paths.length}get x(){return this._currentPoint[0]}set x(t){this._currentPoint[0]=t}get y(){return this.yFactor*this._currentPoint[1]}set y(t){this._currentPoint[1]=this.yFactor*t}get z(){return this._currentPoint[2]}set z(t){this._currentPoint[2]=t}get m(){return this._currentPoint[this._mIndex]}set m(t){this._currentPoint[this._mIndex]=t}get pathIndex(){return this._pathIndex}};const Ws=4,qs=1;let Gn=class Eo extends Pr{initialize(t,e,s,r,n){return super.initialize(t,e,s,r,n),this._controlPoints||(this._controlPoints=this._controlPoints=new Array(this.totalSize).fill(void 0).map(o=>new Set)),this}startPath(){super.startPath(),this._controlPoints.push(new Set)}clone(){const t=new Eo().initialize(this._geometry.clone(),this.geometryType,this.hasZ,this.hasM,this.yFactor);return t._controlPoints=this._controlPoints,t}setControlPoint(){this._controlPoints[this.pathIndex].add(this._coordIndex)}getControlPoint(){return this._controlPoints[this.pathIndex].has(this._coordIndex)}setControlPointAt(t){this._controlPoints[this.pathIndex].add(t)}getControlPointAt(t){return this._controlPoints[this.pathIndex].has(t)}},Bn=class No extends wr{initialize(t,e,s,r,n){return super.initialize(t,e,s,r,n)}clone(){return new No().initialize(Ie(this._paths),this.geometryType,this.hasZ,this.hasM,this.yFactor)}setControlPoint(){this._paths[this.pathIndex][this._pointIndex][Ws]=qs}getControlPoint(){return this._paths[this.pathIndex][this._pointIndex][Ws]===qs}setControlPointAt(t){this._paths[this.pathIndex][t][Ws]=qs}getControlPointAt(t){return this._paths[this.pathIndex][t][Ws]===qs}};const Gl=512;let $t,Sr=class{constructor(t){this._geometry=t}next(){const t=this._geometry;return this._geometry=null,t}};function an(i,t){$t||($t=new tn(0,0,0,1));const e=i.geometryType==="esriGeometryPolygon",s=e?ki.Polygon:ki.LineString,r=e?3:2;let n,o;for($t.reset(s),$t.setPixelMargin(t+1),$t.setExtent(Gl);i.nextPath();)if(!(i.pathSize1&&y>0&&l>0&&(a*_+h*g)/y/l<=this._maxCosAngle&&t.setControlPointAt(p-1),p===1&&(c=_,u=g,d=y),y>0&&(r=m,n=f,a=_,h=g,l=y)}this._isClosed&&l>0&&d>0&&(a*c+h*u)/d/l<=this._maxCosAngle&&t.setControlPointAt(0)}}},Ae=class{constructor(){this.setIdentity()}getAngle(){return(this.rz==null||this.rz===0&&this.rzCos!==1&&this.rzSin!==0)&&(this.rz=Math.atan2(this.rzSin,this.rzCos)),this.rz}setIdentity(){this.tx=0,this.ty=0,this.tz=0,this.s=1,this.rx=0,this.ry=0,this.rz=0,this.rzCos=1,this.rzSin=0}setTranslate(t,e){this.tx=t,this.ty=e}setTranslateZ(t){this.tz=t}setRotateCS(t,e){this.rz=void 0,this.rzCos=t,this.rzSin=e}setRotate(t){this.rz=t,this.rzCos=void 0,this.rzSin=void 0}setRotateY(t){this.ry=t}setScale(t){this.s=t}setMeasure(t){this.m=t}};function nr(i,t){i[4]=t}let Ns=class{constructor(t,e=!0,s=!0,r=0){this.isClosed=!1,this.geometryCursor=null,this.geometryCursor=!e&&t.geometryType==="esriGeometryPolygon"||!s&&t.geometryType==="esriGeometryPolyline"?null:t,this.geomUnitsPerPoint=r,this.iteratePath=!1,this.internalPlacement=new Ae}next(){if(!this.geometryCursor)return null;for(;this.iteratePath||this.geometryCursor.pathIndex0?[o/h,a/h]:[1,0]}getSegAngleCS(t,e){const[[s,r],[n,o]]=t;return this.getAngleCS(s,r,n,o,e)}cut(t,e,s,r,n,o){return[n<=0?[t,e]:this.getCoord2D(t,e,s,r,n),o>=1?[s,r]:this.getCoord2D(t,e,s,r,o)]}getSubCurve(t,e,s){const r=N.createEmptyOptimizedCIM("esriGeometryPolyline");return this.appendSubCurve(r,t,e,s)?r:null}appendSubCurve(t,e,s,r){t.startPath(),e.seekPathStart();let n=0,o=!0;if(!e.nextPoint())return!1;let a=e.x,h=e.y;for(;e.nextPoint();){const l=this.getLength(a,h,e.x,e.y);if(l!==0){if(o){if(n+l>s){const c=(s-n)/l;let u=1,d=!1;n+l>=r&&(u=(r-n)/l,d=!0);const p=this.cut(a,h,e.x,e.y,c,u);if(p&&t.pushPoints(p),d)break;o=!1}}else{if(n+l>r){const c=this.cut(a,h,e.x,e.y,0,(r-n)/l);c&&t.pushPoint(c[1]);break}t.pushXY(e.x,e.y)}n+=l,a=e.x,h=e.y}else a=e.x,h=e.y}return!0}getCIMPointAlong(t,e){if(!t.nextPoint())return null;let s,r,n,o,a=0;for(s=t.x,r=t.y;t.nextPoint();s=n,r=o){n=t.x,o=t.y;const h=this.getLength(s,r,n,o);if(h!==0){if(a+h>e){const l=(e-a)/h;return this.getCoord2D(s,r,n,o,l)}a+=h}}return null}offset(t,e,s,r,n){if(!t||t.length<2)return null;let o=0,a=t[o++],h=o;for(;o=0==e<=0){if(g<1){const y=[m[0]-f[0],m[1]-f[1]];this.normalize(y);const P=Math.sqrt((1+g)/2);if(P>1/r){const w=-Math.abs(e)/P;c.push([u[0]-y[0]*w,u[1]-y[1]*w])}}}else switch(s){case oe.Mitered:{const y=Math.sqrt((1+g)/2);if(y>0&&1/y0){const P=1/y;let w=P;for(let M=1;M0){const n=N.createEmptyOptimizedCIM(t.geometryType),o=Es(t)[0],a=this._curveHelper.offset(o,this._size,oe.Rounded,4,this._offsetFlattenError);if(a)return n.pushPath(a),n}else if(this._size<0){const n=t.asJSON();if(Math.min(n.xmax-n.xmin,n.ymax-n.ymin)+2*this._size>0)return N.fromJSONCIM({xmin:n.xmin-this._size,xmax:n.xmax+this._size,ymin:n.ymin-this._size,ymax:n.ymax+this._size})}}const e=this._geometryEngine;if(e==null)return null;const s=this._tileKey?an(t,this._maxInflateSize):t;if(!s)continue;const r=e.buffer(en.WebMercator,s.asJSON(),this._size,1);return r?N.fromJSONCIM(r):null}return null}},Oo=class ss{static local(){return ss.instance===null&&(ss.instance=new ss),ss.instance}execute(t,e,s,r,n){return new Xl(t,e,s)}};Oo.instance=null;let Xl=class{constructor(t,e,s){this._defaultPointSize=20,this._inputGeometries=t,this._geomUnitsPerPoint=s,this._rule=e.rule??T.FullGeometry,this._defaultSize=this._defaultPointSize*s}next(){let t;for(;t=this._inputGeometries.next();){const e=this._processGeom(Es(t));if(e&&e.length)return N.fromJSONCIM({paths:e})}return null}_clone(t){return[t[0],t[1]]}_mid(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}_mix(t,e,s,r){return[t[0]*e+s[0]*r,t[1]*e+s[1]*r]}_add(t,e){return[t[0]+e[0],t[1]+e[1]]}_add2(t,e,s){return[t[0]+e,t[1]+s]}_sub(t,e){return[t[0]-e[0],t[1]-e[1]]}_dist(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}_norm(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}_normalize(t,e=1){const s=e/this._norm(t);t[0]*=s,t[1]*=s}_leftPerpendicular(t){const e=-t[1],s=t[0];t[0]=e,t[1]=s}_leftPerp(t){return[-t[1],t[0]]}_rightPerpendicular(t){const e=t[1],s=-t[0];t[0]=e,t[1]=s}_rightPerp(t){return[t[1],-t[0]]}_dotProduct(t,e){return t[0]*e[0]+t[1]*e[1]}_crossProduct(t,e){return t[0]*e[1]-t[1]*e[0]}_rotateDirect(t,e,s){const r=t[0]*e-t[1]*s,n=t[0]*s+t[1]*e;t[0]=r,t[1]=n}_makeCtrlPt(t){const e=[t[0],t[1]];return nr(e,1),e}_addAngledTicks(t,e,s,r){const n=this._sub(s,e);this._normalize(n);const o=this._crossProduct(n,this._sub(r,e));let a;a=o>0?this._rightPerp(n):this._leftPerp(n);const h=Math.abs(o)/2,l=[];l.push([e[0]+(a[0]-n[0])*h,e[1]+(a[1]-n[1])*h]),l.push(e),l.push(s),l.push([s[0]+(a[0]+n[0])*h,s[1]+(a[1]+n[1])*h]),t.push(l)}_addBezier2(t,e,s,r,n){if(n--==0)return void t.push(r);const o=this._mid(e,s),a=this._mid(s,r),h=this._mid(o,a);this._addBezier2(t,e,o,h,n),this._addBezier2(t,h,a,r,n)}_addBezier3(t,e,s,r,n,o){if(o--==0)return void t.push(n);const a=this._mid(e,s),h=this._mid(s,r),l=this._mid(r,n),c=this._mid(a,h),u=this._mid(h,l),d=this._mid(c,u);this._addBezier3(t,e,a,c,d,o),this._addBezier3(t,d,u,l,n,o)}_add90DegArc(t,e,s,r,n){const o=n??this._crossProduct(this._sub(s,e),this._sub(r,e))>0,a=this._mid(e,s),h=this._sub(a,e);o?this._leftPerpendicular(h):this._rightPerpendicular(h),a[0]+=h[0],a[1]+=h[1],this._addBezier3(t,e,this._mix(e,.33333,a,.66667),this._mix(s,.33333,a,.66667),s,4)}_addArrow(t,e,s){const r=e[0],n=e[1],o=e[e.length-1],a=this._sub(r,n);this._normalize(a);const h=this._crossProduct(a,this._sub(o,n)),l=.5*h,c=this._leftPerp(a),u=[o[0]-c[0]*h,o[1]-c[1]*h],d=e.length-1,p=[];p.push(s?[-c[0],-c[1]]:c);let m=[-a[0],-a[1]];for(let f=1;f0;f--)t.push([e[f][0]+p[f][0]*l,e[f][1]+p[f][1]*l]);t.push([u[0]+p[0][0]*l,u[1]+p[0][1]*l]),t.push([u[0]+p[0][0]*h,u[1]+p[0][1]*h]),t.push(r),t.push([u[0]-p[0][0]*h,u[1]-p[0][1]*h]),t.push([u[0]-p[0][0]*l,u[1]-p[0][1]*l]);for(let f=1;f=2?t[1]:this._add2(t[0],e*this._defaultSize,s*this._defaultSize)}_cp3(t,e,s,r){if(t.length>=3)return t[2];const n=this._mix(t[0],1-s,e,s),o=this._sub(e,t[0]);return this._normalize(o),this._rightPerpendicular(o),[n[0]+o[0]*r*this._defaultSize,n[1]+o[1]*r*this._defaultSize]}_arrowPath(t){if(t.length>2)return t;const e=t[0],s=this._cp2(t,-4,0),r=this._sub(e,s);this._normalize(r);const n=this._rightPerp(r);return[e,s,[e[0]+(n[0]-r[0])*this._defaultSize,e[1]+(n[1]-r[1])*this._defaultSize]]}_arrowLastSeg(t){const e=t[0],s=this._cp2(t,-4,0);let r;if(t.length>=3)r=t[t.length-1];else{const n=this._sub(e,s);this._normalize(n);const o=this._rightPerp(n);r=[e[0]+(o[0]-n[0])*this._defaultSize,e[1]+(o[1]-n[1])*this._defaultSize]}return[s,r]}_processGeom(t){if(!t)return null;const e=[];for(const s of t){if(!s||s.length===0)continue;const r=s.length;let n=s[0];switch(this._rule){case T.PerpendicularFromFirstSegment:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,4),h=[];h.push(a),h.push(this._mid(n,o)),e.push(h);break}case T.ReversedFirstSegment:{const o=this._cp2(s,0,-1);e.push([o,n]);break}case T.PerpendicularToSecondSegment:{const o=this._cp2(s,-4,1),a=this._cp3(s,o,.882353,-1.94),h=[];h.push(this._mid(o,a)),h.push(n),e.push(h);break}case T.SecondSegmentWithTicks:{const o=this._cp2(s,-4,1),a=this._cp3(s,o,.882353,-1.94),h=this._sub(a,o);let l;l=this._crossProduct(h,this._sub(n,o))>0?this._rightPerp(l):this._leftPerp(h);const c=[];c.push([o[0]+(l[0]-h[0])/3,o[1]+(l[1]-h[1])/3]),c.push(o),c.push(a),c.push([a[0]+(l[0]+h[0])/3,a[1]+(l[1]+h[1])/3]),e.push(c);break}case T.DoublePerpendicular:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,3),h=this._mid(n,o),l=this._sub(h,a);this._normalize(l);const c=this._crossProduct(l,this._sub(n,a));this._leftPerpendicular(l);const u=[];u.push(n),u.push([a[0]+l[0]*c,a[1]+l[1]*c]),e.push(u);const d=[];d.push([a[0]-l[0]*c,a[1]-l[1]*c]),d.push(o),e.push(d);break}case T.OppositeToFirstSegment:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,3),h=this._mid(n,o),l=this._sub(h,a);this._normalize(l);const c=this._crossProduct(l,this._sub(n,a));this._leftPerpendicular(l);const u=[];u.push([a[0]+l[0]*c,a[1]+l[1]*c]),u.push([a[0]-l[0]*c,a[1]-l[1]*c]),e.push(u);break}case T.TriplePerpendicular:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,4),h=this._mid(n,o),l=this._sub(h,a);this._normalize(l);const c=this._crossProduct(l,this._sub(n,a));this._leftPerpendicular(l);const u=[];u.push([a[0]+l[0]*c*.8,a[1]+l[1]*c*.8]),u.push([h[0]+.8*(n[0]-h[0]),h[1]+.8*(n[1]-h[1])]),e.push(u),e.push([a,h]);const d=[];d.push([a[0]-l[0]*c*.8,a[1]-l[1]*c*.8]),d.push([h[0]+.8*(o[0]-h[0]),h[1]+.8*(o[1]-h[1])]),e.push(d);break}case T.HalfCircleFirstSegment:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,4),h=this._mid(n,o);let l=this._sub(o,n);const c=Math.cos(Math.PI/18),u=Math.sin(Math.PI/18),d=Math.sqrt((1+c)/2),p=Math.sqrt((1-c)/2),m=[];let f;this._crossProduct(l,this._sub(a,n))>0?(m.push(n),l=this._sub(n,h),f=o):(m.push(o),l=this._sub(o,h),f=n),this._rotateDirect(l,d,p),l[0]/=d,l[1]/=d;for(let _=1;_<=18;_++)m.push(this._add(h,l)),this._rotateDirect(l,c,u);m.push(f),e.push(m);break}case T.HalfCircleSecondSegment:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,1,-1);let h=this._sub(n,o);this._normalize(h);const l=this._crossProduct(h,this._sub(a,o))/2;this._leftPerpendicular(h);const c=[o[0]+h[0]*l,o[1]+h[1]*l];h=this._sub(o,c);const u=Math.cos(Math.PI/18);let d=Math.sin(Math.PI/18);l>0&&(d=-d);const p=[o];for(let m=1;m<=18;m++)this._rotateDirect(h,u,d),p.push(this._add(c,h));e.push(p);break}case T.HalfCircleExtended:{const o=this._cp2(s,0,-2),a=this._cp3(s,o,1,-1);let h;if(r>=4)h=s[3];else{const m=this._sub(n,o);h=this._add(a,m)}const l=this._dist(o,a)/2/.75,c=this._sub(o,n);this._normalize(c,l);const u=this._sub(a,h);this._normalize(u,l);const d=[h,a];e.push(d);const p=[this._clone(a)];this._addBezier3(p,a,this._add(a,u),this._add(o,c),o,4),p.push(n),e.push(p);break}case T.OpenCircle:{const o=this._cp2(s,-2,0),a=this._sub(o,n),h=Math.cos(Math.PI/18),l=-Math.sin(Math.PI/18),c=[o];for(let u=1;u<=33;u++)this._rotateDirect(a,h,l),c.push(this._add(n,a));e.push(c);break}case T.CoverageEdgesWithTicks:{const o=this._cp2(s,0,-1);let a,h;if(r>=3)a=s[2];else{const d=this._sub(o,n),p=this._leftPerp(d);a=[n[0]+p[0]-.25*d[0],n[1]+p[1]-.25*d[1]]}if(r>=4)h=s[3];else{const d=this._mid(n,o),p=this._sub(n,o);this._normalize(p),this._leftPerpendicular(p);const m=this._crossProduct(p,this._sub(a,d));this._rightPerpendicular(p),h=[a[0]+p[0]*m*2,a[1]+p[1]*m*2]}const l=this._sub(o,n);let c,u;c=this._crossProduct(l,this._sub(a,n))>0?this._rightPerp(l):this._leftPerp(l),u=[],u.push(a),u.push(n),u.push([n[0]+(c[0]-l[0])/3,n[1]+(c[1]-l[1])/3]),e.push(u),c=this._crossProduct(l,this._sub(h,o))>0?this._rightPerp(c):this._leftPerp(l),u=[],u.push([o[0]+(c[0]+l[0])/3,o[1]+(c[1]+l[1])/3]),u.push(o),u.push(h),e.push(u);break}case T.GapExtentWithDoubleTicks:{const o=this._cp2(s,0,2),a=this._cp3(s,o,0,1);let h;if(r>=4)h=s[3];else{const l=this._sub(o,n);h=this._add(a,l)}this._addAngledTicks(e,n,o,this._mid(a,h)),this._addAngledTicks(e,a,h,this._mid(n,o));break}case T.GapExtentMidline:{const o=this._cp2(s,2,0),a=this._cp3(s,o,0,1);let h;if(r>=4)h=s[3];else{const c=this._sub(o,n);h=this._add(a,c)}const l=[];l.push(this._mid(n,a)),l.push(this._mid(o,h)),e.push(l);break}case T.Chevron:{const o=this._cp2(s,-1,-1);let a;if(r>=3)a=s[2];else{const h=this._sub(o,n);this._leftPerpendicular(h),a=this._add(n,h)}e.push([o,this._makeCtrlPt(n),a]);break}case T.PerpendicularWithArc:{const o=this._cp2(s,0,-2),a=this._cp3(s,o,.5,-1);let h=this._sub(o,n);const l=this._norm(h);h[0]/=l,h[1]/=l;const c=this._crossProduct(h,this._sub(a,n));let u=this._dotProduct(h,this._sub(a,n));u<.05*l?u=.05*l:u>.95*l&&(u=.95*l);const d=[n[0]+h[0]*u,n[1]+h[1]*u];this._leftPerpendicular(h);let p=[];p.push([d[0]-h[0]*c,d[1]-h[1]*c]),p.push([d[0]+h[0]*c,d[1]+h[1]*c]),e.push(p);const m=[o[0]+h[0]*c,o[1]+h[1]*c];h=this._sub(o,m);const f=Math.cos(Math.PI/18);let _=Math.sin(Math.PI/18);c<0&&(_=-_),p=[n,o];for(let g=1;g<=9;g++)this._rotateDirect(h,f,_),p.push(this._add(m,h));e.push(p);break}case T.ClosedHalfCircle:{const o=this._cp2(s,2,0),a=this._mid(n,o),h=this._sub(o,a),l=Math.cos(Math.PI/18),c=Math.sin(Math.PI/18),u=[n,o];for(let d=1;d<=18;d++)this._rotateDirect(h,l,c),u.push(this._add(a,h));e.push(u);break}case T.TripleParallelExtended:{const o=this._cp2(s,0,-2),a=this._cp3(s,o,1,-2),h=this._mid(n,o),l=this._sub(a,o);this._normalize(l);const c=Math.abs(this._crossProduct(l,this._sub(h,o)))/2,u=this._dist(o,a),d=[o,n];d.push([n[0]+l[0]*u*.5,n[1]+l[1]*u*.5]),e.push(d);const p=[];p.push([h[0]-l[0]*c,h[1]-l[1]*c]),p.push([h[0]+l[0]*u*.375,h[1]+l[1]*u*.375]),nr(p[p.length-1],1),p.push([h[0]+l[0]*u*.75,h[1]+l[1]*u*.75]),e.push(p);const m=[o,a];e.push(m);break}case T.ParallelWithTicks:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(a,o);this._normalize(h);const l=this._crossProduct(h,this._sub(a,n));this._leftPerpendicular(h),this._addAngledTicks(e,n,o,a),this._addAngledTicks(e,this._mix(n,1,h,l),this._mix(o,1,h,l),this._mid(n,o));break}case T.Parallel:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,n);this._normalize(h);const l=this._leftPerp(h),c=this._crossProduct(h,this._sub(a,n));let u=[n,o];e.push(u),u=[],u.push([n[0]+l[0]*c,n[1]+l[1]*c]),u.push([o[0]+l[0]*c,o[1]+l[1]*c]),e.push(u);break}case T.PerpendicularToFirstSegment:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._mid(n,o),l=this._sub(o,n);this._normalize(l);const c=this._crossProduct(l,this._sub(a,n));this._leftPerpendicular(l);const u=[];u.push([h[0]-l[0]*c*.25,h[1]-l[1]*c*.25]),u.push([h[0]+l[0]*c*1.25,h[1]+l[1]*c*1.25]),e.push(u);break}case T.ParallelOffset:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,n);this._normalize(h);const l=this._crossProduct(h,this._sub(a,n));this._leftPerpendicular(h);const c=[];c.push([n[0]-h[0]*l,n[1]-h[1]*l]),c.push([o[0]-h[0]*l,o[1]-h[1]*l]),e.push(c);const u=[];u.push([n[0]+h[0]*l,n[1]+h[1]*l]),u.push([o[0]+h[0]*l,o[1]+h[1]*l]),e.push(u);break}case T.OffsetOpposite:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,n);this._normalize(h);const l=this._crossProduct(h,this._sub(a,n));this._leftPerpendicular(h);const c=[];c.push([n[0]-h[0]*l,n[1]-h[1]*l]),c.push([o[0]-h[0]*l,o[1]-h[1]*l]),e.push(c);break}case T.OffsetSame:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,n);this._normalize(h);const l=this._crossProduct(h,this._sub(a,n));this._leftPerpendicular(h);const c=[];c.push([n[0]+h[0]*l,n[1]+h[1]*l]),c.push([o[0]+h[0]*l,o[1]+h[1]*l]),e.push(c);break}case T.CircleWithArc:{let o=this._cp2(s,3,0);const a=this._cp3(s,o,.5,-1);let h,l;if(r>=4)h=s[3],l=this._crossProduct(this._sub(h,o),this._sub(a,o))>0;else{h=o,l=this._crossProduct(this._sub(h,n),this._sub(a,n))>0;const m=24*this._geomUnitsPerPoint,f=this._sub(h,n);this._normalize(f,m);const _=Math.sqrt(2)/2;this._rotateDirect(f,_,l?_:-_),o=this._add(n,f)}const c=this._sub(o,n),u=Math.cos(Math.PI/18),d=Math.sin(Math.PI/18),p=[o];for(let m=1;m<=36;m++)this._rotateDirect(c,u,d),p.push(this._add(n,c));this._add90DegArc(p,o,h,a,l),nr(p[p.length-8],1),e.push(p);break}case T.DoubleJog:{let o,a,h=this._cp2(s,-3,1);if(o=r>=3?s[2]:this._add(n,this._sub(n,h)),r>=4)a=s[3];else{const g=n;n=h,a=o;const y=this._dist(n,g),P=this._dist(a,g);let w=30*this._geomUnitsPerPoint;.5*y0?this._rotateDirect(f,m,-m):this._rotateDirect(f,m,m);let _=[];_.push(h),_.push(this._add(l,f)),_.push(this._sub(l,f)),_.push(n),e.push(_),f=this._sub(a,o),this._normalize(f,p),this._crossProduct(f,this._sub(n,o))<0?this._rotateDirect(f,m,m):this._rotateDirect(f,m,-m),_=[],_.push(o),_.push(this._add(c,f)),_.push(this._sub(c,f)),_.push(a),e.push(_);break}case T.PerpendicularOffset:{const o=this._cp2(s,-4,1),a=this._cp3(s,o,.882353,-1.94),h=this._sub(a,o);this._crossProduct(h,this._sub(n,o))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const l=[h[0]/8,h[1]/8],c=this._sub(this._mid(o,a),l);e.push([c,n]);break}case T.LineExcludingLastSegment:{const o=this._arrowPath(s),a=[];let h=o.length-2;for(;h--;)a.push(o[h]);e.push(a);break}case T.MultivertexArrow:{const o=this._arrowPath(s),a=[];this._addArrow(a,o,!1),e.push(a);break}case T.CrossedArrow:{const o=this._arrowPath(s),a=[];this._addArrow(a,o,!0),e.push(a);break}case T.ChevronArrow:{const[o,a]=this._arrowLastSeg(s),h=10*this._geomUnitsPerPoint,l=this._sub(n,o);this._normalize(l);const c=this._crossProduct(l,this._sub(a,o)),u=this._leftPerp(l),d=[a[0]-u[0]*c*2,a[1]-u[1]*c*2],p=[];p.push([a[0]+l[0]*h,a[1]+l[1]*h]),p.push(n),p.push([d[0]+l[0]*h,d[1]+l[1]*h]),e.push(p);break}case T.ChevronArrowOffset:{const[o,a]=this._arrowLastSeg(s),h=this._sub(n,o);this._normalize(h);const l=this._crossProduct(h,this._sub(a,o));this._leftPerpendicular(h);const c=[a[0]-h[0]*l,a[1]-h[1]*l],u=[];u.push([c[0]+h[0]*l*.5,c[1]+h[1]*l*.5]),u.push(this._mid(c,n)),u.push([c[0]-h[0]*l*.5,c[1]-h[1]*l*.5]),e.push(u);break}case T.PartialFirstSegment:{const[o,a]=this._arrowLastSeg(s),h=this._sub(n,o);this._normalize(h);const l=this._crossProduct(h,this._sub(a,o));this._leftPerpendicular(h);const c=[a[0]-h[0]*l,a[1]-h[1]*l];e.push([o,c]);break}case T.Arch:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,1),h=this._sub(n,o),l=this._mix(a,1,h,.55),c=this._mix(a,1,h,-.55),u=[n];this._addBezier2(u,n,l,a,4),this._addBezier2(u,a,c,o,4),e.push(u);break}case T.CurvedParallelTicks:{const o=this._cp2(s,-4,1),a=this._cp3(s,o,.882353,-1.94),h=this._sub(a,o);this._crossProduct(h,this._sub(n,o))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const l=[h[0]/8,h[1]/8],c=this._sub(this._mid(o,a),l),u=this._sub(this._mix(o,.75,a,.25),l),d=this._sub(this._mix(o,.25,a,.75),l),p=[o];this._addBezier2(p,o,u,c,3),this._addBezier2(p,c,d,a,3),e.push(p);for(let m=0;m<8;m++){const f=p[2*m+1],_=[this._clone(f)];_.push(this._add(f,[h[0]/4,h[1]/4])),e.push(_)}break}case T.Arc90Degrees:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,1),h=[o];this._add90DegArc(h,o,n,a),e.push(h);break}case T.FullGeometry:default:e.push(s)}}return e}},Do=class is{static local(){return is.instance===null&&(is.instance=new is),is.instance}execute(t,e,s,r,n){return new Wl(t,e,s)}};Do.instance=null;let Wl=class extends Ui{constructor(t,e,s){super(t,!0,!0),this._curveHelper=new Dt,this._beginCut=(e.beginCut!==void 0?e.beginCut:1)*s,this._endCut=(e.endCut!==void 0?e.endCut:1)*s,this._middleCut=(e.middleCut!==void 0?e.middleCut:0)*s,this._invert=e.invert!==void 0&&e.invert,this._beginCut<0&&(this._beginCut=0),this._endCut<0&&(this._endCut=0),this._middleCut<0&&(this._middleCut=0)}processPath(t){const{_beginCut:e,_endCut:s,_middleCut:r}=this,n=t.pathLength(),o=N.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._invert){if(e!==0||s!==0||r!==0)if(e+s+r>=n)for(o.startPath();t.nextPoint();)o.pushXY(t.x,t.y);else this._curveHelper.appendSubCurve(o,t,0,e),this._curveHelper.appendSubCurve(o,t,.5*(n-r),.5*(n+r)),this._curveHelper.appendSubCurve(o,t,n-s,s)}else if(e===0&&s===0&&r===0)for(o.startPath();t.nextPoint();)o.pushXY(t.x,t.y);else e+s+r0&&(n/=this._currentPosition.segmentLength),this._currentPosition.copyTo(e);e.abscissa+t*this._partLengthRatio>e.segmentLength+this._tolerance;){if(s){if(s.pathSize===0)if(n===0){const a=e.segment[0];s.pushXY(a[0],a[1])}else s.pushPoint(this.getSegCoord2D(e.segment,n));const o=e.segment[1];s.pushXY(o[0],o[1])}if(n=0,t-=(e.segmentLength-e.abscissa)/this._partLengthRatio,this._partSegCount)e.segment=this._nextSegment(),e.segmentLength=this.getSegLength(e.segment),e.abscissa=0,this._partSegCount--;else{if(!this._setPosAtNextPart())return r!==Ut.FAIL&&(e.segmentLength=this.getSegLength(e.segment),e.isPartEnd=!0,r===Ut.END?(e.abscissa=e.segmentLength,e.isPathEnd=!0):e.abscissa=e.segmentLength+t,!0);this._currentPosition.copyTo(e)}}if(e.abscissa+=t*this._partLengthRatio,s){s.pathSize===0&&(n===0?s.pushPoint(e.segment[0]):s.pushPoint(this.getSegCoord2D(e.segment,n)));const o=e.abscissa/e.segmentLength;o===1?s.pushPoint(e.segment[1]):s.pushPoint(this.getSegCoord2D(e.segment,o))}return this._partSegCount||Math.abs(e.abscissa-e.segmentLength)=this._pathCursor.pathSize&&(s=0),this._ctrlPtEnd=this._pathCursor.getControlPointAt(s),this._patternLength>0){const r=this._ctrlPtBegin?this._partCtrlPtGap:this._partExtPtGap,n=this._ctrlPtEnd?this._partCtrlPtGap:this._partExtPtGap;let o=Math.round((this._partLength-(r+n))/this._patternLength);o<=0&&(o=r+n>0?0:1),this._partLengthRatio=this._partLength/(r+n+o*this._patternLength),this._partLengthRatio<.01&&(this._partLengthRatio=1)}else this._partLengthRatio=1;return!0}_hasNextSegment(){return this._seg=e;)r-=e,e=this._pattern.nextValue(),o=!o;e-=r,o?(this._walker.nextPosition(e),e=this._pattern.nextValue()):this.isClosed&&(this._firstCurve=this._walker.nextCurve(e),e=this._pattern.nextValue(),this._walker.nextPosition(e),e=this._pattern.nextValue())}let s=this._walker.nextCurve(e);if(s)if(this._walker.isPathEnd()){if(this.iteratePath=!1,this._firstCurve){for(this._firstCurve.nextPath();this._firstCurve.nextPoint();)s.pushXY(this._firstCurve.x,this._firstCurve.y);this._firstCurve=null}}else e=this._pattern.nextValue(),!this._walker.nextPosition(e)||this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(s.pushCursor(this._firstCurve),this._firstCurve=null)):this.iteratePath=!0;else this.iteratePath=!1,s=this._firstCurve,this._firstCurve=null;return s==null||s.reset(),s}},Bo=class ns{static local(){return ns.instance===null&&(ns.instance=new ns),ns.instance}execute(t,e,s,r,n,o){return new Zl(t,e,s,r,n,o)}};Bo.instance=null;let Zl=class{constructor(t,e,s,r,n,o){switch(this._inputGeometries=t,this._tileKey=r,this._geometryEngine=n,this._maxInflateSize=o*s,this._width=(e.width!==void 0?e.width:2)*s,e.method){case Be.Mitered:case Be.Bevelled:case Be.Rounded:case Be.TrueBuffer:case Be.Square:}this._option=e.option}next(){let t;for(;t=this._inputGeometries.next();){if(t.geometryType==="esriGeometryEnvelope"&&this._width>0){const e=t.asJSON();return Math.min(e.xmax-e.xmin,e.ymax-e.ymin)-2*this._width<0?t:N.fromJSONCIM({paths:[[[e.xmin+this._width,e.ymin+this._width],[e.xmax-this._width,e.ymin+this._width],[e.xmax-this._width,e.ymax-this._width],[e.xmin+this._width,e.ymax-this._width],[e.xmin+this._width,e.ymin+this._width]],[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]})}if(t.geometryType==="esriGeometryPolygon"){if(this._width===0)return t.clone();const e=this._geometryEngine;if(e==null)return null;const s=this._tileKey?an(t,this._maxInflateSize):t.clone();if(!s)continue;const r=e.buffer(en.WebMercator,s.asJSON(),-this._width,1);if(r){for(const n of r.rings)if(n){s.startPath();for(const o of n.reverse())s.pushXY(o[0],s.yFactor*o[1])}}return s}}return null}},Vo=class os{static local(){return os.instance===null&&(os.instance=new os),os.instance}execute(t,e,s,r,n){return new jl(t,e,s)}};Vo.instance=null;let jl=class extends Ui{constructor(t,e,s){super(t,!1,!0),this._curveHelper=new Dt,this._length=(e.length!==void 0?e.length:20)*s,this._angle=e.angle!==void 0?e.angle:225,this._position=e.position!==void 0?e.position:50,this._length<0&&(this._length=-this._length),this._position<20&&(this._position=20),this._position>80&&(this._position=80),this._mirror=!1}processPath(t){const e=N.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._curveHelper.isEmpty(t))return null;t.seekInPath(0);const s=t.x,r=t.y;t.seekInPath(t.pathSize-1);const n=t.x,o=t.y,a=[n-s,o-r];this._curveHelper.normalize(a);const h=s+(n-s)*this._position/100,l=r+(o-r)*this._position/100,c=Math.cos((90-this._angle)/180*Math.PI);let u=Math.sin((90-this._angle)/180*Math.PI);this._mirror&&(u=-u),this._mirror=!this._mirror;const d=[h-this._length/2*c,l-this._length/2*u],p=[h+this._length/2*c,l+this._length/2*u];return e.pushPath([[s,r],d,p,[n,o]]),e}},Yo=class as{static local(){return as.instance===null&&(as.instance=new as),as.instance}execute(t,e,s,r,n){return new Kl(t,e,s)}};Yo.instance=null;let Kl=class{constructor(t,e,s){this._inputGeometries=t,this._offsetX=e.offsetX!==void 0?e.offsetX*s:0,this._offsetY=e.offsetY!==void 0?e.offsetY*s:0}next(){let t=this._inputGeometries.next();for(;t;){if(t.totalSize>0)return this._move(t.clone(),this._offsetX,this._offsetY);t=this._inputGeometries.next()}return null}_move(t,e,s){for(;t.nextPath();)for(;t.nextPoint();)t.x=t.x+e,t.y=t.y+s;return t.reset(),t}};const Jl=10;let Ho=class hs{static local(){return hs.instance===null&&(hs.instance=new hs),hs.instance}execute(t,e,s,r,n,o){return new Ql(t,e,s,r,n,o)}};Ho.instance=null;let Ql=class{constructor(t,e,s,r,n,o){this._inputGeometries=t,this._tileKey=r,this._geometryEngine=n,this._curveHelper=new Dt,this._offset=(e.offset??1)*s,this._method=e.method,this._maxInflateSize=Math.max(Math.abs(o*s),Jl),this._option=e.option,this._offsetFlattenError=Is*s}next(){let t;for(;t=this._inputGeometries.next();){if(this._offset===0)return t.clone();if(t.geometryType==="esriGeometryEnvelope"){if(this._method===oe.Rounded&&this._offset>0){const o=le(t),a=this._curveHelper.offset(o,-this._offset,this._method,4,this._offsetFlattenError);if(a){const h=N.createEmptyOptimizedCIM(t.geometryType);return h.pushPath(a),h}return null}const n=t.asJSON();if(mt(n)&&Math.min(n.xmax-n.xmin,n.ymax-n.ymin)+2*this._offset>0)return N.fromJSONCIM({xmin:n.xmin-this._offset,xmax:n.xmax+this._offset,ymin:n.ymin-this._offset,ymax:n.ymax+this._offset})}const e=this._geometryEngine;if(e==null)continue;const s=this._tileKey?an(t,this._maxInflateSize):t.clone();if(!s)continue;const r=e.offset(en.WebMercator,s.asJSON(),-this._offset,1,this._method,4,this._offsetFlattenError);return r?N.fromJSONCIM(r):null}return null}},Uo=class ls{static local(){return ls.instance===null&&(ls.instance=new ls),ls.instance}execute(t,e,s,r,n){return new tc(t,e,s)}};Uo.instance=null;let tc=class{constructor(t,e,s){this._inputGeometries=t,this._reverse=e.reverse===void 0||e.reverse}next(){let t=this._inputGeometries.next();for(;t;){if(!this._reverse)return t;if(t.geometryType==="esriGeometryPolyline")return ec(t.clone());t=this._inputGeometries.next()}return null}};function ec(i){for(;i.nextPath();)for(let t=0;t0){const e=Vi(t),s=(e[2]+e[0])/2,r=(e[3]+e[1])/2;return t.reset(),this._rotate(t.clone(),s,r)}t=this._inputGeometries.next()}return null}_rotate(t,e,s){const r=Math.cos(this._rotateAngle),n=Math.sin(this._rotateAngle);for(;t.nextPath();)for(;t.nextPoint();){const o=t.x-e,a=t.y-s;t.x=e+o*r-a*n,t.y=s+o*n+a*r}return t.reset(),t}},Wo=class us{static local(){return us.instance===null&&(us.instance=new us),us.instance}execute(t,e,s,r,n){return new ic(t,e,s)}};Wo.instance=null;let ic=class{constructor(t,e,s){this._inputGeometries=t,this._xFactor=e.XScaleFactor!==void 0?e.XScaleFactor:1.15,this._yFactor=e.YScaleFactor!==void 0?e.YScaleFactor:1.15}next(){const t=this._inputGeometries.next();if(t){if(this._xFactor===1&&this._yFactor===1||t.geometryType==="esriGeometryPoint")return t;if(t.totalSize>0){const e=Vi(t),s=(e[2]+e[0])/2,r=(e[3]+e[1])/2;return t.reset(),this._scaleCursor(t.clone(),s,r)}}return null}_scaleCursor(t,e,s){for(;t.nextPath();)for(;t.nextPoint();)t.x=e+(t.x-e)*this._xFactor,t.y=s+(t.y-s)*this._yFactor;return t.reset(),t}},qo=class ps{static local(){return ps.instance===null&&(ps.instance=new ps),ps.instance}execute(t,e,s,r,n){return new rc(t,e,s)}};qo.instance=null;let rc=class{constructor(t,e,s){this._inputGeometries=t,this._height=(e.amplitude!==void 0?e.amplitude:2)*s,this._period=(e.period!==void 0?e.period:3)*s,this._style=e.waveform,this._height<=0&&(this._height=Math.abs(this._height)),this._period<=0&&(this._period=Math.abs(this._period)),this._pattern=new Xi,this._pattern.addValue(this._period),this._pattern.addValue(this._period),this._walker=new Wi,this._walker.updateTolerance(s)}next(){let t=this._inputGeometries.next();for(;t;){if(this._height===0||this._period===0)return t;const e=this._processGeom(t);if(e)return e;t=this._inputGeometries.next()}return null}_processGeom(t){const e=N.createEmptyOptimizedCIM(t.geometryType);for(;t.nextPath();){e.startPath();const s=t.pathLength();if(this._walker.init(t,this._pattern))switch(this._style){case Ds.Sinus:default:this._constructCurve(e,s,!1);break;case Ds.Square:this._constructSquare(e,s);break;case Ds.Triangle:this._constructTriangle(e,s);break;case Ds.Random:this._constructCurve(e,s,!0)}else for(;t.nextPoint();)e.pushXY(t.x,t.y)}return e}_constructCurve(t,e,s){let r=Math.round(e/this._period);r===0&&(r=1);const n=r*16+1,o=e/r,a=this._period/16,h=1/n,l=2*Math.PI*e/o,c=2*Math.PI*Math.random(),u=2*Math.PI*Math.random(),d=2*Math.PI*Math.random(),p=.75-Math.random()/2,m=.75-Math.random()/2,f=new zt;this._walker.curPointAndAngle(f),t.pushPoint(f.pt);let _=0;for(;;){if(!this._walker.nextPointAndAngle(a,f)){t.pushPoint(this._walker.getPathEnd());break}{const g=_;let y;if(_+=h,s){const P=this._height/2*(1+.3*Math.sin(p*l*g+c));y=P*Math.sin(l*g+u),y+=P*Math.sin(m*l*g+d),y/=2}else y=.5*this._height*Math.sin(.5*l*g);t.pushXY(f.pt[0]-y*f.sa,f.pt[1]+y*f.ca)}}}_constructSquare(t,e){Math.round(e/this._period);let s=!0;for(;;){let r=!1;if(this._walker.curPositionIsValid()){const n=new zt;this._walker.curPointAndAngle(n);const o=new zt;if(this._walker.nextPointAndAngle(this._period,o)){const a=new zt;this._walker.nextPointAndAngle(this._period,a)&&(s?(t.pushPoint(n.pt),s=!1):t.pushPoint(n.pt),t.pushXY(n.pt[0]-this._height/2*n.sa,n.pt[1]+this._height/2*n.ca),t.pushXY(o.pt[0]-this._height/2*o.sa,o.pt[1]+this._height/2*o.ca),t.pushXY(o.pt[0]+this._height/2*o.sa,o.pt[1]-this._height/2*o.ca),t.pushXY(a.pt[0]+this._height/2*a.sa,a.pt[1]-this._height/2*a.ca),r=!0)}}if(!r){t.pushPoint(this._walker.getPathEnd());break}}}_constructTriangle(t,e){Math.round(e/this._period);let s=!0;for(;;){let r=!1;if(this._walker.curPositionIsValid()){const n=new zt;this._walker.curPointAndAngle(n);const o=new zt;if(this._walker.nextPointAndAngle(this._period/2,o)){const a=new zt;this._walker.nextPointAndAngle(this._period,a)&&(this._walker.nextPosition(this._period/2)&&(s?(t.pushPoint(n.pt),s=!1):t.pushPoint(n.pt),t.pushXY(o.pt[0]-this._height/2*o.sa,o.pt[1]+this._height/2*o.ca),t.pushXY(a.pt[0]+this._height/2*a.sa,a.pt[1]-this._height/2*a.ca)),r=!0)}}if(!r){t.pushPoint(this._walker.getPathEnd());break}}}},Zo=class ds{static local(){return ds.instance===null&&(ds.instance=new ds),ds.instance}execute(t,e,s,r,n){return new nc(t,e,s)}};Zo.instance=null;let nc=class extends Ns{constructor(t,e,s){super(t),this._geometryWalker=new Wi,this._geometryWalker.updateTolerance(s),this._angleToLine=e.angleToLine??!0,this._offset=(e.offset?e.offset:0)*s,this._originalEndings=e.endings,this._offsetAtEnd=(e.customEndingOffset?e.customEndingOffset:0)*s,this._position=-(e.offsetAlongLine?e.offsetAlongLine:0)*s,this._pattern=new Xi,this._pattern.init(e.placementTemplate,!1),this._pattern.scale(s),this._endings=this._originalEndings}processPath(t){if(this._pattern.isEmpty())return null;let e;if(this.iteratePath)e=this._pattern.nextValue();else{this._originalEndings===Ct.WithFullGap&&this.isClosed?this._endings=Ct.WithMarkers:this._endings=this._originalEndings,this._pattern.extPtGap=0;let r,n=!0;switch(this._endings){case Ct.NoConstraint:r=-this._position,r=this._adjustPosition(r),n=!1;break;case Ct.WithHalfGap:default:r=-this._pattern.lastValue()/2;break;case Ct.WithFullGap:r=-this._pattern.lastValue(),this._pattern.extPtGap=this._pattern.lastValue();break;case Ct.WithMarkers:r=0;break;case Ct.Custom:r=-this._position,r=this._adjustPosition(r),this._pattern.extPtGap=.5*this._offsetAtEnd}if(!this._geometryWalker.init(t,this._pattern,n))return null;this._pattern.reset();let o=0;for(;r>o;)r-=o,o=this._pattern.nextValue();o-=r,e=o,this.iteratePath=!0}const s=new zt;return this._geometryWalker.nextPointAndAngle(e,s)?this._endings===Ct.WithFullGap&&this._geometryWalker.isPathEnd()?(this.iteratePath=!1,null):this._endings===Ct.WithMarkers&&this._geometryWalker.isPathEnd()&&(this.iteratePath=!1,this.isClosed)?null:(this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca),this._angleToLine&&this.internalPlacement.setRotateCS(s.ca,s.sa),this.internalPlacement):(this.iteratePath=!1,null)}_adjustPosition(t){let e=t/this._pattern.length();return e-=Math.floor(e),e*this._pattern.length()}},jo=class fs{static local(){return fs.instance===null&&(fs.instance=new fs),fs.instance}execute(t,e,s,r,n){return new oc(t,e,s)}};jo.instance=null;let oc=class extends Ns{constructor(t,e,s){super(t,!1,!0),this._curveHelper=new Dt,this._angleToLine=e.angleToLine===void 0||e.angleToLine,this._offset=e.offset!==void 0?e.offset*s:0,this._type=e.extremityPlacement,this._position=e.offsetAlongLine!==void 0?e.offsetAlongLine*s:0,this._beginProcessed=!1}processPath(t){let e;switch(this._type){case Xt.Both:default:this._beginProcessed?(e=this._atExtremities(t,this._position,!1),this._beginProcessed=!1,this.iteratePath=!1):(e=this._atExtremities(t,this._position,!0),this._beginProcessed=!0,this.iteratePath=!0);break;case Xt.JustBegin:e=this._atExtremities(t,this._position,!0);break;case Xt.JustEnd:e=this._atExtremities(t,this._position,!1);case Xt.None:}return e}_atExtremities(t,e,s){if(s||t.seekPathEnd(),s?t.nextPoint():t.prevPoint()){let r=0,[n,o]=[0,0],[a,h]=[t.x,t.y];for(;s?t.nextPoint():t.prevPoint();){n=a,o=h,a=t.x,h=t.y;const l=this._curveHelper.getLength(n,o,a,h);if(r+l>e){const c=(e-r)/l,[u,d]=this._curveHelper.getAngleCS(n,o,a,h,c),p=this._curveHelper.getCoord2D(n,o,a,h,c);return this.internalPlacement.setTranslate(p[0]-this._offset*d,p[1]+this._offset*u),this._angleToLine&&this.internalPlacement.setRotateCS(-u,-d),this.internalPlacement}r+=l}}return null}},Ko=class ms{static local(){return ms.instance===null&&(ms.instance=new ms),ms.instance}execute(t,e,s,r,n){return new ac(t,e,s)}};Ko.instance=null;let ac=class extends Ns{constructor(t,e,s){super(t),this._walker=new Wi,this._walker.updateTolerance(s),this._angleToLine=e.angleToLine===void 0||e.angleToLine,this._offset=e.offset!==void 0?e.offset*s:0,this._beginGap=e.beginPosition!==void 0?e.beginPosition*s:0,this._endGap=e.endPosition!==void 0?e.endPosition*s:0,this._flipFirst=e.flipFirst===void 0||e.flipFirst,this._pattern=new Xi,this._pattern.init(e.positionArray,!1,!1),this._subPathLen=0,this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0}processPath(t){if(this._pattern.isEmpty())return null;let e;if(this.iteratePath){const a=this._pattern.nextValue()*this._subPathLen,h=this._beginGap+a;e=h-this._prevPos,this._prevPos=h}else{if(this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0,this._subPathLen=t.pathLength()-this._beginGap-this._endGap,this._subPathLen<0)return this.iteratePath=!1,null;if(!this._walker.init(t,this._pattern,!1))return null;this._pattern.reset();const a=this._pattern.nextValue()*this._subPathLen,h=this._beginGap+a;e=h-this._prevPos,this._prevPos=h,this.iteratePath=!0}const s=new zt;if(!this._walker.nextPointAndAngle(e,s,Ut.END))return this.iteratePath=!1,null;this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca);const r=this._isFirst&&this._flipFirst;let n,o;return this._angleToLine?(n=s.ca,o=s.sa):(n=1,o=0),r&&(n=-n,o=-o),this.internalPlacement.setRotateCS(n,o),this._isFirst=!1,this._posCount--,this._posCount===0&&(this.iteratePath=!1),this.internalPlacement}};const Vt=512,hc=10,yt=24,Li=1e-6;let Jo=class _s{static local(){return _s.instance===null&&(_s.instance=new _s),_s.instance}execute(t,e,s,r,n){return new lc(t,e,s,r,n)}};Jo.instance=null;let lc=class te{constructor(t,e,s,r,n){if(this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,this._currentX=0,this._currentY=0,this._accelerationMap=null,this._testInsidePolygon=!1,this._verticalSubdivision=!0,this._stepX=Math.abs(e.stepX??16)*s,this._stepY=Math.abs(e.stepY??16)*s,this._stepX=Math.round(128*this._stepX)/128,this._stepY=Math.round(128*this._stepY)/128,this._stepX!==0&&this._stepY!==0){if(this._gridType=e.gridType??tr.Fixed,this._gridType===tr.Random){const o=e.seed??13,a=1;this._randomLCG=new go(o*a),this._randomness=(e.randomness??100)/100,this._gridAngle=0,this._shiftOddRows=!1,this._cosAngle=1,this._sinAngle=0,this._offsetX=0,this._offsetY=0,this._buildRandomValues()}else{if(this._randomness=0,this._gridAngle=e.gridAngle??0,this._shiftOddRows=e.shiftOddRows??!1,this._offsetX=(e.offsetX??0)*s,this._offsetY=(e.offsetY??0)*s,this._cosAngle=Math.cos(this._gridAngle/180*Math.PI),this._sinAngle=-Math.sin(this._gridAngle/180*Math.PI),this._stepX)if(this._offsetX<0)for(;this._offsetX<-.5*this._stepX;)this._offsetX+=this._stepX;else for(;this._offsetX>=.5*this._stepX;)this._offsetX-=this._stepX;if(this._stepY)if(this._offsetY<0)for(;this._offsetY<-.5*this._stepY;)this._offsetY+=this._stepY;else for(;this._offsetY>=.5*this._stepY;)this._offsetY-=this._stepY}if(this._graphicOriginX=0,this._graphicOriginY=0,r!=null){const[o,a,h,l]=r.split("/"),c=parseFloat(o),u=parseFloat(a),d=parseFloat(h),p=parseFloat(l);this._graphicOriginX=-(p*2**c+d)*Vt,this._graphicOriginY=u*Vt,this._testInsidePolygon=!0}this._internalPlacement=new Ae,this._calculateMinMax(t),this._geometryCursor=t}}next(){return this._geometryCursor?this._nextInside():null}_buildRandomValues(){if(!te._randValues){te._randValues=[];for(let t=0;t=y,this._polygonMin=this._verticalSubdivision?d:m,this._testInsidePolygon){let P=0-this._graphicOriginX-this._offsetX-this._stepX,w=Vt-this._graphicOriginX-this._offsetX+this._stepX,M=-Vt-this._graphicOriginY-this._offsetY-this._stepY,k=0-this._graphicOriginY-this._offsetY+this._stepY;if(_){const F=[[P,M],[P,k],[w,M],[w,k]];P=M=Number.MAX_VALUE,w=k=-Number.MAX_VALUE;for(const z of F){const A=this._cosAngle*z[0]-this._sinAngle*z[1],R=this._sinAngle*z[0]+this._cosAngle*z[1];P=Math.min(P,A),w=Math.max(w,A),M=Math.min(M,R),k=Math.max(k,R)}}h=h!==Number.MAX_VALUE?Math.max(h,P):P,l=l!==Number.MAX_VALUE?Math.max(l,M):M,c=c!==-Number.MAX_VALUE?Math.min(c,w):w,u=u!==-Number.MAX_VALUE?Math.min(u,k):k}this._xMin=Math.round(h/this._stepX),this._xMax=Math.round(c/this._stepX),this._yMin=Math.round(l/this._stepY),this._yMax=Math.round(u/this._stepY),this._currentX=this._xMax+1,this._currentY=this._yMin-1,this._buildAccelerationMap(t,m,f,d,p)}_buildAccelerationMap(t,e,s,r,n){t.reset();const o=new Map,a=this._verticalSubdivision,h=a?n-r:s-e;let l=Math.ceil(h/hc);if(l<=1)return;const c=Math.floor(h/l);let u,d,p,m,f,_,g,y,P,w,M;for(l++,this._delta=c,a?(P=-Vt-2*this._stepY,w=2*this._stepY,M=r):(P=-2*this._stepX,w=Vt+2*this._stepX,M=e);t.nextPath();)if(!(t.pathSize<2)&&t.nextPoint())for(u=t.x,d=t.y;t.nextPoint();u=p,d=m){if(p=t.x,m=t.y,a){if(d===m||dw&&m>w)continue;f=Math.min(d,m),_=Math.max(d,m)}else{if(u===p||uw&&p>w)continue;f=Math.min(u,p),_=Math.max(u,p)}for(;f<_;)g=Math.floor((f-M)/c),Yn(g,u,d,p,m,o),f+=c;y=Math.floor((_-M)/c),y>g&&Yn(y,u,d,p,m,o)}this._accelerationMap=o}_nextInside(){for(;;){if(this._currentX>this._xMax){if(this._currentY++,this._currentY>this._yMax)return null;this._currentX=this._xMin,this._shiftOddRows&&this._currentY%2&&this._currentX--}let t=this._currentX*this._stepX+this._offsetX;this._shiftOddRows&&this._currentY%2&&(t+=.5*this._stepX);const e=this._currentY*this._stepY+this._offsetY;let s,r;if(this._currentX++,this._gridType===tr.Random){const n=(this._currentX%yt+yt)%yt,o=(this._currentY%yt+yt)%yt;s=this._graphicOriginX+t+this._stepX*this._randomness*(.5-te._randValues[o*yt+n])*2/3,r=this._graphicOriginY+e+this._stepY*this._randomness*(.5-te._randValues[o*yt+n+1])*2/3}else s=this._graphicOriginX+this._cosAngle*t+this._sinAngle*e,r=this._graphicOriginY-this._sinAngle*t+this._cosAngle*e;if(!this._testInsidePolygon||this._isInsidePolygon(s,r,this._geometryCursor))return this._internalPlacement.setTranslate(s,r),this._internalPlacement}}_isInsidePolygon(t,e,s){if(this._accelerationMap==null)return cc(t,e,s);t+=Li,e+=Li;const r=this._verticalSubdivision,n=r?e:t,o=Math.floor((n-this._polygonMin)/this._delta),a=this._accelerationMap.get(o);if(!a)return!1;let h,l,c,u=0;for(const d of a){if(h=d[0],l=d[1],r){if(h[1]>e==l[1]>e)continue;c=(l[0]-h[0])*(e-h[1])-(l[1]-h[1])*(t-h[0])}else{if(h[0]>t==l[0]>t)continue;c=(l[1]-h[1])*(t-h[0])-(l[0]-h[0])*(e-h[1])}c>0?u++:u--}return u!==0}};function cc(i,t,e){let s,r,n,o,a=0;for(i+=Li,t+=Li,e.reset();e.nextPath();)if(e.nextPoint())for(s=e.x,r=e.y;e.nextPoint();s=n,r=o)n=e.x,o=e.y,r>t!=o>t&&((n-s)*(t-r)-(o-r)*(i-s)>0?a++:a--);return a!==0}function Yn(i,t,e,s,r,n){let o=n.get(i);o||(o=[],n.set(i,o)),o.push([[t,e],[s,r]])}const uc=.001;let Qo=class gs{static local(){return gs.instance===null&&(gs.instance=new gs),gs.instance}execute(t,e,s,r,n){return new pc(t,e,s)}};Qo.instance=null;let pc=class extends Ns{constructor(t,e,s){super(t),this._curveHelper=new Dt,this._angleToLine=e.angleToLine===void 0||e.angleToLine,this._offset=e.offset!==void 0?e.offset*s:0,this._relativeTo=e.relativeTo,this._position=e.startPointOffset!==void 0?e.startPointOffset*s:0,this._epsilon=uc*s}processPath(t){const e=this._position;if(this._relativeTo===Ve.SegmentMidpoint){if(this.iteratePath||(this.iteratePath=!0),t.nextPoint()){let[r,n]=[t.x,t.y],[o,a]=[0,0];for(;t.nextPoint();){o=t.x,a=t.y;const h=this._curveHelper.getLength(r,n,o,a);if(hr){const d=(r-o)/u,[p,m]=this._curveHelper.getAngleCS(a,h,l,c,d),f=this._curveHelper.getCoord2D(a,h,l,c,d),_=n?-this._offset:this._offset;return this.internalPlacement.setTranslate(f[0]-_*m,f[1]+_*p),this._angleToLine&&(n?this.internalPlacement.setRotateCS(-p,-m):this.internalPlacement.setRotateCS(p,m)),this.internalPlacement}a=l,h=c,o+=u}}return null}};const dc=1e-15;let ta=class ys{static local(){return ys.instance===null&&(ys.instance=new ys),ys.instance}execute(t,e,s,r,n){return new fc(t,e,s)}};ta.instance=null;let fc=class extends Ns{constructor(t,e,s){super(t),this._curveHelper=new Dt,this._angleToLine=e.angleToLine===void 0||e.angleToLine,this._offset=e.offset!==void 0?e.offset*s:0,this._endPoints=e.placeOnEndPoints===void 0||e.placeOnEndPoints,this._controlPoints=e.placeOnControlPoints===void 0||e.placeOnControlPoints,this._regularVertices=e.placeOnRegularVertices===void 0||e.placeOnRegularVertices,this._tags=[],this._tagIterator=0}processPath(t){if(this.iteratePath||(this._preparePath(t),this.iteratePath=!0),this._tagIterator>=this._tags.length)return this._tags.length=0,this._tagIterator=0,this.iteratePath=!1,null;const e=this._tags[this._tagIterator];this._angleToLine&&this.internalPlacement.setRotate(e[2]);let s=e[0],r=e[1];if(this._offset!==0){const n=Math.cos(e[2]),o=Math.sin(e[2]);s-=this._offset*o,r+=this._offset*n}return this.internalPlacement.setTranslate(s,r),this._tagIterator++,this.internalPlacement}_preparePath(t){this._tags.length=0,this._tagIterator=0,t.seekPathStart();const e=t.isClosed();let s=0,r=!1,n=0,o=0;if(t.seekPathStart(),t.nextPoint()){let a=t.x,h=t.y,l=t.getControlPoint(),c=!0,u=t.nextPoint();for(;u;){const d=t.x,p=t.y,m=t.getControlPoint();(this._angleToLine||this._offset!==0)&&(n=this._curveHelper.getAngle(a,h,d,p,0)),c?(c=!1,e?(s=n,r=l):(this._endPoints||this._controlPoints&&l)&&this._tags.push([a,h,n])):l?this._controlPoints&&this._tags.push([a,h,js(o,n)]):this._regularVertices&&this._tags.push([a,h,js(o,n)]),(this._angleToLine||this._offset!==0)&&(o=this._curveHelper.getAngle(a,h,d,p,1)),u=t.nextPoint(),u||(e?m||r?this._controlPoints&&this._tags.push([d,p,js(o,s)]):this._regularVertices&&this._tags.push([d,p,js(o,s)]):(this._endPoints||this._controlPoints&&m)&&this._tags.push([d,p,o])),a=d,h=p,l=m}}this._tagIterator=0}};function js(i,t){const e=Math.PI;for(;Math.abs(t-i)>e+2*dc;)t-i>e?t-=2*e:t+=2*e;return(i+t)/2}const mc=100*222045e-21;function _c(i){if(i.totalSize===0)return null;const t=Vi(i);if(!t)return null;const e=4*(Math.abs(t[0])+Math.abs(t[2])+Math.abs(t[1])+Math.abs(t[3])+1)*mc;let s=0,r=0;i.reset();for(let A=0;i.nextPath();A++){const R=i.getCurrentRingArea();R>r&&(r=R,s=A)}if(i.seekPath(s),i.pathSize===0)return null;i.seekPathStart();const n=fh(i);if(Math.abs(r)<=2*e*e)return[(n[0]+n[2])/2,(n[1]+n[3])/2];i.seekPathStart();const o=mh(i,ze());if(o===null)return null;if(i.totalPoints<4)return o;const a=[[NaN,NaN],[NaN,NaN],[NaN,NaN],[NaN,NaN]],h=[NaN,NaN,NaN,NaN],l=[NaN,NaN,NaN,NaN];let c=!1,u=Ye(o,i,!0);u.distance===0&&(c=!0,a[0][0]=o[0],a[0][1]=o[1],u=Ye(o,i,!1)),h[0]=u.distance,l[0]=0;const d=[NaN,NaN];let p=!1,m=.25,f=-1,_=NaN;do if(_=NaN,a[1]=ar(i,hr(n[0],n[2],m),e,t),isNaN(a[1][0])||isNaN(a[1][1])||(u=Ye(a[1],i,!1),_=u.distance),!isNaN(_)&&_>e&&pi(a[1],i))p=!0,h[1]=_,l[1]=ee(a[1],o);else if(!isNaN(_)&&_>f&&(f=_,d[0]=a[1][0],d[1]=a[1][1]),m-=.01,m<.1){if(!(f>=0))break;p=!0,h[1]=f,a[1][0]=d[0],a[1][1]=d[1],l[1]=ee(a[1],o)}while(!p);p=!1,m=.5,f=-1;let g=.01,y=1;do if(_=NaN,a[2]=ar(i,hr(n[0],n[2],m),e,t),isNaN(a[2][0])||isNaN(a[2][1])||(u=Ye(a[2],i,!1),_=u.distance),!isNaN(_)&&_>e&&pi(a[2],i))p=!0,h[2]=_,l[2]=ee(a[2],o);else if(!isNaN(_)&&_>f)f=_,d[0]=a[2][0],d[1]=a[2][1];else if(_>f&&(f=_,d[0]=a[2][0],d[1]=a[2][1]),m=.5+g*y,g+=.01,y*=-1,m<.3||m>.7){if(!(f>=0))break;p=!0,h[2]=f,a[2][0]=d[0],a[2][1]=d[1],l[2]=ee(a[2],o)}while(!p);p=!1,m=.75,f=-1;do if(_=NaN,a[3]=ar(i,hr(n[0],n[2],m),e,t),isNaN(a[3][0])||isNaN(a[3][1])||(u=Ye(a[3],i,!1),_=u.distance),!isNaN(_)&&_>e&&pi(a[3],i))p=!0,h[3]=_,l[3]=ee(a[3],o);else if(_>f&&(f=_,d[0]=a[3][0],d[1]=a[3][1]),m+=.01,m>.9){if(!(f>=0))break;p=!0,h[3]=f,a[3][0]=d[0],a[3][1]=d[1],l[3]=ee(a[3],o)}while(!p);const P=[0,1,2,3],w=c?0:1;let M;for(let A=w;A<4;A++)for(let R=w;R<3;R++){const Gt=l[R],Bt=l[R+1];xc(Gt,Bt)>0&&(M=P[R],P[R]=P[R+1],P[R+1]=M,l[R]=Bt,l[R+1]=Gt)}let k=w,F=0,z=0;for(let A=w;A<4;A++){switch(A){case 0:z=2*h[P[A]];break;case 1:z=1.66666666*h[P[A]];break;case 2:z=1.33333333*h[P[A]];break;case 3:z=h[P[A]]}z>F&&(F=z,k=P[A])}return a[k]}function pi(i,t){let e,s,r,n,o=0;for(t.reset();t.nextPath()&&t.nextPoint();)for(e=t.x,s=t.y;t.nextPoint();e=r,s=n)r=t.x,n=t.y,s>i[1]!=n>i[1]&&((r-e)*(i[1]-s)-(n-s)*(i[0]-e)>0?o++:o--);return o!==0}function Ye(i,t,e){if(e&&pi(i,t))return{coord:i,distance:0};let s=1/0,r=0,n=0,o=[0,0],a=[0,0];const h=[0,0];for(t.reset();t.nextPath()&&t.nextPoint();)if(!(t.pathSize<2))for(o[0]=t.x,o[1]=t.y;t.nextPoint();o=a){a=[t.x,t.y],_h(h,i,o,a);const l=ee(i,h);lo?fu)s&Hn?(s&Ks?(t[1]+=u*(n-t[0])/c,t[0]=n):(t[1]+=u*(a-t[0])/c,t[0]=a),s=xt(t,i)):r&Hn?(r&Ks?(e[1]+=u*(n-e[0])/c,e[0]=n):(e[1]+=u*(a-e[0])/c,e[0]=a),r=xt(e,i)):s?(s&Js?(t[0]+=c*(o-t[1])/u,t[1]=o):(t[0]+=c*(h-t[1])/u,t[1]=h),s=xt(t,i)):(r&Js?(e[0]+=c*(o-e[1])/u,e[1]=o):(e[0]+=c*(h-e[1])/u,e[1]=h),r=xt(e,i));else if(s&Un?(s&Js?(t[0]+=c*(o-t[1])/u,t[1]=o):(t[0]+=c*(h-t[1])/u,t[1]=h),s=xt(t,i)):r&Un?(r&Js?(e[0]+=c*(o-e[1])/u,e[1]=o):(e[0]+=c*(h-e[1])/u,e[1]=h),r=xt(e,i)):s?(s&Ks?(t[1]+=u*(n-t[0])/c,t[0]=n):(t[1]+=u*(a-t[0])/c,t[0]=a),s=xt(t,i)):(r&Ks?(e[1]+=u*(n-e[0])/c,e[0]=n):(e[1]+=u*(a-e[0])/c,e[0]=a),r=xt(e,i)),s&r)return 0}while(s|r);return l}function xt(i,t){return(i[0]t[2]?1:0)<<1|(i[1]t[3]?1:0)<<3}function hr(i,t,e){return i+(t-i)*e}function ee(i,t){return(i[0]-t[0])*(i[0]-t[0])+(i[1]-t[1])*(i[1]-t[1])}function xc(i,t){if(it)return 1;if(i===t)return 0;const e=isNaN(i),s=isNaN(t);return es?1:0}let ea=class xs{static local(){return xs.instance===null&&(xs.instance=new xs),xs.instance}execute(t,e,s,r,n){return new bc(t,e,s)}};ea.instance=null;let bc=class{constructor(t,e,s){this._geometryCursor=t,this._offsetX=e.offsetX!==void 0?e.offsetX*s:0,this._offsetY=e.offsetY!==void 0?e.offsetY*s:0,this._method=e.method!==void 0?e.method:Gs.OnPolygon,this._internalPlacement=new Ae}next(){const t=this._geometryCursor;return this._geometryCursor=null,t?this._polygonCenter(t):null}_polygonCenter(t){let e=!1;switch(this._method){case Gs.CenterOfMass:{const s=yh(t);s&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),e=!0)}break;case Gs.BoundingBoxCenter:{const s=Vi(t);s&&(this._internalPlacement.setTranslate((s[2]+s[0])/2+this._offsetX,(s[3]+s[1])/2+this._offsetY),e=!0)}break;case Gs.OnPolygon:default:{const s=_c(t);s!==null&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),e=!0)}}return e?this._internalPlacement:null}};function vr(i){if(!i)return null;switch(i.type){case"CIMGeometricEffectAddControlPoints":return Ao.local();case"CIMGeometricEffectArrow":return Fo.local();case"CIMGeometricEffectBuffer":return Ro.local();case"CIMGeometricEffectControlMeasureLine":return Oo.local();case"CIMGeometricEffectCut":return Do.local();case"CIMGeometricEffectDashes":return Go.local();case"CIMGeometricEffectDonut":return Bo.local();case"CIMGeometricEffectJog":return Vo.local();case"CIMGeometricEffectMove":return Yo.local();case"CIMGeometricEffectOffset":return Ho.local();case"CIMGeometricEffectReverse":return Uo.local();case"CIMGeometricEffectRotate":return Xo.local();case"CIMGeometricEffectScale":return Wo.local();case"CIMGeometricEffectWave":return qo.local()}return null}function sa(i){if(!i)return null;switch(i.type){case"CIMMarkerPlacementAlongLineSameSize":return Zo.local();case"CIMMarkerPlacementAtExtremities":return jo.local();case"CIMMarkerPlacementAtRatioPositions":return Ko.local();case"CIMMarkerPlacementInsidePolygon":return Jo.local();case"CIMMarkerPlacementOnLine":return Qo.local();case"CIMMarkerPlacementOnVertices":return ta.local();case"CIMMarkerPlacementPolygonCenter":return ea.local()}return null}const lr=new Zh;function Pc(i){if(i==null)return["",!1];if(!lr.hasBidiChar(i))return[i,!1];let t;return t=lr.checkContextual(i)==="rtl"?"IDNNN":"ICNNN",[lr.bidiTransform(i,t,"VLYSN"),!0]}const ia="arial-unicode-ms",Xn="woff2",Wn=new Map,wc=new Set;let Sc=class{constructor(t,e){this.fontFace=t,this.promise=e}};async function mf(i){const t=Mc(i),e=Wn.get(t);if(e)return e.promise;const s=new FontFace(i.family,`url('${xh.fontsUrl}/woff2/${t}.${Xn}') format('${Xn}')`,{style:i.style,weight:i.weight}),r=document.fonts;if(r.has(s)&&s.status==="loading")return s.loaded;const n=s.load().then(()=>(r.add(s),s));return Wn.set(t,new Sc(s,n)),wc.add(s),n}function vc(i){if(!i)return ia;const t=i.toLowerCase().split(" ").join("-");switch(t){case"serif":return"noto-serif";case"sans-serif":return"arial-unicode-ms";case"monospace":return"ubuntu-mono";case"fantasy":return"cabin-sketch";case"cursive":return"redressed";default:return t}}function Mc(i){const t=Cc(i)+$c(i);return vc(i.family)+(t.length>0?t:"-regular")}function Cc(i){if(!i.weight)return"";switch(i.weight.toLowerCase()){case"bold":case"bolder":return"-bold"}return""}function $c(i){if(!i.style)return"";switch(i.style.toLowerCase()){case"italic":case"oblique":return"-italic"}return""}let kc=class{applyColorSubstituition(t,e){if(!e)return t;this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas"));const{width:s,height:r}=t,n=this._rasterizationCanvas,o=n.getContext("2d",{willReadFrequently:!0});t!==n&&(n.width=s,n.height=r,o.drawImage(t,0,0,s,r));const a=o.getImageData(0,0,s,r).data;if(e){for(const l of e)if(l&&l.oldColor&&l.oldColor.length===4&&l.newColor&&l.newColor.length===4){const[c,u,d,p]=l.oldColor,[m,f,_,g]=l.newColor;if(c===m&&u===f&&d===_&&p===g)continue;for(let y=0;y0;let P=this._lineThroughWidthOffset,w=0;if(a){r.save();const gt=e.backgroundColor??[0,0,0,0],dt=((Gt=e.borderLine)==null?void 0:Gt.color)??[0,0,0,0],dh=2*I(((Bt=e.borderLine)==null?void 0:Bt.size)??0);r.fillStyle=ur(gt),r.strokeStyle=ur(dt),r.lineWidth=dh,r.fillRect(0,0,s.width,s.height),r.strokeRect(0,0,s.width,s.height),r.restore()}y&&this._renderHalo(r,_,g,P,w,e),w+=g,P+=_;for(const gt of this._textLines)y?(r.globalCompositeOperation="destination-out",r.fillStyle="rgb(0, 0, 0)",r.fillText(gt,P,w),r.globalCompositeOperation="source-over",r.fillStyle=this._fillStyle,r.fillText(gt,P,w)):(r.fillStyle=this._fillStyle,r.fillText(gt,P,w)),n&&n!=="none"&&this._renderDecoration(r,P,w,n,o),w+=p;r.restore();const M=this._renderedWidth+2*this._lineThroughWidthOffset,k=this._renderedHeight,F=r.getImageData(0,0,M,k),z=new Uint8Array(F.data);if(e.premultiplyColors){let gt;for(let dt=0;dt600)&&(s+=.3*t.measureText("w").width),s+=2*I(this._parameters.halo.size),Math.round(s)}_computeLineHeight(){let t=1.275*this._parameters.size;const e=this._parameters.font.decoration;return e&&e==="underline"&&(t*=1.3),Math.round(t+2*I(this._parameters.halo.size))}_renderDecoration(t,e,s,r,n,o){const a=.9*this._lineHeight,h=n==="bold"?.06:n==="bolder"?.09:.04;switch(t.textAlign){case"center":e-=this._renderedWidth/2;break;case"right":e-=this._renderedWidth}const l=t.textBaseline;if(r==="underline")switch(l){case"top":s+=a;break;case"middle":s+=a/2}else if(r==="line-through")switch(l){case"top":s+=a/1.5;break;case"middle":s+=a/3}const c=o?1.5*o:Math.ceil(a*h);t.save(),t.beginPath(),t.strokeStyle=t.fillStyle,t.lineWidth=c,t.moveTo(e-this._lineThroughWidthOffset,s),t.lineTo(e+this._renderedWidth+2*this._lineThroughWidthOffset,s),t.stroke(),t.restore()}};function zc(i,t){return i==="center"?.5*t:i==="right"?t:0}const Lc=()=>me.getLogger("esri.views.2d.engine.webgl.alignmentUtils");var St,lt;function oa(i){if(!i)return St.Center;switch(i){case"Left":case"left":return St.Left;case"Right":case"right":return St.Right;case"Justify":return Lc().warnOnce("Horizontal alignment 'justify' is not implemented. Falling back to 'center'."),St.Center;case"Center":case"center":return St.Center}}function aa(i){if(!i)return lt.Center;switch(i){case"Top":case"top":return lt.Top;case"Center":case"middle":return lt.Center;case"Baseline":case"baseline":return lt.Baseline;case"Bottom":case"bottom":return lt.Bottom}}function yf(i){switch(i){case"above-left":case"esriServerPointLabelPlacementAboveLeft":return["right","bottom"];case"above-center":case"above-along":case"esriServerPointLabelPlacementAboveCenter":case"esriServerLinePlacementAboveAlong":return["center","bottom"];case"above-right":case"esriServerPointLabelPlacementAboveRight":return["left","bottom"];case"center-left":case"esriServerPointLabelPlacementCenterLeft":return["right","middle"];case"center-center":case"center-along":case"esriServerPointLabelPlacementCenterCenter":case"esriServerLinePlacementCenterAlong":case"always-horizontal":case"esriServerPolygonPlacementAlwaysHorizontal":return["center","middle"];case"center-right":case"esriServerPointLabelPlacementCenterRight":return["left","middle"];case"below-left":case"esriServerPointLabelPlacementBelowLeft":return["right","top"];case"below-center":case"below-along":case"esriServerPointLabelPlacementBelowCenter":case"esriServerLinePlacementBelowAlong":return["center","top"];case"below-right":case"esriServerPointLabelPlacementBelowRight":return["left","top"];default:return console.debug(`Found invalid placement type ${i}`),["center","middle"]}}function Ec(i){switch(i){case St.Right:case"right":return-1;case St.Center:case"center":return 0;case St.Left:case"left":return 1;default:return console.debug(`Found invalid horizontal alignment ${i}`),0}}function Nc(i){switch(i){case lt.Top:case"top":return 1;case lt.Center:case"middle":return 0;case lt.Bottom:case lt.Baseline:case"baseline":case"bottom":return-1;default:return console.debug(`Found invalid vertical alignment ${i}`),0}}(function(i){i[i.Left=-1]="Left",i[i.Center=0]="Center",i[i.Right=1]="Right"})(St||(St={})),function(i){i[i.Top=1]="Top",i[i.Center=0]="Center",i[i.Bottom=-1]="Bottom",i[i.Baseline=2]="Baseline"}(lt||(lt={}));const hn=22,ha=4,Ac=hn+ha,Fc=hn-6,qn=3,Rc=Math.PI/180,Yt=8,Oc=1.5;let la=class{constructor(t,e,s,r){this._rotationT=ce(),this._xBounds=0,this._yBounds=0,this.minZoom=0,this.maxZoom=255,this._bounds=null;const n=s.rect,o=new Float32Array(8);t*=r,e*=r;const a=s.code?n.width*r:s.metrics.width,h=s.code?n.height*r:s.metrics.height;this.width=a,this.height=h,o[0]=t,o[1]=e,o[2]=t+a,o[3]=e,o[4]=t,o[5]=e+h,o[6]=t+a,o[7]=e+h,this._data=o,this._setTextureCoords(n),this._scale=r,this._mosaic=s,this.x=t,this.y=e,this.maxOffset=Math.max(t+a,e+h)}get mosaic(){return this._mosaic}set angle(t){this._angle=t,Yi(this._rotationT,-t),this._setOffsets()}get angle(){return this._angle}get xTopLeft(){return this._data[0]}get yTopLeft(){return this._data[1]}get xBottomRight(){return this._data[6]}get yBottomRight(){return this._data[7]}get texcoords(){return this._texcoords}get textureBinding(){return this._mosaic.textureBinding}get offsets(){return this._offsets||this._setOffsets(),this._offsets}get char(){return String.fromCharCode(this._mosaic.code)}get code(){return this._mosaic.code}get bounds(){if(!this._bounds){const{height:t,width:e}=this._mosaic.metrics,s=e*this._scale,r=Math.abs(t)*this._scale,n=new Float32Array(8);n[0]=this.x,n[1]=this.y,n[2]=this.x+s,n[3]=this.y,n[4]=this.x,n[5]=this.y+r,n[6]=this.x+s,n[7]=this.y+r;const o=mr(ce(),this._rotationT,this._transform);Ph(n,n,o);let a=1/0,h=1/0,l=0,c=0;for(let f=0;f<4;f++){const _=n[2*f],g=n[2*f+1];a=Math.min(a,_),h=Math.min(h,g),l=Math.max(l,_),c=Math.max(c,g)}const u=l-a,d=c-h,p=a+u/2,m=h+d/2;this._bounds=new Ce(p,m,u,d)}return this._bounds}setTransform(t){this._transform=t,this._offsets=null}_setOffsets(){this._offsets||(this._offsets={topLeft:[0,0],topRight:[0,0],bottomLeft:[0,0],bottomRight:[0,0]});const t=mr(ce(),this._rotationT,this._transform);this._offsets.topLeft[0]=this._data[0],this._offsets.topLeft[1]=this._data[1],this._offsets.topRight[0]=this._data[2],this._offsets.topRight[1]=this._data[3],this._offsets.bottomLeft[0]=this._data[4],this._offsets.bottomLeft[1]=this._data[5],this._offsets.bottomRight[0]=this._data[6],this._offsets.bottomRight[1]=this._data[7],vt(this._offsets.topLeft,this._offsets.topLeft,t),vt(this._offsets.topRight,this._offsets.topRight,t),vt(this._offsets.bottomLeft,this._offsets.bottomLeft,t),vt(this._offsets.bottomRight,this._offsets.bottomRight,t)}_setTextureCoords({x:t,y:e,width:s,height:r}){this._texcoords={topLeft:[t,e],topRight:[t+s,e],bottomLeft:[t,e+r],bottomRight:[t+s,e+r]}}};const Dc=(i,t)=>({code:0,page:0,sdf:!0,rect:new ll(0,0,11,8),textureBinding:t,metrics:{advance:0,height:4,width:i,left:0,top:0}});function He(i,t){return i.forEach(e=>vt(e,e,t)),{topLeft:i[0],topRight:i[1],bottomLeft:i[2],bottomRight:i[3]}}let Gc=class{constructor(t,e,s){this._rotation=0,this._decorate(t,e,s),this.glyphs=t,this.bounds=this._createBounds(t),this.isMultiline=e.length>1,this._hasRotation=s.angle!==0,this._transform=this._createGlyphTransform(this.bounds,s),this._borderLineSizePx=s.borderLineSizePx,(s.borderLineSizePx||s.hasBackground)&&([this.bounds,this.textBox]=this.shapeBackground(this._transform));for(const r of t)r.setTransform(this._transform)}setRotation(t){if(t===0&&this._rotation===0)return;this._rotation=t;const e=this._transform,s=Yi(ce(),t);mr(e,s,e);for(const r of this.glyphs)r.setTransform(this._transform)}_decorate(t,e,s){if(!s.decoration||s.decoration==="none"||!t.length)return;const r=s.scale,n=s.decoration==="underline"?Ac:Fc,o=t[0].textureBinding;for(const a of e){const h=a.startX*r,l=a.startY*r,c=(a.width+a.glyphWidthEnd)*r;t.push(new la(h,l+n*r,Dc(c,o),1))}}shapeBackground(t){const e=this._borderLineSizePx||0,s=(Oc+e)/2,r=this._borderLineSizePx?s:0,{xmin:n,ymin:o,xmax:a,ymax:h,x:l,y:c,width:u,height:d}=this.bounds,p=[n-Yt,o-Yt],m=[a+Yt,o-Yt],f=[n-Yt,h+Yt],_=[a+Yt,h+Yt],g=He([[p[0]-s,p[1]-s],[m[0]+s,m[1]-s],[p[0]+r,p[1]+r],[m[0]-r,m[1]+r]],t),y=He([[f[0]+r,f[1]-r],[_[0]-r,_[1]-r],[f[0]-s,f[1]+s],[_[0]+s,_[1]+s]],t),P=He([[p[0]-s,p[1]-s],[p[0]+r,p[1]+r],[f[0]-s,f[1]+s],[f[0]+r,f[1]-r]],t),w=He([[m[0]-r,m[1]+r],[m[0]+s,m[1]-s],[_[0]-r,_[1]-r],[_[0]+s,_[1]+s]],t),M={main:He([p,m,f,_],t),top:g,bot:y,left:P,right:w};return[new Ce(l,c,u+2*s,d+2*s),M]}get boundsT(){const t=this.bounds,e=Bs(En(),t.x,t.y);if(vt(e,e,this._transform),this._hasRotation){const s=Math.max(t.width,t.height);return new Ce(e[0],e[1],s,s)}return new Ce(e[0],e[1],t.width,t.height)}_createBounds(t){let e=1/0,s=1/0,r=0,n=0;for(const h of t)e=Math.min(e,h.xTopLeft),s=Math.min(s,h.yTopLeft),r=Math.max(r,h.xBottomRight),n=Math.max(n,h.yBottomRight);const o=r-e,a=n-s;return new Ce(e+o/2,s+a/2,o,a)}_createGlyphTransform(t,e){const s=Rc*e.angle,r=ce(),n=En();return ui(r,r,Bs(n,e.xOffset,-e.yOffset)),e.useCIMAngleBehavior?_r(r,r,s):(ui(r,r,Bs(n,t.x,t.y)),_r(r,r,s),ui(r,r,Bs(n,-t.x,-t.y))),r}},Qs=class{constructor(t,e,s,r,n,o){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(e,s)),this.end=Math.max(0,Math.max(e,s)),this.endi===10,Zn=i=>i===32;function Bc(i,t,e){const s=new Array,r=1/e.scale,n=e.maxLineWidth*r,o=t?i.length-1:0,a=t?-1:i.length,h=t?-1:1;let l=o,c=0,u=0,d=l,p=d,m=0,f=1/0,_=0;for(;l!==a;){const{code:y,metrics:P}=i[l],w=Math.abs(P.top);if(Mr(y)||Zn(y)||(f=Math.min(f,w),_=Math.max(_,w+P.height)),Mr(y))l!==o&&(s.push(new Qs(i,d,l-h,c,f,_)),f=1/0,_=0),c=0,d=l+h,p=l+h,u=0;else if(Zn(y))p=l+h,u=0,m=P.advance,c+=P.advance;else if(c>n){if(p!==d){const M=p-2*h;c-=m,s.push(new Qs(i,d,M,c-u,f,_)),f=1/0,_=0,d=p,c=u}else s.push(new Qs(i,d,l-h,c,f,_)),f=1/0,_=0,d=l,p=l,c=0;c+=P.advance,u+=P.advance}else c+=P.advance,u+=P.advance;l+=h}const g=new Qs(i,d,l-h,c,f,_);return g.start>=0&&g.endme.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");let se=class Pt{constructor(t){this._t=t}static createIdentity(){return new Pt([1,0,0,0,1,0])}clone(){const t=this._t;return new Pt(t.slice())}transform(t){const e=this._t;return[e[0]*t[0]+e[1]*t[1]+e[2],e[3]*t[0]+e[4]*t[1]+e[5]]}static createScale(t,e){return new Pt([t,0,0,0,e,0])}scale(t,e){const s=this._t;return s[0]*=t,s[1]*=t,s[2]*=t,s[3]*=e,s[4]*=e,s[5]*=e,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(t,e){return new Pt([0,0,t,0,0,e])}translate(t,e){const s=this._t;return s[2]+=t,s[5]+=e,this}static createRotate(t){const e=Math.cos(t),s=Math.sin(t);return new Pt([e,-s,0,s,e,0])}rotate(t){return Pt.multiply(this,Pt.createRotate(t),this)}angle(){const t=this._t[0],e=this._t[3],s=Math.sqrt(t*t+e*e);return[t/s,e/s]}static multiply(t,e,s){const r=t._t,n=e._t,o=r[0]*n[0]+r[3]*n[1],a=r[1]*n[0]+r[4]*n[1],h=r[2]*n[0]+r[5]*n[1]+n[2],l=r[0]*n[3]+r[3]*n[4],c=r[1]*n[3]+r[4]*n[4],u=r[2]*n[3]+r[5]*n[4]+n[5],d=s._t;return d[0]=o,d[1]=a,d[2]=h,d[3]=l,d[4]=c,d[5]=u,s}invert(){const t=this._t;let e=t[0]*t[4]-t[1]*t[3];if(e===0)return new Pt([0,0,0,0,0,0]);e=1/e;const s=(t[1]*t[5]-t[2]*t[4])*e,r=(t[2]*t[3]-t[0]*t[5])*e,n=t[4]*e,o=-t[1]*e,a=-t[3]*e,h=t[0]*e;return new Pt([n,o,s,a,h,r])}},cn=class{constructor(t,e){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new Sh(Ae,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(e||se.createIdentity()),this._sizeTransfos.push(e?e.scaleRatio():1)}setTransform(t,e){this._transfos=[t||se.createIdentity()],this._sizeTransfos=[e||(t?t.scaleRatio():1)]}setGeomUnitsPerPoint(t){this._geomUnitsPerPoint=t}transformPt(t){return this._transfos[this._transfos.length-1].transform(t)}transformSize(t){return t*this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformPt(t){return this._transfos[this._transfos.length-1].invert().transform(t)}reverseTransformSize(t){return t/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(t){return t/this._transfos[this._transfos.length-1].scaleRatio()}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}prevGeomUnitsPerPoint(){return this._transfos.length>2?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,e){const s=e?t.scaleRatio():1;se.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*s)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,e,s){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,e);break;case"CIMTextSymbol":this.drawTextSymbol(t,e,s)}}drawMultiLayerSymbol(t,e){if(!t||!e)return;const s=t.symbolLayers;if(!s)return;const r=t.effects;if(r&&r.length>0){const n=this.executeEffects(r,e);if(n){let o=n.next();for(;o;)this.drawSymbolLayers(s,o.asJSON()),o=n.next()}}else this.drawSymbolLayers(s,e)}executeEffects(t,e){const s=this._resourceManager.geometryEngine;let r=new Sr(N.fromJSONCIM(e));for(const n of t){const o=vr(n);o&&(r=o.execute(r,n,this.geomUnitsPerPoint(),null,s))}return r}drawSymbolLayers(t,e){let s=t.length;for(;s--;){const r=t[s];if(!r||r.enable===!1)continue;const n=r.effects;if(n&&n.length>0){const o=this.executeEffects(n,e);if(o){let a=null;for(;(a=o.next())&&(this.drawSymbolLayer(r,a.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(r,e);if(this._earlyReturn)return}}drawSymbolLayer(t,e){switch(t.type){case"CIMSolidFill":this.drawSolidFill(e,t.color);break;case"CIMHatchFill":this.drawHatchFill(e,t);break;case"CIMPictureFill":this.drawPictureFill(e,t);break;case"CIMGradientFill":this.drawGradientFill(e,t);break;case"CIMSolidStroke":this.drawSolidStroke(e,t.color,t.width,t.capStyle,t.joinStyle,t.miterLimit);break;case"CIMPictureStroke":this.drawPictureStroke(e,t);break;case"CIMGradientStroke":this.drawGradientStroke(e,t);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(t,e)}}drawHatchFill(t,e){const s=this._buildHatchPolyline(e,t,this.geomUnitsPerPoint());s&&(this.pushClipPath(t),this.drawMultiLayerSymbol(e.lineSymbol,s),this.popClipPath())}drawPictureFill(t,e){}drawGradientFill(t,e){}drawPictureStroke(t,e){}drawGradientStroke(t,e){}drawMarkerLayer(t,e){const s=t.markerPlacement;if(s){const r=sa(s);if(r){const n=s.type==="CIMMarkerPlacementInsidePolygon"||s.type==="CIMMarkerPlacementPolygonCenter"&&s.clipAtBoundary;n&&this.pushClipPath(e);const o=r.execute(N.fromJSONCIM(e),s,this.geomUnitsPerPoint(),null,this._resourceManager.geometryEngine);if(o){let a=null;for(;(a=o.next())&&(this.drawMarker(t,a),!this._earlyReturn););}n&&this.popClipPath()}}else{const r=this._placementPool.acquire();if(fr(e))r.tx=e.x,r.ty=e.y,this.drawMarker(t,r);else if(ht(e)){const n=vh(e);n&&([r.tx,r.ty]=n,this.drawMarker(t,r))}else for(const n of e.points)if(r.tx=n[0],r.ty=n[1],this.drawMarker(t,r),this._earlyReturn)break;this._placementPool.release(r)}}drawMarker(t,e){switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(t,e);break;case"CIMVectorMarker":this.drawVectorMarker(t,e)}}drawPictureMarker(t,e){if(!t)return;const s=this._resourceManager.getResource(t.url),r=$(t.size,Rt.CIMPictureMarker.size);if(s==null||r<=0)return;const n=s.width,o=s.height;if(!n||!o)return;const a=n/o,h=$(t.scaleX,1),l=se.createIdentity(),c=t.anchorPoint;if(c){let _=c.x,g=c.y;t.anchorPointUnits!=="Absolute"&&(_*=r*a*h,g*=r),l.translate(-_,-g)}let u=$(t.rotation);t.rotateClockwise&&(u=-u),this._mapRotation&&(u+=this._mapRotation),u&&l.rotate(u*Jt);let d=$(t.offsetX),p=$(t.offsetY);if(d||p){if(this._mapRotation){const _=Jt*this._mapRotation,g=Math.cos(_),y=Math.sin(_),P=d*y+p*g;d=d*g-p*y,p=P}l.translate(d,p)}const m=this.geomUnitsPerPoint();m!==1&&l.scale(m,m);const f=e.getAngle();f&&l.rotate(f),l.translate(e.tx,e.ty),this.push(l,!1),this.drawImage(t,r),this.pop()}drawVectorMarker(t,e){if(!t)return;const s=t.markerGraphics;if(!s)return;const r=$(t.size,Rt.CIMVectorMarker.size),n=t.frame,o=n?n.ymax-n.ymin:0,a=r&&o?r/o:1,h=se.createIdentity();n&&h.translate(.5*-(n.xmax+n.xmin),.5*-(n.ymax+n.ymin));const l=t.anchorPoint;if(l){let f=l.x,_=l.y;t.anchorPointUnits!=="Absolute"?n&&(f*=n.xmax-n.xmin,_*=n.ymax-n.ymin):(f/=a,_/=a),h.translate(-f,-_)}a!==1&&h.scale(a,a);let c=$(t.rotation);t.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&h.rotate(c*Jt);let u=$(t.offsetX),d=$(t.offsetY);if(u||d){if(this._mapRotation){const f=Jt*this._mapRotation,_=Math.cos(f),g=Math.sin(f),y=u*g+d*_;u=u*_-d*g,d=y}h.translate(u,d)}const p=this.geomUnitsPerPoint();p!==1&&h.scale(p,p);const m=e.getAngle();m&&h.rotate(m),h.translate(e.tx,e.ty),this.push(h,t.scaleSymbolsProportionally);for(const f of s){f!=null&&f.symbol&&f.geometry||Yc().error("Invalid marker graphic",f);let _=f.textString;if(typeof _=="number"&&(_=_.toString()),this.drawSymbol(f.symbol,f.geometry,_),this._earlyReturn)break}this.pop()}drawTextSymbol(t,e,s){if(!t||!fr(e)||$(t.height,Rt.CIMTextSymbol.height)<=0)return;const r=se.createIdentity();let n=$(t.angle);n=-n,n&&r.rotate(n*Jt);const o=$(t.offsetX),a=$(t.offsetY);(o||a)&&r.translate(o,a);const h=this.geomUnitsPerPoint();h!==1&&r.scale(h,h),r.translate(e.x,e.y),this.push(r,!1),this.drawText(t,s),this.pop()}_buildHatchPolyline(t,e,s){let r=$(t.separation,Rt.CIMHatchFill.separation)*s,n=$(t.rotation);if(r===0)return null;r<0&&(r=-r);let o=0;const a=.5*r;for(;o>a;)o-=r;for(;o<-a;)o+=r;const h=ze();yo(h,e),h[0]-=a,h[1]-=a,h[2]+=a,h[3]+=a;const l=[[h[0],h[1]],[h[0],h[3]],[h[2],h[3]],[h[2],h[1]]];for(;n>180;)n-=180;for(;n<0;)n+=180;const c=Math.cos(n*Jt),u=Math.sin(n*Jt),d=-r*u,p=r*c;let m,f,_,g;o=$(t.offsetX)*s*u-$(t.offsetY)*s*c,m=_=Number.MAX_VALUE,f=g=-Number.MAX_VALUE;for(const z of l){const A=z[0],R=z[1],Gt=c*A+u*R,Bt=-u*A+c*R;m=Math.min(m,Gt),_=Math.min(_,Bt),f=Math.max(f,Gt),g=Math.max(g,Bt)}_=Math.floor(_/r)*r;let y=c*m-u*_-d*o/r,P=u*m+c*_-p*o/r,w=c*f-u*_-d*o/r,M=u*f+c*_-p*o/r;const k=1+Math.round((g-_)/r),F=[];for(let z=0;z0))if(ht(t))this._processPath(t.rings,0);else if(wt(t))this._processPath(t.paths,0);else if(mt(t)){const e=ne(t);e&&this._processPath(e.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(t,e,s){if(!t||this._clipCount>0||s==null||s<=0)return;const r=Math.max(.5*this.transformSize($(s,Rt.CIMSolidStroke.width)),.5*ca);if(ht(t))this._processPath(t.rings,r);else if(wt(t))this._processPath(t.paths,r);else if(mt(t)){const n=ne(t);n&&this._processPath(n.rings,r)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(t,e){ht(e)&&t.markerPlacement&&(t.markerPlacement.type==="CIMMarkerPlacementInsidePolygon"||t.markerPlacement.type==="CIMMarkerPlacementPolygonCenter"&&t.markerPlacement.clipAtBoundary)?this._processPath(e.rings,0):super.drawMarkerLayer(t,e)}drawHatchFill(t,e){this.drawSolidFill(t)}drawPictureFill(t,e){this.drawSolidFill(t)}drawGradientFill(t,e){this.drawSolidFill(t)}drawPictureStroke(t,e){this.drawSolidStroke(t,null,e.width)}drawGradientStroke(t,e){this.drawSolidStroke(t,null,e.width)}pushClipPath(t){this.drawSolidFill(t),this._clipCount++}popClipPath(){this._clipCount--}drawImage(t,e){const{url:s}=t,r=$(t.scaleX,1);let n=r*e,o=e;const a=this._resourceManager.getResource(s);if(a!=null){const h=a.height/a.width;n=r*(e?h>1?e:e/h:a.width),o=e?h>1?e*h:e:a.height}this._merge(this.transformPt([-n/2,-o/2]),0),this._merge(this.transformPt([-n/2,o/2]),0),this._merge(this.transformPt([n/2,-o/2]),0),this._merge(this.transformPt([n/2,o/2]),0)}drawText(t,e){if(!e||e.length===0)return;this._textRasterizer||(this._textRasterizer=new na);const s=pa(t);let[r,n]=this._textRasterizer.computeTextSize(e,s);r=de(r),n=de(n);let o=0;switch(t.horizontalAlignment){case"Left":o=r/2;break;case"Right":o=-r/2}let a=0;switch(t.verticalAlignment){case"Bottom":a=n/2;break;case"Top":a=-n/2;break;case"Baseline":a=n/6}this._merge(this.transformPt([-r/2+o,-n/2+a]),0),this._merge(this.transformPt([-r/2+o,n/2+a]),0),this._merge(this.transformPt([r/2+o,-n/2+a]),0),this._merge(this.transformPt([r/2+o,n/2+a]),0)}_processPath(t,e){if(t)for(const s of t){const r=s?s.length:0;if(r>1){this._merge(this.transformPt(s[0]),e);for(let n=1;nthis._xmax&&(this._xmax=t[0]+e),t[1]-ethis._ymax&&(this._ymax=t[1]+e)}},vf=class extends cn{constructor(){super(...arguments),this._searchPoint=[0,0],this._searchDistPoint=0,this._textInfo=null}hitTest(t,e,s,r,n,o){var l;const a=o*I(1);this.setTransform(),this.setGeomUnitsPerPoint(a),this._searchPoint=[(t[0]+t[2])/2,(t[1]+t[3])/2],this._searchDistPoint=(t[2]-t[0])/2/a,this._textInfo=r;const h=e&&(e.type==="CIMPointSymbol"&&e.angleAlignment!=="Map"||e.type==="CIMTextSymbol");if(this._mapRotation=h?n:0,!ue("esri-mobile")){const c=de(ue("hittest-2d-small-symbol-tolerance")*window.devicePixelRatio),u=de(ue("hittest-2d-small-symbol-tolerance-threshold"));!(((e==null?void 0:e.type)==="CIMLineSymbol"||(e==null?void 0:e.type)==="CIMPolygonSymbol")&&((l=e.symbolLayers)!=null&&l.some(Qh)))&&(e==null?void 0:e.type)!=="CIMMeshSymbol"&&(tl(e)??0)f.xTopLeft&&d-f.yBottomRight&&p<-f.yTopLeft){this._earlyReturn=!0;break}}_hitTestFill(t){let e=null;if(mt(t)){const r=t;e=[[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]]]}else if(ht(t))e=t.rings;else{if(!wt(t))return;e=t.paths}const s=this.reverseTransformPt(this._searchPoint);if(this._pointInPolygon(s,e)&&(this._earlyReturn=!0),!this._earlyReturn){const r=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint();this._nearLine(s,e,r)&&(this._earlyReturn=!0)}}_hitTestStroke(t,e){let s=null;if(mt(t)){const a=t;s=[[[a.xmin,a.ymin],[a.xmin,a.ymax],[a.xmax,a.ymax],[a.xmax,a.ymin],[a.xmin,a.ymin]]]}else if(ht(t))s=t.rings;else{if(!wt(t))return;s=t.paths}const r=this.reverseTransformPt(this._searchPoint),n=$(e,Rt.CIMSolidStroke.width)*this.geomUnitsPerPoint(),o=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint();this._nearLine(r,s,n/2+o)&&(this._earlyReturn=!0)}_pointInPolygon(t,e){let s=0;for(const r of e){const n=r.length;for(let o=1;ot[1]!=h[1]>t[1]&&((h[0]-a[0])*(t[1]-a[1])-(h[1]-a[1])*(t[0]-a[0])>0?s++:s--)}}return s!==0}_nearLine(t,e,s){for(const r of e){const n=r.length;for(let o=1;o-s&&u1){let o=this.transformPt(r[0]);s.moveTo(o[0],o[1]);for(let a=1;ai?{spatialReference:i.spatialReference,rings:[[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]}:null,ua=(i,t,e)=>{switch(i){case"ExtraLeading":return 1+t/e;case"Multiple":return t;case"Exact":return t/e}};function pa(i,t=1){var g;const e=bo(i),s=Po(i.fontStyleName),r=i.fontFamilyName??ia,{weight:n,style:o}=s,a=t*(i.height||5),h=el(i.horizontalAlignment),l=sl(i.verticalAlignment),c=rr(i),u=rr(i.haloSymbol),d=u!=null?t*(i.haloSize??0):0,p=((g=i.callout)==null?void 0:g.type)==="CIMBackgroundCallout"?i.callout.backgroundSymbol:null,m=rr(p),f=il(p),_=rl(p);return{color:c,size:a,horizontalAlignment:h,verticalAlignment:l,font:{family:r,style:nl(o),weight:ol(n),decoration:e},halo:{size:d||0,color:u,style:o},backgroundColor:m,borderLine:f!=null&&_!=null?{size:f,color:_}:null,pixelRatio:1,premultiplyColors:!0}}const Wc=1e-4;function qc(i){let t,e,s,r,n,o=i[0],a=1;for(;ame.getLogger("esri.symbols.cim.CIMSymbolHelper");function $f(i){let t;switch(i.type){case"cim":return i.data;case"web-style":return i;case"simple-marker":{const e=be.fromSimpleMarker(i);if(!e)throw new Error("InternalError: Cannot convert symbol to CIM");t=e;break}case"picture-marker":t=be.fromPictureMarker(i);break;case"simple-line":t=be.fromSimpleLineSymbol(i);break;case"simple-fill":t=be.fromSimpleFillSymbol(i);break;case"picture-fill":t=be.fromPictureFillSymbol(i);break;case"text":t=be.fromTextSymbol(i)}return{type:"CIMSymbolReference",symbol:t}}function di(i,t,e){switch(t.type){case"CIMSymbolReference":return di(i,t.symbol,e);case"CIMPointSymbol":e==null&&(e={x:0,y:0}),i.drawSymbol(t,e);break;case"CIMLineSymbol":e==null&&(e={paths:[[[0,0],[10,0]]]}),i.drawSymbol(t,e);break;case"CIMPolygonSymbol":e==null&&(e={rings:[[[0,0],[0,10],[10,10],[10,0],[0,0]]]}),i.drawSymbol(t,e);break;case"CIMTextSymbol":{const s={x:0,y:0};i.drawSymbol(t,s);break}case"CIMVectorMarker":{const s=new Ae;i.drawMarker(t,s);break}}return i.envelope()}function jc(i){if(!i)return 0;switch(i.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAtExtremities":case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementAtRatioPositions":case"CIMMarkerPlacementOnLine":case"CIMMarkerPlacementOnVertices":return Math.abs(i.offset);default:return 0}}function Kc(i){if(!i)return 0;switch(i.type){case"CIMGeometricEffectArrow":return Math.abs(.5*i.width);case"CIMGeometricEffectBuffer":return Math.abs(i.size);case"CIMGeometricEffectExtension":case"CIMGeometricEffectRadial":return Math.abs(i.length);case"CIMGeometricEffectJog":return Math.abs(.5*i.length);case"CIMGeometricEffectMove":return Math.max(Math.abs($(i.offsetX)),Math.abs($(i.offsetY)));case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":return Math.abs(i.offset);case"CIMGeometricEffectRegularPolygon":return Math.abs(i.radius);case"CIMGeometricEffectRotate":case"CIMGeometricEffectScale":default:return 0;case"CIMGeometricEffectTaperedPolygon":return .5*Math.max(Math.abs(i.fromWidth),Math.abs(i.toWidth));case"CIMGeometricEffectWave":return Math.abs(i.amplitude);case"CIMGeometricEffectDonut":return Math.abs(i.width)}}function Ni(i){if(!i)return 0;let t=0;for(const e of i)t+=Kc(e);return t}let kf=class{static getSymbolInflateSize(t,e,s,r,n){return t||(t=[0,0,0,0]),e?this._getInflateSize(t,e,s,r,n):t}static safeSize(t){const e=Math.max(Math.abs(t[0]),Math.abs(t[2])),s=Math.max(Math.abs(t[1]),Math.abs(t[3]));return Math.sqrt(e*e+s*s)}static _vectorMarkerBounds(t,e,s,r){let n=!0;const o=ze();if(e!=null&&e.markerGraphics)for(const a of e.markerGraphics){const h=[0,0,0,0];a.geometry&&(yo(o,a.geometry),h[0]=0,h[1]=0,h[2]=0,h[3]=0,this.getSymbolInflateSize(h,a.symbol,s,0,r),o[0]+=h[0],o[1]+=h[1],o[2]+=h[2],o[3]+=h[3],n?(t[0]=o[0],t[1]=o[1],t[2]=o[2],t[3]=o[3],n=!1):(t[0]=Math.min(t[0],o[0]),t[1]=Math.min(t[1],o[1]),t[2]=Math.max(t[2],o[2]),t[3]=Math.max(t[3],o[3])))}return t}static _getInflateSize(t,e,s,r,n){if(iu(e)){const o=this._getLayersInflateSize(t,e.symbolLayers,s,r,n),a=Ni(e.effects);return a>0&&(o[0]-=a,o[1]-=a,o[2]+=a,o[3]+=a),o}return this._getTextInflatedSize(t,e,n)}static _getLayersInflateSize(t,e,s,r,n){let o=!0;if(!e)return t;for(const a of e){if(!a)continue;let h=[0,0,0,0];switch(a.type){case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const c=a;let u=c.width;u!=null&&(c.capStyle===tt.Square||c.joinStyle===ct.Miter?u/=1.4142135623730951:u/=2,h[0]=-u,h[1]=-u,h[2]=u,h[3]=u);break}case"CIMCharacterMarker":case"CIMVectorMarker":case"CIMPictureMarker":{const c=a;if(a.type==="CIMVectorMarker"){const f=a;if(h=this._vectorMarkerBounds(h,f,s,n),f.frame){const _=(f.frame.xmin+f.frame.xmax)/2,g=(f.frame.ymin+f.frame.ymax)/2;if(h[0]-=_,h[1]-=g,h[2]-=_,h[3]-=g,f.size!=null){const y=f.size/(f.frame.ymax-f.frame.ymin);h[0]*=y,h[1]*=y,h[2]*=y,h[3]*=y}}}else if(a.type==="CIMPictureMarker"){const f=a,_=s.getResource(f.url);let g=1;if(_!=null&&_.height&&(g=_.width/_.height),c.size!=null){const y=c.size/2,P=c.size*g*f.scaleX/2;h=[-P,-y,P,y]}}else if(c.size!=null){const f=c.size/2;h=[-f,-f,f,f]}if(c.anchorPoint){let f,_;c.anchorPointUnits==="Absolute"?(f=c.anchorPoint.x,_=c.anchorPoint.y):(f=c.anchorPoint.x*(h[2]-h[0]),_=c.anchorPoint.y*(h[3]-h[1])),h[0]-=f,h[1]-=_,h[2]-=f,h[3]-=_}let u=$(c.rotation);if(c.rotateClockwise&&(u=-u),r&&(u-=r),u){const f=jn*u,_=Math.cos(f),g=Math.sin(f),y=ze([Ys,Ys,-Ys,-Ys]);Hs(y,[h[0]*_-h[1]*g,h[0]*g+h[1]*_]),Hs(y,[h[0]*_-h[3]*g,h[0]*g+h[3]*_]),Hs(y,[h[2]*_-h[1]*g,h[2]*g+h[1]*_]),Hs(y,[h[2]*_-h[3]*g,h[2]*g+h[3]*_]),h=y}let d=$(c.offsetX),p=$(c.offsetY);if(r){const f=jn*r,_=Math.cos(f),g=Math.sin(f),y=d*g+p*_;d=d*_-p*g,p=y}h[0]+=d,h[1]+=p,h[2]+=d,h[3]+=p;const m=jc(c.markerPlacement);m>0&&(h[0]-=m,h[1]-=m,h[2]+=m,h[3]+=m);break}}const l=Ni(a.effects);l>0&&(h[0]-=l,h[1]-=l,h[2]+=l,h[3]+=l),o?(t[0]=h[0],t[1]=h[1],t[2]=h[2],t[3]=h[3],o=!1):(t[0]=Math.min(t[0],h[0]),t[1]=Math.min(t[1],h[1]),t[2]=Math.max(t[2],h[2]),t[3]=Math.max(t[3],h[3]))}return t}static _getTextInflatedSize(t,e,s){var u;const r=e.height??Rt.CIMTextSymbol.height;if(t[0]=-r/2,t[1]=-r/2,t[2]=r/2,t[3]=r/2,!s)return t;const n=s.get(e);if(!n||!n.glyphMosaicItems.glyphs.length)return t;const{lineGapType:o,lineGap:a}=e,h=o?ua(o,a??0,r):0,l=((u=e.callout)==null?void 0:u.type)==="CIMBackgroundCallout",c=ln(n.glyphMosaicItems,{scale:r/sn,angle:$(e.angle),xOffset:$(e.offsetX),yOffset:$(e.offsetY),horizontalAlignment:e.horizontalAlignment,verticalAlignment:e.verticalAlignment,maxLineWidth:512,lineHeight:rn*Math.max(.25,Math.min(h||1,4)),decoration:e.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:l}).boundsT;return t[0]=c.x-c.halfWidth,t[1]=-c.y-c.halfHeight,t[2]=c.x+c.halfWidth,t[3]=-c.y+c.halfHeight,t}},be=class fi{static getEnvelope(t,e,s){if(!t)return null;const r=new Hc(s);if(Array.isArray(t)){let n;for(const o of t)n?n.union(di(r,o,e)):n=di(r,o,e);return n}return di(r,t,e)}static getTextureAnchor(t,e){const s=this.getEnvelope(t,null,e);if(!s)return[0,0,0];const r=(s.x+.5*s.width)*bt,n=(s.y+.5*s.height)*bt,o=s.width*bt+2,a=s.height*bt+2;return[-r/o,-n/a,a]}static rasterize(t,e,s,r,n=!0){const o=s||this.getEnvelope(e,null,r);if(!o)return[null,0,0,0,0];const a=(o.x+.5*o.width)*bt,h=(o.y+.5*o.height)*bt;t.width=o.width*bt,t.height=o.height*bt,s||(t.width+=2,t.height+=2);const l=t.getContext("2d",{willReadFrequently:!0}),c=se.createScale(bt,-bt);c.translate(.5*t.width-a,.5*t.height+h);const u=new Uc(l,r,c);switch(e.type){case"CIMPointSymbol":{const m={type:"point",x:0,y:0};u.drawSymbol(e,m);break}case"CIMVectorMarker":{const m=new Ae;u.drawMarker(e,m);break}}const d=l.getImageData(0,0,t.width,t.height),p=new Uint8Array(d.data);if(n){let m;for(let f=0;fu.width&&u.width>0?_*u.width:_),lineDashEnding:m,controlPointEnding:K.FullPattern}]:void 0;o.push({type:"CIMSolidStroke",capStyle:d?tt.Round:tt.Butt,enable:!0,width:p,color:st(u.color),effects:f})}else!e||t.type!=="line-marker"||t.style!=="cross"&&t.style!=="x"?[a,h]=Ue(r):([a,h]=Ue(r),o.push({type:"CIMSolidStroke",enable:!0,width:e,color:st(n)}));o.push({type:"CIMSolidFill",enable:!0,color:st(n)});const c={type:"CIMPolygonSymbol",symbolLayers:o};return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:$(-t.angle),size:$(l||6*e),offsetX:$(t.xoffset),offsetY:$(t.yoffset),scaleSymbolsProportionally:!1,frame:a,markerGraphics:[{type:"CIMMarkerGraphic",geometry:h,symbol:c}]}]}}static fromCIMHatchFill(t,e){var h;const s=e*(t.separation??Rt.CIMHatchFill.separation),r=s/2,n=Ie(t.lineSymbol);(h=n.symbolLayers)==null||h.forEach(l=>{var c;switch(l.type){case"CIMSolidStroke":l.width!=null&&(l.width*=e),(c=l.effects)==null||c.forEach(u=>{if(u.type==="CIMGeometricEffectDashes"){const d=u.dashTemplate;u.dashTemplate=d.map(p=>p*e)}});break;case"CIMVectorMarker":{l.size!=null&&(l.size*=e);const u=l.markerPlacement;u!=null&&"placementTemplate"in u&&(u.placementTemplate=u.placementTemplate.map(d=>d*e));break}}});let o=this._getLineSymbolPeriod(n)||Kn;for(;o{nu(n,e,s),"url"in n&&n.url&&s.push(e.fetchResource(n.url,{signal:r}))}),s}static fetchFonts(t,e,s){if(t&&e){if("symbolLayers"in t&&t.symbolLayers){for(const r of t.symbolLayers)if(r.type==="CIMVectorMarker"&&r.markerGraphics)for(const n of r.markerGraphics)n!=null&&n.symbol&&fi.fetchFonts(n.symbol,e,s)}else if(t.type==="CIMTextSymbol"){const{fontFamilyName:r,fontStyleName:n}=t;if(!r||r.toLowerCase()==="calcitewebcoreicons")return;const{style:o,weight:a}=Po(n),h=bo(t),l=new Lh({family:r,style:o,weight:a,decoration:h});s.push(e.loadFont(l).catch(()=>{Ei().error(`Unsupported font ${r} in CIM symbol`)}))}}}static _getLineSymbolPeriod(t){if(t){const e=this._getEffectsRepeat(t.effects);if(e)return e;if(t.symbolLayers){for(const s of t.symbolLayers)if(s){const r=this._getEffectsRepeat(s.effects);if(r)return r;switch(s.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const n=this._getPlacementRepeat(s.markerPlacement);if(n)return n}}}}}return 0}static _getEffectsRepeat(t){if(t){for(const e of t)if(e)switch(e.type){case"CIMGeometricEffectDashes":{const s=e.dashTemplate;if(s&&s.length){let r=0;for(const n of s)r+=n;return 1&s.length&&(r*=2),r}break}case"CIMGeometricEffectWave":return e.period;default:Ei().error(`unsupported geometric effect type ${e.type}`)}}return 0}static _getPlacementRepeat(t){if(t)switch(t.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineVariableSize":{const e=t.placementTemplate;if(e&&e.length){let s=0;for(const r of e)s+=+r;return 1&e.length&&(s*=2),s}break}}return 0}static fromCIMInsidePolygon(t){const e=t.markerPlacement,s={...t};s.markerPlacement=null,s.anchorPoint=null;const r=Math.abs(e.stepX),n=Math.abs(e.stepY),o=(e.randomness??100)/100;let a,h,l,c;if(e.gridType==="Random"){const u=de(Eh),d=Math.max(Math.floor(u/r),1),p=Math.max(Math.floor(u/n),1);a=d*r/2,h=p*n/2,l=2*h;const m=new go(e.seed),f=o*r/1.5,_=o*n/1.5;c=[];for(let g=0;g({type:"CIMMarkerGraphic",geometry:u,symbol:{type:"CIMPointSymbol",symbolLayers:[s]}})),size:l}}};function fa(i,t){if(i)switch(i.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const e=i.symbolLayers;if(!e)return;for(const s of e)if(t(s),s.type==="CIMVectorMarker"){const r=s.markerGraphics;if(!r)continue;for(const n of r)if(n){const o=n.symbol;o&&fa(o,t)}}break}}}const ma=i=>{if(!i)return tt.Butt;switch(i){case"butt":return tt.Butt;case"square":return tt.Square;case"round":return tt.Round}},_a=i=>{if(!i)return ct.Miter;switch(i){case"miter":return ct.Miter;case"round":return ct.Round;case"bevel":return ct.Bevel}},Jc=i=>{if(i==null)return"Center";switch(i){case"left":return"Left";case"right":return"Right";case"center":return"Center"}},Qc=i=>{if(i==null)return"Center";switch(i){case"baseline":return"Baseline";case"top":return"Top";case"middle":return"Center";case"bottom":return"Bottom"}},st=i=>{if(!i)return[0,0,0,0];const{r:t,g:e,b:s,a:r}=i;return[t,e,s,255*r]},tu=(i,t)=>{const e=eu(t),s=su(i);return e&&s?`${e}-${s}`:`${e}${s}`},eu=i=>{if(!i)return"";switch(i.toLowerCase()){case"bold":case"bolder":return"bold"}return""},su=i=>{if(!i)return"";switch(i.toLowerCase()){case"italic":case"oblique":return"italic"}return""},Cr=(i,t)=>{const e=ue("safari")?.001:0,s=t==="butt";switch(i){case"dash":case"esriSLSDash":return s?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return s?[4,3,1,3]:[3,4,e,4];case"dot":case"esriSLSDot":return s?[1,3]:[e,4];case"long-dash":case"esriSLSLongDash":return s?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return s?[8,3,1,3]:[7,4,e,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return s?[8,3,1,3,1,3]:[7,4,e,4,e,4];case"short-dash":case"esriSLSShortDash":return s?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return s?[4,1,1,1]:[3,2,e,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return s?[4,1,1,1,1,1]:[3,2,e,2,e,2];case"short-dot":case"esriSLSShortDot":return s?[1,1]:[e,2];case"solid":case"esriSLSSolid":case"none":return Ei().error("Unexpected: style does not require rasterization"),[0,0];default:return Ei().error(`Tried to rasterize SLS, but found an unexpected style: ${i}!`),[0,0]}};function iu(i){return i.symbolLayers!==void 0}const Ue=(i,t=100)=>{const e=t/2;let s,r;const n=i;if(n==="circle"||n==="esriSMSCircle"){let a=Math.acos(1-.25/e),h=Math.ceil(da/a/4);h===0&&(h=1),a=Zc/h,h*=4;const l=[];l.push([e,0]);for(let c=1;ci==="vertical"||i==="horizontal"||i==="cross"||i==="esriSFSCross"||i==="esriSFSVertical"||i==="esriSFSHorizontal";function nu(i,t,e){if(!(!i.effects||t.geometryEngine!=null)){if(t.geometryEnginePromise)return void e.push(t.geometryEnginePromise);al(i.effects)&&(t.geometryEnginePromise=hl(),e.push(t.geometryEnginePromise),t.geometryEnginePromise.then(s=>t.geometryEngine=s))}}function Jn(i){if(!i)return null;let t=null;const{cap:e,color:s,join:r,miterLimit:n,style:o,width:a}=i;return o!=="solid"&&o!=="none"&&o!=="esriSLSSolid"&&o!=="esriSLSNull"&&(t=[{type:"CIMGeometricEffectDashes",dashTemplate:Cr(o,e),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]),{type:"CIMSolidStroke",color:o!=="esriSLSNull"&&o!=="none"?st(s):[0,0,0,0],capStyle:ma(e),joinStyle:_a(r),miterLimit:n,width:a,effects:t}}const ou=96/72;let au=class{static executeEffects(t,e,s,r){const n=ou,o=Ni(t);let a=new Sr(e);for(const h of t){const l=vr(h);l&&(a=l.execute(a,h,n,s,r,o))}return a}static applyEffects(t,e,s){if(!t)return e;const r=Ni(t);let n,o=new Sr(N.fromJSONCIM(e));for(const l of t){const c=vr(l);c&&(o=c.execute(o,l,1,null,s,r))}const a=[];let h=null;for(;n=o.next();)a.push(...Es(n)),h=n.geometryType;return a.length===0||h===null?null:h==="esriGeometryPolygon"?{rings:a}:{paths:a}}},ga=null;function un(){return ga}async function hu(){ga=await Nh(()=>import("./geometryEngineJSON-D-7-cYHZ.js").then(i=>i.g),__vite__mapDeps([0,1,2,3,4]))}function ya(i){switch(i){case S.BYTE:case S.UNSIGNED_BYTE:return 1;case S.SHORT:case S.UNSIGNED_SHORT:return 2;case S.FLOAT:case S.INT:case S.UNSIGNED_INT:return 4}}function lu(i){const t=[],e=[],s=[];for(const r of i){const n=ya(r.type)*r.count;switch(n%2||n%4||4){case 4:t.push(r);continue;case 2:e.push(r);continue;case 1:s.push(r);continue;default:throw new Error("Found unexpected dataType byte count")}}return t.push(...e),t.push(...s),t}let cu=class xa{static fromVertexSpec({attributes:t},e){let s,r,n;const o=[];for(const p in t){const m=t[p];(e==null?void 0:e[p])!==!1&&(m.pack==="position"?s={...m,name:p,offset:0}:m.pack==="id"?r={...m,name:p,offset:4}:p==="bitset"?n={...m,name:p,offset:7}:o.push({...m,name:p}))}const a=lu(o),h=[];let l=8,c=1;for(const p of a)h.push({...p,offset:l}),l+=ya(p.type)*p.count,p.packAlternating&&(c=Math.max(p.packAlternating.count,c));const u=Uint32Array.BYTES_PER_ELEMENT,d=l%u;return new xa(s,r,n,h,l+(d?u-d:0),c)}constructor(t,e,s,r,n,o){this.position=t,this.id=e,this.bitset=s,this.standardAttributes=r,this.stride=n,this.packVertexCount=o,r.push(s),this._attributes=[t,e,s,...r]}get attributeLayout(){if(!this._attributeLayout){const t=cl(this._attributes),e=this._attributes.map(s=>({name:s.name,count:s.count,offset:s.offset,type:s.type,packPrecisionFactor:s.packPrecisionFactor,normalized:s.normalized??!1}));this._attributeLayout={attributes:e,hash:t,stride:this.stride}}return this._attributeLayout}},uu=class ba{static fromVertexSpec(t,e){const s=cu.fromVertexSpec(t,e);return new ba(s)}constructor(t){this._spec=t,this._packed=new Uint8Array(this._spec.stride*this._spec.packVertexCount),this._packedU32View=new Uint32Array(this._packed.buffer),this._dataView=new DataView(this._packed.buffer)}get attributeLayout(){return this._spec.attributeLayout}get stride(){return this._spec.stride}writeVertex(t,e,s,r,n,o){var a;for(let h=0;hthis.vertexSpec.createComputedParams(n)}get _vertexPack(){if(!this._cachedVertexPack){const t=uu.fromVertexSpec(this.vertexSpec,this._optionalAttributes);this._evaluator.hasDynamicProperties||t.pack(this._evaluator.evaluatedMeshParams,this._viewParams),this._cachedVertexPack=t}return this._cachedVertexPack}get evaluatedMeshParams(){return this._evaluator.evaluatedMeshParams}get hasEffects(){return!!this.evaluatedMeshParams.effects}get instanceId(){return this._instanceId}get attributeLayout(){return this._vertexPack.attributeLayout}setReferences(t){this._references=t}getBoundsInfo(){return null}getTileInfo(){return this._viewParams.tileInfo}async loadDependencies(){var t;pu((t=this._evaluator.inputMeshParams.params.effects)==null?void 0:t.effectInfos)&&await hu()}enqueueRequest(t,e,s){this._evaluator.hasDynamicProperties&&this._evaluator.enqueueRequest(t,e,s)}write(t,e,s,r,n){var p;this.ensurePacked(e,s,r);const o=this.evaluatedMeshParams.effects;if(!o||o.length===0)return void this._write(t,s,void 0,n);const a=(p=s.readGeometryForDisplay())==null?void 0:p.clone();if(!a)return;const h=N.fromOptimizedCIM(a,s.geometryType),l=un();h.invertY();const c=t.id||"",u=au.executeEffects(o,h,c,l);let d;for(;d=u.next();)d.invertY(),this._write(t,s,d,n)}ensurePacked(t,e,s){if(!this._evaluator.hasDynamicProperties)return;const r=this._evaluator.evaluateMeshParams(t,e,s);this._vertexPack.pack(r,this._viewParams)}_writeVertex(t,e,s,r,n){const o=this.evaluatedMeshParams;this._vertexPack.writeVertex(t,e,s,r,o,n)}};const du=100,fu=ue("featurelayer-fast-triangulation-enabled");let Pa=class extends Fe{async loadDependencies(){await Promise.all([super.loadDependencies(),jh()])}_write(t,e,s){const r=(s==null?void 0:s.asOptimized())??e.readGeometryForDisplay(),n=this._clip(r);n&&(t.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(t,e,n),t.recordEnd())}_clip(t){if(!t)return null;const e=this.hasEffects;return To(t,e?256:8)}_writeGeometry(t,e,s){const r=s.maxLength>du,n=[],o=this.createTesselationParams(e);if(!r&&fu&&Al(n,s))return void(n.length&&this._writeVertices(t,e,s.coords,o,n));const a=Fl(s);this._writeVertices(t,e,a,o)}_writeVertices(t,e,s,r,n){const o=e.getDisplayId(),a=t.vertexCount(),h=this.hasEffects;let l=0;if(n)for(const c of n){const u=s[2*c],d=s[2*c+1];h&&t.recordBounds(u,d,0,0),this._writeVertex(t,o,u,d,r),l++}else for(let c=0;ci,attributes:{id:{type:S.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:S.UNSIGNED_BYTE,count:1},pos:{type:S.SHORT,count:2,pack:"position",packPrecisionFactor:10},inverseArea:{type:S.FLOAT,count:1,packTessellation:({inverseArea:i})=>i}}};let _u=class extends Pa{constructor(){super(...arguments),this.vertexSpec=mu}createTesselationParams(t){return{inverseArea:1/t.readGeometryArea()}}};const gu=()=>me.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.meshWriterUtils"),yu=0,xu=100;function Re(i,t){return[!!(i!=null&&i.minScale)&&t.scaleToZoom(i.minScale)||yu,!!(i!=null&&i.maxScale)&&t.scaleToZoom(i.maxScale)||xu]}function Xe(i){return 1<i,attributes:{id:{type:S.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:S.UNSIGNED_BYTE,count:1},pos:{type:S.SHORT,count:2,pack:"position",packPrecisionFactor:10},zoomRange:{type:S.SHORT,count:2,packPrecisionFactor:Hi,pack:({scaleInfo:i},{tileInfo:t})=>Re(i,t)},color:{type:S.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:i})=>W(i)}}};let pn=class extends Pa{constructor(){super(...arguments),this.vertexSpec=wa}createTesselationParams(t){return null}};const qi={createComputedParams:i=>i,attributes:{...wa.attributes,tlbr:{count:4,type:S.UNSIGNED_SHORT,pack:({sprite:i})=>{const{rect:t,width:e,height:s}=i,r=t.x+Le,n=t.y+Le;return[r,n,r+e,n+s]}},inverseRasterizationScale:{count:1,type:S.BYTE,packPrecisionFactor:16,pack:({sprite:i})=>1/i.rasterizationScale}}};let Sa=class extends pn{constructor(){super(...arguments),this.vertexSpec=qi}_write(t,e,s){var a;const r=(s==null?void 0:s.asOptimized())??e.readGeometryForDisplay(),n=this._clip(r);if(!n)return;const o=(a=this.evaluatedMeshParams.sprite)==null?void 0:a.textureBinding;t.recordStart(this.instanceId,this.attributeLayout,o),this._writeGeometry(t,e,n),t.recordEnd()}};var to;(function(i){i[i.Geographic=0]="Geographic",i[i.Arithmatic=1]="Arithmatic"})(to||(to={}));const Ff=3.14159265359/180,wu=3.14159265359/128,Rf=1,Su=1.1,vu=1,Of=24,Df=8,Mu=1e-5,eo=.05,Cu=1e-30,dn=4,fn=0,va=2,Ma=5,Ca=6,$u=2,ku=3,Iu=0,Tu=3,zu=16777216;function mn(i){const{sprite:t,aspectRatio:e,scaleProportionally:s}=i,r=I(i.height),n=r>0?r:t.height;let o=r*e;return o<=0?o=t.width:s&&(o*=t.width/t.height),{width:o,height:n}}function $a(i){const{applyRandomOffset:t,sampleAlphaOnly:e}=i,{width:s,height:r}=mn(i);return As([[va,t],[dn,e],[Ca,si,attributes:{...qi.attributes,bitset:{count:1,type:S.UNSIGNED_BYTE,pack:$a},width:{count:1,type:S.UNSIGNED_SHORT,pack:ka},height:{count:1,type:S.UNSIGNED_SHORT,pack:Ia},offset:{count:2,type:S.SHORT,pack:({offsetX:i,offsetY:t})=>[I(i),-I(t)]},scale:{count:2,type:S.UNSIGNED_BYTE,packPrecisionFactor:16,pack:({scaleX:i,scaleY:t})=>[i,t]},angle:{count:1,type:S.UNSIGNED_BYTE,pack:({angle:i})=>Fh(i)}}};let Lu=class extends Sa{constructor(){super(...arguments),this.vertexSpec=Ta}},Eu=class{constructor(){this.extrusionOffsetX=0,this.extrusionOffsetY=0,this.normalX=0,this.normalY=0,this.directionX=0,this.directionY=0,this.distance=0}};const Zi={createComputedParams:i=>i,attributes:{id:{type:S.UNSIGNED_BYTE,count:3,pack:"id"},pos:{type:S.SHORT,count:2,pack:"position",packPrecisionFactor:10},bitset:{type:S.UNSIGNED_BYTE,count:1},zoomRange:{type:S.SHORT,count:2,packPrecisionFactor:Hi,pack:({scaleInfo:i},{tileInfo:t})=>Re(i,t)},color:{type:S.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:i})=>W(i)},offset:{type:S.BYTE,count:2,packPrecisionFactor:16,packTessellation:({extrusionOffsetX:i,extrusionOffsetY:t})=>[ti(i,16),ti(t,16)]},normal:{type:S.BYTE,count:2,packPrecisionFactor:16,packTessellation:({normalX:i,normalY:t})=>[ti(i,16),ti(t,16)]},halfWidth:{type:S.UNSIGNED_SHORT,count:1,packPrecisionFactor:16,pack:({width:i})=>Qn(I(.5*i),16)},referenceHalfWidth:{type:S.UNSIGNED_SHORT,count:1,packPrecisionFactor:16,pack:({referenceWidth:i})=>Qn(I(.5*i),16)}}};let Nu=class{constructor(){this.id=0,this.bitset=0,this.indexCount=0,this.vertexCount=0,this.vertexFrom=0,this.vertexBounds=0}};const so=65535;let _n=class extends Fe{constructor(t,e,s,r){super(t,e,s,r),this.vertexSpec=Zi,this._currentWrite=new Nu,this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0,wrapDistance:so,textured:!1},this._tessParams=new Eu,this._initializeTessellator()}writeLineVertices(t,e,s){const r=this._getLines(e);r!=null&&this._writeVertices(t,s,r)}_initializeTessellator(){this._lineTessellator=new Kh(this._writeTesselatedVertex.bind(this),this._writeTriangle.bind(this),!0)}_write(t,e,s){const r=s??N.fromFeatureSetReaderCIM(e);r&&this._writeGeometry(t,e,r)}_writeGeometry(t,e,s,r){t.recordStart(this.instanceId,this.attributeLayout,r),this.writeLineVertices(t,s,e),t.recordEnd()}_getLines(t){return Ol(t,So(this.evaluatedMeshParams))}_writeVertices(t,e,s){const{_currentWrite:r,_tessellationOptions:n,evaluatedMeshParams:o}=this,{width:a,capType:h,joinType:l,miterLimit:c,hasSizeVV:u}=o,d=I(.5*a);n.halfWidth=d,n.capType=bu(h),n.joinType=Pu(l),n.miterLimit=c;const p=!u;r.out=t,r.id=e.getDisplayId(),r.vertexCount=0,r.indexCount=0,r.vertexFrom=t.vertexCount(),r.vertexBounds=p&&di,attributes:{...Zi.attributes,bitset:{type:S.UNSIGNED_BYTE,count:1,pack:i=>0},color:{type:S.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:i})=>W(i)}}},gn={createComputedParams:i=>i,attributes:{...Zi.attributes,bitset:{type:S.UNSIGNED_BYTE,count:1,pack:i=>As([[fn,!0]])},color:{type:S.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:i})=>W(i)}}};let yn=class extends _n{constructor(){super(...arguments),this.vertexSpec=gn}},xn=class extends pn{constructor(t,e,s,r){super(t,e,s,r),this.vertexSpec=za,this._lineMeshWriter=this._createOutlineWriter(t,e,s,r)}_createOutlineWriter(t,e,s,r){return new yn(t,e,s,r)}_write(t,e,s){const r=(s==null?void 0:s.asOptimized())??e.readGeometryForDisplay(),n=this._clip(r);n&&(t.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(t,e,n),this._lineMeshWriter.writeLineVertices(t,N.fromOptimizedCIM(n,"esriGeometryPolyline"),e),t.recordEnd())}_clip(t){return t?To(t,So(this.evaluatedMeshParams)):null}ensurePacked(t,e,s){super.ensurePacked(t,e,s),this._lineMeshWriter.ensurePacked(t,e,s)}enqueueRequest(t,e,s){super.enqueueRequest(t,e,s),this._lineMeshWriter.enqueueRequest(t,e,s)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}};const La=()=>me.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");let Ea=class{constructor(){this._includedModules=new Map}include(t,e){if(this._includedModules.has(t)){const s=this._includedModules.get(t);if(s!==e){La().error("Trying to include shader module multiple times with different sets of options.");const r=new Set;for(const n of Object.keys(s))s[n]!==t[n]&&r.add(n);for(const n of Object.keys(t))s[n]!==t[n]&&r.add(n);r.forEach(n=>console.error(` ${n}: current ${s[n]} new ${t[n]}`))}}else this._includedModules.set(t,e),t(this.builder,e)}},Au=class extends Ea{constructor(){super(...arguments),this.vertex=new io,this.fragment=new io,this.attributes=new Ou,this.varyings=new Du,this.extensions=new $r,this.constants=new Na}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(t,e=!0){const s=this.extensions.generateSource(t),r=this.attributes.generateSource(t),n=this.varyings.generateSource(t),o=t==="vertex"?this.vertex:this.fragment,a=o.uniforms.generateSource(),h=o.code.generateSource(),l=t==="vertex"?Bu:Gu(e),c=this.constants.generateSource().concat(o.constants.generateSource());return`${e?"#version 300 es":""} +import{ij as $i,j_ as tn,jW as ki,ml as Es,ab as ht,ac as wt,ad as li,F as mt,aa as fr,aV as Ie,mm as oe,mn as ci,mo as le,aS as en,mp as T,mq as K,mr as Be,ms as Vi,mt as Ds,mu as Ct,l9 as Xt,mv as tr,i3 as go,mw as Ve,mx as fh,my as mh,ai as ze,mz as _h,ly as gh,mA as Gs,mB as yh,bE as xh,bh as I,mC as bh,s as me,lk as ce,mD as Yi,ll as mr,mE as Ph,mF as vt,fj as Bs,iV as En,lE as ui,lD as _r,ag as wh,E as ue,bg as de,mG as sn,mH as rn,mI as tt,mJ as ct,aq as Sh,il as vh,am as yo,mK as Vs,mL as Mh,mM as Ch,mN as $h,mO as kh,mP as Ih,mQ as Nn,mR as Th,mS as zh,mT as Lh,jJ as Ys,mU as Hs,lA as Eh,_ as Nh,g5 as S,a9 as Ah,N as nn,hh as er,hi as sr,lw as Hi,$ as Le,mV as Fh,mW as Ii,mX as on,hg as Rh,d as x,aG as Oh,mY as ir,iU as Dh,lt as B,I as An,mZ as Gh,l8 as xo,lH as Bh,lB as Vh,y as Fn,f as Yh,a7 as Hh,i0 as Uh,l6 as Xh,g as Wh}from"./index-BjUNJPVf.js";import{a as qh,C as Zh,i as jh,c as Kh}from"./TurboLine-DNQdPIXo.js";import"./earcut-CWKXDqDj.js";import{e as Ti}from"./OptimizedGeometry-CQuTPb9g.js";import{j as Jh,I as $,t as Rt,C as Qh,B as tl,N as xe,w as bo,P as Po,A as el,F as sl,L as rr,x as il,T as rl,S as nl,g as ol,d as al,k as hl,O as wo}from"./utils-CuXO_Zzq.js";import{t as ll}from"./Rect-CUzevAry.js";import{i as Ce,a as cl,f as ul,w as pl,g as So,T as dl,r as Us}from"./LabelMetric-BcUxDImF.js";import{b as fl}from"./labelUtils-3p0-m-Ee.js";import{a as Xs}from"./BindType-BmZEZMMh.js";import{s as ml}from"./Util-CS5u4Lec.js";import"./Texture-S4dD-WHn.js";import{r as _l}from"./Program-DBsYtQ00.js";import{l as vo}from"./highlightReasons-BOU4mnPE.js";import{t as Wt}from"./constants-D5zmR9t2.js";function Ad(i){return i}function Fd(i){return i}function gl(i,t,e,s,r,n,o){xr=0;const a=(s-e)*n,h=r&&r.length,l=h?(r[0]-e)*n:a;let c,u,d,p,m,f=Mo(t,e,s,0,l,n,!0);if(f&&f.next!==f.prev){if(h&&(f=Pl(t,e,s,r,f,n)),a>80*n){c=d=t[0+e*n],u=p=t[1+e*n];for(let _=n;_0)for(let h=s;h=s;h-=n)a=Rn(h+t*n,i[h+t*n],i[h+1+t*n],a);return a&&ae(a,a.next)&&($s(a),a=a.next),a}function Ms(i,t=i){if(!i)return i;let e,s=i;do if(e=!1,s.steiner||!ae(s,s.next)&&Z(s.prev,s,s.next)!==0)s=s.next;else{if($s(s),s=t=s.prev,s===s.next)break;e=!0}while(e||s!==t);return t}function Cs(i,t,e,s,r,n,o,a){if(!i)return;!a&&n&&(i=Co(i,s,r,n));let h=i;for(;i.prev!==i.next;){const l=i.prev,c=i.next;if(n?xl(i,s,r,n):yl(i))t.push(l.index/e+o),t.push(i.index/e+o),t.push(c.index/e+o),$s(i),i=c.next,h=c.next;else if((i=c)===h){a?a===1?Cs(i=kl(i,t,e,o),t,e,s,r,n,o,2):a===2&&Il(i,t,e,s,r,n,o):Cs(Ms(i),t,e,s,r,n,o,1);break}}}function yl(i){const t=i.prev,e=i,s=i.next;if(Z(t,e,s)>=0)return!1;let r=i.next.next;const n=r;let o=0;for(;r!==i.prev&&(o===0||r!==n);){if(o++,$e(t.x,t.y,e.x,e.y,s.x,s.y,r.x,r.y)&&Z(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function xl(i,t,e,s){const r=i.prev,n=i,o=i.next;if(Z(r,n,o)>=0)return!1;const a=r.xn.x?r.x>o.x?r.x:o.x:n.x>o.x?n.x:o.x,c=r.y>n.y?r.y>o.y?r.y:o.y:n.y>o.y?n.y:o.y,u=gr(a,h,t,e,s),d=gr(l,c,t,e,s);let p=i.prevZ,m=i.nextZ;for(;p&&p.z>=u&&m&&m.z<=d;){if(p!==i.prev&&p!==i.next&&$e(r.x,r.y,n.x,n.y,o.x,o.y,p.x,p.y)&&Z(p.prev,p,p.next)>=0||(p=p.prevZ,m!==i.prev&&m!==i.next&&$e(r.x,r.y,n.x,n.y,o.x,o.y,m.x,m.y)&&Z(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;p&&p.z>=u;){if(p!==i.prev&&p!==i.next&&$e(r.x,r.y,n.x,n.y,o.x,o.y,p.x,p.y)&&Z(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;m&&m.z<=d;){if(m!==i.prev&&m!==i.next&&$e(r.x,r.y,n.x,n.y,o.x,o.y,m.x,m.y)&&Z(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function Rn(i,t,e,s){const r=zi.create(i,t,e);return s?(r.next=s.next,r.prev=s,s.next.prev=r,s.next=r):(r.prev=r,r.next=r),r}function $s(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function bl(i){let t=i,e=i;do(t.x=e.next.y&&e.next.y!==e.y){const d=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(d<=s&&d>o){if(o=d,d===s){if(r===e.y)return e;if(r===e.next.y)return e.next}n=e.x=e.x&&e.x>=h&&s!==e.x&&$e(rn.x)&&ks(e,i)&&(n=e,u=c)),e=e.next;return n}function Co(i,t,e,s){let r;for(;r!==i;r=r.next){if(r=r||i,r.z===null&&(r.z=gr(r.x,r.y,t,e,s)),r.prev.next!==r||r.next.prev!==r)return r.prev.next=r,r.next.prev=r,Co(i,t,e,s);r.prevZ=r.prev,r.nextZ=r.next}return i.prevZ.nextZ=null,i.prevZ=null,vl(i)}function vl(i){let t,e=1;for(;;){let s,r=i;i=null,t=null;let n=0;for(;r;){n++,s=r;let o=0;for(;o0||a>0&&s;){let h;o===0?(h=s,s=s.nextZ,a--):a!==0&&s?r.z<=s.z?(h=r,r=r.nextZ,o--):(h=s,s=s.nextZ,a--):(h=r,r=r.nextZ,o--),t?t.nextZ=h:i=h,h.prevZ=t,t=h}r=s}if(t.nextZ=null,e*=2,n<2)return i}}function Z(i,t,e){return(t.y-i.y)*(e.x-t.x)-(t.x-i.x)*(e.y-t.y)}function $o(i,t,e,s){return!!(ae(i,t)&&ae(e,s)||ae(i,s)&&ae(e,t))||Z(i,t,e)>0!=Z(i,t,s)>0&&Z(e,s,i)>0!=Z(e,s,t)>0}function Ml(i,t){let e=i;do{if(e.index!==i.index&&e.next.index!==i.index&&e.index!==t.index&&e.next.index!==t.index&&$o(e,e.next,i,t))return!0;e=e.next}while(e!==i);return!1}function Cl(i,t,e,s,r,n){let o=0;for(let a=s,h=r-n;a=0&&(i-o)*(s-a)-(e-o)*(t-a)>=0&&(e-o)*(n-a)-(r-o)*(s-a)>=0}function ks(i,t){return Z(i.prev,i,i.next)<0?Z(i,t,i.next)>=0&&Z(i,i.prev,t)>=0:Z(i,t,i.prev)<0||Z(i,i.next,t)<0}function gr(i,t,e,s,r){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=32767*(i-e)*r)|i<<8))|i<<4))|i<<2))|i<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-s)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function ae(i,t){return i.x===t.x&&i.y===t.y}function $l(i,t){return i.x-t.x}function kl(i,t,e,s){let r=i;do{const n=r.prev,o=r.next.next;!ae(n,o)&&$o(n,r,r.next,o)&&ks(n,o)&&ks(o,n)&&(t.push(n.index/e+s),t.push(r.index/e+s),t.push(o.index/e+s),$s(r),$s(r.next),r=i=o),r=r.next}while(r!==i);return r}function Il(i,t,e,s,r,n,o){let a=i;do{let h=a.next.next;for(;h!==a.prev;){if(a.index!==h.index&&Tl(a,h)){let l=ko(a,h);return a=Ms(a,a.next),l=Ms(l,l.next),Cs(a,t,e,s,r,n,o,0),void Cs(l,t,e,s,r,n,o,0)}h=h.next}a=a.next}while(a!==i)}function Tl(i,t){return i.next.index!==t.index&&i.prev.index!==t.index&&!Ml(i,t)&&ks(i,t)&&ks(t,i)&&zl(i,t)}function zl(i,t){let e=i,s=!1;const r=(i.x+t.x)/2,n=(i.y+t.y)/2;do e.y>n!=e.next.y>n&&e.next.y!==e.y&&r<(e.next.x-e.x)*(n-e.y)/(e.next.y-e.y)+e.x&&(s=!s),e=e.next;while(e!==i);return s}function ko(i,t){const e=zi.create(i.index,i.x,i.y),s=zi.create(t.index,t.x,t.y),r=i.next,n=t.prev;return i.next=t,t.prev=i,e.next=r,r.prev=e,s.next=e,e.prev=s,n.next=s,s.prev=n,s}let zi=class Io{constructor(){this.index=0,this.x=0,this.y=0,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}static create(t,e,s){const r=xr0))break;u+=g,d.push(a+c),c+=_}const p=o.length;gl(o,e,a,a+c,d,2,n);const m=Nl(o,e,p,o.length,n),f=Math.abs(u);if(Math.abs((m-f)/Math.max(1e-7,f))>El)return o.length=0,!1;h=l,a+=c}return!0}function Fl(i){const{coords:t,lengths:e}=i,{buffer:s}=qh(t,e);return s}function Rl(i,t,e){let s=0;for(let r=0;re||he)return!0}s+=n}return!1}function To(i,t){if(i==null)return null;if(!Rl(i,-128,$i+128))return i;Qt.setPixelMargin(t),Qt.reset(ki.Polygon);let e=0;for(let o=0;or||cr){o=!0;continue}h.push({x:l,y:c})}let u=!1;for(;i.nextPoint();)if(l=i.x,c=i.y,o)e.lineTo(l,c);else{if(lr||cr){u=!0;break}h.push({x:l,y:c})}if(u)o=!0;else{if(o){const d=e.resultWithStarts();if(d)for(const p of d)n.push(p)}else n.push({line:h,start:0});a=i.nextPath(),o=!1}}return n=n.filter(h=>h.line.length>1),n.length===0?null:n}Qt.setExtent($i),br.setExtent($i);let N=class{static fromOptimized(t,e,s=!1,r=!1,n=1){return new Pr().initialize(t,e,s,r,n)}static fromJSON(t,e=!1,s=!1){const[r,n]=Dn(t);return new wr().initialize(r,n,e,s,1)}static fromOptimizedCIM(t,e,s=!1,r=!1,n=1){return new Gn().initialize(t,e,s,r,n)}static fromJSONCIM(t,e=!1,s=!1,r=1){const[n,o]=Dn(t);return new Bn().initialize(n,o,e,s,r)}static fromFeatureSetReader(t){const e=t.readGeometryForDisplay(),s=t.geometryType;return e&&s?this.fromOptimized(e,s):null}static fromFeatureSetReaderCIM(t){const e=t.readGeometryForDisplay(),s=t.geometryType;return e&&s?this.fromOptimizedCIM(e,s):null}static createEmptyOptimized(t,e=!1,s=!1,r=1){return new Pr().initialize(new Ti,t,e,s,r)}static createEmptyJSON(t,e=!1,s=!1){return new wr().initialize([],t,e,s,1)}static createEmptyOptimizedCIM(t,e=!1,s=!1,r=1){return new Gn().initialize(new Ti,t,e,s,r)}static createEmptyJSONCIM(t,e=!1,s=!1,r=1){return new Bn().initialize([],t,e,s,r)}asJSON(){const t=Es(this);return this.geometryType==="esriGeometryEnvelope"?{xmin:t[0][0][0],ymin:t[0][0][1],xmax:t[0][2][0],ymax:t[0][2][1]}:this.geometryType==="esriGeometryMultipoint"?{points:t.flat()}:this.geometryType==="esriGeometryPoint"?{x:t[0][0][0],y:t[0][0][1]}:this.geometryType==="esriGeometryPolygon"?{rings:t}:{paths:t}}getCurrentRingArea(){if(this.pathSize<3)return 0;let t,e,s=0;if(this.seekPathStart(),!this.nextPoint())return 0;t=this.x,e=this.y;const r=t,n=e;for(;this.nextPoint();)s+=(t-this.x)*(e+this.y),t=this.x,e=this.y;return s+=(t-r)*(e+n),-.5*s}invertY(){this.yFactor*=-1}},Pr=class zo extends N{constructor(){super(...arguments),this._end=-1}initialize(t,e,s,r,n){return this.hasZ=s,this.hasM=r,this.geometryType=e,this._stride=2+Number(s)+Number(r),this._geometry=t,this._pathIndex=-1,this._pathOffset=0,this._pointOffset=-this._stride,this._end=-1,this.yFactor=n,this}reset(){this.initialize(this._geometry,this.geometryType,this.hasZ,this.hasM,this.yFactor)}seekPath(t){if(t>=0&&tt)for(;this._pathIndex>t&&this.prevPath(););return!0}return!1}seekPathStart(){this._pointOffset=this._pathOffset-this._stride}seekPathEnd(){this._pointOffset=this._end}seekInPath(t){const e=this._pathOffset+t*this._stride;return e>=0&&e=this._pathOffset}nextPath(){return!(this.pathIndex>=this.totalSize-1)&&(this._pathIndex>=0&&(this._pathOffset+=this._stride*this.pathSize),this._pathIndex++,this._pointOffset=this._pathOffset-this._stride,this._end=this._pointOffset+this._stride+this._stride*this.pathSize,!0)}prevPath(){return!(this.pathIndex<=0)&&(this._pathIndex--,this._end=this._pathOffset,this._pathOffset-=this._stride*this.pathSize,this._pointOffset=this._pathOffset-this._stride,!0)}pathLength(){const t=this._end,e=this._stride,s=this._geometry.coords;let r=0;for(let n=this._pathOffset+e;nt+e)}get pathSize(){const{lengths:t}=this._geometry;return this._pathIndex<0||this._pathIndex>t.length-1?0:this._geometry.isPoint?1:t[this._pathIndex]}get totalSize(){return this._geometry.lengths.length}get x(){return this._geometry.coords[this._pointOffset]}set x(t){this._geometry.coords[this._pointOffset]=t}get y(){return this.yFactor*this._geometry.coords[this._pointOffset+1]}set y(t){this._geometry.coords[this._pointOffset+1]=this.yFactor*t}get z(){return this._geometry.coords[this._pointOffset+2]}set z(t){this._geometry.coords[this._pointOffset+2]=t}get m(){const t=this.hasZ?3:2;return this._geometry.coords[this._pointOffset+t]}set m(t){this._geometry.coords[this._pointOffset+3]=t}get pathIndex(){return this._pathIndex}get _coordIndex(){return this._pointOffset/this._stride}};function Dl(i){const t=[i.x,i.y];return i.z&&t.push(i.z),i.m&&t.push(i.m),t}function Dn(i){return ht(i)?[i.rings,"esriGeometryPolygon"]:wt(i)?[i.paths,"esriGeometryPolyline"]:li(i)?[[i.points],"esriGeometryMultipoint"]:mt(i)?[[[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]],"esriGeometryEnvelope"]:fr(i)?[[[Dl(i)]],"esriGeometryPoint"]:[[],"esriGeometryPolyline"]}let wr=class Lo extends N{initialize(t,e,s,r,n){return this._paths=t,this.geometryType=e,this.hasZ=s,this.hasM=r,this._pathIndex=this._pointIndex=-1,this.yFactor=n,this._mIndex=this.hasZ?3:2,this}reset(){this._pathIndex=this._pointIndex=-1}seekPath(t){return this._pathIndex=t,this._pointIndex=-1,t>=0&&t=0&&t=0}nextPath(){return this._pointIndex=-1,this._currentPath=this._paths[++this._pathIndex],this._pathIndex0&&(this._pointIndex=-1,this._pathIndex--,this._currentPath=this._paths[this._pathIndex],!0)}pathLength(){const t=this._currentPath.length,e=this._currentPath;let s=0;for(let r=1;rt.length).reduce((t,e)=>t+e)}get pathSize(){return this._pathIndex<0||this._pathIndex>this.totalSize-1?-1:this._paths[this._pathIndex].length}get totalSize(){return this._paths.length}get x(){return this._currentPoint[0]}set x(t){this._currentPoint[0]=t}get y(){return this.yFactor*this._currentPoint[1]}set y(t){this._currentPoint[1]=this.yFactor*t}get z(){return this._currentPoint[2]}set z(t){this._currentPoint[2]=t}get m(){return this._currentPoint[this._mIndex]}set m(t){this._currentPoint[this._mIndex]=t}get pathIndex(){return this._pathIndex}};const Ws=4,qs=1;let Gn=class Eo extends Pr{initialize(t,e,s,r,n){return super.initialize(t,e,s,r,n),this._controlPoints||(this._controlPoints=this._controlPoints=new Array(this.totalSize).fill(void 0).map(o=>new Set)),this}startPath(){super.startPath(),this._controlPoints.push(new Set)}clone(){const t=new Eo().initialize(this._geometry.clone(),this.geometryType,this.hasZ,this.hasM,this.yFactor);return t._controlPoints=this._controlPoints,t}setControlPoint(){this._controlPoints[this.pathIndex].add(this._coordIndex)}getControlPoint(){return this._controlPoints[this.pathIndex].has(this._coordIndex)}setControlPointAt(t){this._controlPoints[this.pathIndex].add(t)}getControlPointAt(t){return this._controlPoints[this.pathIndex].has(t)}},Bn=class No extends wr{initialize(t,e,s,r,n){return super.initialize(t,e,s,r,n)}clone(){return new No().initialize(Ie(this._paths),this.geometryType,this.hasZ,this.hasM,this.yFactor)}setControlPoint(){this._paths[this.pathIndex][this._pointIndex][Ws]=qs}getControlPoint(){return this._paths[this.pathIndex][this._pointIndex][Ws]===qs}setControlPointAt(t){this._paths[this.pathIndex][t][Ws]=qs}getControlPointAt(t){return this._paths[this.pathIndex][t][Ws]===qs}};const Gl=512;let $t,Sr=class{constructor(t){this._geometry=t}next(){const t=this._geometry;return this._geometry=null,t}};function an(i,t){$t||($t=new tn(0,0,0,1));const e=i.geometryType==="esriGeometryPolygon",s=e?ki.Polygon:ki.LineString,r=e?3:2;let n,o;for($t.reset(s),$t.setPixelMargin(t+1),$t.setExtent(Gl);i.nextPath();)if(!(i.pathSize1&&y>0&&l>0&&(a*_+h*g)/y/l<=this._maxCosAngle&&t.setControlPointAt(p-1),p===1&&(c=_,u=g,d=y),y>0&&(r=m,n=f,a=_,h=g,l=y)}this._isClosed&&l>0&&d>0&&(a*c+h*u)/d/l<=this._maxCosAngle&&t.setControlPointAt(0)}}},Ae=class{constructor(){this.setIdentity()}getAngle(){return(this.rz==null||this.rz===0&&this.rzCos!==1&&this.rzSin!==0)&&(this.rz=Math.atan2(this.rzSin,this.rzCos)),this.rz}setIdentity(){this.tx=0,this.ty=0,this.tz=0,this.s=1,this.rx=0,this.ry=0,this.rz=0,this.rzCos=1,this.rzSin=0}setTranslate(t,e){this.tx=t,this.ty=e}setTranslateZ(t){this.tz=t}setRotateCS(t,e){this.rz=void 0,this.rzCos=t,this.rzSin=e}setRotate(t){this.rz=t,this.rzCos=void 0,this.rzSin=void 0}setRotateY(t){this.ry=t}setScale(t){this.s=t}setMeasure(t){this.m=t}};function nr(i,t){i[4]=t}let Ns=class{constructor(t,e=!0,s=!0,r=0){this.isClosed=!1,this.geometryCursor=null,this.geometryCursor=!e&&t.geometryType==="esriGeometryPolygon"||!s&&t.geometryType==="esriGeometryPolyline"?null:t,this.geomUnitsPerPoint=r,this.iteratePath=!1,this.internalPlacement=new Ae}next(){if(!this.geometryCursor)return null;for(;this.iteratePath||this.geometryCursor.pathIndex0?[o/h,a/h]:[1,0]}getSegAngleCS(t,e){const[[s,r],[n,o]]=t;return this.getAngleCS(s,r,n,o,e)}cut(t,e,s,r,n,o){return[n<=0?[t,e]:this.getCoord2D(t,e,s,r,n),o>=1?[s,r]:this.getCoord2D(t,e,s,r,o)]}getSubCurve(t,e,s){const r=N.createEmptyOptimizedCIM("esriGeometryPolyline");return this.appendSubCurve(r,t,e,s)?r:null}appendSubCurve(t,e,s,r){t.startPath(),e.seekPathStart();let n=0,o=!0;if(!e.nextPoint())return!1;let a=e.x,h=e.y;for(;e.nextPoint();){const l=this.getLength(a,h,e.x,e.y);if(l!==0){if(o){if(n+l>s){const c=(s-n)/l;let u=1,d=!1;n+l>=r&&(u=(r-n)/l,d=!0);const p=this.cut(a,h,e.x,e.y,c,u);if(p&&t.pushPoints(p),d)break;o=!1}}else{if(n+l>r){const c=this.cut(a,h,e.x,e.y,0,(r-n)/l);c&&t.pushPoint(c[1]);break}t.pushXY(e.x,e.y)}n+=l,a=e.x,h=e.y}else a=e.x,h=e.y}return!0}getCIMPointAlong(t,e){if(!t.nextPoint())return null;let s,r,n,o,a=0;for(s=t.x,r=t.y;t.nextPoint();s=n,r=o){n=t.x,o=t.y;const h=this.getLength(s,r,n,o);if(h!==0){if(a+h>e){const l=(e-a)/h;return this.getCoord2D(s,r,n,o,l)}a+=h}}return null}offset(t,e,s,r,n){if(!t||t.length<2)return null;let o=0,a=t[o++],h=o;for(;o=0==e<=0){if(g<1){const y=[m[0]-f[0],m[1]-f[1]];this.normalize(y);const P=Math.sqrt((1+g)/2);if(P>1/r){const w=-Math.abs(e)/P;c.push([u[0]-y[0]*w,u[1]-y[1]*w])}}}else switch(s){case oe.Mitered:{const y=Math.sqrt((1+g)/2);if(y>0&&1/y0){const P=1/y;let w=P;for(let M=1;M0){const n=N.createEmptyOptimizedCIM(t.geometryType),o=Es(t)[0],a=this._curveHelper.offset(o,this._size,oe.Rounded,4,this._offsetFlattenError);if(a)return n.pushPath(a),n}else if(this._size<0){const n=t.asJSON();if(Math.min(n.xmax-n.xmin,n.ymax-n.ymin)+2*this._size>0)return N.fromJSONCIM({xmin:n.xmin-this._size,xmax:n.xmax+this._size,ymin:n.ymin-this._size,ymax:n.ymax+this._size})}}const e=this._geometryEngine;if(e==null)return null;const s=this._tileKey?an(t,this._maxInflateSize):t;if(!s)continue;const r=e.buffer(en.WebMercator,s.asJSON(),this._size,1);return r?N.fromJSONCIM(r):null}return null}},Oo=class ss{static local(){return ss.instance===null&&(ss.instance=new ss),ss.instance}execute(t,e,s,r,n){return new Xl(t,e,s)}};Oo.instance=null;let Xl=class{constructor(t,e,s){this._defaultPointSize=20,this._inputGeometries=t,this._geomUnitsPerPoint=s,this._rule=e.rule??T.FullGeometry,this._defaultSize=this._defaultPointSize*s}next(){let t;for(;t=this._inputGeometries.next();){const e=this._processGeom(Es(t));if(e&&e.length)return N.fromJSONCIM({paths:e})}return null}_clone(t){return[t[0],t[1]]}_mid(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}_mix(t,e,s,r){return[t[0]*e+s[0]*r,t[1]*e+s[1]*r]}_add(t,e){return[t[0]+e[0],t[1]+e[1]]}_add2(t,e,s){return[t[0]+e,t[1]+s]}_sub(t,e){return[t[0]-e[0],t[1]-e[1]]}_dist(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}_norm(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}_normalize(t,e=1){const s=e/this._norm(t);t[0]*=s,t[1]*=s}_leftPerpendicular(t){const e=-t[1],s=t[0];t[0]=e,t[1]=s}_leftPerp(t){return[-t[1],t[0]]}_rightPerpendicular(t){const e=t[1],s=-t[0];t[0]=e,t[1]=s}_rightPerp(t){return[t[1],-t[0]]}_dotProduct(t,e){return t[0]*e[0]+t[1]*e[1]}_crossProduct(t,e){return t[0]*e[1]-t[1]*e[0]}_rotateDirect(t,e,s){const r=t[0]*e-t[1]*s,n=t[0]*s+t[1]*e;t[0]=r,t[1]=n}_makeCtrlPt(t){const e=[t[0],t[1]];return nr(e,1),e}_addAngledTicks(t,e,s,r){const n=this._sub(s,e);this._normalize(n);const o=this._crossProduct(n,this._sub(r,e));let a;a=o>0?this._rightPerp(n):this._leftPerp(n);const h=Math.abs(o)/2,l=[];l.push([e[0]+(a[0]-n[0])*h,e[1]+(a[1]-n[1])*h]),l.push(e),l.push(s),l.push([s[0]+(a[0]+n[0])*h,s[1]+(a[1]+n[1])*h]),t.push(l)}_addBezier2(t,e,s,r,n){if(n--==0)return void t.push(r);const o=this._mid(e,s),a=this._mid(s,r),h=this._mid(o,a);this._addBezier2(t,e,o,h,n),this._addBezier2(t,h,a,r,n)}_addBezier3(t,e,s,r,n,o){if(o--==0)return void t.push(n);const a=this._mid(e,s),h=this._mid(s,r),l=this._mid(r,n),c=this._mid(a,h),u=this._mid(h,l),d=this._mid(c,u);this._addBezier3(t,e,a,c,d,o),this._addBezier3(t,d,u,l,n,o)}_add90DegArc(t,e,s,r,n){const o=n??this._crossProduct(this._sub(s,e),this._sub(r,e))>0,a=this._mid(e,s),h=this._sub(a,e);o?this._leftPerpendicular(h):this._rightPerpendicular(h),a[0]+=h[0],a[1]+=h[1],this._addBezier3(t,e,this._mix(e,.33333,a,.66667),this._mix(s,.33333,a,.66667),s,4)}_addArrow(t,e,s){const r=e[0],n=e[1],o=e[e.length-1],a=this._sub(r,n);this._normalize(a);const h=this._crossProduct(a,this._sub(o,n)),l=.5*h,c=this._leftPerp(a),u=[o[0]-c[0]*h,o[1]-c[1]*h],d=e.length-1,p=[];p.push(s?[-c[0],-c[1]]:c);let m=[-a[0],-a[1]];for(let f=1;f0;f--)t.push([e[f][0]+p[f][0]*l,e[f][1]+p[f][1]*l]);t.push([u[0]+p[0][0]*l,u[1]+p[0][1]*l]),t.push([u[0]+p[0][0]*h,u[1]+p[0][1]*h]),t.push(r),t.push([u[0]-p[0][0]*h,u[1]-p[0][1]*h]),t.push([u[0]-p[0][0]*l,u[1]-p[0][1]*l]);for(let f=1;f=2?t[1]:this._add2(t[0],e*this._defaultSize,s*this._defaultSize)}_cp3(t,e,s,r){if(t.length>=3)return t[2];const n=this._mix(t[0],1-s,e,s),o=this._sub(e,t[0]);return this._normalize(o),this._rightPerpendicular(o),[n[0]+o[0]*r*this._defaultSize,n[1]+o[1]*r*this._defaultSize]}_arrowPath(t){if(t.length>2)return t;const e=t[0],s=this._cp2(t,-4,0),r=this._sub(e,s);this._normalize(r);const n=this._rightPerp(r);return[e,s,[e[0]+(n[0]-r[0])*this._defaultSize,e[1]+(n[1]-r[1])*this._defaultSize]]}_arrowLastSeg(t){const e=t[0],s=this._cp2(t,-4,0);let r;if(t.length>=3)r=t[t.length-1];else{const n=this._sub(e,s);this._normalize(n);const o=this._rightPerp(n);r=[e[0]+(o[0]-n[0])*this._defaultSize,e[1]+(o[1]-n[1])*this._defaultSize]}return[s,r]}_processGeom(t){if(!t)return null;const e=[];for(const s of t){if(!s||s.length===0)continue;const r=s.length;let n=s[0];switch(this._rule){case T.PerpendicularFromFirstSegment:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,4),h=[];h.push(a),h.push(this._mid(n,o)),e.push(h);break}case T.ReversedFirstSegment:{const o=this._cp2(s,0,-1);e.push([o,n]);break}case T.PerpendicularToSecondSegment:{const o=this._cp2(s,-4,1),a=this._cp3(s,o,.882353,-1.94),h=[];h.push(this._mid(o,a)),h.push(n),e.push(h);break}case T.SecondSegmentWithTicks:{const o=this._cp2(s,-4,1),a=this._cp3(s,o,.882353,-1.94),h=this._sub(a,o);let l;l=this._crossProduct(h,this._sub(n,o))>0?this._rightPerp(l):this._leftPerp(h);const c=[];c.push([o[0]+(l[0]-h[0])/3,o[1]+(l[1]-h[1])/3]),c.push(o),c.push(a),c.push([a[0]+(l[0]+h[0])/3,a[1]+(l[1]+h[1])/3]),e.push(c);break}case T.DoublePerpendicular:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,3),h=this._mid(n,o),l=this._sub(h,a);this._normalize(l);const c=this._crossProduct(l,this._sub(n,a));this._leftPerpendicular(l);const u=[];u.push(n),u.push([a[0]+l[0]*c,a[1]+l[1]*c]),e.push(u);const d=[];d.push([a[0]-l[0]*c,a[1]-l[1]*c]),d.push(o),e.push(d);break}case T.OppositeToFirstSegment:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,3),h=this._mid(n,o),l=this._sub(h,a);this._normalize(l);const c=this._crossProduct(l,this._sub(n,a));this._leftPerpendicular(l);const u=[];u.push([a[0]+l[0]*c,a[1]+l[1]*c]),u.push([a[0]-l[0]*c,a[1]-l[1]*c]),e.push(u);break}case T.TriplePerpendicular:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,4),h=this._mid(n,o),l=this._sub(h,a);this._normalize(l);const c=this._crossProduct(l,this._sub(n,a));this._leftPerpendicular(l);const u=[];u.push([a[0]+l[0]*c*.8,a[1]+l[1]*c*.8]),u.push([h[0]+.8*(n[0]-h[0]),h[1]+.8*(n[1]-h[1])]),e.push(u),e.push([a,h]);const d=[];d.push([a[0]-l[0]*c*.8,a[1]-l[1]*c*.8]),d.push([h[0]+.8*(o[0]-h[0]),h[1]+.8*(o[1]-h[1])]),e.push(d);break}case T.HalfCircleFirstSegment:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,4),h=this._mid(n,o);let l=this._sub(o,n);const c=Math.cos(Math.PI/18),u=Math.sin(Math.PI/18),d=Math.sqrt((1+c)/2),p=Math.sqrt((1-c)/2),m=[];let f;this._crossProduct(l,this._sub(a,n))>0?(m.push(n),l=this._sub(n,h),f=o):(m.push(o),l=this._sub(o,h),f=n),this._rotateDirect(l,d,p),l[0]/=d,l[1]/=d;for(let _=1;_<=18;_++)m.push(this._add(h,l)),this._rotateDirect(l,c,u);m.push(f),e.push(m);break}case T.HalfCircleSecondSegment:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,1,-1);let h=this._sub(n,o);this._normalize(h);const l=this._crossProduct(h,this._sub(a,o))/2;this._leftPerpendicular(h);const c=[o[0]+h[0]*l,o[1]+h[1]*l];h=this._sub(o,c);const u=Math.cos(Math.PI/18);let d=Math.sin(Math.PI/18);l>0&&(d=-d);const p=[o];for(let m=1;m<=18;m++)this._rotateDirect(h,u,d),p.push(this._add(c,h));e.push(p);break}case T.HalfCircleExtended:{const o=this._cp2(s,0,-2),a=this._cp3(s,o,1,-1);let h;if(r>=4)h=s[3];else{const m=this._sub(n,o);h=this._add(a,m)}const l=this._dist(o,a)/2/.75,c=this._sub(o,n);this._normalize(c,l);const u=this._sub(a,h);this._normalize(u,l);const d=[h,a];e.push(d);const p=[this._clone(a)];this._addBezier3(p,a,this._add(a,u),this._add(o,c),o,4),p.push(n),e.push(p);break}case T.OpenCircle:{const o=this._cp2(s,-2,0),a=this._sub(o,n),h=Math.cos(Math.PI/18),l=-Math.sin(Math.PI/18),c=[o];for(let u=1;u<=33;u++)this._rotateDirect(a,h,l),c.push(this._add(n,a));e.push(c);break}case T.CoverageEdgesWithTicks:{const o=this._cp2(s,0,-1);let a,h;if(r>=3)a=s[2];else{const d=this._sub(o,n),p=this._leftPerp(d);a=[n[0]+p[0]-.25*d[0],n[1]+p[1]-.25*d[1]]}if(r>=4)h=s[3];else{const d=this._mid(n,o),p=this._sub(n,o);this._normalize(p),this._leftPerpendicular(p);const m=this._crossProduct(p,this._sub(a,d));this._rightPerpendicular(p),h=[a[0]+p[0]*m*2,a[1]+p[1]*m*2]}const l=this._sub(o,n);let c,u;c=this._crossProduct(l,this._sub(a,n))>0?this._rightPerp(l):this._leftPerp(l),u=[],u.push(a),u.push(n),u.push([n[0]+(c[0]-l[0])/3,n[1]+(c[1]-l[1])/3]),e.push(u),c=this._crossProduct(l,this._sub(h,o))>0?this._rightPerp(c):this._leftPerp(l),u=[],u.push([o[0]+(c[0]+l[0])/3,o[1]+(c[1]+l[1])/3]),u.push(o),u.push(h),e.push(u);break}case T.GapExtentWithDoubleTicks:{const o=this._cp2(s,0,2),a=this._cp3(s,o,0,1);let h;if(r>=4)h=s[3];else{const l=this._sub(o,n);h=this._add(a,l)}this._addAngledTicks(e,n,o,this._mid(a,h)),this._addAngledTicks(e,a,h,this._mid(n,o));break}case T.GapExtentMidline:{const o=this._cp2(s,2,0),a=this._cp3(s,o,0,1);let h;if(r>=4)h=s[3];else{const c=this._sub(o,n);h=this._add(a,c)}const l=[];l.push(this._mid(n,a)),l.push(this._mid(o,h)),e.push(l);break}case T.Chevron:{const o=this._cp2(s,-1,-1);let a;if(r>=3)a=s[2];else{const h=this._sub(o,n);this._leftPerpendicular(h),a=this._add(n,h)}e.push([o,this._makeCtrlPt(n),a]);break}case T.PerpendicularWithArc:{const o=this._cp2(s,0,-2),a=this._cp3(s,o,.5,-1);let h=this._sub(o,n);const l=this._norm(h);h[0]/=l,h[1]/=l;const c=this._crossProduct(h,this._sub(a,n));let u=this._dotProduct(h,this._sub(a,n));u<.05*l?u=.05*l:u>.95*l&&(u=.95*l);const d=[n[0]+h[0]*u,n[1]+h[1]*u];this._leftPerpendicular(h);let p=[];p.push([d[0]-h[0]*c,d[1]-h[1]*c]),p.push([d[0]+h[0]*c,d[1]+h[1]*c]),e.push(p);const m=[o[0]+h[0]*c,o[1]+h[1]*c];h=this._sub(o,m);const f=Math.cos(Math.PI/18);let _=Math.sin(Math.PI/18);c<0&&(_=-_),p=[n,o];for(let g=1;g<=9;g++)this._rotateDirect(h,f,_),p.push(this._add(m,h));e.push(p);break}case T.ClosedHalfCircle:{const o=this._cp2(s,2,0),a=this._mid(n,o),h=this._sub(o,a),l=Math.cos(Math.PI/18),c=Math.sin(Math.PI/18),u=[n,o];for(let d=1;d<=18;d++)this._rotateDirect(h,l,c),u.push(this._add(a,h));e.push(u);break}case T.TripleParallelExtended:{const o=this._cp2(s,0,-2),a=this._cp3(s,o,1,-2),h=this._mid(n,o),l=this._sub(a,o);this._normalize(l);const c=Math.abs(this._crossProduct(l,this._sub(h,o)))/2,u=this._dist(o,a),d=[o,n];d.push([n[0]+l[0]*u*.5,n[1]+l[1]*u*.5]),e.push(d);const p=[];p.push([h[0]-l[0]*c,h[1]-l[1]*c]),p.push([h[0]+l[0]*u*.375,h[1]+l[1]*u*.375]),nr(p[p.length-1],1),p.push([h[0]+l[0]*u*.75,h[1]+l[1]*u*.75]),e.push(p);const m=[o,a];e.push(m);break}case T.ParallelWithTicks:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(a,o);this._normalize(h);const l=this._crossProduct(h,this._sub(a,n));this._leftPerpendicular(h),this._addAngledTicks(e,n,o,a),this._addAngledTicks(e,this._mix(n,1,h,l),this._mix(o,1,h,l),this._mid(n,o));break}case T.Parallel:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,n);this._normalize(h);const l=this._leftPerp(h),c=this._crossProduct(h,this._sub(a,n));let u=[n,o];e.push(u),u=[],u.push([n[0]+l[0]*c,n[1]+l[1]*c]),u.push([o[0]+l[0]*c,o[1]+l[1]*c]),e.push(u);break}case T.PerpendicularToFirstSegment:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._mid(n,o),l=this._sub(o,n);this._normalize(l);const c=this._crossProduct(l,this._sub(a,n));this._leftPerpendicular(l);const u=[];u.push([h[0]-l[0]*c*.25,h[1]-l[1]*c*.25]),u.push([h[0]+l[0]*c*1.25,h[1]+l[1]*c*1.25]),e.push(u);break}case T.ParallelOffset:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,n);this._normalize(h);const l=this._crossProduct(h,this._sub(a,n));this._leftPerpendicular(h);const c=[];c.push([n[0]-h[0]*l,n[1]-h[1]*l]),c.push([o[0]-h[0]*l,o[1]-h[1]*l]),e.push(c);const u=[];u.push([n[0]+h[0]*l,n[1]+h[1]*l]),u.push([o[0]+h[0]*l,o[1]+h[1]*l]),e.push(u);break}case T.OffsetOpposite:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,n);this._normalize(h);const l=this._crossProduct(h,this._sub(a,n));this._leftPerpendicular(h);const c=[];c.push([n[0]-h[0]*l,n[1]-h[1]*l]),c.push([o[0]-h[0]*l,o[1]-h[1]*l]),e.push(c);break}case T.OffsetSame:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,n);this._normalize(h);const l=this._crossProduct(h,this._sub(a,n));this._leftPerpendicular(h);const c=[];c.push([n[0]+h[0]*l,n[1]+h[1]*l]),c.push([o[0]+h[0]*l,o[1]+h[1]*l]),e.push(c);break}case T.CircleWithArc:{let o=this._cp2(s,3,0);const a=this._cp3(s,o,.5,-1);let h,l;if(r>=4)h=s[3],l=this._crossProduct(this._sub(h,o),this._sub(a,o))>0;else{h=o,l=this._crossProduct(this._sub(h,n),this._sub(a,n))>0;const m=24*this._geomUnitsPerPoint,f=this._sub(h,n);this._normalize(f,m);const _=Math.sqrt(2)/2;this._rotateDirect(f,_,l?_:-_),o=this._add(n,f)}const c=this._sub(o,n),u=Math.cos(Math.PI/18),d=Math.sin(Math.PI/18),p=[o];for(let m=1;m<=36;m++)this._rotateDirect(c,u,d),p.push(this._add(n,c));this._add90DegArc(p,o,h,a,l),nr(p[p.length-8],1),e.push(p);break}case T.DoubleJog:{let o,a,h=this._cp2(s,-3,1);if(o=r>=3?s[2]:this._add(n,this._sub(n,h)),r>=4)a=s[3];else{const g=n;n=h,a=o;const y=this._dist(n,g),P=this._dist(a,g);let w=30*this._geomUnitsPerPoint;.5*y0?this._rotateDirect(f,m,-m):this._rotateDirect(f,m,m);let _=[];_.push(h),_.push(this._add(l,f)),_.push(this._sub(l,f)),_.push(n),e.push(_),f=this._sub(a,o),this._normalize(f,p),this._crossProduct(f,this._sub(n,o))<0?this._rotateDirect(f,m,m):this._rotateDirect(f,m,-m),_=[],_.push(o),_.push(this._add(c,f)),_.push(this._sub(c,f)),_.push(a),e.push(_);break}case T.PerpendicularOffset:{const o=this._cp2(s,-4,1),a=this._cp3(s,o,.882353,-1.94),h=this._sub(a,o);this._crossProduct(h,this._sub(n,o))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const l=[h[0]/8,h[1]/8],c=this._sub(this._mid(o,a),l);e.push([c,n]);break}case T.LineExcludingLastSegment:{const o=this._arrowPath(s),a=[];let h=o.length-2;for(;h--;)a.push(o[h]);e.push(a);break}case T.MultivertexArrow:{const o=this._arrowPath(s),a=[];this._addArrow(a,o,!1),e.push(a);break}case T.CrossedArrow:{const o=this._arrowPath(s),a=[];this._addArrow(a,o,!0),e.push(a);break}case T.ChevronArrow:{const[o,a]=this._arrowLastSeg(s),h=10*this._geomUnitsPerPoint,l=this._sub(n,o);this._normalize(l);const c=this._crossProduct(l,this._sub(a,o)),u=this._leftPerp(l),d=[a[0]-u[0]*c*2,a[1]-u[1]*c*2],p=[];p.push([a[0]+l[0]*h,a[1]+l[1]*h]),p.push(n),p.push([d[0]+l[0]*h,d[1]+l[1]*h]),e.push(p);break}case T.ChevronArrowOffset:{const[o,a]=this._arrowLastSeg(s),h=this._sub(n,o);this._normalize(h);const l=this._crossProduct(h,this._sub(a,o));this._leftPerpendicular(h);const c=[a[0]-h[0]*l,a[1]-h[1]*l],u=[];u.push([c[0]+h[0]*l*.5,c[1]+h[1]*l*.5]),u.push(this._mid(c,n)),u.push([c[0]-h[0]*l*.5,c[1]-h[1]*l*.5]),e.push(u);break}case T.PartialFirstSegment:{const[o,a]=this._arrowLastSeg(s),h=this._sub(n,o);this._normalize(h);const l=this._crossProduct(h,this._sub(a,o));this._leftPerpendicular(h);const c=[a[0]-h[0]*l,a[1]-h[1]*l];e.push([o,c]);break}case T.Arch:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,1),h=this._sub(n,o),l=this._mix(a,1,h,.55),c=this._mix(a,1,h,-.55),u=[n];this._addBezier2(u,n,l,a,4),this._addBezier2(u,a,c,o,4),e.push(u);break}case T.CurvedParallelTicks:{const o=this._cp2(s,-4,1),a=this._cp3(s,o,.882353,-1.94),h=this._sub(a,o);this._crossProduct(h,this._sub(n,o))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const l=[h[0]/8,h[1]/8],c=this._sub(this._mid(o,a),l),u=this._sub(this._mix(o,.75,a,.25),l),d=this._sub(this._mix(o,.25,a,.75),l),p=[o];this._addBezier2(p,o,u,c,3),this._addBezier2(p,c,d,a,3),e.push(p);for(let m=0;m<8;m++){const f=p[2*m+1],_=[this._clone(f)];_.push(this._add(f,[h[0]/4,h[1]/4])),e.push(_)}break}case T.Arc90Degrees:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,1),h=[o];this._add90DegArc(h,o,n,a),e.push(h);break}case T.FullGeometry:default:e.push(s)}}return e}},Do=class is{static local(){return is.instance===null&&(is.instance=new is),is.instance}execute(t,e,s,r,n){return new Wl(t,e,s)}};Do.instance=null;let Wl=class extends Ui{constructor(t,e,s){super(t,!0,!0),this._curveHelper=new Dt,this._beginCut=(e.beginCut!==void 0?e.beginCut:1)*s,this._endCut=(e.endCut!==void 0?e.endCut:1)*s,this._middleCut=(e.middleCut!==void 0?e.middleCut:0)*s,this._invert=e.invert!==void 0&&e.invert,this._beginCut<0&&(this._beginCut=0),this._endCut<0&&(this._endCut=0),this._middleCut<0&&(this._middleCut=0)}processPath(t){const{_beginCut:e,_endCut:s,_middleCut:r}=this,n=t.pathLength(),o=N.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._invert){if(e!==0||s!==0||r!==0)if(e+s+r>=n)for(o.startPath();t.nextPoint();)o.pushXY(t.x,t.y);else this._curveHelper.appendSubCurve(o,t,0,e),this._curveHelper.appendSubCurve(o,t,.5*(n-r),.5*(n+r)),this._curveHelper.appendSubCurve(o,t,n-s,s)}else if(e===0&&s===0&&r===0)for(o.startPath();t.nextPoint();)o.pushXY(t.x,t.y);else e+s+r0&&(n/=this._currentPosition.segmentLength),this._currentPosition.copyTo(e);e.abscissa+t*this._partLengthRatio>e.segmentLength+this._tolerance;){if(s){if(s.pathSize===0)if(n===0){const a=e.segment[0];s.pushXY(a[0],a[1])}else s.pushPoint(this.getSegCoord2D(e.segment,n));const o=e.segment[1];s.pushXY(o[0],o[1])}if(n=0,t-=(e.segmentLength-e.abscissa)/this._partLengthRatio,this._partSegCount)e.segment=this._nextSegment(),e.segmentLength=this.getSegLength(e.segment),e.abscissa=0,this._partSegCount--;else{if(!this._setPosAtNextPart())return r!==Ut.FAIL&&(e.segmentLength=this.getSegLength(e.segment),e.isPartEnd=!0,r===Ut.END?(e.abscissa=e.segmentLength,e.isPathEnd=!0):e.abscissa=e.segmentLength+t,!0);this._currentPosition.copyTo(e)}}if(e.abscissa+=t*this._partLengthRatio,s){s.pathSize===0&&(n===0?s.pushPoint(e.segment[0]):s.pushPoint(this.getSegCoord2D(e.segment,n)));const o=e.abscissa/e.segmentLength;o===1?s.pushPoint(e.segment[1]):s.pushPoint(this.getSegCoord2D(e.segment,o))}return this._partSegCount||Math.abs(e.abscissa-e.segmentLength)=this._pathCursor.pathSize&&(s=0),this._ctrlPtEnd=this._pathCursor.getControlPointAt(s),this._patternLength>0){const r=this._ctrlPtBegin?this._partCtrlPtGap:this._partExtPtGap,n=this._ctrlPtEnd?this._partCtrlPtGap:this._partExtPtGap;let o=Math.round((this._partLength-(r+n))/this._patternLength);o<=0&&(o=r+n>0?0:1),this._partLengthRatio=this._partLength/(r+n+o*this._patternLength),this._partLengthRatio<.01&&(this._partLengthRatio=1)}else this._partLengthRatio=1;return!0}_hasNextSegment(){return this._seg=e;)r-=e,e=this._pattern.nextValue(),o=!o;e-=r,o?(this._walker.nextPosition(e),e=this._pattern.nextValue()):this.isClosed&&(this._firstCurve=this._walker.nextCurve(e),e=this._pattern.nextValue(),this._walker.nextPosition(e),e=this._pattern.nextValue())}let s=this._walker.nextCurve(e);if(s)if(this._walker.isPathEnd()){if(this.iteratePath=!1,this._firstCurve){for(this._firstCurve.nextPath();this._firstCurve.nextPoint();)s.pushXY(this._firstCurve.x,this._firstCurve.y);this._firstCurve=null}}else e=this._pattern.nextValue(),!this._walker.nextPosition(e)||this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(s.pushCursor(this._firstCurve),this._firstCurve=null)):this.iteratePath=!0;else this.iteratePath=!1,s=this._firstCurve,this._firstCurve=null;return s==null||s.reset(),s}},Bo=class ns{static local(){return ns.instance===null&&(ns.instance=new ns),ns.instance}execute(t,e,s,r,n,o){return new Zl(t,e,s,r,n,o)}};Bo.instance=null;let Zl=class{constructor(t,e,s,r,n,o){switch(this._inputGeometries=t,this._tileKey=r,this._geometryEngine=n,this._maxInflateSize=o*s,this._width=(e.width!==void 0?e.width:2)*s,e.method){case Be.Mitered:case Be.Bevelled:case Be.Rounded:case Be.TrueBuffer:case Be.Square:}this._option=e.option}next(){let t;for(;t=this._inputGeometries.next();){if(t.geometryType==="esriGeometryEnvelope"&&this._width>0){const e=t.asJSON();return Math.min(e.xmax-e.xmin,e.ymax-e.ymin)-2*this._width<0?t:N.fromJSONCIM({paths:[[[e.xmin+this._width,e.ymin+this._width],[e.xmax-this._width,e.ymin+this._width],[e.xmax-this._width,e.ymax-this._width],[e.xmin+this._width,e.ymax-this._width],[e.xmin+this._width,e.ymin+this._width]],[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]})}if(t.geometryType==="esriGeometryPolygon"){if(this._width===0)return t.clone();const e=this._geometryEngine;if(e==null)return null;const s=this._tileKey?an(t,this._maxInflateSize):t.clone();if(!s)continue;const r=e.buffer(en.WebMercator,s.asJSON(),-this._width,1);if(r){for(const n of r.rings)if(n){s.startPath();for(const o of n.reverse())s.pushXY(o[0],s.yFactor*o[1])}}return s}}return null}},Vo=class os{static local(){return os.instance===null&&(os.instance=new os),os.instance}execute(t,e,s,r,n){return new jl(t,e,s)}};Vo.instance=null;let jl=class extends Ui{constructor(t,e,s){super(t,!1,!0),this._curveHelper=new Dt,this._length=(e.length!==void 0?e.length:20)*s,this._angle=e.angle!==void 0?e.angle:225,this._position=e.position!==void 0?e.position:50,this._length<0&&(this._length=-this._length),this._position<20&&(this._position=20),this._position>80&&(this._position=80),this._mirror=!1}processPath(t){const e=N.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._curveHelper.isEmpty(t))return null;t.seekInPath(0);const s=t.x,r=t.y;t.seekInPath(t.pathSize-1);const n=t.x,o=t.y,a=[n-s,o-r];this._curveHelper.normalize(a);const h=s+(n-s)*this._position/100,l=r+(o-r)*this._position/100,c=Math.cos((90-this._angle)/180*Math.PI);let u=Math.sin((90-this._angle)/180*Math.PI);this._mirror&&(u=-u),this._mirror=!this._mirror;const d=[h-this._length/2*c,l-this._length/2*u],p=[h+this._length/2*c,l+this._length/2*u];return e.pushPath([[s,r],d,p,[n,o]]),e}},Yo=class as{static local(){return as.instance===null&&(as.instance=new as),as.instance}execute(t,e,s,r,n){return new Kl(t,e,s)}};Yo.instance=null;let Kl=class{constructor(t,e,s){this._inputGeometries=t,this._offsetX=e.offsetX!==void 0?e.offsetX*s:0,this._offsetY=e.offsetY!==void 0?e.offsetY*s:0}next(){let t=this._inputGeometries.next();for(;t;){if(t.totalSize>0)return this._move(t.clone(),this._offsetX,this._offsetY);t=this._inputGeometries.next()}return null}_move(t,e,s){for(;t.nextPath();)for(;t.nextPoint();)t.x=t.x+e,t.y=t.y+s;return t.reset(),t}};const Jl=10;let Ho=class hs{static local(){return hs.instance===null&&(hs.instance=new hs),hs.instance}execute(t,e,s,r,n,o){return new Ql(t,e,s,r,n,o)}};Ho.instance=null;let Ql=class{constructor(t,e,s,r,n,o){this._inputGeometries=t,this._tileKey=r,this._geometryEngine=n,this._curveHelper=new Dt,this._offset=(e.offset??1)*s,this._method=e.method,this._maxInflateSize=Math.max(Math.abs(o*s),Jl),this._option=e.option,this._offsetFlattenError=Is*s}next(){let t;for(;t=this._inputGeometries.next();){if(this._offset===0)return t.clone();if(t.geometryType==="esriGeometryEnvelope"){if(this._method===oe.Rounded&&this._offset>0){const o=le(t),a=this._curveHelper.offset(o,-this._offset,this._method,4,this._offsetFlattenError);if(a){const h=N.createEmptyOptimizedCIM(t.geometryType);return h.pushPath(a),h}return null}const n=t.asJSON();if(mt(n)&&Math.min(n.xmax-n.xmin,n.ymax-n.ymin)+2*this._offset>0)return N.fromJSONCIM({xmin:n.xmin-this._offset,xmax:n.xmax+this._offset,ymin:n.ymin-this._offset,ymax:n.ymax+this._offset})}const e=this._geometryEngine;if(e==null)continue;const s=this._tileKey?an(t,this._maxInflateSize):t.clone();if(!s)continue;const r=e.offset(en.WebMercator,s.asJSON(),-this._offset,1,this._method,4,this._offsetFlattenError);return r?N.fromJSONCIM(r):null}return null}},Uo=class ls{static local(){return ls.instance===null&&(ls.instance=new ls),ls.instance}execute(t,e,s,r,n){return new tc(t,e,s)}};Uo.instance=null;let tc=class{constructor(t,e,s){this._inputGeometries=t,this._reverse=e.reverse===void 0||e.reverse}next(){let t=this._inputGeometries.next();for(;t;){if(!this._reverse)return t;if(t.geometryType==="esriGeometryPolyline")return ec(t.clone());t=this._inputGeometries.next()}return null}};function ec(i){for(;i.nextPath();)for(let t=0;t0){const e=Vi(t),s=(e[2]+e[0])/2,r=(e[3]+e[1])/2;return t.reset(),this._rotate(t.clone(),s,r)}t=this._inputGeometries.next()}return null}_rotate(t,e,s){const r=Math.cos(this._rotateAngle),n=Math.sin(this._rotateAngle);for(;t.nextPath();)for(;t.nextPoint();){const o=t.x-e,a=t.y-s;t.x=e+o*r-a*n,t.y=s+o*n+a*r}return t.reset(),t}},Wo=class us{static local(){return us.instance===null&&(us.instance=new us),us.instance}execute(t,e,s,r,n){return new ic(t,e,s)}};Wo.instance=null;let ic=class{constructor(t,e,s){this._inputGeometries=t,this._xFactor=e.XScaleFactor!==void 0?e.XScaleFactor:1.15,this._yFactor=e.YScaleFactor!==void 0?e.YScaleFactor:1.15}next(){const t=this._inputGeometries.next();if(t){if(this._xFactor===1&&this._yFactor===1||t.geometryType==="esriGeometryPoint")return t;if(t.totalSize>0){const e=Vi(t),s=(e[2]+e[0])/2,r=(e[3]+e[1])/2;return t.reset(),this._scaleCursor(t.clone(),s,r)}}return null}_scaleCursor(t,e,s){for(;t.nextPath();)for(;t.nextPoint();)t.x=e+(t.x-e)*this._xFactor,t.y=s+(t.y-s)*this._yFactor;return t.reset(),t}},qo=class ps{static local(){return ps.instance===null&&(ps.instance=new ps),ps.instance}execute(t,e,s,r,n){return new rc(t,e,s)}};qo.instance=null;let rc=class{constructor(t,e,s){this._inputGeometries=t,this._height=(e.amplitude!==void 0?e.amplitude:2)*s,this._period=(e.period!==void 0?e.period:3)*s,this._style=e.waveform,this._height<=0&&(this._height=Math.abs(this._height)),this._period<=0&&(this._period=Math.abs(this._period)),this._pattern=new Xi,this._pattern.addValue(this._period),this._pattern.addValue(this._period),this._walker=new Wi,this._walker.updateTolerance(s)}next(){let t=this._inputGeometries.next();for(;t;){if(this._height===0||this._period===0)return t;const e=this._processGeom(t);if(e)return e;t=this._inputGeometries.next()}return null}_processGeom(t){const e=N.createEmptyOptimizedCIM(t.geometryType);for(;t.nextPath();){e.startPath();const s=t.pathLength();if(this._walker.init(t,this._pattern))switch(this._style){case Ds.Sinus:default:this._constructCurve(e,s,!1);break;case Ds.Square:this._constructSquare(e,s);break;case Ds.Triangle:this._constructTriangle(e,s);break;case Ds.Random:this._constructCurve(e,s,!0)}else for(;t.nextPoint();)e.pushXY(t.x,t.y)}return e}_constructCurve(t,e,s){let r=Math.round(e/this._period);r===0&&(r=1);const n=r*16+1,o=e/r,a=this._period/16,h=1/n,l=2*Math.PI*e/o,c=2*Math.PI*Math.random(),u=2*Math.PI*Math.random(),d=2*Math.PI*Math.random(),p=.75-Math.random()/2,m=.75-Math.random()/2,f=new zt;this._walker.curPointAndAngle(f),t.pushPoint(f.pt);let _=0;for(;;){if(!this._walker.nextPointAndAngle(a,f)){t.pushPoint(this._walker.getPathEnd());break}{const g=_;let y;if(_+=h,s){const P=this._height/2*(1+.3*Math.sin(p*l*g+c));y=P*Math.sin(l*g+u),y+=P*Math.sin(m*l*g+d),y/=2}else y=.5*this._height*Math.sin(.5*l*g);t.pushXY(f.pt[0]-y*f.sa,f.pt[1]+y*f.ca)}}}_constructSquare(t,e){Math.round(e/this._period);let s=!0;for(;;){let r=!1;if(this._walker.curPositionIsValid()){const n=new zt;this._walker.curPointAndAngle(n);const o=new zt;if(this._walker.nextPointAndAngle(this._period,o)){const a=new zt;this._walker.nextPointAndAngle(this._period,a)&&(s?(t.pushPoint(n.pt),s=!1):t.pushPoint(n.pt),t.pushXY(n.pt[0]-this._height/2*n.sa,n.pt[1]+this._height/2*n.ca),t.pushXY(o.pt[0]-this._height/2*o.sa,o.pt[1]+this._height/2*o.ca),t.pushXY(o.pt[0]+this._height/2*o.sa,o.pt[1]-this._height/2*o.ca),t.pushXY(a.pt[0]+this._height/2*a.sa,a.pt[1]-this._height/2*a.ca),r=!0)}}if(!r){t.pushPoint(this._walker.getPathEnd());break}}}_constructTriangle(t,e){Math.round(e/this._period);let s=!0;for(;;){let r=!1;if(this._walker.curPositionIsValid()){const n=new zt;this._walker.curPointAndAngle(n);const o=new zt;if(this._walker.nextPointAndAngle(this._period/2,o)){const a=new zt;this._walker.nextPointAndAngle(this._period,a)&&(this._walker.nextPosition(this._period/2)&&(s?(t.pushPoint(n.pt),s=!1):t.pushPoint(n.pt),t.pushXY(o.pt[0]-this._height/2*o.sa,o.pt[1]+this._height/2*o.ca),t.pushXY(a.pt[0]+this._height/2*a.sa,a.pt[1]-this._height/2*a.ca)),r=!0)}}if(!r){t.pushPoint(this._walker.getPathEnd());break}}}},Zo=class ds{static local(){return ds.instance===null&&(ds.instance=new ds),ds.instance}execute(t,e,s,r,n){return new nc(t,e,s)}};Zo.instance=null;let nc=class extends Ns{constructor(t,e,s){super(t),this._geometryWalker=new Wi,this._geometryWalker.updateTolerance(s),this._angleToLine=e.angleToLine??!0,this._offset=(e.offset?e.offset:0)*s,this._originalEndings=e.endings,this._offsetAtEnd=(e.customEndingOffset?e.customEndingOffset:0)*s,this._position=-(e.offsetAlongLine?e.offsetAlongLine:0)*s,this._pattern=new Xi,this._pattern.init(e.placementTemplate,!1),this._pattern.scale(s),this._endings=this._originalEndings}processPath(t){if(this._pattern.isEmpty())return null;let e;if(this.iteratePath)e=this._pattern.nextValue();else{this._originalEndings===Ct.WithFullGap&&this.isClosed?this._endings=Ct.WithMarkers:this._endings=this._originalEndings,this._pattern.extPtGap=0;let r,n=!0;switch(this._endings){case Ct.NoConstraint:r=-this._position,r=this._adjustPosition(r),n=!1;break;case Ct.WithHalfGap:default:r=-this._pattern.lastValue()/2;break;case Ct.WithFullGap:r=-this._pattern.lastValue(),this._pattern.extPtGap=this._pattern.lastValue();break;case Ct.WithMarkers:r=0;break;case Ct.Custom:r=-this._position,r=this._adjustPosition(r),this._pattern.extPtGap=.5*this._offsetAtEnd}if(!this._geometryWalker.init(t,this._pattern,n))return null;this._pattern.reset();let o=0;for(;r>o;)r-=o,o=this._pattern.nextValue();o-=r,e=o,this.iteratePath=!0}const s=new zt;return this._geometryWalker.nextPointAndAngle(e,s)?this._endings===Ct.WithFullGap&&this._geometryWalker.isPathEnd()?(this.iteratePath=!1,null):this._endings===Ct.WithMarkers&&this._geometryWalker.isPathEnd()&&(this.iteratePath=!1,this.isClosed)?null:(this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca),this._angleToLine&&this.internalPlacement.setRotateCS(s.ca,s.sa),this.internalPlacement):(this.iteratePath=!1,null)}_adjustPosition(t){let e=t/this._pattern.length();return e-=Math.floor(e),e*this._pattern.length()}},jo=class fs{static local(){return fs.instance===null&&(fs.instance=new fs),fs.instance}execute(t,e,s,r,n){return new oc(t,e,s)}};jo.instance=null;let oc=class extends Ns{constructor(t,e,s){super(t,!1,!0),this._curveHelper=new Dt,this._angleToLine=e.angleToLine===void 0||e.angleToLine,this._offset=e.offset!==void 0?e.offset*s:0,this._type=e.extremityPlacement,this._position=e.offsetAlongLine!==void 0?e.offsetAlongLine*s:0,this._beginProcessed=!1}processPath(t){let e;switch(this._type){case Xt.Both:default:this._beginProcessed?(e=this._atExtremities(t,this._position,!1),this._beginProcessed=!1,this.iteratePath=!1):(e=this._atExtremities(t,this._position,!0),this._beginProcessed=!0,this.iteratePath=!0);break;case Xt.JustBegin:e=this._atExtremities(t,this._position,!0);break;case Xt.JustEnd:e=this._atExtremities(t,this._position,!1);case Xt.None:}return e}_atExtremities(t,e,s){if(s||t.seekPathEnd(),s?t.nextPoint():t.prevPoint()){let r=0,[n,o]=[0,0],[a,h]=[t.x,t.y];for(;s?t.nextPoint():t.prevPoint();){n=a,o=h,a=t.x,h=t.y;const l=this._curveHelper.getLength(n,o,a,h);if(r+l>e){const c=(e-r)/l,[u,d]=this._curveHelper.getAngleCS(n,o,a,h,c),p=this._curveHelper.getCoord2D(n,o,a,h,c);return this.internalPlacement.setTranslate(p[0]-this._offset*d,p[1]+this._offset*u),this._angleToLine&&this.internalPlacement.setRotateCS(-u,-d),this.internalPlacement}r+=l}}return null}},Ko=class ms{static local(){return ms.instance===null&&(ms.instance=new ms),ms.instance}execute(t,e,s,r,n){return new ac(t,e,s)}};Ko.instance=null;let ac=class extends Ns{constructor(t,e,s){super(t),this._walker=new Wi,this._walker.updateTolerance(s),this._angleToLine=e.angleToLine===void 0||e.angleToLine,this._offset=e.offset!==void 0?e.offset*s:0,this._beginGap=e.beginPosition!==void 0?e.beginPosition*s:0,this._endGap=e.endPosition!==void 0?e.endPosition*s:0,this._flipFirst=e.flipFirst===void 0||e.flipFirst,this._pattern=new Xi,this._pattern.init(e.positionArray,!1,!1),this._subPathLen=0,this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0}processPath(t){if(this._pattern.isEmpty())return null;let e;if(this.iteratePath){const a=this._pattern.nextValue()*this._subPathLen,h=this._beginGap+a;e=h-this._prevPos,this._prevPos=h}else{if(this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0,this._subPathLen=t.pathLength()-this._beginGap-this._endGap,this._subPathLen<0)return this.iteratePath=!1,null;if(!this._walker.init(t,this._pattern,!1))return null;this._pattern.reset();const a=this._pattern.nextValue()*this._subPathLen,h=this._beginGap+a;e=h-this._prevPos,this._prevPos=h,this.iteratePath=!0}const s=new zt;if(!this._walker.nextPointAndAngle(e,s,Ut.END))return this.iteratePath=!1,null;this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca);const r=this._isFirst&&this._flipFirst;let n,o;return this._angleToLine?(n=s.ca,o=s.sa):(n=1,o=0),r&&(n=-n,o=-o),this.internalPlacement.setRotateCS(n,o),this._isFirst=!1,this._posCount--,this._posCount===0&&(this.iteratePath=!1),this.internalPlacement}};const Vt=512,hc=10,yt=24,Li=1e-6;let Jo=class _s{static local(){return _s.instance===null&&(_s.instance=new _s),_s.instance}execute(t,e,s,r,n){return new lc(t,e,s,r,n)}};Jo.instance=null;let lc=class te{constructor(t,e,s,r,n){if(this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,this._currentX=0,this._currentY=0,this._accelerationMap=null,this._testInsidePolygon=!1,this._verticalSubdivision=!0,this._stepX=Math.abs(e.stepX??16)*s,this._stepY=Math.abs(e.stepY??16)*s,this._stepX=Math.round(128*this._stepX)/128,this._stepY=Math.round(128*this._stepY)/128,this._stepX!==0&&this._stepY!==0){if(this._gridType=e.gridType??tr.Fixed,this._gridType===tr.Random){const o=e.seed??13,a=1;this._randomLCG=new go(o*a),this._randomness=(e.randomness??100)/100,this._gridAngle=0,this._shiftOddRows=!1,this._cosAngle=1,this._sinAngle=0,this._offsetX=0,this._offsetY=0,this._buildRandomValues()}else{if(this._randomness=0,this._gridAngle=e.gridAngle??0,this._shiftOddRows=e.shiftOddRows??!1,this._offsetX=(e.offsetX??0)*s,this._offsetY=(e.offsetY??0)*s,this._cosAngle=Math.cos(this._gridAngle/180*Math.PI),this._sinAngle=-Math.sin(this._gridAngle/180*Math.PI),this._stepX)if(this._offsetX<0)for(;this._offsetX<-.5*this._stepX;)this._offsetX+=this._stepX;else for(;this._offsetX>=.5*this._stepX;)this._offsetX-=this._stepX;if(this._stepY)if(this._offsetY<0)for(;this._offsetY<-.5*this._stepY;)this._offsetY+=this._stepY;else for(;this._offsetY>=.5*this._stepY;)this._offsetY-=this._stepY}if(this._graphicOriginX=0,this._graphicOriginY=0,r!=null){const[o,a,h,l]=r.split("/"),c=parseFloat(o),u=parseFloat(a),d=parseFloat(h),p=parseFloat(l);this._graphicOriginX=-(p*2**c+d)*Vt,this._graphicOriginY=u*Vt,this._testInsidePolygon=!0}this._internalPlacement=new Ae,this._calculateMinMax(t),this._geometryCursor=t}}next(){return this._geometryCursor?this._nextInside():null}_buildRandomValues(){if(!te._randValues){te._randValues=[];for(let t=0;t=y,this._polygonMin=this._verticalSubdivision?d:m,this._testInsidePolygon){let P=0-this._graphicOriginX-this._offsetX-this._stepX,w=Vt-this._graphicOriginX-this._offsetX+this._stepX,M=-Vt-this._graphicOriginY-this._offsetY-this._stepY,k=0-this._graphicOriginY-this._offsetY+this._stepY;if(_){const F=[[P,M],[P,k],[w,M],[w,k]];P=M=Number.MAX_VALUE,w=k=-Number.MAX_VALUE;for(const z of F){const A=this._cosAngle*z[0]-this._sinAngle*z[1],R=this._sinAngle*z[0]+this._cosAngle*z[1];P=Math.min(P,A),w=Math.max(w,A),M=Math.min(M,R),k=Math.max(k,R)}}h=h!==Number.MAX_VALUE?Math.max(h,P):P,l=l!==Number.MAX_VALUE?Math.max(l,M):M,c=c!==-Number.MAX_VALUE?Math.min(c,w):w,u=u!==-Number.MAX_VALUE?Math.min(u,k):k}this._xMin=Math.round(h/this._stepX),this._xMax=Math.round(c/this._stepX),this._yMin=Math.round(l/this._stepY),this._yMax=Math.round(u/this._stepY),this._currentX=this._xMax+1,this._currentY=this._yMin-1,this._buildAccelerationMap(t,m,f,d,p)}_buildAccelerationMap(t,e,s,r,n){t.reset();const o=new Map,a=this._verticalSubdivision,h=a?n-r:s-e;let l=Math.ceil(h/hc);if(l<=1)return;const c=Math.floor(h/l);let u,d,p,m,f,_,g,y,P,w,M;for(l++,this._delta=c,a?(P=-Vt-2*this._stepY,w=2*this._stepY,M=r):(P=-2*this._stepX,w=Vt+2*this._stepX,M=e);t.nextPath();)if(!(t.pathSize<2)&&t.nextPoint())for(u=t.x,d=t.y;t.nextPoint();u=p,d=m){if(p=t.x,m=t.y,a){if(d===m||dw&&m>w)continue;f=Math.min(d,m),_=Math.max(d,m)}else{if(u===p||uw&&p>w)continue;f=Math.min(u,p),_=Math.max(u,p)}for(;f<_;)g=Math.floor((f-M)/c),Yn(g,u,d,p,m,o),f+=c;y=Math.floor((_-M)/c),y>g&&Yn(y,u,d,p,m,o)}this._accelerationMap=o}_nextInside(){for(;;){if(this._currentX>this._xMax){if(this._currentY++,this._currentY>this._yMax)return null;this._currentX=this._xMin,this._shiftOddRows&&this._currentY%2&&this._currentX--}let t=this._currentX*this._stepX+this._offsetX;this._shiftOddRows&&this._currentY%2&&(t+=.5*this._stepX);const e=this._currentY*this._stepY+this._offsetY;let s,r;if(this._currentX++,this._gridType===tr.Random){const n=(this._currentX%yt+yt)%yt,o=(this._currentY%yt+yt)%yt;s=this._graphicOriginX+t+this._stepX*this._randomness*(.5-te._randValues[o*yt+n])*2/3,r=this._graphicOriginY+e+this._stepY*this._randomness*(.5-te._randValues[o*yt+n+1])*2/3}else s=this._graphicOriginX+this._cosAngle*t+this._sinAngle*e,r=this._graphicOriginY-this._sinAngle*t+this._cosAngle*e;if(!this._testInsidePolygon||this._isInsidePolygon(s,r,this._geometryCursor))return this._internalPlacement.setTranslate(s,r),this._internalPlacement}}_isInsidePolygon(t,e,s){if(this._accelerationMap==null)return cc(t,e,s);t+=Li,e+=Li;const r=this._verticalSubdivision,n=r?e:t,o=Math.floor((n-this._polygonMin)/this._delta),a=this._accelerationMap.get(o);if(!a)return!1;let h,l,c,u=0;for(const d of a){if(h=d[0],l=d[1],r){if(h[1]>e==l[1]>e)continue;c=(l[0]-h[0])*(e-h[1])-(l[1]-h[1])*(t-h[0])}else{if(h[0]>t==l[0]>t)continue;c=(l[1]-h[1])*(t-h[0])-(l[0]-h[0])*(e-h[1])}c>0?u++:u--}return u!==0}};function cc(i,t,e){let s,r,n,o,a=0;for(i+=Li,t+=Li,e.reset();e.nextPath();)if(e.nextPoint())for(s=e.x,r=e.y;e.nextPoint();s=n,r=o)n=e.x,o=e.y,r>t!=o>t&&((n-s)*(t-r)-(o-r)*(i-s)>0?a++:a--);return a!==0}function Yn(i,t,e,s,r,n){let o=n.get(i);o||(o=[],n.set(i,o)),o.push([[t,e],[s,r]])}const uc=.001;let Qo=class gs{static local(){return gs.instance===null&&(gs.instance=new gs),gs.instance}execute(t,e,s,r,n){return new pc(t,e,s)}};Qo.instance=null;let pc=class extends Ns{constructor(t,e,s){super(t),this._curveHelper=new Dt,this._angleToLine=e.angleToLine===void 0||e.angleToLine,this._offset=e.offset!==void 0?e.offset*s:0,this._relativeTo=e.relativeTo,this._position=e.startPointOffset!==void 0?e.startPointOffset*s:0,this._epsilon=uc*s}processPath(t){const e=this._position;if(this._relativeTo===Ve.SegmentMidpoint){if(this.iteratePath||(this.iteratePath=!0),t.nextPoint()){let[r,n]=[t.x,t.y],[o,a]=[0,0];for(;t.nextPoint();){o=t.x,a=t.y;const h=this._curveHelper.getLength(r,n,o,a);if(hr){const d=(r-o)/u,[p,m]=this._curveHelper.getAngleCS(a,h,l,c,d),f=this._curveHelper.getCoord2D(a,h,l,c,d),_=n?-this._offset:this._offset;return this.internalPlacement.setTranslate(f[0]-_*m,f[1]+_*p),this._angleToLine&&(n?this.internalPlacement.setRotateCS(-p,-m):this.internalPlacement.setRotateCS(p,m)),this.internalPlacement}a=l,h=c,o+=u}}return null}};const dc=1e-15;let ta=class ys{static local(){return ys.instance===null&&(ys.instance=new ys),ys.instance}execute(t,e,s,r,n){return new fc(t,e,s)}};ta.instance=null;let fc=class extends Ns{constructor(t,e,s){super(t),this._curveHelper=new Dt,this._angleToLine=e.angleToLine===void 0||e.angleToLine,this._offset=e.offset!==void 0?e.offset*s:0,this._endPoints=e.placeOnEndPoints===void 0||e.placeOnEndPoints,this._controlPoints=e.placeOnControlPoints===void 0||e.placeOnControlPoints,this._regularVertices=e.placeOnRegularVertices===void 0||e.placeOnRegularVertices,this._tags=[],this._tagIterator=0}processPath(t){if(this.iteratePath||(this._preparePath(t),this.iteratePath=!0),this._tagIterator>=this._tags.length)return this._tags.length=0,this._tagIterator=0,this.iteratePath=!1,null;const e=this._tags[this._tagIterator];this._angleToLine&&this.internalPlacement.setRotate(e[2]);let s=e[0],r=e[1];if(this._offset!==0){const n=Math.cos(e[2]),o=Math.sin(e[2]);s-=this._offset*o,r+=this._offset*n}return this.internalPlacement.setTranslate(s,r),this._tagIterator++,this.internalPlacement}_preparePath(t){this._tags.length=0,this._tagIterator=0,t.seekPathStart();const e=t.isClosed();let s=0,r=!1,n=0,o=0;if(t.seekPathStart(),t.nextPoint()){let a=t.x,h=t.y,l=t.getControlPoint(),c=!0,u=t.nextPoint();for(;u;){const d=t.x,p=t.y,m=t.getControlPoint();(this._angleToLine||this._offset!==0)&&(n=this._curveHelper.getAngle(a,h,d,p,0)),c?(c=!1,e?(s=n,r=l):(this._endPoints||this._controlPoints&&l)&&this._tags.push([a,h,n])):l?this._controlPoints&&this._tags.push([a,h,js(o,n)]):this._regularVertices&&this._tags.push([a,h,js(o,n)]),(this._angleToLine||this._offset!==0)&&(o=this._curveHelper.getAngle(a,h,d,p,1)),u=t.nextPoint(),u||(e?m||r?this._controlPoints&&this._tags.push([d,p,js(o,s)]):this._regularVertices&&this._tags.push([d,p,js(o,s)]):(this._endPoints||this._controlPoints&&m)&&this._tags.push([d,p,o])),a=d,h=p,l=m}}this._tagIterator=0}};function js(i,t){const e=Math.PI;for(;Math.abs(t-i)>e+2*dc;)t-i>e?t-=2*e:t+=2*e;return(i+t)/2}const mc=100*222045e-21;function _c(i){if(i.totalSize===0)return null;const t=Vi(i);if(!t)return null;const e=4*(Math.abs(t[0])+Math.abs(t[2])+Math.abs(t[1])+Math.abs(t[3])+1)*mc;let s=0,r=0;i.reset();for(let A=0;i.nextPath();A++){const R=i.getCurrentRingArea();R>r&&(r=R,s=A)}if(i.seekPath(s),i.pathSize===0)return null;i.seekPathStart();const n=fh(i);if(Math.abs(r)<=2*e*e)return[(n[0]+n[2])/2,(n[1]+n[3])/2];i.seekPathStart();const o=mh(i,ze());if(o===null)return null;if(i.totalPoints<4)return o;const a=[[NaN,NaN],[NaN,NaN],[NaN,NaN],[NaN,NaN]],h=[NaN,NaN,NaN,NaN],l=[NaN,NaN,NaN,NaN];let c=!1,u=Ye(o,i,!0);u.distance===0&&(c=!0,a[0][0]=o[0],a[0][1]=o[1],u=Ye(o,i,!1)),h[0]=u.distance,l[0]=0;const d=[NaN,NaN];let p=!1,m=.25,f=-1,_=NaN;do if(_=NaN,a[1]=ar(i,hr(n[0],n[2],m),e,t),isNaN(a[1][0])||isNaN(a[1][1])||(u=Ye(a[1],i,!1),_=u.distance),!isNaN(_)&&_>e&&pi(a[1],i))p=!0,h[1]=_,l[1]=ee(a[1],o);else if(!isNaN(_)&&_>f&&(f=_,d[0]=a[1][0],d[1]=a[1][1]),m-=.01,m<.1){if(!(f>=0))break;p=!0,h[1]=f,a[1][0]=d[0],a[1][1]=d[1],l[1]=ee(a[1],o)}while(!p);p=!1,m=.5,f=-1;let g=.01,y=1;do if(_=NaN,a[2]=ar(i,hr(n[0],n[2],m),e,t),isNaN(a[2][0])||isNaN(a[2][1])||(u=Ye(a[2],i,!1),_=u.distance),!isNaN(_)&&_>e&&pi(a[2],i))p=!0,h[2]=_,l[2]=ee(a[2],o);else if(!isNaN(_)&&_>f)f=_,d[0]=a[2][0],d[1]=a[2][1];else if(_>f&&(f=_,d[0]=a[2][0],d[1]=a[2][1]),m=.5+g*y,g+=.01,y*=-1,m<.3||m>.7){if(!(f>=0))break;p=!0,h[2]=f,a[2][0]=d[0],a[2][1]=d[1],l[2]=ee(a[2],o)}while(!p);p=!1,m=.75,f=-1;do if(_=NaN,a[3]=ar(i,hr(n[0],n[2],m),e,t),isNaN(a[3][0])||isNaN(a[3][1])||(u=Ye(a[3],i,!1),_=u.distance),!isNaN(_)&&_>e&&pi(a[3],i))p=!0,h[3]=_,l[3]=ee(a[3],o);else if(_>f&&(f=_,d[0]=a[3][0],d[1]=a[3][1]),m+=.01,m>.9){if(!(f>=0))break;p=!0,h[3]=f,a[3][0]=d[0],a[3][1]=d[1],l[3]=ee(a[3],o)}while(!p);const P=[0,1,2,3],w=c?0:1;let M;for(let A=w;A<4;A++)for(let R=w;R<3;R++){const Gt=l[R],Bt=l[R+1];xc(Gt,Bt)>0&&(M=P[R],P[R]=P[R+1],P[R+1]=M,l[R]=Bt,l[R+1]=Gt)}let k=w,F=0,z=0;for(let A=w;A<4;A++){switch(A){case 0:z=2*h[P[A]];break;case 1:z=1.66666666*h[P[A]];break;case 2:z=1.33333333*h[P[A]];break;case 3:z=h[P[A]]}z>F&&(F=z,k=P[A])}return a[k]}function pi(i,t){let e,s,r,n,o=0;for(t.reset();t.nextPath()&&t.nextPoint();)for(e=t.x,s=t.y;t.nextPoint();e=r,s=n)r=t.x,n=t.y,s>i[1]!=n>i[1]&&((r-e)*(i[1]-s)-(n-s)*(i[0]-e)>0?o++:o--);return o!==0}function Ye(i,t,e){if(e&&pi(i,t))return{coord:i,distance:0};let s=1/0,r=0,n=0,o=[0,0],a=[0,0];const h=[0,0];for(t.reset();t.nextPath()&&t.nextPoint();)if(!(t.pathSize<2))for(o[0]=t.x,o[1]=t.y;t.nextPoint();o=a){a=[t.x,t.y],_h(h,i,o,a);const l=ee(i,h);lo?fu)s&Hn?(s&Ks?(t[1]+=u*(n-t[0])/c,t[0]=n):(t[1]+=u*(a-t[0])/c,t[0]=a),s=xt(t,i)):r&Hn?(r&Ks?(e[1]+=u*(n-e[0])/c,e[0]=n):(e[1]+=u*(a-e[0])/c,e[0]=a),r=xt(e,i)):s?(s&Js?(t[0]+=c*(o-t[1])/u,t[1]=o):(t[0]+=c*(h-t[1])/u,t[1]=h),s=xt(t,i)):(r&Js?(e[0]+=c*(o-e[1])/u,e[1]=o):(e[0]+=c*(h-e[1])/u,e[1]=h),r=xt(e,i));else if(s&Un?(s&Js?(t[0]+=c*(o-t[1])/u,t[1]=o):(t[0]+=c*(h-t[1])/u,t[1]=h),s=xt(t,i)):r&Un?(r&Js?(e[0]+=c*(o-e[1])/u,e[1]=o):(e[0]+=c*(h-e[1])/u,e[1]=h),r=xt(e,i)):s?(s&Ks?(t[1]+=u*(n-t[0])/c,t[0]=n):(t[1]+=u*(a-t[0])/c,t[0]=a),s=xt(t,i)):(r&Ks?(e[1]+=u*(n-e[0])/c,e[0]=n):(e[1]+=u*(a-e[0])/c,e[0]=a),r=xt(e,i)),s&r)return 0}while(s|r);return l}function xt(i,t){return(i[0]t[2]?1:0)<<1|(i[1]t[3]?1:0)<<3}function hr(i,t,e){return i+(t-i)*e}function ee(i,t){return(i[0]-t[0])*(i[0]-t[0])+(i[1]-t[1])*(i[1]-t[1])}function xc(i,t){if(it)return 1;if(i===t)return 0;const e=isNaN(i),s=isNaN(t);return es?1:0}let ea=class xs{static local(){return xs.instance===null&&(xs.instance=new xs),xs.instance}execute(t,e,s,r,n){return new bc(t,e,s)}};ea.instance=null;let bc=class{constructor(t,e,s){this._geometryCursor=t,this._offsetX=e.offsetX!==void 0?e.offsetX*s:0,this._offsetY=e.offsetY!==void 0?e.offsetY*s:0,this._method=e.method!==void 0?e.method:Gs.OnPolygon,this._internalPlacement=new Ae}next(){const t=this._geometryCursor;return this._geometryCursor=null,t?this._polygonCenter(t):null}_polygonCenter(t){let e=!1;switch(this._method){case Gs.CenterOfMass:{const s=yh(t);s&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),e=!0)}break;case Gs.BoundingBoxCenter:{const s=Vi(t);s&&(this._internalPlacement.setTranslate((s[2]+s[0])/2+this._offsetX,(s[3]+s[1])/2+this._offsetY),e=!0)}break;case Gs.OnPolygon:default:{const s=_c(t);s!==null&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),e=!0)}}return e?this._internalPlacement:null}};function vr(i){if(!i)return null;switch(i.type){case"CIMGeometricEffectAddControlPoints":return Ao.local();case"CIMGeometricEffectArrow":return Fo.local();case"CIMGeometricEffectBuffer":return Ro.local();case"CIMGeometricEffectControlMeasureLine":return Oo.local();case"CIMGeometricEffectCut":return Do.local();case"CIMGeometricEffectDashes":return Go.local();case"CIMGeometricEffectDonut":return Bo.local();case"CIMGeometricEffectJog":return Vo.local();case"CIMGeometricEffectMove":return Yo.local();case"CIMGeometricEffectOffset":return Ho.local();case"CIMGeometricEffectReverse":return Uo.local();case"CIMGeometricEffectRotate":return Xo.local();case"CIMGeometricEffectScale":return Wo.local();case"CIMGeometricEffectWave":return qo.local()}return null}function sa(i){if(!i)return null;switch(i.type){case"CIMMarkerPlacementAlongLineSameSize":return Zo.local();case"CIMMarkerPlacementAtExtremities":return jo.local();case"CIMMarkerPlacementAtRatioPositions":return Ko.local();case"CIMMarkerPlacementInsidePolygon":return Jo.local();case"CIMMarkerPlacementOnLine":return Qo.local();case"CIMMarkerPlacementOnVertices":return ta.local();case"CIMMarkerPlacementPolygonCenter":return ea.local()}return null}const lr=new Zh;function Pc(i){if(i==null)return["",!1];if(!lr.hasBidiChar(i))return[i,!1];let t;return t=lr.checkContextual(i)==="rtl"?"IDNNN":"ICNNN",[lr.bidiTransform(i,t,"VLYSN"),!0]}const ia="arial-unicode-ms",Xn="woff2",Wn=new Map,wc=new Set;let Sc=class{constructor(t,e){this.fontFace=t,this.promise=e}};async function mf(i){const t=Mc(i),e=Wn.get(t);if(e)return e.promise;const s=new FontFace(i.family,`url('${xh.fontsUrl}/woff2/${t}.${Xn}') format('${Xn}')`,{style:i.style,weight:i.weight}),r=document.fonts;if(r.has(s)&&s.status==="loading")return s.loaded;const n=s.load().then(()=>(r.add(s),s));return Wn.set(t,new Sc(s,n)),wc.add(s),n}function vc(i){if(!i)return ia;const t=i.toLowerCase().split(" ").join("-");switch(t){case"serif":return"noto-serif";case"sans-serif":return"arial-unicode-ms";case"monospace":return"ubuntu-mono";case"fantasy":return"cabin-sketch";case"cursive":return"redressed";default:return t}}function Mc(i){const t=Cc(i)+$c(i);return vc(i.family)+(t.length>0?t:"-regular")}function Cc(i){if(!i.weight)return"";switch(i.weight.toLowerCase()){case"bold":case"bolder":return"-bold"}return""}function $c(i){if(!i.style)return"";switch(i.style.toLowerCase()){case"italic":case"oblique":return"-italic"}return""}let kc=class{applyColorSubstituition(t,e){if(!e)return t;this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas"));const{width:s,height:r}=t,n=this._rasterizationCanvas,o=n.getContext("2d",{willReadFrequently:!0});t!==n&&(n.width=s,n.height=r,o.drawImage(t,0,0,s,r));const a=o.getImageData(0,0,s,r).data;if(e){for(const l of e)if(l&&l.oldColor&&l.oldColor.length===4&&l.newColor&&l.newColor.length===4){const[c,u,d,p]=l.oldColor,[m,f,_,g]=l.newColor;if(c===m&&u===f&&d===_&&p===g)continue;for(let y=0;y0;let P=this._lineThroughWidthOffset,w=0;if(a){r.save();const gt=e.backgroundColor??[0,0,0,0],dt=((Gt=e.borderLine)==null?void 0:Gt.color)??[0,0,0,0],dh=2*I(((Bt=e.borderLine)==null?void 0:Bt.size)??0);r.fillStyle=ur(gt),r.strokeStyle=ur(dt),r.lineWidth=dh,r.fillRect(0,0,s.width,s.height),r.strokeRect(0,0,s.width,s.height),r.restore()}y&&this._renderHalo(r,_,g,P,w,e),w+=g,P+=_;for(const gt of this._textLines)y?(r.globalCompositeOperation="destination-out",r.fillStyle="rgb(0, 0, 0)",r.fillText(gt,P,w),r.globalCompositeOperation="source-over",r.fillStyle=this._fillStyle,r.fillText(gt,P,w)):(r.fillStyle=this._fillStyle,r.fillText(gt,P,w)),n&&n!=="none"&&this._renderDecoration(r,P,w,n,o),w+=p;r.restore();const M=this._renderedWidth+2*this._lineThroughWidthOffset,k=this._renderedHeight,F=r.getImageData(0,0,M,k),z=new Uint8Array(F.data);if(e.premultiplyColors){let gt;for(let dt=0;dt600)&&(s+=.3*t.measureText("w").width),s+=2*I(this._parameters.halo.size),Math.round(s)}_computeLineHeight(){let t=1.275*this._parameters.size;const e=this._parameters.font.decoration;return e&&e==="underline"&&(t*=1.3),Math.round(t+2*I(this._parameters.halo.size))}_renderDecoration(t,e,s,r,n,o){const a=.9*this._lineHeight,h=n==="bold"?.06:n==="bolder"?.09:.04;switch(t.textAlign){case"center":e-=this._renderedWidth/2;break;case"right":e-=this._renderedWidth}const l=t.textBaseline;if(r==="underline")switch(l){case"top":s+=a;break;case"middle":s+=a/2}else if(r==="line-through")switch(l){case"top":s+=a/1.5;break;case"middle":s+=a/3}const c=o?1.5*o:Math.ceil(a*h);t.save(),t.beginPath(),t.strokeStyle=t.fillStyle,t.lineWidth=c,t.moveTo(e-this._lineThroughWidthOffset,s),t.lineTo(e+this._renderedWidth+2*this._lineThroughWidthOffset,s),t.stroke(),t.restore()}};function zc(i,t){return i==="center"?.5*t:i==="right"?t:0}const Lc=()=>me.getLogger("esri.views.2d.engine.webgl.alignmentUtils");var St,lt;function oa(i){if(!i)return St.Center;switch(i){case"Left":case"left":return St.Left;case"Right":case"right":return St.Right;case"Justify":return Lc().warnOnce("Horizontal alignment 'justify' is not implemented. Falling back to 'center'."),St.Center;case"Center":case"center":return St.Center}}function aa(i){if(!i)return lt.Center;switch(i){case"Top":case"top":return lt.Top;case"Center":case"middle":return lt.Center;case"Baseline":case"baseline":return lt.Baseline;case"Bottom":case"bottom":return lt.Bottom}}function yf(i){switch(i){case"above-left":case"esriServerPointLabelPlacementAboveLeft":return["right","bottom"];case"above-center":case"above-along":case"esriServerPointLabelPlacementAboveCenter":case"esriServerLinePlacementAboveAlong":return["center","bottom"];case"above-right":case"esriServerPointLabelPlacementAboveRight":return["left","bottom"];case"center-left":case"esriServerPointLabelPlacementCenterLeft":return["right","middle"];case"center-center":case"center-along":case"esriServerPointLabelPlacementCenterCenter":case"esriServerLinePlacementCenterAlong":case"always-horizontal":case"esriServerPolygonPlacementAlwaysHorizontal":return["center","middle"];case"center-right":case"esriServerPointLabelPlacementCenterRight":return["left","middle"];case"below-left":case"esriServerPointLabelPlacementBelowLeft":return["right","top"];case"below-center":case"below-along":case"esriServerPointLabelPlacementBelowCenter":case"esriServerLinePlacementBelowAlong":return["center","top"];case"below-right":case"esriServerPointLabelPlacementBelowRight":return["left","top"];default:return console.debug(`Found invalid placement type ${i}`),["center","middle"]}}function Ec(i){switch(i){case St.Right:case"right":return-1;case St.Center:case"center":return 0;case St.Left:case"left":return 1;default:return console.debug(`Found invalid horizontal alignment ${i}`),0}}function Nc(i){switch(i){case lt.Top:case"top":return 1;case lt.Center:case"middle":return 0;case lt.Bottom:case lt.Baseline:case"baseline":case"bottom":return-1;default:return console.debug(`Found invalid vertical alignment ${i}`),0}}(function(i){i[i.Left=-1]="Left",i[i.Center=0]="Center",i[i.Right=1]="Right"})(St||(St={})),function(i){i[i.Top=1]="Top",i[i.Center=0]="Center",i[i.Bottom=-1]="Bottom",i[i.Baseline=2]="Baseline"}(lt||(lt={}));const hn=22,ha=4,Ac=hn+ha,Fc=hn-6,qn=3,Rc=Math.PI/180,Yt=8,Oc=1.5;let la=class{constructor(t,e,s,r){this._rotationT=ce(),this._xBounds=0,this._yBounds=0,this.minZoom=0,this.maxZoom=255,this._bounds=null;const n=s.rect,o=new Float32Array(8);t*=r,e*=r;const a=s.code?n.width*r:s.metrics.width,h=s.code?n.height*r:s.metrics.height;this.width=a,this.height=h,o[0]=t,o[1]=e,o[2]=t+a,o[3]=e,o[4]=t,o[5]=e+h,o[6]=t+a,o[7]=e+h,this._data=o,this._setTextureCoords(n),this._scale=r,this._mosaic=s,this.x=t,this.y=e,this.maxOffset=Math.max(t+a,e+h)}get mosaic(){return this._mosaic}set angle(t){this._angle=t,Yi(this._rotationT,-t),this._setOffsets()}get angle(){return this._angle}get xTopLeft(){return this._data[0]}get yTopLeft(){return this._data[1]}get xBottomRight(){return this._data[6]}get yBottomRight(){return this._data[7]}get texcoords(){return this._texcoords}get textureBinding(){return this._mosaic.textureBinding}get offsets(){return this._offsets||this._setOffsets(),this._offsets}get char(){return String.fromCharCode(this._mosaic.code)}get code(){return this._mosaic.code}get bounds(){if(!this._bounds){const{height:t,width:e}=this._mosaic.metrics,s=e*this._scale,r=Math.abs(t)*this._scale,n=new Float32Array(8);n[0]=this.x,n[1]=this.y,n[2]=this.x+s,n[3]=this.y,n[4]=this.x,n[5]=this.y+r,n[6]=this.x+s,n[7]=this.y+r;const o=mr(ce(),this._rotationT,this._transform);Ph(n,n,o);let a=1/0,h=1/0,l=0,c=0;for(let f=0;f<4;f++){const _=n[2*f],g=n[2*f+1];a=Math.min(a,_),h=Math.min(h,g),l=Math.max(l,_),c=Math.max(c,g)}const u=l-a,d=c-h,p=a+u/2,m=h+d/2;this._bounds=new Ce(p,m,u,d)}return this._bounds}setTransform(t){this._transform=t,this._offsets=null}_setOffsets(){this._offsets||(this._offsets={topLeft:[0,0],topRight:[0,0],bottomLeft:[0,0],bottomRight:[0,0]});const t=mr(ce(),this._rotationT,this._transform);this._offsets.topLeft[0]=this._data[0],this._offsets.topLeft[1]=this._data[1],this._offsets.topRight[0]=this._data[2],this._offsets.topRight[1]=this._data[3],this._offsets.bottomLeft[0]=this._data[4],this._offsets.bottomLeft[1]=this._data[5],this._offsets.bottomRight[0]=this._data[6],this._offsets.bottomRight[1]=this._data[7],vt(this._offsets.topLeft,this._offsets.topLeft,t),vt(this._offsets.topRight,this._offsets.topRight,t),vt(this._offsets.bottomLeft,this._offsets.bottomLeft,t),vt(this._offsets.bottomRight,this._offsets.bottomRight,t)}_setTextureCoords({x:t,y:e,width:s,height:r}){this._texcoords={topLeft:[t,e],topRight:[t+s,e],bottomLeft:[t,e+r],bottomRight:[t+s,e+r]}}};const Dc=(i,t)=>({code:0,page:0,sdf:!0,rect:new ll(0,0,11,8),textureBinding:t,metrics:{advance:0,height:4,width:i,left:0,top:0}});function He(i,t){return i.forEach(e=>vt(e,e,t)),{topLeft:i[0],topRight:i[1],bottomLeft:i[2],bottomRight:i[3]}}let Gc=class{constructor(t,e,s){this._rotation=0,this._decorate(t,e,s),this.glyphs=t,this.bounds=this._createBounds(t),this.isMultiline=e.length>1,this._hasRotation=s.angle!==0,this._transform=this._createGlyphTransform(this.bounds,s),this._borderLineSizePx=s.borderLineSizePx,(s.borderLineSizePx||s.hasBackground)&&([this.bounds,this.textBox]=this.shapeBackground(this._transform));for(const r of t)r.setTransform(this._transform)}setRotation(t){if(t===0&&this._rotation===0)return;this._rotation=t;const e=this._transform,s=Yi(ce(),t);mr(e,s,e);for(const r of this.glyphs)r.setTransform(this._transform)}_decorate(t,e,s){if(!s.decoration||s.decoration==="none"||!t.length)return;const r=s.scale,n=s.decoration==="underline"?Ac:Fc,o=t[0].textureBinding;for(const a of e){const h=a.startX*r,l=a.startY*r,c=(a.width+a.glyphWidthEnd)*r;t.push(new la(h,l+n*r,Dc(c,o),1))}}shapeBackground(t){const e=this._borderLineSizePx||0,s=(Oc+e)/2,r=this._borderLineSizePx?s:0,{xmin:n,ymin:o,xmax:a,ymax:h,x:l,y:c,width:u,height:d}=this.bounds,p=[n-Yt,o-Yt],m=[a+Yt,o-Yt],f=[n-Yt,h+Yt],_=[a+Yt,h+Yt],g=He([[p[0]-s,p[1]-s],[m[0]+s,m[1]-s],[p[0]+r,p[1]+r],[m[0]-r,m[1]+r]],t),y=He([[f[0]+r,f[1]-r],[_[0]-r,_[1]-r],[f[0]-s,f[1]+s],[_[0]+s,_[1]+s]],t),P=He([[p[0]-s,p[1]-s],[p[0]+r,p[1]+r],[f[0]-s,f[1]+s],[f[0]+r,f[1]-r]],t),w=He([[m[0]-r,m[1]+r],[m[0]+s,m[1]-s],[_[0]-r,_[1]-r],[_[0]+s,_[1]+s]],t),M={main:He([p,m,f,_],t),top:g,bot:y,left:P,right:w};return[new Ce(l,c,u+2*s,d+2*s),M]}get boundsT(){const t=this.bounds,e=Bs(En(),t.x,t.y);if(vt(e,e,this._transform),this._hasRotation){const s=Math.max(t.width,t.height);return new Ce(e[0],e[1],s,s)}return new Ce(e[0],e[1],t.width,t.height)}_createBounds(t){let e=1/0,s=1/0,r=0,n=0;for(const h of t)e=Math.min(e,h.xTopLeft),s=Math.min(s,h.yTopLeft),r=Math.max(r,h.xBottomRight),n=Math.max(n,h.yBottomRight);const o=r-e,a=n-s;return new Ce(e+o/2,s+a/2,o,a)}_createGlyphTransform(t,e){const s=Rc*e.angle,r=ce(),n=En();return ui(r,r,Bs(n,e.xOffset,-e.yOffset)),e.useCIMAngleBehavior?_r(r,r,s):(ui(r,r,Bs(n,t.x,t.y)),_r(r,r,s),ui(r,r,Bs(n,-t.x,-t.y))),r}},Qs=class{constructor(t,e,s,r,n,o){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(e,s)),this.end=Math.max(0,Math.max(e,s)),this.endi===10,Zn=i=>i===32;function Bc(i,t,e){const s=new Array,r=1/e.scale,n=e.maxLineWidth*r,o=t?i.length-1:0,a=t?-1:i.length,h=t?-1:1;let l=o,c=0,u=0,d=l,p=d,m=0,f=1/0,_=0;for(;l!==a;){const{code:y,metrics:P}=i[l],w=Math.abs(P.top);if(Mr(y)||Zn(y)||(f=Math.min(f,w),_=Math.max(_,w+P.height)),Mr(y))l!==o&&(s.push(new Qs(i,d,l-h,c,f,_)),f=1/0,_=0),c=0,d=l+h,p=l+h,u=0;else if(Zn(y))p=l+h,u=0,m=P.advance,c+=P.advance;else if(c>n){if(p!==d){const M=p-2*h;c-=m,s.push(new Qs(i,d,M,c-u,f,_)),f=1/0,_=0,d=p,c=u}else s.push(new Qs(i,d,l-h,c,f,_)),f=1/0,_=0,d=l,p=l,c=0;c+=P.advance,u+=P.advance}else c+=P.advance,u+=P.advance;l+=h}const g=new Qs(i,d,l-h,c,f,_);return g.start>=0&&g.endme.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");let se=class Pt{constructor(t){this._t=t}static createIdentity(){return new Pt([1,0,0,0,1,0])}clone(){const t=this._t;return new Pt(t.slice())}transform(t){const e=this._t;return[e[0]*t[0]+e[1]*t[1]+e[2],e[3]*t[0]+e[4]*t[1]+e[5]]}static createScale(t,e){return new Pt([t,0,0,0,e,0])}scale(t,e){const s=this._t;return s[0]*=t,s[1]*=t,s[2]*=t,s[3]*=e,s[4]*=e,s[5]*=e,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(t,e){return new Pt([0,0,t,0,0,e])}translate(t,e){const s=this._t;return s[2]+=t,s[5]+=e,this}static createRotate(t){const e=Math.cos(t),s=Math.sin(t);return new Pt([e,-s,0,s,e,0])}rotate(t){return Pt.multiply(this,Pt.createRotate(t),this)}angle(){const t=this._t[0],e=this._t[3],s=Math.sqrt(t*t+e*e);return[t/s,e/s]}static multiply(t,e,s){const r=t._t,n=e._t,o=r[0]*n[0]+r[3]*n[1],a=r[1]*n[0]+r[4]*n[1],h=r[2]*n[0]+r[5]*n[1]+n[2],l=r[0]*n[3]+r[3]*n[4],c=r[1]*n[3]+r[4]*n[4],u=r[2]*n[3]+r[5]*n[4]+n[5],d=s._t;return d[0]=o,d[1]=a,d[2]=h,d[3]=l,d[4]=c,d[5]=u,s}invert(){const t=this._t;let e=t[0]*t[4]-t[1]*t[3];if(e===0)return new Pt([0,0,0,0,0,0]);e=1/e;const s=(t[1]*t[5]-t[2]*t[4])*e,r=(t[2]*t[3]-t[0]*t[5])*e,n=t[4]*e,o=-t[1]*e,a=-t[3]*e,h=t[0]*e;return new Pt([n,o,s,a,h,r])}},cn=class{constructor(t,e){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new Sh(Ae,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(e||se.createIdentity()),this._sizeTransfos.push(e?e.scaleRatio():1)}setTransform(t,e){this._transfos=[t||se.createIdentity()],this._sizeTransfos=[e||(t?t.scaleRatio():1)]}setGeomUnitsPerPoint(t){this._geomUnitsPerPoint=t}transformPt(t){return this._transfos[this._transfos.length-1].transform(t)}transformSize(t){return t*this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformPt(t){return this._transfos[this._transfos.length-1].invert().transform(t)}reverseTransformSize(t){return t/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(t){return t/this._transfos[this._transfos.length-1].scaleRatio()}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}prevGeomUnitsPerPoint(){return this._transfos.length>2?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,e){const s=e?t.scaleRatio():1;se.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*s)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,e,s){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,e);break;case"CIMTextSymbol":this.drawTextSymbol(t,e,s)}}drawMultiLayerSymbol(t,e){if(!t||!e)return;const s=t.symbolLayers;if(!s)return;const r=t.effects;if(r&&r.length>0){const n=this.executeEffects(r,e);if(n){let o=n.next();for(;o;)this.drawSymbolLayers(s,o.asJSON()),o=n.next()}}else this.drawSymbolLayers(s,e)}executeEffects(t,e){const s=this._resourceManager.geometryEngine;let r=new Sr(N.fromJSONCIM(e));for(const n of t){const o=vr(n);o&&(r=o.execute(r,n,this.geomUnitsPerPoint(),null,s))}return r}drawSymbolLayers(t,e){let s=t.length;for(;s--;){const r=t[s];if(!r||r.enable===!1)continue;const n=r.effects;if(n&&n.length>0){const o=this.executeEffects(n,e);if(o){let a=null;for(;(a=o.next())&&(this.drawSymbolLayer(r,a.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(r,e);if(this._earlyReturn)return}}drawSymbolLayer(t,e){switch(t.type){case"CIMSolidFill":this.drawSolidFill(e,t.color);break;case"CIMHatchFill":this.drawHatchFill(e,t);break;case"CIMPictureFill":this.drawPictureFill(e,t);break;case"CIMGradientFill":this.drawGradientFill(e,t);break;case"CIMSolidStroke":this.drawSolidStroke(e,t.color,t.width,t.capStyle,t.joinStyle,t.miterLimit);break;case"CIMPictureStroke":this.drawPictureStroke(e,t);break;case"CIMGradientStroke":this.drawGradientStroke(e,t);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(t,e)}}drawHatchFill(t,e){const s=this._buildHatchPolyline(e,t,this.geomUnitsPerPoint());s&&(this.pushClipPath(t),this.drawMultiLayerSymbol(e.lineSymbol,s),this.popClipPath())}drawPictureFill(t,e){}drawGradientFill(t,e){}drawPictureStroke(t,e){}drawGradientStroke(t,e){}drawMarkerLayer(t,e){const s=t.markerPlacement;if(s){const r=sa(s);if(r){const n=s.type==="CIMMarkerPlacementInsidePolygon"||s.type==="CIMMarkerPlacementPolygonCenter"&&s.clipAtBoundary;n&&this.pushClipPath(e);const o=r.execute(N.fromJSONCIM(e),s,this.geomUnitsPerPoint(),null,this._resourceManager.geometryEngine);if(o){let a=null;for(;(a=o.next())&&(this.drawMarker(t,a),!this._earlyReturn););}n&&this.popClipPath()}}else{const r=this._placementPool.acquire();if(fr(e))r.tx=e.x,r.ty=e.y,this.drawMarker(t,r);else if(ht(e)){const n=vh(e);n&&([r.tx,r.ty]=n,this.drawMarker(t,r))}else for(const n of e.points)if(r.tx=n[0],r.ty=n[1],this.drawMarker(t,r),this._earlyReturn)break;this._placementPool.release(r)}}drawMarker(t,e){switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(t,e);break;case"CIMVectorMarker":this.drawVectorMarker(t,e)}}drawPictureMarker(t,e){if(!t)return;const s=this._resourceManager.getResource(t.url),r=$(t.size,Rt.CIMPictureMarker.size);if(s==null||r<=0)return;const n=s.width,o=s.height;if(!n||!o)return;const a=n/o,h=$(t.scaleX,1),l=se.createIdentity(),c=t.anchorPoint;if(c){let _=c.x,g=c.y;t.anchorPointUnits!=="Absolute"&&(_*=r*a*h,g*=r),l.translate(-_,-g)}let u=$(t.rotation);t.rotateClockwise&&(u=-u),this._mapRotation&&(u+=this._mapRotation),u&&l.rotate(u*Jt);let d=$(t.offsetX),p=$(t.offsetY);if(d||p){if(this._mapRotation){const _=Jt*this._mapRotation,g=Math.cos(_),y=Math.sin(_),P=d*y+p*g;d=d*g-p*y,p=P}l.translate(d,p)}const m=this.geomUnitsPerPoint();m!==1&&l.scale(m,m);const f=e.getAngle();f&&l.rotate(f),l.translate(e.tx,e.ty),this.push(l,!1),this.drawImage(t,r),this.pop()}drawVectorMarker(t,e){if(!t)return;const s=t.markerGraphics;if(!s)return;const r=$(t.size,Rt.CIMVectorMarker.size),n=t.frame,o=n?n.ymax-n.ymin:0,a=r&&o?r/o:1,h=se.createIdentity();n&&h.translate(.5*-(n.xmax+n.xmin),.5*-(n.ymax+n.ymin));const l=t.anchorPoint;if(l){let f=l.x,_=l.y;t.anchorPointUnits!=="Absolute"?n&&(f*=n.xmax-n.xmin,_*=n.ymax-n.ymin):(f/=a,_/=a),h.translate(-f,-_)}a!==1&&h.scale(a,a);let c=$(t.rotation);t.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&h.rotate(c*Jt);let u=$(t.offsetX),d=$(t.offsetY);if(u||d){if(this._mapRotation){const f=Jt*this._mapRotation,_=Math.cos(f),g=Math.sin(f),y=u*g+d*_;u=u*_-d*g,d=y}h.translate(u,d)}const p=this.geomUnitsPerPoint();p!==1&&h.scale(p,p);const m=e.getAngle();m&&h.rotate(m),h.translate(e.tx,e.ty),this.push(h,t.scaleSymbolsProportionally);for(const f of s){f!=null&&f.symbol&&f.geometry||Yc().error("Invalid marker graphic",f);let _=f.textString;if(typeof _=="number"&&(_=_.toString()),this.drawSymbol(f.symbol,f.geometry,_),this._earlyReturn)break}this.pop()}drawTextSymbol(t,e,s){if(!t||!fr(e)||$(t.height,Rt.CIMTextSymbol.height)<=0)return;const r=se.createIdentity();let n=$(t.angle);n=-n,n&&r.rotate(n*Jt);const o=$(t.offsetX),a=$(t.offsetY);(o||a)&&r.translate(o,a);const h=this.geomUnitsPerPoint();h!==1&&r.scale(h,h),r.translate(e.x,e.y),this.push(r,!1),this.drawText(t,s),this.pop()}_buildHatchPolyline(t,e,s){let r=$(t.separation,Rt.CIMHatchFill.separation)*s,n=$(t.rotation);if(r===0)return null;r<0&&(r=-r);let o=0;const a=.5*r;for(;o>a;)o-=r;for(;o<-a;)o+=r;const h=ze();yo(h,e),h[0]-=a,h[1]-=a,h[2]+=a,h[3]+=a;const l=[[h[0],h[1]],[h[0],h[3]],[h[2],h[3]],[h[2],h[1]]];for(;n>180;)n-=180;for(;n<0;)n+=180;const c=Math.cos(n*Jt),u=Math.sin(n*Jt),d=-r*u,p=r*c;let m,f,_,g;o=$(t.offsetX)*s*u-$(t.offsetY)*s*c,m=_=Number.MAX_VALUE,f=g=-Number.MAX_VALUE;for(const z of l){const A=z[0],R=z[1],Gt=c*A+u*R,Bt=-u*A+c*R;m=Math.min(m,Gt),_=Math.min(_,Bt),f=Math.max(f,Gt),g=Math.max(g,Bt)}_=Math.floor(_/r)*r;let y=c*m-u*_-d*o/r,P=u*m+c*_-p*o/r,w=c*f-u*_-d*o/r,M=u*f+c*_-p*o/r;const k=1+Math.round((g-_)/r),F=[];for(let z=0;z0))if(ht(t))this._processPath(t.rings,0);else if(wt(t))this._processPath(t.paths,0);else if(mt(t)){const e=ne(t);e&&this._processPath(e.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(t,e,s){if(!t||this._clipCount>0||s==null||s<=0)return;const r=Math.max(.5*this.transformSize($(s,Rt.CIMSolidStroke.width)),.5*ca);if(ht(t))this._processPath(t.rings,r);else if(wt(t))this._processPath(t.paths,r);else if(mt(t)){const n=ne(t);n&&this._processPath(n.rings,r)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(t,e){ht(e)&&t.markerPlacement&&(t.markerPlacement.type==="CIMMarkerPlacementInsidePolygon"||t.markerPlacement.type==="CIMMarkerPlacementPolygonCenter"&&t.markerPlacement.clipAtBoundary)?this._processPath(e.rings,0):super.drawMarkerLayer(t,e)}drawHatchFill(t,e){this.drawSolidFill(t)}drawPictureFill(t,e){this.drawSolidFill(t)}drawGradientFill(t,e){this.drawSolidFill(t)}drawPictureStroke(t,e){this.drawSolidStroke(t,null,e.width)}drawGradientStroke(t,e){this.drawSolidStroke(t,null,e.width)}pushClipPath(t){this.drawSolidFill(t),this._clipCount++}popClipPath(){this._clipCount--}drawImage(t,e){const{url:s}=t,r=$(t.scaleX,1);let n=r*e,o=e;const a=this._resourceManager.getResource(s);if(a!=null){const h=a.height/a.width;n=r*(e?h>1?e:e/h:a.width),o=e?h>1?e*h:e:a.height}this._merge(this.transformPt([-n/2,-o/2]),0),this._merge(this.transformPt([-n/2,o/2]),0),this._merge(this.transformPt([n/2,-o/2]),0),this._merge(this.transformPt([n/2,o/2]),0)}drawText(t,e){if(!e||e.length===0)return;this._textRasterizer||(this._textRasterizer=new na);const s=pa(t);let[r,n]=this._textRasterizer.computeTextSize(e,s);r=de(r),n=de(n);let o=0;switch(t.horizontalAlignment){case"Left":o=r/2;break;case"Right":o=-r/2}let a=0;switch(t.verticalAlignment){case"Bottom":a=n/2;break;case"Top":a=-n/2;break;case"Baseline":a=n/6}this._merge(this.transformPt([-r/2+o,-n/2+a]),0),this._merge(this.transformPt([-r/2+o,n/2+a]),0),this._merge(this.transformPt([r/2+o,-n/2+a]),0),this._merge(this.transformPt([r/2+o,n/2+a]),0)}_processPath(t,e){if(t)for(const s of t){const r=s?s.length:0;if(r>1){this._merge(this.transformPt(s[0]),e);for(let n=1;nthis._xmax&&(this._xmax=t[0]+e),t[1]-ethis._ymax&&(this._ymax=t[1]+e)}},vf=class extends cn{constructor(){super(...arguments),this._searchPoint=[0,0],this._searchDistPoint=0,this._textInfo=null}hitTest(t,e,s,r,n,o){var l;const a=o*I(1);this.setTransform(),this.setGeomUnitsPerPoint(a),this._searchPoint=[(t[0]+t[2])/2,(t[1]+t[3])/2],this._searchDistPoint=(t[2]-t[0])/2/a,this._textInfo=r;const h=e&&(e.type==="CIMPointSymbol"&&e.angleAlignment!=="Map"||e.type==="CIMTextSymbol");if(this._mapRotation=h?n:0,!ue("esri-mobile")){const c=de(ue("hittest-2d-small-symbol-tolerance")*window.devicePixelRatio),u=de(ue("hittest-2d-small-symbol-tolerance-threshold"));!(((e==null?void 0:e.type)==="CIMLineSymbol"||(e==null?void 0:e.type)==="CIMPolygonSymbol")&&((l=e.symbolLayers)!=null&&l.some(Qh)))&&(e==null?void 0:e.type)!=="CIMMeshSymbol"&&(tl(e)??0)f.xTopLeft&&d-f.yBottomRight&&p<-f.yTopLeft){this._earlyReturn=!0;break}}_hitTestFill(t){let e=null;if(mt(t)){const r=t;e=[[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]]]}else if(ht(t))e=t.rings;else{if(!wt(t))return;e=t.paths}const s=this.reverseTransformPt(this._searchPoint);if(this._pointInPolygon(s,e)&&(this._earlyReturn=!0),!this._earlyReturn){const r=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint();this._nearLine(s,e,r)&&(this._earlyReturn=!0)}}_hitTestStroke(t,e){let s=null;if(mt(t)){const a=t;s=[[[a.xmin,a.ymin],[a.xmin,a.ymax],[a.xmax,a.ymax],[a.xmax,a.ymin],[a.xmin,a.ymin]]]}else if(ht(t))s=t.rings;else{if(!wt(t))return;s=t.paths}const r=this.reverseTransformPt(this._searchPoint),n=$(e,Rt.CIMSolidStroke.width)*this.geomUnitsPerPoint(),o=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint();this._nearLine(r,s,n/2+o)&&(this._earlyReturn=!0)}_pointInPolygon(t,e){let s=0;for(const r of e){const n=r.length;for(let o=1;ot[1]!=h[1]>t[1]&&((h[0]-a[0])*(t[1]-a[1])-(h[1]-a[1])*(t[0]-a[0])>0?s++:s--)}}return s!==0}_nearLine(t,e,s){for(const r of e){const n=r.length;for(let o=1;o-s&&u1){let o=this.transformPt(r[0]);s.moveTo(o[0],o[1]);for(let a=1;ai?{spatialReference:i.spatialReference,rings:[[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]}:null,ua=(i,t,e)=>{switch(i){case"ExtraLeading":return 1+t/e;case"Multiple":return t;case"Exact":return t/e}};function pa(i,t=1){var g;const e=bo(i),s=Po(i.fontStyleName),r=i.fontFamilyName??ia,{weight:n,style:o}=s,a=t*(i.height||5),h=el(i.horizontalAlignment),l=sl(i.verticalAlignment),c=rr(i),u=rr(i.haloSymbol),d=u!=null?t*(i.haloSize??0):0,p=((g=i.callout)==null?void 0:g.type)==="CIMBackgroundCallout"?i.callout.backgroundSymbol:null,m=rr(p),f=il(p),_=rl(p);return{color:c,size:a,horizontalAlignment:h,verticalAlignment:l,font:{family:r,style:nl(o),weight:ol(n),decoration:e},halo:{size:d||0,color:u,style:o},backgroundColor:m,borderLine:f!=null&&_!=null?{size:f,color:_}:null,pixelRatio:1,premultiplyColors:!0}}const Wc=1e-4;function qc(i){let t,e,s,r,n,o=i[0],a=1;for(;ame.getLogger("esri.symbols.cim.CIMSymbolHelper");function $f(i){let t;switch(i.type){case"cim":return i.data;case"web-style":return i;case"simple-marker":{const e=be.fromSimpleMarker(i);if(!e)throw new Error("InternalError: Cannot convert symbol to CIM");t=e;break}case"picture-marker":t=be.fromPictureMarker(i);break;case"simple-line":t=be.fromSimpleLineSymbol(i);break;case"simple-fill":t=be.fromSimpleFillSymbol(i);break;case"picture-fill":t=be.fromPictureFillSymbol(i);break;case"text":t=be.fromTextSymbol(i)}return{type:"CIMSymbolReference",symbol:t}}function di(i,t,e){switch(t.type){case"CIMSymbolReference":return di(i,t.symbol,e);case"CIMPointSymbol":e==null&&(e={x:0,y:0}),i.drawSymbol(t,e);break;case"CIMLineSymbol":e==null&&(e={paths:[[[0,0],[10,0]]]}),i.drawSymbol(t,e);break;case"CIMPolygonSymbol":e==null&&(e={rings:[[[0,0],[0,10],[10,10],[10,0],[0,0]]]}),i.drawSymbol(t,e);break;case"CIMTextSymbol":{const s={x:0,y:0};i.drawSymbol(t,s);break}case"CIMVectorMarker":{const s=new Ae;i.drawMarker(t,s);break}}return i.envelope()}function jc(i){if(!i)return 0;switch(i.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAtExtremities":case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementAtRatioPositions":case"CIMMarkerPlacementOnLine":case"CIMMarkerPlacementOnVertices":return Math.abs(i.offset);default:return 0}}function Kc(i){if(!i)return 0;switch(i.type){case"CIMGeometricEffectArrow":return Math.abs(.5*i.width);case"CIMGeometricEffectBuffer":return Math.abs(i.size);case"CIMGeometricEffectExtension":case"CIMGeometricEffectRadial":return Math.abs(i.length);case"CIMGeometricEffectJog":return Math.abs(.5*i.length);case"CIMGeometricEffectMove":return Math.max(Math.abs($(i.offsetX)),Math.abs($(i.offsetY)));case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":return Math.abs(i.offset);case"CIMGeometricEffectRegularPolygon":return Math.abs(i.radius);case"CIMGeometricEffectRotate":case"CIMGeometricEffectScale":default:return 0;case"CIMGeometricEffectTaperedPolygon":return .5*Math.max(Math.abs(i.fromWidth),Math.abs(i.toWidth));case"CIMGeometricEffectWave":return Math.abs(i.amplitude);case"CIMGeometricEffectDonut":return Math.abs(i.width)}}function Ni(i){if(!i)return 0;let t=0;for(const e of i)t+=Kc(e);return t}let kf=class{static getSymbolInflateSize(t,e,s,r,n){return t||(t=[0,0,0,0]),e?this._getInflateSize(t,e,s,r,n):t}static safeSize(t){const e=Math.max(Math.abs(t[0]),Math.abs(t[2])),s=Math.max(Math.abs(t[1]),Math.abs(t[3]));return Math.sqrt(e*e+s*s)}static _vectorMarkerBounds(t,e,s,r){let n=!0;const o=ze();if(e!=null&&e.markerGraphics)for(const a of e.markerGraphics){const h=[0,0,0,0];a.geometry&&(yo(o,a.geometry),h[0]=0,h[1]=0,h[2]=0,h[3]=0,this.getSymbolInflateSize(h,a.symbol,s,0,r),o[0]+=h[0],o[1]+=h[1],o[2]+=h[2],o[3]+=h[3],n?(t[0]=o[0],t[1]=o[1],t[2]=o[2],t[3]=o[3],n=!1):(t[0]=Math.min(t[0],o[0]),t[1]=Math.min(t[1],o[1]),t[2]=Math.max(t[2],o[2]),t[3]=Math.max(t[3],o[3])))}return t}static _getInflateSize(t,e,s,r,n){if(iu(e)){const o=this._getLayersInflateSize(t,e.symbolLayers,s,r,n),a=Ni(e.effects);return a>0&&(o[0]-=a,o[1]-=a,o[2]+=a,o[3]+=a),o}return this._getTextInflatedSize(t,e,n)}static _getLayersInflateSize(t,e,s,r,n){let o=!0;if(!e)return t;for(const a of e){if(!a)continue;let h=[0,0,0,0];switch(a.type){case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const c=a;let u=c.width;u!=null&&(c.capStyle===tt.Square||c.joinStyle===ct.Miter?u/=1.4142135623730951:u/=2,h[0]=-u,h[1]=-u,h[2]=u,h[3]=u);break}case"CIMCharacterMarker":case"CIMVectorMarker":case"CIMPictureMarker":{const c=a;if(a.type==="CIMVectorMarker"){const f=a;if(h=this._vectorMarkerBounds(h,f,s,n),f.frame){const _=(f.frame.xmin+f.frame.xmax)/2,g=(f.frame.ymin+f.frame.ymax)/2;if(h[0]-=_,h[1]-=g,h[2]-=_,h[3]-=g,f.size!=null){const y=f.size/(f.frame.ymax-f.frame.ymin);h[0]*=y,h[1]*=y,h[2]*=y,h[3]*=y}}}else if(a.type==="CIMPictureMarker"){const f=a,_=s.getResource(f.url);let g=1;if(_!=null&&_.height&&(g=_.width/_.height),c.size!=null){const y=c.size/2,P=c.size*g*f.scaleX/2;h=[-P,-y,P,y]}}else if(c.size!=null){const f=c.size/2;h=[-f,-f,f,f]}if(c.anchorPoint){let f,_;c.anchorPointUnits==="Absolute"?(f=c.anchorPoint.x,_=c.anchorPoint.y):(f=c.anchorPoint.x*(h[2]-h[0]),_=c.anchorPoint.y*(h[3]-h[1])),h[0]-=f,h[1]-=_,h[2]-=f,h[3]-=_}let u=$(c.rotation);if(c.rotateClockwise&&(u=-u),r&&(u-=r),u){const f=jn*u,_=Math.cos(f),g=Math.sin(f),y=ze([Ys,Ys,-Ys,-Ys]);Hs(y,[h[0]*_-h[1]*g,h[0]*g+h[1]*_]),Hs(y,[h[0]*_-h[3]*g,h[0]*g+h[3]*_]),Hs(y,[h[2]*_-h[1]*g,h[2]*g+h[1]*_]),Hs(y,[h[2]*_-h[3]*g,h[2]*g+h[3]*_]),h=y}let d=$(c.offsetX),p=$(c.offsetY);if(r){const f=jn*r,_=Math.cos(f),g=Math.sin(f),y=d*g+p*_;d=d*_-p*g,p=y}h[0]+=d,h[1]+=p,h[2]+=d,h[3]+=p;const m=jc(c.markerPlacement);m>0&&(h[0]-=m,h[1]-=m,h[2]+=m,h[3]+=m);break}}const l=Ni(a.effects);l>0&&(h[0]-=l,h[1]-=l,h[2]+=l,h[3]+=l),o?(t[0]=h[0],t[1]=h[1],t[2]=h[2],t[3]=h[3],o=!1):(t[0]=Math.min(t[0],h[0]),t[1]=Math.min(t[1],h[1]),t[2]=Math.max(t[2],h[2]),t[3]=Math.max(t[3],h[3]))}return t}static _getTextInflatedSize(t,e,s){var u;const r=e.height??Rt.CIMTextSymbol.height;if(t[0]=-r/2,t[1]=-r/2,t[2]=r/2,t[3]=r/2,!s)return t;const n=s.get(e);if(!n||!n.glyphMosaicItems.glyphs.length)return t;const{lineGapType:o,lineGap:a}=e,h=o?ua(o,a??0,r):0,l=((u=e.callout)==null?void 0:u.type)==="CIMBackgroundCallout",c=ln(n.glyphMosaicItems,{scale:r/sn,angle:$(e.angle),xOffset:$(e.offsetX),yOffset:$(e.offsetY),horizontalAlignment:e.horizontalAlignment,verticalAlignment:e.verticalAlignment,maxLineWidth:512,lineHeight:rn*Math.max(.25,Math.min(h||1,4)),decoration:e.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:l}).boundsT;return t[0]=c.x-c.halfWidth,t[1]=-c.y-c.halfHeight,t[2]=c.x+c.halfWidth,t[3]=-c.y+c.halfHeight,t}},be=class fi{static getEnvelope(t,e,s){if(!t)return null;const r=new Hc(s);if(Array.isArray(t)){let n;for(const o of t)n?n.union(di(r,o,e)):n=di(r,o,e);return n}return di(r,t,e)}static getTextureAnchor(t,e){const s=this.getEnvelope(t,null,e);if(!s)return[0,0,0];const r=(s.x+.5*s.width)*bt,n=(s.y+.5*s.height)*bt,o=s.width*bt+2,a=s.height*bt+2;return[-r/o,-n/a,a]}static rasterize(t,e,s,r,n=!0){const o=s||this.getEnvelope(e,null,r);if(!o)return[null,0,0,0,0];const a=(o.x+.5*o.width)*bt,h=(o.y+.5*o.height)*bt;t.width=o.width*bt,t.height=o.height*bt,s||(t.width+=2,t.height+=2);const l=t.getContext("2d",{willReadFrequently:!0}),c=se.createScale(bt,-bt);c.translate(.5*t.width-a,.5*t.height+h);const u=new Uc(l,r,c);switch(e.type){case"CIMPointSymbol":{const m={type:"point",x:0,y:0};u.drawSymbol(e,m);break}case"CIMVectorMarker":{const m=new Ae;u.drawMarker(e,m);break}}const d=l.getImageData(0,0,t.width,t.height),p=new Uint8Array(d.data);if(n){let m;for(let f=0;fu.width&&u.width>0?_*u.width:_),lineDashEnding:m,controlPointEnding:K.FullPattern}]:void 0;o.push({type:"CIMSolidStroke",capStyle:d?tt.Round:tt.Butt,enable:!0,width:p,color:st(u.color),effects:f})}else!e||t.type!=="line-marker"||t.style!=="cross"&&t.style!=="x"?[a,h]=Ue(r):([a,h]=Ue(r),o.push({type:"CIMSolidStroke",enable:!0,width:e,color:st(n)}));o.push({type:"CIMSolidFill",enable:!0,color:st(n)});const c={type:"CIMPolygonSymbol",symbolLayers:o};return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:$(-t.angle),size:$(l||6*e),offsetX:$(t.xoffset),offsetY:$(t.yoffset),scaleSymbolsProportionally:!1,frame:a,markerGraphics:[{type:"CIMMarkerGraphic",geometry:h,symbol:c}]}]}}static fromCIMHatchFill(t,e){var h;const s=e*(t.separation??Rt.CIMHatchFill.separation),r=s/2,n=Ie(t.lineSymbol);(h=n.symbolLayers)==null||h.forEach(l=>{var c;switch(l.type){case"CIMSolidStroke":l.width!=null&&(l.width*=e),(c=l.effects)==null||c.forEach(u=>{if(u.type==="CIMGeometricEffectDashes"){const d=u.dashTemplate;u.dashTemplate=d.map(p=>p*e)}});break;case"CIMVectorMarker":{l.size!=null&&(l.size*=e);const u=l.markerPlacement;u!=null&&"placementTemplate"in u&&(u.placementTemplate=u.placementTemplate.map(d=>d*e));break}}});let o=this._getLineSymbolPeriod(n)||Kn;for(;o{nu(n,e,s),"url"in n&&n.url&&s.push(e.fetchResource(n.url,{signal:r}))}),s}static fetchFonts(t,e,s){if(t&&e){if("symbolLayers"in t&&t.symbolLayers){for(const r of t.symbolLayers)if(r.type==="CIMVectorMarker"&&r.markerGraphics)for(const n of r.markerGraphics)n!=null&&n.symbol&&fi.fetchFonts(n.symbol,e,s)}else if(t.type==="CIMTextSymbol"){const{fontFamilyName:r,fontStyleName:n}=t;if(!r||r.toLowerCase()==="calcitewebcoreicons")return;const{style:o,weight:a}=Po(n),h=bo(t),l=new Lh({family:r,style:o,weight:a,decoration:h});s.push(e.loadFont(l).catch(()=>{Ei().error(`Unsupported font ${r} in CIM symbol`)}))}}}static _getLineSymbolPeriod(t){if(t){const e=this._getEffectsRepeat(t.effects);if(e)return e;if(t.symbolLayers){for(const s of t.symbolLayers)if(s){const r=this._getEffectsRepeat(s.effects);if(r)return r;switch(s.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const n=this._getPlacementRepeat(s.markerPlacement);if(n)return n}}}}}return 0}static _getEffectsRepeat(t){if(t){for(const e of t)if(e)switch(e.type){case"CIMGeometricEffectDashes":{const s=e.dashTemplate;if(s&&s.length){let r=0;for(const n of s)r+=n;return 1&s.length&&(r*=2),r}break}case"CIMGeometricEffectWave":return e.period;default:Ei().error(`unsupported geometric effect type ${e.type}`)}}return 0}static _getPlacementRepeat(t){if(t)switch(t.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineVariableSize":{const e=t.placementTemplate;if(e&&e.length){let s=0;for(const r of e)s+=+r;return 1&e.length&&(s*=2),s}break}}return 0}static fromCIMInsidePolygon(t){const e=t.markerPlacement,s={...t};s.markerPlacement=null,s.anchorPoint=null;const r=Math.abs(e.stepX),n=Math.abs(e.stepY),o=(e.randomness??100)/100;let a,h,l,c;if(e.gridType==="Random"){const u=de(Eh),d=Math.max(Math.floor(u/r),1),p=Math.max(Math.floor(u/n),1);a=d*r/2,h=p*n/2,l=2*h;const m=new go(e.seed),f=o*r/1.5,_=o*n/1.5;c=[];for(let g=0;g({type:"CIMMarkerGraphic",geometry:u,symbol:{type:"CIMPointSymbol",symbolLayers:[s]}})),size:l}}};function fa(i,t){if(i)switch(i.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const e=i.symbolLayers;if(!e)return;for(const s of e)if(t(s),s.type==="CIMVectorMarker"){const r=s.markerGraphics;if(!r)continue;for(const n of r)if(n){const o=n.symbol;o&&fa(o,t)}}break}}}const ma=i=>{if(!i)return tt.Butt;switch(i){case"butt":return tt.Butt;case"square":return tt.Square;case"round":return tt.Round}},_a=i=>{if(!i)return ct.Miter;switch(i){case"miter":return ct.Miter;case"round":return ct.Round;case"bevel":return ct.Bevel}},Jc=i=>{if(i==null)return"Center";switch(i){case"left":return"Left";case"right":return"Right";case"center":return"Center"}},Qc=i=>{if(i==null)return"Center";switch(i){case"baseline":return"Baseline";case"top":return"Top";case"middle":return"Center";case"bottom":return"Bottom"}},st=i=>{if(!i)return[0,0,0,0];const{r:t,g:e,b:s,a:r}=i;return[t,e,s,255*r]},tu=(i,t)=>{const e=eu(t),s=su(i);return e&&s?`${e}-${s}`:`${e}${s}`},eu=i=>{if(!i)return"";switch(i.toLowerCase()){case"bold":case"bolder":return"bold"}return""},su=i=>{if(!i)return"";switch(i.toLowerCase()){case"italic":case"oblique":return"italic"}return""},Cr=(i,t)=>{const e=ue("safari")?.001:0,s=t==="butt";switch(i){case"dash":case"esriSLSDash":return s?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return s?[4,3,1,3]:[3,4,e,4];case"dot":case"esriSLSDot":return s?[1,3]:[e,4];case"long-dash":case"esriSLSLongDash":return s?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return s?[8,3,1,3]:[7,4,e,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return s?[8,3,1,3,1,3]:[7,4,e,4,e,4];case"short-dash":case"esriSLSShortDash":return s?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return s?[4,1,1,1]:[3,2,e,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return s?[4,1,1,1,1,1]:[3,2,e,2,e,2];case"short-dot":case"esriSLSShortDot":return s?[1,1]:[e,2];case"solid":case"esriSLSSolid":case"none":return Ei().error("Unexpected: style does not require rasterization"),[0,0];default:return Ei().error(`Tried to rasterize SLS, but found an unexpected style: ${i}!`),[0,0]}};function iu(i){return i.symbolLayers!==void 0}const Ue=(i,t=100)=>{const e=t/2;let s,r;const n=i;if(n==="circle"||n==="esriSMSCircle"){let a=Math.acos(1-.25/e),h=Math.ceil(da/a/4);h===0&&(h=1),a=Zc/h,h*=4;const l=[];l.push([e,0]);for(let c=1;ci==="vertical"||i==="horizontal"||i==="cross"||i==="esriSFSCross"||i==="esriSFSVertical"||i==="esriSFSHorizontal";function nu(i,t,e){if(!(!i.effects||t.geometryEngine!=null)){if(t.geometryEnginePromise)return void e.push(t.geometryEnginePromise);al(i.effects)&&(t.geometryEnginePromise=hl(),e.push(t.geometryEnginePromise),t.geometryEnginePromise.then(s=>t.geometryEngine=s))}}function Jn(i){if(!i)return null;let t=null;const{cap:e,color:s,join:r,miterLimit:n,style:o,width:a}=i;return o!=="solid"&&o!=="none"&&o!=="esriSLSSolid"&&o!=="esriSLSNull"&&(t=[{type:"CIMGeometricEffectDashes",dashTemplate:Cr(o,e),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]),{type:"CIMSolidStroke",color:o!=="esriSLSNull"&&o!=="none"?st(s):[0,0,0,0],capStyle:ma(e),joinStyle:_a(r),miterLimit:n,width:a,effects:t}}const ou=96/72;let au=class{static executeEffects(t,e,s,r){const n=ou,o=Ni(t);let a=new Sr(e);for(const h of t){const l=vr(h);l&&(a=l.execute(a,h,n,s,r,o))}return a}static applyEffects(t,e,s){if(!t)return e;const r=Ni(t);let n,o=new Sr(N.fromJSONCIM(e));for(const l of t){const c=vr(l);c&&(o=c.execute(o,l,1,null,s,r))}const a=[];let h=null;for(;n=o.next();)a.push(...Es(n)),h=n.geometryType;return a.length===0||h===null?null:h==="esriGeometryPolygon"?{rings:a}:{paths:a}}},ga=null;function un(){return ga}async function hu(){ga=await Nh(()=>import("./geometryEngineJSON-BfS7Q-po.js").then(i=>i.g),__vite__mapDeps([0,1,2,3,4]))}function ya(i){switch(i){case S.BYTE:case S.UNSIGNED_BYTE:return 1;case S.SHORT:case S.UNSIGNED_SHORT:return 2;case S.FLOAT:case S.INT:case S.UNSIGNED_INT:return 4}}function lu(i){const t=[],e=[],s=[];for(const r of i){const n=ya(r.type)*r.count;switch(n%2||n%4||4){case 4:t.push(r);continue;case 2:e.push(r);continue;case 1:s.push(r);continue;default:throw new Error("Found unexpected dataType byte count")}}return t.push(...e),t.push(...s),t}let cu=class xa{static fromVertexSpec({attributes:t},e){let s,r,n;const o=[];for(const p in t){const m=t[p];(e==null?void 0:e[p])!==!1&&(m.pack==="position"?s={...m,name:p,offset:0}:m.pack==="id"?r={...m,name:p,offset:4}:p==="bitset"?n={...m,name:p,offset:7}:o.push({...m,name:p}))}const a=lu(o),h=[];let l=8,c=1;for(const p of a)h.push({...p,offset:l}),l+=ya(p.type)*p.count,p.packAlternating&&(c=Math.max(p.packAlternating.count,c));const u=Uint32Array.BYTES_PER_ELEMENT,d=l%u;return new xa(s,r,n,h,l+(d?u-d:0),c)}constructor(t,e,s,r,n,o){this.position=t,this.id=e,this.bitset=s,this.standardAttributes=r,this.stride=n,this.packVertexCount=o,r.push(s),this._attributes=[t,e,s,...r]}get attributeLayout(){if(!this._attributeLayout){const t=cl(this._attributes),e=this._attributes.map(s=>({name:s.name,count:s.count,offset:s.offset,type:s.type,packPrecisionFactor:s.packPrecisionFactor,normalized:s.normalized??!1}));this._attributeLayout={attributes:e,hash:t,stride:this.stride}}return this._attributeLayout}},uu=class ba{static fromVertexSpec(t,e){const s=cu.fromVertexSpec(t,e);return new ba(s)}constructor(t){this._spec=t,this._packed=new Uint8Array(this._spec.stride*this._spec.packVertexCount),this._packedU32View=new Uint32Array(this._packed.buffer),this._dataView=new DataView(this._packed.buffer)}get attributeLayout(){return this._spec.attributeLayout}get stride(){return this._spec.stride}writeVertex(t,e,s,r,n,o){var a;for(let h=0;hthis.vertexSpec.createComputedParams(n)}get _vertexPack(){if(!this._cachedVertexPack){const t=uu.fromVertexSpec(this.vertexSpec,this._optionalAttributes);this._evaluator.hasDynamicProperties||t.pack(this._evaluator.evaluatedMeshParams,this._viewParams),this._cachedVertexPack=t}return this._cachedVertexPack}get evaluatedMeshParams(){return this._evaluator.evaluatedMeshParams}get hasEffects(){return!!this.evaluatedMeshParams.effects}get instanceId(){return this._instanceId}get attributeLayout(){return this._vertexPack.attributeLayout}setReferences(t){this._references=t}getBoundsInfo(){return null}getTileInfo(){return this._viewParams.tileInfo}async loadDependencies(){var t;pu((t=this._evaluator.inputMeshParams.params.effects)==null?void 0:t.effectInfos)&&await hu()}enqueueRequest(t,e,s){this._evaluator.hasDynamicProperties&&this._evaluator.enqueueRequest(t,e,s)}write(t,e,s,r,n){var p;this.ensurePacked(e,s,r);const o=this.evaluatedMeshParams.effects;if(!o||o.length===0)return void this._write(t,s,void 0,n);const a=(p=s.readGeometryForDisplay())==null?void 0:p.clone();if(!a)return;const h=N.fromOptimizedCIM(a,s.geometryType),l=un();h.invertY();const c=t.id||"",u=au.executeEffects(o,h,c,l);let d;for(;d=u.next();)d.invertY(),this._write(t,s,d,n)}ensurePacked(t,e,s){if(!this._evaluator.hasDynamicProperties)return;const r=this._evaluator.evaluateMeshParams(t,e,s);this._vertexPack.pack(r,this._viewParams)}_writeVertex(t,e,s,r,n){const o=this.evaluatedMeshParams;this._vertexPack.writeVertex(t,e,s,r,o,n)}};const du=100,fu=ue("featurelayer-fast-triangulation-enabled");let Pa=class extends Fe{async loadDependencies(){await Promise.all([super.loadDependencies(),jh()])}_write(t,e,s){const r=(s==null?void 0:s.asOptimized())??e.readGeometryForDisplay(),n=this._clip(r);n&&(t.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(t,e,n),t.recordEnd())}_clip(t){if(!t)return null;const e=this.hasEffects;return To(t,e?256:8)}_writeGeometry(t,e,s){const r=s.maxLength>du,n=[],o=this.createTesselationParams(e);if(!r&&fu&&Al(n,s))return void(n.length&&this._writeVertices(t,e,s.coords,o,n));const a=Fl(s);this._writeVertices(t,e,a,o)}_writeVertices(t,e,s,r,n){const o=e.getDisplayId(),a=t.vertexCount(),h=this.hasEffects;let l=0;if(n)for(const c of n){const u=s[2*c],d=s[2*c+1];h&&t.recordBounds(u,d,0,0),this._writeVertex(t,o,u,d,r),l++}else for(let c=0;ci,attributes:{id:{type:S.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:S.UNSIGNED_BYTE,count:1},pos:{type:S.SHORT,count:2,pack:"position",packPrecisionFactor:10},inverseArea:{type:S.FLOAT,count:1,packTessellation:({inverseArea:i})=>i}}};let _u=class extends Pa{constructor(){super(...arguments),this.vertexSpec=mu}createTesselationParams(t){return{inverseArea:1/t.readGeometryArea()}}};const gu=()=>me.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.meshWriterUtils"),yu=0,xu=100;function Re(i,t){return[!!(i!=null&&i.minScale)&&t.scaleToZoom(i.minScale)||yu,!!(i!=null&&i.maxScale)&&t.scaleToZoom(i.maxScale)||xu]}function Xe(i){return 1<i,attributes:{id:{type:S.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:S.UNSIGNED_BYTE,count:1},pos:{type:S.SHORT,count:2,pack:"position",packPrecisionFactor:10},zoomRange:{type:S.SHORT,count:2,packPrecisionFactor:Hi,pack:({scaleInfo:i},{tileInfo:t})=>Re(i,t)},color:{type:S.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:i})=>W(i)}}};let pn=class extends Pa{constructor(){super(...arguments),this.vertexSpec=wa}createTesselationParams(t){return null}};const qi={createComputedParams:i=>i,attributes:{...wa.attributes,tlbr:{count:4,type:S.UNSIGNED_SHORT,pack:({sprite:i})=>{const{rect:t,width:e,height:s}=i,r=t.x+Le,n=t.y+Le;return[r,n,r+e,n+s]}},inverseRasterizationScale:{count:1,type:S.BYTE,packPrecisionFactor:16,pack:({sprite:i})=>1/i.rasterizationScale}}};let Sa=class extends pn{constructor(){super(...arguments),this.vertexSpec=qi}_write(t,e,s){var a;const r=(s==null?void 0:s.asOptimized())??e.readGeometryForDisplay(),n=this._clip(r);if(!n)return;const o=(a=this.evaluatedMeshParams.sprite)==null?void 0:a.textureBinding;t.recordStart(this.instanceId,this.attributeLayout,o),this._writeGeometry(t,e,n),t.recordEnd()}};var to;(function(i){i[i.Geographic=0]="Geographic",i[i.Arithmatic=1]="Arithmatic"})(to||(to={}));const Ff=3.14159265359/180,wu=3.14159265359/128,Rf=1,Su=1.1,vu=1,Of=24,Df=8,Mu=1e-5,eo=.05,Cu=1e-30,dn=4,fn=0,va=2,Ma=5,Ca=6,$u=2,ku=3,Iu=0,Tu=3,zu=16777216;function mn(i){const{sprite:t,aspectRatio:e,scaleProportionally:s}=i,r=I(i.height),n=r>0?r:t.height;let o=r*e;return o<=0?o=t.width:s&&(o*=t.width/t.height),{width:o,height:n}}function $a(i){const{applyRandomOffset:t,sampleAlphaOnly:e}=i,{width:s,height:r}=mn(i);return As([[va,t],[dn,e],[Ca,si,attributes:{...qi.attributes,bitset:{count:1,type:S.UNSIGNED_BYTE,pack:$a},width:{count:1,type:S.UNSIGNED_SHORT,pack:ka},height:{count:1,type:S.UNSIGNED_SHORT,pack:Ia},offset:{count:2,type:S.SHORT,pack:({offsetX:i,offsetY:t})=>[I(i),-I(t)]},scale:{count:2,type:S.UNSIGNED_BYTE,packPrecisionFactor:16,pack:({scaleX:i,scaleY:t})=>[i,t]},angle:{count:1,type:S.UNSIGNED_BYTE,pack:({angle:i})=>Fh(i)}}};let Lu=class extends Sa{constructor(){super(...arguments),this.vertexSpec=Ta}},Eu=class{constructor(){this.extrusionOffsetX=0,this.extrusionOffsetY=0,this.normalX=0,this.normalY=0,this.directionX=0,this.directionY=0,this.distance=0}};const Zi={createComputedParams:i=>i,attributes:{id:{type:S.UNSIGNED_BYTE,count:3,pack:"id"},pos:{type:S.SHORT,count:2,pack:"position",packPrecisionFactor:10},bitset:{type:S.UNSIGNED_BYTE,count:1},zoomRange:{type:S.SHORT,count:2,packPrecisionFactor:Hi,pack:({scaleInfo:i},{tileInfo:t})=>Re(i,t)},color:{type:S.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:i})=>W(i)},offset:{type:S.BYTE,count:2,packPrecisionFactor:16,packTessellation:({extrusionOffsetX:i,extrusionOffsetY:t})=>[ti(i,16),ti(t,16)]},normal:{type:S.BYTE,count:2,packPrecisionFactor:16,packTessellation:({normalX:i,normalY:t})=>[ti(i,16),ti(t,16)]},halfWidth:{type:S.UNSIGNED_SHORT,count:1,packPrecisionFactor:16,pack:({width:i})=>Qn(I(.5*i),16)},referenceHalfWidth:{type:S.UNSIGNED_SHORT,count:1,packPrecisionFactor:16,pack:({referenceWidth:i})=>Qn(I(.5*i),16)}}};let Nu=class{constructor(){this.id=0,this.bitset=0,this.indexCount=0,this.vertexCount=0,this.vertexFrom=0,this.vertexBounds=0}};const so=65535;let _n=class extends Fe{constructor(t,e,s,r){super(t,e,s,r),this.vertexSpec=Zi,this._currentWrite=new Nu,this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0,wrapDistance:so,textured:!1},this._tessParams=new Eu,this._initializeTessellator()}writeLineVertices(t,e,s){const r=this._getLines(e);r!=null&&this._writeVertices(t,s,r)}_initializeTessellator(){this._lineTessellator=new Kh(this._writeTesselatedVertex.bind(this),this._writeTriangle.bind(this),!0)}_write(t,e,s){const r=s??N.fromFeatureSetReaderCIM(e);r&&this._writeGeometry(t,e,r)}_writeGeometry(t,e,s,r){t.recordStart(this.instanceId,this.attributeLayout,r),this.writeLineVertices(t,s,e),t.recordEnd()}_getLines(t){return Ol(t,So(this.evaluatedMeshParams))}_writeVertices(t,e,s){const{_currentWrite:r,_tessellationOptions:n,evaluatedMeshParams:o}=this,{width:a,capType:h,joinType:l,miterLimit:c,hasSizeVV:u}=o,d=I(.5*a);n.halfWidth=d,n.capType=bu(h),n.joinType=Pu(l),n.miterLimit=c;const p=!u;r.out=t,r.id=e.getDisplayId(),r.vertexCount=0,r.indexCount=0,r.vertexFrom=t.vertexCount(),r.vertexBounds=p&&di,attributes:{...Zi.attributes,bitset:{type:S.UNSIGNED_BYTE,count:1,pack:i=>0},color:{type:S.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:i})=>W(i)}}},gn={createComputedParams:i=>i,attributes:{...Zi.attributes,bitset:{type:S.UNSIGNED_BYTE,count:1,pack:i=>As([[fn,!0]])},color:{type:S.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:i})=>W(i)}}};let yn=class extends _n{constructor(){super(...arguments),this.vertexSpec=gn}},xn=class extends pn{constructor(t,e,s,r){super(t,e,s,r),this.vertexSpec=za,this._lineMeshWriter=this._createOutlineWriter(t,e,s,r)}_createOutlineWriter(t,e,s,r){return new yn(t,e,s,r)}_write(t,e,s){const r=(s==null?void 0:s.asOptimized())??e.readGeometryForDisplay(),n=this._clip(r);n&&(t.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(t,e,n),this._lineMeshWriter.writeLineVertices(t,N.fromOptimizedCIM(n,"esriGeometryPolyline"),e),t.recordEnd())}_clip(t){return t?To(t,So(this.evaluatedMeshParams)):null}ensurePacked(t,e,s){super.ensurePacked(t,e,s),this._lineMeshWriter.ensurePacked(t,e,s)}enqueueRequest(t,e,s){super.enqueueRequest(t,e,s),this._lineMeshWriter.enqueueRequest(t,e,s)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}};const La=()=>me.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");let Ea=class{constructor(){this._includedModules=new Map}include(t,e){if(this._includedModules.has(t)){const s=this._includedModules.get(t);if(s!==e){La().error("Trying to include shader module multiple times with different sets of options.");const r=new Set;for(const n of Object.keys(s))s[n]!==t[n]&&r.add(n);for(const n of Object.keys(t))s[n]!==t[n]&&r.add(n);r.forEach(n=>console.error(` ${n}: current ${s[n]} new ${t[n]}`))}}else this._includedModules.set(t,e),t(this.builder,e)}},Au=class extends Ea{constructor(){super(...arguments),this.vertex=new io,this.fragment=new io,this.attributes=new Ou,this.varyings=new Du,this.extensions=new $r,this.constants=new Na}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(t,e=!0){const s=this.extensions.generateSource(t),r=this.attributes.generateSource(t),n=this.varyings.generateSource(t),o=t==="vertex"?this.vertex:this.fragment,a=o.uniforms.generateSource(),h=o.code.generateSource(),l=t==="vertex"?Bu:Gu(e),c=this.constants.generateSource().concat(o.constants.generateSource());return`${e?"#version 300 es":""} ${s.join(` `)} ${l} diff --git a/assets/Util-BS8sJGjF.js b/assets/Util-CS5u4Lec.js similarity index 87% rename from assets/Util-BS8sJGjF.js rename to assets/Util-CS5u4Lec.js index c78afd9..c8cf1a7 100644 --- a/assets/Util-BS8sJGjF.js +++ b/assets/Util-CS5u4Lec.js @@ -1 +1 @@ -import"./index-CEWggaxV.js";class l{constructor(t){this.message=t}toString(){return`AssertException: ${this.message}`}}function h(e,t){if(!e){t=t||"Assertion";const u=new Error(t).stack;throw new l(`${t} at ${u}`)}}function m(e,t,u,f){let i,o=(u[0]-e[0])/t[0],s=(f[0]-e[0])/t[0];o>s&&(i=o,o=s,s=i);let n=(u[1]-e[1])/t[1],c=(f[1]-e[1])/t[1];if(n>c&&(i=n,n=c,c=i),o>c||n>s)return!1;n>o&&(o=n),cr&&(i=a,a=r,r=i),!(o>r||a>s)&&(rs&&(i=o,o=s,s=i);let n=(u[1]-e[1])/t[1],c=(f[1]-e[1])/t[1];if(n>c&&(i=n,n=c,c=i),o>c||n>s)return!1;n>o&&(o=n),cr&&(i=a,a=r,r=i),!(o>r||a>s)&&(rthis._width||s>this._height)return new P;let t=null,i=-1;for(let r=0;re&&this._free.push(new P(t.x+e,t.y,t.width-e,s)),t.height>s&&this._free.push(new P(t.x,t.y+s,t.width,t.height-s))):(t.width>e&&this._free.push(new P(t.x+e,t.y,t.width-e,t.height)),t.height>s&&this._free.push(new P(t.x,t.y+s,e,t.height-s))),new P(t.x,t.y,e,s))}release(e){for(let s=0;s{const l=e+a;if(this._rangePromises.has(l))n.push(this._rangePromises.get(l));else{const c=i.getRange(e,a).then(()=>{this._rangePromises.delete(l)},()=>{this._rangePromises.delete(l)});this._rangePromises.set(l,c),n.push(c)}}),Promise.all(n).then(()=>{let a=this._glyphIndex[e];a||(a={},this._glyphIndex[e]=a);for(const l of s){const c=a[l];if(c){t[l]={sdf:!0,rect:c.rect,metrics:c.metrics,page:c.page,code:l};continue}const y=i.getGlyph(e,l);if(!(y!=null&&y.metrics))continue;const d=y.metrics;let u;if(d.width===0)u=new P(0,0,0,0);else{const f=d.width+6,g=d.height+2*3;let p=f%4?4-f%4:4,m=g%4?4-g%4:4;p===1&&(p=5),m===1&&(m=5),u=this._binPack.allocate(f+p,g+m),u.isEmpty&&(this._dirties[this._currentPage]||(this._glyphData[this._currentPage]=null),this._currentPage=this._glyphData.length,this._glyphData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(void 0),this._binPack=new $(this.width-4,this.height-4),u=this._binPack.allocate(f+p,g+m));const b=this._glyphData[this._currentPage],S=y.bitmap;let I,w;if(S)for(let x=0;x{t.addRange(s,new G(new X(new Uint8Array(n.data),new DataView(n.data))))}).catch(()=>{t.addRange(s,new G)})}return t.addRange(s,new G),Promise.resolve()}getGlyph(e,s){const t=this._getFontStack(e);if(!t)return;const i=Math.floor(s/256),r=t.getRange(i);return r?{metrics:r.getMetrics(s),bitmap:r.getBitmap(s)}:void 0}_getFontStack(e){let s=this._glyphInfo[e];return s||(s=this._glyphInfo[e]=new mt),s}},bt=class{constructor(e,s,t){this._array=e,this._start=s,this.length=t}at(e){return 0<=e&&e0&&(this._maxItemSize=t),this._binPack=new $(e-4,s-4)}destroy(){this.dispose()}dispose(){this._binPack=null,this._mosaicsData.length=0,this._mosaicRects={};for(const e of this._textures)e&&e.dispose();this._textures.length=0}getWidth(e){return e>=this._size.length?-1:this._size[e][0]}getHeight(e){return e>=this._size.length?-1:this._size[e][1]}getPageSize(e){return e>=this._size.length?null:this._size[e]}setSpriteSource(e){if(this.dispose(),this.pixelRatio=e.devicePixelRatio,this._mosaicsData.length===0){this._binPack=new $(this._pageWidth-4,this._pageHeight-4);const s=Math.floor(this._pageWidth),t=Math.floor(this._pageHeight),i=new Uint32Array(s*t);this._mosaicsData[0]=i,this._dirties.push(!0),this._size.push([this._pageWidth,this._pageHeight]),this._textures.push(void 0)}this._sprites=e}getSpriteItem(e,s=!1){let t,i,r=this._mosaicRects[e];if(r)return r;if(!this._sprites||this._sprites.loadStatus!=="loaded"||(e&&e.startsWith(wt)?([t,i]=this._rasterizeDash(e),s=!0):t=this._sprites.getSpriteInfo(e),!(t!=null&&t.width)||!t.height||t.width<0||t.height<0))return null;const o=t.width,n=t.height,[a,l,c]=this._allocateImage(o,n);return a.width<=0?null:(this._copy(a,t,l,c,s,i),r={type:"sprite",rect:a,width:o,height:n,sdf:t.sdf,simplePattern:!1,rasterizationScale:t.pixelRatio,page:l},this._mosaicRects[e]=r,r)}getSpriteItems(e){const s={};for(const t of e)s[t.name]=this.getSpriteItem(t.name,t.repeat);return s}getMosaicItemPosition(e,s){const t=this.getSpriteItem(e,s),i=t&&t.rect;if(!i)return null;i.width=t.width,i.height=t.height;const r=t.width,o=t.height,n=2;return{tl:[i.x+n,i.y+n],br:[i.x+n+r,i.y+n+o],page:t.page}}bind(e,s,t=0,i=0){if(t>=this._size.length||t>=this._mosaicsData.length)return;if(!this._textures[t]){const o=new Ae;o.wrapMode=Ce.CLAMP_TO_EDGE,o.width=this._size[t][0],o.height=this._size[t][1],this._textures[t]=new Pe(e,o,new Uint8Array(this._mosaicsData[t].buffer))}const r=this._textures[t];r.setSamplingMode(s),this._dirties[t]&&r.setData(new Uint8Array(this._mosaicsData[t].buffer)),e.bindTexture(r,i),this._dirties[t]=!1}static _copyBits(e,s,t,i,r,o,n,a,l,c,y){let d=i*s+t,u=a*o+n;if(y){u-=o;for(let _=-1;_<=c;_++,d=((_+c)%c+i)*s+t,u+=o)for(let f=-1;f<=l;f++)r[u+f]=e[d+(f+l)%l]}else for(let _=0;_=this._mosaicsData.length)return;const n=new Uint32Array(o?o.buffer:this._sprites.image.buffer),a=this._mosaicsData[t];a&&n||console.error("Source or target images are uninitialized!");const l=2,c=o?s.width:this._sprites.width;Oe._copyBits(n,c,s.x,s.y,a,i[0],e.x+l,e.y+l,s.width,s.height,r),this._dirties[t]=!0}_allocateImage(e,s){e+=2,s+=2;const t=Math.max(e,s);if(this._maxItemSize&&this._maxItemSizethis._spriteMosaic)}get glyphMosaic(){return this._glyphMosaic}async start(e){this._requestSprite(e);const s=this._layer.currentStyleInfo.glyphsUrl,t=new pe(s?re(s,{...this._layer.customParameters,token:this._layer.apiKey}):null);this._glyphMosaic=new fe(1024,1024,t),this._broadcastPromise=$e("WorkerTileHandler",{client:this,schedule:e.schedule,signal:e.signal}).then(i=>{var r;if(this._layer&&((r=this._connection)==null||r.close(),this._connection=i,this._layer&&!this._connection.closed)){const o=i.broadcast("setStyle",{style:this._layer.currentStyleInfo.style,sourceDataMaxLOD:this._sourceDataMaxLOD},e);Promise.all(o).catch(n=>Fe(n))}})}_requestSprite(e){var o,n;(o=this._spriteSourceAbortController)==null||o.abort();const s=new AbortController;this._spriteSourceAbortController=s;const t=e==null?void 0:e.signal;this._inputSignalEventListener&&((n=this._startOptionsInputSignal)==null||n.removeEventListener("abort",this._inputSignalEventListener)),this._startOptionsInputSignal=null,t&&(this._inputSignalEventListener=xt(s),t.addEventListener("abort",this._inputSignalEventListener,{once:!0}));const{signal:i}=s,r={...e,signal:i};this._spriteSourcePromise=this._layer.loadSpriteSource(this.devicePixelRatio,r),this._spriteSourcePromise.then(a=>{qe(i),this._spriteMosaic=new ge(1024,1024,250),this._spriteMosaic.setSpriteSource(a)})}async updateStyle(e){return await this._broadcastPromise,this._broadcastPromise=Promise.all(this._connection.broadcast("updateStyle",e)),this._broadcastPromise}setSpriteSource(e){const s=new ge(1024,1024,250);return s.setSpriteSource(e),this._spriteMosaic=s,this._spriteSourcePromise=Promise.resolve(e),this._spriteSourceAbortController=null,s}async setStyle(e,s,t){await this._broadcastPromise,this._styleRepository=e,this._sourceDataMaxLOD=t,this._requestSprite();const i=new pe(this._layer.currentStyleInfo.glyphsUrl?re(this._layer.currentStyleInfo.glyphsUrl,{...this._layer.customParameters,token:this._layer.apiKey}):null);return this._glyphMosaic=new fe(1024,1024,i),this._broadcastPromise=Promise.all(this._connection.broadcast("setStyle",{style:s,sourceDataMaxLOD:this._sourceDataMaxLOD})),this._broadcastPromise}async fetchTileData(e,s){const t=await this._getRefKeys(e,s);return this._getSourcesData(Object.keys(this._layer.sourceNameToSource),t,s)}async fetchTilePBFs(e){const s=Object.keys(this._layer.sourceNameToSource),t={},i=await this._getRefKeys(e,t),r=[],o=[];for(let n=0;n{r.push({...c,key:a})}),o.push(l)}return Promise.all(o).then(()=>r)}async parseTileData(e,s){const t=e&&e.data;if(!t)return null;const{sourceName2DataAndRefKey:i,transferList:r}=t;return Object.keys(i).length===0?null:this._broadcastPromise.then(()=>this._connection.invoke("createTileAndParse",{key:e.key.id,sourceName2DataAndRefKey:i,styleLayerUIDs:e.styleLayerUIDs},{...s,transferList:r}))}async getSprites(e){return await this._spriteSourcePromise,this._spriteMosaic.getSpriteItems(e)}getGlyphs(e){return this._glyphMosaic.getGlyphItems(e.font,e.codePoints)}async _getTilePayload(e,s,t){const i=M.pool.acquire(e.id),r=this._layer.sourceNameToSource[s],{level:o,row:n,col:a}=i;M.pool.release(i);try{return{protobuff:await r.requestTile(o,n,a,t),sourceName:s}}catch(l){if(j(l))throw l;return{protobuff:null,sourceName:s}}}async _getRefKeys(e,s){const t=this._layer.sourceNameToSource,i=new Array;for(const r in t){const o=t[r].getRefKey(e,s);i.push(o)}return oe(i)}_getSourcesData(e,s,t){const i=[];for(let r=0;r{const o={},n=[];for(let a=0;a0){const c=s[a].value.id;o[l.sourceName]={refKey:c,protobuff:l.protobuff},n.push(l.protobuff)}}return{sourceName2DataAndRefKey:o,transferList:n}})}};function xt(h){return()=>h.abort()}const me=512,It=1e-6,Tt=(h,e)=>h+1/(1<<2*e);let be=class{constructor(e,s){this._tiles=new Map,this._tileCache=new He(40,t=>t.dispose()),this._viewSize=[0,0],this._visibleTiles=new Map,this.acquireTile=e.acquireTile,this.releaseTile=e.releaseTile,this.tileInfoView=e.tileInfoView,this._container=s}destroy(){for(const[e,s]of this._tiles)s.dispose();this._tiles=null,this._tileCache.clear(),this._tileCache=null}update(e){this._updateCacheSize(e);const s=this.tileInfoView,t=s.getTileCoverage(e.state,0,!0,"smallest");if(!t)return!0;const{spans:i,lodInfo:r}=t,{level:o}=r,n=this._tiles,a=new Set,l=new Set;for(const{row:y,colFrom:d,colTo:u}of i)for(let _=d;_<=u;_++){const f=M.getId(o,y,r.normalizeCol(_),r.getWorldForColumn(_)),g=this._getOrAcquireTile(f);a.add(f),g.processed()?this._addToContainer(g):l.add(new M(f))}for(const[y,d]of n)d.isCoverage=a.has(y);for(const y of l)this._findPlaceholdersForMissingTiles(y,a);let c=!1;for(const[y,d]of n)d.neededForCoverage=a.has(y),d.neededForCoverage||d.isHoldingForFade&&s.intersects(t,d.key)&&a.add(y),d.isFading&&(c=!0);for(const[y,d]of this._tiles)a.has(y)||this._releaseTile(y);return Re.pool.release(t),!c}clear(){this._tiles.clear(),this._tileCache.clear(),this._visibleTiles.clear()}clearCache(){this._tileCache.clear()}getIntersectingTiles(e,s,t,i,r){const o=[0,0],n=[0,0];i.toMap(o,e-t,s+t),i.toMap(n,e+t,s-t);const a=Math.min(o[0],n[0]),l=Math.min(o[1],n[1]),c=Math.max(o[0],n[0]),y=Math.max(o[1],n[1]),d=Be(a,l,c,y),u=F(),_=[];for(const[f,g]of this._visibleTiles)this.tileInfoView.getTileBounds(u,g.key),Ne(d,u)&&_.push(g);if(r!=null&&r.length>0){const f=new Set(_.map(p=>p.id)),g=r.filter(p=>!f.has(p.tileKey.id)).map(p=>this._visibleTiles.get(p.tileKey.id)).filter(p=>p!==void 0);_.push(...g)}return _}_findPlaceholdersForMissingTiles(e,s){const t=[];for(const[r,o]of this._tiles)this._addPlaceholderChild(t,o,e,s);const i=t.reduce(Tt,0);Math.abs(1-i)0;){if(i--,r>>=1,o>>=1,t.level===i&&t.row===r&&t.col===o&&t.world===n)return!0;if(a.has(`${i}/${r}/${o}/${n}`))return!1}return!1}_updateCacheSize(e){const s=e.state.size;if(s[0]===this._viewSize[0]&&s[1]===this._viewSize[1])return;const t=Math.ceil(s[0]/me)+1,i=Math.ceil(s[1]/me)+1;this._viewSize[0]=s[0],this._viewSize[1]=s[1],this._tileCache.maxSize=5*t*i}};function vt(h){const[e,s,t,i]=h.split("/"),r=parseInt(e,10);return r===0?null:`${r-1}/${parseInt(s,10)>>1}/${parseInt(t,10)>>1}/${parseInt(i,10)}`}function Dt(h,e){const s=e.level-h.level;return h.row===e.row>>s&&h.col===e.col>>s&&h.world===e.world}let Ct=class{constructor(e,s){this.sourceTile=s,this.xTile=0,this.yTile=0,this.hash=0,this.priority=1,this.featureIndex=0,this.colliders=[],this.textVertexRanges=[],this.iconVertexRanges=[],this.tile=e}};class Rt{constructor(){this.tileSymbols=[],this.parts=[{startTime:0,startOpacity:0,targetOpacity:0,show:!1},{startTime:0,startOpacity:0,targetOpacity:0,show:!1}],this.show=!1}}function we(h,e,s,t,i,r){const o=s-i;if(o>=0)return(e>>o)+(t-(r<>o);const n=-o;return e-(r-(t<>n)<0){this.patternMap=new Map;for(let o=0;o0}triangleCount(){return this.lineIndexCount/3}doDestroy(){this.vao=U(this.vao)}doPrepareForRendering(e,s,t){const i=new Uint32Array(s),r=new Int32Array(i.buffer),o=i[t++],n=R.createVertex(e,C.STATIC_DRAW,new Int32Array(r.buffer,4*t,o));t+=o;const a=i[t++],l=R.createIndex(e,C.STATIC_DRAW,new Uint32Array(i.buffer,4*t,a));t+=a;const c=this.layer.lineMaterial;this.vao=new E(e,c.getAttributeLocations(),c.getLayoutInfo(),{geometry:n},l)}}let kt=class extends K{constructor(e,s){super(e,s),this.type=L.FILL,this.fillIndexStart=0,this.fillIndexCount=0,this.outlineIndexStart=0,this.outlineIndexCount=0;const t=new Uint32Array(e);let i=this.bufferDataOffset;this.fillIndexStart=t[i++],this.fillIndexCount=t[i++],this.outlineIndexStart=t[i++],this.outlineIndexCount=t[i++];const r=t[i++];if(r>0){this.patternMap=new Map;for(let o=0;o0||this.outlineIndexCount>0}triangleCount(){return(this.fillIndexCount+this.outlineIndexCount)/3}doDestroy(){this.fillVAO=U(this.fillVAO),this.outlineVAO=U(this.outlineVAO)}doPrepareForRendering(e,s,t){const i=new Uint32Array(s),r=new Int32Array(i.buffer),o=i[t++],n=R.createVertex(e,C.STATIC_DRAW,new Int32Array(r.buffer,4*t,o));t+=o;const a=i[t++],l=R.createIndex(e,C.STATIC_DRAW,new Uint32Array(i.buffer,4*t,a));t+=a;const c=i[t++],y=R.createVertex(e,C.STATIC_DRAW,new Int32Array(r.buffer,4*t,c));t+=c;const d=i[t++],u=R.createIndex(e,C.STATIC_DRAW,new Uint32Array(i.buffer,4*t,d));t+=d;const _=this.layer,f=_.fillMaterial,g=_.outlineMaterial;this.fillVAO=new E(e,f.getAttributeLocations(),f.getLayoutInfo(),{geometry:n},l),this.outlineVAO=new E(e,g.getAttributeLocations(),g.getLayoutInfo(),{geometry:y},u)}},Ut=class extends K{constructor(e,s,t){super(e,s),this.type=L.SYMBOL,this.iconPerPageElementsMap=new Map,this.glyphPerPageElementsMap=new Map,this.symbolInstances=[],this.isIconSDF=!1,this.opacityChanged=!1,this.lastOpacityUpdate=0,this.symbols=[];const i=new Uint32Array(e),r=new Int32Array(e),o=new Float32Array(e);let n=this.bufferDataOffset;this.isIconSDF=!!i[n++];const a=i[n++],l=i[n++],c=i[n++],y=new M(a,l,c,0),d=i[n++];for(let g=0;g0||this.glyphPerPageElementsMap.size>0}triangleCount(){let e=0;for(const[s,t]of this.iconPerPageElementsMap)e+=t[1];for(const[s,t]of this.glyphPerPageElementsMap)e+=t[1];return e/3}doDestroy(){this.iconVAO=U(this.iconVAO),this.textVAO=U(this.textVAO)}updateOpacityInfo(){if(!this.opacityChanged)return;this.opacityChanged=!1;const e=this.iconOpacity,s=this.iconVAO.vertexBuffers.opacity;e.length>0&&e.byteLength===s.usedMemory&&s.setSubData(e,0,0,e.length);const t=this.textOpacity,i=this.textVAO.vertexBuffers.opacity;t.length>0&&t.byteLength===i.usedMemory&&i.setSubData(t,0,0,t.length)}doPrepareForRendering(e,s,t){const i=new Uint32Array(s),r=new Int32Array(i.buffer),o=i[t++],n=R.createVertex(e,C.STATIC_DRAW,new Int32Array(r.buffer,4*t,o));t+=o;const a=i[t++],l=R.createIndex(e,C.STATIC_DRAW,new Uint32Array(i.buffer,4*t,a));t+=a;const c=i[t++],y=R.createVertex(e,C.STATIC_DRAW,new Int32Array(r.buffer,4*t,c));t+=c;const d=i[t++],u=R.createIndex(e,C.STATIC_DRAW,new Uint32Array(i.buffer,4*t,d));t+=d;const _=R.createVertex(e,C.STATIC_DRAW,this.iconOpacity.buffer),f=R.createVertex(e,C.STATIC_DRAW,this.textOpacity.buffer),g=this.layer,p=g.iconMaterial,m=g.textMaterial;this.iconVAO=new E(e,p.getAttributeLocations(),p.getLayoutInfo(),{geometry:n,opacity:_},l),this.textVAO=new E(e,m.getAttributeLocations(),m.getLayoutInfo(),{geometry:y,opacity:f},u)}},Et=class extends K{constructor(e,s){super(e,s),this.type=L.CIRCLE,this.circleIndexStart=0,this.circleIndexCount=0;const t=new Uint32Array(e);let i=this.bufferDataOffset;this.circleIndexStart=t[i++],this.circleIndexCount=t[i++],this.bufferDataOffset=i}get memoryUsed(){var e,s;return(((e=this.data)==null?void 0:e.byteLength)??0)+(((s=this.vao)==null?void 0:s.usedMemory)??0)}hasData(){return this.circleIndexCount>0}triangleCount(){return this.circleIndexCount/3}doDestroy(){this.vao=U(this.vao)}doPrepareForRendering(e,s,t){const i=new Uint32Array(s),r=new Int32Array(i.buffer),o=i[t++],n=R.createVertex(e,C.STATIC_DRAW,new Int32Array(r.buffer,4*t,o));t+=o;const a=i[t++],l=R.createIndex(e,C.STATIC_DRAW,new Uint32Array(i.buffer,4*t,a));t+=a;const c=this.layer.circleMaterial;this.vao=new E(e,c.getAttributeLocations(),c.getLayoutInfo(),{geometry:n},l)}},Vt=class Ue extends Me{constructor(e,s,t,i,r,o,n,a=null){super(e,s,t,i,r,o,4096,4096),this.styleRepository=n,this._memCache=a,this.type="vector-tile",this._referenced=0,this._hasSymbolBuckets=!1,this._memoryUsedByLayerData=0,this.layerData=new Map,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.parentTile=null,this.childrenTiles=new Set,this.featureIndex=null,this.triangleCount=0,this._processed=!1,this._referenced=1,this.id=e.id}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate0}dispose(){this.status!=="unloaded"&&(this.featureIndex=null,zt.delete(this),Ue._destroyRenderBuckets(this.layerData),this.layerData.clear(),this._memoryUsedByLayerData=0,this.destroy(),this.status="unloaded")}release(){return--this._referenced==0&&(this.dispose(),this.stage=null,!0)}retain(){++this._referenced}get referenced(){return this._referenced}get usedMemory(){return this._memoryUsedByLayerData+256}changeDataImpl(e){var t,i;(t=this.featureIndex)==null||t.clear();let s=!1;if(e){const{bucketsWithData:r,emptyBuckets:o}=e,n=this._createRenderBuckets(r);if(o&&o.byteLength>0){const a=new Uint32Array(o);for(const l of a)this._deleteLayerData(l)}for(const[a,l]of n)this._deleteLayerData(a),l.type===L.SYMBOL&&(this.symbols.set(a,l.symbols),s=!0),this._memoryUsedByLayerData+=l.memoryUsed,this.layerData.set(a,l);(i=this._memCache)==null||i.updateSize(this.key.id,this,this.usedMemory)}this._hasSymbolBuckets=!1;for(const[r,o]of this.layerData)o.type===L.SYMBOL&&(this._hasSymbolBuckets=!0);s&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(s){s.processDetach()},untrashDisplayObject:()=>!1}}setTransform(e){super.setTransform(e);const s=this.resolution/(e.resolution*e.pixelRatio),t=this.width/this.rangeX*s,i=this.height/this.rangeY*s,r=[0,0];e.toScreen(r,[this.x,this.y]);const o=this.transforms.tileUnitsToPixels;Qe(o),Je(o,o,r),Ke(o,o,Math.PI*e.rotation/180),Ge(o,o,[t,i,1])}_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z(),tileUnitsToPixels:z()}}static _destroyRenderBuckets(e){if(!e)return;const s=new Set;for(const t of e.values())s.has(t)||(t.destroy(),s.add(t));e.clear()}_createRenderBuckets(e){const s=new Map,t=new Map;for(const i of e){const r=this._deserializeBucket(i,t);for(const o of r.layerUIDs)s.set(o,r)}return s}_deserializeBucket(e,s){let t=s.get(e);if(t)return t;switch(new Uint32Array(e)[0]){case L.FILL:t=new kt(e,this.styleRepository);break;case L.LINE:t=new Ot(e,this.styleRepository);break;case L.SYMBOL:t=new Ut(e,this.styleRepository,this);break;case L.CIRCLE:t=new Et(e,this.styleRepository)}return s.set(e,t),t}_deleteLayerData(e){if(!this.layerData.has(e))return;const s=this.layerData.get(e);this._memoryUsedByLayerData-=s.memoryUsed,s.destroy(),this.layerData.delete(e)}};const zt=new Map;function $t(h,e,s,t,i,r){const{iconRotationAlignment:o,textRotationAlignment:n,iconTranslate:a,iconTranslateAnchor:l,textTranslate:c,textTranslateAnchor:y}=t;let d=0;for(const u of h.colliders){const[_,f]=u.partIndex===0?a:c,g=u.partIndex===0?l:y,p=u.minLod<=r&&r<=u.maxLod;d+=p?0:1,u.enabled=p,u.xScreen=u.xTile*i[0]+u.yTile*i[3]+i[6],u.yScreen=u.xTile*i[1]+u.yTile*i[4]+i[7],g===Xe.MAP?(u.xScreen+=s*_-e*f,u.yScreen+=e*_+s*f):(u.xScreen+=_,u.yScreen+=f),O.VIEWPORT===(u.partIndex===0?o:n)?(u.dxScreen=u.dxPixels,u.dyScreen=u.dyPixels):(u.dxScreen=s*(u.dxPixels+u.width/2)-e*(u.dyPixels+u.height/2)-u.width/2,u.dyScreen=e*(u.dxPixels+u.width/2)+s*(u.dyPixels+u.height/2)-u.height/2)}h.colliders.length>0&&d===h.colliders.length&&(h.unique.show=!1)}class Ft{constructor(e,s,t,i,r,o){this._symbols=e,this._styleRepository=i,this._zoom=r,this._currentLayerCursor=0,this._currentSymbolCursor=0,this._styleProps=new Map,this._allNeededMatrices=new Map,this._gridIndex=new ke(s,t,yt),this._si=Math.sin(Math.PI*o/180),this._co=Math.cos(Math.PI*o/180);for(const n of e)for(const a of n.symbols)this._allNeededMatrices.has(a.tile)||this._allNeededMatrices.set(a.tile,Ye(a.tile.transforms.tileUnitsToPixels))}work(e){const s=this._gridIndex;function t(r){const o=r.xScreen+r.dxScreen,n=r.yScreen+r.dyScreen,a=o+r.width,l=n+r.height,[c,y,d,u]=s.getCellSpan(o,n,a,l);for(let _=y;_<=u;_++)for(let f=c;f<=d;f++){const g=s.cells[_][f];for(const p of g){const m=p.xScreen+p.dxScreen,b=p.yScreen+p.dyScreen,S=m+p.width,I=b+p.height;if(!(aS||lI))return!0}}return!1}const i=performance.now();for(;this._currentLayerCursore)return!1;const n=r.symbols[this._currentSymbolCursor];if(!n.unique.show)continue;$t(n,this._si,this._co,o,this._allNeededMatrices.get(n.tile),this._zoom);const a=n.unique;if(!a.show)continue;const{iconAllowOverlap:l,iconIgnorePlacement:c,textAllowOverlap:y,textIgnorePlacement:d}=o;for(const u of n.colliders){if(!u.enabled)continue;const _=a.parts[u.partIndex];_.show&&!(u.partIndex?y:l)&&t(u)&&(u.hard?a.show=!1:_.show=!1)}if(a.show)for(const u of n.colliders){if(!u.enabled||(u.partIndex?d:c)||!a.parts[u.partIndex].show)continue;const _=u.xScreen+u.dxScreen,f=u.yScreen+u.dyScreen,g=_+u.width,p=f+u.height,[m,b,S,I]=this._gridIndex.getCellSpan(_,f,g,p);for(let w=b;w<=I;w++)for(let x=m;x<=S;x++)this._gridIndex.cells[w][x].push(u)}}}return!0}_getProperties(e){const s=this._styleProps.get(e);if(s)return s;const t=this._zoom,i=this._styleRepository.getStyleLayerByUID(e),r=i.getLayoutValue("symbol-placement",t)!==je.POINT;let o=i.getLayoutValue("icon-rotation-alignment",t);o===O.AUTO&&(o=r?O.MAP:O.VIEWPORT);let n=i.getLayoutValue("text-rotation-alignment",t);n===O.AUTO&&(n=r?O.MAP:O.VIEWPORT);const a=i.getPaintValue("icon-translate",t),l=i.getPaintValue("icon-translate-anchor",t),c=i.getPaintValue("text-translate",t),y=i.getPaintValue("text-translate-anchor",t),d={iconAllowOverlap:i.getLayoutValue("icon-allow-overlap",t),iconIgnorePlacement:i.getLayoutValue("icon-ignore-placement",t),textAllowOverlap:i.getLayoutValue("text-allow-overlap",t),textIgnorePlacement:i.getLayoutValue("text-ignore-placement",t),iconRotationAlignment:o,textRotationAlignment:n,iconTranslateAnchor:l,iconTranslate:a,textTranslateAnchor:y,textTranslate:c};return this._styleProps.set(e,d),d}}function qt(h,e){if(h.priority-e.priority)return h.priority-e.priority;const s=h.tile.key,t=e.tile.key;return s.world-t.world?s.world-t.world:s.level-t.level?s.level-t.level:s.row-t.row?s.row-t.row:s.col-t.col?s.col-t.col:h.xTile-e.xTile?h.xTile-e.xTile:h.yTile-e.yTile}class Ht{get running(){return this._running}constructor(e,s,t,i,r,o){this._visibleTiles=e,this._symbolRepository=s,this._createCollisionJob=t,this._assignTileSymbolsOpacity=i,this._symbolLayerSorter=r,this._isLayerVisible=o,this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}setScreenSize(e,s){this._screenWidth===e&&this._screenHeight===s||this.restart(),this._screenWidth=e,this._screenHeight=s}restart(){this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}continue(e){if(this._selectionJob||(this._selectionJob=this._createSelectionJob()),!this._selectionJobCompleted){const s=performance.now();if(!this._selectionJob.work(e)||(this._selectionJobCompleted=!0,(e=Math.max(0,e-(performance.now()-s)))===0))return!1}if(this._collisionJob||(this._collisionJob=this._createCollisionJob(this._selectionJob.sortedSymbols,this._screenWidth,this._screenHeight)),!this._collisionJobCompleted){const s=performance.now();if(!this._collisionJob.work(e)||(this._collisionJobCompleted=!0,(e=Math.max(0,e-(performance.now()-s)))===0))return!1}if(this._opacityJob||(this._opacityJob=this._createOpacityJob()),!this._opacityJobCompleted){const s=performance.now();if(!this._opacityJob.work(e)||(this._opacityJobCompleted=!0,(e=Math.max(0,e-(performance.now()-s)))===0))return!1}return this._running=!1,!0}_createSelectionJob(){const e=this._symbolRepository.uniqueSymbols;for(let a=0;aa)return!1;let _=null,f=!1,g=!1;for(const p of l.tileSymbols)if(!g||!f){const m=p.tile;(!_||m.isCoverage||m.neededForCoverage&&!f)&&(_=p,(m.neededForCoverage||m.isCoverage)&&(g=!0),m.isCoverage&&(f=!0))}if(_.selectedForRendering=!0,g){u.symbols.push(_),l.show=!0;for(const p of l.parts)p.show=!0}else l.show=!1}}for(const y of s)y.symbols.sort(qt);return!0}const n=this._symbolLayerSorter;return{work:o,get sortedSymbols(){return s.sort(n)}}}_createOpacityJob(){const e=this._assignTileSymbolsOpacity,s=this._visibleTiles;let t=0;function i(r,o){const n=r.symbols;for(const[a,l]of n)Bt(l,o);e(r,o);for(const a of r.childrenTiles)i(a,o)}return{work(r){const o=performance.now();for(;tr)return!1;const n=s[t];n.parentTile==null&&i(n,performance.now())}return!0}}}}function Bt(h,e){for(const s of h){const t=s.unique;for(const i of t.parts){const r=i.targetOpacity>.5?1:-1;i.startOpacity+=r*((e-i.startTime)/Q),i.startOpacity=Math.min(Math.max(i.startOpacity,0),1),i.startTime=e,i.targetOpacity=t.show&&i.show?1:0}}}const Nt=32,Wt=8,Qt=64;class Jt{constructor(e,s,t){this.tileCoordRange=e,this._visibleTiles=s,this._createUnique=t,this._tiles=new Map,this._uniqueSymbolsReferences=new Map}get uniqueSymbols(){return this._uniqueSymbolLayerArray==null&&(this._uniqueSymbolLayerArray=this._createUniqueSymbolLayerArray()),this._uniqueSymbolLayerArray}get uniqueSymbolsReferences(){return this._uniqueSymbolsReferences}add(e,s){this._uniqueSymbolLayerArray=null;let t=this._tiles.get(e.id);t||(t={symbols:new Map},this._tiles.set(e.id,t));const i=new Map;if(s)for(const n of s)t.symbols.has(n)&&(i.set(n,t.symbols.get(n)),t.symbols.delete(n));else for(const[n,a]of e.layerData)t.symbols.has(n)&&(i.set(n,t.symbols.get(n)),t.symbols.delete(n));this._removeSymbols(i);const r=e.symbols,o=new Map;for(const[n,a]of r){let l=a.length;if(l>=Nt){let c=this.tileCoordRange;do c/=2,l/=4;while(l>Wt&&c>Qt);const y=new ke(this.tileCoordRange,this.tileCoordRange,c);o.set(n,{flat:a,index:y}),t.symbols.set(n,{flat:a,index:y});for(const d of a)y.getCell(d.xTile,d.yTile).push(d)}else o.set(n,{flat:a}),t.symbols.set(n,{flat:a})}this._addSymbols(e.key,r)}deleteStyleLayers(e){this._uniqueSymbolLayerArray=null;for(const[s,t]of this._tiles){const i=new Map;for(const r of e)t.symbols.has(r)&&(i.set(r,t.symbols.get(r)),t.symbols.delete(r));this._removeSymbols(i),t.symbols.size===0&&this._tiles.delete(s)}}removeTile(e){this._uniqueSymbolLayerArray=null;const s=this._tiles.get(e.id);if(!s)return;const t=new Map;for(const[i,r]of e.symbols)s.symbols.has(i)&&(t.set(i,s.symbols.get(i)),s.symbols.delete(i));this._removeSymbols(t),s.symbols.size===0&&this._tiles.delete(e.id)}querySymbols(e,s,t,i){const r=[],o=this.uniqueSymbols;for(const n of o){const a=n.styleLayerUID,l=n.uniqueSymbols;for(const c of l){const y=c.tileSymbols.find(d=>d.selectedForRendering);y&&Mt(y,e,s*(window.devicePixelRatio||1),t)&&r.push({vtlSymbol:y,styleLayerUID:a,tileKey:y.tile.key})}}return r}_removeSymbols(e){for(const[s,{flat:t}]of e)for(const i of t){const r=i.unique,o=r.tileSymbols,n=o.length-1;for(let a=0;as.level){const r=e.key.level-s.level;if(e.key.row>>r!==s.row||e.key.col>>r!==s.col)return}if(s.level>e.key.level){const r=s.level-e.key.level;if(s.row>>r!==e.key.row||s.col>>r!==e.key.col)return}if(s.equals(e.key)){for(const r of e.childrenTiles)this._matchSymbols(r,s,t);return}const i=new Map;for(const[r,o]of t){const n=[];for(const y of o){const d=we(this.tileCoordRange,y.xTile,s.level,s.col,e.key.level,e.key.col),u=we(this.tileCoordRange,y.yTile,s.level,s.row,e.key.level,e.key.row);d>=0&&d=0&&u0&&i.set(r,a)}for(const r of e.childrenTiles)this._matchSymbols(r,s,i)}_createUniqueSymbolLayerArray(){const e=this._uniqueSymbolsReferences,s=new Array(e.size);let t,i=0;for(const[r,o]of e){const n=new Array(o.size);t=0;for(const a of o)n[t++]=a;s[i]={styleLayerUID:r,uniqueSymbols:n},i++}return s}}const Kt=.5,Se=1e-6;class Gt{constructor(e,s){this.styleRepository=e,this._tileToHandle=new Map,this._viewState={scale:0,rotation:0,center:[0,0],size:[0,0]},this._declutterViewState={scale:0,rotation:0,center:[0,0],size:[0,0]},this._offsetFromScreenCenter=[0,0],this._completed=!1,this._fading=Ze(!1),this._symbolRepository=new Jt(4096,s,()=>new Rt),this._symbolDeclutterer=new Ht(s,this._symbolRepository,(t,i,r)=>this._createCollisionJob(t,i,r),(t,i)=>{t.allSymbolsFadingOut=!0,t.lastOpacityUpdate=i,At(t,i,!0),t.decluttered=!0,t.requestRender()},(t,i)=>this.styleRepository.getStyleLayerByUID(t.styleLayerUID).z-this.styleRepository.getStyleLayerByUID(i.styleLayerUID).z,t=>{const i=this.styleRepository.getStyleLayerByUID(t);if(this._zoom+Se=i.maxzoom)return!1;const r=i.getLayoutProperty("visibility");return!r||r.getValue()!==Z.NONE})}get symbolRepository(){return this._symbolRepository}_createCollisionJob(e,s,t){return this.updateDecluttererViewState(),new Ft(e,s,t,this.styleRepository,this._zoom,this._viewState.rotation)}get fading(){return this._fading.value}get decluttererOffset(){return this._offsetFromScreenCenter}addTile(e){e.decluttered=!1,this._tileToHandle.set(e,e.on("symbols-changed",()=>{this._symbolRepository.add(e),this.restartDeclutter()})),this._symbolRepository.add(e),this.restartDeclutter()}removeTile(e){const s=this._tileToHandle.get(e);s&&(this._symbolRepository.removeTile(e),this.restartDeclutter(),s.remove(),this._tileToHandle.delete(e))}update(e,s){this._zoom=e,this._viewState={scale:s.scale,rotation:s.rotation,center:[s.center[0],s.center[1]],size:[s.size[0],s.size[1]]};const t=[0,0];s.toScreen(t,s.center);const i=[0,0];return s.toScreen(i,this._declutterViewState.center),this._offsetFromScreenCenter[0]=t[0]-i[0],this._offsetFromScreenCenter[1]=t[1]-i[1],this._continueDeclutter(),this._completed}restartDeclutter(){this._completed=!1,this._symbolDeclutterer.restart(),this._notifyUnstable()}clear(){this._completed=!1,this._symbolRepository=null,this._symbolDeclutterer.restart(),this._tileToHandle.forEach(e=>e.remove()),this._tileToHandle.clear()}get stale(){return this._zoom!==this._declutterZoom||this._viewState.size[0]!==this._declutterViewState.size[0]||this._viewState.size[1]!==this._declutterViewState.size[1]||this._viewState.scale!==this._declutterViewState.scale||this._viewState.rotation!==this._declutterViewState.rotation}deleteStyleLayers(e){this._symbolRepository.deleteStyleLayers(e)}_continueDeclutter(){this._completed&&!this.stale||(this._symbolDeclutterer.running||(this.updateDecluttererViewState(),this._symbolDeclutterer.restart()),this._symbolDeclutterer.setScreenSize(this._viewState.size[0],this._viewState.size[1]),this._completed=this._symbolDeclutterer.continue(dt),this._completed&&this._scheduleNotifyStable())}_scheduleNotifyStable(){this._stableNotificationHandle!=null&&clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=setTimeout(()=>{this._stableNotificationHandle=null,this._fading.value=!1},(1+Kt)*Q)}_notifyUnstable(){this._stableNotificationHandle!=null&&(clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=null),this._fading.value=!0}updateDecluttererViewState(){this._declutterZoom=this._zoom,this._declutterViewState.center[0]=this._viewState.center[0],this._declutterViewState.center[1]=this._viewState.center[1],this._declutterViewState.rotation=this._viewState.rotation,this._declutterViewState.scale=this._viewState.scale,this._declutterViewState.size[0]=this._viewState.size[0],this._declutterViewState.size[1]=this._viewState.size[1],this._offsetFromScreenCenter[0]=0,this._offsetFromScreenCenter[1]=0}}let Yt=class extends Me{_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z()}}};const J=1e-6;function xe(h,e){if(h){const s=h.getLayoutProperty("visibility");if(!s||s.getValue()!==Z.NONE&&(h.minzoom===void 0||h.minzoom=e-J))return!0}return!1}let jt=class extends _t{constructor(e){super(e),this._backgroundTiles=[],this._computeDisplayInfoView(e)}destroy(){var e,s;this.removeAllChildren(),(e=this._spriteMosaic)==null||e.dispose(),this._spriteMosaic=null,(s=this._glyphMosaic)==null||s.dispose(),this._glyphMosaic=null,this._symbolFader!=null&&(this._symbolFader.clear(),this._symbolFader=null),this._styleRepository=null,this._backgroundTiles=[]}get fading(){var e;return((e=this._symbolFader)==null?void 0:e.fading)??!1}get symbolFader(){return this._symbolFader}get symbolRepository(){var e;return(e=this._symbolFader)==null?void 0:e.symbolRepository}setStyleResources(e,s,t,i){this._spriteMosaic=e,this._glyphMosaic=s,this._styleRepository=t,this._tileInfoView=i,this._computeDisplayInfoView(i),this._symbolFader==null&&(this._symbolFader=new Gt(this._styleRepository,this.children)),this._symbolFader.styleRepository=t}setSpriteMosaic(e){var s;(s=this._spriteMosaic)==null||s.dispose(),this._spriteMosaic=e}deleteStyleLayers(e){this._symbolFader!=null&&this._symbolFader.deleteStyleLayers(e)}createRenderParams(e){return{...super.createRenderParams(e),renderPass:null,styleLayer:null,styleLayerUID:-1,glyphMosaic:this._glyphMosaic,spriteMosaic:this._spriteMosaic,hasClipping:!!this._clippingInfos}}doRender(e){!this.visible||e.drawPhase!==N.MAP&&e.drawPhase!==N.DEBUG||this._spriteMosaic===void 0||super.doRender(e)}addChild(e){return super.addChild(e),this._symbolFader!=null?this._symbolFader.addTile(e):e.decluttered=!0,this.requestRender(),e}removeChild(e){return this._symbolFader!=null&&this._symbolFader.removeTile(e),this.requestRender(),super.removeChild(e)}renderChildren(e){const{drawPhase:s}=e;s!==N.DEBUG?this._doRender(e):super.renderChildren(e)}removeAllChildren(){for(let e=0;ee.neededForCoverage&&e.hasData())}restartDeclutter(){this._symbolFader!=null&&this._symbolFader.restartDeclutter()}_doRender(e){const{context:s,state:t}=e,i=this._styleRepository;if(!i)return;const r=i.layers,o=this._displayInfo.scaleToZoom(t.scale);i.backgroundBucketIds.length>0&&(e.renderPass="background",this._renderBackgroundLayers(e,i.backgroundBucketIds,o)),super.renderChildren(e),e.drawPhase===N.MAP&&this._fade(o,t);const n=this.children.filter(a=>a.visible&&a.hasData());if(!n||n.length===0)return s.bindVAO(),s.setStencilTestEnabled(!0),void s.setBlendingEnabled(!0);for(const a of n)a.triangleCount=0;s.setStencilWriteMask(0),s.setColorMask(!0,!0,!0,!0),s.setStencilOp(k.KEEP,k.KEEP,k.REPLACE),s.setStencilTestEnabled(!0),s.setBlendingEnabled(!1),s.setDepthTestEnabled(!0),s.setDepthWriteEnabled(!0),s.setDepthFunction(ae.LEQUAL),s.setClearDepth(1),s.clear(s.gl.DEPTH_BUFFER_BIT),e.renderPass="opaque";for(let a=r.length-1;a>=0;a--)this._renderStyleLayer(r[a],e,n);s.setDepthWriteEnabled(!1),s.setBlendingEnabled(!0),s.setBlendFunctionSeparate(B.ONE,B.ONE_MINUS_SRC_ALPHA,B.ONE,B.ONE_MINUS_SRC_ALPHA),e.renderPass="translucent";for(let a=0;ac.decluttered):t.filter(c=>c.neededForCoverage),a!=="vtlSymbol"&&(t.length===0||e.minzoom!==void 0&&e.minzoom>=i+J||e.maxzoom!==void 0&&e.maxzoom{const s=h.vtlSymbol.sourceTile,t=e.vtlSymbol.sourceTile;return s.level!==t.level?s.level-t.level:s.row!==t.row?s.row-t.row:s.col!==t.col?s.col-t.col:h.styleLayerUID-e.styleLayerUID};class ee{constructor(e,s,t,i,r){this.tileKey=e,this._index=null,this._styleRepository=null,this._tileHandler=null,this._tileKeyToPBF=new Map,this._tileLayerData=s,this._styleRepository=t,this._tileHandler=i,this._parentLayer=r}static create(e,s,t,i,r){return new ee(e,s,t,i,r)}clear(){var e;(e=this._index)==null||e.clear(),this._tileKeyToPBF.clear()}async queryAttributes(e,s,t,i,r){if(this._tileLayerData.size===0||!this._styleRepository||!this._tileHandler)return[];this._index===null&&(this._index=new ft(100,ts),await this._indexLayers());const o=[];return this._queryIndex(o,e,s,t,this.tileKey.level,i),r&&(r==null?void 0:r.length)>0&&await this._getSymbolsAttributes(o,r),o}async _indexLayers(){const e=this.tileKey,s=this._styleRepository.layers,t=await this._getTilePayload(e);for(const[i,r]of this._tileLayerData){const o=s[i],n=t.find(c=>c.sourceName===o.source);if(!n)continue;const{protobuff:a,key:l}=n;if(r.type!==L.SYMBOL){const c=1<=10*c||ie&&ie<=10*l)continue;const T=e.getFeatureInflatedBounds(H,l,_.extent,I);T==null||T[0]>b||T[1]>S||T[2]y.sourceName===n.source),a&&this._addSymbolsAttributes(e,s.slice(l.from,l.to).map(y=>y.vtlSymbol),i,a)}return e}_addSymbolsAttributes(e,s,t,i){const r=this._styleRepository.layers,o=i.key,n=this.tileKey,a=1<{const{attributes:d,tilePoint:u}=y;e.push({layerId:r[t].id,layerIndex:t,graphic:new le({attributes:d,origin:{type:"vector-tile",layerId:r[t].id,layerIndex:t,layer:this._parentLayer}}),tilePoint:u})})}_getSymbolAttributes(e,s,t,i,r,o){const n=[],a=this._styleRepository.layers;let l=0;s.sort((y,d)=>y.featureIndex-d.featureIndex);const c=new X(new Uint8Array(e),new DataView(e));for(;c.next();)switch(c.tag()){case 3:{const y=c.getMessage(),d=new de(y);if(y.release(),d.name!==a[t].sourceLayer)continue;const u=d.getData(),_=d.extent/i,f=Ie/_,g=_*o,p=_*r;let m=0;for(;u.nextTag(2);){const b=u.getMessage();if(m++===s[l].featureIndex){const S=new _e(b,d),I=S.values,w=S.getGeometry(),x=w!=null?[f*(w[0][0].x-g),f*(w[0][0].y-p)]:null;n.push({attributes:I,tilePoint:x}),l++}if(b.release(),l===s.length)return n}break}default:c.skip()}return n}_queryIndex(e,s,t,i,r,o){var a;const n=Xt*i*(window.devicePixelRatio||1);return(a=this._index)==null||a.search({minX:s-n,minY:t-n,maxX:s+n,maxY:t+n},l=>{const{layer:c,feature:y}=l;c.isIntersectingFeature(s,t,i,y,r,o,l)&&e.push({layerId:c.id,layerIndex:c.uid,tilePoint:null,graphic:new le({attributes:y.values,origin:{type:"vector-tile",layerId:l.layer.id,layerIndex:l.layer.uid,layer:this._parentLayer}})})}),e}async _getTilePayload(e){return tt(this._tileKeyToPBF,e.id,()=>this._tileHandler.fetchTilePBFs(e)).then(s=>s)}}const ts=h=>({minX:h.bounds[0],minY:h.bounds[1],maxX:h.bounds[2],maxY:h.bounds[3]});class Te extends it{constructor(){super(...arguments),this._fullCacheLodInfos=null,this._levelByScale={}}getTileParentId(e){const s=M.pool.acquire(e),t=s.level===0?null:M.getId(s.level-1,s.row>>1,s.col>>1,s.world);return M.pool.release(s),t}getTileCoverage(e,s,t=!0,i){const r=super.getTileCoverage(e,s,t,i);if(!r)return r;const o=1<n.row>=0&&n.rows[0].scale)return s[0].level;let t,i;for(let r=0;ri.scale)return t=s[r],t.level+(t.scale-e)/(t.scale-i.scale);return s[s.length-1].level}}_initializeFullCacheLODs(e){let s;if(e[0].level===0)s=e.map(t=>({level:t.level,resolution:t.resolution,scale:t.scale}));else{const t=this.tileInfo.size[0],i=this.tileInfo.spatialReference;s=Le.create({size:t,spatialReference:i}).lods.map(r=>({level:r.level,resolution:r.resolution,scale:r.scale}))}for(let t=0;tu.tileKey.id===d.id)));return await Promise.all(a),l}update(h){if(this._tileHandlerPromise&&this._isTileHandlerReady)return h.pixelRatio!==this._tileHandler.devicePixelRatio?(this._start(),void(this._tileHandler.devicePixelRatio=h.pixelRatio)):void(this._styleChanges.length>0?this._tileHandlerPromise=this._applyStyleChanges():(this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.state=h.state,this._parseQueue.state=h.state,this._tileManager.update(h)||this.requestUpdate(),this._parseQueue.resume(),this._fetchQueue.resume()))}attach(){const{style:h}=this.layer.currentStyleInfo;this._styleRepository=new he(h),this._tileInfoView=new Te(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new jt(this._tileInfoView),this._tileHandler=new St(this.layer,this._styleRepository,window.devicePixelRatio||1,this.layer.tileInfo.lods.length-1),this.container.addChild(this._vectorTileContainer),this._start(),this.addAttachHandles([this.layer.on("paint-change",e=>{var s,t;if(e.isDataDriven)this._styleChanges.push({type:v.PAINTER_CHANGED,data:e}),this.requestUpdate();else{const i=this._styleRepository,r=i.getLayerById(e.layer);if(!r)return;const o=r.type===D.SYMBOL;i.setPaintProperties(e.layer,e.paint),o&&((s=this._vectorTileContainer)==null||s.restartDeclutter()),(t=this._vectorTileContainer)==null||t.requestRender()}}),this.layer.on("layout-change",e=>{var r,o;const s=this._styleRepository,t=s.getLayerById(e.layer);if(!t)return;const i=ht(t.layout,e.layout);if(i!=null){if(ct(i,"visibility")&&ss(i)===1)return s.setLayoutProperties(e.layer,e.layout),t.type===D.SYMBOL&&((r=this._vectorTileContainer)==null||r.restartDeclutter()),void((o=this._vectorTileContainer)==null?void 0:o.requestRender());this._styleChanges.push({type:v.LAYOUT_CHANGED,data:e}),this.requestUpdate()}}),this.layer.on("style-layer-visibility-change",e=>{var i,r;const s=this._styleRepository,t=s.getLayerById(e.layer);t&&(s.setStyleLayerVisibility(e.layer,e.visibility),t.type===D.SYMBOL&&((i=this._vectorTileContainer)==null||i.restartDeclutter()),(r=this._vectorTileContainer)==null||r.requestRender())}),this.layer.on("style-layer-change",e=>{this._styleChanges.push({type:v.LAYER_CHANGED,data:e}),this.requestUpdate()}),this.layer.on("delete-style-layer",e=>{this._styleChanges.push({type:v.LAYER_REMOVED,data:e}),this.requestUpdate()}),this.layer.on("load-style",()=>this._loadStyle()),this.layer.on("spriteSource-change",e=>{this._styleChanges.push({type:v.SPRITES_CHANGED,data:e});const s=this._styleRepository.layers;for(const t of s)switch(t.type){case D.SYMBOL:t.getLayoutProperty("icon-image")&&this._styleChanges.push({type:v.LAYOUT_CHANGED,data:{layer:t.id,layout:t.layout}});break;case D.LINE:t.getPaintProperty("line-pattern")&&this._styleChanges.push({type:v.PAINTER_CHANGED,data:{layer:t.id,paint:t.paint,isDataDriven:t.isPainterDataDriven()}});break;case D.FILL:t.getLayoutProperty("fill-pattern")&&this._styleChanges.push({type:v.PAINTER_CHANGED,data:{layer:t.id,paint:t.paint,isDataDriven:t.isPainterDataDriven()}})}this.requestUpdate()})])}detach(){this._stop(),this.container.removeAllChildren(),this._vectorTileContainer=V(this._vectorTileContainer),this._tileHandler=V(this._tileHandler)}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(h){var e;return rt((e=this.layer.tileInfo)==null?void 0:e.spatialReference,h)}canResume(){let h=super.canResume();const{currentStyleInfo:e}=this.layer;if(h&&(e!=null&&e.layerDefinition)){const s=this.view.scale,{minScale:t,maxScale:i}=e.layerDefinition;e!=null&&e.layerDefinition&&(t&&ts&&(h=!1))}return h}isUpdating(){return this.fading}acquireTile(h){const e=this._createVectorTile(h);return this._updatingHandles.addPromise(this._fetchQueue.push(e.key).then(s=>this._parseQueue.push({key:e.key,data:s})).then(s=>{e.once("attach",()=>this.requestUpdate()),e.setData(s),this.requestUpdate()}).catch(s=>{j(s)||ce.getLogger(this).error(s)})),e}releaseTile(h){const e=h.key.id;this._fetchQueue.abort(e),this._parseQueue.abort(e),this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new be({acquireTile:s=>this.acquireTile(s),releaseTile:s=>this.releaseTile(s),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;const h=new AbortController,e=this._tileHandler.start({signal:h.signal}).then(()=>{this._fetchQueue=new ue({tileInfoView:this._tileInfoView,process:(s,t)=>this._getTileData(s,t),concurrency:15}),this._parseQueue=new ue({tileInfoView:this._tileInfoView,process:(s,t)=>this._parseTileData(s,t),concurrency:8}),this.requestUpdate(),this._isTileHandlerReady=!0});this._tileHandler.spriteMosaic.then(s=>{this._vectorTileContainer.setStyleResources(s,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this.requestUpdate()}),this._tileHandlerAbortController=h,this._tileHandlerPromise=e}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;const h=this._tileHandlerAbortController;h&&h.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue=V(this._fetchQueue),this._parseQueue=V(this._parseQueue),this._tileManager=V(this._tileManager),this._vectorTileContainer.removeAllChildren()}async _getTileData(h,e){return this._tileHandler.fetchTileData(h,e)}async _parseTileData(h,e){return this._tileHandler.parseTileData(h,e)}async _applyStyleChanges(){this._isTileHandlerReady=!1,this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.clear(),this._parseQueue.clear(),this._tileManager.clearCache();const h=this._styleChanges;try{await this._tileHandler.updateStyle(h)}catch(r){ce.getLogger(this).error("error applying vector-tiles style update",r.message),this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0}const e=this._styleRepository,s=new Set;h.forEach(r=>{if(r.type!==v.LAYER_REMOVED)return;const o=r.data,n=e.getLayerById(o.layer);n&&s.add(n.uid)});const t=new Set;h.forEach(r=>{let o;switch(r.type){case v.PAINTER_CHANGED:e.setPaintProperties(r.data.layer,r.data.paint),o=r.data.layer;break;case v.LAYOUT_CHANGED:e.setLayoutProperties(r.data.layer,r.data.layout),o=r.data.layer;break;case v.LAYER_REMOVED:return void e.deleteStyleLayer(r.data.layer);case v.LAYER_CHANGED:e.setStyleLayer(r.data.layer,r.data.index),o=r.data.layer.id;break;case v.SPRITES_CHANGED:this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(r.data.spriteSource))}if(o){const n=e.getLayerById(o);n&&t.add(n.uid)}});const i=this._vectorTileContainer.children;if(s.size>0){const r=Array.from(s);this._vectorTileContainer.deleteStyleLayers(r);for(const o of i)o.deleteLayerData(r)}if(this._fetchQueue.resume(),this._parseQueue.resume(),t.size>0){const r=Array.from(t),o=[];for(const n of i){const a=this._updatingHandles.addPromise(this._fetchQueue.push(n.key).then(l=>this._parseQueue.push({key:n.key,data:l,styleLayerUIDs:r})).then(l=>n.setData(l)));o.push(a)}await Promise.all(o)}this._styleChanges=[],this._isTileHandlerReady=!0,this.requestUpdate()}async _loadStyle(){const{style:h}=this.layer.currentStyleInfo,e=ot(h);this._isTileHandlerReady=!1,this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.clear(),this._parseQueue.clear(),this._styleRepository=new he(e),this._vectorTileContainer.destroy(),this._tileManager.clear(),this._tileHandlerAbortController.abort(),this._tileHandlerAbortController=new AbortController;const{signal:s}=this._tileHandlerAbortController;try{this._tileHandlerPromise=this._tileHandler.setStyle(this._styleRepository,e,this.layer.tileInfo.lods.length-1),await this._tileHandlerPromise}catch(r){if(!j(r))throw r}if(s.aborted)return this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0,void this.requestUpdate();const t=await this._tileHandler.spriteMosaic,i=this._vectorTileContainer;this._tileInfoView=new Te(this.layer.tileInfo,this.layer.fullExtent),i.setStyleResources(t,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this._tileManager=new be({acquireTile:r=>this.acquireTile(r),releaseTile:r=>this.releaseTile(r),tileInfoView:this._tileInfoView},this._vectorTileContainer),this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0,this.requestUpdate()}_createVectorTile(h){const e=this._tileInfoView.getTileBounds(F(),h),s=this._tileInfoView.getTileResolution(h.level);return new Vt(h,s,e[0],e[3],512,512,this._styleRepository)}async _queryTile(h,e,s,t,i,r){if(i.layerData.size===0)return;const o=this._ensureTileIndex(i),n=this._tileInfoView.getTileBounds(F(),i.key,!0),a=ve*De*((e.x-n[0])/(n[2]-n[0])),l=ve*De*(1-(e.y-n[1])/(n[3]-n[1])),c=await o.queryAttributes(a,l,s,t,r);for(const y of c)y.graphic.geometry=this._tileToMapPoint(y.tilePoint,i.transforms.tileUnitsToPixels),h.push({type:"graphic",layer:this.layer,graphic:y.graphic,mapPoint:e.clone()});h.sort((y,d)=>d.graphic.origin.layerIndex-y.graphic.origin.layerIndex)}_tileToMapPoint(h,e){if(!h)return null;const s=h[0]*e[0]+h[1]*e[3]+e[6],t=h[0]*e[1]+h[1]*e[4]+e[7],i=this.view.state,r=[0,0];return i.toMap(r,[s,t]),new nt({x:r[0],y:r[1],spatialReference:i.spatialReference})}_ensureTileIndex(h){let e=h.featureIndex;return e||(e=ee.create(h.key,h.layerData,this._styleRepository,this._tileHandler,this.layer),h.featureIndex=e),e}};function ss(h){if(h==null)return 0;switch(h.type){case"partial":return Object.keys(h.diff).length;case"complete":return Math.max(Object.keys(h.oldValue).length,Object.keys(h.newValue).length);case"collection":return Object.keys(h.added).length+Object.keys(h.changed).length+Object.keys(h.removed).length}}ye([at()],W.prototype,"_isTileHandlerReady",void 0),W=ye([lt("esri.views.2d.layers.VectorTileLayerView2D")],W);const Bs=W;export{Bs as default}; +import{v as Ee,D as Ce,M as Ve,eC as ze,bD as re,ec as $e,eN as Fe,ay as qe,a as M,b as j,dc as oe,ee as He,kz as Re,ag as Be,ai as F,io as Ne,jO as L,kA as We,fV as U,fX as C,kB as ne,eH as Qe,eI as Je,eK as Ke,f_ as Ge,eO as z,kC as Ye,jR as je,jF as O,kD as Xe,ji as Ze,kE as Z,iS as k,hf as ae,g4 as B,k0 as D,dZ as Le,kF as et,j as le,Z as tt,jZ as st,h as it,k2 as he,k1 as v,u as V,G as rt,s as ce,m as ue,aV as ot,aA as nt,d as ye,y as at,f as lt}from"./index-BjUNJPVf.js";import{m as ht,p as ct}from"./diffUtils-uUoMDFQS.js";import{t as P}from"./Rect-CUzevAry.js";import{e as Ae,m as Pe}from"./Texture-S4dD-WHn.js";import{n as X}from"./pbf-Du8sFEWo.js";import{i as ut}from"./rasterizingUtils-D-sJQSSt.js";import{h as R}from"./Program-DBsYtQ00.js";import{o as E}from"./ProgramTemplate-Ck2I0bIi.js";import{e as Q,t as yt,c as dt}from"./config-MDUrh2eL.js";import{r as Me}from"./WGLContainer-DgZNq7b0.js";import{E as N}from"./Container-_n5wCgez.js";import{i as _t}from"./TileContainer-Bs-vXdD_.js";import{s as ft}from"./PooledRBush-BlFOlUgK.js";import{e as de,s as _e}from"./SourceLayerData-CTiUdlGY.js";import{m as pt,u as gt}from"./LayerView-Bux7vAEn.js";import"./floatRGBA-Cs54GdjG.js";import"./constants-D5zmR9t2.js";import"./LabelMetric-BcUxDImF.js";import"./earcut-CWKXDqDj.js";import"./featureConversionUtils-BHhm7bvm.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./highlightReasons-BOU4mnPE.js";import"./scaleUtils-DWXMiS7R.js";let $=class{constructor(e,s){this._width=0,this._height=0,this._free=[],this._width=e,this._height=s,this._free.push(new P(0,0,e,s))}get width(){return this._width}get height(){return this._height}allocate(e,s){if(e>this._width||s>this._height)return new P;let t=null,i=-1;for(let r=0;re&&this._free.push(new P(t.x+e,t.y,t.width-e,s)),t.height>s&&this._free.push(new P(t.x,t.y+s,t.width,t.height-s))):(t.width>e&&this._free.push(new P(t.x+e,t.y,t.width-e,t.height)),t.height>s&&this._free.push(new P(t.x,t.y+s,e,t.height-s))),new P(t.x,t.y,e,s))}release(e){for(let s=0;s{const l=e+a;if(this._rangePromises.has(l))n.push(this._rangePromises.get(l));else{const c=i.getRange(e,a).then(()=>{this._rangePromises.delete(l)},()=>{this._rangePromises.delete(l)});this._rangePromises.set(l,c),n.push(c)}}),Promise.all(n).then(()=>{let a=this._glyphIndex[e];a||(a={},this._glyphIndex[e]=a);for(const l of s){const c=a[l];if(c){t[l]={sdf:!0,rect:c.rect,metrics:c.metrics,page:c.page,code:l};continue}const y=i.getGlyph(e,l);if(!(y!=null&&y.metrics))continue;const d=y.metrics;let u;if(d.width===0)u=new P(0,0,0,0);else{const f=d.width+6,g=d.height+2*3;let p=f%4?4-f%4:4,m=g%4?4-g%4:4;p===1&&(p=5),m===1&&(m=5),u=this._binPack.allocate(f+p,g+m),u.isEmpty&&(this._dirties[this._currentPage]||(this._glyphData[this._currentPage]=null),this._currentPage=this._glyphData.length,this._glyphData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(void 0),this._binPack=new $(this.width-4,this.height-4),u=this._binPack.allocate(f+p,g+m));const b=this._glyphData[this._currentPage],S=y.bitmap;let I,w;if(S)for(let x=0;x{t.addRange(s,new G(new X(new Uint8Array(n.data),new DataView(n.data))))}).catch(()=>{t.addRange(s,new G)})}return t.addRange(s,new G),Promise.resolve()}getGlyph(e,s){const t=this._getFontStack(e);if(!t)return;const i=Math.floor(s/256),r=t.getRange(i);return r?{metrics:r.getMetrics(s),bitmap:r.getBitmap(s)}:void 0}_getFontStack(e){let s=this._glyphInfo[e];return s||(s=this._glyphInfo[e]=new mt),s}},bt=class{constructor(e,s,t){this._array=e,this._start=s,this.length=t}at(e){return 0<=e&&e0&&(this._maxItemSize=t),this._binPack=new $(e-4,s-4)}destroy(){this.dispose()}dispose(){this._binPack=null,this._mosaicsData.length=0,this._mosaicRects={};for(const e of this._textures)e&&e.dispose();this._textures.length=0}getWidth(e){return e>=this._size.length?-1:this._size[e][0]}getHeight(e){return e>=this._size.length?-1:this._size[e][1]}getPageSize(e){return e>=this._size.length?null:this._size[e]}setSpriteSource(e){if(this.dispose(),this.pixelRatio=e.devicePixelRatio,this._mosaicsData.length===0){this._binPack=new $(this._pageWidth-4,this._pageHeight-4);const s=Math.floor(this._pageWidth),t=Math.floor(this._pageHeight),i=new Uint32Array(s*t);this._mosaicsData[0]=i,this._dirties.push(!0),this._size.push([this._pageWidth,this._pageHeight]),this._textures.push(void 0)}this._sprites=e}getSpriteItem(e,s=!1){let t,i,r=this._mosaicRects[e];if(r)return r;if(!this._sprites||this._sprites.loadStatus!=="loaded"||(e&&e.startsWith(wt)?([t,i]=this._rasterizeDash(e),s=!0):t=this._sprites.getSpriteInfo(e),!(t!=null&&t.width)||!t.height||t.width<0||t.height<0))return null;const o=t.width,n=t.height,[a,l,c]=this._allocateImage(o,n);return a.width<=0?null:(this._copy(a,t,l,c,s,i),r={type:"sprite",rect:a,width:o,height:n,sdf:t.sdf,simplePattern:!1,rasterizationScale:t.pixelRatio,page:l},this._mosaicRects[e]=r,r)}getSpriteItems(e){const s={};for(const t of e)s[t.name]=this.getSpriteItem(t.name,t.repeat);return s}getMosaicItemPosition(e,s){const t=this.getSpriteItem(e,s),i=t&&t.rect;if(!i)return null;i.width=t.width,i.height=t.height;const r=t.width,o=t.height,n=2;return{tl:[i.x+n,i.y+n],br:[i.x+n+r,i.y+n+o],page:t.page}}bind(e,s,t=0,i=0){if(t>=this._size.length||t>=this._mosaicsData.length)return;if(!this._textures[t]){const o=new Ae;o.wrapMode=Ce.CLAMP_TO_EDGE,o.width=this._size[t][0],o.height=this._size[t][1],this._textures[t]=new Pe(e,o,new Uint8Array(this._mosaicsData[t].buffer))}const r=this._textures[t];r.setSamplingMode(s),this._dirties[t]&&r.setData(new Uint8Array(this._mosaicsData[t].buffer)),e.bindTexture(r,i),this._dirties[t]=!1}static _copyBits(e,s,t,i,r,o,n,a,l,c,y){let d=i*s+t,u=a*o+n;if(y){u-=o;for(let _=-1;_<=c;_++,d=((_+c)%c+i)*s+t,u+=o)for(let f=-1;f<=l;f++)r[u+f]=e[d+(f+l)%l]}else for(let _=0;_=this._mosaicsData.length)return;const n=new Uint32Array(o?o.buffer:this._sprites.image.buffer),a=this._mosaicsData[t];a&&n||console.error("Source or target images are uninitialized!");const l=2,c=o?s.width:this._sprites.width;Oe._copyBits(n,c,s.x,s.y,a,i[0],e.x+l,e.y+l,s.width,s.height,r),this._dirties[t]=!0}_allocateImage(e,s){e+=2,s+=2;const t=Math.max(e,s);if(this._maxItemSize&&this._maxItemSizethis._spriteMosaic)}get glyphMosaic(){return this._glyphMosaic}async start(e){this._requestSprite(e);const s=this._layer.currentStyleInfo.glyphsUrl,t=new pe(s?re(s,{...this._layer.customParameters,token:this._layer.apiKey}):null);this._glyphMosaic=new fe(1024,1024,t),this._broadcastPromise=$e("WorkerTileHandler",{client:this,schedule:e.schedule,signal:e.signal}).then(i=>{var r;if(this._layer&&((r=this._connection)==null||r.close(),this._connection=i,this._layer&&!this._connection.closed)){const o=i.broadcast("setStyle",{style:this._layer.currentStyleInfo.style,sourceDataMaxLOD:this._sourceDataMaxLOD},e);Promise.all(o).catch(n=>Fe(n))}})}_requestSprite(e){var o,n;(o=this._spriteSourceAbortController)==null||o.abort();const s=new AbortController;this._spriteSourceAbortController=s;const t=e==null?void 0:e.signal;this._inputSignalEventListener&&((n=this._startOptionsInputSignal)==null||n.removeEventListener("abort",this._inputSignalEventListener)),this._startOptionsInputSignal=null,t&&(this._inputSignalEventListener=xt(s),t.addEventListener("abort",this._inputSignalEventListener,{once:!0}));const{signal:i}=s,r={...e,signal:i};this._spriteSourcePromise=this._layer.loadSpriteSource(this.devicePixelRatio,r),this._spriteSourcePromise.then(a=>{qe(i),this._spriteMosaic=new ge(1024,1024,250),this._spriteMosaic.setSpriteSource(a)})}async updateStyle(e){return await this._broadcastPromise,this._broadcastPromise=Promise.all(this._connection.broadcast("updateStyle",e)),this._broadcastPromise}setSpriteSource(e){const s=new ge(1024,1024,250);return s.setSpriteSource(e),this._spriteMosaic=s,this._spriteSourcePromise=Promise.resolve(e),this._spriteSourceAbortController=null,s}async setStyle(e,s,t){await this._broadcastPromise,this._styleRepository=e,this._sourceDataMaxLOD=t,this._requestSprite();const i=new pe(this._layer.currentStyleInfo.glyphsUrl?re(this._layer.currentStyleInfo.glyphsUrl,{...this._layer.customParameters,token:this._layer.apiKey}):null);return this._glyphMosaic=new fe(1024,1024,i),this._broadcastPromise=Promise.all(this._connection.broadcast("setStyle",{style:s,sourceDataMaxLOD:this._sourceDataMaxLOD})),this._broadcastPromise}async fetchTileData(e,s){const t=await this._getRefKeys(e,s);return this._getSourcesData(Object.keys(this._layer.sourceNameToSource),t,s)}async fetchTilePBFs(e){const s=Object.keys(this._layer.sourceNameToSource),t={},i=await this._getRefKeys(e,t),r=[],o=[];for(let n=0;n{r.push({...c,key:a})}),o.push(l)}return Promise.all(o).then(()=>r)}async parseTileData(e,s){const t=e&&e.data;if(!t)return null;const{sourceName2DataAndRefKey:i,transferList:r}=t;return Object.keys(i).length===0?null:this._broadcastPromise.then(()=>this._connection.invoke("createTileAndParse",{key:e.key.id,sourceName2DataAndRefKey:i,styleLayerUIDs:e.styleLayerUIDs},{...s,transferList:r}))}async getSprites(e){return await this._spriteSourcePromise,this._spriteMosaic.getSpriteItems(e)}getGlyphs(e){return this._glyphMosaic.getGlyphItems(e.font,e.codePoints)}async _getTilePayload(e,s,t){const i=M.pool.acquire(e.id),r=this._layer.sourceNameToSource[s],{level:o,row:n,col:a}=i;M.pool.release(i);try{return{protobuff:await r.requestTile(o,n,a,t),sourceName:s}}catch(l){if(j(l))throw l;return{protobuff:null,sourceName:s}}}async _getRefKeys(e,s){const t=this._layer.sourceNameToSource,i=new Array;for(const r in t){const o=t[r].getRefKey(e,s);i.push(o)}return oe(i)}_getSourcesData(e,s,t){const i=[];for(let r=0;r{const o={},n=[];for(let a=0;a0){const c=s[a].value.id;o[l.sourceName]={refKey:c,protobuff:l.protobuff},n.push(l.protobuff)}}return{sourceName2DataAndRefKey:o,transferList:n}})}};function xt(h){return()=>h.abort()}const me=512,It=1e-6,Tt=(h,e)=>h+1/(1<<2*e);let be=class{constructor(e,s){this._tiles=new Map,this._tileCache=new He(40,t=>t.dispose()),this._viewSize=[0,0],this._visibleTiles=new Map,this.acquireTile=e.acquireTile,this.releaseTile=e.releaseTile,this.tileInfoView=e.tileInfoView,this._container=s}destroy(){for(const[e,s]of this._tiles)s.dispose();this._tiles=null,this._tileCache.clear(),this._tileCache=null}update(e){this._updateCacheSize(e);const s=this.tileInfoView,t=s.getTileCoverage(e.state,0,!0,"smallest");if(!t)return!0;const{spans:i,lodInfo:r}=t,{level:o}=r,n=this._tiles,a=new Set,l=new Set;for(const{row:y,colFrom:d,colTo:u}of i)for(let _=d;_<=u;_++){const f=M.getId(o,y,r.normalizeCol(_),r.getWorldForColumn(_)),g=this._getOrAcquireTile(f);a.add(f),g.processed()?this._addToContainer(g):l.add(new M(f))}for(const[y,d]of n)d.isCoverage=a.has(y);for(const y of l)this._findPlaceholdersForMissingTiles(y,a);let c=!1;for(const[y,d]of n)d.neededForCoverage=a.has(y),d.neededForCoverage||d.isHoldingForFade&&s.intersects(t,d.key)&&a.add(y),d.isFading&&(c=!0);for(const[y,d]of this._tiles)a.has(y)||this._releaseTile(y);return Re.pool.release(t),!c}clear(){this._tiles.clear(),this._tileCache.clear(),this._visibleTiles.clear()}clearCache(){this._tileCache.clear()}getIntersectingTiles(e,s,t,i,r){const o=[0,0],n=[0,0];i.toMap(o,e-t,s+t),i.toMap(n,e+t,s-t);const a=Math.min(o[0],n[0]),l=Math.min(o[1],n[1]),c=Math.max(o[0],n[0]),y=Math.max(o[1],n[1]),d=Be(a,l,c,y),u=F(),_=[];for(const[f,g]of this._visibleTiles)this.tileInfoView.getTileBounds(u,g.key),Ne(d,u)&&_.push(g);if(r!=null&&r.length>0){const f=new Set(_.map(p=>p.id)),g=r.filter(p=>!f.has(p.tileKey.id)).map(p=>this._visibleTiles.get(p.tileKey.id)).filter(p=>p!==void 0);_.push(...g)}return _}_findPlaceholdersForMissingTiles(e,s){const t=[];for(const[r,o]of this._tiles)this._addPlaceholderChild(t,o,e,s);const i=t.reduce(Tt,0);Math.abs(1-i)0;){if(i--,r>>=1,o>>=1,t.level===i&&t.row===r&&t.col===o&&t.world===n)return!0;if(a.has(`${i}/${r}/${o}/${n}`))return!1}return!1}_updateCacheSize(e){const s=e.state.size;if(s[0]===this._viewSize[0]&&s[1]===this._viewSize[1])return;const t=Math.ceil(s[0]/me)+1,i=Math.ceil(s[1]/me)+1;this._viewSize[0]=s[0],this._viewSize[1]=s[1],this._tileCache.maxSize=5*t*i}};function vt(h){const[e,s,t,i]=h.split("/"),r=parseInt(e,10);return r===0?null:`${r-1}/${parseInt(s,10)>>1}/${parseInt(t,10)>>1}/${parseInt(i,10)}`}function Dt(h,e){const s=e.level-h.level;return h.row===e.row>>s&&h.col===e.col>>s&&h.world===e.world}let Ct=class{constructor(e,s){this.sourceTile=s,this.xTile=0,this.yTile=0,this.hash=0,this.priority=1,this.featureIndex=0,this.colliders=[],this.textVertexRanges=[],this.iconVertexRanges=[],this.tile=e}};class Rt{constructor(){this.tileSymbols=[],this.parts=[{startTime:0,startOpacity:0,targetOpacity:0,show:!1},{startTime:0,startOpacity:0,targetOpacity:0,show:!1}],this.show=!1}}function we(h,e,s,t,i,r){const o=s-i;if(o>=0)return(e>>o)+(t-(r<>o);const n=-o;return e-(r-(t<>n)<0){this.patternMap=new Map;for(let o=0;o0}triangleCount(){return this.lineIndexCount/3}doDestroy(){this.vao=U(this.vao)}doPrepareForRendering(e,s,t){const i=new Uint32Array(s),r=new Int32Array(i.buffer),o=i[t++],n=R.createVertex(e,C.STATIC_DRAW,new Int32Array(r.buffer,4*t,o));t+=o;const a=i[t++],l=R.createIndex(e,C.STATIC_DRAW,new Uint32Array(i.buffer,4*t,a));t+=a;const c=this.layer.lineMaterial;this.vao=new E(e,c.getAttributeLocations(),c.getLayoutInfo(),{geometry:n},l)}}let kt=class extends K{constructor(e,s){super(e,s),this.type=L.FILL,this.fillIndexStart=0,this.fillIndexCount=0,this.outlineIndexStart=0,this.outlineIndexCount=0;const t=new Uint32Array(e);let i=this.bufferDataOffset;this.fillIndexStart=t[i++],this.fillIndexCount=t[i++],this.outlineIndexStart=t[i++],this.outlineIndexCount=t[i++];const r=t[i++];if(r>0){this.patternMap=new Map;for(let o=0;o0||this.outlineIndexCount>0}triangleCount(){return(this.fillIndexCount+this.outlineIndexCount)/3}doDestroy(){this.fillVAO=U(this.fillVAO),this.outlineVAO=U(this.outlineVAO)}doPrepareForRendering(e,s,t){const i=new Uint32Array(s),r=new Int32Array(i.buffer),o=i[t++],n=R.createVertex(e,C.STATIC_DRAW,new Int32Array(r.buffer,4*t,o));t+=o;const a=i[t++],l=R.createIndex(e,C.STATIC_DRAW,new Uint32Array(i.buffer,4*t,a));t+=a;const c=i[t++],y=R.createVertex(e,C.STATIC_DRAW,new Int32Array(r.buffer,4*t,c));t+=c;const d=i[t++],u=R.createIndex(e,C.STATIC_DRAW,new Uint32Array(i.buffer,4*t,d));t+=d;const _=this.layer,f=_.fillMaterial,g=_.outlineMaterial;this.fillVAO=new E(e,f.getAttributeLocations(),f.getLayoutInfo(),{geometry:n},l),this.outlineVAO=new E(e,g.getAttributeLocations(),g.getLayoutInfo(),{geometry:y},u)}},Ut=class extends K{constructor(e,s,t){super(e,s),this.type=L.SYMBOL,this.iconPerPageElementsMap=new Map,this.glyphPerPageElementsMap=new Map,this.symbolInstances=[],this.isIconSDF=!1,this.opacityChanged=!1,this.lastOpacityUpdate=0,this.symbols=[];const i=new Uint32Array(e),r=new Int32Array(e),o=new Float32Array(e);let n=this.bufferDataOffset;this.isIconSDF=!!i[n++];const a=i[n++],l=i[n++],c=i[n++],y=new M(a,l,c,0),d=i[n++];for(let g=0;g0||this.glyphPerPageElementsMap.size>0}triangleCount(){let e=0;for(const[s,t]of this.iconPerPageElementsMap)e+=t[1];for(const[s,t]of this.glyphPerPageElementsMap)e+=t[1];return e/3}doDestroy(){this.iconVAO=U(this.iconVAO),this.textVAO=U(this.textVAO)}updateOpacityInfo(){if(!this.opacityChanged)return;this.opacityChanged=!1;const e=this.iconOpacity,s=this.iconVAO.vertexBuffers.opacity;e.length>0&&e.byteLength===s.usedMemory&&s.setSubData(e,0,0,e.length);const t=this.textOpacity,i=this.textVAO.vertexBuffers.opacity;t.length>0&&t.byteLength===i.usedMemory&&i.setSubData(t,0,0,t.length)}doPrepareForRendering(e,s,t){const i=new Uint32Array(s),r=new Int32Array(i.buffer),o=i[t++],n=R.createVertex(e,C.STATIC_DRAW,new Int32Array(r.buffer,4*t,o));t+=o;const a=i[t++],l=R.createIndex(e,C.STATIC_DRAW,new Uint32Array(i.buffer,4*t,a));t+=a;const c=i[t++],y=R.createVertex(e,C.STATIC_DRAW,new Int32Array(r.buffer,4*t,c));t+=c;const d=i[t++],u=R.createIndex(e,C.STATIC_DRAW,new Uint32Array(i.buffer,4*t,d));t+=d;const _=R.createVertex(e,C.STATIC_DRAW,this.iconOpacity.buffer),f=R.createVertex(e,C.STATIC_DRAW,this.textOpacity.buffer),g=this.layer,p=g.iconMaterial,m=g.textMaterial;this.iconVAO=new E(e,p.getAttributeLocations(),p.getLayoutInfo(),{geometry:n,opacity:_},l),this.textVAO=new E(e,m.getAttributeLocations(),m.getLayoutInfo(),{geometry:y,opacity:f},u)}},Et=class extends K{constructor(e,s){super(e,s),this.type=L.CIRCLE,this.circleIndexStart=0,this.circleIndexCount=0;const t=new Uint32Array(e);let i=this.bufferDataOffset;this.circleIndexStart=t[i++],this.circleIndexCount=t[i++],this.bufferDataOffset=i}get memoryUsed(){var e,s;return(((e=this.data)==null?void 0:e.byteLength)??0)+(((s=this.vao)==null?void 0:s.usedMemory)??0)}hasData(){return this.circleIndexCount>0}triangleCount(){return this.circleIndexCount/3}doDestroy(){this.vao=U(this.vao)}doPrepareForRendering(e,s,t){const i=new Uint32Array(s),r=new Int32Array(i.buffer),o=i[t++],n=R.createVertex(e,C.STATIC_DRAW,new Int32Array(r.buffer,4*t,o));t+=o;const a=i[t++],l=R.createIndex(e,C.STATIC_DRAW,new Uint32Array(i.buffer,4*t,a));t+=a;const c=this.layer.circleMaterial;this.vao=new E(e,c.getAttributeLocations(),c.getLayoutInfo(),{geometry:n},l)}},Vt=class Ue extends Me{constructor(e,s,t,i,r,o,n,a=null){super(e,s,t,i,r,o,4096,4096),this.styleRepository=n,this._memCache=a,this.type="vector-tile",this._referenced=0,this._hasSymbolBuckets=!1,this._memoryUsedByLayerData=0,this.layerData=new Map,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.parentTile=null,this.childrenTiles=new Set,this.featureIndex=null,this.triangleCount=0,this._processed=!1,this._referenced=1,this.id=e.id}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate0}dispose(){this.status!=="unloaded"&&(this.featureIndex=null,zt.delete(this),Ue._destroyRenderBuckets(this.layerData),this.layerData.clear(),this._memoryUsedByLayerData=0,this.destroy(),this.status="unloaded")}release(){return--this._referenced==0&&(this.dispose(),this.stage=null,!0)}retain(){++this._referenced}get referenced(){return this._referenced}get usedMemory(){return this._memoryUsedByLayerData+256}changeDataImpl(e){var t,i;(t=this.featureIndex)==null||t.clear();let s=!1;if(e){const{bucketsWithData:r,emptyBuckets:o}=e,n=this._createRenderBuckets(r);if(o&&o.byteLength>0){const a=new Uint32Array(o);for(const l of a)this._deleteLayerData(l)}for(const[a,l]of n)this._deleteLayerData(a),l.type===L.SYMBOL&&(this.symbols.set(a,l.symbols),s=!0),this._memoryUsedByLayerData+=l.memoryUsed,this.layerData.set(a,l);(i=this._memCache)==null||i.updateSize(this.key.id,this,this.usedMemory)}this._hasSymbolBuckets=!1;for(const[r,o]of this.layerData)o.type===L.SYMBOL&&(this._hasSymbolBuckets=!0);s&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(s){s.processDetach()},untrashDisplayObject:()=>!1}}setTransform(e){super.setTransform(e);const s=this.resolution/(e.resolution*e.pixelRatio),t=this.width/this.rangeX*s,i=this.height/this.rangeY*s,r=[0,0];e.toScreen(r,[this.x,this.y]);const o=this.transforms.tileUnitsToPixels;Qe(o),Je(o,o,r),Ke(o,o,Math.PI*e.rotation/180),Ge(o,o,[t,i,1])}_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z(),tileUnitsToPixels:z()}}static _destroyRenderBuckets(e){if(!e)return;const s=new Set;for(const t of e.values())s.has(t)||(t.destroy(),s.add(t));e.clear()}_createRenderBuckets(e){const s=new Map,t=new Map;for(const i of e){const r=this._deserializeBucket(i,t);for(const o of r.layerUIDs)s.set(o,r)}return s}_deserializeBucket(e,s){let t=s.get(e);if(t)return t;switch(new Uint32Array(e)[0]){case L.FILL:t=new kt(e,this.styleRepository);break;case L.LINE:t=new Ot(e,this.styleRepository);break;case L.SYMBOL:t=new Ut(e,this.styleRepository,this);break;case L.CIRCLE:t=new Et(e,this.styleRepository)}return s.set(e,t),t}_deleteLayerData(e){if(!this.layerData.has(e))return;const s=this.layerData.get(e);this._memoryUsedByLayerData-=s.memoryUsed,s.destroy(),this.layerData.delete(e)}};const zt=new Map;function $t(h,e,s,t,i,r){const{iconRotationAlignment:o,textRotationAlignment:n,iconTranslate:a,iconTranslateAnchor:l,textTranslate:c,textTranslateAnchor:y}=t;let d=0;for(const u of h.colliders){const[_,f]=u.partIndex===0?a:c,g=u.partIndex===0?l:y,p=u.minLod<=r&&r<=u.maxLod;d+=p?0:1,u.enabled=p,u.xScreen=u.xTile*i[0]+u.yTile*i[3]+i[6],u.yScreen=u.xTile*i[1]+u.yTile*i[4]+i[7],g===Xe.MAP?(u.xScreen+=s*_-e*f,u.yScreen+=e*_+s*f):(u.xScreen+=_,u.yScreen+=f),O.VIEWPORT===(u.partIndex===0?o:n)?(u.dxScreen=u.dxPixels,u.dyScreen=u.dyPixels):(u.dxScreen=s*(u.dxPixels+u.width/2)-e*(u.dyPixels+u.height/2)-u.width/2,u.dyScreen=e*(u.dxPixels+u.width/2)+s*(u.dyPixels+u.height/2)-u.height/2)}h.colliders.length>0&&d===h.colliders.length&&(h.unique.show=!1)}class Ft{constructor(e,s,t,i,r,o){this._symbols=e,this._styleRepository=i,this._zoom=r,this._currentLayerCursor=0,this._currentSymbolCursor=0,this._styleProps=new Map,this._allNeededMatrices=new Map,this._gridIndex=new ke(s,t,yt),this._si=Math.sin(Math.PI*o/180),this._co=Math.cos(Math.PI*o/180);for(const n of e)for(const a of n.symbols)this._allNeededMatrices.has(a.tile)||this._allNeededMatrices.set(a.tile,Ye(a.tile.transforms.tileUnitsToPixels))}work(e){const s=this._gridIndex;function t(r){const o=r.xScreen+r.dxScreen,n=r.yScreen+r.dyScreen,a=o+r.width,l=n+r.height,[c,y,d,u]=s.getCellSpan(o,n,a,l);for(let _=y;_<=u;_++)for(let f=c;f<=d;f++){const g=s.cells[_][f];for(const p of g){const m=p.xScreen+p.dxScreen,b=p.yScreen+p.dyScreen,S=m+p.width,I=b+p.height;if(!(aS||lI))return!0}}return!1}const i=performance.now();for(;this._currentLayerCursore)return!1;const n=r.symbols[this._currentSymbolCursor];if(!n.unique.show)continue;$t(n,this._si,this._co,o,this._allNeededMatrices.get(n.tile),this._zoom);const a=n.unique;if(!a.show)continue;const{iconAllowOverlap:l,iconIgnorePlacement:c,textAllowOverlap:y,textIgnorePlacement:d}=o;for(const u of n.colliders){if(!u.enabled)continue;const _=a.parts[u.partIndex];_.show&&!(u.partIndex?y:l)&&t(u)&&(u.hard?a.show=!1:_.show=!1)}if(a.show)for(const u of n.colliders){if(!u.enabled||(u.partIndex?d:c)||!a.parts[u.partIndex].show)continue;const _=u.xScreen+u.dxScreen,f=u.yScreen+u.dyScreen,g=_+u.width,p=f+u.height,[m,b,S,I]=this._gridIndex.getCellSpan(_,f,g,p);for(let w=b;w<=I;w++)for(let x=m;x<=S;x++)this._gridIndex.cells[w][x].push(u)}}}return!0}_getProperties(e){const s=this._styleProps.get(e);if(s)return s;const t=this._zoom,i=this._styleRepository.getStyleLayerByUID(e),r=i.getLayoutValue("symbol-placement",t)!==je.POINT;let o=i.getLayoutValue("icon-rotation-alignment",t);o===O.AUTO&&(o=r?O.MAP:O.VIEWPORT);let n=i.getLayoutValue("text-rotation-alignment",t);n===O.AUTO&&(n=r?O.MAP:O.VIEWPORT);const a=i.getPaintValue("icon-translate",t),l=i.getPaintValue("icon-translate-anchor",t),c=i.getPaintValue("text-translate",t),y=i.getPaintValue("text-translate-anchor",t),d={iconAllowOverlap:i.getLayoutValue("icon-allow-overlap",t),iconIgnorePlacement:i.getLayoutValue("icon-ignore-placement",t),textAllowOverlap:i.getLayoutValue("text-allow-overlap",t),textIgnorePlacement:i.getLayoutValue("text-ignore-placement",t),iconRotationAlignment:o,textRotationAlignment:n,iconTranslateAnchor:l,iconTranslate:a,textTranslateAnchor:y,textTranslate:c};return this._styleProps.set(e,d),d}}function qt(h,e){if(h.priority-e.priority)return h.priority-e.priority;const s=h.tile.key,t=e.tile.key;return s.world-t.world?s.world-t.world:s.level-t.level?s.level-t.level:s.row-t.row?s.row-t.row:s.col-t.col?s.col-t.col:h.xTile-e.xTile?h.xTile-e.xTile:h.yTile-e.yTile}class Ht{get running(){return this._running}constructor(e,s,t,i,r,o){this._visibleTiles=e,this._symbolRepository=s,this._createCollisionJob=t,this._assignTileSymbolsOpacity=i,this._symbolLayerSorter=r,this._isLayerVisible=o,this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}setScreenSize(e,s){this._screenWidth===e&&this._screenHeight===s||this.restart(),this._screenWidth=e,this._screenHeight=s}restart(){this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}continue(e){if(this._selectionJob||(this._selectionJob=this._createSelectionJob()),!this._selectionJobCompleted){const s=performance.now();if(!this._selectionJob.work(e)||(this._selectionJobCompleted=!0,(e=Math.max(0,e-(performance.now()-s)))===0))return!1}if(this._collisionJob||(this._collisionJob=this._createCollisionJob(this._selectionJob.sortedSymbols,this._screenWidth,this._screenHeight)),!this._collisionJobCompleted){const s=performance.now();if(!this._collisionJob.work(e)||(this._collisionJobCompleted=!0,(e=Math.max(0,e-(performance.now()-s)))===0))return!1}if(this._opacityJob||(this._opacityJob=this._createOpacityJob()),!this._opacityJobCompleted){const s=performance.now();if(!this._opacityJob.work(e)||(this._opacityJobCompleted=!0,(e=Math.max(0,e-(performance.now()-s)))===0))return!1}return this._running=!1,!0}_createSelectionJob(){const e=this._symbolRepository.uniqueSymbols;for(let a=0;aa)return!1;let _=null,f=!1,g=!1;for(const p of l.tileSymbols)if(!g||!f){const m=p.tile;(!_||m.isCoverage||m.neededForCoverage&&!f)&&(_=p,(m.neededForCoverage||m.isCoverage)&&(g=!0),m.isCoverage&&(f=!0))}if(_.selectedForRendering=!0,g){u.symbols.push(_),l.show=!0;for(const p of l.parts)p.show=!0}else l.show=!1}}for(const y of s)y.symbols.sort(qt);return!0}const n=this._symbolLayerSorter;return{work:o,get sortedSymbols(){return s.sort(n)}}}_createOpacityJob(){const e=this._assignTileSymbolsOpacity,s=this._visibleTiles;let t=0;function i(r,o){const n=r.symbols;for(const[a,l]of n)Bt(l,o);e(r,o);for(const a of r.childrenTiles)i(a,o)}return{work(r){const o=performance.now();for(;tr)return!1;const n=s[t];n.parentTile==null&&i(n,performance.now())}return!0}}}}function Bt(h,e){for(const s of h){const t=s.unique;for(const i of t.parts){const r=i.targetOpacity>.5?1:-1;i.startOpacity+=r*((e-i.startTime)/Q),i.startOpacity=Math.min(Math.max(i.startOpacity,0),1),i.startTime=e,i.targetOpacity=t.show&&i.show?1:0}}}const Nt=32,Wt=8,Qt=64;class Jt{constructor(e,s,t){this.tileCoordRange=e,this._visibleTiles=s,this._createUnique=t,this._tiles=new Map,this._uniqueSymbolsReferences=new Map}get uniqueSymbols(){return this._uniqueSymbolLayerArray==null&&(this._uniqueSymbolLayerArray=this._createUniqueSymbolLayerArray()),this._uniqueSymbolLayerArray}get uniqueSymbolsReferences(){return this._uniqueSymbolsReferences}add(e,s){this._uniqueSymbolLayerArray=null;let t=this._tiles.get(e.id);t||(t={symbols:new Map},this._tiles.set(e.id,t));const i=new Map;if(s)for(const n of s)t.symbols.has(n)&&(i.set(n,t.symbols.get(n)),t.symbols.delete(n));else for(const[n,a]of e.layerData)t.symbols.has(n)&&(i.set(n,t.symbols.get(n)),t.symbols.delete(n));this._removeSymbols(i);const r=e.symbols,o=new Map;for(const[n,a]of r){let l=a.length;if(l>=Nt){let c=this.tileCoordRange;do c/=2,l/=4;while(l>Wt&&c>Qt);const y=new ke(this.tileCoordRange,this.tileCoordRange,c);o.set(n,{flat:a,index:y}),t.symbols.set(n,{flat:a,index:y});for(const d of a)y.getCell(d.xTile,d.yTile).push(d)}else o.set(n,{flat:a}),t.symbols.set(n,{flat:a})}this._addSymbols(e.key,r)}deleteStyleLayers(e){this._uniqueSymbolLayerArray=null;for(const[s,t]of this._tiles){const i=new Map;for(const r of e)t.symbols.has(r)&&(i.set(r,t.symbols.get(r)),t.symbols.delete(r));this._removeSymbols(i),t.symbols.size===0&&this._tiles.delete(s)}}removeTile(e){this._uniqueSymbolLayerArray=null;const s=this._tiles.get(e.id);if(!s)return;const t=new Map;for(const[i,r]of e.symbols)s.symbols.has(i)&&(t.set(i,s.symbols.get(i)),s.symbols.delete(i));this._removeSymbols(t),s.symbols.size===0&&this._tiles.delete(e.id)}querySymbols(e,s,t,i){const r=[],o=this.uniqueSymbols;for(const n of o){const a=n.styleLayerUID,l=n.uniqueSymbols;for(const c of l){const y=c.tileSymbols.find(d=>d.selectedForRendering);y&&Mt(y,e,s*(window.devicePixelRatio||1),t)&&r.push({vtlSymbol:y,styleLayerUID:a,tileKey:y.tile.key})}}return r}_removeSymbols(e){for(const[s,{flat:t}]of e)for(const i of t){const r=i.unique,o=r.tileSymbols,n=o.length-1;for(let a=0;as.level){const r=e.key.level-s.level;if(e.key.row>>r!==s.row||e.key.col>>r!==s.col)return}if(s.level>e.key.level){const r=s.level-e.key.level;if(s.row>>r!==e.key.row||s.col>>r!==e.key.col)return}if(s.equals(e.key)){for(const r of e.childrenTiles)this._matchSymbols(r,s,t);return}const i=new Map;for(const[r,o]of t){const n=[];for(const y of o){const d=we(this.tileCoordRange,y.xTile,s.level,s.col,e.key.level,e.key.col),u=we(this.tileCoordRange,y.yTile,s.level,s.row,e.key.level,e.key.row);d>=0&&d=0&&u0&&i.set(r,a)}for(const r of e.childrenTiles)this._matchSymbols(r,s,i)}_createUniqueSymbolLayerArray(){const e=this._uniqueSymbolsReferences,s=new Array(e.size);let t,i=0;for(const[r,o]of e){const n=new Array(o.size);t=0;for(const a of o)n[t++]=a;s[i]={styleLayerUID:r,uniqueSymbols:n},i++}return s}}const Kt=.5,Se=1e-6;class Gt{constructor(e,s){this.styleRepository=e,this._tileToHandle=new Map,this._viewState={scale:0,rotation:0,center:[0,0],size:[0,0]},this._declutterViewState={scale:0,rotation:0,center:[0,0],size:[0,0]},this._offsetFromScreenCenter=[0,0],this._completed=!1,this._fading=Ze(!1),this._symbolRepository=new Jt(4096,s,()=>new Rt),this._symbolDeclutterer=new Ht(s,this._symbolRepository,(t,i,r)=>this._createCollisionJob(t,i,r),(t,i)=>{t.allSymbolsFadingOut=!0,t.lastOpacityUpdate=i,At(t,i,!0),t.decluttered=!0,t.requestRender()},(t,i)=>this.styleRepository.getStyleLayerByUID(t.styleLayerUID).z-this.styleRepository.getStyleLayerByUID(i.styleLayerUID).z,t=>{const i=this.styleRepository.getStyleLayerByUID(t);if(this._zoom+Se=i.maxzoom)return!1;const r=i.getLayoutProperty("visibility");return!r||r.getValue()!==Z.NONE})}get symbolRepository(){return this._symbolRepository}_createCollisionJob(e,s,t){return this.updateDecluttererViewState(),new Ft(e,s,t,this.styleRepository,this._zoom,this._viewState.rotation)}get fading(){return this._fading.value}get decluttererOffset(){return this._offsetFromScreenCenter}addTile(e){e.decluttered=!1,this._tileToHandle.set(e,e.on("symbols-changed",()=>{this._symbolRepository.add(e),this.restartDeclutter()})),this._symbolRepository.add(e),this.restartDeclutter()}removeTile(e){const s=this._tileToHandle.get(e);s&&(this._symbolRepository.removeTile(e),this.restartDeclutter(),s.remove(),this._tileToHandle.delete(e))}update(e,s){this._zoom=e,this._viewState={scale:s.scale,rotation:s.rotation,center:[s.center[0],s.center[1]],size:[s.size[0],s.size[1]]};const t=[0,0];s.toScreen(t,s.center);const i=[0,0];return s.toScreen(i,this._declutterViewState.center),this._offsetFromScreenCenter[0]=t[0]-i[0],this._offsetFromScreenCenter[1]=t[1]-i[1],this._continueDeclutter(),this._completed}restartDeclutter(){this._completed=!1,this._symbolDeclutterer.restart(),this._notifyUnstable()}clear(){this._completed=!1,this._symbolRepository=null,this._symbolDeclutterer.restart(),this._tileToHandle.forEach(e=>e.remove()),this._tileToHandle.clear()}get stale(){return this._zoom!==this._declutterZoom||this._viewState.size[0]!==this._declutterViewState.size[0]||this._viewState.size[1]!==this._declutterViewState.size[1]||this._viewState.scale!==this._declutterViewState.scale||this._viewState.rotation!==this._declutterViewState.rotation}deleteStyleLayers(e){this._symbolRepository.deleteStyleLayers(e)}_continueDeclutter(){this._completed&&!this.stale||(this._symbolDeclutterer.running||(this.updateDecluttererViewState(),this._symbolDeclutterer.restart()),this._symbolDeclutterer.setScreenSize(this._viewState.size[0],this._viewState.size[1]),this._completed=this._symbolDeclutterer.continue(dt),this._completed&&this._scheduleNotifyStable())}_scheduleNotifyStable(){this._stableNotificationHandle!=null&&clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=setTimeout(()=>{this._stableNotificationHandle=null,this._fading.value=!1},(1+Kt)*Q)}_notifyUnstable(){this._stableNotificationHandle!=null&&(clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=null),this._fading.value=!0}updateDecluttererViewState(){this._declutterZoom=this._zoom,this._declutterViewState.center[0]=this._viewState.center[0],this._declutterViewState.center[1]=this._viewState.center[1],this._declutterViewState.rotation=this._viewState.rotation,this._declutterViewState.scale=this._viewState.scale,this._declutterViewState.size[0]=this._viewState.size[0],this._declutterViewState.size[1]=this._viewState.size[1],this._offsetFromScreenCenter[0]=0,this._offsetFromScreenCenter[1]=0}}let Yt=class extends Me{_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z()}}};const J=1e-6;function xe(h,e){if(h){const s=h.getLayoutProperty("visibility");if(!s||s.getValue()!==Z.NONE&&(h.minzoom===void 0||h.minzoom=e-J))return!0}return!1}let jt=class extends _t{constructor(e){super(e),this._backgroundTiles=[],this._computeDisplayInfoView(e)}destroy(){var e,s;this.removeAllChildren(),(e=this._spriteMosaic)==null||e.dispose(),this._spriteMosaic=null,(s=this._glyphMosaic)==null||s.dispose(),this._glyphMosaic=null,this._symbolFader!=null&&(this._symbolFader.clear(),this._symbolFader=null),this._styleRepository=null,this._backgroundTiles=[]}get fading(){var e;return((e=this._symbolFader)==null?void 0:e.fading)??!1}get symbolFader(){return this._symbolFader}get symbolRepository(){var e;return(e=this._symbolFader)==null?void 0:e.symbolRepository}setStyleResources(e,s,t,i){this._spriteMosaic=e,this._glyphMosaic=s,this._styleRepository=t,this._tileInfoView=i,this._computeDisplayInfoView(i),this._symbolFader==null&&(this._symbolFader=new Gt(this._styleRepository,this.children)),this._symbolFader.styleRepository=t}setSpriteMosaic(e){var s;(s=this._spriteMosaic)==null||s.dispose(),this._spriteMosaic=e}deleteStyleLayers(e){this._symbolFader!=null&&this._symbolFader.deleteStyleLayers(e)}createRenderParams(e){return{...super.createRenderParams(e),renderPass:null,styleLayer:null,styleLayerUID:-1,glyphMosaic:this._glyphMosaic,spriteMosaic:this._spriteMosaic,hasClipping:!!this._clippingInfos}}doRender(e){!this.visible||e.drawPhase!==N.MAP&&e.drawPhase!==N.DEBUG||this._spriteMosaic===void 0||super.doRender(e)}addChild(e){return super.addChild(e),this._symbolFader!=null?this._symbolFader.addTile(e):e.decluttered=!0,this.requestRender(),e}removeChild(e){return this._symbolFader!=null&&this._symbolFader.removeTile(e),this.requestRender(),super.removeChild(e)}renderChildren(e){const{drawPhase:s}=e;s!==N.DEBUG?this._doRender(e):super.renderChildren(e)}removeAllChildren(){for(let e=0;ee.neededForCoverage&&e.hasData())}restartDeclutter(){this._symbolFader!=null&&this._symbolFader.restartDeclutter()}_doRender(e){const{context:s,state:t}=e,i=this._styleRepository;if(!i)return;const r=i.layers,o=this._displayInfo.scaleToZoom(t.scale);i.backgroundBucketIds.length>0&&(e.renderPass="background",this._renderBackgroundLayers(e,i.backgroundBucketIds,o)),super.renderChildren(e),e.drawPhase===N.MAP&&this._fade(o,t);const n=this.children.filter(a=>a.visible&&a.hasData());if(!n||n.length===0)return s.bindVAO(),s.setStencilTestEnabled(!0),void s.setBlendingEnabled(!0);for(const a of n)a.triangleCount=0;s.setStencilWriteMask(0),s.setColorMask(!0,!0,!0,!0),s.setStencilOp(k.KEEP,k.KEEP,k.REPLACE),s.setStencilTestEnabled(!0),s.setBlendingEnabled(!1),s.setDepthTestEnabled(!0),s.setDepthWriteEnabled(!0),s.setDepthFunction(ae.LEQUAL),s.setClearDepth(1),s.clear(s.gl.DEPTH_BUFFER_BIT),e.renderPass="opaque";for(let a=r.length-1;a>=0;a--)this._renderStyleLayer(r[a],e,n);s.setDepthWriteEnabled(!1),s.setBlendingEnabled(!0),s.setBlendFunctionSeparate(B.ONE,B.ONE_MINUS_SRC_ALPHA,B.ONE,B.ONE_MINUS_SRC_ALPHA),e.renderPass="translucent";for(let a=0;ac.decluttered):t.filter(c=>c.neededForCoverage),a!=="vtlSymbol"&&(t.length===0||e.minzoom!==void 0&&e.minzoom>=i+J||e.maxzoom!==void 0&&e.maxzoom{const s=h.vtlSymbol.sourceTile,t=e.vtlSymbol.sourceTile;return s.level!==t.level?s.level-t.level:s.row!==t.row?s.row-t.row:s.col!==t.col?s.col-t.col:h.styleLayerUID-e.styleLayerUID};class ee{constructor(e,s,t,i,r){this.tileKey=e,this._index=null,this._styleRepository=null,this._tileHandler=null,this._tileKeyToPBF=new Map,this._tileLayerData=s,this._styleRepository=t,this._tileHandler=i,this._parentLayer=r}static create(e,s,t,i,r){return new ee(e,s,t,i,r)}clear(){var e;(e=this._index)==null||e.clear(),this._tileKeyToPBF.clear()}async queryAttributes(e,s,t,i,r){if(this._tileLayerData.size===0||!this._styleRepository||!this._tileHandler)return[];this._index===null&&(this._index=new ft(100,ts),await this._indexLayers());const o=[];return this._queryIndex(o,e,s,t,this.tileKey.level,i),r&&(r==null?void 0:r.length)>0&&await this._getSymbolsAttributes(o,r),o}async _indexLayers(){const e=this.tileKey,s=this._styleRepository.layers,t=await this._getTilePayload(e);for(const[i,r]of this._tileLayerData){const o=s[i],n=t.find(c=>c.sourceName===o.source);if(!n)continue;const{protobuff:a,key:l}=n;if(r.type!==L.SYMBOL){const c=1<=10*c||ie&&ie<=10*l)continue;const T=e.getFeatureInflatedBounds(H,l,_.extent,I);T==null||T[0]>b||T[1]>S||T[2]y.sourceName===n.source),a&&this._addSymbolsAttributes(e,s.slice(l.from,l.to).map(y=>y.vtlSymbol),i,a)}return e}_addSymbolsAttributes(e,s,t,i){const r=this._styleRepository.layers,o=i.key,n=this.tileKey,a=1<{const{attributes:d,tilePoint:u}=y;e.push({layerId:r[t].id,layerIndex:t,graphic:new le({attributes:d,origin:{type:"vector-tile",layerId:r[t].id,layerIndex:t,layer:this._parentLayer}}),tilePoint:u})})}_getSymbolAttributes(e,s,t,i,r,o){const n=[],a=this._styleRepository.layers;let l=0;s.sort((y,d)=>y.featureIndex-d.featureIndex);const c=new X(new Uint8Array(e),new DataView(e));for(;c.next();)switch(c.tag()){case 3:{const y=c.getMessage(),d=new de(y);if(y.release(),d.name!==a[t].sourceLayer)continue;const u=d.getData(),_=d.extent/i,f=Ie/_,g=_*o,p=_*r;let m=0;for(;u.nextTag(2);){const b=u.getMessage();if(m++===s[l].featureIndex){const S=new _e(b,d),I=S.values,w=S.getGeometry(),x=w!=null?[f*(w[0][0].x-g),f*(w[0][0].y-p)]:null;n.push({attributes:I,tilePoint:x}),l++}if(b.release(),l===s.length)return n}break}default:c.skip()}return n}_queryIndex(e,s,t,i,r,o){var a;const n=Xt*i*(window.devicePixelRatio||1);return(a=this._index)==null||a.search({minX:s-n,minY:t-n,maxX:s+n,maxY:t+n},l=>{const{layer:c,feature:y}=l;c.isIntersectingFeature(s,t,i,y,r,o,l)&&e.push({layerId:c.id,layerIndex:c.uid,tilePoint:null,graphic:new le({attributes:y.values,origin:{type:"vector-tile",layerId:l.layer.id,layerIndex:l.layer.uid,layer:this._parentLayer}})})}),e}async _getTilePayload(e){return tt(this._tileKeyToPBF,e.id,()=>this._tileHandler.fetchTilePBFs(e)).then(s=>s)}}const ts=h=>({minX:h.bounds[0],minY:h.bounds[1],maxX:h.bounds[2],maxY:h.bounds[3]});class Te extends it{constructor(){super(...arguments),this._fullCacheLodInfos=null,this._levelByScale={}}getTileParentId(e){const s=M.pool.acquire(e),t=s.level===0?null:M.getId(s.level-1,s.row>>1,s.col>>1,s.world);return M.pool.release(s),t}getTileCoverage(e,s,t=!0,i){const r=super.getTileCoverage(e,s,t,i);if(!r)return r;const o=1<n.row>=0&&n.rows[0].scale)return s[0].level;let t,i;for(let r=0;ri.scale)return t=s[r],t.level+(t.scale-e)/(t.scale-i.scale);return s[s.length-1].level}}_initializeFullCacheLODs(e){let s;if(e[0].level===0)s=e.map(t=>({level:t.level,resolution:t.resolution,scale:t.scale}));else{const t=this.tileInfo.size[0],i=this.tileInfo.spatialReference;s=Le.create({size:t,spatialReference:i}).lods.map(r=>({level:r.level,resolution:r.resolution,scale:r.scale}))}for(let t=0;tu.tileKey.id===d.id)));return await Promise.all(a),l}update(h){if(this._tileHandlerPromise&&this._isTileHandlerReady)return h.pixelRatio!==this._tileHandler.devicePixelRatio?(this._start(),void(this._tileHandler.devicePixelRatio=h.pixelRatio)):void(this._styleChanges.length>0?this._tileHandlerPromise=this._applyStyleChanges():(this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.state=h.state,this._parseQueue.state=h.state,this._tileManager.update(h)||this.requestUpdate(),this._parseQueue.resume(),this._fetchQueue.resume()))}attach(){const{style:h}=this.layer.currentStyleInfo;this._styleRepository=new he(h),this._tileInfoView=new Te(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new jt(this._tileInfoView),this._tileHandler=new St(this.layer,this._styleRepository,window.devicePixelRatio||1,this.layer.tileInfo.lods.length-1),this.container.addChild(this._vectorTileContainer),this._start(),this.addAttachHandles([this.layer.on("paint-change",e=>{var s,t;if(e.isDataDriven)this._styleChanges.push({type:v.PAINTER_CHANGED,data:e}),this.requestUpdate();else{const i=this._styleRepository,r=i.getLayerById(e.layer);if(!r)return;const o=r.type===D.SYMBOL;i.setPaintProperties(e.layer,e.paint),o&&((s=this._vectorTileContainer)==null||s.restartDeclutter()),(t=this._vectorTileContainer)==null||t.requestRender()}}),this.layer.on("layout-change",e=>{var r,o;const s=this._styleRepository,t=s.getLayerById(e.layer);if(!t)return;const i=ht(t.layout,e.layout);if(i!=null){if(ct(i,"visibility")&&ss(i)===1)return s.setLayoutProperties(e.layer,e.layout),t.type===D.SYMBOL&&((r=this._vectorTileContainer)==null||r.restartDeclutter()),void((o=this._vectorTileContainer)==null?void 0:o.requestRender());this._styleChanges.push({type:v.LAYOUT_CHANGED,data:e}),this.requestUpdate()}}),this.layer.on("style-layer-visibility-change",e=>{var i,r;const s=this._styleRepository,t=s.getLayerById(e.layer);t&&(s.setStyleLayerVisibility(e.layer,e.visibility),t.type===D.SYMBOL&&((i=this._vectorTileContainer)==null||i.restartDeclutter()),(r=this._vectorTileContainer)==null||r.requestRender())}),this.layer.on("style-layer-change",e=>{this._styleChanges.push({type:v.LAYER_CHANGED,data:e}),this.requestUpdate()}),this.layer.on("delete-style-layer",e=>{this._styleChanges.push({type:v.LAYER_REMOVED,data:e}),this.requestUpdate()}),this.layer.on("load-style",()=>this._loadStyle()),this.layer.on("spriteSource-change",e=>{this._styleChanges.push({type:v.SPRITES_CHANGED,data:e});const s=this._styleRepository.layers;for(const t of s)switch(t.type){case D.SYMBOL:t.getLayoutProperty("icon-image")&&this._styleChanges.push({type:v.LAYOUT_CHANGED,data:{layer:t.id,layout:t.layout}});break;case D.LINE:t.getPaintProperty("line-pattern")&&this._styleChanges.push({type:v.PAINTER_CHANGED,data:{layer:t.id,paint:t.paint,isDataDriven:t.isPainterDataDriven()}});break;case D.FILL:t.getLayoutProperty("fill-pattern")&&this._styleChanges.push({type:v.PAINTER_CHANGED,data:{layer:t.id,paint:t.paint,isDataDriven:t.isPainterDataDriven()}})}this.requestUpdate()})])}detach(){this._stop(),this.container.removeAllChildren(),this._vectorTileContainer=V(this._vectorTileContainer),this._tileHandler=V(this._tileHandler)}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(h){var e;return rt((e=this.layer.tileInfo)==null?void 0:e.spatialReference,h)}canResume(){let h=super.canResume();const{currentStyleInfo:e}=this.layer;if(h&&(e!=null&&e.layerDefinition)){const s=this.view.scale,{minScale:t,maxScale:i}=e.layerDefinition;e!=null&&e.layerDefinition&&(t&&ts&&(h=!1))}return h}isUpdating(){return this.fading}acquireTile(h){const e=this._createVectorTile(h);return this._updatingHandles.addPromise(this._fetchQueue.push(e.key).then(s=>this._parseQueue.push({key:e.key,data:s})).then(s=>{e.once("attach",()=>this.requestUpdate()),e.setData(s),this.requestUpdate()}).catch(s=>{j(s)||ce.getLogger(this).error(s)})),e}releaseTile(h){const e=h.key.id;this._fetchQueue.abort(e),this._parseQueue.abort(e),this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new be({acquireTile:s=>this.acquireTile(s),releaseTile:s=>this.releaseTile(s),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;const h=new AbortController,e=this._tileHandler.start({signal:h.signal}).then(()=>{this._fetchQueue=new ue({tileInfoView:this._tileInfoView,process:(s,t)=>this._getTileData(s,t),concurrency:15}),this._parseQueue=new ue({tileInfoView:this._tileInfoView,process:(s,t)=>this._parseTileData(s,t),concurrency:8}),this.requestUpdate(),this._isTileHandlerReady=!0});this._tileHandler.spriteMosaic.then(s=>{this._vectorTileContainer.setStyleResources(s,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this.requestUpdate()}),this._tileHandlerAbortController=h,this._tileHandlerPromise=e}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;const h=this._tileHandlerAbortController;h&&h.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue=V(this._fetchQueue),this._parseQueue=V(this._parseQueue),this._tileManager=V(this._tileManager),this._vectorTileContainer.removeAllChildren()}async _getTileData(h,e){return this._tileHandler.fetchTileData(h,e)}async _parseTileData(h,e){return this._tileHandler.parseTileData(h,e)}async _applyStyleChanges(){this._isTileHandlerReady=!1,this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.clear(),this._parseQueue.clear(),this._tileManager.clearCache();const h=this._styleChanges;try{await this._tileHandler.updateStyle(h)}catch(r){ce.getLogger(this).error("error applying vector-tiles style update",r.message),this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0}const e=this._styleRepository,s=new Set;h.forEach(r=>{if(r.type!==v.LAYER_REMOVED)return;const o=r.data,n=e.getLayerById(o.layer);n&&s.add(n.uid)});const t=new Set;h.forEach(r=>{let o;switch(r.type){case v.PAINTER_CHANGED:e.setPaintProperties(r.data.layer,r.data.paint),o=r.data.layer;break;case v.LAYOUT_CHANGED:e.setLayoutProperties(r.data.layer,r.data.layout),o=r.data.layer;break;case v.LAYER_REMOVED:return void e.deleteStyleLayer(r.data.layer);case v.LAYER_CHANGED:e.setStyleLayer(r.data.layer,r.data.index),o=r.data.layer.id;break;case v.SPRITES_CHANGED:this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(r.data.spriteSource))}if(o){const n=e.getLayerById(o);n&&t.add(n.uid)}});const i=this._vectorTileContainer.children;if(s.size>0){const r=Array.from(s);this._vectorTileContainer.deleteStyleLayers(r);for(const o of i)o.deleteLayerData(r)}if(this._fetchQueue.resume(),this._parseQueue.resume(),t.size>0){const r=Array.from(t),o=[];for(const n of i){const a=this._updatingHandles.addPromise(this._fetchQueue.push(n.key).then(l=>this._parseQueue.push({key:n.key,data:l,styleLayerUIDs:r})).then(l=>n.setData(l)));o.push(a)}await Promise.all(o)}this._styleChanges=[],this._isTileHandlerReady=!0,this.requestUpdate()}async _loadStyle(){const{style:h}=this.layer.currentStyleInfo,e=ot(h);this._isTileHandlerReady=!1,this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.clear(),this._parseQueue.clear(),this._styleRepository=new he(e),this._vectorTileContainer.destroy(),this._tileManager.clear(),this._tileHandlerAbortController.abort(),this._tileHandlerAbortController=new AbortController;const{signal:s}=this._tileHandlerAbortController;try{this._tileHandlerPromise=this._tileHandler.setStyle(this._styleRepository,e,this.layer.tileInfo.lods.length-1),await this._tileHandlerPromise}catch(r){if(!j(r))throw r}if(s.aborted)return this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0,void this.requestUpdate();const t=await this._tileHandler.spriteMosaic,i=this._vectorTileContainer;this._tileInfoView=new Te(this.layer.tileInfo,this.layer.fullExtent),i.setStyleResources(t,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this._tileManager=new be({acquireTile:r=>this.acquireTile(r),releaseTile:r=>this.releaseTile(r),tileInfoView:this._tileInfoView},this._vectorTileContainer),this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0,this.requestUpdate()}_createVectorTile(h){const e=this._tileInfoView.getTileBounds(F(),h),s=this._tileInfoView.getTileResolution(h.level);return new Vt(h,s,e[0],e[3],512,512,this._styleRepository)}async _queryTile(h,e,s,t,i,r){if(i.layerData.size===0)return;const o=this._ensureTileIndex(i),n=this._tileInfoView.getTileBounds(F(),i.key,!0),a=ve*De*((e.x-n[0])/(n[2]-n[0])),l=ve*De*(1-(e.y-n[1])/(n[3]-n[1])),c=await o.queryAttributes(a,l,s,t,r);for(const y of c)y.graphic.geometry=this._tileToMapPoint(y.tilePoint,i.transforms.tileUnitsToPixels),h.push({type:"graphic",layer:this.layer,graphic:y.graphic,mapPoint:e.clone()});h.sort((y,d)=>d.graphic.origin.layerIndex-y.graphic.origin.layerIndex)}_tileToMapPoint(h,e){if(!h)return null;const s=h[0]*e[0]+h[1]*e[3]+e[6],t=h[0]*e[1]+h[1]*e[4]+e[7],i=this.view.state,r=[0,0];return i.toMap(r,[s,t]),new nt({x:r[0],y:r[1],spatialReference:i.spatialReference})}_ensureTileIndex(h){let e=h.featureIndex;return e||(e=ee.create(h.key,h.layerData,this._styleRepository,this._tileHandler,this.layer),h.featureIndex=e),e}};function ss(h){if(h==null)return 0;switch(h.type){case"partial":return Object.keys(h.diff).length;case"complete":return Math.max(Object.keys(h.oldValue).length,Object.keys(h.newValue).length);case"collection":return Object.keys(h.added).length+Object.keys(h.changed).length+Object.keys(h.removed).length}}ye([at()],W.prototype,"_isTileHandlerReady",void 0),W=ye([lt("esri.views.2d.layers.VectorTileLayerView2D")],W);const Bs=W;export{Bs as default}; diff --git a/assets/Version-Bd0QsIQ5.js b/assets/Version-Dqq_CHBG.js similarity index 93% rename from assets/Version-Bd0QsIQ5.js rename to assets/Version-Dqq_CHBG.js index 270b329..510793e 100644 --- a/assets/Version-Bd0QsIQ5.js +++ b/assets/Version-Dqq_CHBG.js @@ -1 +1 @@ -import{N as s}from"./index-CEWggaxV.js";let c=class n{constructor(t,r,o=""){this.major=t,this.minor=r,this._context=o}lessThan(t,r){return this.majorthis.symbolColor,()=>{this._frameOutlineGraphic.symbol.outline.color=this.symbolColor,this._sensorTrailGraphic.symbol.color=this.symbolColor,this._lineOfSightGraphic.symbol.color=this.symbolColor,this._sensorLocationGraphic.symbol.color=this.symbolColor,this._frameCenterGraphic.symbol.color=this.symbolColor},y)),this._graphicsLayer.graphics.addMany([this._frameOutlineGraphic,this._sensorTrailGraphic,this._lineOfSightGraphic,this._sensorLocationGraphic,this._frameCenterGraphic]),this.visibleTelemetryElements=new u({frameCenter:((e=this.layer.telemetryDisplay)==null?void 0:e.frameCenter)??!0,frameOutline:((i=this.layer.telemetryDisplay)==null?void 0:i.frameOutline)??!0,lineOfSight:((s=this.layer.telemetryDisplay)==null?void 0:s.lineOfSight)??!0,sensorLocation:((l=this.layer.telemetryDisplay)==null?void 0:l.sensorLocation)??!0,sensorTrail:((o=this.layer.telemetryDisplay)==null?void 0:o.sensorTrail)??!0})}attach(){this.graphicsView=new C({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this._graphicsLayer.graphics,container:new O(this.view.featuresTilingScheme)}),this.container.addChild(this.graphicsView.container),this.addAttachHandles(this._graphicsLayer.on("graphic-update",this.graphicsView.graphicUpdateHandler)),this.addAttachHandles([p(()=>{var e,i,s,l,o;return[(e=this.layer.telemetryDisplay)==null?void 0:e.frameCenter,(i=this.layer.telemetryDisplay)==null?void 0:i.frameOutline,(s=this.layer.telemetryDisplay)==null?void 0:s.sensorLocation,(l=this.layer.telemetryDisplay)==null?void 0:l.sensorTrail,(o=this.layer.telemetryDisplay)==null?void 0:o.lineOfSight]},()=>this._updateVisibleTelemetryElements(),y),p(()=>{var e,i,s,l,o;return[this.layer.telemetry,(e=this.visibleTelemetryElements)==null?void 0:e.frameCenter,(i=this.visibleTelemetryElements)==null?void 0:i.frameOutline,(s=this.visibleTelemetryElements)==null?void 0:s.sensorLocation,(l=this.visibleTelemetryElements)==null?void 0:l.sensorTrail,(o=this.visibleTelemetryElements)==null?void 0:o.lineOfSight]},()=>this._updateGraphicGeometries(),y)])}detach(){this.container.removeAllChildren(),this.graphicsView=c(this.graphicsView)}supportsSpatialReference(e){return!0}moveStart(){}moveEnd(){}viewChange(){this.graphicsView.viewChange()}update(e){this.graphicsView.processUpdate(e)}isUpdating(){return!this.graphicsView||this.graphicsView.updating}_updateVisibleTelemetryElements(){this.visibleTelemetryElements&&this.layer.telemetryDisplay&&(this.visibleTelemetryElements.frameCenter=this.layer.telemetryDisplay.frameCenter,this.visibleTelemetryElements.frameOutline=this.layer.telemetryDisplay.frameOutline,this.visibleTelemetryElements.lineOfSight=this.layer.telemetryDisplay.lineOfSight,this.visibleTelemetryElements.sensorLocation=this.layer.telemetryDisplay.sensorLocation,this.visibleTelemetryElements.sensorTrail=this.layer.telemetryDisplay.sensorTrail)}_updateGraphicGeometries(){const{telemetry:e}=this.layer,{visibleTelemetryElements:i}=this;e&&i&&(i.frameOutline&&e.frameOutline?this._frameOutlineGraphic.geometry=this.layer.telemetry.frameOutline:this._frameOutlineGraphic.geometry=null,i.sensorTrail&&e.sensorTrail?this._sensorTrailGraphic.geometry=this.layer.telemetry.sensorTrail:this._sensorTrailGraphic.geometry=null,i.lineOfSight&&e.lineOfSight?this._lineOfSightGraphic.geometry=this.layer.telemetry.lineOfSight:this._lineOfSightGraphic.geometry=null,i.sensorLocation&&e.sensorLocation?this._sensorLocationGraphic.geometry=this.layer.telemetry.sensorLocation:this._sensorLocationGraphic.geometry=null,i.frameCenter&&e.frameCenter?this._frameCenterGraphic.geometry=this.layer.telemetry.frameCenter:this._frameCenterGraphic.geometry=null)}};t([r()],m.prototype,"graphicsView",void 0),t([r()],m.prototype,"layer",void 0),t([r()],m.prototype,"symbolColor",void 0),t([r({type:u})],m.prototype,"visibleTelemetryElements",void 0),m=t([f("esri.views.2d.layers.VideoLayerView2D")],m);const ye=m;export{ye as default}; +import{b4 as g,aU as d,d as t,y as r,f,a9 as b,j as h,u as c,g as p,P as y}from"./index-BjUNJPVf.js";import{h as T}from"./GraphicsLayer-g4hVfoZU.js";import{m as _,u as v}from"./LayerView-Bux7vAEn.js";import{t as O}from"./GraphicContainer-Bue3JF2r.js";import{$ as C}from"./GraphicsView2D-B7H8XAnI.js";import"./scaleUtils-DWXMiS7R.js";import"./Container-_n5wCgez.js";import"./highlightReasons-BOU4mnPE.js";import"./Texture-S4dD-WHn.js";import"./AGraphicContainer-BXk7Eu6w.js";import"./TechniqueInstance-XtnK2qy2.js";import"./UpdateTracking2D-Ds_Gdrxd.js";import"./TurboLine-DNQdPIXo.js";import"./earcut-CWKXDqDj.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./utils-CuXO_Zzq.js";import"./Rect-CUzevAry.js";import"./LabelMetric-BcUxDImF.js";import"./Program-DBsYtQ00.js";import"./labelUtils-3p0-m-Ee.js";import"./defaultsJSON-CHAaurhX.js";import"./BindType-BmZEZMMh.js";import"./Util-CS5u4Lec.js";import"./constants-D5zmR9t2.js";import"./TileContainer-Bs-vXdD_.js";import"./WGLContainer-DgZNq7b0.js";import"./ProgramTemplate-Ck2I0bIi.js";import"./config-MDUrh2eL.js";import"./featureConversionUtils-BHhm7bvm.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./FeatureCommandQueue-DI81F3gA.js";import"./vec3f32-nZdmKIgz.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./OverrideHelper-DxFZBnGL.js";import"./quantizationUtils-CfV316jZ.js";import"./AttributeStore-Bm6hLtR1.js";import"./TimeOnly-BXSODLxA.js";import"./timeSupport-DXkhlToK.js";import"./json-Wa8cmqdu.js";import"./diffUtils-uUoMDFQS.js";import"./normalizeUtilsSync-73yZ0QwV.js";let a=class extends g(d){constructor(e){super(e),this.frameCenter=null,this.frameOutline=null,this.lineOfSight=null,this.sensorLocation=null,this.sensorTrail=null}};t([r({type:Boolean})],a.prototype,"frameCenter",void 0),t([r({type:Boolean})],a.prototype,"frameOutline",void 0),t([r({type:Boolean})],a.prototype,"lineOfSight",void 0),t([r({type:Boolean})],a.prototype,"sensorLocation",void 0),t([r({type:Boolean})],a.prototype,"sensorTrail",void 0),a=t([f("esri.layers.support.TelemetryDisplay")],a);const u=a,n=new b([255,127,0]);let m=class extends _(v){constructor(){super(...arguments),this._graphicsLayer=new T,this._frameOutlineGraphic=new h({symbol:{type:"simple-fill",outline:{type:"simple-line",color:n}}}),this._sensorTrailGraphic=new h({symbol:{type:"simple-line",color:n}}),this._lineOfSightGraphic=new h({symbol:{type:"simple-line",color:n}}),this._sensorLocationGraphic=new h({symbol:{type:"simple-marker",color:n}}),this._frameCenterGraphic=new h({symbol:{type:"simple-marker",color:n}}),this.layer=null,this.symbolColor=n,this.visibleTelemetryElements=null}destroy(){this._graphicsLayer=c(this._graphicsLayer)}initialize(){var e,i,s,l,o;this.addHandles(p(()=>this.symbolColor,()=>{this._frameOutlineGraphic.symbol.outline.color=this.symbolColor,this._sensorTrailGraphic.symbol.color=this.symbolColor,this._lineOfSightGraphic.symbol.color=this.symbolColor,this._sensorLocationGraphic.symbol.color=this.symbolColor,this._frameCenterGraphic.symbol.color=this.symbolColor},y)),this._graphicsLayer.graphics.addMany([this._frameOutlineGraphic,this._sensorTrailGraphic,this._lineOfSightGraphic,this._sensorLocationGraphic,this._frameCenterGraphic]),this.visibleTelemetryElements=new u({frameCenter:((e=this.layer.telemetryDisplay)==null?void 0:e.frameCenter)??!0,frameOutline:((i=this.layer.telemetryDisplay)==null?void 0:i.frameOutline)??!0,lineOfSight:((s=this.layer.telemetryDisplay)==null?void 0:s.lineOfSight)??!0,sensorLocation:((l=this.layer.telemetryDisplay)==null?void 0:l.sensorLocation)??!0,sensorTrail:((o=this.layer.telemetryDisplay)==null?void 0:o.sensorTrail)??!0})}attach(){this.graphicsView=new C({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this._graphicsLayer.graphics,container:new O(this.view.featuresTilingScheme)}),this.container.addChild(this.graphicsView.container),this.addAttachHandles(this._graphicsLayer.on("graphic-update",this.graphicsView.graphicUpdateHandler)),this.addAttachHandles([p(()=>{var e,i,s,l,o;return[(e=this.layer.telemetryDisplay)==null?void 0:e.frameCenter,(i=this.layer.telemetryDisplay)==null?void 0:i.frameOutline,(s=this.layer.telemetryDisplay)==null?void 0:s.sensorLocation,(l=this.layer.telemetryDisplay)==null?void 0:l.sensorTrail,(o=this.layer.telemetryDisplay)==null?void 0:o.lineOfSight]},()=>this._updateVisibleTelemetryElements(),y),p(()=>{var e,i,s,l,o;return[this.layer.telemetry,(e=this.visibleTelemetryElements)==null?void 0:e.frameCenter,(i=this.visibleTelemetryElements)==null?void 0:i.frameOutline,(s=this.visibleTelemetryElements)==null?void 0:s.sensorLocation,(l=this.visibleTelemetryElements)==null?void 0:l.sensorTrail,(o=this.visibleTelemetryElements)==null?void 0:o.lineOfSight]},()=>this._updateGraphicGeometries(),y)])}detach(){this.container.removeAllChildren(),this.graphicsView=c(this.graphicsView)}supportsSpatialReference(e){return!0}moveStart(){}moveEnd(){}viewChange(){this.graphicsView.viewChange()}update(e){this.graphicsView.processUpdate(e)}isUpdating(){return!this.graphicsView||this.graphicsView.updating}_updateVisibleTelemetryElements(){this.visibleTelemetryElements&&this.layer.telemetryDisplay&&(this.visibleTelemetryElements.frameCenter=this.layer.telemetryDisplay.frameCenter,this.visibleTelemetryElements.frameOutline=this.layer.telemetryDisplay.frameOutline,this.visibleTelemetryElements.lineOfSight=this.layer.telemetryDisplay.lineOfSight,this.visibleTelemetryElements.sensorLocation=this.layer.telemetryDisplay.sensorLocation,this.visibleTelemetryElements.sensorTrail=this.layer.telemetryDisplay.sensorTrail)}_updateGraphicGeometries(){const{telemetry:e}=this.layer,{visibleTelemetryElements:i}=this;e&&i&&(i.frameOutline&&e.frameOutline?this._frameOutlineGraphic.geometry=this.layer.telemetry.frameOutline:this._frameOutlineGraphic.geometry=null,i.sensorTrail&&e.sensorTrail?this._sensorTrailGraphic.geometry=this.layer.telemetry.sensorTrail:this._sensorTrailGraphic.geometry=null,i.lineOfSight&&e.lineOfSight?this._lineOfSightGraphic.geometry=this.layer.telemetry.lineOfSight:this._lineOfSightGraphic.geometry=null,i.sensorLocation&&e.sensorLocation?this._sensorLocationGraphic.geometry=this.layer.telemetry.sensorLocation:this._sensorLocationGraphic.geometry=null,i.frameCenter&&e.frameCenter?this._frameCenterGraphic.geometry=this.layer.telemetry.frameCenter:this._frameCenterGraphic.geometry=null)}};t([r()],m.prototype,"graphicsView",void 0),t([r()],m.prototype,"layer",void 0),t([r()],m.prototype,"symbolColor",void 0),t([r({type:u})],m.prototype,"visibleTelemetryElements",void 0),m=t([f("esri.views.2d.layers.VideoLayerView2D")],m);const ye=m;export{ye as default}; diff --git a/assets/VoxelLayer-C6oRPxv0.js b/assets/VoxelLayer-pjuHsY2A.js similarity index 98% rename from assets/VoxelLayer-C6oRPxv0.js rename to assets/VoxelLayer-pjuHsY2A.js index 1cec46a..1ef3b4e 100644 --- a/assets/VoxelLayer-C6oRPxv0.js +++ b/assets/VoxelLayer-pjuHsY2A.js @@ -1 +1 @@ -import{cT as je,cx as ge,fq as ze,kS as ve,ja as fe,cy as Pe,cz as X,b4 as A,hP as $,hQ as R,d as e,y as o,e1 as ee,f as m,aU as g,dC as Me,dS as z,a9 as B,V as c,w as te,I as Y,kT as Z,aV as Q,aS as $e,s as L,G as _e,cU as Be,kU as Ee,aA as ne,hy as Oe,gO as Ce,cX as ke,dM as Ue,dp as We,dq as Je,bQ as Ge,dr as Qe,dO as Xe,dN as Ye,kh as Ze,ay as He,N as le,aE as Re,a_ as E,dt as Ke,du as et,aZ as be,i as tt,bT as it}from"./index-CEWggaxV.js";import{L as ot}from"./SceneService-l5OfqT0E.js";import{j as st}from"./persistable-uPSrwVmW.js";import{I as ae,x as rt}from"./quat-CoKEr4Zu.js";import{e as se}from"./quatf64-Bdb9ZJJK.js";import{p as nt}from"./popupUtils-DAFYyAvw.js";import"./originUtils-D69mHv66.js";import"./multiOriginJSONSupportUtils-C0wm8_Yw.js";import"./resourceUtils-Cu1-5qu3.js";import"./resourceUtils-CjqYbm2Q.js";import"./saveAPIKeyUtils-BiX1lQSW.js";import"./saveUtils-BzCRy3uR.js";import"./MD5-C9MwAd2G.js";import"./resourceExtension-orEjzZQo.js";import"./mat3f64-q3fE-ZOt.js";const f=Pe(),Se=se(),xe=se(),we=se(),Ie=X(0,0,1),lt=X(0,1,0),at=X(1,0,0);function O(i){je(f,i),ge(f,f);const t=Math.atan2(f[1],f[0]),s=ae(se(),Ie,-t);ze(f,f,s);const r=-1*Math.atan2(f[2],f[0]);return[ve(t)+270,ve(r)+90]}function ie(i,t){return ae(xe,Ie,fe(i-270)),ae(we,lt,fe(t-90)),rt(Se,xe,we),je(f,at),ze(f,f,Se),ge(f,f),[f[0],f[1],f[2]]}let I=class extends A(g){constructor(t){super(t),this.enabled=!0,this.label="",this.normal=null,this.point=null}get orientation(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[t,s]=O(this.normal);return $.normalize(R(t),0,!0)}set orientation(t){const s=ie(t,this.tilt);this._set("normal",s),this._set("orientation",t)}get tilt(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[t,s]=O(this.normal);return $.normalize(R(s),0,!0)}set tilt(t){const s=ie(this.orientation,t);this._set("normal",s),this._set("tilt",t)}};e([o({type:Boolean,json:{write:!0}})],I.prototype,"enabled",void 0),e([o({type:String,json:{write:!0}})],I.prototype,"label",void 0),e([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),ee(i=>$.normalize(R(i),0,!0))],I.prototype,"orientation",null),e([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),ee(i=>$.normalize(R(i),0,!0))],I.prototype,"tilt",null),e([o({type:[Number],json:{write:!0}})],I.prototype,"normal",void 0),e([o({type:[Number],json:{write:!0}})],I.prototype,"point",void 0),I=e([m("esri.layers.voxel.VoxelSlice")],I);const oe=I;let S=class extends A(g){constructor(){super(...arguments),this.enabled=!0,this.href=null,this.id=null,this.label="",this.normal=null,this.point=null,this.sizeInPixel=null,this.slices=null,this.timeId=0,this.variableId=null}get orientation(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[t,s]=O(this.normal);return $.normalize(R(t),0,!0)}get tilt(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[t,s]=O(this.normal);return $.normalize(R(s),0,!0)}};e([o({type:Boolean,json:{default:!0,write:!0}})],S.prototype,"enabled",void 0),e([o({type:String,json:{origins:{service:{read:Me}},write:{enabled:!0,isRequired:!0}}}),st({origins:["web-scene"],type:"resource",prefix:"sections",compress:!0})],S.prototype,"href",void 0),e([o({type:z,json:{write:{enabled:!0,isRequired:!0}}})],S.prototype,"id",void 0),e([o({type:String,json:{write:!0}})],S.prototype,"label",void 0),e([o({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],S.prototype,"orientation",null),e([o({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],S.prototype,"tilt",null),e([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],S.prototype,"normal",void 0),e([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],S.prototype,"point",void 0),e([o({type:[z],json:{write:{enabled:!0,isRequired:!0}}})],S.prototype,"sizeInPixel",void 0),e([o({type:[oe],json:{write:!0}})],S.prototype,"slices",void 0),e([o({type:z,json:{default:0,write:!0}})],S.prototype,"timeId",void 0),e([o({type:z,json:{write:{enabled:!0,isRequired:!0}}})],S.prototype,"variableId",void 0),S=e([m("esri.layers.voxel.VoxelSection")],S);const pe=S;let k=class extends g{constructor(){super(...arguments),this.diffuseFactor=.5,this.specularFactor=.5}};e([o({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],k.prototype,"diffuseFactor",void 0),e([o({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],k.prototype,"specularFactor",void 0),k=e([m("esri.layers.voxel.VoxelSimpleShading")],k);const Ne=k;let N=class extends g{constructor(){super(...arguments),this.continuity=null,this.hasNoData=!1,this.noData=0,this.offset=0,this.scale=1,this.type=null}};e([o({type:["discrete","continuous"],json:{write:!0}})],N.prototype,"continuity",void 0),e([o({type:Boolean,json:{write:!0}})],N.prototype,"hasNoData",void 0),e([o({type:Number,json:{write:!0}})],N.prototype,"noData",void 0),e([o({type:Number,json:{write:!0}})],N.prototype,"offset",void 0),e([o({type:Number,json:{write:!0}})],N.prototype,"scale",void 0),e([o({type:String,json:{write:{enabled:!0,isRequired:!0}}})],N.prototype,"type",void 0),N=e([m("esri.layers.voxel.VoxelFormat")],N);const Ve=N;let j=class extends g{constructor(){super(...arguments),this.id=null,this.description="",this.name=null,this.originalFormat=null,this.renderingFormat=null,this.unit="",this.volumeId=0,this.type=null}};e([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],j.prototype,"id",void 0),e([o({type:String,json:{write:!0}})],j.prototype,"description",void 0),e([o({type:String,json:{write:{enabled:!0,isRequired:!0}}})],j.prototype,"name",void 0),e([o({type:Ve,json:{write:!0}})],j.prototype,"originalFormat",void 0),e([o({type:Ve,json:{write:{enabled:!0,isRequired:!0}}})],j.prototype,"renderingFormat",void 0),e([o({type:String,json:{write:!0}})],j.prototype,"unit",void 0),e([o({type:Number,json:{write:!0}})],j.prototype,"volumeId",void 0),e([o({type:["stc-hot-spot-results","stc-cluster-outlier-results","stc-estimated-bin","generic-nearest-interpolated"],json:{write:!0}})],j.prototype,"type",void 0),j=e([m("esri.layers.voxel.VoxelVariable")],j);const pt=j;let F=class extends A(g){constructor(){super(...arguments),this.color=B.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label="",this.colorLocked=!1}};e([o({type:B,json:{type:[z],write:{enabled:!0,isRequired:!0}}})],F.prototype,"color",void 0),e([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],F.prototype,"value",void 0),e([o({type:Boolean,json:{default:!0,write:!0}})],F.prototype,"enabled",void 0),e([o({type:String,json:{write:!0}})],F.prototype,"label",void 0),e([o({type:Boolean,json:{default:!1,write:!0}})],F.prototype,"colorLocked",void 0),F=e([m("esri.layers.voxel.VoxelIsosurface")],F);const Te=F;let U=class extends A(g){constructor(){super(...arguments),this.color=null,this.position=0}};e([o({type:B,json:{type:[z],write:{enabled:!0,isRequired:!0}}})],U.prototype,"color",void 0),e([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],U.prototype,"position",void 0),U=e([m("esri.layers.voxel.VoxelColorStop")],U);const ue=U;let W=class extends A(g){constructor(){super(...arguments),this.opacity=1,this.position=0}};e([o({type:Number,json:{name:"alpha",write:{enabled:!0,isRequired:!0}}})],W.prototype,"opacity",void 0),e([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],W.prototype,"position",void 0),W=e([m("esri.layers.voxel.VoxelOpacityStop")],W);const ce=W;let J=class extends A(g){constructor(){super(...arguments),this.enabled=!1,this.range=null}};e([o({type:Boolean,json:{default:!1,write:!0}})],J.prototype,"enabled",void 0),e([o({type:[Number],json:{write:!0}})],J.prototype,"range",void 0),J=e([m("esri.layers.voxel.VoxelRangeFilter")],J);const ut=J;var V;(function(i){i[i.Color=1]="Color",i[i.Alpha=2]="Alpha",i[i.Both=3]="Both"})(V||(V={}));let T=class extends A(g){constructor(t){super(t),this.interpolation=null,this.stretchRange=null,this.rangeFilter=null,this._colorMapSize=256,this.colorStops=new(c.ofType(ue)),this.opacityStops=new(c.ofType(ce))}set colorStops(t){this._set("colorStops",te(t,this._get("colorStops"),c.ofType(ue)))}set opacityStops(t){this._set("opacityStops",te(t,this._get("opacityStops"),c.ofType(ce)))}getPreviousNext(t,s,r){let n=t;for(;--n>0&&s[n].type!==r&&s[n].type!==V.Both;);let l=t;const u=s.length;for(;++lh.position{y.color[re]=Math.round(Z(C[re],Fe[re],v))})}else d!==-1?H.forEach(v=>{y.color[v]=r[d].color[v]}):H.forEach(v=>{y.color[v]=r[b].color[v]})}}for(const h of r)s.push({color:h.color,position:h.position})}s[0].position=0,s[s.length-1].position=1;let l=0,u=1;for(let p=0;ps[u].position;)l=u++;const y=(h-s[l].position)/(s[u].position-s[l].position),d=s[l].color,b=s[u].color,v=new B;H.forEach(C=>{v[C]=Math.round(Z(d[C],b[C],y))}),v.a=Y(1-Z(d.a,b.a,y)/255,0,1),t.push(v)}return t}getColorForContinuousDataValue(t,s){const r=this.rasterizedTransferFunction;if(this.colorStops.length<2||!Array.isArray(this.stretchRange)||this.stretchRange.length<2||r.length<256)return null;let n=this.stretchRange[0],l=this.stretchRange[1];if(n>l){const p=n;n=l,l=p}t=Y(t,n,l);const u=r[Math.round((t-n)/(l-n)*(this._colorMapSize-1))].clone();return s||(u.a=1),u}};e([o({type:["linear","nearest"],json:{write:!0}})],T.prototype,"interpolation",void 0),e([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],T.prototype,"stretchRange",void 0),e([o({type:c.ofType(ue),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.colorStops&&this.colorStops.length>0}}}}})],T.prototype,"colorStops",null),e([o({type:c.ofType(ce),json:{read:{source:"alphaStops"},write:{enabled:!0,target:"alphaStops",overridePolicy(){return{enabled:!!this.opacityStops&&this.opacityStops.length>0}}}}})],T.prototype,"opacityStops",null),e([o({type:ut,json:{write:!0}})],T.prototype,"rangeFilter",void 0),e([o({type:[B],clonable:!1,json:{read:!1}})],T.prototype,"rasterizedTransferFunction",null),T=e([m("esri.layers.voxel.VoxelTransferFunctionStyle")],T);const ct=T,H=["r","g","b"];let M=class extends A(g){constructor(){super(...arguments),this.color=B.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label=""}};e([o({type:B,json:{type:[z],write:{enabled:!0,isRequired:!0}}})],M.prototype,"color",void 0),e([o({type:z,json:{write:{enabled:!0,isRequired:!0}}})],M.prototype,"value",void 0),e([o({type:Boolean,json:{default:!0,write:!0}})],M.prototype,"enabled",void 0),e([o({type:String,json:{write:!0}})],M.prototype,"label",void 0),M=e([m("esri.layers.voxel.VoxelUniqueValue")],M);const qe=M;var ye;let P=ye=class extends g{constructor(i){super(i),this.variableId=0,this.label="",this.transferFunction=null,this.uniqueValues=null,this.isosurfaces=null,this.uniqueValues=new(c.ofType(qe)),this.isosurfaces=new(c.ofType(Te))}clone(){return new ye({variableId:this.variableId,label:this.label,transferFunction:Q(this.transferFunction),uniqueValues:Q(this.uniqueValues),isosurfaces:Q(this.isosurfaces)})}};e([o({type:z,json:{write:{enabled:!0,isRequired:!0}}})],P.prototype,"variableId",void 0),e([o({type:String,json:{write:!0}})],P.prototype,"label",void 0),e([o({type:ct,json:{write:{enabled:!0,overridePolicy(){return{enabled:!this.uniqueValues||this.uniqueValues.length<1}}}}})],P.prototype,"transferFunction",void 0),e([o({type:c.ofType(qe),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.uniqueValues&&this.uniqueValues.length>0}}}}})],P.prototype,"uniqueValues",void 0),e([o({type:c.ofType(Te),json:{write:{enabled:!0,overridePolicy(){const i=!this.uniqueValues||this.uniqueValues.length<1,t=!!this.isosurfaces&&this.isosurfaces.length>0;return{enabled:i&&t}}}}})],P.prototype,"isosurfaces",void 0),P=ye=e([m("esri.layers.voxel.VoxelVariableStyle")],P);const De=P;let K=class extends g{constructor(){super(...arguments),this.values=null}};e([o({type:[Number],json:{write:!0}})],K.prototype,"values",void 0),K=e([m("esri.layers.voxel.VoxelIrregularSpacing")],K);const yt=K;let G=class extends g{constructor(){super(...arguments),this.scale=1,this.offset=0}};e([o({type:Number,json:{write:!0}})],G.prototype,"scale",void 0),e([o({type:Number,json:{write:!0}})],G.prototype,"offset",void 0),G=e([m("esri.layers.voxel.VoxelRegularSpacing")],G);const dt=G;let x=class extends g{constructor(){super(...arguments),this.irregularSpacing=null,this.isPositiveUp=!0,this.isWrappedDateLine=!1,this.label=null,this.name=null,this.quantity=null,this.regularSpacing=null,this.size=0,this.unit=null}get isRegular(){return(this.irregularSpacing==null||this.irregularSpacing===void 0)&&this.regularSpacing!==null}getRange(){var i;return this.isRegular?[this.regularSpacing.offset,this.regularSpacing.offset+this.regularSpacing.scale*(this.size-1)]:Array.isArray((i=this.irregularSpacing)==null?void 0:i.values)&&this.irregularSpacing.values.length>1?[this.irregularSpacing.values[0],this.irregularSpacing.values[this.irregularSpacing.values.length-1]]:[0,0]}};e([o({type:yt,json:{write:!0}})],x.prototype,"irregularSpacing",void 0),e([o({type:Boolean,json:{write:!0}})],x.prototype,"isPositiveUp",void 0),e([o({type:Boolean,json:{write:!0}})],x.prototype,"isWrappedDateLine",void 0),e([o({type:String,json:{write:!0}})],x.prototype,"label",void 0),e([o({type:String,json:{write:!0}})],x.prototype,"name",void 0),e([o({type:String,json:{write:!0}})],x.prototype,"quantity",void 0),e([o({type:dt,json:{write:!0}})],x.prototype,"regularSpacing",void 0),e([o({type:Number,json:{write:!0}})],x.prototype,"size",void 0),e([o({type:String,json:{write:!0}})],x.prototype,"unit",void 0),e([o({type:Boolean,json:{read:!1}})],x.prototype,"isRegular",null),x=e([m("esri.layers.voxel.VoxelDimension")],x);const ht=x;let w=class extends g{constructor(t){super(t),this.id=0,this.dimensions=null,this.spatialReference=$e.WGS84}get zDimension(){if(!this.dimensions||!Array.isArray(this.dimensions)||this.dimensions.length!==4)return-1;for(let t=2;t<4;++t)if(this.dimensions[t].size>0)return t;return-1}get isValid(){return!!this.dimensions&&!!Array.isArray(this.dimensions)&&this.dimensions.length===4&&!(this.dimensions[0].size<1||this.dimensions[1].size<1)&&!(this.zDimension===-1||this.dimensions[this.zDimension].size<1)}get originInLayerSpace3D(){if(!this.isValid||this.volumeType==="xyt")return[0,0,0];const t=this.dimensions[0].getRange(),s=this.dimensions[1].getRange(),r=this.dimensions[2],n=r.isRegular?r.getRange():[0,r.size];return[t[0],s[0],n[0]]}get voxelSizeInLayerSpaceSigned(){if(!this.isValid||this.volumeType==="xyt")return[0,0,0];const t=this.dimensions[0].getRange(),s=this.dimensions[1].getRange(),r=this.dimensions[2],n=r.isRegular?r.getRange():[0,r.size],l=[this.sizeInVoxels[0],this.sizeInVoxels[1],this.sizeInVoxels[2]];for(let u=0;u<3;++u)l[u]<2?l[u]=1:l[u]-=1;return r.isRegular&&!r.isPositiveUp&&(l[2]*=-1),[(t[1]-t[0])/l[0],(s[1]-s[0])/l[1],(n[1]-n[0])/l[2]]}get volumeType(){if(this.isValid){const t=this.dimensions[2].size>0,s=this.dimensions[3].size>0;if(!t&&s)return"xyt";if(t&&s)return"xyzt"}return"xyz"}get sizeInVoxels(){if(!this.isValid)return[0,0,0];const t=this.zDimension;return[this.dimensions[0].size,this.dimensions[1].size,this.dimensions[t].size]}computeVoxelSpaceLocation(t){var n;if(!this.isValid)return[0,0,0];if(this.volumeType==="xyt")return L.getLogger(this).error("computeVoxelSpacePosition cannot be used with XYT volumes."),[0,0,0];if(!_e(this.spatialReference,t.spatialReference))return L.getLogger(this).error("pos argument should have the same spatial reference as the VoxelLayer."),[0,0,0];const s=X(t.x,t.y,t.z??0);Be(s,s,this.originInLayerSpace3D),Ee(s,s,this.voxelSizeInLayerSpaceSigned);const r=this.dimensions[this.zDimension];if(!r.isRegular&&Array.isArray((n=r.irregularSpacing)==null?void 0:n.values)&&r.irregularSpacing.values.length>1){const l=t.z??0,u=r.irregularSpacing.values,p=r.isPositiveUp?1:-1,h=u.reduce((y,d)=>Math.abs(p*d-l)$.normalize(R(i),0,!0))],q.prototype,"orientation",null),e([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),ee(i=>$.normalize(R(i),0,!0))],q.prototype,"tilt",null),e([o({type:[Number],json:{write:!0}})],q.prototype,"normal",void 0),e([o({type:[Number],json:{write:!0}})],q.prototype,"point",void 0),q=e([m("esri.layers.voxel.VoxelDynamicSection")],q);const he=q;var me;let D=me=class extends g{constructor(i){super(i),this.volumeId=0,this.verticalExaggeration=1,this.exaggerationMode="scale-height",this.verticalOffset=0,this.slices=new(c.ofType(oe)),this.dynamicSections=new(c.ofType(he))}set slices(i){this._set("slices",te(i,this._get("slices"),c.ofType(oe)))}set dynamicSections(i){this._set("dynamicSections",te(i,this._get("dynamicSections"),c.ofType(he)))}clone(){return new me({volumeId:this.volumeId,verticalExaggeration:this.verticalExaggeration,exaggerationMode:this.exaggerationMode,verticalOffset:this.verticalOffset,slices:Q(this.slices),dynamicSections:Q(this.dynamicSections)})}};e([o({type:z,json:{write:{enabled:!0,isRequired:!0}}})],D.prototype,"volumeId",void 0),e([o({type:Number,json:{default:1,write:!0}})],D.prototype,"verticalExaggeration",void 0),e([o({type:["scale-position","scale-height"],json:{default:"scale-height",write:!0}})],D.prototype,"exaggerationMode",void 0),e([o({type:Number,json:{default:0,write:!0}})],D.prototype,"verticalOffset",void 0),e([o({type:c.ofType(oe),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.slices&&this.slices.length>0}}}}})],D.prototype,"slices",null),e([o({type:c.ofType(he),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.dynamicSections&&this.dynamicSections.length>0}}}}})],D.prototype,"dynamicSections",null),D=me=e([m("esri.layers.voxel.VoxelVolumeStyle")],D);const Ae=D;let a=class extends ot(Ue(We(Je(Ge(Qe(Xe(Ye(it)))))))){constructor(i){super(i),this.serviceRoot="",this.operationalLayerType="Voxel",this.legendEnabled=!0,this.title=null,this.sections=null,this.currentVariableId=0,this.volumeStyles=null,this.renderMode="volume",this.variableStyles=null,this.enableSlices=!0,this.enableSections=!0,this.enableDynamicSections=!0,this.enableIsosurfaces=!0,this.shading=new Ne,this.opacity=1,this.variables=new c,this.volumes=new c,this.index=null,this.minScale=0,this.maxScale=0,this.type="voxel",this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.fullExtent=null,this.popupEnabled=!1,this.test=null,this.volumeStyles=new(c.ofType(Ae)),this.variableStyles=new(c.ofType(De)),this.sections=new(c.ofType(pe))}normalizeCtorArgs(i){return i!=null&&i.constantUpscaling&&(this.test={constantUpscaling:!0},delete i.constantUpscaling),i}set url(i){this._set("url",Ze(i,L.getLogger(this)))}load(i){const t=i!=null?i.signal:null,s=this.loadFromPortal({supportedTypes:["Scene Service"]},i).catch(He).then(()=>this._fetchService(t)).then(()=>this.serviceRoot=this.url);return this.addResolvingPromise(s),Promise.resolve(this)}read(i,t){super.read(i,t);for(const s of this.volumes)s.spatialReference=this.spatialReference}readVersion(i,t){return super.parseVersionString(i)}validateLayer(i){if(i.layerType&&i.layerType!==this.operationalLayerType)throw new le("voxel-layer:layer-type-not-supported","VoxelLayer does not support this layer type",{layerType:i.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor)||this.version.major<3)throw new le("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"});if(this.version.major>3)throw new le("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"})}readFullExtent(i,t,s){if(i!=null&&typeof i=="object"){const r=Re.fromJSON(i,s);if(r.zmin===0&&r.zmax===0&&Array.isArray(t.volumes)){const n=Le.fromJSON(t.volumes[0]);if(n.isValid&&n.volumeType!=="xyt"){const l=n.dimensions[2];if(l.isRegular){let u=l.regularSpacing.offset,p=l.regularSpacing.offset+l.regularSpacing.scale*(l.size-1);if(u>p){const h=u;u=p,p=h}r.zmin=u,r.zmax=p}}}return r}return null}get voxelFields(){const i=[new E({name:"Voxel.ServiceValue",alias:"Value",domain:null,editable:!1,length:128,type:"string"}),new E({name:"Voxel.ServiceVariableLabel",alias:"Variable",domain:null,editable:!1,length:128,type:"string"}),new E({name:"Voxel.Position",alias:"Voxel Position",domain:null,editable:!1,length:128,type:"string"})],t=this.getVolume(null);if(t!=null){if(t.volumeType==="xyzt"||t.volumeType==="xyt"){const s=new E({name:"Voxel.ServiceLocalTime",alias:"Local Time",domain:null,editable:!1,length:128,type:"string"});i.push(s);const r=new E({name:"Voxel.ServiceNativeTime",alias:"Native Time",domain:null,editable:!1,length:128,type:"string"});i.push(r)}if(t.volumeType!=="xyt"){const s=new E({name:"Voxel.ServiceDepth",alias:"Depth",domain:null,editable:!1,length:128,type:"string"});i.push(s)}}return i}get popupTemplate(){return this.loaded?this.createPopupTemplate():null}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(i){const t=this.voxelFields,s=this.title;return nt({fields:t,title:s},i)}getConfiguration(){var t,s;const i={layerType:this.operationalLayerType,version:this.version.versionString,name:this.title,spatialReference:this.spatialReference,fullExtent:this.fullExtent,volumes:this.volumes.toJSON(),variables:this.variables.toJSON(),index:(t=this.index)==null?void 0:t.toJSON(),sections:this.getSections(),style:{volumeStyles:this.getVolumeStyles(),currentVariableId:this.currentVariableId,renderMode:this.renderMode,variableStyles:this.getVariableStyles(),enableSections:this.enableSections,enableDynamicSections:this.enableDynamicSections,enableIsosurfaces:this.enableIsosurfaces,enableSlices:this.enableSlices,shading:this.shading}};return i.index&&((s=this.index)!=null&&s.isValid())?JSON.stringify(i):""}getVariableStyle(i){let t=-1;if(t=i??this.currentVariableId,!this.variableStyles||t===-1)return null;const s=this.variableStyles.findIndex(r=>r.variableId===t);return s<0?null:this.variableStyles.at(s)}getVariable(i){let t=-1;if(t=i??this.currentVariableId,!this.variables||t===-1)return null;const s=this.variables.findIndex(r=>r.id===t);return s<0?null:this.variables.at(s)}getVolume(i){const t=this.getVariable(i);return t!=null?this.volumes.find(({id:s})=>s===t.volumeId):null}getVolumeStyle(i){const t=this.getVariable(i);return t!=null?this.volumeStyles.find(({volumeId:s})=>s===t.volumeId):null}getColorForContinuousDataValue(i,t,s){var u;const r=this.getVariable(i);if(r==null||((u=r.renderingFormat)==null?void 0:u.continuity)!=="continuous"||!this.variableStyles)return null;const n=this.variableStyles.findIndex(p=>p.variableId===i);if(n<0)return null;const l=this.variableStyles.at(n);return l!=null&&l.transferFunction?l.transferFunction.getColorForContinuousDataValue(t,s):null}getSections(){const i=[];for(const t of this.sections)i.push(new pe({enabled:t.enabled,href:t.href,id:t.id,label:t.label,normal:t.normal,point:t.point,sizeInPixel:t.sizeInPixel,slices:t.slices,timeId:t.timeId,variableId:t.variableId}));return i}getVariableStyles(){const i=[];for(const t of this.variableStyles){const s=this._getVariable(t);if(s!=null){const r=t.clone();r.isosurfaces.length>4&&(r.isosurfaces=r.isosurfaces.slice(0,3),L.getLogger(this).error("A maximum of 4 isosurfaces are supported for Voxel Layers."));for(const n of r.isosurfaces)if(!n.colorLocked){const l=this.getColorForContinuousDataValue(r.variableId,n.value,!1);l===null||l.equals(n.color)||(n.color=l)}if(s.renderingFormat.continuity==="continuous")(r.transferFunction===null||r.transferFunction.colorStops.length<2)&&L.getLogger(this).error(`VoxelVariableStyle for variable ${s.id} is invalid. At least 2 color stops are required in the transferFunction for continuous Voxel Layer variables.`),r.transferFunction!==null&&(Array.isArray(r.transferFunction.stretchRange)&&r.transferFunction.stretchRange.length===2||(L.getLogger(this).error(`VoxelVariableStyle for variable ${s.id} is invalid. The stretchRange of the transferFunction for continuous Voxel Layer variables must be of the form [minimumDataValue, maximumDataValue].`),r.transferFunction.stretchRange=[0,1],r.transferFunction.colorStops.removeAll()));else if(s.renderingFormat.continuity==="discrete")if(t.uniqueValues.length===0)L.getLogger(this).error(`VoxelVariableStyle for variable ${s.id} is invalid. Unique values are required for discrete Voxel Layer variables.`);else for(const n of t.uniqueValues)n.label!==null&&n.label!==void 0||n.value===null||n.value===void 0||(n.label=n.value.toString());i.push(r)}else L.getLogger(this).error(`VoxelVariable ID=${t.variableId} doesn't exist, VoxelVariableStyle for this VoxelVariable will be ignored.`)}return i}getVolumeStyles(){const i=[];for(const t of this.volumeStyles){const s=this._getVolumeFromVolumeId(t.volumeId);if(s!=null){const r=t.clone();for(const n of r.slices)this._isPlaneValid(n,[0,1,s.zDimension],s.dimensions)||(n.enabled=!1,n.label="invalid");for(const n of r.dynamicSections)this._isPlaneValid(n,[0,1,s.zDimension],s.dimensions)||(n.enabled=!1,n.label="invalid");i.push(r)}else L.getLogger(this).error(`VoxelVolume ID=${t.volumeId} doesn't exist, VoxelVolumeStyle for this VoxelVolume will be ignored.`)}return i}_getVariable(i){const t=i.variableId;for(const s of this.variables)if(s.id===t)return s;return null}_getVolumeFromVolumeId(i){for(const t of this.volumes)if(t.id===i)return t;return null}_isPlaneValid(i,t,s){if(!i.point||!Array.isArray(i.point)||i.point.length!==3||!i.normal||!Array.isArray(i.normal)||i.normal.length!==3)return!1;const r=X(i.normal[0],i.normal[1],i.normal[2]);return ge(r,r),!(Math.abs(r[0])+Math.abs(r[1])+Math.abs(r[2])<1e-6)&&(i.normal[0]=r[0],i.normal[1]=r[1],i.normal[2]=r[2],!0)}};e([o({type:["Voxel"]})],a.prototype,"operationalLayerType",void 0),e([o(Ke)],a.prototype,"legendEnabled",void 0),e([o({json:{write:!0}})],a.prototype,"title",void 0),e([o(et)],a.prototype,"url",null),e([o({type:c.ofType(pe),json:{origins:{"web-scene":{name:"layerDefinition.sections",write:!0}}}})],a.prototype,"sections",void 0),e([o({type:z,json:{origins:{"web-scene":{name:"layerDefinition.style.currentVariableId",write:{enabled:!0,isRequired:!0,ignoreOrigin:!0}},service:{name:"style.currentVariableId"}}}})],a.prototype,"currentVariableId",void 0),e([o({type:c.ofType(Ae),json:{origins:{"web-scene":{name:"layerDefinition.style.volumeStyles",write:!0},service:{name:"style.volumeStyles"}}}})],a.prototype,"volumeStyles",void 0),e([o({type:["volume","surfaces"],json:{origins:{"web-scene":{name:"layerDefinition.style.renderMode",write:!0},service:{name:"style.renderMode"}}}})],a.prototype,"renderMode",void 0),e([o({type:c.ofType(De),json:{origins:{"web-scene":{name:"layerDefinition.style.variableStyles",write:!0},service:{name:"style.variableStyles"}}}})],a.prototype,"variableStyles",void 0),e([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSlices",write:!0},service:{name:"style.enableSlices"}}}})],a.prototype,"enableSlices",void 0),e([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSections",write:!0},service:{name:"style.enableSections"}}}})],a.prototype,"enableSections",void 0),e([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableDynamicSections",write:!0},service:{name:"style.enableDynamicSections"}}}})],a.prototype,"enableDynamicSections",void 0),e([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableIsosurfaces",write:!0},service:{name:"style.enableIsosurfaces"}}}})],a.prototype,"enableIsosurfaces",void 0),e([o({type:Ne,json:{origins:{"web-scene":{name:"layerDefinition.style.shading",write:!0},service:{name:"style.shading"}}}})],a.prototype,"shading",void 0),e([o({type:["show","hide"]})],a.prototype,"listMode",void 0),e([o({type:Number,range:{min:0,max:1},nonNullable:!0,json:{read:!1,write:!1,origins:{"web-scene":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],a.prototype,"opacity",void 0),e([o({type:c.ofType(pt)})],a.prototype,"variables",void 0),e([o({type:c.ofType(Le)})],a.prototype,"volumes",void 0),e([o({type:mt})],a.prototype,"index",void 0),e([o({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],a.prototype,"minScale",void 0),e([o({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],a.prototype,"maxScale",void 0),e([o({json:{read:!1},readOnly:!0})],a.prototype,"type",void 0),e([o({readOnly:!0,json:{name:"serviceVersion"}})],a.prototype,"version",void 0),e([be("service","version")],a.prototype,"readVersion",null),e([o({type:Re})],a.prototype,"fullExtent",void 0),e([be("service","fullExtent",["fullExtent"])],a.prototype,"readFullExtent",null),e([o({readOnly:!0,clonable:!1,json:{read:!1}})],a.prototype,"voxelFields",null),e([o({type:Boolean,json:{name:"disablePopup",read:{reader:(i,t)=>!t.disablePopup},write:{enabled:!0,ignoreOrigin:!0,writer(i,t,s){t[s]=!i}},origins:{"portal-item":{default:!0},"web-scene":{default:!0}}}})],a.prototype,"popupEnabled",void 0),e([o({type:tt,json:{read:!1}})],a.prototype,"popupTemplate",null),e([o({readOnly:!0})],a.prototype,"defaultPopupTemplate",null),a=e([m("esri.layers.VoxelLayer")],a);const Jt=a;export{Jt as default}; +import{cT as je,cx as ge,fq as ze,kS as ve,ja as fe,cy as Pe,cz as X,b4 as A,hP as $,hQ as R,d as e,y as o,e1 as ee,f as m,aU as g,dC as Me,dS as z,a9 as B,V as c,w as te,I as Y,kT as Z,aV as Q,aS as $e,s as L,G as _e,cU as Be,kU as Ee,aA as ne,hy as Oe,gO as Ce,cX as ke,dM as Ue,dp as We,dq as Je,bQ as Ge,dr as Qe,dO as Xe,dN as Ye,kh as Ze,ay as He,N as le,aE as Re,a_ as E,dt as Ke,du as et,aZ as be,i as tt,bT as it}from"./index-BjUNJPVf.js";import{L as ot}from"./SceneService-DbS150xR.js";import{j as st}from"./persistable-3OEDOKAC.js";import{I as ae,x as rt}from"./quat-C0wQB0HB.js";import{e as se}from"./quatf64-Bdb9ZJJK.js";import{p as nt}from"./popupUtils-DlZin22m.js";import"./originUtils-D69mHv66.js";import"./multiOriginJSONSupportUtils-C0wm8_Yw.js";import"./resourceUtils-p9pTIVIi.js";import"./resourceUtils-CfE36DzP.js";import"./saveAPIKeyUtils-YRBbgdzi.js";import"./saveUtils-CGGzyvzv.js";import"./MD5-C9MwAd2G.js";import"./resourceExtension-CiV172Z4.js";import"./mat3f64-q3fE-ZOt.js";const f=Pe(),Se=se(),xe=se(),we=se(),Ie=X(0,0,1),lt=X(0,1,0),at=X(1,0,0);function O(i){je(f,i),ge(f,f);const t=Math.atan2(f[1],f[0]),s=ae(se(),Ie,-t);ze(f,f,s);const r=-1*Math.atan2(f[2],f[0]);return[ve(t)+270,ve(r)+90]}function ie(i,t){return ae(xe,Ie,fe(i-270)),ae(we,lt,fe(t-90)),rt(Se,xe,we),je(f,at),ze(f,f,Se),ge(f,f),[f[0],f[1],f[2]]}let I=class extends A(g){constructor(t){super(t),this.enabled=!0,this.label="",this.normal=null,this.point=null}get orientation(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[t,s]=O(this.normal);return $.normalize(R(t),0,!0)}set orientation(t){const s=ie(t,this.tilt);this._set("normal",s),this._set("orientation",t)}get tilt(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[t,s]=O(this.normal);return $.normalize(R(s),0,!0)}set tilt(t){const s=ie(this.orientation,t);this._set("normal",s),this._set("tilt",t)}};e([o({type:Boolean,json:{write:!0}})],I.prototype,"enabled",void 0),e([o({type:String,json:{write:!0}})],I.prototype,"label",void 0),e([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),ee(i=>$.normalize(R(i),0,!0))],I.prototype,"orientation",null),e([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),ee(i=>$.normalize(R(i),0,!0))],I.prototype,"tilt",null),e([o({type:[Number],json:{write:!0}})],I.prototype,"normal",void 0),e([o({type:[Number],json:{write:!0}})],I.prototype,"point",void 0),I=e([m("esri.layers.voxel.VoxelSlice")],I);const oe=I;let S=class extends A(g){constructor(){super(...arguments),this.enabled=!0,this.href=null,this.id=null,this.label="",this.normal=null,this.point=null,this.sizeInPixel=null,this.slices=null,this.timeId=0,this.variableId=null}get orientation(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[t,s]=O(this.normal);return $.normalize(R(t),0,!0)}get tilt(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[t,s]=O(this.normal);return $.normalize(R(s),0,!0)}};e([o({type:Boolean,json:{default:!0,write:!0}})],S.prototype,"enabled",void 0),e([o({type:String,json:{origins:{service:{read:Me}},write:{enabled:!0,isRequired:!0}}}),st({origins:["web-scene"],type:"resource",prefix:"sections",compress:!0})],S.prototype,"href",void 0),e([o({type:z,json:{write:{enabled:!0,isRequired:!0}}})],S.prototype,"id",void 0),e([o({type:String,json:{write:!0}})],S.prototype,"label",void 0),e([o({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],S.prototype,"orientation",null),e([o({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],S.prototype,"tilt",null),e([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],S.prototype,"normal",void 0),e([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],S.prototype,"point",void 0),e([o({type:[z],json:{write:{enabled:!0,isRequired:!0}}})],S.prototype,"sizeInPixel",void 0),e([o({type:[oe],json:{write:!0}})],S.prototype,"slices",void 0),e([o({type:z,json:{default:0,write:!0}})],S.prototype,"timeId",void 0),e([o({type:z,json:{write:{enabled:!0,isRequired:!0}}})],S.prototype,"variableId",void 0),S=e([m("esri.layers.voxel.VoxelSection")],S);const pe=S;let k=class extends g{constructor(){super(...arguments),this.diffuseFactor=.5,this.specularFactor=.5}};e([o({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],k.prototype,"diffuseFactor",void 0),e([o({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],k.prototype,"specularFactor",void 0),k=e([m("esri.layers.voxel.VoxelSimpleShading")],k);const Ne=k;let N=class extends g{constructor(){super(...arguments),this.continuity=null,this.hasNoData=!1,this.noData=0,this.offset=0,this.scale=1,this.type=null}};e([o({type:["discrete","continuous"],json:{write:!0}})],N.prototype,"continuity",void 0),e([o({type:Boolean,json:{write:!0}})],N.prototype,"hasNoData",void 0),e([o({type:Number,json:{write:!0}})],N.prototype,"noData",void 0),e([o({type:Number,json:{write:!0}})],N.prototype,"offset",void 0),e([o({type:Number,json:{write:!0}})],N.prototype,"scale",void 0),e([o({type:String,json:{write:{enabled:!0,isRequired:!0}}})],N.prototype,"type",void 0),N=e([m("esri.layers.voxel.VoxelFormat")],N);const Ve=N;let j=class extends g{constructor(){super(...arguments),this.id=null,this.description="",this.name=null,this.originalFormat=null,this.renderingFormat=null,this.unit="",this.volumeId=0,this.type=null}};e([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],j.prototype,"id",void 0),e([o({type:String,json:{write:!0}})],j.prototype,"description",void 0),e([o({type:String,json:{write:{enabled:!0,isRequired:!0}}})],j.prototype,"name",void 0),e([o({type:Ve,json:{write:!0}})],j.prototype,"originalFormat",void 0),e([o({type:Ve,json:{write:{enabled:!0,isRequired:!0}}})],j.prototype,"renderingFormat",void 0),e([o({type:String,json:{write:!0}})],j.prototype,"unit",void 0),e([o({type:Number,json:{write:!0}})],j.prototype,"volumeId",void 0),e([o({type:["stc-hot-spot-results","stc-cluster-outlier-results","stc-estimated-bin","generic-nearest-interpolated"],json:{write:!0}})],j.prototype,"type",void 0),j=e([m("esri.layers.voxel.VoxelVariable")],j);const pt=j;let F=class extends A(g){constructor(){super(...arguments),this.color=B.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label="",this.colorLocked=!1}};e([o({type:B,json:{type:[z],write:{enabled:!0,isRequired:!0}}})],F.prototype,"color",void 0),e([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],F.prototype,"value",void 0),e([o({type:Boolean,json:{default:!0,write:!0}})],F.prototype,"enabled",void 0),e([o({type:String,json:{write:!0}})],F.prototype,"label",void 0),e([o({type:Boolean,json:{default:!1,write:!0}})],F.prototype,"colorLocked",void 0),F=e([m("esri.layers.voxel.VoxelIsosurface")],F);const Te=F;let U=class extends A(g){constructor(){super(...arguments),this.color=null,this.position=0}};e([o({type:B,json:{type:[z],write:{enabled:!0,isRequired:!0}}})],U.prototype,"color",void 0),e([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],U.prototype,"position",void 0),U=e([m("esri.layers.voxel.VoxelColorStop")],U);const ue=U;let W=class extends A(g){constructor(){super(...arguments),this.opacity=1,this.position=0}};e([o({type:Number,json:{name:"alpha",write:{enabled:!0,isRequired:!0}}})],W.prototype,"opacity",void 0),e([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],W.prototype,"position",void 0),W=e([m("esri.layers.voxel.VoxelOpacityStop")],W);const ce=W;let J=class extends A(g){constructor(){super(...arguments),this.enabled=!1,this.range=null}};e([o({type:Boolean,json:{default:!1,write:!0}})],J.prototype,"enabled",void 0),e([o({type:[Number],json:{write:!0}})],J.prototype,"range",void 0),J=e([m("esri.layers.voxel.VoxelRangeFilter")],J);const ut=J;var V;(function(i){i[i.Color=1]="Color",i[i.Alpha=2]="Alpha",i[i.Both=3]="Both"})(V||(V={}));let T=class extends A(g){constructor(t){super(t),this.interpolation=null,this.stretchRange=null,this.rangeFilter=null,this._colorMapSize=256,this.colorStops=new(c.ofType(ue)),this.opacityStops=new(c.ofType(ce))}set colorStops(t){this._set("colorStops",te(t,this._get("colorStops"),c.ofType(ue)))}set opacityStops(t){this._set("opacityStops",te(t,this._get("opacityStops"),c.ofType(ce)))}getPreviousNext(t,s,r){let n=t;for(;--n>0&&s[n].type!==r&&s[n].type!==V.Both;);let l=t;const u=s.length;for(;++lh.position{y.color[re]=Math.round(Z(C[re],Fe[re],v))})}else d!==-1?H.forEach(v=>{y.color[v]=r[d].color[v]}):H.forEach(v=>{y.color[v]=r[b].color[v]})}}for(const h of r)s.push({color:h.color,position:h.position})}s[0].position=0,s[s.length-1].position=1;let l=0,u=1;for(let p=0;ps[u].position;)l=u++;const y=(h-s[l].position)/(s[u].position-s[l].position),d=s[l].color,b=s[u].color,v=new B;H.forEach(C=>{v[C]=Math.round(Z(d[C],b[C],y))}),v.a=Y(1-Z(d.a,b.a,y)/255,0,1),t.push(v)}return t}getColorForContinuousDataValue(t,s){const r=this.rasterizedTransferFunction;if(this.colorStops.length<2||!Array.isArray(this.stretchRange)||this.stretchRange.length<2||r.length<256)return null;let n=this.stretchRange[0],l=this.stretchRange[1];if(n>l){const p=n;n=l,l=p}t=Y(t,n,l);const u=r[Math.round((t-n)/(l-n)*(this._colorMapSize-1))].clone();return s||(u.a=1),u}};e([o({type:["linear","nearest"],json:{write:!0}})],T.prototype,"interpolation",void 0),e([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],T.prototype,"stretchRange",void 0),e([o({type:c.ofType(ue),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.colorStops&&this.colorStops.length>0}}}}})],T.prototype,"colorStops",null),e([o({type:c.ofType(ce),json:{read:{source:"alphaStops"},write:{enabled:!0,target:"alphaStops",overridePolicy(){return{enabled:!!this.opacityStops&&this.opacityStops.length>0}}}}})],T.prototype,"opacityStops",null),e([o({type:ut,json:{write:!0}})],T.prototype,"rangeFilter",void 0),e([o({type:[B],clonable:!1,json:{read:!1}})],T.prototype,"rasterizedTransferFunction",null),T=e([m("esri.layers.voxel.VoxelTransferFunctionStyle")],T);const ct=T,H=["r","g","b"];let M=class extends A(g){constructor(){super(...arguments),this.color=B.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label=""}};e([o({type:B,json:{type:[z],write:{enabled:!0,isRequired:!0}}})],M.prototype,"color",void 0),e([o({type:z,json:{write:{enabled:!0,isRequired:!0}}})],M.prototype,"value",void 0),e([o({type:Boolean,json:{default:!0,write:!0}})],M.prototype,"enabled",void 0),e([o({type:String,json:{write:!0}})],M.prototype,"label",void 0),M=e([m("esri.layers.voxel.VoxelUniqueValue")],M);const qe=M;var ye;let P=ye=class extends g{constructor(i){super(i),this.variableId=0,this.label="",this.transferFunction=null,this.uniqueValues=null,this.isosurfaces=null,this.uniqueValues=new(c.ofType(qe)),this.isosurfaces=new(c.ofType(Te))}clone(){return new ye({variableId:this.variableId,label:this.label,transferFunction:Q(this.transferFunction),uniqueValues:Q(this.uniqueValues),isosurfaces:Q(this.isosurfaces)})}};e([o({type:z,json:{write:{enabled:!0,isRequired:!0}}})],P.prototype,"variableId",void 0),e([o({type:String,json:{write:!0}})],P.prototype,"label",void 0),e([o({type:ct,json:{write:{enabled:!0,overridePolicy(){return{enabled:!this.uniqueValues||this.uniqueValues.length<1}}}}})],P.prototype,"transferFunction",void 0),e([o({type:c.ofType(qe),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.uniqueValues&&this.uniqueValues.length>0}}}}})],P.prototype,"uniqueValues",void 0),e([o({type:c.ofType(Te),json:{write:{enabled:!0,overridePolicy(){const i=!this.uniqueValues||this.uniqueValues.length<1,t=!!this.isosurfaces&&this.isosurfaces.length>0;return{enabled:i&&t}}}}})],P.prototype,"isosurfaces",void 0),P=ye=e([m("esri.layers.voxel.VoxelVariableStyle")],P);const De=P;let K=class extends g{constructor(){super(...arguments),this.values=null}};e([o({type:[Number],json:{write:!0}})],K.prototype,"values",void 0),K=e([m("esri.layers.voxel.VoxelIrregularSpacing")],K);const yt=K;let G=class extends g{constructor(){super(...arguments),this.scale=1,this.offset=0}};e([o({type:Number,json:{write:!0}})],G.prototype,"scale",void 0),e([o({type:Number,json:{write:!0}})],G.prototype,"offset",void 0),G=e([m("esri.layers.voxel.VoxelRegularSpacing")],G);const dt=G;let x=class extends g{constructor(){super(...arguments),this.irregularSpacing=null,this.isPositiveUp=!0,this.isWrappedDateLine=!1,this.label=null,this.name=null,this.quantity=null,this.regularSpacing=null,this.size=0,this.unit=null}get isRegular(){return(this.irregularSpacing==null||this.irregularSpacing===void 0)&&this.regularSpacing!==null}getRange(){var i;return this.isRegular?[this.regularSpacing.offset,this.regularSpacing.offset+this.regularSpacing.scale*(this.size-1)]:Array.isArray((i=this.irregularSpacing)==null?void 0:i.values)&&this.irregularSpacing.values.length>1?[this.irregularSpacing.values[0],this.irregularSpacing.values[this.irregularSpacing.values.length-1]]:[0,0]}};e([o({type:yt,json:{write:!0}})],x.prototype,"irregularSpacing",void 0),e([o({type:Boolean,json:{write:!0}})],x.prototype,"isPositiveUp",void 0),e([o({type:Boolean,json:{write:!0}})],x.prototype,"isWrappedDateLine",void 0),e([o({type:String,json:{write:!0}})],x.prototype,"label",void 0),e([o({type:String,json:{write:!0}})],x.prototype,"name",void 0),e([o({type:String,json:{write:!0}})],x.prototype,"quantity",void 0),e([o({type:dt,json:{write:!0}})],x.prototype,"regularSpacing",void 0),e([o({type:Number,json:{write:!0}})],x.prototype,"size",void 0),e([o({type:String,json:{write:!0}})],x.prototype,"unit",void 0),e([o({type:Boolean,json:{read:!1}})],x.prototype,"isRegular",null),x=e([m("esri.layers.voxel.VoxelDimension")],x);const ht=x;let w=class extends g{constructor(t){super(t),this.id=0,this.dimensions=null,this.spatialReference=$e.WGS84}get zDimension(){if(!this.dimensions||!Array.isArray(this.dimensions)||this.dimensions.length!==4)return-1;for(let t=2;t<4;++t)if(this.dimensions[t].size>0)return t;return-1}get isValid(){return!!this.dimensions&&!!Array.isArray(this.dimensions)&&this.dimensions.length===4&&!(this.dimensions[0].size<1||this.dimensions[1].size<1)&&!(this.zDimension===-1||this.dimensions[this.zDimension].size<1)}get originInLayerSpace3D(){if(!this.isValid||this.volumeType==="xyt")return[0,0,0];const t=this.dimensions[0].getRange(),s=this.dimensions[1].getRange(),r=this.dimensions[2],n=r.isRegular?r.getRange():[0,r.size];return[t[0],s[0],n[0]]}get voxelSizeInLayerSpaceSigned(){if(!this.isValid||this.volumeType==="xyt")return[0,0,0];const t=this.dimensions[0].getRange(),s=this.dimensions[1].getRange(),r=this.dimensions[2],n=r.isRegular?r.getRange():[0,r.size],l=[this.sizeInVoxels[0],this.sizeInVoxels[1],this.sizeInVoxels[2]];for(let u=0;u<3;++u)l[u]<2?l[u]=1:l[u]-=1;return r.isRegular&&!r.isPositiveUp&&(l[2]*=-1),[(t[1]-t[0])/l[0],(s[1]-s[0])/l[1],(n[1]-n[0])/l[2]]}get volumeType(){if(this.isValid){const t=this.dimensions[2].size>0,s=this.dimensions[3].size>0;if(!t&&s)return"xyt";if(t&&s)return"xyzt"}return"xyz"}get sizeInVoxels(){if(!this.isValid)return[0,0,0];const t=this.zDimension;return[this.dimensions[0].size,this.dimensions[1].size,this.dimensions[t].size]}computeVoxelSpaceLocation(t){var n;if(!this.isValid)return[0,0,0];if(this.volumeType==="xyt")return L.getLogger(this).error("computeVoxelSpacePosition cannot be used with XYT volumes."),[0,0,0];if(!_e(this.spatialReference,t.spatialReference))return L.getLogger(this).error("pos argument should have the same spatial reference as the VoxelLayer."),[0,0,0];const s=X(t.x,t.y,t.z??0);Be(s,s,this.originInLayerSpace3D),Ee(s,s,this.voxelSizeInLayerSpaceSigned);const r=this.dimensions[this.zDimension];if(!r.isRegular&&Array.isArray((n=r.irregularSpacing)==null?void 0:n.values)&&r.irregularSpacing.values.length>1){const l=t.z??0,u=r.irregularSpacing.values,p=r.isPositiveUp?1:-1,h=u.reduce((y,d)=>Math.abs(p*d-l)$.normalize(R(i),0,!0))],q.prototype,"orientation",null),e([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),ee(i=>$.normalize(R(i),0,!0))],q.prototype,"tilt",null),e([o({type:[Number],json:{write:!0}})],q.prototype,"normal",void 0),e([o({type:[Number],json:{write:!0}})],q.prototype,"point",void 0),q=e([m("esri.layers.voxel.VoxelDynamicSection")],q);const he=q;var me;let D=me=class extends g{constructor(i){super(i),this.volumeId=0,this.verticalExaggeration=1,this.exaggerationMode="scale-height",this.verticalOffset=0,this.slices=new(c.ofType(oe)),this.dynamicSections=new(c.ofType(he))}set slices(i){this._set("slices",te(i,this._get("slices"),c.ofType(oe)))}set dynamicSections(i){this._set("dynamicSections",te(i,this._get("dynamicSections"),c.ofType(he)))}clone(){return new me({volumeId:this.volumeId,verticalExaggeration:this.verticalExaggeration,exaggerationMode:this.exaggerationMode,verticalOffset:this.verticalOffset,slices:Q(this.slices),dynamicSections:Q(this.dynamicSections)})}};e([o({type:z,json:{write:{enabled:!0,isRequired:!0}}})],D.prototype,"volumeId",void 0),e([o({type:Number,json:{default:1,write:!0}})],D.prototype,"verticalExaggeration",void 0),e([o({type:["scale-position","scale-height"],json:{default:"scale-height",write:!0}})],D.prototype,"exaggerationMode",void 0),e([o({type:Number,json:{default:0,write:!0}})],D.prototype,"verticalOffset",void 0),e([o({type:c.ofType(oe),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.slices&&this.slices.length>0}}}}})],D.prototype,"slices",null),e([o({type:c.ofType(he),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.dynamicSections&&this.dynamicSections.length>0}}}}})],D.prototype,"dynamicSections",null),D=me=e([m("esri.layers.voxel.VoxelVolumeStyle")],D);const Ae=D;let a=class extends ot(Ue(We(Je(Ge(Qe(Xe(Ye(it)))))))){constructor(i){super(i),this.serviceRoot="",this.operationalLayerType="Voxel",this.legendEnabled=!0,this.title=null,this.sections=null,this.currentVariableId=0,this.volumeStyles=null,this.renderMode="volume",this.variableStyles=null,this.enableSlices=!0,this.enableSections=!0,this.enableDynamicSections=!0,this.enableIsosurfaces=!0,this.shading=new Ne,this.opacity=1,this.variables=new c,this.volumes=new c,this.index=null,this.minScale=0,this.maxScale=0,this.type="voxel",this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.fullExtent=null,this.popupEnabled=!1,this.test=null,this.volumeStyles=new(c.ofType(Ae)),this.variableStyles=new(c.ofType(De)),this.sections=new(c.ofType(pe))}normalizeCtorArgs(i){return i!=null&&i.constantUpscaling&&(this.test={constantUpscaling:!0},delete i.constantUpscaling),i}set url(i){this._set("url",Ze(i,L.getLogger(this)))}load(i){const t=i!=null?i.signal:null,s=this.loadFromPortal({supportedTypes:["Scene Service"]},i).catch(He).then(()=>this._fetchService(t)).then(()=>this.serviceRoot=this.url);return this.addResolvingPromise(s),Promise.resolve(this)}read(i,t){super.read(i,t);for(const s of this.volumes)s.spatialReference=this.spatialReference}readVersion(i,t){return super.parseVersionString(i)}validateLayer(i){if(i.layerType&&i.layerType!==this.operationalLayerType)throw new le("voxel-layer:layer-type-not-supported","VoxelLayer does not support this layer type",{layerType:i.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor)||this.version.major<3)throw new le("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"});if(this.version.major>3)throw new le("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"})}readFullExtent(i,t,s){if(i!=null&&typeof i=="object"){const r=Re.fromJSON(i,s);if(r.zmin===0&&r.zmax===0&&Array.isArray(t.volumes)){const n=Le.fromJSON(t.volumes[0]);if(n.isValid&&n.volumeType!=="xyt"){const l=n.dimensions[2];if(l.isRegular){let u=l.regularSpacing.offset,p=l.regularSpacing.offset+l.regularSpacing.scale*(l.size-1);if(u>p){const h=u;u=p,p=h}r.zmin=u,r.zmax=p}}}return r}return null}get voxelFields(){const i=[new E({name:"Voxel.ServiceValue",alias:"Value",domain:null,editable:!1,length:128,type:"string"}),new E({name:"Voxel.ServiceVariableLabel",alias:"Variable",domain:null,editable:!1,length:128,type:"string"}),new E({name:"Voxel.Position",alias:"Voxel Position",domain:null,editable:!1,length:128,type:"string"})],t=this.getVolume(null);if(t!=null){if(t.volumeType==="xyzt"||t.volumeType==="xyt"){const s=new E({name:"Voxel.ServiceLocalTime",alias:"Local Time",domain:null,editable:!1,length:128,type:"string"});i.push(s);const r=new E({name:"Voxel.ServiceNativeTime",alias:"Native Time",domain:null,editable:!1,length:128,type:"string"});i.push(r)}if(t.volumeType!=="xyt"){const s=new E({name:"Voxel.ServiceDepth",alias:"Depth",domain:null,editable:!1,length:128,type:"string"});i.push(s)}}return i}get popupTemplate(){return this.loaded?this.createPopupTemplate():null}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(i){const t=this.voxelFields,s=this.title;return nt({fields:t,title:s},i)}getConfiguration(){var t,s;const i={layerType:this.operationalLayerType,version:this.version.versionString,name:this.title,spatialReference:this.spatialReference,fullExtent:this.fullExtent,volumes:this.volumes.toJSON(),variables:this.variables.toJSON(),index:(t=this.index)==null?void 0:t.toJSON(),sections:this.getSections(),style:{volumeStyles:this.getVolumeStyles(),currentVariableId:this.currentVariableId,renderMode:this.renderMode,variableStyles:this.getVariableStyles(),enableSections:this.enableSections,enableDynamicSections:this.enableDynamicSections,enableIsosurfaces:this.enableIsosurfaces,enableSlices:this.enableSlices,shading:this.shading}};return i.index&&((s=this.index)!=null&&s.isValid())?JSON.stringify(i):""}getVariableStyle(i){let t=-1;if(t=i??this.currentVariableId,!this.variableStyles||t===-1)return null;const s=this.variableStyles.findIndex(r=>r.variableId===t);return s<0?null:this.variableStyles.at(s)}getVariable(i){let t=-1;if(t=i??this.currentVariableId,!this.variables||t===-1)return null;const s=this.variables.findIndex(r=>r.id===t);return s<0?null:this.variables.at(s)}getVolume(i){const t=this.getVariable(i);return t!=null?this.volumes.find(({id:s})=>s===t.volumeId):null}getVolumeStyle(i){const t=this.getVariable(i);return t!=null?this.volumeStyles.find(({volumeId:s})=>s===t.volumeId):null}getColorForContinuousDataValue(i,t,s){var u;const r=this.getVariable(i);if(r==null||((u=r.renderingFormat)==null?void 0:u.continuity)!=="continuous"||!this.variableStyles)return null;const n=this.variableStyles.findIndex(p=>p.variableId===i);if(n<0)return null;const l=this.variableStyles.at(n);return l!=null&&l.transferFunction?l.transferFunction.getColorForContinuousDataValue(t,s):null}getSections(){const i=[];for(const t of this.sections)i.push(new pe({enabled:t.enabled,href:t.href,id:t.id,label:t.label,normal:t.normal,point:t.point,sizeInPixel:t.sizeInPixel,slices:t.slices,timeId:t.timeId,variableId:t.variableId}));return i}getVariableStyles(){const i=[];for(const t of this.variableStyles){const s=this._getVariable(t);if(s!=null){const r=t.clone();r.isosurfaces.length>4&&(r.isosurfaces=r.isosurfaces.slice(0,3),L.getLogger(this).error("A maximum of 4 isosurfaces are supported for Voxel Layers."));for(const n of r.isosurfaces)if(!n.colorLocked){const l=this.getColorForContinuousDataValue(r.variableId,n.value,!1);l===null||l.equals(n.color)||(n.color=l)}if(s.renderingFormat.continuity==="continuous")(r.transferFunction===null||r.transferFunction.colorStops.length<2)&&L.getLogger(this).error(`VoxelVariableStyle for variable ${s.id} is invalid. At least 2 color stops are required in the transferFunction for continuous Voxel Layer variables.`),r.transferFunction!==null&&(Array.isArray(r.transferFunction.stretchRange)&&r.transferFunction.stretchRange.length===2||(L.getLogger(this).error(`VoxelVariableStyle for variable ${s.id} is invalid. The stretchRange of the transferFunction for continuous Voxel Layer variables must be of the form [minimumDataValue, maximumDataValue].`),r.transferFunction.stretchRange=[0,1],r.transferFunction.colorStops.removeAll()));else if(s.renderingFormat.continuity==="discrete")if(t.uniqueValues.length===0)L.getLogger(this).error(`VoxelVariableStyle for variable ${s.id} is invalid. Unique values are required for discrete Voxel Layer variables.`);else for(const n of t.uniqueValues)n.label!==null&&n.label!==void 0||n.value===null||n.value===void 0||(n.label=n.value.toString());i.push(r)}else L.getLogger(this).error(`VoxelVariable ID=${t.variableId} doesn't exist, VoxelVariableStyle for this VoxelVariable will be ignored.`)}return i}getVolumeStyles(){const i=[];for(const t of this.volumeStyles){const s=this._getVolumeFromVolumeId(t.volumeId);if(s!=null){const r=t.clone();for(const n of r.slices)this._isPlaneValid(n,[0,1,s.zDimension],s.dimensions)||(n.enabled=!1,n.label="invalid");for(const n of r.dynamicSections)this._isPlaneValid(n,[0,1,s.zDimension],s.dimensions)||(n.enabled=!1,n.label="invalid");i.push(r)}else L.getLogger(this).error(`VoxelVolume ID=${t.volumeId} doesn't exist, VoxelVolumeStyle for this VoxelVolume will be ignored.`)}return i}_getVariable(i){const t=i.variableId;for(const s of this.variables)if(s.id===t)return s;return null}_getVolumeFromVolumeId(i){for(const t of this.volumes)if(t.id===i)return t;return null}_isPlaneValid(i,t,s){if(!i.point||!Array.isArray(i.point)||i.point.length!==3||!i.normal||!Array.isArray(i.normal)||i.normal.length!==3)return!1;const r=X(i.normal[0],i.normal[1],i.normal[2]);return ge(r,r),!(Math.abs(r[0])+Math.abs(r[1])+Math.abs(r[2])<1e-6)&&(i.normal[0]=r[0],i.normal[1]=r[1],i.normal[2]=r[2],!0)}};e([o({type:["Voxel"]})],a.prototype,"operationalLayerType",void 0),e([o(Ke)],a.prototype,"legendEnabled",void 0),e([o({json:{write:!0}})],a.prototype,"title",void 0),e([o(et)],a.prototype,"url",null),e([o({type:c.ofType(pe),json:{origins:{"web-scene":{name:"layerDefinition.sections",write:!0}}}})],a.prototype,"sections",void 0),e([o({type:z,json:{origins:{"web-scene":{name:"layerDefinition.style.currentVariableId",write:{enabled:!0,isRequired:!0,ignoreOrigin:!0}},service:{name:"style.currentVariableId"}}}})],a.prototype,"currentVariableId",void 0),e([o({type:c.ofType(Ae),json:{origins:{"web-scene":{name:"layerDefinition.style.volumeStyles",write:!0},service:{name:"style.volumeStyles"}}}})],a.prototype,"volumeStyles",void 0),e([o({type:["volume","surfaces"],json:{origins:{"web-scene":{name:"layerDefinition.style.renderMode",write:!0},service:{name:"style.renderMode"}}}})],a.prototype,"renderMode",void 0),e([o({type:c.ofType(De),json:{origins:{"web-scene":{name:"layerDefinition.style.variableStyles",write:!0},service:{name:"style.variableStyles"}}}})],a.prototype,"variableStyles",void 0),e([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSlices",write:!0},service:{name:"style.enableSlices"}}}})],a.prototype,"enableSlices",void 0),e([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSections",write:!0},service:{name:"style.enableSections"}}}})],a.prototype,"enableSections",void 0),e([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableDynamicSections",write:!0},service:{name:"style.enableDynamicSections"}}}})],a.prototype,"enableDynamicSections",void 0),e([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableIsosurfaces",write:!0},service:{name:"style.enableIsosurfaces"}}}})],a.prototype,"enableIsosurfaces",void 0),e([o({type:Ne,json:{origins:{"web-scene":{name:"layerDefinition.style.shading",write:!0},service:{name:"style.shading"}}}})],a.prototype,"shading",void 0),e([o({type:["show","hide"]})],a.prototype,"listMode",void 0),e([o({type:Number,range:{min:0,max:1},nonNullable:!0,json:{read:!1,write:!1,origins:{"web-scene":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],a.prototype,"opacity",void 0),e([o({type:c.ofType(pt)})],a.prototype,"variables",void 0),e([o({type:c.ofType(Le)})],a.prototype,"volumes",void 0),e([o({type:mt})],a.prototype,"index",void 0),e([o({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],a.prototype,"minScale",void 0),e([o({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],a.prototype,"maxScale",void 0),e([o({json:{read:!1},readOnly:!0})],a.prototype,"type",void 0),e([o({readOnly:!0,json:{name:"serviceVersion"}})],a.prototype,"version",void 0),e([be("service","version")],a.prototype,"readVersion",null),e([o({type:Re})],a.prototype,"fullExtent",void 0),e([be("service","fullExtent",["fullExtent"])],a.prototype,"readFullExtent",null),e([o({readOnly:!0,clonable:!1,json:{read:!1}})],a.prototype,"voxelFields",null),e([o({type:Boolean,json:{name:"disablePopup",read:{reader:(i,t)=>!t.disablePopup},write:{enabled:!0,ignoreOrigin:!0,writer(i,t,s){t[s]=!i}},origins:{"portal-item":{default:!0},"web-scene":{default:!0}}}})],a.prototype,"popupEnabled",void 0),e([o({type:tt,json:{read:!1}})],a.prototype,"popupTemplate",null),e([o({readOnly:!0})],a.prototype,"defaultPopupTemplate",null),a=e([m("esri.layers.VoxelLayer")],a);const Jt=a;export{Jt as default}; diff --git a/assets/WFSLayer-B8MZMVqa.js b/assets/WFSLayer-DypvB2tP.js similarity index 87% rename from assets/WFSLayer-B8MZMVqa.js rename to assets/WFSLayer-DypvB2tP.js index ada21c3..e159d75 100644 --- a/assets/WFSLayer-B8MZMVqa.js +++ b/assets/WFSLayer-DypvB2tP.js @@ -1 +1 @@ -import{d as t,y as i,f as T,fw as U,k as J,aE as C,N as k,d3 as h,dc as W,ec as X,E as Y,s as D,W as H,dO as L,bP as Q,bQ as G,dp as V,dq as z,dr as A,aS as P,fA as R,b3 as B,a_ as j,b1 as M,bW as Z,aX as y,dR as K,e8 as ee,aR as te,fB as re,dt as ie,dS as f,fT as oe,fD as se,i as ae,fE as ne,du as pe,bT as le}from"./index-CEWggaxV.js";import"./UniqueValueRenderer-BlkUix3g.js";import{a as de,u as ue}from"./jsonUtils-BseLl1fZ.js";import{l as me,o as ye}from"./clientSideDefaults-CgRgH99f.js";import{v as ce,Y as fe,z as he,W as ge,S as we}from"./wfsUtils-DeNqsSXH.js";import{d as ve}from"./FeatureSet-CYJUZgOk.js";import{p as Fe}from"./FeatureEffectLayer-CLTrRFqx.js";import{c as be}from"./FeatureReductionLayer-DncGsNIN.js";import{c as xe}from"./OrderedLayer-Do089KpQ.js";import{f as Oe}from"./RefreshableLayer-1EkEhJeI.js";import{f as Se}from"./TemporalLayer-qq3v_i3q.js";import{s as Re}from"./fieldProperties-DMs4wT6-.js";import{C as Ie}from"./LabelClass-6cZokw8y.js";import{i as Te}from"./labelingInfo-CijajRsc.js";import{p as Ce}from"./popupUtils-DAFYyAvw.js";import"./ColorStop-44hBlQ14.js";import"./diffUtils-B4YFa5Ju.js";import"./colorRamps-BJydlf0f.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-z2k12BH8.js";import"./jsonUtils-qYmXvGJ1.js";import"./styleUtils-CnV_Xzhi.js";import"./Version-Bd0QsIQ5.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./OverrideHelper-B4ryGWZb.js";import"./utils-p-5Bbga5.js";import"./quantizationUtils-CUjGHrU3.js";import"./heatmapUtils-Clt5rJzr.js";import"./QueryEngineCapabilities-CTDe3LlQ.js";import"./defaultsJSON-CHAaurhX.js";import"./geojson-BLwRz6JF.js";import"./date-M6n_RqpC.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./xmlUtils-CtUoQO7q.js";import"./FeatureEffect-ByrbZlne.js";import"./FeatureReductionSelection-BY3KVXac.js";import"./featureLayerUtils-BhDaw8pS.js";import"./AttachmentQuery-D61mmWw4.js";import"./RelationshipQuery-DDK72Kwc.js";import"./MD5-C9MwAd2G.js";import"./OrderByInfo-DKzv2-WS.js";import"./TimeInfo-3TVmpFSA.js";import"./labelUtils-Dnqx6jl5.js";let d=class extends U{constructor(){super(...arguments),this._connection=null,this._workerHandler=null,this.capabilities=me(!1,!1),this.type="wfs",this.refresh=J(async()=>{await this.load();const e={customParameters:this.layer.customParameters,maxRecordCount:this.layer.maxRecordCount,maxTotalRecordCount:this.layer.maxTotalRecordCount,maxPageCount:this.layer.maxPageCount},{extent:r}=await this._workerHandler.refresh(e);return r&&(this.sourceJSON.extent=r),{dataChanged:!0,updates:{extent:this.sourceJSON.extent}}})}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker({signal:r})),Promise.resolve(this)}destroy(){var e;(e=this._connection)==null||e.close(),this._connection=null,this._workerHandler=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,r={}){const s=await this.queryFeaturesJSON(e,r);return ve.fromJSON(s)}async queryFeaturesJSON(e,r={}){return await this.load(r),this._workerHandler.queryFeatures(e?e.toJSON():void 0,r)}async queryFeatureCount(e,r={}){return await this.load(r),this._workerHandler.queryFeatureCount(e?e.toJSON():void 0,r)}async queryObjectIds(e,r={}){return await this.load(r),this._workerHandler.queryObjectIds(e?e.toJSON():void 0,r)}async queryExtent(e,r={}){await this.load(r);const s=await this._workerHandler.queryExtent(e?e.toJSON():void 0,r);return{count:s.count,extent:C.fromJSON(s.extent)}}async querySnapping(e,r={}){return await this.load(r),this._workerHandler.querySnapping(e,r)}async _createLoadOptions(e){var O,S;const{url:r,customParameters:s,name:n,namespaceUri:p,fields:a,geometryType:u,maxRecordCount:m,maxPageCount:g,maxTotalRecordCount:w,swapXY:v}=this.layer,c=this.layer.originOf("spatialReference")==="defaults"?void 0:this.layer.spatialReference;if(!r)throw new k("wfs-layer:missing-url","WFSLayer must be created with a url");this.wfsCapabilities||(this.wfsCapabilities=await ce(r,{customParameters:s,...e}));const $=["fields","geometryType","name","namespaceUri","swapXY"].some(F=>this.layer[F]==null),l=$?await fe(this.wfsCapabilities,n,p,{spatialReference:c,customParameters:s,signal:e==null?void 0:e.signal}):{...he(a??[]),geometryType:u,name:n,namespaceUri:p,spatialReference:c,swapXY:v},q=ge(this.wfsCapabilities.readFeatureTypes(),l.name,l.namespaceUri),E=h.toJSON(l.geometryType),{operations:x}=this.wfsCapabilities,_=x.GetFeature.url,N=x.GetFeature.outputFormat;return{customParameters:s,featureType:q,fields:((O=l.fields)==null?void 0:O.map(F=>F.toJSON()))??[],geometryField:l.geometryField,geometryType:E,getFeatureUrl:_,getFeatureOutputFormat:N,maxRecordCount:m,maxPageCount:g,maxTotalRecordCount:w,objectIdField:l.objectIdField,spatialReference:(S=l.spatialReference)==null?void 0:S.toJSON(),swapXY:!!l.swapXY}}async _startWorker(e){const[r,s]=await W([this._createLoadOptions(e),X("WFSSourceWorker",{...e,strategy:Y("feature-layers-workers")?"dedicated":"local",registryTarget:this})]),n=r.error||s.error||null,p=s.value||null;if(n)throw p&&p.close(),n;const a=r.value;this._connection=s.value,this._workerHandler=this._connection.createInvokeProxy();const u=await this._workerHandler.load(a,e);for(const m of u.warnings)D.getLogger(this.layer).warn("#load()",`${m.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:m});this.sourceJSON={dateFieldsTimeReference:{timeZoneIANA:H},extent:u.extent,fields:a.fields,geometryType:a.geometryType,objectIdField:a.objectIdField,geometryField:a.geometryField,drawingInfo:ye(a.geometryType),name:a.featureType.title,wfsInfo:{name:a.featureType.name,featureUrl:a.getFeatureUrl,maxFeatures:a.maxRecordCount,swapXY:a.swapXY,supportedSpatialReferences:a.featureType.supportedSpatialReferences,version:"2.0.0",wfsNamespace:a.featureType.namespaceUri}}}};t([i()],d.prototype,"capabilities",void 0),t([i({constructOnly:!0})],d.prototype,"layer",void 0),t([i()],d.prototype,"sourceJSON",void 0),t([i()],d.prototype,"type",void 0),t([i()],d.prototype,"wfsCapabilities",void 0),d=t([T("esri.layers.graphics.sources.WFSSource")],d);var b;const I=Re();let o=b=class extends xe(L(be(Fe(Q(Se(Oe(G(V(z(A(le))))))))))){static fromWFSLayerInfo(e){const{customParameters:r,fields:s,geometryField:n,geometryType:p,name:a,namespaceUri:u,objectIdField:m,spatialReference:g,swapXY:w,url:v,wfsCapabilities:c}=e;return new b({customParameters:r,fields:s,geometryField:n,geometryType:p,name:a,namespaceUri:u,objectIdField:m,spatialReference:g,swapXY:w,url:v,wfsCapabilities:c})}constructor(e){super(e),this.copyright=null,this.customParameters=null,this.dateFieldsTimeZone=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.featureUrl=void 0,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="WFS",this.maxRecordCount=3e3,this.maxPageCount=10,this.maxTotalRecordCount=2e5,this.mode=0,this.name=null,this.namespaceUri=null,this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new d({layer:this}),this.spatialReference=P.WGS84,this.spatialReferences=[4326],this.swapXY=void 0,this.title="WFS",this.type="wfs",this.url=null,this.version=void 0}destroy(){var e;(e=this.source)==null||e.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WFS"]},e).then(()=>this.source.load(e)).then(()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo","spatialReference","name","namespaceUri"],"service"),R(this.renderer,this.fieldsIndex),B(this.timeInfo,this.fieldsIndex)})),Promise.resolve(this)}get capabilities(){var e;return(e=this.source)==null?void 0:e.capabilities}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,r,s){const n=e.filter(p=>p.name!==we);this.geometryField&&n.unshift(new j({name:this.geometryField,alias:this.geometryField,type:"geometry"})),M(s,n.map(p=>p.toJSON()),r)}get parsedUrl(){return Z(this.url)}set renderer(e){R(e,this.fieldsIndex),this._set("renderer",e)}get wfsCapabilities(){var e;return(e=this.source)==null?void 0:e.wfsCapabilities}set wfsCapabilities(e){this.source&&(this.source.wfsCapabilities=e)}createPopupTemplate(e){return Ce(this,e)}createQuery(){const e=new y;e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1";const{timeOffset:r,timeExtent:s}=this;return e.timeExtent=r!=null&&s!=null?s.offset(-r.value,r.unit):s||null,e}getFieldDomain(e,r){var s;return(s=this.getField(e))==null?void 0:s.domain}getField(e){var r;return(r=this.fieldsIndex)==null?void 0:r.get(e)}queryFeatures(e,r){return this.load().then(()=>this.source.queryFeatures(y.from(e)||this.createQuery(),r)).then(s=>{if(s!=null&&s.features)for(const n of s.features)n.layer=n.sourceLayer=this;return s})}queryObjectIds(e,r){return this.load().then(()=>this.source.queryObjectIds(y.from(e)||this.createQuery(),r))}queryFeatureCount(e,r){return this.load().then(()=>this.source.queryFeatureCount(y.from(e)||this.createQuery(),r))}queryExtent(e,r){return this.load().then(()=>this.source.queryExtent(y.from(e)||this.createQuery(),r))}async hasDataChanged(){try{const{dataChanged:e,updates:r}=await this.source.refresh();return r!=null&&this.read(r,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};t([i({readOnly:!0})],o.prototype,"capabilities",null),t([i({type:String})],o.prototype,"copyright",void 0),t([i({readOnly:!0})],o.prototype,"createQueryVersion",null),t([i({json:{name:"wfsInfo.customParameters",write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0),ignoreOrigin:!0})}}})],o.prototype,"customParameters",void 0),t([i(K("dateFieldsTimeReference"))],o.prototype,"dateFieldsTimeZone",void 0),t([i({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),t([i({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),t([i({type:String})],o.prototype,"displayField",void 0),t([i(ee)],o.prototype,"elevationInfo",void 0),t([i({type:String,readOnly:!0,json:{name:"wfsInfo.featureUrl",write:{ignoreOrigin:!0,isRequired:!0}}})],o.prototype,"featureUrl",void 0),t([i({type:[j],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],o.prototype,"fields",void 0),t([te("fields")],o.prototype,"writeFields",null),t([i(I.fieldsIndex)],o.prototype,"fieldsIndex",void 0),t([i({type:C,json:{name:"extent"}})],o.prototype,"fullExtent",void 0),t([i()],o.prototype,"geometryField",void 0),t([i({type:String,json:{read:{source:"layerDefinition.geometryType",reader:h.read},write:{target:"layerDefinition.geometryType",writer:h.write,ignoreOrigin:!0},origins:{service:{read:h.read}}}})],o.prototype,"geometryType",void 0),t([i({type:String})],o.prototype,"id",void 0),t([i(re)],o.prototype,"labelsVisible",void 0),t([i({type:[Ie],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:Te},write:!0}})],o.prototype,"labelingInfo",void 0),t([i(ie)],o.prototype,"legendEnabled",void 0),t([i({type:["show","hide"]})],o.prototype,"listMode",void 0),t([i({type:String})],o.prototype,"objectIdField",void 0),t([i({type:["WFS"]})],o.prototype,"operationalLayerType",void 0),t([i({type:f,json:{name:"wfsInfo.maxFeatures",write:{ignoreOrigin:!0,isRequired:!0}}})],o.prototype,"maxRecordCount",void 0),t([i({type:f})],o.prototype,"maxPageCount",void 0),t([i({type:f})],o.prototype,"maxTotalRecordCount",void 0),t([i({type:[0],readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],o.prototype,"mode",void 0),t([i({type:String,json:{name:"wfsInfo.name",write:{ignoreOrigin:!0,isRequired:!0}}})],o.prototype,"name",void 0),t([i({type:String,json:{name:"wfsInfo.wfsNamespace",write:{ignoreOrigin:!0,isRequired:!0}}})],o.prototype,"namespaceUri",void 0),t([i(oe)],o.prototype,"opacity",void 0),t([i(I.outFields)],o.prototype,"outFields",void 0),t([i({readOnly:!0})],o.prototype,"parsedUrl",null),t([i(se)],o.prototype,"popupEnabled",void 0),t([i({type:ae,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),t([i({types:de,json:{origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:ue,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:{ignoreOrigin:!0}}})],o.prototype,"renderer",null),t([i(ne)],o.prototype,"screenSizePerspectiveEnabled",void 0),t([i({readOnly:!0})],o.prototype,"source",void 0),t([i({type:P,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"extent.spatialReference"}}}})],o.prototype,"spatialReference",void 0),t([i({readOnly:!0,type:[f],json:{name:"wfsInfo.supportedSpatialReferences",write:{ignoreOrigin:!0,isRequired:!0}}})],o.prototype,"spatialReferences",void 0),t([i({type:Boolean,value:!1,json:{name:"wfsInfo.swapXY",write:{ignoreOrigin:!0,isRequired:!0}}})],o.prototype,"swapXY",void 0),t([i({json:{write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"name"}}}})],o.prototype,"title",void 0),t([i({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),t([i(pe)],o.prototype,"url",void 0),t([i({type:String,readOnly:!0,json:{name:"wfsInfo.version",write:{ignoreOrigin:!0,isRequired:!0}}})],o.prototype,"version",void 0),t([i()],o.prototype,"wfsCapabilities",null),o=b=t([T("esri.layers.WFSLayer")],o);const vt=o;export{vt as default}; +import{d as t,y as i,f as T,fw as U,k as J,aE as C,N as k,d3 as h,dc as W,ec as X,E as Y,s as D,W as H,dO as L,bP as Q,bQ as G,dp as V,dq as z,dr as A,aS as P,fA as R,b3 as B,a_ as j,b1 as M,bW as Z,aX as y,dR as K,e8 as ee,aR as te,fB as re,dt as ie,dS as f,fT as oe,fD as se,i as ae,fE as ne,du as pe,bT as le}from"./index-BjUNJPVf.js";import"./UniqueValueRenderer-7V9Bhr-D.js";import{a as de,u as ue}from"./jsonUtils-Dw332y6z.js";import{l as me,o as ye}from"./clientSideDefaults-BQP5n3lX.js";import{v as ce,Y as fe,z as he,W as ge,S as we}from"./wfsUtils-p2GOBpZe.js";import{d as ve}from"./FeatureSet-opEn8ou8.js";import{p as Fe}from"./FeatureEffectLayer-DarO4Ctx.js";import{c as be}from"./FeatureReductionLayer-CK-tyM-9.js";import{c as xe}from"./OrderedLayer-dLoPhxcx.js";import{f as Oe}from"./RefreshableLayer-_r2TPtol.js";import{f as Se}from"./TemporalLayer-CKICYnEl.js";import{s as Re}from"./fieldProperties-DnrQXLBM.js";import{C as Ie}from"./LabelClass-CeatfK8u.js";import{i as Te}from"./labelingInfo-DqAUis6e.js";import{p as Ce}from"./popupUtils-DlZin22m.js";import"./ColorStop-DCGjAKLC.js";import"./diffUtils-uUoMDFQS.js";import"./colorRamps-CcakIWlU.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-BX9G5gNQ.js";import"./jsonUtils-Ox5U0P0F.js";import"./styleUtils-DOUOskVZ.js";import"./Version-Dqq_CHBG.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./OverrideHelper-DxFZBnGL.js";import"./utils-CuXO_Zzq.js";import"./quantizationUtils-CfV316jZ.js";import"./heatmapUtils-BSteZBTj.js";import"./QueryEngineCapabilities-CTDe3LlQ.js";import"./defaultsJSON-CHAaurhX.js";import"./geojson-AjfTISUf.js";import"./date-M6n_RqpC.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./xmlUtils-CtUoQO7q.js";import"./FeatureEffect-DBbkrS6j.js";import"./FeatureReductionSelection-t3T7oa8H.js";import"./featureLayerUtils-lwqyOSrl.js";import"./AttachmentQuery-DmEAIZff.js";import"./RelationshipQuery-BDJrOxaX.js";import"./MD5-C9MwAd2G.js";import"./OrderByInfo-DKyk5GLW.js";import"./TimeInfo-DooETFWC.js";import"./labelUtils-3p0-m-Ee.js";let d=class extends U{constructor(){super(...arguments),this._connection=null,this._workerHandler=null,this.capabilities=me(!1,!1),this.type="wfs",this.refresh=J(async()=>{await this.load();const e={customParameters:this.layer.customParameters,maxRecordCount:this.layer.maxRecordCount,maxTotalRecordCount:this.layer.maxTotalRecordCount,maxPageCount:this.layer.maxPageCount},{extent:r}=await this._workerHandler.refresh(e);return r&&(this.sourceJSON.extent=r),{dataChanged:!0,updates:{extent:this.sourceJSON.extent}}})}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker({signal:r})),Promise.resolve(this)}destroy(){var e;(e=this._connection)==null||e.close(),this._connection=null,this._workerHandler=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,r={}){const s=await this.queryFeaturesJSON(e,r);return ve.fromJSON(s)}async queryFeaturesJSON(e,r={}){return await this.load(r),this._workerHandler.queryFeatures(e?e.toJSON():void 0,r)}async queryFeatureCount(e,r={}){return await this.load(r),this._workerHandler.queryFeatureCount(e?e.toJSON():void 0,r)}async queryObjectIds(e,r={}){return await this.load(r),this._workerHandler.queryObjectIds(e?e.toJSON():void 0,r)}async queryExtent(e,r={}){await this.load(r);const s=await this._workerHandler.queryExtent(e?e.toJSON():void 0,r);return{count:s.count,extent:C.fromJSON(s.extent)}}async querySnapping(e,r={}){return await this.load(r),this._workerHandler.querySnapping(e,r)}async _createLoadOptions(e){var O,S;const{url:r,customParameters:s,name:n,namespaceUri:p,fields:a,geometryType:u,maxRecordCount:m,maxPageCount:g,maxTotalRecordCount:w,swapXY:v}=this.layer,c=this.layer.originOf("spatialReference")==="defaults"?void 0:this.layer.spatialReference;if(!r)throw new k("wfs-layer:missing-url","WFSLayer must be created with a url");this.wfsCapabilities||(this.wfsCapabilities=await ce(r,{customParameters:s,...e}));const $=["fields","geometryType","name","namespaceUri","swapXY"].some(F=>this.layer[F]==null),l=$?await fe(this.wfsCapabilities,n,p,{spatialReference:c,customParameters:s,signal:e==null?void 0:e.signal}):{...he(a??[]),geometryType:u,name:n,namespaceUri:p,spatialReference:c,swapXY:v},q=ge(this.wfsCapabilities.readFeatureTypes(),l.name,l.namespaceUri),E=h.toJSON(l.geometryType),{operations:x}=this.wfsCapabilities,_=x.GetFeature.url,N=x.GetFeature.outputFormat;return{customParameters:s,featureType:q,fields:((O=l.fields)==null?void 0:O.map(F=>F.toJSON()))??[],geometryField:l.geometryField,geometryType:E,getFeatureUrl:_,getFeatureOutputFormat:N,maxRecordCount:m,maxPageCount:g,maxTotalRecordCount:w,objectIdField:l.objectIdField,spatialReference:(S=l.spatialReference)==null?void 0:S.toJSON(),swapXY:!!l.swapXY}}async _startWorker(e){const[r,s]=await W([this._createLoadOptions(e),X("WFSSourceWorker",{...e,strategy:Y("feature-layers-workers")?"dedicated":"local",registryTarget:this})]),n=r.error||s.error||null,p=s.value||null;if(n)throw p&&p.close(),n;const a=r.value;this._connection=s.value,this._workerHandler=this._connection.createInvokeProxy();const u=await this._workerHandler.load(a,e);for(const m of u.warnings)D.getLogger(this.layer).warn("#load()",`${m.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:m});this.sourceJSON={dateFieldsTimeReference:{timeZoneIANA:H},extent:u.extent,fields:a.fields,geometryType:a.geometryType,objectIdField:a.objectIdField,geometryField:a.geometryField,drawingInfo:ye(a.geometryType),name:a.featureType.title,wfsInfo:{name:a.featureType.name,featureUrl:a.getFeatureUrl,maxFeatures:a.maxRecordCount,swapXY:a.swapXY,supportedSpatialReferences:a.featureType.supportedSpatialReferences,version:"2.0.0",wfsNamespace:a.featureType.namespaceUri}}}};t([i()],d.prototype,"capabilities",void 0),t([i({constructOnly:!0})],d.prototype,"layer",void 0),t([i()],d.prototype,"sourceJSON",void 0),t([i()],d.prototype,"type",void 0),t([i()],d.prototype,"wfsCapabilities",void 0),d=t([T("esri.layers.graphics.sources.WFSSource")],d);var b;const I=Re();let o=b=class extends xe(L(be(Fe(Q(Se(Oe(G(V(z(A(le))))))))))){static fromWFSLayerInfo(e){const{customParameters:r,fields:s,geometryField:n,geometryType:p,name:a,namespaceUri:u,objectIdField:m,spatialReference:g,swapXY:w,url:v,wfsCapabilities:c}=e;return new b({customParameters:r,fields:s,geometryField:n,geometryType:p,name:a,namespaceUri:u,objectIdField:m,spatialReference:g,swapXY:w,url:v,wfsCapabilities:c})}constructor(e){super(e),this.copyright=null,this.customParameters=null,this.dateFieldsTimeZone=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.featureUrl=void 0,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="WFS",this.maxRecordCount=3e3,this.maxPageCount=10,this.maxTotalRecordCount=2e5,this.mode=0,this.name=null,this.namespaceUri=null,this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new d({layer:this}),this.spatialReference=P.WGS84,this.spatialReferences=[4326],this.swapXY=void 0,this.title="WFS",this.type="wfs",this.url=null,this.version=void 0}destroy(){var e;(e=this.source)==null||e.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WFS"]},e).then(()=>this.source.load(e)).then(()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo","spatialReference","name","namespaceUri"],"service"),R(this.renderer,this.fieldsIndex),B(this.timeInfo,this.fieldsIndex)})),Promise.resolve(this)}get capabilities(){var e;return(e=this.source)==null?void 0:e.capabilities}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,r,s){const n=e.filter(p=>p.name!==we);this.geometryField&&n.unshift(new j({name:this.geometryField,alias:this.geometryField,type:"geometry"})),M(s,n.map(p=>p.toJSON()),r)}get parsedUrl(){return Z(this.url)}set renderer(e){R(e,this.fieldsIndex),this._set("renderer",e)}get wfsCapabilities(){var e;return(e=this.source)==null?void 0:e.wfsCapabilities}set wfsCapabilities(e){this.source&&(this.source.wfsCapabilities=e)}createPopupTemplate(e){return Ce(this,e)}createQuery(){const e=new y;e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1";const{timeOffset:r,timeExtent:s}=this;return e.timeExtent=r!=null&&s!=null?s.offset(-r.value,r.unit):s||null,e}getFieldDomain(e,r){var s;return(s=this.getField(e))==null?void 0:s.domain}getField(e){var r;return(r=this.fieldsIndex)==null?void 0:r.get(e)}queryFeatures(e,r){return this.load().then(()=>this.source.queryFeatures(y.from(e)||this.createQuery(),r)).then(s=>{if(s!=null&&s.features)for(const n of s.features)n.layer=n.sourceLayer=this;return s})}queryObjectIds(e,r){return this.load().then(()=>this.source.queryObjectIds(y.from(e)||this.createQuery(),r))}queryFeatureCount(e,r){return this.load().then(()=>this.source.queryFeatureCount(y.from(e)||this.createQuery(),r))}queryExtent(e,r){return this.load().then(()=>this.source.queryExtent(y.from(e)||this.createQuery(),r))}async hasDataChanged(){try{const{dataChanged:e,updates:r}=await this.source.refresh();return r!=null&&this.read(r,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};t([i({readOnly:!0})],o.prototype,"capabilities",null),t([i({type:String})],o.prototype,"copyright",void 0),t([i({readOnly:!0})],o.prototype,"createQueryVersion",null),t([i({json:{name:"wfsInfo.customParameters",write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0),ignoreOrigin:!0})}}})],o.prototype,"customParameters",void 0),t([i(K("dateFieldsTimeReference"))],o.prototype,"dateFieldsTimeZone",void 0),t([i({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),t([i({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),t([i({type:String})],o.prototype,"displayField",void 0),t([i(ee)],o.prototype,"elevationInfo",void 0),t([i({type:String,readOnly:!0,json:{name:"wfsInfo.featureUrl",write:{ignoreOrigin:!0,isRequired:!0}}})],o.prototype,"featureUrl",void 0),t([i({type:[j],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],o.prototype,"fields",void 0),t([te("fields")],o.prototype,"writeFields",null),t([i(I.fieldsIndex)],o.prototype,"fieldsIndex",void 0),t([i({type:C,json:{name:"extent"}})],o.prototype,"fullExtent",void 0),t([i()],o.prototype,"geometryField",void 0),t([i({type:String,json:{read:{source:"layerDefinition.geometryType",reader:h.read},write:{target:"layerDefinition.geometryType",writer:h.write,ignoreOrigin:!0},origins:{service:{read:h.read}}}})],o.prototype,"geometryType",void 0),t([i({type:String})],o.prototype,"id",void 0),t([i(re)],o.prototype,"labelsVisible",void 0),t([i({type:[Ie],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:Te},write:!0}})],o.prototype,"labelingInfo",void 0),t([i(ie)],o.prototype,"legendEnabled",void 0),t([i({type:["show","hide"]})],o.prototype,"listMode",void 0),t([i({type:String})],o.prototype,"objectIdField",void 0),t([i({type:["WFS"]})],o.prototype,"operationalLayerType",void 0),t([i({type:f,json:{name:"wfsInfo.maxFeatures",write:{ignoreOrigin:!0,isRequired:!0}}})],o.prototype,"maxRecordCount",void 0),t([i({type:f})],o.prototype,"maxPageCount",void 0),t([i({type:f})],o.prototype,"maxTotalRecordCount",void 0),t([i({type:[0],readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],o.prototype,"mode",void 0),t([i({type:String,json:{name:"wfsInfo.name",write:{ignoreOrigin:!0,isRequired:!0}}})],o.prototype,"name",void 0),t([i({type:String,json:{name:"wfsInfo.wfsNamespace",write:{ignoreOrigin:!0,isRequired:!0}}})],o.prototype,"namespaceUri",void 0),t([i(oe)],o.prototype,"opacity",void 0),t([i(I.outFields)],o.prototype,"outFields",void 0),t([i({readOnly:!0})],o.prototype,"parsedUrl",null),t([i(se)],o.prototype,"popupEnabled",void 0),t([i({type:ae,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),t([i({types:de,json:{origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:ue,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:{ignoreOrigin:!0}}})],o.prototype,"renderer",null),t([i(ne)],o.prototype,"screenSizePerspectiveEnabled",void 0),t([i({readOnly:!0})],o.prototype,"source",void 0),t([i({type:P,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"extent.spatialReference"}}}})],o.prototype,"spatialReference",void 0),t([i({readOnly:!0,type:[f],json:{name:"wfsInfo.supportedSpatialReferences",write:{ignoreOrigin:!0,isRequired:!0}}})],o.prototype,"spatialReferences",void 0),t([i({type:Boolean,value:!1,json:{name:"wfsInfo.swapXY",write:{ignoreOrigin:!0,isRequired:!0}}})],o.prototype,"swapXY",void 0),t([i({json:{write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"name"}}}})],o.prototype,"title",void 0),t([i({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),t([i(pe)],o.prototype,"url",void 0),t([i({type:String,readOnly:!0,json:{name:"wfsInfo.version",write:{ignoreOrigin:!0,isRequired:!0}}})],o.prototype,"version",void 0),t([i()],o.prototype,"wfsCapabilities",null),o=b=t([T("esri.layers.WFSLayer")],o);const vt=o;export{vt as default}; diff --git a/assets/WFSSourceWorker-BX8deXfR.js b/assets/WFSSourceWorker-DM2J6sPN.js similarity index 87% rename from assets/WFSSourceWorker-BX8deXfR.js rename to assets/WFSSourceWorker-DM2J6sPN.js index df348f1..56fd24c 100644 --- a/assets/WFSSourceWorker-BX8deXfR.js +++ b/assets/WFSSourceWorker-DM2J6sPN.js @@ -1 +1 @@ -import{N as g,at as p,W as T,cE as E,s as y,au as _,b as R,G as P}from"./index-CEWggaxV.js";import{o as q,r as I}from"./featureConversionUtils-CmP9mw0r.js";import{m as b}from"./FeatureStore-CqSz6SOQ.js";import{x as $,j}from"./timeSupport-BjRbXIpn.js";import{$ as N}from"./QueryEngine-RpcY23Sv.js";import{E as O,N as Q}from"./geojson-BLwRz6JF.js";import{p as M}from"./sourceUtils-QX9lwl5p.js";import{o as k,e as L,K as f}from"./wfsUtils-DeNqsSXH.js";import{Z as U}from"./FieldsIndex-CLgRNeJ_.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./BoundsStore-DMoG4U0L.js";import"./PooledRBush-BsFBmw1o.js";import"./json-Wa8cmqdu.js";import"./WhereClause-Dzgyc0wk.js";import"./TimeOnly-Cm47ew5I.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./QueryEngineCapabilities-CTDe3LlQ.js";import"./quantizationUtils-CUjGHrU3.js";import"./utils-B8iadP2F.js";import"./heatmapUtils-Clt5rJzr.js";import"./utils-SjO_-1JL.js";import"./utils-GMt8_G3w.js";import"./ClassBreaksDefinition-D281x8Sj.js";import"./RenderState-DaVlEYWY.js";import"./date-M6n_RqpC.js";import"./xmlUtils-CtUoQO7q.js";const x="esri.layers.WFSLayer";class gt{constructor(){this._customParameters=null,this._queryEngine=null,this._supportsPagination=!0}destroy(){var t;(t=this._queryEngine)==null||t.destroy(),this._queryEngine=null}async load(t,e={}){const{getFeatureUrl:a,getFeatureOutputFormat:s,fields:i,geometryType:u,featureType:o,maxRecordCount:n,maxTotalRecordCount:m,maxPageCount:C,objectIdField:d,customParameters:F}=t,{spatialReference:l,getFeatureSpatialReference:c}=k(a,o,t.spatialReference);try{await $(c,l)}catch{throw new g("unsupported-projection","Projection not supported",{inSpatialReference:c,outSpatialReference:l})}p(e),this._customParameters=F,this._featureType=o,this._fieldsIndex=U.fromLayerJSON({fields:i,dateFieldsTimeReference:i.some(S=>S.type==="esriFieldTypeDate")?{timeZoneIANA:T}:null}),this._geometryType=u,this._getFeatureUrl=a,this._getFeatureOutputFormat=s,this._getFeatureSpatialReference=c,this._maxRecordCount=n,this._maxTotalRecordCount=m,this._maxPageCount=C,this._objectIdField=d,this._spatialReference=l;let h=await this._snapshotFeatures(e);if(h.errors.length>0&&(this._supportsPagination=!1,h=await this._snapshotFeatures(e),h.errors.length>0))throw h.errors[0];return this._queryEngine=new N({fieldsIndex:this._fieldsIndex,geometryType:u,hasM:!1,hasZ:!1,objectIdField:d,spatialReference:l,timeInfo:null,featureStore:new b({geometryType:u,hasM:!1,hasZ:!1})}),this._queryEngine.featureStore.addMany(h.features),{warnings:w(h),extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async applyEdits(){throw new g("wfs-source:editing-not-supported","applyEdits() is not supported on WFSLayer")}async queryFeatures(t={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(t,e.signal)}async queryFeatureCount(t={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(t,e.signal)}async queryObjectIds(t={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(t,e.signal)}async queryExtent(t={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(t,e.signal)}async querySnapping(t,e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(t,e.signal)}async refresh(t){var e;return this._customParameters=t.customParameters,this._maxRecordCount=t.maxRecordCount,this._maxTotalRecordCount=t.maxTotalRecordCount,this._maxPageCount=t.maxPageCount,(e=this._snapshotTask)==null||e.abort(),this._snapshotTask=E(a=>this._snapshotFeatures({signal:a})),this._snapshotTask.promise.then(a=>{var s;this._queryEngine.featureStore.clear(),this._queryEngine.featureStore.addMany(a.features);for(const i of w(a))y.getLogger(x).warn(new _("wfs-layer:refresh-warning",i.message,i.details));(s=a.errors)!=null&&s.length&&y.getLogger(x).warn(new _("wfs-layer:refresh-error","Refresh completed with errors",{errors:a.errors}))},()=>{this._queryEngine.featureStore.clear()}),await this._waitSnapshotComplete(),{extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _snapshotFeatures(t){const e=t==null?void 0:t.signal,a=this._maxTotalRecordCount,s=this._maxPageCount,i=this._supportsPagination?await L(this._getFeatureUrl,this._featureType.typeName,{customParameters:this._customParameters,signal:e}):void 0;let u=[];const o=[];if(i==null)try{u=await this._singleQuery(e)}catch(n){R(n)||o.push(n)}else{const n=Math.min(i,a),m=Z(this,Math.max(1,Math.min(Math.ceil(n/this._maxRecordCount),s)),e);await Promise.allSettled(Array.from({length:10}).map(()=>G(m,u,o)))}return p(e),{features:u,totalRecordCount:i,maxTotalRecordCount:a,maxPageCount:s,errors:o}}async _singleQuery(t){const e=await f(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,signal:t});return this._processGeoJSON(e,{signal:t})}async _pageQuery(t,e){const a=t*this._maxRecordCount,s=await f(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,startIndex:a,count:this._maxRecordCount,signal:e});return this._processGeoJSON(s,{startIndex:a,signal:e})}_processGeoJSON(t,e){O(t,this._getFeatureSpatialReference.wkid);const{startIndex:a,signal:s}=e;p(s);const i=Q(t,{geometryType:this._geometryType,hasZ:!1,objectIdField:this._objectIdField});if(!P(this._spatialReference,this._getFeatureSpatialReference))for(const o of i)o.geometry!=null&&(o.geometry=q(j(I(o.geometry,this._geometryType,!1,!1),this._getFeatureSpatialReference,this._spatialReference)));let u=a??1;for(const o of i){const n={};M(this._fieldsIndex,n,o.attributes,!0),o.attributes=n,n[this._objectIdField]==null&&(o.objectId=n[this._objectIdField]=u++)}return i}}function*Z(r,t,e){for(let a=0;ar.maxTotalRecordCount&&t.push({name:"wfs-layer:large-dataset",message:`The number of ${r.totalRecordCount} features exceeds the maximum allowed of ${r.maxTotalRecordCount}.`,details:{recordCount:r.features.length,totalRecordCount:r.totalRecordCount,maxTotalRecordCount:r.maxTotalRecordCount}})),t}export{gt as default}; +import{N as g,at as p,W as T,cE as E,s as y,au as _,b as R,G as P}from"./index-BjUNJPVf.js";import{o as q,r as I}from"./featureConversionUtils-BHhm7bvm.js";import{m as b}from"./FeatureStore-CRMzrhIt.js";import{x as $,j}from"./timeSupport-DXkhlToK.js";import{$ as N}from"./QueryEngine-loUu1VUW.js";import{E as O,N as Q}from"./geojson-AjfTISUf.js";import{p as M}from"./sourceUtils-BNTaqxhX.js";import{o as k,e as L,K as f}from"./wfsUtils-p2GOBpZe.js";import{Z as U}from"./FieldsIndex-CK-0B5n9.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./BoundsStore-DRDtG3Mk.js";import"./PooledRBush-BlFOlUgK.js";import"./json-Wa8cmqdu.js";import"./WhereClause-Ctld7DSu.js";import"./TimeOnly-BXSODLxA.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./QueryEngineCapabilities-CTDe3LlQ.js";import"./quantizationUtils-CfV316jZ.js";import"./utils-BKh1cxpi.js";import"./heatmapUtils-BSteZBTj.js";import"./utils-Bzmbfe7p.js";import"./utils-CY1ReiSd.js";import"./ClassBreaksDefinition-Djcxa8Lp.js";import"./RenderState-DaVlEYWY.js";import"./date-M6n_RqpC.js";import"./xmlUtils-CtUoQO7q.js";const x="esri.layers.WFSLayer";class gt{constructor(){this._customParameters=null,this._queryEngine=null,this._supportsPagination=!0}destroy(){var t;(t=this._queryEngine)==null||t.destroy(),this._queryEngine=null}async load(t,e={}){const{getFeatureUrl:a,getFeatureOutputFormat:s,fields:i,geometryType:u,featureType:o,maxRecordCount:n,maxTotalRecordCount:m,maxPageCount:C,objectIdField:d,customParameters:F}=t,{spatialReference:l,getFeatureSpatialReference:c}=k(a,o,t.spatialReference);try{await $(c,l)}catch{throw new g("unsupported-projection","Projection not supported",{inSpatialReference:c,outSpatialReference:l})}p(e),this._customParameters=F,this._featureType=o,this._fieldsIndex=U.fromLayerJSON({fields:i,dateFieldsTimeReference:i.some(S=>S.type==="esriFieldTypeDate")?{timeZoneIANA:T}:null}),this._geometryType=u,this._getFeatureUrl=a,this._getFeatureOutputFormat=s,this._getFeatureSpatialReference=c,this._maxRecordCount=n,this._maxTotalRecordCount=m,this._maxPageCount=C,this._objectIdField=d,this._spatialReference=l;let h=await this._snapshotFeatures(e);if(h.errors.length>0&&(this._supportsPagination=!1,h=await this._snapshotFeatures(e),h.errors.length>0))throw h.errors[0];return this._queryEngine=new N({fieldsIndex:this._fieldsIndex,geometryType:u,hasM:!1,hasZ:!1,objectIdField:d,spatialReference:l,timeInfo:null,featureStore:new b({geometryType:u,hasM:!1,hasZ:!1})}),this._queryEngine.featureStore.addMany(h.features),{warnings:w(h),extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async applyEdits(){throw new g("wfs-source:editing-not-supported","applyEdits() is not supported on WFSLayer")}async queryFeatures(t={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(t,e.signal)}async queryFeatureCount(t={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(t,e.signal)}async queryObjectIds(t={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(t,e.signal)}async queryExtent(t={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(t,e.signal)}async querySnapping(t,e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(t,e.signal)}async refresh(t){var e;return this._customParameters=t.customParameters,this._maxRecordCount=t.maxRecordCount,this._maxTotalRecordCount=t.maxTotalRecordCount,this._maxPageCount=t.maxPageCount,(e=this._snapshotTask)==null||e.abort(),this._snapshotTask=E(a=>this._snapshotFeatures({signal:a})),this._snapshotTask.promise.then(a=>{var s;this._queryEngine.featureStore.clear(),this._queryEngine.featureStore.addMany(a.features);for(const i of w(a))y.getLogger(x).warn(new _("wfs-layer:refresh-warning",i.message,i.details));(s=a.errors)!=null&&s.length&&y.getLogger(x).warn(new _("wfs-layer:refresh-error","Refresh completed with errors",{errors:a.errors}))},()=>{this._queryEngine.featureStore.clear()}),await this._waitSnapshotComplete(),{extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _snapshotFeatures(t){const e=t==null?void 0:t.signal,a=this._maxTotalRecordCount,s=this._maxPageCount,i=this._supportsPagination?await L(this._getFeatureUrl,this._featureType.typeName,{customParameters:this._customParameters,signal:e}):void 0;let u=[];const o=[];if(i==null)try{u=await this._singleQuery(e)}catch(n){R(n)||o.push(n)}else{const n=Math.min(i,a),m=Z(this,Math.max(1,Math.min(Math.ceil(n/this._maxRecordCount),s)),e);await Promise.allSettled(Array.from({length:10}).map(()=>G(m,u,o)))}return p(e),{features:u,totalRecordCount:i,maxTotalRecordCount:a,maxPageCount:s,errors:o}}async _singleQuery(t){const e=await f(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,signal:t});return this._processGeoJSON(e,{signal:t})}async _pageQuery(t,e){const a=t*this._maxRecordCount,s=await f(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,startIndex:a,count:this._maxRecordCount,signal:e});return this._processGeoJSON(s,{startIndex:a,signal:e})}_processGeoJSON(t,e){O(t,this._getFeatureSpatialReference.wkid);const{startIndex:a,signal:s}=e;p(s);const i=Q(t,{geometryType:this._geometryType,hasZ:!1,objectIdField:this._objectIdField});if(!P(this._spatialReference,this._getFeatureSpatialReference))for(const o of i)o.geometry!=null&&(o.geometry=q(j(I(o.geometry,this._geometryType,!1,!1),this._getFeatureSpatialReference,this._spatialReference)));let u=a??1;for(const o of i){const n={};M(this._fieldsIndex,n,o.attributes,!0),o.attributes=n,n[this._objectIdField]==null&&(o.objectId=n[this._objectIdField]=u++)}return i}}function*Z(r,t,e){for(let a=0;ar.maxTotalRecordCount&&t.push({name:"wfs-layer:large-dataset",message:`The number of ${r.totalRecordCount} features exceeds the maximum allowed of ${r.maxTotalRecordCount}.`,details:{recordCount:r.features.length,totalRecordCount:r.totalRecordCount,maxTotalRecordCount:r.maxTotalRecordCount}})),t}export{gt as default}; diff --git a/assets/WGLContainer-B_Pv-8Yi.js b/assets/WGLContainer-DgZNq7b0.js similarity index 99% rename from assets/WGLContainer-B_Pv-8Yi.js rename to assets/WGLContainer-DgZNq7b0.js index c3ff929..9ab297c 100644 --- a/assets/WGLContainer-B_Pv-8Yi.js +++ b/assets/WGLContainer-DgZNq7b0.js @@ -1,4 +1,4 @@ -import{g5 as O,fX as $,iv as ne,g3 as A,L as B,g4 as R,hf as F,li as ce,iS as Q,hc as dt,a as _t,fl as He,eM as We,ij as ue,lj as vt,lk as ge,ll as mt,eO as fe,E as q,ah as he,u as Ie,lm as pt,ln as gt,lo as ht,lp as xt,s as Se,D as yt,lq as U,lr as $e,H as Ee,kD as J,iV as St,jF as G,jR as Oe,eJ as bt,ls as Ae,N as be,fj as Tt,fU as Pe,g as Ct}from"./index-CEWggaxV.js";import{a as Ze,b as Ke,n as qe,w as M,e as re,s as le,r as It}from"./LabelMetric-D2hbzzy_.js";import{h as k}from"./Program-DLRmaKpw.js";import{o as j,a as Et,e as de}from"./ProgramTemplate-BICQrNzS.js";import{i as je,N as _e,S as De,h as Ot,E as ee}from"./Container-CB7SlLB9.js";import{e as At,m as Pt}from"./Texture-DJgkMrSB.js";import{e as Le}from"./config-MDUrh2eL.js";import{i as Dt}from"./earcut-hRlx3adE.js";import{Q as Lt,K as Rt}from"./featureConversionUtils-CmP9mw0r.js";import{e as Re}from"./OptimizedGeometry-CQuTPb9g.js";let Mt=class{constructor(e,t){this._rctx=e,this._attributes=[{name:"position",offset:0,type:O.SHORT,count:2}],this.layout={hash:Ze(this._attributes),attributes:this._attributes,stride:4},this._vertexBuffer=k.createVertex(e,$.STATIC_DRAW,new Uint16Array(t)),this._vao=new j(e,new Map([["a_position",0]]),{geometry:[new ne("a_position",2,O.SHORT,0,4)]},{geometry:this._vertexBuffer}),this._count=t.length/2}bind(){this._rctx.bindVAO(this._vao)}unbind(){this._rctx.bindVAO(null)}dispose(){this._vao.dispose()}draw(){this._rctx.bindVAO(this._vao),this._rctx.drawArrays(A.TRIANGLE_STRIP,0,this._count)}},H=class{constructor(){this.name=this.constructor.name||"UnnamedBrush",this.brushEffect=null}prepareState(e,t){}draw(e,t,n){}drawMany(e,t,n){for(const i of t)i.visible&&this.draw(e,i,n)}};const me={nearest:{defines:[],samplingMode:B.NEAREST,mips:!1},bilinear:{defines:[],samplingMode:B.LINEAR,mips:!1},bicubic:{defines:["bicubic"],samplingMode:B.LINEAR,mips:!1},trilinear:{defines:[],samplingMode:B.LINEAR_MIPMAP_LINEAR,mips:!0}},zt=(f,e,t)=>{if(t.samplingMode==="dynamic"){const{state:n}=f,i=e.resolution/e.pixelRatio/n.resolution,o=Math.round(f.pixelRatio)!==f.pixelRatio,a=i>1.05||i<.95;return n.rotation||a||o||e.isSourceScaled||e.rotation?me.bilinear:me.nearest}return me[t.samplingMode]};let Nt=class extends H{constructor(){super(...arguments),this._desc={vsPath:"raster/bitmap",fsPath:"raster/bitmap",attributes:new Map([["a_pos",0]])}}dispose(){this._quad&&this._quad.dispose()}prepareState({context:e}){e.setBlendingEnabled(!0),e.setColorMask(!0,!0,!0,!0),e.setStencilWriteMask(0),e.setStencilTestEnabled(!0)}draw(e,t){const{context:n,renderingOptions:i,painter:o,requestRender:a,allowDelayedRender:r}=e;if(!t.source||!t.isReady)return;const l=zt(e,t,i),s=o.materialManager.getProgram(this._desc,l.defines);if(r&&a!=null&&!s.compiled)return void a();e.timeline.begin(this.name),t.blendFunction==="additive"?n.setBlendFunctionSeparate(R.ONE,R.ONE,R.ONE,R.ONE):n.setBlendFunctionSeparate(R.ONE,R.ONE_MINUS_SRC_ALPHA,R.ONE,R.ONE_MINUS_SRC_ALPHA),n.setStencilFunction(F.EQUAL,t.stencilRef,255),this._quad||(this._quad=new Mt(n,[0,0,1,0,0,1,1,1]));const{coordScale:c,computedOpacity:_,transforms:u}=t;t.setSamplingProfile(l),t.bind(e.context,ce),n.useProgram(s),s.setUniformMatrix3fv("u_dvsMat3",u.displayViewScreenMat3),s.setUniform1i("u_texture",ce),s.setUniform2fv("u_coordScale",c),s.setUniform1f("u_opacity",_),this._quad.draw(),e.timeline.end(this.name)}};function Xe(){return new Float32Array(4)}function Vt(f){const e=new Float32Array(4);return e[0]=f[0],e[1]=f[1],e[2]=f[2],e[3]=f[3],e}function W(f,e,t,n){const i=new Float32Array(4);return i[0]=f,i[1]=e,i[2]=t,i[3]=n,i}function wt(f,e){return new Float32Array(f,e,4)}function Qe(){return Xe()}function Je(){return W(1,1,1,1)}function et(){return W(1,0,0,0)}function tt(){return W(0,1,0,0)}function nt(){return W(0,0,1,0)}function it(){return W(0,0,0,1)}const Ft=Qe(),Bt=Je(),Ut=et(),Gt=tt(),Yt=nt(),kt=it();Object.freeze(Object.defineProperty({__proto__:null,ONES:Bt,UNIT_W:kt,UNIT_X:Ut,UNIT_Y:Gt,UNIT_Z:Yt,ZEROS:Ft,clone:Vt,create:Xe,createView:wt,fromValues:W,ones:Je,unitW:it,unitX:et,unitY:tt,unitZ:nt,zeros:Qe},Symbol.toStringTag,{value:"Module"}));const Ht={background:{"background.frag":`uniform lowp vec4 u_color; +import{g5 as O,fX as $,iv as ne,g3 as A,L as B,g4 as R,hf as F,li as ce,iS as Q,hc as dt,a as _t,fl as He,eM as We,ij as ue,lj as vt,lk as ge,ll as mt,eO as fe,E as q,ah as he,u as Ie,lm as pt,ln as gt,lo as ht,lp as xt,s as Se,D as yt,lq as U,lr as $e,H as Ee,kD as J,iV as St,jF as G,jR as Oe,eJ as bt,ls as Ae,N as be,fj as Tt,fU as Pe,g as Ct}from"./index-BjUNJPVf.js";import{a as Ze,b as Ke,n as qe,w as M,e as re,s as le,r as It}from"./LabelMetric-BcUxDImF.js";import{h as k}from"./Program-DBsYtQ00.js";import{o as j,a as Et,e as de}from"./ProgramTemplate-Ck2I0bIi.js";import{i as je,N as _e,S as De,h as Ot,E as ee}from"./Container-_n5wCgez.js";import{e as At,m as Pt}from"./Texture-S4dD-WHn.js";import{e as Le}from"./config-MDUrh2eL.js";import{i as Dt}from"./earcut-CWKXDqDj.js";import{Q as Lt,K as Rt}from"./featureConversionUtils-BHhm7bvm.js";import{e as Re}from"./OptimizedGeometry-CQuTPb9g.js";let Mt=class{constructor(e,t){this._rctx=e,this._attributes=[{name:"position",offset:0,type:O.SHORT,count:2}],this.layout={hash:Ze(this._attributes),attributes:this._attributes,stride:4},this._vertexBuffer=k.createVertex(e,$.STATIC_DRAW,new Uint16Array(t)),this._vao=new j(e,new Map([["a_position",0]]),{geometry:[new ne("a_position",2,O.SHORT,0,4)]},{geometry:this._vertexBuffer}),this._count=t.length/2}bind(){this._rctx.bindVAO(this._vao)}unbind(){this._rctx.bindVAO(null)}dispose(){this._vao.dispose()}draw(){this._rctx.bindVAO(this._vao),this._rctx.drawArrays(A.TRIANGLE_STRIP,0,this._count)}},H=class{constructor(){this.name=this.constructor.name||"UnnamedBrush",this.brushEffect=null}prepareState(e,t){}draw(e,t,n){}drawMany(e,t,n){for(const i of t)i.visible&&this.draw(e,i,n)}};const me={nearest:{defines:[],samplingMode:B.NEAREST,mips:!1},bilinear:{defines:[],samplingMode:B.LINEAR,mips:!1},bicubic:{defines:["bicubic"],samplingMode:B.LINEAR,mips:!1},trilinear:{defines:[],samplingMode:B.LINEAR_MIPMAP_LINEAR,mips:!0}},zt=(f,e,t)=>{if(t.samplingMode==="dynamic"){const{state:n}=f,i=e.resolution/e.pixelRatio/n.resolution,o=Math.round(f.pixelRatio)!==f.pixelRatio,a=i>1.05||i<.95;return n.rotation||a||o||e.isSourceScaled||e.rotation?me.bilinear:me.nearest}return me[t.samplingMode]};let Nt=class extends H{constructor(){super(...arguments),this._desc={vsPath:"raster/bitmap",fsPath:"raster/bitmap",attributes:new Map([["a_pos",0]])}}dispose(){this._quad&&this._quad.dispose()}prepareState({context:e}){e.setBlendingEnabled(!0),e.setColorMask(!0,!0,!0,!0),e.setStencilWriteMask(0),e.setStencilTestEnabled(!0)}draw(e,t){const{context:n,renderingOptions:i,painter:o,requestRender:a,allowDelayedRender:r}=e;if(!t.source||!t.isReady)return;const l=zt(e,t,i),s=o.materialManager.getProgram(this._desc,l.defines);if(r&&a!=null&&!s.compiled)return void a();e.timeline.begin(this.name),t.blendFunction==="additive"?n.setBlendFunctionSeparate(R.ONE,R.ONE,R.ONE,R.ONE):n.setBlendFunctionSeparate(R.ONE,R.ONE_MINUS_SRC_ALPHA,R.ONE,R.ONE_MINUS_SRC_ALPHA),n.setStencilFunction(F.EQUAL,t.stencilRef,255),this._quad||(this._quad=new Mt(n,[0,0,1,0,0,1,1,1]));const{coordScale:c,computedOpacity:_,transforms:u}=t;t.setSamplingProfile(l),t.bind(e.context,ce),n.useProgram(s),s.setUniformMatrix3fv("u_dvsMat3",u.displayViewScreenMat3),s.setUniform1i("u_texture",ce),s.setUniform2fv("u_coordScale",c),s.setUniform1f("u_opacity",_),this._quad.draw(),e.timeline.end(this.name)}};function Xe(){return new Float32Array(4)}function Vt(f){const e=new Float32Array(4);return e[0]=f[0],e[1]=f[1],e[2]=f[2],e[3]=f[3],e}function W(f,e,t,n){const i=new Float32Array(4);return i[0]=f,i[1]=e,i[2]=t,i[3]=n,i}function wt(f,e){return new Float32Array(f,e,4)}function Qe(){return Xe()}function Je(){return W(1,1,1,1)}function et(){return W(1,0,0,0)}function tt(){return W(0,1,0,0)}function nt(){return W(0,0,1,0)}function it(){return W(0,0,0,1)}const Ft=Qe(),Bt=Je(),Ut=et(),Gt=tt(),Yt=nt(),kt=it();Object.freeze(Object.defineProperty({__proto__:null,ONES:Bt,UNIT_W:kt,UNIT_X:Ut,UNIT_Y:Gt,UNIT_Z:Yt,ZEROS:Ft,clone:Vt,create:Xe,createView:wt,fromValues:W,ones:Je,unitW:it,unitX:et,unitY:tt,unitZ:nt,zeros:Qe},Symbol.toStringTag,{value:"Module"}));const Ht={background:{"background.frag":`uniform lowp vec4 u_color; void main() { gl_FragColor = u_color; }`,"background.vert":`attribute vec2 a_pos; diff --git a/assets/WMSLayer-CBKAceAl.js b/assets/WMSLayer-5SlLwEaR.js similarity index 98% rename from assets/WMSLayer-CBKAceAl.js rename to assets/WMSLayer-5SlLwEaR.js index 5faf6d8..39da00c 100644 --- a/assets/WMSLayer-CBKAceAl.js +++ b/assets/WMSLayer-5SlLwEaR.js @@ -1,2 +1,2 @@ -import{dn as Le,z as V,ez as N,g as H,aT as Ae,V as Q,d as o,y as u,aE as R,aZ as O,e1 as Me,f as ge,h7 as Ue,N as Te,q as T,aS as E,bW as be,aY as je,bP as _e,bQ as Ce,dp as qe,dq as Ve,dr as We,C as Be,ay as De,bD as ne,M as k,h8 as ke,G as Ge,ex as Xe,i as He,j as Je,fN as ze,bE as Qe,aV as Ye,aR as G,dt as Ke,dS as Ze,du as et,bT as tt,h9 as rt}from"./index-CEWggaxV.js";import{i as se}from"./scaleUtils-Bqauo1zZ.js";import{f as nt}from"./RefreshableLayer-1EkEhJeI.js";import{f as st}from"./TemporalLayer-qq3v_i3q.js";import{o as J}from"./crsUtils-DAndLU68.js";import{a as ie}from"./ExportWMSImageParameters-D7gw-oIo.js";import{t as it}from"./imageBitmapUtils-C0nKXf5P.js";import"./TimeInfo-3TVmpFSA.js";var _;let at=0,h=_=class extends Le(Ue){constructor(e){super(e),this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.legendUrl=null,this.legendEnabled=!0,this.layer=null,this.maxScale=0,this.minScale=0,this.name=null,this.parent=null,this.popupEnabled=!1,this.queryable=!1,this.sublayers=null,this.spatialReferences=null,this.title=null,this.addHandles([V(()=>this.sublayers,"after-add",({item:t})=>{t.parent=this,t.layer=this.layer},N),V(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=t.parent=null},N),H(()=>this.sublayers,(t,r)=>{if(r)for(const n of r)n.layer=n.parent=null;if(t)for(const n of t)n.parent=this,n.layer=this.layer},N),H(()=>this.layer,t=>{if(this.sublayers)for(const r of this.sublayers)r.layer=t},N)])}get id(){return this._get("id")??at++}set id(e){this._set("id",e)}readLegendUrl(e,t){return t.legendUrl??t.legendURL??null}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}castSublayers(e){return Ae(Q.ofType(_),e)}set visible(e){this._setAndNotifyLayer("visible",e)}clone(){var t,r,n;const e=new _;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent.clone()),this.hasOwnProperty("fullExtents")&&(e.fullExtents=((t=this.fullExtents)==null?void 0:t.map(s=>s.clone()))??null),this.hasOwnProperty("legendUrl")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty("legendEnabled")&&(e.legendEnabled=this.legendEnabled),this.hasOwnProperty("layer")&&(e.layer=this.layer),this.hasOwnProperty("name")&&(e.name=this.name),this.hasOwnProperty("parent")&&(e.parent=this.parent),this.hasOwnProperty("queryable")&&(e.queryable=this.queryable),this.hasOwnProperty("sublayers")&&(e.sublayers=(r=this.sublayers)==null?void 0:r.map(s=>s.clone())),this.hasOwnProperty("spatialReferences")&&(e.spatialReferences=(n=this.spatialReferences)==null?void 0:n.map(s=>s)),this.hasOwnProperty("visible")&&(e.visible=this.visible),this.hasOwnProperty("title")&&(e.title=this.title),e}_setAndNotifyLayer(e,t){const r=this.layer;this._get(e)!==t&&(this._set(e,t),r&&r.emit("wms-sublayer-update",{propertyName:e,id:this.id}))}};o([u()],h.prototype,"description",void 0),o([u({readOnly:!0})],h.prototype,"dimensions",void 0),o([u({type:R,json:{name:"extent"}})],h.prototype,"fullExtent",void 0),o([u()],h.prototype,"fullExtents",void 0),o([u({type:Number,json:{write:{enabled:!1,overridePolicy:()=>({ignoreOrigin:!0,enabled:!0})}}})],h.prototype,"id",null),o([u({type:String,json:{name:"legendUrl",write:{ignoreOrigin:!0}}})],h.prototype,"legendUrl",void 0),o([O("legendUrl",["legendUrl","legendURL"])],h.prototype,"readLegendUrl",null),o([u({type:Boolean,json:{name:"showLegend",origins:{"web-map":{read:!1,write:!1},"web-scene":{read:!1,write:!1}}}})],h.prototype,"legendEnabled",void 0),o([u()],h.prototype,"layer",void 0),o([u()],h.prototype,"maxScale",void 0),o([u()],h.prototype,"minScale",void 0),o([u({readOnly:!0})],h.prototype,"effectiveScaleRange",null),o([u({type:String,json:{write:{ignoreOrigin:!0}}})],h.prototype,"name",void 0),o([u()],h.prototype,"parent",void 0),o([u({type:Boolean,json:{read:{source:"showPopup"},write:{ignoreOrigin:!0,target:"showPopup"}}})],h.prototype,"popupEnabled",void 0),o([u({type:Boolean,json:{write:{ignoreOrigin:!0}}})],h.prototype,"queryable",void 0),o([u()],h.prototype,"sublayers",void 0),o([Me("sublayers")],h.prototype,"castSublayers",null),o([u({type:[Number],json:{read:{source:"spatialReferences"}}})],h.prototype,"spatialReferences",void 0),o([u({type:String,json:{write:{ignoreOrigin:!0}}})],h.prototype,"title",void 0),o([u({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"}}})],h.prototype,"visible",null),h=_=o([ge("esri.layers.support.WMSSublayer")],h);const z=h,ae={84:4326,83:4269,27:4267};function ot(e){if(!e)return null;const t={idCounter:-1};typeof e=="string"&&(e=new DOMParser().parseFromString(e,"text/xml"));const r=e.documentElement;if(r.nodeName==="ServiceExceptionReport"){const b=Array.prototype.slice.call(r.childNodes).map(L=>L.textContent).join(`\r +import{dn as Le,z as V,ez as N,g as H,aT as Ae,V as Q,d as o,y as u,aE as R,aZ as O,e1 as Me,f as ge,h7 as Ue,N as Te,q as T,aS as E,bW as be,aY as je,bP as _e,bQ as Ce,dp as qe,dq as Ve,dr as We,C as Be,ay as De,bD as ne,M as k,h8 as ke,G as Ge,ex as Xe,i as He,j as Je,fN as ze,bE as Qe,aV as Ye,aR as G,dt as Ke,dS as Ze,du as et,bT as tt,h9 as rt}from"./index-BjUNJPVf.js";import{i as se}from"./scaleUtils-DWXMiS7R.js";import{f as nt}from"./RefreshableLayer-_r2TPtol.js";import{f as st}from"./TemporalLayer-CKICYnEl.js";import{o as J}from"./crsUtils-DAndLU68.js";import{a as ie}from"./ExportWMSImageParameters-Bl6JFYua.js";import{t as it}from"./imageBitmapUtils-BVxrhFkK.js";import"./TimeInfo-DooETFWC.js";var _;let at=0,h=_=class extends Le(Ue){constructor(e){super(e),this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.legendUrl=null,this.legendEnabled=!0,this.layer=null,this.maxScale=0,this.minScale=0,this.name=null,this.parent=null,this.popupEnabled=!1,this.queryable=!1,this.sublayers=null,this.spatialReferences=null,this.title=null,this.addHandles([V(()=>this.sublayers,"after-add",({item:t})=>{t.parent=this,t.layer=this.layer},N),V(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=t.parent=null},N),H(()=>this.sublayers,(t,r)=>{if(r)for(const n of r)n.layer=n.parent=null;if(t)for(const n of t)n.parent=this,n.layer=this.layer},N),H(()=>this.layer,t=>{if(this.sublayers)for(const r of this.sublayers)r.layer=t},N)])}get id(){return this._get("id")??at++}set id(e){this._set("id",e)}readLegendUrl(e,t){return t.legendUrl??t.legendURL??null}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}castSublayers(e){return Ae(Q.ofType(_),e)}set visible(e){this._setAndNotifyLayer("visible",e)}clone(){var t,r,n;const e=new _;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent.clone()),this.hasOwnProperty("fullExtents")&&(e.fullExtents=((t=this.fullExtents)==null?void 0:t.map(s=>s.clone()))??null),this.hasOwnProperty("legendUrl")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty("legendEnabled")&&(e.legendEnabled=this.legendEnabled),this.hasOwnProperty("layer")&&(e.layer=this.layer),this.hasOwnProperty("name")&&(e.name=this.name),this.hasOwnProperty("parent")&&(e.parent=this.parent),this.hasOwnProperty("queryable")&&(e.queryable=this.queryable),this.hasOwnProperty("sublayers")&&(e.sublayers=(r=this.sublayers)==null?void 0:r.map(s=>s.clone())),this.hasOwnProperty("spatialReferences")&&(e.spatialReferences=(n=this.spatialReferences)==null?void 0:n.map(s=>s)),this.hasOwnProperty("visible")&&(e.visible=this.visible),this.hasOwnProperty("title")&&(e.title=this.title),e}_setAndNotifyLayer(e,t){const r=this.layer;this._get(e)!==t&&(this._set(e,t),r&&r.emit("wms-sublayer-update",{propertyName:e,id:this.id}))}};o([u()],h.prototype,"description",void 0),o([u({readOnly:!0})],h.prototype,"dimensions",void 0),o([u({type:R,json:{name:"extent"}})],h.prototype,"fullExtent",void 0),o([u()],h.prototype,"fullExtents",void 0),o([u({type:Number,json:{write:{enabled:!1,overridePolicy:()=>({ignoreOrigin:!0,enabled:!0})}}})],h.prototype,"id",null),o([u({type:String,json:{name:"legendUrl",write:{ignoreOrigin:!0}}})],h.prototype,"legendUrl",void 0),o([O("legendUrl",["legendUrl","legendURL"])],h.prototype,"readLegendUrl",null),o([u({type:Boolean,json:{name:"showLegend",origins:{"web-map":{read:!1,write:!1},"web-scene":{read:!1,write:!1}}}})],h.prototype,"legendEnabled",void 0),o([u()],h.prototype,"layer",void 0),o([u()],h.prototype,"maxScale",void 0),o([u()],h.prototype,"minScale",void 0),o([u({readOnly:!0})],h.prototype,"effectiveScaleRange",null),o([u({type:String,json:{write:{ignoreOrigin:!0}}})],h.prototype,"name",void 0),o([u()],h.prototype,"parent",void 0),o([u({type:Boolean,json:{read:{source:"showPopup"},write:{ignoreOrigin:!0,target:"showPopup"}}})],h.prototype,"popupEnabled",void 0),o([u({type:Boolean,json:{write:{ignoreOrigin:!0}}})],h.prototype,"queryable",void 0),o([u()],h.prototype,"sublayers",void 0),o([Me("sublayers")],h.prototype,"castSublayers",null),o([u({type:[Number],json:{read:{source:"spatialReferences"}}})],h.prototype,"spatialReferences",void 0),o([u({type:String,json:{write:{ignoreOrigin:!0}}})],h.prototype,"title",void 0),o([u({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"}}})],h.prototype,"visible",null),h=_=o([ge("esri.layers.support.WMSSublayer")],h);const z=h,ae={84:4326,83:4269,27:4267};function ot(e){if(!e)return null;const t={idCounter:-1};typeof e=="string"&&(e=new DOMParser().parseFromString(e,"text/xml"));const r=e.documentElement;if(r.nodeName==="ServiceExceptionReport"){const b=Array.prototype.slice.call(r.childNodes).map(L=>L.textContent).join(`\r `);throw new Te("wmslayer:wms-capabilities-xml-is-not-valid","The server returned errors when the WMS capabilities were requested.",b)}const n=x("Capability",r),s=x("Service",r),l=n&&x("Request",n);if(!n||!s||!l)return null;const a=x("Layer",n);if(!a)return null;const m=r.nodeName==="WMS_Capabilities"||r.nodeName==="WMT_MS_Capabilities"?r.getAttribute("version"):"1.3.0",i=v("Title",s,"")||v("Name",s,""),y=v("AccessConstraints",s,""),p=/^none$/i.test(y)?"":y,f=v("Abstract",s,""),d=parseInt(v("MaxWidth",s,"5000"),10),w=parseInt(v("MaxHeight",s,"5000"),10),S=le(l,"GetMap"),P=oe(l,"GetMap"),g=U(a,m,t);if(!g)return null;let Y,W=0;const Ne=Array.prototype.slice.call(n.childNodes),Ee=g.sublayers??[],B=b=>{b!=null&&Ee.push(b)};Ne.forEach(b=>{b.nodeName==="Layer"&&(W===0?Y=b:(W===1&&g.name&&(g.name="",B(U(Y,m,t))),B(U(b,m,t))),W++)});let I=g.sublayers,D=g.extent;const Ie=g.fullExtents??[];if(I||(I=[]),I.length===0&&I.push(g),!D){const b=new R(I[0].extent);g.extent=b.toJSON(),D=g.extent}const Fe=g.spatialReferences.length>0?g.spatialReferences:xe(g),K=oe(l,"GetFeatureInfo"),$e=K?le(l,"GetFeatureInfo"):null,Z=we(I),Oe=g.minScale||0,Re=g.maxScale||0,ee=g.dimensions??[],Pe=Z.reduce((b,L)=>b.concat(L.dimensions??[]),[]),te=ee.concat(Pe).filter(Se);let re=null;if(te.length){const b=te.map(L=>{const{extent:A}=L;return pt(A)?A.map(j=>j.getTime()):A==null?void 0:A.map(j=>[j.min.getTime(),j.max.getTime()])}).flat(2).filter(T);re={startTimeField:null,endTimeField:null,trackIdField:void 0,timeExtent:[Math.min(...b),Math.max(...b)]}}return{copyright:p,description:f,dimensions:ee,extent:D,fullExtents:Ie,featureInfoFormats:$e,featureInfoUrl:K,mapUrl:P,maxWidth:d,maxHeight:w,maxScale:Re,minScale:Oe,layers:Z,spatialReferences:Fe,supportedImageFormatTypes:S,timeInfo:re,title:i,version:m}}function lt(e){const t=e.filter(r=>r.popupEnabled&&r.name&&r.queryable);return t.length?t.map(({name:r})=>r).join():null}function xe(e){if(e.spatialReferences.length>0)return e.spatialReferences;if(e.sublayers)for(const t of e.sublayers){const r=xe(t);if(r.length>0)return r}return[]}function we(e){var r;let t=[];for(const n of e)t.push(n),(r=n.sublayers)!=null&&r.length&&(t=t.concat(we(n.sublayers)),delete n.sublayers);return t}function C(e,t,r){return t.getAttribute(e)??r}function ut(e,t,r,n){const s=x(e,r);return s?C(t,s,n):n}function x(e,t){for(let r=0;rs).filter(T);const n=[];for(const s of r)if(s.getAttribute("name")===t){const l=q("Format",s);for(const{textContent:a}of l)a!=null&&n.push(a)}return n}function ue(e,t,r){const n=x(t,e);if(!n)return r;const{textContent:s}=n;if(s==null||s==="")return r;const l=Number(s);return isNaN(l)?r:l}function U(e,t,r){if(!e)return null;const n={id:r.idCounter++,fullExtents:[],parentLayerId:null,queryable:e.getAttribute("queryable")==="1",spatialReferences:[],sublayers:null},s=x("LatLonBoundingBox",e),l=x("EX_GeographicBoundingBox",e);let a=null;s&&(a=M(s,4326)),l&&(a=new R(0,0,0,0,new E({wkid:4326})),a.xmin=parseFloat(v("westBoundLongitude",l,"0")),a.ymin=parseFloat(v("southBoundLatitude",l,"0")),a.xmax=parseFloat(v("eastBoundLongitude",l,"0")),a.ymax=parseFloat(v("northBoundLatitude",l,"0"))),s||l||(a=new R(-180,-90,180,90,new E({wkid:4326}))),n.minScale=ue(e,"MaxScaleDenominator",0),n.maxScale=ue(e,"MinScaleDenominator",0);const m=["1.0.0","1.1.0","1.1.1"].includes(t)?"SRS":"CRS";return Array.prototype.slice.call(e.childNodes).forEach(i=>{var y;if(i.nodeName==="Name")n.name=i.textContent||"";else if(i.nodeName==="Title")n.title=i.textContent||"";else if(i.nodeName==="Abstract")n.description=i.textContent||"";else if(i.nodeName==="BoundingBox"){const p=i.getAttribute(m);if(p&&p.indexOf("EPSG:")===0){const d=parseInt(p.substring(5),10);d===0||isNaN(d)||a||(a=t==="1.3.0"?M(i,d,J(d)):M(i,d))}const f=p&&p.indexOf(":");if(f&&f>-1){let d=parseInt(p.substring(f+1,p.length),10);d===0||isNaN(d)||(d=ae[d]??d);const w=t==="1.3.0"?M(i,d,J(d)):M(i,d);w&&n.fullExtents&&n.fullExtents.push(w)}}else if(i.nodeName===m)(((y=i.textContent)==null?void 0:y.split(" "))??[]).forEach(p=>{const f=p.includes(":")?parseInt(p.split(":")[1],10):parseInt(p,10);if(f!==0&&!isNaN(f)){const d=ae[f]??f;n.spatialReferences.includes(d)||n.spatialReferences.push(d)}});else if(i.nodeName!=="Style"||n.legendUrl){if(i.nodeName==="Layer"){const p=U(i,t,r);p&&(p.parentLayerId=n.id,n.sublayers||(n.sublayers=[]),n.sublayers.push(p))}}else{const p=x("LegendURL",i);if(p){const f=x("OnlineResource",p);f&&(n.legendUrl=f.getAttribute("xlink:href"))}}}),n.extent=a==null?void 0:a.toJSON(),n.dimensions=q("Dimension",e).filter(i=>i.getAttribute("name")&&i.getAttribute("units")&&i.textContent).map(i=>{const y=i.getAttribute("name"),p=i.getAttribute("units"),f=i.textContent,d=i.getAttribute("unitSymbol")??void 0,w=i.getAttribute("default")??void 0,S=C("default",i,"0")!=="0",P=C("nearestValue",i,"0")!=="0",g=C("current",i,"0")!=="0";return Se({name:y,units:p})?{name:"time",units:"ISO8601",extent:de(f),default:de(w),multipleValues:S,nearestValue:P,current:g}:ct({name:y,units:p})?{name:"elevation",units:p,extent:pe(f),unitSymbol:d,default:pe(w),multipleValues:S,nearestValue:P}:{name:y,units:p,extent:ce(f),unitSymbol:d,default:ce(w),multipleValues:S,nearestValue:P}}),n}function pt(e){return Array.isArray(e)&&e.length>0&&e[0]instanceof Date}function ve(e){return e.nodeType===Node.ELEMENT_NODE}function ct(e){return/^elevation$/i.test(e.name)&&/^(epsg|crs):\d+$/i.test(e.units)}function Se(e){return/^time$/i.test(e.name)&&/^iso8601$/i.test(e.units)}function dt(e,t){const r=[],n=be(e);for(const s in n.query)n.query.hasOwnProperty(s)&&(t.includes(s.toLowerCase())||r.push(s+"="+n.query[s]));return n.path+(r.length?"?"+r.join("&"):"")}function pe(e){if(!e)return;const t=e.includes("/"),r=e.split(",");return t?r.map(n=>{const s=n.split("/");return s.length<2?null:{min:parseFloat(s[0]),max:parseFloat(s[1]),resolution:s.length>=3&&s[2]!=="0"?parseFloat(s[2]):void 0}}).filter(T):r.map(n=>parseFloat(n))}function ce(e){if(!e)return;const t=e.includes("/"),r=e.split(",");return t?r.map(n=>{const s=n.split("/");return s.length<2?null:{min:s[0],max:s[1],resolution:s.length>=3&&s[2]!=="0"?s[2]:void 0}}).filter(T):r}function de(e){if(!e)return;const t=e.includes("/"),r=e.split(",");return t?r.map(n=>{const s=n.split("/");return s.length<2?null:{min:new Date(s[0]),max:new Date(s[1]),resolution:s.length>=3&&s[2]!=="0"?mt(s[2]):void 0}}).filter(T):r.map(n=>new Date(n))}function mt(e){const t=/(?:p(\d+y|\d+(?:\.|,)\d+y)?(\d+m|\d+(?:\.|,)\d+m)?(\d+d|\d+(?:\.|,)\d+d)?)?(?:t(\d+h|\d+(?:\.|,)\d+h)?(\d+m|\d+(?:\.|,)\d+m)?(\d+s|\d+(?:\.|,)\d+s)?)?/i,r=e.match(t);return r?{years:F(r[1]),months:F(r[2]),days:F(r[3]),hours:F(r[4]),minutes:F(r[5]),seconds:F(r[6])}:null}function F(e){if(!e)return 0;const t=/(?:\d+(?:\.|,)\d+|\d+)/,r=e.match(t);if(!r)return 0;const n=r[0].replace(",",".");return Number(n)}function $(e){return e.toISOString().replace(/\.[0-9]{3}/,"")}const me=new Set([102100,3857,102113,900913]),ft=new Set([3395,54004]);function yt(e,t){let r=e.wkid;return t==null?r:(r!=null&&t.includes(r)||!e.latestWkid||(r=e.latestWkid),r!=null&&me.has(r)?t.find(n=>me.has(n))||t.find(n=>ft.has(n))||102100:r)}const X=new je({bmp:"image/bmp",gif:"image/gif",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml"},{ignoreUnknown:!1});function fe(e){return e==="text/html"}function ye(e){return e==="text/plain"}let c=class extends _e(st(nt(Ce(qe(Ve(We(tt))))))){constructor(...e){super(...e),this.allSublayers=new Be({getCollections:()=>[this.sublayers],getChildrenFunction:t=>t.sublayers}),this.customParameters=null,this.customLayerParameters=null,this.copyright=null,this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.featureInfoFormats=null,this.featureInfoUrl=null,this.fetchFeatureInfoFunction=null,this.imageFormat=null,this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.legendEnabled=!0,this.mapUrl=null,this.isReference=null,this.operationalLayerType="WMS",this.spatialReference=null,this.spatialReferences=null,this.sublayers=null,this.type="wms",this.version=null,this.addHandles([V(()=>this.sublayers,"after-add",({item:t})=>{t.parent=t.layer=this},N),V(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=t.parent=null},N),H(()=>this.sublayers,(t,r)=>{if(r)for(const n of r)n.layer=n.parent=null;if(t)for(const n of t)n.parent=n.layer=this},N)])}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}destroy(){this.allSublayers.destroy()}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMS"]},e).catch(De).then(()=>this._fetchService(t))),Promise.resolve(this)}readFullExtentFromItemOrMap(e,t){const r=t.extent;return r?new R({xmin:r[0][0],ymin:r[0][1],xmax:r[1][0],ymax:r[1][1]}):null}writeFullExtent(e,t){t.extent=[[e.xmin,e.ymin],[e.xmax,e.ymax]]}get featureInfoFormat(){return this.featureInfoFormats==null?null:this.featureInfoFormats.find(fe)??this.featureInfoFormats.find(ye)??null}set featureInfoFormat(e){e==null?(this.revert("featureInfoFormat","service"),this._clearOverride("featureInfoFormat")):(fe(e)||ye(e))&&this._override("featureInfoFormat",e)}readImageFormat(e,t){const r=t.supportedImageFormatTypes;return r&&r.includes("image/png")?"image/png":r&&r[0]}readSpatialReferenceFromItemOrDocument(e,t){return new E(t.spatialReferences[0])}writeSpatialReferences(e,t){var n;const r=(n=this.spatialReference)==null?void 0:n.wkid;e&&r?(t.spatialReferences=e.filter(s=>s!==r),t.spatialReferences.unshift(r)):t.spatialReferences=e}readSublayersFromItemOrMap(e,t,r){return he(t.layers,r,t.visibleLayers)}readSublayers(e,t,r){return he(t.layers,r)}writeSublayers(e,t,r,n){var a,m;t.layers=[];const s=new Map,l=e.flatten(({sublayers:i})=>i??[]);for(const i of l)if(typeof((a=i.parent)==null?void 0:a.id)=="number"){const y=s.get(i.parent.id);y!=null?y.push(i.id):s.set(i.parent.id,[i.id])}for(const i of l){const y={sublayer:i,...n},p=i.write({parentLayerId:typeof((m=i.parent)==null?void 0:m.id)=="number"?i.parent.id:-1},y);if(s.has(i.id)&&(p.sublayerIds=s.get(i.id)),!i.sublayers&&i.name){const f=i.write({},y);delete f.id,t.layers.push(f)}}t.visibleLayers=l.filter(({visible:i,sublayers:y})=>i&&!y).map(({name:i})=>i).toArray()}set url(e){if(!e)return void this._set("url",e);const{path:t,query:r}=be(e);for(const s in r)/^(request|service)$/i.test(s)&&delete r[s];const n=ne(t,r??{});this._set("url",n)}createExportImageParameters(e,t,r,n){const s=(n==null?void 0:n.pixelRatio)??1,l=se({extent:e,width:t})*s,a=new ie({layer:this,scale:l}),{xmin:m,ymin:i,xmax:y,ymax:p,spatialReference:f}=e,d=yt(f,this.spatialReferences),w=this.version==="1.3.0"&&J(d)?`${i},${m},${p},${y}`:`${m},${i},${y},${p}`,S=a.toJSON();return{bbox:w,[this.version==="1.3.0"?"crs":"srs"]:d==null||isNaN(d)?void 0:"EPSG:"+d,...S}}async fetchImage(e,t,r,n){var p,f;const s=this.mapUrl,l=this.createExportImageParameters(e,t,r,n);if(!l.layers){const d=document.createElement("canvas");return d.width=t,d.height=r,d}const a=(p=n==null?void 0:n.timeExtent)==null?void 0:p.start,m=(f=n==null?void 0:n.timeExtent)==null?void 0:f.end,i=a!=null&&m!=null?a.getTime()===m.getTime()?$(a):`${$(a)}/${$(m)}`:void 0,y={responseType:"image",query:this._mixCustomParameters({width:t,height:r,...l,time:i,...this.refreshParameters}),signal:n==null?void 0:n.signal};return k(s??"",y).then(d=>d.data)}async fetchImageBitmap(e,t,r,n){var f,d;const s=this.mapUrl??"",l=this.createExportImageParameters(e,t,r,n);if(!l.layers){const w=document.createElement("canvas");return w.width=t,w.height=r,w}const a=(f=n==null?void 0:n.timeExtent)==null?void 0:f.start,m=(d=n==null?void 0:n.timeExtent)==null?void 0:d.end,i=a!=null&&m!=null?a.getTime()===m.getTime()?$(a):`${$(a)}/${$(m)}`:void 0,y={responseType:"blob",query:this._mixCustomParameters({width:t,height:r,...l,time:i,...this.refreshParameters}),signal:n==null?void 0:n.signal},{data:p}=await k(s,y);return it(p,s,n==null?void 0:n.signal)}fetchFeatureInfo(e,t,r,n,s){const l=se({extent:e,width:t}),a=new ie({layer:this,scale:l}),m=lt(a.visibleSublayers);if(this.featureInfoUrl==null||m==null)return Promise.resolve([]);if(this.fetchFeatureInfoFunction==null&&this.featureInfoFormat==null)return Promise.resolve([]);const i=this.version==="1.3.0"?{I:n,J:s}:{x:n,y:s},y={query_layers:m,request:"GetFeatureInfo",info_format:this.featureInfoFormat,feature_count:25,width:t,height:r,...i},p={...this.createExportImageParameters(e,t,r),...y},f=this._mixCustomParameters(p);return this.fetchFeatureInfoFunction!=null?this.fetchFeatureInfoFunction(f):this._defaultFetchFeatureInfoFunction(ne(this.featureInfoUrl,f))}findSublayerById(e){return this.allSublayers.find(t=>t.id===e)}findSublayerByName(e){return this.allSublayers.find(t=>t.name===e)}serviceSupportsSpatialReference(e){return ke(this.url)||this.spatialReferences!=null&&this.spatialReferences.some(t=>{const r=t===900913?E.WebMercator:new E({wkid:t});return Ge(r,e)})}_defaultFetchFeatureInfoFunction(e){const t=document.createElement("iframe");t.src=Xe(e),t.style.border="none",t.style.margin="0",t.style.width="100%",t.setAttribute("sandbox","");const r=new He({title:this.title,content:t}),n=new Je({sourceLayer:this,popupTemplate:r});return Promise.resolve([n])}async _fetchService(e){var t;if(!this.resourceInfo&&((t=this.parsedUrl)!=null&&t.path)){const{path:r,query:n}=this.parsedUrl,{data:s}=await k(r,{query:{SERVICE:"WMS",REQUEST:"GetCapabilities",...n,...this.customParameters},responseType:"xml",signal:e});this.resourceInfo=ot(s)}if(this.parsedUrl){const r=new ze(this.parsedUrl.path),{httpsDomains:n}=Qe.request;r.scheme!=="https"||r.port&&r.port!=="443"||!r.host||n.includes(r.host)||n.push(r.host)}this.read(this.resourceInfo,{origin:"service"})}_mixCustomParameters(e){if(!this.customLayerParameters&&!this.customParameters)return e;const t={...this.customParameters,...this.customLayerParameters};for(const r in t)e[r.toLowerCase()]=t[r];return e}};function ht(e,t){return e.some(r=>{for(const n in r)if(rt(r,n,null,t))return!0;return!1})}function he(e,t,r){e=e??[];const n=new Map;e.every(l=>l.id==null)&&(e=Ye(e)).forEach((l,a)=>l.id=a);for(const l of e){const a=new z;a.read(l,t),r&&!r.includes(a.name)&&(a.visible=!1),n.set(a.id,a)}const s=[];for(const l of e){const a=l.id!=null?n.get(l.id):null;if(a)if(l.parentLayerId!=null&&l.parentLayerId>=0){const m=n.get(l.parentLayerId);if(!m)continue;m.sublayers||(m.sublayers=new Q),m.sublayers.push(a)}else s.push(a)}return s}o([u({readOnly:!0})],c.prototype,"allSublayers",void 0),o([u({json:{type:Object,write:!0}})],c.prototype,"customParameters",void 0),o([u({json:{type:Object,write:!0}})],c.prototype,"customLayerParameters",void 0),o([u({type:String,json:{write:!0}})],c.prototype,"copyright",void 0),o([u()],c.prototype,"description",void 0),o([u({readOnly:!0})],c.prototype,"dimensions",void 0),o([u({json:{type:[[Number]],read:{source:"extent"},write:{target:"extent"},origins:{"web-document":{write:{ignoreOrigin:!0}},"portal-item":{write:{ignoreOrigin:!0}}}}})],c.prototype,"fullExtent",void 0),o([O(["web-document","portal-item"],"fullExtent",["extent"])],c.prototype,"readFullExtentFromItemOrMap",null),o([G(["web-document","portal-item"],"fullExtent",{extent:{type:[[Number]]}})],c.prototype,"writeFullExtent",null),o([u()],c.prototype,"fullExtents",void 0),o([u({type:String,json:{write:{ignoreOrigin:!0}}})],c.prototype,"featureInfoFormat",null),o([u({type:[String],readOnly:!0})],c.prototype,"featureInfoFormats",void 0),o([u({type:String,json:{write:{ignoreOrigin:!0}}})],c.prototype,"featureInfoUrl",void 0),o([u()],c.prototype,"fetchFeatureInfoFunction",void 0),o([u({type:String,json:{origins:{"web-document":{default:"image/png",type:X.jsonValues,read:{reader:X.read,source:"format"},write:{writer:X.write,target:"format"}}}}})],c.prototype,"imageFormat",void 0),o([O("imageFormat",["supportedImageFormatTypes"])],c.prototype,"readImageFormat",null),o([u({type:Number,json:{read:{source:"maxHeight"},write:{target:"maxHeight"}}})],c.prototype,"imageMaxHeight",void 0),o([u({type:Number,json:{read:{source:"maxWidth"},write:{target:"maxWidth"}}})],c.prototype,"imageMaxWidth",void 0),o([u()],c.prototype,"imageTransparency",void 0),o([u(Ke)],c.prototype,"legendEnabled",void 0),o([u({type:["show","hide","hide-children"]})],c.prototype,"listMode",void 0),o([u({type:String,json:{write:{ignoreOrigin:!0}}})],c.prototype,"mapUrl",void 0),o([u({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],c.prototype,"isReference",void 0),o([u({type:["WMS"]})],c.prototype,"operationalLayerType",void 0),o([u()],c.prototype,"resourceInfo",void 0),o([u({type:E,json:{origins:{service:{read:{source:"extent.spatialReference"}}},write:!1}})],c.prototype,"spatialReference",void 0),o([O(["web-document","portal-item"],"spatialReference",["spatialReferences"])],c.prototype,"readSpatialReferenceFromItemOrDocument",null),o([u({type:[Ze],json:{read:!1,origins:{service:{read:!0},"web-document":{read:!1,write:{ignoreOrigin:!0}},"portal-item":{read:!1,write:{ignoreOrigin:!0}}}}})],c.prototype,"spatialReferences",void 0),o([G(["web-document","portal-item"],"spatialReferences")],c.prototype,"writeSpatialReferences",null),o([u({type:Q.ofType(z),json:{write:{target:"layers",overridePolicy(e,t,r){if(ht(this.allSublayers,r))return{ignoreOrigin:!0}}}}})],c.prototype,"sublayers",void 0),o([O(["web-document","portal-item"],"sublayers",["layers","visibleLayers"])],c.prototype,"readSublayersFromItemOrMap",null),o([O("service","sublayers",["layers"])],c.prototype,"readSublayers",null),o([G("sublayers",{layers:{type:[z]},visibleLayers:{type:[String]}})],c.prototype,"writeSublayers",null),o([u({json:{read:!1},readOnly:!0,value:"wms"})],c.prototype,"type",void 0),o([u(et)],c.prototype,"url",null),o([u({type:String,json:{write:{ignoreOrigin:!0}}})],c.prototype,"version",void 0),c=o([ge("esri.layers.WMSLayer")],c);const It=c;export{It as default}; diff --git a/assets/WMSLayerView2D-D80tHNhN.js b/assets/WMSLayerView2D-BHemqaDF.js similarity index 77% rename from assets/WMSLayerView2D-D80tHNhN.js rename to assets/WMSLayerView2D-BHemqaDF.js index b7c5c97..c0237b8 100644 --- a/assets/WMSLayerView2D-D80tHNhN.js +++ b/assets/WMSLayerView2D-BHemqaDF.js @@ -1 +1 @@ -import{d as a,y as m,bK as F,f as S,u as E,N as f,at as $,b as C,s as R,g as q,aE as U}from"./index-CEWggaxV.js";import{a as M}from"./BitmapContainer-Bq0Mk6_k.js";import{m as V,u as L}from"./LayerView-BEFTHNYv.js";import{v as W}from"./ExportStrategy-fFnMYcIc.js";import{i as A}from"./RefreshableLayerView-C1-PEoNB.js";import{a as H}from"./ExportWMSImageParameters-D7gw-oIo.js";import"./WGLContainer-B_Pv-8Yi.js";import"./LabelMetric-D2hbzzy_.js";import"./Texture-DJgkMrSB.js";import"./Program-DLRmaKpw.js";import"./ProgramTemplate-BICQrNzS.js";import"./Container-CB7SlLB9.js";import"./highlightReasons-DbgbcWKM.js";import"./config-MDUrh2eL.js";import"./earcut-hRlx3adE.js";import"./featureConversionUtils-CmP9mw0r.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./scaleUtils-Bqauo1zZ.js";import"./Bitmap--gOrgR8J.js";const N=e=>{let t=class extends e{initialize(){this.exportImageParameters=new H({layer:this.layer})}destroy(){this.exportImageParameters=E(this.exportImageParameters)}get exportImageVersion(){var r;return(r=this.exportImageParameters)==null||r.commitProperty("version"),this.commitProperty("timeExtent"),(this._get("exportImageVersion")||0)+1}async fetchPopupFeaturesAtLocation(r,s){const{layer:o}=this;if(!r)throw new f("wmslayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:o});const{popupEnabled:d}=o;if(!d)throw new f("wmslayerview:fetchPopupFeatures","popupEnabled should be true",{popupEnabled:d});const i=this.createFetchPopupFeaturesQuery(r);if(!i)return[];const{extent:n,width:p,height:h,x:c,y}=i;if(!(n&&p&&h))throw new f("wmslayerview:fetchPopupFeatures","WMSLayer does not support fetching features.",{extent:n,width:p,height:h});const g=await o.fetchFeatureInfo(n,p,h,c,y);return $(s),g}};return a([m()],t.prototype,"exportImageParameters",void 0),a([m({readOnly:!0})],t.prototype,"exportImageVersion",null),a([m()],t.prototype,"layer",void 0),a([m(F)],t.prototype,"timeExtent",void 0),t=a([S("esri.layers.mixins.WMSLayerView")],t),t};let u=class extends N(A(V(L))){constructor(){super(...arguments),this.bitmapContainer=new M}supportsSpatialReference(e){return this.layer.serviceSupportsSpatialReference(e)}update(e){this.strategy.update(e).catch(t=>{C(t)||R.getLogger(this).error(t)})}attach(){const{layer:e}=this,{imageMaxHeight:t,imageMaxWidth:r}=e;this.bitmapContainer=new M,this.container.addChild(this.bitmapContainer),this.strategy=new W({container:this.bitmapContainer,fetchSource:this.fetchImage.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxHeight:t,imageMaxWidth:r,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1}),this.addAttachHandles(q(()=>this.exportImageVersion,()=>this.requestUpdate()))}detach(){this.strategy=E(this.strategy),this.container.removeAllChildren()}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}createFetchPopupFeaturesQuery(e){const{view:t,bitmapContainer:r}=this,{x:s,y:o}=e,{spatialReference:d}=t;let i,n=0,p=0;if(r.children.some(g=>{const{width:w,height:v,resolution:b,x:l,y:x}=g,I=l+b*w,P=x-b*v;return s>=l&&s<=I&&o<=x&&o>=P&&(i=new U({xmin:l,ymin:P,xmax:I,ymax:x,spatialReference:d}),n=w,p=v,!0)}),!i)return null;const h=i.width/n,c=Math.round((s-i.xmin)/h),y=Math.round((i.ymax-o)/h);return{extent:i,width:n,height:p,x:c,y}}async doRefresh(){this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(e,t,r,s){return this.layer.fetchImageBitmap(e,t,r,{timeExtent:this.timeExtent,...s})}};a([m()],u.prototype,"strategy",void 0),a([m()],u.prototype,"updating",void 0),u=a([S("esri.views.2d.layers.WMSLayerView2D")],u);const st=u;export{st as default}; +import{d as a,y as m,bK as F,f as S,u as E,N as f,at as $,b as C,s as R,g as q,aE as U}from"./index-BjUNJPVf.js";import{a as M}from"./BitmapContainer-DD7rxH0u.js";import{m as V,u as L}from"./LayerView-Bux7vAEn.js";import{v as W}from"./ExportStrategy-SzILz8ne.js";import{i as A}from"./RefreshableLayerView-L9NGpXXI.js";import{a as H}from"./ExportWMSImageParameters-Bl6JFYua.js";import"./WGLContainer-DgZNq7b0.js";import"./LabelMetric-BcUxDImF.js";import"./Texture-S4dD-WHn.js";import"./Program-DBsYtQ00.js";import"./ProgramTemplate-Ck2I0bIi.js";import"./Container-_n5wCgez.js";import"./highlightReasons-BOU4mnPE.js";import"./config-MDUrh2eL.js";import"./earcut-CWKXDqDj.js";import"./featureConversionUtils-BHhm7bvm.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./scaleUtils-DWXMiS7R.js";import"./Bitmap-DpyomsG7.js";const N=e=>{let t=class extends e{initialize(){this.exportImageParameters=new H({layer:this.layer})}destroy(){this.exportImageParameters=E(this.exportImageParameters)}get exportImageVersion(){var r;return(r=this.exportImageParameters)==null||r.commitProperty("version"),this.commitProperty("timeExtent"),(this._get("exportImageVersion")||0)+1}async fetchPopupFeaturesAtLocation(r,s){const{layer:o}=this;if(!r)throw new f("wmslayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:o});const{popupEnabled:d}=o;if(!d)throw new f("wmslayerview:fetchPopupFeatures","popupEnabled should be true",{popupEnabled:d});const i=this.createFetchPopupFeaturesQuery(r);if(!i)return[];const{extent:n,width:p,height:h,x:c,y}=i;if(!(n&&p&&h))throw new f("wmslayerview:fetchPopupFeatures","WMSLayer does not support fetching features.",{extent:n,width:p,height:h});const g=await o.fetchFeatureInfo(n,p,h,c,y);return $(s),g}};return a([m()],t.prototype,"exportImageParameters",void 0),a([m({readOnly:!0})],t.prototype,"exportImageVersion",null),a([m()],t.prototype,"layer",void 0),a([m(F)],t.prototype,"timeExtent",void 0),t=a([S("esri.layers.mixins.WMSLayerView")],t),t};let u=class extends N(A(V(L))){constructor(){super(...arguments),this.bitmapContainer=new M}supportsSpatialReference(e){return this.layer.serviceSupportsSpatialReference(e)}update(e){this.strategy.update(e).catch(t=>{C(t)||R.getLogger(this).error(t)})}attach(){const{layer:e}=this,{imageMaxHeight:t,imageMaxWidth:r}=e;this.bitmapContainer=new M,this.container.addChild(this.bitmapContainer),this.strategy=new W({container:this.bitmapContainer,fetchSource:this.fetchImage.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxHeight:t,imageMaxWidth:r,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1}),this.addAttachHandles(q(()=>this.exportImageVersion,()=>this.requestUpdate()))}detach(){this.strategy=E(this.strategy),this.container.removeAllChildren()}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}createFetchPopupFeaturesQuery(e){const{view:t,bitmapContainer:r}=this,{x:s,y:o}=e,{spatialReference:d}=t;let i,n=0,p=0;if(r.children.some(g=>{const{width:w,height:v,resolution:b,x:l,y:x}=g,I=l+b*w,P=x-b*v;return s>=l&&s<=I&&o<=x&&o>=P&&(i=new U({xmin:l,ymin:P,xmax:I,ymax:x,spatialReference:d}),n=w,p=v,!0)}),!i)return null;const h=i.width/n,c=Math.round((s-i.xmin)/h),y=Math.round((i.ymax-o)/h);return{extent:i,width:n,height:p,x:c,y}}async doRefresh(){this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(e,t,r,s){return this.layer.fetchImageBitmap(e,t,r,{timeExtent:this.timeExtent,...s})}};a([m()],u.prototype,"strategy",void 0),a([m()],u.prototype,"updating",void 0),u=a([S("esri.views.2d.layers.WMSLayerView2D")],u);const st=u;export{st as default}; diff --git a/assets/WMTSLayer-B_E4A-J6.js b/assets/WMTSLayer-DfNOT9ZM.js similarity index 99% rename from assets/WMTSLayer-B_E4A-J6.js rename to assets/WMTSLayer-DfNOT9ZM.js index 202b755..6433ec5 100644 --- a/assets/WMTSLayer-B_E4A-J6.js +++ b/assets/WMTSLayer-DfNOT9ZM.js @@ -1 +1 @@ -import{d as o,y as u,aE as A,dZ as Z,f as N,aU as Q,aZ as R,V as G,N as _,aA as ge,d_ as we,hY as B,hZ as xe,q as de,bP as ve,bQ as Se,dp as Me,dq as Ie,dr as Te,g as ie,ez as j,z as se,ay as ae,aG as Le,h_ as Ee,M as K,aV as le,bW as q,e0 as Pe,aR as be,bT as Ce}from"./index-CEWggaxV.js";import{p as Re,I as Oe}from"./WebTileLayer-D3HPOkPd.js";import{f as Ae}from"./RefreshableLayer-1EkEhJeI.js";import{o as oe}from"./imageBitmapUtils-C0nKXf5P.js";import{o as X}from"./crsUtils-DAndLU68.js";import{o as ne}from"./xmlUtils-CtUoQO7q.js";var J;let F=J=class extends Q{constructor(e){super(e),this.fullExtent=null,this.id=null,this.tileInfo=null}clone(){const e=new J;return this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent&&this.fullExtent.clone()),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("tileInfo")&&(e.tileInfo=this.tileInfo&&this.tileInfo.clone()),e}};o([u({type:A,json:{read:{source:"fullExtent"}}})],F.prototype,"fullExtent",void 0),o([u({type:String,json:{read:{source:"id"}}})],F.prototype,"id",void 0),o([u({type:Z,json:{read:{source:"tileInfo"}}})],F.prototype,"tileInfo",void 0),F=J=o([N("esri.layer.support.TileMatrixSet")],F);const Fe=F;var z;let E=z=class extends Q{constructor(e){super(e),this.id=null,this.title=null,this.description=null,this.legendUrl=null}clone(){const e=new z;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("isDefault")&&(e.isDefault=this.isDefault),this.hasOwnProperty("keywords")&&(e.keywords=this.keywords&&this.keywords.slice()),this.hasOwnProperty("legendUrl")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty("title")&&(e.title=this.title),e}};o([u({json:{read:{source:"id"}}})],E.prototype,"id",void 0),o([u({json:{read:{source:"title"}}})],E.prototype,"title",void 0),o([u({json:{read:{source:"abstract"}}})],E.prototype,"description",void 0),o([u({json:{read:{source:"legendUrl"}}})],E.prototype,"legendUrl",void 0),o([u({json:{read:{source:"isDefault"}}})],E.prototype,"isDefault",void 0),o([u({json:{read:{source:"keywords"}}})],E.prototype,"keywords",void 0),E=z=o([N("esri.layer.support.WMTSStyle")],E);const $e=E;var H;let x=H=class extends Q{constructor(e){super(e),this.description=null,this.fullExtent=null,this.fullExtents=null,this.id=null,this.imageFormats=null,this.layer=null,this.parent=null,this.styles=null,this.title=null,this.tileMatrixSetId=null,this.tileMatrixSets=null}readFullExtent(e,t){return(e=t.fullExtent)?A.fromJSON(e):null}readFullExtents(e,t){var r,i;return(r=t.fullExtents)!=null&&r.length?t.fullExtents.map(s=>A.fromJSON(s)):((i=t.tileMatrixSets)==null?void 0:i.map(s=>A.fromJSON(s.fullExtent)).filter(s=>s))??[]}get imageFormat(){let e=this._get("imageFormat");return e||(e=this.imageFormats&&this.imageFormats.length?this.imageFormats[0]:""),e}set imageFormat(e){const t=this.imageFormats;e&&(e.includes("image/")||t&&!t.includes(e))&&(e.includes("image/")||(e="image/"+e),t&&!t.includes(e))?console.error("The layer doesn't support the format of "+e):this._set("imageFormat",e)}get styleId(){var t,r;let e=this._get("styleId");return e||(e=((r=(t=this.styles)==null?void 0:t.at(0))==null?void 0:r.id)??""),e}set styleId(e){this._set("styleId",e)}get tileMatrixSet(){return this.tileMatrixSets?this.tileMatrixSets.find(e=>e.id===this.tileMatrixSetId):null}clone(){var t,r,i;const e=new H;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("imageFormats")&&(e.imageFormats=this.imageFormats&&this.imageFormats.slice()),this.hasOwnProperty("imageFormat")&&(e.imageFormat=this.imageFormat),this.hasOwnProperty("fullExtent")&&(e.fullExtent=(t=this.fullExtent)==null?void 0:t.clone()),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("layer")&&(e.layer=this.layer),this.hasOwnProperty("styleId")&&(e.styleId=this.styleId),this.hasOwnProperty("styles")&&(e.styles=(r=this.styles)==null?void 0:r.clone()),this.hasOwnProperty("tileMatrixSetId")&&(e.tileMatrixSetId=this.tileMatrixSetId),this.hasOwnProperty("tileMatrixSets")&&(e.tileMatrixSets=(i=this.tileMatrixSets)==null?void 0:i.clone()),this.hasOwnProperty("title")&&(e.title=this.title),e}};o([u()],x.prototype,"description",void 0),o([u()],x.prototype,"fullExtent",void 0),o([R("fullExtent",["fullExtent"])],x.prototype,"readFullExtent",null),o([u({readOnly:!0})],x.prototype,"fullExtents",void 0),o([R("fullExtents",["fullExtents","tileMatrixSets"])],x.prototype,"readFullExtents",null),o([u()],x.prototype,"id",void 0),o([u()],x.prototype,"imageFormat",null),o([u({json:{read:{source:"formats"}}})],x.prototype,"imageFormats",void 0),o([u()],x.prototype,"layer",void 0),o([u()],x.prototype,"parent",void 0),o([u()],x.prototype,"styleId",null),o([u({type:G.ofType($e),json:{read:{source:"styles"}}})],x.prototype,"styles",void 0),o([u({json:{write:{ignoreOrigin:!0}}})],x.prototype,"title",void 0),o([u()],x.prototype,"tileMatrixSetId",void 0),o([u({readOnly:!0})],x.prototype,"tileMatrixSet",null),o([u({type:G.ofType(Fe),json:{read:{source:"tileMatrixSets"}}})],x.prototype,"tileMatrixSets",void 0),x=H=o([N("esri.layers.support.WMTSSublayer")],x);const U=x,me=90.71428571428571;function ue(e){const t=e.replaceAll(/ows:/gi,"");if(!g("Contents",new DOMParser().parseFromString(t,"text/xml").documentElement))throw new _("wmtslayer:wmts-capabilities-xml-is-not-valid","the wmts get capabilities response is not compliant",{text:e})}function Ve(e,t){var re;e=e.replaceAll(/ows:/gi,"");const r=new DOMParser().parseFromString(e,"text/xml").documentElement,i=new Map,s=new Map,l=g("Contents",r);if(!l)throw new _("wmtslayer:wmts-capabilities-xml-is-not-valid");const a=g("OperationsMetadata",r),n=a==null?void 0:a.querySelector("[name='GetTile']"),p=n==null?void 0:n.getElementsByTagName("Get"),c=p&&Array.prototype.slice.call(p),h=(re=t.url)==null?void 0:re.indexOf("https"),f=h!==void 0&&h>-1;let d,w,S=t.serviceMode,v=t==null?void 0:t.url;if(c!=null&&c.length&&c.some(T=>{const L=g("Constraint",T);return!L||$("AllowedValues","Value",S,L)?(v=T.attributes[0].nodeValue,!0):(!L||$("AllowedValues","Value","RESTful",L)||$("AllowedValues","Value","REST",L)?w=T.attributes[0].nodeValue:L&&!$("AllowedValues","Value","KVP",L)||(d=T.attributes[0].nodeValue),!1)}),!v)if(w)v=w,S="RESTful";else if(d)v=d,S="KVP";else{const T=g("ServiceMetadataURL",r);v=T==null?void 0:T.getAttribute("xlink:href")}const P=v.indexOf("1.0.0/");P===-1&&S==="RESTful"?v+="/":P>-1&&(v=v.substring(0,P)),S==="KVP"&&(v+=P>-1?"":"?"),f&&(v=v.replace(/^http:/i,"https:"));const M=y("ServiceIdentification>ServiceTypeVersion",r),I=y("ServiceIdentification>AccessConstraints",r),b=I&&/^none$/i.test(I)?null:I,k=C("Layer",l),W=C("TileMatrixSet",l),D=k.map(T=>{const L=y("Identifier",T);return i.set(L,T),je(L,T,W,f,M)});return{copyright:b,dimensionMap:s,layerMap:i,layers:D,serviceMode:S,tileUrl:v}}function Ue(e){return e.layers.forEach(t=>{var r;(r=t.tileMatrixSets)==null||r.forEach(i=>{var l;const s=i.tileInfo;s&&s.dpi!==96&&((l=s.lods)==null||l.forEach(a=>{var n;a.scale=96*a.scale/s.dpi,a.resolution=fe((n=s.spatialReference)==null?void 0:n.wkid,a.scale*me/96,i.id)}),s.dpi=96)})}),e}function ee(e){return e.nodeType===Node.ELEMENT_NODE}function g(e,t){for(let r=0;ri.textContent).filter(de)}function y(e,t){return e.split(">").forEach(r=>{t&&(t=g(r,t))}),t&&t.textContent}function $(e,t,r,i){let s;return Array.prototype.slice.call(i.childNodes).some(l=>{if(l.nodeName.includes(e)){const a=g(t,l),n=a==null?void 0:a.textContent;if(n===r||r.split(":")&&r.split(":")[1]===n)return s=l,!0}return!1}),s}function je(e,t,r,i,s){const l=y("Abstract",t),a=O("Format",t);return{id:e,fullExtent:We(t),fullExtents:De(t),description:l,formats:a,styles:Be(t,i),title:y("Title",t),tileMatrixSets:Ke(s,t,r)}}function he(e,t){var h;const r=[],i=(h=e.layerMap)==null?void 0:h.get(t);if(!i)return null;const s=C("ResourceURL",i),l=C("Dimension",i);let a,n,p,c;return l.length&&(a=y("Identifier",l[0]),n=O("Default",l[0])||O("Value",l[0])),l.length>1&&(p=y("Identifier",l[1]),c=O("Default",l[1])||O("Value",l[1])),e.dimensionMap.set(t,{dimensions:n,dimensions2:c}),s.forEach(f=>{let d=f.getAttribute("template");if(f.getAttribute("resourceType")==="tile"){if(a&&n.length)if(d.includes("{"+a+"}"))d=d.replace("{"+a+"}","{dimensionValue}");else{const w=d.toLowerCase().indexOf("{"+a.toLowerCase()+"}");w>-1&&(d=d.substring(0,w)+"{dimensionValue}"+d.substring(w+a.length+2))}if(p&&c.length)if(d.includes("{"+p+"}"))d=d.replace("{"+p+"}","{dimensionValue2}");else{const w=d.toLowerCase().indexOf("{"+p.toLowerCase()+"}");w>-1&&(d=d.substring(0,w)+"{dimensionValue2}"+d.substring(w+p.length+2))}r.push({template:d,format:f.getAttribute("format"),resourceType:"tile"})}}),r}function _e(e,t,r,i,s,l,a,n){var d,w;const p=Ne(e,t,i);if(!((p==null?void 0:p.length)>0))return"";const{dimensionMap:c}=e,h=(d=c.get(t).dimensions)==null?void 0:d[0],f=(w=c.get(t).dimensions2)==null?void 0:w[0];return p[a%p.length].template.replaceAll(/\{Style\}/gi,s??"").replaceAll(/\{TileMatrixSet\}/gi,r??"").replaceAll(/\{TileMatrix\}/gi,l).replaceAll(/\{TileRow\}/gi,""+a).replaceAll(/\{TileCol\}/gi,""+n).replaceAll(/\{dimensionValue\}/gi,h).replaceAll(/\{dimensionValue2\}/gi,f)}function Ne(e,t,r){const i=he(e,t),s=i==null?void 0:i.filter(l=>l.format===r);return(s!=null&&s.length?s:i)??[]}function ke(e,t,r,i){var n,p;const{dimensionMap:s}=e,l=he(e,t);let a="";if(l&&l.length>0){const c=(n=s.get(t).dimensions)==null?void 0:n[0],h=(p=s.get(t).dimensions2)==null?void 0:p[0];a=l[0].template,a.endsWith(".xxx")&&(a=a.slice(0,-4)),a=a.replaceAll(/\{Style\}/gi,i),a=a.replaceAll(/\{TileMatrixSet\}/gi,r),a=a.replaceAll(/\{TileMatrix\}/gi,"{level}"),a=a.replaceAll(/\{TileRow\}/gi,"{row}"),a=a.replaceAll(/\{TileCol\}/gi,"{col}"),a=a.replaceAll(/\{dimensionValue\}/gi,c),a=a.replaceAll(/\{dimensionValue2\}/gi,h)}return a}function We(e){const t=g("WGS84BoundingBox",e),r=t?y("LowerCorner",t).split(" "):["-180","-90"],i=t?y("UpperCorner",t).split(" "):["180","90"];return{xmin:parseFloat(r[0]),ymin:parseFloat(r[1]),xmax:parseFloat(i[0]),ymax:parseFloat(i[1]),spatialReference:{wkid:4326}}}function De(e){const t=[];return ne(e,{BoundingBox:r=>{if(!r.getAttribute("crs"))return;const i=r.getAttribute("crs").toLowerCase(),s=te(i),l=i.includes("epsg")&&X(s.wkid);let a,n,p,c;ne(r,{LowerCorner:h=>{[a,n]=h.textContent.split(" ").map(f=>Number.parseFloat(f)),l&&([a,n]=[n,a])},UpperCorner:h=>{[p,c]=h.textContent.split(" ").map(f=>Number.parseFloat(f)),l&&([p,c]=[c,p])}}),t.push({xmin:a,ymin:n,xmax:p,ymax:c,spatialReference:s})}}),t}function Be(e,t){return C("Style",e).map(r=>{const i=g("LegendURL",r),s=g("Keywords",r),l=s?O("Keyword",s):[];let a=i&&i.getAttribute("xlink:href");return t&&(a=a&&a.replace(/^http:/i,"https:")),{abstract:y("Abstract",r),id:y("Identifier",r),isDefault:r.getAttribute("isDefault")==="true",keywords:l,legendUrl:a,title:y("Title",r)}})}function Ke(e,t,r){return C("TileMatrixSetLink",t).map(i=>qe(e,i,r))}function qe(e,t,r){const i=g("TileMatrixSet",t).textContent,s=O("TileMatrix",t),l=r.find(M=>{const I=g("Identifier",M),b=I==null?void 0:I.textContent;return!!(b===i||i.split(":")&&i.split(":")[1]===b)}),a=g("TileMatrixSetLimits",t),n=a&&C("TileMatrixLimits",a),p=new Map;if(n!=null&&n.length)for(const M of n){const I=g("TileMatrix",M).textContent,b=+g("MinTileRow",M).textContent,k=+g("MaxTileRow",M).textContent,W=+g("MinTileCol",M).textContent,D=+g("MaxTileCol",M).textContent;p.set(I,{minCol:W,maxCol:D,minRow:b,maxRow:k})}const c=y("SupportedCRS",l).toLowerCase(),h=Ge(l,c),f=h.spatialReference,d=g("TileMatrix",l),w=[parseInt(y("TileWidth",d),10),parseInt(y("TileHeight",d),10)],S=[];s.length?s.forEach((M,I)=>{const b=$("TileMatrix","Identifier",M,l);S.push(pe(b,c,I,i,p))}):C("TileMatrix",l).forEach((M,I)=>{S.push(pe(M,c,I,i,p))});const v=Je(e,l,h,w,S[0]).toJSON(),P=new Z({dpi:96,spatialReference:f,size:w,origin:h,lods:S}).toJSON();return{id:i,fullExtent:v,tileInfo:P}}function te(e){e=e.toLowerCase();let t=parseInt(e.split(":").pop(),10);t!==900913&&t!==3857||(t=102100);const r=He(e);return r!=null&&(t=r),{wkid:t}}function Ge(e,t){return ye(g("TileMatrix",e),t)}function ye(e,t){const r=te(t),[i,s]=y("TopLeftCorner",e).split(" ").map(a=>parseFloat(a)),l=t.includes("epsg")&&X(r.wkid);return new ge(l?{x:s,y:i,spatialReference:r}:{x:i,y:s,spatialReference:r})}function Je(e,t,r,i,s){const l=g("BoundingBox",t);let a,n,p,c,h,f;if(l&&(a=y("LowerCorner",l).split(" "),n=y("UpperCorner",l).split(" ")),a&&a.length>1&&n&&n.length>1)p=parseFloat(a[0]),h=parseFloat(a[1]),c=parseFloat(n[0]),f=parseFloat(n[1]);else{const d=g("TileMatrix",t),w=parseInt(y("MatrixWidth",d),10),S=parseInt(y("MatrixHeight",d),10);p=r.x,f=r.y,c=p+w*i[0]*s.resolution,h=f-S*i[1]*s.resolution}return ze(e,r.spatialReference,r)?new A(h,p,f,c,r.spatialReference):new A(p,h,c,f,r.spatialReference)}function ze(e,t,r){return e==="1.0.0"&&X(t.wkid)&&!(r.spatialReference.isGeographic&&r.x<-90&&r.y>=-90)}var V;function He(e){return e.includes("crs84")||e.includes("crs:84")?V.CRS84:e.includes("crs83")||e.includes("crs:83")?V.CRS83:e.includes("crs27")||e.includes("crs:27")?V.CRS27:null}function pe(e,t,r,i,s){const l=te(t),a=y("Identifier",e);let n=parseFloat(y("ScaleDenominator",e));const p=fe(l.wkid,n,i);n*=96/me;const c=+y("MatrixWidth",e),h=+y("MatrixHeight",e),{maxCol:f=c-1,maxRow:d=h-1,minCol:w=0,minRow:S=0}=s.get(a)??{},{x:v,y:P}=ye(e,t);return new we({cols:[w,f],level:r,levelValue:a,origin:[v,P],scale:n,resolution:p,rows:[S,d]})}function fe(e,t,r){let i;return i=B.hasOwnProperty(""+e)?B.values[B[e]]:r==="default028mm"?6370997*Math.PI/180:xe(e).metersPerDegree,7*t/25e3/i}(function(e){e[e.CRS84=4326]="CRS84",e[e.CRS83=4269]="CRS83",e[e.CRS27=4267]="CRS27"})(V||(V={}));var Y;const ce={"image/png":".png","image/png8":".png","image/png24":".png","image/png32":".png","image/jpg":".jpg","image/jpeg":".jpeg","image/gif":".gif","image/bmp":".bmp","image/tiff":".tif","image/jpgpng":"","image/jpegpng":"","image/unknown":""},Ye=new Set(["version","service","request","layer","style","format","tilematrixset","tilematrix","tilerow","tilecol"]);let m=Y=class extends ve(Ae(Se(Me(Ie(Te(Ce)))))){constructor(...e){super(...e),this.activeLayer=null,this.copyright="",this.customParameters=null,this.customLayerParameters=null,this.fullExtent=null,this.operationalLayerType="WebTiledLayer",this.resourceInfo=null,this.serviceMode="RESTful",this.sublayers=null,this.type="wmts",this.version="1.0.0",this.addHandles([ie(()=>this.activeLayer,(t,r)=>{var i;r&&!((i=this.sublayers)!=null&&i.includes(r))&&(r.layer=null,r.parent=null),t&&(t.layer=this,t.parent=this)},j),se(()=>this.sublayers,"after-add",({item:t})=>{t.layer=this,t.parent=this},j),se(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=null,t.parent=null},j),ie(()=>this.sublayers,(t,r)=>{if(r)for(const i of r)i.layer=null,i.parent=null;if(t)for(const i of t)i.layer=this,i.parent=this},j)])}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMTS"]},e).catch(ae).then(()=>this._fetchService(e)).catch(t=>{throw ae(t),new _("wmtslayer:unsupported-service-data","Invalid response from the WMTS service.",{error:t})})),Promise.resolve(this)}readActiveLayerFromService(e,t,r){this.activeLayer||(this.activeLayer=new U);let i=t.layers.find(s=>s.id===this.activeLayer.id);return i||(i=t.layers[0]),this.activeLayer.read(i,r),this.activeLayer}readActiveLayerFromItemOrWebDoc(e,t){const{templateUrl:r,wmtsInfo:i}=t,s=r?this._getLowerCasedUrlParams(r):null,l=i==null?void 0:i.layerIdentifier;let a=null;const n=i==null?void 0:i.tileMatrixSet;n&&(Array.isArray(n)?n.length&&(a=n[0]):a=n);const p=s==null?void 0:s.format,c=s==null?void 0:s.style;return new U({id:l,imageFormat:p,styleId:c,tileMatrixSetId:a})}writeActiveLayer(e,t,r,i){const s=this.activeLayer;t.templateUrl=this.getUrlTemplate(s.id,s.tileMatrixSetId,s.imageFormat,s.styleId);const l=Le("tileMatrixSet.tileInfo",s);t.tileInfo=l?l.toJSON(i):null,t.wmtsInfo={...t.wmtsInfo,layerIdentifier:s.id,tileMatrixSet:s.tileMatrixSetId}}readCustomParameters(e,t){const r=t.wmtsInfo;return r?this._mergeParams(r.customParameters,r.url):null}get fullExtents(){return this.activeLayer.fullExtents}readServiceMode(e,t){return t.templateUrl.includes("?")?"KVP":"RESTful"}readSublayersFromService(e,t,r){return Ze(t.layers,r)}get supportedSpatialReferences(){var e;return((e=this.activeLayer.tileMatrixSets)==null?void 0:e.map(t=>{var r;return(r=t.tileInfo)==null?void 0:r.spatialReference}).toArray().filter(de))??[]}get tilemapCache(){var t,r;const e=(r=(t=this.activeLayer)==null?void 0:t.tileMatrixSet)==null?void 0:r.tileInfo;return e?new Ee(e):void 0}get title(){var e;return((e=this.activeLayer)==null?void 0:e.title)??"Layer"}set title(e){this._overrideIfSome("title",e)}get url(){return this._get("url")}set url(e){e&&e.substr(-1)==="/"?this._set("url",e.slice(0,-1)):this._set("url",e)}createWebTileLayer(e){const t=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId),r=this._getTileMatrixSetById(e.tileMatrixSetId),i=r==null?void 0:r.tileInfo,s=e.fullExtent,l=new Re({layerIdentifier:e.id,tileMatrixSet:e.tileMatrixSetId,url:this.url});return this.customLayerParameters&&(l.customLayerParameters=this.customLayerParameters),this.customParameters&&(l.customParameters=this.customParameters),new Oe({fullExtent:s,urlTemplate:t,tileInfo:i,wmtsInfo:l})}async fetchTile(e,t,r,i={}){const{signal:s}=i,l=this.getTileUrl(e,t,r),{data:a}=await K(l,{responseType:"image",signal:s});return a}async fetchImageBitmapTile(e,t,r,i={}){const{signal:s}=i;if(this.fetchTile!==Y.prototype.fetchTile){const n=await this.fetchTile(e,t,r,i);return oe(n,e,t,r,s)}const l=this.getTileUrl(e,t,r),{data:a}=await K(l,{responseType:"blob",signal:s});return oe(a,e,t,r,s)}findSublayerById(e){var t;return(t=this.sublayers)==null?void 0:t.find(r=>r.id===e)}getTileUrl(e,t,r){var n;const i=this._getTileMatrixSetById(this.activeLayer.tileMatrixSetId),s=(n=i==null?void 0:i.tileInfo)==null?void 0:n.lods[e],l=s?s.levelValue||`${s.level}`:`${e}`;let a=this.resourceInfo?"":_e({dimensionMap:this.dimensionMap,layerMap:this.layerMap},this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId,l,t,r);return a||(a=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId).replaceAll(/\{level\}/gi,l).replaceAll(/\{row\}/gi,`${t}`).replaceAll(/\{col\}/gi,`${r}`)),a=this._appendCustomLayerParameters(a),a}getUrlTemplate(e,t,r,i){if(!this.resourceInfo){const s=ke({dimensionMap:this.dimensionMap,layerMap:this.layerMap},e,t,i);if(s)return s}if(this.serviceMode==="KVP")return this.url+"?SERVICE=WMTS&VERSION="+this.version+"&REQUEST=GetTile&LAYER="+e+"&STYLE="+i+"&FORMAT="+r+"&TILEMATRIXSET="+t+"&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}";if(this.serviceMode==="RESTful"){let s="";return ce[r.toLowerCase()]&&(s=ce[r.toLowerCase()]),this.url+e+"/"+i+"/"+t+"/{level}/{row}/{col}"+s}return""}async _fetchService(e){let t;if(this.resourceInfo)this.resourceInfo.serviceMode==="KVP"&&(this.url+=this.url.includes("?")?"":"?"),t={ssl:!1,data:this.resourceInfo};else try{t=await this._getCapabilities(this.serviceMode,e),ue(t.data)}catch{const r=this.serviceMode==="KVP"?"RESTful":"KVP";try{t=await this._getCapabilities(r,e),ue(t.data),this.serviceMode=r}catch(i){throw new _("wmtslayer:unsupported-service-data","Services does not support RESTful or KVP service modes.",{error:i})}}this.resourceInfo?t.data=Ue(t.data):t.data=Ve(t.data,{serviceMode:this.serviceMode,url:this.url}),t.data&&this.read(t.data,{origin:"service"})}async _getCapabilities(e,t){const r=this._getCapabilitiesUrl(e);return await K(r,{...t,responseType:"text"})}_getTileMatrixSetById(e){var i;const t=this.findSublayerById(this.activeLayer.id);return(i=t==null?void 0:t.tileMatrixSets)==null?void 0:i.find(s=>s.id===e)}_appendCustomParameters(e){return this._appendParameters(e,this.customParameters)}_appendCustomLayerParameters(e){return this._appendParameters(e,{...le(this.customParameters),...this.customLayerParameters})}_appendParameters(e,t){const r=q(e),i={...r.query,...t},s=Pe(i);return s===""?r.path:`${r.path}?${s}`}_getCapabilitiesUrl(e){this.url=q(this.url).path;let t=this.url;switch(e){case"KVP":t+=`?request=GetCapabilities&service=WMTS&version=${this.version}`;break;case"RESTful":{const r=`/${this.version}/WMTSCapabilities.xml`,i=new RegExp(r,"i");t=t.replace(i,""),t+=r;break}}return this._appendCustomParameters(t)}_getLowerCasedUrlParams(e){if(!e)return null;const t=q(e).query;if(!t)return null;const r={};return Object.keys(t).forEach(i=>{r[i.toLowerCase()]=t[i]}),r}_mergeParams(e,t){const r=this._getLowerCasedUrlParams(t);if(r){const i=Object.keys(r);i.length&&(e=e?le(e):{},i.forEach(s=>{e.hasOwnProperty(s)||Ye.has(s)||(e[s]=r[s])}))}return e}};function Ze(e,t){return e.map(r=>{const i=new U;return i.read(r,t),i})}o([u()],m.prototype,"dimensionMap",void 0),o([u()],m.prototype,"layerMap",void 0),o([u({type:U,json:{origins:{"web-document":{write:{ignoreOrigin:!0}}}}})],m.prototype,"activeLayer",void 0),o([R("service","activeLayer",["layers"])],m.prototype,"readActiveLayerFromService",null),o([R(["web-document","portal-item"],"activeLayer",["wmtsInfo"])],m.prototype,"readActiveLayerFromItemOrWebDoc",null),o([be(["web-document","portal-item"],"activeLayer",{templateUrl:{type:String},tileInfo:{type:Z},"wmtsInfo.layerIdentifier":{type:String},"wmtsInfo.tileMatrixSet":{type:String}})],m.prototype,"writeActiveLayer",null),o([u({type:String,value:"",json:{write:!0}})],m.prototype,"copyright",void 0),o([u({type:["show","hide"]})],m.prototype,"listMode",void 0),o([u({json:{read:!0,write:!0}})],m.prototype,"blendMode",void 0),o([u({json:{origins:{"web-document":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}},"portal-item":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}}}}})],m.prototype,"customParameters",void 0),o([R(["portal-item","web-document"],"customParameters")],m.prototype,"readCustomParameters",null),o([u({json:{origins:{"web-document":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}},"portal-item":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}}}}})],m.prototype,"customLayerParameters",void 0),o([u({type:A,json:{write:{ignoreOrigin:!0},origins:{"web-document":{read:{source:"fullExtent"}},"portal-item":{read:{source:"fullExtent"}}}}})],m.prototype,"fullExtent",void 0),o([u({readOnly:!0})],m.prototype,"fullExtents",null),o([u({type:["WebTiledLayer"]})],m.prototype,"operationalLayerType",void 0),o([u()],m.prototype,"resourceInfo",void 0),o([u()],m.prototype,"serviceMode",void 0),o([R(["portal-item","web-document"],"serviceMode",["templateUrl"])],m.prototype,"readServiceMode",null),o([u({type:G.ofType(U)})],m.prototype,"sublayers",void 0),o([R("service","sublayers",["layers"])],m.prototype,"readSublayersFromService",null),o([u({readOnly:!0})],m.prototype,"supportedSpatialReferences",null),o([u({readOnly:!0})],m.prototype,"tilemapCache",null),o([u({json:{read:{source:"title"}}})],m.prototype,"title",null),o([u({json:{read:!1},readOnly:!0,value:"wmts"})],m.prototype,"type",void 0),o([u({json:{origins:{service:{read:{source:"tileUrl"}},"web-document":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}},"portal-item":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}}}}})],m.prototype,"url",null),o([u()],m.prototype,"version",void 0),m=Y=o([N("esri.layers.WMTSLayer")],m);const st=m;export{st as default}; +import{d as o,y as u,aE as A,dZ as Z,f as N,aU as Q,aZ as R,V as G,N as _,aA as ge,d_ as we,hY as B,hZ as xe,q as de,bP as ve,bQ as Se,dp as Me,dq as Ie,dr as Te,g as ie,ez as j,z as se,ay as ae,aG as Le,h_ as Ee,M as K,aV as le,bW as q,e0 as Pe,aR as be,bT as Ce}from"./index-BjUNJPVf.js";import{p as Re,I as Oe}from"./WebTileLayer-IRzcPxtS.js";import{f as Ae}from"./RefreshableLayer-_r2TPtol.js";import{o as oe}from"./imageBitmapUtils-BVxrhFkK.js";import{o as X}from"./crsUtils-DAndLU68.js";import{o as ne}from"./xmlUtils-CtUoQO7q.js";var J;let F=J=class extends Q{constructor(e){super(e),this.fullExtent=null,this.id=null,this.tileInfo=null}clone(){const e=new J;return this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent&&this.fullExtent.clone()),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("tileInfo")&&(e.tileInfo=this.tileInfo&&this.tileInfo.clone()),e}};o([u({type:A,json:{read:{source:"fullExtent"}}})],F.prototype,"fullExtent",void 0),o([u({type:String,json:{read:{source:"id"}}})],F.prototype,"id",void 0),o([u({type:Z,json:{read:{source:"tileInfo"}}})],F.prototype,"tileInfo",void 0),F=J=o([N("esri.layer.support.TileMatrixSet")],F);const Fe=F;var z;let E=z=class extends Q{constructor(e){super(e),this.id=null,this.title=null,this.description=null,this.legendUrl=null}clone(){const e=new z;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("isDefault")&&(e.isDefault=this.isDefault),this.hasOwnProperty("keywords")&&(e.keywords=this.keywords&&this.keywords.slice()),this.hasOwnProperty("legendUrl")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty("title")&&(e.title=this.title),e}};o([u({json:{read:{source:"id"}}})],E.prototype,"id",void 0),o([u({json:{read:{source:"title"}}})],E.prototype,"title",void 0),o([u({json:{read:{source:"abstract"}}})],E.prototype,"description",void 0),o([u({json:{read:{source:"legendUrl"}}})],E.prototype,"legendUrl",void 0),o([u({json:{read:{source:"isDefault"}}})],E.prototype,"isDefault",void 0),o([u({json:{read:{source:"keywords"}}})],E.prototype,"keywords",void 0),E=z=o([N("esri.layer.support.WMTSStyle")],E);const $e=E;var H;let x=H=class extends Q{constructor(e){super(e),this.description=null,this.fullExtent=null,this.fullExtents=null,this.id=null,this.imageFormats=null,this.layer=null,this.parent=null,this.styles=null,this.title=null,this.tileMatrixSetId=null,this.tileMatrixSets=null}readFullExtent(e,t){return(e=t.fullExtent)?A.fromJSON(e):null}readFullExtents(e,t){var r,i;return(r=t.fullExtents)!=null&&r.length?t.fullExtents.map(s=>A.fromJSON(s)):((i=t.tileMatrixSets)==null?void 0:i.map(s=>A.fromJSON(s.fullExtent)).filter(s=>s))??[]}get imageFormat(){let e=this._get("imageFormat");return e||(e=this.imageFormats&&this.imageFormats.length?this.imageFormats[0]:""),e}set imageFormat(e){const t=this.imageFormats;e&&(e.includes("image/")||t&&!t.includes(e))&&(e.includes("image/")||(e="image/"+e),t&&!t.includes(e))?console.error("The layer doesn't support the format of "+e):this._set("imageFormat",e)}get styleId(){var t,r;let e=this._get("styleId");return e||(e=((r=(t=this.styles)==null?void 0:t.at(0))==null?void 0:r.id)??""),e}set styleId(e){this._set("styleId",e)}get tileMatrixSet(){return this.tileMatrixSets?this.tileMatrixSets.find(e=>e.id===this.tileMatrixSetId):null}clone(){var t,r,i;const e=new H;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("imageFormats")&&(e.imageFormats=this.imageFormats&&this.imageFormats.slice()),this.hasOwnProperty("imageFormat")&&(e.imageFormat=this.imageFormat),this.hasOwnProperty("fullExtent")&&(e.fullExtent=(t=this.fullExtent)==null?void 0:t.clone()),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("layer")&&(e.layer=this.layer),this.hasOwnProperty("styleId")&&(e.styleId=this.styleId),this.hasOwnProperty("styles")&&(e.styles=(r=this.styles)==null?void 0:r.clone()),this.hasOwnProperty("tileMatrixSetId")&&(e.tileMatrixSetId=this.tileMatrixSetId),this.hasOwnProperty("tileMatrixSets")&&(e.tileMatrixSets=(i=this.tileMatrixSets)==null?void 0:i.clone()),this.hasOwnProperty("title")&&(e.title=this.title),e}};o([u()],x.prototype,"description",void 0),o([u()],x.prototype,"fullExtent",void 0),o([R("fullExtent",["fullExtent"])],x.prototype,"readFullExtent",null),o([u({readOnly:!0})],x.prototype,"fullExtents",void 0),o([R("fullExtents",["fullExtents","tileMatrixSets"])],x.prototype,"readFullExtents",null),o([u()],x.prototype,"id",void 0),o([u()],x.prototype,"imageFormat",null),o([u({json:{read:{source:"formats"}}})],x.prototype,"imageFormats",void 0),o([u()],x.prototype,"layer",void 0),o([u()],x.prototype,"parent",void 0),o([u()],x.prototype,"styleId",null),o([u({type:G.ofType($e),json:{read:{source:"styles"}}})],x.prototype,"styles",void 0),o([u({json:{write:{ignoreOrigin:!0}}})],x.prototype,"title",void 0),o([u()],x.prototype,"tileMatrixSetId",void 0),o([u({readOnly:!0})],x.prototype,"tileMatrixSet",null),o([u({type:G.ofType(Fe),json:{read:{source:"tileMatrixSets"}}})],x.prototype,"tileMatrixSets",void 0),x=H=o([N("esri.layers.support.WMTSSublayer")],x);const U=x,me=90.71428571428571;function ue(e){const t=e.replaceAll(/ows:/gi,"");if(!g("Contents",new DOMParser().parseFromString(t,"text/xml").documentElement))throw new _("wmtslayer:wmts-capabilities-xml-is-not-valid","the wmts get capabilities response is not compliant",{text:e})}function Ve(e,t){var re;e=e.replaceAll(/ows:/gi,"");const r=new DOMParser().parseFromString(e,"text/xml").documentElement,i=new Map,s=new Map,l=g("Contents",r);if(!l)throw new _("wmtslayer:wmts-capabilities-xml-is-not-valid");const a=g("OperationsMetadata",r),n=a==null?void 0:a.querySelector("[name='GetTile']"),p=n==null?void 0:n.getElementsByTagName("Get"),c=p&&Array.prototype.slice.call(p),h=(re=t.url)==null?void 0:re.indexOf("https"),f=h!==void 0&&h>-1;let d,w,S=t.serviceMode,v=t==null?void 0:t.url;if(c!=null&&c.length&&c.some(T=>{const L=g("Constraint",T);return!L||$("AllowedValues","Value",S,L)?(v=T.attributes[0].nodeValue,!0):(!L||$("AllowedValues","Value","RESTful",L)||$("AllowedValues","Value","REST",L)?w=T.attributes[0].nodeValue:L&&!$("AllowedValues","Value","KVP",L)||(d=T.attributes[0].nodeValue),!1)}),!v)if(w)v=w,S="RESTful";else if(d)v=d,S="KVP";else{const T=g("ServiceMetadataURL",r);v=T==null?void 0:T.getAttribute("xlink:href")}const P=v.indexOf("1.0.0/");P===-1&&S==="RESTful"?v+="/":P>-1&&(v=v.substring(0,P)),S==="KVP"&&(v+=P>-1?"":"?"),f&&(v=v.replace(/^http:/i,"https:"));const M=y("ServiceIdentification>ServiceTypeVersion",r),I=y("ServiceIdentification>AccessConstraints",r),b=I&&/^none$/i.test(I)?null:I,k=C("Layer",l),W=C("TileMatrixSet",l),D=k.map(T=>{const L=y("Identifier",T);return i.set(L,T),je(L,T,W,f,M)});return{copyright:b,dimensionMap:s,layerMap:i,layers:D,serviceMode:S,tileUrl:v}}function Ue(e){return e.layers.forEach(t=>{var r;(r=t.tileMatrixSets)==null||r.forEach(i=>{var l;const s=i.tileInfo;s&&s.dpi!==96&&((l=s.lods)==null||l.forEach(a=>{var n;a.scale=96*a.scale/s.dpi,a.resolution=fe((n=s.spatialReference)==null?void 0:n.wkid,a.scale*me/96,i.id)}),s.dpi=96)})}),e}function ee(e){return e.nodeType===Node.ELEMENT_NODE}function g(e,t){for(let r=0;ri.textContent).filter(de)}function y(e,t){return e.split(">").forEach(r=>{t&&(t=g(r,t))}),t&&t.textContent}function $(e,t,r,i){let s;return Array.prototype.slice.call(i.childNodes).some(l=>{if(l.nodeName.includes(e)){const a=g(t,l),n=a==null?void 0:a.textContent;if(n===r||r.split(":")&&r.split(":")[1]===n)return s=l,!0}return!1}),s}function je(e,t,r,i,s){const l=y("Abstract",t),a=O("Format",t);return{id:e,fullExtent:We(t),fullExtents:De(t),description:l,formats:a,styles:Be(t,i),title:y("Title",t),tileMatrixSets:Ke(s,t,r)}}function he(e,t){var h;const r=[],i=(h=e.layerMap)==null?void 0:h.get(t);if(!i)return null;const s=C("ResourceURL",i),l=C("Dimension",i);let a,n,p,c;return l.length&&(a=y("Identifier",l[0]),n=O("Default",l[0])||O("Value",l[0])),l.length>1&&(p=y("Identifier",l[1]),c=O("Default",l[1])||O("Value",l[1])),e.dimensionMap.set(t,{dimensions:n,dimensions2:c}),s.forEach(f=>{let d=f.getAttribute("template");if(f.getAttribute("resourceType")==="tile"){if(a&&n.length)if(d.includes("{"+a+"}"))d=d.replace("{"+a+"}","{dimensionValue}");else{const w=d.toLowerCase().indexOf("{"+a.toLowerCase()+"}");w>-1&&(d=d.substring(0,w)+"{dimensionValue}"+d.substring(w+a.length+2))}if(p&&c.length)if(d.includes("{"+p+"}"))d=d.replace("{"+p+"}","{dimensionValue2}");else{const w=d.toLowerCase().indexOf("{"+p.toLowerCase()+"}");w>-1&&(d=d.substring(0,w)+"{dimensionValue2}"+d.substring(w+p.length+2))}r.push({template:d,format:f.getAttribute("format"),resourceType:"tile"})}}),r}function _e(e,t,r,i,s,l,a,n){var d,w;const p=Ne(e,t,i);if(!((p==null?void 0:p.length)>0))return"";const{dimensionMap:c}=e,h=(d=c.get(t).dimensions)==null?void 0:d[0],f=(w=c.get(t).dimensions2)==null?void 0:w[0];return p[a%p.length].template.replaceAll(/\{Style\}/gi,s??"").replaceAll(/\{TileMatrixSet\}/gi,r??"").replaceAll(/\{TileMatrix\}/gi,l).replaceAll(/\{TileRow\}/gi,""+a).replaceAll(/\{TileCol\}/gi,""+n).replaceAll(/\{dimensionValue\}/gi,h).replaceAll(/\{dimensionValue2\}/gi,f)}function Ne(e,t,r){const i=he(e,t),s=i==null?void 0:i.filter(l=>l.format===r);return(s!=null&&s.length?s:i)??[]}function ke(e,t,r,i){var n,p;const{dimensionMap:s}=e,l=he(e,t);let a="";if(l&&l.length>0){const c=(n=s.get(t).dimensions)==null?void 0:n[0],h=(p=s.get(t).dimensions2)==null?void 0:p[0];a=l[0].template,a.endsWith(".xxx")&&(a=a.slice(0,-4)),a=a.replaceAll(/\{Style\}/gi,i),a=a.replaceAll(/\{TileMatrixSet\}/gi,r),a=a.replaceAll(/\{TileMatrix\}/gi,"{level}"),a=a.replaceAll(/\{TileRow\}/gi,"{row}"),a=a.replaceAll(/\{TileCol\}/gi,"{col}"),a=a.replaceAll(/\{dimensionValue\}/gi,c),a=a.replaceAll(/\{dimensionValue2\}/gi,h)}return a}function We(e){const t=g("WGS84BoundingBox",e),r=t?y("LowerCorner",t).split(" "):["-180","-90"],i=t?y("UpperCorner",t).split(" "):["180","90"];return{xmin:parseFloat(r[0]),ymin:parseFloat(r[1]),xmax:parseFloat(i[0]),ymax:parseFloat(i[1]),spatialReference:{wkid:4326}}}function De(e){const t=[];return ne(e,{BoundingBox:r=>{if(!r.getAttribute("crs"))return;const i=r.getAttribute("crs").toLowerCase(),s=te(i),l=i.includes("epsg")&&X(s.wkid);let a,n,p,c;ne(r,{LowerCorner:h=>{[a,n]=h.textContent.split(" ").map(f=>Number.parseFloat(f)),l&&([a,n]=[n,a])},UpperCorner:h=>{[p,c]=h.textContent.split(" ").map(f=>Number.parseFloat(f)),l&&([p,c]=[c,p])}}),t.push({xmin:a,ymin:n,xmax:p,ymax:c,spatialReference:s})}}),t}function Be(e,t){return C("Style",e).map(r=>{const i=g("LegendURL",r),s=g("Keywords",r),l=s?O("Keyword",s):[];let a=i&&i.getAttribute("xlink:href");return t&&(a=a&&a.replace(/^http:/i,"https:")),{abstract:y("Abstract",r),id:y("Identifier",r),isDefault:r.getAttribute("isDefault")==="true",keywords:l,legendUrl:a,title:y("Title",r)}})}function Ke(e,t,r){return C("TileMatrixSetLink",t).map(i=>qe(e,i,r))}function qe(e,t,r){const i=g("TileMatrixSet",t).textContent,s=O("TileMatrix",t),l=r.find(M=>{const I=g("Identifier",M),b=I==null?void 0:I.textContent;return!!(b===i||i.split(":")&&i.split(":")[1]===b)}),a=g("TileMatrixSetLimits",t),n=a&&C("TileMatrixLimits",a),p=new Map;if(n!=null&&n.length)for(const M of n){const I=g("TileMatrix",M).textContent,b=+g("MinTileRow",M).textContent,k=+g("MaxTileRow",M).textContent,W=+g("MinTileCol",M).textContent,D=+g("MaxTileCol",M).textContent;p.set(I,{minCol:W,maxCol:D,minRow:b,maxRow:k})}const c=y("SupportedCRS",l).toLowerCase(),h=Ge(l,c),f=h.spatialReference,d=g("TileMatrix",l),w=[parseInt(y("TileWidth",d),10),parseInt(y("TileHeight",d),10)],S=[];s.length?s.forEach((M,I)=>{const b=$("TileMatrix","Identifier",M,l);S.push(pe(b,c,I,i,p))}):C("TileMatrix",l).forEach((M,I)=>{S.push(pe(M,c,I,i,p))});const v=Je(e,l,h,w,S[0]).toJSON(),P=new Z({dpi:96,spatialReference:f,size:w,origin:h,lods:S}).toJSON();return{id:i,fullExtent:v,tileInfo:P}}function te(e){e=e.toLowerCase();let t=parseInt(e.split(":").pop(),10);t!==900913&&t!==3857||(t=102100);const r=He(e);return r!=null&&(t=r),{wkid:t}}function Ge(e,t){return ye(g("TileMatrix",e),t)}function ye(e,t){const r=te(t),[i,s]=y("TopLeftCorner",e).split(" ").map(a=>parseFloat(a)),l=t.includes("epsg")&&X(r.wkid);return new ge(l?{x:s,y:i,spatialReference:r}:{x:i,y:s,spatialReference:r})}function Je(e,t,r,i,s){const l=g("BoundingBox",t);let a,n,p,c,h,f;if(l&&(a=y("LowerCorner",l).split(" "),n=y("UpperCorner",l).split(" ")),a&&a.length>1&&n&&n.length>1)p=parseFloat(a[0]),h=parseFloat(a[1]),c=parseFloat(n[0]),f=parseFloat(n[1]);else{const d=g("TileMatrix",t),w=parseInt(y("MatrixWidth",d),10),S=parseInt(y("MatrixHeight",d),10);p=r.x,f=r.y,c=p+w*i[0]*s.resolution,h=f-S*i[1]*s.resolution}return ze(e,r.spatialReference,r)?new A(h,p,f,c,r.spatialReference):new A(p,h,c,f,r.spatialReference)}function ze(e,t,r){return e==="1.0.0"&&X(t.wkid)&&!(r.spatialReference.isGeographic&&r.x<-90&&r.y>=-90)}var V;function He(e){return e.includes("crs84")||e.includes("crs:84")?V.CRS84:e.includes("crs83")||e.includes("crs:83")?V.CRS83:e.includes("crs27")||e.includes("crs:27")?V.CRS27:null}function pe(e,t,r,i,s){const l=te(t),a=y("Identifier",e);let n=parseFloat(y("ScaleDenominator",e));const p=fe(l.wkid,n,i);n*=96/me;const c=+y("MatrixWidth",e),h=+y("MatrixHeight",e),{maxCol:f=c-1,maxRow:d=h-1,minCol:w=0,minRow:S=0}=s.get(a)??{},{x:v,y:P}=ye(e,t);return new we({cols:[w,f],level:r,levelValue:a,origin:[v,P],scale:n,resolution:p,rows:[S,d]})}function fe(e,t,r){let i;return i=B.hasOwnProperty(""+e)?B.values[B[e]]:r==="default028mm"?6370997*Math.PI/180:xe(e).metersPerDegree,7*t/25e3/i}(function(e){e[e.CRS84=4326]="CRS84",e[e.CRS83=4269]="CRS83",e[e.CRS27=4267]="CRS27"})(V||(V={}));var Y;const ce={"image/png":".png","image/png8":".png","image/png24":".png","image/png32":".png","image/jpg":".jpg","image/jpeg":".jpeg","image/gif":".gif","image/bmp":".bmp","image/tiff":".tif","image/jpgpng":"","image/jpegpng":"","image/unknown":""},Ye=new Set(["version","service","request","layer","style","format","tilematrixset","tilematrix","tilerow","tilecol"]);let m=Y=class extends ve(Ae(Se(Me(Ie(Te(Ce)))))){constructor(...e){super(...e),this.activeLayer=null,this.copyright="",this.customParameters=null,this.customLayerParameters=null,this.fullExtent=null,this.operationalLayerType="WebTiledLayer",this.resourceInfo=null,this.serviceMode="RESTful",this.sublayers=null,this.type="wmts",this.version="1.0.0",this.addHandles([ie(()=>this.activeLayer,(t,r)=>{var i;r&&!((i=this.sublayers)!=null&&i.includes(r))&&(r.layer=null,r.parent=null),t&&(t.layer=this,t.parent=this)},j),se(()=>this.sublayers,"after-add",({item:t})=>{t.layer=this,t.parent=this},j),se(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=null,t.parent=null},j),ie(()=>this.sublayers,(t,r)=>{if(r)for(const i of r)i.layer=null,i.parent=null;if(t)for(const i of t)i.layer=this,i.parent=this},j)])}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMTS"]},e).catch(ae).then(()=>this._fetchService(e)).catch(t=>{throw ae(t),new _("wmtslayer:unsupported-service-data","Invalid response from the WMTS service.",{error:t})})),Promise.resolve(this)}readActiveLayerFromService(e,t,r){this.activeLayer||(this.activeLayer=new U);let i=t.layers.find(s=>s.id===this.activeLayer.id);return i||(i=t.layers[0]),this.activeLayer.read(i,r),this.activeLayer}readActiveLayerFromItemOrWebDoc(e,t){const{templateUrl:r,wmtsInfo:i}=t,s=r?this._getLowerCasedUrlParams(r):null,l=i==null?void 0:i.layerIdentifier;let a=null;const n=i==null?void 0:i.tileMatrixSet;n&&(Array.isArray(n)?n.length&&(a=n[0]):a=n);const p=s==null?void 0:s.format,c=s==null?void 0:s.style;return new U({id:l,imageFormat:p,styleId:c,tileMatrixSetId:a})}writeActiveLayer(e,t,r,i){const s=this.activeLayer;t.templateUrl=this.getUrlTemplate(s.id,s.tileMatrixSetId,s.imageFormat,s.styleId);const l=Le("tileMatrixSet.tileInfo",s);t.tileInfo=l?l.toJSON(i):null,t.wmtsInfo={...t.wmtsInfo,layerIdentifier:s.id,tileMatrixSet:s.tileMatrixSetId}}readCustomParameters(e,t){const r=t.wmtsInfo;return r?this._mergeParams(r.customParameters,r.url):null}get fullExtents(){return this.activeLayer.fullExtents}readServiceMode(e,t){return t.templateUrl.includes("?")?"KVP":"RESTful"}readSublayersFromService(e,t,r){return Ze(t.layers,r)}get supportedSpatialReferences(){var e;return((e=this.activeLayer.tileMatrixSets)==null?void 0:e.map(t=>{var r;return(r=t.tileInfo)==null?void 0:r.spatialReference}).toArray().filter(de))??[]}get tilemapCache(){var t,r;const e=(r=(t=this.activeLayer)==null?void 0:t.tileMatrixSet)==null?void 0:r.tileInfo;return e?new Ee(e):void 0}get title(){var e;return((e=this.activeLayer)==null?void 0:e.title)??"Layer"}set title(e){this._overrideIfSome("title",e)}get url(){return this._get("url")}set url(e){e&&e.substr(-1)==="/"?this._set("url",e.slice(0,-1)):this._set("url",e)}createWebTileLayer(e){const t=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId),r=this._getTileMatrixSetById(e.tileMatrixSetId),i=r==null?void 0:r.tileInfo,s=e.fullExtent,l=new Re({layerIdentifier:e.id,tileMatrixSet:e.tileMatrixSetId,url:this.url});return this.customLayerParameters&&(l.customLayerParameters=this.customLayerParameters),this.customParameters&&(l.customParameters=this.customParameters),new Oe({fullExtent:s,urlTemplate:t,tileInfo:i,wmtsInfo:l})}async fetchTile(e,t,r,i={}){const{signal:s}=i,l=this.getTileUrl(e,t,r),{data:a}=await K(l,{responseType:"image",signal:s});return a}async fetchImageBitmapTile(e,t,r,i={}){const{signal:s}=i;if(this.fetchTile!==Y.prototype.fetchTile){const n=await this.fetchTile(e,t,r,i);return oe(n,e,t,r,s)}const l=this.getTileUrl(e,t,r),{data:a}=await K(l,{responseType:"blob",signal:s});return oe(a,e,t,r,s)}findSublayerById(e){var t;return(t=this.sublayers)==null?void 0:t.find(r=>r.id===e)}getTileUrl(e,t,r){var n;const i=this._getTileMatrixSetById(this.activeLayer.tileMatrixSetId),s=(n=i==null?void 0:i.tileInfo)==null?void 0:n.lods[e],l=s?s.levelValue||`${s.level}`:`${e}`;let a=this.resourceInfo?"":_e({dimensionMap:this.dimensionMap,layerMap:this.layerMap},this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId,l,t,r);return a||(a=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId).replaceAll(/\{level\}/gi,l).replaceAll(/\{row\}/gi,`${t}`).replaceAll(/\{col\}/gi,`${r}`)),a=this._appendCustomLayerParameters(a),a}getUrlTemplate(e,t,r,i){if(!this.resourceInfo){const s=ke({dimensionMap:this.dimensionMap,layerMap:this.layerMap},e,t,i);if(s)return s}if(this.serviceMode==="KVP")return this.url+"?SERVICE=WMTS&VERSION="+this.version+"&REQUEST=GetTile&LAYER="+e+"&STYLE="+i+"&FORMAT="+r+"&TILEMATRIXSET="+t+"&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}";if(this.serviceMode==="RESTful"){let s="";return ce[r.toLowerCase()]&&(s=ce[r.toLowerCase()]),this.url+e+"/"+i+"/"+t+"/{level}/{row}/{col}"+s}return""}async _fetchService(e){let t;if(this.resourceInfo)this.resourceInfo.serviceMode==="KVP"&&(this.url+=this.url.includes("?")?"":"?"),t={ssl:!1,data:this.resourceInfo};else try{t=await this._getCapabilities(this.serviceMode,e),ue(t.data)}catch{const r=this.serviceMode==="KVP"?"RESTful":"KVP";try{t=await this._getCapabilities(r,e),ue(t.data),this.serviceMode=r}catch(i){throw new _("wmtslayer:unsupported-service-data","Services does not support RESTful or KVP service modes.",{error:i})}}this.resourceInfo?t.data=Ue(t.data):t.data=Ve(t.data,{serviceMode:this.serviceMode,url:this.url}),t.data&&this.read(t.data,{origin:"service"})}async _getCapabilities(e,t){const r=this._getCapabilitiesUrl(e);return await K(r,{...t,responseType:"text"})}_getTileMatrixSetById(e){var i;const t=this.findSublayerById(this.activeLayer.id);return(i=t==null?void 0:t.tileMatrixSets)==null?void 0:i.find(s=>s.id===e)}_appendCustomParameters(e){return this._appendParameters(e,this.customParameters)}_appendCustomLayerParameters(e){return this._appendParameters(e,{...le(this.customParameters),...this.customLayerParameters})}_appendParameters(e,t){const r=q(e),i={...r.query,...t},s=Pe(i);return s===""?r.path:`${r.path}?${s}`}_getCapabilitiesUrl(e){this.url=q(this.url).path;let t=this.url;switch(e){case"KVP":t+=`?request=GetCapabilities&service=WMTS&version=${this.version}`;break;case"RESTful":{const r=`/${this.version}/WMTSCapabilities.xml`,i=new RegExp(r,"i");t=t.replace(i,""),t+=r;break}}return this._appendCustomParameters(t)}_getLowerCasedUrlParams(e){if(!e)return null;const t=q(e).query;if(!t)return null;const r={};return Object.keys(t).forEach(i=>{r[i.toLowerCase()]=t[i]}),r}_mergeParams(e,t){const r=this._getLowerCasedUrlParams(t);if(r){const i=Object.keys(r);i.length&&(e=e?le(e):{},i.forEach(s=>{e.hasOwnProperty(s)||Ye.has(s)||(e[s]=r[s])}))}return e}};function Ze(e,t){return e.map(r=>{const i=new U;return i.read(r,t),i})}o([u()],m.prototype,"dimensionMap",void 0),o([u()],m.prototype,"layerMap",void 0),o([u({type:U,json:{origins:{"web-document":{write:{ignoreOrigin:!0}}}}})],m.prototype,"activeLayer",void 0),o([R("service","activeLayer",["layers"])],m.prototype,"readActiveLayerFromService",null),o([R(["web-document","portal-item"],"activeLayer",["wmtsInfo"])],m.prototype,"readActiveLayerFromItemOrWebDoc",null),o([be(["web-document","portal-item"],"activeLayer",{templateUrl:{type:String},tileInfo:{type:Z},"wmtsInfo.layerIdentifier":{type:String},"wmtsInfo.tileMatrixSet":{type:String}})],m.prototype,"writeActiveLayer",null),o([u({type:String,value:"",json:{write:!0}})],m.prototype,"copyright",void 0),o([u({type:["show","hide"]})],m.prototype,"listMode",void 0),o([u({json:{read:!0,write:!0}})],m.prototype,"blendMode",void 0),o([u({json:{origins:{"web-document":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}},"portal-item":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}}}}})],m.prototype,"customParameters",void 0),o([R(["portal-item","web-document"],"customParameters")],m.prototype,"readCustomParameters",null),o([u({json:{origins:{"web-document":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}},"portal-item":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}}}}})],m.prototype,"customLayerParameters",void 0),o([u({type:A,json:{write:{ignoreOrigin:!0},origins:{"web-document":{read:{source:"fullExtent"}},"portal-item":{read:{source:"fullExtent"}}}}})],m.prototype,"fullExtent",void 0),o([u({readOnly:!0})],m.prototype,"fullExtents",null),o([u({type:["WebTiledLayer"]})],m.prototype,"operationalLayerType",void 0),o([u()],m.prototype,"resourceInfo",void 0),o([u()],m.prototype,"serviceMode",void 0),o([R(["portal-item","web-document"],"serviceMode",["templateUrl"])],m.prototype,"readServiceMode",null),o([u({type:G.ofType(U)})],m.prototype,"sublayers",void 0),o([R("service","sublayers",["layers"])],m.prototype,"readSublayersFromService",null),o([u({readOnly:!0})],m.prototype,"supportedSpatialReferences",null),o([u({readOnly:!0})],m.prototype,"tilemapCache",null),o([u({json:{read:{source:"title"}}})],m.prototype,"title",null),o([u({json:{read:!1},readOnly:!0,value:"wmts"})],m.prototype,"type",void 0),o([u({json:{origins:{service:{read:{source:"tileUrl"}},"web-document":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}},"portal-item":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}}}}})],m.prototype,"url",null),o([u()],m.prototype,"version",void 0),m=Y=o([N("esri.layers.WMTSLayer")],m);const st=m;export{st as default}; diff --git a/assets/WMTSLayerView2D-CZBGPwsV.js b/assets/WMTSLayerView2D-D7P1L341.js similarity index 84% rename from assets/WMTSLayerView2D-CZBGPwsV.js rename to assets/WMTSLayerView2D-D7P1L341.js index f2f03a2..0e560a5 100644 --- a/assets/WMTSLayerView2D-CZBGPwsV.js +++ b/assets/WMTSLayerView2D-D7P1L341.js @@ -1 +1 @@ -import{h as _,m as w,r as g,G as u,a as p,b as f,s as I,d,y as S,f as T}from"./index-CEWggaxV.js";import{r as V,n as m}from"./imageUtils-D_EPf7De.js";import{m as v,u as x}from"./LayerView-BEFTHNYv.js";import{i as M}from"./RefreshableLayerView-C1-PEoNB.js";import"./Bitmap--gOrgR8J.js";import"./Container-CB7SlLB9.js";import"./highlightReasons-DbgbcWKM.js";import"./Texture-DJgkMrSB.js";import"./WGLContainer-B_Pv-8Yi.js";import"./LabelMetric-D2hbzzy_.js";import"./Program-DLRmaKpw.js";import"./ProgramTemplate-BICQrNzS.js";import"./config-MDUrh2eL.js";import"./earcut-hRlx3adE.js";import"./featureConversionUtils-CmP9mw0r.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./TileContainer-Ci6dOowA.js";import"./scaleUtils-Bqauo1zZ.js";const q=new Set([102113,102100,3857,3785,900913]),b=[0,0];let r=class extends M(V(v(x))){constructor(){super(...arguments),this._tileStrategy=null,this._fetchQueue=null,this.layer=null}get tileMatrixSet(){const e=this._getTileMatrixSetBySpatialReference(this.layer.activeLayer);return e?(e.id!==this.layer.activeLayer.tileMatrixSetId&&(this.layer.activeLayer.tileMatrixSetId=e.id),e):null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume()}attach(){var t;const e=(t=this.tileMatrixSet)==null?void 0:t.tileInfo;e&&(this._tileInfoView=new _(e),this._fetchQueue=new w({tileInfoView:this._tileInfoView,concurrency:16,process:(i,s)=>this.fetchTile(i,s)}),this._tileStrategy=new g({cachePolicy:"keep",resampling:!0,acquireTile:i=>this.acquireTile(i),releaseTile:i=>this.releaseTile(i),tileInfoView:this._tileInfoView}),this.addAttachHandles(this._updatingHandles.add(()=>{var i,s;return[(s=(i=this.layer)==null?void 0:i.activeLayer)==null?void 0:s.styleId,this.tileMatrixSet]},()=>this.doRefresh())),super.attach())}detach(){var e,t;super.detach(),(e=this._tileStrategy)==null||e.destroy(),(t=this._fetchQueue)==null||t.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){var t;return((t=this.layer.activeLayer.tileMatrixSets)==null?void 0:t.some(i=>{var s;return u((s=i.tileInfo)==null?void 0:s.spatialReference,e)}))??!1}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e)))}}acquireTile(e){const t=this._bitmapView.createTile(e),i=t.bitmap;return[i.x,i.y]=this._tileInfoView.getTileCoords(b,t.key),i.resolution=this._tileInfoView.getTileResolution(t.key),[i.width,i.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(t)),this._bitmapView.addChild(t),this.requestUpdate(),t}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,t={}){const i="tilemapCache"in this.layer?this.layer.tilemapCache:null,{signal:s,resamplingLevel:a=0}=t;if(!i)return this._fetchImage(e,s);const l=new p(0,0,0,0);let n;try{await i.fetchAvailabilityUpsample(e.level,e.row,e.col,l,{signal:s}),n=await this._fetchImage(l,s)}catch(h){if(f(h))throw h;if(a<3){const o=this._tileInfoView.getTileParentId(e.id);if(o){const c=new p(o),y=await this.fetchTile(c,{...t,resamplingLevel:a+1});return m(this._tileInfoView,y,c,e)}}throw h}return m(this._tileInfoView,n,l,e)}canResume(){const e=super.canResume();return e&&this.tileMatrixSet!==null}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key);e.bitmap.source=t,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",()=>this.requestUpdate())}catch(t){f(t)||I.getLogger(this).error(t)}this.requestUpdate()}}async _fetchImage(e,t){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:t})}_getTileMatrixSetBySpatialReference(e){const t=this.view.spatialReference;if(!e.tileMatrixSets)return null;let i=e.tileMatrixSets.find(s=>{var a;return u((a=s.tileInfo)==null?void 0:a.spatialReference,t)});return!i&&t.isWebMercator&&(i=e.tileMatrixSets.find(s=>{var a;return q.has(((a=s.tileInfo)==null?void 0:a.spatialReference.wkid)??-1)})),i}};d([S({readOnly:!0})],r.prototype,"tileMatrixSet",null),r=d([T("esri.views.2d.layers.WMTSLayerView2D")],r);const J=r;export{J as default}; +import{h as _,m as w,r as g,G as u,a as p,b as f,s as I,d,y as S,f as T}from"./index-BjUNJPVf.js";import{r as V,n as m}from"./imageUtils-BNh57Y88.js";import{m as v,u as x}from"./LayerView-Bux7vAEn.js";import{i as M}from"./RefreshableLayerView-L9NGpXXI.js";import"./Bitmap-DpyomsG7.js";import"./Container-_n5wCgez.js";import"./highlightReasons-BOU4mnPE.js";import"./Texture-S4dD-WHn.js";import"./WGLContainer-DgZNq7b0.js";import"./LabelMetric-BcUxDImF.js";import"./Program-DBsYtQ00.js";import"./ProgramTemplate-Ck2I0bIi.js";import"./config-MDUrh2eL.js";import"./earcut-CWKXDqDj.js";import"./featureConversionUtils-BHhm7bvm.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./TileContainer-Bs-vXdD_.js";import"./scaleUtils-DWXMiS7R.js";const q=new Set([102113,102100,3857,3785,900913]),b=[0,0];let r=class extends M(V(v(x))){constructor(){super(...arguments),this._tileStrategy=null,this._fetchQueue=null,this.layer=null}get tileMatrixSet(){const e=this._getTileMatrixSetBySpatialReference(this.layer.activeLayer);return e?(e.id!==this.layer.activeLayer.tileMatrixSetId&&(this.layer.activeLayer.tileMatrixSetId=e.id),e):null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume()}attach(){var t;const e=(t=this.tileMatrixSet)==null?void 0:t.tileInfo;e&&(this._tileInfoView=new _(e),this._fetchQueue=new w({tileInfoView:this._tileInfoView,concurrency:16,process:(i,s)=>this.fetchTile(i,s)}),this._tileStrategy=new g({cachePolicy:"keep",resampling:!0,acquireTile:i=>this.acquireTile(i),releaseTile:i=>this.releaseTile(i),tileInfoView:this._tileInfoView}),this.addAttachHandles(this._updatingHandles.add(()=>{var i,s;return[(s=(i=this.layer)==null?void 0:i.activeLayer)==null?void 0:s.styleId,this.tileMatrixSet]},()=>this.doRefresh())),super.attach())}detach(){var e,t;super.detach(),(e=this._tileStrategy)==null||e.destroy(),(t=this._fetchQueue)==null||t.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){var t;return((t=this.layer.activeLayer.tileMatrixSets)==null?void 0:t.some(i=>{var s;return u((s=i.tileInfo)==null?void 0:s.spatialReference,e)}))??!1}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e)))}}acquireTile(e){const t=this._bitmapView.createTile(e),i=t.bitmap;return[i.x,i.y]=this._tileInfoView.getTileCoords(b,t.key),i.resolution=this._tileInfoView.getTileResolution(t.key),[i.width,i.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(t)),this._bitmapView.addChild(t),this.requestUpdate(),t}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,t={}){const i="tilemapCache"in this.layer?this.layer.tilemapCache:null,{signal:s,resamplingLevel:a=0}=t;if(!i)return this._fetchImage(e,s);const l=new p(0,0,0,0);let n;try{await i.fetchAvailabilityUpsample(e.level,e.row,e.col,l,{signal:s}),n=await this._fetchImage(l,s)}catch(h){if(f(h))throw h;if(a<3){const o=this._tileInfoView.getTileParentId(e.id);if(o){const c=new p(o),y=await this.fetchTile(c,{...t,resamplingLevel:a+1});return m(this._tileInfoView,y,c,e)}}throw h}return m(this._tileInfoView,n,l,e)}canResume(){const e=super.canResume();return e&&this.tileMatrixSet!==null}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key);e.bitmap.source=t,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",()=>this.requestUpdate())}catch(t){f(t)||I.getLogger(this).error(t)}this.requestUpdate()}}async _fetchImage(e,t){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:t})}_getTileMatrixSetBySpatialReference(e){const t=this.view.spatialReference;if(!e.tileMatrixSets)return null;let i=e.tileMatrixSets.find(s=>{var a;return u((a=s.tileInfo)==null?void 0:a.spatialReference,t)});return!i&&t.isWebMercator&&(i=e.tileMatrixSets.find(s=>{var a;return q.has(((a=s.tileInfo)==null?void 0:a.spatialReference.wkid)??-1)})),i}};d([S({readOnly:!0})],r.prototype,"tileMatrixSet",null),r=d([T("esri.views.2d.layers.WMTSLayerView2D")],r);const J=r;export{J as default}; diff --git a/assets/WebTileLayer-D3HPOkPd.js b/assets/WebTileLayer-IRzcPxtS.js similarity index 97% rename from assets/WebTileLayer-D3HPOkPd.js rename to assets/WebTileLayer-IRzcPxtS.js index 868e8d2..458097b 100644 --- a/assets/WebTileLayer-D3HPOkPd.js +++ b/assets/WebTileLayer-IRzcPxtS.js @@ -1 +1 @@ -import{d as l,y as i,f as T,aU as P,aV as v,bP as x,bQ as I,dp as M,dq as U,dr as W,aE as j,aS as y,dZ as S,aA as L,d_ as s,fN as h,N as $,fO as D,fP as E,eR as O,M as w,aF as A,aZ as g,aR as q,bT as z}from"./index-CEWggaxV.js";import{f as V}from"./RefreshableLayer-1EkEhJeI.js";import{o as b}from"./imageBitmapUtils-C0nKXf5P.js";var m;let c=m=class extends P{constructor(e){super(e)}clone(){return new m({customLayerParameters:v(this.customLayerParameters),customParameters:v(this.customParameters),layerIdentifier:this.layerIdentifier,tileMatrixSet:this.tileMatrixSet,url:this.url})}};l([i({json:{type:Object,write:!0}})],c.prototype,"customLayerParameters",void 0),l([i({json:{type:Object,write:!0}})],c.prototype,"customParameters",void 0),l([i({type:String,json:{write:!0}})],c.prototype,"layerIdentifier",void 0),l([i({type:String,json:{write:!0}})],c.prototype,"tileMatrixSet",void 0),l([i({type:String,json:{write:!0}})],c.prototype,"url",void 0),c=m=l([T("esri.layer.support.WMTSLayerInfo")],c);var f;let o=f=class extends x(V(I(M(U(W(z)))))){constructor(...e){super(...e),this.copyright="",this.fullExtent=new j(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,y.WebMercator),this.legendEnabled=!1,this.isReference=null,this.popupEnabled=!1,this.spatialReference=y.WebMercator,this.subDomains=null,this.tileInfo=new S({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new L({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:y.WebMercator}),spatialReference:y.WebMercator,lods:[new s({level:0,scale:591657527591555e-6,resolution:156543.033928}),new s({level:1,scale:295828763795777e-6,resolution:78271.5169639999}),new s({level:2,scale:147914381897889e-6,resolution:39135.7584820001}),new s({level:3,scale:73957190948944e-6,resolution:19567.8792409999}),new s({level:4,scale:36978595474472e-6,resolution:9783.93962049996}),new s({level:5,scale:18489297737236e-6,resolution:4891.96981024998}),new s({level:6,scale:9244648868618e-6,resolution:2445.98490512499}),new s({level:7,scale:4622324434309e-6,resolution:1222.99245256249}),new s({level:8,scale:2311162217155e-6,resolution:611.49622628138}),new s({level:9,scale:1155581108577e-6,resolution:305.748113140558}),new s({level:10,scale:577790.554289,resolution:152.874056570411}),new s({level:11,scale:288895.277144,resolution:76.4370282850732}),new s({level:12,scale:144447.638572,resolution:38.2185141425366}),new s({level:13,scale:72223.819286,resolution:19.1092570712683}),new s({level:14,scale:36111.909643,resolution:9.55462853563415}),new s({level:15,scale:18055.954822,resolution:4.77731426794937}),new s({level:16,scale:9027.977411,resolution:2.38865713397468}),new s({level:17,scale:4513.988705,resolution:1.19432856685505}),new s({level:18,scale:2256.994353,resolution:.597164283559817}),new s({level:19,scale:1128.497176,resolution:.298582141647617}),new s({level:20,scale:564.248588,resolution:.14929107082380833}),new s({level:21,scale:282.124294,resolution:.07464553541190416}),new s({level:22,scale:141.062147,resolution:.03732276770595208}),new s({level:23,scale:70.5310735,resolution:.01866138385297604})]}),this.type="web-tile",this.urlTemplate=null,this.wmtsInfo=null}normalizeCtorArgs(e,t){return typeof e=="string"?{urlTemplate:e,...t}:e}load(e){const t=this.loadFromPortal({supportedTypes:["WMTS"]},e).then(()=>{var a;let r="";if(this.urlTemplate)if(this.spatialReference.equals(this.tileInfo.spatialReference)){const n=new h(this.urlTemplate);!(this.subDomains&&this.subDomains.length>0)&&((a=n.authority)!=null&&a.includes("{subDomain}"))&&(r="is missing 'subDomains' property")}else r="spatialReference must match tileInfo.spatialReference";else r="is missing the required 'urlTemplate' property value";if(r)throw new $("web-tile-layer:load",`WebTileLayer (title: '${this.title}', id: '${this.id}') ${r}`)});return this.addResolvingPromise(t),Promise.resolve(this)}get levelValues(){const e=[];if(!this.tileInfo)return null;for(const t of this.tileInfo.lods)e[t.level]=t.levelValue||t.level;return e}readSpatialReference(e,t){var r;return e||y.fromJSON((r=t.fullExtent)==null?void 0:r.spatialReference)}get tileServers(){if(!this.urlTemplate)return null;const e=[],{urlTemplate:t,subDomains:r}=this,a=new h(t),n=a.scheme?a.scheme+"://":"//",u=n+a.authority+"/",p=a.authority;if(p!=null&&p.includes("{subDomain}")){if(r&&r.length>0&&p.split(".").length>1)for(const d of r)e.push(n+p.replaceAll(/\{subDomain\}/gi,d)+"/")}else e.push(u);return e.map(D)}get urlPath(){if(!this.urlTemplate)return null;const e=this.urlTemplate,t=new h(e),r=(t.scheme?t.scheme+"://":"//")+t.authority+"/";return e.substring(r.length)}readUrlTemplate(e,t){return e||t.templateUrl}writeUrlTemplate(e,t){E(e)&&(e="https:"+e),e&&(e=e.replaceAll(/\{z\}/gi,"{level}").replaceAll(/\{x\}/gi,"{col}").replaceAll(/\{y\}/gi,"{row}"),e=O(e)),t.templateUrl=e}fetchTile(e,t,r,a={}){const{signal:n}=a,u=this.getTileUrl(e,t,r),p={responseType:"image",signal:n,query:{...this.refreshParameters}};return w(u,p).then(d=>d.data)}async fetchImageBitmapTile(e,t,r,a={}){const{signal:n}=a;if(this.fetchTile!==f.prototype.fetchTile){const R=await this.fetchTile(e,t,r,a);return b(R,e,t,r,n)}const u=this.getTileUrl(e,t,r),p={responseType:"blob",signal:n,query:{...this.refreshParameters}},{data:d}=await w(u,p);return b(d,e,t,r,n)}getTileUrl(e,t,r){const{levelValues:a,tileServers:n,urlPath:u}=this;if(!a||!n||!u)return"";const p=a[e];return n[t%n.length]+A(u,{level:p,z:p,col:r,x:r,row:t,y:t})}};l([i({type:String,value:"",json:{write:!0}})],o.prototype,"copyright",void 0),l([i({type:j,json:{write:!0},nonNullable:!0})],o.prototype,"fullExtent",void 0),l([i({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"legendEnabled",void 0),l([i({type:["show","hide"]})],o.prototype,"listMode",void 0),l([i({json:{read:!0,write:!0}})],o.prototype,"blendMode",void 0),l([i()],o.prototype,"levelValues",null),l([i({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],o.prototype,"isReference",void 0),l([i({type:["WebTiledLayer"],value:"WebTiledLayer"})],o.prototype,"operationalLayerType",void 0),l([i({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"popupEnabled",void 0),l([i({type:y})],o.prototype,"spatialReference",void 0),l([g("spatialReference",["spatialReference","fullExtent.spatialReference"])],o.prototype,"readSpatialReference",null),l([i({type:[String],json:{write:!0}})],o.prototype,"subDomains",void 0),l([i({type:S,json:{write:!0}})],o.prototype,"tileInfo",void 0),l([i({readOnly:!0})],o.prototype,"tileServers",null),l([i({json:{read:!1}})],o.prototype,"type",void 0),l([i()],o.prototype,"urlPath",null),l([i({type:String,json:{origins:{"portal-item":{read:{source:"url"}}}}})],o.prototype,"urlTemplate",void 0),l([g("urlTemplate",["urlTemplate","templateUrl"])],o.prototype,"readUrlTemplate",null),l([q("urlTemplate",{templateUrl:{type:String}})],o.prototype,"writeUrlTemplate",null),l([i({type:c,json:{write:!0}})],o.prototype,"wmtsInfo",void 0),o=f=l([T("esri.layers.WebTileLayer")],o);const _=o,F=Object.freeze(Object.defineProperty({__proto__:null,default:_},Symbol.toStringTag,{value:"Module"}));export{_ as I,F as W,c as p}; +import{d as l,y as i,f as T,aU as P,aV as v,bP as x,bQ as I,dp as M,dq as U,dr as W,aE as j,aS as y,dZ as S,aA as L,d_ as s,fN as h,N as $,fO as D,fP as E,eR as O,M as w,aF as A,aZ as g,aR as q,bT as z}from"./index-BjUNJPVf.js";import{f as V}from"./RefreshableLayer-_r2TPtol.js";import{o as b}from"./imageBitmapUtils-BVxrhFkK.js";var m;let c=m=class extends P{constructor(e){super(e)}clone(){return new m({customLayerParameters:v(this.customLayerParameters),customParameters:v(this.customParameters),layerIdentifier:this.layerIdentifier,tileMatrixSet:this.tileMatrixSet,url:this.url})}};l([i({json:{type:Object,write:!0}})],c.prototype,"customLayerParameters",void 0),l([i({json:{type:Object,write:!0}})],c.prototype,"customParameters",void 0),l([i({type:String,json:{write:!0}})],c.prototype,"layerIdentifier",void 0),l([i({type:String,json:{write:!0}})],c.prototype,"tileMatrixSet",void 0),l([i({type:String,json:{write:!0}})],c.prototype,"url",void 0),c=m=l([T("esri.layer.support.WMTSLayerInfo")],c);var f;let o=f=class extends x(V(I(M(U(W(z)))))){constructor(...e){super(...e),this.copyright="",this.fullExtent=new j(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,y.WebMercator),this.legendEnabled=!1,this.isReference=null,this.popupEnabled=!1,this.spatialReference=y.WebMercator,this.subDomains=null,this.tileInfo=new S({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new L({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:y.WebMercator}),spatialReference:y.WebMercator,lods:[new s({level:0,scale:591657527591555e-6,resolution:156543.033928}),new s({level:1,scale:295828763795777e-6,resolution:78271.5169639999}),new s({level:2,scale:147914381897889e-6,resolution:39135.7584820001}),new s({level:3,scale:73957190948944e-6,resolution:19567.8792409999}),new s({level:4,scale:36978595474472e-6,resolution:9783.93962049996}),new s({level:5,scale:18489297737236e-6,resolution:4891.96981024998}),new s({level:6,scale:9244648868618e-6,resolution:2445.98490512499}),new s({level:7,scale:4622324434309e-6,resolution:1222.99245256249}),new s({level:8,scale:2311162217155e-6,resolution:611.49622628138}),new s({level:9,scale:1155581108577e-6,resolution:305.748113140558}),new s({level:10,scale:577790.554289,resolution:152.874056570411}),new s({level:11,scale:288895.277144,resolution:76.4370282850732}),new s({level:12,scale:144447.638572,resolution:38.2185141425366}),new s({level:13,scale:72223.819286,resolution:19.1092570712683}),new s({level:14,scale:36111.909643,resolution:9.55462853563415}),new s({level:15,scale:18055.954822,resolution:4.77731426794937}),new s({level:16,scale:9027.977411,resolution:2.38865713397468}),new s({level:17,scale:4513.988705,resolution:1.19432856685505}),new s({level:18,scale:2256.994353,resolution:.597164283559817}),new s({level:19,scale:1128.497176,resolution:.298582141647617}),new s({level:20,scale:564.248588,resolution:.14929107082380833}),new s({level:21,scale:282.124294,resolution:.07464553541190416}),new s({level:22,scale:141.062147,resolution:.03732276770595208}),new s({level:23,scale:70.5310735,resolution:.01866138385297604})]}),this.type="web-tile",this.urlTemplate=null,this.wmtsInfo=null}normalizeCtorArgs(e,t){return typeof e=="string"?{urlTemplate:e,...t}:e}load(e){const t=this.loadFromPortal({supportedTypes:["WMTS"]},e).then(()=>{var a;let r="";if(this.urlTemplate)if(this.spatialReference.equals(this.tileInfo.spatialReference)){const n=new h(this.urlTemplate);!(this.subDomains&&this.subDomains.length>0)&&((a=n.authority)!=null&&a.includes("{subDomain}"))&&(r="is missing 'subDomains' property")}else r="spatialReference must match tileInfo.spatialReference";else r="is missing the required 'urlTemplate' property value";if(r)throw new $("web-tile-layer:load",`WebTileLayer (title: '${this.title}', id: '${this.id}') ${r}`)});return this.addResolvingPromise(t),Promise.resolve(this)}get levelValues(){const e=[];if(!this.tileInfo)return null;for(const t of this.tileInfo.lods)e[t.level]=t.levelValue||t.level;return e}readSpatialReference(e,t){var r;return e||y.fromJSON((r=t.fullExtent)==null?void 0:r.spatialReference)}get tileServers(){if(!this.urlTemplate)return null;const e=[],{urlTemplate:t,subDomains:r}=this,a=new h(t),n=a.scheme?a.scheme+"://":"//",u=n+a.authority+"/",p=a.authority;if(p!=null&&p.includes("{subDomain}")){if(r&&r.length>0&&p.split(".").length>1)for(const d of r)e.push(n+p.replaceAll(/\{subDomain\}/gi,d)+"/")}else e.push(u);return e.map(D)}get urlPath(){if(!this.urlTemplate)return null;const e=this.urlTemplate,t=new h(e),r=(t.scheme?t.scheme+"://":"//")+t.authority+"/";return e.substring(r.length)}readUrlTemplate(e,t){return e||t.templateUrl}writeUrlTemplate(e,t){E(e)&&(e="https:"+e),e&&(e=e.replaceAll(/\{z\}/gi,"{level}").replaceAll(/\{x\}/gi,"{col}").replaceAll(/\{y\}/gi,"{row}"),e=O(e)),t.templateUrl=e}fetchTile(e,t,r,a={}){const{signal:n}=a,u=this.getTileUrl(e,t,r),p={responseType:"image",signal:n,query:{...this.refreshParameters}};return w(u,p).then(d=>d.data)}async fetchImageBitmapTile(e,t,r,a={}){const{signal:n}=a;if(this.fetchTile!==f.prototype.fetchTile){const R=await this.fetchTile(e,t,r,a);return b(R,e,t,r,n)}const u=this.getTileUrl(e,t,r),p={responseType:"blob",signal:n,query:{...this.refreshParameters}},{data:d}=await w(u,p);return b(d,e,t,r,n)}getTileUrl(e,t,r){const{levelValues:a,tileServers:n,urlPath:u}=this;if(!a||!n||!u)return"";const p=a[e];return n[t%n.length]+A(u,{level:p,z:p,col:r,x:r,row:t,y:t})}};l([i({type:String,value:"",json:{write:!0}})],o.prototype,"copyright",void 0),l([i({type:j,json:{write:!0},nonNullable:!0})],o.prototype,"fullExtent",void 0),l([i({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"legendEnabled",void 0),l([i({type:["show","hide"]})],o.prototype,"listMode",void 0),l([i({json:{read:!0,write:!0}})],o.prototype,"blendMode",void 0),l([i()],o.prototype,"levelValues",null),l([i({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],o.prototype,"isReference",void 0),l([i({type:["WebTiledLayer"],value:"WebTiledLayer"})],o.prototype,"operationalLayerType",void 0),l([i({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"popupEnabled",void 0),l([i({type:y})],o.prototype,"spatialReference",void 0),l([g("spatialReference",["spatialReference","fullExtent.spatialReference"])],o.prototype,"readSpatialReference",null),l([i({type:[String],json:{write:!0}})],o.prototype,"subDomains",void 0),l([i({type:S,json:{write:!0}})],o.prototype,"tileInfo",void 0),l([i({readOnly:!0})],o.prototype,"tileServers",null),l([i({json:{read:!1}})],o.prototype,"type",void 0),l([i()],o.prototype,"urlPath",null),l([i({type:String,json:{origins:{"portal-item":{read:{source:"url"}}}}})],o.prototype,"urlTemplate",void 0),l([g("urlTemplate",["urlTemplate","templateUrl"])],o.prototype,"readUrlTemplate",null),l([q("urlTemplate",{templateUrl:{type:String}})],o.prototype,"writeUrlTemplate",null),l([i({type:c,json:{write:!0}})],o.prototype,"wmtsInfo",void 0),o=f=l([T("esri.layers.WebTileLayer")],o);const _=o,F=Object.freeze(Object.defineProperty({__proto__:null,default:_},Symbol.toStringTag,{value:"Module"}));export{_ as I,F as W,c as p}; diff --git a/assets/WhereClause-Dzgyc0wk.js b/assets/WhereClause-Ctld7DSu.js similarity index 99% rename from assets/WhereClause-Dzgyc0wk.js rename to assets/WhereClause-Ctld7DSu.js index 1da0a6d..854f773 100644 --- a/assets/WhereClause-Dzgyc0wk.js +++ b/assets/WhereClause-Ctld7DSu.js @@ -1,4 +1,4 @@ -import{a as q,n as Q,m as Ps}from"./TimeOnly-Cm47ew5I.js";import{aF as sn,hj as _,a5 as Ls,ce as _s,E as Xe,Y as Rs}from"./index-CEWggaxV.js";import{t as jt,i as Yt,r as ct}from"./UnknownTimeZone-DF0BqWCR.js";var d;(function(i){i.InvalidFunctionParameters="InvalidFunctionParameters",i.InvalidValueForAggregateFunction="InvalidValueForAggregateFunction",i.UnsupportedSqlFunction="UnsupportedSqlFunction",i.UnsupportedOperator="UnsupportedOperator",i.UnsupportedSyntax="UnsupportedSyntax",i.UnsupportedIsRhs="UnsupportedIsRhs",i.UnsupportedIsLhs="UnsupportedIsLhs",i.InvalidDataType="InvalidDataType",i.CannotCastValue="CannotCastValue",i.FunctionNotRecognized="FunctionNotRecognized",i.InvalidTime="InvalidTime",i.InvalidParameterCount="InvalidParameterCount",i.InvalidTimeStamp="InvalidTimeStamp",i.InvalidDate="InvalidDate",i.InvalidOperator="InvalidOperator",i.IllegalInterval="IllegalInterval",i.YearMonthIntervals="YearMonthIntervals",i.PrimarySecondaryQualifiers="PrimarySecondaryQualifiers",i.MissingStatisticParameters="MissingStatisticParameters"})(d||(d={}));const Us={[d.InvalidValueForAggregateFunction]:"Invalid value used in aggregate function",[d.MissingStatisticParameters]:"Statistic does not have 1 or 0 Parameters",[d.InvalidFunctionParameters]:"Invalid parameters for call to {function}",[d.UnsupportedIsLhs]:"Unsupported left hand expression in is statement",[d.UnsupportedIsRhs]:"Unsupported right hand expression in is statement",[d.UnsupportedOperator]:"Unsupported operator - {operator}",[d.UnsupportedSyntax]:"Unsupported syntax - {node}",[d.UnsupportedSqlFunction]:"Sql function not found = {function}",[d.InvalidDataType]:"Invalid sql data type",[d.InvalidDate]:"Invalid date encountered",[d.InvalidOperator]:"Invalid operator encountered",[d.InvalidTime]:"Invalid time encountered",[d.IllegalInterval]:"Illegal interval",[d.FunctionNotRecognized]:"Function not recognized",[d.InvalidTimeStamp]:"Invalid timestamp encountered",[d.InvalidParameterCount]:"Invalid parameter count for call to {name}",[d.PrimarySecondaryQualifiers]:"Primary and Secondary SqlInterval qualifiers not supported",[d.YearMonthIntervals]:"Year-Month Intervals not supported",[d.CannotCastValue]:"Cannot cast value to the required data type"};let v=class ln extends Error{constructor(r,u){super(sn(Us[r],u)),this.declaredRootClass="esri.arcade.featureset.support.sqlerror",Error.captureStackTrace&&Error.captureStackTrace(this,ln)}};var W;(function(i){i.NeverReach="NeverReach",i.NotImplemented="NotImplemented",i.Cancelled="Cancelled",i.InvalidStatResponse="InvalidStatResponse",i.InvalidRequest="InvalidRequest",i.RequestFailed="RequestFailed",i.MissingFeatures="MissingFeatures",i.AggregationFieldNotFound="AggregationFieldNotFound",i.DataElementsNotFound="DataElementsNotFound"})(W||(W={}));const Vs={[W.Cancelled]:"Cancelled",[W.InvalidStatResponse]:"Invalid statistics response from service",[W.InvalidRequest]:"Invalid request",[W.RequestFailed]:"Request failed - {reason}",[W.MissingFeatures]:"Missing features",[W.AggregationFieldNotFound]:"Aggregation field not found",[W.DataElementsNotFound]:"Data elements not found on service",[W.NeverReach]:"Encountered unreachable logic",[W.NotImplemented]:"Not implemented"};let wc=class cn extends Error{constructor(r,u){super(sn(Vs[r],u)),this.declaredRootClass="esri.arcade.featureset.support.featureseterror",Error.captureStackTrace&&Error.captureStackTrace(this,cn)}};function tn(i){return Number.isNaN(i)||i===0?i:Math.trunc(i)}class z{constructor(r){this._timeStampOffset=r,this._date=null}toDateTime(){return this._date??(this._date=_.fromISO(this._timeStampOffset,{setZone:!0})),this._date}get isValid(){return this.toDateTime().isValid}get timezoneOffsetHour(){return tn(this.toDateTime().offset/60)}get timezoneOffsetMinutes(){return tn(this.toDateTime().offset%60)}toMilliseconds(){return this.toDateTime().toMillis()}get hour(){return this.toDateTime().hour}get minute(){return this.toDateTime().minute}get second(){return this.toDateTime().second}get day(){return this.toDateTime().day}get month(){return this.toDateTime().month}get year(){return this.toDateTime().year}startOfDay(){return z.fromDateTime(this.toDateTime().startOf("day"))}static fromJSDate(r){return new z(_.fromJSDate(r).toISO({includeOffset:!0}))}static fromDateTime(r){return new z(r.toISO({includeOffset:!0}))}static fromParts(r,u,c=0,l=0,h=0,I=0,e=0,T=!1,O=0,L=0){const U=`${r.toString().padStart(4,"0")}-${u.toString().padStart(2,"0")}-${c.toString().padStart(2,"0")}`;let Z="";I<10&&(Z="0");let C=`${l.toString().padStart(2,"0")}:${h.toString().padStart(2,"0")}:${Z+I.toString()}`;e!==0&&(C+="."+e.toString().padStart(3,"0"));const A=`${T?"-":"+"}${O.toString().padStart(2,"0")}:${L.toString().padStart(2,"0")}`;return new z(U+"T"+C+A)}toStorageFormat(){return this._timeStampOffset}toString(){return this._timeStampOffset}toSQLValue(){let r=this.toDateTime().toSQL({includeOffset:!0,includeOffsetSpace:!0});return r&&(r=r.replace(".000","")),r}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}addMilliseconds(r){const u=this.toDateTime().plus(r);return z.fromDateTime(u)}}function Js(i,r){const u=fn[i.toLowerCase()];if(u==null)throw new v(d.FunctionNotRecognized);if(r.lengthu.maxParams)throw new v(d.InvalidParameterCount,{name:i.toUpperCase()});return u.evaluate(r)}function en(i,r){const u=fn[i.toLowerCase()];return u!=null&&r>=u.minParams&&r<=u.maxParams}const fn={min:{minParams:1,maxParams:1,evaluate:i=>nn(i[0],"min")},max:{minParams:1,maxParams:1,evaluate:i=>nn(i[0],"max")},avg:{minParams:1,maxParams:1,evaluate:i=>dn(i[0])},sum:{minParams:1,maxParams:1,evaluate:i=>zs(i[0])},stddev:{minParams:1,maxParams:1,evaluate:i=>Zs(i[0])},count:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:i[0].length},var:{minParams:1,maxParams:1,evaluate:i=>pn(i[0])}};function dn(i){if(i===null)return null;let r=0,u=0;for(let c=0;c=h)&&(u=l,c=h)}return u}function zs(i){if(i===null)return null;let r=0;for(let u=0;uc!==null)).length===0)return null;const r=dn(i);if(r===null)return null;let u=0;for(const c of i){if(!Xt(c))throw new v(d.InvalidValueForAggregateFunction);u+=(r-c)**2}return u/(i.length-1)}class b{constructor(){this.op="+",this.day=0,this.second=0,this.hour=0,this.month=0,this.year=0,this.minute=0,this.millis=0}static _fixDefaults(r){if(r.precision!==null||r.secondary!==null)throw new v(d.PrimarySecondaryQualifiers)}static _parseSecondsComponent(r,u){if(u.includes(".")){const c=u.split(".");r.second=parseFloat(c[0]),r.millis=parseInt(c[1],10)}else r.second=parseFloat(u)}static createFromMilliseconds(r){const u=new b;return u.second=r/1e3,u}static createFromValueAndQualifier(r,u,c){let l=null;const h=new b;if(h.op=c==="-"?"-":"+",u.type==="interval-period"){b._fixDefaults(u);const I=new RegExp("^[0-9]{1,}$");if(u.period==="year"||u.period==="month")throw new v(d.YearMonthIntervals);if(u.period==="second"){if(!/^[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$/.test(r))throw new v(d.IllegalInterval);b._parseSecondsComponent(h,r)}else{if(!I.test(r))throw new v(d.IllegalInterval);h[u.period]=parseFloat(r)}}else{if(b._fixDefaults(u.start),b._fixDefaults(u.end),u.start.period==="year"||u.start.period==="month"||u.end.period==="year"||u.end.period==="month")throw new v(d.YearMonthIntervals);switch(u.start.period){case"day":switch(u.end.period){case"hour":if(l=new RegExp("^[0-9]{1,} [0-9]{1,}$"),!l.test(r))throw new v(d.IllegalInterval);h[u.start.period]=parseFloat(r.split(" ")[0]),h[u.end.period]=parseFloat(r.split(" ")[1]);break;case"minute":if(l=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,}$"),!l.test(r))throw new v(d.IllegalInterval);{h[u.start.period]=parseFloat(r.split(" ")[0]);const I=r.split(" ")[1].split(":");h.hour=parseFloat(I[0]),h.minute=parseFloat(I[1])}break;case"second":if(l=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!l.test(r))throw new v(d.IllegalInterval);{h[u.start.period]=parseFloat(r.split(" ")[0]);const I=r.split(" ")[1].split(":");h.hour=parseFloat(I[0]),h.minute=parseFloat(I[1]),b._parseSecondsComponent(h,I[2])}break;default:throw new v(d.IllegalInterval)}break;case"hour":switch(u.end.period){case"minute":if(l=new RegExp("^[0-9]{1,}:[0-9]{1,}$"),!l.test(r))throw new v(d.IllegalInterval);h.hour=parseFloat(r.split(":")[0]),h.minute=parseFloat(r.split(":")[1]);break;case"second":if(l=new RegExp("^[0-9]{1,}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!l.test(r))throw new v(d.IllegalInterval);{const I=r.split(":");h.hour=parseFloat(I[0]),h.minute=parseFloat(I[1]),b._parseSecondsComponent(h,I[2])}break;default:throw new v(d.IllegalInterval)}break;case"minute":if(u.end.period!=="second")throw new v(d.IllegalInterval);if(l=new RegExp("^[0-9]{1,}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!l.test(r))throw new v(d.IllegalInterval);{const I=r.split(":");h.minute=parseFloat(I[0]),b._parseSecondsComponent(h,I[1])}break;default:throw new v(d.IllegalInterval)}}return h}valueInMilliseconds(){return(this.op==="-"?-1:1)*(this.millis+1e3*this.second+60*this.minute*1e3+60*this.hour*60*1e3+24*this.day*60*60*1e3+this.month*(365/12)*24*60*60*1e3+365*this.year*24*60*60*1e3)}}const ks=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/,Hs=/^(\d{1,2}):(\d{1,2})$/,qs=/^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/,vn=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,js=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$/,Ys=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$/,Bs=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$/,Qs=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;function bt(i,r){if(r instanceof Ls)return r===jt.instance?_.fromMillis(i.getTime(),{zone:jt.instance}):_.fromJSDate(i,{zone:r});switch(r){case"system":case"local":case null:return _.fromJSDate(i);default:return(r==null?void 0:r.toLowerCase())==="unknown"?_.fromMillis(i.getTime(),{zone:jt.instance}):_.fromJSDate(i,{zone:r})}}function k(i){return typeof i=="number"}function H(i){return typeof i=="string"||i instanceof String}function et(i){return i instanceof b}function Y(i){return i instanceof Date}function M(i){return i instanceof _}function E(i){return i instanceof q}function D(i){return i instanceof Q}function F(i){return i instanceof z}function te(i){let r=ks.exec(i);if(r!==null){const[,u,c,l]=r,h=Q.fromParts(parseInt(u,10),parseInt(c,10),parseInt(l,10),0);if(h!==null)return h;throw new v(d.InvalidTime)}if(r=Hs.exec(i),r!==null){const[,u,c]=r,l=Q.fromParts(parseInt(u,10),parseInt(c,10),0,0);if(l!==null)return l;throw new v(d.InvalidTime)}if(r=qs.exec(i),r!==null){const[,u,c,l,h]=r,I=Q.fromParts(parseInt(u,10),parseInt(c,10),parseInt(l,10),parseInt(h,10));if(I!==null)return I;throw new v(d.InvalidTime)}throw new v(d.InvalidTime)}function At(i,r,u=!1){let c=js.exec(i);if(c!==null){const[,l,h,I,e,T,O,L]=c,U=_.fromObject({year:parseInt(l,10),month:parseInt(h,10),day:parseInt(I,10),hour:parseInt(e,10),minute:parseInt(T,10),second:parseInt(O,10),millisecond:L?parseInt(L.replace(".",""),10):0},{zone:Yt(r)});if(U.isValid===!1)throw new v(d.InvalidTimeStamp);return U}if(c=Ys.exec(i),c!==null){const[,l,h,I,e,T,O,L,U,Z,C]=c,A=z.fromParts(parseInt(l,10),parseInt(h,10),parseInt(I,10),parseInt(e,10),parseInt(T,10),parseInt(O,10),L?parseInt(L.replace(".",""),10):0,U==="-",parseInt(Z,10),parseInt(C,10));if(A.isValid===!1)throw new v(d.InvalidTimeStamp);return A}if(c=Bs.exec(i),c!==null){const[,l,h,I,e,T,O,L,U]=c,Z=z.fromParts(parseInt(l,10),parseInt(h,10),parseInt(I,10),parseInt(e,10),parseInt(T,10),0,0,O==="-",parseInt(L,10),parseInt(U,10));if(Z.isValid===!1)throw new v(d.InvalidTimeStamp);return Z}if(c=Qs.exec(i),c!==null){const[,l,h,I,e,T]=c,O=_.fromObject({year:parseInt(l,10),month:parseInt(h,10),day:parseInt(I,10),hour:parseInt(e,10),minute:parseInt(T,10),second:0},{zone:Yt(r)});if(O.isValid===!1)throw new v(d.InvalidTimeStamp);return O}if(c=vn.exec(i),c!==null){const[,l,h,I]=c,e=_.fromObject({year:parseInt(l,10),month:parseInt(h,10),day:parseInt(I,10),hour:0,minute:0,second:0},{zone:Yt(r)});if(e.isValid===!1)throw new v(d.InvalidTimeStamp);return e}throw new v(d.InvalidTimeStamp)}function mn(i,r){const u=vn.exec(i);if(u===null)try{return At(i,r)}catch{throw new v(d.InvalidDate)}const[,c,l,h]=u,I=q.fromParts(parseInt(c,10),parseInt(l,10),parseInt(h,10));if(I===null)throw new v(d.InvalidDate);return I}const Ws=321408e5,Gs=26784e5,Ks=864e5,Xs=36e5,tl=6e4;function Bt(i){return!!M(i)||!!F(i)}function el(i){return!!M(i)||!!E(i)||!!F(i)||!!D(i)}function xt(i){if(M(i))return i.toMillis();if(E(i))return i.toNumber();if(F(i))return i.toMilliseconds();throw new v(d.InvalidDataType)}function B(i,r,u,c){if(i==null||r==null)return null;if(k(i)){if(k(r))return G(i,r,u);if(H(r))return nl(i,r,u);if(el(r))throw new v(d.InvalidOperator);if(E(r))throw new v(d.InvalidOperator)}else if(H(i)){if(k(r))return rl(i,r,u);if(H(r))return al(i,r,u);if(M(r))throw new v(d.InvalidOperator);if(E(r))throw new v(d.InvalidOperator);if(D(r))throw new v(d.InvalidOperator);if(F(r))throw new v(d.InvalidOperator)}else if(M(i)){if(Bt(r)){if(i instanceof _&&ct(i.zone)){if(r instanceof _&&ct(r.zone)===!1||r instanceof z)return ft(i,r,u)}else if(r instanceof _&&ct(r.zone)&&(i instanceof _&&ct(i.zone)===!1||i instanceof z))return ft(i,r,u);return G(xt(i),xt(r),u)}if(H(r))throw new v(d.InvalidOperator);if(E(r))return il(i,r,u);if(D(r))throw new v(d.InvalidOperator);if(k(r))throw new v(d.InvalidOperator)}else if(E(i)){if(F(r))return sl(i,r,u);if(M(r))return ul(i,r,u);if(H(r))throw new v(d.InvalidOperator);if(E(r))return G(i.toNumber(),r.toNumber(),u);if(D(r))throw new v(d.InvalidOperator);if(k(r))throw new v(d.InvalidOperator)}else if(D(i)){if(D(r))return G(i.toNumber(),r.toNumber(),u);if(H(r))throw new v(d.InvalidOperator);if(k(r))throw new v(d.InvalidOperator);if(E(r))throw new v(d.InvalidOperator);if(Bt(r))throw new v(d.InvalidOperator)}else if(F(i)){if(Bt(r))return r instanceof _&&ct(r.zone)?ft(i,r,u):G(xt(i),xt(r),u);if(H(r))throw new v(d.InvalidOperator);if(E(r))return ol(i,r,u);if(D(r))throw new v(d.InvalidOperator);if(k(r))throw new v(d.InvalidOperator)}switch(u){case"<>":return i!==r;case"=":return i===r;case">":return i>r;case"<":return i=":return i>=r;case"<=":return i<=r}}function G(i,r,u){switch(u){case"<>":return i!==r;case"=":return i===r;case">":return i>r;case"<":return i=":return i>=r;case"<=":return i<=r}}function nl(i,r,u){const c=parseFloat(r);if(!isNaN(c))return G(i,c,u);const l=i.toString();switch(u){case"<>":return l!==r;case"=":return l===r;case">":return l>r;case"<":return l=":return l>=r;case"<=":return l<=r}}function rl(i,r,u){const c=parseFloat(i);if(!isNaN(c))return G(c,r,u);const l=r.toString();switch(u){case"<>":return i!==l;case"=":return i===l;case">":return i>l;case"<":return i=":return i>=l;case"<=":return i<=l}}function al(i,r,u){switch(u){case"<>":return i!==r;case"=":return i===r;case">":return i>r;case"<":return i=":return i>=r;case"<=":return i<=r}}function il(i,r,u){const c=r.toDateTimeLuxon(i.zone);return G((i=i.startOf("day")).toMillis(),c.toMillis(),u)}function ol(i,r,u){const c=r.toDateTimeLuxon(i.toDateTime().zone);return G((i=i.startOfDay()).toMilliseconds(),c.toMillis(),u)}function ul(i,r,u){const c=i.toDateTimeLuxon(r.zone);return r=r.startOf("day"),G(c.toMillis(),r.toMillis(),u)}function sl(i,r,u){const c=i.toDateTimeLuxon(r.toDateTime().zone);return r=r.startOfDay(),G(c.toMillis(),r.toMilliseconds(),u)}function ft(i,r,u){i instanceof z&&(i=i.toDateTime()),r instanceof z&&(r=r.toDateTime());const c=rn(i),l=rn(r);switch(u){case"<>":return c!==l;case"=":return c===l;case">":return c>l;case"<":return c=":return c>=l;case"<=":return c<=l}}function rn(i){return i.year*Ws+i.month*Gs+i.day*Ks+i.hour*Xs+i.minute*tl+1e3*i.second+i.millisecond}function ee(i,r,u){const c=wn[i.toLowerCase()];if(c==null)throw new v(d.FunctionNotRecognized);if(r.lengthc.maxParams)throw new v(d.InvalidParameterCount,{name:i.toUpperCase()});return c.evaluate(r,u)}function ll(i,r){const u=wn[i.toLowerCase()];return u!=null&&r>=u.minParams&&r<=u.maxParams}function Mt(i){return typeof i=="string"||i instanceof String}function Qt(i){return!Y(i)&&!E(i)&&!M(i)&&!D(i)&&!F(i)}function hn(i){return E(i)||D(i)?i.toString():F(i)?i.toSQLValue():M(i)?i.millisecond===0?i.toFormat("yyyy-LL-dd HH:mm:ss"):i.toSQL({includeOffset:!1}):Y(i)?hn(_.fromJSDate(i)):i.toString()}function cl(i){if(Y(i))return q.fromDateJS(i);if(M(i))return q.fromParts(i.year,i.month,i.day);if(E(i))return i;if(D(i))throw new v(d.CannotCastValue);if(F(i)&&q.fromParts(i.year,i.month,i.day)===null)throw new v(d.CannotCastValue);if(Mt(i)){const r=q.fromReader(i);if(r!==null&&r.isValid)return r}throw new v(d.CannotCastValue)}function fl(i,r,u){if(Y(i))return bt(i,r);if(M(i))return i;if(E(i))return i.toDateTimeLuxon("unknown");if(D(i))throw new v(d.CannotCastValue);if(F(i))return i;if(Mt(i))return At(i,"unknown",u);throw new v(d.CannotCastValue)}function dl(i){if(Y(i))return Q.fromDateJS(i);if(M(i))return Q.fromDateTime(i);if(E(i))throw new v(d.CannotCastValue);if(D(i))return i;if(F(i))return Q.fromSqlTimeStampOffset(i);if(Mt(i))return te(i);throw new v(d.CannotCastValue)}const wn={extract:{minParams:2,maxParams:2,evaluate:([i,r])=>{if(r==null)return null;if(Y(r))switch(i.toUpperCase()){case"SECOND":return r.getSeconds();case"MINUTE":return r.getMinutes();case"HOUR":return r.getHours();case"DAY":return r.getDate();case"MONTH":return r.getMonth()+1;case"YEAR":return r.getFullYear();case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":return 0}else if(M(r))switch(i.toUpperCase()){case"SECOND":return r.second;case"MINUTE":return r.minute;case"HOUR":return r.hour;case"DAY":return r.day;case"MONTH":return r.month;case"YEAR":return r.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new v(d.InvalidFunctionParameters,{function:"EXTRACT"})}else if(E(r))switch(i.toUpperCase()){case"DAY":return r.day;case"MONTH":return r.month;case"YEAR":return r.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new v(d.InvalidFunctionParameters,{function:"EXTRACT"})}else if(D(r))switch(i.toUpperCase()){case"SECOND":return r.second;case"MINUTE":return r.minute;case"HOUR":return r.hour}else if(F(r))switch(i.toUpperCase()){case"SECOND":return r.second;case"MINUTE":return r.minute;case"HOUR":return r.hour;case"DAY":return r.day;case"MONTH":return r.month;case"YEAR":return r.year;case"TIMEZONE_HOUR":return r.timezoneOffsetHour;case"TIMEZONE_MINUTE":return r.timezoneOffsetMinutes}throw new v(d.InvalidFunctionParameters,{function:"EXTRACT"})}},substring:{minParams:2,maxParams:3,evaluate:i=>{if(i.length===2){const[r,u]=i;return r==null||u==null?null:r.toString().substring(u-1)}if(i.length===3){const[r,u,c]=i;return r==null||u==null||c==null?null:c<=0?"":r.toString().substring(u-1,u+c-1)}}},position:{minParams:2,maxParams:2,evaluate:([i,r])=>i==null||r==null?null:r.indexOf(i)+1},trim:{minParams:2,maxParams:3,evaluate:i=>{const r=i.length===3,u=r?i[1]:" ",c=r?i[2]:i[1];if(u==null||c==null)return null;const l=`(${_s(u)})`;switch(i[0]){case"BOTH":return c.replaceAll(new RegExp(`^${l}*|${l}*$`,"g"),"");case"LEADING":return c.replaceAll(new RegExp(`^${l}*`,"g"),"");case"TRAILING":return c.replaceAll(new RegExp(`${l}*$`,"g"),"")}throw new v(d.InvalidFunctionParameters,{function:"TRIM"})}},abs:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.abs(i[0])},ceiling:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.ceil(i[0])},floor:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.floor(i[0])},log:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.log(i[0])},log10:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.log(i[0])*Math.LOG10E},sin:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.sin(i[0])},cos:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.cos(i[0])},tan:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.tan(i[0])},asin:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.asin(i[0])},acos:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.acos(i[0])},atan:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.atan(i[0])},sign:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:i[0]>0?1:i[1]<0?-1:0},power:{minParams:2,maxParams:2,evaluate:i=>i[0]==null||i[1]==null?null:i[0]**i[1]},mod:{minParams:2,maxParams:2,evaluate:i=>i[0]==null||i[1]==null?null:i[0]%i[1]},round:{minParams:1,maxParams:2,evaluate:i=>{const r=i[0],u=i.length===2?10**i[1]:1;return r==null?null:Math.round(r*u)/u}},truncate:{minParams:1,maxParams:2,evaluate:i=>i[0]==null?null:i.length===1?parseInt(i[0].toFixed(0),10):parseFloat(i[0].toFixed(i[1]))},char_length:{minParams:1,maxParams:1,evaluate:i=>Mt(i[0])?i[0].length:0},concat:{minParams:1,maxParams:1/0,evaluate:i=>{let r="";for(let u=0;ui[0]==null?null:i[0].toString().toLowerCase()},upper:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:i[0].toString().toUpperCase()},coalesce:{minParams:1,maxParams:1/0,evaluate:i=>{for(const r of i)if(r!==null)return r;return null}},cosh:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.cosh(i[0])},sinh:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.sinh(i[0])},tanh:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.tanh(i[0])},nullif:{minParams:2,maxParams:2,evaluate:(i,r)=>B(i[0],i[1],"=")?null:i[0]},cast:{minParams:2,maxParams:2,evaluate:(i,r)=>{const u=i[0],c=i[1];if(u===null)return null;switch(c.type){case"integer":{if(!Qt(u))throw new v(d.CannotCastValue);const l=parseInt(u,10);if(isNaN(l))throw new v(d.CannotCastValue);return l}case"smallint":{if(!Qt(u))throw new v(d.CannotCastValue);const l=parseInt(u,10);if(isNaN(l))throw new v(d.CannotCastValue);if(l>32767||l<-32767)throw new v(d.CannotCastValue);return l}case"float":case"real":{if(!Qt(u))throw new v(d.CannotCastValue);const l=parseFloat(u);if(isNaN(l))throw new v(d.CannotCastValue);return l}case"time":return dl(u);case"date":return cl(u);case"timestamp":return fl(u,r,c.withtimezone===!0);case"varchar":{const l=hn(u);if(l.length>c.size)throw new v(d.CannotCastValue);return l}default:throw new v(d.InvalidDataType)}}}};function In(i,r,u,c){if(i==="||")return ee("concat",[r,u],c);if(r===null||u===null)return null;if(k(r)){if(k(u))return ne(r,u,i);if(et(u))return yl(r,u,i);if(D(u))return El();if(E(u))return Fl();if(F(u))return Ml();if(M(u))return bl();if(H(u))return $l(r,u,i);throw new v(d.InvalidOperator)}if(E(r)){if(k(u))return xl(r,u,i);if(et(u))return Tl(r,u,i);if(D(u))return Jl();if(E(u))return Vl(r,u,i);if(F(u))return Ul(r,u,i);if(M(u))return Rl(r,u,i);if(H(u))return Xl();throw new v(d.InvalidOperator)}if(D(r)){if(k(u))return Cl(r,u,i);if(et(u))return hl(r,u,i);if(D(u))return Bl();if(E(u))return jl();if(F(u))return Yl();if(M(u))return ql();if(H(u))return tc();throw new v(d.InvalidOperator)}if(et(r)){if(k(u))return gl(r,u,i);if(et(u))return Il(r,u,i);if(D(u))return vl(r,u,i);if(E(u))return ml(r,u,i);if(F(u))return wl(r,u,i);if(M(u))return pl(r,u,i);if(H(u))return Ll();throw new v(d.InvalidOperator)}if(M(r)){if(k(u))return Ol(r,u,i);if(et(u))return Nl(r,u,i);if(D(u))return Kl();if(E(u))return Wl(r,u,i);if(F(u))return Gl(r,u,i);if(M(u))return Ql(r,u,i);if(H(u))return ec();throw new v(d.InvalidOperator)}if(F(r)){if(k(u))return Al(r,u,i);if(et(u))return Sl(r,u,i);if(D(u))return zl();if(E(u))return Zl(r,u,i);if(F(u))return Hl(r,u,i);if(M(u))return kl(r,u,i);if(H(u))return nc();throw new v(d.InvalidOperator)}if(H(r)){if(k(u))return Dl(r,u,i);if(et(u))return _l();if(D(u))return rc();if(E(u))return ac();if(F(u))return oc();if(M(u))return ic();if(H(u))return Pl(r,u,i);throw new v(d.InvalidOperator)}throw new v(d.InvalidOperator)}function ne(i,r,u){switch(u){case"+":return i+r;case"-":return i-r;case"*":return i*r;case"/":return i/r}throw new v(d.InvalidOperator)}function pl(i,r,u){switch(u){case"+":return r.plus({milliseconds:i.valueInMilliseconds()});case"-":return i.valueInMilliseconds()-r.toMillis()}throw new v(d.InvalidOperator)}function vl(i,r,u){if(u==="+")return r.plus("milliseconds",i.valueInMilliseconds());throw new v(d.InvalidOperator)}function ml(i,r,u){if(u==="+")return r.plus("milliseconds",i.valueInMilliseconds());throw new v(d.InvalidOperator)}function hl(i,r,u){switch(u){case"+":return i.plus("milliseconds",r.valueInMilliseconds());case"-":return i.plus("milliseconds",-1*r.valueInMilliseconds())}throw new v(d.InvalidOperator)}function wl(i,r,u){if(u==="+")return r.addMilliseconds(i.valueInMilliseconds());throw new v(d.InvalidOperator)}function Il(i,r,u){switch(u){case"+":return b.createFromMilliseconds(i.valueInMilliseconds()+r.valueInMilliseconds());case"-":return b.createFromMilliseconds(i.valueInMilliseconds()-r.valueInMilliseconds());case"*":return b.createFromMilliseconds(i.valueInMilliseconds()*r.valueInMilliseconds());case"/":return b.createFromMilliseconds(i.valueInMilliseconds()/r.valueInMilliseconds())}throw new v(d.InvalidOperator)}function gl(i,r,u){switch(u){case"+":return b.createFromMilliseconds(i.valueInMilliseconds()+r);case"-":return b.createFromMilliseconds(i.valueInMilliseconds()-r);case"*":return b.createFromMilliseconds(i.valueInMilliseconds()*r);case"/":return b.createFromMilliseconds(i.valueInMilliseconds()/r)}throw new v(d.InvalidOperator)}function yl(i,r,u){switch(u){case"+":return b.createFromMilliseconds(i+r.valueInMilliseconds());case"-":return b.createFromMilliseconds(i-r.valueInMilliseconds());case"*":return b.createFromMilliseconds(i*r.valueInMilliseconds());case"/":return b.createFromMilliseconds(i/r.valueInMilliseconds())}throw new v(d.InvalidOperator)}function Tl(i,r,u){switch(u){case"+":return i.plus("milliseconds",r.valueInMilliseconds());case"-":return i.plus("milliseconds",-1*r.valueInMilliseconds())}throw new v(d.InvalidOperator)}function Nl(i,r,u){switch(u){case"+":return i.plus({milliseconds:r.valueInMilliseconds()});case"-":return i.minus({milliseconds:r.valueInMilliseconds()})}throw new v(d.InvalidOperator)}function Sl(i,r,u){switch(u){case"+":return i.addMilliseconds(r.valueInMilliseconds());case"-":return i.addMilliseconds(-1*r.valueInMilliseconds())}throw new v(d.InvalidOperator)}function Ol(i,r,u){const c=1e3*r*24*60*60;switch(u){case"+":return i.plus({milliseconds:c});case"-":return i.minus({milliseconds:c})}throw new v(d.InvalidOperator)}function xl(i,r,u){const c=1e3*r*24*60*60;switch(u){case"+":return i.plus("milliseconds",c);case"-":return i.plus("milliseconds",-1*c)}throw new v(d.InvalidOperator)}function Cl(i,r,u){const c=1e3*r*24*60*60;switch(u){case"+":return i.plus("milliseconds",c);case"-":return i.plus("milliseconds",-1*c)}throw new v(d.InvalidOperator)}function bl(i,r,u){throw new v(d.InvalidOperator)}function Al(i,r,u){const c=1e3*r*24*60*60;switch(u){case"+":return i.addMilliseconds(c);case"-":return i.addMilliseconds(-1*c)}throw new v(d.InvalidOperator)}function Ml(i,r,u){throw new v(d.InvalidOperator)}function El(i,r,u){throw new v(d.InvalidOperator)}function Fl(i,r,u){throw new v(d.InvalidOperator)}function $l(i,r,u){const c=parseFloat(r);if(isNaN(c))throw new v(d.InvalidOperator);return ne(i,c,u)}function Dl(i,r,u){const c=parseFloat(i);if(isNaN(c))throw new v(d.InvalidOperator);return ne(c,r,u)}function Pl(i,r,u){if(u==="+")return i+r;throw new v(d.InvalidOperator)}function Ll(i,r,u){throw new v(d.InvalidOperator)}function _l(i,r,u){throw new v(d.InvalidOperator)}function Rl(i,r,u){if(u==="-")return i.toDateTimeLuxon(r.zone).diff(r).as("days");throw new v(d.InvalidOperator)}function Ul(i,r,u){if(u==="-")return i.toDateTimeLuxon(r.toDateTime().zone).diff(r.toDateTime()).as("days");throw new v(d.InvalidOperator)}function Vl(i,r,u){if(u==="-")return i.toDateTimeLuxon("UTC").diff(r.toDateTimeLuxon("UTC")).as("days");throw new v(d.InvalidOperator)}function Jl(i,r,u){throw new v(d.InvalidOperator)}function zl(i,r,u){throw new v(d.InvalidOperator)}function Zl(i,r,u){if(u==="-")return i.toDateTime().diff(r.toDateTimeLuxon(i.toDateTime().zone)).as("days");throw new v(d.InvalidOperator)}function kl(i,r,u){if(u==="-")return i.toDateTime().diff(r).as("days");throw new v(d.InvalidOperator)}function Hl(i,r,u){if(u==="-")return i.toDateTime().diff(r.toDateTime()).as("days");throw new v(d.InvalidOperator)}function ql(i,r,u){throw new v(d.InvalidOperator)}function jl(i,r,u){throw new v(d.InvalidOperator)}function Yl(i,r,u){throw new v(d.InvalidOperator)}function Bl(i,r,u){throw new v(d.InvalidOperator)}function Ql(i,r,u){if(u==="-")return i.diff(r).as("days");throw new v(d.InvalidOperator)}function Wl(i,r,u){if(u==="-")return i.diff(r.toDateTimeLuxon(i.zone)).as("days");throw new v(d.InvalidOperator)}function Gl(i,r,u){if(u==="-")return i.diff(r.toDateTime()).as("days");throw new v(d.InvalidOperator)}function Kl(i,r,u){throw new v(d.InvalidOperator)}function Xl(i,r,u){throw new v(d.InvalidOperator)}function tc(i,r,u){throw new v(d.InvalidOperator)}function ec(i,r,u){throw new v(d.InvalidOperator)}function nc(i,r,u){throw new v(d.InvalidOperator)}function rc(i,r,u){throw new v(d.InvalidOperator)}function ac(i,r,u){throw new v(d.InvalidOperator)}function ic(i,r,u){throw new v(d.InvalidOperator)}function oc(i,r,u){throw new v(d.InvalidOperator)}var an,on,gn={exports:{}};on=function(){function i(l,h){function I(){this.constructor=l}I.prototype=h.prototype,l.prototype=new I}function r(l,h,I,e){var T=Error.call(this,l);return Object.setPrototypeOf&&Object.setPrototypeOf(T,r.prototype),T.expected=h,T.found=I,T.location=e,T.name="SyntaxError",T}function u(l,h,I){return I=I||" ",l.length>h?l:(h-=l.length,l+(I+=I.repeat(h)).slice(0,h))}function c(l,h){var I,e={},T=(h=h!==void 0?h:{}).grammarSource,O={start:ye},L=ye,U="!",Z="=",C=">=",A=">",j="<=",R="<>",xn="<",re="!=",Et="+",Ft="-",ae="||",Cn="*",bn="/",An="@",ie="'",oe="N'",dt="''",Mn=".",En="null",Fn="true",$n="false",Dn="in",Pn="is",Ln="like",_n="escape",Rn="not",Un="and",Vn="or",Jn="between",zn="from",Zn="for",kn="substring",Hn="extract",qn="trim",jn="position",Yn="timestamp",Bn="date",Qn="time",Wn="leading",Gn="trailing",Kn="both",Xn="cast",tr="as",er="integer",nr="smallint",rr="float",ar="real",ir="varchar",or="to",ur="interval",sr="year",lr="timezone_hour",cr="timezone_minute",fr="month",dr="day",pr="hour",vr="minute",mr="second",hr="case",wr="end",Ir="when",gr="then",yr="else",Tr=",",Nr="(",Sr=")",ue="`",Or=/^[A-Za-z_\x80-\uFFFF]/,xr=/^[A-Za-z0-9_]/,se=/^[A-Za-z0-9_.\x80-\uFFFF]/,Cr=/^["]/,le=/^[^']/,br=/^[0-9]/,Ar=/^[eE]/,Mr=/^[+\-]/,Er=/^[ \t\n\r]/,ce=/^[^`]/,Fr=y("!",!1),fe=y("=",!1),$r=y(">=",!1),Dr=y(">",!1),Pr=y("<=",!1),Lr=y("<>",!1),_r=y("<",!1),Rr=y("!=",!1),$t=y("+",!1),Dt=y("-",!1),Ur=y("||",!1),Vr=y("*",!1),Jr=y("/",!1),zr=X([["A","Z"],["a","z"],"_",["€","￿"]],!1,!1),Zr=X([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),de=X([["A","Z"],["a","z"],["0","9"],"_",".",["€","￿"]],!1,!1),kr=X(['"'],!1,!1),Hr=y("@",!1),pe=y("'",!1),qr=y("N'",!1),ve=y("''",!1),me=X(["'"],!0,!1),jr=y(".",!1),Yr=X([["0","9"]],!1,!1),Br=X(["e","E"],!1,!1),Qr=X(["+","-"],!1,!1),Wr=y("NULL",!0),Gr=y("TRUE",!0),Kr=y("FALSE",!0),Xr=y("IN",!0),ta=y("IS",!0),ea=y("LIKE",!0),na=y("ESCAPE",!0),ra=y("NOT",!0),aa=y("AND",!0),ia=y("OR",!0),oa=y("BETWEEN",!0),ua=y("FROM",!0),sa=y("FOR",!0),la=y("SUBSTRING",!0),ca=y("EXTRACT",!0),fa=y("TRIM",!0),da=y("POSITION",!0),pa=y("TIMESTAMP",!0),va=y("DATE",!0),ma=y("TIME",!0),ha=y("LEADING",!0),wa=y("TRAILING",!0),Ia=y("BOTH",!0),ga=y("CAST",!0),ya=y("AS",!0),Ta=y("INTEGER",!0),Na=y("SMALLINT",!0),Sa=y("FLOAT",!0),Oa=y("REAL",!0),xa=y("VARCHAR",!0),Ca=y("TO",!0),ba=y("INTERVAL",!0),Aa=y("YEAR",!0),Ma=y("TIMEZONE_HOUR",!0),Ea=y("TIMEZONE_MINUTE",!0),Fa=y("MONTH",!0),$a=y("DAY",!0),Da=y("HOUR",!0),Pa=y("MINUTE",!0),La=y("SECOND",!0),_a=y("CASE",!0),Ra=y("END",!0),Ua=y("WHEN",!0),Va=y("THEN",!0),Ja=y("ELSE",!0),za=y(",",!1),Za=y("(",!1),ka=y(")",!1),Ha=X([" "," ",` +import{a as q,n as Q,m as Ps}from"./TimeOnly-BXSODLxA.js";import{aF as sn,hj as _,a5 as Ls,ce as _s,E as Xe,Y as Rs}from"./index-BjUNJPVf.js";import{t as jt,i as Yt,r as ct}from"./UnknownTimeZone-CK7VjgF3.js";var d;(function(i){i.InvalidFunctionParameters="InvalidFunctionParameters",i.InvalidValueForAggregateFunction="InvalidValueForAggregateFunction",i.UnsupportedSqlFunction="UnsupportedSqlFunction",i.UnsupportedOperator="UnsupportedOperator",i.UnsupportedSyntax="UnsupportedSyntax",i.UnsupportedIsRhs="UnsupportedIsRhs",i.UnsupportedIsLhs="UnsupportedIsLhs",i.InvalidDataType="InvalidDataType",i.CannotCastValue="CannotCastValue",i.FunctionNotRecognized="FunctionNotRecognized",i.InvalidTime="InvalidTime",i.InvalidParameterCount="InvalidParameterCount",i.InvalidTimeStamp="InvalidTimeStamp",i.InvalidDate="InvalidDate",i.InvalidOperator="InvalidOperator",i.IllegalInterval="IllegalInterval",i.YearMonthIntervals="YearMonthIntervals",i.PrimarySecondaryQualifiers="PrimarySecondaryQualifiers",i.MissingStatisticParameters="MissingStatisticParameters"})(d||(d={}));const Us={[d.InvalidValueForAggregateFunction]:"Invalid value used in aggregate function",[d.MissingStatisticParameters]:"Statistic does not have 1 or 0 Parameters",[d.InvalidFunctionParameters]:"Invalid parameters for call to {function}",[d.UnsupportedIsLhs]:"Unsupported left hand expression in is statement",[d.UnsupportedIsRhs]:"Unsupported right hand expression in is statement",[d.UnsupportedOperator]:"Unsupported operator - {operator}",[d.UnsupportedSyntax]:"Unsupported syntax - {node}",[d.UnsupportedSqlFunction]:"Sql function not found = {function}",[d.InvalidDataType]:"Invalid sql data type",[d.InvalidDate]:"Invalid date encountered",[d.InvalidOperator]:"Invalid operator encountered",[d.InvalidTime]:"Invalid time encountered",[d.IllegalInterval]:"Illegal interval",[d.FunctionNotRecognized]:"Function not recognized",[d.InvalidTimeStamp]:"Invalid timestamp encountered",[d.InvalidParameterCount]:"Invalid parameter count for call to {name}",[d.PrimarySecondaryQualifiers]:"Primary and Secondary SqlInterval qualifiers not supported",[d.YearMonthIntervals]:"Year-Month Intervals not supported",[d.CannotCastValue]:"Cannot cast value to the required data type"};let v=class ln extends Error{constructor(r,u){super(sn(Us[r],u)),this.declaredRootClass="esri.arcade.featureset.support.sqlerror",Error.captureStackTrace&&Error.captureStackTrace(this,ln)}};var W;(function(i){i.NeverReach="NeverReach",i.NotImplemented="NotImplemented",i.Cancelled="Cancelled",i.InvalidStatResponse="InvalidStatResponse",i.InvalidRequest="InvalidRequest",i.RequestFailed="RequestFailed",i.MissingFeatures="MissingFeatures",i.AggregationFieldNotFound="AggregationFieldNotFound",i.DataElementsNotFound="DataElementsNotFound"})(W||(W={}));const Vs={[W.Cancelled]:"Cancelled",[W.InvalidStatResponse]:"Invalid statistics response from service",[W.InvalidRequest]:"Invalid request",[W.RequestFailed]:"Request failed - {reason}",[W.MissingFeatures]:"Missing features",[W.AggregationFieldNotFound]:"Aggregation field not found",[W.DataElementsNotFound]:"Data elements not found on service",[W.NeverReach]:"Encountered unreachable logic",[W.NotImplemented]:"Not implemented"};let wc=class cn extends Error{constructor(r,u){super(sn(Vs[r],u)),this.declaredRootClass="esri.arcade.featureset.support.featureseterror",Error.captureStackTrace&&Error.captureStackTrace(this,cn)}};function tn(i){return Number.isNaN(i)||i===0?i:Math.trunc(i)}class z{constructor(r){this._timeStampOffset=r,this._date=null}toDateTime(){return this._date??(this._date=_.fromISO(this._timeStampOffset,{setZone:!0})),this._date}get isValid(){return this.toDateTime().isValid}get timezoneOffsetHour(){return tn(this.toDateTime().offset/60)}get timezoneOffsetMinutes(){return tn(this.toDateTime().offset%60)}toMilliseconds(){return this.toDateTime().toMillis()}get hour(){return this.toDateTime().hour}get minute(){return this.toDateTime().minute}get second(){return this.toDateTime().second}get day(){return this.toDateTime().day}get month(){return this.toDateTime().month}get year(){return this.toDateTime().year}startOfDay(){return z.fromDateTime(this.toDateTime().startOf("day"))}static fromJSDate(r){return new z(_.fromJSDate(r).toISO({includeOffset:!0}))}static fromDateTime(r){return new z(r.toISO({includeOffset:!0}))}static fromParts(r,u,c=0,l=0,h=0,I=0,e=0,T=!1,O=0,L=0){const U=`${r.toString().padStart(4,"0")}-${u.toString().padStart(2,"0")}-${c.toString().padStart(2,"0")}`;let Z="";I<10&&(Z="0");let C=`${l.toString().padStart(2,"0")}:${h.toString().padStart(2,"0")}:${Z+I.toString()}`;e!==0&&(C+="."+e.toString().padStart(3,"0"));const A=`${T?"-":"+"}${O.toString().padStart(2,"0")}:${L.toString().padStart(2,"0")}`;return new z(U+"T"+C+A)}toStorageFormat(){return this._timeStampOffset}toString(){return this._timeStampOffset}toSQLValue(){let r=this.toDateTime().toSQL({includeOffset:!0,includeOffsetSpace:!0});return r&&(r=r.replace(".000","")),r}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}addMilliseconds(r){const u=this.toDateTime().plus(r);return z.fromDateTime(u)}}function Js(i,r){const u=fn[i.toLowerCase()];if(u==null)throw new v(d.FunctionNotRecognized);if(r.lengthu.maxParams)throw new v(d.InvalidParameterCount,{name:i.toUpperCase()});return u.evaluate(r)}function en(i,r){const u=fn[i.toLowerCase()];return u!=null&&r>=u.minParams&&r<=u.maxParams}const fn={min:{minParams:1,maxParams:1,evaluate:i=>nn(i[0],"min")},max:{minParams:1,maxParams:1,evaluate:i=>nn(i[0],"max")},avg:{minParams:1,maxParams:1,evaluate:i=>dn(i[0])},sum:{minParams:1,maxParams:1,evaluate:i=>zs(i[0])},stddev:{minParams:1,maxParams:1,evaluate:i=>Zs(i[0])},count:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:i[0].length},var:{minParams:1,maxParams:1,evaluate:i=>pn(i[0])}};function dn(i){if(i===null)return null;let r=0,u=0;for(let c=0;c=h)&&(u=l,c=h)}return u}function zs(i){if(i===null)return null;let r=0;for(let u=0;uc!==null)).length===0)return null;const r=dn(i);if(r===null)return null;let u=0;for(const c of i){if(!Xt(c))throw new v(d.InvalidValueForAggregateFunction);u+=(r-c)**2}return u/(i.length-1)}class b{constructor(){this.op="+",this.day=0,this.second=0,this.hour=0,this.month=0,this.year=0,this.minute=0,this.millis=0}static _fixDefaults(r){if(r.precision!==null||r.secondary!==null)throw new v(d.PrimarySecondaryQualifiers)}static _parseSecondsComponent(r,u){if(u.includes(".")){const c=u.split(".");r.second=parseFloat(c[0]),r.millis=parseInt(c[1],10)}else r.second=parseFloat(u)}static createFromMilliseconds(r){const u=new b;return u.second=r/1e3,u}static createFromValueAndQualifier(r,u,c){let l=null;const h=new b;if(h.op=c==="-"?"-":"+",u.type==="interval-period"){b._fixDefaults(u);const I=new RegExp("^[0-9]{1,}$");if(u.period==="year"||u.period==="month")throw new v(d.YearMonthIntervals);if(u.period==="second"){if(!/^[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$/.test(r))throw new v(d.IllegalInterval);b._parseSecondsComponent(h,r)}else{if(!I.test(r))throw new v(d.IllegalInterval);h[u.period]=parseFloat(r)}}else{if(b._fixDefaults(u.start),b._fixDefaults(u.end),u.start.period==="year"||u.start.period==="month"||u.end.period==="year"||u.end.period==="month")throw new v(d.YearMonthIntervals);switch(u.start.period){case"day":switch(u.end.period){case"hour":if(l=new RegExp("^[0-9]{1,} [0-9]{1,}$"),!l.test(r))throw new v(d.IllegalInterval);h[u.start.period]=parseFloat(r.split(" ")[0]),h[u.end.period]=parseFloat(r.split(" ")[1]);break;case"minute":if(l=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,}$"),!l.test(r))throw new v(d.IllegalInterval);{h[u.start.period]=parseFloat(r.split(" ")[0]);const I=r.split(" ")[1].split(":");h.hour=parseFloat(I[0]),h.minute=parseFloat(I[1])}break;case"second":if(l=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!l.test(r))throw new v(d.IllegalInterval);{h[u.start.period]=parseFloat(r.split(" ")[0]);const I=r.split(" ")[1].split(":");h.hour=parseFloat(I[0]),h.minute=parseFloat(I[1]),b._parseSecondsComponent(h,I[2])}break;default:throw new v(d.IllegalInterval)}break;case"hour":switch(u.end.period){case"minute":if(l=new RegExp("^[0-9]{1,}:[0-9]{1,}$"),!l.test(r))throw new v(d.IllegalInterval);h.hour=parseFloat(r.split(":")[0]),h.minute=parseFloat(r.split(":")[1]);break;case"second":if(l=new RegExp("^[0-9]{1,}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!l.test(r))throw new v(d.IllegalInterval);{const I=r.split(":");h.hour=parseFloat(I[0]),h.minute=parseFloat(I[1]),b._parseSecondsComponent(h,I[2])}break;default:throw new v(d.IllegalInterval)}break;case"minute":if(u.end.period!=="second")throw new v(d.IllegalInterval);if(l=new RegExp("^[0-9]{1,}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!l.test(r))throw new v(d.IllegalInterval);{const I=r.split(":");h.minute=parseFloat(I[0]),b._parseSecondsComponent(h,I[1])}break;default:throw new v(d.IllegalInterval)}}return h}valueInMilliseconds(){return(this.op==="-"?-1:1)*(this.millis+1e3*this.second+60*this.minute*1e3+60*this.hour*60*1e3+24*this.day*60*60*1e3+this.month*(365/12)*24*60*60*1e3+365*this.year*24*60*60*1e3)}}const ks=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/,Hs=/^(\d{1,2}):(\d{1,2})$/,qs=/^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/,vn=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,js=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$/,Ys=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$/,Bs=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$/,Qs=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;function bt(i,r){if(r instanceof Ls)return r===jt.instance?_.fromMillis(i.getTime(),{zone:jt.instance}):_.fromJSDate(i,{zone:r});switch(r){case"system":case"local":case null:return _.fromJSDate(i);default:return(r==null?void 0:r.toLowerCase())==="unknown"?_.fromMillis(i.getTime(),{zone:jt.instance}):_.fromJSDate(i,{zone:r})}}function k(i){return typeof i=="number"}function H(i){return typeof i=="string"||i instanceof String}function et(i){return i instanceof b}function Y(i){return i instanceof Date}function M(i){return i instanceof _}function E(i){return i instanceof q}function D(i){return i instanceof Q}function F(i){return i instanceof z}function te(i){let r=ks.exec(i);if(r!==null){const[,u,c,l]=r,h=Q.fromParts(parseInt(u,10),parseInt(c,10),parseInt(l,10),0);if(h!==null)return h;throw new v(d.InvalidTime)}if(r=Hs.exec(i),r!==null){const[,u,c]=r,l=Q.fromParts(parseInt(u,10),parseInt(c,10),0,0);if(l!==null)return l;throw new v(d.InvalidTime)}if(r=qs.exec(i),r!==null){const[,u,c,l,h]=r,I=Q.fromParts(parseInt(u,10),parseInt(c,10),parseInt(l,10),parseInt(h,10));if(I!==null)return I;throw new v(d.InvalidTime)}throw new v(d.InvalidTime)}function At(i,r,u=!1){let c=js.exec(i);if(c!==null){const[,l,h,I,e,T,O,L]=c,U=_.fromObject({year:parseInt(l,10),month:parseInt(h,10),day:parseInt(I,10),hour:parseInt(e,10),minute:parseInt(T,10),second:parseInt(O,10),millisecond:L?parseInt(L.replace(".",""),10):0},{zone:Yt(r)});if(U.isValid===!1)throw new v(d.InvalidTimeStamp);return U}if(c=Ys.exec(i),c!==null){const[,l,h,I,e,T,O,L,U,Z,C]=c,A=z.fromParts(parseInt(l,10),parseInt(h,10),parseInt(I,10),parseInt(e,10),parseInt(T,10),parseInt(O,10),L?parseInt(L.replace(".",""),10):0,U==="-",parseInt(Z,10),parseInt(C,10));if(A.isValid===!1)throw new v(d.InvalidTimeStamp);return A}if(c=Bs.exec(i),c!==null){const[,l,h,I,e,T,O,L,U]=c,Z=z.fromParts(parseInt(l,10),parseInt(h,10),parseInt(I,10),parseInt(e,10),parseInt(T,10),0,0,O==="-",parseInt(L,10),parseInt(U,10));if(Z.isValid===!1)throw new v(d.InvalidTimeStamp);return Z}if(c=Qs.exec(i),c!==null){const[,l,h,I,e,T]=c,O=_.fromObject({year:parseInt(l,10),month:parseInt(h,10),day:parseInt(I,10),hour:parseInt(e,10),minute:parseInt(T,10),second:0},{zone:Yt(r)});if(O.isValid===!1)throw new v(d.InvalidTimeStamp);return O}if(c=vn.exec(i),c!==null){const[,l,h,I]=c,e=_.fromObject({year:parseInt(l,10),month:parseInt(h,10),day:parseInt(I,10),hour:0,minute:0,second:0},{zone:Yt(r)});if(e.isValid===!1)throw new v(d.InvalidTimeStamp);return e}throw new v(d.InvalidTimeStamp)}function mn(i,r){const u=vn.exec(i);if(u===null)try{return At(i,r)}catch{throw new v(d.InvalidDate)}const[,c,l,h]=u,I=q.fromParts(parseInt(c,10),parseInt(l,10),parseInt(h,10));if(I===null)throw new v(d.InvalidDate);return I}const Ws=321408e5,Gs=26784e5,Ks=864e5,Xs=36e5,tl=6e4;function Bt(i){return!!M(i)||!!F(i)}function el(i){return!!M(i)||!!E(i)||!!F(i)||!!D(i)}function xt(i){if(M(i))return i.toMillis();if(E(i))return i.toNumber();if(F(i))return i.toMilliseconds();throw new v(d.InvalidDataType)}function B(i,r,u,c){if(i==null||r==null)return null;if(k(i)){if(k(r))return G(i,r,u);if(H(r))return nl(i,r,u);if(el(r))throw new v(d.InvalidOperator);if(E(r))throw new v(d.InvalidOperator)}else if(H(i)){if(k(r))return rl(i,r,u);if(H(r))return al(i,r,u);if(M(r))throw new v(d.InvalidOperator);if(E(r))throw new v(d.InvalidOperator);if(D(r))throw new v(d.InvalidOperator);if(F(r))throw new v(d.InvalidOperator)}else if(M(i)){if(Bt(r)){if(i instanceof _&&ct(i.zone)){if(r instanceof _&&ct(r.zone)===!1||r instanceof z)return ft(i,r,u)}else if(r instanceof _&&ct(r.zone)&&(i instanceof _&&ct(i.zone)===!1||i instanceof z))return ft(i,r,u);return G(xt(i),xt(r),u)}if(H(r))throw new v(d.InvalidOperator);if(E(r))return il(i,r,u);if(D(r))throw new v(d.InvalidOperator);if(k(r))throw new v(d.InvalidOperator)}else if(E(i)){if(F(r))return sl(i,r,u);if(M(r))return ul(i,r,u);if(H(r))throw new v(d.InvalidOperator);if(E(r))return G(i.toNumber(),r.toNumber(),u);if(D(r))throw new v(d.InvalidOperator);if(k(r))throw new v(d.InvalidOperator)}else if(D(i)){if(D(r))return G(i.toNumber(),r.toNumber(),u);if(H(r))throw new v(d.InvalidOperator);if(k(r))throw new v(d.InvalidOperator);if(E(r))throw new v(d.InvalidOperator);if(Bt(r))throw new v(d.InvalidOperator)}else if(F(i)){if(Bt(r))return r instanceof _&&ct(r.zone)?ft(i,r,u):G(xt(i),xt(r),u);if(H(r))throw new v(d.InvalidOperator);if(E(r))return ol(i,r,u);if(D(r))throw new v(d.InvalidOperator);if(k(r))throw new v(d.InvalidOperator)}switch(u){case"<>":return i!==r;case"=":return i===r;case">":return i>r;case"<":return i=":return i>=r;case"<=":return i<=r}}function G(i,r,u){switch(u){case"<>":return i!==r;case"=":return i===r;case">":return i>r;case"<":return i=":return i>=r;case"<=":return i<=r}}function nl(i,r,u){const c=parseFloat(r);if(!isNaN(c))return G(i,c,u);const l=i.toString();switch(u){case"<>":return l!==r;case"=":return l===r;case">":return l>r;case"<":return l=":return l>=r;case"<=":return l<=r}}function rl(i,r,u){const c=parseFloat(i);if(!isNaN(c))return G(c,r,u);const l=r.toString();switch(u){case"<>":return i!==l;case"=":return i===l;case">":return i>l;case"<":return i=":return i>=l;case"<=":return i<=l}}function al(i,r,u){switch(u){case"<>":return i!==r;case"=":return i===r;case">":return i>r;case"<":return i=":return i>=r;case"<=":return i<=r}}function il(i,r,u){const c=r.toDateTimeLuxon(i.zone);return G((i=i.startOf("day")).toMillis(),c.toMillis(),u)}function ol(i,r,u){const c=r.toDateTimeLuxon(i.toDateTime().zone);return G((i=i.startOfDay()).toMilliseconds(),c.toMillis(),u)}function ul(i,r,u){const c=i.toDateTimeLuxon(r.zone);return r=r.startOf("day"),G(c.toMillis(),r.toMillis(),u)}function sl(i,r,u){const c=i.toDateTimeLuxon(r.toDateTime().zone);return r=r.startOfDay(),G(c.toMillis(),r.toMilliseconds(),u)}function ft(i,r,u){i instanceof z&&(i=i.toDateTime()),r instanceof z&&(r=r.toDateTime());const c=rn(i),l=rn(r);switch(u){case"<>":return c!==l;case"=":return c===l;case">":return c>l;case"<":return c=":return c>=l;case"<=":return c<=l}}function rn(i){return i.year*Ws+i.month*Gs+i.day*Ks+i.hour*Xs+i.minute*tl+1e3*i.second+i.millisecond}function ee(i,r,u){const c=wn[i.toLowerCase()];if(c==null)throw new v(d.FunctionNotRecognized);if(r.lengthc.maxParams)throw new v(d.InvalidParameterCount,{name:i.toUpperCase()});return c.evaluate(r,u)}function ll(i,r){const u=wn[i.toLowerCase()];return u!=null&&r>=u.minParams&&r<=u.maxParams}function Mt(i){return typeof i=="string"||i instanceof String}function Qt(i){return!Y(i)&&!E(i)&&!M(i)&&!D(i)&&!F(i)}function hn(i){return E(i)||D(i)?i.toString():F(i)?i.toSQLValue():M(i)?i.millisecond===0?i.toFormat("yyyy-LL-dd HH:mm:ss"):i.toSQL({includeOffset:!1}):Y(i)?hn(_.fromJSDate(i)):i.toString()}function cl(i){if(Y(i))return q.fromDateJS(i);if(M(i))return q.fromParts(i.year,i.month,i.day);if(E(i))return i;if(D(i))throw new v(d.CannotCastValue);if(F(i)&&q.fromParts(i.year,i.month,i.day)===null)throw new v(d.CannotCastValue);if(Mt(i)){const r=q.fromReader(i);if(r!==null&&r.isValid)return r}throw new v(d.CannotCastValue)}function fl(i,r,u){if(Y(i))return bt(i,r);if(M(i))return i;if(E(i))return i.toDateTimeLuxon("unknown");if(D(i))throw new v(d.CannotCastValue);if(F(i))return i;if(Mt(i))return At(i,"unknown",u);throw new v(d.CannotCastValue)}function dl(i){if(Y(i))return Q.fromDateJS(i);if(M(i))return Q.fromDateTime(i);if(E(i))throw new v(d.CannotCastValue);if(D(i))return i;if(F(i))return Q.fromSqlTimeStampOffset(i);if(Mt(i))return te(i);throw new v(d.CannotCastValue)}const wn={extract:{minParams:2,maxParams:2,evaluate:([i,r])=>{if(r==null)return null;if(Y(r))switch(i.toUpperCase()){case"SECOND":return r.getSeconds();case"MINUTE":return r.getMinutes();case"HOUR":return r.getHours();case"DAY":return r.getDate();case"MONTH":return r.getMonth()+1;case"YEAR":return r.getFullYear();case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":return 0}else if(M(r))switch(i.toUpperCase()){case"SECOND":return r.second;case"MINUTE":return r.minute;case"HOUR":return r.hour;case"DAY":return r.day;case"MONTH":return r.month;case"YEAR":return r.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new v(d.InvalidFunctionParameters,{function:"EXTRACT"})}else if(E(r))switch(i.toUpperCase()){case"DAY":return r.day;case"MONTH":return r.month;case"YEAR":return r.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new v(d.InvalidFunctionParameters,{function:"EXTRACT"})}else if(D(r))switch(i.toUpperCase()){case"SECOND":return r.second;case"MINUTE":return r.minute;case"HOUR":return r.hour}else if(F(r))switch(i.toUpperCase()){case"SECOND":return r.second;case"MINUTE":return r.minute;case"HOUR":return r.hour;case"DAY":return r.day;case"MONTH":return r.month;case"YEAR":return r.year;case"TIMEZONE_HOUR":return r.timezoneOffsetHour;case"TIMEZONE_MINUTE":return r.timezoneOffsetMinutes}throw new v(d.InvalidFunctionParameters,{function:"EXTRACT"})}},substring:{minParams:2,maxParams:3,evaluate:i=>{if(i.length===2){const[r,u]=i;return r==null||u==null?null:r.toString().substring(u-1)}if(i.length===3){const[r,u,c]=i;return r==null||u==null||c==null?null:c<=0?"":r.toString().substring(u-1,u+c-1)}}},position:{minParams:2,maxParams:2,evaluate:([i,r])=>i==null||r==null?null:r.indexOf(i)+1},trim:{minParams:2,maxParams:3,evaluate:i=>{const r=i.length===3,u=r?i[1]:" ",c=r?i[2]:i[1];if(u==null||c==null)return null;const l=`(${_s(u)})`;switch(i[0]){case"BOTH":return c.replaceAll(new RegExp(`^${l}*|${l}*$`,"g"),"");case"LEADING":return c.replaceAll(new RegExp(`^${l}*`,"g"),"");case"TRAILING":return c.replaceAll(new RegExp(`${l}*$`,"g"),"")}throw new v(d.InvalidFunctionParameters,{function:"TRIM"})}},abs:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.abs(i[0])},ceiling:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.ceil(i[0])},floor:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.floor(i[0])},log:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.log(i[0])},log10:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.log(i[0])*Math.LOG10E},sin:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.sin(i[0])},cos:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.cos(i[0])},tan:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.tan(i[0])},asin:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.asin(i[0])},acos:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.acos(i[0])},atan:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.atan(i[0])},sign:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:i[0]>0?1:i[1]<0?-1:0},power:{minParams:2,maxParams:2,evaluate:i=>i[0]==null||i[1]==null?null:i[0]**i[1]},mod:{minParams:2,maxParams:2,evaluate:i=>i[0]==null||i[1]==null?null:i[0]%i[1]},round:{minParams:1,maxParams:2,evaluate:i=>{const r=i[0],u=i.length===2?10**i[1]:1;return r==null?null:Math.round(r*u)/u}},truncate:{minParams:1,maxParams:2,evaluate:i=>i[0]==null?null:i.length===1?parseInt(i[0].toFixed(0),10):parseFloat(i[0].toFixed(i[1]))},char_length:{minParams:1,maxParams:1,evaluate:i=>Mt(i[0])?i[0].length:0},concat:{minParams:1,maxParams:1/0,evaluate:i=>{let r="";for(let u=0;ui[0]==null?null:i[0].toString().toLowerCase()},upper:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:i[0].toString().toUpperCase()},coalesce:{minParams:1,maxParams:1/0,evaluate:i=>{for(const r of i)if(r!==null)return r;return null}},cosh:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.cosh(i[0])},sinh:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.sinh(i[0])},tanh:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.tanh(i[0])},nullif:{minParams:2,maxParams:2,evaluate:(i,r)=>B(i[0],i[1],"=")?null:i[0]},cast:{minParams:2,maxParams:2,evaluate:(i,r)=>{const u=i[0],c=i[1];if(u===null)return null;switch(c.type){case"integer":{if(!Qt(u))throw new v(d.CannotCastValue);const l=parseInt(u,10);if(isNaN(l))throw new v(d.CannotCastValue);return l}case"smallint":{if(!Qt(u))throw new v(d.CannotCastValue);const l=parseInt(u,10);if(isNaN(l))throw new v(d.CannotCastValue);if(l>32767||l<-32767)throw new v(d.CannotCastValue);return l}case"float":case"real":{if(!Qt(u))throw new v(d.CannotCastValue);const l=parseFloat(u);if(isNaN(l))throw new v(d.CannotCastValue);return l}case"time":return dl(u);case"date":return cl(u);case"timestamp":return fl(u,r,c.withtimezone===!0);case"varchar":{const l=hn(u);if(l.length>c.size)throw new v(d.CannotCastValue);return l}default:throw new v(d.InvalidDataType)}}}};function In(i,r,u,c){if(i==="||")return ee("concat",[r,u],c);if(r===null||u===null)return null;if(k(r)){if(k(u))return ne(r,u,i);if(et(u))return yl(r,u,i);if(D(u))return El();if(E(u))return Fl();if(F(u))return Ml();if(M(u))return bl();if(H(u))return $l(r,u,i);throw new v(d.InvalidOperator)}if(E(r)){if(k(u))return xl(r,u,i);if(et(u))return Tl(r,u,i);if(D(u))return Jl();if(E(u))return Vl(r,u,i);if(F(u))return Ul(r,u,i);if(M(u))return Rl(r,u,i);if(H(u))return Xl();throw new v(d.InvalidOperator)}if(D(r)){if(k(u))return Cl(r,u,i);if(et(u))return hl(r,u,i);if(D(u))return Bl();if(E(u))return jl();if(F(u))return Yl();if(M(u))return ql();if(H(u))return tc();throw new v(d.InvalidOperator)}if(et(r)){if(k(u))return gl(r,u,i);if(et(u))return Il(r,u,i);if(D(u))return vl(r,u,i);if(E(u))return ml(r,u,i);if(F(u))return wl(r,u,i);if(M(u))return pl(r,u,i);if(H(u))return Ll();throw new v(d.InvalidOperator)}if(M(r)){if(k(u))return Ol(r,u,i);if(et(u))return Nl(r,u,i);if(D(u))return Kl();if(E(u))return Wl(r,u,i);if(F(u))return Gl(r,u,i);if(M(u))return Ql(r,u,i);if(H(u))return ec();throw new v(d.InvalidOperator)}if(F(r)){if(k(u))return Al(r,u,i);if(et(u))return Sl(r,u,i);if(D(u))return zl();if(E(u))return Zl(r,u,i);if(F(u))return Hl(r,u,i);if(M(u))return kl(r,u,i);if(H(u))return nc();throw new v(d.InvalidOperator)}if(H(r)){if(k(u))return Dl(r,u,i);if(et(u))return _l();if(D(u))return rc();if(E(u))return ac();if(F(u))return oc();if(M(u))return ic();if(H(u))return Pl(r,u,i);throw new v(d.InvalidOperator)}throw new v(d.InvalidOperator)}function ne(i,r,u){switch(u){case"+":return i+r;case"-":return i-r;case"*":return i*r;case"/":return i/r}throw new v(d.InvalidOperator)}function pl(i,r,u){switch(u){case"+":return r.plus({milliseconds:i.valueInMilliseconds()});case"-":return i.valueInMilliseconds()-r.toMillis()}throw new v(d.InvalidOperator)}function vl(i,r,u){if(u==="+")return r.plus("milliseconds",i.valueInMilliseconds());throw new v(d.InvalidOperator)}function ml(i,r,u){if(u==="+")return r.plus("milliseconds",i.valueInMilliseconds());throw new v(d.InvalidOperator)}function hl(i,r,u){switch(u){case"+":return i.plus("milliseconds",r.valueInMilliseconds());case"-":return i.plus("milliseconds",-1*r.valueInMilliseconds())}throw new v(d.InvalidOperator)}function wl(i,r,u){if(u==="+")return r.addMilliseconds(i.valueInMilliseconds());throw new v(d.InvalidOperator)}function Il(i,r,u){switch(u){case"+":return b.createFromMilliseconds(i.valueInMilliseconds()+r.valueInMilliseconds());case"-":return b.createFromMilliseconds(i.valueInMilliseconds()-r.valueInMilliseconds());case"*":return b.createFromMilliseconds(i.valueInMilliseconds()*r.valueInMilliseconds());case"/":return b.createFromMilliseconds(i.valueInMilliseconds()/r.valueInMilliseconds())}throw new v(d.InvalidOperator)}function gl(i,r,u){switch(u){case"+":return b.createFromMilliseconds(i.valueInMilliseconds()+r);case"-":return b.createFromMilliseconds(i.valueInMilliseconds()-r);case"*":return b.createFromMilliseconds(i.valueInMilliseconds()*r);case"/":return b.createFromMilliseconds(i.valueInMilliseconds()/r)}throw new v(d.InvalidOperator)}function yl(i,r,u){switch(u){case"+":return b.createFromMilliseconds(i+r.valueInMilliseconds());case"-":return b.createFromMilliseconds(i-r.valueInMilliseconds());case"*":return b.createFromMilliseconds(i*r.valueInMilliseconds());case"/":return b.createFromMilliseconds(i/r.valueInMilliseconds())}throw new v(d.InvalidOperator)}function Tl(i,r,u){switch(u){case"+":return i.plus("milliseconds",r.valueInMilliseconds());case"-":return i.plus("milliseconds",-1*r.valueInMilliseconds())}throw new v(d.InvalidOperator)}function Nl(i,r,u){switch(u){case"+":return i.plus({milliseconds:r.valueInMilliseconds()});case"-":return i.minus({milliseconds:r.valueInMilliseconds()})}throw new v(d.InvalidOperator)}function Sl(i,r,u){switch(u){case"+":return i.addMilliseconds(r.valueInMilliseconds());case"-":return i.addMilliseconds(-1*r.valueInMilliseconds())}throw new v(d.InvalidOperator)}function Ol(i,r,u){const c=1e3*r*24*60*60;switch(u){case"+":return i.plus({milliseconds:c});case"-":return i.minus({milliseconds:c})}throw new v(d.InvalidOperator)}function xl(i,r,u){const c=1e3*r*24*60*60;switch(u){case"+":return i.plus("milliseconds",c);case"-":return i.plus("milliseconds",-1*c)}throw new v(d.InvalidOperator)}function Cl(i,r,u){const c=1e3*r*24*60*60;switch(u){case"+":return i.plus("milliseconds",c);case"-":return i.plus("milliseconds",-1*c)}throw new v(d.InvalidOperator)}function bl(i,r,u){throw new v(d.InvalidOperator)}function Al(i,r,u){const c=1e3*r*24*60*60;switch(u){case"+":return i.addMilliseconds(c);case"-":return i.addMilliseconds(-1*c)}throw new v(d.InvalidOperator)}function Ml(i,r,u){throw new v(d.InvalidOperator)}function El(i,r,u){throw new v(d.InvalidOperator)}function Fl(i,r,u){throw new v(d.InvalidOperator)}function $l(i,r,u){const c=parseFloat(r);if(isNaN(c))throw new v(d.InvalidOperator);return ne(i,c,u)}function Dl(i,r,u){const c=parseFloat(i);if(isNaN(c))throw new v(d.InvalidOperator);return ne(c,r,u)}function Pl(i,r,u){if(u==="+")return i+r;throw new v(d.InvalidOperator)}function Ll(i,r,u){throw new v(d.InvalidOperator)}function _l(i,r,u){throw new v(d.InvalidOperator)}function Rl(i,r,u){if(u==="-")return i.toDateTimeLuxon(r.zone).diff(r).as("days");throw new v(d.InvalidOperator)}function Ul(i,r,u){if(u==="-")return i.toDateTimeLuxon(r.toDateTime().zone).diff(r.toDateTime()).as("days");throw new v(d.InvalidOperator)}function Vl(i,r,u){if(u==="-")return i.toDateTimeLuxon("UTC").diff(r.toDateTimeLuxon("UTC")).as("days");throw new v(d.InvalidOperator)}function Jl(i,r,u){throw new v(d.InvalidOperator)}function zl(i,r,u){throw new v(d.InvalidOperator)}function Zl(i,r,u){if(u==="-")return i.toDateTime().diff(r.toDateTimeLuxon(i.toDateTime().zone)).as("days");throw new v(d.InvalidOperator)}function kl(i,r,u){if(u==="-")return i.toDateTime().diff(r).as("days");throw new v(d.InvalidOperator)}function Hl(i,r,u){if(u==="-")return i.toDateTime().diff(r.toDateTime()).as("days");throw new v(d.InvalidOperator)}function ql(i,r,u){throw new v(d.InvalidOperator)}function jl(i,r,u){throw new v(d.InvalidOperator)}function Yl(i,r,u){throw new v(d.InvalidOperator)}function Bl(i,r,u){throw new v(d.InvalidOperator)}function Ql(i,r,u){if(u==="-")return i.diff(r).as("days");throw new v(d.InvalidOperator)}function Wl(i,r,u){if(u==="-")return i.diff(r.toDateTimeLuxon(i.zone)).as("days");throw new v(d.InvalidOperator)}function Gl(i,r,u){if(u==="-")return i.diff(r.toDateTime()).as("days");throw new v(d.InvalidOperator)}function Kl(i,r,u){throw new v(d.InvalidOperator)}function Xl(i,r,u){throw new v(d.InvalidOperator)}function tc(i,r,u){throw new v(d.InvalidOperator)}function ec(i,r,u){throw new v(d.InvalidOperator)}function nc(i,r,u){throw new v(d.InvalidOperator)}function rc(i,r,u){throw new v(d.InvalidOperator)}function ac(i,r,u){throw new v(d.InvalidOperator)}function ic(i,r,u){throw new v(d.InvalidOperator)}function oc(i,r,u){throw new v(d.InvalidOperator)}var an,on,gn={exports:{}};on=function(){function i(l,h){function I(){this.constructor=l}I.prototype=h.prototype,l.prototype=new I}function r(l,h,I,e){var T=Error.call(this,l);return Object.setPrototypeOf&&Object.setPrototypeOf(T,r.prototype),T.expected=h,T.found=I,T.location=e,T.name="SyntaxError",T}function u(l,h,I){return I=I||" ",l.length>h?l:(h-=l.length,l+(I+=I.repeat(h)).slice(0,h))}function c(l,h){var I,e={},T=(h=h!==void 0?h:{}).grammarSource,O={start:ye},L=ye,U="!",Z="=",C=">=",A=">",j="<=",R="<>",xn="<",re="!=",Et="+",Ft="-",ae="||",Cn="*",bn="/",An="@",ie="'",oe="N'",dt="''",Mn=".",En="null",Fn="true",$n="false",Dn="in",Pn="is",Ln="like",_n="escape",Rn="not",Un="and",Vn="or",Jn="between",zn="from",Zn="for",kn="substring",Hn="extract",qn="trim",jn="position",Yn="timestamp",Bn="date",Qn="time",Wn="leading",Gn="trailing",Kn="both",Xn="cast",tr="as",er="integer",nr="smallint",rr="float",ar="real",ir="varchar",or="to",ur="interval",sr="year",lr="timezone_hour",cr="timezone_minute",fr="month",dr="day",pr="hour",vr="minute",mr="second",hr="case",wr="end",Ir="when",gr="then",yr="else",Tr=",",Nr="(",Sr=")",ue="`",Or=/^[A-Za-z_\x80-\uFFFF]/,xr=/^[A-Za-z0-9_]/,se=/^[A-Za-z0-9_.\x80-\uFFFF]/,Cr=/^["]/,le=/^[^']/,br=/^[0-9]/,Ar=/^[eE]/,Mr=/^[+\-]/,Er=/^[ \t\n\r]/,ce=/^[^`]/,Fr=y("!",!1),fe=y("=",!1),$r=y(">=",!1),Dr=y(">",!1),Pr=y("<=",!1),Lr=y("<>",!1),_r=y("<",!1),Rr=y("!=",!1),$t=y("+",!1),Dt=y("-",!1),Ur=y("||",!1),Vr=y("*",!1),Jr=y("/",!1),zr=X([["A","Z"],["a","z"],"_",["€","￿"]],!1,!1),Zr=X([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),de=X([["A","Z"],["a","z"],["0","9"],"_",".",["€","￿"]],!1,!1),kr=X(['"'],!1,!1),Hr=y("@",!1),pe=y("'",!1),qr=y("N'",!1),ve=y("''",!1),me=X(["'"],!0,!1),jr=y(".",!1),Yr=X([["0","9"]],!1,!1),Br=X(["e","E"],!1,!1),Qr=X(["+","-"],!1,!1),Wr=y("NULL",!0),Gr=y("TRUE",!0),Kr=y("FALSE",!0),Xr=y("IN",!0),ta=y("IS",!0),ea=y("LIKE",!0),na=y("ESCAPE",!0),ra=y("NOT",!0),aa=y("AND",!0),ia=y("OR",!0),oa=y("BETWEEN",!0),ua=y("FROM",!0),sa=y("FOR",!0),la=y("SUBSTRING",!0),ca=y("EXTRACT",!0),fa=y("TRIM",!0),da=y("POSITION",!0),pa=y("TIMESTAMP",!0),va=y("DATE",!0),ma=y("TIME",!0),ha=y("LEADING",!0),wa=y("TRAILING",!0),Ia=y("BOTH",!0),ga=y("CAST",!0),ya=y("AS",!0),Ta=y("INTEGER",!0),Na=y("SMALLINT",!0),Sa=y("FLOAT",!0),Oa=y("REAL",!0),xa=y("VARCHAR",!0),Ca=y("TO",!0),ba=y("INTERVAL",!0),Aa=y("YEAR",!0),Ma=y("TIMEZONE_HOUR",!0),Ea=y("TIMEZONE_MINUTE",!0),Fa=y("MONTH",!0),$a=y("DAY",!0),Da=y("HOUR",!0),Pa=y("MINUTE",!0),La=y("SECOND",!0),_a=y("CASE",!0),Ra=y("END",!0),Ua=y("WHEN",!0),Va=y("THEN",!0),Ja=y("ELSE",!0),za=y(",",!1),Za=y("(",!1),ka=y(")",!1),Ha=X([" "," ",` `,"\r"],!1,!1),he=y("`",!1),we=X(["`"],!0,!1),qa=function(t){return t},ja=function(t,a){var o={type:"expression-list"},s=Es(t,a);return o.value=s,o},Ya=function(t,a){return lt(t,a)},Ba=function(t,a){return lt(t,a)},Qa=function(t){return As("NOT",t)},Wa=function(t,a){return a==""||a==null||a==null?t:a.type=="arithmetic"?lt(t,a.tail):Ke(a.op,t,a.right,a.escape)},Ga=function(t){return{type:"arithmetic",tail:t}},Ka=function(t,a){return{op:t+"NOT",right:a}},Xa=function(t,a){return{op:t,right:a}},ti=function(t,a,o){return{op:"NOT"+t,right:{type:"expression-list",value:[a,o]}}},ei=function(t,a,o){return{op:t,right:{type:"expression-list",value:[a,o]}}},ni=function(t){return t[0]+" "+t[2]},ri=function(t){return t[0]+" "+t[2]},ai=function(t,a,o){return{op:t,right:a,escape:o.value}},ii=function(t,a){return{op:t,right:a,escape:""}},oi=function(t,a){return{op:t,right:a}},ui=function(t){return{op:t,right:{type:"expression-list",value:[]}}},si=function(t,a){return{op:t,right:a}},li=function(t,a){return lt(t,a)},ci=function(t,a){return lt(t,a)},fi=function(t){return t.paren=!0,t},di=function(t){return/^CURRENT_DATE$/i.test(t)?{type:"current-time",mode:"date"}:/^CURRENT_TIMESTAMP$/i.test(t)?{type:"current-time",mode:"timestamp"}:{type:"column-reference",table:"",column:t}},pi=function(t){return{type:"column-reference",table:"",column:t,delimited:!0}},vi=function(t){return t},mi=function(t,a){return t+a.join("")},hi=function(t,a){return t+a.join("")},wi=function(t){return t},Ii=function(t){return t.join("")},gi=function(){return'"'},yi=function(t){return{type:"parameter",value:t[1]}},Ti=function(t,a){return{type:"function",name:"extract",args:{type:"expression-list",value:[{type:"string",value:t},a]}}},Ni=function(t,a,o){return{type:"function",name:"substring",args:{type:"expression-list",value:o?[t,a,o[2]]:[t,a]}}},Si=function(t,a){return{type:"function",name:"cast",args:{type:"expression-list",value:[t,a]}}},Oi=function(){return{type:"data-type",value:{type:"integer"}}},xi=function(){return{type:"data-type",value:{type:"smallint"}}},Ci=function(){return{type:"data-type",value:{type:"float"}}},bi=function(){return{type:"data-type",value:{type:"real"}}},Ai=function(){return{type:"data-type",value:{type:"date"}}},Mi=function(){return{type:"data-type",value:{type:"timestamp"}}},Ei=function(){return{type:"data-type",value:{type:"time"}}},Fi=function(t){return{type:"data-type",value:{type:"varchar",size:parseInt(t)}}},$i=function(t,a,o){return{type:"function",name:"trim",args:{type:"expression-list",value:[{type:"string",value:t??"BOTH"},a,o]}}},Di=function(t,a){return{type:"function",name:"trim",args:{type:"expression-list",value:[{type:"string",value:t??"BOTH"},a]}}},Pi=function(t,a){return{type:"function",name:"position",args:{type:"expression-list",value:[t,a]}}},Li=function(t,a){return{type:"function",name:t,args:a||{type:"expression-list",value:[]}}},_i=function(t){return t.type==="string"&&Fs(t.value),{type:"timestamp",value:t.value}},Ri=function(t){return t.type==="string"&&$s(t.value),{type:"time",value:t.value}},Ui=function(t,a,o){return{type:"interval",value:a,qualifier:o,op:t}},Vi=function(t,a){return{type:"interval",value:t,qualifier:a,op:""}},Ji=function(t,a){return{type:"interval-qualifier",start:t,end:a}},zi=function(t,a){return{type:"interval-period",period:t.value,precision:a,secondary:null}},Zi=function(t){return{type:"interval-period",period:t.value,precision:null,secondary:null}},ki=function(t){return{type:"interval-period",period:t.value,precision:null,secondary:null}},Hi=function(t,a){return{type:"interval-period",period:"second",precision:t,secondary:a}},qi=function(t){return{type:"interval-period",period:"second",precision:t,secondary:null}},ji=function(){return{type:"interval-period",period:"second",precision:null,secondary:null}},Yi=function(t,a){return{type:"interval-period",period:t.value,precision:a,secondary:null}},Bi=function(t){return{type:"interval-period",period:t.value,precision:null,secondary:null}},Qi=function(t,a){return{type:"interval-period",period:"second",precision:t,secondary:a}},Wi=function(t){return{type:"interval-period",period:"second",precision:t,secondary:null}},Gi=function(){return{type:"interval-period",period:"second",precision:null,secondary:null}},Ki=function(){return{type:"string",value:"day"}},Xi=function(){return{type:"string",value:"hour"}},to=function(){return{type:"string",value:"minute"}},eo=function(){return{type:"string",value:"month"}},no=function(){return{type:"string",value:"year"}},ro=function(t){return parseFloat(t)},ao=function(t){return parseFloat(t)},io=function(t){return t.type==="string"&&Ds(t.value),{type:"date",value:t.value}},oo=function(){return{type:"null",value:null}},uo=function(){return{type:"boolean",value:!0}},so=function(){return{type:"boolean",value:!1}},Ie=function(){return"'"},lo=function(t){return{type:"string",value:t.join("")}},co=function(t,a){return{type:"case-expression",format:"simple",operand:t,clauses:a,else:null}},fo=function(t,a,o){return{type:"case-expression",format:"simple",operand:t,clauses:a,else:o.value}},po=function(t){return{type:"case-expression",format:"searched",clauses:t,else:null}},vo=function(t,a){return{type:"case-expression",format:"searched",clauses:t,else:a.value}},mo=function(t,a){return{type:"when-clause",operand:t,value:a}},ho=function(t,a){return{type:"when-clause",operand:t,value:a}},wo=function(t){return{type:"else-clause",value:t}},Io=function(t){return{type:"number",value:t}},go=function(t,a,o){return parseFloat(t+a+o)},yo=function(t,a){return parseFloat(t+a)},To=function(t,a){return parseFloat(t+a)},No=function(t){return parseFloat(t)},So=function(t,a){return t[0]+a},Oo=function(t){return"."+(t??"")},xo=function(t,a){return t+a},Co=function(t){return t.join("")},bo=function(t,a){return"e"+(a===null?"":a)},Ao=function(){return"IN"},Mo=function(){return"IS"},Eo=function(){return"LIKE"},Fo=function(){return"ESCAPE"},$o=function(){return"NOT"},Do=function(){return"AND"},Po=function(){return"OR"},Lo=function(){return"BETWEEN"},_o=function(){return"FROM"},Ro=function(){return"FOR"},Uo=function(){return"SUBSTRING"},Vo=function(){return"EXTRACT"},Jo=function(){return"TRIM"},zo=function(){return"POSITION"},Zo=function(){return"TIMESTAMP"},ko=function(){return"DATE"},Ho=function(){return"TIME"},qo=function(){return"LEADING"},jo=function(){return"TRAILING"},Yo=function(){return"BOTH"},Bo=function(){return"CAST"},Qo=function(){return"AS"},Wo=function(){return"INTEGER"},Go=function(){return"SMALLINT"},Ko=function(){return"FLOAT"},Xo=function(){return"REAL"},tu=function(){return"VARCHAR"},eu=function(){return"TO"},nu=function(){return"INTERVAL"},ru=function(){return"YEAR"},au=function(){return"TIMEZONE_HOUR"},iu=function(){return"TIMEZONE_MINUTE"},ou=function(){return"MONTH"},uu=function(){return"DAY"},su=function(){return"HOUR"},lu=function(){return"MINUTE"},cu=function(){return"SECOND"},fu=function(){return"CASE"},du=function(){return"END"},pu=function(){return"WHEN"},vu=function(){return"THEN"},mu=function(){return"ELSE"},hu=function(t){return t},wu=function(t){return t.join("")},n=0,m=0,pt=[{line:1,column:1}],K=0,Pt=[],f=0;if("startRule"in h){if(!(h.startRule in O))throw new Error(`Can't start parsing from rule "`+h.startRule+'".');L=O[h.startRule]}function Lt(t,a){throw gu(t,a=a!==void 0?a:_t(m,n))}function y(t,a){return{type:"literal",text:t,ignoreCase:a}}function X(t,a,o){return{type:"class",parts:t,inverted:a,ignoreCase:o}}function Iu(){return{type:"end"}}function ge(t){var a,o=pt[t];if(o)return o;for(a=t-1;!pt[a];)a--;for(o={line:(o=pt[a]).line,column:o.column};aK&&(K=n,Pt=[]),Pt.push(t))}function gu(t,a){return new r(t,null,null,a)}function yu(t,a,o){return new r(r.buildMessage(t,a),t,a,o)}function ye(){var t,a;return t=n,p(),(a=P())!==e?(p(),m=t,t=qa(a)):(n=t,t=e),t}function Te(){var t,a,o,s,g,S,x,$;if(t=n,(a=P())!==e){for(o=[],s=n,g=p(),(S=Ot())!==e?(x=p(),($=P())!==e?s=g=[g,S,x,$]:(n=s,s=e)):(n=s,s=e);s!==e;)o.push(s),s=n,g=p(),(S=Ot())!==e?(x=p(),($=P())!==e?s=g=[g,S,x,$]:(n=s,s=e)):(n=s,s=e);m=t,t=ja(a,o)}else n=t,t=e;return t}function P(){var t,a,o,s,g,S,x,$;if(t=n,(a=Rt())!==e){for(o=[],s=n,g=p(),(S=Re())!==e?(x=p(),($=Rt())!==e?s=g=[g,S,x,$]:(n=s,s=e)):(n=s,s=e);s!==e;)o.push(s),s=n,g=p(),(S=Re())!==e?(x=p(),($=Rt())!==e?s=g=[g,S,x,$]:(n=s,s=e)):(n=s,s=e);m=t,t=Ya(a,o)}else n=t,t=e;return t}function Rt(){var t,a,o,s,g,S,x,$;if(t=n,(a=vt())!==e){for(o=[],s=n,g=p(),(S=Tt())!==e?(x=p(),($=vt())!==e?s=g=[g,S,x,$]:(n=s,s=e)):(n=s,s=e);s!==e;)o.push(s),s=n,g=p(),(S=Tt())!==e?(x=p(),($=vt())!==e?s=g=[g,S,x,$]:(n=s,s=e)):(n=s,s=e);m=t,t=Ba(a,o)}else n=t,t=e;return t}function vt(){var t,a,o,s,g;return t=n,(a=st())===e&&(a=n,l.charCodeAt(n)===33?(o=U,n++):(o=e,f===0&&w(Fr)),o!==e?(s=n,f++,l.charCodeAt(n)===61?(g=Z,n++):(g=e,f===0&&w(fe)),f--,g===e?s=void 0:(n=s,s=e),s!==e?a=o=[o,s]:(n=a,a=e)):(n=a,a=e)),a!==e?(o=p(),(s=vt())!==e?(m=t,t=Qa(s)):(n=t,t=e)):(n=t,t=e),t===e&&(t=Tu()),t}function Tu(){var t,a,o;return t=n,(a=tt())!==e?(p(),(o=Nu())===e&&(o=null),m=t,t=Wa(a,o)):(n=t,t=e),t}function Nu(){var t;return(t=Su())===e&&(t=bu())===e&&(t=xu())===e&&(t=Ou())===e&&(t=Cu()),t}function Su(){var t,a,o,s,g,S,x;if(t=n,a=[],o=n,s=p(),(g=Ne())!==e?(S=p(),(x=tt())!==e?o=s=[s,g,S,x]:(n=o,o=e)):(n=o,o=e),o!==e)for(;o!==e;)a.push(o),o=n,s=p(),(g=Ne())!==e?(S=p(),(x=tt())!==e?o=s=[s,g,S,x]:(n=o,o=e)):(n=o,o=e);else a=e;return a!==e&&(m=t,a=Ga(a)),t=a}function Ne(){var t;return l.substr(n,2)===C?(t=C,n+=2):(t=e,f===0&&w($r)),t===e&&(l.charCodeAt(n)===62?(t=A,n++):(t=e,f===0&&w(Dr)),t===e&&(l.substr(n,2)===j?(t=j,n+=2):(t=e,f===0&&w(Pr)),t===e&&(l.substr(n,2)===R?(t=R,n+=2):(t=e,f===0&&w(Lr)),t===e&&(l.charCodeAt(n)===60?(t=xn,n++):(t=e,f===0&&w(_r)),t===e&&(l.charCodeAt(n)===61?(t=Z,n++):(t=e,f===0&&w(fe)),t===e&&(l.substr(n,2)===re?(t=re,n+=2):(t=e,f===0&&w(Rr)))))))),t}function Ou(){var t,a,o,s;return t=n,(a=Le())!==e?(p(),(o=st())!==e?(p(),(s=tt())!==e?(m=t,t=Ka(a,s)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(a=Le())!==e?(p(),(o=tt())!==e?(m=t,t=Xa(a,o)):(n=t,t=e)):(n=t,t=e)),t}function xu(){var t,a,o,s,g,S;return t=n,(a=st())!==e?(p(),(o=Ue())!==e?(p(),(s=tt())!==e?(p(),(g=Tt())!==e?(p(),(S=tt())!==e?(m=t,t=ti(o,s,S)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(a=Ue())!==e?(p(),(o=tt())!==e?(p(),(s=Tt())!==e?(p(),(g=tt())!==e?(m=t,t=ei(a,o,g)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)),t}function Se(){var t,a,o,s,g;return t=n,a=n,(o=st())!==e?(s=p(),(g=_e())!==e?a=o=[o,s,g]:(n=a,a=e)):(n=a,a=e),a!==e&&(m=t,a=ni(a)),(t=a)===e&&(t=_e()),t}function Ut(){var t,a,o,s,g;return t=n,a=n,(o=st())!==e?(s=p(),(g=Ht())!==e?a=o=[o,s,g]:(n=a,a=e)):(n=a,a=e),a!==e&&(m=t,a=ri(a)),(t=a)===e&&(t=Ht()),t}function Cu(){var t,a,o,s;return t=n,(a=Se())!==e?(p(),(o=nt())!==e?(p(),ss()!==e?(p(),(s=kt())!==e?(m=t,t=ai(a,o,s)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(a=Se())!==e?(p(),(o=nt())!==e?(m=t,t=ii(a,o)):(n=t,t=e)):(n=t,t=e)),t}function bu(){var t,a,o,s;return t=n,(a=Ut())!==e?(p(),(o=V())!==e?(p(),(s=Te())!==e?(p(),J()!==e?(m=t,t=oi(a,s)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(a=Ut())!==e?(p(),(o=V())!==e?(p(),(s=J())!==e?(m=t,t=ui(a)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(a=Ut())!==e?(p(),(o=Zt())!==e?(m=t,t=si(a,o)):(n=t,t=e)):(n=t,t=e))),t}function tt(){var t,a,o,s,g,S,x,$;if(t=n,(a=Vt())!==e){for(o=[],s=n,g=p(),(S=Oe())!==e?(x=p(),($=Vt())!==e?s=g=[g,S,x,$]:(n=s,s=e)):(n=s,s=e);s!==e;)o.push(s),s=n,g=p(),(S=Oe())!==e?(x=p(),($=Vt())!==e?s=g=[g,S,x,$]:(n=s,s=e)):(n=s,s=e);m=t,t=li(a,o)}else n=t,t=e;return t}function Oe(){var t;return l.charCodeAt(n)===43?(t=Et,n++):(t=e,f===0&&w($t)),t===e&&(l.charCodeAt(n)===45?(t=Ft,n++):(t=e,f===0&&w(Dt)),t===e&&(l.substr(n,2)===ae?(t=ae,n+=2):(t=e,f===0&&w(Ur)))),t}function Vt(){var t,a,o,s,g,S,x,$;if(t=n,(a=Jt())!==e){for(o=[],s=n,g=p(),(S=xe())!==e?(x=p(),($=Jt())!==e?s=g=[g,S,x,$]:(n=s,s=e)):(n=s,s=e);s!==e;)o.push(s),s=n,g=p(),(S=xe())!==e?(x=p(),($=Jt())!==e?s=g=[g,S,x,$]:(n=s,s=e)):(n=s,s=e);m=t,t=ci(a,o)}else n=t,t=e;return t}function xe(){var t;return l.charCodeAt(n)===42?(t=Cn,n++):(t=e,f===0&&w(Vr)),t===e&&(l.charCodeAt(n)===47?(t=bn,n++):(t=e,f===0&&w(Jr))),t}function Jt(){var t,a;return(t=ku())===e&&(t=Lu())===e&&(t=_u())===e&&(t=Vu())===e&&(t=Ju())===e&&(t=Ru())===e&&(t=zu())===e&&(t=Xu())===e&&(t=Au())===e&&(t=Zt())===e&&(t=n,V()!==e?(p(),(a=P())!==e?(p(),J()!==e?(m=t,t=fi(a)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)),t}function Au(){var t,a;return t=n,(a=Mu())!==e&&(m=t,a=di(a)),(t=a)===e&&(t=n,(a=Fu())!==e&&(m=t,a=pi(a)),t=a),t}function Mu(){var t,a;return t=n,(a=Eu())!==e&&(m=t,a=vi(a)),t=a}function Eu(){var t,a,o,s;if(t=n,(a=zt())!==e){for(o=[],s=be();s!==e;)o.push(s),s=be();m=t,t=mi(a,o)}else n=t,t=e;return t}function Ce(){var t,a,o,s;if(t=n,(a=zt())!==e){for(o=[],s=N();s!==e;)o.push(s),s=N();m=t,t=hi(a,o)}else n=t,t=e;return t}function zt(){var t;return Or.test(l.charAt(n))?(t=l.charAt(n),n++):(t=e,f===0&&w(zr)),t}function N(){var t;return xr.test(l.charAt(n))?(t=l.charAt(n),n++):(t=e,f===0&&w(Zr)),t}function be(){var t;return se.test(l.charAt(n))?(t=l.charAt(n),n++):(t=e,f===0&&w(de)),t}function Fu(){var t,a;return t=n,mt()!==e?(a=$u(),mt()!==e?(m=t,t=wi(a)):(n=t,t=e)):(n=t,t=e),t}function $u(){var t,a,o;for(t=n,a=[],o=Ae();o!==e;)a.push(o),o=Ae();return m=t,t=a=Ii(a)}function Ae(){var t;return(t=Pu())===e&&(t=Du()),t}function Du(){var t;return t=n,mt()!==e&&mt()!==e?(m=t,t=gi()):(n=t,t=e),t}function Pu(){var t;return se.test(l.charAt(n))?(t=l.charAt(n),n++):(t=e,f===0&&w(de)),t}function mt(){var t;return Cr.test(l.charAt(n))?(t=l.charAt(n),n++):(t=e,f===0&&w(kr)),t}function Zt(){var t,a,o,s;return t=n,a=n,l.charCodeAt(n)===64?(o=An,n++):(o=e,f===0&&w(Hr)),o!==e&&(s=Ce())!==e?a=o=[o,s]:(n=a,a=e),a!==e&&(m=t,a=yi(a)),t=a}function Lu(){var t,a,o;return t=n,fs()!==e?(p(),V()!==e?(p(),(a=Zu())!==e?(p(),qt()!==e?(p(),(o=P())!==e?(p(),J()!==e?(m=t,t=Ti(a,o)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t}function _u(){var t,a,o,s,g,S,x;return t=n,cs()!==e?(p(),V()!==e?(p(),(a=P())!==e?(p(),qt()!==e?(p(),(o=P())!==e?(p(),s=n,(g=ls())!==e?(S=p(),(x=P())!==e?s=g=[g,S,x,p()]:(n=s,s=e)):(n=s,s=e),s===e&&(s=null),(g=J())!==e?(m=t,t=Ni(a,o,s)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t}function Ru(){var t,a,o;return t=n,hs()!==e?(p(),V()!==e?(p(),(a=P())!==e?(p(),ws()!==e?(p(),(o=Uu())!==e?(p(),J()!==e?(m=t,t=Si(a,o)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t}function Uu(){var t,a,o;return t=n,(a=Is())!==e&&(m=t,a=Oi()),(t=a)===e&&(t=n,(a=gs())!==e&&(m=t,a=xi()),(t=a)===e&&(t=n,(a=ys())!==e&&(m=t,a=Ci()),(t=a)===e&&(t=n,(a=Ts())!==e&&(m=t,a=bi()),(t=a)===e&&(t=n,(a=ze())!==e&&(m=t,a=Ai()),(t=a)===e&&(t=n,(a=Je())!==e&&(m=t,a=Mi()),(t=a)===e&&(t=n,(a=Ze())!==e&&(m=t,a=Ei()),(t=a)===e&&(t=n,(a=Ns())!==e?(p(),V()!==e?(p(),(o=rt())!==e?(p(),J()!==e?(m=t,t=Fi(o)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)))))))),t}function Vu(){var t,a,o,s;return t=n,Ve()!==e?(p(),V()!==e?(p(),(a=Me())===e&&(a=null),p(),(o=P())!==e?(p(),qt()!==e?(p(),(s=P())!==e?(p(),J()!==e?(m=t,t=$i(a,o,s)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,Ve()!==e?(p(),V()!==e?(p(),(a=Me())===e&&(a=null),p(),(o=P())!==e?(p(),J()!==e?(m=t,t=Di(a,o)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)),t}function Me(){var t;return(t=ps())===e&&(t=vs())===e&&(t=ms()),t}function Ju(){var t,a,o;return t=n,ds()!==e?(p(),V()!==e?(p(),(a=P())!==e?(p(),Ht()!==e?(p(),(o=P())!==e?(p(),J()!==e?(m=t,t=Pi(a,o)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t}function zu(){var t,a,o;return t=n,(a=bs())!==e?(p(),V()!==e?(p(),(o=Te())===e&&(o=null),p(),J()!==e?(m=t,t=Li(a,o)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t}function Zu(){var t;return(t=He())===e&&(t=qe())===e&&(t=je())===e&&(t=Ye())===e&&(t=Be())===e&&(t=at())===e&&(t=Os())===e&&(t=xs()),t}function ku(){var t;return(t=kt())===e&&(t=ns())===e&&(t=Ku())===e&&(t=Gu())===e&&(t=Wu())===e&&(t=Hu())===e&&(t=ju())===e&&(t=qu()),t}function Hu(){var t,a;return t=n,Je()!==e?(p(),(a=nt())!==e?(m=t,t=_i(a)):(n=t,t=e)):(n=t,t=e),t}function qu(){var t,a;return t=n,Ze()!==e?(p(),(a=nt())!==e?(m=t,t=Ri(a)):(n=t,t=e)):(n=t,t=e),t}function ju(){var t,a,o,s;return t=n,ke()!==e?(p(),l.charCodeAt(n)===45?(a=Ft,n++):(a=e,f===0&&w(Dt)),a===e&&(l.charCodeAt(n)===43?(a=Et,n++):(a=e,f===0&&w($t))),a!==e?(p(),(o=nt())!==e?(p(),(s=Ee())!==e?(m=t,t=Ui(a,o,s)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,ke()!==e?(p(),(a=nt())!==e?(p(),(o=Ee())!==e?(m=t,t=Vi(a,o)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)),t}function Ee(){var t,a,o;return t=n,(a=Yu())!==e?(p(),Ss()!==e?(p(),(o=Bu())!==e?(m=t,t=Ji(a,o)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=Qu()),t}function Yu(){var t,a,o;return t=n,(a=ut())!==e?(p(),V()!==e?(p(),(o=wt())!==e?(p(),J()!==e?(m=t,t=zi(a,o)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(a=ut())!==e&&(m=t,a=Zi(a)),t=a),t}function Bu(){var t,a,o,s;return t=n,(a=ut())!==e&&(m=t,a=ki(a)),(t=a)===e&&(t=n,(a=at())!==e?(p(),V()!==e?(p(),(o=wt())!==e?(p(),Ot()!==e?(p(),(s=ht())!==e?(p(),J()!==e?(m=t,t=Hi(o,s)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(a=at())!==e?(p(),V()!==e?(p(),(o=wt())!==e?(p(),J()!==e?(m=t,t=qi(o)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(a=at())!==e&&(m=t,a=ji()),t=a))),t}function Qu(){var t,a,o,s;return t=n,(a=ut())!==e?(p(),V()!==e?(p(),(o=ht())!==e?(p(),J()!==e?(m=t,t=Yi(a,o)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(a=ut())!==e&&(m=t,a=Bi(a)),(t=a)===e&&(t=n,(a=at())!==e?(p(),V()!==e?(p(),(o=wt())!==e?(p(),Ot()!==e?(p(),(s=ht())!==e?(p(),J()!==e?(m=t,t=Qi(o,s)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(a=at())!==e?(p(),V()!==e?(p(),(o=ht())!==e?(p(),J()!==e?(m=t,t=Wi(o)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(a=at())!==e&&(m=t,a=Gi()),t=a)))),t}function ut(){var t,a;return t=n,(a=je())!==e&&(m=t,a=Ki()),(t=a)===e&&(t=n,(a=Ye())!==e&&(m=t,a=Xi()),(t=a)===e&&(t=n,(a=Be())!==e&&(m=t,a=to()),(t=a)===e&&(t=n,(a=qe())!==e&&(m=t,a=eo()),(t=a)===e&&(t=n,(a=He())!==e&&(m=t,a=no()),t=a)))),t}function ht(){var t,a;return t=n,(a=rt())!==e&&(m=t,a=ro(a)),t=a}function wt(){var t,a;return t=n,(a=rt())!==e&&(m=t,a=ao(a)),t=a}function Wu(){var t,a;return t=n,ze()!==e?(p(),(a=nt())!==e?(m=t,t=io(a)):(n=t,t=e)):(n=t,t=e),t}function Gu(){var t,a;return t=n,(a=is())!==e&&(m=t,a=oo()),t=a}function Ku(){var t,a;return t=n,(a=os())!==e&&(m=t,a=uo()),(t=a)===e&&(t=n,(a=us())!==e&&(m=t,a=so()),t=a),t}function nt(){var t;return(t=kt())===e&&(t=Zt()),t}function kt(){var t,a,o,s,g;if(t=n,l.charCodeAt(n)===39?(a=ie,n++):(a=e,f===0&&w(pe)),a===e&&(l.substr(n,2)===oe?(a=oe,n+=2):(a=e,f===0&&w(qr))),a!==e){for(o=[],s=n,l.substr(n,2)===dt?(g=dt,n+=2):(g=e,f===0&&w(ve)),g!==e&&(m=s,g=Ie()),(s=g)===e&&(le.test(l.charAt(n))?(s=l.charAt(n),n++):(s=e,f===0&&w(me)));s!==e;)o.push(s),s=n,l.substr(n,2)===dt?(g=dt,n+=2):(g=e,f===0&&w(ve)),g!==e&&(m=s,g=Ie()),(s=g)===e&&(le.test(l.charAt(n))?(s=l.charAt(n),n++):(s=e,f===0&&w(me)));l.charCodeAt(n)===39?(s=ie,n++):(s=e,f===0&&w(pe)),s!==e?(m=t,t=lo(o)):(n=t,t=e)}else n=t,t=e;return t}function Xu(){var t;return(t=ts())===e&&(t=es()),t}function ts(){var t,a,o,s,g;if(t=n,Nt()!==e)if(p(),(a=P())!==e){for(p(),o=[],s=gt();s!==e;)o.push(s),s=gt();s=p(),(g=St())!==e?(m=t,t=co(a,o)):(n=t,t=e)}else n=t,t=e;else n=t,t=e;if(t===e)if(t=n,Nt()!==e)if(p(),(a=P())!==e){for(p(),o=[],s=gt();s!==e;)o.push(s),s=gt();s=p(),(g=Fe())!==e?(p(),St()!==e?(m=t,t=fo(a,o,g)):(n=t,t=e)):(n=t,t=e)}else n=t,t=e;else n=t,t=e;return t}function es(){var t,a,o,s;if(t=n,Nt()!==e){for(p(),a=[],o=It();o!==e;)a.push(o),o=It();o=p(),(s=St())!==e?(m=t,t=po(a)):(n=t,t=e)}else n=t,t=e;if(t===e)if(t=n,Nt()!==e){for(p(),a=[],o=It();o!==e;)a.push(o),o=It();o=p(),(s=Fe())!==e?(p(),St()!==e?(m=t,t=vo(a,s)):(n=t,t=e)):(n=t,t=e)}else n=t,t=e;return t}function It(){var t,a,o;return t=n,Qe()!==e?(p(),(a=P())!==e?(p(),We()!==e?(p(),(o=P())!==e?(m=t,t=mo(a,o)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t}function gt(){var t,a,o;return t=n,Qe()!==e?(p(),(a=P())!==e?(p(),We()!==e?(p(),(o=P())!==e?(m=t,t=ho(a,o)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t}function Fe(){var t,a;return t=n,Cs()!==e?(p(),(a=P())!==e?(m=t,t=wo(a)):(n=t,t=e)):(n=t,t=e),t}function ns(){var t,a,o,s;return t=n,(a=rs())!==e?(o=n,f++,s=zt(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Io(a)):(n=t,t=e)):(n=t,t=e),t}function rs(){var t,a,o,s;return t=n,(a=yt())!==e&&(o=$e())!==e&&(s=De())!==e?(m=t,t=go(a,o,s)):(n=t,t=e),t===e&&(t=n,(a=yt())!==e&&(o=$e())!==e?(m=t,t=yo(a,o)):(n=t,t=e),t===e&&(t=n,(a=yt())!==e&&(o=De())!==e?(m=t,t=To(a,o)):(n=t,t=e),t===e&&(t=n,(a=yt())!==e&&(m=t,a=No(a)),t=a))),t}function yt(){var t,a,o;return(t=rt())===e&&(t=n,l.charCodeAt(n)===45?(a=Ft,n++):(a=e,f===0&&w(Dt)),a===e&&(l.charCodeAt(n)===43?(a=Et,n++):(a=e,f===0&&w($t))),a!==e&&(o=rt())!==e?(m=t,t=So(a,o)):(n=t,t=e)),t}function $e(){var t,a,o;return t=n,l.charCodeAt(n)===46?(a=Mn,n++):(a=e,f===0&&w(jr)),a!==e?((o=rt())===e&&(o=null),m=t,t=Oo(o)):(n=t,t=e),t}function De(){var t,a,o;return t=n,(a=as())!==e&&(o=rt())!==e?(m=t,t=xo(a,o)):(n=t,t=e),t}function rt(){var t,a,o;if(t=n,a=[],(o=Pe())!==e)for(;o!==e;)a.push(o),o=Pe();else a=e;return a!==e&&(m=t,a=Co(a)),t=a}function Pe(){var t;return br.test(l.charAt(n))?(t=l.charAt(n),n++):(t=e,f===0&&w(Yr)),t}function as(){var t,a,o;return t=n,Ar.test(l.charAt(n))?(a=l.charAt(n),n++):(a=e,f===0&&w(Br)),a!==e?(Mr.test(l.charAt(n))?(o=l.charAt(n),n++):(o=e,f===0&&w(Qr)),o===e&&(o=null),m=t,t=bo(a,o)):(n=t,t=e),t}function is(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===En?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(Wr)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?t=a=[a,o]:(n=t,t=e)):(n=t,t=e),t}function os(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===Fn?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(Gr)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?t=a=[a,o]:(n=t,t=e)):(n=t,t=e),t}function us(){var t,a,o,s;return t=n,l.substr(n,5).toLowerCase()===$n?(a=l.substr(n,5),n+=5):(a=e,f===0&&w(Kr)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?t=a=[a,o]:(n=t,t=e)):(n=t,t=e),t}function Ht(){var t,a,o,s;return t=n,l.substr(n,2).toLowerCase()===Dn?(a=l.substr(n,2),n+=2):(a=e,f===0&&w(Xr)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Ao()):(n=t,t=e)):(n=t,t=e),t}function Le(){var t,a,o,s;return t=n,l.substr(n,2).toLowerCase()===Pn?(a=l.substr(n,2),n+=2):(a=e,f===0&&w(ta)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Mo()):(n=t,t=e)):(n=t,t=e),t}function _e(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===Ln?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(ea)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Eo()):(n=t,t=e)):(n=t,t=e),t}function ss(){var t,a,o,s;return t=n,l.substr(n,6).toLowerCase()===_n?(a=l.substr(n,6),n+=6):(a=e,f===0&&w(na)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Fo()):(n=t,t=e)):(n=t,t=e),t}function st(){var t,a,o,s;return t=n,l.substr(n,3).toLowerCase()===Rn?(a=l.substr(n,3),n+=3):(a=e,f===0&&w(ra)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=$o()):(n=t,t=e)):(n=t,t=e),t}function Tt(){var t,a,o,s;return t=n,l.substr(n,3).toLowerCase()===Un?(a=l.substr(n,3),n+=3):(a=e,f===0&&w(aa)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Do()):(n=t,t=e)):(n=t,t=e),t}function Re(){var t,a,o,s;return t=n,l.substr(n,2).toLowerCase()===Vn?(a=l.substr(n,2),n+=2):(a=e,f===0&&w(ia)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Po()):(n=t,t=e)):(n=t,t=e),t}function Ue(){var t,a,o,s;return t=n,l.substr(n,7).toLowerCase()===Jn?(a=l.substr(n,7),n+=7):(a=e,f===0&&w(oa)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Lo()):(n=t,t=e)):(n=t,t=e),t}function qt(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===zn?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(ua)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=_o()):(n=t,t=e)):(n=t,t=e),t}function ls(){var t,a,o,s;return t=n,l.substr(n,3).toLowerCase()===Zn?(a=l.substr(n,3),n+=3):(a=e,f===0&&w(sa)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Ro()):(n=t,t=e)):(n=t,t=e),t}function cs(){var t,a,o,s;return t=n,l.substr(n,9).toLowerCase()===kn?(a=l.substr(n,9),n+=9):(a=e,f===0&&w(la)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Uo()):(n=t,t=e)):(n=t,t=e),t}function fs(){var t,a,o,s;return t=n,l.substr(n,7).toLowerCase()===Hn?(a=l.substr(n,7),n+=7):(a=e,f===0&&w(ca)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Vo()):(n=t,t=e)):(n=t,t=e),t}function Ve(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===qn?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(fa)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Jo()):(n=t,t=e)):(n=t,t=e),t}function ds(){var t,a,o,s;return t=n,l.substr(n,8).toLowerCase()===jn?(a=l.substr(n,8),n+=8):(a=e,f===0&&w(da)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=zo()):(n=t,t=e)):(n=t,t=e),t}function Je(){var t,a,o,s;return t=n,l.substr(n,9).toLowerCase()===Yn?(a=l.substr(n,9),n+=9):(a=e,f===0&&w(pa)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Zo()):(n=t,t=e)):(n=t,t=e),t}function ze(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===Bn?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(va)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=ko()):(n=t,t=e)):(n=t,t=e),t}function Ze(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===Qn?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(ma)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Ho()):(n=t,t=e)):(n=t,t=e),t}function ps(){var t,a,o,s;return t=n,l.substr(n,7).toLowerCase()===Wn?(a=l.substr(n,7),n+=7):(a=e,f===0&&w(ha)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=qo()):(n=t,t=e)):(n=t,t=e),t}function vs(){var t,a,o,s;return t=n,l.substr(n,8).toLowerCase()===Gn?(a=l.substr(n,8),n+=8):(a=e,f===0&&w(wa)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=jo()):(n=t,t=e)):(n=t,t=e),t}function ms(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===Kn?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(Ia)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Yo()):(n=t,t=e)):(n=t,t=e),t}function hs(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===Xn?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(ga)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Bo()):(n=t,t=e)):(n=t,t=e),t}function ws(){var t,a,o,s;return t=n,l.substr(n,2).toLowerCase()===tr?(a=l.substr(n,2),n+=2):(a=e,f===0&&w(ya)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Qo()):(n=t,t=e)):(n=t,t=e),t}function Is(){var t,a,o,s;return t=n,l.substr(n,7).toLowerCase()===er?(a=l.substr(n,7),n+=7):(a=e,f===0&&w(Ta)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Wo()):(n=t,t=e)):(n=t,t=e),t}function gs(){var t,a,o,s;return t=n,l.substr(n,8).toLowerCase()===nr?(a=l.substr(n,8),n+=8):(a=e,f===0&&w(Na)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Go()):(n=t,t=e)):(n=t,t=e),t}function ys(){var t,a,o,s;return t=n,l.substr(n,5).toLowerCase()===rr?(a=l.substr(n,5),n+=5):(a=e,f===0&&w(Sa)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Ko()):(n=t,t=e)):(n=t,t=e),t}function Ts(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===ar?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(Oa)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Xo()):(n=t,t=e)):(n=t,t=e),t}function Ns(){var t,a,o,s;return t=n,l.substr(n,7).toLowerCase()===ir?(a=l.substr(n,7),n+=7):(a=e,f===0&&w(xa)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=tu()):(n=t,t=e)):(n=t,t=e),t}function Ss(){var t,a,o,s;return t=n,l.substr(n,2).toLowerCase()===or?(a=l.substr(n,2),n+=2):(a=e,f===0&&w(Ca)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=eu()):(n=t,t=e)):(n=t,t=e),t}function ke(){var t,a,o,s;return t=n,l.substr(n,8).toLowerCase()===ur?(a=l.substr(n,8),n+=8):(a=e,f===0&&w(ba)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=nu()):(n=t,t=e)):(n=t,t=e),t}function He(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===sr?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(Aa)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=ru()):(n=t,t=e)):(n=t,t=e),t}function Os(){var t,a,o,s;return t=n,l.substr(n,13).toLowerCase()===lr?(a=l.substr(n,13),n+=13):(a=e,f===0&&w(Ma)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=au()):(n=t,t=e)):(n=t,t=e),t}function xs(){var t,a,o,s;return t=n,l.substr(n,15).toLowerCase()===cr?(a=l.substr(n,15),n+=15):(a=e,f===0&&w(Ea)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=iu()):(n=t,t=e)):(n=t,t=e),t}function qe(){var t,a,o,s;return t=n,l.substr(n,5).toLowerCase()===fr?(a=l.substr(n,5),n+=5):(a=e,f===0&&w(Fa)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=ou()):(n=t,t=e)):(n=t,t=e),t}function je(){var t,a,o,s;return t=n,l.substr(n,3).toLowerCase()===dr?(a=l.substr(n,3),n+=3):(a=e,f===0&&w($a)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=uu()):(n=t,t=e)):(n=t,t=e),t}function Ye(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===pr?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(Da)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=su()):(n=t,t=e)):(n=t,t=e),t}function Be(){var t,a,o,s;return t=n,l.substr(n,6).toLowerCase()===vr?(a=l.substr(n,6),n+=6):(a=e,f===0&&w(Pa)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=lu()):(n=t,t=e)):(n=t,t=e),t}function at(){var t,a,o,s;return t=n,l.substr(n,6).toLowerCase()===mr?(a=l.substr(n,6),n+=6):(a=e,f===0&&w(La)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=cu()):(n=t,t=e)):(n=t,t=e),t}function Nt(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===hr?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(_a)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=fu()):(n=t,t=e)):(n=t,t=e),t}function St(){var t,a,o,s;return t=n,l.substr(n,3).toLowerCase()===wr?(a=l.substr(n,3),n+=3):(a=e,f===0&&w(Ra)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=du()):(n=t,t=e)):(n=t,t=e),t}function Qe(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===Ir?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(Ua)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=pu()):(n=t,t=e)):(n=t,t=e),t}function We(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===gr?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(Va)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=vu()):(n=t,t=e)):(n=t,t=e),t}function Cs(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===yr?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(Ja)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=mu()):(n=t,t=e)):(n=t,t=e),t}function Ot(){var t;return l.charCodeAt(n)===44?(t=Tr,n++):(t=e,f===0&&w(za)),t}function V(){var t;return l.charCodeAt(n)===40?(t=Nr,n++):(t=e,f===0&&w(Za)),t}function J(){var t;return l.charCodeAt(n)===41?(t=Sr,n++):(t=e,f===0&&w(ka)),t}function p(){var t,a;for(t=[],a=Ge();a!==e;)t.push(a),a=Ge();return t}function Ge(){var t;return Er.test(l.charAt(n))?(t=l.charAt(n),n++):(t=e,f===0&&w(Ha)),t}function bs(){var t,a,o,s;if(t=n,(a=Ce())!==e&&(m=t,a=hu(a)),(t=a)===e)if(t=n,l.charCodeAt(n)===96?(a=ue,n++):(a=e,f===0&&w(he)),a!==e){if(o=[],ce.test(l.charAt(n))?(s=l.charAt(n),n++):(s=e,f===0&&w(we)),s!==e)for(;s!==e;)o.push(s),ce.test(l.charAt(n))?(s=l.charAt(n),n++):(s=e,f===0&&w(we));else o=e;o!==e?(l.charCodeAt(n)===96?(s=ue,n++):(s=e,f===0&&w(he)),s!==e?(m=t,t=wu(o)):(n=t,t=e)):(n=t,t=e)}else n=t,t=e;return t}function As(t,a){return{type:"unary-expression",operator:t,expr:a}}function Ke(t,a,o,s){var g={type:"binary-expression",operator:t,left:a,right:o};return s!==void 0&&(g.escape=s),g}function Ms(t,a){for(var o=[t],s=0;s `+L+` `+Z+` | diff --git a/assets/WorkerTileHandler-DlTCcd69.js b/assets/WorkerTileHandler-B1--DifF.js similarity index 99% rename from assets/WorkerTileHandler-DlTCcd69.js rename to assets/WorkerTileHandler-B1--DifF.js index 841d902..d715780 100644 --- a/assets/WorkerTileHandler-DlTCcd69.js +++ b/assets/WorkerTileHandler-B1--DifF.js @@ -1,2 +1,2 @@ -import{fm as L,jF as ie,jG as Te,jH as ae,jI as k,jJ as se,jK as Ge,jL as Le,jM as Ae,jN as v,jO as _e,jP as Ve,jQ as ke,iU as Ce,jR as Pe,jS as We,jT as qe,ah as Ye,jU as Ze,jV as we,jW as Je,jX as Y,jY as ye,jZ as Qe,j_ as Xe,j$ as et,k0 as ee,ib as tt,b as $e,k1 as oe,k2 as st}from"./index-CEWggaxV.js";import{t as Se}from"./Rect-CUzevAry.js";import{o as Ee}from"./config-MDUrh2eL.js";import{n as it}from"./pbf-D9QZb8S8.js";import{a as rt,c as nt,C as at,i as ot}from"./TurboLine-CkxIB4ZX.js";import{s as lt,e as ht}from"./SourceLayerData-2rdvzlLE.js";import{i as ve}from"./earcut-hRlx3adE.js";function ct(f){return f===746||f===747||!(f<4352)&&(f>=12704&&f<=12735||f>=12544&&f<=12591||f>=65072&&f<=65103&&!(f>=65097&&f<=65103)||f>=63744&&f<=64255||f>=13056&&f<=13311||f>=11904&&f<=12031||f>=12736&&f<=12783||f>=12288&&f<=12351&&!(f>=12296&&f<=12305||f>=12308&&f<=12319||f===12336)||f>=13312&&f<=19903||f>=19968&&f<=40959||f>=12800&&f<=13055||f>=12592&&f<=12687||f>=43360&&f<=43391||f>=55216&&f<=55295||f>=4352&&f<=4607||f>=44032&&f<=55215||f>=12352&&f<=12447||f>=12272&&f<=12287||f>=12688&&f<=12703||f>=12032&&f<=12255||f>=12784&&f<=12799||f>=12448&&f<=12543&&f!==12540||f>=65280&&f<=65519&&!(f===65288||f===65289||f===65293||f>=65306&&f<=65310||f===65339||f===65341||f===65343||f>=65371&&f<=65503||f===65507||f>=65512&&f<=65519)||f>=65104&&f<=65135&&!(f>=65112&&f<=65118||f>=65123&&f<=65126)||f>=5120&&f<=5759||f>=6320&&f<=6399||f>=65040&&f<=65055||f>=19904&&f<=19967||f>=40960&&f<=42127||f>=42128&&f<=42191)}function ut(f){return!(f<11904)&&(f>=12704&&f<=12735||f>=12544&&f<=12591||f>=65072&&f<=65103||f>=63744&&f<=64255||f>=13056&&f<=13311||f>=11904&&f<=12031||f>=12736&&f<=12783||f>=12288&&f<=12351||f>=13312&&f<=19903||f>=19968&&f<=40959||f>=12800&&f<=13055||f>=65280&&f<=65519||f>=12352&&f<=12447||f>=12272&&f<=12287||f>=12032&&f<=12255||f>=12784&&f<=12799||f>=12448&&f<=12543||f>=65040&&f<=65055||f>=42128&&f<=42191||f>=40960&&f<=42127)}function ft(f){switch(f){case 10:case 32:case 38:case 40:case 41:case 43:case 45:case 47:case 173:case 183:case 8203:case 8208:case 8211:case 8231:return!0}return!1}function Oe(f){switch(f){case 9:case 10:case 11:case 12:case 13:case 32:return!0}return!1}const H=24,je=17;let He=class{constructor(t,e,i,s,n,a,r){this._glyphItems=t,this._maxWidth=e,this._lineHeight=i,this._letterSpacing=s,this._hAnchor=n,this._vAnchor=a,this._justify=r}getShaping(t,e,i){const s=this._letterSpacing,n=this._lineHeight,a=this._justify,r=this._maxWidth,o=[];let l=0,h=0;for(const g of t){const I=g.codePointAt(0);if(I==null)continue;const w=i&&ct(I);let _;for(const P of this._glyphItems)if(_=P[I],_)break;o.push({codePoint:I,x:l,y:h,vertical:w,glyphMosaicItem:_}),_&&(l+=_.metrics.advance+s)}let d=l;r>0&&(d=l/Math.max(1,Math.ceil(l/r)));const u=t.includes("​"),c=[],y=o.length;for(let g=0;gw&&Oe(o[_].codePoint);)o[_].glyphMosaicItem=null,--_;if(w<=_){const P=o[w].x;for(let T=w;T<=_;T++)o[T].x-=P,o[T].y=h;let D=o[_].x;o[_].glyphMosaicItem&&(D+=o[_].glyphMosaicItem.metrics.advance),M=Math.max(D,M),a&&this._applyJustification(o,w,_)}m=I,h+=x}if(o.length>0){const g=p.length-1,I=(a-this._hAnchor)*M;let w=(-this._vAnchor*(g+1)+.5)*n;e&&g&&(w+=g*n);for(const _ of o)_.x+=I,_.y+=w}return o.filter(g=>g.glyphMosaicItem)}static getTextBox(t,e){if(!t.length)return null;let i=1/0,s=1/0,n=0,a=0;for(const r of t){const o=r.glyphMosaicItem.metrics.advance,l=r.x,h=r.y-je,d=l+o,u=h+e;i=Math.min(i,l),n=Math.max(n,d),s=Math.min(s,h),a=Math.max(a,u)}return{x:i,y:s,width:n-i,height:a-s}}static getBox(t){if(!t.length)return null;let e=1/0,i=1/0,s=0,n=0;for(const a of t){const{height:r,left:o,top:l,width:h}=a.glyphMosaicItem.metrics,d=a.x,u=a.y-(r-Math.abs(l)),c=d+h+o,y=u+r;e=Math.min(e,d),s=Math.max(s,c),i=Math.min(i,u),n=Math.max(n,y)}return{x:e,y:i,width:s-e,height:n-i}}static addDecoration(t,e){const i=t.length;if(i===0)return;const s=3;let n=t[0].x+t[0].glyphMosaicItem.metrics.left,a=t[0].y;for(let o=1;o=0&&r,c=s.allowOverlap&&s.ignorePlacement?null:[],y=[],p=4,M=!u;let x=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY,g=x,I=m;const w=(u||r)&&o,_=s.size/H;let P=!1;for(const b of e)if(b.vertical){P=!0;break}let D,T=0,B=0;if(!u&&P){const b=He.getTextBox(e,s.lineHeight*H);switch(s.anchor){case k.LEFT:T=b.height/2,B=-b.width/2;break;case k.RIGHT:T=-b.height/2,B=b.width/2;break;case k.TOP:T=b.height/2,B=b.width/2;break;case k.BOTTOM:T=-b.height/2,B=-b.width/2;break;case k.TOP_LEFT:T=b.height;break;case k.BOTTOM_LEFT:B=-b.width;break;case k.TOP_RIGHT:B=b.width;break;case k.BOTTOM_RIGHT:T=-b.height}}T+=s.offset[0]*H,B+=s.offset[1]*H;for(const b of e){const S=b.glyphMosaicItem;if(!S||S.rect.isEmpty)continue;const V=S.rect,C=S.metrics,O=S.page;if(c&&M){if(D!==void 0&&D!==b.y){let E,F,z,N;P?(E=-I+T,F=x+B,z=I-g,N=m-x):(E=x+T,F=g+B,z=m-x,N=I-g);const G={xTile:t.x,yTile:t.y,dxPixels:E*_-l,dyPixels:F*_-l,hard:!s.optional,partIndex:1,width:z*_+2*l,height:N*_+2*l,angle:a,minLod:X,maxLod:se};c.push(G),x=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY,g=x,I=m}D=b.y}const Z=[];if(u){const E=.5*S.metrics.width,F=(b.x+C.left-p+E)*_*le;if(h=this._placeGlyph(t,h,F,i,t.segment,1,b.vertical,O,Z),o&&(h=this._placeGlyph(t,h,F,i,t.segment,-1,b.vertical,O,Z)),h>=be)break}else Z.push(new pe(n,d,d,O,!1)),r&&o&&Z.push(new pe(n,d+ae,d+ae,O,!1));const $=b.x+C.left,W=b.y-je-C.top,J=$+C.width,Ie=W+C.height;let R,j,he,ce,Q,ue,De,Be;if(!u&&P)if(b.vertical){const E=($+J)/2-C.height/2,F=(W+Ie)/2+C.width/2;R=new L(-F-p+T,E-p+B),j=new L(R.x+V.width,R.y+V.height),he=new L(R.x,j.y),ce=new L(j.x,R.y)}else R=new L(-W+p+T,$-p+B),j=new L(R.x-V.height,R.y+V.width),he=new L(j.x,R.y),ce=new L(R.x,j.y);else R=new L($-p+T,W-p+B),j=new L(R.x+V.width,R.y+V.height),he=new L(R.x,j.y),ce=new L(j.x,R.y);for(const E of Z){let F,z,N,G;if(E.alternateVerticalGlyph){if(!Q){const q=(W+Ie)/2+B;Q=new L(($+J)/2+T-C.height/2-p,q+C.width/2+p),ue=new L(Q.x+V.height,Q.y-V.width),De=new L(ue.x,Q.y),Be=new L(Q.x,ue.y)}F=Q,z=De,N=Be,G=ue}else F=R,z=he,N=ce,G=j;const fe=W,Me=Ie,de=E.glyphAngle+a;if(de!==0){const q=Math.cos(de),xe=Math.sin(de);F=F.clone(),z=z==null?void 0:z.clone(),N=N==null?void 0:N.clone(),G=G==null?void 0:G.clone(),F.rotate(q,xe),G==null||G.rotate(q,xe),z==null||z.rotate(q,xe),N==null||N.rotate(q,xe)}let re=0,ne=256;if(u&&P?b.vertical?E.alternateVerticalGlyph?(re=32,ne=96):(re=224,ne=32):(re=224,ne=96):(re=192,ne=64),y.push(new Fe(F,N,z,G,V,E.labelAngle,re,ne,E.anchor,E.minzoom,E.maxzoom,E.page)),c&&(!w||this._legible(E.labelAngle))){if(M)$m&&(m=J),Me>I&&(I=Me);else if(E.minzoom=be)return null;if(c&&M){let b,S,V,C;P?(b=-I+T,S=x+B,V=I-g,C=m-x):(b=x+T,S=g+B,V=m-x,C=I-g);const O={xTile:t.x,yTile:t.y,dxPixels:b*_-l,dyPixels:S*_-l,hard:!s.optional,partIndex:1,width:V*_+2*l,height:C*_+2*l,angle:a,minLod:X,maxLod:se};c.push(O)}const A=new ze(y);return c&&c.length>0&&(A.textColliders=c),A}_legible(t){const e=Ge(t);return e<65||e>=193}_placeGlyph(t,e,i,s,n,a,r,o,l){let h=a;const d=h<0?Le(t.angle+ae,Ae):t.angle;let u=0;i<0&&(h*=-1,i*=-1,u=ae),h>0&&++n;let c=new L(t.x,t.y),y=s[n],p=se;if(s.length<=n)return p;for(;;){const M=y.x-c.x,x=y.y-c.y,m=Math.sqrt(M*M+x*x),g=Math.max(i/m,e),I=M/m,w=x/m,_=Le(Math.atan2(w,I)+u,Ae);if(l.push(new pe(c,d,_,o,!1,g,p)),r&&l.push(new pe(c,d,_,o,!0,g,p)),g<=e)return g;c=y.clone();do{if(n+=h,s.length<=n||n<0)return g;y=s[n]}while(c.isEqual(y));let P=y.x-c.x,D=y.y-c.y;const T=Math.sqrt(P*P+D*D);P*=m/T,D*=m/T,c.x-=P,c.y-=D,p=g}}},te=class extends v{constructor(){super(12)}add(t,e,i){const s=this.array;s.push(t),s.push(e),s.push(i)}},xt=class extends v{constructor(t){super(t)}add(t,e,i,s,n,a,r,o,l,h,d,u){const c=this.array;let y=v.i1616to32(t,e);c.push(y);const p=31;y=v.i8888to32(Math.round(p*i),Math.round(p*s),Math.round(p*n),Math.round(p*a)),c.push(y),y=v.i8888to32(Math.round(p*r),Math.round(p*o),Math.round(p*l),Math.round(p*h)),c.push(y),y=v.i1616to32(d,0),c.push(y),u&&c.push(...u)}},yt=class extends v{constructor(t){super(t)}add(t,e,i){const s=this.array;s.push(v.i1616to32(t,e)),i&&s.push(...i)}};class gt extends v{constructor(t){super(t)}add(t,e,i,s,n,a,r){const o=this.array,l=this.index;let h=v.i1616to32(t,e);o.push(h);const d=15;return h=v.i8888to32(Math.round(d*i),Math.round(d*s),n,a),o.push(h),r&&o.push(...r),l}}class Ne extends v{constructor(t){super(t)}add(t,e,i,s,n,a,r,o,l,h,d,u){const c=this.array;let y=v.i1616to32(t,e);c.push(y),y=v.i1616to32(Math.round(8*i),Math.round(8*s)),c.push(y),y=v.i8888to32(n/4,a/4,o,l),c.push(y),y=v.i8888to32(0,Ge(r),10*h,Math.min(10*d,255)),c.push(y),u&&c.push(...u)}}class pt extends v{constructor(t){super(t)}add(t,e,i,s,n){const a=this.array,r=v.i1616to32(2*t+i,2*e+s);a.push(r),n&&a.push(...n)}}class me{constructor(t,e,i){this.layerExtent=4096,this._features=[],this.layer=t,this.zoom=e,this._spriteInfo=i,this._filter=t.getFeatureFilter()}pushFeature(t){this._filter&&!this._filter.filter(t,this.zoom)||this._features.push(t)}hasFeatures(){return this._features.length>0}getResources(t,e,i){}}let _t=class extends me{constructor(t,e,i,s,n){super(t,e,i),this.type=_e.CIRCLE,this._circleVertexBuffer=s,this._circleIndexBuffer=n}get circleIndexStart(){return this._circleIndexStart}get circleIndexCount(){return this._circleIndexCount}processFeatures(t){const e=this._circleVertexBuffer,i=this._circleIndexBuffer;this._circleIndexStart=3*i.index,this._circleIndexCount=0;const s=this.layer,n=this.zoom;t&&t.setExtent(this.layerExtent);for(const a of this._features){const r=a.getGeometry(t);if(!r)continue;const o=s.circleMaterial.encodeAttributes(a,n,s);for(const l of r)if(l)for(const h of l){const d=e.index;e.add(h.x,h.y,0,0,o),e.add(h.x,h.y,0,1,o),e.add(h.x,h.y,1,0,o),e.add(h.x,h.y,1,1,o),i.add(d,d+1,d+2),i.add(d+1,d+2,d+3),this._circleIndexCount+=6}}}serialize(){let t=6;t+=this.layerUIDs.length,t+=this._circleVertexBuffer.array.length,t+=this._circleIndexBuffer.array.length;const e=new Uint32Array(t),i=new Int32Array(e.buffer);let s=0;e[s++]=this.type,e[s++]=this.layerUIDs.length;for(let n=0;nI.page-w.page);for(const{ddFillAttributes:I,ddOutlineAttributes:w,page:_,geometry:P}of c)this._processFeature(P,h,e.outlineUsesFillColor,I,w,u,_)}}else for(const c of d){const y=a?s.encodeAttributes(c,i,e):null,p=h&&r?n.encodeAttributes(c,i,e):null,M=c.getGeometry(t);this._processFeature(M,h,e.outlineUsesFillColor,y,p,u)}}serialize(){let t=10;t+=this.layerUIDs.length,t+=this._fillVertexBuffer.array.length,t+=this._fillIndexBuffer.array.length,t+=this._outlineVertexBuffer.array.length,t+=this._outlineIndexBuffer.array.length,t+=3*this._patternMap.size+1;const e=new Uint32Array(t),i=new Int32Array(e.buffer);let s=0;e[s++]=this.type,e[s++]=this.layerUIDs.length;for(let r=0;r0)for(const[r,[o,l]]of n)e[s++]=r,e[s++]=o,e[s++]=l;e[s++]=this._fillVertexBuffer.array.length;for(let r=0;rh?(d!==void 0&&this._processFill(t,d,s,a,r),d=[u]):c<-h&&d!==void 0&&d.push(u)}d!==void 0&&this._processFill(t,d,s,a,r)}_processOutline(t,e){const i=this._outlineVertexBuffer,s=this._outlineIndexBuffer,n=s.index;let a,r,o;const l=new L(0,0),h=new L(0,0),d=new L(0,0);let u=-1,c=-1,y=-1,p=-1,M=-1,x=!1;const m=0;let g=t.length;if(g<2)return;const I=t[m];let w=t[g-1];for(;g&&w.isEqual(I);)--g,w=t[g-1];if(!(g-m<2)){for(let _=m;_8&&(B=8),D>=0?(y=i.add(r.x,r.y,l.x,l.y,0,1,e),p===-1&&(p=y),u>=0&&c>=0&&y>=0&&!P&&s.add(u,c,y),c=i.add(r.x,r.y,B*-d.x,B*-d.y,0,-1,e),M===-1&&(M=c),u>=0&&c>=0&&y>=0&&!P&&s.add(u,c,y),u=c,c=y,y=i.add(r.x,r.y,d.x,d.y,0,1,e),u>=0&&c>=0&&y>=0&&!P&&s.add(u,c,y),c=i.add(r.x,r.y,h.x,h.y,0,1,e),u>=0&&c>=0&&y>=0&&!P&&s.add(u,c,y)):(y=i.add(r.x,r.y,B*d.x,B*d.y,0,1,e),p===-1&&(p=y),u>=0&&c>=0&&y>=0&&!P&&s.add(u,c,y),c=i.add(r.x,r.y,-l.x,-l.y,0,-1,e),M===-1&&(M=c),u>=0&&c>=0&&y>=0&&!P&&s.add(u,c,y),u=c,c=y,y=i.add(r.x,r.y,-d.x,-d.y,0,-1,e),u>=0&&c>=0&&y>=0&&!P&&s.add(u,c,y),u=i.add(r.x,r.y,-h.x,-h.y,0,-1,e),u>=0&&c>=0&&y>=0&&!P&&s.add(u,c,y))}u>=0&&c>=0&&p>=0&&!x&&s.add(u,c,p),u>=0&&p>=0&&M>=0&&!x&&s.add(u,M,p),this._outlineIndexCount+=3*(s.index-n)}}_processFill(t,e,i,s,n){s=!0;let a;e.length>1&&(a=[]);let r=0;for(const d of e)r!==0&&a.push(r),r+=t[d].length;const o=2*r,l=Ve.acquire();for(const d of e){const u=t[d],c=u.length;for(let y=0;y0){const d=e.map(y=>t[y].length),{buffer:u,vertexCount:c}=rt(l,d);if(c>0){const y=this._fillVertexBuffer.index;for(let p=0;p0){const u=this._fillVertexBuffer.index;let c=0;for(;c=4160:t.y===e.y&&(t.y<=-64||t.y>=4160)}static _area(t){let e=0;const i=t.length-1;for(let s=0;sb.page-S.page),n.textured=!0;for(const{ddAttributes:b,page:S,cap:V,join:C,miterLimit:O,roundLimit:Z,halfWidth:$,offset:W,geometry:J}of A)n.capType=V,n.joinType=C,n.miterLimit=O,n.roundLimit=Z,n.halfWidth=$,n.offset=W,this._processFeature(J,b,S)}else{if(o){const A=o.getValue(i),b=this._spriteInfo[A];if(!(b!=null&&b.rect))return}n.textured=!(!o&&!l),n.capType=y,n.joinType=m,n.miterLimit=I,n.roundLimit=_,n.halfWidth=.5*D,n.offset=B;for(const A of s){const b=a?r.encodeAttributes(A,i,e):null;c&&(n.capType=c.getValue(i,A)),x&&(n.joinType=x.getValue(i,A)),g&&(n.miterLimit=g.getValue(i,A)),w&&(n.roundLimit=w.getValue(i,A)),P&&(n.halfWidth=.5*P.getValue(i,A)),T&&(n.offset=T.getValue(i,A));const S=A.getGeometry(t);this._processFeature(S,b)}}}serialize(){let t=6;t+=this.layerUIDs.length,t+=this.tessellationProperties._lineVertexBuffer.array.length,t+=this.tessellationProperties._lineIndexBuffer.array.length,t+=3*this._patternMap.size+1;const e=new Uint32Array(t),i=new Int32Array(e.buffer);let s=0;e[s++]=this.type,e[s++]=this.layerUIDs.length;for(let r=0;r0)for(const[r,[o,l]]of n)e[s++]=r,e[s++]=o,e[s++]=l;e[s++]=this.tessellationProperties._lineVertexBuffer.array.length;for(let r=0;r(t,e,i,s,n,a,r,o,l,h,d)=>(f._lineVertexBuffer.add(t,e,r,o,i,s,n,a,l,h,d,f._ddValues),f._lineVertexBuffer.index-1),wt=f=>(t,e,i)=>{f._lineIndexBuffer.add(t,e,i)},Ue=10;function bt(f,t){return f.iconMosaicItem&&t.iconMosaicItem?f.iconMosaicItem.page===t.iconMosaicItem.page?0:f.iconMosaicItem.page-t.iconMosaicItem.page:f.iconMosaicItem&&!t.iconMosaicItem?1:!f.iconMosaicItem&&t.iconMosaicItem?-1:0}class U extends me{constructor(t,e,i,s,n,a,r,o,l){super(e,i,l.getSpriteItems()),this.type=_e.SYMBOL,this._markerMap=new Map,this._glyphMap=new Map,this._glyphBufferDataStorage=new Map,this._isIconSDF=!1,this._sourceTileKey=t,this._iconVertexBuffer=s,this._iconIndexBuffer=n,this._textVertexBuffer=a,this._textIndexBuffer=r,this._placementEngine=o,this._workerTileHandler=l}get markerPageMap(){return this._markerMap}get glyphsPageMap(){return this._glyphMap}get symbolInstances(){return this._symbolInstances}getResources(t,e,i){const s=this.layer,n=this.zoom;t&&t.setExtent(this.layerExtent);const a=s.getLayoutProperty("icon-image"),r=s.getLayoutProperty("text-field");let o=s.getLayoutProperty("text-transform"),l=s.getLayoutProperty("text-font");const h=[];let d,u,c,y;a&&!a.isDataDriven&&(d=a.getValue(n)),r&&!r.isDataDriven&&(u=r.getValue(n)),o&&o.isDataDriven||(c=s.getLayoutValue("text-transform",n),o=null),l&&l.isDataDriven||(y=s.getLayoutValue("text-font",n),l=null);for(const p of this._features){const M=p.getGeometry(t);if(!M||M.length===0)continue;let x,m;a&&(x=a.isDataDriven?a.getValue(n,p):this._replaceKeys(d,p.values),x&&e(x));let g=!1;if(r&&(m=r.isDataDriven?r.getValue(n,p):this._replaceKeys(u,p.values),m)){switch(m=m.replaceAll("\\n",` +import{fm as L,jF as ie,jG as Te,jH as ae,jI as k,jJ as se,jK as Ge,jL as Le,jM as Ae,jN as v,jO as _e,jP as Ve,jQ as ke,iU as Ce,jR as Pe,jS as We,jT as qe,ah as Ye,jU as Ze,jV as we,jW as Je,jX as Y,jY as ye,jZ as Qe,j_ as Xe,j$ as et,k0 as ee,ib as tt,b as $e,k1 as oe,k2 as st}from"./index-BjUNJPVf.js";import{t as Se}from"./Rect-CUzevAry.js";import{o as Ee}from"./config-MDUrh2eL.js";import{n as it}from"./pbf-Du8sFEWo.js";import{a as rt,c as nt,C as at,i as ot}from"./TurboLine-DNQdPIXo.js";import{s as lt,e as ht}from"./SourceLayerData-CTiUdlGY.js";import{i as ve}from"./earcut-CWKXDqDj.js";function ct(f){return f===746||f===747||!(f<4352)&&(f>=12704&&f<=12735||f>=12544&&f<=12591||f>=65072&&f<=65103&&!(f>=65097&&f<=65103)||f>=63744&&f<=64255||f>=13056&&f<=13311||f>=11904&&f<=12031||f>=12736&&f<=12783||f>=12288&&f<=12351&&!(f>=12296&&f<=12305||f>=12308&&f<=12319||f===12336)||f>=13312&&f<=19903||f>=19968&&f<=40959||f>=12800&&f<=13055||f>=12592&&f<=12687||f>=43360&&f<=43391||f>=55216&&f<=55295||f>=4352&&f<=4607||f>=44032&&f<=55215||f>=12352&&f<=12447||f>=12272&&f<=12287||f>=12688&&f<=12703||f>=12032&&f<=12255||f>=12784&&f<=12799||f>=12448&&f<=12543&&f!==12540||f>=65280&&f<=65519&&!(f===65288||f===65289||f===65293||f>=65306&&f<=65310||f===65339||f===65341||f===65343||f>=65371&&f<=65503||f===65507||f>=65512&&f<=65519)||f>=65104&&f<=65135&&!(f>=65112&&f<=65118||f>=65123&&f<=65126)||f>=5120&&f<=5759||f>=6320&&f<=6399||f>=65040&&f<=65055||f>=19904&&f<=19967||f>=40960&&f<=42127||f>=42128&&f<=42191)}function ut(f){return!(f<11904)&&(f>=12704&&f<=12735||f>=12544&&f<=12591||f>=65072&&f<=65103||f>=63744&&f<=64255||f>=13056&&f<=13311||f>=11904&&f<=12031||f>=12736&&f<=12783||f>=12288&&f<=12351||f>=13312&&f<=19903||f>=19968&&f<=40959||f>=12800&&f<=13055||f>=65280&&f<=65519||f>=12352&&f<=12447||f>=12272&&f<=12287||f>=12032&&f<=12255||f>=12784&&f<=12799||f>=12448&&f<=12543||f>=65040&&f<=65055||f>=42128&&f<=42191||f>=40960&&f<=42127)}function ft(f){switch(f){case 10:case 32:case 38:case 40:case 41:case 43:case 45:case 47:case 173:case 183:case 8203:case 8208:case 8211:case 8231:return!0}return!1}function Oe(f){switch(f){case 9:case 10:case 11:case 12:case 13:case 32:return!0}return!1}const H=24,je=17;let He=class{constructor(t,e,i,s,n,a,r){this._glyphItems=t,this._maxWidth=e,this._lineHeight=i,this._letterSpacing=s,this._hAnchor=n,this._vAnchor=a,this._justify=r}getShaping(t,e,i){const s=this._letterSpacing,n=this._lineHeight,a=this._justify,r=this._maxWidth,o=[];let l=0,h=0;for(const g of t){const I=g.codePointAt(0);if(I==null)continue;const w=i&&ct(I);let _;for(const P of this._glyphItems)if(_=P[I],_)break;o.push({codePoint:I,x:l,y:h,vertical:w,glyphMosaicItem:_}),_&&(l+=_.metrics.advance+s)}let d=l;r>0&&(d=l/Math.max(1,Math.ceil(l/r)));const u=t.includes("​"),c=[],y=o.length;for(let g=0;gw&&Oe(o[_].codePoint);)o[_].glyphMosaicItem=null,--_;if(w<=_){const P=o[w].x;for(let T=w;T<=_;T++)o[T].x-=P,o[T].y=h;let D=o[_].x;o[_].glyphMosaicItem&&(D+=o[_].glyphMosaicItem.metrics.advance),M=Math.max(D,M),a&&this._applyJustification(o,w,_)}m=I,h+=x}if(o.length>0){const g=p.length-1,I=(a-this._hAnchor)*M;let w=(-this._vAnchor*(g+1)+.5)*n;e&&g&&(w+=g*n);for(const _ of o)_.x+=I,_.y+=w}return o.filter(g=>g.glyphMosaicItem)}static getTextBox(t,e){if(!t.length)return null;let i=1/0,s=1/0,n=0,a=0;for(const r of t){const o=r.glyphMosaicItem.metrics.advance,l=r.x,h=r.y-je,d=l+o,u=h+e;i=Math.min(i,l),n=Math.max(n,d),s=Math.min(s,h),a=Math.max(a,u)}return{x:i,y:s,width:n-i,height:a-s}}static getBox(t){if(!t.length)return null;let e=1/0,i=1/0,s=0,n=0;for(const a of t){const{height:r,left:o,top:l,width:h}=a.glyphMosaicItem.metrics,d=a.x,u=a.y-(r-Math.abs(l)),c=d+h+o,y=u+r;e=Math.min(e,d),s=Math.max(s,c),i=Math.min(i,u),n=Math.max(n,y)}return{x:e,y:i,width:s-e,height:n-i}}static addDecoration(t,e){const i=t.length;if(i===0)return;const s=3;let n=t[0].x+t[0].glyphMosaicItem.metrics.left,a=t[0].y;for(let o=1;o=0&&r,c=s.allowOverlap&&s.ignorePlacement?null:[],y=[],p=4,M=!u;let x=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY,g=x,I=m;const w=(u||r)&&o,_=s.size/H;let P=!1;for(const b of e)if(b.vertical){P=!0;break}let D,T=0,B=0;if(!u&&P){const b=He.getTextBox(e,s.lineHeight*H);switch(s.anchor){case k.LEFT:T=b.height/2,B=-b.width/2;break;case k.RIGHT:T=-b.height/2,B=b.width/2;break;case k.TOP:T=b.height/2,B=b.width/2;break;case k.BOTTOM:T=-b.height/2,B=-b.width/2;break;case k.TOP_LEFT:T=b.height;break;case k.BOTTOM_LEFT:B=-b.width;break;case k.TOP_RIGHT:B=b.width;break;case k.BOTTOM_RIGHT:T=-b.height}}T+=s.offset[0]*H,B+=s.offset[1]*H;for(const b of e){const S=b.glyphMosaicItem;if(!S||S.rect.isEmpty)continue;const V=S.rect,C=S.metrics,O=S.page;if(c&&M){if(D!==void 0&&D!==b.y){let E,F,z,N;P?(E=-I+T,F=x+B,z=I-g,N=m-x):(E=x+T,F=g+B,z=m-x,N=I-g);const G={xTile:t.x,yTile:t.y,dxPixels:E*_-l,dyPixels:F*_-l,hard:!s.optional,partIndex:1,width:z*_+2*l,height:N*_+2*l,angle:a,minLod:X,maxLod:se};c.push(G),x=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY,g=x,I=m}D=b.y}const Z=[];if(u){const E=.5*S.metrics.width,F=(b.x+C.left-p+E)*_*le;if(h=this._placeGlyph(t,h,F,i,t.segment,1,b.vertical,O,Z),o&&(h=this._placeGlyph(t,h,F,i,t.segment,-1,b.vertical,O,Z)),h>=be)break}else Z.push(new pe(n,d,d,O,!1)),r&&o&&Z.push(new pe(n,d+ae,d+ae,O,!1));const $=b.x+C.left,W=b.y-je-C.top,J=$+C.width,Ie=W+C.height;let R,j,he,ce,Q,ue,De,Be;if(!u&&P)if(b.vertical){const E=($+J)/2-C.height/2,F=(W+Ie)/2+C.width/2;R=new L(-F-p+T,E-p+B),j=new L(R.x+V.width,R.y+V.height),he=new L(R.x,j.y),ce=new L(j.x,R.y)}else R=new L(-W+p+T,$-p+B),j=new L(R.x-V.height,R.y+V.width),he=new L(j.x,R.y),ce=new L(R.x,j.y);else R=new L($-p+T,W-p+B),j=new L(R.x+V.width,R.y+V.height),he=new L(R.x,j.y),ce=new L(j.x,R.y);for(const E of Z){let F,z,N,G;if(E.alternateVerticalGlyph){if(!Q){const q=(W+Ie)/2+B;Q=new L(($+J)/2+T-C.height/2-p,q+C.width/2+p),ue=new L(Q.x+V.height,Q.y-V.width),De=new L(ue.x,Q.y),Be=new L(Q.x,ue.y)}F=Q,z=De,N=Be,G=ue}else F=R,z=he,N=ce,G=j;const fe=W,Me=Ie,de=E.glyphAngle+a;if(de!==0){const q=Math.cos(de),xe=Math.sin(de);F=F.clone(),z=z==null?void 0:z.clone(),N=N==null?void 0:N.clone(),G=G==null?void 0:G.clone(),F.rotate(q,xe),G==null||G.rotate(q,xe),z==null||z.rotate(q,xe),N==null||N.rotate(q,xe)}let re=0,ne=256;if(u&&P?b.vertical?E.alternateVerticalGlyph?(re=32,ne=96):(re=224,ne=32):(re=224,ne=96):(re=192,ne=64),y.push(new Fe(F,N,z,G,V,E.labelAngle,re,ne,E.anchor,E.minzoom,E.maxzoom,E.page)),c&&(!w||this._legible(E.labelAngle))){if(M)$m&&(m=J),Me>I&&(I=Me);else if(E.minzoom=be)return null;if(c&&M){let b,S,V,C;P?(b=-I+T,S=x+B,V=I-g,C=m-x):(b=x+T,S=g+B,V=m-x,C=I-g);const O={xTile:t.x,yTile:t.y,dxPixels:b*_-l,dyPixels:S*_-l,hard:!s.optional,partIndex:1,width:V*_+2*l,height:C*_+2*l,angle:a,minLod:X,maxLod:se};c.push(O)}const A=new ze(y);return c&&c.length>0&&(A.textColliders=c),A}_legible(t){const e=Ge(t);return e<65||e>=193}_placeGlyph(t,e,i,s,n,a,r,o,l){let h=a;const d=h<0?Le(t.angle+ae,Ae):t.angle;let u=0;i<0&&(h*=-1,i*=-1,u=ae),h>0&&++n;let c=new L(t.x,t.y),y=s[n],p=se;if(s.length<=n)return p;for(;;){const M=y.x-c.x,x=y.y-c.y,m=Math.sqrt(M*M+x*x),g=Math.max(i/m,e),I=M/m,w=x/m,_=Le(Math.atan2(w,I)+u,Ae);if(l.push(new pe(c,d,_,o,!1,g,p)),r&&l.push(new pe(c,d,_,o,!0,g,p)),g<=e)return g;c=y.clone();do{if(n+=h,s.length<=n||n<0)return g;y=s[n]}while(c.isEqual(y));let P=y.x-c.x,D=y.y-c.y;const T=Math.sqrt(P*P+D*D);P*=m/T,D*=m/T,c.x-=P,c.y-=D,p=g}}},te=class extends v{constructor(){super(12)}add(t,e,i){const s=this.array;s.push(t),s.push(e),s.push(i)}},xt=class extends v{constructor(t){super(t)}add(t,e,i,s,n,a,r,o,l,h,d,u){const c=this.array;let y=v.i1616to32(t,e);c.push(y);const p=31;y=v.i8888to32(Math.round(p*i),Math.round(p*s),Math.round(p*n),Math.round(p*a)),c.push(y),y=v.i8888to32(Math.round(p*r),Math.round(p*o),Math.round(p*l),Math.round(p*h)),c.push(y),y=v.i1616to32(d,0),c.push(y),u&&c.push(...u)}},yt=class extends v{constructor(t){super(t)}add(t,e,i){const s=this.array;s.push(v.i1616to32(t,e)),i&&s.push(...i)}};class gt extends v{constructor(t){super(t)}add(t,e,i,s,n,a,r){const o=this.array,l=this.index;let h=v.i1616to32(t,e);o.push(h);const d=15;return h=v.i8888to32(Math.round(d*i),Math.round(d*s),n,a),o.push(h),r&&o.push(...r),l}}class Ne extends v{constructor(t){super(t)}add(t,e,i,s,n,a,r,o,l,h,d,u){const c=this.array;let y=v.i1616to32(t,e);c.push(y),y=v.i1616to32(Math.round(8*i),Math.round(8*s)),c.push(y),y=v.i8888to32(n/4,a/4,o,l),c.push(y),y=v.i8888to32(0,Ge(r),10*h,Math.min(10*d,255)),c.push(y),u&&c.push(...u)}}class pt extends v{constructor(t){super(t)}add(t,e,i,s,n){const a=this.array,r=v.i1616to32(2*t+i,2*e+s);a.push(r),n&&a.push(...n)}}class me{constructor(t,e,i){this.layerExtent=4096,this._features=[],this.layer=t,this.zoom=e,this._spriteInfo=i,this._filter=t.getFeatureFilter()}pushFeature(t){this._filter&&!this._filter.filter(t,this.zoom)||this._features.push(t)}hasFeatures(){return this._features.length>0}getResources(t,e,i){}}let _t=class extends me{constructor(t,e,i,s,n){super(t,e,i),this.type=_e.CIRCLE,this._circleVertexBuffer=s,this._circleIndexBuffer=n}get circleIndexStart(){return this._circleIndexStart}get circleIndexCount(){return this._circleIndexCount}processFeatures(t){const e=this._circleVertexBuffer,i=this._circleIndexBuffer;this._circleIndexStart=3*i.index,this._circleIndexCount=0;const s=this.layer,n=this.zoom;t&&t.setExtent(this.layerExtent);for(const a of this._features){const r=a.getGeometry(t);if(!r)continue;const o=s.circleMaterial.encodeAttributes(a,n,s);for(const l of r)if(l)for(const h of l){const d=e.index;e.add(h.x,h.y,0,0,o),e.add(h.x,h.y,0,1,o),e.add(h.x,h.y,1,0,o),e.add(h.x,h.y,1,1,o),i.add(d,d+1,d+2),i.add(d+1,d+2,d+3),this._circleIndexCount+=6}}}serialize(){let t=6;t+=this.layerUIDs.length,t+=this._circleVertexBuffer.array.length,t+=this._circleIndexBuffer.array.length;const e=new Uint32Array(t),i=new Int32Array(e.buffer);let s=0;e[s++]=this.type,e[s++]=this.layerUIDs.length;for(let n=0;nI.page-w.page);for(const{ddFillAttributes:I,ddOutlineAttributes:w,page:_,geometry:P}of c)this._processFeature(P,h,e.outlineUsesFillColor,I,w,u,_)}}else for(const c of d){const y=a?s.encodeAttributes(c,i,e):null,p=h&&r?n.encodeAttributes(c,i,e):null,M=c.getGeometry(t);this._processFeature(M,h,e.outlineUsesFillColor,y,p,u)}}serialize(){let t=10;t+=this.layerUIDs.length,t+=this._fillVertexBuffer.array.length,t+=this._fillIndexBuffer.array.length,t+=this._outlineVertexBuffer.array.length,t+=this._outlineIndexBuffer.array.length,t+=3*this._patternMap.size+1;const e=new Uint32Array(t),i=new Int32Array(e.buffer);let s=0;e[s++]=this.type,e[s++]=this.layerUIDs.length;for(let r=0;r0)for(const[r,[o,l]]of n)e[s++]=r,e[s++]=o,e[s++]=l;e[s++]=this._fillVertexBuffer.array.length;for(let r=0;rh?(d!==void 0&&this._processFill(t,d,s,a,r),d=[u]):c<-h&&d!==void 0&&d.push(u)}d!==void 0&&this._processFill(t,d,s,a,r)}_processOutline(t,e){const i=this._outlineVertexBuffer,s=this._outlineIndexBuffer,n=s.index;let a,r,o;const l=new L(0,0),h=new L(0,0),d=new L(0,0);let u=-1,c=-1,y=-1,p=-1,M=-1,x=!1;const m=0;let g=t.length;if(g<2)return;const I=t[m];let w=t[g-1];for(;g&&w.isEqual(I);)--g,w=t[g-1];if(!(g-m<2)){for(let _=m;_8&&(B=8),D>=0?(y=i.add(r.x,r.y,l.x,l.y,0,1,e),p===-1&&(p=y),u>=0&&c>=0&&y>=0&&!P&&s.add(u,c,y),c=i.add(r.x,r.y,B*-d.x,B*-d.y,0,-1,e),M===-1&&(M=c),u>=0&&c>=0&&y>=0&&!P&&s.add(u,c,y),u=c,c=y,y=i.add(r.x,r.y,d.x,d.y,0,1,e),u>=0&&c>=0&&y>=0&&!P&&s.add(u,c,y),c=i.add(r.x,r.y,h.x,h.y,0,1,e),u>=0&&c>=0&&y>=0&&!P&&s.add(u,c,y)):(y=i.add(r.x,r.y,B*d.x,B*d.y,0,1,e),p===-1&&(p=y),u>=0&&c>=0&&y>=0&&!P&&s.add(u,c,y),c=i.add(r.x,r.y,-l.x,-l.y,0,-1,e),M===-1&&(M=c),u>=0&&c>=0&&y>=0&&!P&&s.add(u,c,y),u=c,c=y,y=i.add(r.x,r.y,-d.x,-d.y,0,-1,e),u>=0&&c>=0&&y>=0&&!P&&s.add(u,c,y),u=i.add(r.x,r.y,-h.x,-h.y,0,-1,e),u>=0&&c>=0&&y>=0&&!P&&s.add(u,c,y))}u>=0&&c>=0&&p>=0&&!x&&s.add(u,c,p),u>=0&&p>=0&&M>=0&&!x&&s.add(u,M,p),this._outlineIndexCount+=3*(s.index-n)}}_processFill(t,e,i,s,n){s=!0;let a;e.length>1&&(a=[]);let r=0;for(const d of e)r!==0&&a.push(r),r+=t[d].length;const o=2*r,l=Ve.acquire();for(const d of e){const u=t[d],c=u.length;for(let y=0;y0){const d=e.map(y=>t[y].length),{buffer:u,vertexCount:c}=rt(l,d);if(c>0){const y=this._fillVertexBuffer.index;for(let p=0;p0){const u=this._fillVertexBuffer.index;let c=0;for(;c=4160:t.y===e.y&&(t.y<=-64||t.y>=4160)}static _area(t){let e=0;const i=t.length-1;for(let s=0;sb.page-S.page),n.textured=!0;for(const{ddAttributes:b,page:S,cap:V,join:C,miterLimit:O,roundLimit:Z,halfWidth:$,offset:W,geometry:J}of A)n.capType=V,n.joinType=C,n.miterLimit=O,n.roundLimit=Z,n.halfWidth=$,n.offset=W,this._processFeature(J,b,S)}else{if(o){const A=o.getValue(i),b=this._spriteInfo[A];if(!(b!=null&&b.rect))return}n.textured=!(!o&&!l),n.capType=y,n.joinType=m,n.miterLimit=I,n.roundLimit=_,n.halfWidth=.5*D,n.offset=B;for(const A of s){const b=a?r.encodeAttributes(A,i,e):null;c&&(n.capType=c.getValue(i,A)),x&&(n.joinType=x.getValue(i,A)),g&&(n.miterLimit=g.getValue(i,A)),w&&(n.roundLimit=w.getValue(i,A)),P&&(n.halfWidth=.5*P.getValue(i,A)),T&&(n.offset=T.getValue(i,A));const S=A.getGeometry(t);this._processFeature(S,b)}}}serialize(){let t=6;t+=this.layerUIDs.length,t+=this.tessellationProperties._lineVertexBuffer.array.length,t+=this.tessellationProperties._lineIndexBuffer.array.length,t+=3*this._patternMap.size+1;const e=new Uint32Array(t),i=new Int32Array(e.buffer);let s=0;e[s++]=this.type,e[s++]=this.layerUIDs.length;for(let r=0;r0)for(const[r,[o,l]]of n)e[s++]=r,e[s++]=o,e[s++]=l;e[s++]=this.tessellationProperties._lineVertexBuffer.array.length;for(let r=0;r(t,e,i,s,n,a,r,o,l,h,d)=>(f._lineVertexBuffer.add(t,e,r,o,i,s,n,a,l,h,d,f._ddValues),f._lineVertexBuffer.index-1),wt=f=>(t,e,i)=>{f._lineIndexBuffer.add(t,e,i)},Ue=10;function bt(f,t){return f.iconMosaicItem&&t.iconMosaicItem?f.iconMosaicItem.page===t.iconMosaicItem.page?0:f.iconMosaicItem.page-t.iconMosaicItem.page:f.iconMosaicItem&&!t.iconMosaicItem?1:!f.iconMosaicItem&&t.iconMosaicItem?-1:0}class U extends me{constructor(t,e,i,s,n,a,r,o,l){super(e,i,l.getSpriteItems()),this.type=_e.SYMBOL,this._markerMap=new Map,this._glyphMap=new Map,this._glyphBufferDataStorage=new Map,this._isIconSDF=!1,this._sourceTileKey=t,this._iconVertexBuffer=s,this._iconIndexBuffer=n,this._textVertexBuffer=a,this._textIndexBuffer=r,this._placementEngine=o,this._workerTileHandler=l}get markerPageMap(){return this._markerMap}get glyphsPageMap(){return this._glyphMap}get symbolInstances(){return this._symbolInstances}getResources(t,e,i){const s=this.layer,n=this.zoom;t&&t.setExtent(this.layerExtent);const a=s.getLayoutProperty("icon-image"),r=s.getLayoutProperty("text-field");let o=s.getLayoutProperty("text-transform"),l=s.getLayoutProperty("text-font");const h=[];let d,u,c,y;a&&!a.isDataDriven&&(d=a.getValue(n)),r&&!r.isDataDriven&&(u=r.getValue(n)),o&&o.isDataDriven||(c=s.getLayoutValue("text-transform",n),o=null),l&&l.isDataDriven||(y=s.getLayoutValue("text-font",n),l=null);for(const p of this._features){const M=p.getGeometry(t);if(!M||M.length===0)continue;let x,m;a&&(x=a.isDataDriven?a.getValue(n,p):this._replaceKeys(d,p.values),x&&e(x));let g=!1;if(r&&(m=r.isDataDriven?r.getValue(n,p):this._replaceKeys(u,p.values),m)){switch(m=m.replaceAll("\\n",` `),o&&(c=o.getValue(n,p)),c){case ke.LOWERCASE:m=m.toLowerCase();break;case ke.UPPERCASE:m=m.toUpperCase()}if(U._bidiEngine.hasBidiChar(m)){let _;_=U._bidiEngine.checkContextual(m)==="rtl"?"IDNNN":"ICNNN",m=U._bidiEngine.bidiTransform(m,_,"VLYSN"),g=!0}if(m.length>0){l&&(y=l.getValue(n,p));for(const _ of y){let P=i[_];P||(P=i[_]=new Set);for(const D of m){const T=D.codePointAt(0);T!=null&&P.add(T)}}}}if(!x&&!m)continue;const I=s.getLayoutValue("symbol-sort-key",n,p),w={feature:p,sprite:x,label:m,rtl:g,geometry:M,hash:(m?Ce(m):0)^(x?Ce(x):0),priority:I,textFont:y};h.push(w)}this._symbolFeatures=h}processFeatures(t){t&&t.setExtent(this.layerExtent);const e=this.layer,i=this.zoom,s=e.getLayoutValue("symbol-placement",i),n=s!==Pe.POINT,a=e.getLayoutValue("symbol-spacing",i)*le,r=e.getLayoutProperty("icon-image"),o=e.getLayoutProperty("text-field"),l=r?new We(e,i,n):null,h=o?new qe(e,i,n):null,d=this._workerTileHandler;let u;r&&(u=d.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 c=[];let y=1;h&&h.size&&(y=h.size/H);const p=h?h.maxAngle*Te:0,M=h?h.size*le:0;for(const x of this._symbolFeatures){let m;l&&u&&x.sprite&&(m=u[x.sprite],m&&m.sdf&&(this._isIconSDF=!0));let g;m&&l.update(i,x.feature);let I=0;const w=x.label;if(w){Ye(h),h.update(i,x.feature);const _=n&&h.rotationAlignment===ie.MAP?h.keepUpright:h.writingMode&&h.writingMode.includes(Ze.VERTICAL);let P=.5;switch(h.anchor){case k.TOP_LEFT:case k.LEFT:case k.BOTTOM_LEFT:P=0;break;case k.TOP_RIGHT:case k.RIGHT:case k.BOTTOM_RIGHT:P=1}let D=.5;switch(h.anchor){case k.TOP_LEFT:case k.TOP:case k.TOP_RIGHT:D=0;break;case k.BOTTOM_LEFT:case k.BOTTOM:case k.BOTTOM_RIGHT:D=1}let T=.5;switch(h.justify){case we.AUTO:T=P;break;case we.LEFT:T=0;break;case we.RIGHT:T=1}const B=h.letterSpacing*H,A=n?0:h.maxWidth*H,b=h.lineHeight*H,S=x.textFont.map(V=>d.getGlyphItems(V));if(g=new He(S,A,b,B,P,D,T).getShaping(w,x.rtl,_),g&&g.length>0){let V=1e30,C=-1e30;for(const O of g)V=Math.min(V,O.x),C=Math.max(C,O.x);I=(C-V+2*H)*y*le}}for(let _ of x.geometry){const P=[];if(s===Pe.LINE){if(g!=null&&g.length&&(h!=null&&h.size)){const D=h.size*le*(2+Math.min(2,4*Math.abs(h.offset[1])));_=U._smoothVertices(_,D)}U._pushAnchors(P,_,a,I)}else s===Pe.LINE_CENTER?U._pushCenterAnchor(P,_):x.feature.type===Je.Polygon?U._pushCentroid(P,_):P.push(new ge(_[0].x,_[0].y));for(const D of P){if(D.x<0||D.x>Re||D.y<0||D.y>Re||n&&I>0&&(h==null?void 0:h.rotationAlignment)===ie.MAP&&!U._honorsTextMaxAngle(_,D,I,p,M))continue;const T={shaping:g,line:_,iconMosaicItem:m,anchor:D,symbolFeature:x,textColliders:[],iconColliders:[],textVertexRanges:[],iconVertexRanges:[]};c.push(T),this._processFeature(T,l,h)}}}c.sort(bt),this._addPlacedGlyphs(),this._symbolInstances=c}serialize(){let t=14;t+=this.layerUIDs.length,t+=3*this.markerPageMap.size,t+=3*this.glyphsPageMap.size,t+=U._symbolsSerializationLength(this._symbolInstances),t+=this._iconVertexBuffer.array.length,t+=this._iconIndexBuffer.array.length,t+=this._textVertexBuffer.array.length,t+=this._textIndexBuffer.array.length;const e=new Uint32Array(t),i=new Int32Array(e.buffer),s=new Float32Array(e.buffer),[n,a,r]=this._sourceTileKey.split("/");let o=0;e[o++]=this.type,e[o++]=this.layerUIDs.length;for(let l=0;ls in e?e[s]:"")}_processFeature(t,e,i){const{line:s,iconMosaicItem:n,shaping:a,anchor:r}=t,o=this.zoom,l=this.layer,h=!!n;let d=!0;h&&(d=(e==null?void 0:e.optional)||!n);const u=a&&a.length>0,c=!u||(i==null?void 0:i.optional);let y,p;if(h&&(y=this._placementEngine.getIconPlacement(r,n,e)),(y||d)&&(u&&(p=this._placementEngine.getTextPlacement(r,a,s,i)),p||c)){if(y&&p||(c||d?c||p?d||y||(p=null):y=null:(y=null,p=null)),p){const M=l.hasDataDrivenText?l.textMaterial.encodeAttributes(t.symbolFeature.feature,o,l):null;if(this._storePlacedGlyphs(t,p.shapes,o,i.rotationAlignment,M),p.textColliders){t.textColliders=p.textColliders;for(const x of p.textColliders){x.minLod=Math.max(o+Y(x.minLod),0),x.maxLod=Math.min(o+Y(x.maxLod),25);const m=x.angle;if(m){const g=Math.cos(m),I=Math.sin(m),w=x.dxPixels*g-x.dyPixels*I,_=x.dxPixels*I+x.dyPixels*g,P=(x.dxPixels+x.width)*g-x.dyPixels*I,D=(x.dxPixels+x.width)*I+x.dyPixels*g,T=x.dxPixels*g-(x.dyPixels+x.height)*I,B=x.dxPixels*I+(x.dyPixels+x.height)*g,A=(x.dxPixels+x.width)*g-(x.dyPixels+x.height)*I,b=(x.dxPixels+x.width)*I+(x.dyPixels+x.height)*g,S=Math.min(w,P,T,A),V=Math.max(w,P,T,A),C=Math.min(_,D,B,b),O=Math.max(_,D,B,b);x.dxPixels=S,x.dyPixels=C,x.width=V-S,x.height=O-C}}}}if(y){const M=l.hasDataDrivenIcon?l.iconMaterial.encodeAttributes(t.symbolFeature.feature,o,l):null;if(this._addPlacedIcons(t,y.shapes,o,n.page,e.rotationAlignment===ie.VIEWPORT,M),y.iconColliders){t.iconColliders=y.iconColliders;for(const x of y.iconColliders){x.minLod=Math.max(o+Y(x.minLod),0),x.maxLod=Math.min(o+Y(x.maxLod),25);const m=x.angle;if(m){const g=Math.cos(m),I=Math.sin(m),w=x.dxPixels*g-x.dyPixels*I,_=x.dxPixels*I+x.dyPixels*g,P=(x.dxPixels+x.width)*g-x.dyPixels*I,D=(x.dxPixels+x.width)*I+x.dyPixels*g,T=x.dxPixels*g-(x.dyPixels+x.height)*I,B=x.dxPixels*I+(x.dyPixels+x.height)*g,A=(x.dxPixels+x.width)*g-(x.dyPixels+x.height)*I,b=(x.dxPixels+x.width)*I+(x.dyPixels+x.height)*g,S=Math.min(w,P,T,A),V=Math.max(w,P,T,A),C=Math.min(_,D,B,b),O=Math.max(_,D,B,b);x.dxPixels=S,x.dyPixels=C,x.width=V-S,x.height=O-C}}}}}}_addPlacedIcons(t,e,i,s,n,a){const r=Math.max(i-1,0),o=this._iconVertexBuffer,l=this._iconIndexBuffer,h=this._markerMap;for(const d of e){const u=n?0:Math.max(i+Y(d.minzoom),r),c=n?25:Math.min(i+Y(d.maxzoom),25);if(c<=u)continue;const y=d.tl,p=d.tr,M=d.bl,x=d.br,m=d.mosaicRect,g=d.labelAngle,I=d.minAngle,w=d.maxAngle,_=d.anchor,P=o.index,D=m.x,T=m.y,B=D+m.width,A=T+m.height,b=o.index;o.add(_.x,_.y,y.x,y.y,D,T,g,I,w,u,c,a),o.add(_.x,_.y,p.x,p.y,B,T,g,I,w,u,c,a),o.add(_.x,_.y,M.x,M.y,D,A,g,I,w,u,c,a),o.add(_.x,_.y,x.x,x.y,B,A,g,I,w,u,c,a),t.iconVertexRanges.length>0&&t.iconVertexRanges[0][0]+t.iconVertexRanges[0][1]===b?t.iconVertexRanges[0][1]+=4:t.iconVertexRanges.push([b,4]),l.add(P,P+1,P+2),l.add(P+1,P+2,P+3),h.has(s)?h.get(s)[1]+=6:h.set(s,[this._iconIndexStart+this._iconIndexCount,6]),this._iconIndexCount+=6}}_addPlacedGlyphs(){const t=this._textVertexBuffer,e=this._textIndexBuffer,i=this._glyphMap;for(const[s,n]of this._glyphBufferDataStorage)for(const a of n){const r=t.index,o=a.symbolInstance,l=a.ddAttributes,h=t.index;t.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,l),t.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,l),t.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,l),t.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,l),o.textVertexRanges.length>0&&o.textVertexRanges[0][0]+o.textVertexRanges[0][1]===h?o.textVertexRanges[0][1]+=4:o.textVertexRanges.push([h,4]),e.add(r,r+1,r+2),e.add(r+1,r+2,r+3),i.has(s)?i.get(s)[1]+=6:i.set(s,[this._textIndexStart+this._textIndexCount,6]),this._textIndexCount+=6}this._glyphBufferDataStorage.clear()}_storePlacedGlyphs(t,e,i,s,n){const a=Math.max(i-1,0),r=s===ie.VIEWPORT;let o,l,h,d,u,c,y,p,M,x,m;for(const g of e)o=r?0:Math.max(i+Y(g.minzoom),a),l=r?25:Math.min(i+Y(g.maxzoom),25),!(l<=o)&&(h=g.tl,d=g.tr,u=g.bl,c=g.br,y=g.labelAngle,p=g.minAngle,M=g.maxAngle,x=g.anchor,m=g.mosaicRect,this._glyphBufferDataStorage.has(g.page)||this._glyphBufferDataStorage.set(g.page,[]),this._glyphBufferDataStorage.get(g.page).push({glyphAnchor:[x.x,x.y],tl:[h.x,h.y],tr:[d.x,d.y],bl:[u.x,u.y],br:[c.x,c.y],xmin:m.x,ymin:m.y,xmax:m.x+m.width,ymax:m.y+m.height,labelAngle:y,minAngle:p,maxAngle:M,minLod:o,maxLod:l,placementLod:a,symbolInstance:t,ddAttributes:n}))}static _pushAnchors(t,e,i,s){i+=s;let n=0;const a=e.length-1;for(let u=0;u-r;){if(--l,l<0)return!1;a-=L.distance(t[l],o),o=t[l]}a+=L.distance(t[l],t[l+1]);const h=[];let d=0;const u=t.length;for(;an;)d-=h.shift().deviation;if(Math.abs(d)>s)return!1;a+=L.distance(y,M),l=p}return!0}static _smoothVertices(t,e){if(e<=0)return t;let i=t.length;if(i<3)return t;const s=[];let n=0,a=0;s.push(0);for(let p=1;p0&&(n+=M,s.push(n),a++,a!==p&&(t[a]=t[p]))}if(i=a+1,i<3)return t;e=Math.min(e,.2*n);const r=t[0].x,o=t[0].y,l=t[i-1].x,h=t[i-1].y,d=L.sub(t[0],t[1]);d.normalize(),t[0].x+=e*d.x,t[0].y+=e*d.y,d.assignSub(t[i-1],t[i-2]),d.normalize(),t[i-1].x+=e*d.x,t[i-1].y+=e*d.y,s[0]-=e,s[i-1]+=e;const u=[];u.push(new L(r,o));const c=1e-6,y=.5*e;for(let p=1;p=0;g--){const I=y+s[g+1]-s[p];if(I<0)break;const w=s[g+1]-s[g],_=s[p]-s[g]4096&&(d=4096),d<0&&(d=0),u>4096&&(u=4096),u<0&&(u=0);for(let c=1;c4096&&(y=4096),y<0&&(y=0),p>4096&&(p=4096),p<0&&(p=0),M>4096&&(M=4096),M<0&&(M=0),x>4096&&(x=4096),x<0&&(x=0);const m=(y-d)*(x-u)-(M-d)*(p-u);o+=m*(d+y+M),l+=m*(u+p+x),h+=m}o/=3*h,l/=3*h,isNaN(o)||isNaN(l)||t.push(new ge(o,l))}}U._bidiEngine=new at;var K;(function(f){f[f.INITIALIZED=0]="INITIALIZED",f[f.NO_DATA=1]="NO_DATA",f[f.READY=2]="READY",f[f.MODIFIED=3]="MODIFIED",f[f.INVALID=4]="INVALID"})(K||(K={}));class Tt{constructor(t,e,i,s,n,a){var d;if(this._pbfTiles={},this._tileClippers={},this._client=i,this._tile=e,this._sourceDataMaxLOD=s,a){this._styleLayerUIDs=new Set;for(const u of a)this._styleLayerUIDs.add(u)}this._styleRepository=n,this._layers=((d=this._styleRepository)==null?void 0:d.layers)??[];const[r,o,l]=e.tileKey.split("/").map(parseFloat);this._level=r;const h=Qe(this._level);for(const u of Object.keys(t)){const c=t[u];if(this._pbfTiles[u]=new it(new Uint8Array(c.protobuff),new DataView(c.protobuff)),c.refKey){const[y]=c.refKey.split("/").map(parseFloat),p=r-y;if(p>0){const M=(1<{a.has(h)||(n.push({name:h,repeat:d}),a.add(h))},o={};for(const h of s)h.getResources(h.tileClipper,r,o);if(this._tile.status===K.INVALID)return[];const l=this._fetchResources(n,o,t);return Promise.all([...l,e]).then(()=>this._processFeatures(i.returnedBuckets))}_initialize(t){return{signal:t==null?void 0:t.signal,sourceNameToTileData:this._parseTileData(this._pbfTiles),layers:this._layers,zoom:this._level,sourceNameToTileClipper:this._tileClippers,sourceNameToUniqueSourceLayerBuckets:{},sourceNameToUniqueSourceLayers:{},returnedBuckets:[],layerIdToBucket:{},referencerUIDToReferencedId:new Map}}_processLayers(t){const{sourceNameToTileData:e,zoom:i,layers:s,sourceNameToTileClipper:n,sourceNameToUniqueSourceLayerBuckets:a,sourceNameToUniqueSourceLayers:r,returnedBuckets:o,layerIdToBucket:l,referencerUIDToReferencedId:h}=t,d=this._sourceDataMaxLOD;for(let u=s.length-1;u>=0;u--){const c=s[u];if(i=c.maxzoom)continue}else if(c.maxzoom&&i>=c.maxzoom)continue;if(c.type===ee.BACKGROUND||!this._canParseStyleLayer(c.uid)||!e[c.source]||!n[c.source])continue;const y=e[c.source],p=n[c.source],M=c.sourceLayer,x=y[M];if(x){let m=r[c.source];if(m||(m=r[c.source]=new Set),m.add(c.sourceLayer),c.refLayerId)h.set(c.uid,c.refLayerId);else{const g=this._createBucket(c);if(g){g.layerUIDs=[c.uid],g.layerExtent=x.extent,g.tileClipper=p;let I=a[c.source];I||(I=a[c.source]={});let w=I[M];w||(w=I[M]=[]),w.push(g),o.push(g),l[c.id]=g}}}}}_linkReferences(t){const{layerIdToBucket:e,referencerUIDToReferencedId:i}=t;i.forEach((s,n)=>{e[s]&&e[s].layerUIDs.push(n)})}_filterFeatures(t){const{signal:e,sourceNameToTileData:i,sourceNameToUniqueSourceLayerBuckets:s,sourceNameToUniqueSourceLayers:n}=t,a=10*this._level,r=10*(this._level+1),o=[],l=[];for(const h of Object.keys(n))n[h].forEach(d=>{o.push(d),l.push(h)});for(let h=0;h=r)continue;const w=g._maxzoom;if(w&&w<=a)continue}for(const I of y)I.pushFeature(m)}}}_fetchResources(t,e,i){const s=[],n=this._tile.getWorkerTileHandler();let a,r;t.length>0&&(a=n.fetchSprites(t,this._client,i),s.push(a));for(const o in e){const l=e[o];l.size>0&&(r=n.fetchGlyphs(this._tile.tileKey,o,l,this._client,i),s.push(r))}return s}_processFeatures(t){const e=t.filter(i=>i.hasFeatures()||this._canParseStyleLayer(i.layer.uid));for(const i of e)i.processFeatures(i.tileClipper);return e}_parseTileData(t){const e={};for(const i of Object.keys(t)){const s=t[i],n={};for(;s.next();)switch(s.tag()){case 3:{const a=s.getMessage(),r=new ht(a);a.release(),n[r.name]=r;break}default:s.skip()}e[i]=n}return e}_createBucket(t){switch(t.type){case ee.BACKGROUND:return null;case ee.FILL:return this._createFillBucket(t);case ee.LINE:return this._createLineBucket(t);case ee.CIRCLE:return this._createCircleBucket(t);case ee.SYMBOL:return this._createSymbolBucket(t)}}_createFillBucket(t){return new mt(t,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new yt(t.fillMaterial.getStride()),new te,new gt(t.outlineMaterial.getStride()),new te)}_createLineBucket(t){return new Mt(t,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new xt(t.lineMaterial.getStride()),new te)}_createCircleBucket(t){return new _t(t,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new pt(t.circleMaterial.getStride()),new te)}_createSymbolBucket(t){const e=this._tile;return new U(e.tileKey,t,this._level,new Ne(t.iconMaterial.getStride()),new te,new Ne(t.textMaterial.getStride()),new te,e.placementEngine,e.getWorkerTileHandler())}}let Dt=class{constructor(t,e,i,s){this.status=K.INITIALIZED,this.placementEngine=new dt,this.tileKey=t,this.refKeys=e,this._workerTileHandler=i,this._styleRepository=s}release(){this.tileKey="",this.refKeys=null,this.status=K.INITIALIZED,this._workerTileHandler=null}async parse(t,e){const i=e==null?void 0:e.signal;if(i!=null){const h=()=>{i.removeEventListener("abort",h),this.status=K.INVALID};i.addEventListener("abort",h)}let s;const n={bucketsWithData:[],emptyBuckets:null};try{s=await this._parse(t,e)}catch(h){if($e(h))throw h;return{result:n,transferList:[]}}this.status=K.READY;const a=n.bucketsWithData,r=[];for(const h of s)if(h.hasFeatures()){const d=h.serialize();a.push(d)}else r.push(h.layer.uid);const o=[...a];let l=null;return r.length>0&&(l=Uint32Array.from(r),o.push(l.buffer)),n.emptyBuckets=l,{result:n,transferList:o}}setObsolete(){this.status=K.INVALID}getLayers(){return this._workerTileHandler.getLayers()}getWorkerTileHandler(){return this._workerTileHandler}async _parse(t,e){const i=t.sourceName2DataAndRefKey;return Object.keys(i).length===0?[]:(this.status=K.MODIFIED,new Tt(i,this,e.client,t.sourceDataMaxLOD,this._styleRepository,t.styleLayerUIDs).parse(e))}};const Bt=25;class jt{constructor(){this._spriteInfo={},this._glyphInfo={},this._sourceDataMaxLOD=Bt}reset(){return this._spriteInfo={},this._glyphInfo={},Promise.resolve()}getLayers(){var t;return((t=this._styleRepository)==null?void 0:t.layers)??[]}async createTileAndParse(t,e){const{key:i}=t,s={};for(const a of Object.keys(t.sourceName2DataAndRefKey)){const r=t.sourceName2DataAndRefKey[a];s[a]=r.refKey}const n=new Dt(i,s,this,this._styleRepository);try{return await n.parse({...t,sourceDataMaxLOD:this._sourceDataMaxLOD},e)}catch(a){if(n.setObsolete(),n.release(),!$e(a))throw a;return null}}updateStyle(t){if(!t||t.length===0||!this._styleRepository)return;const e=this._styleRepository;for(const i of t){const s=i.type,n=i.data;switch(s){case oe.PAINTER_CHANGED:e.setPaintProperties(n.layer,n.paint);break;case oe.LAYOUT_CHANGED:e.setLayoutProperties(n.layer,n.layout);break;case oe.LAYER_REMOVED:e.deleteStyleLayer(n.layer);break;case oe.LAYER_CHANGED:e.setStyleLayer(n.layer,n.index);break;case oe.SPRITES_CHANGED:this._spriteInfo={}}}}setStyle(t){const{style:e,sourceDataMaxLOD:i}=t;this._styleRepository=new st(e),this._sourceDataMaxLOD=i,this._spriteInfo={},this._glyphInfo={}}fetchSprites(t,e,i){const s=[],n=this._spriteInfo;for(const a of t)n[a.name]===void 0&&s.push(a);return s.length===0?Promise.resolve():e.invoke("getSprites",s,{signal:i==null?void 0:i.signal}).then(a=>{for(const r in a){const o=a[r];n[r]=o}})}getSpriteItems(){return this._spriteInfo}fetchGlyphs(t,e,i,s,n){const a=[];let r=this._glyphInfo[e];return r?i.forEach(o=>{r[o]||a.push(o)}):(r=this._glyphInfo[e]=[],i.forEach(o=>a.push(o))),a.length===0?Promise.resolve():s.invoke("getGlyphs",{tileID:t,font:e,codePoints:a},n).then(o=>{for(let l=0;l>>24&255,u>>>16&255,u>>>8&255,255&u])}},function(b,l){Object.defineProperty(l,"__esModule",{value:!0}),l.default=function(y){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=e,i=e+(arguments.length>2&&arguments[2]!==void 0?arguments[2]:y.length-e);r>>8^s[255&(n^y[r])];return-1^n};for(var s=new Uint32Array(256),a=0;a<256;a++){for(var h=a,f=0;f<8;f++)h=1&h?3988292384^h>>>1:h>>>1;s[a]=h}},function(b,l,s){Object.defineProperty(l,"__esModule",{value:!0}),l.Frame=l.APNG=void 0;var a=function(){function e(n,r){for(var i=0;i1&&arguments[1]!==void 0&&arguments[1];return this.createImages().then(function(){return new h.default(r,n,i)})}}]),e}(),l.Frame=function(){function e(){y(this,e),this.left=0,this.top=0,this.width=0,this.height=0,this.delay=0,this.disposeOp=0,this.blendOp=0,this.imageData=null,this.imageElement=null}return a(e,[{key:"createImage",value:function(){var n=this;return this.imageElement?Promise.resolve():new Promise(function(r,i){var t=URL.createObjectURL(n.imageData);n.imageElement=document.createElement("img"),n.imageElement.onload=function(){URL.revokeObjectURL(t),r()},n.imageElement.onerror=function(){URL.revokeObjectURL(t),n.imageElement=null,i(new Error("Image creation error"))},n.imageElement.src=t})}}]),e}()},function(b,l,s){Object.defineProperty(l,"__esModule",{value:!0});var a=function(){function r(i,t){for(var o=0;o=this._apng.numPlays&&(this._ended=!0,this._paused=!0)),this._prevFrame&&this._prevFrame.disposeOp==1?this.context.clearRect(this._prevFrame.left,this._prevFrame.top,this._prevFrame.width,this._prevFrame.height):this._prevFrame&&this._prevFrame.disposeOp==2&&this.context.putImageData(this._prevFrameData,this._prevFrame.left,this._prevFrame.top);var t=this.currentFrame;this._prevFrame=t,this._prevFrameData=null,t.disposeOp==2&&(this._prevFrameData=this.context.getImageData(t.left,t.top,t.width,t.height)),t.blendOp==0&&this.context.clearRect(t.left,t.top,t.width,t.height),this.context.drawImage(t.imageElement,t.left,t.top),this.emit("frame",this._currentFrameNumber),this._ended&&this.emit("end")}},{key:"play",value:function(){var t=this;this.emit("play"),this._ended&&this.stop(),this._paused=!1;var o=performance.now()+this.currentFrame.delay/this.playbackRate,v=function m(x){if(!t._ended&&!t._paused){if(x>=o){for(;x-o>=t._apng.playTime/t.playbackRate;)o+=t._apng.playTime/t.playbackRate,t._numPlays++;do t.renderNextFrame(),o+=t.currentFrame.delay/t.playbackRate;while(!t._ended&&x>o)}requestAnimationFrame(m)}};requestAnimationFrame(v)}},{key:"pause",value:function(){this._paused||(this.emit("pause"),this._paused=!0)}},{key:"stop",value:function(){this.emit("stop"),this._numPlays=0,this._ended=!1,this._paused=!0,this._currentFrameNumber=-1,this.context.clearRect(0,0,this._apng.width,this._apng.height),this.renderNextFrame()}},{key:"currentFrameNumber",get:function(){return this._currentFrameNumber}},{key:"currentFrame",get:function(){return this._apng.frames[this._currentFrameNumber]}},{key:"paused",get:function(){return this._paused}},{key:"ended",get:function(){return this._ended}}]),i}(h(s(4)).default);l.default=n},function(b,l){function s(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function a(e){return typeof e=="function"}function h(e){return typeof e=="number"}function f(e){return typeof e=="object"&&e!==null}function y(e){return e===void 0}b.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._maxListeners=void 0,s.defaultMaxListeners=10,s.prototype.setMaxListeners=function(e){if(!h(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},s.prototype.emit=function(e){var n,r,i,t,o,v;if(this._events||(this._events={}),e==="error"&&(!this._events.error||f(this._events.error)&&!this._events.error.length)){if((n=arguments[1])instanceof Error)throw n;var m=new Error('Uncaught, unspecified "error" event. ('+n+")");throw m.context=n,m}if(y(r=this._events[e]))return!1;if(a(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:t=Array.prototype.slice.call(arguments,1),r.apply(this,t)}else if(f(r))for(t=Array.prototype.slice.call(arguments,1),i=(v=r.slice()).length,o=0;o0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),typeof console.trace=="function"&&console.trace()),this},s.prototype.on=s.prototype.addListener,s.prototype.once=function(e,n){if(!a(n))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,n.apply(this,arguments))}return i.listener=n,this.on(e,i),this},s.prototype.removeListener=function(e,n){var r,i,t,o;if(!a(n))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(t=(r=this._events[e]).length,i=-1,r===n||a(r.listener)&&r.listener===n)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,n);else if(f(r)){for(o=t;o-- >0;)if(r[o]===n||r[o].listener&&r[o].listener===n){i=o;break}if(i<0)return this;r.length===1?(r.length=0,delete this._events[e]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,n)}return this},s.prototype.removeAllListeners=function(e){var n,r;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[e]&&delete this._events[e],this;if(arguments.length===0){for(n in this._events)n!=="removeListener"&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events={},this}if(a(r=this._events[e]))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},s.prototype.listeners=function(e){return this._events&&this._events[e]?a(this._events[e])?[this._events[e]]:this._events[e].slice():[]},s.prototype.listenerCount=function(e){if(this._events){var n=this._events[e];if(a(n))return 1;if(n)return n.length}return 0},s.listenerCount=function(e,n){return e.listenerCount(n)}}])},R.exports=I();const B=M(R.exports);async function H(b,l){const s=B(b);if(s instanceof Error)throw s;await s.createImages(),G(l);const{frames:a,width:h,height:f}=s,y=document.createElement("canvas");y.width=h,y.height=f;const e=y.getContext("2d",{willReadFrequently:!0}),n=[],r=[];let i=0;for(const t of a){const o=S(t.delay||100);r.push(o),i+=o;const v=t.imageElement;t.blendOp===0?e.globalCompositeOperation="copy":e.globalCompositeOperation="source-over";const m=t.disposeOp===2?e.getImageData(t.left,t.top,t.width,t.height):void 0;e.drawImage(v,t.left,t.top);const x=e.getImageData(0,0,h,f);n.push(x),t.disposeOp===0||(t.disposeOp===1?e.clearRect(t.left,t.top,t.width,t.height):t.disposeOp===2&&e.putImageData(m,t.left,t.top))}return{frameCount:a.length,duration:i,frameDurations:r,getFrame:t=>n[t],width:h,height:f}}const V=[137,80,78,71,13,10,26,10];function q(b){const l=new Uint8Array(b);return!V.some((s,a)=>s!==l[a])}function z(b){if(!q(b))return!1;const l=new DataView(b),s=new Uint8Array(b);let a,h=8;do{const f=l.getUint32(h);if(a=String.fromCharCode.apply(String,Array.prototype.slice.call(s.subarray(h+4,h+8))),a==="acTL")return!0;h+=12+f}while(a!=="IEND"&&h>>24&255,u>>>16&255,u>>>8&255,255&u])}},function(b,l){Object.defineProperty(l,"__esModule",{value:!0}),l.default=function(y){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=e,i=e+(arguments.length>2&&arguments[2]!==void 0?arguments[2]:y.length-e);r>>8^s[255&(n^y[r])];return-1^n};for(var s=new Uint32Array(256),a=0;a<256;a++){for(var h=a,f=0;f<8;f++)h=1&h?3988292384^h>>>1:h>>>1;s[a]=h}},function(b,l,s){Object.defineProperty(l,"__esModule",{value:!0}),l.Frame=l.APNG=void 0;var a=function(){function e(n,r){for(var i=0;i1&&arguments[1]!==void 0&&arguments[1];return this.createImages().then(function(){return new h.default(r,n,i)})}}]),e}(),l.Frame=function(){function e(){y(this,e),this.left=0,this.top=0,this.width=0,this.height=0,this.delay=0,this.disposeOp=0,this.blendOp=0,this.imageData=null,this.imageElement=null}return a(e,[{key:"createImage",value:function(){var n=this;return this.imageElement?Promise.resolve():new Promise(function(r,i){var t=URL.createObjectURL(n.imageData);n.imageElement=document.createElement("img"),n.imageElement.onload=function(){URL.revokeObjectURL(t),r()},n.imageElement.onerror=function(){URL.revokeObjectURL(t),n.imageElement=null,i(new Error("Image creation error"))},n.imageElement.src=t})}}]),e}()},function(b,l,s){Object.defineProperty(l,"__esModule",{value:!0});var a=function(){function r(i,t){for(var o=0;o=this._apng.numPlays&&(this._ended=!0,this._paused=!0)),this._prevFrame&&this._prevFrame.disposeOp==1?this.context.clearRect(this._prevFrame.left,this._prevFrame.top,this._prevFrame.width,this._prevFrame.height):this._prevFrame&&this._prevFrame.disposeOp==2&&this.context.putImageData(this._prevFrameData,this._prevFrame.left,this._prevFrame.top);var t=this.currentFrame;this._prevFrame=t,this._prevFrameData=null,t.disposeOp==2&&(this._prevFrameData=this.context.getImageData(t.left,t.top,t.width,t.height)),t.blendOp==0&&this.context.clearRect(t.left,t.top,t.width,t.height),this.context.drawImage(t.imageElement,t.left,t.top),this.emit("frame",this._currentFrameNumber),this._ended&&this.emit("end")}},{key:"play",value:function(){var t=this;this.emit("play"),this._ended&&this.stop(),this._paused=!1;var o=performance.now()+this.currentFrame.delay/this.playbackRate,v=function m(x){if(!t._ended&&!t._paused){if(x>=o){for(;x-o>=t._apng.playTime/t.playbackRate;)o+=t._apng.playTime/t.playbackRate,t._numPlays++;do t.renderNextFrame(),o+=t.currentFrame.delay/t.playbackRate;while(!t._ended&&x>o)}requestAnimationFrame(m)}};requestAnimationFrame(v)}},{key:"pause",value:function(){this._paused||(this.emit("pause"),this._paused=!0)}},{key:"stop",value:function(){this.emit("stop"),this._numPlays=0,this._ended=!1,this._paused=!0,this._currentFrameNumber=-1,this.context.clearRect(0,0,this._apng.width,this._apng.height),this.renderNextFrame()}},{key:"currentFrameNumber",get:function(){return this._currentFrameNumber}},{key:"currentFrame",get:function(){return this._apng.frames[this._currentFrameNumber]}},{key:"paused",get:function(){return this._paused}},{key:"ended",get:function(){return this._ended}}]),i}(h(s(4)).default);l.default=n},function(b,l){function s(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function a(e){return typeof e=="function"}function h(e){return typeof e=="number"}function f(e){return typeof e=="object"&&e!==null}function y(e){return e===void 0}b.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._maxListeners=void 0,s.defaultMaxListeners=10,s.prototype.setMaxListeners=function(e){if(!h(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},s.prototype.emit=function(e){var n,r,i,t,o,v;if(this._events||(this._events={}),e==="error"&&(!this._events.error||f(this._events.error)&&!this._events.error.length)){if((n=arguments[1])instanceof Error)throw n;var m=new Error('Uncaught, unspecified "error" event. ('+n+")");throw m.context=n,m}if(y(r=this._events[e]))return!1;if(a(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:t=Array.prototype.slice.call(arguments,1),r.apply(this,t)}else if(f(r))for(t=Array.prototype.slice.call(arguments,1),i=(v=r.slice()).length,o=0;o0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),typeof console.trace=="function"&&console.trace()),this},s.prototype.on=s.prototype.addListener,s.prototype.once=function(e,n){if(!a(n))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,n.apply(this,arguments))}return i.listener=n,this.on(e,i),this},s.prototype.removeListener=function(e,n){var r,i,t,o;if(!a(n))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(t=(r=this._events[e]).length,i=-1,r===n||a(r.listener)&&r.listener===n)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,n);else if(f(r)){for(o=t;o-- >0;)if(r[o]===n||r[o].listener&&r[o].listener===n){i=o;break}if(i<0)return this;r.length===1?(r.length=0,delete this._events[e]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,n)}return this},s.prototype.removeAllListeners=function(e){var n,r;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[e]&&delete this._events[e],this;if(arguments.length===0){for(n in this._events)n!=="removeListener"&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events={},this}if(a(r=this._events[e]))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},s.prototype.listeners=function(e){return this._events&&this._events[e]?a(this._events[e])?[this._events[e]]:this._events[e].slice():[]},s.prototype.listenerCount=function(e){if(this._events){var n=this._events[e];if(a(n))return 1;if(n)return n.length}return 0},s.listenerCount=function(e,n){return e.listenerCount(n)}}])},R.exports=I();const B=M(R.exports);async function H(b,l){const s=B(b);if(s instanceof Error)throw s;await s.createImages(),G(l);const{frames:a,width:h,height:f}=s,y=document.createElement("canvas");y.width=h,y.height=f;const e=y.getContext("2d",{willReadFrequently:!0}),n=[],r=[];let i=0;for(const t of a){const o=S(t.delay||100);r.push(o),i+=o;const v=t.imageElement;t.blendOp===0?e.globalCompositeOperation="copy":e.globalCompositeOperation="source-over";const m=t.disposeOp===2?e.getImageData(t.left,t.top,t.width,t.height):void 0;e.drawImage(v,t.left,t.top);const x=e.getImageData(0,0,h,f);n.push(x),t.disposeOp===0||(t.disposeOp===1?e.clearRect(t.left,t.top,t.width,t.height):t.disposeOp===2&&e.putImageData(m,t.left,t.top))}return{frameCount:a.length,duration:i,frameDurations:r,getFrame:t=>n[t],width:h,height:f}}const V=[137,80,78,71,13,10,26,10];function q(b){const l=new Uint8Array(b);return!V.some((s,a)=>s!==l[a])}function z(b){if(!q(b))return!1;const l=new DataView(b),s=new Uint8Array(b);let a,h=8;do{const f=l.getUint32(h);if(a=String.fromCharCode.apply(String,Array.prototype.slice.call(s.subarray(h+4,h+8))),a==="acTL")return!0;h+=12+f}while(a!=="IEND"&&h{const r={};return g(r,c,{[i]:s},a,o),r[i]}))}function E(e,n,a={}){const o=e instanceof z?new M({source:e.features,geometryType:e.geometryType,fields:e.fields,spatialReference:e.spatialReference}):e;return n.constructFeatureSet(o,a.spatialReference,null,!0,a.lruCache,a.interceptor)}function Q(e,n,a={}){const{spatialReference:o,interceptor:t,lruCache:i}=a;return typeof e=="string"?n.createFeatureSetCollectionFromService(e,o,i,t):n.createFeatureSetCollectionFromMap(e,o,i,t)}function V(e,n,a,o={}){const t={};return g(t,n.properties,e,a,o),new b.Dictionary(t)}function g(e,n,a,o,t={}){const i={};for(const c of Object.keys(a))i[c.toLowerCase()]=a[c];for(const c of n){const s=c.name.toLowerCase();if(t.variablesPreProcessed)e[s]=i[s];else switch(c.type){case"array":{const r=i[s];e[s]=r==null?null:N(r,c,o,t);break}case"feature":{const r=i[s];e[s]=r==null?null:b.Feature.createFromGraphic(r,t==null?void 0:t.timeZone);break}case"featureSet":{const r=i[s];e[s]=r==null?null:o?E(r,o,t):null;break}case"featureSetCollection":{const r=i[s];e[s]=r==null?null:o?Q(r,o,t):null;break}case"dictionary":{const r=i[s];e[s]=r==null?null:V(r,c,o,t);break}case"date":{const r=i[s];e[s]=r?r instanceof w?r:t!=null&&t.timeZone?w.dateJSAndZoneToArcadeDate(r,t==null?void 0:t.timeZone):w.dateJSToArcadeDate(r):null;break}case"dateOnly":{const r=i[s];e[s]=r?r instanceof F?r:F.fromReader(r):null;break}case"time":{const r=i[s];e[s]=r?r instanceof T?r:T.fromReader(r):null;break}case"knowledgeGraph":case"geometry":case"boolean":case"text":case"number":e[s]=i[s]}}}function Z(e,n){for(const a of e)n.push(a),a.type==="dictionary"&&Z(a.properties,n);return n}function R(e,n,a,o,t){const{spatialReference:i,interceptor:c,lruCache:s,console:r,abortSignal:u,timeZone:l,services:S={portal:P.getDefault()}}=a,f={vars:{},spatialReference:i,interceptor:c,timeZone:l,lrucache:s,useAsync:t,services:S,console:r,abortSignal:u};return n&&g(f.vars,e.variables,n,o,a),f}function v(e,n){switch(n.getArcadeType(e)){case"number":case"text":case"boolean":case"point":case"polygon":case"polyline":case"multipoint":case"extent":return e;case"date":return e.toJSDate();case"time":case"dateOnly":return e.toString();case"feature":{const a=(e.type,e),o="geometry"in a?a.geometry():null,t="readAttributes"in a?a.readAttributes():a.attributes;return new I({geometry:o,attributes:t})}case"dictionary":{const a=e,o=a.attributes,t={};for(const i of Object.keys(o))t[i]=v(a.field(i),n);return t}case"array":return("toArray"in e?e.toArray():e).map(a=>v(a,n))}return e}const D={variables:[{name:"$feature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"},{name:"$userInput",type:"geometry"},{name:"$graph",type:"knowledgeGraph"}]},O={variables:[{name:"$feature",type:"feature"},{name:"$aggregatedFeatures",type:"featureSet"}]},U=new Map([["form-constraint",{variables:[{name:"$feature",type:"feature"}]}],["feature-z",{variables:[{name:"$feature",type:"feature"}]}],["field-calculation",{variables:[{name:"$feature",type:"feature"},{name:"$datastore",type:"featureSetCollection"}]}],["form-calculation",{variables:[{name:"$feature",type:"feature"},{name:"$originalFeature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$featureSet",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"},{name:"$editContext",type:"dictionary",properties:[{name:"editType",type:"text"}]}]}],["labeling",{variables:[{name:"$feature",type:"feature"}]}],["popup",D],["popup-element",D],["feature-reduction-popup",O],["feature-reduction-popup-element",O],["visualization",{variables:[{name:"$feature",type:"feature"},{name:"$view",type:"dictionary",properties:[{name:"scale",type:"number"}]}]}]]);function Ve(e){const n=U.get(e);if(!n){const a=Array.from(U.keys()).map(o=>`'${o}'`).join(", ");throw new $("createArcadeProfile:invalid-profile-name",`Invalid profile name '${e}'. You must specify one of the following values: ${a}`)}return G(n)}async function We(e,n,a={}){b||(b=await L());const{arcade:o,arcadeUtils:t}=b,{loadScriptDependencies:i,referencesMember:c,scriptIsAsync:s}=o,r=Z(n.variables,[]),u=r.filter(p=>p.type==="featureSet"||p.type==="featureSetCollection").map(p=>p.name.toLowerCase()),l=o.parseScript(e,u);if(!l)throw new $("arcade:invalid-script","Unable to create SyntaxTree");const S=t.extractFieldNames(l),f=o.scriptTouchesGeometry(l),h=r.map(p=>p.name.toLowerCase()).filter(p=>c(l,p)),m=s(l,u);await i(l,m,u);const C={vars:{},spatialReference:null,useAsync:m};for(const p of h)C.vars[p]="any";const{lruCache:A}=a,x=o.compileScript(l,C),k=o.featureSetUtils(),{services:j}=a;return{execute:(p,y={})=>{if(m)throw new $("arcade:invalid-execution-mode","Cannot execute the script in synchronous mode");const d=x(R(n,p,{lruCache:A,...y},k,m));return y.rawOutput?d:v(d,t)},executeAsync:async(p,y={})=>{const d=await x(R(n,p,{lruCache:A,services:j,...y},k,m));return y.rawOutput?d:v(d,t)},isAsync:m,variablesUsed:h,fieldsUsed:S,geometryUsed:f,syntaxTree:l}}export{We as createArcadeExecutor,Ve as createArcadeProfile}; +import{N as $,aV as G,c8 as L,ax as P,j as I}from"./index-BjUNJPVf.js";import{n as T,a as F,m as w}from"./TimeOnly-BXSODLxA.js";import{t as J}from"./ImmutableArray-BlMso3qf.js";import M from"./FeatureLayer-BHxNIHhy.js";import{d as z}from"./FeatureSet-opEn8ou8.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./UniqueValueRenderer-7V9Bhr-D.js";import"./ColorStop-DCGjAKLC.js";import"./diffUtils-uUoMDFQS.js";import"./colorRamps-CcakIWlU.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-BX9G5gNQ.js";import"./jsonUtils-Ox5U0P0F.js";import"./styleUtils-DOUOskVZ.js";import"./jsonUtils-Dw332y6z.js";import"./Version-Dqq_CHBG.js";import"./FieldsIndex-CK-0B5n9.js";import"./OverrideHelper-DxFZBnGL.js";import"./utils-CuXO_Zzq.js";import"./quantizationUtils-CfV316jZ.js";import"./heatmapUtils-BSteZBTj.js";import"./FormTemplate-BGxtsGX6.js";import"./editsZScale-Bfe6gH1b.js";import"./queryZScale-Dwvn5BlQ.js";import"./EditBusLayer-OslMX9fF.js";import"./FeatureEffectLayer-DarO4Ctx.js";import"./FeatureEffect-DBbkrS6j.js";import"./FeatureLayerBase-D0I-Escx.js";import"./featureLayerUtils-lwqyOSrl.js";import"./AttachmentQuery-DmEAIZff.js";import"./RelationshipQuery-BDJrOxaX.js";import"./LayerFloorInfo-DlYNbO-A.js";import"./serviceCapabilitiesUtils-DiP90Uds.js";import"./FeatureReductionLayer-CK-tyM-9.js";import"./FeatureReductionSelection-t3T7oa8H.js";import"./LabelClass-CeatfK8u.js";import"./labelUtils-3p0-m-Ee.js";import"./defaultsJSON-CHAaurhX.js";import"./MD5-C9MwAd2G.js";import"./OrderedLayer-dLoPhxcx.js";import"./OrderByInfo-DKyk5GLW.js";import"./RefreshableLayer-_r2TPtol.js";import"./TemporalLayer-CKICYnEl.js";import"./TimeInfo-DooETFWC.js";import"./FeatureTemplate-FZNGA_Ik.js";import"./FeatureType-CwUl8Nf5.js";import"./fieldProperties-DnrQXLBM.js";import"./labelingInfo-DqAUis6e.js";import"./versionUtils-BIAEZzrm.js";import"./styleUtils--I7zqeL6.js";import"./TopFeaturesQuery-CVQjqlfM.js";import"./popupUtils-DlZin22m.js";import"./interfaces-CL2NbQte.js";let b=null;function N(e,n,a,o={}){const t=n.elementType,i="value",c=t.type==="array"?[{name:i,type:t.type,elementType:t.elementType}]:t.type==="dictionary"?[{name:i,type:t.type,properties:t.properties}]:[{name:i,type:t.type}];return new J(e.map(s=>{const r={};return g(r,c,{[i]:s},a,o),r[i]}))}function E(e,n,a={}){const o=e instanceof z?new M({source:e.features,geometryType:e.geometryType,fields:e.fields,spatialReference:e.spatialReference}):e;return n.constructFeatureSet(o,a.spatialReference,null,!0,a.lruCache,a.interceptor)}function Q(e,n,a={}){const{spatialReference:o,interceptor:t,lruCache:i}=a;return typeof e=="string"?n.createFeatureSetCollectionFromService(e,o,i,t):n.createFeatureSetCollectionFromMap(e,o,i,t)}function V(e,n,a,o={}){const t={};return g(t,n.properties,e,a,o),new b.Dictionary(t)}function g(e,n,a,o,t={}){const i={};for(const c of Object.keys(a))i[c.toLowerCase()]=a[c];for(const c of n){const s=c.name.toLowerCase();if(t.variablesPreProcessed)e[s]=i[s];else switch(c.type){case"array":{const r=i[s];e[s]=r==null?null:N(r,c,o,t);break}case"feature":{const r=i[s];e[s]=r==null?null:b.Feature.createFromGraphic(r,t==null?void 0:t.timeZone);break}case"featureSet":{const r=i[s];e[s]=r==null?null:o?E(r,o,t):null;break}case"featureSetCollection":{const r=i[s];e[s]=r==null?null:o?Q(r,o,t):null;break}case"dictionary":{const r=i[s];e[s]=r==null?null:V(r,c,o,t);break}case"date":{const r=i[s];e[s]=r?r instanceof w?r:t!=null&&t.timeZone?w.dateJSAndZoneToArcadeDate(r,t==null?void 0:t.timeZone):w.dateJSToArcadeDate(r):null;break}case"dateOnly":{const r=i[s];e[s]=r?r instanceof F?r:F.fromReader(r):null;break}case"time":{const r=i[s];e[s]=r?r instanceof T?r:T.fromReader(r):null;break}case"knowledgeGraph":case"geometry":case"boolean":case"text":case"number":e[s]=i[s]}}}function Z(e,n){for(const a of e)n.push(a),a.type==="dictionary"&&Z(a.properties,n);return n}function R(e,n,a,o,t){const{spatialReference:i,interceptor:c,lruCache:s,console:r,abortSignal:u,timeZone:l,services:S={portal:P.getDefault()}}=a,f={vars:{},spatialReference:i,interceptor:c,timeZone:l,lrucache:s,useAsync:t,services:S,console:r,abortSignal:u};return n&&g(f.vars,e.variables,n,o,a),f}function v(e,n){switch(n.getArcadeType(e)){case"number":case"text":case"boolean":case"point":case"polygon":case"polyline":case"multipoint":case"extent":return e;case"date":return e.toJSDate();case"time":case"dateOnly":return e.toString();case"feature":{const a=(e.type,e),o="geometry"in a?a.geometry():null,t="readAttributes"in a?a.readAttributes():a.attributes;return new I({geometry:o,attributes:t})}case"dictionary":{const a=e,o=a.attributes,t={};for(const i of Object.keys(o))t[i]=v(a.field(i),n);return t}case"array":return("toArray"in e?e.toArray():e).map(a=>v(a,n))}return e}const D={variables:[{name:"$feature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"},{name:"$userInput",type:"geometry"},{name:"$graph",type:"knowledgeGraph"}]},O={variables:[{name:"$feature",type:"feature"},{name:"$aggregatedFeatures",type:"featureSet"}]},U=new Map([["form-constraint",{variables:[{name:"$feature",type:"feature"}]}],["feature-z",{variables:[{name:"$feature",type:"feature"}]}],["field-calculation",{variables:[{name:"$feature",type:"feature"},{name:"$datastore",type:"featureSetCollection"}]}],["form-calculation",{variables:[{name:"$feature",type:"feature"},{name:"$originalFeature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$featureSet",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"},{name:"$editContext",type:"dictionary",properties:[{name:"editType",type:"text"}]}]}],["labeling",{variables:[{name:"$feature",type:"feature"}]}],["popup",D],["popup-element",D],["feature-reduction-popup",O],["feature-reduction-popup-element",O],["visualization",{variables:[{name:"$feature",type:"feature"},{name:"$view",type:"dictionary",properties:[{name:"scale",type:"number"}]}]}]]);function Ve(e){const n=U.get(e);if(!n){const a=Array.from(U.keys()).map(o=>`'${o}'`).join(", ");throw new $("createArcadeProfile:invalid-profile-name",`Invalid profile name '${e}'. You must specify one of the following values: ${a}`)}return G(n)}async function We(e,n,a={}){b||(b=await L());const{arcade:o,arcadeUtils:t}=b,{loadScriptDependencies:i,referencesMember:c,scriptIsAsync:s}=o,r=Z(n.variables,[]),u=r.filter(p=>p.type==="featureSet"||p.type==="featureSetCollection").map(p=>p.name.toLowerCase()),l=o.parseScript(e,u);if(!l)throw new $("arcade:invalid-script","Unable to create SyntaxTree");const S=t.extractFieldNames(l),f=o.scriptTouchesGeometry(l),h=r.map(p=>p.name.toLowerCase()).filter(p=>c(l,p)),m=s(l,u);await i(l,m,u);const C={vars:{},spatialReference:null,useAsync:m};for(const p of h)C.vars[p]="any";const{lruCache:A}=a,x=o.compileScript(l,C),k=o.featureSetUtils(),{services:j}=a;return{execute:(p,y={})=>{if(m)throw new $("arcade:invalid-execution-mode","Cannot execute the script in synchronous mode");const d=x(R(n,p,{lruCache:A,...y},k,m));return y.rawOutput?d:v(d,t)},executeAsync:async(p,y={})=>{const d=await x(R(n,p,{lruCache:A,services:j,...y},k,m));return y.rawOutput?d:v(d,t)},isAsync:m,variablesUsed:h,fieldsUsed:S,geometryUsed:f,syntaxTree:l}}export{We as createArcadeExecutor,Ve as createArcadeProfile}; diff --git a/assets/arcadeAsyncRuntime-CNNOWwv8.js b/assets/arcadeAsyncRuntime-B50Rzrzf.js similarity index 97% rename from assets/arcadeAsyncRuntime-CNNOWwv8.js rename to assets/arcadeAsyncRuntime-B50Rzrzf.js index 8ccc226..dca5f33 100644 --- a/assets/arcadeAsyncRuntime-CNNOWwv8.js +++ b/assets/arcadeAsyncRuntime-B50Rzrzf.js @@ -1,2 +1,2 @@ -import{C as ue,Y as ce,M as fe,W as we,f as pe,a as Y,z as F,b as l,r as s,Q as R,U as A,H as M,G as h,N as I,L as Z,E as C,e as V,o as de,s as ee,w as y,F as E,O as p,R as S,J as $,I as v,p as he,u as me,B as ge,h as d,d as O,c as ye,m as D,_ as ve,Z as be,D as ne,g as Se,i as G,n as J,j as xe}from"./arcadeUtils-BoaybaAR.js";import{registerFunctions as Ie}from"./geomasync-BBmYY70D.js";import{et as T,aS as te}from"./index-CEWggaxV.js";import"./TimeOnly-Cm47ew5I.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./ImmutableArray-BlMso3qf.js";import"./number-Bu1a2qyF.js";import"./featureConversionUtils-CmP9mw0r.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./FieldsIndex-CLgRNeJ_.js";import"./portalUtils-mNGSLeDa.js";import"./geometryEngineAsync-B-ooCYDN.js";function Q(n){return n&&typeof n.then=="function"}const j=100;async function z(n,e){const t=[];for(let r=0;r{const r={spatialReference:this.context.spatialReference,console:this.context.console,lrucache:this.context.lrucache,timeZone:this.context.timeZone??null,exports:this.context.exports,libraryResolver:this.context.libraryResolver,interceptor:this.context.interceptor,localScope:{},depthCounter:{depth:e.depthCounter+1},globalScope:this.context.globalScope};if(r.depthCounter.depth>64)throw new l(e,s.MaximumCallDepth,null);return K(this.definition,r,t,null)}}call(e,t){return k(e,t,(r,o,a)=>{const i={spatialReference:e.spatialReference,services:e.services,console:e.console,libraryResolver:e.libraryResolver,exports:e.exports,lrucache:e.lrucache,timeZone:e.timeZone??null,interceptor:e.interceptor,localScope:{},abortSignal:e.abortSignal,globalScope:e.globalScope,depthCounter:{depth:e.depthCounter.depth+1}};if(i.depthCounter.depth>64)throw new l(e,s.MaximumCallDepth,t);return K(this.definition,i,a,t)})}marshalledCall(e,t,r,o){return o(e,t,async(a,i,c)=>{const f={spatialReference:e.spatialReference,globalScope:r.globalScope,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,console:e.console,abortSignal:e.abortSignal,lrucache:e.lrucache,timeZone:e.timeZone??null,interceptor:e.interceptor,localScope:{}};return c=c.map(w=>!v(w)||w instanceof G?w:J(w,e,o)),J(await K(this.definition,f,c,t),r,o)})}}class L extends xe{constructor(e){super(e)}async global(e){const t=this.executingContext.globalScope[e.toLowerCase()];if(t.valueset||(t.value=await u(this.executingContext,t.node),t.valueset=!0),v(t.value)&&!(t.value instanceof G)){const r=new G;r.fn=t.value,r.parameterEvaluator=k,r.context=this.executingContext,t.value=r}return t.value}setGlobal(e,t){if(v(t))throw new l(null,s.AssignModuleFunction,null);this.executingContext.globalScope[e.toLowerCase()]={value:t,valueset:!0,node:null}}hasGlobal(e){return this.executingContext.exports[e]===void 0&&(e=e.toLowerCase()),this.executingContext.exports[e]!==void 0}async loadModule(e){let t=e.spatialReference;t==null&&(t=new te({wkid:102100})),this.moduleScope=le({},e.customfunctions,e.timeZone),this.executingContext={spatialReference:t,services:e.services,libraryResolver:new ee(e.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{},abortSignal:e.abortSignal===void 0||e.abortSignal===null?{aborted:!1}:e.abortSignal,globalScope:this.moduleScope,console:e.console??se,lrucache:e.lrucache,timeZone:e.timeZone??null,interceptor:e.interceptor,localScope:null,depthCounter:{depth:1}},await u(this.executingContext,this.source.syntax)}}async function k(n,e,t){if(e.preparsed===!0){const o=t(n,null,e.arguments);return Q(o),o}const r=t(n,e,await z(n,e));return Q(r),r}async function u(n,e,t){if(e.breakpoint&&t!==!0)return await e.breakpoint(),u(n,e,!0);try{switch(e==null?void 0:e.type){case"VariableDeclarator":return await Te(n,e);case"ImportDeclaration":return await De(n,e);case"ExportNamedDeclaration":return await Ge(n,e);case"VariableDeclaration":return await oe(n,e,0);case"BlockStatement":case"Program":return await Pe(n,e);case"FunctionDeclaration":return await Ze(n,e);case"ReturnStatement":return await Ke(n,e);case"IfStatement":return await je(n,e);case"ExpressionStatement":return await $e(n,e);case"UpdateExpression":return await Ee(n,e);case"AssignmentExpression":return await Be(n,e);case"ForStatement":return await Le(n,e);case"WhileStatement":return await Ae(n,e);case"ForInStatement":return await ke(n,e);case"BreakStatement":return S;case"EmptyStatement":return p;case"ContinueStatement":return $;case"TemplateElement":return await He(n,e);case"TemplateLiteral":return await Je(n,e);case"Identifier":return await H(n,e);case"MemberExpression":return await Ue(n,e);case"Literal":return e.value;case"CallExpression":return await ze(n,e);case"UnaryExpression":return await qe(n,e);case"BinaryExpression":return await _e(n,e);case"LogicalExpression":return await Ve(n,e);case"ArrayExpression":return await We(n,e);case"ObjectExpression":return await Ce(n,e);case"Property":return await Re(n,e);default:throw new l(n,s.Unrecognized,e)}}catch(r){throw me(n,e,r)}}async function Ce(n,e){const t=[];for(let i=0;i{try{t.testResult===!0?++a>j?(a=0,setTimeout(()=>{B(n,e,t,r,o,a)},0)):B(n,e,t,r,o,a):t.lastAction instanceof y?r(t.lastAction):r(p)}catch(i){o(i)}},i=>{o(i)})}catch(i){o(i)}}function Le(n,e){try{return e.init!==null?u(n,e.init).then(()=>new Promise((t,r)=>{B(n,e,{testResult:!0,lastAction:p},o=>{t(o)},o=>{r(o)},0)})):new Promise((t,r)=>{B(n,e,{testResult:!0,lastAction:p},o=>{t(o)},o=>{r(o)},0)})}catch(t){return Promise.reject(t)}}function U(n,e,t,r,o,a,i,c,f,w){try{if(r<=a)return void c(p);o.value=i==="k"?t[a]:a,u(n,e.body).then(g=>{try{g instanceof y?c(g):g===S?c(p):++w>j?(w=0,setTimeout(()=>{U(n,e,t,r,o,a+1,i,c,f,w)},0)):U(n,e,t,r,o,a+1,i,c,f,w)}catch(P){f(P)}},g=>{f(g)})}catch(g){f(g)}}function q(n,e,t,r,o,a,i,c,f){try{if(t.length()<=o)return void i(p);r.value=a==="k"?t.get(o):o,u(n,e.body).then(w=>{w instanceof y?i(w):w===S?i(p):++f>j?(f=0,setTimeout(()=>{q(n,e,t,r,o+1,a,i,c,f)},0)):q(n,e,t,r,o+1,a,i,c,f)},w=>{c(w)})}catch(w){c(w)}}function W(n,e,t,r,o,a){try{if(a===void 0&&(a="i"),t.length===0)return void r.resolve(p);U(n,e,t,t.length,o,0,a,i=>{r.resolve(i)},i=>{r.reject(i)},0)}catch(i){r.reject(i)}}function Ne(n,e,t,r,o,a){try{if(a===void 0&&(a="i"),t.length===0)return void r.resolve(p);q(n,e,t,o,0,a,i=>{r.resolve(i)},i=>{r.reject(i)},0)}catch(i){r.reject(i)}}function Oe(n,e,t,r,o){try{W(n,e,t.keys(),r,o,"k")}catch(a){r.reject(a)}}function _(n,e,t,r,o,a,i,c){try{n.next().then(f=>{try{if(f===null)a(p);else{const w=ne.createFromGraphicLikeObject(f.geometry,f.attributes,r,e.timeZone);w._underlyingGraphic=f,o.value=w,u(e,t.body).then(g=>{try{g===S?a(p):g instanceof y?a(g):++c>j?(c=0,setTimeout(()=>{_(n,e,t,r,o,a,i,c)},0)):_(n,e,t,r,o,a,i,c)}catch(P){i(P)}},g=>{i(g)})}}catch(w){i(w)}},f=>{i(f)})}catch(f){i(f)}}async function ke(n,e){return new Promise((t,r)=>{u(n,e.right).then(o=>{try{let a=null;a=e.left.type==="VariableDeclaration"?u(n,e.left):Promise.resolve(),a.then(()=>{try{let i="";if(e.left.type==="VariableDeclaration"){const f=e.left.declarations[0].id;f.type==="Identifier"&&(i=f.name)}else e.left.type==="Identifier"&&(i=e.left.name);if(!i)throw new l(n,s.InvalidIdentifier,e);i=i.toLowerCase();let c=null;if(n.localScope!=null&&n.localScope[i]!==void 0&&(c=n.localScope[i]),c===null&&n.globalScope[i]!==void 0&&(c=n.globalScope[i]),c===null)return void r(new l(n,s.InvalidIdentifier,e));A(o)||h(o)?W(n,e,o,{reject:r,resolve:t},c):R(o)?Ne(n,e,o,{reject:r,resolve:t},c):o instanceof I||M(o)?Oe(n,e,o,{reject:r,resolve:t},c):ge(o)?_(o.iterator(n.abortSignal),n,e,o,c,f=>{t(f)},f=>{r(f)},0):W(n,e,[],{reject:r,resolve:t},c)}catch(i){r(i)}},r)}catch(a){r(a)}},r)})}async function Ee(n,e){const t=e.argument;if(t.type==="MemberExpression"){const a={t:null},i=await u(n,t.object);let c=null;a.t=i,t.computed===!0?c=await u(n,t.property):t.property.type==="Identifier"&&(c=t.property.name);const f=a.t;let w;if(A(f)){if(!C(c))throw new l(n,s.ArrayAccessorMustBeNumber,e);if(c<0&&(c=f.length+c),c<0||c>=f.length)throw new l(n,s.OutOfBounds,e);w=d(f[c]),f[c]=e.operator==="++"?w+1:w-1}else if(f instanceof I){if(h(c)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(f.hasField(c)!==!0)throw new l(n,s.FieldNotFound,e,{key:c});w=d(f.field(c)),f.setField(c,e.operator==="++"?w+1:w-1)}else if(f instanceof L){if(h(c)===!1)throw new l(n,s.ModuleAccessorMustBeString,e);if(f.hasGlobal(c)!==!0)throw new l(n,s.ModuleExportNotFound,e);w=d(await f.global(c)),f.setGlobal(c,e.operator==="++"?w+1:w-1)}else{if(!M(f))throw R(f)?new l(n,s.Immutable,e):new l(n,s.InvalidParameter,e);if(h(c)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(f.hasField(c)!==!0)throw new l(n,s.FieldNotFound,e,{key:c});w=d(f.field(c)),f.setField(c,e.operator==="++"?w+1:w-1)}return e.prefix===!1?w:e.operator==="++"?w+1:w-1}const r=e.argument.type==="Identifier"?e.argument.name.toLowerCase():"";if(!r)throw new l(n,s.InvalidIdentifier,e);let o;if(n.localScope!=null&&n.localScope[r]!==void 0)return o=d(n.localScope[r].value),n.localScope[r]={value:e.operator==="++"?o+1:o-1,valueset:!0,node:e},e.prefix===!1?o:e.operator==="++"?o+1:o-1;if(n.globalScope[r]!==void 0)return o=d(n.globalScope[r].value),n.globalScope[r]={value:e.operator==="++"?o+1:o-1,valueset:!0,node:e},e.prefix===!1?o:e.operator==="++"?o+1:o-1;throw new l(n,s.InvalidIdentifier,e)}function b(n,e,t,r,o){switch(e){case"=":return n===p?null:n;case"/=":return d(t)/d(n);case"*=":return d(t)*d(n);case"-=":return d(t)-d(n);case"+=":return h(t)||h(n)?O(t)+O(n):d(t)+d(n);case"%=":return d(t)%d(n);default:throw new l(o,s.UnsupportedOperator,r)}}async function Be(n,e){const t=e.left;if(t.type==="MemberExpression"){const o=await u(n,t.object);let a=null;if(t.computed===!0)a=await u(n,t.property);else{if(t.property.type!=="Identifier")throw new l(n,s.InvalidIdentifier,e);a=t.property.name}const i=await u(n,e.right);if(A(o)){if(!C(a))throw new l(n,s.ArrayAccessorMustBeNumber,e);if(a<0&&(a=o.length+a),a<0||a>o.length)throw new l(n,s.OutOfBounds,e);if(a===o.length){if(e.operator!=="=")throw new l(n,s.OutOfBounds,e);o[a]=b(i,e.operator,o[a],e,n)}else o[a]=b(i,e.operator,o[a],e,n)}else if(o instanceof I){if(h(a)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(o.hasField(a)===!0)o.setField(a,b(i,e.operator,o.field(a),e,n));else{if(e.operator!=="=")throw new l(n,s.FieldNotFound,e,{key:a});o.setField(a,b(i,e.operator,null,e,n))}}else if(o instanceof L){if(h(a)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(o.hasGlobal(a)!==!0)throw new l(n,s.ModuleExportNotFound,e);o.setGlobal(a,b(i,e.operator,await o.global(a),e,n))}else{if(!M(o))throw R(o)?new l(n,s.Immutable,e):new l(n,s.InvalidParameter,e);if(h(a)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(o.hasField(a)===!0)o.setField(a,b(i,e.operator,o.field(a),e,n));else{if(e.operator!=="=")throw new l(n,s.FieldNotFound,e,{key:a});o.setField(a,b(i,e.operator,null,e,n))}}return p}const r=t.name.toLowerCase();if(n.localScope!=null&&n.localScope[r]!==void 0){const o=await u(n,e.right);return n.localScope[r]={value:b(o,e.operator,n.localScope[r].value,e,n),valueset:!0,node:e.right},p}if(n.globalScope[r]!==void 0){const o=await u(n,e.right);return n.globalScope[r]={value:b(o,e.operator,n.globalScope[r].value,e,n),valueset:!0,node:e.right},p}throw new l(n,s.InvalidIdentifier,e)}async function $e(n,e){if(e.expression.type==="AssignmentExpression")return u(n,e.expression);if(e.expression.type==="CallExpression"){const r=await u(n,e.expression);return r===p?p:new E(r)}const t=await u(n,e.expression);return t===p?p:new E(t)}async function je(n,e){const t=await u(n,e.test);if(t===!0)return u(n,e.consequent);if(t===!1)return e.alternate!==null?u(n,e.alternate):p;throw new l(n,s.BooleanConditionRequired,e)}async function Pe(n,e){return re(n,e,0)}async function re(n,e,t){if(t>=e.body.length)return p;const r=await u(n,e.body[t]);return r instanceof y||r===S||r===$||t===e.body.length-1?r:re(n,e,t+1)}async function Ke(n,e){if(e.argument===null)return new y(p);const t=await u(n,e.argument);return new y(t)}async function Ze(n,e){const t=e.id.name.toLowerCase();return n.globalScope[t]={valueset:!0,node:null,value:new Fe(e,n)},p}async function De(n,e){var a,i;const t=e.specifiers[0].local.name.toLowerCase(),r=n.libraryResolver.loadLibrary(t);let o=null;return(a=n.libraryResolver._moduleSingletons)!=null&&a.has(r.uri)?o=n.libraryResolver._moduleSingletons.get(r.uri):(o=new L(r),await o.loadModule(n),(i=n.libraryResolver._moduleSingletons)==null||i.set(r.uri,o)),n.globalScope[t]={value:o,valueset:!0,node:e},p}async function Ge(n,e){if(await u(n,e.declaration),e.declaration.type==="FunctionDeclaration")n.exports[e.declaration.id.name.toLowerCase()]="function";else if(e.declaration.type==="VariableDeclaration")for(const t of e.declaration.declarations)n.exports[t.id.name.toLowerCase()]="variable";return p}async function oe(n,e,t){return t>=e.declarations.length?p:(await u(n,e.declarations[t]),t===e.declarations.length-1||await oe(n,e,t+1),p)}async function Te(n,e){let t=null;if(t=e.init===null?null:await u(n,e.init),n.localScope!==null){if(t===p&&(t=null),e.id.type!=="Identifier")throw new l(n,s.InvalidIdentifier,e);const o=e.id.name.toLowerCase();return n.localScope!=null&&(n.localScope[o]={value:t,valueset:!0,node:e.init}),p}if(e.id.type!=="Identifier")throw new l(n,s.InvalidIdentifier,e);const r=e.id.name.toLowerCase();return t===p&&(t=null),n.globalScope[r]={value:t,valueset:!0,node:e.init},p}async function Ue(n,e){const t=await u(n,e.object);if(t===null)throw new l(n,s.MemberOfNull,e);if(e.computed===!1){if(e.property.type==="Identifier"){if(t instanceof I||M(t))return t.field(e.property.name);if(t instanceof T)return Z(t,e.property.name,n,e);if(t instanceof L){if(!t.hasGlobal(e.property.name))throw new l(n,s.InvalidIdentifier,e);return t.global(e.property.name)}throw new l(n,s.InvalidMemberAccessKey,e)}throw new l(n,s.InvalidMemberAccessKey,e)}let r=await u(n,e.property);if(t instanceof I||M(t)){if(h(r))return t.field(r);throw new l(n,s.InvalidMemberAccessKey,e)}if(t instanceof L){if(h(r))return t.global(r);throw new l(n,s.InvalidMemberAccessKey,e)}if(t instanceof T){if(h(r))return Z(t,r,n,e);throw new l(n,s.InvalidMemberAccessKey,e)}if(A(t)){if(C(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=t.length+r),r>=t.length||r<0)throw new l(n,s.OutOfBounds,e);return t[r]}throw new l(n,s.InvalidMemberAccessKey,e)}if(R(t)){if(C(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=t.length()+r),r>=t.length()||r<0)throw new l(n,s.OutOfBounds,e);return t.get(r)}throw new l(n,s.InvalidMemberAccessKey,e)}if(h(t)){if(C(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=t.length+r),r>=t.length||r<0)throw new l(n,s.OutOfBounds,e);return t[r]}throw new l(n,s.InvalidMemberAccessKey,e)}throw new l(n,s.InvalidMemberAccessKey,e)}async function qe(n,e){const t=await u(n,e.argument);if(F(t)){if(e.operator==="!")return!t;if(e.operator==="-")return-1*d(t);if(e.operator==="+")return 1*d(t);if(e.operator==="~")return~d(t);throw new l(n,s.UnsupportedUnaryOperator,e)}if(e.operator==="-")return-1*d(t);if(e.operator==="+")return 1*d(t);if(e.operator==="~")return~d(t);throw new l(n,s.UnsupportedUnaryOperator,e)}async function We(n,e){const t=[];for(let r=0;r>":case">>>":case"^":case"&":return ve(d(r),d(o),e.operator);case"==":return D(r,o);case"!=":return!D(r,o);case"<":case">":case"<=":case">=":return ye(r,o,e.operator);case"+":return h(r)||h(o)?O(r)+O(o):d(r)+d(o);case"-":return d(r)-d(o);case"*":return d(r)*d(o);case"/":return d(r)/d(o);case"%":return d(r)%d(o);default:throw new l(n,s.UnsupportedOperator,e)}}async function Ve(n,e){const t=await u(n,e.left);let r=null;if(!F(t))throw new l(n,s.LogicalExpressionOnlyBoolean,e);switch(e.operator){case"||":if(t===!0)return t;if(r=await u(n,e.right),F(r))return r;throw new l(n,s.LogicExpressionOrAnd,e);case"&&":if(t===!1)return t;if(r=await u(n,e.right),F(r))return r;throw new l(n,s.LogicExpressionOrAnd,e);default:throw new l(n,s.LogicExpressionOrAnd,e)}}async function H(n,e){const t=e.name.toLowerCase();if(n.localScope!=null&&n.localScope[t]!==void 0){const r=n.localScope[t];if(r.valueset===!0)return r.value;if(r.d!==null)return r.d;r.d=u(n,r.node);const o=await r.d;return r.value=o,r.valueset=!0,o}if(n.globalScope[t]!==void 0){const r=n.globalScope[t];if(r.valueset===!0)return r.value;if(r.d!==null)return r.d;r.d=u(n,r.node);const o=await r.d;return r.value=o,r.valueset=!0,o}throw new l(n,s.InvalidIdentifier,e)}async function ze(n,e){if(e.callee.type==="MemberExpression"){const t=await u(n,e.callee.object);if(!(t instanceof L))throw new l(n,s.FunctionNotFound,e);const r=e.callee.computed===!1?e.callee.property.name:await u(n,e.callee.property);if(!t.hasGlobal(r))throw new l(n,s.FunctionNotFound,e);const o=await t.global(r);if(!v(o))throw new l(n,s.CallNonFunction,e);return o.call(n,e)}if(e.callee.type!=="Identifier")throw new l(n,s.FunctionNotFound,e);if(n.localScope!=null&&n.localScope[e.callee.name.toLowerCase()]!==void 0){const t=n.localScope[e.callee.name.toLowerCase()];if(v(t.value))return t.value.call(n,e);throw new l(n,s.CallNonFunction,e)}if(n.globalScope[e.callee.name.toLowerCase()]!==void 0){const t=n.globalScope[e.callee.name.toLowerCase()];if(v(t.value))return t.value.call(n,e);throw new l(n,s.CallNonFunction,e)}throw new l(n,s.FunctionNotFound,e)}async function He(n,e){return e.value?e.value.cooked:""}function Ye(n,e,t){if(v(n))throw new l(e,s.NoFunctionInTemplateLiteral,t);return n}async function Je(n,e){const t=[];for(let a=0;a{const r={spatialReference:this.context.spatialReference,console:this.context.console,lrucache:this.context.lrucache,timeZone:this.context.timeZone??null,exports:this.context.exports,libraryResolver:this.context.libraryResolver,interceptor:this.context.interceptor,localScope:{},depthCounter:{depth:e.depthCounter+1},globalScope:this.context.globalScope};if(r.depthCounter.depth>64)throw new l(e,s.MaximumCallDepth,null);return K(this.definition,r,t,null)}}call(e,t){return k(e,t,(r,o,a)=>{const i={spatialReference:e.spatialReference,services:e.services,console:e.console,libraryResolver:e.libraryResolver,exports:e.exports,lrucache:e.lrucache,timeZone:e.timeZone??null,interceptor:e.interceptor,localScope:{},abortSignal:e.abortSignal,globalScope:e.globalScope,depthCounter:{depth:e.depthCounter.depth+1}};if(i.depthCounter.depth>64)throw new l(e,s.MaximumCallDepth,t);return K(this.definition,i,a,t)})}marshalledCall(e,t,r,o){return o(e,t,async(a,i,c)=>{const f={spatialReference:e.spatialReference,globalScope:r.globalScope,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,console:e.console,abortSignal:e.abortSignal,lrucache:e.lrucache,timeZone:e.timeZone??null,interceptor:e.interceptor,localScope:{}};return c=c.map(w=>!v(w)||w instanceof G?w:J(w,e,o)),J(await K(this.definition,f,c,t),r,o)})}}class L extends xe{constructor(e){super(e)}async global(e){const t=this.executingContext.globalScope[e.toLowerCase()];if(t.valueset||(t.value=await u(this.executingContext,t.node),t.valueset=!0),v(t.value)&&!(t.value instanceof G)){const r=new G;r.fn=t.value,r.parameterEvaluator=k,r.context=this.executingContext,t.value=r}return t.value}setGlobal(e,t){if(v(t))throw new l(null,s.AssignModuleFunction,null);this.executingContext.globalScope[e.toLowerCase()]={value:t,valueset:!0,node:null}}hasGlobal(e){return this.executingContext.exports[e]===void 0&&(e=e.toLowerCase()),this.executingContext.exports[e]!==void 0}async loadModule(e){let t=e.spatialReference;t==null&&(t=new te({wkid:102100})),this.moduleScope=le({},e.customfunctions,e.timeZone),this.executingContext={spatialReference:t,services:e.services,libraryResolver:new ee(e.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{},abortSignal:e.abortSignal===void 0||e.abortSignal===null?{aborted:!1}:e.abortSignal,globalScope:this.moduleScope,console:e.console??se,lrucache:e.lrucache,timeZone:e.timeZone??null,interceptor:e.interceptor,localScope:null,depthCounter:{depth:1}},await u(this.executingContext,this.source.syntax)}}async function k(n,e,t){if(e.preparsed===!0){const o=t(n,null,e.arguments);return Q(o),o}const r=t(n,e,await z(n,e));return Q(r),r}async function u(n,e,t){if(e.breakpoint&&t!==!0)return await e.breakpoint(),u(n,e,!0);try{switch(e==null?void 0:e.type){case"VariableDeclarator":return await Te(n,e);case"ImportDeclaration":return await De(n,e);case"ExportNamedDeclaration":return await Ge(n,e);case"VariableDeclaration":return await oe(n,e,0);case"BlockStatement":case"Program":return await Pe(n,e);case"FunctionDeclaration":return await Ze(n,e);case"ReturnStatement":return await Ke(n,e);case"IfStatement":return await je(n,e);case"ExpressionStatement":return await $e(n,e);case"UpdateExpression":return await Ee(n,e);case"AssignmentExpression":return await Be(n,e);case"ForStatement":return await Le(n,e);case"WhileStatement":return await Ae(n,e);case"ForInStatement":return await ke(n,e);case"BreakStatement":return S;case"EmptyStatement":return p;case"ContinueStatement":return $;case"TemplateElement":return await He(n,e);case"TemplateLiteral":return await Je(n,e);case"Identifier":return await H(n,e);case"MemberExpression":return await Ue(n,e);case"Literal":return e.value;case"CallExpression":return await ze(n,e);case"UnaryExpression":return await qe(n,e);case"BinaryExpression":return await _e(n,e);case"LogicalExpression":return await Ve(n,e);case"ArrayExpression":return await We(n,e);case"ObjectExpression":return await Ce(n,e);case"Property":return await Re(n,e);default:throw new l(n,s.Unrecognized,e)}}catch(r){throw me(n,e,r)}}async function Ce(n,e){const t=[];for(let i=0;i{try{t.testResult===!0?++a>j?(a=0,setTimeout(()=>{B(n,e,t,r,o,a)},0)):B(n,e,t,r,o,a):t.lastAction instanceof y?r(t.lastAction):r(p)}catch(i){o(i)}},i=>{o(i)})}catch(i){o(i)}}function Le(n,e){try{return e.init!==null?u(n,e.init).then(()=>new Promise((t,r)=>{B(n,e,{testResult:!0,lastAction:p},o=>{t(o)},o=>{r(o)},0)})):new Promise((t,r)=>{B(n,e,{testResult:!0,lastAction:p},o=>{t(o)},o=>{r(o)},0)})}catch(t){return Promise.reject(t)}}function U(n,e,t,r,o,a,i,c,f,w){try{if(r<=a)return void c(p);o.value=i==="k"?t[a]:a,u(n,e.body).then(g=>{try{g instanceof y?c(g):g===S?c(p):++w>j?(w=0,setTimeout(()=>{U(n,e,t,r,o,a+1,i,c,f,w)},0)):U(n,e,t,r,o,a+1,i,c,f,w)}catch(P){f(P)}},g=>{f(g)})}catch(g){f(g)}}function q(n,e,t,r,o,a,i,c,f){try{if(t.length()<=o)return void i(p);r.value=a==="k"?t.get(o):o,u(n,e.body).then(w=>{w instanceof y?i(w):w===S?i(p):++f>j?(f=0,setTimeout(()=>{q(n,e,t,r,o+1,a,i,c,f)},0)):q(n,e,t,r,o+1,a,i,c,f)},w=>{c(w)})}catch(w){c(w)}}function W(n,e,t,r,o,a){try{if(a===void 0&&(a="i"),t.length===0)return void r.resolve(p);U(n,e,t,t.length,o,0,a,i=>{r.resolve(i)},i=>{r.reject(i)},0)}catch(i){r.reject(i)}}function Ne(n,e,t,r,o,a){try{if(a===void 0&&(a="i"),t.length===0)return void r.resolve(p);q(n,e,t,o,0,a,i=>{r.resolve(i)},i=>{r.reject(i)},0)}catch(i){r.reject(i)}}function Oe(n,e,t,r,o){try{W(n,e,t.keys(),r,o,"k")}catch(a){r.reject(a)}}function _(n,e,t,r,o,a,i,c){try{n.next().then(f=>{try{if(f===null)a(p);else{const w=ne.createFromGraphicLikeObject(f.geometry,f.attributes,r,e.timeZone);w._underlyingGraphic=f,o.value=w,u(e,t.body).then(g=>{try{g===S?a(p):g instanceof y?a(g):++c>j?(c=0,setTimeout(()=>{_(n,e,t,r,o,a,i,c)},0)):_(n,e,t,r,o,a,i,c)}catch(P){i(P)}},g=>{i(g)})}}catch(w){i(w)}},f=>{i(f)})}catch(f){i(f)}}async function ke(n,e){return new Promise((t,r)=>{u(n,e.right).then(o=>{try{let a=null;a=e.left.type==="VariableDeclaration"?u(n,e.left):Promise.resolve(),a.then(()=>{try{let i="";if(e.left.type==="VariableDeclaration"){const f=e.left.declarations[0].id;f.type==="Identifier"&&(i=f.name)}else e.left.type==="Identifier"&&(i=e.left.name);if(!i)throw new l(n,s.InvalidIdentifier,e);i=i.toLowerCase();let c=null;if(n.localScope!=null&&n.localScope[i]!==void 0&&(c=n.localScope[i]),c===null&&n.globalScope[i]!==void 0&&(c=n.globalScope[i]),c===null)return void r(new l(n,s.InvalidIdentifier,e));A(o)||h(o)?W(n,e,o,{reject:r,resolve:t},c):R(o)?Ne(n,e,o,{reject:r,resolve:t},c):o instanceof I||M(o)?Oe(n,e,o,{reject:r,resolve:t},c):ge(o)?_(o.iterator(n.abortSignal),n,e,o,c,f=>{t(f)},f=>{r(f)},0):W(n,e,[],{reject:r,resolve:t},c)}catch(i){r(i)}},r)}catch(a){r(a)}},r)})}async function Ee(n,e){const t=e.argument;if(t.type==="MemberExpression"){const a={t:null},i=await u(n,t.object);let c=null;a.t=i,t.computed===!0?c=await u(n,t.property):t.property.type==="Identifier"&&(c=t.property.name);const f=a.t;let w;if(A(f)){if(!C(c))throw new l(n,s.ArrayAccessorMustBeNumber,e);if(c<0&&(c=f.length+c),c<0||c>=f.length)throw new l(n,s.OutOfBounds,e);w=d(f[c]),f[c]=e.operator==="++"?w+1:w-1}else if(f instanceof I){if(h(c)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(f.hasField(c)!==!0)throw new l(n,s.FieldNotFound,e,{key:c});w=d(f.field(c)),f.setField(c,e.operator==="++"?w+1:w-1)}else if(f instanceof L){if(h(c)===!1)throw new l(n,s.ModuleAccessorMustBeString,e);if(f.hasGlobal(c)!==!0)throw new l(n,s.ModuleExportNotFound,e);w=d(await f.global(c)),f.setGlobal(c,e.operator==="++"?w+1:w-1)}else{if(!M(f))throw R(f)?new l(n,s.Immutable,e):new l(n,s.InvalidParameter,e);if(h(c)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(f.hasField(c)!==!0)throw new l(n,s.FieldNotFound,e,{key:c});w=d(f.field(c)),f.setField(c,e.operator==="++"?w+1:w-1)}return e.prefix===!1?w:e.operator==="++"?w+1:w-1}const r=e.argument.type==="Identifier"?e.argument.name.toLowerCase():"";if(!r)throw new l(n,s.InvalidIdentifier,e);let o;if(n.localScope!=null&&n.localScope[r]!==void 0)return o=d(n.localScope[r].value),n.localScope[r]={value:e.operator==="++"?o+1:o-1,valueset:!0,node:e},e.prefix===!1?o:e.operator==="++"?o+1:o-1;if(n.globalScope[r]!==void 0)return o=d(n.globalScope[r].value),n.globalScope[r]={value:e.operator==="++"?o+1:o-1,valueset:!0,node:e},e.prefix===!1?o:e.operator==="++"?o+1:o-1;throw new l(n,s.InvalidIdentifier,e)}function b(n,e,t,r,o){switch(e){case"=":return n===p?null:n;case"/=":return d(t)/d(n);case"*=":return d(t)*d(n);case"-=":return d(t)-d(n);case"+=":return h(t)||h(n)?O(t)+O(n):d(t)+d(n);case"%=":return d(t)%d(n);default:throw new l(o,s.UnsupportedOperator,r)}}async function Be(n,e){const t=e.left;if(t.type==="MemberExpression"){const o=await u(n,t.object);let a=null;if(t.computed===!0)a=await u(n,t.property);else{if(t.property.type!=="Identifier")throw new l(n,s.InvalidIdentifier,e);a=t.property.name}const i=await u(n,e.right);if(A(o)){if(!C(a))throw new l(n,s.ArrayAccessorMustBeNumber,e);if(a<0&&(a=o.length+a),a<0||a>o.length)throw new l(n,s.OutOfBounds,e);if(a===o.length){if(e.operator!=="=")throw new l(n,s.OutOfBounds,e);o[a]=b(i,e.operator,o[a],e,n)}else o[a]=b(i,e.operator,o[a],e,n)}else if(o instanceof I){if(h(a)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(o.hasField(a)===!0)o.setField(a,b(i,e.operator,o.field(a),e,n));else{if(e.operator!=="=")throw new l(n,s.FieldNotFound,e,{key:a});o.setField(a,b(i,e.operator,null,e,n))}}else if(o instanceof L){if(h(a)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(o.hasGlobal(a)!==!0)throw new l(n,s.ModuleExportNotFound,e);o.setGlobal(a,b(i,e.operator,await o.global(a),e,n))}else{if(!M(o))throw R(o)?new l(n,s.Immutable,e):new l(n,s.InvalidParameter,e);if(h(a)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(o.hasField(a)===!0)o.setField(a,b(i,e.operator,o.field(a),e,n));else{if(e.operator!=="=")throw new l(n,s.FieldNotFound,e,{key:a});o.setField(a,b(i,e.operator,null,e,n))}}return p}const r=t.name.toLowerCase();if(n.localScope!=null&&n.localScope[r]!==void 0){const o=await u(n,e.right);return n.localScope[r]={value:b(o,e.operator,n.localScope[r].value,e,n),valueset:!0,node:e.right},p}if(n.globalScope[r]!==void 0){const o=await u(n,e.right);return n.globalScope[r]={value:b(o,e.operator,n.globalScope[r].value,e,n),valueset:!0,node:e.right},p}throw new l(n,s.InvalidIdentifier,e)}async function $e(n,e){if(e.expression.type==="AssignmentExpression")return u(n,e.expression);if(e.expression.type==="CallExpression"){const r=await u(n,e.expression);return r===p?p:new E(r)}const t=await u(n,e.expression);return t===p?p:new E(t)}async function je(n,e){const t=await u(n,e.test);if(t===!0)return u(n,e.consequent);if(t===!1)return e.alternate!==null?u(n,e.alternate):p;throw new l(n,s.BooleanConditionRequired,e)}async function Pe(n,e){return re(n,e,0)}async function re(n,e,t){if(t>=e.body.length)return p;const r=await u(n,e.body[t]);return r instanceof y||r===S||r===$||t===e.body.length-1?r:re(n,e,t+1)}async function Ke(n,e){if(e.argument===null)return new y(p);const t=await u(n,e.argument);return new y(t)}async function Ze(n,e){const t=e.id.name.toLowerCase();return n.globalScope[t]={valueset:!0,node:null,value:new Fe(e,n)},p}async function De(n,e){var a,i;const t=e.specifiers[0].local.name.toLowerCase(),r=n.libraryResolver.loadLibrary(t);let o=null;return(a=n.libraryResolver._moduleSingletons)!=null&&a.has(r.uri)?o=n.libraryResolver._moduleSingletons.get(r.uri):(o=new L(r),await o.loadModule(n),(i=n.libraryResolver._moduleSingletons)==null||i.set(r.uri,o)),n.globalScope[t]={value:o,valueset:!0,node:e},p}async function Ge(n,e){if(await u(n,e.declaration),e.declaration.type==="FunctionDeclaration")n.exports[e.declaration.id.name.toLowerCase()]="function";else if(e.declaration.type==="VariableDeclaration")for(const t of e.declaration.declarations)n.exports[t.id.name.toLowerCase()]="variable";return p}async function oe(n,e,t){return t>=e.declarations.length?p:(await u(n,e.declarations[t]),t===e.declarations.length-1||await oe(n,e,t+1),p)}async function Te(n,e){let t=null;if(t=e.init===null?null:await u(n,e.init),n.localScope!==null){if(t===p&&(t=null),e.id.type!=="Identifier")throw new l(n,s.InvalidIdentifier,e);const o=e.id.name.toLowerCase();return n.localScope!=null&&(n.localScope[o]={value:t,valueset:!0,node:e.init}),p}if(e.id.type!=="Identifier")throw new l(n,s.InvalidIdentifier,e);const r=e.id.name.toLowerCase();return t===p&&(t=null),n.globalScope[r]={value:t,valueset:!0,node:e.init},p}async function Ue(n,e){const t=await u(n,e.object);if(t===null)throw new l(n,s.MemberOfNull,e);if(e.computed===!1){if(e.property.type==="Identifier"){if(t instanceof I||M(t))return t.field(e.property.name);if(t instanceof T)return Z(t,e.property.name,n,e);if(t instanceof L){if(!t.hasGlobal(e.property.name))throw new l(n,s.InvalidIdentifier,e);return t.global(e.property.name)}throw new l(n,s.InvalidMemberAccessKey,e)}throw new l(n,s.InvalidMemberAccessKey,e)}let r=await u(n,e.property);if(t instanceof I||M(t)){if(h(r))return t.field(r);throw new l(n,s.InvalidMemberAccessKey,e)}if(t instanceof L){if(h(r))return t.global(r);throw new l(n,s.InvalidMemberAccessKey,e)}if(t instanceof T){if(h(r))return Z(t,r,n,e);throw new l(n,s.InvalidMemberAccessKey,e)}if(A(t)){if(C(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=t.length+r),r>=t.length||r<0)throw new l(n,s.OutOfBounds,e);return t[r]}throw new l(n,s.InvalidMemberAccessKey,e)}if(R(t)){if(C(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=t.length()+r),r>=t.length()||r<0)throw new l(n,s.OutOfBounds,e);return t.get(r)}throw new l(n,s.InvalidMemberAccessKey,e)}if(h(t)){if(C(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=t.length+r),r>=t.length||r<0)throw new l(n,s.OutOfBounds,e);return t[r]}throw new l(n,s.InvalidMemberAccessKey,e)}throw new l(n,s.InvalidMemberAccessKey,e)}async function qe(n,e){const t=await u(n,e.argument);if(F(t)){if(e.operator==="!")return!t;if(e.operator==="-")return-1*d(t);if(e.operator==="+")return 1*d(t);if(e.operator==="~")return~d(t);throw new l(n,s.UnsupportedUnaryOperator,e)}if(e.operator==="-")return-1*d(t);if(e.operator==="+")return 1*d(t);if(e.operator==="~")return~d(t);throw new l(n,s.UnsupportedUnaryOperator,e)}async function We(n,e){const t=[];for(let r=0;r>":case">>>":case"^":case"&":return ve(d(r),d(o),e.operator);case"==":return D(r,o);case"!=":return!D(r,o);case"<":case">":case"<=":case">=":return ye(r,o,e.operator);case"+":return h(r)||h(o)?O(r)+O(o):d(r)+d(o);case"-":return d(r)-d(o);case"*":return d(r)*d(o);case"/":return d(r)/d(o);case"%":return d(r)%d(o);default:throw new l(n,s.UnsupportedOperator,e)}}async function Ve(n,e){const t=await u(n,e.left);let r=null;if(!F(t))throw new l(n,s.LogicalExpressionOnlyBoolean,e);switch(e.operator){case"||":if(t===!0)return t;if(r=await u(n,e.right),F(r))return r;throw new l(n,s.LogicExpressionOrAnd,e);case"&&":if(t===!1)return t;if(r=await u(n,e.right),F(r))return r;throw new l(n,s.LogicExpressionOrAnd,e);default:throw new l(n,s.LogicExpressionOrAnd,e)}}async function H(n,e){const t=e.name.toLowerCase();if(n.localScope!=null&&n.localScope[t]!==void 0){const r=n.localScope[t];if(r.valueset===!0)return r.value;if(r.d!==null)return r.d;r.d=u(n,r.node);const o=await r.d;return r.value=o,r.valueset=!0,o}if(n.globalScope[t]!==void 0){const r=n.globalScope[t];if(r.valueset===!0)return r.value;if(r.d!==null)return r.d;r.d=u(n,r.node);const o=await r.d;return r.value=o,r.valueset=!0,o}throw new l(n,s.InvalidIdentifier,e)}async function ze(n,e){if(e.callee.type==="MemberExpression"){const t=await u(n,e.callee.object);if(!(t instanceof L))throw new l(n,s.FunctionNotFound,e);const r=e.callee.computed===!1?e.callee.property.name:await u(n,e.callee.property);if(!t.hasGlobal(r))throw new l(n,s.FunctionNotFound,e);const o=await t.global(r);if(!v(o))throw new l(n,s.CallNonFunction,e);return o.call(n,e)}if(e.callee.type!=="Identifier")throw new l(n,s.FunctionNotFound,e);if(n.localScope!=null&&n.localScope[e.callee.name.toLowerCase()]!==void 0){const t=n.localScope[e.callee.name.toLowerCase()];if(v(t.value))return t.value.call(n,e);throw new l(n,s.CallNonFunction,e)}if(n.globalScope[e.callee.name.toLowerCase()]!==void 0){const t=n.globalScope[e.callee.name.toLowerCase()];if(v(t.value))return t.value.call(n,e);throw new l(n,s.CallNonFunction,e)}throw new l(n,s.FunctionNotFound,e)}async function He(n,e){return e.value?e.value.cooked:""}function Ye(n,e,t){if(v(n))throw new l(e,s.NoFunctionInTemplateLiteral,t);return n}async function Je(n,e){const t=[];for(let a=0;a __vite__mapDeps.viteFileDeps[i]) } -import{aF as ar,eu as Xe,aA as J,a_ as _a,hj as st,aE as we,aB as ie,aC as te,aD as Ie,et as $,cd as sr,b0 as le,kH as di,eD as hi,aS as St,bE as Ra,cN as pi,ly as Sr,bo as It,ah as mi,ax as or,lz as La,_ as je,M as Pa,E as Di,aV as Oa}from"./index-CEWggaxV.js";import{m as U,a as De,n as ge,h as _t,c as Be,r as Xt,b as se}from"./TimeOnly-Cm47ew5I.js";import{t as ce}from"./ImmutableArray-BlMso3qf.js";import{s as Ua,p as gi}from"./number-Bu1a2qyF.js";import{r as za}from"./featureConversionUtils-CmP9mw0r.js";import{Z as Za}from"./FieldsIndex-CLgRNeJ_.js";let qt=class{constructor(t){this.source=t}},mn=class{constructor(t,n){this._moduleSingletons=t,this._syntaxModules=n}loadLibrary(t){if(this._syntaxModules==null)return null;const n=this._syntaxModules[t.toLowerCase()];return n?{syntax:n.script,uri:n.uri}:null}};var c;(function(e){e.AsyncNotEnabled="AsyncNotEnabled",e.ModulesNotSupported="ModulesNotSupported",e.CircularModules="CircularModules",e.CannotCompareDateAndTime="CannotCompareDateAndTime",e.NeverReach="NeverReach",e.UnsupportedHashType="UnsupportedHashType",e.InvalidParameter="InvalidParameter",e.FeatureSetDoesNotHaveSubtypes="FeatureSetDoesNotHaveSubtypes",e.UnexpectedToken="UnexpectedToken",e.Unrecognized="Unrecognized",e.UnrecognizedType="UnrecognizedType",e.MaximumCallDepth="MaximumCallDepth",e.BooleanConditionRequired="BooleanConditionRequired",e.TypeNotAllowedInFeature="TypeNotAllowedInFeature",e.KeyMustBeString="KeyMustBeString",e.WrongNumberOfParameters="WrongNumberOfParameters",e.CallNonFunction="CallNonFunction",e.NoFunctionInTemplateLiteral="NoFunctionInTemplateLiteral",e.NoFunctionInDictionary="NoFunctionInDictionary",e.NoFunctionInArray="NoFunctionInArray",e.AssignModuleFunction="AssignModuleFunction",e.LogicExpressionOrAnd="LogicExpressionOrAnd",e.LogicalExpressionOnlyBoolean="LogicalExpressionOnlyBoolean",e.FunctionNotFound="FunctionNotFound",e.InvalidMemberAccessKey="InvalidMemberAccessKey",e.UnsupportedUnaryOperator="UnsupportUnaryOperator",e.InvalidIdentifier="InvalidIdentifier",e.MemberOfNull="MemberOfNull",e.UnsupportedOperator="UnsupportedOperator",e.Cancelled="Cancelled",e.ModuleAccessorMustBeString="ModuleAccessorMustBeString",e.ModuleExportNotFound="ModuleExportNotFound",e.Immutable="Immutable",e.OutOfBounds="OutOfBounds",e.IllegalResult="IllegalResult",e.FieldNotFound="FieldNotFound",e.PortalRequired="PortalRequired",e.LogicError="LogicError",e.ArrayAccessorMustBeNumber="ArrayAccessMustBeNumber",e.KeyAccessorMustBeString="KeyAccessorMustBeString",e.WrongSpatialReference="WrongSpatialReference",e.CannotChangeTimeZoneTime="CannotChangeTimeZoneTime",e.CannotChangeTimeZoneDateOnly="CannotChangeTimeZoneDateOnly"})(c||(c={}));const yi={[c.TypeNotAllowedInFeature]:"Feature attributes only support dates, numbers, strings, guids.",[c.LogicError]:"Logic error - {reason}",[c.CannotCompareDateAndTime]:"Cannot compare date or dateonly with timeonly types",[c.NeverReach]:"Encountered unreachable logic",[c.AsyncNotEnabled]:"Async Arcade must be enabled for this script",[c.ModuleAccessorMustBeString]:"Module accessor must be a string",[c.ModuleExportNotFound]:"Module has no export with provided identifier",[c.ModulesNotSupported]:"Current profile does not support modules",[c.ArrayAccessorMustBeNumber]:"Array accessor must be a number",[c.FunctionNotFound]:"Function not found",[c.FieldNotFound]:"Key not found - {key}",[c.CircularModules]:"Circular module dependencies are not allowed",[c.Cancelled]:"Execution cancelled",[c.UnsupportedHashType]:"Type not supported in hash function",[c.IllegalResult]:"Value is not a supported return type",[c.PortalRequired]:"Portal is required",[c.InvalidParameter]:"Invalid parameter",[c.WrongNumberOfParameters]:"Call with wrong number of parameters",[c.Unrecognized]:"Unrecognized code structure",[c.UnrecognizedType]:"Unrecognized type",[c.WrongSpatialReference]:"Cannot work with geometry in this spatial reference. It is different to the execution spatial reference",[c.BooleanConditionRequired]:"Conditions must use booleans",[c.NoFunctionInDictionary]:"Dictionaries cannot contain functions.",[c.NoFunctionInArray]:"Arrays cannot contain functions.",[c.NoFunctionInTemplateLiteral]:"Template Literals do not expect functions by value.",[c.KeyAccessorMustBeString]:"Accessor must be a string",[c.KeyMustBeString]:"Object keys must be a string",[c.Immutable]:"Object is immutable",[c.UnexpectedToken]:"Unexpected token",[c.MemberOfNull]:"Cannot access property of null object",[c.MaximumCallDepth]:"Exceeded maximum function depth",[c.OutOfBounds]:"Out of bounds",[c.InvalidIdentifier]:"Identifier not recognized",[c.CallNonFunction]:"Expression is not a function",[c.InvalidMemberAccessKey]:"Cannot access value using a key of this type",[c.AssignModuleFunction]:"Cannot assign function to module variable",[c.UnsupportedUnaryOperator]:"Unsupported unary operator",[c.UnsupportedOperator]:"Unsupported operator",[c.LogicalExpressionOnlyBoolean]:"Logical expressions must be boolean",[c.LogicExpressionOrAnd]:"Logical expression can only be combined with || or &&",[c.CannotChangeTimeZoneTime]:"Cannot change the timezone of a Time",[c.CannotChangeTimeZoneDateOnly]:"Cannot change the timezone of a DateOnly",[c.FeatureSetDoesNotHaveSubtypes]:"FeatureSet does not have subtypes"};let Ga=class extends Error{constructor(...t){super(...t)}},Ir=class wi extends Ga{constructor(t,n){super(ur(n)+t.message,{cause:t}),this.loc=null,Error.captureStackTrace&&Error.captureStackTrace(this,wi),n!=null&&n.loc&&(this.loc=n.loc)}},d=class xi extends Error{constructor(t,n,r,a){super("Execution error - "+ur(r)+ar(yi[n],a)),this.loc=null,this.declaredRootClass="esri.arcade.arcadeexecutionerror",Error.captureStackTrace&&Error.captureStackTrace(this,xi),r!=null&&r.loc&&(this.loc=r.loc)}};function ur(e){var t,n;return e&&e.loc?`Line : ${(t=e.loc.start)==null?void 0:t.line}, ${(n=e.loc.start)==null?void 0:n.column}: `:""}let fe=class Fi extends Error{constructor(t,n,r,a){super("Compilation error - "+ur(r)+ar(yi[n],a)),this.loc=null,this.declaredRootClass="esri.arcade.arcadecompilationerror",Error.captureStackTrace&&Error.captureStackTrace(this,Fi),r!=null&&r.loc&&(this.loc=r.loc)}},Qt=class Ci extends Error{constructor(){super("Uncompilable code structures"),this.declaredRootClass="esri.arcade.arcadeuncompilableerror",Error.captureStackTrace&&Error.captureStackTrace(this,Ci)}};function ja(e,t,n){return n.declaredRootClass==="esri.arcade.arcadeexecutionerror"||n.declaredRootClass==="esri.arcade.arcadecompilationerror"?n.loc===null&&(t!=null&&t.loc)?new Ir(n,{cause:n}):n:(n.declaredRootClass==="esri.arcade.featureset.support.featureseterror"||n.declaredRootClass==="esri.arcade.featureset.support.sqlerror"||n.declaredRootClass,t!=null&&t.loc?new Ir(n,{cause:n}):n)}var ot;(function(e){e.UnrecognizedUri="UnrecognizedUri",e.UnsupportedUriProtocol="UnsupportedUriProtocol"})(ot||(ot={}));const Ja={[ot.UnrecognizedUri]:"Unrecognized uri - {uri}",[ot.UnsupportedUriProtocol]:"Unrecognized uri protocol"};let bn=class Ai extends Error{constructor(t,n){super(ar(Ja[t],n)),this.declaredRootClass="esri.arcade.arcademoduleerror",Error.captureStackTrace&&Error.captureStackTrace(this,Ai)}},ut=class{constructor(){}};function xt(e,t,n){if(e instanceof ut&&!(e instanceof qe)){const r=new qe;return r.fn=e,r.parameterEvaluator=n,r.context=t,r}return e}let lt=class extends ut{constructor(t){super(),this.fn=t}createFunction(t){return(...n)=>this.fn(t,{preparsed:!0,arguments:n})}call(t,n){return this.fn(t,n)}marshalledCall(t,n,r,a){return a(t,n,(o,s,i)=>{i=i.map(l=>l instanceof ut&&!(l instanceof qe)?xt(l,t,a):l);const u=this.call(r,{args:i});return Xe(u)?u.then(l=>xt(l,r,a)):u})}},qe=class extends ut{constructor(){super(...arguments),this.fn=null,this.context=null}createFunction(t){return this.fn.createFunction(this.context)}call(t,n){return this.fn.marshalledCall(t,n,this.context,this.parameterEvaluator)}marshalledCall(t,n,r){return this.fn.marshalledCall(t,n,this.context,this.parameterEvaluator)}},ft=class Ei extends ce{constructor(t,n,r,a,o,s){super(t),this._lazyPt=[],this._hasZ=!1,this._hasM=!1,this._spRef=n,this._hasZ=r,this._hasM=a,this._cacheId=o,this._partId=s}get(t){if(this._lazyPt[t]===void 0){const n=this._elements[t];if(n===void 0)return;const r=this._hasZ,a=this._hasM;let o=null;o=r&&!a?new J(n[0],n[1],n[2],void 0,this._spRef):a&&!r?new J(n[0],n[1],void 0,n[2],this._spRef):r&&a?new J(n[0],n[1],n[2],n[3],this._spRef):new J(n[0],n[1],this._spRef),o.cache._arcadeCacheId=this._cacheId.toString()+"-"+this._partId.toString()+"-"+t.toString(),this._lazyPt[t]=o}return this._lazyPt[t]}equalityTest(t){return t===this||t!==null&&t instanceof Ei&&t.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()+"-"+this._partId.toString()}},Un=class bi extends ce{constructor(t,n,r,a,o){super(t),this._lazyPath=[],this._hasZ=!1,this._hasM=!1,this._hasZ=r,this._hasM=a,this._spRef=n,this._cacheId=o}get(t){if(this._lazyPath[t]===void 0){const n=this._elements[t];if(n===void 0)return;this._lazyPath[t]=new ft(n,this._spRef,this._hasZ,this._hasM,this._cacheId,t)}return this._lazyPath[t]}equalityTest(t){return t===this||t!==null&&t instanceof bi&&t.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()}};var kr,Tr;function Cl(e){return _a.fromJSON(e.toJSON())}function Va(e){return e.toJSON?e.toJSON():e}function Al(e){return typeof e=="string"||e instanceof String}function El(e){return typeof e=="number"}function Br(e){return e instanceof Date}function bl(e){return e instanceof st}function $r(e){return e instanceof U}function vl(e){return e instanceof De}function Sl(e){return e instanceof ge}function Il(e,t){return e===t||!(!Br(e)&&!$r(e)||!Br(t)&&!$r(t))&&e.getTime()===t.getTime()}function kl(e){if(e==null)return null;if(typeof e=="number")return e;switch(e.toLowerCase()){case"meters":case"meter":return 109404;case"miles":case"mile":return 109439;case"kilometers":case"kilometer":case"km":return 109414}return null}function Tl(e){if(e==null)return null;switch(e.type){case"polygon":case"multipoint":case"polyline":return e.extent;case"point":return new we({xmin:e.x,ymin:e.y,xmax:e.x,ymax:e.y,spatialReference:e.spatialReference});case"extent":return e}return null}function Bl(e){if(e==null)return null;if(typeof e=="number"||typeof e=="number")return e;switch(e.toLowerCase()){case"meters":case"meter":return 9001;case"miles":case"mile":return 9093;case"kilometers":case"kilometer":case"km":return 9036}return null}(function(e){e[e.Standardised=0]="Standardised",e[e.StandardisedNoInterval=1]="StandardisedNoInterval",e[e.SqlServer=2]="SqlServer",e[e.Oracle=3]="Oracle",e[e.Postgres=4]="Postgres",e[e.PGDB=5]="PGDB",e[e.FILEGDB=6]="FILEGDB",e[e.NotEvaluated=7]="NotEvaluated"})(kr||(kr={})),function(e){e[e.InFeatureSet=0]="InFeatureSet",e[e.NotInFeatureSet=1]="NotInFeatureSet",e[e.Unknown=2]="Unknown"}(Tr||(Tr={}));const $l=1e3,Ml={point:"point",polygon:"polygon",polyline:"polyline",multipoint:"multipoint",extent:"extent",esriGeometryPoint:"point",esriGeometryPolygon:"polygon",esriGeometryPolyline:"polyline",esriGeometryMultipoint:"multipoint",esriGeometryEnvelope:"extent",envelope:"extent"},Mr={point:"esriGeometryPoint",polygon:"esriGeometryPolygon",polyline:"esriGeometryPolyline",multipoint:"esriGeometryMultipoint",extent:"esriGeometryEnvelope",esriGeometryPoint:"esriGeometryPoint",esriGeometryPolygon:"esriGeometryPolygon",esriGeometryPolyline:"esriGeometryPolyline",esriGeometryMultipoint:"esriGeometryMultipoint",esriGeometryEnvelope:"esriGeometryEnvelope",envelope:"esriGeometryEnvelope"},Nr={"small-integer":"esriFieldTypeSmallInteger",integer:"esriFieldTypeInteger",long:"esriFieldTypeLong",single:"esriFieldTypeSingle",double:"esriFieldTypeDouble",string:"esriFieldTypeString",date:"esriFieldTypeDate","date-only":"esriFieldTypeDateOnly","time-only":"esriFieldTypeTimeOnly","timestamp-offset":"esriFieldTypeTimestampOffset",oid:"esriFieldTypeOID",geometry:"esriFieldTypeGeometry",blob:"esriFieldTypeBlob",raster:"esriFieldTypeRaster",guid:"esriFieldTypeGUID","global-id":"esriFieldTypeGlobalID",xml:"esriFieldTypeXML","big-integer":"esriFieldTypeBigInteger",esriFieldTypeSmallInteger:"esriFieldTypeSmallInteger",esriFieldTypeInteger:"esriFieldTypeInteger",esriFieldTypeLong:"esriFieldTypeLong",esriFieldTypeSingle:"esriFieldTypeSingle",esriFieldTypeDouble:"esriFieldTypeDouble",esriFieldTypeString:"esriFieldTypeString",esriFieldTypeDate:"esriFieldTypeDate",esriFieldTypeDateOnly:"esriFieldTypeDateOnly",esriFieldTypeTimeOnly:"esriFieldTypeTimeOnly",esriFieldTypeTimestampOffset:"esriFieldTypeTimestampOffset",esriFieldTypeOID:"esriFieldTypeOID",esriFieldTypeGeometry:"esriFieldTypeGeometry",esriFieldTypeBlob:"esriFieldTypeBlob",esriFieldTypeRaster:"esriFieldTypeRaster",esriFieldTypeGUID:"esriFieldTypeGUID",esriFieldTypeGlobalID:"esriFieldTypeGlobalID",esriFieldTypeXML:"esriFieldTypeXML",esriFieldTypeBigInteger:"esriFieldTypeBigInteger"};function Nl(e){return e===void 0?"":e=(e=(e=e.replace(/\/featureserver\/[0-9]*/i,"/FeatureServer")).replace(/\/mapserver\/[0-9]*/i,"/MapServer")).split("?")[0]}function _l(e,t){t||(t={}),typeof t=="function"&&(t={cmp:t});const n=typeof t.cycles=="boolean"&&t.cycles,r=t.cmp&&(a=t.cmp,function(s){return function(i,u){const l={key:i,value:s[i]},h={key:u,value:s[u]};return a(l,h)}});var a;const o=[];return function s(i){if(i!=null&&i.toJSON&&typeof i.toJSON=="function"&&(i=i.toJSON()),i===void 0)return;if(typeof i=="number")return isFinite(i)?""+i:"null";if(typeof i!="object")return JSON.stringify(i);let u,l;if(Array.isArray(i)){for(l="[",u=0;un)throw new d(r,c.WrongNumberOfParameters,a)}function Zn(e){return e<0?-Math.round(-e):Math.round(e)}function gt(){let e=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replaceAll(/[xy]/g,t=>{const n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),(t==="x"?n:3&n|8).toString(16)})}function hr(e,t){return isNaN(e)||t==null||t===""?e.toString():(t=tt(t,"‰",""),t=tt(t,"¤",""),Ua(e,{pattern:t}))}function gn(e,t){return t==null||t===""?e.toISOString(!0):e.toFormat(pr(t),{locale:sr(),numberingSystem:"latn"})}function pr(e,t=!1){e=e.replaceAll(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let n="";const r=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|Z{1,5}|.)/g;for(const a of e.match(r)||[])switch(a){case"D":n+="d";break;case"DD":n+="dd";break;case"DDD":n+="o";break;case"d":n+="c";break;case"ddd":n+="ccc";break;case"dddd":n+="cccc";break;case"M":n+="L";break;case"MM":n+="LL";break;case"MMM":n+="LLL";break;case"MMMM":n+="LLLL";break;case"YY":n+="yy";break;case"Y":case"YYYY":n+="yyyy";break;case"Q":n+="q";break;case"Z":n+="Z";break;case"ZZ":n+="ZZ";break;case"ZZZ":n+="ZZZ";break;case"ZZZZ":n+=t?"[ZZZZ]":"ZZZZ";break;case"ZZZZZ":n+=t?"[ZZZZZ]":"ZZZZZ";break;case"S":n+="'S'";break;case"SS":n+="'SS'";break;case"SSS":n+="u";break;case"A":case"a":n+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":case"X":case"x":n+=a;break;default:a.length>=2&&a.slice(0,1)==="["&&a.slice(-1)==="]"?n+=`'${a.slice(1,-1)}'`:n+=`'${a}'`}return n}function _(e,t,n){switch(n){case">":return e>t;case"<":return e=":return e>=t;case"<=":return e<=t}return!1}function mr(e,t,n){if(e===null){if(t===null||t===b)return _(null,null,n);if(L(t))return _(0,t,n);if(F(t)||V(t))return _(0,p(t),n);if(H(t))return _(0,t.toNumber(),n);if(j(t)||P(t))return _(e,t.toNumber(),n)}if(e===b){if(t===null||t===b)return _(null,null,n);if(L(t))return _(0,t,n);if(F(t)||V(t))return _(0,p(t),n);if(H(t))return _(0,t.toNumber(),n);if(j(t)||P(t))return _(e,t.toNumber(),n)}else if(L(e)){if(L(t))return _(e,t,n);if(V(t))return _(e,p(t),n);if(t===null||t===b)return _(e,0,n);if(F(t))return _(e,p(t),n);if(H(t)||j(t)||P(t))return _(e,t.toNumber(),n)}else if(F(e)){if(F(t))return _(A(e),A(t),n);if(H(t)||j(t)||P(t))return _(p(e),t.toNumber(),n);if(L(t))return _(p(e),t,n);if(t===null||t===b)return _(p(e),0,n);if(V(t))return _(p(e),p(t),n)}else if(H(e)){if(H(t))return e.timeZone!==t.timeZone&&(e.isUnknownTimeZone?e=U.arcadeDateAndZoneToArcadeDate(e,t.timeZone):t.isUnknownTimeZone&&(t=U.arcadeDateAndZoneToArcadeDate(t,e.timeZone))),_(e.toNumber(),t.toNumber(),n);if(t===null||t===b)return _(e.toNumber(),0,n);if(L(t))return _(e.toNumber(),t,n);if(V(t)||F(t))return _(e.toNumber(),p(t),n);if(j(t))throw new d(null,c.CannotCompareDateAndTime,null);if(P(t))return _(e.toNumber(),t.toNumber(),n)}else if(V(e)){if(V(t))return _(e,t,n);if(L(t))return _(p(e),p(t),n);if(H(t)||j(t)||P(t))return _(p(e),t.toNumber(),n);if(t===null||t===b)return _(p(e),0,n);if(F(t))return _(p(e),p(t),n)}else if(P(e)){if(H(t))return _(e.toNumber(),t.toNumber(),n);if(t===null||t===b)return _(e.toNumber(),0,n);if(L(t))return _(e.toNumber(),t,n);if(V(t)||F(t))return _(e.toNumber(),p(t),n);if(j(t))throw new d(null,c.CannotCompareDateAndTime,null);if(P(t))return _(e.toNumber(),t.toNumber(),n)}else if(j(e)){if(H(t))throw new d(null,c.CannotCompareDateAndTime,null);if(t===null||t===b)return _(e.toNumber(),0,n);if(L(t))return _(e.toNumber(),t,n);if(V(t)||F(t))return _(e.toNumber(),p(t),n);if(j(t))return _(e.toNumber(),t.toNumber(),n);if(P(t))throw new d(null,c.CannotCompareDateAndTime,null)}return!!ke(e,t)&&(n==="<="||n===">=")}function ke(e,t){if(e===t||e===null&&t===b||t===null&&e===b)return!0;if(H(e)&&H(t)||j(e)&&j(t)||P(e)&&P(t))return e.equals(t);if(e instanceof Un||e instanceof ft)return e.equalityTest(t);if(e instanceof J&&t instanceof J){const n=e.cache._arcadeCacheId,r=t.cache._arcadeCacheId;if(n!=null)return n===r}return!!(zn(e)&&zn(t)&&(e._arcadeCacheId===t._arcadeCacheId&&e._arcadeCacheId!==void 0&&e._arcadeCacheId!==null||e._underlyingGraphic===t._underlyingGraphic&&e._underlyingGraphic!==void 0&&e._underlyingGraphic!==null))}function A(e,t){if(F(e))return e;if(e===null)return"";if(L(e))return hr(e,t);if(V(e))return e.toString();if(H(e))return gn(e,t);if(j(e)||P(e))return e.toFormat(t);if(e instanceof $)return JSON.stringify(e.toJSON());if(k(e)){const n=[];for(let r=0;rr.key===a.key?0:r.key==="spatialReference"?1:a.key==="spatialReference"||r.keya.key?1:0);if(k(e)){const r=[];for(let a=0;a0)return e;return null}if(e instanceof te){if(e.paths.length===0)return null;for(const t of e.paths)if(t.length>0)return e;return null}return e instanceof Ie?e.points.length===0?null:e:e instanceof we?e.xmin==="NaN"||e.xmin===null||isNaN(e.xmin)?null:e:null}function Ii(e,t){if(!e||!e.domain)return t;let n=null,r=null;if(H(t))n=t.toNumber();else if(P(t))n=t.toString();else if(j(t))n=t.toStorageString();else if(e.field.type==="string"||e.field.type==="esriFieldTypeString")n=A(t);else{if(t==null)return null;if(t==="")return t;n=p(t)}for(let a=0;a{var f;return h[u]===r&&(a=(f=h.domains)==null?void 0:f[s.name],a&&a.type==="inherited"&&(a=_r(s.name,t),o=!0),!0)}),o||a||(a=_r(e,t)),{field:s,domain:a}}function _r(e,t){let n;return t.fields.some(r=>(r.name.toLowerCase()===e.toLowerCase()&&(n=r.domain),!!n)),n}function Gn(e,t){t||(t={}),typeof t=="function"&&(t={cmp:t});const n=typeof t.cycles=="boolean"&&t.cycles,r=t.cmp&&(a=t.cmp,function(s){return function(i,u){const l={key:i,value:s[i]},h={key:u,value:s[u]};return a(l,h)}});var a;const o=[];return function s(i){if(i!=null&&i.toJSON&&typeof i.toJSON=="function"&&(i=i.toJSON()),i===void 0)return;if(typeof i=="number")return isFinite(i)?""+i:"null";if(typeof i!="object")return JSON.stringify(i);let u,l;if(Array.isArray(i)){for(l="[",u=0;u0&&(o=e[0].spatialReference,n=e[0].hasZ,r=e[0].hasM)}else if(e instanceof ft)a=e._elements,a.length>0&&(n=e._hasZ,r=e._hasM,o=e.get(0).spatialReference);else{if(!M(e))throw new d(null,c.InvalidParameter,null);for(const s of e.toArray())At(a,s);a.length>0&&(o=e.get(0).spatialReference,n=e.get(0).hasZ===!0,r=e.get(0).hasM===!0)}return a.length===0?null:(di(a)||(a=a.slice(0).reverse()),new ie({rings:[a],spatialReference:o,hasZ:n,hasM:r}))}return e}function We(e,t){if(k(e)||M(e)){let n=!1,r=!1,a=[],o=t;if(k(e)){for(const s of e)At(a,s);a.length>0&&(o=e[0].spatialReference,n=e[0].hasZ===!0,r=e[0].hasM===!0)}else if(e instanceof ft)a=e._elements,a.length>0&&(n=e._hasZ,r=e._hasM,o=e.get(0).spatialReference);else if(M(e)){for(const s of e.toArray())At(a,s);a.length>0&&(o=e.get(0).spatialReference,n=e.get(0).hasZ===!0,r=e.get(0).hasM===!0)}return a.length===0?null:new te({paths:[a],spatialReference:o,hasZ:n,hasM:r})}return e}function nn(e,t){if(k(e)||M(e)){let n=!1,r=!1,a=[],o=t;if(k(e)){for(const s of e)At(a,s);a.length>0&&(o=e[0].spatialReference,n=e[0].hasZ===!0,r=e[0].hasM===!0)}else if(e instanceof ft)a=e._elements,a.length>0&&(n=e._hasZ,r=e._hasM,o=e.get(0).spatialReference);else if(M(e)){for(const s of e.toArray())At(a,s);a.length>0&&(o=e.get(0).spatialReference,n=e.get(0).hasZ===!0,r=e.get(0).hasM===!0)}return a.length===0?null:new Ie({points:a,spatialReference:o,hasZ:n,hasM:r})}return e}function Ka(e,t=!1){const n=[];if(e===null)return n;if(k(e)===!0){for(let r=0;r{setTimeout(()=>{t(e)},0)})):e}function Dr(e,t,n){switch(n){case"&":return e&t;case"|":return e|t;case"^":return e^t;case"<<":return e<>":return e>>t;case">>>":return e>>>t}}function nt(e,t=null){return e==null?null:V(e)||L(e)||F(e)?e:e instanceof $?(t==null?void 0:t.keepGeometryType)===!0?e:e.toJSON():e instanceof ce?e.toArray().map(n=>nt(n,t)):e instanceof Array?e.map(n=>nt(n,t)):on(e)?e:H(e)?e.toJSDate():j(e)?e.toString():P(e)?e.toJSDate():e!==null&&typeof e=="object"&&e.castAsJson!==void 0?e.castAsJson(t):null}async function Ya(e,t,n,r,a){const o=await gr(e,t,n);a[r]=o}async function gr(e,t=null,n=null){if(e instanceof ce&&(e=e.toArray()),e==null)return null;if(He(e)||e instanceof $||on(e)||H(e))return nt(e,n);if(e instanceof Array){const r=[],a=[];for(const o of e)o===null||He(o)||o instanceof $||on(o)||H(o)?a.push(nt(o,n)):(a.push(null),r.push(Ya(o,t,n,a.length-1,a)));return r.length>0&&await Promise.all(r),a}return e!==null&&typeof e=="object"&&e.castAsJsonAsync!==void 0?e.castAsJsonAsync(t,n):null}function Kt(e){return Ti(e)?e.parent:e}function Ti(e){return e&&"declaredClass"in e&&e.declaredClass==="esri.layers.support.SubtypeSublayer"}function Xa(e){return e&&"declaredClass"in e&&e.declaredClass==="esri.layers.SubtypeGroupLayer"}function Bi(e,t,n){const r=Kt(e.fullSchema());return r===null||!r.fields?null:yn(t,r,e,n)}function rn(e){const t=Kt(e.fullSchema());return t===null?null:t.fields?t.subtypeField?{subtypeField:t.subtypeField,subtypes:t.subtypes?t.subtypes.map(n=>({name:n.name,code:n.code})):[]}:t.typeIdField?{subtypeField:t.typeIdField,subtypes:t.types?t.types.map(n=>({name:n.name,code:n.id})):[]}:null:null}function $i(e,t,n,r){const a=Kt(e.fullSchema());if(a===null||!a.fields)return null;const o=yn(t,a,e,r);if(n===void 0)try{n=e.field(t)}catch{return null}return Ii(o,n)}function Mi(e,t,n,r){const a=Kt(e.fullSchema());if(a===null||!a.fields)return null;if(n===void 0){try{n=e.field(t)}catch{return null}return n}return ki(yn(t,a,e,r),n)}function N(e){return(e==null?void 0:e.timeZone)??"system"}function Ni(e){const t=Kt(e.fullSchema());if(t===null||!t.fields)return null;const n=[];for(const r of t.fields)n.push(Va(r));return{objectIdField:t.objectIdField,globalIdField:t.globalIdField??"",geometryType:Mr[t.geometryType]===void 0?"":Mr[t.geometryType],fields:n}}function _i(e,t){return e==="system"&&(e=U.systemTimeZoneCanonicalName),{version:Ri,engineVersion:hi,timeZone:e,spatialReference:t instanceof St?t.toJSON():t,application:Ra.applicationName??"",engine:"web",locale:sr()}}const Ri="1.24",Li=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResultE:Si,ReturnResultE:vi,absRound:Zn,arcadeVersion:Ri,autoCastArrayOfPointsToMultiPoint:nn,autoCastArrayOfPointsToPolygon:jn,autoCastArrayOfPointsToPolyline:We,autoCastFeatureToGeometry:G,binaryOperator:Dr,breakResult:Me,castAsJson:nt,castAsJsonAsync:gr,continueResult:kt,defaultExecutingContext:_i,defaultTimeZone:N,defaultUndefined:R,equalityTest:ke,featureDomainCodeLookup:Mi,featureDomainValueLookup:$i,featureFullDomain:Bi,featureSchema:Ni,featureSubtypes:rn,fixNullGeometry:it,fixSpatialReference:ne,formatDate:gn,formatNumber:hr,generateUUID:gt,getDomain:yn,getDomainCode:ki,getDomainValue:Ii,getType:cr,greaterThanLessThan:mr,implicitResult:Ft,isArray:k,isBoolean:V,isDate:H,isDateOnly:P,isDictionary:fr,isFeature:ee,isFeatureSet:Tt,isFeatureSetCollection:Ht,isFunctionParameter:X,isGeometry:Dn,isImmutableArray:M,isInteger:Ze,isJsDate:on,isKnowledgeGraph:dr,isModule:lr,isNumber:L,isObject:zn,isSimpleType:He,isString:F,isSubtypeGrouplayer:Xa,isSubtypeSublayer:Ti,isTime:j,multiReplace:tt,parseGeometryFromJson:Ha,pcCheck:D,returnResult:Ce,stableStringify:Gn,standardiseDateFormat:pr,tick:Wa,toBoolean:Ct,toDate:ue,toNumber:p,toNumberArray:rt,toString:A,toStringArray:Ka,toStringExplicit:Ee,voidOperation:b},Symbol.toStringTag,{value:"Module"}));function Qa(e){Pi=e}let Pi;function jt(e){return e===null?null:H(e)?e.clone():He(e)?e:Dn(e)?e.clone():M(e)?e.toArray().map(t=>jt(t)):k(e)?e.map(t=>jt(t)):ee(e)?Pi.createFromArcadeFeature(e):Ht(e)||Tt(e)?e:fr(e)||(e==null?void 0:e.declaredClass)==="esri.arcade.Attachment"?e.deepClone():((e==null?void 0:e.declaredClass)==="esri.arcade.Portal"||dr(e)||e instanceof qt||X(e),e)}function ln(e,t,n=!1,r=!1){if(e==null)return null;if(L(e))return p(e);if(V(e))return Ct(e);if(F(e))return A(e);if(H(e))return ue(e,t);if(P(e)||j(e))return e;if(k(e)){const o=[];for(const s of e)o.push(ln(s,t,n,r));return o}if(r&&Dn(e))return e;const a=new B;a.immutable=!1;for(const o of Object.keys(e)){const s=e[o];s!==void 0&&a.setField(o,ln(s,t,n,r))}return a.immutable=n,a}let B=class an{constructor(t){this.declaredClass="esri.arcade.Dictionary",this.attributes=null,this.plain=!1,this.immutable=!0,this.attributes=t instanceof an?t.attributes:t??{}}field(t){const n=t.toLowerCase(),r=this.attributes[t];if(r!==void 0)return r;for(const a in this.attributes)if(a.toLowerCase()===n)return this.attributes[a];throw new d(null,c.FieldNotFound,null,{key:t})}setField(t,n){if(this.immutable)throw new d(null,c.Immutable,null);if(X(n))throw new d(null,c.NoFunctionInDictionary,null);const r=t.toLowerCase();if(n instanceof Date&&(n=U.dateJSToArcadeDate(n)),this.attributes[t]===void 0){for(const a in this.attributes)if(a.toLowerCase()===r)return void(this.attributes[a]=n);this.attributes[t]=n}else this.attributes[t]=n}hasField(t){const n=t.toLowerCase();if(this.attributes[t]!==void 0)return!0;for(const r in this.attributes)if(r.toLowerCase()===n)return!0;return!1}keys(){let t=[];for(const n in this.attributes)t.push(n);return t=t.sort(),t}castToText(t=!1){let n="";for(const r in this.attributes){n!==""&&(n+=",");const a=this.attributes[r];a==null?n+=JSON.stringify(r)+":null":V(a)||L(a)||F(a)?n+=JSON.stringify(r)+":"+JSON.stringify(a):a instanceof $?n+=JSON.stringify(r)+":"+Ee(a):a instanceof ce||a instanceof Array?n+=JSON.stringify(r)+":"+Ee(a,null,t):a instanceof U?n+=t?JSON.stringify(r)+":"+JSON.stringify(a.getTime()):JSON.stringify(r)+":"+a.stringify():a!==null&&typeof a=="object"&&a.castToText!==void 0&&(n+=JSON.stringify(r)+":"+a.castToText(t))}return"{"+n+"}"}static convertObjectToArcadeDictionary(t,n,r=!0,a=!1){const o=new an;o.immutable=!1;for(const s in t){const i=t[s];i!==void 0&&o.setField(s.toString(),ln(i,n,r,a))}return o.immutable=r,o}static convertJsonToArcade(t,n,r=!1,a=!1){return ln(t,n,r,a)}castAsJson(t=null){const n={};for(let r in this.attributes){const a=this.attributes[r];a!==void 0&&(t!=null&&t.keyTranslate&&(r=t.keyTranslate(r)),n[r]=nt(a,t))}return n}async castDictionaryValueAsJsonAsync(t,n,r,a=null,o){const s=await gr(r,a,o);return t[n]=s,s}async castAsJsonAsync(t=null,n=null){const r={},a=[];for(let o in this.attributes){const s=this.attributes[o];n!=null&&n.keyTranslate&&(o=n.keyTranslate(o)),s!==void 0&&(He(s)||s instanceof $||s instanceof U?r[o]=nt(s,n):a.push(this.castDictionaryValueAsJsonAsync(r,o,s,t,n)))}return a.length>0&&await Promise.all(a),r}deepClone(){const t=new an;t.immutable=!1;for(const n of this.keys())t.setField(n,jt(this.field(n)));return t}},Q=class ve{constructor(){this.arcadeDeclaredClass="esri.arcade.Feature",this._optimizedGeomDefinition=null,this._geometry=null,this.attributes=null,this._layer=null,this._fieldTypesFixed=!0,this.fieldsIndex=null,this.contextTimeZone=null,this.immutable=!0,this._fieldsToFixDataTypes=null,this.immutable=!0}static createFromGraphic(t,n){const r=new ve;return r.contextTimeZone=n??null,r._geometry=t.geometry!=null?t.geometry:null,t.attributes===void 0||t.attributes===null?r.attributes={}:r.attributes=t.attributes,t._sourceLayer?(r._layer=t._sourceLayer,r._fieldTypesFixed=!1):t._layer?(r._layer=t._layer,r._fieldTypesFixed=!1):t.layer&&"fields"in t.layer?(r._layer=t.layer,r._fieldTypesFixed=!1):t.sourceLayer&&"fields"in t.sourceLayer&&(r._layer=t.sourceLayer,r._fieldTypesFixed=!1),r._layer&&!r._fieldTypesFixed&&(r.fieldsIndex=this.hydrateFieldsIndex(r._layer)),r}static createFromArcadeFeature(t){if(t instanceof ve){const r=new ve;return r._fieldTypesFixed=t._fieldTypesFixed,r.attributes=t.attributes,r._geometry=t._geometry,r._optimizedGeomDefinition=t._optimizedGeomDefinition,t._layer&&(r._layer=t._layer),r.fieldsIndex=t.fieldsIndex,r.contextTimeZone=t.contextTimeZone,r}const n={};for(const r of t.keys())n[r]=t.field(r);return ve.createFromGraphicLikeObject(t.geometry(),n,t.fullSchema(),t.contextTimeZone)}static createFromOptimisedFeature(t,n,r){const a=new ve;return a._geometry=t.geometry?{geometry:t.geometry}:null,a._optimizedGeomDefinition=r,a.attributes=t.attributes||{},a._layer=n,a._fieldTypesFixed=!1,a}static createFromArcadeDictionary(t,n){const r=new ve;return r.attributes=t.field("attributes"),r.attributes!==null&&r.attributes instanceof B?(r.attributes=r.attributes.attributes,r.attributes===null&&(r.attributes={})):r.attributes={},r._geometry=t.field("geometry"),r._geometry!==null&&(r._geometry instanceof B?r._geometry=ve.parseGeometryFromDictionary(r._geometry,n):r._geometry instanceof $||(r._geometry=null)),r}static createFromGraphicLikeObject(t,n,r=null,a){const o=new ve;return o.contextTimeZone=a??null,n===null&&(n={}),o.attributes=n,o._geometry=t??null,o._layer=r,o._layer&&(o._fieldTypesFixed=!1,o.fieldsIndex=this.hydrateFieldsIndex(o._layer)),o}static hydrateFieldsIndex(t){return t===null?null:Tt(t)?t.getFieldsIndex():t.fieldsIndex?t.fieldsIndex:Za.fromLayerJSON({datesInUnknownTimezone:t.datesInUnknownTimezone,fields:t.fields,timeInfo:t.timeInfo,editFieldsInfo:t.editFieldsInfo,dateFieldsTimeReference:t.dateFieldsTimeReference??{timeZone:"UTC",respectsDaylightSaving:!1}})}repurposeFromGraphicLikeObject(t,n,r=null){n===null&&(n={}),this.attributes=n,this._geometry=t??null,this._layer=r,this._layer?this._fieldTypesFixed=!1:this._fieldTypesFixed=!0}castToText(t=!1){let n="";this._fieldTypesFixed===!1&&this._fixFieldTypes();for(const r in this.attributes){n!==""&&(n+=",");const a=this.attributes[r];a==null?n+=JSON.stringify(r)+":null":V(a)||L(a)||F(a)?n+=JSON.stringify(r)+":"+JSON.stringify(a):a instanceof $?n+=JSON.stringify(r)+":"+Ee(a):a instanceof ge||a instanceof De?n+=`${JSON.stringify(r)}:${JSON.stringify(a.toString())}`:a instanceof ce||a instanceof Array?n+=JSON.stringify(r)+":"+Ee(a,null,t):a instanceof U?n+=t?JSON.stringify(r)+":"+JSON.stringify(a.getTime()):JSON.stringify(r)+":"+a.stringify():a!==null&&typeof a=="object"&&a.castToText!==void 0&&(n+=JSON.stringify(r)+":"+a.castToText(t))}return'{"geometry":'+(this.geometry()===null?"null":Ee(this.geometry()))+',"attributes":{'+n+"}}"}_fixFieldTypes(){var r;if(this._fieldsToFixDataTypes&&((r=this._fieldsToFixDataTypes)==null?void 0:r.length)>0)return this._fixAllFields(this._fieldsToFixDataTypes),void(this._fieldTypesFixed=!0);const t=[],n=this._layer.fields;for(let a=0;a0&&this._fixAllFields(t),this._fieldTypesFixed=!0}isUnknownDateTimeField(t){var n;return((n=this.fieldsIndex)==null?void 0:n.getTimeZone(t))==="unknown"}_fixAllFields(t){this.attributes={...this.attributes};const n=this.contextTimeZone??"system";for(let r=0;r!n&&(a.type==="Identifier"&&a.name&&a.name.toLowerCase()===r&&(n=!0),!0)),n}function Ui(e){const t=[];return W(e,n=>(n.type==="ImportDeclaration"&&n.source&&n.source.value&&t.push({libname:n.specifiers[0].local.name.toLowerCase(),source:n.source.value}),!0)),t}function ns(e,t){let n=!1;const r=t.toLowerCase();return W(e,a=>!n&&(a.type!=="CallExpression"||a.callee.type!=="Identifier"||!a.callee.name||a.callee.name.toLowerCase()!==r||(n=!0,!1))),n}function rs(e){const t=[];return W(e,n=>{var r;return n.type!=="MemberExpression"||n.object.type!=="Identifier"||(n.computed===!1&&n.object&&n.object.name&&n.property&&n.property.type==="Identifier"&&n.property.name?t.push(n.object.name.toLowerCase()+"."+n.property.name.toLowerCase()):n.object&&n.object.name&&n.property&&n.property.type==="Literal"&&typeof n.property.value=="string"&&t.push(n.object.name.toLowerCase()+"."+((r=n.property.value)==null?void 0:r.toString().toLowerCase())),!1)}),t}function is(e){const t=[];return W(e,n=>{var r;if(n.type==="CallExpression"){if(n.callee.type==="Identifier"&&n.callee.name.toLowerCase()==="expects"){let a="";for(let o=0;o<(n.arguments||[]).length;o++)o===0?n.arguments[o].type==="Identifier"&&(a=n.arguments[o].name.toLowerCase()):a&&n.arguments[o].type==="Literal"&&Lr(n.arguments[o].value)&&t.push(a+"."+n.arguments[o].value.toLowerCase());return!1}if(n.callee.type==="Identifier"&&["domainname","domaincode","domain","haskey"].includes(n.callee.name.toLowerCase())&&n.arguments.length>=2){let a="";return n.arguments[0].type==="Identifier"&&(a=n.arguments[0].name.toLowerCase()),a&&n.arguments[1].type==="Literal"&&Lr(n.arguments[1].value)&&t.push(a+"."+n.arguments[1].value.toLowerCase()),!1}}return n.type!=="MemberExpression"||n.object.type!=="Identifier"||(n.computed===!1&&n.object&&n.object.name&&n.property&&n.property.type==="Identifier"&&n.property.name?t.push(n.object.name.toLowerCase()+"."+n.property.name.toLowerCase()):n.object&&n.object.name&&n.property&&n.property.type==="Literal"&&typeof n.property.value=="string"&&t.push(n.object.name.toLowerCase()+"."+((r=n.property.value)==null?void 0:r.toString().toLowerCase())),!1)}),t}function Vn(e){const t=[];return W(e,n=>(n.type==="CallExpression"&&n.callee.type==="Identifier"&&t.push(n.callee.name.toLowerCase()),!0)),t}function Wt(e,t=[]){let n=null;if(e.usesFeatureSet===void 0){n===null&&(n=Vn(e)),e.usesFeatureSet=!1;for(let r=0;r0){for(const r of t)if(Oi(e,r)){e.usesFeatureSet=!0,e.isAsync=!0;break}}}if(e.usesModules===void 0&&(e.usesModules=!1,Ui(e).length>0&&(e.usesModules=!0)),e.usesGeometry===void 0){e.usesGeometry=!1,n===null&&(n=Vn(e));for(let r=0;r0||u.length>0;)if(i.length>0&&u.length>0){let f=l(i[0],u[0]);isNaN(f)&&(f=0),f<=0?(h.push(i[0]),i=i.slice(1)):(h.push(u[0]),u=u.slice(1))}else i.length>0?(h.push(i[0]),i=i.slice(1)):u.length>0&&(h.push(u[0]),u=u.slice(1));return h}async function a(i,u){const l=i.length,h=Math.floor(l/2);if(l===0)return[];if(l===1)return[i[0]];const f=[await a(i.slice(0,h),u),await a(i.slice(h,l),u)];return o(f[0],f[1],u,[])}async function o(i,u,l,h){const f=h;if(!(i.length>0||u.length>0))return h;if(i.length>0&&u.length>0){let m=await l(i[0],u[0]);return isNaN(m)&&(m=1),m<=0?(f.push(i[0]),i=i.slice(1)):(f.push(u[0]),u=u.slice(1)),o(i,u,l,h)}return i.length>0?(f.push(i[0]),o(i=i.slice(1),u,l,h)):u.length>0?(f.push(u[0]),o(i,u=u.slice(1),l,h)):void 0}function s(i,u,l,h){D(l,1,2,i,u);let f=l[0];if(M(f)&&(f=f.toArray()),k(f)===!1)throw new d(i,c.InvalidParameter,u);if(l.length>1){if(X(l[1])===!1)throw new d(i,c.InvalidParameter,u);let v=f;const z=l[1].createFunction(i);return h?a(v,z):(v=n(v,(ae,he)=>z(ae,he)),v)}let m=f;if(m.length===0)return[];const g={};for(let v=0;v1||T==="String"?n(m,(v,z)=>{if(v==null||v===b)return z==null||z===b?0:1;if(z==null||z===b)return-1;const ae=A(v),he=A(z);return aev-z):T==="Boolean"?n(m,(v,z)=>v===z?0:z?-1:1):T==="Date"?n(m,(v,z)=>z-v):m.slice(0),m}e.functions.array=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{if(D(f,0,2,i,u),f.length===0)return[];if(f.length===1&&f[0]===null)return[];if(k(f[0])){if(f.length===2&&V(f[1])===!1)throw new d(i,c.InvalidParameter,u);return R(f[1],!1)===!0?jt(f[0]):f[0].slice(0)}if(M(f[0])){if(f.length===2&&V(f[1])===!1)throw new d(i,c.InvalidParameter,u);return R(f[1],!1)===!0?jt(f[0]):f[0].toArray().slice(0)}const m=p(f[0]);if(isNaN(m)||Ze(m)===!1)throw new d(i,c.InvalidParameter,u);const g=R(f[1],null),y=new Array(m);return y.fill(g),y})},e.functions.front=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{if(D(f,1,1,i,u),M(f[0])){if(f[0].length()<=0)throw new d(i,c.OutOfBounds,u);return f[0].get(0)}if(k(f[0])){if(f[0].length<=0)throw new d(i,c.OutOfBounds,u);return f[0][0]}throw new d(i,c.InvalidParameter,u)})},e.functions.back=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{if(D(f,1,1,i,u),M(f[0])){if(f[0].length()<=0)throw new d(i,c.OutOfBounds,u);return f[0].get(f[0].length()-1)}if(k(f[0])){if(f[0].length<=0)throw new d(i,c.OutOfBounds,u);return f[0][f[0].length-1]}throw new d(i,c.InvalidParameter,u)})},e.functions.push=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{if(D(f,1,2,i,u),k(f[0]))return f[0][f[0].length]=f[1],f[0].length;throw new d(i,c.InvalidParameter,u)})},e.functions.pop=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{if(D(f,1,1,i,u),k(f[0])){if(f[0].length<=0)throw new d(i,c.OutOfBounds,u);const m=f[0][f[0].length-1];return f[0].length=f[0].length-1,m}throw new d(i,c.InvalidParameter,u)})},e.functions.erase=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{if(D(f,2,2,i,u),k(f[0])){let m=p(f[1]);if(isNaN(m)||Ze(m)===!1)throw new d(i,c.InvalidParameter,u);const g=f[0];if(g.length<=0)throw new d(i,c.OutOfBounds,u);if(m<0&&(m=g.length+m),m<0)throw new d(i,c.OutOfBounds,u);if(m>=g.length)throw new d(i,c.OutOfBounds,u);return g.splice(m,1),b}throw new d(i,c.InvalidParameter,u)})},e.functions.insert=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{if(D(f,3,3,i,u),k(f[0])){const m=p(f[1]);if(isNaN(m)||Ze(m)===!1)throw new d(i,c.InvalidParameter,u);const g=f[2],y=f[0];if(m>y.length)throw new d(i,c.OutOfBounds,u);if(m<0&&m<-1*y.length)throw new d(i,c.OutOfBounds,u);return m===y.length?(y[m]=g,b):(y.splice(m,0,g),b)}throw new d(i,c.InvalidParameter,u)})},e.functions.resize=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{if(D(f,2,3,i,u),k(f[0])){const m=p(f[1]);if(isNaN(m)||Ze(m)===!1)throw new d(i,c.InvalidParameter,u);if(m<0)throw new d(i,c.InvalidParameter,u);const g=R(f[2],null),y=f[0];if(y.length>=m)return y.length=m,b;const T=y.length;y.length=m;for(let v=T;v{if(D(f,2,2,i,u),k(f[0])){const m=f[1];return f[0].findIndex(g=>ke(g,m))>-1}if(M(f[0])){const m=f[1];return f[0].toArray().findIndex(g=>ke(g,m))>-1}throw new d(i,c.InvalidParameter,u)})},e.functions.slice=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{if(D(f,1,3,i,u),k(f[0])){const m=p(R(f[1],0)),g=p(R(f[2],f[0].length));if(isNaN(m)||Ze(m)===!1)throw new d(i,c.InvalidParameter,u);if(isNaN(g)||Ze(g)===!1)throw new d(i,c.InvalidParameter,u);return f[0].slice(m,g)}if(M(f[0])){const m=f[0],g=p(R(f[1],0)),y=p(R(f[2],m.length()));if(isNaN(g)||Ze(g)===!1)throw new d(i,c.InvalidParameter,u);if(isNaN(y)||Ze(y)===!1)throw new d(i,c.InvalidParameter,u);return m.toArray().slice(g,y)}throw new d(i,c.InvalidParameter,u)})},e.functions.splice=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{const m=[];for(let g=0;g{if(D(f,2,2,i,u),k(f[0]))return p(f[1])>=f[0].length?f[0].slice(0):f[0].slice(0,p(f[1]));if(M(f[0]))return p(f[1])>=f[0].length()?f[0].slice(0):f[0].slice(0,p(f[1]));throw new d(i,c.InvalidParameter,u)})},e.functions.first=function(i,u){return e.standardFunction(i,u,(l,h,f)=>(D(f,1,1,i,u),k(f[0])?f[0].length===0?null:f[0][0]:M(f[0])?f[0].length()===0?null:f[0].get(0):null))},e.mode==="sync"&&(e.functions.sort=function(i,u){return e.standardFunction(i,u,(l,h,f)=>s(i,u,f,!1))},e.functions.any=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{D(f,2,2,i,u);const m=f[1].createFunction(i),g=t(f[0],i,u);for(const y of g){const T=m(y);if(V(T)&&T===!0)return!0}return!1})},e.functions.all=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{D(f,2,2,i,u);const m=f[1].createFunction(i),g=t(f[0],i,u);for(const y of g)if(m(y)!==!0)return!1;return!0})},e.functions.none=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{D(f,2,2,i,u);const m=f[1].createFunction(i),g=t(f[0],i,u);for(const y of g)if(m(y)===!0)return!1;return!0})},e.functions.reduce=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{D(f,2,3,i,u);const m=f[1].createFunction(i),g=t(f[0],i,u);return f.length===2?g.length===0?null:g.reduce((y,T)=>{const v=m(y,T);return y=v!==void 0&&v!==b?v:null}):g.reduce((y,T)=>{const v=m(y,T);return y=v!==void 0&&v!==b?v:null},f[2])})},e.functions.map=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{D(f,2,2,i,u);const m=f[1].createFunction(i),g=t(f[0],i,u),y=[];for(const T of g){const v=m(T);v!==void 0&&v!==b?y.push(v):y.push(null)}return y})},e.functions.filter=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{D(f,2,2,i,u);const m=f[1].createFunction(i),g=t(f[0],i,u),y=[];for(const T of g)m(T)===!0&&y.push(T);return y})}),e.mode==="async"&&(e.functions.sort=function(i,u){return e.standardFunctionAsync(i,u,(l,h,f)=>s(i,u,f,!0))},e.functions.any=function(i,u){return e.standardFunctionAsync(i,u,async(l,h,f)=>{D(f,2,2,i,u);const m=f[1].createFunction(i),g=t(f[0],i,u);for(const y of g){const T=await m(y);let v=null;if(v=Xe(v)?await T:T,V(v)&&v===!0)return!0}return!1})},e.functions.all=function(i,u){return e.standardFunctionAsync(i,u,async(l,h,f)=>{D(f,2,2,i,u);const m=f[1].createFunction(i),g=t(f[0],i,u);for(const y of g){const T=await m(y);let v=null;if(v=Xe(v)?await T:T,v!==!0)return!1}return!0})},e.functions.none=function(i,u){return e.standardFunctionAsync(i,u,async(l,h,f)=>{D(f,2,2,i,u);const m=f[1].createFunction(i),g=t(f[0],i,u);for(const y of g){const T=await m(y);let v=null;if(v=Xe(v)?await T:T,v===!0)return!1}return!0})},e.functions.filter=function(i,u){return e.standardFunctionAsync(i,u,async(l,h,f)=>{D(f,2,2,i,u);const m=f[1].createFunction(i),g=t(f[0],i,u),y=[];for(const T of g){const v=await m(T);let z=null;z=Xe(z)?await v:v,z===!0&&y.push(T)}return y})},e.functions.reduce=function(i,u){return e.standardFunctionAsync(i,u,(l,h,f)=>{D(f,2,3,i,u);const m=f[1].createFunction(i),g=t(f[0],i,u);let y=null;if(f.length>2){const T=R(f[2],null);y=g.reduce(async(v,z)=>{let ae=await v;return ae!==void 0&&ae!==b||(ae=null),m(ae,z)},Promise.resolve(T))}else{if(g.length===0)return null;y=g.reduce(async(T,v,z)=>{if(z<=1)return m(T,v);let ae=await T;return ae!==void 0&&ae!==b||(ae=null),m(ae,v)})}return y.then(T=>T!==void 0&&T!==b?T:null)})},e.functions.map=function(i,u){return e.standardFunctionAsync(i,u,async(l,h,f)=>{D(f,2,2,i,u);const m=f[1].createFunction(i),g=t(f[0],i,u),y=[];for(const T of g){const v=await m(T);let z=null;z=Xe(z)?await v:v,z!==void 0&&z!==b?y.push(z):y.push(null)}return y})})}const qn=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:as},Symbol.toStringTag,{value:"Module"}));function ss(e,t,n){return e+(os(n)?ls:us)[t]}function os(e){return e%4==0&&(e%100!=0||e%400==0)}const us=[0,31,59,90,120,151,181,212,243,273,304,334],ls=[0,31,60,91,121,152,182,213,244,274,305,335];function Re(e){return e===null?e:e.isValid===!1?null:e}function Mt(e,t){return e===""||e.toLowerCase().trim()==="default"?N(t):e==="z"||e==="Z"?"UTC":e}function Oe(e,t){return P(e)?e.toArcadeDate():ue(e,N(t))}function zi(e,t){e.today=function(n,r){return t(n,r,(a,o,s)=>{D(s,0,0,n,r);const i=new Date;return i.setHours(0,0,0,0),U.dateJSAndZoneToArcadeDate(i,N(n))})},e.time=function(n,r){return t(n,r,(a,o,s)=>{switch(D(s,0,4,n,r),s.length){case 0:{const i=U.nowToArcadeDate(N(n));return new ge(i.hour,i.minute,i.second,i.millisecond)}case 1:{if(j(s[0]))return s[0].clone();if(H(s[0]))return new ge(s[0].hour,s[0].minute,s[0].second,s[0].millisecond);if(P(s[0]))return new ge(0,0,0,0);if(F(s[0]))return ge.fromString(s[0]);const i=p(s[0]);return isNaN(i)===!1?ge.fromMilliseconds(i):null}case 2:return F(s[0])&&F(s[1])?ge.fromString(s[0],s[1]):ge.fromParts(p(s[0]),p(s[1]),0,0);case 3:return ge.fromParts(p(s[0]),p(s[1]),p(s[2]),0);case 4:return ge.fromParts(p(s[0]),p(s[1]),p(s[2]),p(s[3]))}throw new d(n,c.InvalidParameter,r)})},e.dateonly=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,0,3,n,r),s.length===3)return De.fromParts(p(s[0]),p(s[1])+1,p(s[2]));if(s.length===2){const i=A(s[1]);return i===""?null:i==="X"?De.fromSeconds(p(s[0])):i==="x"?De.fromMilliseconds(p(s[0])):De.fromString(A(s[0]),i)}if(s.length===1){if(F(s[0])){if(s[0].replaceAll(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")==="")return null;if(/^[0-9][0-9][0-9][0-9]$/.test(s[0])===!0)return De.fromString(s[0]+"-01-01")}if(P(s[0]))return s[0].clone();if(H(s[0]))return De.fromParts(s[0].year,s[0].monthJS+1,s[0].day);const i=p(s[0]);return isNaN(i)===!1?De.fromMilliseconds(i):F(s[0])?De.fromString(s[0]):null}if(s.length===0){const i=U.nowToArcadeDate(N(n));return i.isValid===!1?null:De.fromParts(i.year,i.monthJS+1,i.day)}return null})},e.changetimezone=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,2,2,n,r),s[0]===null)return null;if(P(s[0]))throw new d(n,c.CannotChangeTimeZoneDateOnly,r);if(P(s[0]))throw new d(n,c.CannotChangeTimeZoneTime,r);const i=ue(s[0],N(n));if(i===null)throw new d(n,c.InvalidParameter,r);const u=_t(Mt(A(s[1]),n),!1);if(u===null)return null;const l=U.arcadeDateAndZoneToArcadeDate(i,u);return l.isValid===!1?null:l})},e.timezone=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,1,2,n,r),j(s[0])||P(s[0]))return"Unknown";const i=ue(s[0],N(n));if(i===null)return null;const u=i.timeZone;return u==="system"?U.systemTimeZoneCanonicalName:u.toLowerCase()==="utc"?"UTC":u.toLowerCase()==="unknown"?"Unknown":u})},e.timezoneoffset=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);const i=ue(s[0],N(n));return i===null?null:60*i.timeZoneOffset*1e3})},e.now=function(n,r){return t(n,r,(a,o,s)=>{D(s,0,0,n,r);const i=U.nowToArcadeDate(N(n));return i.isValid===!1?null:i})},e.timestamp=function(n,r){return t(n,r,(a,o,s)=>{D(s,0,0,n,r);const i=U.nowUTCToArcadeDate();return i.isValid===!1?null:i})},e.toutc=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);const i=ue(s[0],N(n));return i===null?null:i.toUTC()})},e.tolocal=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);const i=ue(s[0],N(n));return i===null?null:i.toLocal()})},e.day=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);const i=Oe(s[0],N(n));return i===null?NaN:i.day})},e.month=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);const i=Oe(s[0],N(n));return i===null?NaN:i.monthJS})},e.year=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);const i=Oe(s[0],N(n));return i===null?NaN:i.year})},e.hour=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,1,1,n,r),j(s[0]))return s[0].hour;const i=ue(s[0],N(n));return i===null?NaN:i.hour})},e.second=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,1,1,n,r),j(s[0]))return s[0].second;const i=ue(s[0],N(n));return i===null?NaN:i.second})},e.millisecond=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,1,1,n,r),j(s[0]))return s[0].millisecond;const i=ue(s[0],N(n));return i===null?NaN:i.millisecond})},e.minute=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,1,1,n,r),j(s[0]))return s[0].minute;const i=ue(s[0],N(n));return i===null?NaN:i.minute})},e.week=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,2,n,r);const i=Oe(s[0],N(n));if(i===null)return NaN;const u=p(R(s[1],0));if(u<0||u>6)throw new d(n,c.InvalidParameter,r);const l=i.day,h=i.monthJS,f=i.year,m=i.dayOfWeekJS,g=ss(l,h,f)-1,y=Math.floor(g/7);return m-u+(m-u<0?7:0){D(s,1,1,n,r);const i=Oe(s[0],N(n));return i===null?NaN:i.dayOfWeekJS})},e.isoweekday=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);const i=Oe(s[0],N(n));return i===null?NaN:i.dayOfWeekISO})},e.isomonth=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);const i=Oe(s[0],N(n));return i===null?NaN:i.monthISO})},e.isoweek=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);const i=Oe(s[0],N(n));return i===null?NaN:i.weekISO})},e.isoyear=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);const i=Oe(s[0],N(n));return i===null?NaN:i.yearISO})},e.date=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,0,8,n,r),s.length===3){if(P(s[0])&&j(s[1])&&F(s[2])){const i=_t(Mt(A(s[2])??"unknown",n),!1);return i===null?null:Re(U.fromParts(s[0].year,s[0].month,s[0].day,s[1].hour,s[1].minute,s[1].second,s[1].millisecond,i))}return Re(U.fromParts(p(s[0]),p(s[1])+1,p(s[2]),0,0,0,0,N(n)))}if(s.length===4)return Re(U.fromParts(p(s[0]),p(s[1])+1,p(s[2]),p(s[3]),0,0,0,N(n)));if(s.length===5)return Re(U.fromParts(p(s[0]),p(s[1])+1,p(s[2]),p(s[3]),p(s[4]),0,0,N(n)));if(s.length===6)return Re(U.fromParts(p(s[0]),p(s[1])+1,p(s[2]),p(s[3]),p(s[4]),p(s[5]),0,N(n)));if(s.length===7)return Re(U.fromParts(p(s[0]),p(s[1])+1,p(s[2]),p(s[3]),p(s[4]),p(s[5]),p(s[6]),N(n)));if(s.length===8){const i=_t(Mt(A(s[7])??"unknown",n),!1);return i===null?null:Re(U.fromParts(p(s[0]),p(s[1])+1,p(s[2]),p(s[3]),p(s[4]),p(s[5]),p(s[6]),i))}if(s.length===2){if(P(s[0])&&F(s[1])){const l=_t(Mt(A(s[1])??"unknown",n),!1);return l===null?null:Re(U.fromParts(s[0].year,s[0].month,s[0].day,0,0,0,0,l))}if(P(s[0])&&j(s[1]))return Re(U.fromParts(s[0].year,s[0].month,s[0].day,s[1].hour,s[1].minute,s[1].second,s[1].millisecond,"unknown"));let i,u=A(s[1]);return u===""?null:(u=pr(u,!0),i=u==="X"?st.fromSeconds(p(s[0])):u==="x"?st.fromMillis(p(s[0])):st.fromFormat(A(s[0]),u,{locale:sr(),numberingSystem:"latn"}),i.isValid?U.dateTimeToArcadeDate(i):null)}if(s.length===1){if(P(s[0]))return Re(U.fromParts(s[0].year,s[0].month,s[0].day,0,0,0,0,"unknown"));if(F(s[0])){if(s[0].replaceAll(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")==="")return null;if(/^[0-9][0-9][0-9][0-9]$/.test(s[0])===!0)return ue(s[0]+"-01-01",N(n))}const i=p(s[0]);if(isNaN(i)===!1){const u=st.fromMillis(i);return u.isValid?U.dateTimeAndZoneToArcadeDate(u,N(n)):null}return ue(s[0],N(n))}return s.length===0?U.nowToArcadeDate(N(n)):null})},e.datediff=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,2,4,n,r),j(s[0]))return j(s[1])?s[0].difference(s[1],A(s[2])):NaN;if(j(s[1]))return NaN;if(P(s[0]))return P(s[1])?s[0].difference(s[1],A(s[2])):NaN;if(P(s[1]))return NaN;let i=ue(s[0],N(n)),u=ue(s[1],N(n));if(i===null||u===null)return NaN;let l=R(s[3],"");switch(l!==""&&l!==null?(l=Mt(A(l),n),i=U.arcadeDateAndZoneToArcadeDate(i,l),u=U.arcadeDateAndZoneToArcadeDate(u,l)):i.timeZone!==u.timeZone&&(i.isUnknownTimeZone?i=U.arcadeDateAndZoneToArcadeDate(i,u.timeZone):u=(u.isUnknownTimeZone,U.arcadeDateAndZoneToArcadeDate(u,i.timeZone))),A(s[2]).toLowerCase()){case"days":case"day":case"d":return i.diff(u,"days");case"months":case"month":return i.diff(u,"months");case"minutes":case"minute":case"m":return s[2]==="M"?i.diff(u,"months"):i.diff(u,"minutes");case"seconds":case"second":case"s":return i.diff(u,"seconds");case"milliseconds":case"millisecond":case"ms":default:return i.diff(u);case"hours":case"hour":case"h":return i.diff(u,"hours");case"years":case"year":case"y":return i.diff(u,"years")}})},e.dateadd=function(n,r){return t(n,r,(a,o,s)=>{D(s,2,3,n,r);let i=p(s[1]);if(isNaN(i)||i===1/0||i===-1/0)return j(s[0])||P(s[0])?s[0].clone():ue(s[0],N(n));let u="milliseconds";switch(A(s[2]).toLowerCase()){case"days":case"day":case"d":u="days",i=P(s[0])?i:Zn(i);break;case"months":case"month":u="months",i=P(s[0])?i:Zn(i);break;case"minutes":case"minute":case"m":u=s[2]==="M"?"months":"minutes";break;case"seconds":case"second":case"s":u="seconds";break;case"milliseconds":case"millisecond":case"ms":u="milliseconds";break;case"hours":case"hour":case"h":u="hours";break;case"years":case"year":case"y":u="years"}if(j(s[0])||P(s[0]))return s[0].plus(u,i);const l=ue(s[0],N(n));return l===null?null:l.plus({[u]:i})})}}function xe(e,t,n){return Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]!==void 0&&t[2]!==void 0?(e[2]*n-t[2]*n)**2:0))}function Zi(e,t,n){return Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]!==void 0&&t[2]!==void 0?(e[2]*n-t[2]*n)**2:0))}const Rt=[];for(const e of[[9002,56146130,6131,6132,8050,8051,8228],[9003,5702,6358,6359,6360,8052,8053],[9095,5754]]){const t=e[0];for(let n=1;n0?(r.x/=a,r.y/=a,t&&(r.z/=a),n&&(r.m/=a)):(r.x=e[0][0],r.y=e[0][1],t&&(r.z=e[0][2]),n&&t?r.m=e[0][3]:n&&(r.m=e[0][2])),r}function cs(e,t,n,r){const a={x:(e[0]+t[0])/2,y:(e[1]+t[1])/2};return n&&(a.z=(e[2]+t[2])/2),n&&r?a.m=(e[3]+t[3])/2:r&&(a.m=(e[2]+t[2])/2),a}function fs(e,t){if(e.length<=1)return 0;let n=0;for(let r=1;r0?(n.x/=a,n.y/=a,e.hasZ===!0&&(n.z/=a),e.hasM===!0&&(n.m/=a),new J(n)):r>0?(t.x/=r,t.y/=r,e.hasZ===!0&&(n.z/=r),e.hasM===!0&&(t.m/=r),new J(t)):null}function ps(e){if(e.points.length===0)return null;let t=0,n=0,r=0,a=0;for(let s=0;s=r;)e-=t;return e}function ji(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}function gs(e,t){return Fn(ji(e,t),2*Math.PI)*(180/Math.PI)}function ys(e,t){return Fn(Math.PI/2-ji(e,t),2*Math.PI)*(180/Math.PI)}function Ji(e,t,n){const r={x:e.x-t.x,y:e.y-t.y},a={x:n.x-t.x,y:n.y-t.y};return Math.atan2(Ds(r,a),ms(r,a))}function ws(e,t,n){return pi(Fn(Ji(e,t,n),2*Math.PI))}function xs(e,t,n){return pi(Fn(-1*Ji(e,t,n),2*Math.PI))}Ut[9002]=.3048,Ut[9003]=.3048006096012192,Ut[9095]=.3048007491;const oe=[0,0];function Or(e){for(let t=0;t1&&(r=1)),r<=.5?[t[0]+(n[0]-t[0])*r,t[1]+(n[1]-t[1])*r]:[n[0]-(n[0]-t[0])*(1-r),n[1]-(n[1]-t[1])*(1-r)]}function en(e){return e&&e.arcadeDeclaredClass==="esri.arcade.Feature"}function Vi(e,t){e.ringisclockwise=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);let i=[];if(s[0]===null)return!1;if(k(s[0]))for(const u of s[0]){if(!(u instanceof J))throw new d(n,c.InvalidParameter,r);i.push(u.hasZ?u.hasM?[u.x,u.y,u.z,u.m]:[u.x,u.y,u.z]:[u.x,u.y])}else if(s[0]instanceof ft)i=s[0]._elements;else{if(!M(s[0]))throw new d(n,c.InvalidParameter,r);for(const u of s[0].toArray()){if(!(u instanceof J))throw new d(n,c.InvalidParameter,r);i.push(u.hasZ?u.hasM?[u.x,u.y,u.z,u.m]:[u.x,u.y,u.z]:[u.x,u.y])}}return!(i.length<3)&&di(i)})},e.polygon=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);let i=null;if(s[0]instanceof B){if(i=ne(Q.parseGeometryFromDictionary(s[0],n.spatialReference),n.spatialReference),!(i instanceof ie))throw new d(n,c.InvalidParameter,r)}else if(s[0]instanceof ie)i=le(s[0].toJSON());else{const u=JSON.parse(s[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=ne(new ie(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new d(n,c.WrongSpatialReference,r);return it(i)})},e.polyline=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);let i=null;if(s[0]instanceof B){if(i=ne(Q.parseGeometryFromDictionary(s[0],n.spatialReference),n.spatialReference),!(i instanceof te))throw new d(n,c.InvalidParameter,r)}else if(s[0]instanceof te)i=le(s[0].toJSON());else{const u=JSON.parse(s[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=ne(new te(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new d(n,c.WrongSpatialReference,r);return it(i)})},e.point=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);let i=null;if(s[0]instanceof B){if(i=ne(Q.parseGeometryFromDictionary(s[0],n.spatialReference),n.spatialReference),!(i instanceof J))throw new d(n,c.InvalidParameter,r)}else if(s[0]instanceof J)i=le(s[0].toJSON());else{const u=JSON.parse(s[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=ne(new J(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new d(n,c.WrongSpatialReference,r);return it(i)})},e.multipoint=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);let i=null;if(s[0]instanceof B){if(i=ne(Q.parseGeometryFromDictionary(s[0],n.spatialReference),n.spatialReference),!(i instanceof Ie))throw new d(n,c.InvalidParameter,r)}else if(s[0]instanceof Ie)i=le(s[0].toJSON());else{const u=JSON.parse(s[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=ne(new Ie(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new d(n,c.WrongSpatialReference,r);return it(i)})},e.extent=function(n,r){return t(n,r,(a,o,s)=>{var u,l,h;s=G(s),D(s,1,1,n,r);let i=null;if(s[0]instanceof B)i=ne(Q.parseGeometryFromDictionary(s[0],n.spatialReference),n.spatialReference);else if(s[0]instanceof J){const f={xmin:s[0].x,ymin:s[0].y,xmax:s[0].x,ymax:s[0].y,spatialReference:s[0].spatialReference.toJSON()},m=s[0];m.hasZ?(f.zmin=m.z,f.zmax=m.z):m.hasM&&(f.mmin=m.m,f.mmax=m.m),i=le(f)}else if(s[0]instanceof ie)i=le((u=s[0].extent)==null?void 0:u.toJSON());else if(s[0]instanceof te)i=le((l=s[0].extent)==null?void 0:l.toJSON());else if(s[0]instanceof Ie)i=le((h=s[0].extent)==null?void 0:h.toJSON());else if(s[0]instanceof we)i=le(s[0].toJSON());else{const f=JSON.parse(s[0]);f&&!f.spatialReference&&(f.spatialReference=n.spatialReference),i=ne(new we(f),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new d(n,c.WrongSpatialReference,r);return it(i)})},e.geometry=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);let i=null;if(s[0]===null)return null;if(en(s[0]))i=ne(s[0].geometry(),n.spatialReference);else if(s[0]instanceof B)i=ne(Q.parseGeometryFromDictionary(s[0],n.spatialReference),n.spatialReference);else{const u=JSON.parse(s[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=ne(le(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new d(n,c.WrongSpatialReference,r);return it(i)})},e.setgeometry=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,2,2,n,r),!en(s[0]))throw new d(n,c.InvalidParameter,r);if(s[0].immutable===!0)throw new d(n,c.Immutable,r);if(!(s[1]instanceof $||s[1]===null))throw new d(n,c.InvalidParameter,r);return s[0]._geometry=s[1],b})},e.feature=function(n,r){return t(n,r,(a,o,s)=>{if(s.length===0)throw new d(n,c.WrongNumberOfParameters,r);let i=null;if(s.length===1)if(F(s[0]))i=Q.fromJson(JSON.parse(s[0]),n.timeZone);else if(en(s[0]))i=Q.createFromArcadeFeature(s[0]);else if(s[0]instanceof $)i=Q.createFromGraphicLikeObject(s[0],null,null,n.timeZone);else{if(!(s[0]instanceof B))throw new d(n,c.InvalidParameter,r);{let u=s[0].hasField("geometry")?s[0].field("geometry"):null,l=s[0].hasField("attributes")?s[0].field("attributes"):null;u!==null&&u instanceof B&&(u=Q.parseGeometryFromDictionary(u,n.spatialReference)),l!==null&&(l=Q.parseAttributesFromDictionary(l)),i=Q.createFromGraphicLikeObject(u,l,null,n.timeZone)}}else if(s.length===2){let u=null,l=null;if(s[0]!==null)if(s[0]instanceof $)u=s[0];else{if(!(u instanceof B))throw new d(n,c.InvalidParameter,r);u=Q.parseGeometryFromDictionary(s[0],n.spatialReference)}if(s[1]!==null){if(!(s[1]instanceof B))throw new d(n,c.InvalidParameter,r);l=Q.parseAttributesFromDictionary(s[1])}i=Q.createFromGraphicLikeObject(u,l,null,n.timeZone)}else{let u=null;const l={};if(s[0]!==null)if(s[0]instanceof $)u=s[0];else{if(!(u instanceof B))throw new d(n,c.InvalidParameter,r);u=Q.parseGeometryFromDictionary(s[0],n.spatialReference)}for(let h=1;h{if(s.length===0||s.length===1&&s[0]===null){const l=new B;return l.immutable=!1,l}if(s.length===1&&F(s[0]))try{const l=JSON.parse(s[0]),h=B.convertObjectToArcadeDictionary(l,N(n),!1);return h.immutable=!1,h}catch{throw new d(n,c.InvalidParameter,r)}if(s.length===1&&s[0]instanceof $)try{const l=s[0].toJSON();l.hasZ=s[0].hasZ===!0,l.hasM=s[0].hasM===!0;const h=B.convertObjectToArcadeDictionary(l,N(n),!1);return h.immutable=!1,h}catch{throw new d(n,c.InvalidParameter,r)}if(s.length===1&&ee(s[0]))try{const l=new B;l.immutable=!1,l.setField("geometry",s[0].geometry());const h=new B;h.immutable=!1,l.setField("attributes",h);for(const f of s[0].keys())h.setField(f,s[0].field(f));return l}catch{throw new d(n,c.InvalidParameter,r)}if(s.length===1&&s[0]instanceof B)try{const l=new B;l.immutable=!1;for(const h of s[0].keys())l.setField(h,s[0].field(h));return l}catch{throw new d(n,c.InvalidParameter,r)}if(s.length===2&&s[0]instanceof B&&V(s[1]))try{if(s[1]!==!0){const l=new B;l.immutable=!1;for(const h of s[0].keys())l.setField(h,s[0].field(h));return l}return s[0].deepClone()}catch{throw new d(n,c.InvalidParameter,r)}if(s.length%2!=0)throw new d(n,c.WrongNumberOfParameters,r);const i={};for(let l=0;l{D(s,2,2,n,r);const i=A(s[1]);if(en(s[0])||s[0]instanceof B)return s[0].hasField(i);if(s[0]instanceof $){const u=et(s[0],i,null,null,2);return!u||u.keystate!=="notfound"}throw new d(n,c.InvalidParameter,r)})},e.hasvalue=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,2,2,n,r),k(s[1])||M(s[1])){const u=s[1];let l=[];if(M(u))l=u.toArray();else{if(!k(u))throw new d(n,c.InvalidParameter,r);l=u}let h=s[0];if(h===null)return!1;for(const f of l)if(ee(h)){if(F(f)===!1||!h.hasField(f)||(h=h.field(f),h===null))return!1}else if(h instanceof B){if(F(f)===!1||!h.hasField(f)||(h=h.field(f),h===null))return!1}else if(h instanceof $){if(F(f)===!1||(h=et(h,f,null,null,0),h===null))return!1}else if(k(h)){if(L(f)===!1||(h=h[f],h==null))return!1}else if(!M(h)||L(f)===!1||(h=h.get(f),h==null))return!1;return!0}if(s[0]===null||s[1]===null)return!1;const i=A(s[1]);return ee(s[0])||s[0]instanceof B?!!s[0].hasField(i)&&s[0].field(i)!==null:s[0]instanceof $?et(s[0],i,null,null,0)!==null:!1})},e.indexof=function(n,r){return t(n,r,(a,o,s)=>{D(s,2,2,n,r);const i=s[1];if(k(s[0])){for(let u=0;u{if(s=G(s),D(s,2,3,n,r),!(s[0]instanceof J))throw new d(n,c.InvalidParameter,r);if(!(s[1]instanceof J))throw new d(n,c.InvalidParameter,r);if(s.length>2&&!(s[2]instanceof J))throw new d(n,c.InvalidParameter,r);return s.length===2?gs(s[0],s[1]):ws(s[0],s[1],s[2])})},e.bearing=function(n,r){return t(n,r,(a,o,s)=>{if(s=G(s),D(s,2,3,n,r),!(s[0]instanceof J))throw new d(n,c.InvalidParameter,r);if(!(s[1]instanceof J))throw new d(n,c.InvalidParameter,r);if(s.length>2&&!(s[2]instanceof J))throw new d(n,c.InvalidParameter,r);return s.length===2?ys(s[0],s[1]):xs(s[0],s[1],s[2])})},e.isselfintersecting=function(n,r){return t(n,r,(a,o,s)=>{s=G(s),D(s,1,1,n,r);let i=s[0];if(i instanceof ie)return i.isSelfIntersecting;if(i instanceof te)return i=i.paths,Or(i);if(i instanceof Ie){const u=i.points;for(let l=0;l0&&l[0][i]===t)return{partId:a,distanceAlong:o,coordinate:new J({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:l[0][0],y:l[0][1],...e.hasZ?{z:l[0][u]}:{},...e.hasM?{m:l[0][i]}:{}}),segmentId:0};let h=-1;for(let f=1;ft&&t>l[f-1][i]){const T=(t-l[f-1][i])/g*m;let v=e.hasZ?Hi(l[f-1],l[f],T,r):Ki(l[f-1],l[f],T);v=[...v,t];const z=new J({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:v[0],y:v[1],...e.hasZ?{z:v[u]}:{},...e.hasM?{m:v[i]}:{}});return{partId:a,distanceAlong:o+s(l[f-1],[z.x,z.y,...z.hasZ?[z.z]:[],...z.hasM?[z.m]:[]],r),coordinate:z,segmentId:h}}o+=m}}return null}function ks(e,t){if(!e)return null;switch(e.type){case"extent":case"multipoint":case"mesh":case"point":return null}const n=e.type==="polygon"?e.rings:e.paths;if(t<0)return null;let r=1;(e.spatialReference.vcsWkid||e.spatialReference.latestVcsWkid)&&(r=Bt(e.spatialReference)/It(e.spatialReference));let a=0;const o=e.hasZ?3:2,s=2,i=e.hasZ?xe:qi;let u=-1;if(t===0)return n.length===0||n[0].length===0?null:{partId:0,coordinate:new J({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:n[0][0][0],y:n[0][0][1],...e.hasZ?{z:n[0][0][s]}:{},...e.hasM?{m:n[0][0][o]}:{}}),segmentId:0};for(const l of n){u++;let h=-1;for(let f=1;ft){let y=e.hasZ?Hi(l[f-1],l[f],t-a,r):Ki(l[f-1],l[f],t-a);return y=[...y,Hn(l[f-1][o],l[f][o],m,t-a)],{partId:u,coordinate:new J({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:y[0],y:y[1],...e.hasZ?{z:y[s]}:{},...e.hasM?{m:y[o]}:{}}),segmentId:h}}a=g}}return null}function Ts(e,t){if(!e||!t)return null;let n=1;(t.spatialReference.vcsWkid||t.spatialReference.latestVcsWkid)&&(n=Bt(t.spatialReference)/It(t.spatialReference));let r=null,a=0;return r=e,a=e.hasZ&&t.hasZ?xe([t.x,t.y,t.z],[e.x,e.y,e.z],n):Je([t.x,t.y],[e.x,e.y],!1),{coordinate:r,distance:a}}function Bs(e,t){if(!e||!t)return null;let n=1;(t.spatialReference.vcsWkid||t.spatialReference.latestVcsWkid)&&(n=Bt(t.spatialReference)/It(t.spatialReference));let r=null,a=0,o=Number.MAX_VALUE,s=-1,i=-1;for(const u of e.points||[]){i++;const l=e.hasZ&&t.hasZ?Zi([u[0],u[1],u[2]],[t.x,t.y,t.z],n):Gi([u[0],u[1]],[t.x,t.y],!1);l(i=G(i),n(r,a,i),i[0]===null||i[1]===null||Z.disjoint(i[0],i[1])))},e.intersects=function(r,a){return t(r,a,(o,s,i)=>(i=G(i),n(r,a,i),i[0]!==null&&i[1]!==null&&Z.intersects(i[0],i[1])))},e.touches=function(r,a){return t(r,a,(o,s,i)=>(i=G(i),n(r,a,i),i[0]!==null&&i[1]!==null&&Z.touches(i[0],i[1])))},e.crosses=function(r,a){return t(r,a,(o,s,i)=>(i=G(i),n(r,a,i),i[0]!==null&&i[1]!==null&&Z.crosses(i[0],i[1])))},e.within=function(r,a){return t(r,a,(o,s,i)=>(i=G(i),n(r,a,i),i[0]!==null&&i[1]!==null&&Z.within(i[0],i[1])))},e.contains=function(r,a){return t(r,a,(o,s,i)=>(i=G(i),n(r,a,i),i[0]!==null&&i[1]!==null&&Z.contains(i[0],i[1])))},e.overlaps=function(r,a){return t(r,a,(o,s,i)=>(i=G(i),n(r,a,i),i[0]!==null&&i[1]!==null&&Z.overlaps(i[0],i[1])))},e.equals=function(r,a){return t(r,a,(o,s,i)=>(D(i,2,2,r,a),i[0]===i[1]||(i[0]instanceof $&&i[1]instanceof $?Z.equals(i[0],i[1]):(H(i[0])&&H(i[1])||j(i[0])&&j(i[1])||!(!P(i[0])||!P(i[1])))&&i[0].equals(i[1]))))},e.relate=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,3,3,r,a),i[0]instanceof $&&i[1]instanceof $)return Z.relate(i[0],i[1],A(i[2]));if(i[0]instanceof $&&i[1]===null||i[1]instanceof $&&i[0]===null||i[0]===null&&i[1]===null)return!1;throw new d(r,c.InvalidParameter,a)})},e.intersection=function(r,a){return t(r,a,(o,s,i)=>(i=G(i),n(r,a,i),i[0]===null||i[1]===null?null:Z.intersect(i[0],i[1])))},e.union=function(r,a){return t(r,a,(o,s,i)=>{const u=[];if((i=G(i)).length===0)throw new d(r,c.WrongNumberOfParameters,a);if(i.length===1)if(k(i[0])){const l=G(i[0]);for(let h=0;h(i=G(i),n(r,a,i),i[0]!==null&&i[1]===null?Be(i[0]):i[0]===null?null:Z.difference(i[0],i[1])))},e.symmetricdifference=function(r,a){return t(r,a,(o,s,i)=>(i=G(i),n(r,a,i),i[0]===null&&i[1]===null?null:i[0]===null?Be(i[1]):i[1]===null?Be(i[0]):Z.symmetricDifference(i[0],i[1])))},e.clip=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,2,2,r,a),!(i[1]instanceof we)&&i[1]!==null)throw new d(r,c.InvalidParameter,a);if(i[0]===null)return null;if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);return i[1]===null?null:Z.clip(i[0],i[1])})},e.cut=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,2,2,r,a),!(i[1]instanceof te)&&i[1]!==null)throw new d(r,c.InvalidParameter,a);if(i[0]===null)return[];if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);return i[1]===null?[Be(i[0])]:Z.cut(i[0],i[1])})},e.area=function(r,a){return t(r,a,(o,s,i)=>{if(D(i,1,2,r,a),(i=G(i))[0]===null)return 0;if(k(i[0])||M(i[0])){const u=jn(i[0],r.spatialReference);return u===null?0:Z.planarArea(u,Xt(R(i[1],-1)))}if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);return Z.planarArea(i[0],Xt(R(i[1],-1)))})},e.areageodetic=function(r,a){return t(r,a,(o,s,i)=>{if(D(i,1,2,r,a),(i=G(i))[0]===null)return 0;if(k(i[0])||M(i[0])){const u=jn(i[0],r.spatialReference);return u===null?0:Z.geodesicArea(u,Xt(R(i[1],-1)))}if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);return Z.geodesicArea(i[0],Xt(R(i[1],-1)))})},e.length=function(r,a){return t(r,a,(o,s,i)=>{if(D(i,1,2,r,a),(i=G(i))[0]===null)return 0;if(k(i[0])||M(i[0])){const u=We(i[0],r.spatialReference);return u===null?0:Z.planarLength(u,se(R(i[1],-1)))}if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);return Z.planarLength(i[0],se(R(i[1],-1)))})},e.length3d=function(r,a){return t(r,a,(o,s,i)=>{if(D(i,1,2,r,a),(i=G(i))[0]===null)return 0;if(k(i[0])||M(i[0])){const u=We(i[0],r.spatialReference);return u===null?0:u.hasZ===!0?zr(u,se(R(i[1],-1))):Z.planarLength(u,se(R(i[1],-1)))}if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);return i[0].hasZ===!0?zr(i[0],se(R(i[1],-1))):Z.planarLength(i[0],se(R(i[1],-1)))})},e.lengthgeodetic=function(r,a){return t(r,a,(o,s,i)=>{if(D(i,1,2,r,a),(i=G(i))[0]===null)return 0;if(k(i[0])||M(i[0])){const u=We(i[0],r.spatialReference);return u===null?0:Z.geodesicLength(u,se(R(i[1],-1)))}if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);return Z.geodesicLength(i[0],se(R(i[1],-1)))})},e.distance=function(r,a){return t(r,a,(o,s,i)=>{i=G(i),D(i,2,3,r,a);let u=i[0];(k(i[0])||M(i[0]))&&(u=nn(i[0],r.spatialReference));let l=i[1];if((k(i[1])||M(i[1]))&&(l=nn(i[1],r.spatialReference)),!(u instanceof $))throw new d(r,c.InvalidParameter,a);if(!(l instanceof $))throw new d(r,c.InvalidParameter,a);return Z.distance(u,l,se(R(i[2],-1)))})},e.distancegeodetic=function(r,a){return t(r,a,(o,s,i)=>{i=G(i),D(i,2,3,r,a);const u=i[0],l=i[1];if(!(u instanceof J))throw new d(r,c.InvalidParameter,a);if(!(l instanceof J))throw new d(r,c.InvalidParameter,a);const h=new te({paths:[],spatialReference:u.spatialReference});return h.addPath([u,l]),Z.geodesicLength(h,se(R(i[2],-1)))})},e.densify=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);const u=p(i[1]);if(isNaN(u))throw new d(r,c.InvalidParameter,a);if(u<=0)throw new d(r,c.InvalidParameter,a);return i[0]instanceof ie||i[0]instanceof te?Z.densify(i[0],u,se(R(i[2],-1))):i[0]instanceof we?Z.densify(Ur(i[0]),u,se(R(i[2],-1))):i[0]})},e.densifygeodetic=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);const u=p(i[1]);if(isNaN(u))throw new d(r,c.InvalidParameter,a);if(u<=0)throw new d(r,c.InvalidParameter,a);return i[0]instanceof ie||i[0]instanceof te?Z.geodesicDensify(i[0],u,se(R(i[2],-1))):i[0]instanceof we?Z.geodesicDensify(Ur(i[0]),u,se(R(i[2],-1))):i[0]})},e.generalize=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,2,4,r,a),i[0]===null)return null;if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);const u=p(i[1]);if(isNaN(u))throw new d(r,c.InvalidParameter,a);return Z.generalize(i[0],u,Ct(R(i[2],!0)),se(R(i[3],-1)))})},e.buffer=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);const u=p(i[1]);if(isNaN(u))throw new d(r,c.InvalidParameter,a);return u===0?Be(i[0]):Z.buffer(i[0],u,se(R(i[2],-1)))})},e.buffergeodetic=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);const u=p(i[1]);if(isNaN(u))throw new d(r,c.InvalidParameter,a);return u===0?Be(i[0]):Z.geodesicBuffer(i[0],u,se(R(i[2],-1)))})},e.offset=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,2,6,r,a),i[0]===null)return null;if(!(i[0]instanceof ie||i[0]instanceof te))throw new d(r,c.InvalidParameter,a);const u=p(i[1]);if(isNaN(u))throw new d(r,c.InvalidParameter,a);const l=p(R(i[4],10));if(isNaN(l))throw new d(r,c.InvalidParameter,a);const h=p(R(i[5],0));if(isNaN(h))throw new d(r,c.InvalidParameter,a);return Z.offset(i[0],u,se(R(i[2],-1)),A(R(i[3],"round")).toLowerCase(),l,h)})},e.rotate=function(r,a){return t(r,a,(o,s,i)=>{i=G(i),D(i,2,3,r,a);let u=i[0];if(u===null)return null;if(!(u instanceof $))throw new d(r,c.InvalidParameter,a);u instanceof we&&(u=ie.fromExtent(u));const l=p(i[1]);if(isNaN(l))throw new d(r,c.InvalidParameter,a);const h=R(i[2],null);if(h===null)return Z.rotate(u,l);if(h instanceof J)return Z.rotate(u,l,h);throw new d(r,c.InvalidParameter,a)})},e.centroid=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,1,1,r,a),i[0]===null)return null;let u=i[0];if((k(i[0])||M(i[0]))&&(u=nn(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof $))throw new d(r,c.InvalidParameter,a);return u instanceof J?ne(Be(i[0]),r.spatialReference):u instanceof ie?u.centroid:u instanceof te?hs(u):u instanceof Ie?ps(u):u instanceof we?u.center:null})},e.measuretocoordinate=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,2,2,r,a),i[0]===null)return null;let u=i[0];if((k(i[0])||M(i[0]))&&(u=We(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof $))throw new d(r,c.InvalidParameter,a);if(!(u instanceof te))throw new d(r,c.InvalidParameter,a);if(L(i[1]===!1))throw new d(r,c.InvalidParameter,a);const l=Is(u,i[1]);return l?B.convertObjectToArcadeDictionary(l,N(r),!1,!0):null})},e.pointtocoordinate=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,2,2,r,a),i[0]===null)return null;let u=i[0];if((k(i[0])||M(i[0]))&&(u=We(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof $))throw new d(r,c.InvalidParameter,a);if(!(u instanceof te))throw new d(r,c.InvalidParameter,a);const l=i[1];if(l===null)return null;if(!(l instanceof J))throw new d(r,c.InvalidParameter,a);if(L(i[1]===!1))throw new d(r,c.InvalidParameter,a);const h=Ms(u,l);return h?B.convertObjectToArcadeDictionary(h,N(r),!1,!0):null})},e.distancetocoordinate=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,2,2,r,a),i[0]===null)return null;let u=i[0];if((k(i[0])||M(i[0]))&&(u=We(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof $))throw new d(r,c.InvalidParameter,a);if(!(u instanceof te))throw new d(r,c.InvalidParameter,a);if(L(i[1]===!1))throw new d(r,c.InvalidParameter,a);const l=ks(u,i[1]);return l?B.convertObjectToArcadeDictionary(l,N(r),!1,!0):null})},e.multiparttosinglepart=function(r,a){return t(r,a,(o,s,i)=>{i=G(i),D(i,1,1,r,a);const u=[];if(i[0]===null)return null;if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);if(i[0]instanceof J)return[ne(Be(i[0]),r.spatialReference)];if(i[0]instanceof we)return[ne(Be(i[0]),r.spatialReference)];const l=Z.simplify(i[0]);if(l instanceof ie){const h=[],f=[];for(let m=0;m{if(i=G(i),D(i,1,1,r,a),i[0]===null)return!0;if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);return Z.isSimple(i[0])})},e.simplify=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,1,1,r,a),i[0]===null)return null;if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);return Z.simplify(i[0])})},e.convexhull=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,1,1,r,a),i[0]===null)return null;if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);return Z.convexHull(i[0])})},e.nearestcoordinate=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,2,2,r,a),!(i[0]instanceof $||i[0]===null))throw new d(r,c.InvalidParameter,a);if(!(i[1]instanceof J||i[1]===null))throw new d(r,c.InvalidParameter,a);if(i[0]===null||i[1]===null)return null;const u=Z.nearestCoordinate(i[0],i[1]);return u===null||u.isEmpty?null:B.convertObjectToArcadeDictionary({coordinate:u.coordinate,distance:u.distance,sideOfLine:u.distance===0?"straddle":u.isRightSide?"right":"left"},N(r),!1,!0)})},e.nearestvertex=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,2,2,r,a),!(i[0]instanceof $||i[0]===null))throw new d(r,c.InvalidParameter,a);if(!(i[1]instanceof J||i[1]===null))throw new d(r,c.InvalidParameter,a);if(i[0]===null||i[1]===null)return null;const u=Z.nearestVertex(i[0],i[1]);return u===null||u.isEmpty?null:B.convertObjectToArcadeDictionary({coordinate:u.coordinate,distance:u.distance,sideOfLine:u.distance===0?"straddle":u.isRightSide?"right":"left"},N(r),!1,!0)})}}function Sn(e,t,n){return n===void 0||+n==0?Math[e](t):(t=+t,n=+n,isNaN(t)||typeof n!="number"||n%1!=0?NaN:(t=t.toString().split("e"),+((t=(t=Math[e](+(t[0]+"e"+(t[1]?+t[1]-n:-n)))).toString().split("e"))[0]+"e"+(t[1]?+t[1]+n:n))))}function Yi(e,t){function n(r,a,o){const s=p(r);return isNaN(s)?s:isNaN(a)||isNaN(o)||a>o?NaN:so?o:s}e.number=function(r,a){return t(r,a,(o,s,i)=>{D(i,1,2,r,a);const u=i[0];if(L(u))return u;if(u===null)return 0;if(H(u)||j(u)||P(u))return u.toNumber();if(V(u))return Number(u);if(k(u))return NaN;if(u===""||u===void 0)return Number(u);if(F(u)){if(i[1]!==void 0){let l=tt(i[1],"‰","");return l=tt(l,"¤",""),gi(u,{pattern:l})}return Number(u.trim())}return Number(u)})},e.abs=function(r,a){return t(r,a,(o,s,i)=>(D(i,1,1,r,a),Math.abs(p(i[0]))))},e.acos=function(r,a){return t(r,a,(o,s,i)=>(D(i,1,1,r,a),Math.acos(p(i[0]))))},e.asin=function(r,a){return t(r,a,(o,s,i)=>(D(i,1,1,r,a),Math.asin(p(i[0]))))},e.atan=function(r,a){return t(r,a,(o,s,i)=>(D(i,1,1,r,a),Math.atan(p(i[0]))))},e.atan2=function(r,a){return t(r,a,(o,s,i)=>(D(i,2,2,r,a),Math.atan2(p(i[0]),p(i[1]))))},e.ceil=function(r,a){return t(r,a,(o,s,i)=>{if(D(i,1,2,r,a),i.length===2){let u=p(i[1]);return isNaN(u)&&(u=0),Sn("ceil",p(i[0]),-1*u)}return Math.ceil(p(i[0]))})},e.round=function(r,a){return t(r,a,(o,s,i)=>{if(D(i,1,2,r,a),i.length===2){let u=p(i[1]);return isNaN(u)&&(u=0),Sn("round",p(i[0]),-1*u)}return Math.round(p(i[0]))})},e.floor=function(r,a){return t(r,a,(o,s,i)=>{if(D(i,1,2,r,a),i.length===2){let u=p(i[1]);return isNaN(u)&&(u=0),Sn("floor",p(i[0]),-1*u)}return Math.floor(p(i[0]))})},e.cos=function(r,a){return t(r,a,(o,s,i)=>(D(i,1,1,r,a),Math.cos(p(i[0]))))},e.isnan=function(r,a){return t(r,a,(o,s,i)=>(D(i,1,1,r,a),typeof i[0]=="number"&&isNaN(i[0])))},e.exp=function(r,a){return t(r,a,(o,s,i)=>(D(i,1,1,r,a),Math.exp(p(i[0]))))},e.log=function(r,a){return t(r,a,(o,s,i)=>(D(i,1,1,r,a),Math.log(p(i[0]))))},e.pow=function(r,a){return t(r,a,(o,s,i)=>(D(i,2,2,r,a),p(i[0])**p(i[1])))},e.random=function(r,a){return t(r,a,(o,s,i)=>(D(i,0,0,r,a),Math.random()))},e.sin=function(r,a){return t(r,a,(o,s,i)=>(D(i,1,1,r,a),Math.sin(p(i[0]))))},e.sqrt=function(r,a){return t(r,a,(o,s,i)=>(D(i,1,1,r,a),Math.sqrt(p(i[0]))))},e.tan=function(r,a){return t(r,a,(o,s,i)=>(D(i,1,1,r,a),Math.tan(p(i[0]))))},e.isempty=function(r,a){return t(r,a,(o,s,i)=>(D(i,1,1,r,a),i[0]===null||i[0]===""||i[0]===void 0||i[0]===b))},e.boolean=function(r,a){return t(r,a,(o,s,i)=>{D(i,1,1,r,a);const u=i[0];return Ct(u)})},e.constrain=function(r,a){return t(r,a,(o,s,i)=>{D(i,3,3,r,a);const u=p(i[1]),l=p(i[2]);if(k(i[0])){const h=[];for(const f of i[0])h.push(n(f,u,l));return h}if(M(i[0])){const h=[];for(let f=0;f=t&&t!==-1)return n}return n}function In(e,t,n=1e3){switch(e.toLowerCase()){case"distinct":return Rs(t,n);case"avg":case"mean":return Xi(rt(t));case"min":return Math.min.apply(Math,rt(t));case"sum":return _s(rt(t));case"max":return Math.max.apply(Math,rt(t));case"stdev":case"stddev":return Math.sqrt(Zr(rt(t)));case"var":case"variance":return Zr(rt(t));case"count":return t.length}return 0}function Ke(e,t,n,r){if(r.length===1){if(k(r[0]))return In(e,r[0],-1);if(M(r[0]))return In(e,r[0].toArray(),-1)}return In(e,r,-1)}function Qi(e,t){e.stdev=function(n,r){return t(n,r,(a,o,s)=>Ke("stdev",a,o,s))},e.variance=function(n,r){return t(n,r,(a,o,s)=>Ke("variance",a,o,s))},e.average=function(n,r){return t(n,r,(a,o,s)=>Ke("mean",a,o,s))},e.mean=function(n,r){return t(n,r,(a,o,s)=>Ke("mean",a,o,s))},e.sum=function(n,r){return t(n,r,(a,o,s)=>Ke("sum",a,o,s))},e.min=function(n,r){return t(n,r,(a,o,s)=>Ke("min",a,o,s))},e.max=function(n,r){return t(n,r,(a,o,s)=>Ke("max",a,o,s))},e.distinct=function(n,r){return t(n,r,(a,o,s)=>Ke("distinct",a,o,s))},e.count=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,1,1,n,r),k(s[0])||F(s[0]))return s[0].length;if(M(s[0]))return s[0].length();throw new d(n,c.InvalidParameter,r)})}}let Kn=class extends B{constructor(t){super(),this.declaredClass="esri.arcade.Portal",this.immutable=!1,this.setField("url",t),this.immutable=!0}},Ls=class ea extends B{constructor(t,n,r,a,o,s,i){super(),this.attachmentUrl=o,this.declaredClass="esri.arcade.Attachment",this.immutable=!1,this.setField("id",t),this.setField("name",n),this.setField("contenttype",r),this.setField("size",a),this.setField("exifinfo",s),this.setField("keywords",i),this.immutable=!0}deepClone(){var t;return new ea(this.field("id"),this.field("name"),this.field("contenttype"),this.field("size"),this.attachmentUrl,((t=this.field("exifinfo"))==null?void 0:t.deepClone())??null,this.field("keywords"))}};const yr=e=>(t,n,r)=>(r=r||14,+e(t,n).toFixed(r)),Ps=(e,t)=>e+t,Os=(e,t)=>e*t,Us=(e,t)=>e/t,Gr=(e,t,n)=>yr(Ps)(e,t,n),wt=(e,t,n)=>yr(Os)(e,t,n),cn=(e,t,n)=>yr(Us)(e,t,n),fn=360,zs=400,Zs=2*Math.PI,$e=3600,jr=3240,zt=60,Qe=60,Jr=180*$e/Math.PI,Lt=fn*zt*Qe,kn=90*$e,dt=180*$e,Gs=270*$e,ta="ᵍ",Pt="°";function Nt(e){if(F(e)===!1)throw new d(null,c.InvalidParameter,null);return e}function Wn(e,t){const n=10**t;return Math.round(e*n)/n}function js(e,t){return e%t}function ht(e){const t=parseFloat(e.toString().replace(Math.trunc(e).toString(),"0"))*Math.sign(e);return e<0?{fraction:t,integer:Math.ceil(e)}:{fraction:t,integer:Math.floor(e)}}var Y,w,K,Yn;function yt(e,t){switch(e){case Y.north:return t==="SHORT"?"N":"North";case Y.east:return t==="SHORT"?"E":"East";case Y.south:return t==="SHORT"?"S":"South";case Y.west:return t==="SHORT"?"W":"West"}}function Tn(e,t){return e-Math.floor(e/t)*t}function Bn(e){switch(e){case w.truncated_degrees:case w.decimal_degrees:return fn;case w.radians:return Zs;case w.gradians:return zs;case w.seconds:return Lt;case w.fractional_degree_minutes:return zt;case w.fractional_minute_seconds:return Qe;default:throw new d(null,c.LogicError,null,{reason:"unsupported evaluations"})}}function Vr(e){switch(e.toUpperCase().trim()){case"NORTH":case"NORTHAZIMUTH":case"NORTH AZIMUTH":return K.north_azimuth;case"POLAR":return K.polar;case"QUADRANT":return K.quadrant;case"SOUTH":case"SOUTHAZIMUTH":case"SOUTH AZIMUTH":return K.south_azimuth}throw new d(null,c.LogicError,null,{reason:"unsupported directionType"})}function qr(e){switch(e.toUpperCase().trim()){case"D":case"DD":case"DECIMALDEGREE":case"DECIMAL DEGREE":case"DEGREE":case"DECIMALDEGREES":case"DECIMAL DEGREES":case"DEGREES":return w.decimal_degrees;case"DMS":case"DEGREESMINUTESSECONDS":case"DEGREES MINUTES SECONDS":return w.degrees_minutes_seconds;case"R":case"RAD":case"RADS":case"RADIAN":case"RADIANS":return w.radians;case"G":case"GON":case"GONS":case"GRAD":case"GRADS":case"GRADIAN":case"GRADIANS":return w.gradians}throw new d(null,c.LogicError,null,{reason:"unsupported units"})}(function(e){e[e.north=0]="north",e[e.east=1]="east",e[e.south=2]="south",e[e.west=3]="west"})(Y||(Y={})),function(e){e[e.decimal_degrees=1]="decimal_degrees",e[e.seconds=2]="seconds",e[e.degrees_minutes_seconds=3]="degrees_minutes_seconds",e[e.radians=4]="radians",e[e.gradians=5]="gradians",e[e.truncated_degrees=6]="truncated_degrees",e[e.fractional_degree_minutes=7]="fractional_degree_minutes",e[e.fractional_minute_seconds=8]="fractional_minute_seconds"}(w||(w={})),function(e){e[e.north_azimuth=1]="north_azimuth",e[e.polar=2]="polar",e[e.quadrant=3]="quadrant",e[e.south_azimuth=4]="south_azimuth"}(K||(K={})),function(e){e[e.meridian=0]="meridian",e[e.direction=1]="direction"}(Yn||(Yn={}));let Et=class sn{constructor(t,n,r){this.m_degrees=t,this.m_minutes=n,this.m_seconds=r}getField(t){switch(t){case w.decimal_degrees:case w.truncated_degrees:return this.m_degrees;case w.fractional_degree_minutes:return this.m_minutes;case w.seconds:case w.fractional_minute_seconds:return this.m_seconds;default:throw new d(null,c.LogicError,null,{reason:"unexpected evaluation"})}}static secondsToDMS(t){const n=ht(t).fraction;let r=ht(t).integer;const a=Math.floor(r/$e);r-=a*$e;const o=Math.floor(r/Qe);return r-=o*Qe,new sn(a,o,r+n)}static numberToDms(t){const n=ht(t).fraction,r=ht(t).integer,a=wt(ht(100*n).fraction,100),o=ht(100*n).integer;return new sn(r,o,a)}format(t,n){let r=Wn(this.m_seconds,n),a=this.m_minutes,o=this.m_degrees;if(t===w.seconds||t===w.fractional_minute_seconds)Qe<=r&&(r-=Qe,++a),zt<=a&&(a=0,++o),fn<=o&&(o=0);else if(t===w.fractional_degree_minutes)r=0,a=30<=this.m_seconds?this.m_minutes+1:this.m_minutes,o=this.m_degrees,zt<=a&&(a=0,++o),fn<=o&&(o=0);else if(t===w.decimal_degrees||t===w.truncated_degrees){const s=cn(this.m_seconds,$e),i=cn(this.m_minutes,zt);o=Math.round(this.m_degrees+i+s),a=0,r=0}return new sn(o,a,r)}static dmsToSeconds(t,n,r){return t*$e+n*Qe+r}},Js=class{constructor(t,n,r){this.meridian=t,this.angle=n,this.direction=r}fetchAzimuth(t){return t===Yn.meridian?this.meridian:this.direction}},Ye=class Ge{constructor(t){this._angle=t}static createFromAngleAndDirection(t,n){return new Ge(new Le(Ge._convertDirectionFormat(t.extractAngularUnits(w.seconds),n,K.north_azimuth)))}getAngle(t){const n=this._angle.extractAngularUnits(w.seconds);switch(t){case K.north_azimuth:case K.south_azimuth:case K.polar:return new Le(Ge._convertDirectionFormat(n,K.north_azimuth,t));case K.quadrant:{const r=Ge.secondsNorthAzimuthToQuadrant(n);return new Le(r.angle)}}}getMeridian(t){const n=this._angle.extractAngularUnits(w.seconds);switch(t){case K.north_azimuth:return Y.north;case K.south_azimuth:return Y.south;case K.polar:return Y.east;case K.quadrant:return Ge.secondsNorthAzimuthToQuadrant(n).meridian}}getDirection(t){const n=this._angle.extractAngularUnits(w.seconds);switch(t){case K.north_azimuth:return Y.east;case K.south_azimuth:return Y.west;case K.polar:return Y.north;case K.quadrant:return Ge.secondsNorthAzimuthToQuadrant(n).direction}}static secondsNorthAzimuthToQuadrant(t){const n=t<=kn||t>=Gs?Y.north:Y.south,r=n===Y.north?Math.min(Lt-t,t):Math.abs(t-dt),a=t>dt?Y.west:Y.east;return new Js(n,r,a)}static createFromAngleMeridianAndDirection(t,n,r){return new Ge(new Le(Ge.secondsQuadrantToNorthAzimuth(t.extractAngularUnits(w.seconds),n,r)))}static secondsQuadrantToNorthAzimuth(t,n,r){return n===Y.north?r===Y.east?t:Lt-t:r===Y.east?dt-t:dt+t}static _convertDirectionFormat(t,n,r){let a=0;switch(n){case K.north_azimuth:a=t;break;case K.polar:a=kn-t;break;case K.quadrant:throw new d(null,c.LogicError,null,{reason:"unexpected evaluation"});case K.south_azimuth:a=t+dt}let o=0;switch(r){case K.north_azimuth:o=a;break;case K.polar:o=kn-a;break;case K.quadrant:throw new d(null,c.LogicError,null,{reason:"unexpected evaluation"});case K.south_azimuth:o=a-dt}return o=js(o,Lt),o<0?Lt+o:o}};function Hr(e,t,n){let r=null;switch(t){case w.decimal_degrees:r=wt(e,$e);break;case w.seconds:r=e;break;case w.gradians:r=wt(e,jr);break;case w.radians:r=wt(e,Jr);break;default:throw new d(null,c.LogicError,null,{reason:"unexpected evaluation"})}switch(n){case w.decimal_degrees:return cn(r,$e);case w.seconds:return r;case w.gradians:return cn(r,jr);case w.radians:return r/Jr;default:throw new d(null,c.LogicError,null,{reason:"unexpected evaluation"})}}let Le=class Xn{constructor(t){this._seconds=t}static createFromAngleAndUnits(t,n){return new Xn(Hr(t,n,w.seconds))}extractAngularUnits(t){return Hr(this._seconds,w.seconds,Jt(t))}static createFromDegreesMinutesSeconds(t,n,r){return new Xn(Gr(Gr(wt(t,$e),wt(n,Qe)),r))}};function Jt(e){switch(mi(e),e){case w.decimal_degrees:case w.truncated_degrees:case w.degrees_minutes_seconds:return w.decimal_degrees;case w.gradians:return w.gradians;case w.fractional_degree_minutes:return w.fractional_degree_minutes;case w.radians:return w.radians;case w.seconds:case w.fractional_minute_seconds:return w.seconds}}let Vs=class na{constructor(t,n,r,a){this.view=t,this.angle=n,this.merdian=r,this.direction=a,this._dms=null,this._formattedDms=null}static createFromStringAndBearing(t,n,r){return new na(t,n.getAngle(r),n.getMeridian(r),n.getDirection(r))}fetchAngle(){return this.angle}fetchMeridian(){return this.merdian}fetchDirection(){return this.direction}fetchView(){return this.view}fetchDms(){return this._dms===null&&this._calculateDms(),this._dms}fetchFormattedDms(){return this._formattedDms===null&&this._calculateDms(),this._formattedDms}_calculateDms(){let t=null,n=w.truncated_degrees,r=0;for(let a=0;a0?1:0),"0");case w.truncated_degrees:case w.fractional_degree_minutes:return o=Tn(a.fetchFormattedDms().getField(t),Bn(t)),o.toFixed(r).padStart(n+r+(r>0?1:0),"0");case w.fractional_minute_seconds:return o=Tn(Wn(a.fetchDms().getField(t),r),Bn(t)),o.toFixed(r).padStart(n+r+(r>0?1:0),"0");default:throw new d(null,c.LogicError,null,{reason:"unexpected evaluation"})}}function Hs(e,t,n){if(n===K.quadrant)throw new d(null,c.LogicError,null,{reason:"conversion error"});if(t===w.degrees_minutes_seconds){const r=Et.numberToDms(e);return Ye.createFromAngleAndDirection(Le.createFromDegreesMinutesSeconds(r.m_degrees,r.m_minutes,r.m_seconds),n)}return Ye.createFromAngleAndDirection(Le.createFromAngleAndUnits(e,Jt(t)),n)}function Ks(e){switch(p(e)){case 1:return{first:Y.north,second:Y.east};case 2:return{first:Y.south,second:Y.east};case 3:return{first:Y.south,second:Y.west};case 4:return{first:Y.north,second:Y.west}}return null}function Kr(e){switch(e.toUpperCase().trim()){case"N":case"NORTH":return Y.north;case"E":case"EAST":return Y.east;case"S":case"SOUTH":return Y.south;case"W":case"WEST":return Y.west}return null}function pt(e){const t=parseFloat(e);if(L(t)){if(isNaN(t))throw new d(null,c.LogicError,null,{reason:"invalid conversion"});return t}throw new d(null,c.LogicError,null,{reason:"invalid conversion"})}function $n(e,t,n){const r=n===K.quadrant;let a=null,o=null,s=0,i=0,u=0;if(r){if(e.length<2)throw new d(null,c.LogicError,null,{reason:"conversion error"});u=1;const l=Ks(A(e[e.length-1]));if(l?(a=l.first,o=l.second):(s=1,a=Kr(A(e[0])),o=Kr(A(e[e.length-1]))),a===null||o===null)throw new d(null,c.LogicError,null,{reason:"invalid conversion"})}switch(t){case w.decimal_degrees:case w.radians:case w.gradians:if(e.length===0)throw new d(null,c.LogicError,null,{reason:"invalid conversion"});return r?Ye.createFromAngleMeridianAndDirection(Le.createFromAngleAndUnits(pt(e[s]),Jt(t)),a,o):Ye.createFromAngleAndDirection(Le.createFromAngleAndUnits(pt(e[s]),Jt(t)),n);case w.degrees_minutes_seconds:if(i=e.length-u-s,i===3){const l=Le.createFromDegreesMinutesSeconds(pt(e[s]),pt(e[s+1]),pt(e[s+2]));return r?Ye.createFromAngleMeridianAndDirection(l,a,o):Ye.createFromAngleAndDirection(l,n)}if(i===1){const l=pt(e[s]),h=Et.numberToDms(l),f=Le.createFromDegreesMinutesSeconds(h.m_degrees,h.m_minutes,h.m_seconds);return r?Ye.createFromAngleMeridianAndDirection(f,a,o):Ye.createFromAngleAndDirection(f,n)}}throw new d(null,c.LogicError,null,{reason:"invalid conversion"})}function Ws(e){const t=new Set([" ","-","/","'",'"',"\\","^",Pt,ta," ","\r",` +import{aF as ar,eu as Xe,aA as J,a_ as _a,hj as st,aE as we,aB as ie,aC as te,aD as Ie,et as $,cd as sr,b0 as le,kH as di,eD as hi,aS as St,bE as Ra,cN as pi,ly as Sr,bo as It,ah as mi,ax as or,lz as La,_ as je,M as Pa,E as Di,aV as Oa}from"./index-BjUNJPVf.js";import{m as U,a as De,n as ge,h as _t,c as Be,r as Xt,b as se}from"./TimeOnly-BXSODLxA.js";import{t as ce}from"./ImmutableArray-BlMso3qf.js";import{s as Ua,p as gi}from"./number-CJqenc9O.js";import{r as za}from"./featureConversionUtils-BHhm7bvm.js";import{Z as Za}from"./FieldsIndex-CK-0B5n9.js";let qt=class{constructor(t){this.source=t}},mn=class{constructor(t,n){this._moduleSingletons=t,this._syntaxModules=n}loadLibrary(t){if(this._syntaxModules==null)return null;const n=this._syntaxModules[t.toLowerCase()];return n?{syntax:n.script,uri:n.uri}:null}};var c;(function(e){e.AsyncNotEnabled="AsyncNotEnabled",e.ModulesNotSupported="ModulesNotSupported",e.CircularModules="CircularModules",e.CannotCompareDateAndTime="CannotCompareDateAndTime",e.NeverReach="NeverReach",e.UnsupportedHashType="UnsupportedHashType",e.InvalidParameter="InvalidParameter",e.FeatureSetDoesNotHaveSubtypes="FeatureSetDoesNotHaveSubtypes",e.UnexpectedToken="UnexpectedToken",e.Unrecognized="Unrecognized",e.UnrecognizedType="UnrecognizedType",e.MaximumCallDepth="MaximumCallDepth",e.BooleanConditionRequired="BooleanConditionRequired",e.TypeNotAllowedInFeature="TypeNotAllowedInFeature",e.KeyMustBeString="KeyMustBeString",e.WrongNumberOfParameters="WrongNumberOfParameters",e.CallNonFunction="CallNonFunction",e.NoFunctionInTemplateLiteral="NoFunctionInTemplateLiteral",e.NoFunctionInDictionary="NoFunctionInDictionary",e.NoFunctionInArray="NoFunctionInArray",e.AssignModuleFunction="AssignModuleFunction",e.LogicExpressionOrAnd="LogicExpressionOrAnd",e.LogicalExpressionOnlyBoolean="LogicalExpressionOnlyBoolean",e.FunctionNotFound="FunctionNotFound",e.InvalidMemberAccessKey="InvalidMemberAccessKey",e.UnsupportedUnaryOperator="UnsupportUnaryOperator",e.InvalidIdentifier="InvalidIdentifier",e.MemberOfNull="MemberOfNull",e.UnsupportedOperator="UnsupportedOperator",e.Cancelled="Cancelled",e.ModuleAccessorMustBeString="ModuleAccessorMustBeString",e.ModuleExportNotFound="ModuleExportNotFound",e.Immutable="Immutable",e.OutOfBounds="OutOfBounds",e.IllegalResult="IllegalResult",e.FieldNotFound="FieldNotFound",e.PortalRequired="PortalRequired",e.LogicError="LogicError",e.ArrayAccessorMustBeNumber="ArrayAccessMustBeNumber",e.KeyAccessorMustBeString="KeyAccessorMustBeString",e.WrongSpatialReference="WrongSpatialReference",e.CannotChangeTimeZoneTime="CannotChangeTimeZoneTime",e.CannotChangeTimeZoneDateOnly="CannotChangeTimeZoneDateOnly"})(c||(c={}));const yi={[c.TypeNotAllowedInFeature]:"Feature attributes only support dates, numbers, strings, guids.",[c.LogicError]:"Logic error - {reason}",[c.CannotCompareDateAndTime]:"Cannot compare date or dateonly with timeonly types",[c.NeverReach]:"Encountered unreachable logic",[c.AsyncNotEnabled]:"Async Arcade must be enabled for this script",[c.ModuleAccessorMustBeString]:"Module accessor must be a string",[c.ModuleExportNotFound]:"Module has no export with provided identifier",[c.ModulesNotSupported]:"Current profile does not support modules",[c.ArrayAccessorMustBeNumber]:"Array accessor must be a number",[c.FunctionNotFound]:"Function not found",[c.FieldNotFound]:"Key not found - {key}",[c.CircularModules]:"Circular module dependencies are not allowed",[c.Cancelled]:"Execution cancelled",[c.UnsupportedHashType]:"Type not supported in hash function",[c.IllegalResult]:"Value is not a supported return type",[c.PortalRequired]:"Portal is required",[c.InvalidParameter]:"Invalid parameter",[c.WrongNumberOfParameters]:"Call with wrong number of parameters",[c.Unrecognized]:"Unrecognized code structure",[c.UnrecognizedType]:"Unrecognized type",[c.WrongSpatialReference]:"Cannot work with geometry in this spatial reference. It is different to the execution spatial reference",[c.BooleanConditionRequired]:"Conditions must use booleans",[c.NoFunctionInDictionary]:"Dictionaries cannot contain functions.",[c.NoFunctionInArray]:"Arrays cannot contain functions.",[c.NoFunctionInTemplateLiteral]:"Template Literals do not expect functions by value.",[c.KeyAccessorMustBeString]:"Accessor must be a string",[c.KeyMustBeString]:"Object keys must be a string",[c.Immutable]:"Object is immutable",[c.UnexpectedToken]:"Unexpected token",[c.MemberOfNull]:"Cannot access property of null object",[c.MaximumCallDepth]:"Exceeded maximum function depth",[c.OutOfBounds]:"Out of bounds",[c.InvalidIdentifier]:"Identifier not recognized",[c.CallNonFunction]:"Expression is not a function",[c.InvalidMemberAccessKey]:"Cannot access value using a key of this type",[c.AssignModuleFunction]:"Cannot assign function to module variable",[c.UnsupportedUnaryOperator]:"Unsupported unary operator",[c.UnsupportedOperator]:"Unsupported operator",[c.LogicalExpressionOnlyBoolean]:"Logical expressions must be boolean",[c.LogicExpressionOrAnd]:"Logical expression can only be combined with || or &&",[c.CannotChangeTimeZoneTime]:"Cannot change the timezone of a Time",[c.CannotChangeTimeZoneDateOnly]:"Cannot change the timezone of a DateOnly",[c.FeatureSetDoesNotHaveSubtypes]:"FeatureSet does not have subtypes"};let Ga=class extends Error{constructor(...t){super(...t)}},Ir=class wi extends Ga{constructor(t,n){super(ur(n)+t.message,{cause:t}),this.loc=null,Error.captureStackTrace&&Error.captureStackTrace(this,wi),n!=null&&n.loc&&(this.loc=n.loc)}},d=class xi extends Error{constructor(t,n,r,a){super("Execution error - "+ur(r)+ar(yi[n],a)),this.loc=null,this.declaredRootClass="esri.arcade.arcadeexecutionerror",Error.captureStackTrace&&Error.captureStackTrace(this,xi),r!=null&&r.loc&&(this.loc=r.loc)}};function ur(e){var t,n;return e&&e.loc?`Line : ${(t=e.loc.start)==null?void 0:t.line}, ${(n=e.loc.start)==null?void 0:n.column}: `:""}let fe=class Fi extends Error{constructor(t,n,r,a){super("Compilation error - "+ur(r)+ar(yi[n],a)),this.loc=null,this.declaredRootClass="esri.arcade.arcadecompilationerror",Error.captureStackTrace&&Error.captureStackTrace(this,Fi),r!=null&&r.loc&&(this.loc=r.loc)}},Qt=class Ci extends Error{constructor(){super("Uncompilable code structures"),this.declaredRootClass="esri.arcade.arcadeuncompilableerror",Error.captureStackTrace&&Error.captureStackTrace(this,Ci)}};function ja(e,t,n){return n.declaredRootClass==="esri.arcade.arcadeexecutionerror"||n.declaredRootClass==="esri.arcade.arcadecompilationerror"?n.loc===null&&(t!=null&&t.loc)?new Ir(n,{cause:n}):n:(n.declaredRootClass==="esri.arcade.featureset.support.featureseterror"||n.declaredRootClass==="esri.arcade.featureset.support.sqlerror"||n.declaredRootClass,t!=null&&t.loc?new Ir(n,{cause:n}):n)}var ot;(function(e){e.UnrecognizedUri="UnrecognizedUri",e.UnsupportedUriProtocol="UnsupportedUriProtocol"})(ot||(ot={}));const Ja={[ot.UnrecognizedUri]:"Unrecognized uri - {uri}",[ot.UnsupportedUriProtocol]:"Unrecognized uri protocol"};let bn=class Ai extends Error{constructor(t,n){super(ar(Ja[t],n)),this.declaredRootClass="esri.arcade.arcademoduleerror",Error.captureStackTrace&&Error.captureStackTrace(this,Ai)}},ut=class{constructor(){}};function xt(e,t,n){if(e instanceof ut&&!(e instanceof qe)){const r=new qe;return r.fn=e,r.parameterEvaluator=n,r.context=t,r}return e}let lt=class extends ut{constructor(t){super(),this.fn=t}createFunction(t){return(...n)=>this.fn(t,{preparsed:!0,arguments:n})}call(t,n){return this.fn(t,n)}marshalledCall(t,n,r,a){return a(t,n,(o,s,i)=>{i=i.map(l=>l instanceof ut&&!(l instanceof qe)?xt(l,t,a):l);const u=this.call(r,{args:i});return Xe(u)?u.then(l=>xt(l,r,a)):u})}},qe=class extends ut{constructor(){super(...arguments),this.fn=null,this.context=null}createFunction(t){return this.fn.createFunction(this.context)}call(t,n){return this.fn.marshalledCall(t,n,this.context,this.parameterEvaluator)}marshalledCall(t,n,r){return this.fn.marshalledCall(t,n,this.context,this.parameterEvaluator)}},ft=class Ei extends ce{constructor(t,n,r,a,o,s){super(t),this._lazyPt=[],this._hasZ=!1,this._hasM=!1,this._spRef=n,this._hasZ=r,this._hasM=a,this._cacheId=o,this._partId=s}get(t){if(this._lazyPt[t]===void 0){const n=this._elements[t];if(n===void 0)return;const r=this._hasZ,a=this._hasM;let o=null;o=r&&!a?new J(n[0],n[1],n[2],void 0,this._spRef):a&&!r?new J(n[0],n[1],void 0,n[2],this._spRef):r&&a?new J(n[0],n[1],n[2],n[3],this._spRef):new J(n[0],n[1],this._spRef),o.cache._arcadeCacheId=this._cacheId.toString()+"-"+this._partId.toString()+"-"+t.toString(),this._lazyPt[t]=o}return this._lazyPt[t]}equalityTest(t){return t===this||t!==null&&t instanceof Ei&&t.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()+"-"+this._partId.toString()}},Un=class bi extends ce{constructor(t,n,r,a,o){super(t),this._lazyPath=[],this._hasZ=!1,this._hasM=!1,this._hasZ=r,this._hasM=a,this._spRef=n,this._cacheId=o}get(t){if(this._lazyPath[t]===void 0){const n=this._elements[t];if(n===void 0)return;this._lazyPath[t]=new ft(n,this._spRef,this._hasZ,this._hasM,this._cacheId,t)}return this._lazyPath[t]}equalityTest(t){return t===this||t!==null&&t instanceof bi&&t.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()}};var kr,Tr;function Cl(e){return _a.fromJSON(e.toJSON())}function Va(e){return e.toJSON?e.toJSON():e}function Al(e){return typeof e=="string"||e instanceof String}function El(e){return typeof e=="number"}function Br(e){return e instanceof Date}function bl(e){return e instanceof st}function $r(e){return e instanceof U}function vl(e){return e instanceof De}function Sl(e){return e instanceof ge}function Il(e,t){return e===t||!(!Br(e)&&!$r(e)||!Br(t)&&!$r(t))&&e.getTime()===t.getTime()}function kl(e){if(e==null)return null;if(typeof e=="number")return e;switch(e.toLowerCase()){case"meters":case"meter":return 109404;case"miles":case"mile":return 109439;case"kilometers":case"kilometer":case"km":return 109414}return null}function Tl(e){if(e==null)return null;switch(e.type){case"polygon":case"multipoint":case"polyline":return e.extent;case"point":return new we({xmin:e.x,ymin:e.y,xmax:e.x,ymax:e.y,spatialReference:e.spatialReference});case"extent":return e}return null}function Bl(e){if(e==null)return null;if(typeof e=="number"||typeof e=="number")return e;switch(e.toLowerCase()){case"meters":case"meter":return 9001;case"miles":case"mile":return 9093;case"kilometers":case"kilometer":case"km":return 9036}return null}(function(e){e[e.Standardised=0]="Standardised",e[e.StandardisedNoInterval=1]="StandardisedNoInterval",e[e.SqlServer=2]="SqlServer",e[e.Oracle=3]="Oracle",e[e.Postgres=4]="Postgres",e[e.PGDB=5]="PGDB",e[e.FILEGDB=6]="FILEGDB",e[e.NotEvaluated=7]="NotEvaluated"})(kr||(kr={})),function(e){e[e.InFeatureSet=0]="InFeatureSet",e[e.NotInFeatureSet=1]="NotInFeatureSet",e[e.Unknown=2]="Unknown"}(Tr||(Tr={}));const $l=1e3,Ml={point:"point",polygon:"polygon",polyline:"polyline",multipoint:"multipoint",extent:"extent",esriGeometryPoint:"point",esriGeometryPolygon:"polygon",esriGeometryPolyline:"polyline",esriGeometryMultipoint:"multipoint",esriGeometryEnvelope:"extent",envelope:"extent"},Mr={point:"esriGeometryPoint",polygon:"esriGeometryPolygon",polyline:"esriGeometryPolyline",multipoint:"esriGeometryMultipoint",extent:"esriGeometryEnvelope",esriGeometryPoint:"esriGeometryPoint",esriGeometryPolygon:"esriGeometryPolygon",esriGeometryPolyline:"esriGeometryPolyline",esriGeometryMultipoint:"esriGeometryMultipoint",esriGeometryEnvelope:"esriGeometryEnvelope",envelope:"esriGeometryEnvelope"},Nr={"small-integer":"esriFieldTypeSmallInteger",integer:"esriFieldTypeInteger",long:"esriFieldTypeLong",single:"esriFieldTypeSingle",double:"esriFieldTypeDouble",string:"esriFieldTypeString",date:"esriFieldTypeDate","date-only":"esriFieldTypeDateOnly","time-only":"esriFieldTypeTimeOnly","timestamp-offset":"esriFieldTypeTimestampOffset",oid:"esriFieldTypeOID",geometry:"esriFieldTypeGeometry",blob:"esriFieldTypeBlob",raster:"esriFieldTypeRaster",guid:"esriFieldTypeGUID","global-id":"esriFieldTypeGlobalID",xml:"esriFieldTypeXML","big-integer":"esriFieldTypeBigInteger",esriFieldTypeSmallInteger:"esriFieldTypeSmallInteger",esriFieldTypeInteger:"esriFieldTypeInteger",esriFieldTypeLong:"esriFieldTypeLong",esriFieldTypeSingle:"esriFieldTypeSingle",esriFieldTypeDouble:"esriFieldTypeDouble",esriFieldTypeString:"esriFieldTypeString",esriFieldTypeDate:"esriFieldTypeDate",esriFieldTypeDateOnly:"esriFieldTypeDateOnly",esriFieldTypeTimeOnly:"esriFieldTypeTimeOnly",esriFieldTypeTimestampOffset:"esriFieldTypeTimestampOffset",esriFieldTypeOID:"esriFieldTypeOID",esriFieldTypeGeometry:"esriFieldTypeGeometry",esriFieldTypeBlob:"esriFieldTypeBlob",esriFieldTypeRaster:"esriFieldTypeRaster",esriFieldTypeGUID:"esriFieldTypeGUID",esriFieldTypeGlobalID:"esriFieldTypeGlobalID",esriFieldTypeXML:"esriFieldTypeXML",esriFieldTypeBigInteger:"esriFieldTypeBigInteger"};function Nl(e){return e===void 0?"":e=(e=(e=e.replace(/\/featureserver\/[0-9]*/i,"/FeatureServer")).replace(/\/mapserver\/[0-9]*/i,"/MapServer")).split("?")[0]}function _l(e,t){t||(t={}),typeof t=="function"&&(t={cmp:t});const n=typeof t.cycles=="boolean"&&t.cycles,r=t.cmp&&(a=t.cmp,function(s){return function(i,u){const l={key:i,value:s[i]},h={key:u,value:s[u]};return a(l,h)}});var a;const o=[];return function s(i){if(i!=null&&i.toJSON&&typeof i.toJSON=="function"&&(i=i.toJSON()),i===void 0)return;if(typeof i=="number")return isFinite(i)?""+i:"null";if(typeof i!="object")return JSON.stringify(i);let u,l;if(Array.isArray(i)){for(l="[",u=0;un)throw new d(r,c.WrongNumberOfParameters,a)}function Zn(e){return e<0?-Math.round(-e):Math.round(e)}function gt(){let e=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replaceAll(/[xy]/g,t=>{const n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),(t==="x"?n:3&n|8).toString(16)})}function hr(e,t){return isNaN(e)||t==null||t===""?e.toString():(t=tt(t,"‰",""),t=tt(t,"¤",""),Ua(e,{pattern:t}))}function gn(e,t){return t==null||t===""?e.toISOString(!0):e.toFormat(pr(t),{locale:sr(),numberingSystem:"latn"})}function pr(e,t=!1){e=e.replaceAll(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let n="";const r=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|Z{1,5}|.)/g;for(const a of e.match(r)||[])switch(a){case"D":n+="d";break;case"DD":n+="dd";break;case"DDD":n+="o";break;case"d":n+="c";break;case"ddd":n+="ccc";break;case"dddd":n+="cccc";break;case"M":n+="L";break;case"MM":n+="LL";break;case"MMM":n+="LLL";break;case"MMMM":n+="LLLL";break;case"YY":n+="yy";break;case"Y":case"YYYY":n+="yyyy";break;case"Q":n+="q";break;case"Z":n+="Z";break;case"ZZ":n+="ZZ";break;case"ZZZ":n+="ZZZ";break;case"ZZZZ":n+=t?"[ZZZZ]":"ZZZZ";break;case"ZZZZZ":n+=t?"[ZZZZZ]":"ZZZZZ";break;case"S":n+="'S'";break;case"SS":n+="'SS'";break;case"SSS":n+="u";break;case"A":case"a":n+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":case"X":case"x":n+=a;break;default:a.length>=2&&a.slice(0,1)==="["&&a.slice(-1)==="]"?n+=`'${a.slice(1,-1)}'`:n+=`'${a}'`}return n}function _(e,t,n){switch(n){case">":return e>t;case"<":return e=":return e>=t;case"<=":return e<=t}return!1}function mr(e,t,n){if(e===null){if(t===null||t===b)return _(null,null,n);if(L(t))return _(0,t,n);if(F(t)||V(t))return _(0,p(t),n);if(H(t))return _(0,t.toNumber(),n);if(j(t)||P(t))return _(e,t.toNumber(),n)}if(e===b){if(t===null||t===b)return _(null,null,n);if(L(t))return _(0,t,n);if(F(t)||V(t))return _(0,p(t),n);if(H(t))return _(0,t.toNumber(),n);if(j(t)||P(t))return _(e,t.toNumber(),n)}else if(L(e)){if(L(t))return _(e,t,n);if(V(t))return _(e,p(t),n);if(t===null||t===b)return _(e,0,n);if(F(t))return _(e,p(t),n);if(H(t)||j(t)||P(t))return _(e,t.toNumber(),n)}else if(F(e)){if(F(t))return _(A(e),A(t),n);if(H(t)||j(t)||P(t))return _(p(e),t.toNumber(),n);if(L(t))return _(p(e),t,n);if(t===null||t===b)return _(p(e),0,n);if(V(t))return _(p(e),p(t),n)}else if(H(e)){if(H(t))return e.timeZone!==t.timeZone&&(e.isUnknownTimeZone?e=U.arcadeDateAndZoneToArcadeDate(e,t.timeZone):t.isUnknownTimeZone&&(t=U.arcadeDateAndZoneToArcadeDate(t,e.timeZone))),_(e.toNumber(),t.toNumber(),n);if(t===null||t===b)return _(e.toNumber(),0,n);if(L(t))return _(e.toNumber(),t,n);if(V(t)||F(t))return _(e.toNumber(),p(t),n);if(j(t))throw new d(null,c.CannotCompareDateAndTime,null);if(P(t))return _(e.toNumber(),t.toNumber(),n)}else if(V(e)){if(V(t))return _(e,t,n);if(L(t))return _(p(e),p(t),n);if(H(t)||j(t)||P(t))return _(p(e),t.toNumber(),n);if(t===null||t===b)return _(p(e),0,n);if(F(t))return _(p(e),p(t),n)}else if(P(e)){if(H(t))return _(e.toNumber(),t.toNumber(),n);if(t===null||t===b)return _(e.toNumber(),0,n);if(L(t))return _(e.toNumber(),t,n);if(V(t)||F(t))return _(e.toNumber(),p(t),n);if(j(t))throw new d(null,c.CannotCompareDateAndTime,null);if(P(t))return _(e.toNumber(),t.toNumber(),n)}else if(j(e)){if(H(t))throw new d(null,c.CannotCompareDateAndTime,null);if(t===null||t===b)return _(e.toNumber(),0,n);if(L(t))return _(e.toNumber(),t,n);if(V(t)||F(t))return _(e.toNumber(),p(t),n);if(j(t))return _(e.toNumber(),t.toNumber(),n);if(P(t))throw new d(null,c.CannotCompareDateAndTime,null)}return!!ke(e,t)&&(n==="<="||n===">=")}function ke(e,t){if(e===t||e===null&&t===b||t===null&&e===b)return!0;if(H(e)&&H(t)||j(e)&&j(t)||P(e)&&P(t))return e.equals(t);if(e instanceof Un||e instanceof ft)return e.equalityTest(t);if(e instanceof J&&t instanceof J){const n=e.cache._arcadeCacheId,r=t.cache._arcadeCacheId;if(n!=null)return n===r}return!!(zn(e)&&zn(t)&&(e._arcadeCacheId===t._arcadeCacheId&&e._arcadeCacheId!==void 0&&e._arcadeCacheId!==null||e._underlyingGraphic===t._underlyingGraphic&&e._underlyingGraphic!==void 0&&e._underlyingGraphic!==null))}function A(e,t){if(F(e))return e;if(e===null)return"";if(L(e))return hr(e,t);if(V(e))return e.toString();if(H(e))return gn(e,t);if(j(e)||P(e))return e.toFormat(t);if(e instanceof $)return JSON.stringify(e.toJSON());if(k(e)){const n=[];for(let r=0;rr.key===a.key?0:r.key==="spatialReference"?1:a.key==="spatialReference"||r.keya.key?1:0);if(k(e)){const r=[];for(let a=0;a0)return e;return null}if(e instanceof te){if(e.paths.length===0)return null;for(const t of e.paths)if(t.length>0)return e;return null}return e instanceof Ie?e.points.length===0?null:e:e instanceof we?e.xmin==="NaN"||e.xmin===null||isNaN(e.xmin)?null:e:null}function Ii(e,t){if(!e||!e.domain)return t;let n=null,r=null;if(H(t))n=t.toNumber();else if(P(t))n=t.toString();else if(j(t))n=t.toStorageString();else if(e.field.type==="string"||e.field.type==="esriFieldTypeString")n=A(t);else{if(t==null)return null;if(t==="")return t;n=p(t)}for(let a=0;a{var f;return h[u]===r&&(a=(f=h.domains)==null?void 0:f[s.name],a&&a.type==="inherited"&&(a=_r(s.name,t),o=!0),!0)}),o||a||(a=_r(e,t)),{field:s,domain:a}}function _r(e,t){let n;return t.fields.some(r=>(r.name.toLowerCase()===e.toLowerCase()&&(n=r.domain),!!n)),n}function Gn(e,t){t||(t={}),typeof t=="function"&&(t={cmp:t});const n=typeof t.cycles=="boolean"&&t.cycles,r=t.cmp&&(a=t.cmp,function(s){return function(i,u){const l={key:i,value:s[i]},h={key:u,value:s[u]};return a(l,h)}});var a;const o=[];return function s(i){if(i!=null&&i.toJSON&&typeof i.toJSON=="function"&&(i=i.toJSON()),i===void 0)return;if(typeof i=="number")return isFinite(i)?""+i:"null";if(typeof i!="object")return JSON.stringify(i);let u,l;if(Array.isArray(i)){for(l="[",u=0;u0&&(o=e[0].spatialReference,n=e[0].hasZ,r=e[0].hasM)}else if(e instanceof ft)a=e._elements,a.length>0&&(n=e._hasZ,r=e._hasM,o=e.get(0).spatialReference);else{if(!M(e))throw new d(null,c.InvalidParameter,null);for(const s of e.toArray())At(a,s);a.length>0&&(o=e.get(0).spatialReference,n=e.get(0).hasZ===!0,r=e.get(0).hasM===!0)}return a.length===0?null:(di(a)||(a=a.slice(0).reverse()),new ie({rings:[a],spatialReference:o,hasZ:n,hasM:r}))}return e}function We(e,t){if(k(e)||M(e)){let n=!1,r=!1,a=[],o=t;if(k(e)){for(const s of e)At(a,s);a.length>0&&(o=e[0].spatialReference,n=e[0].hasZ===!0,r=e[0].hasM===!0)}else if(e instanceof ft)a=e._elements,a.length>0&&(n=e._hasZ,r=e._hasM,o=e.get(0).spatialReference);else if(M(e)){for(const s of e.toArray())At(a,s);a.length>0&&(o=e.get(0).spatialReference,n=e.get(0).hasZ===!0,r=e.get(0).hasM===!0)}return a.length===0?null:new te({paths:[a],spatialReference:o,hasZ:n,hasM:r})}return e}function nn(e,t){if(k(e)||M(e)){let n=!1,r=!1,a=[],o=t;if(k(e)){for(const s of e)At(a,s);a.length>0&&(o=e[0].spatialReference,n=e[0].hasZ===!0,r=e[0].hasM===!0)}else if(e instanceof ft)a=e._elements,a.length>0&&(n=e._hasZ,r=e._hasM,o=e.get(0).spatialReference);else if(M(e)){for(const s of e.toArray())At(a,s);a.length>0&&(o=e.get(0).spatialReference,n=e.get(0).hasZ===!0,r=e.get(0).hasM===!0)}return a.length===0?null:new Ie({points:a,spatialReference:o,hasZ:n,hasM:r})}return e}function Ka(e,t=!1){const n=[];if(e===null)return n;if(k(e)===!0){for(let r=0;r{setTimeout(()=>{t(e)},0)})):e}function Dr(e,t,n){switch(n){case"&":return e&t;case"|":return e|t;case"^":return e^t;case"<<":return e<>":return e>>t;case">>>":return e>>>t}}function nt(e,t=null){return e==null?null:V(e)||L(e)||F(e)?e:e instanceof $?(t==null?void 0:t.keepGeometryType)===!0?e:e.toJSON():e instanceof ce?e.toArray().map(n=>nt(n,t)):e instanceof Array?e.map(n=>nt(n,t)):on(e)?e:H(e)?e.toJSDate():j(e)?e.toString():P(e)?e.toJSDate():e!==null&&typeof e=="object"&&e.castAsJson!==void 0?e.castAsJson(t):null}async function Ya(e,t,n,r,a){const o=await gr(e,t,n);a[r]=o}async function gr(e,t=null,n=null){if(e instanceof ce&&(e=e.toArray()),e==null)return null;if(He(e)||e instanceof $||on(e)||H(e))return nt(e,n);if(e instanceof Array){const r=[],a=[];for(const o of e)o===null||He(o)||o instanceof $||on(o)||H(o)?a.push(nt(o,n)):(a.push(null),r.push(Ya(o,t,n,a.length-1,a)));return r.length>0&&await Promise.all(r),a}return e!==null&&typeof e=="object"&&e.castAsJsonAsync!==void 0?e.castAsJsonAsync(t,n):null}function Kt(e){return Ti(e)?e.parent:e}function Ti(e){return e&&"declaredClass"in e&&e.declaredClass==="esri.layers.support.SubtypeSublayer"}function Xa(e){return e&&"declaredClass"in e&&e.declaredClass==="esri.layers.SubtypeGroupLayer"}function Bi(e,t,n){const r=Kt(e.fullSchema());return r===null||!r.fields?null:yn(t,r,e,n)}function rn(e){const t=Kt(e.fullSchema());return t===null?null:t.fields?t.subtypeField?{subtypeField:t.subtypeField,subtypes:t.subtypes?t.subtypes.map(n=>({name:n.name,code:n.code})):[]}:t.typeIdField?{subtypeField:t.typeIdField,subtypes:t.types?t.types.map(n=>({name:n.name,code:n.id})):[]}:null:null}function $i(e,t,n,r){const a=Kt(e.fullSchema());if(a===null||!a.fields)return null;const o=yn(t,a,e,r);if(n===void 0)try{n=e.field(t)}catch{return null}return Ii(o,n)}function Mi(e,t,n,r){const a=Kt(e.fullSchema());if(a===null||!a.fields)return null;if(n===void 0){try{n=e.field(t)}catch{return null}return n}return ki(yn(t,a,e,r),n)}function N(e){return(e==null?void 0:e.timeZone)??"system"}function Ni(e){const t=Kt(e.fullSchema());if(t===null||!t.fields)return null;const n=[];for(const r of t.fields)n.push(Va(r));return{objectIdField:t.objectIdField,globalIdField:t.globalIdField??"",geometryType:Mr[t.geometryType]===void 0?"":Mr[t.geometryType],fields:n}}function _i(e,t){return e==="system"&&(e=U.systemTimeZoneCanonicalName),{version:Ri,engineVersion:hi,timeZone:e,spatialReference:t instanceof St?t.toJSON():t,application:Ra.applicationName??"",engine:"web",locale:sr()}}const Ri="1.24",Li=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResultE:Si,ReturnResultE:vi,absRound:Zn,arcadeVersion:Ri,autoCastArrayOfPointsToMultiPoint:nn,autoCastArrayOfPointsToPolygon:jn,autoCastArrayOfPointsToPolyline:We,autoCastFeatureToGeometry:G,binaryOperator:Dr,breakResult:Me,castAsJson:nt,castAsJsonAsync:gr,continueResult:kt,defaultExecutingContext:_i,defaultTimeZone:N,defaultUndefined:R,equalityTest:ke,featureDomainCodeLookup:Mi,featureDomainValueLookup:$i,featureFullDomain:Bi,featureSchema:Ni,featureSubtypes:rn,fixNullGeometry:it,fixSpatialReference:ne,formatDate:gn,formatNumber:hr,generateUUID:gt,getDomain:yn,getDomainCode:ki,getDomainValue:Ii,getType:cr,greaterThanLessThan:mr,implicitResult:Ft,isArray:k,isBoolean:V,isDate:H,isDateOnly:P,isDictionary:fr,isFeature:ee,isFeatureSet:Tt,isFeatureSetCollection:Ht,isFunctionParameter:X,isGeometry:Dn,isImmutableArray:M,isInteger:Ze,isJsDate:on,isKnowledgeGraph:dr,isModule:lr,isNumber:L,isObject:zn,isSimpleType:He,isString:F,isSubtypeGrouplayer:Xa,isSubtypeSublayer:Ti,isTime:j,multiReplace:tt,parseGeometryFromJson:Ha,pcCheck:D,returnResult:Ce,stableStringify:Gn,standardiseDateFormat:pr,tick:Wa,toBoolean:Ct,toDate:ue,toNumber:p,toNumberArray:rt,toString:A,toStringArray:Ka,toStringExplicit:Ee,voidOperation:b},Symbol.toStringTag,{value:"Module"}));function Qa(e){Pi=e}let Pi;function jt(e){return e===null?null:H(e)?e.clone():He(e)?e:Dn(e)?e.clone():M(e)?e.toArray().map(t=>jt(t)):k(e)?e.map(t=>jt(t)):ee(e)?Pi.createFromArcadeFeature(e):Ht(e)||Tt(e)?e:fr(e)||(e==null?void 0:e.declaredClass)==="esri.arcade.Attachment"?e.deepClone():((e==null?void 0:e.declaredClass)==="esri.arcade.Portal"||dr(e)||e instanceof qt||X(e),e)}function ln(e,t,n=!1,r=!1){if(e==null)return null;if(L(e))return p(e);if(V(e))return Ct(e);if(F(e))return A(e);if(H(e))return ue(e,t);if(P(e)||j(e))return e;if(k(e)){const o=[];for(const s of e)o.push(ln(s,t,n,r));return o}if(r&&Dn(e))return e;const a=new B;a.immutable=!1;for(const o of Object.keys(e)){const s=e[o];s!==void 0&&a.setField(o,ln(s,t,n,r))}return a.immutable=n,a}let B=class an{constructor(t){this.declaredClass="esri.arcade.Dictionary",this.attributes=null,this.plain=!1,this.immutable=!0,this.attributes=t instanceof an?t.attributes:t??{}}field(t){const n=t.toLowerCase(),r=this.attributes[t];if(r!==void 0)return r;for(const a in this.attributes)if(a.toLowerCase()===n)return this.attributes[a];throw new d(null,c.FieldNotFound,null,{key:t})}setField(t,n){if(this.immutable)throw new d(null,c.Immutable,null);if(X(n))throw new d(null,c.NoFunctionInDictionary,null);const r=t.toLowerCase();if(n instanceof Date&&(n=U.dateJSToArcadeDate(n)),this.attributes[t]===void 0){for(const a in this.attributes)if(a.toLowerCase()===r)return void(this.attributes[a]=n);this.attributes[t]=n}else this.attributes[t]=n}hasField(t){const n=t.toLowerCase();if(this.attributes[t]!==void 0)return!0;for(const r in this.attributes)if(r.toLowerCase()===n)return!0;return!1}keys(){let t=[];for(const n in this.attributes)t.push(n);return t=t.sort(),t}castToText(t=!1){let n="";for(const r in this.attributes){n!==""&&(n+=",");const a=this.attributes[r];a==null?n+=JSON.stringify(r)+":null":V(a)||L(a)||F(a)?n+=JSON.stringify(r)+":"+JSON.stringify(a):a instanceof $?n+=JSON.stringify(r)+":"+Ee(a):a instanceof ce||a instanceof Array?n+=JSON.stringify(r)+":"+Ee(a,null,t):a instanceof U?n+=t?JSON.stringify(r)+":"+JSON.stringify(a.getTime()):JSON.stringify(r)+":"+a.stringify():a!==null&&typeof a=="object"&&a.castToText!==void 0&&(n+=JSON.stringify(r)+":"+a.castToText(t))}return"{"+n+"}"}static convertObjectToArcadeDictionary(t,n,r=!0,a=!1){const o=new an;o.immutable=!1;for(const s in t){const i=t[s];i!==void 0&&o.setField(s.toString(),ln(i,n,r,a))}return o.immutable=r,o}static convertJsonToArcade(t,n,r=!1,a=!1){return ln(t,n,r,a)}castAsJson(t=null){const n={};for(let r in this.attributes){const a=this.attributes[r];a!==void 0&&(t!=null&&t.keyTranslate&&(r=t.keyTranslate(r)),n[r]=nt(a,t))}return n}async castDictionaryValueAsJsonAsync(t,n,r,a=null,o){const s=await gr(r,a,o);return t[n]=s,s}async castAsJsonAsync(t=null,n=null){const r={},a=[];for(let o in this.attributes){const s=this.attributes[o];n!=null&&n.keyTranslate&&(o=n.keyTranslate(o)),s!==void 0&&(He(s)||s instanceof $||s instanceof U?r[o]=nt(s,n):a.push(this.castDictionaryValueAsJsonAsync(r,o,s,t,n)))}return a.length>0&&await Promise.all(a),r}deepClone(){const t=new an;t.immutable=!1;for(const n of this.keys())t.setField(n,jt(this.field(n)));return t}},Q=class ve{constructor(){this.arcadeDeclaredClass="esri.arcade.Feature",this._optimizedGeomDefinition=null,this._geometry=null,this.attributes=null,this._layer=null,this._fieldTypesFixed=!0,this.fieldsIndex=null,this.contextTimeZone=null,this.immutable=!0,this._fieldsToFixDataTypes=null,this.immutable=!0}static createFromGraphic(t,n){const r=new ve;return r.contextTimeZone=n??null,r._geometry=t.geometry!=null?t.geometry:null,t.attributes===void 0||t.attributes===null?r.attributes={}:r.attributes=t.attributes,t._sourceLayer?(r._layer=t._sourceLayer,r._fieldTypesFixed=!1):t._layer?(r._layer=t._layer,r._fieldTypesFixed=!1):t.layer&&"fields"in t.layer?(r._layer=t.layer,r._fieldTypesFixed=!1):t.sourceLayer&&"fields"in t.sourceLayer&&(r._layer=t.sourceLayer,r._fieldTypesFixed=!1),r._layer&&!r._fieldTypesFixed&&(r.fieldsIndex=this.hydrateFieldsIndex(r._layer)),r}static createFromArcadeFeature(t){if(t instanceof ve){const r=new ve;return r._fieldTypesFixed=t._fieldTypesFixed,r.attributes=t.attributes,r._geometry=t._geometry,r._optimizedGeomDefinition=t._optimizedGeomDefinition,t._layer&&(r._layer=t._layer),r.fieldsIndex=t.fieldsIndex,r.contextTimeZone=t.contextTimeZone,r}const n={};for(const r of t.keys())n[r]=t.field(r);return ve.createFromGraphicLikeObject(t.geometry(),n,t.fullSchema(),t.contextTimeZone)}static createFromOptimisedFeature(t,n,r){const a=new ve;return a._geometry=t.geometry?{geometry:t.geometry}:null,a._optimizedGeomDefinition=r,a.attributes=t.attributes||{},a._layer=n,a._fieldTypesFixed=!1,a}static createFromArcadeDictionary(t,n){const r=new ve;return r.attributes=t.field("attributes"),r.attributes!==null&&r.attributes instanceof B?(r.attributes=r.attributes.attributes,r.attributes===null&&(r.attributes={})):r.attributes={},r._geometry=t.field("geometry"),r._geometry!==null&&(r._geometry instanceof B?r._geometry=ve.parseGeometryFromDictionary(r._geometry,n):r._geometry instanceof $||(r._geometry=null)),r}static createFromGraphicLikeObject(t,n,r=null,a){const o=new ve;return o.contextTimeZone=a??null,n===null&&(n={}),o.attributes=n,o._geometry=t??null,o._layer=r,o._layer&&(o._fieldTypesFixed=!1,o.fieldsIndex=this.hydrateFieldsIndex(o._layer)),o}static hydrateFieldsIndex(t){return t===null?null:Tt(t)?t.getFieldsIndex():t.fieldsIndex?t.fieldsIndex:Za.fromLayerJSON({datesInUnknownTimezone:t.datesInUnknownTimezone,fields:t.fields,timeInfo:t.timeInfo,editFieldsInfo:t.editFieldsInfo,dateFieldsTimeReference:t.dateFieldsTimeReference??{timeZone:"UTC",respectsDaylightSaving:!1}})}repurposeFromGraphicLikeObject(t,n,r=null){n===null&&(n={}),this.attributes=n,this._geometry=t??null,this._layer=r,this._layer?this._fieldTypesFixed=!1:this._fieldTypesFixed=!0}castToText(t=!1){let n="";this._fieldTypesFixed===!1&&this._fixFieldTypes();for(const r in this.attributes){n!==""&&(n+=",");const a=this.attributes[r];a==null?n+=JSON.stringify(r)+":null":V(a)||L(a)||F(a)?n+=JSON.stringify(r)+":"+JSON.stringify(a):a instanceof $?n+=JSON.stringify(r)+":"+Ee(a):a instanceof ge||a instanceof De?n+=`${JSON.stringify(r)}:${JSON.stringify(a.toString())}`:a instanceof ce||a instanceof Array?n+=JSON.stringify(r)+":"+Ee(a,null,t):a instanceof U?n+=t?JSON.stringify(r)+":"+JSON.stringify(a.getTime()):JSON.stringify(r)+":"+a.stringify():a!==null&&typeof a=="object"&&a.castToText!==void 0&&(n+=JSON.stringify(r)+":"+a.castToText(t))}return'{"geometry":'+(this.geometry()===null?"null":Ee(this.geometry()))+',"attributes":{'+n+"}}"}_fixFieldTypes(){var r;if(this._fieldsToFixDataTypes&&((r=this._fieldsToFixDataTypes)==null?void 0:r.length)>0)return this._fixAllFields(this._fieldsToFixDataTypes),void(this._fieldTypesFixed=!0);const t=[],n=this._layer.fields;for(let a=0;a0&&this._fixAllFields(t),this._fieldTypesFixed=!0}isUnknownDateTimeField(t){var n;return((n=this.fieldsIndex)==null?void 0:n.getTimeZone(t))==="unknown"}_fixAllFields(t){this.attributes={...this.attributes};const n=this.contextTimeZone??"system";for(let r=0;r!n&&(a.type==="Identifier"&&a.name&&a.name.toLowerCase()===r&&(n=!0),!0)),n}function Ui(e){const t=[];return W(e,n=>(n.type==="ImportDeclaration"&&n.source&&n.source.value&&t.push({libname:n.specifiers[0].local.name.toLowerCase(),source:n.source.value}),!0)),t}function ns(e,t){let n=!1;const r=t.toLowerCase();return W(e,a=>!n&&(a.type!=="CallExpression"||a.callee.type!=="Identifier"||!a.callee.name||a.callee.name.toLowerCase()!==r||(n=!0,!1))),n}function rs(e){const t=[];return W(e,n=>{var r;return n.type!=="MemberExpression"||n.object.type!=="Identifier"||(n.computed===!1&&n.object&&n.object.name&&n.property&&n.property.type==="Identifier"&&n.property.name?t.push(n.object.name.toLowerCase()+"."+n.property.name.toLowerCase()):n.object&&n.object.name&&n.property&&n.property.type==="Literal"&&typeof n.property.value=="string"&&t.push(n.object.name.toLowerCase()+"."+((r=n.property.value)==null?void 0:r.toString().toLowerCase())),!1)}),t}function is(e){const t=[];return W(e,n=>{var r;if(n.type==="CallExpression"){if(n.callee.type==="Identifier"&&n.callee.name.toLowerCase()==="expects"){let a="";for(let o=0;o<(n.arguments||[]).length;o++)o===0?n.arguments[o].type==="Identifier"&&(a=n.arguments[o].name.toLowerCase()):a&&n.arguments[o].type==="Literal"&&Lr(n.arguments[o].value)&&t.push(a+"."+n.arguments[o].value.toLowerCase());return!1}if(n.callee.type==="Identifier"&&["domainname","domaincode","domain","haskey"].includes(n.callee.name.toLowerCase())&&n.arguments.length>=2){let a="";return n.arguments[0].type==="Identifier"&&(a=n.arguments[0].name.toLowerCase()),a&&n.arguments[1].type==="Literal"&&Lr(n.arguments[1].value)&&t.push(a+"."+n.arguments[1].value.toLowerCase()),!1}}return n.type!=="MemberExpression"||n.object.type!=="Identifier"||(n.computed===!1&&n.object&&n.object.name&&n.property&&n.property.type==="Identifier"&&n.property.name?t.push(n.object.name.toLowerCase()+"."+n.property.name.toLowerCase()):n.object&&n.object.name&&n.property&&n.property.type==="Literal"&&typeof n.property.value=="string"&&t.push(n.object.name.toLowerCase()+"."+((r=n.property.value)==null?void 0:r.toString().toLowerCase())),!1)}),t}function Vn(e){const t=[];return W(e,n=>(n.type==="CallExpression"&&n.callee.type==="Identifier"&&t.push(n.callee.name.toLowerCase()),!0)),t}function Wt(e,t=[]){let n=null;if(e.usesFeatureSet===void 0){n===null&&(n=Vn(e)),e.usesFeatureSet=!1;for(let r=0;r0){for(const r of t)if(Oi(e,r)){e.usesFeatureSet=!0,e.isAsync=!0;break}}}if(e.usesModules===void 0&&(e.usesModules=!1,Ui(e).length>0&&(e.usesModules=!0)),e.usesGeometry===void 0){e.usesGeometry=!1,n===null&&(n=Vn(e));for(let r=0;r0||u.length>0;)if(i.length>0&&u.length>0){let f=l(i[0],u[0]);isNaN(f)&&(f=0),f<=0?(h.push(i[0]),i=i.slice(1)):(h.push(u[0]),u=u.slice(1))}else i.length>0?(h.push(i[0]),i=i.slice(1)):u.length>0&&(h.push(u[0]),u=u.slice(1));return h}async function a(i,u){const l=i.length,h=Math.floor(l/2);if(l===0)return[];if(l===1)return[i[0]];const f=[await a(i.slice(0,h),u),await a(i.slice(h,l),u)];return o(f[0],f[1],u,[])}async function o(i,u,l,h){const f=h;if(!(i.length>0||u.length>0))return h;if(i.length>0&&u.length>0){let m=await l(i[0],u[0]);return isNaN(m)&&(m=1),m<=0?(f.push(i[0]),i=i.slice(1)):(f.push(u[0]),u=u.slice(1)),o(i,u,l,h)}return i.length>0?(f.push(i[0]),o(i=i.slice(1),u,l,h)):u.length>0?(f.push(u[0]),o(i,u=u.slice(1),l,h)):void 0}function s(i,u,l,h){D(l,1,2,i,u);let f=l[0];if(M(f)&&(f=f.toArray()),k(f)===!1)throw new d(i,c.InvalidParameter,u);if(l.length>1){if(X(l[1])===!1)throw new d(i,c.InvalidParameter,u);let v=f;const z=l[1].createFunction(i);return h?a(v,z):(v=n(v,(ae,he)=>z(ae,he)),v)}let m=f;if(m.length===0)return[];const g={};for(let v=0;v1||T==="String"?n(m,(v,z)=>{if(v==null||v===b)return z==null||z===b?0:1;if(z==null||z===b)return-1;const ae=A(v),he=A(z);return aev-z):T==="Boolean"?n(m,(v,z)=>v===z?0:z?-1:1):T==="Date"?n(m,(v,z)=>z-v):m.slice(0),m}e.functions.array=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{if(D(f,0,2,i,u),f.length===0)return[];if(f.length===1&&f[0]===null)return[];if(k(f[0])){if(f.length===2&&V(f[1])===!1)throw new d(i,c.InvalidParameter,u);return R(f[1],!1)===!0?jt(f[0]):f[0].slice(0)}if(M(f[0])){if(f.length===2&&V(f[1])===!1)throw new d(i,c.InvalidParameter,u);return R(f[1],!1)===!0?jt(f[0]):f[0].toArray().slice(0)}const m=p(f[0]);if(isNaN(m)||Ze(m)===!1)throw new d(i,c.InvalidParameter,u);const g=R(f[1],null),y=new Array(m);return y.fill(g),y})},e.functions.front=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{if(D(f,1,1,i,u),M(f[0])){if(f[0].length()<=0)throw new d(i,c.OutOfBounds,u);return f[0].get(0)}if(k(f[0])){if(f[0].length<=0)throw new d(i,c.OutOfBounds,u);return f[0][0]}throw new d(i,c.InvalidParameter,u)})},e.functions.back=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{if(D(f,1,1,i,u),M(f[0])){if(f[0].length()<=0)throw new d(i,c.OutOfBounds,u);return f[0].get(f[0].length()-1)}if(k(f[0])){if(f[0].length<=0)throw new d(i,c.OutOfBounds,u);return f[0][f[0].length-1]}throw new d(i,c.InvalidParameter,u)})},e.functions.push=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{if(D(f,1,2,i,u),k(f[0]))return f[0][f[0].length]=f[1],f[0].length;throw new d(i,c.InvalidParameter,u)})},e.functions.pop=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{if(D(f,1,1,i,u),k(f[0])){if(f[0].length<=0)throw new d(i,c.OutOfBounds,u);const m=f[0][f[0].length-1];return f[0].length=f[0].length-1,m}throw new d(i,c.InvalidParameter,u)})},e.functions.erase=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{if(D(f,2,2,i,u),k(f[0])){let m=p(f[1]);if(isNaN(m)||Ze(m)===!1)throw new d(i,c.InvalidParameter,u);const g=f[0];if(g.length<=0)throw new d(i,c.OutOfBounds,u);if(m<0&&(m=g.length+m),m<0)throw new d(i,c.OutOfBounds,u);if(m>=g.length)throw new d(i,c.OutOfBounds,u);return g.splice(m,1),b}throw new d(i,c.InvalidParameter,u)})},e.functions.insert=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{if(D(f,3,3,i,u),k(f[0])){const m=p(f[1]);if(isNaN(m)||Ze(m)===!1)throw new d(i,c.InvalidParameter,u);const g=f[2],y=f[0];if(m>y.length)throw new d(i,c.OutOfBounds,u);if(m<0&&m<-1*y.length)throw new d(i,c.OutOfBounds,u);return m===y.length?(y[m]=g,b):(y.splice(m,0,g),b)}throw new d(i,c.InvalidParameter,u)})},e.functions.resize=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{if(D(f,2,3,i,u),k(f[0])){const m=p(f[1]);if(isNaN(m)||Ze(m)===!1)throw new d(i,c.InvalidParameter,u);if(m<0)throw new d(i,c.InvalidParameter,u);const g=R(f[2],null),y=f[0];if(y.length>=m)return y.length=m,b;const T=y.length;y.length=m;for(let v=T;v{if(D(f,2,2,i,u),k(f[0])){const m=f[1];return f[0].findIndex(g=>ke(g,m))>-1}if(M(f[0])){const m=f[1];return f[0].toArray().findIndex(g=>ke(g,m))>-1}throw new d(i,c.InvalidParameter,u)})},e.functions.slice=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{if(D(f,1,3,i,u),k(f[0])){const m=p(R(f[1],0)),g=p(R(f[2],f[0].length));if(isNaN(m)||Ze(m)===!1)throw new d(i,c.InvalidParameter,u);if(isNaN(g)||Ze(g)===!1)throw new d(i,c.InvalidParameter,u);return f[0].slice(m,g)}if(M(f[0])){const m=f[0],g=p(R(f[1],0)),y=p(R(f[2],m.length()));if(isNaN(g)||Ze(g)===!1)throw new d(i,c.InvalidParameter,u);if(isNaN(y)||Ze(y)===!1)throw new d(i,c.InvalidParameter,u);return m.toArray().slice(g,y)}throw new d(i,c.InvalidParameter,u)})},e.functions.splice=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{const m=[];for(let g=0;g{if(D(f,2,2,i,u),k(f[0]))return p(f[1])>=f[0].length?f[0].slice(0):f[0].slice(0,p(f[1]));if(M(f[0]))return p(f[1])>=f[0].length()?f[0].slice(0):f[0].slice(0,p(f[1]));throw new d(i,c.InvalidParameter,u)})},e.functions.first=function(i,u){return e.standardFunction(i,u,(l,h,f)=>(D(f,1,1,i,u),k(f[0])?f[0].length===0?null:f[0][0]:M(f[0])?f[0].length()===0?null:f[0].get(0):null))},e.mode==="sync"&&(e.functions.sort=function(i,u){return e.standardFunction(i,u,(l,h,f)=>s(i,u,f,!1))},e.functions.any=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{D(f,2,2,i,u);const m=f[1].createFunction(i),g=t(f[0],i,u);for(const y of g){const T=m(y);if(V(T)&&T===!0)return!0}return!1})},e.functions.all=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{D(f,2,2,i,u);const m=f[1].createFunction(i),g=t(f[0],i,u);for(const y of g)if(m(y)!==!0)return!1;return!0})},e.functions.none=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{D(f,2,2,i,u);const m=f[1].createFunction(i),g=t(f[0],i,u);for(const y of g)if(m(y)===!0)return!1;return!0})},e.functions.reduce=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{D(f,2,3,i,u);const m=f[1].createFunction(i),g=t(f[0],i,u);return f.length===2?g.length===0?null:g.reduce((y,T)=>{const v=m(y,T);return y=v!==void 0&&v!==b?v:null}):g.reduce((y,T)=>{const v=m(y,T);return y=v!==void 0&&v!==b?v:null},f[2])})},e.functions.map=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{D(f,2,2,i,u);const m=f[1].createFunction(i),g=t(f[0],i,u),y=[];for(const T of g){const v=m(T);v!==void 0&&v!==b?y.push(v):y.push(null)}return y})},e.functions.filter=function(i,u){return e.standardFunction(i,u,(l,h,f)=>{D(f,2,2,i,u);const m=f[1].createFunction(i),g=t(f[0],i,u),y=[];for(const T of g)m(T)===!0&&y.push(T);return y})}),e.mode==="async"&&(e.functions.sort=function(i,u){return e.standardFunctionAsync(i,u,(l,h,f)=>s(i,u,f,!0))},e.functions.any=function(i,u){return e.standardFunctionAsync(i,u,async(l,h,f)=>{D(f,2,2,i,u);const m=f[1].createFunction(i),g=t(f[0],i,u);for(const y of g){const T=await m(y);let v=null;if(v=Xe(v)?await T:T,V(v)&&v===!0)return!0}return!1})},e.functions.all=function(i,u){return e.standardFunctionAsync(i,u,async(l,h,f)=>{D(f,2,2,i,u);const m=f[1].createFunction(i),g=t(f[0],i,u);for(const y of g){const T=await m(y);let v=null;if(v=Xe(v)?await T:T,v!==!0)return!1}return!0})},e.functions.none=function(i,u){return e.standardFunctionAsync(i,u,async(l,h,f)=>{D(f,2,2,i,u);const m=f[1].createFunction(i),g=t(f[0],i,u);for(const y of g){const T=await m(y);let v=null;if(v=Xe(v)?await T:T,v===!0)return!1}return!0})},e.functions.filter=function(i,u){return e.standardFunctionAsync(i,u,async(l,h,f)=>{D(f,2,2,i,u);const m=f[1].createFunction(i),g=t(f[0],i,u),y=[];for(const T of g){const v=await m(T);let z=null;z=Xe(z)?await v:v,z===!0&&y.push(T)}return y})},e.functions.reduce=function(i,u){return e.standardFunctionAsync(i,u,(l,h,f)=>{D(f,2,3,i,u);const m=f[1].createFunction(i),g=t(f[0],i,u);let y=null;if(f.length>2){const T=R(f[2],null);y=g.reduce(async(v,z)=>{let ae=await v;return ae!==void 0&&ae!==b||(ae=null),m(ae,z)},Promise.resolve(T))}else{if(g.length===0)return null;y=g.reduce(async(T,v,z)=>{if(z<=1)return m(T,v);let ae=await T;return ae!==void 0&&ae!==b||(ae=null),m(ae,v)})}return y.then(T=>T!==void 0&&T!==b?T:null)})},e.functions.map=function(i,u){return e.standardFunctionAsync(i,u,async(l,h,f)=>{D(f,2,2,i,u);const m=f[1].createFunction(i),g=t(f[0],i,u),y=[];for(const T of g){const v=await m(T);let z=null;z=Xe(z)?await v:v,z!==void 0&&z!==b?y.push(z):y.push(null)}return y})})}const qn=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:as},Symbol.toStringTag,{value:"Module"}));function ss(e,t,n){return e+(os(n)?ls:us)[t]}function os(e){return e%4==0&&(e%100!=0||e%400==0)}const us=[0,31,59,90,120,151,181,212,243,273,304,334],ls=[0,31,60,91,121,152,182,213,244,274,305,335];function Re(e){return e===null?e:e.isValid===!1?null:e}function Mt(e,t){return e===""||e.toLowerCase().trim()==="default"?N(t):e==="z"||e==="Z"?"UTC":e}function Oe(e,t){return P(e)?e.toArcadeDate():ue(e,N(t))}function zi(e,t){e.today=function(n,r){return t(n,r,(a,o,s)=>{D(s,0,0,n,r);const i=new Date;return i.setHours(0,0,0,0),U.dateJSAndZoneToArcadeDate(i,N(n))})},e.time=function(n,r){return t(n,r,(a,o,s)=>{switch(D(s,0,4,n,r),s.length){case 0:{const i=U.nowToArcadeDate(N(n));return new ge(i.hour,i.minute,i.second,i.millisecond)}case 1:{if(j(s[0]))return s[0].clone();if(H(s[0]))return new ge(s[0].hour,s[0].minute,s[0].second,s[0].millisecond);if(P(s[0]))return new ge(0,0,0,0);if(F(s[0]))return ge.fromString(s[0]);const i=p(s[0]);return isNaN(i)===!1?ge.fromMilliseconds(i):null}case 2:return F(s[0])&&F(s[1])?ge.fromString(s[0],s[1]):ge.fromParts(p(s[0]),p(s[1]),0,0);case 3:return ge.fromParts(p(s[0]),p(s[1]),p(s[2]),0);case 4:return ge.fromParts(p(s[0]),p(s[1]),p(s[2]),p(s[3]))}throw new d(n,c.InvalidParameter,r)})},e.dateonly=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,0,3,n,r),s.length===3)return De.fromParts(p(s[0]),p(s[1])+1,p(s[2]));if(s.length===2){const i=A(s[1]);return i===""?null:i==="X"?De.fromSeconds(p(s[0])):i==="x"?De.fromMilliseconds(p(s[0])):De.fromString(A(s[0]),i)}if(s.length===1){if(F(s[0])){if(s[0].replaceAll(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")==="")return null;if(/^[0-9][0-9][0-9][0-9]$/.test(s[0])===!0)return De.fromString(s[0]+"-01-01")}if(P(s[0]))return s[0].clone();if(H(s[0]))return De.fromParts(s[0].year,s[0].monthJS+1,s[0].day);const i=p(s[0]);return isNaN(i)===!1?De.fromMilliseconds(i):F(s[0])?De.fromString(s[0]):null}if(s.length===0){const i=U.nowToArcadeDate(N(n));return i.isValid===!1?null:De.fromParts(i.year,i.monthJS+1,i.day)}return null})},e.changetimezone=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,2,2,n,r),s[0]===null)return null;if(P(s[0]))throw new d(n,c.CannotChangeTimeZoneDateOnly,r);if(P(s[0]))throw new d(n,c.CannotChangeTimeZoneTime,r);const i=ue(s[0],N(n));if(i===null)throw new d(n,c.InvalidParameter,r);const u=_t(Mt(A(s[1]),n),!1);if(u===null)return null;const l=U.arcadeDateAndZoneToArcadeDate(i,u);return l.isValid===!1?null:l})},e.timezone=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,1,2,n,r),j(s[0])||P(s[0]))return"Unknown";const i=ue(s[0],N(n));if(i===null)return null;const u=i.timeZone;return u==="system"?U.systemTimeZoneCanonicalName:u.toLowerCase()==="utc"?"UTC":u.toLowerCase()==="unknown"?"Unknown":u})},e.timezoneoffset=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);const i=ue(s[0],N(n));return i===null?null:60*i.timeZoneOffset*1e3})},e.now=function(n,r){return t(n,r,(a,o,s)=>{D(s,0,0,n,r);const i=U.nowToArcadeDate(N(n));return i.isValid===!1?null:i})},e.timestamp=function(n,r){return t(n,r,(a,o,s)=>{D(s,0,0,n,r);const i=U.nowUTCToArcadeDate();return i.isValid===!1?null:i})},e.toutc=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);const i=ue(s[0],N(n));return i===null?null:i.toUTC()})},e.tolocal=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);const i=ue(s[0],N(n));return i===null?null:i.toLocal()})},e.day=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);const i=Oe(s[0],N(n));return i===null?NaN:i.day})},e.month=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);const i=Oe(s[0],N(n));return i===null?NaN:i.monthJS})},e.year=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);const i=Oe(s[0],N(n));return i===null?NaN:i.year})},e.hour=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,1,1,n,r),j(s[0]))return s[0].hour;const i=ue(s[0],N(n));return i===null?NaN:i.hour})},e.second=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,1,1,n,r),j(s[0]))return s[0].second;const i=ue(s[0],N(n));return i===null?NaN:i.second})},e.millisecond=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,1,1,n,r),j(s[0]))return s[0].millisecond;const i=ue(s[0],N(n));return i===null?NaN:i.millisecond})},e.minute=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,1,1,n,r),j(s[0]))return s[0].minute;const i=ue(s[0],N(n));return i===null?NaN:i.minute})},e.week=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,2,n,r);const i=Oe(s[0],N(n));if(i===null)return NaN;const u=p(R(s[1],0));if(u<0||u>6)throw new d(n,c.InvalidParameter,r);const l=i.day,h=i.monthJS,f=i.year,m=i.dayOfWeekJS,g=ss(l,h,f)-1,y=Math.floor(g/7);return m-u+(m-u<0?7:0){D(s,1,1,n,r);const i=Oe(s[0],N(n));return i===null?NaN:i.dayOfWeekJS})},e.isoweekday=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);const i=Oe(s[0],N(n));return i===null?NaN:i.dayOfWeekISO})},e.isomonth=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);const i=Oe(s[0],N(n));return i===null?NaN:i.monthISO})},e.isoweek=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);const i=Oe(s[0],N(n));return i===null?NaN:i.weekISO})},e.isoyear=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);const i=Oe(s[0],N(n));return i===null?NaN:i.yearISO})},e.date=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,0,8,n,r),s.length===3){if(P(s[0])&&j(s[1])&&F(s[2])){const i=_t(Mt(A(s[2])??"unknown",n),!1);return i===null?null:Re(U.fromParts(s[0].year,s[0].month,s[0].day,s[1].hour,s[1].minute,s[1].second,s[1].millisecond,i))}return Re(U.fromParts(p(s[0]),p(s[1])+1,p(s[2]),0,0,0,0,N(n)))}if(s.length===4)return Re(U.fromParts(p(s[0]),p(s[1])+1,p(s[2]),p(s[3]),0,0,0,N(n)));if(s.length===5)return Re(U.fromParts(p(s[0]),p(s[1])+1,p(s[2]),p(s[3]),p(s[4]),0,0,N(n)));if(s.length===6)return Re(U.fromParts(p(s[0]),p(s[1])+1,p(s[2]),p(s[3]),p(s[4]),p(s[5]),0,N(n)));if(s.length===7)return Re(U.fromParts(p(s[0]),p(s[1])+1,p(s[2]),p(s[3]),p(s[4]),p(s[5]),p(s[6]),N(n)));if(s.length===8){const i=_t(Mt(A(s[7])??"unknown",n),!1);return i===null?null:Re(U.fromParts(p(s[0]),p(s[1])+1,p(s[2]),p(s[3]),p(s[4]),p(s[5]),p(s[6]),i))}if(s.length===2){if(P(s[0])&&F(s[1])){const l=_t(Mt(A(s[1])??"unknown",n),!1);return l===null?null:Re(U.fromParts(s[0].year,s[0].month,s[0].day,0,0,0,0,l))}if(P(s[0])&&j(s[1]))return Re(U.fromParts(s[0].year,s[0].month,s[0].day,s[1].hour,s[1].minute,s[1].second,s[1].millisecond,"unknown"));let i,u=A(s[1]);return u===""?null:(u=pr(u,!0),i=u==="X"?st.fromSeconds(p(s[0])):u==="x"?st.fromMillis(p(s[0])):st.fromFormat(A(s[0]),u,{locale:sr(),numberingSystem:"latn"}),i.isValid?U.dateTimeToArcadeDate(i):null)}if(s.length===1){if(P(s[0]))return Re(U.fromParts(s[0].year,s[0].month,s[0].day,0,0,0,0,"unknown"));if(F(s[0])){if(s[0].replaceAll(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")==="")return null;if(/^[0-9][0-9][0-9][0-9]$/.test(s[0])===!0)return ue(s[0]+"-01-01",N(n))}const i=p(s[0]);if(isNaN(i)===!1){const u=st.fromMillis(i);return u.isValid?U.dateTimeAndZoneToArcadeDate(u,N(n)):null}return ue(s[0],N(n))}return s.length===0?U.nowToArcadeDate(N(n)):null})},e.datediff=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,2,4,n,r),j(s[0]))return j(s[1])?s[0].difference(s[1],A(s[2])):NaN;if(j(s[1]))return NaN;if(P(s[0]))return P(s[1])?s[0].difference(s[1],A(s[2])):NaN;if(P(s[1]))return NaN;let i=ue(s[0],N(n)),u=ue(s[1],N(n));if(i===null||u===null)return NaN;let l=R(s[3],"");switch(l!==""&&l!==null?(l=Mt(A(l),n),i=U.arcadeDateAndZoneToArcadeDate(i,l),u=U.arcadeDateAndZoneToArcadeDate(u,l)):i.timeZone!==u.timeZone&&(i.isUnknownTimeZone?i=U.arcadeDateAndZoneToArcadeDate(i,u.timeZone):u=(u.isUnknownTimeZone,U.arcadeDateAndZoneToArcadeDate(u,i.timeZone))),A(s[2]).toLowerCase()){case"days":case"day":case"d":return i.diff(u,"days");case"months":case"month":return i.diff(u,"months");case"minutes":case"minute":case"m":return s[2]==="M"?i.diff(u,"months"):i.diff(u,"minutes");case"seconds":case"second":case"s":return i.diff(u,"seconds");case"milliseconds":case"millisecond":case"ms":default:return i.diff(u);case"hours":case"hour":case"h":return i.diff(u,"hours");case"years":case"year":case"y":return i.diff(u,"years")}})},e.dateadd=function(n,r){return t(n,r,(a,o,s)=>{D(s,2,3,n,r);let i=p(s[1]);if(isNaN(i)||i===1/0||i===-1/0)return j(s[0])||P(s[0])?s[0].clone():ue(s[0],N(n));let u="milliseconds";switch(A(s[2]).toLowerCase()){case"days":case"day":case"d":u="days",i=P(s[0])?i:Zn(i);break;case"months":case"month":u="months",i=P(s[0])?i:Zn(i);break;case"minutes":case"minute":case"m":u=s[2]==="M"?"months":"minutes";break;case"seconds":case"second":case"s":u="seconds";break;case"milliseconds":case"millisecond":case"ms":u="milliseconds";break;case"hours":case"hour":case"h":u="hours";break;case"years":case"year":case"y":u="years"}if(j(s[0])||P(s[0]))return s[0].plus(u,i);const l=ue(s[0],N(n));return l===null?null:l.plus({[u]:i})})}}function xe(e,t,n){return Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]!==void 0&&t[2]!==void 0?(e[2]*n-t[2]*n)**2:0))}function Zi(e,t,n){return Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]!==void 0&&t[2]!==void 0?(e[2]*n-t[2]*n)**2:0))}const Rt=[];for(const e of[[9002,56146130,6131,6132,8050,8051,8228],[9003,5702,6358,6359,6360,8052,8053],[9095,5754]]){const t=e[0];for(let n=1;n0?(r.x/=a,r.y/=a,t&&(r.z/=a),n&&(r.m/=a)):(r.x=e[0][0],r.y=e[0][1],t&&(r.z=e[0][2]),n&&t?r.m=e[0][3]:n&&(r.m=e[0][2])),r}function cs(e,t,n,r){const a={x:(e[0]+t[0])/2,y:(e[1]+t[1])/2};return n&&(a.z=(e[2]+t[2])/2),n&&r?a.m=(e[3]+t[3])/2:r&&(a.m=(e[2]+t[2])/2),a}function fs(e,t){if(e.length<=1)return 0;let n=0;for(let r=1;r0?(n.x/=a,n.y/=a,e.hasZ===!0&&(n.z/=a),e.hasM===!0&&(n.m/=a),new J(n)):r>0?(t.x/=r,t.y/=r,e.hasZ===!0&&(n.z/=r),e.hasM===!0&&(t.m/=r),new J(t)):null}function ps(e){if(e.points.length===0)return null;let t=0,n=0,r=0,a=0;for(let s=0;s=r;)e-=t;return e}function ji(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}function gs(e,t){return Fn(ji(e,t),2*Math.PI)*(180/Math.PI)}function ys(e,t){return Fn(Math.PI/2-ji(e,t),2*Math.PI)*(180/Math.PI)}function Ji(e,t,n){const r={x:e.x-t.x,y:e.y-t.y},a={x:n.x-t.x,y:n.y-t.y};return Math.atan2(Ds(r,a),ms(r,a))}function ws(e,t,n){return pi(Fn(Ji(e,t,n),2*Math.PI))}function xs(e,t,n){return pi(Fn(-1*Ji(e,t,n),2*Math.PI))}Ut[9002]=.3048,Ut[9003]=.3048006096012192,Ut[9095]=.3048007491;const oe=[0,0];function Or(e){for(let t=0;t1&&(r=1)),r<=.5?[t[0]+(n[0]-t[0])*r,t[1]+(n[1]-t[1])*r]:[n[0]-(n[0]-t[0])*(1-r),n[1]-(n[1]-t[1])*(1-r)]}function en(e){return e&&e.arcadeDeclaredClass==="esri.arcade.Feature"}function Vi(e,t){e.ringisclockwise=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);let i=[];if(s[0]===null)return!1;if(k(s[0]))for(const u of s[0]){if(!(u instanceof J))throw new d(n,c.InvalidParameter,r);i.push(u.hasZ?u.hasM?[u.x,u.y,u.z,u.m]:[u.x,u.y,u.z]:[u.x,u.y])}else if(s[0]instanceof ft)i=s[0]._elements;else{if(!M(s[0]))throw new d(n,c.InvalidParameter,r);for(const u of s[0].toArray()){if(!(u instanceof J))throw new d(n,c.InvalidParameter,r);i.push(u.hasZ?u.hasM?[u.x,u.y,u.z,u.m]:[u.x,u.y,u.z]:[u.x,u.y])}}return!(i.length<3)&&di(i)})},e.polygon=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);let i=null;if(s[0]instanceof B){if(i=ne(Q.parseGeometryFromDictionary(s[0],n.spatialReference),n.spatialReference),!(i instanceof ie))throw new d(n,c.InvalidParameter,r)}else if(s[0]instanceof ie)i=le(s[0].toJSON());else{const u=JSON.parse(s[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=ne(new ie(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new d(n,c.WrongSpatialReference,r);return it(i)})},e.polyline=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);let i=null;if(s[0]instanceof B){if(i=ne(Q.parseGeometryFromDictionary(s[0],n.spatialReference),n.spatialReference),!(i instanceof te))throw new d(n,c.InvalidParameter,r)}else if(s[0]instanceof te)i=le(s[0].toJSON());else{const u=JSON.parse(s[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=ne(new te(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new d(n,c.WrongSpatialReference,r);return it(i)})},e.point=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);let i=null;if(s[0]instanceof B){if(i=ne(Q.parseGeometryFromDictionary(s[0],n.spatialReference),n.spatialReference),!(i instanceof J))throw new d(n,c.InvalidParameter,r)}else if(s[0]instanceof J)i=le(s[0].toJSON());else{const u=JSON.parse(s[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=ne(new J(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new d(n,c.WrongSpatialReference,r);return it(i)})},e.multipoint=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);let i=null;if(s[0]instanceof B){if(i=ne(Q.parseGeometryFromDictionary(s[0],n.spatialReference),n.spatialReference),!(i instanceof Ie))throw new d(n,c.InvalidParameter,r)}else if(s[0]instanceof Ie)i=le(s[0].toJSON());else{const u=JSON.parse(s[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=ne(new Ie(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new d(n,c.WrongSpatialReference,r);return it(i)})},e.extent=function(n,r){return t(n,r,(a,o,s)=>{var u,l,h;s=G(s),D(s,1,1,n,r);let i=null;if(s[0]instanceof B)i=ne(Q.parseGeometryFromDictionary(s[0],n.spatialReference),n.spatialReference);else if(s[0]instanceof J){const f={xmin:s[0].x,ymin:s[0].y,xmax:s[0].x,ymax:s[0].y,spatialReference:s[0].spatialReference.toJSON()},m=s[0];m.hasZ?(f.zmin=m.z,f.zmax=m.z):m.hasM&&(f.mmin=m.m,f.mmax=m.m),i=le(f)}else if(s[0]instanceof ie)i=le((u=s[0].extent)==null?void 0:u.toJSON());else if(s[0]instanceof te)i=le((l=s[0].extent)==null?void 0:l.toJSON());else if(s[0]instanceof Ie)i=le((h=s[0].extent)==null?void 0:h.toJSON());else if(s[0]instanceof we)i=le(s[0].toJSON());else{const f=JSON.parse(s[0]);f&&!f.spatialReference&&(f.spatialReference=n.spatialReference),i=ne(new we(f),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new d(n,c.WrongSpatialReference,r);return it(i)})},e.geometry=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);let i=null;if(s[0]===null)return null;if(en(s[0]))i=ne(s[0].geometry(),n.spatialReference);else if(s[0]instanceof B)i=ne(Q.parseGeometryFromDictionary(s[0],n.spatialReference),n.spatialReference);else{const u=JSON.parse(s[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=ne(le(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new d(n,c.WrongSpatialReference,r);return it(i)})},e.setgeometry=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,2,2,n,r),!en(s[0]))throw new d(n,c.InvalidParameter,r);if(s[0].immutable===!0)throw new d(n,c.Immutable,r);if(!(s[1]instanceof $||s[1]===null))throw new d(n,c.InvalidParameter,r);return s[0]._geometry=s[1],b})},e.feature=function(n,r){return t(n,r,(a,o,s)=>{if(s.length===0)throw new d(n,c.WrongNumberOfParameters,r);let i=null;if(s.length===1)if(F(s[0]))i=Q.fromJson(JSON.parse(s[0]),n.timeZone);else if(en(s[0]))i=Q.createFromArcadeFeature(s[0]);else if(s[0]instanceof $)i=Q.createFromGraphicLikeObject(s[0],null,null,n.timeZone);else{if(!(s[0]instanceof B))throw new d(n,c.InvalidParameter,r);{let u=s[0].hasField("geometry")?s[0].field("geometry"):null,l=s[0].hasField("attributes")?s[0].field("attributes"):null;u!==null&&u instanceof B&&(u=Q.parseGeometryFromDictionary(u,n.spatialReference)),l!==null&&(l=Q.parseAttributesFromDictionary(l)),i=Q.createFromGraphicLikeObject(u,l,null,n.timeZone)}}else if(s.length===2){let u=null,l=null;if(s[0]!==null)if(s[0]instanceof $)u=s[0];else{if(!(u instanceof B))throw new d(n,c.InvalidParameter,r);u=Q.parseGeometryFromDictionary(s[0],n.spatialReference)}if(s[1]!==null){if(!(s[1]instanceof B))throw new d(n,c.InvalidParameter,r);l=Q.parseAttributesFromDictionary(s[1])}i=Q.createFromGraphicLikeObject(u,l,null,n.timeZone)}else{let u=null;const l={};if(s[0]!==null)if(s[0]instanceof $)u=s[0];else{if(!(u instanceof B))throw new d(n,c.InvalidParameter,r);u=Q.parseGeometryFromDictionary(s[0],n.spatialReference)}for(let h=1;h{if(s.length===0||s.length===1&&s[0]===null){const l=new B;return l.immutable=!1,l}if(s.length===1&&F(s[0]))try{const l=JSON.parse(s[0]),h=B.convertObjectToArcadeDictionary(l,N(n),!1);return h.immutable=!1,h}catch{throw new d(n,c.InvalidParameter,r)}if(s.length===1&&s[0]instanceof $)try{const l=s[0].toJSON();l.hasZ=s[0].hasZ===!0,l.hasM=s[0].hasM===!0;const h=B.convertObjectToArcadeDictionary(l,N(n),!1);return h.immutable=!1,h}catch{throw new d(n,c.InvalidParameter,r)}if(s.length===1&&ee(s[0]))try{const l=new B;l.immutable=!1,l.setField("geometry",s[0].geometry());const h=new B;h.immutable=!1,l.setField("attributes",h);for(const f of s[0].keys())h.setField(f,s[0].field(f));return l}catch{throw new d(n,c.InvalidParameter,r)}if(s.length===1&&s[0]instanceof B)try{const l=new B;l.immutable=!1;for(const h of s[0].keys())l.setField(h,s[0].field(h));return l}catch{throw new d(n,c.InvalidParameter,r)}if(s.length===2&&s[0]instanceof B&&V(s[1]))try{if(s[1]!==!0){const l=new B;l.immutable=!1;for(const h of s[0].keys())l.setField(h,s[0].field(h));return l}return s[0].deepClone()}catch{throw new d(n,c.InvalidParameter,r)}if(s.length%2!=0)throw new d(n,c.WrongNumberOfParameters,r);const i={};for(let l=0;l{D(s,2,2,n,r);const i=A(s[1]);if(en(s[0])||s[0]instanceof B)return s[0].hasField(i);if(s[0]instanceof $){const u=et(s[0],i,null,null,2);return!u||u.keystate!=="notfound"}throw new d(n,c.InvalidParameter,r)})},e.hasvalue=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,2,2,n,r),k(s[1])||M(s[1])){const u=s[1];let l=[];if(M(u))l=u.toArray();else{if(!k(u))throw new d(n,c.InvalidParameter,r);l=u}let h=s[0];if(h===null)return!1;for(const f of l)if(ee(h)){if(F(f)===!1||!h.hasField(f)||(h=h.field(f),h===null))return!1}else if(h instanceof B){if(F(f)===!1||!h.hasField(f)||(h=h.field(f),h===null))return!1}else if(h instanceof $){if(F(f)===!1||(h=et(h,f,null,null,0),h===null))return!1}else if(k(h)){if(L(f)===!1||(h=h[f],h==null))return!1}else if(!M(h)||L(f)===!1||(h=h.get(f),h==null))return!1;return!0}if(s[0]===null||s[1]===null)return!1;const i=A(s[1]);return ee(s[0])||s[0]instanceof B?!!s[0].hasField(i)&&s[0].field(i)!==null:s[0]instanceof $?et(s[0],i,null,null,0)!==null:!1})},e.indexof=function(n,r){return t(n,r,(a,o,s)=>{D(s,2,2,n,r);const i=s[1];if(k(s[0])){for(let u=0;u{if(s=G(s),D(s,2,3,n,r),!(s[0]instanceof J))throw new d(n,c.InvalidParameter,r);if(!(s[1]instanceof J))throw new d(n,c.InvalidParameter,r);if(s.length>2&&!(s[2]instanceof J))throw new d(n,c.InvalidParameter,r);return s.length===2?gs(s[0],s[1]):ws(s[0],s[1],s[2])})},e.bearing=function(n,r){return t(n,r,(a,o,s)=>{if(s=G(s),D(s,2,3,n,r),!(s[0]instanceof J))throw new d(n,c.InvalidParameter,r);if(!(s[1]instanceof J))throw new d(n,c.InvalidParameter,r);if(s.length>2&&!(s[2]instanceof J))throw new d(n,c.InvalidParameter,r);return s.length===2?ys(s[0],s[1]):xs(s[0],s[1],s[2])})},e.isselfintersecting=function(n,r){return t(n,r,(a,o,s)=>{s=G(s),D(s,1,1,n,r);let i=s[0];if(i instanceof ie)return i.isSelfIntersecting;if(i instanceof te)return i=i.paths,Or(i);if(i instanceof Ie){const u=i.points;for(let l=0;l0&&l[0][i]===t)return{partId:a,distanceAlong:o,coordinate:new J({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:l[0][0],y:l[0][1],...e.hasZ?{z:l[0][u]}:{},...e.hasM?{m:l[0][i]}:{}}),segmentId:0};let h=-1;for(let f=1;ft&&t>l[f-1][i]){const T=(t-l[f-1][i])/g*m;let v=e.hasZ?Hi(l[f-1],l[f],T,r):Ki(l[f-1],l[f],T);v=[...v,t];const z=new J({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:v[0],y:v[1],...e.hasZ?{z:v[u]}:{},...e.hasM?{m:v[i]}:{}});return{partId:a,distanceAlong:o+s(l[f-1],[z.x,z.y,...z.hasZ?[z.z]:[],...z.hasM?[z.m]:[]],r),coordinate:z,segmentId:h}}o+=m}}return null}function ks(e,t){if(!e)return null;switch(e.type){case"extent":case"multipoint":case"mesh":case"point":return null}const n=e.type==="polygon"?e.rings:e.paths;if(t<0)return null;let r=1;(e.spatialReference.vcsWkid||e.spatialReference.latestVcsWkid)&&(r=Bt(e.spatialReference)/It(e.spatialReference));let a=0;const o=e.hasZ?3:2,s=2,i=e.hasZ?xe:qi;let u=-1;if(t===0)return n.length===0||n[0].length===0?null:{partId:0,coordinate:new J({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:n[0][0][0],y:n[0][0][1],...e.hasZ?{z:n[0][0][s]}:{},...e.hasM?{m:n[0][0][o]}:{}}),segmentId:0};for(const l of n){u++;let h=-1;for(let f=1;ft){let y=e.hasZ?Hi(l[f-1],l[f],t-a,r):Ki(l[f-1],l[f],t-a);return y=[...y,Hn(l[f-1][o],l[f][o],m,t-a)],{partId:u,coordinate:new J({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:y[0],y:y[1],...e.hasZ?{z:y[s]}:{},...e.hasM?{m:y[o]}:{}}),segmentId:h}}a=g}}return null}function Ts(e,t){if(!e||!t)return null;let n=1;(t.spatialReference.vcsWkid||t.spatialReference.latestVcsWkid)&&(n=Bt(t.spatialReference)/It(t.spatialReference));let r=null,a=0;return r=e,a=e.hasZ&&t.hasZ?xe([t.x,t.y,t.z],[e.x,e.y,e.z],n):Je([t.x,t.y],[e.x,e.y],!1),{coordinate:r,distance:a}}function Bs(e,t){if(!e||!t)return null;let n=1;(t.spatialReference.vcsWkid||t.spatialReference.latestVcsWkid)&&(n=Bt(t.spatialReference)/It(t.spatialReference));let r=null,a=0,o=Number.MAX_VALUE,s=-1,i=-1;for(const u of e.points||[]){i++;const l=e.hasZ&&t.hasZ?Zi([u[0],u[1],u[2]],[t.x,t.y,t.z],n):Gi([u[0],u[1]],[t.x,t.y],!1);l(i=G(i),n(r,a,i),i[0]===null||i[1]===null||Z.disjoint(i[0],i[1])))},e.intersects=function(r,a){return t(r,a,(o,s,i)=>(i=G(i),n(r,a,i),i[0]!==null&&i[1]!==null&&Z.intersects(i[0],i[1])))},e.touches=function(r,a){return t(r,a,(o,s,i)=>(i=G(i),n(r,a,i),i[0]!==null&&i[1]!==null&&Z.touches(i[0],i[1])))},e.crosses=function(r,a){return t(r,a,(o,s,i)=>(i=G(i),n(r,a,i),i[0]!==null&&i[1]!==null&&Z.crosses(i[0],i[1])))},e.within=function(r,a){return t(r,a,(o,s,i)=>(i=G(i),n(r,a,i),i[0]!==null&&i[1]!==null&&Z.within(i[0],i[1])))},e.contains=function(r,a){return t(r,a,(o,s,i)=>(i=G(i),n(r,a,i),i[0]!==null&&i[1]!==null&&Z.contains(i[0],i[1])))},e.overlaps=function(r,a){return t(r,a,(o,s,i)=>(i=G(i),n(r,a,i),i[0]!==null&&i[1]!==null&&Z.overlaps(i[0],i[1])))},e.equals=function(r,a){return t(r,a,(o,s,i)=>(D(i,2,2,r,a),i[0]===i[1]||(i[0]instanceof $&&i[1]instanceof $?Z.equals(i[0],i[1]):(H(i[0])&&H(i[1])||j(i[0])&&j(i[1])||!(!P(i[0])||!P(i[1])))&&i[0].equals(i[1]))))},e.relate=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,3,3,r,a),i[0]instanceof $&&i[1]instanceof $)return Z.relate(i[0],i[1],A(i[2]));if(i[0]instanceof $&&i[1]===null||i[1]instanceof $&&i[0]===null||i[0]===null&&i[1]===null)return!1;throw new d(r,c.InvalidParameter,a)})},e.intersection=function(r,a){return t(r,a,(o,s,i)=>(i=G(i),n(r,a,i),i[0]===null||i[1]===null?null:Z.intersect(i[0],i[1])))},e.union=function(r,a){return t(r,a,(o,s,i)=>{const u=[];if((i=G(i)).length===0)throw new d(r,c.WrongNumberOfParameters,a);if(i.length===1)if(k(i[0])){const l=G(i[0]);for(let h=0;h(i=G(i),n(r,a,i),i[0]!==null&&i[1]===null?Be(i[0]):i[0]===null?null:Z.difference(i[0],i[1])))},e.symmetricdifference=function(r,a){return t(r,a,(o,s,i)=>(i=G(i),n(r,a,i),i[0]===null&&i[1]===null?null:i[0]===null?Be(i[1]):i[1]===null?Be(i[0]):Z.symmetricDifference(i[0],i[1])))},e.clip=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,2,2,r,a),!(i[1]instanceof we)&&i[1]!==null)throw new d(r,c.InvalidParameter,a);if(i[0]===null)return null;if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);return i[1]===null?null:Z.clip(i[0],i[1])})},e.cut=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,2,2,r,a),!(i[1]instanceof te)&&i[1]!==null)throw new d(r,c.InvalidParameter,a);if(i[0]===null)return[];if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);return i[1]===null?[Be(i[0])]:Z.cut(i[0],i[1])})},e.area=function(r,a){return t(r,a,(o,s,i)=>{if(D(i,1,2,r,a),(i=G(i))[0]===null)return 0;if(k(i[0])||M(i[0])){const u=jn(i[0],r.spatialReference);return u===null?0:Z.planarArea(u,Xt(R(i[1],-1)))}if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);return Z.planarArea(i[0],Xt(R(i[1],-1)))})},e.areageodetic=function(r,a){return t(r,a,(o,s,i)=>{if(D(i,1,2,r,a),(i=G(i))[0]===null)return 0;if(k(i[0])||M(i[0])){const u=jn(i[0],r.spatialReference);return u===null?0:Z.geodesicArea(u,Xt(R(i[1],-1)))}if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);return Z.geodesicArea(i[0],Xt(R(i[1],-1)))})},e.length=function(r,a){return t(r,a,(o,s,i)=>{if(D(i,1,2,r,a),(i=G(i))[0]===null)return 0;if(k(i[0])||M(i[0])){const u=We(i[0],r.spatialReference);return u===null?0:Z.planarLength(u,se(R(i[1],-1)))}if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);return Z.planarLength(i[0],se(R(i[1],-1)))})},e.length3d=function(r,a){return t(r,a,(o,s,i)=>{if(D(i,1,2,r,a),(i=G(i))[0]===null)return 0;if(k(i[0])||M(i[0])){const u=We(i[0],r.spatialReference);return u===null?0:u.hasZ===!0?zr(u,se(R(i[1],-1))):Z.planarLength(u,se(R(i[1],-1)))}if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);return i[0].hasZ===!0?zr(i[0],se(R(i[1],-1))):Z.planarLength(i[0],se(R(i[1],-1)))})},e.lengthgeodetic=function(r,a){return t(r,a,(o,s,i)=>{if(D(i,1,2,r,a),(i=G(i))[0]===null)return 0;if(k(i[0])||M(i[0])){const u=We(i[0],r.spatialReference);return u===null?0:Z.geodesicLength(u,se(R(i[1],-1)))}if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);return Z.geodesicLength(i[0],se(R(i[1],-1)))})},e.distance=function(r,a){return t(r,a,(o,s,i)=>{i=G(i),D(i,2,3,r,a);let u=i[0];(k(i[0])||M(i[0]))&&(u=nn(i[0],r.spatialReference));let l=i[1];if((k(i[1])||M(i[1]))&&(l=nn(i[1],r.spatialReference)),!(u instanceof $))throw new d(r,c.InvalidParameter,a);if(!(l instanceof $))throw new d(r,c.InvalidParameter,a);return Z.distance(u,l,se(R(i[2],-1)))})},e.distancegeodetic=function(r,a){return t(r,a,(o,s,i)=>{i=G(i),D(i,2,3,r,a);const u=i[0],l=i[1];if(!(u instanceof J))throw new d(r,c.InvalidParameter,a);if(!(l instanceof J))throw new d(r,c.InvalidParameter,a);const h=new te({paths:[],spatialReference:u.spatialReference});return h.addPath([u,l]),Z.geodesicLength(h,se(R(i[2],-1)))})},e.densify=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);const u=p(i[1]);if(isNaN(u))throw new d(r,c.InvalidParameter,a);if(u<=0)throw new d(r,c.InvalidParameter,a);return i[0]instanceof ie||i[0]instanceof te?Z.densify(i[0],u,se(R(i[2],-1))):i[0]instanceof we?Z.densify(Ur(i[0]),u,se(R(i[2],-1))):i[0]})},e.densifygeodetic=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);const u=p(i[1]);if(isNaN(u))throw new d(r,c.InvalidParameter,a);if(u<=0)throw new d(r,c.InvalidParameter,a);return i[0]instanceof ie||i[0]instanceof te?Z.geodesicDensify(i[0],u,se(R(i[2],-1))):i[0]instanceof we?Z.geodesicDensify(Ur(i[0]),u,se(R(i[2],-1))):i[0]})},e.generalize=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,2,4,r,a),i[0]===null)return null;if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);const u=p(i[1]);if(isNaN(u))throw new d(r,c.InvalidParameter,a);return Z.generalize(i[0],u,Ct(R(i[2],!0)),se(R(i[3],-1)))})},e.buffer=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);const u=p(i[1]);if(isNaN(u))throw new d(r,c.InvalidParameter,a);return u===0?Be(i[0]):Z.buffer(i[0],u,se(R(i[2],-1)))})},e.buffergeodetic=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);const u=p(i[1]);if(isNaN(u))throw new d(r,c.InvalidParameter,a);return u===0?Be(i[0]):Z.geodesicBuffer(i[0],u,se(R(i[2],-1)))})},e.offset=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,2,6,r,a),i[0]===null)return null;if(!(i[0]instanceof ie||i[0]instanceof te))throw new d(r,c.InvalidParameter,a);const u=p(i[1]);if(isNaN(u))throw new d(r,c.InvalidParameter,a);const l=p(R(i[4],10));if(isNaN(l))throw new d(r,c.InvalidParameter,a);const h=p(R(i[5],0));if(isNaN(h))throw new d(r,c.InvalidParameter,a);return Z.offset(i[0],u,se(R(i[2],-1)),A(R(i[3],"round")).toLowerCase(),l,h)})},e.rotate=function(r,a){return t(r,a,(o,s,i)=>{i=G(i),D(i,2,3,r,a);let u=i[0];if(u===null)return null;if(!(u instanceof $))throw new d(r,c.InvalidParameter,a);u instanceof we&&(u=ie.fromExtent(u));const l=p(i[1]);if(isNaN(l))throw new d(r,c.InvalidParameter,a);const h=R(i[2],null);if(h===null)return Z.rotate(u,l);if(h instanceof J)return Z.rotate(u,l,h);throw new d(r,c.InvalidParameter,a)})},e.centroid=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,1,1,r,a),i[0]===null)return null;let u=i[0];if((k(i[0])||M(i[0]))&&(u=nn(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof $))throw new d(r,c.InvalidParameter,a);return u instanceof J?ne(Be(i[0]),r.spatialReference):u instanceof ie?u.centroid:u instanceof te?hs(u):u instanceof Ie?ps(u):u instanceof we?u.center:null})},e.measuretocoordinate=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,2,2,r,a),i[0]===null)return null;let u=i[0];if((k(i[0])||M(i[0]))&&(u=We(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof $))throw new d(r,c.InvalidParameter,a);if(!(u instanceof te))throw new d(r,c.InvalidParameter,a);if(L(i[1]===!1))throw new d(r,c.InvalidParameter,a);const l=Is(u,i[1]);return l?B.convertObjectToArcadeDictionary(l,N(r),!1,!0):null})},e.pointtocoordinate=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,2,2,r,a),i[0]===null)return null;let u=i[0];if((k(i[0])||M(i[0]))&&(u=We(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof $))throw new d(r,c.InvalidParameter,a);if(!(u instanceof te))throw new d(r,c.InvalidParameter,a);const l=i[1];if(l===null)return null;if(!(l instanceof J))throw new d(r,c.InvalidParameter,a);if(L(i[1]===!1))throw new d(r,c.InvalidParameter,a);const h=Ms(u,l);return h?B.convertObjectToArcadeDictionary(h,N(r),!1,!0):null})},e.distancetocoordinate=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,2,2,r,a),i[0]===null)return null;let u=i[0];if((k(i[0])||M(i[0]))&&(u=We(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof $))throw new d(r,c.InvalidParameter,a);if(!(u instanceof te))throw new d(r,c.InvalidParameter,a);if(L(i[1]===!1))throw new d(r,c.InvalidParameter,a);const l=ks(u,i[1]);return l?B.convertObjectToArcadeDictionary(l,N(r),!1,!0):null})},e.multiparttosinglepart=function(r,a){return t(r,a,(o,s,i)=>{i=G(i),D(i,1,1,r,a);const u=[];if(i[0]===null)return null;if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);if(i[0]instanceof J)return[ne(Be(i[0]),r.spatialReference)];if(i[0]instanceof we)return[ne(Be(i[0]),r.spatialReference)];const l=Z.simplify(i[0]);if(l instanceof ie){const h=[],f=[];for(let m=0;m{if(i=G(i),D(i,1,1,r,a),i[0]===null)return!0;if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);return Z.isSimple(i[0])})},e.simplify=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,1,1,r,a),i[0]===null)return null;if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);return Z.simplify(i[0])})},e.convexhull=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,1,1,r,a),i[0]===null)return null;if(!(i[0]instanceof $))throw new d(r,c.InvalidParameter,a);return Z.convexHull(i[0])})},e.nearestcoordinate=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,2,2,r,a),!(i[0]instanceof $||i[0]===null))throw new d(r,c.InvalidParameter,a);if(!(i[1]instanceof J||i[1]===null))throw new d(r,c.InvalidParameter,a);if(i[0]===null||i[1]===null)return null;const u=Z.nearestCoordinate(i[0],i[1]);return u===null||u.isEmpty?null:B.convertObjectToArcadeDictionary({coordinate:u.coordinate,distance:u.distance,sideOfLine:u.distance===0?"straddle":u.isRightSide?"right":"left"},N(r),!1,!0)})},e.nearestvertex=function(r,a){return t(r,a,(o,s,i)=>{if(i=G(i),D(i,2,2,r,a),!(i[0]instanceof $||i[0]===null))throw new d(r,c.InvalidParameter,a);if(!(i[1]instanceof J||i[1]===null))throw new d(r,c.InvalidParameter,a);if(i[0]===null||i[1]===null)return null;const u=Z.nearestVertex(i[0],i[1]);return u===null||u.isEmpty?null:B.convertObjectToArcadeDictionary({coordinate:u.coordinate,distance:u.distance,sideOfLine:u.distance===0?"straddle":u.isRightSide?"right":"left"},N(r),!1,!0)})}}function Sn(e,t,n){return n===void 0||+n==0?Math[e](t):(t=+t,n=+n,isNaN(t)||typeof n!="number"||n%1!=0?NaN:(t=t.toString().split("e"),+((t=(t=Math[e](+(t[0]+"e"+(t[1]?+t[1]-n:-n)))).toString().split("e"))[0]+"e"+(t[1]?+t[1]+n:n))))}function Yi(e,t){function n(r,a,o){const s=p(r);return isNaN(s)?s:isNaN(a)||isNaN(o)||a>o?NaN:so?o:s}e.number=function(r,a){return t(r,a,(o,s,i)=>{D(i,1,2,r,a);const u=i[0];if(L(u))return u;if(u===null)return 0;if(H(u)||j(u)||P(u))return u.toNumber();if(V(u))return Number(u);if(k(u))return NaN;if(u===""||u===void 0)return Number(u);if(F(u)){if(i[1]!==void 0){let l=tt(i[1],"‰","");return l=tt(l,"¤",""),gi(u,{pattern:l})}return Number(u.trim())}return Number(u)})},e.abs=function(r,a){return t(r,a,(o,s,i)=>(D(i,1,1,r,a),Math.abs(p(i[0]))))},e.acos=function(r,a){return t(r,a,(o,s,i)=>(D(i,1,1,r,a),Math.acos(p(i[0]))))},e.asin=function(r,a){return t(r,a,(o,s,i)=>(D(i,1,1,r,a),Math.asin(p(i[0]))))},e.atan=function(r,a){return t(r,a,(o,s,i)=>(D(i,1,1,r,a),Math.atan(p(i[0]))))},e.atan2=function(r,a){return t(r,a,(o,s,i)=>(D(i,2,2,r,a),Math.atan2(p(i[0]),p(i[1]))))},e.ceil=function(r,a){return t(r,a,(o,s,i)=>{if(D(i,1,2,r,a),i.length===2){let u=p(i[1]);return isNaN(u)&&(u=0),Sn("ceil",p(i[0]),-1*u)}return Math.ceil(p(i[0]))})},e.round=function(r,a){return t(r,a,(o,s,i)=>{if(D(i,1,2,r,a),i.length===2){let u=p(i[1]);return isNaN(u)&&(u=0),Sn("round",p(i[0]),-1*u)}return Math.round(p(i[0]))})},e.floor=function(r,a){return t(r,a,(o,s,i)=>{if(D(i,1,2,r,a),i.length===2){let u=p(i[1]);return isNaN(u)&&(u=0),Sn("floor",p(i[0]),-1*u)}return Math.floor(p(i[0]))})},e.cos=function(r,a){return t(r,a,(o,s,i)=>(D(i,1,1,r,a),Math.cos(p(i[0]))))},e.isnan=function(r,a){return t(r,a,(o,s,i)=>(D(i,1,1,r,a),typeof i[0]=="number"&&isNaN(i[0])))},e.exp=function(r,a){return t(r,a,(o,s,i)=>(D(i,1,1,r,a),Math.exp(p(i[0]))))},e.log=function(r,a){return t(r,a,(o,s,i)=>(D(i,1,1,r,a),Math.log(p(i[0]))))},e.pow=function(r,a){return t(r,a,(o,s,i)=>(D(i,2,2,r,a),p(i[0])**p(i[1])))},e.random=function(r,a){return t(r,a,(o,s,i)=>(D(i,0,0,r,a),Math.random()))},e.sin=function(r,a){return t(r,a,(o,s,i)=>(D(i,1,1,r,a),Math.sin(p(i[0]))))},e.sqrt=function(r,a){return t(r,a,(o,s,i)=>(D(i,1,1,r,a),Math.sqrt(p(i[0]))))},e.tan=function(r,a){return t(r,a,(o,s,i)=>(D(i,1,1,r,a),Math.tan(p(i[0]))))},e.isempty=function(r,a){return t(r,a,(o,s,i)=>(D(i,1,1,r,a),i[0]===null||i[0]===""||i[0]===void 0||i[0]===b))},e.boolean=function(r,a){return t(r,a,(o,s,i)=>{D(i,1,1,r,a);const u=i[0];return Ct(u)})},e.constrain=function(r,a){return t(r,a,(o,s,i)=>{D(i,3,3,r,a);const u=p(i[1]),l=p(i[2]);if(k(i[0])){const h=[];for(const f of i[0])h.push(n(f,u,l));return h}if(M(i[0])){const h=[];for(let f=0;f=t&&t!==-1)return n}return n}function In(e,t,n=1e3){switch(e.toLowerCase()){case"distinct":return Rs(t,n);case"avg":case"mean":return Xi(rt(t));case"min":return Math.min.apply(Math,rt(t));case"sum":return _s(rt(t));case"max":return Math.max.apply(Math,rt(t));case"stdev":case"stddev":return Math.sqrt(Zr(rt(t)));case"var":case"variance":return Zr(rt(t));case"count":return t.length}return 0}function Ke(e,t,n,r){if(r.length===1){if(k(r[0]))return In(e,r[0],-1);if(M(r[0]))return In(e,r[0].toArray(),-1)}return In(e,r,-1)}function Qi(e,t){e.stdev=function(n,r){return t(n,r,(a,o,s)=>Ke("stdev",a,o,s))},e.variance=function(n,r){return t(n,r,(a,o,s)=>Ke("variance",a,o,s))},e.average=function(n,r){return t(n,r,(a,o,s)=>Ke("mean",a,o,s))},e.mean=function(n,r){return t(n,r,(a,o,s)=>Ke("mean",a,o,s))},e.sum=function(n,r){return t(n,r,(a,o,s)=>Ke("sum",a,o,s))},e.min=function(n,r){return t(n,r,(a,o,s)=>Ke("min",a,o,s))},e.max=function(n,r){return t(n,r,(a,o,s)=>Ke("max",a,o,s))},e.distinct=function(n,r){return t(n,r,(a,o,s)=>Ke("distinct",a,o,s))},e.count=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,1,1,n,r),k(s[0])||F(s[0]))return s[0].length;if(M(s[0]))return s[0].length();throw new d(n,c.InvalidParameter,r)})}}let Kn=class extends B{constructor(t){super(),this.declaredClass="esri.arcade.Portal",this.immutable=!1,this.setField("url",t),this.immutable=!0}},Ls=class ea extends B{constructor(t,n,r,a,o,s,i){super(),this.attachmentUrl=o,this.declaredClass="esri.arcade.Attachment",this.immutable=!1,this.setField("id",t),this.setField("name",n),this.setField("contenttype",r),this.setField("size",a),this.setField("exifinfo",s),this.setField("keywords",i),this.immutable=!0}deepClone(){var t;return new ea(this.field("id"),this.field("name"),this.field("contenttype"),this.field("size"),this.attachmentUrl,((t=this.field("exifinfo"))==null?void 0:t.deepClone())??null,this.field("keywords"))}};const yr=e=>(t,n,r)=>(r=r||14,+e(t,n).toFixed(r)),Ps=(e,t)=>e+t,Os=(e,t)=>e*t,Us=(e,t)=>e/t,Gr=(e,t,n)=>yr(Ps)(e,t,n),wt=(e,t,n)=>yr(Os)(e,t,n),cn=(e,t,n)=>yr(Us)(e,t,n),fn=360,zs=400,Zs=2*Math.PI,$e=3600,jr=3240,zt=60,Qe=60,Jr=180*$e/Math.PI,Lt=fn*zt*Qe,kn=90*$e,dt=180*$e,Gs=270*$e,ta="ᵍ",Pt="°";function Nt(e){if(F(e)===!1)throw new d(null,c.InvalidParameter,null);return e}function Wn(e,t){const n=10**t;return Math.round(e*n)/n}function js(e,t){return e%t}function ht(e){const t=parseFloat(e.toString().replace(Math.trunc(e).toString(),"0"))*Math.sign(e);return e<0?{fraction:t,integer:Math.ceil(e)}:{fraction:t,integer:Math.floor(e)}}var Y,w,K,Yn;function yt(e,t){switch(e){case Y.north:return t==="SHORT"?"N":"North";case Y.east:return t==="SHORT"?"E":"East";case Y.south:return t==="SHORT"?"S":"South";case Y.west:return t==="SHORT"?"W":"West"}}function Tn(e,t){return e-Math.floor(e/t)*t}function Bn(e){switch(e){case w.truncated_degrees:case w.decimal_degrees:return fn;case w.radians:return Zs;case w.gradians:return zs;case w.seconds:return Lt;case w.fractional_degree_minutes:return zt;case w.fractional_minute_seconds:return Qe;default:throw new d(null,c.LogicError,null,{reason:"unsupported evaluations"})}}function Vr(e){switch(e.toUpperCase().trim()){case"NORTH":case"NORTHAZIMUTH":case"NORTH AZIMUTH":return K.north_azimuth;case"POLAR":return K.polar;case"QUADRANT":return K.quadrant;case"SOUTH":case"SOUTHAZIMUTH":case"SOUTH AZIMUTH":return K.south_azimuth}throw new d(null,c.LogicError,null,{reason:"unsupported directionType"})}function qr(e){switch(e.toUpperCase().trim()){case"D":case"DD":case"DECIMALDEGREE":case"DECIMAL DEGREE":case"DEGREE":case"DECIMALDEGREES":case"DECIMAL DEGREES":case"DEGREES":return w.decimal_degrees;case"DMS":case"DEGREESMINUTESSECONDS":case"DEGREES MINUTES SECONDS":return w.degrees_minutes_seconds;case"R":case"RAD":case"RADS":case"RADIAN":case"RADIANS":return w.radians;case"G":case"GON":case"GONS":case"GRAD":case"GRADS":case"GRADIAN":case"GRADIANS":return w.gradians}throw new d(null,c.LogicError,null,{reason:"unsupported units"})}(function(e){e[e.north=0]="north",e[e.east=1]="east",e[e.south=2]="south",e[e.west=3]="west"})(Y||(Y={})),function(e){e[e.decimal_degrees=1]="decimal_degrees",e[e.seconds=2]="seconds",e[e.degrees_minutes_seconds=3]="degrees_minutes_seconds",e[e.radians=4]="radians",e[e.gradians=5]="gradians",e[e.truncated_degrees=6]="truncated_degrees",e[e.fractional_degree_minutes=7]="fractional_degree_minutes",e[e.fractional_minute_seconds=8]="fractional_minute_seconds"}(w||(w={})),function(e){e[e.north_azimuth=1]="north_azimuth",e[e.polar=2]="polar",e[e.quadrant=3]="quadrant",e[e.south_azimuth=4]="south_azimuth"}(K||(K={})),function(e){e[e.meridian=0]="meridian",e[e.direction=1]="direction"}(Yn||(Yn={}));let Et=class sn{constructor(t,n,r){this.m_degrees=t,this.m_minutes=n,this.m_seconds=r}getField(t){switch(t){case w.decimal_degrees:case w.truncated_degrees:return this.m_degrees;case w.fractional_degree_minutes:return this.m_minutes;case w.seconds:case w.fractional_minute_seconds:return this.m_seconds;default:throw new d(null,c.LogicError,null,{reason:"unexpected evaluation"})}}static secondsToDMS(t){const n=ht(t).fraction;let r=ht(t).integer;const a=Math.floor(r/$e);r-=a*$e;const o=Math.floor(r/Qe);return r-=o*Qe,new sn(a,o,r+n)}static numberToDms(t){const n=ht(t).fraction,r=ht(t).integer,a=wt(ht(100*n).fraction,100),o=ht(100*n).integer;return new sn(r,o,a)}format(t,n){let r=Wn(this.m_seconds,n),a=this.m_minutes,o=this.m_degrees;if(t===w.seconds||t===w.fractional_minute_seconds)Qe<=r&&(r-=Qe,++a),zt<=a&&(a=0,++o),fn<=o&&(o=0);else if(t===w.fractional_degree_minutes)r=0,a=30<=this.m_seconds?this.m_minutes+1:this.m_minutes,o=this.m_degrees,zt<=a&&(a=0,++o),fn<=o&&(o=0);else if(t===w.decimal_degrees||t===w.truncated_degrees){const s=cn(this.m_seconds,$e),i=cn(this.m_minutes,zt);o=Math.round(this.m_degrees+i+s),a=0,r=0}return new sn(o,a,r)}static dmsToSeconds(t,n,r){return t*$e+n*Qe+r}},Js=class{constructor(t,n,r){this.meridian=t,this.angle=n,this.direction=r}fetchAzimuth(t){return t===Yn.meridian?this.meridian:this.direction}},Ye=class Ge{constructor(t){this._angle=t}static createFromAngleAndDirection(t,n){return new Ge(new Le(Ge._convertDirectionFormat(t.extractAngularUnits(w.seconds),n,K.north_azimuth)))}getAngle(t){const n=this._angle.extractAngularUnits(w.seconds);switch(t){case K.north_azimuth:case K.south_azimuth:case K.polar:return new Le(Ge._convertDirectionFormat(n,K.north_azimuth,t));case K.quadrant:{const r=Ge.secondsNorthAzimuthToQuadrant(n);return new Le(r.angle)}}}getMeridian(t){const n=this._angle.extractAngularUnits(w.seconds);switch(t){case K.north_azimuth:return Y.north;case K.south_azimuth:return Y.south;case K.polar:return Y.east;case K.quadrant:return Ge.secondsNorthAzimuthToQuadrant(n).meridian}}getDirection(t){const n=this._angle.extractAngularUnits(w.seconds);switch(t){case K.north_azimuth:return Y.east;case K.south_azimuth:return Y.west;case K.polar:return Y.north;case K.quadrant:return Ge.secondsNorthAzimuthToQuadrant(n).direction}}static secondsNorthAzimuthToQuadrant(t){const n=t<=kn||t>=Gs?Y.north:Y.south,r=n===Y.north?Math.min(Lt-t,t):Math.abs(t-dt),a=t>dt?Y.west:Y.east;return new Js(n,r,a)}static createFromAngleMeridianAndDirection(t,n,r){return new Ge(new Le(Ge.secondsQuadrantToNorthAzimuth(t.extractAngularUnits(w.seconds),n,r)))}static secondsQuadrantToNorthAzimuth(t,n,r){return n===Y.north?r===Y.east?t:Lt-t:r===Y.east?dt-t:dt+t}static _convertDirectionFormat(t,n,r){let a=0;switch(n){case K.north_azimuth:a=t;break;case K.polar:a=kn-t;break;case K.quadrant:throw new d(null,c.LogicError,null,{reason:"unexpected evaluation"});case K.south_azimuth:a=t+dt}let o=0;switch(r){case K.north_azimuth:o=a;break;case K.polar:o=kn-a;break;case K.quadrant:throw new d(null,c.LogicError,null,{reason:"unexpected evaluation"});case K.south_azimuth:o=a-dt}return o=js(o,Lt),o<0?Lt+o:o}};function Hr(e,t,n){let r=null;switch(t){case w.decimal_degrees:r=wt(e,$e);break;case w.seconds:r=e;break;case w.gradians:r=wt(e,jr);break;case w.radians:r=wt(e,Jr);break;default:throw new d(null,c.LogicError,null,{reason:"unexpected evaluation"})}switch(n){case w.decimal_degrees:return cn(r,$e);case w.seconds:return r;case w.gradians:return cn(r,jr);case w.radians:return r/Jr;default:throw new d(null,c.LogicError,null,{reason:"unexpected evaluation"})}}let Le=class Xn{constructor(t){this._seconds=t}static createFromAngleAndUnits(t,n){return new Xn(Hr(t,n,w.seconds))}extractAngularUnits(t){return Hr(this._seconds,w.seconds,Jt(t))}static createFromDegreesMinutesSeconds(t,n,r){return new Xn(Gr(Gr(wt(t,$e),wt(n,Qe)),r))}};function Jt(e){switch(mi(e),e){case w.decimal_degrees:case w.truncated_degrees:case w.degrees_minutes_seconds:return w.decimal_degrees;case w.gradians:return w.gradians;case w.fractional_degree_minutes:return w.fractional_degree_minutes;case w.radians:return w.radians;case w.seconds:case w.fractional_minute_seconds:return w.seconds}}let Vs=class na{constructor(t,n,r,a){this.view=t,this.angle=n,this.merdian=r,this.direction=a,this._dms=null,this._formattedDms=null}static createFromStringAndBearing(t,n,r){return new na(t,n.getAngle(r),n.getMeridian(r),n.getDirection(r))}fetchAngle(){return this.angle}fetchMeridian(){return this.merdian}fetchDirection(){return this.direction}fetchView(){return this.view}fetchDms(){return this._dms===null&&this._calculateDms(),this._dms}fetchFormattedDms(){return this._formattedDms===null&&this._calculateDms(),this._formattedDms}_calculateDms(){let t=null,n=w.truncated_degrees,r=0;for(let a=0;a0?1:0),"0");case w.truncated_degrees:case w.fractional_degree_minutes:return o=Tn(a.fetchFormattedDms().getField(t),Bn(t)),o.toFixed(r).padStart(n+r+(r>0?1:0),"0");case w.fractional_minute_seconds:return o=Tn(Wn(a.fetchDms().getField(t),r),Bn(t)),o.toFixed(r).padStart(n+r+(r>0?1:0),"0");default:throw new d(null,c.LogicError,null,{reason:"unexpected evaluation"})}}function Hs(e,t,n){if(n===K.quadrant)throw new d(null,c.LogicError,null,{reason:"conversion error"});if(t===w.degrees_minutes_seconds){const r=Et.numberToDms(e);return Ye.createFromAngleAndDirection(Le.createFromDegreesMinutesSeconds(r.m_degrees,r.m_minutes,r.m_seconds),n)}return Ye.createFromAngleAndDirection(Le.createFromAngleAndUnits(e,Jt(t)),n)}function Ks(e){switch(p(e)){case 1:return{first:Y.north,second:Y.east};case 2:return{first:Y.south,second:Y.east};case 3:return{first:Y.south,second:Y.west};case 4:return{first:Y.north,second:Y.west}}return null}function Kr(e){switch(e.toUpperCase().trim()){case"N":case"NORTH":return Y.north;case"E":case"EAST":return Y.east;case"S":case"SOUTH":return Y.south;case"W":case"WEST":return Y.west}return null}function pt(e){const t=parseFloat(e);if(L(t)){if(isNaN(t))throw new d(null,c.LogicError,null,{reason:"invalid conversion"});return t}throw new d(null,c.LogicError,null,{reason:"invalid conversion"})}function $n(e,t,n){const r=n===K.quadrant;let a=null,o=null,s=0,i=0,u=0;if(r){if(e.length<2)throw new d(null,c.LogicError,null,{reason:"conversion error"});u=1;const l=Ks(A(e[e.length-1]));if(l?(a=l.first,o=l.second):(s=1,a=Kr(A(e[0])),o=Kr(A(e[e.length-1]))),a===null||o===null)throw new d(null,c.LogicError,null,{reason:"invalid conversion"})}switch(t){case w.decimal_degrees:case w.radians:case w.gradians:if(e.length===0)throw new d(null,c.LogicError,null,{reason:"invalid conversion"});return r?Ye.createFromAngleMeridianAndDirection(Le.createFromAngleAndUnits(pt(e[s]),Jt(t)),a,o):Ye.createFromAngleAndDirection(Le.createFromAngleAndUnits(pt(e[s]),Jt(t)),n);case w.degrees_minutes_seconds:if(i=e.length-u-s,i===3){const l=Le.createFromDegreesMinutesSeconds(pt(e[s]),pt(e[s+1]),pt(e[s+2]));return r?Ye.createFromAngleMeridianAndDirection(l,a,o):Ye.createFromAngleAndDirection(l,n)}if(i===1){const l=pt(e[s]),h=Et.numberToDms(l),f=Le.createFromDegreesMinutesSeconds(h.m_degrees,h.m_minutes,h.m_seconds);return r?Ye.createFromAngleMeridianAndDirection(f,a,o):Ye.createFromAngleAndDirection(f,n)}}throw new d(null,c.LogicError,null,{reason:"invalid conversion"})}function Ws(e){const t=new Set([" ","-","/","'",'"',"\\","^",Pt,ta," ","\r",` `,"*"]);let n="";for(let r=0;rr!=="")}function Ys(e,t,n){if(L(e))return Hs(p(e),t,n);if(F(e))return $n(Ws(e),t,n);if(k(e))return $n(e,t,n);if(M(e))return $n(e.toArray(),t,n);throw new d(null,c.LogicError,null,{reason:"conversion error"})}function Xs(e,t,n){const r=Jt(n);if(r&&n!==w.degrees_minutes_seconds)return e.getAngle(t).extractAngularUnits(r);throw new d(null,c.LogicError,null,{reason:"conversion error"})}function Qs(e,t,n){const r=e.getAngle(t);if(t===K.quadrant&&n===w.degrees_minutes_seconds){const a=Et.secondsToDMS(r.extractAngularUnits(w.seconds));return[yt(e.getMeridian(t),"SHORT"),a.m_degrees,a.m_minutes,a.m_seconds,yt(e.getDirection(t),"SHORT")]}if(n===w.degrees_minutes_seconds){const a=Et.secondsToDMS(r.extractAngularUnits(w.seconds));return[a.m_degrees,a.m_minutes,a.m_seconds]}return t===K.quadrant?[yt(e.getMeridian(t),"SHORT"),r.extractAngularUnits(n),yt(e.getDirection(t),"SHORT")]:[r.extractAngularUnits(n)]}function eo(e,t){let n="";switch(e){case w.decimal_degrees:n=t===K.quadrant?"DD.DD"+Pt:"DDD.DD"+Pt;break;case w.degrees_minutes_seconds:n=t===K.quadrant?"dd"+Pt+` mm' ss"`:"ddd"+Pt+` mm' ss.ss"`;break;case w.radians:n="R.RR";break;case w.gradians:n="GGG.GG"+ta;break;default:throw new d(null,c.LogicError,null,{reason:"conversion error"})}return t===K.quadrant&&(n="p "+n+" b"),n}function Qn(e,t,n){const r={padding:0,rounding:0,newpos:t};let a=!1;for(;t>6,128|63&a):a<55296||a>=57344?t.push(224|a>>12,128|a>>6&63,128|63&a):(n++,a=65536+((1023&a)<<10|1023&e.charCodeAt(n)),t.push(240|a>>18,128|a>>12&63,128|a>>6&63,128|63&a))}return new Uint8Array(t)}let io=class{constructor(t){this._seed=t,this._totallen=0,this._bufs=[],this.init()}init(){return this._bufs=[],this._totallen=0,this}updateFloatArray(t){const n=[];for(const r of t)isNaN(r)?n.push("NaN"):r===1/0?n.push("Infinity"):r===-1/0?n.push("-Infinity"):r===0?n.push("0"):n.push(r.toString(16));this.update(Xr(n.join("")))}updateIntArray(t){const n=Int32Array.from(t);this.update(new Uint8Array(n.buffer))}updateUint8Array(t){this.update(Uint8Array.from(t))}updateWithString(t){return this.update(Xr(t))}update(t){return this._bufs.push(t),this._totallen+=t.length,this}digest(){const t=new Uint8Array(this._totallen);let n=0;for(const r of this._bufs)t.set(r,n),n+=r.length;return this.init(),this._xxHash32(t,this._seed)}_xxHash32(t,n=0){const r=t;let a=n+Yr&4294967295,o=0;if(r.length>=16){const i=[n+mt+Dt&4294967295,n+Dt&4294967295,n+0&4294967295,n-mt&4294967295],u=t,l=u.length-16;let h=0;for(o=0;(4294967280&o)<=l;o+=4){const f=o,m=u[f]+(u[f+1]<<8),g=u[f+2]+(u[f+3]<<8),y=m*Dt+(g*Dt<<16);let T=i[h]+y&4294967295;T=T<<13|T>>>19;const v=65535&T,z=T>>>16;i[h]=v*mt+(z*mt<<16)&4294967295,h=h+1&3}a=(i[0]<<1|i[0]>>>31)+(i[1]<<7|i[1]>>>25)+(i[2]<<12|i[2]>>>20)+(i[3]<<18|i[3]>>>14)&4294967295}a=a+t.length&4294967295;const s=t.length-4;for(;o<=s;o+=4){const i=o,u=r[i]+(r[i+1]<<8),l=r[i+2]+(r[i+3]<<8);a=a+(u*tn+(l*tn<<16))&4294967295,a=a<<17|a>>>15,a=(65535&a)*Wr+((a>>>16)*Wr<<16)&4294967295}for(;o>>21,a=(65535&a)*mt+((a>>>16)*mt<<16)&4294967295;return a^=a>>>15,a=((65535&a)*Dt&4294967295)+((a>>>16)*Dt<<16),a^=a>>>13,a=((65535&a)*tn&4294967295)+((a>>>16)*tn<<16),a^=a>>>16,a<0?a+4294967296:a}};function ao(e){var t;return e.loadStatus==="loaded"&&((t=e.user)!=null&&t.sourceJSON)?e.user.sourceJSON:null}function so(e,t){return!!e&&La(e,(t==null?void 0:t.restUrl)||"")}function Qr(e,t){if(!e||!t)return e===t;if(e.x===t.x&&e.y===t.y){if(e.hasZ){if(e.z!==t.z)return!1}else if(t.hasZ)return!1;if(e.hasM){if(e.m!==t.m)return!1}else if(t.hasM)return!1;return!0}return!1}function Se(e,t,n){if(e!==null)if(k(e)){if(t.updateUint8Array([61]),n.map.has(e)){const r=n.map.get(e);t.updateIntArray([61237541^r])}else{n.map.set(e,n.currentLength++);for(const r of e)Se(r,t,n);n.map.delete(e),n.currentLength--}t.updateUint8Array([199])}else if(M(e)){if(t.updateUint8Array([61]),n.map.has(e)){const r=n.map.get(e);t.updateIntArray([61237541^r])}else{n.map.set(e,n.currentLength++);for(const r of e.toArray())Se(r,t,n);n.map.delete(e),n.currentLength--}t.updateUint8Array([199])}else{if(H(e))return t.updateIntArray([e.toNumber()]),void t.updateUint8Array([241]);if(P(e))return t.updateIntArray([e.toNumber()]),void t.updateIntArray([257]);if(j(e))return t.updateIntArray([e.toNumber()]),void t.updateIntArray([263]);if(F(e))return t.updateIntArray([e.length]),t.updateWithString(e),void t.updateUint8Array([41]);if(V(e))t.updateUint8Array([e===!0?1:0,113]);else{if(L(e))return t.updateFloatArray([e]),void t.updateUint8Array([173]);if(e instanceof Ls)throw new d(n.context,c.UnsupportedHashType,n.node);if(e instanceof Kn)throw new d(n.context,c.UnsupportedHashType,n.node);if(!(e instanceof B)){if(ee(e))throw new d(n.context,c.UnsupportedHashType,n.node);if(e instanceof J)return t.updateIntArray([3833836621]),t.updateIntArray([0]),t.updateFloatArray([e.x]),t.updateIntArray([1]),t.updateFloatArray([e.y]),e.hasZ&&(t.updateIntArray([2]),t.updateFloatArray([e.z])),e.hasM&&(t.updateIntArray([3]),t.updateFloatArray([e.m])),t.updateIntArray([3765347959]),void Se(e.spatialReference.wkid,t,n);if(e instanceof ie){t.updateIntArray([1266616829]);for(let r=0;r(D(s,1,1,n,r),new Kn(A(s[0]))))},e.typeof=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);const i=cr(s[0]);if(i==="Unrecognized Type")throw new d(n,c.UnrecognizedType,r);return i})},e.trim=function(n,r){return t(n,r,(a,o,s)=>(D(s,1,1,n,r),A(s[0]).trim()))},e.tohex=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);const i=p(s[0]);return isNaN(i)?i:i.toString(16)})},e.upper=function(n,r){return t(n,r,(a,o,s)=>(D(s,1,1,n,r),A(s[0]).toUpperCase()))},e.proper=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,2,n,r);let i=1;s.length===2&&A(s[1]).toLowerCase()==="firstword"&&(i=2);const u=/\s/,l=A(s[0]);let h="",f=!0;for(let m=0;m(D(s,1,1,n,r),A(s[0]).toLowerCase()))},e.guid=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,0,1,n,r),s.length>0)switch(A(s[0]).toLowerCase()){case"digits":return gt().replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return gt();case"digits-hyphen-braces":return"{"+gt()+"}";case"digits-hyphen-parentheses":return"("+gt()+")"}return"{"+gt()+"}"})},e.standardizeguid=function(n,r){return t(n,r,(a,o,s)=>{D(s,2,2,n,r);let i=A(s[0]);if(i===""||i===null)return"";const u=/^(\{|\()?(?[0-9a-z]{8})(\-?)(?[0-9a-z]{4})(\-?)(?[0-9a-z]{4})(\-?)(?[0-9a-z]{4})(\-?)(?[0-9a-z]{12})(\}|\))?$/gim.exec(i);if(!u)return"";const l=u.groups;switch(i=l.partA+"-"+l.partB+"-"+l.partC+"-"+l.partD+"-"+l.partE,A(s[1]).toLowerCase()){case"digits":return i.replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return i;case"digits-hyphen-braces":return"{"+i+"}";case"digits-hyphen-parentheses":return"("+i+")"}return"{"+i+"}"})},e.console=function(n,r){return t(n,r,(a,o,s)=>(s.length===0||(s.length===1?n.console(A(s[0])):n.console(A(s))),b))},e.mid=function(n,r){return t(n,r,(a,o,s)=>{D(s,2,3,n,r);let i=p(s[1]);if(isNaN(i))return"";if(i<0&&(i=0),s.length===2)return A(s[0]).substr(i);let u=p(s[2]);return isNaN(u)?"":(u<0&&(u=0),A(s[0]).substr(i,u))})},e.find=function(n,r){return t(n,r,(a,o,s)=>{D(s,2,3,n,r);let i=0;if(s.length>2){if(i=p(R(s[2],0)),isNaN(i))return-1;i<0&&(i=0)}return A(s[1]).indexOf(A(s[0]),i)})},e.left=function(n,r){return t(n,r,(a,o,s)=>{D(s,2,2,n,r);let i=p(s[1]);return isNaN(i)?"":(i<0&&(i=0),A(s[0]).substr(0,i))})},e.right=function(n,r){return t(n,r,(a,o,s)=>{D(s,2,2,n,r);let i=p(s[1]);return isNaN(i)?"":(i<0&&(i=0),A(s[0]).substr(-1*i,i))})},e.split=function(n,r){return t(n,r,(a,o,s)=>{let i;D(s,2,4,n,r);let u=p(R(s[2],-1));const l=Ct(R(s[3],!1));if(u===-1||u===null||l===!0?i=A(s[0]).split(A(s[1])):(isNaN(u)&&(u=-1),u<-1&&(u=-1),i=A(s[0]).split(A(s[1]),u)),l===!1)return i;const h=[];for(let f=0;f=u);f++)i[f]!==""&&i[f]!==void 0&&h.push(i[f]);return h})},e.text=function(n,r){return t(n,r,(a,o,s)=>(D(s,1,2,n,r),Ee(s[0],s[1])))},e.concatenate=function(n,r){return t(n,r,(a,o,s)=>{const i=[];if(s.length<1)return"";if(k(s[0])){const u=R(s[2],"");for(let l=0;l1?i.join(s[1]):i.join("")}if(M(s[0])){const u=R(s[2],"");for(let l=0;l1?i.join(s[1]):i.join("")}for(let u=0;u{if(D(s,1,1,n,r),k(s[0])){const i=s[0].slice(0);return i.reverse(),i}if(M(s[0])){const i=s[0].toArray().slice(0);return i.reverse(),i}throw new d(n,c.InvalidParameter,r)})},e.replace=function(n,r){return t(n,r,(a,o,s)=>{D(s,3,4,n,r);const i=A(s[0]),u=A(s[1]),l=A(s[2]);return s.length!==4||Ct(s[3])?tt(i,u,l):i.replace(u,l)})},e.schema=function(n,r){return t(n,r,(a,o,s)=>{if(ee(s[0])){const i=Ni(s[0]);return i?B.convertObjectToArcadeDictionary(i,N(n)):null}throw new d(n,c.InvalidParameter,r)})},e.subtypes=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,1,1,n,r),ee(s[0])){const i=rn(s[0]);return i?B.convertObjectToArcadeDictionary(i,N(n)):null}throw new d(n,c.InvalidParameter,r)})},e.subtypecode=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,1,1,n,r),ee(s[0])){const i=rn(s[0]);if(!i)return null;if(i.subtypeField&&s[0].hasField(i.subtypeField)){const u=s[0].field(i.subtypeField);for(const l of i.subtypes)if(l.code===u)return l.code;return null}return null}throw new d(n,c.InvalidParameter,r)})},e.subtypename=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,1,1,n,r),ee(s[0])){const i=rn(s[0]);if(!i)return"";if(i.subtypeField&&s[0].hasField(i.subtypeField)){const u=s[0].field(i.subtypeField);for(const l of i.subtypes)if(l.code===u)return l.name;return""}return""}throw new d(n,c.InvalidParameter,r)})},e.gdbversion=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,1,1,n,r),ee(s[0]))return s[0].gdbVersion();throw new d(n,c.InvalidParameter,r)})},e.domain=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,2,3,n,r),ee(s[0])){const i=Bi(s[0],A(s[1]),s[2]===void 0?void 0:s[2]);return i&&i.domain?i.domain.type==="coded-value"||i.domain.type==="codedValue"?B.convertObjectToArcadeDictionary({type:"codedValue",name:i.domain.name,dataType:Nr[i.field.type],codedValues:i.domain.codedValues.map(u=>({name:u.name,code:u.code}))},N(n)):B.convertObjectToArcadeDictionary({type:"range",name:i.domain.name,dataType:Nr[i.field.type],min:i.domain.minValue,max:i.domain.maxValue},N(n)):null}throw new d(n,c.InvalidParameter,r)})},e.domainname=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,2,4,n,r),ee(s[0]))return $i(s[0],A(s[1]),s[2],s[3]===void 0?void 0:s[3]);throw new d(n,c.InvalidParameter,r)})},e.domaincode=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,2,4,n,r),ee(s[0]))return Mi(s[0],A(s[1]),s[2],s[3]===void 0?void 0:s[3]);throw new d(n,c.InvalidParameter,r)})},e.urlencode=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,1,1,n,r),s[0]===null)return"";if(s[0]instanceof B){let i="";for(const u of s[0].keys()){const l=s[0].field(u);i!==""&&(i+="&"),i+=l===null?encodeURIComponent(u)+"=":encodeURIComponent(u)+"="+encodeURIComponent(l)}return i}return encodeURIComponent(A(s[0]))})},e.hash=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,1,n,r);const i=new io(0);return Se(s[0],i,{context:n,node:r,map:new Map,currentLength:0}),i.digest()})},e.convertdirection=function(n,r){return t(n,r,(a,o,s)=>(D(s,3,3,n,r),ro(s[0],s[1],s[2])))},e.fromjson=function(n,r){return t(n,r,(a,o,s)=>{if(D(s,1,1,n,r),F(s[0])===!1)throw new d(n,c.InvalidParameter,r);return B.convertJsonToArcade(JSON.parse(A(s[0])),N(n))})},e.expects=function(n,r){return t(n,r,(a,o,s)=>{if(s.length<1)throw new d(n,c.WrongNumberOfParameters,r);return b})},e.tocharcode=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,2,n,r);const i=p(R(s[1],0)),u=A(s[0]);if(u.length===0&&s.length===1)return null;if(u.length<=i||i<0)throw new d(n,c.OutOfBounds,r);return u.charCodeAt(i)})},e.tocodepoint=function(n,r){return t(n,r,(a,o,s)=>{D(s,1,2,n,r);const i=p(R(s[1],0)),u=A(s[0]);if(u.length===0&&s.length===1)return null;if(u.length<=i||i<0)throw new d(n,c.OutOfBounds,r);return u.codePointAt(i)})},e.fromcharcode=function(n,r){return t(n,r,(a,o,s)=>{if(s.length<1)throw new d(n,c.WrongNumberOfParameters,r);const i=s.map(u=>Math.trunc(p(u))).filter(u=>u>=0&&u<=65535);return i.length===0?null:String.fromCharCode.apply(null,i)})},e.fromcodepoint=function(n,r){return t(n,r,(a,o,s)=>{if(s.length<1)throw new d(n,c.WrongNumberOfParameters,r);let i;try{i=s.map(u=>Math.trunc(p(u))).filter(u=>u<=1114111&&u>>>0===u)}catch{return null}return i.length===0?null:String.fromCodePoint.apply(null,i)})},e.getuser=function(n,r){return t(n,r,(a,o,s)=>{var u;D(s,0,2,n,r);let i=R(s[1],"");if(i=i===!0||i===!1?"":A(i),i!==null&&i!=="")return null;if(s.length===0||s[0]instanceof Kn){let l=null;if(l=(u=n.services)!=null&&u.portal?n.services.portal:or.getDefault(),s.length>0&&!so(s[0].field("url"),l)||!l)return null;if(i===""){const h=ao(l);if(h){const f=JSON.parse(JSON.stringify(h));for(const m of["lastLogin","created","modified"])f[m]!==void 0&&f[m]!==null&&(f[m]=new Date(f[m]));return B.convertObjectToArcadeDictionary(f,N(n))}}return null}throw new d(n,c.InvalidParameter,r)})},e.getenvironment=function(n,r){return t(n,r,(a,o,s)=>(D(s,0,0,n,r),B.convertObjectToArcadeDictionary(_i(N(n),n.spatialReference),N(n),!0)))}}let oo=class extends ut{constructor(t,n){super(),this.paramCount=n,this.fn=t}createFunction(t){return(...n)=>{if(n.length!==this.paramCount)throw new d(t,c.WrongNumberOfParameters,null);return this.fn(...n)}}call(t,n){return this.fn(...n.arguments)}marshalledCall(t,n,r,a){return a(t,n,(o,s,i)=>{i=i.map(l=>!X(l)||l instanceof qe?l:xt(l,t,a));const u=this.call(r,{arguments:i});return Xe(u)?u.then(l=>xt(l,r,a)):u})}};function Ae(e,t,n){try{return n(e,null,t.arguments)}catch(r){throw r}}function x(e,t){try{switch(t.type){case"EmptyStatement":return"lc.voidOperation";case"VariableDeclarator":return Co(e,t);case"VariableDeclaration":return Fo(e,t);case"BlockStatement":case"Program":return er(e,t);case"FunctionDeclaration":return xo(e,t);case"ImportDeclaration":return yo(e,t);case"ExportNamedDeclaration":return wo(e,t);case"ReturnStatement":return go(e,t);case"IfStatement":return ia(e,t);case"ExpressionStatement":return Do(e,t);case"AssignmentExpression":return mo(e,t);case"UpdateExpression":return ho(e,t);case"BreakStatement":return"break";case"ContinueStatement":return"continue";case"TemplateLiteral":return vo(e,t);case"TemplateElement":return JSON.stringify(t.value?t.value.cooked:"");case"ForStatement":return fo(e,t);case"ForInStatement":return co(e,t);case"WhileStatement":return po(e,t);case"Identifier":return ko(e,t);case"MemberExpression":return Ao(e,t);case"Literal":return t.value===null||t.value===void 0?"null":JSON.stringify(t.value);case"CallExpression":return To(e,t);case"UnaryExpression":return Eo(e,t);case"BinaryExpression":return So(e,t);case"LogicalExpression":return Io(e,t);case"ArrayExpression":return bo(e,t);case"ObjectExpression":return uo(e,t);case"Property":return lo(e,t);case"Array":throw new fe(e,c.NeverReach,t);default:throw new fe(e,c.Unrecognized,t)}}catch(n){throw n}}function uo(e,t){let n="lang.dictionary([";for(let r=0;r0&&(n+=","),n+="lang.strCheck("+(a.key.type==="Identifier"?"'"+a.key.name+"'":x(e,a.key))+",'ObjectExpression'),lang.aCheck("+x(e,a.value)+", 'ObjectExpression')"}return n+="])",n}function lo(e,t){throw new fe(e,c.NeverReach,t)}function co(e,t){const n=Fe(e),r=Fe(e),a=Fe(e);let o="var "+n+" = "+x(e,t.right)+`; `;t.left.type==="VariableDeclaration"&&(o+=x(e,t.left));let s=t.left.type==="VariableDeclaration"?t.left.declarations[0].id.name:t.left.name;s=s.toLowerCase(),be(s);let i="";e.localScope!==null&&(e.localScope[s]!==void 0?i="lscope['"+s+"']":e.localScope._SymbolsMap[s]!==void 0&&(i="lscope['"+e.localScope._SymbolsMap[s]+"']"));let u="";if(i===""){if(e.globalScope[s]!==void 0)i="gscope['"+s+"']";else if(e.globalScope._SymbolsMap[s]!==void 0)i="gscope['"+e.globalScope._SymbolsMap[s]+"']";else if(e.localScope!==null)if(e.undeclaredGlobalsInFunctions.has(s))i="gscope['"+e.undeclaredGlobalsInFunctions.get(s).manglename+"']",u=e.undeclaredGlobalsInFunctions.get(s).manglename;else{const l={manglename:_e(e),node:t.left};e.undeclaredGlobalsInFunctions.set(s,l),i="gscope['"+l.manglename+"']",u=l.manglename}}return u&&(o+="lang.chkAssig('"+u+`',runtimeCtx); `),o+="if ("+n+`===null) { lastStatement = lc.voidOperation; } @@ -214,7 +214,7 @@ return lang.__awaiter(this, void 0, void 0, function* () { var lastStatement=lc.voidOperation; `+o+` return lastStatement; } - return this.postProcess(mainBody()); `;const i=a.moduleFactory,u=a.moduleFactoryMap,l=a.exports,h={};for(const m in l)h[m]=a.mangleMap[m]!==void 0?a.mangleMap[m]:m;const f={lc:Li,lang:oa,mangles:a.mangleMap,postProcess(m){if(m instanceof Ce&&(m=m.value),m instanceof Ft&&(m=m.value),m===b&&(m=null),m===Me)throw new d(null,c.IllegalResult,null);if(m===kt)throw new d(null,c.IllegalResult,null);if(X(m))throw new d(null,c.IllegalResult,null);return m},prepare(m,g){let y=m.spatialReference;y==null&&(y=St.WebMercator);const T=sa(m.vars,m.customfunctions,g,m.timeZone);return{localStack:[],isAsync:g,moduleFactory:i,moduleFactoryMap:u,mangleMap:this.mangles,moduleSingletons:{},exports:l,gdefs:{},exportmangle:h,spatialReference:y,globalScope:T,abortSignal:m.abortSignal===void 0||m.abortSignal===null?{aborted:!1}:m.abortSignal,localScope:null,services:m.services,console:m.console??dn,lrucache:m.lrucache,timeZone:m.timeZone??null,interceptor:m.interceptor,symbols:{symbolCounter:0},depthCounter:{depth:1}}}};return new Function("context","spatialReference",s).bind(f)}async function Ro(){return ct([await je(()=>import("./geomasync-BBmYY70D.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]))],"async"),!0}class Ot extends qt{constructor(t){super(null),this.moduleContext=t}hasGlobal(t){return this.moduleContext.exports[t]===void 0&&(t=t.toLowerCase()),this.moduleContext.exports[t]!==void 0}setGlobal(t,n){const r=this.moduleContext.globalScope,a=t.toLowerCase();if(X(n))throw new d(null,c.AssignModuleFunction,null);r[this.moduleContext.exportmangle[a]]=n}global(t){const n=this.moduleContext.globalScope;t=t.toLowerCase();const r=n[this.moduleContext.exportmangle[t]];if(r===void 0)throw new d(null,c.InvalidIdentifier,null);if(X(r)&&!(r instanceof qe)){const a=new qe;return a.fn=r,a.parameterEvaluator=Ae,a.context=this.moduleContext,n[this.moduleContext.exportmangle[t]]=a,a}return r}}function Lo(e,t,n=!1){const r={isAsync:n,moduleFactory:t.moduleFactory,moduleFactoryMap:{},libraryResolver:new mn(null,e.loadedModules),globalScope:aa(t.vars,n?bt:re,t.customfunctions),customfunctions:t.customfunctions,localScope:null,mangleMap:{},undeclaredGlobalsInFunctions:new Map,depthCounter:{depth:1},exports:{},console:dn,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,services:t.services,symbols:{symbolCounter:0}};let a=x(r,e);a===""&&(a="lc.voidOperation; ");let o="";o=n?`var runtimeCtx=this.prepare(context, true); + return this.postProcess(mainBody()); `;const i=a.moduleFactory,u=a.moduleFactoryMap,l=a.exports,h={};for(const m in l)h[m]=a.mangleMap[m]!==void 0?a.mangleMap[m]:m;const f={lc:Li,lang:oa,mangles:a.mangleMap,postProcess(m){if(m instanceof Ce&&(m=m.value),m instanceof Ft&&(m=m.value),m===b&&(m=null),m===Me)throw new d(null,c.IllegalResult,null);if(m===kt)throw new d(null,c.IllegalResult,null);if(X(m))throw new d(null,c.IllegalResult,null);return m},prepare(m,g){let y=m.spatialReference;y==null&&(y=St.WebMercator);const T=sa(m.vars,m.customfunctions,g,m.timeZone);return{localStack:[],isAsync:g,moduleFactory:i,moduleFactoryMap:u,mangleMap:this.mangles,moduleSingletons:{},exports:l,gdefs:{},exportmangle:h,spatialReference:y,globalScope:T,abortSignal:m.abortSignal===void 0||m.abortSignal===null?{aborted:!1}:m.abortSignal,localScope:null,services:m.services,console:m.console??dn,lrucache:m.lrucache,timeZone:m.timeZone??null,interceptor:m.interceptor,symbols:{symbolCounter:0},depthCounter:{depth:1}}}};return new Function("context","spatialReference",s).bind(f)}async function Ro(){return ct([await je(()=>import("./geomasync-B6doa0f9.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]))],"async"),!0}class Ot extends qt{constructor(t){super(null),this.moduleContext=t}hasGlobal(t){return this.moduleContext.exports[t]===void 0&&(t=t.toLowerCase()),this.moduleContext.exports[t]!==void 0}setGlobal(t,n){const r=this.moduleContext.globalScope,a=t.toLowerCase();if(X(n))throw new d(null,c.AssignModuleFunction,null);r[this.moduleContext.exportmangle[a]]=n}global(t){const n=this.moduleContext.globalScope;t=t.toLowerCase();const r=n[this.moduleContext.exportmangle[t]];if(r===void 0)throw new d(null,c.InvalidIdentifier,null);if(X(r)&&!(r instanceof qe)){const a=new qe;return a.fn=r,a.parameterEvaluator=Ae,a.context=this.moduleContext,n[this.moduleContext.exportmangle[t]]=a,a}return r}}function Lo(e,t,n=!1){const r={isAsync:n,moduleFactory:t.moduleFactory,moduleFactoryMap:{},libraryResolver:new mn(null,e.loadedModules),globalScope:aa(t.vars,n?bt:re,t.customfunctions),customfunctions:t.customfunctions,localScope:null,mangleMap:{},undeclaredGlobalsInFunctions:new Map,depthCounter:{depth:1},exports:{},console:dn,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,services:t.services,symbols:{symbolCounter:0}};let a=x(r,e);a===""&&(a="lc.voidOperation; ");let o="";o=n?`var runtimeCtx=this.prepare(context, true); var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; return lang.__awaiter(this, void 0, void 0, function* () { @@ -243,4 +243,4 @@ return lang.__awaiter(this, void 0, void 0, function* () { return "Hello World " + hello; } `,uri:"mock"};const i=t.replace("mock:","");if(ye.mocks[i]!==void 0)return{url:"",scheme:"mock",data:ye.mocks[i],uri:t}}throw new bn(ot.UnrecognizedUri,{uri:t})}async fetchModule(t){const n=ye.cachedModules.getFromCache(t.uri);if(n)return n;const r=this.fetchSource(t);ye.cachedModules.addToCache(t.uri,r);let a=null;try{a=await r}catch(o){throw ye.cachedModules.removeFromCache(t.uri),o}return a}async fetchSource(t){if(t.scheme==="portal"){const n=await Pa(t.url,{responseType:"text",query:{}});if(n.data)return hn(n.data,[])}if(t.scheme==="mock")return hn(t.data??"",[]);throw new bn(ot.UnsupportedUriProtocol)}static create(t){return new ye(t)}static getDefault(){return this._default??(ye._default=ye._moduleResolverFactory())}static set moduleResolverClass(t){this._moduleResolverFactory=t,this._default=null}}ye.mocks={},ye.cachedModules=new Yo(30),ye._default=null,ye._moduleResolverFactory=()=>{const e=or.getDefault();return new ye(e.url)};let Xo=class extends ut{constructor(t,n){super(),this.definition=null,this.context=null,this.definition=t,this.context=n}createFunction(t){return(...n)=>{const r={spatialReference:this.context.spatialReference,console:this.context.console,services:this.context.services,timeZone:this.context.timeZone??null,lrucache:this.context.lrucache,exports:this.context.exports,libraryResolver:this.context.libraryResolver,interceptor:this.context.interceptor,localScope:{},depthCounter:{depth:t.depthCounter.depth+1},globalScope:this.context.globalScope};if(r.depthCounter.depth>64)throw new d(t,c.MaximumCallDepth,null);return Rn(this.definition,r,n,null)}}call(t,n){return Ve(t,n,(r,a,o)=>{const s={spatialReference:t.spatialReference,services:t.services,globalScope:t.globalScope,depthCounter:{depth:t.depthCounter.depth+1},libraryResolver:t.libraryResolver,exports:t.exports,timeZone:t.timeZone??null,console:t.console,lrucache:t.lrucache,interceptor:t.interceptor,localScope:{}};if(s.depthCounter.depth>64)throw new d(t,c.MaximumCallDepth,n);return Rn(this.definition,s,o,n)})}marshalledCall(t,n,r,a){return a(t,n,(o,s,i)=>{const u={spatialReference:t.spatialReference,globalScope:r.globalScope,services:t.services,depthCounter:{depth:t.depthCounter.depth+1},libraryResolver:t.libraryResolver,exports:t.exports,console:t.console,timeZone:t.timeZone??null,lrucache:t.lrucache,interceptor:t.interceptor,localScope:{}};return i=i.map(l=>!X(l)||l instanceof qe?l:xt(l,t,a)),xt(Rn(this.definition,u,i,n),r,a)})}},vt=class extends qt{constructor(t){super(t)}global(t){const n=this.executingContext.globalScope[t.toLowerCase()];if(n.valueset||(n.value=C(this.executingContext,n.node),n.valueset=!0),X(n.value)&&!(n.value instanceof qe)){const r=new qe;r.fn=n.value,r.parameterEvaluator=Ve,r.context=this.executingContext,n.value=r}return n.value}setGlobal(t,n){if(X(n))throw new d(null,c.AssignModuleFunction,null);this.executingContext.globalScope[t.toLowerCase()]={value:n,valueset:!0,node:null}}hasGlobal(t){return this.executingContext.exports[t]===void 0&&(t=t.toLowerCase()),this.executingContext.exports[t]!==void 0}loadModule(t){let n=t.spatialReference;n==null&&(n=new St({wkid:102100})),this.moduleScope=Da({},t.customfunctions,t.timeZone),this.executingContext={spatialReference:n,globalScope:this.moduleScope,localScope:null,libraryResolver:new mn(t.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{},services:t.services,console:t.console??ga,timeZone:t.timeZone??null,lrucache:t.lrucache,interceptor:t.interceptor,depthCounter:{depth:1}},C(this.executingContext,this.source.syntax)}};function Qo(e,t){const n=[];for(let r=0;r=r.length)throw new d(e,c.OutOfBounds,t);n=p(r[a]),r[a]=t.operator==="++"?n+1:n-1}else if(r instanceof B){if(F(a)===!1)throw new d(e,c.KeyAccessorMustBeString,t);if(r.hasField(a)!==!0)throw new d(e,c.FieldNotFound,t);n=p(r.field(a)),r.setField(a,t.operator==="++"?n+1:n-1)}else if(ee(r)){if(F(a)===!1)throw new d(e,c.KeyAccessorMustBeString,t);if(r.hasField(a)!==!0)throw new d(e,c.FieldNotFound,t);n=p(r.field(a)),r.setField(a,t.operator==="++"?n+1:n-1)}else{if(M(r))throw new d(e,c.Immutable,t);if(!(r instanceof vt))throw new d(e,c.InvalidParameter,t);if(F(a)===!1)throw new d(e,c.ModuleAccessorMustBeString,t);if(r.hasGlobal(a)!==!0)throw new d(e,c.ModuleExportNotFound,t);n=p(r.global(a)),r.setGlobal(a,t.operator==="++"?n+1:n-1)}return t.prefix===!1?n:t.operator==="++"?n+1:n-1}if(r=t.argument.type==="Identifier"?t.argument.name.toLowerCase():"",!r)throw new d(e,c.InvalidIdentifier,t);if(e.localScope!=null&&e.localScope[r]!==void 0)return n=p(e.localScope[r].value),e.localScope[r]={value:t.operator==="++"?n+1:n-1,valueset:!0,node:t},t.prefix===!1?n:t.operator==="++"?n+1:n-1;if(e.globalScope[r]!==void 0)return n=p(e.globalScope[r].value),e.globalScope[r]={value:t.operator==="++"?n+1:n-1,valueset:!0,node:t},t.prefix===!1?n:t.operator==="++"?n+1:n-1;throw new d(e,c.InvalidIdentifier,t)}function ze(e,t,n,r,a){switch(t){case"=":return e===b?null:e;case"/=":return p(n)/p(e);case"*=":return p(n)*p(e);case"-=":return p(n)-p(e);case"+=":return F(n)||F(e)?A(n)+A(e):p(n)+p(e);case"%=":return p(n)%p(e);default:throw new d(a,c.UnsupportedOperator,r)}}function ou(e,t){let n=null,r="";if(t.left.type==="MemberExpression"){if(n=C(e,t.left.object),t.left.computed===!0)r=C(e,t.left.property);else{if(t.left.property.type!=="Identifier")throw new d(e,c.InvalidIdentifier,t);r=t.left.property.name}const o=C(e,t.right);if(k(n)){if(!L(r))throw new d(e,c.ArrayAccessorMustBeNumber,t);if(r<0&&(r=n.length+r),r<0||r>n.length)throw new d(e,c.OutOfBounds,t);if(r===n.length){if(t.operator!=="=")throw new d(e,c.OutOfBounds,t);n[r]=ze(o,t.operator,n[r],t,e)}else n[r]=ze(o,t.operator,n[r],t,e)}else if(n instanceof B){if(F(r)===!1)throw new d(e,c.KeyAccessorMustBeString,t);if(n.hasField(r)===!0)n.setField(r,ze(o,t.operator,n.field(r),t,e));else{if(t.operator!=="=")throw new d(e,c.FieldNotFound,t,{key:r});n.setField(r,ze(o,t.operator,null,t,e))}}else if(ee(n)){if(F(r)===!1)throw new d(e,c.KeyAccessorMustBeString,t);if(n.hasField(r)===!0)n.setField(r,ze(o,t.operator,n.field(r),t,e));else{if(t.operator!=="=")throw new d(e,c.FieldNotFound,t,{key:r});n.setField(r,ze(o,t.operator,null,t,e))}}else{if(M(n))throw new d(e,c.Immutable,t);if(!(n instanceof vt))throw new d(e,c.InvalidIdentifier,t);if(F(r)===!1)throw new d(e,c.ModuleAccessorMustBeString,t);if(n.hasGlobal(r)!==!0)throw new d(e,c.ModuleExportNotFound,t);n.setGlobal(r,ze(o,t.operator,n.global(r),t,e))}return b}n=t.left.name.toLowerCase();const a=C(e,t.right);if(e.localScope!=null&&e.localScope[n]!==void 0)return e.localScope[n]={value:ze(a,t.operator,e.localScope[n].value,t,e),valueset:!0,node:t.right},b;if(e.globalScope[n]!==void 0)return e.globalScope[n]={value:ze(a,t.operator,e.globalScope[n].value,t,e),valueset:!0,node:t.right},b;throw new d(e,c.InvalidIdentifier,t)}function uu(e,t){if(t.expression.type==="AssignmentExpression"||t.expression.type==="UpdateExpression")return C(e,t.expression);if(t.expression.type==="CallExpression"){const n=C(e,t.expression);return n===b?b:new Ft(n)}{const n=C(e,t.expression);return n===b?b:new Ft(n)}}function lu(e,t){const n=C(e,t.test);if(n===!0)return C(e,t.consequent);if(n===!1)return t.alternate!==null?C(e,t.alternate):b;throw new d(e,c.BooleanConditionRequired,t)}function cu(e,t){let n=b;for(let r=0;r=n.length||r<0)throw new d(e,c.OutOfBounds,t);return n[r]}throw new d(e,c.InvalidMemberAccessKey,t)}if(F(n)){if(L(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=n.length+r),r>=n.length||r<0)throw new d(e,c.OutOfBounds,t);return n[r]}throw new d(e,c.InvalidMemberAccessKey,t)}if(M(n)){if(L(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=n.length()+r),r>=n.length()||r<0)throw new d(e,c.OutOfBounds,t);return n.get(r)}throw new d(e,c.InvalidMemberAccessKey,t)}throw new d(e,c.InvalidMemberAccessKey,t)}}catch(n){throw n}}function yu(e,t){try{const n=C(e,t.argument);if(V(n)){if(t.operator==="!")return!n;if(t.operator==="-")return-1*p(n);if(t.operator==="+")return 1*p(n);if(t.operator==="~")return~p(n);throw new d(e,c.UnsupportedUnaryOperator,t)}if(t.operator==="~")return~p(n);if(t.operator==="-")return-1*p(n);if(t.operator==="+")return 1*p(n);throw new d(e,c.UnsupportedUnaryOperator,t)}catch(n){throw n}}function wu(e,t){try{const n=[];for(let r=0;r>":case">>>":case"^":case"&":return Dr(p(r),p(a),t.operator);case"==":return ke(r,a);case"!=":return!ke(r,a);case"<":case">":case"<=":case">=":return mr(r,a,t.operator);case"+":return F(r)||F(a)?A(r)+A(a):p(r)+p(a);case"-":return p(r)-p(a);case"*":return p(r)*p(a);case"/":return p(r)/p(a);case"%":return p(r)%p(a);default:throw new d(e,c.UnsupportedOperator,t)}}catch(n){throw n}}function Fu(e,t){try{const n=C(e,t.left);if(V(n))switch(t.operator){case"||":if(n===!0)return n;{const r=C(e,t.right);if(V(r))return r;throw new d(e,c.LogicExpressionOrAnd,t)}case"&&":if(n===!1)return n;{const r=C(e,t.right);if(V(r))return r;throw new d(e,c.LogicExpressionOrAnd,t)}default:throw new d(e,c.LogicExpressionOrAnd,t)}throw new d(e,c.LogicalExpressionOnlyBoolean,t)}catch(n){throw n}}function Cu(e,t){return t.value?t.value.cooked:""}function Au(e,t,n){if(X(e))throw new d(t,c.NoFunctionInTemplateLiteral,n);return e}function Eu(e,t){let n="",r=0;for(const a of t.quasis)n+=a.value?a.value.cooked:"",a.tail===!1&&(n+=t.expressions[r]?A(Au(C(e,t.expressions[r]),e,t)):"",r++);return n}function ha(e,t){let n;try{const r=t.name.toLowerCase();if(e.localScope!=null&&e.localScope[r]!==void 0)return n=e.localScope[r],n.valueset===!0||(n.value=C(e,n.node),n.valueset=!0),n.value;if(e.globalScope[r]!==void 0)return n=e.globalScope[r],n.valueset===!0||(n.value=C(e,n.node),n.valueset=!0),n.value;throw new d(e,c.InvalidIdentifier,t)}catch(r){throw r}}function bu(e,t){try{if(t.callee.type==="MemberExpression"){const n=C(e,t.callee.object);if(!(n instanceof vt))throw new d(e,c.FunctionNotFound,t);const r=t.callee.computed===!1?t.callee.property.name:C(e,t.callee.property);if(!n.hasGlobal(r))throw new d(e,c.FunctionNotFound,t);const a=n.global(r);if(!X(a))throw new d(e,c.CallNonFunction,t);return a.call(e,t)}if(t.callee.type!=="Identifier")throw new d(e,c.FunctionNotFound,t);if(e.localScope!=null&&e.localScope[t.callee.name.toLowerCase()]!==void 0){const n=e.localScope[t.callee.name.toLowerCase()];if(X(n.value))return n.value.call(e,t);throw new d(e,c.CallNonFunction,t)}if(e.globalScope[t.callee.name.toLowerCase()]!==void 0){const n=e.globalScope[t.callee.name.toLowerCase()];if(X(n.value))return n.value.call(e,t);throw new d(e,c.CallNonFunction,t)}throw new d(e,c.FunctionNotFound,t)}catch(n){throw n}}const de={};function pa(e,t,n,r){try{const a=t.arguments,o=C(e,a[n]);if(ke(o,r))return C(e,a[n+1]);{const s=a.length-n;return s===1?C(e,a[n]):s===2?null:s===3?C(e,a[n+2]):pa(e,t,n+2,r)}}catch(a){throw a}}function ma(e,t,n,r){try{const a=t.arguments;if(r===!0)return C(e,a[n+1]);if(a.length-n===3)return C(e,a[n+2]);{const o=C(e,a[n+2]);if(V(o)===!1)throw new d(e,c.BooleanConditionRequired,a[n+2]);return ma(e,t,n+2,o)}}catch(a){throw a}}function Rn(e,t,n,r){try{const a=e.body;if(n.length!==e.params.length)throw new d(t,c.WrongNumberOfParameters,r);if(t.localScope!=null)for(let s=0;simport("./geometryEngine-DD4bBRnV.js"),__vite__mapDeps([13,14,1,2,15]));return xa=!0,Ns(e),!0}let Pn=null;function Er(){return Pn!==null||(Pn=Ea()),Pn}async function Ea(){await Ro(),Ne=await je(()=>import("./arcadeAsyncRuntime-CNNOWwv8.js"),__vite__mapDeps([16,0,1,2,3,4,5,6,7,8,9,10,11,12]));for(const e of ir)Ne.extend(e),ct(e,"async");return ir=null,!0}function ba(){return wa}function va(){return!!Ne}function Sa(){return xa}let On=null;function br(){return On||(On=Ia(),On)}async function Ia(){await Er();const[e,t,n,r,a,o]=await Promise.all([je(()=>import("./featureSetUtils-CGqLzAT0.js").then(s=>s.l),__vite__mapDeps([17,1,2,18,3,4,19,6,12,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,10,11,74,9,75,76])),je(()=>import("./featuresetbase-ahV3ZnCB.js"),__vite__mapDeps([77,3,1,2,4,17,18,19,6,12,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,10,11,74,9,75,76,7,5,8])),je(()=>import("./featuresetgeom-Cl8QdL8d.js"),__vite__mapDeps([78,3,1,2,4,19,18,6,12,7,8,9,10,11])),je(()=>import("./featuresetstats-0jxQEihT.js"),__vite__mapDeps([79,3,1,2,4,18,7,8,9,10,11,12])),je(()=>import("./featuresetstring-DtQ-AsWo.js"),__vite__mapDeps([80,1,2,3,4,7,8,9,10,11,12])),je(()=>import("./knowledgegraph-x8GOX0-O.js"),__vite__mapDeps([81,1,2,5,82,83,3,4,7,8,9,10,11,12]))]);return Ma=e,Ne.extend([t,n,r,a,o]),ct([t,n,r,a,o],"async"),wa=!0,!0}function ka(e,t=[]){return e.usesFeatureSet===void 0&&Wt(e,t),e.usesFeatureSet===!0}function $u(e,t=[]){return e.isAsync===void 0&&Wt(e,t),e.isAsync===!0}function Mu(e,t){if(t){for(const n of t)if(Cn(e,n))return!0;return!1}return!1}async function Ta(e,t,n=[],r=!1,a=null){return vr(new Set,e,t,n,r,a)}async function vr(e,t,n,r=[],a=!1,o=null){const s=typeof t=="string"?Fr(t):t,i=[];return s&&(Sa()===!1&&(An(s)||a)&&i.push(Ar()),va()===!1&&(s.isAsync===!0||n)&&i.push(Er()),ba()===!1&&(ka(s)||Mu(s,r))&&i.push(br())),i.length&&await Promise.all(i),await Ba(e,s,o,n,a),!0}function Nu(e,t=[]){return e.usesModules===void 0&&Wt(e,t),e.usesModules===!0}async function Ba(e,t,n=null,r=!1,a=!1){const o=Ui(t);n===null&&o.length>0&&(n=ye.getDefault()),t.loadedModules={};for(const s of o){mi(n);const i=n.normalizeModuleUri(s.source);if(e.has(i.uri))throw new d(null,c.CircularModules,null);e.add(i.uri);const u=await n.fetchModule(i);await vr(e,u,r,[],a,n),e.delete(i.uri),u.isAsync&&(t.isAsync=!0),u.usesFeatureSet&&(t.usesFeatureSet=!0),u.usesGeometry&&(t.usesGeometry=!0),t.loadedModules[s.libname]={uri:i.uri,script:u}}}function $a(e){if(An(e))return!0;const t=Vn(e);let n=!1;for(let r=0;r{ci.test(s)&&(s=s.replace(ci,""),a.push(s))});const o=a.filter(s=>s.includes("*"));return a=a.filter(s=>!o.includes(s)),t&&o.forEach(s=>{const i=new RegExp(`^${s.split(/\*+/).map(Lu).join(".*")}$`,"i");t.forEach(u=>i.test(u)?a.push(u):null)}),[...new Set(a.sort())]}function qu(e){return Cn(e,"$view")}function Hu(e,t){return!!e&&Cn(e,t)}function Ku(e){if(!(!e||e.spatialReference==null&&(e.scale==null||e.viewingMode==null)))return{view:e.viewingMode&&e.scale!=null?new B({viewingMode:e.viewingMode,scale:e.scale}):null,sr:e.spatialReference}}function Wu({url:e,spatialReference:t,lrucache:n,interceptor:r}){const a=En();return a?a.createFeatureSetCollectionFromService(e,t,n,r):null}function Yu({layer:e,spatialReference:t,outFields:n,returnGeometry:r,lrucache:a,interceptor:o}){if(e===null)return null;const s=En();return s?s.constructFeatureSet(e,t,n,r??!0,a,o):null}function Xu(e){if((e==null?void 0:e.map)===null)return null;const t=En();return t?t.createFeatureSetCollectionFromMap(e.map,e.spatialReference,e.lrucache,e.interceptor):null}function Qu(e,t){return B.convertJsonToArcade(e,t)}function el(e,t,n=[]){return Ta(e,t,n)}function tl(){return Ar()}function nl(){return br()}function rl(e){return e.type==="simple"||e.type==="class-breaks"||e.type==="unique-value"||e.type==="dot-density"||e.type==="dictionary"||e.type==="pie-chart"}function il(e){return e.declaredClass==="esri.layers.support.LabelClass"}function al(e){return e.declaredClass==="esri.PopupTemplate"}function Na(e,t){var r,a;if(!e)return!1;if(typeof e=="string")return t(e);const n=e;if(rl(n)){if(n.type==="dot-density"){const i=(r=n.attributes)==null?void 0:r.some(u=>t(u.valueExpression));if(i)return i}const o=n.visualVariables,s=!!o&&o.some(i=>{let u=t(i.valueExpression);return i.type==="size"&&(fi(i.minSize)&&(u=u||t(i.minSize.valueExpression)),fi(i.maxSize)&&(u=u||t(i.maxSize.valueExpression))),u});return!(!("valueExpression"in n)||!t(n.valueExpression))||s}if(il(n)){const o=(a=n.labelExpressionInfo)==null?void 0:a.expression;return!(!o||!t(o))||!1}return!!al(n)&&(!!n.expressionInfos&&n.expressionInfos.some(o=>t(o.expression))||Array.isArray(n.content)&&n.content.some(o=>{var s;return o.type==="expression"&&t((s=o.expressionInfo)==null?void 0:s.expression)}))}function sl(e){const t=Yt(e);return!!t&&$a(t)}function ol(e){return Na(e,sl)}function ul(e){const t=Yt(e);return!!t&&An(t)}function ll(e){return Na(e,ul)}function fi(e){return e&&e.declaredClass==="esri.renderers.visualVariables.SizeVariable"}const ql=Object.freeze(Object.defineProperty({__proto__:null,Dictionary:B,arcade:_u,arcadeFeature:Q,convertFeatureLayerToFeatureSet:Yu,convertJsonToArcade:Qu,convertMapToFeatureSetCollection:Xu,convertServiceUrlToWorkspace:Wu,createExecContext:Uu,createFeature:zu,createFunction:Ou,createSyntaxTree:Yt,dependsOnView:qu,enableFeatureSetOperations:nl,enableGeometryOperations:tl,evalSyntaxTree:Gu,executeAsyncFunction:Ju,executeFunction:ju,extractFieldNames:Vu,getArcadeType:Pu,getViewInfo:Ku,hasGeometryFunctions:ol,hasGeometryOperations:ll,hasVariable:Hu,loadScriptDependencies:el,updateExecContext:Zu},Symbol.toStringTag,{value:"Module"}));export{Bi as $,tt as A,Tt as B,zi as C,Q as D,L as E,Ft as F,F as G,ee as H,X as I,kt as J,Cl as K,et as L,Yi as M,B as N,b as O,In as P,M as Q,Me as R,Ct as S,G as T,k as U,Ze as V,Vi as W,H as X,ra as Y,ne as Z,Dr as _,D as a,yn as a0,rn as a1,$i as a2,Ii as a3,Mi as a4,ki as a5,Ee as a6,Ni as a7,Nr as a8,dr as a9,Va as aA,Mr as aB,Tl as aC,Wa as aD,$l as aE,_l as aF,Nl as aG,Ls as aH,Xa as aI,Ti as aJ,ql as aK,fr as aa,Dn as ab,on as ac,jn as ad,We as ae,nn as af,hs as ag,ps as ah,Is as ai,Ms as aj,ks as ak,Bt as al,xe as am,kr as an,Br as ao,bl as ap,Sl as aq,$r as ar,vl as as,El as at,Al as au,Il as av,Ml as aw,Tr as ax,kl as ay,Bl as az,d as b,mr as c,A as d,lt as e,Qi as f,ut as g,p as h,qe as i,qt as j,P as k,ue as l,ke as m,xt as n,Jn as o,qn as p,N as q,c as r,mn as s,j as t,ja as u,R as v,Ce as w,Kn as x,Ka as y,V as z}; +`,tab:" ",singlequote:"'",doublequote:'"',forwardslash:"/",backwardslash:"\\"});a.immutable=!1,r.textformatting={value:a,valueset:!0,node:null};for(const o in t)r[o]={value:new lt(t[o]),native:!0,valueset:!0,node:null};for(const o in e)e[o]&&e[o].declaredClass==="esri.Graphic"?r[o]={value:Q.createFromGraphic(e[o],n),valueset:!0,node:null}:r[o]={value:e[o],valueset:!0,node:null};return r}Gt.prototype=de,Gt.prototype.infinity={value:Number.POSITIVE_INFINITY,valueset:!0,node:null},Gt.prototype.pi={value:Math.PI,valueset:!0,node:null};function ga(e){console.log(e)}function ya(e){const t={mode:"sync",compiled:!1,functions:{},signatures:[],standardFunction:Ve,evaluateIdentifier:ha};for(let n=0;nimport("./geometryEngine-8LJe6rF3.js"),__vite__mapDeps([13,14,1,2,15]));return xa=!0,Ns(e),!0}let Pn=null;function Er(){return Pn!==null||(Pn=Ea()),Pn}async function Ea(){await Ro(),Ne=await je(()=>import("./arcadeAsyncRuntime-B50Rzrzf.js"),__vite__mapDeps([16,0,1,2,3,4,5,6,7,8,9,10,11,12]));for(const e of ir)Ne.extend(e),ct(e,"async");return ir=null,!0}function ba(){return wa}function va(){return!!Ne}function Sa(){return xa}let On=null;function br(){return On||(On=Ia(),On)}async function Ia(){await Er();const[e,t,n,r,a,o]=await Promise.all([je(()=>import("./featureSetUtils-BD9u_wDK.js").then(s=>s.l),__vite__mapDeps([17,1,2,18,3,4,19,6,12,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,10,11,74,9,75,76])),je(()=>import("./featuresetbase-WRrooxlm.js"),__vite__mapDeps([77,3,1,2,4,17,18,19,6,12,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,10,11,74,9,75,76,7,5,8])),je(()=>import("./featuresetgeom-4-vjnWH-.js"),__vite__mapDeps([78,3,1,2,4,19,18,6,12,7,8,9,10,11])),je(()=>import("./featuresetstats-442f9v7H.js"),__vite__mapDeps([79,3,1,2,4,18,7,8,9,10,11,12])),je(()=>import("./featuresetstring-TQgTDW3a.js"),__vite__mapDeps([80,1,2,3,4,7,8,9,10,11,12])),je(()=>import("./knowledgegraph-CifNQGEf.js"),__vite__mapDeps([81,1,2,5,82,83,3,4,7,8,9,10,11,12]))]);return Ma=e,Ne.extend([t,n,r,a,o]),ct([t,n,r,a,o],"async"),wa=!0,!0}function ka(e,t=[]){return e.usesFeatureSet===void 0&&Wt(e,t),e.usesFeatureSet===!0}function $u(e,t=[]){return e.isAsync===void 0&&Wt(e,t),e.isAsync===!0}function Mu(e,t){if(t){for(const n of t)if(Cn(e,n))return!0;return!1}return!1}async function Ta(e,t,n=[],r=!1,a=null){return vr(new Set,e,t,n,r,a)}async function vr(e,t,n,r=[],a=!1,o=null){const s=typeof t=="string"?Fr(t):t,i=[];return s&&(Sa()===!1&&(An(s)||a)&&i.push(Ar()),va()===!1&&(s.isAsync===!0||n)&&i.push(Er()),ba()===!1&&(ka(s)||Mu(s,r))&&i.push(br())),i.length&&await Promise.all(i),await Ba(e,s,o,n,a),!0}function Nu(e,t=[]){return e.usesModules===void 0&&Wt(e,t),e.usesModules===!0}async function Ba(e,t,n=null,r=!1,a=!1){const o=Ui(t);n===null&&o.length>0&&(n=ye.getDefault()),t.loadedModules={};for(const s of o){mi(n);const i=n.normalizeModuleUri(s.source);if(e.has(i.uri))throw new d(null,c.CircularModules,null);e.add(i.uri);const u=await n.fetchModule(i);await vr(e,u,r,[],a,n),e.delete(i.uri),u.isAsync&&(t.isAsync=!0),u.usesFeatureSet&&(t.usesFeatureSet=!0),u.usesGeometry&&(t.usesGeometry=!0),t.loadedModules[s.libname]={uri:i.uri,script:u}}}function $a(e){if(An(e))return!0;const t=Vn(e);let n=!1;for(let r=0;r{ci.test(s)&&(s=s.replace(ci,""),a.push(s))});const o=a.filter(s=>s.includes("*"));return a=a.filter(s=>!o.includes(s)),t&&o.forEach(s=>{const i=new RegExp(`^${s.split(/\*+/).map(Lu).join(".*")}$`,"i");t.forEach(u=>i.test(u)?a.push(u):null)}),[...new Set(a.sort())]}function qu(e){return Cn(e,"$view")}function Hu(e,t){return!!e&&Cn(e,t)}function Ku(e){if(!(!e||e.spatialReference==null&&(e.scale==null||e.viewingMode==null)))return{view:e.viewingMode&&e.scale!=null?new B({viewingMode:e.viewingMode,scale:e.scale}):null,sr:e.spatialReference}}function Wu({url:e,spatialReference:t,lrucache:n,interceptor:r}){const a=En();return a?a.createFeatureSetCollectionFromService(e,t,n,r):null}function Yu({layer:e,spatialReference:t,outFields:n,returnGeometry:r,lrucache:a,interceptor:o}){if(e===null)return null;const s=En();return s?s.constructFeatureSet(e,t,n,r??!0,a,o):null}function Xu(e){if((e==null?void 0:e.map)===null)return null;const t=En();return t?t.createFeatureSetCollectionFromMap(e.map,e.spatialReference,e.lrucache,e.interceptor):null}function Qu(e,t){return B.convertJsonToArcade(e,t)}function el(e,t,n=[]){return Ta(e,t,n)}function tl(){return Ar()}function nl(){return br()}function rl(e){return e.type==="simple"||e.type==="class-breaks"||e.type==="unique-value"||e.type==="dot-density"||e.type==="dictionary"||e.type==="pie-chart"}function il(e){return e.declaredClass==="esri.layers.support.LabelClass"}function al(e){return e.declaredClass==="esri.PopupTemplate"}function Na(e,t){var r,a;if(!e)return!1;if(typeof e=="string")return t(e);const n=e;if(rl(n)){if(n.type==="dot-density"){const i=(r=n.attributes)==null?void 0:r.some(u=>t(u.valueExpression));if(i)return i}const o=n.visualVariables,s=!!o&&o.some(i=>{let u=t(i.valueExpression);return i.type==="size"&&(fi(i.minSize)&&(u=u||t(i.minSize.valueExpression)),fi(i.maxSize)&&(u=u||t(i.maxSize.valueExpression))),u});return!(!("valueExpression"in n)||!t(n.valueExpression))||s}if(il(n)){const o=(a=n.labelExpressionInfo)==null?void 0:a.expression;return!(!o||!t(o))||!1}return!!al(n)&&(!!n.expressionInfos&&n.expressionInfos.some(o=>t(o.expression))||Array.isArray(n.content)&&n.content.some(o=>{var s;return o.type==="expression"&&t((s=o.expressionInfo)==null?void 0:s.expression)}))}function sl(e){const t=Yt(e);return!!t&&$a(t)}function ol(e){return Na(e,sl)}function ul(e){const t=Yt(e);return!!t&&An(t)}function ll(e){return Na(e,ul)}function fi(e){return e&&e.declaredClass==="esri.renderers.visualVariables.SizeVariable"}const ql=Object.freeze(Object.defineProperty({__proto__:null,Dictionary:B,arcade:_u,arcadeFeature:Q,convertFeatureLayerToFeatureSet:Yu,convertJsonToArcade:Qu,convertMapToFeatureSetCollection:Xu,convertServiceUrlToWorkspace:Wu,createExecContext:Uu,createFeature:zu,createFunction:Ou,createSyntaxTree:Yt,dependsOnView:qu,enableFeatureSetOperations:nl,enableGeometryOperations:tl,evalSyntaxTree:Gu,executeAsyncFunction:Ju,executeFunction:ju,extractFieldNames:Vu,getArcadeType:Pu,getViewInfo:Ku,hasGeometryFunctions:ol,hasGeometryOperations:ll,hasVariable:Hu,loadScriptDependencies:el,updateExecContext:Zu},Symbol.toStringTag,{value:"Module"}));export{Bi as $,tt as A,Tt as B,zi as C,Q as D,L as E,Ft as F,F as G,ee as H,X as I,kt as J,Cl as K,et as L,Yi as M,B as N,b as O,In as P,M as Q,Me as R,Ct as S,G as T,k as U,Ze as V,Vi as W,H as X,ra as Y,ne as Z,Dr as _,D as a,yn as a0,rn as a1,$i as a2,Ii as a3,Mi as a4,ki as a5,Ee as a6,Ni as a7,Nr as a8,dr as a9,Va as aA,Mr as aB,Tl as aC,Wa as aD,$l as aE,_l as aF,Nl as aG,Ls as aH,Xa as aI,Ti as aJ,ql as aK,fr as aa,Dn as ab,on as ac,jn as ad,We as ae,nn as af,hs as ag,ps as ah,Is as ai,Ms as aj,ks as ak,Bt as al,xe as am,kr as an,Br as ao,bl as ap,Sl as aq,$r as ar,vl as as,El as at,Al as au,Il as av,Ml as aw,Tr as ax,kl as ay,Bl as az,d as b,mr as c,A as d,lt as e,Qi as f,ut as g,p as h,qe as i,qt as j,P as k,ue as l,ke as m,xt as n,Jn as o,qn as p,N as q,c as r,mn as s,j as t,ja as u,R as v,Ce as w,Kn as x,Ka as y,V as z}; diff --git a/assets/arcgis-knowledge-client-core-DKjhP7CP.js b/assets/arcgis-knowledge-client-core-B0fFx-E4.js similarity index 99% rename from assets/arcgis-knowledge-client-core-DKjhP7CP.js rename to assets/arcgis-knowledge-client-core-B0fFx-E4.js index 439ba62..a27249a 100644 --- a/assets/arcgis-knowledge-client-core-DKjhP7CP.js +++ b/assets/arcgis-knowledge-client-core-B0fFx-E4.js @@ -1,3 +1,3 @@ -import{ar as Kn,es as Mr}from"./index-CEWggaxV.js";var $n,Ur,kn,Wn={exports:{}};$n=Wn,Ur=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,kn=function(z){var c,Ir,tr;z=z||{},c||(c=z!==void 0?z:{}),c.ready=new Promise(function(r,n){Ir=r,tr=n});var Rr=Object.assign({},c),xr="./this.program",D="";typeof document<"u"&&document.currentScript&&(D=document.currentScript.src),Ur&&(D=Ur),D=D.indexOf("blob:")!==0?D.substr(0,D.replace(/[?#].*/,"").lastIndexOf("/")+1):"";var q,En=c.print||console.log.bind(console),H=c.printErr||console.warn.bind(console);Object.assign(c,Rr),Rr=null,c.thisProgram&&(xr=c.thisProgram),c.wasmBinary&&(q=c.wasmBinary),c.noExitRuntime,typeof WebAssembly!="object"&&G("no native wasm support detected");var Ar,Tr,j,_,I,N,w,y,Yr,Hr,Vr,Br,zr=!1,qr=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function ar(r,n,e){var t=n+e;for(e=n;r[e]&&!(e>=t);)++e;if(16(a=(240&a)==224?(15&a)<<12|i<<6|f:(7&a)<<18|i<<12|f<<6|63&r[n++])?t+=String.fromCharCode(a):(a-=65536,t+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else t+=String.fromCharCode(a)}return t}function Nr(r,n,e,t){if(0=i&&(i=65536+((1023&i)<<10)|1023&r.charCodeAt(++a)),127>=i){if(e>=t)break;n[e++]=i}else{if(2047>=i){if(e+1>=t)break;n[e++]=192|i>>6}else{if(65535>=i){if(e+2>=t)break;n[e++]=224|i>>12}else{if(e+3>=t)break;n[e++]=240|i>>18,n[e++]=128|i>>12&63}n[e++]=128|i>>6&63}n[e++]=128|63&i}}n[e]=0}}function Lr(r){for(var n=0,e=0;e=t?n++:2047>=t?n+=2:55296<=t&&57343>=t?(n+=4,++e):n+=3}return n}function Gr(){var r=Ar.buffer;Tr=r,c.HEAP8=j=new Int8Array(r),c.HEAP16=I=new Int16Array(r),c.HEAP32=w=new Int32Array(r),c.HEAPU8=_=new Uint8Array(r),c.HEAPU16=N=new Uint16Array(r),c.HEAPU32=y=new Uint32Array(r),c.HEAPF32=Yr=new Float32Array(r),c.HEAPF64=Br=new Float64Array(r),c.HEAP64=Hr=new BigInt64Array(r),c.HEAPU64=Vr=new BigUint64Array(r)}var Jr,Xr=[],Zr=[],Kr=[];function On(){var r=c.preRun.shift();Xr.unshift(r)}var S,R=0,L=null;function G(r){throw c.onAbort&&c.onAbort(r),H(r="Aborted("+r+")"),zr=!0,r=new WebAssembly.RuntimeError(r+". Build with -sASSERTIONS for more info."),tr(r),r}function Qr(){return S.startsWith("data:application/octet-stream;base64,")}if(S="arcgis-knowledge-client-core.wasm",!Qr()){var rn=S;S=c.locateFile?c.locateFile(rn,D):D+rn}function nn(){var r=S;try{if(r==S&&q)return new Uint8Array(q);throw"both async and sync fetching of the wasm failed"}catch(n){G(n)}}function jn(){return q||typeof fetch!="function"?Promise.resolve().then(function(){return nn()}):fetch(S,{credentials:"same-origin"}).then(function(r){if(!r.ok)throw"failed to load wasm binary file at '"+S+"'";return r.arrayBuffer()}).catch(function(){return nn()})}function _r(r){for(;0>2]=n},this.Oa=function(n){y[this.fa+8>>2]=n},this.Ua=function(){w[this.fa>>2]=0},this.Ma=function(){j[this.fa+12>>0]=0},this.Va=function(){j[this.fa+13>>0]=0},this.Ia=function(n,e){this.La(),this.Ya(n),this.Oa(e),this.Ua(),this.Ma(),this.Va()},this.La=function(){y[this.fa+16>>2]=0}}var ir={};function or(r){for(;r.length;){var n=r.pop();r.pop()(n)}}function J(r){return this.fromWireType(w[r>>2])}var V={},x={},ur={};function en(r){if(r===void 0)return"_unknown";var n=(r=r.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=n&&57>=n?"_"+r:r}function Cr(r,n){return r=en(r),function(){return n.apply(this,arguments)}}function Pr(r){var n=Error,e=Cr(r,function(t){this.name=r,this.message=t,(t=Error(t).stack)!==void 0&&(this.stack=this.toString()+` +import{ar as Kn,es as Mr}from"./index-BjUNJPVf.js";var $n,Ur,kn,Wn={exports:{}};$n=Wn,Ur=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,kn=function(z){var c,Ir,tr;z=z||{},c||(c=z!==void 0?z:{}),c.ready=new Promise(function(r,n){Ir=r,tr=n});var Rr=Object.assign({},c),xr="./this.program",D="";typeof document<"u"&&document.currentScript&&(D=document.currentScript.src),Ur&&(D=Ur),D=D.indexOf("blob:")!==0?D.substr(0,D.replace(/[?#].*/,"").lastIndexOf("/")+1):"";var q,En=c.print||console.log.bind(console),H=c.printErr||console.warn.bind(console);Object.assign(c,Rr),Rr=null,c.thisProgram&&(xr=c.thisProgram),c.wasmBinary&&(q=c.wasmBinary),c.noExitRuntime,typeof WebAssembly!="object"&&G("no native wasm support detected");var Ar,Tr,j,_,I,N,w,y,Yr,Hr,Vr,Br,zr=!1,qr=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function ar(r,n,e){var t=n+e;for(e=n;r[e]&&!(e>=t);)++e;if(16(a=(240&a)==224?(15&a)<<12|i<<6|f:(7&a)<<18|i<<12|f<<6|63&r[n++])?t+=String.fromCharCode(a):(a-=65536,t+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else t+=String.fromCharCode(a)}return t}function Nr(r,n,e,t){if(0=i&&(i=65536+((1023&i)<<10)|1023&r.charCodeAt(++a)),127>=i){if(e>=t)break;n[e++]=i}else{if(2047>=i){if(e+1>=t)break;n[e++]=192|i>>6}else{if(65535>=i){if(e+2>=t)break;n[e++]=224|i>>12}else{if(e+3>=t)break;n[e++]=240|i>>18,n[e++]=128|i>>12&63}n[e++]=128|i>>6&63}n[e++]=128|63&i}}n[e]=0}}function Lr(r){for(var n=0,e=0;e=t?n++:2047>=t?n+=2:55296<=t&&57343>=t?(n+=4,++e):n+=3}return n}function Gr(){var r=Ar.buffer;Tr=r,c.HEAP8=j=new Int8Array(r),c.HEAP16=I=new Int16Array(r),c.HEAP32=w=new Int32Array(r),c.HEAPU8=_=new Uint8Array(r),c.HEAPU16=N=new Uint16Array(r),c.HEAPU32=y=new Uint32Array(r),c.HEAPF32=Yr=new Float32Array(r),c.HEAPF64=Br=new Float64Array(r),c.HEAP64=Hr=new BigInt64Array(r),c.HEAPU64=Vr=new BigUint64Array(r)}var Jr,Xr=[],Zr=[],Kr=[];function On(){var r=c.preRun.shift();Xr.unshift(r)}var S,R=0,L=null;function G(r){throw c.onAbort&&c.onAbort(r),H(r="Aborted("+r+")"),zr=!0,r=new WebAssembly.RuntimeError(r+". Build with -sASSERTIONS for more info."),tr(r),r}function Qr(){return S.startsWith("data:application/octet-stream;base64,")}if(S="arcgis-knowledge-client-core.wasm",!Qr()){var rn=S;S=c.locateFile?c.locateFile(rn,D):D+rn}function nn(){var r=S;try{if(r==S&&q)return new Uint8Array(q);throw"both async and sync fetching of the wasm failed"}catch(n){G(n)}}function jn(){return q||typeof fetch!="function"?Promise.resolve().then(function(){return nn()}):fetch(S,{credentials:"same-origin"}).then(function(r){if(!r.ok)throw"failed to load wasm binary file at '"+S+"'";return r.arrayBuffer()}).catch(function(){return nn()})}function _r(r){for(;0>2]=n},this.Oa=function(n){y[this.fa+8>>2]=n},this.Ua=function(){w[this.fa>>2]=0},this.Ma=function(){j[this.fa+12>>0]=0},this.Va=function(){j[this.fa+13>>0]=0},this.Ia=function(n,e){this.La(),this.Ya(n),this.Oa(e),this.Ua(),this.Ma(),this.Va()},this.La=function(){y[this.fa+16>>2]=0}}var ir={};function or(r){for(;r.length;){var n=r.pop();r.pop()(n)}}function J(r){return this.fromWireType(w[r>>2])}var V={},x={},ur={};function en(r){if(r===void 0)return"_unknown";var n=(r=r.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=n&&57>=n?"_"+r:r}function Cr(r,n){return r=en(r),function(){return n.apply(this,arguments)}}function Pr(r){var n=Error,e=Cr(r,function(t){this.name=r,this.message=t,(t=Error(t).stack)!==void 0&&(this.stack=this.toString()+` `+t.replace(/^Error(:[^\n]*)?\n/,""))});return e.prototype=Object.create(n.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},e}var tn=void 0;function cr(r){throw new tn(r)}function $(r,n,e){function t(u){(u=e(u)).length!==r.length&&cr("Mismatched type converter count");for(var l=0;l{x.hasOwnProperty(u)?a[l]=x[u]:(i.push(u),V.hasOwnProperty(u)||(V[u]=[]),V[u].push(()=>{a[l]=x[u],++f===i.length&&t(a)}))}),i.length===0&&t(a)}function X(r){if(r===null)return"null";var n=typeof r;return n==="object"||n==="array"||n==="function"?r.toString():""+r}var an=void 0;function b(r){for(var n="";_[r];)n+=an[_[r++]];return n}var B=void 0;function g(r){throw new B(r)}function k(r,n,e={}){if(!("argPackAdvance"in n))throw new TypeError("registerType registeredInstance requires argPackAdvance");var t=n.name;if(r||g('type "'+t+'" must have a positive integer typeid pointer'),x.hasOwnProperty(r)){if(e.Wa)return;g("Cannot register type '"+t+"' twice")}x[r]=n,delete ur[r],V.hasOwnProperty(r)&&(n=V[r],delete V[r],n.forEach(a=>a()))}function on(r,n,e){switch(n){case 0:return e?function(t){return j[t]}:function(t){return _[t]};case 1:return e?function(t){return I[t>>1]}:function(t){return N[t>>1]};case 2:return e?function(t){return w[t>>2]}:function(t){return y[t>>2]};case 3:return e?function(t){return Hr[t>>3]}:function(t){return Vr[t>>3]};default:throw new TypeError("Unknown integer type: "+r)}}function Z(r){switch(r){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+r)}}function $r(r){g(r.da.ga.ea.name+" instance already deleted")}var kr=!1;function un(){}function cn(r){--r.count.value,r.count.value===0&&(r.ia?r.ka.na(r.ia):r.ga.ea.na(r.fa))}function fn(r,n,e){return n===e?r:e.la===void 0||(r=fn(r,n,e.la))===null?null:e.Ka(r)}var sn={},K=[];function Wr(){for(;K.length;){var r=K.pop();r.da.ta=!1,r.delete()}}var Q=void 0,rr={};function Fn(r,n){for(n===void 0&&g("ptr should not be undefined");r.la;)n=r.va(n),r=r.la;return rr[n]}function fr(r,n){return n.ga&&n.fa||cr("makeClassHandle requires ptr and ptrType"),!!n.ka!=!!n.ia&&cr("Both smartPtrType and smartPtr must be specified"),n.count={value:1},sr(Object.create(r,{da:{value:n}}))}function sr(r){return typeof FinalizationRegistry>"u"?(sr=n=>n,r):(kr=new FinalizationRegistry(n=>{cn(n.da)}),un=n=>{kr.unregister(n)},(sr=n=>{var e=n.da;return e.ia&&kr.register(n,{da:e},n),n})(r))}function M(){}function Er(r,n,e){if(r[n].ha===void 0){var t=r[n];r[n]=function(){return r[n].ha.hasOwnProperty(arguments.length)||g("Function '"+e+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+r[n].ha+")!"),r[n].ha[arguments.length].apply(this,arguments)},r[n].ha=[],r[n].ha[t.sa]=t}}function Or(r,n,e){c.hasOwnProperty(r)?((e===void 0||c[r].ha!==void 0&&c[r].ha[e]!==void 0)&&g("Cannot register public name '"+r+"' twice"),Er(c,r,r),c.hasOwnProperty(e)&&g("Cannot register multiple overloads of a function with the same number of arguments ("+e+")!"),c[r].ha[e]=n):(c[r]=n,e!==void 0&&(c[r].kb=e))}function Dn(r,n,e,t,a,i,f,u){this.name=r,this.constructor=n,this.oa=e,this.na=t,this.la=a,this.Pa=i,this.va=f,this.Ka=u,this.$a=[]}function lr(r,n,e){for(;n!==e;)n.va||g("Expected null or instance of "+e.name+", got an instance of "+n.name),r=n.va(r),n=n.la;return r}function Mn(r,n){return n===null?(this.Aa&&g("null is not a valid "+this.name),0):(n.da||g('Cannot pass "'+X(n)+'" as a '+this.name),n.da.fa||g("Cannot pass deleted object as a pointer of type "+this.name),lr(n.da.fa,n.da.ga.ea,this.ea))}function Un(r,n){if(n===null){if(this.Aa&&g("null is not a valid "+this.name),this.xa){var e=this.Ba();return r!==null&&r.push(this.na,e),e}return 0}if(n.da||g('Cannot pass "'+X(n)+'" as a '+this.name),n.da.fa||g("Cannot pass deleted object as a pointer of type "+this.name),!this.wa&&n.da.ga.wa&&g("Cannot convert argument of type "+(n.da.ka?n.da.ka.name:n.da.ga.name)+" to parameter type "+this.name),e=lr(n.da.fa,n.da.ga.ea,this.ea),this.xa)switch(n.da.ia===void 0&&g("Passing raw pointer to smart pointer is illegal"),this.fb){case 0:n.da.ka===this?e=n.da.ia:g("Cannot convert argument of type "+(n.da.ka?n.da.ka.name:n.da.ga.name)+" to parameter type "+this.name);break;case 1:e=n.da.ia;break;case 2:if(n.da.ka===this)e=n.da.ia;else{var t=n.clone();e=this.ab(e,E(function(){t.delete()})),r!==null&&r.push(this.na,e)}break;default:g("Unsupporting sharing policy")}return e}function In(r,n){return n===null?(this.Aa&&g("null is not a valid "+this.name),0):(n.da||g('Cannot pass "'+X(n)+'" as a '+this.name),n.da.fa||g("Cannot pass deleted object as a pointer of type "+this.name),n.da.ga.wa&&g("Cannot convert argument of type "+n.da.ga.name+" to parameter type "+this.name),lr(n.da.fa,n.da.ga.ea,this.ea))}function O(r,n,e,t,a,i,f,u,l,s,h){this.name=r,this.ea=n,this.Aa=e,this.wa=t,this.xa=a,this.Za=i,this.fb=f,this.Ga=u,this.Ba=l,this.ab=s,this.na=h,a||n.la!==void 0?this.toWireType=Un:(this.toWireType=t?Mn:In,this.ja=null)}function ln(r,n,e){c.hasOwnProperty(r)||cr("Replacing nonexistant public symbol"),c[r].ha!==void 0&&e!==void 0?c[r].ha[e]=n:(c[r]=n,c[r].sa=e)}var hr=[];function T(r,n){r=b(r);var e=hr[n];return e||(n>=hr.length&&(hr.length=n+1),hr[n]=e=Jr.get(n)),typeof e!="function"&&g("unknown function pointer with signature "+r+": "+n),e}var hn=void 0;function dn(r){var n=b(r=_n(r));return F(r),n}function Y(r,n){function e(i){a[i]||x[i]||(ur[i]?ur[i].forEach(e):(t.push(i),a[i]=!0))}var t=[],a={};throw n.forEach(e),new hn(r+": "+t.map(dn).join([", "]))}function dr(r,n,e,t,a){var i=n.length;2>i&&g("argTypes array size mismatch! Must at least get return value and 'this' types!");var f=n[1]!==null&&e!==null,u=!1;for(e=1;e>2]);return e}function pn(r,n,e){return r instanceof Object||g(e+' with invalid "this": '+r),r instanceof n.ea.constructor||g(e+' incompatible with "this" of type '+r.constructor.name),r.da.fa||g("cannot call emscripten binding method "+e+" on deleted object"),lr(r.da.fa,r.da.ga.ea,n.ea)}var jr=[],W=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Sr(r){4(r||g("Cannot use deleted val. handle = "+r),W[r].value),E=r=>{switch(r){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var n=jr.length?jr.pop():W.length;return W[n]={Ca:1,value:r},n}};function Rn(r,n,e){switch(n){case 0:return function(t){return this.fromWireType((e?j:_)[t])};case 1:return function(t){return this.fromWireType((e?I:N)[t>>1])};case 2:return function(t){return this.fromWireType((e?w:y)[t>>2])};default:throw new TypeError("Unknown integer type: "+r)}}function nr(r,n){var e=x[r];return e===void 0&&g(n+" has unknown type "+dn(r)),e}function xn(r,n){switch(n){case 2:return function(e){return this.fromWireType(Yr[e>>2])};case 3:return function(e){return this.fromWireType(Br[e>>3])};default:throw new TypeError("Unknown float type: "+r)}}var vn=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0;function Yn(r,n){for(var e=r>>1,t=e+n/2;!(e>=t)&&N[e];)++e;if(32<(e<<=1)-r&&vn)return vn.decode(_.subarray(r,e));for(e="",t=0;!(t>=n/2);++t){var a=I[r+2*t>>1];if(a==0)break;e+=String.fromCharCode(a)}return e}function Hn(r,n,e){if(e===void 0&&(e=2147483647),2>e)return 0;var t=n;e=(e-=2)<2*r.length?e/2:r.length;for(var a=0;a>1]=r.charCodeAt(a),n+=2;return I[n>>1]=0,n-t}function Vn(r){return 2*r.length}function Bn(r,n){for(var e=0,t="";!(e>=n/4);){var a=w[r+4*e>>2];if(a==0)break;++e,65536<=a?(a-=65536,t+=String.fromCharCode(55296|a>>10,56320|1023&a)):t+=String.fromCharCode(a)}return t}function zn(r,n,e){if(e===void 0&&(e=2147483647),4>e)return 0;var t=n;e=t+e-4;for(var a=0;a=i&&(i=65536+((1023&i)<<10)|1023&r.charCodeAt(++a)),w[n>>2]=i,(n+=4)+4>e)break}return w[n>>2]=0,n-t}function qn(r){for(var n=0,e=0;e=t&&++e,n+=4}return n}function mn(r,n){for(var e=Array(r),t=0;t>2],"parameter "+t);return e}var Nn={};function vr(r){var n=Nn[r];return n===void 0?b(r):n}var mr=[];function gn(){function r(n){n.$$$embind_global$$$=n;var e=typeof $$$embind_global$$$=="object"&&n.$$$embind_global$$$==n;return e||delete n.$$$embind_global$$$,e}if(typeof globalThis=="object")return globalThis;if(typeof $$$embind_global$$$=="object"||(typeof Mr=="object"&&r(Mr)?$$$embind_global$$$=Mr:typeof self=="object"&&r(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")}function Ln(r){var n=mr.length;return mr.push(r),n}var yn=[],Fr={};function bn(){if(!Dr){var r,n={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:xr||"./this.program"};for(r in Fr)Fr[r]===void 0?delete n[r]:n[r]=Fr[r];var e=[];for(r in n)e.push(r+"="+n[r]);Dr=e}return Dr}var Dr,Gn=[null,[],[]];function gr(r){return r%4==0&&(r%100!=0||r%400==0)}var wn=[31,29,31,30,31,30,31,31,30,31,30,31],An=[31,28,31,30,31,30,31,31,30,31,30,31];function Jn(r){var n=Array(Lr(r)+1);return Nr(r,n,0,n.length),n}function Xn(r,n,e,t){function a(o,d,m){for(o=typeof o=="number"?o.toString():o||"";o.lengthP?-1:0A-o.getDate())){o.setDate(o.getDate()+d);break}d-=A-o.getDate()+1,o.setDate(1),11>m?o.setMonth(m+1):(o.setMonth(0),o.setFullYear(o.getFullYear()+1))}return m=new Date(o.getFullYear()+1,0,4),d=u(new Date(o.getFullYear(),0,4)),m=u(m),0>=f(d,o)?0>=f(m,o)?o.getFullYear()+1:o.getFullYear():o.getFullYear()-1}var s=w[t+40>>2];for(var h in t={ib:w[t>>2],hb:w[t+4>>2],ya:w[t+8>>2],Da:w[t+12>>2],za:w[t+16>>2],ra:w[t+20>>2],ma:w[t+24>>2],qa:w[t+28>>2],lb:w[t+32>>2],gb:w[t+36>>2],jb:s&&s?ar(_,s):""},e=e?ar(_,e):"",s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})e=e.replace(new RegExp(h,"g"),s[h]);var p="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),v="January February March April May June July August September October November December".split(" ");for(h in s={"%a":function(o){return p[o.ma].substring(0,3)},"%A":function(o){return p[o.ma]},"%b":function(o){return v[o.za].substring(0,3)},"%B":function(o){return v[o.za]},"%C":function(o){return i((o.ra+1900)/100|0,2)},"%d":function(o){return i(o.Da,2)},"%e":function(o){return a(o.Da,2," ")},"%g":function(o){return l(o).toString().substring(2)},"%G":function(o){return l(o)},"%H":function(o){return i(o.ya,2)},"%I":function(o){return(o=o.ya)==0?o=12:12o.ya?"AM":"PM"},"%S":function(o){return i(o.ib,2)},"%t":function(){return" "},"%u":function(o){return o.ma||7},"%U":function(o){return i(Math.floor((o.qa+7-o.ma)/7),2)},"%V":function(o){var d=Math.floor((o.qa+7-(o.ma+6)%7)/7);if(2>=(o.ma+371-o.qa-2)%7&&d++,d)d==53&&((m=(o.ma+371-o.qa)%7)==4||m==3&&gr(o.ra)||(d=1));else{d=52;var m=(o.ma+7-o.qa-1)%7;(m==4||m==5&&gr(o.ra%400-1))&&d++}return i(d,2)},"%w":function(o){return o.ma},"%W":function(o){return i(Math.floor((o.qa+7-(o.ma+6)%7)/7),2)},"%y":function(o){return(o.ra+1900).toString().substring(2)},"%Y":function(o){return o.ra+1900},"%z":function(o){var d=0<=(o=o.gb);return o=Math.abs(o)/60,(d?"+":"-")+("0000"+(o/60*100+o%60)).slice(-4)},"%Z":function(o){return o.jb},"%%":function(){return"%"}},e=e.replace(/%%/g,"\0\0"),s)e.includes(h)&&(e=e.replace(new RegExp(h,"g"),s[h](t)));return(h=Jn(e=e.replace(/\0\0/g,"%"))).length>n?0:(j.set(h,r),h.length-1)}tn=c.InternalError=Pr("InternalError");for(var Tn=Array(256),yr=0;256>yr;++yr)Tn[yr]=String.fromCharCode(yr);an=Tn,B=c.BindingError=Pr("BindingError"),M.prototype.isAliasOf=function(r){if(!(this instanceof M&&r instanceof M))return!1;var n=this.da.ga.ea,e=this.da.fa,t=r.da.ga.ea;for(r=r.da.fa;n.la;)e=n.va(e),n=n.la;for(;t.la;)r=t.va(r),t=t.la;return n===t&&e===r},M.prototype.clone=function(){if(this.da.fa||$r(this),this.da.ua)return this.da.count.value+=1,this;var r=sr,n=Object,e=n.create,t=Object.getPrototypeOf(this),a=this.da;return(r=r(e.call(n,t,{da:{value:{count:a.count,ta:a.ta,ua:a.ua,fa:a.fa,ga:a.ga,ia:a.ia,ka:a.ka}}}))).da.count.value+=1,r.da.ta=!1,r},M.prototype.delete=function(){this.da.fa||$r(this),this.da.ta&&!this.da.ua&&g("Object already scheduled for deletion"),un(this),cn(this.da),this.da.ua||(this.da.ia=void 0,this.da.fa=void 0)},M.prototype.isDeleted=function(){return!this.da.fa},M.prototype.deleteLater=function(){return this.da.fa||$r(this),this.da.ta&&!this.da.ua&&g("Object already scheduled for deletion"),K.push(this),K.length===1&&Q&&Q(Wr),this.da.ta=!0,this},c.getInheritedInstanceCount=function(){return Object.keys(rr).length},c.getLiveInheritedInstances=function(){var r,n=[];for(r in rr)rr.hasOwnProperty(r)&&n.push(rr[r]);return n},c.flushPendingDeletes=Wr,c.setDelayFunction=function(r){Q=r,K.length&&Q&&Q(Wr)},O.prototype.Qa=function(r){return this.Ga&&(r=this.Ga(r)),r},O.prototype.Ea=function(r){this.na&&this.na(r)},O.prototype.argPackAdvance=8,O.prototype.readValueFromPointer=J,O.prototype.deleteObject=function(r){r!==null&&r.delete()},O.prototype.fromWireType=function(r){function n(){return this.xa?fr(this.ea.oa,{ga:this.Za,fa:e,ka:this,ia:r}):fr(this.ea.oa,{ga:this,fa:r})}var e=this.Qa(r);if(!e)return this.Ea(r),null;var t=Fn(this.ea,e);if(t!==void 0)return t.da.count.value===0?(t.da.fa=e,t.da.ia=r,t.clone()):(t=t.clone(),this.Ea(r),t);if(t=this.ea.Pa(e),!(t=sn[t]))return n.call(this);t=this.wa?t.Ha:t.pointerType;var a=fn(e,this.ea,t.ea);return a===null?n.call(this):this.xa?fr(t.ea.oa,{ga:t,fa:a,ka:this,ia:r}):fr(t.ea.oa,{ga:t,fa:a})},hn=c.UnboundTypeError=Pr("UnboundTypeError"),c.count_emval_handles=function(){for(var r=0,n=5;ni.Ta).concat(a.map(i=>i.cb)),i=>{var f={};return a.forEach((u,l)=>{var s=i[l],h=u.Ra,p=u.Sa,v=i[l+a.length],o=u.bb,d=u.eb;f[u.Na]={read:m=>s.fromWireType(h(p,m)),write:(m,A)=>{var P=[];o(d,m,v.toWireType(P,A)),or(P)}}}),[{name:n.name,fromWireType:function(u){var l,s={};for(l in f)s[l]=f[l].read(u);return t(u),s},toWireType:function(u,l){for(var s in f)if(!(s in l))throw new TypeError('Missing field: "'+s+'"');var h=e();for(s in f)f[s].write(h,l[s]);return u!==null&&u.push(t,h),h},argPackAdvance:8,readValueFromPointer:J,ja:t}]})},E:function(r,n,e,t,a){n=b(n),e=Z(e);var i=n.indexOf("u")!=-1;i&&(a=(1n<<64n)-1n),k(r,{name:n,fromWireType:function(f){return f},toWireType:function(f,u){if(typeof u!="bigint"&&typeof u!="number")throw new TypeError('Cannot convert "'+X(u)+'" to '+this.name);if(ua)throw new TypeError('Passing a number "'+X(u)+'" from JS side to C/C++ side to an argument of type "'+n+'", which is outside the valid range ['+t+", "+a+"]!");return u},argPackAdvance:8,readValueFromPointer:on(n,e,!i),ja:null})},S:function(r,n,e,t,a){var i=Z(e);k(r,{name:n=b(n),fromWireType:function(f){return!!f},toWireType:function(f,u){return u?t:a},argPackAdvance:8,readValueFromPointer:function(f){if(e===1)var u=j;else if(e===2)u=I;else{if(e!==4)throw new TypeError("Unknown boolean type size: "+n);u=w}return this.fromWireType(u[f>>i])},ja:null})},f:function(r,n,e,t,a,i,f,u,l,s,h,p,v){h=b(h),i=T(a,i),u&&(u=T(f,u)),s&&(s=T(l,s)),v=T(p,v);var o=en(h);Or(o,function(){Y("Cannot construct "+h+" due to unbound types",[t])}),$([r,n,e],t?[t]:[],function(d){if(d=d[0],t)var m=d.ea,A=m.oa;else A=M.prototype;d=Cr(o,function(){if(Object.getPrototypeOf(this)!==P)throw new B("Use 'new' to construct "+h);if(U.pa===void 0)throw new B(h+" has no accessible constructor");var Pn=U.pa[arguments.length];if(Pn===void 0)throw new B("Tried to invoke ctor of "+h+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(U.pa).toString()+") parameters instead!");return Pn.apply(this,arguments)});var P=Object.create(A,{constructor:{value:d}});d.prototype=P;var U=new Dn(h,d,P,v,m,i,u,s);m=new O(h,U,!0,!1,!1),A=new O(h+"*",U,!1,!1,!1);var er=new O(h+" const*",U,!1,!0,!1);return sn[r]={pointerType:A,Ha:er},ln(o,d),[m,A,er]})},o:function(r,n,e,t,a,i,f){var u=pr(e,t);n=b(n),i=T(a,i),$([],[r],function(l){function s(){Y("Cannot call "+h+" due to unbound types",u)}var h=(l=l[0]).name+"."+n;n.startsWith("@@")&&(n=Symbol[n.substring(2)]);var p=l.ea.constructor;return p[n]===void 0?(s.sa=e-1,p[n]=s):(Er(p,n,h),p[n].ha[e-1]=s),$([],u,function(v){return v=dr(h,[v[0],null].concat(v.slice(1)),null,i,f),p[n].ha===void 0?(v.sa=e-1,p[n]=v):p[n].ha[e-1]=v,[]}),[]})},i:function(r,n,e,t,a,i){0{Y("Cannot construct "+u.name+" due to unbound types",f)},$([],f,function(s){return s.splice(1,0,null),u.ea.pa[n-1]=dr(l,s,null,a,i),[]}),[]})},b:function(r,n,e,t,a,i,f,u){var l=pr(e,t);n=b(n),i=T(a,i),$([],[r],function(s){function h(){Y("Cannot call "+p+" due to unbound types",l)}var p=(s=s[0]).name+"."+n;n.startsWith("@@")&&(n=Symbol[n.substring(2)]),u&&s.ea.$a.push(n);var v=s.ea.oa,o=v[n];return o===void 0||o.ha===void 0&&o.className!==s.name&&o.sa===e-2?(h.sa=e-2,h.className=s.name,v[n]=h):(Er(v,n,p),v[n].ha[e-2]=h),$([],l,function(d){return d=dr(p,d,s,i,f),v[n].ha===void 0?(d.sa=e-2,v[n]=d):v[n].ha[e-2]=d,[]}),[]})},c:function(r,n,e,t,a,i,f,u,l,s){n=b(n),a=T(t,a),$([],[r],function(h){var p=(h=h[0]).name+"."+n,v={get:function(){Y("Cannot access "+p+" due to unbound types",[e,f])},enumerable:!0,configurable:!0};return v.set=l?()=>{Y("Cannot access "+p+" due to unbound types",[e,f])}:()=>{g(p+" is a read-only property")},Object.defineProperty(h.ea.oa,n,v),$([],l?[e,f]:[e],function(o){var d=o[0],m={get:function(){var P=pn(this,h,p+" getter");return d.fromWireType(a(i,P))},enumerable:!0};if(l){l=T(u,l);var A=o[1];m.set=function(P){var U=pn(this,h,p+" setter"),er=[];l(s,U,A.toWireType(er,P)),or(er)}}return Object.defineProperty(h.ea.oa,n,m),[]}),[]})},R:function(r,n){k(r,{name:n=b(n),fromWireType:function(e){var t=C(e);return Sr(e),t},toWireType:function(e,t){return E(t)},argPackAdvance:8,readValueFromPointer:J,ja:null})},s:function(r,n,e,t){function a(){}e=Z(e),n=b(n),a.values={},k(r,{name:n,constructor:a,fromWireType:function(i){return this.constructor.values[i]},toWireType:function(i,f){return f.value},argPackAdvance:8,readValueFromPointer:Rn(n,e,t),ja:null}),Or(n,a)},e:function(r,n,e){var t=nr(r,"enum");n=b(n),r=t.constructor,t=Object.create(t.constructor.prototype,{value:{value:e},constructor:{value:Cr(t.name+"_"+n,function(){})}}),r.values[e]=t,r[n]=t},D:function(r,n,e){e=Z(e),k(r,{name:n=b(n),fromWireType:function(t){return t},toWireType:function(t,a){return a},argPackAdvance:8,readValueFromPointer:xn(n,e),ja:null})},V:function(r,n,e,t,a,i){var f=pr(n,e);r=b(r),a=T(t,a),Or(r,function(){Y("Cannot call "+r+" due to unbound types",f)},n-1),$([],f,function(u){return ln(r,dr(r,[u[0],null].concat(u.slice(1)),null,a,i),n-1),[]})},w:function(r,n,e,t,a){n=b(n),a===-1&&(a=4294967295),a=Z(e);var i=u=>u;if(t===0){var f=32-8*e;i=u=>u<>>f}e=n.includes("unsigned")?function(u,l){return l>>>0}:function(u,l){return l},k(r,{name:n,fromWireType:i,toWireType:e,argPackAdvance:8,readValueFromPointer:on(n,a,t!==0),ja:null})},q:function(r,n,e){function t(i){var f=y;return new a(Tr,f[1+(i>>=2)],f[i])}var a=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][n];k(r,{name:e=b(e),fromWireType:t,argPackAdvance:8,readValueFromPointer:t},{Wa:!0})},h:function(r,n,e,t,a,i,f,u,l,s,h,p){e=b(e),i=T(a,i),u=T(f,u),s=T(l,s),p=T(h,p),$([r],[n],function(v){return v=v[0],[new O(e,v.ea,!1,!1,!0,v,t,i,u,s,p)]})},F:function(r,n){var e=(n=b(n))==="std::string";k(r,{name:n,fromWireType:function(t){var a=y[t>>2],i=t+4;if(e)for(var f=i,u=0;u<=a;++u){var l=i+u;if(u==a||_[l]==0){if(f=f?ar(_,f,l-f):"",s===void 0)var s=f;else s+="\0",s+=f;f=l+1}}else{for(s=Array(a),u=0;u>2]=f,e&&i)Nr(a,_,l,f+1);else if(i)for(i=0;iN,u=1;else n===4&&(t=Bn,a=zn,i=qn,f=()=>y,u=2);k(r,{name:e,fromWireType:function(l){for(var s,h=y[l>>2],p=f(),v=l+4,o=0;o<=h;++o){var d=l+4+o*n;o!=h&&p[d>>u]!=0||(v=t(v,d-v),s===void 0?s=v:(s+="\0",s+=v),v=d+n)}return F(l),s},toWireType:function(l,s){typeof s!="string"&&g("Cannot pass non-string to C++ string type "+e);var h=i(s),p=wr(4+h+n);return y[p>>2]=h>>u,a(s,p+4,h+n),l!==null&&l.push(F,p),p},argPackAdvance:8,readValueFromPointer:J,ja:function(l){F(l)}})},v:function(r,n,e,t,a,i){ir[r]={name:b(n),Ba:T(e,t),na:T(a,i),Fa:[]}},l:function(r,n,e,t,a,i,f,u,l,s){ir[r].Fa.push({Na:b(n),Ta:e,Ra:T(t,a),Sa:i,cb:f,bb:T(u,l),eb:s})},T:function(r,n){k(r,{Xa:!0,name:n=b(n),argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},k:function(r,n,e){r=C(r),n=nr(n,"emval::as");var t=[],a=E(t);return y[e>>2]=a,n.toWireType(t,r)},z:function(r,n){return r=C(r),(n=nr(n,"emval::as")).toWireType(null,r)},W:function(r,n,e,t){r=C(r),e=mn(n,e);for(var a=Array(n),i=0;i>2]=E(i),r(n,e,i,a)},G:function(r,n,e,t){(r=mr[r])(n=C(n),e=vr(e),null,t)},a:Sr,H:function(r){return r===0?E(gn()):(r=vr(r),E(gn()[r]))},B:function(r,n){var e=mn(r,n),t=e[0];n=t.name+"_$"+e.slice(1).map(function(f){return f.name}).join("_")+"$";var a=yn[n];if(a!==void 0)return a;var i=Array(r-1);return a=Ln((f,u,l,s)=>{for(var h=0,p=0;p>>=0))return!1;for(var e=1;4>=e;e*=2){var t=n*(1+.2/e);t=Math.min(t,r+100663296);var a=Math;t=Math.max(r,t),a=a.min.call(a,2147483648,t+(65536-t%65536)%65536);r:{try{Ar.grow(a-Tr.byteLength+65535>>>16),Gr();var i=1;break r}catch{}i=void 0}if(i)return!0}return!1},K:function(r,n){var e=0;return bn().forEach(function(t,a){var i=n+e;for(a=y[r+4*a>>2]=i,i=0;i>0]=t.charCodeAt(i);j[a>>0]=0,e+=t.length+1}),0},L:function(r,n){var e=bn();y[r>>2]=e.length;var t=0;return e.forEach(function(a){t+=a.length+1}),y[n>>2]=t,0},Q:function(){return 52},P:function(){return 70},O:function(r,n,e,t){for(var a=0,i=0;i>2],u=y[n+4>>2];n+=8;for(var l=0;l>2]=a,0},J:function(r,n,e,t){return Xn(r,n,e,t)}};(function(){function r(a){c.asm=a.exports,Ar=c.asm.X,Gr(),Jr=c.asm.ba,Zr.unshift(c.asm.Y),R--,c.monitorRunDependencies&&c.monitorRunDependencies(R),R==0&&L&&(a=L,L=null,a())}function n(a){r(a.instance)}function e(a){return jn().then(function(i){return WebAssembly.instantiate(i,t)}).then(function(i){return i}).then(a,function(i){H("failed to asynchronously prepare wasm: "+i),G(i)})}var t={a:Zn};if(R++,c.monitorRunDependencies&&c.monitorRunDependencies(R),c.instantiateWasm)try{return c.instantiateWasm(t,r)}catch(a){H("Module.instantiateWasm callback failed with error: "+a),tr(a)}(q||typeof WebAssembly.instantiateStreaming!="function"||Qr()||typeof fetch!="function"?e(n):fetch(S,{credentials:"same-origin"}).then(function(a){return WebAssembly.instantiateStreaming(a,t).then(n,function(i){return H("wasm streaming compile failed: "+i),H("falling back to ArrayBuffer instantiation"),e(n)})})).catch(tr)})(),c.___wasm_call_ctors=function(){return(c.___wasm_call_ctors=c.asm.Y).apply(null,arguments)};var br,wr=c._malloc=function(){return(wr=c._malloc=c.asm.Z).apply(null,arguments)},F=c._free=function(){return(F=c._free=c.asm._).apply(null,arguments)},_n=c.___getTypeName=function(){return(_n=c.___getTypeName=c.asm.$).apply(null,arguments)};function Cn(){function r(){if(!br&&(br=!0,c.calledRun=!0,!zr)){if(_r(Zr),Ir(c),c.onRuntimeInitialized&&c.onRuntimeInitialized(),c.postRun)for(typeof c.postRun=="function"&&(c.postRun=[c.postRun]);c.postRun.length;){var n=c.postRun.shift();Kr.unshift(n)}_r(Kr)}}if(!(0=t);)++e;if(16(a=(240&a)==224?(15&a)<<12|o<<6|f:(7&a)<<18|o<<12|f<<6|63&r[n++])?t+=String.fromCharCode(a):(a-=65536,t+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else t+=String.fromCharCode(a)}return t}function Nr(r,n,e,t){if(0=o&&(o=65536+((1023&o)<<10)|1023&r.charCodeAt(++a)),127>=o){if(e>=t)break;n[e++]=o}else{if(2047>=o){if(e+1>=t)break;n[e++]=192|o>>6}else{if(65535>=o){if(e+2>=t)break;n[e++]=224|o>>12}else{if(e+3>=t)break;n[e++]=240|o>>18,n[e++]=128|o>>12&63}n[e++]=128|o>>6&63}n[e++]=128|63&o}}n[e]=0}}function Lr(r){for(var n=0,e=0;e=t?n++:2047>=t?n+=2:55296<=t&&57343>=t?(n+=4,++e):n+=3}return n}function Gr(){var r=Ar.buffer;Tr=r,c.HEAP8=j=new Int8Array(r),c.HEAP16=I=new Int16Array(r),c.HEAP32=w=new Int32Array(r),c.HEAPU8=_=new Uint8Array(r),c.HEAPU16=N=new Uint16Array(r),c.HEAPU32=y=new Uint32Array(r),c.HEAPF32=Yr=new Float32Array(r),c.HEAPF64=Br=new Float64Array(r),c.HEAP64=Hr=new BigInt64Array(r),c.HEAPU64=Vr=new BigUint64Array(r)}var Jr,Xr=[],Zr=[],Kr=[];function On(){var r=c.preRun.shift();Xr.unshift(r)}var S,R=0,L=null;function G(r){throw c.onAbort&&c.onAbort(r),H(r="Aborted("+r+")"),zr=!0,r=new WebAssembly.RuntimeError(r+". Build with -sASSERTIONS for more info."),tr(r),r}function Qr(){return S.startsWith("data:application/octet-stream;base64,")}if(S="arcgis-knowledge-client-core-simd.wasm",!Qr()){var rn=S;S=c.locateFile?c.locateFile(rn,D):D+rn}function nn(){var r=S;try{if(r==S&&q)return new Uint8Array(q);throw"both async and sync fetching of the wasm failed"}catch(n){G(n)}}function jn(){return q||typeof fetch!="function"?Promise.resolve().then(function(){return nn()}):fetch(S,{credentials:"same-origin"}).then(function(r){if(!r.ok)throw"failed to load wasm binary file at '"+S+"'";return r.arrayBuffer()}).catch(function(){return nn()})}function _r(r){for(;0>2]=n},this.Oa=function(n){y[this.fa+8>>2]=n},this.Ua=function(){w[this.fa>>2]=0},this.Ma=function(){j[this.fa+12>>0]=0},this.Va=function(){j[this.fa+13>>0]=0},this.Ia=function(n,e){this.La(),this.Ya(n),this.Oa(e),this.Ua(),this.Ma(),this.Va()},this.La=function(){y[this.fa+16>>2]=0}}var or={};function ir(r){for(;r.length;){var n=r.pop();r.pop()(n)}}function J(r){return this.fromWireType(w[r>>2])}var V={},x={},ur={};function en(r){if(r===void 0)return"_unknown";var n=(r=r.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=n&&57>=n?"_"+r:r}function Cr(r,n){return r=en(r),function(){return n.apply(this,arguments)}}function Pr(r){var n=Error,e=Cr(r,function(t){this.name=r,this.message=t,(t=Error(t).stack)!==void 0&&(this.stack=this.toString()+` +import{ar as Kn,es as Mr}from"./index-BjUNJPVf.js";var $n,Ur,kn,Wn={exports:{}};$n=Wn,Ur=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,kn=function(z){var c,Ir,tr;z=z||{},c||(c=z!==void 0?z:{}),c.ready=new Promise(function(r,n){Ir=r,tr=n});var Rr=Object.assign({},c),xr="./this.program",D="";typeof document<"u"&&document.currentScript&&(D=document.currentScript.src),Ur&&(D=Ur),D=D.indexOf("blob:")!==0?D.substr(0,D.replace(/[?#].*/,"").lastIndexOf("/")+1):"";var q,En=c.print||console.log.bind(console),H=c.printErr||console.warn.bind(console);Object.assign(c,Rr),Rr=null,c.thisProgram&&(xr=c.thisProgram),c.wasmBinary&&(q=c.wasmBinary),c.noExitRuntime,typeof WebAssembly!="object"&&G("no native wasm support detected");var Ar,Tr,j,_,I,N,w,y,Yr,Hr,Vr,Br,zr=!1,qr=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function ar(r,n,e){var t=n+e;for(e=n;r[e]&&!(e>=t);)++e;if(16(a=(240&a)==224?(15&a)<<12|o<<6|f:(7&a)<<18|o<<12|f<<6|63&r[n++])?t+=String.fromCharCode(a):(a-=65536,t+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else t+=String.fromCharCode(a)}return t}function Nr(r,n,e,t){if(0=o&&(o=65536+((1023&o)<<10)|1023&r.charCodeAt(++a)),127>=o){if(e>=t)break;n[e++]=o}else{if(2047>=o){if(e+1>=t)break;n[e++]=192|o>>6}else{if(65535>=o){if(e+2>=t)break;n[e++]=224|o>>12}else{if(e+3>=t)break;n[e++]=240|o>>18,n[e++]=128|o>>12&63}n[e++]=128|o>>6&63}n[e++]=128|63&o}}n[e]=0}}function Lr(r){for(var n=0,e=0;e=t?n++:2047>=t?n+=2:55296<=t&&57343>=t?(n+=4,++e):n+=3}return n}function Gr(){var r=Ar.buffer;Tr=r,c.HEAP8=j=new Int8Array(r),c.HEAP16=I=new Int16Array(r),c.HEAP32=w=new Int32Array(r),c.HEAPU8=_=new Uint8Array(r),c.HEAPU16=N=new Uint16Array(r),c.HEAPU32=y=new Uint32Array(r),c.HEAPF32=Yr=new Float32Array(r),c.HEAPF64=Br=new Float64Array(r),c.HEAP64=Hr=new BigInt64Array(r),c.HEAPU64=Vr=new BigUint64Array(r)}var Jr,Xr=[],Zr=[],Kr=[];function On(){var r=c.preRun.shift();Xr.unshift(r)}var S,R=0,L=null;function G(r){throw c.onAbort&&c.onAbort(r),H(r="Aborted("+r+")"),zr=!0,r=new WebAssembly.RuntimeError(r+". Build with -sASSERTIONS for more info."),tr(r),r}function Qr(){return S.startsWith("data:application/octet-stream;base64,")}if(S="arcgis-knowledge-client-core-simd.wasm",!Qr()){var rn=S;S=c.locateFile?c.locateFile(rn,D):D+rn}function nn(){var r=S;try{if(r==S&&q)return new Uint8Array(q);throw"both async and sync fetching of the wasm failed"}catch(n){G(n)}}function jn(){return q||typeof fetch!="function"?Promise.resolve().then(function(){return nn()}):fetch(S,{credentials:"same-origin"}).then(function(r){if(!r.ok)throw"failed to load wasm binary file at '"+S+"'";return r.arrayBuffer()}).catch(function(){return nn()})}function _r(r){for(;0>2]=n},this.Oa=function(n){y[this.fa+8>>2]=n},this.Ua=function(){w[this.fa>>2]=0},this.Ma=function(){j[this.fa+12>>0]=0},this.Va=function(){j[this.fa+13>>0]=0},this.Ia=function(n,e){this.La(),this.Ya(n),this.Oa(e),this.Ua(),this.Ma(),this.Va()},this.La=function(){y[this.fa+16>>2]=0}}var or={};function ir(r){for(;r.length;){var n=r.pop();r.pop()(n)}}function J(r){return this.fromWireType(w[r>>2])}var V={},x={},ur={};function en(r){if(r===void 0)return"_unknown";var n=(r=r.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=n&&57>=n?"_"+r:r}function Cr(r,n){return r=en(r),function(){return n.apply(this,arguments)}}function Pr(r){var n=Error,e=Cr(r,function(t){this.name=r,this.message=t,(t=Error(t).stack)!==void 0&&(this.stack=this.toString()+` `+t.replace(/^Error(:[^\n]*)?\n/,""))});return e.prototype=Object.create(n.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},e}var tn=void 0;function cr(r){throw new tn(r)}function $(r,n,e){function t(u){(u=e(u)).length!==r.length&&cr("Mismatched type converter count");for(var l=0;l{x.hasOwnProperty(u)?a[l]=x[u]:(o.push(u),V.hasOwnProperty(u)||(V[u]=[]),V[u].push(()=>{a[l]=x[u],++f===o.length&&t(a)}))}),o.length===0&&t(a)}function X(r){if(r===null)return"null";var n=typeof r;return n==="object"||n==="array"||n==="function"?r.toString():""+r}var an=void 0;function b(r){for(var n="";_[r];)n+=an[_[r++]];return n}var B=void 0;function g(r){throw new B(r)}function k(r,n,e={}){if(!("argPackAdvance"in n))throw new TypeError("registerType registeredInstance requires argPackAdvance");var t=n.name;if(r||g('type "'+t+'" must have a positive integer typeid pointer'),x.hasOwnProperty(r)){if(e.Wa)return;g("Cannot register type '"+t+"' twice")}x[r]=n,delete ur[r],V.hasOwnProperty(r)&&(n=V[r],delete V[r],n.forEach(a=>a()))}function on(r,n,e){switch(n){case 0:return e?function(t){return j[t]}:function(t){return _[t]};case 1:return e?function(t){return I[t>>1]}:function(t){return N[t>>1]};case 2:return e?function(t){return w[t>>2]}:function(t){return y[t>>2]};case 3:return e?function(t){return Hr[t>>3]}:function(t){return Vr[t>>3]};default:throw new TypeError("Unknown integer type: "+r)}}function Z(r){switch(r){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+r)}}function $r(r){g(r.da.ga.ea.name+" instance already deleted")}var kr=!1;function un(){}function cn(r){--r.count.value,r.count.value===0&&(r.ia?r.ka.na(r.ia):r.ga.ea.na(r.fa))}function fn(r,n,e){return n===e?r:e.la===void 0||(r=fn(r,n,e.la))===null?null:e.Ka(r)}var sn={},K=[];function Wr(){for(;K.length;){var r=K.pop();r.da.ta=!1,r.delete()}}var Q=void 0,rr={};function Fn(r,n){for(n===void 0&&g("ptr should not be undefined");r.la;)n=r.va(n),r=r.la;return rr[n]}function fr(r,n){return n.ga&&n.fa||cr("makeClassHandle requires ptr and ptrType"),!!n.ka!=!!n.ia&&cr("Both smartPtrType and smartPtr must be specified"),n.count={value:1},sr(Object.create(r,{da:{value:n}}))}function sr(r){return typeof FinalizationRegistry>"u"?(sr=n=>n,r):(kr=new FinalizationRegistry(n=>{cn(n.da)}),un=n=>{kr.unregister(n)},(sr=n=>{var e=n.da;return e.ia&&kr.register(n,{da:e},n),n})(r))}function M(){}function Er(r,n,e){if(r[n].ha===void 0){var t=r[n];r[n]=function(){return r[n].ha.hasOwnProperty(arguments.length)||g("Function '"+e+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+r[n].ha+")!"),r[n].ha[arguments.length].apply(this,arguments)},r[n].ha=[],r[n].ha[t.sa]=t}}function Or(r,n,e){c.hasOwnProperty(r)?((e===void 0||c[r].ha!==void 0&&c[r].ha[e]!==void 0)&&g("Cannot register public name '"+r+"' twice"),Er(c,r,r),c.hasOwnProperty(e)&&g("Cannot register multiple overloads of a function with the same number of arguments ("+e+")!"),c[r].ha[e]=n):(c[r]=n,e!==void 0&&(c[r].kb=e))}function Dn(r,n,e,t,a,o,f,u){this.name=r,this.constructor=n,this.oa=e,this.na=t,this.la=a,this.Pa=o,this.va=f,this.Ka=u,this.$a=[]}function lr(r,n,e){for(;n!==e;)n.va||g("Expected null or instance of "+e.name+", got an instance of "+n.name),r=n.va(r),n=n.la;return r}function Mn(r,n){return n===null?(this.Aa&&g("null is not a valid "+this.name),0):(n.da||g('Cannot pass "'+X(n)+'" as a '+this.name),n.da.fa||g("Cannot pass deleted object as a pointer of type "+this.name),lr(n.da.fa,n.da.ga.ea,this.ea))}function Un(r,n){if(n===null){if(this.Aa&&g("null is not a valid "+this.name),this.xa){var e=this.Ba();return r!==null&&r.push(this.na,e),e}return 0}if(n.da||g('Cannot pass "'+X(n)+'" as a '+this.name),n.da.fa||g("Cannot pass deleted object as a pointer of type "+this.name),!this.wa&&n.da.ga.wa&&g("Cannot convert argument of type "+(n.da.ka?n.da.ka.name:n.da.ga.name)+" to parameter type "+this.name),e=lr(n.da.fa,n.da.ga.ea,this.ea),this.xa)switch(n.da.ia===void 0&&g("Passing raw pointer to smart pointer is illegal"),this.fb){case 0:n.da.ka===this?e=n.da.ia:g("Cannot convert argument of type "+(n.da.ka?n.da.ka.name:n.da.ga.name)+" to parameter type "+this.name);break;case 1:e=n.da.ia;break;case 2:if(n.da.ka===this)e=n.da.ia;else{var t=n.clone();e=this.ab(e,E(function(){t.delete()})),r!==null&&r.push(this.na,e)}break;default:g("Unsupporting sharing policy")}return e}function In(r,n){return n===null?(this.Aa&&g("null is not a valid "+this.name),0):(n.da||g('Cannot pass "'+X(n)+'" as a '+this.name),n.da.fa||g("Cannot pass deleted object as a pointer of type "+this.name),n.da.ga.wa&&g("Cannot convert argument of type "+n.da.ga.name+" to parameter type "+this.name),lr(n.da.fa,n.da.ga.ea,this.ea))}function O(r,n,e,t,a,o,f,u,l,s,h){this.name=r,this.ea=n,this.Aa=e,this.wa=t,this.xa=a,this.Za=o,this.fb=f,this.Ga=u,this.Ba=l,this.ab=s,this.na=h,a||n.la!==void 0?this.toWireType=Un:(this.toWireType=t?Mn:In,this.ja=null)}function ln(r,n,e){c.hasOwnProperty(r)||cr("Replacing nonexistant public symbol"),c[r].ha!==void 0&&e!==void 0?c[r].ha[e]=n:(c[r]=n,c[r].sa=e)}var hr=[];function T(r,n){r=b(r);var e=hr[n];return e||(n>=hr.length&&(hr.length=n+1),hr[n]=e=Jr.get(n)),typeof e!="function"&&g("unknown function pointer with signature "+r+": "+n),e}var hn=void 0;function dn(r){var n=b(r=_n(r));return F(r),n}function Y(r,n){function e(o){a[o]||x[o]||(ur[o]?ur[o].forEach(e):(t.push(o),a[o]=!0))}var t=[],a={};throw n.forEach(e),new hn(r+": "+t.map(dn).join([", "]))}function dr(r,n,e,t,a){var o=n.length;2>o&&g("argTypes array size mismatch! Must at least get return value and 'this' types!");var f=n[1]!==null&&e!==null,u=!1;for(e=1;e>2]);return e}function pn(r,n,e){return r instanceof Object||g(e+' with invalid "this": '+r),r instanceof n.ea.constructor||g(e+' incompatible with "this" of type '+r.constructor.name),r.da.fa||g("cannot call emscripten binding method "+e+" on deleted object"),lr(r.da.fa,r.da.ga.ea,n.ea)}var jr=[],W=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Sr(r){4(r||g("Cannot use deleted val. handle = "+r),W[r].value),E=r=>{switch(r){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var n=jr.length?jr.pop():W.length;return W[n]={Ca:1,value:r},n}};function Rn(r,n,e){switch(n){case 0:return function(t){return this.fromWireType((e?j:_)[t])};case 1:return function(t){return this.fromWireType((e?I:N)[t>>1])};case 2:return function(t){return this.fromWireType((e?w:y)[t>>2])};default:throw new TypeError("Unknown integer type: "+r)}}function nr(r,n){var e=x[r];return e===void 0&&g(n+" has unknown type "+dn(r)),e}function xn(r,n){switch(n){case 2:return function(e){return this.fromWireType(Yr[e>>2])};case 3:return function(e){return this.fromWireType(Br[e>>3])};default:throw new TypeError("Unknown float type: "+r)}}var vn=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0;function Yn(r,n){for(var e=r>>1,t=e+n/2;!(e>=t)&&N[e];)++e;if(32<(e<<=1)-r&&vn)return vn.decode(_.subarray(r,e));for(e="",t=0;!(t>=n/2);++t){var a=I[r+2*t>>1];if(a==0)break;e+=String.fromCharCode(a)}return e}function Hn(r,n,e){if(e===void 0&&(e=2147483647),2>e)return 0;var t=n;e=(e-=2)<2*r.length?e/2:r.length;for(var a=0;a>1]=r.charCodeAt(a),n+=2;return I[n>>1]=0,n-t}function Vn(r){return 2*r.length}function Bn(r,n){for(var e=0,t="";!(e>=n/4);){var a=w[r+4*e>>2];if(a==0)break;++e,65536<=a?(a-=65536,t+=String.fromCharCode(55296|a>>10,56320|1023&a)):t+=String.fromCharCode(a)}return t}function zn(r,n,e){if(e===void 0&&(e=2147483647),4>e)return 0;var t=n;e=t+e-4;for(var a=0;a=o&&(o=65536+((1023&o)<<10)|1023&r.charCodeAt(++a)),w[n>>2]=o,(n+=4)+4>e)break}return w[n>>2]=0,n-t}function qn(r){for(var n=0,e=0;e=t&&++e,n+=4}return n}function mn(r,n){for(var e=Array(r),t=0;t>2],"parameter "+t);return e}var Nn={};function vr(r){var n=Nn[r];return n===void 0?b(r):n}var mr=[];function gn(){function r(n){n.$$$embind_global$$$=n;var e=typeof $$$embind_global$$$=="object"&&n.$$$embind_global$$$==n;return e||delete n.$$$embind_global$$$,e}if(typeof globalThis=="object")return globalThis;if(typeof $$$embind_global$$$=="object"||(typeof Mr=="object"&&r(Mr)?$$$embind_global$$$=Mr:typeof self=="object"&&r(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")}function Ln(r){var n=mr.length;return mr.push(r),n}var yn=[],Fr={};function bn(){if(!Dr){var r,n={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:xr||"./this.program"};for(r in Fr)Fr[r]===void 0?delete n[r]:n[r]=Fr[r];var e=[];for(r in n)e.push(r+"="+n[r]);Dr=e}return Dr}var Dr,Gn=[null,[],[]];function gr(r){return r%4==0&&(r%100!=0||r%400==0)}var wn=[31,29,31,30,31,30,31,31,30,31,30,31],An=[31,28,31,30,31,30,31,31,30,31,30,31];function Jn(r){var n=Array(Lr(r)+1);return Nr(r,n,0,n.length),n}function Xn(r,n,e,t){function a(i,d,m){for(i=typeof i=="number"?i.toString():i||"";i.lengthP?-1:0A-i.getDate())){i.setDate(i.getDate()+d);break}d-=A-i.getDate()+1,i.setDate(1),11>m?i.setMonth(m+1):(i.setMonth(0),i.setFullYear(i.getFullYear()+1))}return m=new Date(i.getFullYear()+1,0,4),d=u(new Date(i.getFullYear(),0,4)),m=u(m),0>=f(d,i)?0>=f(m,i)?i.getFullYear()+1:i.getFullYear():i.getFullYear()-1}var s=w[t+40>>2];for(var h in t={ib:w[t>>2],hb:w[t+4>>2],ya:w[t+8>>2],Da:w[t+12>>2],za:w[t+16>>2],ra:w[t+20>>2],ma:w[t+24>>2],qa:w[t+28>>2],lb:w[t+32>>2],gb:w[t+36>>2],jb:s&&s?ar(_,s):""},e=e?ar(_,e):"",s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})e=e.replace(new RegExp(h,"g"),s[h]);var p="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),v="January February March April May June July August September October November December".split(" ");for(h in s={"%a":function(i){return p[i.ma].substring(0,3)},"%A":function(i){return p[i.ma]},"%b":function(i){return v[i.za].substring(0,3)},"%B":function(i){return v[i.za]},"%C":function(i){return o((i.ra+1900)/100|0,2)},"%d":function(i){return o(i.Da,2)},"%e":function(i){return a(i.Da,2," ")},"%g":function(i){return l(i).toString().substring(2)},"%G":function(i){return l(i)},"%H":function(i){return o(i.ya,2)},"%I":function(i){return(i=i.ya)==0?i=12:12i.ya?"AM":"PM"},"%S":function(i){return o(i.ib,2)},"%t":function(){return" "},"%u":function(i){return i.ma||7},"%U":function(i){return o(Math.floor((i.qa+7-i.ma)/7),2)},"%V":function(i){var d=Math.floor((i.qa+7-(i.ma+6)%7)/7);if(2>=(i.ma+371-i.qa-2)%7&&d++,d)d==53&&((m=(i.ma+371-i.qa)%7)==4||m==3&&gr(i.ra)||(d=1));else{d=52;var m=(i.ma+7-i.qa-1)%7;(m==4||m==5&&gr(i.ra%400-1))&&d++}return o(d,2)},"%w":function(i){return i.ma},"%W":function(i){return o(Math.floor((i.qa+7-(i.ma+6)%7)/7),2)},"%y":function(i){return(i.ra+1900).toString().substring(2)},"%Y":function(i){return i.ra+1900},"%z":function(i){var d=0<=(i=i.gb);return i=Math.abs(i)/60,(d?"+":"-")+("0000"+(i/60*100+i%60)).slice(-4)},"%Z":function(i){return i.jb},"%%":function(){return"%"}},e=e.replace(/%%/g,"\0\0"),s)e.includes(h)&&(e=e.replace(new RegExp(h,"g"),s[h](t)));return(h=Jn(e=e.replace(/\0\0/g,"%"))).length>n?0:(j.set(h,r),h.length-1)}tn=c.InternalError=Pr("InternalError");for(var Tn=Array(256),yr=0;256>yr;++yr)Tn[yr]=String.fromCharCode(yr);an=Tn,B=c.BindingError=Pr("BindingError"),M.prototype.isAliasOf=function(r){if(!(this instanceof M&&r instanceof M))return!1;var n=this.da.ga.ea,e=this.da.fa,t=r.da.ga.ea;for(r=r.da.fa;n.la;)e=n.va(e),n=n.la;for(;t.la;)r=t.va(r),t=t.la;return n===t&&e===r},M.prototype.clone=function(){if(this.da.fa||$r(this),this.da.ua)return this.da.count.value+=1,this;var r=sr,n=Object,e=n.create,t=Object.getPrototypeOf(this),a=this.da;return(r=r(e.call(n,t,{da:{value:{count:a.count,ta:a.ta,ua:a.ua,fa:a.fa,ga:a.ga,ia:a.ia,ka:a.ka}}}))).da.count.value+=1,r.da.ta=!1,r},M.prototype.delete=function(){this.da.fa||$r(this),this.da.ta&&!this.da.ua&&g("Object already scheduled for deletion"),un(this),cn(this.da),this.da.ua||(this.da.ia=void 0,this.da.fa=void 0)},M.prototype.isDeleted=function(){return!this.da.fa},M.prototype.deleteLater=function(){return this.da.fa||$r(this),this.da.ta&&!this.da.ua&&g("Object already scheduled for deletion"),K.push(this),K.length===1&&Q&&Q(Wr),this.da.ta=!0,this},c.getInheritedInstanceCount=function(){return Object.keys(rr).length},c.getLiveInheritedInstances=function(){var r,n=[];for(r in rr)rr.hasOwnProperty(r)&&n.push(rr[r]);return n},c.flushPendingDeletes=Wr,c.setDelayFunction=function(r){Q=r,K.length&&Q&&Q(Wr)},O.prototype.Qa=function(r){return this.Ga&&(r=this.Ga(r)),r},O.prototype.Ea=function(r){this.na&&this.na(r)},O.prototype.argPackAdvance=8,O.prototype.readValueFromPointer=J,O.prototype.deleteObject=function(r){r!==null&&r.delete()},O.prototype.fromWireType=function(r){function n(){return this.xa?fr(this.ea.oa,{ga:this.Za,fa:e,ka:this,ia:r}):fr(this.ea.oa,{ga:this,fa:r})}var e=this.Qa(r);if(!e)return this.Ea(r),null;var t=Fn(this.ea,e);if(t!==void 0)return t.da.count.value===0?(t.da.fa=e,t.da.ia=r,t.clone()):(t=t.clone(),this.Ea(r),t);if(t=this.ea.Pa(e),!(t=sn[t]))return n.call(this);t=this.wa?t.Ha:t.pointerType;var a=fn(e,this.ea,t.ea);return a===null?n.call(this):this.xa?fr(t.ea.oa,{ga:t,fa:a,ka:this,ia:r}):fr(t.ea.oa,{ga:t,fa:a})},hn=c.UnboundTypeError=Pr("UnboundTypeError"),c.count_emval_handles=function(){for(var r=0,n=5;no.Ta).concat(a.map(o=>o.cb)),o=>{var f={};return a.forEach((u,l)=>{var s=o[l],h=u.Ra,p=u.Sa,v=o[l+a.length],i=u.bb,d=u.eb;f[u.Na]={read:m=>s.fromWireType(h(p,m)),write:(m,A)=>{var P=[];i(d,m,v.toWireType(P,A)),ir(P)}}}),[{name:n.name,fromWireType:function(u){var l,s={};for(l in f)s[l]=f[l].read(u);return t(u),s},toWireType:function(u,l){for(var s in f)if(!(s in l))throw new TypeError('Missing field: "'+s+'"');var h=e();for(s in f)f[s].write(h,l[s]);return u!==null&&u.push(t,h),h},argPackAdvance:8,readValueFromPointer:J,ja:t}]})},E:function(r,n,e,t,a){n=b(n),e=Z(e);var o=n.indexOf("u")!=-1;o&&(a=(1n<<64n)-1n),k(r,{name:n,fromWireType:function(f){return f},toWireType:function(f,u){if(typeof u!="bigint"&&typeof u!="number")throw new TypeError('Cannot convert "'+X(u)+'" to '+this.name);if(ua)throw new TypeError('Passing a number "'+X(u)+'" from JS side to C/C++ side to an argument of type "'+n+'", which is outside the valid range ['+t+", "+a+"]!");return u},argPackAdvance:8,readValueFromPointer:on(n,e,!o),ja:null})},S:function(r,n,e,t,a){var o=Z(e);k(r,{name:n=b(n),fromWireType:function(f){return!!f},toWireType:function(f,u){return u?t:a},argPackAdvance:8,readValueFromPointer:function(f){if(e===1)var u=j;else if(e===2)u=I;else{if(e!==4)throw new TypeError("Unknown boolean type size: "+n);u=w}return this.fromWireType(u[f>>o])},ja:null})},f:function(r,n,e,t,a,o,f,u,l,s,h,p,v){h=b(h),o=T(a,o),u&&(u=T(f,u)),s&&(s=T(l,s)),v=T(p,v);var i=en(h);Or(i,function(){Y("Cannot construct "+h+" due to unbound types",[t])}),$([r,n,e],t?[t]:[],function(d){if(d=d[0],t)var m=d.ea,A=m.oa;else A=M.prototype;d=Cr(i,function(){if(Object.getPrototypeOf(this)!==P)throw new B("Use 'new' to construct "+h);if(U.pa===void 0)throw new B(h+" has no accessible constructor");var Pn=U.pa[arguments.length];if(Pn===void 0)throw new B("Tried to invoke ctor of "+h+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(U.pa).toString()+") parameters instead!");return Pn.apply(this,arguments)});var P=Object.create(A,{constructor:{value:d}});d.prototype=P;var U=new Dn(h,d,P,v,m,o,u,s);m=new O(h,U,!0,!1,!1),A=new O(h+"*",U,!1,!1,!1);var er=new O(h+" const*",U,!1,!0,!1);return sn[r]={pointerType:A,Ha:er},ln(i,d),[m,A,er]})},o:function(r,n,e,t,a,o,f){var u=pr(e,t);n=b(n),o=T(a,o),$([],[r],function(l){function s(){Y("Cannot call "+h+" due to unbound types",u)}var h=(l=l[0]).name+"."+n;n.startsWith("@@")&&(n=Symbol[n.substring(2)]);var p=l.ea.constructor;return p[n]===void 0?(s.sa=e-1,p[n]=s):(Er(p,n,h),p[n].ha[e-1]=s),$([],u,function(v){return v=dr(h,[v[0],null].concat(v.slice(1)),null,o,f),p[n].ha===void 0?(v.sa=e-1,p[n]=v):p[n].ha[e-1]=v,[]}),[]})},i:function(r,n,e,t,a,o){0{Y("Cannot construct "+u.name+" due to unbound types",f)},$([],f,function(s){return s.splice(1,0,null),u.ea.pa[n-1]=dr(l,s,null,a,o),[]}),[]})},b:function(r,n,e,t,a,o,f,u){var l=pr(e,t);n=b(n),o=T(a,o),$([],[r],function(s){function h(){Y("Cannot call "+p+" due to unbound types",l)}var p=(s=s[0]).name+"."+n;n.startsWith("@@")&&(n=Symbol[n.substring(2)]),u&&s.ea.$a.push(n);var v=s.ea.oa,i=v[n];return i===void 0||i.ha===void 0&&i.className!==s.name&&i.sa===e-2?(h.sa=e-2,h.className=s.name,v[n]=h):(Er(v,n,p),v[n].ha[e-2]=h),$([],l,function(d){return d=dr(p,d,s,o,f),v[n].ha===void 0?(d.sa=e-2,v[n]=d):v[n].ha[e-2]=d,[]}),[]})},c:function(r,n,e,t,a,o,f,u,l,s){n=b(n),a=T(t,a),$([],[r],function(h){var p=(h=h[0]).name+"."+n,v={get:function(){Y("Cannot access "+p+" due to unbound types",[e,f])},enumerable:!0,configurable:!0};return v.set=l?()=>{Y("Cannot access "+p+" due to unbound types",[e,f])}:()=>{g(p+" is a read-only property")},Object.defineProperty(h.ea.oa,n,v),$([],l?[e,f]:[e],function(i){var d=i[0],m={get:function(){var P=pn(this,h,p+" getter");return d.fromWireType(a(o,P))},enumerable:!0};if(l){l=T(u,l);var A=i[1];m.set=function(P){var U=pn(this,h,p+" setter"),er=[];l(s,U,A.toWireType(er,P)),ir(er)}}return Object.defineProperty(h.ea.oa,n,m),[]}),[]})},R:function(r,n){k(r,{name:n=b(n),fromWireType:function(e){var t=C(e);return Sr(e),t},toWireType:function(e,t){return E(t)},argPackAdvance:8,readValueFromPointer:J,ja:null})},s:function(r,n,e,t){function a(){}e=Z(e),n=b(n),a.values={},k(r,{name:n,constructor:a,fromWireType:function(o){return this.constructor.values[o]},toWireType:function(o,f){return f.value},argPackAdvance:8,readValueFromPointer:Rn(n,e,t),ja:null}),Or(n,a)},e:function(r,n,e){var t=nr(r,"enum");n=b(n),r=t.constructor,t=Object.create(t.constructor.prototype,{value:{value:e},constructor:{value:Cr(t.name+"_"+n,function(){})}}),r.values[e]=t,r[n]=t},D:function(r,n,e){e=Z(e),k(r,{name:n=b(n),fromWireType:function(t){return t},toWireType:function(t,a){return a},argPackAdvance:8,readValueFromPointer:xn(n,e),ja:null})},V:function(r,n,e,t,a,o){var f=pr(n,e);r=b(r),a=T(t,a),Or(r,function(){Y("Cannot call "+r+" due to unbound types",f)},n-1),$([],f,function(u){return ln(r,dr(r,[u[0],null].concat(u.slice(1)),null,a,o),n-1),[]})},w:function(r,n,e,t,a){n=b(n),a===-1&&(a=4294967295),a=Z(e);var o=u=>u;if(t===0){var f=32-8*e;o=u=>u<>>f}e=n.includes("unsigned")?function(u,l){return l>>>0}:function(u,l){return l},k(r,{name:n,fromWireType:o,toWireType:e,argPackAdvance:8,readValueFromPointer:on(n,a,t!==0),ja:null})},q:function(r,n,e){function t(o){var f=y;return new a(Tr,f[1+(o>>=2)],f[o])}var a=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][n];k(r,{name:e=b(e),fromWireType:t,argPackAdvance:8,readValueFromPointer:t},{Wa:!0})},h:function(r,n,e,t,a,o,f,u,l,s,h,p){e=b(e),o=T(a,o),u=T(f,u),s=T(l,s),p=T(h,p),$([r],[n],function(v){return v=v[0],[new O(e,v.ea,!1,!1,!0,v,t,o,u,s,p)]})},F:function(r,n){var e=(n=b(n))==="std::string";k(r,{name:n,fromWireType:function(t){var a=y[t>>2],o=t+4;if(e)for(var f=o,u=0;u<=a;++u){var l=o+u;if(u==a||_[l]==0){if(f=f?ar(_,f,l-f):"",s===void 0)var s=f;else s+="\0",s+=f;f=l+1}}else{for(s=Array(a),u=0;u>2]=f,e&&o)Nr(a,_,l,f+1);else if(o)for(o=0;oN,u=1;else n===4&&(t=Bn,a=zn,o=qn,f=()=>y,u=2);k(r,{name:e,fromWireType:function(l){for(var s,h=y[l>>2],p=f(),v=l+4,i=0;i<=h;++i){var d=l+4+i*n;i!=h&&p[d>>u]!=0||(v=t(v,d-v),s===void 0?s=v:(s+="\0",s+=v),v=d+n)}return F(l),s},toWireType:function(l,s){typeof s!="string"&&g("Cannot pass non-string to C++ string type "+e);var h=o(s),p=wr(4+h+n);return y[p>>2]=h>>u,a(s,p+4,h+n),l!==null&&l.push(F,p),p},argPackAdvance:8,readValueFromPointer:J,ja:function(l){F(l)}})},v:function(r,n,e,t,a,o){or[r]={name:b(n),Ba:T(e,t),na:T(a,o),Fa:[]}},l:function(r,n,e,t,a,o,f,u,l,s){or[r].Fa.push({Na:b(n),Ta:e,Ra:T(t,a),Sa:o,cb:f,bb:T(u,l),eb:s})},T:function(r,n){k(r,{Xa:!0,name:n=b(n),argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},k:function(r,n,e){r=C(r),n=nr(n,"emval::as");var t=[],a=E(t);return y[e>>2]=a,n.toWireType(t,r)},z:function(r,n){return r=C(r),(n=nr(n,"emval::as")).toWireType(null,r)},W:function(r,n,e,t){r=C(r),e=mn(n,e);for(var a=Array(n),o=0;o>2]=E(o),r(n,e,o,a)},G:function(r,n,e,t){(r=mr[r])(n=C(n),e=vr(e),null,t)},a:Sr,H:function(r){return r===0?E(gn()):(r=vr(r),E(gn()[r]))},B:function(r,n){var e=mn(r,n),t=e[0];n=t.name+"_$"+e.slice(1).map(function(f){return f.name}).join("_")+"$";var a=yn[n];if(a!==void 0)return a;var o=Array(r-1);return a=Ln((f,u,l,s)=>{for(var h=0,p=0;p>>=0))return!1;for(var e=1;4>=e;e*=2){var t=n*(1+.2/e);t=Math.min(t,r+100663296);var a=Math;t=Math.max(r,t),a=a.min.call(a,2147483648,t+(65536-t%65536)%65536);r:{try{Ar.grow(a-Tr.byteLength+65535>>>16),Gr();var o=1;break r}catch{}o=void 0}if(o)return!0}return!1},K:function(r,n){var e=0;return bn().forEach(function(t,a){var o=n+e;for(a=y[r+4*a>>2]=o,o=0;o>0]=t.charCodeAt(o);j[a>>0]=0,e+=t.length+1}),0},L:function(r,n){var e=bn();y[r>>2]=e.length;var t=0;return e.forEach(function(a){t+=a.length+1}),y[n>>2]=t,0},Q:function(){return 52},P:function(){return 70},O:function(r,n,e,t){for(var a=0,o=0;o>2],u=y[n+4>>2];n+=8;for(var l=0;l>2]=a,0},J:function(r,n,e,t){return Xn(r,n,e,t)}};(function(){function r(a){c.asm=a.exports,Ar=c.asm.X,Gr(),Jr=c.asm.ba,Zr.unshift(c.asm.Y),R--,c.monitorRunDependencies&&c.monitorRunDependencies(R),R==0&&L&&(a=L,L=null,a())}function n(a){r(a.instance)}function e(a){return jn().then(function(o){return WebAssembly.instantiate(o,t)}).then(function(o){return o}).then(a,function(o){H("failed to asynchronously prepare wasm: "+o),G(o)})}var t={a:Zn};if(R++,c.monitorRunDependencies&&c.monitorRunDependencies(R),c.instantiateWasm)try{return c.instantiateWasm(t,r)}catch(a){H("Module.instantiateWasm callback failed with error: "+a),tr(a)}(q||typeof WebAssembly.instantiateStreaming!="function"||Qr()||typeof fetch!="function"?e(n):fetch(S,{credentials:"same-origin"}).then(function(a){return WebAssembly.instantiateStreaming(a,t).then(n,function(o){return H("wasm streaming compile failed: "+o),H("falling back to ArrayBuffer instantiation"),e(n)})})).catch(tr)})(),c.___wasm_call_ctors=function(){return(c.___wasm_call_ctors=c.asm.Y).apply(null,arguments)};var br,wr=c._malloc=function(){return(wr=c._malloc=c.asm.Z).apply(null,arguments)},F=c._free=function(){return(F=c._free=c.asm._).apply(null,arguments)},_n=c.___getTypeName=function(){return(_n=c.___getTypeName=c.asm.$).apply(null,arguments)};function Cn(){function r(){if(!br&&(br=!0,c.calledRun=!0,!zr)){if(_r(Zr),Ir(c),c.onRuntimeInitialized&&c.onRuntimeInitialized(),c.postRun)for(typeof c.postRun=="function"&&(c.postRun=[c.postRun]);c.postRun.length;){var n=c.postRun.shift();Kr.unshift(n)}_r(Kr)}}if(!(0 __vite__mapDeps.viteFileDeps[i]) } -import{_ as T,av as U,N as L,bU as F,bV as C,bW as N,bX as O}from"./index-CEWggaxV.js";import{s as J}from"./associatedFeatureServiceUtils-BIEHgyxo.js";import{t as V}from"./fetchService-C38RarY2.js";import{t as f,a as _}from"./lazyLayerLoader-s-GqbiwM.js";const E={FeatureLayer:!0,SceneLayer:!0};async function j(r){var a;const s=(a=r.properties)==null?void 0:a.customParameters,e=await x(r.url,s),t={...r.properties,url:r.url};if(e.layers.length+e.tables.length===0)return e.layerId!=null&&(t.layerId=e.layerId),e.sourceJSON!=null&&(t.sourceJSON=e.sourceJSON),new e.Constructor(t);const l=new(await T(()=>import("./GroupLayer-BGdGYmtj.js"),__vite__mapDeps([0,1,2,3,4,5]))).default({title:e.parsedUrl.title});return await k(l,e,t),l}function g(r,s){return r?r.find(e=>e.id===s):null}async function k(r,s,e){function t(a,n,u,c){const i={...e,layerId:n,sublayerTitleMode:"service-name"};return a!=null&&(i.url=a),u!=null&&(i.sourceJSON=u),c(i)}const l=s.sublayerConstructorProvider;for(const{id:a,serverUrl:n}of s.layers){const u=g(s.sublayerInfos,a),c=(u&&(l==null?void 0:l(u)))??s.Constructor,i=t(n,a,u,p=>new c(p));r.add(i)}if(s.tables.length){const a=await d("FeatureLayer");s.tables.forEach(({id:n,serverUrl:u})=>{const c=t(u,n,g(s.tableInfos,n),i=>new a(i));r.tables.add(c)})}}async function x(r,s){var p,v,w,S,b,I,h;let e=U(r);if(e==null&&(e=await $(r,s)),e==null)throw new L("arcgis-layers:url-mismatch","The url '${url}' is not a valid arcgis resource",{url:r});const{serverType:t,sublayer:l}=e;let a;const n={FeatureServer:"FeatureLayer",StreamServer:"StreamLayer",VectorTileServer:"VectorTileLayer"},u=t==="FeatureServer",c=t==="SceneServer",i={parsedUrl:e,Constructor:null,layerId:u||c?l??void 0:void 0,layers:[],tables:[]};switch(t){case"MapServer":l!=null?a="FeatureLayer":a=await R(r,s)?"TileLayer":"MapImageLayer";break;case"ImageServer":{const o=await f(r,{customParameters:s}),{tileInfo:y,cacheType:m}=o;a=y?((p=y==null?void 0:y.format)==null?void 0:p.toUpperCase())!=="LERC"||m&&m.toLowerCase()!=="elevation"?"ImageryTileLayer":"ElevationLayer":"ImageryLayer";break}case"SceneServer":{const o=await f(e.url.path,{customParameters:s});if(a="SceneLayer",o){const y=o==null?void 0:o.layers;if((o==null?void 0:o.layerType)==="Voxel")a="VoxelLayer";else if(y!=null&&y.length){const m=(v=y[0])==null?void 0:v.layerType;m!=null&&O[m]!=null&&(a=O[m])}}break}case"3DTilesServer":throw new L("arcgis-layers:unsupported","fromUrl() not supported for 3DTiles layers");case"FeatureServer":if(a="FeatureLayer",l!=null){const o=await f(r,{customParameters:s});i.sourceJSON=o,o.type==="Oriented Imagery Layer"&&(a="OrientedImageryLayer")}break;default:a=n[t]}if(E[a]&&l==null){const o=await M(r,t,s);if(u&&(i.sublayerInfos=o.layerInfos,i.tableInfos=o.tableInfos),o.layers.length+o.tables.length!==1)i.layers=o.layers,i.tables=o.tables,u&&((w=o.layerInfos)!=null&&w.length)&&(i.sublayerConstructorProvider=await X(o.layerInfos));else if(u||c){const y=((S=o.layerInfos)==null?void 0:S[0])??((b=o.tableInfos)==null?void 0:b[0]);i.layerId=((I=o.layers[0])==null?void 0:I.id)??((h=o.tables[0])==null?void 0:h.id),i.sourceJSON=y,u&&(y==null?void 0:y.type)==="Oriented Imagery Layer"&&(a="OrientedImageryLayer")}}return i.Constructor=await d(a),i}async function $(r,s){var u;const e=await f(r,{customParameters:s});let t=null,l=null;const a=e.type;if(a==="Feature Layer"||a==="Table"?(t="FeatureServer",l=e.id??null):a==="indexedVector"?t="VectorTileServer":e.hasOwnProperty("mapName")?t="MapServer":e.hasOwnProperty("bandCount")&&e.hasOwnProperty("pixelSizeX")?t="ImageServer":e.hasOwnProperty("maxRecordCount")&&e.hasOwnProperty("allowGeometryUpdates")?t="FeatureServer":e.hasOwnProperty("streamUrls")?t="StreamServer":P(e)?(t="SceneServer",l=e.id):e.hasOwnProperty("layers")&&P((u=e.layers)==null?void 0:u[0])&&(t="SceneServer"),!t)return null;const n=l!=null?F(r):null;return{title:n!=null&&e.name||C(r),serverType:t,sublayer:l,url:{path:n!=null?n.serviceUrl:N(r).path}}}function P(r){return r!=null&&r.hasOwnProperty("store")&&r.hasOwnProperty("id")&&typeof r.id=="number"}async function M(r,s,e){let t,l,a=!1;switch(s){case"FeatureServer":{const c=await V(r,{customParameters:e});a=!!c.layersJSON,t=c.layersJSON||c.serviceJSON;break}case"SceneServer":{const c=await D(r,e);t=c.serviceInfo,l=c.tableServerUrl;break}default:t=await f(r,{customParameters:e})}const n=t==null?void 0:t.layers,u=t==null?void 0:t.tables;return{layers:(n==null?void 0:n.map(c=>({id:c.id})).reverse())||[],tables:(u==null?void 0:u.map(c=>({serverUrl:l,id:c.id})).reverse())||[],layerInfos:a?n:[],tableInfos:a?u:[]}}async function D(r,s){var l;const e=await f(r,{customParameters:s});if(!((l=e.layers)==null?void 0:l[0]))return{serviceInfo:e};try{const{serverUrl:a}=await J(r),n=await f(a,{customParameters:s}).catch(()=>null);return n&&(e.tables=n.tables),{serviceInfo:e,tableServerUrl:a}}catch{return{serviceInfo:e}}}async function d(r){return(0,_[r])()}async function R(r,s){return(await f(r,{customParameters:s})).tileInfo}async function X(r){const s=[],e=[];if(r.forEach(a=>{const{type:n}=a;n==="Oriented Imagery Layer"?(s.push(n),e.push(d("OrientedImageryLayer"))):(s.push(n),e.push(d("FeatureLayer")))}),!e.length)return;const t=await Promise.all(e),l=new Map;return s.forEach((a,n)=>{l.set(a,t[n])}),a=>l.get(a.type)}export{j as fromUrl}; +import{_ as T,av as U,N as L,bU as F,bV as C,bW as N,bX as O}from"./index-BjUNJPVf.js";import{s as J}from"./associatedFeatureServiceUtils-nLeTqfYC.js";import{t as V}from"./fetchService-Crgml5qT.js";import{t as f,a as _}from"./lazyLayerLoader-Cu0XtDD2.js";const E={FeatureLayer:!0,SceneLayer:!0};async function j(r){var a;const s=(a=r.properties)==null?void 0:a.customParameters,e=await x(r.url,s),t={...r.properties,url:r.url};if(e.layers.length+e.tables.length===0)return e.layerId!=null&&(t.layerId=e.layerId),e.sourceJSON!=null&&(t.sourceJSON=e.sourceJSON),new e.Constructor(t);const l=new(await T(()=>import("./GroupLayer-6WnGm0lP.js"),__vite__mapDeps([0,1,2,3,4,5]))).default({title:e.parsedUrl.title});return await k(l,e,t),l}function g(r,s){return r?r.find(e=>e.id===s):null}async function k(r,s,e){function t(a,n,u,c){const i={...e,layerId:n,sublayerTitleMode:"service-name"};return a!=null&&(i.url=a),u!=null&&(i.sourceJSON=u),c(i)}const l=s.sublayerConstructorProvider;for(const{id:a,serverUrl:n}of s.layers){const u=g(s.sublayerInfos,a),c=(u&&(l==null?void 0:l(u)))??s.Constructor,i=t(n,a,u,p=>new c(p));r.add(i)}if(s.tables.length){const a=await d("FeatureLayer");s.tables.forEach(({id:n,serverUrl:u})=>{const c=t(u,n,g(s.tableInfos,n),i=>new a(i));r.tables.add(c)})}}async function x(r,s){var p,v,w,S,b,I,h;let e=U(r);if(e==null&&(e=await $(r,s)),e==null)throw new L("arcgis-layers:url-mismatch","The url '${url}' is not a valid arcgis resource",{url:r});const{serverType:t,sublayer:l}=e;let a;const n={FeatureServer:"FeatureLayer",StreamServer:"StreamLayer",VectorTileServer:"VectorTileLayer"},u=t==="FeatureServer",c=t==="SceneServer",i={parsedUrl:e,Constructor:null,layerId:u||c?l??void 0:void 0,layers:[],tables:[]};switch(t){case"MapServer":l!=null?a="FeatureLayer":a=await R(r,s)?"TileLayer":"MapImageLayer";break;case"ImageServer":{const o=await f(r,{customParameters:s}),{tileInfo:y,cacheType:m}=o;a=y?((p=y==null?void 0:y.format)==null?void 0:p.toUpperCase())!=="LERC"||m&&m.toLowerCase()!=="elevation"?"ImageryTileLayer":"ElevationLayer":"ImageryLayer";break}case"SceneServer":{const o=await f(e.url.path,{customParameters:s});if(a="SceneLayer",o){const y=o==null?void 0:o.layers;if((o==null?void 0:o.layerType)==="Voxel")a="VoxelLayer";else if(y!=null&&y.length){const m=(v=y[0])==null?void 0:v.layerType;m!=null&&O[m]!=null&&(a=O[m])}}break}case"3DTilesServer":throw new L("arcgis-layers:unsupported","fromUrl() not supported for 3DTiles layers");case"FeatureServer":if(a="FeatureLayer",l!=null){const o=await f(r,{customParameters:s});i.sourceJSON=o,o.type==="Oriented Imagery Layer"&&(a="OrientedImageryLayer")}break;default:a=n[t]}if(E[a]&&l==null){const o=await M(r,t,s);if(u&&(i.sublayerInfos=o.layerInfos,i.tableInfos=o.tableInfos),o.layers.length+o.tables.length!==1)i.layers=o.layers,i.tables=o.tables,u&&((w=o.layerInfos)!=null&&w.length)&&(i.sublayerConstructorProvider=await X(o.layerInfos));else if(u||c){const y=((S=o.layerInfos)==null?void 0:S[0])??((b=o.tableInfos)==null?void 0:b[0]);i.layerId=((I=o.layers[0])==null?void 0:I.id)??((h=o.tables[0])==null?void 0:h.id),i.sourceJSON=y,u&&(y==null?void 0:y.type)==="Oriented Imagery Layer"&&(a="OrientedImageryLayer")}}return i.Constructor=await d(a),i}async function $(r,s){var u;const e=await f(r,{customParameters:s});let t=null,l=null;const a=e.type;if(a==="Feature Layer"||a==="Table"?(t="FeatureServer",l=e.id??null):a==="indexedVector"?t="VectorTileServer":e.hasOwnProperty("mapName")?t="MapServer":e.hasOwnProperty("bandCount")&&e.hasOwnProperty("pixelSizeX")?t="ImageServer":e.hasOwnProperty("maxRecordCount")&&e.hasOwnProperty("allowGeometryUpdates")?t="FeatureServer":e.hasOwnProperty("streamUrls")?t="StreamServer":P(e)?(t="SceneServer",l=e.id):e.hasOwnProperty("layers")&&P((u=e.layers)==null?void 0:u[0])&&(t="SceneServer"),!t)return null;const n=l!=null?F(r):null;return{title:n!=null&&e.name||C(r),serverType:t,sublayer:l,url:{path:n!=null?n.serviceUrl:N(r).path}}}function P(r){return r!=null&&r.hasOwnProperty("store")&&r.hasOwnProperty("id")&&typeof r.id=="number"}async function M(r,s,e){let t,l,a=!1;switch(s){case"FeatureServer":{const c=await V(r,{customParameters:e});a=!!c.layersJSON,t=c.layersJSON||c.serviceJSON;break}case"SceneServer":{const c=await D(r,e);t=c.serviceInfo,l=c.tableServerUrl;break}default:t=await f(r,{customParameters:e})}const n=t==null?void 0:t.layers,u=t==null?void 0:t.tables;return{layers:(n==null?void 0:n.map(c=>({id:c.id})).reverse())||[],tables:(u==null?void 0:u.map(c=>({serverUrl:l,id:c.id})).reverse())||[],layerInfos:a?n:[],tableInfos:a?u:[]}}async function D(r,s){var l;const e=await f(r,{customParameters:s});if(!((l=e.layers)==null?void 0:l[0]))return{serviceInfo:e};try{const{serverUrl:a}=await J(r),n=await f(a,{customParameters:s}).catch(()=>null);return n&&(e.tables=n.tables),{serviceInfo:e,tableServerUrl:a}}catch{return{serviceInfo:e}}}async function d(r){return(0,_[r])()}async function R(r,s){return(await f(r,{customParameters:s})).tileInfo}async function X(r){const s=[],e=[];if(r.forEach(a=>{const{type:n}=a;n==="Oriented Imagery Layer"?(s.push(n),e.push(d("OrientedImageryLayer"))):(s.push(n),e.push(d("FeatureLayer")))}),!e.length)return;const t=await Promise.all(e),l=new Map;return s.forEach((a,n)=>{l.set(a,t[n])}),a=>l.get(a.type)}export{j as fromUrl}; diff --git a/assets/associatedFeatureServiceUtils-BIEHgyxo.js b/assets/associatedFeatureServiceUtils-nLeTqfYC.js similarity index 97% rename from assets/associatedFeatureServiceUtils-BIEHgyxo.js rename to assets/associatedFeatureServiceUtils-nLeTqfYC.js index a4677de..48e254f 100644 --- a/assets/associatedFeatureServiceUtils-BIEHgyxo.js +++ b/assets/associatedFeatureServiceUtils-nLeTqfYC.js @@ -1 +1 @@ -import{av as g,N as y,aw as I,ax as T,ay as f,M as d,az as b}from"./index-CEWggaxV.js";async function M(e,n){const a=g(e);if(!a)throw new y("invalid-url","Invalid scene service url");const r={...n,sceneServerUrl:a.url.path,layerId:a.sublayer??void 0};if(r.sceneLayerItem??(r.sceneLayerItem=await q(r)),r.sceneLayerItem==null)return S(r.sceneServerUrl.replace("/SceneServer","/FeatureServer"),r);const t=await K(r);if(!(t!=null&&t.url))throw new y("related-service-not-found","Could not find feature service through portal item relationship");r.featureServiceItem=t;const o=await S(t.url,r);return o.portalItem=t,o}async function q(e){const n=(await U(e)).serviceItemId;if(!n)return null;const a=new I({id:n,apiKey:e.apiKey}),r=await x(e);r!=null&&(a.portal=new T({url:r}));try{return a.load({signal:e.signal})}catch(t){return f(t),null}}async function U(e){if(e.rootDocument)return e.rootDocument;const n={query:{f:"json",...e.customParameters,token:e.apiKey},responseType:"json",signal:e.signal};try{const a=await d(e.sceneServerUrl,n);e.rootDocument=a.data}catch{e.rootDocument={}}return e.rootDocument}async function x(e){var r;const n=(r=b)==null?void 0:r.findServerInfo(e.sceneServerUrl);if(n!=null&&n.owningSystemUrl)return n.owningSystemUrl;const a=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const t=(await d(a,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(t)return t}catch(t){f(t)}return null}async function S(e,n){var p,w,h;const a=g(e);if(!a)throw new y("invalid-feature-service-url","Invalid feature service url");const r=a.url.path,t=n.layerId;if(t==null)return{serverUrl:r};const o=U(n),s=n.featureServiceItem?await n.featureServiceItem.fetchData("json"):null,j=(h=((p=s==null?void 0:s.layers)==null?void 0:p[0])||((w=s==null?void 0:s.tables)==null?void 0:w[0]))==null?void 0:h.customParameters,v=i=>{const A={query:{f:"json",...j},responseType:"json",authMode:i,signal:n.signal};return d(r,A)},D=v("anonymous").catch(()=>v("no-prompt")),[m,c]=await Promise.all([D,o]),u=c==null?void 0:c.layers,l=m.data&&m.data.layers;if(!Array.isArray(l))throw new Error("expected layers array");if(Array.isArray(u)){for(let i=0;it.type==="Feature Service")||null;if(!a)return null;const r=new I({portal:a.portal,id:a.id});return await r.load(),r}catch(a){return f(a),null}}export{M as s}; +import{av as g,N as y,aw as I,ax as T,ay as f,M as d,az as b}from"./index-BjUNJPVf.js";async function M(e,n){const a=g(e);if(!a)throw new y("invalid-url","Invalid scene service url");const r={...n,sceneServerUrl:a.url.path,layerId:a.sublayer??void 0};if(r.sceneLayerItem??(r.sceneLayerItem=await q(r)),r.sceneLayerItem==null)return S(r.sceneServerUrl.replace("/SceneServer","/FeatureServer"),r);const t=await K(r);if(!(t!=null&&t.url))throw new y("related-service-not-found","Could not find feature service through portal item relationship");r.featureServiceItem=t;const o=await S(t.url,r);return o.portalItem=t,o}async function q(e){const n=(await U(e)).serviceItemId;if(!n)return null;const a=new I({id:n,apiKey:e.apiKey}),r=await x(e);r!=null&&(a.portal=new T({url:r}));try{return a.load({signal:e.signal})}catch(t){return f(t),null}}async function U(e){if(e.rootDocument)return e.rootDocument;const n={query:{f:"json",...e.customParameters,token:e.apiKey},responseType:"json",signal:e.signal};try{const a=await d(e.sceneServerUrl,n);e.rootDocument=a.data}catch{e.rootDocument={}}return e.rootDocument}async function x(e){var r;const n=(r=b)==null?void 0:r.findServerInfo(e.sceneServerUrl);if(n!=null&&n.owningSystemUrl)return n.owningSystemUrl;const a=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const t=(await d(a,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(t)return t}catch(t){f(t)}return null}async function S(e,n){var p,w,h;const a=g(e);if(!a)throw new y("invalid-feature-service-url","Invalid feature service url");const r=a.url.path,t=n.layerId;if(t==null)return{serverUrl:r};const o=U(n),s=n.featureServiceItem?await n.featureServiceItem.fetchData("json"):null,j=(h=((p=s==null?void 0:s.layers)==null?void 0:p[0])||((w=s==null?void 0:s.tables)==null?void 0:w[0]))==null?void 0:h.customParameters,v=i=>{const A={query:{f:"json",...j},responseType:"json",authMode:i,signal:n.signal};return d(r,A)},D=v("anonymous").catch(()=>v("no-prompt")),[m,c]=await Promise.all([D,o]),u=c==null?void 0:c.layers,l=m.data&&m.data.layers;if(!Array.isArray(l))throw new Error("expected layers array");if(Array.isArray(u)){for(let i=0;it.type==="Feature Service")||null;if(!a)return null;const r=new I({portal:a.portal,id:a.id});return await r.load(),r}catch(a){return f(a),null}}export{M as s}; diff --git a/assets/basis_transcoder-CY0Zu9W4.js b/assets/basis_transcoder-gYrXvU8A.js similarity index 99% rename from assets/basis_transcoder-CY0Zu9W4.js rename to assets/basis_transcoder-gYrXvU8A.js index d5d2827..45837be 100644 --- a/assets/basis_transcoder-CY0Zu9W4.js +++ b/assets/basis_transcoder-gYrXvU8A.js @@ -1,2 +1,2 @@ -import{ar as Et,es as Me}from"./index-CEWggaxV.js";var Pr,oe,Ar,Wr={exports:{}};Pr=Wr,oe=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,typeof __filename<"u"&&(oe=oe||__filename),Ar=function(ae){var Ve,He,i=(ae=ae||{})!==void 0?ae:{};i.ready=new Promise(function(e,r){Ve=e,He=r});var O,L={};for(O in i)i.hasOwnProperty(O)&&(L[O]=i[O]);var ue=!1,x=!1,we=!1,ze=!1;ue=typeof window=="object",x=typeof importScripts=="function",we=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",ze=!ue&&!we&&!x;var se,X,Te,_e,w="";function Er(e){return i.locateFile?i.locateFile(e,w):w+e}we?(w=x?require("path").dirname(w)+"/":__dirname+"/",se=function(e,r){return Te||(Te=require("fs")),_e||(_e=require("path")),e=_e.normalize(e),Te.readFileSync(e,r?null:"utf8")},X=function(e){var r=se(e,!0);return r.buffer||(r=new Uint8Array(r)),Pe(r.buffer),r},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",function(e){if(!(e instanceof At))throw e}),process.on("unhandledRejection",H),i.inspect=function(){return"[Emscripten Module object]"}):ze?(typeof read<"u"&&(se=function(e){return read(e)}),X=function(e){var r;return typeof readbuffer=="function"?new Uint8Array(readbuffer(e)):(Pe(typeof(r=read(e,"binary"))=="object"),r)},typeof scriptArgs<"u"&&scriptArgs,typeof print<"u"&&(typeof console>"u"&&(console={}),console.log=print,console.warn=console.error=typeof printErr<"u"?printErr:print)):(ue||x)&&(x?w=self.location.href:document.currentScript&&(w=document.currentScript.src),oe&&(w=oe),w=w.indexOf("blob:")!==0?w.substr(0,w.lastIndexOf("/")+1):"",se=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},x&&(X=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}));var J,Y,Sr=i.print||console.log.bind(console),M=i.printErr||console.warn.bind(console);for(O in L)L.hasOwnProperty(O)&&(i[O]=L[O]);L=null,i.arguments&&i.arguments,i.thisProgram&&i.thisProgram,i.quit&&i.quit,i.wasmBinary&&(J=i.wasmBinary),i.noExitRuntime&&i.noExitRuntime,typeof WebAssembly!="object"&&H("no native wasm support detected");var Or=new WebAssembly.Table({initial:157,maximum:157,element:"anyfunc"}),qe=!1;function Pe(e,r){e||H("Assertion failed: "+r)}var Be=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function Ne(e,r,n){for(var t=r+n,o=r;e[o]&&!(o>=t);)++o;if(o-r>16&&e.subarray&&Be)return Be.decode(e.subarray(r,o));for(var a="";r>10,56320|1023&l)}}else a+=String.fromCharCode((31&s)<<6|u)}else a+=String.fromCharCode(s)}return a}function Ge(e,r){return e?Ne($,e,r):""}function jr(e,r,n,t){if(!(t>0))return 0;for(var o=n,a=n+t-1,s=0;s=55296&&u<=57343&&(u=65536+((1023&u)<<10)|1023&e.charCodeAt(++s)),u<=127){if(n>=a)break;r[n++]=u}else if(u<=2047){if(n+1>=a)break;r[n++]=192|u>>6,r[n++]=128|63&u}else if(u<=65535){if(n+2>=a)break;r[n++]=224|u>>12,r[n++]=128|u>>6&63,r[n++]=128|63&u}else{if(n+3>=a)break;r[n++]=240|u>>18,r[n++]=128|u>>12&63,r[n++]=128|u>>6&63,r[n++]=128|63&u}}return r[n]=0,n-o}function kr(e,r,n){return jr(e,$,r,n)}function Fr(e){for(var r=0,n=0;n=55296&&t<=57343&&(t=65536+((1023&t)<<10)|1023&e.charCodeAt(++n)),t<=127?++r:r+=t<=2047?2:t<=65535?3:4}return r}var Le=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0;function Rr(e,r){for(var n=e,t=n>>1,o=t+r/2;!(t>=o)&&Z[t];)++t;if((n=t<<1)-e>32&&Le)return Le.decode($.subarray(e,n));for(var a=0,s="";;){var u=D[e+2*a>>1];if(u==0||a==r/2)return s;++a,s+=String.fromCharCode(u)}}function xr(e,r,n){if(n===void 0&&(n=2147483647),n<2)return 0;for(var t=r,o=(n-=2)<2*e.length?n/2:e.length,a=0;a>1]=s,r+=2}return D[r>>1]=0,r-t}function Dr(e){return 2*e.length}function Ir(e,r){for(var n=0,t="";!(n>=r/4);){var o=g[e+4*n>>2];if(o==0)break;if(++n,o>=65536){var a=o-65536;t+=String.fromCharCode(55296|a>>10,56320|1023&a)}else t+=String.fromCharCode(o)}return t}function Ur(e,r,n){if(n===void 0&&(n=2147483647),n<4)return 0;for(var t=r,o=t+n-4,a=0;a=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),g[r>>2]=s,(r+=4)+4>o)break}return g[r>>2]=0,r-t}function Mr(e){for(var r=0,n=0;n=55296&&t<=57343&&++n,r+=4}return r}var V,ce,$,D,Z,g,_,Xe,Je,Ye=65536;function Vr(e,r){return e%r>0&&(e+=r-e%r),e}function Ze(e){V=e,i.HEAP8=ce=new Int8Array(e),i.HEAP16=D=new Int16Array(e),i.HEAP32=g=new Int32Array(e),i.HEAPU8=$=new Uint8Array(e),i.HEAPU16=Z=new Uint16Array(e),i.HEAPU32=_=new Uint32Array(e),i.HEAPF32=Xe=new Float32Array(e),i.HEAPF64=Je=new Float64Array(e)}var Hr=5565536,zr=322496,Ke=i.INITIAL_MEMORY||16777216;function le(e){for(;e.length>0;){var r=e.shift();if(typeof r!="function"){var n=r.func;typeof n=="number"?r.arg===void 0?i.dynCall_v(n):i.dynCall_vi(n,r.arg):n(r.arg===void 0?null:r.arg)}else r(i)}}(Y=i.wasmMemory?i.wasmMemory:new WebAssembly.Memory({initial:Ke/Ye,maximum:2147483648/Ye}))&&(V=Y.buffer),Ke=V.byteLength,Ze(V),g[zr>>2]=Hr;var Qe=[],er=[],qr=[],rr=[];function Br(){if(i.preRun)for(typeof i.preRun=="function"&&(i.preRun=[i.preRun]);i.preRun.length;)Xr(i.preRun.shift());le(Qe)}function Nr(){le(er)}function Gr(){le(qr)}function Lr(){if(i.postRun)for(typeof i.postRun=="function"&&(i.postRun=[i.postRun]);i.postRun.length;)Jr(i.postRun.shift());le(rr)}function Xr(e){Qe.unshift(e)}function Jr(e){rr.unshift(e)}var Yr=Math.ceil,Zr=Math.floor,I=0,K=null;function Kr(e){I++,i.monitorRunDependencies&&i.monitorRunDependencies(I)}function Qr(e){if(I--,i.monitorRunDependencies&&i.monitorRunDependencies(I),I==0&&K){var r=K;K=null,r()}}function H(e){i.onAbort&&i.onAbort(e),M(e+=""),qe=!0,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.";var r=new WebAssembly.RuntimeError(e);throw He(r),r}function nr(e,r){return String.prototype.startsWith?e.startsWith(r):e.indexOf(r)===0}i.preloadedImages={},i.preloadedAudios={};var en="data:application/octet-stream;base64,";function tr(e){return nr(e,en)}var rn="file://";function ir(e){return nr(e,rn)}var P="basis_transcoder.wasm";function or(){try{if(J)return new Uint8Array(J);if(X)return X(P);throw"both async and sync fetching of the wasm failed"}catch(e){H(e)}}function nn(){return J||!ue&&!x||typeof fetch!="function"||ir(P)?new Promise(function(e,r){e(or())}):fetch(P,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+P+"'";return e.arrayBuffer()}).catch(function(){return or()})}function tn(){var e={a:Pt};function r(a,s){var u=a.exports;i.asm=u,Qr()}function n(a){r(a.instance)}function t(a){return nn().then(function(s){return WebAssembly.instantiate(s,e)}).then(a,function(s){M("failed to asynchronously prepare wasm: "+s),H(s)})}function o(){if(J||typeof WebAssembly.instantiateStreaming!="function"||tr(P)||ir(P)||typeof fetch!="function")return t(n);fetch(P,{credentials:"same-origin"}).then(function(a){return WebAssembly.instantiateStreaming(a,e).then(n,function(s){return M("wasm streaming compile failed: "+s),M("falling back to ArrayBuffer instantiation"),t(n)})})}if(Kr(),i.instantiateWasm)try{return i.instantiateWasm(e,r)}catch(a){return M("Module.instantiateWasm callback failed with error: "+a),!1}return o(),{}}tr(P)||(P=Er(P)),er.push({func:function(){br()}});var fe={};function pe(e){for(;e.length;){var r=e.pop();e.pop()(r)}}function Q(e){return this.fromWireType(_[e>>2])}var z={},U={},de={},on=48,an=57;function ar(e){if(e===void 0)return"_unknown";var r=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return r>=on&&r<=an?"_"+e:e}function Ae(e,r){return e=ar(e),function(){return r.apply(this,arguments)}}function We(e,r){var n=Ae(r,function(t){this.name=r,this.message=t;var o=new Error(t).stack;o!==void 0&&(this.stack=this.toString()+` +import{ar as Et,es as Me}from"./index-BjUNJPVf.js";var Pr,oe,Ar,Wr={exports:{}};Pr=Wr,oe=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,typeof __filename<"u"&&(oe=oe||__filename),Ar=function(ae){var Ve,He,i=(ae=ae||{})!==void 0?ae:{};i.ready=new Promise(function(e,r){Ve=e,He=r});var O,L={};for(O in i)i.hasOwnProperty(O)&&(L[O]=i[O]);var ue=!1,x=!1,we=!1,ze=!1;ue=typeof window=="object",x=typeof importScripts=="function",we=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",ze=!ue&&!we&&!x;var se,X,Te,_e,w="";function Er(e){return i.locateFile?i.locateFile(e,w):w+e}we?(w=x?require("path").dirname(w)+"/":__dirname+"/",se=function(e,r){return Te||(Te=require("fs")),_e||(_e=require("path")),e=_e.normalize(e),Te.readFileSync(e,r?null:"utf8")},X=function(e){var r=se(e,!0);return r.buffer||(r=new Uint8Array(r)),Pe(r.buffer),r},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",function(e){if(!(e instanceof At))throw e}),process.on("unhandledRejection",H),i.inspect=function(){return"[Emscripten Module object]"}):ze?(typeof read<"u"&&(se=function(e){return read(e)}),X=function(e){var r;return typeof readbuffer=="function"?new Uint8Array(readbuffer(e)):(Pe(typeof(r=read(e,"binary"))=="object"),r)},typeof scriptArgs<"u"&&scriptArgs,typeof print<"u"&&(typeof console>"u"&&(console={}),console.log=print,console.warn=console.error=typeof printErr<"u"?printErr:print)):(ue||x)&&(x?w=self.location.href:document.currentScript&&(w=document.currentScript.src),oe&&(w=oe),w=w.indexOf("blob:")!==0?w.substr(0,w.lastIndexOf("/")+1):"",se=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},x&&(X=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}));var J,Y,Sr=i.print||console.log.bind(console),M=i.printErr||console.warn.bind(console);for(O in L)L.hasOwnProperty(O)&&(i[O]=L[O]);L=null,i.arguments&&i.arguments,i.thisProgram&&i.thisProgram,i.quit&&i.quit,i.wasmBinary&&(J=i.wasmBinary),i.noExitRuntime&&i.noExitRuntime,typeof WebAssembly!="object"&&H("no native wasm support detected");var Or=new WebAssembly.Table({initial:157,maximum:157,element:"anyfunc"}),qe=!1;function Pe(e,r){e||H("Assertion failed: "+r)}var Be=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function Ne(e,r,n){for(var t=r+n,o=r;e[o]&&!(o>=t);)++o;if(o-r>16&&e.subarray&&Be)return Be.decode(e.subarray(r,o));for(var a="";r>10,56320|1023&l)}}else a+=String.fromCharCode((31&s)<<6|u)}else a+=String.fromCharCode(s)}return a}function Ge(e,r){return e?Ne($,e,r):""}function jr(e,r,n,t){if(!(t>0))return 0;for(var o=n,a=n+t-1,s=0;s=55296&&u<=57343&&(u=65536+((1023&u)<<10)|1023&e.charCodeAt(++s)),u<=127){if(n>=a)break;r[n++]=u}else if(u<=2047){if(n+1>=a)break;r[n++]=192|u>>6,r[n++]=128|63&u}else if(u<=65535){if(n+2>=a)break;r[n++]=224|u>>12,r[n++]=128|u>>6&63,r[n++]=128|63&u}else{if(n+3>=a)break;r[n++]=240|u>>18,r[n++]=128|u>>12&63,r[n++]=128|u>>6&63,r[n++]=128|63&u}}return r[n]=0,n-o}function kr(e,r,n){return jr(e,$,r,n)}function Fr(e){for(var r=0,n=0;n=55296&&t<=57343&&(t=65536+((1023&t)<<10)|1023&e.charCodeAt(++n)),t<=127?++r:r+=t<=2047?2:t<=65535?3:4}return r}var Le=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0;function Rr(e,r){for(var n=e,t=n>>1,o=t+r/2;!(t>=o)&&Z[t];)++t;if((n=t<<1)-e>32&&Le)return Le.decode($.subarray(e,n));for(var a=0,s="";;){var u=D[e+2*a>>1];if(u==0||a==r/2)return s;++a,s+=String.fromCharCode(u)}}function xr(e,r,n){if(n===void 0&&(n=2147483647),n<2)return 0;for(var t=r,o=(n-=2)<2*e.length?n/2:e.length,a=0;a>1]=s,r+=2}return D[r>>1]=0,r-t}function Dr(e){return 2*e.length}function Ir(e,r){for(var n=0,t="";!(n>=r/4);){var o=g[e+4*n>>2];if(o==0)break;if(++n,o>=65536){var a=o-65536;t+=String.fromCharCode(55296|a>>10,56320|1023&a)}else t+=String.fromCharCode(o)}return t}function Ur(e,r,n){if(n===void 0&&(n=2147483647),n<4)return 0;for(var t=r,o=t+n-4,a=0;a=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),g[r>>2]=s,(r+=4)+4>o)break}return g[r>>2]=0,r-t}function Mr(e){for(var r=0,n=0;n=55296&&t<=57343&&++n,r+=4}return r}var V,ce,$,D,Z,g,_,Xe,Je,Ye=65536;function Vr(e,r){return e%r>0&&(e+=r-e%r),e}function Ze(e){V=e,i.HEAP8=ce=new Int8Array(e),i.HEAP16=D=new Int16Array(e),i.HEAP32=g=new Int32Array(e),i.HEAPU8=$=new Uint8Array(e),i.HEAPU16=Z=new Uint16Array(e),i.HEAPU32=_=new Uint32Array(e),i.HEAPF32=Xe=new Float32Array(e),i.HEAPF64=Je=new Float64Array(e)}var Hr=5565536,zr=322496,Ke=i.INITIAL_MEMORY||16777216;function le(e){for(;e.length>0;){var r=e.shift();if(typeof r!="function"){var n=r.func;typeof n=="number"?r.arg===void 0?i.dynCall_v(n):i.dynCall_vi(n,r.arg):n(r.arg===void 0?null:r.arg)}else r(i)}}(Y=i.wasmMemory?i.wasmMemory:new WebAssembly.Memory({initial:Ke/Ye,maximum:2147483648/Ye}))&&(V=Y.buffer),Ke=V.byteLength,Ze(V),g[zr>>2]=Hr;var Qe=[],er=[],qr=[],rr=[];function Br(){if(i.preRun)for(typeof i.preRun=="function"&&(i.preRun=[i.preRun]);i.preRun.length;)Xr(i.preRun.shift());le(Qe)}function Nr(){le(er)}function Gr(){le(qr)}function Lr(){if(i.postRun)for(typeof i.postRun=="function"&&(i.postRun=[i.postRun]);i.postRun.length;)Jr(i.postRun.shift());le(rr)}function Xr(e){Qe.unshift(e)}function Jr(e){rr.unshift(e)}var Yr=Math.ceil,Zr=Math.floor,I=0,K=null;function Kr(e){I++,i.monitorRunDependencies&&i.monitorRunDependencies(I)}function Qr(e){if(I--,i.monitorRunDependencies&&i.monitorRunDependencies(I),I==0&&K){var r=K;K=null,r()}}function H(e){i.onAbort&&i.onAbort(e),M(e+=""),qe=!0,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.";var r=new WebAssembly.RuntimeError(e);throw He(r),r}function nr(e,r){return String.prototype.startsWith?e.startsWith(r):e.indexOf(r)===0}i.preloadedImages={},i.preloadedAudios={};var en="data:application/octet-stream;base64,";function tr(e){return nr(e,en)}var rn="file://";function ir(e){return nr(e,rn)}var P="basis_transcoder.wasm";function or(){try{if(J)return new Uint8Array(J);if(X)return X(P);throw"both async and sync fetching of the wasm failed"}catch(e){H(e)}}function nn(){return J||!ue&&!x||typeof fetch!="function"||ir(P)?new Promise(function(e,r){e(or())}):fetch(P,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+P+"'";return e.arrayBuffer()}).catch(function(){return or()})}function tn(){var e={a:Pt};function r(a,s){var u=a.exports;i.asm=u,Qr()}function n(a){r(a.instance)}function t(a){return nn().then(function(s){return WebAssembly.instantiate(s,e)}).then(a,function(s){M("failed to asynchronously prepare wasm: "+s),H(s)})}function o(){if(J||typeof WebAssembly.instantiateStreaming!="function"||tr(P)||ir(P)||typeof fetch!="function")return t(n);fetch(P,{credentials:"same-origin"}).then(function(a){return WebAssembly.instantiateStreaming(a,e).then(n,function(s){return M("wasm streaming compile failed: "+s),M("falling back to ArrayBuffer instantiation"),t(n)})})}if(Kr(),i.instantiateWasm)try{return i.instantiateWasm(e,r)}catch(a){return M("Module.instantiateWasm callback failed with error: "+a),!1}return o(),{}}tr(P)||(P=Er(P)),er.push({func:function(){br()}});var fe={};function pe(e){for(;e.length;){var r=e.pop();e.pop()(r)}}function Q(e){return this.fromWireType(_[e>>2])}var z={},U={},de={},on=48,an=57;function ar(e){if(e===void 0)return"_unknown";var r=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return r>=on&&r<=an?"_"+e:e}function Ae(e,r){return e=ar(e),function(){return r.apply(this,arguments)}}function We(e,r){var n=Ae(r,function(t){this.name=r,this.message=t;var o=new Error(t).stack;o!==void 0&&(this.stack=this.toString()+` `+o.replace(/^Error(:[^\n]*)?\n/,""))});return n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},n}var ur=void 0;function ye(e){throw new ur(e)}function j(e,r,n){function t(u){var c=n(u);c.length!==e.length&&ye("Mismatched type converter count");for(var l=0;l>a])},destructorFunction:null})}function ln(e){if(!(this instanceof k)||!(e instanceof k))return!1;for(var r=this.$$.ptrType.registeredClass,n=this.$$.ptr,t=e.$$.ptrType.registeredClass,o=e.$$.ptr;r.baseClass;)n=r.upcast(n),r=r.baseClass;for(;t.baseClass;)o=t.upcast(o),t=t.baseClass;return r===t&&n===o}function fn(e){return{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}}function Ee(e){function r(n){return n.$$.ptrType.registeredClass.name}p(r(e)+" instance already deleted")}var Se=!1;function cr(e){}function pn(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}function lr(e){e.count.value-=1,e.count.value===0&&pn(e)}function ee(e){return typeof FinalizationGroup>"u"?(ee=function(r){return r},e):(Se=new FinalizationGroup(function(r){for(var n=r.next();!n.done;n=r.next()){var t=n.value;t.ptr?lr(t):console.warn("object already deleted: "+t.ptr)}}),ee=function(r){return Se.register(r,r.$$,r.$$),r},cr=function(r){Se.unregister(r.$$)},ee(e))}function dn(){if(this.$$.ptr||Ee(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=ee(Object.create(Object.getPrototypeOf(this),{$$:{value:fn(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e}function yn(){this.$$.ptr||Ee(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&p("Object already scheduled for deletion"),cr(this),lr(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function mn(){return!this.$$.ptr}var re=void 0,ne=[];function Oe(){for(;ne.length;){var e=ne.pop();e.$$.deleteScheduled=!1,e.delete()}}function hn(){return this.$$.ptr||Ee(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&p("Object already scheduled for deletion"),ne.push(this),ne.length===1&&re&&re(Oe),this.$$.deleteScheduled=!0,this}function vn(){k.prototype.isAliasOf=ln,k.prototype.clone=dn,k.prototype.delete=yn,k.prototype.isDeleted=mn,k.prototype.deleteLater=hn}function k(){}var fr={};function pr(e,r,n){if(e[r].overloadTable===void 0){var t=e[r];e[r]=function(){return e[r].overloadTable.hasOwnProperty(arguments.length)||p("Function '"+n+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+e[r].overloadTable+")!"),e[r].overloadTable[arguments.length].apply(this,arguments)},e[r].overloadTable=[],e[r].overloadTable[t.argCount]=t}}function je(e,r,n){i.hasOwnProperty(e)?((n===void 0||i[e].overloadTable!==void 0&&i[e].overloadTable[n]!==void 0)&&p("Cannot register public name '"+e+"' twice"),pr(i,e,e),i.hasOwnProperty(n)&&p("Cannot register multiple overloads of a function with the same number of arguments ("+n+")!"),i[e].overloadTable[n]=r):(i[e]=r,n!==void 0&&(i[e].numArguments=n))}function gn(e,r,n,t,o,a,s,u){this.name=e,this.constructor=r,this.instancePrototype=n,this.rawDestructor=t,this.baseClass=o,this.getActualType=a,this.upcast=s,this.downcast=u,this.pureVirtualFunctions=[]}function ke(e,r,n){for(;r!==n;)r.upcast||p("Expected null or instance of "+n.name+", got an instance of "+r.name),e=r.upcast(e),r=r.baseClass;return e}function $n(e,r){if(r===null)return this.isReference&&p("null is not a valid "+this.name),0;r.$$||p('Cannot pass "'+B(r)+'" as a '+this.name),r.$$.ptr||p("Cannot pass deleted object as a pointer of type "+this.name);var n=r.$$.ptrType.registeredClass;return ke(r.$$.ptr,n,this.registeredClass)}function bn(e,r){var n;if(r===null)return this.isReference&&p("null is not a valid "+this.name),this.isSmartPointer?(n=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,n),n):0;r.$$||p('Cannot pass "'+B(r)+'" as a '+this.name),r.$$.ptr||p("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&r.$$.ptrType.isConst&&p("Cannot convert argument of type "+(r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name)+" to parameter type "+this.name);var t=r.$$.ptrType.registeredClass;if(n=ke(r.$$.ptr,t,this.registeredClass),this.isSmartPointer)switch(r.$$.smartPtr===void 0&&p("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?n=r.$$.smartPtr:p("Cannot convert argument of type "+(r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:n=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)n=r.$$.smartPtr;else{var o=r.clone();n=this.rawShare(n,E(function(){o.delete()})),e!==null&&e.push(this.rawDestructor,n)}break;default:p("Unsupporting sharing policy")}return n}function Cn(e,r){if(r===null)return this.isReference&&p("null is not a valid "+this.name),0;r.$$||p('Cannot pass "'+B(r)+'" as a '+this.name),r.$$.ptr||p("Cannot pass deleted object as a pointer of type "+this.name),r.$$.ptrType.isConst&&p("Cannot convert argument of type "+r.$$.ptrType.name+" to parameter type "+this.name);var n=r.$$.ptrType.registeredClass;return ke(r.$$.ptr,n,this.registeredClass)}function wn(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function Tn(e){this.rawDestructor&&this.rawDestructor(e)}function _n(e){e!==null&&e.delete()}function dr(e,r,n){if(r===n)return e;if(n.baseClass===void 0)return null;var t=dr(e,r,n.baseClass);return t===null?null:n.downcast(t)}function Pn(){return Object.keys(te).length}function An(){var e=[];for(var r in te)te.hasOwnProperty(r)&&e.push(te[r]);return e}function Wn(e){re=e,ne.length&&re&&re(Oe)}function En(){i.getInheritedInstanceCount=Pn,i.getLiveInheritedInstances=An,i.flushPendingDeletes=Oe,i.setDelayFunction=Wn}var te={};function Sn(e,r){for(r===void 0&&p("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r}function On(e,r){return r=Sn(e,r),te[r]}function he(e,r){return r.ptrType&&r.ptr||ye("makeClassHandle requires ptr and ptrType"),!!r.smartPtrType!=!!r.smartPtr&&ye("Both smartPtrType and smartPtr must be specified"),r.count={value:1},ee(Object.create(e,{$$:{value:r}}))}function jn(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var n=On(this.registeredClass,r);if(n!==void 0){if(n.$$.count.value===0)return n.$$.ptr=r,n.$$.smartPtr=e,n.clone();var t=n.clone();return this.destructor(e),t}function o(){return this.isSmartPointer?he(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):he(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a,s=this.registeredClass.getActualType(r),u=fr[s];if(!u)return o.call(this);a=this.isConst?u.constPointerType:u.pointerType;var c=dr(r,this.registeredClass,a.registeredClass);return c===null?o.call(this):this.isSmartPointer?he(a.registeredClass.instancePrototype,{ptrType:a,ptr:c,smartPtrType:this,smartPtr:e}):he(a.registeredClass.instancePrototype,{ptrType:a,ptr:c})}function kn(){W.prototype.getPointee=wn,W.prototype.destructor=Tn,W.prototype.argPackAdvance=8,W.prototype.readValueFromPointer=Q,W.prototype.deleteObject=_n,W.prototype.fromWireType=jn}function W(e,r,n,t,o,a,s,u,c,l,f){this.name=e,this.registeredClass=r,this.isReference=n,this.isConst=t,this.isSmartPointer=o,this.pointeeType=a,this.sharingPolicy=s,this.rawGetPointee=u,this.rawConstructor=c,this.rawShare=l,this.rawDestructor=f,o||r.baseClass!==void 0?this.toWireType=bn:t?(this.toWireType=$n,this.destructorFunction=null):(this.toWireType=Cn,this.destructorFunction=null)}function yr(e,r,n){i.hasOwnProperty(e)||ye("Replacing nonexistant public symbol"),i[e].overloadTable!==void 0&&n!==void 0?i[e].overloadTable[n]=r:(i[e]=r,i[e].argCount=n)}function T(e,r){function n(o){var a=[r];return function(){a.length=arguments.length+1;for(var s=0;s>2)+t]);return n}function Rn(e,r,n,t,o,a){Pe(r>0);var s=Fe(r,n);o=T(t,o);var u=[a],c=[];j([],[e],function(l){var f="constructor "+(l=l[0]).name;if(l.registeredClass.constructor_body===void 0&&(l.registeredClass.constructor_body=[]),l.registeredClass.constructor_body[r-1]!==void 0)throw new q("Cannot register multiple constructors with identical number of parameters ("+(r-1)+") for class '"+l.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return l.registeredClass.constructor_body[r-1]=function(){ve("Cannot construct "+l.name+" due to unbound types",s)},j([],s,function(m){return l.registeredClass.constructor_body[r-1]=function(){arguments.length!==r-1&&p(f+" called with "+arguments.length+" arguments, expected "+(r-1)),c.length=0,u.length=r;for(var d=1;d4&&--C[e].refcount==0&&(C[e]=void 0,Re.push(e))}function In(){for(var e=0,r=5;r>1])};case 2:return function(t){var o=n?g:_;return this.fromWireType(o[t>>2])};default:throw new TypeError("Unknown integer type: "+e)}}function zn(e,r,n,t){var o=me(n);function a(){}r=v(r),a.values={},A(e,{name:r,constructor:a,fromWireType:function(s){return this.constructor.values[s]},toWireType:function(s,u){return u.value},argPackAdvance:8,readValueFromPointer:Hn(r,o,t),destructorFunction:null}),je(r,a)}function ge(e,r){var n=U[e];return n===void 0&&p(r+" has unknown type "+hr(e)),n}function qn(e,r,n){var t=ge(e,"enum");r=v(r);var o=t.constructor,a=Object.create(t.constructor.prototype,{value:{value:n},constructor:{value:Ae(t.name+"_"+r,function(){})}});o.values[n]=a,o[r]=a}function B(e){if(e===null)return"null";var r=typeof e;return r==="object"||r==="array"||r==="function"?e.toString():""+e}function Bn(e,r){switch(r){case 2:return function(n){return this.fromWireType(Xe[n>>2])};case 3:return function(n){return this.fromWireType(Je[n>>3])};default:throw new TypeError("Unknown float type: "+e)}}function Nn(e,r,n){var t=me(n);A(e,{name:r=v(r),fromWireType:function(o){return o},toWireType:function(o,a){if(typeof a!="number"&&typeof a!="boolean")throw new TypeError('Cannot convert "'+B(a)+'" to '+this.name);return a},argPackAdvance:8,readValueFromPointer:Bn(r,t),destructorFunction:null})}function Gn(e,r,n,t,o,a){var s=Fe(r,n);e=v(e),o=T(t,o),je(e,function(){ve("Cannot call "+e+" due to unbound types",s)},r-1),j([],s,function(u){var c=[u[0],null].concat(u.slice(1));return yr(e,vr(e,c,null,o,a),r-1),[]})}function Ln(e,r,n){switch(r){case 0:return n?function(t){return ce[t]}:function(t){return $[t]};case 1:return n?function(t){return D[t>>1]}:function(t){return Z[t>>1]};case 2:return n?function(t){return g[t>>2]}:function(t){return _[t>>2]};default:throw new TypeError("Unknown integer type: "+e)}}function Xn(e,r,n,t,o){r=v(r),o===-1&&(o=4294967295);var a=me(n),s=function(l){return l};if(t===0){var u=32-8*n;s=function(l){return l<>>u}}var c=r.indexOf("unsigned")!=-1;A(e,{name:r,fromWireType:s,toWireType:function(l,f){if(typeof f!="number"&&typeof f!="boolean")throw new TypeError('Cannot convert "'+B(f)+'" to '+this.name);if(fo)throw new TypeError('Passing a number "'+B(f)+'" from JS side to C/C++ side to an argument of type "'+r+'", which is outside the valid range ['+t+", "+o+"]!");return c?f>>>0:0|f},argPackAdvance:8,readValueFromPointer:Ln(r,a,t!==0),destructorFunction:null})}function Jn(e,r,n){var t=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function o(a){var s=_,u=s[a>>=2],c=s[a+1];return new t(V,c,u)}A(e,{name:n=v(n),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})}function Yn(e,r){var n=(r=v(r))==="std::string";A(e,{name:r,fromWireType:function(t){var o,a=_[t>>2];if(n)for(var s=t+4,u=0;u<=a;++u){var c=t+4+u;if(u==a||$[c]==0){var l=Ge(s,c-s);o===void 0?o=l:(o+="\0",o+=l),s=c+1}}else{var f=new Array(a);for(u=0;u>2]=s,n&&a)kr(o,u+4,s+1);else if(a)for(var c=0;c255&&(S(u),p("String has UTF-16 code units that do not fit in 8 bits")),$[u+4+c]=l}else for(c=0;c>2],m=a(),d=c+4,h=0;h<=f;++h){var b=c+4+h*r;if(h==f||m[b>>u]==0){var y=t(d,b-d);l===void 0?l=y:(l+="\0",l+=y),d=b+r}}return S(c),l},toWireType:function(c,l){typeof l!="string"&&p("Cannot pass non-string to C++ string type "+n);var f=s(l),m=Ie(4+f+r);return _[m>>2]=f>>u,o(l,m+4,f+r),c!==null&&c.push(S,m),m},argPackAdvance:8,readValueFromPointer:Q,destructorFunction:function(c){S(c)}})}function Kn(e,r,n,t,o,a){fe[e]={name:v(r),rawConstructor:T(n,t),rawDestructor:T(o,a),fields:[]}}function Qn(e,r,n,t,o,a,s,u,c,l){fe[e].fields.push({fieldName:v(r),getterReturnType:n,getter:T(t,o),getterContext:a,setterArgumentType:s,setter:T(u,c),setterContext:l})}function et(e,r){A(e,{isVoid:!0,name:r=v(r),argPackAdvance:0,fromWireType:function(){},toWireType:function(n,t){}})}function ie(e){return e||p("Cannot use deleted val. handle = "+e),C[e].value}function rt(e,r,n){e=ie(e),r=ge(r,"emval::as");var t=[],o=E(t);return g[n>>2]=o,r.toWireType(t,e)}var nt={};function $e(e){var r=nt[e];return r===void 0?v(e):r}var De=[];function tt(e,r,n,t){(e=De[e])(r=ie(r),n=$e(n),null,t)}function gr(){if(typeof globalThis=="object")return globalThis;function e(r){r.$$$embind_global$$$=r;var n=typeof $$$embind_global$$$=="object"&&r.$$$embind_global$$$===r;return n||delete r.$$$embind_global$$$,n}if(typeof $$$embind_global$$$=="object"||(typeof Me=="object"&&e(Me)?$$$embind_global$$$=Me:typeof self=="object"&&e(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")}function it(e){return e===0?E(gr()):(e=$e(e),E(gr()[e]))}function ot(e){var r=De.length;return De.push(e),r}function at(e,r){for(var n=new Array(e),t=0;t>2)+t],"parameter "+t);return n}function ut(e,r){var n=at(e,r),t=n[0],o=new Array(e-1);return ot(function(a,s,u,c){for(var l=0,f=0;f4&&(C[e].refcount+=1)}function ft(e){var r=new Array(e+1);return function(n,t,o){r[0]=n;for(var a=0;a>2)+a],"parameter "+a);r[a+1]=s.readValueFromPointer(o),o+=s.argPackAdvance}return E(new(n.bind.apply(n,r)))}}var $r={};function pt(e,r,n,t){e=ie(e);var o=$r[r];return o||(o=ft(r),$r[r]=o),o(e,n,t)}function dt(e){return E($e(e))}function yt(e){pe(C[e].value),xe(e)}function mt(){H()}function ht(e,r,n){$.copyWithin(e,r,r+n)}function vt(){return $.length}function gt(e){try{return Y.grow(e-V.byteLength+65535>>>16),Ze(Y.buffer),1}catch{}}function $t(e){e>>>=0;var r=vt(),n=65536,t=2147483648;if(e>t)return!1;for(var o=16777216,a=1;a<=4;a*=2){var s=r*(1+.2/a);if(s=Math.min(s,e+100663296),gt(Math.min(t,Vr(Math.max(o,e,s),n))))return!0}return!1}var be={mappings:{},buffers:[null,[],[]],printChar:function(e,r){var n=be.buffers[e];r===0||r===10?((e===1?Sr:M)(Ne(n,0)),n.length=0):n.push(r)},varargs:void 0,get:function(){return be.varargs+=4,g[be.varargs-4>>2]},getStr:function(e){return Ge(e)},get64:function(e,r){return e}};function bt(e){return 0}function Ct(e,r,n,t,o){}function wt(e,r,n,t){for(var o=0,a=0;a>2],u=g[r+(8*a+4)>>2],c=0;c>2]=o,0}function Tt(e){return(e=+e)>=0?+Zr(e+.5):+Yr(e-.5)}function _t(e){}ur=i.InternalError=We(Error,"InternalError"),sn(),q=i.BindingError=We(Error,"BindingError"),vn(),kn(),En(),mr=i.UnboundTypeError=We(Error,"UnboundTypeError"),Mn();var Pt={u:un,J:cn,y:Fn,x:Rn,d:xn,k:Dn,I:Vn,n:zn,a:qn,B:Nn,i:Gn,j:Xn,h:Jn,C:Yn,w:Zn,v:Kn,c:Qn,K:et,m:rt,s:tt,b:xe,z:it,t:ut,r:st,e:ct,g:lt,q:pt,f:dt,l:yt,p:mt,F:ht,G:$t,H:bt,D:Ct,A:wt,memory:Y,o:Tt,E:_t,table:Or};tn();var Ce,br=i.___wasm_call_ctors=function(){return(br=i.___wasm_call_ctors=i.asm.L).apply(null,arguments)},Ie=i._malloc=function(){return(Ie=i._malloc=i.asm.M).apply(null,arguments)},S=i._free=function(){return(S=i._free=i.asm.N).apply(null,arguments)},Cr=i.___getTypeName=function(){return(Cr=i.___getTypeName=i.asm.O).apply(null,arguments)};function At(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Ue(e){function r(){Ce||(Ce=!0,i.calledRun=!0,qe||(Nr(),Gr(),Ve(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),Lr()))}I>0||(Br(),I>0||(i.setStatus?(i.setStatus("Running..."),setTimeout(function(){setTimeout(function(){i.setStatus("")},1),r()},1)):r()))}if(i.___embind_register_native_and_builtin_types=function(){return(i.___embind_register_native_and_builtin_types=i.asm.P).apply(null,arguments)},i.dynCall_viii=function(){return(i.dynCall_viii=i.asm.Q).apply(null,arguments)},i.dynCall_vi=function(){return(i.dynCall_vi=i.asm.R).apply(null,arguments)},i.dynCall_v=function(){return(i.dynCall_v=i.asm.S).apply(null,arguments)},i.dynCall_i=function(){return(i.dynCall_i=i.asm.T).apply(null,arguments)},i.dynCall_iii=function(){return(i.dynCall_iii=i.asm.U).apply(null,arguments)},i.dynCall_ii=function(){return(i.dynCall_ii=i.asm.V).apply(null,arguments)},i.dynCall_vii=function(){return(i.dynCall_vii=i.asm.W).apply(null,arguments)},i.dynCall_iiii=function(){return(i.dynCall_iiii=i.asm.X).apply(null,arguments)},i.dynCall_iiiii=function(){return(i.dynCall_iiiii=i.asm.Y).apply(null,arguments)},i.dynCall_iiiiii=function(){return(i.dynCall_iiiiii=i.asm.Z).apply(null,arguments)},i.dynCall_iiiiiiii=function(){return(i.dynCall_iiiiiiii=i.asm._).apply(null,arguments)},i.dynCall_iiiiiiiii=function(){return(i.dynCall_iiiiiiiii=i.asm.$).apply(null,arguments)},i.dynCall_viiii=function(){return(i.dynCall_viiii=i.asm.aa).apply(null,arguments)},i.dynCall_iiiiiii=function(){return(i.dynCall_iiiiiii=i.asm.ba).apply(null,arguments)},i.dynCall_iiiiiiiiiiiiiiiiiiii=function(){return(i.dynCall_iiiiiiiiiiiiiiiiiiii=i.asm.ca).apply(null,arguments)},i.dynCall_iiiiiiiiiiiiiiiiiiiii=function(){return(i.dynCall_iiiiiiiiiiiiiiiiiiiii=i.asm.da).apply(null,arguments)},i.dynCall_iiiiiiiiiiiiiiiiiii=function(){return(i.dynCall_iiiiiiiiiiiiiiiiiii=i.asm.ea).apply(null,arguments)},i.dynCall_viiiii=function(){return(i.dynCall_viiiii=i.asm.fa).apply(null,arguments)},i.dynCall_iiiiiiiiii=function(){return(i.dynCall_iiiiiiiiii=i.asm.ga).apply(null,arguments)},i.dynCall_iiiiiiiiiii=function(){return(i.dynCall_iiiiiiiiiii=i.asm.ha).apply(null,arguments)},i.dynCall_jiji=function(){return(i.dynCall_jiji=i.asm.ia).apply(null,arguments)},i.dynCall_viiiiii=function(){return(i.dynCall_viiiiii=i.asm.ja).apply(null,arguments)},K=function e(){Ce||Ue(),Ce||(K=e)},i.run=Ue,i.preInit)for(typeof i.preInit=="function"&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return Ue(),ae.ready},Pr.exports=Ar;const St=Et(Wr.exports),jt=Object.freeze(Object.defineProperty({__proto__:null,default:St},Symbol.toStringTag,{value:"Module"}));export{jt as b}; diff --git a/assets/calcite-action-CEYA6ZsJ.js b/assets/calcite-action-CEYA6ZsJ.js deleted file mode 100644 index acedf67..0000000 --- a/assets/calcite-action-CEYA6ZsJ.js +++ /dev/null @@ -1,5 +0,0 @@ -import{A as t,d as o}from"./action-Ccs4b7Ti.js";import"./index-CEWggaxV.js";import"./dom-DPsTWDAQ.js";import"./guid-DQtJl1SZ.js";import"./interactive-BR2V27xp.js";import"./loadable-DylQ3Aza.js";import"./t9n-gKZJT8eY.js";import"./observers-MZ9Ss0UR.js";import"./component-WqEOSVCt.js";import"./icon-BuW41TqN.js";import"./loader-DQtzvvHl.js";/*! - * All material copyright ESRI, All Rights Reserved, unless otherwise specified. - * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. - * v2.7.1 - */const l=t,A=o;export{l as CalciteAction,A as defineCustomElement}; diff --git a/assets/calcite-action-bar-C5PvC65D.js b/assets/calcite-action-bar-glrD7fhe.js similarity index 93% rename from assets/calcite-action-bar-C5PvC65D.js rename to assets/calcite-action-bar-glrD7fhe.js index aaac9af..b65dbde 100644 --- a/assets/calcite-action-bar-C5PvC65D.js +++ b/assets/calcite-action-bar-glrD7fhe.js @@ -1,4 +1,4 @@ -import{c0 as h,c1 as H,c2 as T,c3 as D,eb as O,c4 as B}from"./index-CEWggaxV.js";import{c as G,d as M}from"./conditionalSlot-D3Ya1Vfj.js";import{g as k,o as A,s as E,m as P}from"./dom-DPsTWDAQ.js";import{a as $,s as q,c as R}from"./loadable-DylQ3Aza.js";import{u as W,c as I,a as F,s as _,d as U,b as j}from"./t9n-gKZJT8eY.js";import{c as y}from"./observers-MZ9Ss0UR.js";import{S as m,d as J}from"./action-group-CACOwGqI.js";import{S as K,d as Q,a as V}from"./action-menu-CYcibT5U.js";import{d as X}from"./action-Ccs4b7Ti.js";import{d as Y}from"./icon-BuW41TqN.js";import{d as Z}from"./loader-DQtzvvHl.js";import{d as N}from"./debounce-CYvLhpWS.js";import"./guid-DQtJl1SZ.js";import"./focusTrapComponent-C_xT3REh.js";import"./openCloseComponent-CP78bYQO.js";import"./component-WqEOSVCt.js";import"./interactive-BR2V27xp.js";/*! +import{c0 as h,c1 as H,c2 as T,c3 as D,eb as O,c4 as B}from"./index-BjUNJPVf.js";import{c as G,d as M}from"./conditionalSlot-DMpb3OPD.js";import{g as k,o as A,s as E,m as P}from"./dom-DPsTWDAQ.js";import{a as $,s as q,c as R}from"./loadable-CreDQ1Dd.js";import{u as W,c as I,a as F,s as _,d as U,b as j}from"./t9n-pVz2fW_o.js";import{c as y}from"./observers-B6R0JooC.js";import{S as m,d as J}from"./action-group-Cz5uoTMD.js";import{S as K,d as Q,a as V}from"./action-menu-B2VkSdfS.js";import{d as X}from"./action-DE-UH85X.js";import{d as Y}from"./icon-BXpWZdRl.js";import{d as Z}from"./loader-Bjz1lIB0.js";import{d as N}from"./debounce-CYvLhpWS.js";import"./guid-DQtJl1SZ.js";import"./focusTrapComponent-C_xT3REh.js";import"./openCloseComponent-7TDD8Qsp.js";import"./component-WqEOSVCt.js";import"./interactive-5-lo-GR7.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.7.1 diff --git a/assets/calcite-action-group-DMHrkhqu.js b/assets/calcite-action-group-DMHrkhqu.js new file mode 100644 index 0000000..2cfe611 --- /dev/null +++ b/assets/calcite-action-group-DMHrkhqu.js @@ -0,0 +1,5 @@ +import{A as o,d as t}from"./action-group-Cz5uoTMD.js";import"./index-BjUNJPVf.js";import"./conditionalSlot-DMpb3OPD.js";import"./observers-B6R0JooC.js";import"./loadable-CreDQ1Dd.js";import"./t9n-pVz2fW_o.js";import"./dom-DPsTWDAQ.js";import"./guid-DQtJl1SZ.js";import"./action-menu-B2VkSdfS.js";import"./action-DE-UH85X.js";import"./interactive-5-lo-GR7.js";import"./component-WqEOSVCt.js";import"./icon-BXpWZdRl.js";import"./loader-Bjz1lIB0.js";import"./debounce-CYvLhpWS.js";import"./focusTrapComponent-C_xT3REh.js";import"./openCloseComponent-7TDD8Qsp.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v2.7.1 + */const x=o,$=t;export{x as CalciteActionGroup,$ as defineCustomElement}; diff --git a/assets/calcite-action-group-oGHjFsjn.js b/assets/calcite-action-group-oGHjFsjn.js deleted file mode 100644 index 20e05bc..0000000 --- a/assets/calcite-action-group-oGHjFsjn.js +++ /dev/null @@ -1,5 +0,0 @@ -import{A as o,d as t}from"./action-group-CACOwGqI.js";import"./index-CEWggaxV.js";import"./conditionalSlot-D3Ya1Vfj.js";import"./observers-MZ9Ss0UR.js";import"./loadable-DylQ3Aza.js";import"./t9n-gKZJT8eY.js";import"./dom-DPsTWDAQ.js";import"./guid-DQtJl1SZ.js";import"./action-menu-CYcibT5U.js";import"./action-Ccs4b7Ti.js";import"./interactive-BR2V27xp.js";import"./component-WqEOSVCt.js";import"./icon-BuW41TqN.js";import"./loader-DQtzvvHl.js";import"./debounce-CYvLhpWS.js";import"./focusTrapComponent-C_xT3REh.js";import"./openCloseComponent-CP78bYQO.js";/*! - * All material copyright ESRI, All Rights Reserved, unless otherwise specified. - * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. - * v2.7.1 - */const x=o,$=t;export{x as CalciteActionGroup,$ as defineCustomElement}; diff --git a/assets/calcite-action-xwwomTuE.js b/assets/calcite-action-xwwomTuE.js new file mode 100644 index 0000000..ee00c89 --- /dev/null +++ b/assets/calcite-action-xwwomTuE.js @@ -0,0 +1,5 @@ +import{A as t,d as o}from"./action-DE-UH85X.js";import"./index-BjUNJPVf.js";import"./dom-DPsTWDAQ.js";import"./guid-DQtJl1SZ.js";import"./interactive-5-lo-GR7.js";import"./loadable-CreDQ1Dd.js";import"./t9n-pVz2fW_o.js";import"./observers-B6R0JooC.js";import"./component-WqEOSVCt.js";import"./icon-BXpWZdRl.js";import"./loader-Bjz1lIB0.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v2.7.1 + */const l=t,A=o;export{l as CalciteAction,A as defineCustomElement}; diff --git a/assets/calcite-button-CMjDkjDb.js b/assets/calcite-button-CWS09kHr.js similarity index 98% rename from assets/calcite-button-CMjDkjDb.js rename to assets/calcite-button-CWS09kHr.js index 0d8eb35..85e8c4b 100644 --- a/assets/calcite-button-CMjDkjDb.js +++ b/assets/calcite-button-CWS09kHr.js @@ -1,4 +1,4 @@ -import{c2 as v,c3 as g,c1 as f,c0 as a}from"./index-CEWggaxV.js";import{s as k,r as m,f as x}from"./form-D5ySy5kP.js";import{c as w,d as y,u as C,I as z}from"./interactive-BR2V27xp.js";import{c as E,d as L,g as S}from"./label2-BT0TPJM3.js";import{s as T,a as O,c as F}from"./loadable-DylQ3Aza.js";import{c as I,a as M,d as R,b as A,s as H,u as j}from"./t9n-gKZJT8eY.js";import{c as i}from"./observers-MZ9Ss0UR.js";import{g as c}from"./component-WqEOSVCt.js";import{t as B}from"./dom-DPsTWDAQ.js";import{d as P}from"./icon-BuW41TqN.js";import{d as _}from"./loader-DQtzvvHl.js";import"./guid-DQtJl1SZ.js";/*! +import{c2 as v,c3 as g,c1 as f,c0 as a}from"./index-BjUNJPVf.js";import{s as k,r as m,f as x}from"./form-BC9xTZIq.js";import{c as w,d as y,u as C,I as z}from"./interactive-5-lo-GR7.js";import{c as E,d as L,g as S}from"./label2-BT0TPJM3.js";import{s as T,a as O,c as F}from"./loadable-CreDQ1Dd.js";import{c as I,a as M,d as R,b as A,s as H,u as j}from"./t9n-pVz2fW_o.js";import{c as i}from"./observers-B6R0JooC.js";import{g as c}from"./component-WqEOSVCt.js";import{t as B}from"./dom-DPsTWDAQ.js";import{d as P}from"./icon-BXpWZdRl.js";import{d as _}from"./loader-Bjz1lIB0.js";import"./guid-DQtJl1SZ.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.7.1 diff --git a/assets/calcite-flow-AUD7SkeM.js b/assets/calcite-flow-cUQQQwo9.js similarity index 95% rename from assets/calcite-flow-AUD7SkeM.js rename to assets/calcite-flow-cUQQQwo9.js index 9ae9ec3..db40a9b 100644 --- a/assets/calcite-flow-AUD7SkeM.js +++ b/assets/calcite-flow-cUQQQwo9.js @@ -1,4 +1,4 @@ -import{c2 as u,c3 as p,c0 as m}from"./index-CEWggaxV.js";import{c as g}from"./observers-MZ9Ss0UR.js";import{c as w,s as b,a as v}from"./loadable-DylQ3Aza.js";/*! +import{c2 as u,c3 as p,c0 as m}from"./index-BjUNJPVf.js";import{c as g}from"./observers-B6R0JooC.js";import{c as w,s as b,a as v}from"./loadable-CreDQ1Dd.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.7.1 diff --git a/assets/calcite-flow-item-B7iK8dgk.js b/assets/calcite-flow-item-aWVm4yY6.js similarity index 96% rename from assets/calcite-flow-item-B7iK8dgk.js rename to assets/calcite-flow-item-aWVm4yY6.js index 07393e7..456f44a 100644 --- a/assets/calcite-flow-item-B7iK8dgk.js +++ b/assets/calcite-flow-item-aWVm4yY6.js @@ -1,4 +1,4 @@ -import{c2 as w,c3 as S,eb as m,c0 as t,c4 as V}from"./index-CEWggaxV.js";import{s as p,o as X,m as Y,t as x,g as Z}from"./dom-DPsTWDAQ.js";import{c as E,u as A,d as H,I as F}from"./interactive-BR2V27xp.js";import{s as B,a as z,c as L}from"./loadable-DylQ3Aza.js";import{c as P,a as I,s as M,d as O,b as T,u as D}from"./t9n-gKZJT8eY.js";import{c as N}from"./observers-MZ9Ss0UR.js";import{d as $,a as R,S as ee,H as te}from"./action-menu-CYcibT5U.js";import{d as _}from"./action-Ccs4b7Ti.js";import{d as W}from"./icon-BuW41TqN.js";import{d as K}from"./loader-DQtzvvHl.js";import{d as j}from"./scrim-DPpUFS3O.js";import"./guid-DQtJl1SZ.js";import"./debounce-CYvLhpWS.js";import"./focusTrapComponent-C_xT3REh.js";import"./openCloseComponent-CP78bYQO.js";import"./component-WqEOSVCt.js";/*! +import{c2 as w,c3 as S,eb as m,c0 as t,c4 as V}from"./index-BjUNJPVf.js";import{s as p,o as X,m as Y,t as x,g as Z}from"./dom-DPsTWDAQ.js";import{c as E,u as A,d as H,I as F}from"./interactive-5-lo-GR7.js";import{s as B,a as z,c as L}from"./loadable-CreDQ1Dd.js";import{c as P,a as I,s as M,d as O,b as T,u as D}from"./t9n-pVz2fW_o.js";import{c as N}from"./observers-B6R0JooC.js";import{d as $,a as R,S as ee,H as te}from"./action-menu-B2VkSdfS.js";import{d as _}from"./action-DE-UH85X.js";import{d as W}from"./icon-BXpWZdRl.js";import{d as K}from"./loader-Bjz1lIB0.js";import{d as j}from"./scrim-CUXJVHyU.js";import"./guid-DQtJl1SZ.js";import"./debounce-CYvLhpWS.js";import"./focusTrapComponent-C_xT3REh.js";import"./openCloseComponent-7TDD8Qsp.js";import"./component-WqEOSVCt.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.7.1 diff --git a/assets/calcite-icon-CHcIXU52.js b/assets/calcite-icon-BCYnyK8T.js similarity index 60% rename from assets/calcite-icon-CHcIXU52.js rename to assets/calcite-icon-BCYnyK8T.js index 56b9308..f1b44c9 100644 --- a/assets/calcite-icon-CHcIXU52.js +++ b/assets/calcite-icon-BCYnyK8T.js @@ -1,4 +1,4 @@ -import{I as o,d as t}from"./icon-BuW41TqN.js";import"./index-CEWggaxV.js";import"./dom-DPsTWDAQ.js";import"./guid-DQtJl1SZ.js";import"./observers-MZ9Ss0UR.js";/*! +import{I as o,d as t}from"./icon-BXpWZdRl.js";import"./index-BjUNJPVf.js";import"./dom-DPsTWDAQ.js";import"./guid-DQtJl1SZ.js";import"./observers-B6R0JooC.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.7.1 diff --git a/assets/calcite-input-fjO1QChb.js b/assets/calcite-input-BwO9LTJJ.js similarity index 50% rename from assets/calcite-input-fjO1QChb.js rename to assets/calcite-input-BwO9LTJJ.js index ead54e1..110dfb9 100644 --- a/assets/calcite-input-fjO1QChb.js +++ b/assets/calcite-input-BwO9LTJJ.js @@ -1,4 +1,4 @@ -import{I as t,d as o}from"./input2-BT_6gQkP.js";import"./index-CEWggaxV.js";import"./dom-DPsTWDAQ.js";import"./guid-DQtJl1SZ.js";import"./form-D5ySy5kP.js";import"./interactive-BR2V27xp.js";import"./t9n-gKZJT8eY.js";import"./observers-MZ9Ss0UR.js";import"./label2-BT0TPJM3.js";import"./component-WqEOSVCt.js";import"./loadable-DylQ3Aza.js";import"./icon-BuW41TqN.js";/*! +import{I as t,d as o}from"./input2-D8djCUJ5.js";import"./index-BjUNJPVf.js";import"./dom-DPsTWDAQ.js";import"./guid-DQtJl1SZ.js";import"./form-BC9xTZIq.js";import"./interactive-5-lo-GR7.js";import"./t9n-pVz2fW_o.js";import"./observers-B6R0JooC.js";import"./label2-BT0TPJM3.js";import"./component-WqEOSVCt.js";import"./loadable-CreDQ1Dd.js";import"./icon-BXpWZdRl.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.7.1 diff --git a/assets/calcite-label-DonsloAk.js b/assets/calcite-label-DlQTm19c.js similarity index 96% rename from assets/calcite-label-DonsloAk.js rename to assets/calcite-label-DlQTm19c.js index 9c1b739..d7abe9e 100644 --- a/assets/calcite-label-DonsloAk.js +++ b/assets/calcite-label-DlQTm19c.js @@ -1,4 +1,4 @@ -import{c2 as l,c3 as s,eb as o,c0 as t,c4 as c}from"./index-CEWggaxV.js";import{a as r,l as d,b as h}from"./label2-BT0TPJM3.js";import"./dom-DPsTWDAQ.js";import"./guid-DQtJl1SZ.js";import"./component-WqEOSVCt.js";/*! +import{c2 as l,c3 as s,eb as o,c0 as t,c4 as c}from"./index-BjUNJPVf.js";import{a as r,l as d,b as h}from"./label2-BT0TPJM3.js";import"./dom-DPsTWDAQ.js";import"./guid-DQtJl1SZ.js";import"./component-WqEOSVCt.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.7.1 diff --git a/assets/calcite-list-D9nZpOdw.js b/assets/calcite-list-CAcrc3c7.js similarity index 98% rename from assets/calcite-list-D9nZpOdw.js rename to assets/calcite-list-CAcrc3c7.js index 9580cf3..346657a 100644 --- a/assets/calcite-list-D9nZpOdw.js +++ b/assets/calcite-list-CAcrc3c7.js @@ -1,4 +1,4 @@ -import{c2 as me,c3 as be,c0 as v,c4 as Nn,eb as ct}from"./index-CEWggaxV.js";import{s as ut,t as Rn}from"./dom-DPsTWDAQ.js";import{c as Ge,u as $e,d as We,I as Ue}from"./interactive-BR2V27xp.js";import{c as jn}from"./observers-MZ9Ss0UR.js";import{u as Hn,b as Bn,M as zn}from"./utils3-D-MRQhiW.js";import{s as qe,a as Ke,c as Ve}from"./loadable-DylQ3Aza.js";import{u as Ze,s as Qe,c as Xn,a as Je,d as Yn,b as tn,n as Ce}from"./t9n-gKZJT8eY.js";import{S as De,i as ve,r as Gn,b as Ee,f as $n,a as Wn,c as en,d as nn}from"./debounce-CYvLhpWS.js";import{d as rn}from"./icon-BuW41TqN.js";import{a as an,b as on,d as sn}from"./input2-BT_6gQkP.js";import{d as Un}from"./loader-DQtzvvHl.js";import{d as qn}from"./scrim-DPpUFS3O.js";import"./guid-DQtJl1SZ.js";import"./form-D5ySy5kP.js";import"./label2-BT0TPJM3.js";import"./component-WqEOSVCt.js";/*! +import{c2 as me,c3 as be,c0 as v,c4 as Nn,eb as ct}from"./index-BjUNJPVf.js";import{s as ut,t as Rn}from"./dom-DPsTWDAQ.js";import{c as Ge,u as $e,d as We,I as Ue}from"./interactive-5-lo-GR7.js";import{c as jn}from"./observers-B6R0JooC.js";import{u as Hn,b as Bn,M as zn}from"./utils3-DOn9OzWH.js";import{s as qe,a as Ke,c as Ve}from"./loadable-CreDQ1Dd.js";import{u as Ze,s as Qe,c as Xn,a as Je,d as Yn,b as tn,n as Ce}from"./t9n-pVz2fW_o.js";import{S as De,i as ve,r as Gn,b as Ee,f as $n,a as Wn,c as en,d as nn}from"./debounce-CYvLhpWS.js";import{d as rn}from"./icon-BXpWZdRl.js";import{a as an,b as on,d as sn}from"./input2-D8djCUJ5.js";import{d as Un}from"./loader-Bjz1lIB0.js";import{d as qn}from"./scrim-CUXJVHyU.js";import"./guid-DQtJl1SZ.js";import"./form-BC9xTZIq.js";import"./label2-BT0TPJM3.js";import"./component-WqEOSVCt.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.7.1 diff --git a/assets/calcite-list-item-BBiyp6uG.js b/assets/calcite-list-item-JeWmt-sE.js similarity index 97% rename from assets/calcite-list-item-BBiyp6uG.js rename to assets/calcite-list-item-JeWmt-sE.js index 6a398ae..9bb4024 100644 --- a/assets/calcite-list-item-BBiyp6uG.js +++ b/assets/calcite-list-item-JeWmt-sE.js @@ -1,4 +1,4 @@ -import{c2 as A,c3 as k,eb as r,c0 as s,c4 as N}from"./index-CEWggaxV.js";import{t as b,s as m,p as L,g as Q}from"./dom-DPsTWDAQ.js";import{c as H,u as D,d as w,I as V}from"./interactive-BR2V27xp.js";import{a as y,g as x,I as f,C as i,S as p,b as X,c as Y,u as Z}from"./utils3-D-MRQhiW.js";import{a as T,c as M,s as P,b as F,d as z,u as B}from"./t9n-gKZJT8eY.js";import{s as O,a as U,c as $}from"./loadable-DylQ3Aza.js";import{d as ee}from"./action-Ccs4b7Ti.js";import{d as G}from"./icon-BuW41TqN.js";import{d as te}from"./loader-DQtzvvHl.js";import"./guid-DQtJl1SZ.js";import"./observers-MZ9Ss0UR.js";import"./component-WqEOSVCt.js";/*! +import{c2 as A,c3 as k,eb as r,c0 as s,c4 as N}from"./index-BjUNJPVf.js";import{t as b,s as m,p as L,g as Q}from"./dom-DPsTWDAQ.js";import{c as H,u as D,d as w,I as V}from"./interactive-5-lo-GR7.js";import{a as y,g as x,I as f,C as i,S as p,b as X,c as Y,u as Z}from"./utils3-DOn9OzWH.js";import{a as T,c as M,s as P,b as F,d as z,u as B}from"./t9n-pVz2fW_o.js";import{s as O,a as U,c as $}from"./loadable-CreDQ1Dd.js";import{d as ee}from"./action-DE-UH85X.js";import{d as G}from"./icon-BXpWZdRl.js";import{d as te}from"./loader-Bjz1lIB0.js";import"./guid-DQtJl1SZ.js";import"./observers-B6R0JooC.js";import"./component-WqEOSVCt.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.7.1 diff --git a/assets/calcite-list-item-group-BIMGmmtA.js b/assets/calcite-list-item-group-tUNZxrA0.js similarity index 93% rename from assets/calcite-list-item-group-BIMGmmtA.js rename to assets/calcite-list-item-group-tUNZxrA0.js index f47dbcd..656566b 100644 --- a/assets/calcite-list-item-group-BIMGmmtA.js +++ b/assets/calcite-list-item-group-tUNZxrA0.js @@ -1,4 +1,4 @@ -import{c2 as c,c3 as r,eb as d,c0 as e,c4 as h}from"./index-CEWggaxV.js";import{c as u,u as m,d as p,I as f}from"./interactive-BR2V27xp.js";import{g,M as v}from"./utils3-D-MRQhiW.js";/*! +import{c2 as c,c3 as r,eb as d,c0 as e,c4 as h}from"./index-BjUNJPVf.js";import{c as u,u as m,d as p,I as f}from"./interactive-5-lo-GR7.js";import{g,M as v}from"./utils3-DOn9OzWH.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.7.1 diff --git a/assets/calcite-loader-CzxKWzLl.js b/assets/calcite-loader-ijl1xz1O.js similarity index 69% rename from assets/calcite-loader-CzxKWzLl.js rename to assets/calcite-loader-ijl1xz1O.js index cf821ec..19471ea 100644 --- a/assets/calcite-loader-CzxKWzLl.js +++ b/assets/calcite-loader-ijl1xz1O.js @@ -1,4 +1,4 @@ -import{L as e,d as o}from"./loader-DQtzvvHl.js";import"./index-CEWggaxV.js";import"./guid-DQtJl1SZ.js";/*! +import{L as e,d as o}from"./loader-Bjz1lIB0.js";import"./index-BjUNJPVf.js";import"./guid-DQtJl1SZ.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.7.1 diff --git a/assets/calcite-modal-Dti-ITgz.js b/assets/calcite-modal-DgU9l6Wa.js similarity index 97% rename from assets/calcite-modal-Dti-ITgz.js rename to assets/calcite-modal-DgU9l6Wa.js index 283f475..4653e7e 100644 --- a/assets/calcite-modal-Dti-ITgz.js +++ b/assets/calcite-modal-DgU9l6Wa.js @@ -1,4 +1,4 @@ -import{c2 as g,c3 as v,eb as a,c0 as o,c4 as x}from"./index-CEWggaxV.js";import{c as k,d as y}from"./conditionalSlot-D3Ya1Vfj.js";import{l as s,s as c,m as w,n as d}from"./dom-DPsTWDAQ.js";import{d as l,a as h,c as z,u as C}from"./focusTrapComponent-C_xT3REh.js";import{s as O,a as E,c as M}from"./loadable-DylQ3Aza.js";import{c as m}from"./observers-MZ9Ss0UR.js";import{o as T}from"./openCloseComponent-CP78bYQO.js";import{s as S,c as F,a as B,d as L,b as D,u as I}from"./t9n-gKZJT8eY.js";import{g as $,c as H}from"./component-WqEOSVCt.js";import{d as V}from"./icon-BuW41TqN.js";import{d as W}from"./loader-DQtzvvHl.js";import{d as A}from"./scrim-DPpUFS3O.js";import"./guid-DQtJl1SZ.js";/*! +import{c2 as g,c3 as v,eb as a,c0 as o,c4 as x}from"./index-BjUNJPVf.js";import{c as k,d as y}from"./conditionalSlot-DMpb3OPD.js";import{l as s,s as c,m as w,n as d}from"./dom-DPsTWDAQ.js";import{d as l,a as h,c as z,u as C}from"./focusTrapComponent-C_xT3REh.js";import{s as O,a as E,c as M}from"./loadable-CreDQ1Dd.js";import{c as m}from"./observers-B6R0JooC.js";import{o as T}from"./openCloseComponent-7TDD8Qsp.js";import{s as S,c as F,a as B,d as L,b as D,u as I}from"./t9n-pVz2fW_o.js";import{g as $,c as H}from"./component-WqEOSVCt.js";import{d as V}from"./icon-BXpWZdRl.js";import{d as W}from"./loader-Bjz1lIB0.js";import{d as A}from"./scrim-CUXJVHyU.js";import"./guid-DQtJl1SZ.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.7.1 diff --git a/assets/calcite-notice-CHsdelpI.js b/assets/calcite-notice-Bu--C1Vt.js similarity index 96% rename from assets/calcite-notice-CHsdelpI.js rename to assets/calcite-notice-Bu--C1Vt.js index 46ea86b..c1442bc 100644 --- a/assets/calcite-notice-CHsdelpI.js +++ b/assets/calcite-notice-Bu--C1Vt.js @@ -1,4 +1,4 @@ -import{c2 as p,c3 as u,eb as s,c0 as t}from"./index-CEWggaxV.js";import{c as b,d as k}from"./conditionalSlot-D3Ya1Vfj.js";import{r as a,l as v}from"./dom-DPsTWDAQ.js";import{s as x,a as w,c as z}from"./loadable-DylQ3Aza.js";import{c as C,a as y,d as E,b as L,s as O,u as B}from"./t9n-gKZJT8eY.js";import{o as l}from"./openCloseComponent-CP78bYQO.js";import{g as r}from"./component-WqEOSVCt.js";import{d as N}from"./icon-BuW41TqN.js";import"./observers-MZ9Ss0UR.js";import"./guid-DQtJl1SZ.js";/*! +import{c2 as p,c3 as u,eb as s,c0 as t}from"./index-BjUNJPVf.js";import{c as b,d as k}from"./conditionalSlot-DMpb3OPD.js";import{r as a,l as v}from"./dom-DPsTWDAQ.js";import{s as x,a as w,c as z}from"./loadable-CreDQ1Dd.js";import{c as C,a as y,d as E,b as L,s as O,u as B}from"./t9n-pVz2fW_o.js";import{o as l}from"./openCloseComponent-7TDD8Qsp.js";import{g as r}from"./component-WqEOSVCt.js";import{d as N}from"./icon-BXpWZdRl.js";import"./observers-B6R0JooC.js";import"./guid-DQtJl1SZ.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.7.1 diff --git a/assets/capabilities-BQHqqlJu.js b/assets/capabilities-DXGHT-QH.js similarity index 96% rename from assets/capabilities-BQHqqlJu.js rename to assets/capabilities-DXGHT-QH.js index 410ec4e..6a747d6 100644 --- a/assets/capabilities-BQHqqlJu.js +++ b/assets/capabilities-DXGHT-QH.js @@ -1 +1 @@ -import{d as s,y as p,b2 as u,f as a,b3 as i}from"./index-CEWggaxV.js";import{d as l,l as d}from"./TimeInfo-3TVmpFSA.js";const m=n=>{let e=class extends n{get timeInfo(){var r;const t=(r=this.associatedLayer)==null?void 0:r.timeInfo;if(t==null)return t;const o=t.clone();return i(o,this.fieldsIndex),o}set timeInfo(t){i(t,this.fieldsIndex),this._override("timeInfo",t)}get timeExtent(){var t;return(t=this.associatedLayer)==null?void 0:t.timeExtent}set timeExtent(t){this._override("timeExtent",t)}get timeOffset(){var t;return(t=this.associatedLayer)==null?void 0:t.timeOffset}set timeOffset(t){this._override("timeOffset",t)}get useViewTime(){var t;return((t=this.associatedLayer)==null?void 0:t.useViewTime)??!0}set useViewTime(t){this._override("useViewTime",t)}get datesInUnknownTimezone(){var t;return((t=this.associatedLayer)==null?void 0:t.datesInUnknownTimezone)??!1}set datesInUnknownTimezone(t){this._override("datesInUnknownTimezone",t)}};return s([p({type:l})],e.prototype,"timeInfo",null),s([p({type:u})],e.prototype,"timeExtent",null),s([p({type:d})],e.prototype,"timeOffset",null),s([p({type:Boolean,nonNullable:!0})],e.prototype,"useViewTime",null),s([p({type:Boolean,nonNullable:!0})],e.prototype,"datesInUnknownTimezone",null),e=s([a("esri.layers.mixins.TemporalSceneLayer")],e),e},h={analytics:{supportsCacheHint:!1},attachment:{supportsContentType:!1,supportsExifInfo:!1,supportsKeywords:!1,supportsName:!1,supportsSize:!1,supportsCacheHint:!1,supportsResize:!1},data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsAsyncApplyEdits:!1,zDefault:void 0},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},query:{maxRecordCount:0,maxRecordCountFactor:0,standardMaxRecordCount:0,supportsCacheHint:!1,supportsCentroid:!1,supportsCompactGeometry:!1,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsSqlExpression:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsStatistics:!1,tileMaxRecordCount:0}};export{m,h as s}; +import{d as s,y as p,b2 as u,f as a,b3 as i}from"./index-BjUNJPVf.js";import{d as l,l as d}from"./TimeInfo-DooETFWC.js";const m=n=>{let e=class extends n{get timeInfo(){var r;const t=(r=this.associatedLayer)==null?void 0:r.timeInfo;if(t==null)return t;const o=t.clone();return i(o,this.fieldsIndex),o}set timeInfo(t){i(t,this.fieldsIndex),this._override("timeInfo",t)}get timeExtent(){var t;return(t=this.associatedLayer)==null?void 0:t.timeExtent}set timeExtent(t){this._override("timeExtent",t)}get timeOffset(){var t;return(t=this.associatedLayer)==null?void 0:t.timeOffset}set timeOffset(t){this._override("timeOffset",t)}get useViewTime(){var t;return((t=this.associatedLayer)==null?void 0:t.useViewTime)??!0}set useViewTime(t){this._override("useViewTime",t)}get datesInUnknownTimezone(){var t;return((t=this.associatedLayer)==null?void 0:t.datesInUnknownTimezone)??!1}set datesInUnknownTimezone(t){this._override("datesInUnknownTimezone",t)}};return s([p({type:l})],e.prototype,"timeInfo",null),s([p({type:u})],e.prototype,"timeExtent",null),s([p({type:d})],e.prototype,"timeOffset",null),s([p({type:Boolean,nonNullable:!0})],e.prototype,"useViewTime",null),s([p({type:Boolean,nonNullable:!0})],e.prototype,"datesInUnknownTimezone",null),e=s([a("esri.layers.mixins.TemporalSceneLayer")],e),e},h={analytics:{supportsCacheHint:!1},attachment:{supportsContentType:!1,supportsExifInfo:!1,supportsKeywords:!1,supportsName:!1,supportsSize:!1,supportsCacheHint:!1,supportsResize:!1},data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsAsyncApplyEdits:!1,zDefault:void 0},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},query:{maxRecordCount:0,maxRecordCountFactor:0,standardMaxRecordCount:0,supportsCacheHint:!1,supportsCentroid:!1,supportsCompactGeometry:!1,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsSqlExpression:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsStatistics:!1,tileMaxRecordCount:0}};export{m,h as s}; diff --git a/assets/chartCommon-DeDLy4W7.js b/assets/chartCommon-HGSAjsjY.js similarity index 98% rename from assets/chartCommon-DeDLy4W7.js rename to assets/chartCommon-HGSAjsjY.js index f126bb5..2f85c09 100644 --- a/assets/chartCommon-DeDLy4W7.js +++ b/assets/chartCommon-HGSAjsjY.js @@ -1 +1 @@ -import{an as X,a3 as s,a6 as P,h as T,w as x,r as A,a as f,i as H,ak as S,b as R,aE as B,C as b,K as M}from"./Theme-Bdh3gaKt.js";import{n as L,o as k}from"./Button-BD3vvwHs.js";import{u as V}from"./Tooltip-CVjHQVY5.js";import{s as U}from"./ColorSet-DDQ4d9ui.js";import"./index-CEWggaxV.js";class j extends X{setupDefaultRules(){super.setupDefaultRules(),this.rule("InterfaceColors").setAll({stroke:s.fromHex(0),fill:s.fromHex(2829099),primaryButton:s.lighten(s.fromHex(6788316),-.2),primaryButtonHover:s.lighten(s.fromHex(6779356),-.2),primaryButtonDown:s.lighten(s.fromHex(6872181),-.2),primaryButtonActive:s.lighten(s.fromHex(6872182),-.2),primaryButtonText:s.fromHex(16777215),primaryButtonStroke:s.lighten(s.fromHex(6788316),-.2),secondaryButton:s.fromHex(3881787),secondaryButtonHover:s.lighten(s.fromHex(3881787),.1),secondaryButtonDown:s.lighten(s.fromHex(3881787),.15),secondaryButtonActive:s.lighten(s.fromHex(3881787),.2),secondaryButtonText:s.fromHex(12303291),secondaryButtonStroke:s.lighten(s.fromHex(3881787),-.2),grid:s.fromHex(12303291),background:s.fromHex(0),alternativeBackground:s.fromHex(16777215),text:s.fromHex(16777215),alternativeText:s.fromHex(0),disabled:s.fromHex(11382189),positive:s.fromHex(5288704),negative:s.fromHex(11730944)})}}class e extends X{constructor(t,i){super(t,i),Object.defineProperty(this,"_dp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"responsiveRules",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this._dp=new P([this._root._rootContainer.onPrivate("width",n=>{this._isUsed()&&this._maybeApplyRules()}),this._root._rootContainer.onPrivate("height",n=>{this._isUsed()&&this._maybeApplyRules()})])}static widthXXS(t,i){return t<=e.XXS}static widthXS(t,i){return t<=e.XS}static widthS(t,i){return t<=e.S}static widthM(t,i){return t<=e.M}static widthL(t,i){return t<=e.L}static widthXL(t,i){return t<=e.XL}static widthXXL(t,i){return t<=e.XXL}static heightXXS(t,i){return i<=e.XXS}static heightXS(t,i){return i<=e.XS}static heightS(t,i){return i<=e.S}static heightM(t,i){return i<=e.M}static heightL(t,i){return i<=e.L}static heightXL(t,i){return i<=e.XL}static heightXXL(t,i){return i<=e.XXL}static isXXS(t,i){return t<=e.XXS&&i<=e.XXS}static isXS(t,i){return t<=e.XS&&i<=e.XS}static isS(t,i){return t<=e.S&&i<=e.S}static isM(t,i){return t<=e.M&&i<=e.M}static isL(t,i){return t<=e.L&&i<=e.L}static isXL(t,i){return t<=e.XL&&i<=e.XL}static isXXL(t,i){return t<=e.XXL&&i<=e.XXL}static maybeXXS(t,i){return t<=e.XXS||i<=e.XXS}static maybeXS(t,i){return t<=e.XS||i<=e.XS}static maybeS(t,i){return t<=e.S||i<=e.S}static maybeM(t,i){return t<=e.M||i<=e.M}static maybeL(t,i){return t<=e.L||i<=e.L}static maybeXL(t,i){return t<=e.XL||i<=e.XL}static maybeXXL(t,i){return t<=e.XXL||i<=e.XXL}static newEmpty(t){return new this(t,!0)}addRule(t){return t.name&&!t.template&&(t.template=this.rule(t.name,t.tags)),this.responsiveRules.push(t),this._maybeApplyRule(t),t}removeRule(t){T(this.responsiveRules,t)}dispose(){this._dp&&this._dp.dispose()}_isUsed(){return this._root._rootContainer.get("themes").indexOf(this)!==-1}_maybeApplyRules(){x(this.responsiveRules,t=>{this._maybeUnapplyRule(t)}),x(this.responsiveRules,t=>{this._maybeApplyRule(t)})}_maybeApplyRule(t){if(t.applied)return;const i=this._root._rootContainer.getPrivate("width"),n=this._root._rootContainer.getPrivate("height");t.relevant.call(t,i,n)&&(t.applied=!0,t.template&&t.settings&&t.template.setAll(t.settings),t.applying&&t.applying.call(t))}_maybeUnapplyRule(t){if(!t.applied)return;const i=this._root._rootContainer.getPrivate("width"),n=this._root._rootContainer.getPrivate("height");t.relevant.call(t,i,n)||(t.applied=!1,t.template&&t.template.removeAll(),t.removing&&t.removing.call(t))}setupDefaultRules(){super.setupDefaultRules();const t=i=>this.addRule(i);t({name:"Chart",relevant:e.widthXXS,settings:{paddingLeft:0,paddingRight:0}}),t({name:"Chart",relevant:e.heightXXS,settings:{paddingTop:0,paddingBottom:0}}),t({name:"Bullet",relevant:e.isXS,settings:{forceHidden:!0}}),t({name:"Legend",relevant:e.isXS,settings:{forceHidden:!0}}),t({name:"HeatLegend",tags:["vertical"],relevant:e.widthXS,settings:{forceHidden:!0}}),t({name:"HeatLegend",tags:["horizontal"],relevant:e.heightXS,settings:{forceHidden:!0}}),t({name:"Label",tags:["heatlegend","start"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"Label",tags:["heatlegend","end"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"Button",tags:["resize"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"AxisRendererX",relevant:e.heightXS,settings:{inside:!0}}),t({name:"AxisRendererY",relevant:e.widthXS,settings:{inside:!0}}),t({name:"AxisRendererXLabel",relevant:e.heightXS,settings:{minPosition:.1,maxPosition:.9}}),t({name:"AxisLabel",tags:["y"],relevant:e.widthXS,settings:{centerY:A,maxPosition:.9}}),t({name:"AxisLabel",tags:["x"],relevant:e.heightXXS,settings:{forceHidden:!0}}),t({name:"AxisLabel",tags:["x","minor"],relevant:e.widthXXL,settings:{forceHidden:!0}}),t({name:"AxisLabel",tags:["y"],relevant:e.widthXXS,settings:{forceHidden:!0}}),t({name:"AxisLabel",tags:["y","minor"],relevant:e.heightXXL,settings:{forceHidden:!0}}),t({name:"AxisTick",tags:["x"],relevant:e.heightXS,settings:{inside:!0,minPosition:.1,maxPosition:.9}}),t({name:"AxisTick",tags:["y"],relevant:e.widthXXS,settings:{inside:!0,minPosition:.1,maxPosition:.9}}),t({name:"Grid",relevant:e.maybeXXS,settings:{forceHidden:!0}}),t({name:"RadialLabel",tags:["radial"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"RadialLabel",tags:["circular"],relevant:e.maybeS,settings:{inside:!0}}),t({name:"AxisTick",relevant:e.maybeS,settings:{inside:!0}}),t({name:"RadialLabel",tags:["circular"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"AxisTick",tags:["circular"],relevant:e.maybeXS,settings:{inside:!0}}),t({name:"PieChart",relevant:e.maybeXS,settings:{radius:f(99)}}),t({name:"PieChart",relevant:e.widthM,settings:{radius:f(99)}}),t({name:"RadialLabel",tags:["pie"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"RadialLabel",tags:["pie"],relevant:e.widthM,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pie"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pie"],relevant:e.widthM,settings:{forceHidden:!0}}),t({name:"FunnelSeries",relevant:e.widthM,settings:{alignLabels:!1}}),t({name:"Label",tags:["funnel","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Tick",tags:["funnel","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Label",tags:["funnel","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["funnel","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"PyramidSeries",relevant:e.widthM,settings:{alignLabels:!1}}),t({name:"Label",tags:["pyramid","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pyramid","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Label",tags:["pyramid","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pyramid","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"PictorialStackedSeries",relevant:e.widthM,settings:{alignLabels:!1}}),t({name:"Label",tags:["pictorial","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pictorial","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Label",tags:["pictorial","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pictorial","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Label",tags:["flow","horizontal"],relevant:e.widthS,settings:{forceHidden:!0}}),t({name:"Label",tags:["flow","vertical"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Chord",relevant:e.maybeXS,settings:{radius:f(99)}}),t({name:"Label",tags:["hierarchy","node"],relevant:e.maybeXS,settings:{forceHidden:!0}})}}Object.defineProperty(e,"XXS",{enumerable:!0,configurable:!0,writable:!0,value:100}),Object.defineProperty(e,"XS",{enumerable:!0,configurable:!0,writable:!0,value:200}),Object.defineProperty(e,"S",{enumerable:!0,configurable:!0,writable:!0,value:300}),Object.defineProperty(e,"M",{enumerable:!0,configurable:!0,writable:!0,value:400}),Object.defineProperty(e,"L",{enumerable:!0,configurable:!0,writable:!0,value:600}),Object.defineProperty(e,"XL",{enumerable:!0,configurable:!0,writable:!0,value:800}),Object.defineProperty(e,"XXL",{enumerable:!0,configurable:!0,writable:!0,value:1e3});class w extends H{constructor(){super(...arguments),Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:this._makeThumb()}),Object.defineProperty(this,"startGrip",{enumerable:!0,configurable:!0,writable:!0,value:this._makeButton()}),Object.defineProperty(this,"endGrip",{enumerable:!0,configurable:!0,writable:!0,value:this._makeButton()}),Object.defineProperty(this,"_thumbBusy",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_startDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_endDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_thumbDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_gripDown",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_addOrientationClass(){this._settings.themeTags=S(this._settings.themeTags,["scrollbar",this._settings.orientation]),this._settings.background||(this._settings.background=L.new(this._root,{themeTags:S(this._settings.themeTags,["main","background"])}))}_makeButton(){return this.children.push(k.new(this._root,{themeTags:["resize","button",this.get("orientation")],icon:R.new(this._root,{themeTags:["icon"]})}))}_makeThumb(){return this.children.push(L.new(this._root,{themeTags:["thumb",this.get("orientation")]}))}_handleAnimation(t){t&&this._disposers.push(t.events.on("stopped",()=>{this.setPrivateRaw("isBusy",!1),this._thumbBusy=!1}))}_afterNew(){this._addOrientationClass(),super._afterNew();const t=this.startGrip,i=this.endGrip,n=this.thumb,l=this.get("background");l&&this._disposers.push(l.events.on("click",a=>{this.setPrivateRaw("isBusy",!0);const r=this._display.toLocal(a.point),h=this.width(),d=this.height(),u=this.get("orientation");let o,m,g;o=u=="vertical"?(r.y-n.height()/2)/d:(r.x-n.width()/2)/h,u=="vertical"?(m=o*d,g="y"):(m=o*h,g="x");const p=this.get("animationDuration",0);p>0?(this._thumbBusy=!0,this._handleAnimation(this.thumb.animate({key:g,to:m,duration:p,easing:this.get("animationEasing")}))):(this.thumb.set(g,m),this._root.events.once("frameended",()=>{this.setPrivateRaw("isBusy",!1)}))})),this._disposers.push(n.events.on("dblclick",a=>{if(!B(a.originalEvent,this))return;const r=this.get("animationDuration",0),h=this.get("animationEasing");this.animate({key:"start",to:0,duration:r,easing:h}),this.animate({key:"end",to:1,duration:r,easing:h})})),this._disposers.push(t.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._startDown=!0,this._gripDown="start"})),this._disposers.push(i.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._endDown=!0,this._gripDown="end"})),this._disposers.push(n.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._thumbDown=!0,this._gripDown=void 0})),this._disposers.push(t.events.on("globalpointerup",()=>{this._startDown&&this.setPrivateRaw("isBusy",!1),this._startDown=!1})),this._disposers.push(i.events.on("globalpointerup",()=>{this._endDown&&this.setPrivateRaw("isBusy",!1),this._endDown=!1})),this._disposers.push(n.events.on("globalpointerup",()=>{this._thumbDown&&this.setPrivateRaw("isBusy",!1),this._thumbDown=!1})),this._disposers.push(t.on("x",()=>{this._updateThumb()})),this._disposers.push(i.on("x",()=>{this._updateThumb()})),this._disposers.push(t.on("y",()=>{this._updateThumb()})),this._disposers.push(i.on("y",()=>{this._updateThumb()})),this._disposers.push(n.events.on("positionchanged",()=>{this._updateGripsByThumb()})),this.get("orientation")=="vertical"?(t.set("x",0),i.set("x",0),this._disposers.push(n.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()-n.height()),0))),this._disposers.push(n.adapters.add("x",a=>this.width()/2)),this._disposers.push(t.adapters.add("x",a=>this.width()/2)),this._disposers.push(i.adapters.add("x",a=>this.width()/2)),this._disposers.push(t.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()),0))),this._disposers.push(i.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()),0)))):(t.set("y",0),i.set("y",0),this._disposers.push(n.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()-n.width()),0))),this._disposers.push(n.adapters.add("y",a=>this.height()/2)),this._disposers.push(t.adapters.add("y",a=>this.height()/2)),this._disposers.push(i.adapters.add("y",a=>this.height()/2)),this._disposers.push(t.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()),0))),this._disposers.push(i.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()),0))))}_updateChildren(){super._updateChildren(),(this.isDirty("end")||this.isDirty("start")||this._sizeDirty)&&this.updateGrips()}_changed(){if(super._changed(),this.isDirty("start")||this.isDirty("end")){const t="rangechanged";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this,start:this.get("start",0),end:this.get("end",1),grip:this._gripDown})}}updateGrips(){const t=this.startGrip,i=this.endGrip,n=this.get("orientation"),l=this.height(),a=this.width();n=="vertical"?(t.set("y",l*this.get("start",0)),i.set("y",l*this.get("end",1))):(t.set("x",a*this.get("start",0)),i.set("x",a*this.get("end",1)));const r=this.getPrivate("positionTextFunction"),h=Math.round(100*this.get("start",0)),d=Math.round(100*this.get("end",0));let u,o;r?(u=r.call(this,this.get("start",0)),o=r.call(this,this.get("end",0))):(u=h+"%",o=d+"%"),t.set("ariaLabel",this._t("From %1",void 0,u)),t.set("ariaValueNow",""+h),t.set("ariaValueText",h+"%"),t.set("ariaValueMin","0"),t.set("ariaValueMax","100"),i.set("ariaLabel",this._t("To %1",void 0,o)),i.set("ariaValueNow",""+d),i.set("ariaValueText",d+"%"),i.set("ariaValueMin","0"),i.set("ariaValueMax","100")}_updateThumb(){const t=this.thumb,i=this.startGrip,n=this.endGrip,l=this.height(),a=this.width();let r=i.x(),h=n.x(),d=i.y(),u=n.y(),o=0,m=1;this.get("orientation")=="vertical"?b(d)&&b(u)&&(this._thumbBusy||t.isDragging()||(t.set("height",u-d),t.set("y",d)),o=d/l,m=u/l):b(r)&&b(h)&&(this._thumbBusy||t.isDragging()||(t.set("width",h-r),t.set("x",r)),o=r/a,m=h/a),!this.getPrivate("isBusy")||this.get("start")==o&&this.get("end")==m||(this.set("start",o),this.set("end",m));const g=this.getPrivate("positionTextFunction"),p=Math.round(100*this.get("start",0)),D=Math.round(100*this.get("end",0));let v,y;g?(v=g.call(this,this.get("start",0)),y=g.call(this,this.get("end",0))):(v=p+"%",y=D+"%"),t.set("ariaLabel",this._t("From %1 to %2",void 0,v,y)),t.set("ariaValueNow",""+p),t.set("ariaValueText",p+"%")}_updateGripsByThumb(){const t=this.thumb,i=this.startGrip,n=this.endGrip;if(this.get("orientation")=="vertical"){const l=t.height();i.set("y",t.y()),n.set("y",t.y()+l)}else{const l=t.width();i.set("x",t.x()),n.set("x",t.x()+l)}}}Object.defineProperty(w,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Scrollbar"}),Object.defineProperty(w,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:H.classNames.concat([w.className])});class G extends X{setupDefaultRules(){super.setupDefaultRules(),this.rule("Component").setAll({interpolationDuration:600}),this.rule("Hierarchy").set("animationDuration",600),this.rule("Scrollbar").set("animationDuration",600),this.rule("Tooltip").set("animationDuration",300),this.rule("MapChart").set("animationDuration",1e3),this.rule("MapChart").set("wheelDuration",300),this.rule("Entity").setAll({stateAnimationDuration:600}),this.rule("Sprite").states.create("default",{stateAnimationDuration:600}),this.rule("Tooltip",["axis"]).setAll({animationDuration:200}),this.rule("WordCloud").set("animationDuration",500),this.rule("Polygon").set("animationDuration",600),this.rule("ArcDiagram").set("animationDuration",600)}}const N=["#2888B8","#EB7028","#48A375","#9370B1","#e55035","#3d9ccc","#DC7B04","#b87bb0","#3fa681","#EE6386"].map(c=>M(c));export{G as AnimatedThemeAm5,U as ColorSetAm5,j as DarkThemeAm5,e as ResponsiveThemeAm5,w as ScrollbarAm5,X as ThemeAm5,V as TooltipAm5,M as colorAm5,N as esriChartColorSet}; +import{an as X,a3 as s,a6 as P,h as T,w as x,r as A,a as f,i as H,ak as S,b as R,aE as B,C as b,K as M}from"./Theme-6HY29PEY.js";import{n as L,o as k}from"./Button-D2RihRUZ.js";import{u as V}from"./Tooltip-C7eoaNP4.js";import{s as U}from"./ColorSet-wEWjQ87p.js";import"./index-BjUNJPVf.js";class j extends X{setupDefaultRules(){super.setupDefaultRules(),this.rule("InterfaceColors").setAll({stroke:s.fromHex(0),fill:s.fromHex(2829099),primaryButton:s.lighten(s.fromHex(6788316),-.2),primaryButtonHover:s.lighten(s.fromHex(6779356),-.2),primaryButtonDown:s.lighten(s.fromHex(6872181),-.2),primaryButtonActive:s.lighten(s.fromHex(6872182),-.2),primaryButtonText:s.fromHex(16777215),primaryButtonStroke:s.lighten(s.fromHex(6788316),-.2),secondaryButton:s.fromHex(3881787),secondaryButtonHover:s.lighten(s.fromHex(3881787),.1),secondaryButtonDown:s.lighten(s.fromHex(3881787),.15),secondaryButtonActive:s.lighten(s.fromHex(3881787),.2),secondaryButtonText:s.fromHex(12303291),secondaryButtonStroke:s.lighten(s.fromHex(3881787),-.2),grid:s.fromHex(12303291),background:s.fromHex(0),alternativeBackground:s.fromHex(16777215),text:s.fromHex(16777215),alternativeText:s.fromHex(0),disabled:s.fromHex(11382189),positive:s.fromHex(5288704),negative:s.fromHex(11730944)})}}class e extends X{constructor(t,i){super(t,i),Object.defineProperty(this,"_dp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"responsiveRules",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this._dp=new P([this._root._rootContainer.onPrivate("width",n=>{this._isUsed()&&this._maybeApplyRules()}),this._root._rootContainer.onPrivate("height",n=>{this._isUsed()&&this._maybeApplyRules()})])}static widthXXS(t,i){return t<=e.XXS}static widthXS(t,i){return t<=e.XS}static widthS(t,i){return t<=e.S}static widthM(t,i){return t<=e.M}static widthL(t,i){return t<=e.L}static widthXL(t,i){return t<=e.XL}static widthXXL(t,i){return t<=e.XXL}static heightXXS(t,i){return i<=e.XXS}static heightXS(t,i){return i<=e.XS}static heightS(t,i){return i<=e.S}static heightM(t,i){return i<=e.M}static heightL(t,i){return i<=e.L}static heightXL(t,i){return i<=e.XL}static heightXXL(t,i){return i<=e.XXL}static isXXS(t,i){return t<=e.XXS&&i<=e.XXS}static isXS(t,i){return t<=e.XS&&i<=e.XS}static isS(t,i){return t<=e.S&&i<=e.S}static isM(t,i){return t<=e.M&&i<=e.M}static isL(t,i){return t<=e.L&&i<=e.L}static isXL(t,i){return t<=e.XL&&i<=e.XL}static isXXL(t,i){return t<=e.XXL&&i<=e.XXL}static maybeXXS(t,i){return t<=e.XXS||i<=e.XXS}static maybeXS(t,i){return t<=e.XS||i<=e.XS}static maybeS(t,i){return t<=e.S||i<=e.S}static maybeM(t,i){return t<=e.M||i<=e.M}static maybeL(t,i){return t<=e.L||i<=e.L}static maybeXL(t,i){return t<=e.XL||i<=e.XL}static maybeXXL(t,i){return t<=e.XXL||i<=e.XXL}static newEmpty(t){return new this(t,!0)}addRule(t){return t.name&&!t.template&&(t.template=this.rule(t.name,t.tags)),this.responsiveRules.push(t),this._maybeApplyRule(t),t}removeRule(t){T(this.responsiveRules,t)}dispose(){this._dp&&this._dp.dispose()}_isUsed(){return this._root._rootContainer.get("themes").indexOf(this)!==-1}_maybeApplyRules(){x(this.responsiveRules,t=>{this._maybeUnapplyRule(t)}),x(this.responsiveRules,t=>{this._maybeApplyRule(t)})}_maybeApplyRule(t){if(t.applied)return;const i=this._root._rootContainer.getPrivate("width"),n=this._root._rootContainer.getPrivate("height");t.relevant.call(t,i,n)&&(t.applied=!0,t.template&&t.settings&&t.template.setAll(t.settings),t.applying&&t.applying.call(t))}_maybeUnapplyRule(t){if(!t.applied)return;const i=this._root._rootContainer.getPrivate("width"),n=this._root._rootContainer.getPrivate("height");t.relevant.call(t,i,n)||(t.applied=!1,t.template&&t.template.removeAll(),t.removing&&t.removing.call(t))}setupDefaultRules(){super.setupDefaultRules();const t=i=>this.addRule(i);t({name:"Chart",relevant:e.widthXXS,settings:{paddingLeft:0,paddingRight:0}}),t({name:"Chart",relevant:e.heightXXS,settings:{paddingTop:0,paddingBottom:0}}),t({name:"Bullet",relevant:e.isXS,settings:{forceHidden:!0}}),t({name:"Legend",relevant:e.isXS,settings:{forceHidden:!0}}),t({name:"HeatLegend",tags:["vertical"],relevant:e.widthXS,settings:{forceHidden:!0}}),t({name:"HeatLegend",tags:["horizontal"],relevant:e.heightXS,settings:{forceHidden:!0}}),t({name:"Label",tags:["heatlegend","start"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"Label",tags:["heatlegend","end"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"Button",tags:["resize"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"AxisRendererX",relevant:e.heightXS,settings:{inside:!0}}),t({name:"AxisRendererY",relevant:e.widthXS,settings:{inside:!0}}),t({name:"AxisRendererXLabel",relevant:e.heightXS,settings:{minPosition:.1,maxPosition:.9}}),t({name:"AxisLabel",tags:["y"],relevant:e.widthXS,settings:{centerY:A,maxPosition:.9}}),t({name:"AxisLabel",tags:["x"],relevant:e.heightXXS,settings:{forceHidden:!0}}),t({name:"AxisLabel",tags:["x","minor"],relevant:e.widthXXL,settings:{forceHidden:!0}}),t({name:"AxisLabel",tags:["y"],relevant:e.widthXXS,settings:{forceHidden:!0}}),t({name:"AxisLabel",tags:["y","minor"],relevant:e.heightXXL,settings:{forceHidden:!0}}),t({name:"AxisTick",tags:["x"],relevant:e.heightXS,settings:{inside:!0,minPosition:.1,maxPosition:.9}}),t({name:"AxisTick",tags:["y"],relevant:e.widthXXS,settings:{inside:!0,minPosition:.1,maxPosition:.9}}),t({name:"Grid",relevant:e.maybeXXS,settings:{forceHidden:!0}}),t({name:"RadialLabel",tags:["radial"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"RadialLabel",tags:["circular"],relevant:e.maybeS,settings:{inside:!0}}),t({name:"AxisTick",relevant:e.maybeS,settings:{inside:!0}}),t({name:"RadialLabel",tags:["circular"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"AxisTick",tags:["circular"],relevant:e.maybeXS,settings:{inside:!0}}),t({name:"PieChart",relevant:e.maybeXS,settings:{radius:f(99)}}),t({name:"PieChart",relevant:e.widthM,settings:{radius:f(99)}}),t({name:"RadialLabel",tags:["pie"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"RadialLabel",tags:["pie"],relevant:e.widthM,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pie"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pie"],relevant:e.widthM,settings:{forceHidden:!0}}),t({name:"FunnelSeries",relevant:e.widthM,settings:{alignLabels:!1}}),t({name:"Label",tags:["funnel","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Tick",tags:["funnel","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Label",tags:["funnel","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["funnel","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"PyramidSeries",relevant:e.widthM,settings:{alignLabels:!1}}),t({name:"Label",tags:["pyramid","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pyramid","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Label",tags:["pyramid","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pyramid","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"PictorialStackedSeries",relevant:e.widthM,settings:{alignLabels:!1}}),t({name:"Label",tags:["pictorial","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pictorial","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Label",tags:["pictorial","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pictorial","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Label",tags:["flow","horizontal"],relevant:e.widthS,settings:{forceHidden:!0}}),t({name:"Label",tags:["flow","vertical"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Chord",relevant:e.maybeXS,settings:{radius:f(99)}}),t({name:"Label",tags:["hierarchy","node"],relevant:e.maybeXS,settings:{forceHidden:!0}})}}Object.defineProperty(e,"XXS",{enumerable:!0,configurable:!0,writable:!0,value:100}),Object.defineProperty(e,"XS",{enumerable:!0,configurable:!0,writable:!0,value:200}),Object.defineProperty(e,"S",{enumerable:!0,configurable:!0,writable:!0,value:300}),Object.defineProperty(e,"M",{enumerable:!0,configurable:!0,writable:!0,value:400}),Object.defineProperty(e,"L",{enumerable:!0,configurable:!0,writable:!0,value:600}),Object.defineProperty(e,"XL",{enumerable:!0,configurable:!0,writable:!0,value:800}),Object.defineProperty(e,"XXL",{enumerable:!0,configurable:!0,writable:!0,value:1e3});class w extends H{constructor(){super(...arguments),Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:this._makeThumb()}),Object.defineProperty(this,"startGrip",{enumerable:!0,configurable:!0,writable:!0,value:this._makeButton()}),Object.defineProperty(this,"endGrip",{enumerable:!0,configurable:!0,writable:!0,value:this._makeButton()}),Object.defineProperty(this,"_thumbBusy",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_startDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_endDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_thumbDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_gripDown",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_addOrientationClass(){this._settings.themeTags=S(this._settings.themeTags,["scrollbar",this._settings.orientation]),this._settings.background||(this._settings.background=L.new(this._root,{themeTags:S(this._settings.themeTags,["main","background"])}))}_makeButton(){return this.children.push(k.new(this._root,{themeTags:["resize","button",this.get("orientation")],icon:R.new(this._root,{themeTags:["icon"]})}))}_makeThumb(){return this.children.push(L.new(this._root,{themeTags:["thumb",this.get("orientation")]}))}_handleAnimation(t){t&&this._disposers.push(t.events.on("stopped",()=>{this.setPrivateRaw("isBusy",!1),this._thumbBusy=!1}))}_afterNew(){this._addOrientationClass(),super._afterNew();const t=this.startGrip,i=this.endGrip,n=this.thumb,l=this.get("background");l&&this._disposers.push(l.events.on("click",a=>{this.setPrivateRaw("isBusy",!0);const r=this._display.toLocal(a.point),h=this.width(),d=this.height(),u=this.get("orientation");let o,m,g;o=u=="vertical"?(r.y-n.height()/2)/d:(r.x-n.width()/2)/h,u=="vertical"?(m=o*d,g="y"):(m=o*h,g="x");const p=this.get("animationDuration",0);p>0?(this._thumbBusy=!0,this._handleAnimation(this.thumb.animate({key:g,to:m,duration:p,easing:this.get("animationEasing")}))):(this.thumb.set(g,m),this._root.events.once("frameended",()=>{this.setPrivateRaw("isBusy",!1)}))})),this._disposers.push(n.events.on("dblclick",a=>{if(!B(a.originalEvent,this))return;const r=this.get("animationDuration",0),h=this.get("animationEasing");this.animate({key:"start",to:0,duration:r,easing:h}),this.animate({key:"end",to:1,duration:r,easing:h})})),this._disposers.push(t.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._startDown=!0,this._gripDown="start"})),this._disposers.push(i.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._endDown=!0,this._gripDown="end"})),this._disposers.push(n.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._thumbDown=!0,this._gripDown=void 0})),this._disposers.push(t.events.on("globalpointerup",()=>{this._startDown&&this.setPrivateRaw("isBusy",!1),this._startDown=!1})),this._disposers.push(i.events.on("globalpointerup",()=>{this._endDown&&this.setPrivateRaw("isBusy",!1),this._endDown=!1})),this._disposers.push(n.events.on("globalpointerup",()=>{this._thumbDown&&this.setPrivateRaw("isBusy",!1),this._thumbDown=!1})),this._disposers.push(t.on("x",()=>{this._updateThumb()})),this._disposers.push(i.on("x",()=>{this._updateThumb()})),this._disposers.push(t.on("y",()=>{this._updateThumb()})),this._disposers.push(i.on("y",()=>{this._updateThumb()})),this._disposers.push(n.events.on("positionchanged",()=>{this._updateGripsByThumb()})),this.get("orientation")=="vertical"?(t.set("x",0),i.set("x",0),this._disposers.push(n.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()-n.height()),0))),this._disposers.push(n.adapters.add("x",a=>this.width()/2)),this._disposers.push(t.adapters.add("x",a=>this.width()/2)),this._disposers.push(i.adapters.add("x",a=>this.width()/2)),this._disposers.push(t.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()),0))),this._disposers.push(i.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()),0)))):(t.set("y",0),i.set("y",0),this._disposers.push(n.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()-n.width()),0))),this._disposers.push(n.adapters.add("y",a=>this.height()/2)),this._disposers.push(t.adapters.add("y",a=>this.height()/2)),this._disposers.push(i.adapters.add("y",a=>this.height()/2)),this._disposers.push(t.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()),0))),this._disposers.push(i.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()),0))))}_updateChildren(){super._updateChildren(),(this.isDirty("end")||this.isDirty("start")||this._sizeDirty)&&this.updateGrips()}_changed(){if(super._changed(),this.isDirty("start")||this.isDirty("end")){const t="rangechanged";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this,start:this.get("start",0),end:this.get("end",1),grip:this._gripDown})}}updateGrips(){const t=this.startGrip,i=this.endGrip,n=this.get("orientation"),l=this.height(),a=this.width();n=="vertical"?(t.set("y",l*this.get("start",0)),i.set("y",l*this.get("end",1))):(t.set("x",a*this.get("start",0)),i.set("x",a*this.get("end",1)));const r=this.getPrivate("positionTextFunction"),h=Math.round(100*this.get("start",0)),d=Math.round(100*this.get("end",0));let u,o;r?(u=r.call(this,this.get("start",0)),o=r.call(this,this.get("end",0))):(u=h+"%",o=d+"%"),t.set("ariaLabel",this._t("From %1",void 0,u)),t.set("ariaValueNow",""+h),t.set("ariaValueText",h+"%"),t.set("ariaValueMin","0"),t.set("ariaValueMax","100"),i.set("ariaLabel",this._t("To %1",void 0,o)),i.set("ariaValueNow",""+d),i.set("ariaValueText",d+"%"),i.set("ariaValueMin","0"),i.set("ariaValueMax","100")}_updateThumb(){const t=this.thumb,i=this.startGrip,n=this.endGrip,l=this.height(),a=this.width();let r=i.x(),h=n.x(),d=i.y(),u=n.y(),o=0,m=1;this.get("orientation")=="vertical"?b(d)&&b(u)&&(this._thumbBusy||t.isDragging()||(t.set("height",u-d),t.set("y",d)),o=d/l,m=u/l):b(r)&&b(h)&&(this._thumbBusy||t.isDragging()||(t.set("width",h-r),t.set("x",r)),o=r/a,m=h/a),!this.getPrivate("isBusy")||this.get("start")==o&&this.get("end")==m||(this.set("start",o),this.set("end",m));const g=this.getPrivate("positionTextFunction"),p=Math.round(100*this.get("start",0)),D=Math.round(100*this.get("end",0));let v,y;g?(v=g.call(this,this.get("start",0)),y=g.call(this,this.get("end",0))):(v=p+"%",y=D+"%"),t.set("ariaLabel",this._t("From %1 to %2",void 0,v,y)),t.set("ariaValueNow",""+p),t.set("ariaValueText",p+"%")}_updateGripsByThumb(){const t=this.thumb,i=this.startGrip,n=this.endGrip;if(this.get("orientation")=="vertical"){const l=t.height();i.set("y",t.y()),n.set("y",t.y()+l)}else{const l=t.width();i.set("x",t.x()),n.set("x",t.x()+l)}}}Object.defineProperty(w,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Scrollbar"}),Object.defineProperty(w,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:H.classNames.concat([w.className])});class G extends X{setupDefaultRules(){super.setupDefaultRules(),this.rule("Component").setAll({interpolationDuration:600}),this.rule("Hierarchy").set("animationDuration",600),this.rule("Scrollbar").set("animationDuration",600),this.rule("Tooltip").set("animationDuration",300),this.rule("MapChart").set("animationDuration",1e3),this.rule("MapChart").set("wheelDuration",300),this.rule("Entity").setAll({stateAnimationDuration:600}),this.rule("Sprite").states.create("default",{stateAnimationDuration:600}),this.rule("Tooltip",["axis"]).setAll({animationDuration:200}),this.rule("WordCloud").set("animationDuration",500),this.rule("Polygon").set("animationDuration",600),this.rule("ArcDiagram").set("animationDuration",600)}}const N=["#2888B8","#EB7028","#48A375","#9370B1","#e55035","#3d9ccc","#DC7B04","#b87bb0","#3fa681","#EE6386"].map(c=>M(c));export{G as AnimatedThemeAm5,U as ColorSetAm5,j as DarkThemeAm5,e as ResponsiveThemeAm5,w as ScrollbarAm5,X as ThemeAm5,V as TooltipAm5,M as colorAm5,N as esriChartColorSet}; diff --git a/assets/chartUtilsAm5-DYfwNDSz.js b/assets/chartUtilsAm5-D5owA826.js similarity index 99% rename from assets/chartUtilsAm5-DYfwNDSz.js rename to assets/chartUtilsAm5-D5owA826.js index 133d016..c729716 100644 --- a/assets/chartUtilsAm5-DYfwNDSz.js +++ b/assets/chartUtilsAm5-D5owA826.js @@ -1 +1 @@ -import{cd as lt,_ as x}from"./index-CEWggaxV.js";import{B as te,k as ht,G as ut,$ as ct,X as dt,Z as bt,u as _t,w as y,x as ie,i as Z,a as Ke,r as K,z as ft,K as re,b as ze,l as J,q as me,c as C,t as gt,e as mt,L as ye,N as se,O as pt,d as X,f as De,g as yt,h as ae,j as Ie,T as Te,m as vt,W as ue,n as pe,s as wt,J as Je,_ as Qe,y as Ce,F as xt,o as ee,p as Q,v as U,A as Pt,C as H,E as Ot,D as j,H as de,S as be,I as Re,M as kt,P as Fe,Q as Et,R as Mt,U as V,V as Ye,Y as St,a0 as Tt,a1 as jt,a2 as Dt,a3 as G,a4 as _e,a5 as Ct,a6 as He,a7 as je,a8 as et,a9 as Ve,aa as Bt,ab as At,ac as tt,ad as it,ae as Lt,af as zt,ag as It,ah as Rt,ai as le,aj as Pe}from"./Theme-Bdh3gaKt.js";import{u as We}from"./Tooltip-CVjHQVY5.js";import{s as Ft}from"./DefaultTheme-QXTOOsyZ.js";class Yt{constructor(){Object.defineProperty(this,"_observer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_targets",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this._observer=new ResizeObserver(e=>{y(e,t=>{y(this._targets,i=>{i.target===t.target&&i.callback()})})})}addTarget(e,t){this._observer.observe(e,{box:"border-box"}),this._targets.push({target:e,callback:t})}removeTarget(e){this._observer.unobserve(e),ye(this._targets,t=>t.target!==e)}}class ve{constructor(){Object.defineProperty(this,"_timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_targets",{enumerable:!0,configurable:!0,writable:!0,value:[]})}addTarget(e,t){if(this._timer===null){let r=null;const a=()=>{const s=Date.now();(r===null||s>r+ve.delay)&&(r=s,y(this._targets,n=>{let h=n.target.getBoundingClientRect();h.width===n.size.width&&h.height===n.size.height||(n.size=h,n.callback())})),this._targets.length===0?this._timer=null:this._timer=requestAnimationFrame(a)};this._timer=requestAnimationFrame(a)}let i={width:0,height:0,left:0,right:0,top:0,bottom:0,x:0,y:0};this._targets.push({target:e,callback:t,size:i})}removeTarget(e){ye(this._targets,t=>t.target!==e),this._targets.length===0&&this._timer!==null&&(cancelAnimationFrame(this._timer),this._timer=null)}}Object.defineProperty(ve,"delay",{enumerable:!0,configurable:!0,writable:!0,value:200});let Oe=null;function Ht(){return Oe===null&&(Oe=typeof ResizeObserver<"u"?new Yt:new ve),Oe}class Vt{constructor(e,t){Object.defineProperty(this,"_sensor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_element",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_listener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this._sensor=Ht(),this._element=e,this._listener=Je(t),this._sensor.addTarget(e,t)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._sensor.removeTarget(this._element),this._listener.dispose())}get sensor(){return this._sensor}}class ge extends te{}Object.defineProperty(ge,"className",{enumerable:!0,configurable:!0,writable:!0,value:"InterfaceColors"}),Object.defineProperty(ge,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:te.classNames.concat([ge.className])});class Wt extends te{_setDefaults(){this._setDefault("negativeBase",0),this._setDefault("numberFormat","#,###.#####"),this._setDefault("smallNumberThreshold",1);const e="_big_number_suffix_",t="_small_number_suffix_",i="_byte_suffix_";this._setDefault("bigNumberPrefixes",[{number:1e3,suffix:this._t(e+"3")},{number:1e6,suffix:this._t(e+"6")},{number:1e9,suffix:this._t(e+"9")},{number:1e12,suffix:this._t(e+"12")},{number:1e15,suffix:this._t(e+"15")},{number:1e18,suffix:this._t(e+"18")},{number:1e21,suffix:this._t(e+"21")},{number:1e24,suffix:this._t(e+"24")}]),this._setDefault("smallNumberPrefixes",[{number:1e-24,suffix:this._t(t+"24")},{number:1e-21,suffix:this._t(t+"21")},{number:1e-18,suffix:this._t(t+"18")},{number:1e-15,suffix:this._t(t+"15")},{number:1e-12,suffix:this._t(t+"12")},{number:1e-9,suffix:this._t(t+"9")},{number:1e-6,suffix:this._t(t+"6")},{number:.001,suffix:this._t(t+"3")}]),this._setDefault("bytePrefixes",[{number:1,suffix:this._t(i+"B")},{number:1024,suffix:this._t(i+"KB")},{number:1048576,suffix:this._t(i+"MB")},{number:1073741824,suffix:this._t(i+"GB")},{number:1099511627776,suffix:this._t(i+"TB")},{number:0x4000000000000,suffix:this._t(i+"PB")}]),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(e,t,i){let r;(t==null||pe(t)&&t.toLowerCase()==="number")&&(t=this.get("numberFormat",""));let a=Number(e);if(Qe(t))try{return this.get("intlLocales")?new Intl.NumberFormat(this.get("intlLocales"),t).format(a):new Intl.NumberFormat(void 0,t).format(a)}catch{return"Invalid"}else{t=Ce(t);let s,n=this.parseFormat(t,this._root.language);s=a>this.get("negativeBase")?n.positive:a{if(h.parsed)return;let c=h.source;c.toLowerCase()==="number"&&(c=this.get("numberFormat","#,###.#####"));let f=U.chunk(c,!0);for(let u=0;u=0?e.toExponential(t.decimals.passive).split("e"):e.toExponential().split("e"),e=Number(u[0]),a="e"+u[1],t.modSpacing&&(a=" "+a)}else if(t.decimals.passive===0)e=Math.round(e);else if(t.decimals.passive>0){let u=Math.pow(10,t.decimals.passive);e=Math.round(e*u)/u}let n="",h=Pt(e).split("."),c=h[0];if(c.length0){let u=[],b=c.split("").reverse().join("");for(let o=0,m=c.length;o<=m;o+=t.thousands.interval){let l=b.substr(o,t.thousands.interval).split("").reverse().join("");l!==""&&u.unshift(l)}c=u.join(t.thousands.separator)}n+=c,h.length===1&&h.push("");let f=h[1];return f.length{switch(f.type){case"year":t=+f.value;break;case"month":i=+f.value-1;break;case"day":r=+f.value;break;case"hour":a=+f.value;break;case"minute":s=+f.value;break;case"second":n=+f.value;break;case"fractionalSecond":h=+f.value;break;case"weekday":switch(f.value){case"Sun":c=0;break;case"Mon":c=1;break;case"Tue":c=2;break;case"Wed":c=3;break;case"Thu":c=4;break;case"Fri":c=5;break;case"Sat":c=6}}}),a===24&&(a=0),{year:t,month:i,day:r,hour:a,minute:s,second:n,millisecond:h,weekday:c}}function Ue(d,e){const{year:t,month:i,day:r,hour:a,minute:s,second:n,millisecond:h}=rt(d,e);return Date.UTC(t,i,r,a,s,n,h)}class Ut{constructor(e,t){if(Object.defineProperty(this,"_utc",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dtf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!t)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this.name=e,this._utc=new Intl.DateTimeFormat("UTC",{hour12:!1,timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",fractionalSecondDigits:3}),this._dtf=new Intl.DateTimeFormat("UTC",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",fractionalSecondDigits:3})}static new(e){return new this(e,!0)}convertLocal(e){const t=this.offsetUTC(e),i=e.getTimezoneOffset(),r=new Date(e);r.setUTCMinutes(r.getUTCMinutes()-(t-i));const a=r.getTimezoneOffset();return i!=a&&r.setUTCMinutes(r.getUTCMinutes()+a-i),r}offsetUTC(e){return(Ue(this._utc,e)-Ue(this._dtf,e))/6e4}parseDate(e){return rt(this._dtf,e)}}class $t extends te{_setDefaults(){this._setDefault("capitalize",!0),this._setDefault("dateFormat","yyyy-MM-dd"),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(e,t){let i;t!==void 0&&t!==""||(t=this.get("dateFormat","yyyy-MM-dd"));let r=e;if(Qe(t))try{const n=this.get("intlLocales");return n?new Intl.DateTimeFormat(n,t).format(r):new Intl.DateTimeFormat(void 0,t).format(r)}catch{return"Invalid"}let a=this.parseFormat(t);const s=this._root.timezone;return s&&!this._root.utc&&(r=s.convertLocal(r)),H(r.getTime())?(i=this.applyFormat(r,a),this.get("capitalize")&&(i=i.replace(/^.{1}/,i.substr(0,1).toUpperCase())),i):"Invalid date"}applyFormat(e,t){let i,r,a,s,n,h,c,f,u=t.template,b=e.getTime();this._root.utc?(i=e.getUTCFullYear(),r=e.getUTCMonth(),a=e.getUTCDay(),s=e.getUTCDate(),n=e.getUTCHours(),h=e.getUTCMinutes(),c=e.getUTCSeconds(),f=e.getUTCMilliseconds()):(i=e.getFullYear(),r=e.getMonth(),a=e.getDay(),s=e.getDate(),n=e.getHours(),h=e.getMinutes(),c=e.getSeconds(),f=e.getMilliseconds());for(let o=0,m=t.parts.length;o=12?this._t("PM"):this._t("AM");break;case"aa":l=n>=12?this._t("P.M."):this._t("A.M.");break;case"aaa":l=n>=12?this._t("P"):this._t("A");break;case"h":l=be(n).toString();break;case"hh":l=j(be(n),2,"0");break;case"H":l=n.toString();break;case"HH":l=j(n,2,"0");break;case"K":l=be(n,0).toString();break;case"KK":l=j(be(n,0),2,"0");break;case"k":l=(n+1).toString();break;case"kk":l=j(n+1,2,"0");break;case"m":l=h.toString();break;case"mm":l=j(h,2,"0");break;case"s":l=c.toString();break;case"ss":l=j(c,2,"0");break;case"S":case"SS":case"SSS":l=Math.round(f/1e3*Math.pow(10,t.parts[o].length)).toString();break;case"x":l=b.toString();break;case"n":case"nn":case"nnn":l=j(f,t.parts[o].length,"0");break;case"z":l=de(e,!1,!1,this._root.utc,this._root.timezone?this._root.timezone.name:void 0).replace(/[+-]+[0-9]+$/,"");break;case"zz":l=de(e,!0,!1,this._root.utc,this._root.timezone?this._root.timezone.name:void 0);break;case"zzz":l=de(e,!1,!0,this._root.utc,this._root.timezone?this._root.timezone.name:void 0).replace(/[+-]+[0-9]+$/,"");break;case"zzzz":l=de(e,!0,!0,this._root.utc,this._root.timezone?this._root.timezone.name:void 0);break;case"Z":case"ZZ":let p=this._root.utc?"UTC":this._root.timezone;p instanceof Ut&&(p=p.name);const w=p?Ot(p):e.getTimezoneOffset();let v=Math.abs(w)/60,_=Math.floor(v),P=60*v-60*_;this._root.utc&&(_=0,P=0),t.parts[o]=="Z"?(l="GMT",l+=w>0?"-":"+",l+=j(_,2)+":"+j(P,2)):(l=w>0?"-":"+",l+=j(_,2)+j(P,2));break;case"i":l=e.toISOString();break;case"I":l=e.toUTCString()}u=u.replace(ee,l)}return u}parseFormat(e){let t={template:"",parts:[]},i=U.chunk(e,!0);for(let r=0;r-1&&(n.year=parseInt(u[s.year])),s.year3>-1){let b=parseInt(u[s.year3]);b+=1e3,n.year=b}if(s.year2>-1){let b=parseInt(u[s.year2]);b+=b>50?1e3:2e3,n.year=b}if(s.year1>-1){let b=parseInt(u[s.year1]);b=10*Math.floor(new Date().getFullYear()/10)+b,n.year=b}if(s.monthLong>-1&&(n.month=this.resolveMonth(u[s.monthLong])),s.monthShort>-1&&(n.month=this.resolveShortMonth(u[s.monthShort])),s.month>-1&&(n.month=parseInt(u[s.month])-1),s.week>-1&&s.day===-1&&(n.month=0,n.day=Mt(parseInt(u[s.week]),n.year,1,this._root.utc)),s.day>-1&&(n.day=parseInt(u[s.day])),s.yearDay>-1&&(n.month=0,n.day=parseInt(u[s.yearDay])),s.hourBase0>-1&&(n.hour=parseInt(u[s.hourBase0])),s.hourBase1>-1&&(n.hour=parseInt(u[s.hourBase1])-1),s.hour12Base0>-1){let b=parseInt(u[s.hour12Base0]);b==11&&(b=0),s.am>-1&&!this.isAm(u[s.am])&&(b+=12),n.hour=b}if(s.hour12Base1>-1){let b=parseInt(u[s.hour12Base1]);b==12&&(b=0),s.am>-1&&!this.isAm(u[s.am])&&(b+=12),n.hour=b}if(s.minute>-1&&(n.minute=parseInt(u[s.minute])),s.second>-1&&(n.second=parseInt(u[s.second])),s.millisecond>-1){let b=parseInt(u[s.millisecond]);s.millisecondDigits==2?b*=10:s.millisecondDigits==1&&(b*=100),n.millisecond=b}if(s.timestamp>-1){n.timestamp=parseInt(u[s.timestamp]);const b=new Date(n.timestamp);n.year=b.getUTCFullYear(),n.month=b.getUTCMonth(),n.day=b.getUTCDate(),n.hour=b.getUTCHours(),n.minute=b.getUTCMinutes(),n.second=b.getUTCSeconds(),n.millisecond=b.getUTCMilliseconds()}s.zone>-1&&(n.offset=this.resolveTimezoneOffset(new Date(n.year,n.month,n.day),u[s.zone])),s.iso>-1&&(n.year=V(u[s.iso+0]),n.month=V(u[s.iso+1])-1,n.day=V(u[s.iso+2]),n.hour=V(u[s.iso+3]),n.minute=V(u[s.iso+4]),n.second=V(u[s.iso+5]),n.millisecond=V(u[s.iso+6]),u[s.iso+7]=="Z"||u[s.iso+7]=="z"?n.utc=!0:u[s.iso+7]!=""&&(n.offset=this.resolveTimezoneOffset(new Date(n.year,n.month,n.day),u[s.iso+7]))),i=n.utc?new Date(Date.UTC(n.year,n.month,n.day,n.hour,n.minute,n.second,n.millisecond)):new Date(n.year,n.month,n.day,n.hour,n.minute+n.offset,n.second,n.millisecond)}else i=new Date(e);return i}resolveTimezoneOffset(e,t){if(t.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/)){let i=t.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/),r=i[1],a=i[2],s=i[3],n=60*parseInt(a)+parseInt(s);return r=="+"&&(n*=-1),n-(e||new Date).getTimezoneOffset()}return 0}resolveMonth(e){let t=this._months().indexOf(e);return t>-1||!this._root.language.isDefault()&&(t=this._root.language.translateAll(this._months()).indexOf(e),t>-1)?t:0}resolveShortMonth(e){let t=this._shortMonths().indexOf(e);return t>-1?t:(t=this._months().indexOf(e),t>-1||this._root.language&&!this._root.language.isDefault()&&(t=this._root.language.translateAll(this._shortMonths()).indexOf(e),t>-1)?t:0)}isAm(e){return this.getStringList(["AM","A.M.","A"]).indexOf(e.toUpperCase())>-1}getStringList(e){let t=[];for(let i=0;ithis.get("negativeBase")?s.positive:n{if(n.parsed)return;let h=n.source,c=[];c=n.source.match(/^\[([^\]]*)\]/),c&&c.length&&c[0]!==""&&(h=n.source.substr(c[0].length),n.color=c[1]);let f=U.chunk(h,!0);for(let u=0;u{if(a==t||i){if(r/s<=1)return i||(i=a),!1;i=a}return!0}),i}getMilliseconds(e,t){return t||(t=this.get("baseUnit")),e*this._getUnitValue(t)}_getUnitValue(e){return this._getUnitValues()[e]}_getUnitValues(){return{millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2592e6,year:31536e6}}}const st={firstDayOfWeek:1,_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date:"yyyy-MM-dd",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"AD",_era_bc:"BC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"",February:"",March:"",April:"",May:"",June:"",July:"",August:"",September:"",October:"",November:"",December:"",Jan:"",Feb:"",Mar:"",Apr:"","May(short)":"May",Jun:"",Jul:"",Aug:"",Sep:"",Oct:"",Nov:"",Dec:"",Sunday:"",Monday:"",Tuesday:"",Wednesday:"",Thursday:"",Friday:"",Saturday:"",Sun:"",Mon:"",Tue:"",Wed:"",Thu:"",Fri:"",Sat:"",_dateOrd:function(d){let e="th";if(d<11||d>13)switch(d%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"",Play:"",Stop:"",Legend:"","Press ENTER to toggle":"",Loading:"",Home:"",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Force directed tree":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"",Image:"",Data:"",Print:"","Press ENTER or use arrow keys to navigate":"","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"","From %1":"","To %1":"","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":"",Close:"",Minimize:""};class Gt extends te{_setDefaults(){this.setPrivate("defaultLocale",st),super._setDefaults()}translate(e,t,...i){t||(t=this._root.locale||this.getPrivate("defaultLocale"));let r=e,a=t[e];if(a===null)r="";else if(a!=null)a&&(r=a);else if(t!==this.getPrivate("defaultLocale"))return this.translate(e,this.getPrivate("defaultLocale"),...i);if(i.length)for(let s=i.length,n=0;n{this.setTranslationAny(i,r,t)})}translateEmpty(e,t,...i){let r=this.translate(e,t,...i);return r==e?"":r}translateFunc(e,t){return this._root.locale[e]?this._root.locale[e]:t!==this.getPrivate("defaultLocale")?this.translateFunc(e,this.getPrivate("defaultLocale")):()=>""}translateAll(e,t){return this.isDefault()?e:Tt(e,i=>this.translate(i,t))}isDefault(){return this.getPrivate("defaultLocale")===this._root.locale}}class ke{constructor(e=1,t=0,i=0,r=1,a=0,s=0){Object.defineProperty(this,"a",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"b",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"c",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"d",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ty",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.a=e,this.b=t,this.c=i,this.d=r,this.tx=a,this.ty=s}setTransform(e,t,i,r,a,s=1){this.a=Math.cos(a)*s,this.b=Math.sin(a)*s,this.c=-Math.sin(a)*s,this.d=Math.cos(a)*s,this.tx=e-(i*this.a+r*this.c),this.ty=t-(i*this.b+r*this.d)}apply(e){return{x:this.a*e.x+this.c*e.y+this.tx,y:this.b*e.x+this.d*e.y+this.ty}}applyInverse(e){const t=1/(this.a*this.d+this.c*-this.b);return{x:this.d*t*e.x+-this.c*t*e.y+(this.ty*this.c-this.tx*this.d)*t,y:this.a*t*e.y+-this.b*t*e.x+(-this.ty*this.a+this.tx*this.b)*t}}append(e){const t=this.a,i=this.b,r=this.c,a=this.d;this.a=e.a*t+e.b*r,this.b=e.a*i+e.b*a,this.c=e.c*t+e.d*r,this.d=e.c*i+e.d*a,this.tx=e.tx*t+e.ty*r+this.tx,this.ty=e.tx*i+e.ty*a+this.ty}prepend(e){const t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const i=this.a,r=this.c;this.a=i*e.a+this.b*e.c,this.b=i*e.b+this.b*e.d,this.c=r*e.a+this.d*e.c,this.d=r*e.b+this.d*e.d}this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty}copyFrom(e){this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty}}var Nt=function(){function d(e,t){var i=[],r=!0,a=!1,s=void 0;try{for(var n,h=e[Symbol.iterator]();!(r=(n=h.next()).done)&&(i.push(n.value),!t||i.length!==t);r=!0);}catch(c){a=!0,s=c}finally{try{!r&&h.return&&h.return()}finally{if(a)throw s}}return i}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return d(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),he=2*Math.PI,Ee=function(d,e,t,i,r,a,s){var n=d.x,h=d.y;return{x:i*(n*=e)-r*(h*=t)+a,y:r*n+i*h+s}},qt=function(d,e){var t=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(e/4),i=Math.cos(d),r=Math.sin(d),a=Math.cos(d+e),s=Math.sin(d+e);return[{x:i-r*t,y:r+i*t},{x:a+s*t,y:s-a*t},{x:a,y:s}]},$e=function(d,e,t,i){var r=d*t+e*i;return r>1&&(r=1),r<-1&&(r=-1),(d*i-e*t<0?-1:1)*Math.acos(r)},Zt=function(d,e,t,i,r,a,s,n,h,c,f,u){var b=Math.pow(r,2),o=Math.pow(a,2),m=Math.pow(f,2),l=Math.pow(u,2),g=b*o-b*l-o*m;g<0&&(g=0),g/=b*l+o*m;var p=(g=Math.sqrt(g)*(s===n?-1:1))*r/a*u,w=g*-a/r*f,v=c*p-h*w+(d+t)/2,_=h*p+c*w+(e+i)/2,P=(f-p)/r,L=(u-w)/a,E=(-f-p)/r,S=(-u-w)/a,B=$e(1,0,P,L),O=$e(P,L,E,S);return n===0&&O>0&&(O-=he),n===1&&O<0&&(O+=he),[v,_,B,O]},Kt=function(d){var e=d.px,t=d.py,i=d.cx,r=d.cy,a=d.rx,s=d.ry,n=d.xAxisRotation,h=n===void 0?0:n,c=d.largeArcFlag,f=c===void 0?0:c,u=d.sweepFlag,b=u===void 0?0:u,o=[];if(a===0||s===0)return[];var m=Math.sin(h*he/360),l=Math.cos(h*he/360),g=l*(e-i)/2+m*(t-r)/2,p=-m*(e-i)/2+l*(t-r)/2;if(g===0&&p===0)return[];a=Math.abs(a),s=Math.abs(s);var w=Math.pow(g,2)/Math.pow(a,2)+Math.pow(p,2)/Math.pow(s,2);w>1&&(a*=Math.sqrt(w),s*=Math.sqrt(w));var v=Zt(e,t,i,r,a,s,f,b,m,l,g,p),_=Nt(v,4),P=_[0],L=_[1],E=_[2],S=_[3],B=Math.abs(S)/(he/4);Math.abs(1-B)<1e-7&&(B=1);var O=Math.max(Math.ceil(B),1);S/=O;for(var I=0;I1){const r=/^([01])([01])(.*)$/.exec(i);r!==null&&(d.splice(t,0,r[1]),++t,d.splice(t,0,r[2]),++t,r[3].length>0?d[t]=r[3]:d.splice(t,1))}if(++t,i=d[t],i.length>1){const r=/^([01])(.+)$/.exec(i);r!==null&&(d.splice(t,0,r[1]),++t,d[t]=r[2])}}}function Xe(d){if(d===0||d===1)return d;throw new Error("Flag must be 0 or 1")}function ei(d){const e=[0,0,0];for(let t=0;t<24;t++)e[t%3]<<=1,e[t%3]|=1&d,d>>=1;return(0|e[0])+(e[1]<<8)+(e[2]<<16)}function fe(d,e){for(;(!d.interactive||e(d))&&d._parent;)d=d._parent}function ti(d,e,t){return C(d,je(e),i=>{const r=et(i);let a=i.touches;a?(a.length==0&&(a=i.changedTouches),t(Bt(a),r)):t([i],r)})}function Ge(d){const e=document.createElement("canvas");e.width=1,e.height=1;const t=e.getContext("2d",{willReadFrequently:!0});t.drawImage(d,0,0,1,1);try{return t.getImageData(0,0,1,1),!1}catch{return console.warn('Image "'+d.src+'" is loaded from different host and is not covered by CORS policy. For more information about the implications read here: https://www.amcharts.com/docs/v5/concepts/cors'),!0}}function oe(d){d.width=0,d.height=0,d.style.width="0px",d.style.height="0px"}function Ne(d){return Math.floor(d)+.5}class ii{constructor(){Object.defineProperty(this,"_x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_y",{enumerable:!0,configurable:!0,writable:!0,value:0})}get x(){return this._x}get y(){return this._y}set x(e){this._x=e}set y(e){this._y=e}}class we extends It{constructor(e){super(),Object.defineProperty(this,"_layer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"mask",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"exportable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"interactive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"inactive",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"wheelable",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"cancelTouch",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isMeasured",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"buttonMode",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"alpha",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"compoundAlpha",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"angle",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"scale",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"crisp",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"pivot",{enumerable:!0,configurable:!0,writable:!0,value:new ii}),Object.defineProperty(this,"filter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cursorOverStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_replacedCursorStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_localMatrix",{enumerable:!0,configurable:!0,writable:!0,value:new ke}),Object.defineProperty(this,"_matrix",{enumerable:!0,configurable:!0,writable:!0,value:new ke}),Object.defineProperty(this,"_uMatrix",{enumerable:!0,configurable:!0,writable:!0,value:new ke}),Object.defineProperty(this,"_renderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_localBounds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_bounds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_colorId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._renderer=e}subStatus(e){return{inactive:this.inactive==null?e.inactive:this.inactive,layer:this._layer||e.layer}}_dispose(){this._renderer._removeObject(this),this.getLayer().dirty=!0}getCanvas(){return this.getLayer().view}getLayer(){let e=this;for(;;){if(e._layer)return e._layer;if(!e._parent)return this._renderer.defaultLayer;e=e._parent}}setLayer(e,t){e==null?this._layer=void 0:(this._layer=this._renderer.getLayer(e,!0),this._layer.visible=!0,this._layer.margin=t,t&&J(this._layer.view,!1),this._renderer._ghostLayer.setMargin(this._renderer.layers),this._parent&&this._parent.registerChildLayer(this._layer),this._layer.dirty=!0,this._renderer.resizeLayer(this._layer),this._renderer.resizeGhost())}markDirtyLayer(){this.getLayer().dirty=!0}clear(){this.invalidateBounds()}invalidateBounds(){this._localBounds=void 0}_addBounds(e){}_getColorId(){return this._colorId===void 0&&(this._colorId=this._renderer.paintId(this)),this._colorId}_isInteractive(e){return!e.inactive&&(this.interactive||this._renderer._forceInteractive>0)}_isInteractiveMask(e){return this._isInteractive(e)}contains(e){for(;;){if(e===this)return!0;if(!e._parent)return!1;e=e._parent}}toGlobal(e){return this._matrix.apply(e)}toLocal(e){return this._matrix.applyInverse(e)}getLocalMatrix(){return this._uMatrix.setTransform(0,0,this.pivot.x,this.pivot.y,this.angle*Math.PI/180,this.scale),this._uMatrix}getLocalBounds(){return this._localBounds||(this._localBounds={left:1e7,top:1e7,right:-1e7,bottom:-1e7},this._addBounds(this._localBounds)),this._localBounds}getAdjustedBounds(e){this._setMatrix();const t=this.getLocalMatrix(),i=t.apply({x:e.left,y:e.top}),r=t.apply({x:e.right,y:e.top}),a=t.apply({x:e.right,y:e.bottom}),s=t.apply({x:e.left,y:e.bottom});return{left:Math.min(i.x,r.x,a.x,s.x),top:Math.min(i.y,r.y,a.y,s.y),right:Math.max(i.x,r.x,a.x,s.x),bottom:Math.max(i.y,r.y,a.y,s.y)}}on(e,t,i){return this.interactive?this._renderer._addEvent(this,e,t,i):new X(()=>{})}_setMatrix(){this._localMatrix.setTransform(this.x,this.y,this.pivot.x,this.pivot.y,this.angle*Math.PI/180,this.scale),this._matrix.copyFrom(this._localMatrix),this._parent&&this._matrix.prepend(this._parent._matrix)}_transform(e,t){const i=this._matrix;let r=i.tx*t,a=i.ty*t;this.crisp&&(r=Ne(r),a=Ne(a)),e.setTransform(i.a*t,i.b*t,i.c*t,i.d*t,r,a)}_transformMargin(e,t,i){const r=this._matrix;e.setTransform(r.a*t,r.b*t,r.c*t,r.d*t,(r.tx+i.left)*t,(r.ty+i.top)*t)}_transformLayer(e,t,i){i.margin?this._transformMargin(e,i.scale||t,i.margin):this._transform(e,i.scale||t)}render(e){if(this.visible&&(this.exportable!==!1||!this._renderer._omitTainted)){this._setMatrix();const t=this.subStatus(e),i=this._renderer.resolution,r=this._renderer.layers,a=this._renderer._ghostLayer,s=a.context,n=this.mask;n&&n._setMatrix(),y(r,h=>{if(h){const c=h.context;c.save(),n&&(n._transformLayer(c,i,h),n._runPath(c),c.clip()),c.globalAlpha=this.compoundAlpha*this.alpha,this._transformLayer(c,i,h),this.filter&&(c.filter=this.filter)}}),s.save(),n&&this._isInteractiveMask(t)&&(n._transformMargin(s,i,a.margin),n._runPath(s),s.clip()),this._transformMargin(s,i,a.margin),this._render(t),s.restore(),y(r,h=>{h&&h.context.restore()})}}_render(e){this.exportable===!1&&(e.layer.tainted=!0)}hovering(){return this._renderer._hovering.has(this)}dragging(){return this._renderer._dragging.some(e=>e.value===this)}shouldCancelTouch(){const e=this._renderer;return!(e.tapToActivate&&!e._touchActive)&&(!!this.cancelTouch||!!this._parent&&this._parent.shouldCancelTouch())}}class ri extends we{constructor(){super(...arguments),Object.defineProperty(this,"interactiveChildren",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_childLayers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_children",{enumerable:!0,configurable:!0,writable:!0,value:[]})}_isInteractiveMask(e){return this.interactiveChildren||super._isInteractiveMask(e)}addChild(e){e._parent=this,this._children.push(e),e._layer&&this.registerChildLayer(e._layer)}addChildAt(e,t){e._parent=this,this._children.splice(t,0,e),e._layer&&this.registerChildLayer(e._layer)}removeChild(e){e._parent=void 0,De(this._children,e)}_render(e){super._render(e);const t=this._renderer;this.interactive&&this.interactiveChildren&&++t._forceInteractive,y(this._children,i=>{i.compoundAlpha=this.compoundAlpha*this.alpha,i.render(e)}),this.interactive&&this.interactiveChildren&&--t._forceInteractive}registerChildLayer(e){this._childLayers||(this._childLayers=[]),Te(this._childLayers,e),this._parent&&this._parent.registerChildLayer(e)}markDirtyLayer(e=!1){super.markDirtyLayer(),e&&this._childLayers&&y(this._childLayers,t=>t.dirty=!0)}_dispose(){super._dispose(),this._childLayers&&y(this._childLayers,e=>{e.dirty=!0})}}function M(d,e){d.left=Math.min(d.left,e.x),d.top=Math.min(d.top,e.y),d.right=Math.max(d.right,e.x),d.bottom=Math.max(d.bottom,e.y)}class T{colorize(e,t){}path(e){}addBounds(e){}}class si extends T{colorize(e,t){e.beginPath()}}class Me extends T{constructor(e){super(),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.fillStyle=t!==void 0?t:this.color}}class ai extends T{constructor(e){super(),Object.defineProperty(this,"clearShadow",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.fill(),this.clearShadow&&(e.shadowColor="",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}}class ni extends T{colorize(e,t){e.stroke()}}class Se extends T{constructor(e,t,i){super(),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"lineJoin",{enumerable:!0,configurable:!0,writable:!0,value:i})}colorize(e,t){e.strokeStyle=t!==void 0?t:this.color,e.lineWidth=this.width,this.lineJoin&&(e.lineJoin=this.lineJoin)}}class oi extends T{constructor(e){super(),Object.defineProperty(this,"dash",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.setLineDash(this.dash)}}class li extends T{constructor(e){super(),Object.defineProperty(this,"dashOffset",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.lineDashOffset=this.dashOffset}}class hi extends T{constructor(e,t,i,r){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.rect(this.x,this.y,this.width,this.height)}addBounds(e){const t=this.x,i=this.y,r=t+this.width,a=i+this.height;M(e,{x:t,y:i}),M(e,{x:r,y:i}),M(e,{x:t,y:a}),M(e,{x:r,y:a})}}class ui extends T{constructor(e,t,i){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:i})}path(e){e.moveTo(this.x+this.radius,this.y),e.arc(this.x,this.y,this.radius,0,2*Math.PI)}addBounds(e){M(e,{x:this.x-this.radius,y:this.y-this.radius}),M(e,{x:this.x+this.radius,y:this.y+this.radius})}}class ci extends T{constructor(e,t,i,r){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radiusX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"radiusY",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.ellipse(0,0,this.radiusX,this.radiusY,0,0,2*Math.PI)}addBounds(e){M(e,{x:this.x-this.radiusX,y:this.y-this.radiusY}),M(e,{x:this.x+this.radiusX,y:this.y+this.radiusY})}}class di extends T{constructor(e,t,i,r,a,s){super(),Object.defineProperty(this,"cx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cy",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"startAngle",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"endAngle",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"anticlockwise",{enumerable:!0,configurable:!0,writable:!0,value:s})}path(e){this.radius>0&&e.arc(this.cx,this.cy,this.radius,this.startAngle,this.endAngle,this.anticlockwise)}addBounds(e){let t=Rt(this.cx,this.cy,this.startAngle*le,this.endAngle*le,this.radius);M(e,{x:t.left,y:t.top}),M(e,{x:t.right,y:t.bottom})}}class bi extends T{constructor(e,t,i,r,a){super(),Object.defineProperty(this,"x1",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y1",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"x2",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"y2",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:a})}path(e){this.radius>0&&e.arcTo(this.x1,this.y1,this.x2,this.y2,this.radius)}addBounds(e){}}class _i extends T{constructor(e,t){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t})}path(e){e.lineTo(this.x,this.y)}addBounds(e){M(e,{x:this.x,y:this.y})}}class fi extends T{constructor(e,t){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t})}path(e){e.moveTo(this.x,this.y)}addBounds(e){M(e,{x:this.x,y:this.y})}}class gi extends T{path(e){e.closePath()}}class mi extends T{constructor(e,t,i,r,a,s){super(),Object.defineProperty(this,"cpX",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cpY",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"cpX2",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"cpY2",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"toX",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"toY",{enumerable:!0,configurable:!0,writable:!0,value:s})}path(e){e.bezierCurveTo(this.cpX,this.cpY,this.cpX2,this.cpY2,this.toX,this.toY)}addBounds(e){M(e,{x:this.cpX,y:this.cpY}),M(e,{x:this.cpX2,y:this.cpY2}),M(e,{x:this.toX,y:this.toY})}}class pi extends T{constructor(e,t,i,r){super(),Object.defineProperty(this,"cpX",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cpY",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"toX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"toY",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.quadraticCurveTo(this.cpX,this.cpY,this.toX,this.toY)}addBounds(e){M(e,{x:this.cpX,y:this.cpY}),M(e,{x:this.toX,y:this.toY})}}class yi extends T{constructor(e,t,i,r,a){super(),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"blur",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"offsetX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"offsetY",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"opacity",{enumerable:!0,configurable:!0,writable:!0,value:a})}colorize(e,t){this.opacity&&(e.fillStyle=this.color),e.shadowColor=this.color,e.shadowBlur=this.blur,e.shadowOffsetX=this.offsetX,e.shadowOffsetY=this.offsetY}}class vi extends T{constructor(e,t,i,r,a){super(),Object.defineProperty(this,"image",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:a})}path(e){e.drawImage(this.image,this.x,this.y,this.width,this.height)}addBounds(e){M(e,{x:this.x,y:this.y}),M(e,{x:this.width,y:this.height})}}class wi extends we{constructor(){super(...arguments),Object.defineProperty(this,"_operations",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"blendMode",{enumerable:!0,configurable:!0,writable:!0,value:At.NORMAL}),Object.defineProperty(this,"_hasShadows",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_fillAlpha",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeAlpha",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}clear(){super.clear(),this._operations.length=0}_pushOp(e){this._operations.push(e)}beginFill(e,t=1){this._fillAlpha=t,e?e instanceof G?this._pushOp(new Me(e.toCSS(t))):(this.isMeasured=!0,this._pushOp(new Me(e))):this._pushOp(new Me("rgba(0, 0, 0, "+t+")"))}endFill(){this._pushOp(new ai(this._hasShadows))}endStroke(){this._pushOp(new ni)}beginPath(){this._pushOp(new si)}lineStyle(e=0,t,i=1,r){this._strokeAlpha=i,t?t instanceof G?this._pushOp(new Se(e,t.toCSS(i),r)):this._pushOp(new Se(e,t,r)):this._pushOp(new Se(e,"rgba(0, 0, 0, "+i+")",r))}setLineDash(e){this._pushOp(new oi(e||[]))}setLineDashOffset(e=0){this._pushOp(new li(e))}drawRect(e,t,i,r){this._pushOp(new hi(e,t,i,r))}drawCircle(e,t,i){this._pushOp(new ui(e,t,i))}drawEllipse(e,t,i,r){this._pushOp(new ci(e,t,i,r))}arc(e,t,i,r,a,s=!1){this._pushOp(new di(e,t,i,r,a,s))}arcTo(e,t,i,r,a){this._pushOp(new bi(e,t,i,r,a))}lineTo(e,t){this._pushOp(new _i(e,t))}moveTo(e,t){this._pushOp(new fi(e,t))}bezierCurveTo(e,t,i,r,a,s){this._pushOp(new mi(e,t,i,r,a,s))}quadraticCurveTo(e,t,i,r){this._pushOp(new pi(e,t,i,r))}closePath(){this._pushOp(new gi)}shadow(e,t=0,i=0,r=0,a){this._hasShadows=!0,this._pushOp(new yi(a?e.toCSS(a):e.toCSS(this._fillAlpha||this._strokeAlpha),t,i,r))}image(e,t,i,r,a){this._pushOp(new vi(e,t,i,r,a))}svgPath(e){let t=0,i=0,r=null,a=null,s=null,n=null;const h=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,c=/[\u0009\u0020\u000A\u000C\u000D]*([\+\-]?[0-9]*\.?[0-9]+(?:[eE][\+\-]?[0-9]+)?)[\u0009\u0020\u000A\u000C\u000D]*,?/g;let f;for(;(f=h.exec(e))!==null;){const u=f[1],b=f[2],o=[];for(;(f=c.exec(b))!==null;)o.push(f[1]);switch(u!=="S"&&u!=="s"&&u!=="C"&&u!=="c"&&(r=null,a=null),u!=="Q"&&u!=="q"&&u!=="T"&&u!=="t"&&(s=null,n=null),u){case"M":z(u,o.length,2),t=+o[0],i=+o[1],this.moveTo(t,i);for(let l=2;l{this.bezierCurveTo(v.x1,v.y1,v.x2,v.y2,v.x,v.y),t=v.x,i=v.y})}break;case"Z":case"z":Jt(u,o.length,0),this.closePath()}}}_runPath(e){e.beginPath(),y(this._operations,t=>{t.path(e)})}_render(e){super._render(e);const t=e.layer.dirty,i=this._isInteractive(e);if(t||i){const r=e.layer.context,a=this._renderer._ghostLayer.context;let s;t&&(r.globalCompositeOperation=this.blendMode,r.beginPath()),i&&(a.beginPath(),s=this._getColorId()),y(this._operations,n=>{t&&(n.path(r),n.colorize(r,void 0)),i&&(n.path(a),n.colorize(a,s))})}}renderDetached(e){if(this.visible){this._setMatrix(),e.save();const t=this.mask;t&&(t._setMatrix(),t._transform(e,1),t._runPath(e),e.clip()),e.globalAlpha=this.compoundAlpha*this.alpha,this._transform(e,1),this.filter&&(e.filter=this.filter),e.globalCompositeOperation=this.blendMode,e.beginPath(),y(this._operations,i=>{i.path(e),i.colorize(e,void 0)}),e.restore()}}_addBounds(e){this.visible&&this.isMeasured&&y(this._operations,t=>{t.addBounds(e)})}}class at extends we{constructor(e,t,i){super(e),Object.defineProperty(this,"text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolution",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"textVisible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_textInfo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_originalScale",{enumerable:!0,configurable:!0,writable:!0,value:1}),this.text=t,this.style=i}invalidateBounds(){super.invalidateBounds(),this._textInfo=void 0}_shared(e){this.style.textAlign&&(e.textAlign=this.style.textAlign),this.style.direction&&(e.direction=this.style.direction),this.style.textBaseline&&(e.textBaseline=this.style.textBaseline)}_prerender(e,t=!1,i=!1){super._render(e);const r=e.layer.context,a=this._renderer._ghostLayer.context,s=this.style;let n=this._getFontStyle(void 0,i);r.font=n,this._isInteractive(e)&&!t&&(a.font=n),s.fill&&(s.fill instanceof G?r.fillStyle=s.fill.toCSS(s.fillOpacity!=null?s.fillOpacity:1):r.fillStyle=s.fill),s.shadowColor&&(e.layer.context.shadowColor=s.shadowColor.toCSS(s.shadowOpacity||1)),s.shadowBlur&&(e.layer.context.shadowBlur=s.shadowBlur),s.shadowOffsetX&&(e.layer.context.shadowOffsetX=s.shadowOffsetX),s.shadowOffsetY&&(e.layer.context.shadowOffsetY=s.shadowOffsetY),this._shared(r),this._isInteractive(e)&&!t&&(a.fillStyle=this._getColorId(),this._shared(a))}_getFontStyle(e,t=!1){const i=this.style;let r=[];return e&&e.fontVariant?r.push(e.fontVariant):i.fontVariant&&r.push(i.fontVariant),t||(e&&e.fontWeight?r.push(e.fontWeight):i.fontWeight&&r.push(i.fontWeight)),e&&e.fontStyle?r.push(e.fontStyle):i.fontStyle&&r.push(i.fontStyle),e&&e.fontSize?(H(e.fontSize)&&(e.fontSize=e.fontSize+"px"),r.push(e.fontSize)):i.fontSize&&(H(i.fontSize)&&(i.fontSize=i.fontSize+"px"),r.push(i.fontSize)),e&&e.fontFamily?r.push(e.fontFamily):i.fontFamily?r.push(i.fontFamily):r.length&&r.push("Arial"),r.join(" ")}_render(e){if(this._textInfo||this._measure(e),this.textVisible){const t=this._isInteractive(e),i=e.layer.context,r=e.layer.dirty,a=this._renderer._ghostLayer.context;i.save(),a.save(),this._prerender(e),y(this._textInfo,(s,n)=>{y(s.textChunks,(h,c)=>{if(h.style&&(i.save(),a.save(),i.font=h.style,this._isInteractive(e)&&(a.font=h.style)),h.fill&&(i.save(),i.fillStyle=h.fill.toCSS()),r&&i.fillText(h.text,h.offsetX,s.offsetY+h.offsetY),h.textDecoration=="underline"||h.textDecoration=="line-through"){let f,u=1,b=1,o=h.height,m=h.offsetX;switch(this.style.textAlign){case"right":case"end":m-=h.width;break;case"center":m-=h.width/2}if(h.style)switch(U.getTextStyle(h.style).fontWeight){case"bolder":case"bold":case"700":case"800":case"900":u=2}o&&(b=o/20),f=h.textDecoration=="line-through"?u+s.offsetY+h.offsetY-h.height/2:u+1.5*b+s.offsetY+h.offsetY,i.save(),i.beginPath(),h.fill?i.strokeStyle=h.fill.toCSS():this.style.fill&&this.style.fill instanceof G&&(i.strokeStyle=this.style.fill.toCSS()),i.lineWidth=u*b,i.moveTo(m,f),i.lineTo(m+h.width,f),i.stroke(),i.restore()}t&&this.interactive&&a.fillText(h.text,h.offsetX,s.offsetY+h.offsetY),h.fill&&i.restore(),h.style&&(i.restore(),a.restore())})}),i.restore(),a.restore()}}_addBounds(e){if(this.visible&&this.isMeasured){const t=this._measure({inactive:this.inactive,layer:this.getLayer()});M(e,{x:t.left,y:t.top}),M(e,{x:t.right,y:t.bottom})}}_ignoreFontWeight(){return/apple/i.test(navigator.vendor)}_measure(e){const t=e.layer.context,i=this._renderer._ghostLayer.context,r=this.style.direction=="rtl";this._textInfo=[];const a=this.style.oversizedBehavior,s=this.style.maxWidth,n=H(s)&&a=="truncate",h=H(s)&&(a=="wrap"||a=="wrap-no-break");t.save(),i.save(),this._prerender(e,!0,this._ignoreFontWeight());const c="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",f=this.text.toString().replace(/\r/g,"").split(/\n/);let u,b=!0,o=0,m=0,l=0;y(f,(p,w)=>{let v;for(v=p==""?[{type:"value",text:""}]:U.chunk(p,!1,this.style.ignoreFormatting);v.length>0;){let _={offsetY:l,ascent:0,width:0,height:0,left:0,right:0,textChunks:[]};const P=this._measureText(c,t),L=P.actualBoundingBoxAscent+P.actualBoundingBoxDescent;let E;_.height=L,_.ascent=P.actualBoundingBoxAscent;let S,B,O,I=this.style.textDecoration,A=!1,Y=!0,N=[];tt(v,(D,ce)=>{if(D.type=="format")if(D.text=="[/]")b||(t.restore(),i.restore(),b=!0),S=void 0,u=void 0,B=void 0,I=this.style.textDecoration,O=void 0,E=D.text;else{b||(t.restore(),i.restore());let k=U.getTextStyle(D.text);const R=this._getFontStyle(k);t.save(),i.save(),t.font=R,u=R,E=D.text,k.textDecoration&&(I=k.textDecoration),k.fill&&(S=k.fill),k.width&&(B=V(k.width)),k.verticalAlign&&(O=k.verticalAlign),b=!1;const F=this._measureText(c,t),q=F.actualBoundingBoxAscent+F.actualBoundingBoxDescent;q>_.height&&(_.height=q),F.actualBoundingBoxAscent>_.ascent&&(_.ascent=F.actualBoundingBoxAscent)}else if(D.type=="value"&&!A){const k=this._measureText(D.text,t);let R=k.actualBoundingBoxLeft+k.actualBoundingBoxRight;if(n){let W=Y||this.style.breakWords||!1;const $=this.style.ellipsis||"",Le=this._measureText($,t),nt=Le.actualBoundingBoxLeft+Le.actualBoundingBoxRight;if(_.width+R>s){const ot=s-_.width-nt;D.text=this._truncateText(t,D.text,ot,W),D.text+=$,A=!0}}else if(h&&_.width+R>s){const W=s-_.width,$=this._truncateText(t,D.text,W,!1,Y&&this.style.oversizedBehavior!="wrap-no-break");if($=="")return this.textVisible=!0,!1;N=v.slice(ce+1),Pe($)!=Pe(D.text)&&(N.unshift({type:"value",text:D.text.substr($.length)}),E&&N.unshift({type:"format",text:E})),D.text=Pe($),v=[],A=!0}let F=1,q=1;if(u&&B&&B>R){const W=R/B;switch(this.style.textAlign){case"right":case"end":F=W;break;case"center":F=W,q=W;break;default:q=W}R=B}const xe=k.actualBoundingBoxAscent+k.actualBoundingBoxDescent;xe>_.height&&(_.height=xe),k.actualBoundingBoxAscent>_.ascent&&(_.ascent=k.actualBoundingBoxAscent),_.width+=R,_.left+=k.actualBoundingBoxLeft/F,_.right+=k.actualBoundingBoxRight/q,_.textChunks.push({style:u,fill:S,text:D.text,width:R,height:xe,left:k.actualBoundingBoxLeft,right:k.actualBoundingBoxRight,ascent:k.actualBoundingBoxAscent,offsetX:0,offsetY:0,textDecoration:I,verticalAlign:O}),Y=!1}return!0}),this.style.lineHeight instanceof it?(_.height*=this.style.lineHeight.value,_.ascent*=this.style.lineHeight.value):(_.height*=this.style.lineHeight||1.2,_.ascent*=this.style.lineHeight||1.2),o<_.left&&(o=_.left),m<_.right&&(m=_.right),this._textInfo.push(_),l+=_.height,v=N||[]}}),b||(t.restore(),i.restore()),y(this._textInfo,(p,w)=>{let v=0;y(p.textChunks,_=>{if(_.offsetX=v+_.left-p.left,_.offsetY+=p.height-p.height*(this.style.baselineRatio||.19),v+=_.width,_.verticalAlign)switch(_.verticalAlign){case"super":_.offsetY-=p.height/2-_.height/2;break;case"sub":_.offsetY+=_.height/2}})});const g={left:r?-m:-o,top:0,right:r?o:m,bottom:l};if(a!=="none"){const p=this._fitRatio(g);if(p<1)if(a=="fit")H(this.style.minScale)&&pi&&t!="");return t}_measureText(e,t){let i=t.measureText(e),r={};if(i.actualBoundingBoxAscent==null){const s=document.createElement("div");s.innerText=e,s.style.visibility="hidden",s.style.position="absolute",s.style.top="-1000000px;",s.style.fontFamily=this.style.fontFamily||"",s.style.fontSize=this.style.fontSize+"",document.body.appendChild(s);const n=s.getBoundingClientRect();document.body.removeChild(s);const h=n.height,c=i.width;r={actualBoundingBoxAscent:h,actualBoundingBoxDescent:0,actualBoundingBoxLeft:0,actualBoundingBoxRight:c,fontBoundingBoxAscent:h,fontBoundingBoxDescent:0,width:c}}else r={actualBoundingBoxAscent:i.actualBoundingBoxAscent,actualBoundingBoxDescent:i.actualBoundingBoxDescent,actualBoundingBoxLeft:i.actualBoundingBoxLeft,actualBoundingBoxRight:i.actualBoundingBoxRight,fontBoundingBoxAscent:i.actualBoundingBoxAscent,fontBoundingBoxDescent:i.actualBoundingBoxDescent,width:i.width};const a=i.width;switch(this.style.textAlign){case"right":case"end":r.actualBoundingBoxLeft=a,r.actualBoundingBoxRight=0;break;case"center":r.actualBoundingBoxLeft=a/2,r.actualBoundingBoxRight=a/2;break;default:r.actualBoundingBoxLeft=0,r.actualBoundingBoxRight=a}return r}}class xi{constructor(){Object.defineProperty(this,"fill",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fillOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textAlign",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontFamily",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontWeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontVariant",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textDecoration",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowBlur",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lineHeight",{enumerable:!0,configurable:!0,writable:!0,value:Ke(120)}),Object.defineProperty(this,"baselineRatio",{enumerable:!0,configurable:!0,writable:!0,value:.19}),Object.defineProperty(this,"direction",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textBaseline",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"oversizedBehavior",{enumerable:!0,configurable:!0,writable:!0,value:"none"}),Object.defineProperty(this,"breakWords",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"ellipsis",{enumerable:!0,configurable:!0,writable:!0,value:"…"}),Object.defineProperty(this,"maxWidth",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxHeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"minScale",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ignoreFormatting",{enumerable:!0,configurable:!0,writable:!0,value:!1})}}class Pi extends at{constructor(){super(...arguments),Object.defineProperty(this,"textType",{enumerable:!0,configurable:!0,writable:!0,value:"circular"}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"startAngle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inside",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"orientation",{enumerable:!0,configurable:!0,writable:!0,value:"auto"}),Object.defineProperty(this,"kerning",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_textReversed",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_render(e){this.textType==="circular"?this._renderCircular(e):super._render(e)}_renderCircular(e){if(this.textVisible){this._prerender(e);const t=this._isInteractive(e),i=e.layer.context,r=e.layer.dirty,a=this._renderer._ghostLayer.context;i.save(),t&&a.save(),this._textInfo||this._measure(e);let s=this.radius||0,n=this.startAngle||0,h=0,c=this.orientation,f=c=="auto"?"auto":c=="inward";const u=this.inside,b=this.style.textAlign||"left",o=this.kerning||0;let m=b=="left"?1:-1;const l=!this._textReversed;if(f=="auto"){let g=0,p=0;y(this._textInfo,(w,v)=>{const _=n+w.width/(s-w.height)/2*-m;_>g&&(g=_)}),p=b=="left"?(g+h/2)*le:b=="right"?(g-h/2)*le:n*le,p=Lt(p),f=p>=270||p<=90}f==1&&l&&(this._textInfo.reverse(),this._textReversed=!0),y(this._textInfo,(g,p)=>{const w=g.height;u||(s+=w),(m==-1&&f||m==1&&!f)&&l&&g.textChunks.reverse();let v=n;h=0,b=="center"&&(v+=g.width/(s-w)/2*-m,h=v-n),v+=Math.PI*(f?0:1),i.save(),t&&a.save(),i.rotate(v),t&&a.rotate(v);let _=0;y(g.textChunks,(P,L)=>{const E=P.text,S=P.width;_=S/2/(s-w)*m,i.rotate(_),t&&a.rotate(_),P.style&&(i.save(),a.save(),i.font=P.style,t&&(a.font=P.style)),P.fill&&(i.save(),i.fillStyle=P.fill.toCSS()),i.textBaseline="middle",i.textAlign="center",t&&(a.textBaseline="middle",a.textAlign="center"),r&&i.fillText(E,0,(f?1:-1)*(0-s+w/2)),t&&a.fillText(E,0,(f?1:-1)*(0-s+w/2)),P.fill&&i.restore(),P.style&&(i.restore(),a.restore()),_=(S/2+o)/(s-w)*m,i.rotate(_),t&&a.rotate(_)}),i.restore(),t&&a.restore(),u&&(s-=w)}),i.restore(),t&&a.restore()}}_measure(e){return this.textType==="circular"?this._measureCircular(e):super._measure(e)}_measureCircular(e){const t=e.layer.context,i=this._renderer._ghostLayer.context,r=this.style.direction=="rtl",a=this.style.oversizedBehavior,s=this.style.maxWidth,n=H(s)&&a=="truncate",h=this.style.ellipsis||"";let c;this.textVisible=!0,this._textInfo=[],this._textReversed=!1,t.save(),i.save(),this._prerender(e,!0);const f=this.text.toString().replace(/\r/g,"").split(/\n/);let u=!0,b=0,o=0;return y(f,(m,l)=>{let g,p,w,v=U.chunk(m,!1,this.style.ignoreFormatting),_={offsetY:o,ascent:0,width:0,height:0,left:0,right:0,textChunks:[]};y(v,(P,L)=>{if(P.type=="format"){if(P.text=="[/]")u||(t.restore(),i.restore(),u=!0),p=void 0,g=void 0,w=void 0;else{let E=U.getTextStyle(P.text);const S=this._getFontStyle(E);t.save(),i.save(),t.font=S,g=S,E.fill&&(p=E.fill),E.width&&(w=V(E.width)),u=!1}n&&(c=this._measureText(h,t))}else if(P.type=="value"){const E=P.text.match(/./gu)||[];r&&E.reverse();for(let S=0;SI&&(I=w);const A=O.actualBoundingBoxAscent+O.actualBoundingBoxDescent;if(A>_.height&&(_.height=A),O.actualBoundingBoxAscent>_.ascent&&(_.ascent=O.actualBoundingBoxAscent),b+=I,n){c||(c=this._measureText(h,t));const Y=c.actualBoundingBoxLeft+c.actualBoundingBoxRight;if(b+Y>s){_.textChunks.length==1?this.textVisible=!1:(_.width+=Y,_.left+=c.actualBoundingBoxLeft,_.right+=c.actualBoundingBoxRight,_.textChunks.push({style:g,fill:p,text:h,width:Y,height:A+c.actualBoundingBoxDescent,left:c.actualBoundingBoxLeft,right:c.actualBoundingBoxRight,ascent:c.actualBoundingBoxAscent,offsetX:0,offsetY:A,textDecoration:void 0}));break}}if(_.width+=I,_.left+=O.actualBoundingBoxLeft,_.right+=O.actualBoundingBoxRight,_.textChunks.push({style:g,fill:p,text:B,width:I,height:A+O.actualBoundingBoxDescent,left:O.actualBoundingBoxLeft,right:O.actualBoundingBoxRight,ascent:O.actualBoundingBoxAscent,offsetX:0,offsetY:A,textDecoration:void 0}),r)break}}}),this.style.lineHeight instanceof it?_.height*=this.style.lineHeight.value:_.height*=this.style.lineHeight||1.2,this._textInfo.push(_),o+=_.height}),u||(t.restore(),i.restore()),a=="hide"&&b>s&&(this.textVisible=!1),y(this._textInfo,m=>{y(m.textChunks,l=>{l.offsetY+=Math.round((m.height-l.height+(m.ascent-l.ascent))/2)})}),t.restore(),i.restore(),{left:0,top:0,right:0,bottom:0}}}class Oi extends we{constructor(e,t){super(e),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"image",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tainted",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowBlur",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_imageMask",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.image=t}_dispose(){super._dispose(),this._imageMask&&oe(this._imageMask)}getLocalBounds(){if(!this._localBounds){let e=0,t=0;this.width&&(e=this.width),this.height&&(t=this.height),this._localBounds={left:0,top:0,right:e,bottom:t},this._addBounds(this._localBounds)}return this._localBounds}_render(e){if(super._render(e),this.image){if(this.tainted===void 0&&(this.tainted=Ge(this.image),e.layer.tainted=!0),this.tainted&&this._renderer._omitTainted)return;if(e.layer.dirty){this.shadowColor&&(e.layer.context.shadowColor=this.shadowColor.toCSS(this.shadowOpacity||1)),this.shadowBlur&&(e.layer.context.shadowBlur=this.shadowBlur),this.shadowOffsetX&&(e.layer.context.shadowOffsetX=this.shadowOffsetX),this.shadowOffsetY&&(e.layer.context.shadowOffsetY=this.shadowOffsetY);const t=this.width||this.image.naturalWidth,i=this.height||this.image.naturalHeight;e.layer.context.drawImage(this.image,0,0,t,i)}if(this.interactive&&this._isInteractive(e)){const t=this._getMask(this.image);this._renderer._ghostLayer.context.drawImage(t,0,0)}}}clear(){super.clear(),this.image=void 0,this._imageMask=void 0}_getMask(e){if(this._imageMask===void 0){const t=this.width||e.naturalWidth,i=this.height||e.naturalHeight,r=document.createElement("canvas");r.width=t,r.height=i;const a=r.getContext("2d");a.imageSmoothingEnabled=!1,a.fillStyle=this._getColorId(),a.fillRect(0,0,t,i),Ge(e)||(a.globalCompositeOperation="destination-in",a.drawImage(e,0,0,t,i)),this._imageMask=r}return this._imageMask}}class ki{constructor(e,t,i,r){Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"originalPoint",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"point",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"bbox",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"simulated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"native",{enumerable:!0,configurable:!0,writable:!0,value:!0}),me("touchevents")&&e instanceof Touch?this.id=e.identifier:this.id=null}}class Ei extends jt{constructor(e){if(super(),Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("div")}),Object.defineProperty(this,"_layerDom",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("div")}),Object.defineProperty(this,"layers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_dirtyLayers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"defaultLayer",{enumerable:!0,configurable:!0,writable:!0,value:this.getLayer(0)}),Object.defineProperty(this,"_ghostLayer",{enumerable:!0,configurable:!0,writable:!0,value:new Mi}),Object.defineProperty(this,"_patternCanvas",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("canvas")}),Object.defineProperty(this,"_patternContext",{enumerable:!0,configurable:!0,writable:!0,value:this._patternCanvas.getContext("2d")}),Object.defineProperty(this,"_realWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_realHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_calculatedWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_calculatedHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"resolution",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"interactionsEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_listeners",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_events",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_colorId",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_colorMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_forceInteractive",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_omitTainted",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_hovering",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"_dragging",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_mousedown",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_lastPointerMoveEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tapToActivate",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"tapToActivateTimeout",{enumerable:!0,configurable:!0,writable:!0,value:3e3}),Object.defineProperty(this,"_touchActive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_touchActiveTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.resolution=e??window.devicePixelRatio,this.view.style.position="absolute",this.view.setAttribute("aria-hidden","true"),this.view.appendChild(this._layerDom),this._disposers.push(new X(()=>{ue(this._events,(t,i)=>{i.disposer.dispose()}),y(this.layers,t=>{oe(t.view),t.exportableView&&oe(t.exportableView)}),oe(this._ghostLayer.view),oe(this._patternCanvas)})),this._disposers.push(Je(()=>{e==null&&(this.resolution=window.devicePixelRatio)})),me("touchevents")){const t=i=>{this._dragging.length!==0&&tt(this._dragging,r=>!r.value.shouldCancelTouch()||(i.preventDefault(),!1)),this._touchActiveTimeout&&this._delayTouchDeactivate()};this._disposers.push(C(window,"touchstart",t,{passive:!1})),this._disposers.push(C(this.view,"touchstart",t,{passive:!1})),this._disposers.push(C(this.view,"touchmove",()=>{this._touchActiveTimeout&&this._delayTouchDeactivate()},{passive:!0})),this._disposers.push(C(window,"click",i=>{this._touchActive=!1},{passive:!0})),this._disposers.push(C(this.view,"click",i=>{window.setTimeout(()=>{this._touchActive=!0,this._delayTouchDeactivate()},100)},{passive:!0}))}me("wheelevents")&&this._disposers.push(C(this.view,"wheel",t=>{let i=!1;this._hovering.forEach(r=>{if(r.wheelable)return i=!0,!1}),i&&t.preventDefault()},{passive:!1}))}resetImageArray(){this._ghostLayer.imageArray=void 0}_delayTouchDeactivate(){this._touchActiveTimeout&&clearTimeout(this._touchActiveTimeout),this.tapToActivateTimeout>0&&(this._touchActiveTimeout=window.setTimeout(()=>{this._touchActive=!1},this.tapToActivateTimeout))}get debugGhostView(){return!!this._ghostLayer.view.parentNode}set debugGhostView(e){e?this._ghostLayer.view.parentNode||this.view.appendChild(this._ghostLayer.view):this._ghostLayer.view.parentNode&&this._ghostLayer.view.parentNode.removeChild(this._ghostLayer.view)}createLinearGradient(e,t,i,r){return this.defaultLayer.context.createLinearGradient(e,t,i,r)}createRadialGradient(e,t,i,r,a,s){return this.defaultLayer.context.createRadialGradient(e,t,i,r,a,s)}createPattern(e,t,i,r,a){return this._patternCanvas.width=r,this._patternCanvas.height=a,this._patternContext.clearRect(0,0,r,a),t.renderDetached(this._patternContext),e.renderDetached(this._patternContext),this._patternContext.createPattern(this._patternCanvas,i)}makeContainer(){return new ri(this)}makeGraphics(){return new wi(this)}makeText(e,t){return new at(this,e,t)}makeTextStyle(){return new xi}makeRadialText(e,t){return new Pi(this,e,t)}makePicture(e){return new Oi(this,e)}resizeLayer(e){e.resize(this._calculatedWidth,this._calculatedHeight,this._calculatedWidth,this._calculatedHeight,this.resolution)}resizeGhost(){this._ghostLayer.resize(this._calculatedWidth,this._calculatedHeight,this._calculatedWidth,this._calculatedHeight,this.resolution)}resize(e,t,i,r){this._realWidth=e,this._realHeight=t,this._calculatedWidth=i,this._calculatedHeight=r,y(this.layers,a=>{a&&(a.dirty=!0,this.resizeLayer(a))}),this.resizeGhost(),this.view.style.width=i+"px",this.view.style.height=r+"px"}createDetachedLayer(e=!1){const t=document.createElement("canvas"),i=t.getContext("2d",{willReadFrequently:e}),r=new Si(t,i);return t.style.position="absolute",t.style.top="0px",t.style.left="0px",r}getLayerByOrder(e){const t=this.layers,i=t.length;for(let r=0;rh.order>c.order?1:h.order{t&&t.dirty&&t.visible&&(this._dirtyLayers.push(t),t.clear())}),this._ghostLayer.clear(),e.render({inactive:null,layer:this.defaultLayer}),this._ghostLayer.context.restore(),y(this.layers,t=>{if(t){const i=t.context;i.beginPath(),i.moveTo(0,0),i.stroke()}}),y(this._dirtyLayers,t=>{t.context.restore(),t.dirty=!1}),this._hovering.size&&this._lastPointerMoveEvent){const{events:t,target:i,native:r}=this._lastPointerMoveEvent;y(t,a=>{this._dispatchGlobalMousemove(a,i,r)})}}paintId(e){const t=ei(++this._colorId),i=G.fromHex(t).toCSS();return this._colorMap[i]=e,i}_removeObject(e){e._colorId!==void 0&&delete this._colorMap[e._colorId]}_adjustBoundingBox(e){const t=this._ghostLayer.margin;return new DOMRect(-t.left,-t.top,e.width+t.left+t.right,e.height+t.top+t.bottom)}getEvent(e,t=!0){const i=this.view.getBoundingClientRect(),r=e.clientX||0,a=e.clientY||0,s=this._calculatedWidth/this._realWidth,n=this._calculatedHeight/this._realHeight,h={x:r-i.left,y:a-i.top},c={x:(r-(t?i.left:0))*s,y:(a-(t?i.top:0))*n};return new ki(e,h,c,this._adjustBoundingBox(i))}_getHitTarget(e,t,i){if(t.width===0||t.height===0||e.xt.right||e.yt.bottom||!i||!this._layerDom.contains(i))return;const r=this._ghostLayer.getImageData(e,t);if(r.data[0]===0&&r.data[1]===0&&r.data[2]===0)return!1;const a=G.fromRGB(r.data[0],r.data[1],r.data[2]).toCSS();return this._colorMap[a]}getObjectAtPoint(e){const t=this._ghostLayer.getImageArray(e);if(t[0]===0&&t[1]===0&&t[2]===0)return;const i=G.fromRGB(t[0],t[1],t[2]).toCSS();return this._colorMap[i]}_withEvents(e,t){const i=this._events[e];if(i!==void 0){i.dispatching=!0;try{t(i)}finally{i.dispatching=!1,i.cleanup&&(i.cleanup=!1,ye(i.callbacks,r=>!r.disposed),i.callbacks.length===0&&(i.disposer.dispose(),delete this._events[e]))}}}_dispatchEventAll(e,t){this.interactionsEnabled&&this._withEvents(e,i=>{y(i.callbacks,r=>{r.disposed||r.callback.call(r.context,t)})})}_dispatchEvent(e,t,i){if(!this.interactionsEnabled)return!1;let r=!1;return this._withEvents(e,a=>{y(a.callbacks,s=>{s.disposed||s.object!==t||(s.callback.call(s.context,i),r=!0)})}),r}_dispatchMousedown(e,t){const i=e.button;if(i!=0&&i!=2&&i!=1&&i!==void 0)return;const r=this.getEvent(e),a=this._getHitTarget(r.originalPoint,r.bbox,t);if(a){const s=r.id;let n=!1;fe(a,h=>{const c={id:s,value:h};return this._mousedown.push(c),!n&&this._dispatchEvent("pointerdown",h,r)&&(n=!0,this._dragging.some(f=>f.value===h&&f.id===s)||this._dragging.push(c)),!0})}}_dispatchGlobalMousemove(e,t,i){const r=this.getEvent(e),a=this._getHitTarget(r.originalPoint,r.bbox,t);r.native=i,a?(this._hovering.forEach(s=>{s.contains(a)||(this._hovering.delete(s),s.cursorOverStyle&&_e(document.body,"cursor",s._replacedCursorStyle),this._dispatchEvent("pointerout",s,r))}),r.native&&fe(a,s=>(this._hovering.has(s)||(this._hovering.add(s),s.cursorOverStyle&&(s._replacedCursorStyle=zt(document.body,"cursor"),_e(document.body,"cursor",s.cursorOverStyle)),this._dispatchEvent("pointerover",s,r)),!0))):(this._hovering.forEach(s=>{s.cursorOverStyle&&_e(document.body,"cursor",s._replacedCursorStyle),this._dispatchEvent("pointerout",s,r)}),this._hovering.clear()),this._dispatchEventAll("globalpointermove",r)}removeHovering(e){this._hovering.delete(e),e.cursorOverStyle&&_e(document.body,"cursor",e._replacedCursorStyle)}_dispatchGlobalMouseup(e,t){const i=this.getEvent(e);i.native=t,this._dispatchEventAll("globalpointerup",i)}_dispatchDragMove(e){if(this._dragging.length!==0){const t=this.getEvent(e),i=t.id;this._dragging.forEach(r=>{r.id===i&&this._dispatchEvent("pointermove",r.value,t)})}}_dispatchDragEnd(e,t){const i=e.button;let r;if(i==0||i===void 0)r="click";else if(i==2)r="rightclick";else{if(i!=1)return;r="middleclick"}const a=this.getEvent(e),s=a.id;if(this._mousedown.length!==0){const n=this._getHitTarget(a.originalPoint,a.bbox,t);n&&this._mousedown.forEach(h=>{h.id===s&&h.value.contains(n)&&this._dispatchEvent(r,h.value,a)}),this._mousedown.length=0}this._dragging.length!==0&&(this._dragging.forEach(n=>{n.id===s&&this._dispatchEvent("pointerup",n.value,a)}),this._dragging.length=0)}_dispatchDoubleClick(e,t){const i=this.getEvent(e),r=this._getHitTarget(i.originalPoint,i.bbox,t);r&&fe(r,a=>!this._dispatchEvent("dblclick",a,i))}_dispatchWheel(e,t){const i=this.getEvent(e),r=this._getHitTarget(i.originalPoint,i.bbox,t);r&&fe(r,a=>!this._dispatchEvent("wheel",a,i))}_makeSharedEvent(e,t){if(this._listeners[e]===void 0){const i=t();this._listeners[e]=new Ct(()=>{delete this._listeners[e],i.dispose()})}return this._listeners[e].increment()}_onPointerEvent(e,t){let i=!1,r=null;function a(){r=null,i=!1}return new He([new X(()=>{r!==null&&clearTimeout(r),a()}),C(this.view,je(e),s=>{i=!0,r!==null&&clearTimeout(r),r=window.setTimeout(a,0)}),ti(window,e,(s,n)=>{r!==null&&(clearTimeout(r),r=null),t(s,n,i),i=!1})])}_initEvent(e){switch(e){case"globalpointermove":case"pointerover":case"pointerout":return this._makeSharedEvent("pointermove",()=>{const t=(i,r,a)=>{this._lastPointerMoveEvent={events:i,target:r,native:a},y(i,s=>{this._dispatchGlobalMousemove(s,r,a)})};return new He([this._onPointerEvent("pointerdown",t),this._onPointerEvent("pointermove",t)])});case"globalpointerup":return this._makeSharedEvent("pointerup",()=>{const t=this._onPointerEvent("pointerup",(r,a,s)=>{y(r,n=>{this._dispatchGlobalMouseup(n,s)}),this._lastPointerMoveEvent={events:r,target:a,native:s}}),i=this._onPointerEvent("pointercancel",(r,a,s)=>{y(r,n=>{this._dispatchGlobalMouseup(n,s)}),this._lastPointerMoveEvent={events:r,target:a,native:s}});return new X(()=>{t.dispose(),i.dispose()})});case"click":case"rightclick":case"middleclick":case"pointerdown":case"pointermove":case"pointerup":return this._makeSharedEvent("pointerdown",()=>{const t=this._onPointerEvent("pointerdown",(s,n)=>{y(s,h=>{this._dispatchMousedown(h,n)})}),i=this._onPointerEvent("pointermove",s=>{y(s,n=>{this._dispatchDragMove(n)})}),r=this._onPointerEvent("pointerup",(s,n)=>{y(s,h=>{this._dispatchDragEnd(h,n)})}),a=this._onPointerEvent("pointercancel",(s,n)=>{y(s,h=>{this._dispatchDragEnd(h,n)})});return new X(()=>{t.dispose(),i.dispose(),r.dispose(),a.dispose()})});case"dblclick":return this._makeSharedEvent("dblclick",()=>this._onPointerEvent("dblclick",(t,i)=>{y(t,r=>{this._dispatchDoubleClick(r,i)})}));case"wheel":return this._makeSharedEvent("wheel",()=>C(this.view,je("wheel"),t=>{this._dispatchWheel(t,et(t))},{passive:!1}))}}_addEvent(e,t,i,r){let a=this._events[t];a===void 0&&(a=this._events[t]={disposer:this._initEvent(t),callbacks:[],dispatching:!1,cleanup:!1});const s={object:e,context:r,callback:i,disposed:!1};return a.callbacks.push(s),new X(()=>{s.disposed=!0,a.dispatching?a.cleanup=!0:(De(a.callbacks,s),a.callbacks.length===0&&(a.disposer.dispose(),delete this._events[t]))})}getCanvas(e,t){this.render(e),t||(t={});let i=this.resolution,r=Math.floor(this._calculatedWidth*this.resolution),a=Math.floor(this._calculatedHeight*this.resolution);if(t.minWidth&&t.minWidth>r){let o=t.minWidth/r;o>i&&(i=o*this.resolution)}if(t.minHeight&&t.minHeight>a){let o=t.minHeight/a;o>i&&(i=o*this.resolution)}if(t.maxWidth&&t.maxWidtha){let o=t.maxHeight/a;o{if(o&&o.visible&&(o.tainted||n)){b=!0,o.exportableView=o.view,o.exportableContext=o.context,o.view=document.createElement("canvas"),o.view.style.position="fixed",o.view.style.top="-10000px",this.view.appendChild(o.view),s.push(o.view);let m=0,l=0;o.margin&&(m+=o.margin.left||0+o.margin.right||0,l+=o.margin.top||0+o.margin.bottom||0),o.view.width=r+m,o.view.height=a+l,o.context=o.view.getContext("2d"),o.dirty=!0,o.scale=i}}),b&&(this._omitTainted=!0,this.render(e),this._omitTainted=!1),y(this.layers,o=>{if(o&&o.visible){let m=0,l=0;o.margin&&(m=-(o.margin.left||0)*this.resolution,l=-(o.margin.top||0)*this.resolution),c.drawImage(o.view,m,l),o.exportableView&&(o.view=o.exportableView,o.exportableView=void 0),o.exportableContext&&(o.context=o.exportableContext,o.exportableContext=void 0),f{o.style.position="",o.style.top="",this.view.removeChild(o)}),h}}class Mi{constructor(){Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"margin",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_resolution",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_height",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"imageArray",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.view=document.createElement("canvas"),this.context=this.view.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.context.imageSmoothingEnabled=!1,this.view.style.position="absolute",this.view.style.top="0px",this.view.style.left="0px"}resize(e,t,i,r,a){this._resolution=a,e+=this.margin.left+this.margin.right,t+=this.margin.top+this.margin.bottom,i+=this.margin.left+this.margin.right,r+=this.margin.top+this.margin.bottom,this.view.style.left=-this.margin.left+"px",this.view.style.top=-this.margin.top+"px",this._width=Math.floor(e*a),this._height=Math.floor(t*a),this.view.width=this._width,this.view.style.width=i+"px",this.view.height=this._height,this.view.style.height=r+"px"}getImageData(e,t){return this.context.getImageData(Math.round((e.x-t.left)/t.width*this._width),Math.round((e.y-t.top)/t.height*this._height),1,1)}getImageArray(e){this.imageArray||(this.imageArray=this.context.getImageData(0,0,this._width,this._height).data);const t=this.imageArray,i=Math.round(e.x*this._resolution),r=4*(Math.round(e.y*this._resolution)*this._width+i);return[t[r],t[r+1],t[r+2],t[r+3]]}setMargin(e){this.margin.left=0,this.margin.right=0,this.margin.top=0,this.margin.bottom=0,y(e,t=>{t.margin&&(this.margin.left=Math.max(this.margin.left,t.margin.left),this.margin.right=Math.max(this.margin.right,t.margin.right),this.margin.top=Math.max(this.margin.top,t.margin.top),this.margin.bottom=Math.max(this.margin.bottom,t.margin.bottom))})}clear(){this.context.save(),this.context.fillStyle="#000",this.context.fillRect(0,0,this._width,this._height)}}class Si{constructor(e,t){Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tainted",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"margin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"order",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scale",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dirty",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"exportableView",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"exportableContext",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_height",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.view=e,this.context=t}resize(e,t,i,r,a){this.width!=null&&(e=this.width,i=this.width),this.height!=null&&(t=this.height,r=this.height),this.margin?(e+=this.margin.left+this.margin.right,t+=this.margin.top+this.margin.bottom,i+=this.margin.left+this.margin.right,r+=this.margin.top+this.margin.bottom,this.view.style.left=-this.margin.left+"px",this.view.style.top=-this.margin.top+"px"):(this.view.style.left="0px",this.view.style.top="0px"),this._width=Math.floor(e*a),this._height=Math.floor(t*a),this.view.width=this._width,this.view.style.width=i+"px",this.view.height=this._height,this.view.style.height=r+"px"}clear(){this.context.save(),this.context.clearRect(0,0,this._width,this._height)}}function qe(d,e){d==null?requestAnimationFrame(e):setTimeout(()=>{requestAnimationFrame(e)},1e3/d)}class Be{constructor(e,t={},i){if(Object.defineProperty(this,"dom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_inner",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDirtyParents",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dirty",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyParents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyBounds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyPositions",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_ticker",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_tickers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_updateTick",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new ut}),Object.defineProperty(this,"animationTime",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_animations",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_renderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rootContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tooltipContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipContainerSettings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltip",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"language",{enumerable:!0,configurable:!0,writable:!0,value:Gt.new(this,{})}),Object.defineProperty(this,"locale",{enumerable:!0,configurable:!0,writable:!0,value:st}),Object.defineProperty(this,"utc",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timezone",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fps",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"numberFormatter",{enumerable:!0,configurable:!0,writable:!0,value:Wt.new(this,{})}),Object.defineProperty(this,"dateFormatter",{enumerable:!0,configurable:!0,writable:!0,value:$t.new(this,{})}),Object.defineProperty(this,"durationFormatter",{enumerable:!0,configurable:!0,writable:!0,value:Xt.new(this,{})}),Object.defineProperty(this,"tabindex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_tabindexes",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_a11yD",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_focusElementDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_focusElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_focusedSprite",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isShift",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_keyboardDragPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_readerAlertElement",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_logo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipDiv",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"nonce",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"interfaceColors",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"verticalLayout",{enumerable:!0,configurable:!0,writable:!0,value:ct.new(this,{})}),Object.defineProperty(this,"horizontalLayout",{enumerable:!0,configurable:!0,writable:!0,value:dt.new(this,{})}),Object.defineProperty(this,"gridLayout",{enumerable:!0,configurable:!0,writable:!0,value:bt.new(this,{})}),Object.defineProperty(this,"_paused",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"autoResize",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_fontHash",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_isDisposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_resizeSensorDisposer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltips",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_htmlElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_htmlEnabledContainers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),!i)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");let r,a;if(this._settings=t,t.accessible==0&&(this._a11yD=!0),t.useSafeResolution==null&&(t.useSafeResolution=!0),t.useSafeResolution&&(r=_t()),this._renderer=new Ei(r),a=e instanceof HTMLElement?e:document.getElementById(e),y(ie.rootElements,h=>{if(h.dom===a)throw new Error("You cannot have multiple Roots on the same DOM node")}),this.interfaceColors=ge.new(this,{}),a===null)throw new Error("Could not find HTML element with id `"+e+"`");this.dom=a;let s=document.createElement("div");s.style.position="relative",s.style.width="100%",s.style.height="100%",a.appendChild(s);const n=t.tooltipContainerBounds;n&&(this._tooltipContainerSettings=n),this._inner=s,this._updateComputedStyles(),ie.rootElements.push(this)}static new(e,t){const i=new Be(e,t,!0);return i._init(),i}moveDOM(e){let t;if(t=e instanceof HTMLElement?e:document.getElementById(e),t){for(;this.dom.childNodes.length>0;)t.appendChild(this.dom.childNodes[0]);this.dom=t,this._initResizeSensor(),this.resize()}}_handleLogo(){if(this._logo){const e=this.dom.offsetWidth,t=this.dom.offsetHeight;e<=150||t<=60?this._logo.hide():this._logo.show()}}_showBranding(){if(!this._logo){const e=this.tooltipContainer.children.push(Z.new(this,{interactive:!0,interactiveChildren:!1,position:"absolute",setStateOnChildren:!0,paddingTop:9,paddingRight:9,paddingBottom:9,paddingLeft:9,scale:.6,y:Ke(100),centerY:K,tooltipText:"Created using amCharts 5",tooltipX:K,cursorOverStyle:"pointer",background:ft.new(this,{fill:re(4671320),fillOpacity:0,tooltipY:5})})),t=We.new(this,{pointerOrientation:"horizontal",paddingTop:4,paddingRight:7,paddingBottom:4,paddingLeft:7});t.label.setAll({fontSize:12}),t.get("background").setAll({fill:this.interfaceColors.get("background"),stroke:this.interfaceColors.get("grid"),strokeOpacity:.3}),e.set("tooltip",t),e.events.on("click",()=>{window.open("https://www.amcharts.com/","_blank")}),e.states.create("hover",{}),e.children.push(ze.new(this,{stroke:re(13421772),strokeWidth:3,svgPath:"M5 25 L13 25h13.6c3.4 0 6 0 10.3-4.3s5.2-12 8.6-12c3.4 0 4.3 8.6 7.7 8.6M83.4 25H79.8c-3.4 0-6 0-10.3-4.3s-5.2-12-8.6-12-4.3 8.6-7.7 8.6"})).states.create("hover",{stroke:re(3976191)}),e.children.push(ze.new(this,{stroke:re(8947848),strokeWidth:3,svgPath:"M83.4 25h-31C37 25 39.5 4.4 28.4 4.4S18.9 24.2 4.3 25H0"})).states.create("hover",{stroke:re(4671320)}),this._logo=e,this._handleLogo()}}_getRealSize(){return this.dom.getBoundingClientRect()}_getCalculatedSize(e){return this._settings.calculateSize?this._settings.calculateSize(e):{width:e.width,height:e.height}}_init(){const e=this._settings;e.accessible!==!1&&(e.focusable&&(this._inner.setAttribute("focusable","true"),this._inner.setAttribute("tabindex",this.tabindex+"")),e.ariaLabel&&this._inner.setAttribute("aria-label",e.ariaLabel),e.role&&this._inner.setAttribute("role",e.role));const t=this._renderer,i=this._getRealSize(),r=this._getCalculatedSize(i),a=Math.floor(r.width),s=Math.floor(r.height),n=Math.floor(i.width),h=Math.floor(i.height),c=Z.new(this,{visible:!0,width:a,height:s});this._rootContainer=c,this._rootContainer._defaultThemes.push(Ft.new(this));const f=c.children.push(Z.new(this,{visible:!0,width:K,height:K}));this.container=f,t.resize(n,h,a,s),this._inner.appendChild(t.view),this._initResizeSensor();const u=document.createElement("div");if(this._htmlElementContainer=u,u.className="am5-html-container",u.style.position="absolute",u.style.pointerEvents="none",this._tooltipContainerSettings||(u.style.overflow="hidden"),this._inner.appendChild(u),this._a11yD!==!0){const b=document.createElement("div");b.className="am5-reader-container",b.setAttribute("role","alert"),b.style.position="absolute",b.style.width="1px",b.style.height="1px",b.style.overflow="hidden",b.style.clip="rect(1px, 1px, 1px, 1px)",this._readerAlertElement=b,this._inner.appendChild(this._readerAlertElement);const o=document.createElement("div");o.className="am5-focus-container",o.style.position="absolute",o.style.pointerEvents="none",o.style.top="0px",o.style.left="0px",o.style.overflow="hidden",o.style.width=a+"px",o.style.height=s+"px",o.setAttribute("role","graphics-document"),J(o,!1),this._focusElementContainer=o,this._inner.appendChild(this._focusElementContainer);const m=document.createElement("div");this._tooltipElementContainer=m,m.className="am5-tooltip-container",this._inner.appendChild(m),me("keyboardevents")&&(this._disposers.push(C(window,"keydown",l=>{l.keyCode==16?this._isShift=!0:l.keyCode==9&&(this._isShift=l.shiftKey)})),this._disposers.push(C(window,"keyup",l=>{l.keyCode==16&&(this._isShift=!1)})),this._disposers.push(C(o,"click",()=>{const l=this._focusedSprite;if(l){const g=t.getEvent(new MouseEvent("click"));l.events.dispatch("click",{type:"click",originalEvent:g.event,point:g.point,simulated:!0,target:l})}})),this._disposers.push(C(o,"keydown",l=>{const g=this._focusedSprite;if(g){l.keyCode==27&&(gt(),this._focusedSprite=void 0);let p=0,w=0;switch(l.keyCode){case 13:l.preventDefault();const v=t.getEvent(new MouseEvent("click"));return void g.events.dispatch("click",{type:"click",originalEvent:v.event,point:v.point,simulated:!0,target:g});case 37:p=-6;break;case 39:p=6;break;case 38:w=-6;break;case 40:w=6;break;default:return}if(p!=0||w!=0){if(l.preventDefault(),!g.isDragging()){this._keyboardDragPoint={x:0,y:0};const P=t.getEvent(new MouseEvent("mousedown",{clientX:0,clientY:0}));g.events.isEnabled("pointerdown")&&g.events.dispatch("pointerdown",{type:"pointerdown",originalEvent:P.event,point:P.point,simulated:!0,target:g})}const v=this._keyboardDragPoint;v.x+=p,v.y+=w;const _=t.getEvent(new MouseEvent("mousemove",{clientX:v.x,clientY:v.y}),!1);g.events.isEnabled("globalpointermove")&&g.events.dispatch("globalpointermove",{type:"globalpointermove",originalEvent:_.event,point:_.point,simulated:!0,target:g})}}})),this._disposers.push(C(o,"keyup",l=>{if(this._focusedSprite){const g=this._focusedSprite,p=l.keyCode;switch(p){case 37:case 39:case 38:case 40:if(g.isDragging()){const w=this._keyboardDragPoint,v=t.getEvent(new MouseEvent("mouseup",{clientX:w.x,clientY:w.y}));return g.events.isEnabled("globalpointerup")&&g.events.dispatch("globalpointerup",{type:"globalpointerup",originalEvent:v.event,point:v.point,simulated:!0,target:g}),void(this._keyboardDragPoint=void 0)}if(g.get("focusableGroup")){const w=g.get("focusableGroup"),v=this._tabindexes.filter(L=>L.get("focusableGroup")==w&&L.getPrivate("focusable")!==!1);let _=v.indexOf(g);const P=v.length-1;_+=p==39||p==40?1:-1,_<0?_=P:_>P&&(_=0),mt(v[_].getPrivate("focusElement").dom)}}}})))}this._startTicker(),this.setThemes([]),this._addTooltip(),this._hasLicense()||this._showBranding()}_initResizeSensor(){this._resizeSensorDisposer&&this._resizeSensorDisposer.dispose(),this._resizeSensorDisposer=new Vt(this.dom,()=>{this.autoResize&&this.resize()}),this._disposers.push(this._resizeSensorDisposer)}resize(){const e=this._getRealSize(),t=this._getCalculatedSize(e),i=Math.floor(t.width),r=Math.floor(t.height);if(i>0&&r>0){const a=Math.floor(e.width),s=Math.floor(e.height),n=this._htmlElementContainer;if(n.style.width=i+"px",n.style.height=r+"px",this._a11yD!==!0){const c=this._focusElementContainer;c.style.width=i+"px",c.style.height=r+"px"}this._renderer.resize(a,s,i,r);const h=this._rootContainer;h.setPrivate("width",i),h.setPrivate("height",r),this._render(),this._handleLogo()}}_render(){this._renderer.render(this._rootContainer._display),this._focusElementDirty&&(this._updateCurrentFocus(),this._focusElementDirty=!1)}_runTickers(e){y(this._tickers,t=>{t(e)})}_runAnimations(e){let t=0;return ye(this._animations,i=>{const r=i._runAnimation(e);return r!==Ve.Stopped&&(r!==Ve.Playing||(++t,!0))}),t===0}_runDirties(){let e={};for(;this._isDirtyParents;)this._isDirtyParents=!1,se(this._dirtyParents).forEach(s=>{const n=this._dirtyParents[s];delete this._dirtyParents[s],n.isDisposed()||(e[n.uid]=n,n._prepareChildren())});se(e).forEach(s=>{e[s]._updateChildren()});const t=[];se(this._dirty).forEach(s=>{const n=this._dirty[s];n.isDisposed()?delete this._dirty[n.uid]:(t.push(n),n._beforeChanged())}),t.forEach(s=>{s._changed(),delete this._dirty[s.uid],s._clearDirty()}),this._isDirty=!1;const i={},r=[];se(this._dirtyBounds).forEach(s=>{const n=this._dirtyBounds[s];delete this._dirtyBounds[s],n.isDisposed()||(i[n.uid]=n.depth(),r.push(n))}),this._positionHTMLElements(),r.sort((s,n)=>pt(i[n.uid],i[s.uid])),r.forEach(s=>{s._updateBounds()});const a=this._dirtyPositions;se(a).forEach(s=>{const n=a[s];delete a[s],n.isDisposed()||n._updatePosition()}),t.forEach(s=>{s._afterChanged()})}_renderFrame(e){if(this._updateTick){this.events.isEnabled("framestarted")&&this.events.dispatch("framestarted",{type:"framestarted",target:this,timestamp:e}),this._checkComputedStyles(),this._runTickers(e);const t=this._runAnimations(e);return this._runDirties(),this._render(),this._renderer.resetImageArray(),this._positionHTMLElements(),this.events.isEnabled("frameended")&&this.events.dispatch("frameended",{type:"frameended",target:this,timestamp:e}),this._tickers.length===0&&t&&!this._isDirty}return!0}_runTicker(e,t){this.isDisposed()||(this.animationTime=e,this._renderFrame(e)?(this._ticker=null,this.animationTime=null):this._paused||(t?this._ticker:qe(this.fps,this._ticker)))}_runTickerNow(e=1e4){if(!this.isDisposed()){const t=performance.now()+e;for(;;){const i=performance.now();if(i>=t){this.animationTime=null;break}if(this.animationTime=i,this._renderFrame(i)){this.animationTime=null;break}}}}_startTicker(){this._ticker===null&&(this.animationTime=null,this._ticker=e=>{this._runTicker(e)},qe(this.fps,this._ticker))}get updateTick(){return this._updateTick}set updateTick(e){this._updateTick=e,e&&this._startTicker()}_addDirtyEntity(e){this._dirty[e.uid]===void 0&&(this._isDirty=!0,this._dirty[e.uid]=e,this._startTicker())}_addDirtyParent(e){this._dirtyParents[e.uid]===void 0&&(this._isDirty=!0,this._isDirtyParents=!0,this._dirtyParents[e.uid]=e,this._startTicker())}_addDirtyBounds(e){this._dirtyBounds[e.uid]===void 0&&(this._isDirty=!0,this._dirtyBounds[e.uid]=e,this._startTicker())}_addDirtyPosition(e){this._dirtyPositions[e.uid]===void 0&&(this._isDirty=!0,this._dirtyPositions[e.uid]=e,this._startTicker())}_addAnimation(e){this._animations.indexOf(e)===-1&&this._animations.push(e),this._startTicker()}_markDirty(){this._isDirty=!0}_markDirtyRedraw(){this.events.once("frameended",()=>{this._isDirty=!0,this._startTicker()})}eachFrame(e){return this._tickers.push(e),this._startTicker(),new X(()=>{De(this._tickers,e)})}markDirtyGlobal(e){e||(e=this.container),e.walkChildren(t=>{t instanceof Z&&this.markDirtyGlobal(t),t.markDirty(),t.markDirtyBounds()})}width(){return Math.floor(this._getCalculatedSize(this._getRealSize()).width)}height(){return Math.floor(this._getCalculatedSize(this._getRealSize()).height)}dispose(){this._isDisposed||(this._isDisposed=!0,this._rootContainer.dispose(),this._renderer.dispose(),this.horizontalLayout.dispose(),this.verticalLayout.dispose(),this.interfaceColors.dispose(),y(this._disposers,e=>{e.dispose()}),this._inner&&yt(this._inner),ae(ie.rootElements,this))}isDisposed(){return this._isDisposed}readerAlert(e){this._a11yD!==!0&&(this._readerAlertElement.innerHTML=Ie(e))}setThemes(e){this._rootContainer.set("themes",e);const t=this.tooltipContainer;t&&t._applyThemes();const i=this.interfaceColors;i&&i._applyThemes()}_addTooltip(){if(!this.tooltipContainer){const e=this._tooltipContainerSettings,t=this._rootContainer.children.push(Z.new(this,{position:"absolute",isMeasured:!1,width:K,height:K,layer:e?35:30,layerMargin:e||void 0}));this.tooltipContainer=t;const i=We.new(this,{});this.container.set("tooltip",i),i.hide(0),this._tooltip=i}}_registerTabindexOrder(e){this._a11yD!=1&&(e.get("focusable")?Te(this._tabindexes,e):ae(this._tabindexes,e),this._invalidateTabindexes())}_unregisterTabindexOrder(e){this._a11yD!=1&&(ae(this._tabindexes,e),this._invalidateTabindexes())}_invalidateTabindexes(){if(this._a11yD==1)return;this._tabindexes.sort((t,i)=>{const r=t.get("tabindexOrder",0),a=i.get("tabindexOrder",0);return r==a?0:r>a?1:-1});const e=[];y(this._tabindexes,(t,i)=>{t.getPrivate("focusElement")?this._moveFocusElement(i,t):this._makeFocusElement(i,t);const r=t.get("focusableGroup");r&&t.getPrivate("focusable")!==!1&&(e.indexOf(r)!==-1?t.getPrivate("focusElement").dom.setAttribute("tabindex","-1"):e.push(r))})}_updateCurrentFocus(){this._a11yD!=1&&this._focusedSprite&&(this._decorateFocusElement(this._focusedSprite),this._positionFocusElement(this._focusedSprite))}_decorateFocusElement(e,t){if(this._a11yD==1||(t||(t=e.getPrivate("focusElement").dom),!t))return;const i=e.get("role");i?t.setAttribute("role",i):t.removeAttribute("role");const r=e.get("ariaLabel");if(r){const o=vt(e,r);t.setAttribute("aria-label",o)}else t.removeAttribute("aria-label");const a=e.get("ariaLive");a?t.setAttribute("aria-live",a):t.removeAttribute("aria-live");const s=e.get("ariaChecked");s!=null&&i&&["checkbox","option","radio","menuitemcheckbox","menuitemradio","treeitem"].indexOf(i)!==-1?t.setAttribute("aria-checked",s?"true":"false"):t.removeAttribute("aria-checked"),e.get("ariaHidden")?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden");const n=e.get("ariaOrientation");n?t.setAttribute("aria-orientation",n):t.removeAttribute("aria-orientation");const h=e.get("ariaValueNow");h?t.setAttribute("aria-valuenow",h):t.removeAttribute("aria-valuenow");const c=e.get("ariaValueMin");c?t.setAttribute("aria-valuemin",c):t.removeAttribute("aria-valuemin");const f=e.get("ariaValueMax");f?t.setAttribute("aria-valuemax",f):t.removeAttribute("aria-valuemax");const u=e.get("ariaValueText");u?t.setAttribute("aria-valuetext",u):t.removeAttribute("aria-valuetext");const b=e.get("ariaControls");b?t.setAttribute("aria-controls",b):t.removeAttribute("aria-controls"),e.get("visible")&&e.get("opacity")!==0&&e.get("role")!="tooltip"&&!e.isHidden()&&e.getPrivate("focusable")!==!1?(t.getAttribute("tabindex")!="-1"&&t.setAttribute("tabindex",""+this.tabindex),t.removeAttribute("aria-hidden")):(t.removeAttribute("tabindex"),t.setAttribute("aria-hidden","true"))}_makeFocusElement(e,t){if(t.getPrivate("focusElement")||this._a11yD==1)return;const i=document.createElement("div");t.get("role")!="tooltip"&&(i.tabIndex=this.tabindex),i.style.position="absolute",J(i,!1);const r=[];t.setPrivate("focusElement",{dom:i,disposers:r}),this._decorateFocusElement(t),r.push(C(i,"focus",a=>{this._handleFocus(a,e)})),r.push(C(i,"blur",a=>{this._handleBlur(a,e)})),this._moveFocusElement(e,t)}_removeFocusElement(e){if(this._a11yD==1)return;ae(this._tabindexes,e);const t=e.getPrivate("focusElement");t&&(this._focusElementContainer.removeChild(t.dom),y(t.disposers,i=>{i.dispose()}))}_hideFocusElement(e){this._a11yD!=1&&(e.getPrivate("focusElement").dom.style.display="none")}_moveFocusElement(e,t){if(this._a11yD==1)return;const i=this._focusElementContainer,r=t.getPrivate("focusElement").dom;if(r===this._focusElementContainer.children[e])return;const a=this._focusElementContainer.children[e+1];a?i.insertBefore(r,a):i.append(r)}_positionFocusElement(e){if(this._a11yD==1||e==null)return;const t=e.globalBounds();let i=t.right==t.left?e.width():t.right-t.left,r=t.top==t.bottom?e.height():t.bottom-t.top;const a=this._settings.focusPadding!==void 0?this._settings.focusPadding:2;let s=t.left-a,n=t.top-a;i<0&&(s+=i,i=Math.abs(i)),r<0&&(n+=r,r=Math.abs(r));const h=e.getPrivate("focusElement").dom;h.style.top=n+"px",h.style.left=s+"px",h.style.width=i+2*a+"px",h.style.height=r+2*a+"px"}_handleFocus(e,t){if(this._a11yD==1)return;const i=this._tabindexes[t];i.isVisibleDeep()?(this._positionFocusElement(i),this._focusedSprite=i,i.events.isEnabled("focus")&&i.events.dispatch("focus",{type:"focus",originalEvent:e,target:i})):this._focusNext(e.target,this._isShift?-1:1)}_focusNext(e,t){if(this._a11yD==1)return;const i=Array.from(document.querySelectorAll(["a[href]","area[href]","button:not([disabled])","details","input:not([disabled])","iframe:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[contentEditable=""]','[contentEditable="true"]','[contentEditable="TRUE"]','[tabindex]:not([tabindex^="-"])'].join(",")));let r=i.indexOf(e)+t;r<0?r=i.length-1:r>=i.length&&(r=0),i[r].focus()}_handleBlur(e,t){if(this._a11yD==1)return;const i=this._focusedSprite;i&&!i.isDisposed()&&i.events.isEnabled("blur")&&i.events.dispatch("blur",{type:"blur",originalEvent:e,target:i}),this._focusedSprite=void 0}updateTooltip(e){if(this._a11yD==1)return;const t=Ie(e._getText());let i=e.getPrivate("tooltipElement");e.get("role")=="tooltip"&&t!=""?(i||(i=this._makeTooltipElement(e)),i.innerHTML!=t&&(i.innerHTML=t)):i&&(i.remove(),e.removePrivate("tooltipElement"))}_makeTooltipElement(e){const t=this._tooltipElementContainer,i=document.createElement("div");return i.style.position="absolute",i.style.width="1px",i.style.height="1px",i.style.overflow="hidden",i.style.clip="rect(1px, 1px, 1px, 1px)",J(i,!1),this._decorateFocusElement(e,i),t.append(i),e.setPrivate("tooltipElement",i),i}_removeTooltipElement(e){if(this._a11yD==1)return;const t=e.getPrivate("tooltipElement");if(t){const i=t.parentElement;i&&i.removeChild(t)}}_invalidateAccessibility(e){if(this._a11yD==1)return;this._focusElementDirty=!0;const t=e.getPrivate("focusElement");e.get("focusable")?t&&(this._decorateFocusElement(e),this._positionFocusElement(e)):t&&this._removeFocusElement(e)}focused(e){return this._focusedSprite===e}documentPointToRoot(e){const t=this._getRealSize(),i=this._getCalculatedSize(t),r=i.width/t.width,a=i.height/t.height;return{x:(e.x-t.left)*r,y:(e.y-t.top)*a}}rootPointToDocument(e){const t=this._getRealSize(),i=this._getCalculatedSize(t),r=i.width/t.width,a=i.height/t.height;return{x:e.x/r+t.left,y:e.y/a+t.top}}addDisposer(e){return this._disposers.push(e),e}_updateComputedStyles(){const e=window.getComputedStyle(this.dom);let t="";ue(e,(r,a)=>{pe(r)&&r.match(/^font/)&&(t+=a)});const i=t!=this._fontHash;return i&&(this._fontHash=t),i}_checkComputedStyles(){this._updateComputedStyles()&&this._invalidateLabelBounds(this.container)}_invalidateLabelBounds(e){e instanceof Z?e.children.each(t=>{this._invalidateLabelBounds(t)}):e instanceof wt&&e.markDirtyBounds()}_hasLicense(){for(let e=0;e{const a=this._renderer.getEvent(r);e.events.dispatch("click",{type:"click",originalEvent:a.event,point:a.point,simulated:!1,target:e})}))),this._positionHTMLElement(e),t.append(i),Te(this._htmlEnabledContainers,e),i}_positionHTMLElements(){y(this._htmlEnabledContainers,e=>{this._positionHTMLElement(e)})}_positionHTMLElement(e){const t=e.getPrivate("htmlElement");if(t){y(["paddingTop","paddingRight","paddingBottom","paddingLeft","minWidth","minHeight","maxWidth","maxHeight"],f=>{const u=e.get(f);t.style[f]=u?u+"px":""});const i=e.compositeOpacity();setTimeout(()=>{t.style.opacity=i+""},10);const r=e.isVisibleDeep();r&&(t.style.display="block");const a=e.globalBounds();t.style.top=a.top+"px",t.style.left=a.left+"px";const s=e.get("width"),n=e.get("height");let h=0,c=0;if(s&&(h=e.width()),n&&(c=e.height()),s&&n)e.removePrivate("minWidth"),e.removePrivate("minHeight");else{t.style.position="fixed",t.style.width="",t.style.height="";const f=t.getBoundingClientRect();t.style.position="absolute",h=f.width,c=f.height,e._adjustedLocalBounds={left:0,right:0,top:0,bottom:0},e.setPrivate("minWidth",h),e.setPrivate("minHeight",c)}h>0&&(t.style.minWidth=h+"px"),c>0&&(t.style.minHeight=c+"px"),r&&i!=0||(t.style.display="none")}}_setHTMLContent(e,t){let i=e.getPrivate("htmlElement");i||(i=this._makeHTMLElement(e)),i.innerHTML!=t&&(i.innerHTML=t)}_removeHTMLContent(e){let t=e.getPrivate("htmlElement");t&&(this._htmlElementContainer.removeChild(t),e.removePrivate("htmlElement")),ae(this._htmlEnabledContainers,e)}}ht("AM5C241025748");const Ze="en-us",Ae=new Map([["ar",()=>x(()=>import("./ar-C6P6sbTZ.js"),[])],["bg-bg",()=>x(()=>import("./bg_BG-BKa2bm9j.js"),[])],["bs-ba",()=>x(()=>import("./bs_BA-Cr-VUOtJ.js"),[])],["ca-es",()=>x(()=>import("./ca_ES-DWC4n8NA.js"),[])],["cs-cz",()=>x(()=>import("./cs_CZ-CyqqX6ir.js"),[])],["da-dk",()=>x(()=>import("./da_DK-2ex9kBWh.js"),[])],["de-de",()=>x(()=>import("./de_DE-BF1_XBt7.js"),[])],["de-ch",()=>x(()=>import("./de_CH-B97rjhoW.js"),[])],["el-gr",()=>x(()=>import("./el_GR-zaN0EgX_.js"),[])],["en-us",()=>x(()=>import("./en_US-COWxzRR4.js"),[])],["en-ca",()=>x(()=>import("./en_CA-COWxzRR4.js"),[])],["es-es",()=>x(()=>import("./es_ES-_3WcXaQ2.js"),[])],["et-ee",()=>x(()=>import("./et_EE-F7kgGek-.js"),[])],["fi-fi",()=>x(()=>import("./fi_FI-Bozs9Z2H.js"),[])],["fr-fr",()=>x(()=>import("./fr_FR-BkfBDc1T.js"),[])],["he-il",()=>x(()=>import("./he_IL-CAeZms-L.js"),[])],["hr-hr",()=>x(()=>import("./hr_HR-BXNws4dg.js"),[])],["hu-hu",()=>x(()=>import("./hu_HU-BPCtb03x.js"),[])],["id-id",()=>x(()=>import("./id_ID-Bk2oUsUi.js"),[])],["it-it",()=>x(()=>import("./it_IT-BU_dnupK.js"),[])],["ja-jp",()=>x(()=>import("./ja_JP-TESpmw1I.js"),[])],["ko-kr",()=>x(()=>import("./ko_KR-DvFSNkwg.js"),[])],["lt-lt",()=>x(()=>import("./lt_LT-DHDBnlgq.js"),[])],["lv-lv",()=>x(()=>import("./lv_LV-BGX5_oyM.js"),[])],["nb-no",()=>x(()=>import("./nb_NO-BVuLzJb0.js"),[])],["nl-nl",()=>x(()=>import("./nl_NL-DiE2F1Fx.js"),[])],["pl-pl",()=>x(()=>import("./pl_PL-CCCo8oJV.js"),[])],["pt-br",()=>x(()=>import("./pt_BR-ClOz39JC.js"),[])],["pt-pt",()=>x(()=>import("./pt_PT-CugZtzXR.js"),[])],["ro-ro",()=>x(()=>import("./ro_RO-D4DP893q.js"),[])],["ru-ru",()=>x(()=>import("./ru_RU-ItrmHbqT.js"),[])],["sk-sk",()=>x(()=>import("./sk_SK-CP61SfDR.js"),[])],["sl-sl",()=>x(()=>import("./sl_SL-hZyOU_tZ.js"),[])],["sr-rs",()=>x(()=>import("./sr_RS-CVYN3U4S.js"),[])],["sv-se",()=>x(()=>import("./sv_SE-CRc7K9Uw.js"),[])],["th-th",()=>x(()=>import("./th_TH-DLSV1BZk.js"),[])],["tr-tr",()=>x(()=>import("./tr_TR-BqZDkyaY.js"),[])],["uk-ua",()=>x(()=>import("./uk_UA-CLrV2Ees.js"),[])],["vi-vn",()=>x(()=>import("./vi_VN-DrrDewoL.js"),[])],["zh-cn",()=>x(()=>import("./zh_Hans-D0O9jRQd.js"),[])],["zh-hk",()=>x(()=>import("./zh_Hant-GhP8Ngw4.js"),[])],["zh-tw",()=>x(()=>import("./zh_Hant-GhP8Ngw4.js"),[])]]);function Ti(d){const e=d.split("-")[0].toLowerCase();let t=null;for(const i of Ae.keys())if(i.startsWith(e)){t=i;break}return t}function ji(d){return d?Ae.has(d.toLowerCase())?d.toLowerCase():Ti(d)||Ze:Ze}async function Li(d,e=lt()){const t=Be.new(d);return t.locale=(await Ae.get(ji(e))()).default,t}export{Li as createRoot}; +import{cd as lt,_ as x}from"./index-BjUNJPVf.js";import{B as te,k as ht,G as ut,$ as ct,X as dt,Z as bt,u as _t,w as y,x as ie,i as Z,a as Ke,r as K,z as ft,K as re,b as ze,l as J,q as me,c as C,t as gt,e as mt,L as ye,N as se,O as pt,d as X,f as De,g as yt,h as ae,j as Ie,T as Te,m as vt,W as ue,n as pe,s as wt,J as Je,_ as Qe,y as Ce,F as xt,o as ee,p as Q,v as U,A as Pt,C as H,E as Ot,D as j,H as de,S as be,I as Re,M as kt,P as Fe,Q as Et,R as Mt,U as V,V as Ye,Y as St,a0 as Tt,a1 as jt,a2 as Dt,a3 as G,a4 as _e,a5 as Ct,a6 as He,a7 as je,a8 as et,a9 as Ve,aa as Bt,ab as At,ac as tt,ad as it,ae as Lt,af as zt,ag as It,ah as Rt,ai as le,aj as Pe}from"./Theme-6HY29PEY.js";import{u as We}from"./Tooltip-C7eoaNP4.js";import{s as Ft}from"./DefaultTheme-Ze4cVXuP.js";class Yt{constructor(){Object.defineProperty(this,"_observer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_targets",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this._observer=new ResizeObserver(e=>{y(e,t=>{y(this._targets,i=>{i.target===t.target&&i.callback()})})})}addTarget(e,t){this._observer.observe(e,{box:"border-box"}),this._targets.push({target:e,callback:t})}removeTarget(e){this._observer.unobserve(e),ye(this._targets,t=>t.target!==e)}}class ve{constructor(){Object.defineProperty(this,"_timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_targets",{enumerable:!0,configurable:!0,writable:!0,value:[]})}addTarget(e,t){if(this._timer===null){let r=null;const a=()=>{const s=Date.now();(r===null||s>r+ve.delay)&&(r=s,y(this._targets,n=>{let h=n.target.getBoundingClientRect();h.width===n.size.width&&h.height===n.size.height||(n.size=h,n.callback())})),this._targets.length===0?this._timer=null:this._timer=requestAnimationFrame(a)};this._timer=requestAnimationFrame(a)}let i={width:0,height:0,left:0,right:0,top:0,bottom:0,x:0,y:0};this._targets.push({target:e,callback:t,size:i})}removeTarget(e){ye(this._targets,t=>t.target!==e),this._targets.length===0&&this._timer!==null&&(cancelAnimationFrame(this._timer),this._timer=null)}}Object.defineProperty(ve,"delay",{enumerable:!0,configurable:!0,writable:!0,value:200});let Oe=null;function Ht(){return Oe===null&&(Oe=typeof ResizeObserver<"u"?new Yt:new ve),Oe}class Vt{constructor(e,t){Object.defineProperty(this,"_sensor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_element",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_listener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this._sensor=Ht(),this._element=e,this._listener=Je(t),this._sensor.addTarget(e,t)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._sensor.removeTarget(this._element),this._listener.dispose())}get sensor(){return this._sensor}}class ge extends te{}Object.defineProperty(ge,"className",{enumerable:!0,configurable:!0,writable:!0,value:"InterfaceColors"}),Object.defineProperty(ge,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:te.classNames.concat([ge.className])});class Wt extends te{_setDefaults(){this._setDefault("negativeBase",0),this._setDefault("numberFormat","#,###.#####"),this._setDefault("smallNumberThreshold",1);const e="_big_number_suffix_",t="_small_number_suffix_",i="_byte_suffix_";this._setDefault("bigNumberPrefixes",[{number:1e3,suffix:this._t(e+"3")},{number:1e6,suffix:this._t(e+"6")},{number:1e9,suffix:this._t(e+"9")},{number:1e12,suffix:this._t(e+"12")},{number:1e15,suffix:this._t(e+"15")},{number:1e18,suffix:this._t(e+"18")},{number:1e21,suffix:this._t(e+"21")},{number:1e24,suffix:this._t(e+"24")}]),this._setDefault("smallNumberPrefixes",[{number:1e-24,suffix:this._t(t+"24")},{number:1e-21,suffix:this._t(t+"21")},{number:1e-18,suffix:this._t(t+"18")},{number:1e-15,suffix:this._t(t+"15")},{number:1e-12,suffix:this._t(t+"12")},{number:1e-9,suffix:this._t(t+"9")},{number:1e-6,suffix:this._t(t+"6")},{number:.001,suffix:this._t(t+"3")}]),this._setDefault("bytePrefixes",[{number:1,suffix:this._t(i+"B")},{number:1024,suffix:this._t(i+"KB")},{number:1048576,suffix:this._t(i+"MB")},{number:1073741824,suffix:this._t(i+"GB")},{number:1099511627776,suffix:this._t(i+"TB")},{number:0x4000000000000,suffix:this._t(i+"PB")}]),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(e,t,i){let r;(t==null||pe(t)&&t.toLowerCase()==="number")&&(t=this.get("numberFormat",""));let a=Number(e);if(Qe(t))try{return this.get("intlLocales")?new Intl.NumberFormat(this.get("intlLocales"),t).format(a):new Intl.NumberFormat(void 0,t).format(a)}catch{return"Invalid"}else{t=Ce(t);let s,n=this.parseFormat(t,this._root.language);s=a>this.get("negativeBase")?n.positive:a{if(h.parsed)return;let c=h.source;c.toLowerCase()==="number"&&(c=this.get("numberFormat","#,###.#####"));let f=U.chunk(c,!0);for(let u=0;u=0?e.toExponential(t.decimals.passive).split("e"):e.toExponential().split("e"),e=Number(u[0]),a="e"+u[1],t.modSpacing&&(a=" "+a)}else if(t.decimals.passive===0)e=Math.round(e);else if(t.decimals.passive>0){let u=Math.pow(10,t.decimals.passive);e=Math.round(e*u)/u}let n="",h=Pt(e).split("."),c=h[0];if(c.length0){let u=[],b=c.split("").reverse().join("");for(let o=0,m=c.length;o<=m;o+=t.thousands.interval){let l=b.substr(o,t.thousands.interval).split("").reverse().join("");l!==""&&u.unshift(l)}c=u.join(t.thousands.separator)}n+=c,h.length===1&&h.push("");let f=h[1];return f.length{switch(f.type){case"year":t=+f.value;break;case"month":i=+f.value-1;break;case"day":r=+f.value;break;case"hour":a=+f.value;break;case"minute":s=+f.value;break;case"second":n=+f.value;break;case"fractionalSecond":h=+f.value;break;case"weekday":switch(f.value){case"Sun":c=0;break;case"Mon":c=1;break;case"Tue":c=2;break;case"Wed":c=3;break;case"Thu":c=4;break;case"Fri":c=5;break;case"Sat":c=6}}}),a===24&&(a=0),{year:t,month:i,day:r,hour:a,minute:s,second:n,millisecond:h,weekday:c}}function Ue(d,e){const{year:t,month:i,day:r,hour:a,minute:s,second:n,millisecond:h}=rt(d,e);return Date.UTC(t,i,r,a,s,n,h)}class Ut{constructor(e,t){if(Object.defineProperty(this,"_utc",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dtf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!t)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this.name=e,this._utc=new Intl.DateTimeFormat("UTC",{hour12:!1,timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",fractionalSecondDigits:3}),this._dtf=new Intl.DateTimeFormat("UTC",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",fractionalSecondDigits:3})}static new(e){return new this(e,!0)}convertLocal(e){const t=this.offsetUTC(e),i=e.getTimezoneOffset(),r=new Date(e);r.setUTCMinutes(r.getUTCMinutes()-(t-i));const a=r.getTimezoneOffset();return i!=a&&r.setUTCMinutes(r.getUTCMinutes()+a-i),r}offsetUTC(e){return(Ue(this._utc,e)-Ue(this._dtf,e))/6e4}parseDate(e){return rt(this._dtf,e)}}class $t extends te{_setDefaults(){this._setDefault("capitalize",!0),this._setDefault("dateFormat","yyyy-MM-dd"),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(e,t){let i;t!==void 0&&t!==""||(t=this.get("dateFormat","yyyy-MM-dd"));let r=e;if(Qe(t))try{const n=this.get("intlLocales");return n?new Intl.DateTimeFormat(n,t).format(r):new Intl.DateTimeFormat(void 0,t).format(r)}catch{return"Invalid"}let a=this.parseFormat(t);const s=this._root.timezone;return s&&!this._root.utc&&(r=s.convertLocal(r)),H(r.getTime())?(i=this.applyFormat(r,a),this.get("capitalize")&&(i=i.replace(/^.{1}/,i.substr(0,1).toUpperCase())),i):"Invalid date"}applyFormat(e,t){let i,r,a,s,n,h,c,f,u=t.template,b=e.getTime();this._root.utc?(i=e.getUTCFullYear(),r=e.getUTCMonth(),a=e.getUTCDay(),s=e.getUTCDate(),n=e.getUTCHours(),h=e.getUTCMinutes(),c=e.getUTCSeconds(),f=e.getUTCMilliseconds()):(i=e.getFullYear(),r=e.getMonth(),a=e.getDay(),s=e.getDate(),n=e.getHours(),h=e.getMinutes(),c=e.getSeconds(),f=e.getMilliseconds());for(let o=0,m=t.parts.length;o=12?this._t("PM"):this._t("AM");break;case"aa":l=n>=12?this._t("P.M."):this._t("A.M.");break;case"aaa":l=n>=12?this._t("P"):this._t("A");break;case"h":l=be(n).toString();break;case"hh":l=j(be(n),2,"0");break;case"H":l=n.toString();break;case"HH":l=j(n,2,"0");break;case"K":l=be(n,0).toString();break;case"KK":l=j(be(n,0),2,"0");break;case"k":l=(n+1).toString();break;case"kk":l=j(n+1,2,"0");break;case"m":l=h.toString();break;case"mm":l=j(h,2,"0");break;case"s":l=c.toString();break;case"ss":l=j(c,2,"0");break;case"S":case"SS":case"SSS":l=Math.round(f/1e3*Math.pow(10,t.parts[o].length)).toString();break;case"x":l=b.toString();break;case"n":case"nn":case"nnn":l=j(f,t.parts[o].length,"0");break;case"z":l=de(e,!1,!1,this._root.utc,this._root.timezone?this._root.timezone.name:void 0).replace(/[+-]+[0-9]+$/,"");break;case"zz":l=de(e,!0,!1,this._root.utc,this._root.timezone?this._root.timezone.name:void 0);break;case"zzz":l=de(e,!1,!0,this._root.utc,this._root.timezone?this._root.timezone.name:void 0).replace(/[+-]+[0-9]+$/,"");break;case"zzzz":l=de(e,!0,!0,this._root.utc,this._root.timezone?this._root.timezone.name:void 0);break;case"Z":case"ZZ":let p=this._root.utc?"UTC":this._root.timezone;p instanceof Ut&&(p=p.name);const w=p?Ot(p):e.getTimezoneOffset();let v=Math.abs(w)/60,_=Math.floor(v),P=60*v-60*_;this._root.utc&&(_=0,P=0),t.parts[o]=="Z"?(l="GMT",l+=w>0?"-":"+",l+=j(_,2)+":"+j(P,2)):(l=w>0?"-":"+",l+=j(_,2)+j(P,2));break;case"i":l=e.toISOString();break;case"I":l=e.toUTCString()}u=u.replace(ee,l)}return u}parseFormat(e){let t={template:"",parts:[]},i=U.chunk(e,!0);for(let r=0;r-1&&(n.year=parseInt(u[s.year])),s.year3>-1){let b=parseInt(u[s.year3]);b+=1e3,n.year=b}if(s.year2>-1){let b=parseInt(u[s.year2]);b+=b>50?1e3:2e3,n.year=b}if(s.year1>-1){let b=parseInt(u[s.year1]);b=10*Math.floor(new Date().getFullYear()/10)+b,n.year=b}if(s.monthLong>-1&&(n.month=this.resolveMonth(u[s.monthLong])),s.monthShort>-1&&(n.month=this.resolveShortMonth(u[s.monthShort])),s.month>-1&&(n.month=parseInt(u[s.month])-1),s.week>-1&&s.day===-1&&(n.month=0,n.day=Mt(parseInt(u[s.week]),n.year,1,this._root.utc)),s.day>-1&&(n.day=parseInt(u[s.day])),s.yearDay>-1&&(n.month=0,n.day=parseInt(u[s.yearDay])),s.hourBase0>-1&&(n.hour=parseInt(u[s.hourBase0])),s.hourBase1>-1&&(n.hour=parseInt(u[s.hourBase1])-1),s.hour12Base0>-1){let b=parseInt(u[s.hour12Base0]);b==11&&(b=0),s.am>-1&&!this.isAm(u[s.am])&&(b+=12),n.hour=b}if(s.hour12Base1>-1){let b=parseInt(u[s.hour12Base1]);b==12&&(b=0),s.am>-1&&!this.isAm(u[s.am])&&(b+=12),n.hour=b}if(s.minute>-1&&(n.minute=parseInt(u[s.minute])),s.second>-1&&(n.second=parseInt(u[s.second])),s.millisecond>-1){let b=parseInt(u[s.millisecond]);s.millisecondDigits==2?b*=10:s.millisecondDigits==1&&(b*=100),n.millisecond=b}if(s.timestamp>-1){n.timestamp=parseInt(u[s.timestamp]);const b=new Date(n.timestamp);n.year=b.getUTCFullYear(),n.month=b.getUTCMonth(),n.day=b.getUTCDate(),n.hour=b.getUTCHours(),n.minute=b.getUTCMinutes(),n.second=b.getUTCSeconds(),n.millisecond=b.getUTCMilliseconds()}s.zone>-1&&(n.offset=this.resolveTimezoneOffset(new Date(n.year,n.month,n.day),u[s.zone])),s.iso>-1&&(n.year=V(u[s.iso+0]),n.month=V(u[s.iso+1])-1,n.day=V(u[s.iso+2]),n.hour=V(u[s.iso+3]),n.minute=V(u[s.iso+4]),n.second=V(u[s.iso+5]),n.millisecond=V(u[s.iso+6]),u[s.iso+7]=="Z"||u[s.iso+7]=="z"?n.utc=!0:u[s.iso+7]!=""&&(n.offset=this.resolveTimezoneOffset(new Date(n.year,n.month,n.day),u[s.iso+7]))),i=n.utc?new Date(Date.UTC(n.year,n.month,n.day,n.hour,n.minute,n.second,n.millisecond)):new Date(n.year,n.month,n.day,n.hour,n.minute+n.offset,n.second,n.millisecond)}else i=new Date(e);return i}resolveTimezoneOffset(e,t){if(t.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/)){let i=t.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/),r=i[1],a=i[2],s=i[3],n=60*parseInt(a)+parseInt(s);return r=="+"&&(n*=-1),n-(e||new Date).getTimezoneOffset()}return 0}resolveMonth(e){let t=this._months().indexOf(e);return t>-1||!this._root.language.isDefault()&&(t=this._root.language.translateAll(this._months()).indexOf(e),t>-1)?t:0}resolveShortMonth(e){let t=this._shortMonths().indexOf(e);return t>-1?t:(t=this._months().indexOf(e),t>-1||this._root.language&&!this._root.language.isDefault()&&(t=this._root.language.translateAll(this._shortMonths()).indexOf(e),t>-1)?t:0)}isAm(e){return this.getStringList(["AM","A.M.","A"]).indexOf(e.toUpperCase())>-1}getStringList(e){let t=[];for(let i=0;ithis.get("negativeBase")?s.positive:n{if(n.parsed)return;let h=n.source,c=[];c=n.source.match(/^\[([^\]]*)\]/),c&&c.length&&c[0]!==""&&(h=n.source.substr(c[0].length),n.color=c[1]);let f=U.chunk(h,!0);for(let u=0;u{if(a==t||i){if(r/s<=1)return i||(i=a),!1;i=a}return!0}),i}getMilliseconds(e,t){return t||(t=this.get("baseUnit")),e*this._getUnitValue(t)}_getUnitValue(e){return this._getUnitValues()[e]}_getUnitValues(){return{millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2592e6,year:31536e6}}}const st={firstDayOfWeek:1,_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date:"yyyy-MM-dd",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"AD",_era_bc:"BC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"",February:"",March:"",April:"",May:"",June:"",July:"",August:"",September:"",October:"",November:"",December:"",Jan:"",Feb:"",Mar:"",Apr:"","May(short)":"May",Jun:"",Jul:"",Aug:"",Sep:"",Oct:"",Nov:"",Dec:"",Sunday:"",Monday:"",Tuesday:"",Wednesday:"",Thursday:"",Friday:"",Saturday:"",Sun:"",Mon:"",Tue:"",Wed:"",Thu:"",Fri:"",Sat:"",_dateOrd:function(d){let e="th";if(d<11||d>13)switch(d%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"",Play:"",Stop:"",Legend:"","Press ENTER to toggle":"",Loading:"",Home:"",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Force directed tree":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"",Image:"",Data:"",Print:"","Press ENTER or use arrow keys to navigate":"","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"","From %1":"","To %1":"","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":"",Close:"",Minimize:""};class Gt extends te{_setDefaults(){this.setPrivate("defaultLocale",st),super._setDefaults()}translate(e,t,...i){t||(t=this._root.locale||this.getPrivate("defaultLocale"));let r=e,a=t[e];if(a===null)r="";else if(a!=null)a&&(r=a);else if(t!==this.getPrivate("defaultLocale"))return this.translate(e,this.getPrivate("defaultLocale"),...i);if(i.length)for(let s=i.length,n=0;n{this.setTranslationAny(i,r,t)})}translateEmpty(e,t,...i){let r=this.translate(e,t,...i);return r==e?"":r}translateFunc(e,t){return this._root.locale[e]?this._root.locale[e]:t!==this.getPrivate("defaultLocale")?this.translateFunc(e,this.getPrivate("defaultLocale")):()=>""}translateAll(e,t){return this.isDefault()?e:Tt(e,i=>this.translate(i,t))}isDefault(){return this.getPrivate("defaultLocale")===this._root.locale}}class ke{constructor(e=1,t=0,i=0,r=1,a=0,s=0){Object.defineProperty(this,"a",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"b",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"c",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"d",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ty",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.a=e,this.b=t,this.c=i,this.d=r,this.tx=a,this.ty=s}setTransform(e,t,i,r,a,s=1){this.a=Math.cos(a)*s,this.b=Math.sin(a)*s,this.c=-Math.sin(a)*s,this.d=Math.cos(a)*s,this.tx=e-(i*this.a+r*this.c),this.ty=t-(i*this.b+r*this.d)}apply(e){return{x:this.a*e.x+this.c*e.y+this.tx,y:this.b*e.x+this.d*e.y+this.ty}}applyInverse(e){const t=1/(this.a*this.d+this.c*-this.b);return{x:this.d*t*e.x+-this.c*t*e.y+(this.ty*this.c-this.tx*this.d)*t,y:this.a*t*e.y+-this.b*t*e.x+(-this.ty*this.a+this.tx*this.b)*t}}append(e){const t=this.a,i=this.b,r=this.c,a=this.d;this.a=e.a*t+e.b*r,this.b=e.a*i+e.b*a,this.c=e.c*t+e.d*r,this.d=e.c*i+e.d*a,this.tx=e.tx*t+e.ty*r+this.tx,this.ty=e.tx*i+e.ty*a+this.ty}prepend(e){const t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const i=this.a,r=this.c;this.a=i*e.a+this.b*e.c,this.b=i*e.b+this.b*e.d,this.c=r*e.a+this.d*e.c,this.d=r*e.b+this.d*e.d}this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty}copyFrom(e){this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty}}var Nt=function(){function d(e,t){var i=[],r=!0,a=!1,s=void 0;try{for(var n,h=e[Symbol.iterator]();!(r=(n=h.next()).done)&&(i.push(n.value),!t||i.length!==t);r=!0);}catch(c){a=!0,s=c}finally{try{!r&&h.return&&h.return()}finally{if(a)throw s}}return i}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return d(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),he=2*Math.PI,Ee=function(d,e,t,i,r,a,s){var n=d.x,h=d.y;return{x:i*(n*=e)-r*(h*=t)+a,y:r*n+i*h+s}},qt=function(d,e){var t=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(e/4),i=Math.cos(d),r=Math.sin(d),a=Math.cos(d+e),s=Math.sin(d+e);return[{x:i-r*t,y:r+i*t},{x:a+s*t,y:s-a*t},{x:a,y:s}]},$e=function(d,e,t,i){var r=d*t+e*i;return r>1&&(r=1),r<-1&&(r=-1),(d*i-e*t<0?-1:1)*Math.acos(r)},Zt=function(d,e,t,i,r,a,s,n,h,c,f,u){var b=Math.pow(r,2),o=Math.pow(a,2),m=Math.pow(f,2),l=Math.pow(u,2),g=b*o-b*l-o*m;g<0&&(g=0),g/=b*l+o*m;var p=(g=Math.sqrt(g)*(s===n?-1:1))*r/a*u,w=g*-a/r*f,v=c*p-h*w+(d+t)/2,_=h*p+c*w+(e+i)/2,P=(f-p)/r,L=(u-w)/a,E=(-f-p)/r,S=(-u-w)/a,B=$e(1,0,P,L),O=$e(P,L,E,S);return n===0&&O>0&&(O-=he),n===1&&O<0&&(O+=he),[v,_,B,O]},Kt=function(d){var e=d.px,t=d.py,i=d.cx,r=d.cy,a=d.rx,s=d.ry,n=d.xAxisRotation,h=n===void 0?0:n,c=d.largeArcFlag,f=c===void 0?0:c,u=d.sweepFlag,b=u===void 0?0:u,o=[];if(a===0||s===0)return[];var m=Math.sin(h*he/360),l=Math.cos(h*he/360),g=l*(e-i)/2+m*(t-r)/2,p=-m*(e-i)/2+l*(t-r)/2;if(g===0&&p===0)return[];a=Math.abs(a),s=Math.abs(s);var w=Math.pow(g,2)/Math.pow(a,2)+Math.pow(p,2)/Math.pow(s,2);w>1&&(a*=Math.sqrt(w),s*=Math.sqrt(w));var v=Zt(e,t,i,r,a,s,f,b,m,l,g,p),_=Nt(v,4),P=_[0],L=_[1],E=_[2],S=_[3],B=Math.abs(S)/(he/4);Math.abs(1-B)<1e-7&&(B=1);var O=Math.max(Math.ceil(B),1);S/=O;for(var I=0;I1){const r=/^([01])([01])(.*)$/.exec(i);r!==null&&(d.splice(t,0,r[1]),++t,d.splice(t,0,r[2]),++t,r[3].length>0?d[t]=r[3]:d.splice(t,1))}if(++t,i=d[t],i.length>1){const r=/^([01])(.+)$/.exec(i);r!==null&&(d.splice(t,0,r[1]),++t,d[t]=r[2])}}}function Xe(d){if(d===0||d===1)return d;throw new Error("Flag must be 0 or 1")}function ei(d){const e=[0,0,0];for(let t=0;t<24;t++)e[t%3]<<=1,e[t%3]|=1&d,d>>=1;return(0|e[0])+(e[1]<<8)+(e[2]<<16)}function fe(d,e){for(;(!d.interactive||e(d))&&d._parent;)d=d._parent}function ti(d,e,t){return C(d,je(e),i=>{const r=et(i);let a=i.touches;a?(a.length==0&&(a=i.changedTouches),t(Bt(a),r)):t([i],r)})}function Ge(d){const e=document.createElement("canvas");e.width=1,e.height=1;const t=e.getContext("2d",{willReadFrequently:!0});t.drawImage(d,0,0,1,1);try{return t.getImageData(0,0,1,1),!1}catch{return console.warn('Image "'+d.src+'" is loaded from different host and is not covered by CORS policy. For more information about the implications read here: https://www.amcharts.com/docs/v5/concepts/cors'),!0}}function oe(d){d.width=0,d.height=0,d.style.width="0px",d.style.height="0px"}function Ne(d){return Math.floor(d)+.5}class ii{constructor(){Object.defineProperty(this,"_x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_y",{enumerable:!0,configurable:!0,writable:!0,value:0})}get x(){return this._x}get y(){return this._y}set x(e){this._x=e}set y(e){this._y=e}}class we extends It{constructor(e){super(),Object.defineProperty(this,"_layer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"mask",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"exportable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"interactive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"inactive",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"wheelable",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"cancelTouch",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isMeasured",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"buttonMode",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"alpha",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"compoundAlpha",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"angle",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"scale",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"crisp",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"pivot",{enumerable:!0,configurable:!0,writable:!0,value:new ii}),Object.defineProperty(this,"filter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cursorOverStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_replacedCursorStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_localMatrix",{enumerable:!0,configurable:!0,writable:!0,value:new ke}),Object.defineProperty(this,"_matrix",{enumerable:!0,configurable:!0,writable:!0,value:new ke}),Object.defineProperty(this,"_uMatrix",{enumerable:!0,configurable:!0,writable:!0,value:new ke}),Object.defineProperty(this,"_renderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_localBounds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_bounds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_colorId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._renderer=e}subStatus(e){return{inactive:this.inactive==null?e.inactive:this.inactive,layer:this._layer||e.layer}}_dispose(){this._renderer._removeObject(this),this.getLayer().dirty=!0}getCanvas(){return this.getLayer().view}getLayer(){let e=this;for(;;){if(e._layer)return e._layer;if(!e._parent)return this._renderer.defaultLayer;e=e._parent}}setLayer(e,t){e==null?this._layer=void 0:(this._layer=this._renderer.getLayer(e,!0),this._layer.visible=!0,this._layer.margin=t,t&&J(this._layer.view,!1),this._renderer._ghostLayer.setMargin(this._renderer.layers),this._parent&&this._parent.registerChildLayer(this._layer),this._layer.dirty=!0,this._renderer.resizeLayer(this._layer),this._renderer.resizeGhost())}markDirtyLayer(){this.getLayer().dirty=!0}clear(){this.invalidateBounds()}invalidateBounds(){this._localBounds=void 0}_addBounds(e){}_getColorId(){return this._colorId===void 0&&(this._colorId=this._renderer.paintId(this)),this._colorId}_isInteractive(e){return!e.inactive&&(this.interactive||this._renderer._forceInteractive>0)}_isInteractiveMask(e){return this._isInteractive(e)}contains(e){for(;;){if(e===this)return!0;if(!e._parent)return!1;e=e._parent}}toGlobal(e){return this._matrix.apply(e)}toLocal(e){return this._matrix.applyInverse(e)}getLocalMatrix(){return this._uMatrix.setTransform(0,0,this.pivot.x,this.pivot.y,this.angle*Math.PI/180,this.scale),this._uMatrix}getLocalBounds(){return this._localBounds||(this._localBounds={left:1e7,top:1e7,right:-1e7,bottom:-1e7},this._addBounds(this._localBounds)),this._localBounds}getAdjustedBounds(e){this._setMatrix();const t=this.getLocalMatrix(),i=t.apply({x:e.left,y:e.top}),r=t.apply({x:e.right,y:e.top}),a=t.apply({x:e.right,y:e.bottom}),s=t.apply({x:e.left,y:e.bottom});return{left:Math.min(i.x,r.x,a.x,s.x),top:Math.min(i.y,r.y,a.y,s.y),right:Math.max(i.x,r.x,a.x,s.x),bottom:Math.max(i.y,r.y,a.y,s.y)}}on(e,t,i){return this.interactive?this._renderer._addEvent(this,e,t,i):new X(()=>{})}_setMatrix(){this._localMatrix.setTransform(this.x,this.y,this.pivot.x,this.pivot.y,this.angle*Math.PI/180,this.scale),this._matrix.copyFrom(this._localMatrix),this._parent&&this._matrix.prepend(this._parent._matrix)}_transform(e,t){const i=this._matrix;let r=i.tx*t,a=i.ty*t;this.crisp&&(r=Ne(r),a=Ne(a)),e.setTransform(i.a*t,i.b*t,i.c*t,i.d*t,r,a)}_transformMargin(e,t,i){const r=this._matrix;e.setTransform(r.a*t,r.b*t,r.c*t,r.d*t,(r.tx+i.left)*t,(r.ty+i.top)*t)}_transformLayer(e,t,i){i.margin?this._transformMargin(e,i.scale||t,i.margin):this._transform(e,i.scale||t)}render(e){if(this.visible&&(this.exportable!==!1||!this._renderer._omitTainted)){this._setMatrix();const t=this.subStatus(e),i=this._renderer.resolution,r=this._renderer.layers,a=this._renderer._ghostLayer,s=a.context,n=this.mask;n&&n._setMatrix(),y(r,h=>{if(h){const c=h.context;c.save(),n&&(n._transformLayer(c,i,h),n._runPath(c),c.clip()),c.globalAlpha=this.compoundAlpha*this.alpha,this._transformLayer(c,i,h),this.filter&&(c.filter=this.filter)}}),s.save(),n&&this._isInteractiveMask(t)&&(n._transformMargin(s,i,a.margin),n._runPath(s),s.clip()),this._transformMargin(s,i,a.margin),this._render(t),s.restore(),y(r,h=>{h&&h.context.restore()})}}_render(e){this.exportable===!1&&(e.layer.tainted=!0)}hovering(){return this._renderer._hovering.has(this)}dragging(){return this._renderer._dragging.some(e=>e.value===this)}shouldCancelTouch(){const e=this._renderer;return!(e.tapToActivate&&!e._touchActive)&&(!!this.cancelTouch||!!this._parent&&this._parent.shouldCancelTouch())}}class ri extends we{constructor(){super(...arguments),Object.defineProperty(this,"interactiveChildren",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_childLayers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_children",{enumerable:!0,configurable:!0,writable:!0,value:[]})}_isInteractiveMask(e){return this.interactiveChildren||super._isInteractiveMask(e)}addChild(e){e._parent=this,this._children.push(e),e._layer&&this.registerChildLayer(e._layer)}addChildAt(e,t){e._parent=this,this._children.splice(t,0,e),e._layer&&this.registerChildLayer(e._layer)}removeChild(e){e._parent=void 0,De(this._children,e)}_render(e){super._render(e);const t=this._renderer;this.interactive&&this.interactiveChildren&&++t._forceInteractive,y(this._children,i=>{i.compoundAlpha=this.compoundAlpha*this.alpha,i.render(e)}),this.interactive&&this.interactiveChildren&&--t._forceInteractive}registerChildLayer(e){this._childLayers||(this._childLayers=[]),Te(this._childLayers,e),this._parent&&this._parent.registerChildLayer(e)}markDirtyLayer(e=!1){super.markDirtyLayer(),e&&this._childLayers&&y(this._childLayers,t=>t.dirty=!0)}_dispose(){super._dispose(),this._childLayers&&y(this._childLayers,e=>{e.dirty=!0})}}function M(d,e){d.left=Math.min(d.left,e.x),d.top=Math.min(d.top,e.y),d.right=Math.max(d.right,e.x),d.bottom=Math.max(d.bottom,e.y)}class T{colorize(e,t){}path(e){}addBounds(e){}}class si extends T{colorize(e,t){e.beginPath()}}class Me extends T{constructor(e){super(),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.fillStyle=t!==void 0?t:this.color}}class ai extends T{constructor(e){super(),Object.defineProperty(this,"clearShadow",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.fill(),this.clearShadow&&(e.shadowColor="",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}}class ni extends T{colorize(e,t){e.stroke()}}class Se extends T{constructor(e,t,i){super(),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"lineJoin",{enumerable:!0,configurable:!0,writable:!0,value:i})}colorize(e,t){e.strokeStyle=t!==void 0?t:this.color,e.lineWidth=this.width,this.lineJoin&&(e.lineJoin=this.lineJoin)}}class oi extends T{constructor(e){super(),Object.defineProperty(this,"dash",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.setLineDash(this.dash)}}class li extends T{constructor(e){super(),Object.defineProperty(this,"dashOffset",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.lineDashOffset=this.dashOffset}}class hi extends T{constructor(e,t,i,r){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.rect(this.x,this.y,this.width,this.height)}addBounds(e){const t=this.x,i=this.y,r=t+this.width,a=i+this.height;M(e,{x:t,y:i}),M(e,{x:r,y:i}),M(e,{x:t,y:a}),M(e,{x:r,y:a})}}class ui extends T{constructor(e,t,i){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:i})}path(e){e.moveTo(this.x+this.radius,this.y),e.arc(this.x,this.y,this.radius,0,2*Math.PI)}addBounds(e){M(e,{x:this.x-this.radius,y:this.y-this.radius}),M(e,{x:this.x+this.radius,y:this.y+this.radius})}}class ci extends T{constructor(e,t,i,r){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radiusX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"radiusY",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.ellipse(0,0,this.radiusX,this.radiusY,0,0,2*Math.PI)}addBounds(e){M(e,{x:this.x-this.radiusX,y:this.y-this.radiusY}),M(e,{x:this.x+this.radiusX,y:this.y+this.radiusY})}}class di extends T{constructor(e,t,i,r,a,s){super(),Object.defineProperty(this,"cx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cy",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"startAngle",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"endAngle",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"anticlockwise",{enumerable:!0,configurable:!0,writable:!0,value:s})}path(e){this.radius>0&&e.arc(this.cx,this.cy,this.radius,this.startAngle,this.endAngle,this.anticlockwise)}addBounds(e){let t=Rt(this.cx,this.cy,this.startAngle*le,this.endAngle*le,this.radius);M(e,{x:t.left,y:t.top}),M(e,{x:t.right,y:t.bottom})}}class bi extends T{constructor(e,t,i,r,a){super(),Object.defineProperty(this,"x1",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y1",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"x2",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"y2",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:a})}path(e){this.radius>0&&e.arcTo(this.x1,this.y1,this.x2,this.y2,this.radius)}addBounds(e){}}class _i extends T{constructor(e,t){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t})}path(e){e.lineTo(this.x,this.y)}addBounds(e){M(e,{x:this.x,y:this.y})}}class fi extends T{constructor(e,t){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t})}path(e){e.moveTo(this.x,this.y)}addBounds(e){M(e,{x:this.x,y:this.y})}}class gi extends T{path(e){e.closePath()}}class mi extends T{constructor(e,t,i,r,a,s){super(),Object.defineProperty(this,"cpX",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cpY",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"cpX2",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"cpY2",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"toX",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"toY",{enumerable:!0,configurable:!0,writable:!0,value:s})}path(e){e.bezierCurveTo(this.cpX,this.cpY,this.cpX2,this.cpY2,this.toX,this.toY)}addBounds(e){M(e,{x:this.cpX,y:this.cpY}),M(e,{x:this.cpX2,y:this.cpY2}),M(e,{x:this.toX,y:this.toY})}}class pi extends T{constructor(e,t,i,r){super(),Object.defineProperty(this,"cpX",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cpY",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"toX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"toY",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.quadraticCurveTo(this.cpX,this.cpY,this.toX,this.toY)}addBounds(e){M(e,{x:this.cpX,y:this.cpY}),M(e,{x:this.toX,y:this.toY})}}class yi extends T{constructor(e,t,i,r,a){super(),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"blur",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"offsetX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"offsetY",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"opacity",{enumerable:!0,configurable:!0,writable:!0,value:a})}colorize(e,t){this.opacity&&(e.fillStyle=this.color),e.shadowColor=this.color,e.shadowBlur=this.blur,e.shadowOffsetX=this.offsetX,e.shadowOffsetY=this.offsetY}}class vi extends T{constructor(e,t,i,r,a){super(),Object.defineProperty(this,"image",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:a})}path(e){e.drawImage(this.image,this.x,this.y,this.width,this.height)}addBounds(e){M(e,{x:this.x,y:this.y}),M(e,{x:this.width,y:this.height})}}class wi extends we{constructor(){super(...arguments),Object.defineProperty(this,"_operations",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"blendMode",{enumerable:!0,configurable:!0,writable:!0,value:At.NORMAL}),Object.defineProperty(this,"_hasShadows",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_fillAlpha",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeAlpha",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}clear(){super.clear(),this._operations.length=0}_pushOp(e){this._operations.push(e)}beginFill(e,t=1){this._fillAlpha=t,e?e instanceof G?this._pushOp(new Me(e.toCSS(t))):(this.isMeasured=!0,this._pushOp(new Me(e))):this._pushOp(new Me("rgba(0, 0, 0, "+t+")"))}endFill(){this._pushOp(new ai(this._hasShadows))}endStroke(){this._pushOp(new ni)}beginPath(){this._pushOp(new si)}lineStyle(e=0,t,i=1,r){this._strokeAlpha=i,t?t instanceof G?this._pushOp(new Se(e,t.toCSS(i),r)):this._pushOp(new Se(e,t,r)):this._pushOp(new Se(e,"rgba(0, 0, 0, "+i+")",r))}setLineDash(e){this._pushOp(new oi(e||[]))}setLineDashOffset(e=0){this._pushOp(new li(e))}drawRect(e,t,i,r){this._pushOp(new hi(e,t,i,r))}drawCircle(e,t,i){this._pushOp(new ui(e,t,i))}drawEllipse(e,t,i,r){this._pushOp(new ci(e,t,i,r))}arc(e,t,i,r,a,s=!1){this._pushOp(new di(e,t,i,r,a,s))}arcTo(e,t,i,r,a){this._pushOp(new bi(e,t,i,r,a))}lineTo(e,t){this._pushOp(new _i(e,t))}moveTo(e,t){this._pushOp(new fi(e,t))}bezierCurveTo(e,t,i,r,a,s){this._pushOp(new mi(e,t,i,r,a,s))}quadraticCurveTo(e,t,i,r){this._pushOp(new pi(e,t,i,r))}closePath(){this._pushOp(new gi)}shadow(e,t=0,i=0,r=0,a){this._hasShadows=!0,this._pushOp(new yi(a?e.toCSS(a):e.toCSS(this._fillAlpha||this._strokeAlpha),t,i,r))}image(e,t,i,r,a){this._pushOp(new vi(e,t,i,r,a))}svgPath(e){let t=0,i=0,r=null,a=null,s=null,n=null;const h=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,c=/[\u0009\u0020\u000A\u000C\u000D]*([\+\-]?[0-9]*\.?[0-9]+(?:[eE][\+\-]?[0-9]+)?)[\u0009\u0020\u000A\u000C\u000D]*,?/g;let f;for(;(f=h.exec(e))!==null;){const u=f[1],b=f[2],o=[];for(;(f=c.exec(b))!==null;)o.push(f[1]);switch(u!=="S"&&u!=="s"&&u!=="C"&&u!=="c"&&(r=null,a=null),u!=="Q"&&u!=="q"&&u!=="T"&&u!=="t"&&(s=null,n=null),u){case"M":z(u,o.length,2),t=+o[0],i=+o[1],this.moveTo(t,i);for(let l=2;l{this.bezierCurveTo(v.x1,v.y1,v.x2,v.y2,v.x,v.y),t=v.x,i=v.y})}break;case"Z":case"z":Jt(u,o.length,0),this.closePath()}}}_runPath(e){e.beginPath(),y(this._operations,t=>{t.path(e)})}_render(e){super._render(e);const t=e.layer.dirty,i=this._isInteractive(e);if(t||i){const r=e.layer.context,a=this._renderer._ghostLayer.context;let s;t&&(r.globalCompositeOperation=this.blendMode,r.beginPath()),i&&(a.beginPath(),s=this._getColorId()),y(this._operations,n=>{t&&(n.path(r),n.colorize(r,void 0)),i&&(n.path(a),n.colorize(a,s))})}}renderDetached(e){if(this.visible){this._setMatrix(),e.save();const t=this.mask;t&&(t._setMatrix(),t._transform(e,1),t._runPath(e),e.clip()),e.globalAlpha=this.compoundAlpha*this.alpha,this._transform(e,1),this.filter&&(e.filter=this.filter),e.globalCompositeOperation=this.blendMode,e.beginPath(),y(this._operations,i=>{i.path(e),i.colorize(e,void 0)}),e.restore()}}_addBounds(e){this.visible&&this.isMeasured&&y(this._operations,t=>{t.addBounds(e)})}}class at extends we{constructor(e,t,i){super(e),Object.defineProperty(this,"text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolution",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"textVisible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_textInfo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_originalScale",{enumerable:!0,configurable:!0,writable:!0,value:1}),this.text=t,this.style=i}invalidateBounds(){super.invalidateBounds(),this._textInfo=void 0}_shared(e){this.style.textAlign&&(e.textAlign=this.style.textAlign),this.style.direction&&(e.direction=this.style.direction),this.style.textBaseline&&(e.textBaseline=this.style.textBaseline)}_prerender(e,t=!1,i=!1){super._render(e);const r=e.layer.context,a=this._renderer._ghostLayer.context,s=this.style;let n=this._getFontStyle(void 0,i);r.font=n,this._isInteractive(e)&&!t&&(a.font=n),s.fill&&(s.fill instanceof G?r.fillStyle=s.fill.toCSS(s.fillOpacity!=null?s.fillOpacity:1):r.fillStyle=s.fill),s.shadowColor&&(e.layer.context.shadowColor=s.shadowColor.toCSS(s.shadowOpacity||1)),s.shadowBlur&&(e.layer.context.shadowBlur=s.shadowBlur),s.shadowOffsetX&&(e.layer.context.shadowOffsetX=s.shadowOffsetX),s.shadowOffsetY&&(e.layer.context.shadowOffsetY=s.shadowOffsetY),this._shared(r),this._isInteractive(e)&&!t&&(a.fillStyle=this._getColorId(),this._shared(a))}_getFontStyle(e,t=!1){const i=this.style;let r=[];return e&&e.fontVariant?r.push(e.fontVariant):i.fontVariant&&r.push(i.fontVariant),t||(e&&e.fontWeight?r.push(e.fontWeight):i.fontWeight&&r.push(i.fontWeight)),e&&e.fontStyle?r.push(e.fontStyle):i.fontStyle&&r.push(i.fontStyle),e&&e.fontSize?(H(e.fontSize)&&(e.fontSize=e.fontSize+"px"),r.push(e.fontSize)):i.fontSize&&(H(i.fontSize)&&(i.fontSize=i.fontSize+"px"),r.push(i.fontSize)),e&&e.fontFamily?r.push(e.fontFamily):i.fontFamily?r.push(i.fontFamily):r.length&&r.push("Arial"),r.join(" ")}_render(e){if(this._textInfo||this._measure(e),this.textVisible){const t=this._isInteractive(e),i=e.layer.context,r=e.layer.dirty,a=this._renderer._ghostLayer.context;i.save(),a.save(),this._prerender(e),y(this._textInfo,(s,n)=>{y(s.textChunks,(h,c)=>{if(h.style&&(i.save(),a.save(),i.font=h.style,this._isInteractive(e)&&(a.font=h.style)),h.fill&&(i.save(),i.fillStyle=h.fill.toCSS()),r&&i.fillText(h.text,h.offsetX,s.offsetY+h.offsetY),h.textDecoration=="underline"||h.textDecoration=="line-through"){let f,u=1,b=1,o=h.height,m=h.offsetX;switch(this.style.textAlign){case"right":case"end":m-=h.width;break;case"center":m-=h.width/2}if(h.style)switch(U.getTextStyle(h.style).fontWeight){case"bolder":case"bold":case"700":case"800":case"900":u=2}o&&(b=o/20),f=h.textDecoration=="line-through"?u+s.offsetY+h.offsetY-h.height/2:u+1.5*b+s.offsetY+h.offsetY,i.save(),i.beginPath(),h.fill?i.strokeStyle=h.fill.toCSS():this.style.fill&&this.style.fill instanceof G&&(i.strokeStyle=this.style.fill.toCSS()),i.lineWidth=u*b,i.moveTo(m,f),i.lineTo(m+h.width,f),i.stroke(),i.restore()}t&&this.interactive&&a.fillText(h.text,h.offsetX,s.offsetY+h.offsetY),h.fill&&i.restore(),h.style&&(i.restore(),a.restore())})}),i.restore(),a.restore()}}_addBounds(e){if(this.visible&&this.isMeasured){const t=this._measure({inactive:this.inactive,layer:this.getLayer()});M(e,{x:t.left,y:t.top}),M(e,{x:t.right,y:t.bottom})}}_ignoreFontWeight(){return/apple/i.test(navigator.vendor)}_measure(e){const t=e.layer.context,i=this._renderer._ghostLayer.context,r=this.style.direction=="rtl";this._textInfo=[];const a=this.style.oversizedBehavior,s=this.style.maxWidth,n=H(s)&&a=="truncate",h=H(s)&&(a=="wrap"||a=="wrap-no-break");t.save(),i.save(),this._prerender(e,!0,this._ignoreFontWeight());const c="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",f=this.text.toString().replace(/\r/g,"").split(/\n/);let u,b=!0,o=0,m=0,l=0;y(f,(p,w)=>{let v;for(v=p==""?[{type:"value",text:""}]:U.chunk(p,!1,this.style.ignoreFormatting);v.length>0;){let _={offsetY:l,ascent:0,width:0,height:0,left:0,right:0,textChunks:[]};const P=this._measureText(c,t),L=P.actualBoundingBoxAscent+P.actualBoundingBoxDescent;let E;_.height=L,_.ascent=P.actualBoundingBoxAscent;let S,B,O,I=this.style.textDecoration,A=!1,Y=!0,N=[];tt(v,(D,ce)=>{if(D.type=="format")if(D.text=="[/]")b||(t.restore(),i.restore(),b=!0),S=void 0,u=void 0,B=void 0,I=this.style.textDecoration,O=void 0,E=D.text;else{b||(t.restore(),i.restore());let k=U.getTextStyle(D.text);const R=this._getFontStyle(k);t.save(),i.save(),t.font=R,u=R,E=D.text,k.textDecoration&&(I=k.textDecoration),k.fill&&(S=k.fill),k.width&&(B=V(k.width)),k.verticalAlign&&(O=k.verticalAlign),b=!1;const F=this._measureText(c,t),q=F.actualBoundingBoxAscent+F.actualBoundingBoxDescent;q>_.height&&(_.height=q),F.actualBoundingBoxAscent>_.ascent&&(_.ascent=F.actualBoundingBoxAscent)}else if(D.type=="value"&&!A){const k=this._measureText(D.text,t);let R=k.actualBoundingBoxLeft+k.actualBoundingBoxRight;if(n){let W=Y||this.style.breakWords||!1;const $=this.style.ellipsis||"",Le=this._measureText($,t),nt=Le.actualBoundingBoxLeft+Le.actualBoundingBoxRight;if(_.width+R>s){const ot=s-_.width-nt;D.text=this._truncateText(t,D.text,ot,W),D.text+=$,A=!0}}else if(h&&_.width+R>s){const W=s-_.width,$=this._truncateText(t,D.text,W,!1,Y&&this.style.oversizedBehavior!="wrap-no-break");if($=="")return this.textVisible=!0,!1;N=v.slice(ce+1),Pe($)!=Pe(D.text)&&(N.unshift({type:"value",text:D.text.substr($.length)}),E&&N.unshift({type:"format",text:E})),D.text=Pe($),v=[],A=!0}let F=1,q=1;if(u&&B&&B>R){const W=R/B;switch(this.style.textAlign){case"right":case"end":F=W;break;case"center":F=W,q=W;break;default:q=W}R=B}const xe=k.actualBoundingBoxAscent+k.actualBoundingBoxDescent;xe>_.height&&(_.height=xe),k.actualBoundingBoxAscent>_.ascent&&(_.ascent=k.actualBoundingBoxAscent),_.width+=R,_.left+=k.actualBoundingBoxLeft/F,_.right+=k.actualBoundingBoxRight/q,_.textChunks.push({style:u,fill:S,text:D.text,width:R,height:xe,left:k.actualBoundingBoxLeft,right:k.actualBoundingBoxRight,ascent:k.actualBoundingBoxAscent,offsetX:0,offsetY:0,textDecoration:I,verticalAlign:O}),Y=!1}return!0}),this.style.lineHeight instanceof it?(_.height*=this.style.lineHeight.value,_.ascent*=this.style.lineHeight.value):(_.height*=this.style.lineHeight||1.2,_.ascent*=this.style.lineHeight||1.2),o<_.left&&(o=_.left),m<_.right&&(m=_.right),this._textInfo.push(_),l+=_.height,v=N||[]}}),b||(t.restore(),i.restore()),y(this._textInfo,(p,w)=>{let v=0;y(p.textChunks,_=>{if(_.offsetX=v+_.left-p.left,_.offsetY+=p.height-p.height*(this.style.baselineRatio||.19),v+=_.width,_.verticalAlign)switch(_.verticalAlign){case"super":_.offsetY-=p.height/2-_.height/2;break;case"sub":_.offsetY+=_.height/2}})});const g={left:r?-m:-o,top:0,right:r?o:m,bottom:l};if(a!=="none"){const p=this._fitRatio(g);if(p<1)if(a=="fit")H(this.style.minScale)&&pi&&t!="");return t}_measureText(e,t){let i=t.measureText(e),r={};if(i.actualBoundingBoxAscent==null){const s=document.createElement("div");s.innerText=e,s.style.visibility="hidden",s.style.position="absolute",s.style.top="-1000000px;",s.style.fontFamily=this.style.fontFamily||"",s.style.fontSize=this.style.fontSize+"",document.body.appendChild(s);const n=s.getBoundingClientRect();document.body.removeChild(s);const h=n.height,c=i.width;r={actualBoundingBoxAscent:h,actualBoundingBoxDescent:0,actualBoundingBoxLeft:0,actualBoundingBoxRight:c,fontBoundingBoxAscent:h,fontBoundingBoxDescent:0,width:c}}else r={actualBoundingBoxAscent:i.actualBoundingBoxAscent,actualBoundingBoxDescent:i.actualBoundingBoxDescent,actualBoundingBoxLeft:i.actualBoundingBoxLeft,actualBoundingBoxRight:i.actualBoundingBoxRight,fontBoundingBoxAscent:i.actualBoundingBoxAscent,fontBoundingBoxDescent:i.actualBoundingBoxDescent,width:i.width};const a=i.width;switch(this.style.textAlign){case"right":case"end":r.actualBoundingBoxLeft=a,r.actualBoundingBoxRight=0;break;case"center":r.actualBoundingBoxLeft=a/2,r.actualBoundingBoxRight=a/2;break;default:r.actualBoundingBoxLeft=0,r.actualBoundingBoxRight=a}return r}}class xi{constructor(){Object.defineProperty(this,"fill",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fillOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textAlign",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontFamily",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontWeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontVariant",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textDecoration",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowBlur",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lineHeight",{enumerable:!0,configurable:!0,writable:!0,value:Ke(120)}),Object.defineProperty(this,"baselineRatio",{enumerable:!0,configurable:!0,writable:!0,value:.19}),Object.defineProperty(this,"direction",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textBaseline",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"oversizedBehavior",{enumerable:!0,configurable:!0,writable:!0,value:"none"}),Object.defineProperty(this,"breakWords",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"ellipsis",{enumerable:!0,configurable:!0,writable:!0,value:"…"}),Object.defineProperty(this,"maxWidth",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxHeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"minScale",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ignoreFormatting",{enumerable:!0,configurable:!0,writable:!0,value:!1})}}class Pi extends at{constructor(){super(...arguments),Object.defineProperty(this,"textType",{enumerable:!0,configurable:!0,writable:!0,value:"circular"}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"startAngle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inside",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"orientation",{enumerable:!0,configurable:!0,writable:!0,value:"auto"}),Object.defineProperty(this,"kerning",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_textReversed",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_render(e){this.textType==="circular"?this._renderCircular(e):super._render(e)}_renderCircular(e){if(this.textVisible){this._prerender(e);const t=this._isInteractive(e),i=e.layer.context,r=e.layer.dirty,a=this._renderer._ghostLayer.context;i.save(),t&&a.save(),this._textInfo||this._measure(e);let s=this.radius||0,n=this.startAngle||0,h=0,c=this.orientation,f=c=="auto"?"auto":c=="inward";const u=this.inside,b=this.style.textAlign||"left",o=this.kerning||0;let m=b=="left"?1:-1;const l=!this._textReversed;if(f=="auto"){let g=0,p=0;y(this._textInfo,(w,v)=>{const _=n+w.width/(s-w.height)/2*-m;_>g&&(g=_)}),p=b=="left"?(g+h/2)*le:b=="right"?(g-h/2)*le:n*le,p=Lt(p),f=p>=270||p<=90}f==1&&l&&(this._textInfo.reverse(),this._textReversed=!0),y(this._textInfo,(g,p)=>{const w=g.height;u||(s+=w),(m==-1&&f||m==1&&!f)&&l&&g.textChunks.reverse();let v=n;h=0,b=="center"&&(v+=g.width/(s-w)/2*-m,h=v-n),v+=Math.PI*(f?0:1),i.save(),t&&a.save(),i.rotate(v),t&&a.rotate(v);let _=0;y(g.textChunks,(P,L)=>{const E=P.text,S=P.width;_=S/2/(s-w)*m,i.rotate(_),t&&a.rotate(_),P.style&&(i.save(),a.save(),i.font=P.style,t&&(a.font=P.style)),P.fill&&(i.save(),i.fillStyle=P.fill.toCSS()),i.textBaseline="middle",i.textAlign="center",t&&(a.textBaseline="middle",a.textAlign="center"),r&&i.fillText(E,0,(f?1:-1)*(0-s+w/2)),t&&a.fillText(E,0,(f?1:-1)*(0-s+w/2)),P.fill&&i.restore(),P.style&&(i.restore(),a.restore()),_=(S/2+o)/(s-w)*m,i.rotate(_),t&&a.rotate(_)}),i.restore(),t&&a.restore(),u&&(s-=w)}),i.restore(),t&&a.restore()}}_measure(e){return this.textType==="circular"?this._measureCircular(e):super._measure(e)}_measureCircular(e){const t=e.layer.context,i=this._renderer._ghostLayer.context,r=this.style.direction=="rtl",a=this.style.oversizedBehavior,s=this.style.maxWidth,n=H(s)&&a=="truncate",h=this.style.ellipsis||"";let c;this.textVisible=!0,this._textInfo=[],this._textReversed=!1,t.save(),i.save(),this._prerender(e,!0);const f=this.text.toString().replace(/\r/g,"").split(/\n/);let u=!0,b=0,o=0;return y(f,(m,l)=>{let g,p,w,v=U.chunk(m,!1,this.style.ignoreFormatting),_={offsetY:o,ascent:0,width:0,height:0,left:0,right:0,textChunks:[]};y(v,(P,L)=>{if(P.type=="format"){if(P.text=="[/]")u||(t.restore(),i.restore(),u=!0),p=void 0,g=void 0,w=void 0;else{let E=U.getTextStyle(P.text);const S=this._getFontStyle(E);t.save(),i.save(),t.font=S,g=S,E.fill&&(p=E.fill),E.width&&(w=V(E.width)),u=!1}n&&(c=this._measureText(h,t))}else if(P.type=="value"){const E=P.text.match(/./gu)||[];r&&E.reverse();for(let S=0;SI&&(I=w);const A=O.actualBoundingBoxAscent+O.actualBoundingBoxDescent;if(A>_.height&&(_.height=A),O.actualBoundingBoxAscent>_.ascent&&(_.ascent=O.actualBoundingBoxAscent),b+=I,n){c||(c=this._measureText(h,t));const Y=c.actualBoundingBoxLeft+c.actualBoundingBoxRight;if(b+Y>s){_.textChunks.length==1?this.textVisible=!1:(_.width+=Y,_.left+=c.actualBoundingBoxLeft,_.right+=c.actualBoundingBoxRight,_.textChunks.push({style:g,fill:p,text:h,width:Y,height:A+c.actualBoundingBoxDescent,left:c.actualBoundingBoxLeft,right:c.actualBoundingBoxRight,ascent:c.actualBoundingBoxAscent,offsetX:0,offsetY:A,textDecoration:void 0}));break}}if(_.width+=I,_.left+=O.actualBoundingBoxLeft,_.right+=O.actualBoundingBoxRight,_.textChunks.push({style:g,fill:p,text:B,width:I,height:A+O.actualBoundingBoxDescent,left:O.actualBoundingBoxLeft,right:O.actualBoundingBoxRight,ascent:O.actualBoundingBoxAscent,offsetX:0,offsetY:A,textDecoration:void 0}),r)break}}}),this.style.lineHeight instanceof it?_.height*=this.style.lineHeight.value:_.height*=this.style.lineHeight||1.2,this._textInfo.push(_),o+=_.height}),u||(t.restore(),i.restore()),a=="hide"&&b>s&&(this.textVisible=!1),y(this._textInfo,m=>{y(m.textChunks,l=>{l.offsetY+=Math.round((m.height-l.height+(m.ascent-l.ascent))/2)})}),t.restore(),i.restore(),{left:0,top:0,right:0,bottom:0}}}class Oi extends we{constructor(e,t){super(e),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"image",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tainted",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowBlur",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_imageMask",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.image=t}_dispose(){super._dispose(),this._imageMask&&oe(this._imageMask)}getLocalBounds(){if(!this._localBounds){let e=0,t=0;this.width&&(e=this.width),this.height&&(t=this.height),this._localBounds={left:0,top:0,right:e,bottom:t},this._addBounds(this._localBounds)}return this._localBounds}_render(e){if(super._render(e),this.image){if(this.tainted===void 0&&(this.tainted=Ge(this.image),e.layer.tainted=!0),this.tainted&&this._renderer._omitTainted)return;if(e.layer.dirty){this.shadowColor&&(e.layer.context.shadowColor=this.shadowColor.toCSS(this.shadowOpacity||1)),this.shadowBlur&&(e.layer.context.shadowBlur=this.shadowBlur),this.shadowOffsetX&&(e.layer.context.shadowOffsetX=this.shadowOffsetX),this.shadowOffsetY&&(e.layer.context.shadowOffsetY=this.shadowOffsetY);const t=this.width||this.image.naturalWidth,i=this.height||this.image.naturalHeight;e.layer.context.drawImage(this.image,0,0,t,i)}if(this.interactive&&this._isInteractive(e)){const t=this._getMask(this.image);this._renderer._ghostLayer.context.drawImage(t,0,0)}}}clear(){super.clear(),this.image=void 0,this._imageMask=void 0}_getMask(e){if(this._imageMask===void 0){const t=this.width||e.naturalWidth,i=this.height||e.naturalHeight,r=document.createElement("canvas");r.width=t,r.height=i;const a=r.getContext("2d");a.imageSmoothingEnabled=!1,a.fillStyle=this._getColorId(),a.fillRect(0,0,t,i),Ge(e)||(a.globalCompositeOperation="destination-in",a.drawImage(e,0,0,t,i)),this._imageMask=r}return this._imageMask}}class ki{constructor(e,t,i,r){Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"originalPoint",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"point",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"bbox",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"simulated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"native",{enumerable:!0,configurable:!0,writable:!0,value:!0}),me("touchevents")&&e instanceof Touch?this.id=e.identifier:this.id=null}}class Ei extends jt{constructor(e){if(super(),Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("div")}),Object.defineProperty(this,"_layerDom",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("div")}),Object.defineProperty(this,"layers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_dirtyLayers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"defaultLayer",{enumerable:!0,configurable:!0,writable:!0,value:this.getLayer(0)}),Object.defineProperty(this,"_ghostLayer",{enumerable:!0,configurable:!0,writable:!0,value:new Mi}),Object.defineProperty(this,"_patternCanvas",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("canvas")}),Object.defineProperty(this,"_patternContext",{enumerable:!0,configurable:!0,writable:!0,value:this._patternCanvas.getContext("2d")}),Object.defineProperty(this,"_realWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_realHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_calculatedWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_calculatedHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"resolution",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"interactionsEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_listeners",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_events",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_colorId",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_colorMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_forceInteractive",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_omitTainted",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_hovering",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"_dragging",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_mousedown",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_lastPointerMoveEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tapToActivate",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"tapToActivateTimeout",{enumerable:!0,configurable:!0,writable:!0,value:3e3}),Object.defineProperty(this,"_touchActive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_touchActiveTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.resolution=e??window.devicePixelRatio,this.view.style.position="absolute",this.view.setAttribute("aria-hidden","true"),this.view.appendChild(this._layerDom),this._disposers.push(new X(()=>{ue(this._events,(t,i)=>{i.disposer.dispose()}),y(this.layers,t=>{oe(t.view),t.exportableView&&oe(t.exportableView)}),oe(this._ghostLayer.view),oe(this._patternCanvas)})),this._disposers.push(Je(()=>{e==null&&(this.resolution=window.devicePixelRatio)})),me("touchevents")){const t=i=>{this._dragging.length!==0&&tt(this._dragging,r=>!r.value.shouldCancelTouch()||(i.preventDefault(),!1)),this._touchActiveTimeout&&this._delayTouchDeactivate()};this._disposers.push(C(window,"touchstart",t,{passive:!1})),this._disposers.push(C(this.view,"touchstart",t,{passive:!1})),this._disposers.push(C(this.view,"touchmove",()=>{this._touchActiveTimeout&&this._delayTouchDeactivate()},{passive:!0})),this._disposers.push(C(window,"click",i=>{this._touchActive=!1},{passive:!0})),this._disposers.push(C(this.view,"click",i=>{window.setTimeout(()=>{this._touchActive=!0,this._delayTouchDeactivate()},100)},{passive:!0}))}me("wheelevents")&&this._disposers.push(C(this.view,"wheel",t=>{let i=!1;this._hovering.forEach(r=>{if(r.wheelable)return i=!0,!1}),i&&t.preventDefault()},{passive:!1}))}resetImageArray(){this._ghostLayer.imageArray=void 0}_delayTouchDeactivate(){this._touchActiveTimeout&&clearTimeout(this._touchActiveTimeout),this.tapToActivateTimeout>0&&(this._touchActiveTimeout=window.setTimeout(()=>{this._touchActive=!1},this.tapToActivateTimeout))}get debugGhostView(){return!!this._ghostLayer.view.parentNode}set debugGhostView(e){e?this._ghostLayer.view.parentNode||this.view.appendChild(this._ghostLayer.view):this._ghostLayer.view.parentNode&&this._ghostLayer.view.parentNode.removeChild(this._ghostLayer.view)}createLinearGradient(e,t,i,r){return this.defaultLayer.context.createLinearGradient(e,t,i,r)}createRadialGradient(e,t,i,r,a,s){return this.defaultLayer.context.createRadialGradient(e,t,i,r,a,s)}createPattern(e,t,i,r,a){return this._patternCanvas.width=r,this._patternCanvas.height=a,this._patternContext.clearRect(0,0,r,a),t.renderDetached(this._patternContext),e.renderDetached(this._patternContext),this._patternContext.createPattern(this._patternCanvas,i)}makeContainer(){return new ri(this)}makeGraphics(){return new wi(this)}makeText(e,t){return new at(this,e,t)}makeTextStyle(){return new xi}makeRadialText(e,t){return new Pi(this,e,t)}makePicture(e){return new Oi(this,e)}resizeLayer(e){e.resize(this._calculatedWidth,this._calculatedHeight,this._calculatedWidth,this._calculatedHeight,this.resolution)}resizeGhost(){this._ghostLayer.resize(this._calculatedWidth,this._calculatedHeight,this._calculatedWidth,this._calculatedHeight,this.resolution)}resize(e,t,i,r){this._realWidth=e,this._realHeight=t,this._calculatedWidth=i,this._calculatedHeight=r,y(this.layers,a=>{a&&(a.dirty=!0,this.resizeLayer(a))}),this.resizeGhost(),this.view.style.width=i+"px",this.view.style.height=r+"px"}createDetachedLayer(e=!1){const t=document.createElement("canvas"),i=t.getContext("2d",{willReadFrequently:e}),r=new Si(t,i);return t.style.position="absolute",t.style.top="0px",t.style.left="0px",r}getLayerByOrder(e){const t=this.layers,i=t.length;for(let r=0;rh.order>c.order?1:h.order{t&&t.dirty&&t.visible&&(this._dirtyLayers.push(t),t.clear())}),this._ghostLayer.clear(),e.render({inactive:null,layer:this.defaultLayer}),this._ghostLayer.context.restore(),y(this.layers,t=>{if(t){const i=t.context;i.beginPath(),i.moveTo(0,0),i.stroke()}}),y(this._dirtyLayers,t=>{t.context.restore(),t.dirty=!1}),this._hovering.size&&this._lastPointerMoveEvent){const{events:t,target:i,native:r}=this._lastPointerMoveEvent;y(t,a=>{this._dispatchGlobalMousemove(a,i,r)})}}paintId(e){const t=ei(++this._colorId),i=G.fromHex(t).toCSS();return this._colorMap[i]=e,i}_removeObject(e){e._colorId!==void 0&&delete this._colorMap[e._colorId]}_adjustBoundingBox(e){const t=this._ghostLayer.margin;return new DOMRect(-t.left,-t.top,e.width+t.left+t.right,e.height+t.top+t.bottom)}getEvent(e,t=!0){const i=this.view.getBoundingClientRect(),r=e.clientX||0,a=e.clientY||0,s=this._calculatedWidth/this._realWidth,n=this._calculatedHeight/this._realHeight,h={x:r-i.left,y:a-i.top},c={x:(r-(t?i.left:0))*s,y:(a-(t?i.top:0))*n};return new ki(e,h,c,this._adjustBoundingBox(i))}_getHitTarget(e,t,i){if(t.width===0||t.height===0||e.xt.right||e.yt.bottom||!i||!this._layerDom.contains(i))return;const r=this._ghostLayer.getImageData(e,t);if(r.data[0]===0&&r.data[1]===0&&r.data[2]===0)return!1;const a=G.fromRGB(r.data[0],r.data[1],r.data[2]).toCSS();return this._colorMap[a]}getObjectAtPoint(e){const t=this._ghostLayer.getImageArray(e);if(t[0]===0&&t[1]===0&&t[2]===0)return;const i=G.fromRGB(t[0],t[1],t[2]).toCSS();return this._colorMap[i]}_withEvents(e,t){const i=this._events[e];if(i!==void 0){i.dispatching=!0;try{t(i)}finally{i.dispatching=!1,i.cleanup&&(i.cleanup=!1,ye(i.callbacks,r=>!r.disposed),i.callbacks.length===0&&(i.disposer.dispose(),delete this._events[e]))}}}_dispatchEventAll(e,t){this.interactionsEnabled&&this._withEvents(e,i=>{y(i.callbacks,r=>{r.disposed||r.callback.call(r.context,t)})})}_dispatchEvent(e,t,i){if(!this.interactionsEnabled)return!1;let r=!1;return this._withEvents(e,a=>{y(a.callbacks,s=>{s.disposed||s.object!==t||(s.callback.call(s.context,i),r=!0)})}),r}_dispatchMousedown(e,t){const i=e.button;if(i!=0&&i!=2&&i!=1&&i!==void 0)return;const r=this.getEvent(e),a=this._getHitTarget(r.originalPoint,r.bbox,t);if(a){const s=r.id;let n=!1;fe(a,h=>{const c={id:s,value:h};return this._mousedown.push(c),!n&&this._dispatchEvent("pointerdown",h,r)&&(n=!0,this._dragging.some(f=>f.value===h&&f.id===s)||this._dragging.push(c)),!0})}}_dispatchGlobalMousemove(e,t,i){const r=this.getEvent(e),a=this._getHitTarget(r.originalPoint,r.bbox,t);r.native=i,a?(this._hovering.forEach(s=>{s.contains(a)||(this._hovering.delete(s),s.cursorOverStyle&&_e(document.body,"cursor",s._replacedCursorStyle),this._dispatchEvent("pointerout",s,r))}),r.native&&fe(a,s=>(this._hovering.has(s)||(this._hovering.add(s),s.cursorOverStyle&&(s._replacedCursorStyle=zt(document.body,"cursor"),_e(document.body,"cursor",s.cursorOverStyle)),this._dispatchEvent("pointerover",s,r)),!0))):(this._hovering.forEach(s=>{s.cursorOverStyle&&_e(document.body,"cursor",s._replacedCursorStyle),this._dispatchEvent("pointerout",s,r)}),this._hovering.clear()),this._dispatchEventAll("globalpointermove",r)}removeHovering(e){this._hovering.delete(e),e.cursorOverStyle&&_e(document.body,"cursor",e._replacedCursorStyle)}_dispatchGlobalMouseup(e,t){const i=this.getEvent(e);i.native=t,this._dispatchEventAll("globalpointerup",i)}_dispatchDragMove(e){if(this._dragging.length!==0){const t=this.getEvent(e),i=t.id;this._dragging.forEach(r=>{r.id===i&&this._dispatchEvent("pointermove",r.value,t)})}}_dispatchDragEnd(e,t){const i=e.button;let r;if(i==0||i===void 0)r="click";else if(i==2)r="rightclick";else{if(i!=1)return;r="middleclick"}const a=this.getEvent(e),s=a.id;if(this._mousedown.length!==0){const n=this._getHitTarget(a.originalPoint,a.bbox,t);n&&this._mousedown.forEach(h=>{h.id===s&&h.value.contains(n)&&this._dispatchEvent(r,h.value,a)}),this._mousedown.length=0}this._dragging.length!==0&&(this._dragging.forEach(n=>{n.id===s&&this._dispatchEvent("pointerup",n.value,a)}),this._dragging.length=0)}_dispatchDoubleClick(e,t){const i=this.getEvent(e),r=this._getHitTarget(i.originalPoint,i.bbox,t);r&&fe(r,a=>!this._dispatchEvent("dblclick",a,i))}_dispatchWheel(e,t){const i=this.getEvent(e),r=this._getHitTarget(i.originalPoint,i.bbox,t);r&&fe(r,a=>!this._dispatchEvent("wheel",a,i))}_makeSharedEvent(e,t){if(this._listeners[e]===void 0){const i=t();this._listeners[e]=new Ct(()=>{delete this._listeners[e],i.dispose()})}return this._listeners[e].increment()}_onPointerEvent(e,t){let i=!1,r=null;function a(){r=null,i=!1}return new He([new X(()=>{r!==null&&clearTimeout(r),a()}),C(this.view,je(e),s=>{i=!0,r!==null&&clearTimeout(r),r=window.setTimeout(a,0)}),ti(window,e,(s,n)=>{r!==null&&(clearTimeout(r),r=null),t(s,n,i),i=!1})])}_initEvent(e){switch(e){case"globalpointermove":case"pointerover":case"pointerout":return this._makeSharedEvent("pointermove",()=>{const t=(i,r,a)=>{this._lastPointerMoveEvent={events:i,target:r,native:a},y(i,s=>{this._dispatchGlobalMousemove(s,r,a)})};return new He([this._onPointerEvent("pointerdown",t),this._onPointerEvent("pointermove",t)])});case"globalpointerup":return this._makeSharedEvent("pointerup",()=>{const t=this._onPointerEvent("pointerup",(r,a,s)=>{y(r,n=>{this._dispatchGlobalMouseup(n,s)}),this._lastPointerMoveEvent={events:r,target:a,native:s}}),i=this._onPointerEvent("pointercancel",(r,a,s)=>{y(r,n=>{this._dispatchGlobalMouseup(n,s)}),this._lastPointerMoveEvent={events:r,target:a,native:s}});return new X(()=>{t.dispose(),i.dispose()})});case"click":case"rightclick":case"middleclick":case"pointerdown":case"pointermove":case"pointerup":return this._makeSharedEvent("pointerdown",()=>{const t=this._onPointerEvent("pointerdown",(s,n)=>{y(s,h=>{this._dispatchMousedown(h,n)})}),i=this._onPointerEvent("pointermove",s=>{y(s,n=>{this._dispatchDragMove(n)})}),r=this._onPointerEvent("pointerup",(s,n)=>{y(s,h=>{this._dispatchDragEnd(h,n)})}),a=this._onPointerEvent("pointercancel",(s,n)=>{y(s,h=>{this._dispatchDragEnd(h,n)})});return new X(()=>{t.dispose(),i.dispose(),r.dispose(),a.dispose()})});case"dblclick":return this._makeSharedEvent("dblclick",()=>this._onPointerEvent("dblclick",(t,i)=>{y(t,r=>{this._dispatchDoubleClick(r,i)})}));case"wheel":return this._makeSharedEvent("wheel",()=>C(this.view,je("wheel"),t=>{this._dispatchWheel(t,et(t))},{passive:!1}))}}_addEvent(e,t,i,r){let a=this._events[t];a===void 0&&(a=this._events[t]={disposer:this._initEvent(t),callbacks:[],dispatching:!1,cleanup:!1});const s={object:e,context:r,callback:i,disposed:!1};return a.callbacks.push(s),new X(()=>{s.disposed=!0,a.dispatching?a.cleanup=!0:(De(a.callbacks,s),a.callbacks.length===0&&(a.disposer.dispose(),delete this._events[t]))})}getCanvas(e,t){this.render(e),t||(t={});let i=this.resolution,r=Math.floor(this._calculatedWidth*this.resolution),a=Math.floor(this._calculatedHeight*this.resolution);if(t.minWidth&&t.minWidth>r){let o=t.minWidth/r;o>i&&(i=o*this.resolution)}if(t.minHeight&&t.minHeight>a){let o=t.minHeight/a;o>i&&(i=o*this.resolution)}if(t.maxWidth&&t.maxWidtha){let o=t.maxHeight/a;o{if(o&&o.visible&&(o.tainted||n)){b=!0,o.exportableView=o.view,o.exportableContext=o.context,o.view=document.createElement("canvas"),o.view.style.position="fixed",o.view.style.top="-10000px",this.view.appendChild(o.view),s.push(o.view);let m=0,l=0;o.margin&&(m+=o.margin.left||0+o.margin.right||0,l+=o.margin.top||0+o.margin.bottom||0),o.view.width=r+m,o.view.height=a+l,o.context=o.view.getContext("2d"),o.dirty=!0,o.scale=i}}),b&&(this._omitTainted=!0,this.render(e),this._omitTainted=!1),y(this.layers,o=>{if(o&&o.visible){let m=0,l=0;o.margin&&(m=-(o.margin.left||0)*this.resolution,l=-(o.margin.top||0)*this.resolution),c.drawImage(o.view,m,l),o.exportableView&&(o.view=o.exportableView,o.exportableView=void 0),o.exportableContext&&(o.context=o.exportableContext,o.exportableContext=void 0),f{o.style.position="",o.style.top="",this.view.removeChild(o)}),h}}class Mi{constructor(){Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"margin",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_resolution",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_height",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"imageArray",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.view=document.createElement("canvas"),this.context=this.view.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.context.imageSmoothingEnabled=!1,this.view.style.position="absolute",this.view.style.top="0px",this.view.style.left="0px"}resize(e,t,i,r,a){this._resolution=a,e+=this.margin.left+this.margin.right,t+=this.margin.top+this.margin.bottom,i+=this.margin.left+this.margin.right,r+=this.margin.top+this.margin.bottom,this.view.style.left=-this.margin.left+"px",this.view.style.top=-this.margin.top+"px",this._width=Math.floor(e*a),this._height=Math.floor(t*a),this.view.width=this._width,this.view.style.width=i+"px",this.view.height=this._height,this.view.style.height=r+"px"}getImageData(e,t){return this.context.getImageData(Math.round((e.x-t.left)/t.width*this._width),Math.round((e.y-t.top)/t.height*this._height),1,1)}getImageArray(e){this.imageArray||(this.imageArray=this.context.getImageData(0,0,this._width,this._height).data);const t=this.imageArray,i=Math.round(e.x*this._resolution),r=4*(Math.round(e.y*this._resolution)*this._width+i);return[t[r],t[r+1],t[r+2],t[r+3]]}setMargin(e){this.margin.left=0,this.margin.right=0,this.margin.top=0,this.margin.bottom=0,y(e,t=>{t.margin&&(this.margin.left=Math.max(this.margin.left,t.margin.left),this.margin.right=Math.max(this.margin.right,t.margin.right),this.margin.top=Math.max(this.margin.top,t.margin.top),this.margin.bottom=Math.max(this.margin.bottom,t.margin.bottom))})}clear(){this.context.save(),this.context.fillStyle="#000",this.context.fillRect(0,0,this._width,this._height)}}class Si{constructor(e,t){Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tainted",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"margin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"order",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scale",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dirty",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"exportableView",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"exportableContext",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_height",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.view=e,this.context=t}resize(e,t,i,r,a){this.width!=null&&(e=this.width,i=this.width),this.height!=null&&(t=this.height,r=this.height),this.margin?(e+=this.margin.left+this.margin.right,t+=this.margin.top+this.margin.bottom,i+=this.margin.left+this.margin.right,r+=this.margin.top+this.margin.bottom,this.view.style.left=-this.margin.left+"px",this.view.style.top=-this.margin.top+"px"):(this.view.style.left="0px",this.view.style.top="0px"),this._width=Math.floor(e*a),this._height=Math.floor(t*a),this.view.width=this._width,this.view.style.width=i+"px",this.view.height=this._height,this.view.style.height=r+"px"}clear(){this.context.save(),this.context.clearRect(0,0,this._width,this._height)}}function qe(d,e){d==null?requestAnimationFrame(e):setTimeout(()=>{requestAnimationFrame(e)},1e3/d)}class Be{constructor(e,t={},i){if(Object.defineProperty(this,"dom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_inner",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDirtyParents",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dirty",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyParents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyBounds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyPositions",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_ticker",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_tickers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_updateTick",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new ut}),Object.defineProperty(this,"animationTime",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_animations",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_renderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rootContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tooltipContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipContainerSettings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltip",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"language",{enumerable:!0,configurable:!0,writable:!0,value:Gt.new(this,{})}),Object.defineProperty(this,"locale",{enumerable:!0,configurable:!0,writable:!0,value:st}),Object.defineProperty(this,"utc",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timezone",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fps",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"numberFormatter",{enumerable:!0,configurable:!0,writable:!0,value:Wt.new(this,{})}),Object.defineProperty(this,"dateFormatter",{enumerable:!0,configurable:!0,writable:!0,value:$t.new(this,{})}),Object.defineProperty(this,"durationFormatter",{enumerable:!0,configurable:!0,writable:!0,value:Xt.new(this,{})}),Object.defineProperty(this,"tabindex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_tabindexes",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_a11yD",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_focusElementDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_focusElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_focusedSprite",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isShift",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_keyboardDragPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_readerAlertElement",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_logo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipDiv",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"nonce",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"interfaceColors",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"verticalLayout",{enumerable:!0,configurable:!0,writable:!0,value:ct.new(this,{})}),Object.defineProperty(this,"horizontalLayout",{enumerable:!0,configurable:!0,writable:!0,value:dt.new(this,{})}),Object.defineProperty(this,"gridLayout",{enumerable:!0,configurable:!0,writable:!0,value:bt.new(this,{})}),Object.defineProperty(this,"_paused",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"autoResize",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_fontHash",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_isDisposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_resizeSensorDisposer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltips",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_htmlElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_htmlEnabledContainers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),!i)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");let r,a;if(this._settings=t,t.accessible==0&&(this._a11yD=!0),t.useSafeResolution==null&&(t.useSafeResolution=!0),t.useSafeResolution&&(r=_t()),this._renderer=new Ei(r),a=e instanceof HTMLElement?e:document.getElementById(e),y(ie.rootElements,h=>{if(h.dom===a)throw new Error("You cannot have multiple Roots on the same DOM node")}),this.interfaceColors=ge.new(this,{}),a===null)throw new Error("Could not find HTML element with id `"+e+"`");this.dom=a;let s=document.createElement("div");s.style.position="relative",s.style.width="100%",s.style.height="100%",a.appendChild(s);const n=t.tooltipContainerBounds;n&&(this._tooltipContainerSettings=n),this._inner=s,this._updateComputedStyles(),ie.rootElements.push(this)}static new(e,t){const i=new Be(e,t,!0);return i._init(),i}moveDOM(e){let t;if(t=e instanceof HTMLElement?e:document.getElementById(e),t){for(;this.dom.childNodes.length>0;)t.appendChild(this.dom.childNodes[0]);this.dom=t,this._initResizeSensor(),this.resize()}}_handleLogo(){if(this._logo){const e=this.dom.offsetWidth,t=this.dom.offsetHeight;e<=150||t<=60?this._logo.hide():this._logo.show()}}_showBranding(){if(!this._logo){const e=this.tooltipContainer.children.push(Z.new(this,{interactive:!0,interactiveChildren:!1,position:"absolute",setStateOnChildren:!0,paddingTop:9,paddingRight:9,paddingBottom:9,paddingLeft:9,scale:.6,y:Ke(100),centerY:K,tooltipText:"Created using amCharts 5",tooltipX:K,cursorOverStyle:"pointer",background:ft.new(this,{fill:re(4671320),fillOpacity:0,tooltipY:5})})),t=We.new(this,{pointerOrientation:"horizontal",paddingTop:4,paddingRight:7,paddingBottom:4,paddingLeft:7});t.label.setAll({fontSize:12}),t.get("background").setAll({fill:this.interfaceColors.get("background"),stroke:this.interfaceColors.get("grid"),strokeOpacity:.3}),e.set("tooltip",t),e.events.on("click",()=>{window.open("https://www.amcharts.com/","_blank")}),e.states.create("hover",{}),e.children.push(ze.new(this,{stroke:re(13421772),strokeWidth:3,svgPath:"M5 25 L13 25h13.6c3.4 0 6 0 10.3-4.3s5.2-12 8.6-12c3.4 0 4.3 8.6 7.7 8.6M83.4 25H79.8c-3.4 0-6 0-10.3-4.3s-5.2-12-8.6-12-4.3 8.6-7.7 8.6"})).states.create("hover",{stroke:re(3976191)}),e.children.push(ze.new(this,{stroke:re(8947848),strokeWidth:3,svgPath:"M83.4 25h-31C37 25 39.5 4.4 28.4 4.4S18.9 24.2 4.3 25H0"})).states.create("hover",{stroke:re(4671320)}),this._logo=e,this._handleLogo()}}_getRealSize(){return this.dom.getBoundingClientRect()}_getCalculatedSize(e){return this._settings.calculateSize?this._settings.calculateSize(e):{width:e.width,height:e.height}}_init(){const e=this._settings;e.accessible!==!1&&(e.focusable&&(this._inner.setAttribute("focusable","true"),this._inner.setAttribute("tabindex",this.tabindex+"")),e.ariaLabel&&this._inner.setAttribute("aria-label",e.ariaLabel),e.role&&this._inner.setAttribute("role",e.role));const t=this._renderer,i=this._getRealSize(),r=this._getCalculatedSize(i),a=Math.floor(r.width),s=Math.floor(r.height),n=Math.floor(i.width),h=Math.floor(i.height),c=Z.new(this,{visible:!0,width:a,height:s});this._rootContainer=c,this._rootContainer._defaultThemes.push(Ft.new(this));const f=c.children.push(Z.new(this,{visible:!0,width:K,height:K}));this.container=f,t.resize(n,h,a,s),this._inner.appendChild(t.view),this._initResizeSensor();const u=document.createElement("div");if(this._htmlElementContainer=u,u.className="am5-html-container",u.style.position="absolute",u.style.pointerEvents="none",this._tooltipContainerSettings||(u.style.overflow="hidden"),this._inner.appendChild(u),this._a11yD!==!0){const b=document.createElement("div");b.className="am5-reader-container",b.setAttribute("role","alert"),b.style.position="absolute",b.style.width="1px",b.style.height="1px",b.style.overflow="hidden",b.style.clip="rect(1px, 1px, 1px, 1px)",this._readerAlertElement=b,this._inner.appendChild(this._readerAlertElement);const o=document.createElement("div");o.className="am5-focus-container",o.style.position="absolute",o.style.pointerEvents="none",o.style.top="0px",o.style.left="0px",o.style.overflow="hidden",o.style.width=a+"px",o.style.height=s+"px",o.setAttribute("role","graphics-document"),J(o,!1),this._focusElementContainer=o,this._inner.appendChild(this._focusElementContainer);const m=document.createElement("div");this._tooltipElementContainer=m,m.className="am5-tooltip-container",this._inner.appendChild(m),me("keyboardevents")&&(this._disposers.push(C(window,"keydown",l=>{l.keyCode==16?this._isShift=!0:l.keyCode==9&&(this._isShift=l.shiftKey)})),this._disposers.push(C(window,"keyup",l=>{l.keyCode==16&&(this._isShift=!1)})),this._disposers.push(C(o,"click",()=>{const l=this._focusedSprite;if(l){const g=t.getEvent(new MouseEvent("click"));l.events.dispatch("click",{type:"click",originalEvent:g.event,point:g.point,simulated:!0,target:l})}})),this._disposers.push(C(o,"keydown",l=>{const g=this._focusedSprite;if(g){l.keyCode==27&&(gt(),this._focusedSprite=void 0);let p=0,w=0;switch(l.keyCode){case 13:l.preventDefault();const v=t.getEvent(new MouseEvent("click"));return void g.events.dispatch("click",{type:"click",originalEvent:v.event,point:v.point,simulated:!0,target:g});case 37:p=-6;break;case 39:p=6;break;case 38:w=-6;break;case 40:w=6;break;default:return}if(p!=0||w!=0){if(l.preventDefault(),!g.isDragging()){this._keyboardDragPoint={x:0,y:0};const P=t.getEvent(new MouseEvent("mousedown",{clientX:0,clientY:0}));g.events.isEnabled("pointerdown")&&g.events.dispatch("pointerdown",{type:"pointerdown",originalEvent:P.event,point:P.point,simulated:!0,target:g})}const v=this._keyboardDragPoint;v.x+=p,v.y+=w;const _=t.getEvent(new MouseEvent("mousemove",{clientX:v.x,clientY:v.y}),!1);g.events.isEnabled("globalpointermove")&&g.events.dispatch("globalpointermove",{type:"globalpointermove",originalEvent:_.event,point:_.point,simulated:!0,target:g})}}})),this._disposers.push(C(o,"keyup",l=>{if(this._focusedSprite){const g=this._focusedSprite,p=l.keyCode;switch(p){case 37:case 39:case 38:case 40:if(g.isDragging()){const w=this._keyboardDragPoint,v=t.getEvent(new MouseEvent("mouseup",{clientX:w.x,clientY:w.y}));return g.events.isEnabled("globalpointerup")&&g.events.dispatch("globalpointerup",{type:"globalpointerup",originalEvent:v.event,point:v.point,simulated:!0,target:g}),void(this._keyboardDragPoint=void 0)}if(g.get("focusableGroup")){const w=g.get("focusableGroup"),v=this._tabindexes.filter(L=>L.get("focusableGroup")==w&&L.getPrivate("focusable")!==!1);let _=v.indexOf(g);const P=v.length-1;_+=p==39||p==40?1:-1,_<0?_=P:_>P&&(_=0),mt(v[_].getPrivate("focusElement").dom)}}}})))}this._startTicker(),this.setThemes([]),this._addTooltip(),this._hasLicense()||this._showBranding()}_initResizeSensor(){this._resizeSensorDisposer&&this._resizeSensorDisposer.dispose(),this._resizeSensorDisposer=new Vt(this.dom,()=>{this.autoResize&&this.resize()}),this._disposers.push(this._resizeSensorDisposer)}resize(){const e=this._getRealSize(),t=this._getCalculatedSize(e),i=Math.floor(t.width),r=Math.floor(t.height);if(i>0&&r>0){const a=Math.floor(e.width),s=Math.floor(e.height),n=this._htmlElementContainer;if(n.style.width=i+"px",n.style.height=r+"px",this._a11yD!==!0){const c=this._focusElementContainer;c.style.width=i+"px",c.style.height=r+"px"}this._renderer.resize(a,s,i,r);const h=this._rootContainer;h.setPrivate("width",i),h.setPrivate("height",r),this._render(),this._handleLogo()}}_render(){this._renderer.render(this._rootContainer._display),this._focusElementDirty&&(this._updateCurrentFocus(),this._focusElementDirty=!1)}_runTickers(e){y(this._tickers,t=>{t(e)})}_runAnimations(e){let t=0;return ye(this._animations,i=>{const r=i._runAnimation(e);return r!==Ve.Stopped&&(r!==Ve.Playing||(++t,!0))}),t===0}_runDirties(){let e={};for(;this._isDirtyParents;)this._isDirtyParents=!1,se(this._dirtyParents).forEach(s=>{const n=this._dirtyParents[s];delete this._dirtyParents[s],n.isDisposed()||(e[n.uid]=n,n._prepareChildren())});se(e).forEach(s=>{e[s]._updateChildren()});const t=[];se(this._dirty).forEach(s=>{const n=this._dirty[s];n.isDisposed()?delete this._dirty[n.uid]:(t.push(n),n._beforeChanged())}),t.forEach(s=>{s._changed(),delete this._dirty[s.uid],s._clearDirty()}),this._isDirty=!1;const i={},r=[];se(this._dirtyBounds).forEach(s=>{const n=this._dirtyBounds[s];delete this._dirtyBounds[s],n.isDisposed()||(i[n.uid]=n.depth(),r.push(n))}),this._positionHTMLElements(),r.sort((s,n)=>pt(i[n.uid],i[s.uid])),r.forEach(s=>{s._updateBounds()});const a=this._dirtyPositions;se(a).forEach(s=>{const n=a[s];delete a[s],n.isDisposed()||n._updatePosition()}),t.forEach(s=>{s._afterChanged()})}_renderFrame(e){if(this._updateTick){this.events.isEnabled("framestarted")&&this.events.dispatch("framestarted",{type:"framestarted",target:this,timestamp:e}),this._checkComputedStyles(),this._runTickers(e);const t=this._runAnimations(e);return this._runDirties(),this._render(),this._renderer.resetImageArray(),this._positionHTMLElements(),this.events.isEnabled("frameended")&&this.events.dispatch("frameended",{type:"frameended",target:this,timestamp:e}),this._tickers.length===0&&t&&!this._isDirty}return!0}_runTicker(e,t){this.isDisposed()||(this.animationTime=e,this._renderFrame(e)?(this._ticker=null,this.animationTime=null):this._paused||(t?this._ticker:qe(this.fps,this._ticker)))}_runTickerNow(e=1e4){if(!this.isDisposed()){const t=performance.now()+e;for(;;){const i=performance.now();if(i>=t){this.animationTime=null;break}if(this.animationTime=i,this._renderFrame(i)){this.animationTime=null;break}}}}_startTicker(){this._ticker===null&&(this.animationTime=null,this._ticker=e=>{this._runTicker(e)},qe(this.fps,this._ticker))}get updateTick(){return this._updateTick}set updateTick(e){this._updateTick=e,e&&this._startTicker()}_addDirtyEntity(e){this._dirty[e.uid]===void 0&&(this._isDirty=!0,this._dirty[e.uid]=e,this._startTicker())}_addDirtyParent(e){this._dirtyParents[e.uid]===void 0&&(this._isDirty=!0,this._isDirtyParents=!0,this._dirtyParents[e.uid]=e,this._startTicker())}_addDirtyBounds(e){this._dirtyBounds[e.uid]===void 0&&(this._isDirty=!0,this._dirtyBounds[e.uid]=e,this._startTicker())}_addDirtyPosition(e){this._dirtyPositions[e.uid]===void 0&&(this._isDirty=!0,this._dirtyPositions[e.uid]=e,this._startTicker())}_addAnimation(e){this._animations.indexOf(e)===-1&&this._animations.push(e),this._startTicker()}_markDirty(){this._isDirty=!0}_markDirtyRedraw(){this.events.once("frameended",()=>{this._isDirty=!0,this._startTicker()})}eachFrame(e){return this._tickers.push(e),this._startTicker(),new X(()=>{De(this._tickers,e)})}markDirtyGlobal(e){e||(e=this.container),e.walkChildren(t=>{t instanceof Z&&this.markDirtyGlobal(t),t.markDirty(),t.markDirtyBounds()})}width(){return Math.floor(this._getCalculatedSize(this._getRealSize()).width)}height(){return Math.floor(this._getCalculatedSize(this._getRealSize()).height)}dispose(){this._isDisposed||(this._isDisposed=!0,this._rootContainer.dispose(),this._renderer.dispose(),this.horizontalLayout.dispose(),this.verticalLayout.dispose(),this.interfaceColors.dispose(),y(this._disposers,e=>{e.dispose()}),this._inner&&yt(this._inner),ae(ie.rootElements,this))}isDisposed(){return this._isDisposed}readerAlert(e){this._a11yD!==!0&&(this._readerAlertElement.innerHTML=Ie(e))}setThemes(e){this._rootContainer.set("themes",e);const t=this.tooltipContainer;t&&t._applyThemes();const i=this.interfaceColors;i&&i._applyThemes()}_addTooltip(){if(!this.tooltipContainer){const e=this._tooltipContainerSettings,t=this._rootContainer.children.push(Z.new(this,{position:"absolute",isMeasured:!1,width:K,height:K,layer:e?35:30,layerMargin:e||void 0}));this.tooltipContainer=t;const i=We.new(this,{});this.container.set("tooltip",i),i.hide(0),this._tooltip=i}}_registerTabindexOrder(e){this._a11yD!=1&&(e.get("focusable")?Te(this._tabindexes,e):ae(this._tabindexes,e),this._invalidateTabindexes())}_unregisterTabindexOrder(e){this._a11yD!=1&&(ae(this._tabindexes,e),this._invalidateTabindexes())}_invalidateTabindexes(){if(this._a11yD==1)return;this._tabindexes.sort((t,i)=>{const r=t.get("tabindexOrder",0),a=i.get("tabindexOrder",0);return r==a?0:r>a?1:-1});const e=[];y(this._tabindexes,(t,i)=>{t.getPrivate("focusElement")?this._moveFocusElement(i,t):this._makeFocusElement(i,t);const r=t.get("focusableGroup");r&&t.getPrivate("focusable")!==!1&&(e.indexOf(r)!==-1?t.getPrivate("focusElement").dom.setAttribute("tabindex","-1"):e.push(r))})}_updateCurrentFocus(){this._a11yD!=1&&this._focusedSprite&&(this._decorateFocusElement(this._focusedSprite),this._positionFocusElement(this._focusedSprite))}_decorateFocusElement(e,t){if(this._a11yD==1||(t||(t=e.getPrivate("focusElement").dom),!t))return;const i=e.get("role");i?t.setAttribute("role",i):t.removeAttribute("role");const r=e.get("ariaLabel");if(r){const o=vt(e,r);t.setAttribute("aria-label",o)}else t.removeAttribute("aria-label");const a=e.get("ariaLive");a?t.setAttribute("aria-live",a):t.removeAttribute("aria-live");const s=e.get("ariaChecked");s!=null&&i&&["checkbox","option","radio","menuitemcheckbox","menuitemradio","treeitem"].indexOf(i)!==-1?t.setAttribute("aria-checked",s?"true":"false"):t.removeAttribute("aria-checked"),e.get("ariaHidden")?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden");const n=e.get("ariaOrientation");n?t.setAttribute("aria-orientation",n):t.removeAttribute("aria-orientation");const h=e.get("ariaValueNow");h?t.setAttribute("aria-valuenow",h):t.removeAttribute("aria-valuenow");const c=e.get("ariaValueMin");c?t.setAttribute("aria-valuemin",c):t.removeAttribute("aria-valuemin");const f=e.get("ariaValueMax");f?t.setAttribute("aria-valuemax",f):t.removeAttribute("aria-valuemax");const u=e.get("ariaValueText");u?t.setAttribute("aria-valuetext",u):t.removeAttribute("aria-valuetext");const b=e.get("ariaControls");b?t.setAttribute("aria-controls",b):t.removeAttribute("aria-controls"),e.get("visible")&&e.get("opacity")!==0&&e.get("role")!="tooltip"&&!e.isHidden()&&e.getPrivate("focusable")!==!1?(t.getAttribute("tabindex")!="-1"&&t.setAttribute("tabindex",""+this.tabindex),t.removeAttribute("aria-hidden")):(t.removeAttribute("tabindex"),t.setAttribute("aria-hidden","true"))}_makeFocusElement(e,t){if(t.getPrivate("focusElement")||this._a11yD==1)return;const i=document.createElement("div");t.get("role")!="tooltip"&&(i.tabIndex=this.tabindex),i.style.position="absolute",J(i,!1);const r=[];t.setPrivate("focusElement",{dom:i,disposers:r}),this._decorateFocusElement(t),r.push(C(i,"focus",a=>{this._handleFocus(a,e)})),r.push(C(i,"blur",a=>{this._handleBlur(a,e)})),this._moveFocusElement(e,t)}_removeFocusElement(e){if(this._a11yD==1)return;ae(this._tabindexes,e);const t=e.getPrivate("focusElement");t&&(this._focusElementContainer.removeChild(t.dom),y(t.disposers,i=>{i.dispose()}))}_hideFocusElement(e){this._a11yD!=1&&(e.getPrivate("focusElement").dom.style.display="none")}_moveFocusElement(e,t){if(this._a11yD==1)return;const i=this._focusElementContainer,r=t.getPrivate("focusElement").dom;if(r===this._focusElementContainer.children[e])return;const a=this._focusElementContainer.children[e+1];a?i.insertBefore(r,a):i.append(r)}_positionFocusElement(e){if(this._a11yD==1||e==null)return;const t=e.globalBounds();let i=t.right==t.left?e.width():t.right-t.left,r=t.top==t.bottom?e.height():t.bottom-t.top;const a=this._settings.focusPadding!==void 0?this._settings.focusPadding:2;let s=t.left-a,n=t.top-a;i<0&&(s+=i,i=Math.abs(i)),r<0&&(n+=r,r=Math.abs(r));const h=e.getPrivate("focusElement").dom;h.style.top=n+"px",h.style.left=s+"px",h.style.width=i+2*a+"px",h.style.height=r+2*a+"px"}_handleFocus(e,t){if(this._a11yD==1)return;const i=this._tabindexes[t];i.isVisibleDeep()?(this._positionFocusElement(i),this._focusedSprite=i,i.events.isEnabled("focus")&&i.events.dispatch("focus",{type:"focus",originalEvent:e,target:i})):this._focusNext(e.target,this._isShift?-1:1)}_focusNext(e,t){if(this._a11yD==1)return;const i=Array.from(document.querySelectorAll(["a[href]","area[href]","button:not([disabled])","details","input:not([disabled])","iframe:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[contentEditable=""]','[contentEditable="true"]','[contentEditable="TRUE"]','[tabindex]:not([tabindex^="-"])'].join(",")));let r=i.indexOf(e)+t;r<0?r=i.length-1:r>=i.length&&(r=0),i[r].focus()}_handleBlur(e,t){if(this._a11yD==1)return;const i=this._focusedSprite;i&&!i.isDisposed()&&i.events.isEnabled("blur")&&i.events.dispatch("blur",{type:"blur",originalEvent:e,target:i}),this._focusedSprite=void 0}updateTooltip(e){if(this._a11yD==1)return;const t=Ie(e._getText());let i=e.getPrivate("tooltipElement");e.get("role")=="tooltip"&&t!=""?(i||(i=this._makeTooltipElement(e)),i.innerHTML!=t&&(i.innerHTML=t)):i&&(i.remove(),e.removePrivate("tooltipElement"))}_makeTooltipElement(e){const t=this._tooltipElementContainer,i=document.createElement("div");return i.style.position="absolute",i.style.width="1px",i.style.height="1px",i.style.overflow="hidden",i.style.clip="rect(1px, 1px, 1px, 1px)",J(i,!1),this._decorateFocusElement(e,i),t.append(i),e.setPrivate("tooltipElement",i),i}_removeTooltipElement(e){if(this._a11yD==1)return;const t=e.getPrivate("tooltipElement");if(t){const i=t.parentElement;i&&i.removeChild(t)}}_invalidateAccessibility(e){if(this._a11yD==1)return;this._focusElementDirty=!0;const t=e.getPrivate("focusElement");e.get("focusable")?t&&(this._decorateFocusElement(e),this._positionFocusElement(e)):t&&this._removeFocusElement(e)}focused(e){return this._focusedSprite===e}documentPointToRoot(e){const t=this._getRealSize(),i=this._getCalculatedSize(t),r=i.width/t.width,a=i.height/t.height;return{x:(e.x-t.left)*r,y:(e.y-t.top)*a}}rootPointToDocument(e){const t=this._getRealSize(),i=this._getCalculatedSize(t),r=i.width/t.width,a=i.height/t.height;return{x:e.x/r+t.left,y:e.y/a+t.top}}addDisposer(e){return this._disposers.push(e),e}_updateComputedStyles(){const e=window.getComputedStyle(this.dom);let t="";ue(e,(r,a)=>{pe(r)&&r.match(/^font/)&&(t+=a)});const i=t!=this._fontHash;return i&&(this._fontHash=t),i}_checkComputedStyles(){this._updateComputedStyles()&&this._invalidateLabelBounds(this.container)}_invalidateLabelBounds(e){e instanceof Z?e.children.each(t=>{this._invalidateLabelBounds(t)}):e instanceof wt&&e.markDirtyBounds()}_hasLicense(){for(let e=0;e{const a=this._renderer.getEvent(r);e.events.dispatch("click",{type:"click",originalEvent:a.event,point:a.point,simulated:!1,target:e})}))),this._positionHTMLElement(e),t.append(i),Te(this._htmlEnabledContainers,e),i}_positionHTMLElements(){y(this._htmlEnabledContainers,e=>{this._positionHTMLElement(e)})}_positionHTMLElement(e){const t=e.getPrivate("htmlElement");if(t){y(["paddingTop","paddingRight","paddingBottom","paddingLeft","minWidth","minHeight","maxWidth","maxHeight"],f=>{const u=e.get(f);t.style[f]=u?u+"px":""});const i=e.compositeOpacity();setTimeout(()=>{t.style.opacity=i+""},10);const r=e.isVisibleDeep();r&&(t.style.display="block");const a=e.globalBounds();t.style.top=a.top+"px",t.style.left=a.left+"px";const s=e.get("width"),n=e.get("height");let h=0,c=0;if(s&&(h=e.width()),n&&(c=e.height()),s&&n)e.removePrivate("minWidth"),e.removePrivate("minHeight");else{t.style.position="fixed",t.style.width="",t.style.height="";const f=t.getBoundingClientRect();t.style.position="absolute",h=f.width,c=f.height,e._adjustedLocalBounds={left:0,right:0,top:0,bottom:0},e.setPrivate("minWidth",h),e.setPrivate("minHeight",c)}h>0&&(t.style.minWidth=h+"px"),c>0&&(t.style.minHeight=c+"px"),r&&i!=0||(t.style.display="none")}}_setHTMLContent(e,t){let i=e.getPrivate("htmlElement");i||(i=this._makeHTMLElement(e)),i.innerHTML!=t&&(i.innerHTML=t)}_removeHTMLContent(e){let t=e.getPrivate("htmlElement");t&&(this._htmlElementContainer.removeChild(t),e.removePrivate("htmlElement")),ae(this._htmlEnabledContainers,e)}}ht("AM5C241025748");const Ze="en-us",Ae=new Map([["ar",()=>x(()=>import("./ar-C6P6sbTZ.js"),[])],["bg-bg",()=>x(()=>import("./bg_BG-BKa2bm9j.js"),[])],["bs-ba",()=>x(()=>import("./bs_BA-Cr-VUOtJ.js"),[])],["ca-es",()=>x(()=>import("./ca_ES-DWC4n8NA.js"),[])],["cs-cz",()=>x(()=>import("./cs_CZ-CyqqX6ir.js"),[])],["da-dk",()=>x(()=>import("./da_DK-2ex9kBWh.js"),[])],["de-de",()=>x(()=>import("./de_DE-BF1_XBt7.js"),[])],["de-ch",()=>x(()=>import("./de_CH-B97rjhoW.js"),[])],["el-gr",()=>x(()=>import("./el_GR-zaN0EgX_.js"),[])],["en-us",()=>x(()=>import("./en_US-COWxzRR4.js"),[])],["en-ca",()=>x(()=>import("./en_CA-COWxzRR4.js"),[])],["es-es",()=>x(()=>import("./es_ES-_3WcXaQ2.js"),[])],["et-ee",()=>x(()=>import("./et_EE-F7kgGek-.js"),[])],["fi-fi",()=>x(()=>import("./fi_FI-Bozs9Z2H.js"),[])],["fr-fr",()=>x(()=>import("./fr_FR-BkfBDc1T.js"),[])],["he-il",()=>x(()=>import("./he_IL-CAeZms-L.js"),[])],["hr-hr",()=>x(()=>import("./hr_HR-BXNws4dg.js"),[])],["hu-hu",()=>x(()=>import("./hu_HU-BPCtb03x.js"),[])],["id-id",()=>x(()=>import("./id_ID-Bk2oUsUi.js"),[])],["it-it",()=>x(()=>import("./it_IT-BU_dnupK.js"),[])],["ja-jp",()=>x(()=>import("./ja_JP-TESpmw1I.js"),[])],["ko-kr",()=>x(()=>import("./ko_KR-DvFSNkwg.js"),[])],["lt-lt",()=>x(()=>import("./lt_LT-DHDBnlgq.js"),[])],["lv-lv",()=>x(()=>import("./lv_LV-BGX5_oyM.js"),[])],["nb-no",()=>x(()=>import("./nb_NO-BVuLzJb0.js"),[])],["nl-nl",()=>x(()=>import("./nl_NL-DiE2F1Fx.js"),[])],["pl-pl",()=>x(()=>import("./pl_PL-CCCo8oJV.js"),[])],["pt-br",()=>x(()=>import("./pt_BR-ClOz39JC.js"),[])],["pt-pt",()=>x(()=>import("./pt_PT-CugZtzXR.js"),[])],["ro-ro",()=>x(()=>import("./ro_RO-D4DP893q.js"),[])],["ru-ru",()=>x(()=>import("./ru_RU-ItrmHbqT.js"),[])],["sk-sk",()=>x(()=>import("./sk_SK-CP61SfDR.js"),[])],["sl-sl",()=>x(()=>import("./sl_SL-hZyOU_tZ.js"),[])],["sr-rs",()=>x(()=>import("./sr_RS-CVYN3U4S.js"),[])],["sv-se",()=>x(()=>import("./sv_SE-CRc7K9Uw.js"),[])],["th-th",()=>x(()=>import("./th_TH-DLSV1BZk.js"),[])],["tr-tr",()=>x(()=>import("./tr_TR-BqZDkyaY.js"),[])],["uk-ua",()=>x(()=>import("./uk_UA-CLrV2Ees.js"),[])],["vi-vn",()=>x(()=>import("./vi_VN-DrrDewoL.js"),[])],["zh-cn",()=>x(()=>import("./zh_Hans-D0O9jRQd.js"),[])],["zh-hk",()=>x(()=>import("./zh_Hant-GhP8Ngw4.js"),[])],["zh-tw",()=>x(()=>import("./zh_Hant-GhP8Ngw4.js"),[])]]);function Ti(d){const e=d.split("-")[0].toLowerCase();let t=null;for(const i of Ae.keys())if(i.startsWith(e)){t=i;break}return t}function ji(d){return d?Ae.has(d.toLowerCase())?d.toLowerCase():Ti(d)||Ze:Ze}async function Li(d,e=lt()){const t=Be.new(d);return t.locale=(await Ae.get(ji(e))()).default,t}export{Li as createRoot}; diff --git a/assets/clientSideDefaults-CgRgH99f.js b/assets/clientSideDefaults-BQP5n3lX.js similarity index 96% rename from assets/clientSideDefaults-CgRgH99f.js rename to assets/clientSideDefaults-BQP5n3lX.js index bdf7a99..2929d0a 100644 --- a/assets/clientSideDefaults-CgRgH99f.js +++ b/assets/clientSideDefaults-BQP5n3lX.js @@ -1,4 +1,4 @@ -import{E as o,aV as u}from"./index-CEWggaxV.js";import{t as n}from"./QueryEngineCapabilities-CTDe3LlQ.js";import{l as i,o as a,S as l}from"./defaultsJSON-CHAaurhX.js";function A(t){return{renderer:{type:"simple",symbol:t==="esriGeometryPoint"||t==="esriGeometryMultipoint"?i:t==="esriGeometryPolyline"?a:l}}}const c=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let y=1;function $(t,s){if(o("esri-csp-restrictions"))return()=>({[s]:null,...t});try{let e=`this.${s} = null;`;for(const r in t)e+=`this${c.test(r)?`.${r}`:`["${r}"]`} = ${JSON.stringify(t[r])};`;const p=new Function(` +import{E as o,aV as u}from"./index-BjUNJPVf.js";import{t as n}from"./QueryEngineCapabilities-CTDe3LlQ.js";import{l as i,o as a,S as l}from"./defaultsJSON-CHAaurhX.js";function A(t){return{renderer:{type:"simple",symbol:t==="esriGeometryPoint"||t==="esriGeometryMultipoint"?i:t==="esriGeometryPolyline"?a:l}}}const c=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let y=1;function $(t,s){if(o("esri-csp-restrictions"))return()=>({[s]:null,...t});try{let e=`this.${s} = null;`;for(const r in t)e+=`this${c.test(r)?`.${r}`:`["${r}"]`} = ${JSON.stringify(t[r])};`;const p=new Function(` return class AttributesClass$${y++} { constructor() { ${e}; diff --git a/assets/colorRamps-BJydlf0f.js b/assets/colorRamps-CcakIWlU.js similarity index 95% rename from assets/colorRamps-BJydlf0f.js rename to assets/colorRamps-CcakIWlU.js index df440d8..8b09b10 100644 --- a/assets/colorRamps-BJydlf0f.js +++ b/assets/colorRamps-CcakIWlU.js @@ -1 +1 @@ -import{d as o,y as e,f as m,aU as d,c9 as C,a9 as y,dS as h,aV as p}from"./index-CEWggaxV.js";let l=class extends d{constructor(t){super(t),this.type=null}};o([e({readOnly:!0,json:{read:!1,write:!0}})],l.prototype,"type",void 0),l=o([m("esri.rest.support.ColorRamp")],l);const c=l;var i;let r=i=class extends c{constructor(t){super(t),this.algorithm=null,this.fromColor=null,this.toColor=null,this.type="algorithmic"}clone(){return new i({fromColor:p(this.fromColor),toColor:p(this.toColor),algorithm:this.algorithm})}};o([C({esriCIELabAlgorithm:"cie-lab",esriHSVAlgorithm:"hsv",esriLabLChAlgorithm:"lab-lch"})],r.prototype,"algorithm",void 0),o([e({type:y,json:{type:[h],write:!0}})],r.prototype,"fromColor",void 0),o([e({type:y,json:{type:[h],write:!0}})],r.prototype,"toColor",void 0),o([e({type:["algorithmic"]})],r.prototype,"type",void 0),r=i=o([m("esri.rest.support.AlgorithmicColorRamp")],r);const n=r;var a;let s=a=class extends c{constructor(t){super(t),this.colorRamps=null,this.type="multipart"}clone(){return new a({colorRamps:p(this.colorRamps)})}};o([e({type:[n],json:{write:!0}})],s.prototype,"colorRamps",void 0),o([e({type:["multipart"]})],s.prototype,"type",void 0),s=a=o([m("esri.rest.support.MultipartColorRamp")],s);const u=s,f={key:"type",base:c,typeMap:{algorithmic:n,multipart:u}};function v(t){return t!=null&&t.type?t.type==="algorithmic"?n.fromJSON(t):t.type==="multipart"?u.fromJSON(t):null:null}export{u as a,f as m,v as p}; +import{d as o,y as e,f as m,aU as d,c9 as C,a9 as y,dS as h,aV as p}from"./index-BjUNJPVf.js";let l=class extends d{constructor(t){super(t),this.type=null}};o([e({readOnly:!0,json:{read:!1,write:!0}})],l.prototype,"type",void 0),l=o([m("esri.rest.support.ColorRamp")],l);const c=l;var i;let r=i=class extends c{constructor(t){super(t),this.algorithm=null,this.fromColor=null,this.toColor=null,this.type="algorithmic"}clone(){return new i({fromColor:p(this.fromColor),toColor:p(this.toColor),algorithm:this.algorithm})}};o([C({esriCIELabAlgorithm:"cie-lab",esriHSVAlgorithm:"hsv",esriLabLChAlgorithm:"lab-lch"})],r.prototype,"algorithm",void 0),o([e({type:y,json:{type:[h],write:!0}})],r.prototype,"fromColor",void 0),o([e({type:y,json:{type:[h],write:!0}})],r.prototype,"toColor",void 0),o([e({type:["algorithmic"]})],r.prototype,"type",void 0),r=i=o([m("esri.rest.support.AlgorithmicColorRamp")],r);const n=r;var a;let s=a=class extends c{constructor(t){super(t),this.colorRamps=null,this.type="multipart"}clone(){return new a({colorRamps:p(this.colorRamps)})}};o([e({type:[n],json:{write:!0}})],s.prototype,"colorRamps",void 0),o([e({type:["multipart"]})],s.prototype,"type",void 0),s=a=o([m("esri.rest.support.MultipartColorRamp")],s);const u=s,f={key:"type",base:c,typeMap:{algorithmic:n,multipart:u}};function v(t){return t!=null&&t.type?t.type==="algorithmic"?n.fromJSON(t):t.type==="multipart"?u.fromJSON(t):null:null}export{u as a,f as m,v as p}; diff --git a/assets/computeTranslationToOriginAndRotation-DOOKw0d1.js b/assets/computeTranslationToOriginAndRotation-BeE3rOSz.js similarity index 95% rename from assets/computeTranslationToOriginAndRotation-DOOKw0d1.js rename to assets/computeTranslationToOriginAndRotation-BeE3rOSz.js index fd9de03..f5c4b59 100644 --- a/assets/computeTranslationToOriginAndRotation-DOOKw0d1.js +++ b/assets/computeTranslationToOriginAndRotation-BeE3rOSz.js @@ -1 +1 @@ -import{aS as L,gm as O,gn as T,go as N,e4 as k,gp as _,gq as g,gr as F,gs as p,gt as G,gu as I,gv as a,G as R,gw as W,gx as C,gy as $,gz as h,cy as S}from"./index-CEWggaxV.js";const H=new L(O),c=new L(T),f=new L(N);new L(k);function x(s){const u=P.get(s);if(u)return u;let n=H;if(s)if(s===c)n=c;else if(s===f)n=f;else{const l=s.wkid,o=s.latestWkid;if(l!=null||o!=null)_(l)||_(o)?n=c:(g(l)||g(o))&&(n=f);else{const e=s.wkt2??s.wkt;if(e){const r=e.toUpperCase();r===m?n=c:r===U&&(n=f)}}}return P.set(s,n),n}const P=new Map,m=c.wkt.toUpperCase(),U=f.wkt.toUpperCase();function M(s,u,n){const l=Math.sin(s),o=Math.cos(s),e=Math.sin(u),r=Math.cos(u),t=n;return t[0]=-l,t[4]=-e*o,t[8]=r*o,t[12]=0,t[1]=o,t[5]=-e*l,t[9]=r*l,t[13]=0,t[2]=0,t[6]=r,t[10]=e,t[14]=0,t[3]=0,t[7]=0,t[11]=0,t[15]=1,t}function d(s,u,n){return M(s,u,n),F(n,n),n}function y(s,u,n,l){if(s==null||l==null)return!1;const o=p(s,G),e=p(l,I);if(o===e&&!w(e)&&(o!==a.UNKNOWN||R(s,l)))return W(n,u),!0;if(w(e)){const r=C[o][a.LON_LAT],t=C[a.LON_LAT][e];return r!=null&&t!=null&&(r(u,0,E,0),t(E,0,i,0),M(A*E[0],A*E[1],n),n[12]=i[0],n[13]=i[1],n[14]=i[2],!0)}if((e===a.WEB_MERCATOR||e===a.PLATE_CARREE||e===a.WGS84)&&(o===a.WGS84||o===a.CGCS2000&&e===a.PLATE_CARREE||o===a.SPHERICAL_ECEF||o===a.WEB_MERCATOR)){const r=C[o][a.LON_LAT],t=C[a.LON_LAT][e];return r!=null&&t!=null&&(r(u,0,E,0),t(E,0,i,0),o===a.SPHERICAL_ECEF?d(A*E[0],A*E[1],n):$(n),n[12]=i[0],n[13]=i[1],n[14]=i[2],!0)}return!1}function w(s){return s===a.SPHERICAL_ECEF||s===a.SPHERICAL_MARS_PCPF||s===a.SPHERICAL_MOON_PCPF}const A=h(1),E=S(),i=S();export{y as R,x as a}; +import{aS as L,gm as O,gn as T,go as N,e4 as k,gp as _,gq as g,gr as F,gs as p,gt as G,gu as I,gv as a,G as R,gw as W,gx as C,gy as $,gz as h,cy as S}from"./index-BjUNJPVf.js";const H=new L(O),c=new L(T),f=new L(N);new L(k);function x(s){const u=P.get(s);if(u)return u;let n=H;if(s)if(s===c)n=c;else if(s===f)n=f;else{const l=s.wkid,o=s.latestWkid;if(l!=null||o!=null)_(l)||_(o)?n=c:(g(l)||g(o))&&(n=f);else{const e=s.wkt2??s.wkt;if(e){const r=e.toUpperCase();r===m?n=c:r===U&&(n=f)}}}return P.set(s,n),n}const P=new Map,m=c.wkt.toUpperCase(),U=f.wkt.toUpperCase();function M(s,u,n){const l=Math.sin(s),o=Math.cos(s),e=Math.sin(u),r=Math.cos(u),t=n;return t[0]=-l,t[4]=-e*o,t[8]=r*o,t[12]=0,t[1]=o,t[5]=-e*l,t[9]=r*l,t[13]=0,t[2]=0,t[6]=r,t[10]=e,t[14]=0,t[3]=0,t[7]=0,t[11]=0,t[15]=1,t}function d(s,u,n){return M(s,u,n),F(n,n),n}function y(s,u,n,l){if(s==null||l==null)return!1;const o=p(s,G),e=p(l,I);if(o===e&&!w(e)&&(o!==a.UNKNOWN||R(s,l)))return W(n,u),!0;if(w(e)){const r=C[o][a.LON_LAT],t=C[a.LON_LAT][e];return r!=null&&t!=null&&(r(u,0,E,0),t(E,0,i,0),M(A*E[0],A*E[1],n),n[12]=i[0],n[13]=i[1],n[14]=i[2],!0)}if((e===a.WEB_MERCATOR||e===a.PLATE_CARREE||e===a.WGS84)&&(o===a.WGS84||o===a.CGCS2000&&e===a.PLATE_CARREE||o===a.SPHERICAL_ECEF||o===a.WEB_MERCATOR)){const r=C[o][a.LON_LAT],t=C[a.LON_LAT][e];return r!=null&&t!=null&&(r(u,0,E,0),t(E,0,i,0),o===a.SPHERICAL_ECEF?d(A*E[0],A*E[1],n):$(n),n[12]=i[0],n[13]=i[1],n[14]=i[2],!0)}return!1}function w(s){return s===a.SPHERICAL_ECEF||s===a.SPHERICAL_MARS_PCPF||s===a.SPHERICAL_MOON_PCPF}const A=h(1),E=S(),i=S();export{y as R,x as a}; diff --git a/assets/conditionalSlot-D3Ya1Vfj.js b/assets/conditionalSlot-DMpb3OPD.js similarity index 83% rename from assets/conditionalSlot-D3Ya1Vfj.js rename to assets/conditionalSlot-DMpb3OPD.js index e894d1b..572a067 100644 --- a/assets/conditionalSlot-D3Ya1Vfj.js +++ b/assets/conditionalSlot-DMpb3OPD.js @@ -1,4 +1,4 @@ -import{c1 as c}from"./index-CEWggaxV.js";import{c as i}from"./observers-MZ9Ss0UR.js";/*! +import{c1 as c}from"./index-BjUNJPVf.js";import{c as i}from"./observers-B6R0JooC.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.7.1 diff --git a/assets/createConnection-BxU4QDA7.js b/assets/createConnection-BvioR9C8.js similarity index 84% rename from assets/createConnection-BxU4QDA7.js rename to assets/createConnection-BvioR9C8.js index 3d9dfd5..a194c55 100644 --- a/assets/createConnection-BxU4QDA7.js +++ b/assets/createConnection-BvioR9C8.js @@ -1,7 +1,7 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/FeatureLayer-D0kMrROG.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css","assets/UniqueValueRenderer-BlkUix3g.js","assets/ColorStop-44hBlQ14.js","assets/diffUtils-B4YFa5Ju.js","assets/colorRamps-BJydlf0f.js","assets/sizeVariableUtils-Cmcuvw-4.js","assets/visualVariableUtils-z2k12BH8.js","assets/jsonUtils-qYmXvGJ1.js","assets/styleUtils-CnV_Xzhi.js","assets/jsonUtils-BseLl1fZ.js","assets/Version-Bd0QsIQ5.js","assets/FieldsIndex-CLgRNeJ_.js","assets/UnknownTimeZone-DF0BqWCR.js","assets/OverrideHelper-B4ryGWZb.js","assets/utils-p-5Bbga5.js","assets/quantizationUtils-CUjGHrU3.js","assets/heatmapUtils-Clt5rJzr.js","assets/FormTemplate-eV18QveB.js","assets/editsZScale-CQCGPEjO.js","assets/queryZScale-DN4aFXYn.js","assets/FeatureSet-CYJUZgOk.js","assets/EditBusLayer-SG7oYwiY.js","assets/FeatureEffectLayer-CLTrRFqx.js","assets/FeatureEffect-ByrbZlne.js","assets/FeatureLayerBase-DPJuwFpX.js","assets/featureLayerUtils-BhDaw8pS.js","assets/AttachmentQuery-D61mmWw4.js","assets/RelationshipQuery-DDK72Kwc.js","assets/LayerFloorInfo-Cdq3ulNh.js","assets/serviceCapabilitiesUtils-t8SL4e_j.js","assets/FeatureReductionLayer-DncGsNIN.js","assets/FeatureReductionSelection-BY3KVXac.js","assets/LabelClass-6cZokw8y.js","assets/labelUtils-Dnqx6jl5.js","assets/defaultsJSON-CHAaurhX.js","assets/MD5-C9MwAd2G.js","assets/OrderedLayer-Do089KpQ.js","assets/OrderByInfo-DKzv2-WS.js","assets/RefreshableLayer-1EkEhJeI.js","assets/TemporalLayer-qq3v_i3q.js","assets/TimeInfo-3TVmpFSA.js","assets/FeatureTemplate-DcprAdTM.js","assets/FeatureType-By3BEr9z.js","assets/fieldProperties-DMs4wT6-.js","assets/labelingInfo-CijajRsc.js","assets/versionUtils-CaceEUVY.js","assets/styleUtils-B_Iy1DTk.js","assets/TopFeaturesQuery-B8kC7n5h.js","assets/popupUtils-DAFYyAvw.js","assets/interfaces-CL2NbQte.js"] + __vite__mapDeps.viteFileDeps = ["assets/FeatureLayer-BHxNIHhy.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css","assets/UniqueValueRenderer-7V9Bhr-D.js","assets/ColorStop-DCGjAKLC.js","assets/diffUtils-uUoMDFQS.js","assets/colorRamps-CcakIWlU.js","assets/sizeVariableUtils-Cmcuvw-4.js","assets/visualVariableUtils-BX9G5gNQ.js","assets/jsonUtils-Ox5U0P0F.js","assets/styleUtils-DOUOskVZ.js","assets/jsonUtils-Dw332y6z.js","assets/Version-Dqq_CHBG.js","assets/FieldsIndex-CK-0B5n9.js","assets/UnknownTimeZone-CK7VjgF3.js","assets/OverrideHelper-DxFZBnGL.js","assets/utils-CuXO_Zzq.js","assets/quantizationUtils-CfV316jZ.js","assets/heatmapUtils-BSteZBTj.js","assets/FormTemplate-BGxtsGX6.js","assets/editsZScale-Bfe6gH1b.js","assets/queryZScale-Dwvn5BlQ.js","assets/FeatureSet-opEn8ou8.js","assets/EditBusLayer-OslMX9fF.js","assets/FeatureEffectLayer-DarO4Ctx.js","assets/FeatureEffect-DBbkrS6j.js","assets/FeatureLayerBase-D0I-Escx.js","assets/featureLayerUtils-lwqyOSrl.js","assets/AttachmentQuery-DmEAIZff.js","assets/RelationshipQuery-BDJrOxaX.js","assets/LayerFloorInfo-DlYNbO-A.js","assets/serviceCapabilitiesUtils-DiP90Uds.js","assets/FeatureReductionLayer-CK-tyM-9.js","assets/FeatureReductionSelection-t3T7oa8H.js","assets/LabelClass-CeatfK8u.js","assets/labelUtils-3p0-m-Ee.js","assets/defaultsJSON-CHAaurhX.js","assets/MD5-C9MwAd2G.js","assets/OrderedLayer-dLoPhxcx.js","assets/OrderByInfo-DKyk5GLW.js","assets/RefreshableLayer-_r2TPtol.js","assets/TemporalLayer-CKICYnEl.js","assets/TimeInfo-DooETFWC.js","assets/FeatureTemplate-FZNGA_Ik.js","assets/FeatureType-CwUl8Nf5.js","assets/fieldProperties-DnrQXLBM.js","assets/labelingInfo-DqAUis6e.js","assets/versionUtils-BIAEZzrm.js","assets/styleUtils--I7zqeL6.js","assets/TopFeaturesQuery-CVQjqlfM.js","assets/popupUtils-DlZin22m.js","assets/interfaces-CL2NbQte.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{ca as L,N as a,d,y as p,f as S,bl as v,bD as F,s as c,fx as N,df as C,M as O,b0 as x,_ as E,aX as $,aS as P}from"./index-CEWggaxV.js";import{c as k}from"./query-BM8R3sQ6.js";import"./pbfQueryUtils-CLRSFGBm.js";import"./pbf-D9QZb8S8.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./queryZScale-DN4aFXYn.js";let m=class extends L.EventedAccessor{destroy(){this.emit("destroy")}get connectionError(){return this.errorString?new a("stream-connection",this.errorString):null}onFeature(e){this.emit("data-received",e)}onMessage(e){this.emit("message-received",e)}};d([p({readOnly:!0})],m.prototype,"connectionError",null),m=d([S("esri.layers.support.StreamConnection")],m);const R=m;var g;(function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"})(g||(g={}));let f=class extends R{constructor(t){super({}),this._outstandingMessages=[],this.errorString=null;const{geometryType:r,spatialReference:s,sourceSpatialReference:o}=t;this._config=t,this._featureZScaler=v(r,o,s),this._open()}normalizeCtorArgs(){return{}}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),this._websocket!=null&&(this._websocket.onopen=null,this._websocket.onclose=null,this._websocket.onerror=null,this._websocket.onmessage=null,this._websocket.close()),this._websocket=null}get connectionStatus(){if(this._websocket==null)return"disconnected";switch(this._websocket.readyState){case g.CONNECTING:case g.OPEN:return"connected";case g.CLOSING:case g.CLOSED:return"disconnected"}}sendMessageToSocket(t){this._websocket!=null?this._websocket.send(JSON.stringify(t)):this._outstandingMessages.push(t)}sendMessageToClient(t){this._onMessage(t)}updateCustomParameters(t){this._config.customParameters=t,this._websocket!=null&&this._websocket.close()}async _tryCreateWebSocket(t=this._config.source.path,r=1e3,s=0){try{if(this.destroyed)return;const o=F(t,this._config.customParameters??{});this._websocket=await this._createWebSocket(o),this.notifyChange("connectionStatus")}catch(o){const n=r/1e3;return this._config.maxReconnectionAttempts&&s>=this._config.maxReconnectionAttempts?(c.getLogger(this).error(new a("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(c.getLogger(this).error(new a("websocket-connection",`Failed to connect. Attempting to reconnect in ${n}s`,o)),await N(r),this._tryCreateWebSocket(t,Math.min(1.5*r,1e3*this._config.maxReconnectionInterval),s+1))}}_setWebSocketJSONParseHandler(t){t.onmessage=r=>{try{const s=JSON.parse(r.data);this._onMessage(s)}catch(s){return void c.getLogger(this).error(new a("websocket-connection","Failed to parse message, invalid JSON",{error:s}))}}}_createWebSocket(t){return new Promise((r,s)=>{const o=new WebSocket(t);o.onopen=()=>{if(o.onopen=null,this.destroyed)return o.onclose=null,void o.close();o.onclose=n=>this._onClose(n),o.onerror=n=>this._onError(n),this._setWebSocketJSONParseHandler(o),r(o)},o.onclose=n=>{o.onopen=o.onclose=null,s(n)}})}async _handshake(t=1e4){const r=this._websocket;if(r==null)return;const s=C(),o=r.onmessage,{filter:n,outFields:u,spatialReference:l}=this._config;return s.timeout(t),r.onmessage=h=>{var w;let i=null;try{i=JSON.parse(h.data)}catch{}i&&typeof i=="object"||(c.getLogger(this).error(new a("websocket-connection","Protocol violation. Handshake failed - malformed message",h.data)),s.reject(),this.destroy()),((w=i.spatialReference)==null?void 0:w.wkid)!==(l==null?void 0:l.wkid)&&(c.getLogger(this).error(new a("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${l.wkid}`,h.data)),s.reject(),this.destroy()),i.format!=="json"&&(c.getLogger(this).error(new a("websocket-connection","Protocol violation. Handshake failed - format is not set",h.data)),s.reject(),this.destroy()),n&&i.filter!==n&&c.getLogger(this).error(new a("websocket-connection","Tried to set filter, but server doesn't support it")),u&&i.outFields!==u&&c.getLogger(this).error(new a("websocket-connection","Tried to set outFields, but server doesn't support it")),r.onmessage=o;for(const y of this._outstandingMessages)r.send(JSON.stringify(y));this._outstandingMessages=[],s.resolve()},r.send(JSON.stringify({filter:n,outFields:u,format:"json",spatialReference:{wkid:l.wkid}})),s.promise}_onMessage(t){if(this.onMessage(t),"type"in t)switch(t.type){case"features":case"featureResult":for(const r of t.features)this._featureZScaler!=null&&this._featureZScaler(r.geometry),this.onFeature(r)}}_onError(t){const r="Encountered an error over WebSocket connection";this._set("errorString",r),c.getLogger(this).error("websocket-connection",r)}_onClose(t){this._websocket=null,this.notifyChange("connectionStatus"),t.code!==1e3&&c.getLogger(this).error("websocket-connection",`WebSocket closed unexpectedly with error code ${t.code}`),this.destroyed||this._open()}};d([p()],f.prototype,"connectionStatus",null),d([p()],f.prototype,"errorString",void 0),f=d([S("esri.layers.graphics.sources.connections.WebSocketConnection")],f);const M=1e4,W={maxQueryDepth:5,maxRecordCountFactor:3};let b=class extends f{constructor(e){super({...W,...e}),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||c.getLogger(this).warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");const t=this._fetchWebSocketUrl(e.streamUrls,this._config.spatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(t);const{filter:r,outFields:s}=this._config;this.destroyed||this._setFilter(r,s)}_onMessage(e){if("attributes"in e){let t;try{t=this._enrich(e),this._featureZScaler!=null&&this._featureZScaler(t.geometry)}catch(r){return void c.getLogger(this).error(new a("geoevent-connection","Failed to parse message",r))}this.onFeature(t)}else this.onMessage(e)}async _fetchServiceDefinition(e){const t={f:"json",...this._config.customParameters},r=O(e.path,{query:t,responseType:"json"}),s=(await r).data;return this._serviceDefinition=s,s}_fetchWebSocketUrl(e,t){const r=e[0],{urls:s,token:o}=r,n=this._inferWebSocketBaseUrl(s);return F(`${n}/subscribe`,{outSR:""+t.wkid,token:o})}_inferWebSocketBaseUrl(e){if(e.length===1)return e[0];for(const t of e)if(t.includes("wss"))return t;return c.getLogger(this).error(new a("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const r=this._websocket;if(r==null||e==null&&t==null)return;const s=JSON.stringify({filter:this._serializeFilter(e,t)});let o=!1;const n=C(),u=()=>{o||(this.destroyed||this._websocket!==r||c.getLogger(this).error(new a("geoevent-connection","Server timed out when setting filter")),n.reject())},l=h=>{const i=JSON.parse(h.data);i.filter&&(i.error&&(c.getLogger(this).error(new a("geoevent-connection","Failed to set service filter",i.error)),this._set("errorString",`Could not set service filter - ${i.error}`),n.reject(i.error)),this._setWebSocketJSONParseHandler(r),o=!0,n.resolve())};return r.onmessage=l,r.send(s),setTimeout(u,M),n.promise}_serializeFilter(e,t){const r={};if(e==null&&t==null)return r;if(e!=null&&e.geometry)try{const s=x(e.geometry);if(s.type!=="extent")throw new a(`Expected extent but found type ${s.type}`);r.geometry=JSON.stringify(s.shiftCentralMeridian())}catch(s){c.getLogger(this).error(new a("geoevent-connection","Encountered an error when setting connection geometryDefinition",s))}return e!=null&&e.where&&e.where!=="1 = 1"&&e.where!=="1=1"&&(r.where=e.where),t!=null&&(r.outFields=t.join(",")),r}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,r=e.attributes[t],s=this._relatedFeatures.get(r);if(!s)return c.getLogger(this).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:o,geometry:n}=s;for(const u in o)e.attributes[u]=o[u];return n&&(e.geometry=n),e.geometry||e.centroid||c.getLogger(this).error(new a("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,r=this._queryRelatedFeatures(e),s=this._queryArchive(t);await r;const o=await s;if(!o)return;for(const n of o.features)this.onFeature(this._enrich(n))}catch(e){c.getLogger(this).error(new a("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;const t=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(t)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){var y;const t=new(await E(()=>import("./FeatureLayer-D0kMrROG.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51]))).default({url:e}),{capabilities:r}=await t.load(),s=r.query.supportsMaxRecordCountFactor,o=r.query.supportsPagination,n=r.query.supportsCentroid,u=this._config.maxRecordCountFactor,l=t.capabilities.query.maxRecordCount,h=s?l*u:l,i=new $;if(i.outFields=this._config.outFields??["*"],i.where=((y=this._config.filter)==null?void 0:y.where)??"1=1",i.returnGeometry=!0,i.returnExceededLimitFeatures=!0,i.outSpatialReference=P.fromJSON(this._config.spatialReference),n&&(i.returnCentroid=!0),s&&(i.maxRecordCountFactor=u),o)return i.num=h,t.destroy(),this._queryPages(e,i);const w=await k(e,i,this._config.sourceSpatialReference);return t.destroy(),w.data}async _queryPages(e,t,r=[],s=0){t.start=t.num!=null?s*t.num:null;const{data:o}=await k(e,t,this._config.sourceSpatialReference);return o.exceededTransferLimit&&s<(this._config.maxQueryDepth??0)?(o.features.forEach(n=>r.push(n)),this._queryPages(e,t,r,s+1)):(r.forEach(n=>o.features.push(n)),o)}_addRelatedFeatures(e){const t=new Map,r=e.features,s=this._serviceDefinition.relatedFeatures.joinField;for(const o of r){const n=o.attributes[s];t.set(n,o)}this._relatedFeatures=t}};b=d([S("esri.layers.graphics.sources.connections.GeoEventConnection")],b);const T=b;let _=class extends R{constructor(e){super({}),this.connectionStatus="connected",this.errorString=null;const{geometryType:t,spatialReference:r,sourceSpatialReference:s}=e;this._featureZScaler=v(t,s,r)}normalizeCtorArgs(){return{}}updateCustomParameters(e){}sendMessageToSocket(e){}sendMessageToClient(e){if("type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)this._featureZScaler!=null&&this._featureZScaler(t.geometry),this.onFeature(t)}this.onMessage(e)}};d([p()],_.prototype,"connectionStatus",void 0),d([p()],_.prototype,"errorString",void 0),_=d([S("esri.layers.support.ClientSideConnection")],_);function q(e,t){if(e==null&&t==null)return null;const r={};return t!=null&&(r.geometry=t),e!=null&&(r.where=e),r}function B(e,t,r,s,o,n,u,l,h){const i={source:e,sourceSpatialReference:t,spatialReference:r,geometryType:s,filter:q(o,n),maxReconnectionAttempts:u,maxReconnectionInterval:l,customParameters:h};return e?e.path.startsWith("wss://")||e.path.startsWith("ws://")?new f(i):new T(i):new _(i)}export{B as createConnection}; +import{ca as L,N as a,d,y as p,f as S,bl as v,bD as F,s as c,fx as N,df as C,M as O,b0 as x,_ as E,aX as $,aS as P}from"./index-BjUNJPVf.js";import{c as k}from"./query-Bk_ITqRK.js";import"./pbfQueryUtils-CSeFSIjv.js";import"./pbf-Du8sFEWo.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./queryZScale-Dwvn5BlQ.js";let m=class extends L.EventedAccessor{destroy(){this.emit("destroy")}get connectionError(){return this.errorString?new a("stream-connection",this.errorString):null}onFeature(e){this.emit("data-received",e)}onMessage(e){this.emit("message-received",e)}};d([p({readOnly:!0})],m.prototype,"connectionError",null),m=d([S("esri.layers.support.StreamConnection")],m);const R=m;var g;(function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"})(g||(g={}));let f=class extends R{constructor(t){super({}),this._outstandingMessages=[],this.errorString=null;const{geometryType:r,spatialReference:s,sourceSpatialReference:o}=t;this._config=t,this._featureZScaler=v(r,o,s),this._open()}normalizeCtorArgs(){return{}}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),this._websocket!=null&&(this._websocket.onopen=null,this._websocket.onclose=null,this._websocket.onerror=null,this._websocket.onmessage=null,this._websocket.close()),this._websocket=null}get connectionStatus(){if(this._websocket==null)return"disconnected";switch(this._websocket.readyState){case g.CONNECTING:case g.OPEN:return"connected";case g.CLOSING:case g.CLOSED:return"disconnected"}}sendMessageToSocket(t){this._websocket!=null?this._websocket.send(JSON.stringify(t)):this._outstandingMessages.push(t)}sendMessageToClient(t){this._onMessage(t)}updateCustomParameters(t){this._config.customParameters=t,this._websocket!=null&&this._websocket.close()}async _tryCreateWebSocket(t=this._config.source.path,r=1e3,s=0){try{if(this.destroyed)return;const o=F(t,this._config.customParameters??{});this._websocket=await this._createWebSocket(o),this.notifyChange("connectionStatus")}catch(o){const n=r/1e3;return this._config.maxReconnectionAttempts&&s>=this._config.maxReconnectionAttempts?(c.getLogger(this).error(new a("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(c.getLogger(this).error(new a("websocket-connection",`Failed to connect. Attempting to reconnect in ${n}s`,o)),await N(r),this._tryCreateWebSocket(t,Math.min(1.5*r,1e3*this._config.maxReconnectionInterval),s+1))}}_setWebSocketJSONParseHandler(t){t.onmessage=r=>{try{const s=JSON.parse(r.data);this._onMessage(s)}catch(s){return void c.getLogger(this).error(new a("websocket-connection","Failed to parse message, invalid JSON",{error:s}))}}}_createWebSocket(t){return new Promise((r,s)=>{const o=new WebSocket(t);o.onopen=()=>{if(o.onopen=null,this.destroyed)return o.onclose=null,void o.close();o.onclose=n=>this._onClose(n),o.onerror=n=>this._onError(n),this._setWebSocketJSONParseHandler(o),r(o)},o.onclose=n=>{o.onopen=o.onclose=null,s(n)}})}async _handshake(t=1e4){const r=this._websocket;if(r==null)return;const s=C(),o=r.onmessage,{filter:n,outFields:u,spatialReference:l}=this._config;return s.timeout(t),r.onmessage=h=>{var w;let i=null;try{i=JSON.parse(h.data)}catch{}i&&typeof i=="object"||(c.getLogger(this).error(new a("websocket-connection","Protocol violation. Handshake failed - malformed message",h.data)),s.reject(),this.destroy()),((w=i.spatialReference)==null?void 0:w.wkid)!==(l==null?void 0:l.wkid)&&(c.getLogger(this).error(new a("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${l.wkid}`,h.data)),s.reject(),this.destroy()),i.format!=="json"&&(c.getLogger(this).error(new a("websocket-connection","Protocol violation. Handshake failed - format is not set",h.data)),s.reject(),this.destroy()),n&&i.filter!==n&&c.getLogger(this).error(new a("websocket-connection","Tried to set filter, but server doesn't support it")),u&&i.outFields!==u&&c.getLogger(this).error(new a("websocket-connection","Tried to set outFields, but server doesn't support it")),r.onmessage=o;for(const y of this._outstandingMessages)r.send(JSON.stringify(y));this._outstandingMessages=[],s.resolve()},r.send(JSON.stringify({filter:n,outFields:u,format:"json",spatialReference:{wkid:l.wkid}})),s.promise}_onMessage(t){if(this.onMessage(t),"type"in t)switch(t.type){case"features":case"featureResult":for(const r of t.features)this._featureZScaler!=null&&this._featureZScaler(r.geometry),this.onFeature(r)}}_onError(t){const r="Encountered an error over WebSocket connection";this._set("errorString",r),c.getLogger(this).error("websocket-connection",r)}_onClose(t){this._websocket=null,this.notifyChange("connectionStatus"),t.code!==1e3&&c.getLogger(this).error("websocket-connection",`WebSocket closed unexpectedly with error code ${t.code}`),this.destroyed||this._open()}};d([p()],f.prototype,"connectionStatus",null),d([p()],f.prototype,"errorString",void 0),f=d([S("esri.layers.graphics.sources.connections.WebSocketConnection")],f);const M=1e4,W={maxQueryDepth:5,maxRecordCountFactor:3};let b=class extends f{constructor(e){super({...W,...e}),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||c.getLogger(this).warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");const t=this._fetchWebSocketUrl(e.streamUrls,this._config.spatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(t);const{filter:r,outFields:s}=this._config;this.destroyed||this._setFilter(r,s)}_onMessage(e){if("attributes"in e){let t;try{t=this._enrich(e),this._featureZScaler!=null&&this._featureZScaler(t.geometry)}catch(r){return void c.getLogger(this).error(new a("geoevent-connection","Failed to parse message",r))}this.onFeature(t)}else this.onMessage(e)}async _fetchServiceDefinition(e){const t={f:"json",...this._config.customParameters},r=O(e.path,{query:t,responseType:"json"}),s=(await r).data;return this._serviceDefinition=s,s}_fetchWebSocketUrl(e,t){const r=e[0],{urls:s,token:o}=r,n=this._inferWebSocketBaseUrl(s);return F(`${n}/subscribe`,{outSR:""+t.wkid,token:o})}_inferWebSocketBaseUrl(e){if(e.length===1)return e[0];for(const t of e)if(t.includes("wss"))return t;return c.getLogger(this).error(new a("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const r=this._websocket;if(r==null||e==null&&t==null)return;const s=JSON.stringify({filter:this._serializeFilter(e,t)});let o=!1;const n=C(),u=()=>{o||(this.destroyed||this._websocket!==r||c.getLogger(this).error(new a("geoevent-connection","Server timed out when setting filter")),n.reject())},l=h=>{const i=JSON.parse(h.data);i.filter&&(i.error&&(c.getLogger(this).error(new a("geoevent-connection","Failed to set service filter",i.error)),this._set("errorString",`Could not set service filter - ${i.error}`),n.reject(i.error)),this._setWebSocketJSONParseHandler(r),o=!0,n.resolve())};return r.onmessage=l,r.send(s),setTimeout(u,M),n.promise}_serializeFilter(e,t){const r={};if(e==null&&t==null)return r;if(e!=null&&e.geometry)try{const s=x(e.geometry);if(s.type!=="extent")throw new a(`Expected extent but found type ${s.type}`);r.geometry=JSON.stringify(s.shiftCentralMeridian())}catch(s){c.getLogger(this).error(new a("geoevent-connection","Encountered an error when setting connection geometryDefinition",s))}return e!=null&&e.where&&e.where!=="1 = 1"&&e.where!=="1=1"&&(r.where=e.where),t!=null&&(r.outFields=t.join(",")),r}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,r=e.attributes[t],s=this._relatedFeatures.get(r);if(!s)return c.getLogger(this).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:o,geometry:n}=s;for(const u in o)e.attributes[u]=o[u];return n&&(e.geometry=n),e.geometry||e.centroid||c.getLogger(this).error(new a("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,r=this._queryRelatedFeatures(e),s=this._queryArchive(t);await r;const o=await s;if(!o)return;for(const n of o.features)this.onFeature(this._enrich(n))}catch(e){c.getLogger(this).error(new a("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;const t=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(t)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){var y;const t=new(await E(()=>import("./FeatureLayer-BHxNIHhy.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51]))).default({url:e}),{capabilities:r}=await t.load(),s=r.query.supportsMaxRecordCountFactor,o=r.query.supportsPagination,n=r.query.supportsCentroid,u=this._config.maxRecordCountFactor,l=t.capabilities.query.maxRecordCount,h=s?l*u:l,i=new $;if(i.outFields=this._config.outFields??["*"],i.where=((y=this._config.filter)==null?void 0:y.where)??"1=1",i.returnGeometry=!0,i.returnExceededLimitFeatures=!0,i.outSpatialReference=P.fromJSON(this._config.spatialReference),n&&(i.returnCentroid=!0),s&&(i.maxRecordCountFactor=u),o)return i.num=h,t.destroy(),this._queryPages(e,i);const w=await k(e,i,this._config.sourceSpatialReference);return t.destroy(),w.data}async _queryPages(e,t,r=[],s=0){t.start=t.num!=null?s*t.num:null;const{data:o}=await k(e,t,this._config.sourceSpatialReference);return o.exceededTransferLimit&&s<(this._config.maxQueryDepth??0)?(o.features.forEach(n=>r.push(n)),this._queryPages(e,t,r,s+1)):(r.forEach(n=>o.features.push(n)),o)}_addRelatedFeatures(e){const t=new Map,r=e.features,s=this._serviceDefinition.relatedFeatures.joinField;for(const o of r){const n=o.attributes[s];t.set(n,o)}this._relatedFeatures=t}};b=d([S("esri.layers.graphics.sources.connections.GeoEventConnection")],b);const T=b;let _=class extends R{constructor(e){super({}),this.connectionStatus="connected",this.errorString=null;const{geometryType:t,spatialReference:r,sourceSpatialReference:s}=e;this._featureZScaler=v(t,s,r)}normalizeCtorArgs(){return{}}updateCustomParameters(e){}sendMessageToSocket(e){}sendMessageToClient(e){if("type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)this._featureZScaler!=null&&this._featureZScaler(t.geometry),this.onFeature(t)}this.onMessage(e)}};d([p()],_.prototype,"connectionStatus",void 0),d([p()],_.prototype,"errorString",void 0),_=d([S("esri.layers.support.ClientSideConnection")],_);function q(e,t){if(e==null&&t==null)return null;const r={};return t!=null&&(r.geometry=t),e!=null&&(r.where=e),r}function B(e,t,r,s,o,n,u,l,h){const i={source:e,sourceSpatialReference:t,spatialReference:r,geometryType:s,filter:q(o,n),maxReconnectionAttempts:u,maxReconnectionInterval:l,customParameters:h};return e?e.path.startsWith("wss://")||e.path.startsWith("ws://")?new f(i):new T(i):new _(i)}export{B as createConnection}; diff --git a/assets/dataUtils-BFJflGP5.js b/assets/dataUtils-DzOfgSpi.js similarity index 99% rename from assets/dataUtils-BFJflGP5.js rename to assets/dataUtils-DzOfgSpi.js index 4b8b1b4..abeb78a 100644 --- a/assets/dataUtils-BFJflGP5.js +++ b/assets/dataUtils-DzOfgSpi.js @@ -1 +1 @@ -import{d as W,y as X,e1 as Dt,f as Rt,aU as Lt,N as Nt,aV as Et,s as Z,aY as jt,E as nt,at as Ot,aj as Gt,aE as qt,i3 as Ut,gz as Wt}from"./index-CEWggaxV.js";let gt=class{constructor(e=null,n=null,r=null){this.minValue=e,this.maxValue=n,this.noDataValue=r}};const zt=9999999e31,Xt=2e-7,Jt={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767],u32:[0,4294967295],s32:[-2147483648,2147483647],f32:[-34028234663852886e22,34028234663852886e22],f64:[-Number.MAX_VALUE,Number.MAX_VALUE],unknown:void 0,c64:void 0,c128:void 0};function ht(t){return Jt[t]??[-34028234663852886e22,34028234663852886e22]}function xe(t,e){return t==null||e==null?"s32":t<0?t>=-128&&e<128?"s8":t>=-32768&&e<32768?"s16":"s32":e<256?"u8":e<65536?"u16":"u32"}function we(t){return((t==null?void 0:t.startsWith("s"))||(t==null?void 0:t.startsWith("u")))??!1}function ye(t,e,n){var p,f;if(t.depthCount&&t.depthCount>1)return;const{pixels:r,statistics:a,pixelType:i}=t,o=r[0].length,u=t.bandMasks??[],h=t.mask??new Uint8Array(o).fill(255),s=i==="f32"||i==="f64",l=ht(i);let c=!1;for(let d=0;dm+Number.EPSILON||w=zt?Xt*Math.abs(m):i==="f32"?2**-23:Number.EPSILON);for(let y=0;y1?u:null,t.mask=h),c&&"updateStatistics"in t&&t.updateStatistics()}var K;let O=K=class extends Lt{static createEmptyBand(t,e){return new(K.getPixelArrayConstructor(t))(e)}static combineBandMasks(t){if(t.length<2)return t[0];const e=t[0].length,n=new Uint8Array(e).fill(255);for(let r=0;rthis._calculateBandStatistics(n,this.mask));const t=this.mask;let e=0;if(t!=null)for(let n=0;nn?n:up>=e.length),i=r===t.length&&!t.some((p,f)=>p!==f);if(a||i)return this;const o=((c=this.bandMasks)==null?void 0:c.length)===r?t.map(p=>this.bandMasks[p]):void 0;let{mask:u,validPixelCount:h}=this;const{width:s,height:l}=this;return o!=null&&o.length&&(u=K.combineBandMasks(o),h=u.filter(p=>!!p).length),new K({pixelType:this.pixelType,width:s,height:l,mask:u,bandMasks:o,validPixelCount:h,maskIsAlpha:this.maskIsAlpha,pixels:t.map(p=>e[p]),statistics:n&&t.map(p=>n[p])})}clone(){const t=new K({width:this.width,height:this.height,pixelType:this.pixelType,maskIsAlpha:this.maskIsAlpha,validPixelCount:this.validPixelCount});let e;this.mask!=null&&(this.mask instanceof Uint8Array?t.mask=new Uint8Array(this.mask):t.mask=this.mask.slice(0)),this.bandMasks&&(t.bandMasks=this.bandMasks.map(r=>new Uint8Array(r)));const n=K.getPixelArrayConstructor(this.pixelType);if(this.pixels&&this.pixels.length>0){t.pixels=[];const r=!!this.pixels[0].slice;for(e=0;e=3?(o=a[1],u=a[2]):a.length===2&&(o=a[1]);const s=new Uint32Array(t),l=this.width*this.height;if(i.length===l)if(e!=null&&e.length===l)if(n)for(h=0;h0){for(const m of r)if(m.minValue!=null&&(o=Math.min(o,m.minValue)),m.maxValue!=null&&m.minValue!=null){const x=m.maxValue-m.minValue;u=Math.max(u,x)}i=255/u}else{let m=255;a==="s8"?(o=-128,m=127):a==="u16"?m=65535:a==="s16"?(o=-32768,m=32767):a==="u32"?m=4294967295:a==="s32"?(o=-2147483648,m=2147483647):a==="f32"?(o=-34e38,m=34e38):a==="f64"&&(o=-Number.MAX_VALUE,m=Number.MAX_VALUE),i=255/(m-o)}const h=new Uint32Array(t),s=this.width*this.height;let l,c,p,f,d;if(l=c=p=e[0],l.length!==s)return Z.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");if(e.length>=2)if(c=e[1],e.length>=3&&(p=e[2]),n!=null&&n.length===s)for(f=0;f=3?(a=e[1],i=e[2]):e.length===2&&(a=e[1]);const u=this.width*this.height;if(r.length!==u)return Z.getLogger(this).error("getAsRGBAFloat()","Unable to convert to RGBA. The pixelblock is invalid.");let h=0;if(n!=null&&n.length===u)for(o=0;or?o:r);else for(i=0;ir?o:r;return new gt(n,r)}};W([X({json:{write:!0}})],O.prototype,"width",void 0),W([X({json:{write:!0}})],O.prototype,"height",void 0),W([X({json:{write:!0}})],O.prototype,"pixelType",void 0),W([Dt("pixelType")],O.prototype,"castPixelType",null),W([X({json:{write:!0}})],O.prototype,"validPixelCount",void 0),W([X({json:{write:!0}})],O.prototype,"mask",void 0),W([X({json:{write:!0}})],O.prototype,"maskIsAlpha",void 0),W([X({json:{write:!0}})],O.prototype,"pixels",void 0),W([X()],O.prototype,"premultiplyAlpha",void 0),W([X({json:{write:!0}})],O.prototype,"statistics",void 0),W([X({json:{write:!0}})],O.prototype,"depthCount",void 0),W([X({json:{write:!0}})],O.prototype,"noDataValues",void 0),W([X({json:{write:!0}})],O.prototype,"bandMasks",void 0),O=K=W([Rt("esri.layers.support.PixelBlock")],O);const _=O;var xt,wt;(function(t){t[t.matchAny=0]="matchAny",t[t.matchAll=1]="matchAll"})(xt||(xt={})),function(t){t[t.bestMatch=0]="bestMatch",t[t.fail=1]="fail"}(wt||(wt={}));const ke=6;function R(t){return t!=null&&t.declaredClass==="esri.layers.support.PixelBlock"&&t.pixels&&t.pixels.length>0}function Me(t){var l;if(!(t!=null&&t.length)||t.some(c=>!R(c)))return null;if(t.length===1)return((l=t[0])==null?void 0:l.clone())??null;const e=t,{width:n,height:r,pixelType:a}=e[0];if(e.some(c=>c.width!==n||c.height!==r))return null;const i=e.map(({mask:c})=>c).filter(c=>c!=null);let o=null;i.length&&(o=new Uint8Array(n*r),o.set(i[0]),i.length>1&&$t(i.slice(1),o));const u=[];e.forEach(({pixels:c})=>u.push(...c));const h=e.map(({statistics:c})=>c).filter(c=>c==null?void 0:c.length),s=[];return h.forEach(c=>s.push(...c)),new _({pixelType:a,width:n,height:r,mask:o,pixels:u,statistics:s.length?s:null})}function Ae(t){if(!t)return;const e=t.colormap;if(!e||e.length===0)return;const n=e.sort((c,p)=>c[0]-p[0]);let r=0;n[0][0]<0&&(r=n[0][0]);const a=Math.max(256,n[n.length-1][0]-r+1),i=new Uint8Array(4*a),o=[];let u,h=0,s=0;const l=n[0].length===5;if(a>65536)return n.forEach(c=>{o[c[0]-r]=l?c.slice(1):c.slice(1).concat([255])}),{indexed2DColormap:o,offset:r,alphaSpecified:l};if(t.fillUnspecified)for(u=n[s],h=u[0]-r;hw?a[l]=0:(p[l]=o[x],f[l]=o[x+1],d[l]=o[x+2],a[l]=o[x+3]));else{for(a=new Uint8Array(i),l=0;lw?a[l]=0:(p[l]=o[x],f[l]=o[x+1],d[l]=o[x+2],a[l]=o[x+3]);n.mask=a}}else if(u)if(a!=null)for(l=0;li));const u=[],h=e.outputPixelType||"u8";for(let l=0;l1;){if(s===l.value){m=!0;break}s>l.value?c=d:p=d,d=Math.floor((c+p)/2),l=e[Math.floor(d)]}m||(s===e[c].value?(l=e[c],m=!0):s===e[p].value?(l=e[p],m=!0):se[c].value&&(sM-d);m[0]=a[0],m[m.length-1]=a[a.length-1]+(s?1e-6:0);const x=a.length/2,[w,A]=ht(o);for(let M=0;M=0;$--)if(v===m[2*$]||v>m[2*$]&&vA?A:v=u[b]&&v<=u[b+1]){c[y]=0,f[y]=0;break}}}return new _({width:n,height:r,pixelType:o,pixels:[c],mask:f})}function yt(t,e,n,r){const a=n!=null&&n.length>=2?new Set(n):null,i=(n==null?void 0:n.length)===1?n[0]:null,o=!!(e!=null&&e.length);for(let u=0;u=e[l]&&h<=e[l+1]){s=!0;break}s||(r[u]=0)}r[u]&&(h===i||a!=null&&a.has(h))&&(r[u]=0)}}function kt(t,e){const n=t[0].length;for(let r=0;rx-1e-6);m[0]=n[0],o&&(m[m.length-1]=n[n.length-1]);for(let x=0;xf?f:r[x]d.pixelBlock);if((n==null?void 0:n.pixelBlock)==null)return null;const r=(n.extent.xmax-n.extent.xmin)/n.pixelBlock.width,a=(n.extent.ymax-n.extent.ymin)/n.pixelBlock.height,i=.01*Math.min(r,a),o=t.sort((d,m)=>Math.abs(d.extent.ymax-m.extent.ymax)>i?m.extent.ymax-d.extent.ymax:Math.abs(d.extent.xmin-m.extent.xmin)>i?d.extent.xmin-m.extent.xmin:0),u=Math.min.apply(null,o.map(d=>d.extent.xmin)),h=Math.min.apply(null,o.map(d=>d.extent.ymin)),s=Math.max.apply(null,o.map(d=>d.extent.xmax)),l=Math.max.apply(null,o.map(d=>d.extent.ymax)),c={x:Math.round((e.xmin-u)/r),y:Math.round((l-e.ymax)/a)},p={width:Math.round((s-u)/r),height:Math.round((l-h)/a)},f={width:Math.round((e.xmax-e.xmin)/r),height:Math.round((e.ymax-e.ymin)/a)};return Math.round(p.width/n.pixelBlock.width)*Math.round(p.height/n.pixelBlock.height)!==o.length||c.x<0||c.y<0||p.widthd.pixelBlock),p,{clipOffset:c,clipSize:f})}}function ut(t,e,n,r,a,i){const{width:o,height:u}=n.block,{x:h,y:s}=n.offset,{width:l,height:c}=n.mosaic,p=Ht(o,u,r,a,h,s,l,c);let f=0,d=0;if(i){const m=i.hasGCSSShiftTransform?360:i.halfWorldWidth??0,x=o*i.resolutionX,w=i.startX+r*x;wm?d=i.rightPadding:w>=m&&(f=i.leftMargin-i.rightPadding,d=0)}if(p.xmax-=d,typeof e!="number")for(let m=p.ymin;mR(P));if(u==null)return null;const h=a?a.width:e.width,s=a?a.height:e.height,l=u.width,c=u.height,p=e.width/l,f=e.height/c,d={offset:r||{x:0,y:0},mosaic:a||e,block:{width:l,height:c}},m=u.pixelType,x=_.getPixelArrayConstructor(m),w=u.pixels.length,A=[];let k,M;for(let P=0;PP==null||P.mask!=null&&P.mask.length>0),y=t.some(P=>(P==null?void 0:P.bandMasks)&&P.bandMasks.length>1),v=g?new Uint8Array(h*s):void 0,b=y?[]:void 0;if(v){for(let P=0;Pw!=null);if(r==null)return null;const a=t.some(w=>w==null||!!w.mask),{width:i,height:o}=e,u=a?new Uint8Array(i*o):null,{blockWidths:h}=n,s=[],l=r.getPlaneCount(),c=_.getPixelArrayConstructor(r.pixelType);if(a)for(let w=0,A=0;w(w==null?void 0:w.bandMasks)&&w.bandMasks.length>1),f=p?[]:void 0,d=i*o;for(let w=0;wr||h>a||i===0&&o===0&&u===r&&h===a)return t;t.mask||(t.mask=new Uint8Array(r*a));const s=t.mask;for(let l=0;l=h||p=u?0:1}return t.updateStatistics(),t}function Qt(t){if(!R(t))return null;const e=t.clone(),{width:n,height:r,pixels:a}=t,i=a[0],o=e.pixels[0],u=t.mask;for(let h=2;he&&(n=i.value,e=r),i=a.next();return n}function rt(t,e,n){if(n===0)return;const r=t.get(e);r===1?t.delete(e):t.set(e,r-1)}function lt(t,e,n){n!==0&&t.set(e,t.has(e)?t.get(e)+1:1)}function Tt(t,e,n){let{x:r,y:a}=e;const{width:i,height:o}=n;if(r===0&&a===0&&o===t.height&&i===t.width)return t;const{width:u,height:h}=t,s=Math.max(0,a),l=Math.max(0,r),c=Math.min(r+i,u),p=Math.min(a+o,h);if(c<0||p<0||!R(t))return null;r=Math.max(0,-r),a=Math.max(0,-a);const{pixels:f}=t,d=i*o,m=f.length,x=[];for(let M=0;M0;f--)p=It(p,o);return p}function Bt(t,e,n,r,a=0){const{width:i,height:o}=t,{width:u,height:h}=e,s=r.cols,l=r.rows,c=Math.ceil(u/s-.1/s),p=Math.ceil(h/l-.1/l);let f,d,m,x,w,A,k;const M=c*s,g=M*p*l,y=new Float32Array(g),v=new Float32Array(g),b=new Uint32Array(g),$=new Uint32Array(g);let T,P,U=0;for(let I=0;I{const B=U instanceof Float32Array||U instanceof Float64Array?0:.5;for(let F=0;F0){const[Y,it]=j(A,v,e,h),[st,D]=j(x,w,e,h);U.push(Y),U.push(it),U.push(H),U.push(et),U.push(st),U.push(D)}else{const[Y,it]=j(A,k,e,h),[st,D]=j(M,g,e,h),[N,ct]=j(b,$,e,h);I.push(H),I.push(et),I.push(N),I.push(ct),I.push(st),I.push(D),I.push(Y),I.push(it)}v+=i,w+=i,k+=i,g+=i,$+=i}const[C,S]=j(s+m,l+o,e,h),B=(r/2+c)*d,[F,V]=j(s+B,l+o,e,h),[E,q]=j(s+m,l-u,e,h),[L,G]=j(s+B,l-u,e,h);return{pennants:U,barbs:I,shaft:[C,S,F,V,E,q,L,G]}}function j(t,e,n,r=1){const a=Math.sqrt(t*t+e*e)/r,i=(2*Math.PI+Math.atan2(e,t))%(2*Math.PI);return[a,(2*Math.PI+i-n)%(2*Math.PI)]}const ot=[0,1,3,6,10,16,21,27,33,40,47,55,63],ee=[0,.5,1,1.5,2],ne=[0,.25,.5,1,1.5,2,2.5,3,3.5,4];function Q(t,e,n,r){const a=mt(r||"knots",n);let i;for(i=1;ig>0).length:p*f,A=new Float32Array(w*h),k=new Uint32Array(s*w),M=e.invertDirection?Vt(0,0,0,!1):Zt;for(let g=0;g=dt){const w=(u[m]+360)%360/180*Math.PI,{pennants:A,barbs:k,shaft:M}=ft[Math.min(Math.floor(x/5),29)];if(A.length+k.length===0)continue;let g=s.length/h;const y=(d+.5)/r,v=(f+.5)/a;for(let b=0;b=(T-b)*(P-$)*(1-a)){w[v]=1;const[U,I]=Ct([m[v]/y,x[v]/y]);m[v]=U,x[v]=I}else w[v]=0,m[v]=0,x[v]=0}const k=new _({width:p,height:f,pixels:[m,x],mask:w});return k.updateStatistics(),k}const J=()=>Z.getLogger("esri.views.2d.engine.flow.dataUtils"),oe=10;async function je(t,e,n,r){const a=performance.now(),i=ae(e,n),o=performance.now(),u=ce(e,i,n.width,n.height),h=performance.now(),s=fe(u,!0),l=performance.now(),c=t==="Streamlines"?pe(s,oe):de(s),p=performance.now();return nt("esri-2d-profiler")&&(J().info("I.1","_createFlowFieldFromData (ms)",Math.round(o-a)),J().info("I.2","_getStreamlines (ms)",Math.round(h-o)),J().info("I.3","createAnimatedLinesData (ms)",Math.round(l-h)),J().info("I.4","create{Streamlines|Particles}Mesh (ms)",Math.round(p-l)),J().info("I.5","createFlowMesh (ms)",Math.round(p-a)),J().info("I.6","Mesh size (bytes)",c.vertexData.buffer.byteLength+c.indexData.buffer.byteLength)),await Promise.resolve(),Ot(r),c}function ae(t,e){const n=ue(e.data,e.width,e.height,t.smoothing);return t.interpolate?(r,a)=>{const i=Math.floor(r),o=Math.floor(a);if(i<0||i>=e.width)return[0,0];if(o<0||o>=e.height)return[0,0];const u=r-i,h=a-o,s=i,l=o,c=i{const i=Math.round(r),o=Math.round(a);return i<0||i>=e.width||o<0||o>=e.height?[0,0]:[n[2*(o*e.width+i)],n[2*(o*e.width+i)+1]]}}function he(t,e,n,r,a,i,o,u,h){const s=[];let l=n,c=r,p=0,[f,d]=e(l,c);f*=t.velocityScale,d*=t.velocityScale;const m=Math.sqrt(f*f+d*d);let x,w;s.push({x:l,y:c,t:p,speed:m});for(let A=0;At.maxTurnAngle)return s;if(t.collisions){const b=Math.round(l*h),$=Math.round(c*h);if(b<0||b>o-1||$<0||$>u-1)return s;const T=i[$*o+b];if(T!==-1&&T!==a)return s;i[$*o+b]=a}s.push({x:l,y:c,t:p,speed:g}),x=y,w=v}return s}function ce(t,e,n,r){const a=[],i=new Ut,o=1/Math.max(t.lineCollisionWidth,1),u=Math.round(n*o),h=Math.round(r*o),s=new Int32Array(u*h);for(let c=0;cc.sort-p.sort);for(const{x:c,y:p}of l)if(i.getFloat()=e)continue;const d=i[f+a];c+=d*t[2*(s*e+(l+f))],p+=d*t[2*(s*e+(l+f))+1]}u[2*(s*e+l)]=c,u[2*(s*e+l)+1]=p}const h=new Float32Array(t.length);for(let s=0;s=n)continue;const d=i[f+a];c+=d*u[2*((l+f)*e+s)],p+=d*u[2*((l+f)*e+s)+1]}h[2*(l*e+s)]=c,h[2*(l*e+s)+1]=p}return h}function fe(t,e){const n=new Ut,r=t.reduce((h,s)=>h+s.length,0),a=new Float32Array(4*r),i=new Array(t.length);let o=0,u=0;for(const h of t){const s=o;for(const l of h)a[4*o]=l.x,a[4*o+1]=l.y,a[4*o+2]=l.t,a[4*o+3]=l.speed,o++;i[u++]={startVertex:s,numberOfVertices:h.length,totalTime:h[h.length-1].t,timeSeed:e?n.getFloat():0}}return{lineVertices:a,lineDescriptors:i}}function pe(t,e){const{lineVertices:r,lineDescriptors:a}=t;let i=0,o=0;for(const f of a)i+=2*f.numberOfVertices,o+=6*(f.numberOfVertices-1);const u=new Float32Array(i*9),h=new Uint32Array(o);let s=0,l=0;function c(){h[l++]=s-2,h[l++]=s,h[l++]=s-1,h[l++]=s,h[l++]=s+1,h[l++]=s-1}function p(f,d,m,x,w,A,k,M){const g=s*9;let y=0;u[g+y++]=f,u[g+y++]=d,u[g+y++]=1,u[g+y++]=m,u[g+y++]=A,u[g+y++]=k,u[g+y++]=x/2,u[g+y++]=w/2,u[g+y++]=M,s++,u[g+y++]=f,u[g+y++]=d,u[g+y++]=-1,u[g+y++]=m,u[g+y++]=A,u[g+y++]=k,u[g+y++]=-x/2,u[g+y++]=-w/2,u[g+y++]=M,s++}for(const f of a){const{totalTime:d,timeSeed:m}=f;let x=null,w=null,A=null,k=null,M=null,g=null;for(let y=0;y0){P=v-x,U=b-w;const S=Math.sqrt(P*P+U*U);if(P/=S,U/=S,y>1){let B=P+M,F=U+g;const V=Math.sqrt(B*B+F*F);B/=V,F/=V;const E=Math.min(1/(B*P+F*U),e);B*=E,F*=E,I=-F,C=B}else I=-U,C=P;I!==null&&C!==null&&(p(x,w,A,I,C,d,m,T),c())}x=v,w=b,A=$,M=P,g=U,k=T}p(x,w,A,-g,M,d,m,k)}return{vertexData:u,indexData:h}}function de(t){const{lineVertices:a,lineDescriptors:i}=t;let o=0,u=0;for(const S of i){const B=S.numberOfVertices-1;o+=4*B*2,u+=6*B*2}const h=new Float32Array(o*16),s=new Uint32Array(u);let l,c,p,f,d,m,x,w,A,k,M,g,y,v,b=0,$=0;function T(){s[$++]=b-8,s[$++]=b-7,s[$++]=b-6,s[$++]=b-7,s[$++]=b-5,s[$++]=b-6,s[$++]=b-4,s[$++]=b-3,s[$++]=b-2,s[$++]=b-3,s[$++]=b-1,s[$++]=b-2}function P(S,B,F,V,E,q,L,G,z,H,et,Y,it,st){const D=b*16;let N=0;for(const ct of[1,2])for(const _t of[1,2,3,4])h[D+N++]=S,h[D+N++]=B,h[D+N++]=F,h[D+N++]=V,h[D+N++]=L,h[D+N++]=G,h[D+N++]=z,h[D+N++]=H,h[D+N++]=ct,h[D+N++]=_t,h[D+N++]=it,h[D+N++]=st,h[D+N++]=E/2,h[D+N++]=q/2,h[D+N++]=et/2,h[D+N++]=Y/2,b++}function U(S,B){let F=A+M,V=k+g;const E=Math.sqrt(F*F+V*V);F/=E,V/=E;const q=A*F+k*V;F/=q,V/=q;let L=M+y,G=g+v;const z=Math.sqrt(L*L+G*G);L/=z,G/=z;const H=M*L+g*G;L/=H,G/=H,P(l,c,p,f,-V,F,d,m,x,w,-G,L,S,B),T()}function I(S,B,F,V,E,q){if(A=M,k=g,M=y,g=v,A==null&&k==null&&(A=M,k=g),d!=null&&m!=null){y=S-d,v=B-m;const L=Math.sqrt(y*y+v*v);y/=L,v/=L}A!=null&&k!=null&&U(E,q),l=d,c=m,p=x,f=w,d=S,m=B,x=F,w=V}function C(S,B){A=M,k=g,M=y,g=v,A==null&&k==null&&(A=M,k=g),A!=null&&k!=null&&U(S,B)}for(const S of i){l=null,c=null,p=null,f=null,d=null,m=null,x=null,w=null,A=null,k=null,M=null,g=null,y=null,v=null;const{totalTime:B,timeSeed:F}=S;for(let V=0;V=n||(A.data[2*(g*n+k+y)]=M.data[2*(g*M.width+y)],A.data[2*(g*n+k+y)+1]=M.data[2*(g*M.width+y)+1],A.mask[g*n+k+y]=M.mask[g*M.width+y]);k+=M.width}return nt("esri-2d-profiler")&&J().info("I.10","loadImagery, general exit (ms)",Math.round(performance.now()-o)),A}async function vt(t,e,n,r,a,i){var s;const o={requestProjectedLocalDirections:!0,signal:i};if(a!=null&&(o.timeExtent=a),t.type==="imagery"){await t.load({signal:i});const l=t.rasterInfo.dataType,c=await t.fetchImage(e,n,r,o);return((s=c==null?void 0:c.pixelData)==null?void 0:s.pixelBlock)==null?{data:new Float32Array(n*r*2),mask:new Uint8Array(n*r),width:n,height:r}:bt(l,c.pixelData.pixelBlock)}await t.load({signal:i});const u=t.serviceRasterInfo.dataType,h=await t.fetchPixels(e,n,r,o);return(h==null?void 0:h.pixelBlock)==null?{data:new Float32Array(n*r*2),mask:new Uint8Array(n*r),width:n,height:r}:bt(u,h.pixelBlock)}export{Te as A,Pt as B,Pe as C,_e as D,Fe as E,Be as M,Ve as R,Ee as S,Se as T,Kt as U,Ce as W,re as _,De as a,Ne as b,ye as c,xe as d,at as e,At as f,Oe as g,mt as h,ht as i,be as j,Ue as k,Ct as l,Le as m,ve as n,R as o,Re as p,Ae as q,we as r,je as s,Me as t,_ as u,wt as v,xt as w,Ie as x,ke as y,$e as z}; +import{d as W,y as X,e1 as Dt,f as Rt,aU as Lt,N as Nt,aV as Et,s as Z,aY as jt,E as nt,at as Ot,aj as Gt,aE as qt,i3 as Ut,gz as Wt}from"./index-BjUNJPVf.js";let gt=class{constructor(e=null,n=null,r=null){this.minValue=e,this.maxValue=n,this.noDataValue=r}};const zt=9999999e31,Xt=2e-7,Jt={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767],u32:[0,4294967295],s32:[-2147483648,2147483647],f32:[-34028234663852886e22,34028234663852886e22],f64:[-Number.MAX_VALUE,Number.MAX_VALUE],unknown:void 0,c64:void 0,c128:void 0};function ht(t){return Jt[t]??[-34028234663852886e22,34028234663852886e22]}function xe(t,e){return t==null||e==null?"s32":t<0?t>=-128&&e<128?"s8":t>=-32768&&e<32768?"s16":"s32":e<256?"u8":e<65536?"u16":"u32"}function we(t){return((t==null?void 0:t.startsWith("s"))||(t==null?void 0:t.startsWith("u")))??!1}function ye(t,e,n){var p,f;if(t.depthCount&&t.depthCount>1)return;const{pixels:r,statistics:a,pixelType:i}=t,o=r[0].length,u=t.bandMasks??[],h=t.mask??new Uint8Array(o).fill(255),s=i==="f32"||i==="f64",l=ht(i);let c=!1;for(let d=0;dm+Number.EPSILON||w=zt?Xt*Math.abs(m):i==="f32"?2**-23:Number.EPSILON);for(let y=0;y1?u:null,t.mask=h),c&&"updateStatistics"in t&&t.updateStatistics()}var K;let O=K=class extends Lt{static createEmptyBand(t,e){return new(K.getPixelArrayConstructor(t))(e)}static combineBandMasks(t){if(t.length<2)return t[0];const e=t[0].length,n=new Uint8Array(e).fill(255);for(let r=0;rthis._calculateBandStatistics(n,this.mask));const t=this.mask;let e=0;if(t!=null)for(let n=0;nn?n:up>=e.length),i=r===t.length&&!t.some((p,f)=>p!==f);if(a||i)return this;const o=((c=this.bandMasks)==null?void 0:c.length)===r?t.map(p=>this.bandMasks[p]):void 0;let{mask:u,validPixelCount:h}=this;const{width:s,height:l}=this;return o!=null&&o.length&&(u=K.combineBandMasks(o),h=u.filter(p=>!!p).length),new K({pixelType:this.pixelType,width:s,height:l,mask:u,bandMasks:o,validPixelCount:h,maskIsAlpha:this.maskIsAlpha,pixels:t.map(p=>e[p]),statistics:n&&t.map(p=>n[p])})}clone(){const t=new K({width:this.width,height:this.height,pixelType:this.pixelType,maskIsAlpha:this.maskIsAlpha,validPixelCount:this.validPixelCount});let e;this.mask!=null&&(this.mask instanceof Uint8Array?t.mask=new Uint8Array(this.mask):t.mask=this.mask.slice(0)),this.bandMasks&&(t.bandMasks=this.bandMasks.map(r=>new Uint8Array(r)));const n=K.getPixelArrayConstructor(this.pixelType);if(this.pixels&&this.pixels.length>0){t.pixels=[];const r=!!this.pixels[0].slice;for(e=0;e=3?(o=a[1],u=a[2]):a.length===2&&(o=a[1]);const s=new Uint32Array(t),l=this.width*this.height;if(i.length===l)if(e!=null&&e.length===l)if(n)for(h=0;h0){for(const m of r)if(m.minValue!=null&&(o=Math.min(o,m.minValue)),m.maxValue!=null&&m.minValue!=null){const x=m.maxValue-m.minValue;u=Math.max(u,x)}i=255/u}else{let m=255;a==="s8"?(o=-128,m=127):a==="u16"?m=65535:a==="s16"?(o=-32768,m=32767):a==="u32"?m=4294967295:a==="s32"?(o=-2147483648,m=2147483647):a==="f32"?(o=-34e38,m=34e38):a==="f64"&&(o=-Number.MAX_VALUE,m=Number.MAX_VALUE),i=255/(m-o)}const h=new Uint32Array(t),s=this.width*this.height;let l,c,p,f,d;if(l=c=p=e[0],l.length!==s)return Z.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");if(e.length>=2)if(c=e[1],e.length>=3&&(p=e[2]),n!=null&&n.length===s)for(f=0;f=3?(a=e[1],i=e[2]):e.length===2&&(a=e[1]);const u=this.width*this.height;if(r.length!==u)return Z.getLogger(this).error("getAsRGBAFloat()","Unable to convert to RGBA. The pixelblock is invalid.");let h=0;if(n!=null&&n.length===u)for(o=0;or?o:r);else for(i=0;ir?o:r;return new gt(n,r)}};W([X({json:{write:!0}})],O.prototype,"width",void 0),W([X({json:{write:!0}})],O.prototype,"height",void 0),W([X({json:{write:!0}})],O.prototype,"pixelType",void 0),W([Dt("pixelType")],O.prototype,"castPixelType",null),W([X({json:{write:!0}})],O.prototype,"validPixelCount",void 0),W([X({json:{write:!0}})],O.prototype,"mask",void 0),W([X({json:{write:!0}})],O.prototype,"maskIsAlpha",void 0),W([X({json:{write:!0}})],O.prototype,"pixels",void 0),W([X()],O.prototype,"premultiplyAlpha",void 0),W([X({json:{write:!0}})],O.prototype,"statistics",void 0),W([X({json:{write:!0}})],O.prototype,"depthCount",void 0),W([X({json:{write:!0}})],O.prototype,"noDataValues",void 0),W([X({json:{write:!0}})],O.prototype,"bandMasks",void 0),O=K=W([Rt("esri.layers.support.PixelBlock")],O);const _=O;var xt,wt;(function(t){t[t.matchAny=0]="matchAny",t[t.matchAll=1]="matchAll"})(xt||(xt={})),function(t){t[t.bestMatch=0]="bestMatch",t[t.fail=1]="fail"}(wt||(wt={}));const ke=6;function R(t){return t!=null&&t.declaredClass==="esri.layers.support.PixelBlock"&&t.pixels&&t.pixels.length>0}function Me(t){var l;if(!(t!=null&&t.length)||t.some(c=>!R(c)))return null;if(t.length===1)return((l=t[0])==null?void 0:l.clone())??null;const e=t,{width:n,height:r,pixelType:a}=e[0];if(e.some(c=>c.width!==n||c.height!==r))return null;const i=e.map(({mask:c})=>c).filter(c=>c!=null);let o=null;i.length&&(o=new Uint8Array(n*r),o.set(i[0]),i.length>1&&$t(i.slice(1),o));const u=[];e.forEach(({pixels:c})=>u.push(...c));const h=e.map(({statistics:c})=>c).filter(c=>c==null?void 0:c.length),s=[];return h.forEach(c=>s.push(...c)),new _({pixelType:a,width:n,height:r,mask:o,pixels:u,statistics:s.length?s:null})}function Ae(t){if(!t)return;const e=t.colormap;if(!e||e.length===0)return;const n=e.sort((c,p)=>c[0]-p[0]);let r=0;n[0][0]<0&&(r=n[0][0]);const a=Math.max(256,n[n.length-1][0]-r+1),i=new Uint8Array(4*a),o=[];let u,h=0,s=0;const l=n[0].length===5;if(a>65536)return n.forEach(c=>{o[c[0]-r]=l?c.slice(1):c.slice(1).concat([255])}),{indexed2DColormap:o,offset:r,alphaSpecified:l};if(t.fillUnspecified)for(u=n[s],h=u[0]-r;hw?a[l]=0:(p[l]=o[x],f[l]=o[x+1],d[l]=o[x+2],a[l]=o[x+3]));else{for(a=new Uint8Array(i),l=0;lw?a[l]=0:(p[l]=o[x],f[l]=o[x+1],d[l]=o[x+2],a[l]=o[x+3]);n.mask=a}}else if(u)if(a!=null)for(l=0;li));const u=[],h=e.outputPixelType||"u8";for(let l=0;l1;){if(s===l.value){m=!0;break}s>l.value?c=d:p=d,d=Math.floor((c+p)/2),l=e[Math.floor(d)]}m||(s===e[c].value?(l=e[c],m=!0):s===e[p].value?(l=e[p],m=!0):se[c].value&&(sM-d);m[0]=a[0],m[m.length-1]=a[a.length-1]+(s?1e-6:0);const x=a.length/2,[w,A]=ht(o);for(let M=0;M=0;$--)if(v===m[2*$]||v>m[2*$]&&vA?A:v=u[b]&&v<=u[b+1]){c[y]=0,f[y]=0;break}}}return new _({width:n,height:r,pixelType:o,pixels:[c],mask:f})}function yt(t,e,n,r){const a=n!=null&&n.length>=2?new Set(n):null,i=(n==null?void 0:n.length)===1?n[0]:null,o=!!(e!=null&&e.length);for(let u=0;u=e[l]&&h<=e[l+1]){s=!0;break}s||(r[u]=0)}r[u]&&(h===i||a!=null&&a.has(h))&&(r[u]=0)}}function kt(t,e){const n=t[0].length;for(let r=0;rx-1e-6);m[0]=n[0],o&&(m[m.length-1]=n[n.length-1]);for(let x=0;xf?f:r[x]d.pixelBlock);if((n==null?void 0:n.pixelBlock)==null)return null;const r=(n.extent.xmax-n.extent.xmin)/n.pixelBlock.width,a=(n.extent.ymax-n.extent.ymin)/n.pixelBlock.height,i=.01*Math.min(r,a),o=t.sort((d,m)=>Math.abs(d.extent.ymax-m.extent.ymax)>i?m.extent.ymax-d.extent.ymax:Math.abs(d.extent.xmin-m.extent.xmin)>i?d.extent.xmin-m.extent.xmin:0),u=Math.min.apply(null,o.map(d=>d.extent.xmin)),h=Math.min.apply(null,o.map(d=>d.extent.ymin)),s=Math.max.apply(null,o.map(d=>d.extent.xmax)),l=Math.max.apply(null,o.map(d=>d.extent.ymax)),c={x:Math.round((e.xmin-u)/r),y:Math.round((l-e.ymax)/a)},p={width:Math.round((s-u)/r),height:Math.round((l-h)/a)},f={width:Math.round((e.xmax-e.xmin)/r),height:Math.round((e.ymax-e.ymin)/a)};return Math.round(p.width/n.pixelBlock.width)*Math.round(p.height/n.pixelBlock.height)!==o.length||c.x<0||c.y<0||p.widthd.pixelBlock),p,{clipOffset:c,clipSize:f})}}function ut(t,e,n,r,a,i){const{width:o,height:u}=n.block,{x:h,y:s}=n.offset,{width:l,height:c}=n.mosaic,p=Ht(o,u,r,a,h,s,l,c);let f=0,d=0;if(i){const m=i.hasGCSSShiftTransform?360:i.halfWorldWidth??0,x=o*i.resolutionX,w=i.startX+r*x;wm?d=i.rightPadding:w>=m&&(f=i.leftMargin-i.rightPadding,d=0)}if(p.xmax-=d,typeof e!="number")for(let m=p.ymin;mR(P));if(u==null)return null;const h=a?a.width:e.width,s=a?a.height:e.height,l=u.width,c=u.height,p=e.width/l,f=e.height/c,d={offset:r||{x:0,y:0},mosaic:a||e,block:{width:l,height:c}},m=u.pixelType,x=_.getPixelArrayConstructor(m),w=u.pixels.length,A=[];let k,M;for(let P=0;PP==null||P.mask!=null&&P.mask.length>0),y=t.some(P=>(P==null?void 0:P.bandMasks)&&P.bandMasks.length>1),v=g?new Uint8Array(h*s):void 0,b=y?[]:void 0;if(v){for(let P=0;Pw!=null);if(r==null)return null;const a=t.some(w=>w==null||!!w.mask),{width:i,height:o}=e,u=a?new Uint8Array(i*o):null,{blockWidths:h}=n,s=[],l=r.getPlaneCount(),c=_.getPixelArrayConstructor(r.pixelType);if(a)for(let w=0,A=0;w(w==null?void 0:w.bandMasks)&&w.bandMasks.length>1),f=p?[]:void 0,d=i*o;for(let w=0;wr||h>a||i===0&&o===0&&u===r&&h===a)return t;t.mask||(t.mask=new Uint8Array(r*a));const s=t.mask;for(let l=0;l=h||p=u?0:1}return t.updateStatistics(),t}function Qt(t){if(!R(t))return null;const e=t.clone(),{width:n,height:r,pixels:a}=t,i=a[0],o=e.pixels[0],u=t.mask;for(let h=2;he&&(n=i.value,e=r),i=a.next();return n}function rt(t,e,n){if(n===0)return;const r=t.get(e);r===1?t.delete(e):t.set(e,r-1)}function lt(t,e,n){n!==0&&t.set(e,t.has(e)?t.get(e)+1:1)}function Tt(t,e,n){let{x:r,y:a}=e;const{width:i,height:o}=n;if(r===0&&a===0&&o===t.height&&i===t.width)return t;const{width:u,height:h}=t,s=Math.max(0,a),l=Math.max(0,r),c=Math.min(r+i,u),p=Math.min(a+o,h);if(c<0||p<0||!R(t))return null;r=Math.max(0,-r),a=Math.max(0,-a);const{pixels:f}=t,d=i*o,m=f.length,x=[];for(let M=0;M0;f--)p=It(p,o);return p}function Bt(t,e,n,r,a=0){const{width:i,height:o}=t,{width:u,height:h}=e,s=r.cols,l=r.rows,c=Math.ceil(u/s-.1/s),p=Math.ceil(h/l-.1/l);let f,d,m,x,w,A,k;const M=c*s,g=M*p*l,y=new Float32Array(g),v=new Float32Array(g),b=new Uint32Array(g),$=new Uint32Array(g);let T,P,U=0;for(let I=0;I{const B=U instanceof Float32Array||U instanceof Float64Array?0:.5;for(let F=0;F0){const[Y,it]=j(A,v,e,h),[st,D]=j(x,w,e,h);U.push(Y),U.push(it),U.push(H),U.push(et),U.push(st),U.push(D)}else{const[Y,it]=j(A,k,e,h),[st,D]=j(M,g,e,h),[N,ct]=j(b,$,e,h);I.push(H),I.push(et),I.push(N),I.push(ct),I.push(st),I.push(D),I.push(Y),I.push(it)}v+=i,w+=i,k+=i,g+=i,$+=i}const[C,S]=j(s+m,l+o,e,h),B=(r/2+c)*d,[F,V]=j(s+B,l+o,e,h),[E,q]=j(s+m,l-u,e,h),[L,G]=j(s+B,l-u,e,h);return{pennants:U,barbs:I,shaft:[C,S,F,V,E,q,L,G]}}function j(t,e,n,r=1){const a=Math.sqrt(t*t+e*e)/r,i=(2*Math.PI+Math.atan2(e,t))%(2*Math.PI);return[a,(2*Math.PI+i-n)%(2*Math.PI)]}const ot=[0,1,3,6,10,16,21,27,33,40,47,55,63],ee=[0,.5,1,1.5,2],ne=[0,.25,.5,1,1.5,2,2.5,3,3.5,4];function Q(t,e,n,r){const a=mt(r||"knots",n);let i;for(i=1;ig>0).length:p*f,A=new Float32Array(w*h),k=new Uint32Array(s*w),M=e.invertDirection?Vt(0,0,0,!1):Zt;for(let g=0;g=dt){const w=(u[m]+360)%360/180*Math.PI,{pennants:A,barbs:k,shaft:M}=ft[Math.min(Math.floor(x/5),29)];if(A.length+k.length===0)continue;let g=s.length/h;const y=(d+.5)/r,v=(f+.5)/a;for(let b=0;b=(T-b)*(P-$)*(1-a)){w[v]=1;const[U,I]=Ct([m[v]/y,x[v]/y]);m[v]=U,x[v]=I}else w[v]=0,m[v]=0,x[v]=0}const k=new _({width:p,height:f,pixels:[m,x],mask:w});return k.updateStatistics(),k}const J=()=>Z.getLogger("esri.views.2d.engine.flow.dataUtils"),oe=10;async function je(t,e,n,r){const a=performance.now(),i=ae(e,n),o=performance.now(),u=ce(e,i,n.width,n.height),h=performance.now(),s=fe(u,!0),l=performance.now(),c=t==="Streamlines"?pe(s,oe):de(s),p=performance.now();return nt("esri-2d-profiler")&&(J().info("I.1","_createFlowFieldFromData (ms)",Math.round(o-a)),J().info("I.2","_getStreamlines (ms)",Math.round(h-o)),J().info("I.3","createAnimatedLinesData (ms)",Math.round(l-h)),J().info("I.4","create{Streamlines|Particles}Mesh (ms)",Math.round(p-l)),J().info("I.5","createFlowMesh (ms)",Math.round(p-a)),J().info("I.6","Mesh size (bytes)",c.vertexData.buffer.byteLength+c.indexData.buffer.byteLength)),await Promise.resolve(),Ot(r),c}function ae(t,e){const n=ue(e.data,e.width,e.height,t.smoothing);return t.interpolate?(r,a)=>{const i=Math.floor(r),o=Math.floor(a);if(i<0||i>=e.width)return[0,0];if(o<0||o>=e.height)return[0,0];const u=r-i,h=a-o,s=i,l=o,c=i{const i=Math.round(r),o=Math.round(a);return i<0||i>=e.width||o<0||o>=e.height?[0,0]:[n[2*(o*e.width+i)],n[2*(o*e.width+i)+1]]}}function he(t,e,n,r,a,i,o,u,h){const s=[];let l=n,c=r,p=0,[f,d]=e(l,c);f*=t.velocityScale,d*=t.velocityScale;const m=Math.sqrt(f*f+d*d);let x,w;s.push({x:l,y:c,t:p,speed:m});for(let A=0;At.maxTurnAngle)return s;if(t.collisions){const b=Math.round(l*h),$=Math.round(c*h);if(b<0||b>o-1||$<0||$>u-1)return s;const T=i[$*o+b];if(T!==-1&&T!==a)return s;i[$*o+b]=a}s.push({x:l,y:c,t:p,speed:g}),x=y,w=v}return s}function ce(t,e,n,r){const a=[],i=new Ut,o=1/Math.max(t.lineCollisionWidth,1),u=Math.round(n*o),h=Math.round(r*o),s=new Int32Array(u*h);for(let c=0;cc.sort-p.sort);for(const{x:c,y:p}of l)if(i.getFloat()=e)continue;const d=i[f+a];c+=d*t[2*(s*e+(l+f))],p+=d*t[2*(s*e+(l+f))+1]}u[2*(s*e+l)]=c,u[2*(s*e+l)+1]=p}const h=new Float32Array(t.length);for(let s=0;s=n)continue;const d=i[f+a];c+=d*u[2*((l+f)*e+s)],p+=d*u[2*((l+f)*e+s)+1]}h[2*(l*e+s)]=c,h[2*(l*e+s)+1]=p}return h}function fe(t,e){const n=new Ut,r=t.reduce((h,s)=>h+s.length,0),a=new Float32Array(4*r),i=new Array(t.length);let o=0,u=0;for(const h of t){const s=o;for(const l of h)a[4*o]=l.x,a[4*o+1]=l.y,a[4*o+2]=l.t,a[4*o+3]=l.speed,o++;i[u++]={startVertex:s,numberOfVertices:h.length,totalTime:h[h.length-1].t,timeSeed:e?n.getFloat():0}}return{lineVertices:a,lineDescriptors:i}}function pe(t,e){const{lineVertices:r,lineDescriptors:a}=t;let i=0,o=0;for(const f of a)i+=2*f.numberOfVertices,o+=6*(f.numberOfVertices-1);const u=new Float32Array(i*9),h=new Uint32Array(o);let s=0,l=0;function c(){h[l++]=s-2,h[l++]=s,h[l++]=s-1,h[l++]=s,h[l++]=s+1,h[l++]=s-1}function p(f,d,m,x,w,A,k,M){const g=s*9;let y=0;u[g+y++]=f,u[g+y++]=d,u[g+y++]=1,u[g+y++]=m,u[g+y++]=A,u[g+y++]=k,u[g+y++]=x/2,u[g+y++]=w/2,u[g+y++]=M,s++,u[g+y++]=f,u[g+y++]=d,u[g+y++]=-1,u[g+y++]=m,u[g+y++]=A,u[g+y++]=k,u[g+y++]=-x/2,u[g+y++]=-w/2,u[g+y++]=M,s++}for(const f of a){const{totalTime:d,timeSeed:m}=f;let x=null,w=null,A=null,k=null,M=null,g=null;for(let y=0;y0){P=v-x,U=b-w;const S=Math.sqrt(P*P+U*U);if(P/=S,U/=S,y>1){let B=P+M,F=U+g;const V=Math.sqrt(B*B+F*F);B/=V,F/=V;const E=Math.min(1/(B*P+F*U),e);B*=E,F*=E,I=-F,C=B}else I=-U,C=P;I!==null&&C!==null&&(p(x,w,A,I,C,d,m,T),c())}x=v,w=b,A=$,M=P,g=U,k=T}p(x,w,A,-g,M,d,m,k)}return{vertexData:u,indexData:h}}function de(t){const{lineVertices:a,lineDescriptors:i}=t;let o=0,u=0;for(const S of i){const B=S.numberOfVertices-1;o+=4*B*2,u+=6*B*2}const h=new Float32Array(o*16),s=new Uint32Array(u);let l,c,p,f,d,m,x,w,A,k,M,g,y,v,b=0,$=0;function T(){s[$++]=b-8,s[$++]=b-7,s[$++]=b-6,s[$++]=b-7,s[$++]=b-5,s[$++]=b-6,s[$++]=b-4,s[$++]=b-3,s[$++]=b-2,s[$++]=b-3,s[$++]=b-1,s[$++]=b-2}function P(S,B,F,V,E,q,L,G,z,H,et,Y,it,st){const D=b*16;let N=0;for(const ct of[1,2])for(const _t of[1,2,3,4])h[D+N++]=S,h[D+N++]=B,h[D+N++]=F,h[D+N++]=V,h[D+N++]=L,h[D+N++]=G,h[D+N++]=z,h[D+N++]=H,h[D+N++]=ct,h[D+N++]=_t,h[D+N++]=it,h[D+N++]=st,h[D+N++]=E/2,h[D+N++]=q/2,h[D+N++]=et/2,h[D+N++]=Y/2,b++}function U(S,B){let F=A+M,V=k+g;const E=Math.sqrt(F*F+V*V);F/=E,V/=E;const q=A*F+k*V;F/=q,V/=q;let L=M+y,G=g+v;const z=Math.sqrt(L*L+G*G);L/=z,G/=z;const H=M*L+g*G;L/=H,G/=H,P(l,c,p,f,-V,F,d,m,x,w,-G,L,S,B),T()}function I(S,B,F,V,E,q){if(A=M,k=g,M=y,g=v,A==null&&k==null&&(A=M,k=g),d!=null&&m!=null){y=S-d,v=B-m;const L=Math.sqrt(y*y+v*v);y/=L,v/=L}A!=null&&k!=null&&U(E,q),l=d,c=m,p=x,f=w,d=S,m=B,x=F,w=V}function C(S,B){A=M,k=g,M=y,g=v,A==null&&k==null&&(A=M,k=g),A!=null&&k!=null&&U(S,B)}for(const S of i){l=null,c=null,p=null,f=null,d=null,m=null,x=null,w=null,A=null,k=null,M=null,g=null,y=null,v=null;const{totalTime:B,timeSeed:F}=S;for(let V=0;V=n||(A.data[2*(g*n+k+y)]=M.data[2*(g*M.width+y)],A.data[2*(g*n+k+y)+1]=M.data[2*(g*M.width+y)+1],A.mask[g*n+k+y]=M.mask[g*M.width+y]);k+=M.width}return nt("esri-2d-profiler")&&J().info("I.10","loadImagery, general exit (ms)",Math.round(performance.now()-o)),A}async function vt(t,e,n,r,a,i){var s;const o={requestProjectedLocalDirections:!0,signal:i};if(a!=null&&(o.timeExtent=a),t.type==="imagery"){await t.load({signal:i});const l=t.rasterInfo.dataType,c=await t.fetchImage(e,n,r,o);return((s=c==null?void 0:c.pixelData)==null?void 0:s.pixelBlock)==null?{data:new Float32Array(n*r*2),mask:new Uint8Array(n*r),width:n,height:r}:bt(l,c.pixelData.pixelBlock)}await t.load({signal:i});const u=t.serviceRasterInfo.dataType,h=await t.fetchPixels(e,n,r,o);return(h==null?void 0:h.pixelBlock)==null?{data:new Float32Array(n*r*2),mask:new Uint8Array(n*r),width:n,height:r}:bt(u,h.pixelBlock)}export{Te as A,Pt as B,Pe as C,_e as D,Fe as E,Be as M,Ve as R,Ee as S,Se as T,Kt as U,Ce as W,re as _,De as a,Ne as b,ye as c,xe as d,at as e,At as f,Oe as g,mt as h,ht as i,be as j,Ue as k,Ct as l,Le as m,ve as n,R as o,Re as p,Ae as q,we as r,je as s,Me as t,_ as u,wt as v,xt as w,Ie as x,ke as y,$e as z}; diff --git a/assets/deduplicate-Bk22TunD.js b/assets/deduplicate-BR6i8Xk0.js similarity index 92% rename from assets/deduplicate-Bk22TunD.js rename to assets/deduplicate-BR6i8Xk0.js index f340eee..262833e 100644 --- a/assets/deduplicate-Bk22TunD.js +++ b/assets/deduplicate-BR6i8Xk0.js @@ -1 +1 @@ -import{cf as R}from"./index-CEWggaxV.js";import{i as v,t as O}from"./Indices-Dv-cCjFT.js";function G(f,n,e){const l=Array.isArray(f),r=l?f.length/n:f.byteLength/(4*n),s=l?f:new Uint32Array(f,0,r*n),u=(e==null?void 0:e.minReduction)??0,y=(e==null?void 0:e.originalIndices)||null,q=y?y.length:0,c=(e==null?void 0:e.componentOffsets)||null;let U=0;if(c)for(let t=0;tU&&(U=a)}else U=r;const m=Math.floor(1.1*U)+1;(h==null||h.length<2*m)&&(h=new Uint32Array(R(2*m)));for(let t=0;t<2*m;t++)h[t]=0;let i=0;const w=!!c&&!!y,b=w?q:r;let A=v(r);const p=new Uint32Array(q),k=1.96;let I=u!==0?Math.ceil(4*k*k/(u*u)*u*(1-u)):b,d=1,j=c?c[1]:b;for(let t=0;t=m&&(g-=m)}C===i&&(h[2*g]=x,h[2*g+1]=a+1,i++),A[a]=C}if(u!==0&&1-i/r>>2)|0;return l>>>0}let h=null;export{G as e}; +import{cf as R}from"./index-BjUNJPVf.js";import{i as v,t as O}from"./Indices-BRm9v2lM.js";function G(f,n,e){const l=Array.isArray(f),r=l?f.length/n:f.byteLength/(4*n),s=l?f:new Uint32Array(f,0,r*n),u=(e==null?void 0:e.minReduction)??0,y=(e==null?void 0:e.originalIndices)||null,q=y?y.length:0,c=(e==null?void 0:e.componentOffsets)||null;let U=0;if(c)for(let t=0;tU&&(U=a)}else U=r;const m=Math.floor(1.1*U)+1;(h==null||h.length<2*m)&&(h=new Uint32Array(R(2*m)));for(let t=0;t<2*m;t++)h[t]=0;let i=0;const w=!!c&&!!y,b=w?q:r;let A=v(r);const p=new Uint32Array(q),k=1.96;let I=u!==0?Math.ceil(4*k*k/(u*u)*u*(1-u)):b,d=1,j=c?c[1]:b;for(let t=0;t=m&&(g-=m)}C===i&&(h[2*g]=x,h[2*g+1]=a+1,i++),A[a]=C}if(u!==0&&1-i/r>>2)|0;return l>>>0}let h=null;export{G as e}; diff --git a/assets/deleteForwardEdits-CDZbz35M.js b/assets/deleteForwardEdits-DOePzMev.js similarity index 69% rename from assets/deleteForwardEdits-CDZbz35M.js rename to assets/deleteForwardEdits-DOePzMev.js index ec79035..bf3ac48 100644 --- a/assets/deleteForwardEdits-CDZbz35M.js +++ b/assets/deleteForwardEdits-DOePzMev.js @@ -1 +1 @@ -import{N as c,aW as f,ep as p,eq as u,M as m}from"./index-CEWggaxV.js";async function g(e,s,a,i){if(!s)throw new c("post:missing-guid","guid for version is missing");const t=f(e),o=a.toJSON(),r=p(t.query,{query:u({...o,f:"json"}),...i,method:"post"});s.startsWith("{")&&(s=s.slice(1,-1));const d=`${t.path}/versions/${s}/deleteForwardEdits`,{data:n}=await m(d,r);return n.success}export{g as deleteForwardEdits}; +import{N as c,aW as f,ep as p,eq as u,M as m}from"./index-BjUNJPVf.js";async function g(e,s,a,i){if(!s)throw new c("post:missing-guid","guid for version is missing");const t=f(e),o=a.toJSON(),r=p(t.query,{query:u({...o,f:"json"}),...i,method:"post"});s.startsWith("{")&&(s=s.slice(1,-1));const d=`${t.path}/versions/${s}/deleteForwardEdits`,{data:n}=await m(d,r);return n.success}export{g as deleteForwardEdits}; diff --git a/assets/diffUtils-B4YFa5Ju.js b/assets/diffUtils-uUoMDFQS.js similarity index 96% rename from assets/diffUtils-B4YFa5Ju.js rename to assets/diffUtils-uUoMDFQS.js index d0ed9a0..5dc825f 100644 --- a/assets/diffUtils-B4YFa5Ju.js +++ b/assets/diffUtils-uUoMDFQS.js @@ -1 +1 @@ -import{V,a6 as A,a7 as D}from"./index-CEWggaxV.js";const k=new Set(["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"]);function y(e){return e instanceof D}function h(e){return e instanceof V?Object.keys(e.items):y(e)?A(e).keys():e?Object.keys(e):[]}function p(e,n){return e instanceof V?e.items[n]:e[n]}function S(e,n){return!(!Array.isArray(e)||!Array.isArray(n))&&e.length!==n.length}function c(e){return e?e.declaredClass:null}function g(e,n){var b;const o=e.diff;if(o&&typeof o=="function")return o(e,n);const i=h(e),f=h(n);if(i.length===0&&f.length===0)return;if(!i.length||!f.length||S(e,n))return{type:"complete",oldValue:e,newValue:n};const s=f.filter(t=>!i.includes(t)),j=i.filter(t=>!f.includes(t)),m=i.filter(t=>f.includes(t)&&p(e,t)!==p(n,t)).concat(s,j).sort(),d=c(e);if(d&&k.has(d)&&m.length)return{type:"complete",oldValue:e,newValue:n};let a;const w=y(e)&&y(n);for(const t of m){const l=p(e,t),r=p(n,t);let u;if((w||typeof l!="function"&&typeof r!="function")&&l!==r&&(l!=null||r!=null)){if(o&&o[t]&&typeof o[t]=="function")u=(b=o[t])==null?void 0:b.call(o,l,r);else if(l instanceof Date&&r instanceof Date){if(l.getTime()===r.getTime())continue;u={type:"complete",oldValue:l,newValue:r}}else u=typeof l=="object"&&typeof r=="object"&&c(l)===c(r)?g(l,r):{type:"complete",oldValue:l,newValue:r};u!=null&&(a!=null?a.diff[t]=u:a={type:"partial",diff:{[t]:u}})}}return a}function C(e,n){return O(e,n)}function O(e,n){if(e==null)return!1;const o=n.split(".");let i=e;for(const f of o){if(i.type==="complete")return!0;if(i.type!=="partial")return!1;{const s=i.diff[f];if(!s)return!1;i=s}}return!0}function T(e,n){if(!e)return!1;if(e.type==="partial"){const o=Object.keys(e.diff);return o.length===1&&o[0]===n}return!1}function x(e,n){if(typeof e!="function"&&typeof n!="function"&&(e!=null||n!=null))return e==null||n==null||typeof e=="object"&&typeof n=="object"&&c(e)!==c(n)?{type:"complete",oldValue:e,newValue:n}:g(e,n)}export{T as d,x as m,O as p,C as s}; +import{V,a6 as A,a7 as D}from"./index-BjUNJPVf.js";const k=new Set(["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"]);function y(e){return e instanceof D}function h(e){return e instanceof V?Object.keys(e.items):y(e)?A(e).keys():e?Object.keys(e):[]}function p(e,n){return e instanceof V?e.items[n]:e[n]}function S(e,n){return!(!Array.isArray(e)||!Array.isArray(n))&&e.length!==n.length}function c(e){return e?e.declaredClass:null}function g(e,n){var b;const o=e.diff;if(o&&typeof o=="function")return o(e,n);const i=h(e),f=h(n);if(i.length===0&&f.length===0)return;if(!i.length||!f.length||S(e,n))return{type:"complete",oldValue:e,newValue:n};const s=f.filter(t=>!i.includes(t)),j=i.filter(t=>!f.includes(t)),m=i.filter(t=>f.includes(t)&&p(e,t)!==p(n,t)).concat(s,j).sort(),d=c(e);if(d&&k.has(d)&&m.length)return{type:"complete",oldValue:e,newValue:n};let a;const w=y(e)&&y(n);for(const t of m){const l=p(e,t),r=p(n,t);let u;if((w||typeof l!="function"&&typeof r!="function")&&l!==r&&(l!=null||r!=null)){if(o&&o[t]&&typeof o[t]=="function")u=(b=o[t])==null?void 0:b.call(o,l,r);else if(l instanceof Date&&r instanceof Date){if(l.getTime()===r.getTime())continue;u={type:"complete",oldValue:l,newValue:r}}else u=typeof l=="object"&&typeof r=="object"&&c(l)===c(r)?g(l,r):{type:"complete",oldValue:l,newValue:r};u!=null&&(a!=null?a.diff[t]=u:a={type:"partial",diff:{[t]:u}})}}return a}function C(e,n){return O(e,n)}function O(e,n){if(e==null)return!1;const o=n.split(".");let i=e;for(const f of o){if(i.type==="complete")return!0;if(i.type!=="partial")return!1;{const s=i.diff[f];if(!s)return!1;i=s}}return!0}function T(e,n){if(!e)return!1;if(e.type==="partial"){const o=Object.keys(e.diff);return o.length===1&&o[0]===n}return!1}function x(e,n){if(typeof e!="function"&&typeof n!="function"&&(e!=null||n!=null))return e==null||n==null||typeof e=="object"&&typeof n=="object"&&c(e)!==c(n)?{type:"complete",oldValue:e,newValue:n}:g(e,n)}export{T as d,x as m,O as p,C as s}; diff --git a/assets/drapedUtils-CGrSPor9.js b/assets/drapedUtils-DDBQ6RK5.js similarity index 97% rename from assets/drapedUtils-CGrSPor9.js rename to assets/drapedUtils-DDBQ6RK5.js index 0b625f4..0517950 100644 --- a/assets/drapedUtils-CGrSPor9.js +++ b/assets/drapedUtils-DDBQ6RK5.js @@ -1,7 +1,7 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/visualVariableUtils-z2k12BH8.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css","assets/sizeVariableUtils-Cmcuvw-4.js"] + __vite__mapDeps.viteFileDeps = ["assets/visualVariableUtils-BX9G5gNQ.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css","assets/sizeVariableUtils-Cmcuvw-4.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{cF as Y,dP as ee,n as te,d as l,y,a$ as re,b0 as se,aR as B,aE as O,aS as ie,b2 as ne,f as G,aU as D,er as oe,j as T,aZ as ae,fM as le,aW as ue,dj as pe,eq as ye,ep as ce,M as fe,a7 as he,k as de,z as me,N as H,e as I,V as ge,q as z,dy as q,_ as be,Z as we,bo as _,E as xe,at as Q,ii as ve,c8 as $e}from"./index-CEWggaxV.js";import{i as Se,o as Fe}from"./scaleUtils-Bqauo1zZ.js";import{n as A}from"./floorFilterUtils-DZ5C6FQv.js";import{n as Ee}from"./sublayerUtils-BPYHHPMV.js";import{n as Re,p as Me}from"./popupUtils-BovqErR_.js";function P(t,e){return e?"xoffset"in e&&e.xoffset?Math.max(t,Math.abs(e.xoffset)):"yoffset"in e&&e.yoffset?Math.max(t,Math.abs(e.yoffset||0)):t:t}function je(t){let e=0,s=0;for(let n=0;ni.type==="size").map(i=>{const{maxSize:u,minSize:p}=i;return(J(u,t)+J(p,t))/2});let n=0;const r=s.length;if(r===0)return t;for(let i=0;i{i=P(i,u.symbol)}),i}if(e.type==="class-breaks"){let i=r;return e.classBreakInfos.forEach(u=>{i=P(i,u.symbol)}),i}return e.type==="dot-density"||e.type,r}function Ie(t,e){const{dpi:s,gdbVersion:n,geometry:r,geometryPrecision:o,height:i,historicMoment:u,layerOption:p,mapExtent:a,maxAllowableOffset:c,returnFieldName:f,returnGeometry:m,returnUnformattedValues:v,returnZ:$,spatialReference:E,timeExtent:d,tolerance:S,width:w}=t.toJSON(),{dynamicLayers:g,layerDefs:b,layerIds:j}=Pe(t),U=(e==null?void 0:e.geometry)!=null?e.geometry:null,x={historicMoment:u,geometryPrecision:o,maxAllowableOffset:c,returnFieldName:f,returnGeometry:m,returnUnformattedValues:v,returnZ:$,tolerance:S},R=U&&U.toJSON()||r;x.imageDisplay=`${w},${i},${s}`,n&&(x.gdbVersion=n),R&&(delete R.spatialReference,x.geometry=JSON.stringify(R),x.geometryType=Y(R));const L=E??(R==null?void 0:R.spatialReference)??(a==null?void 0:a.spatialReference);if(L&&(x.sr=ee(L)),x.time=d?[d.start,d.end].join(","):null,a){const{xmin:W,ymin:C,xmax:K,ymax:X}=a;x.mapExtent=`${W},${C},${K},${X}`}return b&&(x.layerDefs=b),g&&!b&&(x.dynamicLayers=g),x.layers=p==="popup"?"visible":p,j&&!g&&(x.layers+=`:${j.join(",")}`),x}function Pe(t){var $,E;const{mapExtent:e,floors:s,width:n,sublayers:r,layerIds:o,layerOption:i,gdbVersion:u}=t,p=(E=($=r==null?void 0:r.find(d=>d.layer!=null))==null?void 0:$.layer)==null?void 0:E.serviceSublayers,a=i==="popup",c={},f=Se({extent:e,width:n,spatialReference:e==null?void 0:e.spatialReference}),m=[],v=d=>{const S=f===0,w=d.minScale===0||f<=d.minScale,g=d.maxScale===0||f>=d.maxScale;if(d.visible&&(S||w&&g))if(d.sublayers)d.sublayers.forEach(v);else{if((o==null?void 0:o.includes(d.id))===!1||a&&(!d.popupTemplate||!d.popupEnabled))return;m.unshift(d)}};if(r==null||r.forEach(v),r&&!m.length)c.layerIds=[];else{const d=Ee(m,p,u),S=m.map(w=>{const g=A(s,w);return w.toExportImageJSON(g)});if(d)c.dynamicLayers=JSON.stringify(S);else{if(r){let g=m.map(({id:b})=>b);o&&(g=g.filter(b=>o.includes(b))),c.layerIds=g}else o!=null&&o.length&&(c.layerIds=o);const w=Ne(s,m);if(w!=null&&w.length){const g={};for(const b of w)b.definitionExpression&&(g[b.id]=b.definitionExpression);Object.keys(g).length&&(c.layerDefs=JSON.stringify(g))}}}return c}function Ne(t,e){const s=!!(t!=null&&t.length),n=e.filter(r=>r.definitionExpression!=null||s&&r.floorInfo!=null);return n.length?n.map(r=>{const o=A(t,r),i=te(o,r.definitionExpression);return{id:r.id,definitionExpression:i??void 0}}):null}var V;let h=V=class extends D{static from(t){return oe(V,t)}constructor(t){super(t),this.dpi=96,this.floors=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=null,this.height=400,this.historicMoment=null,this.layerIds=null,this.layerOption="top",this.mapExtent=null,this.maxAllowableOffset=null,this.returnFieldName=!0,this.returnGeometry=!1,this.returnM=!1,this.returnUnformattedValues=!0,this.returnZ=!1,this.spatialReference=null,this.sublayers=null,this.timeExtent=null,this.tolerance=null,this.width=400}writeHistoricMoment(t,e){e.historicMoment=t&&t.getTime()}};l([y({type:Number,json:{write:!0}})],h.prototype,"dpi",void 0),l([y()],h.prototype,"floors",void 0),l([y({type:String,json:{write:!0}})],h.prototype,"gdbVersion",void 0),l([y({types:re,json:{read:se,write:!0}})],h.prototype,"geometry",void 0),l([y({type:Number,json:{write:!0}})],h.prototype,"geometryPrecision",void 0),l([y({type:Number,json:{write:!0}})],h.prototype,"height",void 0),l([y({type:Date})],h.prototype,"historicMoment",void 0),l([B("historicMoment")],h.prototype,"writeHistoricMoment",null),l([y({type:[Number],json:{write:!0}})],h.prototype,"layerIds",void 0),l([y({type:["top","visible","all","popup"],json:{write:!0}})],h.prototype,"layerOption",void 0),l([y({type:O,json:{write:!0}})],h.prototype,"mapExtent",void 0),l([y({type:Number,json:{write:!0}})],h.prototype,"maxAllowableOffset",void 0),l([y({type:Boolean,json:{write:!0}})],h.prototype,"returnFieldName",void 0),l([y({type:Boolean,json:{write:!0}})],h.prototype,"returnGeometry",void 0),l([y({type:Boolean,json:{write:!0}})],h.prototype,"returnM",void 0),l([y({type:Boolean,json:{write:!0}})],h.prototype,"returnUnformattedValues",void 0),l([y({type:Boolean,json:{write:!0}})],h.prototype,"returnZ",void 0),l([y({type:ie,json:{write:!0}})],h.prototype,"spatialReference",void 0),l([y()],h.prototype,"sublayers",void 0),l([y({type:ne,json:{write:!0}})],h.prototype,"timeExtent",void 0),l([y({type:Number,json:{write:!0}})],h.prototype,"tolerance",void 0),l([y({type:Number,json:{write:!0}})],h.prototype,"width",void 0),h=V=l([G("esri.rest.support.IdentifyParameters")],h);const Z=h;let F=class extends D{constructor(t){super(t),this.displayFieldName=null,this.feature=null,this.layerId=null,this.layerName=null}readFeature(t,e){return T.fromJSON({attributes:{...e.attributes},geometry:{...e.geometry}})}writeFeature(t,e){if(!t)return;const{attributes:s,geometry:n}=t;s&&(e.attributes={...s}),n!=null&&(e.geometry=n.toJSON(),e.geometryType=le.toJSON(n.type))}};l([y({type:String,json:{write:!0}})],F.prototype,"displayFieldName",void 0),l([y({type:T})],F.prototype,"feature",void 0),l([ae("feature",["attributes","geometry"])],F.prototype,"readFeature",null),l([B("feature")],F.prototype,"writeFeature",null),l([y({type:Number,json:{write:!0}})],F.prototype,"layerId",void 0),l([y({type:String,json:{write:!0}})],F.prototype,"layerName",void 0),F=l([G("esri.rest.support.IdentifyResult")],F);const _e=F;async function Ve(t,e,s){const n=(e=Te(e)).geometry?[e.geometry]:[],r=ue(t);return r.path+="/identify",pe(n).then(o=>{const i=Ie(e,{geometry:o==null?void 0:o[0]}),u=ye({...r.query,f:"json",...i}),p=ce(u,s);return fe(r.path,p).then(Ge).then(a=>Ae(a,e.sublayers))})}function Ge(t){const e=t.data;return e.results=e.results||[],e.exceededTransferLimit=!!e.exceededTransferLimit,e.results=e.results.map(s=>_e.fromJSON(s)),e}function Te(t){return t=Z.from(t)}function Ae(t,e){if(!(e!=null&&e.length))return t;const s=new Map;function n(r){s.set(r.id,r),r.sublayers&&r.sublayers.forEach(n)}e.forEach(n);for(const r of t.results)r.feature.sourceLayer=s.get(r.layerId);return t}let N=null;function De(t,e){return e.type==="tile"||e.type==="map-image"}let M=class extends he{constructor(t){super(t),this._featuresResolutions=new WeakMap,this.highlightGraphics=null,this.highlightGraphicUpdated=null,this.updateHighlightedFeatures=de(async e=>{this.destroyed||this.updatingHandles.addPromise(this._updateHighlightedFeaturesGeometries(e).catch(()=>{}))})}initialize(){const t=e=>{this.updatingHandles.addPromise(this._updateHighlightedFeaturesSymbols(e).catch(()=>{})),this.updateHighlightedFeatures(this._highlightGeometriesResolution)};this.addHandles([me(()=>this.highlightGraphics,"change",e=>t(e.added),{onListenerAdd:e=>t(e)})])}async fetchPopupFeaturesAtLocation(t,e){var i,u;const{layerView:{layer:s,view:{scale:n}}}=this;if(!t)throw new H("fetchPopupFeatures:invalid-area","Nothing to fetch without area",{layer:s});const r=Ue(s.sublayers,n,e);if(!r.length)return[];const o=await He(s,r);if(!((((u=(i=s.capabilities)==null?void 0:i.operations)==null?void 0:u.supportsIdentify)??!0)&&s.version>=10.5)&&!o)throw new H("fetchPopupFeatures:not-supported","query operation is disabled for this service",{layer:s});return o?this._fetchPopupFeaturesUsingQueries(t,r,e):this._fetchPopupFeaturesUsingIdentify(t,r,e)}clearHighlights(){var t;(t=this.highlightGraphics)==null||t.removeAll()}highlight(t){const e=this.highlightGraphics;if(!e)return I();let s=null;if(t instanceof T?s=[t]:ge.isCollection(t)&&t.length>0?s=t.toArray():Array.isArray(t)&&t.length>0&&(s=t),s=s==null?void 0:s.filter(z),!(s!=null&&s.length))return I();for(const n of s){const r=n.sourceLayer;r!=null&&"geometryType"in r&&r.geometryType==="point"&&(n.visible=!1)}return e.addMany(s),I(()=>e.removeMany(s??[]))}async _updateHighlightedFeaturesSymbols(t){const{layerView:{view:e},highlightGraphics:s,highlightGraphicUpdated:n}=this;if(s&&n)for(const r of t){const o=r.sourceLayer&&"renderer"in r.sourceLayer&&r.sourceLayer.renderer;r.sourceLayer&&"geometryType"in r.sourceLayer&&r.sourceLayer.geometryType==="point"&&o&&"getSymbolAsync"in o&&o.getSymbolAsync(r).then(async i=>{var a;i||(i=new q);let u=null;const p="visualVariables"in o?(a=o.visualVariables)==null?void 0:a.find(c=>c.type==="size"):void 0;p&&(N||(N=(await be(()=>import("./visualVariableUtils-z2k12BH8.js"),__vite__mapDeps([0,1,2,3]))).getSize),u=N(p,r,{view:e.type,scale:e.scale,shape:i.type==="simple-marker"?i.style:null})),u||(u="width"in i&&"height"in i&&i.width!=null&&i.height!=null?Math.max(i.width,i.height):"size"in i?i.size:16),s.includes(r)&&(r.symbol=new q({style:"square",size:u,xoffset:"xoffset"in i?i.xoffset:0,yoffset:"yoffset"in i?i.yoffset:0}),n(r,"symbol"),r.visible=!0)})}}async _updateHighlightedFeaturesGeometries(t){const{layerView:{layer:e,view:s},highlightGraphics:n,highlightGraphicUpdated:r}=this;if(this._highlightGeometriesResolution=t,!r||!(n!=null&&n.length)||!e.capabilities.operations.supportsQuery)return;const o=this._getTargetResolution(t),i=new Map;for(const a of n)if(!this._featuresResolutions.has(a)||this._featuresResolutions.get(a)>o){const c=a.sourceLayer;we(i,c,()=>new Map).set(a.getObjectId(),a)}const u=Array.from(i,([a,c])=>{const f=a.createQuery();return f.objectIds=[...c.keys()],f.outFields=[a.objectIdField],f.returnGeometry=!0,f.maxAllowableOffset=o,f.outSpatialReference=s.spatialReference,a.queryFeatures(f)}),p=await Promise.all(u);if(!this.destroyed)for(const{features:a}of p)for(const c of a){const f=c.sourceLayer,m=i.get(f).get(c.getObjectId());m&&n.includes(m)&&(m.geometry=c.geometry,r(m,"geometry"),this._featuresResolutions.set(m,o))}}_getTargetResolution(t){const e=t*_(this.layerView.view.spatialReference),s=e/16;return s<=10?0:t/e*s}async _fetchPopupFeaturesUsingIdentify(t,e,s){const n=await this._createIdentifyParameters(t,e,s);if(n==null)return[];const{results:r}=await Ve(this.layerView.layer.parsedUrl,n,s);return r.map(o=>o.feature)}async _createIdentifyParameters(t,e,s){const{floors:n,layer:r,timeExtent:o,view:{spatialReference:i,scale:u}}=this.layerView;if(!e.length)return null;await Promise.all(e.map(({sublayer:v})=>v.load(s).catch(()=>{})));const p=Math.min(xe("mapservice-popup-identify-max-tolerance"),r.allSublayers.reduce((v,$)=>$.renderer?k({renderer:$.renderer,pointerType:s==null?void 0:s.pointerType}):v,2)),a=this.createFetchPopupFeaturesQueryGeometry(t,p),c=Fe(u,i),f=Math.round(a.width/c),m=new O({xmin:a.center.x-c*f,ymin:a.center.y-c*f,xmax:a.center.x+c*f,ymax:a.center.y+c*f,spatialReference:a.spatialReference});return new Z({floors:n,gdbVersion:"gdbVersion"in r?r.gdbVersion:void 0,geometry:t,height:f,layerOption:"popup",mapExtent:m,returnGeometry:!0,spatialReference:i,sublayers:r.sublayers,timeExtent:o,tolerance:p,width:f})}async _fetchPopupFeaturesUsingQueries(t,e,s){const{layerView:{floors:n,timeExtent:r}}=this,o=e.map(async({sublayer:i,popupTemplate:u})=>{var g;if(await i.load(s).catch(()=>{}),i.capabilities&&!i.capabilities.operations.supportsQuery)return[];const p=i.createQuery(),a=k({renderer:i.renderer,pointerType:s==null?void 0:s.pointerType}),c=this.createFetchPopupFeaturesQueryGeometry(t,a),f=new Set,[m]=await Promise.all([Re(i,u),(g=i.renderer)==null?void 0:g.collectRequiredFields(f,i.fieldsIndex)]);Q(s),ve(f,i.fieldsIndex,m);const v=Array.from(f).sort();if(p.geometry=c,p.outFields=v,p.timeExtent=r,n){const b=n.clone(),j=A(b,i);j!=null&&(p.where=p.where?`(${p.where}) AND (${j})`:j)}const $=this._getTargetResolution(c.width/a),E=await Le(u);Q(s);const d=i.geometryType==="point"||E&&E.arcadeUtils.hasGeometryOperations(u);d||(p.maxAllowableOffset=$);let{features:S}=await i.queryFeatures(p,s);const w=d?0:$;S=await ze(i,S,s);for(const b of S)this._featuresResolutions.set(b,w);return S});return(await Promise.allSettled(o)).reduce((i,u)=>u.status==="fulfilled"?[...i,...u.value]:i,[]).filter(z)}};function Ue(t,e,s){const n=[];if(!t)return n;const r=o=>{const i=o.minScale===0||e<=o.minScale,u=o.maxScale===0||e>=o.maxScale;if(o.visible&&i&&u){if(o.sublayers)o.sublayers.forEach(r);else if(o.popupEnabled){const p=Me(o,{...s,defaultPopupTemplateEnabled:!1});p!=null&&n.unshift({sublayer:o,popupTemplate:p})}}};return t.map(r),n}function Le(t){var e;return(e=t.expressionInfos)!=null&&e.length||Array.isArray(t.content)&&t.content.some(s=>s.type==="expression")?$e():Promise.resolve()}async function He(t,e){var s,n;if((n=(s=t.capabilities)==null?void 0:s.operations)!=null&&n.supportsQuery)return!0;try{return await Promise.any(e.map(({sublayer:r})=>r.load().then(()=>r.capabilities.operations.supportsQuery)))}catch{return!1}}async function ze(t,e,s){const n=t.renderer;return n&&"defaultSymbol"in n&&!n.defaultSymbol&&(e=n.valueExpression?await Promise.all(e.map(r=>n.getSymbolAsync(r,s).then(o=>o?r:null))).then(r=>r.filter(o=>o!=null)):e.filter(r=>n.getSymbol(r)!=null)),e}l([y({constructOnly:!0})],M.prototype,"createFetchPopupFeaturesQueryGeometry",void 0),l([y({constructOnly:!0})],M.prototype,"layerView",void 0),l([y({constructOnly:!0})],M.prototype,"highlightGraphics",void 0),l([y({constructOnly:!0})],M.prototype,"highlightGraphicUpdated",void 0),l([y({constructOnly:!0})],M.prototype,"updatingHandles",void 0),M=l([G("esri.views.layers.support.MapService")],M);function Ze(t,e,s,n=new O){let r=0;if(s.type==="2d")r=e*(s.resolution??0);else if(s.type==="3d"){const c=s.overlayPixelSizeInMapUnits(t),f=s.basemapSpatialReference;r=f==null||f.equals(s.spatialReference)?e*c:_(f)/_(s.spatialReference)}const o=t.x-r,i=t.y-r,u=t.x+r,p=t.y+r,{spatialReference:a}=s;return n.xmin=Math.min(o,u),n.ymin=Math.min(i,p),n.xmax=Math.max(o,u),n.ymax=Math.max(i,p),n.spatialReference=a,n}new O;export{De as S,M as U,Ze as r}; +import{cF as Y,dP as ee,n as te,d as l,y,a$ as re,b0 as se,aR as B,aE as O,aS as ie,b2 as ne,f as G,aU as D,er as oe,j as T,aZ as ae,fM as le,aW as ue,dj as pe,eq as ye,ep as ce,M as fe,a7 as he,k as de,z as me,N as H,e as I,V as ge,q as z,dy as q,_ as be,Z as we,bo as _,E as xe,at as Q,ii as ve,c8 as $e}from"./index-BjUNJPVf.js";import{i as Se,o as Fe}from"./scaleUtils-DWXMiS7R.js";import{n as A}from"./floorFilterUtils-DZ5C6FQv.js";import{n as Ee}from"./sublayerUtils-GrJ1gnTG.js";import{n as Re,p as Me}from"./popupUtils-Do2GfZME.js";function P(t,e){return e?"xoffset"in e&&e.xoffset?Math.max(t,Math.abs(e.xoffset)):"yoffset"in e&&e.yoffset?Math.max(t,Math.abs(e.yoffset||0)):t:t}function je(t){let e=0,s=0;for(let n=0;ni.type==="size").map(i=>{const{maxSize:u,minSize:p}=i;return(J(u,t)+J(p,t))/2});let n=0;const r=s.length;if(r===0)return t;for(let i=0;i{i=P(i,u.symbol)}),i}if(e.type==="class-breaks"){let i=r;return e.classBreakInfos.forEach(u=>{i=P(i,u.symbol)}),i}return e.type==="dot-density"||e.type,r}function Ie(t,e){const{dpi:s,gdbVersion:n,geometry:r,geometryPrecision:o,height:i,historicMoment:u,layerOption:p,mapExtent:a,maxAllowableOffset:c,returnFieldName:f,returnGeometry:m,returnUnformattedValues:v,returnZ:$,spatialReference:E,timeExtent:d,tolerance:S,width:w}=t.toJSON(),{dynamicLayers:g,layerDefs:b,layerIds:j}=Pe(t),U=(e==null?void 0:e.geometry)!=null?e.geometry:null,x={historicMoment:u,geometryPrecision:o,maxAllowableOffset:c,returnFieldName:f,returnGeometry:m,returnUnformattedValues:v,returnZ:$,tolerance:S},R=U&&U.toJSON()||r;x.imageDisplay=`${w},${i},${s}`,n&&(x.gdbVersion=n),R&&(delete R.spatialReference,x.geometry=JSON.stringify(R),x.geometryType=Y(R));const L=E??(R==null?void 0:R.spatialReference)??(a==null?void 0:a.spatialReference);if(L&&(x.sr=ee(L)),x.time=d?[d.start,d.end].join(","):null,a){const{xmin:W,ymin:C,xmax:K,ymax:X}=a;x.mapExtent=`${W},${C},${K},${X}`}return b&&(x.layerDefs=b),g&&!b&&(x.dynamicLayers=g),x.layers=p==="popup"?"visible":p,j&&!g&&(x.layers+=`:${j.join(",")}`),x}function Pe(t){var $,E;const{mapExtent:e,floors:s,width:n,sublayers:r,layerIds:o,layerOption:i,gdbVersion:u}=t,p=(E=($=r==null?void 0:r.find(d=>d.layer!=null))==null?void 0:$.layer)==null?void 0:E.serviceSublayers,a=i==="popup",c={},f=Se({extent:e,width:n,spatialReference:e==null?void 0:e.spatialReference}),m=[],v=d=>{const S=f===0,w=d.minScale===0||f<=d.minScale,g=d.maxScale===0||f>=d.maxScale;if(d.visible&&(S||w&&g))if(d.sublayers)d.sublayers.forEach(v);else{if((o==null?void 0:o.includes(d.id))===!1||a&&(!d.popupTemplate||!d.popupEnabled))return;m.unshift(d)}};if(r==null||r.forEach(v),r&&!m.length)c.layerIds=[];else{const d=Ee(m,p,u),S=m.map(w=>{const g=A(s,w);return w.toExportImageJSON(g)});if(d)c.dynamicLayers=JSON.stringify(S);else{if(r){let g=m.map(({id:b})=>b);o&&(g=g.filter(b=>o.includes(b))),c.layerIds=g}else o!=null&&o.length&&(c.layerIds=o);const w=Ne(s,m);if(w!=null&&w.length){const g={};for(const b of w)b.definitionExpression&&(g[b.id]=b.definitionExpression);Object.keys(g).length&&(c.layerDefs=JSON.stringify(g))}}}return c}function Ne(t,e){const s=!!(t!=null&&t.length),n=e.filter(r=>r.definitionExpression!=null||s&&r.floorInfo!=null);return n.length?n.map(r=>{const o=A(t,r),i=te(o,r.definitionExpression);return{id:r.id,definitionExpression:i??void 0}}):null}var V;let h=V=class extends D{static from(t){return oe(V,t)}constructor(t){super(t),this.dpi=96,this.floors=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=null,this.height=400,this.historicMoment=null,this.layerIds=null,this.layerOption="top",this.mapExtent=null,this.maxAllowableOffset=null,this.returnFieldName=!0,this.returnGeometry=!1,this.returnM=!1,this.returnUnformattedValues=!0,this.returnZ=!1,this.spatialReference=null,this.sublayers=null,this.timeExtent=null,this.tolerance=null,this.width=400}writeHistoricMoment(t,e){e.historicMoment=t&&t.getTime()}};l([y({type:Number,json:{write:!0}})],h.prototype,"dpi",void 0),l([y()],h.prototype,"floors",void 0),l([y({type:String,json:{write:!0}})],h.prototype,"gdbVersion",void 0),l([y({types:re,json:{read:se,write:!0}})],h.prototype,"geometry",void 0),l([y({type:Number,json:{write:!0}})],h.prototype,"geometryPrecision",void 0),l([y({type:Number,json:{write:!0}})],h.prototype,"height",void 0),l([y({type:Date})],h.prototype,"historicMoment",void 0),l([B("historicMoment")],h.prototype,"writeHistoricMoment",null),l([y({type:[Number],json:{write:!0}})],h.prototype,"layerIds",void 0),l([y({type:["top","visible","all","popup"],json:{write:!0}})],h.prototype,"layerOption",void 0),l([y({type:O,json:{write:!0}})],h.prototype,"mapExtent",void 0),l([y({type:Number,json:{write:!0}})],h.prototype,"maxAllowableOffset",void 0),l([y({type:Boolean,json:{write:!0}})],h.prototype,"returnFieldName",void 0),l([y({type:Boolean,json:{write:!0}})],h.prototype,"returnGeometry",void 0),l([y({type:Boolean,json:{write:!0}})],h.prototype,"returnM",void 0),l([y({type:Boolean,json:{write:!0}})],h.prototype,"returnUnformattedValues",void 0),l([y({type:Boolean,json:{write:!0}})],h.prototype,"returnZ",void 0),l([y({type:ie,json:{write:!0}})],h.prototype,"spatialReference",void 0),l([y()],h.prototype,"sublayers",void 0),l([y({type:ne,json:{write:!0}})],h.prototype,"timeExtent",void 0),l([y({type:Number,json:{write:!0}})],h.prototype,"tolerance",void 0),l([y({type:Number,json:{write:!0}})],h.prototype,"width",void 0),h=V=l([G("esri.rest.support.IdentifyParameters")],h);const Z=h;let F=class extends D{constructor(t){super(t),this.displayFieldName=null,this.feature=null,this.layerId=null,this.layerName=null}readFeature(t,e){return T.fromJSON({attributes:{...e.attributes},geometry:{...e.geometry}})}writeFeature(t,e){if(!t)return;const{attributes:s,geometry:n}=t;s&&(e.attributes={...s}),n!=null&&(e.geometry=n.toJSON(),e.geometryType=le.toJSON(n.type))}};l([y({type:String,json:{write:!0}})],F.prototype,"displayFieldName",void 0),l([y({type:T})],F.prototype,"feature",void 0),l([ae("feature",["attributes","geometry"])],F.prototype,"readFeature",null),l([B("feature")],F.prototype,"writeFeature",null),l([y({type:Number,json:{write:!0}})],F.prototype,"layerId",void 0),l([y({type:String,json:{write:!0}})],F.prototype,"layerName",void 0),F=l([G("esri.rest.support.IdentifyResult")],F);const _e=F;async function Ve(t,e,s){const n=(e=Te(e)).geometry?[e.geometry]:[],r=ue(t);return r.path+="/identify",pe(n).then(o=>{const i=Ie(e,{geometry:o==null?void 0:o[0]}),u=ye({...r.query,f:"json",...i}),p=ce(u,s);return fe(r.path,p).then(Ge).then(a=>Ae(a,e.sublayers))})}function Ge(t){const e=t.data;return e.results=e.results||[],e.exceededTransferLimit=!!e.exceededTransferLimit,e.results=e.results.map(s=>_e.fromJSON(s)),e}function Te(t){return t=Z.from(t)}function Ae(t,e){if(!(e!=null&&e.length))return t;const s=new Map;function n(r){s.set(r.id,r),r.sublayers&&r.sublayers.forEach(n)}e.forEach(n);for(const r of t.results)r.feature.sourceLayer=s.get(r.layerId);return t}let N=null;function De(t,e){return e.type==="tile"||e.type==="map-image"}let M=class extends he{constructor(t){super(t),this._featuresResolutions=new WeakMap,this.highlightGraphics=null,this.highlightGraphicUpdated=null,this.updateHighlightedFeatures=de(async e=>{this.destroyed||this.updatingHandles.addPromise(this._updateHighlightedFeaturesGeometries(e).catch(()=>{}))})}initialize(){const t=e=>{this.updatingHandles.addPromise(this._updateHighlightedFeaturesSymbols(e).catch(()=>{})),this.updateHighlightedFeatures(this._highlightGeometriesResolution)};this.addHandles([me(()=>this.highlightGraphics,"change",e=>t(e.added),{onListenerAdd:e=>t(e)})])}async fetchPopupFeaturesAtLocation(t,e){var i,u;const{layerView:{layer:s,view:{scale:n}}}=this;if(!t)throw new H("fetchPopupFeatures:invalid-area","Nothing to fetch without area",{layer:s});const r=Ue(s.sublayers,n,e);if(!r.length)return[];const o=await He(s,r);if(!((((u=(i=s.capabilities)==null?void 0:i.operations)==null?void 0:u.supportsIdentify)??!0)&&s.version>=10.5)&&!o)throw new H("fetchPopupFeatures:not-supported","query operation is disabled for this service",{layer:s});return o?this._fetchPopupFeaturesUsingQueries(t,r,e):this._fetchPopupFeaturesUsingIdentify(t,r,e)}clearHighlights(){var t;(t=this.highlightGraphics)==null||t.removeAll()}highlight(t){const e=this.highlightGraphics;if(!e)return I();let s=null;if(t instanceof T?s=[t]:ge.isCollection(t)&&t.length>0?s=t.toArray():Array.isArray(t)&&t.length>0&&(s=t),s=s==null?void 0:s.filter(z),!(s!=null&&s.length))return I();for(const n of s){const r=n.sourceLayer;r!=null&&"geometryType"in r&&r.geometryType==="point"&&(n.visible=!1)}return e.addMany(s),I(()=>e.removeMany(s??[]))}async _updateHighlightedFeaturesSymbols(t){const{layerView:{view:e},highlightGraphics:s,highlightGraphicUpdated:n}=this;if(s&&n)for(const r of t){const o=r.sourceLayer&&"renderer"in r.sourceLayer&&r.sourceLayer.renderer;r.sourceLayer&&"geometryType"in r.sourceLayer&&r.sourceLayer.geometryType==="point"&&o&&"getSymbolAsync"in o&&o.getSymbolAsync(r).then(async i=>{var a;i||(i=new q);let u=null;const p="visualVariables"in o?(a=o.visualVariables)==null?void 0:a.find(c=>c.type==="size"):void 0;p&&(N||(N=(await be(()=>import("./visualVariableUtils-BX9G5gNQ.js"),__vite__mapDeps([0,1,2,3]))).getSize),u=N(p,r,{view:e.type,scale:e.scale,shape:i.type==="simple-marker"?i.style:null})),u||(u="width"in i&&"height"in i&&i.width!=null&&i.height!=null?Math.max(i.width,i.height):"size"in i?i.size:16),s.includes(r)&&(r.symbol=new q({style:"square",size:u,xoffset:"xoffset"in i?i.xoffset:0,yoffset:"yoffset"in i?i.yoffset:0}),n(r,"symbol"),r.visible=!0)})}}async _updateHighlightedFeaturesGeometries(t){const{layerView:{layer:e,view:s},highlightGraphics:n,highlightGraphicUpdated:r}=this;if(this._highlightGeometriesResolution=t,!r||!(n!=null&&n.length)||!e.capabilities.operations.supportsQuery)return;const o=this._getTargetResolution(t),i=new Map;for(const a of n)if(!this._featuresResolutions.has(a)||this._featuresResolutions.get(a)>o){const c=a.sourceLayer;we(i,c,()=>new Map).set(a.getObjectId(),a)}const u=Array.from(i,([a,c])=>{const f=a.createQuery();return f.objectIds=[...c.keys()],f.outFields=[a.objectIdField],f.returnGeometry=!0,f.maxAllowableOffset=o,f.outSpatialReference=s.spatialReference,a.queryFeatures(f)}),p=await Promise.all(u);if(!this.destroyed)for(const{features:a}of p)for(const c of a){const f=c.sourceLayer,m=i.get(f).get(c.getObjectId());m&&n.includes(m)&&(m.geometry=c.geometry,r(m,"geometry"),this._featuresResolutions.set(m,o))}}_getTargetResolution(t){const e=t*_(this.layerView.view.spatialReference),s=e/16;return s<=10?0:t/e*s}async _fetchPopupFeaturesUsingIdentify(t,e,s){const n=await this._createIdentifyParameters(t,e,s);if(n==null)return[];const{results:r}=await Ve(this.layerView.layer.parsedUrl,n,s);return r.map(o=>o.feature)}async _createIdentifyParameters(t,e,s){const{floors:n,layer:r,timeExtent:o,view:{spatialReference:i,scale:u}}=this.layerView;if(!e.length)return null;await Promise.all(e.map(({sublayer:v})=>v.load(s).catch(()=>{})));const p=Math.min(xe("mapservice-popup-identify-max-tolerance"),r.allSublayers.reduce((v,$)=>$.renderer?k({renderer:$.renderer,pointerType:s==null?void 0:s.pointerType}):v,2)),a=this.createFetchPopupFeaturesQueryGeometry(t,p),c=Fe(u,i),f=Math.round(a.width/c),m=new O({xmin:a.center.x-c*f,ymin:a.center.y-c*f,xmax:a.center.x+c*f,ymax:a.center.y+c*f,spatialReference:a.spatialReference});return new Z({floors:n,gdbVersion:"gdbVersion"in r?r.gdbVersion:void 0,geometry:t,height:f,layerOption:"popup",mapExtent:m,returnGeometry:!0,spatialReference:i,sublayers:r.sublayers,timeExtent:o,tolerance:p,width:f})}async _fetchPopupFeaturesUsingQueries(t,e,s){const{layerView:{floors:n,timeExtent:r}}=this,o=e.map(async({sublayer:i,popupTemplate:u})=>{var g;if(await i.load(s).catch(()=>{}),i.capabilities&&!i.capabilities.operations.supportsQuery)return[];const p=i.createQuery(),a=k({renderer:i.renderer,pointerType:s==null?void 0:s.pointerType}),c=this.createFetchPopupFeaturesQueryGeometry(t,a),f=new Set,[m]=await Promise.all([Re(i,u),(g=i.renderer)==null?void 0:g.collectRequiredFields(f,i.fieldsIndex)]);Q(s),ve(f,i.fieldsIndex,m);const v=Array.from(f).sort();if(p.geometry=c,p.outFields=v,p.timeExtent=r,n){const b=n.clone(),j=A(b,i);j!=null&&(p.where=p.where?`(${p.where}) AND (${j})`:j)}const $=this._getTargetResolution(c.width/a),E=await Le(u);Q(s);const d=i.geometryType==="point"||E&&E.arcadeUtils.hasGeometryOperations(u);d||(p.maxAllowableOffset=$);let{features:S}=await i.queryFeatures(p,s);const w=d?0:$;S=await ze(i,S,s);for(const b of S)this._featuresResolutions.set(b,w);return S});return(await Promise.allSettled(o)).reduce((i,u)=>u.status==="fulfilled"?[...i,...u.value]:i,[]).filter(z)}};function Ue(t,e,s){const n=[];if(!t)return n;const r=o=>{const i=o.minScale===0||e<=o.minScale,u=o.maxScale===0||e>=o.maxScale;if(o.visible&&i&&u){if(o.sublayers)o.sublayers.forEach(r);else if(o.popupEnabled){const p=Me(o,{...s,defaultPopupTemplateEnabled:!1});p!=null&&n.unshift({sublayer:o,popupTemplate:p})}}};return t.map(r),n}function Le(t){var e;return(e=t.expressionInfos)!=null&&e.length||Array.isArray(t.content)&&t.content.some(s=>s.type==="expression")?$e():Promise.resolve()}async function He(t,e){var s,n;if((n=(s=t.capabilities)==null?void 0:s.operations)!=null&&n.supportsQuery)return!0;try{return await Promise.any(e.map(({sublayer:r})=>r.load().then(()=>r.capabilities.operations.supportsQuery)))}catch{return!1}}async function ze(t,e,s){const n=t.renderer;return n&&"defaultSymbol"in n&&!n.defaultSymbol&&(e=n.valueExpression?await Promise.all(e.map(r=>n.getSymbolAsync(r,s).then(o=>o?r:null))).then(r=>r.filter(o=>o!=null)):e.filter(r=>n.getSymbol(r)!=null)),e}l([y({constructOnly:!0})],M.prototype,"createFetchPopupFeaturesQueryGeometry",void 0),l([y({constructOnly:!0})],M.prototype,"layerView",void 0),l([y({constructOnly:!0})],M.prototype,"highlightGraphics",void 0),l([y({constructOnly:!0})],M.prototype,"highlightGraphicUpdated",void 0),l([y({constructOnly:!0})],M.prototype,"updatingHandles",void 0),M=l([G("esri.views.layers.support.MapService")],M);function Ze(t,e,s,n=new O){let r=0;if(s.type==="2d")r=e*(s.resolution??0);else if(s.type==="3d"){const c=s.overlayPixelSizeInMapUnits(t),f=s.basemapSpatialReference;r=f==null||f.equals(s.spatialReference)?e*c:_(f)/_(s.spatialReference)}const o=t.x-r,i=t.y-r,u=t.x+r,p=t.y+r,{spatialReference:a}=s;return n.xmin=Math.min(o,u),n.ymin=Math.min(i,p),n.xmax=Math.max(o,u),n.ymax=Math.max(i,p),n.spatialReference=a,n}new O;export{De as S,M as U,Ze as r}; diff --git a/assets/earcut-hRlx3adE.js b/assets/earcut-CWKXDqDj.js similarity index 99% rename from assets/earcut-hRlx3adE.js rename to assets/earcut-CWKXDqDj.js index 3cb89d8..51b5228 100644 --- a/assets/earcut-hRlx3adE.js +++ b/assets/earcut-CWKXDqDj.js @@ -1 +1 @@ -import{ar as Y}from"./index-CEWggaxV.js";var D,E,F,G={exports:{}};D=G,E=function(){function m(t,r,n){n=n||2;var x,i,e,u,v,f,c,l=r&&r.length,s=l?r[0]*n:t.length,a=B(t,0,s,n,!0),y=[];if(!a||a.next===a.prev)return y;if(l&&(a=N(t,r,a,n)),t.length>80*n){x=e=t[0],i=u=t[1];for(var o=n;oe&&(e=v),f>u&&(u=f);c=(c=Math.max(e-x,u-i))!==0?1/c:0}return g(a,y,n,x,i,c),y}function B(t,r,n,x,i){var e,u;if(i===A(t,r,n,x)>0)for(e=r;e=r;e-=x)u=_(e,t[e],t[e+1],u);if(u&&M(u,u.next)){var v=u.next;w(u),u=v}return u}function h(t,r){if(!t)return t;r||(r=t);var n,x=t;do if(n=!1,x.steiner||!M(x,x.next)&&p(x.prev,x,x.next)!==0)x=x.next;else{var i=x.prev;if(w(x),(x=r=i)===x.next)break;n=!0}while(n||x!==r);return r}function g(t,r,n,x,i,e,u){if(t){!u&&e&&S(t,x,i,e);for(var v,f,c=t;t.prev!==t.next;)if(v=t.prev,f=t.next,e?J(t,x,i,e):I(t))r.push(v.i/n),r.push(t.i/n),r.push(f.i/n),w(t),t=f.next,c=f.next;else if((t=f)===c){u?u===1?g(t=K(h(t),r,n),r,n,x,i,e,2):u===2&&L(t,r,n,x,i,e):g(h(t),r,n,x,i,e,1);break}}}function I(t){var r=t.prev,n=t,x=t.next;if(p(r,n,x)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Z(r.x,r.y,n.x,n.y,x.x,x.y,i.x,i.y)&&p(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function J(t,r,n,x){var i=t.prev,e=t,u=t.next;if(p(i,e,u)>=0)return!1;for(var v=i.xe.x?i.x>u.x?i.x:u.x:e.x>u.x?e.x:u.x,l=i.y>e.y?i.y>u.y?i.y:u.y:e.y>u.y?e.y:u.y,s=j(v,f,r,n,x),a=j(c,l,r,n,x),y=t.prevZ,o=t.nextZ;y&&y.z>=s&&o&&o.z<=a;){if(y!==t.prev&&y!==t.next&&Z(i.x,i.y,e.x,e.y,u.x,u.y,y.x,y.y)&&p(y.prev,y,y.next)>=0||(y=y.prevZ,o!==t.prev&&o!==t.next&&Z(i.x,i.y,e.x,e.y,u.x,u.y,o.x,o.y)&&p(o.prev,o,o.next)>=0))return!1;o=o.nextZ}for(;y&&y.z>=s;){if(y!==t.prev&&y!==t.next&&Z(i.x,i.y,e.x,e.y,u.x,u.y,y.x,y.y)&&p(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;o&&o.z<=a;){if(o!==t.prev&&o!==t.next&&Z(i.x,i.y,e.x,e.y,u.x,u.y,o.x,o.y)&&p(o.prev,o,o.next)>=0)return!1;o=o.nextZ}return!0}function K(t,r,n){var x=t;do{var i=x.prev,e=x.next.next;!M(i,e)&&C(i,x,x.next,e)&&d(i,e)&&d(e,i)&&(r.push(i.i/n),r.push(x.i/n),r.push(e.i/n),w(x),w(x.next),x=t=e),x=x.next}while(x!==t);return h(x)}function L(t,r,n,x,i,e){var u=t;do{for(var v=u.next.next;v!==u.prev;){if(u.i!==v.i&&V(u,v)){var f=H(u,v);return u=h(u,u.next),f=h(f,f.next),g(u,r,n,x,i,e),void g(f,r,n,x,i,e)}v=v.next}u=u.next}while(u!==t)}function N(t,r,n,x){var i,e,u,v=[];for(i=0,e=r.length;i=x.next.y&&x.next.y!==x.y){var v=x.x+(e-x.y)*(x.next.x-x.x)/(x.next.y-x.y);if(v<=i&&v>u){if(u=v,v===i){if(e===x.y)return x;if(e===x.next.y)return x.next}n=x.x=x.x&&x.x>=l&&i!==x.x&&Z(en.x||x.x===n.x&&R(n,x)))&&(n=x,a=f)),x=x.next;while(x!==c);return n}function R(t,r){return p(t.prev,t,r.prev)<0&&p(r.next,t,t.next)<0}function S(t,r,n,x){var i=t;do i.z===null&&(i.z=j(i.x,i.y,r,n,x)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,T(i)}function T(t){var r,n,x,i,e,u,v,f,c=1;do{for(n=t,t=null,e=null,u=0;n;){for(u++,x=n,v=0,r=0;r0||f>0&&x;)v!==0&&(f===0||!x||n.z<=x.z)?(i=n,n=n.nextZ,v--):(i=x,x=x.nextZ,f--),e?e.nextZ=i:t=i,i.prevZ=e,e=i;n=x}e.nextZ=null,c*=2}while(u>1);return t}function j(t,r,n,x,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(r=1431655765&((r=858993459&((r=252645135&((r=16711935&((r=32767*(r-x)*i)|r<<8))|r<<4))|r<<2))|r<<1))<<1}function U(t){var r=t,n=t;do(r.x=0&&(t-u)*(x-v)-(n-u)*(r-v)>=0&&(n-u)*(e-v)-(i-u)*(x-v)>=0}function V(t,r){return t.next.i!==r.i&&t.prev.i!==r.i&&!W(t,r)&&(d(t,r)&&d(r,t)&&X(t,r)&&(p(t.prev,t,r.prev)||p(t,r.prev,r))||M(t,r)&&p(t.prev,t,t.next)>0&&p(r.prev,r,r.next)>0)}function p(t,r,n){return(r.y-t.y)*(n.x-r.x)-(r.x-t.x)*(n.y-r.y)}function M(t,r){return t.x===r.x&&t.y===r.y}function C(t,r,n,x){var i=b(p(t,r,n)),e=b(p(t,r,x)),u=b(p(n,x,t)),v=b(p(n,x,r));return i!==e&&u!==v||!(i!==0||!z(t,n,r))||!(e!==0||!z(t,x,r))||!(u!==0||!z(n,t,x))||!(v!==0||!z(n,r,x))}function z(t,r,n){return r.x<=Math.max(t.x,n.x)&&r.x>=Math.min(t.x,n.x)&&r.y<=Math.max(t.y,n.y)&&r.y>=Math.min(t.y,n.y)}function b(t){return t>0?1:t<0?-1:0}function W(t,r){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==r.i&&n.next.i!==r.i&&C(n,n.next,t,r))return!0;n=n.next}while(n!==t);return!1}function d(t,r){return p(t.prev,t,t.next)<0?p(t,r,t.next)>=0&&p(t,t.prev,r)>=0:p(t,r,t.prev)<0||p(t,t.next,r)<0}function X(t,r){var n=t,x=!1,i=(t.x+r.x)/2,e=(t.y+r.y)/2;do n.y>e!=n.next.y>e&&n.next.y!==n.y&&i<(n.next.x-n.x)*(e-n.y)/(n.next.y-n.y)+n.x&&(x=!x),n=n.next;while(n!==t);return x}function H(t,r){var n=new q(t.i,t.x,t.y),x=new q(r.i,r.x,r.y),i=t.next,e=r.prev;return t.next=r,r.prev=t,n.next=i,i.prev=n,x.next=n,n.prev=x,e.next=x,x.prev=e,x}function _(t,r,n,x){var i=new q(t,r,n);return x?(i.next=x.next,i.prev=x,x.next.prev=i,x.next=i):(i.prev=i,i.next=i),i}function w(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function q(t,r,n){this.i=t,this.x=r,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function A(t,r,n,x){for(var i=0,e=r,u=n-x;e0&&(x+=t[i-1].length,n.holes.push(x))}return n},m},(F=E())!==void 0&&(D.exports=F);const tt=Y(G.exports);export{tt as i}; +import{ar as Y}from"./index-BjUNJPVf.js";var D,E,F,G={exports:{}};D=G,E=function(){function m(t,r,n){n=n||2;var x,i,e,u,v,f,c,l=r&&r.length,s=l?r[0]*n:t.length,a=B(t,0,s,n,!0),y=[];if(!a||a.next===a.prev)return y;if(l&&(a=N(t,r,a,n)),t.length>80*n){x=e=t[0],i=u=t[1];for(var o=n;oe&&(e=v),f>u&&(u=f);c=(c=Math.max(e-x,u-i))!==0?1/c:0}return g(a,y,n,x,i,c),y}function B(t,r,n,x,i){var e,u;if(i===A(t,r,n,x)>0)for(e=r;e=r;e-=x)u=_(e,t[e],t[e+1],u);if(u&&M(u,u.next)){var v=u.next;w(u),u=v}return u}function h(t,r){if(!t)return t;r||(r=t);var n,x=t;do if(n=!1,x.steiner||!M(x,x.next)&&p(x.prev,x,x.next)!==0)x=x.next;else{var i=x.prev;if(w(x),(x=r=i)===x.next)break;n=!0}while(n||x!==r);return r}function g(t,r,n,x,i,e,u){if(t){!u&&e&&S(t,x,i,e);for(var v,f,c=t;t.prev!==t.next;)if(v=t.prev,f=t.next,e?J(t,x,i,e):I(t))r.push(v.i/n),r.push(t.i/n),r.push(f.i/n),w(t),t=f.next,c=f.next;else if((t=f)===c){u?u===1?g(t=K(h(t),r,n),r,n,x,i,e,2):u===2&&L(t,r,n,x,i,e):g(h(t),r,n,x,i,e,1);break}}}function I(t){var r=t.prev,n=t,x=t.next;if(p(r,n,x)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Z(r.x,r.y,n.x,n.y,x.x,x.y,i.x,i.y)&&p(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function J(t,r,n,x){var i=t.prev,e=t,u=t.next;if(p(i,e,u)>=0)return!1;for(var v=i.xe.x?i.x>u.x?i.x:u.x:e.x>u.x?e.x:u.x,l=i.y>e.y?i.y>u.y?i.y:u.y:e.y>u.y?e.y:u.y,s=j(v,f,r,n,x),a=j(c,l,r,n,x),y=t.prevZ,o=t.nextZ;y&&y.z>=s&&o&&o.z<=a;){if(y!==t.prev&&y!==t.next&&Z(i.x,i.y,e.x,e.y,u.x,u.y,y.x,y.y)&&p(y.prev,y,y.next)>=0||(y=y.prevZ,o!==t.prev&&o!==t.next&&Z(i.x,i.y,e.x,e.y,u.x,u.y,o.x,o.y)&&p(o.prev,o,o.next)>=0))return!1;o=o.nextZ}for(;y&&y.z>=s;){if(y!==t.prev&&y!==t.next&&Z(i.x,i.y,e.x,e.y,u.x,u.y,y.x,y.y)&&p(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;o&&o.z<=a;){if(o!==t.prev&&o!==t.next&&Z(i.x,i.y,e.x,e.y,u.x,u.y,o.x,o.y)&&p(o.prev,o,o.next)>=0)return!1;o=o.nextZ}return!0}function K(t,r,n){var x=t;do{var i=x.prev,e=x.next.next;!M(i,e)&&C(i,x,x.next,e)&&d(i,e)&&d(e,i)&&(r.push(i.i/n),r.push(x.i/n),r.push(e.i/n),w(x),w(x.next),x=t=e),x=x.next}while(x!==t);return h(x)}function L(t,r,n,x,i,e){var u=t;do{for(var v=u.next.next;v!==u.prev;){if(u.i!==v.i&&V(u,v)){var f=H(u,v);return u=h(u,u.next),f=h(f,f.next),g(u,r,n,x,i,e),void g(f,r,n,x,i,e)}v=v.next}u=u.next}while(u!==t)}function N(t,r,n,x){var i,e,u,v=[];for(i=0,e=r.length;i=x.next.y&&x.next.y!==x.y){var v=x.x+(e-x.y)*(x.next.x-x.x)/(x.next.y-x.y);if(v<=i&&v>u){if(u=v,v===i){if(e===x.y)return x;if(e===x.next.y)return x.next}n=x.x=x.x&&x.x>=l&&i!==x.x&&Z(en.x||x.x===n.x&&R(n,x)))&&(n=x,a=f)),x=x.next;while(x!==c);return n}function R(t,r){return p(t.prev,t,r.prev)<0&&p(r.next,t,t.next)<0}function S(t,r,n,x){var i=t;do i.z===null&&(i.z=j(i.x,i.y,r,n,x)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,T(i)}function T(t){var r,n,x,i,e,u,v,f,c=1;do{for(n=t,t=null,e=null,u=0;n;){for(u++,x=n,v=0,r=0;r0||f>0&&x;)v!==0&&(f===0||!x||n.z<=x.z)?(i=n,n=n.nextZ,v--):(i=x,x=x.nextZ,f--),e?e.nextZ=i:t=i,i.prevZ=e,e=i;n=x}e.nextZ=null,c*=2}while(u>1);return t}function j(t,r,n,x,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(r=1431655765&((r=858993459&((r=252645135&((r=16711935&((r=32767*(r-x)*i)|r<<8))|r<<4))|r<<2))|r<<1))<<1}function U(t){var r=t,n=t;do(r.x=0&&(t-u)*(x-v)-(n-u)*(r-v)>=0&&(n-u)*(e-v)-(i-u)*(x-v)>=0}function V(t,r){return t.next.i!==r.i&&t.prev.i!==r.i&&!W(t,r)&&(d(t,r)&&d(r,t)&&X(t,r)&&(p(t.prev,t,r.prev)||p(t,r.prev,r))||M(t,r)&&p(t.prev,t,t.next)>0&&p(r.prev,r,r.next)>0)}function p(t,r,n){return(r.y-t.y)*(n.x-r.x)-(r.x-t.x)*(n.y-r.y)}function M(t,r){return t.x===r.x&&t.y===r.y}function C(t,r,n,x){var i=b(p(t,r,n)),e=b(p(t,r,x)),u=b(p(n,x,t)),v=b(p(n,x,r));return i!==e&&u!==v||!(i!==0||!z(t,n,r))||!(e!==0||!z(t,x,r))||!(u!==0||!z(n,t,x))||!(v!==0||!z(n,r,x))}function z(t,r,n){return r.x<=Math.max(t.x,n.x)&&r.x>=Math.min(t.x,n.x)&&r.y<=Math.max(t.y,n.y)&&r.y>=Math.min(t.y,n.y)}function b(t){return t>0?1:t<0?-1:0}function W(t,r){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==r.i&&n.next.i!==r.i&&C(n,n.next,t,r))return!0;n=n.next}while(n!==t);return!1}function d(t,r){return p(t.prev,t,t.next)<0?p(t,r,t.next)>=0&&p(t,t.prev,r)>=0:p(t,r,t.prev)<0||p(t,t.next,r)<0}function X(t,r){var n=t,x=!1,i=(t.x+r.x)/2,e=(t.y+r.y)/2;do n.y>e!=n.next.y>e&&n.next.y!==n.y&&i<(n.next.x-n.x)*(e-n.y)/(n.next.y-n.y)+n.x&&(x=!x),n=n.next;while(n!==t);return x}function H(t,r){var n=new q(t.i,t.x,t.y),x=new q(r.i,r.x,r.y),i=t.next,e=r.prev;return t.next=r,r.prev=t,n.next=i,i.prev=n,x.next=n,n.prev=x,e.next=x,x.prev=e,x}function _(t,r,n,x){var i=new q(t,r,n);return x?(i.next=x.next,i.prev=x,x.next.prev=i,x.next=i):(i.prev=i,i.next=i),i}function w(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function q(t,r,n){this.i=t,this.x=r,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function A(t,r,n,x){for(var i=0,e=r,u=n-x;e0&&(x+=t[i-1].length,n.holes.push(x))}return n},m},(F=E())!==void 0&&(D.exports=F);const tt=Y(G.exports);export{tt as i}; diff --git a/assets/edgeProcessing-Cvxjjjkp.js b/assets/edgeProcessing-Dg7MHcWM.js similarity index 96% rename from assets/edgeProcessing-Cvxjjjkp.js rename to assets/edgeProcessing-Dg7MHcWM.js index a32faf1..7940167 100644 --- a/assets/edgeProcessing-Cvxjjjkp.js +++ b/assets/edgeProcessing-Dg7MHcWM.js @@ -1 +1 @@ -import{e as St}from"./deduplicate-Bk22TunD.js";import{H as L}from"./InterleavedLayout-Dd1W8HCo.js";import{e as g}from"./VertexAttribute-BlT9lbVY.js";import{g5 as R,iv as Ot,gz as ot,iw as ht,gT as Et,fg as X,cT as rt,cu as H,gR as At,ix as Tt,cv as gt,cU as st,cx as Nt,cy as w,I as wt,cX as vt,i3 as yt}from"./index-CEWggaxV.js";function J(t,e=0){const n=t.stride;return Array.from(t.fields.keys()).map(s=>{const r=t.fields.get(s),i=r.constructor.ElementCount,l=$t(r.constructor.ElementType),c=r.offset,p=!(!r.optional||!r.optional.glNormalized);return new Ot(s,i,l,c,n,p,e)})}function $t(t){const e=Mt[t];if(e)return e;throw new Error("BufferType not supported in WebGL")}const Mt={u8:R.UNSIGNED_BYTE,u16:R.UNSIGNED_SHORT,u32:R.UNSIGNED_INT,i8:R.BYTE,i16:R.SHORT,i32:R.INT,f32:R.FLOAT},Rt=L().vec3f(g.POSITION).u16(g.COMPONENTINDEX),Pt=L().vec2u8(g.SIDENESS);J(Pt);const K=L().vec3f(g.POSITION0).vec3f(g.POSITION1).vec2i16(g.NORMALCOMPRESSED).u16(g.COMPONENTINDEX).u8(g.VARIANTOFFSET,{glNormalized:!0}).u8(g.VARIANTSTROKE).u8(g.VARIANTEXTENSION,{glNormalized:!0}),G=L().vec3f(g.POSITION0).vec3f(g.POSITION1).vec2i16(g.NORMALCOMPRESSED).vec2i16(g.NORMAL2COMPRESSED).u16(g.COMPONENTINDEX).u8(g.VARIANTOFFSET,{glNormalized:!0}).u8(g.VARIANTSTROKE).u8(g.VARIANTEXTENSION,{glNormalized:!0});g.POSITION0,g.POSITION1,g.COMPONENTINDEX,g.VARIANTOFFSET,g.VARIANTSTROKE,g.VARIANTEXTENSION,g.NORMALCOMPRESSED,g.NORMAL2COMPRESSED,g.SIDENESS;const P=-1;var it;function Dt(t,e,n,s=_t){const r=t.vertices.position,i=t.vertices.componentIndex,l=ot(s.anglePlanar),c=ot(s.angleSignificantEdge),p=Math.cos(c),f=Math.cos(l),u=k.edge,I=u.position0,S=u.position1,d=u.faceNormal0,v=u.faceNormal1,O=Ft(t),y=Lt(t),o=y.length/4,a=e.allocate(o);let N=0;const m=o,h=n.allocate(m);let T=0,$=0,E=0;const Z=ht(0,o),_=new Float32Array(o);_.forEach((D,A,F)=>{r.getVec(y[4*A],I),r.getVec(y[4*A+1],S),F[A]=Et(I,S)}),Z.sort((D,A)=>_[A]-_[D]);const tt=new Array,et=new Array;for(let D=0;De}function Ct(t,e){const n=At(t.cosAngle),s=k.fwd,r=k.ortho;return Tt(s,t.position1,t.position0),n*(H(gt(r,t.faceNormal0,t.faceNormal1),s)>0?-1:1)>e}function Lt(t){const e=t.faces.length/3,n=t.faces,s=t.neighbors;let r=0;for(let c=0;c{o{if(o{const N=2*o,m=a-o;for(let h=1;h=0&&f[N+2*E]>T;E--)f[N+2*E+2]=f[N+2*E],f[N+2*E+3]=f[N+2*E+1];f[N+2*E+2]=T,f[N+2*E+3]=$}};for(let o=0;oo===t[3*a]?0:o===t[3*a+1]?1:o===t[3*a+2]?2:-1,O=(o,a)=>{const N=v(o,a);d[3*a+N]=-1},y=(o,a,N,m)=>{const h=v(o,a);d[3*a+h]=m;const T=v(N,m);d[3*m+T]=a};for(let o=0;o=0?1:-1)*(1-Math.abs(p)):c,u=r<=0?(p>=0?1:-1)*(1-Math.abs(c)):p,I=e*i;t[I]=at(f),t[I+1]=at(u)}function at(t){return wt(Math.round(32767*t),-32767,32767)}class mt{updateSettings(e){this.settings=e,this._edgeHashFunction=e.reducedPrecision?Bt:bt}write(e,n,s){const r=this._edgeHashFunction(s);B.seed=r;const i=B.getIntRange(0,255),l=B.getIntRange(0,this.settings.variants-1),c=.7,p=B.getFloat(),f=255*(.5*Ut(-(1-Math.min(p/c,1))+Math.max(0,p-c)/(1-c),1.2)+.5);e.position0.setVec(n,s.position0),e.position1.setVec(n,s.position1),e.componentIndex.set(n,s.componentIndex),e.variantOffset.set(n,i),e.variantStroke.set(n,l),e.variantExtension.set(n,f)}trim(e,n){return e.slice(0,n)}}const Q=new Float32Array(6),U=new Uint32Array(Q.buffer),M=new Uint32Array(1);function bt(t){const e=Q;e[0]=t.position0[0],e[1]=t.position0[1],e[2]=t.position0[2],e[3]=t.position1[0],e[4]=t.position1[1],e[5]=t.position1[2],M[0]=5381;for(let n=0;n{const r=t.fields.get(s),i=r.constructor.ElementCount,l=$t(r.constructor.ElementType),c=r.offset,p=!(!r.optional||!r.optional.glNormalized);return new Ot(s,i,l,c,n,p,e)})}function $t(t){const e=Mt[t];if(e)return e;throw new Error("BufferType not supported in WebGL")}const Mt={u8:R.UNSIGNED_BYTE,u16:R.UNSIGNED_SHORT,u32:R.UNSIGNED_INT,i8:R.BYTE,i16:R.SHORT,i32:R.INT,f32:R.FLOAT},Rt=L().vec3f(g.POSITION).u16(g.COMPONENTINDEX),Pt=L().vec2u8(g.SIDENESS);J(Pt);const K=L().vec3f(g.POSITION0).vec3f(g.POSITION1).vec2i16(g.NORMALCOMPRESSED).u16(g.COMPONENTINDEX).u8(g.VARIANTOFFSET,{glNormalized:!0}).u8(g.VARIANTSTROKE).u8(g.VARIANTEXTENSION,{glNormalized:!0}),G=L().vec3f(g.POSITION0).vec3f(g.POSITION1).vec2i16(g.NORMALCOMPRESSED).vec2i16(g.NORMAL2COMPRESSED).u16(g.COMPONENTINDEX).u8(g.VARIANTOFFSET,{glNormalized:!0}).u8(g.VARIANTSTROKE).u8(g.VARIANTEXTENSION,{glNormalized:!0});g.POSITION0,g.POSITION1,g.COMPONENTINDEX,g.VARIANTOFFSET,g.VARIANTSTROKE,g.VARIANTEXTENSION,g.NORMALCOMPRESSED,g.NORMAL2COMPRESSED,g.SIDENESS;const P=-1;var it;function Dt(t,e,n,s=_t){const r=t.vertices.position,i=t.vertices.componentIndex,l=ot(s.anglePlanar),c=ot(s.angleSignificantEdge),p=Math.cos(c),f=Math.cos(l),u=k.edge,I=u.position0,S=u.position1,d=u.faceNormal0,v=u.faceNormal1,O=Ft(t),y=Lt(t),o=y.length/4,a=e.allocate(o);let N=0;const m=o,h=n.allocate(m);let T=0,$=0,E=0;const Z=ht(0,o),_=new Float32Array(o);_.forEach((D,A,F)=>{r.getVec(y[4*A],I),r.getVec(y[4*A+1],S),F[A]=Et(I,S)}),Z.sort((D,A)=>_[A]-_[D]);const tt=new Array,et=new Array;for(let D=0;De}function Ct(t,e){const n=At(t.cosAngle),s=k.fwd,r=k.ortho;return Tt(s,t.position1,t.position0),n*(H(gt(r,t.faceNormal0,t.faceNormal1),s)>0?-1:1)>e}function Lt(t){const e=t.faces.length/3,n=t.faces,s=t.neighbors;let r=0;for(let c=0;c{o{if(o{const N=2*o,m=a-o;for(let h=1;h=0&&f[N+2*E]>T;E--)f[N+2*E+2]=f[N+2*E],f[N+2*E+3]=f[N+2*E+1];f[N+2*E+2]=T,f[N+2*E+3]=$}};for(let o=0;oo===t[3*a]?0:o===t[3*a+1]?1:o===t[3*a+2]?2:-1,O=(o,a)=>{const N=v(o,a);d[3*a+N]=-1},y=(o,a,N,m)=>{const h=v(o,a);d[3*a+h]=m;const T=v(N,m);d[3*m+T]=a};for(let o=0;o=0?1:-1)*(1-Math.abs(p)):c,u=r<=0?(p>=0?1:-1)*(1-Math.abs(c)):p,I=e*i;t[I]=at(f),t[I+1]=at(u)}function at(t){return wt(Math.round(32767*t),-32767,32767)}class mt{updateSettings(e){this.settings=e,this._edgeHashFunction=e.reducedPrecision?Bt:bt}write(e,n,s){const r=this._edgeHashFunction(s);B.seed=r;const i=B.getIntRange(0,255),l=B.getIntRange(0,this.settings.variants-1),c=.7,p=B.getFloat(),f=255*(.5*Ut(-(1-Math.min(p/c,1))+Math.max(0,p-c)/(1-c),1.2)+.5);e.position0.setVec(n,s.position0),e.position1.setVec(n,s.position1),e.componentIndex.set(n,s.componentIndex),e.variantOffset.set(n,i),e.variantStroke.set(n,l),e.variantExtension.set(n,f)}trim(e,n){return e.slice(0,n)}}const Q=new Float32Array(6),U=new Uint32Array(Q.buffer),M=new Uint32Array(1);function bt(t){const e=Q;e[0]=t.position0[0],e[1]=t.position0[1],e[2]=t.position0[2],e[3]=t.position1[0],e[4]=t.position1[1],e[5]=t.position1[2],M[0]=5381;for(let n=0;n{(p.addedFeatures.length||p.updatedFeatures.length||p.deletedFeatures.length||p.addedAttachments.length||p.updatedAttachments.length||p.deletedAttachments.length)&&e.emit("edits",p)});const i={result:s.promise};e.emit("apply-edits",i)}try{const{results:i,edits:p}=await C(e,t,a,r),c=h=>h.filter(I=>!I.error).map(v),l={edits:p,addedFeatures:c(i.addFeatureResults),updatedFeatures:c(i.updateFeatureResults),deletedFeatures:c(i.deleteFeatureResults),addedAttachments:c(i.addAttachmentResults),updatedAttachments:c(i.updateAttachmentResults),deletedAttachments:c(i.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:i.editMoment?new Date(i.editMoment):null,globalIdToObjectId:r.globalIdToObjectId};return(o=i.editedFeatureResults)!=null&&o.length&&(l.editedFeatures=i.editedFeatureResults),s.resolve(l),i}catch(i){throw s.reject(i),i}}async function C(e,t,a,r){var u,o,i,p,c,l;if(await e.load(),!F(t))throw new d(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!E(e))throw new d(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:s,options:n}=await q(e,a,r);return(u=s.addFeatures)!=null&&u.length||(o=s.updateFeatures)!=null&&o.length||(i=s.deleteFeatures)!=null&&i.length||(p=s.addAttachments)!=null&&p.length||(c=s.updateAttachments)!=null&&c.length||(l=s.deleteAttachments)!=null&&l.length?{edits:s,results:await t.applyEdits(s,n)}:{edits:s,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}async function q(e,t,a){const r=w(e),s=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),n=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),u=e.infoFor3D!=null;if(P(t,r,a,!!s,!!n,`${e.type}-layer`),!r.data.isVersioned&&(a==null?void 0:a.gdbVersion))throw new d(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!r.editing.supportsRollbackOnFailure&&(a!=null&&a.rollbackOnFailureEnabled))throw new d(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");const o={...a};if(o.rollbackOnFailureEnabled!=null||r.editing.supportsRollbackOnFailure||(o.rollbackOnFailureEnabled=!0),o.rollbackOnFailureEnabled||o.returnServiceEditsOption!=="original-and-current-features"||(o.rollbackOnFailureEnabled===!1&&S.getLogger("esri.layers.graphics.editingSupport").warn(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwritten and set to true."),o.rollbackOnFailureEnabled=!0),!r.editing.supportsReturnServiceEditsInSourceSpatialReference&&o.returnServiceEditsInSourceSR)throw new d(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(o.returnServiceEditsInSourceSR&&o.returnServiceEditsOption!=="original-and-current-features")throw new d(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const i=K(t,r,`${e.type}-layer`),p=(a==null?void 0:a.globalIdUsed)||u,c=e.fields.filter(l=>l.type==="big-integer"||l.type==="oid"&&(l.length||0)>=8);if(p){const{globalIdField:l}=e;if(l==null)throw new d(`${e.type}-layer:invalid-parameter`,"Layer does not specify a global id field.");i.addFeatures.forEach(h=>J(h,l))}return i.addFeatures.forEach(l=>N(l,e,p,c)),i.updateFeatures.forEach(l=>_(l,e,p,c)),i.deleteFeatures.forEach(l=>Z(l,e,p,c)),i.addAttachments.forEach(l=>m(l,e)),i.updateAttachments.forEach(l=>m(l,e)),u&&await Q(i,e),{edits:await X(i),options:o}}function f(e,t,a,r){var s,n;if(a){if("attributes"in e&&!e.attributes[t.globalIdField])throw new d(`${t.type}-layer:invalid-parameter`,`Feature should have '${t.globalIdField}' when 'globalIdUsed' is true`);if(!("attributes"in e)&&!e.globalId)throw new d(`${t.type}-layer:invalid-parameter`,"`'globalId' of the feature should be passed when 'globalIdUsed' is true")}if(r.length&&"attributes"in e)for(const u of r){const o=e.attributes[u.name];if(o!==void 0&&!G(u,o))throw new d(`${t.type}-layer:invalid-parameter`,`Big-integer field '${u.name}' of the feature must be less than ${Number.MAX_SAFE_INTEGER}`,{feature:e})}if("geometry"in e&&e.geometry!=null){if(e.geometry.hasZ&&((s=t.capabilities)==null?void 0:s.data.supportsZ)===!1)throw new d(`${t.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(e.geometry.hasM&&((n=t.capabilities)==null?void 0:n.data.supportsM)===!1)throw new d(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function A(e,t){var a;if("geometry"in e&&((a=e.geometry)==null?void 0:a.type)==="mesh"&&t.infoFor3D!=null&&t.spatialReference!=null){const{geometry:r}=e,{spatialReference:s,vertexSpace:n}=r,u=t.spatialReference,o=n.type==="local",i=U(u),p=T(u,s),c=p||y(u)&&(y(s)||V(s));if(!(o&&i&&c||!o&&!i&&p))throw new d(`${t.type}-layer:mesh-unsupported`,`Uploading a mesh with a ${n.type} vertex space and a spatial reference wkid:${s.wkid} to a layer with a spatial reference wkid:${u.wkid} is not supported.`)}}function N(e,t,a,r){f(e,t,a,r),A(e,t)}function Z(e,t,a,r){f(e,t,a,r)}function _(e,t,a,r){f(e,t,a,r),A(e,t);const s=w(t);if("geometry"in e&&e.geometry!=null&&!(s!=null&&s.editing.supportsGeometryUpdate))throw new d(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}function m(e,t){var s;const{feature:a,attachment:r}=e;if(!a||"attributes"in a&&!a.attributes[t.globalIdField])throw new d(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in a)&&!a.globalId)throw new d(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!r.globalId)throw new d(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!r.data&&!r.uploadId)throw new d(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(r.data instanceof File&&r.data.name)&&!r.name)throw new d(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!((s=t.capabilities)!=null&&s.editing.supportsUploadWithItemId)&&r.uploadId)throw new d(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if(typeof r.data=="string"){const n=R(r.data);if(n&&!n.isBase64)throw new d(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}function J(e,t){const{attributes:a}=e;a[t]==null&&(a[t]=O())}async function X(e){const t=e.addFeatures??[],a=e.updateFeatures??[],r=t.concat(a).map(o=>o.geometry),s=await k(r),n=t.length,u=a.length;return s.slice(0,n).forEach((o,i)=>t[i].geometry=o),s.slice(n,n+u).forEach((o,i)=>a[i].geometry=o),e}function H(e){return{addFeatures:Array.from((e==null?void 0:e.addFeatures)??[]),updateFeatures:Array.from((e==null?void 0:e.updateFeatures)??[]),deleteFeatures:e&&L.isCollection(e.deleteFeatures)?e.deleteFeatures.toArray():e.deleteFeatures||[],addAttachments:e.addAttachments||[],updateAttachments:e.updateAttachments||[],deleteAttachments:e.deleteAttachments||[]}}function K(e,t,a){var s,n,u;const r=H(e);if((s=r.addFeatures)!=null&&s.length&&!t.operations.supportsAdd)throw new d(`${a}:unsupported-operation`,"Layer does not support adding features.");if((n=r.updateFeatures)!=null&&n.length&&!t.operations.supportsUpdate)throw new d(`${a}:unsupported-operation`,"Layer does not support updating features.");if((u=r.deleteFeatures)!=null&&u.length&&!t.operations.supportsDelete)throw new d(`${a}:unsupported-operation`,"Layer does not support deleting features.");return r.addFeatures=r.addFeatures.map(g),r.updateFeatures=r.updateFeatures.map(g),r.addAssetFeatures=[],r}function P(e,t,a,r,s,n){if(!e||!r&&!s)throw new d(`${n}:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");if(!t.editing.supportsGlobalId&&(a!=null&&a.globalIdUsed))throw new d(`${n}:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!t.editing.supportsGlobalId&&s)throw new d(`${n}:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!(a!=null&&a.globalIdUsed)&&s)throw new d(`${n}:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true")}function g(e){const t=new j;return e.attributes||(e.attributes={}),t.geometry=e.geometry,t.attributes=e.attributes,t}async function Q(e,t){if(t.infoFor3D==null)return;const{infoFor3D:a}=t,r=W("model/gltf-binary",a.supportedFormats)??z("glb",a.supportedFormats);if(!(r&&a.editFormats.includes(r)))throw new d(`${t.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");e.addAssetFeatures??(e.addAssetFeatures=[]);const{addAssetFeatures:s}=e;for(const n of e.addFeatures??[])b(n)&&s.push(n);for(const n of e.updateFeatures??[])b(n)&&s.push(n)}function b(e){var t;return((t=e==null?void 0:e.geometry)==null?void 0:t.type)==="mesh"}function ie(e,t,a,r){if(!F(t))throw new d(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!t.uploadAssets)throw new d(`${e.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:e});return t.uploadAssets(a,r)}export{se as applyEdits,P as checkEditingCapabilities,re as isFeatureIdentifierArrayWithGlobalId,ae as isFeatureIdentifierArrayWithObjectId,x as isFeatureIdentifierWithGlobalId,M as isFeatureIdentifierWithObjectId,H as normalizeCollections,K as normalizeEdits,X as normalizeGeometries,g as shallowCloneFeature,ie as uploadAssets}; +import{df as $,aV as v,N as d,dg as E,dh as w,s as S,J as R,di as O,dj as k,V as L,j,dk as G,dl as U,G as T,cG as y,ak as V}from"./index-BjUNJPVf.js";import{p as B,h as D}from"./EditBusLayer-OslMX9fF.js";import{u as W,i as z}from"./infoFor3D-DsOdlPuA.js";function F(e){return(e==null?void 0:e.applyEdits)!=null}function M(e){return typeof e=="object"&&e!=null&&"objectId"in e&&!!e.objectId}function ae(e){return e.every(M)}function x(e){return typeof e=="object"&&e!=null&&"globalId"in e&&!!e.globalId}function re(e){return e.every(x)}async function se(e,t,a,r={}){var o;let s;const n="gdbVersion"in e?e.gdbVersion:null,u=r.gdbVersion??n;if(B(e)&&e.url)s=D(e.url,e.layerId,u,r.returnServiceEditsOption==="original-and-current-features");else{s=$(),s.promise.then(p=>{(p.addedFeatures.length||p.updatedFeatures.length||p.deletedFeatures.length||p.addedAttachments.length||p.updatedAttachments.length||p.deletedAttachments.length)&&e.emit("edits",p)});const i={result:s.promise};e.emit("apply-edits",i)}try{const{results:i,edits:p}=await C(e,t,a,r),c=h=>h.filter(I=>!I.error).map(v),l={edits:p,addedFeatures:c(i.addFeatureResults),updatedFeatures:c(i.updateFeatureResults),deletedFeatures:c(i.deleteFeatureResults),addedAttachments:c(i.addAttachmentResults),updatedAttachments:c(i.updateAttachmentResults),deletedAttachments:c(i.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:i.editMoment?new Date(i.editMoment):null,globalIdToObjectId:r.globalIdToObjectId};return(o=i.editedFeatureResults)!=null&&o.length&&(l.editedFeatures=i.editedFeatureResults),s.resolve(l),i}catch(i){throw s.reject(i),i}}async function C(e,t,a,r){var u,o,i,p,c,l;if(await e.load(),!F(t))throw new d(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!E(e))throw new d(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:s,options:n}=await q(e,a,r);return(u=s.addFeatures)!=null&&u.length||(o=s.updateFeatures)!=null&&o.length||(i=s.deleteFeatures)!=null&&i.length||(p=s.addAttachments)!=null&&p.length||(c=s.updateAttachments)!=null&&c.length||(l=s.deleteAttachments)!=null&&l.length?{edits:s,results:await t.applyEdits(s,n)}:{edits:s,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}async function q(e,t,a){const r=w(e),s=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),n=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),u=e.infoFor3D!=null;if(P(t,r,a,!!s,!!n,`${e.type}-layer`),!r.data.isVersioned&&(a==null?void 0:a.gdbVersion))throw new d(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!r.editing.supportsRollbackOnFailure&&(a!=null&&a.rollbackOnFailureEnabled))throw new d(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");const o={...a};if(o.rollbackOnFailureEnabled!=null||r.editing.supportsRollbackOnFailure||(o.rollbackOnFailureEnabled=!0),o.rollbackOnFailureEnabled||o.returnServiceEditsOption!=="original-and-current-features"||(o.rollbackOnFailureEnabled===!1&&S.getLogger("esri.layers.graphics.editingSupport").warn(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwritten and set to true."),o.rollbackOnFailureEnabled=!0),!r.editing.supportsReturnServiceEditsInSourceSpatialReference&&o.returnServiceEditsInSourceSR)throw new d(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(o.returnServiceEditsInSourceSR&&o.returnServiceEditsOption!=="original-and-current-features")throw new d(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const i=K(t,r,`${e.type}-layer`),p=(a==null?void 0:a.globalIdUsed)||u,c=e.fields.filter(l=>l.type==="big-integer"||l.type==="oid"&&(l.length||0)>=8);if(p){const{globalIdField:l}=e;if(l==null)throw new d(`${e.type}-layer:invalid-parameter`,"Layer does not specify a global id field.");i.addFeatures.forEach(h=>J(h,l))}return i.addFeatures.forEach(l=>N(l,e,p,c)),i.updateFeatures.forEach(l=>_(l,e,p,c)),i.deleteFeatures.forEach(l=>Z(l,e,p,c)),i.addAttachments.forEach(l=>m(l,e)),i.updateAttachments.forEach(l=>m(l,e)),u&&await Q(i,e),{edits:await X(i),options:o}}function f(e,t,a,r){var s,n;if(a){if("attributes"in e&&!e.attributes[t.globalIdField])throw new d(`${t.type}-layer:invalid-parameter`,`Feature should have '${t.globalIdField}' when 'globalIdUsed' is true`);if(!("attributes"in e)&&!e.globalId)throw new d(`${t.type}-layer:invalid-parameter`,"`'globalId' of the feature should be passed when 'globalIdUsed' is true")}if(r.length&&"attributes"in e)for(const u of r){const o=e.attributes[u.name];if(o!==void 0&&!G(u,o))throw new d(`${t.type}-layer:invalid-parameter`,`Big-integer field '${u.name}' of the feature must be less than ${Number.MAX_SAFE_INTEGER}`,{feature:e})}if("geometry"in e&&e.geometry!=null){if(e.geometry.hasZ&&((s=t.capabilities)==null?void 0:s.data.supportsZ)===!1)throw new d(`${t.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(e.geometry.hasM&&((n=t.capabilities)==null?void 0:n.data.supportsM)===!1)throw new d(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function A(e,t){var a;if("geometry"in e&&((a=e.geometry)==null?void 0:a.type)==="mesh"&&t.infoFor3D!=null&&t.spatialReference!=null){const{geometry:r}=e,{spatialReference:s,vertexSpace:n}=r,u=t.spatialReference,o=n.type==="local",i=U(u),p=T(u,s),c=p||y(u)&&(y(s)||V(s));if(!(o&&i&&c||!o&&!i&&p))throw new d(`${t.type}-layer:mesh-unsupported`,`Uploading a mesh with a ${n.type} vertex space and a spatial reference wkid:${s.wkid} to a layer with a spatial reference wkid:${u.wkid} is not supported.`)}}function N(e,t,a,r){f(e,t,a,r),A(e,t)}function Z(e,t,a,r){f(e,t,a,r)}function _(e,t,a,r){f(e,t,a,r),A(e,t);const s=w(t);if("geometry"in e&&e.geometry!=null&&!(s!=null&&s.editing.supportsGeometryUpdate))throw new d(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}function m(e,t){var s;const{feature:a,attachment:r}=e;if(!a||"attributes"in a&&!a.attributes[t.globalIdField])throw new d(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in a)&&!a.globalId)throw new d(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!r.globalId)throw new d(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!r.data&&!r.uploadId)throw new d(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(r.data instanceof File&&r.data.name)&&!r.name)throw new d(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!((s=t.capabilities)!=null&&s.editing.supportsUploadWithItemId)&&r.uploadId)throw new d(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if(typeof r.data=="string"){const n=R(r.data);if(n&&!n.isBase64)throw new d(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}function J(e,t){const{attributes:a}=e;a[t]==null&&(a[t]=O())}async function X(e){const t=e.addFeatures??[],a=e.updateFeatures??[],r=t.concat(a).map(o=>o.geometry),s=await k(r),n=t.length,u=a.length;return s.slice(0,n).forEach((o,i)=>t[i].geometry=o),s.slice(n,n+u).forEach((o,i)=>a[i].geometry=o),e}function H(e){return{addFeatures:Array.from((e==null?void 0:e.addFeatures)??[]),updateFeatures:Array.from((e==null?void 0:e.updateFeatures)??[]),deleteFeatures:e&&L.isCollection(e.deleteFeatures)?e.deleteFeatures.toArray():e.deleteFeatures||[],addAttachments:e.addAttachments||[],updateAttachments:e.updateAttachments||[],deleteAttachments:e.deleteAttachments||[]}}function K(e,t,a){var s,n,u;const r=H(e);if((s=r.addFeatures)!=null&&s.length&&!t.operations.supportsAdd)throw new d(`${a}:unsupported-operation`,"Layer does not support adding features.");if((n=r.updateFeatures)!=null&&n.length&&!t.operations.supportsUpdate)throw new d(`${a}:unsupported-operation`,"Layer does not support updating features.");if((u=r.deleteFeatures)!=null&&u.length&&!t.operations.supportsDelete)throw new d(`${a}:unsupported-operation`,"Layer does not support deleting features.");return r.addFeatures=r.addFeatures.map(g),r.updateFeatures=r.updateFeatures.map(g),r.addAssetFeatures=[],r}function P(e,t,a,r,s,n){if(!e||!r&&!s)throw new d(`${n}:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");if(!t.editing.supportsGlobalId&&(a!=null&&a.globalIdUsed))throw new d(`${n}:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!t.editing.supportsGlobalId&&s)throw new d(`${n}:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!(a!=null&&a.globalIdUsed)&&s)throw new d(`${n}:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true")}function g(e){const t=new j;return e.attributes||(e.attributes={}),t.geometry=e.geometry,t.attributes=e.attributes,t}async function Q(e,t){if(t.infoFor3D==null)return;const{infoFor3D:a}=t,r=W("model/gltf-binary",a.supportedFormats)??z("glb",a.supportedFormats);if(!(r&&a.editFormats.includes(r)))throw new d(`${t.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");e.addAssetFeatures??(e.addAssetFeatures=[]);const{addAssetFeatures:s}=e;for(const n of e.addFeatures??[])b(n)&&s.push(n);for(const n of e.updateFeatures??[])b(n)&&s.push(n)}function b(e){var t;return((t=e==null?void 0:e.geometry)==null?void 0:t.type)==="mesh"}function ie(e,t,a,r){if(!F(t))throw new d(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!t.uploadAssets)throw new d(`${e.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:e});return t.uploadAssets(a,r)}export{se as applyEdits,P as checkEditingCapabilities,re as isFeatureIdentifierArrayWithGlobalId,ae as isFeatureIdentifierArrayWithObjectId,x as isFeatureIdentifierWithGlobalId,M as isFeatureIdentifierWithObjectId,H as normalizeCollections,K as normalizeEdits,X as normalizeGeometries,g as shallowCloneFeature,ie as uploadAssets}; diff --git a/assets/editsZScale-CQCGPEjO.js b/assets/editsZScale-Bfe6gH1b.js similarity index 89% rename from assets/editsZScale-CQCGPEjO.js rename to assets/editsZScale-Bfe6gH1b.js index 41d9ffb..2bab7d5 100644 --- a/assets/editsZScale-CQCGPEjO.js +++ b/assets/editsZScale-Bfe6gH1b.js @@ -1 +1 @@ -import{bk as l,G as a}from"./index-CEWggaxV.js";function t(n,s,o){if(n.hasM==null||n.hasZ)for(const f of s)for(const e of f)e.length>2&&(e[2]*=o)}function u(n,s,o){if(!n&&!s||!o)return;const f=l(o);r(n,o,f),r(s,o,f)}function r(n,s,o){if(n)for(const f of n)c(f.geometry,s,o)}function c(n,s,o){if(!(n!=null&&n.spatialReference)||a(n.spatialReference,s))return;const f=l(n.spatialReference)/o;if(f!==1){if("x"in n)n.z!=null&&(n.z*=f);else if("rings"in n)t(n,n.rings,f);else if("paths"in n)t(n,n.paths,f);else if("points"in n&&(n.hasM==null||n.hasZ))for(const e of n.points)e.length>2&&(e[2]*=f)}}export{u as i}; +import{bk as l,G as a}from"./index-BjUNJPVf.js";function t(n,s,o){if(n.hasM==null||n.hasZ)for(const f of s)for(const e of f)e.length>2&&(e[2]*=o)}function u(n,s,o){if(!n&&!s||!o)return;const f=l(o);r(n,o,f),r(s,o,f)}function r(n,s,o){if(n)for(const f of n)c(f.geometry,s,o)}function c(n,s,o){if(!(n!=null&&n.spatialReference)||a(n.spatialReference,s))return;const f=l(n.spatialReference)/o;if(f!==1){if("x"in n)n.z!=null&&(n.z*=f);else if("rings"in n)t(n,n.rings,f);else if("paths"in n)t(n,n.paths,f);else if("points"in n&&(n.hasM==null||n.hasZ))for(const e of n.points)e.length>2&&(e[2]*=f)}}export{u as i}; diff --git a/assets/elevationInfoUtils-Dag_mzct.js b/assets/elevationInfoUtils-DIYaTlLQ.js similarity index 90% rename from assets/elevationInfoUtils-Dag_mzct.js rename to assets/elevationInfoUtils-DIYaTlLQ.js index 5f04449..1cf91fb 100644 --- a/assets/elevationInfoUtils-Dag_mzct.js +++ b/assets/elevationInfoUtils-DIYaTlLQ.js @@ -1 +1 @@ -import"./index-CEWggaxV.js";function r(e){return e?u:f}function t(e,o){return o!=null&&o.mode?o.mode:r(e).mode}function l(e,o){return t(e!=null&&e.hasZ,o)}function s(e,o,n){return n&&n.mode!==o?`${e} only support ${o} elevation mode`:null}function d(e,o,n){return(n==null?void 0:n.mode)===o?`${e} do not support ${o} elevation mode`:null}function p(e,o){return(o==null?void 0:o.featureExpressionInfo)!=null&&o.featureExpressionInfo.expression!=="0"?`${e} do not support featureExpressionInfo`:null}function m(e,o){o&&e.warn(".elevationInfo=",o)}const u={mode:"absolute-height",offset:0},f={mode:"on-the-ground",offset:null};export{m as I,p as Z,l as i,s as x,d as y}; +import"./index-BjUNJPVf.js";function r(e){return e?u:f}function t(e,o){return o!=null&&o.mode?o.mode:r(e).mode}function l(e,o){return t(e!=null&&e.hasZ,o)}function s(e,o,n){return n&&n.mode!==o?`${e} only support ${o} elevation mode`:null}function d(e,o,n){return(n==null?void 0:n.mode)===o?`${e} do not support ${o} elevation mode`:null}function p(e,o){return(o==null?void 0:o.featureExpressionInfo)!=null&&o.featureExpressionInfo.expression!=="0"?`${e} do not support featureExpressionInfo`:null}function m(e,o){o&&e.warn(".elevationInfo=",o)}const u={mode:"absolute-height",offset:0},f={mode:"on-the-ground",offset:null};export{m as I,p as Z,l as i,s as x,d as y}; diff --git a/assets/executeForIds-BjeEaIen.js b/assets/executeForIds-CZ3M8IZd.js similarity index 57% rename from assets/executeForIds-BjeEaIen.js rename to assets/executeForIds-CZ3M8IZd.js index 512c09f..9e46baf 100644 --- a/assets/executeForIds-BjeEaIen.js +++ b/assets/executeForIds-CZ3M8IZd.js @@ -1 +1 @@ -import{aW as c,aX as s}from"./index-CEWggaxV.js";import{S as f,p as e}from"./query-BM8R3sQ6.js";async function u(n,t,o){const r=c(n);return f(r,s.from(t),{...o}).then(a=>a.data.count)}async function i(n,t,o){const r=c(n);return e(r,s.from(t),{...o}).then(a=>a.data.objectIds)}export{u as n,i as s}; +import{aW as c,aX as s}from"./index-BjUNJPVf.js";import{S as f,p as e}from"./query-Bk_ITqRK.js";async function u(n,t,o){const r=c(n);return f(r,s.from(t),{...o}).then(a=>a.data.count)}async function i(n,t,o){const r=c(n);return e(r,s.from(t),{...o}).then(a=>a.data.objectIds)}export{u as n,i as s}; diff --git a/assets/executeForTopCount-DDGFKOhN.js b/assets/executeForTopCount-DDGFKOhN.js new file mode 100644 index 0000000..52a2510 --- /dev/null +++ b/assets/executeForTopCount-DDGFKOhN.js @@ -0,0 +1 @@ +import{aW as i}from"./index-BjUNJPVf.js";import{a as p}from"./queryTopFeatures-BZWuOU3o.js";import{S as a}from"./TopFeaturesQuery-CVQjqlfM.js";import"./query-Bk_ITqRK.js";import"./pbfQueryUtils-CSeFSIjv.js";import"./pbf-Du8sFEWo.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./queryZScale-Dwvn5BlQ.js";async function y(o,t,r){const m=i(o);return(await p(m,a.from(t),{...r})).data.count}export{y as executeForTopCount}; diff --git a/assets/executeForTopCount-P_PtmMoE.js b/assets/executeForTopCount-P_PtmMoE.js deleted file mode 100644 index 8097c0a..0000000 --- a/assets/executeForTopCount-P_PtmMoE.js +++ /dev/null @@ -1 +0,0 @@ -import{aW as i}from"./index-CEWggaxV.js";import{a as p}from"./queryTopFeatures-CtNPRLBc.js";import{S as a}from"./TopFeaturesQuery-B8kC7n5h.js";import"./query-BM8R3sQ6.js";import"./pbfQueryUtils-CLRSFGBm.js";import"./pbf-D9QZb8S8.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./queryZScale-DN4aFXYn.js";async function y(o,t,r){const m=i(o);return(await p(m,a.from(t),{...r})).data.count}export{y as executeForTopCount}; diff --git a/assets/executeForTopExtents-BWFPmLVe.js b/assets/executeForTopExtents-BWFPmLVe.js deleted file mode 100644 index f757bd9..0000000 --- a/assets/executeForTopExtents-BWFPmLVe.js +++ /dev/null @@ -1 +0,0 @@ -import{aW as n,aE as e}from"./index-CEWggaxV.js";import{d as p}from"./queryTopFeatures-CtNPRLBc.js";import{S as s}from"./TopFeaturesQuery-B8kC7n5h.js";import"./query-BM8R3sQ6.js";import"./pbfQueryUtils-CLRSFGBm.js";import"./pbf-D9QZb8S8.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./queryZScale-DN4aFXYn.js";async function S(a,i,m){const r=n(a),o=await p(r,s.from(i),{...m}),t=o.data.extent;return!t||isNaN(t.xmin)||isNaN(t.ymin)||isNaN(t.xmax)||isNaN(t.ymax)?{count:o.data.count,extent:null}:{count:o.data.count,extent:e.fromJSON(t)}}export{S as executeForTopExtents}; diff --git a/assets/executeForTopExtents-C_oYktcC.js b/assets/executeForTopExtents-C_oYktcC.js new file mode 100644 index 0000000..52ca638 --- /dev/null +++ b/assets/executeForTopExtents-C_oYktcC.js @@ -0,0 +1 @@ +import{aW as n,aE as e}from"./index-BjUNJPVf.js";import{d as p}from"./queryTopFeatures-BZWuOU3o.js";import{S as s}from"./TopFeaturesQuery-CVQjqlfM.js";import"./query-Bk_ITqRK.js";import"./pbfQueryUtils-CSeFSIjv.js";import"./pbf-Du8sFEWo.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./queryZScale-Dwvn5BlQ.js";async function S(a,i,m){const r=n(a),o=await p(r,s.from(i),{...m}),t=o.data.extent;return!t||isNaN(t.xmin)||isNaN(t.ymin)||isNaN(t.xmax)||isNaN(t.ymax)?{count:o.data.count,extent:null}:{count:o.data.count,extent:e.fromJSON(t)}}export{S as executeForTopExtents}; diff --git a/assets/executeForTopIds-B6SIZ04E.js b/assets/executeForTopIds-B6SIZ04E.js new file mode 100644 index 0000000..d298d3f --- /dev/null +++ b/assets/executeForTopIds-B6SIZ04E.js @@ -0,0 +1 @@ +import{aW as i}from"./index-BjUNJPVf.js";import{m as p}from"./queryTopFeatures-BZWuOU3o.js";import{S as a}from"./TopFeaturesQuery-CVQjqlfM.js";import"./query-Bk_ITqRK.js";import"./pbfQueryUtils-CSeFSIjv.js";import"./pbf-Du8sFEWo.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./queryZScale-Dwvn5BlQ.js";async function b(o,r,t){const m=i(o);return(await p(m,a.from(r),{...t})).data.objectIds}export{b as executeForTopIds}; diff --git a/assets/executeForTopIds-CLsxKpmx.js b/assets/executeForTopIds-CLsxKpmx.js deleted file mode 100644 index b251a15..0000000 --- a/assets/executeForTopIds-CLsxKpmx.js +++ /dev/null @@ -1 +0,0 @@ -import{aW as i}from"./index-CEWggaxV.js";import{m as p}from"./queryTopFeatures-CtNPRLBc.js";import{S as a}from"./TopFeaturesQuery-B8kC7n5h.js";import"./query-BM8R3sQ6.js";import"./pbfQueryUtils-CLRSFGBm.js";import"./pbf-D9QZb8S8.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./queryZScale-DN4aFXYn.js";async function b(o,r,t){const m=i(o);return(await p(m,a.from(r),{...t})).data.objectIds}export{b as executeForTopIds}; diff --git a/assets/executeQueryJSON-COxi_Fac.js b/assets/executeQueryJSON-COxi_Fac.js new file mode 100644 index 0000000..1079b1f --- /dev/null +++ b/assets/executeQueryJSON-COxi_Fac.js @@ -0,0 +1 @@ +import{aW as i,aX as s}from"./index-BjUNJPVf.js";import{c as e}from"./query-Bk_ITqRK.js";import{d as m}from"./FeatureSet-opEn8ou8.js";async function y(a,r,o){const t=await p(a,r,o);return m.fromJSON(t)}async function p(a,r,o){const t=i(a),c={...o},n=s.from(r),{data:f}=await e(t,n,n.sourceSpatialReference,c);return f}export{p as a,y as s}; diff --git a/assets/executeQueryJSON-DngjHRnE.js b/assets/executeQueryJSON-DngjHRnE.js deleted file mode 100644 index 601386f..0000000 --- a/assets/executeQueryJSON-DngjHRnE.js +++ /dev/null @@ -1 +0,0 @@ -import{aW as i,aX as s}from"./index-CEWggaxV.js";import{c as e}from"./query-BM8R3sQ6.js";import{d as m}from"./FeatureSet-CYJUZgOk.js";async function y(a,r,o){const t=await p(a,r,o);return m.fromJSON(t)}async function p(a,r,o){const t=i(a),c={...o},n=s.from(r),{data:f}=await e(t,n,n.sourceSpatialReference,c);return f}export{p as a,y as s}; diff --git a/assets/executeQueryPBF-BYY2Ipuh.js b/assets/executeQueryPBF-DROgTCuZ.js similarity index 96% rename from assets/executeQueryPBF-BYY2Ipuh.js rename to assets/executeQueryPBF-DROgTCuZ.js index e97ac0d..094c240 100644 --- a/assets/executeQueryPBF-BYY2Ipuh.js +++ b/assets/executeQueryPBF-DROgTCuZ.js @@ -1 +1 @@ -import{bl as d,ah as c,aW as f,aX as _}from"./index-CEWggaxV.js";import{p,r as m}from"./featureConversionUtils-CmP9mw0r.js";import{f as y}from"./query-BM8R3sQ6.js";import"./FeatureSet-CYJUZgOk.js";function P(o,t){return t}function h(o,t,e,r){switch(e){case 0:return n(o,t+r,0);case 1:return o.originPosition==="lowerLeft"?n(o,t+r,1):G(o,t+r,1)}}function u(o,t,e,r){return e===2?n(o,t,2):h(o,t,e,r)}function C(o,t,e,r){return e===2?t===0?0:n(o,t,3):h(o,t,e,r)}function g(o,t,e,r){return e===3?t===0?0:n(o,t,3):u(o,t,e,r)}function n({translate:o,scale:t},e,r){return o[r]+e*t[r]}function G({translate:o,scale:t},e,r){return o[r]-e*t[r]}class v{constructor(t){this._options=t,this.geometryTypes=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=P,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._mValueOffset=null,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return{fields:[],features:[]}}finishFeatureResult(t){if(this._options.applyTransform&&(t.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!t.hasZ)return;const e=d(t.geometryType,this._options.sourceSpatialReference,t.spatialReference);if(e!=null)for(const r of t.features)e(r.geometry)}createSpatialReference(){return{}}addField(t,e){const r=t.fields;c(r),r.push(e);const s=r.map(i=>i.name);this._attributesConstructor=function(){for(const i of s)this[i]=null}}addFeature(t,e){t.features.push(e)}prepareFeatures(t){switch(this._transform=t.transform,this._options.applyTransform&&t.transform&&(this._applyTransform=this._deriveApplyTransform(t)),this._mValueOffset=null,this._vertexDimension=2,t.hasZ&&this._vertexDimension++,t.hasM&&(this._mValueOffset=this._vertexDimension,this._vertexDimension++),t.geometryType){case"esriGeometryPoint":this.addCoordinate=(e,r,s)=>this.addCoordinatePoint(e,r,s),this.createGeometry=e=>this.createPointGeometry(e);break;case"esriGeometryPolygon":this.addCoordinate=(e,r,s)=>this._addCoordinatePolygon(e,r,s),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"esriGeometryPolyline":this.addCoordinate=(e,r,s)=>this._addCoordinatePolyline(e,r,s),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"esriGeometryMultipoint":this.addCoordinate=(e,r,s)=>this._addCoordinateMultipoint(e,r,s),this.createGeometry=e=>this._createMultipointGeometry(e)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,{attributes:new this._attributesConstructor}}allocateCoordinates(){}addLength(t,e,r){this._lengths.length===0&&(this._toAddInCurrentPath=e),this._lengths.push(e)}addQueryGeometry(t,e){const{queryGeometry:r,queryGeometryType:s}=e,i=p(r.clone(),r,!1,!1,this._transform),a=m(i,s,!1,!1);t.queryGeometryType=s,t.queryGeometry={...a}}createPointGeometry(t){const e={x:0,y:0,spatialReference:t.spatialReference};return t.hasZ&&(e.z=0),t.hasM&&(e.m=0),e}addCoordinatePoint(t,e,r){const s=this._transform;switch(e=this._applyTransform(s,e,r,0),r){case 0:t.x=e;break;case 1:t.y=e;break;case 2:"z"in t?t.z=e:t.m=e;break;case 3:t.m=e}}_transformPathLikeValue(t,e){let r=0;e<=1&&(r=this._previousCoordinate[e],this._previousCoordinate[e]+=t);const s=this._transform;return this._mValueOffset===null||t!==0||e%this._mValueOffset?this._applyTransform(s,t,e,r):0}_addCoordinatePolyline(t,e,r){this._dehydratedAddPointsCoordinate(t.paths,e,r)}_addCoordinatePolygon(t,e,r){this._dehydratedAddPointsCoordinate(t.rings,e,r)}_addCoordinateMultipoint(t,e,r){r===0&&t.points.push([]);const s=this._transformPathLikeValue(e,r);t.points[t.points.length-1].push(s)}_createPolygonGeometry(t){return{rings:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createPolylineGeometry(t){return{paths:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createMultipointGeometry(t){return{points:[],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_dehydratedAddPointsCoordinate(t,e,r){r===0&&this._toAddInCurrentPath--==0&&(t.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const s=this._transformPathLikeValue(e,r),i=t[t.length-1];r===0&&(this._coordinateBufferPtr=0,this._coordinateBuffer=new Array(this._vertexDimension),i.push(this._coordinateBuffer)),this._coordinateBuffer[this._coordinateBufferPtr++]=s}_deriveApplyTransform(t){const{hasZ:e,hasM:r}=t;return e&&r?g:e?u:r?C:h}}async function x(o,t,e){const r=f(o),s={...e},i=_.from(t),a=!i.quantizationParameters,{data:l}=await y(r,i,new v({sourceSpatialReference:i.sourceSpatialReference,applyTransform:a}),s);return l}export{x as n}; +import{bl as d,ah as c,aW as f,aX as _}from"./index-BjUNJPVf.js";import{p,r as m}from"./featureConversionUtils-BHhm7bvm.js";import{f as y}from"./query-Bk_ITqRK.js";import"./FeatureSet-opEn8ou8.js";function P(o,t){return t}function h(o,t,e,r){switch(e){case 0:return n(o,t+r,0);case 1:return o.originPosition==="lowerLeft"?n(o,t+r,1):G(o,t+r,1)}}function u(o,t,e,r){return e===2?n(o,t,2):h(o,t,e,r)}function C(o,t,e,r){return e===2?t===0?0:n(o,t,3):h(o,t,e,r)}function g(o,t,e,r){return e===3?t===0?0:n(o,t,3):u(o,t,e,r)}function n({translate:o,scale:t},e,r){return o[r]+e*t[r]}function G({translate:o,scale:t},e,r){return o[r]-e*t[r]}class v{constructor(t){this._options=t,this.geometryTypes=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=P,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._mValueOffset=null,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return{fields:[],features:[]}}finishFeatureResult(t){if(this._options.applyTransform&&(t.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!t.hasZ)return;const e=d(t.geometryType,this._options.sourceSpatialReference,t.spatialReference);if(e!=null)for(const r of t.features)e(r.geometry)}createSpatialReference(){return{}}addField(t,e){const r=t.fields;c(r),r.push(e);const s=r.map(i=>i.name);this._attributesConstructor=function(){for(const i of s)this[i]=null}}addFeature(t,e){t.features.push(e)}prepareFeatures(t){switch(this._transform=t.transform,this._options.applyTransform&&t.transform&&(this._applyTransform=this._deriveApplyTransform(t)),this._mValueOffset=null,this._vertexDimension=2,t.hasZ&&this._vertexDimension++,t.hasM&&(this._mValueOffset=this._vertexDimension,this._vertexDimension++),t.geometryType){case"esriGeometryPoint":this.addCoordinate=(e,r,s)=>this.addCoordinatePoint(e,r,s),this.createGeometry=e=>this.createPointGeometry(e);break;case"esriGeometryPolygon":this.addCoordinate=(e,r,s)=>this._addCoordinatePolygon(e,r,s),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"esriGeometryPolyline":this.addCoordinate=(e,r,s)=>this._addCoordinatePolyline(e,r,s),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"esriGeometryMultipoint":this.addCoordinate=(e,r,s)=>this._addCoordinateMultipoint(e,r,s),this.createGeometry=e=>this._createMultipointGeometry(e)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,{attributes:new this._attributesConstructor}}allocateCoordinates(){}addLength(t,e,r){this._lengths.length===0&&(this._toAddInCurrentPath=e),this._lengths.push(e)}addQueryGeometry(t,e){const{queryGeometry:r,queryGeometryType:s}=e,i=p(r.clone(),r,!1,!1,this._transform),a=m(i,s,!1,!1);t.queryGeometryType=s,t.queryGeometry={...a}}createPointGeometry(t){const e={x:0,y:0,spatialReference:t.spatialReference};return t.hasZ&&(e.z=0),t.hasM&&(e.m=0),e}addCoordinatePoint(t,e,r){const s=this._transform;switch(e=this._applyTransform(s,e,r,0),r){case 0:t.x=e;break;case 1:t.y=e;break;case 2:"z"in t?t.z=e:t.m=e;break;case 3:t.m=e}}_transformPathLikeValue(t,e){let r=0;e<=1&&(r=this._previousCoordinate[e],this._previousCoordinate[e]+=t);const s=this._transform;return this._mValueOffset===null||t!==0||e%this._mValueOffset?this._applyTransform(s,t,e,r):0}_addCoordinatePolyline(t,e,r){this._dehydratedAddPointsCoordinate(t.paths,e,r)}_addCoordinatePolygon(t,e,r){this._dehydratedAddPointsCoordinate(t.rings,e,r)}_addCoordinateMultipoint(t,e,r){r===0&&t.points.push([]);const s=this._transformPathLikeValue(e,r);t.points[t.points.length-1].push(s)}_createPolygonGeometry(t){return{rings:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createPolylineGeometry(t){return{paths:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createMultipointGeometry(t){return{points:[],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_dehydratedAddPointsCoordinate(t,e,r){r===0&&this._toAddInCurrentPath--==0&&(t.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const s=this._transformPathLikeValue(e,r),i=t[t.length-1];r===0&&(this._coordinateBufferPtr=0,this._coordinateBuffer=new Array(this._vertexDimension),i.push(this._coordinateBuffer)),this._coordinateBuffer[this._coordinateBufferPtr++]=s}_deriveApplyTransform(t){const{hasZ:e,hasM:r}=t;return e&&r?g:e?u:r?C:h}}async function x(o,t,e){const r=f(o),s={...e},i=_.from(t),a=!i.quantizationParameters,{data:l}=await y(r,i,new v({sourceSpatialReference:i.sourceSpatialReference,applyTransform:a}),s);return l}export{x as n}; diff --git a/assets/executeRelationshipQuery-DbtTkmN8.js b/assets/executeRelationshipQuery-BRG4cb0K.js similarity index 82% rename from assets/executeRelationshipQuery-DbtTkmN8.js rename to assets/executeRelationshipQuery-BRG4cb0K.js index 304b8cd..731bdd5 100644 --- a/assets/executeRelationshipQuery-DbtTkmN8.js +++ b/assets/executeRelationshipQuery-BRG4cb0K.js @@ -1 +1 @@ -import{M as m,dP as p,aW as l}from"./index-CEWggaxV.js";import{t as j}from"./query-BM8R3sQ6.js";import{d as R}from"./FeatureSet-CYJUZgOk.js";import f from"./RelationshipQuery-DDK72Kwc.js";import"./pbfQueryUtils-CLRSFGBm.js";import"./pbf-D9QZb8S8.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./queryZScale-DN4aFXYn.js";function F(r,t){const e=r.toJSON();return e.objectIds&&(e.objectIds=e.objectIds.join(",")),e.orderByFields&&(e.orderByFields=e.orderByFields.join(",")),e.outFields&&!(t!=null&&t.returnCountOnly)?e.outFields.includes("*")?e.outFields="*":e.outFields=e.outFields.join(","):delete e.outFields,e.outSR&&(e.outSR=p(e.outSR)),e.dynamicDataSource&&(e.layer=JSON.stringify({source:e.dynamicDataSource}),delete e.dynamicDataSource),e}async function b(r,t,e){const n=await y(r,t,e),o=n.data,s=o.geometryType,a=o.spatialReference,d={};for(const c of o.relatedRecordGroups){const u={fields:void 0,objectIdFieldName:void 0,geometryType:s,spatialReference:a,hasZ:!!o.hasZ,hasM:!!o.hasM,features:c.relatedRecords};if(c.objectId!=null)d[c.objectId]=u;else for(const i of Object.keys(c))i!=="relatedRecords"&&(d[c[i]]=u)}return{...n,data:d}}async function h(r,t,e){const n=await y(r,t,e,{returnCountOnly:!0}),o=n.data,s={};for(const a of o.relatedRecordGroups)a.objectId!=null&&(s[a.objectId]=a.count);return{...n,data:s}}async function y(r,t,e={},n){const o=j({...r.query,f:"json",...n,...F(t,n)});return m(r.path+"/queryRelatedRecords",{...e,query:{...e.query,...o}})}async function D(r,t,e){t=f.from(t);const n=l(r);return b(n,t,e).then(o=>{const s=o.data,a={};return Object.keys(s).forEach(d=>a[d]=R.fromJSON(s[d])),a})}async function J(r,t,e){t=f.from(t);const n=l(r);return h(n,t,{...e}).then(o=>o.data)}export{D as executeRelationshipQuery,J as executeRelationshipQueryForCount}; +import{M as m,dP as p,aW as l}from"./index-BjUNJPVf.js";import{t as j}from"./query-Bk_ITqRK.js";import{d as R}from"./FeatureSet-opEn8ou8.js";import f from"./RelationshipQuery-BDJrOxaX.js";import"./pbfQueryUtils-CSeFSIjv.js";import"./pbf-Du8sFEWo.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./queryZScale-Dwvn5BlQ.js";function F(r,t){const e=r.toJSON();return e.objectIds&&(e.objectIds=e.objectIds.join(",")),e.orderByFields&&(e.orderByFields=e.orderByFields.join(",")),e.outFields&&!(t!=null&&t.returnCountOnly)?e.outFields.includes("*")?e.outFields="*":e.outFields=e.outFields.join(","):delete e.outFields,e.outSR&&(e.outSR=p(e.outSR)),e.dynamicDataSource&&(e.layer=JSON.stringify({source:e.dynamicDataSource}),delete e.dynamicDataSource),e}async function b(r,t,e){const n=await y(r,t,e),o=n.data,s=o.geometryType,a=o.spatialReference,d={};for(const c of o.relatedRecordGroups){const u={fields:void 0,objectIdFieldName:void 0,geometryType:s,spatialReference:a,hasZ:!!o.hasZ,hasM:!!o.hasM,features:c.relatedRecords};if(c.objectId!=null)d[c.objectId]=u;else for(const i of Object.keys(c))i!=="relatedRecords"&&(d[c[i]]=u)}return{...n,data:d}}async function h(r,t,e){const n=await y(r,t,e,{returnCountOnly:!0}),o=n.data,s={};for(const a of o.relatedRecordGroups)a.objectId!=null&&(s[a.objectId]=a.count);return{...n,data:s}}async function y(r,t,e={},n){const o=j({...r.query,f:"json",...n,...F(t,n)});return m(r.path+"/queryRelatedRecords",{...e,query:{...e.query,...o}})}async function D(r,t,e){t=f.from(t);const n=l(r);return b(n,t,e).then(o=>{const s=o.data,a={};return Object.keys(s).forEach(d=>a[d]=R.fromJSON(s[d])),a})}async function J(r,t,e){t=f.from(t);const n=l(r);return h(n,t,{...e}).then(o=>o.data)}export{D as executeRelationshipQuery,J as executeRelationshipQueryForCount}; diff --git a/assets/executeTopFeaturesQuery-9oGsFDn1.js b/assets/executeTopFeaturesQuery-9oGsFDn1.js deleted file mode 100644 index e6fdf66..0000000 --- a/assets/executeTopFeaturesQuery-9oGsFDn1.js +++ /dev/null @@ -1 +0,0 @@ -import{aW as f}from"./index-CEWggaxV.js";import{p as e}from"./queryTopFeatures-CtNPRLBc.js";import{d as s}from"./FeatureSet-CYJUZgOk.js";import{S as n}from"./TopFeaturesQuery-B8kC7n5h.js";import"./query-BM8R3sQ6.js";import"./pbfQueryUtils-CLRSFGBm.js";import"./pbf-D9QZb8S8.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./queryZScale-DN4aFXYn.js";async function O(r,o,t,m){const i=f(r),p={...m},{data:a}=await e(i,n.from(o),t,p);return s.fromJSON(a)}export{O as executeTopFeaturesQuery}; diff --git a/assets/executeTopFeaturesQuery-DpUwEjEz.js b/assets/executeTopFeaturesQuery-DpUwEjEz.js new file mode 100644 index 0000000..d6404fd --- /dev/null +++ b/assets/executeTopFeaturesQuery-DpUwEjEz.js @@ -0,0 +1 @@ +import{aW as f}from"./index-BjUNJPVf.js";import{p as e}from"./queryTopFeatures-BZWuOU3o.js";import{d as s}from"./FeatureSet-opEn8ou8.js";import{S as n}from"./TopFeaturesQuery-CVQjqlfM.js";import"./query-Bk_ITqRK.js";import"./pbfQueryUtils-CSeFSIjv.js";import"./pbf-Du8sFEWo.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./queryZScale-Dwvn5BlQ.js";async function O(r,o,t,m){const i=f(r),p={...m},{data:a}=await e(i,n.from(o),t,p);return s.fromJSON(a)}export{O as executeTopFeaturesQuery}; diff --git a/assets/featureConversionUtils-CmP9mw0r.js b/assets/featureConversionUtils-BHhm7bvm.js similarity index 99% rename from assets/featureConversionUtils-CmP9mw0r.js rename to assets/featureConversionUtils-BHhm7bvm.js index af3283e..f6bbfb7 100644 --- a/assets/featureConversionUtils-CmP9mw0r.js +++ b/assets/featureConversionUtils-BHhm7bvm.js @@ -1 +1 @@ -import{aa as or,ab as er,ac as tr,ad as sr,N as x,s as ur,ae as lr,af as cr,ag as ir,ah as ar}from"./index-CEWggaxV.js";import{e as T,t as P}from"./OptimizedGeometry-CQuTPb9g.js";import{e as fr}from"./OptimizedFeatureSet-Blu9Ckm7.js";function p(r,n){return r?n?4:3:n?3:2}const v=()=>ur.getLogger("esri.layers.graphics.featureConversionUtils"),D={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0,esriGeometryEnvelope:0},hr=(r,n,o,e,s,t)=>{r[o]=s,r[o+1]=t},C=(r,n,o,e,s,t)=>{r[o]=s,r[o+1]=t,r[o+2]=n[e+2]},dr=(r,n,o,e,s,t)=>{r[o]=s,r[o+1]=t,r[o+2]=n[e+3]},mr=(r,n,o,e,s,t)=>{r[o]=s,r[o+1]=t,r[o+2]=n[e+2],r[o+3]=n[e+3]};function U(r,n,o,e){if(r){if(o)return n&&e?mr:C;if(n&&e)return dr}else if(n&&e)return C;return hr}function z({scale:r,translate:n},o){return Math.round((o-n[0])/r[0])}function E({scale:r,translate:n},o){return Math.round((n[1]-o)/r[1])}function q({scale:r,translate:n},o,e){return o*r[e]+n[e]}function Ur(r,n,o){return r?n?o?V(r):R(r):o?S(r):j(r):null}function j(r){const n=r.coords;return{x:n[0],y:n[1]}}function H(r,n){return r.coords[0]=n.x,r.coords[1]=n.y,r}function R(r){const n=r.coords;return{x:n[0],y:n[1],z:n[2]}}function gr(r,n){return r.coords[0]=n.x,r.coords[1]=n.y,r.coords[2]=n.z,r}function S(r){const n=r.coords;return{x:n[0],y:n[1],m:n[2]}}function yr(r,n){return r.coords[0]=n.x,r.coords[1]=n.y,r.coords[2]=n.m,r}function V(r){const n=r.coords;return{x:n[0],y:n[1],z:n[2],m:n[3]}}function pr(r,n){return r.coords[0]=n.x,r.coords[1]=n.y,r.coords[2]=n.z,r.coords[3]=n.m,r}function br(r,n,o,e){let s=j;o&&e?s=V:o?s=R:e&&(s=S);for(const t of n){const{geometry:u,attributes:l}=t,i=u!=null?s(u):null;r.push({attributes:l,geometry:i})}return r}function Y(r,n){return r&&n?pr:r?gr:n?yr:H}function wr(r,n,o,e,s){const t=Y(o,e);for(const{geometry:u,attributes:l}of n){const i=u!=null?t(new T,u):null;r.push(new P(i,l,null,s?l[s]:void 0))}return r}function Ir(r,n,o=Y(n.z!=null,n.m!=null)){return o(r,n)}function Mr(r,n,o,e){for(const{geometry:s,attributes:t}of n)r.push({attributes:t,geometry:s!=null?J(s,o,e):null});return r}function J(r,n,o){if(r==null)return null;const e=p(n,o),s=[];for(let t=0;t=i&&(r.lengths.push(k),M=g)}return G(r.coords,M),r.coords.length?r:null}function Or(r,n,o,e,s,t,u=o,l=e){if(N(r),!(n!=null&&n.coords.length))return null;const i=D[s],{coords:c,lengths:a}=n,f=p(o,e),h=p(o&&u,e&&l),d=U(o,e,u,l);if(!a.length)return d(r.coords,c,0,0,c[0],c[1]),N(r,f,0),r;let m=0;const y=t*t;for(const w of a){if(w=i?r.lengths.push(M):G(r.coords,I*h),m+=w*f}return r.coords.length?r:null}function kr(r,n,o,e){const s=r[n],t=r[n+1],u=r[o],l=r[o+1],i=r[e],c=r[e+1];let a=u,f=l,h=i-a,d=c-f;if(h!==0||d!==0){const m=((s-a)*h+(t-f)*d)/(h*h+d*d);m>1?(a=i,f=c):m>0&&(a+=h*m,f+=d*m)}return h=s-a,d=t-f,h*h+d*d}function L(r,n,o,e,s,t,u){let l,i=e,c=0;for(let a=t+o;ai&&(c=a,i=l);i>e&&(c-t>o&&L(r,n,o,e,s,t,c),s(r,n,r.length,c,n[c],n[c+1]),u-c>o&&L(r,n,o,e,s,c,u))}function Br(r,n,o,e){var c;if(!((c=n==null?void 0:n.coords)!=null&&c.length))return null;const s=p(o,e);let t=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;if(n&&n.coords){const a=n.coords;for(let f=0;fur.getLogger("esri.layers.graphics.featureConversionUtils"),D={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0,esriGeometryEnvelope:0},hr=(r,n,o,e,s,t)=>{r[o]=s,r[o+1]=t},C=(r,n,o,e,s,t)=>{r[o]=s,r[o+1]=t,r[o+2]=n[e+2]},dr=(r,n,o,e,s,t)=>{r[o]=s,r[o+1]=t,r[o+2]=n[e+3]},mr=(r,n,o,e,s,t)=>{r[o]=s,r[o+1]=t,r[o+2]=n[e+2],r[o+3]=n[e+3]};function U(r,n,o,e){if(r){if(o)return n&&e?mr:C;if(n&&e)return dr}else if(n&&e)return C;return hr}function z({scale:r,translate:n},o){return Math.round((o-n[0])/r[0])}function E({scale:r,translate:n},o){return Math.round((n[1]-o)/r[1])}function q({scale:r,translate:n},o,e){return o*r[e]+n[e]}function Ur(r,n,o){return r?n?o?V(r):R(r):o?S(r):j(r):null}function j(r){const n=r.coords;return{x:n[0],y:n[1]}}function H(r,n){return r.coords[0]=n.x,r.coords[1]=n.y,r}function R(r){const n=r.coords;return{x:n[0],y:n[1],z:n[2]}}function gr(r,n){return r.coords[0]=n.x,r.coords[1]=n.y,r.coords[2]=n.z,r}function S(r){const n=r.coords;return{x:n[0],y:n[1],m:n[2]}}function yr(r,n){return r.coords[0]=n.x,r.coords[1]=n.y,r.coords[2]=n.m,r}function V(r){const n=r.coords;return{x:n[0],y:n[1],z:n[2],m:n[3]}}function pr(r,n){return r.coords[0]=n.x,r.coords[1]=n.y,r.coords[2]=n.z,r.coords[3]=n.m,r}function br(r,n,o,e){let s=j;o&&e?s=V:o?s=R:e&&(s=S);for(const t of n){const{geometry:u,attributes:l}=t,i=u!=null?s(u):null;r.push({attributes:l,geometry:i})}return r}function Y(r,n){return r&&n?pr:r?gr:n?yr:H}function wr(r,n,o,e,s){const t=Y(o,e);for(const{geometry:u,attributes:l}of n){const i=u!=null?t(new T,u):null;r.push(new P(i,l,null,s?l[s]:void 0))}return r}function Ir(r,n,o=Y(n.z!=null,n.m!=null)){return o(r,n)}function Mr(r,n,o,e){for(const{geometry:s,attributes:t}of n)r.push({attributes:t,geometry:s!=null?J(s,o,e):null});return r}function J(r,n,o){if(r==null)return null;const e=p(n,o),s=[];for(let t=0;t=i&&(r.lengths.push(k),M=g)}return G(r.coords,M),r.coords.length?r:null}function Or(r,n,o,e,s,t,u=o,l=e){if(N(r),!(n!=null&&n.coords.length))return null;const i=D[s],{coords:c,lengths:a}=n,f=p(o,e),h=p(o&&u,e&&l),d=U(o,e,u,l);if(!a.length)return d(r.coords,c,0,0,c[0],c[1]),N(r,f,0),r;let m=0;const y=t*t;for(const w of a){if(w=i?r.lengths.push(M):G(r.coords,I*h),m+=w*f}return r.coords.length?r:null}function kr(r,n,o,e){const s=r[n],t=r[n+1],u=r[o],l=r[o+1],i=r[e],c=r[e+1];let a=u,f=l,h=i-a,d=c-f;if(h!==0||d!==0){const m=((s-a)*h+(t-f)*d)/(h*h+d*d);m>1?(a=i,f=c):m>0&&(a+=h*m,f+=d*m)}return h=s-a,d=t-f,h*h+d*d}function L(r,n,o,e,s,t,u){let l,i=e,c=0;for(let a=t+o;ai&&(c=a,i=l);i>e&&(c-t>o&&L(r,n,o,e,s,t,c),s(r,n,r.length,c,n[c],n[c+1]),u-c>o&&L(r,n,o,e,s,c,u))}function Br(r,n,o,e){var c;if(!((c=n==null?void 0:n.coords)!=null&&c.length))return null;const s=p(o,e);let t=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;if(n&&n.coords){const a=n.coords;for(let f=0;fn.layer.layerId)),r}function ae(e){return!!(e&&Array.isArray(e.layers)&&Array.isArray(e.tables))}function re(e){e.layers||(e.layers=[]),e.tables||(e.tables=[])}function te(e,a){const r=[],t=[];for(const{layer:o}of a){const{isTable:s,layerId:n}=o;s?t.push(n):r.push(n)}A(e.layers,r),A(e.tables,t)}function A(e,a){if(e.length<2)return;const r=[];for(const{id:t}of e)r.push(t);_(r.sort(L),a.slice().sort(L))&&e.sort((t,o)=>{const s=a.indexOf(t.id),n=a.indexOf(o.id);return sn?1:0})}function L(e,a){return ea?1:0}async function ne(e,a,r){const{url:t,customParameters:o,apiKey:s}=a,{serviceJSON:n,layersJSON:l}=await Q(t,{customParameters:o,apiKey:s}),i=P(e.layers,n.layers,r),c=P(e.tables,n.tables,r);e.layers=i.itemResources,e.tables=c.itemResources;const m=[...i.added,...c.added],Y=l?[...l.layers,...l.tables]:[];await se(e,m,t,Y)}function P(e,a,r){const t=k(e,a,(s,n)=>s.id===n.id);e=e.filter(s=>!t.removed.some(n=>n.id===s.id));const o=t.added;return o.forEach(({id:s})=>{e.push({id:s})}),{itemResources:e,added:o.filter(({id:s})=>!r.includes(s))}}async function se(e,a,r,t){const o=await oe(a),s=a.map(({id:n,type:l})=>new(o.get(l))({url:r,layerId:n,sourceJSON:t.find(({id:i})=>i===n)}));await Promise.allSettled(s.map(n=>n.load())),s.forEach(n=>{const{layerId:l,loaded:i,defaultPopupTemplate:c}=n;if(!i||c==null)return;const m={id:l,popupInfo:c.toJSON()};n.operationalLayerType!=="ArcGISFeatureLayer"&&(m.layerType=n.operationalLayerType),U(n,m,e)})}async function oe(e){const a=[];e.forEach(({type:o})=>{const s=le(o),n=W[s];a.push(n())});const r=await Promise.all(a),t=new Map;return e.forEach(({type:o},s)=>{t.set(o,r[s])}),t}function le(e){let a;switch(e){case"Feature Layer":case"Table":a="FeatureLayer";break;case"Oriented Imagery Layer":a="OrientedImageryLayer";break;case"Catalog Layer":a="CatalogLayer"}return a}function U(e,a,r){e.isTable?S(r.tables,a):S(r.layers,a)}function S(e,a){const r=e.findIndex(({id:t})=>t===a.id);r===-1?e.push(a):e[r]=a}function j(e,a){if(!e.length)throw new y(`${a}:missing-parameters`,"'layers' array should contain at least one feature layer")}function ie(e,a){const r=e.map(t=>t.portalItem.id);if(new Set(r).size>1)throw new y(`${a}:invalid-parameters`,"All layers in the 'layers' array should be loaded from the same portal item")}function K(e,a){const r=e.map(t=>t.layerId);if(new Set(r).size!==r.length)throw new y(`${a}:invalid-parameters`,"'layers' array should contain only one instance each of layer or table in a feature service")}async function ce(e){j(e,f),await Promise.all(e.map(a=>a.load()));for(const a of e)F(a,f,v),H({layer:a,itemType:h,errorNamePrefix:f});ie(e,f),K(e,f)}async function ue(e,a){const{url:r,layerId:t,title:o,fullExtent:s,isTable:n}=e,l=d(r);a.url=(l==null?void 0:l.serverType)==="FeatureServer"?r:`${r}/${t}`,a.title||(a.title=o),a.extent=null,n||s==null||(a.extent=await E(s)),b(a,u.METADATA),b(a,u.MULTI_LAYER),I(a,u.SINGLE_LAYER),n&&I(a,u.TABLE)}function ye(e,a){for(const s of e){const n=s.parsedUrl.path,l=d(n);if(!(l==null?void 0:l.url.path))throw new y(`${a}:invalid-parameters`,T(s,`has unsupported url pattern: ${n}`),{layer:s});const c=l==null?void 0:l.serverType;if(c!=="FeatureServer"&&c!=="MapServer")throw new y(`${a}:invalid-parameters`,T(s,`has unsupported server type: ${c}`),{layer:s});if(c==="MapServer"&&e.length>1)throw new y(`${a}:invalid-parameters`,"Only one layer or table in a map service can be saved")}const r=d(e[0].parsedUrl.path),t=r==null?void 0:r.url.path;if(!e.every(s=>{const n=d(s.parsedUrl.path);return(n==null?void 0:n.url.path)===t}))throw new y(`${a}:invalid-parameters`,"'layers' array should only contain layers or tables that belong to the same feature service")}async function fe(e){j(e,p),await Promise.all(e.map(a=>a.load()));for(const a of e)F(a,p,v);ye(e,p),K(e,p)}async function pe(e,a){let r=0,t=0;for(const{isTable:n}of a)n?t++:r++;const o=a[0].parsedUrl.path,s=d(o);if(e.url=(s==null?void 0:s.serverType)==="FeatureServer"?s.url.path:o,e.title||(e.title=s.title),e.extent=null,r>0){const n=a.map(l=>l.fullExtent).filter(G).reduce((l,i)=>l.clone().union(i));n&&(e.extent=await E(n))}b(e,u.METADATA),$(e,u.MULTI_LAYER,a.length>1),$(e,u.SINGLE_LAYER,a.length===1),$(e,u.TABLE,t>0&&r===0),O(e)}async function Te(e,a){return z({layer:e,itemType:h,validateLayer:v,createItemData:(r,t)=>R(t,[r]),errorNamePrefix:X},a)}async function Ae(e,a){await ce(e);const r=e[0].portalItem,t=g(r),o=await Promise.all(e.map(n=>x(n,t,a))),s=await R(r,e.map((n,l)=>({layer:n,layerJSON:o[l]})));return O(r),await r.update({data:s}),await Promise.all(e.slice(1).map(n=>n.portalItem.reload())),N(t),r.clone()}async function Le(e,a,r){return B({layer:e,itemType:h,validateLayer:v,createItemData:(t,o)=>Promise.resolve(M(t)),errorNamePrefix:Z,newItem:a,setItemProperties:ue},r)}async function Pe(e,a,r){await fe(e);const t=C({itemType:h,errorNamePrefix:p,newItem:a}),o=g(t),s=await Promise.all(e.map(l=>x(l,o,r))),n=await D(e.map((l,i)=>({layer:l,layerJSON:s[i]})));await pe(t,e),await V(t,n,r);for(const l of e)l.portalItem=t.clone();return N(o),t}export{Te as save,Ae as saveAll,Pe as saveAllAs,Le as saveAs}; +import{de as _,eh as k,av as d,q as G,ei as E,ej as b,ek as $,el as u,em as q,N as y,en as I}from"./index-BjUNJPVf.js";import{i as N}from"./originUtils-D69mHv66.js";import{$ as z,w as g,I as x,v as O,j as B,y as C,P as V,l as F,d as H,c as T}from"./utils-iOpWi7jV.js";import{t as Q}from"./fetchService-Crgml5qT.js";import{a as W}from"./lazyLayerLoader-Cu0XtDD2.js";import"./multiOriginJSONSupportUtils-C0wm8_Yw.js";import"./saveAPIKeyUtils-YRBbgdzi.js";import"./saveUtils-CGGzyvzv.js";const h="Feature Service",w="feature-layer-utils",X=`${w}-save`,Z=`${w}-save-as`,f=`${w}-saveall`,p=`${w}-saveall-as`;function v(e){return{isValid:q(e)&&(e.type!=="feature"||!e.dynamicDataSource),errorMessage:"Feature layer should be a layer or table in a map or feature service"}}function J(e){const a=[],r=[];for(const{layer:t,layerJSON:o}of e)t.isTable?r.push(o):a.push(o);return{layers:a,tables:r}}function M(e){return J([e])}async function R(e,a){return/\/\d+\/?$/.test(e.url)?M(a[0]):D(a,e)}async function D(e,a){if(e.reverse(),!a)return J(e);const r=await ee(a,e);for(const t of e)U(t.layer,t.layerJSON,r);return te(r,e),r}async function ee(e,a){let r=await e.fetchData("json");if(ae(r))return r;r||(r={}),re(r);const{layer:{url:t,customParameters:o,apiKey:s}}=a[0];return await ne(r,{url:t??"",customParameters:o,apiKey:s},a.map(n=>n.layer.layerId)),r}function ae(e){return!!(e&&Array.isArray(e.layers)&&Array.isArray(e.tables))}function re(e){e.layers||(e.layers=[]),e.tables||(e.tables=[])}function te(e,a){const r=[],t=[];for(const{layer:o}of a){const{isTable:s,layerId:n}=o;s?t.push(n):r.push(n)}A(e.layers,r),A(e.tables,t)}function A(e,a){if(e.length<2)return;const r=[];for(const{id:t}of e)r.push(t);_(r.sort(L),a.slice().sort(L))&&e.sort((t,o)=>{const s=a.indexOf(t.id),n=a.indexOf(o.id);return sn?1:0})}function L(e,a){return ea?1:0}async function ne(e,a,r){const{url:t,customParameters:o,apiKey:s}=a,{serviceJSON:n,layersJSON:l}=await Q(t,{customParameters:o,apiKey:s}),i=P(e.layers,n.layers,r),c=P(e.tables,n.tables,r);e.layers=i.itemResources,e.tables=c.itemResources;const m=[...i.added,...c.added],Y=l?[...l.layers,...l.tables]:[];await se(e,m,t,Y)}function P(e,a,r){const t=k(e,a,(s,n)=>s.id===n.id);e=e.filter(s=>!t.removed.some(n=>n.id===s.id));const o=t.added;return o.forEach(({id:s})=>{e.push({id:s})}),{itemResources:e,added:o.filter(({id:s})=>!r.includes(s))}}async function se(e,a,r,t){const o=await oe(a),s=a.map(({id:n,type:l})=>new(o.get(l))({url:r,layerId:n,sourceJSON:t.find(({id:i})=>i===n)}));await Promise.allSettled(s.map(n=>n.load())),s.forEach(n=>{const{layerId:l,loaded:i,defaultPopupTemplate:c}=n;if(!i||c==null)return;const m={id:l,popupInfo:c.toJSON()};n.operationalLayerType!=="ArcGISFeatureLayer"&&(m.layerType=n.operationalLayerType),U(n,m,e)})}async function oe(e){const a=[];e.forEach(({type:o})=>{const s=le(o),n=W[s];a.push(n())});const r=await Promise.all(a),t=new Map;return e.forEach(({type:o},s)=>{t.set(o,r[s])}),t}function le(e){let a;switch(e){case"Feature Layer":case"Table":a="FeatureLayer";break;case"Oriented Imagery Layer":a="OrientedImageryLayer";break;case"Catalog Layer":a="CatalogLayer"}return a}function U(e,a,r){e.isTable?S(r.tables,a):S(r.layers,a)}function S(e,a){const r=e.findIndex(({id:t})=>t===a.id);r===-1?e.push(a):e[r]=a}function j(e,a){if(!e.length)throw new y(`${a}:missing-parameters`,"'layers' array should contain at least one feature layer")}function ie(e,a){const r=e.map(t=>t.portalItem.id);if(new Set(r).size>1)throw new y(`${a}:invalid-parameters`,"All layers in the 'layers' array should be loaded from the same portal item")}function K(e,a){const r=e.map(t=>t.layerId);if(new Set(r).size!==r.length)throw new y(`${a}:invalid-parameters`,"'layers' array should contain only one instance each of layer or table in a feature service")}async function ce(e){j(e,f),await Promise.all(e.map(a=>a.load()));for(const a of e)F(a,f,v),H({layer:a,itemType:h,errorNamePrefix:f});ie(e,f),K(e,f)}async function ue(e,a){const{url:r,layerId:t,title:o,fullExtent:s,isTable:n}=e,l=d(r);a.url=(l==null?void 0:l.serverType)==="FeatureServer"?r:`${r}/${t}`,a.title||(a.title=o),a.extent=null,n||s==null||(a.extent=await E(s)),b(a,u.METADATA),b(a,u.MULTI_LAYER),I(a,u.SINGLE_LAYER),n&&I(a,u.TABLE)}function ye(e,a){for(const s of e){const n=s.parsedUrl.path,l=d(n);if(!(l==null?void 0:l.url.path))throw new y(`${a}:invalid-parameters`,T(s,`has unsupported url pattern: ${n}`),{layer:s});const c=l==null?void 0:l.serverType;if(c!=="FeatureServer"&&c!=="MapServer")throw new y(`${a}:invalid-parameters`,T(s,`has unsupported server type: ${c}`),{layer:s});if(c==="MapServer"&&e.length>1)throw new y(`${a}:invalid-parameters`,"Only one layer or table in a map service can be saved")}const r=d(e[0].parsedUrl.path),t=r==null?void 0:r.url.path;if(!e.every(s=>{const n=d(s.parsedUrl.path);return(n==null?void 0:n.url.path)===t}))throw new y(`${a}:invalid-parameters`,"'layers' array should only contain layers or tables that belong to the same feature service")}async function fe(e){j(e,p),await Promise.all(e.map(a=>a.load()));for(const a of e)F(a,p,v);ye(e,p),K(e,p)}async function pe(e,a){let r=0,t=0;for(const{isTable:n}of a)n?t++:r++;const o=a[0].parsedUrl.path,s=d(o);if(e.url=(s==null?void 0:s.serverType)==="FeatureServer"?s.url.path:o,e.title||(e.title=s.title),e.extent=null,r>0){const n=a.map(l=>l.fullExtent).filter(G).reduce((l,i)=>l.clone().union(i));n&&(e.extent=await E(n))}b(e,u.METADATA),$(e,u.MULTI_LAYER,a.length>1),$(e,u.SINGLE_LAYER,a.length===1),$(e,u.TABLE,t>0&&r===0),O(e)}async function Te(e,a){return z({layer:e,itemType:h,validateLayer:v,createItemData:(r,t)=>R(t,[r]),errorNamePrefix:X},a)}async function Ae(e,a){await ce(e);const r=e[0].portalItem,t=g(r),o=await Promise.all(e.map(n=>x(n,t,a))),s=await R(r,e.map((n,l)=>({layer:n,layerJSON:o[l]})));return O(r),await r.update({data:s}),await Promise.all(e.slice(1).map(n=>n.portalItem.reload())),N(t),r.clone()}async function Le(e,a,r){return B({layer:e,itemType:h,validateLayer:v,createItemData:(t,o)=>Promise.resolve(M(t)),errorNamePrefix:Z,newItem:a,setItemProperties:ue},r)}async function Pe(e,a,r){await fe(e);const t=C({itemType:h,errorNamePrefix:p,newItem:a}),o=g(t),s=await Promise.all(e.map(l=>x(l,o,r))),n=await D(e.map((l,i)=>({layer:l,layerJSON:s[i]})));await pe(t,e),await V(t,n,r);for(const l of e)l.portalItem=t.clone();return N(o),t}export{Te as save,Ae as saveAll,Pe as saveAllAs,Le as saveAs}; diff --git a/assets/featureLayerUtils-BhDaw8pS.js b/assets/featureLayerUtils-lwqyOSrl.js similarity index 93% rename from assets/featureLayerUtils-BhDaw8pS.js rename to assets/featureLayerUtils-lwqyOSrl.js index 54746e3..b1942d1 100644 --- a/assets/featureLayerUtils-BhDaw8pS.js +++ b/assets/featureLayerUtils-lwqyOSrl.js @@ -1,7 +1,7 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/editingSupport-DWTRjmy9.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css","assets/EditBusLayer-SG7oYwiY.js","assets/infoFor3D-DsOdlPuA.js"] + __vite__mapDeps.viteFileDeps = ["assets/editingSupport-4MwIplWk.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css","assets/EditBusLayer-OslMX9fF.js","assets/infoFor3D-DsOdlPuA.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{aX as y,aY as O,eX as P,eY as j,N as i,_ as q,eZ as x,e_ as E,az as m,e$ as R}from"./index-CEWggaxV.js";import{m as C}from"./jsonUtils-BseLl1fZ.js";import{A as _}from"./UniqueValueRenderer-BlkUix3g.js";import{c as L}from"./AttachmentQuery-D61mmWw4.js";import F from"./RelationshipQuery-DDK72Kwc.js";async function M(e,t,n){t=t.clone(),e.capabilities.query.supportsMaxRecordCountFactor&&(t.maxRecordCountFactor=A(e));const r=T(e),a=e.capabilities.query.supportsPagination;t.start=0,t.num=r;let o=null;for(;;){const s=await e.source.queryFeaturesJSON(t,n);if(o==null?o=s:o.features=o.features.concat(s.features),o.exceededTransferLimit=s.exceededTransferLimit,!a||!s.exceededTransferLimit)break;t.start+=r}return o}function T(e){return A(e)*S(e)}function S(e){return e.capabilities.query.maxRecordCount||2e3}function A(e){return e.capabilities.query.supportsMaxRecordCountFactor?y.MAX_MAX_RECORD_COUNT_FACTOR:1}const U=new O({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"});async function J(e,t,n,r){const a=await f(e);if(await w(e,t,r),!a.addAttachment)throw new i(r,"Layer source does not support addAttachment capability");return a.addAttachment(t,n)}function w(e,t,n){var o,s;const{attributes:r}=t,{objectIdField:a}=e;return(s=(o=e.capabilities)==null?void 0:o.data)!=null&&s.supportsAttachment?t?r?a&&r[a]?Promise.resolve():Promise.reject(new i(n,`feature is missing the identifying attribute ${a}`)):Promise.reject(new i(n,"'attributes' are required on a feature to query attachments")):Promise.reject(new i(n,"A feature is required to add/delete/update attachments")):Promise.reject(new i(n,"this layer doesn't support attachments"))}async function Z(e,t,n,r,a){const o=await f(e);if(await w(e,t,a),!o.updateAttachment)throw new i(a,"Layer source does not support updateAttachment capability");return o.updateAttachment(t,n,r)}async function k(e,t,n){const{applyEdits:r}=await q(()=>import("./editingSupport-DWTRjmy9.js"),__vite__mapDeps([0,1,2,3,4])),a=await e.load(),{source:o,globalIdField:s}=a;let l=n;return a.type==="feature"&&a.infoFor3D&&t.deleteFeatures!=null&&s!=null&&(l={...l,globalIdToObjectId:await D(e,t.deleteFeatures,s)}),r(a,o,t,n)}async function X(e,t,n){const{uploadAssets:r}=await q(()=>import("./editingSupport-DWTRjmy9.js"),__vite__mapDeps([0,1,2,3,4])),a=await e.load();return r(a,a.source,t,n)}async function z(e,t,n,r){const a=await f(e);if(await w(e,t,r),!a.deleteAttachments)throw new i(r,"Layer source does not support deleteAttachments capability");return a.deleteAttachments(t,n)}async function H(e,t,n){const r=(await e.load({signal:t==null?void 0:t.signal})).source;if(!r.fetchRecomputedExtents)throw new i(n,"Layer source does not support fetchUpdates capability");return r.fetchRecomputedExtents(t)}async function Y(e,t,n,r){var g,I;t=L.from(t),await e.load();const a=e.source,o=e.capabilities;if(!((g=o==null?void 0:o.data)!=null&&g.supportsAttachment))throw new i(r,"this layer doesn't support attachments");const{attachmentTypes:s,objectIds:l,globalIds:p,num:u,size:c,start:d,where:b}=t;if(!((I=o==null?void 0:o.operations)!=null&&I.supportsQueryAttachments)&&((s==null?void 0:s.length)>0||(p==null?void 0:p.length)>0||(c==null?void 0:c.length)>0||u||d||b))throw new i(r,"when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",t);if(!(l!=null&&l.length||p!=null&&p.length||b))throw new i(r,"'objectIds', 'globalIds', or 'where' are required to perform attachment query",t);if(!a.queryAttachments)throw new i(r,"Layer source does not support queryAttachments capability",t);return a.queryAttachments(t)}async function B(e,t,n,r){const a=await f(e);if(!a.queryObjectIds)throw new i(r,"Layer source does not support queryObjectIds capability");return a.queryObjectIds(y.from(t)??e.createQuery(),n)}async function K(e,t,n,r){const a=await f(e);if(!a.queryFeatureCount)throw new i(r,"Layer source does not support queryFeatureCount capability");return a.queryFeatureCount(y.from(t)??e.createQuery(),n)}async function W(e,t,n,r){const a=await f(e);if(!a.queryExtent)throw new i(r,"Layer source does not support queryExtent capability");return a.queryExtent(y.from(t)??e.createQuery(),n)}async function ee(e,t,n,r){const a=await f(e);if(!a.queryRelatedFeatures)throw new i(r,"Layer source does not support queryRelatedFeatures capability");return a.queryRelatedFeatures(F.from(t),n)}async function te(e,t,n,r){const a=await f(e);if(!a.queryRelatedFeaturesCount)throw new i(r,"Layer source does not support queryRelatedFeaturesCount capability");return a.queryRelatedFeaturesCount(F.from(t),n)}async function re(e){const t=e.source;if(t!=null&&t.refresh)try{const{dataChanged:n,updates:r}=await t.refresh();if(r!=null&&(e.sourceJSON={...e.sourceJSON,...r},e.read(r,{origin:"service",url:e.parsedUrl})),n)return!0}catch{}if(e.definitionExpression)try{return(await x(e.definitionExpression,e.fieldsIndex)).hasDateFunctions}catch{}return!1}function ne(e){var s,l;const t=new y,n=(s=e.capabilities)==null?void 0:s.data,r=(l=e.capabilities)==null?void 0:l.query;t.historicMoment=e.historicMoment,t.gdbVersion=e.gdbVersion,t.returnGeometry=!0,r&&(t.compactGeometryEnabled=r.supportsCompactGeometry,t.defaultSpatialReferenceEnabled=r.supportsDefaultSpatialReference),n&&(n.supportsZ&&e.returnZ!=null&&(t.returnZ=e.returnZ),n.supportsM&&e.returnM!=null&&(t.returnM=e.returnM)),t.outFields=["*"];const{timeOffset:a,timeExtent:o}=e;return t.timeExtent=a!=null&&o!=null?o.offset(-a.value,a.unit):o||null,t.multipatchOption=e.geometryType==="multipatch"?"xyFootprint":null,t}function ae(e){const{globalIdField:t,fields:n}=e;if(t)return t;if(n){for(const r of n)if(r.type==="esriFieldTypeGlobalID")return r.name}}function oe(e){const{objectIdField:t,fields:n}=e;if(t)return t;if(n){for(const r of n)if(r.type==="esriFieldTypeOID")return r.name}}function se(e){return e.currentVersion?e.currentVersion:e.hasOwnProperty("capabilities")||e.hasOwnProperty("drawingInfo")||e.hasOwnProperty("hasAttachments")||e.hasOwnProperty("htmlPopupType")||e.hasOwnProperty("relationships")||e.hasOwnProperty("timeInfo")||e.hasOwnProperty("typeIdField")||e.hasOwnProperty("types")?10:9.3}async function f(e){return(await e.load()).source}async function v(e,t){if(!m||m.findCredential(e))return;let n;try{const r=await R(e,t);r&&(n=await m.checkSignInStatus(`${r}/sharing`))}catch{}if(n)try{const r=t!=null?t.signal:null;await m.getCredential(e,{signal:r})}catch{}}async function ie(e,t,n){var a;const r=(a=e.parsedUrl)==null?void 0:a.path;r&&e.authenticationTriggerEvent===t&&await v(r,n)}function ue(e){var t;return!((t=e.sourceJSON)!=null&&t.isMultiServicesView)&&(e.userHasUpdateItemPrivileges||e.editingEnabled)}const h=P({types:j});function ce(e,t){var n;if(e.defaultSymbol)return(n=e.types)!=null&&n.length?new _({defaultSymbol:h(e.defaultSymbol,e,t),field:e.typeIdField,uniqueValueInfos:e.types.map(r=>({id:r.id,symbol:h(r.symbol,r,t)}))}):new C({symbol:h(e.defaultSymbol,e,t)})}function le(e){var r,a,o;let t=(r=e.sourceJSON)==null?void 0:r.cacheMaxAge;if(!t)return!1;const n=(o=(a=e.editingInfo)==null?void 0:a.lastEditDate)==null?void 0:o.getTime();return n==null||(t*=1e3,Date.now()-n{let c=null;if("attributes"in u){const{attributes:d}=u;c={globalId:d[n],objectId:d[a]!=null&&d[a]!==-1?d[a]:null}}else c={globalId:u.globalId,objectId:u.objectId!=null&&u.objectId!==-1?u.objectId:null};c.globalId!=null&&(c.objectId!=null&&c.objectId!==-1||r.push(c.globalId))}),r.length===0)return null;const o=e.createQuery();o.where=r.map(u=>`${n}='${u}'`).join(" OR "),o.returnGeometry=!1,o.outFields=[a,n],o.cacheHint=!1;const s=await E(M(e,o));if(!s.ok)return null;const l=new Map,p=s.value.features;for(const u of p){const c=u.attributes[n],d=u.attributes[a];c!=null&&d!=null&&d!==-1&&l.set(c,d)}return l}export{K as A,se as C,ce as D,te as E,B as F,H as I,oe as M,W as O,ee as P,ie as Q,ae as R,re as S,ue as T,le as U,D as V,k as b,U as f,X as g,z as j,J as m,Y as q,Z as w,ne as x}; +import{aX as y,aY as O,eX as P,eY as j,N as i,_ as q,eZ as x,e_ as E,az as m,e$ as R}from"./index-BjUNJPVf.js";import{m as C}from"./jsonUtils-Dw332y6z.js";import{A as _}from"./UniqueValueRenderer-7V9Bhr-D.js";import{c as L}from"./AttachmentQuery-DmEAIZff.js";import F from"./RelationshipQuery-BDJrOxaX.js";async function M(e,t,n){t=t.clone(),e.capabilities.query.supportsMaxRecordCountFactor&&(t.maxRecordCountFactor=A(e));const r=T(e),a=e.capabilities.query.supportsPagination;t.start=0,t.num=r;let o=null;for(;;){const s=await e.source.queryFeaturesJSON(t,n);if(o==null?o=s:o.features=o.features.concat(s.features),o.exceededTransferLimit=s.exceededTransferLimit,!a||!s.exceededTransferLimit)break;t.start+=r}return o}function T(e){return A(e)*S(e)}function S(e){return e.capabilities.query.maxRecordCount||2e3}function A(e){return e.capabilities.query.supportsMaxRecordCountFactor?y.MAX_MAX_RECORD_COUNT_FACTOR:1}const U=new O({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"});async function J(e,t,n,r){const a=await f(e);if(await w(e,t,r),!a.addAttachment)throw new i(r,"Layer source does not support addAttachment capability");return a.addAttachment(t,n)}function w(e,t,n){var o,s;const{attributes:r}=t,{objectIdField:a}=e;return(s=(o=e.capabilities)==null?void 0:o.data)!=null&&s.supportsAttachment?t?r?a&&r[a]?Promise.resolve():Promise.reject(new i(n,`feature is missing the identifying attribute ${a}`)):Promise.reject(new i(n,"'attributes' are required on a feature to query attachments")):Promise.reject(new i(n,"A feature is required to add/delete/update attachments")):Promise.reject(new i(n,"this layer doesn't support attachments"))}async function Z(e,t,n,r,a){const o=await f(e);if(await w(e,t,a),!o.updateAttachment)throw new i(a,"Layer source does not support updateAttachment capability");return o.updateAttachment(t,n,r)}async function k(e,t,n){const{applyEdits:r}=await q(()=>import("./editingSupport-4MwIplWk.js"),__vite__mapDeps([0,1,2,3,4])),a=await e.load(),{source:o,globalIdField:s}=a;let l=n;return a.type==="feature"&&a.infoFor3D&&t.deleteFeatures!=null&&s!=null&&(l={...l,globalIdToObjectId:await D(e,t.deleteFeatures,s)}),r(a,o,t,n)}async function X(e,t,n){const{uploadAssets:r}=await q(()=>import("./editingSupport-4MwIplWk.js"),__vite__mapDeps([0,1,2,3,4])),a=await e.load();return r(a,a.source,t,n)}async function z(e,t,n,r){const a=await f(e);if(await w(e,t,r),!a.deleteAttachments)throw new i(r,"Layer source does not support deleteAttachments capability");return a.deleteAttachments(t,n)}async function H(e,t,n){const r=(await e.load({signal:t==null?void 0:t.signal})).source;if(!r.fetchRecomputedExtents)throw new i(n,"Layer source does not support fetchUpdates capability");return r.fetchRecomputedExtents(t)}async function Y(e,t,n,r){var g,I;t=L.from(t),await e.load();const a=e.source,o=e.capabilities;if(!((g=o==null?void 0:o.data)!=null&&g.supportsAttachment))throw new i(r,"this layer doesn't support attachments");const{attachmentTypes:s,objectIds:l,globalIds:p,num:u,size:c,start:d,where:b}=t;if(!((I=o==null?void 0:o.operations)!=null&&I.supportsQueryAttachments)&&((s==null?void 0:s.length)>0||(p==null?void 0:p.length)>0||(c==null?void 0:c.length)>0||u||d||b))throw new i(r,"when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",t);if(!(l!=null&&l.length||p!=null&&p.length||b))throw new i(r,"'objectIds', 'globalIds', or 'where' are required to perform attachment query",t);if(!a.queryAttachments)throw new i(r,"Layer source does not support queryAttachments capability",t);return a.queryAttachments(t)}async function B(e,t,n,r){const a=await f(e);if(!a.queryObjectIds)throw new i(r,"Layer source does not support queryObjectIds capability");return a.queryObjectIds(y.from(t)??e.createQuery(),n)}async function K(e,t,n,r){const a=await f(e);if(!a.queryFeatureCount)throw new i(r,"Layer source does not support queryFeatureCount capability");return a.queryFeatureCount(y.from(t)??e.createQuery(),n)}async function W(e,t,n,r){const a=await f(e);if(!a.queryExtent)throw new i(r,"Layer source does not support queryExtent capability");return a.queryExtent(y.from(t)??e.createQuery(),n)}async function ee(e,t,n,r){const a=await f(e);if(!a.queryRelatedFeatures)throw new i(r,"Layer source does not support queryRelatedFeatures capability");return a.queryRelatedFeatures(F.from(t),n)}async function te(e,t,n,r){const a=await f(e);if(!a.queryRelatedFeaturesCount)throw new i(r,"Layer source does not support queryRelatedFeaturesCount capability");return a.queryRelatedFeaturesCount(F.from(t),n)}async function re(e){const t=e.source;if(t!=null&&t.refresh)try{const{dataChanged:n,updates:r}=await t.refresh();if(r!=null&&(e.sourceJSON={...e.sourceJSON,...r},e.read(r,{origin:"service",url:e.parsedUrl})),n)return!0}catch{}if(e.definitionExpression)try{return(await x(e.definitionExpression,e.fieldsIndex)).hasDateFunctions}catch{}return!1}function ne(e){var s,l;const t=new y,n=(s=e.capabilities)==null?void 0:s.data,r=(l=e.capabilities)==null?void 0:l.query;t.historicMoment=e.historicMoment,t.gdbVersion=e.gdbVersion,t.returnGeometry=!0,r&&(t.compactGeometryEnabled=r.supportsCompactGeometry,t.defaultSpatialReferenceEnabled=r.supportsDefaultSpatialReference),n&&(n.supportsZ&&e.returnZ!=null&&(t.returnZ=e.returnZ),n.supportsM&&e.returnM!=null&&(t.returnM=e.returnM)),t.outFields=["*"];const{timeOffset:a,timeExtent:o}=e;return t.timeExtent=a!=null&&o!=null?o.offset(-a.value,a.unit):o||null,t.multipatchOption=e.geometryType==="multipatch"?"xyFootprint":null,t}function ae(e){const{globalIdField:t,fields:n}=e;if(t)return t;if(n){for(const r of n)if(r.type==="esriFieldTypeGlobalID")return r.name}}function oe(e){const{objectIdField:t,fields:n}=e;if(t)return t;if(n){for(const r of n)if(r.type==="esriFieldTypeOID")return r.name}}function se(e){return e.currentVersion?e.currentVersion:e.hasOwnProperty("capabilities")||e.hasOwnProperty("drawingInfo")||e.hasOwnProperty("hasAttachments")||e.hasOwnProperty("htmlPopupType")||e.hasOwnProperty("relationships")||e.hasOwnProperty("timeInfo")||e.hasOwnProperty("typeIdField")||e.hasOwnProperty("types")?10:9.3}async function f(e){return(await e.load()).source}async function v(e,t){if(!m||m.findCredential(e))return;let n;try{const r=await R(e,t);r&&(n=await m.checkSignInStatus(`${r}/sharing`))}catch{}if(n)try{const r=t!=null?t.signal:null;await m.getCredential(e,{signal:r})}catch{}}async function ie(e,t,n){var a;const r=(a=e.parsedUrl)==null?void 0:a.path;r&&e.authenticationTriggerEvent===t&&await v(r,n)}function ue(e){var t;return!((t=e.sourceJSON)!=null&&t.isMultiServicesView)&&(e.userHasUpdateItemPrivileges||e.editingEnabled)}const h=P({types:j});function ce(e,t){var n;if(e.defaultSymbol)return(n=e.types)!=null&&n.length?new _({defaultSymbol:h(e.defaultSymbol,e,t),field:e.typeIdField,uniqueValueInfos:e.types.map(r=>({id:r.id,symbol:h(r.symbol,r,t)}))}):new C({symbol:h(e.defaultSymbol,e,t)})}function le(e){var r,a,o;let t=(r=e.sourceJSON)==null?void 0:r.cacheMaxAge;if(!t)return!1;const n=(o=(a=e.editingInfo)==null?void 0:a.lastEditDate)==null?void 0:o.getTime();return n==null||(t*=1e3,Date.now()-n{let c=null;if("attributes"in u){const{attributes:d}=u;c={globalId:d[n],objectId:d[a]!=null&&d[a]!==-1?d[a]:null}}else c={globalId:u.globalId,objectId:u.objectId!=null&&u.objectId!==-1?u.objectId:null};c.globalId!=null&&(c.objectId!=null&&c.objectId!==-1||r.push(c.globalId))}),r.length===0)return null;const o=e.createQuery();o.where=r.map(u=>`${n}='${u}'`).join(" OR "),o.returnGeometry=!1,o.outFields=[a,n],o.cacheHint=!1;const s=await E(M(e,o));if(!s.ok)return null;const l=new Map,p=s.value.features;for(const u of p){const c=u.attributes[n],d=u.attributes[a];c!=null&&d!=null&&d!==-1&&l.set(c,d)}return l}export{K as A,se as C,ce as D,te as E,B as F,H as I,oe as M,W as O,ee as P,ie as Q,ae as R,re as S,ue as T,le as U,D as V,k as b,U as f,X as g,z as j,J as m,Y as q,Z as w,ne as x}; diff --git a/assets/featureSetUtils-CGqLzAT0.js b/assets/featureSetUtils-BD9u_wDK.js similarity index 98% rename from assets/featureSetUtils-CGqLzAT0.js rename to assets/featureSetUtils-BD9u_wDK.js index efe9678..e729eda 100644 --- a/assets/featureSetUtils-CGqLzAT0.js +++ b/assets/featureSetUtils-BD9u_wDK.js @@ -1,7 +1,7 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/meshFeatureSet-DmiifJYC.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css","assets/Mesh-9oOqPmbT.js","assets/georeference-DtjTZVKi.js","assets/mat3f64-q3fE-ZOt.js","assets/mat4f64-CSKppSlJ.js","assets/computeTranslationToOriginAndRotation-DOOKw0d1.js","assets/DoubleArray-DxyNBrRi.js","assets/quat-CoKEr4Zu.js","assets/quatf64-Bdb9ZJJK.js","assets/meshVertexSpaceUtils-BFWpJFSd.js","assets/MeshLocalVertexSpace-Cltwu1Kq.js","assets/vec3-CjYmIfaa.js","assets/BufferView-Ao_K-5Vg.js","assets/imageUtils-DNanu5Rn.js","assets/earcut-hRlx3adE.js","assets/Indices-Dv-cCjFT.js","assets/deduplicate-Bk22TunD.js","assets/plane-py4f_JCU.js","assets/triangle-CU37cZF1.js","assets/Util-BS8sJGjF.js","assets/ObjectStack-CF0cQvd2.js","assets/lineSegment-B9UF3nEF.js","assets/basicInterfaces-GbxEOYtk.js","assets/VertexAttribute-BlT9lbVY.js","assets/External-DC51KyR4.js","assets/infoFor3D-DsOdlPuA.js","assets/FeatureSet-CYJUZgOk.js"] + __vite__mapDeps.viteFileDeps = ["assets/meshFeatureSet-BCixIf_6.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css","assets/Mesh--rTzs1p1.js","assets/georeference-DqFdARS7.js","assets/mat3f64-q3fE-ZOt.js","assets/mat4f64-CSKppSlJ.js","assets/computeTranslationToOriginAndRotation-BeE3rOSz.js","assets/DoubleArray--0pYeNcV.js","assets/quat-C0wQB0HB.js","assets/quatf64-Bdb9ZJJK.js","assets/meshVertexSpaceUtils-DwMoblqo.js","assets/MeshLocalVertexSpace-DRvwbFTJ.js","assets/vec3-DdRUbala.js","assets/BufferView-3om6S_aJ.js","assets/imageUtils-ChIDAvDr.js","assets/earcut-CWKXDqDj.js","assets/Indices-BRm9v2lM.js","assets/deduplicate-BR6i8Xk0.js","assets/plane-DxOTtTwj.js","assets/triangle-DmKBscqo.js","assets/Util-CS5u4Lec.js","assets/ObjectStack-BAIuPeIh.js","assets/lineSegment-BYtydnRZ.js","assets/basicInterfaces-GbxEOYtk.js","assets/VertexAttribute-BlT9lbVY.js","assets/External-DIoD7Bb4.js","assets/infoFor3D-DsOdlPuA.js","assets/FeatureSet-opEn8ou8.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{aS as ae,eu as Ue,ah as Be,j as G,a_ as M,E as Me,fy as We,_ as $e,aX as N,aQ as Ve,N as Qe,jt as fe,dP as Ze,M as B,b0 as ze,az as pe,et as Je,aw as Ke}from"./index-CEWggaxV.js";import{aw as re,ax as I,K as Xe,an as x,ao as _e,ap as ye,aq as ge,ar as me,as as we,aD as $,aE as ne,aF as Ye,aG as Y,N as He,aH as et,aI as V,aJ as tt}from"./arcadeUtils-BoaybaAR.js";import{x as R,s as D,a as T,n as L,t as A,r as it}from"./WhereClause-Dzgyc0wk.js";import{x as E,t as _,g as j,m as Q,a as k,y as st,L as at,w as X,E as Fe,T as Se,S as be,F as rt,v as ve,p as nt,D as Z,I as lt,d as U,b as ot,f as ut,c as m}from"./SpatialFilter-C4Il3spK.js";import{c as dt,a as ht,n as ct}from"./TimeOnly-Cm47ew5I.js";import{x as xe,n as Ne}from"./MD5-C9MwAd2G.js";import{Z as ft}from"./FieldsIndex-CLgRNeJ_.js";import v from"./FeatureLayer-D0kMrROG.js";import Le from"./SubtypeGroupLayer-DOR5l1_M.js";import{u as Ie,i as Ce}from"./infoFor3D-DsOdlPuA.js";import{a as pt,s as De}from"./executeQueryJSON-DngjHRnE.js";import{n as _t}from"./executeQueryPBF-BYY2Ipuh.js";import{d as yt}from"./FeatureSet-CYJUZgOk.js";import"./AttachmentInfo-DEdzaB9S.js";import"./AttachmentQuery-D61mmWw4.js";import{n as gt,s as mt}from"./executeForIds-BjeEaIen.js";import"./pbf-D9QZb8S8.js";import Te from"./RelationshipQuery-DDK72Kwc.js";import"./TopFeaturesQuery-B8kC7n5h.js";import{n as wt}from"./FeatureType-By3BEr9z.js";let Ae=class{constructor(){this.declaredRootClass="esri.arcade.featureSetCollection",this._layerById={},this._layerByName={}}add(e,t,i){this._layerById[t]=i,this._layerByName[e]=i}async featureSetByName(e,t=!0,i=["*"]){return this._layerByName[e]===void 0?null:this._layerByName[e]}async featureSetById(e,t=!0,i=["*"]){return this._layerById[e]===void 0?null:this._layerById[e]}castToText(e=!1){return"object, FeatureSetCollection"}},Oe=class H extends E{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.actions.AttributeFilter",this._maxProcessing=1e3,this._parent=e.parentfeatureset,e.whereclause instanceof R?(this._whereclause=e.whereclause,this._whereClauseFunction=null):(this._whereClauseFunction=e.whereclause,this._whereclause=null)}_initialiseFeatureSet(){this._parent!==null?(this.fields=this._parent.fields.slice(0),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types,this.subtypeField=this._parent.subtypeField,this.subtypes=this._parent.subtypes):(this.fields=[],this.typeIdField="",this.subtypeField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new ae({wkid:4326}),this.geometryType=re.point)}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._parent._getFilteredSet("",null,this._whereclause,null,e);return this._checkCancelled(e),this._whereClauseFunction!==null?this._wset=new _(t._candidates.slice(0).concat(t._known.slice(0)),[],t._ordered,this._clonePageDefinition(t.pagesDefinition)):this._wset=new _(t._candidates.slice(0),t._known.slice(0),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){var i;let t=(i=this._parent)==null?void 0:i._isInFeatureSet(e);return t===I.NotInFeatureSet?t:(t=this._idstates[e],t===void 0?I.Unknown:t)}_getFeature(e,t,i){return this._parent._getFeature(e,t,i)}_getFeatures(e,t,i,s){return this._parent._getFeatures(e,t,i,s)}_featureFromCache(e){return this._parent._featureFromCache(e)}executeWhereClause(e){var t;return((t=this._whereclause)==null?void 0:t.testFeature(e))??!1}async executeWhereClauseDeferred(e){if(this._whereClauseFunction!==null){const t=this._whereClauseFunction(e);return Ue(t),t}return this.executeWhereClause(e)}async _fetchAndRefineFeatures(e,t,i){var n,l,u;const s=new _([],e,!1,null),a=Math.min(t,e.length);if(await((n=this._parent)==null?void 0:n._getFeatures(s,-1,a,i)),this._checkCancelled(i),this._whereClauseFunction==null){for(let o=0;o":case"=":if(e.left.type==="column-reference"&&e.right.type==="string"){if(e.left.column.toUpperCase()===this.field.name.toUpperCase()&&this.lkp[e.right.value.toString()]!==void 0)return" ("+s+" "+e.operator+" "+this.lkp[e.right.value.toString()].toString()+") "}else if(e.right.type==="column-reference"&&e.left.type==="string"&&e.right.column.toUpperCase()===this.field.name.toUpperCase())return" ("+this.lkp[e.right.value.toString()].toString()+" "+e.operator+" "+s+") ";return" ("+this.evaluateNodeToWhereClause(e.left,t,i,F.BADNESS,a)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,F.BADNESS,a)+") ";case"<":case">":case">=":case"<=":case"*":case"-":case"+":case"/":case"||":return" ("+this.evaluateNodeToWhereClause(e.left,t,i,F.BADNESS,a)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,F.BADNESS,a)+") "}case"null":return"null";case"boolean":return e.value===!0?"1":"0";case"string":return"'"+e.value.toString().replaceAll("'","''")+"'";case"timestamp":return`timestamp '${e.value}'`;case"date":return`date '${e.value}'`;case"time":return`time '${e.value}'`;case"number":return e.value.toString();case"current-time":return at(e.mode==="date",t);case"column-reference":return i&&i.toLowerCase()===e.column.toLowerCase()?"("+s+")":e.column;case"data-type":return e.value;case"function":{const o=this.evaluateNodeToWhereClause(e.args,t,i,F.BADNESS,a);return st(e.name,o,t)}}throw new L(A.UnsupportedSyntax,{node:e.type})}extractValue(e){return this.codefield instanceof R?this.reverseLkp[R.convertValueToStorageFormat(this.codefield.calculateValueCompiled(e))]:this.reverseLkp[e.attributes[this.codefield]]}};St.BADNESS="_!!!_BAD_LKP_!!!!";class bt extends J{constructor(e,t){super(e),this._sql=t}rewriteSql(e,t){return{rewritten:!0,where:Q(e,this.field.name,k(this._sql,x.Standardised),t.getFieldsIndex())}}extractValue(e){return R.convertValueToStorageFormat(this._sql.calculateValueCompiled(e),this.field.type)}}class It extends E{static findField(e,t){for(const i of e)if(i.name.toLowerCase()===t.toString().toLowerCase())return i;return null}constructor(e){super(e),this._calcFunc=null,this.declaredClass="esri.arcade.featureset.actions.Adapted",this.adaptedFields=[],this._extraFilter=null,this._extraFilter=e.extraFilter,this._parent=e.parentfeatureset,this._maxProcessing=30,this.adaptedFields=e.adaptedFields}_initialiseFeatureSet(){this._parent!==null?(this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.spatialReference=new ae({wkid:4326}),this.objectIdField="",this.globalIdField="",this.geometryType=re.point,this.typeIdField="",this.types=null,this.subtypeField=null,this.subtypes=null),this.fields=[];for(const e of this.adaptedFields)e.postInitialization(this,this._parent),this.fields.push(e.field)}async _getSet(e){var t;if(this._wset===null){await this._ensureLoaded();let i=null;return i=this._extraFilter?await this._getFilteredSet("",null,null,null,e):await((t=this._parent)==null?void 0:t._getSet(e)),this._checkCancelled(e),Be(i),this._wset=new _(i._candidates.slice(0),i._known.slice(0),i._ordered,this._clonePageDefinition(i.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}async _getFeatures(e,t,i,s){var o,d;const a=[];t!==-1&&this._featureCache[t]===void 0&&a.push(t);const r=this._maxQueryRate();if(this._checkIfNeedToExpandKnownPage(e,r)===!0)return await this._expandPagedSet(e,r,0,0,s),this._getFeatures(e,t,i,s);let n=0;for(let c=e._lastFetchedIndex;c=r)));c++);if(a.length===0)return"success";e=new _([],a,e._ordered,null);const l=Math.min(a.length,i);await((o=this._parent)==null?void 0:o._getFeatures(e,-1,l,s)),this._checkCancelled(s);const u=[];for(let c=0;c0&&(s=s.replaceFields(d))}i!==null?this._extraFilter!==null&&(i=j(this._extraFilter,i)):i=this._extraFilter,await this._ensureLoaded();const u=await this._parent._getFilteredSet(e,t,i,s,a);let o;return this._checkCancelled(a),o=r===!0?new _(u._candidates.slice(0).concat(u._known.slice(0)),[],l===!0&&u._ordered,this._clonePageDefinition(u.pagesDefinition)):new _(u._candidates.slice(0),u._known.slice(0),l===!0&&u._ordered,this._clonePageDefinition(u.pagesDefinition)),o}_reformulateWithoutAdaptions(e){const t={cannot:!1,where:e};if(e!==null){for(const i of this.adaptedFields)if(ve(e,i.field.name)===!0){const s=i.rewriteSql(e,this);if(s.rewritten!==!0){t.cannot=!0,t.where=null;break}t.where=s.where}}return t}async _stat(e,t,i,s,a,r,n){let l=!1,u=this._reformulateWithoutAdaptions(t);if(l=u.cannot,t=u.where,u=this._reformulateWithoutAdaptions(a),l=l||u.cannot,(a=u.where)!==null?this._extraFilter!==null&&(a=j(this._extraFilter,a)):a=this._extraFilter,l===!0)return a===null&&i===""&&s===null?this._manualStat(e,t,r,n):{calculated:!1};const o=await this._parent._stat(e,t,i,s,a,r,n);return o.calculated===!1?a===null&&i===""&&s===null?this._manualStat(e,t,r,n):{calculated:!1}:o}async _canDoAggregates(e,t,i,s,a){if(this._parent===null)return!1;for(let l=0;l{for(let s=0;s0?(await $(this._refineSetBlock(e,this._maxProcessingRate(),s)),this._checkCancelled(s),this.getIdColumnDictionary(e,t,i,s)):t}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}_getFeatures(e,t,i,s){return this._parent._getFeatures(e,t,i,s)}_featureFromCache(e){if(this._featureCache[e]===void 0){const t=this._parent._featureFromCache(e);return t===void 0?void 0:t===null?null:(this._featureCache[e]=t,t)}return this._featureCache[e]}async _fetchAndRefineFeatures(){throw new D(T.NeverReach)}async _getFilteredSet(e,t,i,s,a){await this._ensureLoaded();const r=await this._parent._getFilteredSet(e,t,i,s===null?this._orderbyclause:s,a);this._checkCancelled(a);const n=new _(r._candidates.slice(0),r._known.slice(0),r._ordered,this._clonePageDefinition(r.pagesDefinition));let l=!0;if(r._candidates.length>0&&(l=!1),n._ordered===!1){let u=await this.manualOrderSet(n,a);return l===!1&&(t===null&&i===null||(u=new _(u._candidates.slice(0).concat(u._known.slice(0)),[],u._ordered,this._clonePageDefinition(u.pagesDefinition)))),u}return n}static registerAction(){E._featuresetFunctions.orderBy=function(e){return e===""?this:new Ee({parentfeatureset:this,orderbyclause:new W(e)})}}getFieldsIndex(){return this._parent.getFieldsIndex()}};function Ct(h){if(h.parseTree.type==="function"){if(h.parseTree.args.value.length===0)return{name:h.parseTree.name,expr:null};if(h.parseTree.args.value.length>1)throw new L(A.MissingStatisticParameters);const e=R.create(nt(h.parseTree.args.value[0],x.Standardised,h.parameters),h.fieldsIndex,h.timeZone);return{name:h.parseTree.name,expr:e}}return null}let ke=class ie{constructor(){this.field="",this.tofieldname="",this.typeofstat="MIN",this.workingexpr=null}clone(){const e=new ie;return e.field=this.field,e.tofieldname=this.tofieldname,e.typeofstat=this.typeofstat,e.workingexpr=this.workingexpr,e}static parseStatField(e,t,i,s){const a=new ie;a.field=e;const r=R.create(t,i,s),n=Ct(r);if(n===null)throw new L(A.UnsupportedSqlFunction,{function:""});const l=n.name.toUpperCase().trim();if(l==="MIN"){if(a.typeofstat="MIN",a.workingexpr=n.expr,r===null)throw new L(A.InvalidFunctionParameters,{function:"min"})}else if(l==="MAX"){if(a.typeofstat="MAX",a.workingexpr=n.expr,r===null)throw new L(A.InvalidFunctionParameters,{function:"max"})}else if(l==="COUNT")a.typeofstat="COUNT",a.workingexpr=n.expr;else if(l==="STDEV"){if(a.typeofstat="STDDEV",a.workingexpr=n.expr,r===null)throw new L(A.InvalidFunctionParameters,{function:"stdev"})}else if(l==="SUM"){if(a.typeofstat="SUM",a.workingexpr=n.expr,r===null)throw new L(A.InvalidFunctionParameters,{function:"sum"})}else if(l==="MEAN"){if(a.typeofstat="AVG",a.workingexpr=n.expr,r===null)throw new L(A.InvalidFunctionParameters,{function:l})}else if(l==="AVG"){if(a.typeofstat="AVG",a.workingexpr=n.expr,r===null)throw new L(A.InvalidFunctionParameters,{function:"avg"})}else{if(l!=="VAR")throw new L(A.UnsupportedSqlFunction,{function:l});if(a.typeofstat="VAR",a.workingexpr=n.expr,r===null)throw new L(A.InvalidFunctionParameters,{function:"var"})}return a}toStatisticsName(){switch(this.typeofstat.toUpperCase()){case"MIN":return"min";case"MAX":return"max";case"SUM":return"sum";case"COUNT":default:return"count";case"VAR":return"var";case"STDDEV":return"stddev";case"AVG":return"avg"}}};function Dt(h){if(!h)return"COUNT";switch(h.toLowerCase()){case"max":return"MAX";case"var":case"variance":return"VAR";case"avg":case"average":case"mean":return"AVG";case"min":return"MIN";case"sum":return"SUM";case"stdev":case"stddev":return"STDDEV";case"count":return"COUNT"}return"COUNT"}let Tt=class Pe extends E{constructor(e){super(e),this._decodedStatsfield=[],this._decodedGroupbyfield=[],this._candosimplegroupby=!0,this.phsyicalgroupbyfields=[],this.objectIdField="ROW__ID",this._internalObjectIdField="ROW__ID",this._adaptedFields=[],this.declaredClass="esri.arcade.featureset.actions.Aggregate",this._uniqueIds=1,this._maxQuery=10,this._maxProcessing=10,this._parent=e.parentfeatureset,this._config=e}isTable(){return!0}async _getSet(e){if(this._wset===null){const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,this._wset}return this._wset}_isInFeatureSet(){return I.InFeatureSet}_nextUniqueName(e){for(;e["T"+this._uniqueIds.toString()]===1;)this._uniqueIds++;const t="T"+this._uniqueIds.toString();return e[t]=1,t}_convertToEsriFieldType(e){return e}_initialiseFeatureSet(){const e={};let t=!1,i=1;const s=this._parent?this._parent.getFieldsIndex():new ft([]);for(this.objectIdField="ROW__ID",this.globalIdField="";t===!1;){let r=!1;for(let n=0;n0)for(const r of this._parent.fields)this._adaptedFields.push(new ee(r));for(let r=0;r0&&(l=new It({parentfeatureset:this._parent,adaptedFields:this._adaptedFields,extraFilter:null})),n.nowhereclause===!0)r=new _(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new te({parentfeatureset:l,orderbyclause:new W(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}});else{let u=l;if(i!==null){let o=null;i&&(o=this._reformulateWhereClauseWithoutGroupByFields(i)),u=new Oe({parentfeatureset:u,whereclause:o})}r=new _(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new te({parentfeatureset:u,orderbyclause:new W(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}})}return r}_reformulateWhereClauseWithoutStatsFields(e){for(const t of this._decodedStatsfield)e=Q(e,t.tofieldname,k(t.workingexpr,x.Standardised),this._parent.getFieldsIndex());return e}_reformulateWhereClauseWithoutGroupByFields(e){for(const t of this._decodedGroupbyfield)t.tofieldname!==t.name&&(e=Q(e,t.tofieldname,k(t.expression,x.Standardised),this._parent.getFieldsIndex()));return e}_reformulateOrderClauseWithoutGroupByFields(e){const t=[];for(const i of this._decodedGroupbyfield)i.tofieldname!==i.name&&t.push({field:i.tofieldname,newfield:i.name});return t.length>0?e.replaceFields(t):e}_clonePageDefinition(e){return e===null?null:e.aggregatefeaturesetpagedefinition===!0?{aggregatefeaturesetpagedefinition:!0,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,internal:e.internal}:this._parent._clonePageDefinition(e)}async _refineSetBlock(e,t,i){return this._checkIfNeedToExpandCandidatePage(e,this._maxQuery)===!0?(await this._expandPagedSet(e,this._maxQuery,0,0,i),this._refineSetBlock(e,t,i)):(this._checkCancelled(i),e._candidates.length,this._refineKnowns(e,t),e._candidates.length,e._candidates.length,e)}_expandPagedSet(e,t,i,s,a){return this._expandPagedSetFeatureSet(e,t,i,s,a)}async _getPhysicalPage(e,t,i){if(e.pagesDefinition.aggregatefeaturesetpagedefinition===!0)return this._sequentialGetPhysicalItem(e,e.pagesDefinition.resultRecordCount,i,[]);const s=await this._getAgregagtePhysicalPage(e,t,i);for(const a of s){const r={geometry:a.geometry,attributes:{}},n={};for(const l in a.attributes)n[l.toLowerCase()]=a.attributes[l];for(const l of this._decodedGroupbyfield)r.attributes[l.tofieldname]=n[l.name.toLowerCase()];for(const l of this._decodedStatsfield)r.attributes[l.tofieldname]=n[l.field.toLowerCase()];this._featureCache[r.attributes[this.objectIdField]]=new G(r)}return s.length}_sequentialGetPhysicalItem(e,t,i,s){return new Promise((a,r)=>{e.pagesDefinition.internal.iterator===null&&(e.pagesDefinition.internal.iterator=e.pagesDefinition.internal.subfeatureset.iterator(i)),e.pagesDefinition.internal.fullyResolved===!0||t===0?a(s.length):this._nextAggregateItem(e,t,i,s,n=>{n===null?a(s.length):(t-=1,a(this._sequentialGetPhysicalItem(e,t,i,s)))},r)})}_nextAggregateItem(e,t,i,s,a,r){try{$(e.pagesDefinition.internal.iterator.next()).then(n=>{if(n===null)if(e.pagesDefinition.internal.workingItem!==null){const l=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);s.push(l),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(l.attributes[this.objectIdField]),e.pagesDefinition.internal.fullyResolved=!0,a(null)}else e.pagesDefinition.internal.fullyResolved=!0,a(null);else{const l=this._generateAggregateHash(n);if(e.pagesDefinition.internal.workingItem===null)e.pagesDefinition.internal.workingItem={features:[n],id:l};else{if(l!==e.pagesDefinition.internal.workingItem.id){const u=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);return s.push(u),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(u.attributes[this.objectIdField]),t-=1,e.pagesDefinition.internal.workingItem={features:[n],id:l},void a(u)}e.pagesDefinition.internal.workingItem.features.push(n)}this._nextAggregateItem(e,t,i,s,a,r)}},r)}catch(n){r(n)}}_calculateFieldStat(e,t,i){const s=[];for(let a=0;athis._topnum&&(this._wset._known=this._wset._known.slice(0,this._topnum)),this._setKnownLength(this._wset)>=this._topnum&&(this._wset._candidates=[]),this._wset}return this._wset}_setKnownLength(e){return e._known.length>0&&e._known[e._known.length-1]==="GETPAGES"?e._known.length-1:e._known.length}_isInFeatureSet(e){const t=this._parent._isInFeatureSet(e);if(t===I.NotInFeatureSet)return t;const i=this._idstates[e];return i===I.InFeatureSet||i===I.NotInFeatureSet?i:t===I.InFeatureSet&&i===void 0?this._countedinthis._topnum&&(t=this._topnum),this._countedin>=this._topnum&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset){let n=e._known.length;return n>0&&e._known[n-1]==="GETPAGES"&&(e._known.length=n-1),n=e._candidates.length,n>0&&e._candidates[n-1]==="GETPAGES"&&(e._candidates.length=n-1),"success"}const r=await this._parent._expandPagedSet(e,t,i,s,a);return this._setKnownLength(e)>this._topnum&&(e._known.length=this._topnum),this._setKnownLength(e)>=this._topnum&&(e._candidates.length=0),r}async _getFeatures(e,t,i,s){const a=[],r=this._maxQueryRate();if(this._checkIfNeedToExpandKnownPage(e,r)===!0)return await this._expandPagedSet(e,r,0,0,s),this._getFeatures(e,t,i,s);t!==-1&&this._featureCache[t]===void 0&&a.push(t);let n=0;for(let o=e._lastFetchedIndex;or)));o++);if(a.length===0)return"success";const l=new _([],a,!1,null),u=Math.min(a.length,i);await this._parent._getFeatures(l,-1,u,s);for(let o=0;o=this._topnum)break}else if(n===I.NotInFeatureSet)s===null?s={start:r,end:r}:s.end===r-1?s.end=r:(a.push(s),s={start:r,end:r}),i+=1;else if(n===I.Unknown)break;if(i>=t)break}s!==null&&a.push(s);for(let r=a.length-1;r>=0;r--)e._candidates.splice(a[r].start,a[r].end-a[r].start+1);this._setKnownLength(e)>this._topnum&&(e._known=e._known.slice(0,this._topnum)),this._setKnownLength(e)>=this._topnum&&(e._candidates=[])}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}static registerAction(){E._featuresetFunctions.top=function(e){return new le({parentfeatureset:this,topnum:e})}}getFieldsIndex(){return this._parent.getFieldsIndex()}}async function Rt(h,e,t,i){return xt(e,await kt(h,e,t,i),t,i)}async function kt(h,e,t,i){var o;const s={...i},a=Nt(e,t),r=((o=e.outStatistics)==null?void 0:o[0])!=null,n=Me("featurelayer-pbf-statistics"),l=!r||n;let u;if((t==null?void 0:t.format)==="pbf"&&l)try{u=await _t(h,a,s)}catch(d){if(d.name!=="query:parsing-pbf")throw d;t.format="json"}return(t==null?void 0:t.format)!=="json"&&l||(u=await pt(h,a,s)),vt(t==null?void 0:t.fieldsIndex,u.fields),u}function vt(h,e){if(h!=null&&e!=null)for(const t of e){const i=h.get(t.name);i&&Object.assign(t,i.toJSON())}}async function xt(h,e,t,i){var r;const s=t==null?void 0:t.infoFor3D;if(!qe(h,s)||s==null||!e.assetMaps||!((r=e.features)!=null&&r.length))return yt.fromJSON(e);const{meshFeatureSetFromJSON:a}=await We($e(()=>import("./meshFeatureSet-DmiifJYC.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28])),i);return a(h,s,e)}function Nt(h,e){let t=N.from(h);t.sourceSpatialReference=t.sourceSpatialReference??(e==null?void 0:e.sourceSpatialReference)??null,(e!=null&&e.gdbVersion||e!=null&&e.dynamicDataSource)&&(t=t===h?t.clone():t,t.gdbVersion=h.gdbVersion||e.gdbVersion,t.dynamicDataSource=h.dynamicDataSource?Ve.from(h.dynamicDataSource):e.dynamicDataSource);const i=e==null?void 0:e.infoFor3D;if(i!=null&&qe(h,i)){t=t===h?t.clone():t,t.formatOf3DObjects=null;const{supportedFormats:s,queryFormats:a}=i,r=Ie("model/gltf-binary",s)??Ce("glb",s),n=Ie("model/gltf+json",s)??Ce("gtlf",s);for(const l of a){if(l===r){t.formatOf3DObjects=l;break}l!==n||t.formatOf3DObjects||(t.formatOf3DObjects=l)}if(!t.formatOf3DObjects)throw new Qe("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(t.outFields==null||!t.outFields.includes("*")){t=t===h?t.clone():t,t.outFields==null&&(t.outFields=[]);const{originX:l,originY:u,originZ:o,translationX:d,translationY:c,translationZ:f,scaleX:y,scaleY:g,scaleZ:b,rotationX:S,rotationY:p,rotationZ:w,rotationDeg:C}=i.transformFieldRoles;t.outFields.push(l,u,o,d,c,f,y,g,b,S,p,w,C)}}return t}function qe(h,e){return e!=null&&h.returnGeometry===!0&&h.multipatchOption!=="xyFootprint"&&!h.outStatistics}class z extends E{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerDynamic",this._removeGeometry=!1,this._overrideFields=null,this.formulaCredential=null,this._pageJustIds=!1,this._requestStandardised=!1,this._useDefinitionExpression=!0,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,e.outFields!==void 0&&(this._overrideFields=e.outFields),e.includeGeometry!==void 0&&(this._removeGeometry=e.includeGeometry===!1)}_maxQueryRate(){return ne}end(){return this._layer}optimisePagingFeatureQueries(e){this._pageJustIds=e}get urlQueryPath(){return this._layer.parsedUrl.path||""}convertQueryToLruCacheKey(e){const t=this.urlQueryPath+","+Ye(e.toJSON());return xe(t,Ne.String)}async loadImpl(){return this._layer.loaded===!0?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){var e,t,i,s,a,r;if(this.spatialReference==null&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType,this.fields=this._layer.fields.slice(0),this.hasZ=((i=(t=(e=this._layer)==null?void 0:e.capabilities)==null?void 0:t.data)==null?void 0:i.supportsZ)===!0,this.hasM=((r=(a=(s=this._layer)==null?void 0:s.capabilities)==null?void 0:a.data)==null?void 0:r.supportsM)===!0,this._overrideFields!==null)if(this._overrideFields.length===1&&this._overrideFields[0]==="*")this._overrideFields=null;else{const n=[],l=[];for(const u of this.fields)if(u.type==="oid")n.push(u),l.push(u.name);else for(const o of this._overrideFields)if(o.toLowerCase()===u.name.toLowerCase()){n.push(u),l.push(u.name);break}this.fields=n,this._overrideFields=l}if(this._layer.source&&this._layer.source.sourceJSON){const n=this._layer.source.sourceJSON.currentVersion;this._layer.source.sourceJSON.useStandardizedQueries===!0?(this._databaseType=x.StandardisedNoInterval,n!=null&&n>=10.61&&(this._databaseType=x.Standardised)):n!=null&&(n>=10.5&&(this._databaseType=x.StandardisedNoInterval,this._requestStandardised=!0),n>=10.61&&(this._databaseType=x.Standardised))}this.objectIdField=this._layer.objectIdField;for(const n of this.fields)n.type==="global-id"&&(this.globalIdField=n.name);this._layer instanceof Le?(this.subtypeField=this._layer.subtypeField??"",this.subtypes=this._layer.subtypes,this.types=null,this.typeIdField=null):(this.typeIdField=this._layer.typeIdField??"",this.types=this._layer.types,this.subtypeField=this._layer.subtypeField,this.subtypes=this._layer.subtypes)}_isInFeatureSet(){return I.InFeatureSet}async _refineSetBlock(e){return e}_candidateIdTransform(e){return e}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}async _runDatabaseProbe(e){await this._ensureLoaded();const t=new N;this.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t.where=e.replace("OBJECTID",this._layer.objectIdField);try{return await this._layer.queryObjectIds(t),!0}catch{return!1}}_canUsePagination(){return!(!this._layer.capabilities||!this._layer.capabilities.query||this._layer.capabilities.query.supportsPagination!==!0)}_cacheableFeatureSetSourceKey(){return this._layer.url}pbfSupportedForQuery(e){var i,s;const t=(s=(i=this._layer)==null?void 0:i.capabilities)==null?void 0:s.query;return!e.outStatistics&&(t==null?void 0:t.supportsFormatPBF)===!0&&(t==null?void 0:t.supportsQuantizationEditMode)===!0}async queryPBF(e){return e.quantizationParameters={mode:"edit"},(await Rt(this._layer.parsedUrl,e,{format:"pbf"},{})).unquantize()}get gdbVersion(){return this._layer&&this._layer.capabilities&&this._layer.capabilities.data&&this._layer.capabilities.data.isVersioned?this._layer.gdbVersion||"SDE.DEFAULT":""}nativeCapabilities(){return{title:this._layer.title??"",source:this,canQueryRelated:!0,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:this._requestStandardised}}executeQuery(e,t){e.returnZ=this.hasZ,e.returnM=this.hasM;const i=t==="execute"?De:t==="executeForCount"?gt:mt,s=t==="execute"&&this.pbfSupportedForQuery(e);let a=null;if(this.recentlyUsedQueries){const r=this.convertQueryToLruCacheKey(e);a=this.recentlyUsedQueries.getFromCache(r),a===null&&(a=s!==!0?i(this._layer.parsedUrl.path,e):this.queryPBF(e),this.recentlyUsedQueries.addToCache(r,a),a=a.catch(n=>{var l;throw(l=this.recentlyUsedQueries)==null||l.removeFromCache(r),n}))}return this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:e,method:t}),a===null&&(a=s!==!0?i(this._layer.parsedUrl.path,e):this.queryPBF(e)),a}async _getFilteredSet(e,t,i,s,a){const r=await this.databaseType();if(this.isTable()&&t&&e!==null&&e!=="")return new _([],[],!0,null);if(this._canUsePagination())return this._getFilteredSetUsingPaging(e,t,i,s,a);let n="",l=!1;s!==null&&this._layer.capabilities&&this._layer.capabilities.query&&this._layer.capabilities.query.supportsOrderBy===!0&&(n=s.constructClause(),l=!0);const u=new N;this.datesInUnknownTimezone&&(u.timeReferenceUnknownClient=!0),u.where=i===null?t===null?"1=1":"":k(i,r),this._requestStandardised&&(u.sqlFormat="standard"),u.spatialRelationship=this._makeRelationshipEnum(e),u.outSpatialReference=this.spatialReference,u.orderByFields=n!==""?n.split(","):null,u.geometry=t===null?null:t,u.relationParameter=this._makeRelationshipParam(e);let o=await this.executeQuery(u,"executeForIds");return o===null&&(o=[]),this._checkCancelled(a),new _([],o,l,null)}_expandPagedSet(e,t,i,s,a){return this._expandPagedSetFeatureSet(e,t,i,s,a)}async _getFilteredSetUsingPaging(e,t,i,s,a){var f;let r="",n=!1;s!==null&&this._layer.capabilities&&this._layer.capabilities.query&&this._layer.capabilities.query.supportsOrderBy===!0&&(r=s.constructClause(),n=!0);const l=await this.databaseType();let u=i===null?t===null?"1=1":"":k(i,l);this._layer.definitionExpression&&this._useDefinitionExpression&&(u=u!==""?"(("+this._layer.definitionExpression+") AND ("+u+"))":this._layer.definitionExpression);let o=this._maxQueryRate();const d=(f=this._layer.capabilities)==null?void 0:f.query.maxRecordCount;d!=null&&d=this._maxProcessingRate()-1))break}if(r>=i&&a.length===0)break}if(a.length===0)return"success";const n=new N;this._requestStandardised&&(n.sqlFormat="standard"),this.datesInUnknownTimezone&&(n.timeReferenceUnknownClient=!0),n.objectIds=a,n.outFields=this._overrideFields??this._fieldsIncludingObjectId(["*"]),n.returnGeometry=!0,this._removeGeometry===!0&&(n.returnGeometry=!1),n.outSpatialReference=this.spatialReference;const l=await this.executeQuery(n,"execute");if(this._checkCancelled(s),l.error!==void 0)throw new D(T.RequestFailed,{reason:l.error});const u=this._layer.objectIdField;for(let o=0;o=n)break}return g.features.length===0?l:g.features.length===((S=this._layer.capabilities)==null?void 0:S.query.maxRecordCount)&&l.length"+e.pagesDefinition.internal.lastMaxId.toString()+")":e.pagesDefinition.generatedOid+">"+e.pagesDefinition.internal.lastMaxId.toString());const a=e.pagesDefinition.internal.lastRetrieved,r=a,n=e.pagesDefinition.internal.lastPage,l=new N;if(this._requestStandardised&&(l.sqlFormat="standard"),l.where=s,l.spatialRelationship=e.pagesDefinition.spatialRel,l.relationParameter=e.pagesDefinition.relationParam,l.outFields=e.pagesDefinition.outFields,l.outStatistics=e.pagesDefinition.outStatistics,l.geometry=e.pagesDefinition.geometry,l.groupByFieldsForStatistics=e.pagesDefinition.groupByFieldsForStatistics,l.num=e.pagesDefinition.resultRecordCount,l.start=e.pagesDefinition.internal.lastPage,l.returnGeometry=e.pagesDefinition.returnGeometry,this.datesInUnknownTimezone&&(l.timeReferenceUnknownClient=!0),l.orderByFields=e.pagesDefinition.orderByFields!==""?e.pagesDefinition.orderByFields.split(","):null,this.isTable()&&l.geometry&&l.spatialRelationship)return[];const u=await this.executeQuery(l,"execute");if(this._checkCancelled(i),!u.hasOwnProperty("features"))throw new D(T.InvalidStatResponse);const o=[];if(e.pagesDefinition.internal.lastPage!==n)return[];u.features.length>0&&u.features[0].attributes[e.pagesDefinition.generatedOid]===void 0&&(e.pagesDefinition.generatedOid=e.pagesDefinition.generatedOid.toLowerCase());for(let d=0;d0||i&&i>0)&&(n.size=[t&&t>0?t:0,i&&i>0?i:t+1]),s&&s.length>0&&(n.attachmentTypes=s),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:n,method:"attachments"});const l=await this._layer.queryAttachments(n),u=[];return l&&l[e]&&l[e].forEach(o=>{const d=this._layer.parsedUrl.path+"/"+e.toString()+"/attachments/"+o.id.toString();let c=null;a&&o.exifInfo&&(c=He.convertJsonToArcade(o.exifInfo,"system",!0)),u.push(new et(o.id,o.name,o.contentType,o.size,d,c,o.keywords??null))}),u}return[]}async queryRelatedFeatures(e){var s;const t={f:"json",relationshipId:e.relationshipId.toString(),definitionExpression:e.where,outFields:(s=e.outFields)==null?void 0:s.join(","),returnGeometry:e.returnGeometry.toString()};e.resultOffset!==void 0&&e.resultOffset!==null&&(t.resultOffset=e.resultOffset.toString()),e.resultRecordCount!==void 0&&e.resultRecordCount!==null&&(t.resultRecordCount=e.resultRecordCount.toString()),e.orderByFields&&(t.orderByFields=e.orderByFields.join(",")),e.objectIds&&e.objectIds.length>0&&(t.objectIds=e.objectIds.join(",")),e.outSpatialReference&&(t.outSR=Ze(e.outSpatialReference)),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preRequestCallback({layer:this._layer,queryPayload:t,method:"relatedrecords",url:this._layer.parsedUrl.path+"/queryRelatedRecords"});const i=await B(this._layer.parsedUrl.path+"/queryRelatedRecords",{responseType:"json",query:t});if(i.data){const a={},r=i.data;if(r!=null&&r.relatedRecordGroups){const n=r.spatialReference;for(const l of r.relatedRecordGroups){const u=l.objectId,o=[];for(const d of l.relatedRecords){d.geometry&&(d.geometry.spatialReference=n);const c=new G({geometry:d.geometry?ze(d.geometry):null,attributes:d.attributes});o.push(c)}a[u]={features:o,exceededTransferLimit:r.exceededTransferLimit===!0}}}return a}throw new D(T.InvalidRequest)}async getFeatureByObjectId(e,t){const i=new N;i.outFields=t,i.returnGeometry=!1,i.outSpatialReference=this.spatialReference,i.where=this.objectIdField+"="+e.toString(),this.datesInUnknownTimezone&&(i.timeReferenceUnknownClient=!0),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:i,method:"execute"});const s=await De(this._layer.parsedUrl.path,i);return s.features.length===1?s.features[0]:null}async getIdentityUser(){var t;await this.load();const e=(t=pe)==null?void 0:t.findCredential(this._layer.url);return e?e.userId:null}async getOwningSystemUrl(){var s,a;await this.load();const e=(s=pe)==null?void 0:s.findServerInfo(this._layer.url);if(e)return e.owningSystemUrl;let t=this._layer.url;const i=t.toLowerCase().indexOf("/rest/services");if(t=i>-1?t.substring(0,i):t,t){t+="/rest/info";try{const r=await B(t,{query:{f:"json"}});let n="";return(a=r.data)!=null&&a.owningSystemUrl&&(n=r.data.owningSystemUrl),n}catch{return""}}return""}getDataSourceFeatureSet(){const e=new z({layer:this._layer,spatialReference:this.spatialReference??void 0,outFields:this._overrideFields??void 0,includeGeometry:!this._removeGeometry,lrucache:this.recentlyUsedQueries??void 0,interceptor:this.featureSetQueryInterceptor??void 0});return e._useDefinitionExpression=!1,e}get preferredTimeZone(){return this._layer.preferredTimeZone??null}get dateFieldsTimeZone(){return this._layer.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._layer.datesInUnknownTimezone}get editFieldsInfo(){return this._layer.editFieldsInfo??null}get timeInfo(){return this._layer.timeInfo??null}async getFeatureSetInfo(){var a,r;if(this.fsetInfo)return this.fsetInfo;let e=null,{parsedUrl:{path:t},serviceItemId:i=null}=this._layer;if(t){const n=await B(t,{responseType:"json",query:{f:"json"}});e=((a=n==null?void 0:n.data)==null?void 0:a.name)??null,i=((r=n==null?void 0:n.data)==null?void 0:r.serviceItemId)??null}const s=this._layer.title&&(this._layer.parent??null)!==null;return this.featureSetInfo={layerId:this._layer.layerId,layerName:e===""?null:e,itemId:i===""?null:i,serviceLayerUrl:t===""?null:t,webMapLayerId:s?this._layer.id??null:null,webMapLayerTitle:s?this._layer.title??null:null,className:null,objectClassId:null},this.fsetInfo}}class oe extends E{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerMemory",this._removeGeometry=!1,this._overrideFields=null,this._forceIsTable=!1,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,e.isTable===!0&&(this._forceIsTable=!0),e.outFields!==void 0&&(this._overrideFields=e.outFields),e.includeGeometry!==void 0&&(this._removeGeometry=e.includeGeometry===!1)}_maxQueryRate(){return ne}end(){return this._layer}optimisePagingFeatureQueries(){}async loadImpl(){return this._layer.loaded===!0?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}get gdbVersion(){return""}_initialiseFeatureSet(){var e,t,i,s,a,r;if(this.spatialReference==null&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType,this.fields=this._layer.fields.slice(0),this._overrideFields!==null)if(this._overrideFields.length===1&&this._overrideFields[0]==="*")this._overrideFields=null;else{const n=[],l=[];for(const u of this.fields)if(u.type==="oid")n.push(u),l.push(u.name);else for(const o of this._overrideFields)if(o.toLowerCase()===u.name.toLowerCase()){n.push(u),l.push(u.name);break}this.fields=n,this._overrideFields=l}this.objectIdField=this._layer.objectIdField;for(const n of this.fields)n.type==="global-id"&&(this.globalIdField=n.name);this._databaseType=x.Standardised,this.hasZ=((i=(t=(e=this._layer)==null?void 0:e.capabilities)==null?void 0:t.data)==null?void 0:i.supportsZ)===!0,this.hasM=((r=(a=(s=this._layer)==null?void 0:s.capabilities)==null?void 0:a.data)==null?void 0:r.supportsM)===!0,this._layer instanceof Le?(this.subtypeField=this._layer.subtypeField??"",this.subtypes=this._layer.subtypes,this.types=null,this.typeIdField=null):(this.typeIdField=this._layer.typeIdField??"",this.types=this._layer.types,this.subtypeField=this._layer.subtypeField,this.subtypes=this._layer.subtypes)}isTable(){return this._forceIsTable||this._layer.isTable||this._layer.type==="table"||!this._layer.geometryType}_isInFeatureSet(){return I.InFeatureSet}_candidateIdTransform(e){return e}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}_changeFeature(e){const t={};for(const i of this.fields)t[i.name]=e.attributes[i.name];return new G({geometry:this._removeGeometry===!0?null:e.geometry,attributes:t})}async _getFilteredSet(e,t,i,s,a){let r="",n=!1;if(s!==null&&(r=s.constructClause(),n=!0),this.isTable()&&t&&e!==null&&e!=="")return new _([],[],!0,null);const l=new N;l.returnZ=this.hasZ,l.returnM=this.hasM,l.where=i===null?t===null?"1=1":"":k(i,x.Standardised),l.spatialRelationship=this._makeRelationshipEnum(e),l.outSpatialReference=this.spatialReference,l.orderByFields=r!==""?r.split(","):null,l.geometry=t===null?null:t,l.returnGeometry=!0,l.relationParameter=this._makeRelationshipParam(e);const u=await this._layer.queryFeatures(l);if(u===null)return new _([],[],n,null);this._checkCancelled(a);const o=[];return u.features.forEach(d=>{const c=d.attributes[this._layer.objectIdField];o.push(c),this._featureCache[c]=this._changeFeature(d)}),new _([],o,n,null)}_makeRelationshipEnum(e){if(e.includes("esriSpatialRelRelation"))return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e}_makeRelationshipParam(e){return e.includes("esriSpatialRelRelation")?e.split(":")[1]:""}async _queryAllFeatures(){if(this._wset)return this._wset;const e=new N;if(e.where="1=1",await this._ensureLoaded(),this._layer.source&&this._layer.source.items){const s=[];return this._layer.source.items.forEach(a=>{const r=a.attributes[this._layer.objectIdField];s.push(r),this._featureCache[r]=this._changeFeature(a)}),this._wset=new _([],s,!1,null),this._wset}e.returnZ=this.hasZ,e.returnM=this.hasM;const t=await this._layer.queryFeatures(e),i=[];return t.features.forEach(s=>{const a=s.attributes[this._layer.objectIdField];i.push(a),this._featureCache[a]=this._changeFeature(s)}),this._wset=new _([],i,!1,null),this._wset}async _getFeatures(e,t,i){const s=[];t!==-1&&this._featureCache[t]===void 0&&s.push(t);for(let a=e._lastFetchedIndex;ai)));a++);if(s.length===0)return"success";throw new D(T.MissingFeatures)}async _refineSetBlock(e){return e}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}relationshipMetaData(){return[]}static _cloneAttr(e){const t={};for(const i in e)t[i]=e[i];return t}nativeCapabilities(){return{title:this._layer.title??"",canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}}static create(e,t){var y,g,b,S,p,w;let i=e.layerDefinition.objectIdField;const s=e.layerDefinition.typeIdField??"",a=[];if(e.layerDefinition.types)for(const C of e.layerDefinition.types)a.push(wt.fromJSON(C));let r=e.layerDefinition.geometryType;r===void 0&&(r=e.featureSet.geometryType||"");let n=e.featureSet.features;const l=t.toJSON();if(!i){let C=!1;for(const P of e.layerDefinition.fields)if(P.type==="oid"||P.type==="esriFieldTypeOID"){i=P.name,C=!0;break}if(C===!1){let P="FID",he=!0,ce=0;for(;he;){let q=!0;for(const Ge of e.layerDefinition.fields)if(Ge.name===P){q=!1;break}q===!0?he=!1:(ce++,P="FID"+ce.toString())}e.layerDefinition.fields.push({type:"esriFieldTypeOID",name:P,alias:P});const K=[];for(let q=0;qw.name):["*"]);u.outFields=o,u.relationshipId=this.relationship.id,u.where="1=1";let d=!0;this._removeGeometry===!0&&(d=!1),u.returnGeometry=d,this._requestStandardised&&(u.sqlFormat="standard"),u.outSpatialReference=this.spatialReference,u.orderByFields=n!==""?n.split(","):null;const c=await r.source.queryRelatedFeatures(u);this._checkCancelled(a);const f=c[this._findObjectId]?c[this._findObjectId].features:[],y=[];for(let w=0;ww.name):["*"]);return y=new _(c||f?["GETPAGES"]:[],c||f?[]:["GETPAGES"],n,{outFields:b.join(","),resultRecordCount:o,resultOffset:0,objectIds:[this._findObjectId],where:u,orderByFields:r,returnGeometry:g,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}}),await this._expandPagedSet(y,o,0,0,a),y}_expandPagedSet(e,t,i,s,a){return this._expandPagedSetFeatureSet(e,t,i,s,a)}_clonePageDefinition(e){return e===null?null:e.groupbypage!==!0?{groupbypage:!1,outFields:e.outFields,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}:{groupbypage:!0,outFields:e.outFields,resultRecordCount:e.resultRecordCount,useOIDpagination:e.useOIDpagination,generatedOid:e.generatedOid,groupByFieldsForStatistics:e.groupByFieldsForStatistics,resultOffset:e.resultOffset,outStatistics:e.outStatistics,geometry:e.geometry,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}}async _getPhysicalPage(e,t,i){const s=e.pagesDefinition.internal.lastRetrieved,a=s,r=e.pagesDefinition.internal.lastPage,n=this._layer.nativeCapabilities(),l=new Te;this._requestStandardised===!0&&(l.sqlFormat="standard"),l.relationshipId=this.relationship.id,l.objectIds=e.pagesDefinition.objectIds,l.resultOffset=e.pagesDefinition.internal.lastPage,l.resultRecordCount=e.pagesDefinition.resultRecordCount,l.outFields=e.pagesDefinition.outFields.split(","),l.where=e.pagesDefinition.where,l.orderByFields=e.pagesDefinition.orderByFields!==""?e.pagesDefinition.orderByFields.split(","):null,l.returnGeometry=e.pagesDefinition.returnGeometry,l.outSpatialReference=this.spatialReference;const u=await n.source.queryRelatedFeatures(l);if(this._checkCancelled(i),e.pagesDefinition.internal.lastPage!==r)return 0;const o=u[this._findObjectId]?u[this._findObjectId].features:[];for(let c=0;ci)))&&!(n>=i&&a.length===0);l++);if(a.length===0)return"success";throw new D(T.MissingFeatures)}async _refineSetBlock(e,t,i){return e}async _stat(e,t,i,s,a,r,n){return{calculated:!1}}get gdbVersion(){return this._relatedLayer.gdbVersion}async _canDoAggregates(e,t,i,s,a){return!1}relationshipMetaData(){return this._relatedLayer.relationshipMetaData()}serviceUrl(){return this._relatedLayer.serviceUrl()}queryAttachments(e,t,i,s,a){return this._relatedLayer.queryAttachments(e,t,i,s,a)}getFeatureByObjectId(e,t){return this._relatedLayer.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._relatedLayer.getOwningSystemUrl()}getIdentityUser(){return this._relatedLayer.getIdentityUser()}getDataSourceFeatureSet(){return this._relatedLayer}get preferredTimeZone(){var e;return((e=this._relatedLayer)==null?void 0:e.preferredTimeZone)??null}get dateFieldsTimeZone(){var e;return((e=this._relatedLayer)==null?void 0:e.dateFieldsTimeZone)??null}get datesInUnknownTimezone(){var e;return(e=this._relatedLayer)==null?void 0:e.datesInUnknownTimezone}get editFieldsInfo(){var e;return((e=this._relatedLayer)==null?void 0:e.editFieldsInfo)??null}get timeInfo(){var e;return((e=this._relatedLayer)==null?void 0:e.timeInfo)??null}async getFeatureSetInfo(){return this.fsetInfo??this._layer.featureSetInfo}}function At(){m.applicationCache===null&&(m.applicationCache=new m)}async function se(h,e){if(m.applicationCache){const t=m.applicationCache.getLayerInfo(h);if(t){const a=await t;return new v({url:h,outFields:e,sourceJSON:a})}const i=new v({url:h,outFields:e}),s=(async()=>(await i.load(),i.sourceJSON))();if(m.applicationCache){m.applicationCache.setLayerInfo(h,s);try{return await s,i}catch(a){throw m.applicationCache.clearLayerInfo(h),a}}return await s,i}return new v({url:h,outFields:e})}async function ue(h,e,t,i,s,a=null){return O(await se(h,["*"]),e,t,i,s,a)}function O(h,e=null,t=null,i=!0,s=null,a=null){if(h instanceof v||V(h)){const n={layer:h,spatialReference:e,outFields:t,includeGeometry:i,lrucache:s,interceptor:a};return h.url||!h.source?new z(n):new oe(n)}const r=O(h.parent,e,t,i,s,a);return r.filter(R.create(h.parent.subtypeField+"="+h.subtypeCode.toString(),h.parent.fieldsIndex,r.dateFieldsTimeZoneDefaultUTC))}async function Ot(h){if(m.applicationCache!==null){const t=m.applicationCache.getLayerInfo(h);if(t!==null)return t}const e=(async()=>{const t=await B(h,{responseType:"json",query:{f:"json"}});return t.data?t.data:null})();if(m.applicationCache!==null){m.applicationCache.setLayerInfo(h,e);try{return await e}catch(t){throw m.applicationCache.clearLayerInfo(h),t}}return e}async function Et(h,e){const t="QUERYDATAELEMTS:"+e.toString()+":"+h;if(m.applicationCache!==null){const s=m.applicationCache.getLayerInfo(t);if(s!==null)return s}const i=(async()=>{var a;const s=await B(h+"/queryDataElements",{method:"post",responseType:"json",query:{layers:JSON.stringify([e.toString()]),f:"json"}});if(s.data){const r=s.data;if((a=r.layerDataElements)!=null&&a[0])return r.layerDataElements[0]}throw new D(T.DataElementsNotFound)})();if(m.applicationCache!==null){m.applicationCache.setLayerInfo(t,i);try{return await i}catch(s){throw m.applicationCache.clearLayerInfo(t),s}}return i}async function je(h){if(m.applicationCache!==null){const t=m.applicationCache.getLayerInfo(h);if(t!==null)return t}const e=(async()=>{const t=await B(h,{responseType:"json",query:{f:"json"}});if(t.data){const i=t.data;return i.layers||(i.layers=[]),i.tables||(i.tables=[]),i}return{layers:[],tables:[]}})();if(m.applicationCache!==null){m.applicationCache.setLayerInfo(h,e);try{return await e}catch(t){throw m.applicationCache.clearLayerInfo(h),t}}return e}async function Pt(h,e){var s,a,r;const t={metadata:null,networkId:-1,unVersion:3,terminals:[],queryelem:null,layerNameLkp:{},lkp:null},i=await je(h);if(t.metadata=i,((s=i.controllerDatasetLayers)==null?void 0:s.utilityNetworkLayerId)!==void 0&&i.controllerDatasetLayers.utilityNetworkLayerId!==null){if(i.layers)for(const u of i.layers)t.layerNameLkp[u.id]=u.name;if(i.tables)for(const u of i.tables)t.layerNameLkp[u.id]=u.name;const n=i.controllerDatasetLayers.utilityNetworkLayerId;t.networkId=n;const l=await Et(h,n);if(l){t.queryelem=l,(a=t.queryelem)!=null&&a.dataElement&&t.queryelem.dataElement.schemaGeneration!==void 0&&(t.unVersion=t.queryelem.dataElement.schemaGeneration),t.lkp={},t.queryelem.dataElement.domainNetworks||(t.queryelem.dataElement.domainNetworks=[]);for(const o of t.queryelem.dataElement.domainNetworks){for(const d of o.edgeSources??[]){const c={layerId:d.layerId,sourceId:d.sourceId,className:t.layerNameLkp[d.layerId]??null};c.className&&(t.lkp[c.className]=c)}for(const d of o.junctionSources??[]){const c={layerId:d.layerId,sourceId:d.sourceId,className:t.layerNameLkp[d.layerId]??null};c.className&&(t.lkp[c.className]=c)}}if(t.queryelem.dataElement.terminalConfigurations)for(const o of t.queryelem.dataElement.terminalConfigurations)for(const d of o.terminals)t.terminals.push({terminalId:d.terminalId,terminalName:d.terminalName});const u=await Ot(h+"/"+n);if(((r=u.systemLayers)==null?void 0:r.associationsTableId)!==void 0&&u.systemLayers.associationsTableId!==null){const o=[];t.unVersion>=4&&(o.push("STATUS"),o.push("PERCENTALONG"));let d=await ue(h+"/"+u.systemLayers.associationsTableId.toString(),e,["OBJECTID","FROMNETWORKSOURCEID","TONETWORKSOURCEID","FROMGLOBALID","TOGLOBALID","TOTERMINALID","FROMTERMINALID","ASSOCIATIONTYPE","ISCONTENTVISIBLE","GLOBALID",...o],!1,null,null);return await d.load(),t.unVersion>=4&&(d=d.filter(R.create("STATUS NOT IN (1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63)",d.getFieldsIndex(),d.dateFieldsTimeZoneDefaultUTC)),await d.load()),{lkp:t.lkp,associations:d,unVersion:t.unVersion,terminals:t.terminals}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}async function qt(h,e,t,i=null,s=null,a=!0,r=null,n=null){let l=h.serviceUrl();if(!l)return null;l=l.charAt(l.length-1)==="/"?l+e.relatedTableId.toString():l+"/"+e.relatedTableId.toString();const u=await ue(l,i,s,a,r,n);return new Lt({layer:h,relatedLayer:u,relationship:e,objectId:t,spatialReference:i,outFields:s,includeGeometry:a,lrucache:r,interceptor:n})}Oe.registerAction(),Tt.registerAction(),te.registerAction(),ut.registerAction(),le.registerAction();class jt extends Ae{constructor(e,t=null,i=null,s=null){super(),this._map=e,this._overridespref=t,this._lrucache=i,this._interceptor=s,this._instantLayers=[]}_makeAndAddFeatureSet(e,t=!0,i=null){const s=O(e,this._overridespref,i===null?["*"]:i,t,this._lrucache,this._interceptor);return this._instantLayers.push({featureset:s,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),s}async featureSetByName(e,t=!0,i=null){if(this._map.loaded!==void 0&&this._map.load!==void 0&&this._map.loaded===!1)return await this._map.load(),this.featureSetByName(e,t,i);i===null&&(i=["*"]),i=(i=i.slice(0)).sort();const s=JSON.stringify(i);for(let r=0;r{if(r instanceof v){if(r.title===e)return!0}else if(V(r)&&r.title===e)return!0;return!1});if(a)return this._makeAndAddFeatureSet(a,t,i);if(this._map.tables){const r=this._map.tables.find(n=>!!(n.title&&n.title===e||n.title&&n.title===e));if(r){if(r instanceof v)return this._makeAndAddFeatureSet(r,t,i);if(!r._materializedTable){const n=r.outFields?r:{...r,outFields:["*"]};r._materializedTable=new v(n)}return await r._materializedTable.load(),this._makeAndAddFeatureSet(r._materializedTable,t,i)}}return null}async featureSetById(e,t=!0,i=["*"]){if(this._map.loaded!==void 0&&this._map.load!==void 0&&this._map.loaded===!1)return await this._map.load(),this.featureSetById(e,t,i);i===null&&(i=["*"]),i=(i=i.slice(0)).sort();const s=JSON.stringify(i);for(let r=0;r{if(r instanceof v){if(r.id===e)return!0}else if(V(r)&&r.id===e)return!0;return!1});if(a)return this._makeAndAddFeatureSet(a,t,i);if(this._map.tables){const r=this._map.tables.find(n=>n.id===e);if(r){if(r instanceof v)return this._makeAndAddFeatureSet(r,t,i);if(!r._materializedTable){const n={...r,outFields:["*"]};r._materializedTable=new v(n)}return await r._materializedTable.load(),this._makeAndAddFeatureSet(r._materializedTable,t,i)}}return null}}class de extends Ae{constructor(e,t=null,i=null,s=null){super(),this._url=e,this._overridespref=t,this._lrucache=i,this._interceptor=s,this.metadata=null,this._instantLayers=[]}get url(){return this._url}_makeAndAddFeatureSet(e,t=!0,i=null){const s=O(e,this._overridespref,i===null?["*"]:i,t,this._lrucache);return this._instantLayers.push({featureset:s,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),s}async _loadMetaData(){const e=await je(this._url);return this.metadata=e,e}load(){return this._loadMetaData()}clone(){return new de(this._url,this._overridespref,this._lrucache,this._interceptor)}async featureSetByName(e,t=!0,i=null){i===null&&(i=["*"]),i=(i=i.slice(0)).sort();const s=JSON.stringify(i);for(let n=0;n":case"=":if(e.left.type==="column-reference"&&e.right.type==="string"){if(e.left.column.toUpperCase()===this.field.name.toUpperCase()&&this.lkp[e.right.value.toString()]!==void 0)return" ("+s+" "+e.operator+" "+this.lkp[e.right.value.toString()].toString()+") "}else if(e.right.type==="column-reference"&&e.left.type==="string"&&e.right.column.toUpperCase()===this.field.name.toUpperCase())return" ("+this.lkp[e.right.value.toString()].toString()+" "+e.operator+" "+s+") ";return" ("+this.evaluateNodeToWhereClause(e.left,t,i,F.BADNESS,a)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,F.BADNESS,a)+") ";case"<":case">":case">=":case"<=":case"*":case"-":case"+":case"/":case"||":return" ("+this.evaluateNodeToWhereClause(e.left,t,i,F.BADNESS,a)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,F.BADNESS,a)+") "}case"null":return"null";case"boolean":return e.value===!0?"1":"0";case"string":return"'"+e.value.toString().replaceAll("'","''")+"'";case"timestamp":return`timestamp '${e.value}'`;case"date":return`date '${e.value}'`;case"time":return`time '${e.value}'`;case"number":return e.value.toString();case"current-time":return at(e.mode==="date",t);case"column-reference":return i&&i.toLowerCase()===e.column.toLowerCase()?"("+s+")":e.column;case"data-type":return e.value;case"function":{const o=this.evaluateNodeToWhereClause(e.args,t,i,F.BADNESS,a);return st(e.name,o,t)}}throw new L(A.UnsupportedSyntax,{node:e.type})}extractValue(e){return this.codefield instanceof R?this.reverseLkp[R.convertValueToStorageFormat(this.codefield.calculateValueCompiled(e))]:this.reverseLkp[e.attributes[this.codefield]]}};St.BADNESS="_!!!_BAD_LKP_!!!!";class bt extends J{constructor(e,t){super(e),this._sql=t}rewriteSql(e,t){return{rewritten:!0,where:Q(e,this.field.name,k(this._sql,x.Standardised),t.getFieldsIndex())}}extractValue(e){return R.convertValueToStorageFormat(this._sql.calculateValueCompiled(e),this.field.type)}}class It extends E{static findField(e,t){for(const i of e)if(i.name.toLowerCase()===t.toString().toLowerCase())return i;return null}constructor(e){super(e),this._calcFunc=null,this.declaredClass="esri.arcade.featureset.actions.Adapted",this.adaptedFields=[],this._extraFilter=null,this._extraFilter=e.extraFilter,this._parent=e.parentfeatureset,this._maxProcessing=30,this.adaptedFields=e.adaptedFields}_initialiseFeatureSet(){this._parent!==null?(this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.spatialReference=new ae({wkid:4326}),this.objectIdField="",this.globalIdField="",this.geometryType=re.point,this.typeIdField="",this.types=null,this.subtypeField=null,this.subtypes=null),this.fields=[];for(const e of this.adaptedFields)e.postInitialization(this,this._parent),this.fields.push(e.field)}async _getSet(e){var t;if(this._wset===null){await this._ensureLoaded();let i=null;return i=this._extraFilter?await this._getFilteredSet("",null,null,null,e):await((t=this._parent)==null?void 0:t._getSet(e)),this._checkCancelled(e),Be(i),this._wset=new _(i._candidates.slice(0),i._known.slice(0),i._ordered,this._clonePageDefinition(i.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}async _getFeatures(e,t,i,s){var o,d;const a=[];t!==-1&&this._featureCache[t]===void 0&&a.push(t);const r=this._maxQueryRate();if(this._checkIfNeedToExpandKnownPage(e,r)===!0)return await this._expandPagedSet(e,r,0,0,s),this._getFeatures(e,t,i,s);let n=0;for(let c=e._lastFetchedIndex;c=r)));c++);if(a.length===0)return"success";e=new _([],a,e._ordered,null);const l=Math.min(a.length,i);await((o=this._parent)==null?void 0:o._getFeatures(e,-1,l,s)),this._checkCancelled(s);const u=[];for(let c=0;c0&&(s=s.replaceFields(d))}i!==null?this._extraFilter!==null&&(i=j(this._extraFilter,i)):i=this._extraFilter,await this._ensureLoaded();const u=await this._parent._getFilteredSet(e,t,i,s,a);let o;return this._checkCancelled(a),o=r===!0?new _(u._candidates.slice(0).concat(u._known.slice(0)),[],l===!0&&u._ordered,this._clonePageDefinition(u.pagesDefinition)):new _(u._candidates.slice(0),u._known.slice(0),l===!0&&u._ordered,this._clonePageDefinition(u.pagesDefinition)),o}_reformulateWithoutAdaptions(e){const t={cannot:!1,where:e};if(e!==null){for(const i of this.adaptedFields)if(ve(e,i.field.name)===!0){const s=i.rewriteSql(e,this);if(s.rewritten!==!0){t.cannot=!0,t.where=null;break}t.where=s.where}}return t}async _stat(e,t,i,s,a,r,n){let l=!1,u=this._reformulateWithoutAdaptions(t);if(l=u.cannot,t=u.where,u=this._reformulateWithoutAdaptions(a),l=l||u.cannot,(a=u.where)!==null?this._extraFilter!==null&&(a=j(this._extraFilter,a)):a=this._extraFilter,l===!0)return a===null&&i===""&&s===null?this._manualStat(e,t,r,n):{calculated:!1};const o=await this._parent._stat(e,t,i,s,a,r,n);return o.calculated===!1?a===null&&i===""&&s===null?this._manualStat(e,t,r,n):{calculated:!1}:o}async _canDoAggregates(e,t,i,s,a){if(this._parent===null)return!1;for(let l=0;l{for(let s=0;s0?(await $(this._refineSetBlock(e,this._maxProcessingRate(),s)),this._checkCancelled(s),this.getIdColumnDictionary(e,t,i,s)):t}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}_getFeatures(e,t,i,s){return this._parent._getFeatures(e,t,i,s)}_featureFromCache(e){if(this._featureCache[e]===void 0){const t=this._parent._featureFromCache(e);return t===void 0?void 0:t===null?null:(this._featureCache[e]=t,t)}return this._featureCache[e]}async _fetchAndRefineFeatures(){throw new D(T.NeverReach)}async _getFilteredSet(e,t,i,s,a){await this._ensureLoaded();const r=await this._parent._getFilteredSet(e,t,i,s===null?this._orderbyclause:s,a);this._checkCancelled(a);const n=new _(r._candidates.slice(0),r._known.slice(0),r._ordered,this._clonePageDefinition(r.pagesDefinition));let l=!0;if(r._candidates.length>0&&(l=!1),n._ordered===!1){let u=await this.manualOrderSet(n,a);return l===!1&&(t===null&&i===null||(u=new _(u._candidates.slice(0).concat(u._known.slice(0)),[],u._ordered,this._clonePageDefinition(u.pagesDefinition)))),u}return n}static registerAction(){E._featuresetFunctions.orderBy=function(e){return e===""?this:new Ee({parentfeatureset:this,orderbyclause:new W(e)})}}getFieldsIndex(){return this._parent.getFieldsIndex()}};function Ct(h){if(h.parseTree.type==="function"){if(h.parseTree.args.value.length===0)return{name:h.parseTree.name,expr:null};if(h.parseTree.args.value.length>1)throw new L(A.MissingStatisticParameters);const e=R.create(nt(h.parseTree.args.value[0],x.Standardised,h.parameters),h.fieldsIndex,h.timeZone);return{name:h.parseTree.name,expr:e}}return null}let ke=class ie{constructor(){this.field="",this.tofieldname="",this.typeofstat="MIN",this.workingexpr=null}clone(){const e=new ie;return e.field=this.field,e.tofieldname=this.tofieldname,e.typeofstat=this.typeofstat,e.workingexpr=this.workingexpr,e}static parseStatField(e,t,i,s){const a=new ie;a.field=e;const r=R.create(t,i,s),n=Ct(r);if(n===null)throw new L(A.UnsupportedSqlFunction,{function:""});const l=n.name.toUpperCase().trim();if(l==="MIN"){if(a.typeofstat="MIN",a.workingexpr=n.expr,r===null)throw new L(A.InvalidFunctionParameters,{function:"min"})}else if(l==="MAX"){if(a.typeofstat="MAX",a.workingexpr=n.expr,r===null)throw new L(A.InvalidFunctionParameters,{function:"max"})}else if(l==="COUNT")a.typeofstat="COUNT",a.workingexpr=n.expr;else if(l==="STDEV"){if(a.typeofstat="STDDEV",a.workingexpr=n.expr,r===null)throw new L(A.InvalidFunctionParameters,{function:"stdev"})}else if(l==="SUM"){if(a.typeofstat="SUM",a.workingexpr=n.expr,r===null)throw new L(A.InvalidFunctionParameters,{function:"sum"})}else if(l==="MEAN"){if(a.typeofstat="AVG",a.workingexpr=n.expr,r===null)throw new L(A.InvalidFunctionParameters,{function:l})}else if(l==="AVG"){if(a.typeofstat="AVG",a.workingexpr=n.expr,r===null)throw new L(A.InvalidFunctionParameters,{function:"avg"})}else{if(l!=="VAR")throw new L(A.UnsupportedSqlFunction,{function:l});if(a.typeofstat="VAR",a.workingexpr=n.expr,r===null)throw new L(A.InvalidFunctionParameters,{function:"var"})}return a}toStatisticsName(){switch(this.typeofstat.toUpperCase()){case"MIN":return"min";case"MAX":return"max";case"SUM":return"sum";case"COUNT":default:return"count";case"VAR":return"var";case"STDDEV":return"stddev";case"AVG":return"avg"}}};function Dt(h){if(!h)return"COUNT";switch(h.toLowerCase()){case"max":return"MAX";case"var":case"variance":return"VAR";case"avg":case"average":case"mean":return"AVG";case"min":return"MIN";case"sum":return"SUM";case"stdev":case"stddev":return"STDDEV";case"count":return"COUNT"}return"COUNT"}let Tt=class Pe extends E{constructor(e){super(e),this._decodedStatsfield=[],this._decodedGroupbyfield=[],this._candosimplegroupby=!0,this.phsyicalgroupbyfields=[],this.objectIdField="ROW__ID",this._internalObjectIdField="ROW__ID",this._adaptedFields=[],this.declaredClass="esri.arcade.featureset.actions.Aggregate",this._uniqueIds=1,this._maxQuery=10,this._maxProcessing=10,this._parent=e.parentfeatureset,this._config=e}isTable(){return!0}async _getSet(e){if(this._wset===null){const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,this._wset}return this._wset}_isInFeatureSet(){return I.InFeatureSet}_nextUniqueName(e){for(;e["T"+this._uniqueIds.toString()]===1;)this._uniqueIds++;const t="T"+this._uniqueIds.toString();return e[t]=1,t}_convertToEsriFieldType(e){return e}_initialiseFeatureSet(){const e={};let t=!1,i=1;const s=this._parent?this._parent.getFieldsIndex():new ft([]);for(this.objectIdField="ROW__ID",this.globalIdField="";t===!1;){let r=!1;for(let n=0;n0)for(const r of this._parent.fields)this._adaptedFields.push(new ee(r));for(let r=0;r0&&(l=new It({parentfeatureset:this._parent,adaptedFields:this._adaptedFields,extraFilter:null})),n.nowhereclause===!0)r=new _(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new te({parentfeatureset:l,orderbyclause:new W(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}});else{let u=l;if(i!==null){let o=null;i&&(o=this._reformulateWhereClauseWithoutGroupByFields(i)),u=new Oe({parentfeatureset:u,whereclause:o})}r=new _(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new te({parentfeatureset:u,orderbyclause:new W(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}})}return r}_reformulateWhereClauseWithoutStatsFields(e){for(const t of this._decodedStatsfield)e=Q(e,t.tofieldname,k(t.workingexpr,x.Standardised),this._parent.getFieldsIndex());return e}_reformulateWhereClauseWithoutGroupByFields(e){for(const t of this._decodedGroupbyfield)t.tofieldname!==t.name&&(e=Q(e,t.tofieldname,k(t.expression,x.Standardised),this._parent.getFieldsIndex()));return e}_reformulateOrderClauseWithoutGroupByFields(e){const t=[];for(const i of this._decodedGroupbyfield)i.tofieldname!==i.name&&t.push({field:i.tofieldname,newfield:i.name});return t.length>0?e.replaceFields(t):e}_clonePageDefinition(e){return e===null?null:e.aggregatefeaturesetpagedefinition===!0?{aggregatefeaturesetpagedefinition:!0,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,internal:e.internal}:this._parent._clonePageDefinition(e)}async _refineSetBlock(e,t,i){return this._checkIfNeedToExpandCandidatePage(e,this._maxQuery)===!0?(await this._expandPagedSet(e,this._maxQuery,0,0,i),this._refineSetBlock(e,t,i)):(this._checkCancelled(i),e._candidates.length,this._refineKnowns(e,t),e._candidates.length,e._candidates.length,e)}_expandPagedSet(e,t,i,s,a){return this._expandPagedSetFeatureSet(e,t,i,s,a)}async _getPhysicalPage(e,t,i){if(e.pagesDefinition.aggregatefeaturesetpagedefinition===!0)return this._sequentialGetPhysicalItem(e,e.pagesDefinition.resultRecordCount,i,[]);const s=await this._getAgregagtePhysicalPage(e,t,i);for(const a of s){const r={geometry:a.geometry,attributes:{}},n={};for(const l in a.attributes)n[l.toLowerCase()]=a.attributes[l];for(const l of this._decodedGroupbyfield)r.attributes[l.tofieldname]=n[l.name.toLowerCase()];for(const l of this._decodedStatsfield)r.attributes[l.tofieldname]=n[l.field.toLowerCase()];this._featureCache[r.attributes[this.objectIdField]]=new G(r)}return s.length}_sequentialGetPhysicalItem(e,t,i,s){return new Promise((a,r)=>{e.pagesDefinition.internal.iterator===null&&(e.pagesDefinition.internal.iterator=e.pagesDefinition.internal.subfeatureset.iterator(i)),e.pagesDefinition.internal.fullyResolved===!0||t===0?a(s.length):this._nextAggregateItem(e,t,i,s,n=>{n===null?a(s.length):(t-=1,a(this._sequentialGetPhysicalItem(e,t,i,s)))},r)})}_nextAggregateItem(e,t,i,s,a,r){try{$(e.pagesDefinition.internal.iterator.next()).then(n=>{if(n===null)if(e.pagesDefinition.internal.workingItem!==null){const l=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);s.push(l),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(l.attributes[this.objectIdField]),e.pagesDefinition.internal.fullyResolved=!0,a(null)}else e.pagesDefinition.internal.fullyResolved=!0,a(null);else{const l=this._generateAggregateHash(n);if(e.pagesDefinition.internal.workingItem===null)e.pagesDefinition.internal.workingItem={features:[n],id:l};else{if(l!==e.pagesDefinition.internal.workingItem.id){const u=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);return s.push(u),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(u.attributes[this.objectIdField]),t-=1,e.pagesDefinition.internal.workingItem={features:[n],id:l},void a(u)}e.pagesDefinition.internal.workingItem.features.push(n)}this._nextAggregateItem(e,t,i,s,a,r)}},r)}catch(n){r(n)}}_calculateFieldStat(e,t,i){const s=[];for(let a=0;athis._topnum&&(this._wset._known=this._wset._known.slice(0,this._topnum)),this._setKnownLength(this._wset)>=this._topnum&&(this._wset._candidates=[]),this._wset}return this._wset}_setKnownLength(e){return e._known.length>0&&e._known[e._known.length-1]==="GETPAGES"?e._known.length-1:e._known.length}_isInFeatureSet(e){const t=this._parent._isInFeatureSet(e);if(t===I.NotInFeatureSet)return t;const i=this._idstates[e];return i===I.InFeatureSet||i===I.NotInFeatureSet?i:t===I.InFeatureSet&&i===void 0?this._countedinthis._topnum&&(t=this._topnum),this._countedin>=this._topnum&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset){let n=e._known.length;return n>0&&e._known[n-1]==="GETPAGES"&&(e._known.length=n-1),n=e._candidates.length,n>0&&e._candidates[n-1]==="GETPAGES"&&(e._candidates.length=n-1),"success"}const r=await this._parent._expandPagedSet(e,t,i,s,a);return this._setKnownLength(e)>this._topnum&&(e._known.length=this._topnum),this._setKnownLength(e)>=this._topnum&&(e._candidates.length=0),r}async _getFeatures(e,t,i,s){const a=[],r=this._maxQueryRate();if(this._checkIfNeedToExpandKnownPage(e,r)===!0)return await this._expandPagedSet(e,r,0,0,s),this._getFeatures(e,t,i,s);t!==-1&&this._featureCache[t]===void 0&&a.push(t);let n=0;for(let o=e._lastFetchedIndex;or)));o++);if(a.length===0)return"success";const l=new _([],a,!1,null),u=Math.min(a.length,i);await this._parent._getFeatures(l,-1,u,s);for(let o=0;o=this._topnum)break}else if(n===I.NotInFeatureSet)s===null?s={start:r,end:r}:s.end===r-1?s.end=r:(a.push(s),s={start:r,end:r}),i+=1;else if(n===I.Unknown)break;if(i>=t)break}s!==null&&a.push(s);for(let r=a.length-1;r>=0;r--)e._candidates.splice(a[r].start,a[r].end-a[r].start+1);this._setKnownLength(e)>this._topnum&&(e._known=e._known.slice(0,this._topnum)),this._setKnownLength(e)>=this._topnum&&(e._candidates=[])}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}static registerAction(){E._featuresetFunctions.top=function(e){return new le({parentfeatureset:this,topnum:e})}}getFieldsIndex(){return this._parent.getFieldsIndex()}}async function Rt(h,e,t,i){return xt(e,await kt(h,e,t,i),t,i)}async function kt(h,e,t,i){var o;const s={...i},a=Nt(e,t),r=((o=e.outStatistics)==null?void 0:o[0])!=null,n=Me("featurelayer-pbf-statistics"),l=!r||n;let u;if((t==null?void 0:t.format)==="pbf"&&l)try{u=await _t(h,a,s)}catch(d){if(d.name!=="query:parsing-pbf")throw d;t.format="json"}return(t==null?void 0:t.format)!=="json"&&l||(u=await pt(h,a,s)),vt(t==null?void 0:t.fieldsIndex,u.fields),u}function vt(h,e){if(h!=null&&e!=null)for(const t of e){const i=h.get(t.name);i&&Object.assign(t,i.toJSON())}}async function xt(h,e,t,i){var r;const s=t==null?void 0:t.infoFor3D;if(!qe(h,s)||s==null||!e.assetMaps||!((r=e.features)!=null&&r.length))return yt.fromJSON(e);const{meshFeatureSetFromJSON:a}=await We($e(()=>import("./meshFeatureSet-BCixIf_6.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28])),i);return a(h,s,e)}function Nt(h,e){let t=N.from(h);t.sourceSpatialReference=t.sourceSpatialReference??(e==null?void 0:e.sourceSpatialReference)??null,(e!=null&&e.gdbVersion||e!=null&&e.dynamicDataSource)&&(t=t===h?t.clone():t,t.gdbVersion=h.gdbVersion||e.gdbVersion,t.dynamicDataSource=h.dynamicDataSource?Ve.from(h.dynamicDataSource):e.dynamicDataSource);const i=e==null?void 0:e.infoFor3D;if(i!=null&&qe(h,i)){t=t===h?t.clone():t,t.formatOf3DObjects=null;const{supportedFormats:s,queryFormats:a}=i,r=Ie("model/gltf-binary",s)??Ce("glb",s),n=Ie("model/gltf+json",s)??Ce("gtlf",s);for(const l of a){if(l===r){t.formatOf3DObjects=l;break}l!==n||t.formatOf3DObjects||(t.formatOf3DObjects=l)}if(!t.formatOf3DObjects)throw new Qe("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(t.outFields==null||!t.outFields.includes("*")){t=t===h?t.clone():t,t.outFields==null&&(t.outFields=[]);const{originX:l,originY:u,originZ:o,translationX:d,translationY:c,translationZ:f,scaleX:y,scaleY:g,scaleZ:b,rotationX:S,rotationY:p,rotationZ:w,rotationDeg:C}=i.transformFieldRoles;t.outFields.push(l,u,o,d,c,f,y,g,b,S,p,w,C)}}return t}function qe(h,e){return e!=null&&h.returnGeometry===!0&&h.multipatchOption!=="xyFootprint"&&!h.outStatistics}class z extends E{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerDynamic",this._removeGeometry=!1,this._overrideFields=null,this.formulaCredential=null,this._pageJustIds=!1,this._requestStandardised=!1,this._useDefinitionExpression=!0,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,e.outFields!==void 0&&(this._overrideFields=e.outFields),e.includeGeometry!==void 0&&(this._removeGeometry=e.includeGeometry===!1)}_maxQueryRate(){return ne}end(){return this._layer}optimisePagingFeatureQueries(e){this._pageJustIds=e}get urlQueryPath(){return this._layer.parsedUrl.path||""}convertQueryToLruCacheKey(e){const t=this.urlQueryPath+","+Ye(e.toJSON());return xe(t,Ne.String)}async loadImpl(){return this._layer.loaded===!0?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){var e,t,i,s,a,r;if(this.spatialReference==null&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType,this.fields=this._layer.fields.slice(0),this.hasZ=((i=(t=(e=this._layer)==null?void 0:e.capabilities)==null?void 0:t.data)==null?void 0:i.supportsZ)===!0,this.hasM=((r=(a=(s=this._layer)==null?void 0:s.capabilities)==null?void 0:a.data)==null?void 0:r.supportsM)===!0,this._overrideFields!==null)if(this._overrideFields.length===1&&this._overrideFields[0]==="*")this._overrideFields=null;else{const n=[],l=[];for(const u of this.fields)if(u.type==="oid")n.push(u),l.push(u.name);else for(const o of this._overrideFields)if(o.toLowerCase()===u.name.toLowerCase()){n.push(u),l.push(u.name);break}this.fields=n,this._overrideFields=l}if(this._layer.source&&this._layer.source.sourceJSON){const n=this._layer.source.sourceJSON.currentVersion;this._layer.source.sourceJSON.useStandardizedQueries===!0?(this._databaseType=x.StandardisedNoInterval,n!=null&&n>=10.61&&(this._databaseType=x.Standardised)):n!=null&&(n>=10.5&&(this._databaseType=x.StandardisedNoInterval,this._requestStandardised=!0),n>=10.61&&(this._databaseType=x.Standardised))}this.objectIdField=this._layer.objectIdField;for(const n of this.fields)n.type==="global-id"&&(this.globalIdField=n.name);this._layer instanceof Le?(this.subtypeField=this._layer.subtypeField??"",this.subtypes=this._layer.subtypes,this.types=null,this.typeIdField=null):(this.typeIdField=this._layer.typeIdField??"",this.types=this._layer.types,this.subtypeField=this._layer.subtypeField,this.subtypes=this._layer.subtypes)}_isInFeatureSet(){return I.InFeatureSet}async _refineSetBlock(e){return e}_candidateIdTransform(e){return e}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}async _runDatabaseProbe(e){await this._ensureLoaded();const t=new N;this.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t.where=e.replace("OBJECTID",this._layer.objectIdField);try{return await this._layer.queryObjectIds(t),!0}catch{return!1}}_canUsePagination(){return!(!this._layer.capabilities||!this._layer.capabilities.query||this._layer.capabilities.query.supportsPagination!==!0)}_cacheableFeatureSetSourceKey(){return this._layer.url}pbfSupportedForQuery(e){var i,s;const t=(s=(i=this._layer)==null?void 0:i.capabilities)==null?void 0:s.query;return!e.outStatistics&&(t==null?void 0:t.supportsFormatPBF)===!0&&(t==null?void 0:t.supportsQuantizationEditMode)===!0}async queryPBF(e){return e.quantizationParameters={mode:"edit"},(await Rt(this._layer.parsedUrl,e,{format:"pbf"},{})).unquantize()}get gdbVersion(){return this._layer&&this._layer.capabilities&&this._layer.capabilities.data&&this._layer.capabilities.data.isVersioned?this._layer.gdbVersion||"SDE.DEFAULT":""}nativeCapabilities(){return{title:this._layer.title??"",source:this,canQueryRelated:!0,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:this._requestStandardised}}executeQuery(e,t){e.returnZ=this.hasZ,e.returnM=this.hasM;const i=t==="execute"?De:t==="executeForCount"?gt:mt,s=t==="execute"&&this.pbfSupportedForQuery(e);let a=null;if(this.recentlyUsedQueries){const r=this.convertQueryToLruCacheKey(e);a=this.recentlyUsedQueries.getFromCache(r),a===null&&(a=s!==!0?i(this._layer.parsedUrl.path,e):this.queryPBF(e),this.recentlyUsedQueries.addToCache(r,a),a=a.catch(n=>{var l;throw(l=this.recentlyUsedQueries)==null||l.removeFromCache(r),n}))}return this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:e,method:t}),a===null&&(a=s!==!0?i(this._layer.parsedUrl.path,e):this.queryPBF(e)),a}async _getFilteredSet(e,t,i,s,a){const r=await this.databaseType();if(this.isTable()&&t&&e!==null&&e!=="")return new _([],[],!0,null);if(this._canUsePagination())return this._getFilteredSetUsingPaging(e,t,i,s,a);let n="",l=!1;s!==null&&this._layer.capabilities&&this._layer.capabilities.query&&this._layer.capabilities.query.supportsOrderBy===!0&&(n=s.constructClause(),l=!0);const u=new N;this.datesInUnknownTimezone&&(u.timeReferenceUnknownClient=!0),u.where=i===null?t===null?"1=1":"":k(i,r),this._requestStandardised&&(u.sqlFormat="standard"),u.spatialRelationship=this._makeRelationshipEnum(e),u.outSpatialReference=this.spatialReference,u.orderByFields=n!==""?n.split(","):null,u.geometry=t===null?null:t,u.relationParameter=this._makeRelationshipParam(e);let o=await this.executeQuery(u,"executeForIds");return o===null&&(o=[]),this._checkCancelled(a),new _([],o,l,null)}_expandPagedSet(e,t,i,s,a){return this._expandPagedSetFeatureSet(e,t,i,s,a)}async _getFilteredSetUsingPaging(e,t,i,s,a){var f;let r="",n=!1;s!==null&&this._layer.capabilities&&this._layer.capabilities.query&&this._layer.capabilities.query.supportsOrderBy===!0&&(r=s.constructClause(),n=!0);const l=await this.databaseType();let u=i===null?t===null?"1=1":"":k(i,l);this._layer.definitionExpression&&this._useDefinitionExpression&&(u=u!==""?"(("+this._layer.definitionExpression+") AND ("+u+"))":this._layer.definitionExpression);let o=this._maxQueryRate();const d=(f=this._layer.capabilities)==null?void 0:f.query.maxRecordCount;d!=null&&d=this._maxProcessingRate()-1))break}if(r>=i&&a.length===0)break}if(a.length===0)return"success";const n=new N;this._requestStandardised&&(n.sqlFormat="standard"),this.datesInUnknownTimezone&&(n.timeReferenceUnknownClient=!0),n.objectIds=a,n.outFields=this._overrideFields??this._fieldsIncludingObjectId(["*"]),n.returnGeometry=!0,this._removeGeometry===!0&&(n.returnGeometry=!1),n.outSpatialReference=this.spatialReference;const l=await this.executeQuery(n,"execute");if(this._checkCancelled(s),l.error!==void 0)throw new D(T.RequestFailed,{reason:l.error});const u=this._layer.objectIdField;for(let o=0;o=n)break}return g.features.length===0?l:g.features.length===((S=this._layer.capabilities)==null?void 0:S.query.maxRecordCount)&&l.length"+e.pagesDefinition.internal.lastMaxId.toString()+")":e.pagesDefinition.generatedOid+">"+e.pagesDefinition.internal.lastMaxId.toString());const a=e.pagesDefinition.internal.lastRetrieved,r=a,n=e.pagesDefinition.internal.lastPage,l=new N;if(this._requestStandardised&&(l.sqlFormat="standard"),l.where=s,l.spatialRelationship=e.pagesDefinition.spatialRel,l.relationParameter=e.pagesDefinition.relationParam,l.outFields=e.pagesDefinition.outFields,l.outStatistics=e.pagesDefinition.outStatistics,l.geometry=e.pagesDefinition.geometry,l.groupByFieldsForStatistics=e.pagesDefinition.groupByFieldsForStatistics,l.num=e.pagesDefinition.resultRecordCount,l.start=e.pagesDefinition.internal.lastPage,l.returnGeometry=e.pagesDefinition.returnGeometry,this.datesInUnknownTimezone&&(l.timeReferenceUnknownClient=!0),l.orderByFields=e.pagesDefinition.orderByFields!==""?e.pagesDefinition.orderByFields.split(","):null,this.isTable()&&l.geometry&&l.spatialRelationship)return[];const u=await this.executeQuery(l,"execute");if(this._checkCancelled(i),!u.hasOwnProperty("features"))throw new D(T.InvalidStatResponse);const o=[];if(e.pagesDefinition.internal.lastPage!==n)return[];u.features.length>0&&u.features[0].attributes[e.pagesDefinition.generatedOid]===void 0&&(e.pagesDefinition.generatedOid=e.pagesDefinition.generatedOid.toLowerCase());for(let d=0;d0||i&&i>0)&&(n.size=[t&&t>0?t:0,i&&i>0?i:t+1]),s&&s.length>0&&(n.attachmentTypes=s),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:n,method:"attachments"});const l=await this._layer.queryAttachments(n),u=[];return l&&l[e]&&l[e].forEach(o=>{const d=this._layer.parsedUrl.path+"/"+e.toString()+"/attachments/"+o.id.toString();let c=null;a&&o.exifInfo&&(c=He.convertJsonToArcade(o.exifInfo,"system",!0)),u.push(new et(o.id,o.name,o.contentType,o.size,d,c,o.keywords??null))}),u}return[]}async queryRelatedFeatures(e){var s;const t={f:"json",relationshipId:e.relationshipId.toString(),definitionExpression:e.where,outFields:(s=e.outFields)==null?void 0:s.join(","),returnGeometry:e.returnGeometry.toString()};e.resultOffset!==void 0&&e.resultOffset!==null&&(t.resultOffset=e.resultOffset.toString()),e.resultRecordCount!==void 0&&e.resultRecordCount!==null&&(t.resultRecordCount=e.resultRecordCount.toString()),e.orderByFields&&(t.orderByFields=e.orderByFields.join(",")),e.objectIds&&e.objectIds.length>0&&(t.objectIds=e.objectIds.join(",")),e.outSpatialReference&&(t.outSR=Ze(e.outSpatialReference)),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preRequestCallback({layer:this._layer,queryPayload:t,method:"relatedrecords",url:this._layer.parsedUrl.path+"/queryRelatedRecords"});const i=await B(this._layer.parsedUrl.path+"/queryRelatedRecords",{responseType:"json",query:t});if(i.data){const a={},r=i.data;if(r!=null&&r.relatedRecordGroups){const n=r.spatialReference;for(const l of r.relatedRecordGroups){const u=l.objectId,o=[];for(const d of l.relatedRecords){d.geometry&&(d.geometry.spatialReference=n);const c=new G({geometry:d.geometry?ze(d.geometry):null,attributes:d.attributes});o.push(c)}a[u]={features:o,exceededTransferLimit:r.exceededTransferLimit===!0}}}return a}throw new D(T.InvalidRequest)}async getFeatureByObjectId(e,t){const i=new N;i.outFields=t,i.returnGeometry=!1,i.outSpatialReference=this.spatialReference,i.where=this.objectIdField+"="+e.toString(),this.datesInUnknownTimezone&&(i.timeReferenceUnknownClient=!0),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:i,method:"execute"});const s=await De(this._layer.parsedUrl.path,i);return s.features.length===1?s.features[0]:null}async getIdentityUser(){var t;await this.load();const e=(t=pe)==null?void 0:t.findCredential(this._layer.url);return e?e.userId:null}async getOwningSystemUrl(){var s,a;await this.load();const e=(s=pe)==null?void 0:s.findServerInfo(this._layer.url);if(e)return e.owningSystemUrl;let t=this._layer.url;const i=t.toLowerCase().indexOf("/rest/services");if(t=i>-1?t.substring(0,i):t,t){t+="/rest/info";try{const r=await B(t,{query:{f:"json"}});let n="";return(a=r.data)!=null&&a.owningSystemUrl&&(n=r.data.owningSystemUrl),n}catch{return""}}return""}getDataSourceFeatureSet(){const e=new z({layer:this._layer,spatialReference:this.spatialReference??void 0,outFields:this._overrideFields??void 0,includeGeometry:!this._removeGeometry,lrucache:this.recentlyUsedQueries??void 0,interceptor:this.featureSetQueryInterceptor??void 0});return e._useDefinitionExpression=!1,e}get preferredTimeZone(){return this._layer.preferredTimeZone??null}get dateFieldsTimeZone(){return this._layer.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._layer.datesInUnknownTimezone}get editFieldsInfo(){return this._layer.editFieldsInfo??null}get timeInfo(){return this._layer.timeInfo??null}async getFeatureSetInfo(){var a,r;if(this.fsetInfo)return this.fsetInfo;let e=null,{parsedUrl:{path:t},serviceItemId:i=null}=this._layer;if(t){const n=await B(t,{responseType:"json",query:{f:"json"}});e=((a=n==null?void 0:n.data)==null?void 0:a.name)??null,i=((r=n==null?void 0:n.data)==null?void 0:r.serviceItemId)??null}const s=this._layer.title&&(this._layer.parent??null)!==null;return this.featureSetInfo={layerId:this._layer.layerId,layerName:e===""?null:e,itemId:i===""?null:i,serviceLayerUrl:t===""?null:t,webMapLayerId:s?this._layer.id??null:null,webMapLayerTitle:s?this._layer.title??null:null,className:null,objectClassId:null},this.fsetInfo}}class oe extends E{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerMemory",this._removeGeometry=!1,this._overrideFields=null,this._forceIsTable=!1,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,e.isTable===!0&&(this._forceIsTable=!0),e.outFields!==void 0&&(this._overrideFields=e.outFields),e.includeGeometry!==void 0&&(this._removeGeometry=e.includeGeometry===!1)}_maxQueryRate(){return ne}end(){return this._layer}optimisePagingFeatureQueries(){}async loadImpl(){return this._layer.loaded===!0?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}get gdbVersion(){return""}_initialiseFeatureSet(){var e,t,i,s,a,r;if(this.spatialReference==null&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType,this.fields=this._layer.fields.slice(0),this._overrideFields!==null)if(this._overrideFields.length===1&&this._overrideFields[0]==="*")this._overrideFields=null;else{const n=[],l=[];for(const u of this.fields)if(u.type==="oid")n.push(u),l.push(u.name);else for(const o of this._overrideFields)if(o.toLowerCase()===u.name.toLowerCase()){n.push(u),l.push(u.name);break}this.fields=n,this._overrideFields=l}this.objectIdField=this._layer.objectIdField;for(const n of this.fields)n.type==="global-id"&&(this.globalIdField=n.name);this._databaseType=x.Standardised,this.hasZ=((i=(t=(e=this._layer)==null?void 0:e.capabilities)==null?void 0:t.data)==null?void 0:i.supportsZ)===!0,this.hasM=((r=(a=(s=this._layer)==null?void 0:s.capabilities)==null?void 0:a.data)==null?void 0:r.supportsM)===!0,this._layer instanceof Le?(this.subtypeField=this._layer.subtypeField??"",this.subtypes=this._layer.subtypes,this.types=null,this.typeIdField=null):(this.typeIdField=this._layer.typeIdField??"",this.types=this._layer.types,this.subtypeField=this._layer.subtypeField,this.subtypes=this._layer.subtypes)}isTable(){return this._forceIsTable||this._layer.isTable||this._layer.type==="table"||!this._layer.geometryType}_isInFeatureSet(){return I.InFeatureSet}_candidateIdTransform(e){return e}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}_changeFeature(e){const t={};for(const i of this.fields)t[i.name]=e.attributes[i.name];return new G({geometry:this._removeGeometry===!0?null:e.geometry,attributes:t})}async _getFilteredSet(e,t,i,s,a){let r="",n=!1;if(s!==null&&(r=s.constructClause(),n=!0),this.isTable()&&t&&e!==null&&e!=="")return new _([],[],!0,null);const l=new N;l.returnZ=this.hasZ,l.returnM=this.hasM,l.where=i===null?t===null?"1=1":"":k(i,x.Standardised),l.spatialRelationship=this._makeRelationshipEnum(e),l.outSpatialReference=this.spatialReference,l.orderByFields=r!==""?r.split(","):null,l.geometry=t===null?null:t,l.returnGeometry=!0,l.relationParameter=this._makeRelationshipParam(e);const u=await this._layer.queryFeatures(l);if(u===null)return new _([],[],n,null);this._checkCancelled(a);const o=[];return u.features.forEach(d=>{const c=d.attributes[this._layer.objectIdField];o.push(c),this._featureCache[c]=this._changeFeature(d)}),new _([],o,n,null)}_makeRelationshipEnum(e){if(e.includes("esriSpatialRelRelation"))return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e}_makeRelationshipParam(e){return e.includes("esriSpatialRelRelation")?e.split(":")[1]:""}async _queryAllFeatures(){if(this._wset)return this._wset;const e=new N;if(e.where="1=1",await this._ensureLoaded(),this._layer.source&&this._layer.source.items){const s=[];return this._layer.source.items.forEach(a=>{const r=a.attributes[this._layer.objectIdField];s.push(r),this._featureCache[r]=this._changeFeature(a)}),this._wset=new _([],s,!1,null),this._wset}e.returnZ=this.hasZ,e.returnM=this.hasM;const t=await this._layer.queryFeatures(e),i=[];return t.features.forEach(s=>{const a=s.attributes[this._layer.objectIdField];i.push(a),this._featureCache[a]=this._changeFeature(s)}),this._wset=new _([],i,!1,null),this._wset}async _getFeatures(e,t,i){const s=[];t!==-1&&this._featureCache[t]===void 0&&s.push(t);for(let a=e._lastFetchedIndex;ai)));a++);if(s.length===0)return"success";throw new D(T.MissingFeatures)}async _refineSetBlock(e){return e}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}relationshipMetaData(){return[]}static _cloneAttr(e){const t={};for(const i in e)t[i]=e[i];return t}nativeCapabilities(){return{title:this._layer.title??"",canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}}static create(e,t){var y,g,b,S,p,w;let i=e.layerDefinition.objectIdField;const s=e.layerDefinition.typeIdField??"",a=[];if(e.layerDefinition.types)for(const C of e.layerDefinition.types)a.push(wt.fromJSON(C));let r=e.layerDefinition.geometryType;r===void 0&&(r=e.featureSet.geometryType||"");let n=e.featureSet.features;const l=t.toJSON();if(!i){let C=!1;for(const P of e.layerDefinition.fields)if(P.type==="oid"||P.type==="esriFieldTypeOID"){i=P.name,C=!0;break}if(C===!1){let P="FID",he=!0,ce=0;for(;he;){let q=!0;for(const Ge of e.layerDefinition.fields)if(Ge.name===P){q=!1;break}q===!0?he=!1:(ce++,P="FID"+ce.toString())}e.layerDefinition.fields.push({type:"esriFieldTypeOID",name:P,alias:P});const K=[];for(let q=0;qw.name):["*"]);u.outFields=o,u.relationshipId=this.relationship.id,u.where="1=1";let d=!0;this._removeGeometry===!0&&(d=!1),u.returnGeometry=d,this._requestStandardised&&(u.sqlFormat="standard"),u.outSpatialReference=this.spatialReference,u.orderByFields=n!==""?n.split(","):null;const c=await r.source.queryRelatedFeatures(u);this._checkCancelled(a);const f=c[this._findObjectId]?c[this._findObjectId].features:[],y=[];for(let w=0;ww.name):["*"]);return y=new _(c||f?["GETPAGES"]:[],c||f?[]:["GETPAGES"],n,{outFields:b.join(","),resultRecordCount:o,resultOffset:0,objectIds:[this._findObjectId],where:u,orderByFields:r,returnGeometry:g,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}}),await this._expandPagedSet(y,o,0,0,a),y}_expandPagedSet(e,t,i,s,a){return this._expandPagedSetFeatureSet(e,t,i,s,a)}_clonePageDefinition(e){return e===null?null:e.groupbypage!==!0?{groupbypage:!1,outFields:e.outFields,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}:{groupbypage:!0,outFields:e.outFields,resultRecordCount:e.resultRecordCount,useOIDpagination:e.useOIDpagination,generatedOid:e.generatedOid,groupByFieldsForStatistics:e.groupByFieldsForStatistics,resultOffset:e.resultOffset,outStatistics:e.outStatistics,geometry:e.geometry,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}}async _getPhysicalPage(e,t,i){const s=e.pagesDefinition.internal.lastRetrieved,a=s,r=e.pagesDefinition.internal.lastPage,n=this._layer.nativeCapabilities(),l=new Te;this._requestStandardised===!0&&(l.sqlFormat="standard"),l.relationshipId=this.relationship.id,l.objectIds=e.pagesDefinition.objectIds,l.resultOffset=e.pagesDefinition.internal.lastPage,l.resultRecordCount=e.pagesDefinition.resultRecordCount,l.outFields=e.pagesDefinition.outFields.split(","),l.where=e.pagesDefinition.where,l.orderByFields=e.pagesDefinition.orderByFields!==""?e.pagesDefinition.orderByFields.split(","):null,l.returnGeometry=e.pagesDefinition.returnGeometry,l.outSpatialReference=this.spatialReference;const u=await n.source.queryRelatedFeatures(l);if(this._checkCancelled(i),e.pagesDefinition.internal.lastPage!==r)return 0;const o=u[this._findObjectId]?u[this._findObjectId].features:[];for(let c=0;ci)))&&!(n>=i&&a.length===0);l++);if(a.length===0)return"success";throw new D(T.MissingFeatures)}async _refineSetBlock(e,t,i){return e}async _stat(e,t,i,s,a,r,n){return{calculated:!1}}get gdbVersion(){return this._relatedLayer.gdbVersion}async _canDoAggregates(e,t,i,s,a){return!1}relationshipMetaData(){return this._relatedLayer.relationshipMetaData()}serviceUrl(){return this._relatedLayer.serviceUrl()}queryAttachments(e,t,i,s,a){return this._relatedLayer.queryAttachments(e,t,i,s,a)}getFeatureByObjectId(e,t){return this._relatedLayer.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._relatedLayer.getOwningSystemUrl()}getIdentityUser(){return this._relatedLayer.getIdentityUser()}getDataSourceFeatureSet(){return this._relatedLayer}get preferredTimeZone(){var e;return((e=this._relatedLayer)==null?void 0:e.preferredTimeZone)??null}get dateFieldsTimeZone(){var e;return((e=this._relatedLayer)==null?void 0:e.dateFieldsTimeZone)??null}get datesInUnknownTimezone(){var e;return(e=this._relatedLayer)==null?void 0:e.datesInUnknownTimezone}get editFieldsInfo(){var e;return((e=this._relatedLayer)==null?void 0:e.editFieldsInfo)??null}get timeInfo(){var e;return((e=this._relatedLayer)==null?void 0:e.timeInfo)??null}async getFeatureSetInfo(){return this.fsetInfo??this._layer.featureSetInfo}}function At(){m.applicationCache===null&&(m.applicationCache=new m)}async function se(h,e){if(m.applicationCache){const t=m.applicationCache.getLayerInfo(h);if(t){const a=await t;return new v({url:h,outFields:e,sourceJSON:a})}const i=new v({url:h,outFields:e}),s=(async()=>(await i.load(),i.sourceJSON))();if(m.applicationCache){m.applicationCache.setLayerInfo(h,s);try{return await s,i}catch(a){throw m.applicationCache.clearLayerInfo(h),a}}return await s,i}return new v({url:h,outFields:e})}async function ue(h,e,t,i,s,a=null){return O(await se(h,["*"]),e,t,i,s,a)}function O(h,e=null,t=null,i=!0,s=null,a=null){if(h instanceof v||V(h)){const n={layer:h,spatialReference:e,outFields:t,includeGeometry:i,lrucache:s,interceptor:a};return h.url||!h.source?new z(n):new oe(n)}const r=O(h.parent,e,t,i,s,a);return r.filter(R.create(h.parent.subtypeField+"="+h.subtypeCode.toString(),h.parent.fieldsIndex,r.dateFieldsTimeZoneDefaultUTC))}async function Ot(h){if(m.applicationCache!==null){const t=m.applicationCache.getLayerInfo(h);if(t!==null)return t}const e=(async()=>{const t=await B(h,{responseType:"json",query:{f:"json"}});return t.data?t.data:null})();if(m.applicationCache!==null){m.applicationCache.setLayerInfo(h,e);try{return await e}catch(t){throw m.applicationCache.clearLayerInfo(h),t}}return e}async function Et(h,e){const t="QUERYDATAELEMTS:"+e.toString()+":"+h;if(m.applicationCache!==null){const s=m.applicationCache.getLayerInfo(t);if(s!==null)return s}const i=(async()=>{var a;const s=await B(h+"/queryDataElements",{method:"post",responseType:"json",query:{layers:JSON.stringify([e.toString()]),f:"json"}});if(s.data){const r=s.data;if((a=r.layerDataElements)!=null&&a[0])return r.layerDataElements[0]}throw new D(T.DataElementsNotFound)})();if(m.applicationCache!==null){m.applicationCache.setLayerInfo(t,i);try{return await i}catch(s){throw m.applicationCache.clearLayerInfo(t),s}}return i}async function je(h){if(m.applicationCache!==null){const t=m.applicationCache.getLayerInfo(h);if(t!==null)return t}const e=(async()=>{const t=await B(h,{responseType:"json",query:{f:"json"}});if(t.data){const i=t.data;return i.layers||(i.layers=[]),i.tables||(i.tables=[]),i}return{layers:[],tables:[]}})();if(m.applicationCache!==null){m.applicationCache.setLayerInfo(h,e);try{return await e}catch(t){throw m.applicationCache.clearLayerInfo(h),t}}return e}async function Pt(h,e){var s,a,r;const t={metadata:null,networkId:-1,unVersion:3,terminals:[],queryelem:null,layerNameLkp:{},lkp:null},i=await je(h);if(t.metadata=i,((s=i.controllerDatasetLayers)==null?void 0:s.utilityNetworkLayerId)!==void 0&&i.controllerDatasetLayers.utilityNetworkLayerId!==null){if(i.layers)for(const u of i.layers)t.layerNameLkp[u.id]=u.name;if(i.tables)for(const u of i.tables)t.layerNameLkp[u.id]=u.name;const n=i.controllerDatasetLayers.utilityNetworkLayerId;t.networkId=n;const l=await Et(h,n);if(l){t.queryelem=l,(a=t.queryelem)!=null&&a.dataElement&&t.queryelem.dataElement.schemaGeneration!==void 0&&(t.unVersion=t.queryelem.dataElement.schemaGeneration),t.lkp={},t.queryelem.dataElement.domainNetworks||(t.queryelem.dataElement.domainNetworks=[]);for(const o of t.queryelem.dataElement.domainNetworks){for(const d of o.edgeSources??[]){const c={layerId:d.layerId,sourceId:d.sourceId,className:t.layerNameLkp[d.layerId]??null};c.className&&(t.lkp[c.className]=c)}for(const d of o.junctionSources??[]){const c={layerId:d.layerId,sourceId:d.sourceId,className:t.layerNameLkp[d.layerId]??null};c.className&&(t.lkp[c.className]=c)}}if(t.queryelem.dataElement.terminalConfigurations)for(const o of t.queryelem.dataElement.terminalConfigurations)for(const d of o.terminals)t.terminals.push({terminalId:d.terminalId,terminalName:d.terminalName});const u=await Ot(h+"/"+n);if(((r=u.systemLayers)==null?void 0:r.associationsTableId)!==void 0&&u.systemLayers.associationsTableId!==null){const o=[];t.unVersion>=4&&(o.push("STATUS"),o.push("PERCENTALONG"));let d=await ue(h+"/"+u.systemLayers.associationsTableId.toString(),e,["OBJECTID","FROMNETWORKSOURCEID","TONETWORKSOURCEID","FROMGLOBALID","TOGLOBALID","TOTERMINALID","FROMTERMINALID","ASSOCIATIONTYPE","ISCONTENTVISIBLE","GLOBALID",...o],!1,null,null);return await d.load(),t.unVersion>=4&&(d=d.filter(R.create("STATUS NOT IN (1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63)",d.getFieldsIndex(),d.dateFieldsTimeZoneDefaultUTC)),await d.load()),{lkp:t.lkp,associations:d,unVersion:t.unVersion,terminals:t.terminals}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}async function qt(h,e,t,i=null,s=null,a=!0,r=null,n=null){let l=h.serviceUrl();if(!l)return null;l=l.charAt(l.length-1)==="/"?l+e.relatedTableId.toString():l+"/"+e.relatedTableId.toString();const u=await ue(l,i,s,a,r,n);return new Lt({layer:h,relatedLayer:u,relationship:e,objectId:t,spatialReference:i,outFields:s,includeGeometry:a,lrucache:r,interceptor:n})}Oe.registerAction(),Tt.registerAction(),te.registerAction(),ut.registerAction(),le.registerAction();class jt extends Ae{constructor(e,t=null,i=null,s=null){super(),this._map=e,this._overridespref=t,this._lrucache=i,this._interceptor=s,this._instantLayers=[]}_makeAndAddFeatureSet(e,t=!0,i=null){const s=O(e,this._overridespref,i===null?["*"]:i,t,this._lrucache,this._interceptor);return this._instantLayers.push({featureset:s,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),s}async featureSetByName(e,t=!0,i=null){if(this._map.loaded!==void 0&&this._map.load!==void 0&&this._map.loaded===!1)return await this._map.load(),this.featureSetByName(e,t,i);i===null&&(i=["*"]),i=(i=i.slice(0)).sort();const s=JSON.stringify(i);for(let r=0;r{if(r instanceof v){if(r.title===e)return!0}else if(V(r)&&r.title===e)return!0;return!1});if(a)return this._makeAndAddFeatureSet(a,t,i);if(this._map.tables){const r=this._map.tables.find(n=>!!(n.title&&n.title===e||n.title&&n.title===e));if(r){if(r instanceof v)return this._makeAndAddFeatureSet(r,t,i);if(!r._materializedTable){const n=r.outFields?r:{...r,outFields:["*"]};r._materializedTable=new v(n)}return await r._materializedTable.load(),this._makeAndAddFeatureSet(r._materializedTable,t,i)}}return null}async featureSetById(e,t=!0,i=["*"]){if(this._map.loaded!==void 0&&this._map.load!==void 0&&this._map.loaded===!1)return await this._map.load(),this.featureSetById(e,t,i);i===null&&(i=["*"]),i=(i=i.slice(0)).sort();const s=JSON.stringify(i);for(let r=0;r{if(r instanceof v){if(r.id===e)return!0}else if(V(r)&&r.id===e)return!0;return!1});if(a)return this._makeAndAddFeatureSet(a,t,i);if(this._map.tables){const r=this._map.tables.find(n=>n.id===e);if(r){if(r instanceof v)return this._makeAndAddFeatureSet(r,t,i);if(!r._materializedTable){const n={...r,outFields:["*"]};r._materializedTable=new v(n)}return await r._materializedTable.load(),this._makeAndAddFeatureSet(r._materializedTable,t,i)}}return null}}class de extends Ae{constructor(e,t=null,i=null,s=null){super(),this._url=e,this._overridespref=t,this._lrucache=i,this._interceptor=s,this.metadata=null,this._instantLayers=[]}get url(){return this._url}_makeAndAddFeatureSet(e,t=!0,i=null){const s=O(e,this._overridespref,i===null?["*"]:i,t,this._lrucache);return this._instantLayers.push({featureset:s,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),s}async _loadMetaData(){const e=await je(this._url);return this.metadata=e,e}load(){return this._loadMetaData()}clone(){return new de(this._url,this._overridespref,this._lrucache,this._interceptor)}async featureSetByName(e,t=!0,i=null){i===null&&(i=["*"]),i=(i=i.slice(0)).sort();const s=JSON.stringify(i);for(let n=0;n0){const F=[];for(let t=0;t{var u,y;if(E(e,1,2,n,a),De(e[0])||X(e[0]))return"Unknown";if(A(e[0])){if(await e[0].load(),e.length===1||e[1]===null)return e[0].datesInUnknownTimezone?z("unknown"):z(e[0].dateFieldsTimeZone);if(!(e[1]instanceof v)||e[1].hasField("type")===!1)throw new m(n,p.InvalidParameter,a);const o=e[1].field("type");if(P(o)===!1)throw new m(n,p.InvalidParameter,a);switch(x(o).toLowerCase()){case"preferredtimezone":return z(e[0].preferredTimeZone);case"editfieldsinfo":return z(((u=e[0].editFieldsInfo)==null?void 0:u.timeZone)??null);case"timeinfo":return z(((y=e[0].timeInfo)==null?void 0:y.timeZone)??null);case"field":if(e[1].hasField("fieldname")&&P(e[1].field("fieldname")))return z(e[0].fieldTimeZone(x(e[1].field("fieldname"))))}throw new m(n,p.InvalidParameter,a)}const t=Te(e[0],ue(n));if(t===null)return null;const r=t.timeZone;return r==="system"?Ie.systemTimeZoneCanonicalName:r.toLowerCase()==="utc"?"UTC":r.toLowerCase()==="unknown"?"Unknown":r})},s.functions.sqltimestamp=function(n,a){return s.standardFunctionAsync(n,a,async(c,F,e)=>{E(e,1,3,n,a);const t=e[0];if(de(t)){if(e.length===1)return t.toSQLWithKeyword();if(e.length===2)return t.changeTimeZone(x(e[1])).toSQLWithKeyword();throw new m(n,p.InvalidParameter,a)}if(X(t))return t.toSQLWithKeyword();if(A(t)){if(e.length!==3)throw new m(n,p.InvalidParameter,a);await t.load();const r=x(e[1]);if(X(e[2]))return e[2].toSQLWithKeyword();if(de(e[2])===!1)throw new m(n,p.InvalidParameter,a);const u=t.fieldTimeZone(r);return u===null?e[2].toSQLWithKeyword():e[2].changeTimeZone(u).toSQLWithKeyword()}throw new m(n,p.InvalidParameter,a)})},s.signatures.push({name:"sqltimestamp",min:2,max:4}),s.functions.featuresetbyid=function(n,a){return s.standardFunctionAsync(n,a,(c,F,e)=>{if(E(e,2,4,n,a),e[0]instanceof ce){const t=x(e[1]);let r=L(e[2],null);const u=M(L(e[3],!0));if(r===null&&(r=["*"]),N(r)===!1)throw new m(n,p.InvalidParameter,a);return e[0].featureSetById(t,u,r)}throw new m(n,p.InvalidParameter,a)})},s.signatures.push({name:"featuresetbyid",min:2,max:4}),s.functions.getfeatureset=function(n,a){return s.standardFunctionAsync(n,a,(c,F,e)=>{if(E(e,1,2,n,a),G(e[0])){let t=L(e[1],"datasource");return t===null&&(t="datasource"),t=x(t).toLowerCase(),Se(e[0].fullSchema(),t,n.lrucache,n.interceptor,n.spatialReference)}throw new m(n,p.InvalidParameter,a)})},s.signatures.push({name:"getfeatureset",min:1,max:2}),s.functions.featuresetbyportalitem=function(n,a){return s.standardFunctionAsync(n,a,(c,F,e)=>{var o,i;if(E(e,2,5,n,a),e[0]===null)throw new m(n,p.PortalRequired,a);if(e[0]instanceof be){const l=x(e[1]),f=x(e[2]);let I=L(e[3],null);const D=M(L(e[4],!0));if(I===null&&(I=["*"]),N(I)===!1)throw new m(n,p.InvalidParameter,a);let w=null;return w=(o=n.services)!=null&&o.portal?n.services.portal:ye.getDefault(),w=Me(e[0],w),me(l,f,n.spatialReference,I,D,w,n.lrucache,n.interceptor)}if(P(e[0])===!1)throw new m(n,p.PortalRequired,a);const t=x(e[0]),r=x(e[1]);let u=L(e[2],null);const y=M(L(e[3],!0));if(u===null&&(u=["*"]),N(u)===!1)throw new m(n,p.InvalidParameter,a);return me(t,r,n.spatialReference,u,y,((i=n.services)==null?void 0:i.portal)??ye.getDefault(),n.lrucache,n.interceptor)})},s.signatures.push({name:"featuresetbyportalitem",min:2,max:5}),s.functions.featuresetbyname=function(n,a){return s.standardFunctionAsync(n,a,(c,F,e)=>{if(E(e,2,4,n,a),e[0]instanceof ce){const t=x(e[1]);let r=L(e[2],null);const u=M(L(e[3],!0));if(r===null&&(r=["*"]),N(r)===!1)throw new m(n,p.InvalidParameter,a);return e[0].featureSetByName(t,u,r)}throw new m(n,p.InvalidParameter,a)})},s.signatures.push({name:"featuresetbyname",min:2,max:4}),s.functions.featureset=function(n,a){return s.standardFunction(n,a,(c,F,e)=>{E(e,1,1,n,a);let t=e[0];const r={layerDefinition:{geometryType:"",objectIdField:"",hasM:!1,hasZ:!1,globalIdField:"",typeIdField:"",fields:[]},featureSet:{geometryType:"",features:[]}};if(P(t))t=JSON.parse(t),t.layerDefinition!==void 0?(r.layerDefinition=t.layerDefinition,r.featureSet=t.featureSet,t.layerDefinition.spatialReference&&(r.layerDefinition.spatialReference=t.layerDefinition.spatialReference)):(r.featureSet.features=t.features,r.featureSet.geometryType=t.geometryType,r.layerDefinition.geometryType=r.featureSet.geometryType,r.layerDefinition.objectIdField=t.objectIdFieldName??"",r.layerDefinition.typeIdField=t.typeIdFieldName,r.layerDefinition.globalIdField=t.globalIdFieldName,r.layerDefinition.fields=t.fields,t.spatialReference&&(r.layerDefinition.spatialReference=t.spatialReference));else{if(!(e[0]instanceof v))throw new m(n,p.InvalidParameter,a);{t=JSON.parse(e[0].castToText(!0));const u=d(t,"layerdefinition");if(u!==null){r.layerDefinition.geometryType=d(u,"geometrytype",""),r.featureSet.geometryType=r.layerDefinition.geometryType,r.layerDefinition.globalIdField=d(u,"globalidfield",""),r.layerDefinition.objectIdField=d(u,"objectidfield",""),r.layerDefinition.typeIdField=d(u,"typeidfield",""),r.layerDefinition.hasZ=d(u,"hasz",!1)===!0,r.layerDefinition.hasM=d(u,"hasm",!1)===!0;const y=d(u,"spatialreference",null);y&&(r.layerDefinition.spatialReference=ae(y));for(const i of d(u,"fields",[])){const l={name:d(i,"name",""),alias:d(i,"alias",""),type:d(i,"type",""),nullable:d(i,"nullable",!0),editable:d(i,"editable",!0),length:d(i,"length",null),domain:we(d(i,"domain"))};r.layerDefinition.fields.push(l)}const o=d(t,"featureset",null);if(o){const i={};for(const l of r.layerDefinition.fields)i[l.name.toLowerCase()]=l.name;for(const l of d(o,"features",[])){const f={},I=d(l,"attributes",{});for(const D in I)f[i[D.toLowerCase()]]=I[D];r.featureSet.features.push({attributes:f,geometry:he(d(l,"geometry",null))})}}}else{r.layerDefinition.hasZ=d(t,"hasz",!1)===!0,r.layerDefinition.hasM=d(t,"hasm",!1)===!0,r.layerDefinition.geometryType=d(t,"geometrytype",""),r.featureSet.geometryType=r.layerDefinition.geometryType,r.layerDefinition.objectIdField=d(t,"objectidfieldname",""),r.layerDefinition.typeIdField=d(t,"typeidfieldname","");const y=d(t,"spatialreference",null);y&&(r.layerDefinition.spatialReference=ae(y));let o=d(t,"fields",null);if(N(o))for(const f of o){const I={name:d(f,"name",""),alias:d(f,"alias",""),type:d(f,"type",""),nullable:d(f,"nullable",!0),editable:d(f,"editable",!0),length:d(f,"length",null),domain:we(d(f,"domain"))};r.layerDefinition.fields.push(I)}else o=null,r.layerDefinition.fields=o;const i={};for(const f of r.layerDefinition.fields)i[f.name.toLowerCase()]=f.name;let l=d(t,"features",null);if(N(l))for(const f of l){const I={},D=d(f,"attributes",{});for(const w in D)I[i[w.toLowerCase()]]=D[w];r.featureSet.features.push({attributes:I,geometry:he(d(f,"geometry",null))})}else l=null,r.featureSet.features=l}}}if(je(r)===!1)throw new m(n,p.InvalidParameter,a);return r.layerDefinition.geometryType||(r.layerDefinition.geometryType="esriGeometryNull"),Le.create(r,n.spatialReference)})},s.signatures.push({name:"featureset",min:1,max:1}),s.functions.filter=function(n,a){return s.standardFunctionAsync(n,a,async(c,F,e)=>{if(E(e,2,2,n,a),N(e[0])||R(e[0])){const t=[];let r=e[0];r instanceof Re&&(r=r.toArray());let u=null;if(!Ee(e[1]))throw new m(n,p.InvalidParameter,a);u=e[1].createFunction(n);for(const y of r){const o=u(y);ze(o)?await o===!0&&t.push(y):o===!0&&t.push(y)}return t}if(A(e[0])){const t=await e[0].load(),r=T.create(e[1],t.getFieldsIndex(),t.dateFieldsTimeZoneDefaultUTC),u=r.getVariables();if(u.length>0){const y=[];for(let i=0;i{if(E(e,2,2,n,a),A(e[0])){const t=new Ce(e[1]);return new ve({parentfeatureset:e[0],orderbyclause:t})}throw new m(n,p.InvalidParameter,a)})},s.signatures.push({name:"orderby",min:2,max:2}),s.functions.top=function(n,a){return s.standardFunctionAsync(n,a,async(c,F,e)=>{if(E(e,2,2,n,a),A(e[0]))return new Pe({parentfeatureset:e[0],topnum:e[1]});if(N(e[0]))return O(e[1])>=e[0].length?e[0].slice(0):e[0].slice(0,O(e[1]));if(R(e[0]))return O(e[1])>=e[0].length()?e[0].slice(0):e[0].slice(0,O(e[1]));throw new m(n,p.InvalidParameter,a)})},s.signatures.push({name:"top",min:2,max:2}),s.functions.first=function(n,a){return s.standardFunctionAsync(n,a,async(c,F,e)=>{if(E(e,1,1,n,a),A(e[0])){const t=await e[0].first(c.abortSignal);if(t!==null){const r=xe.createFromGraphicLikeObject(t.geometry,t.attributes,e[0],n.timeZone);return r._underlyingGraphic=t,r}return t}return N(e[0])?e[0].length===0?null:e[0][0]:R(e[0])?e[0].length()===0?null:e[0].get(0):null})},s.signatures.push({name:"first",min:1,max:1}),s.functions.attachments=function(n,a){return s.standardFunctionAsync(n,a,async(c,F,e)=>{E(e,1,2,n,a);const t={minsize:-1,maxsize:-1,types:null,returnMetadata:!1};if(e.length>1){if(e[1]instanceof v){if(e[1].hasField("minsize")&&(t.minsize=O(e[1].field("minsize"))),e[1].hasField("metadata")&&(t.returnMetadata=M(e[1].field("metadata"))),e[1].hasField("maxsize")&&(t.maxsize=O(e[1].field("maxsize"))),e[1].hasField("types")){const r=Ne(e[1].field("types"),!1);r.length>0&&(t.types=r)}}else if(e[1]!==null)throw new m(n,p.InvalidParameter,a)}if(G(e[0])){let r=e[0]._layer;return r instanceof te&&(r=ee(r,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),r===null?[]:A(r)===!1?[]:(await r.load(),r.queryAttachments(e[0].field(r.objectIdField),t.minsize,t.maxsize,t.types,t.returnMetadata))}if(e[0]===null)return[];throw new m(n,p.InvalidParameter,a)})},s.signatures.push({name:"attachments",min:1,max:2}),s.functions.featuresetbyrelationshipname=function(n,a){return s.standardFunctionAsync(n,a,async(c,F,e)=>{E(e,2,4,n,a);const t=e[0],r=x(e[1]);let u=L(e[2],null);const y=M(L(e[3],!0));if(u===null&&(u=["*"]),N(u)===!1)throw new m(n,p.InvalidParameter,a);if(e[0]===null)return null;if(!G(e[0]))throw new m(n,p.InvalidParameter,a);let o=t._layer;if(o instanceof te&&(o=ee(o,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),o===null||A(o)===!1)return null;o=await o.load();const i=o.relationshipMetaData().filter(w=>w.name===r);if(i.length===0)return null;if(i[0].relationshipTableId!==void 0&&i[0].relationshipTableId!==null&&i[0].relationshipTableId>-1)return Ze(o,i[0],t.field(o.objectIdField),o.spatialReference,u,y,n.lrucache,n.interceptor);let l=o.serviceUrl();if(!l)return null;l=l.charAt(l.length-1)==="/"?l+i[0].relatedTableId.toString():l+"/"+i[0].relatedTableId.toString();const f=await $e(l,o.spatialReference,u,y,n.lrucache,n.interceptor);await f.load();let I=f.relationshipMetaData();if(I=I.filter(w=>w.id===i[0].id),t.hasField(i[0].keyField)===!1||t.field(i[0].keyField)===null){const w=await o.getFeatureByObjectId(t.field(o.objectIdField),[i[0].keyField]);if(w){const b=T.create(I[0].keyField+"= @id",f.getFieldsIndex(),f.dateFieldsTimeZoneDefaultUTC);return b.parameters={id:w.attributes[i[0].keyField]},f.filter(b)}return new Oe({parentfeatureset:f})}const D=T.create(I[0].keyField+"= @id",f.getFieldsIndex(),f.dateFieldsTimeZoneDefaultUTC);return D.parameters={id:t.field(i[0].keyField)},f.filter(D)})},s.signatures.push({name:"featuresetbyrelationshipname",min:2,max:4}),s.functions.featuresetbyassociation=function(n,a){return s.standardFunctionAsync(n,a,async(c,F,e)=>{E(e,2,3,n,a);const t=e[0],r=x(L(e[1],"")).toLowerCase(),u=P(e[2])?x(e[2]):null;if(e[0]===null)return null;if(!G(e[0]))throw new m(n,p.InvalidParameter,a);let y=t._layer;if(y instanceof te&&(y=ee(y,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),y===null||A(y)===!1)return null;await y.load();const o=y.serviceUrl(),i=await Ue(o,n.spatialReference);let l=null,f=null,I=!1;if(u!==null&&u!==""&&u!==void 0){for(const g of i.terminals)g.terminalName===u&&(f=g.terminalId);f===null&&(I=!0)}const D=i.associations.getFieldsIndex(),w=D.get("TOGLOBALID").name,b=D.get("FROMGLOBALID").name,Q=D.get("TOTERMINALID").name,V=D.get("FROMTERMINALID").name,H=D.get("FROMNETWORKSOURCEID").name,W=D.get("TONETWORKSOURCEID").name,U=D.get("ASSOCIATIONTYPE").name,ge=D.get("ISCONTENTVISIBLE").name,Fe=D.get("OBJECTID").name;for(const g of y.fields)if(g.type==="global-id"){l=t.field(g.name);break}let Z=null,re=new k(new j({name:"percentalong",alias:"percentalong",type:"double"}),T.create("0",i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC)),se=new k(new j({name:"side",alias:"side",type:"string"}),T.create("''",i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC));const S="globalid",le="globalId",oe={};for(const g in i.lkp)oe[g]=i.lkp[g].sourceId;const $=new ke(new j({name:"classname",alias:"classname",type:"string"}),null,oe);let h="";switch(r){case"midspan":{h=`((${w}='${l}') OR ( ${b}='${l}')) AND (${U} IN (5))`,$.codefield=T.create(`CASE WHEN (${w}='${l}') THEN ${H} ELSE ${W} END`,i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC);const g=Y(C.findField(i.associations.fields,b));g.name=S,g.alias=S,Z=new k(g,T.create(`CASE WHEN (${b}='${l}') THEN ${w} ELSE ${b} END`,i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC)),re=i.unVersion>=4?new ne(C.findField(i.associations.fields,D.get("PERCENTALONG").name)):new k(new j({name:"percentalong",alias:"percentalong",type:"double"}),T.create("0",i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC));break}case"junctionedge":{h=`((${w}='${l}') OR ( ${b}='${l}')) AND (${U} IN (4,6))`,$.codefield=T.create(`CASE WHEN (${w}='${l}') THEN ${H} ELSE ${W} END`,i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC);const g=Y(C.findField(i.associations.fields,b));g.name=S,g.alias=S,Z=new k(g,T.create(`CASE WHEN (${b}='${l}') THEN ${w} ELSE ${b} END`,i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC)),se=new k(new j({name:"side",alias:"side",type:"string"}),T.create(`CASE WHEN (${U}=4) THEN 'from' ELSE 'to' END`,i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC));break}case"connected":{let g=`${w}='@T'`,fe=`${b}='@T'`;f!==null&&(g+=` AND ${Q}=@A`,fe+=` AND ${V}=@A`),h="(("+g+") OR ("+fe+"))",h=B(h,"@T",l??""),g=B(g,"@T",l??""),f!==null&&(g=B(g,"@A",f.toString()),h=B(h,"@A",f.toString())),$.codefield=T.create("CASE WHEN "+g+` THEN ${H} ELSE ${W} END`,i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC);const J=Y(C.findField(i.associations.fields,b));J.name=S,J.alias=S,Z=new k(J,T.create("CASE WHEN "+g+` THEN ${b} ELSE ${w} END`,i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC));break}case"container":h=`${w}='${l}' AND ${U} = 2`,f!==null&&(h+=` AND ${Q} = `+f.toString()),$.codefield=H,h="( "+h+" )",Z=new K(C.findField(i.associations.fields,b),S,S);break;case"content":h=`(${b}='${l}' AND ${U} = 2)`,f!==null&&(h+=` AND ${V} = `+f.toString()),$.codefield=W,h="( "+h+" )",Z=new K(C.findField(i.associations.fields,w),S,S);break;case"structure":h=`(${w}='${l}' AND ${U} = 3)`,f!==null&&(h+=` AND ${Q} = `+f.toString()),$.codefield=H,h="( "+h+" )",Z=new K(C.findField(i.associations.fields,b),S,le);break;case"attached":h=`(${b}='${l}' AND ${U} = 3)`,f!==null&&(h+=` AND ${V} = `+f.toString()),$.codefield=W,h="( "+h+" )",Z=new K(C.findField(i.associations.fields,w),S,le);break;default:throw new m(n,p.InvalidParameter,a)}return I&&(h="1 <> 1"),new C({parentfeatureset:i.associations,adaptedFields:[new ne(C.findField(i.associations.fields,Fe)),new ne(C.findField(i.associations.fields,ge)),Z,se,$,re],extraFilter:h?T.create(h,i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC):null})})},s.signatures.push({name:"featuresetbyassociation",min:2,max:6}),s.functions.groupby=function(n,a){return s.standardFunctionAsync(n,a,async(c,F,e)=>{if(E(e,3,3,n,a),!A(e[0]))throw new m(n,p.InvalidParameter,a);const t=await e[0].load(),r=[],u=[];let y=!1,o=[];if(P(e[1]))o.push(e[1]);else if(e[1]instanceof v)o.push(e[1]);else if(N(e[1]))o=e[1];else{if(!R(e[1]))throw new m(n,p.InvalidParameter,a);o=e[1].toArray()}for(const i of o)if(P(i)){const l=T.create(x(i),t.getFieldsIndex(),t.dateFieldsTimeZoneDefaultUTC),f=pe(l)===!0?x(i):"%%%%FIELDNAME";r.push({name:f,expression:l}),f==="%%%%FIELDNAME"&&(y=!0)}else{if(!(i instanceof v))throw new m(n,p.InvalidParameter,a);{const l=i.hasField("name")?i.field("name"):"%%%%FIELDNAME",f=i.hasField("expression")?i.field("expression"):"";if(l==="%%%%FIELDNAME"&&(y=!0),!l)throw new m(n,p.InvalidParameter,a);r.push({name:l,expression:T.create(f||l,t.getFieldsIndex(),t.dateFieldsTimeZoneDefaultUTC)})}}if(o=[],P(e[2]))o.push(e[2]);else if(N(e[2]))o=e[2];else if(R(e[2]))o=e[2].toArray();else{if(!(e[2]instanceof v))throw new m(n,p.InvalidParameter,a);o.push(e[2])}for(const i of o){if(!(i instanceof v))throw new m(n,p.InvalidParameter,a);{const l=i.hasField("name")?i.field("name"):"",f=i.hasField("statistic")?i.field("statistic"):"",I=i.hasField("expression")?i.field("expression"):"";if(!l||!f||!I)throw new m(n,p.InvalidParameter,a);u.push({name:l,statistic:f.toLowerCase(),expression:T.create(I,t.getFieldsIndex(),t.dateFieldsTimeZoneDefaultUTC)})}}if(y){const i={};for(const f of t.fields)i[f.name.toLowerCase()]=1;for(const f of r)f.name!=="%%%%FIELDNAME"&&(i[f.name.toLowerCase()]=1);for(const f of u)f.name!=="%%%%FIELDNAME"&&(i[f.name.toLowerCase()]=1);let l=0;for(const f of r)if(f.name==="%%%%FIELDNAME"){for(;i["field_"+l.toString()]===1;)l++;i["field_"+l.toString()]=1,f.name="FIELD_"+l.toString()}}for(const i of r)await ie(i.expression,s,n);for(const i of u)await ie(i.expression,s,n);return e[0].groupby(r,u)})},s.signatures.push({name:"groupby",min:3,max:3}),s.functions.distinct=function(n,a){return s.standardFunctionAsync(n,a,async(c,F,e)=>{if(A(e[0])){E(e,2,2,n,a);const t=await e[0].load(),r=[];let u=[];if(P(e[1]))u.push(e[1]);else if(e[1]instanceof v)u.push(e[1]);else if(N(e[1]))u=e[1];else{if(!R(e[1]))throw new m(n,p.InvalidParameter,a);u=e[1].toArray()}let y=!1;for(const o of u)if(P(o)){const i=T.create(x(o),t.getFieldsIndex(),t.dateFieldsTimeZoneDefaultUTC),l=pe(i)===!0?x(o):"%%%%FIELDNAME";r.push({name:l,expression:i}),l==="%%%%FIELDNAME"&&(y=!0)}else{if(!(o instanceof v))throw new m(n,p.InvalidParameter,a);{const i=o.hasField("name")?o.field("name"):"%%%%FIELDNAME",l=o.hasField("expression")?o.field("expression"):"";if(i==="%%%%FIELDNAME"&&(y=!0),!i)throw new m(n,p.InvalidParameter,a);r.push({name:i,expression:T.create(l||i,t.getFieldsIndex(),t.dateFieldsTimeZoneDefaultUTC)})}}if(y){const o={};for(const l of t.fields)o[l.name.toLowerCase()]=1;for(const l of r)l.name!=="%%%%FIELDNAME"&&(o[l.name.toLowerCase()]=1);let i=0;for(const l of r)if(l.name==="%%%%FIELDNAME"){for(;o["field_"+i.toString()]===1;)i++;o["field_"+i.toString()]=1,l.name="FIELD_"+i.toString()}}for(const o of r)await ie(o.expression,s,n);return e[0].groupby(r,[])}return He("distinct",c,F,e)})}),s.functions.getfeaturesetinfo=function(n,a){return s.standardFunctionAsync(n,a,async(c,F,e)=>{if(E(e,1,1,n,a),!A(e[0]))return null;const t=await e[0].getFeatureSetInfo();return t?v.convertObjectToArcadeDictionary({layerId:t.layerId,layerName:t.layerName,itemId:t.itemId,serviceLayerUrl:t.serviceLayerUrl,webMapLayerId:t.webMapLayerId??null,webMapLayerTitle:t.webMapLayerTitle??null,className:null,objectClassId:null},ue(n),!1,!1):null})},s.signatures.push({name:"getfeaturesetinfo",min:1,max:1}),s.functions.filterbysubtypecode=function(n,a){return s.standardFunctionAsync(n,a,async(c,F,e)=>{if(E(e,2,2,n,a),A(e[0])){const t=await e[0].load(),r=e[1];if(!Ae(r))throw new m(n,p.InvalidParameter,a);if(t.subtypeField){const y=T.create(`${t.subtypeField}= ${e[1]}`,t.getFieldsIndex(),t.dateFieldsTimeZoneDefaultUTC);return new _({parentfeatureset:e[0],whereclause:y})}if(t.typeIdField===null||t.typeIdField==="")throw new m(n,p.FeatureSetDoesNotHaveSubtypes,a);const u=T.create(`${t.typeIdField}= ${e[1]}`,t.getFieldsIndex(),t.dateFieldsTimeZoneDefaultUTC);return new _({parentfeatureset:e[0],whereclause:u})}throw new m(n,p.InvalidParameter,a)})},s.signatures.push({name:"filterbysubtypecode",min:2,max:2})}export{ft as registerFunctions}; +import{m as Ie}from"./TimeOnly-BXSODLxA.js";import{a as E,t as De,k as X,B as A,N as v,b as m,r as p,G as P,d as x,l as Te,q as ue,X as de,v as L,S as M,U as N,H as G,x as be,Q as R,I as Ee,h as O,D as xe,y as Ne,A as B,K as Y,V as Ae,P as q}from"./arcadeUtils-BxUF81hz.js";import{e as ce,j as Se,q as me,f as Le,c as _,a as Ce,b as ve,d as Pe,g as ee,k as Ze,F as $e,A as Ue,B as k,h as ke,i as K,L as C,I as ne}from"./featureSetUtils-BD9u_wDK.js";import{t as Re}from"./ImmutableArray-BlMso3qf.js";import{l as Me}from"./portalUtils-ApkRv-Dr.js";import{u as Oe,D as pe}from"./SpatialFilter-D9TNROUn.js";import{ax as ye,eu as ze,a_ as j}from"./index-BjUNJPVf.js";import{x as T}from"./WhereClause-Ctld7DSu.js";import te from"./FeatureLayer-BHxNIHhy.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./number-CJqenc9O.js";import"./featureConversionUtils-BHhm7bvm.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./FieldsIndex-CK-0B5n9.js";import"./MD5-C9MwAd2G.js";import"./SubtypeGroupLayer-DoVLJ5RR.js";import"./EditBusLayer-OslMX9fF.js";import"./FeatureLayerBase-D0I-Escx.js";import"./featureLayerUtils-lwqyOSrl.js";import"./jsonUtils-Dw332y6z.js";import"./UniqueValueRenderer-7V9Bhr-D.js";import"./ColorStop-DCGjAKLC.js";import"./diffUtils-uUoMDFQS.js";import"./colorRamps-CcakIWlU.js";import"./sizeVariableUtils-Cmcuvw-4.js";import"./visualVariableUtils-BX9G5gNQ.js";import"./jsonUtils-Ox5U0P0F.js";import"./styleUtils-DOUOskVZ.js";import"./Version-Dqq_CHBG.js";import"./OverrideHelper-DxFZBnGL.js";import"./utils-CuXO_Zzq.js";import"./quantizationUtils-CfV316jZ.js";import"./heatmapUtils-BSteZBTj.js";import"./AttachmentQuery-DmEAIZff.js";import"./RelationshipQuery-BDJrOxaX.js";import"./LayerFloorInfo-DlYNbO-A.js";import"./serviceCapabilitiesUtils-DiP90Uds.js";import"./RefreshableLayer-_r2TPtol.js";import"./TemporalLayer-CKICYnEl.js";import"./TimeInfo-DooETFWC.js";import"./fieldProperties-DnrQXLBM.js";import"./FormTemplate-BGxtsGX6.js";import"./FeatureTemplate-FZNGA_Ik.js";import"./LabelClass-CeatfK8u.js";import"./labelUtils-3p0-m-Ee.js";import"./defaultsJSON-CHAaurhX.js";import"./labelingInfo-DqAUis6e.js";import"./popupUtils-DlZin22m.js";import"./versionUtils-BIAEZzrm.js";import"./interfaces-CL2NbQte.js";import"./infoFor3D-DsOdlPuA.js";import"./executeQueryJSON-COxi_Fac.js";import"./query-Bk_ITqRK.js";import"./pbfQueryUtils-CSeFSIjv.js";import"./pbf-Du8sFEWo.js";import"./queryZScale-Dwvn5BlQ.js";import"./FeatureSet-opEn8ou8.js";import"./executeQueryPBF-DROgTCuZ.js";import"./AttachmentInfo-Cm6dhnUr.js";import"./executeForIds-CZ3M8IZd.js";import"./TopFeaturesQuery-CVQjqlfM.js";import"./FeatureType-CwUl8Nf5.js";import"./geometryEngineAsync-wvmuP1s9.js";import"./editsZScale-Bfe6gH1b.js";import"./FeatureEffectLayer-DarO4Ctx.js";import"./FeatureEffect-DBbkrS6j.js";import"./FeatureReductionLayer-CK-tyM-9.js";import"./FeatureReductionSelection-t3T7oa8H.js";import"./OrderedLayer-dLoPhxcx.js";import"./OrderByInfo-DKyk5GLW.js";import"./styleUtils--I7zqeL6.js";function He(s,n,a,c){if(c.length===1){if(N(c[0]))return q(s,c[0],-1);if(R(c[0]))return q(s,c[0].toArray(),-1)}return q(s,c,-1)}async function ie(s,n,a){const c=s.getVariables();if(c.length>0){const F=[];for(let t=0;t{var u,y;if(E(e,1,2,n,a),De(e[0])||X(e[0]))return"Unknown";if(A(e[0])){if(await e[0].load(),e.length===1||e[1]===null)return e[0].datesInUnknownTimezone?z("unknown"):z(e[0].dateFieldsTimeZone);if(!(e[1]instanceof v)||e[1].hasField("type")===!1)throw new m(n,p.InvalidParameter,a);const o=e[1].field("type");if(P(o)===!1)throw new m(n,p.InvalidParameter,a);switch(x(o).toLowerCase()){case"preferredtimezone":return z(e[0].preferredTimeZone);case"editfieldsinfo":return z(((u=e[0].editFieldsInfo)==null?void 0:u.timeZone)??null);case"timeinfo":return z(((y=e[0].timeInfo)==null?void 0:y.timeZone)??null);case"field":if(e[1].hasField("fieldname")&&P(e[1].field("fieldname")))return z(e[0].fieldTimeZone(x(e[1].field("fieldname"))))}throw new m(n,p.InvalidParameter,a)}const t=Te(e[0],ue(n));if(t===null)return null;const r=t.timeZone;return r==="system"?Ie.systemTimeZoneCanonicalName:r.toLowerCase()==="utc"?"UTC":r.toLowerCase()==="unknown"?"Unknown":r})},s.functions.sqltimestamp=function(n,a){return s.standardFunctionAsync(n,a,async(c,F,e)=>{E(e,1,3,n,a);const t=e[0];if(de(t)){if(e.length===1)return t.toSQLWithKeyword();if(e.length===2)return t.changeTimeZone(x(e[1])).toSQLWithKeyword();throw new m(n,p.InvalidParameter,a)}if(X(t))return t.toSQLWithKeyword();if(A(t)){if(e.length!==3)throw new m(n,p.InvalidParameter,a);await t.load();const r=x(e[1]);if(X(e[2]))return e[2].toSQLWithKeyword();if(de(e[2])===!1)throw new m(n,p.InvalidParameter,a);const u=t.fieldTimeZone(r);return u===null?e[2].toSQLWithKeyword():e[2].changeTimeZone(u).toSQLWithKeyword()}throw new m(n,p.InvalidParameter,a)})},s.signatures.push({name:"sqltimestamp",min:2,max:4}),s.functions.featuresetbyid=function(n,a){return s.standardFunctionAsync(n,a,(c,F,e)=>{if(E(e,2,4,n,a),e[0]instanceof ce){const t=x(e[1]);let r=L(e[2],null);const u=M(L(e[3],!0));if(r===null&&(r=["*"]),N(r)===!1)throw new m(n,p.InvalidParameter,a);return e[0].featureSetById(t,u,r)}throw new m(n,p.InvalidParameter,a)})},s.signatures.push({name:"featuresetbyid",min:2,max:4}),s.functions.getfeatureset=function(n,a){return s.standardFunctionAsync(n,a,(c,F,e)=>{if(E(e,1,2,n,a),G(e[0])){let t=L(e[1],"datasource");return t===null&&(t="datasource"),t=x(t).toLowerCase(),Se(e[0].fullSchema(),t,n.lrucache,n.interceptor,n.spatialReference)}throw new m(n,p.InvalidParameter,a)})},s.signatures.push({name:"getfeatureset",min:1,max:2}),s.functions.featuresetbyportalitem=function(n,a){return s.standardFunctionAsync(n,a,(c,F,e)=>{var o,i;if(E(e,2,5,n,a),e[0]===null)throw new m(n,p.PortalRequired,a);if(e[0]instanceof be){const l=x(e[1]),f=x(e[2]);let I=L(e[3],null);const D=M(L(e[4],!0));if(I===null&&(I=["*"]),N(I)===!1)throw new m(n,p.InvalidParameter,a);let w=null;return w=(o=n.services)!=null&&o.portal?n.services.portal:ye.getDefault(),w=Me(e[0],w),me(l,f,n.spatialReference,I,D,w,n.lrucache,n.interceptor)}if(P(e[0])===!1)throw new m(n,p.PortalRequired,a);const t=x(e[0]),r=x(e[1]);let u=L(e[2],null);const y=M(L(e[3],!0));if(u===null&&(u=["*"]),N(u)===!1)throw new m(n,p.InvalidParameter,a);return me(t,r,n.spatialReference,u,y,((i=n.services)==null?void 0:i.portal)??ye.getDefault(),n.lrucache,n.interceptor)})},s.signatures.push({name:"featuresetbyportalitem",min:2,max:5}),s.functions.featuresetbyname=function(n,a){return s.standardFunctionAsync(n,a,(c,F,e)=>{if(E(e,2,4,n,a),e[0]instanceof ce){const t=x(e[1]);let r=L(e[2],null);const u=M(L(e[3],!0));if(r===null&&(r=["*"]),N(r)===!1)throw new m(n,p.InvalidParameter,a);return e[0].featureSetByName(t,u,r)}throw new m(n,p.InvalidParameter,a)})},s.signatures.push({name:"featuresetbyname",min:2,max:4}),s.functions.featureset=function(n,a){return s.standardFunction(n,a,(c,F,e)=>{E(e,1,1,n,a);let t=e[0];const r={layerDefinition:{geometryType:"",objectIdField:"",hasM:!1,hasZ:!1,globalIdField:"",typeIdField:"",fields:[]},featureSet:{geometryType:"",features:[]}};if(P(t))t=JSON.parse(t),t.layerDefinition!==void 0?(r.layerDefinition=t.layerDefinition,r.featureSet=t.featureSet,t.layerDefinition.spatialReference&&(r.layerDefinition.spatialReference=t.layerDefinition.spatialReference)):(r.featureSet.features=t.features,r.featureSet.geometryType=t.geometryType,r.layerDefinition.geometryType=r.featureSet.geometryType,r.layerDefinition.objectIdField=t.objectIdFieldName??"",r.layerDefinition.typeIdField=t.typeIdFieldName,r.layerDefinition.globalIdField=t.globalIdFieldName,r.layerDefinition.fields=t.fields,t.spatialReference&&(r.layerDefinition.spatialReference=t.spatialReference));else{if(!(e[0]instanceof v))throw new m(n,p.InvalidParameter,a);{t=JSON.parse(e[0].castToText(!0));const u=d(t,"layerdefinition");if(u!==null){r.layerDefinition.geometryType=d(u,"geometrytype",""),r.featureSet.geometryType=r.layerDefinition.geometryType,r.layerDefinition.globalIdField=d(u,"globalidfield",""),r.layerDefinition.objectIdField=d(u,"objectidfield",""),r.layerDefinition.typeIdField=d(u,"typeidfield",""),r.layerDefinition.hasZ=d(u,"hasz",!1)===!0,r.layerDefinition.hasM=d(u,"hasm",!1)===!0;const y=d(u,"spatialreference",null);y&&(r.layerDefinition.spatialReference=ae(y));for(const i of d(u,"fields",[])){const l={name:d(i,"name",""),alias:d(i,"alias",""),type:d(i,"type",""),nullable:d(i,"nullable",!0),editable:d(i,"editable",!0),length:d(i,"length",null),domain:we(d(i,"domain"))};r.layerDefinition.fields.push(l)}const o=d(t,"featureset",null);if(o){const i={};for(const l of r.layerDefinition.fields)i[l.name.toLowerCase()]=l.name;for(const l of d(o,"features",[])){const f={},I=d(l,"attributes",{});for(const D in I)f[i[D.toLowerCase()]]=I[D];r.featureSet.features.push({attributes:f,geometry:he(d(l,"geometry",null))})}}}else{r.layerDefinition.hasZ=d(t,"hasz",!1)===!0,r.layerDefinition.hasM=d(t,"hasm",!1)===!0,r.layerDefinition.geometryType=d(t,"geometrytype",""),r.featureSet.geometryType=r.layerDefinition.geometryType,r.layerDefinition.objectIdField=d(t,"objectidfieldname",""),r.layerDefinition.typeIdField=d(t,"typeidfieldname","");const y=d(t,"spatialreference",null);y&&(r.layerDefinition.spatialReference=ae(y));let o=d(t,"fields",null);if(N(o))for(const f of o){const I={name:d(f,"name",""),alias:d(f,"alias",""),type:d(f,"type",""),nullable:d(f,"nullable",!0),editable:d(f,"editable",!0),length:d(f,"length",null),domain:we(d(f,"domain"))};r.layerDefinition.fields.push(I)}else o=null,r.layerDefinition.fields=o;const i={};for(const f of r.layerDefinition.fields)i[f.name.toLowerCase()]=f.name;let l=d(t,"features",null);if(N(l))for(const f of l){const I={},D=d(f,"attributes",{});for(const w in D)I[i[w.toLowerCase()]]=D[w];r.featureSet.features.push({attributes:I,geometry:he(d(f,"geometry",null))})}else l=null,r.featureSet.features=l}}}if(je(r)===!1)throw new m(n,p.InvalidParameter,a);return r.layerDefinition.geometryType||(r.layerDefinition.geometryType="esriGeometryNull"),Le.create(r,n.spatialReference)})},s.signatures.push({name:"featureset",min:1,max:1}),s.functions.filter=function(n,a){return s.standardFunctionAsync(n,a,async(c,F,e)=>{if(E(e,2,2,n,a),N(e[0])||R(e[0])){const t=[];let r=e[0];r instanceof Re&&(r=r.toArray());let u=null;if(!Ee(e[1]))throw new m(n,p.InvalidParameter,a);u=e[1].createFunction(n);for(const y of r){const o=u(y);ze(o)?await o===!0&&t.push(y):o===!0&&t.push(y)}return t}if(A(e[0])){const t=await e[0].load(),r=T.create(e[1],t.getFieldsIndex(),t.dateFieldsTimeZoneDefaultUTC),u=r.getVariables();if(u.length>0){const y=[];for(let i=0;i{if(E(e,2,2,n,a),A(e[0])){const t=new Ce(e[1]);return new ve({parentfeatureset:e[0],orderbyclause:t})}throw new m(n,p.InvalidParameter,a)})},s.signatures.push({name:"orderby",min:2,max:2}),s.functions.top=function(n,a){return s.standardFunctionAsync(n,a,async(c,F,e)=>{if(E(e,2,2,n,a),A(e[0]))return new Pe({parentfeatureset:e[0],topnum:e[1]});if(N(e[0]))return O(e[1])>=e[0].length?e[0].slice(0):e[0].slice(0,O(e[1]));if(R(e[0]))return O(e[1])>=e[0].length()?e[0].slice(0):e[0].slice(0,O(e[1]));throw new m(n,p.InvalidParameter,a)})},s.signatures.push({name:"top",min:2,max:2}),s.functions.first=function(n,a){return s.standardFunctionAsync(n,a,async(c,F,e)=>{if(E(e,1,1,n,a),A(e[0])){const t=await e[0].first(c.abortSignal);if(t!==null){const r=xe.createFromGraphicLikeObject(t.geometry,t.attributes,e[0],n.timeZone);return r._underlyingGraphic=t,r}return t}return N(e[0])?e[0].length===0?null:e[0][0]:R(e[0])?e[0].length()===0?null:e[0].get(0):null})},s.signatures.push({name:"first",min:1,max:1}),s.functions.attachments=function(n,a){return s.standardFunctionAsync(n,a,async(c,F,e)=>{E(e,1,2,n,a);const t={minsize:-1,maxsize:-1,types:null,returnMetadata:!1};if(e.length>1){if(e[1]instanceof v){if(e[1].hasField("minsize")&&(t.minsize=O(e[1].field("minsize"))),e[1].hasField("metadata")&&(t.returnMetadata=M(e[1].field("metadata"))),e[1].hasField("maxsize")&&(t.maxsize=O(e[1].field("maxsize"))),e[1].hasField("types")){const r=Ne(e[1].field("types"),!1);r.length>0&&(t.types=r)}}else if(e[1]!==null)throw new m(n,p.InvalidParameter,a)}if(G(e[0])){let r=e[0]._layer;return r instanceof te&&(r=ee(r,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),r===null?[]:A(r)===!1?[]:(await r.load(),r.queryAttachments(e[0].field(r.objectIdField),t.minsize,t.maxsize,t.types,t.returnMetadata))}if(e[0]===null)return[];throw new m(n,p.InvalidParameter,a)})},s.signatures.push({name:"attachments",min:1,max:2}),s.functions.featuresetbyrelationshipname=function(n,a){return s.standardFunctionAsync(n,a,async(c,F,e)=>{E(e,2,4,n,a);const t=e[0],r=x(e[1]);let u=L(e[2],null);const y=M(L(e[3],!0));if(u===null&&(u=["*"]),N(u)===!1)throw new m(n,p.InvalidParameter,a);if(e[0]===null)return null;if(!G(e[0]))throw new m(n,p.InvalidParameter,a);let o=t._layer;if(o instanceof te&&(o=ee(o,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),o===null||A(o)===!1)return null;o=await o.load();const i=o.relationshipMetaData().filter(w=>w.name===r);if(i.length===0)return null;if(i[0].relationshipTableId!==void 0&&i[0].relationshipTableId!==null&&i[0].relationshipTableId>-1)return Ze(o,i[0],t.field(o.objectIdField),o.spatialReference,u,y,n.lrucache,n.interceptor);let l=o.serviceUrl();if(!l)return null;l=l.charAt(l.length-1)==="/"?l+i[0].relatedTableId.toString():l+"/"+i[0].relatedTableId.toString();const f=await $e(l,o.spatialReference,u,y,n.lrucache,n.interceptor);await f.load();let I=f.relationshipMetaData();if(I=I.filter(w=>w.id===i[0].id),t.hasField(i[0].keyField)===!1||t.field(i[0].keyField)===null){const w=await o.getFeatureByObjectId(t.field(o.objectIdField),[i[0].keyField]);if(w){const b=T.create(I[0].keyField+"= @id",f.getFieldsIndex(),f.dateFieldsTimeZoneDefaultUTC);return b.parameters={id:w.attributes[i[0].keyField]},f.filter(b)}return new Oe({parentfeatureset:f})}const D=T.create(I[0].keyField+"= @id",f.getFieldsIndex(),f.dateFieldsTimeZoneDefaultUTC);return D.parameters={id:t.field(i[0].keyField)},f.filter(D)})},s.signatures.push({name:"featuresetbyrelationshipname",min:2,max:4}),s.functions.featuresetbyassociation=function(n,a){return s.standardFunctionAsync(n,a,async(c,F,e)=>{E(e,2,3,n,a);const t=e[0],r=x(L(e[1],"")).toLowerCase(),u=P(e[2])?x(e[2]):null;if(e[0]===null)return null;if(!G(e[0]))throw new m(n,p.InvalidParameter,a);let y=t._layer;if(y instanceof te&&(y=ee(y,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),y===null||A(y)===!1)return null;await y.load();const o=y.serviceUrl(),i=await Ue(o,n.spatialReference);let l=null,f=null,I=!1;if(u!==null&&u!==""&&u!==void 0){for(const g of i.terminals)g.terminalName===u&&(f=g.terminalId);f===null&&(I=!0)}const D=i.associations.getFieldsIndex(),w=D.get("TOGLOBALID").name,b=D.get("FROMGLOBALID").name,Q=D.get("TOTERMINALID").name,V=D.get("FROMTERMINALID").name,H=D.get("FROMNETWORKSOURCEID").name,W=D.get("TONETWORKSOURCEID").name,U=D.get("ASSOCIATIONTYPE").name,ge=D.get("ISCONTENTVISIBLE").name,Fe=D.get("OBJECTID").name;for(const g of y.fields)if(g.type==="global-id"){l=t.field(g.name);break}let Z=null,re=new k(new j({name:"percentalong",alias:"percentalong",type:"double"}),T.create("0",i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC)),se=new k(new j({name:"side",alias:"side",type:"string"}),T.create("''",i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC));const S="globalid",le="globalId",oe={};for(const g in i.lkp)oe[g]=i.lkp[g].sourceId;const $=new ke(new j({name:"classname",alias:"classname",type:"string"}),null,oe);let h="";switch(r){case"midspan":{h=`((${w}='${l}') OR ( ${b}='${l}')) AND (${U} IN (5))`,$.codefield=T.create(`CASE WHEN (${w}='${l}') THEN ${H} ELSE ${W} END`,i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC);const g=Y(C.findField(i.associations.fields,b));g.name=S,g.alias=S,Z=new k(g,T.create(`CASE WHEN (${b}='${l}') THEN ${w} ELSE ${b} END`,i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC)),re=i.unVersion>=4?new ne(C.findField(i.associations.fields,D.get("PERCENTALONG").name)):new k(new j({name:"percentalong",alias:"percentalong",type:"double"}),T.create("0",i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC));break}case"junctionedge":{h=`((${w}='${l}') OR ( ${b}='${l}')) AND (${U} IN (4,6))`,$.codefield=T.create(`CASE WHEN (${w}='${l}') THEN ${H} ELSE ${W} END`,i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC);const g=Y(C.findField(i.associations.fields,b));g.name=S,g.alias=S,Z=new k(g,T.create(`CASE WHEN (${b}='${l}') THEN ${w} ELSE ${b} END`,i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC)),se=new k(new j({name:"side",alias:"side",type:"string"}),T.create(`CASE WHEN (${U}=4) THEN 'from' ELSE 'to' END`,i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC));break}case"connected":{let g=`${w}='@T'`,fe=`${b}='@T'`;f!==null&&(g+=` AND ${Q}=@A`,fe+=` AND ${V}=@A`),h="(("+g+") OR ("+fe+"))",h=B(h,"@T",l??""),g=B(g,"@T",l??""),f!==null&&(g=B(g,"@A",f.toString()),h=B(h,"@A",f.toString())),$.codefield=T.create("CASE WHEN "+g+` THEN ${H} ELSE ${W} END`,i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC);const J=Y(C.findField(i.associations.fields,b));J.name=S,J.alias=S,Z=new k(J,T.create("CASE WHEN "+g+` THEN ${b} ELSE ${w} END`,i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC));break}case"container":h=`${w}='${l}' AND ${U} = 2`,f!==null&&(h+=` AND ${Q} = `+f.toString()),$.codefield=H,h="( "+h+" )",Z=new K(C.findField(i.associations.fields,b),S,S);break;case"content":h=`(${b}='${l}' AND ${U} = 2)`,f!==null&&(h+=` AND ${V} = `+f.toString()),$.codefield=W,h="( "+h+" )",Z=new K(C.findField(i.associations.fields,w),S,S);break;case"structure":h=`(${w}='${l}' AND ${U} = 3)`,f!==null&&(h+=` AND ${Q} = `+f.toString()),$.codefield=H,h="( "+h+" )",Z=new K(C.findField(i.associations.fields,b),S,le);break;case"attached":h=`(${b}='${l}' AND ${U} = 3)`,f!==null&&(h+=` AND ${V} = `+f.toString()),$.codefield=W,h="( "+h+" )",Z=new K(C.findField(i.associations.fields,w),S,le);break;default:throw new m(n,p.InvalidParameter,a)}return I&&(h="1 <> 1"),new C({parentfeatureset:i.associations,adaptedFields:[new ne(C.findField(i.associations.fields,Fe)),new ne(C.findField(i.associations.fields,ge)),Z,se,$,re],extraFilter:h?T.create(h,i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC):null})})},s.signatures.push({name:"featuresetbyassociation",min:2,max:6}),s.functions.groupby=function(n,a){return s.standardFunctionAsync(n,a,async(c,F,e)=>{if(E(e,3,3,n,a),!A(e[0]))throw new m(n,p.InvalidParameter,a);const t=await e[0].load(),r=[],u=[];let y=!1,o=[];if(P(e[1]))o.push(e[1]);else if(e[1]instanceof v)o.push(e[1]);else if(N(e[1]))o=e[1];else{if(!R(e[1]))throw new m(n,p.InvalidParameter,a);o=e[1].toArray()}for(const i of o)if(P(i)){const l=T.create(x(i),t.getFieldsIndex(),t.dateFieldsTimeZoneDefaultUTC),f=pe(l)===!0?x(i):"%%%%FIELDNAME";r.push({name:f,expression:l}),f==="%%%%FIELDNAME"&&(y=!0)}else{if(!(i instanceof v))throw new m(n,p.InvalidParameter,a);{const l=i.hasField("name")?i.field("name"):"%%%%FIELDNAME",f=i.hasField("expression")?i.field("expression"):"";if(l==="%%%%FIELDNAME"&&(y=!0),!l)throw new m(n,p.InvalidParameter,a);r.push({name:l,expression:T.create(f||l,t.getFieldsIndex(),t.dateFieldsTimeZoneDefaultUTC)})}}if(o=[],P(e[2]))o.push(e[2]);else if(N(e[2]))o=e[2];else if(R(e[2]))o=e[2].toArray();else{if(!(e[2]instanceof v))throw new m(n,p.InvalidParameter,a);o.push(e[2])}for(const i of o){if(!(i instanceof v))throw new m(n,p.InvalidParameter,a);{const l=i.hasField("name")?i.field("name"):"",f=i.hasField("statistic")?i.field("statistic"):"",I=i.hasField("expression")?i.field("expression"):"";if(!l||!f||!I)throw new m(n,p.InvalidParameter,a);u.push({name:l,statistic:f.toLowerCase(),expression:T.create(I,t.getFieldsIndex(),t.dateFieldsTimeZoneDefaultUTC)})}}if(y){const i={};for(const f of t.fields)i[f.name.toLowerCase()]=1;for(const f of r)f.name!=="%%%%FIELDNAME"&&(i[f.name.toLowerCase()]=1);for(const f of u)f.name!=="%%%%FIELDNAME"&&(i[f.name.toLowerCase()]=1);let l=0;for(const f of r)if(f.name==="%%%%FIELDNAME"){for(;i["field_"+l.toString()]===1;)l++;i["field_"+l.toString()]=1,f.name="FIELD_"+l.toString()}}for(const i of r)await ie(i.expression,s,n);for(const i of u)await ie(i.expression,s,n);return e[0].groupby(r,u)})},s.signatures.push({name:"groupby",min:3,max:3}),s.functions.distinct=function(n,a){return s.standardFunctionAsync(n,a,async(c,F,e)=>{if(A(e[0])){E(e,2,2,n,a);const t=await e[0].load(),r=[];let u=[];if(P(e[1]))u.push(e[1]);else if(e[1]instanceof v)u.push(e[1]);else if(N(e[1]))u=e[1];else{if(!R(e[1]))throw new m(n,p.InvalidParameter,a);u=e[1].toArray()}let y=!1;for(const o of u)if(P(o)){const i=T.create(x(o),t.getFieldsIndex(),t.dateFieldsTimeZoneDefaultUTC),l=pe(i)===!0?x(o):"%%%%FIELDNAME";r.push({name:l,expression:i}),l==="%%%%FIELDNAME"&&(y=!0)}else{if(!(o instanceof v))throw new m(n,p.InvalidParameter,a);{const i=o.hasField("name")?o.field("name"):"%%%%FIELDNAME",l=o.hasField("expression")?o.field("expression"):"";if(i==="%%%%FIELDNAME"&&(y=!0),!i)throw new m(n,p.InvalidParameter,a);r.push({name:i,expression:T.create(l||i,t.getFieldsIndex(),t.dateFieldsTimeZoneDefaultUTC)})}}if(y){const o={};for(const l of t.fields)o[l.name.toLowerCase()]=1;for(const l of r)l.name!=="%%%%FIELDNAME"&&(o[l.name.toLowerCase()]=1);let i=0;for(const l of r)if(l.name==="%%%%FIELDNAME"){for(;o["field_"+i.toString()]===1;)i++;o["field_"+i.toString()]=1,l.name="FIELD_"+i.toString()}}for(const o of r)await ie(o.expression,s,n);return e[0].groupby(r,[])}return He("distinct",c,F,e)})}),s.functions.getfeaturesetinfo=function(n,a){return s.standardFunctionAsync(n,a,async(c,F,e)=>{if(E(e,1,1,n,a),!A(e[0]))return null;const t=await e[0].getFeatureSetInfo();return t?v.convertObjectToArcadeDictionary({layerId:t.layerId,layerName:t.layerName,itemId:t.itemId,serviceLayerUrl:t.serviceLayerUrl,webMapLayerId:t.webMapLayerId??null,webMapLayerTitle:t.webMapLayerTitle??null,className:null,objectClassId:null},ue(n),!1,!1):null})},s.signatures.push({name:"getfeaturesetinfo",min:1,max:1}),s.functions.filterbysubtypecode=function(n,a){return s.standardFunctionAsync(n,a,async(c,F,e)=>{if(E(e,2,2,n,a),A(e[0])){const t=await e[0].load(),r=e[1];if(!Ae(r))throw new m(n,p.InvalidParameter,a);if(t.subtypeField){const y=T.create(`${t.subtypeField}= ${e[1]}`,t.getFieldsIndex(),t.dateFieldsTimeZoneDefaultUTC);return new _({parentfeatureset:e[0],whereclause:y})}if(t.typeIdField===null||t.typeIdField==="")throw new m(n,p.FeatureSetDoesNotHaveSubtypes,a);const u=T.create(`${t.typeIdField}= ${e[1]}`,t.getFieldsIndex(),t.dateFieldsTimeZoneDefaultUTC);return new _({parentfeatureset:e[0],whereclause:u})}throw new m(n,p.InvalidParameter,a)})},s.signatures.push({name:"filterbysubtypecode",min:2,max:2})}export{ft as registerFunctions}; diff --git a/assets/featuresetgeom-Cl8QdL8d.js b/assets/featuresetgeom-4-vjnWH-.js similarity index 83% rename from assets/featuresetgeom-Cl8QdL8d.js rename to assets/featuresetgeom-4-vjnWH-.js index 4bf224a..4f1d88d 100644 --- a/assets/featuresetgeom-Cl8QdL8d.js +++ b/assets/featuresetgeom-4-vjnWH-.js @@ -1 +1 @@ -import{T as S,a as F,d as p,B as i,b as u,r as l}from"./arcadeUtils-BoaybaAR.js";import{s as w}from"./TimeOnly-Cm47ew5I.js";import{u as c,f as h}from"./SpatialFilter-C4Il3spK.js";import{et as o}from"./index-CEWggaxV.js";import{relate as I,crosses as A,touches as P,within as g,overlaps as C,contains as O,intersects as R}from"./geometryEngineAsync-B-ooCYDN.js";import"./ImmutableArray-BlMso3qf.js";import"./number-Bu1a2qyF.js";import"./featureConversionUtils-CmP9mw0r.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./WhereClause-Dzgyc0wk.js";function f(r){return r instanceof o}function a(r,t,s,d){return d(r,t,async(y,e,n)=>{if(n.length<2)throw new u(r,l.WrongNumberOfParameters,t);if((n=S(n))[0]===null&&n[1]===null)return!1;if(i(n[0])){if(n[1]instanceof o)return new h({parentfeatureset:n[0],relation:s,relationGeom:n[1]});if(n[1]===null)return new c({parentfeatureset:n[0]});throw new u(r,l.InvalidParameter,t)}if(f(n[0])){if(f(n[1])){switch(s){case"esriSpatialRelEnvelopeIntersects":return R(w(n[0]),w(n[1]));case"esriSpatialRelIntersects":return R(n[0],n[1]);case"esriSpatialRelContains":return O(n[0],n[1]);case"esriSpatialRelOverlaps":return C(n[0],n[1]);case"esriSpatialRelWithin":return g(n[0],n[1]);case"esriSpatialRelTouches":return P(n[0],n[1]);case"esriSpatialRelCrosses":return A(n[0],n[1])}throw new u(r,l.InvalidParameter,t)}if(i(n[1]))return new h({parentfeatureset:n[1],relation:s,relationGeom:n[0]});if(n[1]===null)return!1;throw new u(r,l.InvalidParameter,t)}if(n[0]!==null)throw new u(r,l.InvalidParameter,t);return i(n[1])?new c({parentfeatureset:n[1]}):!(n[1]instanceof o||n[1]===null)&&void 0})}function z(r){r.mode==="async"&&(r.functions.intersects=function(t,s){return a(t,s,"esriSpatialRelIntersects",r.standardFunctionAsync)},r.functions.envelopeintersects=function(t,s){return a(t,s,"esriSpatialRelEnvelopeIntersects",r.standardFunctionAsync)},r.signatures.push({name:"envelopeintersects",min:2,max:2}),r.functions.contains=function(t,s){return a(t,s,"esriSpatialRelContains",r.standardFunctionAsync)},r.functions.overlaps=function(t,s){return a(t,s,"esriSpatialRelOverlaps",r.standardFunctionAsync)},r.functions.within=function(t,s){return a(t,s,"esriSpatialRelWithin",r.standardFunctionAsync)},r.functions.touches=function(t,s){return a(t,s,"esriSpatialRelTouches",r.standardFunctionAsync)},r.functions.crosses=function(t,s){return a(t,s,"esriSpatialRelCrosses",r.standardFunctionAsync)},r.functions.relate=function(t,s){return r.standardFunctionAsync(t,s,(d,y,e)=>{if(e=S(e),F(e,3,3,t,s),f(e[0])&&f(e[1]))return I(e[0],e[1],p(e[2]));if(e[0]instanceof o&&e[1]===null||e[1]instanceof o&&e[0]===null)return!1;if(i(e[0])&&e[1]===null)return new c({parentfeatureset:e[0]});if(i(e[1])&&e[0]===null)return new c({parentfeatureset:e[1]});if(i(e[0])&&e[1]instanceof o)return e[0].relate(e[1],p(e[2]));if(i(e[1])&&e[0]instanceof o)return e[1].relate(e[0],p(e[2]));if(e[0]===null&&e[1]===null)return!1;throw new u(t,l.InvalidParameter,s)})})}export{z as registerFunctions}; +import{T as S,a as F,d as p,B as i,b as u,r as l}from"./arcadeUtils-BxUF81hz.js";import{s as w}from"./TimeOnly-BXSODLxA.js";import{u as c,f as h}from"./SpatialFilter-D9TNROUn.js";import{et as o}from"./index-BjUNJPVf.js";import{relate as I,crosses as A,touches as P,within as g,overlaps as C,contains as O,intersects as R}from"./geometryEngineAsync-wvmuP1s9.js";import"./ImmutableArray-BlMso3qf.js";import"./number-CJqenc9O.js";import"./featureConversionUtils-BHhm7bvm.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./WhereClause-Ctld7DSu.js";function f(r){return r instanceof o}function a(r,t,s,d){return d(r,t,async(y,e,n)=>{if(n.length<2)throw new u(r,l.WrongNumberOfParameters,t);if((n=S(n))[0]===null&&n[1]===null)return!1;if(i(n[0])){if(n[1]instanceof o)return new h({parentfeatureset:n[0],relation:s,relationGeom:n[1]});if(n[1]===null)return new c({parentfeatureset:n[0]});throw new u(r,l.InvalidParameter,t)}if(f(n[0])){if(f(n[1])){switch(s){case"esriSpatialRelEnvelopeIntersects":return R(w(n[0]),w(n[1]));case"esriSpatialRelIntersects":return R(n[0],n[1]);case"esriSpatialRelContains":return O(n[0],n[1]);case"esriSpatialRelOverlaps":return C(n[0],n[1]);case"esriSpatialRelWithin":return g(n[0],n[1]);case"esriSpatialRelTouches":return P(n[0],n[1]);case"esriSpatialRelCrosses":return A(n[0],n[1])}throw new u(r,l.InvalidParameter,t)}if(i(n[1]))return new h({parentfeatureset:n[1],relation:s,relationGeom:n[0]});if(n[1]===null)return!1;throw new u(r,l.InvalidParameter,t)}if(n[0]!==null)throw new u(r,l.InvalidParameter,t);return i(n[1])?new c({parentfeatureset:n[1]}):!(n[1]instanceof o||n[1]===null)&&void 0})}function z(r){r.mode==="async"&&(r.functions.intersects=function(t,s){return a(t,s,"esriSpatialRelIntersects",r.standardFunctionAsync)},r.functions.envelopeintersects=function(t,s){return a(t,s,"esriSpatialRelEnvelopeIntersects",r.standardFunctionAsync)},r.signatures.push({name:"envelopeintersects",min:2,max:2}),r.functions.contains=function(t,s){return a(t,s,"esriSpatialRelContains",r.standardFunctionAsync)},r.functions.overlaps=function(t,s){return a(t,s,"esriSpatialRelOverlaps",r.standardFunctionAsync)},r.functions.within=function(t,s){return a(t,s,"esriSpatialRelWithin",r.standardFunctionAsync)},r.functions.touches=function(t,s){return a(t,s,"esriSpatialRelTouches",r.standardFunctionAsync)},r.functions.crosses=function(t,s){return a(t,s,"esriSpatialRelCrosses",r.standardFunctionAsync)},r.functions.relate=function(t,s){return r.standardFunctionAsync(t,s,(d,y,e)=>{if(e=S(e),F(e,3,3,t,s),f(e[0])&&f(e[1]))return I(e[0],e[1],p(e[2]));if(e[0]instanceof o&&e[1]===null||e[1]instanceof o&&e[0]===null)return!1;if(i(e[0])&&e[1]===null)return new c({parentfeatureset:e[0]});if(i(e[1])&&e[0]===null)return new c({parentfeatureset:e[1]});if(i(e[0])&&e[1]instanceof o)return e[0].relate(e[1],p(e[2]));if(i(e[1])&&e[0]instanceof o)return e[1].relate(e[0],p(e[2]));if(e[0]===null&&e[1]===null)return!1;throw new u(t,l.InvalidParameter,s)})})}export{z as registerFunctions}; diff --git a/assets/featuresetstats-0jxQEihT.js b/assets/featuresetstats-442f9v7H.js similarity index 84% rename from assets/featuresetstats-0jxQEihT.js rename to assets/featuresetstats-442f9v7H.js index 71b2541..fd99b99 100644 --- a/assets/featuresetstats-0jxQEihT.js +++ b/assets/featuresetstats-442f9v7H.js @@ -1 +1 @@ -import{m as g}from"./TimeOnly-Cm47ew5I.js";import{a as F,B as m,U as l,G as h,Q as d,b as w,r as v,P as f,v as c,q as S}from"./arcadeUtils-BoaybaAR.js";import{x as p,r as x}from"./WhereClause-Dzgyc0wk.js";import"./index-CEWggaxV.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./ImmutableArray-BlMso3qf.js";import"./number-Bu1a2qyF.js";import"./featureConversionUtils-CmP9mw0r.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./FieldsIndex-CLgRNeJ_.js";async function s(n,r,a,t,i,e){if(t.length===1){if(l(t[0]))return f(n,t[0],c(t[1],-1));if(d(t[0]))return f(n,t[0].toArray(),c(t[1],-1))}else if(t.length===2){if(l(t[0]))return f(n,t[0],c(t[1],-1));if(d(t[0]))return f(n,t[0].toArray(),c(t[1],-1));if(m(t[0])){const o=await t[0].load(),u=await A(p.create(t[1],o.getFieldsIndex(),o.dateFieldsTimeZoneDefaultUTC),e,i);return y(i,await t[0].calculateStatistic(n,u,c(t[2],1e3),r.abortSignal))}}else if(t.length===3&&m(t[0])){const o=await t[0].load(),u=await A(p.create(t[1],o.getFieldsIndex(),o.dateFieldsTimeZoneDefaultUTC),e,i);return y(i,await t[0].calculateStatistic(n,u,c(t[2],1e3),r.abortSignal))}return f(n,t,-1)}function y(n,r){return r instanceof x?g.fromReaderAsTimeStampOffset(r.toStorageFormat()):r instanceof Date?g.dateJSAndZoneToArcadeDate(r,S(n)):r}async function A(n,r,a){const t=n.getVariables();if(t.length>0){const i=[];for(let o=0;os("stdev",t,i,e,r,n))},n.functions.variance=function(r,a){return n.standardFunctionAsync(r,a,(t,i,e)=>s("variance",t,i,e,r,n))},n.functions.average=function(r,a){return n.standardFunctionAsync(r,a,(t,i,e)=>s("mean",t,i,e,r,n))},n.functions.mean=function(r,a){return n.standardFunctionAsync(r,a,(t,i,e)=>s("mean",t,i,e,r,n))},n.functions.sum=function(r,a){return n.standardFunctionAsync(r,a,(t,i,e)=>s("sum",t,i,e,r,n))},n.functions.min=function(r,a){return n.standardFunctionAsync(r,a,(t,i,e)=>s("min",t,i,e,r,n))},n.functions.max=function(r,a){return n.standardFunctionAsync(r,a,(t,i,e)=>s("max",t,i,e,r,n))},n.functions.count=function(r,a){return n.standardFunctionAsync(r,a,(t,i,e)=>{if(F(e,1,1,r,a),m(e[0]))return e[0].count(t.abortSignal);if(l(e[0])||h(e[0]))return e[0].length;if(d(e[0]))return e[0].length();throw new w(r,v.InvalidParameter,a)})})}export{G as registerFunctions}; +import{m as g}from"./TimeOnly-BXSODLxA.js";import{a as F,B as m,U as l,G as h,Q as d,b as w,r as v,P as f,v as c,q as S}from"./arcadeUtils-BxUF81hz.js";import{x as p,r as x}from"./WhereClause-Ctld7DSu.js";import"./index-BjUNJPVf.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./ImmutableArray-BlMso3qf.js";import"./number-CJqenc9O.js";import"./featureConversionUtils-BHhm7bvm.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./FieldsIndex-CK-0B5n9.js";async function s(n,r,a,t,i,e){if(t.length===1){if(l(t[0]))return f(n,t[0],c(t[1],-1));if(d(t[0]))return f(n,t[0].toArray(),c(t[1],-1))}else if(t.length===2){if(l(t[0]))return f(n,t[0],c(t[1],-1));if(d(t[0]))return f(n,t[0].toArray(),c(t[1],-1));if(m(t[0])){const o=await t[0].load(),u=await A(p.create(t[1],o.getFieldsIndex(),o.dateFieldsTimeZoneDefaultUTC),e,i);return y(i,await t[0].calculateStatistic(n,u,c(t[2],1e3),r.abortSignal))}}else if(t.length===3&&m(t[0])){const o=await t[0].load(),u=await A(p.create(t[1],o.getFieldsIndex(),o.dateFieldsTimeZoneDefaultUTC),e,i);return y(i,await t[0].calculateStatistic(n,u,c(t[2],1e3),r.abortSignal))}return f(n,t,-1)}function y(n,r){return r instanceof x?g.fromReaderAsTimeStampOffset(r.toStorageFormat()):r instanceof Date?g.dateJSAndZoneToArcadeDate(r,S(n)):r}async function A(n,r,a){const t=n.getVariables();if(t.length>0){const i=[];for(let o=0;os("stdev",t,i,e,r,n))},n.functions.variance=function(r,a){return n.standardFunctionAsync(r,a,(t,i,e)=>s("variance",t,i,e,r,n))},n.functions.average=function(r,a){return n.standardFunctionAsync(r,a,(t,i,e)=>s("mean",t,i,e,r,n))},n.functions.mean=function(r,a){return n.standardFunctionAsync(r,a,(t,i,e)=>s("mean",t,i,e,r,n))},n.functions.sum=function(r,a){return n.standardFunctionAsync(r,a,(t,i,e)=>s("sum",t,i,e,r,n))},n.functions.min=function(r,a){return n.standardFunctionAsync(r,a,(t,i,e)=>s("min",t,i,e,r,n))},n.functions.max=function(r,a){return n.standardFunctionAsync(r,a,(t,i,e)=>s("max",t,i,e,r,n))},n.functions.count=function(r,a){return n.standardFunctionAsync(r,a,(t,i,e)=>{if(F(e,1,1,r,a),m(e[0]))return e[0].count(t.abortSignal);if(l(e[0])||h(e[0]))return e[0].length;if(d(e[0]))return e[0].length();throw new w(r,v.InvalidParameter,a)})})}export{G as registerFunctions}; diff --git a/assets/featuresetstring-DtQ-AsWo.js b/assets/featuresetstring-TQgTDW3a.js similarity index 90% rename from assets/featuresetstring-DtQ-AsWo.js rename to assets/featuresetstring-TQgTDW3a.js index cc08cca..bb14b27 100644 --- a/assets/featuresetstring-DtQ-AsWo.js +++ b/assets/featuresetstring-TQgTDW3a.js @@ -1 +1 @@ -import{a as o,H as s,$ as T,d as u,B as c,a0 as f,b as m,r as y,a1 as b,N as v,q as p,a2 as A,a3 as g,a4 as x,a5 as V,a6 as F,v as D,a7 as j,a8 as l}from"./arcadeUtils-BoaybaAR.js";import"./index-CEWggaxV.js";import"./TimeOnly-Cm47ew5I.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./ImmutableArray-BlMso3qf.js";import"./number-Bu1a2qyF.js";import"./featureConversionUtils-CmP9mw0r.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./FieldsIndex-CLgRNeJ_.js";function w(a,e){return a&&a.domain?a.domain.type==="coded-value"||a.domain.type==="codedValue"?v.convertObjectToArcadeDictionary({type:"codedValue",name:a.domain.name,dataType:l[a.field.type],codedValues:a.domain.codedValues.map(t=>({name:t.name,code:t.code}))},p(e)):v.convertObjectToArcadeDictionary({type:"range",name:a.domain.name,dataType:l[a.field.type],min:a.domain.minValue,max:a.domain.maxValue},p(e)):null}function S(a){a.mode==="async"&&(a.functions.domain=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,2,3,e,t),s(n[0]))return w(T(n[0],u(n[1]),n[2]===void 0?void 0:n[2]),e);if(c(n[0]))return await n[0]._ensureLoaded(),w(f(u(n[1]),n[0],null,n[2]===void 0?void 0:n[2]),e);throw new m(e,y.InvalidParameter,t)})},a.functions.subtypes=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,1,1,e,t),s(n[0])){const r=b(n[0]);return r?v.convertObjectToArcadeDictionary(r,p(e)):null}if(c(n[0])){await n[0]._ensureLoaded();const r=n[0].subtypeMetaData();return r?v.convertObjectToArcadeDictionary(r,p(e)):null}throw new m(e,y.InvalidParameter,t)})},a.functions.domainname=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,2,4,e,t),s(n[0]))return A(n[0],u(n[1]),n[2],n[3]===void 0?void 0:n[3]);if(c(n[0])){await n[0]._ensureLoaded();const r=f(u(n[1]),n[0],null,n[3]===void 0?void 0:n[3]);return g(r,n[2])}throw new m(e,y.InvalidParameter,t)})},a.signatures.push({name:"domainname",min:2,max:4}),a.functions.domaincode=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,2,4,e,t),s(n[0]))return x(n[0],u(n[1]),n[2],n[3]===void 0?void 0:n[3]);if(c(n[0])){await n[0]._ensureLoaded();const r=f(u(n[1]),n[0],null,n[3]===void 0?void 0:n[3]);return V(r,n[2])}throw new m(e,y.InvalidParameter,t)})},a.signatures.push({name:"domaincode",min:2,max:4})),a.functions.text=function(e,t){return a.standardFunctionAsync(e,t,(i,d,n)=>{if(o(n,1,2,e,t),!c(n[0]))return F(n[0],n[1]);{const r=D(n[1],"");if(r==="")return n[0].castToText();if(r.toLowerCase()==="schema")return n[0].convertToText("schema",i.abortSignal);if(r.toLowerCase()==="featureset")return n[0].convertToText("featureset",i.abortSignal)}})},a.functions.gdbversion=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,1,1,e,t),s(n[0]))return n[0].gdbVersion();if(c(n[0]))return(await n[0].load()).gdbVersion;throw new m(e,y.InvalidParameter,t)})},a.functions.schema=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,1,1,e,t),c(n[0]))return await n[0].load(),v.convertObjectToArcadeDictionary(n[0].schema(),p(e));if(s(n[0])){const r=j(n[0]);return r?v.convertObjectToArcadeDictionary(r,p(e)):null}throw new m(e,y.InvalidParameter,t)})}}export{S as registerFunctions}; +import{a as o,H as s,$ as T,d as u,B as c,a0 as f,b as m,r as y,a1 as b,N as v,q as p,a2 as A,a3 as g,a4 as x,a5 as V,a6 as F,v as D,a7 as j,a8 as l}from"./arcadeUtils-BxUF81hz.js";import"./index-BjUNJPVf.js";import"./TimeOnly-BXSODLxA.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./ImmutableArray-BlMso3qf.js";import"./number-CJqenc9O.js";import"./featureConversionUtils-BHhm7bvm.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./FieldsIndex-CK-0B5n9.js";function w(a,e){return a&&a.domain?a.domain.type==="coded-value"||a.domain.type==="codedValue"?v.convertObjectToArcadeDictionary({type:"codedValue",name:a.domain.name,dataType:l[a.field.type],codedValues:a.domain.codedValues.map(t=>({name:t.name,code:t.code}))},p(e)):v.convertObjectToArcadeDictionary({type:"range",name:a.domain.name,dataType:l[a.field.type],min:a.domain.minValue,max:a.domain.maxValue},p(e)):null}function S(a){a.mode==="async"&&(a.functions.domain=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,2,3,e,t),s(n[0]))return w(T(n[0],u(n[1]),n[2]===void 0?void 0:n[2]),e);if(c(n[0]))return await n[0]._ensureLoaded(),w(f(u(n[1]),n[0],null,n[2]===void 0?void 0:n[2]),e);throw new m(e,y.InvalidParameter,t)})},a.functions.subtypes=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,1,1,e,t),s(n[0])){const r=b(n[0]);return r?v.convertObjectToArcadeDictionary(r,p(e)):null}if(c(n[0])){await n[0]._ensureLoaded();const r=n[0].subtypeMetaData();return r?v.convertObjectToArcadeDictionary(r,p(e)):null}throw new m(e,y.InvalidParameter,t)})},a.functions.domainname=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,2,4,e,t),s(n[0]))return A(n[0],u(n[1]),n[2],n[3]===void 0?void 0:n[3]);if(c(n[0])){await n[0]._ensureLoaded();const r=f(u(n[1]),n[0],null,n[3]===void 0?void 0:n[3]);return g(r,n[2])}throw new m(e,y.InvalidParameter,t)})},a.signatures.push({name:"domainname",min:2,max:4}),a.functions.domaincode=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,2,4,e,t),s(n[0]))return x(n[0],u(n[1]),n[2],n[3]===void 0?void 0:n[3]);if(c(n[0])){await n[0]._ensureLoaded();const r=f(u(n[1]),n[0],null,n[3]===void 0?void 0:n[3]);return V(r,n[2])}throw new m(e,y.InvalidParameter,t)})},a.signatures.push({name:"domaincode",min:2,max:4})),a.functions.text=function(e,t){return a.standardFunctionAsync(e,t,(i,d,n)=>{if(o(n,1,2,e,t),!c(n[0]))return F(n[0],n[1]);{const r=D(n[1],"");if(r==="")return n[0].castToText();if(r.toLowerCase()==="schema")return n[0].convertToText("schema",i.abortSignal);if(r.toLowerCase()==="featureset")return n[0].convertToText("featureset",i.abortSignal)}})},a.functions.gdbversion=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,1,1,e,t),s(n[0]))return n[0].gdbVersion();if(c(n[0]))return(await n[0].load()).gdbVersion;throw new m(e,y.InvalidParameter,t)})},a.functions.schema=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,1,1,e,t),c(n[0]))return await n[0].load(),v.convertObjectToArcadeDictionary(n[0].schema(),p(e));if(s(n[0])){const r=j(n[0]);return r?v.convertObjectToArcadeDictionary(r,p(e)):null}throw new m(e,y.InvalidParameter,t)})}}export{S as registerFunctions}; diff --git a/assets/fetchService-C38RarY2.js b/assets/fetchService-Crgml5qT.js similarity index 91% rename from assets/fetchService-C38RarY2.js rename to assets/fetchService-Crgml5qT.js index 0ebf38c..63e22d2 100644 --- a/assets/fetchService-C38RarY2.js +++ b/assets/fetchService-Crgml5qT.js @@ -1 +1 @@ -import{t as o}from"./lazyLayerLoader-s-GqbiwM.js";async function h(t,r){const{loadContext:a,...e}=r||{},n=a?await a.fetchServiceMetadata(t,e):await o(t,e);y(n),l(n);const s={serviceJSON:n};if((n.currentVersion??0)<10.5)return s;const c=`${t}/layers`,i=a?await a.fetchServiceMetadata(c,e):await o(c,e);return y(i),l(i),s.layersJSON={layers:i.layers,tables:i.tables},s}function f(t){return t.type==="Feature Layer"||t.type==="Oriented Imagery Layer"}function u(t){return t.type==="Table"}function l(t){var r,a;t.layers=(r=t.layers)==null?void 0:r.filter(f),t.tables=(a=t.tables)==null?void 0:a.filter(u)}function b(t){t.type||(t.type="Feature Layer")}function p(t){t.type||(t.type="Table")}function y(t){var r,a;(r=t.layers)==null||r.forEach(b),(a=t.tables)==null||a.forEach(p)}export{h as t}; +import{t as o}from"./lazyLayerLoader-Cu0XtDD2.js";async function h(t,r){const{loadContext:a,...e}=r||{},n=a?await a.fetchServiceMetadata(t,e):await o(t,e);y(n),l(n);const s={serviceJSON:n};if((n.currentVersion??0)<10.5)return s;const c=`${t}/layers`,i=a?await a.fetchServiceMetadata(c,e):await o(c,e);return y(i),l(i),s.layersJSON={layers:i.layers,tables:i.tables},s}function f(t){return t.type==="Feature Layer"||t.type==="Oriented Imagery Layer"}function u(t){return t.type==="Table"}function l(t){var r,a;t.layers=(r=t.layers)==null?void 0:r.filter(f),t.tables=(a=t.tables)==null?void 0:a.filter(u)}function b(t){t.type||(t.type="Feature Layer")}function p(t){t.type||(t.type="Table")}function y(t){var r,a;(r=t.layers)==null||r.forEach(b),(a=t.tables)==null||a.forEach(p)}export{h as t}; diff --git a/assets/fieldProperties-DMs4wT6-.js b/assets/fieldProperties-DnrQXLBM.js similarity index 89% rename from assets/fieldProperties-DMs4wT6-.js rename to assets/fieldProperties-DnrQXLBM.js index c443b81..2f9cdba 100644 --- a/assets/fieldProperties-DMs4wT6-.js +++ b/assets/fieldProperties-DnrQXLBM.js @@ -1 +1 @@ -import{a_ as n,E as l,s as r,b6 as o}from"./index-CEWggaxV.js";import{Z as d}from"./FieldsIndex-CLgRNeJ_.js";function a(){return{fields:{type:[n],value:null,set:function(e){if(e&&l("big-integer-warning-enabled")){const i=e.filter(t=>t.type==="big-integer"||t.type==="oid"&&(t.length||0)>=8);if(i.length){const t=i.map(s=>`'${s.name}'`).join(", ");r.getLogger(this).warn("#fields",`Layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}') references big-integer field(s): ${t}, support for which is experimental. Only integers less than ${Number.MAX_SAFE_INTEGER} (Number.MAX_SAFE_INTEGER) are supported.`)}}this._set("fields",e)}},fieldsIndex:{readOnly:!0,get(){return d.fromLayer(this)}},outFields:{type:[String],json:{read:!1},set:function(e){this._userOutFields=e,this.notifyChange("outFields")},get:function(){var i;const e=this._userOutFields;if(!(e!=null&&e.length))return null;if(e.includes("*"))return["*"];if(!this.fields)return e;for(const t of e)((i=this.fieldsIndex)==null?void 0:i.has(t))||r.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${t} found in outFields`,{layer:this,outFields:e});return o(this.fieldsIndex,e)}}}}export{a as s}; +import{a_ as n,E as l,s as r,b6 as o}from"./index-BjUNJPVf.js";import{Z as d}from"./FieldsIndex-CK-0B5n9.js";function a(){return{fields:{type:[n],value:null,set:function(e){if(e&&l("big-integer-warning-enabled")){const i=e.filter(t=>t.type==="big-integer"||t.type==="oid"&&(t.length||0)>=8);if(i.length){const t=i.map(s=>`'${s.name}'`).join(", ");r.getLogger(this).warn("#fields",`Layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}') references big-integer field(s): ${t}, support for which is experimental. Only integers less than ${Number.MAX_SAFE_INTEGER} (Number.MAX_SAFE_INTEGER) are supported.`)}}this._set("fields",e)}},fieldsIndex:{readOnly:!0,get(){return d.fromLayer(this)}},outFields:{type:[String],json:{read:!1},set:function(e){this._userOutFields=e,this.notifyChange("outFields")},get:function(){var i;const e=this._userOutFields;if(!(e!=null&&e.length))return null;if(e.includes("*"))return["*"];if(!this.fields)return e;for(const t of e)((i=this.fieldsIndex)==null?void 0:i.has(t))||r.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${t} found in outFields`,{layer:this,outFields:e});return o(this.fieldsIndex,e)}}}}export{a as s}; diff --git a/assets/floatRGBA-BLm-Rhaq.js b/assets/floatRGBA-Cs54GdjG.js similarity index 83% rename from assets/floatRGBA-BLm-Rhaq.js rename to assets/floatRGBA-Cs54GdjG.js index 84b4469..3745c03 100644 --- a/assets/floatRGBA-BLm-Rhaq.js +++ b/assets/floatRGBA-Cs54GdjG.js @@ -1 +1 @@ -import{I as f}from"./index-CEWggaxV.js";function p(o,e,t=0){const r=f(o,0,c);for(let n=0;n<4;n++)e[t+n]=Math.floor(256*u(r*i[n]))}function l(o,e=0){let t=0;for(let r=0;r<4;r++)t+=o[e+r]*a[r];return t}const i=[1,256,65536,16777216],a=[1/256,1/65536,1/16777216,1/4294967296],c=l(new Uint8ClampedArray([255,255,255,255]));function u(o){return o-Math.floor(o)}export{p as o,l as r}; +import{I as f}from"./index-BjUNJPVf.js";function p(o,e,t=0){const r=f(o,0,c);for(let n=0;n<4;n++)e[t+n]=Math.floor(256*u(r*i[n]))}function l(o,e=0){let t=0;for(let r=0;r<4;r++)t+=o[e+r]*a[r];return t}const i=[1,256,65536,16777216],a=[1/256,1/65536,1/16777216,1/4294967296],c=l(new Uint8ClampedArray([255,255,255,255]));function u(o){return o-Math.floor(o)}export{p as o,l as r}; diff --git a/assets/form-D5ySy5kP.js b/assets/form-BC9xTZIq.js similarity index 99% rename from assets/form-D5ySy5kP.js rename to assets/form-BC9xTZIq.js index 22218f3..747abe8 100644 --- a/assets/form-D5ySy5kP.js +++ b/assets/form-BC9xTZIq.js @@ -1,4 +1,4 @@ -import{q as S,c as I}from"./dom-DPsTWDAQ.js";import{c0 as V}from"./index-CEWggaxV.js";/*! +import{q as S,c as I}from"./dom-DPsTWDAQ.js";import{c0 as V}from"./index-BjUNJPVf.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.7.1 diff --git a/assets/geohashUtils-CTQSvgbV.js b/assets/geohashUtils-DEscCvdk.js similarity index 91% rename from assets/geohashUtils-CTQSvgbV.js rename to assets/geohashUtils-DEscCvdk.js index ce06a72..89f0238 100644 --- a/assets/geohashUtils-CTQSvgbV.js +++ b/assets/geohashUtils-DEscCvdk.js @@ -1 +1 @@ -import{aB as A,aE as B,aS as g,cN as j,cO as w}from"./index-CEWggaxV.js";import{K as R}from"./featureConversionUtils-CmP9mw0r.js";import{e as v}from"./OptimizedGeometry-CQuTPb9g.js";import{j as b}from"./timeSupport-BjRbXIpn.js";const E=new Float64Array(2),F=new Float64Array(2),T="0123456789bcdefghjkmnpqrstuvwxyz",Y=64;function O(n,e,r,a){const t=[n.xmin,n.ymin,n.xmax,n.ymax],s=A.fromExtent(B.fromBounds(t,a)),c=b(s,a,g.WGS84,{densificationStep:e*Y});if(!c)return null;const o=R(new v,c,!1,!1),u=o.coords.filter((W,h)=>!(h%2)),i=o.coords.filter((W,h)=>h%2),d=Math.min(...u),M=Math.min(...i),l=Math.max(...u),m=Math.max(...i),f=G(d,M,r,g.WGS84),y=G(l,m,r,g.WGS84);return f&&y?{bounds:t,geohashBounds:{xLL:f[0],yLL:f[1],xTR:y[0],yTR:y[1]},level:r}:null}function G(n,e,r,a){if(a.isWebMercator){const c=j(n/w.radius),o=c-360*Math.floor((c+180)/360),u=[0,0];return $(u,0,j(Math.PI/2-2*Math.atan(Math.exp(-e/w.radius))),o,r),u}const t=b({x:n,y:e},a,g.WGS84);if(!t)return null;const s=[0,0];return $(s,0,t.y,t.x,r),s}function k(n){return T[n]}function z(n){return(n[0]+n[1])/2}function L(n,e,r){return n[0]=e,n[1]=r,n}function q(n,e){const r=z(n),a=e,t=!e;n[0]=t*n[0]+a*r,n[1]=t*r+a*n[1]}function x(n,e){const r=e>z(n);return q(n,r),r}function P(n,e){let r=-90,a=90,t=-180,s=180;for(let c=0;c>d,W=(f&n.geohashY)>>M;for(let h=l-1;h>=0;h--){const S=(t+s)/2,p=y&1<=0;h--){const S=(r+a)/2,p=W&1<m?1:0;s|=f<<29-(l+5*M),i=(1-f)*i+f*m,d=(1-f)*m+f*d}for(let l=0;l<5;l++){const m=(o+u)/2,f=r>m?1:0;c|=f<<29-(l+5*M),o=(1-f)*o+f*m,u=(1-f)*m+f*u}}n[2*e]=s,n[2*e+1]=c}function X(n,e,r){let a="";const t=L(E,-90,90),s=L(F,-180,180);for(let c=0;c!(h%2)),i=o.coords.filter((W,h)=>h%2),d=Math.min(...u),M=Math.min(...i),l=Math.max(...u),m=Math.max(...i),f=G(d,M,r,g.WGS84),y=G(l,m,r,g.WGS84);return f&&y?{bounds:t,geohashBounds:{xLL:f[0],yLL:f[1],xTR:y[0],yTR:y[1]},level:r}:null}function G(n,e,r,a){if(a.isWebMercator){const c=j(n/w.radius),o=c-360*Math.floor((c+180)/360),u=[0,0];return $(u,0,j(Math.PI/2-2*Math.atan(Math.exp(-e/w.radius))),o,r),u}const t=b({x:n,y:e},a,g.WGS84);if(!t)return null;const s=[0,0];return $(s,0,t.y,t.x,r),s}function k(n){return T[n]}function z(n){return(n[0]+n[1])/2}function L(n,e,r){return n[0]=e,n[1]=r,n}function q(n,e){const r=z(n),a=e,t=!e;n[0]=t*n[0]+a*r,n[1]=t*r+a*n[1]}function x(n,e){const r=e>z(n);return q(n,r),r}function P(n,e){let r=-90,a=90,t=-180,s=180;for(let c=0;c>d,W=(f&n.geohashY)>>M;for(let h=l-1;h>=0;h--){const S=(t+s)/2,p=y&1<=0;h--){const S=(r+a)/2,p=W&1<m?1:0;s|=f<<29-(l+5*M),i=(1-f)*i+f*m,d=(1-f)*m+f*d}for(let l=0;l<5;l++){const m=(o+u)/2,f=r>m?1:0;c|=f<<29-(l+5*M),o=(1-f)*o+f*m,u=(1-f)*m+f*u}}n[2*e]=s,n[2*e+1]=c}function X(n,e,r){let a="";const t=L(E,-90,90),s=L(F,-180,180);for(let c=0;c2)return!0;return!1}function Z(t){return!T(t)}function H(t){return T(t)}function T(t){let n=0;for(let o=0;o=0;e--)S(t,n[e],o);t.lengths.push(n.length)}function S(t,n,o){const[e,r,s]=n;t.coords.push(e,r),o.hasZ&&t.coords.push(s||0)}function W(t){switch(typeof t){case"string":return I(t)?"esriFieldTypeDate":"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function tt(t,n=4326){if(!t)throw new P("geojson-layer:empty","GeoJSON data is empty");if(t.type!=="Feature"&&t.type!=="FeatureCollection")throw new P("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:t});const{crs:o}=t;if(!o)return;const e=typeof o=="string"?o:o.type==="name"?o.properties.name:o.type==="EPSG"?o.properties.code:null,r=C({wkid:n})?new RegExp(".*(CRS84H?|4326)$","i"):new RegExp(`.*(${n})$`,"i");if(!e||!r.test(e))throw new P("geojson:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:o})}function nt(t,n={}){const o=[],e=new Set,r=new Set;let s,y=!1,i=null,l=!1,{geometryType:c=null}=n,m=!1;for(const d of M(t)){const{geometry:h,properties:u,id:a}=d;if((!h||(c||(c=b(h.type)),b(h.type)===c))&&(y||(y=A(R(h))),l||(l=a!=null,l&&(s=typeof a,u&&(i=Object.keys(u).filter(p=>u[p]===a)))),u&&i&&l&&a!=null&&(i.length>1?i=i.filter(p=>u[p]===a):i.length===1&&(i=u[i[0]]===a?i:[])),!m&&u)){let p=!0;for(const f in u){if(e.has(f))continue;const F=u[f];if(F==null){p=!1,r.add(f);continue}const G=W(F);if(G==="unknown"){r.add(f);continue}r.delete(f),e.add(f);const j=k(f);j&&o.push({name:j,alias:f,type:G})}m=p}}const w=k((i==null?void 0:i.length)===1&&i[0]||null)??void 0;if(w){for(const d of o)if(d.name===w&&E(d)){d.type="esriFieldTypeOID";break}}return{fields:o,geometryType:c,hasZ:y,objectIdFieldName:w,objectIdFieldType:s,unknownFields:Array.from(r)}}function ot(t,n){return Array.from(v(M(t),n))}export{tt as E,nt as I,ot as N,b as u}; +import{t as I}from"./date-M6n_RqpC.js";import{N as P,cG as C,a3 as k,Q as E}from"./index-BjUNJPVf.js";import{t as x,e as D}from"./OptimizedGeometry-CQuTPb9g.js";const J={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function b(t){return J[t]}function*M(t){switch(t.type){case"Feature":yield t;break;case"FeatureCollection":for(const n of t.features)n&&(yield n)}}function*R(t){if(t)switch(t.type){case"Point":yield t.coordinates;break;case"LineString":case"MultiPoint":yield*t.coordinates;break;case"MultiLineString":case"Polygon":for(const n of t.coordinates)yield*n;break;case"MultiPolygon":for(const n of t.coordinates)for(const o of n)yield*o}}function*v(t,n={}){const{geometryType:o,objectIdField:e}=n;for(const r of t){const{geometry:s,properties:y,id:i}=r;if(s&&b(s.type)!==o)continue;const l=y||{};let c;e&&(c=l[e],i==null||c||(l[e]=c=i)),yield new x(s?Q(new D,s,n):null,l,null,c??void 0)}}function A(t){for(const n of t)if(n.length>2)return!0;return!1}function Z(t){return!T(t)}function H(t){return T(t)}function T(t){let n=0;for(let o=0;o=0;e--)S(t,n[e],o);t.lengths.push(n.length)}function S(t,n,o){const[e,r,s]=n;t.coords.push(e,r),o.hasZ&&t.coords.push(s||0)}function W(t){switch(typeof t){case"string":return I(t)?"esriFieldTypeDate":"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function tt(t,n=4326){if(!t)throw new P("geojson-layer:empty","GeoJSON data is empty");if(t.type!=="Feature"&&t.type!=="FeatureCollection")throw new P("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:t});const{crs:o}=t;if(!o)return;const e=typeof o=="string"?o:o.type==="name"?o.properties.name:o.type==="EPSG"?o.properties.code:null,r=C({wkid:n})?new RegExp(".*(CRS84H?|4326)$","i"):new RegExp(`.*(${n})$`,"i");if(!e||!r.test(e))throw new P("geojson:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:o})}function nt(t,n={}){const o=[],e=new Set,r=new Set;let s,y=!1,i=null,l=!1,{geometryType:c=null}=n,m=!1;for(const d of M(t)){const{geometry:h,properties:u,id:a}=d;if((!h||(c||(c=b(h.type)),b(h.type)===c))&&(y||(y=A(R(h))),l||(l=a!=null,l&&(s=typeof a,u&&(i=Object.keys(u).filter(p=>u[p]===a)))),u&&i&&l&&a!=null&&(i.length>1?i=i.filter(p=>u[p]===a):i.length===1&&(i=u[i[0]]===a?i:[])),!m&&u)){let p=!0;for(const f in u){if(e.has(f))continue;const F=u[f];if(F==null){p=!1,r.add(f);continue}const G=W(F);if(G==="unknown"){r.add(f);continue}r.delete(f),e.add(f);const j=k(f);j&&o.push({name:j,alias:f,type:G})}m=p}}const w=k((i==null?void 0:i.length)===1&&i[0]||null)??void 0;if(w){for(const d of o)if(d.name===w&&E(d)){d.type="esriFieldTypeOID";break}}return{fields:o,geometryType:c,hasZ:y,objectIdFieldName:w,objectIdFieldType:s,unknownFields:Array.from(r)}}function ot(t,n){return Array.from(v(M(t),n))}export{tt as E,nt as I,ot as N,b as u}; diff --git a/assets/geomasync-BBmYY70D.js b/assets/geomasync-B6doa0f9.js similarity index 96% rename from assets/geomasync-BBmYY70D.js rename to assets/geomasync-B6doa0f9.js index 2179c1d..670fd58 100644 --- a/assets/geomasync-BBmYY70D.js +++ b/assets/geomasync-B6doa0f9.js @@ -1 +1 @@ -import{az as ln,M as W,et as d,aE as T,aC as F,aA as N,aB as D,aD as V,b0 as H,ax as Q,eD as on,bo as dn}from"./index-CEWggaxV.js";import{T as o,a as h,X as K,t as X,k as Y,d as z,b as s,r as u,U as P,Q as I,Z as M,B as Z,v as w,ad as G,ae as L,af as E,h as x,S as wn,ag as hn,ah as mn,E as q,ai as yn,N as S,q as O,aj as pn,ak as vn,x as _,al as gn,am as J}from"./arcadeUtils-BoaybaAR.js";import{c as A,r as C,b as y}from"./TimeOnly-Cm47ew5I.js";import{l as $}from"./portalUtils-mNGSLeDa.js";import{disjoint as Pn,intersects as In,touches as An,crosses as Fn,within as Rn,contains as xn,overlaps as bn,equals as Nn,relate as Sn,intersect as On,union as Dn,difference as jn,symmetricDifference as Tn,clip as Ln,cut as Cn,planarArea as nn,geodesicArea as en,planarLength as U,geodesicLength as B,distance as Mn,densify as rn,geodesicDensify as tn,generalize as Zn,buffer as Jn,geodesicBuffer as Un,offset as kn,rotate as an,simplify as sn,isSimple as zn,convexHull as En,nearestCoordinate as qn,nearestVertex as Bn}from"./geometryEngineAsync-B-ooCYDN.js";import"./ImmutableArray-BlMso3qf.js";import"./number-Bu1a2qyF.js";import"./featureConversionUtils-CmP9mw0r.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";async function un(a,e,r){var t,i;if(!((t=ln)==null?void 0:t.findCredential(a.restUrl)))return null;if(a.loadStatus==="loaded"&&e===""&&((i=a.user)!=null&&i.sourceJSON)&&r===!1)return a.user.sourceJSON;const l={responseType:"json",query:{f:"json"}};if(r&&(l.query.returnUserLicenseTypeExtensions=!0),e===""){const f=await W(a.restUrl+"/community/self",l);if(f.data){const m=f.data;if(m!=null&&m.username)return m}return null}const n=await W(a.restUrl+"/community/users/"+e,l);if(n.data){const f=n.data;return f.error?null:f}return null}function cn(a){return on.indexOf("4.")===0?D.fromExtent(a):new D({spatialReference:a.spatialReference,rings:[[[a.xmin,a.ymin],[a.xmin,a.ymax],[a.xmax,a.ymax],[a.xmax,a.ymin],[a.xmin,a.ymin]]]})}function R(a,e,r){if(h(a,2,2,e,r),!(a[0]instanceof d&&a[1]instanceof d)){if(!(a[0]instanceof d&&a[1]===null)){if(!(a[1]instanceof d&&a[0]===null)){if(a[0]!==null||a[1]!==null)throw new s(e,u.InvalidParameter,r)}}}}async function fn(a,e){if(a.type!=="polygon"&&a.type!=="polyline"&&a.type!=="extent")return 0;let r=1;(a.spatialReference.vcsWkid||a.spatialReference.latestVcsWkid)&&(r=gn(a.spatialReference)/dn(a.spatialReference));let c=0;if(a.type==="polyline")for(const n of a.paths)for(let t=1;t(R(n=o(n),e,r),n[0]===null||n[1]===null||Pn(n[0],n[1])))},a.functions.intersects=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>(R(n=o(n),e,r),n[0]!==null&&n[1]!==null&&In(n[0],n[1])))},a.functions.touches=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>(R(n=o(n),e,r),n[0]!==null&&n[1]!==null&&An(n[0],n[1])))},a.functions.crosses=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>(R(n=o(n),e,r),n[0]!==null&&n[1]!==null&&Fn(n[0],n[1])))},a.functions.within=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>(R(n=o(n),e,r),n[0]!==null&&n[1]!==null&&Rn(n[0],n[1])))},a.functions.contains=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>(R(n=o(n),e,r),n[0]!==null&&n[1]!==null&&xn(n[0],n[1])))},a.functions.overlaps=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>(R(n=o(n),e,r),n[0]!==null&&n[1]!==null&&bn(n[0],n[1])))},a.functions.equals=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>(h(n,2,2,e,r),n[0]===n[1]||(n[0]instanceof d&&n[1]instanceof d?Nn(n[0],n[1]):(K(n[0])&&K(n[1])||!!(X(n[0])&&X(n[1])||Y(n[0])&&Y(n[1])))&&n[0].equals(n[1]))))},a.functions.relate=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,3,3,e,r),n[0]instanceof d&&n[1]instanceof d)return Sn(n[0],n[1],z(n[2]));if(n[0]instanceof d&&n[1]===null||n[1]instanceof d&&n[0]===null||n[0]===null&&n[1]===null)return!1;throw new s(e,u.InvalidParameter,r)})},a.functions.intersection=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>(R(n=o(n),e,r),n[0]===null||n[1]===null?null:On(n[0],n[1])))},a.functions.union=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{const t=[];if((n=o(n)).length===0)throw new s(e,u.WrongNumberOfParameters,r);if(n.length===1)if(P(n[0])){const i=o(n[0]);for(let f=0;f(R(n=o(n),e,r),n[0]!==null&&n[1]===null?A(n[0]):n[0]===null?null:jn(n[0],n[1])))},a.functions.symmetricdifference=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>(R(n=o(n),e,r),n[0]===null&&n[1]===null?null:n[0]===null?A(n[1]):n[1]===null?A(n[0]):Tn(n[0],n[1])))},a.functions.clip=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,2,e,r),!(n[1]instanceof T)&&n[1]!==null)throw new s(e,u.InvalidParameter,r);if(n[0]===null)return null;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return n[1]===null?null:Ln(n[0],n[1])})},a.functions.cut=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,2,e,r),!(n[1]instanceof F)&&n[1]!==null)throw new s(e,u.InvalidParameter,r);if(n[0]===null)return[];if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return n[1]===null?[A(n[0])]:Cn(n[0],n[1])})},a.functions.area=function(e,r){return a.standardFunctionAsync(e,r,async(c,l,n)=>{if(h(n,1,2,e,r),(n=o(n))[0]===null)return 0;if(Z(n[0])){const t=await n[0].sumArea(C(w(n[1],-1)),!1,e.abortSignal);if(e.abortSignal.aborted)throw new s(e,u.Cancelled,r);return t}if(P(n[0])||I(n[0])){const t=G(n[0],e.spatialReference);return t===null?0:nn(t,C(w(n[1],-1)))}if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return nn(n[0],C(w(n[1],-1)))})},a.functions.areageodetic=function(e,r){return a.standardFunctionAsync(e,r,async(c,l,n)=>{if(h(n,1,2,e,r),(n=o(n))[0]===null)return 0;if(Z(n[0])){const t=await n[0].sumArea(C(w(n[1],-1)),!0,e.abortSignal);if(e.abortSignal.aborted)throw new s(e,u.Cancelled,r);return t}if(P(n[0])||I(n[0])){const t=G(n[0],e.spatialReference);return t===null?0:en(t,C(w(n[1],-1)))}if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return en(n[0],C(w(n[1],-1)))})},a.functions.length=function(e,r){return a.standardFunctionAsync(e,r,async(c,l,n)=>{if(h(n,1,2,e,r),(n=o(n))[0]===null)return 0;if(Z(n[0])){const t=await n[0].sumLength(y(w(n[1],-1)),!1,e.abortSignal);if(e.abortSignal.aborted)throw new s(e,u.Cancelled,r);return t}if(P(n[0])||I(n[0])){const t=L(n[0],e.spatialReference);return t===null?0:U(t,y(w(n[1],-1)))}if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return U(n[0],y(w(n[1],-1)))})},a.functions.length3d=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(h(n,1,2,e,r),(n=o(n))[0]===null)return 0;if(P(n[0])||I(n[0])){const t=L(n[0],e.spatialReference);return t===null?0:t.hasZ===!0?fn(t,y(w(n[1],-1))):U(t,y(w(n[1],-1)))}if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return n[0].hasZ===!0?fn(n[0],y(w(n[1],-1))):U(n[0],y(w(n[1],-1)))})},a.functions.lengthgeodetic=function(e,r){return a.standardFunctionAsync(e,r,async(c,l,n)=>{if(h(n,1,2,e,r),(n=o(n))[0]===null)return 0;if(Z(n[0])){const t=await n[0].sumLength(y(w(n[1],-1)),!0,e.abortSignal);if(e.abortSignal.aborted)throw new s(e,u.Cancelled,r);return t}if(P(n[0])||I(n[0])){const t=L(n[0],e.spatialReference);return t===null?0:B(t,y(w(n[1],-1)))}if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return B(n[0],y(w(n[1],-1)))})},a.functions.distance=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{n=o(n),h(n,2,3,e,r);let t=n[0];(P(n[0])||I(n[0]))&&(t=E(n[0],e.spatialReference));let i=n[1];if((P(n[1])||I(n[1]))&&(i=E(n[1],e.spatialReference)),!(t instanceof d))throw new s(e,u.InvalidParameter,r);if(!(i instanceof d))throw new s(e,u.InvalidParameter,r);return Mn(t,i,y(w(n[2],-1)))})},a.functions.distancegeodetic=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{n=o(n),h(n,2,3,e,r);const t=n[0],i=n[1];if(!(t instanceof N))throw new s(e,u.InvalidParameter,r);if(!(i instanceof N))throw new s(e,u.InvalidParameter,r);const f=new F({paths:[],spatialReference:t.spatialReference});return f.addPath([t,i]),B(f,y(w(n[2],-1)))})},a.functions.densify=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,3,e,r),n[0]===null)return null;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);const t=x(n[1]);if(isNaN(t))throw new s(e,u.InvalidParameter,r);if(t<=0)throw new s(e,u.InvalidParameter,r);return n[0]instanceof D||n[0]instanceof F?rn(n[0],t,y(w(n[2],-1))):n[0]instanceof T?rn(cn(n[0]),t,y(w(n[2],-1))):n[0]})},a.functions.densifygeodetic=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,3,e,r),n[0]===null)return null;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);const t=x(n[1]);if(isNaN(t))throw new s(e,u.InvalidParameter,r);if(t<=0)throw new s(e,u.InvalidParameter,r);return n[0]instanceof D||n[0]instanceof F?tn(n[0],t,y(w(n[2],-1))):n[0]instanceof T?tn(cn(n[0]),t,y(w(n[2],-1))):n[0]})},a.functions.generalize=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,4,e,r),n[0]===null)return null;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);const t=x(n[1]);if(isNaN(t))throw new s(e,u.InvalidParameter,r);return Zn(n[0],t,wn(w(n[2],!0)),y(w(n[3],-1)))})},a.functions.buffer=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,3,e,r),n[0]===null)return null;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);const t=x(n[1]);if(isNaN(t))throw new s(e,u.InvalidParameter,r);return t===0?A(n[0]):Jn(n[0],t,y(w(n[2],-1)))})},a.functions.buffergeodetic=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,3,e,r),n[0]===null)return null;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);const t=x(n[1]);if(isNaN(t))throw new s(e,u.InvalidParameter,r);return t===0?A(n[0]):Un(n[0],t,y(w(n[2],-1)))})},a.functions.offset=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,6,e,r),n[0]===null)return null;if(!(n[0]instanceof D||n[0]instanceof F))throw new s(e,u.InvalidParameter,r);const t=x(n[1]);if(isNaN(t))throw new s(e,u.InvalidParameter,r);const i=x(w(n[4],10));if(isNaN(i))throw new s(e,u.InvalidParameter,r);const f=x(w(n[5],0));if(isNaN(f))throw new s(e,u.InvalidParameter,r);return kn(n[0],t,y(w(n[2],-1)),z(w(n[3],"round")).toLowerCase(),i,f)})},a.functions.rotate=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{n=o(n),h(n,2,3,e,r);let t=n[0];if(t===null)return null;if(!(t instanceof d))throw new s(e,u.InvalidParameter,r);t instanceof T&&(t=D.fromExtent(t));const i=x(n[1]);if(isNaN(i))throw new s(e,u.InvalidParameter,r);const f=w(n[2],null);if(f===null)return an(t,i);if(f instanceof N)return an(t,i,f);throw new s(e,u.InvalidParameter,r)})},a.functions.centroid=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,1,1,e,r),n[0]===null)return null;let t=n[0];if((P(n[0])||I(n[0]))&&(t=E(n[0],e.spatialReference)),t===null)return null;if(!(t instanceof d))throw new s(e,u.InvalidParameter,r);return t instanceof N?M(A(n[0]),e.spatialReference):t instanceof D?t.centroid:t instanceof F?hn(t):t instanceof V?mn(t):t instanceof T?t.center:null})},a.functions.measuretocoordinate=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,2,e,r),n[0]===null)return null;let t=n[0];if((P(n[0])||I(n[0]))&&(t=L(n[0],e.spatialReference)),t===null)return null;if(!(t instanceof d))throw new s(e,u.InvalidParameter,r);if(!(t instanceof F))throw new s(e,u.InvalidParameter,r);if(q(n[1]===!1))throw new s(e,u.InvalidParameter,r);const i=yn(t,n[1]);return i?S.convertObjectToArcadeDictionary(i,O(e),!1,!0):null})},a.functions.pointtocoordinate=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,2,e,r),n[0]===null)return null;let t=n[0];if((P(n[0])||I(n[0]))&&(t=L(n[0],e.spatialReference)),t===null)return null;if(!(t instanceof d))throw new s(e,u.InvalidParameter,r);if(!(t instanceof F))throw new s(e,u.InvalidParameter,r);const i=n[1];if(i===null)return null;if(!(i instanceof N))throw new s(e,u.InvalidParameter,r);if(q(n[1]===!1))throw new s(e,u.InvalidParameter,r);const f=pn(t,i);return f?S.convertObjectToArcadeDictionary(f,O(e),!1,!0):null})},a.functions.distancetocoordinate=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,2,e,r),n[0]===null)return null;let t=n[0];if((P(n[0])||I(n[0]))&&(t=L(n[0],e.spatialReference)),t===null)return null;if(!(t instanceof d))throw new s(e,u.InvalidParameter,r);if(!(t instanceof F))throw new s(e,u.InvalidParameter,r);if(q(n[1]===!1))throw new s(e,u.InvalidParameter,r);const i=vn(t,n[1]);return i?S.convertObjectToArcadeDictionary(i,O(e),!1,!0):null})},a.functions.multiparttosinglepart=function(e,r){return a.standardFunctionAsync(e,r,async(c,l,n)=>{n=o(n),h(n,1,1,e,r);const t=[];if(n[0]===null)return null;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);if(n[0]instanceof N)return[M(A(n[0]),e.spatialReference)];if(n[0]instanceof T)return[M(A(n[0]),e.spatialReference)];const i=await sn(n[0]);if(i instanceof D){const f=[],m=[];for(let p=0;p{if(n=o(n),h(n,1,1,e,r),n[0]===null)return!0;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return zn(n[0])})},a.functions.simplify=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,1,1,e,r),n[0]===null)return null;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return sn(n[0])})},a.functions.convexhull=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,1,1,e,r),n[0]===null)return null;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return En(n[0])})},a.functions.getuser=function(e,r){return a.standardFunctionAsync(e,r,async(c,l,n)=>{var m,p;h(n,0,2,e,r);let t=w(n[1],""),i=t===!0;if(t=t===!0||t===!1?"":z(t),n.length===0||n[0]instanceof _){let v=null;v=(m=e.services)!=null&&m.portal?e.services.portal:Q.getDefault(),n.length>0&&(v=$(n[0],v));const j=await un(v,t,i);if(j){const b=JSON.parse(JSON.stringify(j));for(const g of["lastLogin","created","modified"])b[g]!==void 0&&b[g]!==null&&(b[g]=new Date(b[g]));return S.convertObjectToArcadeDictionary(b,O(e))}return null}let f=null;if(Z(n[0])&&(f=n[0]),f){if(i=!1,t)return null;await f.load();const v=await f.getOwningSystemUrl();if(!v){if(!t){const g=await f.getIdentityUser();return g?S.convertObjectToArcadeDictionary({username:g},O(e)):null}return null}let j=null;j=(p=e.services)!=null&&p.portal?e.services.portal:Q.getDefault(),j=$(new _(v),j);const b=await un(j,t,i);if(b){const g=JSON.parse(JSON.stringify(b));for(const k of["lastLogin","created","modified"])g[k]!==void 0&&g[k]!==null&&(g[k]=new Date(g[k]));return S.convertObjectToArcadeDictionary(g,O(e))}return null}throw new s(e,u.InvalidParameter,r)})}),a.functions.nearestcoordinate=function(e,r){return a.standardFunctionAsync(e,r,async(c,l,n)=>{if(n=o(n),h(n,2,2,e,r),!(n[0]instanceof d||n[0]===null))throw new s(e,u.InvalidParameter,r);if(!(n[1]instanceof N||n[1]===null))throw new s(e,u.InvalidParameter,r);if(n[0]===null||n[1]===null)return null;const t=await qn(n[0],n[1]);return t===null?null:S.convertObjectToArcadeDictionary({coordinate:t.coordinate,distance:t.distance,sideOfLine:t.distance===0?"straddle":t.isRightSide?"right":"left"},O(e),!1,!0)})},a.functions.nearestvertex=function(e,r){return a.standardFunctionAsync(e,r,async(c,l,n)=>{if(n=o(n),h(n,2,2,e,r),!(n[0]instanceof d||n[0]===null))throw new s(e,u.InvalidParameter,r);if(!(n[1]instanceof N||n[1]===null))throw new s(e,u.InvalidParameter,r);if(n[0]===null||n[1]===null)return null;const t=await Bn(n[0],n[1]);return t===null?null:S.convertObjectToArcadeDictionary({coordinate:t.coordinate,distance:t.distance,sideOfLine:t.distance===0?"straddle":t.isRightSide?"right":"left"},O(e),!1,!0)})}}export{re as registerFunctions}; +import{az as ln,M as W,et as d,aE as T,aC as F,aA as N,aB as D,aD as V,b0 as H,ax as Q,eD as on,bo as dn}from"./index-BjUNJPVf.js";import{T as o,a as h,X as K,t as X,k as Y,d as z,b as s,r as u,U as P,Q as I,Z as M,B as Z,v as w,ad as G,ae as L,af as E,h as x,S as wn,ag as hn,ah as mn,E as q,ai as yn,N as S,q as O,aj as pn,ak as vn,x as _,al as gn,am as J}from"./arcadeUtils-BxUF81hz.js";import{c as A,r as C,b as y}from"./TimeOnly-BXSODLxA.js";import{l as $}from"./portalUtils-ApkRv-Dr.js";import{disjoint as Pn,intersects as In,touches as An,crosses as Fn,within as Rn,contains as xn,overlaps as bn,equals as Nn,relate as Sn,intersect as On,union as Dn,difference as jn,symmetricDifference as Tn,clip as Ln,cut as Cn,planarArea as nn,geodesicArea as en,planarLength as U,geodesicLength as B,distance as Mn,densify as rn,geodesicDensify as tn,generalize as Zn,buffer as Jn,geodesicBuffer as Un,offset as kn,rotate as an,simplify as sn,isSimple as zn,convexHull as En,nearestCoordinate as qn,nearestVertex as Bn}from"./geometryEngineAsync-wvmuP1s9.js";import"./ImmutableArray-BlMso3qf.js";import"./number-CJqenc9O.js";import"./featureConversionUtils-BHhm7bvm.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";async function un(a,e,r){var t,i;if(!((t=ln)==null?void 0:t.findCredential(a.restUrl)))return null;if(a.loadStatus==="loaded"&&e===""&&((i=a.user)!=null&&i.sourceJSON)&&r===!1)return a.user.sourceJSON;const l={responseType:"json",query:{f:"json"}};if(r&&(l.query.returnUserLicenseTypeExtensions=!0),e===""){const f=await W(a.restUrl+"/community/self",l);if(f.data){const m=f.data;if(m!=null&&m.username)return m}return null}const n=await W(a.restUrl+"/community/users/"+e,l);if(n.data){const f=n.data;return f.error?null:f}return null}function cn(a){return on.indexOf("4.")===0?D.fromExtent(a):new D({spatialReference:a.spatialReference,rings:[[[a.xmin,a.ymin],[a.xmin,a.ymax],[a.xmax,a.ymax],[a.xmax,a.ymin],[a.xmin,a.ymin]]]})}function R(a,e,r){if(h(a,2,2,e,r),!(a[0]instanceof d&&a[1]instanceof d)){if(!(a[0]instanceof d&&a[1]===null)){if(!(a[1]instanceof d&&a[0]===null)){if(a[0]!==null||a[1]!==null)throw new s(e,u.InvalidParameter,r)}}}}async function fn(a,e){if(a.type!=="polygon"&&a.type!=="polyline"&&a.type!=="extent")return 0;let r=1;(a.spatialReference.vcsWkid||a.spatialReference.latestVcsWkid)&&(r=gn(a.spatialReference)/dn(a.spatialReference));let c=0;if(a.type==="polyline")for(const n of a.paths)for(let t=1;t(R(n=o(n),e,r),n[0]===null||n[1]===null||Pn(n[0],n[1])))},a.functions.intersects=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>(R(n=o(n),e,r),n[0]!==null&&n[1]!==null&&In(n[0],n[1])))},a.functions.touches=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>(R(n=o(n),e,r),n[0]!==null&&n[1]!==null&&An(n[0],n[1])))},a.functions.crosses=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>(R(n=o(n),e,r),n[0]!==null&&n[1]!==null&&Fn(n[0],n[1])))},a.functions.within=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>(R(n=o(n),e,r),n[0]!==null&&n[1]!==null&&Rn(n[0],n[1])))},a.functions.contains=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>(R(n=o(n),e,r),n[0]!==null&&n[1]!==null&&xn(n[0],n[1])))},a.functions.overlaps=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>(R(n=o(n),e,r),n[0]!==null&&n[1]!==null&&bn(n[0],n[1])))},a.functions.equals=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>(h(n,2,2,e,r),n[0]===n[1]||(n[0]instanceof d&&n[1]instanceof d?Nn(n[0],n[1]):(K(n[0])&&K(n[1])||!!(X(n[0])&&X(n[1])||Y(n[0])&&Y(n[1])))&&n[0].equals(n[1]))))},a.functions.relate=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,3,3,e,r),n[0]instanceof d&&n[1]instanceof d)return Sn(n[0],n[1],z(n[2]));if(n[0]instanceof d&&n[1]===null||n[1]instanceof d&&n[0]===null||n[0]===null&&n[1]===null)return!1;throw new s(e,u.InvalidParameter,r)})},a.functions.intersection=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>(R(n=o(n),e,r),n[0]===null||n[1]===null?null:On(n[0],n[1])))},a.functions.union=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{const t=[];if((n=o(n)).length===0)throw new s(e,u.WrongNumberOfParameters,r);if(n.length===1)if(P(n[0])){const i=o(n[0]);for(let f=0;f(R(n=o(n),e,r),n[0]!==null&&n[1]===null?A(n[0]):n[0]===null?null:jn(n[0],n[1])))},a.functions.symmetricdifference=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>(R(n=o(n),e,r),n[0]===null&&n[1]===null?null:n[0]===null?A(n[1]):n[1]===null?A(n[0]):Tn(n[0],n[1])))},a.functions.clip=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,2,e,r),!(n[1]instanceof T)&&n[1]!==null)throw new s(e,u.InvalidParameter,r);if(n[0]===null)return null;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return n[1]===null?null:Ln(n[0],n[1])})},a.functions.cut=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,2,e,r),!(n[1]instanceof F)&&n[1]!==null)throw new s(e,u.InvalidParameter,r);if(n[0]===null)return[];if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return n[1]===null?[A(n[0])]:Cn(n[0],n[1])})},a.functions.area=function(e,r){return a.standardFunctionAsync(e,r,async(c,l,n)=>{if(h(n,1,2,e,r),(n=o(n))[0]===null)return 0;if(Z(n[0])){const t=await n[0].sumArea(C(w(n[1],-1)),!1,e.abortSignal);if(e.abortSignal.aborted)throw new s(e,u.Cancelled,r);return t}if(P(n[0])||I(n[0])){const t=G(n[0],e.spatialReference);return t===null?0:nn(t,C(w(n[1],-1)))}if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return nn(n[0],C(w(n[1],-1)))})},a.functions.areageodetic=function(e,r){return a.standardFunctionAsync(e,r,async(c,l,n)=>{if(h(n,1,2,e,r),(n=o(n))[0]===null)return 0;if(Z(n[0])){const t=await n[0].sumArea(C(w(n[1],-1)),!0,e.abortSignal);if(e.abortSignal.aborted)throw new s(e,u.Cancelled,r);return t}if(P(n[0])||I(n[0])){const t=G(n[0],e.spatialReference);return t===null?0:en(t,C(w(n[1],-1)))}if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return en(n[0],C(w(n[1],-1)))})},a.functions.length=function(e,r){return a.standardFunctionAsync(e,r,async(c,l,n)=>{if(h(n,1,2,e,r),(n=o(n))[0]===null)return 0;if(Z(n[0])){const t=await n[0].sumLength(y(w(n[1],-1)),!1,e.abortSignal);if(e.abortSignal.aborted)throw new s(e,u.Cancelled,r);return t}if(P(n[0])||I(n[0])){const t=L(n[0],e.spatialReference);return t===null?0:U(t,y(w(n[1],-1)))}if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return U(n[0],y(w(n[1],-1)))})},a.functions.length3d=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(h(n,1,2,e,r),(n=o(n))[0]===null)return 0;if(P(n[0])||I(n[0])){const t=L(n[0],e.spatialReference);return t===null?0:t.hasZ===!0?fn(t,y(w(n[1],-1))):U(t,y(w(n[1],-1)))}if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return n[0].hasZ===!0?fn(n[0],y(w(n[1],-1))):U(n[0],y(w(n[1],-1)))})},a.functions.lengthgeodetic=function(e,r){return a.standardFunctionAsync(e,r,async(c,l,n)=>{if(h(n,1,2,e,r),(n=o(n))[0]===null)return 0;if(Z(n[0])){const t=await n[0].sumLength(y(w(n[1],-1)),!0,e.abortSignal);if(e.abortSignal.aborted)throw new s(e,u.Cancelled,r);return t}if(P(n[0])||I(n[0])){const t=L(n[0],e.spatialReference);return t===null?0:B(t,y(w(n[1],-1)))}if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return B(n[0],y(w(n[1],-1)))})},a.functions.distance=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{n=o(n),h(n,2,3,e,r);let t=n[0];(P(n[0])||I(n[0]))&&(t=E(n[0],e.spatialReference));let i=n[1];if((P(n[1])||I(n[1]))&&(i=E(n[1],e.spatialReference)),!(t instanceof d))throw new s(e,u.InvalidParameter,r);if(!(i instanceof d))throw new s(e,u.InvalidParameter,r);return Mn(t,i,y(w(n[2],-1)))})},a.functions.distancegeodetic=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{n=o(n),h(n,2,3,e,r);const t=n[0],i=n[1];if(!(t instanceof N))throw new s(e,u.InvalidParameter,r);if(!(i instanceof N))throw new s(e,u.InvalidParameter,r);const f=new F({paths:[],spatialReference:t.spatialReference});return f.addPath([t,i]),B(f,y(w(n[2],-1)))})},a.functions.densify=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,3,e,r),n[0]===null)return null;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);const t=x(n[1]);if(isNaN(t))throw new s(e,u.InvalidParameter,r);if(t<=0)throw new s(e,u.InvalidParameter,r);return n[0]instanceof D||n[0]instanceof F?rn(n[0],t,y(w(n[2],-1))):n[0]instanceof T?rn(cn(n[0]),t,y(w(n[2],-1))):n[0]})},a.functions.densifygeodetic=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,3,e,r),n[0]===null)return null;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);const t=x(n[1]);if(isNaN(t))throw new s(e,u.InvalidParameter,r);if(t<=0)throw new s(e,u.InvalidParameter,r);return n[0]instanceof D||n[0]instanceof F?tn(n[0],t,y(w(n[2],-1))):n[0]instanceof T?tn(cn(n[0]),t,y(w(n[2],-1))):n[0]})},a.functions.generalize=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,4,e,r),n[0]===null)return null;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);const t=x(n[1]);if(isNaN(t))throw new s(e,u.InvalidParameter,r);return Zn(n[0],t,wn(w(n[2],!0)),y(w(n[3],-1)))})},a.functions.buffer=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,3,e,r),n[0]===null)return null;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);const t=x(n[1]);if(isNaN(t))throw new s(e,u.InvalidParameter,r);return t===0?A(n[0]):Jn(n[0],t,y(w(n[2],-1)))})},a.functions.buffergeodetic=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,3,e,r),n[0]===null)return null;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);const t=x(n[1]);if(isNaN(t))throw new s(e,u.InvalidParameter,r);return t===0?A(n[0]):Un(n[0],t,y(w(n[2],-1)))})},a.functions.offset=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,6,e,r),n[0]===null)return null;if(!(n[0]instanceof D||n[0]instanceof F))throw new s(e,u.InvalidParameter,r);const t=x(n[1]);if(isNaN(t))throw new s(e,u.InvalidParameter,r);const i=x(w(n[4],10));if(isNaN(i))throw new s(e,u.InvalidParameter,r);const f=x(w(n[5],0));if(isNaN(f))throw new s(e,u.InvalidParameter,r);return kn(n[0],t,y(w(n[2],-1)),z(w(n[3],"round")).toLowerCase(),i,f)})},a.functions.rotate=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{n=o(n),h(n,2,3,e,r);let t=n[0];if(t===null)return null;if(!(t instanceof d))throw new s(e,u.InvalidParameter,r);t instanceof T&&(t=D.fromExtent(t));const i=x(n[1]);if(isNaN(i))throw new s(e,u.InvalidParameter,r);const f=w(n[2],null);if(f===null)return an(t,i);if(f instanceof N)return an(t,i,f);throw new s(e,u.InvalidParameter,r)})},a.functions.centroid=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,1,1,e,r),n[0]===null)return null;let t=n[0];if((P(n[0])||I(n[0]))&&(t=E(n[0],e.spatialReference)),t===null)return null;if(!(t instanceof d))throw new s(e,u.InvalidParameter,r);return t instanceof N?M(A(n[0]),e.spatialReference):t instanceof D?t.centroid:t instanceof F?hn(t):t instanceof V?mn(t):t instanceof T?t.center:null})},a.functions.measuretocoordinate=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,2,e,r),n[0]===null)return null;let t=n[0];if((P(n[0])||I(n[0]))&&(t=L(n[0],e.spatialReference)),t===null)return null;if(!(t instanceof d))throw new s(e,u.InvalidParameter,r);if(!(t instanceof F))throw new s(e,u.InvalidParameter,r);if(q(n[1]===!1))throw new s(e,u.InvalidParameter,r);const i=yn(t,n[1]);return i?S.convertObjectToArcadeDictionary(i,O(e),!1,!0):null})},a.functions.pointtocoordinate=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,2,e,r),n[0]===null)return null;let t=n[0];if((P(n[0])||I(n[0]))&&(t=L(n[0],e.spatialReference)),t===null)return null;if(!(t instanceof d))throw new s(e,u.InvalidParameter,r);if(!(t instanceof F))throw new s(e,u.InvalidParameter,r);const i=n[1];if(i===null)return null;if(!(i instanceof N))throw new s(e,u.InvalidParameter,r);if(q(n[1]===!1))throw new s(e,u.InvalidParameter,r);const f=pn(t,i);return f?S.convertObjectToArcadeDictionary(f,O(e),!1,!0):null})},a.functions.distancetocoordinate=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,2,e,r),n[0]===null)return null;let t=n[0];if((P(n[0])||I(n[0]))&&(t=L(n[0],e.spatialReference)),t===null)return null;if(!(t instanceof d))throw new s(e,u.InvalidParameter,r);if(!(t instanceof F))throw new s(e,u.InvalidParameter,r);if(q(n[1]===!1))throw new s(e,u.InvalidParameter,r);const i=vn(t,n[1]);return i?S.convertObjectToArcadeDictionary(i,O(e),!1,!0):null})},a.functions.multiparttosinglepart=function(e,r){return a.standardFunctionAsync(e,r,async(c,l,n)=>{n=o(n),h(n,1,1,e,r);const t=[];if(n[0]===null)return null;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);if(n[0]instanceof N)return[M(A(n[0]),e.spatialReference)];if(n[0]instanceof T)return[M(A(n[0]),e.spatialReference)];const i=await sn(n[0]);if(i instanceof D){const f=[],m=[];for(let p=0;p{if(n=o(n),h(n,1,1,e,r),n[0]===null)return!0;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return zn(n[0])})},a.functions.simplify=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,1,1,e,r),n[0]===null)return null;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return sn(n[0])})},a.functions.convexhull=function(e,r){return a.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,1,1,e,r),n[0]===null)return null;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return En(n[0])})},a.functions.getuser=function(e,r){return a.standardFunctionAsync(e,r,async(c,l,n)=>{var m,p;h(n,0,2,e,r);let t=w(n[1],""),i=t===!0;if(t=t===!0||t===!1?"":z(t),n.length===0||n[0]instanceof _){let v=null;v=(m=e.services)!=null&&m.portal?e.services.portal:Q.getDefault(),n.length>0&&(v=$(n[0],v));const j=await un(v,t,i);if(j){const b=JSON.parse(JSON.stringify(j));for(const g of["lastLogin","created","modified"])b[g]!==void 0&&b[g]!==null&&(b[g]=new Date(b[g]));return S.convertObjectToArcadeDictionary(b,O(e))}return null}let f=null;if(Z(n[0])&&(f=n[0]),f){if(i=!1,t)return null;await f.load();const v=await f.getOwningSystemUrl();if(!v){if(!t){const g=await f.getIdentityUser();return g?S.convertObjectToArcadeDictionary({username:g},O(e)):null}return null}let j=null;j=(p=e.services)!=null&&p.portal?e.services.portal:Q.getDefault(),j=$(new _(v),j);const b=await un(j,t,i);if(b){const g=JSON.parse(JSON.stringify(b));for(const k of["lastLogin","created","modified"])g[k]!==void 0&&g[k]!==null&&(g[k]=new Date(g[k]));return S.convertObjectToArcadeDictionary(g,O(e))}return null}throw new s(e,u.InvalidParameter,r)})}),a.functions.nearestcoordinate=function(e,r){return a.standardFunctionAsync(e,r,async(c,l,n)=>{if(n=o(n),h(n,2,2,e,r),!(n[0]instanceof d||n[0]===null))throw new s(e,u.InvalidParameter,r);if(!(n[1]instanceof N||n[1]===null))throw new s(e,u.InvalidParameter,r);if(n[0]===null||n[1]===null)return null;const t=await qn(n[0],n[1]);return t===null?null:S.convertObjectToArcadeDictionary({coordinate:t.coordinate,distance:t.distance,sideOfLine:t.distance===0?"straddle":t.isRightSide?"right":"left"},O(e),!1,!0)})},a.functions.nearestvertex=function(e,r){return a.standardFunctionAsync(e,r,async(c,l,n)=>{if(n=o(n),h(n,2,2,e,r),!(n[0]instanceof d||n[0]===null))throw new s(e,u.InvalidParameter,r);if(!(n[1]instanceof N||n[1]===null))throw new s(e,u.InvalidParameter,r);if(n[0]===null||n[1]===null)return null;const t=await Bn(n[0],n[1]);return t===null?null:S.convertObjectToArcadeDictionary({coordinate:t.coordinate,distance:t.distance,sideOfLine:t.distance===0?"straddle":t.isRightSide?"right":"left"},O(e),!1,!0)})}}export{re as registerFunctions}; diff --git a/assets/geometryEngine-DD4bBRnV.js b/assets/geometryEngine-8LJe6rF3.js similarity index 94% rename from assets/geometryEngine-DD4bBRnV.js rename to assets/geometryEngine-8LJe6rF3.js index 63bba11..0fbb92a 100644 --- a/assets/geometryEngine-DD4bBRnV.js +++ b/assets/geometryEngine-8LJe6rF3.js @@ -1 +1 @@ -import{G as t}from"./geometryEngineBase-C5__2Su1.js";import{hydratedAdapter as r}from"./hydrated-CcIo9KoC.js";import"./index-CEWggaxV.js";function i(e){return Array.isArray(e)?e[0].spatialReference:e&&e.spatialReference}function g(e){return t.extendedSpatialReferenceInfo(e)}function h(e,n){return t.clip(r,i(e),e,n)}function m(e,n){return t.cut(r,i(e),e,n)}function w(e,n){return t.contains(r,i(e),e,n)}function R(e,n){return t.crosses(r,i(e),e,n)}function x(e,n,a){return t.distance(r,i(e),e,n,a)}function y(e,n){return t.equals(r,i(e),e,n)}function S(e,n){return t.intersects(r,i(e),e,n)}function A(e,n){return t.touches(r,i(e),e,n)}function D(e,n){return t.within(r,i(e),e,n)}function L(e,n){return t.disjoint(r,i(e),e,n)}function T(e,n){return t.overlaps(r,i(e),e,n)}function V(e,n,a){return t.relate(r,i(e),e,n,a)}function v(e){return t.isSimple(r,i(e),e)}function z(e){return t.simplify(r,i(e),e)}function H(e,n=!1){return t.convexHull(r,i(e),e,n)}function I(e,n){return t.difference(r,i(e),e,n)}function J(e,n){return t.symmetricDifference(r,i(e),e,n)}function N(e,n){return t.intersect(r,i(e),e,n)}function O(e,n=null){return t.union(r,i(e),e,n)}function b(e,n,a,s,c,o){return t.offset(r,i(e),e,n,a,s,c,o)}function j(e,n,a,s=!1){return t.buffer(r,i(e),e,n,a,s)}function q(e,n,a,s,c,o){return t.geodesicBuffer(r,i(e),e,n,a,s,c,o)}function B(e,n,a=!0){return t.nearestCoordinate(r,i(e),e,n,a)}function C(e,n){return t.nearestVertex(r,i(e),e,n)}function E(e,n,a,s){return t.nearestVertices(r,i(e),e,n,a,s)}function f(e){var n;return"xmin"in e?"center"in e?e.center:null:"x"in e?e:"extent"in e?((n=e.extent)==null?void 0:n.center)??null:null}function P(e,n,a){if(e==null)throw new u;const s=e.spatialReference;if((a=a??f(e))==null)throw new u;const c=e.constructor.fromJSON(t.rotate(e,n,a));return c.spatialReference=s,c}function G(e,n){if(e==null)throw new u;const a=e.spatialReference;if((n=n??f(e))==null)throw new u;const s=e.constructor.fromJSON(t.flipHorizontal(e,n));return s.spatialReference=a,s}function $(e,n){if(e==null)throw new u;const a=e.spatialReference;if((n=n??f(e))==null)throw new u;const s=e.constructor.fromJSON(t.flipVertical(e,n));return s.spatialReference=a,s}function k(e,n,a,s){return t.generalize(r,i(e),e,n,a,s)}function F(e,n,a){return t.densify(r,i(e),e,n,a)}function K(e,n,a,s=0){return t.geodesicDensify(r,i(e),e,n,a,s)}function M(e,n){return t.planarArea(r,i(e),e,n)}function Q(e,n){return t.planarLength(r,i(e),e,n)}function U(e,n,a){return t.geodesicArea(r,i(e),e,n,a)}function W(e,n,a){return t.geodesicLength(r,i(e),e,n,a)}function X(e,n){return t.intersectLinesToPoints(r,i(e),e,n)}function Y(e,n){t.changeDefaultSpatialReferenceTolerance(e,n)}function Z(e){t.clearDefaultSpatialReferenceTolerance(e)}class u extends Error{constructor(){super("Illegal Argument Exception")}}export{j as buffer,Y as changeDefaultSpatialReferenceTolerance,Z as clearDefaultSpatialReferenceTolerance,h as clip,w as contains,H as convexHull,R as crosses,m as cut,F as densify,I as difference,L as disjoint,x as distance,y as equals,g as extendedSpatialReferenceInfo,G as flipHorizontal,$ as flipVertical,k as generalize,U as geodesicArea,q as geodesicBuffer,K as geodesicDensify,W as geodesicLength,N as intersect,X as intersectLinesToPoints,S as intersects,v as isSimple,B as nearestCoordinate,C as nearestVertex,E as nearestVertices,b as offset,T as overlaps,M as planarArea,Q as planarLength,V as relate,P as rotate,z as simplify,J as symmetricDifference,A as touches,O as union,D as within}; +import{G as t}from"./geometryEngineBase-CDbTTSsS.js";import{hydratedAdapter as r}from"./hydrated-D7zavlGk.js";import"./index-BjUNJPVf.js";function i(e){return Array.isArray(e)?e[0].spatialReference:e&&e.spatialReference}function g(e){return t.extendedSpatialReferenceInfo(e)}function h(e,n){return t.clip(r,i(e),e,n)}function m(e,n){return t.cut(r,i(e),e,n)}function w(e,n){return t.contains(r,i(e),e,n)}function R(e,n){return t.crosses(r,i(e),e,n)}function x(e,n,a){return t.distance(r,i(e),e,n,a)}function y(e,n){return t.equals(r,i(e),e,n)}function S(e,n){return t.intersects(r,i(e),e,n)}function A(e,n){return t.touches(r,i(e),e,n)}function D(e,n){return t.within(r,i(e),e,n)}function L(e,n){return t.disjoint(r,i(e),e,n)}function T(e,n){return t.overlaps(r,i(e),e,n)}function V(e,n,a){return t.relate(r,i(e),e,n,a)}function v(e){return t.isSimple(r,i(e),e)}function z(e){return t.simplify(r,i(e),e)}function H(e,n=!1){return t.convexHull(r,i(e),e,n)}function I(e,n){return t.difference(r,i(e),e,n)}function J(e,n){return t.symmetricDifference(r,i(e),e,n)}function N(e,n){return t.intersect(r,i(e),e,n)}function O(e,n=null){return t.union(r,i(e),e,n)}function b(e,n,a,s,c,o){return t.offset(r,i(e),e,n,a,s,c,o)}function j(e,n,a,s=!1){return t.buffer(r,i(e),e,n,a,s)}function q(e,n,a,s,c,o){return t.geodesicBuffer(r,i(e),e,n,a,s,c,o)}function B(e,n,a=!0){return t.nearestCoordinate(r,i(e),e,n,a)}function C(e,n){return t.nearestVertex(r,i(e),e,n)}function E(e,n,a,s){return t.nearestVertices(r,i(e),e,n,a,s)}function f(e){var n;return"xmin"in e?"center"in e?e.center:null:"x"in e?e:"extent"in e?((n=e.extent)==null?void 0:n.center)??null:null}function P(e,n,a){if(e==null)throw new u;const s=e.spatialReference;if((a=a??f(e))==null)throw new u;const c=e.constructor.fromJSON(t.rotate(e,n,a));return c.spatialReference=s,c}function G(e,n){if(e==null)throw new u;const a=e.spatialReference;if((n=n??f(e))==null)throw new u;const s=e.constructor.fromJSON(t.flipHorizontal(e,n));return s.spatialReference=a,s}function $(e,n){if(e==null)throw new u;const a=e.spatialReference;if((n=n??f(e))==null)throw new u;const s=e.constructor.fromJSON(t.flipVertical(e,n));return s.spatialReference=a,s}function k(e,n,a,s){return t.generalize(r,i(e),e,n,a,s)}function F(e,n,a){return t.densify(r,i(e),e,n,a)}function K(e,n,a,s=0){return t.geodesicDensify(r,i(e),e,n,a,s)}function M(e,n){return t.planarArea(r,i(e),e,n)}function Q(e,n){return t.planarLength(r,i(e),e,n)}function U(e,n,a){return t.geodesicArea(r,i(e),e,n,a)}function W(e,n,a){return t.geodesicLength(r,i(e),e,n,a)}function X(e,n){return t.intersectLinesToPoints(r,i(e),e,n)}function Y(e,n){t.changeDefaultSpatialReferenceTolerance(e,n)}function Z(e){t.clearDefaultSpatialReferenceTolerance(e)}class u extends Error{constructor(){super("Illegal Argument Exception")}}export{j as buffer,Y as changeDefaultSpatialReferenceTolerance,Z as clearDefaultSpatialReferenceTolerance,h as clip,w as contains,H as convexHull,R as crosses,m as cut,F as densify,I as difference,L as disjoint,x as distance,y as equals,g as extendedSpatialReferenceInfo,G as flipHorizontal,$ as flipVertical,k as generalize,U as geodesicArea,q as geodesicBuffer,K as geodesicDensify,W as geodesicLength,N as intersect,X as intersectLinesToPoints,S as intersects,v as isSimple,B as nearestCoordinate,C as nearestVertex,E as nearestVertices,b as offset,T as overlaps,M as planarArea,Q as planarLength,V as relate,P as rotate,z as simplify,J as symmetricDifference,A as touches,O as union,D as within}; diff --git a/assets/geometryEngineAsync-B-ooCYDN.js b/assets/geometryEngineAsync-wvmuP1s9.js similarity index 98% rename from assets/geometryEngineAsync-B-ooCYDN.js rename to assets/geometryEngineAsync-wvmuP1s9.js index daf819c..32ce7f5 100644 --- a/assets/geometryEngineAsync-B-ooCYDN.js +++ b/assets/geometryEngineAsync-wvmuP1s9.js @@ -1 +1 @@ -import{aA as l,b0 as w,ec as h}from"./index-CEWggaxV.js";function n(e){var t;return Array.isArray(e)?(t=e[0])==null?void 0:t.spatialReference:e==null?void 0:e.spatialReference}function p(e){return e&&(Array.isArray(e)?e.map(p):e.toJSON?e.toJSON():e)}function c(e){return Array.isArray(e)?e.map(t=>w(t)):w(e)}function S(e,t){let a;return Array.isArray(e)?a=e:(a=[],a.push(e),t!=null&&a.push(t)),a}let f;async function d(){return f||(f=h("geometryEngineWorker",{strategy:"distributed"})),f}async function r(e,t){return(await d()).invoke("executeGEOperation",{operation:e,parameters:p(t)})}async function m(e,t){const a=await d();return Promise.all(a.broadcast("executeGEOperation",{operation:e,parameters:p(t)}))}function A(e){return r("extendedSpatialReferenceInfo",[e])}async function R(e,t){return c(await r("clip",[n(e),e,t]))}async function O(e,t){return c(await r("cut",[n(e),e,t]))}function D(e,t){return r("contains",[n(e),e,t])}function J(e,t){return r("crosses",[n(e),e,t])}function N(e,t,a){return r("distance",[n(e),e,t,a])}function L(e,t){return r("equals",[n(e),e,t])}function T(e,t){return r("intersects",[n(e),e,t])}function V(e,t){return r("touches",[n(e),e,t])}function b(e,t){return r("within",[n(e),e,t])}function v(e,t){return r("disjoint",[n(e),e,t])}function E(e,t){return r("overlaps",[n(e),e,t])}function z(e,t,a){return r("relate",[n(e),e,t,a])}function H(e){return r("isSimple",[n(e),e])}async function I(e){return c(await r("simplify",[n(e),e]))}async function P(e,t=!1){return c(await r("convexHull",[n(e),e,t]))}async function j(e,t){return c(await r("difference",[n(e),e,t]))}async function k(e,t){return c(await r("symmetricDifference",[n(e),e,t]))}async function q(e,t){return c(await r("intersect",[n(e),e,t]))}async function B(e,t=null){const a=S(e,t);return c(await r("union",[n(a),a]))}async function C(e,t,a,i,s,u){return c(await r("offset",[n(e),e,t,a,i,s,u]))}async function G(e,t,a,i=!1){const s=[n(e),e,t,a,i];return c(await r("buffer",s))}async function $(e,t,a,i,s,u){const g=[n(e),e,t,a,i,s,u];return c(await r("geodesicBuffer",g))}async function W(e,t,a=!0){const i=await r("nearestCoordinate",[n(e),e,t,a]);return{...i,coordinate:l.fromJSON(i.coordinate)}}async function F(e,t){const a=await r("nearestVertex",[n(e),e,t]);return{...a,coordinate:l.fromJSON(a.coordinate)}}async function K(e,t,a,i){return(await r("nearestVertices",[n(e),e,t,a,i])).map(s=>({...s,coordinate:l.fromJSON(s.coordinate)}))}function y(e){var t;return"xmin"in e?e.center:"x"in e?e:(t=e.extent)==null?void 0:t.center}async function M(e,t,a){if(e==null)throw new o;const i=e.spatialReference;if((a=a??y(e))==null)throw new o;const s=e.constructor.fromJSON(await r("rotate",[i,e,t,a]));return s.spatialReference=i,s}async function Q(e,t){if(e==null)throw new o;const a=e.spatialReference;if((t=t??y(e))==null)throw new o;const i=e.constructor.fromJSON(await r("flipHorizontal",[a,e,t]));return i.spatialReference=a,i}async function U(e,t){if(e==null)throw new o;const a=e.spatialReference;if((t=t??y(e))==null)throw new o;const i=e.constructor.fromJSON(await r("flipVertical",[a,e,t]));return i.spatialReference=a,i}async function X(e,t,a,i){return c(await r("generalize",[n(e),e,t,a,i]))}async function Y(e,t,a){return c(await r("densify",[n(e),e,t,a]))}async function Z(e,t,a,i=0){return c(await r("geodesicDensify",[n(e),e,t,a,i]))}function _(e,t){return r("planarArea",[n(e),e,t])}function ee(e,t){return r("planarLength",[n(e),e,t])}function te(e,t,a){return r("geodesicArea",[n(e),e,t,a])}function ae(e,t,a){return r("geodesicLength",[n(e),e,t,a])}async function re(e,t){return c(await r("intersectLinesToPoints",[n(e),e,t]))}async function ne(e,t){await m("changeDefaultSpatialReferenceTolerance",[e,t])}async function ie(e){await m("clearDefaultSpatialReferenceTolerance",[e])}class o extends Error{constructor(){super("Illegal Argument Exception")}}export{G as buffer,ne as changeDefaultSpatialReferenceTolerance,ie as clearDefaultSpatialReferenceTolerance,R as clip,D as contains,P as convexHull,J as crosses,O as cut,Y as densify,j as difference,v as disjoint,N as distance,L as equals,A as extendedSpatialReferenceInfo,Q as flipHorizontal,U as flipVertical,X as generalize,te as geodesicArea,$ as geodesicBuffer,Z as geodesicDensify,ae as geodesicLength,q as intersect,re as intersectLinesToPoints,T as intersects,H as isSimple,W as nearestCoordinate,F as nearestVertex,K as nearestVertices,C as offset,E as overlaps,_ as planarArea,ee as planarLength,z as relate,M as rotate,I as simplify,k as symmetricDifference,V as touches,B as union,b as within}; +import{aA as l,b0 as w,ec as h}from"./index-BjUNJPVf.js";function n(e){var t;return Array.isArray(e)?(t=e[0])==null?void 0:t.spatialReference:e==null?void 0:e.spatialReference}function p(e){return e&&(Array.isArray(e)?e.map(p):e.toJSON?e.toJSON():e)}function c(e){return Array.isArray(e)?e.map(t=>w(t)):w(e)}function S(e,t){let a;return Array.isArray(e)?a=e:(a=[],a.push(e),t!=null&&a.push(t)),a}let f;async function d(){return f||(f=h("geometryEngineWorker",{strategy:"distributed"})),f}async function r(e,t){return(await d()).invoke("executeGEOperation",{operation:e,parameters:p(t)})}async function m(e,t){const a=await d();return Promise.all(a.broadcast("executeGEOperation",{operation:e,parameters:p(t)}))}function A(e){return r("extendedSpatialReferenceInfo",[e])}async function R(e,t){return c(await r("clip",[n(e),e,t]))}async function O(e,t){return c(await r("cut",[n(e),e,t]))}function D(e,t){return r("contains",[n(e),e,t])}function J(e,t){return r("crosses",[n(e),e,t])}function N(e,t,a){return r("distance",[n(e),e,t,a])}function L(e,t){return r("equals",[n(e),e,t])}function T(e,t){return r("intersects",[n(e),e,t])}function V(e,t){return r("touches",[n(e),e,t])}function b(e,t){return r("within",[n(e),e,t])}function v(e,t){return r("disjoint",[n(e),e,t])}function E(e,t){return r("overlaps",[n(e),e,t])}function z(e,t,a){return r("relate",[n(e),e,t,a])}function H(e){return r("isSimple",[n(e),e])}async function I(e){return c(await r("simplify",[n(e),e]))}async function P(e,t=!1){return c(await r("convexHull",[n(e),e,t]))}async function j(e,t){return c(await r("difference",[n(e),e,t]))}async function k(e,t){return c(await r("symmetricDifference",[n(e),e,t]))}async function q(e,t){return c(await r("intersect",[n(e),e,t]))}async function B(e,t=null){const a=S(e,t);return c(await r("union",[n(a),a]))}async function C(e,t,a,i,s,u){return c(await r("offset",[n(e),e,t,a,i,s,u]))}async function G(e,t,a,i=!1){const s=[n(e),e,t,a,i];return c(await r("buffer",s))}async function $(e,t,a,i,s,u){const g=[n(e),e,t,a,i,s,u];return c(await r("geodesicBuffer",g))}async function W(e,t,a=!0){const i=await r("nearestCoordinate",[n(e),e,t,a]);return{...i,coordinate:l.fromJSON(i.coordinate)}}async function F(e,t){const a=await r("nearestVertex",[n(e),e,t]);return{...a,coordinate:l.fromJSON(a.coordinate)}}async function K(e,t,a,i){return(await r("nearestVertices",[n(e),e,t,a,i])).map(s=>({...s,coordinate:l.fromJSON(s.coordinate)}))}function y(e){var t;return"xmin"in e?e.center:"x"in e?e:(t=e.extent)==null?void 0:t.center}async function M(e,t,a){if(e==null)throw new o;const i=e.spatialReference;if((a=a??y(e))==null)throw new o;const s=e.constructor.fromJSON(await r("rotate",[i,e,t,a]));return s.spatialReference=i,s}async function Q(e,t){if(e==null)throw new o;const a=e.spatialReference;if((t=t??y(e))==null)throw new o;const i=e.constructor.fromJSON(await r("flipHorizontal",[a,e,t]));return i.spatialReference=a,i}async function U(e,t){if(e==null)throw new o;const a=e.spatialReference;if((t=t??y(e))==null)throw new o;const i=e.constructor.fromJSON(await r("flipVertical",[a,e,t]));return i.spatialReference=a,i}async function X(e,t,a,i){return c(await r("generalize",[n(e),e,t,a,i]))}async function Y(e,t,a){return c(await r("densify",[n(e),e,t,a]))}async function Z(e,t,a,i=0){return c(await r("geodesicDensify",[n(e),e,t,a,i]))}function _(e,t){return r("planarArea",[n(e),e,t])}function ee(e,t){return r("planarLength",[n(e),e,t])}function te(e,t,a){return r("geodesicArea",[n(e),e,t,a])}function ae(e,t,a){return r("geodesicLength",[n(e),e,t,a])}async function re(e,t){return c(await r("intersectLinesToPoints",[n(e),e,t]))}async function ne(e,t){await m("changeDefaultSpatialReferenceTolerance",[e,t])}async function ie(e){await m("clearDefaultSpatialReferenceTolerance",[e])}class o extends Error{constructor(){super("Illegal Argument Exception")}}export{G as buffer,ne as changeDefaultSpatialReferenceTolerance,ie as clearDefaultSpatialReferenceTolerance,R as clip,D as contains,P as convexHull,J as crosses,O as cut,Y as densify,j as difference,v as disjoint,N as distance,L as equals,A as extendedSpatialReferenceInfo,Q as flipHorizontal,U as flipVertical,X as generalize,te as geodesicArea,$ as geodesicBuffer,Z as geodesicDensify,ae as geodesicLength,q as intersect,re as intersectLinesToPoints,T as intersects,H as isSimple,W as nearestCoordinate,F as nearestVertex,K as nearestVertices,C as offset,E as overlaps,_ as planarArea,ee as planarLength,z as relate,M as rotate,I as simplify,k as symmetricDifference,V as touches,B as union,b as within}; diff --git a/assets/geometryEngineBase-C5__2Su1.js b/assets/geometryEngineBase-CDbTTSsS.js similarity index 99% rename from assets/geometryEngineBase-C5__2Su1.js rename to assets/geometryEngineBase-CDbTTSsS.js index e505892..f0e5a12 100644 --- a/assets/geometryEngineBase-C5__2Su1.js +++ b/assets/geometryEngineBase-CDbTTSsS.js @@ -1 +1 @@ -import{ar as pi}from"./index-CEWggaxV.js";function yi(ct,gt){for(var lt=0;ltrt[_]})}}}return Object.freeze(Object.defineProperty(ct,Symbol.toStringTag,{value:"Module"}))}var At={exports:{}};(function(ct,gt){function lt(){function _(e){if(typeof e=="number")return k.Tc.Zg(e);if(e==null)return null;if(kt[e]!=null)return k.Tc.Zg(kt[e]);throw Error("Unrecognised Unit Type")}function ut(e){if(typeof e=="number")return k.Tc.Zg(e);if(e==null)return null;if(Mt[e]!=null)return k.Tc.Zg(Mt[e]);throw Error("Unrecognised Unit Type")}function pt(e){if(e)switch(e){case"loxodrome":return 1;case"great-elliptic":return 2;case"normal-section":return 3;case"shape-preserving":return 4}return 0}function Y(e,v,f,r){if(f==null||f.B())return null;switch(f.getType()){case k.qn.Point:return e.exportPoint(v,f,r);case k.qn.Polygon:return e.exportPolygon(v,f,r);case k.qn.Polyline:return e.exportPolyline(v,f,r);case k.qn.MultiPoint:return e.exportMultipoint(v,f,r);case k.qn.Envelope:return e.exportExtent(v,f,r)}return null}function bt(e,v,f,r){if(f.getType()!==k.qn.Point)throw Error("Geometry not Point");return e.exportPoint(v,f,r)}function q(e,v,f){return e.convertToGEGeometry(v,f)}function F(e){var v=e.wkid;e=e.wkt2||e.wkt;var f=at.get(v||e);return f==null&&(v!==-1&&v!=null?(f=k.Eg.create(v),at.set(v,f)):e&&(f=k.Eg.qP(e),at.set(e,f)),ft.has(v||e)&&f.VW(ft.get(v||e))),f}function Nt(e){var v,f,r;if(e==null)return null;var n=F(e);return e=n.Hd(),n=n.Kn(),(v={}).tolerance=n,v.unitType=e==null?-1:e.od,v.unitID=e==null?-1:e.Ec(),v.unitBaseFactor=e==null?0:e.ai,v.unitSquareDerivative=e==null?0:(r=(f=k.Tc.aG(e))===null||f===void 0?void 0:f.Ec())!==null&&r!==void 0?r:0,v}function It(e,v,f,r){return f==null?null:(f=k.$b.clip(q(e,P,f),q(e,P,r),F(v)),Y(e,P,f,v))}function Tt(e,v,f,r){f=k.$b.dl(q(e,P,f),q(e,P,r),F(v)),r=[];for(var n=0;n>6)>>1},r.Rn=function(n){return(32&n)!=0},r.US=function(n){return(128&n)!=0},r.yd=function(n){return(256&n)!=0},r.xj=function(n){return(512&n)!=0},r.Hc=function(n){return(1024&n)!=0},r.prototype.Of=function(){var n=this.Ia();return this.copyTo(n),n},r.prototype.mg=function(){return null},r.jg=function(n){var t=n.Ia();return n.copyTo(t),t},r.prototype.vc=function(){0<=this.VA&&(this.VA+=2147483649)},r.Ax=function(n){var t=n.getType();if(r.xj(t))return n.I();if(n.B())return 0;if(t==197)return 4;if(t==33)return 1;if(r.yd(t))return 2;throw e.i.fa("missing type")},r}();e.aa=f})(k||(k={})),it=k||(k={}),jt=function(){function e(){this.y=this.x=0}return e.construct=function(v,f){var r=new e;return r.x=v,r.y=f,r},e.al=function(v){var f=new e;return f.x=v.x,f.y=v.y,f},e.prototype.ma=function(v,f){this.x=v,this.y=f},e.prototype.L=function(v){this.x=v.x,this.y=v.y},e.prototype.fq=function(v,f){return this.x===v&&this.y===f},e.prototype.Rz=function(v){return 2220446049250313e-31>=Math.abs(this.x-v.x)&&2220446049250313e-31>=Math.abs(this.y-v.y)},e.prototype.qb=function(v){return this.x===v.x&&this.y===v.y},e.prototype.Nb=function(v){return v==this||v instanceof e&&this.x==v.x&&this.y==v.y},e.prototype.sub=function(v){this.x-=v.x,this.y-=v.y},e.prototype.uc=function(v,f){this.x=v.x-f.x,this.y=v.y-f.y},e.prototype.add=function(v,f){f!==void 0?(this.x=v.x+f.x,this.y=v.y+f.y):(this.x+=v.x,this.y+=v.y)},e.prototype.Sq=function(){this.x=-this.x,this.y=-this.y},e.prototype.mt=function(v){this.x=-v.x,this.y=-v.y},e.prototype.NS=function(v,f,r){this.x=v.x*(1-r)+f.x*r,this.y=v.y*(1-r)+f.y*r},e.prototype.Ct=function(v,f){this.x=this.x*v+f.x,this.y=this.y*v+f.y},e.prototype.HW=function(v,f,r){this.x=f.x*v+r.x,this.y=f.y*v+r.y},e.prototype.scale=function(v){this.x*=v,this.y*=v},e.prototype.compare=function(v){return this.yv.y?1:this.xv.x?1:0},e.prototype.normalize=function(){var v=this.length();v==0&&(this.x=1,this.y=0),this.x/=v,this.y/=v},e.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.Sk=function(){return this.x*this.x+this.y*this.y},e.tb=function(v,f){return Math.sqrt(this.yc(v,f))},e.Oy=function(v,f,r,n){return v-=r,f-=n,Math.sqrt(v*v+f*f)},e.prototype.Qh=function(v){return this.x*v.x+this.y*v.y},e.prototype.fD=function(v){return Math.abs(this.x*v.x)+Math.abs(this.y*v.y)},e.prototype.wi=function(v){return this.x*v.y-this.y*v.x},e.prototype.Bt=function(v,f){var r=-this.x*f+this.y*v;this.x=this.x*v+this.y*f,this.y=r},e.prototype.Hv=function(){var v=this.x;this.x=-this.y,this.y=v},e.prototype.MG=function(v){this.x=-v.y,this.y=v.x},e.prototype.ar=function(){var v=this.x;this.x=this.y,this.y=-v},e.prototype.qu=function(){return 0(v=v.wi(f))?1:0(r=n.value())?-1:0r?-1:0=t?r+(n-r)*t:n-(n-r)*(1-t)},f.OG=function(r,n,t,i){.5>=t?(i.x=r.x+(n.x-r.x)*t,i.y=r.y+(n.y-r.y)*t):(i.x=n.x-(n.x-r.x)*(1-t),i.y=n.y-(n.y-r.y)*(1-t))},f.lT=function(r,n,t,i,h,s){.5>=h?(s.x=r+(t-r)*h,s.y=n+(i-n)*h):(s.x=t-(t-r)*(1-h),s.y=i-(i-n)*(1-h))},f}()}(k||(k={})),function(e){var v=function(f){function r(){var n=f.call(this)||this;return n.sa=0,n.na=0,n.pa=0,n.la=0,n.ka=null,n}return J(r,f),r.prototype.ac=function(){return e.h.construct(this.sa,this.na)},r.prototype.Yp=function(n){n.x=this.sa,n.y=this.na},r.prototype.Dc=function(n){this.em(0,n)},r.prototype.ZB=function(n,t){this.em(0,e.h.construct(n,t))},r.prototype.To=function(n){this.hD(0,n)},r.prototype.setStart=function(n){this.uD(0,n)},r.prototype.wv=function(n,t){return this.Od(0,n,t)},r.prototype.YB=function(n,t,i){this.tn(0,n,t,i)},r.prototype.wc=function(){return e.h.construct(this.pa,this.la)},r.prototype.Tr=function(n){n.x=this.pa,n.y=this.la},r.prototype.Qc=function(n){this.em(1,n)},r.prototype.Ql=function(n,t){this.em(1,e.h.construct(n,t))},r.prototype.Po=function(n){this.hD(1,n)},r.prototype.setEnd=function(n){this.uD(1,n)},r.prototype.gv=function(n,t){return this.Od(1,n,t)},r.prototype.OB=function(n,t,i){this.tn(1,n,t,i)},r.prototype.Db=function(){return 1},r.prototype.B=function(){return this.Ac()},r.prototype.Oa=function(){},r.prototype.Ke=function(){return 0},r.prototype.Ea=function(n,t,i,h,s){return this.KM(n,t,i,h,s)},r.prototype.isIntersecting=function(n,t){return this.zr(n,t,!1)!=0},r.prototype.qs=function(n,t){return this.ru(n,t,!1)},r.prototype.ru=function(){return null},r.prototype.Ac=function(){return!1},r.prototype.ay=function(n){if(this.vc(),this.ka==null&&0=e.ra.Va(t))throw e.i.ce();var h=this.description.Pf(t);return 0<=h?(this.ka!=null&&this.ay(this.description.Ae.length-2),this.ka[r.Gg(this.description,n)+this.description.$j(h)-2+i]):e.ra.se(t)},r.prototype.tn=function(n,t,i,h){if(this.vc(),i>=e.ra.Va(t))throw e.i.ce();var s=this.description.Pf(t);0>s&&(this.re(t),s=this.description.Pf(t)),t==0?n!=0?i!=0?this.la=h:this.pa=h:i!=0?this.na=h:this.sa=h:(this.ka==null&&this.ay(this.description.Ae.length-2),this.ka[r.Gg(this.description,n)+this.description.$j(s)-2+i]=h)},r.prototype.copyTo=function(n){if(n.getType()!=this.getType())throw e.i.N();n.description=this.description,n.ay(this.description.Ae.length-2),r.gM(this.ka,n.ka,2*(this.description.Ae.length-2)),n.sa=this.sa,n.na=this.na,n.pa=this.pa,n.la=this.la,n.vc(),this.op(n)},r.prototype.Tg=function(n,t){var i=new e.Nc;return this.Ac()?(i.Oa(),i):(i.oa=this.Od(0,n,t),i.va=i.oa,i.Lk(this.Od(1,n,t)),i)},r.prototype.ZI=function(n){this.Ac()?n.Oa():(n.oa=this.Od(0,0,0),n.va=n.oa,n.Lk(this.Od(1,0,0)))},r.prototype.Tw=function(n,t){t.Nf(this.description),t.Cb(this.hc(n));for(var i=1,h=this.description.Aa;it||t>=this.wa)throw e.i.fa("index out of bounds");this.mc(),i.Nf(this.description),i.B()&&i.un();for(var h=0;ht||t>=this.I())throw e.i.ce();this.mc(),this.za[0].tc(2*t,i)},n.prototype.Na=function(t){var i=new e.h;return this.D(t,i),i},n.prototype.Gc=function(t,i){this.za[0].tc(2*t,i)},n.prototype.Cb=function(t,i,h){if(0>t||t>=this.wa)throw e.i.ce();this.mc();var s=this.za[0];h!==void 0?(s.write(2*t,i),s.write(2*t+1,h)):s.Tt(2*t,i),this.Pc(1993)},n.prototype.Cz=function(){if(void 0>=this.I())throw e.i.ce();this.mc();var t=this.za[0],i=new e.Nd;return i.x=t.read(NaN),i.y=t.read(NaN),i.z=this.hasAttribute(1)?this.za[1].eg():e.ra.se(1),i},n.prototype.dC=function(t){if(0>t||t>=this.I())throw e.i.ce();this.re(1),this.mc(),this.Pc(1993);var i=this.za[0];i.write(2*t,(void 0).x),i.write(2*t+1,(void 0).y),this.za[1].pr(t,(void 0).z)},n.prototype.Uc=function(t,i,h){if(0>i||i>=this.wa)throw e.i.ce();var s=e.ra.Va(t);if(h>=s)throw e.i.ce();this.mc();var o=this.description.Pf(t);return 0<=o?this.za[o].eg(i*s+h):e.ra.se(t)},n.prototype.yF=function(t,i){return this.Uc(t,i)},n.prototype.setAttribute=function(t,i,h,s){if(0>i||i>=this.wa)throw e.i.ce();var o=e.ra.Va(t);if(h>=o)throw e.i.ce();this.re(t),this.mc(),t=this.description.Pf(t),this.Pc(1993),this.za[t].pr(i*o+h,s)},n.prototype.ub=function(t){return this.wx(),this.re(t),this.mc(),this.za[this.description.Pf(t)]},n.prototype.hn=function(t,i){if(i!=null&&e.ra.Tp(t)!=i.Tp())throw e.i.N();this.re(t),t=this.description.Pf(t),this.za==null&&(this.za=e.Yc.qI(this.description.Aa)),this.za[t]=i,this.Pc(16777215)},n.prototype.sn=function(t){var i=null;if(this.za!=null){var h=e.ee.Iw(t,this.description);i=[];for(var s=0,o=t.Aa;sthis.wa+5?(5*this.wa+3)/4:this.wa),this.za[t].resize(s*h,e.ra.se(i))),st)throw e.i.N();t!=this.wa&&(this.wa=t,this.Pc(65535))},n.prototype.om=function(t){if(!this.ak(1)){if(!this.ak(2))return 0;if(this.QT>=t)return this.ak(8)?1:2}return-1},n.prototype.Ch=function(t,i){if(this.QT=i,t==-1)this.Lf(1,!0),this.Lf(8,!0);else if(this.Lf(1,!1),this.Lf(8,!0),t==0)this.Lf(2,!1),this.Lf(4,!1);else if(t==1)this.Lf(2,!0),this.Lf(4,!1);else{if(t!=2)throw e.i.fa("internal error.");this.Lf(2,!0),this.Lf(4,!0)}},n.prototype.lM=function(){this.Bb!=null&&(this.Bb=null)},n.prototype.kD=function(t,i,h,s){if(0>t||t>=this.wa||0>i||i>=this.wa)throw e.i.fa("index out of bounds");this.mc(),s.Nf(this.description),s.B()&&s.un();for(var o=0;ot||t>=this.wa)throw e.i.ce();this.mc();var i=new e.Sa;i.Nf(this.description),i.B()&&i.un();for(var h=0;ht||t>=this.wa)throw e.i.ce();if(i.B())throw e.i.N();this.mc();for(var h=i.description,s=0;se.O.bB(this.Tm)>>1:n!=-1)?r=n:i=o,n=!0;;){if(0>i){if((o=s[7*r])==-1){i=r,t=this.ob.Ll([-1,-1,r,t,this.gl(),-1,-1]),(s=this.ob.o)[7*r]=t;break}r=o}else{if((o=s[7*r+1])==-1){i=s[7*r+6],t=this.ob.Ll([-1,-1,r,t,this.gl(),-1,-1]),(s=this.ob.o)[7*r+1]=t;break}r=o}n&&(i*=-1,n=!1)}return this.oy(t,s),s[7*t+2]===-1&&(s[7*h]=t),this.vp(i,t,h,s),t},f.prototype.FF=function(){return this.iR(this.Qe)},f.prototype.vd=function(r,n){n=n==-1?this.Qe:n,this.Rv?this.LP(r,n):this.iY(r,n)},f.prototype.search=function(r,n){for(n=this.sv(n);n!=-1;){var t=this.Zn.compare(this,r,n);if(t==0)return n;n=0>t?this.ll(n):this.Xp(n)}return-1},f.prototype.IW=function(r){for(var n=this.sv(-1),t=-1;n!=-1;){var i=r.compare(this,n);if(i==0)return n;0>i?n=this.ll(n):(t=n,n=this.Xp(n))}return t},f.prototype.uJ=function(r){for(var n=this.sv(-1),t=-1;n!=-1;){var i=r.compare(this,n);if(i==0)return n;0>i?(t=n,n=this.ll(n)):n=this.Xp(n)}return t},f.prototype.ja=function(r){return this.ob.T(r,3)},f.prototype.ll=function(r){return this.ob.T(r,0)},f.prototype.Xp=function(r){return this.ob.T(r,1)},f.prototype.getParent=function(r){return this.ob.T(r,2)},f.prototype.lb=function(r){return this.ob.T(r,6)},f.prototype.we=function(r){return this.ob.T(r,5)},f.prototype.rc=function(r){return r==-1?this.kl(this.Qe):this.kl(r)},f.prototype.Fc=function(r){return r==-1?this.Zr(this.Qe):this.Zr(r)},f.prototype.ZR=function(r){return r==-1?this.bG(this.Qe):this.bG(r)},f.prototype.Sj=function(r,n){this.NB(r,n)},f.prototype.sv=function(r){return r==-1?this.YF(this.Qe):this.YF(r)},f.prototype.clear=function(){this.ob.mj(!1),this.Qe=-1},f.prototype.size=function(r){return r==-1?this.$F(this.Qe):this.$F(r)},f.prototype.KN=function(r,n){for(var t=n[7*r],i=n[7*r+1],h=n[7*r+4];t!=-1||i!=-1;){var s=t!=-1?n[7*t+4]:2147483647;if(i=i!=-1?n[7*i+4]:2147483647,h<=Math.min(s,i))break;s<=i?this.sJ(t,n):this.rJ(r,n),t=n[7*r],i=n[7*r+1]}},f.prototype.oy=function(r,n){if(this.Rv)for(var t=n[7*r+4],i=n[7*r+2];i!=-1&&n[7*i+4]>t;)n[7*i]==r?this.sJ(r,n):this.rJ(i,n),i=n[7*r+2]},f.prototype.rJ=function(r,n){var t=n[7*r+1];n[7*t+2]=n[7*r+2],n[7*r+2]=t;var i=n[7*t];n[7*r+1]=i,i!=-1&&(n[7*i+2]=r),n[7*t]=r,(i=n[7*t+2])!=-1&&(n[7*i]==r?n[7*i]=t:n[7*i+1]=t)},f.prototype.sJ=function(r,n){var t=n[7*r+2];n[7*r+2]=n[7*t+2],n[7*t+2]=r;var i=n[7*r+1];n[7*t]=i,i!=-1&&(n[7*i+2]=t),n[7*r+1]=t,(i=n[7*r+2])!=-1&&(n[7*i]===t?n[7*i]=r:n[7*i+1]=r)},f.prototype.Pk=function(r,n){this.ob.S(r,2,n)},f.prototype.TB=function(r,n){this.ob.S(r,0,n)},f.prototype.XB=function(r,n){this.ob.S(r,1,n)},f.prototype.WB=function(r,n){this.ob.S(r,5,n)},f.prototype.ex=function(r,n){this.ob.S(r,6,n)},f.prototype.XJ=function(r,n){this.ob.S(n,0,r)},f.prototype.rX=function(r){this.ob.S(r,4,0)},f.prototype.uX=function(r,n){this.ob.S(n,5,r)},f.prototype.YF=function(r){return r==-1?-1:this.ob.T(r,0)},f.prototype.kl=function(r){return r==-1?-1:this.ob.T(r,1)},f.prototype.Zr=function(r){return r==-1?-1:this.ob.T(r,2)},f.prototype.iR=function(r){return r==-1?-1:this.ob.T(r,3)},f.prototype.$F=function(r){return r==-1?0:this.ob.T(r,4)},f.prototype.bG=function(r){return this.ob.T(r,5)},f.prototype.Pw=function(){return this.ob.Ll([-1,-1,-1,void 0,this.gl(),-1,-1])},f.prototype.fl=function(r){r!=-1&&this.ob.jd(r)},f.prototype.gl=function(){return this.Tm=e.O.bB(this.Tm),1073741823&this.Tm},f.prototype.FD=function(r,n,t){var i=this.ob.o;if(t==-1||i[7*t]==-1)return r=this.ob.Ll([-1,-1,-1,r,this.gl(),-1,-1]),(i=this.ob.o)[7*t]=r,this.vp(-1,r,t,i),r;for(var h=t==-1?-1:i[7*t];;){var s=n==-1?1:this.Zn.compare(this,r,h);if(0>s){if((s=this.ll(h))==-1){n=h,r=this.ob.Ll([-1,-1,h,r,this.gl(),-1,-1]),(i=this.ob.o)[7*h]=r;break}h=s}else{if(n==1&&s==0)return i[7*t+3]=h,-1;if((s=i[7*h+1])==-1){n=i[7*h+6],r=this.ob.Ll([-1,-1,h,r,this.gl(),-1,-1]),(i=this.ob.o)[7*h+1]=r;break}h=s}}return this.oy(r,i),i[7*r+2]===-1&&(i[7*t]=r),this.vp(n,r,t,i),r},f.prototype.vp=function(r,n,t,i){if(r!=-1){var h=i[7*r+5];i[7*r+5]=n}else h=t==-1?-1:i[7*t+2];i[7*n+5]=h,h!=-1&&(i[7*h+6]=n),i[7*n+6]=r,r==(t==-1?-1:i[7*t+1])&&(i[7*t+1]=n),r==-1&&(i[7*t+2]=n),i[7*t+4]=(t==-1?0:i[7*t+4])+1},f.prototype.AB=function(r,n){var t=this.ob.o,i=t[7*r+5];r=t[7*r+6],i!=-1?t[7*i+6]=r:t[7*n+1]=r,r!=-1?t[7*r+5]=i:t[7*n+2]=i,t[7*n+4]=n===-1?-1:t[7*n+4]-1},f.prototype.iY=function(r,n){this.AB(r,n);var t=this.ll(r),i=this.Xp(r),h=this.getParent(r),s=r;if(t!=-1&&i!=-1){this.Tm=e.O.bB(this.Tm);var o=1073741823=r.oa:r.va>=this.oa},f.prototype.move=function(r){this.B()||(this.oa+=r,this.va+=r)},f.prototype.normalize=function(){if(!isNaN(this.oa)){if(this.oa>this.va){var r=this.oa;this.oa=this.va,this.va=r}isNaN(this.va)&&this.Oa()}},f.prototype.Oa=function(){this.va=this.oa=NaN},f.prototype.B=function(){return isNaN(this.oa)},f.prototype.Zb=function(r){typeof r=="number"?this.B()?this.va=this.oa=r:this.Lk(r):r.B()||(this.B()?(this.oa=r.oa,this.va=r.va):(this.oa>r.oa&&(this.oa=r.oa),this.vathis.va&&this.Oa()))},f.prototype.Lk=function(r){rthis.va&&(this.va=r)},f.prototype.contains=function(r){return typeof r=="number"?r>=this.oa&&r<=this.va:r.oa>=this.oa&&r.va<=this.va},f.prototype.Ea=function(r){this.B()||r.B()?this.Oa():(this.oar.va&&(this.va=r.va),this.oa>this.va&&this.Oa())},f.prototype.W=function(r){this.B()||(this.oa-=r,this.va+=r,this.van?(this.oa=n,this.va=r):(this.oa=r,this.va=n)},f.prototype.It=function(r){return e.O.Rk(r,this.oa,this.va)},f.prototype.R=function(){return this.va-this.oa},f.prototype.sf=function(){return .5*(this.oa+this.va)},f.prototype.Nb=function(r){return r==this||r instanceof f&&(!(!this.B()||!r.B())||this.oa==r.oa&&this.va==r.va)},f.prototype.cc=function(){return e.O.uj(e.O.uj())},f}();e.Nc=v}(k||(k={})),function(e){var v=new e.Nc,f=new e.Nc,r=function(){this.ne=null,this.pb=-1,this.sb=new e.yb,this.qA=55555555,this.Tv=this.Vv=!1,this.Uf=new e.Nc,this.Uf.KB(0,0)};e.IY=r;var n=function(){function t(i,h,s){this.g=i,this.Hk=NaN,this.NH=this.Kq=0,this.OH=NaN,this.qa=h,this.Nq=10*h,this.PH=this.QH=NaN,this.rg=!1,this.Dm=this.gt=this.Lo=this.Xs=this.Ws=-1,this.gA=s,this.TA=new r,this.YH=new r,e.O.truncate(3*i.fd/2)}return t.prototype.mG=function(i,h,s,o){i.ne=o===null?null:o[s[5*h]],i.Tv=i.ne!=null,i.Tv||((o=s[5*h+2])!==-1&&this.g.mW(s[5*h],s[5*o],i.sb),i.ne=i.sb,i.Uf.KB(i.sb.sa,i.sb.pa),i.Uf.va+=this.qa,i.sb.rI(),i.Vv=i.sb.la==i.sb.na,i.Vv||(i.qA=(i.sb.pa-i.sb.sa)/(i.sb.la-i.sb.na)))},t.prototype.OO=function(i,h){var s=i.zr(h,this.qa,!0);return s!=0?s==2?this.Qy():this.xi():(i.Yp(ht),i.Tr(et),h.Yp(st),h.Tr(ot),Q.ma(this.Kq,this.Hk),ht.qb(st)&&this.Hk==ht.y?0>et.compare(ot)?Q.L(et):Q.L(ot):ht.qb(ot)&&this.Hk==ht.y?0>et.compare(st)?Q.L(et):Q.L(st):st.qb(et)&&this.Hk==st.y?0>ht.compare(ot)?Q.L(ht):Q.L(ot):et.qb(ot)&&this.Hk==et.y&&(0>ht.compare(st)?Q.L(ht):Q.L(st)),i.Pe(Q.y,Q.x)s&&0>i?-1:0h.pa){if(h.pa>h.sa&&h.la-h.na<2*this.qa&&i.vi(h.pa,h.la,this.qa))return this.xi()}else if((h.la-h.na)/(h.pa-h.sa)*(i.pa-i.sa)h.sa&&h.la-h.na<2*this.qa&&i.vi(h.pa,h.la,this.qa))return this.xi()}else if((h.la-h.na)/(h.pa-h.sa)*(i.sa-i.pa)o&&0>s?-1:0h+u?s:o.vi(i.sa,i.na,this.qa)?this.xi():ah+u?s:o.vi(i.pa,i.la,this.qa)?this.xi():aa?1:0)},t.prototype.Kr=function(){this.rg=!1},t.prototype.rm=function(){return this.Ni},t.prototype.$J=function(i,h){this.Hk=i,this.Kq=h,this.gt=this.Lo=this.Xs=this.Ws=-1},t.prototype.compare=function(i,h,s){return this.rg?-1:(i=i.ja(s),this.Dm=s,this.RE(h,h,i,i))},t.prototype.RE=function(i,h,s,o){if(this.Lo==h)var a=this.TA;else this.Lo=h,a=this.TA,this.TA.pb=i,this.mG(a,h,this.g.td.o,this.g.We);if(u==null){this.gt=o;var u=this.YH;this.YH.pb=s,this.mG(u,o,this.g.td.o,this.g.We)}return a.Tv||u.Tv?this.NO(h,o,a,u):a.Uf.vathis.Uf.va)return 1;if(this.ie.na==this.ie.la)return this.Dm=r,this.rg=!0,0;this.ie.rI(),t=this.ie.ac(),(n=new e.h).uc(this.ie.wc(),t),n.ar();var i=new e.h;return i.uc(this.Gq,t),t=n.Qh(i),(t/=n.length())<10*-this.qa?-1:t>10*this.qa?1:this.ie.qs(this.Gq,this.qa)&&((n=Math.abs(t))t?-1:1},f}();e.aM=v}(k||(k={})),function(e){function v(r,n,t,i){t=new Float64Array(r.subarray(t,i)),r.set(t,n)}var f=function(){function r(n){this.Pb=this.pk=!1,this.o=null;var t=n;2>t&&(t=2),this.o=new Float64Array(t),this.size=n}return r.prototype.rotate=function(n,t,i){if(this.Pb)throw e.i.fa("invalid_call");if(ti||n>i)throw e.i.N();n!=t&&i!=t&&(this.ni(n,t-n,1),this.ni(t,i-t,1),this.ni(n,i-n,1))},r.qf=function(n,t){var i=new r(n),h=i.o;if(2>n&&(n=2),t!==0)for(var s=0;st&&(i.size=t),2>(t=i.size)&&(t=2),i.o=new Float64Array(t),i.o.set(n.o.length<=t?n.o:n.o.subarray(0,t),0),i},r.prototype.Jb=function(n){0>=n||(this.o==null?this.o=new Float64Array(n):n<=this.o.length||(0this.o.length&&(i=e.O.truncate(64>n?Math.max(2*n,4):5*n/4),(i=new Float64Array(i)).set(this.o),this.o=i),i=this.o;for(var h=this.size;hthis.o.length)&&this.resize(n),this.pk)throw e.i.fa("invalid call. Attribute Stream is locked and cannot be resized.");this.size=n},r.prototype.pr=function(n,t){this.write(n,t)},r.prototype.An=function(n,t,i){for(var h=this.size;th||i>s&&h!=s)return!1;for(i>h&&(i=h);ts||i%s!=0))throw e.i.N();var o=this.size;if(this.resize(o+i),h)this.o.set(n.o.subarray(t,t+i),o);else{h=i;for(var a=0;ao||h%o!=0))throw e.i.N();var u=this.size-a;if(uo&&(o=this.size),this.size+2*h>this.o.length?this.resize(this.size+2*h):this.size+=2*h,v(this.o,n+2*h,n,n+(o-n)),s)for(s=0;sn||0>t||0>h||!s&&(0>=o||t%o!=0)||i.sizethis.size)throw e.i.Hb();0i||t%i!=0)throw e.i.Hb();for(var h=t>>1,s=0;st||0>i||0>t||i+t>this.size)throw e.i.N();for(var h=t;hn||0>t||0>h)throw e.i.N();if(t!=0)for(this.size<(t<<1)+n&&this.resize((t<<1)+n),s||(n+=t-1<<1),s=s?2:-2,t+=h;hn||0>t)throw e.i.N();if(t!=0){this.size<(t<<1)+n&&this.resize((t<<1)+n),t+=0;for(var h=0;hn||0>t||0>h||this.sizen||0>t||this.size<(t>>1)+n)throw e.i.N();if(t!=0){t=0+t;for(var h=0;ht&&(t=2),this.o=new Int32Array(t),this.size=n}return r.prototype.rotate=function(n,t,i){if(this.Pb)throw e.i.fa("invalid_call");if(ti||n>i)throw e.i.N();n!=t&&i!=t&&(this.ni(n,t-n,1),this.ni(t,i-t,1),this.ni(n,i-n,1))},r.qf=function(n,t){var i=new r(n),h=i.o;if(2>n&&(n=2),t!==0)for(var s=0;st&&(i.size=t),2>(t=i.size)&&(t=2),i.o=new Int32Array(t),i.o.set(n.o.length<=t?n.o:n.o.subarray(0,t),0),i},r.prototype.Jb=function(n){0>=n||(this.o==null?this.o=new Int32Array(n):n<=this.o.length||(0this.o.length&&(i=e.O.truncate(64>n?Math.max(2*n,4):5*n/4),(i=new Int32Array(i)).set(this.o),this.o=i),i=this.o;for(var h=this.size;hthis.o.length)&&this.resize(n),this.pk)throw e.i.fa("invalid call. Attribute Stream is locked and cannot be resized.");this.size=n},r.prototype.pr=function(n,t){this.write(n,t)},r.prototype.An=function(n,t,i){for(var h=this.size;th||i>s&&h!=s)return!1;for(i>h&&(i=h);ts||i%s!=0))throw e.i.N();var o=this.size;if(this.resize(o+i),h)this.o.set(n.o.subarray(t,t+i),o);else{h=i;for(var a=0;ao||h%o!=0))throw e.i.N();if(v(this.o,n+h,n,n+(a-n)),this.o==t.o&&no&&(o=this.size),this.size+2*h>this.o.length?this.resize(this.size+2*h):this.size+=2*h,v(this.o,n+2*h,n,n+(o-n)),s)for(s=0;sn||0>t||0>h||!s&&(0>=o||t%o!=0)||i.sizethis.size)throw e.i.Hb();0i||t%i!=0)throw e.i.Hb();for(var h=t>>1,s=0;st||0>i||0>t||i+t>this.size)throw e.i.N();for(var h=t;hn||0>t||0>h)throw e.i.N();if(t!=0)for(this.size<(t<<1)+n&&this.resize((t<<1)+n),s||(n+=t-1<<1),s=s?2:-2,t+=h;hn||0>t||0>h||this.sizet-n?r.rG(this.o,n,t,i):r.qB(this.o,n,t-1,i)},r.prototype.Tp=function(){return 2},r.prototype.Fc=function(){return this.o[this.size-1]},r.prototype.If=function(){this.resize(this.size-1)},r.prototype.bX=function(n){this.o[this.size-1]=n},r.prototype.SV=function(n){n=t&&0=i))for(;;){if(9>i-t){r.rG(n,t,i+1,h);break}var s=n[t];r.tx(n,t,i);for(var o=t,a=t;a=h(n[a],s)&&(r.tx(n,o,a),o+=1);r.tx(n,o,i),o-tt&&(t=2),this.o=new Int8Array(t),this.size=n}return r.prototype.rotate=function(n,t,i){if(this.Pb)throw e.i.fa("invalid_call");if(ti||n>i)throw e.i.N();n!=t&&i!=t&&(this.ni(n,t-n,1),this.ni(t,i-t,1),this.ni(n,i-n,1))},r.qf=function(n,t){var i=new r(n),h=i.o;if(2>n&&(n=2),t!==0)for(var s=0;st&&(i.size=t),2>(t=i.size)&&(t=2),i.o=new Int8Array(t),i.o.set(n.o.length<=t?n.o:n.o.subarray(0,t),0),i},r.prototype.Jb=function(n){0>=n||(this.o==null?this.o=new Int8Array(n):n<=this.o.length||(0this.o.length&&(i=e.O.truncate(64>n?Math.max(2*n,4):5*n/4),(i=new Int8Array(i)).set(this.o),this.o=i),i=this.o;for(var h=this.size;hthis.o.length)&&this.resize(n),this.pk)throw e.i.fa("invalid call. Attribute Stream is locked and cannot be resized.");this.size=n},r.prototype.pr=function(n,t){this.write(n,t)},r.prototype.An=function(n,t,i){for(var h=this.size;th||i>s&&h!=s)return!1;for(i>h&&(i=h);ts||i%s!=0))throw e.i.N();var o=this.size;if(this.resize(o+i),h)this.o.set(n.o.subarray(t,t+i),o);else{h=i;for(var a=0;ao||h%o!=0))throw e.i.N();if(v(this.o,n+h,n,n+(a-n)),this.o==t.o&&no&&(o=this.size),this.size+2*h>this.o.length?this.resize(this.size+2*h):this.size+=2*h,v(this.o,n+2*h,n,n+(o-n)),s)for(s=0;sn||0>t||0>h||!s&&(0>=o||t%o!=0)||i.sizethis.size)throw e.i.Hb();0i||t%i!=0)throw e.i.Hb();for(var h=t>>1,s=0;st||0>i||0>t||i+t>this.size)throw e.i.N();for(var h=t;hn||0>t||0>h)throw e.i.N();if(t!=0)for(this.size<(t<<1)+n&&this.resize((t<<1)+n),s||(n+=t-1<<1),s=s?2:-2,t+=h;hn||0>t||0>h||this.sizer?-r:r},f.ti=function(r){return 3552713678800501e-30>r},f.KC=function(r,n,t){return f.P(r-n)<=t*(1+(f.P(r)+f.P(n))/2)},f.Y=function(r,n){return f.KC(r,n,3552713678800501e-30)},f.FL=function(r){return 3552713678800501e-30>=f.P(r)},f.Cd=function(r){return f.FL(r)},f}();e.s=v,e.F=function(){function f(){}return f.gp=function(r,n){var t=0;return(r=v.P(r))+(n=v.P(n))!=0&&(r>n?(t=n/r,t=r*Math.sqrt(1+t*t)):(t=r/n,t=n*Math.sqrt(1+t*t))),t},f.Wq=function(r,n,t,i,h){for(var s=[0,0,0],o=[0,0,0],a=0;2>=a;a++)n[a]-=r[a],t[a]-=n[a];t=s[1]*o[2]-s[2]*o[1],n=s[2]*o[0]-s[0]*o[2],s=s[0]*o[1]-s[1]*o[0],r=-1*(t*r[0]+n*r[1]+s*r[2]),i[0]=t,i[1]=n,i[2]=s,i[3]=r,o=f.on(i),i[0]/=o,i[1]/=o,i[2]/=o,i[3]/=o,h!=0&&(o=v.Cd(s)?v.Cd(r)?v.Mb(1,n):-v.Mb(1,r):v.Mb(1,s),o*=v.Mb(1,h),i[0]*=o,i[1]*=o,i[2]*=o,i[3]*=o)},f.zx=function(r,n,t){t[0]=r[1]*n[2]-n[1]*r[2],t[1]=r[2]*n[0]-n[2]*r[0],t[2]=r[0]*n[1]-n[0]*r[1]},f.St=function(r,n){return r[0]*n[0]+r[1]*n[1]+r[2]*n[2]},f.on=function(r){return f.gp(f.gp(r[0],r[1]),r[2])},f.cl=function(r,n,t,i,h,s,o,a){r=f.n(r,n,t);var u=Math.cos(t);s.u=(r+h)*u*Math.cos(i),o.u=(r+h)*u*Math.sin(i),a.u=(r*(1-n)+h)*Math.sin(t)},f.jO=function(r,n,t,i,h,s,o){var a=f.gp(n,t),u=1*Math.sqrt(1-r),c=u/1;if(v.Y(a,0))s.u=0,h.u=v.Mb(1.570796326794897,i),o.u=v.P(i)-u;else{s.u=Math.atan2(t,n),t=Math.atan2(1*i,u*a),s=Math.cos(t);var l=Math.sin(t);n=u*r/(1-r),r*=1,t=Math.atan2(i+n*l*l*l,a-r*s*s*s),3.141592653589793r){var t=Math.sqrt(1-r),i=(1-t)/(1+t),h=i*i,s=i*h,o=i*s,a=i*o,u=i*a,c=i*u,l=1.572916666666667*s-3.2578125*a+4.295068359375*c;r=2.142578125*o-6.071484375*u,t=3.129296875*a-11.249837239583334*c;var p=4.775276692708333*u,y=7.958636765252976*c,d=Math.cos(2*n);return n+Math.sin(2*n)*(1.5*i-.84375*s+.525390625*a-.2688395182291667*c-l+t-y+d*(2*(1.3125*h-1.71875*o+1.650146484375*u)-4*r+6*p+d*(4*l-12*t+24*y+d*(8*r-32*p+d*(16*t-80*y+d*(32*p+64*d*y))))))}for(t=1-r,i=r/2,s=(h=v.P(n))*f.Zu(r)/(1.570796326794897*t),o=9999,u=h,h=0;1e-16h;h++)c=f.w(r,u),a=u-(l=(a=(f.kG(u,r)-i*Math.sin(2*u)/c)/t-s)/(c=1/(c*c*c))),o=v.P(l),u=a;return 0<=n?u:-u},f.qW=function(r,n){return v.ti(n)?r:r*f.Zu(n)/1.570796326794897},f.ba=function(r){return 0>(r=f.pF(r,6.283185307179586))?r+6.283185307179586:3.141592653589793>v.P(r)||v.Y(v.P(r),3.141592653589793)?r:r-6.283185307179586},f.pF=function(r,n){return r-Math.floor(r/n)*n},f.Ah=function(r,n){if(.006884661117170036>n){var t=(n=(1-(n=Math.sqrt(1-n)))/(1+n))*n,i=t*t;return r/(1+n)*(1+.25*t+.015625*i+.00390625*t*i)*1.570796326794897}return r*f.Zu(n)},f.Vq=function(r,n){var t=v.Mb(1,Math.sin(n));return n=1.570796326794897>=(n=v.P(f.pF(n,3.141592653589793)))?n:3.141592653589793-n,(v.Y(n,1.570796326794897)?n:Math.atan(Math.sqrt(1-r)*Math.tan(n)))*t},f.q=function(r,n,t){if(.006884661117170036>n){var i=(n=(1-(n=Math.sqrt(1-n)))/(1+n))*n,h=n*i,s=n*h,o=n*s,a=n*o,u=n*a,c=-.7291666666666666*h+.2278645833333333*o+.03987630208333334*u,l=.615234375*s-.21533203125*a,p=-.54140625*o+.20302734375*u,y=.48876953125*a,d=-.4488699776785715*u,g=Math.cos(2*t);return r/(1+n)*((1+.25*i+.015625*s+.00390625*a)*t+Math.sin(2*t)*(-1.5*n+.1875*h+.0234375*o+.00732421875*u-c+p-d+g*(2*(.9375*i-.234375*s-.03662109375*a)-4*l+6*y+g*(4*c-12*p+24*d+g*(8*l-32*y+g*(16*p-80*d+g*(32*y+64*g*d)))))))}return r*(f.kG(t,n)-.5*n*Math.sin(2*t)/f.w(n,t))},f.w=function(r,n){return n=Math.sin(n),Math.sqrt(1-r*n*n)},f.Zu=function(r){return v.KC(r,1,2220446049250313e-31)?1:1>r?f.Xw(0,1-r)-r/3*f.Uw(0,1-r):NaN},f.kG=function(r,n){var t=v.Mb(1,r);r=v.P(r);var i=Math.floor(r/1.570796326794897);if(1v.P(i)&&1e-4>v.P(h)&&1e-4>v.P(s));)s=Math.sqrt(a),n+=r/((t=Math.sqrt(u))*(u+(s=Math.sqrt(o)*(s+t)+s*t))),r*=.25,o=.25*(o+s),a=.25*(a+s),u=.25*(u+s);return a=(o=i*h)-(u=s*s),3*n+r*(1+(u=o-6*u)*(.10227272727272728*u-.2142857142857143-.1730769230769231*s*(i=u+a+a))+s*(.1666666666666667*i+s*(-.4090909090909091*a+.1153846153846154*s*o)))/(t*Math.sqrt(t))},f.Xw=function(r,n){for(var t,i,h,s,o=1;i=2-((t=(r+n+o)/3)+r)/t,h=2-(t+n)/t,s=2-(t+o)/t,!(1e-4>v.P(i)&&1e-4>v.P(h)&&1e-4>v.P(s));o=.25*(o+t))t=Math.sqrt(n),i=Math.sqrt(o),r=.25*(r+(t=Math.sqrt(r)*(t+i)+t*i)),n=.25*(n+t);return(1+(.04166666666666666*(r=i*h-s*s)-.1-.06818181818181818*(n=i*h*s))*r+.07142857142857142*n)/Math.sqrt(t)},f.Qw=function(r,n){if(v.ti(r)||n==0||v.Y(v.P(n),1.570796326794897))return n;if(.006884661117170036>r){var t=r*r,i=r*t,h=r*i,s=r*h,o=r*s,a=r*o,u=-(.02708333333333333*i+.03430059523809524*h+.03149181547619048*s+.02634359154541446*o+.02156896735835538*a),c=.007669890873015873*h+.01299603174603175*s+.0148051353064374*o+.01454454953803912*a,l=-(.002275545634920635*s+.004830845032667949*o+.006558395368616723*a),p=.0006957236677288761*o+.001775193002406544*a,y=-.000217324089394402*a,d=Math.cos(2*n);return n+Math.sin(2*n)*(-(.5*r+.2083333333333333*t+.09375*i+.04878472222222222*h+.02916666666666667*s+.01938905423280423*o+.01388255931712963*a)-u+l-y+d*(2*(.1041666666666667*t+.0875*i+.06050347222222222*h+.04151785714285714*s+.02958958540013228*o+.02203667534722222*a)-4*c+6*p+d*(4*u-12*l+24*y+d*(8*c-32*p+d*(16*l-80*y+d*(32*p+64*d*y))))))}return n==0||v.Y(v.P(n),1.570796326794897)?t=n:(h=(i=Math.sqrt(r))*Math.sin(n),t=Math.tan(.7853981633974483+n/2)*Math.pow((1-h)/(1+h),i/2),t=2*Math.atan(t)-1.570796326794897),t},f.yO=function(r,n){if(v.ti(r)||n==0||v.Y(v.P(n),1.570796326794897))return n;if(.006884661117170036>r){var t=r*(p=r*(l=r*(d=r*r))),i=r*(y=r*t),h=.05833333333333333*l+.07232142857142858*p+.05634300595238095*t+.0355325796406526*y+.020235546186067*i,s=.02653149801587302*p+.04379960317460317*t+.0429211791776896*y+.03255384637546096*i,o=.01294022817460318*t+.02668104344536636*y+.03155651254609588*i,a=.00659454790965208*y+.0163075268674227*i,u=.003463473736911237*i,c=Math.cos(2*n);return n+Math.sin(2*n)*(.5*r+.2083333333333333*d+.08333333333333333*l+.03611111111111111*p+.01875*t+.01195601851851852*y+.008863673941798942*i-h+o-u+c*(2*(.1458333333333333*d+.1208333333333333*l+.07039930555555556*p+.03616071428571429*t+.01839451058201058*y+.01017113095238095*i)-4*s+6*a+c*(4*h-12*o+24*u+c*(8*s-32*a+c*(16*o-80*u+c*(32*a+64*c*u))))))}var l=Math.sqrt(r),p=l/2,y=Math.tan(.7853981633974483+n/2);r=0,h=1;for(var d=n;h!=0;d=i)t=l*Math.sin(d),i=y*Math.pow((1+t)/(1-t),p),i=2*Math.atan(i)-1.570796326794897,r++,(v.Y(i,d)||3e4this.Kk&&(this.Kk=0);var t=this.Ue.getType();if(this.jH=t==e.Sc.PE_TYPE_PROJCS?2:1,t==e.Sc.PE_TYPE_PROJCS&&!r.loadConstants())throw e.i.N("PeProjcs.loadConstants failed");n=t==e.Sc.PE_TYPE_GEOGCS?this.Ue:this.Ue.getGeogcs(),t!=e.Sc.PE_TYPE_GEOGCS&&e.pf.getCode(n),this.Eo=r.getUnit(),this.RH=n.getPrimem().getLongitude(),this.wH=r=n.getUnit().getUnitFactor(),r=Math.PI/(180*r),1e-10>Math.abs(r-1)&&(r=1),this.GA=r,t&e.Sc.PE_TYPE_PROJCS?(n=this.Ue,this.HA=1/n.getUnit().getUnitFactor(),this.sw=.001/this.Ue.getUnit().getUnitFactor(),this.tw=e.Cg.generate(n,e.Cg.PE_PCSINFO_OPTION_NONE),this.zl=this.tw.isPannableRectangle(),this.bA=e.zb.qN(this.tw.getCentralMeridian(),this.GA)):(this.KA=this.zl=!0,this.HA=0,t=1/n.getUnit().getUnitFactor(),this.sw=.001/n.getDatum().getSpheroid().getAxis()*t,this.bA=0),this.zl&&(this.xx(),this.DK(),this.nY(),this.CK(),this.lY(),this.mY())}return f.prototype.$r=function(){return this.Kk},f.prototype.kk=function(){return this.tw},f.Py=function(r,n){return r==n||r!=null&&n!=null&&r.Kk==0&&n.Kk==0&&r.As===n.As},f.prototype.Wc=function(){return this.zl},f.prototype.gh=function(r){r.K(this.so)},f.prototype.pv=function(){return this.so.v},f.prototype.ov=function(){return this.so.C},f.prototype.GR=function(r){r.K(this.uw)},f.prototype.lY=function(){var r=this.Ue.getType();if(r==e.Sc.PE_TYPE_PROJCS){r=this.Ue;var n=this.kk().getCentralMeridian(),t=r.getGeogcs();if(t==null)throw e.i.fa("internal error");n=[[n+(t=1/t.getUnit().getUnitFactor()*Math.PI),0]],e.ej.geogToProj(r,1,n),n=n[0][0],t=r.getParameters()[e.Sc.PE_PARM_X0].getValue();var i=this.ml();r=new e.l,i.A(r),n=(i=Math.abs(n-t))+t,t=-1*i+t,i=r.H,r=r.G;var h=new e.l;h.K(t,r,n,i),this.so==null&&(this.so=h)}else{if(r!=e.Sc.PE_TYPE_GEOGCS)throw e.i.fa("internal error");t=1/this.Ue.getUnit().getUnitFactor()*Math.PI,(r=new e.l).K(-t,-t/2,t,t/2),this.so==null&&(this.so=r)}},f.prototype.mY=function(){var r=this.Ue.getType();if(r==e.Sc.PE_TYPE_PROJCS){var n=this.Ue;if(r=this.kk().getCentralMeridian(),(n=n.getGeogcs())==null)throw e.i.fa("internal error");n=1/n.getUnit().getUnitFactor()*Math.PI;var t=this.Vr(),i=new e.l;t.A(i),(t=new e.l).K(r-n,i.G,r+n,i.H),this.uw==null&&(this.uw=t)}else{if(r!=e.Sc.PE_TYPE_GEOGCS)throw e.i.fa("internal error");n=1/this.Ue.getUnit().getUnitFactor()*Math.PI,(r=new e.l).K(-n,-n/2,n,n/2),this.uw==null&&(this.uw=r)}},f.prototype.bf=function(){return this.GA},f.prototype.pm=function(){return this.HA},f.prototype.Vr=function(){if(this.zl)return this.ul;var r=this.ul;return r??(this.xx(),this.ul)},f.prototype.Wr=function(){return this.zl?null:(this.ul!=null||this.xx(),this.YG)},f.prototype.xx=function(){if(this.Ue.getType()==e.Sc.PE_TYPE_PROJCS){var r=this.Ue,n=r.getGeogcs(),t=r.horizonGcsGenerate();if(t!=null){var i=t[0].getNump(),h=t[0].getKind();r=0u&&(t=-400*s,l.K(t,l.G,t+5*a,l.H)),t=new e.Fh(l),this.ul==null&&(this.ul=t,this.Iv=r);else{if(u=new e.Da,a=this.kk().isGcsHorizonMultiOverlap(),l=e.gu.bF(n,e.hu.Integer64),a){for(u=new e.gL,c=e.Gh.local().V(u,l,null),y=0;ythis.ss&&(this.ss=0),this.Eo=n=this.KT.getUnit(),this.IH=1/n.getUnitFactor(),e.pf.getCode(r)}return f.Py=function(r,n){return r==n||r!=null&&n!=null&&r.ss==0&&n.ss==0&&r.As===n.As},f.prototype.$r=function(){return this.ss},f}();e.PL=v}(k||(k={})),function(e){e.Yg=function(){function v(){}return v.tb=function(f,r,n,t,i,h,s,o){if(h!=null||s!=null||o!=null){t=e.F.ba(t),r=e.F.ba(r),n=e.F.ba(n),i=e.F.ba(i),1.570796326794897n?t:e.F.ba(3.141592653589793-t):Math.atan2(l*d,u*p-c*l*y)),o!=null&&(e.s.Y(e.s.P(i),1.570796326794897)?o.u=0>i?r:e.F.ba(3.141592653589793-r):(o.u=Math.atan2(u*d,p*u*y-l*c),o.u=e.F.ba(o.u+3.141592653589793)))}}},v.rf=function(f,r,n,t,i,h,s){if(h!=null||s!=null){r=e.F.ba(r),n=e.F.ba(n),1.570796326794897p?i:e.F.ba(3.141592653589793-i):r:e.s.Y(e.s.P(n),1.570796326794897)&&e.s.Y(f,3.141592653589793)?0>n?i:e.F.ba(3.141592653589793-i):e.F.ba(r+Math.atan2(l*a,u*t-c*l*o)))}},v}()}(k||(k={})),function(e){e.Wk=function(){function v(){}return v.tb=function(f,r,n,t,i,h,s,o,a){var u=new e.ga(0),c=new e.ga(0),l=[0,0,0],p=[0,0,0],y=[0,0,0],d=new e.ga(0),g=new e.ga(0),b=new e.ga(0),x=new e.ga(0),m=new e.ga(0);if(s!=null||o!=null||a!=null)if(e.s.ti(r))e.Yg.tb(f,n,t,i,h,s,o,a);else{i=e.F.ba(i),n=e.F.ba(n);var w=e.F.ba(i-n);if(e.s.Y(t,h)&&(e.s.Y(n,i)||e.s.Y(e.s.P(t),1.570796326794897)))s!=null&&(s.u=0),o!=null&&(o.u=0),a!=null&&(a.u=0);else{if(e.s.Y(t,-h)){if(e.s.Y(e.s.P(t),1.570796326794897))return s!=null&&(s.u=2*e.F.Ah(f,r)),o!=null&&(o.u=0w){j=1;var M=n;n=i,i=M,M=t,t=h,h=M}w=e.F.ot(r,t);var A=e.F.ot(r,h);o==null&&a==null||(e.Yg.tb(f,n,w,i,A,null,u,c),u=Math.atan2(Math.sin(u.u)*Math.cos(t-w),Math.cos(u.u)),c=Math.atan2(Math.sin(c.u)*Math.cos(h-A),Math.cos(c.u)),j!=0&&(M=u,u=c,c=M),o!=null&&(o.u=u),a!=null&&(a.u=c)),s!=null&&(e.F.cl(1,r,t,n,0,b,x,m),l[0]=b.u,l[1]=x.u,l[2]=m.u,e.F.cl(1,r,h,i,0,b,x,m),p[0]=b.u,p[1]=x.u,p[2]=m.u,y[0]=l[1]*p[2]-p[1]*l[2],y[1]=-(l[0]*p[2]-p[0]*l[2]),y[2]=l[0]*p[1]-p[0]*l[1],r=1-e.F.w(r,e.F.Vq(r,e.F.Qj(r,Math.acos(y[2]/Math.sqrt(y[0]*y[0]+y[1]*y[1]+y[2]*y[2]))))),r*=2-r,o=Math.atan2(-y[1],-y[0]),y=e.F.ba(o-1.570796326794897),o=e.F.ba(o+1.570796326794897),y=e.s.P(e.F.ba(n-y))<=e.s.P(e.F.ba(n-o))?y:o,e.Yg.tb(1,y,0,n,w,d,null,null),e.Yg.tb(1,y,0,i,A,g,null,null),3.141592653589793i&&(i=e.s.P(i),h=e.F.ba(h+3.141592653589793)),n=e.F.ba(n),t=e.F.ba(t),1.570796326794897=e.s.P(h)?1:-1);h=e.F.ba(n+Math.atan(Math.tan(h)*-Math.sin(b))),e.Yg.tb(f,h,0,n,b,null,c,null),b=e.s.P(1.570796326794897-e.s.P(c.u)),b=e.F.Qj(r,b),b=1-e.F.w(r,e.F.Vq(r,b)),b*=2-b,e.F.cl(1,r,0,h,0,y,d,g),l[0]=y.u,l[1]=d.u,l[2]=g.u,e.F.cl(1,r,t,n,0,y,d,g),p[0]=y.u,p[1]=d.u,p[2]=g.u,t=Math.acos((l[0]*p[0]+l[1]*p[1]+l[2]*p[2])/Math.sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2])),t=e.F.Qj(b,t),i=0<(t=e.F.q(f,b,t)+i*x)?c.u:e.F.ba(c.u+3.141592653589793),f=e.s.P(t)/e.F.Ah(f,b)*1.570796326794897,f=e.F.Rq(b,f),f=e.F.ot(b,f),e.Yg.rf(1,h,0,f,i,s,u),o!=null&&(a=u.u),o!=null&&(o.u=e.F.Qj(r,a))}},v}()}(k||(k={})),function(e){e.cu=function(){function v(){}return v.tb=function(f,r,n,t,i,h,s,o,a){var u=0,c=0,l=0;if(s!=null||o!=null||a!=null)if(e.s.ti(r))e.Yg.tb(f,n,t,i,h,s,o,a);else{var p=e.F.ba(i-n);if(e.s.Y(t,h)&&(e.s.Cd(p)||e.s.Y(e.s.P(t),1.570796326794897)))s!=null&&(s.u=0),o!=null&&(o.u=0),a!=null&&(a.u=0);else{if(e.s.Y(t,-h)){if(e.s.Y(e.s.P(t),1.570796326794897))return s!=null&&(s.u=2*e.F.Ah(f,r)),o!=null&&(o.u=0=N&&!e.s.Y(I,j));if(z!=0)y=(d*=u)*(256+d*(d*(74-47*d)-128))/1024,s!=null&&(s.u=g*(1+d*(4096+d*(d*(320-175*d)-768))/16384)*(D-y*C*(c+y/4*(T*(2*l-1)-y/6*c*(4*C*C-3)*(4*l-3))))),o!=null&&(o.u=e.s.Y(e.s.P(t),1.570796326794897)?0>t?i:e.F.ba(3.141592653589793-i):Math.atan2(m*A,r*w-x*m*M)),a!=null&&(e.s.Y(e.s.P(h),1.570796326794897)?a.u=0>h?n:e.F.ba(3.141592653589793-n):(a.u=Math.atan2(r*A,r*w*M-x*m),a.u=e.F.ba(a.u+3.141592653589793)));else{j=e.s.Mb(3.141592653589793,p),T=x*w-r*m,D=Math.acos(T),C=Math.sin(D),u=1,N=B=0;do l=B,M=1-.25*(B=y*(u*=u)*(1+y+y*y))+.1875*(c=y*y*(M=u*u)*(1+2.25*y))-.1953125*(z=y*y*y*M*u),B=.25*B-.25*c+.29296875*z,A=.03125*c-.05859375*z,z*=.00651041666666667,c=T-2*x*w/u,1=N&&!e.s.Y(l,B));s!=null&&(M=1+(d*=u*=u)*(4096+d*(d*(320-175*d)-768))/16384,e.s.Y(t,-h)?s.u=3.141592653589793*g*M:(c=T-2*x*w/u,u=Math.acos(c),T=Math.cos(2*u),I=Math.cos(3*u),s.u=g*(M*D+d*(d*(128+d*(35*d-60))-512)/2048*C*c+d*(5*d-4)/6144*d*d*Math.sin(2*D)*T+z*Math.sin(3*D)*I+-762939453125e-16*d*d*d*d*Math.sin(4*D)*Math.cos(4*u)))),o!=null&&(e.s.Cd(t)&&e.s.Cd(h)?(u=Math.sqrt(1-B*B),o.u=Math.acos(u),0>p&&(o.u*=-1)):e.s.Y(e.s.P(t),1.570796326794897)?o.u=0>t?i:e.F.ba(3.141592653589793-i):(s=B/r,g=Math.sqrt(1-s*s),0>r*w-x*m*Math.cos(j)&&(g*=-1),o.u=Math.atan2(s,g),e.s.Y(t,-h)&&e.s.P(e.F.ba(n-i))>3.141592653589793*(1-y*Math.cos(t))&&(0e.s.P(o.u)||0>t&&1.570796326794897h?n:e.F.ba(3.141592653589793-n):(p=B/m,s=Math.sqrt(1-p*p),g=Math.sin(j/2),0>Math.sin(b-f)-2*r*w*g*g&&(s*=-1),a.u=Math.atan2(p,s),a.u=e.F.ba(a.u+3.141592653589793),e.s.Y(t,-h)&&!e.s.Cd(t)&&!e.s.Y(e.s.P(t),1.570796326794897)&&e.s.P(e.F.ba(n-i))>3.141592653589793*(1-y*Math.cos(t))&&(o!=null?g=o.u:(s=B/r,g=Math.sqrt(1-s*s),0>r*w-x*m*Math.cos(j)&&(g*=-1),g=Math.atan2(s,g),e.s.Y(t,-h)&&e.s.P(e.F.ba(n-i))>3.141592653589793*(1-y*Math.cos(t))&&(0e.s.P(g)||0>t&&1.570796326794897=e.s.P(g)&&1.570796326794897e.s.P(a.u))&&(a.u=-1*e.F.ba(a.u+3.141592653589793))))}}}},v.rf=function(f,r,n,t,i,h,s,o){if(s!=null||o!=null)if(e.s.ti(r))e.Yg.rf(f,n,t,i,h,s,o);else if(h=e.F.ba(h),e.s.Y(e.s.P(t),1.570796326794897)||e.s.Cd(h)||e.s.Y(e.s.P(h),3.141592653589793))e.Wk.rf(f,r,n,t,i,h,s,o);else{var a=e.s.P(h)==1.570796326794897?0:Math.cos(h),u=e.s.P(h)==3.141592653589793?0:Math.sin(h);e.s.Y(e.s.P(t),1.570796326794897)&&(n=0),h=1-Math.sqrt(1-r);var c=e.F.Vq(r,t);t=e.s.P(c)==1.570796326794897?0:Math.cos(c);var l=Math.sin(c);c=Math.atan2(Math.tan(c),a);var p=t*u,y=p*p,d=1-y,g=r/(1-r)*d,b=(r=g*(256+g*(g*(74-47*g)-128))/1024)/4,x=r/6,m=i/(f*(1-h)*(1+g*(4096+g*(g*(320-175*g)-768))/16384)),w=m;do{var j=w;i=e.s.P(w)==1.570796326794897?0:Math.cos(w);var M=(g=e.s.P(w)==3.141592653589793?0:Math.sin(w))*g;w=r*g*((f=Math.cos(2*c+w))+b*(i*(2*(w=f*f)-1)-x*f*(4*M-3)*(4*w-3)))+m}while(!e.s.Y(j,w));i=e.s.P(w)==1.570796326794897?0:Math.cos(w),g=e.s.P(w)==3.141592653589793?0:Math.sin(w),s!=null&&(u=Math.atan2(g*u,t*i-l*g*a),d=h/16*d*(4+h*(4-3*d)),f=Math.cos(2*c+w),s.u=e.F.ba(n+(u-(1-d)*h*p*(w+d*g*(f+d*i*(2*f*f-1)))))),o!=null&&(d=l*g-t*i*a,d=(1-h)*Math.sqrt(y+d*d),o.u=Math.atan2(l*i+t*g*a,d))}},v}()}(k||(k={})),function(e){e.PC=function(){function v(){}return v.tb=function(f,r,n,t,i,h,s,o,a){var u=e.F.ba(i-n),c=e.s.Y(e.s.P(t),1.570796326794897),l=e.s.Y(e.s.P(h),1.570796326794897);if(e.s.Y(t,h)&&(e.s.Cd(u)||c))s!=null&&(s.u=0),o!=null&&(o.u=0),a!=null&&(a.u=0);else{if(e.s.ti(r)){var p=Math.sin(t),y=Math.sin(h);p=Math.sqrt((1+p)/(1-p)),y=Math.sqrt((1+y)/(1-y)),p=Math.log(y)-Math.log(p),p=Math.atan2(u,p),s!=null&&(s.u=e.s.Y(t,h)?e.s.P(f*Math.cos(t)*u):e.s.P((f*h-f*t)/Math.cos(p)))}else y=e.F.Qw(r,h),p=Math.sin(e.F.Qw(r,t)),y=Math.sin(y),p=Math.sqrt((1+p)/(1-p)),y=Math.sqrt((1+y)/(1-y)),p=Math.log(y)-Math.log(p),p=Math.atan2(u,p),s!=null&&(e.s.Y(t,h)?s.u=e.s.P(f*u*Math.cos(t)/e.F.w(r,t)):(u=e.F.q(f,r,t),f=e.F.q(f,r,h),s.u=e.s.P((f-u)/Math.cos(p))));o==null&&a==null||(s=e.F.ba(p+3.141592653589793),c&&l||!c&&!l||(c?p=0>t?i:e.F.ba(3.141592653589793-i):l&&(s=0>h?n:e.F.ba(3.141592653589793-n))),o!=null&&(o.u=p),a!=null&&(a.u=s))}},v.rf=function(f,r,n,t,i,h,s,o){h=e.F.ba(h),0>i&&(i=e.s.P(i),h=e.F.ba(h+3.141592653589793)),e.s.ti(r)?e.s.Y(e.s.P(t),1.570796326794897)?(n=0>t?h:e.F.ba(3.141592653589793-h),3.141592653589793>=(h=i/f%6.283185307179586)?f=t-e.s.Mb(h,t):(n=e.F.ba(n+3.141592653589793),f=-t+e.s.Mb(h-3.141592653589793,t))):e.s.Y(e.s.P(h),1.570796326794897)?(n=e.F.ba(n+e.s.Mb(i,h)/(f*Math.cos(t))),f=t):(f=t+i*Math.cos(h)/f,1.570796326794897t?h:e.F.ba(3.141592653589793-h),h=i/e.F.qW(f,r),3.141592653589793>=(h%=6.283185307179586)?f=t-e.s.Mb(h,t):(n=e.F.ba(n+3.141592653589793),f=-t+e.s.Mb(h-3.141592653589793,t)),f=e.F.Rq(r,f)):e.s.Y(e.s.P(h),1.570796326794897)?(n=e.F.ba(n+e.s.Mb(i,h)*e.F.w(r,t)/(f*Math.cos(t))),f=t):(f=1.570796326794897*(i*Math.cos(h)+e.F.q(f,r,t))/e.F.Ah(f,r),1.570796326794897Math.PI||Math.abs(t.y)>.5*Math.PI||Math.abs(i.y)>.5*Math.PI||(Math.abs(t.y)==.5*Math.PI||Math.abs(i.y)==.5*Math.PI)&&t.x!=i.x)return NaN;if(h=r.cB(h,Math.min(t.x,i.x),Math.max(t.x,i.x)),!new e.Nc(t.x,i.x).contains(h))return NaN;var s=v.construct(t);if(i=v.construct(i),s=r.Yu(n,s),i=r.Yu(n,i),(i=s.cF(i)).z.qg())return t.y;var o=new e.Wb;o.set(i.x),o.jm(i.z),o.No(-1);var a=new e.Wb;a.set(i.y),a.jm(i.z),a.No(-1);var u=new e.Wb;return u.set(a),u.Ag(a),(s=new e.Wb).set(o),s.Ag(o),s.add(u),s.sqrt(),s.qg()||o.qg()&&a.qg()?t.y:(t=Math.atan2(a.value(),o.value()),t=Math.atan2(s.value()*Math.cos(t-h),1-n),h=r.DP(n,e.h.construct(h,t)),n=new e.Nd(h.x,h.y,-h.z),h=i.value().Qh(h),n=i.value().Qh(n),Math.abs(n)Math.PI||Math.abs(t.y)>.5*Math.PI||Math.abs(i.y)>.5*Math.PI||(Math.abs(t.y)==.5*Math.PI||Math.abs(i.y)==.5*Math.PI)&&t.x!=i.x||Math.abs(h)>=.5*Math.PI||0h&&i.y>h||0>t.y&&0>i.y&&t.yMath.abs(s[1]-t.x)&&(t=s[0],s[0]=s[1],s[1]=t)),h))},r.cB=function(n,t,i){return n>i?n-=2*(t=Math.ceil((n-i)/(2*Math.PI)))*Math.PI:ni.x?(i.x-=i.x%360,-180>i.x&&(i.x+=360)):180i.y&&(i.y=-90);for(var h=-180,s=180,o=(f=5*n)-1,a=(r=(f+31)/32)-1;0<=a;a--)for(var u=o-32*a,c=Math.min(32,f-32*a),l=1;l=p?(t[a]|=1<=p?(t[a]|=1<>h&31;if(31<(h+=5)){var a=37-h;o&=(1<r)for(s=0;s=r[0]?r:'"'+r.trim()+'"'}var f=[];e.XC=function(){function r(){}return r.EQ=function(n){try{for(var t=0;tn||n>this.Aa)throw e.i.N();return this.bg[n]},r.prototype.Pf=function(n){return this.uh[n]},r.lz=function(n){return r.JM[n]},r.Tp=function(n){return r.SM[n]},r.Va=function(n){return r.rM[n]},r.prototype.hasAttribute=function(n){return 0<=this.uh[n]},r.prototype.iG=function(){return this.hasAttribute(1)},r.se=function(n){return r.eD[n]},r.prototype.LR=function(n){return this.Vs[n]},r.DG=function(n,t){return r.eD[n]===t},r.prototype.Nb=function(n){return this===n},r.prototype.An=function(){for(var n=e.O.Th(this.bg[0]),t=1;t++o&&f(s,u,h.eu),c[0]?a?u=o:(c=s.c,u=s.e+u+1):++u;c.lengths.Bd&&c[0]?"-":"")+(1u?"e":"e+")+u:s.toString()}function f(s,o,a,u){var c=s.c,l=s.e+o+1;if(a===1?u=5<=c[l]:a===2?u=5l||c[l+1]!==void 0||1&c[l-1]):a===3?u=u||c[l]!==void 0||0>l:(u=!1,a!==0&&r("!Big.RM!")),1>l||!c[0])u?(s.e=-o,s.c=[1]):s.c=[s.e=0];else{if(c.length=l--,u)for(;9<++c[l];)c[l]=0,l--||(++s.e,c.unshift(1));for(l=c.length;!c[--l];c.pop());}return s}function r(s){throw(s=Error(s)).name="BigError",s}var n=-7,t=21,i=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,h=function(){function s(o){if(o instanceof s)this.Bd=o.Bd,this.e=o.e,this.c=o.c.slice();else{var a,u,c;for(o===0&&0>1/o?o="-0":i.test(o+="")||r(NaN),this.Bd=o.charAt(0)=="-"?(o=o.slice(1),-1):1,-1<(a=o.indexOf("."))&&(o=o.replace(".","")),0<(u=o.search(/e/i))?(0>a&&(a=u),a+=+o.slice(u+1),o=o.substring(0,u)):0>a&&(a=o.length),u=0;o.charAt(u)=="0";u++);if(u==(c=o.length))this.c=[this.e=0];else{for(;o.charAt(--c)=="0";);for(this.e=a-u-1,this.c=[],a=0;u<=c;this.c[a++]=+o.charAt(u++));}}}return s.prototype.abs=function(){var o=new s(this);return o.Bd=1,o},s.prototype.cmp=function(o){var a=this.c,u=(o=new s(o)).c,c=this.Bd,l=o.Bd,p=this.e,y=o.e;if(!a[0]||!u[0])return a[0]?c:u[0]?-l:0;if(c!=l)return c;if(o=0>c,p!=y)return p>(y^o)?1:-1;for(c=-1,l=(p=a.length)<(y=u.length)?p:y;++c(u[c]^o)?1:-1;return p==y?0:p>(y^o)?1:-1},s.prototype.jm=function(o){var a=this.c,u=(o=new s(o)).c,c=this.Bd==o.Bd?1:-1,l=s.rr;if((l!==~~l||0>l||1e6A?0:A,d.unshift(0);m++y;y++){if(p!=(m=x.length))var z=p>m?1:-1;else{var N=-1;for(z=0;++Nx[N]?1:-1;break}}if(!(0>z))break;for(o=m==p?u:d;m;){if(x[--m]A&&f(w,l,s.eu,x[0]!==void 0),w},s.prototype.fS=function(){return 0this.cmp(0)},s.prototype.jt=function(o){var a,u=this.Bd,c=(o=new s(o)).Bd;if(u!=c)return o.Bd=-c,this.tI(o);var l=this.c.slice(),p=this.e,y=o.c,d=o.e;if(!l[0]||!y[0])return y[0]?(o.Bd=-c,o):new s(l[0]?this:0);if(u=p-d){for((a=0>u)?(u=-u,p=l):(d=p,p=y),p.reverse(),c=u;c--;p.push(0));p.reverse()}else for(p=((a=l.lengthu;){if(l[--p]c.length-p.length&&(u=p,p=c,c=u),a=p.length,u=0;a;)u=(c[--a]=c[a]+p[a]+u)/10|0,c[a]%=10;for(u&&(c.unshift(u),++l),a=c.length;c[--a]==0;c.pop());return o.c=c,o.e=l,o},s.prototype.pow=function(o){var a=this,u=new s(1),c=u,l=0>o;for((o!==~~o||-1e6>o||1e6>=1;)a=a.lr(a);return l?u.jm(c):c},s.prototype.round=function(o,a){var u=this;return o==null?o=0:(o!==~~o||0>o||1e6a&&r(NaN),(a=Math.sqrt(this.toString()))==0||a==1/0?((a=o.join("")).length+u&1||(a+="0"),(o=new s(Math.sqrt(a).toString())).e=((u+1)/2|0)-(0>u||1&u)):o=new s(a.toString()),a=o.e+(s.rr+=4);do u=o,o=c.lr(u.tI(this.jm(u)));while(u.c.slice(0,a).join("")!==o.c.slice(0,a).join(""));return f(o,s.rr-=4,s.eu),o},s.prototype.lr=function(o){var a=this.c,u=(o=new s(o)).c,c=a.length,l=u.length,p=this.e,y=o.e;if(o.Bd=this.Bd==o.Bd?1:-1,!a[0]||!u[0])return new s(0*o.Bd);if(o.e=p+y,cp;)l=d[y]+u[p]*a[y-p-1]+l,d[y--]=l%10,l=l/10|0;d[y]=(d[y]+l)%10}for(l&&++o.e,d[0]||d.shift(),p=d.length;!d[--p];d.pop());return o.c=d,o},s.prototype.toString=function(){var o=this.e,a=this.c.join(""),u=a.length;if(o<=n||o>=t)a=a.charAt(0)+(1o?"e":"e+")+o;else if(0>o){for(;++o;a="0"+a);a="0."+a}else if(0u)for(o-=u;o--;a+="0");else othis.Bd&&this.c[0]?"-"+a:a},s.prototype.toExponential=function(o){return o==null?o=this.c.length-1:(o!==~~o||0>o||1e6=o&&(c=v(this,this.e+o),0>this.Bd&&this.c[0]&&0>c.indexOf("-")&&(c="-"+c));return n=a,t=u,c||r("!toFix!"),c},s.prototype.toPrecision=function(o){return o==null?this.toString():((o!==~~o||1>o||1e6h.get(p)?(h.set(a,2147483647),a=p):h.set(p,2147483647),u++;else{if(!(1&u))h.set(a,2147483647);else if(n)return t!=null&&(t[0]=!0),null;o.L(l),a=p,u=1}if(!(1&u))h.set(a,2147483647);else if(n)return t!=null&&(t[0]=!0),null;if(!n)for(h.Vd(0,h.size,function(d,g){return d-g}),p=0,y=h.size;pt-n)i.nr(n,t,r);else{var h=!0;try{for(var s=1/0,o=-1/0,a=n;ao&&(o=u)}if(this.reset(t-n,s,o,t-n)){for(a=n;ah&&i.nr(n+h,n+t,r);100r||t==n)&&(r=Math.min(f.hL,r),this.yf.Jb(r),this.yf.resize(r),this.yf.Wj(0,0,this.yf.size),this.EH=n,this.ys.resize(i),this.Es=(t-n)/(r-1),!0)},f.prototype.zF=function(r){return e.O.truncate((r-this.EH)/this.Es)},f.hL=65536,f}();e.Xt=v}(k||(k={})),function(e){var v,f;(f=v||(v={}))[f.enum_line=1]="enum_line",f[f.enum_arc=2]="enum_arc",f[f.enum_dummy=4]="enum_dummy",f[f.enum_concave_dip=8]="enum_concave_dip",f[f.enum_connection=3]="enum_connection";var r=function(){function s(){}return s.Qu=function(o,a,u,c,l,p){var y=new s;return y.Im=new e.h,y.Vm=new e.h,y.aw=new e.h,y.Im.L(o),y.Vm.L(a),y.aw.L(u),y.Co=c,y.qh=l,y.sh=p,y},s.construct=function(o,a,u,c){var l=new s;return l.Im=new e.h,l.Vm=new e.h,l.aw=new e.h,l.Im.L(o),l.Vm.L(a),l.aw.Rc(),l.Co=4,l.qh=u,l.sh=c,l},s}(),n=function(){function s(o,a,u,c,l,p){this.Yv=null,this.ya=0,this.EA=o,this.bI=this.$H=0,this.Ka=a,this.Mj=u,this.vk=c,this.Dq=l,this.Ub=p}return s.prototype.next=function(){for(var o=new e.Sa;;){if(this.ya==this.EA.I())return null;if(this.EA.ve(this.ya,o),this.ya++,!o.B())break}var a=!1;if(this.Yv==null&&(this.$H=o.Lg(),this.bI=o.ih(),this.Yv=h.buffer(o,this.Ka,this.Mj,this.vk,this.Dq,this.Ub),a=!0),this.yac)throw e.i.N();if(o.B())return new e.Da(o.description);var y=new e.l;return o.xc(y),0=l&&(l=96),p.rb=Math.abs(p.Ka),p.Kv=p.rb!=0?1/p.rb:0,isNaN(c)||c==0?c=1e-5*p.rb:c>.5*p.rb&&(c=.5*p.rb),12>l&&(l=12),(o=Math.abs(a)*(1-Math.cos(Math.PI/l)))>c?c=o:(o=Math.PI/Math.acos(1-c/Math.abs(a)))(l=e.O.truncate(o))&&(l=12,c=Math.abs(a)*(1-Math.cos(Math.PI/l))),p.vk=c,p.Dq=l,p.tA=Math.min(p.ct,.25*c),p.lE()},s.prototype.cv=function(){if(this.Id==null)this.Id=[];else if(this.Id.length!==0)return;var o=this.qE();o=e.O.truncate((o+3)/4);var a=.5*Math.PI/o;this.oA=a;for(var u=0;u<4*o;u++)this.Id.push(null);var c=Math.cos(a);a=Math.sin(a);var l=e.h.construct(0,1);for(u=0;u=this.Ka&&(o=new e.l,this.X.A(o),o.R()<=2*-this.Ka||o.ca()<=2*this.Ka))return new e.Da(this.X.description)}switch(this.X.getType()){case 33:return this.PN();case 550:return this.ON();case 1607:return this.RN();case 1736:return this.QN();case 197:return this.LN();default:throw e.i.Qa()}},s.prototype.RN=function(){if(this.EG(this.X)){var o=new e.Sa;this.X.ve(0,o);var a=new e.l;return this.X.A(a),o.Cb(a.sf()),this.Gu(o)}return this.X=this.WV(this.X),o=new t(this,this.oq),e.Gh.local().V(o,this.Mj,this.Ub).next()},s.prototype.QN=function(){if(this.Ka==0)return this.X;var o=e.Yl.local();if(this.cv(),this.X=o.V(this.X,null,!1,this.Ub),0>this.Ka){var a=this.X;return a=this.py(a,0,a.da()),o.V(a,this.Mj,!1,this.Ub)}return this.EG(this.X)?(o=new e.Sa,this.X.ve(0,o),a=new e.l,this.X.A(a),o.Cb(a.sf()),this.Gu(o)):(o=new i(this),e.Gh.local().V(o,this.Mj,this.Ub).next())},s.prototype.py=function(o,a,u){for(var c=new e.Da(o.description);ao.Ja(a))){var l=o.Ir(a),p=new e.l;if(o.Rj(a,p),0=this.Ka){if(this.Ka==0)o.ad(this.X,!1);else{var a=new e.Fh;this.X.bn(a),a.W(this.Ka,this.Ka),o.ad(a,!1)}return o}return o.ad(this.X,!1),this.X=o,this.jE(o,0)},s.prototype.jE=function(o,a){this.cv();var u=new e.Da(o.description),c=new e.h,l=new e.h,p=new e.h,y=new e.h,d=new e.h,g=new e.h,b=new e.h,x=new e.h,m=o.Ja(a),w=o.Ba(a),j=0;for(a=o.Ja(a);jo.Ja(a))return null;if(this.FG(o,a)&&0(o=-1>o?4:2*Math.PI/Math.acos(o)+.5)?o=4:o>this.Dq&&(o=this.Dq),e.O.truncate(o)},s.prototype.GD=function(o,a,u,c,l){this.cv();var p=new e.h;p.uc(u,a),p.scale(this.Kv);var y=new e.h;y.uc(c,a),y.scale(this.Kv),0>(p=Math.atan2(p.y,p.x)/this.oA)&&(p=this.Id.length+p),p=this.Id.length-p,0>(y=Math.atan2(y.y,y.x)/this.oA)&&(y=this.Id.length+y),(y=this.Id.length-y)p.I(y))return 0>l||(l=o,p=new e.Sa,l.ve(l.Ba(a),p),this.yu(u,p)),1;var d=p.Na(p.Xa(p.Ob(y))),g=new e.Dd;if(g.gg(-d.x,-d.y),p.Oc(g),c&&(this.tQ(p,y,l),2>p.I(y)))return 0>l||(l=o,p=new e.Sa,l.ve(l.Ba(a),p),this.yu(u,p)),1;this.Zd.length=0;var b=p.Ob(y);a=p.Xa(b);var x=l==1?p.Ma(a):p.U(a);o=l==1?p.U(a):p.Ma(a);var m=!0;c=new e.h,y=new e.h;var w=new e.h,j=new e.h,M=new e.h,A=new e.h,z=new e.h,N=new e.h,I=new e.h,C=new e.h,T=this.rb;b=p.Ja(b);for(var D=0;Dx||0>m&&x==0?this.Zd.push(r.Qu(j,M,c,2,this.Zd.length+1,this.Zd.length-1)):j.qb(M)||(this.Zd.push(r.construct(j,c,this.Zd.length+1,this.Zd.length-1,"dummy")),this.Zd.push(r.construct(c,M,this.Zd.length+1,this.Zd.length-1,"dummy"))),A.add(y,I),this.Zd.push(r.Qu(M,A,c,1,this.Zd.length+1,this.Zd.length-1)),j.L(A),C.L(I),w.L(c),c.L(y),N.L(z),x=a,a=o,m=!1,o=l==1?p.U(a):p.Ma(a);return this.Zd[this.Zd.length-1].qh=0,this.Zd[0].sh=this.Zd.length-1,this.YV(u),g.gg(d.x,d.y),u.YD(g,u.da()-1),1},s.prototype.YV=function(o){for(var a=this.zO(),u=!0,c=a+1,l=a;c!=a;l=c){var p=this.Zd[l];c=p.qh!=-1?p.qh:(l+1)%this.Zd.length,p.Co!=0&&(u&&o.Lt(p.Im),p.Co==2?this.GD(o,p.aw,p.Im,p.Vm,!0):o.Ci(p.Vm),u=!1)}},s.prototype.zO=function(){this.Ks==null&&(this.Ks=[null,null,null,null,null,null,null,null,null]);for(var o=0,a=0,u=this.Zd.length;a=this.rb)return!0}return!1},s.prototype.tQ=function(o,a,u){for(var c=0;1>c;c++){var l=!1,p=o.Ob(a),y=o.Ja(p);if(y==0)break;var d=y;if(3>y)break;!o.dc(p)&&(d=y-1),p=o.Xa(p),y=0G||0>H&&G==0||!this.Fv(j,m,w)||(z.L(w),U=!1,++B,l=!0),U){if(0.5*this.vk?(A.add(j,m),A.scale(.5),C.normalize(),C.ar(),T.L(C),T.scale(D-B),A.add(T),o.mf(y,A)):o.pd(y,!0),B=0}j.L(m),b=p}m.L(w),y=p,p=g,g=0a?(this.oq=!1,o):(this.oq=!0,e.Fg.Mk(o,this.ct,!1,!0,this.Ub))},s.prototype.yu=function(o,a){if(a=a.D(),this.Id!=null&&this.Id.length!==0){var u=new e.h;u.L(this.Id[0]),u.Ct(this.rb,a),o.Lt(u);for(var c=1,l=this.Id.length;c=t?1:-1;case 1:if(r.G=t?1:-1;case 2:if(r.v>=t&&r.C>t)break;return r.C<=t?1:-1;case 3:if(!(r.G>=t&&r.H>t))return r.H<=t?1:-1}return 0},f.prototype.Ay=function(r,n){return r.getType()==1736?this.Cy(r,n):this.Dy(r)},f.prototype.Cy=function(r,n){if(this.Ca.R()==0||this.Ca.ca()==0)return r.Ia();var t=new e.l;r.xc(t),this.X=this.g.Ib(r);var i=new e.l,h=new e.l,s=new e.h,o=new e.h,a=[0,0,0,0,0,0,0,0,0],u=[0,0,0,0,0,0,0,0,0];new e.ig;var c=new e.yb,l=new e.ia(0);l.Jb(Math.min(100,r.I()));for(var p=!1,y=0;!p&&4>y;y++){var d=!1,g=(1&y)!=0,b=0;switch(y){case 0:b=this.Ca.v,d=t.v<=b&&t.C>=b;break;case 1:b=this.Ca.G,d=t.G<=b&&t.H>=b;break;case 2:b=this.Ca.C,d=t.v<=b&&t.C>=b;break;case 3:b=this.Ca.H,d=t.G<=b&&t.H>=b}if(d)for(p=!0,d=this.g.Ob(this.X);d!=-1;){var x=-1,m=-1,w=this.g.Xa(d),j=w;do{var M=this.g.bc(j);M==null&&(M=c,this.g.D(j,s),M.Dc(s),this.g.D(this.g.U(j),o),M.Qc(o)),M.A(i);var A=this.Lh(i,y,b),z=0,N=-1;if(A==-1){z=0<(M=M.cq(g,b,a,u))?this.g.Ul(j,u,M):0,z+=1;var I=j,C=this.g.U(I);for(M=0;Mthis.g.Ja(d)?this.g.Zq(d):this.g.Rb(d)}}return p?r.Ia():(this.FB(),0u;u++){var c=!1,l=(1&u)!=0,p=0;switch(u){case 0:p=this.Ca.v,c=a.v<=p&&a.C>=p;break;case 1:p=this.Ca.G,c=a.G<=p&&a.H>=p;break;case 2:p=this.Ca.C,c=a.v<=p&&a.C>=p;break;case 3:p=this.Ca.H,c=a.G<=p&&a.H>=p}if(c){c=o,o=r.Ia(),(c=c.Ga()).Zi();for(var y,d=new e.h;c.$a();)for(var g,b=!0;c.Ha();){var x=c.ha();x.A(n);var m=this.Lh(n,u,p);if(m==-1){if(0<(m=x.cq(l,p,i,h))){var w=0;y=x.ac();for(var j=0;j<=m;j++)if(w!=(g=j=(u=e.O.truncate(Math.min(Math.ceil(u/r),2048)))))){for(var c=1;ch.size)){var l=this;h.Vd(0,h.size,function(A,z){return l.Mh(A,z)}),t=new e.h,s=new e.h,o=new e.h,s.Rc();var p=-1;a=new e.ia(0),u=new e.ia(0),c=this.g.Gd();for(var y=this.g.Gd(),d=0,g=h.size;dthis.Mh(p,m)&&(this.g.D(m,t),r?t.y==n:t.x==n)&&(a.add(p),w=!0,this.g.Ra(p,y,1)),0>this.Mh(p,b)&&(this.g.D(b,t),r?t.y==n:t.x==n)&&(w||a.add(p),this.g.Ra(p,c,1))}for(x=0,w=a.size;xthis.Mh(g,x)&&(this.g.D(x,a),r?a.y==n:a.x==n)&&(b=x),x=-1;var m=this.g.Ma(g);if(0>this.Mh(g,m)&&(this.g.D(m,a),r?a.y==n:a.x==n)&&(x=m),b!=-1&&x!=-1)this.Kh(g,i,h),this.g.pd(g,!1),this.Kh(b,i,h),this.g.pd(b,!1),l=!0;else if(b!=-1||x!=-1){for(m=d+1;mthis.Mh(w,j)&&(this.g.D(j,a),r?a.y==n:a.x==n)&&(M=j),j=this.g.Ma(w);var A=-1;if(0>this.Mh(w,j)&&(this.g.D(j,a),r?a.y==n:a.x==n)&&(A=j),M!=-1&&A!=-1){this.Kh(w,i,h),this.g.pd(w,!1),this.Kh(M,i,h),this.g.pd(M,!1),l=!0;break}if(b!=-1&&A!=-1){this.zt(i,g,b,w,A,h),l=!0;break}if(x!=-1&&M!=-1){this.zt(i,w,M,g,x,h),l=!0;break}}}if(l)break}}}if(!l)break}p=s,u.L(t)}}this.g.Td(h)},f.prototype.Kh=function(r,n,t){t=this.g.Pa(r,t),n.set(t,-1),t=this.g.Pa(r,this.ji),this.dd.set(t,-1),(n=this.g.bd(r))!=-1&&this.g.Xa(n)==r&&(this.g.Jf(n,-1),this.g.Wg(n,-1))},f.prototype.zt=function(r,n,t,i,h,s){this.g.Bc(n,i),this.g.Cc(i,n),this.g.Cc(t,h),this.g.Bc(h,t),this.Kh(i,r,s),this.g.mi(i,!1),this.Kh(h,r,s),this.g.mi(h,!0)},f.prototype.Ty=function(){for(var r=0,n=this.dd.size;r=a?(t=this.g.Pa(o,this.ji),this.dd.set(t,-1),o=this.g.pd(o,!1),a==2&&(t=this.g.Pa(o,this.ji),this.dd.set(t,-1),this.g.pd(o,!1)),a=s,s=this.g.Rb(s),this.g.Jf(a,-1),this.g.$q(a)):(this.g.cp(s,!1),this.g.Wg(s,this.g.Ma(o)),this.g.Vj(s,a),h+=a,i++,s=this.g.Rb(s))}}for(r=0,n=this.dd.size;r=a?(t=this.g.Pa(o,this.ji),this.dd.set(t,-1),o=this.g.pd(o,!1),a==2&&(0<=(t=this.g.Pa(o,this.ji))&&this.dd.set(t,-1),this.g.pd(o,!1)),a=s,this.g.Jf(a,-1),this.g.$q(a)):(this.g.kn(s,!0),this.g.Vj(s,a),this.g.Jf(s,o),this.g.Wg(s,this.g.Ma(o)),this.g.cp(s,!1),h+=a,i++)}for(this.g.Rl(this.X,i),this.g.Tj(this.X,h),r=0,n=this.g.ld;n!=-1;n=this.g.ue(n))r+=this.g.I(n);this.g.bC(r)},f.By=function(r,n,t){return new f(n).Ay(r,t)},f.clip=function(r,n,t,i){if(r.B())return r;if(n.B())return r.Ia();if((t=r.getType())==33)return i=r.D(),n.contains(i)?r:r.Ia();if(t==197)return i=new e.l,r.A(i),i.Ea(n)?(n=new e.Fh,r.copyTo(n),n.Xo(i),n):r.Ia();var h=new e.l;if(r.xc(h),n.contains(h))return r;if(!n.isIntersecting(h))return r.Ia();if((h=r.Bb)!=null&&(h=h.Fk)!=null){if((h=h.Ro(n))==1){if(t!=1736)throw e.i.Qa();return(r=new e.Da(r.description)).tp(n),r}if(h==0)return r.Ia()}switch(t){case 550:t=null,h=r.I();for(var s=r.ub(0),o=0,a=0;a=t?1:-1;case 1:if(r.G=t?1:-1;case 2:if(r.v>=t&&r.C>t)break;return r.C<=t?1:-1;case 3:if(!(r.G>=t&&r.H>t))return r.H<=t?1:-1}return 0},f.prototype.Ay=function(r,n){return r.getType()==1736?this.Cy(r,n):this.Dy(r)},f.prototype.Cy=function(r,n){if(this.Ca.R()==0||this.Ca.ca()==0)return r.Ia();var t=new e.l;r.xc(t),this.X=this.g.Ib(r);var i=new e.l,h=new e.l,s=new e.h,o=new e.h,a=[0,0,0,0,0,0,0,0,0],u=[0,0,0,0,0,0,0,0,0],c=new e.yb,l=new e.ia(0);l.Jb(256);for(var p=!1,y=0;!p&&4>y;y++){var d=!1,g=(1&y)!=0,b=0;switch(y){case 0:b=this.Ca.v,d=t.v<=b&&t.C>=b;break;case 1:b=this.Ca.G,d=t.G<=b&&t.H>=b;break;case 2:b=this.Ca.C,d=t.v<=b&&t.C>=b;break;case 3:b=this.Ca.H,d=t.G<=b&&t.H>=b}if(d)for(p=!0,d=this.g.Ob(this.X);d!=-1;){var x=!0,m=-1,w=-1,j=this.g.Xa(d),M=j;do{var A=this.g.bc(M);A==null&&(A=c,this.g.D(M,s),A.Dc(s),this.g.D(this.g.U(M),o),A.Qc(o)),A.A(i);var z=this.Lh(i,y,b),N=0,I=-1;if(z==-1){N=0<(A=A.cq(g,b,a,u))?this.g.LX(M,u,A):0,N+=1;var C=M,T=this.g.U(C);for(A=0;Ay;y++){var d=!1,g=(1&y)!=0,b=0;switch(y){case 0:b=this.Ca.v,d=a.v<=b&&a.C>=b;break;case 1:b=this.Ca.G,d=a.G<=b&&a.H>=b;break;case 2:b=this.Ca.C,d=a.v<=b&&a.C>=b;break;case 3:b=this.Ca.H,d=a.G<=b&&a.H>=b}if(d)for(d=o,o=r.Ia(),(d=d.Ga()).Zi();d.$a();)for(var x,m=!0;d.Ha();){var w=d.ha();w.A(n);var j=this.Lh(n,y,b);if(j==-1){if(0<(j=w.cq(g,b,i,h))){var M=0;w.Yp(u);for(var A=0;A<=j;A++)if(M!=(x=Ai.x&&(i.x+=r)}else p=n.y-this.Ca.G,h.y=e.lc.sign(t.y-n.y),i.y=r*e.lc.Cn(Math.floor(Math.abs(p/r)),p)+this.Ca.G,0>i.y&&(i.y+=r);p=l!=0?t.y-n.y:t.x-n.x;var y=Math.abs(p);if(65536=g||(s[y]=g,y++)}y!=0&&this.g.Ul(u,s,y)}}u=c}while(u!=a)}},f.prototype.Vl=function(r,n){for(var t=-1,i=new e.h,h=null,s=this.g.Ob(this.X);s!=-1;s=this.g.Rb(s))for(var o=this.g.Xa(s),a=0,u=this.g.Ja(s);ah.size)){var l=this;h.Vd(0,h.size,function(A,z){return l.Mh(A,z)}),t=new e.h,s=new e.h,o=new e.h,s.Rc();var p=-1;a=new e.ia(0),u=new e.ia(0),c=null;for(var y=this.g.Gd(),d=this.g.Gd(),g=0,b=h.size;gs.compare(t)&&(r?t.y==n:t.x==n)&&(a.add(p),j=!0,this.g.Ra(p,d,1)),this.g.D(x,t),0>s.compare(t)&&(r?t.y==n:t.x==n)&&(j||a.add(p),this.g.Ra(p,y,1))}for(m=0,j=a.size;mu.compare(a)&&(r?a.y==n:a.x==n)&&(b=x),x=-1;var m=this.g.Ma(g);if(this.g.D(m,a),0>u.compare(a)&&(r?a.y==n:a.x==n)&&(x=m),b!=-1&&x!=-1)this.Kh(g,i,h),this.g.pd(g,!1),this.Kh(b,i,h),this.g.pd(b,!1),l=!0;else if(b!=-1||x!=-1){for(m=d+1;mu.compare(a)&&(r?a.y==n:a.x==n)&&(M=j),j=this.g.Ma(w);var A=-1;if(this.g.D(j,a),0>u.compare(a)&&(r?a.y==n:a.x==n)&&(A=j),M!=-1&&A!=-1){this.Kh(w,i,h),this.g.pd(w,!1),this.Kh(M,i,h),this.g.pd(M,!1),l=!0;break}if(b!=-1&&A!=-1){this.zt(i,g,b,w,A,h),l=!0;break}if(x!=-1&&M!=-1){this.zt(i,w,M,g,x,h),l=!0;break}}}if(l)break}}}if(!l)break}p=s,u.L(t)}this.g.Td(h)}},f.prototype.Kh=function(r,n,t){t=this.g.Pa(r,t),n.set(t,-1),t=this.g.Pa(r,this.ji),this.dd.set(t,-1),(n=this.g.bd(r))!=-1&&this.g.Xa(n)==r&&(this.g.Jf(n,-1),this.g.Wg(n,-1))},f.prototype.zt=function(r,n,t,i,h,s){this.g.Bc(n,i),this.g.Cc(i,n),this.g.Cc(t,h),this.g.Bc(h,t),this.Kh(i,r,s),this.g.mi(i,!1),this.Kh(h,r,s),this.g.mi(h,!0)},f.prototype.Ty=function(){for(var r=0,n=this.dd.size;r=a?(t=this.g.Pa(o,this.ji),this.dd.set(t,-1),o=this.g.pd(o,!1),a==2&&(0<=(t=this.g.Pa(o,this.ji))&&this.dd.set(t,-1),this.g.pd(o,!1)),a=s,this.g.Jf(a,-1),this.g.$q(a)):(this.g.kn(s,!0),this.g.Vj(s,a),this.g.Jf(s,o),this.g.Wg(s,this.g.Ma(o)),this.g.cp(s,!1),h+=a,i++)}for(this.g.Rl(this.X,i),this.g.Tj(this.X,h),r=0,n=this.g.ld;n!=-1;n=this.g.ue(n))r+=this.g.I(n);this.g.bC(r)},f.By=function(r,n,t,i){return new f(n,i).Ay(r,t)},f.clip=function(r,n,t,i,h){return f.Nu(r,n,null,t,i,h)},f.Nu=function(r,n,t,i,h,s){var o=r.getType();if(o==33)return h=r.D(),n.contains(h)?r:r.Ia();if(o==197)return h=new e.l,r.A(h),h.Ea(n)?(n=new e.Fh,r.copyTo(n),n.Xo(h),n):r.Ia();if(r.B())return r;if(n.B())return r.Ia();var a=new e.l;if(r.xc(a),n.contains(a))return r;if(!n.isIntersecting(a))return r.Ia();if((t!=null||isNaN(i))&&e.ta.ty(t,n,!1),!e.aa.xj(o))throw e.i.N();if((t=r.Bb)!=null&&(t=t.Fk)!=null){if((t=t.Ro(n))==1){if(o!=1736)throw e.i.fa("internal error");return(r=new e.Da(r.description)).tp(n),r}if(t==0)return r.Ia()}switch(o){case 550:for(s=null,o=r.I(),t=r.ub(0),i=0,h=new e.h,a=0;a=a;a+=1)for(var u=0;1>=u;u+=1){var c=n.jG(s+a,o+u),l=this.xl.rR(c);l!=-1&&(this.pq[h]=l,this.xs[h]=c,h++)}for(s=h-1;1<=s;s--)for(l=this.pq[s],o=s-1;0<=o;o--)if(l==this.pq[o]){this.xs[o]=-1,s!=--h&&(this.xs[s]=this.xs[h],this.pq[s]=this.pq[h]);break}for(o=0;oo.Db())throw e.i.N();return a==0||o.B()?o:((p=new s(p)).ko=o,p.Ka=a,p.qa=l,p.Ki=u,p.CA=c,p.Rx())},s.prototype.eM=function(){var o=this.ko,a=o.ac(),u=o.wc(),c=new e.h;return c.uc(u,a),c.normalize(),c.Hv(),c.scale(this.Ka),a.add(c),u.add(c),c=o.Ia(),o.Dc(a),o.Qc(u),c},s.prototype.dM=function(){var o=this.ko;if(0p&&(0this.Ka?-f:f,-1g&&(.017453292519943295>(b=2*Math.acos(g))&&(b=.017453292519943295),1<(y=e.O.truncate(f/b+1.5))&&(d/=y)),b=w+n,w=t.Pd(p,this.Ka,b),o==0&&(w.type|=1024),this.fc(w,o),g=this.Ka/Math.cos(d/2),b+=d/2,(w=t.Pd(p,g,b)).type|=1024,this.fc(w);0<--y;)b+=d,(w=t.Pd(p,g,b)).type|=1024,this.fc(w);(w=t.Pd(p,this.Ka,j-n)).type|=1024,this.fc(w)}else if(this.Ki==1)w=t.Pd(p,this.Ka,w+n),this.fc(w,o),w=t.Pd(p,this.Ka,j-n),this.fc(w);else if(this.Ki==0)for(g=1-u/Math.abs(this.Ka),y=1,d=j-n-(w+n),-1g&&(.017453292519943295>(b=2*Math.acos(g))&&(b=.017453292519943295),1<(y=e.O.truncate(Math.abs(d)/b+1.5))&&(d/=y)),g=this.Ka/Math.cos(.5*d),b=w+n+.5*d,w=t.Pd(p,g,b),this.fc(w,o);0<--y;)b+=d,w=t.Pd(p,g,b),this.fc(w);else this.Ki==2?(g=y.x-p.x,b=y.y-p.y,.99999999<(y=(g*(x=d.x-p.x)+b*(m=d.y-p.y))/Math.sqrt(g*g+b*b)/Math.sqrt(x*x+m*m))?(w=t.Pd(p,1.4142135623730951*this.Ka,j-.25*f),this.fc(w,o),w=t.Pd(p,1.4142135623730951*this.Ka,j+.25*f),this.fc(w)):(y=Math.abs(this.Ka/Math.sin(.5*Math.acos(y))))>(d=Math.abs(this.CA*this.Ka))?(g=.5*(j-w),g=this.Ka/Math.abs(Math.sin(g)),w=t.Pd(p,g,.5*(w+j)),j=e.h.construct(w.x,w.y),w=e.h.construct(p.x,p.y),(p=new e.h).uc(j,w),(j=new e.h).HW(d/p.length(),p,w),w=(y-d)*Math.abs(this.Ka)/Math.sqrt(y*y-this.Ka*this.Ka),0w&&(j-=r),y=w-j(g=1.4142135623730951*this.Ka)?w+.25*f:w+.75*f,w=t.Pd(p,g,b),this.fc(w,o),b=0>g?j-.25*f:j-.75*f,w=t.Pd(p,g,b),this.fc(w)):(g=.5*(j-w),g=this.Ka/Math.abs(Math.sin(g)),ja))for(var u=0;u=c+1;a--)(u=t.al(o.Na(a))).type|=1024,this.wg.push(u);if(this.mE())if(2<=this.Yb.length){for(o=-1,(l=(1024&this.Yb[this.gf-1].type)!=0)||(o=0),a=1;a=Math.min(u.x,c.x)&&Math.max(u.x,c.x)>=Math.min(o.x,a.x)&&Math.max(o.y,a.y)>=Math.min(u.y,c.y)&&Math.max(u.y,c.y)>=Math.min(o.y,a.y)},s.prototype.xQ=function(o,a,u,c,l){l.bE=!1;var p=(a.y-o.y)*(c.x-u.x)-(a.x-o.x)*(c.y-u.y),y=(u.y-o.y)*(a.x-o.x)-(u.x-o.x)*(a.y-o.y);if(0<=(p=p==0?2:y/p)&&1>=p){var d=p;if(p=(c.y-u.y)*(a.x-o.x)-(c.x-u.x)*(a.y-o.y),y=(o.y-u.y)*(c.x-u.x)-(o.x-u.x)*(c.y-u.y),0<=(p=p==0?2:y/p)&&1>=p)return l.an=t.TO(o.x+p*(a.x-o.x),o.y+p*(a.y-o.y)),l.an.Uh=u.Uh+d*(c.Uh-u.Uh),d!=0&&d!=1||p!=0&&p!=1||(l.bE=!0),l.VY=p,l.WY=d,!((d==0||d==1)&&0p||(p==0||p==1)&&0d)}return!1},s.prototype.QO=function(o){for(;this.Yb[o].sho-(s*=2))return!0;h=new e.h;var a=new e.h,u=new e.h;i.tc(s,h),i.tc(s+2,a),i.tc(s+4,u);var c=t.Wu(a,u,h);if(c.ps()||!t.um(c.value()))return!1;var l=e.h.construct(a.x,a.y),p=new e.h;for(s+=6;so;o++){i.mB(o,s);var a=this.Cr(s);if(a!=-1){i.Hf(o,h);var u=this.g.fc(this.Ss,h);this.Fa.Sj(a,u)}}},t.prototype.oN=function(i){var h=new e.Sa,s=i.ac();if((s=this.Cr(s))!=-1){i.To(h);var o=this.g.fc(this.Ss,h);this.Fa.Sj(s,o)}s=i.wc(),(s=this.Cr(s))!=-1&&(i.Po(h),i=this.g.fc(this.Ss,h),this.Fa.Sj(s,i))},t.prototype.nN=function(i){var h=i.D();(h=this.Cr(h))!=-1&&(i=this.g.fc(this.Ss,i),this.Fa.Sj(h,i))},t.prototype.Cr=function(i){var h=-1;if(this.Fa.size(-1)==0)return this.Fa.addElement(-4,-1);if(this.Fa.size(-1)==1){var s=this.g.Na(this.Fa.ja(this.Fa.rc(-1)));return i.Rz(s)||(h=this.Fa.xn(-5)),h}return this.pC(i)},t.prototype.pC=function(i){var h=-1;do{var s=this.Fa.rc(-1),o=this.Fa.Fc(-1),a=this.Fa.ja(s),u=this.Fa.ja(o),c=new e.h,l=new e.h;if(this.Xh.D(a,c),this.Xh.D(u,l),a=e.h.Uq(l,i,c),t.um(a))h=this.Fa.xn(-1),(c=this.nC(i,o,s))!=s&&this.oC(i,s,this.Fa.we(c));else if(t.CG(a)){l=this.Fa.sv(-1);var p=this.Fa.rc(-1),y=this.Fa.Fc(-1);for(a=new e.h,u=new e.h;p!=this.Fa.we(y);){var d=this.Fa.ja(l);this.Xh.D(d,a),d=e.h.Uq(a,i,c),t.CG(d)?(y=l,l=this.Fa.ll(l)):(p=l,l=this.Fa.Xp(l))}if(l=y,c=p,d=this.Fa.ja(l),p=this.Fa.ja(c),this.Xh.D(d,a),this.Xh.D(p,u),c!=s&&(a=e.h.Uq(u,i,a),!t.um(a)))continue;h=this.Fa.zu(c,l,-2,!1),this.oC(i,l,o),this.nC(i,c,s)}else this.sb==null&&(this.sb=new e.yb),this.sb.Dc(l),this.sb.Qc(c),0>(c=this.sb.fe(i,!0))?(c=this.Fa.we(o),this.Fa.vd(o,-1),h=this.Fa.xn(-3),this.nC(i,c,s)):1i},t.CG=function(i){return 0h)throw e.i.fa("Internal Error: max number of iterations exceeded");var a=this.nM(n);if(i=i||a,this.tH&&(a=this.g.Gp(n,!0,!1)!=0,i=i||a),a=!1,(s==0||o||e.$t.kI(!0,this.g,r,null,this.nd))&&(a=this.sM(t),i=i||a),!a)break;e.mp.zp(this.nd)}return i},f}();e.Tk=v}(k||(k={})),function(e){var v=function(){function r(n){this.$d=this.Mc=null,this.Ys=0,this.Ub=n,this.cA=!0}return r.prototype.uv=function(n,t){var i=this.g.bc(n);if(i==null){if(!this.g.ed(n,t))return null;i=t}return i},r.prototype.Xq=function(){var n;n===void 0&&(n=!1),this.Ys++,(n||!(4095&this.Ys))&&(this.Ys=0,e.mp.zp(this.Ub))},r.prototype.nP=function(){var n=this.g.Yq(!1),t=!1,i=new e.yb,h=new e.yb,s=new e.l;s.Oa();var o=new e.l;o.Oa();for(var a=new e.Sa,u=new e.TC,c=n.next();c!=-1;c=n.next()){e.mp.zp(this.Ub);var l=null,p=!1;if(!e.aa.Rn(this.g.ic(n.ck))){if((l=this.uv(c,i))==null)continue;if(l.A(s),s.W(this.qa,this.qa),l.Bi(this.qa)){if(!l.Bi(0))continue;p=!0,l=null}}var y=this.g.Yq(n),d=y.next();for(d!=-1&&(d=y.next());d!=-1;d=y.next()){var g=null,b=!1;if(!e.aa.Rn(this.g.ic(y.ck))){if((g=this.uv(d,h))==null)continue;if(g.A(o),g.Bi(this.qa)){if(!g.Bi(0))continue;b=!0,g=null}}var x=0,m=0;if(l!=null&&g!=null)s.HG(o)&&(u.Oo(l),u.Oo(g),u.Ea(this.qa,!1),0<(x=u.ol(0))+(m=u.ol(1))&&(this.g.jr(c,u,0,!0),this.g.jr(d,u,1,!0)),u.clear());else if(l!=null){var w=new e.h;if(this.g.D(d,w),s.contains(w)){if(u.Oo(l),this.g.Vi(d,a),u.Kz(this.qa,a,!1),0<(x=u.ol(0)))if(this.g.jr(c,u,0,!0),b){for(b=-1,w=this.g.U(d);w!=-1&&w!=d&&(b=w,(g=this.uv(w,h))!=null&&g.Bi(0));w=this.g.U(w));for(w=d;w!=-1&&(this.g.Dh(w,u.Bf),w!=b);w=this.g.U(w));}else this.g.Dh(d,u.Bf);u.clear()}}else{if(g==null)continue;if(w=new e.h,this.g.D(c,w),o.W(this.qa,this.qa),o.contains(w)){if(u.Oo(g),this.g.Vi(c,a),u.Kz(this.qa,a,!1),0<(m=u.ol(0)))if(this.g.jr(d,u,0,!0),p){for(b=-1,w=this.g.U(c);w!=-1&&w!=c&&(b=w,(g=this.uv(w,h))!=null&&g.Bi(0));w=this.g.U(w));for(w=c;w!=-1&&(this.g.Dh(w,u.Bf),w!=b);w=this.g.U(w));}else this.g.Dh(c,u.Bf);u.clear()}}if(x+m!=0){if(x!=0){if((l=this.g.bc(c))==null){if(!this.g.ed(c,i))continue;l=i,i.A(s)}else l.A(s);if(l.Bi(this.qa))break}t=!0}}}return t},r.prototype.oP=function(){return this.QU()},r.prototype.QU=function(){return new e.RC().PX(this.g,this.qa)},r.prototype.lI=function(){var n=!1;this.Mc==null&&(this.Mc=new e.Yj);var t=new e.ia(0);t.Jb(this.g.fd+1);for(var i=this.g.Yq(),h=i.next();h!=-1;h=i.next())t.add(h);this.g.nx(t,t.size),t.add(-1),i=this.g.Gd(),h=this.g.Gd(),this.$d=new e.UC(this.g,this.qa,!this.cA),this.Mc.Vo(this.$d);var s=new e.ia(0),o=new e.ia(0),a=0;new e.h;var u=this.g.td;this.g.vb.mc();for(var c,l,p=this.g.vb.za[0].o,y=t.get(a++);y!=-1;){var d=c=p[2*(l=u.T(y,0))],g=l=p[2*l+1];do{var b=u.T(y,2),x=u.T(y,1);if(b!=-1){var m=u.T(b,0),w=p[2*m];0>(g<(m=p[2*m+1])?-1:g>m?1:dw?1:0)&&(o.add(y),o.add(b))}x!=-1&&(w=p[2*(m=u.T(x,0))],0>(g<(m=p[2*m+1])?-1:g>m?1:dw?1:0)&&(o.add(x),o.add(x))),(w=this.g.Pa(y,i))!=-1&&(s.add(w),this.g.Ra(y,i,-1)),(w=this.g.Pa(y,h))!=-1&&(s.add(w),this.g.Ra(y,h,-1)),(y=t.get(a++))!==-1&&(d=p[2*(g=u.T(y,0))],g=p[2*g+1])}while(y!=-1&&d===c&&g===l);for(d=s.size==1&&o.size==2,w=g=-1,b=0,x=s.size;bn.fd?n=t.nP():t.oP())},r.V=function(n,t,i){return r.fQ(n,n.IF(),t,i)},r.kI=function(n,t,i,h,s){if(!r.yE(t))return!1;var o=new r(s);if(o.g=t,o.qa=i,o.cA=n,o.lI())return h!=null&&h.Wt(o.Ni),!0;var a=new e.Dd;return a.$B(),t.Oc(a),(o=new r(s)).g=t,o.qa=i,o.cA=n,n=o.lI(),a.$B(),t.Oc(a),!!n&&(h!=null&&h.Wt(o.Ni),!0)},r.Ml=function(n,t){return!(16>(n=n.I()))&&2*n+Math.log(n)*Math.LOG10E/Math.log(2)*t<1*n*t},r.lP=function(n,t,i,h){var s=t.getType();if(e.aa.Hc(s))return new r(h).mP(n,t,i);throw e.i.fa("crack_A_with_B")},r.prototype.mP=function(n,t,i){var h=new e.l;n.xc(h);var s=new e.l;if(t.xc(s),s.W(i,i),!s.isIntersecting(h))return n;var o=n.Bb,a=null;o!=null&&(a=o.Fb),r.Ml(n,n.I())&&(a=e.ta.jj(n,s));var u=a!=null?a.getIterator():null,c=t.Ga();t=n.Ga();var l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(s=[];c.$a();)for(;c.Ha();){var p=c.ha();if(a!=null){for(u.Uo(p,i),o=u.next();o!=-1;o=u.next())if(this.Xq(),t.Vb(a.ja(o),-1),t.Ha()){var y=(o=t.ha()).Ea(p,null,l,null,i);for(o=0;ot.t?1:n.tt.index?1:-1},r}()}(k||(k={})),function(e){var v;(v=e.KK||(e.KK={}))[v.Left=0]="Left",v[v.Right=1]="Right",v[v.Coincident=2]="Coincident",v[v.Undefined=3]="Undefined",v[v.Uncut=4]="Uncut";var f=function(t,i,h,s,o,a,u,c,l,p,y){this.X=t,this.bt=i,this.Ns=h,this.tg=s,this.Lm=p,this.Al=y};e.uY=f;var r=function(){function t(i,h){this.JH=i,this.Hi=h}return t.prototype.qM=function(i,h){var s=new e.h;this.Hi.D(i,s);var o=new e.h;return this.Hi.D(h,o),(s=s.compare(o))!=0?s:(i=this.Hi.Pa(i,this.JH))<(h=this.Hi.Pa(h,this.JH))?-1:i==h?0:1},t}(),n=function(t,i,h,s,o,a,u,c,l){this.tg=t,this.Ns=i,this.OA=h,this.UH=s,this.Ei=o,this.Al=a,this.Lm=u,this.VH=c,this.OT=l};e.tY=n,e.LK=function(){function t(){}return t.JK=function(i,h,s,o,a,u){if(h.B())i=new f(h,4,-1,-1,NaN,4,-1,-1,NaN,-1,-1),a.push(i);else if(s.B())i=new f(h,4,-1,-1,NaN,4,-1,-1,NaN,-1,-1),a.push(i);else{var c=new e.gd;if(c.Ib(h),c.Ib(s),e.Tk.V(c,o,u,!0),c.fd==0)i=new f(h.Ia(),4,-1,-1,NaN,4,-1,-1,NaN,-1,-1),a.push(i);else{for(h=0,s=c.Gd(),o=c.ld;o!=-1;o=c.ue(o))for(u=c.Ob(o);u!=-1;u=c.Rb(u))for(var l=c.Xa(u),p=0,y=c.Ja(u);p(g=g.Ea(l,null,y,d,0))&&(o=new n(a,o,y[0],NaN,g,c,u,d[0],NaN),s.push(o),0>(o=h.Pa(a,i))&&h.Ra(a,i,s.length-1)),!0},t.wM=function(i,h,s,o,a,u,c){var l=new e.yb,p=new e.yb,y=[0,0],d=[0,0],g=h.bc(a);return g==null&&(h.ed(a,l),g=l),(l=h.bc(c))==null&&(h.ed(c,p),l=p),2>(g=g.Ea(l,null,y,d,0))&&(o=new n(a,o,y[0],NaN,g,c,u,d[0],NaN),s.push(o),0>(o=h.Pa(a,i))&&h.Ra(a,i,s.length-1),!0)},t.xM=function(i,h,s,o,a,u,c,l){var p=new e.yb,y=new e.yb,d=[0,0],g=[0,0],b=h.bc(a);return b==null&&(h.ed(a,p),b=p),(p=h.bc(c))==null&&(h.ed(c,y),p=y),(b=b.Ea(p,null,d,g,0))==2?(o=new n(a,o,d[0],d[1],b,c,u,g[0],g[1]),s.push(o),0>(o=h.Pa(a,i))&&h.Ra(a,i,s.length-1),!0):(y=!1,a==l&&(o=new n(a,o,d[0],NaN,b,c,u,g[0],NaN),s.push(o),0>(o=h.Pa(a,i))&&h.Ra(a,i,s.length-1),y=!0),y)},t.yM=function(i,h,s,o,a,u,c,l){var p=new e.yb,y=new e.yb,d=[0,0],g=[0,0],b=h.bc(a);return b==null&&(h.ed(a,p),b=p),(p=h.bc(c))==null&&(h.ed(c,y),p=y),(b=b.Ea(p,null,d,g,0))==2?(o=new n(a,o,d[0],d[1],b,c,u,g[0],g[1]),s.push(o),0>(o=h.Pa(a,i))&&h.Ra(a,i,s.length-1),!0):(y=!1,a==l&&(o=new n(a,o,d[0],NaN,b,c,u,g[0],NaN),s.push(o),0>(o=h.Pa(a,i))&&h.Ra(a,i,s.length-1),y=!0),y)},t.cM=function(i,h,s,o){var a=[];a[0]=new e.h,a[1]=new e.h,a[2]=new e.h,a[3]=new e.h;var u=new e.h,c=new e.h,l=new e.h,p=new e.h,y=null;o!=null&&(y=new e.ig).Or();var d=0,g=null,b=new e.yb;new e.yb;for(var x=s.Ob(s.ld);x!=-1;x=s.Rb(x)){for(var m=4,w=-1,j=-1,M=-1,A=-1,z=NaN,N=!0,I=!1,C=!0,T=!0,D=!0,B=0,E=x,G=0,H=s.Xa(x),U=s.Ja(x),$=0;$=h.length-2||h[d+2].Ns!=w)&&(m=0):m=1):((S!=R||L&&R==0)&&(o!=null?(O=new f(g,3,w,K,S,m,E,j,G,X,V),o.push(O)):null.add(B)),m=1):m!=0?((S!=R||L&&R==0)&&(o!=null?(O=new f(g,0,w,K,S,m,E,j,G,X,V),o.push(O)):null.add(B)),tt?(d>=h.length-2||h[d+2].Ns!=w)&&(m=1):m=0):((S!=R||L&&R==0)&&(o!=null?(O=new f(g,3,w,K,S,m,E,j,G,X,V),o.push(O)):null.add(B)),m=0),(S!=R||L&&R==0)&&(R=S,E=w,j=K,G=S,M=X,A=V,z=nt,N=C=!1,T=D=!0))}}d++}R!=1&&(D&&(o!=null?g=new e.Ta:B=0),o!=null?(W.ah(R,1,y),g.oc(y.get(),T)):B++,T=D=!1,C=!0)}C&&(S=1,K=s.rj(x),K=s.Ma(K),V=X=-1,nt=NaN,N?o!=null?(O=new f(g,4,w,K,S,m,E,j,G,X,V),o.push(O)):null.add(B):(N=m==1?0:m==0?1:3,o!=null?(O=new f(g,N,w,K,S,m,E,j,G,X,V),o.push(O)):null.add(B)))}},t.CM=function(i,h,s,o,a,u){var c=s[o].VH;if(c==1)return t.AM(i,h,s,o,a,u);if(c==0)return t.BM(i,h,s,o,a,u);throw e.i.Qa()},t.AM=function(i,h,s,o,a,u){var c=new e.yb,l=s[o].tg,p=s[o].Lm,y=s[o].Al,d=-1,g=-1,b=-1,x=-1;if(!i&&0.01*n&&(i*=1+(1+(r=r.xb/n))*r),this.pb=t,this.xb=i+2220446049250313e-31*Math.abs(t)},f.prototype.sqrt=function(){if(0<=this.pb){var r=Math.sqrt(this.pb),n=this.pb>10*this.xb?.5*this.xb/r:this.pb>this.xb?r-Math.sqrt(this.pb-this.xb):Math.max(r,Math.sqrt(this.pb+this.xb)-r);n+=2220446049250313e-31*Math.abs(r)}else this.pb<-1*this.xb?n=r=NaN:(r=0,n=Math.sqrt(this.xb));this.pb=r,this.xb=n},f.prototype.sin=function(r){var n=Math.sin(r.pb),t=Math.cos(r.pb);this.pb=n,n=Math.abs(n),this.xb=(Math.abs(t)+.5*n*r.xb)*r.xb+2220446049250313e-31*n},f.prototype.cos=function(r){var n=Math.sin(r.pb),t=Math.cos(r.pb);this.pb=t,t=Math.abs(t),this.xb=(Math.abs(n)+.5*t*r.xb)*r.xb+2220446049250313e-31*t},f.prototype.qg=function(){return Math.abs(this.pb)<=this.xb},f.prototype.ps=function(){return this.qg()&&this.xb!=0},f}();e.Wb=v}(k||(k={}));var Q=new k.h,ht=new k.h,et=new k.h,st=new k.h,ot=new k.h;(function(e){var v,f;(f=v||(v={}))[f.closedPath=1]="closedPath",f[f.exteriorPath=2]="exteriorPath",f[f.ringAreaValid=4]="ringAreaValid";var r=function(){function n(t,i,h,s,o,a,u){i!==void 0?(this.ib=t,this.ck=i,this.bl=h,this.ii=s,this.ya=a,this.hA=u,this.ew=o):(this.ib=t.ib,this.ck=t.ck,this.bl=t.bl,this.ii=t.ii,this.ya=t.ya,this.hA=t.hA,this.ew=t.ew),this.bH=!0}return n.prototype.next=function(){return this.bH?(this.bH=!1,this.ii):this.ii!=-1?(this.ii=this.ib.U(this.ii),this.ya++,this.ii!=-1&&this.ii!=this.ew?this.ii:this.$T()):-1},n.prototype.$T=function(){for(this.bl=this.ib.Rb(this.bl),this.ya=0;this.ck!=-1;){for(;this.bl!=-1;this.bl=this.ib.Rb(this.bl))if(this.ew=this.ii=this.ib.Xa(this.bl),this.ii!=-1)return this.ii;if(this.ck=this.ib.ue(this.ck),this.ck==-1)break;this.hA&&!e.aa.Hc(this.ib.ic(this.ck))||(this.bl=this.ib.Ob(this.ck))}return-1},n.AP=function(t,i,h,s,o,a,u){return new n(t,i,h,s,o,a,u)},n}();e.zY=r,v=function(){function n(){this.jo=this.Am=this.wk=this.cd=this.Ck=this.vo=this.Oi=this.md=this.bi=this.Sg=this.We=this.Il=null,this.qw=this.ld=-1,this.fd=0,this.fA=!1,this.ht=this.it=this.vb=null}return n.prototype.Sh=function(t){return this.We!=null?this.We[t]:null},n.prototype.Xg=function(t,i){if(this.We==null){if(i==null)return;this.We=[];for(var h=0,s=this.vb.I();h=this.Oi.size&&(t=16>i?16:e.O.truncate(3*i/2),this.Oi.resize(t),this.vo.resize(t)),this.Oi.set(i,0),this.vo.set(i,0),i},n.prototype.sF=function(t){this.md.jd(t)},n.prototype.Vy=function(t){this.td.jd(t),this.fd--},n.prototype.oI=function(t){this.md==null&&(this.md=new e.$c(8),this.td=new e.$c(5),this.Oi=new e.be(0),this.vo=new e.be(0));var i=this.td.Ce(),h=0<=t?t:i;if(this.td.S(i,0,h),0>t){if(h>=this.vb.I()){if(t=16>h?16:e.O.truncate(3*h/2),this.vb.resize(t),this.We!=null)for(var s=0;si.Ja(s))){var a=this.vf(t,-1);this.kn(a,i.dc(s));for(var u=i.Ba(s),c=i.Vc(s);ut.Ja(i))return h;this.Il.Fd(t,t.Ba(i),t.Vc(i)),this.it=this.vb.ub(0);var s=this.vf(h,-1);this.kn(s,t.dc(i)||!0);var o=this.We!=null&&t.Ve!=null,a=t.Ba(i);for(i=t.Vc(i);a=i.size&&i.resize(Math.max(e.O.truncate(1.25*t),16),-1),i.write(t,h)},n.prototype.KF=function(t,i){return(t=this.JF(t))<(i=this.wk[i]).size?i.read(t):-1},n.prototype.aF=function(){this.wk==null&&(this.wk=[]);for(var t=0;tl:2>l)?(u=this.Zq(u),s=0y){var d=y;c!=null&&(d=0d){var g=d;if(c!=null&&(g=0s||o>this.fd-1)throw e.i.N("invalid call");if(s>o&&!this.dc(t))throw e.i.N("cannot iterate across an open path");for(t=0;i!=h;i=this.U(i))s=this.Ua(i),(o=this.Sh(s))!=null?t+=o.Qb():(o=this.Ua(this.U(i)),t+=this.vb.yr(s,o));return t},n.prototype.Dh=function(t,i){var h=this.Ua(t);this.vb.Ht(h,i),(h=this.Sh(h))!=null&&h.setStart(i),(t=this.Ma(t))!=-1&&(t=this.Ua(t),this.Sh(t)!=null&&h.setEnd(i))},n.prototype.Vi=function(t,i){t=this.Ua(t),this.vb.ve(t,i)},n.prototype.mf=function(t,i){this.Cb(t,i.x,i.y)},n.prototype.Cb=function(t,i,h){var s=this.Ua(t);this.vb.Cb(s,i,h),(s=this.Sh(s))!=null&&s.ZB(i,h),(t=this.Ma(t))!=-1&&(t=this.Ua(t),this.Sh(t)!=null&&s.Ql(i,h))},n.prototype.D=function(t,i){this.vb.D(this.td.T(t,0),i)},n.prototype.Gc=function(t,i){this.vb.za[0].tc(2*this.td.T(t,0),i)},n.prototype.Na=function(t){var i=new e.h;return this.vb.D(this.td.T(t,0),i),i},n.prototype.dG=function(t,i){this.it.tc(2*t,i)},n.prototype.Uc=function(t,i,h){return this.vb.Uc(t,this.Ua(i),h)},n.prototype.setAttribute=function(t,i,h,s){this.vb.setAttribute(t,this.Ua(i),h,s)},n.prototype.Ua=function(t){return this.td.T(t,0)},n.prototype.ih=function(){var t=new e.h;return this.D(void 0,t),t.y},n.prototype.fq=function(t,i){t=this.Ua(t),i=this.Ua(i);var h=this.vb.za[0].o;return h[2*t]===h[2*i]&&h[2*t+1]===h[2*i+1]},n.prototype.Dv=function(t,i){t=this.Ua(t);var h=this.vb.za[0].o;return h[2*t]===i.x&&h[2*t+1]===i.y},n.prototype.vX=function(t,i){if(1>i&&(i=1),this.Sg==null){if(i==1)return;this.Sg=e.Yc.Dn(this.vb.I(),1)}(t=this.Ua(t))>=this.Sg.size&&this.Sg.resize(t+1,1),this.Sg.write(t,i)},n.prototype.cG=function(t){return t=this.Ua(t),this.Sg==null||t>=this.Sg.size?1:this.Sg.read(t)},n.prototype.Ra=function(t,i,h){i=this.bi[i],t=this.Ua(t),i.sizeo?1:ac?1:0})},n.prototype.jS=function(){for(var t=this.ld;t!=-1;t=this.ue(t))if(!e.aa.Hc(this.ic(t)))return!0;return!1},n.prototype.hC=function(t,i){for(var h=this.Ob(t),s=this.Ob(i),o=this.kv(t),a=this.kv(i),u=this.Ob(t);u!=-1;u=this.Rb(u))this.gx(u,i);for(u=this.Ob(i);u!=-1;u=this.Rb(u))this.gx(u,t);this.Zo(t,s),this.Zo(i,h),this.$o(t,a),this.$o(i,o),h=this.I(t),s=this.da(t),o=this.da(i),this.Tj(t,this.I(i)),this.Tj(i,h),this.Rl(t,o),this.Rl(i,s),h=this.cd.T(t,2),this.cd.S(t,2,this.cd.T(i,2)),this.cd.S(i,2,h)},n}(),e.gd=v})(k||(k={})),function(e){var v=function(f){function r(n,t,i,h){var s=f.call(this)||this;return s.$=new e.l,n===void 0?s.UE():typeof n=="number"?s.VO(n,t,i,h):n instanceof e.Sa?t!==void 0?s.Qu(n,t,i):s.WO(n):n instanceof e.ra?t!==void 0?s.YO(n,t):s.XO(n):n instanceof e.l?s.UO(n):s.UE(),s}return J(r,f),r.prototype.Qu=function(n,t,i){this.description=e.ee.og(),this.$.Oa(),n.B()||this.tu(n,t,i)},r.prototype.UO=function(n){this.description=e.ee.og(),this.$.K(n),this.$.normalize()},r.prototype.XO=function(n){if(n==null)throw e.i.N();this.description=n,this.$.Oa()},r.prototype.YO=function(n,t){if(n==null)throw e.i.N();this.description=n,this.$.K(t),this.$.normalize()},r.prototype.UE=function(){this.description=e.ee.og(),this.$.Oa()},r.prototype.WO=function(n){this.description=e.ee.og(),this.$.Oa(),n.B()||this.tu(n)},r.prototype.VO=function(n,t,i,h){this.description=e.ee.og(),this.K(n,t,i,h)},r.prototype.K=function(n,t,i,h){if(this.vc(),typeof n=="number")this.$.K(n,t,i,h);else for(this.Oa(),t=0,i=n.length;t=e.ra.Va(t))throw e.i.N();var h=this.description.Pf(t);return this.ou(),0<=h?this.ka[this.kR(this.description,n)+this.description.LR(h)-2+i]:e.ra.se(t)},r.prototype.ou=function(){if(this.vc(),this.ka==null&&2=e.ra.Va(t))throw e.i.ce();var h=this.description.Pf(t);return 0<=h?(this.ou(),this.ka[r.Gg(this.description,n)+this.description.$j(h)-2+i]):e.ra.se(t)},r.prototype.vD=function(n,t,i,h){if(this.vc(),t==0)n!=0?i!=0?this.$.H=h:this.$.C=h:i!=0?this.$.G=h:this.$.v=h;else{if(i>=e.ra.Va(t))throw e.i.ce();if(!this.hasAttribute(t)){if(e.ra.DG(t,h))return;this.re(t)}t=this.description.Pf(t),this.ou(),this.ka[r.Gg(this.description,n)+this.description.$j(t)-2+i]=h}},r.Gg=function(n,t){return t*(n.Ae.length-2)},r.prototype.Ea=function(n){this.vc();var t=new e.l;return n.A(t),this.$.Ea(t)},r.prototype.isIntersecting=function(n){return n instanceof e.l?this.$.isIntersecting(n):this.$.isIntersecting(n.$)},r.prototype.Ju=function(n,t){this.vc(),n.B()?this.Oa():t!==void 0?this.tu(n,t):this.$.Ju(n.Lg(),n.ih())},r.prototype.offset=function(n,t){this.vc(),this.$.offset(n,t)},r.prototype.normalize=function(){this.vc(),this.$.normalize()},r.prototype.sf=function(n){if(n===void 0){if(n=new e.Sa(this.description),this.B())return n;for(t=this.description.Aa,i=1;ithis.C&&(this.C=i.x),i.ythis.H&&(this.H=i.y)}}else if(r==null||r.length==0)this.Oa();else for(i=r[0],this.K(i.x,i.y),t=1;tr?this.v=r:this.Cn?this.G=n:this.Hr?this.v=r:this.Cn?this.G=n:this.Hthis.C||this.G>this.H)&&this.Oa())},f.prototype.scale=function(r){0>r&&this.Oa(),this.B()||(this.v*=r,this.C*=r,this.G*=r,this.H*=r)},f.prototype.zoom=function(r,n){this.B()||this.K(this.sf(),r*this.R(),n*this.ca())},f.prototype.isIntersecting=function(r){return!this.B()&&!r.B()&&(this.v<=r.v?this.C>=r.v:r.C>=this.v)&&(this.G<=r.G?this.H>=r.G:r.H>=this.G)},f.prototype.HG=function(r){return(this.v<=r.v?this.C>=r.v:r.C>=this.v)&&(this.G<=r.G?this.H>=r.G:r.H>=this.G)},f.prototype.Ea=function(r){return!this.B()&&!r.B()&&(r.v>this.v&&(this.v=r.v),r.Cthis.G&&(this.G=r.G),r.Hr.length)throw e.i.N();r[0]!=null?r[0].ma(this.v,this.G):r[0]=e.h.construct(this.v,this.G),r[1]!=null?r[1].ma(this.v,this.H):r[1]=e.h.construct(this.v,this.H),r[2]!=null?r[2].ma(this.C,this.H):r[2]=e.h.construct(this.C,this.H),r[3]!=null?r[3].ma(this.C,this.G):r[3]=e.h.construct(this.C,this.G)},f.prototype.wF=function(){return this.B()?0:this.R()*this.ca()},f.prototype.yR=function(){return this.B()?0:2*(this.R()+this.ca())},f.prototype.gk=function(){return(this.C+this.v)/2},f.prototype.Jp=function(){return(this.H+this.G)/2},f.prototype.R=function(){return this.C-this.v},f.prototype.ca=function(){return this.H-this.G},f.prototype.move=function(r,n){this.B()||(this.v+=r,this.G+=n,this.C+=r,this.H+=n)},f.prototype.Ju=function(r,n){if(n!==void 0)this.move(r-this.gk(),n-this.Jp());else if(r instanceof e.h)this.Ju(r.x,r.y);else{if(!(r instanceof e.Sa))throw e.i.N();n=(this.C-this.v)/2;var t=(this.H-this.G)/2;this.v=r.Lg()-n,this.C=r.Lg()+n,this.G=r.ih()-t,this.H=r.ih()+t}},f.prototype.offset=function(r,n){this.v+=r,this.C+=r,this.G+=n,this.H+=n},f.prototype.normalize=function(){if(!this.B()){var r=Math.min(this.v,this.C),n=Math.max(this.v,this.C);this.v=r,this.C=n,r=Math.min(this.G,this.H),n=Math.max(this.G,this.H),this.G=r,this.H=n}},f.prototype.dn=function(r){r.ma(this.v,this.G)},f.prototype.$I=function(r){r.ma(this.C,this.G)},f.prototype.cJ=function(r){r.ma(this.v,this.H)},f.prototype.en=function(r){r.ma(this.C,this.H)},f.prototype.fT=function(){return this.B()||this.v<=this.C&&this.G<=this.H},f.prototype.sf=function(){return e.h.construct((this.C+this.v)/2,(this.H+this.G)/2)},f.prototype.mz=function(){return e.h.construct(this.v,this.G)},f.prototype.contains=function(r,n){if(n!==void 0)return r>=this.v&&r<=this.C&&n>=this.G&&n<=this.H;if(r instanceof e.Sa)return this.contains(r.Lg(),r.ih());if(r instanceof e.h)return this.contains(r.x,r.y);if(r instanceof f)return r.v>=this.v&&r.C<=this.C&&r.G>=this.G&&r.H<=this.H;throw e.i.N()},f.prototype.hm=function(r,n){if(n!==void 0)return r>this.v&&rthis.G&&nthis.v&&r.Cthis.G&&r.H>>32);var n=e.O.Th(r);return r=this.C,r=e.O.truncate(r^r>>>32),n=e.O.Th(r,n),r=this.G,r=e.O.truncate(r^r>>>32),n=e.O.Th(r,n),r=this.H,r=e.O.truncate(r^r>>>32),e.O.Th(r,n)},f.prototype.xr=function(){return this.B()?2220446049250313e-29:2220446049250313e-29*(Math.abs(this.v)+Math.abs(this.C)+Math.abs(this.G)+Math.abs(this.H)+1)},f.prototype.zy=function(r,n){var t=this.Zj(r),i=this.Zj(n);if(t&i)return 0;if(!(t|i))return 4;var h=(t!=0?1:0)|(i!=0?2:0);do{var s=n.x-r.x,o=n.y-r.y;if(s>o?t&f.YC?(t&f.ju?(r.y+=o*(this.v-r.x)/s,r.x=this.v):(r.y+=o*(this.C-r.x)/s,r.x=this.C),t=this.Zj(r)):i&f.YC?(i&f.ju?(n.y+=o*(this.v-n.x)/s,n.x=this.v):(n.y+=o*(this.C-n.x)/s,n.x=this.C),i=this.Zj(n)):t!=0?(t&f.ku?(r.x+=s*(this.G-r.y)/o,r.y=this.G):(r.x+=s*(this.H-r.y)/o,r.y=this.H),t=this.Zj(r)):(i&f.ku?(n.x+=s*(this.G-n.y)/o,n.y=this.G):(n.x+=s*(this.H-n.y)/o,n.y=this.H),i=this.Zj(n)):t&f.ZC?(t&f.ku?(r.x+=s*(this.G-r.y)/o,r.y=this.G):(r.x+=s*(this.H-r.y)/o,r.y=this.H),t=this.Zj(r)):i&f.ZC?(i&f.ku?(n.x+=s*(this.G-n.y)/o,n.y=this.G):(n.x+=s*(this.H-n.y)/o,n.y=this.H),i=this.Zj(n)):t!=0?(t&f.ju?(r.y+=o*(this.v-r.x)/s,r.x=this.v):(r.y+=o*(this.C-r.x)/s,r.x=this.C),t=this.Zj(r)):(i&f.ju?(n.y+=o*(this.v-n.x)/s,n.x=this.v):(n.y+=o*(this.C-n.x)/s,n.x=this.C),i=this.Zj(n)),(t&i)!=0)return 0}while(t|i);return h},f.prototype.Zj=function(r){return(r.xthis.C?1:0)<<1|(r.ythis.H?1:0)<<3},f.prototype.Bi=function(r){return!this.B()&&(this.R()<=r||this.ca()<=r)},f.prototype.tb=function(r){return r instanceof e.h?Math.sqrt(this.iK(r)):Math.sqrt(this.px(r))},f.prototype.px=function(r){var n=0,t=0,i=this.v-r.C;return i>n&&(n=i),(i=this.G-r.H)>t&&(t=i),(i=r.v-this.C)>n&&(n=i),(i=r.G-this.H)>t&&(t=i),n*n+t*t},f.prototype.iK=function(r){var n=0,t=0,i=this.v-r.x;return i>n&&(n=i),(i=this.G-r.y)>t&&(t=i),(i=r.x-this.C)>n&&(n=i),(i=r.y-this.H)>t&&(t=i),n*n+t*t},f.prototype.cn=function(r){this.B()?r.Oa():r.K(this.v,this.C)},f.ju=1,f.ku=4,f.YC=3,f.ZC=12,f}();e.l=v}(k||(k={})),function(e){var v,f;(f=v||(v={}))[f.initialize=0]="initialize",f[f.initializeRed=1]="initializeRed",f[f.initializeBlue=2]="initializeBlue",f[f.initializeRedBlue=3]="initializeRedBlue",f[f.sweep=4]="sweep",f[f.sweepBruteForce=5]="sweepBruteForce",f[f.sweepRedBlueBruteForce=6]="sweepRedBlueBruteForce",f[f.sweepRedBlue=7]="sweepRedBlue",f[f.sweepRed=8]="sweepRed",f[f.sweepBlue=9]="sweepBlue",f[f.iterate=10]="iterate",f[f.iterateRed=11]="iterateRed",f[f.iterateBlue=12]="iterateBlue",f[f.iterateBruteForce=13]="iterateBruteForce",f[f.iterateRedBlueBruteForce=14]="iterateRedBlueBruteForce",f[f.resetRed=15]="resetRed",f[f.resetBlue=16]="resetBlue";var r=function(){function n(t,i){this.ci=t,this.dH=i}return n.prototype.nr=function(t,i,h){this.ci.JX(h,t,i,this.dH)},n.prototype.$p=function(t){return this.ci.Rr(t,this.dH)},n}();v=function(){function n(){this.ow=this.oo=this.ff=this.rd=null,this.wq=new e.l,this.Am=this.Hj=this.Ij=this.Ad=this.Ef=this.Ld=this.cw=this.fo=this.qd=this.Eb=null,this.Xb=-1,this.qa=0,this.Nk()}return n.prototype.kr=function(){this.Nk(),this.Pv=!0,this.Eb==null?(this.fo=new e.ia(0),this.Eb=[]):(this.fo.Bh(0),this.Eb.length=0)},n.prototype.ad=function(t,i){if(!this.Pv)throw e.i.Hb();var h=new e.l;h.K(i),this.fo.add(t),this.Eb.push(h)},n.prototype.Fp=function(){if(!this.Pv)throw e.i.Hb();this.Pv=!1,this.Eb!=null&&0this.Eb.length)return this.pe=this.Eb.length,this.Xb=5,!0;this.rd==null&&(this.rd=new e.sr(!0),this.oo=this.rd.getIterator(),this.Ld=new e.ia(0)),this.rd.kr();for(var t=0;tthis.Eb.length||10>this.qd.length)return this.pe=this.Eb.length,this.Xb=6,!0;this.rd==null&&(this.rd=new e.sr(!0),this.oo=this.rd.getIterator(),this.Ld=new e.ia(0)),this.rd.kr();for(var t=0;tthis.Eb.length||10>this.qd.length)return this.pe=this.Eb.length,this.Xb=6,!0;this.ff==null&&(this.ff=new e.sr(!0),this.ow=this.ff.getIterator(),this.Ef=new e.ia(0)),this.ff.kr();for(var t=0;tthis.Eb.length||10>this.qd.length)return this.pe=this.Eb.length,this.Xb=6,!0;this.rd==null&&(this.rd=new e.sr(!0),this.oo=this.rd.getIterator(),this.Ld=new e.ia(0)),this.ff==null&&(this.ff=new e.sr(!0),this.ow=this.ff.getIterator(),this.Ef=new e.ia(0)),this.rd.kr();for(var t=0;t>1;return n.eq(t)?(this.rd.remove(i),this.pe!=0||(this.Af=this.Vf=-1,this.Ic=!0,!1)):(this.oo.EB(this.Eb[i].v,this.Eb[i].C,this.qa),this.Vf=i,this.Xb=10,!0)},n.prototype.QX=function(){return--this.pe==-1?(this.Af=this.Vf=-1,this.Ic=!0,!1):(this.Rg=this.Vf=this.pe,this.Xb=13,!0)},n.prototype.RX=function(){return--this.pe==-1?(this.Af=this.Vf=-1,this.Ic=!0,!1):(this.Vf=this.pe,this.Rg=this.qd.length,this.Xb=14,!0)},n.prototype.SX=function(){var t=this.Ld.get(this.pe-1),i=this.Ef.get(this.Rg-1),h=this.Rr(t,!0),s=this.Rr(i,!1);return h>s?this.ux():h>1;if(n.eq(t))return this.Df!=-1&&this.Ij.get(i)!=-1?(this.Ad.jd(this.Df,this.Ij.get(i)),this.Ij.set(i,-1)):this.rd.remove(i),this.pe!=0||(this.Af=this.Vf=-1,this.Ic=!0,!1);if(this.Cf!=-1&&0>1;if(n.eq(t))return this.Cf!=-1&&this.Hj.get(i)!=-1?(this.Ad.jd(this.Cf,this.Hj.get(i)),this.Hj.set(i,-1)):this.ff.remove(i),this.Rg!=0||(this.Af=this.Vf=-1,this.Ic=!0,!1);if(this.Df!=-1&&0>1;return this.rd.vj(t),this.Xb=4,!0},n.prototype.jT=function(){if(this.Vf=this.oo.next(),this.Vf!=-1)return!1;this.Af=this.Vf=-1;var t=this.Ef.get(this.Rg)>>1;return this.ff.vj(t),this.Xb=7,!0},n.prototype.gT=function(){if(this.Af=this.ow.next(),this.Af!=-1)return!1;var t=this.Ld.get(this.pe)>>1;return this.rd.vj(t),this.Xb=7,!0},n.prototype.hT=function(){if(--this.Rg==-1)return this.Xb=5,!0;this.wq.K(this.Eb[this.pe]);var t=this.Eb[this.Rg];return this.wq.W(this.qa,this.qa),!this.wq.isIntersecting(t)||(this.Af=this.Rg,!1)},n.prototype.iT=function(){if(--this.Rg==-1)return this.Xb=6,!0;this.wq.K(this.Eb[this.pe]);var t=this.qd[this.Rg];return this.wq.W(this.qa,this.qa),!this.wq.isIntersecting(t)||(this.Af=this.Rg,!1)},n.prototype.kJ=function(){return this.rd==null?(this.Ic=!0,!1):(this.pe=this.Ld.size,0>1],n.eq(t)?i.G-h:i.H+h):(i=this.qd[t>>1],n.eq(t)?i.G-h:i.H+h)},n}(),e.xC=v}(k||(k={})),function(e){var v=function(){function f(){}return f.construct=function(r,n,t,i,h,s){var o=new f;return o.v=r,o.G=n,o.Ye=t,o.C=i,o.H=h,o.Bg=s,o},f.prototype.Oa=function(){this.Ye=this.v=NaN},f.prototype.B=function(){return isNaN(this.v)},f.prototype.XS=function(){return isNaN(this.Ye)},f.prototype.K=function(r,n,t,i,h,s){i!==void 0?typeof r=="number"?(this.v=r,this.G=n,this.Ye=t,this.C=i,this.H=h,this.Bg=s):(this.v=r.x-.5*n,this.C=this.v+n,this.G=r.y-.5*t,this.H=this.G+t,this.Ye=r.z-.5*i,this.Bg=this.Ye+i):(this.v=r,this.G=n,this.Ye=t,this.C=r,this.H=n,this.Bg=t)},f.prototype.move=function(r){this.v+=r.x,this.G+=r.y,this.Ye+=r.z,this.C+=r.x,this.H+=r.y,this.Bg+=r.z},f.prototype.copyTo=function(r){r.v=this.v,r.G=this.G,r.C=this.C,r.H=this.H},f.prototype.Lk=function(r,n,t){this.v>r?this.v=r:this.Cn?this.G=n:this.Ht?this.Ye=t:this.Bgr.length)throw e.i.N();r[0]=new e.Nd(this.v,this.G,this.Ye),r[1]=new e.Nd(this.v,this.H,this.Ye),r[2]=new e.Nd(this.C,this.H,this.Ye),r[3]=new e.Nd(this.C,this.G,this.Ye),r[4]=new e.Nd(this.v,this.G,this.Bg),r[5]=new e.Nd(this.v,this.H,this.Bg),r[6]=new e.Nd(this.C,this.H,this.Bg),r[7]=new e.Nd(this.C,this.G,this.Bg)},f.prototype.Zw=function(r){if(r==null||r.length==0)this.Oa();else{var n=r[0];for(this.K(n.x,n.y,n.z),n=1;nthis.FA;){var a=this.sd.ha();if(h.L(a.ac()),s.L(a.wc()),h.scale(this.Wa.ec),s.scale(this.Wa.ec),e.cj.Mu(h,s)?h.x=s.x:e.cj.Ku(h,s)&&(s.x=h.x),this.uk.length=0,e.cj.tF(this.Wa.Tb,this.Wa.kc,this.Wa.ze,h,s,this.Wa.QA,this.Wa.Zs,o,this.Nj,this.Gs,this.uk,this.bw),this.co!=null&&(a=this.uk.slice(0),this.co.qG(this.co.da()-1,a,a.length-1)),e.cj.Lu(h,s)?(this.qq.Oa(),this.Wa.sy(h,this.sl,this.qq),this.Xn=!0):(this.qq.Oa(),this.Xn=this.xy(o[0],this.qq)),this.Xn){if(this.sd.li(),this.sd.Ez()){this.sd.li(),this.sd.ha();break}this.sd.DW();break}t==null&&(t=new e.Da).Yk(null,0),this.OD(t),i++}if(this.bw[0]=0,0=this.Nj[0]){var o=this.di+1.570796326794897;h=o+3.141592653589793-(this.di-this.Nj[0])}else h=(o=this.di+1.570796326794897)+3.141592653589793-(6.283185307179586-(this.Nj[0]-this.di));var a=!(this.di>=this.Nj[0]&&3.141592653589793>=this.di-this.Nj[0])&&!(this.dio;)c-=6.283185307179586;ci.x-this.sk[0]?this.sk[0]-=6.283185307179586:3.141592653589793o?u.xX():u.$n=o,h=t.getType(),e.aa.yd(h)?((h=new e.Ta(t.description)).oc(t,!0),t=h,h=1607):h==197&&(h=new e.l,t.A(h),h.R()<=u.qa||h.ca()<=u.qa?((h=new e.Ta(t.description)).ad(t,!1),t=h,h=1607):((h=new e.Da(t.description)).ad(t,!1),t=h,h=1736)),u.yX(),e.aa.Rn(h)||u.zX(),u.rb<=.5*u.$n)return h!=1736?new e.Da(t.description):u.Wv?t:e.cj.Qr(t,u.Qg,u.ze,u.QA,-1,a);if(0>u.Ka&&h!=1736)return new e.Da(t.description);if(u.Wv&&e.aa.Hc(h)?(i=e.cj.Qr(t,i,4,NaN,u.$n,a),t=e.cb.zh(i,u.Qg,u.Jc)):t=e.cb.zh(t,u.Qg,u.Jc),(t=e.Hh.lj(t,u.Jc)).B())return new e.Da(t.description);switch(!u.Wv&&e.aa.Hc(h)&&(t=e.cj.pI(u.ec,t)),t=n.KX(t,u.Jc),h){case 1736:i=u.UN(t);break;case 1607:i=u.VN(t);break;case 550:i=u.SN(t);break;case 33:i=u.TN(t);break;default:throw e.i.fa("corrupted_geometry")}return(u=e.cb.zh(i,u.Jc,u.Qg)).Jl(t.description),u},n.prototype.UN=function(t){var i=new e.Da;t=new f(this,t,i),t=e.Gh.local().V(t,this.Jc,this.Ub).next(),t=e.ip.nj(t,this.Jc,2);var h=new e.Dd;return h.scale(1/this.ec,1/this.ec),i.Oc(h),i=e.ip.nj(i,this.Jc,2),0<=this.Ka?e.Gh.local().V(i,t,this.Jc,this.Ub):e.kp.local().V(i,t,this.Jc,this.Ub)},n.prototype.VN=function(t){return t=new f(this,t,null),t=e.Gh.local().V(t,this.Jc,this.Ub).next(),e.ip.nj(t,this.Jc,2)},n.prototype.SN=function(t){return t=new v(this,t),t=e.Gh.local().V(t,this.Jc,this.Ub).next(),e.ip.nj(t,this.Jc,2)},n.prototype.TN=function(t){(t=t.D()).scale(this.ec);var i=new e.Da;return this.sy(t,!1,i),e.ip.nj(i,this.Jc,2)},n.prototype.xy=function(t,i,h,s,o,a){var u=t[0],c=t[t.length-1],l=u.y>c.y?u.y:c.y,p=e.F.q(this.Tb,this.kc,u.yt.Ke()&&(this.UV(t),!0)},n.prototype.OI=function(t,i,h){var s=h.I(),o=0a.x?(a=this.zq,s.gg(-this.Js,0)):(a=-this.zq,s.gg(this.Js,0)),i.add(t,!1),t.Oa(),h.add(i,!1),h.Oc(s),o=new e.l,h.A(o),o.W((this.Js-o.R())/2,0),o.G=-this.zq,o.H=this.zq;for(var c=0;c=u));)e.kb.yi(t,i,o.x,o.y,s,A,b,x),l?w.ma(b.u,x.u):(m.ma(b.u,x.u),n.gJ(o.x,m.x,j.x,p),w.ma(p[0]+m.x,m.y),j.L(w)),w.scale(h),y.wf(0,-1,w),a=A,A=M++*c}},n.dJ=function(t,i,h,s,o,a,u,c,l,p){var y=new e.h,d=new e.h,g=new e.ga(0),b=new e.ga(0);for(e.kb.yi(t,i,s.x,s.y,h,o,g,b),y.ma(g.u,b.u),e.kb.yi(t,i,s.x,s.y,h,a,g,b),d.ma(g.u,b.u),h=new e.ga(0),e.kb.Xy(t,i,u.x,u.y,y.x,y.y,h),l[0]=h.u,e.kb.Xy(t,i,u.x,u.y,d.x,d.y,h),p[0]=h.u;l[0]<=p[0];)l[0]+=6.283185307179586;for(;l[0]>p[0];)l[0]-=6.283185307179586;for(;l[0]>=c;)l[0]-=6.283185307179586,p[0]-=6.283185307179586;for(;l[0]a[y]?1:0}),i=t.Ia(),c=0;cthis.rb/t&&(t=this.rb/500),.01>t&&(t=.01),this.$n=t},n}();e.VK=r}(k||(k={})),function(e){var v=function(){function f(){}return f.Mf=function(r,n){var t=new e.h;t.L(n),r.push(t)},f.up=function(r,n){r.add(n.x),r.add(n.y)},f.hB=function(r){r.Bh(r.size-2)},f.oB=function(r,n){n.ma(r.get(r.size-2),r.get(r.size-1))},f.Qr=function(r,n,t,i,h,s){if(r==null)throw e.i.N();var o=r.getType();if(r.B()||e.aa.Rn(o))return r;var a=new f;a.Qg=n,a.Jc=e.cb.sc(n);var u=e.cb.vv(a.Jc);if(a.Ub=s,a.Tb=e.cb.ev(a.Jc),a.kc=u*(2-u),a.ec=a.Jc.Hd().ai,a.Aq=a.Jc.Kn(),a.Zs=a.Aq*a.ec,a.AA=i,a.zA=h,a.ze=t,o==197?(t=new e.Da(r.description)).ad(r,!1):e.aa.yd(o)?(t=new e.Ta(r.description)).oc(r,!0):t=r,a.ze!=4){if((n=a.Qg.Nb(a.Jc)==0?e.cb.zh(t,a.Qg,a.Jc):e.Hh.lj(t,a.Jc)).B())return n;n=f.pI(a.ec,n),n=a.Zy(n),n=e.ip.nj(n,a.Jc,a.ze),a=e.cb.zh(n,a.Jc,a.Qg)}else{if(e.Eg.Sb(n)==2?(r=e.cb.ml(),(n=e.Xj.local().V(t,r,n,s))==r&&(n=new e.Da,r.copyTo(n))):n=e.Hh.lj(t,a.Jc),n.B())return n;a=a.CX(n)}return a},f.pI=function(r,n){var t=new e.l;if(n.xc(t),3.141592653589793>t.R()*r)return n;var i=!1;t=n.Ga();for(var h=new e.h,s=new e.h;t.$a();)for(;t.Ha();){var o=t.ha();if(h.L(o.ac()),s.L(o.wc()),h.scale(r),s.scale(r),3.141592653589793s.x-h.x)for(;-6.283185307179586>s.x-h.x;)s.x+=6.283185307179586;f.Wi(s.x,NaN,b),p.L(s)}else c.L(s),f.AU(c),f.Wi(c.x,g,b),p.ma(b[0]+c.x,c.y);.5>Math.abs(p.x-s.x)&&p.L(s),u?(o.Tw(0,d),y.L(l),y.scale(1/r),d.Cb(y),(a=t.vm())?i.nf(d):i.lineTo(d),t.Qn()&&!n.dc(t.gb)&&(o.Tw(1,d),y.L(p),y.scale(1/r),d.Cb(y),i.lineTo(d))):((a=t.vm())&&i.Hz(null,0),o=i.da()-1,y.L(l),y.scale(1/r),i.wf(o,-1,y),t.Qn()&&!n.dc(t.gb)&&(y.L(p),y.scale(1/r),i.wf(o,-1,y)))}return i},f.tF=function(r,n,t,i,h,s,o,a,u,c,l,p){var y=new e.h,d=new e.h,g=0m&&(m+=6.283185307179586),0>(b=b.u)&&(b+=6.283185307179586),u!=null&&(u[0]=x),c!=null&&(c[0]=m),l!=null&&(l[0]=b),c=u=NaN,p!=null&&(u=((c=e.F.Ah(r,n))-(l=e.F.q(r,n,i.y)))/x,c=(c+l)/x),l=f.Mu(i,h),b=f.Ku(i,h),m=l||b;var w=f.FE(i,h,a),j=new e.ga(0),M=new e.ga(0),A=new e.h,z=new e.h,N=new e.h;f.Wi(i.x,NaN,d);var I=[d[0]];if(x<=s)f.Mf(y,i),f.Wi(h.x,NaN,d),p!=null&&p.add(0),m?(l&&f.kB(i,h,p,y),b&&f.iB(i,h,p,y)):w?f.jB(i,h,g,u,c,p,y):0N.x&&(d[0]+=6.283185307179586,N.ma(d[0]+A.x,A.y)):T.xo.x?o.x+=6.283185307179586:3.141592653589793E;E++)if(T=C[E]*c+(1-C[E])*u,e.kb.oj(r,n,i.x,i.y,T*h,s,x,m,t),A.ma(x.u,m.u),E==0&&(B=T,z.L(A)),f.WW(j,A,M,I),I.hc(I.fe(A,!0),N),e.kb.wd(r,n,A.x,A.y,N.x,N.y,w,null,null,2),w.u>l){D=!0;break}D?(M.L(z),c=B,f.up(o,M),a.add(c)):(f.hB(o),a.En(a.size-1,1,a.size-1),0=o&&W.u<=s&&3.141592653589793>Math.abs(g.x-b.x)||i.Ux(D,B)<=h));I++){var L=U[I]*B+(1-U[I])*D;if(i.hc(L,p),N?x.ma(p.x*t,p.y*t):(z[0][0]=p.x,z[0][1]=p.y,e.cb.vt(),x.x=z[0][0]*t,x.y=z[0][1]*t),I==0&&(tt=L,d.L(p),w.L(x),0s||3.141592653589793<=Math.abs(g.x-b.x)))){O=!0;break}if(E&&0s||3.141592653589793<=Math.abs(g.x-x.x)){O=!0;break}}else if(0o){O=!0;break}if(E){if(e.kb.wd(r,n,A.x,A.y,m.x,m.y,V,null,null,2),V.u>o){O=!0;break}if(e.kb.wd(r,n,m.x,m.y,x.x,x.y,nt,null,null,2),nt.u>o){O=!0;break}}}}O?(l.L(d),b.L(w),B=tt,f.up(C,l),f.up(G,b),H.add(B)):(f.hB(C),f.hB(G),H.En(H.size-1,1,H.size-1),f.Mf(u,l),T+=W.u,a!=null&&a.add(T),0Math.abs(n.x-r.x)?(i.Dc(r),3.141592653589793<=t.x-r.x?i.Ql(t.x-6.283185307179586,t.y):3.141592653589793<=r.x-t.x?i.Ql(t.x+6.283185307179586,t.y):i.Ql(t.x,t.y)):(i.Dc(t),3.141592653589793<=r.x-t.x?i.Ql(r.x-6.283185307179586,r.y):3.141592653589793<=t.x-r.x?i.Ql(r.x+6.283185307179586,r.y):i.Ql(r.x,r.y))},f.YJ=function(r,n){for(var t=0;tr.x)for(;-3.141592653589793>r.x;)r.x+=6.283185307179586;if(3.141592653589793f.v+i&&sf?-f:f},v.Mb=function(f,r){return 0<=r?v.P(f):-v.P(f)},v.Y=function(f,r){return f==r||v.P(f-r)<=v.JC*(1+(v.P(f)+v.P(r))/2)},v.Cd=function(f){return f==0||v.P(f)<=v.JC},v.Ah=function(f,r){var n=(r=(1-(r=Math.sqrt(1-r)))/(1+r))*r;return f/(1+r)*(1+n*(.25+n*(.015625+1/256*n)))*v.EL},v.EL=1.5707963267948966,v.JC=3552713678800501e-30,v}()}(k||(k={})),function(e){var v=function(r){this.Wf=r,this.Kk=this.Wf.getCode(),0>this.Kk&&(this.Kk=0)};e.DY=v;var f=function(){function r(n){n===void 0&&(n=null),this.Cj=null,this.Un=!1,n!==null&&(this.Cj=new v(n))}return r.prototype.Ec=function(){return this.Cj!=null?this.Cj.Kk:0},r.prototype.Of=function(){var n=new r;return this.copyTo(n),n},r.prototype.copyTo=function(n){n.Cj=this.Cj,n.Un=this.Un},r.prototype.Qz=function(){this.Un=!this.Un},r.prototype.qm=function(){return this.Cj!=null?this.Cj.Wf:null},r.prototype.LJ=function(n){if(0>=n)throw e.i.N();if(n!=this.Ec()){if((n=e.pf.geogtran(n))==null)throw e.i.N("Geogtran not found.");this.Cj=new v(n)}},r.prototype.Bz=function(){return this.Cj==null?null:this.Cj.Wf.toString()},r.prototype.tX=function(n){if(n==null)throw e.i.N();var t=null;try{t=e.pf.fromString(e.Sc.PE_TYPE_GEOGTRAN,n)}catch{throw e.i.N()}this.Cj=new v(t)},r.prototype.Nb=function(n){return n==this||!(!(n instanceof r)||(0>=this.Ec()||this.Ec()!=n.Ec())&&!this.qm().isEqual(n.qm()))&&this.Un==n.Un},r.prototype.toString=function(){var n="GeographicTransformation: "+this.Bz();return 200r.I())},f.BE=function(r){return!(r.B()||r.getType()!=1607&&r.getType()!=1736||20>r.I())},f}();e.Uk=v}(k||(k={})),function(e){e.$b=function(){function v(){}return v.TT=function(f){var r=new e.Da;return r.sx(f.es(),f.gs()),r.yj(f.es(),f.fs()),r.yj(f.ds(),f.fs()),r.yj(f.ds(),f.gs()),r},v.zh=function(f,r){return f===null?null:e.Hx.local().V(f,r,null)},v.jY=function(f,r){var n=e.Gh.local();return f=new e.Zc(f),n.V(f,r,null).next()},v.im=function(f,r,n){return e.kp.local().V(f,r,n,null)},v.ep=function(f,r,n){return e.Kx.local().V(f,r,n,null)},v.VX=function(f,r,n){var t=e.Kx.local();for(f=new e.Zc(f),r=new e.Zc(r),n=t.V(f,r,n,null),t=[];(r=n.next())!=null;)t.push(r);return t},v.Nb=function(f,r,n){return e.dj.local().V(3,f,r,n,null)},v.TP=function(f,r,n){return e.dj.local().V(4,f,r,n,null)},v.RS=function(f,r,n){var t=e.Xj.local();for(f=new e.Zc(f),r=new e.Zc(r),n=t.V(f,r,n,null),t=[];(r=n.next())!=null;)t.push(r);return t},v.QP=function(f,r,n){var t=e.kp.local();for(f=new e.Zc(f),r=new e.Zc(r),n=t.V(f,r,n,null),t=[];(r=n.next())!=null;)t.push(r);return t},v.Ea=function(f,r,n){return e.Xj.local().V(f,r,n,null)},v.QS=function(f,r,n){if((f=e.Xj.local().V(f,r,n,null,1))===null)return[];if(f.getType()===550){for(r=[],n=0;nf.Db())return 0;var t=null;if(r!=null){if(t=r.Hd(),n!=null&&t.Ec()!=n.Ec()&&t.od!=n.od)throw e.i.Xk()}else if(n!=null)throw e.i.N();f.getType()==1736||f.getType()==197?r=f.mg():e.aa.yd(f.getType())?(r=new e.Ta(f.description)).oc(f,!0):r=f,f=0,r=r.Ga();for(var i=new e.h,h=new e.h;r.$a();)for(;r.Ha();){var s=r.ha();s.Yp(i),s.Tr(h),f+=e.h.tb(i,h)}return t!==null&&n!==null&&(f=e.Tc.Nh(f,t,n)),f},v.fP=function(f){return f.points!==void 0?v.mS(f,f.hasZ!==void 0&&f.hasZ,f.hasM!==void 0&&f.hasM):f.rings!==void 0?v.lG(f.rings,f.hasZ!==void 0&&f.hasZ,f.hasM!==void 0&&f.hasM,"P"):f.paths!==void 0?v.lG(f.paths,f.hasZ!==void 0&&f.hasZ,f.hasM!==void 0&&f.hasM,"L"):f.x!==void 0?v.nS(f):f.xmin!==void 0?v.lS(f):null},v.nS=function(f){if(f.x==null||f.x=="NaN")return new e.Sa;var r=new e.Sa(f.x,f.y);return f.z!==void 0&&f.z!==null&&r.wX(f.z),f.m!==void 0&&f.m!==null&&r.hX(f.m),r},v.lS=function(f){if(f.xmin==null||f.xmin=="NaN")return new e.Fh;var r=new e.Fh(f.xmin,f.ymin,f.xmax,f.ymax);return f.zmin!==void 0&&f.zmin!==null&&r.setInterval(1,0,f.zmin,f.zmax),f.mmin!==void 0&&f.mmin!==null&&r.setInterval(2,0,f.mmin,f.mmax),r},v.mS=function(f,r,n){var t=0,i=new e.de,h=3*f.points.length;h%2!=0&&h++,2>h&&(h=2);var s=e.O.truncate(3*f.points.length/2);4>s?s=4:16>s&&(s=16),h=e.Yc.Dn(h,0);var o=e.Yc.Dn(s);s=e.Yc.Dn(s);for(var a=0;a=h?(p[y]=!1,c+=1,o.add(u),a.add(i),u+=d):p[y]=!0}for((t=3*u)%2!=0&&t++,2>t&&(t=2),4>(y=e.O.truncate(3*u/2))?y=4:16>y&&(y=16),t=e.Yc.Dn(t,0),i=e.Yc.Dn(y),h=e.Yc.Dn(y),y=d=0;yo)throw e.i.N();this.Qi.oa=s-a,this.Qi.va=o+a,this.hi.resize(0),this.he=0,this.sg[0]=0},h.prototype.Uo=function(s,o){this.Qi.oa=s-o,this.Qi.va=s+o,this.hi.resize(0),this.he=0,this.sg[0]=0},h.prototype.next=function(){if(!this.Ya.lq)throw e.i.Hb();if(0>this.he)return-1;for(var s=!0;s;)switch(this.sg[this.he]){case 1:s=this.FU();break;case 2:s=this.GU();break;case 3:s=this.HU();break;case 4:s=this.IU();break;case 5:s=this.GW();break;case 6:s=this.kT();break;case 7:s=this.tN();break;case 0:s=this.Gz();break;default:throw e.i.Qa()}return this.Og!=-1?this.Mp()>>1:-1},h.construct=function(s){var o=new h;return o.Ya=s,o.hi.Jb(20),o.he=-1,o},h.prototype.Gz=function(){return this.Og=this.vH=this.Mi=this.Lc=-1,this.Ya.me!=null&&0=this.Qi.oa?(this.ei=this.QR(),!1):(this.he--,!0)},h.prototype.tN=function(){return this.Og=this.ei,this.Og!=-1&&i.gq(this.Mp())?(this.ei=this.SF(),!1):(this.he--,!0)},h.prototype.SF=function(){return this.Ya.Sf?this.Ya.$f.lb(this.Og):this.Ya.Ti.lb(this.Og)},h.prototype.QR=function(){return this.Ya.Sf?this.Ya.$f.we(this.Og):this.Ya.Ti.we(this.Og)},h.prototype.Mp=function(){return this.Ya.Sf?this.Ya.$f.ja(this.Og):this.Ya.Ti.getData(this.Og)},h}();e.EY=t;var i=function(){function h(s){this.Am=this.$h=this.$f=this.Ti=this.Km=this.Ej=this.me=this.Fj=null,this.Sf=s,this.lq=this.Sv=!1}return h.prototype.kr=function(){this.Nk(!0)},h.prototype.Br=function(s,o){if(!this.Sv)throw e.i.Hb();this.Fj.push(new e.Nc(s,o))},h.prototype.Fp=function(){if(!this.Sv)throw e.i.fa("invalid call");this.Sv=!1,this.lq=!0,this.Sf||(this.vS(),this.Zv=this.Fj.length)},h.prototype.vj=function(s){if(!this.Sf||!this.lq)throw e.i.N("invalid call");if(this.kf==-1){var o=this.Fj.length;if(this.iA){var a=new e.ia(0);a.Jb(2*o),this.bJ(a),this.$h.Jb(2*o),this.$h.resize(0),this.aJ(a),this.Km.resize(o,-1),this.Km.Wj(-1,0,o),this.iA=!1}else this.Km.Wj(-1,0,o);this.kf=this.Tu()}o=this.pG(s<<1,this.kf),a=this.$f.addElement(1+(s<<1),this.xz(o)),this.VJ(o,a),this.Km.set(s,o),this.Zv++},h.prototype.remove=function(s){if(!this.Sf||!this.lq)throw e.i.fa("invalid call");var o=this.Km.get(s);if(o==-1)throw e.i.N("the interval does not exist in the interval tree");this.Km.set(s,-1),this.Zv--;var a=this.xz(o),u=this.$f.ZR(a);this.$f.vd(this.wR(o),a),this.$f.vd(this.TR(o),a),(s=this.$f.size(a))==0&&(this.$f.MP(a),this.ZJ(u,-1)),this.Ej.jd(o),a=this.UF(u);var c=this.qj(u),l=this.lk(u);for(o=0;!(0>1);c!=-1?this.VJ(c,this.Ti.addElement(this.xz(c),u)):(c=this.pG(u,this.kf),a.set(u>>1,c))}},h.prototype.pG=function(s,o){var a=o,u=o,c=-1,l=0,p=this.$h.size-1,y=0,d=s>>1,g=NaN,b=NaN,x=!0,m=this.DR(d);for(d=this.AR(d);x;){lw&&(ww)o!=-1&&(o==a?(u=a,g=w,b=(o=this.lk(a))!=-1?this.Np(o):NaN):b>1];return h.gq(s)?o.oa:o.va},h}();e.sr=i}(k||(k={})),function(e){var v=function(){function f(r){if(r==null)throw e.i.fa("Invalid arguement");this.hf=r;var n=r.nR();n.hS()?r.ef.IG()?this.lo=e.si.PannableFold:this.lo=e.si.Clip:this.lo=e.si.DontClip,n.iS()?r.Yf.IG()?this.Qm=e.si.PannableFold:this.Qm=e.si.Clip:this.Qm=e.si.DontClip,this.Bm=n.Jr,this.mH=n.Vu,r=this.hf.sH,this.aH=r.hs(2147483648),this.Uv=r.hs(1073741824)}return f.zh=function(r,n,t){return n.ww.zh(r,t)},f.Rt=function(r,n,t,i){return r.ww.Rt(n,t,i)},f.Qt=function(r,n,t,i){if(t=0>t?n.length:t,(r=r.ww.Rt(n,t,i))==t)return r;for(var h=n=0;hh.H){var d=e.l.construct(a.v-1,h.G,a.C+1,h.H);if((y=e.ri.Nu(y,d,t,NaN,0,n)).B())return y}a.R()>2*h.R()&&(y=e.zb.Hp(y,-2*h.R(),2*h.R(),t,!0,0,!0,n))}a=this.mH,(h=!isNaN(a))&&(y=e.Xl.local().V(y,a,n)),d=c?i.kk():null;var g=NaN;u&&(g=t.zi());var b=i.Wr()!=null;if(this.aH)u&&(e.zb.ur(t,g,y,o),h&&(u=t.hh(),a*=(g=t.sc().hh())/u)),e.zb.tr(this.hf,y,p,o),h&&(u=t.sc().hh(),a*=(g=i.sc().hh())/u),t=y;else{var x=new e.Ta(y.description);x.DD(y),u&&(e.zb.ur(t,g,x,o),h&&(u=t.hh(),a*=(g=t.sc().hh())/u)),e.zb.tr(this.hf,x,p,o),h&&(u=t.sc().pm(),a*=(g=i.sc().pm())/u),p=NaN,c?(d=i.kk(),p=i.zi()):isNaN(this.Bm)||(p=this.Bm),u=f.tv(t)|f.tv(i),g=10*l.Xd(0),this.Uv&&(u=3,g=0),t=e.zb.UQ(y,t,x,l,p,n,u,g)}return b&&(t=e.zb.XD(t,i,n)),c&&(s||(c=l.Oe().R(),t.Tg(0,0).R()>=c-l.Xd(0)&&(l=d.getNorthPoleLocation(),c=d.getSouthPoleLocation(),y=d.getNorthPoleGeometry(),d=d.getSouthPoleGeometry(),p=0,y==e.Cg.PE_POLE_POINT&&l!=e.Cg.PE_POLE_OUTSIDE_BOUNDARY&&(p=1),d==e.Cg.PE_POLE_POINT&&c!=e.Cg.PE_POLE_OUTSIDE_BOUNDARY&&(p|=2),p!==0&&(s=!0))),t=e.zb.Mz(t,i,this.Qm,n),h&&(t=e.Xl.local().V(t,a,n)),e.zb.Lx(i,t,o)),t.B()||(s&&(t=e.Yl.local().V(t,i,!1,n)),r!=null&&(t=r.Zk(t,!1),this.wp(r,e.bm.reverse,t),t=r.$k(t,!1))),t},f.tv=function(r){if(r.Sb()!=2)return 0;var n=0,t=r.kk();r=t.getNorthPoleLocation();var i=t.getSouthPoleLocation(),h=t.getNorthPoleGeometry();return t=t.getSouthPoleGeometry(),h==e.Cg.PE_POLE_POINT&&r!=e.Cg.PE_POLE_OUTSIDE_BOUNDARY&&(n=1),t==e.Cg.PE_POLE_POINT&&i!=e.Cg.PE_POLE_OUTSIDE_BOUNDARY&&(n|=2),n},f.prototype.hW=function(r,n){var t=this.hf.ef,i=this.hf.Yf,h=t.Sb(),s=i.Sb(),o=e.O.Fu(Math.min(r.I(),64)),a=e.Ta.jg(r);h==3&&(h=(t=(r=t.Ji).fk()).Sb(),a=r.$k(a,!0),this.wp(r,e.bm.forward,a),a=r.Zk(a,!0)),r=null,s==3&&(s=(i=(r=i.Ji).fk()).Sb());var u=h==2;h=(s=s==2)?i.sc():i;var c=!s&&!this.Uv;if(u){if((a=e.zb.UI(a,t,this.lo,n)).B())return a}else{var l=new e.l;a.xc(l);var p=t.Oe();if((l.Gp.H)&&(l=e.l.construct(l.v-1,p.G,l.C+1,p.H),(a=e.ri.Nu(a,l,t,NaN,0,n)).B()))return a}var y=NaN;u&&(y=t.zi()),l=i.Wr()!=null,p=this.mH;var d=!isNaN(p);if(d&&(a=e.Xl.local().V(a,p,n)),this.aH)u&&e.zb.ur(t,y,a,o),d&&(u=t.hh(),p*=(y=t.sc().hh())/u),e.zb.tr(this.hf,a,c,o),d&&(u=t.sc().hh(),p*=(y=i.sc().hh())/u),t=a;else{var g=new e.Ta(a.description);g.DD(a),u&&(e.zb.ur(t,y,g,o),d&&(u=t.hh(),p*=(y=t.sc().hh())/u)),e.zb.tr(this.hf,g,c,o),d&&(u=t.sc().hh(),p*=(y=i.sc().hh())/u),c=NaN,s?c=i.zi():isNaN(this.Bm)||(c=this.Bm),u=f.tv(t)|f.tv(i),y=10*h.Xd(0),this.Uv&&(u=3,y=0),t=e.zb.VQ(a,t,g,h,c,n,u,y)}return l&&(t=e.zb.XD(t,i,n)),s&&(t=e.zb.Mz(t,i,this.Qm,n),d&&(t=e.Xl.local().V(t,p,n)),e.zb.Lx(i,t,o)),t.B()||r!=null&&(t=r.Zk(t,!1),this.wp(r,e.bm.reverse,t),t=r.$k(t,!1)),t},f.prototype.eW=function(r,n){var t=(r.ca()+r.R())/400;return t!=0?(t=e.Xl.local().V(r,t,n),t=this.VI(t,n),n=r.Ia(),t.bn(n)):(n=new e.Sa(r.Ip()),t=this.XI(n),n=r.Ia(),t.B()?n.Oa():(r.copyTo(n),r=t.D(),n.K(r.x,r.y,r.x,r.y))),n},f.prototype.fW=function(r,n){r=e.aa.jg(r);var t=this.hf.ef,i=this.hf.Yf,h=t.Sb(),s=i.Sb(),o=e.O.Fu(Math.min(r.I(),64));if(h==3){var a=t.Ji;h=(t=a.fk()).Sb(),r=a.Zk(r,!0),this.wp(a,e.bm.forward,r),r=a.$k(r,!0)}if(h==2){if(this.lo==e.si.Clip?r=e.Xj.local().V(r,t.ml(),t,n):t.Wc()&&(h=new e.l,r.xc(h),t.Oe().contains(h)||(this.lo==e.si.PannableFold&&(r=e.zb.lj(r,t)),e.zb.Jt(r,t.Oe(),t.Xd(0),!0),r=e.zb.Fn(r,t,0,!0,0,n))),r.B())return r;e.zb.ur(t,0,r,o)}else e.zb.Jt(r,t.Oe(),t.Xd(0),!0);return e.zb.tr(this.hf,r,!1,o),t=0,h=!1,a=null,s==3&&(h=!0,s=(i=(a=i.Ji).fk()).Sb()),(s=s==2)?t=i.zi():isNaN(this.Bm)||(t=this.Bm),s&&this.Qm!=e.si.Clip||(r=e.zb.Fn(r,i.sc(),t,!1,0,n)),s&&(r=e.zb.Mz(r,i,this.Qm,n),e.zb.Lx(i,r,o),r.B())||h&&(r=a.Zk(r,!0),this.wp(a,e.bm.reverse,r),r=a.$k(r,!0)),r},f.prototype.wp=function(r,n,t){var i=t.I();if(i!=0){for(var h=t.ub(0),s=e.O.lg(200,0),o=[],a=0;ah.v+s&&an?this.wv(t,i):this.gv(t,i);case 1:var h=this.wv(t,i);return t=this.gv(t,i),e.lc.hq(h,t,n);case 2:throw e.i.fa("not implemented")}throw e.i.Qa()},r.prototype.fe=function(n,t){var i=this.pa-this.sa,h=this.la-this.na,s=i*i+h*h;return s==0?.5:(n=((n.x-this.sa)*i+(n.y-this.na)*h)/s,t||(0>n?n=0:1(t=(t-this.na)/n)||1(t=(t-this.sa)/n)||1(t=8881784197001252e-31*(Math.abs(i.x*t.y)+Math.abs(i.y*t.x)))?-1:n<-t?1:0},r.prototype.rp=function(n,t,i,h){var s=this.sa,o=this.na,a=n-s,u=t-o;if((a=Math.sqrt(a*a+u*u))<=Math.max(i,6661338147750939e-31*a))return h&&a==0?NaN:0;if(a=n-this.pa,u=t-this.la,(a=Math.sqrt(a*a+u*u))<=Math.max(i,6661338147750939e-31*a))return h&&a==0?NaN:1;if(a=this.pa-this.sa,u=this.la-this.na,0<(h=Math.sqrt(a*a+u*u))){var c=1/h,l=n-s,p=t-o,y=l*(a*=c)+p*(u*=c),d=17763568394002505e-31*(Math.abs(l*a)+Math.abs(p*u)),g=a;if(a=-u,u=g,y<-(d=Math.max(i,d))||y>h+d)return NaN;if(Math.abs(l*a+p*u)<=Math.max(i,17763568394002505e-31*(Math.abs(l*a)+Math.abs(p*u)))&&(.5>=(a=e.O.Rk(y*c,0,1))?(u=this.sa+(this.pa-this.sa)*a,h=this.na+(this.la-this.na)*a):(u=this.pa-(this.pa-this.sa)*(1-a),h=this.la-(this.la-this.na)*(1-a)),e.h.Oy(u,h,n,t)<=i)){if(.5>a){if(e.h.Oy(u,h,s,o)<=i)return 0}else if(e.h.Oy(u,h,this.pa,this.la)<=i)return 1;return a}}return NaN},r.prototype.Nb=function(n){return n!=null&&(n==this||n.constructor===this.constructor&&this.FM(n))},r.prototype.rD=function(n,t,i){var h=i?this.sa:this.pa;i=i?this.na:this.la;var s=new e.h;return s.x=n.pa-h,s.y=n.la-i,!(t.Qh(s)>6661338147750939e-31*t.fD(s))||(s.x=n.sa-h,s.y=n.na-i,t.Qh(s)<=6661338147750939e-31*t.fD(s))},r.prototype.qD=function(n){var t=new e.h;return t.x=this.pa-this.sa,t.y=this.la-this.na,!!this.rD(n,t,!1)&&(t.Sq(),!!this.rD(n,t,!0))},r.NM=function(n,t){var i=n.uu(t.sa,t.na),h=n.uu(t.pa,t.la);return!(0>i&&0>h||0i&&0>h||0(h=t.Qb())?n.qD(t):t.qD(n)))},r.LM=function(n,t,i){var h=e.h.construct(NaN,NaN),s=n.pa-n.sa,o=n.la-n.na,a=t.pa-t.sa,u=t.la-t.na,c=a*o-s*u;if(c==0)return h;var l=8881784197001252e-31*(Math.abs(a*o)+Math.abs(s*u)),p=t.sa-n.sa,y=t.na-n.na,d=a*y-p*u,g=d/c,b=Math.abs(c);return g<-(a=(8881784197001252e-31*(Math.abs(a*y)+Math.abs(p*u))*b+l*Math.abs(d))/(c*c)+2220446049250313e-31*Math.abs(g))||g>1+a||(a=(u=s*y-p*o)/c)<-(s=(8881784197001252e-31*(Math.abs(s*y)+Math.abs(p*o))*b+l*Math.abs(u))/(c*c)+2220446049250313e-31*Math.abs(a))||a>1+s||(g=e.O.Rk(g,0,1),s=e.O.Rk(a,0,1),o=n.hc(g),c=t.hc(s),(l=new e.h).uc(o,c),l.length()>i&&(l.add(o,c),l.scale(.5),g=n.fe(l,!1),s=t.fe(l,!1),n=n.hc(g),t=t.hc(s),n.sub(t),n.length()>i)||h.ma(g,s)),h},r.OM=function(n,t,i,h){var s=0;if((n.sa==t.sa&&n.na==t.na||n.sa==t.pa&&n.na==t.la)&&(s++,!h))return 1;if(n.pa==t.sa&&n.la==t.na||n.pa==t.pa&&n.la==t.la){if(++s==2)return 2;if(!h)return 1}return t.vi(n.sa,n.na,i)||t.vi(n.pa,n.la,i)||n.vi(t.sa,t.na,i)||n.vi(t.pa,t.la,i)?1:h&&s!=0||r.NM(n,t)==0?0:1},r.Zx=function(n,t,i,h,s,o){var a=0,u=n.rp(t.sa,t.na,o,!1),c=n.rp(t.pa,t.la,o,!1),l=t.rp(n.sa,n.na,o,!1),p=t.rp(n.pa,n.la,o,!1);return isNaN(u)||(h!=null&&(h[a]=u),s!=null&&(s[a]=0),i!=null&&(i[a]=e.h.construct(t.sa,t.na)),a++),isNaN(c)||(h!=null&&(h[a]=c),s!=null&&(s[a]=1),i!=null&&(i[a]=e.h.construct(t.pa,t.la)),a++),a==2||isNaN(l)||u==0&&l==0||c==0&&l==1||(h!=null&&(h[a]=0),s!=null&&(s[a]=l),i!=null&&(i[a]=e.h.construct(n.sa,n.na)),a++),a==2||isNaN(p)||u==1&&p==0||c==1&&p==1||(h!=null&&(h[a]=1),s!=null&&(s[a]=p),i!=null&&(i[a]=e.h.construct(t.pa,t.la)),a++),0h[1]&&(n=h[0],h[0]=h[1],h[1]=n,s!=null&&(h=s[0],s[0]=s[1],s[1]=h),i!=null&&(s=e.h.construct(i[0].x,i[0].y),i[0]=i[1],i[1]=s)),a):(a=r.LM(n,t,o),isNaN(a.x)?0:(i!=null&&(i[0]=n.hc(a.x)),h!=null&&(h[0]=a.x),s!=null&&(s[0]=a.y),1))},r.prototype.eG=function(){return 0},r.prototype.op=function(){},r.prototype.toString=function(){return"Line: ["+this.sa.toString()+", "+this.na.toString()+", "+this.pa.toString()+", "+this.la.toString()+"]"},r}(e.SC);e.yb=v}(k||(k={})),function(e){var v=function(){function f(){this.Jm=[],this.ya=-1}return f.prototype.La=function(){return this.ya},f.prototype.next=function(){if(this.Jm!=null&&this.Jm.length!=0){this.ya++;var r=this.Jm[0];return this.Jm=1>=this.Jm.length?[]:this.Jm.slice(1),r}return this.Jm=null},f.prototype.ZX=function(r){this.Jm.push(r)},f.prototype.qe=function(){},f}();e.gL=v}(k||(k={})),function(e){var v;(v=e.SL||(e.SL={}))[v.enumFillRuleOddEven=0]="enumFillRuleOddEven",v[v.enumFillRuleWinding=1]="enumFillRuleWinding";var f=function(r){function n(t,i){var h=r.call(this)||this;if(h.xf=!1,h.Eq=null,h.sq=0,h.rq=0,h.Aj=null,h.Mg=!1,h.nb=null,h.mb=null,h.Ve=null,h.Lj=null,h.Sd=null,h.tq=0,h.gb=0,h.xq=0,i===void 0)h.xf=t,h.Mg=!1,h.tq=0,h.sq=0,h.rq=0,h.wa=0,h.description=e.ee.og();else{if(i==null)throw e.i.N();h.xf=t,h.Mg=!1,h.tq=0,h.sq=0,h.rq=0,h.wa=0,h.description=i}return h.Aj=null,h.gb=0,h}return J(n,r),n.prototype.tm=function(){return 0i)throw e.i.Qa();if(this.dc(t)){if(this.mb==null)throw e.i.Qa();var h=this.wa,s=this.Ba(t),o=this.Vc(t);this.dm(this.wa+1),this.mc();for(var a=0,u=this.description.Aa;at;i--)h=this.nb.read(i),this.nb.write(i,h+1);this.mb.KE(t,1)}},n.prototype.Ap=function(){if(this.wx(),t===void 0){this.Mg=!1;var t=this.da()-1}var i=this.mb.read(t);this.mb.write(t,1|i),this.Ve!=null&&(t=this.Vc(t)-1,this.Ve.write(t,1),this.Lj.write(t,-1))},n.prototype.dc=function(t){return(1&this.mb.read(t))!=0},n.prototype.Nn=function(t){if(this.dc(t))return!0;var i=this.Ba(t);return!(i>(t=this.Vc(t)-1))&&(i=this.Na(i),t=this.Na(t),i.qb(t))},n.prototype.yv=function(t){return(2&this.mb.read(t))!=0},n.prototype.oc=function(t,i){if(this.Jl(t.description),t.getType()!=322)throw e.i.Qa();var h=new e.Sa;(i||this.B())&&(t.To(h),this.nf(h)),t.Po(h),this.lineTo(h)},n.prototype.tp=function(t){var i=this.wa==0;this.sx(t.v,t.G),this.yj(t.v,t.H),this.yj(t.C,t.H),this.yj(t.C,t.G),this.Ap(),this.Mg=!1,i&&this.Lf(256,!1)},n.prototype.ad=function(t,i){if(!t.B()){for(var h=this.wa==0,s=new e.Sa(this.description),o=0;4>o;o++)t.Hf(i?4-o-1:o,s),o==0?this.nf(s):this.lineTo(s);this.Ap(),this.Mg=!1,h&&!i&&this.Lf(256,!1)}},n.prototype.add=function(t,i){for(var h=0;hi&&(i=t.da()-1),i>=t.da()||0>h||0>s||s>t.rv(i))throw e.i.fa("index out of bounds");if(s!=0){var a=t.dc(i)&&h+s==t.rv(i);if(!a||s!=1){if(this.Mg=!1,this.Jl(t.description),h=t.Ba(i)+h+1,o&&(s++,h--),a&&s--,a=this.wa,this.dm(this.wa+s),this.mc(),o){if(s==0)return;this.nb.add(this.wa),o=t.mb.read(i),o&=-5,this.xf&&(o|=1),this.mb.write(this.mb.size-1,o),this.mb.add(0)}else this.nb.write(this.mb.size-1,this.wa);o=0;for(var u=this.description.Aa;op||t.za[p]==null?this.za[o].Ln(l*a,e.ra.se(c),s*l,l*a):this.za[o].Mn(l*a,t.za[p],l*h,s*l,!0,l,l*a)}if(this.tm()||t.yv(i))throw e.i.Qa();this.Pc(1993)}}},n.prototype.oJ=function(){for(var t=0,i=this.da();t=this.da())throw e.i.N();var i=this.Ba(t),h=this.Ja(t);t=this.dc(t)?1:0;for(var s=0,o=this.description.Aa;st&&(t=i-1),t>=i)throw e.i.N();for(var h=this.Ba(t),s=this.Ja(t),o=0,a=this.description.Aa;o=i.da())throw e.i.N();var o=this.da();if(t>o)throw e.i.N();0>t&&(t=o),0>h&&(h=i.da()-1),this.Mg=!1,this.Jl(i.description),i.mc();var a=i.Ba(h),u=i.Ja(h),c=this.wa,l=i.dc(h)&&!s?1:0;this.dm(this.wa+u),this.mc();for(var p=t=t+1;s--)a=this.nb.read(s-1),this.nb.write(s,a+u);for(i.yv(h),this.mb.add(0),s=o-1;s>=t+1;s--)o=this.mb.read(s),o&=-5,this.mb.write(s+1,o);o=i.JR().read(h),o&=-5,this.xf&&(o|=1),this.mb.write(t,o)},n.prototype.Hz=function(t,i){var h=-1,s=this.da();if(h>s)throw e.i.N();0>h&&(h=s),this.Mg=!1;var o=this.wa;this.dm(this.wa+i),this.mc();var a=h=h+1;o--)a=this.nb.read(o-1),this.nb.write(o,a+i);for(this.mb.add(0),o=s-1;o>=h+1;o--)i=this.mb.read(o),i&=-5,this.mb.write(o+1,i);this.xf&&this.mb.write(h,1)},n.prototype.qG=function(t,i,h){var s=-1;if(0>t&&(t=this.da()),t>this.da()||s>this.Ja(t)||h>i.length)throw e.i.fa("index out of bounds");if(h!=0){t==this.da()&&(this.nb.add(this.wa),this.xf?this.mb.add(1):this.mb.add(0)),0>s&&(s=this.Ja(t)),this.mc();var o=this.wa;this.dm(this.wa+h),this.mc();for(var a=0,u=this.description.Aa;at&&(t=this.da()),t>=s||i>this.Ja(t))throw e.i.fa("index out of bounds");t==this.da()&&(this.nb.add(this.wa),this.xf?this.mb.add(1):this.mb.add(0)),0>i&&(i=this.Ja(t));var o=this.wa;this.dm(this.wa+1),this.mc();var a=this.Ba(t);this.za[0].vj(2*(a+i),h,2*o),h=1;for(var u=this.description.Aa;ht&&(t=h-1),t>=h||i>=this.Ja(t))throw e.i.fa("index out of bounds");this.mc();var s=this.Ba(t);0>i&&(i=this.Ja(t)-1),i=s+i,s=0;for(var o=this.description.Aa;s=t+1;h--)i=this.nb.read(h),this.nb.write(h,i-1);this.wa--,this.Pg--,this.Pc(1993)},n.prototype.uE=function(t,i,h){var s=this.Ba(t)+i;if((h=this.Ba(h)+void 0)s||h>this.I()-1)throw e.i.N();i=0,(t=this.Ga()).Vb(s);do{for(;t.Ha()&&(s=t.ha(),t.wb()!=h);)i+=s=s.Qb();if(t.wb()==h)break}while(t.$a());return i},n.prototype.fO=function(t,i,h){if(i=this.Ba(t)+i,h=this.Ba(t)+h,0>i||h>this.I()-1)throw e.i.N();var s=this.Ga();if(i>h){if(!this.dc(t))throw e.i.N("cannot iterate across an open path");s.JB()}var o=t=0;s.Vb(i);do o+=t,t=s.ha().Qb();while(s.wb()!=h);return o},n.prototype.mg=function(){return e.pi.gm(this,null)},n.prototype.KS=function(t,i,h){for(var s=t;si){var a=this.tm(),u=0;i=this.wa}else a=this.yv(i),u=this.Ba(i),i=this.Vc(i);for(;u=this.Ba(i))return i;i--}else i++;if(0<=i&&i=this.Ba(i)&&th){for(i=0;ii;){var s=i+(h-i>>1);if(t=(i=this.Vc(s))))return this.gb=s;i=s+1}}return this.gb=i},n.prototype.yz=function(){var t=this.I();if(!this.xf){t-=this.da();for(var i=0,h=this.da();ih.RR()))return!0;this.Bb.yD(null)}return h=e.Nx.create(this,t,i),this.Bb.yD(h),!0},n.prototype.cc=function(){var t=r.prototype.cc.call(this);if(!this.Ac()){var i=this.da();this.nb!=null&&this.nb.An(t,0,i+1),this.mb!=null&&this.mb.An(t,0,i)}return t},n.prototype.ZF=function(t){return this.Ve!=null?this.Ve.read(t):1},n.prototype.bc=function(t,i,h){var s=this.sz(t);if(t==this.Vc(s)-1&&!this.dc(s))throw e.i.fa("index out of bounds");this.mc();var o=this.Ve,a=1;if(o!=null&&(a=7&o.read(t)),a!==1)throw e.i.Qa();if(i.Or(),i=i.get(),h?i.Nf(e.ee.og()):i.Nf(this.description),s=t==this.Vc(s)-1&&this.dc(s)?this.Ba(s):t+1,o=new e.h,this.D(t,o),i.Dc(o),this.D(s,o),i.Qc(o),!h)for(h=1,o=this.description.Aa;h=this.da())throw e.i.N();if(this.B())i.Oa();else{if(this.yv(t))throw e.i.fa("not implemented");var h=this.ub(0),s=new e.h,o=new e.l;o.Oa();var a=this.Ba(t);for(t=this.Vc(t);athis.I())&&(t=e.ta.nE(this),this.Bb.WM(t),!0)},n.prototype.hM=function(){if(this.Bb==null&&(this.Bb=new e.Uk),this.Bb.zo==null){this.Bb.xD(null);var t=e.ta.YN(this);this.Bb.xD(t)}},n.prototype.Yo=function(t){this.xq=t},n.prototype.In=function(){return this.xq},n.prototype.DD=function(t){if(this==t)throw e.i.fa("MultiPathImpl.add");for(var i=this.da(),h=0;h=(i=this.Vc(i))||ti?n.I():i,0>t||t>n.I()||it?i:t,0>i||0>t)throw e.i.N();if(t!=0){i=t-0,t=this.wa,this.resize(this.wa+i);for(var h=0;hn||n>=this.I())throw e.i.fa("index out of bounds");this.mc();for(var t=0,i=this.description.Aa;tt||t>=this.wa||in?n:f},v.Th=function(f,r){var n=5381;return((n=((n=((n=r!==void 0?(r<<5)+r+(255&f):(n<<5)+n+(255&f))<<5)+n+(f>>8&255))<<5)+n+(f>>16&255))<<5)+n+(f>>24&255)&2147483647},v.uj=function(){throw Error("Not Implemented")},v.bB=function(f){return v.aU(f)+12345&2147483647},v.XG=function(f){var r=32,n=f%v.Qx|0,t=f/v.Qx|0;return(r&=63)==0?f:(32>r?(f=n>>>r|t<<32-r,r=t>>r):(f=t>>r-32,r=0<=t?0:-1),r*v.Qx+(f>>>0))},v.aU=function(f){var r=1103515245,n=65535&r;return((r-n)*(f|=0)|0)+(n*f|0)|0},v.truncate=function(f){return 0>f?-1*Math.floor(Math.abs(f)):Math.floor(f)},v.MAX_SAFE_INTEGER=Math.pow(2,53)-1,v.MIN_SAFE_INTEGER=-v.MAX_SAFE_INTEGER,v.VC=65536,v.Qx=v.VC*v.VC,v}()}(k||(k={})),function(e){var v;(v=e.CL||(e.CL={}))[v.Project=0]="Project",v[v.Union=1]="Union",v[v.Difference=2]="Difference",v[v.Proximity2D=3]="Proximity2D",v[v.Relate=4]="Relate",v[v.Equals=5]="Equals",v[v.Disjoint=6]="Disjoint",v[v.Intersects=7]="Intersects",v[v.Within=8]="Within",v[v.Contains=9]="Contains",v[v.Crosses=10]="Crosses",v[v.Touches=11]="Touches",v[v.Overlaps=12]="Overlaps",v[v.Buffer=13]="Buffer",v[v.Distance=14]="Distance",v[v.Intersection=15]="Intersection",v[v.Clip=16]="Clip",v[v.Cut=17]="Cut",v[v.DensifyByLength=18]="DensifyByLength",v[v.DensifyByAngle=19]="DensifyByAngle",v[v.LabelPoint=20]="LabelPoint",v[v.GeodesicBuffer=21]="GeodesicBuffer",v[v.GeodeticDensifyByLength=22]="GeodeticDensifyByLength",v[v.ShapePreservingDensify=23]="ShapePreservingDensify",v[v.GeodeticLength=24]="GeodeticLength",v[v.GeodeticArea=25]="GeodeticArea",v[v.Simplify=26]="Simplify",v[v.SimplifyOGC=27]="SimplifyOGC",v[v.Offset=28]="Offset",v[v.Generalize=29]="Generalize",v[v.SymmetricDifference=30]="SymmetricDifference",v[v.ConvexHull=31]="ConvexHull",v[v.Boundary=32]="Boundary",v[v.SimpleRelation=33]="SimpleRelation";var f=function(){function r(){}return r.prototype.getType=function(){return null},r.prototype.wn=function(){},r.prototype.Iu=function(){return!1},r}();e.Je=f}(k||(k={})),function(e){var v=function(f){function r(){return f!==null&&f.apply(this,arguments)||this}return J(r,f),r.prototype.getType=function(){return 13},r.local=function(){return r.instance===null&&(r.instance=new r),r.instance},r.prototype.V=function(n,t,i,h,s){return n instanceof e.aa?(s=new e.Zc(n),this.V(s,t,[i],!1,h).next()):h===!0?(i=new e.BC(n,t,i,!1,s),e.Gh.local().V(i,t,s)):new e.BC(n,t,i,!1,s)},r.instance=null,r}(e.Je);e.AC=v}(k||(k={})),function(e){var v=function(){function f(r,n,t,i,h){this.ya=-1,this.Rd=r,this.$z=n,this.Cs=t,this.tT=new e.l,this.tT.Oa(),this.eo=-1,this.Ub=h}return f.prototype.next=function(){for(var r;(r=this.Rd.next())!=null;)return this.ya=this.Rd.La(),this.eo+1=r.I():r.da()==1&&(2>=r.I()||e.Zt.JG(r,0)))},f}();e.DC=v}(k||(k={})),function(e){var v=function(f){function r(){return f!==null&&f.apply(this,arguments)||this}return J(r,f),r.prototype.getType=function(){return 17},r.local=function(){return r.instance===null&&(r.instance=new r),r.instance},r.prototype.V=function(n,t,i,h,s){return new e.nL(n,t,i,h,s)},r.instance=null,r}(e.Je);e.mL=v}(k||(k={})),function(e){var v=function(){function f(r,n,t,i,h){if(this.Tf=null,n==null||t==null)throw e.i.fa("invalid argument");this.qT=r,this.nA=n,this.lH=t,r=e.ta.mv(n,t),this.qa=e.ta.Wd(i,r,!0),this.kH=-1,this.nd=h}return f.prototype.La=function(){return 0},f.prototype.next=function(){return this.RQ(),++this.kHthis.Tf.length&&(this.Tf.length=0)},f.prototype.SQ=function(){var r=new e.ia(0),n=new e.gd,t=n.aF(),i=n.Ib(this.nA),h=n.Ib(this.lH),s=new e.Fg;try{s.Ft(n,this.qa,this.nd),s.dl(t,i,h,r);var o=n.Ne(i),a=new e.Da,u=new e.Da;for(this.Tf.length=0,this.Tf.push(a),this.Tf.push(u),i=0;i=t)throw e.i.N();return new e.oL(n,t,i)},r.instance=null,r}(e.Je);e.Xl=v}(k||(k={})),function(e){var v=function(){function f(r,n){this.ya=-1,this.Rd=r,this.Ps=n}return f.prototype.La=function(){return this.ya},f.prototype.next=function(){var r;return(r=this.Rd.next())!=null?(this.ya=this.Rd.La(),this.NP(r)):null},f.prototype.NP=function(r){if(r.B()||1>r.Db())return r;var n=r.getType();if(n==1736||n==1607)return this.Ny(r);if(e.aa.yd(n))return this.PP(r);if(n==197)return this.OP(r);throw e.i.Qa()},f.prototype.PP=function(r){if(r.Qb()<=this.Ps)return r;var n=new e.Ta(r.description);return n.oc(r,!0),this.Ny(n)},f.prototype.OP=function(r){var n=new e.Da(r.description);n.ad(r,!1);var t=new e.l;return r.A(t),r=t.ca(),t.R()<=this.Ps&&r<=this.Ps?n:this.Ny(n)},f.prototype.Ny=function(r){for(var n=r.Ia(),t=r.Ga();t.$a();)for(var i=!0;t.Ha();){var h=t.ha();if(h.getType()!=322)throw e.i.fa("not implemented");var s=t.On(),o=h.Qb();if(o>this.Ps){var a=Math.ceil(o/this.Ps);o=new e.Sa(r.description),i&&(h.To(o),n.nf(o));var u=i=1/a,c=0;for(--a;co)return n;var a=n.getType(),u=t.getType(),c=new e.l,l=new e.l,p=new e.l;n.A(c),t.A(l),p.K(c),p.Zb(l);var y=(p=e.ta.Wd(i,p,!0))*Math.sqrt(2)*1.00001,d=new e.l;if(d.K(c),d.W(y,y),!d.isIntersecting(l))return n;if(s==1&&o==2)return r.KV(n,t,u,i,h);if(a==33)switch(e.Vk.yd(u)?(i=new e.Ta(t.description),i.oc(t,!0)):i=t,u){case 1736:return r.XU(n,i,p);case 1607:return r.YU(n,i,p);case 550:return r.VU(n,i,p);case 197:return r.UU(n,i,p);case 33:return r.WU(n,i,p);default:throw e.i.N()}else if(a==550)switch(u){case 1736:return r.nU(n,t,p);case 197:return r.lU(n,t,p);case 33:return r.mU(n,t,p)}return e.Fg.im(n,t,i,h)},r.XU=function(n,t,i){return e.hd.KG(t,n,i)==0?n:n.Ia()},r.YU=function(n,t,i){var h=n.D();t=t.Ga();for(var s=i*Math.sqrt(2)*1.00001,o=s*s,a=new e.l;t.$a();)for(;t.Ha();){var u=t.ha();if(u.A(a),a.W(s,s),a.contains(h)){if(u.qs(h,i))return n.Ia();var c=u.ac();if(e.h.yc(h,c)<=o||(c=u.wc(),e.h.yc(h,c)<=o))return n.Ia()}}return n},r.VU=function(n,t,i){var h=t.ub(0);t=t.I();var s=n.D(),o=new e.h;i=i*Math.sqrt(2)*1.00001,i*=i;for(var a=0;at.I()?this.gE(n,t,i):(this.Nt(),n=this.gE(t,n,i),this.Nt(),n):n.getType()==550&&e.aa.Hc(t.getType())?(n=this.hE(t,n,i),this.Nt(),n):t.getType()==550&&e.aa.Hc(n.getType())?this.hE(n,t,i):n.getType()==550&&t.getType()==550?n.I()>t.I()?this.iE(n,t):(this.Nt(),n=this.iE(t,n),this.Nt(),n):0},r.prototype.gE=function(n,t,i){var h=n.Ga(),s=t.Ga(),o=new e.l,a=new e.l,u=17976931348623157e292;if(!i&&this.pY(n,t,h,s))return 0;for(;h.$a();)for(;h.Ha();)if((n=h.ha()).A(o),!(o.px(this.oh)>u)){for(;s.$a();)for(;s.Ha();)if((t=s.ha()).A(a),o.px(a)o)){for(var l=0;lh)){for(var l=0;lr.Ja(n))){var h=r.Ba(n),s=r.Vc(n)-1,o=r.ub(0),a=r.dc(n),u=new e.ia(0);u.Jb(r.Ja(n)+1);var c=new e.ia(0);for(c.Jb(r.Ja(n)+1),u.add(a?h:s),u.add(h),h=new e.h;1this.DH&&a>s&&(h=i,s=a)}return h},f.prototype.qe=function(){},f}();e.sL=v}(k||(k={})),function(e){var v=function(f){function r(){return f!==null&&f.apply(this,arguments)||this}return J(r,f),r.prototype.getType=function(){return 29},r.prototype.V=function(n,t,i,h){return n instanceof e.aa?(n=new e.Zc(n),this.V(n,t,i,h).next()):new e.sL(n,t,i,h)},r.local=function(){return r.instance===null&&(r.instance=new r),r.instance},r.instance=null,r}(e.Je);e.EC=v}(k||(k={})),function(e){var v=function(f){function r(){return f!==null&&f.apply(this,arguments)||this}return J(r,f),r.prototype.getType=function(){return 21},r.local=function(){return r.instance===null&&(r.instance=new r),r.instance},r.prototype.V=function(n,t,i,h,s,o,a,u){return n instanceof e.aa?(u=new e.Zc(n),this.V(u,t,i,[h],s,o,!1,a).next()):a===!0?(i=new e.GC(n,t,i,h,s,!1,!1,u),e.Gh.local().V(i,t,u)):new e.GC(n,t,i,h,s,!1,!1,u)},r.instance=null,r}(e.Je);e.FC=v}(k||(k={})),function(e){var v=function(){function f(r,n,t,i,h,s,o,a){if(s)throw e.i.Ie();if(n==null)throw e.i.N();this.ya=-1,this.Ms=r,this.vg=n,this.ze=t,this.Cs=i,this.$n=h,this.eo=-1,this.Ub=a,this.uT=new e.l,this.uT.Oa()}return f.prototype.next=function(){for(var r;(r=this.Ms.next())!=null;)return this.ya=this.Ms.La(),this.eo+1n.Db())return 0;if(i==4)throw e.i.Ie();var h=e.cb.sc(t),s=e.cb.vv(h),o=e.cb.ev(h);s*=2-s;var a=h.Hd().ai,u=n.getType();if(u==1736||u==197)var c=n.mg();else e.aa.yd(u)?(c=new e.Ta(n.description)).oc(n,!0):c=n;if(h.Nb(t)==0){if(e.cb.Wc(t)){c=e.Hh.lj(c,t),u==1607&&c==n&&(c=e.aa.jg(n)),n=new e.Nc,e.cb.gh(t).cn(n),u=0;for(var l=c.I();u=this.Fi||7h||t==0&&n==550&&this.Dj==33?this.nJ():f.HB(r,i);if((this.Fi==-1||this.Fi==4)&&n==197&&this.Dj==197)return t=this.Se,n=new e.l,r.A(n),i=new e.l,t.A(i),n.Ea(i),t=new e.Fh,r.copyTo(t),t.Xo(n),t;if(n==197&&e.aa.tf(this.Dj)==0||this.Dj==197&&e.aa.tf(n)==0)return i=n==197?r:this.Se,r=n==197?this.Se:r,n=new e.l,i.A(n),e.Ud.clip(r,n,t,0);if(e.aa.tf(n)==0&&0a&&(a=t.yz()),s=t.I()+i.I(),a*i.I()>Math.log(s)*s*4)return null;s=null,a=i.Ga(),u!=null&&u.Fb!=null&&(s=u.Fb),s==null&&20w){if(s!=null)for(i==null?i=s.vR(j,h):i.Uo(j,h),w=i.next();w!=-1;w=i.next()){a.Vb(s.ja(w)),w=a.ha();var M=j.Ea(w,null,c,null,h);for(w=0;wm?(y=u.wb()-t.Ba(x),d=1,m=m==0?3:2):d++:(r.oc(A,m==0),m=1);break;case 0:m=0,y=-1,d=0;break;default:return null}A=N}}}else{if(0>(w=this.QD(n,j.ac(),h)))return null;w==1?(2>m&&(y=u.wb()-t.Ba(x),m=m==0?3:2),d++):(y=-1,d=0)}l.clear(!1)}else w!=0&&w==1&&(m==0?(m=3,y=u.wb()-t.Ba(x)):m==1?(m=2,y=u.wb()-t.Ba(x)):d++)}2<=m&&(r.Dr(t,x,y,d,m==3),y=-1)}return r},f.prototype.QD=function(r,n,t){return e.Dg.wm(r,n,t)},f.prototype.RD=function(r,n,t){var i=n.ac();n=n.wc();var h=e.Dg.wm(r,i,t),s=e.Dg.wm(r,n,t);return h==1&&s==0||h==0&&s==1?-1:h==0||s==0?0:h==1||s==1?1:((h=new e.h).add(i,n),h.scale(.5),(r=e.Dg.wm(r,h,t))==0?0:r==1?1:-1)},f.HB=function(r,n){return n?r:r.Ia()},f.prototype.nJ=function(){return this.yH==null&&(this.yH=this.Se.Ia()),this.yH},f.prototype.qe=function(){},f}();e.HC=v}(k||(k={})),function(e){var v=function(f){function r(){return f!==null&&f.apply(this,arguments)||this}return J(r,f),r.prototype.getType=function(){return 28},r.local=function(){return r.instance===null&&(r.instance=new r),r.instance},r.prototype.V=function(n,t,i,h,s,o,a){return n instanceof e.aa?(n=new e.Zc(n),this.V(n,t,i,h,s,o,a).next()):new e.xL(n,t,i,h,s,o,a)},r.instance=null,r}(e.Je);e.IC=v}(k||(k={})),function(e){var v=function(){function f(r,n,t,i,h,s,o){this.ya=-1,this.Rd=r,this.Mj=n,this.Ka=t,this.Ki=i,this.CA=h,this.uH=s,this.nd=o}return f.prototype.next=function(){var r=this.Rd.next();return r!=null?(this.ya=this.Rd.La(),this.jL(r)):null},f.prototype.La=function(){return this.ya},f.prototype.jL=function(r){var n=0>=this.uH?e.ta.kj(this.Mj,r,!1):this.uH;return e.IK.V(r,this.Ka,this.Ki,this.CA,n,this.nd)},f.prototype.qe=function(){},f}();e.xL=v}(k||(k={})),function(e){var v;(v=e.NK||(e.NK={}))[v.clipToDomainOnly=1]="clipToDomainOnly",v[v.clipWithHorizon=2]="clipWithHorizon",v[v.foldAndClipWithHorizon=3]="foldAndClipWithHorizon";var f=function(r){function n(){return r!==null&&r.apply(this,arguments)||this}return J(n,r),n.prototype.getType=function(){return 0},n.local=function(){return n.instance===null&&(n.instance=new n),n.instance},n.prototype.V=function(t,i,h){return t instanceof e.aa?(t=new e.Zc(t),this.V(t,i,h).next()):new e.yL(t,i,h)},n.prototype.transform=function(t,i,h,s){return e.bu.transform(t,i,h,s,!0)},n.prototype.Qt=function(t,i,h,s){return e.bu.Qt(t,i,h,s)},n.instance=null,n}(e.Je);e.Hx=f}(k||(k={})),function(e){var v=function(){function f(r,n,t){this.ya=-1,this.Rd=r,this.MT=n,this.nd=t}return f.prototype.next=function(){var r=this.Rd.next();return r!=null?(this.ya=this.Rd.La(),e.bu.zh(r,this.MT,this.nd)):null},f.prototype.La=function(){return this.ya},f.prototype.qe=function(){},f}();e.yL=v}(k||(k={})),function(e){var v=function(){function r(){}return r.prototype.reset=function(){this.ph=this.xk=-1,this.us=this.kq=!1},r.prototype.AQ=function(n,t,i){for(n.Vb(t,i);n.Ha();){var h=n.ha();if((h=h.Qb())!=0)return n.wb()}for(n.Vb(t,i);n.Ez();)if((h=(h=n.li()).Qb())!=0)return n.wb();return-1},r.prototype.BQ=function(n,t){for(n.Vb(t,-1);n.Ez();)if(n.li().Qb()!=0)return n.wb();return-1},r.prototype.zQ=function(n,t){for(n.Vb(t,-1),n.ha();n.Ha();)if(n.ha().Qb()!=0)return n.wb();return-1},r.prototype.yQ=function(n,t,i,h){if(this.xk=this.AQ(t,i,h),this.xk!=-1){t.Vb(this.xk,-1);var s=t.ha(),o=s.hc(s.fe(n,!1));if(i=e.h.yc(o,n),(h=new e.h).L(o),h.sub(s.ac()),(o=new e.h).L(n),o.sub(s.ac()),this.kq=0>h.wi(o),this.ph=this.zQ(t,this.xk),this.ph!=-1){t.Vb(this.ph,-1);var a=(s=t.ha()).fe(n,!1);a=s.hc(a);var u=e.h.yc(a,n);u>i?this.ph=-1:(h.L(a),h.sub(s.ac()),o.L(n),o.sub(s.ac()),this.us=0>h.wi(o))}this.ph==-1&&(this.ph=this.BQ(t,this.xk),this.ph!=-1&&(t.Vb(this.ph,-1),a=(s=t.ha()).fe(n,!1),a=s.hc(a),(u=e.h.yc(a,n))>i?this.ph=-1:(h.L(a),h.sub(s.ac()),o.L(n),o.sub(s.ac()),this.us=0>h.wi(o),n=this.xk,this.xk=this.ph,this.ph=n,n=this.kq,this.kq=this.us,this.us=n)))}},r.prototype.cO=function(n,t,i,h,s){return i=i.Ga(),this.yQ(n,i,h,s),this.xk!=-1&&this.ph==-1?this.kq:this.xk!=-1&&this.ph!=-1?this.kq==this.us?this.kq:(i.Vb(this.xk,-1),n=i.ha().kg(),i.Vb(this.ph,-1),t=i.ha().kg(),0<=n.wi(t)):t},r}(),f=function(r){function n(){return r!==null&&r.apply(this,arguments)||this}return J(n,r),n.local=function(){return n.instance===null&&(n.instance=new n),n.instance},n.prototype.getType=function(){return 3},n.prototype.nz=function(t,i,h){var s;if(s===void 0&&(s=!1),t.B())return new e.$l;i=i.D();var o=t,a=t.getType();switch(a==197&&((o=new e.Da).ad(t,!1),a=1736),a){case 33:return this.xI(o,i);case 550:return this.jI(o,i);case 1607:case 1736:return this.bU(o,i,h,s);default:throw e.i.fa("not implemented")}},n.prototype.oz=function(t,i){if(t.B())return new e.$l;i=i.D();var h=t,s=t.getType();switch(s==197&&((h=new e.Da).ad(t,!1),s=1736),s){case 33:return this.xI(h,i);case 550:case 1607:case 1736:return this.jI(h,i);default:throw e.i.fa("not implemented")}},n.prototype.pz=function(t,i,h,s){if(0>s)throw e.i.N();if(t.B())return[];i=i.D();var o=t,a=t.getType();switch(a==197&&((o=new e.Da).ad(t,!1),a=1736),a){case 33:return this.TU(o,i,h,s);case 550:case 1607:case 1736:return this.tU(o,i,h,s);default:throw e.i.fa("not implemented")}},n.prototype.bU=function(t,i,h,s){if(t.getType()==1736&&h&&(h=new e.l,t.A(h),h=e.ta.Wd(null,h,!1),(s?e.hd.Yd(t,i,0):e.hd.Yd(t,i,h))!=0)){var o=new e.$l(i,0,0);return s&&o.WJ(!0),o}var a=t.Ga();o=new e.h;for(var u=h=-1,c=17976931348623157e292,l=0;a.$a();)for(;a.Ha();){var p=a.ha();p=p.hc(p.fe(i,!1));var y=e.h.yc(p,i);ye.h.Uq(i,p.ac(),p.wc()),1=i||(t.length=s),t.slice(0)},n.instance=null,n}(e.Je);e.Ix=f}(k||(k={})),function(e){var v=function(f){function r(){return f!==null&&f.apply(this,arguments)||this}return J(r,f),r.prototype.getType=function(){return 4},r.prototype.V=function(n,t,i,h,s){return e.am.yB(n,t,i,h,s)},r.local=function(){return r.instance===null&&(r.instance=new r),r.instance},r.prototype.Iu=function(n){return e.Vt.wy(n)},r.prototype.wn=function(n,t,i){e.Vt.CD(n,t,i)},r.instance=null,r}(e.Je);e.zL=v}(k||(k={})),function(e){var v=function(f){function r(){return f!==null&&f.apply(this,arguments)||this}return J(r,f),r.prototype.getType=function(){return 33},r.prototype.V=function(n,t,i,h,s){return n===1073741824?!e.ud.zB(t,i,h,4,s):e.ud.zB(t,i,h,n,s)},r.local=function(){return r.instance===null&&(r.instance=new r),r.instance},r.prototype.Iu=function(n){return e.Vt.wy(n)},r.prototype.wn=function(n,t,i){e.Vt.CD(n,t,i)},r.instance=null,r}(e.Je);e.dj=v}(k||(k={})),function(e){var v=function(){function f(r,n,t,i){if(this.nd=i,this.rT=t,this.ya=-1,r==null)throw e.i.N();this.yk=r,this.Mj=n}return f.prototype.next=function(){var r;if((r=this.yk.next())!=null){if(this.ya=this.yk.La(),this.nd!=null&&!this.nd.progress(-1,-1))throw e.i.fu("user_canceled");return this.eC(r)}return null},f.prototype.La=function(){return this.ya},f.prototype.eC=function(r){if(r==null)throw e.i.N();return e.Jx.cK(r,this.Mj,this.rT,this.nd)},f.prototype.qe=function(){},f}();e.AL=v}(k||(k={})),function(e){var v=function(f){function r(){return f!==null&&f.apply(this,arguments)||this}return J(r,f),r.prototype.getType=function(){return 26},r.prototype.V=function(n,t,i,h){return n instanceof e.aa?(n=new e.Zc(n),this.V(n,t,i,h).next()):new e.AL(n,t,i,h)},r.prototype.rs=function(n,t,i,h,s){return 0<(h!==void 0?e.Jx.rs(n,t,i,h,s):e.Jx.rs(n,t,!1,null,i))},r.local=function(){return r.instance===null&&(r.instance=new r),r.instance},r.instance=null,r}(e.Je);e.Yl=v}(k||(k={})),function(e){var v=function(){function s(){this.yq=0}return s.prototype.nX=function(o){this.yq&=-2,this.yq|=o?1:0},s.prototype.Wp=function(){return(1&this.yq)!=0},s.prototype.XF=function(){return this.Wp()?0:1},s}();e.xY=v;var f=function(){},r=function(s,o,a,u){this.x=s,this.y=o,this.Ai=a,this.xm=u},n=function(){function s(o){this.Be=o}return s.prototype.compare=function(o,a,u){return o=o.ja(u),a=this.Be.lf.read(2*a),0>(a-=o=this.Be.lf.read(2*o))?-1:0p?1:0},s}(),i=function(){function s(o,a){this.YI=new e.h,this.parent=o,this.dS=a}return s.prototype.nr=function(o,a,u){var c=this.parent,l=this.dS;u.Vd(o,a,function(p,y){return c.Mh(p,y,l)})},s.prototype.$p=function(o){return o=this.parent.gi.get(o),this.parent.lf.tc(2*(o>>1),this.YI),this.YI.y+(1&o?this.parent.Oj:-this.parent.Oj)},s}(),h=function(){function s(o,a,u,c,l){this.nH=o.description,this.X=o,this.Qg=a,this.Oj=e.ta.kj(this.Qg,o,!1),this.Bo=e.ta.kj(this.Qg,o,!0),this.xA=u,this.oT=this.nH.Aa,this.hb=[],this.po=[],this.mh=new e.jp,this.fb=new e.Yj,this.ke=new e.Md,this.ZG=this.ql=l}return s.prototype.eT=function(){return this.ZG=!0,(!e.aa.Hc(this.X.getType())||this.GE()&&this.DE(!1))&&this.mO()?e.aa.Hc(this.X.getType())?this.pO()?this.X.getType()==1607?this.rO()?2:0:this.sO()?this.tO():0:0:2:0},s.prototype.kC=function(o,a){var u=this.lf.read(2*o);o=this.lf.read(2*o+1);var c=this.lf.read(2*a);a=this.lf.read(2*a+1);var l=!e.Yt.Cv(u,o,c,a,this.Oj*this.Oj);return l||this.X.Db()!=0&&u==c&&o==a},s.prototype.GE=function(){for(var o=this.X,a=o.xf?3:2,u=0,c=o.da();uthis.Oj)){if(o&&c){var p=l.wv(1,0);if(l=l.wv(1,0),Math.abs(l-p)>a)continue}return this.ke=new e.Md(2,u.wb(),-1),!1}}return!0},s.prototype.mO=function(){var o=this.X,a=null;e.aa.Hc(this.X.getType())&&(a=this.X);var u=(this.ZG||this.ql)&&a!=null,c=o.I();this.lf=o.ub(0),this.gi=new e.ia(0),this.gi.Jb(2*c),this.fi=new e.ia(0),this.fi.Jb(2*c),u&&(this.Fl==null&&(this.Fl=new e.ia(0)),this.Fl.Jb(c));for(var l=o=0;l=a.Vc(o);)o++;this.Fl.add(o)}for(new e.Xt().sort(this.fi,0,2*c,new i(this,u)),this.fb.clear(),this.fb.Vo(new n(this)),this.fb.De(c),a=0,c*=2;a>1,(1&o)==0){if(o=this.fb.addElement(u,-1),(l=this.fb.we(o))!=-1&&!this.kC(this.fb.ja(l),u))return this.ke=new e.Md(3,u,this.fb.ja(l)),!1;var p=this.fb.lb(o);if(p!=-1&&!this.kC(this.fb.ja(p),u))return this.ke=new e.Md(3,u,this.fb.ja(p)),!1}else if(o=this.fb.search(u,-1),l=this.fb.we(o),p=this.fb.lb(o),this.fb.vd(o,-1),l!=-1&&p!=-1&&!this.kC(this.fb.ja(l),this.fb.ja(p)))return this.ke=new e.Md(3,this.fb.ja(l),this.fb.ja(p)),!1;return!0},s.prototype.pO=function(){return 10>this.X.I()?this.nO():this.oO()},s.prototype.oO=function(){var o=new e.gd;o.Ib(this.X);var a=new e.Md;return!e.$t.kI(!1,o,this.Oj,a,this.nd)||(a.Jo=o.Ua(a.Jo),a.Ko=o.Ua(a.Ko),this.ke.Wt(a),!1)},s.prototype.nO=function(){var o=this.X,a=o.Ga();for(o=o.Ga();a.$a();)for(;a.Ha();){var u=a.ha();if(!a.Qn()||!a.$S()){o.BW(a);do for(;o.Ha();){var c=o.ha();if((c=u.zr(c,this.Oj,!0))!=0)return this.ke=new e.Md(c==2?5:4,a.wb(),o.wb()),!1}while(o.$a())}}return!0},s.prototype.sO=function(){var o=this.X;this.hb.length=0,this.po.length=0,this.Zf=o.Ga(),this.Zf.JB();var a=new e.ia(0);a.Jb(10);var u=NaN,c=0,l=0;for(o=2*o.I();l>=1;var y=this.lf.read(2*p),d=this.lf.read(2*p+1);if(a.size!=0&&(y!=u||d!=c)){if(!this.RI(a))return!1;a!=null&&a.clear(!1)}a.add(p),u=y,c=d}}return!!this.RI(a)},s.prototype.rO=function(){for(var o=this.X,a=Array(o.da()),u=0,c=o.da();u>1;this.lf.tc(2*p,l);var y=a[u=this.Fl.get(p)],d=o.Ba(u),g=o.Vc(u)-1;c.el=p==d||p==g,c.ny=this.ql?!y&&c.el:c.el,c.Ai=u,c.x=l.x,c.y=l.y,c.xm=p;for(var b=new f,x=1,m=this.fi.size;x>1,this.lf.tc(2*p,l),(u=this.Fl.get(p))!=c.Ai&&(y=a[u],d=o.Ba(u),g=o.Vc(u)-1);var w=p==d||p==g,j=this.ql?!y&&c.el:c.el;if(b.x=l.x,b.y=l.y,b.Ai=u,b.xm=p,b.ny=j,b.el=w,b.x==c.x&&b.y==c.y){if(this.ql){if(!(b.ny&&c.ny||b.Ai==c.Ai&&(b.el||c.el)))return this.ke=new e.Md(8,b.xm,c.xm),!1}else if(!b.el||!c.el)return this.ke=new e.Md(5,b.xm,c.xm),!1}u=c,c=b,b=u}return!0},s.prototype.JE=function(){for(var o=this.X,a=[],u=-1,c=!1,l=0,p=o.da();l>1;this.lf.tc(2*y,c),l=this.Fl.get(y),u=new r(c.x,c.y,l,y,a[l]),o=[];var d=1;for(p=this.fi.size;d>1,this.lf.tc(2*y,c),l=this.Fl.get(y),(l=new r(c.x,c.y,l,y,a[l])).x==u.x&&l.y==u.y){if(l.Ai==u.Ai)return this.ke=new e.Md(9,l.xm,u.xm),!1;0<=a[l.Ai]&&a[l.Ai]==a[u.Ai]&&(o.length!=0&&o[o.length-1]==u||o.push(u),o.push(l))}u=l}if(o.length==0)return!0;for(l=new e.jp(!0),e.O.$u(a,-1),c=-1,(d=new e.h).Rc(),u=0,p=o.length;u=o.Ke())return this.ke=new e.Md(6,o.da()==1?1:-1,-1),0;if(o.da()==1)return this.ql&&!this.JE()?0:2;this.to=e.ia.qf(o.da(),0),this.JA=e.ia.qf(o.da(),-1);for(var a=-1,u=0,c=0,l=o.da();cp?0:256),0a||u>=1,(c=this.lf.read(2*u+1))!=this.Mo&&o.size!=0){if(!this.ut(o))return 0;o!=null&&o.clear(!1)}o.add(u),this.Mo=c}return 0l.la){var y=this.Zf.wb(),d=this.Su(l,c,this.Zf.gb,!0);0o.Ja(a.gb))){u.EW();for(var b,x,m=!0;a.Ha();){var w=a.ha(),j=u.li();if(a.wb()>u.wb())break;m&&(d.add(a.wb()),g.add(u.ik()),m=!1),x=d.Fc();var M=a.ik();if(1this.Bo?d.add(a.ik()):p&&(b=o.Uc(1,d.Fc(),0),w=w.gv(1,0),Math.abs(w-b)>y&&d.add(a.ik())),x>this.Bo?g.add(u.wb()):p&&(b=o.Uc(1,g.Fc(),0),w=j.gv(1,0),Math.abs(w-b)>y&&g.add(u.wb()))}if(d.Fc()g.size?d.If():g.If():(d.Fc()!=g.Fc()&&g.If(),g.If()),2<=g.size+d.size){for(m=new e.Sa,j=0,w=d.size;j>1;var l=c>>1,p=new e.h,y=new e.h;return this.lf.tc(2*a,p),p.y+=1&o?this.Oj:-this.Oj,this.lf.tc(2*l,y),y.y+=1&c?this.Oj:-this.Oj,(o=p.compare(y))==0&&u?0>(u=this.Fl.get(a)-this.Fl.get(l))?-1:0l.x)return 1;if(c.yl.y)return 1;for(c=1;cg)return 1}}return 0},s.prototype.PO=function(o,a){var u=this.Ou(o,a);return u==0?oa?1:0o?n:t;if(n.B())return t;if(t.B())return n;var a=new e.l,u=new e.l,c=new e.l;return n.A(a),t.A(u),c.K(a),c.Zb(u),a=e.ta.Wd(i,c,!0),u=n.getType(),c=t.getType(),u==33&&c==33?r.aV(n,t,a):u!=c?0o?n:t:u==550?r.iI(n,t,a):r.iI(t,n,a):e.Fg.ep(n,t,i,h)},r.aV=function(n,t,i){i=i*Math.sqrt(2)*1.00001,i*=i;var h=n.D(),s=t.D(),o=new e.de(n.description);return e.h.yc(h,s)>i&&(o.add(n),o.add(t)),o},r.iI=function(n,t,i){var h=n.ub(0),s=n.I(),o=t.D(),a=n.Ia();i=i*Math.sqrt(2)*1.00001;var u=new e.l;if(n.A(u),u.W(i,i),u.contains(o)){i*=i,u=!1;for(var c=[],l=0;lthis.zk||0>this.bo)throw e.i.Qa();if(this.AH[this.bo])break}return this.ya++,this.fG(this.bo)}return this.ya=0,this.bo=this.zk,this.fG(this.zk)},n.prototype.La=function(){return this.ya},n.prototype.qK=function(){if(this.Ic)return!0;var t=null;if(this.Rd!=null&&(t=this.Rd.next())==null&&(this.Ic=!0,this.Rd=null),e.mp.zp(this.Ub),t!=null){var i=t.Db();this.AH[i]=!0,i>=this.zk&&!this.jA&&(this.ND(i,!1,t),i>this.zk&&!this.jA&&this.zW(i))}if(0this.Do.length)for(var o=0,a=Math.max(2,t+1);oi?e.F.Wq(l,c,u,p,0):e.F.Wq(l,u,c,p,0),d=[0,0,0],g=[0,0,0];var m=[0,0,0];u=[0,0,0],y=[0,0,0];var w=Math.acos(p[2]/1),j=1-r,M=Math.tan(w),A=1+M*M/j,z=2*l[2]*M/j;for(j=(-z+(M=Math.sqrt(z*z-4*A*(l[2]*l[2]/j-1))))/(A*=2),z=(-z-M)/A,M=Math.tan(w),w=(j+z)/2,l=((A=M*j+l[2])+(M*z+l[2]))/2,M=e.F.gp(j-w,A-l),j=l/x*1.570796326794897,z=0;100>z&&(A=(A=e.F.w(r,j))*A/Math.cos(j)*(Math.sin(j)-l*A/(1-r)),!e.s.Cd(A));z++)j-=A;l=e.F.n(1,r,j)*Math.cos(j),M=1-M/(l=Math.sqrt((l-w)*(l+w))),M*=2-M,A=e.F.on(d),w=e.F.on(g),j=e.F.on(m);var N=e.F.St(m,d);z=e.F.St(m,g),e.F.zx(m,d,u),e.F.zx(m,g,y),d=Math.acos(N/(j*A)),g=Math.acos(z/(j*w)),g*=e.s.Mb(1,e.F.St(u,y)),(1.570796326794897<=e.s.P(d)&&1.570796326794897<=e.s.P(g)||3.141592653589793y&&0>i)&&(i=e.F.ba(i+3.141592653589793)),s!=null&&(s.u=u),o!=null&&(o.u=y),a!=null&&(a.u=i)}}},v.rf=function(f,r,n,t,i,h,s,o){var a=[0,0,0],u=[0,0,0],c=[0,0,0],l=[0,0,0],p=[0,0,0],y=[0,0,0],d=[0,0,0],g=[0,0,0,0],b=new e.ga(0),x=new e.ga(0),m=new e.ga(0),w=new e.ga(0),j=new e.ga(0),M=new e.ga(0);if(s!=null&&o!=null)if(e.s.ti(r))e.Yg.rf(f,n,t,i,h,s,o);else if(e.s.Cd(i))s!=null&&(s.u=n),o!=null&&(o.u=t);else if(h=e.F.ba(h),0>i&&(i=e.s.P(i),h=e.F.ba(h+3.141592653589793)),n=e.F.ba(n),t=e.F.ba(t),1.570796326794897h?e.F.Wq(d,p,a,g,0):e.F.Wq(d,a,p,g,0),a=Math.acos(g[2]/1),g=Math.atan2(-g[1],-g[0]),t=1-r,j=1+(p=Math.tan(a))*p/t,t=(-(w=2*d[2]*p/t)+(p=Math.sqrt(w*w-4*j*(d[2]*d[2]/t-1))))/(j*=2),w=(-w-p)/j,p=Math.tan(a),a=(t+w)/2,d=((j=p*t+d[2])+(p*w+d[2]))/2,p=e.F.gp(t-a,j-d),A=d/A*1.570796326794897,t=0;100>t&&(w=(w=e.F.w(r,A))*w/Math.cos(A)*(Math.sin(A)-d*w/(1-r)),!e.s.Cd(w));t++)A-=w;A=e.F.n(1,r,A)*Math.cos(A),d=1-p/(A=Math.sqrt((A-a)*(A+a))),d*=2-d,y=Math.acos(e.F.St(y,u)/(e.F.on(y)*e.F.on(u))),y*=e.s.Mb(1,u[0]),h=(e.F.q(A,d,e.F.Qj(d,y))+f*e.s.Mb(1,h))/e.F.Ah(A,d),h=e.F.ba(1.570796326794897*h),h=e.F.Rq(d,h),e.F.n(A,d,h),p=e.F.ba(g+n),n=Math.cos(p),h=Math.sin(p),c[0]=l[0]*n+l[1]*-h,c[1]=l[0]*h+l[1]*n,c[2]=l[2],e.F.jO(r,c[0],c[1],c[2],m,x,b),s!=null&&(s.u=x.u),o!=null&&(o.u=m.u)}},v}()}(k||(k={})),function(e){var v=function(){function i(h){this.Ya=null,this.wt=new e.h,this.xt=new e.h,this.g=h}return i.prototype.compare=function(h,s,o){return this.g.Gc(s,this.wt),this.g.Gc(h.ja(o),this.xt),this.wt.compare(this.xt)},i}(),f=function(){function i(h){this.Bf=new e.h,this.Dk=new e.h,this.g=h}return i.prototype.Dh=function(h){this.Bf.L(h)},i.prototype.compare=function(h,s){return this.g.Gc(h.ja(s),this.Dk),this.Bf.compare(this.Dk)},i}(),r=function(i){function h(s){var o=i.call(this,s.g,s.qa,!1)||this;return o.ib=s,o}return J(h,i),h.prototype.compare=function(s,o,a){if(this.rg)return-1;var u=this.ib.Qd.Jn(this.ib.Rh(o));s=s.ja(a);var c=this.ib.Qd.Jn(this.ib.Rh(s));return this.Dm=a,this.RE(o,u,s,c)},h}(e.UC),n=function(i){function h(s){var o=i.call(this,s.g,s.qa)||this;return o.ib=s,o}return J(h,i),h.prototype.compare=function(s,o){return this.rg?-1:(s=this.ib.Qd.Jn(this.ib.Rh(s.ja(o))),this.Dm=o,this.SE(o,s))},h}(e.aM),t=function(){function i(){this.Mc=this.df=this.jo=this.Qd=this.lh=this.zd=this.hb=this.g=null,this.Ng=!1,this.vh=this.Nm=this.ie=this.Gk=this.nh=this.Ak=this.Ff=this.$d=null,this.xh=this.Jq=this.UA=this.qa=0,this.Xv=this.Wn=!1,this.yo=new e.h,this.Pi=new e.h,this.hb=new e.$c(8),this.zd=new e.$c(5),this.lh=new e.au,this.Qd=new e.au,this.Ng=!1,this.vh=new e.h,this.vh.ma(0,0),this.qa=0,this.xh=-1,this.Wn=!1,this.g=null,this.df=new e.Yj,this.Mc=new e.Yj,this.nh=new e.ia(0),this.Gk=new e.TC,this.Ff=new e.ia(0),this.Ak=new e.ia(0),this.jo=new e.Sa}return i.prototype.PX=function(h,s){var o=new e.Dd;return o.$B(),h.Oc(o),this.er(h),this.Wn=!1,this.qa=s,this.UA=s*s,s=this.jC(),h.Oc(o),s||(this.qQ(),s||this.jC()),this.xh!=-1&&(this.g.Td(this.xh),this.xh=-1),this.g=null,this.Wn},i.prototype.TX=function(h,s){this.er(h),this.Wn=!1,this.qa=s,this.UA=s*s,this.Ng=!1,this.jC(),this.Ng||(this.Ng=h.Gp(s,!0,!1)==1),this.xh!=-1&&(this.g.Td(this.xh),this.xh=-1),this.g=null},i.prototype.pg=function(h,s){return this.hb.T(h,0+s)},i.prototype.LB=function(h,s,o){this.hb.S(h,0+s,o)},i.prototype.Rh=function(h){return this.hb.T(h,2)},i.prototype.ZW=function(h,s){this.hb.S(h,2,s)},i.prototype.RF=function(h,s){return this.hb.T(h,3+s)},i.prototype.Pp=function(h){return this.hb.T(h,7)},i.prototype.Pl=function(h,s){this.hb.S(h,7,s)},i.prototype.Rp=function(h,s){return this.hb.T(h,3+this.Op(h,s))},i.prototype.fr=function(h,s,o){this.hb.S(h,3+this.Op(h,s),o)},i.prototype.NR=function(h,s){return this.hb.T(h,5+this.Op(h,s))},i.prototype.hr=function(h,s,o){this.hb.S(h,5+this.Op(h,s),o)},i.prototype.Sr=function(h){return this.zd.T(h,0)},i.prototype.UW=function(h,s){this.zd.S(h,0,s)},i.prototype.ez=function(h){return this.zd.T(h,4)},i.prototype.cr=function(h,s){this.zd.S(h,4,s)},i.prototype.il=function(h){return this.zd.T(h,1)},i.prototype.ln=function(h,s){this.zd.S(h,1,s)},i.prototype.dz=function(h){return this.zd.T(h,3)},i.prototype.Et=function(h,s){this.zd.S(h,3,s)},i.prototype.Ym=function(h){var s=this.zd.Ce(),o=this.lh.Ph();return this.UW(s,o),h!=-1?(this.lh.addElement(o,h),this.g.Ra(h,this.xh,s),this.cr(s,this.g.Ua(h))):this.cr(s,-1),s},i.prototype.HP=function(h){this.zd.jd(h)},i.prototype.LD=function(h,s){this.lh.addElement(this.Sr(h),s),this.g.Ra(s,this.xh,h)},i.prototype.nt=function(h){var s=this.hb.Ce(),o=this.Qd.Ph();return this.ZW(s,o),h!=-1&&this.Qd.addElement(o,h),s},i.prototype.MD=function(h,s){this.Qd.addElement(this.Rh(h),s)},i.prototype.Uu=function(h){this.hb.jd(h),0<=(h=this.nh.lF(h))&&this.nh.SV(h)},i.prototype.hj=function(h,s){if(this.pg(h,0)==-1)this.LB(h,0,s);else{if(this.pg(h,1)!=-1)throw e.i.Qa();this.LB(h,1,s)}this.ky(h,s)},i.prototype.ky=function(h,s){var o=this.il(s);if(o!=-1){var a=this.Rp(o,s);this.hr(a,s,h),this.fr(h,s,a),this.fr(o,s,h),this.hr(h,s,o)}else this.hr(h,s,h),this.fr(h,s,h),this.ln(s,h)},i.prototype.Op=function(h,s){return this.pg(h,0)==s?0:1},i.prototype.Xm=function(h,s){var o,a=this.dz(s);if(a!=-1&&(this.df.vd(a,-1),this.Et(s,-1)),(a=this.il(s))!=-1){var u=o=a;do{var c=!1,l=this.Op(o,s),p=this.RF(o,l);if(this.pg(o,l+1&1)==h){if(this.Xu(o),this.Qd.bh(this.Rh(o)),this.Uu(o),o==p){a=-1;break}a==o&&(a=this.il(s),u=p,c=!0)}o=p}while(o!=u||c);if(a!=-1){do l=this.Op(o,s),p=this.RF(o,l),this.LB(o,l,h),o=p;while(o!=u);(o=this.il(h))!=-1?(u=this.Rp(o,h),c=this.Rp(a,h),u==o?(this.ln(h,a),this.ky(o,h),this.ln(h,o)):c==a&&this.ky(a,h),this.fr(a,h,u),this.hr(u,h,a),this.fr(o,h,c),this.hr(c,h,o)):this.ln(h,a)}}for(a=this.Sr(h),o=this.Sr(s),u=this.lh.rc(o);u!=-1;u=this.lh.lb(u))this.g.Ra(this.lh.ja(u),this.xh,h);this.lh.Hy(a,o),this.HP(s)},i.prototype.UT=function(h,s){var o=this.pg(h,0),a=this.pg(h,1),u=this.pg(s,0),c=this.pg(s,1);this.Qd.Hy(this.Rh(h),this.Rh(s)),s==this.il(o)&&this.ln(o,h),s==this.il(a)&&this.ln(a,h),this.Xu(s),this.Uu(s),o==u&&a==c||a==u&&o==c||(this.Hn(o,this.yo),this.Hn(u,this.Pi),this.yo.qb(this.Pi)?(o!=u&&this.Xm(o,u),a!=c&&this.Xm(a,c)):(a!=u&&this.Xm(a,u),o!=c&&this.Xm(o,c)))},i.prototype.Xu=function(h){var s=this.pg(h,1);this.dF(h,this.pg(h,0)),this.dF(h,s)},i.prototype.dF=function(h,s){var o=this.Rp(h,s),a=this.NR(h,s),u=this.il(s);o!=h?(this.fr(a,s,o),this.hr(o,s,a),u==h&&this.ln(s,o)):this.ln(s,-1)},i.prototype.WD=function(h,s,o){var a=this.Qd.rc(h),u=this.Qd.ja(a);h=this.Le(u);var c=this.Le(this.g.U(u));for(this.g.jr(u,s,o,!0),a=this.Qd.lb(a);a!=-1;a=this.Qd.lb(a)){u=this.Qd.ja(a);var l=this.Le(u)==h;this.g.jr(u,s,o,l)}a=s.Vp(o,0).ac(),s=s.Vp(o,s.ol(o)-1).wc(),this.BK(h,a),this.BK(c,s)},i.prototype.ZE=function(h,s,o){var a=this.Rh(h),u=this.pg(h,0),c=this.pg(h,1),l=this.nt(-1);for(this.nh.add(l),this.Pl(l,-3),this.Ff.add(l),this.hj(l,u),h=1,s=s.ol(o);hthis.ez(l)&&this.cr(l,this.g.Ua(c))),l=this.Ff.get(h),h-=2,this.MD(l,c),c=this.g.U(c);while(0<=h)}this.Ff.clear(!1)},i.prototype.Le=function(h){return this.g.Pa(h,this.xh)},i.prototype.TI=function(h,s,o){var a=this.pg(s,0),u=new e.h;this.Hn(a,u);var c=new e.h,l=this.pg(s,1);this.Hn(l,c);var p=o.ol(h),y=o.Vp(h,0),d=new e.h;if(y.Yp(d),!u.qb(d)){if(!this.Ng){var g=u.compare(this.vh);0>g*(d=d.compare(this.vh))&&(this.Ng=!0)}this.vF(a,this.Ff),this.Ak.add(a)}for(!this.Ng&&1y.compare(this.vh))&&(this.Ng=!0)),h=(y=o.Vp(h,p-1)).wc(),c.qb(h)||(this.Ng||0>(g=c.compare(this.vh))*(d=h.compare(this.vh))&&(this.Ng=!0),this.vF(l,this.Ff),this.Ak.add(l)),this.Ff.add(s),c=0,l=this.Ff.size;cMath.max(100,this.g.fd)){this.nh.clear(!1),this.Ng=!0;break}var h=this.nh.Fc();this.nh.If(),this.Pl(h,-1),this.WS(h)!=-1&&this.wS(h),this.Vn=!1}},i.prototype.wS=function(h){if(this.Vn){var s=this.Mc.zu(this.MH,this.GH,h,!0);this.Vn=!1}else s=this.Mc.KD(h);s==-1?this.UT(this.Mc.ja(this.Mc.FF()),h):(this.Pl(h,s),this.$d.rg&&(this.$d.Kr(),this.oF(this.$d.Dm,s)))},i.prototype.WS=function(h){var s=this.pg(h,0);if(h=this.pg(h,1),this.Hn(s,this.yo),this.Hn(h,this.Pi),e.h.yc(this.yo,this.Pi)<=this.UA)return this.Ng=!0,-1;var o=this.yo.compare(this.vh),a=this.Pi.compare(this.vh);return 0>=o&&0=a&&0h&&(this.re(n),h=this.description.Pf(n)),this.ka==null&&this.un(),this.ka[this.description.$j(h)+t]=i},r.prototype.getType=function(){return 33},r.prototype.Db=function(){return 0},r.prototype.Oa=function(){this.vc(),this.ka!=null&&(this.ka[0]=NaN,this.ka[1]=NaN)},r.prototype.sn=function(n){if(this.ka!=null){for(var t=e.ee.Iw(n,this.description),i=[],h=0,s=0,o=n.Aa;s>>32),n=e.O.Th(h,n)}return n},r.prototype.mg=function(){return null},r}(e.aa);e.Sa=v}(k||(k={})),function(e){var v=function(){function f(r,n,t){r!==void 0&&(this.x=r,this.y=n,this.z=t)}return f.construct=function(r,n,t){var i=new f;return i.x=r,i.y=n,i.z=t,i},f.prototype.K=function(r,n,t){this.x=r,this.y=n,this.z=t},f.prototype.lx=function(){this.z=this.y=this.x=0},f.prototype.normalize=function(){var r=this.length();r==0&&(this.x/=r,this.y/=r,this.z/=r)},f.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},f.prototype.sub=function(r){return new f(this.x-r.x,this.y-r.y,this.z-r.z)},f.prototype.Ag=function(r){new f(this.x*r,this.y*r,this.z*r)},f.prototype.Qh=function(r){return this.x*r.x+this.y*r.y+this.z*r.z},f}();e.Nd=v}(k||(k={})),function(e){var v=function(){function f(r,n,t){this.Gw=this.DA=null,this.Xf=n,this.FT=n.y-t,this.ET=n.y+t,this.Ew=0,this.dA=r,this.qa=t,this.RT=t*t,this.eA=t!=0,this.Lv=!1}return f.prototype.result=function(){return this.Ew!=0?1:0},f.prototype.ZM=function(r){return r=r.hc(r.fe(this.Xf,!1)),e.h.yc(r,this.Xf)<=this.RT},f.prototype.fF=function(r){if(!this.eA&&(this.dA&&this.Xf.qb(r.ac())||this.Xf.qb(r.wc())))this.Lv=!0;else if(r.na==this.Xf.y&&r.na==r.la){if(this.dA&&!this.eA){var n=Math.max(r.sa,r.pa);this.Xf.x>Math.min(r.sa,r.pa)&&this.Xf.xn?t=!0:this.Xf.x>=Math.min(r.sa,r.pa)&&(t=0r.wc().y?1:-1)}}},f.prototype.SI=function(r){var n=r.Tg(0,1);if(n.oa>this.ET||n.vathis.Xf.y||n.va(r=r.I()))&&2*r+Math.log(r)/Math.log(2)*n<1*r*n},f}();e.Dg=v}(k||(k={})),function(e){var v=function(f){function r(n){return f.call(this,!0,n)||this}return J(r,f),r.prototype.Ia=function(){return new r(this.description)},r.prototype.Db=function(){return 2},r.prototype.getType=function(){return 1736},r.prototype.xG=function(n,t,i){this.JS(n,t,i)},r.prototype.qR=function(){this.FR()},r}(e.Vk);e.Da=v}(k||(k={})),function(e){(function(v){v[v.PiPOutside=0]="PiPOutside",v[v.PiPInside=1]="PiPInside",v[v.PiPBoundary=2]="PiPBoundary"})(e.RL||(e.RL={})),e.hd=function(){function v(){}return v.KG=function(f,r,n){return(f=e.Dg.bT(f,r,n))==0?0:f==1?1:2},v.Yd=function(f,r,n){return(f=e.Dg.wm(f,r,n))==0?0:f==1?1:2},v.WX=function(f,r,n,t,i){if(r.lengthr?(0>r?r+=360:360<=r&&(r-=360),r):(0>(r=e.lc.RK(r))&&(r+=360),r)},f.gP=function(r){return 180<(r=f.hP(r))&&(r-=360),r},f.oW=57.29577951308232,f}();e.qr=v,e.Hh=function(){function f(){}return f.lj=function(r,n){var t=new e.l;r.A(t);var i=e.cb.gh(n),h=new e.l;return h.K(i),h.v=t.v,h.C=t.C,h.W(.01*h.ca(),0),n=e.ta.Wd(n,t,!1),h.contains(t)?r:e.Ud.clip(r,h,n,0)},f.ks=function(r,n,t,i,h){if(!e.cb.Wc(n))throw e.i.N();var s=e.ta.kj(n,r,!1),o=e.cb.gh(n),a=e.cb.sc(n),u=a.Hd().ai,c=e.cb.vv(a);a=e.cb.ev(a),c*=2-c;var l=new e.Nc;o.cn(l);var p=[[0,0],[0,0]];if(e.Eg.Sb(n)==2?i?(p[0][0]=f.Zm(h,l),p[0][1]=o.Jp(),e.cb.vt(),o=p[0][0]*u):(p[0][0]=o.gk(),p[0][1]=h,e.cb.vt(),o=p[0][1]*u):o=h*u,!i&&o!=0)throw e.i.N();var y=new e.ga,d=new e.gd;r=d.Ib(r);for(var g=[0],b=new e.h,x=new e.h,m=new e.h,w=new e.h,j=new e.h,M=new e.h,A=d.Ob(r);A!=-1;A=d.Rb(A)){var z=d.Xa(A);d.D(z,m);for(var N=!1,I=z=d.U(z);I!=-1;I=d.U(I)){if(I==z){if(N)break;N=!0}if(d.D(I,w),i&&ss||ss||!i&&s<-m.y&&w.y>s||s<-w.y&&m.y>s)do if(!(Math.abs(m.x-w.x)>=.5*l.R())){if(e.Eg.Sb(n)==2?(p[0][0]=f.Zm(m.x,l),p[0][1]=m.y,p[1][0]=f.Zm(w.x,l),p[1][1]=w.y,e.cb.dW(),j.x=p[0][0]*u,j.y=p[0][1]*u,M.x=p[1][0]*u,M.y=p[1][1]*u):(j.x=m.x*u,j.y=m.y*u,M.x=w.x*u,M.y=w.y*u),M.x=6.283185307179586*(w.x-m.x)/l.R()+j.x,i){if(x.x=o,x.y=f.Nz(a,c,j,M,o,t),isNaN(x.y))break}else{if(x.x=f.Lz(a,c,j,M,t),isNaN(x.x))break;x.y=0}e.kb.wd(a,c,j.x,j.y,M.x,M.y,y,null,null,t);var C=y.u;e.kb.wd(a,c,j.x,j.y,x.x,x.y,y,null,null,t);var T=y.u;e.Eg.Sb(n)==2?(p[0][0]=x.x/u,p[0][1]=x.y/u,e.cb.bR(),i?(b.y=p[0][1],b.x=h):(b.x=f.os(p[0][0],m.x,w.x,l),b.y=h)):i?(b.x=h,b.y=x.y/u):(b.x=f.os(x.x/u,m.x,w.x,l),b.y=h),g[0]=0i.x)var o=i;else o=t,t=i;i=new e.ga(0);var a=new e.ga(0),u=new e.ga(0);e.kb.wd(r,n,o.x,o.y,t.x,t.y,a,i,null,s);var c=a.u,l=0,p=1,y=new e.h;for(y.L(o);c*(p-l)>1e-12*r;){var d=.5*(l+p);if(e.kb.oj(r,n,o.x,o.y,c*d,i.u,a,u,s),y.x=a.u,y.y=u.u,y.x==h)break;if(f.Sn(o.x,y.x,h))p=d;else{if(!f.Sn(t.x,y.x,h))return NaN;l=d}}return y.y},f.Sn=function(r,n,t){return r=v.Cp(r),n=v.mx(r,v.Cp(n)),(t=v.mx(r,v.Cp(t)))==0||0n&&0>t&&t>=n},f.Zm=function(r,n){var t=n.va-n.oa;return n.It(r-Math.floor((r-n.oa)/t)*t)},f.os=function(r,n,t,i){var h=new e.Nc;for(h.K(n,t),t=i.R(),r=Math.floor((r-n)/t)*t+r,h=h.sf();Math.abs(r-h)>Math.abs(r+t-h);)r+=t;return r},f.Lz=function(r,n,t,i,h){if(t.y>i.y)var s=i;else s=t,t=i;if((i=new e.Nc).K(s.y,t.y),!i.contains(0)||3.141592653589793<=Math.abs(s.x-t.x))return NaN;if(s.x==t.x)return s.x;var o=new e.ga(0),a=new e.ga(0),u=new e.ga(0);e.kb.wd(r,n,s.x,s.y,t.x,t.y,a,o,null,h);var c=a.u,l=0,p=1,y=new e.h;for(y.L(s);c*(p-l)>1e-12*r;){var d=.5*(l+p);if(e.kb.oj(r,n,s.x,s.y,c*d,o.u,a,u,h),y.x=a.u,y.y=u.u,i.K(s.y,y.y),y.y==0)break;if(i.contains(0))p=d;else{if(i.K(t.y,y.y),!i.contains(0))return NaN;l=d}}return y.x},f.Hp=function(r,n,t,i,h,s,o){var a=new e.l;if(r.A(a),a.B())return r;var u=new e.Nc;a.cn(u);var c=new e.Nc;if(c.K(n,n+t),c.contains(u)&&c.va!=u.va)return r;var l=new e.l;l.K(a);var p=r.getType();if(p==33)return((a=(l=h?r:r.Of()).Lg())=c.va||o&&a==c.va)&&(a+=Math.ceil((c.oa-a)/t)*t,a=c.It(a),l.cC(a)),l;if(p==550){for(i=(l=h?r:r.Of()).ub(0),p=2*l.I(),r=!1,h=0;h=c.va||o&&a==c.va)&&(r=!0,a+=Math.ceil((c.oa-a)/t)*t,a=c.It(a),i.write(h,a));return r&&l.Pc(1993),l}if(c.contains(u))return r;if(p==197)return t=h?r:r.Of(),a.Ea(l),t.Xo(a),t;var y=.1*Math.max(a.ca(),a.R());for(l.W(0,y),o=r,c=i.Xd(0),r=e.Gh.local(),h=new e.Dd;;){var d=Math.floor((u.oa-n)/t),g=Math.ceil((u.va-n)/t);if(!(3l.v;)(y=e.Ud.clip(o,l,c,0)).A(u),(p==1607?!y.B()&&(u.R()>c||u.ca()>c):!y.B()&&(p!=1736||u.R()>c))&&(y.Oc(h),y.A(u),n.A(s),s.W(c,c),s.isIntersecting(u)&&p==1736?n=r.V(n,y,i,null):n.add(y,!1)),l.move(t,0),h.shift(-t,0);return n},f.WI=function(r,n,t,i){var h=new e.de(t.description);h.Fd(t,0,-1),h=e.cb.zh(h,r,n);var s=t.I();if(i.Oa(),!e.cb.Wc(r)||s!=h.I())return!1;var o=new e.l;t.A(o);var a=new e.l;if(h.A(a),o=o.R(),a=a.R(),o!=0&&a!=0){if(a/=o,r=e.cb.gh(n).R()/e.cb.gh(r).R(),1e-10=t[h]?i[h]=t[h].toUpperCase():t[h];return i.join()}return t.toString(e.Sc.PE_STR_AUTH_TOP)},n.ur=function(t,i,h,s){var o=s.length,a=h.I();if(a!=0){var u=h.ub(0),c=Math.min(a,o),l=0,p=t.eh();isNaN(i)&&(i=0);for(var y=t.Wc(),d=179*(t=y?t.sc().Oe().R():0)/360;0x*e.lc.sign(m)&&Math.abs(b)>d&&(s[g][0]+=-x*t)}u.uC(l<<1,c,s),l+=c,a-=c,c=Math.min(a,o)}h.Pc(1993)}},n.IL=function(t,i,h,s){var o=0,a=t.eh();isNaN(o)&&(o=0);var u=t.Wc(),c=t.bf();t=360*c,c*=179;for(var l=s.length,p=0;pm*e.lc.sign(b)&&Math.abs(x)>c&&(s[y][0]-=m*t)}e.ta.Iy(i,p,s,d),p+=d}}},n.Lx=function(t,i,h){var s=h.length,o=i.I();if(!(1>o)){var a=i.ub(0),u=Math.min(o,s),c=0,l=t.eh(),p=t.Wc(),y=p?t.Oe().R():0,d=179*y/360,g=0;for(p&&(g=t.zi());0x*e.lc.sign(m)&&Math.abs(b)>d&&(h[t][0]+=-x*y)}a.uC(c<<1,u,h),c+=u,o-=u,u=Math.min(o,s)}i.Pc(1993)}},n.HL=function(t,i,h,s){if(h!=0){var o=t.eh(),a=t.Wc(),u=a?t.Oe().R():0,c=179*u/360,l=0;for(a&&(l=t.zi()),t=0;tb*e.lc.sign(i[d].x-l)&&Math.abs(g)>c&&(s[p][0]-=b*u)}e.ta.Iy(i,t,s,y),t+=y}}}},n.tr=function(t,i,h,s){var o=i.I();if(o!=0){var a=i.ub(0),u=t.ef,c=t.Yf,l=u.sc().Qp(),p=c.sc().Qp(),y=u.bf(),d=c.bf();if((t=t.Wf)==null||t.count()==0){for(h=l/p,s=(u.Up()-c.Up())*d,p=-90*y,t=90*y,l=!1,d=1,u=2*o;dw?s[d][1]=w:s[d][1]<-w&&(s[d][1]=-w));for(y=0;yd){if(A){var V=I+(W+11*y&&(A=!1)}A||(S=K+(D-=e.lc.Cn(p,S-B)),++E,$=D!=0,R.x=S)}else G||e.ta.AG(U,H,R,N)&&(G=!0);$&&C.write(2*W,S),B=S,U.L(H),H.L(R)}0t?u=1:0>=c&&0.99*c&&(u=-1)):u=-1),u!=0&&((i=new e.Da(o.description)).tp(l),(i=e.Xl.local().V(i,h,a)).add(o,!1),w=!0,o=i),w&&(o=e.Yl.local().V(o,s,!1,a)),o},n.vQ=function(t,i,h,s,o){var a=h.I(),u=h.Na(0),c=h.Na(a-1);o=(s=n.dv(s,o)).R(),u=e.lc.sign(c.x-u.x);var l=new e.l;h.xc(l);var p=s.gk();if(c=p-o,p+=o,0<=u){var y=Math.ceil((c-l.v)/o);for(y*=o;c>l.v+y;)y+=o;for(;cl.v+y;)y+=o;d=y,720c;)1024<=m&&(m=0),g.move(y,0),b.Gb=y,h.Oc(b),x+=y,s.v<=x&&s.C>=x&&(o=l.I()-1),h.Cb(0,d),d=h.Na(a-1),l.Dr(h,0,0,a-1,!1);return h=new e.Da(l.description),a=0u?a:!a)?(u=e.h.construct(c.x,s.H),h.Ci(u),u=e.h.construct(s.gk(),s.H),h.Ci(u),s=e.h.construct(t.x,s.H)):(u=e.h.construct(c.x,s.G),h.Ci(u),u=e.h.construct(s.gk(),s.G),h.Ci(u),s=e.h.construct(t.x,s.G)),h.Ci(s),h.xG(0,i,0),h.kO(o),h},n.uQ=function(t,i,h,s,o){var a=new e.Da(t.description);a.add(t,!1),a.DB(0,a.I()-1);var u=new e.l;a.xc(u);var c=(h=n.dv(i,h)).R(),l=Math.ceil((h.v-u.v)/c);for(l*=c;h.v>u.v+l;)l+=c;for(;h.vu.C)return o&&(o=a.Ke(),i=(a=e.Yl.local().V(a,i,!0,s)).Ke(),(i=e.lc.sign(o)!=e.lc.sign(i))&&a.oJ()),a;for((t=new e.Da(t.description)).add(a,!1),o=o||u.R()>c-i.Xd(0);u.v=h){c=!0;break}if(2&o&&p.y<=-h){c=!0;break}}if(!c)return!1;a=!1,t&&(a=i.Nn(0)),u=(t=new e.gd).Ib(i),c=t.Ob(u);var y=-1,d=!0,g=new e.h;g.Rc(),l=new e.Sa;for(var b=-1,x=t.Xa(c);x!=-1;x=t.U(x)){p=t.Na(x);var m=1&o&&90<=p.y?1:0;if(m|=2&o&&p.y<=-h?2:0,0c){if(new e.l().K(g.v-u,-c,g.C+u,c),(o=e.ri.Nu(o,i,t,NaN,0,s)).B())return o;o.A(g)}if(x&&(i.Hg.H))return o.Ia();if(g.R()>p&&(o=n.Hp(o,y-l,p,t,!0,0,!0,s)).A(g),(c=n.eO(g.v,g.C,i.v,i.C,p))!=0&&g.move(c,0),g.C>i.C||g.vi.C)for(;g.v>=i.C;)g.move(-p,0),c-=p;for(;g.vc;c++){if(m?u=e.aa.Hc(a)?e.ri.clip(o,i,h,d,s):e.ri.clip(o,i,h,0,s):(u=e.Xj.local().V(o,b,t,s))==b&&(u=e.aa.jg(u)),i.v<=g.v&&i.C>=g.C||i.v>=g.v&&i.C<=g.C)return u;x[c]=u,c==0&&(g.move(-p,0),(u=new e.Dd).gg(-p,0),o.Oc(u))}if(a==550)x[0].Fd(x[1],0,-1);else if(e.aa.Hc(a))x[0].add(x[1],!1);else{if(a!=33)throw e.i.fa("intersect_with_GCS_horizon: unexpected geometry type");x[0].B()&&(x[0]=x[1])}return x[0]}if(i.Hg.H)return o;for(a=0;!o.B()&&g.C>i.v;)a!=0&&((u=new e.Dd).gg(a,0),o.Oc(u)),e.dj.local().V(4,o,b,t,s)||b==(o=e.kp.local().V(o,b,t,s))&&(o=e.aa.jg(o)),a!=0&&((d=new e.Dd).gg(-a,0),o.Oc(d)),a-=p,g.move(-p,0);return o},n.yG=function(t,i,h,s){if(i!=0&&s!=v.DontClip)if(s==v.PannableFold){s=h.HR();for(var o=i,a=0;as.H||t[a].yu||t[a].y<-u)&&(t[a].Rc(),o--);if(o!=0){(o=new e.l).Zw(t,i),u=h.Vr();var l=h.hv();a=u.getType()==197;var p=new e.l;if(u.A(p),!l||!(p.Ho.H))if(l)if(n.av(t,i,p.gk()-c,s),o=i,a)for(a=0;a=p||u&&y==p)&&(y+=Math.ceil((i-y)/h)*h,y=e.O.Rk(y,i,p),s.cC(y)),s}if(t.B()||(y=new e.l,t.A(y),y.B()))return t;var d=new e.Nc;y.cn(d);var g=new e.Nc;if(g.K(i,p),g.contains(d))return t;if((p=new e.l).K(y),l===550){for(c=(s=o?t:t.Of()).ub(0),l=2*s.I(),p=!1,i=0;i=g.va||u&&y==g.va)&&(p=!0,y+=Math.ceil((g.oa-y)/h)*h,y=g.It(y),c.write(i,y));return p&&s.Pc(1993),s}if(l==197)return h=o?t:t.Of(),y.Ea(p),h.Xo(y),h;var b=.1*Math.max(y.ca(),y.R());for(p.W(0,b),u=t,g=s.Xd(0),t=e.Gh.local(),o=new e.Dd;;){var x=Math.floor((d.oa-i)/h),m=Math.ceil((d.va-i)/h);if(!(3p.v;)(b=e.ri.clip(u,p,g,0,c)).A(d),(l==1607?!b.B()&&(d.R()>g||d.ca()>g):!b.B()&&(l!=1736||d.R()>g))&&(b.Oc(o),b.A(d),i.A(a),a.W(g,g),a.isIntersecting(d)&&l==1736?i=t.V(i,b,s,null):i.add(b,!1)),p.move(h,0),o.shift(-h,0);return i},n.av=function(t,i,h,s){for(var o=h+s,a=0;ao||u==o)||(u+=Math.ceil((h-u)/s)*s,u=e.O.Rk(u,h,o),t[a].x=u)}},n.Fn=function(t,i,h,s,o,a){if(!i.Wc())throw e.i.fa("fold_into_360_degree_range");if(t.B())return t;if(i.Sb()==2){h=i.pv();var u=i.ov()-h}else{var c=i.bf();u=360*c,h-=180*c}return n.Hp(t,h,u,i,s,o,!0,a)},n.qF=function(t,i,h,s){if(h.Sb()==2)s=h.pv(),h=h.ov()-s;else{var o=h.bf();h=360*o,s-=180*o}n.av(t,i,s,h)},n.lj=function(t,i){var h=i.Oe();if(t.getType()==33){var s=t.ih();return h.G<=s&&s<=h.H?t:t.Ia()}s=new e.l,t.A(s);var o=new e.l;return o.K(h),o.v=s.v,o.C=s.C,o.W(.01*o.ca(),0),h=e.ta.uy(i,s),o.contains(s)?t:e.ri.clip(t,o,h,0,null)},n.ir=function(t,i,h){return t>i.C&&t-i.Ch.H?t[o].Rc():t[o].x=n.ir(t[o].x,h,s)},n.Jt=function(t,i,h,s){if(!t.B()){var o=t.getType();if(!s||o!=1736)if(e.aa.xj(o)){s=t.ub(0),o=0;for(var a=t.I();os||ss)||!a&&(u!=0||s<-z.y&&N.y>s||s<-N.y&&z.y>s))do if(!(Math.abs(z.x-N.x)>=.5*d.R())){if(h.Sb()==2?(b[0][0]=n.Zm(z.x,d),b[0][1]=z.y,b[1][0]=n.Zm(N.x,d),b[1][1]=N.y,e.ej.projToGeogCenter(g,2,b,0),I.x=b[0][0]*l,I.y=b[0][1]*l,C.y=b[1][1]*l):(I.x=z.x*l,I.y=z.y*l,C.y=N.y*l),C.x=2*(N.x-z.x)*Math.PI/d.R()+I.x,a){if(j.x=c,j.y=n.Nz(p,y,I,C,c,o),isNaN(j.y))break;A[0]=j;var E=1}else if(o==r.GreatElliptic){var G=[0,0];if((E=e.Ox.Oz(y,I,C,c,G))==0)break;j.x=G[0],j.y=c,A[0]=j,E==2&&(M.x=G[1],M.y=c,A[1]=M)}else{if(j.x=n.Lz(p,y,I,C,o),isNaN(j.x))break;j.y=0,A[0]=j,E=1}var H=-1;for(G=0;Gm[0]||(H=t.Ma(B),t.Ul(H,m,1),t.Cb(t.U(H),w.x,w.y),H=m[0])}}while(!1);z.L(N)}}},n.Zm=function(t,i){var h=i.va-i.oa;return i.It(t-Math.floor((t-i.oa)/h)*h)},n.os=function(t,i,h,s){var o=new e.Nc;for(o.K(i,h),h=s.R(),t=Math.floor((t-i)/h)*h+t,o=o.sf();Math.abs(t-o)>Math.abs(t+h-o);)t+=h;return t},n.Sn=function(t,i,h){return t=e.qr.Cp(t),i=e.qr.mx(t,e.qr.Cp(i)),(h=e.qr.mx(t,e.qr.Cp(h)))==0||0i&&0>h&&h>=i},n.Nz=function(t,i,h,s,o,a){if(a==r.GreatElliptic)return e.Ox.SS(i,h,s,o);if(Math.abs(h.x-s.x)>=Math.PI||!n.Sn(h.x,s.x,o))return NaN;if(h.x>s.x)var u=s;else u=h,h=s;s=new e.ga;var c=new e.ga,l=new e.ga;e.kb.wd(t,i,u.x,u.y,h.x,h.y,c,s,null,a);var p=c.u,y=0,d=1,g=new e.h;for(g.L(u);p*(d-y)>1e-12*t;){var b=.5*(y+d);if(e.kb.oj(t,i,u.x,u.y,p*b,s.u,c,l,a),g.x=c.u,g.y=l.u,g.x==o)break;if(n.Sn(u.x,g.x,o))d=b;else{if(!n.Sn(h.x,g.x,o))return NaN;y=b}}return g.y},n.Lz=function(t,i,h,s,o){if(o==r.GreatElliptic)return t=[0,0],e.Ox.Oz(i,h,s,0,t),t[0];if(h.y>s.y)var a=s;else a=h,h=s;if((s=new e.Nc).K(a.y,h.y),!s.contains(0)||Math.abs(a.x-h.x)>=Math.PI)return NaN;if(a.x==h.x)return a.x;var u=new e.ga,c=new e.ga,l=new e.ga;e.kb.wd(t,i,a.x,a.y,h.x,h.y,c,u,null,o);var p=c.u,y=0,d=1,g=new e.h;for(g.L(a);p*(d-y)>1e-12*t;){var b=.5*(y+d);if(e.kb.oj(t,i,a.x,a.y,p*b,u.u,c,l,o),g.x=c.u,g.y=l.u,s.K(a.y,g.y),g.y==0)break;if(s.contains(0))d=b;else{if(s.K(h.y,g.y),!s.contains(0))return NaN;y=b}}return g.x},n.WI=function(t,i,h,s){if(!t.ef.Wc())return!1;var o=new e.de(i.description);if(o.Fd(i,0,-1),s=e.Hx.local().V(o,t,s),o=i.I(),h.Oa(),o!=s.I())return!1;var a=new e.l;i.A(a);var u=new e.l;if(s.A(u),a=a.R(),u=u.R(),a!=0&&u!=0){if(u/=a,t=t.Yf.gh().R()/t.ef.gh().R(),1e-10=180*i&&(t-=360*i),t},n.UI=function(t,i,h,s){if(h==v.Clip){var o=i.ml();o.getType()==197?(h=new e.l,o.A(h),o=e.ta.uy(i,h),t=e.ri.clip(t,h,o,5e4*i.pm(),s)):e.dj.local().V(1,o,t,i,s)||(t=e.Xj.local().V(t,o,i,s))==o&&(t=e.Vk.jg(t))}else i.Wc()&&(s=new e.l,t.xc(s),i.Oe().contains(s)||(n.Jt(t,i.Oe(),i.Xd(0),!0),h==v.PannableFold&&(t=n.lj(t,i)),t=n.Fn(t,i,0,!0,1e5*i.pm(),null)));return t},n.XD=function(t,i,h){var s=i.Wr();if(s==null)return t;var o=(i=i.sc()).Oe().R(),a=new e.l;t.xc(a);var u=new e.Nc;a.cn(u),a=s.Ga(),s=null;for(var c=new e.Dd;a.$a();)for(;a.Ha();){var l=a.ha(),p=l.Tg(0,0),y=new e.Nc;for(y.K(p.oa,p.va),p=0;y.va>u.oa;)y.move(-o),--p;for(;y.oa<=u.va;){if(y.isIntersecting(u)){s==null&&(s=new e.Ta);var d=e.yb.cP(l.ac(),l.wc());p!=0&&(c.gg(p*o,0),d.Oc(c)),s.oc(d,!0)}y.move(o),++p}}return s!=null?(i=e.ta.gO(i,s),i=e.ta.Er(i),e.$t.lP(t,s,i,h)):t},n.eO=function(t,i,h,s,o){return t>=h&&i<=s?0:n.tE(.5*(i+t),h,s,o)},n.tE=function(t,i,h,s){return e.lc.round((.5*(h+i)-t)/s)*s},n.VQ=function(t,i,h,s,o,a,u,c){var l=n.dv(s,o),p=l.R(),y=p/360,d=n.pE*y,g=t.ub(0),b=i.Wc(),x=b?p/i.Oe().R():0;i=t.Ia();for(var m=0,w=h.da();md){if(j){var X=z+$-1,V=z;(!N||$+11*y&&(b=!1)}j||(K=R+(C-=e.lc.Cn(p,K-T)),++D,U=C!=0,W.x=K)}else E||e.ta.AG(G,H,W,B)&&(E=!0);U&&I.write(2*$,K),T=K,G.L(H),H.L(W)}D!=0&&M.Pc(1993),j=M.Na(0),A=M.Na(A-1),e.h.tb(j,A),M=n.wQ(M,s,isNaN(o)?0:o,a),i.add(M,!1)}return t=s.Xd(0),h=l.R()/180,n.Jt(i,l,.1*t,!1),e.ri.clip(i,l,t,h,a)},n.wQ=function(t,i,h,s){return n.Fn(t,i,h,!0,0,s)},n.OS=function(t,i,h,s){var o=t.getType();if(o==1736)for(i=i!=null?i.Xd(0):0,o=0;oh)for(var o=new e.Sa,a=0;ah)for(var o=new e.Sa,a=0;athis.Io},r.prototype.fz=function(){if(this.B())throw e.i.fa("invalid call");return new e.Sa(this.Bs.x,this.Bs.y)},r.prototype.Ua=function(){if(this.B())throw e.i.fa("invalid call");return this.Io},r.prototype.hz=function(){if(this.B())throw e.i.fa("invalid call");return this.Ka},r.prototype.Sz=function(){return(1&this.nw)!=0},r.prototype.ey=function(n,t,i,h){this.Bs.x=n,this.Bs.y=t,this.Io=i,this.Ka=h},r}();e.$l=f}(k||(k={})),function(e){var v=function(){function r(){}return r.prototype.Uo=function(n,t){if(this.th.resize(0),this.Ii.length=0,this.tk=-1,n.xc(this.Ek),this.Ek.W(t,t),this.Ek.isIntersecting(this.Fb.Ca)){var i=n.getType();(this.vs=e.aa.yd(i))?(this.TH=n.ac(),this.SH=n.wc(),this.qa=t):this.qa=NaN,this.th.add(this.Fb.kf),this.Ii.push(this.Fb.Ca),this.Qs=this.Fb.Ur(this.Fb.kf)}else this.Qs=-1},r.prototype.Xi=function(n,t){this.th.resize(0),this.Ii.length=0,this.tk=-1,this.Ek.K(n),this.Ek.W(t,t),this.qa=NaN,this.Ek.isIntersecting(this.Fb.Ca)?(this.th.add(this.Fb.kf),this.Ii.push(this.Fb.Ca),this.Qs=this.Fb.Ur(this.Fb.kf),this.vs=!1):this.Qs=-1},r.prototype.next=function(){if(this.th.size==0)return-1;this.tk=this.Qs;var n=null,t=null,i=null,h=null;this.vs&&(n=new e.h,t=new e.h,i=new e.l);for(var s=!1;!s;){for(;this.tk!=-1;){var o=this.Fb.bz(this.Fb.fv(this.tk));if(o.isIntersecting(this.Ek)){if(!this.vs){s=!0;break}if(n.L(this.TH),t.L(this.SH),i.K(o),i.W(this.qa,this.qa),0a;a++){var u=this.Fb.Lp(o,a);if(u!=-1&&0>h);s==0?(t.v=.5*(t.v+t.C),t.G=.5*(t.G+t.H)):s==1?(t.C=.5*(t.v+t.C),t.G=.5*(t.G+t.H)):(s==2?t.C=.5*(t.v+t.C):t.v=.5*(t.v+t.C),t.H=.5*(t.G+t.H))}return t},r.prototype.WR=function(n){return this.Az(n)},r.prototype.vR=function(n,t){return v.bP(this,n,t)},r.prototype.MF=function(n,t){return v.aP(this,n,t)},r.prototype.getIterator=function(){return v.$O(this)},r.prototype.Nk=function(n,t){if(0>t||32<2*t)throw e.i.N("invalid height");this.BT=t,this.Ca.K(n),this.kf=this.jf.Ce(),this.jx(this.kf,0),this.ax(this.kf,0),this.NJ(this.kf,0),this.KJ(this.kf,0)},r.prototype.zv=function(n,t,i,h,s,o,a){if(!h.contains(t))return i==0?-1:this.zv(n,t,0,this.Ca,this.kf,o,a);if(!o)for(var u=s;u!=-1;u=this.IR(u))this.jx(u,this.Az(u)+1);(u=new e.l).K(h),h=s;var c=[];for(c[0]=new e.l,c[1]=new e.l,c[2]=new e.l,c[3]=new e.l;ip;p++)if(c[p].contains(t)){l=!0;var y=this.Lp(h,p);y==-1&&(y=this.rP(h,p)),this.jx(y,this.Az(y)+1),h=y,u.K(c[p]);break}if(!l)break}return this.sS(n,t,i,u,h,o,s,a)},r.prototype.sS=function(n,t,i,h,s,o,a,u){var c=this.NF(s);if(o){if(s==a)return u;this.SP(u),o=u}else o=this.tP(),this.NB(o,n),this.KW(this.fv(o),t);return this.mX(o,s),c!=-1?(this.hx(o,c),this.bx(c,o)):this.GJ(s,o),this.SB(s,o),this.ax(s,this.lv(s)+1),this.hO(s)&&this.MQ(i,h,s),o},r.prototype.SP=function(n){var t=this.WF(n),i=this.NF(t),h=this.OR(n),s=this.nv(n);this.Ur(t)==n?(s!=-1?this.hx(s,-1):this.SB(t,-1),this.GJ(t,s)):i==n?(this.bx(h,-1),this.SB(t,h)):(this.hx(s,h),this.bx(h,s)),this.hx(n,-1),this.bx(n,-1),this.ax(t,this.lv(t)-1)},r.EJ=function(n,t){var i=.5*(n.v+n.C),h=.5*(n.G+n.H);t[0].K(i,h,n.C,n.H),t[1].K(n.v,h,i,n.H),t[2].K(n.v,n.G,i,h),t[3].K(i,n.G,n.C,h)},r.prototype.hO=function(n){return this.lv(n)==8&&!this.gG(n)},r.prototype.MQ=function(n,t,i){var h=this.Ur(i);do{var s=this.fv(h),o=this.Zh.T(h,0);s=this.bz(s),this.zv(o,s,n,t,i,!0,h),h=o=this.nv(h)}while(h!=-1)},r.prototype.iO=function(n){return 8<=this.lv(n)||this.gG(n)},r.prototype.gG=function(n){return this.Lp(n,0)!=-1||this.Lp(n,1)!=-1||this.Lp(n,2)!=-1||this.Lp(n,3)!=-1},r.prototype.rP=function(n,t){var i=this.jf.Ce();return this.OW(n,t,i),this.jx(i,0),this.ax(i,0),this.Pk(i,n),this.KJ(i,this.jv(n)+1),this.NJ(i,t<<2*this.jv(n)|this.QF(n)),i},r.prototype.tP=function(){var n=this.Zh.Ce();if(0>4)]|=this.iH<<2*(15&s)},n}();e.HY=f;var r=function(){function n(t,i,h){this.Vh=null,this.SA=this.Ik=this.cI=this.aI=this.Es=this.qH=this.Gf=this.Um=0,this.Ri=this.Jk=this.vl=null,this.Fz(t,i,h)}return n.create=function(t,i,h){if(!n.zE(t))throw e.i.N();return n.wP(t,i,h)},n.pW=function(t){switch(t){case 0:t=1024;break;case 1:t=16384;break;case 2:t=262144;break;default:throw e.i.fa("Internal Error")}return t},n.zE=function(t){return!(t.B()||t.getType()!=1607&&t.getType()!=1736)},n.prototype.rQ=function(t,i){i=i.Ga();for(var h=new e.h,s=new e.h;i.$a();)for(;i.Ha();){var o=i.ha();if(o.getType()!=322)throw e.i.fa("Internal Error");t.Eh(o.ac(),h),t.Eh(o.wc(),s),this.Ri.jy(h.x,h.y,s.x,s.y)}this.Ri.iJ(e.Px.Cx)},n.prototype.sQ=function(){throw e.i.fa("Internal Error")},n.prototype.Ry=function(t,i){for(var h=1;4>h;h++)t.jy(i[h-1].x,i[h-1].y,i[h].x,i[h].y);t.jy(i[3].x,i[3].y,i[0].x,i[0].y),this.Ri.iJ(e.Px.Cx)},n.prototype.rK=function(t,i,h){for(var s=[null,null,null,null],o=0;o(b=o.length());b==0?o.ma(1,0):(x||y.L(l),o.scale(h/b),a.ma(-o.y,o.x),u.ma(o.y,-o.x),c.sub(o),l.add(o),s[0].add(c,a),s[1].add(c,u),s[2].add(l,u),s[3].add(l,a),x?d=!0:this.Ry(t,s))}else d&&(this.Ry(t,s),d=!1),g=!0}d&&this.Ry(t,s)}},n.prototype.sC=function(t){return e.O.truncate(t*this.qH+this.aI)},n.prototype.tC=function(t){return e.O.truncate(t*this.Es+this.cI)},n.wP=function(t,i,h){return new n(t,i,h)},n.prototype.Fz=function(t,i,h){this.Gf=Math.max(e.O.truncate(2*Math.sqrt(h)+.5),64),this.Um=e.O.truncate((2*this.Gf+31)/32),this.vl=new e.l,this.Ik=i,h=0;for(var s=this.Gf,o=this.Um;8<=s;)h+=s*o,s=e.O.truncate(s/2),o=e.O.truncate((2*s+31)/32);this.Vh=e.O.lg(h,0),this.Ri=new e.Px,h=new f(this.Vh,this.Um,this),this.Ri.AX(this.Gf,this.Gf,h),t.A(this.vl),this.vl.W(i,i),s=new e.l;var a=i*(o=e.l.construct(1,1,this.Gf-2,this.Gf-2)).R();switch(i*=o.ca(),s.K(this.vl.sf(),Math.max(a,this.vl.R()),Math.max(i,this.vl.ca())),this.SA=this.Ik,this.Jk=new e.Dd,this.Jk.pS(s,o),new e.Dd,t.getType()){case 550:h.setColor(this.Ri,2),this.sQ();break;case 1607:h.setColor(this.Ri,2),this.rK(this.Ri,t,this.SA);break;case 1736:h.setColor(this.Ri,1),this.rQ(this.Jk,t),h.setColor(this.Ri,2),this.rK(this.Ri,t,this.SA)}this.qH=this.Jk.bb,this.Es=this.Jk.ab,this.aI=this.Jk.Gb,this.cI=this.Jk.Lb,this.XN()},n.prototype.XN=function(){this.Ri.flush();for(var t=0,i=this.Gf*this.Um,h=this.Gf,s=e.O.truncate(this.Gf/2),o=this.Um,a=e.O.truncate((2*s+31)/32);8>4;p=2*(15&p);var g=y>>4;y=2*(15&y);var b=this.Vh[t+o*u+d]>>p&3;b|=this.Vh[t+o*u+g]>>y&3,b|=this.Vh[t+o*c+d]>>p&3,b|=this.Vh[t+o*c+g]>>y&3,this.Vh[i+a*h+(l>>4)]|=b<<2*(15&l)}h=s,o=a,t=i,s=e.O.truncate(h/2),a=e.O.truncate((2*s+31)/32),i=t+o*h}},n.prototype.So=function(t,i){return this.vl.contains(t,i)?(t=this.sC(t),i=this.tC(i),0>t||t>=this.Gf||0>i||i>=this.Gf||(i=this.Vh[this.Um*i+(t>>4)]>>2*(15&t)&3)==0?0:i==1?1:2):0},n.prototype.Ro=function(t){if(!t.Ea(this.vl))return 0;var i=this.sC(t.v),h=this.sC(t.C),s=this.tC(t.G);if(t=this.tC(t.H),0>i&&(i=0),0>s&&(s=0),h>=this.Gf&&(h=this.Gf-1),t>=this.Gf&&(t=this.Gf-1),i>h||s>t)return 0;for(var o=Math.max(h-i,1)*Math.max(t-s,1),a=0,u=this.Um,c=this.Gf,l=0;;){if(32>o||16>c){for(o=s;o<=t;o++)for(var p=i;p<=h;p++)if(1<(l=this.Vh[a+u*o+(p>>4)]>>2*(15&p)&3))return 2;if(l==0)return 0;if(l==1)return 1}a+=u*c,c=e.O.truncate(c/2),u=e.O.truncate((2*c+31)/32),i=e.O.truncate(i/2),s=e.O.truncate(s/2),h=e.O.truncate(h/2),t=e.O.truncate(t/2),o=Math.max(h-i,1)*Math.max(t-s,1)}},n.prototype.RR=function(){return this.Gf*this.Um},n}();e.Nx=r}(k||(k={})),function(e){var v;(v=e.VL||(e.VL={}))[v.contains=1]="contains",v[v.within=2]="within",v[v.equals=3]="equals",v[v.disjoint=4]="disjoint",v[v.touches=8]="touches",v[v.crosses=16]="crosses",v[v.overlaps=32]="overlaps",v[v.unknown=0]="unknown",v[v.intersects=1073741824]="intersects";var f=function(){function n(){}return n.construct=function(t,i,h,s,o,a,u,c){var l=new n;return l.pw=t,l.Mm=i,l.Kj=h,l.Si=s,l.BH=o,l.SY=a,l.TY=u,l.UY=c,l},n}();e.Vt=function(){function n(){}return n.CD=function(t,i,h){if(n.wy(t)){var s=e.ta.kj(i,t,!1);i=!1,e.Uk.CE(t)&&(i=i||t.lu(s,h)),(s=t.getType())!=1736&&s!=1607||!e.Uk.AE(t)||h==0||(i=i||t.fj(h)),s!=1736&&s!=1607||!e.Uk.BE(t)||h==0||i||t.hM()}},n.wy=function(t){return e.Uk.CE(t)||e.Uk.AE(t)||e.Uk.BE(t)},n}();var r=function(){function n(){this.rh=[]}return n.zB=function(t,i,h,s,o){var a=t.getType(),u=i.getType();if(a==197){if(u==197)return n.tW(t,i,h,s);if(u==33)return s==2?s=1:s==1&&(s=2),n.hJ(i,t,h,s)}else if(a==33){if(u==197)return n.hJ(t,i,h,s);if(u==33)return n.vW(t,i,h,s)}if(t.B()||i.B())return s==4;var c=new e.l;t.A(c);var l=new e.l;i.A(l);var p=new e.l;if(p.K(c),p.Zb(l),h=e.ta.Wd(h,p,!1),n.dk(c,l,h))return s==4;switch(c=!1,e.Vk.yd(a)&&((a=new e.Ta(t.description)).oc(t,!0),t=a,a=1607),e.Vk.yd(u)&&((u=new e.Ta(i.description)).oc(i,!0),i=u,u=1607),a!=197&&u!=197?(t.Db()4*Math.max(t.I(),i.I())*h)&&n.Wz(t,i,h,!0)))},n.kV=function(t,i,h){var s=n.qc(t,i,!0);return s==4||s!=1&&s!=2&&s!=1073741824&&n.EI(t,i,h)},n.vV=function(t,i,h){var s=n.qc(t,i,!1);return s!=4&&s!=1&&s!=2&&n.II(t,i,h,null)},n.qV=function(t,i,h,s){var o=n.qc(t,i,!1);return o!=4&&o!=1&&o!=2&&n.FI(t,i,h,s)},n.Sw=function(t,i,h,s){var o=new e.l,a=new e.l;return t.A(o),i.A(a),!!n.zc(o,a,h)&&(o=n.qc(t,i,!1))!=4&&o!=2&&(o==1||n.BI(t,i,h,s))},n.lV=function(t,i,h){var s=n.qc(t,i,!0);return s==4||s!=1&&s!=1073741824&&n.EI(t,i,h)},n.wV=function(t,i,h,s){var o=n.qc(t,i,!1);return o!=4&&o!=1&&n.JI(t,i,h,s)},n.gV=function(t,i,h){var s=n.qc(t,i,!1);return s!=4&&s!=1&&n.DI(t,i,h,null)},n.fB=function(t,i,h,s){var o=new e.l,a=new e.l;return t.A(o),i.A(a),!!n.zc(o,a,h)&&(o=n.qc(t,i,!1))!=4&&(o==1||n.CI(t,i,h,s))},n.jV=function(t,i,h){return e.hd.KG(t,i,h)==0},n.uV=function(t,i,h){return i=i.D(),n.HI(t,i,h)},n.dV=function(t,i,h){return i=i.D(),n.AI(t,i,h)},n.iV=function(t,i,h){var s=n.qc(t,i,!1);if(s==4)return!0;if(s==1)return!1;s=new e.l,t.A(s),s.W(h,h);for(var o=new e.h,a=0;ah&&a.R()>h||a.ca()<=h&&a.R()<=h)&&(o=new e.Ta,a=new e.Sa,i.Hf(0,a),o.nf(a),i.Hf(2,a),o.lineTo(a),n.DI(t,o,h,s))},n.IV=function(t,i,h){var s=new e.l,o=new e.l;return t.A(s),i.A(o),!(!n.ek(s,o,h)||n.qc(t,i,!1)==4)&&(!!n.dI(t,i,h)||n.Wz(t,i,h,!1))},n.GV=function(t,i,h){return this.qc(t,i,!1)==4||!!new e.Zl(t,i,h,!0).next()&&!this.UG(t,i,h)},n.NI=function(t,i,h){if(n.qc(t,i,!1)==4)return!1;var s=new e.be(0);if(n.Xz(t,i,h,s)!=0)return!1;for(var o=new e.de,a=0;ah&&o.R()>h)&&n.ek(s,o,h)},n.DV=function(t,i,h){var s=new e.l,o=new e.l;return t.A(s),i.A(o),!n.zc(o,s,h)&&!n.TG(t,o,h)},n.OV=function(t,i,h){var s=new e.l,o=new e.l;if(t.A(s),i.A(o),o.ca()<=h&&o.R()<=h)return o=i.Ip(),n.Zz(t,o,h);if(o.ca()<=h||o.R()<=h)return o=new e.Ta,s=new e.Sa,i.Hf(0,s),o.nf(s),i.Hf(2,s),o.lineTo(s),n.NI(t,o,h);t=t.Ga(),i=new e.l,s=new e.l,i.K(o),s.K(o),i.W(-h,-h),s.W(h,h),o=!1;for(var a=new e.l,u=new e.l;t.$a();)for(;t.Ha();){if(t.ha().A(a),u.K(i),u.Ea(a),!u.B()&&(u.ca()>h||u.R()>h))return!1;u.K(s),u.Ea(a),u.B()||(o=!0)}return o},n.LV=function(t,i,h){var s=new e.l,o=new e.l;return t.A(s),i.A(o),!(n.zc(s,o,h)||n.zc(o,s,h)||n.zc(o,s,h)||o.ca()>h&&o.R()>h||o.ca()<=h&&o.R()<=h)&&(s=new e.Ta,o=new e.Sa,i.Hf(0,o),s.nf(o),i.Hf(2,o),s.lineTo(o),n.WG(t,s,h))},n.RV=function(t,i,h){var s=new e.l,o=new e.l;if(t.A(s),i.A(o),!n.zc(o,s,h)||o.ca()<=h&&o.R()<=h)return!1;if(o.ca()<=h||o.R()<=h)return n.zc(o,s,h);t=t.Ga(),(i=new e.l).K(o),i.W(-h,-h),o=!1,s=new e.l;for(var a=new e.l;t.$a();)for(;t.Ha();)t.ha().A(s),i.hm(s)?o=!0:(a.K(i),a.Ea(s),!a.B()&&(a.ca()>h||a.R()>h)&&(o=!0));return o},n.yV=function(t,i,h){var s=new e.l,o=new e.l;return i.A(o),t.A(s),!(!n.zc(s,o,h)||o.ca()>h&&o.R()>h)&&(o.ca()<=h&&o.R()<=h?(i=i.Ip(),n.SG(t,i,h)):(s=new e.Ta,o=new e.Sa,i.Hf(0,o),s.nf(o),i.Hf(2,o),s.lineTo(o),n.ym(s,t,h,!1)))},n.BV=function(t,i,h){var s=new e.l,o=new e.l;if(t.A(s),i.A(o),n.zc(o,s,h)||o.ca()<=h&&o.R()<=h)return!1;if(o.ca()<=h||o.R()<=h)return s=new e.Ta,o=new e.Sa,i.Hf(0,o),s.nf(o),i.Hf(2,o),s.lineTo(o),n.LI(t,s,h);t=t.Ga(),i=new e.l,(s=new e.l).K(o),i.K(o),s.W(-h,-h),i.W(h,h);for(var a=o=!1,u=new e.l,c=new e.l;t.$a();)for(;t.Ha();)if(t.ha().A(u),a||i.contains(u)||(a=!0),o||(c.K(s),c.Ea(u),!c.B()&&(c.ca()>h||c.R()>h)&&(o=!0)),o&&a)return!0;return!1},n.iU=function(t,i,h){var s=new e.l,o=new e.l;return t.A(s),i.A(o),!!n.ek(s,o,h)&&(!!n.jU(t,i,h)||n.YA(t,i,h,!1,!0,!1))},n.gU=function(t,i,h){return!n.gI(t,i,h)},n.oU=function(t,i,h){return n.YA(t,i,h,!1,!1,!0)},n.eI=function(t,i,h){var s=new e.l,o=new e.l;return t.A(s),i.A(o),!!n.zc(s,o,h)&&n.YA(i,t,h,!0,!1,!1)},n.Mw=function(t,i,h){h*=h;for(var s=new e.h,o=new e.h,a=0;ah||o.R()>h)&&n.ek(s,o,h)},n.fU=function(t,i,h){var s=new e.l,o=new e.l;if(t.A(s),i.A(o),n.zc(o,s,h))return!1;for((i=new e.l).K(o),i.W(h,h),h=new e.h,o=0;oh?a.W(0,-h):a.W(-h,0);for(var c=0;ch){if(i.y>a.G&&i.ya.v&&i.xh?s.W(0,-h):s.W(-h,0),a.W(h,h);for(var u=new e.h,c=0;ch?u.y>s.G&&u.ys.v&&u.xh||o.R()>h)&&(i=i.Ip(),!n.kt(t,i,h))},n.eU=function(t,i,h){var s=new e.l,o=new e.l;if(t.A(s),i.A(o),n.zc(o,s,h)||o.ca()<=h&&o.R()<=h)return!1;if(o.ca()<=h||o.R()<=h){i=new e.l,s=new e.l,i.K(o),o.ca()>h?i.W(0,-h):i.W(-h,0),s.K(o),s.W(h,h);for(var a=new e.h,u=!1,c=!1,l=0;lh?a.y>i.G&&a.yi.v&&a.xh*h},n.uI=function(t,i,h){return n.wI(t,i,h)},n.vI=function(t,i,h){var s=new e.l;return s.K(t),n.ek(s,i,h)},n.Rw=function(t,i,h){var s=new e.l;return s.K(i),s.W(h,h),!s.contains(t)},n.dB=function(t,i,h){if(i.ca()<=h&&i.R()<=h)return!1;var s=new e.l,o=new e.l;if(s.K(i),s.W(h,h),!s.contains(t))return!1;if(i.ca()<=h||i.R()<=h){if(o.K(i),i.ca()>h?o.W(0,-h):o.W(-h,0),i.ca()>h){if(t.y>o.G&&t.yo.v&&t.xh?s.W(0,-h):s.W(-h,0);var o=!1;return i.ca()>h?t.y>s.G&&t.ys.v&&t.xh&&t.R()>h&&(i.ca()<=h||i.R()<=h)?s=i:(s=t,t=i),s.ca()<=h||s.R()<=h){if(t.ca()<=h||t.R()<=h){i=new e.yb;var o=new e.yb,a=[0,0],u=[0,0],c=new e.h;return s.dn(c),i.Dc(c),s.en(c),i.Qc(c),t.dn(c),o.Dc(c),t.en(c),o.Qc(c),i.Ea(o,null,a,u,h),i.Ea(o,null,null,null,h)==1&&(a[0]==0||a[1]==1||u[0]==0||u[1]==1)}return i=new e.l,o=new e.l,i.K(t),i.W(-h,-h),o.K(i),o.Ea(s),!(!o.B()&&(o.ca()>h||o.R()>h))}return t.W(h,h),(o=new e.l).K(s),o.Ea(t),!(o.B()||!o.B()&&o.ca()>h&&o.R()>h)},n.bQ=function(t,i,h){if(n.zc(t,i,h)||n.zc(i,t,h)||t.ca()<=h&&t.R()<=h||i.ca()<=h&&i.R()<=h)return!1;if(t.ca()<=h||t.R()<=h){if(i.ca()>h&&i.R()>h)return!1;var s=new e.yb,o=new e.yb,a=[0,0],u=[0,0],c=new e.h;return t.dn(c),s.Dc(c),t.en(c),s.Qc(c),i.dn(c),o.Dc(c),i.en(c),o.Qc(c),s.Ea(o,null,a,u,h),s.Ea(o,null,null,null,h)==2&&(0a[1])&&(0u[1])}return!(i.ca()<=h||i.R()<=h)&&((s=new e.l).K(t),s.Ea(i),!(s.B()||s.ca()<=h||s.R()<=h))},n.jF=function(t,i,h){if(!n.zc(t,i,h))return!1;if(t.ca()<=h&&t.R()<=h)return t=t.sf(),n.eB(t,i,h);if(i.ca()<=h&&i.R()<=h)return i=i.sf(),n.eB(i,t,h);if(t.ca()<=h||t.R()<=h)return n.zc(t,i,h);if(i.ca()<=h||i.R()<=h){var s=new e.l;return s.K(t),s.W(-h,-h),s.hm(i)?!0:((t=new e.l).K(s),t.Ea(i),!(t.B()||t.ca()<=h&&t.R()<=h))}return n.zc(t,i,h)},n.aQ=function(t,i,h){if(n.zc(t,i,h)||n.zc(i,t,h)||t.ca()<=h&&t.R()<=h||i.ca()<=h&&i.R()<=h||i.ca()>h&&i.R()>h&&t.ca()>h&&t.R()>h)return!1;if(t.ca()>h&&t.R()>h)var s=i;else s=t,t=i;if(t.ca()>h&&t.R()>h){i=new e.l;var o=new e.l;return o.K(t),o.W(-h,-h),i.K(o),i.Ea(s),!(i.B()||i.ca()<=h&&i.R()<=h)}i=new e.yb,o=new e.yb;var a=[0,0],u=[0,0],c=new e.h;return s.dn(c),i.Dc(c),s.en(c),i.Qc(c),t.dn(c),o.Dc(c),t.en(c),o.Qc(c),i.Ea(o,null,a,u,h),i.Ea(o,null,null,null,h)==1&&0a[1]&&0u[1]},n.EI=function(t,i,h){var s=new e.l,o=new e.l,a=new e.Zl(t,i,h,!0);if(!a.next())return!0;if(this.UG(t,i,h))return!1;var u=t,c=null;i.getType()==1736&&(c=i);var l=!1,p=!1;do{var y=a.nl(),d=a.hl();if(d=i.Na(i.Ba(d)),s.K(a.uz()),s.W(h,h),s.contains(d)&&(d=e.hd.Yd(u,d,0))!=0||i.getType()==1736&&(y=t.Na(t.Ba(y)),o.K(a.az()),o.W(h,h),o.contains(y)&&(d=e.hd.Yd(c,y,0))!=0))return!1;l||(!e.Dg.Ml(t,i.da()-1)||t.Bb!=null&&t.Bb.Fb!=null?u=t:(u=new e.Da,t.copyTo(u),u.fj(1)),l=!0),i.getType()!=1736||p||(p=i,!e.Dg.Ml(p,t.da()-1)||i.Bb!=null&&i.Bb.Fb!=null?c=i:(c=new e.Da,p.copyTo(c),c.fj(1)),p=!0)}while(a.next());return!0},n.zc=function(t,i,h){var s=new e.l;return s.K(t),s.W(h,h),s.contains(i)},n.ls=function(t,i,h){var s=new e.l;return s.K(i),s.W(h,h),i=new e.h,t.dn(i),!s.contains(i)||(t.$I(i),!s.contains(i)||(t.cJ(i),!s.contains(i)||(t.en(i),!s.contains(i))))},n.dI=function(t,i,h){if(t.da()!=i.da()||t.I()!=i.I())return!1;var s=new e.h,o=new e.h,a=!0;h*=h;for(var u=0;uh){a=!1;break}if(!a)break}return!!a},n.jU=function(t,i,h){if(t.I()!=i.I())return!1;var s=new e.h,o=new e.h,a=!0;h*=h;for(var u=0;uh){a=!1;break}return!!a},n.YA=function(t,i,h,s,o,a){var u=!1;if(t.I()>i.I()){s&&(s=!1,u=!0);var c=i}else c=t,t=i;if(i=null,o||a||u){i=new e.pn(t.I());for(var l=0;li.I())var s=i;else s=t,t=i;i=new e.l;var o=new e.l,a=new e.l;s.A(i),t.A(o),i.W(h,h),o.W(h,h),a.K(i),a.Ea(o),o=new e.h;for(var u=new e.h,c=h*h,l=e.ta.oE(t,a),p=l.getIterator(),y=0;yh)return!1;if(w*(1-(M=a.Si))<=h||M==1)break}if(w*(1-M)>h)return!1;p=0,y.resize(0),d.rh.length=0}}return u},n.WG=function(t,i,h){if(1>n.Xz(t,i,h,null))return!1;var s=new e.l,o=new e.l;t.A(s),i.A(o);var a=n.ls(s,o,h);return s=n.ls(o,s,h),!(!a||!s)||(a&&!s?!n.ym(i,t,h,!1):s&&!a?!n.ym(t,i,h,!1):!n.ym(t,i,h,!1)&&!n.ym(i,t,h,!1))},n.Xz=function(t,i,h,s){function o(H,U){return g.QE(H,U)}if(t.yz()>i.yz())var a=i,u=t;else a=t,u=i;t=a.Ga(),i=u.Ga();var c=[0,0],l=[0,0],p=-1,y=0,d=new e.ia(0),g=new n,b=new e.l,x=new e.l,m=new e.l;a.A(b),u.A(x),b.W(h,h),x.W(h,h),m.K(b),m.Ea(x),a=null,s!=null&&(a=new e.h);var w=x=x=null,j=u.Bb;for(j!=null?(x=j.Fb,w=j.zo,x==null&&(x=e.ta.jj(u,m))):x=e.ta.jj(u,m),u=x.getIterator(),j=null,w!=null&&(j=w.getIterator());t.$a();)for(w=0;t.Ha();){var M=t.ha();if(M.A(b),b.isIntersecting(m)){if(j!=null&&(j.Xi(b,h),j.next()==-1))continue;var A=M.Qb();u.Uo(M,h);for(var z=u.next();z!=-1;z=u.next()){var N=x.ja(z);i.Vb(N);var I=i.ha(),C=I.Qb(),T=M.Ea(I,null,c,l,h);if(0h)return 1;var E=A*(D-z);if(i.Ha()){if(I=i.ha(),(T=M.Ea(I,null,c,null,h))==2){T=c[0];var G=c[1];if(E+(T=A*(G-T))>h)return 1}i.Vb(N),i.ha()}if(!i.vm()){if(i.li(),I=i.li(),(T=M.Ea(I,null,c,null,h))==2&&(T=c[0],E+(T=A*((G=c[1])-T))>h))return 1;i.Vb(N),i.ha()}if(t.Ha()){if(N=t.wb(),(T=(M=t.ha()).Ea(I,null,c,null,h))==2&&(T=c[0],E+(T=A*((G=c[1])-T))>h))return 1;t.Vb(N),t.ha()}if(!t.vm()){if(N=t.wb(),t.li(),(T=(M=t.li()).Ea(I,null,c,null,h))==2&&(T=c[0],E+(T=C*((G=c[1])-T))>h))return 1;t.Vb(N),t.ha()}I=f.construct(t.wb(),t.gb,z,D,i.wb(),i.gb,p,B),g.rh.push(I),d.add(d.size)}p=0,s!=null&&(M.hc(z,a),s.add(a.x),s.add(a.y))}}if(yh)w=A*(I.Si-I.Kj),M=I.Si,z=I.Mm;else{if(I.Mm!=z?(w=A*(I.Si-I.Kj),z=I.Mm):w+=A*(I.Si-I.Kj),w>h)return 1;if((M=I.Si)==1)break}A*(1-M)>h&&(w=0),y=0,d.resize(0),g.rh.length=0}}}return p},n.UG=function(t,i,h){var s=t.Ga(),o=i.Ga();for(t=new e.Zl(t,i,h,!1);t.next();){i=t.nl();var a=t.hl();if(s.Vb(i),o.Vb(a),i=s.ha(),0h)return!1;y=!0}else if(g!=0){if(y=c[0],d=l[0],0y&&0d)return!1;y=!0}}return!!y&&(a=new e.l,u=new e.l,o=new e.l,t.A(a),i.A(u),a.W(1e3*h,1e3*h),u.W(1e3*h,1e3*h),o.K(a),o.Ea(u),!(10h&&(l=!0,p&&y))return!0}else if(w!=0&&(w=b[0],j=x[0],0w&&0j))return!0}if(o=new e.l,d=new e.l,o.K(a),o.W(1e3*h,1e3*h),d.K(u),d.W(1e3*h,1e3*h),c.K(o),c.Ea(d),a="",a=l?a+"**":a+"T*",p){if(10y&&0d)))return s[0]=!0,!1}if(!p){for(s[0]=!0,u=new e.l,t.A(u),u.W(h,h),l=t,p=!1,c=new e.l,s=0,o=i.da();sp&&0y)return!1;p=!0}}return!!p&&(a=new e.l,u=new e.l,o=new e.l,t.A(a),i.A(u),a.W(1e3*h,1e3*h),u.W(1e3*h,1e3*h),o.K(a),o.Ea(u),!(10p&&0y)return!0;p=!0}}return!!p&&(a=new e.l,u=new e.l,c=new e.l,l=new e.l,o=new e.l,t.A(a),i.A(u),n.ls(u,a,h)?(c.K(a),c.W(1e3*h,1e3*h),l.K(u),l.W(1e3*h,1e3*h),o.K(c),o.Ea(l),!(10a;a++){var u=s.charAt(a);if(u!="*"&&u!="T"&&u!="F"&&u!="0"&&u!="1"&&u!="2")throw e.i.fa("relation string")}if((a=this.MR(s,t.Db(),i.Db()))!=0)return e.ud.zB(t,i,h,a,o);a=new e.l,t.A(a),u=new e.l,i.A(u);var c=new e.l;if(c.K(a),c.Zb(u),h=e.ta.Wd(h,c,!1),t=this.WE(t,h),i=this.WE(i,h),t.B()||i.B())return this.uW(t,i,s);switch(a=t.getType(),u=i.getType(),c=!1,a){case 1736:switch(u){case 1736:c=this.rt(t,i,h,s,o);break;case 1607:c=this.$m(t,i,h,s,o);break;case 33:c=this.qt(t,i,h,s);break;case 550:c=this.pt(t,i,h,s,o)}break;case 1607:switch(u){case 1736:c=this.$m(i,t,h,this.Zp(s),o);break;case 1607:c=this.gB(t,i,h,s,o);break;case 33:c=this.tt(t,i,h,s,o);break;case 550:c=this.st(t,i,h,s,o)}break;case 33:switch(u){case 1736:c=this.qt(i,t,h,this.Zp(s));break;case 1607:c=this.tt(i,t,h,this.Zp(s),o);break;case 33:c=this.$U(t,i,h,s);break;case 550:c=this.lt(i,t,h,this.Zp(s))}break;case 550:switch(u){case 1736:c=this.pt(i,t,h,this.Zp(s),o);break;case 1607:c=this.st(i,t,h,this.Zp(s),o);break;case 550:c=this.ZA(t,i,h,s,o);break;case 33:c=this.lt(t,i,h,s)}break;default:c=!1}return c},n.rt=function(t,i,h,s,o){var a=new n;a.Yi(),a.bj(s),a.xJ();var u=new e.l,c=new e.l;return t.A(u),i.A(c),s=!1,e.ud.dk(u,c,h)&&(a.Cu(t,i),s=!0),s||((u=e.ud.qc(t,i,!1))==4?(a.Cu(t,i),s=!0):u==1?(a.ly(i),s=!0):u==2&&(a.ZD(t),s=!0)),s||(t=(s=new e.gd).Ib(t),i=s.Ib(i),a.Wo(s,h,o),a.Bp(t,i),a.j.Ug()),n.fg(a.J,a.Xc)},n.Sw=function(t,i,h,s){var o=new n;o.Yi(),o.bj("T*****F**"),o.xJ();var a=new e.l,u=new e.l;t.A(a),i.A(u);var c=!1;return e.ud.dk(a,u,h)&&(o.Cu(t,i),c=!0),c||((a=e.ud.qc(t,i,!1))==4?(o.Cu(t,i),c=!0):a==1?(o.ly(i),c=!0):a==2&&(o.ZD(t),c=!0)),c?this.fg(o.J,o.Xc):(t=(c=new e.gd).Ib(t),a=c.Ib(i),e.Tk.V(c,h,s,!1),h=c.Ne(a).mg(),c.Gp(0,!0,!0),e.rn.V(c,t,-1,!1,s),c.I(t)!=0&&(e.rn.V(c,a,-1,!1,s),o.er(c,s),(i=c.I(a)==0)||(o.Bp(t,a),o.j.Ug(),a=this.fg(o.J,o.Xc))?(t=c.Ne(t),t=(c=new e.gd).Ib(t),a=c.Ib(h),o.er(c,s),o.le=0,o.Yi(),o.bj(i?"T*****F**":"******F**"),o.IB(),o.Bp(t,a),o.j.Ug(),this.fg(o.J,o.Xc)):a))},n.$m=function(t,i,h,s,o){var a=new n;a.Yi(),a.bj(s),a.IB();var u=new e.l,c=new e.l;return t.A(u),i.A(c),s=!1,e.ud.dk(u,c,h)&&(a.Du(t,i),s=!0),s||((u=e.ud.qc(t,i,!1))==4?(a.Du(t,i),s=!0):u==1&&(a.$D(i),s=!0)),s||(t=(s=new e.gd).Ib(t),i=s.Ib(i),a.Wo(s,h,o),a.kh=a.j.Dp(),n.Jw(i,a.j,a.kh),a.Bp(t,i),a.j.Ep(a.kh),a.j.Ug()),n.fg(a.J,a.Xc)},n.fB=function(t,i,h,s){var o=new n;o.Yi(),o.bj("T*****F**"),o.IB();var a=new e.l,u=new e.l;t.A(a),i.A(u);var c=!1;return e.ud.dk(a,u,h)&&(o.Du(t,i),c=!0),c||((a=e.ud.qc(t,i,!1))==4?(o.Du(t,i),c=!0):a==1&&(o.$D(i),c=!0)),c?this.fg(o.J,o.Xc):(t=(c=new e.gd).Ib(t),i=c.Ib(i),o.Wo(c,h,s),c.I(t)!=0&&(o.Bp(t,i),o.j.Ug(),this.fg(o.J,o.Xc)))},n.pt=function(t,i,h,s,o){var a=new n;a.Yi(),a.bj(s),a.yJ();var u=new e.l,c=new e.l;return t.A(u),i.A(c),s=!1,e.ud.dk(u,c,h)&&(a.Eu(t),s=!0),s||((u=e.ud.qc(t,i,!1))==4?(a.Eu(t),s=!0):u==1&&(a.zN(),s=!0)),s||(t=(s=new e.gd).Ib(t),i=s.Ib(i),a.Wo(s,h,o),a.Gy(t,i),a.j.Ug()),n.fg(a.J,a.Xc)},n.gB=function(t,i,h,s,o){var a=new n;a.Yi(),a.bj(s),a.eX(),s=new e.l;var u=new e.l;t.A(s),i.A(u);var c=!1;return e.ud.dk(s,u,h)&&(a.PG(t,i),c=!0),c||e.ud.qc(t,i,!1)!=4||(a.PG(t,i),c=!0),c||(t=(s=new e.gd).Ib(t),i=s.Ib(i),a.Wo(s,h,o),a.Yh=a.j.Dp(),a.kh=a.j.Dp(),n.Jw(t,a.j,a.Yh),n.Jw(i,a.j,a.kh),a.Bp(t,i),a.j.Ep(a.Yh),a.j.Ep(a.kh),a.j.Ug()),n.fg(a.J,a.Xc)},n.st=function(t,i,h,s,o){var a=new n;a.Yi(),a.bj(s),a.MJ(),s=new e.l;var u=new e.l;t.A(s),i.A(u);var c=!1;return e.ud.dk(s,u,h)&&(a.Vz(t),c=!0),c||e.ud.qc(t,i,!1)!=4||(a.Vz(t),c=!0),c||(t=(s=new e.gd).Ib(t),i=s.Ib(i),a.Wo(s,h,o),a.Yh=a.j.Dp(),n.Jw(t,a.j,a.Yh),a.Gy(t,i),a.j.Ep(a.Yh),a.j.Ug()),n.fg(a.J,a.Xc)},n.ZA=function(t,i,h,s,o){var a=new n;a.Yi(),a.bj(s),a.RJ(),s=new e.l;var u=new e.l;t.A(s),i.A(u);var c=!1;return e.ud.dk(s,u,h)&&(a.yI(),c=!0),c||(t=(s=new e.gd).Ib(t),i=s.Ib(i),a.Wo(s,h,o),a.Gy(t,i),a.j.Ug()),n.fg(a.J,a.Xc)},n.qt=function(t,i,h,s){var o=new n;o.Yi(),o.bj(s),o.yJ();var a=new e.l;t.A(a),i=i.D();var u=!1;return e.ud.Rw(i,a,h)&&(o.Eu(t),u=!0),u||((h=e.hd.Yd(t,i,h))==1?(o.J[0]=0,o.J[2]=2,o.J[3]=-1,o.J[5]=1,o.J[6]=-1):h==2?(o.J[6]=-1,t.Ke()!=0?(o.J[0]=-1,o.J[3]=0,o.J[2]=2,o.J[5]=1):(o.J[0]=0,o.J[3]=-1,o.J[5]=-1,h=new e.l,t.A(h),o.J[2]=h.ca()==0&&h.R()==0?-1:1)):o.Eu(t)),this.fg(o.J,s)},n.tt=function(t,i,h,s,o){var a=new n;a.Yi(),a.bj(s),a.MJ();var u=new e.l;t.A(u),s=i.D();var c=!1;if(e.ud.Rw(s,u,h)&&(a.Vz(t),c=!0),!c){u=null;var l=c=!1;(a.ea[0]||a.ea[6])&&(e.ud.Yz(t,s,h)?(a.ea[0]&&(u=e.pi.gm(t,o),l=!e.ud.kt(u,s,h),c=!0,a.J[0]=l?-1:0),a.J[6]=-1):(a.J[0]=-1,a.J[6]=0)),a.ea[3]&&(u!=null&&u.B()?a.J[3]=-1:(c||(u==null&&(u=e.pi.gm(t,o)),l=!e.ud.kt(u,s,h),c=!0),a.J[3]=l?0:-1)),a.ea[5]&&(u!=null&&u.B()?a.J[5]=-1:c&&!l?a.J[5]=0:(u==null&&(u=e.pi.gm(t,o)),o=e.ud.Nw(u,i,h),a.J[5]=o?-1:0)),a.ea[2]&&(t.Qb()!=0?a.J[2]=1:((o=new e.de(t.description)).Fd(t,0,t.I()),t=e.ud.Nw(o,i,h),a.J[2]=t?-1:0))}return this.fg(a.J,a.Xc)},n.lt=function(t,i,h,s){var o=new n;o.Yi(),o.bj(s),o.RJ();var a=new e.l;t.A(a),i=i.D();var u=!1;if(e.ud.Rw(i,a,h)&&(o.yI(),u=!0),!u){a=!1,u=!0,h*=h;for(var c=0;ca;a++)o[a]=-1;return e.h.yc(t,i)<=h*h?o[0]=0:(o[2]=0,o[6]=0),o[8]=2,n.fg(o,s)},n.fg=function(t,i){for(var h=0;9>h;h++)switch(i.charAt(h)){case"T":if(t[h]==-1)return!1;break;case"F":if(t[h]!=-1)return!1;break;case"0":if(t[h]!=0)return!1;break;case"1":if(t[h]!=1)return!1;break;case"2":if(t[h]!=2)return!1}return!0},n.uW=function(t,i,h){var s=[-1,-1,-1,-1,-1,-1,-1,-1,-1];if(t.B()&&i.B()){for(var o=0;9>o;o++)s[o]=-1;return this.fg(s,h)}return o=!1,t.B()&&(t=i,o=!0),s[0]=-1,s[1]=-1,s[3]=-1,s[4]=-1,s[6]=-1,s[7]=-1,s[8]=2,i=t.getType(),e.aa.Hc(i)?i==1736?t.Ke()!=0?(s[2]=2,s[5]=1):(s[5]=-1,i=new e.l,t.A(i),s[2]=i.ca()==0&&i.R()==0?0:1):(i=t.Qb()!=0,s[2]=i?1:0,s[5]=e.pi.aq(t)?0:-1):(s[2]=0,s[5]=-1),o&&this.vK(s),this.fg(s,h)},n.MR=function(t,i,h){return n.dQ(t)?3:n.UP(t)?4:n.cY(t,i,h)?8:n.CP(t,i,h)?16:n.eP(t)?1:n.EU(t,i,h)?32:0},n.dQ=function(t){return t.charAt(0)=="T"&&t.charAt(1)=="*"&&t.charAt(2)=="F"&&t.charAt(3)=="*"&&t.charAt(4)=="*"&&t.charAt(5)=="F"&&t.charAt(6)=="F"&&t.charAt(7)=="F"&&t.charAt(8)=="*"},n.UP=function(t){return t.charAt(0)=="F"&&t.charAt(1)=="F"&&t.charAt(2)=="*"&&t.charAt(3)=="F"&&t.charAt(4)=="F"&&t.charAt(5)=="*"&&t.charAt(6)=="*"&&t.charAt(7)=="*"&&t.charAt(8)=="*"},n.cY=function(t,i,h){return(i!=0||h!=0)&&((i!=2||h!=2)&&(t.charAt(0)=="F"&&t.charAt(1)=="*"&&t.charAt(2)=="*"&&t.charAt(3)=="T"&&t.charAt(4)=="*"&&t.charAt(5)=="*"&&t.charAt(6)=="*"&&t.charAt(7)=="*"&&t.charAt(8)=="*"||i==1&&h==1&&t.charAt(0)=="F"&&t.charAt(1)=="T"&&t.charAt(2)=="*"&&t.charAt(3)=="*"&&t.charAt(4)=="*"&&t.charAt(5)=="*"&&t.charAt(6)=="*"&&t.charAt(7)=="*"&&t.charAt(8)=="*")||h!=0&&t.charAt(0)=="F"&&t.charAt(1)=="*"&&t.charAt(2)=="*"&&t.charAt(3)=="*"&&t.charAt(4)=="T"&&t.charAt(5)=="*"&&t.charAt(6)=="*"&&t.charAt(7)=="*"&&t.charAt(8)=="*")},n.CP=function(t,i,h){return i>h?t.charAt(0)=="T"&&t.charAt(1)=="*"&&t.charAt(2)=="*"&&t.charAt(3)=="*"&&t.charAt(4)=="*"&&t.charAt(5)=="*"&&t.charAt(6)=="T"&&t.charAt(7)=="*"&&t.charAt(8)=="*":i==1&&h==1&&t.charAt(0)=="0"&&t.charAt(1)=="*"&&t.charAt(2)=="*"&&t.charAt(3)=="*"&&t.charAt(4)=="*"&&t.charAt(5)=="*"&&t.charAt(6)=="*"&&t.charAt(7)=="*"&&t.charAt(8)=="*"},n.eP=function(t){return t.charAt(0)=="T"&&t.charAt(1)=="*"&&t.charAt(2)=="*"&&t.charAt(3)=="*"&&t.charAt(4)=="*"&&t.charAt(5)=="*"&&t.charAt(6)=="F"&&t.charAt(7)=="F"&&t.charAt(8)=="*"},n.EU=function(t,i,h){if(i==h){if(i!=1)return t.charAt(0)=="T"&&t.charAt(1)=="*"&&t.charAt(2)=="T"&&t.charAt(3)=="*"&&t.charAt(4)=="*"&&t.charAt(5)=="*"&&t.charAt(6)=="T"&&t.charAt(7)=="*"&&t.charAt(8)=="*";if(t.charAt(0)=="1"&&t.charAt(1)=="*"&&t.charAt(2)=="T"&&t.charAt(3)=="*"&&t.charAt(4)=="*"&&t.charAt(5)=="*"&&t.charAt(6)=="T"&&t.charAt(7)=="*"&&t.charAt(8)=="*")return!0}return!1},n.Jw=function(t,i,h){t=i.La(t);for(var s=i.Re;s!=-1;s=i.Rf(s))if(i.xd(s)&t){var o=i.Me(s);if(o==-1)i.nn(s,h,0);else{var a=o,u=0;do i.dh(a)&t&&u++,a=i.jc(i.xa(a));while(a!=o);i.nn(s,h,u)}}},n.Zp=function(t){var i=""+t.charAt(0);return i+=t.charAt(3),i+=t.charAt(6),i+=t.charAt(1),i+=t.charAt(4),i+=t.charAt(7),i+=t.charAt(2),(i+=t.charAt(5))+t.charAt(8)},n.prototype.Yi=function(){for(var t=0;9>t;t++)this.J[t]=-2,this.Za[t]=-2},n.vK=function(t){var i=t[1],h=t[2],s=t[5];t[1]=t[3],t[2]=t[6],t[5]=t[7],t[3]=i,t[6]=h,t[7]=s},n.prototype.bj=function(t){for(this.Xc=t,t=0;9>t;t++)this.Xc.charAt(t)!="*"?(this.ea[t]=!0,this.le++):this.ea[t]=!1},n.prototype.UJ=function(){for(var t=0;9>t;t++)this.ea[t]&&this.J[t]==-2&&(this.J[t]=-1,this.ea[t]=!1)},n.prototype.pc=function(t){return this.J[t]!=-2&&(this.J[t]==-1?(this.ea[t]=!1,this.le--,!0):this.Xc.charAt(t)!="T"&&this.Xc.charAt(t)!="F"?!(this.J[t]a?1:0},n.prototype.reset=function(){this.yA=-1},n}(),r=function(){function n(){this.Wm=this.Gl=null,this.fb=new e.Yj,this.fb.RP(),this.$d=new f(this),this.fb.Vo(this.$d)}return n.prototype.HQ=function(){var t=!1;if(this.fw&&(t=this.IQ()),this.g.da(this.X)==1){var i=this.g.Ob(this.X);return t=this.g.wz(i),this.g.PB(i,!0),0>t&&(t=this.g.Xa(i),this.g.pJ(t),this.g.Wg(i,this.g.Ma(t)),!0)}for(this.El=this.g.Ky(),this.wo=this.g.Ky(),i=this.g.Ob(this.X);i!=-1;i=this.g.Rb(i))this.g.gr(i,this.El,0),this.g.gr(i,this.wo,-1);i=new e.ia(0),this.yh=NaN;var h=new e.h;this.et=this.g.da(this.X),this.ro=this.g.Gd(),this.Rs=this.g.Gd();for(var s=this.Gl.rc(this.Gl.je);s!=-1;s=this.Gl.lb(s)){var o=this.Gl.getData(s);if(this.g.Gc(o,h),h.y!=this.yh&&i.size!=0&&(t=this.ut(i)||t,this.$d.reset(),i.clear(!1)),i.add(o),this.yh=h.y,this.et==0)break}for(0=this.MA.length&&this.MA.push(new e.ig);var n=this.MA[this.Cw];return this.Cw++,n},r.prototype.clear=function(){this.wB(this.mo),this.wB(this.$s),this.wB(this.yw),this.Cw=0},r.prototype.Oo=function(n){this.mo.push(this.Ow(n))},r.prototype.ol=function(n){return n==0?this.$s.length:this.yw.length},r.prototype.Vp=function(n,t){return this.SR(n,t).$i},r.prototype.Ea=function(n,t){if(this.mo.length!=2)throw e.i.Qa();this.qa=n;var i=e.lc.ox(.01*n),h=!1,s=this.mo[0],o=this.mo[1];if(t||5&s.$i.zr(o.$i,n,!0)){if(s.$i.getType()==322){var a=s.$i;if(o.$i.getType()==322){t=o.$i;var u=e.yb.Zx(a,t,null,this.Fq,this.Bk,n);if(u==0)throw e.yb.Zx(a,t,null,this.Fq,this.Bk,n),e.i.Qa();n=Array(9),e.O.$u(n,null);for(var c=0;ci&&(h=!0)):y>g?(a.hc(l,x),l=new e.h,t.hc(p,l),e.h.yc(x,l)>i&&(h=!0)):(t.hc(p,x),y=new e.h,a.hc(l,y),e.h.yc(x,y)>i&&(h=!0)),n[c]=x}for(s=0,o=-1,c=0;c<=u;c++)(b=cthis.Bk[1]&&(b=this.Bk[0],this.Bk[0]=this.Bk[1],this.Bk[1]=b,c=a[0],a[0]=a[1],a[1]=c),s=0,o=-1,c=0;c<=u;c++)(b=c=o;o++){if((t=1>o?this.Fq[o]:1)!=i){var a=this.aB();n.ah(i,t,a),s!=-1&&a.get().Dc(h),o!=1&&a.get().Qc(h),i=t,this.$s.push(this.Ow(a.get()))}s=o}this.Bf.Cb(h)}},r}();e.TC=f}(k||(k={})),function(e){var v=function(){function f(r){this.Ds=this.rk=this.sb=null,this.ag=0,this.zm=!1,this.zf=-1,this.Cl=this.Jd=0,this.gb=-1,this.ib=r,this.ag=this.Wx(this.Cl),this.zm=!1,this.rk=null,this.Ds=new e.h}return f.prototype.BW=function(r){if(this.ib!=r.ib)throw e.i.Hb();this.zf=r.zf,this.Jd=r.Jd,this.gb=r.gb,this.Cl=r.Cl,this.ag=r.ag,this.zm=r.zm,this.rk=null},f.prototype.ha=function(){if(this.zf!=this.Jd&&this.BD(),this.zm)this.Jd=(this.Jd+1)%this.ag;else{if(this.Jd==this.ag)throw e.i.ce();this.Jd++}return this.rk},f.prototype.li=function(){if(this.zm)this.Jd=(this.ag+this.Jd-1)%this.ag;else{if(this.Jd==0)throw e.i.ce();this.Jd--}return this.Jd!=this.zf&&this.BD(),this.rk},f.prototype.DW=function(){this.zf=-1,this.Jd=0},f.prototype.EW=function(){this.Jd=this.ag,this.zf=-1},f.prototype.Vb=function(r,n){if(n===void 0&&(n=-1),0<=this.gb&&this.gb=t&&r=this.ib.Ba(n)&&r=this.ib.da())&&(this.zf=-1,this.Jd=0,this.ag=this.Wx(this.gb),this.ib.Ba(this.gb),this.ib.dc(this.gb),this.Cl++,!0)},f.prototype.Zi=function(){this.ag=this.Jd=this.zf=-1,this.Cl=0,this.gb=-1},f.prototype.Wx=function(r){if(this.ib.Ac())return 0;var n=1;return this.ib.dc(r)&&(n=0),this.ib.Ja(r)-n},f.prototype.On=function(){return this.zf==this.ag-1&&this.ib.dc(this.gb)},f.prototype.JB=function(){this.zm=!0},f.prototype.wb=function(){return this.ib.nb.o[this.gb]+this.zf},f.prototype.IM=function(){return this.ib.Ba(this.gb)},f.prototype.ik=function(){return this.On()?this.ib.Ba(this.gb):this.wb()+1},f.prototype.vm=function(){return this.zf==0},f.prototype.Qn=function(){return this.zf==this.ag-1},f.prototype.Ha=function(){return this.Jdthis.Jd||this.Jd>=this.ag)throw e.i.ce();this.zf=this.Jd;var r=this.wb();this.ib.mc();var n=this.ib.Ve,t=1;switch(n!=null&&(t=7&n.read(r)),n=this.ib.description,t){case 1:this.sb==null&&(this.sb=new e.yb),this.rk=this.sb;break;case 2:throw e.i.fa("internal error");default:throw e.i.Qa()}this.rk.Nf(n),t=this.ik(),this.ib.Gc(r,this.Ds),this.rk.Dc(this.Ds),this.ib.Gc(t,this.Ds),this.rk.Qc(this.Ds);for(var i=1,h=n.Aa;ih&&(s=n,n=i,i=s,s=t,t=h,h=s,s=-1),!(0>h||t>=this.pl)){0>n&&0>i?i=n=-1:n>=this.oi&&i>=this.oi&&(i=n=this.oi);var o=(i-n)/(h-t);h>this.pl&&(i=o*((h=this.pl)-t)+n),0>t&&(n=o*(0-t)+n,t=0);var a=Math.max(this.oi+1,8388607);-8388607>n?(t=(0-n)/o+t,n=0):n>a&&(t=(this.oi-n)/o+t,n=this.oi),-8388607>i?h=(0-n)/o+t:i>a&&(h=(this.oi-n)/o+t),(t=e.O.truncate(t))!=(h=e.O.truncate(h))&&((i=new v).x=e.O.truncate(4294967296*n),i.y=t,i.H=h,i.WP=e.O.truncate(4294967296*o),i.dir=s,this.Wl==null&&(this.Wl=e.O.lg(this.pl,null)),i.next=this.Wl[i.y],this.Wl[i.y]=i,i.ythis.Kw&&(this.Kw=i.H),this.Tq++)}}},r.prototype.sN=function(){if(this.Jh!=null){for(var n=!1,t=null,i=this.Jh;i!=null;)if(i.y++,i.y==i.H){var h=i;i=i.next,t!=null?t.next=i:this.Jh=i,h.next=null}else i.x+=i.WP,t!=null&&t.x>i.x&&(n=!0),t=i,i=i.next;n&&(this.Jh=this.fK(this.Jh))}},r.prototype.lN=function(n){if(!(n>=this.pl)){var t=this.Wl[n];if(t!=null){this.Wl[n]=null,t=this.fK(t),this.Tq-=this.gK,n=this.Jh;for(var i=!0,h=t,s=null;n!=null&&h!=null;)n.x>h.x?(i&&(this.Jh=h),i=h.next,h.next=n,s!=null&&(s.next=h),s=h,h=i):(i=n.next,n.next=h,s!=null&&(s.next=n),s=n,n=i),i=!1;this.Jh==null&&(this.Jh=t)}}},r.eK=function(n,t){return 0>n?0:n>t?t:n},r.prototype.ZP=function(){if(this.Jh!=null){for(var n=0,t=this.Jh,i=e.O.truncate(e.O.XG(t.x)),h=t.next;h!=null;h=h.next)if(n=this.kF?1^n:n+h.dir,h.x>t.x){var s=e.O.truncate(e.O.XG(h.x));n!=0&&(t=r.eK(i,this.oi),(i=r.eK(s,this.oi))>t&&tthis.Kf[1].x&&(n=this.Kf[0],this.Kf[0]=this.Kf[1],this.Kf[1]=n):r.AN(this.Kf,t,function(s,o){return s==o?0:s.xo.x?1:0}),n=this.Kf[0],this.Kf[0]=null,i=n,h=1;hthis.Wh.size)break;var u=this;for(this.xe.Vd(0,this.xe.size,function(c,l){return u.pM(c,l)}),t=0,i=this.xe.size;tb?1:xm?1:0)==0&&(x=(y=u[c*y+3])<(d=u[c*d+3])?-1:y==d?0:1),x}),this.Pq=this.g.Gd(),this.oe=new e.jp,this.RA=this.oe.Ph(0),this.oe.fn(t),h=0;hu;u++){for(c=y[u],l=t[u],p=u-1;0<=p&&y[p]>c;)y[p+1]=y[p],t[p+1]=t[p],p--;y[p+1]=c,t[p+1]=l}return y=0,t[0]!=0&&(y|=1),t[1]!=0&&(y|=2),t[2]!=0&&(y|=4),t[3]!=0&&(y|=8),(y==5||y==10)&&(r==n?r?(this.g.Bc(a,i),this.g.Cc(i,a),this.g.Bc(h,o),this.g.Cc(o,h)):(this.g.Cc(a,i),this.g.Bc(i,a),this.g.Cc(h,o),this.g.Bc(o,h)):r?(this.g.Cc(i,s),this.g.Bc(s,i),this.g.Cc(o,h),this.g.Bc(h,o)):(this.g.Bc(i,s),this.g.Cc(s,i),this.g.Bc(o,h),this.g.Cc(h,o)),!0)},f.prototype.tD=function(r,n,t,i,h,s){this.MY?this.VM():this.UM(r,n,t,i,h,s)},f.prototype.VM=function(){throw e.i.fa("not implemented.")},f.prototype.UM=function(r,n,t,i,h,s){if(r!=n)r?(this.g.Bc(t,h),this.g.Cc(h,t),this.g.Bc(s,i),this.g.Cc(i,s),this.vn(h,t),this.ui(h,!0),this.g.mi(h,!0),this.bk(t),this.vn(s,i),this.ui(s,!0),this.g.mi(s,!1)):(this.g.Bc(h,t),this.g.Cc(t,h),this.g.Bc(i,s),this.g.Cc(s,i),this.vn(h,t),this.ui(h,!0),this.g.mi(h,!1),this.bk(t),this.vn(s,i),this.ui(s,!0),this.g.mi(s,!0)),this.bk(i);else{var o=r?t:i,a=n?h:s;for(r=r?i:t,n=n?s:h,h=!1,this.g.Bc(o,a),this.g.Bc(a,o),this.g.Cc(r,n),this.g.Cc(n,r),s=n;s!=a;)t=this.g.Ma(s),i=this.g.U(s),this.g.Cc(s,i),this.g.Bc(s,t),h=h||s==o,s=i;h||(t=this.g.Ma(a),i=this.g.U(a),this.g.Cc(a,i),this.g.Bc(a,t)),this.vn(a,o),this.ui(a,!0),this.g.mi(a,!1),this.bk(o),this.vn(n,r),this.ui(n,!0),this.g.mi(n,!1),this.bk(r)}},f.prototype.cD=function(){for(var r=!1,n=this.g.Ob(this.X);n!=-1;){for(var t=this.g.Xa(n),i=0,h=this.g.Ja(n);ithis.g.Ja(n)){for(r=this.g.Xa(n),i=0,h=this.g.Ja(n);i=n)throw e.i.N("Invalid or unsupported wkid: "+n);var t=new r;return t.dg=n,t},r.qP=function(n){if(n==null||n.length==0)throw e.i.N("Cannot create SpatialReference from null or empty text.");var t=new r;return t.wh=n,t},r.prototype.Nb=function(n){return this==n||n!=null&&this.constructor==n.constructor&&this.dg==n.dg&&(this.dg!=0||this.wh===n.wh)},r.prototype.toString=function(){return"[ tol: "+this.Kn()+"; wkid: "+this.Ec()+"; wkt: "+this.Bz()+"]"},r.prototype.cc=function(){if(this.pp!=="")return this.pp;var n=this.toString();if(Array.prototype.reduce)return this.pp="S"+n.split("").reduce(function(h,s){return(h=(h<<5)-h+s.charCodeAt(0))&h},0);var t=0;if(n.length===0)return"";for(var i=0;i=n.length)throw e.i.N();var t=null;try{t=e.NC.fromString(n)}catch{t=null}return t==null?null:r.bD(t,!0)},r.prototype.by=function(n){this.Kd=n,this.Eo=this.Kd.Hd()},r.prototype.gy=function(n){this.KH=n,this.ST=this.KH!=null?this.KH.Eo:null},r.prototype.Wc=function(){return this.Sb()!=0&&this.Sb()!=3&&this.Kd.Wc()},r.prototype.IG=function(){return this.Sb()!=0&&(this.Sb()==3?this.Ji.fk().Wc():this.Kd.Wc())},r.prototype.eh=function(){return this.Kd!=null?this.Kd.Ue:null},r.prototype.pm=function(){return this.Kd.pm()},r.prototype.bf=function(){return this.Kd.bf()},r.prototype.hh=function(){return this.Kd!=null?this.Kd.sw:NaN},r.prototype.Up=function(){return this.Kd.Up()},r.prototype.Wr=function(){return this.Kd.Wr()},r.prototype.kk=function(){return this.Kd.kk()},r.prototype.kS=function(n){return e.OC.Py(this.Kd,n.Kd)},r.prototype.ml=function(){return this.Kd.ml()},r.prototype.Vr=function(){return this.Kd.Vr()},r.prototype.zi=function(){return this.Sb()==3?this.Ji.fk().zi():this.Kd.zi()},r.prototype.gh=function(){if(!this.Wc())throw e.i.N("!isPannable()");var n=new e.l;return this.Kd.gh(n),n},r.prototype.Oe=function(){if(!this.Wc())throw e.i.N("!isPannable()");return this.Kd.so},r.prototype.HR=function(){if(!this.Wc())throw e.i.N("!isPannable()");var n=new e.l;return this.Kd.GR(n),n},r.prototype.pv=function(){if(!this.Wc())throw e.i.N("!isPannable()");return this.Kd.pv()},r.prototype.ov=function(){if(!this.Wc())throw e.i.N("!isPannable()");return this.Kd.ov()},r.prototype.Xr=function(){return this.Ji!=null?this.Ji.fk().Xr():this.Kd.Xr()},r.prototype.PQ=function(){return this.Kd.hv()},r.prototype.Qp=function(){return this.Eo.getUnitFactor()},r.prototype.vz=function(n){return this.Hq.vz(n)},r.prototype.sc=function(){var n=this.Sb();if(n==1)return this;if(n==3)return this.Ji.fk().sc();if(n==0||n===4)throw e.i.fa("invalid call");if(this.jw!==null)return this.jw;if((n=this.eh().getGeogcs())==null)throw e.i.Qa();return this.jw=r.bF(n,this.Hq.VF())},r.bF=function(n,t){if(n==null)throw e.i.N("null pointer.");var i=new r;return n=r.mu(n,!0),i.Hq.Xx(n,null,t),i.by(n),i.gy(null),i.dg=n.$r(),i},r.prototype.Sb=function(){var n=this.eh();if(n!=null)switch(n.getType()){case e.Sc.PE_TYPE_GEOGCS:return 1;case e.Sc.PE_TYPE_PROJCS:return 2}return 4},r.prototype.hv=function(){return this.Kd.hv()},r.mu=function(n,t){var i=n.getCode();if(0>=i&&0<(i=e.pf.getCode(n))){if((n=e.pf.coordsys(i))==null)throw e.i.N("Text to wkid mapping had failed: "+i);return r.mu(n,t)}if(t&&0=i?n:e.pf.coordsys(i),n=new e.OC(n),r.lK[t]=n,0=n)throw e.i.N("Invalid or unsupported wkid: "+n);var t=r.qx[n];if(t!=null)return t;if((t=e.pf.coordsys(n))==null)throw e.i.N("Invalid or unsupported wkid: "+n);return(t=r.mu(t,!1)).$r()!=n&&(r.qx[n]=t),t},r.kM=function(n){if(n==null||n===void 0||n.length==0)throw e.i.N("Cannot create SpatialReference from null or empty text.");var t=null;try{t=e.pf.fromString(e.Sc.PE_TYPE_COORDSYS,n)}catch(i){throw e.i.N("Cannot create SpatialReference from text. "+i.message)}if(t===null)throw e.i.N("Cannot create SpatialReference from text. ");return r.mu(t,!0)},r.bD=function(n,t){var i,h=n.getCode();if(0>=h&&0<(h=e.pf.getCode(n))){if((h=e.pf.vertcs(h))===null)throw e.i.N();return r.bD(h,t)}if(t&&0=h||(i=e.pf.vertcs(h)),i===null)throw e.i.N();return i=new e.PL(i),r.mK[n]=i,0t&&(this.Pj=t/(h-this.Fm)),i=this.Gm+i,(s=e.O.truncate((i-this.Gm)*this.Pj))>t&&(this.Pj=t/(i-this.Gm))}},n.prototype.aC=function(t){switch(t){case 0:this.Ik=void 0;case 1:this.Mq=void 0;case 2:this.Lq=void 0}},n.prototype.Kn=function(t){switch(t){case 0:return this.Ik;case 1:return this.Mq;case 2:return this.Lq}return 0},n.prototype.vz=function(t){if(this.Rm==v.FloatingPoint)return 0;switch(t){case 0:return 1/this.Pj;case 1:case 2:return 1/this.Fo;default:return 0}},n.prototype.toString=function(){var t="SRPD [m_toleranceXY: "+this.Ik.toString();return(t=(t=(t=(t=(t=(t=(t=(t=(t=t+";m_falseX: "+this.Fm.toString())+";m_falseY: "+this.Gm.toString())+";m_unitsXY: "+this.Pj.toString())+";m_falseZ: "+this.sA.toString())+";m_unitsZ: "+this.Fo.toString())+";m_falseM: "+this.rA.toString())+";m_toleranceZ: "+this.Mq.toString())+";m_toleranceM: "+this.Lq.toString())+";m_precision: "+this.Rm.toString())+"] "},n}();e.ZL=r}(k||(k={})),function(e){function v(h,s){return 89.99999s&&(s=-89.99999),s*=.017453292519943,[111319.49079327169*h,31890685e-1*Math.log((1+Math.sin(s))/(1-Math.sin(s)))]}function f(h,s,o){return h=h/6378137*57.29577951308232,o?[h,57.29577951308232*(1.5707963267948966-2*Math.atan(Math.exp(-1*s/6378137)))]:[h-360*Math.floor((h+180)/360),57.29577951308232*(1.5707963267948966-2*Math.atan(Math.exp(-1*s/6378137)))]}function r(h,s,o){var a=h.Of();if(h.getType()===33)s=s(a.Lg(),a.ih()),a.Cb(s[0],s[1]);else if(h.getType()===197){var u=s(h.es(),h.gs(),o);s=s(h.ds(),h.fs(),o),a.K(u[0],u[1],s[0],s[1])}else for(u=new e.h,h=0;ho&&(o=637.100877141506);for(var a,u=[],c=0;cthis.Hg&&this.Dz(r)},f.prototype.tx=function(r,n){r*=this.stride,n*=this.stride;for(var t=0;tthis.ns.va)return 1;s=h.na==h.la;var o=i.na==i.la;if(s||o){if(s&&o)return 0;if(h.na==i.na&&h.sa==i.sa)return s?1:-1;if(h.la==i.la&&h.pa==i.pa)return s?-1:1}return(s=h.Pe(this.yh,this.ms.oa))==(o=i.Pe(this.yh,this.ns.oa))&&((o=.5*((s=Math.min(h.la,i.la))+this.yh))==this.yh&&(o=s),s=h.Pe(o,this.ms.oa),o=i.Pe(o,this.ns.oa)),so?1:0},t.prototype.aK=function(i){this.yh=i},t}(),n=function(){function t(i){this.ib=i,this.WH=new e.ig,this.Bf=new e.h,this.wA=new e.Nc}return t.prototype.kX=function(i){this.Bf.L(i)},t.prototype.compare=function(i,h){return this.ib.pB(i.ja(h),this.WH),i=this.WH.get(),this.wA.K(i.sa,i.pa),this.Bf.xthis.wA.va?1:(i=i.Pe(this.Bf.y,this.Bf.x),this.Bf.xi?1:0)},t}();v=function(){function t(){this.hH=this.Di=this.Gi=this.kA=this.Yn=this.ye=this.Kc=this.jh=this.ge=null,this.Go=this.xg=-1,this.gH=!0,this.pA=!1,this.lA=NaN,this.Ni=new e.Md,this.bO=2147483647,this.aO=e.O.truncate(-2147483648),this.cg=this.ae=this.Hl=this.Cq=this.Cm=this.Bq=this.Os=this.Re=-1,this.wa=0}return t.prototype.yy=function(i){this.lA=i},t.prototype.Ym=function(){this.ge==null&&(this.ge=new e.$c(8));var i=this.ge.Ce();return this.ge.S(i,1,0),i},t.prototype.vU=function(){this.Kc==null&&(this.Kc=new e.$c(8));var i=this.Kc.Ce();this.Kc.S(i,2,0),this.Kc.S(i,3,0);var h=this.Kc.Ce();return this.Kc.S(h,2,0),this.Kc.S(h,3,0),this.JJ(i,h),this.JJ(h,i),i},t.prototype.mI=function(){this.ye==null&&(this.ye=new e.$c(8));var i=this.ye.Ce();return this.ye.S(i,2,0),i},t.prototype.TW=function(i,h){this.ge.S(i,7,h)},t.prototype.mn=function(i,h){this.ge.S(i,2,h)},t.prototype.SW=function(i,h){this.ge.S(i,1,h)},t.prototype.lX=function(i,h){this.ge.S(i,3,h)},t.prototype.iX=function(i,h){this.ge.S(i,4,h)},t.prototype.cr=function(i,h){this.ge.S(i,5,h)},t.prototype.eR=function(i){return this.ge.T(i,5)},t.prototype.RW=function(i,h){this.ge.S(i,6,h)},t.prototype.cN=function(i,h){this.RW(h,i)},t.prototype.IJ=function(i,h){this.Kc.S(i,1,h)},t.prototype.JJ=function(i,h){this.Kc.S(i,4,h)},t.prototype.Tl=function(i,h){this.Kc.S(i,5,h)},t.prototype.Sl=function(i,h){this.Kc.S(i,6,h)},t.prototype.$W=function(i,h){this.Kc.S(i,2,h)},t.prototype.$w=function(i,h){this.Kc.S(i,3,h)},t.prototype.LF=function(i){return this.Kc.T(i,3)},t.prototype.Gt=function(i,h){this.Kc.S(i,7,h)},t.prototype.EK=function(i,h){if(this.mm(i)!=-1)for(h=h?-1:i,i=this.mm(i);i!=-1;i=this.js(i))this.g.Ra(this.tj(i),this.Cq,h)},t.prototype.yx=function(i,h){i!=-1&&(this.EK(i,h),this.EK(this.xa(i),h))},t.prototype.Dt=function(i,h){this.ye.S(i,1,h)},t.prototype.Vg=function(i,h){this.ye.S(i,2,h)},t.prototype.jn=function(i,h){this.ye.S(i,3,h),this.NW(i,this.dR(h)),this.MW(h,i)},t.prototype.MW=function(i,h){this.ye.S(i,4,h)},t.prototype.NW=function(i,h){this.ye.S(i,5,h)},t.prototype.DJ=function(i,h){this.ye.S(i,6,h)},t.prototype.BJ=function(i,h){this.ye.S(i,7,h)},t.prototype.AJ=function(i,h){this.Yn.write(i,h)},t.prototype.CJ=function(i,h){this.kA.write(i,h)},t.prototype.kY=function(i){var h=0,s=0,o=this.AF(i),a=new e.h,u=new e.h,c=new e.h;this.Yr(o,a),u.L(a);var l=o;do this.lm(l,c),s+=e.h.tb(u,c),this.$e(this.xa(l))!=i&&(h+=(c.x-a.x-(u.x-a.x))*(c.y-a.y+(u.y-a.y))*.5),u.L(c),l=this.jc(l);while(l!=o);this.Yn.write(i,h),this.kA.write(i,s)},t.prototype.PU=function(i,h){var s=new r(this),o=new e.Yj;o.De(e.O.truncate(this.wa/2)),o.Vo(s);for(var a=new e.ia(0),u=this.$g(),c=null,l=0,p=new e.h,y=this.Re;y!=-1;y=this.Rf(y)){if(!(255&++l)&&h!=null&&!h.progress(-1,-1))throw e.i.WC();var d=this.Me(y);if(d!=-1){if(a.Bh(0),!this.gY(o,u,a,d)){this.D(y,p),s.aK(p.y);var g=d;do{var b=this.Ab(g,u);b!=-1&&(o.vd(b,-1),this.Kb(g,u,-2)),g=this.jc(this.xa(g))}while(d!=g);g=d;do(b=this.Ab(g,u))==-1&&(b=o.addElement(g,-1),a.add(b)),g=this.jc(this.xa(g));while(d!=g)}for(d=a.size-1;0<=d;d--)b=a.get(d),g=o.ja(b),this.Kb(this.xa(g),u,b),this.OU(o,b,i)}else this.cz(y)==-1&&(c==null&&(c=new n(this)),this.D(y,p),c.kX(p),g=o.IW(c),d=this.Hl,g!=-1&&(b=o.ja(g),this.$e(b)==this.$e(this.xa(b))&&(b=this.OF(o,g)),b!=-1&&(d=this.$e(b))),this.cN(d,y))}this.Jg(u)},t.prototype.OU=function(i,h,s){var o=i.ja(h),a=this.$e(o);if(this.Gn(a)==-1){var u=this.OF(i,h),c=this.xa(o),l=this.$e(c);this.Kp(a),this.Kp(l);var p=this.Gn(a),y=this.Gn(l);if(u==-1&&p==-1&&(l==a?(this.jn(l,this.Hl),p=y=this.Hl):(y==-1&&(this.jn(l,this.Hl),y=this.Hl),this.jn(a,l),p=l)),u!=-1){var d=this.$e(u);y==-1&&(0>=this.Kp(d)?(y=this.Gn(d),this.jn(l,y)):(this.jn(l,d),y=d),l==a&&(p=y))}p==-1&&this.hY(a,l),s==0?this.jW(i,h,o,u,a,l):s==5?this.kW(i,h,o,c,a,l):s==4&&this.iW(o,u,a,l)}},t.prototype.jW=function(i,h,s,o,a,u){var c=this.hk(a);if(o!=-1){var l=this.hk(u),p=this.hk(this.$e(o));o=c&l&p,p^=p&this.dh(s),(p|=o)!=0&&(this.Vg(u,l|p),this.Vg(a,p|c),c=c||p)}for(h=i.lb(h);h!=-1&&(o=i.ja(h),s=this.$e(this.xa(o)),a=this.hk(s),u=this.dh(o),l=this.$e(o),o=a&(p=this.hk(l))&c,c^=c&u,(c|=o)!=0);h=i.lb(h))this.Vg(s,a|c),this.Vg(l,p|c)},t.prototype.kW=function(i,h,s,o,a,u){if(a!=u){s=this.Ab(s,this.cg),s+=this.Ab(o,this.cg),o=0;var c=new e.ia(0),l=new e.ia(0);l.add(0);for(var p=i.rc(-1);p!=h;p=i.lb(p)){var y=i.ja(p),d=this.xa(y),g=this.$e(y),b=this.$e(d);if(g!=b){if(y=this.Ab(y,this.cg),o+=y+=this.Ab(d,this.cg),d=!1,c.size!=0&&c.Fc()==b&&(l.If(),c.If(),d=!0),this.Gn(b)==-1)throw e.i.Qa();d&&this.Gn(b)==g||(l.add(o),c.add(g))}}o+=s,c.size!=0&&c.Fc()==u&&(l.If(),c.If()),o!=0?l.Fc()==0&&(i=this.g.ld,i=this.La(i),this.Vg(a,i)):l.Fc()!=0&&(i=this.g.ld,i=this.La(i),this.Vg(a,i))}},t.prototype.iW=function(i,h,s,o){var a=this.La(this.g.ld);if(h==-1)this.Vg(o,this.Go),1&(i=this.Ab(i,this.xg))?this.Vg(s,a):this.Vg(s,this.Go);else{var u=this.hk(o);u==0?(u=this.hk(this.$e(h)),this.Vg(o,u),1&(i=this.Ab(i,this.xg))?this.Vg(s,u==a?this.Go:a):this.Vg(s,u)):1&(i=this.Ab(i,this.xg))?this.Vg(s,u==a?this.Go:a):this.Vg(s,u)}},t.prototype.gY=function(i,h,s,o){var a=o,u=-1,c=-1,l=0;do{if(l==2)return!1;var p=this.Ab(a,h);if(p!=-1){if(u!=-1)return!1;u=p}else{if(c!=-1)return!1;c=a}l++,a=this.jc(this.xa(a))}while(o!=a);return c!=-1&&u!=-1&&(this.Kb(i.ja(u),h,-2),i.Sj(u,c),s.add(u),!0)},t.prototype.hY=function(i,h){var s=this.Kp(i);if(s!=0){var o=this.Kp(h);0o||0>s&&0y.compare(a)?p=1:u=-1,this.Kb(g,this.ae,0),this.Kb(d,this.ae,0),this.Kb(d,this.cg,p),this.Kb(g,this.cg,u)):i==7?(this.Kb(g,this.ae,this.Go),this.Kb(d,this.ae,l==1736?c:0)):i==4&&(this.Kb(g,this.ae,0),this.Kb(d,this.ae,0),this.Kb(d,this.xg,1),this.Kb(g,this.xg,1)),l=l==1736?this.aO:0,this.$w(d,c|l),this.$w(g,c|l)}}}}},t.prototype.VT=function(i,h){var s=this.mm(h);if(s!=-1){var o=this.mm(i);this.jh.S(s,1,o),this.Gt(i,s),this.Gt(h,-1)}i=this.xa(i),h=this.xa(h),(s=this.mm(h))!=-1&&(o=this.mm(i),this.jh.S(s,1,o),this.Gt(i,s),this.Gt(h,-1))},t.prototype.IX=function(i){function h(M,A){return o.HO(M,A)}var s=new e.ia(0);s.Jb(10);for(var o=this,a=this.Re;a!=-1;a=this.Rf(a)){s.clear(!1);var u=this.Me(a);if(u!=-1){var c=u;do s.add(c),c=this.jc(this.xa(c));while(c!=u);if(1n.Db())return f.ki(f.Xe(n.Ia()),r,"&")}return s=new f,o=(h=new e.gd).Ib(f.Xe(r)),n=h.Ib(f.Xe(n)),s.Ft(h,t,i),i=s.Av(o,n),r=f.ki(h.Ne(i),r,"&"),e.aa.Hc(r.getType())&&(r.Ch(2,t),r.getType()==1736&&r.fm()),r},f.bW=function(r,n,t){if(r.B()||n.B())return r.Ia();var i=[null],h=[0],s=n.Db()==2;if(n.Db()!=1&&n.Db()!=2)throw e.i.Qa();return i[0]=r.D(),s?e.hd.sK(n,i,1,t,h):e.hd.tK(n,i,1,t,h),h[0]==0?r.Ia():r},f.prototype.LU=function(r,n,t,i,h){if(r.B())return r;var s=new e.gd;return r=s.Ib(r),this.Mk(s,r,n,t,i,h)},f.prototype.NU=function(r,n,t,i,h,s){if(h&&r.ic(n)!=550){var o=new e.RC;o.TX(r,t),o.Ng?(e.Tk.V(r,t,s,!0),h=!1):this.j.yy(t)}else e.Tk.V(r,t,s,!0),h=!1;if(i&&r.ic(n)!=550?this.j.wJ(r,n,s):this.j.vJ(r,n,s),this.j.pA)return this.j.Ug(),this.j=null,this.Mk(r,n,t,i,!1,s);if(this.j.yy(NaN),s=this.j.La(n),this.bq(s+1),this.Gj[s]=!0,r.ic(n)==1736||i&&r.ic(n)!=550)return r.Yo(n,0),n=this.Ot(n,-1,-1),(r=r.Ne(n)).Yo(0),h?r.Ch(1,0):(r.Ch(2,t),r.fm()),r;if(r.ic(n)==1607)return n=this.Pt(-1),r=r.Ne(n),h||r.Ch(2,t),r;if(r.ic(n)==550)return n=this.mr(),r=r.Ne(n),h||r.Ch(2,t),r;throw e.i.Qa()},f.prototype.Mk=function(r,n,t,i,h,s){this.j=new e.iu;try{return this.NU(r,n,t,i,h,s)}finally{this.j.Ug()}},f.Mk=function(r,n,t,i,h){return new f().LU(r,n,t,i,h)},f.prototype.MU=function(r,n,t,i){this.Mv=r,this.j=new e.iu,r=n.In(t);var h=n.ic(t);if(r!=1||h==550?this.j.vJ(n,t,i):this.j.wJ(n,t,i),!this.j.pA)if(this.j.yy(NaN),i=this.j.La(t),this.bq(i+1),this.Gj[i]=!0,n.ic(t)==1736||r==1&&n.ic(t)!=550)n.Yo(t,0),i=this.Ot(t,-1,-1),n.hC(i,t),n.BB(i);else if(n.ic(t)==1607)i=this.Pt(-1),n.hC(i,t),n.BB(i);else{if(n.ic(t)!=550)throw e.i.fa("internal error");i=this.mr(),n.hC(i,t),n.BB(i)}},f.prototype.im=function(r,n){var t=e.aa.tf(this.j.g.ic(r)),i=e.aa.tf(this.j.g.ic(n));if(t>i)return r;var h=this.j.La(r),s=this.j.La(n);if(this.bq(1+(h|s)),this.Gj[this.j.La(r)]=!0,t==2&&i==2)return this.Ot(r,n,-1);if(t==1&&i==2||t==1&&i==1)return this.Pt(-1);if(t==0)return this.mr();throw e.i.Qa()},f.prototype.Av=function(r,n){var t=e.aa.tf(this.j.g.ic(r)),i=e.aa.tf(this.j.g.ic(n)),h=this.j.La(r),s=this.j.La(n);if(this.bq(1+(h|s)),this.Gj[this.j.La(r)|this.j.La(n)]=!0,h=-1,1n.Db())return f.ki(f.Xe(r),r,"-");var h=new e.l;r.A(h);var s=new e.l;if(n.A(s),!h.isIntersecting(s))return f.ki(f.Xe(r),r,"-");var o=new e.l;return o.K(h),o.Zb(s),t=e.ta.Wd(t,o,!0),s=new f,o=(h=new e.gd).Ib(f.Xe(r)),n=h.Ib(f.Xe(n)),s.Ft(h,t,i),i=s.im(o,n),i=h.Ne(i),r=f.ki(i,r,"-"),e.aa.Hc(r.getType())&&(r.Ch(2,t),r.getType()==1736&&r.fm()),r},f.VP=function(r,n,t){if(2>r.length)throw e.i.N("not enough geometries to dissolve");for(var i=0,h=0,s=r.length;hc?f.Xe(r[l]):(r=i==2,n=e.ta.Wd(i==0?n:null,o,!0),new f().Mk(a,u,n,r,!0,t))},f.Pz=function(r,n,t,i){var h=[null,null,null],s=new e.l;r.A(s);var o=new e.l;n.A(o);var a=new e.l;if(a.K(s),a.Zb(o),t=e.ta.Wd(t,a,!0),(a=new e.l).K(o),o=e.ta.Er(t),a.W(o,o),!s.isIntersecting(a)){if(r.Db()<=n.Db())return h[(r=f.ki(f.Xe(r.Ia()),r,"&")).Db()]=r,h;if(r.Db()>n.Db())return h[(r=f.ki(f.Xe(n.Ia()),r,"&")).Db()]=r,h}for(o=new f,a=(s=new e.gd).Ib(f.Xe(r)),n=s.Ib(f.Xe(n)),o.Ft(s,t,i),i=o.Pz(a,n),n=0;nn.Db())return f.ki(f.Xe(r),r,"^");if(r.Db()t;t++)n[t]=new e.h;r.nB(n),this.fY(n,n),r.Zw(n,4)}},f.prototype.fY=function(r,n){for(var t=0;t(n=.5*n.Sk())?Math.sqrt(i):Math.sqrt(n))},f.prototype.RB=function(){this.bb=1,this.jb=this.Gb=this.eb=0,this.ab=1,this.Lb=0},f.prototype.isIdentity=function(r){if(r!==void 0){var n=e.h.construct(0,1);return this.Eh(n,n),n.sub(e.h.construct(0,1)),n.Sk()>r*r?!1:(n.ma(0,0),this.Eh(n,n),!(n.Sk()>r*r)&&(n.ma(1,0),this.Eh(n,n),n.sub(e.h.construct(1,0)),n.Sk()<=r*r))}return this.bb==1&&this.ab==1&&this.eb==0&&this.Gb==0&&this.jb==0&&this.Lb==0},f.prototype.Bi=function(r){return Math.abs(this.bb*this.ab-this.jb*this.eb)<=2*r*(Math.abs(this.bb*this.ab)+Math.abs(this.jb*this.eb))},f.prototype.gg=function(r,n){this.bb=1,this.eb=0,this.Gb=r,this.jb=0,this.ab=1,this.Lb=n},f.prototype.setScale=function(r,n){n!==void 0?(this.bb=r,this.jb=this.Gb=this.eb=0,this.ab=n,this.Lb=0):this.setScale(r,r)},f.prototype.$B=function(){this.bb=0,this.eb=1,this.Gb=0,this.jb=1,this.Lb=this.ab=0},f.prototype.setRotate=function(r){this.pX(Math.cos(r),Math.sin(r))},f.prototype.pX=function(r,n){this.bb=r,this.eb=-n,this.Gb=0,this.jb=n,this.ab=r,this.Lb=0},f.prototype.shift=function(r,n){this.Gb+=r,this.Lb+=n},f.prototype.scale=function(r,n){this.bb*=r,this.eb*=r,this.Gb*=r,this.jb*=n,this.ab*=n,this.Lb*=n},f.prototype.flipX=function(r,n){this.bb=-this.bb,this.eb=-this.eb,this.Gb=r+n-this.Gb},f.prototype.flipY=function(r,n){this.jb=-this.jb,this.ab=-this.ab,this.Lb=r+n-this.Lb},f.prototype.rotate=function(r){var n=new f;n.setRotate(r),this.multiply(n)},f.prototype.inverse=function(r){if(r!==void 0){var n=this.bb*this.ab-this.eb*this.jb;n==0?r.lx():(n=1/n,r.Gb=(this.eb*this.Lb-this.Gb*this.ab)*n,r.Lb=(this.Gb*this.jb-this.bb*this.Lb)*n,r.bb=this.ab*n,r.eb=-this.eb*n,r.jb=-this.jb*n,r.ab=this.bb*n)}else this.inverse(this)},f}();e.Dd=v}(k||(k={})),function(e){var v=function(){function f(){}return f.prototype.lx=function(){this.hg=this.Lb=this.Gb=this.He=this.Fe=this.Ee=this.Ge=this.ab=this.eb=this.Ze=this.jb=this.bb=0},f.prototype.setScale=function(r,n,t){this.bb=r,this.eb=this.Ze=this.jb=0,this.ab=n,this.Fe=this.Ee=this.Ge=0,this.He=t,this.hg=this.Lb=this.Gb=0},f.prototype.setTranslate=function(r,n,t){this.bb=1,this.eb=this.Ze=this.jb=0,this.ab=1,this.Fe=this.Ee=this.Ge=0,this.He=1,this.Gb=r,this.Lb=n,this.hg=t},f.prototype.translate=function(r,n,t){this.Gb+=r,this.Lb+=n,this.hg+=t},f.prototype.mC=function(r){if(!r.B()){for(var n=new e.Nd[8],t=0;8>t;t++)n[t]=new e.Nd;r.nB(n),this.transform(n,8,n),r.Zw(n)}},f.prototype.transform=function(r,n,t){for(var i=0;ii;i++)t.uh[i]=-1;t.uh[t.bg[0]]=0}return t.jq=!0,t}return J(n,r),n.prototype.re=function(t){this.hasAttribute(t)||(this.uh[t]=0,this.jD())},n.prototype.removeAttribute=function(t){if(t==0)throw e.i.N("Position attribue cannot be removed");this.hasAttribute(t)&&(this.uh[t]=-1,this.jD())},n.prototype.reset=function(){this.bg[0]=0,this.Aa=1;for(var t=0;tt;t++)0<=this.uh[t]&&(this.bg[i]=t,this.uh[t]=i,i++,this.Aa++);this.jq=!0},n.prototype.cc=function(){return this.jq&&(this.wl=this.An(),this.jq=!1),this.wl},n.prototype.Nb=function(t){if(t==null)return!1;if(t==this)return!0;if(!(t instanceof n)||t.Aa!=this.Aa)return!1;for(var i=0;is;s++)!t.hasAttribute(s)&&i.hasAttribute(s)&&(h==null&&(h=new n(t)),h.re(s));return h!=null?h.EF():t},n}(e.ra);e.ee=v;var f=function(){function r(){this.map=[];var n=new v;this.add(n),(n=new v).re(1),this.add(n)}return r.kz=function(){return r.bL},r.prototype.$R=function(){return r.ft},r.prototype.add=function(n){var t=n.cc();if(r.ft!=null&&r.ft.cc()==t&&n.GG(r.ft))return r.ft;if(r.Dw!=null&&r.Dw.cc()==t&&n.GG(r.Dw))return r.Dw;var i=null;return this.map[t]!==void 0&&(i=this.map[t]),i==null&&((i=n.tM()).Aa==1?r.ft=i:i.Aa==2&&i.kd(1)==1?r.Dw=i:this.map[t]=i),i},r.bL=new r,r}()}(k||(k={}));var kt={feet:9002,kilometers:9036,meters:9001,miles:9093,"nautical-miles":9030,yards:9096},Mt={acres:109402,ares:109463,hectares:109401,"square-feet":109405,"square-kilometers":109414,"square-meters":109404,"square-miles":109439,"square-yards":109442},at=new(function(){function e(){this.RM=50,this.np=new Map,this.gj=[]}return e.prototype.clear=function(){this.gj.length=0,this.np.clear()},e.prototype.delete=function(v){return!!this.np.delete(v)&&(this.gj.splice(this.gj.indexOf(v),1),!0)},e.prototype.get=function(v){var f=this.np.get(v);if(f!==void 0)return this.gj[0]!==v&&(this.gj.splice(this.gj.indexOf(v),1),this.gj.unshift(v)),f},e.prototype.has=function(v){return this.np.has(v)},e.prototype.set=function(v,f){return this.get(v)!==void 0&&this.delete(v),this.gj.unshift(v),this.np.set(v,f),this.oM(),this},e.prototype.oM=function(){for(;this.gj.length&&this.gj.length>this.RM;){var v=this.gj.pop();this.np.delete(v)}},e}()),P=((Z={}).convertJSONToGeometry=function(e){return k.$b.fP(e)},Z.hasM=function(e){return e.hasAttribute(k.Ih.M)},Z.hasZ=function(e){return e.hasAttribute(k.Ih.Z)},Z.getPointX=function(e){return e.Lg()},Z.getPointY=function(e){return e.ih()},Z.getPointZ=function(e){return e.bS()},Z.getPointM=function(e){return e.zR()},Z.getXMin=function(e){return e.es()},Z.getYMin=function(e){return e.gs()},Z.getXMax=function(e){return e.ds()},Z.getYMax=function(e){return e.fs()},Z.getZExtent=function(e){return e.Tg(k.Ih.Z,0)},Z.getMExtent=function(e){return e.Tg(k.Ih.M,0)},Z.exportPaths=function(e){var v=[],f=e.da(),r=null,n=null,t=e.hasAttribute(k.Ih.Z),i=e.hasAttribute(k.Ih.M);t&&(r=e.ub(k.Ih.Z)),i&&(n=e.ub(k.Ih.M));for(var h=new k.h,s=0;srt[_]})}}}return Object.freeze(Object.defineProperty(ct,Symbol.toStringTag,{value:"Module"}))}var At={exports:{}};(function(ct,gt){function lt(){function _(e){if(typeof e=="number")return k.Tc.Zg(e);if(e==null)return null;if(kt[e]!=null)return k.Tc.Zg(kt[e]);throw Error("Unrecognised Unit Type")}function ut(e){if(typeof e=="number")return k.Tc.Zg(e);if(e==null)return null;if(Mt[e]!=null)return k.Tc.Zg(Mt[e]);throw Error("Unrecognised Unit Type")}function pt(e){if(e)switch(e){case"loxodrome":return 1;case"great-elliptic":return 2;case"normal-section":return 3;case"shape-preserving":return 4}return 0}function Y(e,v,f,r){if(f==null||f.B())return null;switch(f.getType()){case k.qn.Point:return e.exportPoint(v,f,r);case k.qn.Polygon:return e.exportPolygon(v,f,r);case k.qn.Polyline:return e.exportPolyline(v,f,r);case k.qn.MultiPoint:return e.exportMultipoint(v,f,r);case k.qn.Envelope:return e.exportExtent(v,f,r)}return null}function bt(e,v,f,r){if(f.getType()!==k.qn.Point)throw Error("Geometry not Point");return e.exportPoint(v,f,r)}function q(e,v,f){return e.convertToGEGeometry(v,f)}function F(e){var v=e.wkid;e=e.wkt2||e.wkt;var f=at.get(v||e);return f==null&&(v!==-1&&v!=null?(f=k.Eg.create(v),at.set(v,f)):e&&(f=k.Eg.qP(e),at.set(e,f)),ft.has(v||e)&&f.VW(ft.get(v||e))),f}function Nt(e){var v,f,r;if(e==null)return null;var n=F(e);return e=n.Hd(),n=n.Kn(),(v={}).tolerance=n,v.unitType=e==null?-1:e.od,v.unitID=e==null?-1:e.Ec(),v.unitBaseFactor=e==null?0:e.ai,v.unitSquareDerivative=e==null?0:(r=(f=k.Tc.aG(e))===null||f===void 0?void 0:f.Ec())!==null&&r!==void 0?r:0,v}function It(e,v,f,r){return f==null?null:(f=k.$b.clip(q(e,P,f),q(e,P,r),F(v)),Y(e,P,f,v))}function Tt(e,v,f,r){f=k.$b.dl(q(e,P,f),q(e,P,r),F(v)),r=[];for(var n=0;n>6)>>1},r.Rn=function(n){return(32&n)!=0},r.US=function(n){return(128&n)!=0},r.yd=function(n){return(256&n)!=0},r.xj=function(n){return(512&n)!=0},r.Hc=function(n){return(1024&n)!=0},r.prototype.Of=function(){var n=this.Ia();return this.copyTo(n),n},r.prototype.mg=function(){return null},r.jg=function(n){var t=n.Ia();return n.copyTo(t),t},r.prototype.vc=function(){0<=this.VA&&(this.VA+=2147483649)},r.Ax=function(n){var t=n.getType();if(r.xj(t))return n.I();if(n.B())return 0;if(t==197)return 4;if(t==33)return 1;if(r.yd(t))return 2;throw e.i.fa("missing type")},r}();e.aa=f})(k||(k={})),it=k||(k={}),jt=function(){function e(){this.y=this.x=0}return e.construct=function(v,f){var r=new e;return r.x=v,r.y=f,r},e.al=function(v){var f=new e;return f.x=v.x,f.y=v.y,f},e.prototype.ma=function(v,f){this.x=v,this.y=f},e.prototype.L=function(v){this.x=v.x,this.y=v.y},e.prototype.fq=function(v,f){return this.x===v&&this.y===f},e.prototype.Rz=function(v){return 2220446049250313e-31>=Math.abs(this.x-v.x)&&2220446049250313e-31>=Math.abs(this.y-v.y)},e.prototype.qb=function(v){return this.x===v.x&&this.y===v.y},e.prototype.Nb=function(v){return v==this||v instanceof e&&this.x==v.x&&this.y==v.y},e.prototype.sub=function(v){this.x-=v.x,this.y-=v.y},e.prototype.uc=function(v,f){this.x=v.x-f.x,this.y=v.y-f.y},e.prototype.add=function(v,f){f!==void 0?(this.x=v.x+f.x,this.y=v.y+f.y):(this.x+=v.x,this.y+=v.y)},e.prototype.Sq=function(){this.x=-this.x,this.y=-this.y},e.prototype.mt=function(v){this.x=-v.x,this.y=-v.y},e.prototype.NS=function(v,f,r){this.x=v.x*(1-r)+f.x*r,this.y=v.y*(1-r)+f.y*r},e.prototype.Ct=function(v,f){this.x=this.x*v+f.x,this.y=this.y*v+f.y},e.prototype.HW=function(v,f,r){this.x=f.x*v+r.x,this.y=f.y*v+r.y},e.prototype.scale=function(v){this.x*=v,this.y*=v},e.prototype.compare=function(v){return this.yv.y?1:this.xv.x?1:0},e.prototype.normalize=function(){var v=this.length();v==0&&(this.x=1,this.y=0),this.x/=v,this.y/=v},e.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.Sk=function(){return this.x*this.x+this.y*this.y},e.tb=function(v,f){return Math.sqrt(this.yc(v,f))},e.Oy=function(v,f,r,n){return v-=r,f-=n,Math.sqrt(v*v+f*f)},e.prototype.Qh=function(v){return this.x*v.x+this.y*v.y},e.prototype.fD=function(v){return Math.abs(this.x*v.x)+Math.abs(this.y*v.y)},e.prototype.wi=function(v){return this.x*v.y-this.y*v.x},e.prototype.Bt=function(v,f){var r=-this.x*f+this.y*v;this.x=this.x*v+this.y*f,this.y=r},e.prototype.Hv=function(){var v=this.x;this.x=-this.y,this.y=v},e.prototype.MG=function(v){this.x=-v.y,this.y=v.x},e.prototype.ar=function(){var v=this.x;this.x=this.y,this.y=-v},e.prototype.qu=function(){return 0(v=v.wi(f))?1:0(r=n.value())?-1:0r?-1:0=t?r+(n-r)*t:n-(n-r)*(1-t)},f.OG=function(r,n,t,i){.5>=t?(i.x=r.x+(n.x-r.x)*t,i.y=r.y+(n.y-r.y)*t):(i.x=n.x-(n.x-r.x)*(1-t),i.y=n.y-(n.y-r.y)*(1-t))},f.lT=function(r,n,t,i,h,s){.5>=h?(s.x=r+(t-r)*h,s.y=n+(i-n)*h):(s.x=t-(t-r)*(1-h),s.y=i-(i-n)*(1-h))},f}()}(k||(k={})),function(e){var v=function(f){function r(){var n=f.call(this)||this;return n.sa=0,n.na=0,n.pa=0,n.la=0,n.ka=null,n}return J(r,f),r.prototype.ac=function(){return e.h.construct(this.sa,this.na)},r.prototype.Yp=function(n){n.x=this.sa,n.y=this.na},r.prototype.Dc=function(n){this.em(0,n)},r.prototype.ZB=function(n,t){this.em(0,e.h.construct(n,t))},r.prototype.To=function(n){this.hD(0,n)},r.prototype.setStart=function(n){this.uD(0,n)},r.prototype.wv=function(n,t){return this.Od(0,n,t)},r.prototype.YB=function(n,t,i){this.tn(0,n,t,i)},r.prototype.wc=function(){return e.h.construct(this.pa,this.la)},r.prototype.Tr=function(n){n.x=this.pa,n.y=this.la},r.prototype.Qc=function(n){this.em(1,n)},r.prototype.Ql=function(n,t){this.em(1,e.h.construct(n,t))},r.prototype.Po=function(n){this.hD(1,n)},r.prototype.setEnd=function(n){this.uD(1,n)},r.prototype.gv=function(n,t){return this.Od(1,n,t)},r.prototype.OB=function(n,t,i){this.tn(1,n,t,i)},r.prototype.Db=function(){return 1},r.prototype.B=function(){return this.Ac()},r.prototype.Oa=function(){},r.prototype.Ke=function(){return 0},r.prototype.Ea=function(n,t,i,h,s){return this.KM(n,t,i,h,s)},r.prototype.isIntersecting=function(n,t){return this.zr(n,t,!1)!=0},r.prototype.qs=function(n,t){return this.ru(n,t,!1)},r.prototype.ru=function(){return null},r.prototype.Ac=function(){return!1},r.prototype.ay=function(n){if(this.vc(),this.ka==null&&0=e.ra.Va(t))throw e.i.ce();var h=this.description.Pf(t);return 0<=h?(this.ka!=null&&this.ay(this.description.Ae.length-2),this.ka[r.Gg(this.description,n)+this.description.$j(h)-2+i]):e.ra.se(t)},r.prototype.tn=function(n,t,i,h){if(this.vc(),i>=e.ra.Va(t))throw e.i.ce();var s=this.description.Pf(t);0>s&&(this.re(t),s=this.description.Pf(t)),t==0?n!=0?i!=0?this.la=h:this.pa=h:i!=0?this.na=h:this.sa=h:(this.ka==null&&this.ay(this.description.Ae.length-2),this.ka[r.Gg(this.description,n)+this.description.$j(s)-2+i]=h)},r.prototype.copyTo=function(n){if(n.getType()!=this.getType())throw e.i.N();n.description=this.description,n.ay(this.description.Ae.length-2),r.gM(this.ka,n.ka,2*(this.description.Ae.length-2)),n.sa=this.sa,n.na=this.na,n.pa=this.pa,n.la=this.la,n.vc(),this.op(n)},r.prototype.Tg=function(n,t){var i=new e.Nc;return this.Ac()?(i.Oa(),i):(i.oa=this.Od(0,n,t),i.va=i.oa,i.Lk(this.Od(1,n,t)),i)},r.prototype.ZI=function(n){this.Ac()?n.Oa():(n.oa=this.Od(0,0,0),n.va=n.oa,n.Lk(this.Od(1,0,0)))},r.prototype.Tw=function(n,t){t.Nf(this.description),t.Cb(this.hc(n));for(var i=1,h=this.description.Aa;it||t>=this.wa)throw e.i.fa("index out of bounds");this.mc(),i.Nf(this.description),i.B()&&i.un();for(var h=0;ht||t>=this.I())throw e.i.ce();this.mc(),this.za[0].tc(2*t,i)},n.prototype.Na=function(t){var i=new e.h;return this.D(t,i),i},n.prototype.Gc=function(t,i){this.za[0].tc(2*t,i)},n.prototype.Cb=function(t,i,h){if(0>t||t>=this.wa)throw e.i.ce();this.mc();var s=this.za[0];h!==void 0?(s.write(2*t,i),s.write(2*t+1,h)):s.Tt(2*t,i),this.Pc(1993)},n.prototype.Cz=function(){if(void 0>=this.I())throw e.i.ce();this.mc();var t=this.za[0],i=new e.Nd;return i.x=t.read(NaN),i.y=t.read(NaN),i.z=this.hasAttribute(1)?this.za[1].eg():e.ra.se(1),i},n.prototype.dC=function(t){if(0>t||t>=this.I())throw e.i.ce();this.re(1),this.mc(),this.Pc(1993);var i=this.za[0];i.write(2*t,(void 0).x),i.write(2*t+1,(void 0).y),this.za[1].pr(t,(void 0).z)},n.prototype.Uc=function(t,i,h){if(0>i||i>=this.wa)throw e.i.ce();var s=e.ra.Va(t);if(h>=s)throw e.i.ce();this.mc();var o=this.description.Pf(t);return 0<=o?this.za[o].eg(i*s+h):e.ra.se(t)},n.prototype.yF=function(t,i){return this.Uc(t,i)},n.prototype.setAttribute=function(t,i,h,s){if(0>i||i>=this.wa)throw e.i.ce();var o=e.ra.Va(t);if(h>=o)throw e.i.ce();this.re(t),this.mc(),t=this.description.Pf(t),this.Pc(1993),this.za[t].pr(i*o+h,s)},n.prototype.ub=function(t){return this.wx(),this.re(t),this.mc(),this.za[this.description.Pf(t)]},n.prototype.hn=function(t,i){if(i!=null&&e.ra.Tp(t)!=i.Tp())throw e.i.N();this.re(t),t=this.description.Pf(t),this.za==null&&(this.za=e.Yc.qI(this.description.Aa)),this.za[t]=i,this.Pc(16777215)},n.prototype.sn=function(t){var i=null;if(this.za!=null){var h=e.ee.Iw(t,this.description);i=[];for(var s=0,o=t.Aa;sthis.wa+5?(5*this.wa+3)/4:this.wa),this.za[t].resize(s*h,e.ra.se(i))),st)throw e.i.N();t!=this.wa&&(this.wa=t,this.Pc(65535))},n.prototype.om=function(t){if(!this.ak(1)){if(!this.ak(2))return 0;if(this.QT>=t)return this.ak(8)?1:2}return-1},n.prototype.Ch=function(t,i){if(this.QT=i,t==-1)this.Lf(1,!0),this.Lf(8,!0);else if(this.Lf(1,!1),this.Lf(8,!0),t==0)this.Lf(2,!1),this.Lf(4,!1);else if(t==1)this.Lf(2,!0),this.Lf(4,!1);else{if(t!=2)throw e.i.fa("internal error.");this.Lf(2,!0),this.Lf(4,!0)}},n.prototype.lM=function(){this.Bb!=null&&(this.Bb=null)},n.prototype.kD=function(t,i,h,s){if(0>t||t>=this.wa||0>i||i>=this.wa)throw e.i.fa("index out of bounds");this.mc(),s.Nf(this.description),s.B()&&s.un();for(var o=0;ot||t>=this.wa)throw e.i.ce();this.mc();var i=new e.Sa;i.Nf(this.description),i.B()&&i.un();for(var h=0;ht||t>=this.wa)throw e.i.ce();if(i.B())throw e.i.N();this.mc();for(var h=i.description,s=0;se.O.bB(this.Tm)>>1:n!=-1)?r=n:i=o,n=!0;;){if(0>i){if((o=s[7*r])==-1){i=r,t=this.ob.Ll([-1,-1,r,t,this.gl(),-1,-1]),(s=this.ob.o)[7*r]=t;break}r=o}else{if((o=s[7*r+1])==-1){i=s[7*r+6],t=this.ob.Ll([-1,-1,r,t,this.gl(),-1,-1]),(s=this.ob.o)[7*r+1]=t;break}r=o}n&&(i*=-1,n=!1)}return this.oy(t,s),s[7*t+2]===-1&&(s[7*h]=t),this.vp(i,t,h,s),t},f.prototype.FF=function(){return this.iR(this.Qe)},f.prototype.vd=function(r,n){n=n==-1?this.Qe:n,this.Rv?this.LP(r,n):this.iY(r,n)},f.prototype.search=function(r,n){for(n=this.sv(n);n!=-1;){var t=this.Zn.compare(this,r,n);if(t==0)return n;n=0>t?this.ll(n):this.Xp(n)}return-1},f.prototype.IW=function(r){for(var n=this.sv(-1),t=-1;n!=-1;){var i=r.compare(this,n);if(i==0)return n;0>i?n=this.ll(n):(t=n,n=this.Xp(n))}return t},f.prototype.uJ=function(r){for(var n=this.sv(-1),t=-1;n!=-1;){var i=r.compare(this,n);if(i==0)return n;0>i?(t=n,n=this.ll(n)):n=this.Xp(n)}return t},f.prototype.ja=function(r){return this.ob.T(r,3)},f.prototype.ll=function(r){return this.ob.T(r,0)},f.prototype.Xp=function(r){return this.ob.T(r,1)},f.prototype.getParent=function(r){return this.ob.T(r,2)},f.prototype.lb=function(r){return this.ob.T(r,6)},f.prototype.we=function(r){return this.ob.T(r,5)},f.prototype.rc=function(r){return r==-1?this.kl(this.Qe):this.kl(r)},f.prototype.Fc=function(r){return r==-1?this.Zr(this.Qe):this.Zr(r)},f.prototype.ZR=function(r){return r==-1?this.bG(this.Qe):this.bG(r)},f.prototype.Sj=function(r,n){this.NB(r,n)},f.prototype.sv=function(r){return r==-1?this.YF(this.Qe):this.YF(r)},f.prototype.clear=function(){this.ob.mj(!1),this.Qe=-1},f.prototype.size=function(r){return r==-1?this.$F(this.Qe):this.$F(r)},f.prototype.KN=function(r,n){for(var t=n[7*r],i=n[7*r+1],h=n[7*r+4];t!=-1||i!=-1;){var s=t!=-1?n[7*t+4]:2147483647;if(i=i!=-1?n[7*i+4]:2147483647,h<=Math.min(s,i))break;s<=i?this.sJ(t,n):this.rJ(r,n),t=n[7*r],i=n[7*r+1]}},f.prototype.oy=function(r,n){if(this.Rv)for(var t=n[7*r+4],i=n[7*r+2];i!=-1&&n[7*i+4]>t;)n[7*i]==r?this.sJ(r,n):this.rJ(i,n),i=n[7*r+2]},f.prototype.rJ=function(r,n){var t=n[7*r+1];n[7*t+2]=n[7*r+2],n[7*r+2]=t;var i=n[7*t];n[7*r+1]=i,i!=-1&&(n[7*i+2]=r),n[7*t]=r,(i=n[7*t+2])!=-1&&(n[7*i]==r?n[7*i]=t:n[7*i+1]=t)},f.prototype.sJ=function(r,n){var t=n[7*r+2];n[7*r+2]=n[7*t+2],n[7*t+2]=r;var i=n[7*r+1];n[7*t]=i,i!=-1&&(n[7*i+2]=t),n[7*r+1]=t,(i=n[7*r+2])!=-1&&(n[7*i]===t?n[7*i]=r:n[7*i+1]=r)},f.prototype.Pk=function(r,n){this.ob.S(r,2,n)},f.prototype.TB=function(r,n){this.ob.S(r,0,n)},f.prototype.XB=function(r,n){this.ob.S(r,1,n)},f.prototype.WB=function(r,n){this.ob.S(r,5,n)},f.prototype.ex=function(r,n){this.ob.S(r,6,n)},f.prototype.XJ=function(r,n){this.ob.S(n,0,r)},f.prototype.rX=function(r){this.ob.S(r,4,0)},f.prototype.uX=function(r,n){this.ob.S(n,5,r)},f.prototype.YF=function(r){return r==-1?-1:this.ob.T(r,0)},f.prototype.kl=function(r){return r==-1?-1:this.ob.T(r,1)},f.prototype.Zr=function(r){return r==-1?-1:this.ob.T(r,2)},f.prototype.iR=function(r){return r==-1?-1:this.ob.T(r,3)},f.prototype.$F=function(r){return r==-1?0:this.ob.T(r,4)},f.prototype.bG=function(r){return this.ob.T(r,5)},f.prototype.Pw=function(){return this.ob.Ll([-1,-1,-1,void 0,this.gl(),-1,-1])},f.prototype.fl=function(r){r!=-1&&this.ob.jd(r)},f.prototype.gl=function(){return this.Tm=e.O.bB(this.Tm),1073741823&this.Tm},f.prototype.FD=function(r,n,t){var i=this.ob.o;if(t==-1||i[7*t]==-1)return r=this.ob.Ll([-1,-1,-1,r,this.gl(),-1,-1]),(i=this.ob.o)[7*t]=r,this.vp(-1,r,t,i),r;for(var h=t==-1?-1:i[7*t];;){var s=n==-1?1:this.Zn.compare(this,r,h);if(0>s){if((s=this.ll(h))==-1){n=h,r=this.ob.Ll([-1,-1,h,r,this.gl(),-1,-1]),(i=this.ob.o)[7*h]=r;break}h=s}else{if(n==1&&s==0)return i[7*t+3]=h,-1;if((s=i[7*h+1])==-1){n=i[7*h+6],r=this.ob.Ll([-1,-1,h,r,this.gl(),-1,-1]),(i=this.ob.o)[7*h+1]=r;break}h=s}}return this.oy(r,i),i[7*r+2]===-1&&(i[7*t]=r),this.vp(n,r,t,i),r},f.prototype.vp=function(r,n,t,i){if(r!=-1){var h=i[7*r+5];i[7*r+5]=n}else h=t==-1?-1:i[7*t+2];i[7*n+5]=h,h!=-1&&(i[7*h+6]=n),i[7*n+6]=r,r==(t==-1?-1:i[7*t+1])&&(i[7*t+1]=n),r==-1&&(i[7*t+2]=n),i[7*t+4]=(t==-1?0:i[7*t+4])+1},f.prototype.AB=function(r,n){var t=this.ob.o,i=t[7*r+5];r=t[7*r+6],i!=-1?t[7*i+6]=r:t[7*n+1]=r,r!=-1?t[7*r+5]=i:t[7*n+2]=i,t[7*n+4]=n===-1?-1:t[7*n+4]-1},f.prototype.iY=function(r,n){this.AB(r,n);var t=this.ll(r),i=this.Xp(r),h=this.getParent(r),s=r;if(t!=-1&&i!=-1){this.Tm=e.O.bB(this.Tm);var o=1073741823=r.oa:r.va>=this.oa},f.prototype.move=function(r){this.B()||(this.oa+=r,this.va+=r)},f.prototype.normalize=function(){if(!isNaN(this.oa)){if(this.oa>this.va){var r=this.oa;this.oa=this.va,this.va=r}isNaN(this.va)&&this.Oa()}},f.prototype.Oa=function(){this.va=this.oa=NaN},f.prototype.B=function(){return isNaN(this.oa)},f.prototype.Zb=function(r){typeof r=="number"?this.B()?this.va=this.oa=r:this.Lk(r):r.B()||(this.B()?(this.oa=r.oa,this.va=r.va):(this.oa>r.oa&&(this.oa=r.oa),this.vathis.va&&this.Oa()))},f.prototype.Lk=function(r){rthis.va&&(this.va=r)},f.prototype.contains=function(r){return typeof r=="number"?r>=this.oa&&r<=this.va:r.oa>=this.oa&&r.va<=this.va},f.prototype.Ea=function(r){this.B()||r.B()?this.Oa():(this.oar.va&&(this.va=r.va),this.oa>this.va&&this.Oa())},f.prototype.W=function(r){this.B()||(this.oa-=r,this.va+=r,this.van?(this.oa=n,this.va=r):(this.oa=r,this.va=n)},f.prototype.It=function(r){return e.O.Rk(r,this.oa,this.va)},f.prototype.R=function(){return this.va-this.oa},f.prototype.sf=function(){return .5*(this.oa+this.va)},f.prototype.Nb=function(r){return r==this||r instanceof f&&(!(!this.B()||!r.B())||this.oa==r.oa&&this.va==r.va)},f.prototype.cc=function(){return e.O.uj(e.O.uj())},f}();e.Nc=v}(k||(k={})),function(e){var v=new e.Nc,f=new e.Nc,r=function(){this.ne=null,this.pb=-1,this.sb=new e.yb,this.qA=55555555,this.Tv=this.Vv=!1,this.Uf=new e.Nc,this.Uf.KB(0,0)};e.IY=r;var n=function(){function t(i,h,s){this.g=i,this.Hk=NaN,this.NH=this.Kq=0,this.OH=NaN,this.qa=h,this.Nq=10*h,this.PH=this.QH=NaN,this.rg=!1,this.Dm=this.gt=this.Lo=this.Xs=this.Ws=-1,this.gA=s,this.TA=new r,this.YH=new r,e.O.truncate(3*i.fd/2)}return t.prototype.mG=function(i,h,s,o){i.ne=o===null?null:o[s[5*h]],i.Tv=i.ne!=null,i.Tv||((o=s[5*h+2])!==-1&&this.g.mW(s[5*h],s[5*o],i.sb),i.ne=i.sb,i.Uf.KB(i.sb.sa,i.sb.pa),i.Uf.va+=this.qa,i.sb.rI(),i.Vv=i.sb.la==i.sb.na,i.Vv||(i.qA=(i.sb.pa-i.sb.sa)/(i.sb.la-i.sb.na)))},t.prototype.OO=function(i,h){var s=i.zr(h,this.qa,!0);return s!=0?s==2?this.Qy():this.xi():(i.Yp(ht),i.Tr(et),h.Yp(st),h.Tr(ot),Q.ma(this.Kq,this.Hk),ht.qb(st)&&this.Hk==ht.y?0>et.compare(ot)?Q.L(et):Q.L(ot):ht.qb(ot)&&this.Hk==ht.y?0>et.compare(st)?Q.L(et):Q.L(st):st.qb(et)&&this.Hk==st.y?0>ht.compare(ot)?Q.L(ht):Q.L(ot):et.qb(ot)&&this.Hk==et.y&&(0>ht.compare(st)?Q.L(ht):Q.L(st)),i.Pe(Q.y,Q.x)s&&0>i?-1:0h.pa){if(h.pa>h.sa&&h.la-h.na<2*this.qa&&i.vi(h.pa,h.la,this.qa))return this.xi()}else if((h.la-h.na)/(h.pa-h.sa)*(i.pa-i.sa)h.sa&&h.la-h.na<2*this.qa&&i.vi(h.pa,h.la,this.qa))return this.xi()}else if((h.la-h.na)/(h.pa-h.sa)*(i.sa-i.pa)o&&0>s?-1:0h+u?s:o.vi(i.sa,i.na,this.qa)?this.xi():ah+u?s:o.vi(i.pa,i.la,this.qa)?this.xi():aa?1:0)},t.prototype.Kr=function(){this.rg=!1},t.prototype.rm=function(){return this.Ni},t.prototype.$J=function(i,h){this.Hk=i,this.Kq=h,this.gt=this.Lo=this.Xs=this.Ws=-1},t.prototype.compare=function(i,h,s){return this.rg?-1:(i=i.ja(s),this.Dm=s,this.RE(h,h,i,i))},t.prototype.RE=function(i,h,s,o){if(this.Lo==h)var a=this.TA;else this.Lo=h,a=this.TA,this.TA.pb=i,this.mG(a,h,this.g.td.o,this.g.We);if(u==null){this.gt=o;var u=this.YH;this.YH.pb=s,this.mG(u,o,this.g.td.o,this.g.We)}return a.Tv||u.Tv?this.NO(h,o,a,u):a.Uf.vathis.Uf.va)return 1;if(this.ie.na==this.ie.la)return this.Dm=r,this.rg=!0,0;this.ie.rI(),t=this.ie.ac(),(n=new e.h).uc(this.ie.wc(),t),n.ar();var i=new e.h;return i.uc(this.Gq,t),t=n.Qh(i),(t/=n.length())<10*-this.qa?-1:t>10*this.qa?1:this.ie.qs(this.Gq,this.qa)&&((n=Math.abs(t))t?-1:1},f}();e.aM=v}(k||(k={})),function(e){function v(r,n,t,i){t=new Float64Array(r.subarray(t,i)),r.set(t,n)}var f=function(){function r(n){this.Pb=this.pk=!1,this.o=null;var t=n;2>t&&(t=2),this.o=new Float64Array(t),this.size=n}return r.prototype.rotate=function(n,t,i){if(this.Pb)throw e.i.fa("invalid_call");if(ti||n>i)throw e.i.N();n!=t&&i!=t&&(this.ni(n,t-n,1),this.ni(t,i-t,1),this.ni(n,i-n,1))},r.qf=function(n,t){var i=new r(n),h=i.o;if(2>n&&(n=2),t!==0)for(var s=0;st&&(i.size=t),2>(t=i.size)&&(t=2),i.o=new Float64Array(t),i.o.set(n.o.length<=t?n.o:n.o.subarray(0,t),0),i},r.prototype.Jb=function(n){0>=n||(this.o==null?this.o=new Float64Array(n):n<=this.o.length||(0this.o.length&&(i=e.O.truncate(64>n?Math.max(2*n,4):5*n/4),(i=new Float64Array(i)).set(this.o),this.o=i),i=this.o;for(var h=this.size;hthis.o.length)&&this.resize(n),this.pk)throw e.i.fa("invalid call. Attribute Stream is locked and cannot be resized.");this.size=n},r.prototype.pr=function(n,t){this.write(n,t)},r.prototype.An=function(n,t,i){for(var h=this.size;th||i>s&&h!=s)return!1;for(i>h&&(i=h);ts||i%s!=0))throw e.i.N();var o=this.size;if(this.resize(o+i),h)this.o.set(n.o.subarray(t,t+i),o);else{h=i;for(var a=0;ao||h%o!=0))throw e.i.N();var u=this.size-a;if(uo&&(o=this.size),this.size+2*h>this.o.length?this.resize(this.size+2*h):this.size+=2*h,v(this.o,n+2*h,n,n+(o-n)),s)for(s=0;sn||0>t||0>h||!s&&(0>=o||t%o!=0)||i.sizethis.size)throw e.i.Hb();0i||t%i!=0)throw e.i.Hb();for(var h=t>>1,s=0;st||0>i||0>t||i+t>this.size)throw e.i.N();for(var h=t;hn||0>t||0>h)throw e.i.N();if(t!=0)for(this.size<(t<<1)+n&&this.resize((t<<1)+n),s||(n+=t-1<<1),s=s?2:-2,t+=h;hn||0>t)throw e.i.N();if(t!=0){this.size<(t<<1)+n&&this.resize((t<<1)+n),t+=0;for(var h=0;hn||0>t||0>h||this.sizen||0>t||this.size<(t>>1)+n)throw e.i.N();if(t!=0){t=0+t;for(var h=0;ht&&(t=2),this.o=new Int32Array(t),this.size=n}return r.prototype.rotate=function(n,t,i){if(this.Pb)throw e.i.fa("invalid_call");if(ti||n>i)throw e.i.N();n!=t&&i!=t&&(this.ni(n,t-n,1),this.ni(t,i-t,1),this.ni(n,i-n,1))},r.qf=function(n,t){var i=new r(n),h=i.o;if(2>n&&(n=2),t!==0)for(var s=0;st&&(i.size=t),2>(t=i.size)&&(t=2),i.o=new Int32Array(t),i.o.set(n.o.length<=t?n.o:n.o.subarray(0,t),0),i},r.prototype.Jb=function(n){0>=n||(this.o==null?this.o=new Int32Array(n):n<=this.o.length||(0this.o.length&&(i=e.O.truncate(64>n?Math.max(2*n,4):5*n/4),(i=new Int32Array(i)).set(this.o),this.o=i),i=this.o;for(var h=this.size;hthis.o.length)&&this.resize(n),this.pk)throw e.i.fa("invalid call. Attribute Stream is locked and cannot be resized.");this.size=n},r.prototype.pr=function(n,t){this.write(n,t)},r.prototype.An=function(n,t,i){for(var h=this.size;th||i>s&&h!=s)return!1;for(i>h&&(i=h);ts||i%s!=0))throw e.i.N();var o=this.size;if(this.resize(o+i),h)this.o.set(n.o.subarray(t,t+i),o);else{h=i;for(var a=0;ao||h%o!=0))throw e.i.N();if(v(this.o,n+h,n,n+(a-n)),this.o==t.o&&no&&(o=this.size),this.size+2*h>this.o.length?this.resize(this.size+2*h):this.size+=2*h,v(this.o,n+2*h,n,n+(o-n)),s)for(s=0;sn||0>t||0>h||!s&&(0>=o||t%o!=0)||i.sizethis.size)throw e.i.Hb();0i||t%i!=0)throw e.i.Hb();for(var h=t>>1,s=0;st||0>i||0>t||i+t>this.size)throw e.i.N();for(var h=t;hn||0>t||0>h)throw e.i.N();if(t!=0)for(this.size<(t<<1)+n&&this.resize((t<<1)+n),s||(n+=t-1<<1),s=s?2:-2,t+=h;hn||0>t||0>h||this.sizet-n?r.rG(this.o,n,t,i):r.qB(this.o,n,t-1,i)},r.prototype.Tp=function(){return 2},r.prototype.Fc=function(){return this.o[this.size-1]},r.prototype.If=function(){this.resize(this.size-1)},r.prototype.bX=function(n){this.o[this.size-1]=n},r.prototype.SV=function(n){n=t&&0=i))for(;;){if(9>i-t){r.rG(n,t,i+1,h);break}var s=n[t];r.tx(n,t,i);for(var o=t,a=t;a=h(n[a],s)&&(r.tx(n,o,a),o+=1);r.tx(n,o,i),o-tt&&(t=2),this.o=new Int8Array(t),this.size=n}return r.prototype.rotate=function(n,t,i){if(this.Pb)throw e.i.fa("invalid_call");if(ti||n>i)throw e.i.N();n!=t&&i!=t&&(this.ni(n,t-n,1),this.ni(t,i-t,1),this.ni(n,i-n,1))},r.qf=function(n,t){var i=new r(n),h=i.o;if(2>n&&(n=2),t!==0)for(var s=0;st&&(i.size=t),2>(t=i.size)&&(t=2),i.o=new Int8Array(t),i.o.set(n.o.length<=t?n.o:n.o.subarray(0,t),0),i},r.prototype.Jb=function(n){0>=n||(this.o==null?this.o=new Int8Array(n):n<=this.o.length||(0this.o.length&&(i=e.O.truncate(64>n?Math.max(2*n,4):5*n/4),(i=new Int8Array(i)).set(this.o),this.o=i),i=this.o;for(var h=this.size;hthis.o.length)&&this.resize(n),this.pk)throw e.i.fa("invalid call. Attribute Stream is locked and cannot be resized.");this.size=n},r.prototype.pr=function(n,t){this.write(n,t)},r.prototype.An=function(n,t,i){for(var h=this.size;th||i>s&&h!=s)return!1;for(i>h&&(i=h);ts||i%s!=0))throw e.i.N();var o=this.size;if(this.resize(o+i),h)this.o.set(n.o.subarray(t,t+i),o);else{h=i;for(var a=0;ao||h%o!=0))throw e.i.N();if(v(this.o,n+h,n,n+(a-n)),this.o==t.o&&no&&(o=this.size),this.size+2*h>this.o.length?this.resize(this.size+2*h):this.size+=2*h,v(this.o,n+2*h,n,n+(o-n)),s)for(s=0;sn||0>t||0>h||!s&&(0>=o||t%o!=0)||i.sizethis.size)throw e.i.Hb();0i||t%i!=0)throw e.i.Hb();for(var h=t>>1,s=0;st||0>i||0>t||i+t>this.size)throw e.i.N();for(var h=t;hn||0>t||0>h)throw e.i.N();if(t!=0)for(this.size<(t<<1)+n&&this.resize((t<<1)+n),s||(n+=t-1<<1),s=s?2:-2,t+=h;hn||0>t||0>h||this.sizer?-r:r},f.ti=function(r){return 3552713678800501e-30>r},f.KC=function(r,n,t){return f.P(r-n)<=t*(1+(f.P(r)+f.P(n))/2)},f.Y=function(r,n){return f.KC(r,n,3552713678800501e-30)},f.FL=function(r){return 3552713678800501e-30>=f.P(r)},f.Cd=function(r){return f.FL(r)},f}();e.s=v,e.F=function(){function f(){}return f.gp=function(r,n){var t=0;return(r=v.P(r))+(n=v.P(n))!=0&&(r>n?(t=n/r,t=r*Math.sqrt(1+t*t)):(t=r/n,t=n*Math.sqrt(1+t*t))),t},f.Wq=function(r,n,t,i,h){for(var s=[0,0,0],o=[0,0,0],a=0;2>=a;a++)n[a]-=r[a],t[a]-=n[a];t=s[1]*o[2]-s[2]*o[1],n=s[2]*o[0]-s[0]*o[2],s=s[0]*o[1]-s[1]*o[0],r=-1*(t*r[0]+n*r[1]+s*r[2]),i[0]=t,i[1]=n,i[2]=s,i[3]=r,o=f.on(i),i[0]/=o,i[1]/=o,i[2]/=o,i[3]/=o,h!=0&&(o=v.Cd(s)?v.Cd(r)?v.Mb(1,n):-v.Mb(1,r):v.Mb(1,s),o*=v.Mb(1,h),i[0]*=o,i[1]*=o,i[2]*=o,i[3]*=o)},f.zx=function(r,n,t){t[0]=r[1]*n[2]-n[1]*r[2],t[1]=r[2]*n[0]-n[2]*r[0],t[2]=r[0]*n[1]-n[0]*r[1]},f.St=function(r,n){return r[0]*n[0]+r[1]*n[1]+r[2]*n[2]},f.on=function(r){return f.gp(f.gp(r[0],r[1]),r[2])},f.cl=function(r,n,t,i,h,s,o,a){r=f.n(r,n,t);var u=Math.cos(t);s.u=(r+h)*u*Math.cos(i),o.u=(r+h)*u*Math.sin(i),a.u=(r*(1-n)+h)*Math.sin(t)},f.jO=function(r,n,t,i,h,s,o){var a=f.gp(n,t),u=1*Math.sqrt(1-r),c=u/1;if(v.Y(a,0))s.u=0,h.u=v.Mb(1.570796326794897,i),o.u=v.P(i)-u;else{s.u=Math.atan2(t,n),t=Math.atan2(1*i,u*a),s=Math.cos(t);var l=Math.sin(t);n=u*r/(1-r),r*=1,t=Math.atan2(i+n*l*l*l,a-r*s*s*s),3.141592653589793r){var t=Math.sqrt(1-r),i=(1-t)/(1+t),h=i*i,s=i*h,o=i*s,a=i*o,u=i*a,c=i*u,l=1.572916666666667*s-3.2578125*a+4.295068359375*c;r=2.142578125*o-6.071484375*u,t=3.129296875*a-11.249837239583334*c;var p=4.775276692708333*u,y=7.958636765252976*c,d=Math.cos(2*n);return n+Math.sin(2*n)*(1.5*i-.84375*s+.525390625*a-.2688395182291667*c-l+t-y+d*(2*(1.3125*h-1.71875*o+1.650146484375*u)-4*r+6*p+d*(4*l-12*t+24*y+d*(8*r-32*p+d*(16*t-80*y+d*(32*p+64*d*y))))))}for(t=1-r,i=r/2,s=(h=v.P(n))*f.Zu(r)/(1.570796326794897*t),o=9999,u=h,h=0;1e-16h;h++)c=f.w(r,u),a=u-(l=(a=(f.kG(u,r)-i*Math.sin(2*u)/c)/t-s)/(c=1/(c*c*c))),o=v.P(l),u=a;return 0<=n?u:-u},f.qW=function(r,n){return v.ti(n)?r:r*f.Zu(n)/1.570796326794897},f.ba=function(r){return 0>(r=f.pF(r,6.283185307179586))?r+6.283185307179586:3.141592653589793>v.P(r)||v.Y(v.P(r),3.141592653589793)?r:r-6.283185307179586},f.pF=function(r,n){return r-Math.floor(r/n)*n},f.Ah=function(r,n){if(.006884661117170036>n){var t=(n=(1-(n=Math.sqrt(1-n)))/(1+n))*n,i=t*t;return r/(1+n)*(1+.25*t+.015625*i+.00390625*t*i)*1.570796326794897}return r*f.Zu(n)},f.Vq=function(r,n){var t=v.Mb(1,Math.sin(n));return n=1.570796326794897>=(n=v.P(f.pF(n,3.141592653589793)))?n:3.141592653589793-n,(v.Y(n,1.570796326794897)?n:Math.atan(Math.sqrt(1-r)*Math.tan(n)))*t},f.q=function(r,n,t){if(.006884661117170036>n){var i=(n=(1-(n=Math.sqrt(1-n)))/(1+n))*n,h=n*i,s=n*h,o=n*s,a=n*o,u=n*a,c=-.7291666666666666*h+.2278645833333333*o+.03987630208333334*u,l=.615234375*s-.21533203125*a,p=-.54140625*o+.20302734375*u,y=.48876953125*a,d=-.4488699776785715*u,g=Math.cos(2*t);return r/(1+n)*((1+.25*i+.015625*s+.00390625*a)*t+Math.sin(2*t)*(-1.5*n+.1875*h+.0234375*o+.00732421875*u-c+p-d+g*(2*(.9375*i-.234375*s-.03662109375*a)-4*l+6*y+g*(4*c-12*p+24*d+g*(8*l-32*y+g*(16*p-80*d+g*(32*y+64*g*d)))))))}return r*(f.kG(t,n)-.5*n*Math.sin(2*t)/f.w(n,t))},f.w=function(r,n){return n=Math.sin(n),Math.sqrt(1-r*n*n)},f.Zu=function(r){return v.KC(r,1,2220446049250313e-31)?1:1>r?f.Xw(0,1-r)-r/3*f.Uw(0,1-r):NaN},f.kG=function(r,n){var t=v.Mb(1,r);r=v.P(r);var i=Math.floor(r/1.570796326794897);if(1v.P(i)&&1e-4>v.P(h)&&1e-4>v.P(s));)s=Math.sqrt(a),n+=r/((t=Math.sqrt(u))*(u+(s=Math.sqrt(o)*(s+t)+s*t))),r*=.25,o=.25*(o+s),a=.25*(a+s),u=.25*(u+s);return a=(o=i*h)-(u=s*s),3*n+r*(1+(u=o-6*u)*(.10227272727272728*u-.2142857142857143-.1730769230769231*s*(i=u+a+a))+s*(.1666666666666667*i+s*(-.4090909090909091*a+.1153846153846154*s*o)))/(t*Math.sqrt(t))},f.Xw=function(r,n){for(var t,i,h,s,o=1;i=2-((t=(r+n+o)/3)+r)/t,h=2-(t+n)/t,s=2-(t+o)/t,!(1e-4>v.P(i)&&1e-4>v.P(h)&&1e-4>v.P(s));o=.25*(o+t))t=Math.sqrt(n),i=Math.sqrt(o),r=.25*(r+(t=Math.sqrt(r)*(t+i)+t*i)),n=.25*(n+t);return(1+(.04166666666666666*(r=i*h-s*s)-.1-.06818181818181818*(n=i*h*s))*r+.07142857142857142*n)/Math.sqrt(t)},f.Qw=function(r,n){if(v.ti(r)||n==0||v.Y(v.P(n),1.570796326794897))return n;if(.006884661117170036>r){var t=r*r,i=r*t,h=r*i,s=r*h,o=r*s,a=r*o,u=-(.02708333333333333*i+.03430059523809524*h+.03149181547619048*s+.02634359154541446*o+.02156896735835538*a),c=.007669890873015873*h+.01299603174603175*s+.0148051353064374*o+.01454454953803912*a,l=-(.002275545634920635*s+.004830845032667949*o+.006558395368616723*a),p=.0006957236677288761*o+.001775193002406544*a,y=-.000217324089394402*a,d=Math.cos(2*n);return n+Math.sin(2*n)*(-(.5*r+.2083333333333333*t+.09375*i+.04878472222222222*h+.02916666666666667*s+.01938905423280423*o+.01388255931712963*a)-u+l-y+d*(2*(.1041666666666667*t+.0875*i+.06050347222222222*h+.04151785714285714*s+.02958958540013228*o+.02203667534722222*a)-4*c+6*p+d*(4*u-12*l+24*y+d*(8*c-32*p+d*(16*l-80*y+d*(32*p+64*d*y))))))}return n==0||v.Y(v.P(n),1.570796326794897)?t=n:(h=(i=Math.sqrt(r))*Math.sin(n),t=Math.tan(.7853981633974483+n/2)*Math.pow((1-h)/(1+h),i/2),t=2*Math.atan(t)-1.570796326794897),t},f.yO=function(r,n){if(v.ti(r)||n==0||v.Y(v.P(n),1.570796326794897))return n;if(.006884661117170036>r){var t=r*(p=r*(l=r*(d=r*r))),i=r*(y=r*t),h=.05833333333333333*l+.07232142857142858*p+.05634300595238095*t+.0355325796406526*y+.020235546186067*i,s=.02653149801587302*p+.04379960317460317*t+.0429211791776896*y+.03255384637546096*i,o=.01294022817460318*t+.02668104344536636*y+.03155651254609588*i,a=.00659454790965208*y+.0163075268674227*i,u=.003463473736911237*i,c=Math.cos(2*n);return n+Math.sin(2*n)*(.5*r+.2083333333333333*d+.08333333333333333*l+.03611111111111111*p+.01875*t+.01195601851851852*y+.008863673941798942*i-h+o-u+c*(2*(.1458333333333333*d+.1208333333333333*l+.07039930555555556*p+.03616071428571429*t+.01839451058201058*y+.01017113095238095*i)-4*s+6*a+c*(4*h-12*o+24*u+c*(8*s-32*a+c*(16*o-80*u+c*(32*a+64*c*u))))))}var l=Math.sqrt(r),p=l/2,y=Math.tan(.7853981633974483+n/2);r=0,h=1;for(var d=n;h!=0;d=i)t=l*Math.sin(d),i=y*Math.pow((1+t)/(1-t),p),i=2*Math.atan(i)-1.570796326794897,r++,(v.Y(i,d)||3e4this.Kk&&(this.Kk=0);var t=this.Ue.getType();if(this.jH=t==e.Sc.PE_TYPE_PROJCS?2:1,t==e.Sc.PE_TYPE_PROJCS&&!r.loadConstants())throw e.i.N("PeProjcs.loadConstants failed");n=t==e.Sc.PE_TYPE_GEOGCS?this.Ue:this.Ue.getGeogcs(),t!=e.Sc.PE_TYPE_GEOGCS&&e.pf.getCode(n),this.Eo=r.getUnit(),this.RH=n.getPrimem().getLongitude(),this.wH=r=n.getUnit().getUnitFactor(),r=Math.PI/(180*r),1e-10>Math.abs(r-1)&&(r=1),this.GA=r,t&e.Sc.PE_TYPE_PROJCS?(n=this.Ue,this.HA=1/n.getUnit().getUnitFactor(),this.sw=.001/this.Ue.getUnit().getUnitFactor(),this.tw=e.Cg.generate(n,e.Cg.PE_PCSINFO_OPTION_NONE),this.zl=this.tw.isPannableRectangle(),this.bA=e.zb.qN(this.tw.getCentralMeridian(),this.GA)):(this.KA=this.zl=!0,this.HA=0,t=1/n.getUnit().getUnitFactor(),this.sw=.001/n.getDatum().getSpheroid().getAxis()*t,this.bA=0),this.zl&&(this.xx(),this.DK(),this.nY(),this.CK(),this.lY(),this.mY())}return f.prototype.$r=function(){return this.Kk},f.prototype.kk=function(){return this.tw},f.Py=function(r,n){return r==n||r!=null&&n!=null&&r.Kk==0&&n.Kk==0&&r.As===n.As},f.prototype.Wc=function(){return this.zl},f.prototype.gh=function(r){r.K(this.so)},f.prototype.pv=function(){return this.so.v},f.prototype.ov=function(){return this.so.C},f.prototype.GR=function(r){r.K(this.uw)},f.prototype.lY=function(){var r=this.Ue.getType();if(r==e.Sc.PE_TYPE_PROJCS){r=this.Ue;var n=this.kk().getCentralMeridian(),t=r.getGeogcs();if(t==null)throw e.i.fa("internal error");n=[[n+(t=1/t.getUnit().getUnitFactor()*Math.PI),0]],e.ej.geogToProj(r,1,n),n=n[0][0],t=r.getParameters()[e.Sc.PE_PARM_X0].getValue();var i=this.ml();r=new e.l,i.A(r),n=(i=Math.abs(n-t))+t,t=-1*i+t,i=r.H,r=r.G;var h=new e.l;h.K(t,r,n,i),this.so==null&&(this.so=h)}else{if(r!=e.Sc.PE_TYPE_GEOGCS)throw e.i.fa("internal error");t=1/this.Ue.getUnit().getUnitFactor()*Math.PI,(r=new e.l).K(-t,-t/2,t,t/2),this.so==null&&(this.so=r)}},f.prototype.mY=function(){var r=this.Ue.getType();if(r==e.Sc.PE_TYPE_PROJCS){var n=this.Ue;if(r=this.kk().getCentralMeridian(),(n=n.getGeogcs())==null)throw e.i.fa("internal error");n=1/n.getUnit().getUnitFactor()*Math.PI;var t=this.Vr(),i=new e.l;t.A(i),(t=new e.l).K(r-n,i.G,r+n,i.H),this.uw==null&&(this.uw=t)}else{if(r!=e.Sc.PE_TYPE_GEOGCS)throw e.i.fa("internal error");n=1/this.Ue.getUnit().getUnitFactor()*Math.PI,(r=new e.l).K(-n,-n/2,n,n/2),this.uw==null&&(this.uw=r)}},f.prototype.bf=function(){return this.GA},f.prototype.pm=function(){return this.HA},f.prototype.Vr=function(){if(this.zl)return this.ul;var r=this.ul;return r??(this.xx(),this.ul)},f.prototype.Wr=function(){return this.zl?null:(this.ul!=null||this.xx(),this.YG)},f.prototype.xx=function(){if(this.Ue.getType()==e.Sc.PE_TYPE_PROJCS){var r=this.Ue,n=r.getGeogcs(),t=r.horizonGcsGenerate();if(t!=null){var i=t[0].getNump(),h=t[0].getKind();r=0u&&(t=-400*s,l.K(t,l.G,t+5*a,l.H)),t=new e.Fh(l),this.ul==null&&(this.ul=t,this.Iv=r);else{if(u=new e.Da,a=this.kk().isGcsHorizonMultiOverlap(),l=e.gu.bF(n,e.hu.Integer64),a){for(u=new e.gL,c=e.Gh.local().V(u,l,null),y=0;ythis.ss&&(this.ss=0),this.Eo=n=this.KT.getUnit(),this.IH=1/n.getUnitFactor(),e.pf.getCode(r)}return f.Py=function(r,n){return r==n||r!=null&&n!=null&&r.ss==0&&n.ss==0&&r.As===n.As},f.prototype.$r=function(){return this.ss},f}();e.PL=v}(k||(k={})),function(e){e.Yg=function(){function v(){}return v.tb=function(f,r,n,t,i,h,s,o){if(h!=null||s!=null||o!=null){t=e.F.ba(t),r=e.F.ba(r),n=e.F.ba(n),i=e.F.ba(i),1.570796326794897n?t:e.F.ba(3.141592653589793-t):Math.atan2(l*d,u*p-c*l*y)),o!=null&&(e.s.Y(e.s.P(i),1.570796326794897)?o.u=0>i?r:e.F.ba(3.141592653589793-r):(o.u=Math.atan2(u*d,p*u*y-l*c),o.u=e.F.ba(o.u+3.141592653589793)))}}},v.rf=function(f,r,n,t,i,h,s){if(h!=null||s!=null){r=e.F.ba(r),n=e.F.ba(n),1.570796326794897p?i:e.F.ba(3.141592653589793-i):r:e.s.Y(e.s.P(n),1.570796326794897)&&e.s.Y(f,3.141592653589793)?0>n?i:e.F.ba(3.141592653589793-i):e.F.ba(r+Math.atan2(l*a,u*t-c*l*o)))}},v}()}(k||(k={})),function(e){e.Wk=function(){function v(){}return v.tb=function(f,r,n,t,i,h,s,o,a){var u=new e.ga(0),c=new e.ga(0),l=[0,0,0],p=[0,0,0],y=[0,0,0],d=new e.ga(0),g=new e.ga(0),b=new e.ga(0),x=new e.ga(0),m=new e.ga(0);if(s!=null||o!=null||a!=null)if(e.s.ti(r))e.Yg.tb(f,n,t,i,h,s,o,a);else{i=e.F.ba(i),n=e.F.ba(n);var w=e.F.ba(i-n);if(e.s.Y(t,h)&&(e.s.Y(n,i)||e.s.Y(e.s.P(t),1.570796326794897)))s!=null&&(s.u=0),o!=null&&(o.u=0),a!=null&&(a.u=0);else{if(e.s.Y(t,-h)){if(e.s.Y(e.s.P(t),1.570796326794897))return s!=null&&(s.u=2*e.F.Ah(f,r)),o!=null&&(o.u=0w){j=1;var M=n;n=i,i=M,M=t,t=h,h=M}w=e.F.ot(r,t);var A=e.F.ot(r,h);o==null&&a==null||(e.Yg.tb(f,n,w,i,A,null,u,c),u=Math.atan2(Math.sin(u.u)*Math.cos(t-w),Math.cos(u.u)),c=Math.atan2(Math.sin(c.u)*Math.cos(h-A),Math.cos(c.u)),j!=0&&(M=u,u=c,c=M),o!=null&&(o.u=u),a!=null&&(a.u=c)),s!=null&&(e.F.cl(1,r,t,n,0,b,x,m),l[0]=b.u,l[1]=x.u,l[2]=m.u,e.F.cl(1,r,h,i,0,b,x,m),p[0]=b.u,p[1]=x.u,p[2]=m.u,y[0]=l[1]*p[2]-p[1]*l[2],y[1]=-(l[0]*p[2]-p[0]*l[2]),y[2]=l[0]*p[1]-p[0]*l[1],r=1-e.F.w(r,e.F.Vq(r,e.F.Qj(r,Math.acos(y[2]/Math.sqrt(y[0]*y[0]+y[1]*y[1]+y[2]*y[2]))))),r*=2-r,o=Math.atan2(-y[1],-y[0]),y=e.F.ba(o-1.570796326794897),o=e.F.ba(o+1.570796326794897),y=e.s.P(e.F.ba(n-y))<=e.s.P(e.F.ba(n-o))?y:o,e.Yg.tb(1,y,0,n,w,d,null,null),e.Yg.tb(1,y,0,i,A,g,null,null),3.141592653589793i&&(i=e.s.P(i),h=e.F.ba(h+3.141592653589793)),n=e.F.ba(n),t=e.F.ba(t),1.570796326794897=e.s.P(h)?1:-1);h=e.F.ba(n+Math.atan(Math.tan(h)*-Math.sin(b))),e.Yg.tb(f,h,0,n,b,null,c,null),b=e.s.P(1.570796326794897-e.s.P(c.u)),b=e.F.Qj(r,b),b=1-e.F.w(r,e.F.Vq(r,b)),b*=2-b,e.F.cl(1,r,0,h,0,y,d,g),l[0]=y.u,l[1]=d.u,l[2]=g.u,e.F.cl(1,r,t,n,0,y,d,g),p[0]=y.u,p[1]=d.u,p[2]=g.u,t=Math.acos((l[0]*p[0]+l[1]*p[1]+l[2]*p[2])/Math.sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2])),t=e.F.Qj(b,t),i=0<(t=e.F.q(f,b,t)+i*x)?c.u:e.F.ba(c.u+3.141592653589793),f=e.s.P(t)/e.F.Ah(f,b)*1.570796326794897,f=e.F.Rq(b,f),f=e.F.ot(b,f),e.Yg.rf(1,h,0,f,i,s,u),o!=null&&(a=u.u),o!=null&&(o.u=e.F.Qj(r,a))}},v}()}(k||(k={})),function(e){e.cu=function(){function v(){}return v.tb=function(f,r,n,t,i,h,s,o,a){var u=0,c=0,l=0;if(s!=null||o!=null||a!=null)if(e.s.ti(r))e.Yg.tb(f,n,t,i,h,s,o,a);else{var p=e.F.ba(i-n);if(e.s.Y(t,h)&&(e.s.Cd(p)||e.s.Y(e.s.P(t),1.570796326794897)))s!=null&&(s.u=0),o!=null&&(o.u=0),a!=null&&(a.u=0);else{if(e.s.Y(t,-h)){if(e.s.Y(e.s.P(t),1.570796326794897))return s!=null&&(s.u=2*e.F.Ah(f,r)),o!=null&&(o.u=0=N&&!e.s.Y(I,j));if(z!=0)y=(d*=u)*(256+d*(d*(74-47*d)-128))/1024,s!=null&&(s.u=g*(1+d*(4096+d*(d*(320-175*d)-768))/16384)*(D-y*C*(c+y/4*(T*(2*l-1)-y/6*c*(4*C*C-3)*(4*l-3))))),o!=null&&(o.u=e.s.Y(e.s.P(t),1.570796326794897)?0>t?i:e.F.ba(3.141592653589793-i):Math.atan2(m*A,r*w-x*m*M)),a!=null&&(e.s.Y(e.s.P(h),1.570796326794897)?a.u=0>h?n:e.F.ba(3.141592653589793-n):(a.u=Math.atan2(r*A,r*w*M-x*m),a.u=e.F.ba(a.u+3.141592653589793)));else{j=e.s.Mb(3.141592653589793,p),T=x*w-r*m,D=Math.acos(T),C=Math.sin(D),u=1,N=B=0;do l=B,M=1-.25*(B=y*(u*=u)*(1+y+y*y))+.1875*(c=y*y*(M=u*u)*(1+2.25*y))-.1953125*(z=y*y*y*M*u),B=.25*B-.25*c+.29296875*z,A=.03125*c-.05859375*z,z*=.00651041666666667,c=T-2*x*w/u,1=N&&!e.s.Y(l,B));s!=null&&(M=1+(d*=u*=u)*(4096+d*(d*(320-175*d)-768))/16384,e.s.Y(t,-h)?s.u=3.141592653589793*g*M:(c=T-2*x*w/u,u=Math.acos(c),T=Math.cos(2*u),I=Math.cos(3*u),s.u=g*(M*D+d*(d*(128+d*(35*d-60))-512)/2048*C*c+d*(5*d-4)/6144*d*d*Math.sin(2*D)*T+z*Math.sin(3*D)*I+-762939453125e-16*d*d*d*d*Math.sin(4*D)*Math.cos(4*u)))),o!=null&&(e.s.Cd(t)&&e.s.Cd(h)?(u=Math.sqrt(1-B*B),o.u=Math.acos(u),0>p&&(o.u*=-1)):e.s.Y(e.s.P(t),1.570796326794897)?o.u=0>t?i:e.F.ba(3.141592653589793-i):(s=B/r,g=Math.sqrt(1-s*s),0>r*w-x*m*Math.cos(j)&&(g*=-1),o.u=Math.atan2(s,g),e.s.Y(t,-h)&&e.s.P(e.F.ba(n-i))>3.141592653589793*(1-y*Math.cos(t))&&(0e.s.P(o.u)||0>t&&1.570796326794897h?n:e.F.ba(3.141592653589793-n):(p=B/m,s=Math.sqrt(1-p*p),g=Math.sin(j/2),0>Math.sin(b-f)-2*r*w*g*g&&(s*=-1),a.u=Math.atan2(p,s),a.u=e.F.ba(a.u+3.141592653589793),e.s.Y(t,-h)&&!e.s.Cd(t)&&!e.s.Y(e.s.P(t),1.570796326794897)&&e.s.P(e.F.ba(n-i))>3.141592653589793*(1-y*Math.cos(t))&&(o!=null?g=o.u:(s=B/r,g=Math.sqrt(1-s*s),0>r*w-x*m*Math.cos(j)&&(g*=-1),g=Math.atan2(s,g),e.s.Y(t,-h)&&e.s.P(e.F.ba(n-i))>3.141592653589793*(1-y*Math.cos(t))&&(0e.s.P(g)||0>t&&1.570796326794897=e.s.P(g)&&1.570796326794897e.s.P(a.u))&&(a.u=-1*e.F.ba(a.u+3.141592653589793))))}}}},v.rf=function(f,r,n,t,i,h,s,o){if(s!=null||o!=null)if(e.s.ti(r))e.Yg.rf(f,n,t,i,h,s,o);else if(h=e.F.ba(h),e.s.Y(e.s.P(t),1.570796326794897)||e.s.Cd(h)||e.s.Y(e.s.P(h),3.141592653589793))e.Wk.rf(f,r,n,t,i,h,s,o);else{var a=e.s.P(h)==1.570796326794897?0:Math.cos(h),u=e.s.P(h)==3.141592653589793?0:Math.sin(h);e.s.Y(e.s.P(t),1.570796326794897)&&(n=0),h=1-Math.sqrt(1-r);var c=e.F.Vq(r,t);t=e.s.P(c)==1.570796326794897?0:Math.cos(c);var l=Math.sin(c);c=Math.atan2(Math.tan(c),a);var p=t*u,y=p*p,d=1-y,g=r/(1-r)*d,b=(r=g*(256+g*(g*(74-47*g)-128))/1024)/4,x=r/6,m=i/(f*(1-h)*(1+g*(4096+g*(g*(320-175*g)-768))/16384)),w=m;do{var j=w;i=e.s.P(w)==1.570796326794897?0:Math.cos(w);var M=(g=e.s.P(w)==3.141592653589793?0:Math.sin(w))*g;w=r*g*((f=Math.cos(2*c+w))+b*(i*(2*(w=f*f)-1)-x*f*(4*M-3)*(4*w-3)))+m}while(!e.s.Y(j,w));i=e.s.P(w)==1.570796326794897?0:Math.cos(w),g=e.s.P(w)==3.141592653589793?0:Math.sin(w),s!=null&&(u=Math.atan2(g*u,t*i-l*g*a),d=h/16*d*(4+h*(4-3*d)),f=Math.cos(2*c+w),s.u=e.F.ba(n+(u-(1-d)*h*p*(w+d*g*(f+d*i*(2*f*f-1)))))),o!=null&&(d=l*g-t*i*a,d=(1-h)*Math.sqrt(y+d*d),o.u=Math.atan2(l*i+t*g*a,d))}},v}()}(k||(k={})),function(e){e.PC=function(){function v(){}return v.tb=function(f,r,n,t,i,h,s,o,a){var u=e.F.ba(i-n),c=e.s.Y(e.s.P(t),1.570796326794897),l=e.s.Y(e.s.P(h),1.570796326794897);if(e.s.Y(t,h)&&(e.s.Cd(u)||c))s!=null&&(s.u=0),o!=null&&(o.u=0),a!=null&&(a.u=0);else{if(e.s.ti(r)){var p=Math.sin(t),y=Math.sin(h);p=Math.sqrt((1+p)/(1-p)),y=Math.sqrt((1+y)/(1-y)),p=Math.log(y)-Math.log(p),p=Math.atan2(u,p),s!=null&&(s.u=e.s.Y(t,h)?e.s.P(f*Math.cos(t)*u):e.s.P((f*h-f*t)/Math.cos(p)))}else y=e.F.Qw(r,h),p=Math.sin(e.F.Qw(r,t)),y=Math.sin(y),p=Math.sqrt((1+p)/(1-p)),y=Math.sqrt((1+y)/(1-y)),p=Math.log(y)-Math.log(p),p=Math.atan2(u,p),s!=null&&(e.s.Y(t,h)?s.u=e.s.P(f*u*Math.cos(t)/e.F.w(r,t)):(u=e.F.q(f,r,t),f=e.F.q(f,r,h),s.u=e.s.P((f-u)/Math.cos(p))));o==null&&a==null||(s=e.F.ba(p+3.141592653589793),c&&l||!c&&!l||(c?p=0>t?i:e.F.ba(3.141592653589793-i):l&&(s=0>h?n:e.F.ba(3.141592653589793-n))),o!=null&&(o.u=p),a!=null&&(a.u=s))}},v.rf=function(f,r,n,t,i,h,s,o){h=e.F.ba(h),0>i&&(i=e.s.P(i),h=e.F.ba(h+3.141592653589793)),e.s.ti(r)?e.s.Y(e.s.P(t),1.570796326794897)?(n=0>t?h:e.F.ba(3.141592653589793-h),3.141592653589793>=(h=i/f%6.283185307179586)?f=t-e.s.Mb(h,t):(n=e.F.ba(n+3.141592653589793),f=-t+e.s.Mb(h-3.141592653589793,t))):e.s.Y(e.s.P(h),1.570796326794897)?(n=e.F.ba(n+e.s.Mb(i,h)/(f*Math.cos(t))),f=t):(f=t+i*Math.cos(h)/f,1.570796326794897t?h:e.F.ba(3.141592653589793-h),h=i/e.F.qW(f,r),3.141592653589793>=(h%=6.283185307179586)?f=t-e.s.Mb(h,t):(n=e.F.ba(n+3.141592653589793),f=-t+e.s.Mb(h-3.141592653589793,t)),f=e.F.Rq(r,f)):e.s.Y(e.s.P(h),1.570796326794897)?(n=e.F.ba(n+e.s.Mb(i,h)*e.F.w(r,t)/(f*Math.cos(t))),f=t):(f=1.570796326794897*(i*Math.cos(h)+e.F.q(f,r,t))/e.F.Ah(f,r),1.570796326794897Math.PI||Math.abs(t.y)>.5*Math.PI||Math.abs(i.y)>.5*Math.PI||(Math.abs(t.y)==.5*Math.PI||Math.abs(i.y)==.5*Math.PI)&&t.x!=i.x)return NaN;if(h=r.cB(h,Math.min(t.x,i.x),Math.max(t.x,i.x)),!new e.Nc(t.x,i.x).contains(h))return NaN;var s=v.construct(t);if(i=v.construct(i),s=r.Yu(n,s),i=r.Yu(n,i),(i=s.cF(i)).z.qg())return t.y;var o=new e.Wb;o.set(i.x),o.jm(i.z),o.No(-1);var a=new e.Wb;a.set(i.y),a.jm(i.z),a.No(-1);var u=new e.Wb;return u.set(a),u.Ag(a),(s=new e.Wb).set(o),s.Ag(o),s.add(u),s.sqrt(),s.qg()||o.qg()&&a.qg()?t.y:(t=Math.atan2(a.value(),o.value()),t=Math.atan2(s.value()*Math.cos(t-h),1-n),h=r.DP(n,e.h.construct(h,t)),n=new e.Nd(h.x,h.y,-h.z),h=i.value().Qh(h),n=i.value().Qh(n),Math.abs(n)Math.PI||Math.abs(t.y)>.5*Math.PI||Math.abs(i.y)>.5*Math.PI||(Math.abs(t.y)==.5*Math.PI||Math.abs(i.y)==.5*Math.PI)&&t.x!=i.x||Math.abs(h)>=.5*Math.PI||0h&&i.y>h||0>t.y&&0>i.y&&t.yMath.abs(s[1]-t.x)&&(t=s[0],s[0]=s[1],s[1]=t)),h))},r.cB=function(n,t,i){return n>i?n-=2*(t=Math.ceil((n-i)/(2*Math.PI)))*Math.PI:ni.x?(i.x-=i.x%360,-180>i.x&&(i.x+=360)):180i.y&&(i.y=-90);for(var h=-180,s=180,o=(f=5*n)-1,a=(r=(f+31)/32)-1;0<=a;a--)for(var u=o-32*a,c=Math.min(32,f-32*a),l=1;l=p?(t[a]|=1<=p?(t[a]|=1<>h&31;if(31<(h+=5)){var a=37-h;o&=(1<r)for(s=0;s=r[0]?r:'"'+r.trim()+'"'}var f=[];e.XC=function(){function r(){}return r.EQ=function(n){try{for(var t=0;tn||n>this.Aa)throw e.i.N();return this.bg[n]},r.prototype.Pf=function(n){return this.uh[n]},r.lz=function(n){return r.JM[n]},r.Tp=function(n){return r.SM[n]},r.Va=function(n){return r.rM[n]},r.prototype.hasAttribute=function(n){return 0<=this.uh[n]},r.prototype.iG=function(){return this.hasAttribute(1)},r.se=function(n){return r.eD[n]},r.prototype.LR=function(n){return this.Vs[n]},r.DG=function(n,t){return r.eD[n]===t},r.prototype.Nb=function(n){return this===n},r.prototype.An=function(){for(var n=e.O.Th(this.bg[0]),t=1;t++o&&f(s,u,h.eu),c[0]?a?u=o:(c=s.c,u=s.e+u+1):++u;c.lengths.Bd&&c[0]?"-":"")+(1u?"e":"e+")+u:s.toString()}function f(s,o,a,u){var c=s.c,l=s.e+o+1;if(a===1?u=5<=c[l]:a===2?u=5l||c[l+1]!==void 0||1&c[l-1]):a===3?u=u||c[l]!==void 0||0>l:(u=!1,a!==0&&r("!Big.RM!")),1>l||!c[0])u?(s.e=-o,s.c=[1]):s.c=[s.e=0];else{if(c.length=l--,u)for(;9<++c[l];)c[l]=0,l--||(++s.e,c.unshift(1));for(l=c.length;!c[--l];c.pop());}return s}function r(s){throw(s=Error(s)).name="BigError",s}var n=-7,t=21,i=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,h=function(){function s(o){if(o instanceof s)this.Bd=o.Bd,this.e=o.e,this.c=o.c.slice();else{var a,u,c;for(o===0&&0>1/o?o="-0":i.test(o+="")||r(NaN),this.Bd=o.charAt(0)=="-"?(o=o.slice(1),-1):1,-1<(a=o.indexOf("."))&&(o=o.replace(".","")),0<(u=o.search(/e/i))?(0>a&&(a=u),a+=+o.slice(u+1),o=o.substring(0,u)):0>a&&(a=o.length),u=0;o.charAt(u)=="0";u++);if(u==(c=o.length))this.c=[this.e=0];else{for(;o.charAt(--c)=="0";);for(this.e=a-u-1,this.c=[],a=0;u<=c;this.c[a++]=+o.charAt(u++));}}}return s.prototype.abs=function(){var o=new s(this);return o.Bd=1,o},s.prototype.cmp=function(o){var a=this.c,u=(o=new s(o)).c,c=this.Bd,l=o.Bd,p=this.e,y=o.e;if(!a[0]||!u[0])return a[0]?c:u[0]?-l:0;if(c!=l)return c;if(o=0>c,p!=y)return p>(y^o)?1:-1;for(c=-1,l=(p=a.length)<(y=u.length)?p:y;++c(u[c]^o)?1:-1;return p==y?0:p>(y^o)?1:-1},s.prototype.jm=function(o){var a=this.c,u=(o=new s(o)).c,c=this.Bd==o.Bd?1:-1,l=s.rr;if((l!==~~l||0>l||1e6A?0:A,d.unshift(0);m++y;y++){if(p!=(m=x.length))var z=p>m?1:-1;else{var N=-1;for(z=0;++Nx[N]?1:-1;break}}if(!(0>z))break;for(o=m==p?u:d;m;){if(x[--m]A&&f(w,l,s.eu,x[0]!==void 0),w},s.prototype.fS=function(){return 0this.cmp(0)},s.prototype.jt=function(o){var a,u=this.Bd,c=(o=new s(o)).Bd;if(u!=c)return o.Bd=-c,this.tI(o);var l=this.c.slice(),p=this.e,y=o.c,d=o.e;if(!l[0]||!y[0])return y[0]?(o.Bd=-c,o):new s(l[0]?this:0);if(u=p-d){for((a=0>u)?(u=-u,p=l):(d=p,p=y),p.reverse(),c=u;c--;p.push(0));p.reverse()}else for(p=((a=l.lengthu;){if(l[--p]c.length-p.length&&(u=p,p=c,c=u),a=p.length,u=0;a;)u=(c[--a]=c[a]+p[a]+u)/10|0,c[a]%=10;for(u&&(c.unshift(u),++l),a=c.length;c[--a]==0;c.pop());return o.c=c,o.e=l,o},s.prototype.pow=function(o){var a=this,u=new s(1),c=u,l=0>o;for((o!==~~o||-1e6>o||1e6>=1;)a=a.lr(a);return l?u.jm(c):c},s.prototype.round=function(o,a){var u=this;return o==null?o=0:(o!==~~o||0>o||1e6a&&r(NaN),(a=Math.sqrt(this.toString()))==0||a==1/0?((a=o.join("")).length+u&1||(a+="0"),(o=new s(Math.sqrt(a).toString())).e=((u+1)/2|0)-(0>u||1&u)):o=new s(a.toString()),a=o.e+(s.rr+=4);do u=o,o=c.lr(u.tI(this.jm(u)));while(u.c.slice(0,a).join("")!==o.c.slice(0,a).join(""));return f(o,s.rr-=4,s.eu),o},s.prototype.lr=function(o){var a=this.c,u=(o=new s(o)).c,c=a.length,l=u.length,p=this.e,y=o.e;if(o.Bd=this.Bd==o.Bd?1:-1,!a[0]||!u[0])return new s(0*o.Bd);if(o.e=p+y,cp;)l=d[y]+u[p]*a[y-p-1]+l,d[y--]=l%10,l=l/10|0;d[y]=(d[y]+l)%10}for(l&&++o.e,d[0]||d.shift(),p=d.length;!d[--p];d.pop());return o.c=d,o},s.prototype.toString=function(){var o=this.e,a=this.c.join(""),u=a.length;if(o<=n||o>=t)a=a.charAt(0)+(1o?"e":"e+")+o;else if(0>o){for(;++o;a="0"+a);a="0."+a}else if(0u)for(o-=u;o--;a+="0");else othis.Bd&&this.c[0]?"-"+a:a},s.prototype.toExponential=function(o){return o==null?o=this.c.length-1:(o!==~~o||0>o||1e6=o&&(c=v(this,this.e+o),0>this.Bd&&this.c[0]&&0>c.indexOf("-")&&(c="-"+c));return n=a,t=u,c||r("!toFix!"),c},s.prototype.toPrecision=function(o){return o==null?this.toString():((o!==~~o||1>o||1e6h.get(p)?(h.set(a,2147483647),a=p):h.set(p,2147483647),u++;else{if(!(1&u))h.set(a,2147483647);else if(n)return t!=null&&(t[0]=!0),null;o.L(l),a=p,u=1}if(!(1&u))h.set(a,2147483647);else if(n)return t!=null&&(t[0]=!0),null;if(!n)for(h.Vd(0,h.size,function(d,g){return d-g}),p=0,y=h.size;pt-n)i.nr(n,t,r);else{var h=!0;try{for(var s=1/0,o=-1/0,a=n;ao&&(o=u)}if(this.reset(t-n,s,o,t-n)){for(a=n;ah&&i.nr(n+h,n+t,r);100r||t==n)&&(r=Math.min(f.hL,r),this.yf.Jb(r),this.yf.resize(r),this.yf.Wj(0,0,this.yf.size),this.EH=n,this.ys.resize(i),this.Es=(t-n)/(r-1),!0)},f.prototype.zF=function(r){return e.O.truncate((r-this.EH)/this.Es)},f.hL=65536,f}();e.Xt=v}(k||(k={})),function(e){var v,f;(f=v||(v={}))[f.enum_line=1]="enum_line",f[f.enum_arc=2]="enum_arc",f[f.enum_dummy=4]="enum_dummy",f[f.enum_concave_dip=8]="enum_concave_dip",f[f.enum_connection=3]="enum_connection";var r=function(){function s(){}return s.Qu=function(o,a,u,c,l,p){var y=new s;return y.Im=new e.h,y.Vm=new e.h,y.aw=new e.h,y.Im.L(o),y.Vm.L(a),y.aw.L(u),y.Co=c,y.qh=l,y.sh=p,y},s.construct=function(o,a,u,c){var l=new s;return l.Im=new e.h,l.Vm=new e.h,l.aw=new e.h,l.Im.L(o),l.Vm.L(a),l.aw.Rc(),l.Co=4,l.qh=u,l.sh=c,l},s}(),n=function(){function s(o,a,u,c,l,p){this.Yv=null,this.ya=0,this.EA=o,this.bI=this.$H=0,this.Ka=a,this.Mj=u,this.vk=c,this.Dq=l,this.Ub=p}return s.prototype.next=function(){for(var o=new e.Sa;;){if(this.ya==this.EA.I())return null;if(this.EA.ve(this.ya,o),this.ya++,!o.B())break}var a=!1;if(this.Yv==null&&(this.$H=o.Lg(),this.bI=o.ih(),this.Yv=h.buffer(o,this.Ka,this.Mj,this.vk,this.Dq,this.Ub),a=!0),this.yac)throw e.i.N();if(o.B())return new e.Da(o.description);var y=new e.l;return o.xc(y),0=l&&(l=96),p.rb=Math.abs(p.Ka),p.Kv=p.rb!=0?1/p.rb:0,isNaN(c)||c==0?c=1e-5*p.rb:c>.5*p.rb&&(c=.5*p.rb),12>l&&(l=12),(o=Math.abs(a)*(1-Math.cos(Math.PI/l)))>c?c=o:(o=Math.PI/Math.acos(1-c/Math.abs(a)))(l=e.O.truncate(o))&&(l=12,c=Math.abs(a)*(1-Math.cos(Math.PI/l))),p.vk=c,p.Dq=l,p.tA=Math.min(p.ct,.25*c),p.lE()},s.prototype.cv=function(){if(this.Id==null)this.Id=[];else if(this.Id.length!==0)return;var o=this.qE();o=e.O.truncate((o+3)/4);var a=.5*Math.PI/o;this.oA=a;for(var u=0;u<4*o;u++)this.Id.push(null);var c=Math.cos(a);a=Math.sin(a);var l=e.h.construct(0,1);for(u=0;u=this.Ka&&(o=new e.l,this.X.A(o),o.R()<=2*-this.Ka||o.ca()<=2*this.Ka))return new e.Da(this.X.description)}switch(this.X.getType()){case 33:return this.PN();case 550:return this.ON();case 1607:return this.RN();case 1736:return this.QN();case 197:return this.LN();default:throw e.i.Qa()}},s.prototype.RN=function(){if(this.EG(this.X)){var o=new e.Sa;this.X.ve(0,o);var a=new e.l;return this.X.A(a),o.Cb(a.sf()),this.Gu(o)}return this.X=this.WV(this.X),o=new t(this,this.oq),e.Gh.local().V(o,this.Mj,this.Ub).next()},s.prototype.QN=function(){if(this.Ka==0)return this.X;var o=e.Yl.local();if(this.cv(),this.X=o.V(this.X,null,!1,this.Ub),0>this.Ka){var a=this.X;return a=this.py(a,0,a.da()),o.V(a,this.Mj,!1,this.Ub)}return this.EG(this.X)?(o=new e.Sa,this.X.ve(0,o),a=new e.l,this.X.A(a),o.Cb(a.sf()),this.Gu(o)):(o=new i(this),e.Gh.local().V(o,this.Mj,this.Ub).next())},s.prototype.py=function(o,a,u){for(var c=new e.Da(o.description);ao.Ja(a))){var l=o.Ir(a),p=new e.l;if(o.Rj(a,p),0=this.Ka){if(this.Ka==0)o.ad(this.X,!1);else{var a=new e.Fh;this.X.bn(a),a.W(this.Ka,this.Ka),o.ad(a,!1)}return o}return o.ad(this.X,!1),this.X=o,this.jE(o,0)},s.prototype.jE=function(o,a){this.cv();var u=new e.Da(o.description),c=new e.h,l=new e.h,p=new e.h,y=new e.h,d=new e.h,g=new e.h,b=new e.h,x=new e.h,m=o.Ja(a),w=o.Ba(a),j=0;for(a=o.Ja(a);jo.Ja(a))return null;if(this.FG(o,a)&&0(o=-1>o?4:2*Math.PI/Math.acos(o)+.5)?o=4:o>this.Dq&&(o=this.Dq),e.O.truncate(o)},s.prototype.GD=function(o,a,u,c,l){this.cv();var p=new e.h;p.uc(u,a),p.scale(this.Kv);var y=new e.h;y.uc(c,a),y.scale(this.Kv),0>(p=Math.atan2(p.y,p.x)/this.oA)&&(p=this.Id.length+p),p=this.Id.length-p,0>(y=Math.atan2(y.y,y.x)/this.oA)&&(y=this.Id.length+y),(y=this.Id.length-y)p.I(y))return 0>l||(l=o,p=new e.Sa,l.ve(l.Ba(a),p),this.yu(u,p)),1;var d=p.Na(p.Xa(p.Ob(y))),g=new e.Dd;if(g.gg(-d.x,-d.y),p.Oc(g),c&&(this.tQ(p,y,l),2>p.I(y)))return 0>l||(l=o,p=new e.Sa,l.ve(l.Ba(a),p),this.yu(u,p)),1;this.Zd.length=0;var b=p.Ob(y);a=p.Xa(b);var x=l==1?p.Ma(a):p.U(a);o=l==1?p.U(a):p.Ma(a);var m=!0;c=new e.h,y=new e.h;var w=new e.h,j=new e.h,M=new e.h,A=new e.h,z=new e.h,N=new e.h,I=new e.h,C=new e.h,T=this.rb;b=p.Ja(b);for(var D=0;Dx||0>m&&x==0?this.Zd.push(r.Qu(j,M,c,2,this.Zd.length+1,this.Zd.length-1)):j.qb(M)||(this.Zd.push(r.construct(j,c,this.Zd.length+1,this.Zd.length-1,"dummy")),this.Zd.push(r.construct(c,M,this.Zd.length+1,this.Zd.length-1,"dummy"))),A.add(y,I),this.Zd.push(r.Qu(M,A,c,1,this.Zd.length+1,this.Zd.length-1)),j.L(A),C.L(I),w.L(c),c.L(y),N.L(z),x=a,a=o,m=!1,o=l==1?p.U(a):p.Ma(a);return this.Zd[this.Zd.length-1].qh=0,this.Zd[0].sh=this.Zd.length-1,this.YV(u),g.gg(d.x,d.y),u.YD(g,u.da()-1),1},s.prototype.YV=function(o){for(var a=this.zO(),u=!0,c=a+1,l=a;c!=a;l=c){var p=this.Zd[l];c=p.qh!=-1?p.qh:(l+1)%this.Zd.length,p.Co!=0&&(u&&o.Lt(p.Im),p.Co==2?this.GD(o,p.aw,p.Im,p.Vm,!0):o.Ci(p.Vm),u=!1)}},s.prototype.zO=function(){this.Ks==null&&(this.Ks=[null,null,null,null,null,null,null,null,null]);for(var o=0,a=0,u=this.Zd.length;a=this.rb)return!0}return!1},s.prototype.tQ=function(o,a,u){for(var c=0;1>c;c++){var l=!1,p=o.Ob(a),y=o.Ja(p);if(y==0)break;var d=y;if(3>y)break;!o.dc(p)&&(d=y-1),p=o.Xa(p),y=0G||0>H&&G==0||!this.Fv(j,m,w)||(z.L(w),U=!1,++B,l=!0),U){if(0.5*this.vk?(A.add(j,m),A.scale(.5),C.normalize(),C.ar(),T.L(C),T.scale(D-B),A.add(T),o.mf(y,A)):o.pd(y,!0),B=0}j.L(m),b=p}m.L(w),y=p,p=g,g=0a?(this.oq=!1,o):(this.oq=!0,e.Fg.Mk(o,this.ct,!1,!0,this.Ub))},s.prototype.yu=function(o,a){if(a=a.D(),this.Id!=null&&this.Id.length!==0){var u=new e.h;u.L(this.Id[0]),u.Ct(this.rb,a),o.Lt(u);for(var c=1,l=this.Id.length;c=t?1:-1;case 1:if(r.G=t?1:-1;case 2:if(r.v>=t&&r.C>t)break;return r.C<=t?1:-1;case 3:if(!(r.G>=t&&r.H>t))return r.H<=t?1:-1}return 0},f.prototype.Ay=function(r,n){return r.getType()==1736?this.Cy(r,n):this.Dy(r)},f.prototype.Cy=function(r,n){if(this.Ca.R()==0||this.Ca.ca()==0)return r.Ia();var t=new e.l;r.xc(t),this.X=this.g.Ib(r);var i=new e.l,h=new e.l,s=new e.h,o=new e.h,a=[0,0,0,0,0,0,0,0,0],u=[0,0,0,0,0,0,0,0,0];new e.ig;var c=new e.yb,l=new e.ia(0);l.Jb(Math.min(100,r.I()));for(var p=!1,y=0;!p&&4>y;y++){var d=!1,g=(1&y)!=0,b=0;switch(y){case 0:b=this.Ca.v,d=t.v<=b&&t.C>=b;break;case 1:b=this.Ca.G,d=t.G<=b&&t.H>=b;break;case 2:b=this.Ca.C,d=t.v<=b&&t.C>=b;break;case 3:b=this.Ca.H,d=t.G<=b&&t.H>=b}if(d)for(p=!0,d=this.g.Ob(this.X);d!=-1;){var x=-1,m=-1,w=this.g.Xa(d),j=w;do{var M=this.g.bc(j);M==null&&(M=c,this.g.D(j,s),M.Dc(s),this.g.D(this.g.U(j),o),M.Qc(o)),M.A(i);var A=this.Lh(i,y,b),z=0,N=-1;if(A==-1){z=0<(M=M.cq(g,b,a,u))?this.g.Ul(j,u,M):0,z+=1;var I=j,C=this.g.U(I);for(M=0;Mthis.g.Ja(d)?this.g.Zq(d):this.g.Rb(d)}}return p?r.Ia():(this.FB(),0u;u++){var c=!1,l=(1&u)!=0,p=0;switch(u){case 0:p=this.Ca.v,c=a.v<=p&&a.C>=p;break;case 1:p=this.Ca.G,c=a.G<=p&&a.H>=p;break;case 2:p=this.Ca.C,c=a.v<=p&&a.C>=p;break;case 3:p=this.Ca.H,c=a.G<=p&&a.H>=p}if(c){c=o,o=r.Ia(),(c=c.Ga()).Zi();for(var y,d=new e.h;c.$a();)for(var g,b=!0;c.Ha();){var x=c.ha();x.A(n);var m=this.Lh(n,u,p);if(m==-1){if(0<(m=x.cq(l,p,i,h))){var w=0;y=x.ac();for(var j=0;j<=m;j++)if(w!=(g=j=(u=e.O.truncate(Math.min(Math.ceil(u/r),2048)))))){for(var c=1;ch.size)){var l=this;h.Vd(0,h.size,function(A,z){return l.Mh(A,z)}),t=new e.h,s=new e.h,o=new e.h,s.Rc();var p=-1;a=new e.ia(0),u=new e.ia(0),c=this.g.Gd();for(var y=this.g.Gd(),d=0,g=h.size;dthis.Mh(p,m)&&(this.g.D(m,t),r?t.y==n:t.x==n)&&(a.add(p),w=!0,this.g.Ra(p,y,1)),0>this.Mh(p,b)&&(this.g.D(b,t),r?t.y==n:t.x==n)&&(w||a.add(p),this.g.Ra(p,c,1))}for(x=0,w=a.size;xthis.Mh(g,x)&&(this.g.D(x,a),r?a.y==n:a.x==n)&&(b=x),x=-1;var m=this.g.Ma(g);if(0>this.Mh(g,m)&&(this.g.D(m,a),r?a.y==n:a.x==n)&&(x=m),b!=-1&&x!=-1)this.Kh(g,i,h),this.g.pd(g,!1),this.Kh(b,i,h),this.g.pd(b,!1),l=!0;else if(b!=-1||x!=-1){for(m=d+1;mthis.Mh(w,j)&&(this.g.D(j,a),r?a.y==n:a.x==n)&&(M=j),j=this.g.Ma(w);var A=-1;if(0>this.Mh(w,j)&&(this.g.D(j,a),r?a.y==n:a.x==n)&&(A=j),M!=-1&&A!=-1){this.Kh(w,i,h),this.g.pd(w,!1),this.Kh(M,i,h),this.g.pd(M,!1),l=!0;break}if(b!=-1&&A!=-1){this.zt(i,g,b,w,A,h),l=!0;break}if(x!=-1&&M!=-1){this.zt(i,w,M,g,x,h),l=!0;break}}}if(l)break}}}if(!l)break}p=s,u.L(t)}}this.g.Td(h)},f.prototype.Kh=function(r,n,t){t=this.g.Pa(r,t),n.set(t,-1),t=this.g.Pa(r,this.ji),this.dd.set(t,-1),(n=this.g.bd(r))!=-1&&this.g.Xa(n)==r&&(this.g.Jf(n,-1),this.g.Wg(n,-1))},f.prototype.zt=function(r,n,t,i,h,s){this.g.Bc(n,i),this.g.Cc(i,n),this.g.Cc(t,h),this.g.Bc(h,t),this.Kh(i,r,s),this.g.mi(i,!1),this.Kh(h,r,s),this.g.mi(h,!0)},f.prototype.Ty=function(){for(var r=0,n=this.dd.size;r=a?(t=this.g.Pa(o,this.ji),this.dd.set(t,-1),o=this.g.pd(o,!1),a==2&&(t=this.g.Pa(o,this.ji),this.dd.set(t,-1),this.g.pd(o,!1)),a=s,s=this.g.Rb(s),this.g.Jf(a,-1),this.g.$q(a)):(this.g.cp(s,!1),this.g.Wg(s,this.g.Ma(o)),this.g.Vj(s,a),h+=a,i++,s=this.g.Rb(s))}}for(r=0,n=this.dd.size;r=a?(t=this.g.Pa(o,this.ji),this.dd.set(t,-1),o=this.g.pd(o,!1),a==2&&(0<=(t=this.g.Pa(o,this.ji))&&this.dd.set(t,-1),this.g.pd(o,!1)),a=s,this.g.Jf(a,-1),this.g.$q(a)):(this.g.kn(s,!0),this.g.Vj(s,a),this.g.Jf(s,o),this.g.Wg(s,this.g.Ma(o)),this.g.cp(s,!1),h+=a,i++)}for(this.g.Rl(this.X,i),this.g.Tj(this.X,h),r=0,n=this.g.ld;n!=-1;n=this.g.ue(n))r+=this.g.I(n);this.g.bC(r)},f.By=function(r,n,t){return new f(n).Ay(r,t)},f.clip=function(r,n,t,i){if(r.B())return r;if(n.B())return r.Ia();if((t=r.getType())==33)return i=r.D(),n.contains(i)?r:r.Ia();if(t==197)return i=new e.l,r.A(i),i.Ea(n)?(n=new e.Fh,r.copyTo(n),n.Xo(i),n):r.Ia();var h=new e.l;if(r.xc(h),n.contains(h))return r;if(!n.isIntersecting(h))return r.Ia();if((h=r.Bb)!=null&&(h=h.Fk)!=null){if((h=h.Ro(n))==1){if(t!=1736)throw e.i.Qa();return(r=new e.Da(r.description)).tp(n),r}if(h==0)return r.Ia()}switch(t){case 550:t=null,h=r.I();for(var s=r.ub(0),o=0,a=0;a=t?1:-1;case 1:if(r.G=t?1:-1;case 2:if(r.v>=t&&r.C>t)break;return r.C<=t?1:-1;case 3:if(!(r.G>=t&&r.H>t))return r.H<=t?1:-1}return 0},f.prototype.Ay=function(r,n){return r.getType()==1736?this.Cy(r,n):this.Dy(r)},f.prototype.Cy=function(r,n){if(this.Ca.R()==0||this.Ca.ca()==0)return r.Ia();var t=new e.l;r.xc(t),this.X=this.g.Ib(r);var i=new e.l,h=new e.l,s=new e.h,o=new e.h,a=[0,0,0,0,0,0,0,0,0],u=[0,0,0,0,0,0,0,0,0],c=new e.yb,l=new e.ia(0);l.Jb(256);for(var p=!1,y=0;!p&&4>y;y++){var d=!1,g=(1&y)!=0,b=0;switch(y){case 0:b=this.Ca.v,d=t.v<=b&&t.C>=b;break;case 1:b=this.Ca.G,d=t.G<=b&&t.H>=b;break;case 2:b=this.Ca.C,d=t.v<=b&&t.C>=b;break;case 3:b=this.Ca.H,d=t.G<=b&&t.H>=b}if(d)for(p=!0,d=this.g.Ob(this.X);d!=-1;){var x=!0,m=-1,w=-1,j=this.g.Xa(d),M=j;do{var A=this.g.bc(M);A==null&&(A=c,this.g.D(M,s),A.Dc(s),this.g.D(this.g.U(M),o),A.Qc(o)),A.A(i);var z=this.Lh(i,y,b),N=0,I=-1;if(z==-1){N=0<(A=A.cq(g,b,a,u))?this.g.LX(M,u,A):0,N+=1;var C=M,T=this.g.U(C);for(A=0;Ay;y++){var d=!1,g=(1&y)!=0,b=0;switch(y){case 0:b=this.Ca.v,d=a.v<=b&&a.C>=b;break;case 1:b=this.Ca.G,d=a.G<=b&&a.H>=b;break;case 2:b=this.Ca.C,d=a.v<=b&&a.C>=b;break;case 3:b=this.Ca.H,d=a.G<=b&&a.H>=b}if(d)for(d=o,o=r.Ia(),(d=d.Ga()).Zi();d.$a();)for(var x,m=!0;d.Ha();){var w=d.ha();w.A(n);var j=this.Lh(n,y,b);if(j==-1){if(0<(j=w.cq(g,b,i,h))){var M=0;w.Yp(u);for(var A=0;A<=j;A++)if(M!=(x=Ai.x&&(i.x+=r)}else p=n.y-this.Ca.G,h.y=e.lc.sign(t.y-n.y),i.y=r*e.lc.Cn(Math.floor(Math.abs(p/r)),p)+this.Ca.G,0>i.y&&(i.y+=r);p=l!=0?t.y-n.y:t.x-n.x;var y=Math.abs(p);if(65536=g||(s[y]=g,y++)}y!=0&&this.g.Ul(u,s,y)}}u=c}while(u!=a)}},f.prototype.Vl=function(r,n){for(var t=-1,i=new e.h,h=null,s=this.g.Ob(this.X);s!=-1;s=this.g.Rb(s))for(var o=this.g.Xa(s),a=0,u=this.g.Ja(s);ah.size)){var l=this;h.Vd(0,h.size,function(A,z){return l.Mh(A,z)}),t=new e.h,s=new e.h,o=new e.h,s.Rc();var p=-1;a=new e.ia(0),u=new e.ia(0),c=null;for(var y=this.g.Gd(),d=this.g.Gd(),g=0,b=h.size;gs.compare(t)&&(r?t.y==n:t.x==n)&&(a.add(p),j=!0,this.g.Ra(p,d,1)),this.g.D(x,t),0>s.compare(t)&&(r?t.y==n:t.x==n)&&(j||a.add(p),this.g.Ra(p,y,1))}for(m=0,j=a.size;mu.compare(a)&&(r?a.y==n:a.x==n)&&(b=x),x=-1;var m=this.g.Ma(g);if(this.g.D(m,a),0>u.compare(a)&&(r?a.y==n:a.x==n)&&(x=m),b!=-1&&x!=-1)this.Kh(g,i,h),this.g.pd(g,!1),this.Kh(b,i,h),this.g.pd(b,!1),l=!0;else if(b!=-1||x!=-1){for(m=d+1;mu.compare(a)&&(r?a.y==n:a.x==n)&&(M=j),j=this.g.Ma(w);var A=-1;if(this.g.D(j,a),0>u.compare(a)&&(r?a.y==n:a.x==n)&&(A=j),M!=-1&&A!=-1){this.Kh(w,i,h),this.g.pd(w,!1),this.Kh(M,i,h),this.g.pd(M,!1),l=!0;break}if(b!=-1&&A!=-1){this.zt(i,g,b,w,A,h),l=!0;break}if(x!=-1&&M!=-1){this.zt(i,w,M,g,x,h),l=!0;break}}}if(l)break}}}if(!l)break}p=s,u.L(t)}this.g.Td(h)}},f.prototype.Kh=function(r,n,t){t=this.g.Pa(r,t),n.set(t,-1),t=this.g.Pa(r,this.ji),this.dd.set(t,-1),(n=this.g.bd(r))!=-1&&this.g.Xa(n)==r&&(this.g.Jf(n,-1),this.g.Wg(n,-1))},f.prototype.zt=function(r,n,t,i,h,s){this.g.Bc(n,i),this.g.Cc(i,n),this.g.Cc(t,h),this.g.Bc(h,t),this.Kh(i,r,s),this.g.mi(i,!1),this.Kh(h,r,s),this.g.mi(h,!0)},f.prototype.Ty=function(){for(var r=0,n=this.dd.size;r=a?(t=this.g.Pa(o,this.ji),this.dd.set(t,-1),o=this.g.pd(o,!1),a==2&&(0<=(t=this.g.Pa(o,this.ji))&&this.dd.set(t,-1),this.g.pd(o,!1)),a=s,this.g.Jf(a,-1),this.g.$q(a)):(this.g.kn(s,!0),this.g.Vj(s,a),this.g.Jf(s,o),this.g.Wg(s,this.g.Ma(o)),this.g.cp(s,!1),h+=a,i++)}for(this.g.Rl(this.X,i),this.g.Tj(this.X,h),r=0,n=this.g.ld;n!=-1;n=this.g.ue(n))r+=this.g.I(n);this.g.bC(r)},f.By=function(r,n,t,i){return new f(n,i).Ay(r,t)},f.clip=function(r,n,t,i,h){return f.Nu(r,n,null,t,i,h)},f.Nu=function(r,n,t,i,h,s){var o=r.getType();if(o==33)return h=r.D(),n.contains(h)?r:r.Ia();if(o==197)return h=new e.l,r.A(h),h.Ea(n)?(n=new e.Fh,r.copyTo(n),n.Xo(h),n):r.Ia();if(r.B())return r;if(n.B())return r.Ia();var a=new e.l;if(r.xc(a),n.contains(a))return r;if(!n.isIntersecting(a))return r.Ia();if((t!=null||isNaN(i))&&e.ta.ty(t,n,!1),!e.aa.xj(o))throw e.i.N();if((t=r.Bb)!=null&&(t=t.Fk)!=null){if((t=t.Ro(n))==1){if(o!=1736)throw e.i.fa("internal error");return(r=new e.Da(r.description)).tp(n),r}if(t==0)return r.Ia()}switch(o){case 550:for(s=null,o=r.I(),t=r.ub(0),i=0,h=new e.h,a=0;a=a;a+=1)for(var u=0;1>=u;u+=1){var c=n.jG(s+a,o+u),l=this.xl.rR(c);l!=-1&&(this.pq[h]=l,this.xs[h]=c,h++)}for(s=h-1;1<=s;s--)for(l=this.pq[s],o=s-1;0<=o;o--)if(l==this.pq[o]){this.xs[o]=-1,s!=--h&&(this.xs[s]=this.xs[h],this.pq[s]=this.pq[h]);break}for(o=0;oo.Db())throw e.i.N();return a==0||o.B()?o:((p=new s(p)).ko=o,p.Ka=a,p.qa=l,p.Ki=u,p.CA=c,p.Rx())},s.prototype.eM=function(){var o=this.ko,a=o.ac(),u=o.wc(),c=new e.h;return c.uc(u,a),c.normalize(),c.Hv(),c.scale(this.Ka),a.add(c),u.add(c),c=o.Ia(),o.Dc(a),o.Qc(u),c},s.prototype.dM=function(){var o=this.ko;if(0p&&(0this.Ka?-f:f,-1g&&(.017453292519943295>(b=2*Math.acos(g))&&(b=.017453292519943295),1<(y=e.O.truncate(f/b+1.5))&&(d/=y)),b=w+n,w=t.Pd(p,this.Ka,b),o==0&&(w.type|=1024),this.fc(w,o),g=this.Ka/Math.cos(d/2),b+=d/2,(w=t.Pd(p,g,b)).type|=1024,this.fc(w);0<--y;)b+=d,(w=t.Pd(p,g,b)).type|=1024,this.fc(w);(w=t.Pd(p,this.Ka,j-n)).type|=1024,this.fc(w)}else if(this.Ki==1)w=t.Pd(p,this.Ka,w+n),this.fc(w,o),w=t.Pd(p,this.Ka,j-n),this.fc(w);else if(this.Ki==0)for(g=1-u/Math.abs(this.Ka),y=1,d=j-n-(w+n),-1g&&(.017453292519943295>(b=2*Math.acos(g))&&(b=.017453292519943295),1<(y=e.O.truncate(Math.abs(d)/b+1.5))&&(d/=y)),g=this.Ka/Math.cos(.5*d),b=w+n+.5*d,w=t.Pd(p,g,b),this.fc(w,o);0<--y;)b+=d,w=t.Pd(p,g,b),this.fc(w);else this.Ki==2?(g=y.x-p.x,b=y.y-p.y,.99999999<(y=(g*(x=d.x-p.x)+b*(m=d.y-p.y))/Math.sqrt(g*g+b*b)/Math.sqrt(x*x+m*m))?(w=t.Pd(p,1.4142135623730951*this.Ka,j-.25*f),this.fc(w,o),w=t.Pd(p,1.4142135623730951*this.Ka,j+.25*f),this.fc(w)):(y=Math.abs(this.Ka/Math.sin(.5*Math.acos(y))))>(d=Math.abs(this.CA*this.Ka))?(g=.5*(j-w),g=this.Ka/Math.abs(Math.sin(g)),w=t.Pd(p,g,.5*(w+j)),j=e.h.construct(w.x,w.y),w=e.h.construct(p.x,p.y),(p=new e.h).uc(j,w),(j=new e.h).HW(d/p.length(),p,w),w=(y-d)*Math.abs(this.Ka)/Math.sqrt(y*y-this.Ka*this.Ka),0w&&(j-=r),y=w-j(g=1.4142135623730951*this.Ka)?w+.25*f:w+.75*f,w=t.Pd(p,g,b),this.fc(w,o),b=0>g?j-.25*f:j-.75*f,w=t.Pd(p,g,b),this.fc(w)):(g=.5*(j-w),g=this.Ka/Math.abs(Math.sin(g)),ja))for(var u=0;u=c+1;a--)(u=t.al(o.Na(a))).type|=1024,this.wg.push(u);if(this.mE())if(2<=this.Yb.length){for(o=-1,(l=(1024&this.Yb[this.gf-1].type)!=0)||(o=0),a=1;a=Math.min(u.x,c.x)&&Math.max(u.x,c.x)>=Math.min(o.x,a.x)&&Math.max(o.y,a.y)>=Math.min(u.y,c.y)&&Math.max(u.y,c.y)>=Math.min(o.y,a.y)},s.prototype.xQ=function(o,a,u,c,l){l.bE=!1;var p=(a.y-o.y)*(c.x-u.x)-(a.x-o.x)*(c.y-u.y),y=(u.y-o.y)*(a.x-o.x)-(u.x-o.x)*(a.y-o.y);if(0<=(p=p==0?2:y/p)&&1>=p){var d=p;if(p=(c.y-u.y)*(a.x-o.x)-(c.x-u.x)*(a.y-o.y),y=(o.y-u.y)*(c.x-u.x)-(o.x-u.x)*(c.y-u.y),0<=(p=p==0?2:y/p)&&1>=p)return l.an=t.TO(o.x+p*(a.x-o.x),o.y+p*(a.y-o.y)),l.an.Uh=u.Uh+d*(c.Uh-u.Uh),d!=0&&d!=1||p!=0&&p!=1||(l.bE=!0),l.VY=p,l.WY=d,!((d==0||d==1)&&0p||(p==0||p==1)&&0d)}return!1},s.prototype.QO=function(o){for(;this.Yb[o].sho-(s*=2))return!0;h=new e.h;var a=new e.h,u=new e.h;i.tc(s,h),i.tc(s+2,a),i.tc(s+4,u);var c=t.Wu(a,u,h);if(c.ps()||!t.um(c.value()))return!1;var l=e.h.construct(a.x,a.y),p=new e.h;for(s+=6;so;o++){i.mB(o,s);var a=this.Cr(s);if(a!=-1){i.Hf(o,h);var u=this.g.fc(this.Ss,h);this.Fa.Sj(a,u)}}},t.prototype.oN=function(i){var h=new e.Sa,s=i.ac();if((s=this.Cr(s))!=-1){i.To(h);var o=this.g.fc(this.Ss,h);this.Fa.Sj(s,o)}s=i.wc(),(s=this.Cr(s))!=-1&&(i.Po(h),i=this.g.fc(this.Ss,h),this.Fa.Sj(s,i))},t.prototype.nN=function(i){var h=i.D();(h=this.Cr(h))!=-1&&(i=this.g.fc(this.Ss,i),this.Fa.Sj(h,i))},t.prototype.Cr=function(i){var h=-1;if(this.Fa.size(-1)==0)return this.Fa.addElement(-4,-1);if(this.Fa.size(-1)==1){var s=this.g.Na(this.Fa.ja(this.Fa.rc(-1)));return i.Rz(s)||(h=this.Fa.xn(-5)),h}return this.pC(i)},t.prototype.pC=function(i){var h=-1;do{var s=this.Fa.rc(-1),o=this.Fa.Fc(-1),a=this.Fa.ja(s),u=this.Fa.ja(o),c=new e.h,l=new e.h;if(this.Xh.D(a,c),this.Xh.D(u,l),a=e.h.Uq(l,i,c),t.um(a))h=this.Fa.xn(-1),(c=this.nC(i,o,s))!=s&&this.oC(i,s,this.Fa.we(c));else if(t.CG(a)){l=this.Fa.sv(-1);var p=this.Fa.rc(-1),y=this.Fa.Fc(-1);for(a=new e.h,u=new e.h;p!=this.Fa.we(y);){var d=this.Fa.ja(l);this.Xh.D(d,a),d=e.h.Uq(a,i,c),t.CG(d)?(y=l,l=this.Fa.ll(l)):(p=l,l=this.Fa.Xp(l))}if(l=y,c=p,d=this.Fa.ja(l),p=this.Fa.ja(c),this.Xh.D(d,a),this.Xh.D(p,u),c!=s&&(a=e.h.Uq(u,i,a),!t.um(a)))continue;h=this.Fa.zu(c,l,-2,!1),this.oC(i,l,o),this.nC(i,c,s)}else this.sb==null&&(this.sb=new e.yb),this.sb.Dc(l),this.sb.Qc(c),0>(c=this.sb.fe(i,!0))?(c=this.Fa.we(o),this.Fa.vd(o,-1),h=this.Fa.xn(-3),this.nC(i,c,s)):1i},t.CG=function(i){return 0h)throw e.i.fa("Internal Error: max number of iterations exceeded");var a=this.nM(n);if(i=i||a,this.tH&&(a=this.g.Gp(n,!0,!1)!=0,i=i||a),a=!1,(s==0||o||e.$t.kI(!0,this.g,r,null,this.nd))&&(a=this.sM(t),i=i||a),!a)break;e.mp.zp(this.nd)}return i},f}();e.Tk=v}(k||(k={})),function(e){var v=function(){function r(n){this.$d=this.Mc=null,this.Ys=0,this.Ub=n,this.cA=!0}return r.prototype.uv=function(n,t){var i=this.g.bc(n);if(i==null){if(!this.g.ed(n,t))return null;i=t}return i},r.prototype.Xq=function(){var n;n===void 0&&(n=!1),this.Ys++,(n||!(4095&this.Ys))&&(this.Ys=0,e.mp.zp(this.Ub))},r.prototype.nP=function(){var n=this.g.Yq(!1),t=!1,i=new e.yb,h=new e.yb,s=new e.l;s.Oa();var o=new e.l;o.Oa();for(var a=new e.Sa,u=new e.TC,c=n.next();c!=-1;c=n.next()){e.mp.zp(this.Ub);var l=null,p=!1;if(!e.aa.Rn(this.g.ic(n.ck))){if((l=this.uv(c,i))==null)continue;if(l.A(s),s.W(this.qa,this.qa),l.Bi(this.qa)){if(!l.Bi(0))continue;p=!0,l=null}}var y=this.g.Yq(n),d=y.next();for(d!=-1&&(d=y.next());d!=-1;d=y.next()){var g=null,b=!1;if(!e.aa.Rn(this.g.ic(y.ck))){if((g=this.uv(d,h))==null)continue;if(g.A(o),g.Bi(this.qa)){if(!g.Bi(0))continue;b=!0,g=null}}var x=0,m=0;if(l!=null&&g!=null)s.HG(o)&&(u.Oo(l),u.Oo(g),u.Ea(this.qa,!1),0<(x=u.ol(0))+(m=u.ol(1))&&(this.g.jr(c,u,0,!0),this.g.jr(d,u,1,!0)),u.clear());else if(l!=null){var w=new e.h;if(this.g.D(d,w),s.contains(w)){if(u.Oo(l),this.g.Vi(d,a),u.Kz(this.qa,a,!1),0<(x=u.ol(0)))if(this.g.jr(c,u,0,!0),b){for(b=-1,w=this.g.U(d);w!=-1&&w!=d&&(b=w,(g=this.uv(w,h))!=null&&g.Bi(0));w=this.g.U(w));for(w=d;w!=-1&&(this.g.Dh(w,u.Bf),w!=b);w=this.g.U(w));}else this.g.Dh(d,u.Bf);u.clear()}}else{if(g==null)continue;if(w=new e.h,this.g.D(c,w),o.W(this.qa,this.qa),o.contains(w)){if(u.Oo(g),this.g.Vi(c,a),u.Kz(this.qa,a,!1),0<(m=u.ol(0)))if(this.g.jr(d,u,0,!0),p){for(b=-1,w=this.g.U(c);w!=-1&&w!=c&&(b=w,(g=this.uv(w,h))!=null&&g.Bi(0));w=this.g.U(w));for(w=c;w!=-1&&(this.g.Dh(w,u.Bf),w!=b);w=this.g.U(w));}else this.g.Dh(c,u.Bf);u.clear()}}if(x+m!=0){if(x!=0){if((l=this.g.bc(c))==null){if(!this.g.ed(c,i))continue;l=i,i.A(s)}else l.A(s);if(l.Bi(this.qa))break}t=!0}}}return t},r.prototype.oP=function(){return this.QU()},r.prototype.QU=function(){return new e.RC().PX(this.g,this.qa)},r.prototype.lI=function(){var n=!1;this.Mc==null&&(this.Mc=new e.Yj);var t=new e.ia(0);t.Jb(this.g.fd+1);for(var i=this.g.Yq(),h=i.next();h!=-1;h=i.next())t.add(h);this.g.nx(t,t.size),t.add(-1),i=this.g.Gd(),h=this.g.Gd(),this.$d=new e.UC(this.g,this.qa,!this.cA),this.Mc.Vo(this.$d);var s=new e.ia(0),o=new e.ia(0),a=0;new e.h;var u=this.g.td;this.g.vb.mc();for(var c,l,p=this.g.vb.za[0].o,y=t.get(a++);y!=-1;){var d=c=p[2*(l=u.T(y,0))],g=l=p[2*l+1];do{var b=u.T(y,2),x=u.T(y,1);if(b!=-1){var m=u.T(b,0),w=p[2*m];0>(g<(m=p[2*m+1])?-1:g>m?1:dw?1:0)&&(o.add(y),o.add(b))}x!=-1&&(w=p[2*(m=u.T(x,0))],0>(g<(m=p[2*m+1])?-1:g>m?1:dw?1:0)&&(o.add(x),o.add(x))),(w=this.g.Pa(y,i))!=-1&&(s.add(w),this.g.Ra(y,i,-1)),(w=this.g.Pa(y,h))!=-1&&(s.add(w),this.g.Ra(y,h,-1)),(y=t.get(a++))!==-1&&(d=p[2*(g=u.T(y,0))],g=p[2*g+1])}while(y!=-1&&d===c&&g===l);for(d=s.size==1&&o.size==2,w=g=-1,b=0,x=s.size;bn.fd?n=t.nP():t.oP())},r.V=function(n,t,i){return r.fQ(n,n.IF(),t,i)},r.kI=function(n,t,i,h,s){if(!r.yE(t))return!1;var o=new r(s);if(o.g=t,o.qa=i,o.cA=n,o.lI())return h!=null&&h.Wt(o.Ni),!0;var a=new e.Dd;return a.$B(),t.Oc(a),(o=new r(s)).g=t,o.qa=i,o.cA=n,n=o.lI(),a.$B(),t.Oc(a),!!n&&(h!=null&&h.Wt(o.Ni),!0)},r.Ml=function(n,t){return!(16>(n=n.I()))&&2*n+Math.log(n)*Math.LOG10E/Math.log(2)*t<1*n*t},r.lP=function(n,t,i,h){var s=t.getType();if(e.aa.Hc(s))return new r(h).mP(n,t,i);throw e.i.fa("crack_A_with_B")},r.prototype.mP=function(n,t,i){var h=new e.l;n.xc(h);var s=new e.l;if(t.xc(s),s.W(i,i),!s.isIntersecting(h))return n;var o=n.Bb,a=null;o!=null&&(a=o.Fb),r.Ml(n,n.I())&&(a=e.ta.jj(n,s));var u=a!=null?a.getIterator():null,c=t.Ga();t=n.Ga();var l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(s=[];c.$a();)for(;c.Ha();){var p=c.ha();if(a!=null){for(u.Uo(p,i),o=u.next();o!=-1;o=u.next())if(this.Xq(),t.Vb(a.ja(o),-1),t.Ha()){var y=(o=t.ha()).Ea(p,null,l,null,i);for(o=0;ot.t?1:n.tt.index?1:-1},r}()}(k||(k={})),function(e){var v;(v=e.KK||(e.KK={}))[v.Left=0]="Left",v[v.Right=1]="Right",v[v.Coincident=2]="Coincident",v[v.Undefined=3]="Undefined",v[v.Uncut=4]="Uncut";var f=function(t,i,h,s,o,a,u,c,l,p,y){this.X=t,this.bt=i,this.Ns=h,this.tg=s,this.Lm=p,this.Al=y};e.uY=f;var r=function(){function t(i,h){this.JH=i,this.Hi=h}return t.prototype.qM=function(i,h){var s=new e.h;this.Hi.D(i,s);var o=new e.h;return this.Hi.D(h,o),(s=s.compare(o))!=0?s:(i=this.Hi.Pa(i,this.JH))<(h=this.Hi.Pa(h,this.JH))?-1:i==h?0:1},t}(),n=function(t,i,h,s,o,a,u,c,l){this.tg=t,this.Ns=i,this.OA=h,this.UH=s,this.Ei=o,this.Al=a,this.Lm=u,this.VH=c,this.OT=l};e.tY=n,e.LK=function(){function t(){}return t.JK=function(i,h,s,o,a,u){if(h.B())i=new f(h,4,-1,-1,NaN,4,-1,-1,NaN,-1,-1),a.push(i);else if(s.B())i=new f(h,4,-1,-1,NaN,4,-1,-1,NaN,-1,-1),a.push(i);else{var c=new e.gd;if(c.Ib(h),c.Ib(s),e.Tk.V(c,o,u,!0),c.fd==0)i=new f(h.Ia(),4,-1,-1,NaN,4,-1,-1,NaN,-1,-1),a.push(i);else{for(h=0,s=c.Gd(),o=c.ld;o!=-1;o=c.ue(o))for(u=c.Ob(o);u!=-1;u=c.Rb(u))for(var l=c.Xa(u),p=0,y=c.Ja(u);p(g=g.Ea(l,null,y,d,0))&&(o=new n(a,o,y[0],NaN,g,c,u,d[0],NaN),s.push(o),0>(o=h.Pa(a,i))&&h.Ra(a,i,s.length-1)),!0},t.wM=function(i,h,s,o,a,u,c){var l=new e.yb,p=new e.yb,y=[0,0],d=[0,0],g=h.bc(a);return g==null&&(h.ed(a,l),g=l),(l=h.bc(c))==null&&(h.ed(c,p),l=p),2>(g=g.Ea(l,null,y,d,0))&&(o=new n(a,o,y[0],NaN,g,c,u,d[0],NaN),s.push(o),0>(o=h.Pa(a,i))&&h.Ra(a,i,s.length-1),!0)},t.xM=function(i,h,s,o,a,u,c,l){var p=new e.yb,y=new e.yb,d=[0,0],g=[0,0],b=h.bc(a);return b==null&&(h.ed(a,p),b=p),(p=h.bc(c))==null&&(h.ed(c,y),p=y),(b=b.Ea(p,null,d,g,0))==2?(o=new n(a,o,d[0],d[1],b,c,u,g[0],g[1]),s.push(o),0>(o=h.Pa(a,i))&&h.Ra(a,i,s.length-1),!0):(y=!1,a==l&&(o=new n(a,o,d[0],NaN,b,c,u,g[0],NaN),s.push(o),0>(o=h.Pa(a,i))&&h.Ra(a,i,s.length-1),y=!0),y)},t.yM=function(i,h,s,o,a,u,c,l){var p=new e.yb,y=new e.yb,d=[0,0],g=[0,0],b=h.bc(a);return b==null&&(h.ed(a,p),b=p),(p=h.bc(c))==null&&(h.ed(c,y),p=y),(b=b.Ea(p,null,d,g,0))==2?(o=new n(a,o,d[0],d[1],b,c,u,g[0],g[1]),s.push(o),0>(o=h.Pa(a,i))&&h.Ra(a,i,s.length-1),!0):(y=!1,a==l&&(o=new n(a,o,d[0],NaN,b,c,u,g[0],NaN),s.push(o),0>(o=h.Pa(a,i))&&h.Ra(a,i,s.length-1),y=!0),y)},t.cM=function(i,h,s,o){var a=[];a[0]=new e.h,a[1]=new e.h,a[2]=new e.h,a[3]=new e.h;var u=new e.h,c=new e.h,l=new e.h,p=new e.h,y=null;o!=null&&(y=new e.ig).Or();var d=0,g=null,b=new e.yb;new e.yb;for(var x=s.Ob(s.ld);x!=-1;x=s.Rb(x)){for(var m=4,w=-1,j=-1,M=-1,A=-1,z=NaN,N=!0,I=!1,C=!0,T=!0,D=!0,B=0,E=x,G=0,H=s.Xa(x),U=s.Ja(x),$=0;$=h.length-2||h[d+2].Ns!=w)&&(m=0):m=1):((S!=R||L&&R==0)&&(o!=null?(O=new f(g,3,w,K,S,m,E,j,G,X,V),o.push(O)):null.add(B)),m=1):m!=0?((S!=R||L&&R==0)&&(o!=null?(O=new f(g,0,w,K,S,m,E,j,G,X,V),o.push(O)):null.add(B)),tt?(d>=h.length-2||h[d+2].Ns!=w)&&(m=1):m=0):((S!=R||L&&R==0)&&(o!=null?(O=new f(g,3,w,K,S,m,E,j,G,X,V),o.push(O)):null.add(B)),m=0),(S!=R||L&&R==0)&&(R=S,E=w,j=K,G=S,M=X,A=V,z=nt,N=C=!1,T=D=!0))}}d++}R!=1&&(D&&(o!=null?g=new e.Ta:B=0),o!=null?(W.ah(R,1,y),g.oc(y.get(),T)):B++,T=D=!1,C=!0)}C&&(S=1,K=s.rj(x),K=s.Ma(K),V=X=-1,nt=NaN,N?o!=null?(O=new f(g,4,w,K,S,m,E,j,G,X,V),o.push(O)):null.add(B):(N=m==1?0:m==0?1:3,o!=null?(O=new f(g,N,w,K,S,m,E,j,G,X,V),o.push(O)):null.add(B)))}},t.CM=function(i,h,s,o,a,u){var c=s[o].VH;if(c==1)return t.AM(i,h,s,o,a,u);if(c==0)return t.BM(i,h,s,o,a,u);throw e.i.Qa()},t.AM=function(i,h,s,o,a,u){var c=new e.yb,l=s[o].tg,p=s[o].Lm,y=s[o].Al,d=-1,g=-1,b=-1,x=-1;if(!i&&0.01*n&&(i*=1+(1+(r=r.xb/n))*r),this.pb=t,this.xb=i+2220446049250313e-31*Math.abs(t)},f.prototype.sqrt=function(){if(0<=this.pb){var r=Math.sqrt(this.pb),n=this.pb>10*this.xb?.5*this.xb/r:this.pb>this.xb?r-Math.sqrt(this.pb-this.xb):Math.max(r,Math.sqrt(this.pb+this.xb)-r);n+=2220446049250313e-31*Math.abs(r)}else this.pb<-1*this.xb?n=r=NaN:(r=0,n=Math.sqrt(this.xb));this.pb=r,this.xb=n},f.prototype.sin=function(r){var n=Math.sin(r.pb),t=Math.cos(r.pb);this.pb=n,n=Math.abs(n),this.xb=(Math.abs(t)+.5*n*r.xb)*r.xb+2220446049250313e-31*n},f.prototype.cos=function(r){var n=Math.sin(r.pb),t=Math.cos(r.pb);this.pb=t,t=Math.abs(t),this.xb=(Math.abs(n)+.5*t*r.xb)*r.xb+2220446049250313e-31*t},f.prototype.qg=function(){return Math.abs(this.pb)<=this.xb},f.prototype.ps=function(){return this.qg()&&this.xb!=0},f}();e.Wb=v}(k||(k={}));var Q=new k.h,ht=new k.h,et=new k.h,st=new k.h,ot=new k.h;(function(e){var v,f;(f=v||(v={}))[f.closedPath=1]="closedPath",f[f.exteriorPath=2]="exteriorPath",f[f.ringAreaValid=4]="ringAreaValid";var r=function(){function n(t,i,h,s,o,a,u){i!==void 0?(this.ib=t,this.ck=i,this.bl=h,this.ii=s,this.ya=a,this.hA=u,this.ew=o):(this.ib=t.ib,this.ck=t.ck,this.bl=t.bl,this.ii=t.ii,this.ya=t.ya,this.hA=t.hA,this.ew=t.ew),this.bH=!0}return n.prototype.next=function(){return this.bH?(this.bH=!1,this.ii):this.ii!=-1?(this.ii=this.ib.U(this.ii),this.ya++,this.ii!=-1&&this.ii!=this.ew?this.ii:this.$T()):-1},n.prototype.$T=function(){for(this.bl=this.ib.Rb(this.bl),this.ya=0;this.ck!=-1;){for(;this.bl!=-1;this.bl=this.ib.Rb(this.bl))if(this.ew=this.ii=this.ib.Xa(this.bl),this.ii!=-1)return this.ii;if(this.ck=this.ib.ue(this.ck),this.ck==-1)break;this.hA&&!e.aa.Hc(this.ib.ic(this.ck))||(this.bl=this.ib.Ob(this.ck))}return-1},n.AP=function(t,i,h,s,o,a,u){return new n(t,i,h,s,o,a,u)},n}();e.zY=r,v=function(){function n(){this.jo=this.Am=this.wk=this.cd=this.Ck=this.vo=this.Oi=this.md=this.bi=this.Sg=this.We=this.Il=null,this.qw=this.ld=-1,this.fd=0,this.fA=!1,this.ht=this.it=this.vb=null}return n.prototype.Sh=function(t){return this.We!=null?this.We[t]:null},n.prototype.Xg=function(t,i){if(this.We==null){if(i==null)return;this.We=[];for(var h=0,s=this.vb.I();h=this.Oi.size&&(t=16>i?16:e.O.truncate(3*i/2),this.Oi.resize(t),this.vo.resize(t)),this.Oi.set(i,0),this.vo.set(i,0),i},n.prototype.sF=function(t){this.md.jd(t)},n.prototype.Vy=function(t){this.td.jd(t),this.fd--},n.prototype.oI=function(t){this.md==null&&(this.md=new e.$c(8),this.td=new e.$c(5),this.Oi=new e.be(0),this.vo=new e.be(0));var i=this.td.Ce(),h=0<=t?t:i;if(this.td.S(i,0,h),0>t){if(h>=this.vb.I()){if(t=16>h?16:e.O.truncate(3*h/2),this.vb.resize(t),this.We!=null)for(var s=0;si.Ja(s))){var a=this.vf(t,-1);this.kn(a,i.dc(s));for(var u=i.Ba(s),c=i.Vc(s);ut.Ja(i))return h;this.Il.Fd(t,t.Ba(i),t.Vc(i)),this.it=this.vb.ub(0);var s=this.vf(h,-1);this.kn(s,t.dc(i)||!0);var o=this.We!=null&&t.Ve!=null,a=t.Ba(i);for(i=t.Vc(i);a=i.size&&i.resize(Math.max(e.O.truncate(1.25*t),16),-1),i.write(t,h)},n.prototype.KF=function(t,i){return(t=this.JF(t))<(i=this.wk[i]).size?i.read(t):-1},n.prototype.aF=function(){this.wk==null&&(this.wk=[]);for(var t=0;tl:2>l)?(u=this.Zq(u),s=0y){var d=y;c!=null&&(d=0d){var g=d;if(c!=null&&(g=0s||o>this.fd-1)throw e.i.N("invalid call");if(s>o&&!this.dc(t))throw e.i.N("cannot iterate across an open path");for(t=0;i!=h;i=this.U(i))s=this.Ua(i),(o=this.Sh(s))!=null?t+=o.Qb():(o=this.Ua(this.U(i)),t+=this.vb.yr(s,o));return t},n.prototype.Dh=function(t,i){var h=this.Ua(t);this.vb.Ht(h,i),(h=this.Sh(h))!=null&&h.setStart(i),(t=this.Ma(t))!=-1&&(t=this.Ua(t),this.Sh(t)!=null&&h.setEnd(i))},n.prototype.Vi=function(t,i){t=this.Ua(t),this.vb.ve(t,i)},n.prototype.mf=function(t,i){this.Cb(t,i.x,i.y)},n.prototype.Cb=function(t,i,h){var s=this.Ua(t);this.vb.Cb(s,i,h),(s=this.Sh(s))!=null&&s.ZB(i,h),(t=this.Ma(t))!=-1&&(t=this.Ua(t),this.Sh(t)!=null&&s.Ql(i,h))},n.prototype.D=function(t,i){this.vb.D(this.td.T(t,0),i)},n.prototype.Gc=function(t,i){this.vb.za[0].tc(2*this.td.T(t,0),i)},n.prototype.Na=function(t){var i=new e.h;return this.vb.D(this.td.T(t,0),i),i},n.prototype.dG=function(t,i){this.it.tc(2*t,i)},n.prototype.Uc=function(t,i,h){return this.vb.Uc(t,this.Ua(i),h)},n.prototype.setAttribute=function(t,i,h,s){this.vb.setAttribute(t,this.Ua(i),h,s)},n.prototype.Ua=function(t){return this.td.T(t,0)},n.prototype.ih=function(){var t=new e.h;return this.D(void 0,t),t.y},n.prototype.fq=function(t,i){t=this.Ua(t),i=this.Ua(i);var h=this.vb.za[0].o;return h[2*t]===h[2*i]&&h[2*t+1]===h[2*i+1]},n.prototype.Dv=function(t,i){t=this.Ua(t);var h=this.vb.za[0].o;return h[2*t]===i.x&&h[2*t+1]===i.y},n.prototype.vX=function(t,i){if(1>i&&(i=1),this.Sg==null){if(i==1)return;this.Sg=e.Yc.Dn(this.vb.I(),1)}(t=this.Ua(t))>=this.Sg.size&&this.Sg.resize(t+1,1),this.Sg.write(t,i)},n.prototype.cG=function(t){return t=this.Ua(t),this.Sg==null||t>=this.Sg.size?1:this.Sg.read(t)},n.prototype.Ra=function(t,i,h){i=this.bi[i],t=this.Ua(t),i.sizeo?1:ac?1:0})},n.prototype.jS=function(){for(var t=this.ld;t!=-1;t=this.ue(t))if(!e.aa.Hc(this.ic(t)))return!0;return!1},n.prototype.hC=function(t,i){for(var h=this.Ob(t),s=this.Ob(i),o=this.kv(t),a=this.kv(i),u=this.Ob(t);u!=-1;u=this.Rb(u))this.gx(u,i);for(u=this.Ob(i);u!=-1;u=this.Rb(u))this.gx(u,t);this.Zo(t,s),this.Zo(i,h),this.$o(t,a),this.$o(i,o),h=this.I(t),s=this.da(t),o=this.da(i),this.Tj(t,this.I(i)),this.Tj(i,h),this.Rl(t,o),this.Rl(i,s),h=this.cd.T(t,2),this.cd.S(t,2,this.cd.T(i,2)),this.cd.S(i,2,h)},n}(),e.gd=v})(k||(k={})),function(e){var v=function(f){function r(n,t,i,h){var s=f.call(this)||this;return s.$=new e.l,n===void 0?s.UE():typeof n=="number"?s.VO(n,t,i,h):n instanceof e.Sa?t!==void 0?s.Qu(n,t,i):s.WO(n):n instanceof e.ra?t!==void 0?s.YO(n,t):s.XO(n):n instanceof e.l?s.UO(n):s.UE(),s}return J(r,f),r.prototype.Qu=function(n,t,i){this.description=e.ee.og(),this.$.Oa(),n.B()||this.tu(n,t,i)},r.prototype.UO=function(n){this.description=e.ee.og(),this.$.K(n),this.$.normalize()},r.prototype.XO=function(n){if(n==null)throw e.i.N();this.description=n,this.$.Oa()},r.prototype.YO=function(n,t){if(n==null)throw e.i.N();this.description=n,this.$.K(t),this.$.normalize()},r.prototype.UE=function(){this.description=e.ee.og(),this.$.Oa()},r.prototype.WO=function(n){this.description=e.ee.og(),this.$.Oa(),n.B()||this.tu(n)},r.prototype.VO=function(n,t,i,h){this.description=e.ee.og(),this.K(n,t,i,h)},r.prototype.K=function(n,t,i,h){if(this.vc(),typeof n=="number")this.$.K(n,t,i,h);else for(this.Oa(),t=0,i=n.length;t=e.ra.Va(t))throw e.i.N();var h=this.description.Pf(t);return this.ou(),0<=h?this.ka[this.kR(this.description,n)+this.description.LR(h)-2+i]:e.ra.se(t)},r.prototype.ou=function(){if(this.vc(),this.ka==null&&2=e.ra.Va(t))throw e.i.ce();var h=this.description.Pf(t);return 0<=h?(this.ou(),this.ka[r.Gg(this.description,n)+this.description.$j(h)-2+i]):e.ra.se(t)},r.prototype.vD=function(n,t,i,h){if(this.vc(),t==0)n!=0?i!=0?this.$.H=h:this.$.C=h:i!=0?this.$.G=h:this.$.v=h;else{if(i>=e.ra.Va(t))throw e.i.ce();if(!this.hasAttribute(t)){if(e.ra.DG(t,h))return;this.re(t)}t=this.description.Pf(t),this.ou(),this.ka[r.Gg(this.description,n)+this.description.$j(t)-2+i]=h}},r.Gg=function(n,t){return t*(n.Ae.length-2)},r.prototype.Ea=function(n){this.vc();var t=new e.l;return n.A(t),this.$.Ea(t)},r.prototype.isIntersecting=function(n){return n instanceof e.l?this.$.isIntersecting(n):this.$.isIntersecting(n.$)},r.prototype.Ju=function(n,t){this.vc(),n.B()?this.Oa():t!==void 0?this.tu(n,t):this.$.Ju(n.Lg(),n.ih())},r.prototype.offset=function(n,t){this.vc(),this.$.offset(n,t)},r.prototype.normalize=function(){this.vc(),this.$.normalize()},r.prototype.sf=function(n){if(n===void 0){if(n=new e.Sa(this.description),this.B())return n;for(t=this.description.Aa,i=1;ithis.C&&(this.C=i.x),i.ythis.H&&(this.H=i.y)}}else if(r==null||r.length==0)this.Oa();else for(i=r[0],this.K(i.x,i.y),t=1;tr?this.v=r:this.Cn?this.G=n:this.Hr?this.v=r:this.Cn?this.G=n:this.Hthis.C||this.G>this.H)&&this.Oa())},f.prototype.scale=function(r){0>r&&this.Oa(),this.B()||(this.v*=r,this.C*=r,this.G*=r,this.H*=r)},f.prototype.zoom=function(r,n){this.B()||this.K(this.sf(),r*this.R(),n*this.ca())},f.prototype.isIntersecting=function(r){return!this.B()&&!r.B()&&(this.v<=r.v?this.C>=r.v:r.C>=this.v)&&(this.G<=r.G?this.H>=r.G:r.H>=this.G)},f.prototype.HG=function(r){return(this.v<=r.v?this.C>=r.v:r.C>=this.v)&&(this.G<=r.G?this.H>=r.G:r.H>=this.G)},f.prototype.Ea=function(r){return!this.B()&&!r.B()&&(r.v>this.v&&(this.v=r.v),r.Cthis.G&&(this.G=r.G),r.Hr.length)throw e.i.N();r[0]!=null?r[0].ma(this.v,this.G):r[0]=e.h.construct(this.v,this.G),r[1]!=null?r[1].ma(this.v,this.H):r[1]=e.h.construct(this.v,this.H),r[2]!=null?r[2].ma(this.C,this.H):r[2]=e.h.construct(this.C,this.H),r[3]!=null?r[3].ma(this.C,this.G):r[3]=e.h.construct(this.C,this.G)},f.prototype.wF=function(){return this.B()?0:this.R()*this.ca()},f.prototype.yR=function(){return this.B()?0:2*(this.R()+this.ca())},f.prototype.gk=function(){return(this.C+this.v)/2},f.prototype.Jp=function(){return(this.H+this.G)/2},f.prototype.R=function(){return this.C-this.v},f.prototype.ca=function(){return this.H-this.G},f.prototype.move=function(r,n){this.B()||(this.v+=r,this.G+=n,this.C+=r,this.H+=n)},f.prototype.Ju=function(r,n){if(n!==void 0)this.move(r-this.gk(),n-this.Jp());else if(r instanceof e.h)this.Ju(r.x,r.y);else{if(!(r instanceof e.Sa))throw e.i.N();n=(this.C-this.v)/2;var t=(this.H-this.G)/2;this.v=r.Lg()-n,this.C=r.Lg()+n,this.G=r.ih()-t,this.H=r.ih()+t}},f.prototype.offset=function(r,n){this.v+=r,this.C+=r,this.G+=n,this.H+=n},f.prototype.normalize=function(){if(!this.B()){var r=Math.min(this.v,this.C),n=Math.max(this.v,this.C);this.v=r,this.C=n,r=Math.min(this.G,this.H),n=Math.max(this.G,this.H),this.G=r,this.H=n}},f.prototype.dn=function(r){r.ma(this.v,this.G)},f.prototype.$I=function(r){r.ma(this.C,this.G)},f.prototype.cJ=function(r){r.ma(this.v,this.H)},f.prototype.en=function(r){r.ma(this.C,this.H)},f.prototype.fT=function(){return this.B()||this.v<=this.C&&this.G<=this.H},f.prototype.sf=function(){return e.h.construct((this.C+this.v)/2,(this.H+this.G)/2)},f.prototype.mz=function(){return e.h.construct(this.v,this.G)},f.prototype.contains=function(r,n){if(n!==void 0)return r>=this.v&&r<=this.C&&n>=this.G&&n<=this.H;if(r instanceof e.Sa)return this.contains(r.Lg(),r.ih());if(r instanceof e.h)return this.contains(r.x,r.y);if(r instanceof f)return r.v>=this.v&&r.C<=this.C&&r.G>=this.G&&r.H<=this.H;throw e.i.N()},f.prototype.hm=function(r,n){if(n!==void 0)return r>this.v&&rthis.G&&nthis.v&&r.Cthis.G&&r.H>>32);var n=e.O.Th(r);return r=this.C,r=e.O.truncate(r^r>>>32),n=e.O.Th(r,n),r=this.G,r=e.O.truncate(r^r>>>32),n=e.O.Th(r,n),r=this.H,r=e.O.truncate(r^r>>>32),e.O.Th(r,n)},f.prototype.xr=function(){return this.B()?2220446049250313e-29:2220446049250313e-29*(Math.abs(this.v)+Math.abs(this.C)+Math.abs(this.G)+Math.abs(this.H)+1)},f.prototype.zy=function(r,n){var t=this.Zj(r),i=this.Zj(n);if(t&i)return 0;if(!(t|i))return 4;var h=(t!=0?1:0)|(i!=0?2:0);do{var s=n.x-r.x,o=n.y-r.y;if(s>o?t&f.YC?(t&f.ju?(r.y+=o*(this.v-r.x)/s,r.x=this.v):(r.y+=o*(this.C-r.x)/s,r.x=this.C),t=this.Zj(r)):i&f.YC?(i&f.ju?(n.y+=o*(this.v-n.x)/s,n.x=this.v):(n.y+=o*(this.C-n.x)/s,n.x=this.C),i=this.Zj(n)):t!=0?(t&f.ku?(r.x+=s*(this.G-r.y)/o,r.y=this.G):(r.x+=s*(this.H-r.y)/o,r.y=this.H),t=this.Zj(r)):(i&f.ku?(n.x+=s*(this.G-n.y)/o,n.y=this.G):(n.x+=s*(this.H-n.y)/o,n.y=this.H),i=this.Zj(n)):t&f.ZC?(t&f.ku?(r.x+=s*(this.G-r.y)/o,r.y=this.G):(r.x+=s*(this.H-r.y)/o,r.y=this.H),t=this.Zj(r)):i&f.ZC?(i&f.ku?(n.x+=s*(this.G-n.y)/o,n.y=this.G):(n.x+=s*(this.H-n.y)/o,n.y=this.H),i=this.Zj(n)):t!=0?(t&f.ju?(r.y+=o*(this.v-r.x)/s,r.x=this.v):(r.y+=o*(this.C-r.x)/s,r.x=this.C),t=this.Zj(r)):(i&f.ju?(n.y+=o*(this.v-n.x)/s,n.x=this.v):(n.y+=o*(this.C-n.x)/s,n.x=this.C),i=this.Zj(n)),(t&i)!=0)return 0}while(t|i);return h},f.prototype.Zj=function(r){return(r.xthis.C?1:0)<<1|(r.ythis.H?1:0)<<3},f.prototype.Bi=function(r){return!this.B()&&(this.R()<=r||this.ca()<=r)},f.prototype.tb=function(r){return r instanceof e.h?Math.sqrt(this.iK(r)):Math.sqrt(this.px(r))},f.prototype.px=function(r){var n=0,t=0,i=this.v-r.C;return i>n&&(n=i),(i=this.G-r.H)>t&&(t=i),(i=r.v-this.C)>n&&(n=i),(i=r.G-this.H)>t&&(t=i),n*n+t*t},f.prototype.iK=function(r){var n=0,t=0,i=this.v-r.x;return i>n&&(n=i),(i=this.G-r.y)>t&&(t=i),(i=r.x-this.C)>n&&(n=i),(i=r.y-this.H)>t&&(t=i),n*n+t*t},f.prototype.cn=function(r){this.B()?r.Oa():r.K(this.v,this.C)},f.ju=1,f.ku=4,f.YC=3,f.ZC=12,f}();e.l=v}(k||(k={})),function(e){var v,f;(f=v||(v={}))[f.initialize=0]="initialize",f[f.initializeRed=1]="initializeRed",f[f.initializeBlue=2]="initializeBlue",f[f.initializeRedBlue=3]="initializeRedBlue",f[f.sweep=4]="sweep",f[f.sweepBruteForce=5]="sweepBruteForce",f[f.sweepRedBlueBruteForce=6]="sweepRedBlueBruteForce",f[f.sweepRedBlue=7]="sweepRedBlue",f[f.sweepRed=8]="sweepRed",f[f.sweepBlue=9]="sweepBlue",f[f.iterate=10]="iterate",f[f.iterateRed=11]="iterateRed",f[f.iterateBlue=12]="iterateBlue",f[f.iterateBruteForce=13]="iterateBruteForce",f[f.iterateRedBlueBruteForce=14]="iterateRedBlueBruteForce",f[f.resetRed=15]="resetRed",f[f.resetBlue=16]="resetBlue";var r=function(){function n(t,i){this.ci=t,this.dH=i}return n.prototype.nr=function(t,i,h){this.ci.JX(h,t,i,this.dH)},n.prototype.$p=function(t){return this.ci.Rr(t,this.dH)},n}();v=function(){function n(){this.ow=this.oo=this.ff=this.rd=null,this.wq=new e.l,this.Am=this.Hj=this.Ij=this.Ad=this.Ef=this.Ld=this.cw=this.fo=this.qd=this.Eb=null,this.Xb=-1,this.qa=0,this.Nk()}return n.prototype.kr=function(){this.Nk(),this.Pv=!0,this.Eb==null?(this.fo=new e.ia(0),this.Eb=[]):(this.fo.Bh(0),this.Eb.length=0)},n.prototype.ad=function(t,i){if(!this.Pv)throw e.i.Hb();var h=new e.l;h.K(i),this.fo.add(t),this.Eb.push(h)},n.prototype.Fp=function(){if(!this.Pv)throw e.i.Hb();this.Pv=!1,this.Eb!=null&&0this.Eb.length)return this.pe=this.Eb.length,this.Xb=5,!0;this.rd==null&&(this.rd=new e.sr(!0),this.oo=this.rd.getIterator(),this.Ld=new e.ia(0)),this.rd.kr();for(var t=0;tthis.Eb.length||10>this.qd.length)return this.pe=this.Eb.length,this.Xb=6,!0;this.rd==null&&(this.rd=new e.sr(!0),this.oo=this.rd.getIterator(),this.Ld=new e.ia(0)),this.rd.kr();for(var t=0;tthis.Eb.length||10>this.qd.length)return this.pe=this.Eb.length,this.Xb=6,!0;this.ff==null&&(this.ff=new e.sr(!0),this.ow=this.ff.getIterator(),this.Ef=new e.ia(0)),this.ff.kr();for(var t=0;tthis.Eb.length||10>this.qd.length)return this.pe=this.Eb.length,this.Xb=6,!0;this.rd==null&&(this.rd=new e.sr(!0),this.oo=this.rd.getIterator(),this.Ld=new e.ia(0)),this.ff==null&&(this.ff=new e.sr(!0),this.ow=this.ff.getIterator(),this.Ef=new e.ia(0)),this.rd.kr();for(var t=0;t>1;return n.eq(t)?(this.rd.remove(i),this.pe!=0||(this.Af=this.Vf=-1,this.Ic=!0,!1)):(this.oo.EB(this.Eb[i].v,this.Eb[i].C,this.qa),this.Vf=i,this.Xb=10,!0)},n.prototype.QX=function(){return--this.pe==-1?(this.Af=this.Vf=-1,this.Ic=!0,!1):(this.Rg=this.Vf=this.pe,this.Xb=13,!0)},n.prototype.RX=function(){return--this.pe==-1?(this.Af=this.Vf=-1,this.Ic=!0,!1):(this.Vf=this.pe,this.Rg=this.qd.length,this.Xb=14,!0)},n.prototype.SX=function(){var t=this.Ld.get(this.pe-1),i=this.Ef.get(this.Rg-1),h=this.Rr(t,!0),s=this.Rr(i,!1);return h>s?this.ux():h>1;if(n.eq(t))return this.Df!=-1&&this.Ij.get(i)!=-1?(this.Ad.jd(this.Df,this.Ij.get(i)),this.Ij.set(i,-1)):this.rd.remove(i),this.pe!=0||(this.Af=this.Vf=-1,this.Ic=!0,!1);if(this.Cf!=-1&&0>1;if(n.eq(t))return this.Cf!=-1&&this.Hj.get(i)!=-1?(this.Ad.jd(this.Cf,this.Hj.get(i)),this.Hj.set(i,-1)):this.ff.remove(i),this.Rg!=0||(this.Af=this.Vf=-1,this.Ic=!0,!1);if(this.Df!=-1&&0>1;return this.rd.vj(t),this.Xb=4,!0},n.prototype.jT=function(){if(this.Vf=this.oo.next(),this.Vf!=-1)return!1;this.Af=this.Vf=-1;var t=this.Ef.get(this.Rg)>>1;return this.ff.vj(t),this.Xb=7,!0},n.prototype.gT=function(){if(this.Af=this.ow.next(),this.Af!=-1)return!1;var t=this.Ld.get(this.pe)>>1;return this.rd.vj(t),this.Xb=7,!0},n.prototype.hT=function(){if(--this.Rg==-1)return this.Xb=5,!0;this.wq.K(this.Eb[this.pe]);var t=this.Eb[this.Rg];return this.wq.W(this.qa,this.qa),!this.wq.isIntersecting(t)||(this.Af=this.Rg,!1)},n.prototype.iT=function(){if(--this.Rg==-1)return this.Xb=6,!0;this.wq.K(this.Eb[this.pe]);var t=this.qd[this.Rg];return this.wq.W(this.qa,this.qa),!this.wq.isIntersecting(t)||(this.Af=this.Rg,!1)},n.prototype.kJ=function(){return this.rd==null?(this.Ic=!0,!1):(this.pe=this.Ld.size,0>1],n.eq(t)?i.G-h:i.H+h):(i=this.qd[t>>1],n.eq(t)?i.G-h:i.H+h)},n}(),e.xC=v}(k||(k={})),function(e){var v=function(){function f(){}return f.construct=function(r,n,t,i,h,s){var o=new f;return o.v=r,o.G=n,o.Ye=t,o.C=i,o.H=h,o.Bg=s,o},f.prototype.Oa=function(){this.Ye=this.v=NaN},f.prototype.B=function(){return isNaN(this.v)},f.prototype.XS=function(){return isNaN(this.Ye)},f.prototype.K=function(r,n,t,i,h,s){i!==void 0?typeof r=="number"?(this.v=r,this.G=n,this.Ye=t,this.C=i,this.H=h,this.Bg=s):(this.v=r.x-.5*n,this.C=this.v+n,this.G=r.y-.5*t,this.H=this.G+t,this.Ye=r.z-.5*i,this.Bg=this.Ye+i):(this.v=r,this.G=n,this.Ye=t,this.C=r,this.H=n,this.Bg=t)},f.prototype.move=function(r){this.v+=r.x,this.G+=r.y,this.Ye+=r.z,this.C+=r.x,this.H+=r.y,this.Bg+=r.z},f.prototype.copyTo=function(r){r.v=this.v,r.G=this.G,r.C=this.C,r.H=this.H},f.prototype.Lk=function(r,n,t){this.v>r?this.v=r:this.Cn?this.G=n:this.Ht?this.Ye=t:this.Bgr.length)throw e.i.N();r[0]=new e.Nd(this.v,this.G,this.Ye),r[1]=new e.Nd(this.v,this.H,this.Ye),r[2]=new e.Nd(this.C,this.H,this.Ye),r[3]=new e.Nd(this.C,this.G,this.Ye),r[4]=new e.Nd(this.v,this.G,this.Bg),r[5]=new e.Nd(this.v,this.H,this.Bg),r[6]=new e.Nd(this.C,this.H,this.Bg),r[7]=new e.Nd(this.C,this.G,this.Bg)},f.prototype.Zw=function(r){if(r==null||r.length==0)this.Oa();else{var n=r[0];for(this.K(n.x,n.y,n.z),n=1;nthis.FA;){var a=this.sd.ha();if(h.L(a.ac()),s.L(a.wc()),h.scale(this.Wa.ec),s.scale(this.Wa.ec),e.cj.Mu(h,s)?h.x=s.x:e.cj.Ku(h,s)&&(s.x=h.x),this.uk.length=0,e.cj.tF(this.Wa.Tb,this.Wa.kc,this.Wa.ze,h,s,this.Wa.QA,this.Wa.Zs,o,this.Nj,this.Gs,this.uk,this.bw),this.co!=null&&(a=this.uk.slice(0),this.co.qG(this.co.da()-1,a,a.length-1)),e.cj.Lu(h,s)?(this.qq.Oa(),this.Wa.sy(h,this.sl,this.qq),this.Xn=!0):(this.qq.Oa(),this.Xn=this.xy(o[0],this.qq)),this.Xn){if(this.sd.li(),this.sd.Ez()){this.sd.li(),this.sd.ha();break}this.sd.DW();break}t==null&&(t=new e.Da).Yk(null,0),this.OD(t),i++}if(this.bw[0]=0,0=this.Nj[0]){var o=this.di+1.570796326794897;h=o+3.141592653589793-(this.di-this.Nj[0])}else h=(o=this.di+1.570796326794897)+3.141592653589793-(6.283185307179586-(this.Nj[0]-this.di));var a=!(this.di>=this.Nj[0]&&3.141592653589793>=this.di-this.Nj[0])&&!(this.dio;)c-=6.283185307179586;ci.x-this.sk[0]?this.sk[0]-=6.283185307179586:3.141592653589793o?u.xX():u.$n=o,h=t.getType(),e.aa.yd(h)?((h=new e.Ta(t.description)).oc(t,!0),t=h,h=1607):h==197&&(h=new e.l,t.A(h),h.R()<=u.qa||h.ca()<=u.qa?((h=new e.Ta(t.description)).ad(t,!1),t=h,h=1607):((h=new e.Da(t.description)).ad(t,!1),t=h,h=1736)),u.yX(),e.aa.Rn(h)||u.zX(),u.rb<=.5*u.$n)return h!=1736?new e.Da(t.description):u.Wv?t:e.cj.Qr(t,u.Qg,u.ze,u.QA,-1,a);if(0>u.Ka&&h!=1736)return new e.Da(t.description);if(u.Wv&&e.aa.Hc(h)?(i=e.cj.Qr(t,i,4,NaN,u.$n,a),t=e.cb.zh(i,u.Qg,u.Jc)):t=e.cb.zh(t,u.Qg,u.Jc),(t=e.Hh.lj(t,u.Jc)).B())return new e.Da(t.description);switch(!u.Wv&&e.aa.Hc(h)&&(t=e.cj.pI(u.ec,t)),t=n.KX(t,u.Jc),h){case 1736:i=u.UN(t);break;case 1607:i=u.VN(t);break;case 550:i=u.SN(t);break;case 33:i=u.TN(t);break;default:throw e.i.fa("corrupted_geometry")}return(u=e.cb.zh(i,u.Jc,u.Qg)).Jl(t.description),u},n.prototype.UN=function(t){var i=new e.Da;t=new f(this,t,i),t=e.Gh.local().V(t,this.Jc,this.Ub).next(),t=e.ip.nj(t,this.Jc,2);var h=new e.Dd;return h.scale(1/this.ec,1/this.ec),i.Oc(h),i=e.ip.nj(i,this.Jc,2),0<=this.Ka?e.Gh.local().V(i,t,this.Jc,this.Ub):e.kp.local().V(i,t,this.Jc,this.Ub)},n.prototype.VN=function(t){return t=new f(this,t,null),t=e.Gh.local().V(t,this.Jc,this.Ub).next(),e.ip.nj(t,this.Jc,2)},n.prototype.SN=function(t){return t=new v(this,t),t=e.Gh.local().V(t,this.Jc,this.Ub).next(),e.ip.nj(t,this.Jc,2)},n.prototype.TN=function(t){(t=t.D()).scale(this.ec);var i=new e.Da;return this.sy(t,!1,i),e.ip.nj(i,this.Jc,2)},n.prototype.xy=function(t,i,h,s,o,a){var u=t[0],c=t[t.length-1],l=u.y>c.y?u.y:c.y,p=e.F.q(this.Tb,this.kc,u.yt.Ke()&&(this.UV(t),!0)},n.prototype.OI=function(t,i,h){var s=h.I(),o=0a.x?(a=this.zq,s.gg(-this.Js,0)):(a=-this.zq,s.gg(this.Js,0)),i.add(t,!1),t.Oa(),h.add(i,!1),h.Oc(s),o=new e.l,h.A(o),o.W((this.Js-o.R())/2,0),o.G=-this.zq,o.H=this.zq;for(var c=0;c=u));)e.kb.yi(t,i,o.x,o.y,s,A,b,x),l?w.ma(b.u,x.u):(m.ma(b.u,x.u),n.gJ(o.x,m.x,j.x,p),w.ma(p[0]+m.x,m.y),j.L(w)),w.scale(h),y.wf(0,-1,w),a=A,A=M++*c}},n.dJ=function(t,i,h,s,o,a,u,c,l,p){var y=new e.h,d=new e.h,g=new e.ga(0),b=new e.ga(0);for(e.kb.yi(t,i,s.x,s.y,h,o,g,b),y.ma(g.u,b.u),e.kb.yi(t,i,s.x,s.y,h,a,g,b),d.ma(g.u,b.u),h=new e.ga(0),e.kb.Xy(t,i,u.x,u.y,y.x,y.y,h),l[0]=h.u,e.kb.Xy(t,i,u.x,u.y,d.x,d.y,h),p[0]=h.u;l[0]<=p[0];)l[0]+=6.283185307179586;for(;l[0]>p[0];)l[0]-=6.283185307179586;for(;l[0]>=c;)l[0]-=6.283185307179586,p[0]-=6.283185307179586;for(;l[0]a[y]?1:0}),i=t.Ia(),c=0;cthis.rb/t&&(t=this.rb/500),.01>t&&(t=.01),this.$n=t},n}();e.VK=r}(k||(k={})),function(e){var v=function(){function f(){}return f.Mf=function(r,n){var t=new e.h;t.L(n),r.push(t)},f.up=function(r,n){r.add(n.x),r.add(n.y)},f.hB=function(r){r.Bh(r.size-2)},f.oB=function(r,n){n.ma(r.get(r.size-2),r.get(r.size-1))},f.Qr=function(r,n,t,i,h,s){if(r==null)throw e.i.N();var o=r.getType();if(r.B()||e.aa.Rn(o))return r;var a=new f;a.Qg=n,a.Jc=e.cb.sc(n);var u=e.cb.vv(a.Jc);if(a.Ub=s,a.Tb=e.cb.ev(a.Jc),a.kc=u*(2-u),a.ec=a.Jc.Hd().ai,a.Aq=a.Jc.Kn(),a.Zs=a.Aq*a.ec,a.AA=i,a.zA=h,a.ze=t,o==197?(t=new e.Da(r.description)).ad(r,!1):e.aa.yd(o)?(t=new e.Ta(r.description)).oc(r,!0):t=r,a.ze!=4){if((n=a.Qg.Nb(a.Jc)==0?e.cb.zh(t,a.Qg,a.Jc):e.Hh.lj(t,a.Jc)).B())return n;n=f.pI(a.ec,n),n=a.Zy(n),n=e.ip.nj(n,a.Jc,a.ze),a=e.cb.zh(n,a.Jc,a.Qg)}else{if(e.Eg.Sb(n)==2?(r=e.cb.ml(),(n=e.Xj.local().V(t,r,n,s))==r&&(n=new e.Da,r.copyTo(n))):n=e.Hh.lj(t,a.Jc),n.B())return n;a=a.CX(n)}return a},f.pI=function(r,n){var t=new e.l;if(n.xc(t),3.141592653589793>t.R()*r)return n;var i=!1;t=n.Ga();for(var h=new e.h,s=new e.h;t.$a();)for(;t.Ha();){var o=t.ha();if(h.L(o.ac()),s.L(o.wc()),h.scale(r),s.scale(r),3.141592653589793s.x-h.x)for(;-6.283185307179586>s.x-h.x;)s.x+=6.283185307179586;f.Wi(s.x,NaN,b),p.L(s)}else c.L(s),f.AU(c),f.Wi(c.x,g,b),p.ma(b[0]+c.x,c.y);.5>Math.abs(p.x-s.x)&&p.L(s),u?(o.Tw(0,d),y.L(l),y.scale(1/r),d.Cb(y),(a=t.vm())?i.nf(d):i.lineTo(d),t.Qn()&&!n.dc(t.gb)&&(o.Tw(1,d),y.L(p),y.scale(1/r),d.Cb(y),i.lineTo(d))):((a=t.vm())&&i.Hz(null,0),o=i.da()-1,y.L(l),y.scale(1/r),i.wf(o,-1,y),t.Qn()&&!n.dc(t.gb)&&(y.L(p),y.scale(1/r),i.wf(o,-1,y)))}return i},f.tF=function(r,n,t,i,h,s,o,a,u,c,l,p){var y=new e.h,d=new e.h,g=0m&&(m+=6.283185307179586),0>(b=b.u)&&(b+=6.283185307179586),u!=null&&(u[0]=x),c!=null&&(c[0]=m),l!=null&&(l[0]=b),c=u=NaN,p!=null&&(u=((c=e.F.Ah(r,n))-(l=e.F.q(r,n,i.y)))/x,c=(c+l)/x),l=f.Mu(i,h),b=f.Ku(i,h),m=l||b;var w=f.FE(i,h,a),j=new e.ga(0),M=new e.ga(0),A=new e.h,z=new e.h,N=new e.h;f.Wi(i.x,NaN,d);var I=[d[0]];if(x<=s)f.Mf(y,i),f.Wi(h.x,NaN,d),p!=null&&p.add(0),m?(l&&f.kB(i,h,p,y),b&&f.iB(i,h,p,y)):w?f.jB(i,h,g,u,c,p,y):0N.x&&(d[0]+=6.283185307179586,N.ma(d[0]+A.x,A.y)):T.xo.x?o.x+=6.283185307179586:3.141592653589793E;E++)if(T=C[E]*c+(1-C[E])*u,e.kb.oj(r,n,i.x,i.y,T*h,s,x,m,t),A.ma(x.u,m.u),E==0&&(B=T,z.L(A)),f.WW(j,A,M,I),I.hc(I.fe(A,!0),N),e.kb.wd(r,n,A.x,A.y,N.x,N.y,w,null,null,2),w.u>l){D=!0;break}D?(M.L(z),c=B,f.up(o,M),a.add(c)):(f.hB(o),a.En(a.size-1,1,a.size-1),0=o&&W.u<=s&&3.141592653589793>Math.abs(g.x-b.x)||i.Ux(D,B)<=h));I++){var L=U[I]*B+(1-U[I])*D;if(i.hc(L,p),N?x.ma(p.x*t,p.y*t):(z[0][0]=p.x,z[0][1]=p.y,e.cb.vt(),x.x=z[0][0]*t,x.y=z[0][1]*t),I==0&&(tt=L,d.L(p),w.L(x),0s||3.141592653589793<=Math.abs(g.x-b.x)))){O=!0;break}if(E&&0s||3.141592653589793<=Math.abs(g.x-x.x)){O=!0;break}}else if(0o){O=!0;break}if(E){if(e.kb.wd(r,n,A.x,A.y,m.x,m.y,V,null,null,2),V.u>o){O=!0;break}if(e.kb.wd(r,n,m.x,m.y,x.x,x.y,nt,null,null,2),nt.u>o){O=!0;break}}}}O?(l.L(d),b.L(w),B=tt,f.up(C,l),f.up(G,b),H.add(B)):(f.hB(C),f.hB(G),H.En(H.size-1,1,H.size-1),f.Mf(u,l),T+=W.u,a!=null&&a.add(T),0Math.abs(n.x-r.x)?(i.Dc(r),3.141592653589793<=t.x-r.x?i.Ql(t.x-6.283185307179586,t.y):3.141592653589793<=r.x-t.x?i.Ql(t.x+6.283185307179586,t.y):i.Ql(t.x,t.y)):(i.Dc(t),3.141592653589793<=r.x-t.x?i.Ql(r.x-6.283185307179586,r.y):3.141592653589793<=t.x-r.x?i.Ql(r.x+6.283185307179586,r.y):i.Ql(r.x,r.y))},f.YJ=function(r,n){for(var t=0;tr.x)for(;-3.141592653589793>r.x;)r.x+=6.283185307179586;if(3.141592653589793f.v+i&&sf?-f:f},v.Mb=function(f,r){return 0<=r?v.P(f):-v.P(f)},v.Y=function(f,r){return f==r||v.P(f-r)<=v.JC*(1+(v.P(f)+v.P(r))/2)},v.Cd=function(f){return f==0||v.P(f)<=v.JC},v.Ah=function(f,r){var n=(r=(1-(r=Math.sqrt(1-r)))/(1+r))*r;return f/(1+r)*(1+n*(.25+n*(.015625+1/256*n)))*v.EL},v.EL=1.5707963267948966,v.JC=3552713678800501e-30,v}()}(k||(k={})),function(e){var v=function(r){this.Wf=r,this.Kk=this.Wf.getCode(),0>this.Kk&&(this.Kk=0)};e.DY=v;var f=function(){function r(n){n===void 0&&(n=null),this.Cj=null,this.Un=!1,n!==null&&(this.Cj=new v(n))}return r.prototype.Ec=function(){return this.Cj!=null?this.Cj.Kk:0},r.prototype.Of=function(){var n=new r;return this.copyTo(n),n},r.prototype.copyTo=function(n){n.Cj=this.Cj,n.Un=this.Un},r.prototype.Qz=function(){this.Un=!this.Un},r.prototype.qm=function(){return this.Cj!=null?this.Cj.Wf:null},r.prototype.LJ=function(n){if(0>=n)throw e.i.N();if(n!=this.Ec()){if((n=e.pf.geogtran(n))==null)throw e.i.N("Geogtran not found.");this.Cj=new v(n)}},r.prototype.Bz=function(){return this.Cj==null?null:this.Cj.Wf.toString()},r.prototype.tX=function(n){if(n==null)throw e.i.N();var t=null;try{t=e.pf.fromString(e.Sc.PE_TYPE_GEOGTRAN,n)}catch{throw e.i.N()}this.Cj=new v(t)},r.prototype.Nb=function(n){return n==this||!(!(n instanceof r)||(0>=this.Ec()||this.Ec()!=n.Ec())&&!this.qm().isEqual(n.qm()))&&this.Un==n.Un},r.prototype.toString=function(){var n="GeographicTransformation: "+this.Bz();return 200r.I())},f.BE=function(r){return!(r.B()||r.getType()!=1607&&r.getType()!=1736||20>r.I())},f}();e.Uk=v}(k||(k={})),function(e){e.$b=function(){function v(){}return v.TT=function(f){var r=new e.Da;return r.sx(f.es(),f.gs()),r.yj(f.es(),f.fs()),r.yj(f.ds(),f.fs()),r.yj(f.ds(),f.gs()),r},v.zh=function(f,r){return f===null?null:e.Hx.local().V(f,r,null)},v.jY=function(f,r){var n=e.Gh.local();return f=new e.Zc(f),n.V(f,r,null).next()},v.im=function(f,r,n){return e.kp.local().V(f,r,n,null)},v.ep=function(f,r,n){return e.Kx.local().V(f,r,n,null)},v.VX=function(f,r,n){var t=e.Kx.local();for(f=new e.Zc(f),r=new e.Zc(r),n=t.V(f,r,n,null),t=[];(r=n.next())!=null;)t.push(r);return t},v.Nb=function(f,r,n){return e.dj.local().V(3,f,r,n,null)},v.TP=function(f,r,n){return e.dj.local().V(4,f,r,n,null)},v.RS=function(f,r,n){var t=e.Xj.local();for(f=new e.Zc(f),r=new e.Zc(r),n=t.V(f,r,n,null),t=[];(r=n.next())!=null;)t.push(r);return t},v.QP=function(f,r,n){var t=e.kp.local();for(f=new e.Zc(f),r=new e.Zc(r),n=t.V(f,r,n,null),t=[];(r=n.next())!=null;)t.push(r);return t},v.Ea=function(f,r,n){return e.Xj.local().V(f,r,n,null)},v.QS=function(f,r,n){if((f=e.Xj.local().V(f,r,n,null,1))===null)return[];if(f.getType()===550){for(r=[],n=0;nf.Db())return 0;var t=null;if(r!=null){if(t=r.Hd(),n!=null&&t.Ec()!=n.Ec()&&t.od!=n.od)throw e.i.Xk()}else if(n!=null)throw e.i.N();f.getType()==1736||f.getType()==197?r=f.mg():e.aa.yd(f.getType())?(r=new e.Ta(f.description)).oc(f,!0):r=f,f=0,r=r.Ga();for(var i=new e.h,h=new e.h;r.$a();)for(;r.Ha();){var s=r.ha();s.Yp(i),s.Tr(h),f+=e.h.tb(i,h)}return t!==null&&n!==null&&(f=e.Tc.Nh(f,t,n)),f},v.fP=function(f){return f.points!==void 0?v.mS(f,f.hasZ!==void 0&&f.hasZ,f.hasM!==void 0&&f.hasM):f.rings!==void 0?v.lG(f.rings,f.hasZ!==void 0&&f.hasZ,f.hasM!==void 0&&f.hasM,"P"):f.paths!==void 0?v.lG(f.paths,f.hasZ!==void 0&&f.hasZ,f.hasM!==void 0&&f.hasM,"L"):f.x!==void 0?v.nS(f):f.xmin!==void 0?v.lS(f):null},v.nS=function(f){if(f.x==null||f.x=="NaN")return new e.Sa;var r=new e.Sa(f.x,f.y);return f.z!==void 0&&f.z!==null&&r.wX(f.z),f.m!==void 0&&f.m!==null&&r.hX(f.m),r},v.lS=function(f){if(f.xmin==null||f.xmin=="NaN")return new e.Fh;var r=new e.Fh(f.xmin,f.ymin,f.xmax,f.ymax);return f.zmin!==void 0&&f.zmin!==null&&r.setInterval(1,0,f.zmin,f.zmax),f.mmin!==void 0&&f.mmin!==null&&r.setInterval(2,0,f.mmin,f.mmax),r},v.mS=function(f,r,n){var t=0,i=new e.de,h=3*f.points.length;h%2!=0&&h++,2>h&&(h=2);var s=e.O.truncate(3*f.points.length/2);4>s?s=4:16>s&&(s=16),h=e.Yc.Dn(h,0);var o=e.Yc.Dn(s);s=e.Yc.Dn(s);for(var a=0;a=h?(p[y]=!1,c+=1,o.add(u),a.add(i),u+=d):p[y]=!0}for((t=3*u)%2!=0&&t++,2>t&&(t=2),4>(y=e.O.truncate(3*u/2))?y=4:16>y&&(y=16),t=e.Yc.Dn(t,0),i=e.Yc.Dn(y),h=e.Yc.Dn(y),y=d=0;yo)throw e.i.N();this.Qi.oa=s-a,this.Qi.va=o+a,this.hi.resize(0),this.he=0,this.sg[0]=0},h.prototype.Uo=function(s,o){this.Qi.oa=s-o,this.Qi.va=s+o,this.hi.resize(0),this.he=0,this.sg[0]=0},h.prototype.next=function(){if(!this.Ya.lq)throw e.i.Hb();if(0>this.he)return-1;for(var s=!0;s;)switch(this.sg[this.he]){case 1:s=this.FU();break;case 2:s=this.GU();break;case 3:s=this.HU();break;case 4:s=this.IU();break;case 5:s=this.GW();break;case 6:s=this.kT();break;case 7:s=this.tN();break;case 0:s=this.Gz();break;default:throw e.i.Qa()}return this.Og!=-1?this.Mp()>>1:-1},h.construct=function(s){var o=new h;return o.Ya=s,o.hi.Jb(20),o.he=-1,o},h.prototype.Gz=function(){return this.Og=this.vH=this.Mi=this.Lc=-1,this.Ya.me!=null&&0=this.Qi.oa?(this.ei=this.QR(),!1):(this.he--,!0)},h.prototype.tN=function(){return this.Og=this.ei,this.Og!=-1&&i.gq(this.Mp())?(this.ei=this.SF(),!1):(this.he--,!0)},h.prototype.SF=function(){return this.Ya.Sf?this.Ya.$f.lb(this.Og):this.Ya.Ti.lb(this.Og)},h.prototype.QR=function(){return this.Ya.Sf?this.Ya.$f.we(this.Og):this.Ya.Ti.we(this.Og)},h.prototype.Mp=function(){return this.Ya.Sf?this.Ya.$f.ja(this.Og):this.Ya.Ti.getData(this.Og)},h}();e.EY=t;var i=function(){function h(s){this.Am=this.$h=this.$f=this.Ti=this.Km=this.Ej=this.me=this.Fj=null,this.Sf=s,this.lq=this.Sv=!1}return h.prototype.kr=function(){this.Nk(!0)},h.prototype.Br=function(s,o){if(!this.Sv)throw e.i.Hb();this.Fj.push(new e.Nc(s,o))},h.prototype.Fp=function(){if(!this.Sv)throw e.i.fa("invalid call");this.Sv=!1,this.lq=!0,this.Sf||(this.vS(),this.Zv=this.Fj.length)},h.prototype.vj=function(s){if(!this.Sf||!this.lq)throw e.i.N("invalid call");if(this.kf==-1){var o=this.Fj.length;if(this.iA){var a=new e.ia(0);a.Jb(2*o),this.bJ(a),this.$h.Jb(2*o),this.$h.resize(0),this.aJ(a),this.Km.resize(o,-1),this.Km.Wj(-1,0,o),this.iA=!1}else this.Km.Wj(-1,0,o);this.kf=this.Tu()}o=this.pG(s<<1,this.kf),a=this.$f.addElement(1+(s<<1),this.xz(o)),this.VJ(o,a),this.Km.set(s,o),this.Zv++},h.prototype.remove=function(s){if(!this.Sf||!this.lq)throw e.i.fa("invalid call");var o=this.Km.get(s);if(o==-1)throw e.i.N("the interval does not exist in the interval tree");this.Km.set(s,-1),this.Zv--;var a=this.xz(o),u=this.$f.ZR(a);this.$f.vd(this.wR(o),a),this.$f.vd(this.TR(o),a),(s=this.$f.size(a))==0&&(this.$f.MP(a),this.ZJ(u,-1)),this.Ej.jd(o),a=this.UF(u);var c=this.qj(u),l=this.lk(u);for(o=0;!(0>1);c!=-1?this.VJ(c,this.Ti.addElement(this.xz(c),u)):(c=this.pG(u,this.kf),a.set(u>>1,c))}},h.prototype.pG=function(s,o){var a=o,u=o,c=-1,l=0,p=this.$h.size-1,y=0,d=s>>1,g=NaN,b=NaN,x=!0,m=this.DR(d);for(d=this.AR(d);x;){lw&&(ww)o!=-1&&(o==a?(u=a,g=w,b=(o=this.lk(a))!=-1?this.Np(o):NaN):b>1];return h.gq(s)?o.oa:o.va},h}();e.sr=i}(k||(k={})),function(e){var v=function(){function f(r){if(r==null)throw e.i.fa("Invalid arguement");this.hf=r;var n=r.nR();n.hS()?r.ef.IG()?this.lo=e.si.PannableFold:this.lo=e.si.Clip:this.lo=e.si.DontClip,n.iS()?r.Yf.IG()?this.Qm=e.si.PannableFold:this.Qm=e.si.Clip:this.Qm=e.si.DontClip,this.Bm=n.Jr,this.mH=n.Vu,r=this.hf.sH,this.aH=r.hs(2147483648),this.Uv=r.hs(1073741824)}return f.zh=function(r,n,t){return n.ww.zh(r,t)},f.Rt=function(r,n,t,i){return r.ww.Rt(n,t,i)},f.Qt=function(r,n,t,i){if(t=0>t?n.length:t,(r=r.ww.Rt(n,t,i))==t)return r;for(var h=n=0;hh.H){var d=e.l.construct(a.v-1,h.G,a.C+1,h.H);if((y=e.ri.Nu(y,d,t,NaN,0,n)).B())return y}a.R()>2*h.R()&&(y=e.zb.Hp(y,-2*h.R(),2*h.R(),t,!0,0,!0,n))}a=this.mH,(h=!isNaN(a))&&(y=e.Xl.local().V(y,a,n)),d=c?i.kk():null;var g=NaN;u&&(g=t.zi());var b=i.Wr()!=null;if(this.aH)u&&(e.zb.ur(t,g,y,o),h&&(u=t.hh(),a*=(g=t.sc().hh())/u)),e.zb.tr(this.hf,y,p,o),h&&(u=t.sc().hh(),a*=(g=i.sc().hh())/u),t=y;else{var x=new e.Ta(y.description);x.DD(y),u&&(e.zb.ur(t,g,x,o),h&&(u=t.hh(),a*=(g=t.sc().hh())/u)),e.zb.tr(this.hf,x,p,o),h&&(u=t.sc().pm(),a*=(g=i.sc().pm())/u),p=NaN,c?(d=i.kk(),p=i.zi()):isNaN(this.Bm)||(p=this.Bm),u=f.tv(t)|f.tv(i),g=10*l.Xd(0),this.Uv&&(u=3,g=0),t=e.zb.UQ(y,t,x,l,p,n,u,g)}return b&&(t=e.zb.XD(t,i,n)),c&&(s||(c=l.Oe().R(),t.Tg(0,0).R()>=c-l.Xd(0)&&(l=d.getNorthPoleLocation(),c=d.getSouthPoleLocation(),y=d.getNorthPoleGeometry(),d=d.getSouthPoleGeometry(),p=0,y==e.Cg.PE_POLE_POINT&&l!=e.Cg.PE_POLE_OUTSIDE_BOUNDARY&&(p=1),d==e.Cg.PE_POLE_POINT&&c!=e.Cg.PE_POLE_OUTSIDE_BOUNDARY&&(p|=2),p!==0&&(s=!0))),t=e.zb.Mz(t,i,this.Qm,n),h&&(t=e.Xl.local().V(t,a,n)),e.zb.Lx(i,t,o)),t.B()||(s&&(t=e.Yl.local().V(t,i,!1,n)),r!=null&&(t=r.Zk(t,!1),this.wp(r,e.bm.reverse,t),t=r.$k(t,!1))),t},f.tv=function(r){if(r.Sb()!=2)return 0;var n=0,t=r.kk();r=t.getNorthPoleLocation();var i=t.getSouthPoleLocation(),h=t.getNorthPoleGeometry();return t=t.getSouthPoleGeometry(),h==e.Cg.PE_POLE_POINT&&r!=e.Cg.PE_POLE_OUTSIDE_BOUNDARY&&(n=1),t==e.Cg.PE_POLE_POINT&&i!=e.Cg.PE_POLE_OUTSIDE_BOUNDARY&&(n|=2),n},f.prototype.hW=function(r,n){var t=this.hf.ef,i=this.hf.Yf,h=t.Sb(),s=i.Sb(),o=e.O.Fu(Math.min(r.I(),64)),a=e.Ta.jg(r);h==3&&(h=(t=(r=t.Ji).fk()).Sb(),a=r.$k(a,!0),this.wp(r,e.bm.forward,a),a=r.Zk(a,!0)),r=null,s==3&&(s=(i=(r=i.Ji).fk()).Sb());var u=h==2;h=(s=s==2)?i.sc():i;var c=!s&&!this.Uv;if(u){if((a=e.zb.UI(a,t,this.lo,n)).B())return a}else{var l=new e.l;a.xc(l);var p=t.Oe();if((l.Gp.H)&&(l=e.l.construct(l.v-1,p.G,l.C+1,p.H),(a=e.ri.Nu(a,l,t,NaN,0,n)).B()))return a}var y=NaN;u&&(y=t.zi()),l=i.Wr()!=null,p=this.mH;var d=!isNaN(p);if(d&&(a=e.Xl.local().V(a,p,n)),this.aH)u&&e.zb.ur(t,y,a,o),d&&(u=t.hh(),p*=(y=t.sc().hh())/u),e.zb.tr(this.hf,a,c,o),d&&(u=t.sc().hh(),p*=(y=i.sc().hh())/u),t=a;else{var g=new e.Ta(a.description);g.DD(a),u&&(e.zb.ur(t,y,g,o),d&&(u=t.hh(),p*=(y=t.sc().hh())/u)),e.zb.tr(this.hf,g,c,o),d&&(u=t.sc().hh(),p*=(y=i.sc().hh())/u),c=NaN,s?c=i.zi():isNaN(this.Bm)||(c=this.Bm),u=f.tv(t)|f.tv(i),y=10*h.Xd(0),this.Uv&&(u=3,y=0),t=e.zb.VQ(a,t,g,h,c,n,u,y)}return l&&(t=e.zb.XD(t,i,n)),s&&(t=e.zb.Mz(t,i,this.Qm,n),d&&(t=e.Xl.local().V(t,p,n)),e.zb.Lx(i,t,o)),t.B()||r!=null&&(t=r.Zk(t,!1),this.wp(r,e.bm.reverse,t),t=r.$k(t,!1)),t},f.prototype.eW=function(r,n){var t=(r.ca()+r.R())/400;return t!=0?(t=e.Xl.local().V(r,t,n),t=this.VI(t,n),n=r.Ia(),t.bn(n)):(n=new e.Sa(r.Ip()),t=this.XI(n),n=r.Ia(),t.B()?n.Oa():(r.copyTo(n),r=t.D(),n.K(r.x,r.y,r.x,r.y))),n},f.prototype.fW=function(r,n){r=e.aa.jg(r);var t=this.hf.ef,i=this.hf.Yf,h=t.Sb(),s=i.Sb(),o=e.O.Fu(Math.min(r.I(),64));if(h==3){var a=t.Ji;h=(t=a.fk()).Sb(),r=a.Zk(r,!0),this.wp(a,e.bm.forward,r),r=a.$k(r,!0)}if(h==2){if(this.lo==e.si.Clip?r=e.Xj.local().V(r,t.ml(),t,n):t.Wc()&&(h=new e.l,r.xc(h),t.Oe().contains(h)||(this.lo==e.si.PannableFold&&(r=e.zb.lj(r,t)),e.zb.Jt(r,t.Oe(),t.Xd(0),!0),r=e.zb.Fn(r,t,0,!0,0,n))),r.B())return r;e.zb.ur(t,0,r,o)}else e.zb.Jt(r,t.Oe(),t.Xd(0),!0);return e.zb.tr(this.hf,r,!1,o),t=0,h=!1,a=null,s==3&&(h=!0,s=(i=(a=i.Ji).fk()).Sb()),(s=s==2)?t=i.zi():isNaN(this.Bm)||(t=this.Bm),s&&this.Qm!=e.si.Clip||(r=e.zb.Fn(r,i.sc(),t,!1,0,n)),s&&(r=e.zb.Mz(r,i,this.Qm,n),e.zb.Lx(i,r,o),r.B())||h&&(r=a.Zk(r,!0),this.wp(a,e.bm.reverse,r),r=a.$k(r,!0)),r},f.prototype.wp=function(r,n,t){var i=t.I();if(i!=0){for(var h=t.ub(0),s=e.O.lg(200,0),o=[],a=0;ah.v+s&&an?this.wv(t,i):this.gv(t,i);case 1:var h=this.wv(t,i);return t=this.gv(t,i),e.lc.hq(h,t,n);case 2:throw e.i.fa("not implemented")}throw e.i.Qa()},r.prototype.fe=function(n,t){var i=this.pa-this.sa,h=this.la-this.na,s=i*i+h*h;return s==0?.5:(n=((n.x-this.sa)*i+(n.y-this.na)*h)/s,t||(0>n?n=0:1(t=(t-this.na)/n)||1(t=(t-this.sa)/n)||1(t=8881784197001252e-31*(Math.abs(i.x*t.y)+Math.abs(i.y*t.x)))?-1:n<-t?1:0},r.prototype.rp=function(n,t,i,h){var s=this.sa,o=this.na,a=n-s,u=t-o;if((a=Math.sqrt(a*a+u*u))<=Math.max(i,6661338147750939e-31*a))return h&&a==0?NaN:0;if(a=n-this.pa,u=t-this.la,(a=Math.sqrt(a*a+u*u))<=Math.max(i,6661338147750939e-31*a))return h&&a==0?NaN:1;if(a=this.pa-this.sa,u=this.la-this.na,0<(h=Math.sqrt(a*a+u*u))){var c=1/h,l=n-s,p=t-o,y=l*(a*=c)+p*(u*=c),d=17763568394002505e-31*(Math.abs(l*a)+Math.abs(p*u)),g=a;if(a=-u,u=g,y<-(d=Math.max(i,d))||y>h+d)return NaN;if(Math.abs(l*a+p*u)<=Math.max(i,17763568394002505e-31*(Math.abs(l*a)+Math.abs(p*u)))&&(.5>=(a=e.O.Rk(y*c,0,1))?(u=this.sa+(this.pa-this.sa)*a,h=this.na+(this.la-this.na)*a):(u=this.pa-(this.pa-this.sa)*(1-a),h=this.la-(this.la-this.na)*(1-a)),e.h.Oy(u,h,n,t)<=i)){if(.5>a){if(e.h.Oy(u,h,s,o)<=i)return 0}else if(e.h.Oy(u,h,this.pa,this.la)<=i)return 1;return a}}return NaN},r.prototype.Nb=function(n){return n!=null&&(n==this||n.constructor===this.constructor&&this.FM(n))},r.prototype.rD=function(n,t,i){var h=i?this.sa:this.pa;i=i?this.na:this.la;var s=new e.h;return s.x=n.pa-h,s.y=n.la-i,!(t.Qh(s)>6661338147750939e-31*t.fD(s))||(s.x=n.sa-h,s.y=n.na-i,t.Qh(s)<=6661338147750939e-31*t.fD(s))},r.prototype.qD=function(n){var t=new e.h;return t.x=this.pa-this.sa,t.y=this.la-this.na,!!this.rD(n,t,!1)&&(t.Sq(),!!this.rD(n,t,!0))},r.NM=function(n,t){var i=n.uu(t.sa,t.na),h=n.uu(t.pa,t.la);return!(0>i&&0>h||0i&&0>h||0(h=t.Qb())?n.qD(t):t.qD(n)))},r.LM=function(n,t,i){var h=e.h.construct(NaN,NaN),s=n.pa-n.sa,o=n.la-n.na,a=t.pa-t.sa,u=t.la-t.na,c=a*o-s*u;if(c==0)return h;var l=8881784197001252e-31*(Math.abs(a*o)+Math.abs(s*u)),p=t.sa-n.sa,y=t.na-n.na,d=a*y-p*u,g=d/c,b=Math.abs(c);return g<-(a=(8881784197001252e-31*(Math.abs(a*y)+Math.abs(p*u))*b+l*Math.abs(d))/(c*c)+2220446049250313e-31*Math.abs(g))||g>1+a||(a=(u=s*y-p*o)/c)<-(s=(8881784197001252e-31*(Math.abs(s*y)+Math.abs(p*o))*b+l*Math.abs(u))/(c*c)+2220446049250313e-31*Math.abs(a))||a>1+s||(g=e.O.Rk(g,0,1),s=e.O.Rk(a,0,1),o=n.hc(g),c=t.hc(s),(l=new e.h).uc(o,c),l.length()>i&&(l.add(o,c),l.scale(.5),g=n.fe(l,!1),s=t.fe(l,!1),n=n.hc(g),t=t.hc(s),n.sub(t),n.length()>i)||h.ma(g,s)),h},r.OM=function(n,t,i,h){var s=0;if((n.sa==t.sa&&n.na==t.na||n.sa==t.pa&&n.na==t.la)&&(s++,!h))return 1;if(n.pa==t.sa&&n.la==t.na||n.pa==t.pa&&n.la==t.la){if(++s==2)return 2;if(!h)return 1}return t.vi(n.sa,n.na,i)||t.vi(n.pa,n.la,i)||n.vi(t.sa,t.na,i)||n.vi(t.pa,t.la,i)?1:h&&s!=0||r.NM(n,t)==0?0:1},r.Zx=function(n,t,i,h,s,o){var a=0,u=n.rp(t.sa,t.na,o,!1),c=n.rp(t.pa,t.la,o,!1),l=t.rp(n.sa,n.na,o,!1),p=t.rp(n.pa,n.la,o,!1);return isNaN(u)||(h!=null&&(h[a]=u),s!=null&&(s[a]=0),i!=null&&(i[a]=e.h.construct(t.sa,t.na)),a++),isNaN(c)||(h!=null&&(h[a]=c),s!=null&&(s[a]=1),i!=null&&(i[a]=e.h.construct(t.pa,t.la)),a++),a==2||isNaN(l)||u==0&&l==0||c==0&&l==1||(h!=null&&(h[a]=0),s!=null&&(s[a]=l),i!=null&&(i[a]=e.h.construct(n.sa,n.na)),a++),a==2||isNaN(p)||u==1&&p==0||c==1&&p==1||(h!=null&&(h[a]=1),s!=null&&(s[a]=p),i!=null&&(i[a]=e.h.construct(t.pa,t.la)),a++),0h[1]&&(n=h[0],h[0]=h[1],h[1]=n,s!=null&&(h=s[0],s[0]=s[1],s[1]=h),i!=null&&(s=e.h.construct(i[0].x,i[0].y),i[0]=i[1],i[1]=s)),a):(a=r.LM(n,t,o),isNaN(a.x)?0:(i!=null&&(i[0]=n.hc(a.x)),h!=null&&(h[0]=a.x),s!=null&&(s[0]=a.y),1))},r.prototype.eG=function(){return 0},r.prototype.op=function(){},r.prototype.toString=function(){return"Line: ["+this.sa.toString()+", "+this.na.toString()+", "+this.pa.toString()+", "+this.la.toString()+"]"},r}(e.SC);e.yb=v}(k||(k={})),function(e){var v=function(){function f(){this.Jm=[],this.ya=-1}return f.prototype.La=function(){return this.ya},f.prototype.next=function(){if(this.Jm!=null&&this.Jm.length!=0){this.ya++;var r=this.Jm[0];return this.Jm=1>=this.Jm.length?[]:this.Jm.slice(1),r}return this.Jm=null},f.prototype.ZX=function(r){this.Jm.push(r)},f.prototype.qe=function(){},f}();e.gL=v}(k||(k={})),function(e){var v;(v=e.SL||(e.SL={}))[v.enumFillRuleOddEven=0]="enumFillRuleOddEven",v[v.enumFillRuleWinding=1]="enumFillRuleWinding";var f=function(r){function n(t,i){var h=r.call(this)||this;if(h.xf=!1,h.Eq=null,h.sq=0,h.rq=0,h.Aj=null,h.Mg=!1,h.nb=null,h.mb=null,h.Ve=null,h.Lj=null,h.Sd=null,h.tq=0,h.gb=0,h.xq=0,i===void 0)h.xf=t,h.Mg=!1,h.tq=0,h.sq=0,h.rq=0,h.wa=0,h.description=e.ee.og();else{if(i==null)throw e.i.N();h.xf=t,h.Mg=!1,h.tq=0,h.sq=0,h.rq=0,h.wa=0,h.description=i}return h.Aj=null,h.gb=0,h}return J(n,r),n.prototype.tm=function(){return 0i)throw e.i.Qa();if(this.dc(t)){if(this.mb==null)throw e.i.Qa();var h=this.wa,s=this.Ba(t),o=this.Vc(t);this.dm(this.wa+1),this.mc();for(var a=0,u=this.description.Aa;at;i--)h=this.nb.read(i),this.nb.write(i,h+1);this.mb.KE(t,1)}},n.prototype.Ap=function(){if(this.wx(),t===void 0){this.Mg=!1;var t=this.da()-1}var i=this.mb.read(t);this.mb.write(t,1|i),this.Ve!=null&&(t=this.Vc(t)-1,this.Ve.write(t,1),this.Lj.write(t,-1))},n.prototype.dc=function(t){return(1&this.mb.read(t))!=0},n.prototype.Nn=function(t){if(this.dc(t))return!0;var i=this.Ba(t);return!(i>(t=this.Vc(t)-1))&&(i=this.Na(i),t=this.Na(t),i.qb(t))},n.prototype.yv=function(t){return(2&this.mb.read(t))!=0},n.prototype.oc=function(t,i){if(this.Jl(t.description),t.getType()!=322)throw e.i.Qa();var h=new e.Sa;(i||this.B())&&(t.To(h),this.nf(h)),t.Po(h),this.lineTo(h)},n.prototype.tp=function(t){var i=this.wa==0;this.sx(t.v,t.G),this.yj(t.v,t.H),this.yj(t.C,t.H),this.yj(t.C,t.G),this.Ap(),this.Mg=!1,i&&this.Lf(256,!1)},n.prototype.ad=function(t,i){if(!t.B()){for(var h=this.wa==0,s=new e.Sa(this.description),o=0;4>o;o++)t.Hf(i?4-o-1:o,s),o==0?this.nf(s):this.lineTo(s);this.Ap(),this.Mg=!1,h&&!i&&this.Lf(256,!1)}},n.prototype.add=function(t,i){for(var h=0;hi&&(i=t.da()-1),i>=t.da()||0>h||0>s||s>t.rv(i))throw e.i.fa("index out of bounds");if(s!=0){var a=t.dc(i)&&h+s==t.rv(i);if(!a||s!=1){if(this.Mg=!1,this.Jl(t.description),h=t.Ba(i)+h+1,o&&(s++,h--),a&&s--,a=this.wa,this.dm(this.wa+s),this.mc(),o){if(s==0)return;this.nb.add(this.wa),o=t.mb.read(i),o&=-5,this.xf&&(o|=1),this.mb.write(this.mb.size-1,o),this.mb.add(0)}else this.nb.write(this.mb.size-1,this.wa);o=0;for(var u=this.description.Aa;op||t.za[p]==null?this.za[o].Ln(l*a,e.ra.se(c),s*l,l*a):this.za[o].Mn(l*a,t.za[p],l*h,s*l,!0,l,l*a)}if(this.tm()||t.yv(i))throw e.i.Qa();this.Pc(1993)}}},n.prototype.oJ=function(){for(var t=0,i=this.da();t=this.da())throw e.i.N();var i=this.Ba(t),h=this.Ja(t);t=this.dc(t)?1:0;for(var s=0,o=this.description.Aa;st&&(t=i-1),t>=i)throw e.i.N();for(var h=this.Ba(t),s=this.Ja(t),o=0,a=this.description.Aa;o=i.da())throw e.i.N();var o=this.da();if(t>o)throw e.i.N();0>t&&(t=o),0>h&&(h=i.da()-1),this.Mg=!1,this.Jl(i.description),i.mc();var a=i.Ba(h),u=i.Ja(h),c=this.wa,l=i.dc(h)&&!s?1:0;this.dm(this.wa+u),this.mc();for(var p=t=t+1;s--)a=this.nb.read(s-1),this.nb.write(s,a+u);for(i.yv(h),this.mb.add(0),s=o-1;s>=t+1;s--)o=this.mb.read(s),o&=-5,this.mb.write(s+1,o);o=i.JR().read(h),o&=-5,this.xf&&(o|=1),this.mb.write(t,o)},n.prototype.Hz=function(t,i){var h=-1,s=this.da();if(h>s)throw e.i.N();0>h&&(h=s),this.Mg=!1;var o=this.wa;this.dm(this.wa+i),this.mc();var a=h=h+1;o--)a=this.nb.read(o-1),this.nb.write(o,a+i);for(this.mb.add(0),o=s-1;o>=h+1;o--)i=this.mb.read(o),i&=-5,this.mb.write(o+1,i);this.xf&&this.mb.write(h,1)},n.prototype.qG=function(t,i,h){var s=-1;if(0>t&&(t=this.da()),t>this.da()||s>this.Ja(t)||h>i.length)throw e.i.fa("index out of bounds");if(h!=0){t==this.da()&&(this.nb.add(this.wa),this.xf?this.mb.add(1):this.mb.add(0)),0>s&&(s=this.Ja(t)),this.mc();var o=this.wa;this.dm(this.wa+h),this.mc();for(var a=0,u=this.description.Aa;at&&(t=this.da()),t>=s||i>this.Ja(t))throw e.i.fa("index out of bounds");t==this.da()&&(this.nb.add(this.wa),this.xf?this.mb.add(1):this.mb.add(0)),0>i&&(i=this.Ja(t));var o=this.wa;this.dm(this.wa+1),this.mc();var a=this.Ba(t);this.za[0].vj(2*(a+i),h,2*o),h=1;for(var u=this.description.Aa;ht&&(t=h-1),t>=h||i>=this.Ja(t))throw e.i.fa("index out of bounds");this.mc();var s=this.Ba(t);0>i&&(i=this.Ja(t)-1),i=s+i,s=0;for(var o=this.description.Aa;s=t+1;h--)i=this.nb.read(h),this.nb.write(h,i-1);this.wa--,this.Pg--,this.Pc(1993)},n.prototype.uE=function(t,i,h){var s=this.Ba(t)+i;if((h=this.Ba(h)+void 0)s||h>this.I()-1)throw e.i.N();i=0,(t=this.Ga()).Vb(s);do{for(;t.Ha()&&(s=t.ha(),t.wb()!=h);)i+=s=s.Qb();if(t.wb()==h)break}while(t.$a());return i},n.prototype.fO=function(t,i,h){if(i=this.Ba(t)+i,h=this.Ba(t)+h,0>i||h>this.I()-1)throw e.i.N();var s=this.Ga();if(i>h){if(!this.dc(t))throw e.i.N("cannot iterate across an open path");s.JB()}var o=t=0;s.Vb(i);do o+=t,t=s.ha().Qb();while(s.wb()!=h);return o},n.prototype.mg=function(){return e.pi.gm(this,null)},n.prototype.KS=function(t,i,h){for(var s=t;si){var a=this.tm(),u=0;i=this.wa}else a=this.yv(i),u=this.Ba(i),i=this.Vc(i);for(;u=this.Ba(i))return i;i--}else i++;if(0<=i&&i=this.Ba(i)&&th){for(i=0;ii;){var s=i+(h-i>>1);if(t=(i=this.Vc(s))))return this.gb=s;i=s+1}}return this.gb=i},n.prototype.yz=function(){var t=this.I();if(!this.xf){t-=this.da();for(var i=0,h=this.da();ih.RR()))return!0;this.Bb.yD(null)}return h=e.Nx.create(this,t,i),this.Bb.yD(h),!0},n.prototype.cc=function(){var t=r.prototype.cc.call(this);if(!this.Ac()){var i=this.da();this.nb!=null&&this.nb.An(t,0,i+1),this.mb!=null&&this.mb.An(t,0,i)}return t},n.prototype.ZF=function(t){return this.Ve!=null?this.Ve.read(t):1},n.prototype.bc=function(t,i,h){var s=this.sz(t);if(t==this.Vc(s)-1&&!this.dc(s))throw e.i.fa("index out of bounds");this.mc();var o=this.Ve,a=1;if(o!=null&&(a=7&o.read(t)),a!==1)throw e.i.Qa();if(i.Or(),i=i.get(),h?i.Nf(e.ee.og()):i.Nf(this.description),s=t==this.Vc(s)-1&&this.dc(s)?this.Ba(s):t+1,o=new e.h,this.D(t,o),i.Dc(o),this.D(s,o),i.Qc(o),!h)for(h=1,o=this.description.Aa;h=this.da())throw e.i.N();if(this.B())i.Oa();else{if(this.yv(t))throw e.i.fa("not implemented");var h=this.ub(0),s=new e.h,o=new e.l;o.Oa();var a=this.Ba(t);for(t=this.Vc(t);athis.I())&&(t=e.ta.nE(this),this.Bb.WM(t),!0)},n.prototype.hM=function(){if(this.Bb==null&&(this.Bb=new e.Uk),this.Bb.zo==null){this.Bb.xD(null);var t=e.ta.YN(this);this.Bb.xD(t)}},n.prototype.Yo=function(t){this.xq=t},n.prototype.In=function(){return this.xq},n.prototype.DD=function(t){if(this==t)throw e.i.fa("MultiPathImpl.add");for(var i=this.da(),h=0;h=(i=this.Vc(i))||ti?n.I():i,0>t||t>n.I()||it?i:t,0>i||0>t)throw e.i.N();if(t!=0){i=t-0,t=this.wa,this.resize(this.wa+i);for(var h=0;hn||n>=this.I())throw e.i.fa("index out of bounds");this.mc();for(var t=0,i=this.description.Aa;tt||t>=this.wa||in?n:f},v.Th=function(f,r){var n=5381;return((n=((n=((n=r!==void 0?(r<<5)+r+(255&f):(n<<5)+n+(255&f))<<5)+n+(f>>8&255))<<5)+n+(f>>16&255))<<5)+n+(f>>24&255)&2147483647},v.uj=function(){throw Error("Not Implemented")},v.bB=function(f){return v.aU(f)+12345&2147483647},v.XG=function(f){var r=32,n=f%v.Qx|0,t=f/v.Qx|0;return(r&=63)==0?f:(32>r?(f=n>>>r|t<<32-r,r=t>>r):(f=t>>r-32,r=0<=t?0:-1),r*v.Qx+(f>>>0))},v.aU=function(f){var r=1103515245,n=65535&r;return((r-n)*(f|=0)|0)+(n*f|0)|0},v.truncate=function(f){return 0>f?-1*Math.floor(Math.abs(f)):Math.floor(f)},v.MAX_SAFE_INTEGER=Math.pow(2,53)-1,v.MIN_SAFE_INTEGER=-v.MAX_SAFE_INTEGER,v.VC=65536,v.Qx=v.VC*v.VC,v}()}(k||(k={})),function(e){var v;(v=e.CL||(e.CL={}))[v.Project=0]="Project",v[v.Union=1]="Union",v[v.Difference=2]="Difference",v[v.Proximity2D=3]="Proximity2D",v[v.Relate=4]="Relate",v[v.Equals=5]="Equals",v[v.Disjoint=6]="Disjoint",v[v.Intersects=7]="Intersects",v[v.Within=8]="Within",v[v.Contains=9]="Contains",v[v.Crosses=10]="Crosses",v[v.Touches=11]="Touches",v[v.Overlaps=12]="Overlaps",v[v.Buffer=13]="Buffer",v[v.Distance=14]="Distance",v[v.Intersection=15]="Intersection",v[v.Clip=16]="Clip",v[v.Cut=17]="Cut",v[v.DensifyByLength=18]="DensifyByLength",v[v.DensifyByAngle=19]="DensifyByAngle",v[v.LabelPoint=20]="LabelPoint",v[v.GeodesicBuffer=21]="GeodesicBuffer",v[v.GeodeticDensifyByLength=22]="GeodeticDensifyByLength",v[v.ShapePreservingDensify=23]="ShapePreservingDensify",v[v.GeodeticLength=24]="GeodeticLength",v[v.GeodeticArea=25]="GeodeticArea",v[v.Simplify=26]="Simplify",v[v.SimplifyOGC=27]="SimplifyOGC",v[v.Offset=28]="Offset",v[v.Generalize=29]="Generalize",v[v.SymmetricDifference=30]="SymmetricDifference",v[v.ConvexHull=31]="ConvexHull",v[v.Boundary=32]="Boundary",v[v.SimpleRelation=33]="SimpleRelation";var f=function(){function r(){}return r.prototype.getType=function(){return null},r.prototype.wn=function(){},r.prototype.Iu=function(){return!1},r}();e.Je=f}(k||(k={})),function(e){var v=function(f){function r(){return f!==null&&f.apply(this,arguments)||this}return J(r,f),r.prototype.getType=function(){return 13},r.local=function(){return r.instance===null&&(r.instance=new r),r.instance},r.prototype.V=function(n,t,i,h,s){return n instanceof e.aa?(s=new e.Zc(n),this.V(s,t,[i],!1,h).next()):h===!0?(i=new e.BC(n,t,i,!1,s),e.Gh.local().V(i,t,s)):new e.BC(n,t,i,!1,s)},r.instance=null,r}(e.Je);e.AC=v}(k||(k={})),function(e){var v=function(){function f(r,n,t,i,h){this.ya=-1,this.Rd=r,this.$z=n,this.Cs=t,this.tT=new e.l,this.tT.Oa(),this.eo=-1,this.Ub=h}return f.prototype.next=function(){for(var r;(r=this.Rd.next())!=null;)return this.ya=this.Rd.La(),this.eo+1=r.I():r.da()==1&&(2>=r.I()||e.Zt.JG(r,0)))},f}();e.DC=v}(k||(k={})),function(e){var v=function(f){function r(){return f!==null&&f.apply(this,arguments)||this}return J(r,f),r.prototype.getType=function(){return 17},r.local=function(){return r.instance===null&&(r.instance=new r),r.instance},r.prototype.V=function(n,t,i,h,s){return new e.nL(n,t,i,h,s)},r.instance=null,r}(e.Je);e.mL=v}(k||(k={})),function(e){var v=function(){function f(r,n,t,i,h){if(this.Tf=null,n==null||t==null)throw e.i.fa("invalid argument");this.qT=r,this.nA=n,this.lH=t,r=e.ta.mv(n,t),this.qa=e.ta.Wd(i,r,!0),this.kH=-1,this.nd=h}return f.prototype.La=function(){return 0},f.prototype.next=function(){return this.RQ(),++this.kHthis.Tf.length&&(this.Tf.length=0)},f.prototype.SQ=function(){var r=new e.ia(0),n=new e.gd,t=n.aF(),i=n.Ib(this.nA),h=n.Ib(this.lH),s=new e.Fg;try{s.Ft(n,this.qa,this.nd),s.dl(t,i,h,r);var o=n.Ne(i),a=new e.Da,u=new e.Da;for(this.Tf.length=0,this.Tf.push(a),this.Tf.push(u),i=0;i=t)throw e.i.N();return new e.oL(n,t,i)},r.instance=null,r}(e.Je);e.Xl=v}(k||(k={})),function(e){var v=function(){function f(r,n){this.ya=-1,this.Rd=r,this.Ps=n}return f.prototype.La=function(){return this.ya},f.prototype.next=function(){var r;return(r=this.Rd.next())!=null?(this.ya=this.Rd.La(),this.NP(r)):null},f.prototype.NP=function(r){if(r.B()||1>r.Db())return r;var n=r.getType();if(n==1736||n==1607)return this.Ny(r);if(e.aa.yd(n))return this.PP(r);if(n==197)return this.OP(r);throw e.i.Qa()},f.prototype.PP=function(r){if(r.Qb()<=this.Ps)return r;var n=new e.Ta(r.description);return n.oc(r,!0),this.Ny(n)},f.prototype.OP=function(r){var n=new e.Da(r.description);n.ad(r,!1);var t=new e.l;return r.A(t),r=t.ca(),t.R()<=this.Ps&&r<=this.Ps?n:this.Ny(n)},f.prototype.Ny=function(r){for(var n=r.Ia(),t=r.Ga();t.$a();)for(var i=!0;t.Ha();){var h=t.ha();if(h.getType()!=322)throw e.i.fa("not implemented");var s=t.On(),o=h.Qb();if(o>this.Ps){var a=Math.ceil(o/this.Ps);o=new e.Sa(r.description),i&&(h.To(o),n.nf(o));var u=i=1/a,c=0;for(--a;co)return n;var a=n.getType(),u=t.getType(),c=new e.l,l=new e.l,p=new e.l;n.A(c),t.A(l),p.K(c),p.Zb(l);var y=(p=e.ta.Wd(i,p,!0))*Math.sqrt(2)*1.00001,d=new e.l;if(d.K(c),d.W(y,y),!d.isIntersecting(l))return n;if(s==1&&o==2)return r.KV(n,t,u,i,h);if(a==33)switch(e.Vk.yd(u)?(i=new e.Ta(t.description),i.oc(t,!0)):i=t,u){case 1736:return r.XU(n,i,p);case 1607:return r.YU(n,i,p);case 550:return r.VU(n,i,p);case 197:return r.UU(n,i,p);case 33:return r.WU(n,i,p);default:throw e.i.N()}else if(a==550)switch(u){case 1736:return r.nU(n,t,p);case 197:return r.lU(n,t,p);case 33:return r.mU(n,t,p)}return e.Fg.im(n,t,i,h)},r.XU=function(n,t,i){return e.hd.KG(t,n,i)==0?n:n.Ia()},r.YU=function(n,t,i){var h=n.D();t=t.Ga();for(var s=i*Math.sqrt(2)*1.00001,o=s*s,a=new e.l;t.$a();)for(;t.Ha();){var u=t.ha();if(u.A(a),a.W(s,s),a.contains(h)){if(u.qs(h,i))return n.Ia();var c=u.ac();if(e.h.yc(h,c)<=o||(c=u.wc(),e.h.yc(h,c)<=o))return n.Ia()}}return n},r.VU=function(n,t,i){var h=t.ub(0);t=t.I();var s=n.D(),o=new e.h;i=i*Math.sqrt(2)*1.00001,i*=i;for(var a=0;at.I()?this.gE(n,t,i):(this.Nt(),n=this.gE(t,n,i),this.Nt(),n):n.getType()==550&&e.aa.Hc(t.getType())?(n=this.hE(t,n,i),this.Nt(),n):t.getType()==550&&e.aa.Hc(n.getType())?this.hE(n,t,i):n.getType()==550&&t.getType()==550?n.I()>t.I()?this.iE(n,t):(this.Nt(),n=this.iE(t,n),this.Nt(),n):0},r.prototype.gE=function(n,t,i){var h=n.Ga(),s=t.Ga(),o=new e.l,a=new e.l,u=17976931348623157e292;if(!i&&this.pY(n,t,h,s))return 0;for(;h.$a();)for(;h.Ha();)if((n=h.ha()).A(o),!(o.px(this.oh)>u)){for(;s.$a();)for(;s.Ha();)if((t=s.ha()).A(a),o.px(a)o)){for(var l=0;lh)){for(var l=0;lr.Ja(n))){var h=r.Ba(n),s=r.Vc(n)-1,o=r.ub(0),a=r.dc(n),u=new e.ia(0);u.Jb(r.Ja(n)+1);var c=new e.ia(0);for(c.Jb(r.Ja(n)+1),u.add(a?h:s),u.add(h),h=new e.h;1this.DH&&a>s&&(h=i,s=a)}return h},f.prototype.qe=function(){},f}();e.sL=v}(k||(k={})),function(e){var v=function(f){function r(){return f!==null&&f.apply(this,arguments)||this}return J(r,f),r.prototype.getType=function(){return 29},r.prototype.V=function(n,t,i,h){return n instanceof e.aa?(n=new e.Zc(n),this.V(n,t,i,h).next()):new e.sL(n,t,i,h)},r.local=function(){return r.instance===null&&(r.instance=new r),r.instance},r.instance=null,r}(e.Je);e.EC=v}(k||(k={})),function(e){var v=function(f){function r(){return f!==null&&f.apply(this,arguments)||this}return J(r,f),r.prototype.getType=function(){return 21},r.local=function(){return r.instance===null&&(r.instance=new r),r.instance},r.prototype.V=function(n,t,i,h,s,o,a,u){return n instanceof e.aa?(u=new e.Zc(n),this.V(u,t,i,[h],s,o,!1,a).next()):a===!0?(i=new e.GC(n,t,i,h,s,!1,!1,u),e.Gh.local().V(i,t,u)):new e.GC(n,t,i,h,s,!1,!1,u)},r.instance=null,r}(e.Je);e.FC=v}(k||(k={})),function(e){var v=function(){function f(r,n,t,i,h,s,o,a){if(s)throw e.i.Ie();if(n==null)throw e.i.N();this.ya=-1,this.Ms=r,this.vg=n,this.ze=t,this.Cs=i,this.$n=h,this.eo=-1,this.Ub=a,this.uT=new e.l,this.uT.Oa()}return f.prototype.next=function(){for(var r;(r=this.Ms.next())!=null;)return this.ya=this.Ms.La(),this.eo+1n.Db())return 0;if(i==4)throw e.i.Ie();var h=e.cb.sc(t),s=e.cb.vv(h),o=e.cb.ev(h);s*=2-s;var a=h.Hd().ai,u=n.getType();if(u==1736||u==197)var c=n.mg();else e.aa.yd(u)?(c=new e.Ta(n.description)).oc(n,!0):c=n;if(h.Nb(t)==0){if(e.cb.Wc(t)){c=e.Hh.lj(c,t),u==1607&&c==n&&(c=e.aa.jg(n)),n=new e.Nc,e.cb.gh(t).cn(n),u=0;for(var l=c.I();u=this.Fi||7h||t==0&&n==550&&this.Dj==33?this.nJ():f.HB(r,i);if((this.Fi==-1||this.Fi==4)&&n==197&&this.Dj==197)return t=this.Se,n=new e.l,r.A(n),i=new e.l,t.A(i),n.Ea(i),t=new e.Fh,r.copyTo(t),t.Xo(n),t;if(n==197&&e.aa.tf(this.Dj)==0||this.Dj==197&&e.aa.tf(n)==0)return i=n==197?r:this.Se,r=n==197?this.Se:r,n=new e.l,i.A(n),e.Ud.clip(r,n,t,0);if(e.aa.tf(n)==0&&0a&&(a=t.yz()),s=t.I()+i.I(),a*i.I()>Math.log(s)*s*4)return null;s=null,a=i.Ga(),u!=null&&u.Fb!=null&&(s=u.Fb),s==null&&20w){if(s!=null)for(i==null?i=s.vR(j,h):i.Uo(j,h),w=i.next();w!=-1;w=i.next()){a.Vb(s.ja(w)),w=a.ha();var M=j.Ea(w,null,c,null,h);for(w=0;wm?(y=u.wb()-t.Ba(x),d=1,m=m==0?3:2):d++:(r.oc(A,m==0),m=1);break;case 0:m=0,y=-1,d=0;break;default:return null}A=N}}}else{if(0>(w=this.QD(n,j.ac(),h)))return null;w==1?(2>m&&(y=u.wb()-t.Ba(x),m=m==0?3:2),d++):(y=-1,d=0)}l.clear(!1)}else w!=0&&w==1&&(m==0?(m=3,y=u.wb()-t.Ba(x)):m==1?(m=2,y=u.wb()-t.Ba(x)):d++)}2<=m&&(r.Dr(t,x,y,d,m==3),y=-1)}return r},f.prototype.QD=function(r,n,t){return e.Dg.wm(r,n,t)},f.prototype.RD=function(r,n,t){var i=n.ac();n=n.wc();var h=e.Dg.wm(r,i,t),s=e.Dg.wm(r,n,t);return h==1&&s==0||h==0&&s==1?-1:h==0||s==0?0:h==1||s==1?1:((h=new e.h).add(i,n),h.scale(.5),(r=e.Dg.wm(r,h,t))==0?0:r==1?1:-1)},f.HB=function(r,n){return n?r:r.Ia()},f.prototype.nJ=function(){return this.yH==null&&(this.yH=this.Se.Ia()),this.yH},f.prototype.qe=function(){},f}();e.HC=v}(k||(k={})),function(e){var v=function(f){function r(){return f!==null&&f.apply(this,arguments)||this}return J(r,f),r.prototype.getType=function(){return 28},r.local=function(){return r.instance===null&&(r.instance=new r),r.instance},r.prototype.V=function(n,t,i,h,s,o,a){return n instanceof e.aa?(n=new e.Zc(n),this.V(n,t,i,h,s,o,a).next()):new e.xL(n,t,i,h,s,o,a)},r.instance=null,r}(e.Je);e.IC=v}(k||(k={})),function(e){var v=function(){function f(r,n,t,i,h,s,o){this.ya=-1,this.Rd=r,this.Mj=n,this.Ka=t,this.Ki=i,this.CA=h,this.uH=s,this.nd=o}return f.prototype.next=function(){var r=this.Rd.next();return r!=null?(this.ya=this.Rd.La(),this.jL(r)):null},f.prototype.La=function(){return this.ya},f.prototype.jL=function(r){var n=0>=this.uH?e.ta.kj(this.Mj,r,!1):this.uH;return e.IK.V(r,this.Ka,this.Ki,this.CA,n,this.nd)},f.prototype.qe=function(){},f}();e.xL=v}(k||(k={})),function(e){var v;(v=e.NK||(e.NK={}))[v.clipToDomainOnly=1]="clipToDomainOnly",v[v.clipWithHorizon=2]="clipWithHorizon",v[v.foldAndClipWithHorizon=3]="foldAndClipWithHorizon";var f=function(r){function n(){return r!==null&&r.apply(this,arguments)||this}return J(n,r),n.prototype.getType=function(){return 0},n.local=function(){return n.instance===null&&(n.instance=new n),n.instance},n.prototype.V=function(t,i,h){return t instanceof e.aa?(t=new e.Zc(t),this.V(t,i,h).next()):new e.yL(t,i,h)},n.prototype.transform=function(t,i,h,s){return e.bu.transform(t,i,h,s,!0)},n.prototype.Qt=function(t,i,h,s){return e.bu.Qt(t,i,h,s)},n.instance=null,n}(e.Je);e.Hx=f}(k||(k={})),function(e){var v=function(){function f(r,n,t){this.ya=-1,this.Rd=r,this.MT=n,this.nd=t}return f.prototype.next=function(){var r=this.Rd.next();return r!=null?(this.ya=this.Rd.La(),e.bu.zh(r,this.MT,this.nd)):null},f.prototype.La=function(){return this.ya},f.prototype.qe=function(){},f}();e.yL=v}(k||(k={})),function(e){var v=function(){function r(){}return r.prototype.reset=function(){this.ph=this.xk=-1,this.us=this.kq=!1},r.prototype.AQ=function(n,t,i){for(n.Vb(t,i);n.Ha();){var h=n.ha();if((h=h.Qb())!=0)return n.wb()}for(n.Vb(t,i);n.Ez();)if((h=(h=n.li()).Qb())!=0)return n.wb();return-1},r.prototype.BQ=function(n,t){for(n.Vb(t,-1);n.Ez();)if(n.li().Qb()!=0)return n.wb();return-1},r.prototype.zQ=function(n,t){for(n.Vb(t,-1),n.ha();n.Ha();)if(n.ha().Qb()!=0)return n.wb();return-1},r.prototype.yQ=function(n,t,i,h){if(this.xk=this.AQ(t,i,h),this.xk!=-1){t.Vb(this.xk,-1);var s=t.ha(),o=s.hc(s.fe(n,!1));if(i=e.h.yc(o,n),(h=new e.h).L(o),h.sub(s.ac()),(o=new e.h).L(n),o.sub(s.ac()),this.kq=0>h.wi(o),this.ph=this.zQ(t,this.xk),this.ph!=-1){t.Vb(this.ph,-1);var a=(s=t.ha()).fe(n,!1);a=s.hc(a);var u=e.h.yc(a,n);u>i?this.ph=-1:(h.L(a),h.sub(s.ac()),o.L(n),o.sub(s.ac()),this.us=0>h.wi(o))}this.ph==-1&&(this.ph=this.BQ(t,this.xk),this.ph!=-1&&(t.Vb(this.ph,-1),a=(s=t.ha()).fe(n,!1),a=s.hc(a),(u=e.h.yc(a,n))>i?this.ph=-1:(h.L(a),h.sub(s.ac()),o.L(n),o.sub(s.ac()),this.us=0>h.wi(o),n=this.xk,this.xk=this.ph,this.ph=n,n=this.kq,this.kq=this.us,this.us=n)))}},r.prototype.cO=function(n,t,i,h,s){return i=i.Ga(),this.yQ(n,i,h,s),this.xk!=-1&&this.ph==-1?this.kq:this.xk!=-1&&this.ph!=-1?this.kq==this.us?this.kq:(i.Vb(this.xk,-1),n=i.ha().kg(),i.Vb(this.ph,-1),t=i.ha().kg(),0<=n.wi(t)):t},r}(),f=function(r){function n(){return r!==null&&r.apply(this,arguments)||this}return J(n,r),n.local=function(){return n.instance===null&&(n.instance=new n),n.instance},n.prototype.getType=function(){return 3},n.prototype.nz=function(t,i,h){var s;if(s===void 0&&(s=!1),t.B())return new e.$l;i=i.D();var o=t,a=t.getType();switch(a==197&&((o=new e.Da).ad(t,!1),a=1736),a){case 33:return this.xI(o,i);case 550:return this.jI(o,i);case 1607:case 1736:return this.bU(o,i,h,s);default:throw e.i.fa("not implemented")}},n.prototype.oz=function(t,i){if(t.B())return new e.$l;i=i.D();var h=t,s=t.getType();switch(s==197&&((h=new e.Da).ad(t,!1),s=1736),s){case 33:return this.xI(h,i);case 550:case 1607:case 1736:return this.jI(h,i);default:throw e.i.fa("not implemented")}},n.prototype.pz=function(t,i,h,s){if(0>s)throw e.i.N();if(t.B())return[];i=i.D();var o=t,a=t.getType();switch(a==197&&((o=new e.Da).ad(t,!1),a=1736),a){case 33:return this.TU(o,i,h,s);case 550:case 1607:case 1736:return this.tU(o,i,h,s);default:throw e.i.fa("not implemented")}},n.prototype.bU=function(t,i,h,s){if(t.getType()==1736&&h&&(h=new e.l,t.A(h),h=e.ta.Wd(null,h,!1),(s?e.hd.Yd(t,i,0):e.hd.Yd(t,i,h))!=0)){var o=new e.$l(i,0,0);return s&&o.WJ(!0),o}var a=t.Ga();o=new e.h;for(var u=h=-1,c=17976931348623157e292,l=0;a.$a();)for(;a.Ha();){var p=a.ha();p=p.hc(p.fe(i,!1));var y=e.h.yc(p,i);ye.h.Uq(i,p.ac(),p.wc()),1=i||(t.length=s),t.slice(0)},n.instance=null,n}(e.Je);e.Ix=f}(k||(k={})),function(e){var v=function(f){function r(){return f!==null&&f.apply(this,arguments)||this}return J(r,f),r.prototype.getType=function(){return 4},r.prototype.V=function(n,t,i,h,s){return e.am.yB(n,t,i,h,s)},r.local=function(){return r.instance===null&&(r.instance=new r),r.instance},r.prototype.Iu=function(n){return e.Vt.wy(n)},r.prototype.wn=function(n,t,i){e.Vt.CD(n,t,i)},r.instance=null,r}(e.Je);e.zL=v}(k||(k={})),function(e){var v=function(f){function r(){return f!==null&&f.apply(this,arguments)||this}return J(r,f),r.prototype.getType=function(){return 33},r.prototype.V=function(n,t,i,h,s){return n===1073741824?!e.ud.zB(t,i,h,4,s):e.ud.zB(t,i,h,n,s)},r.local=function(){return r.instance===null&&(r.instance=new r),r.instance},r.prototype.Iu=function(n){return e.Vt.wy(n)},r.prototype.wn=function(n,t,i){e.Vt.CD(n,t,i)},r.instance=null,r}(e.Je);e.dj=v}(k||(k={})),function(e){var v=function(){function f(r,n,t,i){if(this.nd=i,this.rT=t,this.ya=-1,r==null)throw e.i.N();this.yk=r,this.Mj=n}return f.prototype.next=function(){var r;if((r=this.yk.next())!=null){if(this.ya=this.yk.La(),this.nd!=null&&!this.nd.progress(-1,-1))throw e.i.fu("user_canceled");return this.eC(r)}return null},f.prototype.La=function(){return this.ya},f.prototype.eC=function(r){if(r==null)throw e.i.N();return e.Jx.cK(r,this.Mj,this.rT,this.nd)},f.prototype.qe=function(){},f}();e.AL=v}(k||(k={})),function(e){var v=function(f){function r(){return f!==null&&f.apply(this,arguments)||this}return J(r,f),r.prototype.getType=function(){return 26},r.prototype.V=function(n,t,i,h){return n instanceof e.aa?(n=new e.Zc(n),this.V(n,t,i,h).next()):new e.AL(n,t,i,h)},r.prototype.rs=function(n,t,i,h,s){return 0<(h!==void 0?e.Jx.rs(n,t,i,h,s):e.Jx.rs(n,t,!1,null,i))},r.local=function(){return r.instance===null&&(r.instance=new r),r.instance},r.instance=null,r}(e.Je);e.Yl=v}(k||(k={})),function(e){var v=function(){function s(){this.yq=0}return s.prototype.nX=function(o){this.yq&=-2,this.yq|=o?1:0},s.prototype.Wp=function(){return(1&this.yq)!=0},s.prototype.XF=function(){return this.Wp()?0:1},s}();e.xY=v;var f=function(){},r=function(s,o,a,u){this.x=s,this.y=o,this.Ai=a,this.xm=u},n=function(){function s(o){this.Be=o}return s.prototype.compare=function(o,a,u){return o=o.ja(u),a=this.Be.lf.read(2*a),0>(a-=o=this.Be.lf.read(2*o))?-1:0p?1:0},s}(),i=function(){function s(o,a){this.YI=new e.h,this.parent=o,this.dS=a}return s.prototype.nr=function(o,a,u){var c=this.parent,l=this.dS;u.Vd(o,a,function(p,y){return c.Mh(p,y,l)})},s.prototype.$p=function(o){return o=this.parent.gi.get(o),this.parent.lf.tc(2*(o>>1),this.YI),this.YI.y+(1&o?this.parent.Oj:-this.parent.Oj)},s}(),h=function(){function s(o,a,u,c,l){this.nH=o.description,this.X=o,this.Qg=a,this.Oj=e.ta.kj(this.Qg,o,!1),this.Bo=e.ta.kj(this.Qg,o,!0),this.xA=u,this.oT=this.nH.Aa,this.hb=[],this.po=[],this.mh=new e.jp,this.fb=new e.Yj,this.ke=new e.Md,this.ZG=this.ql=l}return s.prototype.eT=function(){return this.ZG=!0,(!e.aa.Hc(this.X.getType())||this.GE()&&this.DE(!1))&&this.mO()?e.aa.Hc(this.X.getType())?this.pO()?this.X.getType()==1607?this.rO()?2:0:this.sO()?this.tO():0:0:2:0},s.prototype.kC=function(o,a){var u=this.lf.read(2*o);o=this.lf.read(2*o+1);var c=this.lf.read(2*a);a=this.lf.read(2*a+1);var l=!e.Yt.Cv(u,o,c,a,this.Oj*this.Oj);return l||this.X.Db()!=0&&u==c&&o==a},s.prototype.GE=function(){for(var o=this.X,a=o.xf?3:2,u=0,c=o.da();uthis.Oj)){if(o&&c){var p=l.wv(1,0);if(l=l.wv(1,0),Math.abs(l-p)>a)continue}return this.ke=new e.Md(2,u.wb(),-1),!1}}return!0},s.prototype.mO=function(){var o=this.X,a=null;e.aa.Hc(this.X.getType())&&(a=this.X);var u=(this.ZG||this.ql)&&a!=null,c=o.I();this.lf=o.ub(0),this.gi=new e.ia(0),this.gi.Jb(2*c),this.fi=new e.ia(0),this.fi.Jb(2*c),u&&(this.Fl==null&&(this.Fl=new e.ia(0)),this.Fl.Jb(c));for(var l=o=0;l=a.Vc(o);)o++;this.Fl.add(o)}for(new e.Xt().sort(this.fi,0,2*c,new i(this,u)),this.fb.clear(),this.fb.Vo(new n(this)),this.fb.De(c),a=0,c*=2;a>1,(1&o)==0){if(o=this.fb.addElement(u,-1),(l=this.fb.we(o))!=-1&&!this.kC(this.fb.ja(l),u))return this.ke=new e.Md(3,u,this.fb.ja(l)),!1;var p=this.fb.lb(o);if(p!=-1&&!this.kC(this.fb.ja(p),u))return this.ke=new e.Md(3,u,this.fb.ja(p)),!1}else if(o=this.fb.search(u,-1),l=this.fb.we(o),p=this.fb.lb(o),this.fb.vd(o,-1),l!=-1&&p!=-1&&!this.kC(this.fb.ja(l),this.fb.ja(p)))return this.ke=new e.Md(3,this.fb.ja(l),this.fb.ja(p)),!1;return!0},s.prototype.pO=function(){return 10>this.X.I()?this.nO():this.oO()},s.prototype.oO=function(){var o=new e.gd;o.Ib(this.X);var a=new e.Md;return!e.$t.kI(!1,o,this.Oj,a,this.nd)||(a.Jo=o.Ua(a.Jo),a.Ko=o.Ua(a.Ko),this.ke.Wt(a),!1)},s.prototype.nO=function(){var o=this.X,a=o.Ga();for(o=o.Ga();a.$a();)for(;a.Ha();){var u=a.ha();if(!a.Qn()||!a.$S()){o.BW(a);do for(;o.Ha();){var c=o.ha();if((c=u.zr(c,this.Oj,!0))!=0)return this.ke=new e.Md(c==2?5:4,a.wb(),o.wb()),!1}while(o.$a())}}return!0},s.prototype.sO=function(){var o=this.X;this.hb.length=0,this.po.length=0,this.Zf=o.Ga(),this.Zf.JB();var a=new e.ia(0);a.Jb(10);var u=NaN,c=0,l=0;for(o=2*o.I();l>=1;var y=this.lf.read(2*p),d=this.lf.read(2*p+1);if(a.size!=0&&(y!=u||d!=c)){if(!this.RI(a))return!1;a!=null&&a.clear(!1)}a.add(p),u=y,c=d}}return!!this.RI(a)},s.prototype.rO=function(){for(var o=this.X,a=Array(o.da()),u=0,c=o.da();u>1;this.lf.tc(2*p,l);var y=a[u=this.Fl.get(p)],d=o.Ba(u),g=o.Vc(u)-1;c.el=p==d||p==g,c.ny=this.ql?!y&&c.el:c.el,c.Ai=u,c.x=l.x,c.y=l.y,c.xm=p;for(var b=new f,x=1,m=this.fi.size;x>1,this.lf.tc(2*p,l),(u=this.Fl.get(p))!=c.Ai&&(y=a[u],d=o.Ba(u),g=o.Vc(u)-1);var w=p==d||p==g,j=this.ql?!y&&c.el:c.el;if(b.x=l.x,b.y=l.y,b.Ai=u,b.xm=p,b.ny=j,b.el=w,b.x==c.x&&b.y==c.y){if(this.ql){if(!(b.ny&&c.ny||b.Ai==c.Ai&&(b.el||c.el)))return this.ke=new e.Md(8,b.xm,c.xm),!1}else if(!b.el||!c.el)return this.ke=new e.Md(5,b.xm,c.xm),!1}u=c,c=b,b=u}return!0},s.prototype.JE=function(){for(var o=this.X,a=[],u=-1,c=!1,l=0,p=o.da();l>1;this.lf.tc(2*y,c),l=this.Fl.get(y),u=new r(c.x,c.y,l,y,a[l]),o=[];var d=1;for(p=this.fi.size;d>1,this.lf.tc(2*y,c),l=this.Fl.get(y),(l=new r(c.x,c.y,l,y,a[l])).x==u.x&&l.y==u.y){if(l.Ai==u.Ai)return this.ke=new e.Md(9,l.xm,u.xm),!1;0<=a[l.Ai]&&a[l.Ai]==a[u.Ai]&&(o.length!=0&&o[o.length-1]==u||o.push(u),o.push(l))}u=l}if(o.length==0)return!0;for(l=new e.jp(!0),e.O.$u(a,-1),c=-1,(d=new e.h).Rc(),u=0,p=o.length;u=o.Ke())return this.ke=new e.Md(6,o.da()==1?1:-1,-1),0;if(o.da()==1)return this.ql&&!this.JE()?0:2;this.to=e.ia.qf(o.da(),0),this.JA=e.ia.qf(o.da(),-1);for(var a=-1,u=0,c=0,l=o.da();cp?0:256),0a||u>=1,(c=this.lf.read(2*u+1))!=this.Mo&&o.size!=0){if(!this.ut(o))return 0;o!=null&&o.clear(!1)}o.add(u),this.Mo=c}return 0l.la){var y=this.Zf.wb(),d=this.Su(l,c,this.Zf.gb,!0);0o.Ja(a.gb))){u.EW();for(var b,x,m=!0;a.Ha();){var w=a.ha(),j=u.li();if(a.wb()>u.wb())break;m&&(d.add(a.wb()),g.add(u.ik()),m=!1),x=d.Fc();var M=a.ik();if(1this.Bo?d.add(a.ik()):p&&(b=o.Uc(1,d.Fc(),0),w=w.gv(1,0),Math.abs(w-b)>y&&d.add(a.ik())),x>this.Bo?g.add(u.wb()):p&&(b=o.Uc(1,g.Fc(),0),w=j.gv(1,0),Math.abs(w-b)>y&&g.add(u.wb()))}if(d.Fc()g.size?d.If():g.If():(d.Fc()!=g.Fc()&&g.If(),g.If()),2<=g.size+d.size){for(m=new e.Sa,j=0,w=d.size;j>1;var l=c>>1,p=new e.h,y=new e.h;return this.lf.tc(2*a,p),p.y+=1&o?this.Oj:-this.Oj,this.lf.tc(2*l,y),y.y+=1&c?this.Oj:-this.Oj,(o=p.compare(y))==0&&u?0>(u=this.Fl.get(a)-this.Fl.get(l))?-1:0l.x)return 1;if(c.yl.y)return 1;for(c=1;cg)return 1}}return 0},s.prototype.PO=function(o,a){var u=this.Ou(o,a);return u==0?oa?1:0o?n:t;if(n.B())return t;if(t.B())return n;var a=new e.l,u=new e.l,c=new e.l;return n.A(a),t.A(u),c.K(a),c.Zb(u),a=e.ta.Wd(i,c,!0),u=n.getType(),c=t.getType(),u==33&&c==33?r.aV(n,t,a):u!=c?0o?n:t:u==550?r.iI(n,t,a):r.iI(t,n,a):e.Fg.ep(n,t,i,h)},r.aV=function(n,t,i){i=i*Math.sqrt(2)*1.00001,i*=i;var h=n.D(),s=t.D(),o=new e.de(n.description);return e.h.yc(h,s)>i&&(o.add(n),o.add(t)),o},r.iI=function(n,t,i){var h=n.ub(0),s=n.I(),o=t.D(),a=n.Ia();i=i*Math.sqrt(2)*1.00001;var u=new e.l;if(n.A(u),u.W(i,i),u.contains(o)){i*=i,u=!1;for(var c=[],l=0;lthis.zk||0>this.bo)throw e.i.Qa();if(this.AH[this.bo])break}return this.ya++,this.fG(this.bo)}return this.ya=0,this.bo=this.zk,this.fG(this.zk)},n.prototype.La=function(){return this.ya},n.prototype.qK=function(){if(this.Ic)return!0;var t=null;if(this.Rd!=null&&(t=this.Rd.next())==null&&(this.Ic=!0,this.Rd=null),e.mp.zp(this.Ub),t!=null){var i=t.Db();this.AH[i]=!0,i>=this.zk&&!this.jA&&(this.ND(i,!1,t),i>this.zk&&!this.jA&&this.zW(i))}if(0this.Do.length)for(var o=0,a=Math.max(2,t+1);oi?e.F.Wq(l,c,u,p,0):e.F.Wq(l,u,c,p,0),d=[0,0,0],g=[0,0,0];var m=[0,0,0];u=[0,0,0],y=[0,0,0];var w=Math.acos(p[2]/1),j=1-r,M=Math.tan(w),A=1+M*M/j,z=2*l[2]*M/j;for(j=(-z+(M=Math.sqrt(z*z-4*A*(l[2]*l[2]/j-1))))/(A*=2),z=(-z-M)/A,M=Math.tan(w),w=(j+z)/2,l=((A=M*j+l[2])+(M*z+l[2]))/2,M=e.F.gp(j-w,A-l),j=l/x*1.570796326794897,z=0;100>z&&(A=(A=e.F.w(r,j))*A/Math.cos(j)*(Math.sin(j)-l*A/(1-r)),!e.s.Cd(A));z++)j-=A;l=e.F.n(1,r,j)*Math.cos(j),M=1-M/(l=Math.sqrt((l-w)*(l+w))),M*=2-M,A=e.F.on(d),w=e.F.on(g),j=e.F.on(m);var N=e.F.St(m,d);z=e.F.St(m,g),e.F.zx(m,d,u),e.F.zx(m,g,y),d=Math.acos(N/(j*A)),g=Math.acos(z/(j*w)),g*=e.s.Mb(1,e.F.St(u,y)),(1.570796326794897<=e.s.P(d)&&1.570796326794897<=e.s.P(g)||3.141592653589793y&&0>i)&&(i=e.F.ba(i+3.141592653589793)),s!=null&&(s.u=u),o!=null&&(o.u=y),a!=null&&(a.u=i)}}},v.rf=function(f,r,n,t,i,h,s,o){var a=[0,0,0],u=[0,0,0],c=[0,0,0],l=[0,0,0],p=[0,0,0],y=[0,0,0],d=[0,0,0],g=[0,0,0,0],b=new e.ga(0),x=new e.ga(0),m=new e.ga(0),w=new e.ga(0),j=new e.ga(0),M=new e.ga(0);if(s!=null&&o!=null)if(e.s.ti(r))e.Yg.rf(f,n,t,i,h,s,o);else if(e.s.Cd(i))s!=null&&(s.u=n),o!=null&&(o.u=t);else if(h=e.F.ba(h),0>i&&(i=e.s.P(i),h=e.F.ba(h+3.141592653589793)),n=e.F.ba(n),t=e.F.ba(t),1.570796326794897h?e.F.Wq(d,p,a,g,0):e.F.Wq(d,a,p,g,0),a=Math.acos(g[2]/1),g=Math.atan2(-g[1],-g[0]),t=1-r,j=1+(p=Math.tan(a))*p/t,t=(-(w=2*d[2]*p/t)+(p=Math.sqrt(w*w-4*j*(d[2]*d[2]/t-1))))/(j*=2),w=(-w-p)/j,p=Math.tan(a),a=(t+w)/2,d=((j=p*t+d[2])+(p*w+d[2]))/2,p=e.F.gp(t-a,j-d),A=d/A*1.570796326794897,t=0;100>t&&(w=(w=e.F.w(r,A))*w/Math.cos(A)*(Math.sin(A)-d*w/(1-r)),!e.s.Cd(w));t++)A-=w;A=e.F.n(1,r,A)*Math.cos(A),d=1-p/(A=Math.sqrt((A-a)*(A+a))),d*=2-d,y=Math.acos(e.F.St(y,u)/(e.F.on(y)*e.F.on(u))),y*=e.s.Mb(1,u[0]),h=(e.F.q(A,d,e.F.Qj(d,y))+f*e.s.Mb(1,h))/e.F.Ah(A,d),h=e.F.ba(1.570796326794897*h),h=e.F.Rq(d,h),e.F.n(A,d,h),p=e.F.ba(g+n),n=Math.cos(p),h=Math.sin(p),c[0]=l[0]*n+l[1]*-h,c[1]=l[0]*h+l[1]*n,c[2]=l[2],e.F.jO(r,c[0],c[1],c[2],m,x,b),s!=null&&(s.u=x.u),o!=null&&(o.u=m.u)}},v}()}(k||(k={})),function(e){var v=function(){function i(h){this.Ya=null,this.wt=new e.h,this.xt=new e.h,this.g=h}return i.prototype.compare=function(h,s,o){return this.g.Gc(s,this.wt),this.g.Gc(h.ja(o),this.xt),this.wt.compare(this.xt)},i}(),f=function(){function i(h){this.Bf=new e.h,this.Dk=new e.h,this.g=h}return i.prototype.Dh=function(h){this.Bf.L(h)},i.prototype.compare=function(h,s){return this.g.Gc(h.ja(s),this.Dk),this.Bf.compare(this.Dk)},i}(),r=function(i){function h(s){var o=i.call(this,s.g,s.qa,!1)||this;return o.ib=s,o}return J(h,i),h.prototype.compare=function(s,o,a){if(this.rg)return-1;var u=this.ib.Qd.Jn(this.ib.Rh(o));s=s.ja(a);var c=this.ib.Qd.Jn(this.ib.Rh(s));return this.Dm=a,this.RE(o,u,s,c)},h}(e.UC),n=function(i){function h(s){var o=i.call(this,s.g,s.qa)||this;return o.ib=s,o}return J(h,i),h.prototype.compare=function(s,o){return this.rg?-1:(s=this.ib.Qd.Jn(this.ib.Rh(s.ja(o))),this.Dm=o,this.SE(o,s))},h}(e.aM),t=function(){function i(){this.Mc=this.df=this.jo=this.Qd=this.lh=this.zd=this.hb=this.g=null,this.Ng=!1,this.vh=this.Nm=this.ie=this.Gk=this.nh=this.Ak=this.Ff=this.$d=null,this.xh=this.Jq=this.UA=this.qa=0,this.Xv=this.Wn=!1,this.yo=new e.h,this.Pi=new e.h,this.hb=new e.$c(8),this.zd=new e.$c(5),this.lh=new e.au,this.Qd=new e.au,this.Ng=!1,this.vh=new e.h,this.vh.ma(0,0),this.qa=0,this.xh=-1,this.Wn=!1,this.g=null,this.df=new e.Yj,this.Mc=new e.Yj,this.nh=new e.ia(0),this.Gk=new e.TC,this.Ff=new e.ia(0),this.Ak=new e.ia(0),this.jo=new e.Sa}return i.prototype.PX=function(h,s){var o=new e.Dd;return o.$B(),h.Oc(o),this.er(h),this.Wn=!1,this.qa=s,this.UA=s*s,s=this.jC(),h.Oc(o),s||(this.qQ(),s||this.jC()),this.xh!=-1&&(this.g.Td(this.xh),this.xh=-1),this.g=null,this.Wn},i.prototype.TX=function(h,s){this.er(h),this.Wn=!1,this.qa=s,this.UA=s*s,this.Ng=!1,this.jC(),this.Ng||(this.Ng=h.Gp(s,!0,!1)==1),this.xh!=-1&&(this.g.Td(this.xh),this.xh=-1),this.g=null},i.prototype.pg=function(h,s){return this.hb.T(h,0+s)},i.prototype.LB=function(h,s,o){this.hb.S(h,0+s,o)},i.prototype.Rh=function(h){return this.hb.T(h,2)},i.prototype.ZW=function(h,s){this.hb.S(h,2,s)},i.prototype.RF=function(h,s){return this.hb.T(h,3+s)},i.prototype.Pp=function(h){return this.hb.T(h,7)},i.prototype.Pl=function(h,s){this.hb.S(h,7,s)},i.prototype.Rp=function(h,s){return this.hb.T(h,3+this.Op(h,s))},i.prototype.fr=function(h,s,o){this.hb.S(h,3+this.Op(h,s),o)},i.prototype.NR=function(h,s){return this.hb.T(h,5+this.Op(h,s))},i.prototype.hr=function(h,s,o){this.hb.S(h,5+this.Op(h,s),o)},i.prototype.Sr=function(h){return this.zd.T(h,0)},i.prototype.UW=function(h,s){this.zd.S(h,0,s)},i.prototype.ez=function(h){return this.zd.T(h,4)},i.prototype.cr=function(h,s){this.zd.S(h,4,s)},i.prototype.il=function(h){return this.zd.T(h,1)},i.prototype.ln=function(h,s){this.zd.S(h,1,s)},i.prototype.dz=function(h){return this.zd.T(h,3)},i.prototype.Et=function(h,s){this.zd.S(h,3,s)},i.prototype.Ym=function(h){var s=this.zd.Ce(),o=this.lh.Ph();return this.UW(s,o),h!=-1?(this.lh.addElement(o,h),this.g.Ra(h,this.xh,s),this.cr(s,this.g.Ua(h))):this.cr(s,-1),s},i.prototype.HP=function(h){this.zd.jd(h)},i.prototype.LD=function(h,s){this.lh.addElement(this.Sr(h),s),this.g.Ra(s,this.xh,h)},i.prototype.nt=function(h){var s=this.hb.Ce(),o=this.Qd.Ph();return this.ZW(s,o),h!=-1&&this.Qd.addElement(o,h),s},i.prototype.MD=function(h,s){this.Qd.addElement(this.Rh(h),s)},i.prototype.Uu=function(h){this.hb.jd(h),0<=(h=this.nh.lF(h))&&this.nh.SV(h)},i.prototype.hj=function(h,s){if(this.pg(h,0)==-1)this.LB(h,0,s);else{if(this.pg(h,1)!=-1)throw e.i.Qa();this.LB(h,1,s)}this.ky(h,s)},i.prototype.ky=function(h,s){var o=this.il(s);if(o!=-1){var a=this.Rp(o,s);this.hr(a,s,h),this.fr(h,s,a),this.fr(o,s,h),this.hr(h,s,o)}else this.hr(h,s,h),this.fr(h,s,h),this.ln(s,h)},i.prototype.Op=function(h,s){return this.pg(h,0)==s?0:1},i.prototype.Xm=function(h,s){var o,a=this.dz(s);if(a!=-1&&(this.df.vd(a,-1),this.Et(s,-1)),(a=this.il(s))!=-1){var u=o=a;do{var c=!1,l=this.Op(o,s),p=this.RF(o,l);if(this.pg(o,l+1&1)==h){if(this.Xu(o),this.Qd.bh(this.Rh(o)),this.Uu(o),o==p){a=-1;break}a==o&&(a=this.il(s),u=p,c=!0)}o=p}while(o!=u||c);if(a!=-1){do l=this.Op(o,s),p=this.RF(o,l),this.LB(o,l,h),o=p;while(o!=u);(o=this.il(h))!=-1?(u=this.Rp(o,h),c=this.Rp(a,h),u==o?(this.ln(h,a),this.ky(o,h),this.ln(h,o)):c==a&&this.ky(a,h),this.fr(a,h,u),this.hr(u,h,a),this.fr(o,h,c),this.hr(c,h,o)):this.ln(h,a)}}for(a=this.Sr(h),o=this.Sr(s),u=this.lh.rc(o);u!=-1;u=this.lh.lb(u))this.g.Ra(this.lh.ja(u),this.xh,h);this.lh.Hy(a,o),this.HP(s)},i.prototype.UT=function(h,s){var o=this.pg(h,0),a=this.pg(h,1),u=this.pg(s,0),c=this.pg(s,1);this.Qd.Hy(this.Rh(h),this.Rh(s)),s==this.il(o)&&this.ln(o,h),s==this.il(a)&&this.ln(a,h),this.Xu(s),this.Uu(s),o==u&&a==c||a==u&&o==c||(this.Hn(o,this.yo),this.Hn(u,this.Pi),this.yo.qb(this.Pi)?(o!=u&&this.Xm(o,u),a!=c&&this.Xm(a,c)):(a!=u&&this.Xm(a,u),o!=c&&this.Xm(o,c)))},i.prototype.Xu=function(h){var s=this.pg(h,1);this.dF(h,this.pg(h,0)),this.dF(h,s)},i.prototype.dF=function(h,s){var o=this.Rp(h,s),a=this.NR(h,s),u=this.il(s);o!=h?(this.fr(a,s,o),this.hr(o,s,a),u==h&&this.ln(s,o)):this.ln(s,-1)},i.prototype.WD=function(h,s,o){var a=this.Qd.rc(h),u=this.Qd.ja(a);h=this.Le(u);var c=this.Le(this.g.U(u));for(this.g.jr(u,s,o,!0),a=this.Qd.lb(a);a!=-1;a=this.Qd.lb(a)){u=this.Qd.ja(a);var l=this.Le(u)==h;this.g.jr(u,s,o,l)}a=s.Vp(o,0).ac(),s=s.Vp(o,s.ol(o)-1).wc(),this.BK(h,a),this.BK(c,s)},i.prototype.ZE=function(h,s,o){var a=this.Rh(h),u=this.pg(h,0),c=this.pg(h,1),l=this.nt(-1);for(this.nh.add(l),this.Pl(l,-3),this.Ff.add(l),this.hj(l,u),h=1,s=s.ol(o);hthis.ez(l)&&this.cr(l,this.g.Ua(c))),l=this.Ff.get(h),h-=2,this.MD(l,c),c=this.g.U(c);while(0<=h)}this.Ff.clear(!1)},i.prototype.Le=function(h){return this.g.Pa(h,this.xh)},i.prototype.TI=function(h,s,o){var a=this.pg(s,0),u=new e.h;this.Hn(a,u);var c=new e.h,l=this.pg(s,1);this.Hn(l,c);var p=o.ol(h),y=o.Vp(h,0),d=new e.h;if(y.Yp(d),!u.qb(d)){if(!this.Ng){var g=u.compare(this.vh);0>g*(d=d.compare(this.vh))&&(this.Ng=!0)}this.vF(a,this.Ff),this.Ak.add(a)}for(!this.Ng&&1y.compare(this.vh))&&(this.Ng=!0)),h=(y=o.Vp(h,p-1)).wc(),c.qb(h)||(this.Ng||0>(g=c.compare(this.vh))*(d=h.compare(this.vh))&&(this.Ng=!0),this.vF(l,this.Ff),this.Ak.add(l)),this.Ff.add(s),c=0,l=this.Ff.size;cMath.max(100,this.g.fd)){this.nh.clear(!1),this.Ng=!0;break}var h=this.nh.Fc();this.nh.If(),this.Pl(h,-1),this.WS(h)!=-1&&this.wS(h),this.Vn=!1}},i.prototype.wS=function(h){if(this.Vn){var s=this.Mc.zu(this.MH,this.GH,h,!0);this.Vn=!1}else s=this.Mc.KD(h);s==-1?this.UT(this.Mc.ja(this.Mc.FF()),h):(this.Pl(h,s),this.$d.rg&&(this.$d.Kr(),this.oF(this.$d.Dm,s)))},i.prototype.WS=function(h){var s=this.pg(h,0);if(h=this.pg(h,1),this.Hn(s,this.yo),this.Hn(h,this.Pi),e.h.yc(this.yo,this.Pi)<=this.UA)return this.Ng=!0,-1;var o=this.yo.compare(this.vh),a=this.Pi.compare(this.vh);return 0>=o&&0=a&&0h&&(this.re(n),h=this.description.Pf(n)),this.ka==null&&this.un(),this.ka[this.description.$j(h)+t]=i},r.prototype.getType=function(){return 33},r.prototype.Db=function(){return 0},r.prototype.Oa=function(){this.vc(),this.ka!=null&&(this.ka[0]=NaN,this.ka[1]=NaN)},r.prototype.sn=function(n){if(this.ka!=null){for(var t=e.ee.Iw(n,this.description),i=[],h=0,s=0,o=n.Aa;s>>32),n=e.O.Th(h,n)}return n},r.prototype.mg=function(){return null},r}(e.aa);e.Sa=v}(k||(k={})),function(e){var v=function(){function f(r,n,t){r!==void 0&&(this.x=r,this.y=n,this.z=t)}return f.construct=function(r,n,t){var i=new f;return i.x=r,i.y=n,i.z=t,i},f.prototype.K=function(r,n,t){this.x=r,this.y=n,this.z=t},f.prototype.lx=function(){this.z=this.y=this.x=0},f.prototype.normalize=function(){var r=this.length();r==0&&(this.x/=r,this.y/=r,this.z/=r)},f.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},f.prototype.sub=function(r){return new f(this.x-r.x,this.y-r.y,this.z-r.z)},f.prototype.Ag=function(r){new f(this.x*r,this.y*r,this.z*r)},f.prototype.Qh=function(r){return this.x*r.x+this.y*r.y+this.z*r.z},f}();e.Nd=v}(k||(k={})),function(e){var v=function(){function f(r,n,t){this.Gw=this.DA=null,this.Xf=n,this.FT=n.y-t,this.ET=n.y+t,this.Ew=0,this.dA=r,this.qa=t,this.RT=t*t,this.eA=t!=0,this.Lv=!1}return f.prototype.result=function(){return this.Ew!=0?1:0},f.prototype.ZM=function(r){return r=r.hc(r.fe(this.Xf,!1)),e.h.yc(r,this.Xf)<=this.RT},f.prototype.fF=function(r){if(!this.eA&&(this.dA&&this.Xf.qb(r.ac())||this.Xf.qb(r.wc())))this.Lv=!0;else if(r.na==this.Xf.y&&r.na==r.la){if(this.dA&&!this.eA){var n=Math.max(r.sa,r.pa);this.Xf.x>Math.min(r.sa,r.pa)&&this.Xf.xn?t=!0:this.Xf.x>=Math.min(r.sa,r.pa)&&(t=0r.wc().y?1:-1)}}},f.prototype.SI=function(r){var n=r.Tg(0,1);if(n.oa>this.ET||n.vathis.Xf.y||n.va(r=r.I()))&&2*r+Math.log(r)/Math.log(2)*n<1*r*n},f}();e.Dg=v}(k||(k={})),function(e){var v=function(f){function r(n){return f.call(this,!0,n)||this}return J(r,f),r.prototype.Ia=function(){return new r(this.description)},r.prototype.Db=function(){return 2},r.prototype.getType=function(){return 1736},r.prototype.xG=function(n,t,i){this.JS(n,t,i)},r.prototype.qR=function(){this.FR()},r}(e.Vk);e.Da=v}(k||(k={})),function(e){(function(v){v[v.PiPOutside=0]="PiPOutside",v[v.PiPInside=1]="PiPInside",v[v.PiPBoundary=2]="PiPBoundary"})(e.RL||(e.RL={})),e.hd=function(){function v(){}return v.KG=function(f,r,n){return(f=e.Dg.bT(f,r,n))==0?0:f==1?1:2},v.Yd=function(f,r,n){return(f=e.Dg.wm(f,r,n))==0?0:f==1?1:2},v.WX=function(f,r,n,t,i){if(r.lengthr?(0>r?r+=360:360<=r&&(r-=360),r):(0>(r=e.lc.RK(r))&&(r+=360),r)},f.gP=function(r){return 180<(r=f.hP(r))&&(r-=360),r},f.oW=57.29577951308232,f}();e.qr=v,e.Hh=function(){function f(){}return f.lj=function(r,n){var t=new e.l;r.A(t);var i=e.cb.gh(n),h=new e.l;return h.K(i),h.v=t.v,h.C=t.C,h.W(.01*h.ca(),0),n=e.ta.Wd(n,t,!1),h.contains(t)?r:e.Ud.clip(r,h,n,0)},f.ks=function(r,n,t,i,h){if(!e.cb.Wc(n))throw e.i.N();var s=e.ta.kj(n,r,!1),o=e.cb.gh(n),a=e.cb.sc(n),u=a.Hd().ai,c=e.cb.vv(a);a=e.cb.ev(a),c*=2-c;var l=new e.Nc;o.cn(l);var p=[[0,0],[0,0]];if(e.Eg.Sb(n)==2?i?(p[0][0]=f.Zm(h,l),p[0][1]=o.Jp(),e.cb.vt(),o=p[0][0]*u):(p[0][0]=o.gk(),p[0][1]=h,e.cb.vt(),o=p[0][1]*u):o=h*u,!i&&o!=0)throw e.i.N();var y=new e.ga,d=new e.gd;r=d.Ib(r);for(var g=[0],b=new e.h,x=new e.h,m=new e.h,w=new e.h,j=new e.h,M=new e.h,A=d.Ob(r);A!=-1;A=d.Rb(A)){var z=d.Xa(A);d.D(z,m);for(var N=!1,I=z=d.U(z);I!=-1;I=d.U(I)){if(I==z){if(N)break;N=!0}if(d.D(I,w),i&&ss||ss||!i&&s<-m.y&&w.y>s||s<-w.y&&m.y>s)do if(!(Math.abs(m.x-w.x)>=.5*l.R())){if(e.Eg.Sb(n)==2?(p[0][0]=f.Zm(m.x,l),p[0][1]=m.y,p[1][0]=f.Zm(w.x,l),p[1][1]=w.y,e.cb.dW(),j.x=p[0][0]*u,j.y=p[0][1]*u,M.x=p[1][0]*u,M.y=p[1][1]*u):(j.x=m.x*u,j.y=m.y*u,M.x=w.x*u,M.y=w.y*u),M.x=6.283185307179586*(w.x-m.x)/l.R()+j.x,i){if(x.x=o,x.y=f.Nz(a,c,j,M,o,t),isNaN(x.y))break}else{if(x.x=f.Lz(a,c,j,M,t),isNaN(x.x))break;x.y=0}e.kb.wd(a,c,j.x,j.y,M.x,M.y,y,null,null,t);var C=y.u;e.kb.wd(a,c,j.x,j.y,x.x,x.y,y,null,null,t);var T=y.u;e.Eg.Sb(n)==2?(p[0][0]=x.x/u,p[0][1]=x.y/u,e.cb.bR(),i?(b.y=p[0][1],b.x=h):(b.x=f.os(p[0][0],m.x,w.x,l),b.y=h)):i?(b.x=h,b.y=x.y/u):(b.x=f.os(x.x/u,m.x,w.x,l),b.y=h),g[0]=0i.x)var o=i;else o=t,t=i;i=new e.ga(0);var a=new e.ga(0),u=new e.ga(0);e.kb.wd(r,n,o.x,o.y,t.x,t.y,a,i,null,s);var c=a.u,l=0,p=1,y=new e.h;for(y.L(o);c*(p-l)>1e-12*r;){var d=.5*(l+p);if(e.kb.oj(r,n,o.x,o.y,c*d,i.u,a,u,s),y.x=a.u,y.y=u.u,y.x==h)break;if(f.Sn(o.x,y.x,h))p=d;else{if(!f.Sn(t.x,y.x,h))return NaN;l=d}}return y.y},f.Sn=function(r,n,t){return r=v.Cp(r),n=v.mx(r,v.Cp(n)),(t=v.mx(r,v.Cp(t)))==0||0n&&0>t&&t>=n},f.Zm=function(r,n){var t=n.va-n.oa;return n.It(r-Math.floor((r-n.oa)/t)*t)},f.os=function(r,n,t,i){var h=new e.Nc;for(h.K(n,t),t=i.R(),r=Math.floor((r-n)/t)*t+r,h=h.sf();Math.abs(r-h)>Math.abs(r+t-h);)r+=t;return r},f.Lz=function(r,n,t,i,h){if(t.y>i.y)var s=i;else s=t,t=i;if((i=new e.Nc).K(s.y,t.y),!i.contains(0)||3.141592653589793<=Math.abs(s.x-t.x))return NaN;if(s.x==t.x)return s.x;var o=new e.ga(0),a=new e.ga(0),u=new e.ga(0);e.kb.wd(r,n,s.x,s.y,t.x,t.y,a,o,null,h);var c=a.u,l=0,p=1,y=new e.h;for(y.L(s);c*(p-l)>1e-12*r;){var d=.5*(l+p);if(e.kb.oj(r,n,s.x,s.y,c*d,o.u,a,u,h),y.x=a.u,y.y=u.u,i.K(s.y,y.y),y.y==0)break;if(i.contains(0))p=d;else{if(i.K(t.y,y.y),!i.contains(0))return NaN;l=d}}return y.x},f.Hp=function(r,n,t,i,h,s,o){var a=new e.l;if(r.A(a),a.B())return r;var u=new e.Nc;a.cn(u);var c=new e.Nc;if(c.K(n,n+t),c.contains(u)&&c.va!=u.va)return r;var l=new e.l;l.K(a);var p=r.getType();if(p==33)return((a=(l=h?r:r.Of()).Lg())=c.va||o&&a==c.va)&&(a+=Math.ceil((c.oa-a)/t)*t,a=c.It(a),l.cC(a)),l;if(p==550){for(i=(l=h?r:r.Of()).ub(0),p=2*l.I(),r=!1,h=0;h=c.va||o&&a==c.va)&&(r=!0,a+=Math.ceil((c.oa-a)/t)*t,a=c.It(a),i.write(h,a));return r&&l.Pc(1993),l}if(c.contains(u))return r;if(p==197)return t=h?r:r.Of(),a.Ea(l),t.Xo(a),t;var y=.1*Math.max(a.ca(),a.R());for(l.W(0,y),o=r,c=i.Xd(0),r=e.Gh.local(),h=new e.Dd;;){var d=Math.floor((u.oa-n)/t),g=Math.ceil((u.va-n)/t);if(!(3l.v;)(y=e.Ud.clip(o,l,c,0)).A(u),(p==1607?!y.B()&&(u.R()>c||u.ca()>c):!y.B()&&(p!=1736||u.R()>c))&&(y.Oc(h),y.A(u),n.A(s),s.W(c,c),s.isIntersecting(u)&&p==1736?n=r.V(n,y,i,null):n.add(y,!1)),l.move(t,0),h.shift(-t,0);return n},f.WI=function(r,n,t,i){var h=new e.de(t.description);h.Fd(t,0,-1),h=e.cb.zh(h,r,n);var s=t.I();if(i.Oa(),!e.cb.Wc(r)||s!=h.I())return!1;var o=new e.l;t.A(o);var a=new e.l;if(h.A(a),o=o.R(),a=a.R(),o!=0&&a!=0){if(a/=o,r=e.cb.gh(n).R()/e.cb.gh(r).R(),1e-10=t[h]?i[h]=t[h].toUpperCase():t[h];return i.join()}return t.toString(e.Sc.PE_STR_AUTH_TOP)},n.ur=function(t,i,h,s){var o=s.length,a=h.I();if(a!=0){var u=h.ub(0),c=Math.min(a,o),l=0,p=t.eh();isNaN(i)&&(i=0);for(var y=t.Wc(),d=179*(t=y?t.sc().Oe().R():0)/360;0x*e.lc.sign(m)&&Math.abs(b)>d&&(s[g][0]+=-x*t)}u.uC(l<<1,c,s),l+=c,a-=c,c=Math.min(a,o)}h.Pc(1993)}},n.IL=function(t,i,h,s){var o=0,a=t.eh();isNaN(o)&&(o=0);var u=t.Wc(),c=t.bf();t=360*c,c*=179;for(var l=s.length,p=0;pm*e.lc.sign(b)&&Math.abs(x)>c&&(s[y][0]-=m*t)}e.ta.Iy(i,p,s,d),p+=d}}},n.Lx=function(t,i,h){var s=h.length,o=i.I();if(!(1>o)){var a=i.ub(0),u=Math.min(o,s),c=0,l=t.eh(),p=t.Wc(),y=p?t.Oe().R():0,d=179*y/360,g=0;for(p&&(g=t.zi());0x*e.lc.sign(m)&&Math.abs(b)>d&&(h[t][0]+=-x*y)}a.uC(c<<1,u,h),c+=u,o-=u,u=Math.min(o,s)}i.Pc(1993)}},n.HL=function(t,i,h,s){if(h!=0){var o=t.eh(),a=t.Wc(),u=a?t.Oe().R():0,c=179*u/360,l=0;for(a&&(l=t.zi()),t=0;tb*e.lc.sign(i[d].x-l)&&Math.abs(g)>c&&(s[p][0]-=b*u)}e.ta.Iy(i,t,s,y),t+=y}}}},n.tr=function(t,i,h,s){var o=i.I();if(o!=0){var a=i.ub(0),u=t.ef,c=t.Yf,l=u.sc().Qp(),p=c.sc().Qp(),y=u.bf(),d=c.bf();if((t=t.Wf)==null||t.count()==0){for(h=l/p,s=(u.Up()-c.Up())*d,p=-90*y,t=90*y,l=!1,d=1,u=2*o;dw?s[d][1]=w:s[d][1]<-w&&(s[d][1]=-w));for(y=0;yd){if(A){var V=I+(W+11*y&&(A=!1)}A||(S=K+(D-=e.lc.Cn(p,S-B)),++E,$=D!=0,R.x=S)}else G||e.ta.AG(U,H,R,N)&&(G=!0);$&&C.write(2*W,S),B=S,U.L(H),H.L(R)}0t?u=1:0>=c&&0.99*c&&(u=-1)):u=-1),u!=0&&((i=new e.Da(o.description)).tp(l),(i=e.Xl.local().V(i,h,a)).add(o,!1),w=!0,o=i),w&&(o=e.Yl.local().V(o,s,!1,a)),o},n.vQ=function(t,i,h,s,o){var a=h.I(),u=h.Na(0),c=h.Na(a-1);o=(s=n.dv(s,o)).R(),u=e.lc.sign(c.x-u.x);var l=new e.l;h.xc(l);var p=s.gk();if(c=p-o,p+=o,0<=u){var y=Math.ceil((c-l.v)/o);for(y*=o;c>l.v+y;)y+=o;for(;cl.v+y;)y+=o;d=y,720c;)1024<=m&&(m=0),g.move(y,0),b.Gb=y,h.Oc(b),x+=y,s.v<=x&&s.C>=x&&(o=l.I()-1),h.Cb(0,d),d=h.Na(a-1),l.Dr(h,0,0,a-1,!1);return h=new e.Da(l.description),a=0u?a:!a)?(u=e.h.construct(c.x,s.H),h.Ci(u),u=e.h.construct(s.gk(),s.H),h.Ci(u),s=e.h.construct(t.x,s.H)):(u=e.h.construct(c.x,s.G),h.Ci(u),u=e.h.construct(s.gk(),s.G),h.Ci(u),s=e.h.construct(t.x,s.G)),h.Ci(s),h.xG(0,i,0),h.kO(o),h},n.uQ=function(t,i,h,s,o){var a=new e.Da(t.description);a.add(t,!1),a.DB(0,a.I()-1);var u=new e.l;a.xc(u);var c=(h=n.dv(i,h)).R(),l=Math.ceil((h.v-u.v)/c);for(l*=c;h.v>u.v+l;)l+=c;for(;h.vu.C)return o&&(o=a.Ke(),i=(a=e.Yl.local().V(a,i,!0,s)).Ke(),(i=e.lc.sign(o)!=e.lc.sign(i))&&a.oJ()),a;for((t=new e.Da(t.description)).add(a,!1),o=o||u.R()>c-i.Xd(0);u.v=h){c=!0;break}if(2&o&&p.y<=-h){c=!0;break}}if(!c)return!1;a=!1,t&&(a=i.Nn(0)),u=(t=new e.gd).Ib(i),c=t.Ob(u);var y=-1,d=!0,g=new e.h;g.Rc(),l=new e.Sa;for(var b=-1,x=t.Xa(c);x!=-1;x=t.U(x)){p=t.Na(x);var m=1&o&&90<=p.y?1:0;if(m|=2&o&&p.y<=-h?2:0,0c){if(new e.l().K(g.v-u,-c,g.C+u,c),(o=e.ri.Nu(o,i,t,NaN,0,s)).B())return o;o.A(g)}if(x&&(i.Hg.H))return o.Ia();if(g.R()>p&&(o=n.Hp(o,y-l,p,t,!0,0,!0,s)).A(g),(c=n.eO(g.v,g.C,i.v,i.C,p))!=0&&g.move(c,0),g.C>i.C||g.vi.C)for(;g.v>=i.C;)g.move(-p,0),c-=p;for(;g.vc;c++){if(m?u=e.aa.Hc(a)?e.ri.clip(o,i,h,d,s):e.ri.clip(o,i,h,0,s):(u=e.Xj.local().V(o,b,t,s))==b&&(u=e.aa.jg(u)),i.v<=g.v&&i.C>=g.C||i.v>=g.v&&i.C<=g.C)return u;x[c]=u,c==0&&(g.move(-p,0),(u=new e.Dd).gg(-p,0),o.Oc(u))}if(a==550)x[0].Fd(x[1],0,-1);else if(e.aa.Hc(a))x[0].add(x[1],!1);else{if(a!=33)throw e.i.fa("intersect_with_GCS_horizon: unexpected geometry type");x[0].B()&&(x[0]=x[1])}return x[0]}if(i.Hg.H)return o;for(a=0;!o.B()&&g.C>i.v;)a!=0&&((u=new e.Dd).gg(a,0),o.Oc(u)),e.dj.local().V(4,o,b,t,s)||b==(o=e.kp.local().V(o,b,t,s))&&(o=e.aa.jg(o)),a!=0&&((d=new e.Dd).gg(-a,0),o.Oc(d)),a-=p,g.move(-p,0);return o},n.yG=function(t,i,h,s){if(i!=0&&s!=v.DontClip)if(s==v.PannableFold){s=h.HR();for(var o=i,a=0;as.H||t[a].yu||t[a].y<-u)&&(t[a].Rc(),o--);if(o!=0){(o=new e.l).Zw(t,i),u=h.Vr();var l=h.hv();a=u.getType()==197;var p=new e.l;if(u.A(p),!l||!(p.Ho.H))if(l)if(n.av(t,i,p.gk()-c,s),o=i,a)for(a=0;a=p||u&&y==p)&&(y+=Math.ceil((i-y)/h)*h,y=e.O.Rk(y,i,p),s.cC(y)),s}if(t.B()||(y=new e.l,t.A(y),y.B()))return t;var d=new e.Nc;y.cn(d);var g=new e.Nc;if(g.K(i,p),g.contains(d))return t;if((p=new e.l).K(y),l===550){for(c=(s=o?t:t.Of()).ub(0),l=2*s.I(),p=!1,i=0;i=g.va||u&&y==g.va)&&(p=!0,y+=Math.ceil((g.oa-y)/h)*h,y=g.It(y),c.write(i,y));return p&&s.Pc(1993),s}if(l==197)return h=o?t:t.Of(),y.Ea(p),h.Xo(y),h;var b=.1*Math.max(y.ca(),y.R());for(p.W(0,b),u=t,g=s.Xd(0),t=e.Gh.local(),o=new e.Dd;;){var x=Math.floor((d.oa-i)/h),m=Math.ceil((d.va-i)/h);if(!(3p.v;)(b=e.ri.clip(u,p,g,0,c)).A(d),(l==1607?!b.B()&&(d.R()>g||d.ca()>g):!b.B()&&(l!=1736||d.R()>g))&&(b.Oc(o),b.A(d),i.A(a),a.W(g,g),a.isIntersecting(d)&&l==1736?i=t.V(i,b,s,null):i.add(b,!1)),p.move(h,0),o.shift(-h,0);return i},n.av=function(t,i,h,s){for(var o=h+s,a=0;ao||u==o)||(u+=Math.ceil((h-u)/s)*s,u=e.O.Rk(u,h,o),t[a].x=u)}},n.Fn=function(t,i,h,s,o,a){if(!i.Wc())throw e.i.fa("fold_into_360_degree_range");if(t.B())return t;if(i.Sb()==2){h=i.pv();var u=i.ov()-h}else{var c=i.bf();u=360*c,h-=180*c}return n.Hp(t,h,u,i,s,o,!0,a)},n.qF=function(t,i,h,s){if(h.Sb()==2)s=h.pv(),h=h.ov()-s;else{var o=h.bf();h=360*o,s-=180*o}n.av(t,i,s,h)},n.lj=function(t,i){var h=i.Oe();if(t.getType()==33){var s=t.ih();return h.G<=s&&s<=h.H?t:t.Ia()}s=new e.l,t.A(s);var o=new e.l;return o.K(h),o.v=s.v,o.C=s.C,o.W(.01*o.ca(),0),h=e.ta.uy(i,s),o.contains(s)?t:e.ri.clip(t,o,h,0,null)},n.ir=function(t,i,h){return t>i.C&&t-i.Ch.H?t[o].Rc():t[o].x=n.ir(t[o].x,h,s)},n.Jt=function(t,i,h,s){if(!t.B()){var o=t.getType();if(!s||o!=1736)if(e.aa.xj(o)){s=t.ub(0),o=0;for(var a=t.I();os||ss)||!a&&(u!=0||s<-z.y&&N.y>s||s<-N.y&&z.y>s))do if(!(Math.abs(z.x-N.x)>=.5*d.R())){if(h.Sb()==2?(b[0][0]=n.Zm(z.x,d),b[0][1]=z.y,b[1][0]=n.Zm(N.x,d),b[1][1]=N.y,e.ej.projToGeogCenter(g,2,b,0),I.x=b[0][0]*l,I.y=b[0][1]*l,C.y=b[1][1]*l):(I.x=z.x*l,I.y=z.y*l,C.y=N.y*l),C.x=2*(N.x-z.x)*Math.PI/d.R()+I.x,a){if(j.x=c,j.y=n.Nz(p,y,I,C,c,o),isNaN(j.y))break;A[0]=j;var E=1}else if(o==r.GreatElliptic){var G=[0,0];if((E=e.Ox.Oz(y,I,C,c,G))==0)break;j.x=G[0],j.y=c,A[0]=j,E==2&&(M.x=G[1],M.y=c,A[1]=M)}else{if(j.x=n.Lz(p,y,I,C,o),isNaN(j.x))break;j.y=0,A[0]=j,E=1}var H=-1;for(G=0;Gm[0]||(H=t.Ma(B),t.Ul(H,m,1),t.Cb(t.U(H),w.x,w.y),H=m[0])}}while(!1);z.L(N)}}},n.Zm=function(t,i){var h=i.va-i.oa;return i.It(t-Math.floor((t-i.oa)/h)*h)},n.os=function(t,i,h,s){var o=new e.Nc;for(o.K(i,h),h=s.R(),t=Math.floor((t-i)/h)*h+t,o=o.sf();Math.abs(t-o)>Math.abs(t+h-o);)t+=h;return t},n.Sn=function(t,i,h){return t=e.qr.Cp(t),i=e.qr.mx(t,e.qr.Cp(i)),(h=e.qr.mx(t,e.qr.Cp(h)))==0||0i&&0>h&&h>=i},n.Nz=function(t,i,h,s,o,a){if(a==r.GreatElliptic)return e.Ox.SS(i,h,s,o);if(Math.abs(h.x-s.x)>=Math.PI||!n.Sn(h.x,s.x,o))return NaN;if(h.x>s.x)var u=s;else u=h,h=s;s=new e.ga;var c=new e.ga,l=new e.ga;e.kb.wd(t,i,u.x,u.y,h.x,h.y,c,s,null,a);var p=c.u,y=0,d=1,g=new e.h;for(g.L(u);p*(d-y)>1e-12*t;){var b=.5*(y+d);if(e.kb.oj(t,i,u.x,u.y,p*b,s.u,c,l,a),g.x=c.u,g.y=l.u,g.x==o)break;if(n.Sn(u.x,g.x,o))d=b;else{if(!n.Sn(h.x,g.x,o))return NaN;y=b}}return g.y},n.Lz=function(t,i,h,s,o){if(o==r.GreatElliptic)return t=[0,0],e.Ox.Oz(i,h,s,0,t),t[0];if(h.y>s.y)var a=s;else a=h,h=s;if((s=new e.Nc).K(a.y,h.y),!s.contains(0)||Math.abs(a.x-h.x)>=Math.PI)return NaN;if(a.x==h.x)return a.x;var u=new e.ga,c=new e.ga,l=new e.ga;e.kb.wd(t,i,a.x,a.y,h.x,h.y,c,u,null,o);var p=c.u,y=0,d=1,g=new e.h;for(g.L(a);p*(d-y)>1e-12*t;){var b=.5*(y+d);if(e.kb.oj(t,i,a.x,a.y,p*b,u.u,c,l,o),g.x=c.u,g.y=l.u,s.K(a.y,g.y),g.y==0)break;if(s.contains(0))d=b;else{if(s.K(h.y,g.y),!s.contains(0))return NaN;y=b}}return g.x},n.WI=function(t,i,h,s){if(!t.ef.Wc())return!1;var o=new e.de(i.description);if(o.Fd(i,0,-1),s=e.Hx.local().V(o,t,s),o=i.I(),h.Oa(),o!=s.I())return!1;var a=new e.l;i.A(a);var u=new e.l;if(s.A(u),a=a.R(),u=u.R(),a!=0&&u!=0){if(u/=a,t=t.Yf.gh().R()/t.ef.gh().R(),1e-10=180*i&&(t-=360*i),t},n.UI=function(t,i,h,s){if(h==v.Clip){var o=i.ml();o.getType()==197?(h=new e.l,o.A(h),o=e.ta.uy(i,h),t=e.ri.clip(t,h,o,5e4*i.pm(),s)):e.dj.local().V(1,o,t,i,s)||(t=e.Xj.local().V(t,o,i,s))==o&&(t=e.Vk.jg(t))}else i.Wc()&&(s=new e.l,t.xc(s),i.Oe().contains(s)||(n.Jt(t,i.Oe(),i.Xd(0),!0),h==v.PannableFold&&(t=n.lj(t,i)),t=n.Fn(t,i,0,!0,1e5*i.pm(),null)));return t},n.XD=function(t,i,h){var s=i.Wr();if(s==null)return t;var o=(i=i.sc()).Oe().R(),a=new e.l;t.xc(a);var u=new e.Nc;a.cn(u),a=s.Ga(),s=null;for(var c=new e.Dd;a.$a();)for(;a.Ha();){var l=a.ha(),p=l.Tg(0,0),y=new e.Nc;for(y.K(p.oa,p.va),p=0;y.va>u.oa;)y.move(-o),--p;for(;y.oa<=u.va;){if(y.isIntersecting(u)){s==null&&(s=new e.Ta);var d=e.yb.cP(l.ac(),l.wc());p!=0&&(c.gg(p*o,0),d.Oc(c)),s.oc(d,!0)}y.move(o),++p}}return s!=null?(i=e.ta.gO(i,s),i=e.ta.Er(i),e.$t.lP(t,s,i,h)):t},n.eO=function(t,i,h,s,o){return t>=h&&i<=s?0:n.tE(.5*(i+t),h,s,o)},n.tE=function(t,i,h,s){return e.lc.round((.5*(h+i)-t)/s)*s},n.VQ=function(t,i,h,s,o,a,u,c){var l=n.dv(s,o),p=l.R(),y=p/360,d=n.pE*y,g=t.ub(0),b=i.Wc(),x=b?p/i.Oe().R():0;i=t.Ia();for(var m=0,w=h.da();md){if(j){var X=z+$-1,V=z;(!N||$+11*y&&(b=!1)}j||(K=R+(C-=e.lc.Cn(p,K-T)),++D,U=C!=0,W.x=K)}else E||e.ta.AG(G,H,W,B)&&(E=!0);U&&I.write(2*$,K),T=K,G.L(H),H.L(W)}D!=0&&M.Pc(1993),j=M.Na(0),A=M.Na(A-1),e.h.tb(j,A),M=n.wQ(M,s,isNaN(o)?0:o,a),i.add(M,!1)}return t=s.Xd(0),h=l.R()/180,n.Jt(i,l,.1*t,!1),e.ri.clip(i,l,t,h,a)},n.wQ=function(t,i,h,s){return n.Fn(t,i,h,!0,0,s)},n.OS=function(t,i,h,s){var o=t.getType();if(o==1736)for(i=i!=null?i.Xd(0):0,o=0;oh)for(var o=new e.Sa,a=0;ah)for(var o=new e.Sa,a=0;athis.Io},r.prototype.fz=function(){if(this.B())throw e.i.fa("invalid call");return new e.Sa(this.Bs.x,this.Bs.y)},r.prototype.Ua=function(){if(this.B())throw e.i.fa("invalid call");return this.Io},r.prototype.hz=function(){if(this.B())throw e.i.fa("invalid call");return this.Ka},r.prototype.Sz=function(){return(1&this.nw)!=0},r.prototype.ey=function(n,t,i,h){this.Bs.x=n,this.Bs.y=t,this.Io=i,this.Ka=h},r}();e.$l=f}(k||(k={})),function(e){var v=function(){function r(){}return r.prototype.Uo=function(n,t){if(this.th.resize(0),this.Ii.length=0,this.tk=-1,n.xc(this.Ek),this.Ek.W(t,t),this.Ek.isIntersecting(this.Fb.Ca)){var i=n.getType();(this.vs=e.aa.yd(i))?(this.TH=n.ac(),this.SH=n.wc(),this.qa=t):this.qa=NaN,this.th.add(this.Fb.kf),this.Ii.push(this.Fb.Ca),this.Qs=this.Fb.Ur(this.Fb.kf)}else this.Qs=-1},r.prototype.Xi=function(n,t){this.th.resize(0),this.Ii.length=0,this.tk=-1,this.Ek.K(n),this.Ek.W(t,t),this.qa=NaN,this.Ek.isIntersecting(this.Fb.Ca)?(this.th.add(this.Fb.kf),this.Ii.push(this.Fb.Ca),this.Qs=this.Fb.Ur(this.Fb.kf),this.vs=!1):this.Qs=-1},r.prototype.next=function(){if(this.th.size==0)return-1;this.tk=this.Qs;var n=null,t=null,i=null,h=null;this.vs&&(n=new e.h,t=new e.h,i=new e.l);for(var s=!1;!s;){for(;this.tk!=-1;){var o=this.Fb.bz(this.Fb.fv(this.tk));if(o.isIntersecting(this.Ek)){if(!this.vs){s=!0;break}if(n.L(this.TH),t.L(this.SH),i.K(o),i.W(this.qa,this.qa),0a;a++){var u=this.Fb.Lp(o,a);if(u!=-1&&0>h);s==0?(t.v=.5*(t.v+t.C),t.G=.5*(t.G+t.H)):s==1?(t.C=.5*(t.v+t.C),t.G=.5*(t.G+t.H)):(s==2?t.C=.5*(t.v+t.C):t.v=.5*(t.v+t.C),t.H=.5*(t.G+t.H))}return t},r.prototype.WR=function(n){return this.Az(n)},r.prototype.vR=function(n,t){return v.bP(this,n,t)},r.prototype.MF=function(n,t){return v.aP(this,n,t)},r.prototype.getIterator=function(){return v.$O(this)},r.prototype.Nk=function(n,t){if(0>t||32<2*t)throw e.i.N("invalid height");this.BT=t,this.Ca.K(n),this.kf=this.jf.Ce(),this.jx(this.kf,0),this.ax(this.kf,0),this.NJ(this.kf,0),this.KJ(this.kf,0)},r.prototype.zv=function(n,t,i,h,s,o,a){if(!h.contains(t))return i==0?-1:this.zv(n,t,0,this.Ca,this.kf,o,a);if(!o)for(var u=s;u!=-1;u=this.IR(u))this.jx(u,this.Az(u)+1);(u=new e.l).K(h),h=s;var c=[];for(c[0]=new e.l,c[1]=new e.l,c[2]=new e.l,c[3]=new e.l;ip;p++)if(c[p].contains(t)){l=!0;var y=this.Lp(h,p);y==-1&&(y=this.rP(h,p)),this.jx(y,this.Az(y)+1),h=y,u.K(c[p]);break}if(!l)break}return this.sS(n,t,i,u,h,o,s,a)},r.prototype.sS=function(n,t,i,h,s,o,a,u){var c=this.NF(s);if(o){if(s==a)return u;this.SP(u),o=u}else o=this.tP(),this.NB(o,n),this.KW(this.fv(o),t);return this.mX(o,s),c!=-1?(this.hx(o,c),this.bx(c,o)):this.GJ(s,o),this.SB(s,o),this.ax(s,this.lv(s)+1),this.hO(s)&&this.MQ(i,h,s),o},r.prototype.SP=function(n){var t=this.WF(n),i=this.NF(t),h=this.OR(n),s=this.nv(n);this.Ur(t)==n?(s!=-1?this.hx(s,-1):this.SB(t,-1),this.GJ(t,s)):i==n?(this.bx(h,-1),this.SB(t,h)):(this.hx(s,h),this.bx(h,s)),this.hx(n,-1),this.bx(n,-1),this.ax(t,this.lv(t)-1)},r.EJ=function(n,t){var i=.5*(n.v+n.C),h=.5*(n.G+n.H);t[0].K(i,h,n.C,n.H),t[1].K(n.v,h,i,n.H),t[2].K(n.v,n.G,i,h),t[3].K(i,n.G,n.C,h)},r.prototype.hO=function(n){return this.lv(n)==8&&!this.gG(n)},r.prototype.MQ=function(n,t,i){var h=this.Ur(i);do{var s=this.fv(h),o=this.Zh.T(h,0);s=this.bz(s),this.zv(o,s,n,t,i,!0,h),h=o=this.nv(h)}while(h!=-1)},r.prototype.iO=function(n){return 8<=this.lv(n)||this.gG(n)},r.prototype.gG=function(n){return this.Lp(n,0)!=-1||this.Lp(n,1)!=-1||this.Lp(n,2)!=-1||this.Lp(n,3)!=-1},r.prototype.rP=function(n,t){var i=this.jf.Ce();return this.OW(n,t,i),this.jx(i,0),this.ax(i,0),this.Pk(i,n),this.KJ(i,this.jv(n)+1),this.NJ(i,t<<2*this.jv(n)|this.QF(n)),i},r.prototype.tP=function(){var n=this.Zh.Ce();if(0>4)]|=this.iH<<2*(15&s)},n}();e.HY=f;var r=function(){function n(t,i,h){this.Vh=null,this.SA=this.Ik=this.cI=this.aI=this.Es=this.qH=this.Gf=this.Um=0,this.Ri=this.Jk=this.vl=null,this.Fz(t,i,h)}return n.create=function(t,i,h){if(!n.zE(t))throw e.i.N();return n.wP(t,i,h)},n.pW=function(t){switch(t){case 0:t=1024;break;case 1:t=16384;break;case 2:t=262144;break;default:throw e.i.fa("Internal Error")}return t},n.zE=function(t){return!(t.B()||t.getType()!=1607&&t.getType()!=1736)},n.prototype.rQ=function(t,i){i=i.Ga();for(var h=new e.h,s=new e.h;i.$a();)for(;i.Ha();){var o=i.ha();if(o.getType()!=322)throw e.i.fa("Internal Error");t.Eh(o.ac(),h),t.Eh(o.wc(),s),this.Ri.jy(h.x,h.y,s.x,s.y)}this.Ri.iJ(e.Px.Cx)},n.prototype.sQ=function(){throw e.i.fa("Internal Error")},n.prototype.Ry=function(t,i){for(var h=1;4>h;h++)t.jy(i[h-1].x,i[h-1].y,i[h].x,i[h].y);t.jy(i[3].x,i[3].y,i[0].x,i[0].y),this.Ri.iJ(e.Px.Cx)},n.prototype.rK=function(t,i,h){for(var s=[null,null,null,null],o=0;o(b=o.length());b==0?o.ma(1,0):(x||y.L(l),o.scale(h/b),a.ma(-o.y,o.x),u.ma(o.y,-o.x),c.sub(o),l.add(o),s[0].add(c,a),s[1].add(c,u),s[2].add(l,u),s[3].add(l,a),x?d=!0:this.Ry(t,s))}else d&&(this.Ry(t,s),d=!1),g=!0}d&&this.Ry(t,s)}},n.prototype.sC=function(t){return e.O.truncate(t*this.qH+this.aI)},n.prototype.tC=function(t){return e.O.truncate(t*this.Es+this.cI)},n.wP=function(t,i,h){return new n(t,i,h)},n.prototype.Fz=function(t,i,h){this.Gf=Math.max(e.O.truncate(2*Math.sqrt(h)+.5),64),this.Um=e.O.truncate((2*this.Gf+31)/32),this.vl=new e.l,this.Ik=i,h=0;for(var s=this.Gf,o=this.Um;8<=s;)h+=s*o,s=e.O.truncate(s/2),o=e.O.truncate((2*s+31)/32);this.Vh=e.O.lg(h,0),this.Ri=new e.Px,h=new f(this.Vh,this.Um,this),this.Ri.AX(this.Gf,this.Gf,h),t.A(this.vl),this.vl.W(i,i),s=new e.l;var a=i*(o=e.l.construct(1,1,this.Gf-2,this.Gf-2)).R();switch(i*=o.ca(),s.K(this.vl.sf(),Math.max(a,this.vl.R()),Math.max(i,this.vl.ca())),this.SA=this.Ik,this.Jk=new e.Dd,this.Jk.pS(s,o),new e.Dd,t.getType()){case 550:h.setColor(this.Ri,2),this.sQ();break;case 1607:h.setColor(this.Ri,2),this.rK(this.Ri,t,this.SA);break;case 1736:h.setColor(this.Ri,1),this.rQ(this.Jk,t),h.setColor(this.Ri,2),this.rK(this.Ri,t,this.SA)}this.qH=this.Jk.bb,this.Es=this.Jk.ab,this.aI=this.Jk.Gb,this.cI=this.Jk.Lb,this.XN()},n.prototype.XN=function(){this.Ri.flush();for(var t=0,i=this.Gf*this.Um,h=this.Gf,s=e.O.truncate(this.Gf/2),o=this.Um,a=e.O.truncate((2*s+31)/32);8>4;p=2*(15&p);var g=y>>4;y=2*(15&y);var b=this.Vh[t+o*u+d]>>p&3;b|=this.Vh[t+o*u+g]>>y&3,b|=this.Vh[t+o*c+d]>>p&3,b|=this.Vh[t+o*c+g]>>y&3,this.Vh[i+a*h+(l>>4)]|=b<<2*(15&l)}h=s,o=a,t=i,s=e.O.truncate(h/2),a=e.O.truncate((2*s+31)/32),i=t+o*h}},n.prototype.So=function(t,i){return this.vl.contains(t,i)?(t=this.sC(t),i=this.tC(i),0>t||t>=this.Gf||0>i||i>=this.Gf||(i=this.Vh[this.Um*i+(t>>4)]>>2*(15&t)&3)==0?0:i==1?1:2):0},n.prototype.Ro=function(t){if(!t.Ea(this.vl))return 0;var i=this.sC(t.v),h=this.sC(t.C),s=this.tC(t.G);if(t=this.tC(t.H),0>i&&(i=0),0>s&&(s=0),h>=this.Gf&&(h=this.Gf-1),t>=this.Gf&&(t=this.Gf-1),i>h||s>t)return 0;for(var o=Math.max(h-i,1)*Math.max(t-s,1),a=0,u=this.Um,c=this.Gf,l=0;;){if(32>o||16>c){for(o=s;o<=t;o++)for(var p=i;p<=h;p++)if(1<(l=this.Vh[a+u*o+(p>>4)]>>2*(15&p)&3))return 2;if(l==0)return 0;if(l==1)return 1}a+=u*c,c=e.O.truncate(c/2),u=e.O.truncate((2*c+31)/32),i=e.O.truncate(i/2),s=e.O.truncate(s/2),h=e.O.truncate(h/2),t=e.O.truncate(t/2),o=Math.max(h-i,1)*Math.max(t-s,1)}},n.prototype.RR=function(){return this.Gf*this.Um},n}();e.Nx=r}(k||(k={})),function(e){var v;(v=e.VL||(e.VL={}))[v.contains=1]="contains",v[v.within=2]="within",v[v.equals=3]="equals",v[v.disjoint=4]="disjoint",v[v.touches=8]="touches",v[v.crosses=16]="crosses",v[v.overlaps=32]="overlaps",v[v.unknown=0]="unknown",v[v.intersects=1073741824]="intersects";var f=function(){function n(){}return n.construct=function(t,i,h,s,o,a,u,c){var l=new n;return l.pw=t,l.Mm=i,l.Kj=h,l.Si=s,l.BH=o,l.SY=a,l.TY=u,l.UY=c,l},n}();e.Vt=function(){function n(){}return n.CD=function(t,i,h){if(n.wy(t)){var s=e.ta.kj(i,t,!1);i=!1,e.Uk.CE(t)&&(i=i||t.lu(s,h)),(s=t.getType())!=1736&&s!=1607||!e.Uk.AE(t)||h==0||(i=i||t.fj(h)),s!=1736&&s!=1607||!e.Uk.BE(t)||h==0||i||t.hM()}},n.wy=function(t){return e.Uk.CE(t)||e.Uk.AE(t)||e.Uk.BE(t)},n}();var r=function(){function n(){this.rh=[]}return n.zB=function(t,i,h,s,o){var a=t.getType(),u=i.getType();if(a==197){if(u==197)return n.tW(t,i,h,s);if(u==33)return s==2?s=1:s==1&&(s=2),n.hJ(i,t,h,s)}else if(a==33){if(u==197)return n.hJ(t,i,h,s);if(u==33)return n.vW(t,i,h,s)}if(t.B()||i.B())return s==4;var c=new e.l;t.A(c);var l=new e.l;i.A(l);var p=new e.l;if(p.K(c),p.Zb(l),h=e.ta.Wd(h,p,!1),n.dk(c,l,h))return s==4;switch(c=!1,e.Vk.yd(a)&&((a=new e.Ta(t.description)).oc(t,!0),t=a,a=1607),e.Vk.yd(u)&&((u=new e.Ta(i.description)).oc(i,!0),i=u,u=1607),a!=197&&u!=197?(t.Db()4*Math.max(t.I(),i.I())*h)&&n.Wz(t,i,h,!0)))},n.kV=function(t,i,h){var s=n.qc(t,i,!0);return s==4||s!=1&&s!=2&&s!=1073741824&&n.EI(t,i,h)},n.vV=function(t,i,h){var s=n.qc(t,i,!1);return s!=4&&s!=1&&s!=2&&n.II(t,i,h,null)},n.qV=function(t,i,h,s){var o=n.qc(t,i,!1);return o!=4&&o!=1&&o!=2&&n.FI(t,i,h,s)},n.Sw=function(t,i,h,s){var o=new e.l,a=new e.l;return t.A(o),i.A(a),!!n.zc(o,a,h)&&(o=n.qc(t,i,!1))!=4&&o!=2&&(o==1||n.BI(t,i,h,s))},n.lV=function(t,i,h){var s=n.qc(t,i,!0);return s==4||s!=1&&s!=1073741824&&n.EI(t,i,h)},n.wV=function(t,i,h,s){var o=n.qc(t,i,!1);return o!=4&&o!=1&&n.JI(t,i,h,s)},n.gV=function(t,i,h){var s=n.qc(t,i,!1);return s!=4&&s!=1&&n.DI(t,i,h,null)},n.fB=function(t,i,h,s){var o=new e.l,a=new e.l;return t.A(o),i.A(a),!!n.zc(o,a,h)&&(o=n.qc(t,i,!1))!=4&&(o==1||n.CI(t,i,h,s))},n.jV=function(t,i,h){return e.hd.KG(t,i,h)==0},n.uV=function(t,i,h){return i=i.D(),n.HI(t,i,h)},n.dV=function(t,i,h){return i=i.D(),n.AI(t,i,h)},n.iV=function(t,i,h){var s=n.qc(t,i,!1);if(s==4)return!0;if(s==1)return!1;s=new e.l,t.A(s),s.W(h,h);for(var o=new e.h,a=0;ah&&a.R()>h||a.ca()<=h&&a.R()<=h)&&(o=new e.Ta,a=new e.Sa,i.Hf(0,a),o.nf(a),i.Hf(2,a),o.lineTo(a),n.DI(t,o,h,s))},n.IV=function(t,i,h){var s=new e.l,o=new e.l;return t.A(s),i.A(o),!(!n.ek(s,o,h)||n.qc(t,i,!1)==4)&&(!!n.dI(t,i,h)||n.Wz(t,i,h,!1))},n.GV=function(t,i,h){return this.qc(t,i,!1)==4||!!new e.Zl(t,i,h,!0).next()&&!this.UG(t,i,h)},n.NI=function(t,i,h){if(n.qc(t,i,!1)==4)return!1;var s=new e.be(0);if(n.Xz(t,i,h,s)!=0)return!1;for(var o=new e.de,a=0;ah&&o.R()>h)&&n.ek(s,o,h)},n.DV=function(t,i,h){var s=new e.l,o=new e.l;return t.A(s),i.A(o),!n.zc(o,s,h)&&!n.TG(t,o,h)},n.OV=function(t,i,h){var s=new e.l,o=new e.l;if(t.A(s),i.A(o),o.ca()<=h&&o.R()<=h)return o=i.Ip(),n.Zz(t,o,h);if(o.ca()<=h||o.R()<=h)return o=new e.Ta,s=new e.Sa,i.Hf(0,s),o.nf(s),i.Hf(2,s),o.lineTo(s),n.NI(t,o,h);t=t.Ga(),i=new e.l,s=new e.l,i.K(o),s.K(o),i.W(-h,-h),s.W(h,h),o=!1;for(var a=new e.l,u=new e.l;t.$a();)for(;t.Ha();){if(t.ha().A(a),u.K(i),u.Ea(a),!u.B()&&(u.ca()>h||u.R()>h))return!1;u.K(s),u.Ea(a),u.B()||(o=!0)}return o},n.LV=function(t,i,h){var s=new e.l,o=new e.l;return t.A(s),i.A(o),!(n.zc(s,o,h)||n.zc(o,s,h)||n.zc(o,s,h)||o.ca()>h&&o.R()>h||o.ca()<=h&&o.R()<=h)&&(s=new e.Ta,o=new e.Sa,i.Hf(0,o),s.nf(o),i.Hf(2,o),s.lineTo(o),n.WG(t,s,h))},n.RV=function(t,i,h){var s=new e.l,o=new e.l;if(t.A(s),i.A(o),!n.zc(o,s,h)||o.ca()<=h&&o.R()<=h)return!1;if(o.ca()<=h||o.R()<=h)return n.zc(o,s,h);t=t.Ga(),(i=new e.l).K(o),i.W(-h,-h),o=!1,s=new e.l;for(var a=new e.l;t.$a();)for(;t.Ha();)t.ha().A(s),i.hm(s)?o=!0:(a.K(i),a.Ea(s),!a.B()&&(a.ca()>h||a.R()>h)&&(o=!0));return o},n.yV=function(t,i,h){var s=new e.l,o=new e.l;return i.A(o),t.A(s),!(!n.zc(s,o,h)||o.ca()>h&&o.R()>h)&&(o.ca()<=h&&o.R()<=h?(i=i.Ip(),n.SG(t,i,h)):(s=new e.Ta,o=new e.Sa,i.Hf(0,o),s.nf(o),i.Hf(2,o),s.lineTo(o),n.ym(s,t,h,!1)))},n.BV=function(t,i,h){var s=new e.l,o=new e.l;if(t.A(s),i.A(o),n.zc(o,s,h)||o.ca()<=h&&o.R()<=h)return!1;if(o.ca()<=h||o.R()<=h)return s=new e.Ta,o=new e.Sa,i.Hf(0,o),s.nf(o),i.Hf(2,o),s.lineTo(o),n.LI(t,s,h);t=t.Ga(),i=new e.l,(s=new e.l).K(o),i.K(o),s.W(-h,-h),i.W(h,h);for(var a=o=!1,u=new e.l,c=new e.l;t.$a();)for(;t.Ha();)if(t.ha().A(u),a||i.contains(u)||(a=!0),o||(c.K(s),c.Ea(u),!c.B()&&(c.ca()>h||c.R()>h)&&(o=!0)),o&&a)return!0;return!1},n.iU=function(t,i,h){var s=new e.l,o=new e.l;return t.A(s),i.A(o),!!n.ek(s,o,h)&&(!!n.jU(t,i,h)||n.YA(t,i,h,!1,!0,!1))},n.gU=function(t,i,h){return!n.gI(t,i,h)},n.oU=function(t,i,h){return n.YA(t,i,h,!1,!1,!0)},n.eI=function(t,i,h){var s=new e.l,o=new e.l;return t.A(s),i.A(o),!!n.zc(s,o,h)&&n.YA(i,t,h,!0,!1,!1)},n.Mw=function(t,i,h){h*=h;for(var s=new e.h,o=new e.h,a=0;ah||o.R()>h)&&n.ek(s,o,h)},n.fU=function(t,i,h){var s=new e.l,o=new e.l;if(t.A(s),i.A(o),n.zc(o,s,h))return!1;for((i=new e.l).K(o),i.W(h,h),h=new e.h,o=0;oh?a.W(0,-h):a.W(-h,0);for(var c=0;ch){if(i.y>a.G&&i.ya.v&&i.xh?s.W(0,-h):s.W(-h,0),a.W(h,h);for(var u=new e.h,c=0;ch?u.y>s.G&&u.ys.v&&u.xh||o.R()>h)&&(i=i.Ip(),!n.kt(t,i,h))},n.eU=function(t,i,h){var s=new e.l,o=new e.l;if(t.A(s),i.A(o),n.zc(o,s,h)||o.ca()<=h&&o.R()<=h)return!1;if(o.ca()<=h||o.R()<=h){i=new e.l,s=new e.l,i.K(o),o.ca()>h?i.W(0,-h):i.W(-h,0),s.K(o),s.W(h,h);for(var a=new e.h,u=!1,c=!1,l=0;lh?a.y>i.G&&a.yi.v&&a.xh*h},n.uI=function(t,i,h){return n.wI(t,i,h)},n.vI=function(t,i,h){var s=new e.l;return s.K(t),n.ek(s,i,h)},n.Rw=function(t,i,h){var s=new e.l;return s.K(i),s.W(h,h),!s.contains(t)},n.dB=function(t,i,h){if(i.ca()<=h&&i.R()<=h)return!1;var s=new e.l,o=new e.l;if(s.K(i),s.W(h,h),!s.contains(t))return!1;if(i.ca()<=h||i.R()<=h){if(o.K(i),i.ca()>h?o.W(0,-h):o.W(-h,0),i.ca()>h){if(t.y>o.G&&t.yo.v&&t.xh?s.W(0,-h):s.W(-h,0);var o=!1;return i.ca()>h?t.y>s.G&&t.ys.v&&t.xh&&t.R()>h&&(i.ca()<=h||i.R()<=h)?s=i:(s=t,t=i),s.ca()<=h||s.R()<=h){if(t.ca()<=h||t.R()<=h){i=new e.yb;var o=new e.yb,a=[0,0],u=[0,0],c=new e.h;return s.dn(c),i.Dc(c),s.en(c),i.Qc(c),t.dn(c),o.Dc(c),t.en(c),o.Qc(c),i.Ea(o,null,a,u,h),i.Ea(o,null,null,null,h)==1&&(a[0]==0||a[1]==1||u[0]==0||u[1]==1)}return i=new e.l,o=new e.l,i.K(t),i.W(-h,-h),o.K(i),o.Ea(s),!(!o.B()&&(o.ca()>h||o.R()>h))}return t.W(h,h),(o=new e.l).K(s),o.Ea(t),!(o.B()||!o.B()&&o.ca()>h&&o.R()>h)},n.bQ=function(t,i,h){if(n.zc(t,i,h)||n.zc(i,t,h)||t.ca()<=h&&t.R()<=h||i.ca()<=h&&i.R()<=h)return!1;if(t.ca()<=h||t.R()<=h){if(i.ca()>h&&i.R()>h)return!1;var s=new e.yb,o=new e.yb,a=[0,0],u=[0,0],c=new e.h;return t.dn(c),s.Dc(c),t.en(c),s.Qc(c),i.dn(c),o.Dc(c),i.en(c),o.Qc(c),s.Ea(o,null,a,u,h),s.Ea(o,null,null,null,h)==2&&(0a[1])&&(0u[1])}return!(i.ca()<=h||i.R()<=h)&&((s=new e.l).K(t),s.Ea(i),!(s.B()||s.ca()<=h||s.R()<=h))},n.jF=function(t,i,h){if(!n.zc(t,i,h))return!1;if(t.ca()<=h&&t.R()<=h)return t=t.sf(),n.eB(t,i,h);if(i.ca()<=h&&i.R()<=h)return i=i.sf(),n.eB(i,t,h);if(t.ca()<=h||t.R()<=h)return n.zc(t,i,h);if(i.ca()<=h||i.R()<=h){var s=new e.l;return s.K(t),s.W(-h,-h),s.hm(i)?!0:((t=new e.l).K(s),t.Ea(i),!(t.B()||t.ca()<=h&&t.R()<=h))}return n.zc(t,i,h)},n.aQ=function(t,i,h){if(n.zc(t,i,h)||n.zc(i,t,h)||t.ca()<=h&&t.R()<=h||i.ca()<=h&&i.R()<=h||i.ca()>h&&i.R()>h&&t.ca()>h&&t.R()>h)return!1;if(t.ca()>h&&t.R()>h)var s=i;else s=t,t=i;if(t.ca()>h&&t.R()>h){i=new e.l;var o=new e.l;return o.K(t),o.W(-h,-h),i.K(o),i.Ea(s),!(i.B()||i.ca()<=h&&i.R()<=h)}i=new e.yb,o=new e.yb;var a=[0,0],u=[0,0],c=new e.h;return s.dn(c),i.Dc(c),s.en(c),i.Qc(c),t.dn(c),o.Dc(c),t.en(c),o.Qc(c),i.Ea(o,null,a,u,h),i.Ea(o,null,null,null,h)==1&&0a[1]&&0u[1]},n.EI=function(t,i,h){var s=new e.l,o=new e.l,a=new e.Zl(t,i,h,!0);if(!a.next())return!0;if(this.UG(t,i,h))return!1;var u=t,c=null;i.getType()==1736&&(c=i);var l=!1,p=!1;do{var y=a.nl(),d=a.hl();if(d=i.Na(i.Ba(d)),s.K(a.uz()),s.W(h,h),s.contains(d)&&(d=e.hd.Yd(u,d,0))!=0||i.getType()==1736&&(y=t.Na(t.Ba(y)),o.K(a.az()),o.W(h,h),o.contains(y)&&(d=e.hd.Yd(c,y,0))!=0))return!1;l||(!e.Dg.Ml(t,i.da()-1)||t.Bb!=null&&t.Bb.Fb!=null?u=t:(u=new e.Da,t.copyTo(u),u.fj(1)),l=!0),i.getType()!=1736||p||(p=i,!e.Dg.Ml(p,t.da()-1)||i.Bb!=null&&i.Bb.Fb!=null?c=i:(c=new e.Da,p.copyTo(c),c.fj(1)),p=!0)}while(a.next());return!0},n.zc=function(t,i,h){var s=new e.l;return s.K(t),s.W(h,h),s.contains(i)},n.ls=function(t,i,h){var s=new e.l;return s.K(i),s.W(h,h),i=new e.h,t.dn(i),!s.contains(i)||(t.$I(i),!s.contains(i)||(t.cJ(i),!s.contains(i)||(t.en(i),!s.contains(i))))},n.dI=function(t,i,h){if(t.da()!=i.da()||t.I()!=i.I())return!1;var s=new e.h,o=new e.h,a=!0;h*=h;for(var u=0;uh){a=!1;break}if(!a)break}return!!a},n.jU=function(t,i,h){if(t.I()!=i.I())return!1;var s=new e.h,o=new e.h,a=!0;h*=h;for(var u=0;uh){a=!1;break}return!!a},n.YA=function(t,i,h,s,o,a){var u=!1;if(t.I()>i.I()){s&&(s=!1,u=!0);var c=i}else c=t,t=i;if(i=null,o||a||u){i=new e.pn(t.I());for(var l=0;li.I())var s=i;else s=t,t=i;i=new e.l;var o=new e.l,a=new e.l;s.A(i),t.A(o),i.W(h,h),o.W(h,h),a.K(i),a.Ea(o),o=new e.h;for(var u=new e.h,c=h*h,l=e.ta.oE(t,a),p=l.getIterator(),y=0;yh)return!1;if(w*(1-(M=a.Si))<=h||M==1)break}if(w*(1-M)>h)return!1;p=0,y.resize(0),d.rh.length=0}}return u},n.WG=function(t,i,h){if(1>n.Xz(t,i,h,null))return!1;var s=new e.l,o=new e.l;t.A(s),i.A(o);var a=n.ls(s,o,h);return s=n.ls(o,s,h),!(!a||!s)||(a&&!s?!n.ym(i,t,h,!1):s&&!a?!n.ym(t,i,h,!1):!n.ym(t,i,h,!1)&&!n.ym(i,t,h,!1))},n.Xz=function(t,i,h,s){function o(H,U){return g.QE(H,U)}if(t.yz()>i.yz())var a=i,u=t;else a=t,u=i;t=a.Ga(),i=u.Ga();var c=[0,0],l=[0,0],p=-1,y=0,d=new e.ia(0),g=new n,b=new e.l,x=new e.l,m=new e.l;a.A(b),u.A(x),b.W(h,h),x.W(h,h),m.K(b),m.Ea(x),a=null,s!=null&&(a=new e.h);var w=x=x=null,j=u.Bb;for(j!=null?(x=j.Fb,w=j.zo,x==null&&(x=e.ta.jj(u,m))):x=e.ta.jj(u,m),u=x.getIterator(),j=null,w!=null&&(j=w.getIterator());t.$a();)for(w=0;t.Ha();){var M=t.ha();if(M.A(b),b.isIntersecting(m)){if(j!=null&&(j.Xi(b,h),j.next()==-1))continue;var A=M.Qb();u.Uo(M,h);for(var z=u.next();z!=-1;z=u.next()){var N=x.ja(z);i.Vb(N);var I=i.ha(),C=I.Qb(),T=M.Ea(I,null,c,l,h);if(0h)return 1;var E=A*(D-z);if(i.Ha()){if(I=i.ha(),(T=M.Ea(I,null,c,null,h))==2){T=c[0];var G=c[1];if(E+(T=A*(G-T))>h)return 1}i.Vb(N),i.ha()}if(!i.vm()){if(i.li(),I=i.li(),(T=M.Ea(I,null,c,null,h))==2&&(T=c[0],E+(T=A*((G=c[1])-T))>h))return 1;i.Vb(N),i.ha()}if(t.Ha()){if(N=t.wb(),(T=(M=t.ha()).Ea(I,null,c,null,h))==2&&(T=c[0],E+(T=A*((G=c[1])-T))>h))return 1;t.Vb(N),t.ha()}if(!t.vm()){if(N=t.wb(),t.li(),(T=(M=t.li()).Ea(I,null,c,null,h))==2&&(T=c[0],E+(T=C*((G=c[1])-T))>h))return 1;t.Vb(N),t.ha()}I=f.construct(t.wb(),t.gb,z,D,i.wb(),i.gb,p,B),g.rh.push(I),d.add(d.size)}p=0,s!=null&&(M.hc(z,a),s.add(a.x),s.add(a.y))}}if(yh)w=A*(I.Si-I.Kj),M=I.Si,z=I.Mm;else{if(I.Mm!=z?(w=A*(I.Si-I.Kj),z=I.Mm):w+=A*(I.Si-I.Kj),w>h)return 1;if((M=I.Si)==1)break}A*(1-M)>h&&(w=0),y=0,d.resize(0),g.rh.length=0}}}return p},n.UG=function(t,i,h){var s=t.Ga(),o=i.Ga();for(t=new e.Zl(t,i,h,!1);t.next();){i=t.nl();var a=t.hl();if(s.Vb(i),o.Vb(a),i=s.ha(),0h)return!1;y=!0}else if(g!=0){if(y=c[0],d=l[0],0y&&0d)return!1;y=!0}}return!!y&&(a=new e.l,u=new e.l,o=new e.l,t.A(a),i.A(u),a.W(1e3*h,1e3*h),u.W(1e3*h,1e3*h),o.K(a),o.Ea(u),!(10h&&(l=!0,p&&y))return!0}else if(w!=0&&(w=b[0],j=x[0],0w&&0j))return!0}if(o=new e.l,d=new e.l,o.K(a),o.W(1e3*h,1e3*h),d.K(u),d.W(1e3*h,1e3*h),c.K(o),c.Ea(d),a="",a=l?a+"**":a+"T*",p){if(10y&&0d)))return s[0]=!0,!1}if(!p){for(s[0]=!0,u=new e.l,t.A(u),u.W(h,h),l=t,p=!1,c=new e.l,s=0,o=i.da();sp&&0y)return!1;p=!0}}return!!p&&(a=new e.l,u=new e.l,o=new e.l,t.A(a),i.A(u),a.W(1e3*h,1e3*h),u.W(1e3*h,1e3*h),o.K(a),o.Ea(u),!(10p&&0y)return!0;p=!0}}return!!p&&(a=new e.l,u=new e.l,c=new e.l,l=new e.l,o=new e.l,t.A(a),i.A(u),n.ls(u,a,h)?(c.K(a),c.W(1e3*h,1e3*h),l.K(u),l.W(1e3*h,1e3*h),o.K(c),o.Ea(l),!(10a;a++){var u=s.charAt(a);if(u!="*"&&u!="T"&&u!="F"&&u!="0"&&u!="1"&&u!="2")throw e.i.fa("relation string")}if((a=this.MR(s,t.Db(),i.Db()))!=0)return e.ud.zB(t,i,h,a,o);a=new e.l,t.A(a),u=new e.l,i.A(u);var c=new e.l;if(c.K(a),c.Zb(u),h=e.ta.Wd(h,c,!1),t=this.WE(t,h),i=this.WE(i,h),t.B()||i.B())return this.uW(t,i,s);switch(a=t.getType(),u=i.getType(),c=!1,a){case 1736:switch(u){case 1736:c=this.rt(t,i,h,s,o);break;case 1607:c=this.$m(t,i,h,s,o);break;case 33:c=this.qt(t,i,h,s);break;case 550:c=this.pt(t,i,h,s,o)}break;case 1607:switch(u){case 1736:c=this.$m(i,t,h,this.Zp(s),o);break;case 1607:c=this.gB(t,i,h,s,o);break;case 33:c=this.tt(t,i,h,s,o);break;case 550:c=this.st(t,i,h,s,o)}break;case 33:switch(u){case 1736:c=this.qt(i,t,h,this.Zp(s));break;case 1607:c=this.tt(i,t,h,this.Zp(s),o);break;case 33:c=this.$U(t,i,h,s);break;case 550:c=this.lt(i,t,h,this.Zp(s))}break;case 550:switch(u){case 1736:c=this.pt(i,t,h,this.Zp(s),o);break;case 1607:c=this.st(i,t,h,this.Zp(s),o);break;case 550:c=this.ZA(t,i,h,s,o);break;case 33:c=this.lt(t,i,h,s)}break;default:c=!1}return c},n.rt=function(t,i,h,s,o){var a=new n;a.Yi(),a.bj(s),a.xJ();var u=new e.l,c=new e.l;return t.A(u),i.A(c),s=!1,e.ud.dk(u,c,h)&&(a.Cu(t,i),s=!0),s||((u=e.ud.qc(t,i,!1))==4?(a.Cu(t,i),s=!0):u==1?(a.ly(i),s=!0):u==2&&(a.ZD(t),s=!0)),s||(t=(s=new e.gd).Ib(t),i=s.Ib(i),a.Wo(s,h,o),a.Bp(t,i),a.j.Ug()),n.fg(a.J,a.Xc)},n.Sw=function(t,i,h,s){var o=new n;o.Yi(),o.bj("T*****F**"),o.xJ();var a=new e.l,u=new e.l;t.A(a),i.A(u);var c=!1;return e.ud.dk(a,u,h)&&(o.Cu(t,i),c=!0),c||((a=e.ud.qc(t,i,!1))==4?(o.Cu(t,i),c=!0):a==1?(o.ly(i),c=!0):a==2&&(o.ZD(t),c=!0)),c?this.fg(o.J,o.Xc):(t=(c=new e.gd).Ib(t),a=c.Ib(i),e.Tk.V(c,h,s,!1),h=c.Ne(a).mg(),c.Gp(0,!0,!0),e.rn.V(c,t,-1,!1,s),c.I(t)!=0&&(e.rn.V(c,a,-1,!1,s),o.er(c,s),(i=c.I(a)==0)||(o.Bp(t,a),o.j.Ug(),a=this.fg(o.J,o.Xc))?(t=c.Ne(t),t=(c=new e.gd).Ib(t),a=c.Ib(h),o.er(c,s),o.le=0,o.Yi(),o.bj(i?"T*****F**":"******F**"),o.IB(),o.Bp(t,a),o.j.Ug(),this.fg(o.J,o.Xc)):a))},n.$m=function(t,i,h,s,o){var a=new n;a.Yi(),a.bj(s),a.IB();var u=new e.l,c=new e.l;return t.A(u),i.A(c),s=!1,e.ud.dk(u,c,h)&&(a.Du(t,i),s=!0),s||((u=e.ud.qc(t,i,!1))==4?(a.Du(t,i),s=!0):u==1&&(a.$D(i),s=!0)),s||(t=(s=new e.gd).Ib(t),i=s.Ib(i),a.Wo(s,h,o),a.kh=a.j.Dp(),n.Jw(i,a.j,a.kh),a.Bp(t,i),a.j.Ep(a.kh),a.j.Ug()),n.fg(a.J,a.Xc)},n.fB=function(t,i,h,s){var o=new n;o.Yi(),o.bj("T*****F**"),o.IB();var a=new e.l,u=new e.l;t.A(a),i.A(u);var c=!1;return e.ud.dk(a,u,h)&&(o.Du(t,i),c=!0),c||((a=e.ud.qc(t,i,!1))==4?(o.Du(t,i),c=!0):a==1&&(o.$D(i),c=!0)),c?this.fg(o.J,o.Xc):(t=(c=new e.gd).Ib(t),i=c.Ib(i),o.Wo(c,h,s),c.I(t)!=0&&(o.Bp(t,i),o.j.Ug(),this.fg(o.J,o.Xc)))},n.pt=function(t,i,h,s,o){var a=new n;a.Yi(),a.bj(s),a.yJ();var u=new e.l,c=new e.l;return t.A(u),i.A(c),s=!1,e.ud.dk(u,c,h)&&(a.Eu(t),s=!0),s||((u=e.ud.qc(t,i,!1))==4?(a.Eu(t),s=!0):u==1&&(a.zN(),s=!0)),s||(t=(s=new e.gd).Ib(t),i=s.Ib(i),a.Wo(s,h,o),a.Gy(t,i),a.j.Ug()),n.fg(a.J,a.Xc)},n.gB=function(t,i,h,s,o){var a=new n;a.Yi(),a.bj(s),a.eX(),s=new e.l;var u=new e.l;t.A(s),i.A(u);var c=!1;return e.ud.dk(s,u,h)&&(a.PG(t,i),c=!0),c||e.ud.qc(t,i,!1)!=4||(a.PG(t,i),c=!0),c||(t=(s=new e.gd).Ib(t),i=s.Ib(i),a.Wo(s,h,o),a.Yh=a.j.Dp(),a.kh=a.j.Dp(),n.Jw(t,a.j,a.Yh),n.Jw(i,a.j,a.kh),a.Bp(t,i),a.j.Ep(a.Yh),a.j.Ep(a.kh),a.j.Ug()),n.fg(a.J,a.Xc)},n.st=function(t,i,h,s,o){var a=new n;a.Yi(),a.bj(s),a.MJ(),s=new e.l;var u=new e.l;t.A(s),i.A(u);var c=!1;return e.ud.dk(s,u,h)&&(a.Vz(t),c=!0),c||e.ud.qc(t,i,!1)!=4||(a.Vz(t),c=!0),c||(t=(s=new e.gd).Ib(t),i=s.Ib(i),a.Wo(s,h,o),a.Yh=a.j.Dp(),n.Jw(t,a.j,a.Yh),a.Gy(t,i),a.j.Ep(a.Yh),a.j.Ug()),n.fg(a.J,a.Xc)},n.ZA=function(t,i,h,s,o){var a=new n;a.Yi(),a.bj(s),a.RJ(),s=new e.l;var u=new e.l;t.A(s),i.A(u);var c=!1;return e.ud.dk(s,u,h)&&(a.yI(),c=!0),c||(t=(s=new e.gd).Ib(t),i=s.Ib(i),a.Wo(s,h,o),a.Gy(t,i),a.j.Ug()),n.fg(a.J,a.Xc)},n.qt=function(t,i,h,s){var o=new n;o.Yi(),o.bj(s),o.yJ();var a=new e.l;t.A(a),i=i.D();var u=!1;return e.ud.Rw(i,a,h)&&(o.Eu(t),u=!0),u||((h=e.hd.Yd(t,i,h))==1?(o.J[0]=0,o.J[2]=2,o.J[3]=-1,o.J[5]=1,o.J[6]=-1):h==2?(o.J[6]=-1,t.Ke()!=0?(o.J[0]=-1,o.J[3]=0,o.J[2]=2,o.J[5]=1):(o.J[0]=0,o.J[3]=-1,o.J[5]=-1,h=new e.l,t.A(h),o.J[2]=h.ca()==0&&h.R()==0?-1:1)):o.Eu(t)),this.fg(o.J,s)},n.tt=function(t,i,h,s,o){var a=new n;a.Yi(),a.bj(s),a.MJ();var u=new e.l;t.A(u),s=i.D();var c=!1;if(e.ud.Rw(s,u,h)&&(a.Vz(t),c=!0),!c){u=null;var l=c=!1;(a.ea[0]||a.ea[6])&&(e.ud.Yz(t,s,h)?(a.ea[0]&&(u=e.pi.gm(t,o),l=!e.ud.kt(u,s,h),c=!0,a.J[0]=l?-1:0),a.J[6]=-1):(a.J[0]=-1,a.J[6]=0)),a.ea[3]&&(u!=null&&u.B()?a.J[3]=-1:(c||(u==null&&(u=e.pi.gm(t,o)),l=!e.ud.kt(u,s,h),c=!0),a.J[3]=l?0:-1)),a.ea[5]&&(u!=null&&u.B()?a.J[5]=-1:c&&!l?a.J[5]=0:(u==null&&(u=e.pi.gm(t,o)),o=e.ud.Nw(u,i,h),a.J[5]=o?-1:0)),a.ea[2]&&(t.Qb()!=0?a.J[2]=1:((o=new e.de(t.description)).Fd(t,0,t.I()),t=e.ud.Nw(o,i,h),a.J[2]=t?-1:0))}return this.fg(a.J,a.Xc)},n.lt=function(t,i,h,s){var o=new n;o.Yi(),o.bj(s),o.RJ();var a=new e.l;t.A(a),i=i.D();var u=!1;if(e.ud.Rw(i,a,h)&&(o.yI(),u=!0),!u){a=!1,u=!0,h*=h;for(var c=0;ca;a++)o[a]=-1;return e.h.yc(t,i)<=h*h?o[0]=0:(o[2]=0,o[6]=0),o[8]=2,n.fg(o,s)},n.fg=function(t,i){for(var h=0;9>h;h++)switch(i.charAt(h)){case"T":if(t[h]==-1)return!1;break;case"F":if(t[h]!=-1)return!1;break;case"0":if(t[h]!=0)return!1;break;case"1":if(t[h]!=1)return!1;break;case"2":if(t[h]!=2)return!1}return!0},n.uW=function(t,i,h){var s=[-1,-1,-1,-1,-1,-1,-1,-1,-1];if(t.B()&&i.B()){for(var o=0;9>o;o++)s[o]=-1;return this.fg(s,h)}return o=!1,t.B()&&(t=i,o=!0),s[0]=-1,s[1]=-1,s[3]=-1,s[4]=-1,s[6]=-1,s[7]=-1,s[8]=2,i=t.getType(),e.aa.Hc(i)?i==1736?t.Ke()!=0?(s[2]=2,s[5]=1):(s[5]=-1,i=new e.l,t.A(i),s[2]=i.ca()==0&&i.R()==0?0:1):(i=t.Qb()!=0,s[2]=i?1:0,s[5]=e.pi.aq(t)?0:-1):(s[2]=0,s[5]=-1),o&&this.vK(s),this.fg(s,h)},n.MR=function(t,i,h){return n.dQ(t)?3:n.UP(t)?4:n.cY(t,i,h)?8:n.CP(t,i,h)?16:n.eP(t)?1:n.EU(t,i,h)?32:0},n.dQ=function(t){return t.charAt(0)=="T"&&t.charAt(1)=="*"&&t.charAt(2)=="F"&&t.charAt(3)=="*"&&t.charAt(4)=="*"&&t.charAt(5)=="F"&&t.charAt(6)=="F"&&t.charAt(7)=="F"&&t.charAt(8)=="*"},n.UP=function(t){return t.charAt(0)=="F"&&t.charAt(1)=="F"&&t.charAt(2)=="*"&&t.charAt(3)=="F"&&t.charAt(4)=="F"&&t.charAt(5)=="*"&&t.charAt(6)=="*"&&t.charAt(7)=="*"&&t.charAt(8)=="*"},n.cY=function(t,i,h){return(i!=0||h!=0)&&((i!=2||h!=2)&&(t.charAt(0)=="F"&&t.charAt(1)=="*"&&t.charAt(2)=="*"&&t.charAt(3)=="T"&&t.charAt(4)=="*"&&t.charAt(5)=="*"&&t.charAt(6)=="*"&&t.charAt(7)=="*"&&t.charAt(8)=="*"||i==1&&h==1&&t.charAt(0)=="F"&&t.charAt(1)=="T"&&t.charAt(2)=="*"&&t.charAt(3)=="*"&&t.charAt(4)=="*"&&t.charAt(5)=="*"&&t.charAt(6)=="*"&&t.charAt(7)=="*"&&t.charAt(8)=="*")||h!=0&&t.charAt(0)=="F"&&t.charAt(1)=="*"&&t.charAt(2)=="*"&&t.charAt(3)=="*"&&t.charAt(4)=="T"&&t.charAt(5)=="*"&&t.charAt(6)=="*"&&t.charAt(7)=="*"&&t.charAt(8)=="*")},n.CP=function(t,i,h){return i>h?t.charAt(0)=="T"&&t.charAt(1)=="*"&&t.charAt(2)=="*"&&t.charAt(3)=="*"&&t.charAt(4)=="*"&&t.charAt(5)=="*"&&t.charAt(6)=="T"&&t.charAt(7)=="*"&&t.charAt(8)=="*":i==1&&h==1&&t.charAt(0)=="0"&&t.charAt(1)=="*"&&t.charAt(2)=="*"&&t.charAt(3)=="*"&&t.charAt(4)=="*"&&t.charAt(5)=="*"&&t.charAt(6)=="*"&&t.charAt(7)=="*"&&t.charAt(8)=="*"},n.eP=function(t){return t.charAt(0)=="T"&&t.charAt(1)=="*"&&t.charAt(2)=="*"&&t.charAt(3)=="*"&&t.charAt(4)=="*"&&t.charAt(5)=="*"&&t.charAt(6)=="F"&&t.charAt(7)=="F"&&t.charAt(8)=="*"},n.EU=function(t,i,h){if(i==h){if(i!=1)return t.charAt(0)=="T"&&t.charAt(1)=="*"&&t.charAt(2)=="T"&&t.charAt(3)=="*"&&t.charAt(4)=="*"&&t.charAt(5)=="*"&&t.charAt(6)=="T"&&t.charAt(7)=="*"&&t.charAt(8)=="*";if(t.charAt(0)=="1"&&t.charAt(1)=="*"&&t.charAt(2)=="T"&&t.charAt(3)=="*"&&t.charAt(4)=="*"&&t.charAt(5)=="*"&&t.charAt(6)=="T"&&t.charAt(7)=="*"&&t.charAt(8)=="*")return!0}return!1},n.Jw=function(t,i,h){t=i.La(t);for(var s=i.Re;s!=-1;s=i.Rf(s))if(i.xd(s)&t){var o=i.Me(s);if(o==-1)i.nn(s,h,0);else{var a=o,u=0;do i.dh(a)&t&&u++,a=i.jc(i.xa(a));while(a!=o);i.nn(s,h,u)}}},n.Zp=function(t){var i=""+t.charAt(0);return i+=t.charAt(3),i+=t.charAt(6),i+=t.charAt(1),i+=t.charAt(4),i+=t.charAt(7),i+=t.charAt(2),(i+=t.charAt(5))+t.charAt(8)},n.prototype.Yi=function(){for(var t=0;9>t;t++)this.J[t]=-2,this.Za[t]=-2},n.vK=function(t){var i=t[1],h=t[2],s=t[5];t[1]=t[3],t[2]=t[6],t[5]=t[7],t[3]=i,t[6]=h,t[7]=s},n.prototype.bj=function(t){for(this.Xc=t,t=0;9>t;t++)this.Xc.charAt(t)!="*"?(this.ea[t]=!0,this.le++):this.ea[t]=!1},n.prototype.UJ=function(){for(var t=0;9>t;t++)this.ea[t]&&this.J[t]==-2&&(this.J[t]=-1,this.ea[t]=!1)},n.prototype.pc=function(t){return this.J[t]!=-2&&(this.J[t]==-1?(this.ea[t]=!1,this.le--,!0):this.Xc.charAt(t)!="T"&&this.Xc.charAt(t)!="F"?!(this.J[t]a?1:0},n.prototype.reset=function(){this.yA=-1},n}(),r=function(){function n(){this.Wm=this.Gl=null,this.fb=new e.Yj,this.fb.RP(),this.$d=new f(this),this.fb.Vo(this.$d)}return n.prototype.HQ=function(){var t=!1;if(this.fw&&(t=this.IQ()),this.g.da(this.X)==1){var i=this.g.Ob(this.X);return t=this.g.wz(i),this.g.PB(i,!0),0>t&&(t=this.g.Xa(i),this.g.pJ(t),this.g.Wg(i,this.g.Ma(t)),!0)}for(this.El=this.g.Ky(),this.wo=this.g.Ky(),i=this.g.Ob(this.X);i!=-1;i=this.g.Rb(i))this.g.gr(i,this.El,0),this.g.gr(i,this.wo,-1);i=new e.ia(0),this.yh=NaN;var h=new e.h;this.et=this.g.da(this.X),this.ro=this.g.Gd(),this.Rs=this.g.Gd();for(var s=this.Gl.rc(this.Gl.je);s!=-1;s=this.Gl.lb(s)){var o=this.Gl.getData(s);if(this.g.Gc(o,h),h.y!=this.yh&&i.size!=0&&(t=this.ut(i)||t,this.$d.reset(),i.clear(!1)),i.add(o),this.yh=h.y,this.et==0)break}for(0=this.MA.length&&this.MA.push(new e.ig);var n=this.MA[this.Cw];return this.Cw++,n},r.prototype.clear=function(){this.wB(this.mo),this.wB(this.$s),this.wB(this.yw),this.Cw=0},r.prototype.Oo=function(n){this.mo.push(this.Ow(n))},r.prototype.ol=function(n){return n==0?this.$s.length:this.yw.length},r.prototype.Vp=function(n,t){return this.SR(n,t).$i},r.prototype.Ea=function(n,t){if(this.mo.length!=2)throw e.i.Qa();this.qa=n;var i=e.lc.ox(.01*n),h=!1,s=this.mo[0],o=this.mo[1];if(t||5&s.$i.zr(o.$i,n,!0)){if(s.$i.getType()==322){var a=s.$i;if(o.$i.getType()==322){t=o.$i;var u=e.yb.Zx(a,t,null,this.Fq,this.Bk,n);if(u==0)throw e.yb.Zx(a,t,null,this.Fq,this.Bk,n),e.i.Qa();n=Array(9),e.O.$u(n,null);for(var c=0;ci&&(h=!0)):y>g?(a.hc(l,x),l=new e.h,t.hc(p,l),e.h.yc(x,l)>i&&(h=!0)):(t.hc(p,x),y=new e.h,a.hc(l,y),e.h.yc(x,y)>i&&(h=!0)),n[c]=x}for(s=0,o=-1,c=0;c<=u;c++)(b=cthis.Bk[1]&&(b=this.Bk[0],this.Bk[0]=this.Bk[1],this.Bk[1]=b,c=a[0],a[0]=a[1],a[1]=c),s=0,o=-1,c=0;c<=u;c++)(b=c=o;o++){if((t=1>o?this.Fq[o]:1)!=i){var a=this.aB();n.ah(i,t,a),s!=-1&&a.get().Dc(h),o!=1&&a.get().Qc(h),i=t,this.$s.push(this.Ow(a.get()))}s=o}this.Bf.Cb(h)}},r}();e.TC=f}(k||(k={})),function(e){var v=function(){function f(r){this.Ds=this.rk=this.sb=null,this.ag=0,this.zm=!1,this.zf=-1,this.Cl=this.Jd=0,this.gb=-1,this.ib=r,this.ag=this.Wx(this.Cl),this.zm=!1,this.rk=null,this.Ds=new e.h}return f.prototype.BW=function(r){if(this.ib!=r.ib)throw e.i.Hb();this.zf=r.zf,this.Jd=r.Jd,this.gb=r.gb,this.Cl=r.Cl,this.ag=r.ag,this.zm=r.zm,this.rk=null},f.prototype.ha=function(){if(this.zf!=this.Jd&&this.BD(),this.zm)this.Jd=(this.Jd+1)%this.ag;else{if(this.Jd==this.ag)throw e.i.ce();this.Jd++}return this.rk},f.prototype.li=function(){if(this.zm)this.Jd=(this.ag+this.Jd-1)%this.ag;else{if(this.Jd==0)throw e.i.ce();this.Jd--}return this.Jd!=this.zf&&this.BD(),this.rk},f.prototype.DW=function(){this.zf=-1,this.Jd=0},f.prototype.EW=function(){this.Jd=this.ag,this.zf=-1},f.prototype.Vb=function(r,n){if(n===void 0&&(n=-1),0<=this.gb&&this.gb=t&&r=this.ib.Ba(n)&&r=this.ib.da())&&(this.zf=-1,this.Jd=0,this.ag=this.Wx(this.gb),this.ib.Ba(this.gb),this.ib.dc(this.gb),this.Cl++,!0)},f.prototype.Zi=function(){this.ag=this.Jd=this.zf=-1,this.Cl=0,this.gb=-1},f.prototype.Wx=function(r){if(this.ib.Ac())return 0;var n=1;return this.ib.dc(r)&&(n=0),this.ib.Ja(r)-n},f.prototype.On=function(){return this.zf==this.ag-1&&this.ib.dc(this.gb)},f.prototype.JB=function(){this.zm=!0},f.prototype.wb=function(){return this.ib.nb.o[this.gb]+this.zf},f.prototype.IM=function(){return this.ib.Ba(this.gb)},f.prototype.ik=function(){return this.On()?this.ib.Ba(this.gb):this.wb()+1},f.prototype.vm=function(){return this.zf==0},f.prototype.Qn=function(){return this.zf==this.ag-1},f.prototype.Ha=function(){return this.Jdthis.Jd||this.Jd>=this.ag)throw e.i.ce();this.zf=this.Jd;var r=this.wb();this.ib.mc();var n=this.ib.Ve,t=1;switch(n!=null&&(t=7&n.read(r)),n=this.ib.description,t){case 1:this.sb==null&&(this.sb=new e.yb),this.rk=this.sb;break;case 2:throw e.i.fa("internal error");default:throw e.i.Qa()}this.rk.Nf(n),t=this.ik(),this.ib.Gc(r,this.Ds),this.rk.Dc(this.Ds),this.ib.Gc(t,this.Ds),this.rk.Qc(this.Ds);for(var i=1,h=n.Aa;ih&&(s=n,n=i,i=s,s=t,t=h,h=s,s=-1),!(0>h||t>=this.pl)){0>n&&0>i?i=n=-1:n>=this.oi&&i>=this.oi&&(i=n=this.oi);var o=(i-n)/(h-t);h>this.pl&&(i=o*((h=this.pl)-t)+n),0>t&&(n=o*(0-t)+n,t=0);var a=Math.max(this.oi+1,8388607);-8388607>n?(t=(0-n)/o+t,n=0):n>a&&(t=(this.oi-n)/o+t,n=this.oi),-8388607>i?h=(0-n)/o+t:i>a&&(h=(this.oi-n)/o+t),(t=e.O.truncate(t))!=(h=e.O.truncate(h))&&((i=new v).x=e.O.truncate(4294967296*n),i.y=t,i.H=h,i.WP=e.O.truncate(4294967296*o),i.dir=s,this.Wl==null&&(this.Wl=e.O.lg(this.pl,null)),i.next=this.Wl[i.y],this.Wl[i.y]=i,i.ythis.Kw&&(this.Kw=i.H),this.Tq++)}}},r.prototype.sN=function(){if(this.Jh!=null){for(var n=!1,t=null,i=this.Jh;i!=null;)if(i.y++,i.y==i.H){var h=i;i=i.next,t!=null?t.next=i:this.Jh=i,h.next=null}else i.x+=i.WP,t!=null&&t.x>i.x&&(n=!0),t=i,i=i.next;n&&(this.Jh=this.fK(this.Jh))}},r.prototype.lN=function(n){if(!(n>=this.pl)){var t=this.Wl[n];if(t!=null){this.Wl[n]=null,t=this.fK(t),this.Tq-=this.gK,n=this.Jh;for(var i=!0,h=t,s=null;n!=null&&h!=null;)n.x>h.x?(i&&(this.Jh=h),i=h.next,h.next=n,s!=null&&(s.next=h),s=h,h=i):(i=n.next,n.next=h,s!=null&&(s.next=n),s=n,n=i),i=!1;this.Jh==null&&(this.Jh=t)}}},r.eK=function(n,t){return 0>n?0:n>t?t:n},r.prototype.ZP=function(){if(this.Jh!=null){for(var n=0,t=this.Jh,i=e.O.truncate(e.O.XG(t.x)),h=t.next;h!=null;h=h.next)if(n=this.kF?1^n:n+h.dir,h.x>t.x){var s=e.O.truncate(e.O.XG(h.x));n!=0&&(t=r.eK(i,this.oi),(i=r.eK(s,this.oi))>t&&tthis.Kf[1].x&&(n=this.Kf[0],this.Kf[0]=this.Kf[1],this.Kf[1]=n):r.AN(this.Kf,t,function(s,o){return s==o?0:s.xo.x?1:0}),n=this.Kf[0],this.Kf[0]=null,i=n,h=1;hthis.Wh.size)break;var u=this;for(this.xe.Vd(0,this.xe.size,function(c,l){return u.pM(c,l)}),t=0,i=this.xe.size;tb?1:xm?1:0)==0&&(x=(y=u[c*y+3])<(d=u[c*d+3])?-1:y==d?0:1),x}),this.Pq=this.g.Gd(),this.oe=new e.jp,this.RA=this.oe.Ph(0),this.oe.fn(t),h=0;hu;u++){for(c=y[u],l=t[u],p=u-1;0<=p&&y[p]>c;)y[p+1]=y[p],t[p+1]=t[p],p--;y[p+1]=c,t[p+1]=l}return y=0,t[0]!=0&&(y|=1),t[1]!=0&&(y|=2),t[2]!=0&&(y|=4),t[3]!=0&&(y|=8),(y==5||y==10)&&(r==n?r?(this.g.Bc(a,i),this.g.Cc(i,a),this.g.Bc(h,o),this.g.Cc(o,h)):(this.g.Cc(a,i),this.g.Bc(i,a),this.g.Cc(h,o),this.g.Bc(o,h)):r?(this.g.Cc(i,s),this.g.Bc(s,i),this.g.Cc(o,h),this.g.Bc(h,o)):(this.g.Bc(i,s),this.g.Cc(s,i),this.g.Bc(o,h),this.g.Cc(h,o)),!0)},f.prototype.tD=function(r,n,t,i,h,s){this.MY?this.VM():this.UM(r,n,t,i,h,s)},f.prototype.VM=function(){throw e.i.fa("not implemented.")},f.prototype.UM=function(r,n,t,i,h,s){if(r!=n)r?(this.g.Bc(t,h),this.g.Cc(h,t),this.g.Bc(s,i),this.g.Cc(i,s),this.vn(h,t),this.ui(h,!0),this.g.mi(h,!0),this.bk(t),this.vn(s,i),this.ui(s,!0),this.g.mi(s,!1)):(this.g.Bc(h,t),this.g.Cc(t,h),this.g.Bc(i,s),this.g.Cc(s,i),this.vn(h,t),this.ui(h,!0),this.g.mi(h,!1),this.bk(t),this.vn(s,i),this.ui(s,!0),this.g.mi(s,!0)),this.bk(i);else{var o=r?t:i,a=n?h:s;for(r=r?i:t,n=n?s:h,h=!1,this.g.Bc(o,a),this.g.Bc(a,o),this.g.Cc(r,n),this.g.Cc(n,r),s=n;s!=a;)t=this.g.Ma(s),i=this.g.U(s),this.g.Cc(s,i),this.g.Bc(s,t),h=h||s==o,s=i;h||(t=this.g.Ma(a),i=this.g.U(a),this.g.Cc(a,i),this.g.Bc(a,t)),this.vn(a,o),this.ui(a,!0),this.g.mi(a,!1),this.bk(o),this.vn(n,r),this.ui(n,!0),this.g.mi(n,!1),this.bk(r)}},f.prototype.cD=function(){for(var r=!1,n=this.g.Ob(this.X);n!=-1;){for(var t=this.g.Xa(n),i=0,h=this.g.Ja(n);ithis.g.Ja(n)){for(r=this.g.Xa(n),i=0,h=this.g.Ja(n);i=n)throw e.i.N("Invalid or unsupported wkid: "+n);var t=new r;return t.dg=n,t},r.qP=function(n){if(n==null||n.length==0)throw e.i.N("Cannot create SpatialReference from null or empty text.");var t=new r;return t.wh=n,t},r.prototype.Nb=function(n){return this==n||n!=null&&this.constructor==n.constructor&&this.dg==n.dg&&(this.dg!=0||this.wh===n.wh)},r.prototype.toString=function(){return"[ tol: "+this.Kn()+"; wkid: "+this.Ec()+"; wkt: "+this.Bz()+"]"},r.prototype.cc=function(){if(this.pp!=="")return this.pp;var n=this.toString();if(Array.prototype.reduce)return this.pp="S"+n.split("").reduce(function(h,s){return(h=(h<<5)-h+s.charCodeAt(0))&h},0);var t=0;if(n.length===0)return"";for(var i=0;i=n.length)throw e.i.N();var t=null;try{t=e.NC.fromString(n)}catch{t=null}return t==null?null:r.bD(t,!0)},r.prototype.by=function(n){this.Kd=n,this.Eo=this.Kd.Hd()},r.prototype.gy=function(n){this.KH=n,this.ST=this.KH!=null?this.KH.Eo:null},r.prototype.Wc=function(){return this.Sb()!=0&&this.Sb()!=3&&this.Kd.Wc()},r.prototype.IG=function(){return this.Sb()!=0&&(this.Sb()==3?this.Ji.fk().Wc():this.Kd.Wc())},r.prototype.eh=function(){return this.Kd!=null?this.Kd.Ue:null},r.prototype.pm=function(){return this.Kd.pm()},r.prototype.bf=function(){return this.Kd.bf()},r.prototype.hh=function(){return this.Kd!=null?this.Kd.sw:NaN},r.prototype.Up=function(){return this.Kd.Up()},r.prototype.Wr=function(){return this.Kd.Wr()},r.prototype.kk=function(){return this.Kd.kk()},r.prototype.kS=function(n){return e.OC.Py(this.Kd,n.Kd)},r.prototype.ml=function(){return this.Kd.ml()},r.prototype.Vr=function(){return this.Kd.Vr()},r.prototype.zi=function(){return this.Sb()==3?this.Ji.fk().zi():this.Kd.zi()},r.prototype.gh=function(){if(!this.Wc())throw e.i.N("!isPannable()");var n=new e.l;return this.Kd.gh(n),n},r.prototype.Oe=function(){if(!this.Wc())throw e.i.N("!isPannable()");return this.Kd.so},r.prototype.HR=function(){if(!this.Wc())throw e.i.N("!isPannable()");var n=new e.l;return this.Kd.GR(n),n},r.prototype.pv=function(){if(!this.Wc())throw e.i.N("!isPannable()");return this.Kd.pv()},r.prototype.ov=function(){if(!this.Wc())throw e.i.N("!isPannable()");return this.Kd.ov()},r.prototype.Xr=function(){return this.Ji!=null?this.Ji.fk().Xr():this.Kd.Xr()},r.prototype.PQ=function(){return this.Kd.hv()},r.prototype.Qp=function(){return this.Eo.getUnitFactor()},r.prototype.vz=function(n){return this.Hq.vz(n)},r.prototype.sc=function(){var n=this.Sb();if(n==1)return this;if(n==3)return this.Ji.fk().sc();if(n==0||n===4)throw e.i.fa("invalid call");if(this.jw!==null)return this.jw;if((n=this.eh().getGeogcs())==null)throw e.i.Qa();return this.jw=r.bF(n,this.Hq.VF())},r.bF=function(n,t){if(n==null)throw e.i.N("null pointer.");var i=new r;return n=r.mu(n,!0),i.Hq.Xx(n,null,t),i.by(n),i.gy(null),i.dg=n.$r(),i},r.prototype.Sb=function(){var n=this.eh();if(n!=null)switch(n.getType()){case e.Sc.PE_TYPE_GEOGCS:return 1;case e.Sc.PE_TYPE_PROJCS:return 2}return 4},r.prototype.hv=function(){return this.Kd.hv()},r.mu=function(n,t){var i=n.getCode();if(0>=i&&0<(i=e.pf.getCode(n))){if((n=e.pf.coordsys(i))==null)throw e.i.N("Text to wkid mapping had failed: "+i);return r.mu(n,t)}if(t&&0=i?n:e.pf.coordsys(i),n=new e.OC(n),r.lK[t]=n,0=n)throw e.i.N("Invalid or unsupported wkid: "+n);var t=r.qx[n];if(t!=null)return t;if((t=e.pf.coordsys(n))==null)throw e.i.N("Invalid or unsupported wkid: "+n);return(t=r.mu(t,!1)).$r()!=n&&(r.qx[n]=t),t},r.kM=function(n){if(n==null||n===void 0||n.length==0)throw e.i.N("Cannot create SpatialReference from null or empty text.");var t=null;try{t=e.pf.fromString(e.Sc.PE_TYPE_COORDSYS,n)}catch(i){throw e.i.N("Cannot create SpatialReference from text. "+i.message)}if(t===null)throw e.i.N("Cannot create SpatialReference from text. ");return r.mu(t,!0)},r.bD=function(n,t){var i,h=n.getCode();if(0>=h&&0<(h=e.pf.getCode(n))){if((h=e.pf.vertcs(h))===null)throw e.i.N();return r.bD(h,t)}if(t&&0=h||(i=e.pf.vertcs(h)),i===null)throw e.i.N();return i=new e.PL(i),r.mK[n]=i,0t&&(this.Pj=t/(h-this.Fm)),i=this.Gm+i,(s=e.O.truncate((i-this.Gm)*this.Pj))>t&&(this.Pj=t/(i-this.Gm))}},n.prototype.aC=function(t){switch(t){case 0:this.Ik=void 0;case 1:this.Mq=void 0;case 2:this.Lq=void 0}},n.prototype.Kn=function(t){switch(t){case 0:return this.Ik;case 1:return this.Mq;case 2:return this.Lq}return 0},n.prototype.vz=function(t){if(this.Rm==v.FloatingPoint)return 0;switch(t){case 0:return 1/this.Pj;case 1:case 2:return 1/this.Fo;default:return 0}},n.prototype.toString=function(){var t="SRPD [m_toleranceXY: "+this.Ik.toString();return(t=(t=(t=(t=(t=(t=(t=(t=(t=t+";m_falseX: "+this.Fm.toString())+";m_falseY: "+this.Gm.toString())+";m_unitsXY: "+this.Pj.toString())+";m_falseZ: "+this.sA.toString())+";m_unitsZ: "+this.Fo.toString())+";m_falseM: "+this.rA.toString())+";m_toleranceZ: "+this.Mq.toString())+";m_toleranceM: "+this.Lq.toString())+";m_precision: "+this.Rm.toString())+"] "},n}();e.ZL=r}(k||(k={})),function(e){function v(h,s){return 89.99999s&&(s=-89.99999),s*=.017453292519943,[111319.49079327169*h,31890685e-1*Math.log((1+Math.sin(s))/(1-Math.sin(s)))]}function f(h,s,o){return h=h/6378137*57.29577951308232,o?[h,57.29577951308232*(1.5707963267948966-2*Math.atan(Math.exp(-1*s/6378137)))]:[h-360*Math.floor((h+180)/360),57.29577951308232*(1.5707963267948966-2*Math.atan(Math.exp(-1*s/6378137)))]}function r(h,s,o){var a=h.Of();if(h.getType()===33)s=s(a.Lg(),a.ih()),a.Cb(s[0],s[1]);else if(h.getType()===197){var u=s(h.es(),h.gs(),o);s=s(h.ds(),h.fs(),o),a.K(u[0],u[1],s[0],s[1])}else for(u=new e.h,h=0;ho&&(o=637.100877141506);for(var a,u=[],c=0;cthis.Hg&&this.Dz(r)},f.prototype.tx=function(r,n){r*=this.stride,n*=this.stride;for(var t=0;tthis.ns.va)return 1;s=h.na==h.la;var o=i.na==i.la;if(s||o){if(s&&o)return 0;if(h.na==i.na&&h.sa==i.sa)return s?1:-1;if(h.la==i.la&&h.pa==i.pa)return s?-1:1}return(s=h.Pe(this.yh,this.ms.oa))==(o=i.Pe(this.yh,this.ns.oa))&&((o=.5*((s=Math.min(h.la,i.la))+this.yh))==this.yh&&(o=s),s=h.Pe(o,this.ms.oa),o=i.Pe(o,this.ns.oa)),so?1:0},t.prototype.aK=function(i){this.yh=i},t}(),n=function(){function t(i){this.ib=i,this.WH=new e.ig,this.Bf=new e.h,this.wA=new e.Nc}return t.prototype.kX=function(i){this.Bf.L(i)},t.prototype.compare=function(i,h){return this.ib.pB(i.ja(h),this.WH),i=this.WH.get(),this.wA.K(i.sa,i.pa),this.Bf.xthis.wA.va?1:(i=i.Pe(this.Bf.y,this.Bf.x),this.Bf.xi?1:0)},t}();v=function(){function t(){this.hH=this.Di=this.Gi=this.kA=this.Yn=this.ye=this.Kc=this.jh=this.ge=null,this.Go=this.xg=-1,this.gH=!0,this.pA=!1,this.lA=NaN,this.Ni=new e.Md,this.bO=2147483647,this.aO=e.O.truncate(-2147483648),this.cg=this.ae=this.Hl=this.Cq=this.Cm=this.Bq=this.Os=this.Re=-1,this.wa=0}return t.prototype.yy=function(i){this.lA=i},t.prototype.Ym=function(){this.ge==null&&(this.ge=new e.$c(8));var i=this.ge.Ce();return this.ge.S(i,1,0),i},t.prototype.vU=function(){this.Kc==null&&(this.Kc=new e.$c(8));var i=this.Kc.Ce();this.Kc.S(i,2,0),this.Kc.S(i,3,0);var h=this.Kc.Ce();return this.Kc.S(h,2,0),this.Kc.S(h,3,0),this.JJ(i,h),this.JJ(h,i),i},t.prototype.mI=function(){this.ye==null&&(this.ye=new e.$c(8));var i=this.ye.Ce();return this.ye.S(i,2,0),i},t.prototype.TW=function(i,h){this.ge.S(i,7,h)},t.prototype.mn=function(i,h){this.ge.S(i,2,h)},t.prototype.SW=function(i,h){this.ge.S(i,1,h)},t.prototype.lX=function(i,h){this.ge.S(i,3,h)},t.prototype.iX=function(i,h){this.ge.S(i,4,h)},t.prototype.cr=function(i,h){this.ge.S(i,5,h)},t.prototype.eR=function(i){return this.ge.T(i,5)},t.prototype.RW=function(i,h){this.ge.S(i,6,h)},t.prototype.cN=function(i,h){this.RW(h,i)},t.prototype.IJ=function(i,h){this.Kc.S(i,1,h)},t.prototype.JJ=function(i,h){this.Kc.S(i,4,h)},t.prototype.Tl=function(i,h){this.Kc.S(i,5,h)},t.prototype.Sl=function(i,h){this.Kc.S(i,6,h)},t.prototype.$W=function(i,h){this.Kc.S(i,2,h)},t.prototype.$w=function(i,h){this.Kc.S(i,3,h)},t.prototype.LF=function(i){return this.Kc.T(i,3)},t.prototype.Gt=function(i,h){this.Kc.S(i,7,h)},t.prototype.EK=function(i,h){if(this.mm(i)!=-1)for(h=h?-1:i,i=this.mm(i);i!=-1;i=this.js(i))this.g.Ra(this.tj(i),this.Cq,h)},t.prototype.yx=function(i,h){i!=-1&&(this.EK(i,h),this.EK(this.xa(i),h))},t.prototype.Dt=function(i,h){this.ye.S(i,1,h)},t.prototype.Vg=function(i,h){this.ye.S(i,2,h)},t.prototype.jn=function(i,h){this.ye.S(i,3,h),this.NW(i,this.dR(h)),this.MW(h,i)},t.prototype.MW=function(i,h){this.ye.S(i,4,h)},t.prototype.NW=function(i,h){this.ye.S(i,5,h)},t.prototype.DJ=function(i,h){this.ye.S(i,6,h)},t.prototype.BJ=function(i,h){this.ye.S(i,7,h)},t.prototype.AJ=function(i,h){this.Yn.write(i,h)},t.prototype.CJ=function(i,h){this.kA.write(i,h)},t.prototype.kY=function(i){var h=0,s=0,o=this.AF(i),a=new e.h,u=new e.h,c=new e.h;this.Yr(o,a),u.L(a);var l=o;do this.lm(l,c),s+=e.h.tb(u,c),this.$e(this.xa(l))!=i&&(h+=(c.x-a.x-(u.x-a.x))*(c.y-a.y+(u.y-a.y))*.5),u.L(c),l=this.jc(l);while(l!=o);this.Yn.write(i,h),this.kA.write(i,s)},t.prototype.PU=function(i,h){var s=new r(this),o=new e.Yj;o.De(e.O.truncate(this.wa/2)),o.Vo(s);for(var a=new e.ia(0),u=this.$g(),c=null,l=0,p=new e.h,y=this.Re;y!=-1;y=this.Rf(y)){if(!(255&++l)&&h!=null&&!h.progress(-1,-1))throw e.i.WC();var d=this.Me(y);if(d!=-1){if(a.Bh(0),!this.gY(o,u,a,d)){this.D(y,p),s.aK(p.y);var g=d;do{var b=this.Ab(g,u);b!=-1&&(o.vd(b,-1),this.Kb(g,u,-2)),g=this.jc(this.xa(g))}while(d!=g);g=d;do(b=this.Ab(g,u))==-1&&(b=o.addElement(g,-1),a.add(b)),g=this.jc(this.xa(g));while(d!=g)}for(d=a.size-1;0<=d;d--)b=a.get(d),g=o.ja(b),this.Kb(this.xa(g),u,b),this.OU(o,b,i)}else this.cz(y)==-1&&(c==null&&(c=new n(this)),this.D(y,p),c.kX(p),g=o.IW(c),d=this.Hl,g!=-1&&(b=o.ja(g),this.$e(b)==this.$e(this.xa(b))&&(b=this.OF(o,g)),b!=-1&&(d=this.$e(b))),this.cN(d,y))}this.Jg(u)},t.prototype.OU=function(i,h,s){var o=i.ja(h),a=this.$e(o);if(this.Gn(a)==-1){var u=this.OF(i,h),c=this.xa(o),l=this.$e(c);this.Kp(a),this.Kp(l);var p=this.Gn(a),y=this.Gn(l);if(u==-1&&p==-1&&(l==a?(this.jn(l,this.Hl),p=y=this.Hl):(y==-1&&(this.jn(l,this.Hl),y=this.Hl),this.jn(a,l),p=l)),u!=-1){var d=this.$e(u);y==-1&&(0>=this.Kp(d)?(y=this.Gn(d),this.jn(l,y)):(this.jn(l,d),y=d),l==a&&(p=y))}p==-1&&this.hY(a,l),s==0?this.jW(i,h,o,u,a,l):s==5?this.kW(i,h,o,c,a,l):s==4&&this.iW(o,u,a,l)}},t.prototype.jW=function(i,h,s,o,a,u){var c=this.hk(a);if(o!=-1){var l=this.hk(u),p=this.hk(this.$e(o));o=c&l&p,p^=p&this.dh(s),(p|=o)!=0&&(this.Vg(u,l|p),this.Vg(a,p|c),c=c||p)}for(h=i.lb(h);h!=-1&&(o=i.ja(h),s=this.$e(this.xa(o)),a=this.hk(s),u=this.dh(o),l=this.$e(o),o=a&(p=this.hk(l))&c,c^=c&u,(c|=o)!=0);h=i.lb(h))this.Vg(s,a|c),this.Vg(l,p|c)},t.prototype.kW=function(i,h,s,o,a,u){if(a!=u){s=this.Ab(s,this.cg),s+=this.Ab(o,this.cg),o=0;var c=new e.ia(0),l=new e.ia(0);l.add(0);for(var p=i.rc(-1);p!=h;p=i.lb(p)){var y=i.ja(p),d=this.xa(y),g=this.$e(y),b=this.$e(d);if(g!=b){if(y=this.Ab(y,this.cg),o+=y+=this.Ab(d,this.cg),d=!1,c.size!=0&&c.Fc()==b&&(l.If(),c.If(),d=!0),this.Gn(b)==-1)throw e.i.Qa();d&&this.Gn(b)==g||(l.add(o),c.add(g))}}o+=s,c.size!=0&&c.Fc()==u&&(l.If(),c.If()),o!=0?l.Fc()==0&&(i=this.g.ld,i=this.La(i),this.Vg(a,i)):l.Fc()!=0&&(i=this.g.ld,i=this.La(i),this.Vg(a,i))}},t.prototype.iW=function(i,h,s,o){var a=this.La(this.g.ld);if(h==-1)this.Vg(o,this.Go),1&(i=this.Ab(i,this.xg))?this.Vg(s,a):this.Vg(s,this.Go);else{var u=this.hk(o);u==0?(u=this.hk(this.$e(h)),this.Vg(o,u),1&(i=this.Ab(i,this.xg))?this.Vg(s,u==a?this.Go:a):this.Vg(s,u)):1&(i=this.Ab(i,this.xg))?this.Vg(s,u==a?this.Go:a):this.Vg(s,u)}},t.prototype.gY=function(i,h,s,o){var a=o,u=-1,c=-1,l=0;do{if(l==2)return!1;var p=this.Ab(a,h);if(p!=-1){if(u!=-1)return!1;u=p}else{if(c!=-1)return!1;c=a}l++,a=this.jc(this.xa(a))}while(o!=a);return c!=-1&&u!=-1&&(this.Kb(i.ja(u),h,-2),i.Sj(u,c),s.add(u),!0)},t.prototype.hY=function(i,h){var s=this.Kp(i);if(s!=0){var o=this.Kp(h);0o||0>s&&0y.compare(a)?p=1:u=-1,this.Kb(g,this.ae,0),this.Kb(d,this.ae,0),this.Kb(d,this.cg,p),this.Kb(g,this.cg,u)):i==7?(this.Kb(g,this.ae,this.Go),this.Kb(d,this.ae,l==1736?c:0)):i==4&&(this.Kb(g,this.ae,0),this.Kb(d,this.ae,0),this.Kb(d,this.xg,1),this.Kb(g,this.xg,1)),l=l==1736?this.aO:0,this.$w(d,c|l),this.$w(g,c|l)}}}}},t.prototype.VT=function(i,h){var s=this.mm(h);if(s!=-1){var o=this.mm(i);this.jh.S(s,1,o),this.Gt(i,s),this.Gt(h,-1)}i=this.xa(i),h=this.xa(h),(s=this.mm(h))!=-1&&(o=this.mm(i),this.jh.S(s,1,o),this.Gt(i,s),this.Gt(h,-1))},t.prototype.IX=function(i){function h(M,A){return o.HO(M,A)}var s=new e.ia(0);s.Jb(10);for(var o=this,a=this.Re;a!=-1;a=this.Rf(a)){s.clear(!1);var u=this.Me(a);if(u!=-1){var c=u;do s.add(c),c=this.jc(this.xa(c));while(c!=u);if(1n.Db())return f.ki(f.Xe(n.Ia()),r,"&")}return s=new f,o=(h=new e.gd).Ib(f.Xe(r)),n=h.Ib(f.Xe(n)),s.Ft(h,t,i),i=s.Av(o,n),r=f.ki(h.Ne(i),r,"&"),e.aa.Hc(r.getType())&&(r.Ch(2,t),r.getType()==1736&&r.fm()),r},f.bW=function(r,n,t){if(r.B()||n.B())return r.Ia();var i=[null],h=[0],s=n.Db()==2;if(n.Db()!=1&&n.Db()!=2)throw e.i.Qa();return i[0]=r.D(),s?e.hd.sK(n,i,1,t,h):e.hd.tK(n,i,1,t,h),h[0]==0?r.Ia():r},f.prototype.LU=function(r,n,t,i,h){if(r.B())return r;var s=new e.gd;return r=s.Ib(r),this.Mk(s,r,n,t,i,h)},f.prototype.NU=function(r,n,t,i,h,s){if(h&&r.ic(n)!=550){var o=new e.RC;o.TX(r,t),o.Ng?(e.Tk.V(r,t,s,!0),h=!1):this.j.yy(t)}else e.Tk.V(r,t,s,!0),h=!1;if(i&&r.ic(n)!=550?this.j.wJ(r,n,s):this.j.vJ(r,n,s),this.j.pA)return this.j.Ug(),this.j=null,this.Mk(r,n,t,i,!1,s);if(this.j.yy(NaN),s=this.j.La(n),this.bq(s+1),this.Gj[s]=!0,r.ic(n)==1736||i&&r.ic(n)!=550)return r.Yo(n,0),n=this.Ot(n,-1,-1),(r=r.Ne(n)).Yo(0),h?r.Ch(1,0):(r.Ch(2,t),r.fm()),r;if(r.ic(n)==1607)return n=this.Pt(-1),r=r.Ne(n),h||r.Ch(2,t),r;if(r.ic(n)==550)return n=this.mr(),r=r.Ne(n),h||r.Ch(2,t),r;throw e.i.Qa()},f.prototype.Mk=function(r,n,t,i,h,s){this.j=new e.iu;try{return this.NU(r,n,t,i,h,s)}finally{this.j.Ug()}},f.Mk=function(r,n,t,i,h){return new f().LU(r,n,t,i,h)},f.prototype.MU=function(r,n,t,i){this.Mv=r,this.j=new e.iu,r=n.In(t);var h=n.ic(t);if(r!=1||h==550?this.j.vJ(n,t,i):this.j.wJ(n,t,i),!this.j.pA)if(this.j.yy(NaN),i=this.j.La(t),this.bq(i+1),this.Gj[i]=!0,n.ic(t)==1736||r==1&&n.ic(t)!=550)n.Yo(t,0),i=this.Ot(t,-1,-1),n.hC(i,t),n.BB(i);else if(n.ic(t)==1607)i=this.Pt(-1),n.hC(i,t),n.BB(i);else{if(n.ic(t)!=550)throw e.i.fa("internal error");i=this.mr(),n.hC(i,t),n.BB(i)}},f.prototype.im=function(r,n){var t=e.aa.tf(this.j.g.ic(r)),i=e.aa.tf(this.j.g.ic(n));if(t>i)return r;var h=this.j.La(r),s=this.j.La(n);if(this.bq(1+(h|s)),this.Gj[this.j.La(r)]=!0,t==2&&i==2)return this.Ot(r,n,-1);if(t==1&&i==2||t==1&&i==1)return this.Pt(-1);if(t==0)return this.mr();throw e.i.Qa()},f.prototype.Av=function(r,n){var t=e.aa.tf(this.j.g.ic(r)),i=e.aa.tf(this.j.g.ic(n)),h=this.j.La(r),s=this.j.La(n);if(this.bq(1+(h|s)),this.Gj[this.j.La(r)|this.j.La(n)]=!0,h=-1,1n.Db())return f.ki(f.Xe(r),r,"-");var h=new e.l;r.A(h);var s=new e.l;if(n.A(s),!h.isIntersecting(s))return f.ki(f.Xe(r),r,"-");var o=new e.l;return o.K(h),o.Zb(s),t=e.ta.Wd(t,o,!0),s=new f,o=(h=new e.gd).Ib(f.Xe(r)),n=h.Ib(f.Xe(n)),s.Ft(h,t,i),i=s.im(o,n),i=h.Ne(i),r=f.ki(i,r,"-"),e.aa.Hc(r.getType())&&(r.Ch(2,t),r.getType()==1736&&r.fm()),r},f.VP=function(r,n,t){if(2>r.length)throw e.i.N("not enough geometries to dissolve");for(var i=0,h=0,s=r.length;hc?f.Xe(r[l]):(r=i==2,n=e.ta.Wd(i==0?n:null,o,!0),new f().Mk(a,u,n,r,!0,t))},f.Pz=function(r,n,t,i){var h=[null,null,null],s=new e.l;r.A(s);var o=new e.l;n.A(o);var a=new e.l;if(a.K(s),a.Zb(o),t=e.ta.Wd(t,a,!0),(a=new e.l).K(o),o=e.ta.Er(t),a.W(o,o),!s.isIntersecting(a)){if(r.Db()<=n.Db())return h[(r=f.ki(f.Xe(r.Ia()),r,"&")).Db()]=r,h;if(r.Db()>n.Db())return h[(r=f.ki(f.Xe(n.Ia()),r,"&")).Db()]=r,h}for(o=new f,a=(s=new e.gd).Ib(f.Xe(r)),n=s.Ib(f.Xe(n)),o.Ft(s,t,i),i=o.Pz(a,n),n=0;nn.Db())return f.ki(f.Xe(r),r,"^");if(r.Db()t;t++)n[t]=new e.h;r.nB(n),this.fY(n,n),r.Zw(n,4)}},f.prototype.fY=function(r,n){for(var t=0;t(n=.5*n.Sk())?Math.sqrt(i):Math.sqrt(n))},f.prototype.RB=function(){this.bb=1,this.jb=this.Gb=this.eb=0,this.ab=1,this.Lb=0},f.prototype.isIdentity=function(r){if(r!==void 0){var n=e.h.construct(0,1);return this.Eh(n,n),n.sub(e.h.construct(0,1)),n.Sk()>r*r?!1:(n.ma(0,0),this.Eh(n,n),!(n.Sk()>r*r)&&(n.ma(1,0),this.Eh(n,n),n.sub(e.h.construct(1,0)),n.Sk()<=r*r))}return this.bb==1&&this.ab==1&&this.eb==0&&this.Gb==0&&this.jb==0&&this.Lb==0},f.prototype.Bi=function(r){return Math.abs(this.bb*this.ab-this.jb*this.eb)<=2*r*(Math.abs(this.bb*this.ab)+Math.abs(this.jb*this.eb))},f.prototype.gg=function(r,n){this.bb=1,this.eb=0,this.Gb=r,this.jb=0,this.ab=1,this.Lb=n},f.prototype.setScale=function(r,n){n!==void 0?(this.bb=r,this.jb=this.Gb=this.eb=0,this.ab=n,this.Lb=0):this.setScale(r,r)},f.prototype.$B=function(){this.bb=0,this.eb=1,this.Gb=0,this.jb=1,this.Lb=this.ab=0},f.prototype.setRotate=function(r){this.pX(Math.cos(r),Math.sin(r))},f.prototype.pX=function(r,n){this.bb=r,this.eb=-n,this.Gb=0,this.jb=n,this.ab=r,this.Lb=0},f.prototype.shift=function(r,n){this.Gb+=r,this.Lb+=n},f.prototype.scale=function(r,n){this.bb*=r,this.eb*=r,this.Gb*=r,this.jb*=n,this.ab*=n,this.Lb*=n},f.prototype.flipX=function(r,n){this.bb=-this.bb,this.eb=-this.eb,this.Gb=r+n-this.Gb},f.prototype.flipY=function(r,n){this.jb=-this.jb,this.ab=-this.ab,this.Lb=r+n-this.Lb},f.prototype.rotate=function(r){var n=new f;n.setRotate(r),this.multiply(n)},f.prototype.inverse=function(r){if(r!==void 0){var n=this.bb*this.ab-this.eb*this.jb;n==0?r.lx():(n=1/n,r.Gb=(this.eb*this.Lb-this.Gb*this.ab)*n,r.Lb=(this.Gb*this.jb-this.bb*this.Lb)*n,r.bb=this.ab*n,r.eb=-this.eb*n,r.jb=-this.jb*n,r.ab=this.bb*n)}else this.inverse(this)},f}();e.Dd=v}(k||(k={})),function(e){var v=function(){function f(){}return f.prototype.lx=function(){this.hg=this.Lb=this.Gb=this.He=this.Fe=this.Ee=this.Ge=this.ab=this.eb=this.Ze=this.jb=this.bb=0},f.prototype.setScale=function(r,n,t){this.bb=r,this.eb=this.Ze=this.jb=0,this.ab=n,this.Fe=this.Ee=this.Ge=0,this.He=t,this.hg=this.Lb=this.Gb=0},f.prototype.setTranslate=function(r,n,t){this.bb=1,this.eb=this.Ze=this.jb=0,this.ab=1,this.Fe=this.Ee=this.Ge=0,this.He=1,this.Gb=r,this.Lb=n,this.hg=t},f.prototype.translate=function(r,n,t){this.Gb+=r,this.Lb+=n,this.hg+=t},f.prototype.mC=function(r){if(!r.B()){for(var n=new e.Nd[8],t=0;8>t;t++)n[t]=new e.Nd;r.nB(n),this.transform(n,8,n),r.Zw(n)}},f.prototype.transform=function(r,n,t){for(var i=0;ii;i++)t.uh[i]=-1;t.uh[t.bg[0]]=0}return t.jq=!0,t}return J(n,r),n.prototype.re=function(t){this.hasAttribute(t)||(this.uh[t]=0,this.jD())},n.prototype.removeAttribute=function(t){if(t==0)throw e.i.N("Position attribue cannot be removed");this.hasAttribute(t)&&(this.uh[t]=-1,this.jD())},n.prototype.reset=function(){this.bg[0]=0,this.Aa=1;for(var t=0;tt;t++)0<=this.uh[t]&&(this.bg[i]=t,this.uh[t]=i,i++,this.Aa++);this.jq=!0},n.prototype.cc=function(){return this.jq&&(this.wl=this.An(),this.jq=!1),this.wl},n.prototype.Nb=function(t){if(t==null)return!1;if(t==this)return!0;if(!(t instanceof n)||t.Aa!=this.Aa)return!1;for(var i=0;is;s++)!t.hasAttribute(s)&&i.hasAttribute(s)&&(h==null&&(h=new n(t)),h.re(s));return h!=null?h.EF():t},n}(e.ra);e.ee=v;var f=function(){function r(){this.map=[];var n=new v;this.add(n),(n=new v).re(1),this.add(n)}return r.kz=function(){return r.bL},r.prototype.$R=function(){return r.ft},r.prototype.add=function(n){var t=n.cc();if(r.ft!=null&&r.ft.cc()==t&&n.GG(r.ft))return r.ft;if(r.Dw!=null&&r.Dw.cc()==t&&n.GG(r.Dw))return r.Dw;var i=null;return this.map[t]!==void 0&&(i=this.map[t]),i==null&&((i=n.tM()).Aa==1?r.ft=i:i.Aa==2&&i.kd(1)==1?r.Dw=i:this.map[t]=i),i},r.bL=new r,r}()}(k||(k={}));var kt={feet:9002,kilometers:9036,meters:9001,miles:9093,"nautical-miles":9030,yards:9096},Mt={acres:109402,ares:109463,hectares:109401,"square-feet":109405,"square-kilometers":109414,"square-meters":109404,"square-miles":109439,"square-yards":109442},at=new(function(){function e(){this.RM=50,this.np=new Map,this.gj=[]}return e.prototype.clear=function(){this.gj.length=0,this.np.clear()},e.prototype.delete=function(v){return!!this.np.delete(v)&&(this.gj.splice(this.gj.indexOf(v),1),!0)},e.prototype.get=function(v){var f=this.np.get(v);if(f!==void 0)return this.gj[0]!==v&&(this.gj.splice(this.gj.indexOf(v),1),this.gj.unshift(v)),f},e.prototype.has=function(v){return this.np.has(v)},e.prototype.set=function(v,f){return this.get(v)!==void 0&&this.delete(v),this.gj.unshift(v),this.np.set(v,f),this.oM(),this},e.prototype.oM=function(){for(;this.gj.length&&this.gj.length>this.RM;){var v=this.gj.pop();this.np.delete(v)}},e}()),P=((Z={}).convertJSONToGeometry=function(e){return k.$b.fP(e)},Z.hasM=function(e){return e.hasAttribute(k.Ih.M)},Z.hasZ=function(e){return e.hasAttribute(k.Ih.Z)},Z.getPointX=function(e){return e.Lg()},Z.getPointY=function(e){return e.ih()},Z.getPointZ=function(e){return e.bS()},Z.getPointM=function(e){return e.zR()},Z.getXMin=function(e){return e.es()},Z.getYMin=function(e){return e.gs()},Z.getXMax=function(e){return e.ds()},Z.getYMax=function(e){return e.fs()},Z.getZExtent=function(e){return e.Tg(k.Ih.Z,0)},Z.getMExtent=function(e){return e.Tg(k.Ih.M,0)},Z.exportPaths=function(e){var v=[],f=e.da(),r=null,n=null,t=e.hasAttribute(k.Ih.Z),i=e.hasAttribute(k.Ih.M);t&&(r=e.ub(k.Ih.Z)),i&&(n=e.ub(k.Ih.M));for(var h=new k.h,s=0;sk.getLogger("esri.geometry.support.meshUtils.normalProjection");function se(t,e,r,n,o){return V(n)?(I(y.TO_PCPF,$.fromTypedArray(t),A.fromTypedArray(e),A.fromTypedArray(r),n,$.fromTypedArray(o)),o):(B().error("Cannot convert spatial reference to PCPF"),o)}function le(t,e,r,n,o){return V(n)?(I(y.FROM_PCPF,$.fromTypedArray(t),A.fromTypedArray(e),A.fromTypedArray(r),n,$.fromTypedArray(o)),o):(B().error("Cannot convert to spatial reference from PCPF"),o)}function ce(t,e,r){return z(t,e,0,r,R(e),0,t.length/3),r}function ue(t,e,r){return z(t,R(r),0,e,r,0,t.length/3),e}function fe(t,e,r){return G(u,r),T(e,t,u),gt(u)||$t(e,e),e}function pe(t,e,r){if(G(u,r),T(e,t,u,4),gt(u)||$t(e,e,4),t!==e)for(let n=3;nk.getLogger("esri.geometry.support.meshUtils.normalProjection");function se(t,e,r,n,o){return V(n)?(I(y.TO_PCPF,$.fromTypedArray(t),A.fromTypedArray(e),A.fromTypedArray(r),n,$.fromTypedArray(o)),o):(B().error("Cannot convert spatial reference to PCPF"),o)}function le(t,e,r,n,o){return V(n)?(I(y.FROM_PCPF,$.fromTypedArray(t),A.fromTypedArray(e),A.fromTypedArray(r),n,$.fromTypedArray(o)),o):(B().error("Cannot convert to spatial reference from PCPF"),o)}function ce(t,e,r){return z(t,e,0,r,R(e),0,t.length/3),r}function ue(t,e,r){return z(t,R(r),0,e,r,0,t.length/3),e}function fe(t,e,r){return G(u,r),T(e,t,u),gt(u)||$t(e,e),e}function pe(t,e,r){if(G(u,r),T(e,t,u,4),gt(u)||$t(e,e,4),t!==e)for(let n=3;n2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:n;if(Array.isArray(e))e.forEach(function(o){return t(a,o,n,i)});else if(typeof e=="function")e(a,n,i,t);else{var d=Object.keys(e)[0];Array.isArray(e[d])?(i[d]={},t(a,e[d],n,i[d])):i[d]=e[d](a,n,i,t)}return n};w.parse=q;var V=function(t,a){return function(e,n,i,d){a(e,n,i)&&d(e,t,n,i)}};w.conditional=V;var $=function(t,a){return function(e,n,i,d){for(var o=[],c=e.pos;a(e,n,i);){var l={};if(d(e,t,n,l),e.pos===c)break;c=e.pos,o.push(l)}return o}};w.loop=$;var f={};Object.defineProperty(f,"__esModule",{value:!0}),f.readBits=f.readArray=f.readUnsigned=f.readString=f.peekBytes=f.readBytes=f.peekByte=f.readByte=f.buildStream=void 0;var H=function(t){return{data:t,pos:0}};f.buildStream=H;var T=function(){return function(t){return t.data[t.pos++]}};f.readByte=T;var J=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(a){return a.data[a.pos+t]}};f.peekByte=J;var _=function(t){return function(a){return a.data.subarray(a.pos,a.pos+=t)}};f.readBytes=_;var K=function(t){return function(a){return a.data.subarray(a.pos,a.pos+t)}};f.peekBytes=K;var L=function(t){return function(a){return Array.from(_(t)(a)).map(function(e){return String.fromCharCode(e)}).join("")}};f.readString=L;var N=function(t){return function(a){var e=_(2)(a);return t?(e[1]<<8)+e[0]:(e[0]<<8)+e[1]}};f.readUnsigned=N;var Q=function(t,a){return function(e,n,i){for(var d=typeof a=="function"?a(e,n,i):a,o=_(t),c=new Array(d),l=0;l=g){var m=g-r.pos;u.push((0,e.readBytes)(m)(r)),h+=m;break}u.push((0,e.readBytes)(y)(r)),h+=y}for(var x=new Uint8Array(h),b=0,v=0;v>=o,h-=o,r>n||r==c)break;if(r==i){d=(1<<(o=u+1))-1,n=i+2,p=C;continue}if(p==C){A[m++]=k[r],p=r,y=r;continue}for(l=r,r==n&&(A[m++]=y,r=p);r>i;)A[m++]=k[r],r=M[r];y=255&k[r],A[m++]=y,nc[r],width:i,height:d}}function ce(t){return U??(U=document.createElement("canvas")),D??(D=U.getContext("2d",{willReadFrequently:!0})),U.width=t.width,U.height=t.height,D.putImageData(t,0,0),U}G=B.decompressFrames=se;const le=[71,73,70];function fe(t){const a=new Uint8Array(t);return!le.some((e,n)=>e!==a[n])}function ye(t){if(!fe(t))return!1;const a=new DataView(t),e=a.getUint8(10);let n=13+(128&e?3*2**(1+(7&e)):0),i=0,d=!1;for(;!d;){switch(a.getUint8(n++)){case 33:if(!o())return!1;break;case 44:c();break;case 59:d=!0;break;default:return!1}if(i>1)return!0}function o(){switch(a.getUint8(n++)){case 249:l();break;case 1:p();break;case 254:r();break;case 255:s();break;default:return!1}return!0}function c(){i++,n+=8;const g=a.getUint8(n++);n+=128&g?3*2**(1+(7&g)):0,n++,u()}function l(){n++,n+=4,u()}function p(){i++,n++,n+=12,u()}function r(){u()}function s(){n++,n+=8,n+=3,u()}function u(){let g;for(;g=a.getUint8(n++);)n+=g}return!1}export{ye as isAnimatedGIF,fe as isGIF,ge as parseGif}; +import{B as E}from"./index-BjUNJPVf.js";var B={},O={},w={};Object.defineProperty(w,"__esModule",{value:!0}),w.loop=w.conditional=w.parse=void 0;var q=function t(a,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:n;if(Array.isArray(e))e.forEach(function(o){return t(a,o,n,i)});else if(typeof e=="function")e(a,n,i,t);else{var d=Object.keys(e)[0];Array.isArray(e[d])?(i[d]={},t(a,e[d],n,i[d])):i[d]=e[d](a,n,i,t)}return n};w.parse=q;var V=function(t,a){return function(e,n,i,d){a(e,n,i)&&d(e,t,n,i)}};w.conditional=V;var $=function(t,a){return function(e,n,i,d){for(var o=[],c=e.pos;a(e,n,i);){var l={};if(d(e,t,n,l),e.pos===c)break;c=e.pos,o.push(l)}return o}};w.loop=$;var f={};Object.defineProperty(f,"__esModule",{value:!0}),f.readBits=f.readArray=f.readUnsigned=f.readString=f.peekBytes=f.readBytes=f.peekByte=f.readByte=f.buildStream=void 0;var H=function(t){return{data:t,pos:0}};f.buildStream=H;var T=function(){return function(t){return t.data[t.pos++]}};f.readByte=T;var J=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(a){return a.data[a.pos+t]}};f.peekByte=J;var _=function(t){return function(a){return a.data.subarray(a.pos,a.pos+=t)}};f.readBytes=_;var K=function(t){return function(a){return a.data.subarray(a.pos,a.pos+t)}};f.peekBytes=K;var L=function(t){return function(a){return Array.from(_(t)(a)).map(function(e){return String.fromCharCode(e)}).join("")}};f.readString=L;var N=function(t){return function(a){var e=_(2)(a);return t?(e[1]<<8)+e[0]:(e[0]<<8)+e[1]}};f.readUnsigned=N;var Q=function(t,a){return function(e,n,i){for(var d=typeof a=="function"?a(e,n,i):a,o=_(t),c=new Array(d),l=0;l=g){var m=g-r.pos;u.push((0,e.readBytes)(m)(r)),h+=m;break}u.push((0,e.readBytes)(y)(r)),h+=y}for(var x=new Uint8Array(h),b=0,v=0;v>=o,h-=o,r>n||r==c)break;if(r==i){d=(1<<(o=u+1))-1,n=i+2,p=C;continue}if(p==C){A[m++]=k[r],p=r,y=r;continue}for(l=r,r==n&&(A[m++]=y,r=p);r>i;)A[m++]=k[r],r=M[r];y=255&k[r],A[m++]=y,nc[r],width:i,height:d}}function ce(t){return U??(U=document.createElement("canvas")),D??(D=U.getContext("2d",{willReadFrequently:!0})),U.width=t.width,U.height=t.height,D.putImageData(t,0,0),U}G=B.decompressFrames=se;const le=[71,73,70];function fe(t){const a=new Uint8Array(t);return!le.some((e,n)=>e!==a[n])}function ye(t){if(!fe(t))return!1;const a=new DataView(t),e=a.getUint8(10);let n=13+(128&e?3*2**(1+(7&e)):0),i=0,d=!1;for(;!d;){switch(a.getUint8(n++)){case 33:if(!o())return!1;break;case 44:c();break;case 59:d=!0;break;default:return!1}if(i>1)return!0}function o(){switch(a.getUint8(n++)){case 249:l();break;case 1:p();break;case 254:r();break;case 255:s();break;default:return!1}return!0}function c(){i++,n+=8;const g=a.getUint8(n++);n+=128&g?3*2**(1+(7&g)):0,n++,u()}function l(){n++,n+=4,u()}function p(){i++,n++,n+=12,u()}function r(){u()}function s(){n++,n+=8,n+=3,u()}function u(){let g;for(;g=a.getUint8(n++);)n+=g}return!1}export{ye as isAnimatedGIF,fe as isGIF,ge as parseGif}; diff --git a/assets/gltfexport-D_QduVJ6.js b/assets/gltfexport-BTAOUMHO.js similarity index 95% rename from assets/gltfexport-D_QduVJ6.js rename to assets/gltfexport-BTAOUMHO.js index 6de56b7..c05a6b4 100644 --- a/assets/gltfexport-D_QduVJ6.js +++ b/assets/gltfexport-BTAOUMHO.js @@ -1 +1 @@ -import{N as j,jc as ae,J as oe,g5 as g,fg as C,cU as J,cv as ce,cx as he,cy as O,gQ as K,gB as fe,cS as z,gi as se,fu as le,hI as ue,gz as de,Z as pe,D as A,s as me,hp as _e,aA as W,js as ge}from"./index-CEWggaxV.js";import{o as we,e as Te}from"./mat4f64-CSKppSlJ.js";import{N as Ae,T as ye}from"./quat-CoKEr4Zu.js";import{o as be,r as Ee,e as Re}from"./quatf64-Bdb9ZJJK.js";import{i as xe}from"./MeshLocalVertexSpace-Cltwu1Kq.js";import{a as Ne}from"./Mesh-9oOqPmbT.js";import{O as Ie,C as Se}from"./georeference-DtjTZVKi.js";import{r as k}from"./resourceUtils-BqKyAr0B.js";import"./mat3f64-q3fE-ZOt.js";import"./imageUtils-DNanu5Rn.js";import"./meshVertexSpaceUtils-BFWpJFSd.js";import"./vec3-CjYmIfaa.js";import"./earcut-hRlx3adE.js";import"./DoubleArray-DxyNBrRi.js";import"./Indices-Dv-cCjFT.js";import"./deduplicate-Bk22TunD.js";import"./plane-py4f_JCU.js";import"./triangle-CU37cZF1.js";import"./Util-BS8sJGjF.js";import"./ObjectStack-CF0cQvd2.js";import"./lineSegment-B9UF3nEF.js";import"./basicInterfaces-GbxEOYtk.js";import"./VertexAttribute-BlT9lbVY.js";import"./External-DC51KyR4.js";import"./infoFor3D-DsOdlPuA.js";import"./computeTranslationToOriginAndRotation-DOOKw0d1.js";import"./BufferView-Ao_K-5Vg.js";function Me(i){const e=ie(i);return e!=null?e.toDataURL():""}async function X(i){const e=ie(i);if(e==null)throw new j("imageToArrayBuffer","Unsupported image type");const t=await Oe(i),s=await new Promise(r=>e.toBlob(r,t));if(!s)throw new j("imageToArrayBuffer","Failed to encode image");return{data:await s.arrayBuffer(),type:t}}async function Oe(i){if(!(i instanceof HTMLImageElement))return"image/png";const e=i.src;if(ae(e)){const t=oe(e);return(t==null?void 0:t.mediaType)==="image/jpeg"?t.mediaType:"image/png"}return/\.png$/i.test(e)?"image/png":/\.(jpg|jpeg)$/i.test(e)?"image/jpeg":"image/png"}function ie(i){if(i instanceof HTMLCanvasElement)return i;if(i instanceof HTMLVideoElement)return null;const e=document.createElement("canvas");e.width=i.width,e.height=i.height;const t=e.getContext("2d");return i instanceof HTMLImageElement?t.drawImage(i,0,0,i.width,i.height):i instanceof ImageData&&t.putImageData(i,0,0),e}function Be(i){const e=[],t=new Uint8Array(i);for(let s=0;s=4&&n!==b.ELEMENT_ARRAY_BUFFER&&(this._bufferView.byteStride=a),t.bufferViews.push(this._bufferView),this._numComponentsForDataType=this._calculateNumComponentsForDataType()}push(e){const t=this._data.length;if(this._data.push(e),this._accessorIndex>=0){const s=t%this._numComponentsForDataType,r=this._accessorMin[s];this._accessorMin[s]=typeof r!="number"?e:Math.min(r,e);const n=this._accessorMax[s];this._accessorMax[s]=typeof n!="number"?e:Math.max(n,e)}}get dataSize(){return this._data.length*this._sizeComponentType()}get byteSize(){function e(t,s){return s*Math.ceil(t/s)}return e(this.dataSize,4)}getByteOffset(){if(!this._isFinalized)throw new Error("Cannot get BufferView offset until it is finalized");return this._buffer.getByteOffset(this)}get byteOffset(){if(!this._isFinalized)throw new Error("Cannot get BufferView offset until it is finalized");return this._buffer.getByteOffset(this)}_createTypedArray(e,t){switch(this._componentType){case g.BYTE:return new Int8Array(e,t);case g.FLOAT:return new Float32Array(e,t);case g.SHORT:return new Int16Array(e,t);case g.UNSIGNED_BYTE:return new Uint8Array(e,t);case g.UNSIGNED_INT:return new Uint32Array(e,t);case g.UNSIGNED_SHORT:return new Uint16Array(e,t)}}writeOutToBuffer(e,t){this._createTypedArray(e,t).set(this._data)}writeAsync(e){if(this._asyncWritePromise)throw new Error("Can't write multiple bufferView values asynchronously");return this._asyncWritePromise=e.then(t=>{const s=new Uint8Array(t);for(let r=0;r=0)throw new Error("Accessor was started without ending the previous one");this._accessorIndex=this._data.length,this._accessorAttribute=e;const t=this._numComponentsForDataType;this._accessorMin=new Array(t),this._accessorMax=new Array(t)}endAccessor(){if(this._accessorIndex<0)throw new Error("An accessor was not started, but was attempted to be ended");const e=this._getElementSize(),t=this._numComponentsForDataType,s=(this._data.length-this._accessorIndex)/t;if(s%1)throw new Error("An accessor was ended with missing component values");for(let n=0;nthis._finalizedPromiseResolve=e)}async finalize(){const e=this._bufferView,t=this._buffer.getViewFinalizePromises(this);this._asyncWritePromise&&t.push(this._asyncWritePromise),await Promise.allSettled(t),this._isFinalized=!0,e.byteOffset=this.getByteOffset(),e.byteLength=this.dataSize,this._finalizedPromiseResolve&&this._finalizedPromiseResolve()}_getElementSize(){return this._sizeComponentType()*this._numComponentsForDataType}_sizeComponentType(){switch(this._componentType){case g.BYTE:case g.UNSIGNED_BYTE:return 1;case g.SHORT:case g.UNSIGNED_SHORT:return 2;case g.UNSIGNED_INT:case g.FLOAT:return 4}}_calculateNumComponentsForDataType(){switch(this._dataType){case T.SCALAR:return 1;case T.VEC2:return 2;case T.VEC3:return 3;case T.VEC4:case T.MAT2:return 4;case T.MAT3:return 9;case T.MAT4:return 16}}},ee=class{constructor(e){this._gltf=e,this._bufferViews=[],this._isFinalized=!1,e.buffers||(e.buffers=[]),this.index=e.buffers.length;const t={byteLength:-1};e.buffers.push(t),this._buffer=t}addBufferView(e,t,s){if(this._finalizePromise)throw new Error("Cannot add buffer view after fiinalizing buffer");const r=new Ce(this,this._gltf,e,t,s);return this._bufferViews.push(r),r}getByteOffset(e){let t=0;for(const s of this._bufferViews){if(s===e)return t;t+=s.byteSize}throw new Error("Given bufferView was not present in this buffer")}getViewFinalizePromises(e){const t=[];for(const s of this._bufferViews){if(e&&s===e)return t;t.push(s.finalized)}return t}getArrayBuffer(){if(!this._isFinalized)throw new Error("Cannot get ArrayBuffer from Buffer before it is finalized");const e=this._getTotalSize(),t=new ArrayBuffer(e);let s=0;for(const r of this._bufferViews)r.writeOutToBuffer(t,s),s+=r.byteSize;return t}finalize(){var e;if(this._finalizePromise)throw new Error(`Buffer ${this.index} was already finalized`);return this._finalizePromise=Promise.allSettled(this.getViewFinalizePromises()).then(()=>{this._isFinalized=!0;const t=this.getArrayBuffer();this._buffer.byteLength=t.byteLength,this._buffer.uri=t}),(e=this._gltf.extras)==null||e.promises.push(this._finalizePromise),this._finalizePromise}_getTotalSize(){let e=0;for(const t of this._bufferViews)e+=t.byteSize;return e}};function ze(i,e){if(i.components)for(const t of i.components)t.faces&&t.shading==="smooth"&&Ve(t,e)}function Ve(i,e){e.normal==null&&(e.normal=new Float32Array(e.position.length));const t=i.faces,{position:s,normal:r}=e,n=t.length/3;for(let a=0;ame.getLogger("gltf");class Ue{constructor(e,t,s){this.params={},this._materialMap=new Array,this._imageMap=new Map,this._textureMap=new Map,this.gltf={asset:{version:"2.0",copyright:e.copyright,generator:e.generator},extras:{options:t,binChunkBuffer:null,promises:[]}},s&&(this.params=s),this._addScenes(e)}_addScenes(e){this.gltf.scene=e.defaultScene;const t=this.gltf.extras,s=t.options.bufferOutputType===E.GLB||t.options.imageOutputType===y.GLB;s&&(t.binChunkBuffer=new ee(this.gltf)),e.forEachScene(r=>{this._addScene(r)}),s&&t.binChunkBuffer.finalize()}_addScene(e){this.gltf.scenes||(this.gltf.scenes=[]);const t={};e.name&&(t.name=e.name),e.forEachNode(s=>{t.nodes||(t.nodes=[]),t.nodes.push(...this._addNodes(s))}),this.gltf.scenes.push(t)}_addNodes(e){this.gltf.nodes||(this.gltf.nodes=[]);const t={};e.name&&(t.name=e.name);const s=e.translation;K(s,fe)||(t.translation=z(s));const r=e.rotation;Ae(r,be)||(t.rotation=Ee(r));const n=e.scale;K(n,se)||(t.scale=z(n));const a=this.gltf.nodes.length;if(this.gltf.nodes.push(t),e.mesh&&e.mesh.vertexAttributes.position){const o=this._createMeshes(e.mesh),h=[a];if(o.length===1)this._addMesh(t,o[0]);else for(const l of o){const c={};this._addMesh(c,l),h.push(this.gltf.nodes.length),this.gltf.nodes.push(c)}return h}return e.forEachNode(o=>{t.children||(t.children=[]),t.children.push(...this._addNodes(o))}),[a]}_addMesh(e,t){var r;(r=this.gltf).meshes??(r.meshes=[]);const s=this.gltf.meshes.length;this.gltf.meshes.push(t),e.mesh=s}_createMeshes(e){const t=this.gltf.extras,s=t.options.bufferOutputType===E.GLB;let r;r=s?t.binChunkBuffer:new ee(this.gltf),this.params.origin||(this.params.origin=e.anchor);const{ignoreLocalTransform:n}=this.params,a=n?null:e.transform,{vertexSpace:o,spatialReference:h}=e,l=o.origin,c=e.vertexAttributes;let u=null;if(o.type==="local"){const f=le(h);ue(te,(a==null?void 0:a.localMatrix)??we,[f,f,f]),u=Ie(c,te)}else{const f=n?new xe({origin:l?z(l):null}):o;u=Se(c,f,a,this.params.origin,{geographic:this.params.geographic,unit:"meters"})}if(u==null)throw new j("Error during gltf export.");c.position&&u.position===c.position&&(u.position=c.position.slice()),c.normal&&u.normal===c.normal&&(u.normal=c.normal.slice()),c.tangent&&u.tangent===c.tangent&&(u.tangent=c.tangent.slice()),ze(e,u),this._flipYZAxis(u);const w=r.addBufferView(g.FLOAT,T.VEC3,b.ARRAY_BUFFER);let m,p,d,_;u.normal&&(m=r.addBufferView(g.FLOAT,T.VEC3,b.ARRAY_BUFFER)),c.uv&&(p=r.addBufferView(g.FLOAT,T.VEC2,b.ARRAY_BUFFER)),u.tangent&&(d=r.addBufferView(g.FLOAT,T.VEC4,b.ARRAY_BUFFER)),c.color&&(_=r.addBufferView(g.UNSIGNED_BYTE,T.VEC4,b.ARRAY_BUFFER)),w.startAccessor("POSITION"),m&&m.startAccessor("NORMAL"),p&&p.startAccessor("TEXCOORD_0"),d&&d.startAccessor("TANGENT"),_&&_.startAccessor("COLOR_0");const R=u.position.length/3,{position:D,normal:B,tangent:I}=u,{color:S,uv:P}=c;for(let f=0;f0&&e.components[0].faces?(L=r.addBufferView(g.UNSIGNED_INT,T.SCALAR,b.ELEMENT_ARRAY_BUFFER),this._addMeshVertexIndexed(L,e.components,Y,Z,U,G,$,v)):this._addMeshVertexNonIndexed(e.components,Y,Z,U,G,$,v),w.finalize(),m&&m.finalize(),p&&p.finalize(),d&&d.finalize(),L&&L.finalize(),_&&_.finalize(),s||r.finalize(),Y}_flipYZAxis({position:e,normal:t,tangent:s}){this._flipYZBuffer(e,3),this._flipYZBuffer(t,3),this._flipYZBuffer(s,4)}_flipYZBuffer(e,t){if(e!=null)for(let s=1,r=2;so**2.1,n=o=>{const h=o.toRgba();return h[0]=r(h[0]/255),h[1]=r(h[1]/255),h[2]=r(h[2]/255),h};if(e.color!=null&&(s.pbrMetallicRoughness.baseColorFactor=n(e.color)),e.colorTexture!=null&&(s.pbrMetallicRoughness.baseColorTexture=this._createTextureInfo(e.colorTexture,e.colorTextureTransform)),e.normalTexture!=null&&(s.normalTexture=this._createTextureInfo(e.normalTexture,e.normalTextureTransform)),e instanceof Ne){if(e.emissiveTexture!=null&&(s.emissiveTexture=this._createTextureInfo(e.emissiveTexture,e.emissiveTextureTransform)),e.emissiveColor!=null){const o=n(e.emissiveColor);s.emissiveFactor=[o[0],o[1],o[2]]}e.occlusionTexture!=null&&(s.occlusionTexture=this._createTextureInfo(e.occlusionTexture,e.occlusionTextureTransform)),e.metallicRoughnessTexture!=null&&(s.pbrMetallicRoughness.metallicRoughnessTexture=this._createTextureInfo(e.metallicRoughnessTexture,e.metallicRoughnessTextureTransform)),s.pbrMetallicRoughness.metallicFactor=e.metallic,s.pbrMetallicRoughness.roughnessFactor=e.roughness}else s.pbrMetallicRoughness.metallicFactor=1,s.pbrMetallicRoughness.roughnessFactor=1,H().warnOnce("Meshes exported to GLTF without MeshMaterialMetallicRoughness material will appear different when imported back.");const a=this.gltf.materials.length;return this.gltf.materials.push(s),this._materialMap.push(e),a}_createTextureInfo(e,t){const s={index:this._addTexture(e)};return t&&(s.extensions||(s.extensions={}),s.extensions.KHR_texture_transform={scale:t.scale,offset:t.offset,rotation:de(t.rotation)}),s}_addTexture(e){const t=this.gltf.textures??[];return this.gltf.textures=t,pe(this._textureMap,e,()=>{const s={sampler:this._addSampler(e),source:this._addImage(e)},r=t.length;return t.push(s),r})}_addImage(e){const t=this._imageMap.get(e);if(t!=null)return t;this.gltf.images||(this.gltf.images=[]);const s={};if(e.url)s.uri=e.url;else{const n=e.data;s.extras=n;for(let o=0;o(s.mimeType=c,l));o.writeAsync(h).then(()=>{o.finalize()})}s.bufferView=o.index;break}case y.DataURI:if(k(n)){H().warnOnce("Image export for basis compressed textures not available.");break}s.uri=Me(n);break;default:if(k(n)){H().warnOnce("Image export for basis compressed textures not available.");break}a.promises.push(X(n).then(({data:o,type:h})=>{s.uri=o,s.mimeType=h}))}}const r=this.gltf.images.length;return this.gltf.images.push(s),this._imageMap.set(e,r),r}_addSampler(e){this.gltf.samplers||(this.gltf.samplers=[]);let t=A.REPEAT,s=A.REPEAT;if(typeof e.wrap=="string")switch(e.wrap){case"clamp":t=A.CLAMP_TO_EDGE,s=A.CLAMP_TO_EDGE;break;case"mirror":t=A.MIRRORED_REPEAT,s=A.MIRRORED_REPEAT}else{switch(e.wrap.vertical){case"clamp":s=A.CLAMP_TO_EDGE;break;case"mirror":s=A.MIRRORED_REPEAT}switch(e.wrap.horizontal){case"clamp":t=A.CLAMP_TO_EDGE;break;case"mirror":t=A.MIRRORED_REPEAT}}const r={wrapS:t,wrapT:s};for(let a=0;a{if(d!=="extras"){if(_ instanceof ArrayBuffer){if(Le(_))switch(e.imageOutputType){case y.DataURI:case y.GLB:break;case y.External:default:{const R=`img${l}.png`;return l++,u[R]=_,R}}switch(e.bufferOutputType){case E.DataURI:return Be(_);case E.GLB:if(c)throw new Error("Already encountered an ArrayBuffer, there should only be one in the GLB format.");return void(c=_);case E.External:default:{const R=`data${h}.bin`;return h++,u[R]=_,R}}}return _}},w);return e.bufferOutputType===E.GLB||e.imageOutputType===y.GLB?u[re]=new M(m,c).buffer:u[Ye]=m,u}function He(i,e){return ke(i,{bufferOutputType:E.GLB,imageOutputType:y.GLB,jsonSpacing:0},e)}class je{constructor(e,t){this._file={type:"model/gltf-binary",data:e},this.origin=t}buffer(){return Promise.resolve(this._file)}download(e){ge(new Blob([this._file.data],{type:this._file.type}),e)}}function Et(i,e){const t=new Ge,s=new $e;return t.addScene(s),s.addNode(new ve(i)),He(t,e).then(r=>new je(r[re],r.origin))}export{Et as toBinaryGLTF}; +import{N as j,jc as ae,J as oe,g5 as g,fg as C,cU as J,cv as ce,cx as he,cy as O,gQ as K,gB as fe,cS as z,gi as se,fu as le,hI as ue,gz as de,Z as pe,D as A,s as me,hp as _e,aA as W,js as ge}from"./index-BjUNJPVf.js";import{o as we,e as Te}from"./mat4f64-CSKppSlJ.js";import{N as Ae,T as ye}from"./quat-C0wQB0HB.js";import{o as be,r as Ee,e as Re}from"./quatf64-Bdb9ZJJK.js";import{i as xe}from"./MeshLocalVertexSpace-DRvwbFTJ.js";import{a as Ne}from"./Mesh--rTzs1p1.js";import{O as Ie,C as Se}from"./georeference-DqFdARS7.js";import{r as k}from"./resourceUtils-BHmy1O5x.js";import"./mat3f64-q3fE-ZOt.js";import"./imageUtils-ChIDAvDr.js";import"./meshVertexSpaceUtils-DwMoblqo.js";import"./vec3-DdRUbala.js";import"./earcut-CWKXDqDj.js";import"./DoubleArray--0pYeNcV.js";import"./Indices-BRm9v2lM.js";import"./deduplicate-BR6i8Xk0.js";import"./plane-DxOTtTwj.js";import"./triangle-DmKBscqo.js";import"./Util-CS5u4Lec.js";import"./ObjectStack-BAIuPeIh.js";import"./lineSegment-BYtydnRZ.js";import"./basicInterfaces-GbxEOYtk.js";import"./VertexAttribute-BlT9lbVY.js";import"./External-DIoD7Bb4.js";import"./infoFor3D-DsOdlPuA.js";import"./computeTranslationToOriginAndRotation-BeE3rOSz.js";import"./BufferView-3om6S_aJ.js";function Me(i){const e=ie(i);return e!=null?e.toDataURL():""}async function X(i){const e=ie(i);if(e==null)throw new j("imageToArrayBuffer","Unsupported image type");const t=await Oe(i),s=await new Promise(r=>e.toBlob(r,t));if(!s)throw new j("imageToArrayBuffer","Failed to encode image");return{data:await s.arrayBuffer(),type:t}}async function Oe(i){if(!(i instanceof HTMLImageElement))return"image/png";const e=i.src;if(ae(e)){const t=oe(e);return(t==null?void 0:t.mediaType)==="image/jpeg"?t.mediaType:"image/png"}return/\.png$/i.test(e)?"image/png":/\.(jpg|jpeg)$/i.test(e)?"image/jpeg":"image/png"}function ie(i){if(i instanceof HTMLCanvasElement)return i;if(i instanceof HTMLVideoElement)return null;const e=document.createElement("canvas");e.width=i.width,e.height=i.height;const t=e.getContext("2d");return i instanceof HTMLImageElement?t.drawImage(i,0,0,i.width,i.height):i instanceof ImageData&&t.putImageData(i,0,0),e}function Be(i){const e=[],t=new Uint8Array(i);for(let s=0;s=4&&n!==b.ELEMENT_ARRAY_BUFFER&&(this._bufferView.byteStride=a),t.bufferViews.push(this._bufferView),this._numComponentsForDataType=this._calculateNumComponentsForDataType()}push(e){const t=this._data.length;if(this._data.push(e),this._accessorIndex>=0){const s=t%this._numComponentsForDataType,r=this._accessorMin[s];this._accessorMin[s]=typeof r!="number"?e:Math.min(r,e);const n=this._accessorMax[s];this._accessorMax[s]=typeof n!="number"?e:Math.max(n,e)}}get dataSize(){return this._data.length*this._sizeComponentType()}get byteSize(){function e(t,s){return s*Math.ceil(t/s)}return e(this.dataSize,4)}getByteOffset(){if(!this._isFinalized)throw new Error("Cannot get BufferView offset until it is finalized");return this._buffer.getByteOffset(this)}get byteOffset(){if(!this._isFinalized)throw new Error("Cannot get BufferView offset until it is finalized");return this._buffer.getByteOffset(this)}_createTypedArray(e,t){switch(this._componentType){case g.BYTE:return new Int8Array(e,t);case g.FLOAT:return new Float32Array(e,t);case g.SHORT:return new Int16Array(e,t);case g.UNSIGNED_BYTE:return new Uint8Array(e,t);case g.UNSIGNED_INT:return new Uint32Array(e,t);case g.UNSIGNED_SHORT:return new Uint16Array(e,t)}}writeOutToBuffer(e,t){this._createTypedArray(e,t).set(this._data)}writeAsync(e){if(this._asyncWritePromise)throw new Error("Can't write multiple bufferView values asynchronously");return this._asyncWritePromise=e.then(t=>{const s=new Uint8Array(t);for(let r=0;r=0)throw new Error("Accessor was started without ending the previous one");this._accessorIndex=this._data.length,this._accessorAttribute=e;const t=this._numComponentsForDataType;this._accessorMin=new Array(t),this._accessorMax=new Array(t)}endAccessor(){if(this._accessorIndex<0)throw new Error("An accessor was not started, but was attempted to be ended");const e=this._getElementSize(),t=this._numComponentsForDataType,s=(this._data.length-this._accessorIndex)/t;if(s%1)throw new Error("An accessor was ended with missing component values");for(let n=0;nthis._finalizedPromiseResolve=e)}async finalize(){const e=this._bufferView,t=this._buffer.getViewFinalizePromises(this);this._asyncWritePromise&&t.push(this._asyncWritePromise),await Promise.allSettled(t),this._isFinalized=!0,e.byteOffset=this.getByteOffset(),e.byteLength=this.dataSize,this._finalizedPromiseResolve&&this._finalizedPromiseResolve()}_getElementSize(){return this._sizeComponentType()*this._numComponentsForDataType}_sizeComponentType(){switch(this._componentType){case g.BYTE:case g.UNSIGNED_BYTE:return 1;case g.SHORT:case g.UNSIGNED_SHORT:return 2;case g.UNSIGNED_INT:case g.FLOAT:return 4}}_calculateNumComponentsForDataType(){switch(this._dataType){case T.SCALAR:return 1;case T.VEC2:return 2;case T.VEC3:return 3;case T.VEC4:case T.MAT2:return 4;case T.MAT3:return 9;case T.MAT4:return 16}}},ee=class{constructor(e){this._gltf=e,this._bufferViews=[],this._isFinalized=!1,e.buffers||(e.buffers=[]),this.index=e.buffers.length;const t={byteLength:-1};e.buffers.push(t),this._buffer=t}addBufferView(e,t,s){if(this._finalizePromise)throw new Error("Cannot add buffer view after fiinalizing buffer");const r=new Ce(this,this._gltf,e,t,s);return this._bufferViews.push(r),r}getByteOffset(e){let t=0;for(const s of this._bufferViews){if(s===e)return t;t+=s.byteSize}throw new Error("Given bufferView was not present in this buffer")}getViewFinalizePromises(e){const t=[];for(const s of this._bufferViews){if(e&&s===e)return t;t.push(s.finalized)}return t}getArrayBuffer(){if(!this._isFinalized)throw new Error("Cannot get ArrayBuffer from Buffer before it is finalized");const e=this._getTotalSize(),t=new ArrayBuffer(e);let s=0;for(const r of this._bufferViews)r.writeOutToBuffer(t,s),s+=r.byteSize;return t}finalize(){var e;if(this._finalizePromise)throw new Error(`Buffer ${this.index} was already finalized`);return this._finalizePromise=Promise.allSettled(this.getViewFinalizePromises()).then(()=>{this._isFinalized=!0;const t=this.getArrayBuffer();this._buffer.byteLength=t.byteLength,this._buffer.uri=t}),(e=this._gltf.extras)==null||e.promises.push(this._finalizePromise),this._finalizePromise}_getTotalSize(){let e=0;for(const t of this._bufferViews)e+=t.byteSize;return e}};function ze(i,e){if(i.components)for(const t of i.components)t.faces&&t.shading==="smooth"&&Ve(t,e)}function Ve(i,e){e.normal==null&&(e.normal=new Float32Array(e.position.length));const t=i.faces,{position:s,normal:r}=e,n=t.length/3;for(let a=0;ame.getLogger("gltf");class Ue{constructor(e,t,s){this.params={},this._materialMap=new Array,this._imageMap=new Map,this._textureMap=new Map,this.gltf={asset:{version:"2.0",copyright:e.copyright,generator:e.generator},extras:{options:t,binChunkBuffer:null,promises:[]}},s&&(this.params=s),this._addScenes(e)}_addScenes(e){this.gltf.scene=e.defaultScene;const t=this.gltf.extras,s=t.options.bufferOutputType===E.GLB||t.options.imageOutputType===y.GLB;s&&(t.binChunkBuffer=new ee(this.gltf)),e.forEachScene(r=>{this._addScene(r)}),s&&t.binChunkBuffer.finalize()}_addScene(e){this.gltf.scenes||(this.gltf.scenes=[]);const t={};e.name&&(t.name=e.name),e.forEachNode(s=>{t.nodes||(t.nodes=[]),t.nodes.push(...this._addNodes(s))}),this.gltf.scenes.push(t)}_addNodes(e){this.gltf.nodes||(this.gltf.nodes=[]);const t={};e.name&&(t.name=e.name);const s=e.translation;K(s,fe)||(t.translation=z(s));const r=e.rotation;Ae(r,be)||(t.rotation=Ee(r));const n=e.scale;K(n,se)||(t.scale=z(n));const a=this.gltf.nodes.length;if(this.gltf.nodes.push(t),e.mesh&&e.mesh.vertexAttributes.position){const o=this._createMeshes(e.mesh),h=[a];if(o.length===1)this._addMesh(t,o[0]);else for(const l of o){const c={};this._addMesh(c,l),h.push(this.gltf.nodes.length),this.gltf.nodes.push(c)}return h}return e.forEachNode(o=>{t.children||(t.children=[]),t.children.push(...this._addNodes(o))}),[a]}_addMesh(e,t){var r;(r=this.gltf).meshes??(r.meshes=[]);const s=this.gltf.meshes.length;this.gltf.meshes.push(t),e.mesh=s}_createMeshes(e){const t=this.gltf.extras,s=t.options.bufferOutputType===E.GLB;let r;r=s?t.binChunkBuffer:new ee(this.gltf),this.params.origin||(this.params.origin=e.anchor);const{ignoreLocalTransform:n}=this.params,a=n?null:e.transform,{vertexSpace:o,spatialReference:h}=e,l=o.origin,c=e.vertexAttributes;let u=null;if(o.type==="local"){const f=le(h);ue(te,(a==null?void 0:a.localMatrix)??we,[f,f,f]),u=Ie(c,te)}else{const f=n?new xe({origin:l?z(l):null}):o;u=Se(c,f,a,this.params.origin,{geographic:this.params.geographic,unit:"meters"})}if(u==null)throw new j("Error during gltf export.");c.position&&u.position===c.position&&(u.position=c.position.slice()),c.normal&&u.normal===c.normal&&(u.normal=c.normal.slice()),c.tangent&&u.tangent===c.tangent&&(u.tangent=c.tangent.slice()),ze(e,u),this._flipYZAxis(u);const w=r.addBufferView(g.FLOAT,T.VEC3,b.ARRAY_BUFFER);let m,p,d,_;u.normal&&(m=r.addBufferView(g.FLOAT,T.VEC3,b.ARRAY_BUFFER)),c.uv&&(p=r.addBufferView(g.FLOAT,T.VEC2,b.ARRAY_BUFFER)),u.tangent&&(d=r.addBufferView(g.FLOAT,T.VEC4,b.ARRAY_BUFFER)),c.color&&(_=r.addBufferView(g.UNSIGNED_BYTE,T.VEC4,b.ARRAY_BUFFER)),w.startAccessor("POSITION"),m&&m.startAccessor("NORMAL"),p&&p.startAccessor("TEXCOORD_0"),d&&d.startAccessor("TANGENT"),_&&_.startAccessor("COLOR_0");const R=u.position.length/3,{position:D,normal:B,tangent:I}=u,{color:S,uv:P}=c;for(let f=0;f0&&e.components[0].faces?(L=r.addBufferView(g.UNSIGNED_INT,T.SCALAR,b.ELEMENT_ARRAY_BUFFER),this._addMeshVertexIndexed(L,e.components,Y,Z,U,G,$,v)):this._addMeshVertexNonIndexed(e.components,Y,Z,U,G,$,v),w.finalize(),m&&m.finalize(),p&&p.finalize(),d&&d.finalize(),L&&L.finalize(),_&&_.finalize(),s||r.finalize(),Y}_flipYZAxis({position:e,normal:t,tangent:s}){this._flipYZBuffer(e,3),this._flipYZBuffer(t,3),this._flipYZBuffer(s,4)}_flipYZBuffer(e,t){if(e!=null)for(let s=1,r=2;so**2.1,n=o=>{const h=o.toRgba();return h[0]=r(h[0]/255),h[1]=r(h[1]/255),h[2]=r(h[2]/255),h};if(e.color!=null&&(s.pbrMetallicRoughness.baseColorFactor=n(e.color)),e.colorTexture!=null&&(s.pbrMetallicRoughness.baseColorTexture=this._createTextureInfo(e.colorTexture,e.colorTextureTransform)),e.normalTexture!=null&&(s.normalTexture=this._createTextureInfo(e.normalTexture,e.normalTextureTransform)),e instanceof Ne){if(e.emissiveTexture!=null&&(s.emissiveTexture=this._createTextureInfo(e.emissiveTexture,e.emissiveTextureTransform)),e.emissiveColor!=null){const o=n(e.emissiveColor);s.emissiveFactor=[o[0],o[1],o[2]]}e.occlusionTexture!=null&&(s.occlusionTexture=this._createTextureInfo(e.occlusionTexture,e.occlusionTextureTransform)),e.metallicRoughnessTexture!=null&&(s.pbrMetallicRoughness.metallicRoughnessTexture=this._createTextureInfo(e.metallicRoughnessTexture,e.metallicRoughnessTextureTransform)),s.pbrMetallicRoughness.metallicFactor=e.metallic,s.pbrMetallicRoughness.roughnessFactor=e.roughness}else s.pbrMetallicRoughness.metallicFactor=1,s.pbrMetallicRoughness.roughnessFactor=1,H().warnOnce("Meshes exported to GLTF without MeshMaterialMetallicRoughness material will appear different when imported back.");const a=this.gltf.materials.length;return this.gltf.materials.push(s),this._materialMap.push(e),a}_createTextureInfo(e,t){const s={index:this._addTexture(e)};return t&&(s.extensions||(s.extensions={}),s.extensions.KHR_texture_transform={scale:t.scale,offset:t.offset,rotation:de(t.rotation)}),s}_addTexture(e){const t=this.gltf.textures??[];return this.gltf.textures=t,pe(this._textureMap,e,()=>{const s={sampler:this._addSampler(e),source:this._addImage(e)},r=t.length;return t.push(s),r})}_addImage(e){const t=this._imageMap.get(e);if(t!=null)return t;this.gltf.images||(this.gltf.images=[]);const s={};if(e.url)s.uri=e.url;else{const n=e.data;s.extras=n;for(let o=0;o(s.mimeType=c,l));o.writeAsync(h).then(()=>{o.finalize()})}s.bufferView=o.index;break}case y.DataURI:if(k(n)){H().warnOnce("Image export for basis compressed textures not available.");break}s.uri=Me(n);break;default:if(k(n)){H().warnOnce("Image export for basis compressed textures not available.");break}a.promises.push(X(n).then(({data:o,type:h})=>{s.uri=o,s.mimeType=h}))}}const r=this.gltf.images.length;return this.gltf.images.push(s),this._imageMap.set(e,r),r}_addSampler(e){this.gltf.samplers||(this.gltf.samplers=[]);let t=A.REPEAT,s=A.REPEAT;if(typeof e.wrap=="string")switch(e.wrap){case"clamp":t=A.CLAMP_TO_EDGE,s=A.CLAMP_TO_EDGE;break;case"mirror":t=A.MIRRORED_REPEAT,s=A.MIRRORED_REPEAT}else{switch(e.wrap.vertical){case"clamp":s=A.CLAMP_TO_EDGE;break;case"mirror":s=A.MIRRORED_REPEAT}switch(e.wrap.horizontal){case"clamp":t=A.CLAMP_TO_EDGE;break;case"mirror":t=A.MIRRORED_REPEAT}}const r={wrapS:t,wrapT:s};for(let a=0;a{if(d!=="extras"){if(_ instanceof ArrayBuffer){if(Le(_))switch(e.imageOutputType){case y.DataURI:case y.GLB:break;case y.External:default:{const R=`img${l}.png`;return l++,u[R]=_,R}}switch(e.bufferOutputType){case E.DataURI:return Be(_);case E.GLB:if(c)throw new Error("Already encountered an ArrayBuffer, there should only be one in the GLB format.");return void(c=_);case E.External:default:{const R=`data${h}.bin`;return h++,u[R]=_,R}}}return _}},w);return e.bufferOutputType===E.GLB||e.imageOutputType===y.GLB?u[re]=new M(m,c).buffer:u[Ye]=m,u}function He(i,e){return ke(i,{bufferOutputType:E.GLB,imageOutputType:y.GLB,jsonSpacing:0},e)}class je{constructor(e,t){this._file={type:"model/gltf-binary",data:e},this.origin=t}buffer(){return Promise.resolve(this._file)}download(e){ge(new Blob([this._file.data],{type:this._file.type}),e)}}function Et(i,e){const t=new Ge,s=new $e;return t.addScene(s),s.addNode(new ve(i)),He(t,e).then(r=>new je(r[re],r.origin))}export{Et as toBinaryGLTF}; diff --git a/assets/groupLayerUtils-BrcnmI65.js b/assets/groupLayerUtils-4dYtm0nq.js similarity index 76% rename from assets/groupLayerUtils-BrcnmI65.js rename to assets/groupLayerUtils-4dYtm0nq.js index f1bf65a..a8d56f0 100644 --- a/assets/groupLayerUtils-BrcnmI65.js +++ b/assets/groupLayerUtils-4dYtm0nq.js @@ -1 +1 @@ -import{$ as l,j as y}from"./utils-2LBmsoaQ.js";import{bZ as f,eo as v,ej as d,el as s,en as I}from"./index-CEWggaxV.js";import{p as i}from"./resourceUtils-Cu1-5qu3.js";import"./originUtils-D69mHv66.js";import"./multiOriginJSONSupportUtils-C0wm8_Yw.js";import"./saveAPIKeyUtils-BiX1lQSW.js";import"./saveUtils-BzCRy3uR.js";import"./resourceUtils-CjqYbm2Q.js";const n="Group Layer",g="group-layer-save",A="group-layer-save-as",o=s.GROUP_LAYER_MAP;function c(e){return{isValid:e.type==="group",errorMessage:"Layer.type should be 'group'"}}function P(e){return{isValid:f(e,o),errorMessage:`Layer.portalItem.typeKeywords should have '${o}'`}}function u(e,r){return{...v(e,"web-map",!0),initiator:r}}function m(e){const r=e.layerJSON;return Promise.resolve(r&&Object.keys(r).length?r:null)}async function R(e,r){r.title||(r.title=e.title),d(r,s.METADATA),I(r,o)}async function T(e,r){return l({layer:e,itemType:n,validateLayer:c,validateItem:P,createJSONContext:t=>u(t,e),createItemData:m,errorNamePrefix:g,saveResources:async(t,a)=>(e.sourceIsPortalItem||await t.removeAllResources().catch(()=>{}),i(e.resourceReferences,a))},r)}async function $(e,r,t){return y({layer:e,itemType:n,validateLayer:c,createJSONContext:a=>u(a,e),createItemData:m,errorNamePrefix:A,newItem:r,setItemProperties:R,saveResources:(a,p)=>i(e.resourceReferences,p)},t)}export{T as save,$ as saveAs}; +import{$ as l,j as y}from"./utils-iOpWi7jV.js";import{bZ as f,eo as v,ej as d,el as s,en as I}from"./index-BjUNJPVf.js";import{p as i}from"./resourceUtils-p9pTIVIi.js";import"./originUtils-D69mHv66.js";import"./multiOriginJSONSupportUtils-C0wm8_Yw.js";import"./saveAPIKeyUtils-YRBbgdzi.js";import"./saveUtils-CGGzyvzv.js";import"./resourceUtils-CfE36DzP.js";const n="Group Layer",g="group-layer-save",A="group-layer-save-as",o=s.GROUP_LAYER_MAP;function c(e){return{isValid:e.type==="group",errorMessage:"Layer.type should be 'group'"}}function P(e){return{isValid:f(e,o),errorMessage:`Layer.portalItem.typeKeywords should have '${o}'`}}function u(e,r){return{...v(e,"web-map",!0),initiator:r}}function m(e){const r=e.layerJSON;return Promise.resolve(r&&Object.keys(r).length?r:null)}async function R(e,r){r.title||(r.title=e.title),d(r,s.METADATA),I(r,o)}async function T(e,r){return l({layer:e,itemType:n,validateLayer:c,validateItem:P,createJSONContext:t=>u(t,e),createItemData:m,errorNamePrefix:g,saveResources:async(t,a)=>(e.sourceIsPortalItem||await t.removeAllResources().catch(()=>{}),i(e.resourceReferences,a))},r)}async function $(e,r,t){return y({layer:e,itemType:n,validateLayer:c,createJSONContext:a=>u(a,e),createItemData:m,errorNamePrefix:A,newItem:r,setItemProperties:R,saveResources:(a,p)=>i(e.resourceReferences,p)},t)}export{T as save,$ as saveAs}; diff --git a/assets/heatmapUtils-Clt5rJzr.js b/assets/heatmapUtils-BSteZBTj.js similarity index 84% rename from assets/heatmapUtils-Clt5rJzr.js rename to assets/heatmapUtils-BSteZBTj.js index 751a061..562a36f 100644 --- a/assets/heatmapUtils-Clt5rJzr.js +++ b/assets/heatmapUtils-BSteZBTj.js @@ -1 +1 @@ -import{bg as u,bh as l,bi as h,bj as m,I as p}from"./index-CEWggaxV.js";const s=2.4;function g(r){return u(r*s)}function A(r){return l(r)/s}function b(r,i,t,a){let{color:c,ratio:e}=i,{color:f,ratio:o}=t;o===e&&(o===1?e-=1e-6:o+=1e-6);const n=p((a-e)/(o-e),0,1);h(r,c.toArray(),f.toArray(),n)}function M(r){const t=new Uint8ClampedArray(2048);if(r=r.filter(({ratio:o})=>o>=0&&o<=1).sort((o,n)=>o.ratio-n.ratio).map(({color:o,ratio:n})=>({color:o,ratio:Math.max(n,.001)})),r.length<1)return t;let a=r[0],c=r[0],e=1;const f=m();for(let o=0;o<512;o++){const n=(o+.5)/512;for(;n>c.ratio&&e1?0:3/(Math.PI*t**2)*(1-a**2)**2}function I(r){return typeof r=="function"?r:r?i=>+i[r]:()=>1}export{A as a,s as c,g as e,M as f,x as l,I as u}; +import{bg as u,bh as l,bi as h,bj as m,I as p}from"./index-BjUNJPVf.js";const s=2.4;function g(r){return u(r*s)}function A(r){return l(r)/s}function b(r,i,t,a){let{color:c,ratio:e}=i,{color:f,ratio:o}=t;o===e&&(o===1?e-=1e-6:o+=1e-6);const n=p((a-e)/(o-e),0,1);h(r,c.toArray(),f.toArray(),n)}function M(r){const t=new Uint8ClampedArray(2048);if(r=r.filter(({ratio:o})=>o>=0&&o<=1).sort((o,n)=>o.ratio-n.ratio).map(({color:o,ratio:n})=>({color:o,ratio:Math.max(n,.001)})),r.length<1)return t;let a=r[0],c=r[0],e=1;const f=m();for(let o=0;o<512;o++){const n=(o+.5)/512;for(;n>c.ratio&&e1?0:3/(Math.PI*t**2)*(1-a**2)**2}function I(r){return typeof r=="function"?r:r?i=>+i[r]:()=>1}export{A as a,s as c,g as e,M as f,x as l,I as u}; diff --git a/assets/highlightReasons-DbgbcWKM.js b/assets/highlightReasons-BOU4mnPE.js similarity index 82% rename from assets/highlightReasons-DbgbcWKM.js rename to assets/highlightReasons-BOU4mnPE.js index c33d2c2..12258cb 100644 --- a/assets/highlightReasons-DbgbcWKM.js +++ b/assets/highlightReasons-BOU4mnPE.js @@ -1 +1 @@ -import{a8 as l,a9 as t}from"./index-CEWggaxV.js";const e={selection:o=>new l({color:new t([o.color.r/2,o.color.g/2,o.color.b/2,o.color.a])}),highlight:o=>o,popup:o=>new l({color:new t([o.color.g,o.color.b,o.color.r,o.color.a])})};function i(o){if(!o)return 0;let r=1;for(const n in e){if(n===o)break;r<<=1}return r}const a=Object.keys(e);export{e as c,a as l,i as t}; +import{a8 as l,a9 as t}from"./index-BjUNJPVf.js";const e={selection:o=>new l({color:new t([o.color.r/2,o.color.g/2,o.color.b/2,o.color.a])}),highlight:o=>o,popup:o=>new l({color:new t([o.color.g,o.color.b,o.color.r,o.color.a])})};function i(o){if(!o)return 0;let r=1;for(const n in e){if(n===o)break;r<<=1}return r}const a=Object.keys(e);export{e as c,a as l,i as t}; diff --git a/assets/hydrated-CcIo9KoC.js b/assets/hydrated-D7zavlGk.js similarity index 90% rename from assets/hydrated-CcIo9KoC.js rename to assets/hydrated-D7zavlGk.js index bef7e27..0eb43d7 100644 --- a/assets/hydrated-CcIo9KoC.js +++ b/assets/hydrated-D7zavlGk.js @@ -1 +1 @@ -import{aA as r,aB as c,aC as h,aD as x,aE as m}from"./index-CEWggaxV.js";const Z={convertToGEGeometry:g,exportPoint:p,exportPolygon:u,exportPolyline:l,exportMultipoint:M,exportExtent:f};function g(t,e){if(e==null)return null;let a="cache"in e?e.cache._geVersion:void 0;return a==null&&(a=t.convertJSONToGeometry(e),"cache"in e&&(e.cache._geVersion=a)),a}function p(t,e,a){const o=t.hasZ(e),i=t.hasM(e),s=new r({x:t.getPointX(e),y:t.getPointY(e),spatialReference:a});return o&&(s.z=t.getPointZ(e)),i&&(s.m=t.getPointM(e)),s.cache._geVersion=e,s}function u(t,e,a){const o=new c({rings:t.exportPaths(e),hasZ:t.hasZ(e),hasM:t.hasM(e),spatialReference:a});return o.cache._geVersion=e,o}function l(t,e,a){const o=new h({paths:t.exportPaths(e),hasZ:t.hasZ(e),hasM:t.hasM(e),spatialReference:a});return o.cache._geVersion=e,o}function M(t,e,a){const o=new x({hasZ:t.hasZ(e),hasM:t.hasM(e),points:t.exportPoints(e),spatialReference:a});return o.cache._geVersion=e,o}function f(t,e,a){const o=t.hasZ(e),i=t.hasM(e),s=new m({xmin:t.getXMin(e),ymin:t.getYMin(e),xmax:t.getXMax(e),ymax:t.getYMax(e),spatialReference:a});if(o){const n=t.getZExtent(e);s.zmin=n.vmin,s.zmax=n.vmax}if(i){const n=t.getMExtent(e);s.mmin=n.vmin,s.mmax=n.vmax}return s.cache._geVersion=e,s}export{Z as hydratedAdapter}; +import{aA as r,aB as c,aC as h,aD as x,aE as m}from"./index-BjUNJPVf.js";const Z={convertToGEGeometry:g,exportPoint:p,exportPolygon:u,exportPolyline:l,exportMultipoint:M,exportExtent:f};function g(t,e){if(e==null)return null;let a="cache"in e?e.cache._geVersion:void 0;return a==null&&(a=t.convertJSONToGeometry(e),"cache"in e&&(e.cache._geVersion=a)),a}function p(t,e,a){const o=t.hasZ(e),i=t.hasM(e),s=new r({x:t.getPointX(e),y:t.getPointY(e),spatialReference:a});return o&&(s.z=t.getPointZ(e)),i&&(s.m=t.getPointM(e)),s.cache._geVersion=e,s}function u(t,e,a){const o=new c({rings:t.exportPaths(e),hasZ:t.hasZ(e),hasM:t.hasM(e),spatialReference:a});return o.cache._geVersion=e,o}function l(t,e,a){const o=new h({paths:t.exportPaths(e),hasZ:t.hasZ(e),hasM:t.hasM(e),spatialReference:a});return o.cache._geVersion=e,o}function M(t,e,a){const o=new x({hasZ:t.hasZ(e),hasM:t.hasM(e),points:t.exportPoints(e),spatialReference:a});return o.cache._geVersion=e,o}function f(t,e,a){const o=t.hasZ(e),i=t.hasM(e),s=new m({xmin:t.getXMin(e),ymin:t.getYMin(e),xmax:t.getXMax(e),ymax:t.getYMax(e),spatialReference:a});if(o){const n=t.getZExtent(e);s.zmin=n.vmin,s.zmax=n.vmax}if(i){const n=t.getMExtent(e);s.mmin=n.vmin,s.mmax=n.vmax}return s.cache._geVersion=e,s}export{Z as hydratedAdapter}; diff --git a/assets/i3s-DgwnR-Am.js b/assets/i3s-DvXaSYJ6.js similarity index 99% rename from assets/i3s-DgwnR-Am.js rename to assets/i3s-DvXaSYJ6.js index 052d8f2..4096aaa 100644 --- a/assets/i3s-DgwnR-Am.js +++ b/assets/i3s-DvXaSYJ6.js @@ -1,2 +1,2 @@ -import{ar as ue}from"./index-CEWggaxV.js";var It,it,Ot,Ht={exports:{}};It=Ht,it=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,Ot=function(J={}){var ot,z,i=J!==void 0?J:{};i.ready=new Promise((t,n)=>{ot=t,z=n});var at=Object.assign({},i),ut=typeof window=="object",D=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var K,b="";function zt(t){return i.locateFile?i.locateFile(t,b):b+t}(ut||D)&&(D?b=self.location.href:typeof document<"u"&&document.currentScript&&(b=document.currentScript.src),it&&(b=it),b=b.indexOf("blob:")!==0?b.substr(0,b.replace(/[?#].*/,"").lastIndexOf("/")+1):"",D&&(K=t=>{var n=new XMLHttpRequest;return n.open("GET",t,!1),n.responseType="arraybuffer",n.send(null),new Uint8Array(n.response)}));var U,V,Dt=i.print||console.log.bind(console),F=i.printErr||console.warn.bind(console);Object.assign(i,at),at=null,i.arguments&&i.arguments,i.thisProgram&&i.thisProgram,i.quit&&i.quit,i.wasmBinary&&(U=i.wasmBinary),i.noExitRuntime,typeof WebAssembly!="object"&&B("no native wasm support detected");var E,v,R,M,W,p,ct,st,ft,lt=!1;function dt(){var t=V.buffer;i.HEAP8=E=new Int8Array(t),i.HEAP16=R=new Int16Array(t),i.HEAP32=W=new Int32Array(t),i.HEAPU8=v=new Uint8Array(t),i.HEAPU16=M=new Uint16Array(t),i.HEAPU32=p=new Uint32Array(t),i.HEAPF32=ct=new Float32Array(t),i.HEAPF64=st=new Float64Array(t)}var pt=[],vt=[],ht=[];function Vt(){if(i.preRun)for(typeof i.preRun=="function"&&(i.preRun=[i.preRun]);i.preRun.length;)qt(i.preRun.shift());Q(pt)}function Mt(){Q(vt)}function Bt(){if(i.postRun)for(typeof i.postRun=="function"&&(i.postRun=[i.postRun]);i.postRun.length;)Lt(i.postRun.shift());Q(ht)}function qt(t){pt.unshift(t)}function Nt(t){vt.unshift(t)}function Lt(t){ht.unshift(t)}var k=0,I=null;function $t(t){k++,i.monitorRunDependencies&&i.monitorRunDependencies(k)}function Gt(t){if(k--,i.monitorRunDependencies&&i.monitorRunDependencies(k),k==0&&I){var n=I;I=null,n()}}function B(t){i.onAbort&&i.onAbort(t),F(t="Aborted("+t+")"),lt=!0,t+=". Build with -sASSERTIONS for more info.";var n=new WebAssembly.RuntimeError(t);throw z(n),n}var O,Xt="data:application/octet-stream;base64,";function mt(t){return t.startsWith(Xt)}function gt(t){try{if(t==O&&U)return new Uint8Array(U);if(K)return K(t);throw"both async and sync fetching of the wasm failed"}catch(n){B(n)}}function Zt(t){return U||!ut&&!D||typeof fetch!="function"?Promise.resolve().then(()=>gt(t)):fetch(t,{credentials:"same-origin"}).then(n=>{if(!n.ok)throw"failed to load wasm binary file at '"+t+"'";return n.arrayBuffer()}).catch(()=>gt(t))}function yt(t,n,e){return Zt(t).then(r=>WebAssembly.instantiate(r,n)).then(r=>r).then(e,r=>{F("failed to asynchronously prepare wasm: "+r),B(r)})}function Jt(t,n,e,r){return t||typeof WebAssembly.instantiateStreaming!="function"||mt(n)||typeof fetch!="function"?yt(n,e,r):fetch(n,{credentials:"same-origin"}).then(o=>WebAssembly.instantiateStreaming(o,e).then(r,function(u){return F("wasm streaming compile failed: "+u),F("falling back to ArrayBuffer instantiation"),yt(n,e,r)}))}function Kt(){var t={env:Rt,wasi_snapshot_preview1:Rt};function n(r,o){var u=r.exports;return i.asm=u,V=i.asm.memory,dt(),ft=i.asm.__indirect_function_table,Nt(i.asm.__wasm_call_ctors),Gt(),u}function e(r){n(r.instance)}if($t(),i.instantiateWasm)try{return i.instantiateWasm(t,n)}catch(r){F("Module.instantiateWasm callback failed with error: "+r),z(r)}return Jt(U,O,t,e).catch(z),{}}function Q(t){for(;t.length>0;)t.shift()(i)}mt(O="i3s.wasm")||(O=zt(O));var q=[];function Y(t){var n=q[t];return n||(t>=q.length&&(q.length=t+1),q[t]=n=ft.get(t)),n}function Qt(t,n){Y(t)(n)}function Yt(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(n){p[this.ptr+4>>2]=n},this.get_type=function(){return p[this.ptr+4>>2]},this.set_destructor=function(n){p[this.ptr+8>>2]=n},this.get_destructor=function(){return p[this.ptr+8>>2]},this.set_caught=function(n){n=n?1:0,E[this.ptr+12>>0]=n},this.get_caught=function(){return E[this.ptr+12>>0]!=0},this.set_rethrown=function(n){n=n?1:0,E[this.ptr+13>>0]=n},this.get_rethrown=function(){return E[this.ptr+13>>0]!=0},this.init=function(n,e){this.set_adjusted_ptr(0),this.set_type(n),this.set_destructor(e)},this.set_adjusted_ptr=function(n){p[this.ptr+16>>2]=n},this.get_adjusted_ptr=function(){return p[this.ptr+16>>2]},this.get_exception_ptr=function(){if(xt(this.get_type()))return p[this.excPtr>>2];var n=this.get_adjusted_ptr();return n!==0?n:this.excPtr}}function tn(t,n,e){throw new Yt(t).init(n,e),t}var N={};function _t(t){for(;t.length;){var n=t.pop();t.pop()(n)}}function L(t){return this.fromWireType(W[t>>2])}var S={},j={},$={},nn=48,en=57;function rn(t){if(t===void 0)return"_unknown";var n=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return n>=nn&&n<=en?"_"+t:t}function on(t,n){return{[t=rn(t)]:function(){return n.apply(this,arguments)}}[t]}function tt(t,n){var e=on(n,function(r){this.name=n,this.message=r;var o=new Error(r).stack;o!==void 0&&(this.stack=this.toString()+` +import{ar as ue}from"./index-BjUNJPVf.js";var It,it,Ot,Ht={exports:{}};It=Ht,it=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,Ot=function(J={}){var ot,z,i=J!==void 0?J:{};i.ready=new Promise((t,n)=>{ot=t,z=n});var at=Object.assign({},i),ut=typeof window=="object",D=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var K,b="";function zt(t){return i.locateFile?i.locateFile(t,b):b+t}(ut||D)&&(D?b=self.location.href:typeof document<"u"&&document.currentScript&&(b=document.currentScript.src),it&&(b=it),b=b.indexOf("blob:")!==0?b.substr(0,b.replace(/[?#].*/,"").lastIndexOf("/")+1):"",D&&(K=t=>{var n=new XMLHttpRequest;return n.open("GET",t,!1),n.responseType="arraybuffer",n.send(null),new Uint8Array(n.response)}));var U,V,Dt=i.print||console.log.bind(console),F=i.printErr||console.warn.bind(console);Object.assign(i,at),at=null,i.arguments&&i.arguments,i.thisProgram&&i.thisProgram,i.quit&&i.quit,i.wasmBinary&&(U=i.wasmBinary),i.noExitRuntime,typeof WebAssembly!="object"&&B("no native wasm support detected");var E,v,R,M,W,p,ct,st,ft,lt=!1;function dt(){var t=V.buffer;i.HEAP8=E=new Int8Array(t),i.HEAP16=R=new Int16Array(t),i.HEAP32=W=new Int32Array(t),i.HEAPU8=v=new Uint8Array(t),i.HEAPU16=M=new Uint16Array(t),i.HEAPU32=p=new Uint32Array(t),i.HEAPF32=ct=new Float32Array(t),i.HEAPF64=st=new Float64Array(t)}var pt=[],vt=[],ht=[];function Vt(){if(i.preRun)for(typeof i.preRun=="function"&&(i.preRun=[i.preRun]);i.preRun.length;)qt(i.preRun.shift());Q(pt)}function Mt(){Q(vt)}function Bt(){if(i.postRun)for(typeof i.postRun=="function"&&(i.postRun=[i.postRun]);i.postRun.length;)Lt(i.postRun.shift());Q(ht)}function qt(t){pt.unshift(t)}function Nt(t){vt.unshift(t)}function Lt(t){ht.unshift(t)}var k=0,I=null;function $t(t){k++,i.monitorRunDependencies&&i.monitorRunDependencies(k)}function Gt(t){if(k--,i.monitorRunDependencies&&i.monitorRunDependencies(k),k==0&&I){var n=I;I=null,n()}}function B(t){i.onAbort&&i.onAbort(t),F(t="Aborted("+t+")"),lt=!0,t+=". Build with -sASSERTIONS for more info.";var n=new WebAssembly.RuntimeError(t);throw z(n),n}var O,Xt="data:application/octet-stream;base64,";function mt(t){return t.startsWith(Xt)}function gt(t){try{if(t==O&&U)return new Uint8Array(U);if(K)return K(t);throw"both async and sync fetching of the wasm failed"}catch(n){B(n)}}function Zt(t){return U||!ut&&!D||typeof fetch!="function"?Promise.resolve().then(()=>gt(t)):fetch(t,{credentials:"same-origin"}).then(n=>{if(!n.ok)throw"failed to load wasm binary file at '"+t+"'";return n.arrayBuffer()}).catch(()=>gt(t))}function yt(t,n,e){return Zt(t).then(r=>WebAssembly.instantiate(r,n)).then(r=>r).then(e,r=>{F("failed to asynchronously prepare wasm: "+r),B(r)})}function Jt(t,n,e,r){return t||typeof WebAssembly.instantiateStreaming!="function"||mt(n)||typeof fetch!="function"?yt(n,e,r):fetch(n,{credentials:"same-origin"}).then(o=>WebAssembly.instantiateStreaming(o,e).then(r,function(u){return F("wasm streaming compile failed: "+u),F("falling back to ArrayBuffer instantiation"),yt(n,e,r)}))}function Kt(){var t={env:Rt,wasi_snapshot_preview1:Rt};function n(r,o){var u=r.exports;return i.asm=u,V=i.asm.memory,dt(),ft=i.asm.__indirect_function_table,Nt(i.asm.__wasm_call_ctors),Gt(),u}function e(r){n(r.instance)}if($t(),i.instantiateWasm)try{return i.instantiateWasm(t,n)}catch(r){F("Module.instantiateWasm callback failed with error: "+r),z(r)}return Jt(U,O,t,e).catch(z),{}}function Q(t){for(;t.length>0;)t.shift()(i)}mt(O="i3s.wasm")||(O=zt(O));var q=[];function Y(t){var n=q[t];return n||(t>=q.length&&(q.length=t+1),q[t]=n=ft.get(t)),n}function Qt(t,n){Y(t)(n)}function Yt(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(n){p[this.ptr+4>>2]=n},this.get_type=function(){return p[this.ptr+4>>2]},this.set_destructor=function(n){p[this.ptr+8>>2]=n},this.get_destructor=function(){return p[this.ptr+8>>2]},this.set_caught=function(n){n=n?1:0,E[this.ptr+12>>0]=n},this.get_caught=function(){return E[this.ptr+12>>0]!=0},this.set_rethrown=function(n){n=n?1:0,E[this.ptr+13>>0]=n},this.get_rethrown=function(){return E[this.ptr+13>>0]!=0},this.init=function(n,e){this.set_adjusted_ptr(0),this.set_type(n),this.set_destructor(e)},this.set_adjusted_ptr=function(n){p[this.ptr+16>>2]=n},this.get_adjusted_ptr=function(){return p[this.ptr+16>>2]},this.get_exception_ptr=function(){if(xt(this.get_type()))return p[this.excPtr>>2];var n=this.get_adjusted_ptr();return n!==0?n:this.excPtr}}function tn(t,n,e){throw new Yt(t).init(n,e),t}var N={};function _t(t){for(;t.length;){var n=t.pop();t.pop()(n)}}function L(t){return this.fromWireType(W[t>>2])}var S={},j={},$={},nn=48,en=57;function rn(t){if(t===void 0)return"_unknown";var n=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return n>=nn&&n<=en?"_"+t:t}function on(t,n){return{[t=rn(t)]:function(){return n.apply(this,arguments)}}[t]}function tt(t,n){var e=on(n,function(r){this.name=n,this.message=r;var o=new Error(r).stack;o!==void 0&&(this.stack=this.toString()+` `+o.replace(/^Error(:[^\n]*)?\n/,""))});return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},e}var wt=void 0;function bt(t){throw new wt(t)}function At(t,n,e){function r(a){var s=e(a);s.length!==t.length&&bt("Mismatched type converter count");for(var f=0;f{j.hasOwnProperty(a)?o[s]=j[a]:(u.push(a),S.hasOwnProperty(a)||(S[a]=[]),S[a].push(()=>{o[s]=j[a],++c===u.length&&r(o)}))}),u.length===0&&r(o)}function an(t){var n=N[t];delete N[t];var e=n.rawConstructor,r=n.rawDestructor,o=n.fields;At([t],o.map(u=>u.getterReturnType).concat(o.map(u=>u.setterArgumentType)),u=>{var c={};return o.forEach((a,s)=>{var f=a.fieldName,l=u[s],d=a.getter,C=a.getterContext,y=u[s+o.length],_=a.setter,P=a.setterContext;c[f]={read:w=>l.fromWireType(d(C,w)),write:(w,rt)=>{var Z=[];_(P,w,y.toWireType(Z,rt)),_t(Z)}}}),[{name:n.name,fromWireType:function(a){var s={};for(var f in c)s[f]=c[f].read(a);return r(a),s},toWireType:function(a,s){for(var f in c)if(!(f in s))throw new TypeError('Missing field: "'+f+'"');var l=e();for(f in c)c[f].write(l,s[f]);return a!==null&&a.push(r,l),l},argPackAdvance:8,readValueFromPointer:L,destructorFunction:r}]})}function un(t,n,e,r,o){}function nt(t){switch(t){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+t)}}function cn(){for(var t=new Array(256),n=0;n<256;++n)t[n]=String.fromCharCode(n);Tt=t}var Tt=void 0;function h(t){for(var n="",e=t;v[e];)n+=Tt[v[e++]];return n}var Ct=void 0;function m(t){throw new Ct(t)}function A(t,n,e={}){if(!("argPackAdvance"in n))throw new TypeError("registerType registeredInstance requires argPackAdvance");var r=n.name;if(t||m('type "'+r+'" must have a positive integer typeid pointer'),j.hasOwnProperty(t)){if(e.ignoreDuplicateRegistrations)return;m("Cannot register type '"+r+"' twice")}if(j[t]=n,delete $[t],S.hasOwnProperty(t)){var o=S[t];delete S[t],o.forEach(u=>u())}}function sn(t,n,e,r,o){var u=nt(e);A(t,{name:n=h(n),fromWireType:function(c){return!!c},toWireType:function(c,a){return a?r:o},argPackAdvance:8,readValueFromPointer:function(c){var a;if(e===1)a=E;else if(e===2)a=R;else{if(e!==4)throw new TypeError("Unknown boolean type size: "+n);a=W}return this.fromWireType(a[c>>u])},destructorFunction:null})}function fn(){this.allocated=[void 0],this.freelist=[],this.get=function(t){return this.allocated[t]},this.allocate=function(t){let n=this.freelist.pop()||this.allocated.length;return this.allocated[n]=t,n},this.free=function(t){this.allocated[t]=void 0,this.freelist.push(t)}}var g=new fn;function Pt(t){t>=g.reserved&&--g.get(t).refcount==0&&g.free(t)}function ln(){for(var t=0,n=g.reserved;n(t||m("Cannot use deleted val. handle = "+t),g.get(t).value),toHandle:t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return g.allocate({refcount:1,value:t})}}};function pn(t,n){A(t,{name:n=h(n),fromWireType:function(e){var r=G.toValue(e);return Pt(e),r},toWireType:function(e,r){return G.toHandle(r)},argPackAdvance:8,readValueFromPointer:L,destructorFunction:null})}function vn(t,n){switch(n){case 2:return function(e){return this.fromWireType(ct[e>>2])};case 3:return function(e){return this.fromWireType(st[e>>3])};default:throw new TypeError("Unknown float type: "+t)}}function hn(t,n,e){var r=nt(e);A(t,{name:n=h(n),fromWireType:function(o){return o},toWireType:function(o,u){return u},argPackAdvance:8,readValueFromPointer:vn(n,r),destructorFunction:null})}function mn(t,n,e,r,o,u){var c=n.length;c<2&&m("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var a=n[1]!==null&&e!==null,s=!1,f=1;f>2]);return e}function wn(t,n,e){i.hasOwnProperty(t)||bt("Replacing nonexistant public symbol"),i[t].overloadTable!==void 0&&e!==void 0?i[t].overloadTable[e]=n:(i[t]=n,i[t].argCount=e)}function bn(t,n,e){var r=i["dynCall_"+t];return e&&e.length?r.apply(null,[n].concat(e)):r.call(null,n)}function An(t,n,e){return t.includes("j")?bn(t,n,e):Y(n).apply(null,e)}function Tn(t,n){var e=[];return function(){return e.length=0,Object.assign(e,arguments),An(t,n,e)}}function H(t,n){function e(){return t.includes("j")?Tn(t,n):Y(n)}t=h(t);var r=e();return typeof r!="function"&&m("unknown function pointer with signature "+t+": "+n),r}var Et=void 0;function Wt(t){var n=St(t),e=h(n);return T(n),e}function Cn(t,n){var e=[],r={};function o(u){r[u]||j[u]||($[u]?$[u].forEach(o):(e.push(u),r[u]=!0))}throw n.forEach(o),new Et(t+": "+e.map(Wt).join([", "]))}function Pn(t,n,e,r,o,u,c){var a=_n(n,e);t=h(t),o=H(r,o),yn(t,function(){Cn("Cannot call "+t+" due to unbound types",a)},n-1),At([],a,function(s){var f=[s[0],null].concat(s.slice(1));return wn(t,mn(t,f,null,o,u),n-1),[]})}function En(t,n,e){switch(n){case 0:return e?function(r){return E[r]}:function(r){return v[r]};case 1:return e?function(r){return R[r>>1]}:function(r){return M[r>>1]};case 2:return e?function(r){return W[r>>2]}:function(r){return p[r>>2]};default:throw new TypeError("Unknown integer type: "+t)}}function Wn(t,n,e,r,o){n=h(n);var u=nt(e),c=l=>l;if(r===0){var a=32-8*e;c=l=>l<>>a}var s=n.includes("unsigned"),f=(l,d)=>{};A(t,{name:n,fromWireType:c,toWireType:s?function(l,d){return f(d,this.name),d>>>0}:function(l,d){return f(d,this.name),d},argPackAdvance:8,readValueFromPointer:En(n,u,r!==0),destructorFunction:null})}function kn(t,n,e){var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][n];function o(u){var c=p,a=c[u>>=2],s=c[u+1];return new r(c.buffer,s,a)}A(t,{name:e=h(e),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})}function jn(t,n,e,r){if(!(r>0))return 0;for(var o=e,u=e+r-1,c=0;c=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++c)),a<=127){if(e>=u)break;n[e++]=a}else if(a<=2047){if(e+1>=u)break;n[e++]=192|a>>6,n[e++]=128|63&a}else if(a<=65535){if(e+2>=u)break;n[e++]=224|a>>12,n[e++]=128|a>>6&63,n[e++]=128|63&a}else{if(e+3>=u)break;n[e++]=240|a>>18,n[e++]=128|a>>12&63,n[e++]=128|a>>6&63,n[e++]=128|63&a}}return n[e]=0,e-o}function Fn(t,n,e){return jn(t,v,n,e)}function Rn(t){for(var n=0,e=0;e=55296&&r<=57343?(n+=4,++e):n+=3}return n}var kt=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function jt(t,n,e){for(var r=n+e,o=n;t[o]&&!(o>=r);)++o;if(o-n>16&&t.buffer&&kt)return kt.decode(t.subarray(n,o));for(var u="";n>10,56320|1023&f)}}else u+=String.fromCharCode((31&c)<<6|a)}else u+=String.fromCharCode(c)}return u}function Sn(t,n){return t?jt(v,t,n):""}function xn(t,n){var e=(n=h(n))==="std::string";A(t,{name:n,fromWireType:function(r){var o,u=p[r>>2],c=r+4;if(e)for(var a=c,s=0;s<=u;++s){var f=c+s;if(s==u||v[f]==0){var l=Sn(a,f-a);o===void 0?o=l:(o+="\0",o+=l),a=f+1}}else{var d=new Array(u);for(s=0;s>2]=u,e&&c)Fn(o,s,u+1);else if(c)for(var f=0;f255&&(T(s),m("String has UTF-16 code units that do not fit in 8 bits")),v[s+f]=l}else for(f=0;f>1,o=r+n/2;!(r>=o)&&M[r];)++r;if((e=r<<1)-t>32&&Ft)return Ft.decode(v.subarray(t,e));for(var u="",c=0;!(c>=n/2);++c){var a=R[t+2*c>>1];if(a==0)break;u+=String.fromCharCode(a)}return u}function In(t,n,e){if(e===void 0&&(e=2147483647),e<2)return 0;for(var r=n,o=(e-=2)<2*t.length?e/2:t.length,u=0;u>1]=c,n+=2}return R[n>>1]=0,n-r}function On(t){return 2*t.length}function Hn(t,n){for(var e=0,r="";!(e>=n/4);){var o=W[t+4*e>>2];if(o==0)break;if(++e,o>=65536){var u=o-65536;r+=String.fromCharCode(55296|u>>10,56320|1023&u)}else r+=String.fromCharCode(o)}return r}function zn(t,n,e){if(e===void 0&&(e=2147483647),e<4)return 0;for(var r=n,o=r+e-4,u=0;u=55296&&c<=57343&&(c=65536+((1023&c)<<10)|1023&t.charCodeAt(++u)),W[n>>2]=c,(n+=4)+4>o)break}return W[n>>2]=0,n-r}function Dn(t){for(var n=0,e=0;e=55296&&r<=57343&&++e,n+=4}return n}function Vn(t,n,e){var r,o,u,c,a;e=h(e),n===2?(r=Un,o=In,c=On,u=()=>M,a=1):n===4&&(r=Hn,o=zn,c=Dn,u=()=>p,a=2),A(t,{name:e,fromWireType:function(s){for(var f,l=p[s>>2],d=u(),C=s+4,y=0;y<=l;++y){var _=s+4+y*n;if(y==l||d[_>>a]==0){var P=r(C,_-C);f===void 0?f=P:(f+="\0",f+=P),C=_+n}}return T(s),f},toWireType:function(s,f){typeof f!="string"&&m("Cannot pass non-string to C++ string type "+e);var l=c(f),d=et(4+l+n);return p[d>>2]=l>>a,o(f,d+4,l+n),s!==null&&s.push(T,d),d},argPackAdvance:8,readValueFromPointer:L,destructorFunction:function(s){T(s)}})}function Mn(t,n,e,r,o,u){N[t]={name:h(n),rawConstructor:H(e,r),rawDestructor:H(o,u),fields:[]}}function Bn(t,n,e,r,o,u,c,a,s,f){N[t].fields.push({fieldName:h(n),getterReturnType:e,getter:H(r,o),getterContext:u,setterArgumentType:c,setter:H(a,s),setterContext:f})}function qn(t,n){A(t,{isVoid:!0,name:n=h(n),argPackAdvance:0,fromWireType:function(){},toWireType:function(e,r){}})}function Nn(t){t>4&&(g.get(t).refcount+=1)}var Ln={};function $n(t){var n=Ln[t];return n===void 0?h(t):n}function Gn(t){return G.toHandle($n(t))}function Xn(t,n){var e=j[t];return e===void 0&&m(n+" has unknown type "+Wt(t)),e}function Zn(t,n){var e=(t=Xn(t,"_emval_take_value")).readValueFromPointer(n);return G.toHandle(e)}function Jn(){B("")}function Kn(t,n,e){v.copyWithin(t,n,n+e)}function Qn(){return 2147483648}function Yn(t){var n=V.buffer;try{return V.grow(t-n.byteLength+65535>>>16),dt(),1}catch{}}function te(t){var n=v.length;t>>>=0;var e=Qn();if(t>e)return!1;let r=(c,a)=>c+(a-c%a)%a;for(var o=1;o<=4;o*=2){var u=n*(1+.2/o);if(u=Math.min(u,t+100663296),Yn(Math.min(e,r(Math.max(t,u),65536))))return!0}return!1}function ne(t){return 52}function ee(t,n,e,r,o){return 70}var re=[null,[],[]];function ie(t,n){var e=re[t];n===0||n===10?((t===1?Dt:F)(jt(e,0)),e.length=0):e.push(n)}function oe(t,n,e,r){for(var o=0,u=0;u>2],a=p[n+4>>2];n+=8;for(var s=0;s>2]=o,0}wt=i.InternalError=tt(Error,"InternalError"),cn(),Ct=i.BindingError=tt(Error,"BindingError"),dn(),Et=i.UnboundTypeError=tt(Error,"UnboundTypeError");var Rt={__call_sighandler:Qt,__cxa_throw:tn,_embind_finalize_value_object:an,_embind_register_bigint:un,_embind_register_bool:sn,_embind_register_emval:pn,_embind_register_float:hn,_embind_register_function:Pn,_embind_register_integer:Wn,_embind_register_memory_view:kn,_embind_register_std_string:xn,_embind_register_std_wstring:Vn,_embind_register_value_object:Mn,_embind_register_value_object_field:Bn,_embind_register_void:qn,_emval_decref:Pt,_emval_incref:Nn,_emval_new_cstring:Gn,_emval_take_value:Zn,abort:Jn,emscripten_memcpy_big:Kn,emscripten_resize_heap:te,fd_close:ne,fd_seek:ee,fd_write:oe};Kt();var et=function(){return(et=i.asm.malloc).apply(null,arguments)},T=function(){return(T=i.asm.free).apply(null,arguments)},St=function(){return(St=i.asm.__getTypeName).apply(null,arguments)};i.__embind_initialize_bindings=function(){return(i.__embind_initialize_bindings=i.asm._embind_initialize_bindings).apply(null,arguments)};var X,xt=function(){return(xt=i.asm.__cxa_is_pointer_type).apply(null,arguments)};function Ut(){function t(){X||(X=!0,i.calledRun=!0,lt||(Mt(),ot(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),Bt()))}k>0||(Vt(),k>0||(i.setStatus?(i.setStatus("Running..."),setTimeout(function(){setTimeout(function(){i.setStatus("")},1),t()},1)):t()))}if(i.dynCall_vij=function(){return(i.dynCall_vij=i.asm.dynCall_vij).apply(null,arguments)},i.dynCall_jiji=function(){return(i.dynCall_jiji=i.asm.dynCall_jiji).apply(null,arguments)},I=function t(){X||Ut(),X||(I=t)},i.preInit)for(typeof i.preInit=="function"&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return Ut(),J.ready},It.exports=Ot;const ce=ue(Ht.exports),fe=Object.freeze(Object.defineProperty({__proto__:null,default:ce},Symbol.toStringTag,{value:"Module"}));export{fe as i}; diff --git a/assets/icon-BuW41TqN.js b/assets/icon-BXpWZdRl.js similarity index 94% rename from assets/icon-BuW41TqN.js rename to assets/icon-BXpWZdRl.js index 1c1a128..18e6dd3 100644 --- a/assets/icon-BuW41TqN.js +++ b/assets/icon-BXpWZdRl.js @@ -1,4 +1,4 @@ -import{c2 as m,c3 as b,c0 as h,c4 as x,c5 as g}from"./index-CEWggaxV.js";import{g as v,t as z}from"./dom-DPsTWDAQ.js";import{c as I}from"./observers-MZ9Ss0UR.js";/*! +import{c2 as m,c3 as b,c0 as h,c4 as x,c5 as g}from"./index-BjUNJPVf.js";import{g as v,t as z}from"./dom-DPsTWDAQ.js";import{c as I}from"./observers-B6R0JooC.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.7.1 diff --git a/assets/imageBitmapUtils-C0nKXf5P.js b/assets/imageBitmapUtils-BVxrhFkK.js similarity index 84% rename from assets/imageBitmapUtils-C0nKXf5P.js rename to assets/imageBitmapUtils-BVxrhFkK.js index 5e8690f..5bfb4cf 100644 --- a/assets/imageBitmapUtils-C0nKXf5P.js +++ b/assets/imageBitmapUtils-BVxrhFkK.js @@ -1 +1 @@ -import{N as l,at as c}from"./index-CEWggaxV.js";async function u(a,e,t){let r;try{r=await createImageBitmap(a)}catch(o){throw new l("request:server",`Unable to load ${e}`,{url:e,error:o})}return c(t),r}async function w(a,e,t,r,o){let n;try{n=await createImageBitmap(a)}catch(s){throw new l("request:server",`Unable to load tile ${e}/${t}/${r}`,{error:s,level:e,row:t,col:r})}return c(o),n}export{w as o,u as t}; +import{N as l,at as c}from"./index-BjUNJPVf.js";async function u(a,e,t){let r;try{r=await createImageBitmap(a)}catch(o){throw new l("request:server",`Unable to load ${e}`,{url:e,error:o})}return c(t),r}async function w(a,e,t,r,o){let n;try{n=await createImageBitmap(a)}catch(s){throw new l("request:server",`Unable to load tile ${e}/${t}/${r}`,{error:s,level:e,row:t,col:r})}return c(o),n}export{w as o,u as t}; diff --git a/assets/imageUtils-D_EPf7De.js b/assets/imageUtils-BNh57Y88.js similarity index 90% rename from assets/imageUtils-D_EPf7De.js rename to assets/imageUtils-BNh57Y88.js index 7671502..0d79acb 100644 --- a/assets/imageUtils-D_EPf7De.js +++ b/assets/imageUtils-BNh57Y88.js @@ -1 +1 @@ -import{eO as m,ai as M,d as V,f as y}from"./index-CEWggaxV.js";import{b as I}from"./Bitmap--gOrgR8J.js";import{r as T,h as _}from"./WGLContainer-B_Pv-8Yi.js";import{E as c}from"./Container-CB7SlLB9.js";import{i as A}from"./TileContainer-Ci6dOowA.js";let F=class extends T{constructor(e,i,r,s,n,o,a=null){super(e,i,r,s,n,o),this.bitmap=new I(a),this.bitmap.coordScale=[n,o],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy()}beforeRender(e){this.bitmap.beforeRender(e),super.beforeRender(e)}afterRender(e){this.bitmap.afterRender(e),super.afterRender(e)}set stencilRef(e){this.bitmap.stencilRef=e}get stencilRef(){return this.bitmap.stencilRef}_createTransforms(){return{displayViewScreenMat3:m(),tileMat3:m()}}setTransform(e){super.setTransform(e),this.bitmap.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap&&(this.bitmap.stage=null)}},L=class extends A{get requiresDedicatedFBO(){return this.children.some(e=>e.bitmap.blendFunction==="additive")}createTile(e){const i=this._tileInfoView.getTileBounds(M(),e),r=this._tileInfoView.getTileResolution(e.level),[s,n]=this._tileInfoView.tileInfo.size;return new F(e,r,i[0],i[3],s,n)}prepareRenderPasses(e){const i=e.registerRenderPass({name:"bitmap (tile)",brushes:[_.bitmap],target:()=>this.children.map(r=>r.bitmap),drawPhase:c.MAP});return[...super.prepareRenderPasses(e),i]}doRender(e){this.visible&&e.drawPhase===c.MAP&&super.doRender(e)}};const z=t=>{let e=class extends t{attach(){this.view.timeline.record(`${this.layer.title} (BitmapTileLayer) Attach`),this._bitmapView=new L(this._tileInfoView),this.container.addChild(this._bitmapView)}detach(){var i;this.container.removeChild(this._bitmapView),(i=this._bitmapView)==null||i.removeAllChildren(),this._bitmapView=null}};return e=V([y("esri.views.2d.layers.BitmapTileLayerView2D")],e),e};function P(t){return t instanceof HTMLImageElement?t.naturalWidth:t.width}function $(t){return t instanceof HTMLImageElement?t.naturalHeight:t.height}function X(t,e,i,r){if(i.level===r.level)return e;const s=t.tileInfo.size,n=t.getTileResolution(i.level),o=t.getTileResolution(r.level);let a=t.getLODInfoAt(r.level);const p=a.getXForColumn(r.col),u=a.getYForRow(r.row);a=t.getLODInfoAt(i.level);const f=a.getXForColumn(i.col),b=a.getYForRow(i.row),l=P(e)/s[0],h=$(e)/s[1],w=Math.round(l*((p-f)/n)),g=Math.round(h*(-(u-b)/n)),R=Math.round(l*s[0]*(o/n)),v=Math.round(h*s[1]*(o/n)),d=C(s);return d.getContext("2d").drawImage(e,w,g,R,v,0,0,s[0],s[1]),d}function C(t){const e=document.createElement("canvas");return[e.width,e.height]=t,e}export{X as n,C as o,z as r}; +import{eO as m,ai as M,d as V,f as y}from"./index-BjUNJPVf.js";import{b as I}from"./Bitmap-DpyomsG7.js";import{r as T,h as _}from"./WGLContainer-DgZNq7b0.js";import{E as c}from"./Container-_n5wCgez.js";import{i as A}from"./TileContainer-Bs-vXdD_.js";let F=class extends T{constructor(e,i,r,s,n,o,a=null){super(e,i,r,s,n,o),this.bitmap=new I(a),this.bitmap.coordScale=[n,o],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy()}beforeRender(e){this.bitmap.beforeRender(e),super.beforeRender(e)}afterRender(e){this.bitmap.afterRender(e),super.afterRender(e)}set stencilRef(e){this.bitmap.stencilRef=e}get stencilRef(){return this.bitmap.stencilRef}_createTransforms(){return{displayViewScreenMat3:m(),tileMat3:m()}}setTransform(e){super.setTransform(e),this.bitmap.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap&&(this.bitmap.stage=null)}},L=class extends A{get requiresDedicatedFBO(){return this.children.some(e=>e.bitmap.blendFunction==="additive")}createTile(e){const i=this._tileInfoView.getTileBounds(M(),e),r=this._tileInfoView.getTileResolution(e.level),[s,n]=this._tileInfoView.tileInfo.size;return new F(e,r,i[0],i[3],s,n)}prepareRenderPasses(e){const i=e.registerRenderPass({name:"bitmap (tile)",brushes:[_.bitmap],target:()=>this.children.map(r=>r.bitmap),drawPhase:c.MAP});return[...super.prepareRenderPasses(e),i]}doRender(e){this.visible&&e.drawPhase===c.MAP&&super.doRender(e)}};const z=t=>{let e=class extends t{attach(){this.view.timeline.record(`${this.layer.title} (BitmapTileLayer) Attach`),this._bitmapView=new L(this._tileInfoView),this.container.addChild(this._bitmapView)}detach(){var i;this.container.removeChild(this._bitmapView),(i=this._bitmapView)==null||i.removeAllChildren(),this._bitmapView=null}};return e=V([y("esri.views.2d.layers.BitmapTileLayerView2D")],e),e};function P(t){return t instanceof HTMLImageElement?t.naturalWidth:t.width}function $(t){return t instanceof HTMLImageElement?t.naturalHeight:t.height}function X(t,e,i,r){if(i.level===r.level)return e;const s=t.tileInfo.size,n=t.getTileResolution(i.level),o=t.getTileResolution(r.level);let a=t.getLODInfoAt(r.level);const p=a.getXForColumn(r.col),u=a.getYForRow(r.row);a=t.getLODInfoAt(i.level);const f=a.getXForColumn(i.col),b=a.getYForRow(i.row),l=P(e)/s[0],h=$(e)/s[1],w=Math.round(l*((p-f)/n)),g=Math.round(h*(-(u-b)/n)),R=Math.round(l*s[0]*(o/n)),v=Math.round(h*s[1]*(o/n)),d=C(s);return d.getContext("2d").drawImage(e,w,g,R,v,0,0,s[0],s[1]),d}function C(t){const e=document.createElement("canvas");return[e.width,e.height]=t,e}export{X as n,C as o,z as r}; diff --git a/assets/imageUtils-DNanu5Rn.js b/assets/imageUtils-ChIDAvDr.js similarity index 78% rename from assets/imageUtils-DNanu5Rn.js rename to assets/imageUtils-ChIDAvDr.js index 2777f7e..07cc632 100644 --- a/assets/imageUtils-DNanu5Rn.js +++ b/assets/imageUtils-ChIDAvDr.js @@ -1,7 +1,7 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/gif-CppQXD_j.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css","assets/apng-D2pTRXhQ.js"] + __vite__mapDeps.viteFileDeps = ["assets/gif-DuihXOIa.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css","assets/apng-DNWE4pJX.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{_ as u,J as m,K as w,M as f,b as p,N as y}from"./index-CEWggaxV.js";let i=null,s=!0;function T(n,a,t){if(!n||!a)throw new Error("Cannot construct image data without dimensions");if(s)try{return new ImageData(n,a)}catch{s=!1}return d(n,a,t)}function E(n,a,t,e){if(!a||!t)throw new Error("Cannot construct image data without dimensions");if(s)try{return new ImageData(n,a,t)}catch{s=!1}const r=d(a,t,e);return r.data.set(n,0),r}function g(){return i||(i=document.createElement("canvas"),i.width=1,i.height=1),i}function d(n,a,t){return t||(t=g()),t.getContext("2d").createImageData(n,a)}async function h(n,a){const t=window.URL.createObjectURL(n);try{const{data:e}=await f(t,{...a,responseType:"image"});return e}catch(e){throw p(e)?e:new y("invalid-image",`Could not fetch requested image at ${t}`)}finally{window.URL.revokeObjectURL(t)}}async function b(n,a){const{arrayBuffer:t,mediaType:e}=await _(n,a),r=e==="image/png";if(e==="image/gif"){const{isAnimatedGIF:o,parseGif:c}=await u(()=>import("./gif-CppQXD_j.js"),__vite__mapDeps([0,1,2]));if(o(t))return c(t,a)}if(r){const{isAnimatedPNG:o,parseApng:c}=await u(()=>import("./apng-D2pTRXhQ.js"),__vite__mapDeps([3,1,2]));if(o(t))return c(t,a)}return h(new Blob([t],{type:e}),a)}async function _(n,a){var r;const t=m(n);if(t!=null&&t.isBase64)return{arrayBuffer:w(t.data),mediaType:t.mediaType};const e=await f(n,{responseType:"array-buffer",...a});return{arrayBuffer:e.data,mediaType:((r=e.getHeader)==null?void 0:r.call(e,"Content-Type"))??""}}export{E as c,b as p,T as s}; +import{_ as u,J as m,K as w,M as f,b as p,N as y}from"./index-BjUNJPVf.js";let i=null,s=!0;function T(n,a,t){if(!n||!a)throw new Error("Cannot construct image data without dimensions");if(s)try{return new ImageData(n,a)}catch{s=!1}return d(n,a,t)}function E(n,a,t,e){if(!a||!t)throw new Error("Cannot construct image data without dimensions");if(s)try{return new ImageData(n,a,t)}catch{s=!1}const r=d(a,t,e);return r.data.set(n,0),r}function g(){return i||(i=document.createElement("canvas"),i.width=1,i.height=1),i}function d(n,a,t){return t||(t=g()),t.getContext("2d").createImageData(n,a)}async function h(n,a){const t=window.URL.createObjectURL(n);try{const{data:e}=await f(t,{...a,responseType:"image"});return e}catch(e){throw p(e)?e:new y("invalid-image",`Could not fetch requested image at ${t}`)}finally{window.URL.revokeObjectURL(t)}}async function b(n,a){const{arrayBuffer:t,mediaType:e}=await _(n,a),r=e==="image/png";if(e==="image/gif"){const{isAnimatedGIF:o,parseGif:c}=await u(()=>import("./gif-DuihXOIa.js"),__vite__mapDeps([0,1,2]));if(o(t))return c(t,a)}if(r){const{isAnimatedPNG:o,parseApng:c}=await u(()=>import("./apng-DNWE4pJX.js"),__vite__mapDeps([3,1,2]));if(o(t))return c(t,a)}return h(new Blob([t],{type:e}),a)}async function _(n,a){var r;const t=m(n);if(t!=null&&t.isBase64)return{arrayBuffer:w(t.data),mediaType:t.mediaType};const e=await f(n,{responseType:"array-buffer",...a});return{arrayBuffer:e.data,mediaType:((r=e.getHeader)==null?void 0:r.call(e,"Content-Type"))??""}}export{E as c,b as p,T as s}; diff --git a/assets/imageryUtils-Bct433Ji.js b/assets/imageryUtils-CP_eOmeO.js similarity index 81% rename from assets/imageryUtils-Bct433Ji.js rename to assets/imageryUtils-CP_eOmeO.js index e4814cb..a693f81 100644 --- a/assets/imageryUtils-Bct433Ji.js +++ b/assets/imageryUtils-CP_eOmeO.js @@ -1 +1 @@ -import{$ as m,j as o}from"./utils-2LBmsoaQ.js";import{ei as c,ej as p,el as i,en as u}from"./index-CEWggaxV.js";import"./originUtils-D69mHv66.js";import"./multiOriginJSONSupportUtils-C0wm8_Yw.js";import"./saveAPIKeyUtils-BiX1lQSW.js";import"./saveUtils-BzCRy3uR.js";const s="Image Service",g="imagery-layer-save",v="imagery-layer-save-as",f="imagery-tile-layer-save",d="imagery-tile-layer-save-as";function l(a){var t;if(a.type==="imagery")return{isValid:!0};const{raster:e}=a,r=(e==null?void 0:e.datasetFormat)==="Function"?(t=e.primaryRasters)==null?void 0:t.rasters[0]:e;return{isValid:(r==null?void 0:r.datasetFormat)==="RasterTileServer"&&(r.tileType==="Raster"||r.tileType==="Map"),errorMessage:"imagery tile layer should be created from a tiled image service."}}function n(a){const e=a.layerJSON;return Promise.resolve(e&&Object.keys(e).length?e:null)}async function T(a,e){const{parsedUrl:r,title:t,fullExtent:y}=a;e.url=r.path,e.title||(e.title=t);try{e.extent=await c(y)}catch{e.extent=void 0}p(e,i.METADATA),a.type==="imagery-tile"&&u(e,i.TILED_IMAGERY)}async function M(a,e){const r=a.type==="imagery"?g:f;return m({layer:a,itemType:s,validateLayer:l,createItemData:n,errorNamePrefix:r},e)}async function P(a,e,r){const t=a.type==="imagery"?v:d;return o({layer:a,itemType:s,validateLayer:l,createItemData:n,errorNamePrefix:t,newItem:e,setItemProperties:T},r)}export{M as save,P as saveAs}; +import{$ as m,j as o}from"./utils-iOpWi7jV.js";import{ei as c,ej as p,el as i,en as u}from"./index-BjUNJPVf.js";import"./originUtils-D69mHv66.js";import"./multiOriginJSONSupportUtils-C0wm8_Yw.js";import"./saveAPIKeyUtils-YRBbgdzi.js";import"./saveUtils-CGGzyvzv.js";const s="Image Service",g="imagery-layer-save",v="imagery-layer-save-as",f="imagery-tile-layer-save",d="imagery-tile-layer-save-as";function l(a){var t;if(a.type==="imagery")return{isValid:!0};const{raster:e}=a,r=(e==null?void 0:e.datasetFormat)==="Function"?(t=e.primaryRasters)==null?void 0:t.rasters[0]:e;return{isValid:(r==null?void 0:r.datasetFormat)==="RasterTileServer"&&(r.tileType==="Raster"||r.tileType==="Map"),errorMessage:"imagery tile layer should be created from a tiled image service."}}function n(a){const e=a.layerJSON;return Promise.resolve(e&&Object.keys(e).length?e:null)}async function T(a,e){const{parsedUrl:r,title:t,fullExtent:y}=a;e.url=r.path,e.title||(e.title=t);try{e.extent=await c(y)}catch{e.extent=void 0}p(e,i.METADATA),a.type==="imagery-tile"&&u(e,i.TILED_IMAGERY)}async function M(a,e){const r=a.type==="imagery"?g:f;return m({layer:a,itemType:s,validateLayer:l,createItemData:n,errorNamePrefix:r},e)}async function P(a,e,r){const t=a.type==="imagery"?v:d;return o({layer:a,itemType:s,validateLayer:l,createItemData:n,errorNamePrefix:t,newItem:e,setItemProperties:T},r)}export{M as save,P as saveAs}; diff --git a/assets/index-CEWggaxV.js b/assets/index-BjUNJPVf.js similarity index 98% rename from assets/index-CEWggaxV.js rename to assets/index-BjUNJPVf.js index 1975231..6aa7853 100644 --- a/assets/index-CEWggaxV.js +++ b/assets/index-BjUNJPVf.js @@ -1,6 +1,6 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/IdentityManager-CHp4-snh.js","assets/substitute-DxAztrfK.js","assets/layersCreator-ByGguThJ.js","assets/portalLayers-B6YNSnGP.js","assets/associatedFeatureServiceUtils-BIEHgyxo.js","assets/lazyLayerLoader-s-GqbiwM.js","assets/styleUtils-B_Iy1DTk.js","assets/arcgisLayers-DI7gu0Vy.js","assets/fetchService-C38RarY2.js","assets/statsWorker-CD2pE8ny.js","assets/utils-B8iadP2F.js","assets/quantizationUtils-CUjGHrU3.js","assets/heatmapUtils-Clt5rJzr.js","assets/utils-SjO_-1JL.js","assets/utils-GMt8_G3w.js","assets/ClassBreaksDefinition-D281x8Sj.js","assets/geometryEngineWorker-iTtx-A2l.js","assets/geometryEngineJSON-D-7-cYHZ.js","assets/geometryEngineBase-C5__2Su1.js","assets/json-Wa8cmqdu.js","assets/CSVSourceWorker-CrU3052N.js","assets/date-M6n_RqpC.js","assets/OptimizedGeometry-CQuTPb9g.js","assets/FeatureStore-CqSz6SOQ.js","assets/featureConversionUtils-CmP9mw0r.js","assets/OptimizedFeatureSet-Blu9Ckm7.js","assets/BoundsStore-DMoG4U0L.js","assets/PooledRBush-BsFBmw1o.js","assets/timeSupport-BjRbXIpn.js","assets/QueryEngine-RpcY23Sv.js","assets/WhereClause-Dzgyc0wk.js","assets/TimeOnly-Cm47ew5I.js","assets/UnknownTimeZone-DF0BqWCR.js","assets/QueryEngineCapabilities-CTDe3LlQ.js","assets/FieldsIndex-CLgRNeJ_.js","assets/RenderState-DaVlEYWY.js","assets/number-Bu1a2qyF.js","assets/clientSideDefaults-CgRgH99f.js","assets/defaultsJSON-CHAaurhX.js","assets/EdgeProcessingWorker-C-Yxye3Z.js","assets/InterleavedLayout-Dd1W8HCo.js","assets/BufferView-Ao_K-5Vg.js","assets/types-D0PSWh4d.js","assets/Util-BS8sJGjF.js","assets/edgeProcessing-Cvxjjjkp.js","assets/deduplicate-Bk22TunD.js","assets/Indices-Dv-cCjFT.js","assets/VertexAttribute-BlT9lbVY.js","assets/ElevationSamplerWorker-DNbNk0sW.js","assets/meshVertexSpaceUtils-BFWpJFSd.js","assets/MeshLocalVertexSpace-Cltwu1Kq.js","assets/vec3-CjYmIfaa.js","assets/georeference-DtjTZVKi.js","assets/mat3f64-q3fE-ZOt.js","assets/mat4f64-CSKppSlJ.js","assets/computeTranslationToOriginAndRotation-DOOKw0d1.js","assets/DoubleArray-DxyNBrRi.js","assets/quat-CoKEr4Zu.js","assets/quatf64-Bdb9ZJJK.js","assets/FeatureServiceSnappingSourceWorker-BZ3sJkXx.js","assets/pbfQueryUtils-CLRSFGBm.js","assets/pbf-D9QZb8S8.js","assets/query-BM8R3sQ6.js","assets/queryZScale-DN4aFXYn.js","assets/GeoJSONSourceWorker-CUwhItjB.js","assets/geojson-BLwRz6JF.js","assets/sourceUtils-QX9lwl5p.js","assets/MemorySourceWorker-CaK7s0IK.js","assets/objectIdUtils-4dd1rf9p.js","assets/PBFDecoderWorker-C5tQTeCI.js","assets/FeaturePipelineWorker-6OTTsaNH.js","assets/diffUtils-B4YFa5Ju.js","assets/AttributeStore-Ck-75lnq.js","assets/LabelMetric-D2hbzzy_.js","assets/Texture-DJgkMrSB.js","assets/Program-DLRmaKpw.js","assets/UpdateTracking2D-nj9Q-3df.js","assets/TurboLine-CkxIB4ZX.js","assets/earcut-hRlx3adE.js","assets/utils-p-5Bbga5.js","assets/Rect-CUzevAry.js","assets/labelUtils-Dnqx6jl5.js","assets/BindType-BmZEZMMh.js","assets/highlightReasons-DbgbcWKM.js","assets/constants-D5zmR9t2.js","assets/tileUtils-B7X19rIS.js","assets/geohashUtils-CTQSvgbV.js","assets/ogcFeatureUtils-D4df60hh.js","assets/CircularArray-DfLrgW_-.js","assets/createConnection-BxU4QDA7.js","assets/PointCloudWorker-BVcb1Zzd.js","assets/vec3f32-nZdmKIgz.js","assets/PointCloudUniqueValueRenderer-CdXEaMW5.js","assets/ColorStop-44hBlQ14.js","assets/I3SBinaryReader-N_Is4gxa.js","assets/orientedBoundingBox-BQdJNYvE.js","assets/plane-py4f_JCU.js","assets/RasterWorker-DIZgcx97.js","assets/dataUtils-BFJflGP5.js","assets/RasterSymbolizer-D7OwkKeP.js","assets/utils-CMvkNhle.js","assets/colorRamps-BJydlf0f.js","assets/rasterProjectionHelper-Bwvi37wQ.js","assets/SceneLayerSnappingSourceWorker-BIrjnrGh.js","assets/lineSegment-B9UF3nEF.js","assets/ObjectStack-CF0cQvd2.js","assets/sphere-DHd2K2LR.js","assets/SceneLayerWorker-fYw2Py8t.js","assets/I3SUtil-DxFIPSkh.js","assets/symbolColorUtils-D_minlYz.js","assets/WFSSourceWorker-BX8deXfR.js","assets/wfsUtils-DeNqsSXH.js","assets/xmlUtils-CtUoQO7q.js","assets/WorkerTileHandler-DlTCcd69.js","assets/config-MDUrh2eL.js","assets/SourceLayerData-2rdvzlLE.js","assets/Popup-CMTUSIYl.js","assets/AttachmentInfo-DEdzaB9S.js","assets/AttachmentQuery-D61mmWw4.js","assets/utils-kx2f2Fff.js","assets/jsonUtils-BseLl1fZ.js","assets/UniqueValueRenderer-BlkUix3g.js","assets/sizeVariableUtils-Cmcuvw-4.js","assets/visualVariableUtils-z2k12BH8.js","assets/jsonUtils-qYmXvGJ1.js","assets/styleUtils-CnV_Xzhi.js","assets/Version-Bd0QsIQ5.js","assets/OverrideHelper-B4ryGWZb.js","assets/executeQueryJSON-DngjHRnE.js","assets/FeatureSet-CYJUZgOk.js","assets/RelationshipQuery-DDK72Kwc.js","assets/TopFeaturesQuery-B8kC7n5h.js","assets/FeatureLayer-D0kMrROG.js","assets/FormTemplate-eV18QveB.js","assets/editsZScale-CQCGPEjO.js","assets/EditBusLayer-SG7oYwiY.js","assets/FeatureEffectLayer-CLTrRFqx.js","assets/FeatureEffect-ByrbZlne.js","assets/FeatureLayerBase-DPJuwFpX.js","assets/featureLayerUtils-BhDaw8pS.js","assets/LayerFloorInfo-Cdq3ulNh.js","assets/serviceCapabilitiesUtils-t8SL4e_j.js","assets/FeatureReductionLayer-DncGsNIN.js","assets/FeatureReductionSelection-BY3KVXac.js","assets/LabelClass-6cZokw8y.js","assets/MD5-C9MwAd2G.js","assets/OrderedLayer-Do089KpQ.js","assets/OrderByInfo-DKzv2-WS.js","assets/RefreshableLayer-1EkEhJeI.js","assets/TemporalLayer-qq3v_i3q.js","assets/TimeInfo-3TVmpFSA.js","assets/FeatureTemplate-DcprAdTM.js","assets/FeatureType-By3BEr9z.js","assets/fieldProperties-DMs4wT6-.js","assets/labelingInfo-CijajRsc.js","assets/versionUtils-CaceEUVY.js","assets/popupUtils-DAFYyAvw.js","assets/interfaces-CL2NbQte.js","assets/arcadeUtils-BoaybaAR.js","assets/ImmutableArray-BlMso3qf.js","assets/webStyleSymbolUtils-yt4cEoD8.js","assets/devEnvironmentUtils-Blrp8lZ5.js","assets/geometryServiceUtils-CZ5hQKF0.js","assets/project-DmZZCyH4.js","assets/webglDeps-BqalI_vm.js","assets/NestedMap-DgiGbX8E.js","assets/ProgramTemplate-BICQrNzS.js","assets/mapViewDeps-pgi5I2eW.js","assets/SDFHelper-CSK796Wb.js","assets/floatRGBA-BLm-Rhaq.js","assets/Container-CB7SlLB9.js","assets/WGLContainer-B_Pv-8Yi.js","assets/MagnifierPrograms-B5-grLP-.js","assets/testSVGPremultipliedAlpha-B0ipOzbU.js","assets/RenderingContext-2weDpoeh.js","assets/OrderIndependentTransparency-C747AfeB.js","assets/basicInterfaces-GbxEOYtk.js","assets/doublePrecisionUtils-B0owpBza.js","assets/imageUtils-DNanu5Rn.js","assets/rasterizingUtils-DXTinem2.js","assets/utils-CJVw5T-r.js","assets/FeatureCommandQueue-Btq_FXyi.js","assets/GraphicsView2D-DbbthiwV.js","assets/normalizeUtilsSync-B6VufdiX.js","assets/GraphicContainer-CbvswCG0.js","assets/AGraphicContainer-Dby-baET.js","assets/TechniqueInstance-CSsTmbek.js","assets/TileContainer-Ci6dOowA.js","assets/requestImageUtils-Dzwz9ori.js","assets/TileLayerView2D-BnlmUfzg.js","assets/imageUtils-D_EPf7De.js","assets/Bitmap--gOrgR8J.js","assets/LayerView-BEFTHNYv.js","assets/scaleUtils-Bqauo1zZ.js","assets/HighlightGraphicContainer-Cnwl0eCq.js","assets/RefreshableLayerView-C1-PEoNB.js","assets/drapedUtils-CGrSPor9.js","assets/floorFilterUtils-DZ5C6FQv.js","assets/sublayerUtils-BPYHHPMV.js","assets/popupUtils-BovqErR_.js","assets/FeatureLayerView2D-Dw_5zj3d.js","assets/HighlightCounter-abgLEfgq.js","assets/BaseDynamicLayerView2D-BqfsTH6m.js","assets/BitmapContainer-Bq0Mk6_k.js","assets/ExportStrategy-fFnMYcIc.js","assets/CatalogLayerView2D-BuGdqUm1.js","assets/CatalogDynamicGroupLayerView2D-CqaPUHS1.js","assets/CatalogFootprintLayerView2D-4V3pvH_N.js","assets/GeoRSSLayerView2D-DGBAg8jk.js","assets/GraphicsLayerView2D-D7NawYZd.js","assets/GroupLayerView2D-ayVE8wm-.js","assets/ImageryLayerView2D-D5_CduBq.js","assets/RasterVFDisplayObject-boi924Q6.js","assets/ImageryTileLayerView2D-CxFrn228.js","assets/multidimensionalUtils-uKyVhR8j.js","assets/rasterUtils-Dgn5fnGK.js","assets/RawBlockCache-D9cjIDVu.js","assets/KMLLayerView2D-B307IWZ8.js","assets/kmlUtils-Dl7cXNEs.js","assets/KnowledgeGraphLayerView2D-CuM0qoPc.js","assets/MapImageLayerView2D-iNdXAMVi.js","assets/ExportImageParameters-DVsh-7G1.js","assets/MapNotesLayerView2D-DxdmUoTh.js","assets/MediaLayerView2D-vpnVWbi-.js","assets/perspectiveUtils-24oy2YlR.js","assets/OGCFeatureLayerView2D-DBRY7Ix7.js","assets/RouteLayerView2D-CcISu94y.js","assets/Stop-VHT4QwcG.js","assets/StreamLayerView2D-Be7jZFcL.js","assets/SubtypeGroupLayerView2D-BzijIwec.js","assets/VectorTileLayerView2D-Bu846VB2.js","assets/VideoLayerView2D-CtjQ6rEp.js","assets/GraphicsLayer-CexPXXFK.js","assets/WMSLayerView2D-D80tHNhN.js","assets/ExportWMSImageParameters-D7gw-oIo.js","assets/WMTSLayerView2D-CZBGPwsV.js","assets/calcite-button-CMjDkjDb.js","assets/form-D5ySy5kP.js","assets/dom-DPsTWDAQ.js","assets/guid-DQtJl1SZ.js","assets/interactive-BR2V27xp.js","assets/label2-BT0TPJM3.js","assets/component-WqEOSVCt.js","assets/loadable-DylQ3Aza.js","assets/t9n-gKZJT8eY.js","assets/observers-MZ9Ss0UR.js","assets/icon-BuW41TqN.js","assets/loader-DQtzvvHl.js","assets/calcite-icon-CHcIXU52.js","assets/layersLoader-NUfQIBq4.js"] + __vite__mapDeps.viteFileDeps = ["assets/IdentityManager-DBFJchIs.js","assets/substitute-Bz_UrLGp.js","assets/layersCreator-ua5OUPYt.js","assets/portalLayers-DU48R6fl.js","assets/associatedFeatureServiceUtils-nLeTqfYC.js","assets/lazyLayerLoader-Cu0XtDD2.js","assets/styleUtils--I7zqeL6.js","assets/arcgisLayers-fiEUw9dp.js","assets/fetchService-Crgml5qT.js","assets/statsWorker-CAnWqyLs.js","assets/utils-BKh1cxpi.js","assets/quantizationUtils-CfV316jZ.js","assets/heatmapUtils-BSteZBTj.js","assets/utils-Bzmbfe7p.js","assets/utils-CY1ReiSd.js","assets/ClassBreaksDefinition-Djcxa8Lp.js","assets/geometryEngineWorker-C9d969a6.js","assets/geometryEngineJSON-BfS7Q-po.js","assets/geometryEngineBase-CDbTTSsS.js","assets/json-Wa8cmqdu.js","assets/CSVSourceWorker-DNn0ZitV.js","assets/date-M6n_RqpC.js","assets/OptimizedGeometry-CQuTPb9g.js","assets/FeatureStore-CRMzrhIt.js","assets/featureConversionUtils-BHhm7bvm.js","assets/OptimizedFeatureSet-Blu9Ckm7.js","assets/BoundsStore-DRDtG3Mk.js","assets/PooledRBush-BlFOlUgK.js","assets/timeSupport-DXkhlToK.js","assets/QueryEngine-loUu1VUW.js","assets/WhereClause-Ctld7DSu.js","assets/TimeOnly-BXSODLxA.js","assets/UnknownTimeZone-CK7VjgF3.js","assets/QueryEngineCapabilities-CTDe3LlQ.js","assets/FieldsIndex-CK-0B5n9.js","assets/RenderState-DaVlEYWY.js","assets/number-CJqenc9O.js","assets/clientSideDefaults-BQP5n3lX.js","assets/defaultsJSON-CHAaurhX.js","assets/EdgeProcessingWorker-DXabLlxw.js","assets/InterleavedLayout-Cinhb-cY.js","assets/BufferView-3om6S_aJ.js","assets/types-D0PSWh4d.js","assets/Util-CS5u4Lec.js","assets/edgeProcessing-Dg7MHcWM.js","assets/deduplicate-BR6i8Xk0.js","assets/Indices-BRm9v2lM.js","assets/VertexAttribute-BlT9lbVY.js","assets/ElevationSamplerWorker-DR7iKj10.js","assets/meshVertexSpaceUtils-DwMoblqo.js","assets/MeshLocalVertexSpace-DRvwbFTJ.js","assets/vec3-DdRUbala.js","assets/georeference-DqFdARS7.js","assets/mat3f64-q3fE-ZOt.js","assets/mat4f64-CSKppSlJ.js","assets/computeTranslationToOriginAndRotation-BeE3rOSz.js","assets/DoubleArray--0pYeNcV.js","assets/quat-C0wQB0HB.js","assets/quatf64-Bdb9ZJJK.js","assets/FeatureServiceSnappingSourceWorker-CRj73rBJ.js","assets/pbfQueryUtils-CSeFSIjv.js","assets/pbf-Du8sFEWo.js","assets/query-Bk_ITqRK.js","assets/queryZScale-Dwvn5BlQ.js","assets/GeoJSONSourceWorker-CJxkfTXL.js","assets/geojson-AjfTISUf.js","assets/sourceUtils-BNTaqxhX.js","assets/MemorySourceWorker-DFsRya29.js","assets/objectIdUtils-4dd1rf9p.js","assets/PBFDecoderWorker-DLXRZcsS.js","assets/FeaturePipelineWorker--iWINXTy.js","assets/diffUtils-uUoMDFQS.js","assets/AttributeStore-Bm6hLtR1.js","assets/LabelMetric-BcUxDImF.js","assets/Texture-S4dD-WHn.js","assets/Program-DBsYtQ00.js","assets/UpdateTracking2D-Ds_Gdrxd.js","assets/TurboLine-DNQdPIXo.js","assets/earcut-CWKXDqDj.js","assets/utils-CuXO_Zzq.js","assets/Rect-CUzevAry.js","assets/labelUtils-3p0-m-Ee.js","assets/BindType-BmZEZMMh.js","assets/highlightReasons-BOU4mnPE.js","assets/constants-D5zmR9t2.js","assets/tileUtils-B7X19rIS.js","assets/geohashUtils-DEscCvdk.js","assets/ogcFeatureUtils-B_dc0icr.js","assets/CircularArray-DfLrgW_-.js","assets/createConnection-BvioR9C8.js","assets/PointCloudWorker-RLZ1Rh8W.js","assets/vec3f32-nZdmKIgz.js","assets/PointCloudUniqueValueRenderer-DGqW3DIg.js","assets/ColorStop-DCGjAKLC.js","assets/I3SBinaryReader-Bg6QQKyW.js","assets/orientedBoundingBox-sJmHxD3E.js","assets/plane-DxOTtTwj.js","assets/RasterWorker-CzY22QDJ.js","assets/dataUtils-DzOfgSpi.js","assets/RasterSymbolizer-BN7ge8gb.js","assets/utils-CBTVfSGR.js","assets/colorRamps-CcakIWlU.js","assets/rasterProjectionHelper-CHkyWbma.js","assets/SceneLayerSnappingSourceWorker-HITRlJJU.js","assets/lineSegment-BYtydnRZ.js","assets/ObjectStack-BAIuPeIh.js","assets/sphere-F1imyuMS.js","assets/SceneLayerWorker-C6NfAzt5.js","assets/I3SUtil-Bs1mZiKI.js","assets/symbolColorUtils-C9Wp-TPe.js","assets/WFSSourceWorker-DM2J6sPN.js","assets/wfsUtils-p2GOBpZe.js","assets/xmlUtils-CtUoQO7q.js","assets/WorkerTileHandler-B1--DifF.js","assets/config-MDUrh2eL.js","assets/SourceLayerData-CTiUdlGY.js","assets/Popup-DSVql8fN.js","assets/AttachmentInfo-Cm6dhnUr.js","assets/AttachmentQuery-DmEAIZff.js","assets/utils-Dx_a2yJw.js","assets/jsonUtils-Dw332y6z.js","assets/UniqueValueRenderer-7V9Bhr-D.js","assets/sizeVariableUtils-Cmcuvw-4.js","assets/visualVariableUtils-BX9G5gNQ.js","assets/jsonUtils-Ox5U0P0F.js","assets/styleUtils-DOUOskVZ.js","assets/Version-Dqq_CHBG.js","assets/OverrideHelper-DxFZBnGL.js","assets/executeQueryJSON-COxi_Fac.js","assets/FeatureSet-opEn8ou8.js","assets/RelationshipQuery-BDJrOxaX.js","assets/TopFeaturesQuery-CVQjqlfM.js","assets/FeatureLayer-BHxNIHhy.js","assets/FormTemplate-BGxtsGX6.js","assets/editsZScale-Bfe6gH1b.js","assets/EditBusLayer-OslMX9fF.js","assets/FeatureEffectLayer-DarO4Ctx.js","assets/FeatureEffect-DBbkrS6j.js","assets/FeatureLayerBase-D0I-Escx.js","assets/featureLayerUtils-lwqyOSrl.js","assets/LayerFloorInfo-DlYNbO-A.js","assets/serviceCapabilitiesUtils-DiP90Uds.js","assets/FeatureReductionLayer-CK-tyM-9.js","assets/FeatureReductionSelection-t3T7oa8H.js","assets/LabelClass-CeatfK8u.js","assets/MD5-C9MwAd2G.js","assets/OrderedLayer-dLoPhxcx.js","assets/OrderByInfo-DKyk5GLW.js","assets/RefreshableLayer-_r2TPtol.js","assets/TemporalLayer-CKICYnEl.js","assets/TimeInfo-DooETFWC.js","assets/FeatureTemplate-FZNGA_Ik.js","assets/FeatureType-CwUl8Nf5.js","assets/fieldProperties-DnrQXLBM.js","assets/labelingInfo-DqAUis6e.js","assets/versionUtils-BIAEZzrm.js","assets/popupUtils-DlZin22m.js","assets/interfaces-CL2NbQte.js","assets/arcadeUtils-BxUF81hz.js","assets/ImmutableArray-BlMso3qf.js","assets/webStyleSymbolUtils--Y3TqgZl.js","assets/devEnvironmentUtils-Blrp8lZ5.js","assets/geometryServiceUtils-CdocmtDi.js","assets/project-DaC2Outd.js","assets/webglDeps-Cjw3mzdd.js","assets/NestedMap-DgiGbX8E.js","assets/ProgramTemplate-Ck2I0bIi.js","assets/mapViewDeps-B6Hg404o.js","assets/SDFHelper-kKuXhauo.js","assets/floatRGBA-Cs54GdjG.js","assets/Container-_n5wCgez.js","assets/WGLContainer-DgZNq7b0.js","assets/MagnifierPrograms-Dy7jbVaV.js","assets/testSVGPremultipliedAlpha-BUMQhQ4O.js","assets/RenderingContext-vSxDymNY.js","assets/OrderIndependentTransparency-Btph8gYx.js","assets/basicInterfaces-GbxEOYtk.js","assets/doublePrecisionUtils-B0owpBza.js","assets/imageUtils-ChIDAvDr.js","assets/rasterizingUtils-D-sJQSSt.js","assets/utils-D-nPH6yJ.js","assets/FeatureCommandQueue-DI81F3gA.js","assets/GraphicsView2D-B7H8XAnI.js","assets/normalizeUtilsSync-73yZ0QwV.js","assets/GraphicContainer-Bue3JF2r.js","assets/AGraphicContainer-BXk7Eu6w.js","assets/TechniqueInstance-XtnK2qy2.js","assets/TileContainer-Bs-vXdD_.js","assets/requestImageUtils-BHJ_ulwE.js","assets/TileLayerView2D-CoWYvoLX.js","assets/imageUtils-BNh57Y88.js","assets/Bitmap-DpyomsG7.js","assets/LayerView-Bux7vAEn.js","assets/scaleUtils-DWXMiS7R.js","assets/HighlightGraphicContainer-B5WIObEd.js","assets/RefreshableLayerView-L9NGpXXI.js","assets/drapedUtils-DDBQ6RK5.js","assets/floorFilterUtils-DZ5C6FQv.js","assets/sublayerUtils-GrJ1gnTG.js","assets/popupUtils-Do2GfZME.js","assets/FeatureLayerView2D-B6lIa9Lt.js","assets/HighlightCounter-qEuAaY1V.js","assets/BaseDynamicLayerView2D-DSmk7XW5.js","assets/BitmapContainer-DD7rxH0u.js","assets/ExportStrategy-SzILz8ne.js","assets/CatalogLayerView2D-d-xBXyF9.js","assets/CatalogDynamicGroupLayerView2D-CyoAbf0b.js","assets/CatalogFootprintLayerView2D-KePfoiS2.js","assets/GeoRSSLayerView2D-DvkynA-l.js","assets/GraphicsLayerView2D-CtKxPbzt.js","assets/GroupLayerView2D-BVygDtT5.js","assets/ImageryLayerView2D-Cd1bppq2.js","assets/RasterVFDisplayObject-DLrowEg_.js","assets/ImageryTileLayerView2D-DAJXGdeV.js","assets/multidimensionalUtils-u3oUX4w1.js","assets/rasterUtils-DEPcL5Ca.js","assets/RawBlockCache-DNGqU_D7.js","assets/KMLLayerView2D-BTxXwgAN.js","assets/kmlUtils-C6tn6hG1.js","assets/KnowledgeGraphLayerView2D-DZm8ubx6.js","assets/MapImageLayerView2D-Cq7vZ1xD.js","assets/ExportImageParameters-CXqmEVur.js","assets/MapNotesLayerView2D-DgCKO3Zc.js","assets/MediaLayerView2D-CfaV01hI.js","assets/perspectiveUtils-DhC7L1B1.js","assets/OGCFeatureLayerView2D-BT1AiNl1.js","assets/RouteLayerView2D-CjJummeL.js","assets/Stop-D_lBQff2.js","assets/StreamLayerView2D-DqZHXc4V.js","assets/SubtypeGroupLayerView2D-DykSTPs3.js","assets/VectorTileLayerView2D-BLrO1BgS.js","assets/VideoLayerView2D-Vkk8l0f8.js","assets/GraphicsLayer-g4hVfoZU.js","assets/WMSLayerView2D-BHemqaDF.js","assets/ExportWMSImageParameters-Bl6JFYua.js","assets/WMTSLayerView2D-D7P1L341.js","assets/calcite-button-CWS09kHr.js","assets/form-BC9xTZIq.js","assets/dom-DPsTWDAQ.js","assets/guid-DQtJl1SZ.js","assets/interactive-5-lo-GR7.js","assets/label2-BT0TPJM3.js","assets/component-WqEOSVCt.js","assets/loadable-CreDQ1Dd.js","assets/t9n-pVz2fW_o.js","assets/observers-B6R0JooC.js","assets/icon-BXpWZdRl.js","assets/loader-Bjz1lIB0.js","assets/calcite-icon-BCYnyK8T.js","assets/layersLoader-CBGHpR45.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } @@ -9,7 +9,7 @@ var ZV=Object.defineProperty;var YV=(e,t,i)=>t in e?ZV(e,t,{enumerable:!0,config ⚙️ Version: ${s}`),n&&(o+=` 🔗 See ${n} for more details.`),z7(e,o,c)}}function Hme(e){const t=[];return function*(){yield*t;for(const i of e)t.push(i),yield i}}function F7(e,t){for(const i of e)if(i!=null&&t(i))return i}function Gb(e){return e!=null&&typeof e[Symbol.iterator]=="function"}let eA=class kT{constructor(){this._groups=new Map}destroy(){this.removeAll()}get size(){let t=0;return this._groups.forEach(i=>{t+=i.length}),t}add(t,i){if(Gb(t)){const r=this._getOrCreateGroup(i);for(const s of t)this._isHandle(s)&&r.push(s)}else this._isHandle(t)&&this._getOrCreateGroup(i).push(t);return this}forEach(t,i){if(typeof t=="function")this._groups.forEach(r=>r.forEach(t));else{const r=this._getGroup(t);r&&i&&r.forEach(i)}}has(t){return this._groups.has(this._ensureGroupKey(t))}remove(t){if(typeof t!="string"&&Gb(t)){for(const i of t)this.remove(i);return this}return this.has(t)?(this._removeAllFromGroup(this._getGroup(t)),this._groups.delete(this._ensureGroupKey(t)),this):this}removeAll(){return this._groups.forEach(t=>this._removeAllFromGroup(t)),this._groups.clear(),this}_isHandle(t){return t&&(!!t.remove||t instanceof kT)}_getOrCreateGroup(t){if(this.has(t))return this._getGroup(t);const i=[];return this._groups.set(this._ensureGroupKey(t),i),i}_getGroup(t){return this._groups.get(this._ensureGroupKey(t))}_ensureGroupKey(t){return t||"_default_"}_removeAllFromGroup(t){for(const i of t)i instanceof kT?i.removeAll():i.remove()}};function F5(e,t){if(e==null)throw new Error(t??"value is None")}function lr(e){return e==null||e.destroy(),null}function Wme(e){return e==null||e.dispose(),null}function Sr(e){return e==null||e.remove(),null}function z0(e){return e==null||e.abort(),null}function Zme(e){return e==null||e.release(),null}function B7(e,t,i){return e!=null&&t!=null?i!=null?i(e,t):e.equals(t):e===t}function U7(e,t){let i;return e.some((r,s)=>(i=t(r,s),i!=null)),i??void 0}const B5=Symbol("Accessor-beforeDestroy"),j7={remove:()=>{}};function er(e){return e?{remove(){e&&(e(),e=void 0)}}:j7}function V7(e){e.forEach(t=>t==null?void 0:t.remove())}function h_(e){return er(()=>V7(e))}function To(e){return e.__accessor__??null}function G7(e,t){var i;return((i=e==null?void 0:e.metadata)==null?void 0:i[t])!=null}function Uv(e,t,i){return i?qb(e,t,{policy:i,path:""}):qb(e,t,null)}function qb(e,t,i){return t?Object.keys(t).reduce((r,s)=>{const n=s;let c=null,o="merge";if(i&&(c=i.path?`${i.path}.${s}`:s,o=i.policy(c)),o==="replace"||o==="replace-arrays"&&Array.isArray(r[n]))return r[n]=t[n],r;if(r[n]===void 0)return r[n]=He(t[n]),r;let f=r[n],g=t[n];if(f===g)return r;if(Array.isArray(g)||Array.isArray(r))f=f?Array.isArray(f)?r[n]=f.concat():r[n]=[f]:r[n]=[],g&&(Array.isArray(g)||(g=[g]),g.forEach(S=>{f.includes(S)||f.push(S)}));else if(g&&typeof g=="object")if(i){const S=i.path;i.path=c,r[n]=qb(f,g,i),i.path=S}else r[n]=qb(f,g,null);else r.hasOwnProperty(s)&&!t.hasOwnProperty(s)||(r[n]=g);return r},e||{}):e}function U5(e){return Array.isArray(e)?e:e.split(".")}function e$(e){return e.includes(",")?e.split(",").map(t=>t.trim()):[e.trim()]}function q7(e){if(Array.isArray(e)){const t=[];for(const i of e)t.push(...e$(i));return t}return e$(e)}function j5(e,t,i,r){const s=q7(t);if(s.length!==1){const n=s.map(c=>r(e,c,i));return h_(n)}return r(e,s[0],i)}function V5(e,t){const i=e[e.length-1]==="?"?e.slice(0,-1):e;if(t.getItemAt!=null||Array.isArray(t)){const s=parseInt(i,10);if(!isNaN(s))return Array.isArray(t)?t[s]:t.at(s)}const r=To(t);return G7(r,i)?r.get(i):t[i]}function G5(e,t,i){if(e==null)return e;const r=V5(t[i],e);return!r&&i=this._pool.length)){for(let i=t;i0){if(!(s+r{},onTrackingEnd:()=>{}},Eg=[];let d0=Wb;function Rt(e){d0.onObservableAccessed(e)}let jv=!1,Vv=!1;function Bc(e,t,i){if(jv)return tA(e,t,i);H5(e);const r=t.call(i);return W5(),r}function eG(e,t){return Bc(Wb,e,t)}function tA(e,t,i){const r=jv;jv=!0,H5(e);let s=null;try{s=t.call(i)}catch(n){Vv&&_t.getLogger("esri.core.accessorSupport.tracking").error(n)}return W5(),jv=r,s}function H5(e){d0=e,Eg.push(e)}function W5(){const e=Eg.length;if(e>1){const t=Eg.pop();d0=Eg[e-2],t.onTrackingEnd()}else if(e===1){const t=Eg.pop();d0=Wb,t.onTrackingEnd()}else d0=Wb}function Z5(e,t){if(t.flags&Bi.DepTrackingInitialized)return;const i=Vv;Vv=!1,t.flags&Bi.AutoTracked?tA(t,t.metadata.get,e):Y5(e,t),Vv=i}const tG=[];function Y5(e,t){t.flags&Bi.ExplicitlyTracking||(t.flags|=Bi.ExplicitlyTracking,tA(t,()=>{const i=t.metadata.dependsOn||tG;for(const r of i)if(typeof r!="string"||r.includes(".")){const s=U5(r);for(let n=0,c=e;n0)for(const i of t)i.onInvalidated()}onCommitted(){const t=this._observers;if(t&&t.length>0){const i=t.slice();for(const r of i)r.onCommitted()}}},iG=class J5{constructor(){this._values=new Map,this.multipleOriginsSupported=!1}clone(t){const i=new J5;return this._values.forEach((r,s)=>{t&&t.has(s)||i.set(s,He(r))}),i}get(t){return this._values.get(t)}originOf(){return fi.USER}keys(){return[...this._values.keys()]}set(t,i){this._values.set(t,i)}delete(t){this._values.delete(t)}has(t){return this._values.has(t)}forEach(t){this._values.forEach(t)}};function H1(e,t,i){return e!==void 0}function s$(e,t,i,r){return e!==void 0&&(!(i==null&&e.flags&Bi.NonNullable)||(r.lifecycle,Jn.INITIALIZING,!1))}let rG=class{constructor(t){this.host=t,this.propertiesByName=new Map,this.ctorArgs=null,this.lifecycle=Jn.INITIALIZING,this.store=new iG,this._origin=fi.USER;const i=this.host.constructor.__accessorMetadata__;for(const r in i){const s=new r$(r,i[r]);this.propertiesByName.set(r,s)}this.metadata=i}initialize(){this.lifecycle=Jn.CONSTRUCTING}constructed(){this.lifecycle=Jn.CONSTRUCTED}destroy(){this.lifecycle=Jn.DESTROYED,this.propertiesByName.forEach(t=>t.destroy())}get initialized(){return this.lifecycle!==Jn.INITIALIZING}get(t){const i=this.propertiesByName.get(t);if(i.metadata.get)return i.getComputed(this);Rt(i);const r=this.store;return r.has(t)?r.get(t):i.metadata.value}originOf(t){const i=this.store.originOf(t);if(i===void 0){const r=this.propertiesByName.get(t);if(r!==void 0&&r.flags&Bi.HasDefaultValue)return"defaults"}return Hb(i)}has(t){return this.propertiesByName.has(t)&&this.store.has(t)}keys(){return[...this.propertiesByName.keys()]}internalGet(t){const i=this.propertiesByName.get(t);if(H1(i))return this.store.has(t)?this.store.get(t):i.metadata.value}internalSet(t,i){const r=this.propertiesByName.get(t);H1(r)&&this._internalSet(r,i)}getDependsInfo(t,i,r){const s=this.propertiesByName.get(i);if(!H1(s))return"";const n=new Set,c=Bc({onObservableAccessed:f=>n.add(f),onTrackingEnd:()=>{}},()=>{var f;return(f=s.metadata.get)==null?void 0:f.call(t)});let o=`${r}${t.declaredClass.split(".").pop()}.${i}: ${c} `;if(n.size===0)return o;r+=" ";for(const f of n)f instanceof r$&&(o+=`${r}${f.propertyName}: undefined -`);return o}setAtOrigin(t,i,r){const s=this.propertiesByName.get(t);if(H1(s))return this._setAtOrigin(s,i,r)}isOverridden(t){const i=this.propertiesByName.get(t);return i!==void 0&&!!(i.flags&Bi.Overridden)}clearOverride(t){const i=this.propertiesByName.get(t);i&&i.flags&Bi.Overridden&&(i.flags&=~Bi.Overridden,i.notifyChange())}override(t,i){const r=this.propertiesByName.get(t);if(!s$(r,t,i,this))return;const s=r.metadata.cast;if(s){const n=this._cast(s,i),{valid:c,value:o}=n;if(gS.release(n),!c)return;i=o}r.flags|=Bi.Overridden,this._internalSet(r,i)}set(t,i){const r=this.propertiesByName.get(t);if(!s$(r,t,i,this))return;const s=r.metadata.cast;if(s){const c=this._cast(s,i),{valid:o,value:f}=c;if(gS.release(c),!o)return;i=f}const n=r.metadata.set;n?n.call(this.host,i):this._internalSet(r,i)}setDefaultOrigin(t){this._origin=nh(t)}getDefaultOrigin(){return Hb(this._origin)}notifyChange(t){const i=this.propertiesByName.get(t);i!==void 0&&i.notifyChange()}invalidate(t){const i=this.propertiesByName.get(t);i!==void 0&&i.invalidate()}commit(t){const i=this.propertiesByName.get(t);i!==void 0&&i.commit()}_internalSet(t,i){const r=this.lifecycle!==Jn.INITIALIZING?this._origin:fi.DEFAULTS;this._setAtOrigin(t,i,r)}_setAtOrigin(t,i,r){const s=this.store,n=t.propertyName;s.has(n,r)&&QI(i,s.get(n))&&~t.flags&Bi.Overridden&&r===s.originOf(n)||(t.invalidate(),s.set(n,i,r),t.commit(),Z5(this.host,t))}_cast(t,i){const r=gS.acquire();return r.valid=!0,r.value=i,t&&(r.value=t.call(this.host,i,r)),r}},sG=class{constructor(){this.value=null,this.valid=!0}acquire(){this.valid=!0}release(){this.value=null}};const gS=new Pp(sG);function Zb(e,t,i){if(e&&t)if(typeof t=="object")for(const r of Object.getOwnPropertyNames(t))Zb(e,r,t[r]);else{if(t.includes(".")){const s=t.split("."),n=s.splice(-1,1)[0];return void Zb(Va(e,s),n,i)}const r=e.__accessor__;r!=null&&nG(t,r),e[t]=i}}function nG(e,t){if(Le("esri-unknown-property-errors")&&!oG(e,t))throw new Je("set:unknown-property",aG(e,t))}function oG(e,t){return t.metadata[e]!=null}function aG(e,t){return"setting unknown property '"+e+"' on instance of "+t.host.declaredClass}let lG;function cG(){return lG}var n$;(function(e){e[e.Ignore=0]="Ignore",e[e.Destroy=1]="Destroy",e[e.ThrowError=2]="ThrowError"})(n$||(n$={}));function uG(e){e.length=0}let kn=class{constructor(t=50,i=50){this._pool=new Pp(Array,void 0,uG,i,t)}acquire(){return this._pool.acquire()}release(t){this._pool.release(t)}prune(){this._pool.prune(0)}static acquire(){return _S.acquire()}static release(t){return _S.release(t)}static prune(){_S.prune()}};const _S=new kn(100);let K5=class extends Pp{constructor(){super(...arguments),this._set=new Set}destroy(){super.destroy(),this._set=null}acquire(...t){const i=super.acquire(...t);return this._set.delete(i),i}release(t){t&&!this._set.has(t)&&(super.release(t),this._set.add(t))}_dispose(t){this._set.delete(t),super._dispose(t)}};const W1=[];function Yb(e){W1.push(e),W1.length===1&&queueMicrotask(()=>{const t=W1.slice();W1.length=0;for(const i of t)i()})}let X5=class{constructor(t,i=30){this.name=t,this._counter=0,this._samples=new Array(i)}record(t){t!=null&&(this._samples[++this._counter%this._samples.length]=t)}get median(){return this._samples.slice().sort((t,i)=>t-i)[Math.floor(this._samples.length/2)]}get average(){return this._samples.reduce((t,i)=>t+i,0)/this._samples.length}get last(){return this._samples[this._counter%this._samples.length]}};var LT;(function(e){const t=(n,c,o,f)=>{let g=c,S=c;const I=o>>>1,A=n[g-1];for(;S<=I;){S=g<<1,Snc?1:0;function r(n,c,o,f){c===void 0&&(c=0),o===void 0&&(o=n.length),f===void 0&&(f=i);for(let S=o>>>1;S>c;S--)t(n,S,o,f);const g=c+1;for(let S=o-1;S>c;S--){const I=n[c];n[c]=n[S],n[S]=I,t(n,g,S,f)}}function*s(n,c,o,f){c===void 0&&(c=0),o===void 0&&(o=n.length),f===void 0&&(f=i);for(let S=o>>>1;S>c;S--)t(n,S,o,f),yield;const g=c+1;for(let S=o-1;S>c;S--){const I=n[c];n[c]=n[S],n[S]=I,t(n,g,S,f),yield}}e.sort=r,e.iterableSort=s})(LT||(LT={}));const o$=LT,hG=1.5,dG=1.1;let F0=class{constructor(t){this.data=[],this._length=0,this._allocator=void 0,this._deallocator=()=>null,this._shrink=()=>{},this._hint=new _5,t&&(t.initialSize&&(this.data=new Array(t.initialSize)),t.allocator&&(this._allocator=t.allocator),t.deallocator!==void 0&&(this._deallocator=t.deallocator),t.shrink&&(this._shrink=()=>a$(this)))}toArray(){return this.data.slice(0,this.length)}filter(t){const i=new Array;for(let r=0;r=this._length))return this.data[t]}includes(t,i){const r=this.data.indexOf(t,i);return r!==-1&&rthis._length){if(this._allocator){for(;this._length=this.length||t<0))return this.swapElements(t,this.length-1),this.pop()}removeUnorderedMany(t,i=t.length,r){this.length=x7(this.data,t,this.length,i,this._hint,r),this._shrink()}front(){if(this.length!==0)return this.data[0]}back(){if(this.length!==0)return this.data[this.length-1]}swapElements(t,i){if(t>=this.length||i>=this.length||t===i)return;const r=this.data[t];this.data[t]=this.data[i],this.data[i]=r}sort(t){o$.sort(this.data,0,this.length,t)}iterableSort(t){return o$.iterableSort(this.data,0,this.length,t)}some(t,i){for(let r=0;rhG*e.length&&(e.data.length=Math.floor(e.length*dG))}function pG(e){return{setTimeout:(t,i)=>{const r=e.setTimeout(t,i);return er(()=>e.clearTimeout(r))}}}const Vm=pG(globalThis);function cx(e){return fG(e)||Q5(e)}function fG(e){return e!=null&&typeof e=="object"&&"on"in e&&typeof e.on=="function"}function Q5(e){return e!=null&&typeof e=="object"&&"addEventListener"in e&&typeof e.addEventListener=="function"}function f_(e,t,i){if(!cx(e))throw new TypeError("target is not a Evented or EventTarget object");return Q5(e)?mG(e,t,i):e.on(t,i)}function mG(e,t,i,r){if(Array.isArray(t)){const s=t.slice();for(const n of s)e.addEventListener(n,i,r);return er(()=>{for(const n of s)e.removeEventListener(n,i,r)})}return e.addEventListener(t,i,r),er(()=>e.removeEventListener(t,i,r))}function e4(e,t,i){if(!cx(e))throw new TypeError("target is not a Evented or EventTarget object");if("once"in e)return e.once(t,i);const r=f_(e,t,s=>{r.remove(),i.call(e,s)});return r}function jr(e="Aborted"){return new Je("AbortError",e)}function mr(e,t="Aborted"){if(ra(e))throw jr(t)}function ux(e){return e instanceof AbortSignal?e:e==null?void 0:e.signal}function ra(e){const t=ux(e);return t!=null&&t.aborted}function Na(e){if(Ys(e))throw e}function l$(e){if(!Ys(e))throw e}function io(e,t){const i=ux(e);if(i!=null){if(!i.aborted)return e4(i,"abort",()=>t());t()}}function iA(e,t){const i=ux(e);if(i!=null)return mr(i),e4(i,"abort",()=>t(jr()))}function yG(e,t){return ux(t)==null?e:new Promise((i,r)=>{let s=io(t,()=>r(jr()));const n=()=>{s=Sr(s)};e.then(n,n),e.then(i,r)})}function Ys(e){return(e==null?void 0:e.name)==="AbortError"}async function c$(e){try{return await e}catch(t){if(!Ys(t))throw t;return}}async function rA(e){if(!e)return;if(typeof e.forEach!="function"){const i=Object.keys(e),r=i.map(c=>e[c]),s=await rA(r),n={};return i.map((c,o)=>n[c]=s[o]),n}const t=e;return Promise.allSettled(t).then(i=>Array.from(t,(r,s)=>{const n=i[s];return n.status==="fulfilled"?{promise:r,value:n.value}:{promise:r,error:n.reason}}))}async function gG(e){return(await Promise.allSettled(e)).filter(t=>t.status==="fulfilled").map(t=>t.value)}async function sye(e){return(await Promise.allSettled(e)).filter(t=>t.status==="rejected").map(t=>t.reason)}function t4(e,t=void 0,i){const r=new AbortController;return io(i,()=>r.abort()),new Promise((s,n)=>{let c=setTimeout(()=>{c=0,s(t)},e);io(r,()=>{c&&(clearTimeout(c),n(jr()))})})}function _G(e,t){const i=new AbortController,r=setTimeout(()=>i.abort(),t);return io(e,()=>{i.abort(),clearTimeout(r)}),{...e,signal:i.signal}}function xh(e){return e&&typeof e.then=="function"}function u$(e){return xh(e)?e:Promise.resolve(e)}function vG(e,t=-1){let i,r,s,n,c=null;const o=(...f)=>{if(i){r=f,n&&n.reject(jr()),n=sa();const A=n.promise;if(c){const O=c;c=null,O.abort()}return A}if(s=n||sa(),n=null,t>0){const A=new AbortController;i=u$(e(...f,A.signal));const O=i;t4(t).then(()=>{i===O&&(n?A.abort():c=A)})}else i=1,i=u$(e(...f));const g=()=>{const A=r;r=s=i=c=null,A!=null&&o(...A)},S=i,I=s;return S.then(g,g),S.then(I.resolve,I.reject),I.promise};return o}function sa(){let e,t;const i=new Promise((s,n)=>{e=s,t=n}),r=s=>{e(s)};return r.resolve=s=>e(s),r.reject=s=>t(s),r.timeout=(s,n)=>Vm.setTimeout(()=>r.reject(n),s),r.promise=i,r}async function Jb(e){await Promise.resolve(),mr(e)}function nye(e){return e}function oye(e){return 1e3*e}function aye(e){return e}let bG=class{constructor(t){this.phases=t,this.paused=!1,this.ticks=-1,this.removed=!1}},wG=class{constructor(t){this.callback=t,this.isActive=!0}remove(){this.isActive=!1}},DT=0;const ag={time:0,deltaTime:0,elapsedFrameTime:0,frameDuration:0},NT=["prepare","preRender","render","postRender","update","finish"],zT=[],dp=new F0;let xG=class{constructor(t){this._task=t}remove(){this._task.removed=!0}pause(){this._task.paused=!0}resume(){this._task.paused=!1}};function SG(){np!=null&&(cancelAnimationFrame(np),np=requestAnimationFrame(sA))}const Kb={frameTasks:dp,willDispatch:!1,clearFrameTasks:TG,dispatch:r4,executeFrameTasks:EG,reschedule:SG};function m_(e){const t=new wG(e);return zT.push(t),Kb.willDispatch||(Kb.willDispatch=!0,Yb(r4)),t}function Mm(e){const t=new bG(e);return dp.push(t),np==null&&(DT=performance.now(),np=requestAnimationFrame(sA)),new xG(t)}let np=null;function TG(e=!1){dp.forAll(t=>{t.removed=!0}),e&&i4()}function sA(){const e=performance.now();np=null,np=dp.length>0?requestAnimationFrame(sA):null,Kb.executeFrameTasks(e)}function EG(e){const t=e-DT;DT=e;const i=1e3/60,r=Math.max(0,t-i);ag.time=e,ag.frameDuration=i-r;for(let s=0;s{var f;o.paused||o.removed||(s===0&&o.ticks++,o.phases[c]&&(ag.elapsedFrameTime=performance.now()-e,ag.deltaTime=o.ticks===0?0:t,(f=o.phases[c])==null||f.call(o,ag)))}),IG[s].record(performance.now()-n)}i4(),AG.record(performance.now()-e)}const Z1=new F0;function i4(){dp.forAll(e=>{e.removed&&Z1.push(e)}),dp.removeUnorderedMany(Z1.data,Z1.length),Z1.clear()}function r4(){for(;zT.length;){const e=zT.shift();e.isActive&&e.callback()}Kb.willDispatch=!1}function MG(e=1,t){const i=sa(),r=()=>{ra(t)?i.reject(jr()):e===0?i():(--e,Yb(()=>r()))};return r(),i.promise}const IG=NT.map(e=>new X5(e)),AG=new X5("total");function PG(e,t){for(const i of e.entries())if(t(i[0]))return!0;return!1}function h$(e,t){if(!t)return e;for(const i of t)e.add(i);return e}function s4(e,t){const i=new Set;return h$(i,e),h$(i,t),i}function CG(e,t){const i=new Set;for(const r of t)e.has(r)&&i.add(r);return i}function hye(e,t){if(!e||!t)return!1;if(e===t)return!0;for(const i of e)if(!t.has(i))return!1;return!0}function dye(e,t){if(e==null&&t==null)return!0;if(e==null||t==null||e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}function $G(e,t){const i=new Set(e);for(const r of t)i.delete(r);return i}function kG(e,t){return $G(s4(e,t),CG(e,t))}let RG=0;function p0(){return++RG}let hx=class{constructor(t){this._accessed=[],this._handles=[],this._observerObject=new OG(t),d$.register(this,new WeakRef(this._observerObject),this)}destroy(){var t;d$.unregister(this._observerObject),this._accessed.length=0,(t=this._observerObject)==null||t.destroy(),this.clear()}onObservableAccessed(t){const i=this._accessed;i.includes(t)||i.push(t)}onTrackingEnd(){const t=this._handles,i=this._accessed,r=this._observerObject;for(let s=0;s0?t-1:0}destroy(){this.destroyed=!0,this._notify=LG}};const d$=new FinalizationRegistry(e=>{var t;(t=e.deref())==null||t.destroy()});function LG(){}let dm=!1;const Xb=[];function n4(e,t){let i=new hx(n),r=null,s=!1;function n(){if(!i||s)return;if(dm)return void a4(n);const o=r;i.clear(),dm=!0,s=!0,r=Bc(i,e),s=!1,dm=!1,t(r,o),l4()}function c(){i&&(i.destroy(),i=null,r=null)}return s=!0,r=Bc(i,e),s=!1,er(c)}function o4(e,t){let i=new hx(s),r=null;function s(){t(r,c)}function n(){i&&(i.destroy(),i=null),r=null}function c(){return i?(i.clear(),r=Bc(i,e),r):null}return c(),er(n)}function DG(e){let t=new hx(r),i=!1;function r(){t&&!i&&(dm?a4(r):(t.clear(),dm=!0,i=!0,Bc(t,e),i=!1,dm=!1,l4()))}function s(){t&&(t.destroy(),t=null)}return i=!0,Bc(t,e),i=!1,er(s)}function a4(e){Xb.includes(e)||Xb.unshift(e)}function l4(){for(;Xb.length;)Xb.pop()()}var f0;(function(e){e[e.Untracked=0]="Untracked",e[e.Tracked=1]="Tracked"})(f0||(f0={}));let B0=class{constructor(){this.uid=p0(),this.removed=!1,this.type=null,this.oldValue=null,this.callback=null,this.getValue=null,this.target=null,this.path=null,this.equals=null}static acquireUntracked(t,i,r,s,n){return this.pool.acquire(f0.Untracked,t,i,r,s,n,QI)}static acquireTracked(t,i,r,s){return this.pool.acquire(f0.Tracked,t,i,r,null,null,s)}notify(t,i){this.type===f0.Untracked?this.callback.call(this.target,t,i,this.path,this.target):this.callback.call(null,t,i,void 0,void 0)}acquire(t,i,r,s,n,c,o){this.uid=p0(),this.removed=!1,this.type=t,this.oldValue=i,this.callback=r,this.getValue=s,this.target=n,this.path=c,this.equals=o}release(){this.target=this.path=this.oldValue=this.callback=this.getValue=null,this.uid=p0(),this.removed=!0}};B0.pool=new K5(B0);const Gv=new kn,Dc=new Set;let Qb;function ew(e){Dc.delete(e),Dc.add(e),Qb||(Qb=m_(FG))}function NG(e){if(e.removed)return;const t=e.oldValue,i=e.getValue();e.equals(t,i)||(e.oldValue=i,e.notify(i,t))}function zG(e){for(const t of Dc.values())t.target===e&&(t.removed=!0)}function FG(){let e=10;for(;Qb&&e--;){Qb=null;const t=BG(),i=Gv.acquire();for(const r of t){const s=r.uid;NG(r),s===r.uid&&r.removed&&i.push(r)}for(const r of Dc)r.removed&&(i.push(r),Dc.delete(r));for(const r of i)B0.pool.release(r);Gv.release(i),Gv.release(t),FT.forEach(r=>r())}}function BG(){const e=Gv.acquire();e.length=Dc.size;let t=0;for(const i of Dc)e[t]=i,++t;return Dc.clear(),e}const FT=new Set;function UG(e){return FT.add(e),er(()=>FT.delete(e))}function jG(e,t,i){let r=j5(e,t,i,(s,n,c)=>{let o,f,g=o4(()=>d_(s,n),(S,I)=>{var A;((A=s.__accessor__)==null?void 0:A.lifecycle)===Jn.DESTROYED||o&&o.uid!==f?r.remove():(o||(o=B0.acquireUntracked(S,c,I,s,n),f=o.uid),ew(o))});return er(()=>{g.remove(),o&&(o.uid!==f||o.removed||(o.removed=!0,ew(o)),o=null),r=g=null})});return r}function VG(e,t,i){const r=j5(e,t,i,(s,n,c)=>{let o=!1;return n4(()=>d_(s,n),(f,g)=>{s.__accessor__.lifecycle!==Jn.DESTROYED?o||(o=!0,QI(g,f)||c.call(s,f,g,n,s),o=!1):r.remove()})});return r}function GG(e,t,i,r=!1){return e.__accessor__&&e.__accessor__.lifecycle!==Jn.DESTROYED?r?VG(e,t,i):jG(e,t,i):er()}function qG(e,t,i){let r,s,n=o4(e,(c,o)=>{r&&r.uid!==s?n.remove():(r||(r=B0.acquireTracked(c,t,o,i),s=r.uid),ew(r))});return er(()=>{n.remove(),r&&(r.uid!==s||r.removed||(r.removed=!0,ew(r)),r=null),n=null})}function HG(e,t,i){let r=!1;return n4(e,(s,n)=>{r||(r=!0,i(n,s)||t(s,n),r=!1)})}function WG(e,t,i=!1,r=$5){return i?HG(e,t,r):qG(e,t,r)}function p$(e){return PG(Dc,t=>t.oldValue===e)}function dx(e,t){for(const[i,r]of e)if(t(r,i))return!0;return!1}function nA(e,t,i){const r=e.get(t);if(r!==void 0)return r;const s=i();return e.set(t,s),s}function yye(e){const t=new Map;return i=>(t.has(i)||t.set(i,e(i)),t.get(i))}const pm=()=>_t.getLogger("esri.core.accessorSupport.ensureTypes");function ZG(e){return e==null?e:new Date(e)}function YG(e){return e==null?e:!!e}function JG(e){return e==null?e:e.toString()}function za(e){return e==null?e:(e=parseFloat(e),isNaN(e)?0:e)}function oA(e){return e==null?e:Math.round(parseFloat(e))}function c4(e){return(e==null?void 0:e.constructor)&&e.constructor.__accessorMetadata__!==void 0}function tw(e,t){return t!=null&&e&&!(t instanceof e)}function u4(e){return e&&"isCollection"in e}function f$(e){return e!=null&&e.Type?typeof e.Type=="function"?e.Type:e.Type.base:null}function KG(e,t){if(!(t!=null&&t.constructor)||!u4(t.constructor))return BT(e,t)?t:new e(t);const i=f$(e.prototype.itemType),r=f$(t.constructor.prototype.itemType);return i?r?i===r?t:i.prototype.isPrototypeOf(r.prototype)?new e(t):(BT(e,t),t):new e(t):t}function BT(e,t){return!!c4(t)&&(pm().error("Accessor#set","Assigning an instance of '"+(t.declaredClass||"unknown")+"' which is not a subclass of '"+fx(e)+"'"),!0)}function px(e,t){return t==null?t:u4(e)?KG(e,t):tw(e,t)?BT(e,t)?t:new e(t):t}function fx(e){var t;return((t=e==null?void 0:e.prototype)==null?void 0:t.declaredClass)||"unknown"}const XG=new WeakMap;function QG(e){switch(e){case Number:return za;case $r:return oA;case Boolean:return YG;case String:return JG;case Date:return ZG;default:return nA(XG,e,()=>px.bind(null,e))}}function Fn(e,t){const i=QG(e);return arguments.length===1?i:i(t)}function U0(e,t,i){return arguments.length===1?U0.bind(null,e):t&&(Array.isArray(t)?t.map(r=>e(r,i)):[e(t,i)])}function eq(e,t){return arguments.length===1?U0(i=>Fn(e,i)):U0(i=>Fn(e,i),t)}function h4(e,t,i){return t!==0&&Array.isArray(i)?i.map(r=>h4(e,t-1,r)):e(i)}function iw(e,t,i){if(arguments.length===2)return n=>iw(e,t,n);if(!i)return i;i=h4(e,t,i);let r=t,s=i;for(;r>0&&Array.isArray(s);)r--,s=s[0];if(s!==void 0)for(let n=0;nFn(e,r),t):iw(r=>Fn(e,r),t,i)}function d4(e){return!!Array.isArray(e)&&!e.some(t=>{const i=typeof t;return!(i==="string"||i==="number"||i==="function"&&e.length>1)})}function UT(e,t){if(arguments.length===2)return UT(e).call(null,t);const i=new Set,r=e.filter(o=>typeof o!="function"),s=e.filter(o=>typeof o=="function");for(const o of e)typeof o!="string"&&typeof o!="number"||i.add(o);let n=null,c=null;return(o,f)=>{if(o==null)return o;const g=typeof o,S=g==="string"||g==="number";return S&&(i.has(o)||s.some(I=>g==="string"&&I===String||g==="number"&&I===Number))||g==="object"&&s.some(I=>!tw(o,I))?o:(S&&r.length?(n||(n=r.map(I=>typeof I=="string"?`'${I}'`:`${I}`).join(", ")),pm().error("Accessor#set",`'${o}' is not a valid value for this property, only the following values are valid: ${n}`)):typeof o=="object"&&s.length?(c||(c=s.map(I=>fx(I)).join(", ")),pm().error("Accessor#set",`'${o}' is not a valid value for this property, value must be one of ${c}`)):pm().error("Accessor#set",`'${o}' is not a valid value for this property`),f&&(f.valid=!1),null)}}function Uc(e,t){if(arguments.length===2)return Uc(e).call(null,t);const i={},r=[],s=[];for(const f in e.typeMap){const g=e.typeMap[f];i[f]=Fn(g),r.push(fx(g)),s.push(f)}const n=()=>`'${r.join("', '")}'`,c=()=>`'${s.join("', '")}'`,o=typeof e.key=="string"?f=>f[e.key]:e.key;return f=>{if(e.base&&!tw(e.base,f)||f==null)return f;const g=o(f)||e.defaultKeyValue,S=i[g];if(!S)return pm().error("Accessor#set",`Invalid property value, value needs to be one of ${n()}, or a plain object that can autocast (having .type = ${c()})`),null;if(!tw(e.typeMap[g],f))return f;if(typeof e.key=="string"&&!c4(f)){const I={};for(const A in f)A!==e.key&&(I[A]=f[A]);return S(I)}return S(f)}}let $r=class{};const _ye={native:e=>({type:"native",value:e}),array:e=>({type:"array",value:e}),oneOf:e=>({type:"one-of",values:e})};function iq(e){if(!e||!("type"in e))return!1;switch(e.type){case"native":case"array":case"one-of":return!0}return!1}function p4(e){switch(e.type){case"native":return Fn(e.value);case"array":return U0(p4(e.value));case"one-of":return rq(e);default:return null}}function rq(e){let t=null;return(i,r)=>VT(i,e)?i:(t==null&&(t=jT(e)),pm().error("Accessor#set",`Invalid property value, value needs to be of type ${t}`),r&&(r.valid=!1),null)}function jT(e){switch(e.type){case"native":switch(e.value){case Number:return"number";case String:return"string";case Boolean:return"boolean";case $r:return"integer";case Date:return"date";default:return fx(e.value)}case"array":return`array of ${jT(e.value)}`;case"one-of":{const t=e.values.map(i=>jT(i));return`one of ${t.slice(0,-1)} or ${t[t.length-1]}`}}return"unknown"}function VT(e,t){if(e==null)return!0;switch(t.type){case"native":switch(t.value){case Number:case $r:return typeof e=="number";case Boolean:return typeof e=="boolean";case String:return typeof e=="string"}return e instanceof t.value;case"array":return!!Array.isArray(e)&&!e.some(i=>!VT(i,t.value));case"one-of":return t.values.some(i=>VT(e,i))}}function M(e={}){return(t,i)=>{if(t===Function.prototype)throw new Error(`Inappropriate use of @property() on a static field: ${t.name}.${i}. Accessor does not support static properties.`);const r=Object.getOwnPropertyDescriptor(t,i),s=lx(t,i);r&&(r.get||r.set?(s.get=r.get||s.get,s.set=r.set||s.set):"value"in r&&("value"in e&&_t.getLogger("esri.core.accessorSupport.decorators.property").warn(`@property() will redefine the value of "${i}" on "${t.constructor.name}" already defined in the metadata`,e),s.value=e.value=r.value)),e.readOnly!=null&&(s.readOnly=e.readOnly);const n=e.aliasOf;if(n){const f=typeof n=="string"?n:n.source,g=typeof n=="string"?null:n.overridable===!0;let S;s.dependsOn=[f],s.get=function(){let I=Va(this,f);if(typeof I=="function"){S||(S=f.split(".").slice(0,-1).join("."));const A=Va(this,S);A&&(I=I.bind(A))}return I},s.readOnly||(s.set=g?function(I){this._override(i,I)}:function(I){Zb(this,f,I)})}const c=e.type,o=e.types;s.cast||(c?s.cast=sq(c):o&&(Array.isArray(o)?s.cast=U0(Uc(o[0])):s.cast=Uc(o))),H7(s,e),e.range&&(s.cast=nq(s.cast,e.range))}}function f4(e,t,i){const r=lx(e,i);r.json||(r.json={});let s=r.json;return t!==void 0&&(s.origins||(s.origins={}),s.origins[t]||(s.origins[t]={}),s=s.origins[t]),s}function sq(e){let t=0,i=e;if(iq(e))return p4(e);for(;Array.isArray(i)&&i.length===1&&typeof i[0]!="string"&&typeof i[0]!="number";)i=i[0],t++;const r=i;if(d4(r))return t===0?UT(r):iw(UT(r),t);if(t===1)return eq(r);if(t>1)return tq(r,t);const s=e;return s.from?s.from:Fn(s)}function nq(e,t){return i=>{let r=+e(i);return t.step!=null&&(r=Math.round(r/t.step)*t.step),t.min!=null&&(r=Math.max(t.min,r)),t.max!=null&&(r=Math.min(t.max,r)),r}}function oq(e){if(e.json&&e.json.origins){const t=e.json.origins,i={"web-document":["web-scene","web-map"]};for(const r in i)if(t[r]){const s=t[r];i[r].forEach(n=>{t[n]=s}),delete t[r]}}}let jc=class extends D5{constructor(t,i,r){super(t,i,r)}};jc.prototype.type="warning";function m4(e){var t;return!!e&&((t=e.prototype)==null?void 0:t.declaredClass)&&e.prototype.declaredClass.indexOf("esri.core.Collection")===0}const GT=()=>_t.getLogger("esri.core.accessorSupport.extensions.serializableProperty.reader");function m$(e,t,i){var r,s;e&&(!i&&!t.read||(r=t.read)!=null&&r.reader||((s=t.read)==null?void 0:s.enabled)===!1||cq(e)&&Ap("read.reader",aA(e),t))}function aA(e){var i,r;const t=e.ndimArray??0;if(t>1)return lq(e);if(t===1)return y$(e);if("type"in e&&g4(e.type)){const s=(r=(i=e.type.prototype)==null?void 0:i.itemType)==null?void 0:r.Type,n=y$(typeof s=="function"?{type:s}:{types:s});return(c,o,f)=>{const g=n(c,o,f);return g&&new e.type(g)}}return lA(e)}function lA(e){return"type"in e?aq(e.type):uq(e.types)}function aq(e){return e.prototype.read?(t,i,r)=>{if(t==null)return t;const s=typeof t;if(s!=="object")return void GT().error(`Expected JSON value of type 'object' to deserialize type '${e.prototype.declaredClass}', but got '${s}'`);const n=new e;return n.read(t,r),n}:e.fromJSON}function y4(e,t,i,r){return r!==0&&Array.isArray(t)?t.map(s=>y4(e,s,i,r-1)):e(t,void 0,i)}function lq(e){const t=lA(e),i=y4.bind(null,t),r=e.ndimArray??0;return(s,n,c)=>{if(s==null)return s;s=i(s,c,r);let o=r,f=s;for(;o>0&&Array.isArray(f);)o--,f=f[0];if(f!==void 0)for(let g=0;g{if(i==null)return i;if(Array.isArray(i)){const c=[];for(const o of i){const f=t(o,void 0,s);f!==void 0&&c.push(f)}return c}const n=t(i,void 0,s);return n!==void 0?[n]:void 0}}function g4(e){if(!m4(e))return!1;const t=e.prototype.itemType;return!(!t||!t.Type)&&(typeof t.Type=="function"?cA(t.Type):_4(t.Type))}function cq(e){return"types"in e?_4(e.types):cA(e.type)}function cA(e){return!Array.isArray(e)&&!!e&&e.prototype&&("read"in e.prototype||"fromJSON"in e||g4(e))}function _4(e){for(const t in e.typeMap)if(!cA(e.typeMap[t]))return!1;return!0}function uq(e){let t=null;const i=e.errorContext??"type",r=e.validate;return(s,n,c)=>{if(s==null)return s;const o=typeof s;if(o!=="object")return void GT().error(`Expected JSON value of type 'object' to deserialize, but got '${o}'`);t||(t=hq(e));const f=e.key;if(typeof f!="string")return;const g=s[f],S=g?t[g]:e.defaultKeyValue?e.typeMap[e.defaultKeyValue]:void 0;if(!S){const A=`Type '${g||"unknown"}' is not supported`;return c!=null&&c.messages&&s&&c.messages.push(new jc(`${i}:unsupported`,A,{definition:s,context:c})),void GT().error(A)}const I=new S;return I.read(s,c),r?r(I):I}}function hq(e){var i,r;const t={};for(const s in e.typeMap){const n=e.typeMap[s],c=p_(n.prototype);if(typeof e.key=="function")continue;const o=c[e.key];if(!o)continue;(i=o.json)!=null&&i.type&&Array.isArray(o.json.type)&&o.json.type.length===1&&typeof o.json.type[0]=="string"&&(t[o.json.type[0]]=n);const f=(r=o.json)==null?void 0:r.write;if(!(f!=null&&f.writer)){t[s]=n;continue}const g=f.target,S=typeof g=="string"?g:e.key,I={};f.writer(s,I,S),I[S]&&(t[I[S]]=n)}return t}function dq(e){if(e.json||(e.json={}),_$(e.json),v$(e.json),g$(e.json),e.json.origins)for(const t in e.json.origins)_$(e.json.origins[t]),v$(e.json.origins[t]),g$(e.json.origins[t]);return!0}function g$(e){e.name&&(e.read&&typeof e.read=="object"?e.read.source===void 0&&(e.read.source=e.name):e.read={source:e.name},e.write&&typeof e.write=="object"?e.write.target===void 0&&(e.write.target=e.name):e.write={target:e.name})}function _$(e){typeof e.read=="boolean"?e.read={enabled:e.read}:typeof e.read=="function"?e.read={enabled:!0,reader:e.read}:e.read&&typeof e.read=="object"&&e.read.enabled===void 0&&(e.read.enabled=!0)}function v$(e){typeof e.write=="boolean"?e.write={enabled:e.write}:typeof e.write=="function"?e.write={enabled:!0,writer:e.write}:e.write&&typeof e.write=="object"&&e.write.enabled===void 0&&(e.write.enabled=!0)}function b$(e,t){if(!t.write||t.write.writer||t.write.enabled===!1&&!t.write.overridePolicy)return;const i=(e==null?void 0:e.ndimArray)??0;e&&(i===1||"type"in e&&m4(e.type))?t.write.writer=mq:i>1?t.write.writer=yq(i):t.types?Array.isArray(t.types)?t.write.writer=fq(t.types[0]):t.write.writer=pq(t.types):t.write.writer=j0}function pq(e){return(t,i,r,s)=>t?v4(t,e,s)?j0(t,i,r,s):void 0:j0(t,i,r,s)}function v4(e,t,i){for(const r in t.typeMap)if(e instanceof t.typeMap[r])return!0;if(i!=null&&i.messages){const r=t.errorContext??"type",s=`Values of type '${(typeof t.key!="function"?e[t.key]:e.declaredClass)??"Unknown"}' cannot be written`;i&&i.messages&&e&&i.messages.push(new Je(`${r}:unsupported`,s,{definition:e,context:i})),_t.getLogger("esri.core.accessorSupport.extensions.serializableProperty.writer").error(s)}return!1}function fq(e){return(t,i,r,s)=>!t||!Array.isArray(t)?j0(t,i,r,s):j0(t.filter(n=>v4(n,e,s)),i,r,s)}function j0(e,t,i,r){Ap(i,rw(e,r),t)}function rw(e,t){return e&&typeof e.write=="function"?e.write({},t):e&&typeof e.toJSON=="function"?e.toJSON():typeof e=="number"?sw(e):e}function sw(e){return e===-1/0?-Number.MAX_VALUE:e===1/0?Number.MAX_VALUE:isNaN(e)?null:e}function mq(e,t,i,r){let s;e===null?s=null:e&&typeof e.map=="function"?(s=e.map(n=>rw(n,r)),typeof s.toArray=="function"&&(s=s.toArray())):s=[rw(e,r)],Ap(i,s,t)}function b4(e,t,i){return i!==0&&Array.isArray(e)?e.map(r=>b4(r,t,i-1)):rw(e,t)}function yq(e){return(t,i,r,s)=>{let n;if(t===null)n=null;else{n=b4(t,s,e);let c=e,o=n;for(;c>0&&Array.isArray(o);)c--,o=o[0];if(o!==void 0)for(let f=0;f{e??(e="esri.core.Accessor"),t.prototype.declaredClass=e,Sq(t);const i=[],r=[];let s=t.prototype;for(;s;)s.hasOwnProperty("initialize")&&!vS.has(s.initialize)&&(vS.add(s.initialize),i.push(s.initialize)),s.hasOwnProperty("destroy")&&!bS.has(s.destroy)&&(bS.add(s.destroy),r.push(s.destroy)),s=Object.getPrototypeOf(s);vS.clear(),bS.clear();const n=class extends t{constructor(...o){if(super(...o),this.constructor===n&&typeof this.postscript=="function"){if(i.length&&Object.defineProperty(this,"initialize",{enumerable:!1,configurable:!0,value(){for(let f=i.length-1;f>=0;f--)i[f].call(this)}}),r.length){let f=!1;const g=this[B5];Object.defineProperty(this,"destroy",{enumerable:!1,configurable:!0,value(){if(!f){f=!0,g.call(this);for(let S=0;S0&&this.normalizeCtorArgs&&(i.ctorArgs=this.normalizeCtorArgs.apply(this,t))}postscript(t){const i=this.__accessor__,r=i.ctorArgs||t;i.initialize(),r&&(this.set(r),i.ctorArgs=null),i.constructed(),this.initialize(),this[WT]=!0}initialize(){}[B5](){this[Eu]=lr(this[Eu])}destroy(){var t;this.destroyed||(zG(this),this.__accessor__.destroy(),(t=cG())==null||t.onInstanceDestroy(this))}[Symbol.dispose](){this.destroy()}get constructed(){return this.__accessor__&&this.__accessor__.initialized||!1}get initialized(){return this[WT]}get destroyed(){var t;return((t=this.__accessor__)==null?void 0:t.lifecycle)===Jn.DESTROYED||!1}commitProperty(t){Va(this,t)}get(t){return z5(_t.getLogger(this),"`Accessor.get` is deprecated in favor of using optional chaining",{version:"4.28",see:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining"}),Va(this,t)}hasOwnProperty(t){return this.__accessor__?this.__accessor__.has(t):Object.prototype.hasOwnProperty.call(this,t)}keys(){return this.__accessor__?this.__accessor__.keys():[]}set(t,i){return Zb(this,t,i),this}watch(t,i,r){return GG(this,t,i,r)}addHandles(t,i){if(this.destroyed){const s=Array.isArray(t)?t:[t];for(const n of s)n.remove();return}let r=this[Eu];r==null&&(r=this[Eu]=new eA),r.add(t,i)}removeHandles(t){const i=this[Eu];i!=null&&i.remove(t)}removeAllHandles(){const t=this[Eu];t!=null&&t.removeAll()}hasHandles(t){const i=this[Eu];return i!=null&&i.has(t)}_override(t,i){i===void 0?this.__accessor__.clearOverride(t):this.__accessor__.override(t,i)}_clearOverride(t){return this.__accessor__.clearOverride(t)}_overrideIfSome(t,i){i==null?this.__accessor__.clearOverride(t):this.__accessor__.override(t,i)}_isOverridden(t){return this.__accessor__.isOverridden(t)}notifyChange(t){this.__accessor__.notifyChange(t)}_get(t){return this.__accessor__.internalGet(t)}_set(t,i){return this.__accessor__.internalSet(t,i),this}};S4=Eu,T4=WT;let Eq=class M4{constructor(){this._values=new Map,this.multipleOriginsSupported=!1}clone(t){const i=new M4;return this._values.forEach((r,s)=>{t&&t.has(s)||i.set(s,He(r.value),r.origin)}),i}get(t,i){i=this._normalizeOrigin(i);const r=this._values.get(t);return i==null||(r==null?void 0:r.origin)===i?r==null?void 0:r.value:void 0}originOf(t){var i;return((i=this._values.get(t))==null?void 0:i.origin)??fi.USER}keys(t){t=this._normalizeOrigin(t);const i=[...this._values.keys()];return t==null?i:i.filter(r=>{var s;return((s=this._values.get(r))==null?void 0:s.origin)===t})}set(t,i,r){if((r=this._normalizeOrigin(r))===fi.DEFAULTS){const s=this._values.get(t);if((s==null?void 0:s.origin)!=null&&s.origin>r)return}this._values.set(t,new Mq(i,r))}delete(t,i){var r;(i=this._normalizeOrigin(i))!=null&&((r=this._values.get(t))==null?void 0:r.origin)!==i||this._values.delete(t)}has(t,i){var r;return(i=this._normalizeOrigin(i))!=null?((r=this._values.get(t))==null?void 0:r.origin)===i:this._values.has(t)}forEach(t){this._values.forEach(({value:i},r)=>t(i,r))}_normalizeOrigin(t){if(t!=null)return t===fi.DEFAULTS?t:fi.USER}},Mq=class{constructor(t,i){this.value=t,this.origin=i}};function I4(e,t,i){t.keys().forEach(s=>{i.set(s,t.get(s),fi.DEFAULTS)});const r=e.metadata;Object.keys(r).forEach(s=>{e.internalGet(s)&&i.set(s,e.internalGet(s),fi.DEFAULTS)})}function Iq(e,t,i){if(!(e!=null&&e.read)||e.read.enabled===!1||!e.read.source)return!1;const r=e.read.source;if(typeof r=="string"){if(r===t||r.includes(".")&&r.indexOf(t)===0&&t$(r,i))return!0}else for(const s of r)if(s===t||s.includes(".")&&s.indexOf(t)===0&&t$(s,i))return!0;return!1}function Aq(e){return e&&(!e.read||e.read.enabled!==!1&&!e.read.source)}function Pq(e,t,i,r,s){let n=qT(t[i],s);Aq(n)&&(e[i]=!0);for(const c of Object.getOwnPropertyNames(t))n=qT(t[c],s),Iq(n,i,r)&&(e[c]=!0)}function Cq(e,t,i,r){const s=i.metadata,n=gq(s[t],r),c=n==null?void 0:n.default;if(c===void 0)return;const o=typeof c=="function"?c.call(e,t,r):c;o!==void 0&&i.set(t,o)}const A4={origin:"service"};function P4(e,t,i=A4){if(!t||typeof t!="object")return;const r=To(e),s=r.metadata,n={};for(const c of Object.getOwnPropertyNames(t))Pq(n,s,c,t,i);r.setDefaultOrigin(i.origin);for(const c of Object.getOwnPropertyNames(n)){const o=qT(s[c],i).read,f=o==null?void 0:o.source;let g;g=f&&typeof f=="string"?d_(t,f):t[c],o!=null&&o.reader&&(g=o.reader.call(e,g,t,i)),g!==void 0&&r.set(c,g)}if(!i||!i.ignoreDefaults){r.setDefaultOrigin("defaults");for(const c of Object.getOwnPropertyNames(s))n[c]||Cq(e,c,r,i)}r.setDefaultOrigin("user")}function $q(e,t,i,r=A4){var n;const s={...r,messages:[]};i(s),(n=s.messages)==null||n.forEach(c=>{c.type!=="warning"||e.loaded?r!=null&&r.messages&&r.messages.push(c):e.loadWarnings.push(c)})}function kq(e,t,i,r,s){var c,o;const n={};return(o=(c=t.write)==null?void 0:c.writer)==null||o.call(e,r,n,i,s),n}function C4(e,t,i,r,s,n){if(!(r!=null&&r.write))return!1;const c=Va(e,i);if(!s&&r.write.overridePolicy){const o=r.write.overridePolicy.call(e,c,i,n??void 0);o!==void 0&&(s=o)}if(s||(s=r.write),!s||s.enabled===!1||s.layerContainerTypes&&(n!=null&&n.layerContainerType)&&!s.layerContainerTypes.includes(n.layerContainerType))return!1;if((c===null&&!s.allowNull&&!s.writerEnsuresNonNull||c===void 0)&&s.isRequired){const o=new Je("web-document-write:property-required",`Missing value for required property '${i}' on '${e.declaredClass}'`,{propertyName:i,target:e});return o&&(n!=null&&n.messages)?n.messages.push(o):o&&!n&&_t.getLogger("esri.core.accessorSupport.write").error(o.name,o.message),!1}return!(c===void 0||c===null&&!s.allowNull&&!s.writerEnsuresNonNull||!s.alwaysWriteDefaults&&(!t.store.multipleOriginsSupported||t.store.originOf(i)===fi.DEFAULTS)&&Rq(e,i,n,r,c)||!s.ignoreOrigin&&(n!=null&&n.origin)&&t.store.multipleOriginsSupported&&t.store.originOf(i)0&&(t=Uv(t,S),(c=(n=i==null?void 0:i.resources)==null?void 0:n.pendingOperations)!=null&&c.length&&i.resources.pendingOperations.push(Promise.all(i.resources.pendingOperations).then(()=>Uv(t,S,()=>"replace-arrays"))),i!=null&&i.writtenProperties&&i.writtenProperties.push({target:e,propName:o,oldOrigin:Q7(r.store.originOf(o)),newOrigin:i.origin}))}return t}const y_=e=>{let t=class extends e{constructor(...i){super(...i);const r=To(this),s=r.store,n=new Eq;r.store=n,I4(r,s,n)}read(i,r){P4(this,i,r)}write(i,r){return $4(this,i??{},r)}toJSON(i){return this.write({},i)}static fromJSON(i,r){return Lq.call(this,i,r)}};return t=v([fe("esri.core.JSONSupport")],t),t.prototype.toJSON.isDefaultToJSON=!0,t};function Lq(e,t){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");const i=new this;return i.read(e,t),i}function ZT(e){return e&&typeof e=="object"&&"toJSON"in e&&typeof e.toJSON=="function"}let At=class extends y_(Nt){};At=v([fe("esri.core.JSONSupport")],At);const Dq=/^https:\/\/([a-z\d-]+)(\.maps([^.]*))?\.arcgis\.com/i,Nq={devext:{customBaseUrl:"mapsdevext.arcgis.com",portalHostname:"devext.arcgis.com"},qaext:{customBaseUrl:"mapsqa.arcgis.com",portalHostname:"qaext.arcgis.com"},www:{customBaseUrl:"maps.arcgis.com",portalHostname:"www.arcgis.com"}};function YT(e){const t=e==null?void 0:e.match(Dq);if(!t)return null;const[,i,r,s]=t;if(!i)return null;let n=null,c=null,o=null;const{devext:f,qaext:g,www:S}=Nq;if(r)if(n=i,s)switch(s.toLowerCase()){case"devext":({customBaseUrl:c,portalHostname:o}=f);break;case"qa":({customBaseUrl:c,portalHostname:o}=g);break;default:return null}else({customBaseUrl:c,portalHostname:o}=S);else switch(i.toLowerCase()){case"devext":({customBaseUrl:c,portalHostname:o}=f);break;case"qaext":({customBaseUrl:c,portalHostname:o}=g);break;case"www":({customBaseUrl:c,portalHostname:o}=S);break;default:return null}return{customBaseUrl:c,isPortal:!1,portalHostname:o,urlKey:n}}function zq(e){return/\/(sharing|usrsvcs)\/(appservices|servers)\//i.test(e)}function Fq(e){const t=atob(e),i=new Uint8Array(t.length);for(let r=0;r_t.getLogger("esri.core.urlUtils"),Gm=Ci.request,w$="esri/config: esriConfig.request.proxyUrl is not set.",k4=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,R4=/^\s*http:/i,jq=/^\s*https:/i,Vq=/^\s*file:/i,Gq=/:\d+$/,qq=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,Hq=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),Wq=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");let fm=class{constructor(t=""){this.uri=t,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let i=this.uri.match(Hq);this.scheme=i[2]||(i[1]?"":null),this.authority=i[4]||(i[3]?"":null),this.path=i[5],this.query=i[7]||(i[6]?"":null),this.fragment=i[9]||(i[8]?"":null),this.authority!=null&&(i=this.authority.match(Wq),this.user=i[3]||null,this.password=i[4]||null,this.host=i[6]||i[7],this.port=i[9]||null)}toString(){return this.uri}};const Y1={},Zq=new fm(Ci.applicationUrl);let mn=Zq;const Yq=Jq();let hA=Yq;const dA=()=>mn,O4=()=>hA;function Jq(){const e=mn.path,t=e.substring(0,e.lastIndexOf(e.split("/")[e.split("/").length-1]));return`${`${mn.scheme}://${mn.host}${mn.port!=null?`:${mn.port}`:""}`}${t}`}function Rr(e){if(!e)return null;const t={path:null,query:null},i=new fm(e),r=e.indexOf("?");return i.query===null?t.path=e:(t.path=e.substring(0,r),t.query=pA(i.query)),i.fragment&&(t.hash=i.fragment,i.query===null&&(t.path=t.path.substring(0,t.path.length-(i.fragment.length+1)))),t}function pA(e){const t=e.split("&"),i={};for(const r of t){if(!r)continue;const s=r.indexOf("=");let n,c;s<0?(n=decodeURIComponent(r),c=""):(n=decodeURIComponent(r.slice(0,s)),c=decodeURIComponent(r.slice(s+1)));let o=i[n];typeof o=="string"&&(o=i[n]=[o]),Array.isArray(o)?o.push(c):i[n]=c}return i}function pp(e,t){return e?t&&typeof t=="function"?Object.keys(e).map(i=>encodeURIComponent(i)+"="+encodeURIComponent(t(i,e[i]))).join("&"):Object.keys(e).map(i=>{const r=e[i];if(r==null)return"";const s=encodeURIComponent(i)+"=",n=t==null?void 0:t[i];return n?s+encodeURIComponent(n(r)):Array.isArray(r)?r.map(c=>ZT(c)?s+encodeURIComponent(JSON.stringify(c)):s+encodeURIComponent(c)).join("&"):ZT(r)?s+encodeURIComponent(JSON.stringify(r)):s+encodeURIComponent(r)}).filter(i=>i).join("&"):""}function Kq(e=!1){let t,i=Gm.proxyUrl;if(typeof e=="string"){t=sH(e);const r=mx(e);r&&(i=r.proxyUrl)}else t=!!e;if(!i)throw Uq().warn(w$),new Je("urlUtils:proxy-not-set",w$);return t&&JT()&&(i=_A(i)),Rr(i)}function Sye(e){const t=mx(e);let i,r;if(t){const s=fA(t.proxyUrl);i=s.path,r=s.query?pA(s.query):null}if(i){const s=Rr(e);e=i+"?"+s.path;const n=pp({...r,...s.query});n&&(e=`${e}?${n}`)}return e}const lg={path:"",query:""};function fA(e){const t=e.indexOf("?");return t!==-1?(lg.path=e.slice(0,t),lg.query=e.slice(t+1)):(lg.path=e,lg.query=null),lg}function L4(e){return e=(e=ow(e=uH(e=fA(e).path),!0)).toLowerCase()}function Xq(e){const t={proxyUrl:e.proxyUrl,urlPrefix:L4(e.urlPrefix)},i=Gm.proxyRules,r=t.urlPrefix;let s=i.length;for(let n=0;n0?e.substring(0,t):e.replace(/\/+$/,"")}function N4(e){const t=r=>r==null||r instanceof RegExp&&r.test(e)||typeof r=="string"&&e.startsWith(r),i=Gm.interceptors;if(i){for(const r of i)if(Array.isArray(r.urls)){if(r.urls.some(t))return r}else if(t(r.urls))return r}return null}function Im(e,t,i=!1){if(!e||!t)return!1;const r=XT(e),s=XT(t);return!(!i&&r.scheme!==s.scheme)&&r.host!=null&&s.host!=null&&r.host.toLowerCase()===s.host.toLowerCase()&&r.port===s.port}function mA(e){if(typeof e=="string"){if(!zn(e))return!0;e=XT(e)}if(Im(e,mn))return!0;const t=Gm.trustedServers||[];for(let i=0;i(O=I.indexOf(A,O))===-1?I.length:O;let f=o(s,"/",s.indexOf("//")+2),g=-1;for(;s.slice(0,f+1)===n.slice(0,f)+"/"&&(g=f+1,f!==s.length);)f=o(s,"/",f+1);if(g===-1||c&&g0)for(let I=0;In?s.concat(n.split("/")):s,[]);for(let s=0;s0&&i[i.length-1]!==".."?i.pop():(!n&&s===r.length-1||n&&(n!=="."||i.length===0))&&i.push(n)}return i.join("/")}function Ga(e,t=!1){if(e==null||yx(e)||Cp(e))return null;let i=e.indexOf("://");if(i===-1&&na(e))i=2;else{if(i===-1)return null;i+=3}const r=e.indexOf("/",i);return r!==-1&&(e=e.slice(0,r)),t&&(e=ow(e,!0)),e}function zn(e){return na(e)||gA(e)}function yx(e){return e!=null&&e.slice(0,5)==="blob:"}function Cp(e){return e!=null&&e.slice(0,5)==="data:"}function tH(e){const t=V0(e);return t&&t.isBase64?Fq(t.data):null}function Tye(e){return Bq(e).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}const iH=/^data:(.*?)(;base64)?,(.*)$/;function V0(e){const t=e.match(iH);if(!t)return null;const[,i,r,s]=t;return{mediaType:i,isBase64:!!r,data:s}}function z4(e){return e.isBase64?`data:${e.mediaType};base64,${e.data}`:`data:${e.mediaType},${e.data}`}async function Eye(e){return(await fetch(e)).blob()}function Mye(e){const t=tH(e);if(!t)return null;const i=V0(e);return new Blob([t],{type:i.mediaType})}function Iye(e,t){rH(e,t)}function rH(e,t){if(!e)return!1;const i=document.createElement("a");if(!("download"in i))return!1;const r=URL.createObjectURL(e);return i.download=t,i.href=r,i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r),!0}function na(e){return e!=null&&e[0]==="/"&&e[1]==="/"}function gA(e){return e!=null&&k4.test(e)}function sH(e){return e!=null&&jq.test(e)||mn.scheme==="https"&&na(e)}function nH(e){return e!=null&&R4.test(e)||mn.scheme==="http"&&na(e)}function oH(e){return e!=null&&Vq.test(e)}function _A(e){return na(e)?`https:${e}`:e.replace(R4,"https:")}function aH(){return mn.scheme==="http"}function JT(){return mn.scheme==="https"}function ow(e,t=!1){return na(e)?e.slice(2):(e=e.replace(k4,""),t&&e.length>1&&e[0]==="/"&&e[1]==="/"&&(e=e.slice(2)),e)}function lH(e){const t=e.indexOf("//"),i=e.indexOf("/",t+2);return i===-1?e:e.slice(0,i)}function cH(e){let t=0;if(zn(e)){const r=e.indexOf("//");r!==-1&&(t=r+2)}const i=e.lastIndexOf("/");return ir===s||r.endsWith(`.${s}`))||JT()&&!mx(e))&&(e=_A(e)),e}function KT(e,t,i){if(!(t&&i&&e&&zn(e)))return e;const r=e.indexOf("//"),s=e.indexOf("/",r+2),n=e.indexOf(":",r+2),c=Math.min(s<0?e.length:s,n<0?e.length:n);return e.slice(r+2,c).toLowerCase()!==t.toLowerCase()?e:`${e.slice(0,r+2)}${i}${e.slice(c)}`}function XT(e){return typeof e=="string"?new fm(Xo(e)):(e.scheme||(e.scheme=mn.scheme),e)}function Pye(e){return mH.test(e)}function F4(e,t){const i=Rr(e),r=Object.keys(i.query||{});return r.length>0&&t&&t.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${r.join(", ")}.`),i.path}function fH(e,t,i){const r=Rr(e),s=r.query||{};return s[t]=String(i),`${r.path}?${pp(s)}`}function Pl(e,t){if(!t)return e;const i=Rr(e),r=i.query||{};for(const[n,c]of Object.entries(t))c!=null&&(r[n]=c);const s=pp(r);return s?`${i.path}?${s}`:i.path}function Cye(e){if(e==null)return null;const t=e.match(B4);return t?t[2]:null}function x$(e){if(e==null)return null;const t=e.match(B4);return t?{path:t[1],extension:t[2]}:{path:e,extension:null}}async function $ye(e){return typeof e=="string"?V0(e)??{data:e}:new Promise((t,i)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(V0(r.result)),r.onerror=s=>i(s)})}const B4=/([^.]*)\.([^\/]*)$/,mH=/(^data:image\/svg|\.svg$)/i,U4="20240321",j4="9cf5a4b8555fda94595b625a40b922e012baf071";Symbol.dispose??(Symbol.dispose=Symbol("Symbol.dispose")),Symbol.asyncDispose??(Symbol.asyncDispose=Symbol("Symbol.asyncDispose"));const yH="4.29";let bi,vA=yH;vA="4.29.10";function kye(e){bi=e}function Rye(e){const t=bi==null?void 0:bi.findCredential(e);return t!=null&&t.token?fH(e,"token",t.token):e}Le("host-webworker");const gH=new Set(["elevation3d.arcgis.com","js.arcgis.com","jsdev.arcgis.com","jsqa.arcgis.com","static.arcgis.com"]);function V4(e){const t=Ga(e,!0);return!!t&&t.endsWith(".arcgis.com")&&!gH.has(t)&&!e.endsWith("/sharing/rest/generateToken")}function _H(e,t,i=!1,r){return new Promise((s,n)=>{if(ra(r))return void n(S$());let c=()=>{g(),n(new Error(`Unable to load ${t}`))},o=()=>{const S=e;g(),s(S)},f=()=>{if(!e)return;const S=e;g(),S.src="",n(S$())};const g=()=>{Le("esri-image-decode")||(e.removeEventListener("error",c),e.removeEventListener("load",o)),c=null,o=null,e=null,r!=null&&r.removeEventListener("abort",f),f=null,i&&URL.revokeObjectURL(t)};r!=null&&r.addEventListener("abort",f),Le("esri-image-decode")?e.decode().then(o,c):(e.addEventListener("error",c),e.addEventListener("load",o))})}function S$(){try{return new DOMException("Aborted","AbortError")}catch{const e=new Error;return e.name="AbortError",e}}const vH="Timeout exceeded";function bH(){return new Error(vH)}function wH(e){Ci.request.crossOriginNoCorsDomains||(Ci.request.crossOriginNoCorsDomains={});const t=Ci.request.crossOriginNoCorsDomains;for(let i of e)i=i.toLowerCase(),/^https?:\/\//.test(i)?t[Ga(i)??""]=0:(t[Ga("http://"+i)??""]=0,t[Ga("https://"+i)??""]=0)}function xH(e){const t=Ci.request.crossOriginNoCorsDomains;if(t){let i=Ga(e);if(i)return i=i.toLowerCase(),!Im(i,dA())&&t[i]c.abort());const o={controller:c,credential:void 0,credentialToken:void 0,fetchOptions:void 0,hasToken:!1,interceptor:n,params:s,redoRequest:!1,useIdentity:Oa.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},f=await RH(o);return(g=n==null?void 0:n.after)==null||g.call(n,f),f}let aw;const Oa=Ci.request,G4="FormData"in globalThis,TH=new Set([499,498,403,401]),EH=new Set(["COM_0056","COM_0057","SB_0008"]),MH=[/\/arcgis\/tokens/i,/\/sharing(\/rest)?\/generatetoken/i,/\/rest\/info/i],Am=()=>null,lw=Symbol();function IH(e){const t=Ga(e);t&&!Qi._corsServers.includes(t)&&Qi._corsServers.push(t)}function T$(e){const t=Ga(e);return!t||t.endsWith(".arcgis.com")||Qi._corsServers.includes(t)||mA(t)}function Cl(e,t,i,r){let s="Error";const n={url:i.url,requestOptions:i.requestOptions,getAllHeaders:Am,getHeader:Am,ssl:!1};if(t instanceof Je)return t.details?(t.details=He(t.details),t.details.url=i.url,t.details.requestOptions=i.requestOptions):t.details=n,t;if(t){const c=r&&(()=>Array.from(r.headers)),o=r&&(S=>r.headers.get(S)),f=r==null?void 0:r.status,g=t.message;g&&(s=g),c&&o&&(n.getAllHeaders=c,n.getHeader=o),n.httpStatus=(t.httpCode!=null?t.httpCode:t.code)||f||0,n.subCode=t.subcode,n.messageCode=t.messageCode,typeof t.details=="string"?n.messages=[t.details]:n.messages=t.details,n.raw=lw in t?t[lw]:t}return Ys(t)?jr():new Je(e,s,n)}async function AH(){Le("host-webworker")&&!aw&&(aw=await ht(()=>import("./request-hDnRRtK8.js"),[]))}async function QT(){bi||await ht(()=>import("./IdentityManager-CHp4-snh.js"),__vite__mapDeps([0,1]))}async function PH(e){var o;const t=e.params.url,i=e.params.requestOptions,r=e.controller.signal,s=i.body;let n=null,c=null;if(G4&&"HTMLFormElement"in globalThis&&(s instanceof FormData?n=s:s instanceof HTMLFormElement&&(n=new FormData(s))),typeof s=="string"&&(c=s),e.fetchOptions={cache:i.cacheBust?"no-cache":"default",credentials:"same-origin",headers:i.headers||{},method:i.method==="head"?"HEAD":"GET",mode:"cors",priority:Oa.priority,redirect:"follow",signal:r},(n||c)&&(e.fetchOptions.body=n||c),i.authMode==="anonymous"&&(e.useIdentity=!1),e.hasToken=!!(/token=/i.test(t)||(o=i.query)!=null&&o.token||n!=null&&n.get("token")),!e.hasToken&&Ci.apiKey&&V4(t)&&(i.query||(i.query={}),i.query.token=Ci.apiKey,e.hasToken=!0),e.useIdentity&&!e.hasToken&&!e.credentialToken&&!q4(t)&&!ra(r)){let f;i.authMode==="immediate"?(await QT(),f=await bi.getCredential(t,{signal:r}),e.credential=f):i.authMode==="no-prompt"?(await QT(),f=await bi.getCredential(t,{prompt:!1,signal:r}).catch(()=>{}),e.credential=f):bi&&(f=bi.findCredential(t)),f&&(e.credentialToken=f.token,e.useSSL=!!f.ssl)}}function q4(e){return MH.some(t=>t.test(e))}async function CH(e){let t=e.params.url;const i=e.params.requestOptions,r=e.fetchOptions??{},s=yx(t)||Cp(t),n=i.responseType||"json",c=s?0:i.timeout!=null?i.timeout:Oa.timeout;let o=!1;if(!s){e.useSSL&&(t=_A(t));let A={...i.query};e.credentialToken&&(A.token=e.credentialToken);let O=pp(A);Le("esri-url-encodes-apostrophe")&&(O=O.replaceAll("'","%27"));const z=t.length+1+O.length;let V;o=i.method==="delete"||i.method==="post"||i.method==="put"||!!i.body||z>Oa.maxUrlLength;const H=i.useProxy||!!mx(t);if(H){const Q=Kq(t);V=Q.path,!o&&V.length+1+z>Oa.maxUrlLength&&(o=!0),Q.query&&(A={...Q.query,...A})}if(r.method==="HEAD"&&(o||H)){if(o)throw z>Oa.maxUrlLength?Cl("request:invalid-parameters",new Error("URL exceeds maximum length"),e.params):Cl("request:invalid-parameters",new Error("cannot use POST request when method is 'head'"),e.params);if(H)throw Cl("request:invalid-parameters",new Error("cannot use proxy when method is 'head'"),e.params)}if(o?(r.method=i.method==="delete"?"DELETE":i.method==="put"?"PUT":"POST",i.body?t=Pl(t,A):(r.body=pp(A),r.headers||(r.headers={}),r.headers["Content-Type"]="application/x-www-form-urlencoded")):t=Pl(t,A),H&&(e.useProxy=!0,t=`${V}?${t}`),A.token&&G4&&r.body instanceof FormData&&!zq(t)&&r.body.set("token",A.token),i.hasOwnProperty("withCredentials"))e.withCredentials=i.withCredentials;else if(!Im(t,dA())){if(mA(t))e.withCredentials=!0;else if(bi){const Q=bi.findServerInfo(t);Q!=null&&Q.webTierAuth&&(e.withCredentials=!0)}}e.withCredentials&&(r.credentials="include",xH(t)&&await SH(o?Pl(t,A):t))}let f,g,S=0,I=!1;c>0&&(S=setTimeout(()=>{I=!0,e.controller.abort()},c));try{if(i.responseType==="native-request-init")g=r,g.url=t;else if(i.responseType!=="image"||r.cache!=="default"||r.method!=="GET"||o||kH(i.headers)||!s&&!e.useProxy&&Oa.proxyUrl&&!T$(t)){if(Qi._beforeFetch&&await Qi._beforeFetch(t,r),f=await fetch(t,r),Qi._afterFetch&&await Qi._afterFetch(f),e.useProxy||IH(t),i.responseType==="native")g=f;else if(r.method!=="HEAD")if(f.ok){switch(n){case"array-buffer":g=await f.arrayBuffer();break;case"blob":case"image":g=await f.blob();break;default:g=await f.text()}if(S&&(clearTimeout(S),S=0),n==="json"||n==="xml"||n==="document")if(g)switch(n){case"json":g=JSON.parse(g);break;case"xml":g=E$(g,"application/xml");break;case"document":g=E$(g,"text/html")}else g=null;if(g){if(n==="array-buffer"||n==="blob"){const A=f.headers.get("Content-Type");if(A&&/application\/json|text\/plain/i.test(A)&&g[n==="blob"?"size":"byteLength"]<=750)try{const O=await new Response(g).json();O.error&&(g=O)}catch{}}n==="image"&&g instanceof Blob&&(g=await M$(URL.createObjectURL(g),e,!0))}}else{g=await f.text();try{g=JSON.parse(g)}catch{}}}else g=await M$(t,e)}catch(A){if(A.name==="AbortError")throw I?bH():jr("Request canceled");if(!(!f&&A instanceof TypeError&&Oa.proxyUrl)||i.body||i.method==="delete"||i.method==="head"||i.method==="post"||i.method==="put"||e.useProxy||T$(t))throw A;e.redoRequest=!0,Xq({proxyUrl:Oa.proxyUrl,urlPrefix:Ga(t)??""})}finally{S&&clearTimeout(S)}return[f,g]}async function $H(e,t){if(e.responseData!=null)return e.responseData;if(e.headers&&(t.requestOptions.headers={...t.requestOptions.headers,...e.headers}),e.query&&(t.requestOptions.query={...t.requestOptions.query,...e.query}),e.before){let i,r;try{r=await e.before(t)}catch(s){i=Cl("request:interceptor",s,t)}if((r instanceof Error||r instanceof Je)&&(i=Cl("request:interceptor",r,t)),i)throw e.error&&e.error(i),i;return r}}function kH(e){if(e){for(const t of Object.getOwnPropertyNames(e))if(e[t])return!0}return!1}function E$(e,t){let i;try{i=new DOMParser().parseFromString(e,t)}catch{}if(!i||i.getElementsByTagName("parsererror").length)throw new SyntaxError("XML Parse error");return i}async function RH(e){var n,c;let t,i;await PH(e);try{do[t,i]=await CH(e);while(!await OH(e,t,i))}catch(o){const f=Cl("request:server",o,e.params,t);throw f.details.ssl=e.useSSL,(n=e.interceptor)!=null&&n.error&&e.interceptor.error(f),f}const r=e.params.url;if(i&&/\/sharing\/rest\/(accounts|portals)\/self/i.test(r)){if(!e.hasToken&&!e.credentialToken&&((c=i.user)!=null&&c.username)&&!mA(r)){const o=Ga(r,!0);o&&Oa.trustedServers.push(o)}Array.isArray(i.authorizedCrossOriginNoCorsDomains)&&wH(i.authorizedCrossOriginNoCorsDomains)}const s=e.credential;if(s&&bi){const o=bi.findServerInfo(s.server);let f=o==null?void 0:o.owningSystemUrl;if(f){f=f.replace(/\/?$/,"/sharing");const g=bi.findCredential(f,s.userId);g&&bi._getIdenticalSvcIdx(f,g)===-1&&g.resources.unshift(f)}}return{data:i,getAllHeaders:t?()=>Array.from(t.headers):Am,getHeader:t?o=>t.headers.get(o):Am,httpStatus:(t==null?void 0:t.status)??200,requestOptions:e.params.requestOptions,ssl:e.useSSL,url:e.params.url}}async function OH(e,t,i){var g;if(e.redoRequest)return e.redoRequest=!1,!1;const r=e.params.requestOptions;if(!t||r.responseType==="native"||r.responseType==="native-request-init")return!0;let s,n;if(i&&(i.error?s=i.error:i.status==="error"&&Array.isArray(i.messages)&&(s={...i},s[lw]=i,s.details=i.messages)),!s&&!t.ok)throw s=new Error(`Unable to load ${t.url} status: ${t.status}`),s[lw]=i,s;let c,o=null;s&&(n=Number(s.code),o=s.hasOwnProperty("subcode")?Number(s.subcode):null,c=s.messageCode,c=c==null?void 0:c.toUpperCase());const f=r.authMode;if(n===403&&(o===4||(g=s.message)!=null&&g.toLowerCase().includes("ssl")&&!s.message.toLowerCase().includes("permission"))){if(!e.useSSL)return e.useSSL=!0,!1}else if(!e.hasToken&&e.useIdentity&&(f!=="no-prompt"||n===498)&&n!==void 0&&TH.has(n)&&!q4(e.params.url)&&(n!==403||(!c||!EH.has(c))&&(o==null||o===2&&e.credentialToken))){await QT();try{const S=await bi.getCredential(e.params.url,{error:Cl("request:server",s,e.params),prompt:f!=="no-prompt",signal:e.controller.signal,token:e.credentialToken});return e.credential=S,e.credentialToken=S.token,e.useSSL=e.useSSL||S.ssl,!1}catch(S){if(f==="no-prompt")return e.credential=void 0,e.credentialToken=void 0,!1;s=S}}if(s)throw s;return!0}function M$(e,t,i=!1){const r=t.controller.signal,s=new Image;return t.withCredentials?s.crossOrigin="use-credentials":s.crossOrigin="anonymous",s.alt="",s.fetchPriority=Oa.priority,s.src=e,_H(s,e,i,r)}Qi._corsServers=["https://server.arcgisonline.com","https://services.arcgisonline.com"],Qi._beforeFetch=void 0,Qi._afterFetch=void 0;let qv=class H4{constructor(){this._emitter=new H4.EventEmitter(this)}emit(t,i){return this._emitter.emit(t,i)}on(t,i){return this._emitter.on(t,i)}once(t,i){return this._emitter.once(t,i)}hasEventListener(t){return this._emitter.hasEventListener(t)}};(function(e){class t{constructor(s=null){this._target=s,this._listenersMap=null}clear(){var s;(s=this._listenersMap)==null||s.clear(),this._listenersMap=null}destroy(){this.clear()}emit(s,n){var g;let c=(g=this._listenersMap)==null?void 0:g.get(s);if(!c)return!1;const o=this._target||this;let f=!1;for(const S of c.slice()){const I="deref"in S?S.deref():S;I?I==null||I.call(o,n):f=!0}return f&&(c=c.filter(S=>!("deref"in S)||S.deref()!=null),this._listenersMap.set(s,c)),c.length>0}on(s,n){if(Array.isArray(s)){const o=s.map(f=>this.on(f,n));return h_(o)}if(s.includes(","))throw new TypeError("Evented.on() with a comma delimited string of event types is not supported");this._listenersMap??(this._listenersMap=new Map);const c=this._listenersMap.get(s)||[];return c.push(n),this._listenersMap.set(s,c),er(()=>{var g;const o=(g=this._listenersMap)==null?void 0:g.get(s),f=(o==null?void 0:o.indexOf(n))??-1;f>=0&&o.splice(f,1)})}once(s,n){const c=this.on(s,o=>{c.remove();const f="deref"in n?n.deref():n;f==null||f.call(null,o)});return c}hasEventListener(s){var c;const n=(c=this._listenersMap)==null?void 0:c.get(s);return n!=null&&n.length>0}}e.EventEmitter=t,e.EventedMixin=r=>{let s=class extends r{constructor(){super(...arguments),this._emitter=new t}destroy(){this._emitter.clear()}emit(n,c){return this._emitter.emit(n,c)}on(n,c){return this._emitter.on(n,c)}once(n,c){return this._emitter.once(n,c)}hasEventListener(n){return this._emitter.hasEventListener(n)}};return s=v([fe("esri.core.Evented")],s),s};let i=class extends Nt{constructor(){super(...arguments),this._emitter=new qv.EventEmitter(this)}destroy(){this._emitter.clear()}emit(r,s){return this._emitter.emit(r,s)}on(r,s){return this._emitter.on(r,s)}once(r,s){return this._emitter.once(r,s)}hasEventListener(r){return this._emitter.hasEventListener(r)}};i=v([fe("esri.core.Evented")],i),e.EventedAccessor=i})(qv||(qv={}));const Sh=qv;var ki;(function(e){e[e.ADD=1]="ADD",e[e.REMOVE=2]="REMOVE",e[e.MOVE=4]="MOVE"})(ki||(ki={}));function W4(e){return(t,i)=>{t[i]=e}}let g_=class extends q5{notify(){const t=this._observers;if(t&&t.length>0){const i=t.slice();for(const r of i)r.onInvalidated(),r.onCommitted()}}};var $c;let LH=class{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(t){this.defaultPrevented=!1,this.item=t}},DH=class{constructor(t,i,r,s,n){this.target=t,this.added=i,this.removed=r,this.start=s,this.deleteCount=n}};const Fo=new Pp(LH,void 0,e=>{e.item=null,e.target=null,e.defaultPrevented=!1,e.cancellable=!1});function wS(e){return e?e instanceof Ac?e.toArray():e.length?Array.prototype.slice.apply(e):[]:[]}function xS(e){if(e!=null&&e.length)return e[0]}function NH(e,t,i,r){const s=Math.min(e.length-i,t.length-r);let n=0;for(;n{e.push(s),Z4(e,i.call(r,s,n,c),i,r)})}const yu=new Set,gu=new Set,_u=new Set,SS=new Map;let zH=0,Ac=$c=class extends Sh.EventedAccessor{static isCollection(e){return e!=null&&e instanceof $c}constructor(e){super(e),this._chgListeners=[],this._notifications=null,this._updating=!1,this._timer=null,this._observable=new g_,this.length=0,this._items=[],Object.defineProperty(this,"uid",{value:zH++})}normalizeCtorArgs(e){return e?Array.isArray(e)||e instanceof $c?{items:e}:e:{}}destroy(){this._removeAllRaw()}*[Symbol.iterator](){yield*this.items}get items(){return Rt(this._observable),this._items}set items(e){this._emitBeforeChanges(ki.ADD)||(this._splice(0,this.length,wS(e)),this._emitAfterChanges(ki.ADD))}hasEventListener(e){return e==="change"?this._chgListeners.length>0:this._emitter.hasEventListener(e)}on(e,t){if(e==="change"){const i=this._chgListeners,r={removed:!1,callback:t};return i.push(r),this._notifications&&this._notifications.push({listeners:i.slice(),items:this._items.slice(),changes:[]}),er(()=>{r.removed=!0,i.splice(i.indexOf(r),1)})}return this._emitter.on(e,t)}once(e,t){const i="deref"in t?()=>t.deref():()=>t,r=this.on(e,s=>{var n;(n=i())==null||n.call(null,s),r.remove()});return r}add(e,t){if(Rt(this._observable),this._emitBeforeChanges(ki.ADD))return this;const i=this.getNextIndex(t??null);return this._splice(i,0,[e]),this._emitAfterChanges(ki.ADD),this}addMany(e,t=this._items.length){if(Rt(this._observable),!(e!=null&&e.length))return this;if(this._emitBeforeChanges(ki.ADD))return this;const i=this.getNextIndex(t);return this._splice(i,0,wS(e)),this._emitAfterChanges(ki.ADD),this}at(e){if(Rt(this._observable),(e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this._items[e]}removeAll(){if(Rt(this._observable),!this.length||this._emitBeforeChanges(ki.REMOVE))return[];const e=this._removeAllRaw();return this._emitAfterChanges(ki.REMOVE),e}_removeAllRaw(){return this.length===0?[]:this._splice(0,this.length)||[]}clone(){return Rt(this._observable),this._createNewInstance({items:this._items.map(He)})}concat(...e){Rt(this._observable);const t=e.map(wS);return this._createNewInstance({items:this._items.concat(...t)})}drain(e,t){if(Rt(this._observable),!this.length||this._emitBeforeChanges(ki.REMOVE))return;const i=this._splice(0,this.length),r=i.length;for(let s=0;st&&(e=t),e}includes(e,t=0){return Rt(this._observable),this._items.includes(e,t)}indexOf(e,t=0){return Rt(this._observable),this._items.indexOf(e,t)}join(e=","){return Rt(this._observable),this._items.join(e)}lastIndexOf(e,t=this.length-1){return Rt(this._observable),this._items.lastIndexOf(e,t)}map(e,t){Rt(this._observable);const i=this._items.map(e,t);return new $c({items:i})}reorder(e,t=this.length-1){Rt(this._observable);const i=this.indexOf(e);if(i!==-1){if(t<0?t=0:t>=this.length&&(t=this.length-1),i!==t){if(this._emitBeforeChanges(ki.MOVE))return e;this._splice(i,1),this._splice(t,0,[e]),this._emitAfterChanges(ki.MOVE)}return e}}pop(){if(Rt(this._observable),!this.length||this._emitBeforeChanges(ki.REMOVE))return;const e=xS(this._splice(this.length-1,1));return this._emitAfterChanges(ki.REMOVE),e}push(...e){return Rt(this._observable),this._emitBeforeChanges(ki.ADD)||(this._splice(this.length,0,e),this._emitAfterChanges(ki.ADD)),this.length}reduce(e,t){Rt(this._observable);const i=this._items;return arguments.length===2?i.reduce(e,t):i.reduce(e)}reduceRight(e,t){Rt(this._observable);const i=this._items;return arguments.length===2?i.reduceRight(e,t):i.reduceRight(e)}remove(e){return Rt(this._observable),this.removeAt(this.indexOf(e))}removeAt(e){if(Rt(this._observable),e<0||e>=this.length||this._emitBeforeChanges(ki.REMOVE))return;const t=xS(this._splice(e,1));return this._emitAfterChanges(ki.REMOVE),t}removeMany(e){if(Rt(this._observable),!(e!=null&&e.length)||this._emitBeforeChanges(ki.REMOVE))return[];const t=e instanceof $c?e.toArray():e,i=this._items,r=[],s=t.length;for(let n=0;n-1){const f=1+NH(t,i,n+1,o+1),g=this._splice(o,f);g&&g.length>0&&r.push.apply(r,g),n+=f-1}}return this._emitAfterChanges(ki.REMOVE),r}reverse(){if(Rt(this._observable),this._emitBeforeChanges(ki.MOVE))return this;const e=this._splice(0,this.length);return e&&(e.reverse(),this._splice(0,0,e)),this._emitAfterChanges(ki.MOVE),this}shift(){if(Rt(this._observable),!this.length||this._emitBeforeChanges(ki.REMOVE))return;const e=xS(this._splice(0,1));return this._emitAfterChanges(ki.REMOVE),e}slice(e=0,t=this.length){return Rt(this._observable),this._createNewInstance({items:this._items.slice(e,t)})}some(e,t){return Rt(this._observable),this._items.some(e,t)}sort(e){if(Rt(this._observable),!this.length||this._emitBeforeChanges(ki.MOVE))return this;const t=this._splice(0,this.length);return arguments.length?t.sort(e):t.sort(),this._splice(0,0,t),this._emitAfterChanges(ki.MOVE),this}splice(e,t,...i){Rt(this._observable);const r=(t?ki.REMOVE:0)|(i.length?ki.ADD:0);if(this._emitBeforeChanges(r))return[];const s=this._splice(e,t,i)||[];return this._emitAfterChanges(r),s}toArray(){return Rt(this._observable),this._items.slice()}toJSON(){return Rt(this._observable),this.toArray()}toLocaleString(){return Rt(this._observable),this._items.toLocaleString()}toString(){return Rt(this._observable),this._items.toString()}unshift(...e){return Rt(this._observable),!e.length||this._emitBeforeChanges(ki.ADD)||(this._splice(0,0,e),this._emitAfterChanges(ki.ADD)),this.length}_createNewInstance(e){return new this.constructor(e)}_splice(e,t,i){const r=this._items,s=this.itemType;let n,c;if(!this._notifications&&this.hasEventListener("change")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._updating=!0,this._timer=m_(()=>this._dispatchChange())),e<0&&(e+=this.length),t){if(c=r.splice(e,t),this.hasEventListener("before-remove")){const o=Fo.acquire();o.target=this,o.cancellable=!0;for(let f=0,g=c.length;f{r.push(f)});const s=kn.acquire();gu.forEach(f=>{s.push(f)});const n=this._items,c=t.items,o=kn.acquire();if(_u.forEach(f=>{c.indexOf(f)!==n.indexOf(f)&&o.push(f)}),t.listeners&&(r.length||s.length||o.length)){const f={target:this,added:r,removed:s,moved:o},g=t.listeners.length;for(let S=0;S{if(!e)return $c;if(SS.has(e))return SS.get(e);let t=null;if(typeof e=="function")t=e.prototype.declaredClass;else if(e.base)t=e.base.prototype.declaredClass;else for(const r in e.typeMap){const s=e.typeMap[r].prototype.declaredClass;t?t+=` | ${s}`:t=s}let i=class extends $c{};return v([W4({Type:e,ensureType:typeof e=="function"?Fn(e):Uc(e)})],i.prototype,"itemType",void 0),i=v([fe(`esri.core.Collection<${t}>`)],i),SS.set(e,i),i},v([M()],Ac.prototype,"_updating",void 0),v([M()],Ac.prototype,"length",void 0),v([M()],Ac.prototype,"items",null),v([M({readOnly:!0})],Ac.prototype,"updating",null),Ac=$c=v([fe("esri.core.Collection")],Ac);const Bt=Ac;function mp(e,t,i=Bt){return t||(t=new i),t===e||(t.removeAll(),FH(e)?t.addMany(e):e&&t.add(e)),t}function Y4(e){return e}function FH(e){return e&&(Array.isArray(e)||"items"in e&&Array.isArray(e.items))}var Ju;(function(e){e[e.PENDING=0]="PENDING",e[e.RESOLVED=1]="RESOLVED",e[e.REJECTED=2]="REJECTED"})(Ju||(Ju={}));let BH=class{constructor(){this._resolver=sa(),this._status=Ju.PENDING,this._resolvingPromises=[],this._resolver.promise.then(()=>{this._status=Ju.RESOLVED,this._cleanUp()},()=>{this._status=Ju.REJECTED,this._cleanUp()}),this.promise=this._resolver.promise}destroy(){this._cleanUp()}addResolvingPromise(t){this._resolvingPromises.push(t),this._tryResolve()}isResolved(){return this._status===Ju.RESOLVED}isRejected(){return this._status===Ju.REJECTED}isFulfilled(){return this._status!==Ju.PENDING}abort(){this._resolver.reject(jr())}_cleanUp(){this._allPromise=null,this._resolvingPromises=null}_tryResolve(){if(this.isFulfilled())return;const t=sa(),i=[...this._resolvingPromises,t.promise],r=this._allPromise=Promise.all(i);r.then(()=>{this.isFulfilled()||this._allPromise!==r||this._resolver.resolve()},s=>{this.isFulfilled()||this._allPromise!==r||Ys(s)||this._resolver.reject(s)}),t.resolve()}};const bA=e=>{let t=class extends e{constructor(...i){super(...i),this._promiseProps=new BH,this.addResolvingPromise(Promise.resolve())}destroy(){this._promiseProps.destroy()}isResolved(){return this._promiseProps.isResolved()}isRejected(){return this._promiseProps.isRejected()}isFulfilled(){return this._promiseProps.isFulfilled()}when(i,r){return this._promiseProps.promise.then(()=>this).then(i,r)}catch(i){return this.when(null,i)}addResolvingPromise(i){i&&!this._promiseProps.isFulfilled()&&this._promiseProps.addResolvingPromise("_promiseProps"in i?i.when():i)}};return t=v([fe("esri.core.Promise")],t),t};let cw=class extends bA(Nt){};cw=v([fe("esri.core.Promise")],cw);const UH="not-loaded",jH="loading",VH="failed",I$="loaded",J4=e=>{let t=class extends e{constructor(...i){super(...i),this._loadController=null,this.loadError=null,this.loadStatus="not-loaded",this._set("loadWarnings",[]),this.addResolvingPromise(new Promise(r=>{const s=this.load.bind(this);this.load=n=>{const c=new Promise((o,f)=>{const g=iA(n,f);this.destroyed&&f(new Je("load:instance-destroyed",`Instance of '${this.declaredClass||this.constructor.name}' is already destroyed`,{instance:this})),this.when(o,f).finally(()=>{g&&g.remove()})});if(this.loadStatus===UH){this._set("loadStatus",jH);const o=this._loadController=new AbortController;s({signal:o.signal})}return r(),c}})),this.when(()=>{this._set("loadStatus",I$),this._loadController=null},r=>{this._set("loadStatus",VH),this._set("loadError",r),this._loadController=null})}destroy(){this._loadController&&(this._loadController=z0(this._loadController),this._promiseProps.abort()),this._set("loadError",null),this._set("loadWarnings",[])}get loaded(){return this.loadStatus===I$}get loadWarnings(){return this._get("loadWarnings")}load(){return null}cancelLoad(){var i;return this.isFulfilled()||(this._set("loadError",new Je("load:cancelled","Cancelled")),(i=this._loadController)==null||i.abort(),this._promiseProps.abort()),this}};return v([M({readOnly:!0})],t.prototype,"loaded",null),v([M({readOnly:!0})],t.prototype,"loadError",void 0),v([M({clonable:!1})],t.prototype,"loadStatus",void 0),v([M({type:[jc],readOnly:!0})],t.prototype,"loadWarnings",null),t=v([fe("esri.core.Loadable")],t),t};let Mg=class extends J4(cw){};Mg=v([fe("esri.core.Loadable")],Mg),function(e){function t(i){return!(!i||!i.load)}e.LoadableMixin=J4,e.isLoadable=t}(Mg||(Mg={}));const dh=Mg;function Bye(e,t,i){return rA(e.map((r,s)=>t.apply(i,[r,s])))}async function GH(e,t,i){return(await rA(e.map((r,s)=>t.apply(i,[r,s])))).map(r=>r.value)}function wA(e){return{ok:!0,value:e}}function xA(e){return{ok:!1,error:e}}function qH(e){return e!=null&&e.ok===!0?e.value:null}function HH(e){return e!=null&&e.ok===!1?e.error:null}async function SA(e){if(e==null)return{ok:!1,error:new Error("no promise provided")};try{return wA(await e)}catch(t){return xA(t)}}async function Uye(e){try{return wA(await e)}catch(t){return Na(t),xA(t)}}function _x(e,t){return new Mu(e,t)}let Mu=class extends Nt{get value(){return qH(this._result)}get error(){return HH(this._result)}get finished(){return this._result!=null}constructor(t,i){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=z0(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:r}=this._abortController;this.promise=t(r),this.promise.then(s=>{this._result=wA(s),this._cleanup()},s=>{this._result=xA(s),this._cleanup()}),this._abortHandle=io(i,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=Sr(this._abortHandle),this._abortController=null}};v([M()],Mu.prototype,"value",null),v([M()],Mu.prototype,"error",null),v([M()],Mu.prototype,"finished",null),v([M()],Mu.prototype,"promise",void 0),v([M()],Mu.prototype,"_result",void 0),Mu=v([fe("esri.core.asyncUtils.ReactiveTask")],Mu);async function K4(e,t){return await e.load(),WH(e,t)}async function WH(e,t){const i=[],r=(...n)=>{for(const c of n)c!=null&&(Array.isArray(c)?r(...c):Bt.isCollection(c)?c.forEach(o=>r(o)):dh.isLoadable(c)&&i.push(c))};t(r);let s=null;if(await GH(i,async n=>{const c=await SA(ZH(n)?n.loadAll():n.load());c.ok!==!1||s||(s=c)}),s)throw s.error;return e}function ZH(e){return"loadAll"in e&&typeof e.loadAll=="function"}function ui(e,t,i){let r,s;return t===void 0?(s=e,r=[void 0]):typeof t!="string"?(s=e,r=[void 0],i=t):(s=t,r=Array.isArray(e)?e:[e]),(n,c)=>{const o=n.constructor.prototype;for(const f of r){const g=f4(n,f,s);g.write&&typeof g.write=="object"||(g.write={}),i&&(g.write.target=i),g.write.writer=o[c]}}}let ks=class{constructor(t,i={ignoreUnknown:!1,useNumericKeys:!1}){this._jsonToAPI=t,this._options=i,this.apiValues=[],this.jsonValues=[],this._apiToJSON=this._invertMap(t),this.apiValues=this._getKeysSorted(this._apiToJSON),this.jsonValues=this._getKeysSorted(this._jsonToAPI),this.read=r=>this.fromJSON(r),this.write=(r,s,n)=>{const c=this.toJSON(r);c!==void 0&&Ap(n,c,s)},this.write.isJSONMapWriter=!0}toJSON(t){if(t==null)return null;if(this._apiToJSON.hasOwnProperty(t)){const i=this._apiToJSON[t];return this._options.useNumericKeys?+i:i}return this._options.ignoreUnknown?void 0:t}fromJSON(t){return t!=null&&this._jsonToAPI.hasOwnProperty(t)?this._jsonToAPI[t]:this._options.ignoreUnknown?void 0:t}_invertMap(t){const i={};for(const r in t)i[t[r]]=r;return i}_getKeysSorted(t){const i=[];for(const r in t)i.push(r);return i.sort(),i}};function Bn(){return function(e,t){return new ks(e,{ignoreUnknown:!0,...t})}}let TA=class{constructor(t,i,r,s){this.semiMajorAxis=t,this.flattening=i,this.outerAtmosphereRimWidth=r;const n=1-this.flattening;this.semiMinorAxis=this.semiMajorAxis*n,this.halfSemiMajorAxis=this.semiMajorAxis/2,this.halfCircumference=Math.PI*this.semiMajorAxis,this.metersPerDegree=this.halfCircumference/180,this.inverseFlattening=1/(1-this.flattening)-1,this.eccentricitySquared=s||2*this.flattening-this.flattening*this.flattening,this.meanRadiusSemiAxes=(2*this.semiMajorAxis+this.semiMinorAxis)/3}get radius(){return this.semiMajorAxis}};const Or=new TA(6378137,1/298.257223563,3e5,.006694379990137799),$l=new TA(3396190,1/169.8944472236118,23e4),ph=new TA(1737400,0,0);function Ri(e){if(!Ci.assetsPath)throw _t.getLogger("esri.assets").errorOnce("The API assets location needs to be set using config.assetsPath. More information: https://arcg.is/1OzLe50"),new Je("assets:path-not-set","config.assetsPath is not set");return fp(Ci.assetsPath,e)}let TS,Ee=null;function EA(){return!!Ee}function YH(){return!!Le("esri-wasm")}function X4(){return TS||(TS=ht(()=>import("./pe-wasm-CayGlshv.js"),[]).then(e=>e.p).then(({default:e})=>e({locateFile:t=>Ri(`esri/geometry/support/${t}`)})).then(e=>{eN(e)}),TS)}var eE,fr,tE;(function(e){function t(n,c,o){Ee.ensureCache.prepare();const f=zd(o),g=o===f,S=Ee.ensureFloat64(f),I=Ee._pe_geog_to_proj(Ee.getPointer(n),c,S);return I&&th(o,c,S,g),I}function i(n,c,o,f){switch(f){case fr.PE_TRANSFORM_P_TO_G:return r(n,c,o);case fr.PE_TRANSFORM_G_TO_P:return t(n,c,o)}return 0}function r(n,c,o){return s(n,c,o,0)}function s(n,c,o,f){Ee.ensureCache.prepare();const g=zd(o),S=o===g,I=Ee.ensureFloat64(g),A=Ee._pe_proj_to_geog_center(Ee.getPointer(n),c,I,f);return A&&th(o,c,I,S),A}e.geogToProj=t,e.projGeog=i,e.projToGeog=r,e.projToGeogCenter=s})(eE||(eE={})),function(e){function t(){e.PE_BUFFER_MAX=Ee.PeDefs.prototype.PE_BUFFER_MAX,e.PE_NAME_MAX=Ee.PeDefs.prototype.PE_NAME_MAX,e.PE_MGRS_MAX=Ee.PeDefs.prototype.PE_MGRS_MAX,e.PE_USNG_MAX=Ee.PeDefs.prototype.PE_USNG_MAX,e.PE_DD_MAX=Ee.PeDefs.prototype.PE_DD_MAX,e.PE_DDM_MAX=Ee.PeDefs.prototype.PE_DDM_MAX,e.PE_DMS_MAX=Ee.PeDefs.prototype.PE_DMS_MAX,e.PE_UTM_MAX=Ee.PeDefs.prototype.PE_UTM_MAX,e.PE_PARM_MAX=Ee.PeDefs.prototype.PE_PARM_MAX,e.PE_TYPE_NONE=Ee.PeDefs.prototype.PE_TYPE_NONE,e.PE_TYPE_GEOGCS=Ee.PeDefs.prototype.PE_TYPE_GEOGCS,e.PE_TYPE_PROJCS=Ee.PeDefs.prototype.PE_TYPE_PROJCS,e.PE_TYPE_GEOGTRAN=Ee.PeDefs.prototype.PE_TYPE_GEOGTRAN,e.PE_TYPE_COORDSYS=Ee.PeDefs.prototype.PE_TYPE_COORDSYS,e.PE_TYPE_UNIT=Ee.PeDefs.prototype.PE_TYPE_UNIT,e.PE_TYPE_LINUNIT=Ee.PeDefs.prototype.PE_TYPE_LINUNIT,e.PE_STR_OPTS_NONE=Ee.PeDefs.prototype.PE_STR_OPTS_NONE,e.PE_STR_AUTH_NONE=Ee.PeDefs.prototype.PE_STR_AUTH_NONE,e.PE_STR_AUTH_TOP=Ee.PeDefs.prototype.PE_STR_AUTH_TOP,e.PE_STR_NAME_CANON=Ee.PeDefs.prototype.PE_STR_NAME_CANON,e.PE_STR_FMT_WKT=Ee.PeDefs.prototype.PE_STR_FMT_WKT,e.PE_STR_FMT_WKT2=Ee.PeDefs.prototype.PE_STR_FMT_WKT2,e.PE_PARM_X0=Ee.PeDefs.prototype.PE_PARM_X0,e.PE_PARM_ND=Ee.PeDefs.prototype.PE_PARM_ND,e.PE_TRANSFORM_1_TO_2=Ee.PeDefs.prototype.PE_TRANSFORM_1_TO_2,e.PE_TRANSFORM_2_TO_1=Ee.PeDefs.prototype.PE_TRANSFORM_2_TO_1,e.PE_TRANSFORM_P_TO_G=Ee.PeDefs.prototype.PE_TRANSFORM_P_TO_G,e.PE_TRANSFORM_G_TO_P=Ee.PeDefs.prototype.PE_TRANSFORM_G_TO_P,e.PE_HORIZON_RECT=Ee.PeDefs.prototype.PE_HORIZON_RECT,e.PE_HORIZON_POLY=Ee.PeDefs.prototype.PE_HORIZON_POLY,e.PE_HORIZON_LINE=Ee.PeDefs.prototype.PE_HORIZON_LINE,e.PE_HORIZON_DELTA=Ee.PeDefs.prototype.PE_HORIZON_DELTA}e.init=t}(fr||(fr={})),function(e){const t={},i={},r=O=>{if(O){const z=O.getType();switch(z){case fr.PE_TYPE_GEOGCS:O=Ee.castObject(O,Ee.PeGeogcs);break;case fr.PE_TYPE_PROJCS:O=Ee.castObject(O,Ee.PeProjcs);break;case fr.PE_TYPE_GEOGTRAN:O=Ee.castObject(O,Ee.PeGeogtran);break;default:z&fr.PE_TYPE_UNIT&&(O=Ee.castObject(O,Ee.PeUnit))}}return O};function s(){Ee.PeFactory.prototype.initialize(null)}function n(O){return c(fr.PE_TYPE_COORDSYS,O)}function c(O,z){let V=null,H=t[O];if(H||(H={},t[O]=H),H.hasOwnProperty(String(z)))V=H[z];else{const Q=Ee.PeFactory.prototype.factoryByType(O,z);Ee.compare(Q,Ee.NULL)||(V=Q,H[z]=V)}return V=r(V),V}function o(O,z){let V=null,H=i[O];if(H||(H={},i[O]=H),H.hasOwnProperty(z))V=H[z];else{const Q=Ee.PeFactory.prototype.fromString(O,z);Ee.compare(Q,Ee.NULL)||(V=Q,H[z]=V)}return V=r(V),V}function f(O){return c(fr.PE_TYPE_GEOGCS,O)}function g(O){return c(fr.PE_TYPE_GEOGTRAN,O)}function S(O){return Ee.PeFactory.prototype.getCode(O)}function I(O){return c(fr.PE_TYPE_PROJCS,O)}function A(O){return c(fr.PE_TYPE_UNIT,O)}e.initialize=s,e.coordsys=n,e.factoryByType=c,e.fromString=o,e.geogcs=f,e.geogtran=g,e.getCode=S,e.projcs=I,e.unit=A}(tE||(tE={}));let Q4=null;var uw,iE,rE,sE,hw,nE,dw,pw,oE;function eN(e){function t(n,c,o){n[c]=o(n[c])}Ee=e,fr.init(),uw.init(),hw.init(),dw.init(),pw.init(),Q4=class extends Ee.PeGCSExtent{destroy(){Ee.destroy(this)}};const i=[Ee.PeDatum,Ee.PeGeogcs,Ee.PeGeogtran,Ee.PeObject,Ee.PeParameter,Ee.PePrimem,Ee.PeProjcs,Ee.PeSpheroid,Ee.PeUnit];for(const n of i)t(n.prototype,"getName",c=>function(){return c.call(this,new Array(fr.PE_NAME_MAX))});for(const n of[Ee.PeGeogtran,Ee.PeProjcs])t(n.prototype,"getParameters",c=>function(){const o=new Array(fr.PE_PARM_MAX);let f=c.call(this);for(let g=0;gfunction(){const c=this.getSize();if(!c)return null;const o=[];return th(o,c,n.call(this)),o}),t(Ee.PeGTlistExtendedEntry.prototype,"getEntries",n=>{const c=Ee._pe_getPeGTlistExtendedGTsSize();return function(){let o=null;const f=n.call(this);if(!Ee.compare(f,Ee.NULL)){o=[f];const g=this.getSteps();if(g>1){const S=Ee.getPointer(f);for(let I=1;Ifunction(){let c=this._cache;if(c||(c=new Map,this._cache=c),c.has(n))return c.get(n);let o=null;const f=n.call(this);if(!Ee.compare(f,Ee.NULL)){o=[f];const g=f.getNump();if(g>1){const S=Ee.getPointer(f);for(let I=1;I{t.push(i[0],i[1])})):t=e,t}function th(e,t,i,r=!1){if(r)for(let s=0;s<2*t;s++)e[s]=Ee.getValue(i+s*Float64Array.BYTES_PER_ELEMENT,"double");else{const s=e.length===0;for(let n=0;n1)){const O=Ee.getPointer(A);for(let z=1;z{dc(s);const n=s.getGeogtran();dc(n),n.getParameters().forEach(dc),[n.getGeogcs1(),n.getGeogcs2()].forEach(c=>{dc(c);const o=c.getDatum();dc(o),dc(o.getSpheroid()),dc(c.getPrimem()),dc(c.getUnit())})});Ee.PeGTlistExtendedEntry.prototype.Delete(i[0])}}e.destroy=t}(iE||(iE={})),function(e){function t(i,r,s,n,c){Ee.ensureCache.prepare();const o=zd(s),f=s===o,g=Ee.ensureFloat64(o);let S=0;n&&(S=Ee.ensureFloat64(n));const I=Ee._pe_geog_to_geog(Ee.getPointer(i),r,g,S,c);return I&&th(s,r,g,f),I}e.geogToGeog=t}(rE||(rE={})),function(e){const t=(g,S,I,A,O,z)=>{let V,H;switch(Ee.ensureCache.prepare(),g){case"dd":V=Ee._pe_geog_to_dd,H=fr.PE_DD_MAX;break;case"ddm":V=Ee._pe_geog_to_ddm,H=fr.PE_DDM_MAX;break;case"dms":V=Ee._pe_geog_to_dms,H=fr.PE_DMS_MAX}let Q=0;S&&(Q=Ee.getPointer(S));const ve=zd(A),me=Ee.ensureFloat64(ve),ge=J1(I,H),Ie=V(Q,I,me,O,Ee.ensureInt32(ge));if(Ie)for(let Ce=0;Ce{let z;switch(Ee.ensureCache.prepare(),g){case"dd":z=Ee._pe_dd_to_geog;break;case"ddm":z=Ee._pe_ddm_to_geog;break;case"dms":z=Ee._pe_dms_to_geog}let V=0;S&&(V=Ee.getPointer(S));const H=A.map(ge=>Ee.ensureString(ge)),Q=Ee.ensureInt32(H),ve=Ee.ensureFloat64(new Array(2*I)),me=z(V,I,Q,ve);return me&&th(O,I,ve),me};function r(g,S,I,A,O){return t("dms",g,S,I,A,O)}function s(g,S,I,A){return i("dms",g,S,I,A)}function n(g,S,I,A,O){return t("ddm",g,S,I,A,O)}function c(g,S,I,A){return i("ddm",g,S,I,A)}function o(g,S,I,A,O){return t("dd",g,S,I,A,O)}function f(g,S,I,A){return i("dd",g,S,I,A)}e.geogToDms=r,e.dmsToGeog=s,e.geogToDdm=n,e.ddmToGeog=c,e.geogToDd=o,e.ddToGeog=f}(sE||(sE={})),function(e){function t(){e.PE_MGRS_STYLE_NEW=Ee.PeNotationMgrs.prototype.PE_MGRS_STYLE_NEW,e.PE_MGRS_STYLE_OLD=Ee.PeNotationMgrs.prototype.PE_MGRS_STYLE_OLD,e.PE_MGRS_STYLE_AUTO=Ee.PeNotationMgrs.prototype.PE_MGRS_STYLE_AUTO,e.PE_MGRS_180_ZONE_1_PLUS=Ee.PeNotationMgrs.prototype.PE_MGRS_180_ZONE_1_PLUS,e.PE_MGRS_ADD_SPACES=Ee.PeNotationMgrs.prototype.PE_MGRS_ADD_SPACES}function i(s,n,c,o,f,g,S){Ee.ensureCache.prepare();let I=0;s&&(I=Ee.getPointer(s));const A=zd(c),O=Ee.ensureFloat64(A),z=J1(n,fr.PE_MGRS_MAX),V=Ee.ensureInt32(z),H=Ee._pe_geog_to_mgrs_extended(I,n,O,o,f,g,V);if(H)for(let Q=0;QEe.ensureString(z)),I=Ee.ensureInt32(S),A=Ee.ensureFloat64(new Array(2*n)),O=Ee._pe_mgrs_to_geog_extended(g,n,I,o,A);return O&&th(f,n,A),O}e.init=t,e.geogToMgrsExtended=i,e.mgrsToGeogExtended=r}(hw||(hw={})),function(e){function t(r,s,n,c,o,f,g){Ee.ensureCache.prepare();let S=0;r&&(S=Ee.getPointer(r));const I=zd(n),A=Ee.ensureFloat64(I),O=J1(s,fr.PE_MGRS_MAX),z=Ee.ensureInt32(O),V=Ee._pe_geog_to_usng(S,s,A,c,o,f,z);if(V)for(let H=0;HEe.ensureString(A)),g=Ee.ensureInt32(f),S=Ee.ensureFloat64(new Array(2*s)),I=Ee._pe_usng_to_geog(o,s,g,S);return I&&th(c,s,S),I}e.geogToUsng=t,e.usngToGeog=i}(nE||(nE={})),function(e){function t(){e.PE_UTM_OPTS_NONE=Ee.PeNotationUtm.prototype.PE_UTM_OPTS_NONE,e.PE_UTM_OPTS_ADD_SPACES=Ee.PeNotationUtm.prototype.PE_UTM_OPTS_ADD_SPACES,e.PE_UTM_OPTS_NS=Ee.PeNotationUtm.prototype.PE_UTM_OPTS_NS}function i(s,n,c,o,f){Ee.ensureCache.prepare();let g=0;s&&(g=Ee.getPointer(s));const S=zd(c),I=Ee.ensureFloat64(S),A=J1(n,fr.PE_UTM_MAX),O=Ee.ensureInt32(A),z=Ee._pe_geog_to_utm(g,n,I,o,O);if(z)for(let V=0;VEe.ensureString(z)),I=Ee.ensureInt32(S),A=Ee.ensureFloat64(new Array(2*n)),O=Ee._pe_utm_to_geog(g,n,I,o,A);return O&&th(f,n,A),O}e.init=t,e.geogToUtm=i,e.utmToGeog=r}(dw||(dw={})),function(e){const t=new Map;function i(){e.PE_PCSINFO_OPTION_NONE=Ee.PePCSInfo.prototype.PE_PCSINFO_OPTION_NONE,e.PE_PCSINFO_OPTION_DOMAIN=Ee.PePCSInfo.prototype.PE_PCSINFO_OPTION_DOMAIN,e.PE_POLE_OUTSIDE_BOUNDARY=Ee.PePCSInfo.prototype.PE_POLE_OUTSIDE_BOUNDARY,e.PE_POLE_POINT=Ee.PePCSInfo.prototype.PE_POLE_POINT}function r(s,n=e.PE_PCSINFO_OPTION_DOMAIN){let c=null,o=null;return t.has(s)&&(o=t.get(s),o[n]&&(c=o[n])),c||(c=Ee.PePCSInfo.prototype.generate(s,n),o||(o=[],t.set(s,o)),o[n]=c),c}e.init=i,e.generate=r}(pw||(pw={})),function(e){function t(){return Ee.PeVersion.prototype.version_string()}e.versionString=t}(oE||(oE={}));const JH=Object.freeze(Object.defineProperty({__proto__:null,get PeCSTransformations(){return eE},get PeDefs(){return fr},get PeFactory(){return tE},get PeGCSExtent(){return Q4},get PeGTTransformations(){return rE},get PeGTlistExtended(){return uw},get PeGTlistExtendedEntry(){return iE},get PeNotationDms(){return sE},get PeNotationMgrs(){return hw},get PeNotationUsng(){return nE},get PeNotationUtm(){return dw},get PePCSInfo(){return pw},get PeVersion(){return oE},_init:eN,get _pe(){return Ee},isLoaded:EA,isSupported:YH,load:X4},Symbol.toStringTag,{value:"Module"}));var yp;(function(e){e[e.CGCS2000=4490]="CGCS2000",e[e.GCSMARS2000=104971]="GCSMARS2000",e[e.GCSMARS2000_SPHERE=104905]="GCSMARS2000_SPHERE",e[e.GCSMOON2000=104903]="GCSMOON2000"})(yp||(yp={}));let y;const q={values:[1,.3048,.3048006096012192,.3047972654,.9143917962,.201166195164,.9143984146160287,.3047994715386762,20.11676512155263,20.11678249437587,.9143985307444408,.91439523,.3047997101815088,20.1168,20.116756,5e4,15e4],units:["Meter","Foot","Foot_US","Foot_Clarke","Yard_Clarke","Link_Clarke","Yard_Sears","Foot_Sears","Chain_Sears","Chain_Benoit_1895_B","Yard_Indian","Yard_Indian_1937","Foot_Gold_Coast","Chain","Chain_Sears_1922_Truncated","50_Kilometers","150_Kilometers"],2066:5,2136:12,2155:2,2157:0,2158:0,2159:12,2160:12,2204:2,2219:0,2220:0,2254:2,2255:2,2256:1,2265:1,2266:1,2267:2,2268:2,2269:1,2270:1,2271:2,2272:2,2273:1,2294:0,2295:0,2314:3,2899:2,2900:2,2901:1,2909:1,2910:1,2911:2,2912:2,2913:1,2914:1,2992:1,2993:0,2994:1,3080:1,3089:2,3090:0,3091:2,3102:2,3141:0,3142:0,3167:14,3359:2,3360:0,3361:1,3362:0,3363:2,3364:0,3365:2,3366:3,3404:2,3405:0,3406:0,3407:3,3439:0,3440:0,3479:1,3480:0,3481:1,3482:0,3483:1,3484:0,3485:2,3486:0,3487:2,3488:0,3489:0,3490:2,3491:0,3492:2,3493:0,3494:2,3495:0,3496:2,3497:0,3498:2,3499:0,3500:2,3501:0,3502:2,3503:0,3504:2,3505:0,3506:2,3507:0,3508:2,3509:0,3510:2,3511:0,3512:2,3513:0,3514:0,3515:2,3516:0,3517:2,3518:0,3519:2,3520:0,3521:2,3522:0,3523:2,3524:0,3525:2,3526:0,3527:2,3528:0,3529:2,3530:0,3531:2,3532:0,3533:2,3534:0,3535:2,3536:0,3537:2,3538:0,3539:2,3540:0,3541:2,3542:0,3543:2,3544:0,3545:2,3546:0,3547:2,3548:0,3549:2,3550:0,3551:2,3552:0,3553:2,3582:2,3583:0,3584:2,3585:0,3586:2,3587:0,3588:1,3589:0,3590:1,3591:0,3592:0,3593:1,3598:2,3599:0,3600:2,3605:1,3606:0,3607:0,3608:2,3609:0,3610:2,3611:0,3612:2,3613:0,3614:2,3615:0,3616:2,3617:0,3618:2,3619:0,3620:2,3621:0,3622:2,3623:0,3624:2,3625:0,3626:2,3627:0,3628:2,3629:0,3630:2,3631:0,3632:2,3633:0,3634:1,3635:0,3636:1,3640:2,3641:0,3642:2,3643:0,3644:1,3645:0,3646:1,3647:0,3648:1,3649:0,3650:2,3651:0,3652:2,3653:0,3654:2,3655:0,3656:1,3657:0,3658:2,3659:0,3660:2,3661:0,3662:2,3663:0,3664:2,3668:2,3669:0,3670:2,3671:0,3672:2,3673:0,3674:2,3675:0,3676:1,3677:2,3678:0,3679:1,3680:2,3681:0,3682:1,3683:2,3684:0,3685:0,3686:2,3687:0,3688:2,3689:0,3690:2,3691:0,3692:2,3696:2,3697:0,3698:2,3699:0,3700:2,3793:0,3794:0,3812:0,3854:0,3857:0,3920:0,3978:0,3979:0,3991:2,3992:2,4026:0,4037:0,4038:0,4071:0,4082:0,4083:0,4087:0,4088:0,4217:2,4414:0,4415:0,4417:0,4434:0,4437:0,4438:2,4439:2,4462:0,4467:0,4471:0,4474:0,4559:0,4647:0,4822:0,4826:0,4839:0,5018:0,5041:0,5042:0,5048:0,5221:0,5223:0,5234:0,5235:0,5243:0,5247:0,5266:0,5316:0,5320:0,5321:0,5325:0,5337:0,5361:0,5362:0,5367:0,5382:0,5383:0,5396:0,5456:0,5457:0,5469:0,5472:4,5490:0,5513:0,5514:0,5523:0,5559:0,5588:1,5589:3,5596:0,5627:0,5629:0,5641:0,5643:0,5644:0,5646:2,5654:2,5655:2,5659:0,5700:0,5825:0,5836:0,5837:0,5839:0,5842:0,5844:0,5858:0,5879:0,5880:0,5887:0,5890:0,6128:1,6129:1,6141:1,6204:0,6210:0,6211:0,6307:0,6312:0,6316:0,6362:0,6391:1,6405:1,6406:0,6407:1,6408:0,6409:1,6410:0,6411:2,6412:0,6413:2,6414:0,6415:0,6416:2,6417:0,6418:2,6419:0,6420:2,6421:0,6422:2,6423:0,6424:2,6425:0,6426:2,6427:0,6428:2,6429:0,6430:2,6431:0,6432:2,6433:0,6434:2,6435:0,6436:2,6437:0,6438:2,6439:0,6440:0,6441:2,6442:0,6443:2,6444:0,6445:2,6446:0,6447:2,6448:0,6449:2,6450:0,6451:2,6452:0,6453:2,6454:0,6455:2,6456:0,6457:2,6458:0,6459:2,6460:0,6461:2,6462:0,6463:2,6464:0,6465:2,6466:0,6467:2,6468:0,6469:2,6470:0,6471:2,6472:0,6473:2,6474:0,6475:2,6476:0,6477:2,6478:0,6479:2,6484:2,6485:0,6486:2,6487:0,6488:2,6489:0,6490:2,6491:0,6492:2,6493:0,6494:1,6495:0,6496:1,6497:0,6498:0,6499:1,6500:0,6501:2,6502:0,6503:2,6504:0,6505:2,6506:0,6507:2,6508:0,6509:0,6510:2,6515:1,6516:0,6518:0,6519:2,6520:0,6521:2,6522:0,6523:2,6524:0,6525:2,6526:0,6527:2,6528:0,6529:2,6530:0,6531:2,6532:0,6533:2,6534:0,6535:2,6536:0,6537:2,6538:0,6539:2,6540:0,6541:2,6542:0,6543:2,6544:0,6545:1,6546:0,6547:1,6548:0,6549:2,6550:0,6551:2,6552:0,6553:2,6554:0,6555:2,6556:0,6557:1,6558:0,6559:1,6560:0,6561:1,6562:0,6563:2,6564:0,6565:2,6566:0,6567:0,6568:2,6569:0,6570:1,6571:0,6572:2,6573:0,6574:2,6575:0,6576:2,6577:0,6578:2,6582:2,6583:0,6584:2,6585:0,6586:2,6587:0,6588:2,6589:0,6590:2,6591:0,6592:0,6593:2,6594:0,6595:2,6596:0,6597:2,6598:0,6599:2,6600:0,6601:2,6602:0,6603:2,6605:2,6606:0,6607:2,6608:0,6609:2,6610:0,6611:0,6612:2,6613:0,6614:2,6615:0,6616:2,6617:0,6618:2,6633:2,6646:0,6703:0,6784:0,6785:1,6786:0,6787:1,6788:0,6789:1,6790:0,6791:1,6792:0,6793:1,6794:0,6795:1,6796:0,6797:1,6798:0,6799:1,6800:0,6801:1,6802:0,6803:1,6804:0,6805:1,6806:0,6807:1,6808:0,6809:1,6810:0,6811:1,6812:0,6813:1,6814:0,6815:1,6816:0,6817:1,6818:0,6819:1,6820:0,6821:1,6822:0,6823:1,6824:0,6825:1,6826:0,6827:1,6828:0,6829:1,6830:0,6831:1,6832:0,6833:1,6834:0,6835:1,6836:0,6837:1,6838:0,6839:1,6840:0,6841:1,6842:0,6843:1,6844:0,6845:1,6846:0,6847:1,6848:0,6849:1,6850:0,6851:1,6852:0,6853:1,6854:0,6855:1,6856:0,6857:1,6858:0,6859:1,6860:0,6861:1,6862:0,6863:1,6867:0,6868:1,6870:0,6875:0,6876:0,6879:0,6880:2,6884:0,6885:1,6886:0,6887:1,6915:0,6922:0,6923:2,6924:0,6925:2,6962:0,6984:0,6991:0,7128:2,7131:0,7132:2,7142:0,7257:0,7258:2,7259:0,7260:2,7261:0,7262:2,7263:0,7264:2,7265:0,7266:2,7267:0,7268:2,7269:0,7270:2,7271:0,7272:2,7273:0,7274:2,7275:0,7276:2,7277:0,7278:2,7279:0,7280:2,7281:0,7282:2,7283:0,7284:2,7285:0,7286:2,7287:0,7288:2,7289:0,7290:2,7291:0,7292:2,7293:0,7294:2,7295:0,7296:2,7297:0,7298:2,7299:0,7300:2,7301:0,7302:2,7303:0,7304:2,7305:0,7306:2,7307:0,7308:2,7309:0,7310:2,7311:0,7312:2,7313:0,7314:2,7315:0,7316:2,7317:0,7318:2,7319:0,7320:2,7321:0,7322:2,7323:0,7324:2,7325:0,7326:2,7327:0,7328:2,7329:0,7330:2,7331:0,7332:2,7333:0,7334:2,7335:0,7336:2,7337:0,7338:2,7339:0,7340:2,7341:0,7342:2,7343:0,7344:2,7345:0,7346:2,7347:0,7348:2,7349:0,7350:2,7351:0,7352:2,7353:0,7354:2,7355:0,7356:2,7357:0,7358:2,7359:0,7360:2,7361:0,7362:2,7363:0,7364:2,7365:0,7366:2,7367:0,7368:2,7369:0,7370:2,7877:0,7878:0,7882:0,7883:0,7887:0,7899:0,7991:0,7992:0,8035:2,8036:2,8058:0,8059:0,8082:0,8083:0,8088:0,8090:0,8091:2,8092:0,8093:2,8095:0,8096:2,8097:0,8098:2,8099:0,8100:2,8101:0,8102:2,8103:0,8104:2,8105:0,8106:2,8107:0,8108:2,8109:0,8110:2,8111:0,8112:2,8113:0,8114:2,8115:0,8116:2,8117:0,8118:2,8119:0,8120:2,8121:0,8122:2,8123:0,8124:2,8125:0,8126:2,8127:0,8128:2,8129:0,8130:2,8131:0,8132:2,8133:0,8134:2,8135:0,8136:2,8137:0,8138:2,8139:0,8140:2,8141:0,8142:2,8143:0,8144:2,8145:0,8146:2,8147:0,8148:2,8149:0,8150:2,8151:0,8152:2,8153:0,8154:2,8155:0,8156:2,8157:0,8158:2,8159:0,8160:2,8161:0,8162:2,8163:0,8164:2,8165:0,8166:2,8167:0,8168:2,8169:0,8170:2,8171:0,8172:2,8173:0,8177:2,8179:0,8180:2,8181:0,8182:2,8184:0,8185:2,8187:0,8189:2,8191:0,8193:2,8196:0,8197:2,8198:0,8200:2,8201:0,8202:2,8203:0,8204:2,8205:0,8206:2,8207:0,8208:2,8209:0,8210:2,8212:0,8213:2,8214:0,8216:2,8218:0,8220:2,8222:0,8224:2,8225:0,8226:2,8311:0,8312:1,8313:0,8314:1,8315:0,8316:1,8317:0,8318:1,8319:0,8320:1,8321:0,8322:1,8323:0,8324:1,8325:0,8326:1,8327:0,8328:1,8329:0,8330:1,8331:0,8332:1,8333:0,8334:1,8335:0,8336:1,8337:0,8338:1,8339:0,8340:1,8341:0,8342:1,8343:0,8344:1,8345:0,8346:1,8347:0,8348:1,8352:0,8353:0,8379:0,8380:2,8381:0,8382:2,8383:0,8384:2,8385:0,8387:2,8391:0,8395:0,8433:0,8441:0,8455:0,8456:0,8531:2,8682:0,8686:0,8687:0,8692:0,8693:0,8826:0,8903:0,8950:0,8951:0,9039:0,9040:0,9141:0,9149:0,9150:0,9191:0,9221:0,9222:0,9249:0,9250:0,9252:0,9254:0,9265:0,9284:0,9285:0,9300:0,9354:0,9367:0,9373:0,9377:0,9387:0,9391:0,9456:0,9473:0,9498:0,9674:0,9678:0,9680:0,9709:0,9712:0,9713:0,9716:0,9741:0,9748:2,9749:2,9761:0,9766:0,9793:0,9794:0,9869:0,9874:0,9875:0,9880:0,9895:0,9943:0,9945:0,9947:0,9967:0,9972:0,9977:0,10160:0,10183:0,10188:0,10194:0,10199:0,10207:0,10212:0,10217:0,10222:0,10227:0,10235:0,10240:0,10250:0,10254:0,10270:0,10275:0,10280:0,10306:0,10329:0,10471:0,20002:0,20042:0,20050:1,20499:0,20538:0,20539:0,20790:0,20791:0,21291:0,21292:0,21500:0,21817:0,21818:0,22032:0,22033:0,22091:0,22092:0,22239:0,22240:0,22332:0,22337:0,22338:0,22391:0,22392:0,22639:0,22700:0,22739:0,22770:0,22780:0,22832:0,23090:0,23095:0,23239:0,23240:0,23433:0,23700:0,24047:0,24048:0,24100:3,24200:0,24305:0,24306:0,24382:10,24383:0,24500:0,24547:0,24548:0,24571:9,24600:0,25e3:0,25231:0,25884:0,25932:0,26237:0,26331:0,26332:0,26432:0,26591:0,26592:0,26632:0,26692:0,27120:0,27200:0,27291:6,27292:6,27429:0,27492:0,27493:0,27500:0,27700:0,28232:0,28600:0,28991:0,28992:0,29100:0,29101:0,29220:0,29221:0,29333:0,29635:0,29636:0,29701:0,29738:0,29739:0,29849:0,29850:0,29871:8,29872:7,29873:0,29874:0,30200:5,30339:0,30340:0,30591:0,30592:0,30791:0,30792:0,30800:0,31028:0,31121:0,31154:0,31170:0,31171:0,31370:0,31528:0,31529:0,31600:0,31700:0,31838:0,31839:0,31900:0,31901:0,32061:0,32062:0,32098:0,32099:2,32100:0,32104:0,32161:0,32766:0,53048:0,53049:0,54090:0,54091:0,65061:2,65062:2,65161:0,65163:0,102041:2,102064:11,102068:15,102069:16,102118:2,102119:1,102120:2,102121:2,102217:2,102218:0,102219:2,102220:2,102378:1,102379:1,102380:0,102381:1,102589:2,102599:2,102600:2,102604:2,102647:0,102704:2,102705:2,102706:0,102731:0,102732:0,102759:1,102760:1,102761:2,102762:0,102763:2,102764:0,102765:0,102766:2,102970:1,102974:2,102993:0,102994:0,102995:2,102996:2,103015:0,103016:2,103017:0,103018:2,103025:0,103026:0,103027:2,103028:2,103035:0,103036:0,103037:2,103038:2,103039:0,103040:0,103041:2,103042:2,103043:0,103044:0,103045:2,103046:2,103047:0,103048:0,103049:2,103050:2,103051:0,103052:2,103053:0,103054:2,103055:0,103056:2,103057:0,103058:0,103059:2,103060:2,103061:0,103062:0,103063:2,103064:2,103069:2,103070:0,103071:0,103072:2,103073:2,103086:0,103087:0,103088:2,103089:2,103094:1,103095:0,103096:2,103103:0,103104:2,103105:0,103106:2,103121:0,103122:2,103123:0,103124:0,103125:1,103126:1,103127:0,103128:0,103129:2,103130:2,103131:0,103132:0,103133:2,103134:2,103135:0,103136:0,103137:1,103138:1,103139:0,103140:2,103141:0,103142:2,103143:0,103144:2,103145:0,103146:1,103147:0,103148:0,103149:2,103150:2,103151:0,103152:2,103172:0,103173:2,103174:0,103175:0,103176:2,103177:2,103178:0,103179:0,103180:2,103181:2,103182:0,103183:0,103184:2,103185:2,103228:0,103229:0,103230:2,103231:2,103250:0,103251:2,103252:0,103253:2,103260:0,103261:0,103262:2,103263:2,103270:0,103271:0,103272:2,103273:2,103274:0,103275:0,103276:2,103277:2,103278:0,103279:0,103280:2,103281:2,103282:0,103283:0,103284:2,103285:2,103286:0,103287:2,103288:0,103289:2,103290:0,103291:2,103292:0,103293:0,103294:2,103295:2,103296:0,103297:0,103298:2,103299:2,103376:2,103377:0,103378:0,103379:2,103380:2,103393:0,103394:0,103395:2,103396:2,103472:0,103473:1,103474:0,103475:2,103482:0,103483:2,103484:0,103485:2,103500:0,103501:2,103502:0,103503:0,103504:1,103505:1,103506:0,103507:0,103508:2,103509:2,103510:0,103511:0,103512:2,103513:2,103514:0,103515:2,103516:0,103517:2,103518:0,103519:2,103520:0,103521:1,103522:0,103523:0,103524:2,103525:2,103526:0,103527:2,103561:2,103562:2,103563:0,103564:0,103565:2,103566:2,103567:0,103568:0,103569:2,103570:2,103584:0,103585:2,103586:0,103587:2,103588:1,103589:0,103590:2,103591:1,103592:0,103593:2,103594:1,103695:2,103897:1};for(y=2e3;y<=2045;y++)q[y]=0;for(y=2056;y<=2065;y++)q[y]=0;for(y=2067;y<=2135;y++)q[y]=0;for(y=2137;y<=2154;y++)q[y]=0;for(y=2161;y<=2170;y++)q[y]=0;for(y=2172;y<=2193;y++)q[y]=0;for(y=2195;y<=2198;y++)q[y]=0;for(y=2200;y<=2203;y++)q[y]=0;for(y=2205;y<=2217;y++)q[y]=0;for(y=2222;y<=2224;y++)q[y]=1;for(y=2225;y<=2250;y++)q[y]=2;for(y=2251;y<=2253;y++)q[y]=1;for(y=2257;y<=2264;y++)q[y]=2;for(y=2274;y<=2279;y++)q[y]=2;for(y=2280;y<=2282;y++)q[y]=1;for(y=2283;y<=2289;y++)q[y]=2;for(y=2290;y<=2292;y++)q[y]=0;for(y=2308;y<=2313;y++)q[y]=0;for(y=2315;y<=2491;y++)q[y]=0;for(y=2494;y<=2866;y++)q[y]=0;for(y=2867;y<=2869;y++)q[y]=1;for(y=2870;y<=2888;y++)q[y]=2;for(y=2891;y<=2895;y++)q[y]=2;for(y=2896;y<=2898;y++)q[y]=1;for(y=2902;y<=2908;y++)q[y]=2;for(y=2915;y<=2920;y++)q[y]=2;for(y=2921;y<=2923;y++)q[y]=1;for(y=2924;y<=2930;y++)q[y]=2;for(y=2931;y<=2962;y++)q[y]=0;for(y=2964;y<=2968;y++)q[y]=2;for(y=2969;y<=2973;y++)q[y]=0;for(y=2975;y<=2991;y++)q[y]=0;for(y=2995;y<=3051;y++)q[y]=0;for(y=3054;y<=3079;y++)q[y]=0;for(y=3081;y<=3088;y++)q[y]=0;for(y=3092;y<=3101;y++)q[y]=0;for(y=3106;y<=3138;y++)q[y]=0;for(y=3146;y<=3151;y++)q[y]=0;for(y=3153;y<=3166;y++)q[y]=0;for(y=3168;y<=3172;y++)q[y]=0;for(y=3174;y<=3203;y++)q[y]=0;for(y=3294;y<=3358;y++)q[y]=0;for(y=3367;y<=3403;y++)q[y]=0;for(y=3408;y<=3416;y++)q[y]=0;for(y=3417;y<=3438;y++)q[y]=2;for(y=3441;y<=3446;y++)q[y]=2;for(y=3447;y<=3450;y++)q[y]=0;for(y=3451;y<=3459;y++)q[y]=2;for(y=3460;y<=3478;y++)q[y]=0;for(y=3554;y<=3559;y++)q[y]=0;for(y=3560;y<=3570;y++)q[y]=2;for(y=3571;y<=3581;y++)q[y]=0;for(y=3594;y<=3597;y++)q[y]=0;for(y=3601;y<=3604;y++)q[y]=0;for(y=3637;y<=3639;y++)q[y]=0;for(y=3665;y<=3667;y++)q[y]=0;for(y=3693;y<=3695;y++)q[y]=0;for(y=3701;y<=3727;y++)q[y]=0;for(y=3728;y<=3739;y++)q[y]=2;for(y=3740;y<=3751;y++)q[y]=0;for(y=3753;y<=3760;y++)q[y]=2;for(y=3761;y<=3773;y++)q[y]=0;for(y=3775;y<=3777;y++)q[y]=0;for(y=3779;y<=3781;y++)q[y]=0;for(y=3783;y<=3785;y++)q[y]=0;for(y=3788;y<=3791;y++)q[y]=0;for(y=3797;y<=3802;y++)q[y]=0;for(y=3814;y<=3816;y++)q[y]=0;for(y=3825;y<=3829;y++)q[y]=0;for(y=3832;y<=3841;y++)q[y]=0;for(y=3844;y<=3852;y++)q[y]=0;for(y=3873;y<=3885;y++)q[y]=0;for(y=3890;y<=3893;y++)q[y]=0;for(y=3907;y<=3912;y++)q[y]=0;for(y=3942;y<=3950;y++)q[y]=0;for(y=3968;y<=3970;y++)q[y]=0;for(y=3973;y<=3976;y++)q[y]=0;for(y=3986;y<=3989;y++)q[y]=0;for(y=3994;y<=3997;y++)q[y]=0;for(y=4048;y<=4051;y++)q[y]=0;for(y=4056;y<=4063;y++)q[y]=0;for(y=4093;y<=4096;y++)q[y]=0;for(y=4390;y<=4398;y++)q[y]=0;for(y=4399;y<=4413;y++)q[y]=2;for(y=4418;y<=4433;y++)q[y]=2;for(y=4455;y<=4457;y++)q[y]=2;for(y=4484;y<=4489;y++)q[y]=0;for(y=4491;y<=4554;y++)q[y]=0;for(y=4568;y<=4589;y++)q[y]=0;for(y=4652;y<=4656;y++)q[y]=0;for(y=4766;y<=4800;y++)q[y]=0;for(y=5014;y<=5016;y++)q[y]=0;for(y=5069;y<=5072;y++)q[y]=0;for(y=5105;y<=5130;y++)q[y]=0;for(y=5167;y<=5188;y++)q[y]=0;for(y=5253;y<=5259;y++)q[y]=0;for(y=5269;y<=5275;y++)q[y]=0;for(y=5292;y<=5311;y++)q[y]=0;for(y=5329;y<=5331;y++)q[y]=0;for(y=5343;y<=5349;y++)q[y]=0;for(y=5355;y<=5357;y++)q[y]=0;for(y=5387;y<=5389;y++)q[y]=0;for(y=5459;y<=5463;y++)q[y]=0;for(y=5479;y<=5482;y++)q[y]=0;for(y=5518;y<=5520;y++)q[y]=0;for(y=5530;y<=5539;y++)q[y]=0;for(y=5550;y<=5552;y++)q[y]=0;for(y=5562;y<=5583;y++)q[y]=0;for(y=5623;y<=5625;y++)q[y]=2;for(y=5631;y<=5639;y++)q[y]=0;for(y=5649;y<=5653;y++)q[y]=0;for(y=5663;y<=5680;y++)q[y]=0;for(y=5682;y<=5685;y++)q[y]=0;for(y=5875;y<=5877;y++)q[y]=0;for(y=5896;y<=5899;y++)q[y]=0;for(y=5921;y<=5940;y++)q[y]=0;for(y=6050;y<=6125;y++)q[y]=0;for(y=6244;y<=6275;y++)q[y]=0;for(y=6328;y<=6348;y++)q[y]=0;for(y=6350;y<=6356;y++)q[y]=0;for(y=6366;y<=6372;y++)q[y]=0;for(y=6381;y<=6387;y++)q[y]=0;for(y=6393;y<=6404;y++)q[y]=0;for(y=6480;y<=6483;y++)q[y]=0;for(y=6511;y<=6514;y++)q[y]=0;for(y=6579;y<=6581;y++)q[y]=0;for(y=6619;y<=6624;y++)q[y]=0;for(y=6625;y<=6627;y++)q[y]=2;for(y=6628;y<=6632;y++)q[y]=0;for(y=6634;y<=6637;y++)q[y]=0;for(y=6669;y<=6692;y++)q[y]=0;for(y=6707;y<=6709;y++)q[y]=0;for(y=6720;y<=6723;y++)q[y]=0;for(y=6732;y<=6738;y++)q[y]=0;for(y=6931;y<=6933;y++)q[y]=0;for(y=6956;y<=6959;y++)q[y]=0;for(y=7005;y<=7007;y++)q[y]=0;for(y=7057;y<=7070;y++)q[y]=2;for(y=7074;y<=7082;y++)q[y]=0;for(y=7109;y<=7118;y++)q[y]=0;for(y=7119;y<=7127;y++)q[y]=1;for(y=7374;y<=7376;y++)q[y]=0;for(y=7528;y<=7586;y++)q[y]=0;for(y=7587;y<=7645;y++)q[y]=2;for(y=7692;y<=7696;y++)q[y]=0;for(y=7755;y<=7787;y++)q[y]=0;for(y=7791;y<=7795;y++)q[y]=0;for(y=7799;y<=7801;y++)q[y]=0;for(y=7803;y<=7805;y++)q[y]=0;for(y=7825;y<=7831;y++)q[y]=0;for(y=7845;y<=7859;y++)q[y]=0;for(y=8013;y<=8032;y++)q[y]=0;for(y=8065;y<=8068;y++)q[y]=1;for(y=8518;y<=8529;y++)q[y]=2;for(y=8533;y<=8536;y++)q[y]=2;for(y=8538;y<=8540;y++)q[y]=2;for(y=8677;y<=8679;y++)q[y]=0;for(y=8836;y<=8840;y++)q[y]=0;for(y=8857;y<=8859;y++)q[y]=0;for(y=8908;y<=8910;y++)q[y]=0;for(y=9154;y<=9159;y++)q[y]=0;for(y=9205;y<=9218;y++)q[y]=0;for(y=9271;y<=9273;y++)q[y]=0;for(y=9295;y<=9297;y++)q[y]=0;for(y=9356;y<=9360;y++)q[y]=0;for(y=9404;y<=9407;y++)q[y]=0;for(y=9476;y<=9482;y++)q[y]=0;for(y=9487;y<=9494;y++)q[y]=0;for(y=9697;y<=9699;y++)q[y]=0;for(y=9821;y<=9865;y++)q[y]=0;for(y=10285;y<=10291;y++)q[y]=0;for(y=10314;y<=10317;y++)q[y]=0;for(y=10448;y<=10465;y++)q[y]=0;for(y=11114;y<=11118;y++)q[y]=0;for(y=20004;y<=20032;y++)q[y]=0;for(y=20047;y<=20049;y++)q[y]=0;for(y=20062;y<=20092;y++)q[y]=0;for(y=20135;y<=20138;y++)q[y]=0;for(y=20248;y<=20258;y++)q[y]=0;for(y=20348;y<=20358;y++)q[y]=0;for(y=20436;y<=20440;y++)q[y]=0;for(y=20822;y<=20824;y++)q[y]=0;for(y=20904;y<=20932;y++)q[y]=0;for(y=20934;y<=20936;y++)q[y]=0;for(y=21004;y<=21032;y++)q[y]=0;for(y=21035;y<=21037;y++)q[y]=0;for(y=21095;y<=21097;y++)q[y]=0;for(y=21148;y<=21150;y++)q[y]=0;for(y=21207;y<=21264;y++)q[y]=0;for(y=21307;y<=21364;y++)q[y]=0;for(y=21413;y<=21423;y++)q[y]=0;for(y=21453;y<=21463;y++)q[y]=0;for(y=21473;y<=21483;y++)q[y]=0;for(y=21780;y<=21782;y++)q[y]=0;for(y=21891;y<=21894;y++)q[y]=0;for(y=21896;y<=21899;y++)q[y]=0;for(y=22171;y<=22177;y++)q[y]=0;for(y=22181;y<=22187;y++)q[y]=0;for(y=22191;y<=22197;y++)q[y]=0;for(y=22207;y<=22222;y++)q[y]=0;for(y=22229;y<=22232;y++)q[y]=0;for(y=22234;y<=22236;y++)q[y]=0;for(y=22243;y<=22250;y++)q[y]=0;for(y=22262;y<=22265;y++)q[y]=0;for(y=22307;y<=22322;y++)q[y]=0;for(y=22348;y<=22357;y++)q[y]=0;for(y=22407;y<=22422;y++)q[y]=0;for(y=22462;y<=22465;y++)q[y]=0;for(y=22521;y<=22525;y++)q[y]=0;for(y=22607;y<=22622;y++)q[y]=0;for(y=22641;y<=22646;y++)q[y]=0;for(y=22648;y<=22657;y++)q[y]=0;for(y=22707;y<=22722;y++)q[y]=0;for(y=22762;y<=22765;y++)q[y]=0;for(y=22807;y<=22822;y++)q[y]=0;for(y=22991;y<=22994;y++)q[y]=0;for(y=23028;y<=23038;y++)q[y]=0;for(y=23301;y<=23333;y++)q[y]=2;for(y=23830;y<=23853;y++)q[y]=0;for(y=23866;y<=23872;y++)q[y]=0;for(y=23877;y<=23884;y++)q[y]=0;for(y=23886;y<=23894;y++)q[y]=0;for(y=23946;y<=23948;y++)q[y]=0;for(y=24311;y<=24313;y++)q[y]=0;for(y=24342;y<=24347;y++)q[y]=0;for(y=24370;y<=24374;y++)q[y]=10;for(y=24375;y<=24381;y++)q[y]=0;for(y=24718;y<=24721;y++)q[y]=0;for(y=24817;y<=24821;y++)q[y]=0;for(y=24877;y<=24882;y++)q[y]=0;for(y=24891;y<=24893;y++)q[y]=0;for(y=25391;y<=25395;y++)q[y]=0;for(y=25828;y<=25838;y++)q[y]=0;for(y=26191;y<=26195;y++)q[y]=0;for(y=26391;y<=26393;y++)q[y]=0;for(y=26701;y<=26722;y++)q[y]=0;for(y=26729;y<=26799;y++)q[y]=2;for(y=26801;y<=26803;y++)q[y]=2;for(y=26811;y<=26813;y++)q[y]=2;for(y=26847;y<=26870;y++)q[y]=2;for(y=26891;y<=26899;y++)q[y]=0;for(y=26901;y<=26923;y++)q[y]=0;for(y=26929;y<=26946;y++)q[y]=0;for(y=26948;y<=26998;y++)q[y]=0;for(y=27037;y<=27040;y++)q[y]=0;for(y=27205;y<=27232;y++)q[y]=0;for(y=27258;y<=27260;y++)q[y]=0;for(y=27391;y<=27398;y++)q[y]=0;for(y=27561;y<=27564;y++)q[y]=0;for(y=27571;y<=27574;y++)q[y]=0;for(y=27581;y<=27584;y++)q[y]=0;for(y=27591;y<=27594;y++)q[y]=0;for(y=28191;y<=28193;y++)q[y]=0;for(y=28348;y<=28358;y++)q[y]=0;for(y=28402;y<=28432;y++)q[y]=0;for(y=28462;y<=28492;y++)q[y]=0;for(y=29118;y<=29122;y++)q[y]=0;for(y=29168;y<=29172;y++)q[y]=0;for(y=29177;y<=29185;y++)q[y]=0;for(y=29187;y<=29195;y++)q[y]=0;for(y=29900;y<=29903;y++)q[y]=0;for(y=30161;y<=30179;y++)q[y]=0;for(y=30491;y<=30494;y++)q[y]=0;for(y=30729;y<=30732;y++)q[y]=0;for(y=31251;y<=31259;y++)q[y]=0;for(y=31265;y<=31268;y++)q[y]=0;for(y=31275;y<=31279;y++)q[y]=0;for(y=31281;y<=31297;y++)q[y]=0;for(y=31461;y<=31469;y++)q[y]=0;for(y=31491;y<=31495;y++)q[y]=0;for(y=31917;y<=31922;y++)q[y]=0;for(y=31965;y<=32e3;y++)q[y]=0;for(y=32001;y<=32003;y++)q[y]=2;for(y=32005;y<=32031;y++)q[y]=2;for(y=32033;y<=32060;y++)q[y]=2;for(y=32064;y<=32067;y++)q[y]=2;for(y=32074;y<=32077;y++)q[y]=2;for(y=32081;y<=32086;y++)q[y]=0;for(y=32107;y<=32130;y++)q[y]=0;for(y=32133;y<=32159;y++)q[y]=0;for(y=32164;y<=32167;y++)q[y]=2;for(y=32180;y<=32199;y++)q[y]=0;for(y=32201;y<=32260;y++)q[y]=0;for(y=32301;y<=32360;y++)q[y]=0;for(y=32401;y<=32460;y++)q[y]=0;for(y=32501;y<=32560;y++)q[y]=0;for(y=32601;y<=32662;y++)q[y]=0;for(y=32664;y<=32667;y++)q[y]=2;for(y=32701;y<=32761;y++)q[y]=0;for(y=53001;y<=53004;y++)q[y]=0;for(y=53008;y<=53019;y++)q[y]=0;for(y=53021;y<=53032;y++)q[y]=0;for(y=53034;y<=53037;y++)q[y]=0;for(y=53042;y<=53046;y++)q[y]=0;for(y=53074;y<=53080;y++)q[y]=0;for(y=54001;y<=54004;y++)q[y]=0;for(y=54008;y<=54019;y++)q[y]=0;for(y=54021;y<=54032;y++)q[y]=0;for(y=54034;y<=54037;y++)q[y]=0;for(y=54042;y<=54046;y++)q[y]=0;for(y=54048;y<=54053;y++)q[y]=0;for(y=54074;y<=54080;y++)q[y]=0;for(y=54098;y<=54101;y++)q[y]=0;for(y=102001;y<=102040;y++)q[y]=0;for(y=102042;y<=102063;y++)q[y]=0;for(y=102065;y<=102067;y++)q[y]=0;for(y=102070;y<=102117;y++)q[y]=0;for(y=102122;y<=102216;y++)q[y]=0;for(y=102221;y<=102377;y++)q[y]=0;for(y=102382;y<=102388;y++)q[y]=0;for(y=102389;y<=102398;y++)q[y]=2;for(y=102399;y<=102444;y++)q[y]=0;for(y=102445;y<=102447;y++)q[y]=2;for(y=102448;y<=102458;y++)q[y]=0;for(y=102459;y<=102468;y++)q[y]=2;for(y=102469;y<=102499;y++)q[y]=0;for(y=102500;y<=102519;y++)q[y]=1;for(y=102520;y<=102524;y++)q[y]=0;for(y=102525;y<=102529;y++)q[y]=2;for(y=102530;y<=102588;y++)q[y]=0;for(y=102590;y<=102598;y++)q[y]=0;for(y=102601;y<=102603;y++)q[y]=0;for(y=102605;y<=102628;y++)q[y]=0;for(y=102629;y<=102646;y++)q[y]=2;for(y=102648;y<=102700;y++)q[y]=2;for(y=102701;y<=102703;y++)q[y]=0;for(y=102707;y<=102730;y++)q[y]=2;for(y=102733;y<=102758;y++)q[y]=2;for(y=102767;y<=102900;y++)q[y]=0;for(y=102901;y<=102933;y++)q[y]=2;for(y=102934;y<=102950;y++)q[y]=13;for(y=102951;y<=102955;y++)q[y]=0;for(y=102961;y<=102963;y++)q[y]=0;for(y=102965;y<=102969;y++)q[y]=0;for(y=102971;y<=102973;y++)q[y]=0;for(y=102975;y<=102989;y++)q[y]=0;for(y=102990;y<=102992;y++)q[y]=1;for(y=102997;y<=103002;y++)q[y]=0;for(y=103003;y<=103008;y++)q[y]=2;for(y=103009;y<=103011;y++)q[y]=0;for(y=103012;y<=103014;y++)q[y]=2;for(y=103019;y<=103021;y++)q[y]=0;for(y=103022;y<=103024;y++)q[y]=2;for(y=103029;y<=103031;y++)q[y]=0;for(y=103032;y<=103034;y++)q[y]=2;for(y=103065;y<=103068;y++)q[y]=0;for(y=103074;y<=103076;y++)q[y]=0;for(y=103077;y<=103079;y++)q[y]=1;for(y=103080;y<=103082;y++)q[y]=0;for(y=103083;y<=103085;y++)q[y]=2;for(y=103090;y<=103093;y++)q[y]=0;for(y=103097;y<=103099;y++)q[y]=0;for(y=103100;y<=103102;y++)q[y]=2;for(y=103107;y<=103109;y++)q[y]=0;for(y=103110;y<=103112;y++)q[y]=2;for(y=103113;y<=103116;y++)q[y]=0;for(y=103117;y<=103120;y++)q[y]=2;for(y=103153;y<=103157;y++)q[y]=0;for(y=103158;y<=103162;y++)q[y]=2;for(y=103163;y<=103165;y++)q[y]=0;for(y=103166;y<=103168;y++)q[y]=1;for(y=103169;y<=103171;y++)q[y]=2;for(y=103186;y<=103188;y++)q[y]=0;for(y=103189;y<=103191;y++)q[y]=2;for(y=103192;y<=103195;y++)q[y]=0;for(y=103196;y<=103199;y++)q[y]=2;for(y=103200;y<=103224;y++)q[y]=0;for(y=103225;y<=103227;y++)q[y]=1;for(y=103232;y<=103237;y++)q[y]=0;for(y=103238;y<=103243;y++)q[y]=2;for(y=103244;y<=103246;y++)q[y]=0;for(y=103247;y<=103249;y++)q[y]=2;for(y=103254;y<=103256;y++)q[y]=0;for(y=103257;y<=103259;y++)q[y]=2;for(y=103264;y<=103266;y++)q[y]=0;for(y=103267;y<=103269;y++)q[y]=2;for(y=103300;y<=103375;y++)q[y]=0;for(y=103381;y<=103383;y++)q[y]=0;for(y=103384;y<=103386;y++)q[y]=1;for(y=103387;y<=103389;y++)q[y]=0;for(y=103390;y<=103392;y++)q[y]=2;for(y=103397;y<=103399;y++)q[y]=0;for(y=103400;y<=103471;y++)q[y]=2;for(y=103476;y<=103478;y++)q[y]=0;for(y=103479;y<=103481;y++)q[y]=2;for(y=103486;y<=103488;y++)q[y]=0;for(y=103489;y<=103491;y++)q[y]=2;for(y=103492;y<=103495;y++)q[y]=0;for(y=103496;y<=103499;y++)q[y]=2;for(y=103528;y<=103543;y++)q[y]=0;for(y=103544;y<=103548;y++)q[y]=2;for(y=103549;y<=103551;y++)q[y]=0;for(y=103552;y<=103554;y++)q[y]=1;for(y=103555;y<=103557;y++)q[y]=2;for(y=103558;y<=103560;y++)q[y]=0;for(y=103571;y<=103573;y++)q[y]=0;for(y=103574;y<=103576;y++)q[y]=2;for(y=103577;y<=103580;y++)q[y]=0;for(y=103581;y<=103583;y++)q[y]=2;for(y=103595;y<=103694;y++)q[y]=0;for(y=103696;y<=103699;y++)q[y]=0;for(y=103700;y<=103793;y++)q[y]=2;for(y=103794;y<=103890;y++)q[y]=0;for(y=103891;y<=103896;y++)q[y]=2;for(y=103900;y<=103971;y++)q[y]=2;for(y=103972;y<=103977;y++)q[y]=0;for(y=112e3;y<=112101;y++)q[y]=0;const tN=[102100,102113,3857,3785],KH=[104905,104971],XH=[4326,...tN,...KH],A$='PROJCS["WGS_1984_Web_Mercator_Auxiliary_Sphere",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator_Auxiliary_Sphere"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",{Central_Meridian}],PARAMETER["Standard_Parallel_1",0.0],PARAMETER["Auxiliary_Sphere_Type",0.0],UNIT["Meter",1.0]]',K1=[-20037508342788905e-9,20037508342788905e-9],X1=[-20037508342787e-6,20037508342787e-6],iN={102113:{wkTemplate:'PROJCS["WGS_1984_Web_Mercator",GEOGCS["GCS_WGS_1984_Major_Auxiliary_Sphere",DATUM["D_WGS_1984_Major_Auxiliary_Sphere",SPHEROID["WGS_1984_Major_Auxiliary_Sphere",6378137.0,0.0]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",{Central_Meridian}],PARAMETER["Standard_Parallel_1",0.0],UNIT["Meter",1.0]]',valid:K1,origin:X1,dx:1e-5},102100:{wkTemplate:A$,valid:K1,origin:X1,dx:1e-5},3785:{wkTemplate:'PROJCS["WGS_1984_Web_Mercator",GEOGCS["GCS_WGS_1984_Major_Auxiliary_Sphere",DATUM["D_WGS_1984_Major_Auxiliary_Sphere",SPHEROID["WGS_1984_Major_Auxiliary_Sphere",6378137.0,0.0]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",{Central_Meridian}],PARAMETER["Standard_Parallel_1",0.0],UNIT["Meter",1.0]]',valid:K1,origin:X1,dx:1e-5},3857:{wkTemplate:A$,valid:K1,origin:X1,dx:1e-5},4326:{wkTemplate:'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",{Central_Meridian}],UNIT["Degree",0.0174532925199433]]',altTemplate:'PROJCS["WGS_1984_Plate_Carree",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Plate_Carree"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",{Central_Meridian}],UNIT["Degrees",111319.491]]',valid:[-180,180],origin:[-180,90],dx:1e-5},104971:{wkTemplate:'GEOGCS["Mars_2000_(Sphere)",DATUM["Mars_2000_(Sphere)",SPHEROID["Mars_2000_(Sphere)",3396190.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]',valid:[-180,180],origin:[-180,90],dx:1e-5},104905:{wkTemplate:'GEOGCS["GCS_Mars_2000",DATUM["D_Mars_2000",SPHEROID["Mars_2000_IAU_IAG",3396190.0,169.8944472236118]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]',valid:[-180,180],origin:[-180,90],dx:1e-5}};function Js(e,t){if(e===t)return!0;if(e==null||t==null)return!1;const i=e.wkid,r=t.wkid;if(i!=null||r!=null){if(i===r||gp(e)&&gp(t))return!0;const c=e.latestWkid;if(c!=null&&r===c)return!0;const o=t.latestWkid;return o!=null&&i===o}let s,n;return e.wkt2&&t.wkt2?(s=e.wkt2,n=t.wkt2):e.wkt&&t.wkt&&(s=e.wkt,n=t.wkt),!(!s||!n)&&s.toUpperCase()===n.toUpperCase()}function ro(e){const t=e==null?void 0:e.wkid;return t!=null&&t>=2e3&&iN[t]||null}function rN(e){if(!e)return;const{wkid:t,vcsWkid:i}=e;if(t)return i?JSON.stringify({wkid:t,vcsWkid:i}):String(t);const r=e.wkt||e.wkt2;return JSON.stringify(r?i?{wkt:r,vcsWkid:i}:{wkt:r}:{})}function MA(e){if(!Ba(e))return!1;const{wkid:t}=e;if(t)return q[t]==null;const i=e.wkt2||e.wkt;return!!i&&/^\s*(?:GEOGCS|GEOGCRS|GEOGRAPHICCRS)/i.test(i)}function QH(e){return!(sN(e)||nN(e))}function G0(e){return(e==null?void 0:e.wkid)===4326}function qye(e){return/^\s*(?:GEOD|GEODETIC|GEOG|GEOGRAPHIC|PROJ|PROJECTED|VERT|VERTICAL|ENG|ENGINEERING|PARAMETRIC|TIME|DERIVEDPROJ|COMPOUND|BOUND)CRS/i.test(e)}function Hye(e){return(e==null?void 0:e.wkid)===yp.CGCS2000}function gp(e){const t=e==null?void 0:e.wkid;return t!=null&&t>=2e3&&tN.includes(t)}function eW(e){return(e==null?void 0:e.wkid)===32662}function vx(e){return e===yp.GCSMARS2000||e===yp.GCSMARS2000_SPHERE}function sN(e){return vx(e==null?void 0:e.wkid)}function bx(e){return e===yp.GCSMOON2000}function nN(e){return bx(e==null?void 0:e.wkid)}function tW(e){const t=e==null?void 0:e.wkid;return t!=null&&t>=2e3&&XH.includes(t)}function Ba(e){if(e==null)return!1;const t=e.wkid;return t!=null&&t>=2e3||e.wkt2!=null||e.wkt!=null}const fw={wkid:4326,wkt:O5(iN[4326].wkTemplate,{Central_Meridian:"0.0"})},mw={wkid:102100,latestWkid:3857},iW={wkid:32662};function IA(e){return{wkt:`GEOCCS["Spherical geocentric", +`);return o}setAtOrigin(t,i,r){const s=this.propertiesByName.get(t);if(H1(s))return this._setAtOrigin(s,i,r)}isOverridden(t){const i=this.propertiesByName.get(t);return i!==void 0&&!!(i.flags&Bi.Overridden)}clearOverride(t){const i=this.propertiesByName.get(t);i&&i.flags&Bi.Overridden&&(i.flags&=~Bi.Overridden,i.notifyChange())}override(t,i){const r=this.propertiesByName.get(t);if(!s$(r,t,i,this))return;const s=r.metadata.cast;if(s){const n=this._cast(s,i),{valid:c,value:o}=n;if(gS.release(n),!c)return;i=o}r.flags|=Bi.Overridden,this._internalSet(r,i)}set(t,i){const r=this.propertiesByName.get(t);if(!s$(r,t,i,this))return;const s=r.metadata.cast;if(s){const c=this._cast(s,i),{valid:o,value:f}=c;if(gS.release(c),!o)return;i=f}const n=r.metadata.set;n?n.call(this.host,i):this._internalSet(r,i)}setDefaultOrigin(t){this._origin=nh(t)}getDefaultOrigin(){return Hb(this._origin)}notifyChange(t){const i=this.propertiesByName.get(t);i!==void 0&&i.notifyChange()}invalidate(t){const i=this.propertiesByName.get(t);i!==void 0&&i.invalidate()}commit(t){const i=this.propertiesByName.get(t);i!==void 0&&i.commit()}_internalSet(t,i){const r=this.lifecycle!==Jn.INITIALIZING?this._origin:fi.DEFAULTS;this._setAtOrigin(t,i,r)}_setAtOrigin(t,i,r){const s=this.store,n=t.propertyName;s.has(n,r)&&QI(i,s.get(n))&&~t.flags&Bi.Overridden&&r===s.originOf(n)||(t.invalidate(),s.set(n,i,r),t.commit(),Z5(this.host,t))}_cast(t,i){const r=gS.acquire();return r.valid=!0,r.value=i,t&&(r.value=t.call(this.host,i,r)),r}},sG=class{constructor(){this.value=null,this.valid=!0}acquire(){this.valid=!0}release(){this.value=null}};const gS=new Pp(sG);function Zb(e,t,i){if(e&&t)if(typeof t=="object")for(const r of Object.getOwnPropertyNames(t))Zb(e,r,t[r]);else{if(t.includes(".")){const s=t.split("."),n=s.splice(-1,1)[0];return void Zb(Va(e,s),n,i)}const r=e.__accessor__;r!=null&&nG(t,r),e[t]=i}}function nG(e,t){if(Le("esri-unknown-property-errors")&&!oG(e,t))throw new Je("set:unknown-property",aG(e,t))}function oG(e,t){return t.metadata[e]!=null}function aG(e,t){return"setting unknown property '"+e+"' on instance of "+t.host.declaredClass}let lG;function cG(){return lG}var n$;(function(e){e[e.Ignore=0]="Ignore",e[e.Destroy=1]="Destroy",e[e.ThrowError=2]="ThrowError"})(n$||(n$={}));function uG(e){e.length=0}let kn=class{constructor(t=50,i=50){this._pool=new Pp(Array,void 0,uG,i,t)}acquire(){return this._pool.acquire()}release(t){this._pool.release(t)}prune(){this._pool.prune(0)}static acquire(){return _S.acquire()}static release(t){return _S.release(t)}static prune(){_S.prune()}};const _S=new kn(100);let K5=class extends Pp{constructor(){super(...arguments),this._set=new Set}destroy(){super.destroy(),this._set=null}acquire(...t){const i=super.acquire(...t);return this._set.delete(i),i}release(t){t&&!this._set.has(t)&&(super.release(t),this._set.add(t))}_dispose(t){this._set.delete(t),super._dispose(t)}};const W1=[];function Yb(e){W1.push(e),W1.length===1&&queueMicrotask(()=>{const t=W1.slice();W1.length=0;for(const i of t)i()})}let X5=class{constructor(t,i=30){this.name=t,this._counter=0,this._samples=new Array(i)}record(t){t!=null&&(this._samples[++this._counter%this._samples.length]=t)}get median(){return this._samples.slice().sort((t,i)=>t-i)[Math.floor(this._samples.length/2)]}get average(){return this._samples.reduce((t,i)=>t+i,0)/this._samples.length}get last(){return this._samples[this._counter%this._samples.length]}};var LT;(function(e){const t=(n,c,o,f)=>{let g=c,S=c;const I=o>>>1,A=n[g-1];for(;S<=I;){S=g<<1,Snc?1:0;function r(n,c,o,f){c===void 0&&(c=0),o===void 0&&(o=n.length),f===void 0&&(f=i);for(let S=o>>>1;S>c;S--)t(n,S,o,f);const g=c+1;for(let S=o-1;S>c;S--){const I=n[c];n[c]=n[S],n[S]=I,t(n,g,S,f)}}function*s(n,c,o,f){c===void 0&&(c=0),o===void 0&&(o=n.length),f===void 0&&(f=i);for(let S=o>>>1;S>c;S--)t(n,S,o,f),yield;const g=c+1;for(let S=o-1;S>c;S--){const I=n[c];n[c]=n[S],n[S]=I,t(n,g,S,f),yield}}e.sort=r,e.iterableSort=s})(LT||(LT={}));const o$=LT,hG=1.5,dG=1.1;let F0=class{constructor(t){this.data=[],this._length=0,this._allocator=void 0,this._deallocator=()=>null,this._shrink=()=>{},this._hint=new _5,t&&(t.initialSize&&(this.data=new Array(t.initialSize)),t.allocator&&(this._allocator=t.allocator),t.deallocator!==void 0&&(this._deallocator=t.deallocator),t.shrink&&(this._shrink=()=>a$(this)))}toArray(){return this.data.slice(0,this.length)}filter(t){const i=new Array;for(let r=0;r=this._length))return this.data[t]}includes(t,i){const r=this.data.indexOf(t,i);return r!==-1&&rthis._length){if(this._allocator){for(;this._length=this.length||t<0))return this.swapElements(t,this.length-1),this.pop()}removeUnorderedMany(t,i=t.length,r){this.length=x7(this.data,t,this.length,i,this._hint,r),this._shrink()}front(){if(this.length!==0)return this.data[0]}back(){if(this.length!==0)return this.data[this.length-1]}swapElements(t,i){if(t>=this.length||i>=this.length||t===i)return;const r=this.data[t];this.data[t]=this.data[i],this.data[i]=r}sort(t){o$.sort(this.data,0,this.length,t)}iterableSort(t){return o$.iterableSort(this.data,0,this.length,t)}some(t,i){for(let r=0;rhG*e.length&&(e.data.length=Math.floor(e.length*dG))}function pG(e){return{setTimeout:(t,i)=>{const r=e.setTimeout(t,i);return er(()=>e.clearTimeout(r))}}}const Vm=pG(globalThis);function cx(e){return fG(e)||Q5(e)}function fG(e){return e!=null&&typeof e=="object"&&"on"in e&&typeof e.on=="function"}function Q5(e){return e!=null&&typeof e=="object"&&"addEventListener"in e&&typeof e.addEventListener=="function"}function f_(e,t,i){if(!cx(e))throw new TypeError("target is not a Evented or EventTarget object");return Q5(e)?mG(e,t,i):e.on(t,i)}function mG(e,t,i,r){if(Array.isArray(t)){const s=t.slice();for(const n of s)e.addEventListener(n,i,r);return er(()=>{for(const n of s)e.removeEventListener(n,i,r)})}return e.addEventListener(t,i,r),er(()=>e.removeEventListener(t,i,r))}function e4(e,t,i){if(!cx(e))throw new TypeError("target is not a Evented or EventTarget object");if("once"in e)return e.once(t,i);const r=f_(e,t,s=>{r.remove(),i.call(e,s)});return r}function jr(e="Aborted"){return new Je("AbortError",e)}function mr(e,t="Aborted"){if(ra(e))throw jr(t)}function ux(e){return e instanceof AbortSignal?e:e==null?void 0:e.signal}function ra(e){const t=ux(e);return t!=null&&t.aborted}function Na(e){if(Ys(e))throw e}function l$(e){if(!Ys(e))throw e}function io(e,t){const i=ux(e);if(i!=null){if(!i.aborted)return e4(i,"abort",()=>t());t()}}function iA(e,t){const i=ux(e);if(i!=null)return mr(i),e4(i,"abort",()=>t(jr()))}function yG(e,t){return ux(t)==null?e:new Promise((i,r)=>{let s=io(t,()=>r(jr()));const n=()=>{s=Sr(s)};e.then(n,n),e.then(i,r)})}function Ys(e){return(e==null?void 0:e.name)==="AbortError"}async function c$(e){try{return await e}catch(t){if(!Ys(t))throw t;return}}async function rA(e){if(!e)return;if(typeof e.forEach!="function"){const i=Object.keys(e),r=i.map(c=>e[c]),s=await rA(r),n={};return i.map((c,o)=>n[c]=s[o]),n}const t=e;return Promise.allSettled(t).then(i=>Array.from(t,(r,s)=>{const n=i[s];return n.status==="fulfilled"?{promise:r,value:n.value}:{promise:r,error:n.reason}}))}async function gG(e){return(await Promise.allSettled(e)).filter(t=>t.status==="fulfilled").map(t=>t.value)}async function sye(e){return(await Promise.allSettled(e)).filter(t=>t.status==="rejected").map(t=>t.reason)}function t4(e,t=void 0,i){const r=new AbortController;return io(i,()=>r.abort()),new Promise((s,n)=>{let c=setTimeout(()=>{c=0,s(t)},e);io(r,()=>{c&&(clearTimeout(c),n(jr()))})})}function _G(e,t){const i=new AbortController,r=setTimeout(()=>i.abort(),t);return io(e,()=>{i.abort(),clearTimeout(r)}),{...e,signal:i.signal}}function xh(e){return e&&typeof e.then=="function"}function u$(e){return xh(e)?e:Promise.resolve(e)}function vG(e,t=-1){let i,r,s,n,c=null;const o=(...f)=>{if(i){r=f,n&&n.reject(jr()),n=sa();const A=n.promise;if(c){const O=c;c=null,O.abort()}return A}if(s=n||sa(),n=null,t>0){const A=new AbortController;i=u$(e(...f,A.signal));const O=i;t4(t).then(()=>{i===O&&(n?A.abort():c=A)})}else i=1,i=u$(e(...f));const g=()=>{const A=r;r=s=i=c=null,A!=null&&o(...A)},S=i,I=s;return S.then(g,g),S.then(I.resolve,I.reject),I.promise};return o}function sa(){let e,t;const i=new Promise((s,n)=>{e=s,t=n}),r=s=>{e(s)};return r.resolve=s=>e(s),r.reject=s=>t(s),r.timeout=(s,n)=>Vm.setTimeout(()=>r.reject(n),s),r.promise=i,r}async function Jb(e){await Promise.resolve(),mr(e)}function nye(e){return e}function oye(e){return 1e3*e}function aye(e){return e}let bG=class{constructor(t){this.phases=t,this.paused=!1,this.ticks=-1,this.removed=!1}},wG=class{constructor(t){this.callback=t,this.isActive=!0}remove(){this.isActive=!1}},DT=0;const ag={time:0,deltaTime:0,elapsedFrameTime:0,frameDuration:0},NT=["prepare","preRender","render","postRender","update","finish"],zT=[],dp=new F0;let xG=class{constructor(t){this._task=t}remove(){this._task.removed=!0}pause(){this._task.paused=!0}resume(){this._task.paused=!1}};function SG(){np!=null&&(cancelAnimationFrame(np),np=requestAnimationFrame(sA))}const Kb={frameTasks:dp,willDispatch:!1,clearFrameTasks:TG,dispatch:r4,executeFrameTasks:EG,reschedule:SG};function m_(e){const t=new wG(e);return zT.push(t),Kb.willDispatch||(Kb.willDispatch=!0,Yb(r4)),t}function Mm(e){const t=new bG(e);return dp.push(t),np==null&&(DT=performance.now(),np=requestAnimationFrame(sA)),new xG(t)}let np=null;function TG(e=!1){dp.forAll(t=>{t.removed=!0}),e&&i4()}function sA(){const e=performance.now();np=null,np=dp.length>0?requestAnimationFrame(sA):null,Kb.executeFrameTasks(e)}function EG(e){const t=e-DT;DT=e;const i=1e3/60,r=Math.max(0,t-i);ag.time=e,ag.frameDuration=i-r;for(let s=0;s{var f;o.paused||o.removed||(s===0&&o.ticks++,o.phases[c]&&(ag.elapsedFrameTime=performance.now()-e,ag.deltaTime=o.ticks===0?0:t,(f=o.phases[c])==null||f.call(o,ag)))}),IG[s].record(performance.now()-n)}i4(),AG.record(performance.now()-e)}const Z1=new F0;function i4(){dp.forAll(e=>{e.removed&&Z1.push(e)}),dp.removeUnorderedMany(Z1.data,Z1.length),Z1.clear()}function r4(){for(;zT.length;){const e=zT.shift();e.isActive&&e.callback()}Kb.willDispatch=!1}function MG(e=1,t){const i=sa(),r=()=>{ra(t)?i.reject(jr()):e===0?i():(--e,Yb(()=>r()))};return r(),i.promise}const IG=NT.map(e=>new X5(e)),AG=new X5("total");function PG(e,t){for(const i of e.entries())if(t(i[0]))return!0;return!1}function h$(e,t){if(!t)return e;for(const i of t)e.add(i);return e}function s4(e,t){const i=new Set;return h$(i,e),h$(i,t),i}function CG(e,t){const i=new Set;for(const r of t)e.has(r)&&i.add(r);return i}function hye(e,t){if(!e||!t)return!1;if(e===t)return!0;for(const i of e)if(!t.has(i))return!1;return!0}function dye(e,t){if(e==null&&t==null)return!0;if(e==null||t==null||e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}function $G(e,t){const i=new Set(e);for(const r of t)i.delete(r);return i}function kG(e,t){return $G(s4(e,t),CG(e,t))}let RG=0;function p0(){return++RG}let hx=class{constructor(t){this._accessed=[],this._handles=[],this._observerObject=new OG(t),d$.register(this,new WeakRef(this._observerObject),this)}destroy(){var t;d$.unregister(this._observerObject),this._accessed.length=0,(t=this._observerObject)==null||t.destroy(),this.clear()}onObservableAccessed(t){const i=this._accessed;i.includes(t)||i.push(t)}onTrackingEnd(){const t=this._handles,i=this._accessed,r=this._observerObject;for(let s=0;s0?t-1:0}destroy(){this.destroyed=!0,this._notify=LG}};const d$=new FinalizationRegistry(e=>{var t;(t=e.deref())==null||t.destroy()});function LG(){}let dm=!1;const Xb=[];function n4(e,t){let i=new hx(n),r=null,s=!1;function n(){if(!i||s)return;if(dm)return void a4(n);const o=r;i.clear(),dm=!0,s=!0,r=Bc(i,e),s=!1,dm=!1,t(r,o),l4()}function c(){i&&(i.destroy(),i=null,r=null)}return s=!0,r=Bc(i,e),s=!1,er(c)}function o4(e,t){let i=new hx(s),r=null;function s(){t(r,c)}function n(){i&&(i.destroy(),i=null),r=null}function c(){return i?(i.clear(),r=Bc(i,e),r):null}return c(),er(n)}function DG(e){let t=new hx(r),i=!1;function r(){t&&!i&&(dm?a4(r):(t.clear(),dm=!0,i=!0,Bc(t,e),i=!1,dm=!1,l4()))}function s(){t&&(t.destroy(),t=null)}return i=!0,Bc(t,e),i=!1,er(s)}function a4(e){Xb.includes(e)||Xb.unshift(e)}function l4(){for(;Xb.length;)Xb.pop()()}var f0;(function(e){e[e.Untracked=0]="Untracked",e[e.Tracked=1]="Tracked"})(f0||(f0={}));let B0=class{constructor(){this.uid=p0(),this.removed=!1,this.type=null,this.oldValue=null,this.callback=null,this.getValue=null,this.target=null,this.path=null,this.equals=null}static acquireUntracked(t,i,r,s,n){return this.pool.acquire(f0.Untracked,t,i,r,s,n,QI)}static acquireTracked(t,i,r,s){return this.pool.acquire(f0.Tracked,t,i,r,null,null,s)}notify(t,i){this.type===f0.Untracked?this.callback.call(this.target,t,i,this.path,this.target):this.callback.call(null,t,i,void 0,void 0)}acquire(t,i,r,s,n,c,o){this.uid=p0(),this.removed=!1,this.type=t,this.oldValue=i,this.callback=r,this.getValue=s,this.target=n,this.path=c,this.equals=o}release(){this.target=this.path=this.oldValue=this.callback=this.getValue=null,this.uid=p0(),this.removed=!0}};B0.pool=new K5(B0);const Gv=new kn,Dc=new Set;let Qb;function ew(e){Dc.delete(e),Dc.add(e),Qb||(Qb=m_(FG))}function NG(e){if(e.removed)return;const t=e.oldValue,i=e.getValue();e.equals(t,i)||(e.oldValue=i,e.notify(i,t))}function zG(e){for(const t of Dc.values())t.target===e&&(t.removed=!0)}function FG(){let e=10;for(;Qb&&e--;){Qb=null;const t=BG(),i=Gv.acquire();for(const r of t){const s=r.uid;NG(r),s===r.uid&&r.removed&&i.push(r)}for(const r of Dc)r.removed&&(i.push(r),Dc.delete(r));for(const r of i)B0.pool.release(r);Gv.release(i),Gv.release(t),FT.forEach(r=>r())}}function BG(){const e=Gv.acquire();e.length=Dc.size;let t=0;for(const i of Dc)e[t]=i,++t;return Dc.clear(),e}const FT=new Set;function UG(e){return FT.add(e),er(()=>FT.delete(e))}function jG(e,t,i){let r=j5(e,t,i,(s,n,c)=>{let o,f,g=o4(()=>d_(s,n),(S,I)=>{var A;((A=s.__accessor__)==null?void 0:A.lifecycle)===Jn.DESTROYED||o&&o.uid!==f?r.remove():(o||(o=B0.acquireUntracked(S,c,I,s,n),f=o.uid),ew(o))});return er(()=>{g.remove(),o&&(o.uid!==f||o.removed||(o.removed=!0,ew(o)),o=null),r=g=null})});return r}function VG(e,t,i){const r=j5(e,t,i,(s,n,c)=>{let o=!1;return n4(()=>d_(s,n),(f,g)=>{s.__accessor__.lifecycle!==Jn.DESTROYED?o||(o=!0,QI(g,f)||c.call(s,f,g,n,s),o=!1):r.remove()})});return r}function GG(e,t,i,r=!1){return e.__accessor__&&e.__accessor__.lifecycle!==Jn.DESTROYED?r?VG(e,t,i):jG(e,t,i):er()}function qG(e,t,i){let r,s,n=o4(e,(c,o)=>{r&&r.uid!==s?n.remove():(r||(r=B0.acquireTracked(c,t,o,i),s=r.uid),ew(r))});return er(()=>{n.remove(),r&&(r.uid!==s||r.removed||(r.removed=!0,ew(r)),r=null),n=null})}function HG(e,t,i){let r=!1;return n4(e,(s,n)=>{r||(r=!0,i(n,s)||t(s,n),r=!1)})}function WG(e,t,i=!1,r=$5){return i?HG(e,t,r):qG(e,t,r)}function p$(e){return PG(Dc,t=>t.oldValue===e)}function dx(e,t){for(const[i,r]of e)if(t(r,i))return!0;return!1}function nA(e,t,i){const r=e.get(t);if(r!==void 0)return r;const s=i();return e.set(t,s),s}function yye(e){const t=new Map;return i=>(t.has(i)||t.set(i,e(i)),t.get(i))}const pm=()=>_t.getLogger("esri.core.accessorSupport.ensureTypes");function ZG(e){return e==null?e:new Date(e)}function YG(e){return e==null?e:!!e}function JG(e){return e==null?e:e.toString()}function za(e){return e==null?e:(e=parseFloat(e),isNaN(e)?0:e)}function oA(e){return e==null?e:Math.round(parseFloat(e))}function c4(e){return(e==null?void 0:e.constructor)&&e.constructor.__accessorMetadata__!==void 0}function tw(e,t){return t!=null&&e&&!(t instanceof e)}function u4(e){return e&&"isCollection"in e}function f$(e){return e!=null&&e.Type?typeof e.Type=="function"?e.Type:e.Type.base:null}function KG(e,t){if(!(t!=null&&t.constructor)||!u4(t.constructor))return BT(e,t)?t:new e(t);const i=f$(e.prototype.itemType),r=f$(t.constructor.prototype.itemType);return i?r?i===r?t:i.prototype.isPrototypeOf(r.prototype)?new e(t):(BT(e,t),t):new e(t):t}function BT(e,t){return!!c4(t)&&(pm().error("Accessor#set","Assigning an instance of '"+(t.declaredClass||"unknown")+"' which is not a subclass of '"+fx(e)+"'"),!0)}function px(e,t){return t==null?t:u4(e)?KG(e,t):tw(e,t)?BT(e,t)?t:new e(t):t}function fx(e){var t;return((t=e==null?void 0:e.prototype)==null?void 0:t.declaredClass)||"unknown"}const XG=new WeakMap;function QG(e){switch(e){case Number:return za;case $r:return oA;case Boolean:return YG;case String:return JG;case Date:return ZG;default:return nA(XG,e,()=>px.bind(null,e))}}function Fn(e,t){const i=QG(e);return arguments.length===1?i:i(t)}function U0(e,t,i){return arguments.length===1?U0.bind(null,e):t&&(Array.isArray(t)?t.map(r=>e(r,i)):[e(t,i)])}function eq(e,t){return arguments.length===1?U0(i=>Fn(e,i)):U0(i=>Fn(e,i),t)}function h4(e,t,i){return t!==0&&Array.isArray(i)?i.map(r=>h4(e,t-1,r)):e(i)}function iw(e,t,i){if(arguments.length===2)return n=>iw(e,t,n);if(!i)return i;i=h4(e,t,i);let r=t,s=i;for(;r>0&&Array.isArray(s);)r--,s=s[0];if(s!==void 0)for(let n=0;nFn(e,r),t):iw(r=>Fn(e,r),t,i)}function d4(e){return!!Array.isArray(e)&&!e.some(t=>{const i=typeof t;return!(i==="string"||i==="number"||i==="function"&&e.length>1)})}function UT(e,t){if(arguments.length===2)return UT(e).call(null,t);const i=new Set,r=e.filter(o=>typeof o!="function"),s=e.filter(o=>typeof o=="function");for(const o of e)typeof o!="string"&&typeof o!="number"||i.add(o);let n=null,c=null;return(o,f)=>{if(o==null)return o;const g=typeof o,S=g==="string"||g==="number";return S&&(i.has(o)||s.some(I=>g==="string"&&I===String||g==="number"&&I===Number))||g==="object"&&s.some(I=>!tw(o,I))?o:(S&&r.length?(n||(n=r.map(I=>typeof I=="string"?`'${I}'`:`${I}`).join(", ")),pm().error("Accessor#set",`'${o}' is not a valid value for this property, only the following values are valid: ${n}`)):typeof o=="object"&&s.length?(c||(c=s.map(I=>fx(I)).join(", ")),pm().error("Accessor#set",`'${o}' is not a valid value for this property, value must be one of ${c}`)):pm().error("Accessor#set",`'${o}' is not a valid value for this property`),f&&(f.valid=!1),null)}}function Uc(e,t){if(arguments.length===2)return Uc(e).call(null,t);const i={},r=[],s=[];for(const f in e.typeMap){const g=e.typeMap[f];i[f]=Fn(g),r.push(fx(g)),s.push(f)}const n=()=>`'${r.join("', '")}'`,c=()=>`'${s.join("', '")}'`,o=typeof e.key=="string"?f=>f[e.key]:e.key;return f=>{if(e.base&&!tw(e.base,f)||f==null)return f;const g=o(f)||e.defaultKeyValue,S=i[g];if(!S)return pm().error("Accessor#set",`Invalid property value, value needs to be one of ${n()}, or a plain object that can autocast (having .type = ${c()})`),null;if(!tw(e.typeMap[g],f))return f;if(typeof e.key=="string"&&!c4(f)){const I={};for(const A in f)A!==e.key&&(I[A]=f[A]);return S(I)}return S(f)}}let $r=class{};const _ye={native:e=>({type:"native",value:e}),array:e=>({type:"array",value:e}),oneOf:e=>({type:"one-of",values:e})};function iq(e){if(!e||!("type"in e))return!1;switch(e.type){case"native":case"array":case"one-of":return!0}return!1}function p4(e){switch(e.type){case"native":return Fn(e.value);case"array":return U0(p4(e.value));case"one-of":return rq(e);default:return null}}function rq(e){let t=null;return(i,r)=>VT(i,e)?i:(t==null&&(t=jT(e)),pm().error("Accessor#set",`Invalid property value, value needs to be of type ${t}`),r&&(r.valid=!1),null)}function jT(e){switch(e.type){case"native":switch(e.value){case Number:return"number";case String:return"string";case Boolean:return"boolean";case $r:return"integer";case Date:return"date";default:return fx(e.value)}case"array":return`array of ${jT(e.value)}`;case"one-of":{const t=e.values.map(i=>jT(i));return`one of ${t.slice(0,-1)} or ${t[t.length-1]}`}}return"unknown"}function VT(e,t){if(e==null)return!0;switch(t.type){case"native":switch(t.value){case Number:case $r:return typeof e=="number";case Boolean:return typeof e=="boolean";case String:return typeof e=="string"}return e instanceof t.value;case"array":return!!Array.isArray(e)&&!e.some(i=>!VT(i,t.value));case"one-of":return t.values.some(i=>VT(e,i))}}function M(e={}){return(t,i)=>{if(t===Function.prototype)throw new Error(`Inappropriate use of @property() on a static field: ${t.name}.${i}. Accessor does not support static properties.`);const r=Object.getOwnPropertyDescriptor(t,i),s=lx(t,i);r&&(r.get||r.set?(s.get=r.get||s.get,s.set=r.set||s.set):"value"in r&&("value"in e&&_t.getLogger("esri.core.accessorSupport.decorators.property").warn(`@property() will redefine the value of "${i}" on "${t.constructor.name}" already defined in the metadata`,e),s.value=e.value=r.value)),e.readOnly!=null&&(s.readOnly=e.readOnly);const n=e.aliasOf;if(n){const f=typeof n=="string"?n:n.source,g=typeof n=="string"?null:n.overridable===!0;let S;s.dependsOn=[f],s.get=function(){let I=Va(this,f);if(typeof I=="function"){S||(S=f.split(".").slice(0,-1).join("."));const A=Va(this,S);A&&(I=I.bind(A))}return I},s.readOnly||(s.set=g?function(I){this._override(i,I)}:function(I){Zb(this,f,I)})}const c=e.type,o=e.types;s.cast||(c?s.cast=sq(c):o&&(Array.isArray(o)?s.cast=U0(Uc(o[0])):s.cast=Uc(o))),H7(s,e),e.range&&(s.cast=nq(s.cast,e.range))}}function f4(e,t,i){const r=lx(e,i);r.json||(r.json={});let s=r.json;return t!==void 0&&(s.origins||(s.origins={}),s.origins[t]||(s.origins[t]={}),s=s.origins[t]),s}function sq(e){let t=0,i=e;if(iq(e))return p4(e);for(;Array.isArray(i)&&i.length===1&&typeof i[0]!="string"&&typeof i[0]!="number";)i=i[0],t++;const r=i;if(d4(r))return t===0?UT(r):iw(UT(r),t);if(t===1)return eq(r);if(t>1)return tq(r,t);const s=e;return s.from?s.from:Fn(s)}function nq(e,t){return i=>{let r=+e(i);return t.step!=null&&(r=Math.round(r/t.step)*t.step),t.min!=null&&(r=Math.max(t.min,r)),t.max!=null&&(r=Math.min(t.max,r)),r}}function oq(e){if(e.json&&e.json.origins){const t=e.json.origins,i={"web-document":["web-scene","web-map"]};for(const r in i)if(t[r]){const s=t[r];i[r].forEach(n=>{t[n]=s}),delete t[r]}}}let jc=class extends D5{constructor(t,i,r){super(t,i,r)}};jc.prototype.type="warning";function m4(e){var t;return!!e&&((t=e.prototype)==null?void 0:t.declaredClass)&&e.prototype.declaredClass.indexOf("esri.core.Collection")===0}const GT=()=>_t.getLogger("esri.core.accessorSupport.extensions.serializableProperty.reader");function m$(e,t,i){var r,s;e&&(!i&&!t.read||(r=t.read)!=null&&r.reader||((s=t.read)==null?void 0:s.enabled)===!1||cq(e)&&Ap("read.reader",aA(e),t))}function aA(e){var i,r;const t=e.ndimArray??0;if(t>1)return lq(e);if(t===1)return y$(e);if("type"in e&&g4(e.type)){const s=(r=(i=e.type.prototype)==null?void 0:i.itemType)==null?void 0:r.Type,n=y$(typeof s=="function"?{type:s}:{types:s});return(c,o,f)=>{const g=n(c,o,f);return g&&new e.type(g)}}return lA(e)}function lA(e){return"type"in e?aq(e.type):uq(e.types)}function aq(e){return e.prototype.read?(t,i,r)=>{if(t==null)return t;const s=typeof t;if(s!=="object")return void GT().error(`Expected JSON value of type 'object' to deserialize type '${e.prototype.declaredClass}', but got '${s}'`);const n=new e;return n.read(t,r),n}:e.fromJSON}function y4(e,t,i,r){return r!==0&&Array.isArray(t)?t.map(s=>y4(e,s,i,r-1)):e(t,void 0,i)}function lq(e){const t=lA(e),i=y4.bind(null,t),r=e.ndimArray??0;return(s,n,c)=>{if(s==null)return s;s=i(s,c,r);let o=r,f=s;for(;o>0&&Array.isArray(f);)o--,f=f[0];if(f!==void 0)for(let g=0;g{if(i==null)return i;if(Array.isArray(i)){const c=[];for(const o of i){const f=t(o,void 0,s);f!==void 0&&c.push(f)}return c}const n=t(i,void 0,s);return n!==void 0?[n]:void 0}}function g4(e){if(!m4(e))return!1;const t=e.prototype.itemType;return!(!t||!t.Type)&&(typeof t.Type=="function"?cA(t.Type):_4(t.Type))}function cq(e){return"types"in e?_4(e.types):cA(e.type)}function cA(e){return!Array.isArray(e)&&!!e&&e.prototype&&("read"in e.prototype||"fromJSON"in e||g4(e))}function _4(e){for(const t in e.typeMap)if(!cA(e.typeMap[t]))return!1;return!0}function uq(e){let t=null;const i=e.errorContext??"type",r=e.validate;return(s,n,c)=>{if(s==null)return s;const o=typeof s;if(o!=="object")return void GT().error(`Expected JSON value of type 'object' to deserialize, but got '${o}'`);t||(t=hq(e));const f=e.key;if(typeof f!="string")return;const g=s[f],S=g?t[g]:e.defaultKeyValue?e.typeMap[e.defaultKeyValue]:void 0;if(!S){const A=`Type '${g||"unknown"}' is not supported`;return c!=null&&c.messages&&s&&c.messages.push(new jc(`${i}:unsupported`,A,{definition:s,context:c})),void GT().error(A)}const I=new S;return I.read(s,c),r?r(I):I}}function hq(e){var i,r;const t={};for(const s in e.typeMap){const n=e.typeMap[s],c=p_(n.prototype);if(typeof e.key=="function")continue;const o=c[e.key];if(!o)continue;(i=o.json)!=null&&i.type&&Array.isArray(o.json.type)&&o.json.type.length===1&&typeof o.json.type[0]=="string"&&(t[o.json.type[0]]=n);const f=(r=o.json)==null?void 0:r.write;if(!(f!=null&&f.writer)){t[s]=n;continue}const g=f.target,S=typeof g=="string"?g:e.key,I={};f.writer(s,I,S),I[S]&&(t[I[S]]=n)}return t}function dq(e){if(e.json||(e.json={}),_$(e.json),v$(e.json),g$(e.json),e.json.origins)for(const t in e.json.origins)_$(e.json.origins[t]),v$(e.json.origins[t]),g$(e.json.origins[t]);return!0}function g$(e){e.name&&(e.read&&typeof e.read=="object"?e.read.source===void 0&&(e.read.source=e.name):e.read={source:e.name},e.write&&typeof e.write=="object"?e.write.target===void 0&&(e.write.target=e.name):e.write={target:e.name})}function _$(e){typeof e.read=="boolean"?e.read={enabled:e.read}:typeof e.read=="function"?e.read={enabled:!0,reader:e.read}:e.read&&typeof e.read=="object"&&e.read.enabled===void 0&&(e.read.enabled=!0)}function v$(e){typeof e.write=="boolean"?e.write={enabled:e.write}:typeof e.write=="function"?e.write={enabled:!0,writer:e.write}:e.write&&typeof e.write=="object"&&e.write.enabled===void 0&&(e.write.enabled=!0)}function b$(e,t){if(!t.write||t.write.writer||t.write.enabled===!1&&!t.write.overridePolicy)return;const i=(e==null?void 0:e.ndimArray)??0;e&&(i===1||"type"in e&&m4(e.type))?t.write.writer=mq:i>1?t.write.writer=yq(i):t.types?Array.isArray(t.types)?t.write.writer=fq(t.types[0]):t.write.writer=pq(t.types):t.write.writer=j0}function pq(e){return(t,i,r,s)=>t?v4(t,e,s)?j0(t,i,r,s):void 0:j0(t,i,r,s)}function v4(e,t,i){for(const r in t.typeMap)if(e instanceof t.typeMap[r])return!0;if(i!=null&&i.messages){const r=t.errorContext??"type",s=`Values of type '${(typeof t.key!="function"?e[t.key]:e.declaredClass)??"Unknown"}' cannot be written`;i&&i.messages&&e&&i.messages.push(new Je(`${r}:unsupported`,s,{definition:e,context:i})),_t.getLogger("esri.core.accessorSupport.extensions.serializableProperty.writer").error(s)}return!1}function fq(e){return(t,i,r,s)=>!t||!Array.isArray(t)?j0(t,i,r,s):j0(t.filter(n=>v4(n,e,s)),i,r,s)}function j0(e,t,i,r){Ap(i,rw(e,r),t)}function rw(e,t){return e&&typeof e.write=="function"?e.write({},t):e&&typeof e.toJSON=="function"?e.toJSON():typeof e=="number"?sw(e):e}function sw(e){return e===-1/0?-Number.MAX_VALUE:e===1/0?Number.MAX_VALUE:isNaN(e)?null:e}function mq(e,t,i,r){let s;e===null?s=null:e&&typeof e.map=="function"?(s=e.map(n=>rw(n,r)),typeof s.toArray=="function"&&(s=s.toArray())):s=[rw(e,r)],Ap(i,s,t)}function b4(e,t,i){return i!==0&&Array.isArray(e)?e.map(r=>b4(r,t,i-1)):rw(e,t)}function yq(e){return(t,i,r,s)=>{let n;if(t===null)n=null;else{n=b4(t,s,e);let c=e,o=n;for(;c>0&&Array.isArray(o);)c--,o=o[0];if(o!==void 0)for(let f=0;f{e??(e="esri.core.Accessor"),t.prototype.declaredClass=e,Sq(t);const i=[],r=[];let s=t.prototype;for(;s;)s.hasOwnProperty("initialize")&&!vS.has(s.initialize)&&(vS.add(s.initialize),i.push(s.initialize)),s.hasOwnProperty("destroy")&&!bS.has(s.destroy)&&(bS.add(s.destroy),r.push(s.destroy)),s=Object.getPrototypeOf(s);vS.clear(),bS.clear();const n=class extends t{constructor(...o){if(super(...o),this.constructor===n&&typeof this.postscript=="function"){if(i.length&&Object.defineProperty(this,"initialize",{enumerable:!1,configurable:!0,value(){for(let f=i.length-1;f>=0;f--)i[f].call(this)}}),r.length){let f=!1;const g=this[B5];Object.defineProperty(this,"destroy",{enumerable:!1,configurable:!0,value(){if(!f){f=!0,g.call(this);for(let S=0;S0&&this.normalizeCtorArgs&&(i.ctorArgs=this.normalizeCtorArgs.apply(this,t))}postscript(t){const i=this.__accessor__,r=i.ctorArgs||t;i.initialize(),r&&(this.set(r),i.ctorArgs=null),i.constructed(),this.initialize(),this[WT]=!0}initialize(){}[B5](){this[Eu]=lr(this[Eu])}destroy(){var t;this.destroyed||(zG(this),this.__accessor__.destroy(),(t=cG())==null||t.onInstanceDestroy(this))}[Symbol.dispose](){this.destroy()}get constructed(){return this.__accessor__&&this.__accessor__.initialized||!1}get initialized(){return this[WT]}get destroyed(){var t;return((t=this.__accessor__)==null?void 0:t.lifecycle)===Jn.DESTROYED||!1}commitProperty(t){Va(this,t)}get(t){return z5(_t.getLogger(this),"`Accessor.get` is deprecated in favor of using optional chaining",{version:"4.28",see:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining"}),Va(this,t)}hasOwnProperty(t){return this.__accessor__?this.__accessor__.has(t):Object.prototype.hasOwnProperty.call(this,t)}keys(){return this.__accessor__?this.__accessor__.keys():[]}set(t,i){return Zb(this,t,i),this}watch(t,i,r){return GG(this,t,i,r)}addHandles(t,i){if(this.destroyed){const s=Array.isArray(t)?t:[t];for(const n of s)n.remove();return}let r=this[Eu];r==null&&(r=this[Eu]=new eA),r.add(t,i)}removeHandles(t){const i=this[Eu];i!=null&&i.remove(t)}removeAllHandles(){const t=this[Eu];t!=null&&t.removeAll()}hasHandles(t){const i=this[Eu];return i!=null&&i.has(t)}_override(t,i){i===void 0?this.__accessor__.clearOverride(t):this.__accessor__.override(t,i)}_clearOverride(t){return this.__accessor__.clearOverride(t)}_overrideIfSome(t,i){i==null?this.__accessor__.clearOverride(t):this.__accessor__.override(t,i)}_isOverridden(t){return this.__accessor__.isOverridden(t)}notifyChange(t){this.__accessor__.notifyChange(t)}_get(t){return this.__accessor__.internalGet(t)}_set(t,i){return this.__accessor__.internalSet(t,i),this}};S4=Eu,T4=WT;let Eq=class M4{constructor(){this._values=new Map,this.multipleOriginsSupported=!1}clone(t){const i=new M4;return this._values.forEach((r,s)=>{t&&t.has(s)||i.set(s,He(r.value),r.origin)}),i}get(t,i){i=this._normalizeOrigin(i);const r=this._values.get(t);return i==null||(r==null?void 0:r.origin)===i?r==null?void 0:r.value:void 0}originOf(t){var i;return((i=this._values.get(t))==null?void 0:i.origin)??fi.USER}keys(t){t=this._normalizeOrigin(t);const i=[...this._values.keys()];return t==null?i:i.filter(r=>{var s;return((s=this._values.get(r))==null?void 0:s.origin)===t})}set(t,i,r){if((r=this._normalizeOrigin(r))===fi.DEFAULTS){const s=this._values.get(t);if((s==null?void 0:s.origin)!=null&&s.origin>r)return}this._values.set(t,new Mq(i,r))}delete(t,i){var r;(i=this._normalizeOrigin(i))!=null&&((r=this._values.get(t))==null?void 0:r.origin)!==i||this._values.delete(t)}has(t,i){var r;return(i=this._normalizeOrigin(i))!=null?((r=this._values.get(t))==null?void 0:r.origin)===i:this._values.has(t)}forEach(t){this._values.forEach(({value:i},r)=>t(i,r))}_normalizeOrigin(t){if(t!=null)return t===fi.DEFAULTS?t:fi.USER}},Mq=class{constructor(t,i){this.value=t,this.origin=i}};function I4(e,t,i){t.keys().forEach(s=>{i.set(s,t.get(s),fi.DEFAULTS)});const r=e.metadata;Object.keys(r).forEach(s=>{e.internalGet(s)&&i.set(s,e.internalGet(s),fi.DEFAULTS)})}function Iq(e,t,i){if(!(e!=null&&e.read)||e.read.enabled===!1||!e.read.source)return!1;const r=e.read.source;if(typeof r=="string"){if(r===t||r.includes(".")&&r.indexOf(t)===0&&t$(r,i))return!0}else for(const s of r)if(s===t||s.includes(".")&&s.indexOf(t)===0&&t$(s,i))return!0;return!1}function Aq(e){return e&&(!e.read||e.read.enabled!==!1&&!e.read.source)}function Pq(e,t,i,r,s){let n=qT(t[i],s);Aq(n)&&(e[i]=!0);for(const c of Object.getOwnPropertyNames(t))n=qT(t[c],s),Iq(n,i,r)&&(e[c]=!0)}function Cq(e,t,i,r){const s=i.metadata,n=gq(s[t],r),c=n==null?void 0:n.default;if(c===void 0)return;const o=typeof c=="function"?c.call(e,t,r):c;o!==void 0&&i.set(t,o)}const A4={origin:"service"};function P4(e,t,i=A4){if(!t||typeof t!="object")return;const r=To(e),s=r.metadata,n={};for(const c of Object.getOwnPropertyNames(t))Pq(n,s,c,t,i);r.setDefaultOrigin(i.origin);for(const c of Object.getOwnPropertyNames(n)){const o=qT(s[c],i).read,f=o==null?void 0:o.source;let g;g=f&&typeof f=="string"?d_(t,f):t[c],o!=null&&o.reader&&(g=o.reader.call(e,g,t,i)),g!==void 0&&r.set(c,g)}if(!i||!i.ignoreDefaults){r.setDefaultOrigin("defaults");for(const c of Object.getOwnPropertyNames(s))n[c]||Cq(e,c,r,i)}r.setDefaultOrigin("user")}function $q(e,t,i,r=A4){var n;const s={...r,messages:[]};i(s),(n=s.messages)==null||n.forEach(c=>{c.type!=="warning"||e.loaded?r!=null&&r.messages&&r.messages.push(c):e.loadWarnings.push(c)})}function kq(e,t,i,r,s){var c,o;const n={};return(o=(c=t.write)==null?void 0:c.writer)==null||o.call(e,r,n,i,s),n}function C4(e,t,i,r,s,n){if(!(r!=null&&r.write))return!1;const c=Va(e,i);if(!s&&r.write.overridePolicy){const o=r.write.overridePolicy.call(e,c,i,n??void 0);o!==void 0&&(s=o)}if(s||(s=r.write),!s||s.enabled===!1||s.layerContainerTypes&&(n!=null&&n.layerContainerType)&&!s.layerContainerTypes.includes(n.layerContainerType))return!1;if((c===null&&!s.allowNull&&!s.writerEnsuresNonNull||c===void 0)&&s.isRequired){const o=new Je("web-document-write:property-required",`Missing value for required property '${i}' on '${e.declaredClass}'`,{propertyName:i,target:e});return o&&(n!=null&&n.messages)?n.messages.push(o):o&&!n&&_t.getLogger("esri.core.accessorSupport.write").error(o.name,o.message),!1}return!(c===void 0||c===null&&!s.allowNull&&!s.writerEnsuresNonNull||!s.alwaysWriteDefaults&&(!t.store.multipleOriginsSupported||t.store.originOf(i)===fi.DEFAULTS)&&Rq(e,i,n,r,c)||!s.ignoreOrigin&&(n!=null&&n.origin)&&t.store.multipleOriginsSupported&&t.store.originOf(i)0&&(t=Uv(t,S),(c=(n=i==null?void 0:i.resources)==null?void 0:n.pendingOperations)!=null&&c.length&&i.resources.pendingOperations.push(Promise.all(i.resources.pendingOperations).then(()=>Uv(t,S,()=>"replace-arrays"))),i!=null&&i.writtenProperties&&i.writtenProperties.push({target:e,propName:o,oldOrigin:Q7(r.store.originOf(o)),newOrigin:i.origin}))}return t}const y_=e=>{let t=class extends e{constructor(...i){super(...i);const r=To(this),s=r.store,n=new Eq;r.store=n,I4(r,s,n)}read(i,r){P4(this,i,r)}write(i,r){return $4(this,i??{},r)}toJSON(i){return this.write({},i)}static fromJSON(i,r){return Lq.call(this,i,r)}};return t=v([fe("esri.core.JSONSupport")],t),t.prototype.toJSON.isDefaultToJSON=!0,t};function Lq(e,t){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");const i=new this;return i.read(e,t),i}function ZT(e){return e&&typeof e=="object"&&"toJSON"in e&&typeof e.toJSON=="function"}let At=class extends y_(Nt){};At=v([fe("esri.core.JSONSupport")],At);const Dq=/^https:\/\/([a-z\d-]+)(\.maps([^.]*))?\.arcgis\.com/i,Nq={devext:{customBaseUrl:"mapsdevext.arcgis.com",portalHostname:"devext.arcgis.com"},qaext:{customBaseUrl:"mapsqa.arcgis.com",portalHostname:"qaext.arcgis.com"},www:{customBaseUrl:"maps.arcgis.com",portalHostname:"www.arcgis.com"}};function YT(e){const t=e==null?void 0:e.match(Dq);if(!t)return null;const[,i,r,s]=t;if(!i)return null;let n=null,c=null,o=null;const{devext:f,qaext:g,www:S}=Nq;if(r)if(n=i,s)switch(s.toLowerCase()){case"devext":({customBaseUrl:c,portalHostname:o}=f);break;case"qa":({customBaseUrl:c,portalHostname:o}=g);break;default:return null}else({customBaseUrl:c,portalHostname:o}=S);else switch(i.toLowerCase()){case"devext":({customBaseUrl:c,portalHostname:o}=f);break;case"qaext":({customBaseUrl:c,portalHostname:o}=g);break;case"www":({customBaseUrl:c,portalHostname:o}=S);break;default:return null}return{customBaseUrl:c,isPortal:!1,portalHostname:o,urlKey:n}}function zq(e){return/\/(sharing|usrsvcs)\/(appservices|servers)\//i.test(e)}function Fq(e){const t=atob(e),i=new Uint8Array(t.length);for(let r=0;r_t.getLogger("esri.core.urlUtils"),Gm=Ci.request,w$="esri/config: esriConfig.request.proxyUrl is not set.",k4=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,R4=/^\s*http:/i,jq=/^\s*https:/i,Vq=/^\s*file:/i,Gq=/:\d+$/,qq=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,Hq=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),Wq=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");let fm=class{constructor(t=""){this.uri=t,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let i=this.uri.match(Hq);this.scheme=i[2]||(i[1]?"":null),this.authority=i[4]||(i[3]?"":null),this.path=i[5],this.query=i[7]||(i[6]?"":null),this.fragment=i[9]||(i[8]?"":null),this.authority!=null&&(i=this.authority.match(Wq),this.user=i[3]||null,this.password=i[4]||null,this.host=i[6]||i[7],this.port=i[9]||null)}toString(){return this.uri}};const Y1={},Zq=new fm(Ci.applicationUrl);let mn=Zq;const Yq=Jq();let hA=Yq;const dA=()=>mn,O4=()=>hA;function Jq(){const e=mn.path,t=e.substring(0,e.lastIndexOf(e.split("/")[e.split("/").length-1]));return`${`${mn.scheme}://${mn.host}${mn.port!=null?`:${mn.port}`:""}`}${t}`}function Rr(e){if(!e)return null;const t={path:null,query:null},i=new fm(e),r=e.indexOf("?");return i.query===null?t.path=e:(t.path=e.substring(0,r),t.query=pA(i.query)),i.fragment&&(t.hash=i.fragment,i.query===null&&(t.path=t.path.substring(0,t.path.length-(i.fragment.length+1)))),t}function pA(e){const t=e.split("&"),i={};for(const r of t){if(!r)continue;const s=r.indexOf("=");let n,c;s<0?(n=decodeURIComponent(r),c=""):(n=decodeURIComponent(r.slice(0,s)),c=decodeURIComponent(r.slice(s+1)));let o=i[n];typeof o=="string"&&(o=i[n]=[o]),Array.isArray(o)?o.push(c):i[n]=c}return i}function pp(e,t){return e?t&&typeof t=="function"?Object.keys(e).map(i=>encodeURIComponent(i)+"="+encodeURIComponent(t(i,e[i]))).join("&"):Object.keys(e).map(i=>{const r=e[i];if(r==null)return"";const s=encodeURIComponent(i)+"=",n=t==null?void 0:t[i];return n?s+encodeURIComponent(n(r)):Array.isArray(r)?r.map(c=>ZT(c)?s+encodeURIComponent(JSON.stringify(c)):s+encodeURIComponent(c)).join("&"):ZT(r)?s+encodeURIComponent(JSON.stringify(r)):s+encodeURIComponent(r)}).filter(i=>i).join("&"):""}function Kq(e=!1){let t,i=Gm.proxyUrl;if(typeof e=="string"){t=sH(e);const r=mx(e);r&&(i=r.proxyUrl)}else t=!!e;if(!i)throw Uq().warn(w$),new Je("urlUtils:proxy-not-set",w$);return t&&JT()&&(i=_A(i)),Rr(i)}function Sye(e){const t=mx(e);let i,r;if(t){const s=fA(t.proxyUrl);i=s.path,r=s.query?pA(s.query):null}if(i){const s=Rr(e);e=i+"?"+s.path;const n=pp({...r,...s.query});n&&(e=`${e}?${n}`)}return e}const lg={path:"",query:""};function fA(e){const t=e.indexOf("?");return t!==-1?(lg.path=e.slice(0,t),lg.query=e.slice(t+1)):(lg.path=e,lg.query=null),lg}function L4(e){return e=(e=ow(e=uH(e=fA(e).path),!0)).toLowerCase()}function Xq(e){const t={proxyUrl:e.proxyUrl,urlPrefix:L4(e.urlPrefix)},i=Gm.proxyRules,r=t.urlPrefix;let s=i.length;for(let n=0;n0?e.substring(0,t):e.replace(/\/+$/,"")}function N4(e){const t=r=>r==null||r instanceof RegExp&&r.test(e)||typeof r=="string"&&e.startsWith(r),i=Gm.interceptors;if(i){for(const r of i)if(Array.isArray(r.urls)){if(r.urls.some(t))return r}else if(t(r.urls))return r}return null}function Im(e,t,i=!1){if(!e||!t)return!1;const r=XT(e),s=XT(t);return!(!i&&r.scheme!==s.scheme)&&r.host!=null&&s.host!=null&&r.host.toLowerCase()===s.host.toLowerCase()&&r.port===s.port}function mA(e){if(typeof e=="string"){if(!zn(e))return!0;e=XT(e)}if(Im(e,mn))return!0;const t=Gm.trustedServers||[];for(let i=0;i(O=I.indexOf(A,O))===-1?I.length:O;let f=o(s,"/",s.indexOf("//")+2),g=-1;for(;s.slice(0,f+1)===n.slice(0,f)+"/"&&(g=f+1,f!==s.length);)f=o(s,"/",f+1);if(g===-1||c&&g0)for(let I=0;In?s.concat(n.split("/")):s,[]);for(let s=0;s0&&i[i.length-1]!==".."?i.pop():(!n&&s===r.length-1||n&&(n!=="."||i.length===0))&&i.push(n)}return i.join("/")}function Ga(e,t=!1){if(e==null||yx(e)||Cp(e))return null;let i=e.indexOf("://");if(i===-1&&na(e))i=2;else{if(i===-1)return null;i+=3}const r=e.indexOf("/",i);return r!==-1&&(e=e.slice(0,r)),t&&(e=ow(e,!0)),e}function zn(e){return na(e)||gA(e)}function yx(e){return e!=null&&e.slice(0,5)==="blob:"}function Cp(e){return e!=null&&e.slice(0,5)==="data:"}function tH(e){const t=V0(e);return t&&t.isBase64?Fq(t.data):null}function Tye(e){return Bq(e).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}const iH=/^data:(.*?)(;base64)?,(.*)$/;function V0(e){const t=e.match(iH);if(!t)return null;const[,i,r,s]=t;return{mediaType:i,isBase64:!!r,data:s}}function z4(e){return e.isBase64?`data:${e.mediaType};base64,${e.data}`:`data:${e.mediaType},${e.data}`}async function Eye(e){return(await fetch(e)).blob()}function Mye(e){const t=tH(e);if(!t)return null;const i=V0(e);return new Blob([t],{type:i.mediaType})}function Iye(e,t){rH(e,t)}function rH(e,t){if(!e)return!1;const i=document.createElement("a");if(!("download"in i))return!1;const r=URL.createObjectURL(e);return i.download=t,i.href=r,i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r),!0}function na(e){return e!=null&&e[0]==="/"&&e[1]==="/"}function gA(e){return e!=null&&k4.test(e)}function sH(e){return e!=null&&jq.test(e)||mn.scheme==="https"&&na(e)}function nH(e){return e!=null&&R4.test(e)||mn.scheme==="http"&&na(e)}function oH(e){return e!=null&&Vq.test(e)}function _A(e){return na(e)?`https:${e}`:e.replace(R4,"https:")}function aH(){return mn.scheme==="http"}function JT(){return mn.scheme==="https"}function ow(e,t=!1){return na(e)?e.slice(2):(e=e.replace(k4,""),t&&e.length>1&&e[0]==="/"&&e[1]==="/"&&(e=e.slice(2)),e)}function lH(e){const t=e.indexOf("//"),i=e.indexOf("/",t+2);return i===-1?e:e.slice(0,i)}function cH(e){let t=0;if(zn(e)){const r=e.indexOf("//");r!==-1&&(t=r+2)}const i=e.lastIndexOf("/");return ir===s||r.endsWith(`.${s}`))||JT()&&!mx(e))&&(e=_A(e)),e}function KT(e,t,i){if(!(t&&i&&e&&zn(e)))return e;const r=e.indexOf("//"),s=e.indexOf("/",r+2),n=e.indexOf(":",r+2),c=Math.min(s<0?e.length:s,n<0?e.length:n);return e.slice(r+2,c).toLowerCase()!==t.toLowerCase()?e:`${e.slice(0,r+2)}${i}${e.slice(c)}`}function XT(e){return typeof e=="string"?new fm(Xo(e)):(e.scheme||(e.scheme=mn.scheme),e)}function Pye(e){return mH.test(e)}function F4(e,t){const i=Rr(e),r=Object.keys(i.query||{});return r.length>0&&t&&t.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${r.join(", ")}.`),i.path}function fH(e,t,i){const r=Rr(e),s=r.query||{};return s[t]=String(i),`${r.path}?${pp(s)}`}function Pl(e,t){if(!t)return e;const i=Rr(e),r=i.query||{};for(const[n,c]of Object.entries(t))c!=null&&(r[n]=c);const s=pp(r);return s?`${i.path}?${s}`:i.path}function Cye(e){if(e==null)return null;const t=e.match(B4);return t?t[2]:null}function x$(e){if(e==null)return null;const t=e.match(B4);return t?{path:t[1],extension:t[2]}:{path:e,extension:null}}async function $ye(e){return typeof e=="string"?V0(e)??{data:e}:new Promise((t,i)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(V0(r.result)),r.onerror=s=>i(s)})}const B4=/([^.]*)\.([^\/]*)$/,mH=/(^data:image\/svg|\.svg$)/i,U4="20240321",j4="9cf5a4b8555fda94595b625a40b922e012baf071";Symbol.dispose??(Symbol.dispose=Symbol("Symbol.dispose")),Symbol.asyncDispose??(Symbol.asyncDispose=Symbol("Symbol.asyncDispose"));const yH="4.29";let bi,vA=yH;vA="4.29.10";function kye(e){bi=e}function Rye(e){const t=bi==null?void 0:bi.findCredential(e);return t!=null&&t.token?fH(e,"token",t.token):e}Le("host-webworker");const gH=new Set(["elevation3d.arcgis.com","js.arcgis.com","jsdev.arcgis.com","jsqa.arcgis.com","static.arcgis.com"]);function V4(e){const t=Ga(e,!0);return!!t&&t.endsWith(".arcgis.com")&&!gH.has(t)&&!e.endsWith("/sharing/rest/generateToken")}function _H(e,t,i=!1,r){return new Promise((s,n)=>{if(ra(r))return void n(S$());let c=()=>{g(),n(new Error(`Unable to load ${t}`))},o=()=>{const S=e;g(),s(S)},f=()=>{if(!e)return;const S=e;g(),S.src="",n(S$())};const g=()=>{Le("esri-image-decode")||(e.removeEventListener("error",c),e.removeEventListener("load",o)),c=null,o=null,e=null,r!=null&&r.removeEventListener("abort",f),f=null,i&&URL.revokeObjectURL(t)};r!=null&&r.addEventListener("abort",f),Le("esri-image-decode")?e.decode().then(o,c):(e.addEventListener("error",c),e.addEventListener("load",o))})}function S$(){try{return new DOMException("Aborted","AbortError")}catch{const e=new Error;return e.name="AbortError",e}}const vH="Timeout exceeded";function bH(){return new Error(vH)}function wH(e){Ci.request.crossOriginNoCorsDomains||(Ci.request.crossOriginNoCorsDomains={});const t=Ci.request.crossOriginNoCorsDomains;for(let i of e)i=i.toLowerCase(),/^https?:\/\//.test(i)?t[Ga(i)??""]=0:(t[Ga("http://"+i)??""]=0,t[Ga("https://"+i)??""]=0)}function xH(e){const t=Ci.request.crossOriginNoCorsDomains;if(t){let i=Ga(e);if(i)return i=i.toLowerCase(),!Im(i,dA())&&t[i]c.abort());const o={controller:c,credential:void 0,credentialToken:void 0,fetchOptions:void 0,hasToken:!1,interceptor:n,params:s,redoRequest:!1,useIdentity:Oa.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},f=await RH(o);return(g=n==null?void 0:n.after)==null||g.call(n,f),f}let aw;const Oa=Ci.request,G4="FormData"in globalThis,TH=new Set([499,498,403,401]),EH=new Set(["COM_0056","COM_0057","SB_0008"]),MH=[/\/arcgis\/tokens/i,/\/sharing(\/rest)?\/generatetoken/i,/\/rest\/info/i],Am=()=>null,lw=Symbol();function IH(e){const t=Ga(e);t&&!Qi._corsServers.includes(t)&&Qi._corsServers.push(t)}function T$(e){const t=Ga(e);return!t||t.endsWith(".arcgis.com")||Qi._corsServers.includes(t)||mA(t)}function Cl(e,t,i,r){let s="Error";const n={url:i.url,requestOptions:i.requestOptions,getAllHeaders:Am,getHeader:Am,ssl:!1};if(t instanceof Je)return t.details?(t.details=He(t.details),t.details.url=i.url,t.details.requestOptions=i.requestOptions):t.details=n,t;if(t){const c=r&&(()=>Array.from(r.headers)),o=r&&(S=>r.headers.get(S)),f=r==null?void 0:r.status,g=t.message;g&&(s=g),c&&o&&(n.getAllHeaders=c,n.getHeader=o),n.httpStatus=(t.httpCode!=null?t.httpCode:t.code)||f||0,n.subCode=t.subcode,n.messageCode=t.messageCode,typeof t.details=="string"?n.messages=[t.details]:n.messages=t.details,n.raw=lw in t?t[lw]:t}return Ys(t)?jr():new Je(e,s,n)}async function AH(){Le("host-webworker")&&!aw&&(aw=await ht(()=>import("./request-DxtPt6s5.js"),[]))}async function QT(){bi||await ht(()=>import("./IdentityManager-DBFJchIs.js"),__vite__mapDeps([0,1]))}async function PH(e){var o;const t=e.params.url,i=e.params.requestOptions,r=e.controller.signal,s=i.body;let n=null,c=null;if(G4&&"HTMLFormElement"in globalThis&&(s instanceof FormData?n=s:s instanceof HTMLFormElement&&(n=new FormData(s))),typeof s=="string"&&(c=s),e.fetchOptions={cache:i.cacheBust?"no-cache":"default",credentials:"same-origin",headers:i.headers||{},method:i.method==="head"?"HEAD":"GET",mode:"cors",priority:Oa.priority,redirect:"follow",signal:r},(n||c)&&(e.fetchOptions.body=n||c),i.authMode==="anonymous"&&(e.useIdentity=!1),e.hasToken=!!(/token=/i.test(t)||(o=i.query)!=null&&o.token||n!=null&&n.get("token")),!e.hasToken&&Ci.apiKey&&V4(t)&&(i.query||(i.query={}),i.query.token=Ci.apiKey,e.hasToken=!0),e.useIdentity&&!e.hasToken&&!e.credentialToken&&!q4(t)&&!ra(r)){let f;i.authMode==="immediate"?(await QT(),f=await bi.getCredential(t,{signal:r}),e.credential=f):i.authMode==="no-prompt"?(await QT(),f=await bi.getCredential(t,{prompt:!1,signal:r}).catch(()=>{}),e.credential=f):bi&&(f=bi.findCredential(t)),f&&(e.credentialToken=f.token,e.useSSL=!!f.ssl)}}function q4(e){return MH.some(t=>t.test(e))}async function CH(e){let t=e.params.url;const i=e.params.requestOptions,r=e.fetchOptions??{},s=yx(t)||Cp(t),n=i.responseType||"json",c=s?0:i.timeout!=null?i.timeout:Oa.timeout;let o=!1;if(!s){e.useSSL&&(t=_A(t));let A={...i.query};e.credentialToken&&(A.token=e.credentialToken);let O=pp(A);Le("esri-url-encodes-apostrophe")&&(O=O.replaceAll("'","%27"));const z=t.length+1+O.length;let V;o=i.method==="delete"||i.method==="post"||i.method==="put"||!!i.body||z>Oa.maxUrlLength;const H=i.useProxy||!!mx(t);if(H){const Q=Kq(t);V=Q.path,!o&&V.length+1+z>Oa.maxUrlLength&&(o=!0),Q.query&&(A={...Q.query,...A})}if(r.method==="HEAD"&&(o||H)){if(o)throw z>Oa.maxUrlLength?Cl("request:invalid-parameters",new Error("URL exceeds maximum length"),e.params):Cl("request:invalid-parameters",new Error("cannot use POST request when method is 'head'"),e.params);if(H)throw Cl("request:invalid-parameters",new Error("cannot use proxy when method is 'head'"),e.params)}if(o?(r.method=i.method==="delete"?"DELETE":i.method==="put"?"PUT":"POST",i.body?t=Pl(t,A):(r.body=pp(A),r.headers||(r.headers={}),r.headers["Content-Type"]="application/x-www-form-urlencoded")):t=Pl(t,A),H&&(e.useProxy=!0,t=`${V}?${t}`),A.token&&G4&&r.body instanceof FormData&&!zq(t)&&r.body.set("token",A.token),i.hasOwnProperty("withCredentials"))e.withCredentials=i.withCredentials;else if(!Im(t,dA())){if(mA(t))e.withCredentials=!0;else if(bi){const Q=bi.findServerInfo(t);Q!=null&&Q.webTierAuth&&(e.withCredentials=!0)}}e.withCredentials&&(r.credentials="include",xH(t)&&await SH(o?Pl(t,A):t))}let f,g,S=0,I=!1;c>0&&(S=setTimeout(()=>{I=!0,e.controller.abort()},c));try{if(i.responseType==="native-request-init")g=r,g.url=t;else if(i.responseType!=="image"||r.cache!=="default"||r.method!=="GET"||o||kH(i.headers)||!s&&!e.useProxy&&Oa.proxyUrl&&!T$(t)){if(Qi._beforeFetch&&await Qi._beforeFetch(t,r),f=await fetch(t,r),Qi._afterFetch&&await Qi._afterFetch(f),e.useProxy||IH(t),i.responseType==="native")g=f;else if(r.method!=="HEAD")if(f.ok){switch(n){case"array-buffer":g=await f.arrayBuffer();break;case"blob":case"image":g=await f.blob();break;default:g=await f.text()}if(S&&(clearTimeout(S),S=0),n==="json"||n==="xml"||n==="document")if(g)switch(n){case"json":g=JSON.parse(g);break;case"xml":g=E$(g,"application/xml");break;case"document":g=E$(g,"text/html")}else g=null;if(g){if(n==="array-buffer"||n==="blob"){const A=f.headers.get("Content-Type");if(A&&/application\/json|text\/plain/i.test(A)&&g[n==="blob"?"size":"byteLength"]<=750)try{const O=await new Response(g).json();O.error&&(g=O)}catch{}}n==="image"&&g instanceof Blob&&(g=await M$(URL.createObjectURL(g),e,!0))}}else{g=await f.text();try{g=JSON.parse(g)}catch{}}}else g=await M$(t,e)}catch(A){if(A.name==="AbortError")throw I?bH():jr("Request canceled");if(!(!f&&A instanceof TypeError&&Oa.proxyUrl)||i.body||i.method==="delete"||i.method==="head"||i.method==="post"||i.method==="put"||e.useProxy||T$(t))throw A;e.redoRequest=!0,Xq({proxyUrl:Oa.proxyUrl,urlPrefix:Ga(t)??""})}finally{S&&clearTimeout(S)}return[f,g]}async function $H(e,t){if(e.responseData!=null)return e.responseData;if(e.headers&&(t.requestOptions.headers={...t.requestOptions.headers,...e.headers}),e.query&&(t.requestOptions.query={...t.requestOptions.query,...e.query}),e.before){let i,r;try{r=await e.before(t)}catch(s){i=Cl("request:interceptor",s,t)}if((r instanceof Error||r instanceof Je)&&(i=Cl("request:interceptor",r,t)),i)throw e.error&&e.error(i),i;return r}}function kH(e){if(e){for(const t of Object.getOwnPropertyNames(e))if(e[t])return!0}return!1}function E$(e,t){let i;try{i=new DOMParser().parseFromString(e,t)}catch{}if(!i||i.getElementsByTagName("parsererror").length)throw new SyntaxError("XML Parse error");return i}async function RH(e){var n,c;let t,i;await PH(e);try{do[t,i]=await CH(e);while(!await OH(e,t,i))}catch(o){const f=Cl("request:server",o,e.params,t);throw f.details.ssl=e.useSSL,(n=e.interceptor)!=null&&n.error&&e.interceptor.error(f),f}const r=e.params.url;if(i&&/\/sharing\/rest\/(accounts|portals)\/self/i.test(r)){if(!e.hasToken&&!e.credentialToken&&((c=i.user)!=null&&c.username)&&!mA(r)){const o=Ga(r,!0);o&&Oa.trustedServers.push(o)}Array.isArray(i.authorizedCrossOriginNoCorsDomains)&&wH(i.authorizedCrossOriginNoCorsDomains)}const s=e.credential;if(s&&bi){const o=bi.findServerInfo(s.server);let f=o==null?void 0:o.owningSystemUrl;if(f){f=f.replace(/\/?$/,"/sharing");const g=bi.findCredential(f,s.userId);g&&bi._getIdenticalSvcIdx(f,g)===-1&&g.resources.unshift(f)}}return{data:i,getAllHeaders:t?()=>Array.from(t.headers):Am,getHeader:t?o=>t.headers.get(o):Am,httpStatus:(t==null?void 0:t.status)??200,requestOptions:e.params.requestOptions,ssl:e.useSSL,url:e.params.url}}async function OH(e,t,i){var g;if(e.redoRequest)return e.redoRequest=!1,!1;const r=e.params.requestOptions;if(!t||r.responseType==="native"||r.responseType==="native-request-init")return!0;let s,n;if(i&&(i.error?s=i.error:i.status==="error"&&Array.isArray(i.messages)&&(s={...i},s[lw]=i,s.details=i.messages)),!s&&!t.ok)throw s=new Error(`Unable to load ${t.url} status: ${t.status}`),s[lw]=i,s;let c,o=null;s&&(n=Number(s.code),o=s.hasOwnProperty("subcode")?Number(s.subcode):null,c=s.messageCode,c=c==null?void 0:c.toUpperCase());const f=r.authMode;if(n===403&&(o===4||(g=s.message)!=null&&g.toLowerCase().includes("ssl")&&!s.message.toLowerCase().includes("permission"))){if(!e.useSSL)return e.useSSL=!0,!1}else if(!e.hasToken&&e.useIdentity&&(f!=="no-prompt"||n===498)&&n!==void 0&&TH.has(n)&&!q4(e.params.url)&&(n!==403||(!c||!EH.has(c))&&(o==null||o===2&&e.credentialToken))){await QT();try{const S=await bi.getCredential(e.params.url,{error:Cl("request:server",s,e.params),prompt:f!=="no-prompt",signal:e.controller.signal,token:e.credentialToken});return e.credential=S,e.credentialToken=S.token,e.useSSL=e.useSSL||S.ssl,!1}catch(S){if(f==="no-prompt")return e.credential=void 0,e.credentialToken=void 0,!1;s=S}}if(s)throw s;return!0}function M$(e,t,i=!1){const r=t.controller.signal,s=new Image;return t.withCredentials?s.crossOrigin="use-credentials":s.crossOrigin="anonymous",s.alt="",s.fetchPriority=Oa.priority,s.src=e,_H(s,e,i,r)}Qi._corsServers=["https://server.arcgisonline.com","https://services.arcgisonline.com"],Qi._beforeFetch=void 0,Qi._afterFetch=void 0;let qv=class H4{constructor(){this._emitter=new H4.EventEmitter(this)}emit(t,i){return this._emitter.emit(t,i)}on(t,i){return this._emitter.on(t,i)}once(t,i){return this._emitter.once(t,i)}hasEventListener(t){return this._emitter.hasEventListener(t)}};(function(e){class t{constructor(s=null){this._target=s,this._listenersMap=null}clear(){var s;(s=this._listenersMap)==null||s.clear(),this._listenersMap=null}destroy(){this.clear()}emit(s,n){var g;let c=(g=this._listenersMap)==null?void 0:g.get(s);if(!c)return!1;const o=this._target||this;let f=!1;for(const S of c.slice()){const I="deref"in S?S.deref():S;I?I==null||I.call(o,n):f=!0}return f&&(c=c.filter(S=>!("deref"in S)||S.deref()!=null),this._listenersMap.set(s,c)),c.length>0}on(s,n){if(Array.isArray(s)){const o=s.map(f=>this.on(f,n));return h_(o)}if(s.includes(","))throw new TypeError("Evented.on() with a comma delimited string of event types is not supported");this._listenersMap??(this._listenersMap=new Map);const c=this._listenersMap.get(s)||[];return c.push(n),this._listenersMap.set(s,c),er(()=>{var g;const o=(g=this._listenersMap)==null?void 0:g.get(s),f=(o==null?void 0:o.indexOf(n))??-1;f>=0&&o.splice(f,1)})}once(s,n){const c=this.on(s,o=>{c.remove();const f="deref"in n?n.deref():n;f==null||f.call(null,o)});return c}hasEventListener(s){var c;const n=(c=this._listenersMap)==null?void 0:c.get(s);return n!=null&&n.length>0}}e.EventEmitter=t,e.EventedMixin=r=>{let s=class extends r{constructor(){super(...arguments),this._emitter=new t}destroy(){this._emitter.clear()}emit(n,c){return this._emitter.emit(n,c)}on(n,c){return this._emitter.on(n,c)}once(n,c){return this._emitter.once(n,c)}hasEventListener(n){return this._emitter.hasEventListener(n)}};return s=v([fe("esri.core.Evented")],s),s};let i=class extends Nt{constructor(){super(...arguments),this._emitter=new qv.EventEmitter(this)}destroy(){this._emitter.clear()}emit(r,s){return this._emitter.emit(r,s)}on(r,s){return this._emitter.on(r,s)}once(r,s){return this._emitter.once(r,s)}hasEventListener(r){return this._emitter.hasEventListener(r)}};i=v([fe("esri.core.Evented")],i),e.EventedAccessor=i})(qv||(qv={}));const Sh=qv;var ki;(function(e){e[e.ADD=1]="ADD",e[e.REMOVE=2]="REMOVE",e[e.MOVE=4]="MOVE"})(ki||(ki={}));function W4(e){return(t,i)=>{t[i]=e}}let g_=class extends q5{notify(){const t=this._observers;if(t&&t.length>0){const i=t.slice();for(const r of i)r.onInvalidated(),r.onCommitted()}}};var $c;let LH=class{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(t){this.defaultPrevented=!1,this.item=t}},DH=class{constructor(t,i,r,s,n){this.target=t,this.added=i,this.removed=r,this.start=s,this.deleteCount=n}};const Fo=new Pp(LH,void 0,e=>{e.item=null,e.target=null,e.defaultPrevented=!1,e.cancellable=!1});function wS(e){return e?e instanceof Ac?e.toArray():e.length?Array.prototype.slice.apply(e):[]:[]}function xS(e){if(e!=null&&e.length)return e[0]}function NH(e,t,i,r){const s=Math.min(e.length-i,t.length-r);let n=0;for(;n{e.push(s),Z4(e,i.call(r,s,n,c),i,r)})}const yu=new Set,gu=new Set,_u=new Set,SS=new Map;let zH=0,Ac=$c=class extends Sh.EventedAccessor{static isCollection(e){return e!=null&&e instanceof $c}constructor(e){super(e),this._chgListeners=[],this._notifications=null,this._updating=!1,this._timer=null,this._observable=new g_,this.length=0,this._items=[],Object.defineProperty(this,"uid",{value:zH++})}normalizeCtorArgs(e){return e?Array.isArray(e)||e instanceof $c?{items:e}:e:{}}destroy(){this._removeAllRaw()}*[Symbol.iterator](){yield*this.items}get items(){return Rt(this._observable),this._items}set items(e){this._emitBeforeChanges(ki.ADD)||(this._splice(0,this.length,wS(e)),this._emitAfterChanges(ki.ADD))}hasEventListener(e){return e==="change"?this._chgListeners.length>0:this._emitter.hasEventListener(e)}on(e,t){if(e==="change"){const i=this._chgListeners,r={removed:!1,callback:t};return i.push(r),this._notifications&&this._notifications.push({listeners:i.slice(),items:this._items.slice(),changes:[]}),er(()=>{r.removed=!0,i.splice(i.indexOf(r),1)})}return this._emitter.on(e,t)}once(e,t){const i="deref"in t?()=>t.deref():()=>t,r=this.on(e,s=>{var n;(n=i())==null||n.call(null,s),r.remove()});return r}add(e,t){if(Rt(this._observable),this._emitBeforeChanges(ki.ADD))return this;const i=this.getNextIndex(t??null);return this._splice(i,0,[e]),this._emitAfterChanges(ki.ADD),this}addMany(e,t=this._items.length){if(Rt(this._observable),!(e!=null&&e.length))return this;if(this._emitBeforeChanges(ki.ADD))return this;const i=this.getNextIndex(t);return this._splice(i,0,wS(e)),this._emitAfterChanges(ki.ADD),this}at(e){if(Rt(this._observable),(e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this._items[e]}removeAll(){if(Rt(this._observable),!this.length||this._emitBeforeChanges(ki.REMOVE))return[];const e=this._removeAllRaw();return this._emitAfterChanges(ki.REMOVE),e}_removeAllRaw(){return this.length===0?[]:this._splice(0,this.length)||[]}clone(){return Rt(this._observable),this._createNewInstance({items:this._items.map(He)})}concat(...e){Rt(this._observable);const t=e.map(wS);return this._createNewInstance({items:this._items.concat(...t)})}drain(e,t){if(Rt(this._observable),!this.length||this._emitBeforeChanges(ki.REMOVE))return;const i=this._splice(0,this.length),r=i.length;for(let s=0;st&&(e=t),e}includes(e,t=0){return Rt(this._observable),this._items.includes(e,t)}indexOf(e,t=0){return Rt(this._observable),this._items.indexOf(e,t)}join(e=","){return Rt(this._observable),this._items.join(e)}lastIndexOf(e,t=this.length-1){return Rt(this._observable),this._items.lastIndexOf(e,t)}map(e,t){Rt(this._observable);const i=this._items.map(e,t);return new $c({items:i})}reorder(e,t=this.length-1){Rt(this._observable);const i=this.indexOf(e);if(i!==-1){if(t<0?t=0:t>=this.length&&(t=this.length-1),i!==t){if(this._emitBeforeChanges(ki.MOVE))return e;this._splice(i,1),this._splice(t,0,[e]),this._emitAfterChanges(ki.MOVE)}return e}}pop(){if(Rt(this._observable),!this.length||this._emitBeforeChanges(ki.REMOVE))return;const e=xS(this._splice(this.length-1,1));return this._emitAfterChanges(ki.REMOVE),e}push(...e){return Rt(this._observable),this._emitBeforeChanges(ki.ADD)||(this._splice(this.length,0,e),this._emitAfterChanges(ki.ADD)),this.length}reduce(e,t){Rt(this._observable);const i=this._items;return arguments.length===2?i.reduce(e,t):i.reduce(e)}reduceRight(e,t){Rt(this._observable);const i=this._items;return arguments.length===2?i.reduceRight(e,t):i.reduceRight(e)}remove(e){return Rt(this._observable),this.removeAt(this.indexOf(e))}removeAt(e){if(Rt(this._observable),e<0||e>=this.length||this._emitBeforeChanges(ki.REMOVE))return;const t=xS(this._splice(e,1));return this._emitAfterChanges(ki.REMOVE),t}removeMany(e){if(Rt(this._observable),!(e!=null&&e.length)||this._emitBeforeChanges(ki.REMOVE))return[];const t=e instanceof $c?e.toArray():e,i=this._items,r=[],s=t.length;for(let n=0;n-1){const f=1+NH(t,i,n+1,o+1),g=this._splice(o,f);g&&g.length>0&&r.push.apply(r,g),n+=f-1}}return this._emitAfterChanges(ki.REMOVE),r}reverse(){if(Rt(this._observable),this._emitBeforeChanges(ki.MOVE))return this;const e=this._splice(0,this.length);return e&&(e.reverse(),this._splice(0,0,e)),this._emitAfterChanges(ki.MOVE),this}shift(){if(Rt(this._observable),!this.length||this._emitBeforeChanges(ki.REMOVE))return;const e=xS(this._splice(0,1));return this._emitAfterChanges(ki.REMOVE),e}slice(e=0,t=this.length){return Rt(this._observable),this._createNewInstance({items:this._items.slice(e,t)})}some(e,t){return Rt(this._observable),this._items.some(e,t)}sort(e){if(Rt(this._observable),!this.length||this._emitBeforeChanges(ki.MOVE))return this;const t=this._splice(0,this.length);return arguments.length?t.sort(e):t.sort(),this._splice(0,0,t),this._emitAfterChanges(ki.MOVE),this}splice(e,t,...i){Rt(this._observable);const r=(t?ki.REMOVE:0)|(i.length?ki.ADD:0);if(this._emitBeforeChanges(r))return[];const s=this._splice(e,t,i)||[];return this._emitAfterChanges(r),s}toArray(){return Rt(this._observable),this._items.slice()}toJSON(){return Rt(this._observable),this.toArray()}toLocaleString(){return Rt(this._observable),this._items.toLocaleString()}toString(){return Rt(this._observable),this._items.toString()}unshift(...e){return Rt(this._observable),!e.length||this._emitBeforeChanges(ki.ADD)||(this._splice(0,0,e),this._emitAfterChanges(ki.ADD)),this.length}_createNewInstance(e){return new this.constructor(e)}_splice(e,t,i){const r=this._items,s=this.itemType;let n,c;if(!this._notifications&&this.hasEventListener("change")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._updating=!0,this._timer=m_(()=>this._dispatchChange())),e<0&&(e+=this.length),t){if(c=r.splice(e,t),this.hasEventListener("before-remove")){const o=Fo.acquire();o.target=this,o.cancellable=!0;for(let f=0,g=c.length;f{r.push(f)});const s=kn.acquire();gu.forEach(f=>{s.push(f)});const n=this._items,c=t.items,o=kn.acquire();if(_u.forEach(f=>{c.indexOf(f)!==n.indexOf(f)&&o.push(f)}),t.listeners&&(r.length||s.length||o.length)){const f={target:this,added:r,removed:s,moved:o},g=t.listeners.length;for(let S=0;S{if(!e)return $c;if(SS.has(e))return SS.get(e);let t=null;if(typeof e=="function")t=e.prototype.declaredClass;else if(e.base)t=e.base.prototype.declaredClass;else for(const r in e.typeMap){const s=e.typeMap[r].prototype.declaredClass;t?t+=` | ${s}`:t=s}let i=class extends $c{};return v([W4({Type:e,ensureType:typeof e=="function"?Fn(e):Uc(e)})],i.prototype,"itemType",void 0),i=v([fe(`esri.core.Collection<${t}>`)],i),SS.set(e,i),i},v([M()],Ac.prototype,"_updating",void 0),v([M()],Ac.prototype,"length",void 0),v([M()],Ac.prototype,"items",null),v([M({readOnly:!0})],Ac.prototype,"updating",null),Ac=$c=v([fe("esri.core.Collection")],Ac);const Bt=Ac;function mp(e,t,i=Bt){return t||(t=new i),t===e||(t.removeAll(),FH(e)?t.addMany(e):e&&t.add(e)),t}function Y4(e){return e}function FH(e){return e&&(Array.isArray(e)||"items"in e&&Array.isArray(e.items))}var Ju;(function(e){e[e.PENDING=0]="PENDING",e[e.RESOLVED=1]="RESOLVED",e[e.REJECTED=2]="REJECTED"})(Ju||(Ju={}));let BH=class{constructor(){this._resolver=sa(),this._status=Ju.PENDING,this._resolvingPromises=[],this._resolver.promise.then(()=>{this._status=Ju.RESOLVED,this._cleanUp()},()=>{this._status=Ju.REJECTED,this._cleanUp()}),this.promise=this._resolver.promise}destroy(){this._cleanUp()}addResolvingPromise(t){this._resolvingPromises.push(t),this._tryResolve()}isResolved(){return this._status===Ju.RESOLVED}isRejected(){return this._status===Ju.REJECTED}isFulfilled(){return this._status!==Ju.PENDING}abort(){this._resolver.reject(jr())}_cleanUp(){this._allPromise=null,this._resolvingPromises=null}_tryResolve(){if(this.isFulfilled())return;const t=sa(),i=[...this._resolvingPromises,t.promise],r=this._allPromise=Promise.all(i);r.then(()=>{this.isFulfilled()||this._allPromise!==r||this._resolver.resolve()},s=>{this.isFulfilled()||this._allPromise!==r||Ys(s)||this._resolver.reject(s)}),t.resolve()}};const bA=e=>{let t=class extends e{constructor(...i){super(...i),this._promiseProps=new BH,this.addResolvingPromise(Promise.resolve())}destroy(){this._promiseProps.destroy()}isResolved(){return this._promiseProps.isResolved()}isRejected(){return this._promiseProps.isRejected()}isFulfilled(){return this._promiseProps.isFulfilled()}when(i,r){return this._promiseProps.promise.then(()=>this).then(i,r)}catch(i){return this.when(null,i)}addResolvingPromise(i){i&&!this._promiseProps.isFulfilled()&&this._promiseProps.addResolvingPromise("_promiseProps"in i?i.when():i)}};return t=v([fe("esri.core.Promise")],t),t};let cw=class extends bA(Nt){};cw=v([fe("esri.core.Promise")],cw);const UH="not-loaded",jH="loading",VH="failed",I$="loaded",J4=e=>{let t=class extends e{constructor(...i){super(...i),this._loadController=null,this.loadError=null,this.loadStatus="not-loaded",this._set("loadWarnings",[]),this.addResolvingPromise(new Promise(r=>{const s=this.load.bind(this);this.load=n=>{const c=new Promise((o,f)=>{const g=iA(n,f);this.destroyed&&f(new Je("load:instance-destroyed",`Instance of '${this.declaredClass||this.constructor.name}' is already destroyed`,{instance:this})),this.when(o,f).finally(()=>{g&&g.remove()})});if(this.loadStatus===UH){this._set("loadStatus",jH);const o=this._loadController=new AbortController;s({signal:o.signal})}return r(),c}})),this.when(()=>{this._set("loadStatus",I$),this._loadController=null},r=>{this._set("loadStatus",VH),this._set("loadError",r),this._loadController=null})}destroy(){this._loadController&&(this._loadController=z0(this._loadController),this._promiseProps.abort()),this._set("loadError",null),this._set("loadWarnings",[])}get loaded(){return this.loadStatus===I$}get loadWarnings(){return this._get("loadWarnings")}load(){return null}cancelLoad(){var i;return this.isFulfilled()||(this._set("loadError",new Je("load:cancelled","Cancelled")),(i=this._loadController)==null||i.abort(),this._promiseProps.abort()),this}};return v([M({readOnly:!0})],t.prototype,"loaded",null),v([M({readOnly:!0})],t.prototype,"loadError",void 0),v([M({clonable:!1})],t.prototype,"loadStatus",void 0),v([M({type:[jc],readOnly:!0})],t.prototype,"loadWarnings",null),t=v([fe("esri.core.Loadable")],t),t};let Mg=class extends J4(cw){};Mg=v([fe("esri.core.Loadable")],Mg),function(e){function t(i){return!(!i||!i.load)}e.LoadableMixin=J4,e.isLoadable=t}(Mg||(Mg={}));const dh=Mg;function Bye(e,t,i){return rA(e.map((r,s)=>t.apply(i,[r,s])))}async function GH(e,t,i){return(await rA(e.map((r,s)=>t.apply(i,[r,s])))).map(r=>r.value)}function wA(e){return{ok:!0,value:e}}function xA(e){return{ok:!1,error:e}}function qH(e){return e!=null&&e.ok===!0?e.value:null}function HH(e){return e!=null&&e.ok===!1?e.error:null}async function SA(e){if(e==null)return{ok:!1,error:new Error("no promise provided")};try{return wA(await e)}catch(t){return xA(t)}}async function Uye(e){try{return wA(await e)}catch(t){return Na(t),xA(t)}}function _x(e,t){return new Mu(e,t)}let Mu=class extends Nt{get value(){return qH(this._result)}get error(){return HH(this._result)}get finished(){return this._result!=null}constructor(t,i){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=z0(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:r}=this._abortController;this.promise=t(r),this.promise.then(s=>{this._result=wA(s),this._cleanup()},s=>{this._result=xA(s),this._cleanup()}),this._abortHandle=io(i,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=Sr(this._abortHandle),this._abortController=null}};v([M()],Mu.prototype,"value",null),v([M()],Mu.prototype,"error",null),v([M()],Mu.prototype,"finished",null),v([M()],Mu.prototype,"promise",void 0),v([M()],Mu.prototype,"_result",void 0),Mu=v([fe("esri.core.asyncUtils.ReactiveTask")],Mu);async function K4(e,t){return await e.load(),WH(e,t)}async function WH(e,t){const i=[],r=(...n)=>{for(const c of n)c!=null&&(Array.isArray(c)?r(...c):Bt.isCollection(c)?c.forEach(o=>r(o)):dh.isLoadable(c)&&i.push(c))};t(r);let s=null;if(await GH(i,async n=>{const c=await SA(ZH(n)?n.loadAll():n.load());c.ok!==!1||s||(s=c)}),s)throw s.error;return e}function ZH(e){return"loadAll"in e&&typeof e.loadAll=="function"}function ui(e,t,i){let r,s;return t===void 0?(s=e,r=[void 0]):typeof t!="string"?(s=e,r=[void 0],i=t):(s=t,r=Array.isArray(e)?e:[e]),(n,c)=>{const o=n.constructor.prototype;for(const f of r){const g=f4(n,f,s);g.write&&typeof g.write=="object"||(g.write={}),i&&(g.write.target=i),g.write.writer=o[c]}}}let ks=class{constructor(t,i={ignoreUnknown:!1,useNumericKeys:!1}){this._jsonToAPI=t,this._options=i,this.apiValues=[],this.jsonValues=[],this._apiToJSON=this._invertMap(t),this.apiValues=this._getKeysSorted(this._apiToJSON),this.jsonValues=this._getKeysSorted(this._jsonToAPI),this.read=r=>this.fromJSON(r),this.write=(r,s,n)=>{const c=this.toJSON(r);c!==void 0&&Ap(n,c,s)},this.write.isJSONMapWriter=!0}toJSON(t){if(t==null)return null;if(this._apiToJSON.hasOwnProperty(t)){const i=this._apiToJSON[t];return this._options.useNumericKeys?+i:i}return this._options.ignoreUnknown?void 0:t}fromJSON(t){return t!=null&&this._jsonToAPI.hasOwnProperty(t)?this._jsonToAPI[t]:this._options.ignoreUnknown?void 0:t}_invertMap(t){const i={};for(const r in t)i[t[r]]=r;return i}_getKeysSorted(t){const i=[];for(const r in t)i.push(r);return i.sort(),i}};function Bn(){return function(e,t){return new ks(e,{ignoreUnknown:!0,...t})}}let TA=class{constructor(t,i,r,s){this.semiMajorAxis=t,this.flattening=i,this.outerAtmosphereRimWidth=r;const n=1-this.flattening;this.semiMinorAxis=this.semiMajorAxis*n,this.halfSemiMajorAxis=this.semiMajorAxis/2,this.halfCircumference=Math.PI*this.semiMajorAxis,this.metersPerDegree=this.halfCircumference/180,this.inverseFlattening=1/(1-this.flattening)-1,this.eccentricitySquared=s||2*this.flattening-this.flattening*this.flattening,this.meanRadiusSemiAxes=(2*this.semiMajorAxis+this.semiMinorAxis)/3}get radius(){return this.semiMajorAxis}};const Or=new TA(6378137,1/298.257223563,3e5,.006694379990137799),$l=new TA(3396190,1/169.8944472236118,23e4),ph=new TA(1737400,0,0);function Ri(e){if(!Ci.assetsPath)throw _t.getLogger("esri.assets").errorOnce("The API assets location needs to be set using config.assetsPath. More information: https://arcg.is/1OzLe50"),new Je("assets:path-not-set","config.assetsPath is not set");return fp(Ci.assetsPath,e)}let TS,Ee=null;function EA(){return!!Ee}function YH(){return!!Le("esri-wasm")}function X4(){return TS||(TS=ht(()=>import("./pe-wasm-Dbaxno0I.js"),[]).then(e=>e.p).then(({default:e})=>e({locateFile:t=>Ri(`esri/geometry/support/${t}`)})).then(e=>{eN(e)}),TS)}var eE,fr,tE;(function(e){function t(n,c,o){Ee.ensureCache.prepare();const f=zd(o),g=o===f,S=Ee.ensureFloat64(f),I=Ee._pe_geog_to_proj(Ee.getPointer(n),c,S);return I&&th(o,c,S,g),I}function i(n,c,o,f){switch(f){case fr.PE_TRANSFORM_P_TO_G:return r(n,c,o);case fr.PE_TRANSFORM_G_TO_P:return t(n,c,o)}return 0}function r(n,c,o){return s(n,c,o,0)}function s(n,c,o,f){Ee.ensureCache.prepare();const g=zd(o),S=o===g,I=Ee.ensureFloat64(g),A=Ee._pe_proj_to_geog_center(Ee.getPointer(n),c,I,f);return A&&th(o,c,I,S),A}e.geogToProj=t,e.projGeog=i,e.projToGeog=r,e.projToGeogCenter=s})(eE||(eE={})),function(e){function t(){e.PE_BUFFER_MAX=Ee.PeDefs.prototype.PE_BUFFER_MAX,e.PE_NAME_MAX=Ee.PeDefs.prototype.PE_NAME_MAX,e.PE_MGRS_MAX=Ee.PeDefs.prototype.PE_MGRS_MAX,e.PE_USNG_MAX=Ee.PeDefs.prototype.PE_USNG_MAX,e.PE_DD_MAX=Ee.PeDefs.prototype.PE_DD_MAX,e.PE_DDM_MAX=Ee.PeDefs.prototype.PE_DDM_MAX,e.PE_DMS_MAX=Ee.PeDefs.prototype.PE_DMS_MAX,e.PE_UTM_MAX=Ee.PeDefs.prototype.PE_UTM_MAX,e.PE_PARM_MAX=Ee.PeDefs.prototype.PE_PARM_MAX,e.PE_TYPE_NONE=Ee.PeDefs.prototype.PE_TYPE_NONE,e.PE_TYPE_GEOGCS=Ee.PeDefs.prototype.PE_TYPE_GEOGCS,e.PE_TYPE_PROJCS=Ee.PeDefs.prototype.PE_TYPE_PROJCS,e.PE_TYPE_GEOGTRAN=Ee.PeDefs.prototype.PE_TYPE_GEOGTRAN,e.PE_TYPE_COORDSYS=Ee.PeDefs.prototype.PE_TYPE_COORDSYS,e.PE_TYPE_UNIT=Ee.PeDefs.prototype.PE_TYPE_UNIT,e.PE_TYPE_LINUNIT=Ee.PeDefs.prototype.PE_TYPE_LINUNIT,e.PE_STR_OPTS_NONE=Ee.PeDefs.prototype.PE_STR_OPTS_NONE,e.PE_STR_AUTH_NONE=Ee.PeDefs.prototype.PE_STR_AUTH_NONE,e.PE_STR_AUTH_TOP=Ee.PeDefs.prototype.PE_STR_AUTH_TOP,e.PE_STR_NAME_CANON=Ee.PeDefs.prototype.PE_STR_NAME_CANON,e.PE_STR_FMT_WKT=Ee.PeDefs.prototype.PE_STR_FMT_WKT,e.PE_STR_FMT_WKT2=Ee.PeDefs.prototype.PE_STR_FMT_WKT2,e.PE_PARM_X0=Ee.PeDefs.prototype.PE_PARM_X0,e.PE_PARM_ND=Ee.PeDefs.prototype.PE_PARM_ND,e.PE_TRANSFORM_1_TO_2=Ee.PeDefs.prototype.PE_TRANSFORM_1_TO_2,e.PE_TRANSFORM_2_TO_1=Ee.PeDefs.prototype.PE_TRANSFORM_2_TO_1,e.PE_TRANSFORM_P_TO_G=Ee.PeDefs.prototype.PE_TRANSFORM_P_TO_G,e.PE_TRANSFORM_G_TO_P=Ee.PeDefs.prototype.PE_TRANSFORM_G_TO_P,e.PE_HORIZON_RECT=Ee.PeDefs.prototype.PE_HORIZON_RECT,e.PE_HORIZON_POLY=Ee.PeDefs.prototype.PE_HORIZON_POLY,e.PE_HORIZON_LINE=Ee.PeDefs.prototype.PE_HORIZON_LINE,e.PE_HORIZON_DELTA=Ee.PeDefs.prototype.PE_HORIZON_DELTA}e.init=t}(fr||(fr={})),function(e){const t={},i={},r=O=>{if(O){const z=O.getType();switch(z){case fr.PE_TYPE_GEOGCS:O=Ee.castObject(O,Ee.PeGeogcs);break;case fr.PE_TYPE_PROJCS:O=Ee.castObject(O,Ee.PeProjcs);break;case fr.PE_TYPE_GEOGTRAN:O=Ee.castObject(O,Ee.PeGeogtran);break;default:z&fr.PE_TYPE_UNIT&&(O=Ee.castObject(O,Ee.PeUnit))}}return O};function s(){Ee.PeFactory.prototype.initialize(null)}function n(O){return c(fr.PE_TYPE_COORDSYS,O)}function c(O,z){let V=null,H=t[O];if(H||(H={},t[O]=H),H.hasOwnProperty(String(z)))V=H[z];else{const Q=Ee.PeFactory.prototype.factoryByType(O,z);Ee.compare(Q,Ee.NULL)||(V=Q,H[z]=V)}return V=r(V),V}function o(O,z){let V=null,H=i[O];if(H||(H={},i[O]=H),H.hasOwnProperty(z))V=H[z];else{const Q=Ee.PeFactory.prototype.fromString(O,z);Ee.compare(Q,Ee.NULL)||(V=Q,H[z]=V)}return V=r(V),V}function f(O){return c(fr.PE_TYPE_GEOGCS,O)}function g(O){return c(fr.PE_TYPE_GEOGTRAN,O)}function S(O){return Ee.PeFactory.prototype.getCode(O)}function I(O){return c(fr.PE_TYPE_PROJCS,O)}function A(O){return c(fr.PE_TYPE_UNIT,O)}e.initialize=s,e.coordsys=n,e.factoryByType=c,e.fromString=o,e.geogcs=f,e.geogtran=g,e.getCode=S,e.projcs=I,e.unit=A}(tE||(tE={}));let Q4=null;var uw,iE,rE,sE,hw,nE,dw,pw,oE;function eN(e){function t(n,c,o){n[c]=o(n[c])}Ee=e,fr.init(),uw.init(),hw.init(),dw.init(),pw.init(),Q4=class extends Ee.PeGCSExtent{destroy(){Ee.destroy(this)}};const i=[Ee.PeDatum,Ee.PeGeogcs,Ee.PeGeogtran,Ee.PeObject,Ee.PeParameter,Ee.PePrimem,Ee.PeProjcs,Ee.PeSpheroid,Ee.PeUnit];for(const n of i)t(n.prototype,"getName",c=>function(){return c.call(this,new Array(fr.PE_NAME_MAX))});for(const n of[Ee.PeGeogtran,Ee.PeProjcs])t(n.prototype,"getParameters",c=>function(){const o=new Array(fr.PE_PARM_MAX);let f=c.call(this);for(let g=0;gfunction(){const c=this.getSize();if(!c)return null;const o=[];return th(o,c,n.call(this)),o}),t(Ee.PeGTlistExtendedEntry.prototype,"getEntries",n=>{const c=Ee._pe_getPeGTlistExtendedGTsSize();return function(){let o=null;const f=n.call(this);if(!Ee.compare(f,Ee.NULL)){o=[f];const g=this.getSteps();if(g>1){const S=Ee.getPointer(f);for(let I=1;Ifunction(){let c=this._cache;if(c||(c=new Map,this._cache=c),c.has(n))return c.get(n);let o=null;const f=n.call(this);if(!Ee.compare(f,Ee.NULL)){o=[f];const g=f.getNump();if(g>1){const S=Ee.getPointer(f);for(let I=1;I{t.push(i[0],i[1])})):t=e,t}function th(e,t,i,r=!1){if(r)for(let s=0;s<2*t;s++)e[s]=Ee.getValue(i+s*Float64Array.BYTES_PER_ELEMENT,"double");else{const s=e.length===0;for(let n=0;n1)){const O=Ee.getPointer(A);for(let z=1;z{dc(s);const n=s.getGeogtran();dc(n),n.getParameters().forEach(dc),[n.getGeogcs1(),n.getGeogcs2()].forEach(c=>{dc(c);const o=c.getDatum();dc(o),dc(o.getSpheroid()),dc(c.getPrimem()),dc(c.getUnit())})});Ee.PeGTlistExtendedEntry.prototype.Delete(i[0])}}e.destroy=t}(iE||(iE={})),function(e){function t(i,r,s,n,c){Ee.ensureCache.prepare();const o=zd(s),f=s===o,g=Ee.ensureFloat64(o);let S=0;n&&(S=Ee.ensureFloat64(n));const I=Ee._pe_geog_to_geog(Ee.getPointer(i),r,g,S,c);return I&&th(s,r,g,f),I}e.geogToGeog=t}(rE||(rE={})),function(e){const t=(g,S,I,A,O,z)=>{let V,H;switch(Ee.ensureCache.prepare(),g){case"dd":V=Ee._pe_geog_to_dd,H=fr.PE_DD_MAX;break;case"ddm":V=Ee._pe_geog_to_ddm,H=fr.PE_DDM_MAX;break;case"dms":V=Ee._pe_geog_to_dms,H=fr.PE_DMS_MAX}let Q=0;S&&(Q=Ee.getPointer(S));const ve=zd(A),me=Ee.ensureFloat64(ve),ge=J1(I,H),Ie=V(Q,I,me,O,Ee.ensureInt32(ge));if(Ie)for(let Ce=0;Ce{let z;switch(Ee.ensureCache.prepare(),g){case"dd":z=Ee._pe_dd_to_geog;break;case"ddm":z=Ee._pe_ddm_to_geog;break;case"dms":z=Ee._pe_dms_to_geog}let V=0;S&&(V=Ee.getPointer(S));const H=A.map(ge=>Ee.ensureString(ge)),Q=Ee.ensureInt32(H),ve=Ee.ensureFloat64(new Array(2*I)),me=z(V,I,Q,ve);return me&&th(O,I,ve),me};function r(g,S,I,A,O){return t("dms",g,S,I,A,O)}function s(g,S,I,A){return i("dms",g,S,I,A)}function n(g,S,I,A,O){return t("ddm",g,S,I,A,O)}function c(g,S,I,A){return i("ddm",g,S,I,A)}function o(g,S,I,A,O){return t("dd",g,S,I,A,O)}function f(g,S,I,A){return i("dd",g,S,I,A)}e.geogToDms=r,e.dmsToGeog=s,e.geogToDdm=n,e.ddmToGeog=c,e.geogToDd=o,e.ddToGeog=f}(sE||(sE={})),function(e){function t(){e.PE_MGRS_STYLE_NEW=Ee.PeNotationMgrs.prototype.PE_MGRS_STYLE_NEW,e.PE_MGRS_STYLE_OLD=Ee.PeNotationMgrs.prototype.PE_MGRS_STYLE_OLD,e.PE_MGRS_STYLE_AUTO=Ee.PeNotationMgrs.prototype.PE_MGRS_STYLE_AUTO,e.PE_MGRS_180_ZONE_1_PLUS=Ee.PeNotationMgrs.prototype.PE_MGRS_180_ZONE_1_PLUS,e.PE_MGRS_ADD_SPACES=Ee.PeNotationMgrs.prototype.PE_MGRS_ADD_SPACES}function i(s,n,c,o,f,g,S){Ee.ensureCache.prepare();let I=0;s&&(I=Ee.getPointer(s));const A=zd(c),O=Ee.ensureFloat64(A),z=J1(n,fr.PE_MGRS_MAX),V=Ee.ensureInt32(z),H=Ee._pe_geog_to_mgrs_extended(I,n,O,o,f,g,V);if(H)for(let Q=0;QEe.ensureString(z)),I=Ee.ensureInt32(S),A=Ee.ensureFloat64(new Array(2*n)),O=Ee._pe_mgrs_to_geog_extended(g,n,I,o,A);return O&&th(f,n,A),O}e.init=t,e.geogToMgrsExtended=i,e.mgrsToGeogExtended=r}(hw||(hw={})),function(e){function t(r,s,n,c,o,f,g){Ee.ensureCache.prepare();let S=0;r&&(S=Ee.getPointer(r));const I=zd(n),A=Ee.ensureFloat64(I),O=J1(s,fr.PE_MGRS_MAX),z=Ee.ensureInt32(O),V=Ee._pe_geog_to_usng(S,s,A,c,o,f,z);if(V)for(let H=0;HEe.ensureString(A)),g=Ee.ensureInt32(f),S=Ee.ensureFloat64(new Array(2*s)),I=Ee._pe_usng_to_geog(o,s,g,S);return I&&th(c,s,S),I}e.geogToUsng=t,e.usngToGeog=i}(nE||(nE={})),function(e){function t(){e.PE_UTM_OPTS_NONE=Ee.PeNotationUtm.prototype.PE_UTM_OPTS_NONE,e.PE_UTM_OPTS_ADD_SPACES=Ee.PeNotationUtm.prototype.PE_UTM_OPTS_ADD_SPACES,e.PE_UTM_OPTS_NS=Ee.PeNotationUtm.prototype.PE_UTM_OPTS_NS}function i(s,n,c,o,f){Ee.ensureCache.prepare();let g=0;s&&(g=Ee.getPointer(s));const S=zd(c),I=Ee.ensureFloat64(S),A=J1(n,fr.PE_UTM_MAX),O=Ee.ensureInt32(A),z=Ee._pe_geog_to_utm(g,n,I,o,O);if(z)for(let V=0;VEe.ensureString(z)),I=Ee.ensureInt32(S),A=Ee.ensureFloat64(new Array(2*n)),O=Ee._pe_utm_to_geog(g,n,I,o,A);return O&&th(f,n,A),O}e.init=t,e.geogToUtm=i,e.utmToGeog=r}(dw||(dw={})),function(e){const t=new Map;function i(){e.PE_PCSINFO_OPTION_NONE=Ee.PePCSInfo.prototype.PE_PCSINFO_OPTION_NONE,e.PE_PCSINFO_OPTION_DOMAIN=Ee.PePCSInfo.prototype.PE_PCSINFO_OPTION_DOMAIN,e.PE_POLE_OUTSIDE_BOUNDARY=Ee.PePCSInfo.prototype.PE_POLE_OUTSIDE_BOUNDARY,e.PE_POLE_POINT=Ee.PePCSInfo.prototype.PE_POLE_POINT}function r(s,n=e.PE_PCSINFO_OPTION_DOMAIN){let c=null,o=null;return t.has(s)&&(o=t.get(s),o[n]&&(c=o[n])),c||(c=Ee.PePCSInfo.prototype.generate(s,n),o||(o=[],t.set(s,o)),o[n]=c),c}e.init=i,e.generate=r}(pw||(pw={})),function(e){function t(){return Ee.PeVersion.prototype.version_string()}e.versionString=t}(oE||(oE={}));const JH=Object.freeze(Object.defineProperty({__proto__:null,get PeCSTransformations(){return eE},get PeDefs(){return fr},get PeFactory(){return tE},get PeGCSExtent(){return Q4},get PeGTTransformations(){return rE},get PeGTlistExtended(){return uw},get PeGTlistExtendedEntry(){return iE},get PeNotationDms(){return sE},get PeNotationMgrs(){return hw},get PeNotationUsng(){return nE},get PeNotationUtm(){return dw},get PePCSInfo(){return pw},get PeVersion(){return oE},_init:eN,get _pe(){return Ee},isLoaded:EA,isSupported:YH,load:X4},Symbol.toStringTag,{value:"Module"}));var yp;(function(e){e[e.CGCS2000=4490]="CGCS2000",e[e.GCSMARS2000=104971]="GCSMARS2000",e[e.GCSMARS2000_SPHERE=104905]="GCSMARS2000_SPHERE",e[e.GCSMOON2000=104903]="GCSMOON2000"})(yp||(yp={}));let y;const q={values:[1,.3048,.3048006096012192,.3047972654,.9143917962,.201166195164,.9143984146160287,.3047994715386762,20.11676512155263,20.11678249437587,.9143985307444408,.91439523,.3047997101815088,20.1168,20.116756,5e4,15e4],units:["Meter","Foot","Foot_US","Foot_Clarke","Yard_Clarke","Link_Clarke","Yard_Sears","Foot_Sears","Chain_Sears","Chain_Benoit_1895_B","Yard_Indian","Yard_Indian_1937","Foot_Gold_Coast","Chain","Chain_Sears_1922_Truncated","50_Kilometers","150_Kilometers"],2066:5,2136:12,2155:2,2157:0,2158:0,2159:12,2160:12,2204:2,2219:0,2220:0,2254:2,2255:2,2256:1,2265:1,2266:1,2267:2,2268:2,2269:1,2270:1,2271:2,2272:2,2273:1,2294:0,2295:0,2314:3,2899:2,2900:2,2901:1,2909:1,2910:1,2911:2,2912:2,2913:1,2914:1,2992:1,2993:0,2994:1,3080:1,3089:2,3090:0,3091:2,3102:2,3141:0,3142:0,3167:14,3359:2,3360:0,3361:1,3362:0,3363:2,3364:0,3365:2,3366:3,3404:2,3405:0,3406:0,3407:3,3439:0,3440:0,3479:1,3480:0,3481:1,3482:0,3483:1,3484:0,3485:2,3486:0,3487:2,3488:0,3489:0,3490:2,3491:0,3492:2,3493:0,3494:2,3495:0,3496:2,3497:0,3498:2,3499:0,3500:2,3501:0,3502:2,3503:0,3504:2,3505:0,3506:2,3507:0,3508:2,3509:0,3510:2,3511:0,3512:2,3513:0,3514:0,3515:2,3516:0,3517:2,3518:0,3519:2,3520:0,3521:2,3522:0,3523:2,3524:0,3525:2,3526:0,3527:2,3528:0,3529:2,3530:0,3531:2,3532:0,3533:2,3534:0,3535:2,3536:0,3537:2,3538:0,3539:2,3540:0,3541:2,3542:0,3543:2,3544:0,3545:2,3546:0,3547:2,3548:0,3549:2,3550:0,3551:2,3552:0,3553:2,3582:2,3583:0,3584:2,3585:0,3586:2,3587:0,3588:1,3589:0,3590:1,3591:0,3592:0,3593:1,3598:2,3599:0,3600:2,3605:1,3606:0,3607:0,3608:2,3609:0,3610:2,3611:0,3612:2,3613:0,3614:2,3615:0,3616:2,3617:0,3618:2,3619:0,3620:2,3621:0,3622:2,3623:0,3624:2,3625:0,3626:2,3627:0,3628:2,3629:0,3630:2,3631:0,3632:2,3633:0,3634:1,3635:0,3636:1,3640:2,3641:0,3642:2,3643:0,3644:1,3645:0,3646:1,3647:0,3648:1,3649:0,3650:2,3651:0,3652:2,3653:0,3654:2,3655:0,3656:1,3657:0,3658:2,3659:0,3660:2,3661:0,3662:2,3663:0,3664:2,3668:2,3669:0,3670:2,3671:0,3672:2,3673:0,3674:2,3675:0,3676:1,3677:2,3678:0,3679:1,3680:2,3681:0,3682:1,3683:2,3684:0,3685:0,3686:2,3687:0,3688:2,3689:0,3690:2,3691:0,3692:2,3696:2,3697:0,3698:2,3699:0,3700:2,3793:0,3794:0,3812:0,3854:0,3857:0,3920:0,3978:0,3979:0,3991:2,3992:2,4026:0,4037:0,4038:0,4071:0,4082:0,4083:0,4087:0,4088:0,4217:2,4414:0,4415:0,4417:0,4434:0,4437:0,4438:2,4439:2,4462:0,4467:0,4471:0,4474:0,4559:0,4647:0,4822:0,4826:0,4839:0,5018:0,5041:0,5042:0,5048:0,5221:0,5223:0,5234:0,5235:0,5243:0,5247:0,5266:0,5316:0,5320:0,5321:0,5325:0,5337:0,5361:0,5362:0,5367:0,5382:0,5383:0,5396:0,5456:0,5457:0,5469:0,5472:4,5490:0,5513:0,5514:0,5523:0,5559:0,5588:1,5589:3,5596:0,5627:0,5629:0,5641:0,5643:0,5644:0,5646:2,5654:2,5655:2,5659:0,5700:0,5825:0,5836:0,5837:0,5839:0,5842:0,5844:0,5858:0,5879:0,5880:0,5887:0,5890:0,6128:1,6129:1,6141:1,6204:0,6210:0,6211:0,6307:0,6312:0,6316:0,6362:0,6391:1,6405:1,6406:0,6407:1,6408:0,6409:1,6410:0,6411:2,6412:0,6413:2,6414:0,6415:0,6416:2,6417:0,6418:2,6419:0,6420:2,6421:0,6422:2,6423:0,6424:2,6425:0,6426:2,6427:0,6428:2,6429:0,6430:2,6431:0,6432:2,6433:0,6434:2,6435:0,6436:2,6437:0,6438:2,6439:0,6440:0,6441:2,6442:0,6443:2,6444:0,6445:2,6446:0,6447:2,6448:0,6449:2,6450:0,6451:2,6452:0,6453:2,6454:0,6455:2,6456:0,6457:2,6458:0,6459:2,6460:0,6461:2,6462:0,6463:2,6464:0,6465:2,6466:0,6467:2,6468:0,6469:2,6470:0,6471:2,6472:0,6473:2,6474:0,6475:2,6476:0,6477:2,6478:0,6479:2,6484:2,6485:0,6486:2,6487:0,6488:2,6489:0,6490:2,6491:0,6492:2,6493:0,6494:1,6495:0,6496:1,6497:0,6498:0,6499:1,6500:0,6501:2,6502:0,6503:2,6504:0,6505:2,6506:0,6507:2,6508:0,6509:0,6510:2,6515:1,6516:0,6518:0,6519:2,6520:0,6521:2,6522:0,6523:2,6524:0,6525:2,6526:0,6527:2,6528:0,6529:2,6530:0,6531:2,6532:0,6533:2,6534:0,6535:2,6536:0,6537:2,6538:0,6539:2,6540:0,6541:2,6542:0,6543:2,6544:0,6545:1,6546:0,6547:1,6548:0,6549:2,6550:0,6551:2,6552:0,6553:2,6554:0,6555:2,6556:0,6557:1,6558:0,6559:1,6560:0,6561:1,6562:0,6563:2,6564:0,6565:2,6566:0,6567:0,6568:2,6569:0,6570:1,6571:0,6572:2,6573:0,6574:2,6575:0,6576:2,6577:0,6578:2,6582:2,6583:0,6584:2,6585:0,6586:2,6587:0,6588:2,6589:0,6590:2,6591:0,6592:0,6593:2,6594:0,6595:2,6596:0,6597:2,6598:0,6599:2,6600:0,6601:2,6602:0,6603:2,6605:2,6606:0,6607:2,6608:0,6609:2,6610:0,6611:0,6612:2,6613:0,6614:2,6615:0,6616:2,6617:0,6618:2,6633:2,6646:0,6703:0,6784:0,6785:1,6786:0,6787:1,6788:0,6789:1,6790:0,6791:1,6792:0,6793:1,6794:0,6795:1,6796:0,6797:1,6798:0,6799:1,6800:0,6801:1,6802:0,6803:1,6804:0,6805:1,6806:0,6807:1,6808:0,6809:1,6810:0,6811:1,6812:0,6813:1,6814:0,6815:1,6816:0,6817:1,6818:0,6819:1,6820:0,6821:1,6822:0,6823:1,6824:0,6825:1,6826:0,6827:1,6828:0,6829:1,6830:0,6831:1,6832:0,6833:1,6834:0,6835:1,6836:0,6837:1,6838:0,6839:1,6840:0,6841:1,6842:0,6843:1,6844:0,6845:1,6846:0,6847:1,6848:0,6849:1,6850:0,6851:1,6852:0,6853:1,6854:0,6855:1,6856:0,6857:1,6858:0,6859:1,6860:0,6861:1,6862:0,6863:1,6867:0,6868:1,6870:0,6875:0,6876:0,6879:0,6880:2,6884:0,6885:1,6886:0,6887:1,6915:0,6922:0,6923:2,6924:0,6925:2,6962:0,6984:0,6991:0,7128:2,7131:0,7132:2,7142:0,7257:0,7258:2,7259:0,7260:2,7261:0,7262:2,7263:0,7264:2,7265:0,7266:2,7267:0,7268:2,7269:0,7270:2,7271:0,7272:2,7273:0,7274:2,7275:0,7276:2,7277:0,7278:2,7279:0,7280:2,7281:0,7282:2,7283:0,7284:2,7285:0,7286:2,7287:0,7288:2,7289:0,7290:2,7291:0,7292:2,7293:0,7294:2,7295:0,7296:2,7297:0,7298:2,7299:0,7300:2,7301:0,7302:2,7303:0,7304:2,7305:0,7306:2,7307:0,7308:2,7309:0,7310:2,7311:0,7312:2,7313:0,7314:2,7315:0,7316:2,7317:0,7318:2,7319:0,7320:2,7321:0,7322:2,7323:0,7324:2,7325:0,7326:2,7327:0,7328:2,7329:0,7330:2,7331:0,7332:2,7333:0,7334:2,7335:0,7336:2,7337:0,7338:2,7339:0,7340:2,7341:0,7342:2,7343:0,7344:2,7345:0,7346:2,7347:0,7348:2,7349:0,7350:2,7351:0,7352:2,7353:0,7354:2,7355:0,7356:2,7357:0,7358:2,7359:0,7360:2,7361:0,7362:2,7363:0,7364:2,7365:0,7366:2,7367:0,7368:2,7369:0,7370:2,7877:0,7878:0,7882:0,7883:0,7887:0,7899:0,7991:0,7992:0,8035:2,8036:2,8058:0,8059:0,8082:0,8083:0,8088:0,8090:0,8091:2,8092:0,8093:2,8095:0,8096:2,8097:0,8098:2,8099:0,8100:2,8101:0,8102:2,8103:0,8104:2,8105:0,8106:2,8107:0,8108:2,8109:0,8110:2,8111:0,8112:2,8113:0,8114:2,8115:0,8116:2,8117:0,8118:2,8119:0,8120:2,8121:0,8122:2,8123:0,8124:2,8125:0,8126:2,8127:0,8128:2,8129:0,8130:2,8131:0,8132:2,8133:0,8134:2,8135:0,8136:2,8137:0,8138:2,8139:0,8140:2,8141:0,8142:2,8143:0,8144:2,8145:0,8146:2,8147:0,8148:2,8149:0,8150:2,8151:0,8152:2,8153:0,8154:2,8155:0,8156:2,8157:0,8158:2,8159:0,8160:2,8161:0,8162:2,8163:0,8164:2,8165:0,8166:2,8167:0,8168:2,8169:0,8170:2,8171:0,8172:2,8173:0,8177:2,8179:0,8180:2,8181:0,8182:2,8184:0,8185:2,8187:0,8189:2,8191:0,8193:2,8196:0,8197:2,8198:0,8200:2,8201:0,8202:2,8203:0,8204:2,8205:0,8206:2,8207:0,8208:2,8209:0,8210:2,8212:0,8213:2,8214:0,8216:2,8218:0,8220:2,8222:0,8224:2,8225:0,8226:2,8311:0,8312:1,8313:0,8314:1,8315:0,8316:1,8317:0,8318:1,8319:0,8320:1,8321:0,8322:1,8323:0,8324:1,8325:0,8326:1,8327:0,8328:1,8329:0,8330:1,8331:0,8332:1,8333:0,8334:1,8335:0,8336:1,8337:0,8338:1,8339:0,8340:1,8341:0,8342:1,8343:0,8344:1,8345:0,8346:1,8347:0,8348:1,8352:0,8353:0,8379:0,8380:2,8381:0,8382:2,8383:0,8384:2,8385:0,8387:2,8391:0,8395:0,8433:0,8441:0,8455:0,8456:0,8531:2,8682:0,8686:0,8687:0,8692:0,8693:0,8826:0,8903:0,8950:0,8951:0,9039:0,9040:0,9141:0,9149:0,9150:0,9191:0,9221:0,9222:0,9249:0,9250:0,9252:0,9254:0,9265:0,9284:0,9285:0,9300:0,9354:0,9367:0,9373:0,9377:0,9387:0,9391:0,9456:0,9473:0,9498:0,9674:0,9678:0,9680:0,9709:0,9712:0,9713:0,9716:0,9741:0,9748:2,9749:2,9761:0,9766:0,9793:0,9794:0,9869:0,9874:0,9875:0,9880:0,9895:0,9943:0,9945:0,9947:0,9967:0,9972:0,9977:0,10160:0,10183:0,10188:0,10194:0,10199:0,10207:0,10212:0,10217:0,10222:0,10227:0,10235:0,10240:0,10250:0,10254:0,10270:0,10275:0,10280:0,10306:0,10329:0,10471:0,20002:0,20042:0,20050:1,20499:0,20538:0,20539:0,20790:0,20791:0,21291:0,21292:0,21500:0,21817:0,21818:0,22032:0,22033:0,22091:0,22092:0,22239:0,22240:0,22332:0,22337:0,22338:0,22391:0,22392:0,22639:0,22700:0,22739:0,22770:0,22780:0,22832:0,23090:0,23095:0,23239:0,23240:0,23433:0,23700:0,24047:0,24048:0,24100:3,24200:0,24305:0,24306:0,24382:10,24383:0,24500:0,24547:0,24548:0,24571:9,24600:0,25e3:0,25231:0,25884:0,25932:0,26237:0,26331:0,26332:0,26432:0,26591:0,26592:0,26632:0,26692:0,27120:0,27200:0,27291:6,27292:6,27429:0,27492:0,27493:0,27500:0,27700:0,28232:0,28600:0,28991:0,28992:0,29100:0,29101:0,29220:0,29221:0,29333:0,29635:0,29636:0,29701:0,29738:0,29739:0,29849:0,29850:0,29871:8,29872:7,29873:0,29874:0,30200:5,30339:0,30340:0,30591:0,30592:0,30791:0,30792:0,30800:0,31028:0,31121:0,31154:0,31170:0,31171:0,31370:0,31528:0,31529:0,31600:0,31700:0,31838:0,31839:0,31900:0,31901:0,32061:0,32062:0,32098:0,32099:2,32100:0,32104:0,32161:0,32766:0,53048:0,53049:0,54090:0,54091:0,65061:2,65062:2,65161:0,65163:0,102041:2,102064:11,102068:15,102069:16,102118:2,102119:1,102120:2,102121:2,102217:2,102218:0,102219:2,102220:2,102378:1,102379:1,102380:0,102381:1,102589:2,102599:2,102600:2,102604:2,102647:0,102704:2,102705:2,102706:0,102731:0,102732:0,102759:1,102760:1,102761:2,102762:0,102763:2,102764:0,102765:0,102766:2,102970:1,102974:2,102993:0,102994:0,102995:2,102996:2,103015:0,103016:2,103017:0,103018:2,103025:0,103026:0,103027:2,103028:2,103035:0,103036:0,103037:2,103038:2,103039:0,103040:0,103041:2,103042:2,103043:0,103044:0,103045:2,103046:2,103047:0,103048:0,103049:2,103050:2,103051:0,103052:2,103053:0,103054:2,103055:0,103056:2,103057:0,103058:0,103059:2,103060:2,103061:0,103062:0,103063:2,103064:2,103069:2,103070:0,103071:0,103072:2,103073:2,103086:0,103087:0,103088:2,103089:2,103094:1,103095:0,103096:2,103103:0,103104:2,103105:0,103106:2,103121:0,103122:2,103123:0,103124:0,103125:1,103126:1,103127:0,103128:0,103129:2,103130:2,103131:0,103132:0,103133:2,103134:2,103135:0,103136:0,103137:1,103138:1,103139:0,103140:2,103141:0,103142:2,103143:0,103144:2,103145:0,103146:1,103147:0,103148:0,103149:2,103150:2,103151:0,103152:2,103172:0,103173:2,103174:0,103175:0,103176:2,103177:2,103178:0,103179:0,103180:2,103181:2,103182:0,103183:0,103184:2,103185:2,103228:0,103229:0,103230:2,103231:2,103250:0,103251:2,103252:0,103253:2,103260:0,103261:0,103262:2,103263:2,103270:0,103271:0,103272:2,103273:2,103274:0,103275:0,103276:2,103277:2,103278:0,103279:0,103280:2,103281:2,103282:0,103283:0,103284:2,103285:2,103286:0,103287:2,103288:0,103289:2,103290:0,103291:2,103292:0,103293:0,103294:2,103295:2,103296:0,103297:0,103298:2,103299:2,103376:2,103377:0,103378:0,103379:2,103380:2,103393:0,103394:0,103395:2,103396:2,103472:0,103473:1,103474:0,103475:2,103482:0,103483:2,103484:0,103485:2,103500:0,103501:2,103502:0,103503:0,103504:1,103505:1,103506:0,103507:0,103508:2,103509:2,103510:0,103511:0,103512:2,103513:2,103514:0,103515:2,103516:0,103517:2,103518:0,103519:2,103520:0,103521:1,103522:0,103523:0,103524:2,103525:2,103526:0,103527:2,103561:2,103562:2,103563:0,103564:0,103565:2,103566:2,103567:0,103568:0,103569:2,103570:2,103584:0,103585:2,103586:0,103587:2,103588:1,103589:0,103590:2,103591:1,103592:0,103593:2,103594:1,103695:2,103897:1};for(y=2e3;y<=2045;y++)q[y]=0;for(y=2056;y<=2065;y++)q[y]=0;for(y=2067;y<=2135;y++)q[y]=0;for(y=2137;y<=2154;y++)q[y]=0;for(y=2161;y<=2170;y++)q[y]=0;for(y=2172;y<=2193;y++)q[y]=0;for(y=2195;y<=2198;y++)q[y]=0;for(y=2200;y<=2203;y++)q[y]=0;for(y=2205;y<=2217;y++)q[y]=0;for(y=2222;y<=2224;y++)q[y]=1;for(y=2225;y<=2250;y++)q[y]=2;for(y=2251;y<=2253;y++)q[y]=1;for(y=2257;y<=2264;y++)q[y]=2;for(y=2274;y<=2279;y++)q[y]=2;for(y=2280;y<=2282;y++)q[y]=1;for(y=2283;y<=2289;y++)q[y]=2;for(y=2290;y<=2292;y++)q[y]=0;for(y=2308;y<=2313;y++)q[y]=0;for(y=2315;y<=2491;y++)q[y]=0;for(y=2494;y<=2866;y++)q[y]=0;for(y=2867;y<=2869;y++)q[y]=1;for(y=2870;y<=2888;y++)q[y]=2;for(y=2891;y<=2895;y++)q[y]=2;for(y=2896;y<=2898;y++)q[y]=1;for(y=2902;y<=2908;y++)q[y]=2;for(y=2915;y<=2920;y++)q[y]=2;for(y=2921;y<=2923;y++)q[y]=1;for(y=2924;y<=2930;y++)q[y]=2;for(y=2931;y<=2962;y++)q[y]=0;for(y=2964;y<=2968;y++)q[y]=2;for(y=2969;y<=2973;y++)q[y]=0;for(y=2975;y<=2991;y++)q[y]=0;for(y=2995;y<=3051;y++)q[y]=0;for(y=3054;y<=3079;y++)q[y]=0;for(y=3081;y<=3088;y++)q[y]=0;for(y=3092;y<=3101;y++)q[y]=0;for(y=3106;y<=3138;y++)q[y]=0;for(y=3146;y<=3151;y++)q[y]=0;for(y=3153;y<=3166;y++)q[y]=0;for(y=3168;y<=3172;y++)q[y]=0;for(y=3174;y<=3203;y++)q[y]=0;for(y=3294;y<=3358;y++)q[y]=0;for(y=3367;y<=3403;y++)q[y]=0;for(y=3408;y<=3416;y++)q[y]=0;for(y=3417;y<=3438;y++)q[y]=2;for(y=3441;y<=3446;y++)q[y]=2;for(y=3447;y<=3450;y++)q[y]=0;for(y=3451;y<=3459;y++)q[y]=2;for(y=3460;y<=3478;y++)q[y]=0;for(y=3554;y<=3559;y++)q[y]=0;for(y=3560;y<=3570;y++)q[y]=2;for(y=3571;y<=3581;y++)q[y]=0;for(y=3594;y<=3597;y++)q[y]=0;for(y=3601;y<=3604;y++)q[y]=0;for(y=3637;y<=3639;y++)q[y]=0;for(y=3665;y<=3667;y++)q[y]=0;for(y=3693;y<=3695;y++)q[y]=0;for(y=3701;y<=3727;y++)q[y]=0;for(y=3728;y<=3739;y++)q[y]=2;for(y=3740;y<=3751;y++)q[y]=0;for(y=3753;y<=3760;y++)q[y]=2;for(y=3761;y<=3773;y++)q[y]=0;for(y=3775;y<=3777;y++)q[y]=0;for(y=3779;y<=3781;y++)q[y]=0;for(y=3783;y<=3785;y++)q[y]=0;for(y=3788;y<=3791;y++)q[y]=0;for(y=3797;y<=3802;y++)q[y]=0;for(y=3814;y<=3816;y++)q[y]=0;for(y=3825;y<=3829;y++)q[y]=0;for(y=3832;y<=3841;y++)q[y]=0;for(y=3844;y<=3852;y++)q[y]=0;for(y=3873;y<=3885;y++)q[y]=0;for(y=3890;y<=3893;y++)q[y]=0;for(y=3907;y<=3912;y++)q[y]=0;for(y=3942;y<=3950;y++)q[y]=0;for(y=3968;y<=3970;y++)q[y]=0;for(y=3973;y<=3976;y++)q[y]=0;for(y=3986;y<=3989;y++)q[y]=0;for(y=3994;y<=3997;y++)q[y]=0;for(y=4048;y<=4051;y++)q[y]=0;for(y=4056;y<=4063;y++)q[y]=0;for(y=4093;y<=4096;y++)q[y]=0;for(y=4390;y<=4398;y++)q[y]=0;for(y=4399;y<=4413;y++)q[y]=2;for(y=4418;y<=4433;y++)q[y]=2;for(y=4455;y<=4457;y++)q[y]=2;for(y=4484;y<=4489;y++)q[y]=0;for(y=4491;y<=4554;y++)q[y]=0;for(y=4568;y<=4589;y++)q[y]=0;for(y=4652;y<=4656;y++)q[y]=0;for(y=4766;y<=4800;y++)q[y]=0;for(y=5014;y<=5016;y++)q[y]=0;for(y=5069;y<=5072;y++)q[y]=0;for(y=5105;y<=5130;y++)q[y]=0;for(y=5167;y<=5188;y++)q[y]=0;for(y=5253;y<=5259;y++)q[y]=0;for(y=5269;y<=5275;y++)q[y]=0;for(y=5292;y<=5311;y++)q[y]=0;for(y=5329;y<=5331;y++)q[y]=0;for(y=5343;y<=5349;y++)q[y]=0;for(y=5355;y<=5357;y++)q[y]=0;for(y=5387;y<=5389;y++)q[y]=0;for(y=5459;y<=5463;y++)q[y]=0;for(y=5479;y<=5482;y++)q[y]=0;for(y=5518;y<=5520;y++)q[y]=0;for(y=5530;y<=5539;y++)q[y]=0;for(y=5550;y<=5552;y++)q[y]=0;for(y=5562;y<=5583;y++)q[y]=0;for(y=5623;y<=5625;y++)q[y]=2;for(y=5631;y<=5639;y++)q[y]=0;for(y=5649;y<=5653;y++)q[y]=0;for(y=5663;y<=5680;y++)q[y]=0;for(y=5682;y<=5685;y++)q[y]=0;for(y=5875;y<=5877;y++)q[y]=0;for(y=5896;y<=5899;y++)q[y]=0;for(y=5921;y<=5940;y++)q[y]=0;for(y=6050;y<=6125;y++)q[y]=0;for(y=6244;y<=6275;y++)q[y]=0;for(y=6328;y<=6348;y++)q[y]=0;for(y=6350;y<=6356;y++)q[y]=0;for(y=6366;y<=6372;y++)q[y]=0;for(y=6381;y<=6387;y++)q[y]=0;for(y=6393;y<=6404;y++)q[y]=0;for(y=6480;y<=6483;y++)q[y]=0;for(y=6511;y<=6514;y++)q[y]=0;for(y=6579;y<=6581;y++)q[y]=0;for(y=6619;y<=6624;y++)q[y]=0;for(y=6625;y<=6627;y++)q[y]=2;for(y=6628;y<=6632;y++)q[y]=0;for(y=6634;y<=6637;y++)q[y]=0;for(y=6669;y<=6692;y++)q[y]=0;for(y=6707;y<=6709;y++)q[y]=0;for(y=6720;y<=6723;y++)q[y]=0;for(y=6732;y<=6738;y++)q[y]=0;for(y=6931;y<=6933;y++)q[y]=0;for(y=6956;y<=6959;y++)q[y]=0;for(y=7005;y<=7007;y++)q[y]=0;for(y=7057;y<=7070;y++)q[y]=2;for(y=7074;y<=7082;y++)q[y]=0;for(y=7109;y<=7118;y++)q[y]=0;for(y=7119;y<=7127;y++)q[y]=1;for(y=7374;y<=7376;y++)q[y]=0;for(y=7528;y<=7586;y++)q[y]=0;for(y=7587;y<=7645;y++)q[y]=2;for(y=7692;y<=7696;y++)q[y]=0;for(y=7755;y<=7787;y++)q[y]=0;for(y=7791;y<=7795;y++)q[y]=0;for(y=7799;y<=7801;y++)q[y]=0;for(y=7803;y<=7805;y++)q[y]=0;for(y=7825;y<=7831;y++)q[y]=0;for(y=7845;y<=7859;y++)q[y]=0;for(y=8013;y<=8032;y++)q[y]=0;for(y=8065;y<=8068;y++)q[y]=1;for(y=8518;y<=8529;y++)q[y]=2;for(y=8533;y<=8536;y++)q[y]=2;for(y=8538;y<=8540;y++)q[y]=2;for(y=8677;y<=8679;y++)q[y]=0;for(y=8836;y<=8840;y++)q[y]=0;for(y=8857;y<=8859;y++)q[y]=0;for(y=8908;y<=8910;y++)q[y]=0;for(y=9154;y<=9159;y++)q[y]=0;for(y=9205;y<=9218;y++)q[y]=0;for(y=9271;y<=9273;y++)q[y]=0;for(y=9295;y<=9297;y++)q[y]=0;for(y=9356;y<=9360;y++)q[y]=0;for(y=9404;y<=9407;y++)q[y]=0;for(y=9476;y<=9482;y++)q[y]=0;for(y=9487;y<=9494;y++)q[y]=0;for(y=9697;y<=9699;y++)q[y]=0;for(y=9821;y<=9865;y++)q[y]=0;for(y=10285;y<=10291;y++)q[y]=0;for(y=10314;y<=10317;y++)q[y]=0;for(y=10448;y<=10465;y++)q[y]=0;for(y=11114;y<=11118;y++)q[y]=0;for(y=20004;y<=20032;y++)q[y]=0;for(y=20047;y<=20049;y++)q[y]=0;for(y=20062;y<=20092;y++)q[y]=0;for(y=20135;y<=20138;y++)q[y]=0;for(y=20248;y<=20258;y++)q[y]=0;for(y=20348;y<=20358;y++)q[y]=0;for(y=20436;y<=20440;y++)q[y]=0;for(y=20822;y<=20824;y++)q[y]=0;for(y=20904;y<=20932;y++)q[y]=0;for(y=20934;y<=20936;y++)q[y]=0;for(y=21004;y<=21032;y++)q[y]=0;for(y=21035;y<=21037;y++)q[y]=0;for(y=21095;y<=21097;y++)q[y]=0;for(y=21148;y<=21150;y++)q[y]=0;for(y=21207;y<=21264;y++)q[y]=0;for(y=21307;y<=21364;y++)q[y]=0;for(y=21413;y<=21423;y++)q[y]=0;for(y=21453;y<=21463;y++)q[y]=0;for(y=21473;y<=21483;y++)q[y]=0;for(y=21780;y<=21782;y++)q[y]=0;for(y=21891;y<=21894;y++)q[y]=0;for(y=21896;y<=21899;y++)q[y]=0;for(y=22171;y<=22177;y++)q[y]=0;for(y=22181;y<=22187;y++)q[y]=0;for(y=22191;y<=22197;y++)q[y]=0;for(y=22207;y<=22222;y++)q[y]=0;for(y=22229;y<=22232;y++)q[y]=0;for(y=22234;y<=22236;y++)q[y]=0;for(y=22243;y<=22250;y++)q[y]=0;for(y=22262;y<=22265;y++)q[y]=0;for(y=22307;y<=22322;y++)q[y]=0;for(y=22348;y<=22357;y++)q[y]=0;for(y=22407;y<=22422;y++)q[y]=0;for(y=22462;y<=22465;y++)q[y]=0;for(y=22521;y<=22525;y++)q[y]=0;for(y=22607;y<=22622;y++)q[y]=0;for(y=22641;y<=22646;y++)q[y]=0;for(y=22648;y<=22657;y++)q[y]=0;for(y=22707;y<=22722;y++)q[y]=0;for(y=22762;y<=22765;y++)q[y]=0;for(y=22807;y<=22822;y++)q[y]=0;for(y=22991;y<=22994;y++)q[y]=0;for(y=23028;y<=23038;y++)q[y]=0;for(y=23301;y<=23333;y++)q[y]=2;for(y=23830;y<=23853;y++)q[y]=0;for(y=23866;y<=23872;y++)q[y]=0;for(y=23877;y<=23884;y++)q[y]=0;for(y=23886;y<=23894;y++)q[y]=0;for(y=23946;y<=23948;y++)q[y]=0;for(y=24311;y<=24313;y++)q[y]=0;for(y=24342;y<=24347;y++)q[y]=0;for(y=24370;y<=24374;y++)q[y]=10;for(y=24375;y<=24381;y++)q[y]=0;for(y=24718;y<=24721;y++)q[y]=0;for(y=24817;y<=24821;y++)q[y]=0;for(y=24877;y<=24882;y++)q[y]=0;for(y=24891;y<=24893;y++)q[y]=0;for(y=25391;y<=25395;y++)q[y]=0;for(y=25828;y<=25838;y++)q[y]=0;for(y=26191;y<=26195;y++)q[y]=0;for(y=26391;y<=26393;y++)q[y]=0;for(y=26701;y<=26722;y++)q[y]=0;for(y=26729;y<=26799;y++)q[y]=2;for(y=26801;y<=26803;y++)q[y]=2;for(y=26811;y<=26813;y++)q[y]=2;for(y=26847;y<=26870;y++)q[y]=2;for(y=26891;y<=26899;y++)q[y]=0;for(y=26901;y<=26923;y++)q[y]=0;for(y=26929;y<=26946;y++)q[y]=0;for(y=26948;y<=26998;y++)q[y]=0;for(y=27037;y<=27040;y++)q[y]=0;for(y=27205;y<=27232;y++)q[y]=0;for(y=27258;y<=27260;y++)q[y]=0;for(y=27391;y<=27398;y++)q[y]=0;for(y=27561;y<=27564;y++)q[y]=0;for(y=27571;y<=27574;y++)q[y]=0;for(y=27581;y<=27584;y++)q[y]=0;for(y=27591;y<=27594;y++)q[y]=0;for(y=28191;y<=28193;y++)q[y]=0;for(y=28348;y<=28358;y++)q[y]=0;for(y=28402;y<=28432;y++)q[y]=0;for(y=28462;y<=28492;y++)q[y]=0;for(y=29118;y<=29122;y++)q[y]=0;for(y=29168;y<=29172;y++)q[y]=0;for(y=29177;y<=29185;y++)q[y]=0;for(y=29187;y<=29195;y++)q[y]=0;for(y=29900;y<=29903;y++)q[y]=0;for(y=30161;y<=30179;y++)q[y]=0;for(y=30491;y<=30494;y++)q[y]=0;for(y=30729;y<=30732;y++)q[y]=0;for(y=31251;y<=31259;y++)q[y]=0;for(y=31265;y<=31268;y++)q[y]=0;for(y=31275;y<=31279;y++)q[y]=0;for(y=31281;y<=31297;y++)q[y]=0;for(y=31461;y<=31469;y++)q[y]=0;for(y=31491;y<=31495;y++)q[y]=0;for(y=31917;y<=31922;y++)q[y]=0;for(y=31965;y<=32e3;y++)q[y]=0;for(y=32001;y<=32003;y++)q[y]=2;for(y=32005;y<=32031;y++)q[y]=2;for(y=32033;y<=32060;y++)q[y]=2;for(y=32064;y<=32067;y++)q[y]=2;for(y=32074;y<=32077;y++)q[y]=2;for(y=32081;y<=32086;y++)q[y]=0;for(y=32107;y<=32130;y++)q[y]=0;for(y=32133;y<=32159;y++)q[y]=0;for(y=32164;y<=32167;y++)q[y]=2;for(y=32180;y<=32199;y++)q[y]=0;for(y=32201;y<=32260;y++)q[y]=0;for(y=32301;y<=32360;y++)q[y]=0;for(y=32401;y<=32460;y++)q[y]=0;for(y=32501;y<=32560;y++)q[y]=0;for(y=32601;y<=32662;y++)q[y]=0;for(y=32664;y<=32667;y++)q[y]=2;for(y=32701;y<=32761;y++)q[y]=0;for(y=53001;y<=53004;y++)q[y]=0;for(y=53008;y<=53019;y++)q[y]=0;for(y=53021;y<=53032;y++)q[y]=0;for(y=53034;y<=53037;y++)q[y]=0;for(y=53042;y<=53046;y++)q[y]=0;for(y=53074;y<=53080;y++)q[y]=0;for(y=54001;y<=54004;y++)q[y]=0;for(y=54008;y<=54019;y++)q[y]=0;for(y=54021;y<=54032;y++)q[y]=0;for(y=54034;y<=54037;y++)q[y]=0;for(y=54042;y<=54046;y++)q[y]=0;for(y=54048;y<=54053;y++)q[y]=0;for(y=54074;y<=54080;y++)q[y]=0;for(y=54098;y<=54101;y++)q[y]=0;for(y=102001;y<=102040;y++)q[y]=0;for(y=102042;y<=102063;y++)q[y]=0;for(y=102065;y<=102067;y++)q[y]=0;for(y=102070;y<=102117;y++)q[y]=0;for(y=102122;y<=102216;y++)q[y]=0;for(y=102221;y<=102377;y++)q[y]=0;for(y=102382;y<=102388;y++)q[y]=0;for(y=102389;y<=102398;y++)q[y]=2;for(y=102399;y<=102444;y++)q[y]=0;for(y=102445;y<=102447;y++)q[y]=2;for(y=102448;y<=102458;y++)q[y]=0;for(y=102459;y<=102468;y++)q[y]=2;for(y=102469;y<=102499;y++)q[y]=0;for(y=102500;y<=102519;y++)q[y]=1;for(y=102520;y<=102524;y++)q[y]=0;for(y=102525;y<=102529;y++)q[y]=2;for(y=102530;y<=102588;y++)q[y]=0;for(y=102590;y<=102598;y++)q[y]=0;for(y=102601;y<=102603;y++)q[y]=0;for(y=102605;y<=102628;y++)q[y]=0;for(y=102629;y<=102646;y++)q[y]=2;for(y=102648;y<=102700;y++)q[y]=2;for(y=102701;y<=102703;y++)q[y]=0;for(y=102707;y<=102730;y++)q[y]=2;for(y=102733;y<=102758;y++)q[y]=2;for(y=102767;y<=102900;y++)q[y]=0;for(y=102901;y<=102933;y++)q[y]=2;for(y=102934;y<=102950;y++)q[y]=13;for(y=102951;y<=102955;y++)q[y]=0;for(y=102961;y<=102963;y++)q[y]=0;for(y=102965;y<=102969;y++)q[y]=0;for(y=102971;y<=102973;y++)q[y]=0;for(y=102975;y<=102989;y++)q[y]=0;for(y=102990;y<=102992;y++)q[y]=1;for(y=102997;y<=103002;y++)q[y]=0;for(y=103003;y<=103008;y++)q[y]=2;for(y=103009;y<=103011;y++)q[y]=0;for(y=103012;y<=103014;y++)q[y]=2;for(y=103019;y<=103021;y++)q[y]=0;for(y=103022;y<=103024;y++)q[y]=2;for(y=103029;y<=103031;y++)q[y]=0;for(y=103032;y<=103034;y++)q[y]=2;for(y=103065;y<=103068;y++)q[y]=0;for(y=103074;y<=103076;y++)q[y]=0;for(y=103077;y<=103079;y++)q[y]=1;for(y=103080;y<=103082;y++)q[y]=0;for(y=103083;y<=103085;y++)q[y]=2;for(y=103090;y<=103093;y++)q[y]=0;for(y=103097;y<=103099;y++)q[y]=0;for(y=103100;y<=103102;y++)q[y]=2;for(y=103107;y<=103109;y++)q[y]=0;for(y=103110;y<=103112;y++)q[y]=2;for(y=103113;y<=103116;y++)q[y]=0;for(y=103117;y<=103120;y++)q[y]=2;for(y=103153;y<=103157;y++)q[y]=0;for(y=103158;y<=103162;y++)q[y]=2;for(y=103163;y<=103165;y++)q[y]=0;for(y=103166;y<=103168;y++)q[y]=1;for(y=103169;y<=103171;y++)q[y]=2;for(y=103186;y<=103188;y++)q[y]=0;for(y=103189;y<=103191;y++)q[y]=2;for(y=103192;y<=103195;y++)q[y]=0;for(y=103196;y<=103199;y++)q[y]=2;for(y=103200;y<=103224;y++)q[y]=0;for(y=103225;y<=103227;y++)q[y]=1;for(y=103232;y<=103237;y++)q[y]=0;for(y=103238;y<=103243;y++)q[y]=2;for(y=103244;y<=103246;y++)q[y]=0;for(y=103247;y<=103249;y++)q[y]=2;for(y=103254;y<=103256;y++)q[y]=0;for(y=103257;y<=103259;y++)q[y]=2;for(y=103264;y<=103266;y++)q[y]=0;for(y=103267;y<=103269;y++)q[y]=2;for(y=103300;y<=103375;y++)q[y]=0;for(y=103381;y<=103383;y++)q[y]=0;for(y=103384;y<=103386;y++)q[y]=1;for(y=103387;y<=103389;y++)q[y]=0;for(y=103390;y<=103392;y++)q[y]=2;for(y=103397;y<=103399;y++)q[y]=0;for(y=103400;y<=103471;y++)q[y]=2;for(y=103476;y<=103478;y++)q[y]=0;for(y=103479;y<=103481;y++)q[y]=2;for(y=103486;y<=103488;y++)q[y]=0;for(y=103489;y<=103491;y++)q[y]=2;for(y=103492;y<=103495;y++)q[y]=0;for(y=103496;y<=103499;y++)q[y]=2;for(y=103528;y<=103543;y++)q[y]=0;for(y=103544;y<=103548;y++)q[y]=2;for(y=103549;y<=103551;y++)q[y]=0;for(y=103552;y<=103554;y++)q[y]=1;for(y=103555;y<=103557;y++)q[y]=2;for(y=103558;y<=103560;y++)q[y]=0;for(y=103571;y<=103573;y++)q[y]=0;for(y=103574;y<=103576;y++)q[y]=2;for(y=103577;y<=103580;y++)q[y]=0;for(y=103581;y<=103583;y++)q[y]=2;for(y=103595;y<=103694;y++)q[y]=0;for(y=103696;y<=103699;y++)q[y]=0;for(y=103700;y<=103793;y++)q[y]=2;for(y=103794;y<=103890;y++)q[y]=0;for(y=103891;y<=103896;y++)q[y]=2;for(y=103900;y<=103971;y++)q[y]=2;for(y=103972;y<=103977;y++)q[y]=0;for(y=112e3;y<=112101;y++)q[y]=0;const tN=[102100,102113,3857,3785],KH=[104905,104971],XH=[4326,...tN,...KH],A$='PROJCS["WGS_1984_Web_Mercator_Auxiliary_Sphere",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator_Auxiliary_Sphere"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",{Central_Meridian}],PARAMETER["Standard_Parallel_1",0.0],PARAMETER["Auxiliary_Sphere_Type",0.0],UNIT["Meter",1.0]]',K1=[-20037508342788905e-9,20037508342788905e-9],X1=[-20037508342787e-6,20037508342787e-6],iN={102113:{wkTemplate:'PROJCS["WGS_1984_Web_Mercator",GEOGCS["GCS_WGS_1984_Major_Auxiliary_Sphere",DATUM["D_WGS_1984_Major_Auxiliary_Sphere",SPHEROID["WGS_1984_Major_Auxiliary_Sphere",6378137.0,0.0]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",{Central_Meridian}],PARAMETER["Standard_Parallel_1",0.0],UNIT["Meter",1.0]]',valid:K1,origin:X1,dx:1e-5},102100:{wkTemplate:A$,valid:K1,origin:X1,dx:1e-5},3785:{wkTemplate:'PROJCS["WGS_1984_Web_Mercator",GEOGCS["GCS_WGS_1984_Major_Auxiliary_Sphere",DATUM["D_WGS_1984_Major_Auxiliary_Sphere",SPHEROID["WGS_1984_Major_Auxiliary_Sphere",6378137.0,0.0]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",{Central_Meridian}],PARAMETER["Standard_Parallel_1",0.0],UNIT["Meter",1.0]]',valid:K1,origin:X1,dx:1e-5},3857:{wkTemplate:A$,valid:K1,origin:X1,dx:1e-5},4326:{wkTemplate:'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",{Central_Meridian}],UNIT["Degree",0.0174532925199433]]',altTemplate:'PROJCS["WGS_1984_Plate_Carree",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Plate_Carree"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",{Central_Meridian}],UNIT["Degrees",111319.491]]',valid:[-180,180],origin:[-180,90],dx:1e-5},104971:{wkTemplate:'GEOGCS["Mars_2000_(Sphere)",DATUM["Mars_2000_(Sphere)",SPHEROID["Mars_2000_(Sphere)",3396190.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]',valid:[-180,180],origin:[-180,90],dx:1e-5},104905:{wkTemplate:'GEOGCS["GCS_Mars_2000",DATUM["D_Mars_2000",SPHEROID["Mars_2000_IAU_IAG",3396190.0,169.8944472236118]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]',valid:[-180,180],origin:[-180,90],dx:1e-5}};function Js(e,t){if(e===t)return!0;if(e==null||t==null)return!1;const i=e.wkid,r=t.wkid;if(i!=null||r!=null){if(i===r||gp(e)&&gp(t))return!0;const c=e.latestWkid;if(c!=null&&r===c)return!0;const o=t.latestWkid;return o!=null&&i===o}let s,n;return e.wkt2&&t.wkt2?(s=e.wkt2,n=t.wkt2):e.wkt&&t.wkt&&(s=e.wkt,n=t.wkt),!(!s||!n)&&s.toUpperCase()===n.toUpperCase()}function ro(e){const t=e==null?void 0:e.wkid;return t!=null&&t>=2e3&&iN[t]||null}function rN(e){if(!e)return;const{wkid:t,vcsWkid:i}=e;if(t)return i?JSON.stringify({wkid:t,vcsWkid:i}):String(t);const r=e.wkt||e.wkt2;return JSON.stringify(r?i?{wkt:r,vcsWkid:i}:{wkt:r}:{})}function MA(e){if(!Ba(e))return!1;const{wkid:t}=e;if(t)return q[t]==null;const i=e.wkt2||e.wkt;return!!i&&/^\s*(?:GEOGCS|GEOGCRS|GEOGRAPHICCRS)/i.test(i)}function QH(e){return!(sN(e)||nN(e))}function G0(e){return(e==null?void 0:e.wkid)===4326}function qye(e){return/^\s*(?:GEOD|GEODETIC|GEOG|GEOGRAPHIC|PROJ|PROJECTED|VERT|VERTICAL|ENG|ENGINEERING|PARAMETRIC|TIME|DERIVEDPROJ|COMPOUND|BOUND)CRS/i.test(e)}function Hye(e){return(e==null?void 0:e.wkid)===yp.CGCS2000}function gp(e){const t=e==null?void 0:e.wkid;return t!=null&&t>=2e3&&tN.includes(t)}function eW(e){return(e==null?void 0:e.wkid)===32662}function vx(e){return e===yp.GCSMARS2000||e===yp.GCSMARS2000_SPHERE}function sN(e){return vx(e==null?void 0:e.wkid)}function bx(e){return e===yp.GCSMOON2000}function nN(e){return bx(e==null?void 0:e.wkid)}function tW(e){const t=e==null?void 0:e.wkid;return t!=null&&t>=2e3&&XH.includes(t)}function Ba(e){if(e==null)return!1;const t=e.wkid;return t!=null&&t>=2e3||e.wkt2!=null||e.wkt!=null}const fw={wkid:4326,wkt:O5(iN[4326].wkTemplate,{Central_Meridian:"0.0"})},mw={wkid:102100,latestWkid:3857},iW={wkid:32662};function IA(e){return{wkt:`GEOCCS["Spherical geocentric", DATUM["Not specified", SPHEROID["Sphere",${e.radius},0]], PRIMEM["Greenwich",0.0, @@ -31,7 +31,7 @@ var ZV=Object.defineProperty;var YV=(e,t,i)=>t in e?ZV(e,t,{enumerable:!0,config AXIS["Geocentric Y",OTHER], AXIS["Geocentric Z",NORTH], AUTHORITY["EPSG","4978"] -]`},nW=AA.wkt.toUpperCase(),oW=PA.wkt.toUpperCase();function aW(e){if(e!=null&&Ba(e)){const t=e.wkid,i=e.wkt2??e.wkt;if(vx(t))return $l;const r=i==null?void 0:i.toUpperCase();if(i&&r===nW)return $l;if(bx(t)||r&&r===oW)return ph}return Or}function Wye(e){return vx(e)?$l:bx(e)?ph:Or}function yw(e){return Js(e,rW)}function fh(e){return yw(e)||Js(e,AA)||Js(e,PA)}const Zye=39.37,lW=Or.radius*Math.PI/200,oN=/(?:LENGTH)?UNIT\[([^\]]+)]]$/i,op=q,aN=/UNIT\[([^\]]+)]/i,cW=new Set([4261,4305,4807,4810,4811,4812,4816,4819,4821,4901,4902,37225,104139,104140]),uW=Bn()({meter:"meters",foot:"feet",foot_us:"us-feet",foot_clarke:"clarke-feet",yard_clarke:"clarke-yards",link_clarke:"clarke-links",yard_sears:"sears-yards",foot_sears:"sears-feet",chain_sears:"sears-chains",chain_benoit_1895_b:"benoit-1895-b-chains",yard_indian:"indian-yards",yard_indian_1937:"indian-1937-yards",foot_gold_coast:"gold-coast-feet",chain_sears_1922_truncated:"sears-1922-truncated-chains","50_kilometers":"50-kilometers","150_kilometers":"150-kilometers"}),ll=e=>e*e,vu=e=>e*e*e,q0={length:{baseUnit:"meters",units:{millimeters:{inBaseUnits:.001},centimeters:{inBaseUnits:.01},decimeters:{inBaseUnits:.1},meters:{inBaseUnits:1},kilometers:{inBaseUnits:1e3},inches:{inBaseUnits:.0254},feet:{inBaseUnits:.3048},yards:{inBaseUnits:.9144},miles:{inBaseUnits:1609.344},"nautical-miles":{inBaseUnits:1852},"us-feet":{inBaseUnits:1200/3937}}},area:{baseUnit:"square-meters",units:{"square-millimeters":{inBaseUnits:ll(.001)},"square-centimeters":{inBaseUnits:ll(.01)},"square-decimeters":{inBaseUnits:ll(.1)},"square-meters":{inBaseUnits:1},"square-kilometers":{inBaseUnits:ll(1e3)},"square-inches":{inBaseUnits:ll(.0254)},"square-feet":{inBaseUnits:ll(.3048)},"square-yards":{inBaseUnits:ll(.9144)},"square-miles":{inBaseUnits:ll(1609.344)},"square-us-feet":{inBaseUnits:ll(1200/3937)},acres:{inBaseUnits:.0015625*ll(1609.344)},ares:{inBaseUnits:100},hectares:{inBaseUnits:1e4}}},volume:{baseUnit:"liters",units:{liters:{inBaseUnits:1},"cubic-millimeters":{inBaseUnits:1e3*vu(.001)},"cubic-centimeters":{inBaseUnits:1e3*vu(.01)},"cubic-decimeters":{inBaseUnits:1e3*vu(.1)},"cubic-meters":{inBaseUnits:1e3},"cubic-kilometers":{inBaseUnits:1e3*vu(1e3)},"cubic-inches":{inBaseUnits:1e3*vu(.0254)},"cubic-feet":{inBaseUnits:1e3*vu(.3048)},"cubic-yards":{inBaseUnits:1e3*vu(.9144)},"cubic-miles":{inBaseUnits:1e3*vu(1609.344)}}},angle:{baseUnit:"radians",units:{radians:{inBaseUnits:1},degrees:{inBaseUnits:Math.PI/180}}}},hW=(()=>{const e={};for(const t in q0)for(const i in q0[t].units)e[i]=t;return e})();function dW(e,t,i){return e*q0[i].units[t].inBaseUnits}function pW(e,t,i){return e/q0[i].units[t].inBaseUnits}function aE(e){const t=hW[e];if(!t)throw new Error("unknown type");return t}function P$(e,t=null){return t=t||aE(e),q0[t].baseUnit===e}function Uo(e,t,i){if(t===i)return e;const r=aE(t);if(r!==aE(i))throw new Error("incompatible units");const s=P$(t,r)?e:dW(e,t,r);return P$(i,r)?s:pW(s,i,r)}function fW(e,t,i){return Uo(e,t,"meters")/(i*Math.PI/180)}function lN(e){return uW.fromJSON(e.toLowerCase())||null}function C$(e){if(e!=null&&!QH(e))return 1;const t=$p(e);return t>1e5?1:t}function mW(e){return $p(e)>=aW(e).metersPerDegree?"meters":uN(e)}function $p(e,t=Or.metersPerDegree){return yW(e,!0)??t}function yW(e,t=!1){const i=(e==null?void 0:e.wkid)??null,r=(e==null?void 0:e.wkt2)??(e==null?void 0:e.wkt)??null;let s=null;if(i){if(vx(i))return $l.metersPerDegree;if(bx(i))return ph.metersPerDegree;s=op.values[op[i]],!s&&t&&cW.has(i)&&(s=lW)}else r&&(dN(r)?s=$$(oN.exec(r),s):hN(r)&&(s=$$(aN.exec(r),s)));return s}function Yye(e){return MA(e)?1:$p(e)}function $$(e,t){return e!=null&&e[1]?cN(e[1]):t}function cN(e){return parseFloat(e.split(",")[1])}function uN(e){const t=(e==null?void 0:e.wkid)??null,i=(e==null?void 0:e.wkt2)??(e==null?void 0:e.wkt)??null;let r=null;if(t)r=op.units[op[t]];else if(i){const s=dN(i)?oN:hN(i)?aN:null;if(s){const n=s.exec(i);n!=null&&n[1]&&(r=_W(n[1]))}}return r!=null?lN(r):null}function hN(e){return/^GEOCCS/i.test(e)}function dN(e){return/^\s*(?:PROJCS|PROJCRS|PROJECTEDCRS)/i.test(e)}const gW=1e-7;function _W(e){const t=/[\\"']{1}([^\\"']+)/.exec(e);let i=t==null?void 0:t[1];if(!i||!op.units.includes(i)){const r=cN(e);i=null;const s=op.values;for(let n=0;n{const o=n.constructor.prototype;r.forEach(f=>{const g=f4(n,f,s);g.read&&typeof g.read=="object"||(g.read={}),g.read.reader=o[c],i&&(g.read.source=(g.read.source||[]).concat(i))})}}let dl=class extends At{constructor(...t){super(...t),this.type=null,this.hasM=!1,this.hasZ=!1,this.spatialReference=yi.WGS84}get cache(){return this.commitProperty("spatialReference"),{}}get extent(){return null}readSpatialReference(t,i){if(t instanceof yi)return t;if(t!=null){const r=new yi;return r.read(t,i),r}return t}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}clearCache(){this.notifyChange("cache")}getCacheValue(t){return this.cache[t]}setCacheValue(t,i){this.cache[t]=i}};v([M()],dl.prototype,"type",void 0),v([M({readOnly:!0})],dl.prototype,"cache",null),v([M({readOnly:!0})],dl.prototype,"extent",null),v([M({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],dl.prototype,"hasM",void 0),v([M({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],dl.prototype,"hasZ",void 0),v([M({type:yi,json:{write:!0},value:yi.WGS84})],dl.prototype,"spatialReference",void 0),v([mi("spatialReference")],dl.prototype,"readSpatialReference",null),dl=v([fe("esri.geometry.Geometry")],dl);const Th=dl,xW=Object.prototype.toString;function SW(e){const t="__accessorMetadata__"in e?Fn(e):e;return function(...i){if(i.push(t),typeof i[2]=="number")throw new Error("Using @cast has parameter decorator is not supported since 4.16");return TW.apply(this,i)}}function TW(e,t,i,r){lx(e,t).cast=r}function EW(e){return(t,i)=>{lx(t,e).cast=t[i]}}function Rs(...e){if(e.length!==3||typeof e[1]!="string")return e.length===1&&xW.call(e[0])==="[object Function]"?SW(e[0]):e.length===1&&typeof e[0]=="string"?EW(e[0]):void 0}function MW(e,t){const i=e.x-t.x,r=e.y-t.y,s=e.hasZ&&t.hasZ?e.z-t.z:0;return Math.sqrt(i*i+r*r+s*s)}const IW=57.29577951308232,AW=.017453292519943;function k$(e){return e*IW}function R$(e){return e*AW}function ege(e){return Math.PI/2-2*Math.atan(Math.exp(-e/Or.radius))}function lE(e){return e.wkid!=null||e.wkt!=null}const ES=[0,0];function gw(e,t,i,r,s){const n=e,c=s;if(c.spatialReference=i,"x"in n&&"x"in c)[c.x,c.y]=t(n.x,n.y,ES,r);else if("xmin"in n&&"xmin"in c)[c.xmin,c.ymin]=t(n.xmin,n.ymin,ES,r),[c.xmax,c.ymax]=t(n.xmax,n.ymax,ES,r);else if("paths"in n&&"paths"in c||"rings"in n&&"rings"in c){const o="paths"in n?n.paths:n.rings,f=[];let g;for(let S=0;S2&&g[A].push(I[A][2]),I[A].length>3&&g[A].push(I[A][3])}"paths"in c?c.paths=f:c.rings=f}else if("points"in n&&"points"in c){const o=n.points,f=[];for(let g=0;g2&&f[g].push(o[g][2]),o[g].length>3&&f[g].push(o[g][3]);c.points=f}return s}function Hv(e,t){const i=e&&(lE(e)?e:e.spatialReference),r=t&&(lE(t)?t:t.spatialReference);return!(e&&"type"in e&&e.type==="mesh"||t&&"type"in t&&t.type==="mesh"||!i||!r)&&(!!Js(r,i)||gp(r)&&G0(i)||gp(i)&&G0(r))}function wx(e,t){if(e==null)return null;const i=e.spatialReference,r=t&&(lE(t)?t:t.spatialReference);return Hv(i,r)?Js(i,r)?He(e):gp(r)?gw(e,tm,yi.WebMercator,!1,He(e)):G0(r)?gw(e,m0,yi.WGS84,!1,He(e)):null:null}function tm(e,t,i=[0,0]){t>89.99999?t=89.99999:t<-89.99999&&(t=-89.99999);const r=R$(t);return i[0]=R$(e)*Or.radius,i[1]=Or.halfSemiMajorAxis*Math.log((1+Math.sin(r))/(1-Math.sin(r))),i}function m0(e,t,i=[0,0],r=!1){const s=k$(e/Or.radius);return i[0]=r?s:s-360*Math.floor((s+180)/360),i[1]=k$(Math.PI/2-2*Math.atan(Math.exp(-t/Or.radius))),i}function Nc(e,t=!1,i=He(e)){return gw(e,tm,yi.WebMercator,t,i)}function im(e,t=!1,i=He(e)){return gw(e,m0,yi.WGS84,t,i)}var Wv;const cg=[0,0];function O$(e){return e&&(e.declaredClass==="esri.geometry.SpatialReference"||e.wkid!=null)}let Mn=Wv=class extends Th{static copy(e,t){t._set("x",e._get("x")),t._set("y",e._get("y")),t._set("z",e._get("z")),t._set("m",e._get("m"));const i=e._get("spatialReference");t._set("spatialReference",Object.isFrozen(i)?i:i.clone())}constructor(...e){super(...e),this.x=0,this.y=0,this.z=void 0,this.m=void 0,this.type="point"}normalizeCtorArgs(e,t,i,r,s){let n;if(Array.isArray(e))n=e,s=t,e=n[0],t=n[1],i=n[2],r=n[3];else if(e&&typeof e=="object"){if(n=e,e=n.x!=null?n.x:n.longitude,t=n.y!=null?n.y:n.latitude,i=n.z,r=n.m,(s=n.spatialReference)&&s.declaredClass!=="esri.geometry.SpatialReference"&&(s=new yi(s)),n.longitude!=null||n.latitude!=null){if(n.longitude==null)_t.getLogger(this).warn(".longitude=","Latitude was defined without longitude");else if(n.latitude==null)_t.getLogger(this).warn(".latitude=","Longitude was defined without latitude");else if(!n.declaredClass&&s&&s.isWebMercator){const o=tm(n.longitude,n.latitude,cg);e=o[0],t=o[1]}}}else O$(i)?(s=i,i=null):O$(r)&&(s=r,r=null);const c={x:e,y:t};return c.x==null&&c.y!=null?_t.getLogger(this).warn(".y=","Y coordinate was defined without an X coordinate"):c.y==null&&c.x!=null&&_t.getLogger(this).warn(".x=","X coordinate was defined without a Y coordinate"),s!=null&&(c.spatialReference=s),i!=null&&(c.z=i),r!=null&&(c.m=r),c}get cache(){return this.commitProperty("x"),this.commitProperty("y"),this.commitProperty("z"),this.commitProperty("m"),this.commitProperty("spatialReference"),{}}get hasM(){return this.m!==void 0}set hasM(e){e!==(this._get("m")!==void 0)&&(this._set("m",e?0:void 0),this._set("hasM",e))}get hasZ(){return this.z!==void 0}set hasZ(e){e!==(this._get("z")!==void 0)&&(this._set("z",e?0:void 0),this._set("hasZ",e))}get latitude(){const{spatialReference:e,x:t,y:i}=this;if(e){if(e.isWebMercator)return m0(t,i,cg)[1];if(e.isGeographic)return i}return null}set latitude(e){const{spatialReference:t,x:i}=this;e!=null&&t&&(t.isWebMercator?this._set("y",tm(i,e,cg)[1]):t.isGeographic&&this._set("y",e),this._set("latitude",e))}get longitude(){const{x:e,y:t,spatialReference:i}=this;if(i){if(i.isWebMercator)return m0(e,t,cg)[0];if(i.isGeographic)return e}return null}set longitude(e){const{y:t,spatialReference:i}=this;e!=null&&i&&(i.isWebMercator?this._set("x",tm(e,t,cg)[0]):i.isGeographic&&this._set("x",e),this._set("longitude",e))}writeX(e,t,i){t[i]=isNaN(e)?"NaN":e}readX(e){return typeof e=="string"?NaN:e}clone(){const e=new Wv;return e.x=this.x,e.y=this.y,e.z=this.z,e.m=this.m,e.spatialReference=this.spatialReference,e}copy(e){return Wv.copy(e,this),this}equals(e){if(e==null)return!1;const{x:t,y:i,z:r,m:s,spatialReference:n}=this,{z:c,m:o}=e;let{x:f,y:g,spatialReference:S}=e;if(!n.equals(S))if(n.isWebMercator&&S.isWGS84)[f,g]=tm(f,g),S=n;else{if(!n.isWGS84||!S.isWebMercator)return!1;[f,g]=m0(f,g),S=n}return t===f&&i===g&&r===c&&s===o&&n.wkid===S.wkid}offset(e,t,i){return this.x+=e,this.y+=t,i!=null&&(this.z=(this.z??0)+i),this}normalize(){if(!this.spatialReference)return this;const e=ro(this.spatialReference);if(!e)return this;let t=this.x;const[i,r]=e.valid,s=2*r;let n;return t>r?(n=Math.ceil(Math.abs(t-r)/s),t-=n*s):tisNaN(e)?e:za(e))],Mn.prototype,"x",void 0),v([ui("x")],Mn.prototype,"writeX",null),v([mi("x")],Mn.prototype,"readX",null),v([M({type:Number,json:{write:!0}})],Mn.prototype,"y",void 0),v([M({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasZ}}}}})],Mn.prototype,"z",void 0),v([M({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasM}}}}})],Mn.prototype,"m",void 0),Mn=Wv=v([fe("esri.geometry.Point")],Mn),Mn.prototype.toJSON.isDefaultToJSON=!0;const ri=Mn,MS=[0,0];function xx(e,t){return t!=null&&$n(e,t.x,t.y,t.z)}function tge(e,t){if(!t.points||t.points.length)return!1;for(const i of t.points)if(!Pm(e,i))return!1;return!0}function PW(e,t){const{xmin:i,ymin:r,zmin:s,xmax:n,ymax:c,zmax:o}=t;return e.hasZ&&t.hasZ?$n(e,i,r,s)&&$n(e,i,c,s)&&$n(e,n,c,s)&&$n(e,n,r,s)&&$n(e,i,r,o)&&$n(e,i,c,o)&&$n(e,n,c,o)&&$n(e,n,r,o):$n(e,i,r)&&$n(e,i,c)&&$n(e,n,c)&&$n(e,n,r)}function Pm(e,t){return $n(e,t[0],t[1])}function CW(e,t){return $n(e,t[0],t[1],t[2])}function $n(e,t,i,r){return t>=e.xmin&&t<=e.xmax&&i>=e.ymin&&i<=e.ymax&&(r==null||!e.hasZ||r>=e.zmin&&r<=e.zmax)}function pN(e,t){return MS[1]=t.y,MS[0]=t.x,$W(e,MS)}function $W(e,t){return fN(e.rings,t)}function fN(e,t){if(!e)return!1;if(kW(e))return L$(!1,e,t);let i=!1;for(let r=0,s=e.length;r=s||A=s)&&g+(s-S)/(A-S)*(I-g)=0&&ge<=1&&Ie>=0&&Ie<=1&&(s&&(s[0]=n+ge*(o-n),s[1]=c+ge*(f-c)),!0)}function UW(e){switch(e){case"esriGeometryEnvelope":case"extent":return OW;case"esriGeometryMultipoint":case"multipoint":return LW;case"esriGeometryPoint":case"point":return RW;case"esriGeometryPolygon":case"polygon":return NW;case"esriGeometryPolyline":case"polyline":return FW}}var jo;function jW(e){return e&&(e.declaredClass==="esri.geometry.SpatialReference"||e.wkid!=null)}function bu(e,t,i){return t==null?i:i==null?t:e(t,i)}let ys=jo=class extends Th{constructor(...e){super(...e),this.type="extent",this.xmin=0,this.ymin=0,this.mmin=void 0,this.zmin=void 0,this.xmax=0,this.ymax=0,this.mmax=void 0,this.zmax=void 0}normalizeCtorArgs(e,t,i,r,s){return jW(e)?{spatialReference:e,xmin:0,ymin:0,xmax:0,ymax:0}:typeof e=="object"?(e.spatialReference=e.spatialReference==null?yi.WGS84:e.spatialReference,e):{xmin:e,ymin:t,xmax:i,ymax:r,spatialReference:s??yi.WGS84}}static fromBounds(e,t){return new jo({xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3],spatialReference:t})}static fromPoint(e){return new jo({xmin:e.x,ymin:e.y,zmin:e.z,xmax:e.x,ymax:e.y,zmax:e.z,spatialReference:e.spatialReference})}get cache(){return this.commitProperty("xmin"),this.commitProperty("ymin"),this.commitProperty("zmin"),this.commitProperty("mmin"),this.commitProperty("xmax"),this.commitProperty("ymax"),this.commitProperty("zmax"),this.commitProperty("mmax"),this.commitProperty("spatialReference"),{}}get center(){const e=new ri({x:.5*(this.xmin+this.xmax),y:.5*(this.ymin+this.ymax),spatialReference:this.spatialReference});return this.hasZ&&(e.z=.5*(this.zmin+this.zmax)),this.hasM&&(e.m=.5*(this.mmin+this.mmax)),e}get extent(){return this.clone()}get hasM(){return this.mmin!=null&&this.mmax!=null}get hasZ(){return this.zmin!=null&&this.zmax!=null}get height(){return Math.abs(this.ymax-this.ymin)}get width(){return Math.abs(this.xmax-this.xmin)}centerAt(e){const t=this.center;return e.z!=null&&this.hasZ?this.offset(e.x-t.x,e.y-t.y,e.z-t.z):this.offset(e.x-t.x,e.y-t.y)}clone(){const e=new jo;return e.xmin=this.xmin,e.ymin=this.ymin,e.xmax=this.xmax,e.ymax=this.ymax,e.spatialReference=this.spatialReference,this.zmin!=null&&(e.zmin=this.zmin,e.zmax=this.zmax),this.mmin!=null&&(e.mmin=this.mmin,e.mmax=this.mmax),e}contains(e){if(!e)return!1;const t=this.spatialReference,i=e.spatialReference;return t&&i&&!t.equals(i)&&Hv(t,i)&&(e=t.isWebMercator?Nc(e):im(e,!0)),e.type==="point"?xx(this,e):e.type==="extent"&&PW(this,e)}equals(e){if(this===e)return!0;if(e==null)return!1;const t=this.spatialReference,i=e.spatialReference;return t&&i&&!t.equals(i)&&Hv(t,i)&&(e=t.isWebMercator?Nc(e):im(e,!0)),this.xmin===e.xmin&&this.ymin===e.ymin&&this.zmin===e.zmin&&this.mmin===e.mmin&&this.xmax===e.xmax&&this.ymax===e.ymax&&this.zmax===e.zmax&&this.mmax===e.mmax}expand(e){const t=.5*(1-e),i=this.width*t,r=this.height*t;if(this.xmin+=i,this.ymin+=r,this.xmax-=i,this.ymax-=r,this.hasZ){const s=(this.zmax-this.zmin)*t;this.zmin+=s,this.zmax-=s}if(this.hasM){const s=(this.mmax-this.mmin)*t;this.mmin+=s,this.mmax-=s}return this}intersects(e){if(e==null)return!1;e.type==="mesh"&&(e=e.extent);const t=this.spatialReference,i=e.spatialReference;return t&&i&&!Js(t,i)&&Hv(t,i)&&(e=t.isWebMercator?Nc(e):im(e,!0)),UW(e.type)(this,e)}normalize(){const e=this._normalize(!1,!0);return Array.isArray(e)?e:[e]}offset(e,t,i){return this.xmin+=e,this.ymin+=t,this.xmax+=e,this.ymax+=t,i!=null&&(this.zmin+=i,this.zmax+=i),this}shiftCentralMeridian(){return this._normalize(!0)}union(e){return this===e||(this.xmin=Math.min(this.xmin,e.xmin),this.ymin=Math.min(this.ymin,e.ymin),this.xmax=Math.max(this.xmax,e.xmax),this.ymax=Math.max(this.ymax,e.ymax),(this.hasZ||e.hasZ)&&(this.zmin=bu(Math.min,this.zmin,e.zmin),this.zmax=bu(Math.max,this.zmax,e.zmax)),(this.hasM||e.hasM)&&(this.mmin=bu(Math.min,this.mmin,e.mmin),this.mmax=bu(Math.max,this.mmax,e.mmax))),this}intersection(e){return this===e?this:e!=null&&this.intersects(e)?(this.xmin=Math.max(this.xmin,e.xmin),this.ymin=Math.max(this.ymin,e.ymin),this.xmax=Math.min(this.xmax,e.xmax),this.ymax=Math.min(this.ymax,e.ymax),(this.hasZ||e.hasZ)&&(this.zmin=bu(Math.max,this.zmin,e.zmin),this.zmax=bu(Math.min,this.zmax,e.zmax)),(this.hasM||e.hasM)&&(this.mmin=bu(Math.max,this.mmin,e.mmin),this.mmax=bu(Math.min,this.mmax,e.mmax)),this):null}toJSON(e){return this.write({},e)}_shiftCM(e=ro(this.spatialReference)){if(!e||!this.spatialReference)return this;const t=this.spatialReference,i=this._getCM(e);if(i){const r=t.isWebMercator?im(i):i;this.xmin-=i.x,this.xmax-=i.x,t.isWebMercator||(r.x=this._normalizeX(r.x,e).x),this.spatialReference=new yi(O5((t.isWGS84?e.altTemplate:null)??e.wkTemplate,{Central_Meridian:r.x}))}return this}_getCM(e){let t=null;const[i,r]=e.valid,s=this.xmin,n=this.xmax;return s>=i&&s<=r&&n>=i&&n<=r||(t=this.center),t}_normalize(e,t,i){const r=this.spatialReference;if(!r)return this;const s=i??ro(r);if(s==null)return this;const n=this._getParts(s).map(f=>f.extent);if(n.length<2)return n[0]||this;if(n.length>2)return e?this._shiftCM(s):this.set({xmin:s.valid[0],xmax:s.valid[1]});if(e)return this._shiftCM(s);if(t)return n;let c=!0,o=!0;return n.forEach(f=>{f.hasZ||(c=!1),f.hasM||(o=!1)}),{rings:n.map(f=>{const g=[[f.xmin,f.ymin],[f.xmin,f.ymax],[f.xmax,f.ymax],[f.xmax,f.ymin],[f.xmin,f.ymin]];if(c){const S=(f.zmax-f.zmin)/2;for(let I=0;I0;if(o>2*A){const ve=new jo(fV||Q?t.push({extent:new jo(O,s,A,n,c),frameIds:[z]},{extent:new jo(I,s,V,n,c),frameIds:[H]}):t.push({extent:new jo(O,s,V,n,c),frameIds:[z]});this.cache._parts=t}const i=this.hasZ,r=this.hasM;if(i||r){const s={};i&&(s.zmin=this.zmin,s.zmax=this.zmax),r&&(s.mmin=this.mmin,s.mmax=this.mmax);for(let n=0;nr?(n=Math.ceil(Math.abs(e-r)/s),e-=n*s,c=n):eg0.splice(g0.indexOf(e),1))}const uE=[];function $A(e){return uE.push(e),er(()=>g0.splice(uE.indexOf(e),1))}function qW(){const e=gN();y0!==e&&(y0=e,[...uE].forEach(t=>{t.call(null,e)}),[...g0].forEach(t=>{t.call(null,e)}))}var u5;(u5=globalThis.addEventListener)==null||u5.call(globalThis,"languagechange",qW);let Q1;function HW(e){return Q1&&!Q1.destroyed||(Q1=e()),Q1}var hE;const WW=new ks({avgRating:"avg-rating",numRatings:"num-ratings",numComments:"num-comments",numViews:"num-views"});let Vo=hE=class extends Nt{constructor(e){super(e),this.categories=null,this.disableExtraQuery=!1,this.extent=null,this.filter=null,this.num=10,this.query=null,this.sortField=null,this.start=1}get sortOrder(){return this._get("sortOrder")||"asc"}set sortOrder(e){e!=="asc"&&e!=="desc"||this._set("sortOrder",e)}clone(){return new hE({categories:this.categories?He(this.categories):null,disableExtraQuery:this.disableExtraQuery,extent:this.extent?this.extent.clone():null,filter:this.filter,num:this.num,query:this.query,sortField:this.sortField,sortOrder:this.sortOrder,start:this.start})}toRequestOptions(e,t){let i=[];this.categories&&(i=this.categories.map(c=>Array.isArray(c)?JSON.stringify(c):c));let r="";if(this.extent){const c=wx(this.extent,yi.WGS84);c!=null&&(r=`${c.xmin},${c.ymin},${c.xmax},${c.ymax}`)}let s=this.query;!this.disableExtraQuery&&e.extraQuery&&(s="("+s+")"+e.extraQuery);const n={categories:i,bbox:r,q:s,filter:this.filter,num:this.num,sortField:null,sortOrder:null,start:this.start};return this.sortField&&(n.sortField=this.sortField.split(",").map(c=>WW.toJSON(c.trim())).join(","),n.sortOrder=this.sortOrder),{query:{...t,...n}}}};v([M()],Vo.prototype,"categories",void 0),v([M()],Vo.prototype,"disableExtraQuery",void 0),v([M({type:Ui})],Vo.prototype,"extent",void 0),v([M()],Vo.prototype,"filter",void 0),v([M()],Vo.prototype,"num",void 0),v([M()],Vo.prototype,"query",void 0),v([M()],Vo.prototype,"sortField",void 0),v([M()],Vo.prototype,"sortOrder",null),v([M()],Vo.prototype,"start",void 0),Vo=hE=v([fe("esri.portal.PortalQueryParams")],Vo);const Lc=Vo;var dE;let cs=dE=class extends At{constructor(e){super(e),this.access=null,this.created=null,this.description=null,this.id=null,this.isInvitationOnly=!1,this.modified=null,this.owner=null,this.portal=null,this.snippet=null,this.sortField=null,this.sortOrder=null,this.sourceJSON=null,this.tags=null,this.title=null}get thumbnailUrl(){var i;const e=this.url,t=this.thumbnail;return e&&t&&this.portal?(i=this.portal)==null?void 0:i.normalizeUrl(`${e}/info/${t}?f=json`):null}get url(){var t;const e=(t=this.portal)==null?void 0:t.restUrl;return e?e+"/community/groups/"+this.id:null}fetchCategorySchema(e){return this.portal.request(this.url+"/categorySchema",e).then(t=>{const i=t.categorySchema||[];return i.some(r=>r.source==="contentCategorySetsGroupQuery.LivingAtlas")?this._fetchCategorySchemaSet("LivingAtlas",e):i})}fetchMembers(e){return this.portal.request(this.url+"/users",e)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}toJSON(){throw new Je("internal:not-yet-implemented","PortalGroup.toJSON is not yet implemented")}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");const t=new dE;return t.sourceJSON=e,t.read(e),t}queryItems(e,t){let i=Fn(Lc,e);const r=this.portal;return parseFloat(r.currentVersion)>5?(i=i||new Lc,r.queryPortal(`/content/groups/${this.id}/search`,i,"PortalItem",t)):(i=i?i.clone():new Lc,i.query="group:"+this.id+(i.query?" "+i.query:""),r.queryItems(i,t))}_fetchCategorySchemaSet(e,t){const i=this.portal;return i.fetchSelf(i.authMode,!0,t).then(r=>{const s=r.contentCategorySetsGroupQuery;if(s){const n=new Lc;return n.disableExtraQuery=!0,n.num=1,n.query=s,i.queryGroups(n,t)}throw new Je("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery value not found")}).then(r=>{if(r.total){const s=r.results[0],n=new Lc;return n.num=1,n.query=`typekeywords:"${e}"`,s.queryItems(n,t)}throw new Je("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery group not found")}).then(r=>r.total?r.results[0].fetchData("json",t).then(s=>{const n=s==null?void 0:s.categorySchema;return n!=null&&n.length?n:[]}):[])}};v([M()],cs.prototype,"access",void 0),v([M({type:Date})],cs.prototype,"created",void 0),v([M()],cs.prototype,"description",void 0),v([M()],cs.prototype,"id",void 0),v([M()],cs.prototype,"isInvitationOnly",void 0),v([M({type:Date})],cs.prototype,"modified",void 0),v([M()],cs.prototype,"owner",void 0),v([M()],cs.prototype,"portal",void 0),v([M()],cs.prototype,"snippet",void 0),v([M()],cs.prototype,"sortField",void 0),v([M()],cs.prototype,"sortOrder",void 0),v([M()],cs.prototype,"sourceJSON",void 0),v([M()],cs.prototype,"tags",void 0),v([M()],cs.prototype,"thumbnail",void 0),v([M({readOnly:!0})],cs.prototype,"thumbnailUrl",null),v([M()],cs.prototype,"title",void 0),v([M({readOnly:!0})],cs.prototype,"url",null),cs=dE=v([fe("esri.portal.PortalGroup")],cs);const pE=cs;let hd=class extends Nt{constructor(t){super(t),this.nextQueryParams=null,this.queryParams=null,this.results=null,this.total=null}};v([M()],hd.prototype,"nextQueryParams",void 0),v([M()],hd.prototype,"queryParams",void 0),v([M()],hd.prototype,"results",void 0),v([M()],hd.prototype,"total",void 0),hd=v([fe("esri.portal.PortalQueryResult")],hd);const ZW=hd;let _c=class extends At{constructor(t){super(t),this.created=null,this.id=null,this.portal=null,this.title=null,this.username=null}get url(){var i;const t=(i=this.portal)==null?void 0:i.restUrl;return t?`${t}/content/users/${this.username}/${this.id}`:null}toJSON(){throw new Je("internal:not-yet-implemented","PortalFolder.toJSON is not yet implemented")}};v([M({type:Date})],_c.prototype,"created",void 0),v([M()],_c.prototype,"id",void 0),v([M()],_c.prototype,"portal",void 0),v([M()],_c.prototype,"title",void 0),v([M({readOnly:!0})],_c.prototype,"url",null),v([M()],_c.prototype,"username",void 0),_c=v([fe("esri.portal.PortalFolder")],_c);const YW=_c;var fE;let or=fE=class extends At{constructor(...e){super(...e),this.access=null,this.created=null,this.culture=null,this.description=null,this.email=null,this.fullName=null,this.modified=null,this.orgId=null,this.portal=null,this.preferredView=null,this.privileges=null,this.region=null,this.role=null,this.roleId=null,this.sourceJSON=null,this.units=null,this.username=null,this.userType=null}get thumbnailUrl(){const e=this.url,t=this.thumbnail;return e&&t?this.portal.normalizeUrl(`${e}/info/${t}?f=json`):null}get userContentUrl(){var t;const e=(t=this.portal)==null?void 0:t.restUrl;return e?`${e}/content/users/${this.username}`:null}get url(){var t;const e=(t=this.portal)==null?void 0:t.restUrl;return e?`${e}/community/users/${this.username}`:null}addItem(e){const t=e&&e.item,i=e==null?void 0:e.data,r=e==null?void 0:e.folder,s={method:"post"};t&&(s.query=t.createPostQuery(),i!=null&&(typeof i=="string"?s.query.text=i:typeof i=="object"&&(s.query.text=JSON.stringify(i))));let n=this.userContentUrl;return r&&(n+="/"+(typeof r=="string"?r:r.id)),this.portal.request(n+"/addItem",s).then(c=>(t.id=c.id,t.portal=this.portal,t.loaded?t.reload():t.load()))}deleteItem(e){let t=this.userContentUrl;return e.ownerFolder&&(t+="/"+e.ownerFolder),this.portal.request(t+`/items/${e.id}/delete`,{method:"post"}).then(()=>{e.id=null,e.portal=null})}deleteItems(e){const t=this.userContentUrl+"/deleteItems",i=e.map(r=>r.id);if(i.length){const r={method:"post",query:{items:i.join(",")}};return this.portal.request(t,r).then(()=>{e.forEach(s=>{s.id=null,s.portal=null})})}return Promise.resolve(void 0)}fetchFolders(){const e={query:{num:1}};return this.portal.request(this.userContentUrl??"",e).then(t=>{let i;return i=t&&t.folders?t.folders.map(r=>{const s=YW.fromJSON(r);return s.portal=this.portal,s}):[],i})}fetchGroups(){return this.portal.request(this.url??"").then(e=>{let t;return t=e&&e.groups?e.groups.map(i=>{const r=pE.fromJSON(i);return r.portal=this.portal,r}):[],t})}fetchItems(e){const t=e??{};let i,r=this.userContentUrl??"";return t.folder&&(r+="/"+t.folder.id),ht(()=>Promise.resolve().then(()=>vN),void 0).then(({default:s})=>{i=s;const n={folders:!1,num:t.num||10,start:t.start||1,sortField:t.sortField||"created",sortOrder:t.sortOrder||"asc"};return this.portal.request(r,{query:n})}).then(s=>{let n;return s!=null&&s.items?(n=s.items.map(c=>{const o=i.fromJSON(c);return o.portal=this.portal,o}),Promise.all(n.map(c=>c.load())).catch(c=>c).then(()=>({items:n,nextStart:s.nextStart,total:s.total}))):{items:[],nextStart:-1,total:0}})}fetchTags(){return this.portal.request(this.url+"/tags").then(e=>e.tags)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}queryFavorites(e){return this.favGroupId?(this._favGroup||(this._favGroup=new pE({id:this.favGroupId,portal:this.portal})),this._favGroup.queryItems(e)):Promise.reject(new Je("internal:unknown","Unknown internal error",{internalError:"Unknown favGroupId"}))}toJSON(){throw new Je("internal:not-yet-implemented","PortalUser.toJSON is not yet implemented")}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");const t=new fE;return t.sourceJSON=e,t.read(e),t}};v([M()],or.prototype,"access",void 0),v([M({type:Date})],or.prototype,"created",void 0),v([M()],or.prototype,"culture",void 0),v([M()],or.prototype,"description",void 0),v([M()],or.prototype,"email",void 0),v([M()],or.prototype,"favGroupId",void 0),v([M()],or.prototype,"fullName",void 0),v([M({type:Date})],or.prototype,"modified",void 0),v([M()],or.prototype,"orgId",void 0),v([M()],or.prototype,"portal",void 0),v([M()],or.prototype,"preferredView",void 0),v([M()],or.prototype,"privileges",void 0),v([M()],or.prototype,"region",void 0),v([M()],or.prototype,"role",void 0),v([M()],or.prototype,"roleId",void 0),v([M()],or.prototype,"sourceJSON",void 0),v([M()],or.prototype,"thumbnail",void 0),v([M({readOnly:!0})],or.prototype,"thumbnailUrl",null),v([M()],or.prototype,"units",void 0),v([M({readOnly:!0})],or.prototype,"userContentUrl",null),v([M({readOnly:!0})],or.prototype,"url",null),v([M()],or.prototype,"username",void 0),v([M()],or.prototype,"userType",void 0),or=fE=v([fe("esri.portal.PortalUser")],or);const kA=or;var mo;let ev;const D$={PortalGroup:()=>Promise.resolve({default:pE}),PortalItem:()=>ht(()=>Promise.resolve().then(()=>vN),void 0),PortalUser:()=>Promise.resolve({default:kA})};let st=mo=class extends y_(dh){constructor(e){super(e),this._esriIdCredentialCreateHandle=null,this.access=null,this.allSSL=!1,this.authMode="auto",this.authorizedCrossOriginDomains=null,this.basemapGalleryGroupQuery=null,this.basemapGalleryGroupQuery3D=null,this.bingKey=null,this.canListApps=!1,this.canListData=!1,this.canListPreProvisionedItems=!1,this.canProvisionDirectPurchase=!1,this.canSearchPublic=!0,this.canShareBingPublic=!1,this.canSharePublic=!1,this.canSignInArcGIS=!1,this.canSignInIDP=!1,this.colorSetsGroupQuery=null,this.commentsEnabled=!1,this.created=null,this.culture=null,this.customBaseUrl=null,this.defaultBasemap=null,this.defaultDevBasemap=null,this.defaultExtent=null,this.defaultVectorBasemap=null,this.description=null,this.devBasemapGalleryGroupQuery=null,this.eueiEnabled=null,this.featuredGroups=null,this.featuredItemsGroupQuery=null,this.galleryTemplatesGroupQuery=null,this.layoutGroupQuery=null,this.livingAtlasGroupQuery=null,this.hasCategorySchema=!1,this.helperServices=null,this.homePageFeaturedContent=null,this.homePageFeaturedContentCount=null,this.httpPort=null,this.httpsPort=null,this.id=null,this.ipCntryCode=null,this.isPortal=!1,this.isReadOnly=!1,this.layerTemplatesGroupQuery=null,this.maxTokenExpirationMinutes=null,this.modified=null,this.name=null,this.portalHostname=null,this.portalMode=null,this.portalProperties=null,this.region=null,this.rotatorPanels=null,this.showHomePageDescription=!1,this.sourceJSON=null,this.supportsHostedServices=!1,this.symbolSetsGroupQuery=null,this.templatesGroupQuery=null,this.units=null,this.url=Ci.portalUrl,this.urlKey=null,this.user=null,this.use3dBasemaps=!0,this.useStandardizedQuery=!1,this.useVectorBasemaps=!1,this.vectorBasemapGalleryGroupQuery=null}normalizeCtorArgs(e){return typeof e=="string"?{url:e}:e}destroy(){N$.unregister(this),this.defaultBasemap=lr(this.defaultBasemap),this.defaultDevBasemap=lr(this.defaultDevBasemap),this.defaultVectorBasemap=lr(this.defaultVectorBasemap),this._esriIdCredentialCreateHandle=Sr(this._esriIdCredentialCreateHandle)}readAuthorizedCrossOriginDomains(e){if(e)for(const t of e)Ci.request.trustedServers.includes(t)||Ci.request.trustedServers.push(t);return e}readDefaultBasemap(e){return this._readBasemap(e)}readDefaultDevBasemap(e){return this._readBasemap(e)}readDefaultVectorBasemap(e){return this._readBasemap(e)}get extraQuery(){var i;const e=(i=this.user)==null?void 0:i.orgId,t=!e||this.canSearchPublic;return this.id&&!t?` AND orgid:${this.id}`:null}get isOrganization(){return!!this.access}get itemPageUrl(){return this.url?`${this.url}/home/item.html`:null}get restUrl(){let e=this.url;if(e){const t=e.indexOf("/sharing");e=t>0?e.substring(0,t):this.url.replace(/\/+$/,""),e+="/sharing/rest"}return e}get thumbnailUrl(){const e=this.restUrl,t=this.thumbnail;return e&&t?this._normalizeSSL(e+"/portals/self/resources/"+t):null}readUrlKey(e){return e&&e.toLowerCase()}readUser(e){let t=null;return e&&(t=kA.fromJSON(e),t.portal=this),t}load(e){const t=ht(()=>Promise.resolve().then(()=>IZ),void 0).then(({default:i})=>{mr(e),ev=i}).then(()=>this.sourceJSON?this.sourceJSON:this.fetchSelf(this.authMode,!1,e)).then(i=>{var r;if(bi){const s=bi;this.credential=s.findCredential(this.restUrl),this.credential||this.authMode!==mo.AUTH_MODE_AUTO&&this.authMode!==mo.AUTH_MODE_NO_PROMPT||((r=this._esriIdCredentialCreateHandle)==null||r.remove(),this._esriIdCredentialCreateHandle=s.on("credential-create",JW(new WeakRef(this))),N$.register(this,this._esriIdCredentialCreateHandle,this))}this.sourceJSON=i,this.read(i)});return this.addResolvingPromise(t),Promise.resolve(this)}async createElevationLayers(){await this.load();const e=this._getHelperService("defaultElevationLayers"),t=(await ht(()=>import("./ElevationLayer-D3CeIkQP.js"),[])).default;return e?e.map(i=>new t({id:i.id,url:i.url})):[]}async fetchBasemaps(e,t){const i=await this._fetchBasemaps(e,t);if((t==null?void 0:t.include3d)===!0&&this.use3dBasemaps!==!1){const r=await this._fetchBasemaps3D(e,t);i.unshift(...r)}return i}fetchCategorySchema(e){return this.hasCategorySchema?this.request(this.restUrl+"/portals/self/categorySchema",e).then(t=>t.categorySchema):ra(e)?Promise.reject(jr()):Promise.resolve([])}fetchFeaturedGroups(e){const t=this.featuredGroups,i=new Lc;if(i.num=100,i.sortField="title",t&&t.length){const r=[];for(const s of t)r.push(`(title:"${s.title}" AND owner:${s.owner})`);return i.query=r.join(" OR "),this.queryGroups(i,e).then(s=>s.results)}return ra(e)?Promise.reject(jr()):Promise.resolve([])}fetchRegions(e){var i;const t=((i=this.user)==null?void 0:i.culture)||this.culture||wo();return this.request(this.restUrl+"/portals/regions",{...e,query:{culture:t}})}fetchSettings(e){var i;const t=((i=this.user)==null?void 0:i.culture)||this.culture||wo();return this.request(this.restUrl+"/portals/self/settings",{...e,query:{culture:t}})}static getDefault(){return HW(()=>new mo)}queryGroups(e,t){return this.queryPortal("/community/groups",e,"PortalGroup",t)}queryItems(e,t){return this.queryPortal("/search",e,"PortalItem",t)}queryUsers(e,t){return e.sortField||(e.sortField="username"),this.queryPortal("/community/users",e,"PortalUser",t)}fetchSelf(e=this.authMode,t=!1,i){const r=this.restUrl+"/portals/self",s={authMode:e,query:{culture:wo().toLowerCase()},withCredentials:!0,...i};return s.authMode==="auto"&&(s.authMode="no-prompt"),t&&(s.query.default=!0),this.request(r,s)}queryPortal(e,t,i,r){const s=Fn(Lc,t),n=c=>this.request(this.restUrl+e,{...s.toRequestOptions(this),...r}).then(o=>{const f=s.clone();return f.start=o.nextStart,new ZW({nextQueryParams:f,queryParams:s,total:o.total,results:mo._resultsToTypedArray(c,{portal:this},o,r)})}).then(o=>Promise.all(o.results.map(f=>typeof f.when=="function"?f.when():o)).then(()=>o,f=>(Na(f),o)));return i&&D$[i]?D$[i]().then(({default:c})=>(mr(r),n(c))):n()}signIn(){if(this.authMode===mo.AUTH_MODE_ANONYMOUS||this.authMode===mo.AUTH_MODE_NO_PROMPT&&!bi)return Promise.reject(new Je("portal:invalid-auth-mode",`Current "authMode"' is "${this.authMode}"`));if(this.loadStatus==="failed")return Promise.reject(this.loadError);const e=t=>Promise.resolve().then(()=>this.loadStatus==="not-loaded"?(t||(this.authMode="immediate"),this.load().then(()=>null)):this.loadStatus==="loading"?this.load().then(()=>this.credential?null:(this.credential=t,this.fetchSelf("immediate"))):this.user&&this.credential===t?null:(this.credential=t,this.fetchSelf("immediate"))).then(i=>{i&&(this.sourceJSON=i,this.read(i))});return bi?bi.getCredential(this.restUrl,{prompt:this.authMode!==mo.AUTH_MODE_NO_PROMPT}).then(t=>e(t)):e(this.credential)}normalizeUrl(e){var i;const t=(i=this.credential)==null?void 0:i.token;return this._normalizeSSL(t?e+(e.includes("?")?"&":"?")+"token="+t:e)}requestToTypedArray(e,t,i){return this.request(e,t).then(r=>{const s=mo._resultsToTypedArray(i,{portal:this},r);return Promise.all(s.map(n=>typeof n.when=="function"?n.when():r)).then(()=>s,()=>s)})}request(e,t={}){const i={f:"json",...t.query},{authMode:r=this.authMode===mo.AUTH_MODE_ANONYMOUS||this.authMode===mo.AUTH_MODE_NO_PROMPT?this.authMode:"auto",body:s=null,cacheBust:n=!1,method:c="auto",responseType:o="json",signal:f}=t,g={authMode:r,body:s,cacheBust:n,method:c,query:i,responseType:o,timeout:0,signal:f};return t.withCredentials&&(g.withCredentials=!0),Qi(this._normalizeSSL(e),g).then(S=>S.data)}toJSON(){throw new Je("internal:not-yet-implemented","Portal.toJSON is not yet implemented")}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new mo({sourceJSON:e})}_getHelperService(e){const t=this.helperServices&&this.helperServices[e];if(!t)throw new Je("portal:service-not-found",`The \`helperServices\` do not include an entry named "${e}"`);return t}async _fetchBasemaps(e,t){const i=new Lc;i.query=e||(Ci.apiKey&&V4(this.url)?this.devBasemapGalleryGroupQuery:this.useVectorBasemaps?this.vectorBasemapGalleryGroupQuery:this.basemapGalleryGroupQuery),i.disableExtraQuery=!0;const r=await this.queryGroups(i,t);if(!r.total)return[];const s=r.results[0];i.num=100,i.query='type:"Web Map" -type:"Web Application"',i.sortField=s.sortField||"name",i.sortOrder=s.sortOrder||"desc";const n=await s.queryItems(i,t);return n.total?n.results.filter(c=>c.type==="Web Map").map(c=>new ev({portalItem:c})):[]}async _fetchBasemaps3D(e,t){const i=e||this.basemapGalleryGroupQuery3D;if(!i)return[];const r=new Lc({query:i,disableExtraQuery:!0}),s=await this.queryGroups(r,t);if(!s.total)return[];const n=s.results[0];r.num=100,r.query='type:"Web Scene"',r.sortField=n.sortField||"name",r.sortOrder=n.sortOrder||"desc";const c=await n.queryItems(r,t);return c.total?c.results.filter(o=>o.type==="Web Scene").map(o=>new ev({portalItem:o})):[]}_normalizeSSL(e){return e.replace(/^http:/i,"https:").replace(":7080",":7443")}_readBasemap(e){if(e){const t=ev.fromJSON(e);return t.portalItem={portal:this},t}return null}static _resultsToTypedArray(e,t,i,r){let s=[];if(i){const n=r!=null?r.signal:null;s=i.listings||i.notifications||i.userInvitations||i.tags||i.items||i.groups||i.comments||i.provisions||i.results||i.relatedItems||i,(e||t)&&(s=s.map(c=>{const o=Object.assign(e?e.fromJSON(c):c,t);return typeof o.load=="function"&&o.load(n),o}))}else s=[];return s}};st.AUTH_MODE_ANONYMOUS="anonymous",st.AUTH_MODE_AUTO="auto",st.AUTH_MODE_IMMEDIATE="immediate",st.AUTH_MODE_NO_PROMPT="no-prompt",v([M()],st.prototype,"access",void 0),v([M()],st.prototype,"allSSL",void 0),v([M()],st.prototype,"authMode",void 0),v([M()],st.prototype,"authorizedCrossOriginDomains",void 0),v([mi("authorizedCrossOriginDomains")],st.prototype,"readAuthorizedCrossOriginDomains",null),v([M()],st.prototype,"basemapGalleryGroupQuery",void 0),v([M({json:{name:"3DBasemapGalleryGroupQuery"}})],st.prototype,"basemapGalleryGroupQuery3D",void 0),v([M()],st.prototype,"bingKey",void 0),v([M()],st.prototype,"canListApps",void 0),v([M()],st.prototype,"canListData",void 0),v([M()],st.prototype,"canListPreProvisionedItems",void 0),v([M()],st.prototype,"canProvisionDirectPurchase",void 0),v([M()],st.prototype,"canSearchPublic",void 0),v([M()],st.prototype,"canShareBingPublic",void 0),v([M()],st.prototype,"canSharePublic",void 0),v([M()],st.prototype,"canSignInArcGIS",void 0),v([M()],st.prototype,"canSignInIDP",void 0),v([M()],st.prototype,"colorSetsGroupQuery",void 0),v([M()],st.prototype,"commentsEnabled",void 0),v([M({type:Date})],st.prototype,"created",void 0),v([M()],st.prototype,"credential",void 0),v([M()],st.prototype,"culture",void 0),v([M()],st.prototype,"currentVersion",void 0),v([M()],st.prototype,"customBaseUrl",void 0),v([M()],st.prototype,"defaultBasemap",void 0),v([mi("defaultBasemap")],st.prototype,"readDefaultBasemap",null),v([M()],st.prototype,"defaultDevBasemap",void 0),v([mi("defaultDevBasemap")],st.prototype,"readDefaultDevBasemap",null),v([M({type:Ui})],st.prototype,"defaultExtent",void 0),v([M()],st.prototype,"defaultVectorBasemap",void 0),v([mi("defaultVectorBasemap")],st.prototype,"readDefaultVectorBasemap",null),v([M()],st.prototype,"description",void 0),v([M()],st.prototype,"devBasemapGalleryGroupQuery",void 0),v([M()],st.prototype,"eueiEnabled",void 0),v([M({readOnly:!0})],st.prototype,"extraQuery",null),v([M()],st.prototype,"featuredGroups",void 0),v([M()],st.prototype,"featuredItemsGroupQuery",void 0),v([M()],st.prototype,"galleryTemplatesGroupQuery",void 0),v([M()],st.prototype,"layoutGroupQuery",void 0),v([M()],st.prototype,"livingAtlasGroupQuery",void 0),v([M()],st.prototype,"hasCategorySchema",void 0),v([M()],st.prototype,"helpBase",void 0),v([M()],st.prototype,"helperServices",void 0),v([M()],st.prototype,"helpMap",void 0),v([M()],st.prototype,"homePageFeaturedContent",void 0),v([M()],st.prototype,"homePageFeaturedContentCount",void 0),v([M()],st.prototype,"httpPort",void 0),v([M()],st.prototype,"httpsPort",void 0),v([M()],st.prototype,"id",void 0),v([M()],st.prototype,"ipCntryCode",void 0),v([M({readOnly:!0})],st.prototype,"isOrganization",null),v([M()],st.prototype,"isPortal",void 0),v([M()],st.prototype,"isReadOnly",void 0),v([M({readOnly:!0})],st.prototype,"itemPageUrl",null),v([M()],st.prototype,"layerTemplatesGroupQuery",void 0),v([M()],st.prototype,"maxTokenExpirationMinutes",void 0),v([M({type:Date})],st.prototype,"modified",void 0),v([M()],st.prototype,"name",void 0),v([M()],st.prototype,"portalHostname",void 0),v([M()],st.prototype,"portalMode",void 0),v([M()],st.prototype,"portalProperties",void 0),v([M()],st.prototype,"region",void 0),v([M({readOnly:!0})],st.prototype,"restUrl",null),v([M()],st.prototype,"rotatorPanels",void 0),v([M()],st.prototype,"showHomePageDescription",void 0),v([M()],st.prototype,"sourceJSON",void 0),v([M()],st.prototype,"staticImagesUrl",void 0),v([M({json:{name:"2DStylesGroupQuery"}})],st.prototype,"stylesGroupQuery2d",void 0),v([M({json:{name:"stylesGroupQuery"}})],st.prototype,"stylesGroupQuery3d",void 0),v([M()],st.prototype,"supportsHostedServices",void 0),v([M()],st.prototype,"symbolSetsGroupQuery",void 0),v([M()],st.prototype,"templatesGroupQuery",void 0),v([M()],st.prototype,"thumbnail",void 0),v([M({readOnly:!0})],st.prototype,"thumbnailUrl",null),v([M()],st.prototype,"units",void 0),v([M()],st.prototype,"url",void 0),v([M()],st.prototype,"urlKey",void 0),v([mi("urlKey")],st.prototype,"readUrlKey",null),v([M()],st.prototype,"user",void 0),v([mi("user")],st.prototype,"readUser",null),v([M()],st.prototype,"use3dBasemaps",void 0),v([M()],st.prototype,"useStandardizedQuery",void 0),v([M()],st.prototype,"useVectorBasemaps",void 0),v([M()],st.prototype,"vectorBasemapGalleryGroupQuery",void 0),st=mo=v([fe("esri.portal.Portal")],st);const Za=st,N$=new FinalizationRegistry(e=>{e.remove()});function JW(e){const t=bi;return()=>{const i=e.deref();i&&t.findCredential(i.restUrl)&&i.signIn().catch(()=>{})}}let vc=class extends Nt{constructor(t){super(t),this.portalItem=null}normalizeCtorArgs(t){return t!=null&&t.portalItem&&t.path?{...t,path:this._normalizePath(t.path,t.portalItem)}:t}set path(t){t!=null&&zn(t)?_t.getLogger(this).error("portalitemresource:invalid-path","A portal item resource path must be relative"):this._set("path",t)}_castPath(t){return this._normalizePath(t,this.portalItem)}get url(){return this.portalItem&&this.path?`${this.portalItem.itemUrl}/resources/${this.path}`:null}get cdnUrl(){return this.portalItem&&this.path?`${this.portalItem.itemCdnUrl}/resources/${this.path}`:null}get itemRelativeUrl(){return this.portalItem&&this.path?`./resources/${this.path}`:null}fetch(t="json",i){const r=this.cdnUrl;if(r==null)throw new Je("portal-item-resource:fetch","Portal item resource does not refer to a valid item or path");return this.portalItem.portal.request(r,{responseType:t,query:{token:this.portalItem.apiKey},signal:i==null?void 0:i.signal})}async update(t,i){const{addOrUpdateResources:r}=await ht(()=>import("./resourceUtils-CjqYbm2Q.js"),[]);return await r(this.portalItem,[{resource:this,content:t,compress:i==null?void 0:i.compress,access:i==null?void 0:i.access}],"update",i),this}hasPath(){return this.path!=null}_normalizePath(t,i){return t==null?t:(t=t.replace(/^\/+/,""),i!=null&&zn(t)&&(t=yA(t,i.itemUrl)),t==null?void 0:t.replace(/^\/+/,"").replace(/^(\.\/)?resources\//,""))}};v([M()],vc.prototype,"portalItem",void 0),v([M({type:String,value:null})],vc.prototype,"path",null),v([Rs("path")],vc.prototype,"_castPath",null),v([M({type:String,readOnly:!0})],vc.prototype,"url",null),v([M({type:String,readOnly:!0})],vc.prototype,"cdnUrl",null),v([M({type:String,readOnly:!0})],vc.prototype,"itemRelativeUrl",null),vc=v([fe("esri.portal.PortalItemResource")],vc);const KW=vc;let Ig=class extends Nt{constructor(t){super(t),this.created=null,this.rating=null}};v([M()],Ig.prototype,"created",void 0),v([M()],Ig.prototype,"rating",void 0),Ig=v([fe("esri.portal.PortalRating")],Ig);const IS=Ig;function __(e,t){var r;const i=(r=t==null?void 0:t.url)==null?void 0:r.path;if(e&&i&&(e=Xo(e,i,{preserveProtocolRelative:!0}),t.portalItem&&t.readResourcePaths)){const s=yA(e,t.portalItem.itemUrl);s!=null&&XW.test(s)&&t.readResourcePaths.push(t.portalItem.resourceFromPath(s).path)}return(e=mE(e,t==null?void 0:t.portal))&&Tx.test(e)?LA(e):e}function Sx(e,t,i=H0.YES){var s,n;if((e=e&&Tx.test(e)?_N(e):e)==null)return e;!zn(e)&&(t!=null&&t.blockedRelativeUrls)&&t.blockedRelativeUrls.push(e);let r=Xo(e);if(t){const c=((s=t.verifyItemRelativeUrls)==null?void 0:s.rootPath)||((n=t.url)==null?void 0:n.path);if(c){const o=mE(c,t.portal),f=mE(r,t.portal);r=yA(f,o,o),r!=null&&r!==f&&r!==e&&t.verifyItemRelativeUrls&&t.verifyItemRelativeUrls.writtenUrls.push(r)}}return r=OA(r,t==null?void 0:t.portal),zn(r)&&(r=ta(r)),t!=null&&t.resources&&(t!=null&&t.portalItem)&&!zn(r)&&!Cp(r)&&i===H0.YES&&t.resources.toKeep.push({resource:t.portalItem.resourceFromPath(r),compress:!1}),r}function RA(e,t,i){return __(e,i)}function xp(e,t,i,r){const s=Sx(e,r);s!==void 0&&(t[i]=s)}const Tx=/\/items\/([^\/]+)\/resources\/(.*)/,XW=/^\.\/resources\//;function QW(e){const t=(e==null?void 0:e.match(Tx))??null;return(t==null?void 0:t[1])??null}function eZ(e){const t=(e==null?void 0:e.match(Tx))??null;if(t==null)return null;const i=t[2],r=i.lastIndexOf("/");if(r===-1){const{path:c,extension:o}=x$(i);return{prefix:null,filename:c,extension:o}}const{path:s,extension:n}=x$(i.slice(r+1));return{prefix:i.slice(0,r),filename:s,extension:n}}function OA(e,t){return t&&!t.isPortal&&t.urlKey&&t.customBaseUrl?KT(e,`${t.urlKey}.${t.customBaseUrl}`,t.portalHostname):e}function mE(e,t){if(!t||t.isPortal||!t.urlKey||!t.customBaseUrl)return e;const i=`${t.urlKey}.${t.customBaseUrl}`,r=dA();return Im(r,`${r.scheme}://${i}`)?KT(e,t.portalHostname,i):KT(e,i,t.portalHostname)}function LA(e){if(!e)return e||null;let t=e;return t&&bi&&!bi.findCredential(t)&&(t=bi._normalizeAGOLorgDomain(t),t=t.replace(/^https?:\/\/www\.arcgis\.com/,"https://cdn.arcgis.com"),t=t.replace(/^https?:\/\/devext\.arcgis\.com/,"https://cdndev.arcgis.com"),t=t.replace(/^https?:\/\/qaext\.arcgis\.com/,"https://cdnqa.arcgis.com")),t}function _N(e){if(!e)return e||null;let t=e;return t=t.replace(/^https?:\/\/cdn\.arcgis\.com/,"https://www.arcgis.com"),t=t.replace(/^https?:\/\/cdndev\.arcgis\.com/,"https://devext.arcgis.com"),t=t.replace(/^https?:\/\/cdnqa\.arcgis\.com/,"https://qaext.arcgis.com"),t&&bi&&!bi.findCredential(t)&&(t=bi._normalizeAGOLorgDomain(t)),t}var H0;(function(e){e[e.YES=0]="YES",e[e.NO=1]="NO"})(H0||(H0={}));const oge=Object.freeze(Object.defineProperty({__proto__:null,get MarkKeep(){return H0},ensureMainOnlineDomain:OA,fromCDNUrl:_N,fromJSON:__,itemIdFromResourceUrl:QW,prefixAndFilenameFromResourceUrl:eZ,read:RA,toCDNUrl:LA,toJSON:Sx,write:xp},Symbol.toStringTag,{value:"Module"}));var dd;const tZ=new Set(["3DTiles Service","CSV","Feature Collection","Feature Service","Feed","GeoJson","Group Layer","Image Service","KML","Map Service","Media Layer","Scene Service","Stream Service","Vector Tile Service","WFS","WMS","WMTS"]),iZ=new Set(["KML","GeoJson","CSV"]);let ii=dd=class extends y_(dh){static from(e){return px(dd,e)}constructor(e){super(e),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.isOrgItem=!1,this.itemControl=null,this.licenseInfo=null,this.modified=null,this.name=null,this.numComments=null,this.numRatings=null,this.numViews=null,this.owner=null,this.ownerFolder=null,this.portal=null,this.screenshots=null,this.size=null,this.snippet=null,this.sourceJSON=null,this.sourceUrl=null,this.spatialReference=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}destroy(){this.portal=null}get displayName(){const e=this.type,t=this.typeKeywords||[];let i=e;return e==="Feature Service"||e==="Feature Collection"?i=t.includes("Table")?"Table":t.includes("Route Layer")?"Route Layer":t.includes("Markup")?"Markup":"Feature Layer":e==="Image Service"?i=t.includes("Elevation 3D Layer")?"Elevation Layer":t.includes("Tiled Imagery")?"Tiled Imagery Layer":"Imagery Layer":e==="Scene Service"?i="Scene Layer":e==="Video Service"?i="Video Layer":e==="Scene Package"?i="Scene Layer Package":e==="Stream Service"?i="Feature Layer":e==="Geoprocessing Service"?i=t.includes("Web Tool")?"Tool":"Geoprocessing Service":e==="Geoenrichment Service"?i="GeoEnrichment Service":e==="Geocoding Service"?i="Locator":e==="Microsoft Powerpoint"?i="Microsoft PowerPoint":e==="GeoJson"?i="GeoJSON":e==="Globe Service"?i="Globe Layer":e==="Vector Tile Service"?i="Tile Layer":e==="netCDF"?i="NetCDF":e==="Map Service"?i=t.includes("Spatiotemporal")||!t.includes("Hosted Service")&&!t.includes("Tiled")||t.includes("Relational")?"Map Image Layer":"Tile Layer":e&&e.toLowerCase().includes("add in")?i=e.replaceAll(/(add in)/gi,"Add-In"):e==="datastore catalog service"?i="Big Data File Share":e==="Compact Tile Package"?i="Tile Package (tpkx)":e==="Raster function template"?i="Raster Function Template":e==="OGCFeatureServer"?i="OGC Feature Layer":e==="web mapping application"&&t.includes("configurableApp")?i="Instant App":e==="Insights Page"?i="Insights Report":e==="Excalibur Imagery Project"?i="Excalibur Project":e==="3DTiles Service"?i="3D tiles layer":e==="3DTiles Package"&&(i="3D tiles package"),i}readExtent(e){return e&&e.length?new Ui(e[0][0],e[0][1],e[1][0],e[1][1]):null}get iconUrl(){var O;const e=((O=this.type)==null?void 0:O.toLowerCase())||"",t=this.typeKeywords||[],i="esri/images/portal/",r="16";let s,n=!1,c=!1,o=!1,f=!1,g=!1,S=!1,I=!1,A=!1;return e.indexOf("service")>0||e==="feature collection"||e==="kml"||e==="wms"||e==="wmts"||e==="wfs"?(n=t.includes("Hosted Service"),e==="feature service"||e==="feature collection"||e==="kml"||e==="wfs"?(c=t.includes("Table"),o=t.includes("Route Layer"),f=t.includes("Markup"),g=t.includes("Spatiotemporal"),S=t.includes("UtilityNetwork"),s=g&&c?"spatiotemporaltable":c?"table":o?"routelayer":f?"markup":g?"spatiotemporal":S?"utilitynetwork":n?"featureshosted":"features"):e==="map service"||e==="wms"||e==="wmts"?(g=t.includes("Spatiotemporal"),I=t.includes("Relational"),s=g||I?"mapimages":n||t.includes("Tiled")||e==="wmts"?"maptiles":"mapimages"):s=e==="scene service"?t.includes("Line")?"sceneweblayerline":t.includes("3DObject")?"sceneweblayermultipatch":t.includes("Point")?"sceneweblayerpoint":t.includes("IntegratedMesh")?"sceneweblayermesh":t.includes("PointCloud")?"sceneweblayerpointcloud":t.includes("Polygon")?"sceneweblayerpolygon":t.includes("Building")?"sceneweblayerbuilding":t.includes("Voxel")?"sceneweblayervoxel":"sceneweblayer":e==="image service"?t.includes("Elevation 3D Layer")?"elevationlayer":t.includes("Tiled Imagery")?"tiledimagerylayer":"imagery":e==="stream service"?"streamlayer":e==="vector tile service"?"vectortile":e==="datastore catalog service"?"datastorecollection":e==="geocoding service"?"geocodeservice":e==="video service"?t.includes("Live Stream")?"livestreamvideolayer":"videolayer":e==="geoprocessing service"?t.includes("Web Tool")?"tool":"layers":e==="geodata service"?"geodataservice":e==="3dtiles service"?t.includes("3DObject")?"3dobjecttileslayer":t.includes("IntegratedMesh")?"integratedmeshtileslayer":"3dtileslayer":"layers"):e==="web map"||e==="cityengine web scene"?s="maps":e==="web scene"?s=t.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal":e==="web mapping application"&&t.includes("configurableApp")?s="instantapps":e==="web mapping application"||e==="mobile application"||e==="application"||e==="operation view"||e==="desktop application"?s="apps":e==="map document"||e==="map package"||e==="published map"||e==="scene document"||e==="globe document"||e==="basemap package"||e==="mobile basemap package"||e==="mobile map package"||e==="project package"||e==="project template"||e==="pro map"||e==="layout"||e==="layer"&&t.includes("ArcGIS Pro")||e==="explorer map"&&t.indexOf("Explorer Document")?s="mapsgray":e==="service definition"||e==="shapefile"||e==="cad drawing"||e==="geojson"||e==="netcdf"||e==="administrative report"?s="datafiles":e==="360 vr experience"?s="360vr":e==="explorer add in"||e==="desktop add in"||e==="windows viewer add in"||e==="windows viewer configuration"?s="appsgray":e==="arcgis pro add in"||e==="arcgis pro configuration"?s="addindesktop":e==="pdf"?s="pdf":e==="microsoft word"?s="word":e==="microsoft excel"?s="excel":e==="microsoft powerpoint"?s="ppt":e==="rule package"||e==="file geodatabase"||e==="sqlite geodatabase"||e==="csv collection"||e==="kml collection"||e==="windows mobile package"||e==="map template"||e==="desktop application template"||e==="gml"||e==="arcpad package"||e==="code sample"||e==="document link"||e==="earth configuration"||e==="operations dashboard add in"||e==="rules package"||e==="workflow manager package"||e==="explorer map"&&t.includes("Explorer Mapping Application")||t.includes("Document")?s="datafilesgray":e==="network analysis service"||e==="geoprocessing service"||e==="geodata service"||e==="geometry service"||e==="geoprocessing package"||e==="locator package"||e==="geoprocessing sample"||e==="workflow manager service"?s="toolsgray":e==="layer"||e==="layer package"||e==="explorer layer"?s="layersgray":e==="scene package"?s="scenepackage":e==="3dtiles package"?s="3dtileslayerpackage":e==="3dtiles service"?s="3dtileslayer":e==="mobile scene package"?s="mobilescenepackage":e==="tile package"||e==="compact tile package"?s="tilepackage":e==="task file"?s="taskfile":e==="report template"?s="report-template":e==="statistical data collection"?s="statisticaldatacollection":e==="insights workbook"?s="workbook":e==="insights model"?s="insightsmodel":e==="insights page"?s="insightspage":e==="insights theme"?s="insightstheme":e==="hub initiative"?s="hubinitiative":e==="hub page"?s="hubpage":e==="hub site application"?s="hubsite":e==="hub event"?s="hubevent":e==="hub project"?s="hubproject":e==="relational database connection"?s="relationaldatabaseconnection":e==="big data file share"?s="datastorecollection":e==="image collection"?s="imagecollection":e==="desktop style"?s="desktopstyle":e==="style"?s="style":e==="dashboard"?s="dashboard":e==="raster function template"?s="rasterprocessingtemplate":e==="vector tile package"?s="vectortilepackage":e==="ortho mapping project"?s="orthomappingproject":e==="ortho mapping template"?s="orthomappingtemplate":e==="solution"?s="solutions":e==="geopackage"?s="geopackage":e==="deep learning package"?s="deeplearningpackage":e==="real time analytic"?s="realtimeanalytics":e==="big data analytic"?s="bigdataanalytics":e==="feed"?s="feed":e==="excalibur imagery project"?s="excaliburimageryproject":e==="notebook"?s="notebook":e==="storymap"?s="storymap":e==="survey123 add in"?s="survey123addin":e==="mission"?s="mission":e==="mission report"?s="missionreport":e==="mission template"?s="missiontemplate":e==="quickcapture project"?s="quickcaptureproject":e==="pro report"?s="proreport":e==="pro report template"?s="proreporttemplate":e==="urban model"?s="urbanmodel":e==="web experience"?s="experiencebuilder":e==="web experience template"?s="webexperiencetemplate":e==="experience builder widget"?s="experiencebuilderwidget":e==="experience builder widget package"?s="experiencebuilderwidgetpackage":e==="workflow"?s="workflow":e==="kernel gateway connection"?s="kernelgatewayconnection":e==="insights script"?s="insightsscript":e==="hub initiative template"?s="hubinitiativetemplate":e==="storymap theme"?s="storymaptheme":e==="knowledge graph"?s="knowledgegraph":e==="knowledge studio project"?s="knowledgestudio":e==="native application"?s="nativeapp":e==="native application installer"?s="nativeappinstaller":e==="web link chart"?s="linkchart":e==="knowledge graph web investigation"?s="investigation":e==="ogcfeatureserver"?s="features":e==="pro project"?s="proproject":e==="insights workbook package"?s="insightsworkbookpackage":e==="apache parquet"?s="apacheparquet":e==="notebook code snippets"||e==="notebook code snippet library"?s="notebookcodesnippets":e==="suitability model"?s="suitabilitymodel":e==="esri classifier definition"?s="classifierdefinition":e==="esri classification schema"?s="classificationschema":e==="insights data engineering workbook"?s="dataengineeringworkbook":e==="insights data engineering model"?s="dataengineeringmodel":e==="deep learning studio project"?s="deeplearningproject":e==="discussion"?s="discussion":e==="allsource project"?s="allsourceproject":e==="api key"?s="apikey":e==="data pipeline"?s="datapipelines":e==="group layer"?(A=t.includes("Map"),s=A?"layergroup2d":"layergroup"):s=e==="media layer"?"onlinemedialayer":e==="form"?t.includes("Survey123")?"survey":"datafilesgray":e==="csv"?"csv":e==="image"?"image":"maps",s?Ri(i+s+r+".png"):null}get isLayer(){return this.type!=null&&tZ.has(this.type)}get itemCdnUrl(){return LA(this.itemUrl)}get itemPageUrl(){var t;const e=(t=this.portal)==null?void 0:t.itemPageUrl;return e&&this.id?`${e}?id=${this.id}`:null}get itemUrl(){var t;const e=(t=this.portal)==null?void 0:t.restUrl;return e&&this.id?`${e}/content/items/${this.id}`:null}get thumbnailUrl(){var i;const e=this.itemUrl,t=this.thumbnail;return e&&t?((i=this.portal)==null?void 0:i.normalizeUrl(`${e}/info/${t}?f=json`))??null:null}get userItemUrl(){var i,r,s;const e=(i=this.portal)==null?void 0:i.restUrl;if(!e)return null;const t=this.owner||((s=(r=this.portal)==null?void 0:r.user)==null?void 0:s.username);return t?`${e}/content/users/${this.ownerFolder?`${t}/${this.ownerFolder}`:t}/items/${this.id}`:null}load(e){const t=this.portal??(this.portal=Za.getDefault()),i=t.load(e).then(()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?t.request(this.itemUrl,{signal:e!=null?e.signal:null,query:{token:this.apiKey}}):{}).then(r=>{this.sourceJSON=r,this.read(r)});return this.addResolvingPromise(i),Promise.resolve(this)}async addRating(e){const t={method:"post",query:{}};return e instanceof IS&&(e=e.rating),e==null||isNaN(e)||typeof e!="number"||(t.query.rating=e),this.portal?(await this.portal.request(this.itemUrl+"/addRating",t),new IS({rating:e,created:new Date})):null}clone(){const e={access:this.access,accessInformation:this.accessInformation,applicationProxies:He(this.applicationProxies),avgRating:this.avgRating,categories:He(this.categories),created:He(this.created),culture:this.culture,description:this.description,extent:He(this.extent),groupCategories:He(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:He(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:He(this.screenshots),size:this.size,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:He(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:He(this.typeKeywords),url:this.url};this.loaded&&(e.loadStatus="loaded");const t=new dd({sourceJSON:this.sourceJSON}).set(e);return t._set("isOrgItem",this.isOrgItem),t}createPostQuery(){var i;const e=this.toJSON();for(const r of["tags","typeKeywords","categories"])e[r]=(i=e[r])==null?void 0:i.join(", ");const{extent:t}=e;return t&&(e.extent=JSON.stringify(t)),e}async deleteRating(){await this.portal.request(this.itemUrl+"/deleteRating",{method:"post"})}fetchData(e="json",t){return this.portal.request(this.itemUrl+"/data",{responseType:e,...t,query:{token:this.apiKey}})}async fetchRating(e){const t=await this.portal.request(this.itemUrl+"/rating",{query:{token:this.apiKey},...e});return t.rating!=null?(t.created=new Date(t.created),new IS(t)):null}fetchRelatedItems(e,t){return this.portal.requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...e,token:this.apiKey},...t},dd)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){return this.portal.request(this.itemUrl??"",{cacheBust:!0,query:{token:this.apiKey}}).then(e=>(this.sourceJSON=e,this.read(e),this))}update(e){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const t=e==null?void 0:e.data,i={method:"post"};i.query=this.createPostQuery();for(const r in i.query)i.query[r]===null&&(i.query[r]="");return i.query.clearEmptyFields=!0,t!=null&&(typeof t=="string"?i.query.text=t:typeof t=="object"&&(i.query.text=JSON.stringify(t))),this.portal.request(`${this.userItemUrl}/update`,i).then(()=>this.reload())}):Promise.reject(new Je("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async copy(e){if(!this.id)throw new Je("portal:item-does-not-exist","The item does not exist yet");await this.load();const{portal:t,itemUrl:i}=this;await t.signIn();const{copyResources:r,folder:s,tags:n,title:c}=e||{},o={method:"post",query:{copyPrivateResources:r==="all",folder:typeof s=="string"?s:s==null?void 0:s.id,includeResources:!!r,tags:n==null?void 0:n.join(","),title:c}},{itemId:f}=await t.request(`${i}/copy`,o);return new dd({id:f,portal:t})}updateThumbnail(e){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const t=e.thumbnail,i=e.filename,r={method:"post"};if(typeof t=="string")Cp(t)?r.query={data:t}:r.query={url:Xo(t)},i!=null&&(r.query.filename=i);else{const s=new FormData;i!=null?s.append("file",t,i):s.append("file",t),r.body=s}return this.portal.request(`${this.userItemUrl}/updateThumbnail`,r).then(()=>this.reload())}):Promise.reject(new Je("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(e={},t){const{fetchResources:i}=await ht(()=>import("./resourceUtils-CjqYbm2Q.js"),[]);return i(this,e,t)}async addResource(e,t,i){const{addOrUpdateResources:r}=await ht(()=>import("./resourceUtils-CjqYbm2Q.js"),[]);return e.portalItem=this,await r(this,[{resource:e,content:t,compress:i==null?void 0:i.compress,access:i==null?void 0:i.access}],"add",i),e}async removeResource(e,t){const{removeResource:i}=await ht(()=>import("./resourceUtils-CjqYbm2Q.js"),[]);if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new Je("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return i(this,e,t)}async removeAllResources(e){const{removeAllResources:t}=await ht(()=>import("./resourceUtils-CjqYbm2Q.js"),[]);return t(this,e)}resourceFromPath(e){return new KW({portalItem:this,path:e})}toJSON(){var i,r;const e=this.extent,t={accessInformation:this.accessInformation,categories:He(this.categories),created:(i=this.created)==null?void 0:i.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,isOrgItem:this.isOrgItem,licenseInfo:this.licenseInfo,modified:(r=this.modified)==null?void 0:r.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:He(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:He(this.typeKeywords),url:this.url};return I5(t)}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new dd({sourceJSON:e})}_getPostQuery(){const e=this.toJSON();for(const t in e)t==="tags"&&e[t]!==null&&(e[t]=e[t].join(", ")),t==="typeKeywords"&&e[t]!==null&&(e[t]=e[t].join(", ")),t==="extent"&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}};v([M({type:["private","shared","org","public"]})],ii.prototype,"access",void 0),v([M()],ii.prototype,"accessInformation",void 0),v([M({type:String})],ii.prototype,"apiKey",void 0),v([M({json:{read:{source:"appProxies"}}})],ii.prototype,"applicationProxies",void 0),v([M()],ii.prototype,"avgRating",void 0),v([M()],ii.prototype,"categories",void 0),v([M({type:Date})],ii.prototype,"created",void 0),v([M()],ii.prototype,"culture",void 0),v([M()],ii.prototype,"description",void 0),v([M({readOnly:!0})],ii.prototype,"displayName",null),v([M({type:Ui})],ii.prototype,"extent",void 0),v([mi("extent")],ii.prototype,"readExtent",null),v([M()],ii.prototype,"groupCategories",void 0),v([M({readOnly:!0})],ii.prototype,"iconUrl",null),v([M()],ii.prototype,"id",void 0),v([M({readOnly:!0})],ii.prototype,"isLayer",null),v([M({type:Boolean,readOnly:!0})],ii.prototype,"isOrgItem",void 0),v([M()],ii.prototype,"itemControl",void 0),v([M({readOnly:!0})],ii.prototype,"itemPageUrl",null),v([M({readOnly:!0})],ii.prototype,"itemUrl",null),v([M()],ii.prototype,"licenseInfo",void 0),v([M({type:Date})],ii.prototype,"modified",void 0),v([M()],ii.prototype,"name",void 0),v([M()],ii.prototype,"numComments",void 0),v([M()],ii.prototype,"numRatings",void 0),v([M()],ii.prototype,"numViews",void 0),v([M()],ii.prototype,"owner",void 0),v([M()],ii.prototype,"ownerFolder",void 0),v([M({type:Za})],ii.prototype,"portal",void 0),v([M()],ii.prototype,"screenshots",void 0),v([M()],ii.prototype,"size",void 0),v([M()],ii.prototype,"snippet",void 0),v([M()],ii.prototype,"sourceJSON",void 0),v([M({type:String})],ii.prototype,"sourceUrl",void 0),v([M({type:String})],ii.prototype,"spatialReference",void 0),v([M()],ii.prototype,"tags",void 0),v([M()],ii.prototype,"thumbnail",void 0),v([M({readOnly:!0})],ii.prototype,"thumbnailUrl",null),v([M()],ii.prototype,"title",void 0),v([M()],ii.prototype,"type",void 0),v([M()],ii.prototype,"typeKeywords",void 0),v([M({type:String,json:{read(e,t){var i;if(iZ.has(t.type)){const r=(i=this.portal)==null?void 0:i.restUrl;e||(e=r&&this.id?`${r}/content/items/${this.id}/data`:null)}return e}}})],ii.prototype,"url",void 0),v([M({readOnly:!0})],ii.prototype,"userItemUrl",null),ii=dd=v([fe("esri.portal.PortalItem")],ii);const _0=ii,vN=Object.freeze(Object.defineProperty({__proto__:null,default:_0},Symbol.toStringTag,{value:"Module"})),z$=/^([a-z]{2})(?:[-_]([A-Za-z]{2}))?$/,rZ={ar:!0,bg:!0,bs:!0,ca:!0,cs:!0,da:!0,de:!0,el:!0,en:!0,es:!0,et:!0,fi:!0,fr:!0,he:!0,hr:!0,hu:!0,id:!0,it:!0,ja:!0,ko:!0,lt:!0,lv:!0,nb:!0,nl:!0,pl:!0,"pt-BR":!0,"pt-PT":!0,ro:!0,ru:!0,sk:!0,sl:!0,sr:!0,sv:!0,th:!0,tr:!0,uk:!0,vi:!0,"zh-CN":!0,"zh-HK":!0,"zh-TW":!0};function F$(e){return e in rZ}const Ag=[],mm=new Map;function B$(e){for(const t of mm.keys())bN(e.pattern,t)&&mm.delete(t)}function sZ(e){return Ag.includes(e)||(B$(e),Ag.unshift(e)),er(()=>{const t=Ag.indexOf(e);t>-1&&(Ag.splice(t,1),B$(e))})}async function DA(e){const t=wo();mm.has(e)||mm.set(e,oZ(e,t));const i=mm.get(e);return i&&await aZ.add(i),i}function nZ(e){if(!z$.test(e))return null;const t=z$.exec(e);if(t===null)return null;const[,i,r]=t,s=i+(r?"-"+r.toUpperCase():"");return F$(s)?s:F$(i)?i:null}async function oZ(e,t){const i=[];for(const r of Ag)if(bN(r.pattern,e))try{return await r.fetchMessageBundle(e,t)}catch(s){i.push(s)}throw i.length?new Je("intl:message-bundle-error",`Errors occurred while loading "${e}"`,{errors:i}):new Je("intl:no-message-bundle-loader",`No loader found for message bundle "${e}"`)}function bN(e,t){return typeof e=="string"?t.startsWith(e):e.test(t)}$A(()=>{mm.clear()});const aZ=new class{constructor(){this._numLoading=0,this._dfd=null}async waitForAll(){this._dfd&&await this._dfd.promise}add(e){return this._increase(),e.then(()=>this._decrease(),()=>this._decrease()),this.waitForAll()}_increase(){this._numLoading++,this._dfd||(this._dfd=sa())}_decrease(){this._numLoading=Math.max(this._numLoading-1,0),this._dfd&&this._numLoading===0&&(this._dfd.resolve(),this._dfd=null)}};async function lZ(e){if(!e)return;const t=e.includes("-vector")?e.slice(0,e.indexOf("-vector")):e.includes("-3d")?e.slice(0,e.indexOf("-3d")):e,i=await DA("esri/t9n/basemaps");return i[e]||i[t]}const yE={satellite:{id:"satellite",classic:!0,get thumbnailUrl(){return Ri("esri/images/basemap/satellite.jpg")},baseMapLayers:[{id:"satellite-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1}]},hybrid:{id:"hybrid",classic:!0,get thumbnailUrl(){return Ri("esri/images/basemap/hybrid.jpg")},baseMapLayers:[{id:"hybrid-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1},{id:"hybrid-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/30d6b8271e1849cd9c3042060001f425/resources/styles/root.json",layerType:"VectorTileLayer",title:"Hybrid Reference Layer",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},terrain:{id:"terrain",classic:!0,get thumbnailUrl(){return Ri("esri/images/basemap/terrain.jpg")},baseMapLayers:[{id:"terrain-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Terrain Base",showLegend:!1,visibility:!0,opacity:1},{id:"terrain-reference-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Reference Overlay",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},oceans:{id:"oceans",classic:!0,get thumbnailUrl(){return Ri("esri/images/basemap/oceans.jpg")},baseMapLayers:[{id:"oceans-base-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Base",showLegend:!1,visibility:!0,opacity:1},{id:"oceans-reference-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},osm:{id:"osm",classic:!0,get thumbnailUrl(){return Ri("esri/images/basemap/osm.jpg")},baseMapLayers:[{id:"osm-base-layer",layerType:"OpenStreetMap",title:"Open Street Map",showLegend:!1,visibility:!0,opacity:1}]},"dark-gray-vector":{id:"dark-gray-vector",classic:!0,get thumbnailUrl(){return Ri("esri/images/basemap/dark-gray-vector.jpg")},baseMapLayers:[{id:"dark-gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/5e9b3685f4c24d8781073dd928ebda50/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Base",visibility:!0,opacity:1},{id:"dark-gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/747cb7a5329c478cbe6981076cc879c5/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get"dark-gray"(){return{...this["dark-gray-vector"],id:"dark-gray"}},"gray-vector":{id:"gray-vector",classic:!0,get thumbnailUrl(){return Ri("esri/images/basemap/gray-vector.jpg")},baseMapLayers:[{id:"gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/291da5eab3a0412593b66d384379f89f/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Base",visibility:!0,opacity:1},{id:"gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/1768e8369a214dfab4e2167d5c5f2454/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get gray(){return{...this["gray-vector"],id:"gray"}},"streets-vector":{id:"streets-vector",classic:!0,get thumbnailUrl(){return Ri("esri/images/basemap/streets-vector.jpg")},baseMapLayers:[{id:"streets-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/de26a3cf4cc9451298ea173c4b324736/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets",visibility:!0,opacity:1}]},get streets(){return{...this["streets-vector"],id:"streets"}},"topo-vector":{id:"topo-vector",classic:!0,get thumbnailUrl(){return Ri("esri/images/basemap/topo-vector.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"topo-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/7dc6cea0b1764a1f9af2e679f642f0f5/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Topo",visibility:!0,opacity:1}]},get topo(){return{...this["topo-vector"],id:"topo"}},"streets-night-vector":{id:"streets-night-vector",classic:!0,get thumbnailUrl(){return Ri("esri/images/basemap/streets-night.jpg")},baseMapLayers:[{id:"streets-night-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/86f556a2d1fd468181855a35e344567f/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Night",visibility:!0,opacity:1}]},"streets-relief-vector":{id:"streets-relief-vector",classic:!0,get thumbnailUrl(){return Ri("esri/images/basemap/streets-relief.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"streets-relief-vector-base-layer",styleUrl:"//www.arcgis.com/sharing/rest/content/items/b266e6d17fc345b498345613930fbd76/resources/styles/root.json",title:"World Streets Relief",layerType:"VectorTileLayer",visibility:!0,opacity:1}]},"streets-navigation-vector":{id:"streets-navigation-vector",classic:!0,get thumbnailUrl(){return Ri("esri/images/basemap/streets-navigation.jpg")},baseMapLayers:[{id:"streets-navigation-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/63c47b7177f946b49902c24129b87252/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Navigation",visibility:!0,opacity:1}]},"topo-3d":{id:"topo-3d",is3d:!0,get thumbnailUrl(){return Ri("esri/images/basemap/topo-3d.png")},baseMapLayers:[{id:"topo-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/1e7d1784d1ef4b79ba6764d0bd6c3150/resources/styles/root.json",layerType:"VectorTileLayer",title:"Topographic",visibility:!0,opacity:1},{id:"topo-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Trees_Thematic_v1/SceneServer",itemId:"f75fef56b2d944fe92ef9f7737b4f953",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"navigation-3d":{id:"navigation-3d",is3d:!0,get thumbnailUrl(){return Ri("esri/images/basemap/navigation-3d.jpg")},baseMapLayers:[{id:"navigation-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/ccc904ff872b4144b94934e55e32784b/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation",visibility:!0,opacity:1},{id:"navigation-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"streets-3d":{id:"streets-3d",is3d:!0,get thumbnailUrl(){return Ri("esri/images/basemap/streets-3d.png")},baseMapLayers:[{id:"streets-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/198298c4c64c4cb19de5b46aa00c198d/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"streets-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"streets-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"osm-3d":{id:"osm-3d",is3d:!0,get thumbnailUrl(){return Ri("esri/images/basemap/osm-3d.png")},baseMapLayers:[{id:"osm-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/8628d259c9d14bdc848771c23c513940/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap",visibility:!0,opacity:1},{id:"osm-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Trees_Thematic_v1/SceneServer",itemId:"f75fef56b2d944fe92ef9f7737b4f953",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"gray-3d":{id:"gray-3d",is3d:!0,get thumbnailUrl(){return Ri("esri/images/basemap/gray-3d.png")},baseMapLayers:[{id:"gray-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/01a14b466345455ba4176d2e6390db92/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"navigation-dark-3d":{id:"navigation-dark-3d",itemId:"5a1365328b4943f09a54cf5fd1205707",is3d:!0,baseMapLayers:[{id:"navigation-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/451a1777ab3f4bf095fae24a117439d9/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation Dark"},{id:"navigation-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"streets-dark-3d":{id:"streets-dark-3d",itemId:"8a4efa2c20484ec9b4557895e65736ff",is3d:!0,baseMapLayers:[{id:"streets-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/bc599b6d741a4ac084b7eea7bf8c5938/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Streets Night (for 3D)"},{id:"streets-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"streets-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"dark-gray-3d":{id:"dark-gray-3d",itemId:"a8b7322a5fe94002bb0f5e0eeb0c5c18",is3d:!0,baseMapLayers:[{id:"dark-gray-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/4178f71acb934fb89f169e7d667c20c6/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Dark Gray Canvas (for 3D)"},{id:"dark-gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"dark-gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"arcgis-imagery":{get thumbnailUrl(){return Ri("esri/images/basemap/hybrid.jpg")},title:"Imagery Hybrid",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Imagery",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Imagery:Labels",title:"Hybrid Reference Layer",isReference:!0}]},"arcgis-imagery-standard":{get thumbnailUrl(){return Ri("esri/images/basemap/satellite.jpg")},title:"Imagery",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Imagery",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"}]},"arcgis-imagery-labels":{title:"Hybrid [Reference]",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Imagery:Labels",title:"Hybrid Reference Layer",isReference:!0}]},"arcgis-light-gray":{get thumbnailUrl(){return Ri("esri/images/basemap/gray-vector.jpg")},title:"Light Gray Canvas",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:LightGray:Base",title:"Light Gray Canvas Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:LightGray:Labels",title:"Light Gray Canvas Labels",isReference:!0}]},"arcgis-dark-gray":{get thumbnailUrl(){return Ri("esri/images/basemap/dark-gray.jpg")},title:"Dark Gray Canvas",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:DarkGray:Base",title:"Dark Gray Canvas Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:DarkGray:Labels",title:"Dark Gray Canvas Labels",isReference:!0}]},"arcgis-navigation":{get thumbnailUrl(){return Ri("esri/images/basemap/streets-navigation.jpg")},title:"Navigation",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Navigation",title:"World Navigation Map"}]},"arcgis-navigation-night":{title:"Navigation (Dark Mode)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:NavigationNight",title:"World Navigation Map (Dark Mode)"}]},"arcgis-streets":{get thumbnailUrl(){return Ri("esri/images/basemap/streets-vector.jpg")},title:"Streets",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Streets",title:"World Street Map"}]},"arcgis-streets-night":{get thumbnailUrl(){return Ri("esri/images/basemap/streets-night.jpg")},title:"Streets (Night)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:StreetsNight",title:"World Street Map (Night)"}]},"arcgis-streets-relief":{get thumbnailUrl(){return Ri("esri/images/basemap/streets-relief.jpg")},title:"Streets (with Relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:StreetsRelief:Base",title:"World Street Map (with Relief)"}]},"arcgis-topographic":{get thumbnailUrl(){return Ri("esri/images/basemap/topo.jpg")},title:"Topographic",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Topographic:Base",title:"World Topographic Map"}]},"arcgis-oceans":{get thumbnailUrl(){return Ri("esri/images/basemap/oceans.jpg")},title:"Oceans",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Ocean Base",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Oceans:Labels",title:"World Ocean Reference",isReference:!0}]},"osm-standard":{title:"OpenStreetMap",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:Standard",title:"OpenStreetMap"}]},"osm-standard-relief":{title:"OpenStreetMap (with relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:StandardRelief:Base",layerType:"VectorTileLayer",title:"OpenStreetMap Relief Base"}]},"osm-streets":{title:"OpenStreetMap (Streets)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:Streets",title:"OpenStreetMap (Streets)"}]},"osm-streets-relief":{title:"OpenStreetMap (Streets with relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:StreetsRelief:Base",layerType:"VectorTileLayer",title:"OpenStreetMap Relief Base"}]},"osm-light-gray":{title:"OpenStreetMap (Light Gray Canvas)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:LightGray:Base",title:"OSM (Light Gray Base)"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:LightGray:Labels",title:"OSM (Light Gray Reference)",isReference:!0}]},"osm-dark-gray":{title:"OpenStreetMap (Dark Gray Canvas)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:DarkGray:Base",title:"OSM (Dark Gray Base)"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:DarkGray:Labels",title:"OSM (Dark Gray Reference)",isReference:!0}]},"arcgis-terrain":{title:"Terrain with Labels",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Terrain:Base",title:"World Terrain Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Terrain:Detail",title:"World Terrain Reference",isReference:!0}]},"arcgis-community":{title:"Community",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Community",title:"Community"}]},"arcgis-charted-territory":{title:"Charted Territory",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ChartedTerritory:Base",title:"Charted Territory"}]},"arcgis-colored-pencil":{title:"Colored Pencil",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ColoredPencil",title:"Colored Pencil"}]},"arcgis-nova":{title:"Nova",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Nova",title:"Nova"}]},"arcgis-modern-antique":{title:"Modern Antique",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ModernAntique:Base",title:"Modern Antique"}]},"arcgis-midcentury":{title:"Mid-Century",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Midcentury",title:"Mid-Century"}]},"arcgis-newspaper":{title:"Newspaper",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Newspaper",title:"Newspaper"}]},"arcgis-hillshade-light":{title:"Hillshade",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"}]},"arcgis-hillshade-dark":{title:"Hillshade (Dark)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade (Dark)",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade_Dark/MapServer"}]},"arcgis-human-geography":{title:"Human Geography",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Base",title:"Human Geography Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Detail",title:"Human Geography Detail",isReference:!0},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Label",title:"Human Geography Label",isReference:!0}]},"arcgis-human-geography-dark":{title:"Human Geography (Dark)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Base",title:"Human Geography Dark Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Detail",title:"Human Geography Dark Detail",isReference:!0},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Label",title:"Human Geography Dark Label",isReference:!0}]}},cZ=new Set(["ar","bs","ca","hr","cs","da","nl","en","et","fi","fr","de","el","he","hu","id","it","ja","ko","lv","lt","nb","pl","ro","ru","sr","es","sv","th","tr","uk","vi"]);let Iu=class extends Nt{constructor(t){super(t),this.id=null,this.language=null,this.places=null,this.serviceUrl="https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/webmaps",this.worldview=null}getLanguageParamValue(){if(this.language)return this.language;const t=wo().toLowerCase();switch(t){case"pt-br":return"pt-BR";case"pt-pt":return"pt-PT";case"zh-cn":return"zh-CN";case"zh-hk":return"zh-HK";case"zh-tw":return"zh-TW"}const i=GW(t);return i==="pt"?"pt-BR":i&&cZ.has(i)?i:"global"}};v([M()],Iu.prototype,"id",void 0),v([M()],Iu.prototype,"language",void 0),v([M()],Iu.prototype,"places",void 0),v([M()],Iu.prototype,"serviceUrl",void 0),v([M()],Iu.prototype,"worldview",void 0),Iu=v([fe("esri.support.BasemapStyle")],Iu);const uZ=Iu;function hZ(e){return e!=null&&typeof e=="object"&&"type"in e&&e.type==="subtype-group"&&"sublayers"in e}function Tf(e){return(e==null?void 0:e.type)==="subtype-sublayer"}const lge={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function cge(e){const t=e==null?void 0:e.type;return t==="building-scene"||t==="integrated-mesh"||t==="point-cloud"||t==="scene"}function Ex(e){var t;return(e==null?void 0:e.type)==="feature"&&!e.url&&((t=e.source)==null?void 0:t.type)==="memory"}function uge(e){var t;return((e==null?void 0:e.type)==="feature"||(e==null?void 0:e.type)==="subtype-group")&&((t=e.source)==null?void 0:t.type)==="feature-layer"}async function dZ(e,t){const i=bi==null?void 0:bi.findServerInfo(e);if((i==null?void 0:i.currentVersion)!=null)return i.owningSystemUrl||null;const r=e.toLowerCase().indexOf("/rest/services");if(r===-1)return null;const s=`${e.substring(0,r)}/rest/info`,n=t!=null?t.signal:null,{data:c}=await Qi(s,{query:{f:"json"},responseType:"json",signal:n});return(c==null?void 0:c.owningSystemUrl)||null}function pZ(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}function fZ(e){return pZ(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function mZ(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}function yZ(e){return!!mZ(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}const gZ=new Set(["bing-maps","imagery","imagery-tile","map-image","open-street-map","tile","unknown","unsupported","vector-tile","web-tile","wms","wmts"]),_Z=new Set(["csv","feature","geo-rss","geojson","group","imagery","imagery-tile","kml","map-image","map-notes","media","ogc-feature","oriented-imagery","route","stream","subtype-group","tile","unknown","unsupported","vector-tile","web-tile","wfs","wms","wmts"]);function vZ(e){return e.layerContainerType==="basemap"?gZ:e.layerContainerType==="operational-layers"?_Z:null}function bZ(e,t){if(t.restrictedWebMapWriting){const i=vZ(t);return i==null||i.has(e.type)&&!Ex(e)}return!0}function wZ(e,t){var i;if(t)if(Ex(e)){const r=ax("featureCollection.layers",t),s=(i=r==null?void 0:r[0])==null?void 0:i.layerDefinition;s&&U$(e,s)}else e.type!=="group"&&U$(e,t)}function U$(e,t){"maxScale"in e&&(t.maxScale=sw(e.maxScale)??void 0),"minScale"in e&&(t.minScale=sw(e.minScale)??void 0)}function xZ(e,t){if(wZ(e,t),t&&(t.id=e.id,"blendMode"in e&&(t.blendMode=e.blendMode,t.blendMode==="normal"&&delete t.blendMode),t.opacity=sw(e.opacity)??void 0,t.title=e.title||"Layer",t.visibility=e.visible,"legendEnabled"in e&&e.type!=="wmts"))if(Ex(e)){const i=t.featureCollection;i&&(i.showLegend=e.legendEnabled)}else t.showLegend=e.legendEnabled}function j$(e,t,i){if(!e.persistenceEnabled)return null;if(!("write"in e)||!e.write)return i!=null&&i.messages&&i.messages.push(new Je("layer:unsupported",`Layers (${e.title}, ${e.id}) of type '${e.declaredClass}' cannot be persisted`,{layer:e})),null;if(Ex(e)&&!e.isTable)t=e.resourceInfo;else if(bZ(e,i)){const r={};return e.write(r,i)?r:null}return t!=null&&xZ(e,t=He(t)),t}var Pg;let SZ=0;const TZ="esri.Basemap";let yo=Pg=class extends y_(dh){constructor(e){super(e),this.id=null,this.portalItem=null,this.spatialReference=null,this.style=null,this.thumbnailUrl=null,this.title="Basemap",this.id=Date.now().toString(16)+"-basemap-"+SZ++,this.baseLayers=new Bt,this.referenceLayers=new Bt;const t=r=>{r.parent&&r.parent!==this&&"remove"in r.parent&&r.parent.remove(r),r.parent=this,r.type==="elevation"&&_t.getLogger(this).error(`Layer '${r.title}, id:${r.id}' of type '${r.type}' is not supported as a basemap layer and will therefore be ignored.`)},i=r=>{r.parent=null};this.addHandles([this.baseLayers.on("after-add",r=>t(r.item)),this.referenceLayers.on("after-add",r=>t(r.item)),this.baseLayers.on("after-remove",r=>i(r.item)),this.referenceLayers.on("after-remove",r=>i(r.item))])}initialize(){this.when().catch(e=>{_t.getLogger(this).error("#load()",`Failed to load basemap (title: '${this.title}', id: '${this.id}')`,e)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const e=this.baseLayers.toArray();for(const i of e)i.destroy();const t=this.referenceLayers.toArray();for(const i of t)i.destroy();this.baseLayers.destroy(),this.referenceLayers.destroy(),this.portalItem=lr(this.portalItem)}normalizeCtorArgs(e){return e&&"resourceInfo"in e&&(this._set("resourceInfo",e.resourceInfo),delete(e={...e}).resourceInfo),e}set baseLayers(e){this._set("baseLayers",mp(e,this._get("baseLayers")))}_writeBaseLayers(e,t,i){const r=[];e&&(i={...i,layerContainerType:"basemap"},this.baseLayers.forEach(s=>{const n=j$(s,i.webmap?i.webmap.getLayerJSONFromResourceInfo(s):null,i);n!=null&&r.push(n)}),this.referenceLayers.forEach(s=>{const n=j$(s,i.webmap?i.webmap.getLayerJSONFromResourceInfo(s):null,i);n!=null&&(s.type!=="scene"&&(n.isReference=!0),r.push(n))})),t.baseMapLayers=r}set referenceLayers(e){this._set("referenceLayers",mp(e,this._get("referenceLayers")))}writeTitle(e,t){t.title=e||"Basemap"}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return K4(this,e=>{e(this.baseLayers,this.referenceLayers)})}clone(){const e={id:this.id,title:this.title,portalItem:this.portalItem,baseLayers:this.baseLayers.map(t=>Vb(t)?t.clone():t),referenceLayers:this.referenceLayers.map(t=>Vb(t)?t.clone():t)};return this.loaded&&(e.loadStatus="loaded"),new Pg({resourceInfo:this.resourceInfo}).set(e)}read(e,t){this.resourceInfo||this._set("resourceInfo",{data:e,context:t}),super.read(e,t)}write(e,t){var i;return e=e||{},t!=null&&t.origin||(t={origin:"web-map",...t}),super.write(e,t),!this.loaded&&((i=this.resourceInfo)!=null&&i.data.baseMapLayers)&&(e.baseMapLayers=this.resourceInfo.data.baseMapLayers.map(r=>{const s=He(r);return s.url&&na(s.url)&&(s.url=`https:${s.url}`),s.templateUrl&&na(s.templateUrl)&&(s.templateUrl=`https:${s.templateUrl}`),s})),e}async _loadFromSource(e){const{resourceInfo:t,portalItem:i,style:r}=this;mr(e);const s=[];if(t){const n=t.context?t.context.url:null;if(s.push(this._loadLayersFromJSON(t.data,n,e)),t.data.id&&!t.data.title){const c=t.data.id;s.push(lZ(c).then(o=>{o&&this.read({title:o},t.context)}))}}else i?s.push(this._loadFromItem(i,e)):r&&s.push(this._loadFromStylesService(r,e));await Promise.all(s)}async _loadLayersFromJSON(e,t,i){var f,g;const r=(f=this.resourceInfo)==null?void 0:f.context,s=((g=this.portalItem)==null?void 0:g.portal)||(r==null?void 0:r.portal)||null,n=MZ[(r==null?void 0:r.origin)||""]??"web-map",{populateOperationalLayers:c}=await ht(()=>import("./layersCreator-ByGguThJ.js"),__vite__mapDeps([2,3,4,5,6])),o=[];if(mr(i),e.baseMapLayers&&Array.isArray(e.baseMapLayers)){const S={context:{...r,origin:n,url:t,portal:s,layerContainerType:"basemap"},defaultLayerType:"DefaultTileLayer"},I=z=>n==="web-scene"&&z.layerType==="ArcGISSceneServiceLayer"||z.isReference,A=c(this.baseLayers,e.baseMapLayers.filter(z=>!I(z)),S);o.push(A);const O=c(this.referenceLayers,e.baseMapLayers.filter(I),S);o.push(O)}await Promise.allSettled(o)}async _loadFromItem(e,t){const i=await e.load(t),r=await i.fetchData("json",t),s=Rr(e.itemUrl??"");return this._set("resourceInfo",{data:r.baseMap??{},context:{origin:EZ[e.type||""]??"web-map",portal:e.portal||Za.getDefault(),url:s}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:r.spatialReference},this.resourceInfo.context),this.read({title:e.title,thumbnailUrl:e.thumbnailUrl},{origin:"portal-item",portal:e.portal||Za.getDefault(),url:s}),this._loadLayersFromJSON(this.resourceInfo.data,s,t)}async _loadFromStylesService(e,t){const i=`${e.serviceUrl}/${e.id}`,r=(await Qi(i,{query:{language:e.getLanguageParamValue(),places:e.places,worldview:e.worldview},signal:t==null?void 0:t.signal})).data,s=Rr(i);return this._set("resourceInfo",{data:r.baseMap??{},context:{origin:"web-map",url:s}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:r.spatialReference},this.resourceInfo.context),this._loadLayersFromJSON(this.resourceInfo.data,s,t)}static fromId(e){const t=yE[e];return t?t.itemId?new Pg({portalItem:{id:t.itemId,portal:{url:"https://www.arcgis.com"}}}):Pg.fromJSON(t,{origin:t.is3d?"web-scene":"web-map"}):null}};v([M({json:{write:{ignoreOrigin:!0,target:"baseMapLayers",writer(e,t,i,r){this._writeBaseLayers(e,t,r)}},origins:{"web-scene":{write:{ignoreOrigin:!0,target:{baseMapLayers:{type:Bt}},writer(e,t,i,r){this._writeBaseLayers(e,t,r)}}}}}})],yo.prototype,"baseLayers",null),v([M({type:String,json:{origins:{"web-scene":{write:!0}}}})],yo.prototype,"id",void 0),v([M({type:_0})],yo.prototype,"portalItem",void 0),v([M()],yo.prototype,"referenceLayers",null),v([M({readOnly:!0})],yo.prototype,"resourceInfo",void 0),v([M({type:yi})],yo.prototype,"spatialReference",void 0),v([M({type:uZ})],yo.prototype,"style",void 0),v([M()],yo.prototype,"thumbnailUrl",void 0),v([M({type:String,json:{origins:{"web-scene":{write:{isRequired:!0}}}}})],yo.prototype,"title",void 0),v([ui("title")],yo.prototype,"writeTitle",null),yo=Pg=v([fe(TZ)],yo);const EZ={"Web Scene":"web-scene","Web Map":"web-map","Link Chart":"link-chart"},MZ={"web-scene":"web-scene","web-map":"web-map","link-chart":"link-chart"},v0=yo,IZ=Object.freeze(Object.defineProperty({__proto__:null,default:v0},Symbol.toStringTag,{value:"Module"})),_w={transparent:[0,0,0,0],black:[0,0,0,1],silver:[192,192,192,1],gray:[128,128,128,1],white:[255,255,255,1],maroon:[128,0,0,1],red:[255,0,0,1],purple:[128,0,128,1],fuchsia:[255,0,255,1],green:[0,128,0,1],lime:[0,255,0,1],olive:[128,128,0,1],yellow:[255,255,0,1],navy:[0,0,128,1],blue:[0,0,255,1],teal:[0,128,128,1],aqua:[0,255,255,1],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],blanchedalmond:[255,235,205,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],oldlace:[253,245,230,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],rebeccapurple:[102,51,153,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],whitesmoke:[245,245,245,1],yellowgreen:[154,205,50,1]};function wN(e){return!!_w[e]||!!_w[e.toLowerCase()]}function NA(e){return _w[e]??_w[e.toLowerCase()]}function AZ(e){return[...NA(e)]}function AS(e,t,i){i<0&&++i,i>1&&--i;const r=6*i;return r<1?e+(t-e)*r:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}function xN(e,t,i,r=1){const s=(e%360+360)%360/360,n=i<=.5?i*(t+1):i+t-i*t,c=2*i-n;return[Math.round(255*AS(c,n,s+1/3)),Math.round(255*AS(c,n,s)),Math.round(255*AS(c,n,s-1/3)),r]}function PZ(e){const t=e.length>5,i=t?8:4,r=(1<>=i,o[3]=s*f/255),f=c&r,c>>=i,o[2]=s*f,f=c&r,c>>=i,o[1]=s*f,f=c&r,c>>=i,o[0]=s*f,o}function Eh(){return[0,0,0]}function CZ(e){return[e[0],e[1],e[2]]}function v_(e,t,i){return[e,t,i]}function $Z(e,t=Eh()){const i=Math.min(3,e.length);for(let r=0;r0&&(n=1/Math.sqrt(n),e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n),e}function DN(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function tY(e,t,i){const r=t[0],s=t[1],n=t[2],c=i[0],o=i[1],f=i[2];return e[0]=s*f-n*o,e[1]=n*c-r*f,e[2]=r*o-s*c,e}function iY(e,t,i,r){const s=t[0],n=t[1],c=t[2];return e[0]=s+r*(i[0]-s),e[1]=n+r*(i[1]-n),e[2]=c+r*(i[2]-c),e}function rY(e,t,i,r,s,n){const c=n*n,o=c*(2*n-3)+1,f=c*(n-2)+n,g=c*(n-1),S=c*(3-2*n);return e[0]=t[0]*o+i[0]*f+r[0]*g+s[0]*S,e[1]=t[1]*o+i[1]*f+r[1]*g+s[1]*S,e[2]=t[2]*o+i[2]*f+r[2]*g+s[2]*S,e}function sY(e,t,i,r,s,n){const c=1-n,o=c*c,f=n*n,g=o*c,S=3*n*o,I=3*f*c,A=f*n;return e[0]=t[0]*g+i[0]*S+r[0]*I+s[0]*A,e[1]=t[1]*g+i[1]*S+r[1]*I+s[1]*A,e[2]=t[2]*g+i[2]*S+r[2]*I+s[2]*A,e}function nY(e,t){t=t||1;const i=Mx,r=2*i()*Math.PI,s=2*i()-1,n=Math.sqrt(1-s*s)*t;return e[0]=Math.cos(r)*n,e[1]=Math.sin(r)*n,e[2]=s*t,e}function oY(e,t,i){const r=t[0],s=t[1],n=t[2];return e[0]=i[0]*r+i[4]*s+i[8]*n+i[12],e[1]=i[1]*r+i[5]*s+i[9]*n+i[13],e[2]=i[2]*r+i[6]*s+i[10]*n+i[14],e}function aY(e,t,i){const r=t[0],s=t[1],n=t[2];return e[0]=r*i[0]+s*i[3]+n*i[6],e[1]=r*i[1]+s*i[4]+n*i[7],e[2]=r*i[2]+s*i[5]+n*i[8],e}function lY(e,t,i){const r=i[0],s=i[1],n=i[2],c=i[3],o=t[0],f=t[1],g=t[2],S=s*g-n*f,I=n*o-r*g,A=r*f-s*o,O=s*A-n*I,z=n*S-r*A,V=r*I-s*S,H=2*c;return e[0]=o+S*H+2*O,e[1]=f+I*H+2*z,e[2]=g+A*H+2*V,e}function cY(e,t,i,r){const s=[],n=[];return s[0]=t[0]-i[0],s[1]=t[1]-i[1],s[2]=t[2]-i[2],n[0]=s[0],n[1]=s[1]*Math.cos(r)-s[2]*Math.sin(r),n[2]=s[1]*Math.sin(r)+s[2]*Math.cos(r),e[0]=n[0]+i[0],e[1]=n[1]+i[1],e[2]=n[2]+i[2],e}function uY(e,t,i,r){const s=[],n=[];return s[0]=t[0]-i[0],s[1]=t[1]-i[1],s[2]=t[2]-i[2],n[0]=s[2]*Math.sin(r)+s[0]*Math.cos(r),n[1]=s[1],n[2]=s[2]*Math.cos(r)-s[0]*Math.sin(r),e[0]=n[0]+i[0],e[1]=n[1]+i[1],e[2]=n[2]+i[2],e}function hY(e,t,i,r){const s=[],n=[];return s[0]=t[0]-i[0],s[1]=t[1]-i[1],s[2]=t[2]-i[2],n[0]=s[0]*Math.cos(r)-s[1]*Math.sin(r),n[1]=s[0]*Math.sin(r)+s[1]*Math.cos(r),n[2]=s[2],e[0]=n[0]+i[0],e[1]=n[1]+i[1],e[2]=n[2]+i[2],e}function dY(e,t){gE(V$,e),gE(G$,t);const i=DN(V$,G$);return i>1?0:i<-1?Math.PI:Math.acos(i)}const V$=Eh(),G$=Eh();function pY(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"}function fY(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function mY(e,t){if(e===t)return!0;const i=e[0],r=e[1],s=e[2],n=t[0],c=t[1],o=t[2],f=aa();return Math.abs(i-n)<=f*Math.max(1,Math.abs(i),Math.abs(n))&&Math.abs(r-c)<=f*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(s-o)<=f*Math.max(1,Math.abs(s),Math.abs(o))}function yY(e,t,i){const r=i[0]-t[0],s=i[1]-t[1],n=i[2]-t[2];let c=r*r+s*s+n*n;return c>0?(c=1/Math.sqrt(c),e[0]=r*c,e[1]=s*c,e[2]=n*c,e):(e[0]=0,e[1]=0,e[2]=0,e)}const gY=PN,_Y=CN,vY=$N,bY=RN,wY=ON,xY=BA,SY=LN;Object.freeze(Object.defineProperty({__proto__:null,abs:WZ,add:GZ,angle:dY,bezier:sY,ceil:qZ,copy:VZ,cross:tY,direction:yY,dist:bY,distance:RN,div:vY,divide:$N,dot:DN,equals:mY,exactEquals:fY,floor:HZ,hermite:rY,inverse:eY,len:xY,length:BA,lerp:iY,max:JZ,min:YZ,mul:_Y,multiply:CN,negate:QZ,normalize:gE,random:nY,rotateX:cY,rotateY:uY,rotateZ:hY,round:KZ,scale:kN,scaleAndAdd:XZ,set:AN,sign:ZZ,sqrDist:wY,sqrLen:SY,squaredDistance:ON,squaredLength:LN,str:pY,sub:gY,subtract:PN,transformMat3:aY,transformMat4:oY,transformQuat:lY},Symbol.toStringTag,{value:"Module"}));const q$=new Float32Array(1);function hge(e){--e;for(let t=1;t<32;t<<=1)e|=e>>t;return e+1}function Ll(e,t,i){return Math.min(Math.max(e,t),i)}function dge(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e}function TY(e,t,i){return e+(t-e)*i}function pge(e,t,i,r,s){return TY(r,s,(e-t)/(i-t))}function NN(e){return e*Math.PI/180}function zN(e){return 180*e/Math.PI}function fge(e){return Math.acos(Ll(e,-1,1))}function FN(e){return Math.asin(Ll(e,-1,1))}function PS(e,t,i=1e-6){return e===t?!0:!Number.isFinite(e)||!Number.isFinite(t)?!1:(e>t?e-t:t-e)<=i}const vw=new DataView(new ArrayBuffer(Float64Array.BYTES_PER_ELEMENT));function EY(e){return vw.setFloat64(0,e),vw.getBigInt64(0)}function MY(e){return vw.setBigInt64(0,e),vw.getFloat64(0)}const CS=BigInt("1000000");IY(1);function IY(e){const t=EY(e=Math.abs(e)),i=MY(t<=CS?CS:t-CS);return Math.abs(e-i)}function mge(e){return BN(Math.max(-H$,Math.min(e,H$)))}function BN(e){return q$[0]=e,q$[0]}function yge(e,t){const i=BA(e),r=FN(e[2]/i),s=Math.atan2(e[1]/i,e[0]/i);return AN(t,i,r,s),t}function gge(e){const t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[3]*e[3]+e[4]*e[4]+e[5]*e[5],r=e[6]*e[6]+e[7]*e[7]+e[8]*e[8];return!(PS(t,1)&&PS(i,1)&&PS(r,1))}const H$=BN(34028234663852886e22);function tv(e){return Ll(oA(e),0,255)}function iv(e,t,i){return e=Number(e),isNaN(e)?i:ei?i:e}function rv(e,t){const i=e.toString(16).padStart(2,"0");return t?i.substring(0,1):i}let Zv=class gs{static blendColors(t,i,r,s=new gs){return s.r=Math.round(t.r+(i.r-t.r)*r),s.g=Math.round(t.g+(i.g-t.g)*r),s.b=Math.round(t.b+(i.b-t.b)*r),s.a=t.a+(i.a-t.a)*r,s._sanitize()}static fromRgb(t,i){const r=t.toLowerCase().match(/^(rgba?|hsla?)\(([\s\.\-,%0-9]+)\)/);if(r){const s=r[2].split(/\s*,\s*/),n=r[1];if(n==="rgb"&&s.length===3||n==="rgba"&&s.length===4){const c=s[0];if(c.charAt(c.length-1)==="%"){const o=s.map(f=>2.56*parseFloat(f));return s.length===4&&(o[3]=parseFloat(s[3])),gs.fromArray(o,i)}return gs.fromArray(s.map(o=>parseFloat(o)),i)}if(n==="hsl"&&s.length===3||n==="hsla"&&s.length===4)return gs.fromArray(xN(parseFloat(s[0]),parseFloat(s[1])/100,parseFloat(s[2])/100,parseFloat(s[3])),i)}return null}static fromHex(t,i=new gs){if(t[0]!=="#"||isNaN(+`0x${t.substring(1)}`))return null;switch(t.length){case 4:case 5:{const r=parseInt(t.substring(1,2),16),s=parseInt(t.substring(2,3),16),n=parseInt(t.substring(3,4),16),c=t.length===5?15:parseInt(t.substring(4),16);return gs.fromArray([r+16*r,s+16*s,n+16*n,(c+16*c)/255],i)}case 7:case 9:{const r=parseInt(t.substring(1,3),16),s=parseInt(t.substring(3,5),16),n=parseInt(t.substring(5,7),16),c=t.length===7?255:parseInt(t.substring(7),16);return gs.fromArray([r,s,n,c/255],i)}default:return null}}static fromArray(t,i=new gs){return i._set(Number(t[0]),Number(t[1]),Number(t[2]),Number(t[3])),isNaN(i.a)&&(i.a=1),i._sanitize()}static fromString(t,i){const r=wN(t)?NA(t):null;return r&&gs.fromArray(r,i)||gs.fromRgb(t,i)||gs.fromHex(t,i)}static fromJSON(t){return t!=null?new gs([t[0],t[1],t[2],(t[3]??255)/255]):void 0}static toUnitRGB(t){return t!=null?[t.r/255,t.g/255,t.b/255]:null}static toUnitRGBA(t){return t!=null?[t.r/255,t.g/255,t.b/255,t.a!=null?t.a:1]:null}constructor(t){this.r=255,this.g=255,this.b=255,this.a=1,t&&this.setColor(t)}get isBright(){return .299*this.r+.587*this.g+.114*this.b>=127}setColor(t){return typeof t=="string"?gs.fromString(t,this):Array.isArray(t)?gs.fromArray(t,this):(this._set(t.r??0,t.g??0,t.b??0,t.a??1),t instanceof gs||this._sanitize()),this}toRgb(){return[this.r,this.g,this.b]}toRgba(){return[this.r,this.g,this.b,this.a]}toHex(t){const i=(t==null?void 0:t.capitalize)??!1,r=(t==null?void 0:t.digits)??6,s=r===3||r===4,n=r===4||r===8,c=`#${rv(this.r,s)}${rv(this.g,s)}${rv(this.b,s)}${n?rv(Math.round(255*this.a),s):""}`;return i?c.toUpperCase():c}toCss(t=!1){const i=this.r+", "+this.g+", "+this.b;return t?`rgba(${i}, ${this.a})`:`rgb(${i})`}toString(){return this.toCss(!0)}toJSON(){return this.toArray()}toArray(t=gs.AlphaMode.ALWAYS){const i=tv(this.r),r=tv(this.g),s=tv(this.b);return t===gs.AlphaMode.ALWAYS||this.a!==1?[i,r,s,tv(255*this.a)]:[i,r,s]}clone(){return new gs(this.toRgba())}hash(){return this.r<<24|this.g<<16|this.b<<8|255*this.a}equals(t){return t!=null&&t.r===this.r&&t.g===this.g&&t.b===this.b&&t.a===this.a}_sanitize(){return this.r=Math.round(iv(this.r,0,255)),this.g=Math.round(iv(this.g,0,255)),this.b=Math.round(iv(this.b,0,255)),this.a=iv(this.a,0,1),this}_set(t,i,r,s){this.r=t,this.g=i,this.b=r,this.a=s}};Zv.prototype.declaredClass="esri.Color",function(e){var t;(t=e.AlphaMode||(e.AlphaMode={}))[t.ALWAYS=0]="ALWAYS",t[t.UNLESS_OPAQUE=1]="UNLESS_OPAQUE"}(Zv||(Zv={}));const zt=Zv;function _ge(e){}function AY(e){return()=>e}function Gt(e,t={}){const i=e instanceof ks?e:new ks(e,t),r={type:(t==null?void 0:t.ignoreUnknown)??1?i.apiValues:String,json:{type:i.jsonValues,read:!(t!=null&&t.readOnly)&&{reader:i.read},write:{writer:i.write}}};return(t==null?void 0:t.readOnly)!==void 0&&(r.readOnly=!!t.readOnly),(t==null?void 0:t.default)!==void 0&&(r.json.default=t.default),(t==null?void 0:t.name)!==void 0&&(r.json.name=t.name),(t==null?void 0:t.nonNullable)!==void 0&&(r.nonNullable=t.nonNullable),M(r)}var _E;let Yv=_E=class extends At{constructor(e){super(e),this.type="none"}clone(){return new _E({type:this.type})}};v([Gt({none:"none",stayAbove:"stay-above"})],Yv.prototype,"type",void 0),Yv=_E=v([fe("esri.ground.NavigationConstraint")],Yv);function UN(e){const t=oA(100*(1-e));return Math.max(0,Math.min(t,100))}function bw(e){const t=1-e/100;return Math.max(0,Math.min(t,1))}var vE;let bc=vE=class extends y_(dh){constructor(e){super(e),this.opacity=1,this.surfaceColor=null,this.navigationConstraint=null,this.layers=new Bt;const t=r=>{r.parent&&r.parent!==this&&"remove"in r.parent&&r.parent.remove(r),r.parent=this,r.type!=="elevation"&&r.type!=="base-elevation"&&_t.getLogger(this).error(`Layer '${r.title}, id:${r.id}' of type '${r.type}' is not supported as a ground layer and will therefore be ignored. Only layers of type 'elevation' are supported.`)},i=r=>{r.parent=null};this.addHandles([this.layers.on("after-add",r=>t(r.item)),this.layers.on("after-remove",r=>i(r.item))])}initialize(){this.when().catch(e=>{Ys(e)||_t.getLogger(this).error("#load()","Failed to load ground",e)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const e=this.layers.removeAll();for(const t of e)lr(t);this.layers.destroy()}normalizeCtorArgs(e){return e&&"resourceInfo"in e&&(this._set("resourceInfo",e.resourceInfo),delete(e={...e}).resourceInfo),e}set layers(e){this._set("layers",mp(e,this._get("layers")))}writeLayers(e,t,i,r){const s=[];e&&(r={...r,layerContainerType:"ground"},e.forEach(n=>{if("write"in n){const c={};AY(n)().write(c,r)&&s.push(c)}else r!=null&&r.messages&&r.messages.push(new Je("layer:unsupported",`Layers (${n.title}, ${n.id}) of type '${n.declaredClass}' cannot be persisted in the ground`,{layer:n}))})),t.layers=s}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return K4(this,e=>{e(this.layers)})}async queryElevation(e,t){await this.load({signal:t==null?void 0:t.signal});const{ElevationQuery:i}=await ht(()=>import("./ElevationQuery-BFZ9QB_a.js"),[]);mr(t);const r=new i,s=this.layers.filter(W$).toArray();return r.queryAll(s,e,t)}async createElevationSampler(e,t){await this.load({signal:t==null?void 0:t.signal});const{ElevationQuery:i}=await ht(()=>import("./ElevationQuery-BFZ9QB_a.js"),[]);mr(t);const r=new i,s=this.layers.filter(W$).toArray();return r.createSamplerAll(s,e,t)}clone(){const e={opacity:this.opacity,surfaceColor:He(this.surfaceColor),navigationConstraint:He(this.navigationConstraint),layers:this.layers.slice()};return this.loaded&&(e.loadStatus="loaded"),new vE({resourceInfo:this.resourceInfo}).set(e)}read(e,t){this.resourceInfo||this._set("resourceInfo",{data:e,context:t}),super.read(e,t)}_loadFromSource(e){const t=this.resourceInfo;return t?this._loadLayersFromJSON(t.data,t.context,e):Promise.resolve()}async _loadLayersFromJSON(e,t,i){const r=(t==null?void 0:t.origin)||"web-scene",s=(t==null?void 0:t.portal)||null,n=(t==null?void 0:t.url)||null,{populateOperationalLayers:c}=await ht(()=>import("./layersCreator-ByGguThJ.js"),__vite__mapDeps([2,3,4,5,6]));mr(i);const o=[];if(e.layers&&Array.isArray(e.layers)){const f={context:{origin:r,url:n,portal:s,layerContainerType:"ground"},defaultLayerType:"ArcGISTiledElevationServiceLayer"};o.push(c(this.layers,e.layers,f))}await Promise.allSettled(o)}};function PY(e){return e&&"createElevationSampler"in e}function W$(e){return e.type==="elevation"||PY(e)}v([M({json:{read:!1}})],bc.prototype,"layers",null),v([ui("layers")],bc.prototype,"writeLayers",null),v([M({readOnly:!0})],bc.prototype,"resourceInfo",void 0),v([M({type:Number,nonNullable:!0,range:{min:0,max:1},json:{type:$r,read:{reader:bw,source:"transparency"},write:{writer:(e,t)=>{t.transparency=UN(e)},target:"transparency"}}})],bc.prototype,"opacity",void 0),v([M({type:zt,json:{type:[$r],write:(e,t)=>{t.surfaceColor=e.toJSON().slice(0,3)}}})],bc.prototype,"surfaceColor",void 0),v([M({type:Yv,json:{write:!0}})],bc.prototype,"navigationConstraint",void 0),bc=vE=v([fe("esri.Ground")],bc);const ww=bc;let Rf=class extends Bt{constructor(t){super(t),this.getCollections=null}initialize(){this.addHandles(DG(()=>this._refresh()))}destroy(){this.getCollections=null}_refresh(){const t=this.getCollections!=null?this.getCollections():null;if(t==null)return void this.removeAll();let i=0;for(const r of t)r!=null&&(i=this._processCollection(i,r));this.splice(i,this.length)}_createNewInstance(t){return new Bt(t)}_processCollection(t,i){if(!i)return t;const r=this.itemFilterFunction??(s=>!!s);for(const s of i)if(s){if(r(s)){const n=this.indexOf(s,t);n>=0?n!==t&&this.reorder(s,t):this.add(s,t),++t}if(this.getChildrenFunction){const n=this.getChildrenFunction(s);if(Array.isArray(n))for(const c of n)t=this._processCollection(t,c);else t=this._processCollection(t,n)}}return t}};v([M()],Rf.prototype,"getCollections",void 0),v([M()],Rf.prototype,"getChildrenFunction",void 0),v([M()],Rf.prototype,"itemFilterFunction",void 0),Rf=v([fe("esri.core.CollectionFlattener")],Rf);const W0=Rf;function CY(e){var t,i;return!(!(e&&typeof e=="object"&&"loaded"in e&&e.loaded&&((i=(t=fZ(e))==null?void 0:t.operations)!=null&&i.supportsEditing)&&"type"in e)||"editingEnabled"in e&&!yZ(e))}const $Y=/^-?(\d+(\.\d+)?)\s*((px)|(pt))?$/i,kY="screenUtils.toPt: input not recognized!",jN=96;function bge(e){return e?e/72*jN:0}function mh(e){return e?72*e/jN:0}function xr(e){if(typeof e=="string"){const t=e.match($Y);if(t){const i=Number(t[1]),r=t[3]&&t[3].toLowerCase(),s=e.charAt(0)==="-",n=r==="px"?mh(i):i;return s?-n:n}return console.warn(kY),null}return e}function Dn(e=0,t=0){return{x:e,y:t}}function wge(e=0,t=0){return[e,t]}function Ix(){const e=new Float32Array(16);return e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function RY(e){const t=new Float32Array(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function OY(e,t,i,r,s,n,c,o,f,g,S,I,A,O,z,V){const H=new Float32Array(16);return H[0]=e,H[1]=t,H[2]=i,H[3]=r,H[4]=s,H[5]=n,H[6]=c,H[7]=o,H[8]=f,H[9]=g,H[10]=S,H[11]=I,H[12]=A,H[13]=O,H[14]=z,H[15]=V,H}function LY(e,t){return new Float32Array(e,t,16)}const DY=Ix();Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:DY,clone:RY,create:Ix,createView:LY,fromValues:OY},Symbol.toStringTag,{value:"Module"}));function NY(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Mh(e,t,i,r,s,n,c,o,f,g,S,I,A,O,z,V,H){return e[0]=t,e[1]=i,e[2]=r,e[3]=s,e[4]=n,e[5]=c,e[6]=o,e[7]=f,e[8]=g,e[9]=S,e[10]=I,e[11]=A,e[12]=O,e[13]=z,e[14]=V,e[15]=H,e}function Ax(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Ih(e,t){if(e===t){const i=t[1],r=t[2],s=t[3],n=t[6],c=t[7],o=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=i,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=n,e[11]=t[14],e[12]=s,e[13]=c,e[14]=o}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function zY(e,t){return VN(e,t)||Ax(e),e}function VN(e,t){const i=t[0],r=t[1],s=t[2],n=t[3],c=t[4],o=t[5],f=t[6],g=t[7],S=t[8],I=t[9],A=t[10],O=t[11],z=t[12],V=t[13],H=t[14],Q=t[15],ve=i*o-r*c,me=i*f-s*c,ge=i*g-n*c,Ie=r*f-s*o,Ce=r*g-n*o,ze=s*g-n*f,je=S*V-I*z,tt=S*H-A*z,ut=S*Q-O*z,ot=I*H-A*V,et=I*Q-O*V,Et=A*Q-O*H;let dt=ve*Et-me*et+ge*ot+Ie*ut-Ce*tt+ze*je;return dt?(dt=1/dt,e[0]=(o*Et-f*et+g*ot)*dt,e[1]=(s*et-r*Et-n*ot)*dt,e[2]=(V*ze-H*Ce+Q*Ie)*dt,e[3]=(A*Ce-I*ze-O*Ie)*dt,e[4]=(f*ut-c*Et-g*tt)*dt,e[5]=(i*Et-s*ut+n*tt)*dt,e[6]=(H*ge-z*ze-Q*me)*dt,e[7]=(S*ze-A*ge+O*me)*dt,e[8]=(c*et-o*ut+g*je)*dt,e[9]=(r*ut-i*et-n*je)*dt,e[10]=(z*Ce-V*ge+Q*ve)*dt,e[11]=(I*ge-S*Ce-O*ve)*dt,e[12]=(o*tt-c*ot-f*je)*dt,e[13]=(i*ot-r*tt+s*je)*dt,e[14]=(V*me-z*Ie-H*ve)*dt,e[15]=(S*Ie-I*me+A*ve)*dt,e):null}function FY(e,t){const i=t[0],r=t[1],s=t[2],n=t[3],c=t[4],o=t[5],f=t[6],g=t[7],S=t[8],I=t[9],A=t[10],O=t[11],z=t[12],V=t[13],H=t[14],Q=t[15];return e[0]=o*(A*Q-O*H)-I*(f*Q-g*H)+V*(f*O-g*A),e[1]=-(r*(A*Q-O*H)-I*(s*Q-n*H)+V*(s*O-n*A)),e[2]=r*(f*Q-g*H)-o*(s*Q-n*H)+V*(s*g-n*f),e[3]=-(r*(f*O-g*A)-o*(s*O-n*A)+I*(s*g-n*f)),e[4]=-(c*(A*Q-O*H)-S*(f*Q-g*H)+z*(f*O-g*A)),e[5]=i*(A*Q-O*H)-S*(s*Q-n*H)+z*(s*O-n*A),e[6]=-(i*(f*Q-g*H)-c*(s*Q-n*H)+z*(s*g-n*f)),e[7]=i*(f*O-g*A)-c*(s*O-n*A)+S*(s*g-n*f),e[8]=c*(I*Q-O*V)-S*(o*Q-g*V)+z*(o*O-g*I),e[9]=-(i*(I*Q-O*V)-S*(r*Q-n*V)+z*(r*O-n*I)),e[10]=i*(o*Q-g*V)-c*(r*Q-n*V)+z*(r*g-n*o),e[11]=-(i*(o*O-g*I)-c*(r*O-n*I)+S*(r*g-n*o)),e[12]=-(c*(I*H-A*V)-S*(o*H-f*V)+z*(o*A-f*I)),e[13]=i*(I*H-A*V)-S*(r*H-s*V)+z*(r*A-s*I),e[14]=-(i*(o*H-f*V)-c*(r*H-s*V)+z*(r*f-s*o)),e[15]=i*(o*A-f*I)-c*(r*A-s*I)+S*(r*f-s*o),e}function BY(e){const t=e[0],i=e[1],r=e[2],s=e[3],n=e[4],c=e[5],o=e[6],f=e[7],g=e[8],S=e[9],I=e[10],A=e[11],O=e[12],z=e[13],V=e[14],H=e[15];return(t*c-i*n)*(I*H-A*V)-(t*o-r*n)*(S*H-A*z)+(t*f-s*n)*(S*V-I*z)+(i*o-r*c)*(g*H-A*O)-(i*f-s*c)*(g*V-I*O)+(r*f-s*o)*(g*z-S*O)}function GN(e,t,i){const r=t[0],s=t[1],n=t[2],c=t[3],o=t[4],f=t[5],g=t[6],S=t[7],I=t[8],A=t[9],O=t[10],z=t[11],V=t[12],H=t[13],Q=t[14],ve=t[15];let me=i[0],ge=i[1],Ie=i[2],Ce=i[3];return e[0]=me*r+ge*o+Ie*I+Ce*V,e[1]=me*s+ge*f+Ie*A+Ce*H,e[2]=me*n+ge*g+Ie*O+Ce*Q,e[3]=me*c+ge*S+Ie*z+Ce*ve,me=i[4],ge=i[5],Ie=i[6],Ce=i[7],e[4]=me*r+ge*o+Ie*I+Ce*V,e[5]=me*s+ge*f+Ie*A+Ce*H,e[6]=me*n+ge*g+Ie*O+Ce*Q,e[7]=me*c+ge*S+Ie*z+Ce*ve,me=i[8],ge=i[9],Ie=i[10],Ce=i[11],e[8]=me*r+ge*o+Ie*I+Ce*V,e[9]=me*s+ge*f+Ie*A+Ce*H,e[10]=me*n+ge*g+Ie*O+Ce*Q,e[11]=me*c+ge*S+Ie*z+Ce*ve,me=i[12],ge=i[13],Ie=i[14],Ce=i[15],e[12]=me*r+ge*o+Ie*I+Ce*V,e[13]=me*s+ge*f+Ie*A+Ce*H,e[14]=me*n+ge*g+Ie*O+Ce*Q,e[15]=me*c+ge*S+Ie*z+Ce*ve,e}function UY(e,t,i){const r=i[0],s=i[1],n=i[2];if(t===e)e[12]=t[0]*r+t[4]*s+t[8]*n+t[12],e[13]=t[1]*r+t[5]*s+t[9]*n+t[13],e[14]=t[2]*r+t[6]*s+t[10]*n+t[14],e[15]=t[3]*r+t[7]*s+t[11]*n+t[15];else{const c=t[0],o=t[1],f=t[2],g=t[3],S=t[4],I=t[5],A=t[6],O=t[7],z=t[8],V=t[9],H=t[10],Q=t[11];e[0]=c,e[1]=o,e[2]=f,e[3]=g,e[4]=S,e[5]=I,e[6]=A,e[7]=O,e[8]=z,e[9]=V,e[10]=H,e[11]=Q,e[12]=c*r+S*s+z*n+t[12],e[13]=o*r+I*s+V*n+t[13],e[14]=f*r+A*s+H*n+t[14],e[15]=g*r+O*s+Q*n+t[15]}return e}function jY(e,t,i){const r=i[0],s=i[1],n=i[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*s,e[5]=t[5]*s,e[6]=t[6]*s,e[7]=t[7]*s,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function VY(e,t,i,r){let s,n,c,o,f,g,S,I,A,O,z,V,H,Q,ve,me,ge,Ie,Ce,ze,je,tt,ut,ot,et=r[0],Et=r[1],dt=r[2],vi=Math.sqrt(et*et+Et*Et+dt*dt);return vi0?(i[0]=2*(o*c+S*r+f*n-g*s)/I,i[1]=2*(f*c+S*s+g*r-o*n)/I,i[2]=2*(g*c+S*n+o*s-f*r)/I):(i[0]=2*(o*c+S*r+f*n-g*s),i[1]=2*(f*c+S*s+g*r-o*n),i[2]=2*(g*c+S*n+o*s-f*r)),qN(e,t,i),e}const eJ=Eh();function tJ(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function iJ(e,t){const i=t[0],r=t[1],s=t[2],n=t[4],c=t[5],o=t[6],f=t[8],g=t[9],S=t[10];return e[0]=Math.sqrt(i*i+r*r+s*s),e[1]=Math.sqrt(n*n+c*c+o*o),e[2]=Math.sqrt(f*f+g*g+S*S),e}function rJ(e,t){const i=t[0]+t[5]+t[10];let r=0;return i>0?(r=2*Math.sqrt(i+1),e[3]=.25*r,e[0]=(t[6]-t[9])/r,e[1]=(t[8]-t[2])/r,e[2]=(t[1]-t[4])/r):t[0]>t[5]&&t[0]>t[10]?(r=2*Math.sqrt(1+t[0]-t[5]-t[10]),e[3]=(t[6]-t[9])/r,e[0]=.25*r,e[1]=(t[1]+t[4])/r,e[2]=(t[8]+t[2])/r):t[5]>t[10]?(r=2*Math.sqrt(1+t[5]-t[0]-t[10]),e[3]=(t[8]-t[2])/r,e[0]=(t[1]+t[4])/r,e[1]=.25*r,e[2]=(t[6]+t[9])/r):(r=2*Math.sqrt(1+t[10]-t[0]-t[5]),e[3]=(t[1]-t[4])/r,e[0]=(t[8]+t[2])/r,e[1]=(t[6]+t[9])/r,e[2]=.25*r),e}function sJ(e,t,i,r){const s=t[0],n=t[1],c=t[2],o=t[3],f=s+s,g=n+n,S=c+c,I=s*f,A=s*g,O=s*S,z=n*g,V=n*S,H=c*S,Q=o*f,ve=o*g,me=o*S,ge=r[0],Ie=r[1],Ce=r[2];return e[0]=(1-(z+H))*ge,e[1]=(A+me)*ge,e[2]=(O-ve)*ge,e[3]=0,e[4]=(A-me)*Ie,e[5]=(1-(I+H))*Ie,e[6]=(V+Q)*Ie,e[7]=0,e[8]=(O+ve)*Ce,e[9]=(V-Q)*Ce,e[10]=(1-(I+z))*Ce,e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e}function nJ(e,t,i,r,s){const n=t[0],c=t[1],o=t[2],f=t[3],g=n+n,S=c+c,I=o+o,A=n*g,O=n*S,z=n*I,V=c*S,H=c*I,Q=o*I,ve=f*g,me=f*S,ge=f*I,Ie=r[0],Ce=r[1],ze=r[2],je=s[0],tt=s[1],ut=s[2],ot=(1-(V+Q))*Ie,et=(O+ge)*Ie,Et=(z-me)*Ie,dt=(O-ge)*Ce,vi=(1-(A+Q))*Ce,$i=(H+ve)*Ce,Kt=(z+me)*ze,Ft=(H-ve)*ze,ji=(1-(A+V))*ze;return e[0]=ot,e[1]=et,e[2]=Et,e[3]=0,e[4]=dt,e[5]=vi,e[6]=$i,e[7]=0,e[8]=Kt,e[9]=Ft,e[10]=ji,e[11]=0,e[12]=i[0]+je-(ot*je+dt*tt+Kt*ut),e[13]=i[1]+tt-(et*je+vi*tt+Ft*ut),e[14]=i[2]+ut-(Et*je+$i*tt+ji*ut),e[15]=1,e}function oJ(e,t){const i=t[0],r=t[1],s=t[2],n=t[3],c=i+i,o=r+r,f=s+s,g=i*c,S=r*c,I=r*o,A=s*c,O=s*o,z=s*f,V=n*c,H=n*o,Q=n*f;return e[0]=1-I-z,e[1]=S+Q,e[2]=A-H,e[3]=0,e[4]=S-Q,e[5]=1-g-z,e[6]=O+V,e[7]=0,e[8]=A+H,e[9]=O-V,e[10]=1-g-I,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function aJ(e,t,i,r,s,n,c){const o=1/(i-t),f=1/(s-r),g=1/(n-c);return e[0]=2*n*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*n*f,e[6]=0,e[7]=0,e[8]=(i+t)*o,e[9]=(s+r)*f,e[10]=(c+n)*g,e[11]=-1,e[12]=0,e[13]=0,e[14]=c*n*2*g,e[15]=0,e}function lJ(e,t,i,r,s){const n=1/Math.tan(t/2);let c;return e[0]=n/i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,s!=null&&s!==1/0?(c=1/(r-s),e[10]=(s+r)*c,e[14]=2*s*r*c):(e[10]=-1,e[14]=-2*r),e}function cJ(e,t,i,r){const s=Math.tan(t.upDegrees*Math.PI/180),n=Math.tan(t.downDegrees*Math.PI/180),c=Math.tan(t.leftDegrees*Math.PI/180),o=Math.tan(t.rightDegrees*Math.PI/180),f=2/(c+o),g=2/(s+n);return e[0]=f,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=g,e[6]=0,e[7]=0,e[8]=-(c-o)*f*.5,e[9]=(s-n)*g*.5,e[10]=r/(i-r),e[11]=-1,e[12]=0,e[13]=0,e[14]=r*i/(i-r),e[15]=0,e}function uJ(e,t,i,r,s,n,c){const o=1/(t-i),f=1/(r-s),g=1/(n-c);return e[0]=-2*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*f,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*g,e[11]=0,e[12]=(t+i)*o,e[13]=(s+r)*f,e[14]=(c+n)*g,e[15]=1,e}function hJ(e,t,i,r){const s=t[0],n=t[1],c=t[2];let o=s-i[0],f=n-i[1],g=c-i[2];const S=aa();if(Math.abs(o)0&&(O=1/Math.sqrt(O),S*=O,I*=O,A*=O);let z=f*A-g*I,V=g*S-o*A,H=o*I-f*S;return O=z*z+V*V+H*H,O>0&&(O=1/Math.sqrt(O),z*=O,V*=O,H*=O),e[0]=z,e[1]=V,e[2]=H,e[3]=0,e[4]=I*H-A*V,e[5]=A*z-S*H,e[6]=S*V-I*z,e[7]=0,e[8]=S,e[9]=I,e[10]=A,e[11]=0,e[12]=s,e[13]=n,e[14]=c,e[15]=1,e}function pJ(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}function fJ(e){return Math.sqrt(e[0]**2+e[1]**2+e[2]**2+e[3]**2+e[4]**2+e[5]**2+e[6]**2+e[7]**2+e[8]**2+e[9]**2+e[10]**2+e[11]**2+e[12]**2+e[13]**2+e[14]**2+e[15]**2)}function mJ(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e[4]=t[4]+i[4],e[5]=t[5]+i[5],e[6]=t[6]+i[6],e[7]=t[7]+i[7],e[8]=t[8]+i[8],e[9]=t[9]+i[9],e[10]=t[10]+i[10],e[11]=t[11]+i[11],e[12]=t[12]+i[12],e[13]=t[13]+i[13],e[14]=t[14]+i[14],e[15]=t[15]+i[15],e}function HN(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e[3]=t[3]-i[3],e[4]=t[4]-i[4],e[5]=t[5]-i[5],e[6]=t[6]-i[6],e[7]=t[7]-i[7],e[8]=t[8]-i[8],e[9]=t[9]-i[9],e[10]=t[10]-i[10],e[11]=t[11]-i[11],e[12]=t[12]-i[12],e[13]=t[13]-i[13],e[14]=t[14]-i[14],e[15]=t[15]-i[15],e}function yJ(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12]*i,e[13]=t[13]*i,e[14]=t[14]*i,e[15]=t[15]*i,e}function gJ(e,t,i,r){return e[0]=t[0]+i[0]*r,e[1]=t[1]+i[1]*r,e[2]=t[2]+i[2]*r,e[3]=t[3]+i[3]*r,e[4]=t[4]+i[4]*r,e[5]=t[5]+i[5]*r,e[6]=t[6]+i[6]*r,e[7]=t[7]+i[7]*r,e[8]=t[8]+i[8]*r,e[9]=t[9]+i[9]*r,e[10]=t[10]+i[10]*r,e[11]=t[11]+i[11]*r,e[12]=t[12]+i[12]*r,e[13]=t[13]+i[13]*r,e[14]=t[14]+i[14]*r,e[15]=t[15]+i[15]*r,e}function _J(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function vJ(e,t){if(e===t)return!0;const i=e[0],r=e[1],s=e[2],n=e[3],c=e[4],o=e[5],f=e[6],g=e[7],S=e[8],I=e[9],A=e[10],O=e[11],z=e[12],V=e[13],H=e[14],Q=e[15],ve=t[0],me=t[1],ge=t[2],Ie=t[3],Ce=t[4],ze=t[5],je=t[6],tt=t[7],ut=t[8],ot=t[9],et=t[10],Et=t[11],dt=t[12],vi=t[13],$i=t[14],Kt=t[15],Ft=aa();return Math.abs(i-ve)<=Ft*Math.max(1,Math.abs(i),Math.abs(ve))&&Math.abs(r-me)<=Ft*Math.max(1,Math.abs(r),Math.abs(me))&&Math.abs(s-ge)<=Ft*Math.max(1,Math.abs(s),Math.abs(ge))&&Math.abs(n-Ie)<=Ft*Math.max(1,Math.abs(n),Math.abs(Ie))&&Math.abs(c-Ce)<=Ft*Math.max(1,Math.abs(c),Math.abs(Ce))&&Math.abs(o-ze)<=Ft*Math.max(1,Math.abs(o),Math.abs(ze))&&Math.abs(f-je)<=Ft*Math.max(1,Math.abs(f),Math.abs(je))&&Math.abs(g-tt)<=Ft*Math.max(1,Math.abs(g),Math.abs(tt))&&Math.abs(S-ut)<=Ft*Math.max(1,Math.abs(S),Math.abs(ut))&&Math.abs(I-ot)<=Ft*Math.max(1,Math.abs(I),Math.abs(ot))&&Math.abs(A-et)<=Ft*Math.max(1,Math.abs(A),Math.abs(et))&&Math.abs(O-Et)<=Ft*Math.max(1,Math.abs(O),Math.abs(Et))&&Math.abs(z-dt)<=Ft*Math.max(1,Math.abs(z),Math.abs(dt))&&Math.abs(V-vi)<=Ft*Math.max(1,Math.abs(V),Math.abs(vi))&&Math.abs(H-$i)<=Ft*Math.max(1,Math.abs(H),Math.abs($i))&&Math.abs(Q-Kt)<=Ft*Math.max(1,Math.abs(Q),Math.abs(Kt))}function bJ(e){const t=aa(),i=e[0],r=e[1],s=e[2],n=e[4],c=e[5],o=e[6],f=e[8],g=e[9],S=e[10];return Math.abs(1-(i*i+n*n+f*f))<=t&&Math.abs(1-(r*r+c*c+g*g))<=t&&Math.abs(1-(s*s+o*o+S*S))<=t}function wJ(e){return e[0]===1&&e[1]===0&&e[2]===0&&e[4]===0&&e[5]===1&&e[6]===0&&e[8]===0&&e[9]===0&&e[10]===1}const xJ=GN,SJ=HN;Object.freeze(Object.defineProperty({__proto__:null,add:mJ,adjoint:FY,copy:NY,determinant:BY,equals:vJ,exactEquals:_J,frob:fJ,fromQuat:oJ,fromQuat2:QY,fromRotation:YY,fromRotationTranslation:qN,fromRotationTranslationScale:sJ,fromRotationTranslationScaleOrigin:nJ,fromScaling:ZY,fromTranslation:WY,fromXRotation:JY,fromYRotation:KY,fromZRotation:XY,frustum:aJ,getRotation:rJ,getScaling:iJ,getTranslation:tJ,hasIdentityRotation:wJ,identity:Ax,invert:VN,invertOrIdentity:zY,isOrthoNormal:bJ,lookAt:hJ,mul:xJ,multiply:GN,multiplyScalar:yJ,multiplyScalarAndAdd:gJ,ortho:uJ,perspective:lJ,perspectiveFromFieldOfView:cJ,rotate:VY,rotateX:GY,rotateY:qY,rotateZ:HY,scale:jY,set:Mh,str:pJ,sub:SJ,subtract:HN,targetTo:dJ,translate:UY,transpose:Ih},Symbol.toStringTag,{value:"Module"}));const TJ=(e,t)=>{const i=Mh(e,t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1);return Ih(i,i)},EJ=(e,t)=>{const i=Mh(e,t,0,0,.5-.5*t,0,t,0,.5-.5*t,0,0,t,.5-.5*t,0,0,0,1);return Ih(i,i)},MJ=(e,t)=>{const i=1-t,r=Mh(e,.2126+.7874*i,.7152-.7152*i,.0722-.0722*i,0,.2126-.2126*i,.7152+.2848*i,.0722-.0722*i,0,.2126-.2126*i,.7152-.7152*i,.0722+.9278*i,0,0,0,0,1);return Ih(r,r)},IJ=(e,t)=>{const i=Math.sin(t*Math.PI/180),r=Math.cos(t*Math.PI/180),s=Mh(e,.213+.787*r-.213*i,.715-.715*r-.715*i,.072-.072*r+.928*i,0,.213-.213*r+.143*i,.715+.285*r+.14*i,.072-.072*r-.283*i,0,.213-.213*r-.787*i,.715-.715*r+.715*i,.072+.928*r+.072*i,0,0,0,0,1);return Ih(s,s)},AJ=(e,t)=>{const i=1-2*t,r=Mh(e,i,0,0,t,0,i,0,t,0,0,i,t,0,0,0,1);return Ih(r,r)},PJ=(e,t)=>{const i=Mh(e,.213+.787*t,.715-.715*t,.072-.072*t,0,.213-.213*t,.715+.285*t,.072-.072*t,0,.213-.213*t,.715-.715*t,.072+.928*t,0,0,0,0,1);return Ih(i,i)},CJ=(e,t)=>{const i=1-t,r=Mh(e,.393+.607*i,.769-.769*i,.189-.189*i,0,.349-.349*i,.686+.314*i,.168-.168*i,0,.272-.272*i,.534-.534*i,.131+.869*i,0,0,0,0,1);return Ih(r,r)};let WN=class ZN{constructor(t,i,r){this.strength=t,this.radius=i,this.threshold=r,this.type="bloom"}interpolate(t,i,r){this.strength=Yn(t.strength,i.strength,r),this.radius=Yn(t.radius,i.radius,r),this.threshold=Yn(t.threshold,i.threshold,r)}clone(){return new ZN(this.strength,this.radius,this.threshold)}toJSON(){return{type:"bloom",radius:b0(this.radius),strength:this.strength,threshold:this.threshold}}},YN=class JN{constructor(t){this.radius=t,this.type="blur"}interpolate(t,i,r){this.radius=Math.round(Yn(t.radius,i.radius,r))}clone(){return new JN(this.radius)}toJSON(){return{type:"blur",radius:b0(this.radius)}}},bE=class KN{constructor(t,i){this.type=t,this.amount=i,this.type!=="invert"&&this.type!=="grayscale"&&this.type!=="sepia"||(this.amount=Math.min(this.amount,1))}get colorMatrix(){return this._colorMatrix||this._updateMatrix(),this._colorMatrix}interpolate(t,i,r){this.amount=Yn(t.amount,i.amount,r),this._updateMatrix()}clone(){return new KN(this.type,this.amount)}toJSON(){return{type:this.type,amount:this.amount}}_updateMatrix(){const t=this._colorMatrix||Ix();switch(this.type){case"brightness":this._colorMatrix=TJ(t,this.amount);break;case"contrast":this._colorMatrix=EJ(t,this.amount);break;case"grayscale":this._colorMatrix=MJ(t,this.amount);break;case"invert":this._colorMatrix=AJ(t,this.amount);break;case"saturate":this._colorMatrix=PJ(t,this.amount);break;case"sepia":this._colorMatrix=CJ(t,this.amount)}}},XN=class QN{constructor(t,i,r,s){this.offsetX=t,this.offsetY=i,this.blurRadius=r,this.color=s,this.type="drop-shadow"}interpolate(t,i,r){this.offsetX=Yn(t.offsetX,i.offsetX,r),this.offsetY=Yn(t.offsetY,i.offsetY,r),this.blurRadius=Yn(t.blurRadius,i.blurRadius,r),this.color[0]=Math.round(Yn(t.color[0],i.color[0],r)),this.color[1]=Math.round(Yn(t.color[1],i.color[1],r)),this.color[2]=Math.round(Yn(t.color[2],i.color[2],r)),this.color[3]=Yn(t.color[3],i.color[3],r)}clone(){return new QN(this.offsetX,this.offsetY,this.blurRadius,[...this.color])}toJSON(){const t=[...this.color];return t[3]*=255,{type:"drop-shadow",xoffset:b0(this.offsetX),yoffset:b0(this.offsetY),blurRadius:b0(this.blurRadius),color:t}}},e6=class t6{constructor(t){this.angle=t,this.type="hue-rotate"}get colorMatrix(){return this._colorMatrix||this._updateMatrix(),this._colorMatrix}interpolate(t,i,r){this.angle=Yn(t.angle,i.angle,r),this._updateMatrix()}clone(){return new t6(this.angle)}toJSON(){return{type:"hue-rotate",angle:this.angle}}_updateMatrix(){const t=this._colorMatrix||Ix();this._colorMatrix=IJ(t,this.angle)}},i6=class r6{constructor(t){this.amount=t,this.type="opacity",this.amount=Math.min(this.amount,1)}interpolate(t,i,r){this.amount=Yn(t.amount,i.amount,r)}clone(){return new r6(this.amount)}toJSON(){return{type:"opacity",amount:this.amount}}};function Yn(e,t,i){return e+(t-e)*i}function b0(e){return Math.round(1e3*mh(e))/1e3}function $J(e){switch(e.type){case"grayscale":case"sepia":case"invert":return new bE(e.type,0);case"saturate":case"brightness":case"contrast":return new bE(e.type,1);case"opacity":return new i6(1);case"hue-rotate":return new e6(0);case"blur":return new YN(0);case"drop-shadow":return new XN(0,0,0,[...NA("transparent")]);case"bloom":return new WN(0,0,1)}}function kJ(e,t){const i=e.length>t.length?e:t;return(e.length>t.length?t:e).every((r,s)=>r.type===i[s].type)}function RJ(e,t){const i=e.length>t.length?e:t,r=e.length>t.length?t:e;for(let s=r.length;s_t.getLogger("esri.support.basemapUtils");function LJ(){return{}}function DJ(e){for(const t in e){const i=e[t];lr(i),delete e[t]}}function NJ(e,t){let i;if(typeof e=="string"){const r=e in yE,s=!r&&e.includes("/");if(!r&&!s){const n=Object.entries(yE).filter(([c,o])=>Ci.apiKey&&!o.classic||!Ci.apiKey&&(o.classic||o.is3d)).map(([c])=>`"${c}"`).sort().join(", ");return Z$().warn(`Unable to find basemap definition for: ${e}. Try one of these: ${n}`),null}t&&(i=t[e]),i||(i=r?v0.fromId(e):new v0({style:{id:e}}),t&&(t[e]=i))}else i=Fn(v0,e);return i!=null&&i.destroyed&&(Z$().warn("The provided basemap is already destroyed",{basemap:i}),i=null),i}function zJ(e){return new W0({getCollections:()=>[e.tables,e.layers],getChildrenFunction:t=>{const i=[];return"tables"in t&&i.push(t.tables),"layers"in t&&i.push(t.layers),i},itemFilterFunction:t=>{const i=t.parent;return!!i&&"tables"in i&&i.tables.includes(t)}})}function $S(e){for(const t of e.values())t==null||t.destroy();e.clear()}const Y$={"world-elevation":{id:"worldElevation",url:"//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer",layerType:"ArcGISTiledElevationServiceLayer"},"world-topobathymetry":{id:"worldTopoBathymetry",url:"//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/TopoBathy3D/ImageServer",layerType:"ArcGISTiledElevationServiceLayer"}};function FJ(e){let t=null;if(typeof e=="string")if(e in Y$){const i=Y$[e];t=new ww({resourceInfo:{data:{layers:[i]}}})}else _t.getLogger("esri.support.groundUtils").warn(`Unable to find ground definition for: ${e}. Try "world-elevation"`);else t=Fn(ww,e);return t}function Cm(e,t,i=!1){let{hasM:r,hasZ:s}=e;Array.isArray(t)?t.length!==4||r||s?t.length===3&&i&&!r?(s=!0,r=!1):t.length===3&&r&&s&&(r=!1,s=!1):(r=!0,s=!0):(s=!s&&t.hasZ&&(!r||t.hasM),r=!r&&t.hasM&&(!s||t.hasZ)),e.hasZ=s,e.hasM=r}var wE;function J$(e){return(t,i)=>t==null?i:i==null?t:e(t,i)}function BJ(e){return e&&(e.declaredClass==="esri.geometry.SpatialReference"||e.wkid!=null)}let Au=wE=class extends Th{constructor(...e){super(...e),this.points=[],this.type="multipoint"}normalizeCtorArgs(e,t){var s;if(!e&&!t)return{};const i={};Array.isArray(e)?(i.points=e,i.spatialReference=t):BJ(e)?i.spatialReference=e:(e.points&&(i.points=e.points),e.spatialReference&&(i.spatialReference=e.spatialReference),e.hasZ&&(i.hasZ=e.hasZ),e.hasM&&(i.hasM=e.hasM));const r=(s=i.points)==null?void 0:s[0];return r&&(i.hasZ===void 0&&i.hasM===void 0?(i.hasZ=r.length>2,i.hasM=!1):i.hasZ===void 0?i.hasZ=r.length>3:i.hasM===void 0&&(i.hasM=r.length>3)),i}get cache(){return this.commitProperty("points"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get extent(){const e=this.points;if(!e.length)return null;const t=new Ui,i=this.hasZ,r=this.hasM,s=i?3:2,n=e[0],c=J$(Math.min),o=J$(Math.max);let f,g,S,I,[A,O]=n,[z,V]=n;for(let H=0,Q=e.length;H2){const Ie=ve[2];f=c(f,Ie),S=o(S,Ie)}if(r&&ve.length>s){const Ie=ve[s];g=c(g,Ie),I=o(I,Ie)}}return t.xmin=A,t.ymin=O,t.xmax=z,t.ymax=V,t.spatialReference=this.spatialReference,i?(t.zmin=f,t.zmax=S):(t.zmin=void 0,t.zmax=void 0),r?(t.mmin=g,t.mmax=I):(t.mmin=void 0,t.mmax=void 0),t}writePoints(e,t){t.points=He(this.points)}addPoint(e){return Cm(this,e),Array.isArray(e)?this.points.push(e):this.points.push(e.toArray()),this.notifyChange("points"),this}clone(){const e={points:He(this.points),spatialReference:this.spatialReference};return this.hasZ&&(e.hasZ=!0),this.hasM&&(e.hasM=!0),new wE(e)}getPoint(e){if(!this._validateInputs(e))return null;const t=this.points[e],i={x:t[0],y:t[1],spatialReference:this.spatialReference};let r=2;return this.hasZ&&(i.z=t[2],r=3),this.hasM&&(i.m=t[r]),new ri(i)}removePoint(e){if(!this._validateInputs(e))return null;const t=new ri(this.points.splice(e,1)[0],this.spatialReference);return this.notifyChange("points"),t}setPoint(e,t){return this._validateInputs(e)?(Cm(this,t),Array.isArray(t)||(t=t.toArray()),this.points[e]=t,this.notifyChange("points"),this):this}toJSON(e){return this.write({},e)}_validateInputs(e){return e!=null&&e>=0&&e2&&t.length>2){const s=e[2]-t[2];return Math.sqrt(i*i+r*r+s*s)}return Math.sqrt(i*i+r*r)}function jJ(e,t,i){const r=e[0]+i*(t[0]-e[0]),s=e[1]+i*(t[1]-e[1]);return e.length>2&&t.length>2?[r,s,e[2]+i*(t[2]-e[2])]:[r,s]}function VJ(e,t,i,r){return GJ(e,t,i[r],i[r+1])}function GJ(e,t,i,r){const[s,n]=t,[c,o]=i,[f,g]=r,S=f-c,I=g-o,A=S*S+I*I,O=(s-c)*S+(n-o)*I,z=Math.min(1,Math.max(0,O/A));return e[0]=c+S*z,e[1]=o+I*z,e}function qJ(e,t,i,r,s,n){let c=i,o=r,f=s-c,g=n-o;if(f!==0||g!==0){const S=((e-c)*f+(t-o)*g)/(f*f+g*g);S>1?(c=s,o=n):S>0&&(c+=f*S,o+=g*S)}return f=e-c,g=t-o,f*f+g*g}function n6(e,t){return jJ(e,t,.5)}function o6(e,t=xw.X,i=xw.Y){let r=0;const s=e.length;let n=e[0];for(let c=0;c=0}function HJ(e){const t=e.length;return t>2&&sx(e[0],e[t-1])}function Sge(e){if("rings"in e&&(WJ(e),e.rings.length>0&&!o6(e.rings[0])))for(const t of e.rings)t.reverse()}function WJ(e){if("rings"in e)for(const t of e.rings)HJ(t)||t.push(t[0].slice())}function Tge(e){return e?e.hasZ?[e.xmax-e.xmin/2,e.ymax-e.ymin/2,e.zmax-e.zmin/2]:[e.xmax-e.xmin/2,e.ymax-e.ymin/2]:null}function ZJ(e){return e?YJ(e.rings,e.hasZ??!1):null}function YJ(e,t){if(!(e!=null&&e.length))return null;const i=[],r=[],s=t?[1/0,-1/0,1/0,-1/0,1/0,-1/0]:[1/0,-1/0,1/0,-1/0];for(let n=0,c=e.length;n{let o=n[2]-c[2];return o===0&&t&&(o=n[4]-c[4]),o}),r.length&&(i[0]=r[0][0],i[1]=r[0][1],t&&(i[2]=r[0][3]),(i[0]s[1]||i[1]s[3]||t&&(i[2]s[5]))&&(i.length=0)),!i.length){const n=e[0]&&e[0].length?JJ(e[0],t):null;if(!n)return null;i[0]=n[0],i[1]=n[1],t&&n.length>2&&(i[2]=n[2])}return i}function a6(e,t,i){let r=0,s=0,n=0,c=0,o=0;const f=e.length?e[0][0]:0,g=e.length?e[0][1]:0,S=e.length&&t?e[0][2]:0;for(let A=0;A2&&z.length>2){const ut=Q-S,ot=Ce-S,et=ve*ot-ze*ut;n+=(ut+ot)*et,o+=et}Vi[1]&&(i[1]=V),Hi[3]&&(i[3]=H),t&&(Qi[5]&&(i[5]=Q))}if(c>0&&(c*=-1),o>0&&(o*=-1),!c)return null;c*=.5,o*=.5;const I=[r/(6*c)+f,s/(6*c)+g,c];return t&&(i[4]===i[5]||o===0?(I[3]=(i[4]+i[5])/2,I[4]=0):(I[3]=n/(6*o)+S,I[4]=o)),I}function Ege(e,t){let i=0,r=0,s=0;e.nextPoint();const n=e.pathSize?e.x:0,c=e.pathSize?e.y:0;for(let o=0;ot[1]&&(t[1]=S),It[3]&&(t[3]=I)}return s>0&&(s*=-1),s?(s*=.5,[i/(6*s)+n,r/(6*s)+c,s]):null}function JJ(e,t){const i=t?[0,0,0]:[0,0],r=t?[0,0,0]:[0,0];let s=0,n=0,c=0,o=0;for(let f=0,g=e.length;f2&&I.length>2&&(i[2]=S[2],r[2]=I[2]);const A=s6(i,r);if(A){s+=A;const O=n6(S,I);n+=A*O[0],c+=A*O[1],t&&O.length>2&&(o+=A*O[2])}}}return s>0?t?[n/s,c/s,o/s]:[n/s,c/s]:e.length?e[0]:null}function KJ(e){const{hasZ:t,totalSize:i}=e;if(i===0)return null;const r=[],s=[],n=t?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY];for(e.reset();e.nextPath();){const c=a6(UJ(e),e.hasZ,n);c&&s.push(c)}if(s.sort((c,o)=>{let f=c[2]-o[2];return f===0&&t&&(f=c[4]-o[4]),f}),s.length&&(r[0]=s[0][0],r[1]=s[0][1],t&&(r[2]=s[0][3]),(r[0]n[1]||r[1]n[3]||t&&(r[2]n[5]))&&(r.length=0)),!r.length){e.reset(),e.nextPath();const c=e.pathSize?XJ(e):null;if(!c)return null;r[0]=c[0],r[1]=c[1],t&&c.length>2&&(r[2]=c[2])}return r}function XJ(e){const{hasZ:t}=e,i=t?[0,0,0]:[0,0],r=t?[0,0,0]:[0,0];let s=0,n=0,c=0,o=0;if(e.nextPoint()){let f=e.x,g=e.y,S=e.z;for(;e.nextPoint();){const I=e.x,A=e.y,O=e.z;i[0]=f,i[1]=g,r[0]=I,r[1]=A,t&&(i[2]=S,r[2]=O);const z=s6(i,r);if(z){s+=z;const V=n6(i,r);n+=z*V[0],c+=z*V[1],t&&V.length>2&&(o+=z*V[2])}f=I,g=A,S=O}}return s>0?t?[n/s,c/s,o/s]:[n/s,c/s]:e.pathSize?(e.seekPathStart(),e.nextPoint(),[e.x,e.y]):null}const QJ=1e-6;function Mge(e){let t=0;for(e.reset();e.nextPath();)t+=e.getCurrentRingArea();if(te[2]&&(e[2]=t[0]),t[1]e[3]&&(e[3]=t[1])}function Cge(e,t,i){if(t!=null)if("length"in t)xE(t)?(i[0]=Math.min(e[0],t[0]),i[1]=Math.min(e[1],t[1]),i[2]=Math.max(e[2],t[2]),i[3]=Math.max(e[3],t[3])):t.length!==2&&t.length!==3||(i[0]=Math.min(e[0],t[0]),i[1]=Math.min(e[1],t[1]),i[2]=Math.max(e[2],t[0]),i[3]=Math.max(e[3],t[1]));else switch(t.type){case"extent":i[0]=Math.min(e[0],t.xmin),i[1]=Math.min(e[1],t.ymin),i[2]=Math.max(e[2],t.xmax),i[3]=Math.max(e[3],t.ymax);break;case"point":i[0]=Math.min(e[0],t.x),i[1]=Math.min(e[1],t.y),i[2]=Math.max(e[2],t.x),i[3]=Math.max(e[3],t.y)}else l6(i,e)}function c6(e){return e==null||e[0]>=e[2]?0:e[2]-e[0]}function u6(e){return e==null||e[1]>=e[3]?0:e[3]-e[1]}function $ge(e){return c6(e)*u6(e)}function kge(e,t,i){return t>=e[0]&&i>=e[1]&&t<=e[2]&&i<=e[3]}function Rge(e,t){return Math.max(t[0],e[0])<=Math.min(t[2],e[2])&&Math.max(t[1],e[1])<=Math.min(t[3],e[3])}function rK(e,t){return t[0]>=e[0]&&t[2]<=e[2]&&t[1]>=e[1]&&t[3]<=e[3]}function Oge(e){return e?l6(e,K$):eo(K$)}function xE(e){return e!=null&&e.length===4}function Lge(e,t){return xE(e)&&xE(t)?e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]:e===t}const K$=[1/0,1/0,-1/0,-1/0],sK=[0,0,0,0];function h6(e){return e.xmin!==void 0&&e.ymin!==void 0&&e.xmax!==void 0&&e.ymax!==void 0}function d6(e){return e.points!==void 0}function p6(e){return e.x!==void 0&&e.y!==void 0}function f6(e){return e.paths!==void 0}function m6(e){return e.rings!==void 0}function y6(e){function t(i,r){return i==null?r:r==null?i:e(i,r)}return t}const oh=y6(Math.min),ah=y6(Math.max);function Dge(e,t){return f6(t)?$m(e,t.paths,!1,!1):m6(t)?$m(e,t.rings,!1,!1):d6(t)?UA(e,t.points,!1,!1,!1,!1):h6(t)?g6(e,t):(p6(t)&&(e[0]=t.x,e[1]=t.y,e[2]=t.x,e[3]=t.y),e)}function Nge(e){let t,i,r,s;for(e.reset(),t=r=1/0,i=s=-1/0;e.nextPath();){const n=nK(e);t=Math.min(n[0],t),r=Math.min(n[1],r),i=Math.max(n[2],i),s=Math.max(n[3],s)}return eo([t,r,i,s])}function nK(e){let t,i,r,s;for(t=r=1/0,i=s=-1/0;e.nextPoint();)t=Math.min(e.x,t),r=Math.min(e.y,r),i=Math.max(e.x,i),s=Math.max(e.y,s);return eo([t,r,i,s])}function zge(e,t){return f6(t)?$m(e,t.paths,!0,!1):m6(t)?$m(e,t.rings,!0,!1):d6(t)?UA(e,t.points,!0,!1,!0,!1):h6(t)?g6(e,t,!0,!1,!0,!1):(p6(t)&&(e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.x,e[4]=t.y,e[5]=t.z),e)}function $m(e,t,i,r){const s=i?3:2;if(!t.length||!t[0].length)return null;let n,c,o,f,[g,S]=t[0][0],[I,A]=t[0][0];for(let O=0;O2){const me=H[2];n=oh(n,me),c=ah(c,me)}if(r&&H.length>s){const me=H[s];o=oh(n,me),f=ah(c,me)}}}return i?r?(e[0]=g,e[1]=S,e[2]=n,e[3]=o,e[4]=I,e[5]=A,e[6]=c,e[7]=f,e.length=8,e):(e[0]=g,e[1]=S,e[2]=n,e[3]=I,e[4]=A,e[5]=c,e.length=6,e):r?(e[0]=g,e[1]=S,e[2]=o,e[3]=I,e[4]=A,e[5]=f,e.length=6,e):(e[0]=g,e[1]=S,e[2]=I,e[3]=A,e.length=4,e)}function g6(e,t,i,r,s,n){const c=t.xmin,o=t.xmax,f=t.ymin,g=t.ymax;let S=t.zmin,I=t.zmax,A=t.mmin,O=t.mmax;return s?(S=S||0,I=I||0,n?(A=A||0,O=O||0,e[0]=c,e[1]=f,e[2]=S,e[3]=A,e[4]=o,e[5]=g,e[6]=I,e[7]=O,e):(e[0]=c,e[1]=f,e[2]=S,e[3]=o,e[4]=g,e[5]=I,e)):n?(A=A||0,O=O||0,e[0]=c,e[1]=f,e[2]=A,e[3]=o,e[4]=g,e[5]=O,e):(e[0]=c,e[1]=f,e[2]=o,e[3]=g,e)}function UA(e,t,i,r,s,n){const c=i?3:2,o=r&&n,f=i&&s;if(!t.length||!t[0].length)return null;let g,S,I,A,[O,z]=t[0],[V,H]=t[0];for(let Q=0;Q2){const Ie=ve[2];g=oh(g,Ie),S=ah(S,Ie)}if(o&&ve.length>c){const Ie=ve[c];I=oh(g,Ie),A=ah(S,Ie)}}return s?(g=g||0,S=S||0,n?(I=I||0,A=A||0,e[0]=O,e[1]=z,e[2]=g,e[3]=I,e[4]=V,e[5]=H,e[6]=S,e[7]=A,e):(e[0]=O,e[1]=z,e[2]=g,e[3]=V,e[4]=H,e[5]=S,e)):n?(I=I||0,A=A||0,e[0]=O,e[1]=z,e[2]=I,e[3]=V,e[4]=H,e[5]=A,e):(e[0]=O,e[1]=z,e[2]=V,e[3]=H,e)}function oK(e){return e.xmin!==void 0&&e.ymin!==void 0&&e.xmax!==void 0&&e.ymax!==void 0}function aK(e){return e.points!==void 0}function lK(e){return e.x!==void 0&&e.y!==void 0}function cK(e){return e.paths!==void 0}function uK(e){return e.rings!==void 0}const jA=[];function _6(e,t,i,r){return{xmin:e,ymin:t,xmax:i,ymax:r}}function v6(e,t,i,r,s,n){return{xmin:e,ymin:t,zmin:i,xmax:r,ymax:s,zmax:n}}function b6(e,t,i,r,s,n){return{xmin:e,ymin:t,mmin:i,xmax:r,ymax:s,mmax:n}}function w6(e,t,i,r,s,n,c,o){return{xmin:e,ymin:t,zmin:i,mmin:r,xmax:s,ymax:n,zmax:c,mmax:o}}function VA(e,t=!1,i=!1){return t?i?w6(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]):v6(e[0],e[1],e[2],e[3],e[4],e[5]):i?b6(e[0],e[1],e[2],e[3],e[4],e[5]):_6(e[0],e[1],e[2],e[3])}function Fge(e){return e?oK(e)?e:lK(e)?dK(e):uK(e)?x6(e):cK(e)?S6(e):aK(e)?hK(e):null:null}function hK(e){const{hasZ:t,hasM:i,points:r}=e;return VA(UA(jA,r,t??!1,i??!1),t,i)}function dK(e){const{x:t,y:i,z:r,m:s}=e,n=s!=null;return r!=null?n?w6(t,i,r,s,t,i,r,s):v6(t,i,r,t,i,r):n?b6(t,i,s,t,i,s):_6(t,i,t,i)}function x6(e){const{hasZ:t,hasM:i,rings:r}=e,s=$m(jA,r,t??!1,i??!1);return s?VA(s,t,i):null}function S6(e){const{hasZ:t,hasM:i,paths:r}=e,s=$m(jA,r,t??!1,i??!1);return s?VA(s,t,i):null}var Jv;function X$(e){return!Array.isArray(e[0])}let pl=Jv=class extends Th{static fromExtent(e){const t=e.clone().normalize(),i=e.spatialReference;let r=!1,s=!1;for(const c of t)c.hasZ&&(r=!0),c.hasM&&(s=!0);const n={rings:t.map(c=>{const o=[[c.xmin,c.ymin],[c.xmin,c.ymax],[c.xmax,c.ymax],[c.xmax,c.ymin],[c.xmin,c.ymin]];if(r&&c.hasZ){const f=c.zmin+.5*(c.zmax-c.zmin);for(let g=0;g2,r=n.length>3):i===void 0?i=r?n.length>3:n.length>2:r===void 0&&(r=i?n.length>3:n.length>2)),{rings:s,spatialReference:t,hasZ:i,hasM:r}}get cache(){return this.commitProperty("rings"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get centroid(){const e=ZJ(this);if(!e||isNaN(e[0])||isNaN(e[1])||this.hasZ&&isNaN(e[2]))return null;const t=new ri;return t.x=e[0],t.y=e[1],t.spatialReference=this.spatialReference,this.hasZ&&(t.z=e[2]),t}get extent(){const{spatialReference:e}=this,t=x6(this);if(!t)return null;const i=new Ui(t);return i.spatialReference=e,i}get isSelfIntersecting(){return BW(this.rings)}writeRings(e,t){t.rings=He(this.rings)}addRing(e){if(!e)return;const t=this.rings,i=t.length;if(X$(e)){const r=[];for(let s=0,n=e.length;ss===f&&n===g&&(c==null&&S==null||c===S)&&(o==null&&I==null||o===I);for(let s=0;sthis.hasZ?this.hasM?[i.x,i.y,i.z,i.m]:[i.x,i.y,i.z]:[i.x,i.y]):e,o6(t)}getPoint(e,t){if(!this._validateInputs(e,t))return null;const i=this.rings[e][t],r=this.hasZ,s=this.hasM;return r&&!s?new ri(i[0],i[1],i[2],void 0,this.spatialReference):s&&!r?new ri(i[0],i[1],void 0,i[2],this.spatialReference):r&&s?new ri(i[0],i[1],i[2],i[3],this.spatialReference):new ri(i[0],i[1],this.spatialReference)}insertPoint(e,t,i){return this._validateInputs(e,t,!0)?(Cm(this,i),Array.isArray(i)||(i=i.toArray()),this.rings[e].splice(t,0,i),this.notifyChange("rings"),this):this}removePoint(e,t){if(!this._validateInputs(e,t))return null;const i=new ri(this.rings[e].splice(t,1)[0],this.spatialReference);return this.notifyChange("rings"),i}removeRing(e){if(!this._validateInputs(e,null))return null;const t=this.rings.splice(e,1)[0],i=this.spatialReference,r=t.map(s=>new ri(s,i));return this.notifyChange("rings"),r}setPoint(e,t,i){return this._validateInputs(e,t)?(Cm(this,i),Array.isArray(i)||(i=i.toArray()),this.rings[e][t]=i,this.notifyChange("rings"),this):this}_validateInputs(e,t,i=!1){if(e==null||e<0||e>=this.rings.length)return!1;if(t!=null){const r=this.rings[e];if(i&&(t<0||t>r.length)||!i&&(t<0||t>=r.length))return!1}return!0}toJSON(e){return this.write({},e)}};v([M({readOnly:!0})],pl.prototype,"cache",null),v([M({readOnly:!0})],pl.prototype,"centroid",null),v([M({readOnly:!0})],pl.prototype,"extent",null),v([M({readOnly:!0})],pl.prototype,"isSelfIntersecting",null),v([M({type:[[[Number]]],json:{write:{isRequired:!0}}})],pl.prototype,"rings",void 0),v([ui("rings")],pl.prototype,"writeRings",null),pl=Jv=v([fe("esri.geometry.Polygon")],pl),pl.prototype.toJSON.isDefaultToJSON=!0;const yh=pl;var SE;function pK(e){return!Array.isArray(e[0])}let Pu=SE=class extends Th{constructor(...e){super(...e),this.paths=[],this.type="polyline"}normalizeCtorArgs(e,t){var c,o;let i,r,s=null,n=null;return e&&!Array.isArray(e)?(s=e.paths??null,t||(e.spatialReference?t=e.spatialReference:e.paths||(t=e)),i=e.hasZ,r=e.hasM):s=e,s=s||[],t=t||yi.WGS84,s.length&&((c=s[0])==null?void 0:c[0])!=null&&typeof s[0][0]=="number"&&(s=[s]),n=(o=s[0])==null?void 0:o[0],n&&(i===void 0&&r===void 0?(i=n.length>2,r=!1):i===void 0?i=!r&&n.length>3:r===void 0&&(r=!i&&n.length>3)),{paths:s,spatialReference:t,hasZ:i,hasM:r}}get cache(){return this.commitProperty("paths"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get extent(){const{spatialReference:e}=this,t=S6(this);if(!t)return null;const i=new Ui(t);return i.spatialReference=e,i}writePaths(e,t){t.paths=He(this.paths)}addPath(e){if(!e)return;const t=this.paths,i=t.length;if(pK(e)){const r=[];for(let s=0,n=e.length;snew ri(s,i));return this.notifyChange("paths"),r}removePoint(e,t){if(!this._validateInputs(e,t))return null;const i=new ri(this.paths[e].splice(t,1)[0],this.spatialReference);return this.notifyChange("paths"),i}setPoint(e,t,i){return this._validateInputs(e,t)?(Cm(this,i),Array.isArray(i)||(i=i.toArray()),this.paths[e][t]=i,this.notifyChange("paths"),this):this}_validateInputs(e,t,i=!1){if(e==null||e<0||e>=this.paths.length)return!1;if(t!=null){const r=this.paths[e];if(i&&(t<0||t>r.length)||!i&&(t<0||t>=r.length))return!1}return!0}toJSON(e){return this.write({},e)}};v([M({readOnly:!0})],Pu.prototype,"cache",null),v([M({readOnly:!0})],Pu.prototype,"extent",null),v([M({type:[[[Number]]],json:{write:{isRequired:!0}}})],Pu.prototype,"paths",void 0),v([ui("paths")],Pu.prototype,"writePaths",null),Pu=SE=v([fe("esri.geometry.Polyline")],Pu),Pu.prototype.toJSON.isDefaultToJSON=!0;const Ua=Pu,fK=Bn()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),Bge=Bn()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"});function T6(e){return e.xmin!==void 0&&e.ymin!==void 0&&e.xmax!==void 0&&e.ymax!==void 0}function E6(e){return e.points!==void 0}function M6(e){return e.x!==void 0&&e.y!==void 0}function I6(e){return e.paths!==void 0}function GA(e){return e.rings!==void 0}function km(e){return e==null?null:e instanceof Th?e:M6(e)?ri.fromJSON(e):I6(e)?Ua.fromJSON(e):GA(e)?yh.fromJSON(e):E6(e)?Px.fromJSON(e):T6(e)?Ui.fromJSON(e):null}function qA(e){return e?M6(e)?"esriGeometryPoint":I6(e)?"esriGeometryPolyline":GA(e)?"esriGeometryPolygon":T6(e)?"esriGeometryEnvelope":E6(e)?"esriGeometryMultipoint":null:null}const mK={esriGeometryPoint:ri,esriGeometryPolyline:Ua,esriGeometryPolygon:yh,esriGeometryEnvelope:Ui,esriGeometryMultipoint:Px};function yK(e){return e&&mK[e]||null}const Cx={base:Th,key:"type",typeMap:{extent:Ui,multipoint:Px,point:ri,polyline:Ua,polygon:yh}};Uc(Cx);let A6=0;const HA=e=>{let t=class extends e{constructor(...i){super(...i),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+A6++})}};return t=v([fe("esri.core.Identifiable")],t),t},WA=e=>{let t=class extends e{constructor(...i){super(...i),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:A6++})}};return t=v([fe("esri.core.NumericIdentifiable")],t),t};let Q$=class extends HA(class{}){};Q$=v([fe("esri.core.Identifiable")],Q$);async function gK(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:i}=await ht(()=>import("./portalLayers-B6YNSnGP.js").then(r=>r.p),__vite__mapDeps([3,4,5]));try{return await i(t)}catch(r){const s=t&&t.portalItem,n=(s==null?void 0:s.id)||"unset",c=s&&s.portal&&s.portal.url||Ci.portalUrl;throw _t.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+c+"', id: '"+n+"')",r),r}}let _K=0,us=class extends Sh.EventedMixin(HA(dh)){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new Ui(-180,-90,180,90,yi.WGS84),this.id=Date.now().toString(16)+"-layer-"+_K++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=yi.WGS84,this.title=null,this.type=null,this.url=null,this.visible=!0}static async fromArcGISServerUrl(t){const i=typeof t=="string"?{url:t}:t;return(await ht(()=>import("./arcgisLayers-DI7gu0Vy.js"),__vite__mapDeps([7,4,8,5]))).fromUrl(i)}static fromPortalItem(t){return gK(t)}initialize(){this.when().catch(t=>{Ys(t)||_t.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:t})})}destroy(){const t=this.parent;if(t){const i=this;"layers"in t&&t.layers.includes(i)?t.layers.remove(i):"tables"in t&&t.tables.includes(i)?t.tables.remove(i):"baseLayers"in t&&t.baseLayers.includes(i)?t.baseLayers.remove(i):"referenceLayers"in t&&t.referenceLayers.includes(i)&&t.referenceLayers.remove(i),this._set("parent",null)}}get hasAttributionData(){return this.attributionDataUrl!=null}get parsedUrl(){return Rr(this.url)}async fetchAttributionData(){const t=this.attributionDataUrl;if(this.hasAttributionData&&t)return(await Qi(t,{query:{f:"json"},responseType:"json"})).data;throw new Je("layer:no-attribution-data","Layer does not have attribution data")}};v([M({type:String})],us.prototype,"attributionDataUrl",void 0),v([M({type:Ui})],us.prototype,"fullExtent",void 0),v([M({readOnly:!0})],us.prototype,"hasAttributionData",null),v([M({type:String,clonable:!1})],us.prototype,"id",void 0),v([M({type:Boolean,nonNullable:!0})],us.prototype,"legendEnabled",void 0),v([M({type:["show","hide","hide-children"]})],us.prototype,"listMode",void 0),v([M({type:Number,range:{min:0,max:1},nonNullable:!0})],us.prototype,"opacity",void 0),v([M({clonable:!1})],us.prototype,"parent",void 0),v([M({readOnly:!0})],us.prototype,"parsedUrl",null),v([M({type:Boolean,readOnly:!0})],us.prototype,"persistenceEnabled",void 0),v([M({type:Boolean})],us.prototype,"popupEnabled",void 0),v([M({type:Boolean})],us.prototype,"attributionVisible",void 0),v([M({type:yi})],us.prototype,"spatialReference",void 0),v([M({type:String})],us.prototype,"title",void 0),v([M({readOnly:!0,json:{read:!1}})],us.prototype,"type",void 0),v([M()],us.prototype,"url",void 0),v([M({type:Boolean,nonNullable:!0})],us.prototype,"visible",void 0),us=v([fe("esri.layers.Layer")],us);const P6=us;function TE(e,t,i){let r,s;if(e)for(let n=0,c=e.length;n{let t=class extends e{constructor(...i){super(...i),this.layers=new Bt;const r=c=>{c.parent&&"remove"in c.parent&&c.parent.remove(c)},s=c=>{c.parent=this,this.layerAdded(c),c.type!=="elevation"&&c.type!=="base-elevation"||_t.getLogger(this).error(`Layer 'title:${c.title}, id:${c.id}' of type '${c.type}' is not supported as an operational layer and will therefore be ignored.`)},n=c=>{c.parent=null,this.layerRemoved(c)};this.addHandles([this.layers.on("before-add",c=>r(c.item)),this.layers.on("after-add",c=>s(c.item)),this.layers.on("after-remove",c=>n(c.item))])}destroy(){const i=this.layers.toArray();for(const r of i)r.destroy();this.layers.destroy()}set layers(i){this._set("layers",mp(i,this._get("layers")))}add(i,r){const s=this.layers;if(r=s.getNextIndex(r),i instanceof P6){const n=i;n.parent===this?this.reorder(n,r):s.add(n,r)}else xh(i)?i.then(n=>{this.destroyed||this.add(n,r)}):_t.getLogger(this).error("#add()","The item being added is not a Layer or a Promise that resolves to a Layer.")}addMany(i,r){const s=this.layers;let n=s.getNextIndex(r);i.slice().forEach(c=>{c.parent!==this?(s.add(c,n),n+=1):this.reorder(c,n)})}findLayerById(i){return TE(this.layers,"id",i)}findLayerByUid(i){return TE(this.layers,"uid",i)}remove(i){return this.layers.remove(i)}removeMany(i){return this.layers.removeMany(i)}removeAll(){return this.layers.removeAll()}reorder(i,r){return this.layers.reorder(i,r)}layerAdded(i){}layerRemoved(i){}};return v([M()],t.prototype,"layers",null),t=v([fe("esri.support.LayersMixin")],t),t};function EE(e,t,i){if(e)for(let r=0,s=e.length;r{let t=class extends e{constructor(...i){super(...i),this.tables=new Bt,this.addHandles([this.tables.on("after-add",r=>{const s=r.item;s.parent&&s.parent!==this&&"tables"in s.parent&&s.parent.tables.remove(s),s.parent=this,s.type!=="feature"&&_t.getLogger(this).error(`Layer 'title:${s.title}, id:${s.id}' of type '${s.type}' is not supported as a table and will therefore be ignored.`)}),this.tables.on("after-remove",r=>{r.item.parent=null})])}destroy(){const i=this.tables.toArray();for(const r of i)r.destroy();this.tables.destroy()}set tables(i){this._set("tables",mp(i,this._get("tables")))}findTableById(i){return EE(this.tables,"id",i)}findTableByUid(i){return EE(this.tables,"uid",i)}};return v([M()],t.prototype,"tables",null),t=v([fe("esri.support.TablesMixin")],t),t};let Ea=class extends bK(vK(Sh.EventedMixin(Nt))){constructor(t){super(t),this.allLayers=new W0({getCollections:()=>{var i,r,s;return[(i=this.basemap)==null?void 0:i.baseLayers,(r=this.ground)==null?void 0:r.layers,this.layers,(s=this.basemap)==null?void 0:s.referenceLayers]},getChildrenFunction:i=>"layers"in i?i.layers:null}),this.allTables=zJ(this),this.basemap=null,this.editableLayers=new W0({getCollections:()=>[this.allLayers],itemFilterFunction:CY}),this.ground=new ww,this._basemapCache=LJ()}destroy(){DJ(this._basemapCache),this._basemapCache=null,this.allLayers.destroy(),this.allTables.destroy(),this.editableLayers.destroy(),this.basemap=lr(this.basemap),lr(this.ground),this._set("ground",null)}castBasemap(t){return NJ(t,this._basemapCache)}castGround(t){return FJ(t)??this._get("ground")}findLayerById(t){return this.allLayers.find(i=>i.id===t)}findTableById(t){return this.allTables.find(i=>i.id===t)}};v([M({readOnly:!0,dependsOn:[]})],Ea.prototype,"allLayers",void 0),v([M({readOnly:!0})],Ea.prototype,"allTables",void 0),v([M({type:v0,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],Ea.prototype,"basemap",void 0),v([Rs("basemap")],Ea.prototype,"castBasemap",null),v([M({readOnly:!0})],Ea.prototype,"editableLayers",void 0),v([M({type:ww,nonNullable:!0})],Ea.prototype,"ground",void 0),v([Rs("ground")],Ea.prototype,"castGround",null),v([M()],Ea.prototype,"undoRedo",void 0),Ea=v([fe("esri.Map")],Ea);const C6=Ea,jl=e=>{let t=class extends e{clone(){var f;const i=To(this);F5(i,"unable to clone instance of non-accessor class");const r=i.metadata,s=i.store,n={},c=new Map;for(const g in r){const S=r[g],I=s==null?void 0:s.originOf(g),A=S.clonable;if(S.readOnly||A===!1||I!==fi.USER&&I!==fi.DEFAULTS&&I!==fi.WEB_MAP&&I!==fi.WEB_SCENE)continue;const O=this[g];let z=null;z=typeof A=="function"?A(O):A==="reference"?O:$T(O),O!=null&&z==null||(I===fi.DEFAULTS?c.set(g,z):n[g]=z)}const o=new(Object.getPrototypeOf(this)).constructor(n);if(c.size){const g=(f=To(o))==null?void 0:f.store;if(g)for(const[S,I]of c)g.set(S,I,fi.DEFAULTS)}return o}};return t=v([fe("esri.core.Clonable")],t),t};let ME=class extends jl(Nt){};ME=v([fe("esri.core.Clonable")],ME);let pd=class extends ME{constructor(t){super(t),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(t){return t!=null&&this.row===t.row&&this.rows===t.rows&&this.column===t.column&&this.columns===t.columns}};v([M({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],pd.prototype,"row",void 0),v([M({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],pd.prototype,"column",void 0),v([M({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],pd.prototype,"rows",void 0),v([M({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],pd.prototype,"columns",void 0),pd=v([fe("esri.CameraLayout")],pd);const $6=pd;let ZA=class{constructor(t,i){this.min=t,this.max=i,this.range=i-t}ndiff(t,i=0){return Math.ceil((t-i)/this.range)*this.range+i}_normalize(t,i,r,s=0,n=!1){return(r-=s)i&&(r-=this.ndiff(r-i)),n&&r===i&&(r=t),r+s}normalize(t,i=0,r=!1){return this._normalize(this.min,this.max,t,i,r)}clamp(t,i=0){return Ll(t-i,this.min,this.max)+i}monotonic(t,i,r){return tt&&rwK.normalize(za(e)))],fl.prototype,"heading",void 0),v([M({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),Rs(e=>Ll(za(e),-180,180))],fl.prototype,"tilt",void 0),v([M({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],fl.prototype,"fov",void 0),v([M({type:$6,nonNullable:!0,json:{read:!1,write:!1}})],fl.prototype,"layout",void 0),fl=v([fe("esri.Camera")],fl);const xK=fl;var IE;let Cu=IE=class extends At{constructor(e){super(e),this.rotation=0,this.scale=0,this.targetGeometry=null,this.camera=null}castRotation(e){return(e%=360)<0&&(e+=360),e}clone(){return new IE({rotation:this.rotation,scale:this.scale,targetGeometry:this.targetGeometry!=null?this.targetGeometry.clone():null,camera:this.camera!=null?this.camera.clone():null})}};function kS(){return{enabled:!this.camera}}v([M({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:kS}}}}})],Cu.prototype,"rotation",void 0),v([Rs("rotation")],Cu.prototype,"castRotation",null),v([M({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:kS}}}}})],Cu.prototype,"scale",void 0),v([M({types:Cx,json:{read:km,write:!0,origins:{"web-scene":{read:km,write:{overridePolicy:kS}}}}})],Cu.prototype,"targetGeometry",void 0),v([M({type:xK,json:{write:!0}})],Cu.prototype,"camera",void 0),Cu=IE=v([fe("esri.Viewpoint")],Cu);const kl=Cu;function ti(e,t,i={}){return JA(e,t,i,k6)}function gh(e,t,i={}){return JA(e,t,i,R6)}function JA(e,t,i={},r){let s=null;const n=i.once?(c,o)=>{r(c)&&(Sr(s),t(c,o))}:(c,o)=>{r(c)&&t(c,o)};if(s=WG(e,n,i.sync,i.equals),i.initial){const c=e();n(c,c)}return s}function Sp(e,t,i,r={}){let s=null,n=null,c=null;function o(){var S;s&&n&&(n.remove(),(S=r.onListenerRemove)==null||S.call(r,s),s=null,n=null)}function f(S){r.once&&r.once&&Sr(c),i(S)}const g=ti(e,(S,I)=>{var A;o(),cx(S)&&(s=S,n=f_(S,t,f),(A=r.onListenerAdd)==null||A.call(r,S))},{sync:r.sync,initial:!0});return c=er(()=>{g.remove(),o()}),c}function $x(e,t){return SK(e,R6,t)}function SK(e,t,i){if(ra(i))return Promise.reject(jr());const r=e();if(t!=null&&t(r))return Promise.resolve(r);let s=null;function n(){s=Sr(s)}return new Promise((c,o)=>{s=h_([io(i,()=>{n(),o(jr())}),JA(e,f=>{n(),c(f)},{sync:!1,once:!0},t??k6)])})}function k6(e){return!0}function R6(e){return!!e}const Tp={sync:!0},_n={initial:!0},Fa={sync:!0,initial:!0};let Sw=class{constructor(t=i=>i.values().next().value){this._peeker=t,this._observable=new g_,this._items=new Set}get length(){return Rt(this._observable),this._items.size}clear(){this.length!==0&&(this._items.clear(),this._observable.notify())}last(){if(this.length===0)return;let t;for(t of this._items);return t}peek(){if(this.length!==0)return this._peeker(this._items)}push(t){this.contains(t)||(this._items.add(t),this._observable.notify())}contains(t){return Rt(this._observable),this._items.has(t)}pop(){if(this.length===0)return;const t=this.peek();return this._items.delete(t),this._observable.notify(),t}popLast(){if(this.length===0)return;const t=this.last();return this._items.delete(t),this._observable.notify(),t}remove(t){this.contains(t)&&(this._items.delete(t),this._observable.notify())}filter(t){const i=this.length;return this._items.forEach(r=>{t(r)||this._items.delete(r)}),i!==this._items.size&&this._observable.notify(),this}*[Symbol.iterator](){Rt(this._observable),yield*this._items}};const O6=new FinalizationRegistry(e=>{e.close()});function TK(e,t){O6.register(e,t,t)}function EK(e){O6.unregister(e)}const L6="worker:port-closed";var $s;(function(e){e[e.HANDSHAKE=0]="HANDSHAKE",e[e.OPEN=1]="OPEN",e[e.OPENED=2]="OPENED",e[e.RESPONSE=3]="RESPONSE",e[e.INVOKE=4]="INVOKE",e[e.ABORT=5]="ABORT",e[e.CLOSE=6]="CLOSE",e[e.OPEN_PORT=7]="OPEN_PORT",e[e.ON=8]="ON"})($s||($s={}));let MK=0;function D6(){return MK++}function IK(e){return e&&typeof e=="object"&&("result"in e||"transferList"in e)}function Z0(e){return e?typeof e=="string"?JSON.stringify({name:"message",message:e}):e.toJSON?JSON.stringify(e):JSON.stringify({name:e.name,message:e.message,details:e.details||{stack:e.stack}}):null}function KA(e,t,i,r){if(t.type===$s.OPEN_PORT)return void e.postMessage(t,[t.port]);if(t.type!==$s.INVOKE&&t.type!==$s.RESPONSE)return void e.postMessage(t);let s;if(IK(i)?(s=ek(i.transferList),t.data=i.result):(s=ek(r),t.data=i),s){if(Le("ff")){for(const n of s)if("byteLength"in n&&n.byteLength>267386880){const c="Worker call with large ArrayBuffer would crash Firefox";switch(t.type){case $s.INVOKE:throw c;case $s.RESPONSE:return void KA(e,{type:$s.RESPONSE,jobId:t.jobId,error:Z0(c)})}}}e.postMessage(t,s)}else e.postMessage(t)}function Y0(e){if(!e)return null;const t=e.data;return t?typeof t=="string"?JSON.parse(t):t:null}function ek(e){if(!(e!=null&&e.length))return null;if(Le("esri-workers-arraybuffer-transfer"))return e;const t=e.filter(i=>!AK(i));return t.length?t:null}function AK(e){var t;return e instanceof ArrayBuffer||((t=e==null?void 0:e.constructor)==null?void 0:t.name)==="ArrayBuffer"}async function PK(e){try{return await e}catch(t){const i=(t==null?void 0:t.name)===L6;if(!(Ys(t)||i))throw t;return}}function N6(e,t,i){return new Proxy({},{get:(r,s,n)=>(...c)=>{let o,f;const g=c[c.length-1];CK(g)&&(o=g.signal,f=g.transferList,c.pop());const S=e.apply(t?`${t}.${s.toString()}`:s.toString(),c,{transferList:f,signal:o});return i!=null&&i.ignoreConnectionErrors?PK(S):S}})}function CK(e){return typeof e=="object"&&!Array.isArray(e)&&e!=null&&("signal"in e||"transferList"in e||Object.keys(e).length===0)}const $K={statsWorker:()=>ht(()=>import("./statsWorker-CD2pE8ny.js"),__vite__mapDeps([9,10,11,12,13,14,15])),geometryEngineWorker:()=>ht(()=>import("./geometryEngineWorker-iTtx-A2l.js"),__vite__mapDeps([16,17,18,19])),CSVSourceWorker:()=>ht(()=>import("./CSVSourceWorker-CrU3052N.js"),__vite__mapDeps([20,21,19,22,23,24,25,26,27,28,29,30,31,32,33,11,10,12,13,14,15,34,35,36,37,38])),EdgeProcessingWorker:()=>ht(()=>import("./EdgeProcessingWorker-C-Yxye3Z.js"),__vite__mapDeps([39,40,41,42,43,44,45,46,47])),ElevationSamplerWorker:()=>ht(()=>import("./ElevationSamplerWorker-DNbNk0sW.js"),__vite__mapDeps([48,27,49,50,51,52,53,54,55,56,57,58,41])),FeatureServiceSnappingSourceWorker:()=>ht(()=>import("./FeatureServiceSnappingSourceWorker-BZ3sJkXx.js"),__vite__mapDeps([59,23,24,22,25,26,27,28,19,29,30,31,32,33,11,10,12,13,14,15,34,35,60,61,62,63])),GeoJSONSourceWorker:()=>ht(()=>import("./GeoJSONSourceWorker-CUwhItjB.js"),__vite__mapDeps([64,24,22,25,23,26,27,28,19,29,30,31,32,33,11,10,12,13,14,15,34,35,65,21,37,38,66])),LercWorker:()=>ht(()=>import("./LercWorker-BiydENSI.js"),[]),MemorySourceWorker:()=>ht(()=>import("./MemorySourceWorker-CaK7s0IK.js"),__vite__mapDeps([67,24,22,25,68,23,26,27,28,19,29,30,31,32,33,11,10,12,13,14,15,34,35,37,38,66,21])),PBFDecoderWorker:()=>ht(()=>import("./PBFDecoderWorker-C5tQTeCI.js"),__vite__mapDeps([69,24,22,25,60,61])),FeaturePipelineWorker:()=>ht(()=>import("./FeaturePipelineWorker-6OTTsaNH.js"),__vite__mapDeps([70,71,72,73,74,75,76,77,78,22,79,80,81,38,82,43,83,84,34,32,31,28,24,25,19,85,86,29,30,33,11,10,12,13,14,15,35,62,60,61,63,87,65,21,37,66,88,89])),PointCloudWorker:()=>ht(()=>import("./PointCloudWorker-BVcb1Zzd.js"),__vite__mapDeps([90,57,53,58,91,92,93,94,47,95,54,55,96])),RasterWorker:()=>ht(()=>import("./RasterWorker-DIZgcx97.js"),__vite__mapDeps([97,98,99,100,101,102])),SceneLayerSnappingSourceWorker:()=>ht(()=>import("./SceneLayerSnappingSourceWorker-BIrjnrGh.js"),__vite__mapDeps([103,104,105,96,53,54,58,106,43,44,45,46,40,41,42,47])),SceneLayerWorker:()=>ht(()=>import("./SceneLayerWorker-fYw2Py8t.js"),__vite__mapDeps([107,56,50,51,106,105,96,53,54,58,108,55,94,47,109,95,57])),WFSSourceWorker:()=>ht(()=>import("./WFSSourceWorker-BX8deXfR.js"),__vite__mapDeps([110,24,22,25,23,26,27,28,19,29,30,31,32,33,11,10,12,13,14,15,34,35,65,21,66,111,112])),WorkerTileHandler:()=>ht(()=>import("./WorkerTileHandler-DlTCcd69.js"),__vite__mapDeps([113,80,114,61,77,115,78])),Lyr3DWorker:()=>ht(()=>import("./Lyr3DWorker-pyatxP09.js"),[])},{CLOSE:tk,ABORT:ik,INVOKE:rk,RESPONSE:ug,OPEN_PORT:sk,ON:kK}=$s,RK=2;let OK=class{constructor(t){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=t,this._timer=null,this._process=this._process.bind(this)}push(t){t.type===$s.ABORT?this._cancelledJobIds.add(t.jobId):(this._invokeMessages.push(t),this._timer===null&&(this._timer=setTimeout(this._process,0)))}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null}_process(){this._timer=null;for(const t of this._invokeMessages)this._cancelledJobIds.has(t.jobId)||this._invoke(t);this._cancelledJobIds.clear(),this._invokeMessages.length=0}},_h=class Of{static connect(t){const i=new MessageChannel;let r;r=typeof t=="function"?new t:"default"in t&&typeof t.default=="function"?new t.default:t;const s=new Of(i.port1,{channel:i,client:r});return typeof r=="object"&&"remoteClient"in r&&(r.remoteClient=s),Of.clients.set(s,r),i.port2}static loadWorker(t){const i=$K[t];return i?i():Promise.resolve(null)}constructor(t,i,r){this._port=t,this._jobQueue=r,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new OK(s=>this._onInvokeMessage(s)),this._client=i.client,this._onMessage=this._onMessage.bind(this),this._channel=i.channel,this._schedule=i.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}close(){this._post({type:tk}),this._close()}isBusy(){return this._outJobs.size>0}invoke(t,i,r){return this.apply(t,[i],r)}apply(t,i,r){const s=r==null?void 0:r.signal,n=r==null?void 0:r.transferList;if(!this._port)return Promise.reject(new Je(L6,`Cannot call invoke('${t}'), port is closed`,{methodName:t,data:i}));const c=D6();return new Promise((o,f)=>{if(ra(s))return this._processWork(),void f(jr());const g=io(s,()=>{const I=this._outJobs.get(c);I&&(this._outJobs.delete(c),this._processWork(),Sr(I.abortHandle),this._post({type:ik,jobId:c}),f(jr()))}),S={resolve:o,reject:f,abortHandle:g,debugInfo:t};this._outJobs.set(c,S),this._post({type:rk,jobId:c,methodName:t,abortable:s!=null},i,n)})}createInvokeProxy(t,i){return N6(this,t,i)}on(t,i){const r=new MessageChannel;function s(n){i(n.data)}return this._port.postMessage({type:$s.ON,eventType:t,port:r.port2},[r.port2]),r.port1.addEventListener("message",s),r.port1.start(),er(()=>{r.port1.postMessage({type:$s.CLOSE}),r.port1.close(),r.port1.removeEventListener("message",s)})}jobAdded(){this._processWork()}openPort(){const t=new MessageChannel;return this._post({type:sk,port:t.port2}),t.port1}_processWork(){var c;if(this._outJobs.size>=RK)return;const t=(c=this._jobQueue)==null?void 0:c.pop();if(!t)return;const{methodName:i,data:r,invokeOptions:s,resolver:n}=t;this.apply(i,r,s).then(o=>n.resolve(o)).catch(o=>n.reject(o))}_close(){this._channel&&(this._channel=void 0),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach(t=>{Sr(t.abortHandle),t.reject(jr(`Worker closing, aborting job calling '${t.debugInfo}'`))}),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=null,this._client=null,this._schedule=null}_onMessage(t){this._schedule!=null?this._schedule(()=>this._processMessage(t)):this._processMessage(t)}_processMessage(t){const i=Y0(t);if(i)switch(i.type){case ug:this._onResponseMessage(i);break;case rk:this._invokeQueue.push(i);break;case ik:this._onAbortMessage(i);break;case tk:this._onCloseMessage();break;case sk:this._onOpenPortMessage(i);break;case kK:this._onOnMessage(i)}}_onAbortMessage(t){const i=this._inJobs,r=t.jobId,s=i.get(r);this._invokeQueue.push(t),s&&(s.controller&&s.controller.abort(),i.delete(r))}_onCloseMessage(){const t=this._client;this._close(),t&&"destroy"in t&&Of.clients.get(this)===t&&t.destroy(),Of.clients.delete(this),t!=null&&t.remoteClient&&(t.remoteClient=null)}_onInvokeMessage(t){const{methodName:i,jobId:r,data:s=[],abortable:n}=t,c=n?new AbortController:null,o=this._inJobs;let f,g=this._client,S=g[i];try{if(!S&&i&&i.includes(".")){const I=i.split(".");for(let A=0;A{o.has(r)&&(o.delete(r),this._post({type:ug,jobId:r},I))},I=>{o.has(r)&&(o.delete(r),Ys(I)||this._post({type:ug,jobId:r,error:Z0(I||{message:`Error encountered at method ${i}`})}))})):this._post({type:ug,jobId:r},f)}_onOpenPortMessage(t){new Of(t.port,{client:this._client})}_onOnMessage(t){const{port:i}=t,r=this._client.on(t.eventType,n=>{i.postMessage(n)}),s=f_(t.port,"message",n=>{const c=Y0(n);(c==null?void 0:c.type)===$s.CLOSE&&(s.remove(),r.remove(),i.close())})}_onResponseMessage(t){const{jobId:i,error:r,data:s}=t,n=this._outJobs;if(!n.has(i))return;const c=n.get(i);n.delete(i),this._processWork(),Sr(c.abortHandle),r?c.reject(Je.fromJSON(JSON.parse(r))):c.resolve(s)}_post(t,i,r){return KA(this._port,t,i,r)}};_h.kernelInfo={buildDate:U4,fullVersion:vA,revision:j4},_h.clients=new Map;let LK=class{constructor(){this._inUseClients=new Array,this._clients=new Array,this._clientPromises=new Array,this._ongoingJobsQueue=new Sw}destroy(){this.close()}get closed(){var t;return!((t=this._clients)!=null&&t.length)}open(t,i){return new Promise((r,s)=>{let n=!0;const c=o=>{mr(i.signal),n&&(n=!1,o())};this._clients.length=t.length,this._clientPromises.length=t.length,this._inUseClients.length=t.length;for(let o=0;o(this._clients[o]=new _h(g,i,this._ongoingJobsQueue),c(r),this._clients[o]),()=>(c(s),null)):(this._clients[o]=new _h(f,i,this._ongoingJobsQueue),this._clientPromises[o]=Promise.resolve(this._clients[o]),c(r))}})}broadcast(t,i,r){const s=new Array(this._clientPromises.length);for(let n=0;no==null?void 0:o.invoke(t,i,r))}return s}close(){let t;for(;t=this._ongoingJobsQueue.pop();)t.resolver.reject(jr(`Worker closing, aborting job calling '${t.methodName}'`));for(const i of this._clientPromises)i.then(r=>r==null?void 0:r.close());this._clients.length=0,this._clientPromises.length=0,this._inUseClients.length=0,EK(this)}invoke(t,i,r){return this.apply(t,[i],r)}apply(t,i,r){const s=sa();this._ongoingJobsQueue.push({methodName:t,data:i,invokeOptions:r,resolver:s});for(let n=0;no==null?void 0:o.jobAdded())}return s.promise}createInvokeProxy(t){return N6(this,t)}on(t,i){return Promise.all(this._clientPromises).then(()=>h_(this._clients.map(r=>r.on(t,i))))}openPorts(){return new Promise(t=>{const i=new Array(this._clientPromises.length);let r=i.length;for(let s=0;s{n&&(i[s]=n.openPort()),--r==0&&t(i)})})}get test(){return{numClients:this._clients.length}}};const DK={async request(e,t){var c,o;const i=e.options,r=i.responseType;i.signal=t==null?void 0:t.signal,i.responseType=r==="native"||r==="native-request-init"?"native-request-init":r&&["blob","json","text"].includes(r)&&((c=N4(e.url))!=null&&c.after)?r:"array-buffer";const s=await Qi(e.url,i),n={data:s.data,httpStatus:s.httpStatus,ssl:s.ssl};switch((o=s.requestOptions)==null?void 0:o.responseType){case"native-request-init":return delete n.data.signal,n;case"blob":n.data=await n.data.arrayBuffer();break;case"json":n.data=new TextEncoder().encode(JSON.stringify(n.data)).buffer;break;case"text":n.data=new TextEncoder().encode(n.data).buffer}return{result:n,transferList:[n.data]}}},nk=new Map([["AUS Central Standard Time","Australia/Darwin"],["AUS Eastern Standard Time","Australia/Sydney"],["Afghanistan Standard Time","Asia/Kabul"],["Alaskan Standard Time","America/Anchorage"],["Aleutian Standard Time","America/Adak"],["Altai Standard Time","Asia/Barnaul"],["Arab Standard Time","Asia/Riyadh"],["Arabian Standard Time","Asia/Dubai"],["Arabic Standard Time","Asia/Baghdad"],["Argentina Standard Time","America/Buenos_Aires"],["Astrakhan Standard Time","Europe/Astrakhan"],["Atlantic Standard Time","America/Halifax"],["Aus Central W. Standard Time","Australia/Eucla"],["Azerbaijan Standard Time","Asia/Baku"],["Azores Standard Time","Atlantic/Azores"],["Bahia Standard Time","America/Bahia"],["Bangladesh Standard Time","Asia/Dhaka"],["Belarus Standard Time","Europe/Minsk"],["Bougainville Standard Time","Pacific/Bougainville"],["Canada Central Standard Time","America/Regina"],["Cape Verde Standard Time","Atlantic/Cape_Verde"],["Caucasus Standard Time","Asia/Yerevan"],["Cen. Australia Standard Time","Australia/Adelaide"],["Central America Standard Time","America/Guatemala"],["Central Asia Standard Time","Asia/Almaty"],["Central Brazilian Standard Time","America/Cuiaba"],["Central Europe Standard Time","Europe/Budapest"],["Central European Standard Time","Europe/Warsaw"],["Central Pacific Standard Time","Pacific/Guadalcanal"],["Central Standard Time","America/Chicago"],["Central Standard Time (Mexico)","America/Mexico_City"],["Chatham Islands Standard Time","Pacific/Chatham"],["China Standard Time","Asia/Shanghai"],["Cuba Standard Time","America/Havana"],["Dateline Standard Time","Etc/GMT+12"],["E. Africa Standard Time","Africa/Nairobi"],["E. Australia Standard Time","Australia/Brisbane"],["E. Europe Standard Time","Europe/Chisinau"],["E. South America Standard Time","America/Sao_Paulo"],["Easter Island Standard Time","Pacific/Easter"],["Eastern Standard Time","America/New_York"],["Eastern Standard Time (Mexico)","America/Cancun"],["Egypt Standard Time","Africa/Cairo"],["Ekaterinburg Standard Time","Asia/Yekaterinburg"],["FLE Standard Time","Europe/Kiev"],["Fiji Standard Time","Pacific/Fiji"],["GMT Standard Time","Europe/London"],["GTB Standard Time","Europe/Bucharest"],["Georgian Standard Time","Asia/Tbilisi"],["Greenland Standard Time","America/Godthab"],["Greenwich Standard Time","Atlantic/Reykjavik"],["Haiti Standard Time","America/Port-au-Prince"],["Hawaiian Standard Time","Pacific/Honolulu"],["India Standard Time","Asia/Calcutta"],["Iran Standard Time","Asia/Tehran"],["Israel Standard Time","Asia/Jerusalem"],["Jordan Standard Time","Asia/Amman"],["Kaliningrad Standard Time","Europe/Kaliningrad"],["Korea Standard Time","Asia/Seoul"],["Libya Standard Time","Africa/Tripoli"],["Line Islands Standard Time","Pacific/Kiritimati"],["Lord Howe Standard Time","Australia/Lord_Howe"],["Magadan Standard Time","Asia/Magadan"],["Magallanes Standard Time","America/Punta_Arenas"],["Marquesas Standard Time","Pacific/Marquesas"],["Mauritius Standard Time","Indian/Mauritius"],["Middle East Standard Time","Asia/Beirut"],["Montevideo Standard Time","America/Montevideo"],["Morocco Standard Time","Africa/Casablanca"],["Mountain Standard Time","America/Denver"],["Mountain Standard Time (Mexico)","America/Mazatlan"],["Myanmar Standard Time","Asia/Rangoon"],["N. Central Asia Standard Time","Asia/Novosibirsk"],["Namibia Standard Time","Africa/Windhoek"],["Nepal Standard Time","Asia/Katmandu"],["New Zealand Standard Time","Pacific/Auckland"],["Newfoundland Standard Time","America/St_Johns"],["Norfolk Standard Time","Pacific/Norfolk"],["North Asia East Standard Time","Asia/Irkutsk"],["North Asia Standard Time","Asia/Krasnoyarsk"],["North Korea Standard Time","Asia/Pyongyang"],["Omsk Standard Time","Asia/Omsk"],["Pacific SA Standard Time","America/Santiago"],["Pacific Standard Time","America/Los_Angeles"],["Pacific Standard Time (Mexico)","America/Tijuana"],["Pakistan Standard Time","Asia/Karachi"],["Paraguay Standard Time","America/Asuncion"],["Qyzylorda Standard Time","Asia/Qyzylorda"],["Romance Standard Time","Europe/Paris"],["Russia Time Zone 10","Asia/Srednekolymsk"],["Russia Time Zone 11","Asia/Kamchatka"],["Russia Time Zone 3","Europe/Samara"],["Russian Standard Time","Europe/Moscow"],["SA Eastern Standard Time","America/Cayenne"],["SA Pacific Standard Time","America/Bogota"],["SA Western Standard Time","America/La_Paz"],["SE Asia Standard Time","Asia/Bangkok"],["Saint Pierre Standard Time","America/Miquelon"],["Sakhalin Standard Time","Asia/Sakhalin"],["Samoa Standard Time","Pacific/Apia"],["Sao Tome Standard Time","Africa/Sao_Tome"],["Saratov Standard Time","Europe/Saratov"],["Singapore Standard Time","Asia/Singapore"],["South Africa Standard Time","Africa/Johannesburg"],["South Sudan Standard Time","Africa/Juba"],["Sri Lanka Standard Time","Asia/Colombo"],["Sudan Standard Time","Africa/Khartoum"],["Syria Standard Time","Asia/Damascus"],["Taipei Standard Time","Asia/Taipei"],["Tasmania Standard Time","Australia/Hobart"],["Tocantins Standard Time","America/Araguaina"],["Tokyo Standard Time","Asia/Tokyo"],["Tomsk Standard Time","Asia/Tomsk"],["Tonga Standard Time","Pacific/Tongatapu"],["Transbaikal Standard Time","Asia/Chita"],["Turkey Standard Time","Europe/Istanbul"],["Turks And Caicos Standard Time","America/Grand_Turk"],["US Eastern Standard Time","America/Indianapolis"],["US Mountain Standard Time","America/Phoenix"],["UTC","Etc/GMT"],["UTC+01","Etc/GMT-1"],["UTC+02","Etc/GMT-2"],["UTC+03","Etc/GMT-3"],["UTC+04","Etc/GMT-4"],["UTC+05","Etc/GMT-5"],["UTC+06","Etc/GMT-6"],["UTC+07","Etc/GMT-7"],["UTC+08","Etc/GMT-8"],["UTC+09","Etc/GMT-9"],["UTC+10","Etc/GMT-10"],["UTC+11","Etc/GMT-11"],["UTC+12","Etc/GMT-12"],["UTC+13","Etc/GMT-13"],["UTC+14","Etc/GMT-14"],["UTC-01","Etc/GMT+1"],["UTC-02","Etc/GMT+2"],["UTC-03","Etc/GMT+3"],["UTC-04","Etc/GMT+4"],["UTC-05","Etc/GMT+5"],["UTC-06","Etc/GMT+6"],["UTC-07","Etc/GMT+7"],["UTC-08","Etc/GMT+8"],["UTC-09","Etc/GMT+9"],["UTC-10","Etc/GMT+10"],["UTC-11","Etc/GMT+11"],["UTC-12","Etc/GMT+12"],["Ulaanbaatar Standard Time","Asia/Ulaanbaatar"],["Venezuela Standard Time","America/Caracas"],["Vladivostok Standard Time","Asia/Vladivostok"],["Volgograd Standard Time","Europe/Volgograd"],["W. Australia Standard Time","Australia/Perth"],["W. Central Africa Standard Time","Africa/Lagos"],["W. Europe Standard Time","Europe/Berlin"],["W. Mongolia Standard Time","Asia/Hovd"],["West Asia Standard Time","Asia/Tashkent"],["West Bank Standard Time","Asia/Hebron"],["West Pacific Standard Time","Pacific/Port_Moresby"],["Yakutsk Standard Time","Asia/Yakutsk"],["Yukon Standard Time","America/Whitehorse"]]);class kp extends Error{}class NK extends kp{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class zK extends kp{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class FK extends kp{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class rm extends kp{}class z6 extends kp{constructor(t){super(`Invalid unit ${t}`)}}class Kn extends kp{}class wu extends kp{constructor(){super("Zone is an abstract class")}}const yt="numeric",Ya="short",xo="long",Tw={year:yt,month:yt,day:yt},F6={year:yt,month:Ya,day:yt},BK={year:yt,month:Ya,day:yt,weekday:Ya},B6={year:yt,month:xo,day:yt},U6={year:yt,month:xo,day:yt,weekday:xo},j6={hour:yt,minute:yt},V6={hour:yt,minute:yt,second:yt},G6={hour:yt,minute:yt,second:yt,timeZoneName:Ya},q6={hour:yt,minute:yt,second:yt,timeZoneName:xo},H6={hour:yt,minute:yt,hourCycle:"h23"},W6={hour:yt,minute:yt,second:yt,hourCycle:"h23"},Z6={hour:yt,minute:yt,second:yt,hourCycle:"h23",timeZoneName:Ya},Y6={hour:yt,minute:yt,second:yt,hourCycle:"h23",timeZoneName:xo},J6={year:yt,month:yt,day:yt,hour:yt,minute:yt},K6={year:yt,month:yt,day:yt,hour:yt,minute:yt,second:yt},X6={year:yt,month:Ya,day:yt,hour:yt,minute:yt},Q6={year:yt,month:Ya,day:yt,hour:yt,minute:yt,second:yt},UK={year:yt,month:Ya,day:yt,weekday:Ya,hour:yt,minute:yt},ez={year:yt,month:xo,day:yt,hour:yt,minute:yt,timeZoneName:Ya},tz={year:yt,month:xo,day:yt,hour:yt,minute:yt,second:yt,timeZoneName:Ya},iz={year:yt,month:xo,day:yt,weekday:xo,hour:yt,minute:yt,timeZoneName:xo},rz={year:yt,month:xo,day:yt,weekday:xo,hour:yt,minute:yt,second:yt,timeZoneName:xo};class b_{get type(){throw new wu}get name(){throw new wu}get ianaName(){return this.name}get isUniversal(){throw new wu}offsetName(t,i){throw new wu}formatOffset(t,i){throw new wu}offset(t){throw new wu}equals(t){throw new wu}get isValid(){throw new wu}}let RS=null;class kx extends b_{static get instance(){return RS===null&&(RS=new kx),RS}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:i,locale:r}){return dz(t,i,r)}formatOffset(t,i){return w0(this.offset(t),i)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let Kv={};function jK(e){return Kv[e]||(Kv[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Kv[e]}const VK={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function GK(e,t){const i=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(i),[,s,n,c,o,f,g,S]=r;return[c,s,n,o,f,g,S]}function qK(e,t){const i=e.formatToParts(t),r=[];for(let s=0;s=0?z:1e3+z,(A-O)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let ok={};function HK(e,t={}){const i=JSON.stringify([e,t]);let r=ok[i];return r||(r=new Intl.ListFormat(e,t),ok[i]=r),r}let AE={};function PE(e,t={}){const i=JSON.stringify([e,t]);let r=AE[i];return r||(r=new Intl.DateTimeFormat(e,t),AE[i]=r),r}let CE={};function WK(e,t={}){const i=JSON.stringify([e,t]);let r=CE[i];return r||(r=new Intl.NumberFormat(e,t),CE[i]=r),r}let $E={};function ZK(e,t={}){const{base:i,...r}=t,s=JSON.stringify([e,r]);let n=$E[s];return n||(n=new Intl.RelativeTimeFormat(e,t),$E[s]=n),n}let Cg=null;function YK(){return Cg||(Cg=new Intl.DateTimeFormat().resolvedOptions().locale,Cg)}let ak={};function JK(e){let t=ak[e];if(!t){const i=new Intl.Locale(e);t="getWeekInfo"in i?i.getWeekInfo():i.weekInfo,ak[e]=t}return t}function KK(e){const t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));const i=e.indexOf("-u-");if(i===-1)return[e];{let r,s;try{r=PE(e).resolvedOptions(),s=e}catch{const f=e.substring(0,i);r=PE(f).resolvedOptions(),s=f}const{numberingSystem:n,calendar:c}=r;return[s,n,c]}}function XK(e,t,i){return(i||t)&&(e.includes("-u-")||(e+="-u"),i&&(e+=`-ca-${i}`),t&&(e+=`-nu-${t}`)),e}function QK(e){const t=[];for(let i=1;i<=12;i++){const r=Jt.utc(2009,i,1);t.push(e(r))}return t}function eX(e){const t=[];for(let i=1;i<=7;i++){const r=Jt.utc(2016,11,13+i);t.push(e(r))}return t}function nv(e,t,i,r){const s=e.listingMode();return s==="error"?null:s==="en"?i(t):r(t)}function tX(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}class iX{constructor(t,i,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:s,floor:n,...c}=r;if(!i||Object.keys(c).length>0){const o={useGrouping:!1,...r};r.padTo>0&&(o.minimumIntegerDigits=r.padTo),this.inf=WK(t,o)}}format(t){if(this.inf){const i=this.floor?Math.floor(t):t;return this.inf.format(i)}else{const i=this.floor?Math.floor(t):t3(t,3);return ps(i,this.padTo)}}}class rX{constructor(t,i,r){this.opts=r,this.originalZone=void 0;let s;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const c=-1*(t.offset/60),o=c>=0?`Etc/GMT+${c}`:`Etc/GMT${c}`;t.offset!==0&&Ja.create(o).valid?(s=o,this.dt=t):(s="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,s=t.zone.name):(s="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const n={...this.opts};n.timeZone=n.timeZone||s,this.dtf=PE(i,n)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(i=>{if(i.type==="timeZoneName"){const r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...i,value:r}}else return i}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class sX{constructor(t,i,r){this.opts={style:"long",...r},!i&&uz()&&(this.rtf=ZK(t,r))}format(t,i){return this.rtf?this.rtf.format(t,i):TX(i,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,i){return this.rtf?this.rtf.formatToParts(t,i):[]}}const nX={firstDay:1,minimalDays:4,weekend:[6,7]};class Xi{static fromOpts(t){return Xi.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,i,r,s,n=!1){const c=t||rs.defaultLocale,o=c||(n?"en-US":YK()),f=i||rs.defaultNumberingSystem,g=r||rs.defaultOutputCalendar,S=kE(s)||rs.defaultWeekSettings;return new Xi(o,f,g,S,c)}static resetCache(){Cg=null,AE={},CE={},$E={}}static fromObject({locale:t,numberingSystem:i,outputCalendar:r,weekSettings:s}={}){return Xi.create(t,i,r,s)}constructor(t,i,r,s,n){const[c,o,f]=KK(t);this.locale=c,this.numberingSystem=i||o||null,this.outputCalendar=r||f||null,this.weekSettings=s,this.intl=XK(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=n,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=tX(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),i=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&i?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:Xi.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,kE(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,i=!1){return nv(this,t,mz,()=>{const r=i?{month:t,day:"numeric"}:{month:t},s=i?"format":"standalone";return this.monthsCache[s][t]||(this.monthsCache[s][t]=QK(n=>this.extract(n,r,"month"))),this.monthsCache[s][t]})}weekdays(t,i=!1){return nv(this,t,_z,()=>{const r=i?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},s=i?"format":"standalone";return this.weekdaysCache[s][t]||(this.weekdaysCache[s][t]=eX(n=>this.extract(n,r,"weekday"))),this.weekdaysCache[s][t]})}meridiems(){return nv(this,void 0,()=>vz,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Jt.utc(2016,11,13,9),Jt.utc(2016,11,13,19)].map(i=>this.extract(i,t,"dayperiod"))}return this.meridiemCache})}eras(t){return nv(this,t,bz,()=>{const i={era:t};return this.eraCache[t]||(this.eraCache[t]=[Jt.utc(-40,1,1),Jt.utc(2017,1,1)].map(r=>this.extract(r,i,"era"))),this.eraCache[t]})}extract(t,i,r){const s=this.dtFormatter(t,i),n=s.formatToParts(),c=n.find(o=>o.type.toLowerCase()===r);return c?c.value:null}numberFormatter(t={}){return new iX(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,i={}){return new rX(t,this.intl,i)}relFormatter(t={}){return new sX(this.intl,this.isEnglish(),t)}listFormatter(t={}){return HK(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:hz()?JK(this.locale):nX}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}}let OS=null;class gn extends b_{static get utcInstance(){return OS===null&&(OS=new gn(0)),OS}static instance(t){return t===0?gn.utcInstance:new gn(t)}static parseSpecifier(t){if(t){const i=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(i)return new gn(Lx(i[1],i[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${w0(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${w0(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,i){return w0(this.fixed,i)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class oX extends b_{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function ih(e,t){if(ni(e)||e===null)return t;if(e instanceof b_)return e;if(cX(e)){const i=e.toLowerCase();return i==="default"?t:i==="local"||i==="system"?kx.instance:i==="utc"||i==="gmt"?gn.utcInstance:gn.parseSpecifier(i)||Ja.create(e)}else return ap(e)?gn.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new oX(e)}let lk=()=>Date.now(),ck="system",uk=null,hk=null,dk=null,pk=60,fk,mk=null;class rs{static get now(){return lk}static set now(t){lk=t}static set defaultZone(t){ck=t}static get defaultZone(){return ih(ck,kx.instance)}static get defaultLocale(){return uk}static set defaultLocale(t){uk=t}static get defaultNumberingSystem(){return hk}static set defaultNumberingSystem(t){hk=t}static get defaultOutputCalendar(){return dk}static set defaultOutputCalendar(t){dk=t}static get defaultWeekSettings(){return mk}static set defaultWeekSettings(t){mk=kE(t)}static get twoDigitCutoffYear(){return pk}static set twoDigitCutoffYear(t){pk=t%100}static get throwOnInvalid(){return fk}static set throwOnInvalid(t){fk=t}static resetCaches(){Xi.resetCache(),Ja.resetCache()}}class ja{constructor(t,i){this.reason=t,this.explanation=i}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const sz=[0,31,59,90,120,151,181,212,243,273,304,334],nz=[0,31,60,91,121,152,182,213,244,274,305,335];function Qo(e,t){return new ja("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function XA(e,t,i){const r=new Date(Date.UTC(e,t-1,i));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const s=r.getUTCDay();return s===0?7:s}function oz(e,t,i){return i+(w_(e)?nz:sz)[t-1]}function az(e,t){const i=w_(e)?nz:sz,r=i.findIndex(n=>nJ0(r,t,i)?(g=r+1,f=1):g=r,{weekYear:g,weekNumber:f,weekday:o,...Dx(e)}}function yk(e,t=4,i=1){const{weekYear:r,weekNumber:s,weekday:n}=e,c=QA(XA(r,1,t),i),o=ym(r);let f=s*7+n-c-7+t,g;f<1?(g=r-1,f+=ym(g)):f>o?(g=r+1,f-=ym(r)):g=r;const{month:S,day:I}=az(g,f);return{year:g,month:S,day:I,...Dx(e)}}function LS(e){const{year:t,month:i,day:r}=e,s=oz(t,i,r);return{year:t,ordinal:s,...Dx(e)}}function gk(e){const{year:t,ordinal:i}=e,{month:r,day:s}=az(t,i);return{year:t,month:r,day:s,...Dx(e)}}function _k(e,t){if(!ni(e.localWeekday)||!ni(e.localWeekNumber)||!ni(e.localWeekYear)){if(!ni(e.weekday)||!ni(e.weekNumber)||!ni(e.weekYear))throw new rm("Cannot mix locale-based week fields with ISO-based week fields");return ni(e.localWeekday)||(e.weekday=e.localWeekday),ni(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),ni(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function aX(e,t=4,i=1){const r=Rx(e.weekYear),s=ea(e.weekNumber,1,J0(e.weekYear,t,i)),n=ea(e.weekday,1,7);return r?s?n?!1:Qo("weekday",e.weekday):Qo("week",e.weekNumber):Qo("weekYear",e.weekYear)}function lX(e){const t=Rx(e.year),i=ea(e.ordinal,1,ym(e.year));return t?i?!1:Qo("ordinal",e.ordinal):Qo("year",e.year)}function lz(e){const t=Rx(e.year),i=ea(e.month,1,12),r=ea(e.day,1,Mw(e.year,e.month));return t?i?r?!1:Qo("day",e.day):Qo("month",e.month):Qo("year",e.year)}function cz(e){const{hour:t,minute:i,second:r,millisecond:s}=e,n=ea(t,0,23)||t===24&&i===0&&r===0&&s===0,c=ea(i,0,59),o=ea(r,0,59),f=ea(s,0,999);return n?c?o?f?!1:Qo("millisecond",s):Qo("second",r):Qo("minute",i):Qo("hour",t)}function ni(e){return typeof e>"u"}function ap(e){return typeof e=="number"}function Rx(e){return typeof e=="number"&&e%1===0}function cX(e){return typeof e=="string"}function uX(e){return Object.prototype.toString.call(e)==="[object Date]"}function uz(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function hz(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function hX(e){return Array.isArray(e)?e:[e]}function vk(e,t,i){if(e.length!==0)return e.reduce((r,s)=>{const n=[t(s),s];return r&&i(r[0],n[0])===r[0]?r:n},null)[1]}function dX(e,t){return t.reduce((i,r)=>(i[r]=e[r],i),{})}function Rm(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function kE(e){if(e==null)return null;if(typeof e!="object")throw new Kn("Week settings must be an object");if(!ea(e.firstDay,1,7)||!ea(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!ea(t,1,7)))throw new Kn("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function ea(e,t,i){return Rx(e)&&e>=t&&e<=i}function pX(e,t){return e-t*Math.floor(e/t)}function ps(e,t=2){const i=e<0;let r;return i?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function Ku(e){if(!(ni(e)||e===null||e===""))return parseInt(e,10)}function td(e){if(!(ni(e)||e===null||e===""))return parseFloat(e)}function e3(e){if(!(ni(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function t3(e,t,i=!1){const r=10**t;return(i?Math.trunc:Math.round)(e*r)/r}function w_(e){return e%4===0&&(e%100!==0||e%400===0)}function ym(e){return w_(e)?366:365}function Mw(e,t){const i=pX(t-1,12)+1,r=e+(t-i)/12;return i===2?w_(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][i-1]}function Ox(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function bk(e,t,i){return-QA(XA(e,1,t),i)+t-1}function J0(e,t=4,i=1){const r=bk(e,t,i),s=bk(e+1,t,i);return(ym(e)-r+s)/7}function RE(e){return e>99?e:e>rs.twoDigitCutoffYear?1900+e:2e3+e}function dz(e,t,i,r=null){const s=new Date(e),n={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(n.timeZone=r);const c={timeZoneName:t,...n},o=new Intl.DateTimeFormat(i,c).formatToParts(s).find(f=>f.type.toLowerCase()==="timezonename");return o?o.value:null}function Lx(e,t){let i=parseInt(e,10);Number.isNaN(i)&&(i=0);const r=parseInt(t,10)||0,s=i<0||Object.is(i,-0)?-r:r;return i*60+s}function pz(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new Kn(`Invalid unit value ${e}`);return t}function Iw(e,t){const i={};for(const r in e)if(Rm(e,r)){const s=e[r];if(s==null)continue;i[t(r)]=pz(s)}return i}function w0(e,t){const i=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),s=e>=0?"+":"-";switch(t){case"short":return`${s}${ps(i,2)}:${ps(r,2)}`;case"narrow":return`${s}${i}${r>0?`:${r}`:""}`;case"techie":return`${s}${ps(i,2)}${ps(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Dx(e){return dX(e,["hour","minute","second","millisecond"])}const fX=["January","February","March","April","May","June","July","August","September","October","November","December"],fz=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],mX=["J","F","M","A","M","J","J","A","S","O","N","D"];function mz(e){switch(e){case"narrow":return[...mX];case"short":return[...fz];case"long":return[...fX];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const yz=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],gz=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],yX=["M","T","W","T","F","S","S"];function _z(e){switch(e){case"narrow":return[...yX];case"short":return[...gz];case"long":return[...yz];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const vz=["AM","PM"],gX=["Before Christ","Anno Domini"],_X=["BC","AD"],vX=["B","A"];function bz(e){switch(e){case"narrow":return[...vX];case"short":return[..._X];case"long":return[...gX];default:return null}}function bX(e){return vz[e.hour<12?0:1]}function wX(e,t){return _z(t)[e.weekday-1]}function xX(e,t){return mz(t)[e.month-1]}function SX(e,t){return bz(t)[e.year<0?0:1]}function TX(e,t,i="always",r=!1){const s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},n=["hours","minutes","seconds"].indexOf(e)===-1;if(i==="auto"&&n){const I=e==="days";switch(t){case 1:return I?"tomorrow":`next ${s[e][0]}`;case-1:return I?"yesterday":`last ${s[e][0]}`;case 0:return I?"today":`this ${s[e][0]}`}}const c=Object.is(t,-0)||t<0,o=Math.abs(t),f=o===1,g=s[e],S=r?f?g[1]:g[2]||g[1]:f?s[e][0]:e;return c?`${o} ${S} ago`:`in ${o} ${S}`}function wk(e,t){let i="";for(const r of e)r.literal?i+=r.val:i+=t(r.val);return i}const EX={D:Tw,DD:F6,DDD:B6,DDDD:U6,t:j6,tt:V6,ttt:G6,tttt:q6,T:H6,TT:W6,TTT:Z6,TTTT:Y6,f:J6,ff:X6,fff:ez,ffff:iz,F:K6,FF:Q6,FFF:tz,FFFF:rz};class yn{static create(t,i={}){return new yn(t,i)}static parseFormat(t){let i=null,r="",s=!1;const n=[];for(let c=0;c0&&n.push({literal:s||/^\s+$/.test(r),val:r}),i=null,r="",s=!s):s||o===i?r+=o:(r.length>0&&n.push({literal:/^\s+$/.test(r),val:r}),r=o,i=o)}return r.length>0&&n.push({literal:s||/^\s+$/.test(r),val:r}),n}static macroTokenToFormatOpts(t){return EX[t]}constructor(t,i){this.opts=i,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,i){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...i}).format()}dtFormatter(t,i={}){return this.loc.dtFormatter(t,{...this.opts,...i})}formatDateTime(t,i){return this.dtFormatter(t,i).format()}formatDateTimeParts(t,i){return this.dtFormatter(t,i).formatToParts()}formatInterval(t,i){return this.dtFormatter(t.start,i).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,i){return this.dtFormatter(t,i).resolvedOptions()}num(t,i=0){if(this.opts.forceSimple)return ps(t,i);const r={...this.opts};return i>0&&(r.padTo=i),this.loc.numberFormatter(r).format(t)}formatDateTimeFromString(t,i){const r=this.loc.listingMode()==="en",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",n=(O,z)=>this.loc.extract(t,O,z),c=O=>t.isOffsetFixed&&t.offset===0&&O.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,O.format):"",o=()=>r?bX(t):n({hour:"numeric",hourCycle:"h12"},"dayperiod"),f=(O,z)=>r?xX(t,O):n(z?{month:O}:{month:O,day:"numeric"},"month"),g=(O,z)=>r?wX(t,O):n(z?{weekday:O}:{weekday:O,month:"long",day:"numeric"},"weekday"),S=O=>{const z=yn.macroTokenToFormatOpts(O);return z?this.formatWithSystemDefault(t,z):O},I=O=>r?SX(t,O):n({era:O},"era"),A=O=>{switch(O){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return c({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return c({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return c({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return o();case"d":return s?n({day:"numeric"},"day"):this.num(t.day);case"dd":return s?n({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return g("short",!0);case"cccc":return g("long",!0);case"ccccc":return g("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return g("short",!1);case"EEEE":return g("long",!1);case"EEEEE":return g("narrow",!1);case"L":return s?n({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return s?n({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return f("short",!0);case"LLLL":return f("long",!0);case"LLLLL":return f("narrow",!0);case"M":return s?n({month:"numeric"},"month"):this.num(t.month);case"MM":return s?n({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return f("short",!1);case"MMMM":return f("long",!1);case"MMMMM":return f("narrow",!1);case"y":return s?n({year:"numeric"},"year"):this.num(t.year);case"yy":return s?n({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return s?n({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return s?n({year:"numeric"},"year"):this.num(t.year,6);case"G":return I("short");case"GG":return I("long");case"GGGGG":return I("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return S(O)}};return wk(yn.parseFormat(i),A)}formatDurationFromString(t,i){const r=f=>{switch(f[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=f=>g=>{const S=r(g);return S?this.num(f.get(S),g.length):g},n=yn.parseFormat(i),c=n.reduce((f,{literal:g,val:S})=>g?f:f.concat(S),[]),o=t.shiftTo(...c.map(r).filter(f=>f));return wk(n,s(o))}}const wz=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function qm(...e){const t=e.reduce((i,r)=>i+r.source,"");return RegExp(`^${t}$`)}function Hm(...e){return t=>e.reduce(([i,r,s],n)=>{const[c,o,f]=n(t,s);return[{...i,...c},o||r,f]},[{},null,1]).slice(0,2)}function Wm(e,...t){if(e==null)return[null,null];for(const[i,r]of t){const s=i.exec(e);if(s)return r(s)}return[null,null]}function xz(...e){return(t,i)=>{const r={};let s;for(s=0;sO!==void 0&&(z||O&&S)?-O:O;return[{years:A(td(i)),months:A(td(r)),weeks:A(td(s)),days:A(td(n)),hours:A(td(c)),minutes:A(td(o)),seconds:A(td(f),f==="-0"),milliseconds:A(e3(g),I)}]}const zX={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function s3(e,t,i,r,s,n,c){const o={year:t.length===2?RE(Ku(t)):Ku(t),month:fz.indexOf(i)+1,day:Ku(r),hour:Ku(s),minute:Ku(n)};return c&&(o.second=Ku(c)),e&&(o.weekday=e.length>3?yz.indexOf(e)+1:gz.indexOf(e)+1),o}const FX=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function BX(e){const[,t,i,r,s,n,c,o,f,g,S,I]=e,A=s3(t,s,r,i,n,c,o);let O;return f?O=zX[f]:g?O=0:O=Lx(S,I),[A,new gn(O)]}function UX(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const jX=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,VX=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,GX=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function xk(e){const[,t,i,r,s,n,c,o]=e;return[s3(t,s,r,i,n,c,o),gn.utcInstance]}function qX(e){const[,t,i,r,s,n,c,o]=e;return[s3(t,o,i,r,s,n,c),gn.utcInstance]}const HX=qm(IX,r3),WX=qm(AX,r3),ZX=qm(PX,r3),YX=qm(Tz),Mz=Hm(OX,Zm,x_,S_),JX=Hm(CX,Zm,x_,S_),KX=Hm($X,Zm,x_,S_),XX=Hm(Zm,x_,S_);function QX(e){return Wm(e,[HX,Mz],[WX,JX],[ZX,KX],[YX,XX])}function eQ(e){return Wm(UX(e),[FX,BX])}function tQ(e){return Wm(e,[jX,xk],[VX,xk],[GX,qX])}function iQ(e){return Wm(e,[DX,NX])}const rQ=Hm(Zm);function sQ(e){return Wm(e,[LX,rQ])}const nQ=qm(kX,RX),oQ=qm(Ez),aQ=Hm(Zm,x_,S_);function lQ(e){return Wm(e,[nQ,Mz],[oQ,aQ])}const Sk="Invalid Duration",Iz={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},cQ={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...Iz},Bo=146097/400,Ef=146097/4800,uQ={years:{quarters:4,months:12,weeks:Bo/7,days:Bo,hours:Bo*24,minutes:Bo*24*60,seconds:Bo*24*60*60,milliseconds:Bo*24*60*60*1e3},quarters:{months:3,weeks:Bo/28,days:Bo/4,hours:Bo*24/4,minutes:Bo*24*60/4,seconds:Bo*24*60*60/4,milliseconds:Bo*24*60*60*1e3/4},months:{weeks:Ef/7,days:Ef,hours:Ef*24,minutes:Ef*24*60,seconds:Ef*24*60*60,milliseconds:Ef*24*60*60*1e3},...Iz},Yd=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],hQ=Yd.slice(0).reverse();function xu(e,t,i=!1){const r={values:i?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Pi(r)}function Az(e,t){let i=t.milliseconds??0;for(const r of hQ.slice(1))t[r]&&(i+=t[r]*e[r].milliseconds);return i}function Tk(e,t){const i=Az(e,t)<0?-1:1;Yd.reduceRight((r,s)=>{if(ni(t[s]))return r;if(r){const n=t[r]*i,c=e[s][r],o=Math.floor(n/c);t[s]+=o*i,t[r]-=o*c*i}return s},null),Yd.reduce((r,s)=>{if(ni(t[s]))return r;if(r){const n=t[r]%1;t[r]-=n,t[s]+=n*e[r][s]}return s},null)}function dQ(e){const t={};for(const[i,r]of Object.entries(e))r!==0&&(t[i]=r);return t}class Pi{constructor(t){const i=t.conversionAccuracy==="longterm"||!1;let r=i?uQ:cQ;t.matrix&&(r=t.matrix),this.values=t.values,this.loc=t.loc||Xi.create(),this.conversionAccuracy=i?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(t,i){return Pi.fromObject({milliseconds:t},i)}static fromObject(t,i={}){if(t==null||typeof t!="object")throw new Kn(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new Pi({values:Iw(t,Pi.normalizeUnit),loc:Xi.fromObject(i),conversionAccuracy:i.conversionAccuracy,matrix:i.matrix})}static fromDurationLike(t){if(ap(t))return Pi.fromMillis(t);if(Pi.isDuration(t))return t;if(typeof t=="object")return Pi.fromObject(t);throw new Kn(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,i){const[r]=iQ(t);return r?Pi.fromObject(r,i):Pi.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,i){const[r]=sQ(t);return r?Pi.fromObject(r,i):Pi.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,i=null){if(!t)throw new Kn("need to specify a reason the Duration is invalid");const r=t instanceof ja?t:new ja(t,i);if(rs.throwOnInvalid)throw new FK(r);return new Pi({invalid:r})}static normalizeUnit(t){const i={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!i)throw new z6(t);return i}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,i={}){const r={...i,floor:i.round!==!1&&i.floor!==!1};return this.isValid?yn.create(this.loc,r).formatDurationFromString(this,t):Sk}toHuman(t={}){if(!this.isValid)return Sk;const i=Yd.map(r=>{const s=this.values[r];return ni(s)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:r.slice(0,-1)}).format(s)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(i)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=t3(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const i=this.toMillis();return i<0||i>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},Jt.fromMillis(i,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Az(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const i=Pi.fromDurationLike(t),r={};for(const s of Yd)(Rm(i.values,s)||Rm(this.values,s))&&(r[s]=i.get(s)+this.get(s));return xu(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const i=Pi.fromDurationLike(t);return this.plus(i.negate())}mapUnits(t){if(!this.isValid)return this;const i={};for(const r of Object.keys(this.values))i[r]=pz(t(this.values[r],r));return xu(this,{values:i},!0)}get(t){return this[Pi.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const i={...this.values,...Iw(t,Pi.normalizeUnit)};return xu(this,{values:i})}reconfigure({locale:t,numberingSystem:i,conversionAccuracy:r,matrix:s}={}){const c={loc:this.loc.clone({locale:t,numberingSystem:i}),matrix:s,conversionAccuracy:r};return xu(this,c)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return Tk(this.matrix,t),xu(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=dQ(this.normalize().shiftToAll().toObject());return xu(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(c=>Pi.normalizeUnit(c));const i={},r={},s=this.toObject();let n;for(const c of Yd)if(t.indexOf(c)>=0){n=c;let o=0;for(const g in r)o+=this.matrix[g][c]*r[g],r[g]=0;ap(s[c])&&(o+=s[c]);const f=Math.trunc(o);i[c]=f,r[c]=(o*1e3-f*1e3)/1e3}else ap(s[c])&&(r[c]=s[c]);for(const c in r)r[c]!==0&&(i[n]+=c===n?r[c]:r[c]/this.matrix[n][c]);return Tk(this.matrix,i),xu(this,{values:i},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const i of Object.keys(this.values))t[i]=this.values[i]===0?0:-this.values[i];return xu(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function i(r,s){return r===void 0||r===0?s===void 0||s===0:r===s}for(const r of Yd)if(!i(this.values[r],t.values[r]))return!1;return!0}}const Mf="Invalid Interval";function pQ(e,t){return!e||!e.isValid?Fr.invalid("missing or invalid start"):!t||!t.isValid?Fr.invalid("missing or invalid end"):tt:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:i}={}){return this.isValid?Fr.fromDateTimes(t||this.s,i||this.e):this}splitAt(...t){if(!this.isValid)return[];const i=t.map(dg).filter(c=>this.contains(c)).sort((c,o)=>c.toMillis()-o.toMillis()),r=[];let{s}=this,n=0;for(;s+this.e?this.e:c;r.push(Fr.fromDateTimes(s,o)),s=o,n+=1}return r}splitBy(t){const i=Pi.fromDurationLike(t);if(!this.isValid||!i.isValid||i.as("milliseconds")===0)return[];let{s:r}=this,s=1,n;const c=[];for(;rf*s));n=+o>+this.e?this.e:o,c.push(Fr.fromDateTimes(r,n)),r=n,s+=1}return c}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const i=this.s>t.s?this.s:t.s,r=this.e=r?null:Fr.fromDateTimes(i,r)}union(t){if(!this.isValid)return this;const i=this.st.e?this.e:t.e;return Fr.fromDateTimes(i,r)}static merge(t){const[i,r]=t.sort((s,n)=>s.s-n.s).reduce(([s,n],c)=>n?n.overlaps(c)||n.abutsStart(c)?[s,n.union(c)]:[s.concat([n]),c]:[s,c],[[],null]);return r&&i.push(r),i}static xor(t){let i=null,r=0;const s=[],n=t.map(f=>[{time:f.s,type:"s"},{time:f.e,type:"e"}]),c=Array.prototype.concat(...n),o=c.sort((f,g)=>f.time-g.time);for(const f of o)r+=f.type==="s"?1:-1,r===1?i=f.time:(i&&+i!=+f.time&&s.push(Fr.fromDateTimes(i,f.time)),i=null);return Fr.merge(s)}difference(...t){return Fr.xor([this].concat(t)).map(i=>this.intersection(i)).filter(i=>i&&!i.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Mf}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=Tw,i={}){return this.isValid?yn.create(this.s.loc.clone(i),t).formatInterval(this):Mf}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Mf}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Mf}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Mf}toFormat(t,{separator:i=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${i}${this.e.toFormat(t)}`:Mf}toDuration(t,i){return this.isValid?this.e.diff(this.s,t,i):Pi.invalid(this.invalidReason)}mapEndpoints(t){return Fr.fromDateTimes(t(this.s),t(this.e))}}class ov{static hasDST(t=rs.defaultZone){const i=Jt.now().setZone(t).set({month:12});return!t.isUniversal&&i.offset!==i.set({month:6}).offset}static isValidIANAZone(t){return Ja.isValidZone(t)}static normalizeZone(t){return ih(t,rs.defaultZone)}static getStartOfWeek({locale:t=null,locObj:i=null}={}){return(i||Xi.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:i=null}={}){return(i||Xi.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:i=null}={}){return(i||Xi.create(t)).getWeekendDays().slice()}static months(t="long",{locale:i=null,numberingSystem:r=null,locObj:s=null,outputCalendar:n="gregory"}={}){return(s||Xi.create(i,r,n)).months(t)}static monthsFormat(t="long",{locale:i=null,numberingSystem:r=null,locObj:s=null,outputCalendar:n="gregory"}={}){return(s||Xi.create(i,r,n)).months(t,!0)}static weekdays(t="long",{locale:i=null,numberingSystem:r=null,locObj:s=null}={}){return(s||Xi.create(i,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:i=null,numberingSystem:r=null,locObj:s=null}={}){return(s||Xi.create(i,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return Xi.create(t).meridiems()}static eras(t="short",{locale:i=null}={}){return Xi.create(i,null,"gregory").eras(t)}static features(){return{relative:uz(),localeWeek:hz()}}}function Ek(e,t){const i=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=i(t)-i(e);return Math.floor(Pi.fromMillis(r).as("days"))}function fQ(e,t,i){const r=[["years",(f,g)=>g.year-f.year],["quarters",(f,g)=>g.quarter-f.quarter+(g.year-f.year)*4],["months",(f,g)=>g.month-f.month+(g.year-f.year)*12],["weeks",(f,g)=>{const S=Ek(f,g);return(S-S%7)/7}],["days",Ek]],s={},n=e;let c,o;for(const[f,g]of r)i.indexOf(f)>=0&&(c=f,s[f]=g(e,t),o=n.plus(s),o>t?(s[f]--,e=n.plus(s),e>t&&(o=e,s[f]--,e=n.plus(s))):e=o);return[e,s,o,c]}function mQ(e,t,i,r){let[s,n,c,o]=fQ(e,t,i);const f=t-s,g=i.filter(I=>["hours","minutes","seconds","milliseconds"].indexOf(I)>=0);g.length===0&&(c0?Pi.fromMillis(f,r).shiftTo(...g).plus(S):S}const n3={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Mk={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},yQ=n3.hanidec.replace(/[\[|\]]/g,"").split("");function gQ(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let i=0;i=n&&r<=c&&(t+=r-n)}}return parseInt(t,10)}else return t}function ba({numberingSystem:e},t=""){return new RegExp(`${n3[e||"latn"]}${t}`)}const _Q="missing Intl.DateTimeFormat.formatToParts support";function Li(e,t=i=>i){return{regex:e,deser:([i])=>t(gQ(i))}}const vQ=" ",Pz=`[ ${vQ}]`,Cz=new RegExp(Pz,"g");function bQ(e){return e.replace(/\./g,"\\.?").replace(Cz,Pz)}function Ik(e){return e.replace(/\./g,"").replace(Cz," ").toLowerCase()}function wa(e,t){return e===null?null:{regex:RegExp(e.map(bQ).join("|")),deser:([i])=>e.findIndex(r=>Ik(i)===Ik(r))+t}}function Ak(e,t){return{regex:e,deser:([,i,r])=>Lx(i,r),groups:t}}function av(e){return{regex:e,deser:([t])=>t}}function wQ(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function xQ(e,t){const i=ba(t),r=ba(t,"{2}"),s=ba(t,"{3}"),n=ba(t,"{4}"),c=ba(t,"{6}"),o=ba(t,"{1,2}"),f=ba(t,"{1,3}"),g=ba(t,"{1,6}"),S=ba(t,"{1,9}"),I=ba(t,"{2,4}"),A=ba(t,"{4,6}"),O=H=>({regex:RegExp(wQ(H.val)),deser:([Q])=>Q,literal:!0}),V=(H=>{if(e.literal)return O(H);switch(H.val){case"G":return wa(t.eras("short"),0);case"GG":return wa(t.eras("long"),0);case"y":return Li(g);case"yy":return Li(I,RE);case"yyyy":return Li(n);case"yyyyy":return Li(A);case"yyyyyy":return Li(c);case"M":return Li(o);case"MM":return Li(r);case"MMM":return wa(t.months("short",!0),1);case"MMMM":return wa(t.months("long",!0),1);case"L":return Li(o);case"LL":return Li(r);case"LLL":return wa(t.months("short",!1),1);case"LLLL":return wa(t.months("long",!1),1);case"d":return Li(o);case"dd":return Li(r);case"o":return Li(f);case"ooo":return Li(s);case"HH":return Li(r);case"H":return Li(o);case"hh":return Li(r);case"h":return Li(o);case"mm":return Li(r);case"m":return Li(o);case"q":return Li(o);case"qq":return Li(r);case"s":return Li(o);case"ss":return Li(r);case"S":return Li(f);case"SSS":return Li(s);case"u":return av(S);case"uu":return av(o);case"uuu":return Li(i);case"a":return wa(t.meridiems(),0);case"kkkk":return Li(n);case"kk":return Li(I,RE);case"W":return Li(o);case"WW":return Li(r);case"E":case"c":return Li(i);case"EEE":return wa(t.weekdays("short",!1),1);case"EEEE":return wa(t.weekdays("long",!1),1);case"ccc":return wa(t.weekdays("short",!0),1);case"cccc":return wa(t.weekdays("long",!0),1);case"Z":case"ZZ":return Ak(new RegExp(`([+-]${o.source})(?::(${r.source}))?`),2);case"ZZZ":return Ak(new RegExp(`([+-]${o.source})(${r.source})?`),2);case"z":return av(/[a-z_+-/]{1,256}?/i);case" ":return av(/[^\S\n\r]/);default:return O(H)}})(e)||{invalidReason:_Q};return V.token=e,V}const SQ={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function TQ(e,t,i){const{type:r,value:s}=e;if(r==="literal"){const f=/^\s+$/.test(s);return{literal:!f,val:f?" ":s}}const n=t[r];let c=r;r==="hour"&&(t.hour12!=null?c=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?c="hour12":c="hour24":c=i.hour12?"hour12":"hour24");let o=SQ[c];if(typeof o=="object"&&(o=o[n]),o)return{literal:!1,val:o}}function EQ(e){return[`^${e.map(i=>i.regex).reduce((i,r)=>`${i}(${r.source})`,"")}$`,e]}function MQ(e,t,i){const r=e.match(t);if(r){const s={};let n=1;for(const c in i)if(Rm(i,c)){const o=i[c],f=o.groups?o.groups+1:1;!o.literal&&o.token&&(s[o.token.val[0]]=o.deser(r.slice(n,n+f))),n+=f}return[r,s]}else return[r,{}]}function IQ(e){const t=n=>{switch(n){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let i=null,r;return ni(e.z)||(i=Ja.create(e.z)),ni(e.Z)||(i||(i=new gn(e.Z)),r=e.Z),ni(e.q)||(e.M=(e.q-1)*3+1),ni(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),ni(e.u)||(e.S=e3(e.u)),[Object.keys(e).reduce((n,c)=>{const o=t(c);return o&&(n[o]=e[c]),n},{}),i,r]}let DS=null;function AQ(){return DS||(DS=Jt.fromMillis(1555555555555)),DS}function PQ(e,t){if(e.literal)return e;const i=yn.macroTokenToFormatOpts(e.val),r=Rz(i,t);return r==null||r.includes(void 0)?e:r}function $z(e,t){return Array.prototype.concat(...e.map(i=>PQ(i,t)))}function kz(e,t,i){const r=$z(yn.parseFormat(i),e),s=r.map(c=>xQ(c,e)),n=s.find(c=>c.invalidReason);if(n)return{input:t,tokens:r,invalidReason:n.invalidReason};{const[c,o]=EQ(s),f=RegExp(c,"i"),[g,S]=MQ(t,f,o),[I,A,O]=S?IQ(S):[null,null,void 0];if(Rm(S,"a")&&Rm(S,"H"))throw new rm("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:f,rawMatches:g,matches:S,result:I,zone:A,specificOffset:O}}}function CQ(e,t,i){const{result:r,zone:s,specificOffset:n,invalidReason:c}=kz(e,t,i);return[r,s,n,c]}function Rz(e,t){if(!e)return null;const r=yn.create(t,e).dtFormatter(AQ()),s=r.formatToParts(),n=r.resolvedOptions();return s.map(c=>TQ(c,e,n))}const NS="Invalid DateTime",Pk=864e13;function lv(e){return new ja("unsupported zone",`the zone "${e.name}" is not supported`)}function zS(e){return e.weekData===null&&(e.weekData=Ew(e.c)),e.weekData}function FS(e){return e.localWeekData===null&&(e.localWeekData=Ew(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function id(e,t){const i={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Jt({...i,...t,old:i})}function Oz(e,t,i){let r=e-t*60*1e3;const s=i.offset(r);if(t===s)return[r,t];r-=(s-t)*60*1e3;const n=i.offset(r);return s===n?[r,s]:[e-Math.min(s,n)*60*1e3,Math.max(s,n)]}function cv(e,t){e+=t*60*1e3;const i=new Date(e);return{year:i.getUTCFullYear(),month:i.getUTCMonth()+1,day:i.getUTCDate(),hour:i.getUTCHours(),minute:i.getUTCMinutes(),second:i.getUTCSeconds(),millisecond:i.getUTCMilliseconds()}}function Xv(e,t,i){return Oz(Ox(e),t,i)}function Ck(e,t){const i=e.o,r=e.c.year+Math.trunc(t.years),s=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,n={...e.c,year:r,month:s,day:Math.min(e.c.day,Mw(r,s))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},c=Pi.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),o=Ox(n);let[f,g]=Oz(o,i,e.zone);return c!==0&&(f+=c,g=e.zone.offset(f)),{ts:f,o:g}}function hg(e,t,i,r,s,n){const{setZone:c,zone:o}=i;if(e&&Object.keys(e).length!==0||t){const f=t||o,g=Jt.fromObject(e,{...i,zone:f,specificOffset:n});return c?g:g.setZone(o)}else return Jt.invalid(new ja("unparsable",`the input "${s}" can't be parsed as ${r}`))}function uv(e,t,i=!0){return e.isValid?yn.create(Xi.create("en-US"),{allowZ:i,forceSimple:!0}).formatDateTimeFromString(e,t):null}function BS(e,t){const i=e.c.year>9999||e.c.year<0;let r="";return i&&e.c.year>=0&&(r+="+"),r+=ps(e.c.year,i?6:4),t?(r+="-",r+=ps(e.c.month),r+="-",r+=ps(e.c.day)):(r+=ps(e.c.month),r+=ps(e.c.day)),r}function $k(e,t,i,r,s,n){let c=ps(e.c.hour);return t?(c+=":",c+=ps(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!i)&&(c+=":")):c+=ps(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!i)&&(c+=ps(e.c.second),(e.c.millisecond!==0||!r)&&(c+=".",c+=ps(e.c.millisecond,3))),s&&(e.isOffsetFixed&&e.offset===0&&!n?c+="Z":e.o<0?(c+="-",c+=ps(Math.trunc(-e.o/60)),c+=":",c+=ps(Math.trunc(-e.o%60))):(c+="+",c+=ps(Math.trunc(e.o/60)),c+=":",c+=ps(Math.trunc(e.o%60)))),n&&(c+="["+e.zone.ianaName+"]"),c}const Lz={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},$Q={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},kQ={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Dz=["year","month","day","hour","minute","second","millisecond"],RQ=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],OQ=["year","ordinal","hour","minute","second","millisecond"];function LQ(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new z6(e);return t}function kk(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return LQ(e)}}function Rk(e,t){const i=ih(t.zone,rs.defaultZone),r=Xi.fromObject(t),s=rs.now();let n,c;if(ni(e.year))n=s;else{for(const g of Dz)ni(e[g])&&(e[g]=Lz[g]);const o=lz(e)||cz(e);if(o)return Jt.invalid(o);const f=i.offset(s);[n,c]=Xv(e,f,i)}return new Jt({ts:n,zone:i,loc:r,o:c})}function Ok(e,t,i){const r=ni(i.round)?!0:i.round,s=(c,o)=>(c=t3(c,r||i.calendary?0:2,!0),t.loc.clone(i).relFormatter(i).format(c,o)),n=c=>i.calendary?t.hasSame(e,c)?0:t.startOf(c).diff(e.startOf(c),c).get(c):t.diff(e,c).get(c);if(i.unit)return s(n(i.unit),i.unit);for(const c of i.units){const o=n(c);if(Math.abs(o)>=1)return s(o,c)}return s(e>t?-0:0,i.units[i.units.length-1])}function Lk(e){let t={},i;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],i=Array.from(e).slice(0,e.length-1)):i=Array.from(e),[t,i]}class Jt{constructor(t){const i=t.zone||rs.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new ja("invalid input"):null)||(i.isValid?null:lv(i));this.ts=ni(t.ts)?rs.now():t.ts;let s=null,n=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(i))[s,n]=[t.old.c,t.old.o];else{const o=i.offset(this.ts);s=cv(this.ts,o),r=Number.isNaN(s.year)?new ja("invalid input"):null,s=r?null:s,n=r?null:o}this._zone=i,this.loc=t.loc||Xi.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=s,this.o=n,this.isLuxonDateTime=!0}static now(){return new Jt({})}static local(){const[t,i]=Lk(arguments),[r,s,n,c,o,f,g]=i;return Rk({year:r,month:s,day:n,hour:c,minute:o,second:f,millisecond:g},t)}static utc(){const[t,i]=Lk(arguments),[r,s,n,c,o,f,g]=i;return t.zone=gn.utcInstance,Rk({year:r,month:s,day:n,hour:c,minute:o,second:f,millisecond:g},t)}static fromJSDate(t,i={}){const r=uX(t)?t.valueOf():NaN;if(Number.isNaN(r))return Jt.invalid("invalid input");const s=ih(i.zone,rs.defaultZone);return s.isValid?new Jt({ts:r,zone:s,loc:Xi.fromObject(i)}):Jt.invalid(lv(s))}static fromMillis(t,i={}){if(ap(t))return t<-Pk||t>Pk?Jt.invalid("Timestamp out of range"):new Jt({ts:t,zone:ih(i.zone,rs.defaultZone),loc:Xi.fromObject(i)});throw new Kn(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,i={}){if(ap(t))return new Jt({ts:t*1e3,zone:ih(i.zone,rs.defaultZone),loc:Xi.fromObject(i)});throw new Kn("fromSeconds requires a numerical input")}static fromObject(t,i={}){t=t||{};const r=ih(i.zone,rs.defaultZone);if(!r.isValid)return Jt.invalid(lv(r));const s=Xi.fromObject(i),n=Iw(t,kk),{minDaysInFirstWeek:c,startOfWeek:o}=_k(n,s),f=rs.now(),g=ni(i.specificOffset)?r.offset(f):i.specificOffset,S=!ni(n.ordinal),I=!ni(n.year),A=!ni(n.month)||!ni(n.day),O=I||A,z=n.weekYear||n.weekNumber;if((O||S)&&z)throw new rm("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(A&&S)throw new rm("Can't mix ordinal dates with month/day");const V=z||n.weekday&&!O;let H,Q,ve=cv(f,g);V?(H=RQ,Q=$Q,ve=Ew(ve,c,o)):S?(H=OQ,Q=kQ,ve=LS(ve)):(H=Dz,Q=Lz);let me=!1;for(const ut of H){const ot=n[ut];ni(ot)?me?n[ut]=Q[ut]:n[ut]=ve[ut]:me=!0}const ge=V?aX(n,c,o):S?lX(n):lz(n),Ie=ge||cz(n);if(Ie)return Jt.invalid(Ie);const Ce=V?yk(n,c,o):S?gk(n):n,[ze,je]=Xv(Ce,g,r),tt=new Jt({ts:ze,zone:r,o:je,loc:s});return n.weekday&&O&&t.weekday!==tt.weekday?Jt.invalid("mismatched weekday",`you can't specify both a weekday of ${n.weekday} and a date of ${tt.toISO()}`):tt}static fromISO(t,i={}){const[r,s]=QX(t);return hg(r,s,i,"ISO 8601",t)}static fromRFC2822(t,i={}){const[r,s]=eQ(t);return hg(r,s,i,"RFC 2822",t)}static fromHTTP(t,i={}){const[r,s]=tQ(t);return hg(r,s,i,"HTTP",i)}static fromFormat(t,i,r={}){if(ni(t)||ni(i))throw new Kn("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:n=null}=r,c=Xi.fromOpts({locale:s,numberingSystem:n,defaultToEN:!0}),[o,f,g,S]=CQ(c,t,i);return S?Jt.invalid(S):hg(o,f,r,`format ${i}`,t,g)}static fromString(t,i,r={}){return Jt.fromFormat(t,i,r)}static fromSQL(t,i={}){const[r,s]=lQ(t);return hg(r,s,i,"SQL",t)}static invalid(t,i=null){if(!t)throw new Kn("need to specify a reason the DateTime is invalid");const r=t instanceof ja?t:new ja(t,i);if(rs.throwOnInvalid)throw new NK(r);return new Jt({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,i={}){const r=Rz(t,Xi.fromObject(i));return r?r.map(s=>s?s.val:null).join(""):null}static expandFormat(t,i={}){return $z(yn.parseFormat(t),Xi.fromObject(i)).map(s=>s.val).join("")}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?zS(this).weekYear:NaN}get weekNumber(){return this.isValid?zS(this).weekNumber:NaN}get weekday(){return this.isValid?zS(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?FS(this).weekday:NaN}get localWeekNumber(){return this.isValid?FS(this).weekNumber:NaN}get localWeekYear(){return this.isValid?FS(this).weekYear:NaN}get ordinal(){return this.isValid?LS(this.c).ordinal:NaN}get monthShort(){return this.isValid?ov.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?ov.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?ov.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?ov.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,i=6e4,r=Ox(this.c),s=this.zone.offset(r-t),n=this.zone.offset(r+t),c=this.zone.offset(r-s*i),o=this.zone.offset(r-n*i);if(c===o)return[this];const f=r-c*i,g=r-o*i,S=cv(f,c),I=cv(g,o);return S.hour===I.hour&&S.minute===I.minute&&S.second===I.second&&S.millisecond===I.millisecond?[id(this,{ts:f}),id(this,{ts:g})]:[this]}get isInLeapYear(){return w_(this.year)}get daysInMonth(){return Mw(this.year,this.month)}get daysInYear(){return this.isValid?ym(this.year):NaN}get weeksInWeekYear(){return this.isValid?J0(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?J0(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:i,numberingSystem:r,calendar:s}=yn.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:i,numberingSystem:r,outputCalendar:s}}toUTC(t=0,i={}){return this.setZone(gn.instance(t),i)}toLocal(){return this.setZone(rs.defaultZone)}setZone(t,{keepLocalTime:i=!1,keepCalendarTime:r=!1}={}){if(t=ih(t,rs.defaultZone),t.equals(this.zone))return this;if(t.isValid){let s=this.ts;if(i||r){const n=t.offset(this.ts),c=this.toObject();[s]=Xv(c,n,t)}return id(this,{ts:s,zone:t})}else return Jt.invalid(lv(t))}reconfigure({locale:t,numberingSystem:i,outputCalendar:r}={}){const s=this.loc.clone({locale:t,numberingSystem:i,outputCalendar:r});return id(this,{loc:s})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const i=Iw(t,kk),{minDaysInFirstWeek:r,startOfWeek:s}=_k(i,this.loc),n=!ni(i.weekYear)||!ni(i.weekNumber)||!ni(i.weekday),c=!ni(i.ordinal),o=!ni(i.year),f=!ni(i.month)||!ni(i.day),g=o||f,S=i.weekYear||i.weekNumber;if((g||c)&&S)throw new rm("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(f&&c)throw new rm("Can't mix ordinal dates with month/day");let I;n?I=yk({...Ew(this.c,r,s),...i},r,s):ni(i.ordinal)?(I={...this.toObject(),...i},ni(i.day)&&(I.day=Math.min(Mw(I.year,I.month),I.day))):I=gk({...LS(this.c),...i});const[A,O]=Xv(I,this.o,this.zone);return id(this,{ts:A,o:O})}plus(t){if(!this.isValid)return this;const i=Pi.fromDurationLike(t);return id(this,Ck(this,i))}minus(t){if(!this.isValid)return this;const i=Pi.fromDurationLike(t).negate();return id(this,Ck(this,i))}startOf(t,{useLocaleWeeks:i=!1}={}){if(!this.isValid)return this;const r={},s=Pi.normalizeUnit(t);switch(s){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(s==="weeks")if(i){const n=this.loc.getStartOfWeek(),{weekday:c}=this;cthis.valueOf(),o=c?this:t,f=c?t:this,g=mQ(o,f,n,s);return c?g.negate():g}diffNow(t="milliseconds",i={}){return this.diff(Jt.now(),t,i)}until(t){return this.isValid?Fr.fromDateTimes(this,t):this}hasSame(t,i,r){if(!this.isValid)return!1;const s=t.valueOf(),n=this.setZone(t.zone,{keepLocalTime:!0});return n.startOf(i,r)<=s&&s<=n.endOf(i,r)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const i=t.base||Jt.fromObject({},{zone:this.zone}),r=t.padding?thisi.valueOf(),Math.min)}static max(...t){if(!t.every(Jt.isDateTime))throw new Kn("max requires all arguments be DateTimes");return vk(t,i=>i.valueOf(),Math.max)}static fromFormatExplain(t,i,r={}){const{locale:s=null,numberingSystem:n=null}=r,c=Xi.fromOpts({locale:s,numberingSystem:n,defaultToEN:!0});return kz(c,t,i)}static fromStringExplain(t,i,r={}){return Jt.fromFormatExplain(t,i,r)}static get DATE_SHORT(){return Tw}static get DATE_MED(){return F6}static get DATE_MED_WITH_WEEKDAY(){return BK}static get DATE_FULL(){return B6}static get DATE_HUGE(){return U6}static get TIME_SIMPLE(){return j6}static get TIME_WITH_SECONDS(){return V6}static get TIME_WITH_SHORT_OFFSET(){return G6}static get TIME_WITH_LONG_OFFSET(){return q6}static get TIME_24_SIMPLE(){return H6}static get TIME_24_WITH_SECONDS(){return W6}static get TIME_24_WITH_SHORT_OFFSET(){return Z6}static get TIME_24_WITH_LONG_OFFSET(){return Y6}static get DATETIME_SHORT(){return J6}static get DATETIME_SHORT_WITH_SECONDS(){return K6}static get DATETIME_MED(){return X6}static get DATETIME_MED_WITH_SECONDS(){return Q6}static get DATETIME_MED_WITH_WEEKDAY(){return UK}static get DATETIME_FULL(){return ez}static get DATETIME_FULL_WITH_SECONDS(){return tz}static get DATETIME_HUGE(){return iz}static get DATETIME_HUGE_WITH_SECONDS(){return rz}}function dg(e){if(Jt.isDateTime(e))return e;if(e&&e.valueOf&&ap(e.valueOf()))return Jt.fromJSDate(e);if(e&&typeof e=="object")return Jt.fromObject(e);throw new Kn(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const Dl="system",o3="unknown",K0="UTC",DQ=Intl.DateTimeFormat().resolvedOptions().timeZone,NQ="shortOffset";function zQ(e){return"timeZoneIANA"in e}function FQ(e){return e.startsWith("UTC")}function Kge(e,t=!1){return{json:{read:{source:e,reader:(i,r)=>r[e]?BQ(r[e]):null},write:!!t&&{allowNull:!0,writer(i,r){r[e]=i?UQ(i):null}}}}}function BQ(e,t=Dl){return e?zQ(e)?e.timeZoneIANA:jQ(e,t):t}function UQ(e){return{timeZoneIANA:e}}function jQ(e,t=Dl){if(!e||!nk.has(e.timeZone))return t;const i=nk.get(e.timeZone);return FQ(e.timeZone)||e.respectsDaylightSaving?i:VQ(i)}function VQ(e){const t=Jt.local().setZone(e),i=Math.min(t.set({month:1,day:1}).offset,t.set({month:5}).offset);return i===0?"Etc/UTC":`Etc/GMT${gn.instance(-i).formatOffset(0,"narrow")}`}function Xge(e,t,i,r,s){if(t&&s==="date")return{timeZone:K0,timeZoneName:void 0};const n=r.timeStyle||r.hour,c=i===o3;return{timeZone:c?s==="timestamp-offset"?void 0:e??K0:i,timeZoneName:c&&n?NQ:void 0}}const GQ={year:void 0,month:void 0,day:void 0,weekday:void 0},qQ={hour:void 0,minute:void 0,second:void 0},Nz={timeZone:K0},cl={year:"numeric",month:"numeric",day:"numeric"},pg={year:"numeric",month:"long",day:"numeric"},fg={year:"numeric",month:"short",day:"numeric"},mg={year:"numeric",month:"long",weekday:"long",day:"numeric"},Xu={hour:"numeric",minute:"numeric"},fd={...Xu,second:"numeric"},zz={hourCycle:"h23"},yg={...Xu,...zz},gg={...fd,...zz},Fz={"short-date":cl,"short-date-short-time":{...cl,...Xu},"short-date-short-time-24":{...cl,...yg},"short-date-long-time":{...cl,...fd},"short-date-long-time-24":{...cl,...gg},"short-date-le":cl,"short-date-le-short-time":{...cl,...Xu},"short-date-le-short-time-24":{...cl,...yg},"short-date-le-long-time":{...cl,...fd},"short-date-le-long-time-24":{...cl,...gg},"long-month-day-year":pg,"long-month-day-year-short-time":{...pg,...Xu},"long-month-day-year-short-time-24":{...pg,...yg},"long-month-day-year-long-time":{...pg,...fd},"long-month-day-year-long-time-24":{...pg,...gg},"day-short-month-year":fg,"day-short-month-year-short-time":{...fg,...Xu},"day-short-month-year-short-time-24":{...fg,...yg},"day-short-month-year-long-time":{...fg,...fd},"day-short-month-year-long-time-24":{...fg,...gg},"long-date":mg,"long-date-short-time":{...mg,...Xu},"long-date-short-time-24":{...mg,...yg},"long-date-long-time":{...mg,...fd},"long-date-long-time-24":{...mg,...gg},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":Xu,"long-time":fd},HQ=Bn()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"}),Bz={ar:"ar-u-nu-latn-ca-gregory"};let OE=new WeakMap;const Nx=Fz["short-date-short-time"];function WQ(e){let t=OE.get(e);if(!t){const i=wo(),r=Bz[i]||i,s=l3(e.timeZone??Dl),n={...e,timeZone:s};t=new Intl.DateTimeFormat(r,n),OE.set(e,t)}return t}function Qge(e){return Fz[e]}function a3(e,t=Nx){return WQ(t).format(e)}function e0e(e,t=Nx){return a3(new Date(e),{...t,...Nz,...qQ})}function t0e(e,t=Nx){return a3(new Date(`1970-01-01T${e}Z`),{...t,...Nz,...GQ})}function i0e(e,t=Nx){if(t.timeZone)return a3(new Date(e),t);const i=Jt.fromISO(e,{setZone:!0}),r=wo(),s=Bz[r]??r,n=i.offset===0?K0:t.timeZone,c={...t,timeZone:n};return i.toLocaleString(c,{locale:s})}function l3(e){switch(e){case Dl:return DQ;case o3:return K0;default:return e}}$A(()=>{OE=new WeakMap});const ZQ={ar:"ar-u-nu-latn"};let Qv=new WeakMap,Uz={};function YQ(e){const t=e||Uz;if(!Qv.has(t)){const i=wo(),r=ZQ[wo()]||i;Qv.set(t,new Intl.NumberFormat(r,e))}return Qv.get(t)}function r0e(e={}){const t={};return e.digitSeparator!=null&&(t.useGrouping=e.digitSeparator),e.places!=null&&(t.minimumFractionDigits=t.maximumFractionDigits=e.places),t}function s0e(e,t){return Object.is(e,-0)&&(e=0),YQ(t).format(e)}$A(()=>{Qv=new WeakMap,Uz={}});async function JQ(e,t,i,r){const s=t.exec(i);if(!s)throw new Je("esri-intl:invalid-bundle",`Bundle id "${i}" is not compatible with the pattern "${t}"`);const n=s[1]?`${s[1]}/`:"",c=s[2],o=nZ(r),f=`${n}${c}.json`,g=o?`${n}${c}_${o}.json`:f;let S;try{S=await Dk(e(g))}catch(I){if(g===f)throw new Je("intl:unknown-bundle",`Bundle "${i}" cannot be loaded`,{error:I});try{S=await Dk(e(f))}catch(A){throw new Je("intl:unknown-bundle",`Bundle "${i}" cannot be loaded`,{error:A})}}return S}async function Dk(e){if(Nk.fetchBundleAsset!=null)return Nk.fetchBundleAsset(e);const t=await Qi(e,{responseType:"text"});return JSON.parse(t.data)}let KQ=class{constructor({base:t="",pattern:i,location:r=new URL(window.location.href)}){let s;s=typeof r=="string"?n=>new URL(n,new URL(r,window.location.href)).href:r instanceof URL?n=>new URL(n,r).href:r,this.pattern=typeof i=="string"?new RegExp(`^${i}`):i,this.getAssetUrl=s,t=t?t.endsWith("/")?t:t+"/":"",this.matcher=new RegExp(`^${t}(?:(.*)/)?(.*)$`)}fetchMessageBundle(t,i){return JQ(this.getAssetUrl,this.matcher,t,i)}};function XQ(e){return new KQ(e)}const Nk={};sZ(XQ({pattern:"esri/",location:Ri}));const QQ={};function eee(e){var i;const t={async:e.async,isDebug:e.isDebug,locale:e.locale,baseUrl:e.baseUrl,has:{...e.has},map:{...e.map},packages:((i=e.packages)==null?void 0:i.concat())||[],paths:{...e.paths}};return e.hasOwnProperty("async")||(t.async=!0),e.hasOwnProperty("isDebug")||(t.isDebug=!1),e.baseUrl||(t.baseUrl=QQ.baseUrl),t}let tee=class{constructor(){const t=document.createDocumentFragment();["addEventListener","dispatchEvent","removeEventListener"].forEach(i=>{this[i]=(...r)=>t[i](...r)})}},eb=class{constructor(){this._dispatcher=new tee,this._workerPostMessage({type:$s.HANDSHAKE})}terminate(){}get onmessage(){return this._onmessageHandler}set onmessage(t){this._onmessageHandler&&this.removeEventListener("message",this._onmessageHandler),this._onmessageHandler=t,t&&this.addEventListener("message",t)}get onmessageerror(){return this._onmessageerrorHandler}set onmessageerror(t){this._onmessageerrorHandler&&this.removeEventListener("messageerror",this._onmessageerrorHandler),this._onmessageerrorHandler=t,t&&this.addEventListener("messageerror",t)}get onerror(){return this._onerrorHandler}set onerror(t){this._onerrorHandler&&this.removeEventListener("error",this._onerrorHandler),this._onerrorHandler=t,t&&this.addEventListener("error",t)}postMessage(t){Yb(()=>{this._workerMessageHandler(new MessageEvent("message",{data:t}))})}dispatchEvent(t){return this._dispatcher.dispatchEvent(t)}addEventListener(t,i,r){this._dispatcher.addEventListener(t,i,r)}removeEventListener(t,i,r){this._dispatcher.removeEventListener(t,i,r)}_workerPostMessage(t){Yb(()=>{this.dispatchEvent(new MessageEvent("message",{data:t}))})}async _workerMessageHandler(t){const i=Y0(t);if(i&&i.type===$s.OPEN){const{modulePath:r,jobId:s}=i;let n=await _h.loadWorker(r);n||(n=await ht(()=>import(r),[]));const c=_h.connect(n);this._workerPostMessage({type:$s.OPENED,jobId:s,data:c})}}};const LE=()=>_t.getLogger("esri.core.workers.workerFactory"),{HANDSHAKE:iee}=$s,ree='let globalId=0;const outgoing=new Map,configuration=JSON.parse("{CONFIGURATION}");self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}function invokeStaticMessage(e,o,r){const t=r&&r.signal,n=globalId++;return new Promise(((r,s)=>{if(t){if(t.aborted)return s(createAbortError());t.addEventListener("abort",(()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:ABORT,jobId:n}),s(createAbortError()))}))}outgoing.set(n,{resolve:r,reject:s}),self.postMessage({type:INVOKE,jobId:n,methodName:e,abortable:null!=t,data:o})}))}let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,fullVersion:r}=configuration.kernelInfo,{revision:t,fullVersion:n,version:s}=e.kernelInfo;esriConfig.assetsPath!==esriConfig.defaultAssetsPath&&o!==t&&console.warn(`Version mismatch detected between ArcGIS Maps SDK for JavaScript modules and assets. For more information visit https://bit.ly/3QnsuSo.\\nModules version: ${r}\\nAssets version: ${n??s}\\nAssets path: ${esriConfig.assetsPath}`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case OPEN:let n;function t(e){const o=n.connect(e);self.postMessage({type:OPENED,jobId:r,data:o},[o])}"function"==typeof define&&define.amd?require([workerPath],(e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then((e=>e||new Promise((e=>{require([o.modulePath],e)})))).then(t)})):"System"in self&&"function"==typeof System.import?System.import(workerPath).then((e=>(n=e.default,checkWorkerRevision(n),n.loadWorker(o.modulePath)))).then((e=>e||System.import(o.modulePath))).then(t):esriConfig.workers.useDynamicImport?import(workerPath).then((e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then((e=>e||import(o.modulePath))).then(t)})):(self.RemoteClient||importScripts(workerPath),n=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(n),n.loadWorker(o.modulePath).then(t));break;case RESPONSE:if(outgoing.has(r)){const s=outgoing.get(r);outgoing.delete(r),o.error?s.reject(JSON.parse(o.error)):s.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});';let hv,dv;const zk="Failed to create Worker. Fallback to execute module in main thread";async function see(){if(!Le("esri-workers"))return Fk(new eb);if(!hv&&!dv)try{const t=ree.split('"{CONFIGURATION}"').join(`'${nee()}'`);hv=URL.createObjectURL(new Blob([t],{type:"text/javascript"}))}catch(t){dv=t||{}}let e;if(hv)try{e=new Worker(hv,{name:"esri-worker-"+oee++})}catch{LE().warn(zk,dv),e=new eb}else LE().warn(zk,dv),e=new eb;return Fk(e)}async function Fk(e){return new Promise(t=>{function i(s){const n=Y0(s);n&&n.type===iee&&(e.removeEventListener("message",i),e.removeEventListener("error",r),t(e))}function r(s){s.preventDefault(),e.removeEventListener("message",i),e.removeEventListener("error",r),LE().warn("Failed to create Worker. Fallback to execute module in main thread",s),(e=new eb).addEventListener("message",i),e.addEventListener("error",r)}e.addEventListener("message",i),e.addEventListener("error",r)})}function nee(){let e;if(Ci.default!=null){const s={...Ci};delete s.default,e=JSON.parse(JSON.stringify(s))}else e=JSON.parse(JSON.stringify(Ci));e.assetsPath=Xo(e.assetsPath),e.defaultAssetsPath=e.defaultAssetsPath?Xo(e.defaultAssetsPath):void 0,e.request.interceptors=[],e.log.interceptors=[],e.locale=wo(),e.has={"esri-csp-restrictions":Le("esri-csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":Le("esri-2d-update-debug"),"esri-2d-log-updating":Le("esri-2d-log-updating"),"featurelayer-pbf":Le("featurelayer-pbf"),"featurelayer-fast-triangulation-enabled":Le("featurelayer-fast-triangulation-enabled"),"featurelayer-simplify-thresholds":Le("featurelayer-simplify-thresholds"),"featurelayer-simplify-payload-size-factors":Le("featurelayer-simplify-payload-size-factors"),"featurelayer-simplify-mobile-factor":Le("featurelayer-simplify-mobile-factor"),"featurelayer-query-max-depth":Le("featurelayer-query-max-depth"),"featurelayer-query-pausing-enabled":Le("featurelayer-query-pausing-enabled"),"featurelayer-snapshot-enabled":Le("featurelayer-snapshot-enabled"),"esri-atomics":Le("esri-atomics"),"esri-shared-array-buffer":Le("esri-shared-array-buffer"),"esri-tiles-debug":Le("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":Le("esri-workers-arraybuffer-transfer"),"feature-polyline-generalization-factor":Le("feature-polyline-generalization-factor"),"host-webworker":1},e.workers.loaderUrl&&(e.workers.loaderUrl=Xo(e.workers.loaderUrl)),e.workers.workerPath?e.workers.workerPath=Xo(e.workers.workerPath):e.workers.workerPath=Xo(Ri("esri/core/workers/RemoteClient.js")),e.workers.useDynamicImport=!1;const t=Ci.workers.loaderConfig,i=eee({baseUrl:t==null?void 0:t.baseUrl,locale:wo(),has:{"csp-restrictions":1,"dojo-test-sniff":0,"host-webworker":1,...t==null?void 0:t.has},map:{...t==null?void 0:t.map},paths:{...t==null?void 0:t.paths},packages:(t==null?void 0:t.packages)||[]});return JSON.stringify({esriConfig:e,loaderConfig:i,kernelInfo:{buildDate:U4,fullVersion:vA,revision:j4}})}let oee=0;const{ABORT:Bk,INVOKE:aee,OPEN:lee,OPENED:cee,RESPONSE:_g}=$s;let uee=class jz{static async create(t){const i=await see();return new jz(i,t)}constructor(t,i){this._outJobs=new Map,this._inJobs=new Map,this.worker=t,this.id=i,t.addEventListener("message",this._onMessage.bind(this)),t.addEventListener("error",r=>{r.preventDefault(),_t.getLogger("esri.core.workers.WorkerOwner").error(r)})}terminate(){this.worker.terminate()}async open(t,i={}){const{signal:r}=i,s=D6();return new Promise((n,c)=>{const o={resolve:n,reject:c,abortHandle:iA(r,()=>{this._outJobs.delete(s),this._post({type:Bk,jobId:s})})};this._outJobs.set(s,o),this._post({type:lee,jobId:s,modulePath:t})})}_onMessage(t){const i=Y0(t);if(i)switch(i.type){case cee:this._onOpenedMessage(i);break;case _g:this._onResponseMessage(i);break;case Bk:this._onAbortMessage(i);break;case aee:this._onInvokeMessage(i)}}_onAbortMessage(t){const i=this._inJobs,r=t.jobId,s=i.get(r);s&&(s.controller&&s.controller.abort(),i.delete(r))}_onInvokeMessage(t){const{methodName:i,jobId:r,data:s,abortable:n}=t,c=n?new AbortController:null,o=this._inJobs,f=DK[i];let g;try{if(typeof f!="function")throw new TypeError(`${i} is not a function`);g=f.call(null,s,{signal:c?c.signal:null})}catch(S){return void this._post({type:_g,jobId:r,error:Z0(S)})}xh(g)?(o.set(r,{controller:c,promise:g}),g.then(S=>{o.has(r)&&(o.delete(r),this._post({type:_g,jobId:r},S))},S=>{o.has(r)&&(o.delete(r),S||(S={message:"Error encountered at method"+i}),Ys(S)||this._post({type:_g,jobId:r,error:Z0(S||{message:`Error encountered at method ${i}`})}))})):this._post({type:_g,jobId:r},g)}_onOpenedMessage(t){const{jobId:i,data:r}=t,s=this._outJobs.get(i);s&&(this._outJobs.delete(i),Sr(s.abortHandle),s.resolve(r))}_onResponseMessage(t){const{jobId:i,error:r,data:s}=t,n=this._outJobs.get(i);n&&(this._outJobs.delete(i),Sr(n.abortHandle),r?n.reject(Je.fromJSON(JSON.parse(r))):n.resolve(s))}_post(t,i,r){return KA(this.worker,t,i,r)}};const Uk=Le("host-browser")?Math.min(navigator.hardwareConcurrency-1,Le("workers-pool-size")):0;let Jd=Le("esri-mobile")?Math.min(Uk,3):Uk;Jd||(Jd=Le("safari")&&Le("mac")?7:2);let jk=0;const tb=[];function hee(){Vz()}async function pv(e,t){const i=new LK,{registryTarget:r,...s}=t;return await i.open(e,s),r&&TK(r,i),i}async function l0e(e,t={}){if(typeof e!="string")throw new Je("workers:undefined-module","modulePath is missing");let i=t.strategy||"distributed";if(Le("host-webworker")&&!Le("esri-workers")&&(i="local"),i==="local"){let r=await _h.loadWorker(e);r||(r=await ht(()=>import(e),[])),mr(t.signal);const s=t.client||r;return pv([_h.connect(r)],{...t,client:s})}if(await Vz(),mr(t.signal),i==="dedicated"){const r=jk++%Jd;return pv([await tb[r].open(e,t)],t)}if(t.maxNumWorkers&&t.maxNumWorkers>0){const r=Math.min(t.maxNumWorkers,Jd);if(rr.open(e,t)),t)}let fv=null;async function Vz(){if(fv)return fv;new AbortController;const e=[];for(let t=0;t(tb[t]=r,r));e.push(i)}return fv=Promise.all(e),fv}const Su=Or.radius,xa=Or.eccentricitySquared,dee={a1:Su*xa,a2:Su*xa*Su*xa,a3:Su*xa*xa/2,a4:Su*xa*Su*xa*2.5,a5:Su*xa+Su*xa*xa/2,a6:1-xa};1/294.9786982,1/298.257222101,Or.radius,Or.flattening,1/298.257222101,ph.radius,ph.flattening,1/192.0430107526882,$l.radius,$l.flattening,1/10.2079945799458,1/43.61604095563141,$l.radius;var be;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.SPHERICAL_ECEF=1]="SPHERICAL_ECEF",e[e.WGS84=2]="WGS84",e[e.WEB_MERCATOR=3]="WEB_MERCATOR",e[e.WGS84_ECEF=4]="WGS84_ECEF",e[e.CGCS2000=5]="CGCS2000",e[e.WGS84_COMPARABLE_LON_LAT=6]="WGS84_COMPARABLE_LON_LAT",e[e.SPHERICAL_MARS_PCPF=7]="SPHERICAL_MARS_PCPF",e[e.GCSMARS2000=8]="GCSMARS2000",e[e.SPHERICAL_MOON_PCPF=9]="SPHERICAL_MOON_PCPF",e[e.GCSMOON2000=10]="GCSMOON2000",e[e.LON_LAT=11]="LON_LAT",e[e.PLATE_CARREE=12]="PLATE_CARREE"})(be||(be={}));const Gz={[be.WGS84]:{[be.CGCS2000]:null,[be.GCSMARS2000]:null,[be.GCSMOON2000]:null,[be.LON_LAT]:Wi,[be.WGS84_COMPARABLE_LON_LAT]:Wi,[be.SPHERICAL_ECEF]:sm,[be.SPHERICAL_MARS_PCPF]:null,[be.SPHERICAL_MOON_PCPF]:null,[be.UNKNOWN]:null,[be.WEB_MERCATOR]:X0,[be.PLATE_CARREE]:Kd,[be.WGS84]:Wi,[be.WGS84_ECEF]:ep},[be.CGCS2000]:{[be.CGCS2000]:Wi,[be.GCSMARS2000]:null,[be.GCSMOON2000]:null,[be.LON_LAT]:Wi,[be.WGS84_COMPARABLE_LON_LAT]:Wi,[be.SPHERICAL_ECEF]:sm,[be.SPHERICAL_MARS_PCPF]:null,[be.SPHERICAL_MOON_PCPF]:null,[be.UNKNOWN]:null,[be.WEB_MERCATOR]:null,[be.PLATE_CARREE]:Kd,[be.WGS84]:null,[be.WGS84_ECEF]:ep},[be.GCSMARS2000]:{[be.CGCS2000]:null,[be.GCSMARS2000]:Wi,[be.GCSMOON2000]:null,[be.LON_LAT]:Wi,[be.WGS84_COMPARABLE_LON_LAT]:null,[be.SPHERICAL_ECEF]:null,[be.SPHERICAL_MARS_PCPF]:Gk,[be.SPHERICAL_MOON_PCPF]:null,[be.UNKNOWN]:null,[be.WEB_MERCATOR]:null,[be.PLATE_CARREE]:null,[be.WGS84]:null,[be.WGS84_ECEF]:null},[be.GCSMOON2000]:{[be.CGCS2000]:null,[be.GCSMARS2000]:null,[be.GCSMOON2000]:Wi,[be.LON_LAT]:Wi,[be.WGS84_COMPARABLE_LON_LAT]:null,[be.SPHERICAL_ECEF]:null,[be.SPHERICAL_MARS_PCPF]:null,[be.SPHERICAL_MOON_PCPF]:Vk,[be.UNKNOWN]:null,[be.WEB_MERCATOR]:null,[be.PLATE_CARREE]:null,[be.WGS84]:null,[be.WGS84_ECEF]:null},[be.WEB_MERCATOR]:{[be.CGCS2000]:null,[be.GCSMARS2000]:null,[be.GCSMOON2000]:null,[be.LON_LAT]:x0,[be.WGS84_COMPARABLE_LON_LAT]:x0,[be.SPHERICAL_ECEF]:fee,[be.SPHERICAL_MARS_PCPF]:null,[be.SPHERICAL_MOON_PCPF]:null,[be.UNKNOWN]:null,[be.WEB_MERCATOR]:Wi,[be.PLATE_CARREE]:gee,[be.WGS84]:x0,[be.WGS84_ECEF]:mee},[be.WGS84_ECEF]:{[be.CGCS2000]:tp,[be.GCSMARS2000]:null,[be.GCSMOON2000]:null,[be.LON_LAT]:tp,[be.WGS84_COMPARABLE_LON_LAT]:tp,[be.SPHERICAL_ECEF]:Mee,[be.SPHERICAL_MARS_PCPF]:null,[be.SPHERICAL_MOON_PCPF]:null,[be.UNKNOWN]:null,[be.WEB_MERCATOR]:Iee,[be.PLATE_CARREE]:_ee,[be.WGS84]:tp,[be.WGS84_ECEF]:Wi},[be.SPHERICAL_ECEF]:{[be.CGCS2000]:Qd,[be.GCSMARS2000]:null,[be.GCSMOON2000]:null,[be.LON_LAT]:Qd,[be.WGS84_COMPARABLE_LON_LAT]:Qd,[be.SPHERICAL_ECEF]:Wi,[be.SPHERICAL_MARS_PCPF]:null,[be.SPHERICAL_MOON_PCPF]:null,[be.UNKNOWN]:null,[be.WEB_MERCATOR]:See,[be.PLATE_CARREE]:vee,[be.WGS84]:Qd,[be.WGS84_ECEF]:Tee},[be.SPHERICAL_MARS_PCPF]:{[be.CGCS2000]:null,[be.GCSMARS2000]:Hk,[be.GCSMOON2000]:null,[be.LON_LAT]:Hk,[be.WGS84_COMPARABLE_LON_LAT]:null,[be.SPHERICAL_ECEF]:null,[be.SPHERICAL_MARS_PCPF]:Wi,[be.SPHERICAL_MOON_PCPF]:null,[be.UNKNOWN]:null,[be.WEB_MERCATOR]:null,[be.PLATE_CARREE]:null,[be.WGS84]:null,[be.WGS84_ECEF]:null},[be.SPHERICAL_MOON_PCPF]:{[be.CGCS2000]:null,[be.GCSMARS2000]:null,[be.GCSMOON2000]:qk,[be.LON_LAT]:qk,[be.WGS84_COMPARABLE_LON_LAT]:null,[be.SPHERICAL_ECEF]:null,[be.SPHERICAL_MARS_PCPF]:null,[be.SPHERICAL_MOON_PCPF]:Wi,[be.UNKNOWN]:null,[be.WEB_MERCATOR]:null,[be.PLATE_CARREE]:null,[be.WGS84]:null,[be.WGS84_ECEF]:null},[be.UNKNOWN]:{[be.CGCS2000]:null,[be.GCSMARS2000]:null,[be.GCSMOON2000]:null,[be.LON_LAT]:null,[be.WGS84_COMPARABLE_LON_LAT]:null,[be.SPHERICAL_ECEF]:null,[be.SPHERICAL_MARS_PCPF]:null,[be.SPHERICAL_MOON_PCPF]:null,[be.UNKNOWN]:Wi,[be.WEB_MERCATOR]:null,[be.PLATE_CARREE]:null,[be.WGS84]:null,[be.WGS84_ECEF]:null},[be.LON_LAT]:{[be.CGCS2000]:Wi,[be.GCSMARS2000]:Wi,[be.GCSMOON2000]:Wi,[be.LON_LAT]:Wi,[be.WGS84_COMPARABLE_LON_LAT]:Wi,[be.SPHERICAL_ECEF]:sm,[be.SPHERICAL_MARS_PCPF]:Gk,[be.SPHERICAL_MOON_PCPF]:Vk,[be.UNKNOWN]:null,[be.WEB_MERCATOR]:X0,[be.PLATE_CARREE]:Kd,[be.WGS84]:Wi,[be.WGS84_ECEF]:ep},[be.WGS84_COMPARABLE_LON_LAT]:{[be.CGCS2000]:null,[be.GCSMARS2000]:null,[be.GCSMOON2000]:null,[be.LON_LAT]:Wi,[be.WGS84_COMPARABLE_LON_LAT]:Wi,[be.SPHERICAL_ECEF]:sm,[be.SPHERICAL_MARS_PCPF]:null,[be.SPHERICAL_MOON_PCPF]:null,[be.UNKNOWN]:null,[be.WEB_MERCATOR]:null,[be.PLATE_CARREE]:Kd,[be.WGS84]:Wi,[be.WGS84_ECEF]:ep},[be.PLATE_CARREE]:{[be.CGCS2000]:Xd,[be.GCSMARS2000]:null,[be.GCSMOON2000]:null,[be.LON_LAT]:Xd,[be.WGS84_COMPARABLE_LON_LAT]:Xd,[be.SPHERICAL_ECEF]:bee,[be.SPHERICAL_MARS_PCPF]:null,[be.SPHERICAL_MOON_PCPF]:null,[be.UNKNOWN]:null,[be.WEB_MERCATOR]:wee,[be.PLATE_CARREE]:Wi,[be.WGS84]:Xd,[be.WGS84_ECEF]:xee}};function pee(e){const t=DE(e,Pee);return Gz[t][be.WGS84_COMPARABLE_LON_LAT]}function qz(e,t,i=Hz()){return e==null||t==null?null:Aee(e,t,i).projector}function DE(e,t){return e?t.spatialReference===e?t.spatialReferenceId:(t.spatialReference=e,"metersPerUnit"in t&&(t.metersPerUnit=$p(e,1)),yw(e)?t.spatialReferenceId=be.SPHERICAL_ECEF:G0(e)?t.spatialReferenceId=be.WGS84:gp(e)?t.spatialReferenceId=be.WEB_MERCATOR:eW(e)?t.spatialReferenceId=be.PLATE_CARREE:e.wkt===sW.wkt?t.spatialReferenceId=be.WGS84_ECEF:e.wkid===yp.CGCS2000?t.spatialReferenceId=be.CGCS2000:e.wkt===AA.wkt?t.spatialReferenceId=be.SPHERICAL_MARS_PCPF:e.wkt===PA.wkt?t.spatialReferenceId=be.SPHERICAL_MOON_PCPF:sN(e)?t.spatialReferenceId=be.GCSMARS2000:nN(e)?t.spatialReferenceId=be.GCSMOON2000:t.spatialReferenceId=be.UNKNOWN):be.UNKNOWN}function Wi(e,t,i,r){e!==i&&(i[r++]=e[t++],i[r++]=e[t++],i[r]=e[t])}function x0(e,t,i,r){i[r]=Lm*(e[t]/lp),i[r+1]=Lm*(Zz-2*Math.atan(Math.exp(-e[t+1]/lp))),i[r+2]=e[t+2]}function fee(e,t,i,r){const s=e[t]/lp,n=Zz-2*Math.atan(Math.exp(-e[t+1]/lp)),c=lp+e[t+2],o=Math.cos(n)*c;i[r]=Math.cos(s)*o,i[r+1]=Math.sin(s)*o,i[r+2]=Math.sin(n)*c}function mee(e,t,i,r){x0(e,t,i,r),ep(i,r,i,r)}function yee(e,t,i,r,s){const n=.4999999*zx,c=Ll(Om*e[t+1],-n,n),o=Math.sin(c);i[r++]=Om*e[t]*s.radius,i[r++]=s.halfSemiMajorAxis*Math.log((1+o)/(1-o)),i[r]=e[t+2]}function X0(e,t,i,r){yee(e,t,i,r,Or)}function Kd(e,t,i,r){i[r]=e[t]*Wk,i[r+1]=e[t+1]*Wk,i[r+2]=e[t+2]}function Xd(e,t,i,r){i[r]=e[t]*Zk,i[r+1]=e[t+1]*Zk,i[r+2]=e[t+2]}function gee(e,t,i,r){x0(e,t,i,r),Kd(i,r,i,r)}function _ee(e,t,i,r){tp(e,t,i,r),Kd(i,r,i,r)}function vee(e,t,i,r){Qd(e,t,i,r),Kd(i,r,i,r)}function bee(e,t,i,r){Xd(e,t,i,r),sm(i,r,i,r)}function wee(e,t,i,r){Xd(e,t,i,r),X0(i,r,i,r)}function xee(e,t,i,r){Xd(e,t,i,r),ep(i,r,i,r)}function c3(e,t,i,r,s){const n=s+e[t+2],c=Om*e[t+1],o=Om*e[t],f=Math.cos(c)*n;i[r]=Math.cos(o)*f,i[r+1]=Math.sin(o)*f,i[r+2]=Math.sin(c)*n}function Vk(e,t,i,r){c3(e,t,i,r,ph.radius)}function Gk(e,t,i,r){c3(e,t,i,r,$l.radius)}function sm(e,t,i,r){c3(e,t,i,r,Or.radius)}function u3(e,t,i,r,s){const n=e[t],c=e[t+1],o=e[t+2],f=Math.sqrt(n*n+c*c+o*o),g=FN(o/(f===0?1:f)),S=Math.atan2(c,n);i[r++]=Lm*S,i[r++]=Lm*g,i[r]=f-s}function qk(e,t,i,r){u3(e,t,i,r,ph.radius)}function Hk(e,t,i,r){u3(e,t,i,r,$l.radius)}function Qd(e,t,i,r){u3(e,t,i,r,Or.radius)}function See(e,t,i,r){Qd(e,t,i,r),X0(i,r,i,r)}function Tee(e,t,i,r){Qd(e,t,i,r),ep(i,r,i,r)}function Eee(e,t,i,r,s){const n=Om*e[t],c=Om*e[t+1],o=e[t+2],f=Math.sin(c),g=Math.cos(c),S=s.radius/Math.sqrt(1-s.eccentricitySquared*f*f);i[r++]=(S+o)*g*Math.cos(n),i[r++]=(S+o)*g*Math.sin(n),i[r++]=(S*(1-s.eccentricitySquared)+o)*f}function ep(e,t,i,r){Eee(e,t,i,r,Or)}function tp(e,t,i,r){const s=dee,n=e[t],c=e[t+1],o=e[t+2];let f,g,S,I,A,O,z,V,H,Q,ve,me,ge,Ie,Ce,ze,je,tt,ut,ot,et;f=Math.abs(o),g=n*n+c*c,S=Math.sqrt(g),I=g+o*o,A=Math.sqrt(I),ot=Math.atan2(c,n),O=o*o/I,z=g/I,Ie=s.a2/A,Ce=s.a3-s.a4/A,z>.3?(V=f/A*(1+z*(s.a1+Ie+O*Ce)/A),ut=Math.asin(V),Q=V*V,H=Math.sqrt(1-Q)):(H=S/A*(1-O*(s.a5-Ie-z*Ce)/A),ut=Math.acos(H),Q=1-H*H,V=Math.sqrt(Q)),ve=1-Or.eccentricitySquared*Q,me=Or.radius/Math.sqrt(ve),ge=s.a6*me,Ie=S-me*H,Ce=f-ge*V,je=H*Ie+V*Ce,ze=H*Ce-V*Ie,tt=ze/(ge/ve+je),ut+=tt,et=je+ze*tt/2,o<0&&(ut=-ut),i[r++]=Lm*ot,i[r++]=Lm*ut,i[r]=et}function Mee(e,t,i,r){tp(e,t,i,r),sm(i,r,i,r)}function Iee(e,t,i,r){tp(e,t,i,r),X0(i,r,i,r)}function Aee(e,t,i){if(e==null||t==null||i.source.spatialReference===e&&i.dest.spatialReference===t)return i;const r=DE(e,i.source),s=DE(t,i.dest);return r===be.UNKNOWN&&s===be.UNKNOWN?Js(e,t)?i.projector=Wi:i.projector=null:i.projector=Gz[r][s],i}function Hz(){return{source:{spatialReference:null,spatialReferenceId:be.UNKNOWN,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:be.UNKNOWN,metersPerUnit:1},projector:Wi}}const Pee={spatialReference:null,spatialReferenceId:be.UNKNOWN},c0e={spatialReference:null,spatialReferenceId:be.UNKNOWN},Wz=Hz(),Om=NN(1),Lm=zN(1),zx=Math.PI,Zz=.5*zx,lp=Or.radius,Wk=lp*zx/180,Zk=180/(lp*zx);function T_(e,t,i,r,s,n,c=1){const o=qz(t,s,Wz);if(o==null)return!1;if(o===Wi){if(e===r&&i===n)return!0;const g=i+3*c;for(let S=i,I=n;S=0;i--){const r=this.steps[i];t.steps.push(r.getInverse())}return t}getGTListEntry(){let t="";for(const i of this.steps)t+=i.uid.toString()+",";return t!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=t),this._gtlistentry}assignCachedGe(t,i,r){this._cachedProjection[$g.cacheKey(t,i)]=r}getCachedGeTransformation(t,i){let r="";for(const n of this.steps)r+=n.uid.toString()+",";r!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=r);const s=this._cachedProjection[$g.cacheKey(t,i)];return s===void 0?null:s}};function Cee(e,t,i){if(t==null||i==null||i.vcsWkid||Js(t,i)||fh(t)||fh(i))return null;const r=C$(t)/C$(i);if(r===1)return null;switch(e){case"point":case"esriGeometryPoint":return s=>$ee(s,r);case"polyline":case"esriGeometryPolyline":return s=>Ree(s,r);case"polygon":case"esriGeometryPolygon":return s=>kee(s,r);case"multipoint":case"esriGeometryMultipoint":return s=>Oee(s,r);case"extent":case"esriGeometryEnvelope":return s=>Lee(s,r);default:return null}}function $ee(e,t){(e==null?void 0:e.z)!=null&&(e.z*=t)}function kee(e,t){if(e)for(const i of e.rings)for(const r of i)r.length>2&&(r[2]*=t)}function Ree(e,t){if(e)for(const i of e.paths)for(const r of i)r.length>2&&(r[2]*=t)}function Oee(e,t){if(e)for(const i of e.points)i.length>2&&(i[2]*=t)}function Lee(e,t){e&&e.zmin!=null&&e.zmax!=null&&(e.zmin*=t,e.zmax*=t)}let qa=null,vh=null,S0=null,ib={};const h3=new g_;function Ah(){return!!qa&&EA()}function Yz(){return!!Ah()||(Rt(h3),bh(),!1)}function Jz(e,t){return!e||!t||Nl(e,t)||Yz()}function Dee(e,t){return!Nl(e,t)&&!Ah()}function bh(e){return S0==null&&(S0=Promise.all([X4(),ht(()=>import("./geometryEngineBase-C5__2Su1.js"),[]).then(t=>t.g),ht(()=>import("./hydrated-CcIo9KoC.js"),[])])),S0.then(([,t,{hydratedAdapter:i}])=>{mr(e),vh=i,qa=t.default,qa._enableProjection(JH),h3.notify()})}function Ph(e,t,i=null,r=null){return Array.isArray(e)?e.length===0?[]:zE(vh,e,e[0].spatialReference,t,i,r):zE(vh,[e],e.spatialReference,t,i,r)[0]}function zE(e,t,i,r,s=null,n=null){if(i==null||r==null)return t;if(Nl(i,r,s))return t.map(c=>rb(c,i,r));if(s==null&&yw(i))return t.map(c=>rb(c,i,yi.WGS84)).map(c=>Q0(c,r));if(s==null&&yw(r))return t.map(c=>Q0(c,yi.WGS84)).map(c=>rb(c,yi.WGS84,r));if(s==null){const c=Aw.cacheKey(i,r);ib[c]!==void 0?s=ib[c]:((s=Xz(i,r,void 0))==null&&(s=new Aw),ib[c]=s)}if(qa==null||e==null)throw new Fx;return n!=null?qa._project(e,t,i,r,s,n):qa._project(e,t,i,r,s)}function Nee(e,t){const i=Kz([e],t);return i.pending!=null?{pending:i.pending,geometry:null}:i.geometries!=null?{pending:null,geometry:i.geometries[0]}:{pending:null,geometry:null}}function Kz(e,t){if(!Ah()){for(const i of e)if(i!=null&&!Js(i.spatialReference,t)&&Ba(i.spatialReference)&&Ba(t)&&!Nl(i.spatialReference,t))return Rt(h3),{pending:bh(),geometries:null}}return{pending:null,geometries:e.map(i=>i==null?null:Js(i.spatialReference,t)?i:Ba(i.spatialReference)&&Ba(t)?Q0(i,t):null)}}function Xz(e,t,i=null){if(e==null||t==null)return null;if(qa==null||vh==null)throw new Fx;const r=qa._getTransformation(vh,e,t,i,i==null?void 0:i.spatialReference);return r!==null?Aw.fromGE(r):null}function zee(e,t,i=null){if(qa==null||vh==null)throw new Fx;const r=qa._getTransformationBySuitability(vh,e,t,i,i==null?void 0:i.spatialReference);if(r!==null){const s=[];for(const n of r)s.push(Aw.fromGE(n));return s}return[]}let Fx=class extends Je{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}};function Fee(){qa=null,vh=null,S0=null,ib={}}const Bee={get loadPromise(){return S0}};function Q0(e,t){try{const i=Ph(e,t);if(i==null)return null;"xmin"in e&&"xmin"in i&&(i.zmin=e.zmin,i.zmax=e.zmax);const r=Cee(i.type,e.spatialReference,t);return r!=null&&r(i),i}catch(i){if(!(i instanceof Fx))throw i;return null}}async function Uee(e,t,i){const r=e.spatialReference;return r!=null&&t!=null&&await d3(r,t,null,i),Q0(e,t)}function Nl(e,t,i){return!i&&(!!Js(e,t)||Ba(e)&&Ba(t)&&!!qz(e,t,Wz))}async function d3(e,t,i,r){if(Ah())return Jb(r);if(Array.isArray(e)){for(const{source:s,dest:n,geographicTransformation:c}of e)if(s&&n&&!Nl(s,n,c))return bh(r)}else if(e&&t&&!Nl(e,t,i))return bh(r);return Jb(r)}function rb(e,t,i){return e?"x"in e?Qz(e,t,new ri,i,0):"xmin"in e?rF(e,t,new Ui,i,0):"rings"in e?iF(e,t,new yh,i,0):"paths"in e?tF(e,t,new Ua,i,0):"points"in e?eF(e,t,new Px,i,0):null:null}function jee(e,t,i=t.spatialReference,r=0){return i!=null&&e.spatialReference!=null&&Qz(e,e.spatialReference,t,i,r)!=null}function Qz(e,t,i,r,s){fn[0]=e.x,fn[1]=e.y;const n=e.z;return fn[2]=n!==void 0?n:s,T_(fn,t,0,fn,r,0,1)?(i.x=fn[0],i.y=fn[1],i.spatialReference=r,n!==void 0||fh(r)?(i.z=fn[2],i.hasZ=!0):(i.z=void 0,i.hasZ=!1),e.m===void 0?(i.m=void 0,i.hasM=!1):(i.m=e.m,i.hasM=!0),i):null}function Vee(e,t,i=t.spatialReference,r=0){return e.spatialReference!=null&&i!=null&&eF(e,e.spatialReference,t,i,r)!=null}function eF(e,t,i,r,s){const{points:n,hasZ:c,hasM:o}=e,f=[],g=n.length,S=[];for(const A of n)S.push(A[0],A[1],c?A[2]:s);if(!T_(S,t,0,S,r,0,g))return null;const I=c||fh(r);for(let A=0;A=0;O--)I.unshift(new kc({level:O,scale:A,resolution:A})),A*=2}return new $u({dpi:96,lods:I,origin:new ri(0,0,s),size:[r,r],spatialReference:s})}const c=ro(s),o=e.origin?new ri({x:e.origin.x,y:e.origin.y,spatialReference:s}):new ri(c?{x:c.origin[0],y:c.origin[1],spatialReference:s}:{x:0,y:0,spatialReference:s}),f=96,g=1/($p(s)*39.37*f),S=[];if(i)for(let I=0;I{r.push(n.scale),t=n.scale>t?n.scale:t,i=n.scale=t.length-1)return t[t.length-1];const i=Math.floor(e),r=i+1;return t[i]/(t[i]/t[r])**(e-i)}scaleToZoom(e){const t=this.scales,i=t.length-1;let r=0;for(;re&&n=t?this.zoomToScale(Math.ceil(i)):this.zoomToScale(Math.floor(i))}tileAt(e,t,i,r){const s=this.lodAt(e);if(!s)return null;let n,c;if(typeof t=="number")n=t,c=i;else if(Js(t.spatialReference,this.spatialReference))n=t.x,c=t.y,r=i;else{const g=wx(t,this.spatialReference);if(g==null)return null;n=g.x,c=g.y,r=i}const o=s.resolution*this.size[0],f=s.resolution*this.size[1];return r||(r=new nF(null,0,0,0,eo())),r.level=e,r.row=Math.floor((this.origin.y-c)/f+.001),r.col=Math.floor((n-this.origin.x)/o+.001),this.updateTileInfo(r),r}updateTileInfo(e,t=$u.ExtrapolateOptions.NONE){let i=this.lodAt(e.level);if(!i&&t===$u.ExtrapolateOptions.POWER_OF_TWO){const c=this.lods[this.lods.length-1];c.levelArray.isArray(e)?e:typeof e=="number"?[e,e]:[256,256]})],qs.prototype,"size",void 0),v([mi("size",["rows","cols"])],qs.prototype,"readSize",null),v([ui("size",{cols:{type:$r},rows:{type:$r}})],qs.prototype,"writeSize",null),v([M({type:yi,json:{write:!0}})],qs.prototype,"spatialReference",void 0),qs=$u=v([fe("esri.layers.support.TileInfo")],qs),function(e){var t;(t=e.ExtrapolateOptions||(e.ExtrapolateOptions={}))[t.NONE=0]="NONE",t[t.POWER_OF_TWO=1]="POWER_OF_TWO"}(qs||(qs={}));const Ep=qs,sb={widthBreakpoint:{getValue(e){const t=e.viewSize[0],i=e.breakpoints,r=this.values;return t<=i.xsmall?r.xsmall:t<=i.small?r.small:t<=i.medium?r.medium:t<=i.large?r.large:r.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-width-xsmall esri-view-width-less-than-small esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",small:"esri-view-width-small esri-view-width-greater-than-xsmall esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",medium:"esri-view-width-medium esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-less-than-large esri-view-width-less-than-xlarge",large:"esri-view-width-large esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-less-than-xlarge",xlarge:"esri-view-width-xlarge esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-greater-than-large"}},heightBreakpoint:{getValue(e){const t=e.viewSize[1],i=e.breakpoints,r=this.values;return t<=i.xsmall?r.xsmall:t<=i.small?r.small:t<=i.medium?r.medium:t<=i.large?r.large:r.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-height-xsmall esri-view-height-less-than-small esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",small:"esri-view-height-small esri-view-height-greater-than-xsmall esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",medium:"esri-view-height-medium esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-less-than-large esri-view-height-less-than-xlarge",large:"esri-view-height-large esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-less-than-xlarge",xlarge:"esri-view-height-xlarge esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-greater-than-large"}},orientation:{getValue(e){const t=e.viewSize,i=t[0],r=t[1],s=this.values;return r>=i?s.portrait:s.landscape},values:{portrait:"portrait",landscape:"landscape"},valueToClassName:{portrait:"esri-view-orientation-portrait",landscape:"esri-view-orientation-landscape"}}},jS={xsmall:544,small:768,medium:992,large:1200};function Zee(e){const t=e;return t&&t.xsmall{let t=class extends e{constructor(...i){super(...i),this.orientation=null,this.widthBreakpoint=null,this.heightBreakpoint=null,this.breakpoints=jS}initialize(){this.addHandles(ti(()=>[this.breakpoints,this.size],()=>this._updateClassNames(),_n))}destroy(){this.destroyed||this._removeActiveClassNames()}set breakpoints(i){if(i===this._get("breakpoints"))return;const r=Zee(i);if(!r){const s=JSON.stringify(jS,null,2);console.warn("provided breakpoints are not valid, using defaults:"+s)}i=r?i:jS,this._set("breakpoints",{...i})}_updateClassNames(){if(!this.container)return;const i=kn.acquire(),r=kn.acquire();let s,n=!1;for(s in sb){const c=this[s],o=sb[s].getValue({viewSize:this.size,breakpoints:this.breakpoints});c!==o&&(n=!0,this[s]=o,VS(s,c).forEach(f=>r.push(f)),VS(s,o).forEach(f=>i.push(f)))}n&&(this._applyClassNameChanges(i,r),kn.release(i),kn.release(r))}_applyClassNameChanges(i,r){const s=this.container;s&&(r.forEach(n=>s.classList.remove(n)),i.forEach(n=>s.classList.add(n)))}_removeActiveClassNames(){const i=this.container;if(!i)return;let r;for(r in sb)VS(r,this[r]).forEach(s=>i.classList.remove(s))}};return v([M()],t.prototype,"breakpoints",null),v([M()],t.prototype,"orientation",void 0),v([M()],t.prototype,"widthBreakpoint",void 0),v([M()],t.prototype,"heightBreakpoint",void 0),t=v([fe("esri.views.BreakpointsOwner")],t),t};function p3(e){return typeof e=="string"?document.getElementById(e):e??null}function oF(e){for(;e.hasChildNodes();)e.removeChild(e.firstChild)}function Kk(e,t){const i=t.parentNode;i&&i.insertBefore(e,t)}function Xk(e,t){for(;;){const i=e.firstChild;if(!i)break;t.appendChild(i)}}let cp=class extends Nt{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll()}add(t,i,r={}){return this._installWatch(t,i,r,ti)}addWhen(t,i,r={}){return this._installWatch(t,i,r,gh)}addOnCollectionChange(t,i,{initial:r=!1,final:s=!1}={}){const n=++this._handleId;return this.addHandles([Sp(t,"after-changes",this._createSyncUpdatingCallback(),Tp),Sp(t,"change",i,{onListenerAdd:r?c=>i({added:c.toArray(),removed:[]}):void 0,onListenerRemove:s?c=>i({added:[],removed:c.toArray()}):void 0})],n),er(()=>this.removeHandles(n))}addPromise(t){if(t==null)return t;const i=++this._handleId;this.addHandles(er(()=>{this._pendingPromises.delete(t)&&(this._pendingPromises.size!==0||this.hasHandles(gv)||this._set("updating",!1))}),i),this._pendingPromises.add(t),this._set("updating",!0);const r=()=>this.removeHandles(i);return t.then(r,r),t}removeAll(){this._pendingPromises.clear(),this.removeAllHandles(),this._set("updating",!1)}_installWatch(t,i,r={},s){const n=++this._handleId;r.sync||this._installSyncUpdatingWatch(t,n);const c=s(t,i,r);return this.addHandles(c,n),er(()=>this.removeHandles(n))}_installSyncUpdatingWatch(t,i){const r=this._createSyncUpdatingCallback(),s=ti(t,r,{sync:!0,equals:()=>!1});return this.addHandles(s,i),s}_createSyncUpdatingCallback(){return()=>{this.removeHandles(gv),++this._scheduleHandleId;const t=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this.addHandles(m_(()=>{t===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this.removeHandles(gv))}),gv)}}};v([M({readOnly:!0})],cp.prototype,"updating",void 0),cp=v([fe("esri.core.support.UpdatingHandles")],cp);const gv=-42;/*! +]`},nW=AA.wkt.toUpperCase(),oW=PA.wkt.toUpperCase();function aW(e){if(e!=null&&Ba(e)){const t=e.wkid,i=e.wkt2??e.wkt;if(vx(t))return $l;const r=i==null?void 0:i.toUpperCase();if(i&&r===nW)return $l;if(bx(t)||r&&r===oW)return ph}return Or}function Wye(e){return vx(e)?$l:bx(e)?ph:Or}function yw(e){return Js(e,rW)}function fh(e){return yw(e)||Js(e,AA)||Js(e,PA)}const Zye=39.37,lW=Or.radius*Math.PI/200,oN=/(?:LENGTH)?UNIT\[([^\]]+)]]$/i,op=q,aN=/UNIT\[([^\]]+)]/i,cW=new Set([4261,4305,4807,4810,4811,4812,4816,4819,4821,4901,4902,37225,104139,104140]),uW=Bn()({meter:"meters",foot:"feet",foot_us:"us-feet",foot_clarke:"clarke-feet",yard_clarke:"clarke-yards",link_clarke:"clarke-links",yard_sears:"sears-yards",foot_sears:"sears-feet",chain_sears:"sears-chains",chain_benoit_1895_b:"benoit-1895-b-chains",yard_indian:"indian-yards",yard_indian_1937:"indian-1937-yards",foot_gold_coast:"gold-coast-feet",chain_sears_1922_truncated:"sears-1922-truncated-chains","50_kilometers":"50-kilometers","150_kilometers":"150-kilometers"}),ll=e=>e*e,vu=e=>e*e*e,q0={length:{baseUnit:"meters",units:{millimeters:{inBaseUnits:.001},centimeters:{inBaseUnits:.01},decimeters:{inBaseUnits:.1},meters:{inBaseUnits:1},kilometers:{inBaseUnits:1e3},inches:{inBaseUnits:.0254},feet:{inBaseUnits:.3048},yards:{inBaseUnits:.9144},miles:{inBaseUnits:1609.344},"nautical-miles":{inBaseUnits:1852},"us-feet":{inBaseUnits:1200/3937}}},area:{baseUnit:"square-meters",units:{"square-millimeters":{inBaseUnits:ll(.001)},"square-centimeters":{inBaseUnits:ll(.01)},"square-decimeters":{inBaseUnits:ll(.1)},"square-meters":{inBaseUnits:1},"square-kilometers":{inBaseUnits:ll(1e3)},"square-inches":{inBaseUnits:ll(.0254)},"square-feet":{inBaseUnits:ll(.3048)},"square-yards":{inBaseUnits:ll(.9144)},"square-miles":{inBaseUnits:ll(1609.344)},"square-us-feet":{inBaseUnits:ll(1200/3937)},acres:{inBaseUnits:.0015625*ll(1609.344)},ares:{inBaseUnits:100},hectares:{inBaseUnits:1e4}}},volume:{baseUnit:"liters",units:{liters:{inBaseUnits:1},"cubic-millimeters":{inBaseUnits:1e3*vu(.001)},"cubic-centimeters":{inBaseUnits:1e3*vu(.01)},"cubic-decimeters":{inBaseUnits:1e3*vu(.1)},"cubic-meters":{inBaseUnits:1e3},"cubic-kilometers":{inBaseUnits:1e3*vu(1e3)},"cubic-inches":{inBaseUnits:1e3*vu(.0254)},"cubic-feet":{inBaseUnits:1e3*vu(.3048)},"cubic-yards":{inBaseUnits:1e3*vu(.9144)},"cubic-miles":{inBaseUnits:1e3*vu(1609.344)}}},angle:{baseUnit:"radians",units:{radians:{inBaseUnits:1},degrees:{inBaseUnits:Math.PI/180}}}},hW=(()=>{const e={};for(const t in q0)for(const i in q0[t].units)e[i]=t;return e})();function dW(e,t,i){return e*q0[i].units[t].inBaseUnits}function pW(e,t,i){return e/q0[i].units[t].inBaseUnits}function aE(e){const t=hW[e];if(!t)throw new Error("unknown type");return t}function P$(e,t=null){return t=t||aE(e),q0[t].baseUnit===e}function Uo(e,t,i){if(t===i)return e;const r=aE(t);if(r!==aE(i))throw new Error("incompatible units");const s=P$(t,r)?e:dW(e,t,r);return P$(i,r)?s:pW(s,i,r)}function fW(e,t,i){return Uo(e,t,"meters")/(i*Math.PI/180)}function lN(e){return uW.fromJSON(e.toLowerCase())||null}function C$(e){if(e!=null&&!QH(e))return 1;const t=$p(e);return t>1e5?1:t}function mW(e){return $p(e)>=aW(e).metersPerDegree?"meters":uN(e)}function $p(e,t=Or.metersPerDegree){return yW(e,!0)??t}function yW(e,t=!1){const i=(e==null?void 0:e.wkid)??null,r=(e==null?void 0:e.wkt2)??(e==null?void 0:e.wkt)??null;let s=null;if(i){if(vx(i))return $l.metersPerDegree;if(bx(i))return ph.metersPerDegree;s=op.values[op[i]],!s&&t&&cW.has(i)&&(s=lW)}else r&&(dN(r)?s=$$(oN.exec(r),s):hN(r)&&(s=$$(aN.exec(r),s)));return s}function Yye(e){return MA(e)?1:$p(e)}function $$(e,t){return e!=null&&e[1]?cN(e[1]):t}function cN(e){return parseFloat(e.split(",")[1])}function uN(e){const t=(e==null?void 0:e.wkid)??null,i=(e==null?void 0:e.wkt2)??(e==null?void 0:e.wkt)??null;let r=null;if(t)r=op.units[op[t]];else if(i){const s=dN(i)?oN:hN(i)?aN:null;if(s){const n=s.exec(i);n!=null&&n[1]&&(r=_W(n[1]))}}return r!=null?lN(r):null}function hN(e){return/^GEOCCS/i.test(e)}function dN(e){return/^\s*(?:PROJCS|PROJCRS|PROJECTEDCRS)/i.test(e)}const gW=1e-7;function _W(e){const t=/[\\"']{1}([^\\"']+)/.exec(e);let i=t==null?void 0:t[1];if(!i||!op.units.includes(i)){const r=cN(e);i=null;const s=op.values;for(let n=0;n{const o=n.constructor.prototype;r.forEach(f=>{const g=f4(n,f,s);g.read&&typeof g.read=="object"||(g.read={}),g.read.reader=o[c],i&&(g.read.source=(g.read.source||[]).concat(i))})}}let dl=class extends At{constructor(...t){super(...t),this.type=null,this.hasM=!1,this.hasZ=!1,this.spatialReference=yi.WGS84}get cache(){return this.commitProperty("spatialReference"),{}}get extent(){return null}readSpatialReference(t,i){if(t instanceof yi)return t;if(t!=null){const r=new yi;return r.read(t,i),r}return t}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}clearCache(){this.notifyChange("cache")}getCacheValue(t){return this.cache[t]}setCacheValue(t,i){this.cache[t]=i}};v([M()],dl.prototype,"type",void 0),v([M({readOnly:!0})],dl.prototype,"cache",null),v([M({readOnly:!0})],dl.prototype,"extent",null),v([M({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],dl.prototype,"hasM",void 0),v([M({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],dl.prototype,"hasZ",void 0),v([M({type:yi,json:{write:!0},value:yi.WGS84})],dl.prototype,"spatialReference",void 0),v([mi("spatialReference")],dl.prototype,"readSpatialReference",null),dl=v([fe("esri.geometry.Geometry")],dl);const Th=dl,xW=Object.prototype.toString;function SW(e){const t="__accessorMetadata__"in e?Fn(e):e;return function(...i){if(i.push(t),typeof i[2]=="number")throw new Error("Using @cast has parameter decorator is not supported since 4.16");return TW.apply(this,i)}}function TW(e,t,i,r){lx(e,t).cast=r}function EW(e){return(t,i)=>{lx(t,e).cast=t[i]}}function Rs(...e){if(e.length!==3||typeof e[1]!="string")return e.length===1&&xW.call(e[0])==="[object Function]"?SW(e[0]):e.length===1&&typeof e[0]=="string"?EW(e[0]):void 0}function MW(e,t){const i=e.x-t.x,r=e.y-t.y,s=e.hasZ&&t.hasZ?e.z-t.z:0;return Math.sqrt(i*i+r*r+s*s)}const IW=57.29577951308232,AW=.017453292519943;function k$(e){return e*IW}function R$(e){return e*AW}function ege(e){return Math.PI/2-2*Math.atan(Math.exp(-e/Or.radius))}function lE(e){return e.wkid!=null||e.wkt!=null}const ES=[0,0];function gw(e,t,i,r,s){const n=e,c=s;if(c.spatialReference=i,"x"in n&&"x"in c)[c.x,c.y]=t(n.x,n.y,ES,r);else if("xmin"in n&&"xmin"in c)[c.xmin,c.ymin]=t(n.xmin,n.ymin,ES,r),[c.xmax,c.ymax]=t(n.xmax,n.ymax,ES,r);else if("paths"in n&&"paths"in c||"rings"in n&&"rings"in c){const o="paths"in n?n.paths:n.rings,f=[];let g;for(let S=0;S2&&g[A].push(I[A][2]),I[A].length>3&&g[A].push(I[A][3])}"paths"in c?c.paths=f:c.rings=f}else if("points"in n&&"points"in c){const o=n.points,f=[];for(let g=0;g2&&f[g].push(o[g][2]),o[g].length>3&&f[g].push(o[g][3]);c.points=f}return s}function Hv(e,t){const i=e&&(lE(e)?e:e.spatialReference),r=t&&(lE(t)?t:t.spatialReference);return!(e&&"type"in e&&e.type==="mesh"||t&&"type"in t&&t.type==="mesh"||!i||!r)&&(!!Js(r,i)||gp(r)&&G0(i)||gp(i)&&G0(r))}function wx(e,t){if(e==null)return null;const i=e.spatialReference,r=t&&(lE(t)?t:t.spatialReference);return Hv(i,r)?Js(i,r)?He(e):gp(r)?gw(e,tm,yi.WebMercator,!1,He(e)):G0(r)?gw(e,m0,yi.WGS84,!1,He(e)):null:null}function tm(e,t,i=[0,0]){t>89.99999?t=89.99999:t<-89.99999&&(t=-89.99999);const r=R$(t);return i[0]=R$(e)*Or.radius,i[1]=Or.halfSemiMajorAxis*Math.log((1+Math.sin(r))/(1-Math.sin(r))),i}function m0(e,t,i=[0,0],r=!1){const s=k$(e/Or.radius);return i[0]=r?s:s-360*Math.floor((s+180)/360),i[1]=k$(Math.PI/2-2*Math.atan(Math.exp(-t/Or.radius))),i}function Nc(e,t=!1,i=He(e)){return gw(e,tm,yi.WebMercator,t,i)}function im(e,t=!1,i=He(e)){return gw(e,m0,yi.WGS84,t,i)}var Wv;const cg=[0,0];function O$(e){return e&&(e.declaredClass==="esri.geometry.SpatialReference"||e.wkid!=null)}let Mn=Wv=class extends Th{static copy(e,t){t._set("x",e._get("x")),t._set("y",e._get("y")),t._set("z",e._get("z")),t._set("m",e._get("m"));const i=e._get("spatialReference");t._set("spatialReference",Object.isFrozen(i)?i:i.clone())}constructor(...e){super(...e),this.x=0,this.y=0,this.z=void 0,this.m=void 0,this.type="point"}normalizeCtorArgs(e,t,i,r,s){let n;if(Array.isArray(e))n=e,s=t,e=n[0],t=n[1],i=n[2],r=n[3];else if(e&&typeof e=="object"){if(n=e,e=n.x!=null?n.x:n.longitude,t=n.y!=null?n.y:n.latitude,i=n.z,r=n.m,(s=n.spatialReference)&&s.declaredClass!=="esri.geometry.SpatialReference"&&(s=new yi(s)),n.longitude!=null||n.latitude!=null){if(n.longitude==null)_t.getLogger(this).warn(".longitude=","Latitude was defined without longitude");else if(n.latitude==null)_t.getLogger(this).warn(".latitude=","Longitude was defined without latitude");else if(!n.declaredClass&&s&&s.isWebMercator){const o=tm(n.longitude,n.latitude,cg);e=o[0],t=o[1]}}}else O$(i)?(s=i,i=null):O$(r)&&(s=r,r=null);const c={x:e,y:t};return c.x==null&&c.y!=null?_t.getLogger(this).warn(".y=","Y coordinate was defined without an X coordinate"):c.y==null&&c.x!=null&&_t.getLogger(this).warn(".x=","X coordinate was defined without a Y coordinate"),s!=null&&(c.spatialReference=s),i!=null&&(c.z=i),r!=null&&(c.m=r),c}get cache(){return this.commitProperty("x"),this.commitProperty("y"),this.commitProperty("z"),this.commitProperty("m"),this.commitProperty("spatialReference"),{}}get hasM(){return this.m!==void 0}set hasM(e){e!==(this._get("m")!==void 0)&&(this._set("m",e?0:void 0),this._set("hasM",e))}get hasZ(){return this.z!==void 0}set hasZ(e){e!==(this._get("z")!==void 0)&&(this._set("z",e?0:void 0),this._set("hasZ",e))}get latitude(){const{spatialReference:e,x:t,y:i}=this;if(e){if(e.isWebMercator)return m0(t,i,cg)[1];if(e.isGeographic)return i}return null}set latitude(e){const{spatialReference:t,x:i}=this;e!=null&&t&&(t.isWebMercator?this._set("y",tm(i,e,cg)[1]):t.isGeographic&&this._set("y",e),this._set("latitude",e))}get longitude(){const{x:e,y:t,spatialReference:i}=this;if(i){if(i.isWebMercator)return m0(e,t,cg)[0];if(i.isGeographic)return e}return null}set longitude(e){const{y:t,spatialReference:i}=this;e!=null&&i&&(i.isWebMercator?this._set("x",tm(e,t,cg)[0]):i.isGeographic&&this._set("x",e),this._set("longitude",e))}writeX(e,t,i){t[i]=isNaN(e)?"NaN":e}readX(e){return typeof e=="string"?NaN:e}clone(){const e=new Wv;return e.x=this.x,e.y=this.y,e.z=this.z,e.m=this.m,e.spatialReference=this.spatialReference,e}copy(e){return Wv.copy(e,this),this}equals(e){if(e==null)return!1;const{x:t,y:i,z:r,m:s,spatialReference:n}=this,{z:c,m:o}=e;let{x:f,y:g,spatialReference:S}=e;if(!n.equals(S))if(n.isWebMercator&&S.isWGS84)[f,g]=tm(f,g),S=n;else{if(!n.isWGS84||!S.isWebMercator)return!1;[f,g]=m0(f,g),S=n}return t===f&&i===g&&r===c&&s===o&&n.wkid===S.wkid}offset(e,t,i){return this.x+=e,this.y+=t,i!=null&&(this.z=(this.z??0)+i),this}normalize(){if(!this.spatialReference)return this;const e=ro(this.spatialReference);if(!e)return this;let t=this.x;const[i,r]=e.valid,s=2*r;let n;return t>r?(n=Math.ceil(Math.abs(t-r)/s),t-=n*s):tisNaN(e)?e:za(e))],Mn.prototype,"x",void 0),v([ui("x")],Mn.prototype,"writeX",null),v([mi("x")],Mn.prototype,"readX",null),v([M({type:Number,json:{write:!0}})],Mn.prototype,"y",void 0),v([M({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasZ}}}}})],Mn.prototype,"z",void 0),v([M({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasM}}}}})],Mn.prototype,"m",void 0),Mn=Wv=v([fe("esri.geometry.Point")],Mn),Mn.prototype.toJSON.isDefaultToJSON=!0;const ri=Mn,MS=[0,0];function xx(e,t){return t!=null&&$n(e,t.x,t.y,t.z)}function tge(e,t){if(!t.points||t.points.length)return!1;for(const i of t.points)if(!Pm(e,i))return!1;return!0}function PW(e,t){const{xmin:i,ymin:r,zmin:s,xmax:n,ymax:c,zmax:o}=t;return e.hasZ&&t.hasZ?$n(e,i,r,s)&&$n(e,i,c,s)&&$n(e,n,c,s)&&$n(e,n,r,s)&&$n(e,i,r,o)&&$n(e,i,c,o)&&$n(e,n,c,o)&&$n(e,n,r,o):$n(e,i,r)&&$n(e,i,c)&&$n(e,n,c)&&$n(e,n,r)}function Pm(e,t){return $n(e,t[0],t[1])}function CW(e,t){return $n(e,t[0],t[1],t[2])}function $n(e,t,i,r){return t>=e.xmin&&t<=e.xmax&&i>=e.ymin&&i<=e.ymax&&(r==null||!e.hasZ||r>=e.zmin&&r<=e.zmax)}function pN(e,t){return MS[1]=t.y,MS[0]=t.x,$W(e,MS)}function $W(e,t){return fN(e.rings,t)}function fN(e,t){if(!e)return!1;if(kW(e))return L$(!1,e,t);let i=!1;for(let r=0,s=e.length;r=s||A=s)&&g+(s-S)/(A-S)*(I-g)=0&&ge<=1&&Ie>=0&&Ie<=1&&(s&&(s[0]=n+ge*(o-n),s[1]=c+ge*(f-c)),!0)}function UW(e){switch(e){case"esriGeometryEnvelope":case"extent":return OW;case"esriGeometryMultipoint":case"multipoint":return LW;case"esriGeometryPoint":case"point":return RW;case"esriGeometryPolygon":case"polygon":return NW;case"esriGeometryPolyline":case"polyline":return FW}}var jo;function jW(e){return e&&(e.declaredClass==="esri.geometry.SpatialReference"||e.wkid!=null)}function bu(e,t,i){return t==null?i:i==null?t:e(t,i)}let ys=jo=class extends Th{constructor(...e){super(...e),this.type="extent",this.xmin=0,this.ymin=0,this.mmin=void 0,this.zmin=void 0,this.xmax=0,this.ymax=0,this.mmax=void 0,this.zmax=void 0}normalizeCtorArgs(e,t,i,r,s){return jW(e)?{spatialReference:e,xmin:0,ymin:0,xmax:0,ymax:0}:typeof e=="object"?(e.spatialReference=e.spatialReference==null?yi.WGS84:e.spatialReference,e):{xmin:e,ymin:t,xmax:i,ymax:r,spatialReference:s??yi.WGS84}}static fromBounds(e,t){return new jo({xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3],spatialReference:t})}static fromPoint(e){return new jo({xmin:e.x,ymin:e.y,zmin:e.z,xmax:e.x,ymax:e.y,zmax:e.z,spatialReference:e.spatialReference})}get cache(){return this.commitProperty("xmin"),this.commitProperty("ymin"),this.commitProperty("zmin"),this.commitProperty("mmin"),this.commitProperty("xmax"),this.commitProperty("ymax"),this.commitProperty("zmax"),this.commitProperty("mmax"),this.commitProperty("spatialReference"),{}}get center(){const e=new ri({x:.5*(this.xmin+this.xmax),y:.5*(this.ymin+this.ymax),spatialReference:this.spatialReference});return this.hasZ&&(e.z=.5*(this.zmin+this.zmax)),this.hasM&&(e.m=.5*(this.mmin+this.mmax)),e}get extent(){return this.clone()}get hasM(){return this.mmin!=null&&this.mmax!=null}get hasZ(){return this.zmin!=null&&this.zmax!=null}get height(){return Math.abs(this.ymax-this.ymin)}get width(){return Math.abs(this.xmax-this.xmin)}centerAt(e){const t=this.center;return e.z!=null&&this.hasZ?this.offset(e.x-t.x,e.y-t.y,e.z-t.z):this.offset(e.x-t.x,e.y-t.y)}clone(){const e=new jo;return e.xmin=this.xmin,e.ymin=this.ymin,e.xmax=this.xmax,e.ymax=this.ymax,e.spatialReference=this.spatialReference,this.zmin!=null&&(e.zmin=this.zmin,e.zmax=this.zmax),this.mmin!=null&&(e.mmin=this.mmin,e.mmax=this.mmax),e}contains(e){if(!e)return!1;const t=this.spatialReference,i=e.spatialReference;return t&&i&&!t.equals(i)&&Hv(t,i)&&(e=t.isWebMercator?Nc(e):im(e,!0)),e.type==="point"?xx(this,e):e.type==="extent"&&PW(this,e)}equals(e){if(this===e)return!0;if(e==null)return!1;const t=this.spatialReference,i=e.spatialReference;return t&&i&&!t.equals(i)&&Hv(t,i)&&(e=t.isWebMercator?Nc(e):im(e,!0)),this.xmin===e.xmin&&this.ymin===e.ymin&&this.zmin===e.zmin&&this.mmin===e.mmin&&this.xmax===e.xmax&&this.ymax===e.ymax&&this.zmax===e.zmax&&this.mmax===e.mmax}expand(e){const t=.5*(1-e),i=this.width*t,r=this.height*t;if(this.xmin+=i,this.ymin+=r,this.xmax-=i,this.ymax-=r,this.hasZ){const s=(this.zmax-this.zmin)*t;this.zmin+=s,this.zmax-=s}if(this.hasM){const s=(this.mmax-this.mmin)*t;this.mmin+=s,this.mmax-=s}return this}intersects(e){if(e==null)return!1;e.type==="mesh"&&(e=e.extent);const t=this.spatialReference,i=e.spatialReference;return t&&i&&!Js(t,i)&&Hv(t,i)&&(e=t.isWebMercator?Nc(e):im(e,!0)),UW(e.type)(this,e)}normalize(){const e=this._normalize(!1,!0);return Array.isArray(e)?e:[e]}offset(e,t,i){return this.xmin+=e,this.ymin+=t,this.xmax+=e,this.ymax+=t,i!=null&&(this.zmin+=i,this.zmax+=i),this}shiftCentralMeridian(){return this._normalize(!0)}union(e){return this===e||(this.xmin=Math.min(this.xmin,e.xmin),this.ymin=Math.min(this.ymin,e.ymin),this.xmax=Math.max(this.xmax,e.xmax),this.ymax=Math.max(this.ymax,e.ymax),(this.hasZ||e.hasZ)&&(this.zmin=bu(Math.min,this.zmin,e.zmin),this.zmax=bu(Math.max,this.zmax,e.zmax)),(this.hasM||e.hasM)&&(this.mmin=bu(Math.min,this.mmin,e.mmin),this.mmax=bu(Math.max,this.mmax,e.mmax))),this}intersection(e){return this===e?this:e!=null&&this.intersects(e)?(this.xmin=Math.max(this.xmin,e.xmin),this.ymin=Math.max(this.ymin,e.ymin),this.xmax=Math.min(this.xmax,e.xmax),this.ymax=Math.min(this.ymax,e.ymax),(this.hasZ||e.hasZ)&&(this.zmin=bu(Math.max,this.zmin,e.zmin),this.zmax=bu(Math.min,this.zmax,e.zmax)),(this.hasM||e.hasM)&&(this.mmin=bu(Math.max,this.mmin,e.mmin),this.mmax=bu(Math.min,this.mmax,e.mmax)),this):null}toJSON(e){return this.write({},e)}_shiftCM(e=ro(this.spatialReference)){if(!e||!this.spatialReference)return this;const t=this.spatialReference,i=this._getCM(e);if(i){const r=t.isWebMercator?im(i):i;this.xmin-=i.x,this.xmax-=i.x,t.isWebMercator||(r.x=this._normalizeX(r.x,e).x),this.spatialReference=new yi(O5((t.isWGS84?e.altTemplate:null)??e.wkTemplate,{Central_Meridian:r.x}))}return this}_getCM(e){let t=null;const[i,r]=e.valid,s=this.xmin,n=this.xmax;return s>=i&&s<=r&&n>=i&&n<=r||(t=this.center),t}_normalize(e,t,i){const r=this.spatialReference;if(!r)return this;const s=i??ro(r);if(s==null)return this;const n=this._getParts(s).map(f=>f.extent);if(n.length<2)return n[0]||this;if(n.length>2)return e?this._shiftCM(s):this.set({xmin:s.valid[0],xmax:s.valid[1]});if(e)return this._shiftCM(s);if(t)return n;let c=!0,o=!0;return n.forEach(f=>{f.hasZ||(c=!1),f.hasM||(o=!1)}),{rings:n.map(f=>{const g=[[f.xmin,f.ymin],[f.xmin,f.ymax],[f.xmax,f.ymax],[f.xmax,f.ymin],[f.xmin,f.ymin]];if(c){const S=(f.zmax-f.zmin)/2;for(let I=0;I0;if(o>2*A){const ve=new jo(fV||Q?t.push({extent:new jo(O,s,A,n,c),frameIds:[z]},{extent:new jo(I,s,V,n,c),frameIds:[H]}):t.push({extent:new jo(O,s,V,n,c),frameIds:[z]});this.cache._parts=t}const i=this.hasZ,r=this.hasM;if(i||r){const s={};i&&(s.zmin=this.zmin,s.zmax=this.zmax),r&&(s.mmin=this.mmin,s.mmax=this.mmax);for(let n=0;nr?(n=Math.ceil(Math.abs(e-r)/s),e-=n*s,c=n):eg0.splice(g0.indexOf(e),1))}const uE=[];function $A(e){return uE.push(e),er(()=>g0.splice(uE.indexOf(e),1))}function qW(){const e=gN();y0!==e&&(y0=e,[...uE].forEach(t=>{t.call(null,e)}),[...g0].forEach(t=>{t.call(null,e)}))}var u5;(u5=globalThis.addEventListener)==null||u5.call(globalThis,"languagechange",qW);let Q1;function HW(e){return Q1&&!Q1.destroyed||(Q1=e()),Q1}var hE;const WW=new ks({avgRating:"avg-rating",numRatings:"num-ratings",numComments:"num-comments",numViews:"num-views"});let Vo=hE=class extends Nt{constructor(e){super(e),this.categories=null,this.disableExtraQuery=!1,this.extent=null,this.filter=null,this.num=10,this.query=null,this.sortField=null,this.start=1}get sortOrder(){return this._get("sortOrder")||"asc"}set sortOrder(e){e!=="asc"&&e!=="desc"||this._set("sortOrder",e)}clone(){return new hE({categories:this.categories?He(this.categories):null,disableExtraQuery:this.disableExtraQuery,extent:this.extent?this.extent.clone():null,filter:this.filter,num:this.num,query:this.query,sortField:this.sortField,sortOrder:this.sortOrder,start:this.start})}toRequestOptions(e,t){let i=[];this.categories&&(i=this.categories.map(c=>Array.isArray(c)?JSON.stringify(c):c));let r="";if(this.extent){const c=wx(this.extent,yi.WGS84);c!=null&&(r=`${c.xmin},${c.ymin},${c.xmax},${c.ymax}`)}let s=this.query;!this.disableExtraQuery&&e.extraQuery&&(s="("+s+")"+e.extraQuery);const n={categories:i,bbox:r,q:s,filter:this.filter,num:this.num,sortField:null,sortOrder:null,start:this.start};return this.sortField&&(n.sortField=this.sortField.split(",").map(c=>WW.toJSON(c.trim())).join(","),n.sortOrder=this.sortOrder),{query:{...t,...n}}}};v([M()],Vo.prototype,"categories",void 0),v([M()],Vo.prototype,"disableExtraQuery",void 0),v([M({type:Ui})],Vo.prototype,"extent",void 0),v([M()],Vo.prototype,"filter",void 0),v([M()],Vo.prototype,"num",void 0),v([M()],Vo.prototype,"query",void 0),v([M()],Vo.prototype,"sortField",void 0),v([M()],Vo.prototype,"sortOrder",null),v([M()],Vo.prototype,"start",void 0),Vo=hE=v([fe("esri.portal.PortalQueryParams")],Vo);const Lc=Vo;var dE;let cs=dE=class extends At{constructor(e){super(e),this.access=null,this.created=null,this.description=null,this.id=null,this.isInvitationOnly=!1,this.modified=null,this.owner=null,this.portal=null,this.snippet=null,this.sortField=null,this.sortOrder=null,this.sourceJSON=null,this.tags=null,this.title=null}get thumbnailUrl(){var i;const e=this.url,t=this.thumbnail;return e&&t&&this.portal?(i=this.portal)==null?void 0:i.normalizeUrl(`${e}/info/${t}?f=json`):null}get url(){var t;const e=(t=this.portal)==null?void 0:t.restUrl;return e?e+"/community/groups/"+this.id:null}fetchCategorySchema(e){return this.portal.request(this.url+"/categorySchema",e).then(t=>{const i=t.categorySchema||[];return i.some(r=>r.source==="contentCategorySetsGroupQuery.LivingAtlas")?this._fetchCategorySchemaSet("LivingAtlas",e):i})}fetchMembers(e){return this.portal.request(this.url+"/users",e)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}toJSON(){throw new Je("internal:not-yet-implemented","PortalGroup.toJSON is not yet implemented")}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");const t=new dE;return t.sourceJSON=e,t.read(e),t}queryItems(e,t){let i=Fn(Lc,e);const r=this.portal;return parseFloat(r.currentVersion)>5?(i=i||new Lc,r.queryPortal(`/content/groups/${this.id}/search`,i,"PortalItem",t)):(i=i?i.clone():new Lc,i.query="group:"+this.id+(i.query?" "+i.query:""),r.queryItems(i,t))}_fetchCategorySchemaSet(e,t){const i=this.portal;return i.fetchSelf(i.authMode,!0,t).then(r=>{const s=r.contentCategorySetsGroupQuery;if(s){const n=new Lc;return n.disableExtraQuery=!0,n.num=1,n.query=s,i.queryGroups(n,t)}throw new Je("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery value not found")}).then(r=>{if(r.total){const s=r.results[0],n=new Lc;return n.num=1,n.query=`typekeywords:"${e}"`,s.queryItems(n,t)}throw new Je("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery group not found")}).then(r=>r.total?r.results[0].fetchData("json",t).then(s=>{const n=s==null?void 0:s.categorySchema;return n!=null&&n.length?n:[]}):[])}};v([M()],cs.prototype,"access",void 0),v([M({type:Date})],cs.prototype,"created",void 0),v([M()],cs.prototype,"description",void 0),v([M()],cs.prototype,"id",void 0),v([M()],cs.prototype,"isInvitationOnly",void 0),v([M({type:Date})],cs.prototype,"modified",void 0),v([M()],cs.prototype,"owner",void 0),v([M()],cs.prototype,"portal",void 0),v([M()],cs.prototype,"snippet",void 0),v([M()],cs.prototype,"sortField",void 0),v([M()],cs.prototype,"sortOrder",void 0),v([M()],cs.prototype,"sourceJSON",void 0),v([M()],cs.prototype,"tags",void 0),v([M()],cs.prototype,"thumbnail",void 0),v([M({readOnly:!0})],cs.prototype,"thumbnailUrl",null),v([M()],cs.prototype,"title",void 0),v([M({readOnly:!0})],cs.prototype,"url",null),cs=dE=v([fe("esri.portal.PortalGroup")],cs);const pE=cs;let hd=class extends Nt{constructor(t){super(t),this.nextQueryParams=null,this.queryParams=null,this.results=null,this.total=null}};v([M()],hd.prototype,"nextQueryParams",void 0),v([M()],hd.prototype,"queryParams",void 0),v([M()],hd.prototype,"results",void 0),v([M()],hd.prototype,"total",void 0),hd=v([fe("esri.portal.PortalQueryResult")],hd);const ZW=hd;let _c=class extends At{constructor(t){super(t),this.created=null,this.id=null,this.portal=null,this.title=null,this.username=null}get url(){var i;const t=(i=this.portal)==null?void 0:i.restUrl;return t?`${t}/content/users/${this.username}/${this.id}`:null}toJSON(){throw new Je("internal:not-yet-implemented","PortalFolder.toJSON is not yet implemented")}};v([M({type:Date})],_c.prototype,"created",void 0),v([M()],_c.prototype,"id",void 0),v([M()],_c.prototype,"portal",void 0),v([M()],_c.prototype,"title",void 0),v([M({readOnly:!0})],_c.prototype,"url",null),v([M()],_c.prototype,"username",void 0),_c=v([fe("esri.portal.PortalFolder")],_c);const YW=_c;var fE;let or=fE=class extends At{constructor(...e){super(...e),this.access=null,this.created=null,this.culture=null,this.description=null,this.email=null,this.fullName=null,this.modified=null,this.orgId=null,this.portal=null,this.preferredView=null,this.privileges=null,this.region=null,this.role=null,this.roleId=null,this.sourceJSON=null,this.units=null,this.username=null,this.userType=null}get thumbnailUrl(){const e=this.url,t=this.thumbnail;return e&&t?this.portal.normalizeUrl(`${e}/info/${t}?f=json`):null}get userContentUrl(){var t;const e=(t=this.portal)==null?void 0:t.restUrl;return e?`${e}/content/users/${this.username}`:null}get url(){var t;const e=(t=this.portal)==null?void 0:t.restUrl;return e?`${e}/community/users/${this.username}`:null}addItem(e){const t=e&&e.item,i=e==null?void 0:e.data,r=e==null?void 0:e.folder,s={method:"post"};t&&(s.query=t.createPostQuery(),i!=null&&(typeof i=="string"?s.query.text=i:typeof i=="object"&&(s.query.text=JSON.stringify(i))));let n=this.userContentUrl;return r&&(n+="/"+(typeof r=="string"?r:r.id)),this.portal.request(n+"/addItem",s).then(c=>(t.id=c.id,t.portal=this.portal,t.loaded?t.reload():t.load()))}deleteItem(e){let t=this.userContentUrl;return e.ownerFolder&&(t+="/"+e.ownerFolder),this.portal.request(t+`/items/${e.id}/delete`,{method:"post"}).then(()=>{e.id=null,e.portal=null})}deleteItems(e){const t=this.userContentUrl+"/deleteItems",i=e.map(r=>r.id);if(i.length){const r={method:"post",query:{items:i.join(",")}};return this.portal.request(t,r).then(()=>{e.forEach(s=>{s.id=null,s.portal=null})})}return Promise.resolve(void 0)}fetchFolders(){const e={query:{num:1}};return this.portal.request(this.userContentUrl??"",e).then(t=>{let i;return i=t&&t.folders?t.folders.map(r=>{const s=YW.fromJSON(r);return s.portal=this.portal,s}):[],i})}fetchGroups(){return this.portal.request(this.url??"").then(e=>{let t;return t=e&&e.groups?e.groups.map(i=>{const r=pE.fromJSON(i);return r.portal=this.portal,r}):[],t})}fetchItems(e){const t=e??{};let i,r=this.userContentUrl??"";return t.folder&&(r+="/"+t.folder.id),ht(()=>Promise.resolve().then(()=>vN),void 0).then(({default:s})=>{i=s;const n={folders:!1,num:t.num||10,start:t.start||1,sortField:t.sortField||"created",sortOrder:t.sortOrder||"asc"};return this.portal.request(r,{query:n})}).then(s=>{let n;return s!=null&&s.items?(n=s.items.map(c=>{const o=i.fromJSON(c);return o.portal=this.portal,o}),Promise.all(n.map(c=>c.load())).catch(c=>c).then(()=>({items:n,nextStart:s.nextStart,total:s.total}))):{items:[],nextStart:-1,total:0}})}fetchTags(){return this.portal.request(this.url+"/tags").then(e=>e.tags)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}queryFavorites(e){return this.favGroupId?(this._favGroup||(this._favGroup=new pE({id:this.favGroupId,portal:this.portal})),this._favGroup.queryItems(e)):Promise.reject(new Je("internal:unknown","Unknown internal error",{internalError:"Unknown favGroupId"}))}toJSON(){throw new Je("internal:not-yet-implemented","PortalUser.toJSON is not yet implemented")}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");const t=new fE;return t.sourceJSON=e,t.read(e),t}};v([M()],or.prototype,"access",void 0),v([M({type:Date})],or.prototype,"created",void 0),v([M()],or.prototype,"culture",void 0),v([M()],or.prototype,"description",void 0),v([M()],or.prototype,"email",void 0),v([M()],or.prototype,"favGroupId",void 0),v([M()],or.prototype,"fullName",void 0),v([M({type:Date})],or.prototype,"modified",void 0),v([M()],or.prototype,"orgId",void 0),v([M()],or.prototype,"portal",void 0),v([M()],or.prototype,"preferredView",void 0),v([M()],or.prototype,"privileges",void 0),v([M()],or.prototype,"region",void 0),v([M()],or.prototype,"role",void 0),v([M()],or.prototype,"roleId",void 0),v([M()],or.prototype,"sourceJSON",void 0),v([M()],or.prototype,"thumbnail",void 0),v([M({readOnly:!0})],or.prototype,"thumbnailUrl",null),v([M()],or.prototype,"units",void 0),v([M({readOnly:!0})],or.prototype,"userContentUrl",null),v([M({readOnly:!0})],or.prototype,"url",null),v([M()],or.prototype,"username",void 0),v([M()],or.prototype,"userType",void 0),or=fE=v([fe("esri.portal.PortalUser")],or);const kA=or;var mo;let ev;const D$={PortalGroup:()=>Promise.resolve({default:pE}),PortalItem:()=>ht(()=>Promise.resolve().then(()=>vN),void 0),PortalUser:()=>Promise.resolve({default:kA})};let st=mo=class extends y_(dh){constructor(e){super(e),this._esriIdCredentialCreateHandle=null,this.access=null,this.allSSL=!1,this.authMode="auto",this.authorizedCrossOriginDomains=null,this.basemapGalleryGroupQuery=null,this.basemapGalleryGroupQuery3D=null,this.bingKey=null,this.canListApps=!1,this.canListData=!1,this.canListPreProvisionedItems=!1,this.canProvisionDirectPurchase=!1,this.canSearchPublic=!0,this.canShareBingPublic=!1,this.canSharePublic=!1,this.canSignInArcGIS=!1,this.canSignInIDP=!1,this.colorSetsGroupQuery=null,this.commentsEnabled=!1,this.created=null,this.culture=null,this.customBaseUrl=null,this.defaultBasemap=null,this.defaultDevBasemap=null,this.defaultExtent=null,this.defaultVectorBasemap=null,this.description=null,this.devBasemapGalleryGroupQuery=null,this.eueiEnabled=null,this.featuredGroups=null,this.featuredItemsGroupQuery=null,this.galleryTemplatesGroupQuery=null,this.layoutGroupQuery=null,this.livingAtlasGroupQuery=null,this.hasCategorySchema=!1,this.helperServices=null,this.homePageFeaturedContent=null,this.homePageFeaturedContentCount=null,this.httpPort=null,this.httpsPort=null,this.id=null,this.ipCntryCode=null,this.isPortal=!1,this.isReadOnly=!1,this.layerTemplatesGroupQuery=null,this.maxTokenExpirationMinutes=null,this.modified=null,this.name=null,this.portalHostname=null,this.portalMode=null,this.portalProperties=null,this.region=null,this.rotatorPanels=null,this.showHomePageDescription=!1,this.sourceJSON=null,this.supportsHostedServices=!1,this.symbolSetsGroupQuery=null,this.templatesGroupQuery=null,this.units=null,this.url=Ci.portalUrl,this.urlKey=null,this.user=null,this.use3dBasemaps=!0,this.useStandardizedQuery=!1,this.useVectorBasemaps=!1,this.vectorBasemapGalleryGroupQuery=null}normalizeCtorArgs(e){return typeof e=="string"?{url:e}:e}destroy(){N$.unregister(this),this.defaultBasemap=lr(this.defaultBasemap),this.defaultDevBasemap=lr(this.defaultDevBasemap),this.defaultVectorBasemap=lr(this.defaultVectorBasemap),this._esriIdCredentialCreateHandle=Sr(this._esriIdCredentialCreateHandle)}readAuthorizedCrossOriginDomains(e){if(e)for(const t of e)Ci.request.trustedServers.includes(t)||Ci.request.trustedServers.push(t);return e}readDefaultBasemap(e){return this._readBasemap(e)}readDefaultDevBasemap(e){return this._readBasemap(e)}readDefaultVectorBasemap(e){return this._readBasemap(e)}get extraQuery(){var i;const e=(i=this.user)==null?void 0:i.orgId,t=!e||this.canSearchPublic;return this.id&&!t?` AND orgid:${this.id}`:null}get isOrganization(){return!!this.access}get itemPageUrl(){return this.url?`${this.url}/home/item.html`:null}get restUrl(){let e=this.url;if(e){const t=e.indexOf("/sharing");e=t>0?e.substring(0,t):this.url.replace(/\/+$/,""),e+="/sharing/rest"}return e}get thumbnailUrl(){const e=this.restUrl,t=this.thumbnail;return e&&t?this._normalizeSSL(e+"/portals/self/resources/"+t):null}readUrlKey(e){return e&&e.toLowerCase()}readUser(e){let t=null;return e&&(t=kA.fromJSON(e),t.portal=this),t}load(e){const t=ht(()=>Promise.resolve().then(()=>IZ),void 0).then(({default:i})=>{mr(e),ev=i}).then(()=>this.sourceJSON?this.sourceJSON:this.fetchSelf(this.authMode,!1,e)).then(i=>{var r;if(bi){const s=bi;this.credential=s.findCredential(this.restUrl),this.credential||this.authMode!==mo.AUTH_MODE_AUTO&&this.authMode!==mo.AUTH_MODE_NO_PROMPT||((r=this._esriIdCredentialCreateHandle)==null||r.remove(),this._esriIdCredentialCreateHandle=s.on("credential-create",JW(new WeakRef(this))),N$.register(this,this._esriIdCredentialCreateHandle,this))}this.sourceJSON=i,this.read(i)});return this.addResolvingPromise(t),Promise.resolve(this)}async createElevationLayers(){await this.load();const e=this._getHelperService("defaultElevationLayers"),t=(await ht(()=>import("./ElevationLayer-QYZSSLWB.js"),[])).default;return e?e.map(i=>new t({id:i.id,url:i.url})):[]}async fetchBasemaps(e,t){const i=await this._fetchBasemaps(e,t);if((t==null?void 0:t.include3d)===!0&&this.use3dBasemaps!==!1){const r=await this._fetchBasemaps3D(e,t);i.unshift(...r)}return i}fetchCategorySchema(e){return this.hasCategorySchema?this.request(this.restUrl+"/portals/self/categorySchema",e).then(t=>t.categorySchema):ra(e)?Promise.reject(jr()):Promise.resolve([])}fetchFeaturedGroups(e){const t=this.featuredGroups,i=new Lc;if(i.num=100,i.sortField="title",t&&t.length){const r=[];for(const s of t)r.push(`(title:"${s.title}" AND owner:${s.owner})`);return i.query=r.join(" OR "),this.queryGroups(i,e).then(s=>s.results)}return ra(e)?Promise.reject(jr()):Promise.resolve([])}fetchRegions(e){var i;const t=((i=this.user)==null?void 0:i.culture)||this.culture||wo();return this.request(this.restUrl+"/portals/regions",{...e,query:{culture:t}})}fetchSettings(e){var i;const t=((i=this.user)==null?void 0:i.culture)||this.culture||wo();return this.request(this.restUrl+"/portals/self/settings",{...e,query:{culture:t}})}static getDefault(){return HW(()=>new mo)}queryGroups(e,t){return this.queryPortal("/community/groups",e,"PortalGroup",t)}queryItems(e,t){return this.queryPortal("/search",e,"PortalItem",t)}queryUsers(e,t){return e.sortField||(e.sortField="username"),this.queryPortal("/community/users",e,"PortalUser",t)}fetchSelf(e=this.authMode,t=!1,i){const r=this.restUrl+"/portals/self",s={authMode:e,query:{culture:wo().toLowerCase()},withCredentials:!0,...i};return s.authMode==="auto"&&(s.authMode="no-prompt"),t&&(s.query.default=!0),this.request(r,s)}queryPortal(e,t,i,r){const s=Fn(Lc,t),n=c=>this.request(this.restUrl+e,{...s.toRequestOptions(this),...r}).then(o=>{const f=s.clone();return f.start=o.nextStart,new ZW({nextQueryParams:f,queryParams:s,total:o.total,results:mo._resultsToTypedArray(c,{portal:this},o,r)})}).then(o=>Promise.all(o.results.map(f=>typeof f.when=="function"?f.when():o)).then(()=>o,f=>(Na(f),o)));return i&&D$[i]?D$[i]().then(({default:c})=>(mr(r),n(c))):n()}signIn(){if(this.authMode===mo.AUTH_MODE_ANONYMOUS||this.authMode===mo.AUTH_MODE_NO_PROMPT&&!bi)return Promise.reject(new Je("portal:invalid-auth-mode",`Current "authMode"' is "${this.authMode}"`));if(this.loadStatus==="failed")return Promise.reject(this.loadError);const e=t=>Promise.resolve().then(()=>this.loadStatus==="not-loaded"?(t||(this.authMode="immediate"),this.load().then(()=>null)):this.loadStatus==="loading"?this.load().then(()=>this.credential?null:(this.credential=t,this.fetchSelf("immediate"))):this.user&&this.credential===t?null:(this.credential=t,this.fetchSelf("immediate"))).then(i=>{i&&(this.sourceJSON=i,this.read(i))});return bi?bi.getCredential(this.restUrl,{prompt:this.authMode!==mo.AUTH_MODE_NO_PROMPT}).then(t=>e(t)):e(this.credential)}normalizeUrl(e){var i;const t=(i=this.credential)==null?void 0:i.token;return this._normalizeSSL(t?e+(e.includes("?")?"&":"?")+"token="+t:e)}requestToTypedArray(e,t,i){return this.request(e,t).then(r=>{const s=mo._resultsToTypedArray(i,{portal:this},r);return Promise.all(s.map(n=>typeof n.when=="function"?n.when():r)).then(()=>s,()=>s)})}request(e,t={}){const i={f:"json",...t.query},{authMode:r=this.authMode===mo.AUTH_MODE_ANONYMOUS||this.authMode===mo.AUTH_MODE_NO_PROMPT?this.authMode:"auto",body:s=null,cacheBust:n=!1,method:c="auto",responseType:o="json",signal:f}=t,g={authMode:r,body:s,cacheBust:n,method:c,query:i,responseType:o,timeout:0,signal:f};return t.withCredentials&&(g.withCredentials=!0),Qi(this._normalizeSSL(e),g).then(S=>S.data)}toJSON(){throw new Je("internal:not-yet-implemented","Portal.toJSON is not yet implemented")}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new mo({sourceJSON:e})}_getHelperService(e){const t=this.helperServices&&this.helperServices[e];if(!t)throw new Je("portal:service-not-found",`The \`helperServices\` do not include an entry named "${e}"`);return t}async _fetchBasemaps(e,t){const i=new Lc;i.query=e||(Ci.apiKey&&V4(this.url)?this.devBasemapGalleryGroupQuery:this.useVectorBasemaps?this.vectorBasemapGalleryGroupQuery:this.basemapGalleryGroupQuery),i.disableExtraQuery=!0;const r=await this.queryGroups(i,t);if(!r.total)return[];const s=r.results[0];i.num=100,i.query='type:"Web Map" -type:"Web Application"',i.sortField=s.sortField||"name",i.sortOrder=s.sortOrder||"desc";const n=await s.queryItems(i,t);return n.total?n.results.filter(c=>c.type==="Web Map").map(c=>new ev({portalItem:c})):[]}async _fetchBasemaps3D(e,t){const i=e||this.basemapGalleryGroupQuery3D;if(!i)return[];const r=new Lc({query:i,disableExtraQuery:!0}),s=await this.queryGroups(r,t);if(!s.total)return[];const n=s.results[0];r.num=100,r.query='type:"Web Scene"',r.sortField=n.sortField||"name",r.sortOrder=n.sortOrder||"desc";const c=await n.queryItems(r,t);return c.total?c.results.filter(o=>o.type==="Web Scene").map(o=>new ev({portalItem:o})):[]}_normalizeSSL(e){return e.replace(/^http:/i,"https:").replace(":7080",":7443")}_readBasemap(e){if(e){const t=ev.fromJSON(e);return t.portalItem={portal:this},t}return null}static _resultsToTypedArray(e,t,i,r){let s=[];if(i){const n=r!=null?r.signal:null;s=i.listings||i.notifications||i.userInvitations||i.tags||i.items||i.groups||i.comments||i.provisions||i.results||i.relatedItems||i,(e||t)&&(s=s.map(c=>{const o=Object.assign(e?e.fromJSON(c):c,t);return typeof o.load=="function"&&o.load(n),o}))}else s=[];return s}};st.AUTH_MODE_ANONYMOUS="anonymous",st.AUTH_MODE_AUTO="auto",st.AUTH_MODE_IMMEDIATE="immediate",st.AUTH_MODE_NO_PROMPT="no-prompt",v([M()],st.prototype,"access",void 0),v([M()],st.prototype,"allSSL",void 0),v([M()],st.prototype,"authMode",void 0),v([M()],st.prototype,"authorizedCrossOriginDomains",void 0),v([mi("authorizedCrossOriginDomains")],st.prototype,"readAuthorizedCrossOriginDomains",null),v([M()],st.prototype,"basemapGalleryGroupQuery",void 0),v([M({json:{name:"3DBasemapGalleryGroupQuery"}})],st.prototype,"basemapGalleryGroupQuery3D",void 0),v([M()],st.prototype,"bingKey",void 0),v([M()],st.prototype,"canListApps",void 0),v([M()],st.prototype,"canListData",void 0),v([M()],st.prototype,"canListPreProvisionedItems",void 0),v([M()],st.prototype,"canProvisionDirectPurchase",void 0),v([M()],st.prototype,"canSearchPublic",void 0),v([M()],st.prototype,"canShareBingPublic",void 0),v([M()],st.prototype,"canSharePublic",void 0),v([M()],st.prototype,"canSignInArcGIS",void 0),v([M()],st.prototype,"canSignInIDP",void 0),v([M()],st.prototype,"colorSetsGroupQuery",void 0),v([M()],st.prototype,"commentsEnabled",void 0),v([M({type:Date})],st.prototype,"created",void 0),v([M()],st.prototype,"credential",void 0),v([M()],st.prototype,"culture",void 0),v([M()],st.prototype,"currentVersion",void 0),v([M()],st.prototype,"customBaseUrl",void 0),v([M()],st.prototype,"defaultBasemap",void 0),v([mi("defaultBasemap")],st.prototype,"readDefaultBasemap",null),v([M()],st.prototype,"defaultDevBasemap",void 0),v([mi("defaultDevBasemap")],st.prototype,"readDefaultDevBasemap",null),v([M({type:Ui})],st.prototype,"defaultExtent",void 0),v([M()],st.prototype,"defaultVectorBasemap",void 0),v([mi("defaultVectorBasemap")],st.prototype,"readDefaultVectorBasemap",null),v([M()],st.prototype,"description",void 0),v([M()],st.prototype,"devBasemapGalleryGroupQuery",void 0),v([M()],st.prototype,"eueiEnabled",void 0),v([M({readOnly:!0})],st.prototype,"extraQuery",null),v([M()],st.prototype,"featuredGroups",void 0),v([M()],st.prototype,"featuredItemsGroupQuery",void 0),v([M()],st.prototype,"galleryTemplatesGroupQuery",void 0),v([M()],st.prototype,"layoutGroupQuery",void 0),v([M()],st.prototype,"livingAtlasGroupQuery",void 0),v([M()],st.prototype,"hasCategorySchema",void 0),v([M()],st.prototype,"helpBase",void 0),v([M()],st.prototype,"helperServices",void 0),v([M()],st.prototype,"helpMap",void 0),v([M()],st.prototype,"homePageFeaturedContent",void 0),v([M()],st.prototype,"homePageFeaturedContentCount",void 0),v([M()],st.prototype,"httpPort",void 0),v([M()],st.prototype,"httpsPort",void 0),v([M()],st.prototype,"id",void 0),v([M()],st.prototype,"ipCntryCode",void 0),v([M({readOnly:!0})],st.prototype,"isOrganization",null),v([M()],st.prototype,"isPortal",void 0),v([M()],st.prototype,"isReadOnly",void 0),v([M({readOnly:!0})],st.prototype,"itemPageUrl",null),v([M()],st.prototype,"layerTemplatesGroupQuery",void 0),v([M()],st.prototype,"maxTokenExpirationMinutes",void 0),v([M({type:Date})],st.prototype,"modified",void 0),v([M()],st.prototype,"name",void 0),v([M()],st.prototype,"portalHostname",void 0),v([M()],st.prototype,"portalMode",void 0),v([M()],st.prototype,"portalProperties",void 0),v([M()],st.prototype,"region",void 0),v([M({readOnly:!0})],st.prototype,"restUrl",null),v([M()],st.prototype,"rotatorPanels",void 0),v([M()],st.prototype,"showHomePageDescription",void 0),v([M()],st.prototype,"sourceJSON",void 0),v([M()],st.prototype,"staticImagesUrl",void 0),v([M({json:{name:"2DStylesGroupQuery"}})],st.prototype,"stylesGroupQuery2d",void 0),v([M({json:{name:"stylesGroupQuery"}})],st.prototype,"stylesGroupQuery3d",void 0),v([M()],st.prototype,"supportsHostedServices",void 0),v([M()],st.prototype,"symbolSetsGroupQuery",void 0),v([M()],st.prototype,"templatesGroupQuery",void 0),v([M()],st.prototype,"thumbnail",void 0),v([M({readOnly:!0})],st.prototype,"thumbnailUrl",null),v([M()],st.prototype,"units",void 0),v([M()],st.prototype,"url",void 0),v([M()],st.prototype,"urlKey",void 0),v([mi("urlKey")],st.prototype,"readUrlKey",null),v([M()],st.prototype,"user",void 0),v([mi("user")],st.prototype,"readUser",null),v([M()],st.prototype,"use3dBasemaps",void 0),v([M()],st.prototype,"useStandardizedQuery",void 0),v([M()],st.prototype,"useVectorBasemaps",void 0),v([M()],st.prototype,"vectorBasemapGalleryGroupQuery",void 0),st=mo=v([fe("esri.portal.Portal")],st);const Za=st,N$=new FinalizationRegistry(e=>{e.remove()});function JW(e){const t=bi;return()=>{const i=e.deref();i&&t.findCredential(i.restUrl)&&i.signIn().catch(()=>{})}}let vc=class extends Nt{constructor(t){super(t),this.portalItem=null}normalizeCtorArgs(t){return t!=null&&t.portalItem&&t.path?{...t,path:this._normalizePath(t.path,t.portalItem)}:t}set path(t){t!=null&&zn(t)?_t.getLogger(this).error("portalitemresource:invalid-path","A portal item resource path must be relative"):this._set("path",t)}_castPath(t){return this._normalizePath(t,this.portalItem)}get url(){return this.portalItem&&this.path?`${this.portalItem.itemUrl}/resources/${this.path}`:null}get cdnUrl(){return this.portalItem&&this.path?`${this.portalItem.itemCdnUrl}/resources/${this.path}`:null}get itemRelativeUrl(){return this.portalItem&&this.path?`./resources/${this.path}`:null}fetch(t="json",i){const r=this.cdnUrl;if(r==null)throw new Je("portal-item-resource:fetch","Portal item resource does not refer to a valid item or path");return this.portalItem.portal.request(r,{responseType:t,query:{token:this.portalItem.apiKey},signal:i==null?void 0:i.signal})}async update(t,i){const{addOrUpdateResources:r}=await ht(()=>import("./resourceUtils-CfE36DzP.js"),[]);return await r(this.portalItem,[{resource:this,content:t,compress:i==null?void 0:i.compress,access:i==null?void 0:i.access}],"update",i),this}hasPath(){return this.path!=null}_normalizePath(t,i){return t==null?t:(t=t.replace(/^\/+/,""),i!=null&&zn(t)&&(t=yA(t,i.itemUrl)),t==null?void 0:t.replace(/^\/+/,"").replace(/^(\.\/)?resources\//,""))}};v([M()],vc.prototype,"portalItem",void 0),v([M({type:String,value:null})],vc.prototype,"path",null),v([Rs("path")],vc.prototype,"_castPath",null),v([M({type:String,readOnly:!0})],vc.prototype,"url",null),v([M({type:String,readOnly:!0})],vc.prototype,"cdnUrl",null),v([M({type:String,readOnly:!0})],vc.prototype,"itemRelativeUrl",null),vc=v([fe("esri.portal.PortalItemResource")],vc);const KW=vc;let Ig=class extends Nt{constructor(t){super(t),this.created=null,this.rating=null}};v([M()],Ig.prototype,"created",void 0),v([M()],Ig.prototype,"rating",void 0),Ig=v([fe("esri.portal.PortalRating")],Ig);const IS=Ig;function __(e,t){var r;const i=(r=t==null?void 0:t.url)==null?void 0:r.path;if(e&&i&&(e=Xo(e,i,{preserveProtocolRelative:!0}),t.portalItem&&t.readResourcePaths)){const s=yA(e,t.portalItem.itemUrl);s!=null&&XW.test(s)&&t.readResourcePaths.push(t.portalItem.resourceFromPath(s).path)}return(e=mE(e,t==null?void 0:t.portal))&&Tx.test(e)?LA(e):e}function Sx(e,t,i=H0.YES){var s,n;if((e=e&&Tx.test(e)?_N(e):e)==null)return e;!zn(e)&&(t!=null&&t.blockedRelativeUrls)&&t.blockedRelativeUrls.push(e);let r=Xo(e);if(t){const c=((s=t.verifyItemRelativeUrls)==null?void 0:s.rootPath)||((n=t.url)==null?void 0:n.path);if(c){const o=mE(c,t.portal),f=mE(r,t.portal);r=yA(f,o,o),r!=null&&r!==f&&r!==e&&t.verifyItemRelativeUrls&&t.verifyItemRelativeUrls.writtenUrls.push(r)}}return r=OA(r,t==null?void 0:t.portal),zn(r)&&(r=ta(r)),t!=null&&t.resources&&(t!=null&&t.portalItem)&&!zn(r)&&!Cp(r)&&i===H0.YES&&t.resources.toKeep.push({resource:t.portalItem.resourceFromPath(r),compress:!1}),r}function RA(e,t,i){return __(e,i)}function xp(e,t,i,r){const s=Sx(e,r);s!==void 0&&(t[i]=s)}const Tx=/\/items\/([^\/]+)\/resources\/(.*)/,XW=/^\.\/resources\//;function QW(e){const t=(e==null?void 0:e.match(Tx))??null;return(t==null?void 0:t[1])??null}function eZ(e){const t=(e==null?void 0:e.match(Tx))??null;if(t==null)return null;const i=t[2],r=i.lastIndexOf("/");if(r===-1){const{path:c,extension:o}=x$(i);return{prefix:null,filename:c,extension:o}}const{path:s,extension:n}=x$(i.slice(r+1));return{prefix:i.slice(0,r),filename:s,extension:n}}function OA(e,t){return t&&!t.isPortal&&t.urlKey&&t.customBaseUrl?KT(e,`${t.urlKey}.${t.customBaseUrl}`,t.portalHostname):e}function mE(e,t){if(!t||t.isPortal||!t.urlKey||!t.customBaseUrl)return e;const i=`${t.urlKey}.${t.customBaseUrl}`,r=dA();return Im(r,`${r.scheme}://${i}`)?KT(e,t.portalHostname,i):KT(e,i,t.portalHostname)}function LA(e){if(!e)return e||null;let t=e;return t&&bi&&!bi.findCredential(t)&&(t=bi._normalizeAGOLorgDomain(t),t=t.replace(/^https?:\/\/www\.arcgis\.com/,"https://cdn.arcgis.com"),t=t.replace(/^https?:\/\/devext\.arcgis\.com/,"https://cdndev.arcgis.com"),t=t.replace(/^https?:\/\/qaext\.arcgis\.com/,"https://cdnqa.arcgis.com")),t}function _N(e){if(!e)return e||null;let t=e;return t=t.replace(/^https?:\/\/cdn\.arcgis\.com/,"https://www.arcgis.com"),t=t.replace(/^https?:\/\/cdndev\.arcgis\.com/,"https://devext.arcgis.com"),t=t.replace(/^https?:\/\/cdnqa\.arcgis\.com/,"https://qaext.arcgis.com"),t&&bi&&!bi.findCredential(t)&&(t=bi._normalizeAGOLorgDomain(t)),t}var H0;(function(e){e[e.YES=0]="YES",e[e.NO=1]="NO"})(H0||(H0={}));const oge=Object.freeze(Object.defineProperty({__proto__:null,get MarkKeep(){return H0},ensureMainOnlineDomain:OA,fromCDNUrl:_N,fromJSON:__,itemIdFromResourceUrl:QW,prefixAndFilenameFromResourceUrl:eZ,read:RA,toCDNUrl:LA,toJSON:Sx,write:xp},Symbol.toStringTag,{value:"Module"}));var dd;const tZ=new Set(["3DTiles Service","CSV","Feature Collection","Feature Service","Feed","GeoJson","Group Layer","Image Service","KML","Map Service","Media Layer","Scene Service","Stream Service","Vector Tile Service","WFS","WMS","WMTS"]),iZ=new Set(["KML","GeoJson","CSV"]);let ii=dd=class extends y_(dh){static from(e){return px(dd,e)}constructor(e){super(e),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.isOrgItem=!1,this.itemControl=null,this.licenseInfo=null,this.modified=null,this.name=null,this.numComments=null,this.numRatings=null,this.numViews=null,this.owner=null,this.ownerFolder=null,this.portal=null,this.screenshots=null,this.size=null,this.snippet=null,this.sourceJSON=null,this.sourceUrl=null,this.spatialReference=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}destroy(){this.portal=null}get displayName(){const e=this.type,t=this.typeKeywords||[];let i=e;return e==="Feature Service"||e==="Feature Collection"?i=t.includes("Table")?"Table":t.includes("Route Layer")?"Route Layer":t.includes("Markup")?"Markup":"Feature Layer":e==="Image Service"?i=t.includes("Elevation 3D Layer")?"Elevation Layer":t.includes("Tiled Imagery")?"Tiled Imagery Layer":"Imagery Layer":e==="Scene Service"?i="Scene Layer":e==="Video Service"?i="Video Layer":e==="Scene Package"?i="Scene Layer Package":e==="Stream Service"?i="Feature Layer":e==="Geoprocessing Service"?i=t.includes("Web Tool")?"Tool":"Geoprocessing Service":e==="Geoenrichment Service"?i="GeoEnrichment Service":e==="Geocoding Service"?i="Locator":e==="Microsoft Powerpoint"?i="Microsoft PowerPoint":e==="GeoJson"?i="GeoJSON":e==="Globe Service"?i="Globe Layer":e==="Vector Tile Service"?i="Tile Layer":e==="netCDF"?i="NetCDF":e==="Map Service"?i=t.includes("Spatiotemporal")||!t.includes("Hosted Service")&&!t.includes("Tiled")||t.includes("Relational")?"Map Image Layer":"Tile Layer":e&&e.toLowerCase().includes("add in")?i=e.replaceAll(/(add in)/gi,"Add-In"):e==="datastore catalog service"?i="Big Data File Share":e==="Compact Tile Package"?i="Tile Package (tpkx)":e==="Raster function template"?i="Raster Function Template":e==="OGCFeatureServer"?i="OGC Feature Layer":e==="web mapping application"&&t.includes("configurableApp")?i="Instant App":e==="Insights Page"?i="Insights Report":e==="Excalibur Imagery Project"?i="Excalibur Project":e==="3DTiles Service"?i="3D tiles layer":e==="3DTiles Package"&&(i="3D tiles package"),i}readExtent(e){return e&&e.length?new Ui(e[0][0],e[0][1],e[1][0],e[1][1]):null}get iconUrl(){var O;const e=((O=this.type)==null?void 0:O.toLowerCase())||"",t=this.typeKeywords||[],i="esri/images/portal/",r="16";let s,n=!1,c=!1,o=!1,f=!1,g=!1,S=!1,I=!1,A=!1;return e.indexOf("service")>0||e==="feature collection"||e==="kml"||e==="wms"||e==="wmts"||e==="wfs"?(n=t.includes("Hosted Service"),e==="feature service"||e==="feature collection"||e==="kml"||e==="wfs"?(c=t.includes("Table"),o=t.includes("Route Layer"),f=t.includes("Markup"),g=t.includes("Spatiotemporal"),S=t.includes("UtilityNetwork"),s=g&&c?"spatiotemporaltable":c?"table":o?"routelayer":f?"markup":g?"spatiotemporal":S?"utilitynetwork":n?"featureshosted":"features"):e==="map service"||e==="wms"||e==="wmts"?(g=t.includes("Spatiotemporal"),I=t.includes("Relational"),s=g||I?"mapimages":n||t.includes("Tiled")||e==="wmts"?"maptiles":"mapimages"):s=e==="scene service"?t.includes("Line")?"sceneweblayerline":t.includes("3DObject")?"sceneweblayermultipatch":t.includes("Point")?"sceneweblayerpoint":t.includes("IntegratedMesh")?"sceneweblayermesh":t.includes("PointCloud")?"sceneweblayerpointcloud":t.includes("Polygon")?"sceneweblayerpolygon":t.includes("Building")?"sceneweblayerbuilding":t.includes("Voxel")?"sceneweblayervoxel":"sceneweblayer":e==="image service"?t.includes("Elevation 3D Layer")?"elevationlayer":t.includes("Tiled Imagery")?"tiledimagerylayer":"imagery":e==="stream service"?"streamlayer":e==="vector tile service"?"vectortile":e==="datastore catalog service"?"datastorecollection":e==="geocoding service"?"geocodeservice":e==="video service"?t.includes("Live Stream")?"livestreamvideolayer":"videolayer":e==="geoprocessing service"?t.includes("Web Tool")?"tool":"layers":e==="geodata service"?"geodataservice":e==="3dtiles service"?t.includes("3DObject")?"3dobjecttileslayer":t.includes("IntegratedMesh")?"integratedmeshtileslayer":"3dtileslayer":"layers"):e==="web map"||e==="cityengine web scene"?s="maps":e==="web scene"?s=t.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal":e==="web mapping application"&&t.includes("configurableApp")?s="instantapps":e==="web mapping application"||e==="mobile application"||e==="application"||e==="operation view"||e==="desktop application"?s="apps":e==="map document"||e==="map package"||e==="published map"||e==="scene document"||e==="globe document"||e==="basemap package"||e==="mobile basemap package"||e==="mobile map package"||e==="project package"||e==="project template"||e==="pro map"||e==="layout"||e==="layer"&&t.includes("ArcGIS Pro")||e==="explorer map"&&t.indexOf("Explorer Document")?s="mapsgray":e==="service definition"||e==="shapefile"||e==="cad drawing"||e==="geojson"||e==="netcdf"||e==="administrative report"?s="datafiles":e==="360 vr experience"?s="360vr":e==="explorer add in"||e==="desktop add in"||e==="windows viewer add in"||e==="windows viewer configuration"?s="appsgray":e==="arcgis pro add in"||e==="arcgis pro configuration"?s="addindesktop":e==="pdf"?s="pdf":e==="microsoft word"?s="word":e==="microsoft excel"?s="excel":e==="microsoft powerpoint"?s="ppt":e==="rule package"||e==="file geodatabase"||e==="sqlite geodatabase"||e==="csv collection"||e==="kml collection"||e==="windows mobile package"||e==="map template"||e==="desktop application template"||e==="gml"||e==="arcpad package"||e==="code sample"||e==="document link"||e==="earth configuration"||e==="operations dashboard add in"||e==="rules package"||e==="workflow manager package"||e==="explorer map"&&t.includes("Explorer Mapping Application")||t.includes("Document")?s="datafilesgray":e==="network analysis service"||e==="geoprocessing service"||e==="geodata service"||e==="geometry service"||e==="geoprocessing package"||e==="locator package"||e==="geoprocessing sample"||e==="workflow manager service"?s="toolsgray":e==="layer"||e==="layer package"||e==="explorer layer"?s="layersgray":e==="scene package"?s="scenepackage":e==="3dtiles package"?s="3dtileslayerpackage":e==="3dtiles service"?s="3dtileslayer":e==="mobile scene package"?s="mobilescenepackage":e==="tile package"||e==="compact tile package"?s="tilepackage":e==="task file"?s="taskfile":e==="report template"?s="report-template":e==="statistical data collection"?s="statisticaldatacollection":e==="insights workbook"?s="workbook":e==="insights model"?s="insightsmodel":e==="insights page"?s="insightspage":e==="insights theme"?s="insightstheme":e==="hub initiative"?s="hubinitiative":e==="hub page"?s="hubpage":e==="hub site application"?s="hubsite":e==="hub event"?s="hubevent":e==="hub project"?s="hubproject":e==="relational database connection"?s="relationaldatabaseconnection":e==="big data file share"?s="datastorecollection":e==="image collection"?s="imagecollection":e==="desktop style"?s="desktopstyle":e==="style"?s="style":e==="dashboard"?s="dashboard":e==="raster function template"?s="rasterprocessingtemplate":e==="vector tile package"?s="vectortilepackage":e==="ortho mapping project"?s="orthomappingproject":e==="ortho mapping template"?s="orthomappingtemplate":e==="solution"?s="solutions":e==="geopackage"?s="geopackage":e==="deep learning package"?s="deeplearningpackage":e==="real time analytic"?s="realtimeanalytics":e==="big data analytic"?s="bigdataanalytics":e==="feed"?s="feed":e==="excalibur imagery project"?s="excaliburimageryproject":e==="notebook"?s="notebook":e==="storymap"?s="storymap":e==="survey123 add in"?s="survey123addin":e==="mission"?s="mission":e==="mission report"?s="missionreport":e==="mission template"?s="missiontemplate":e==="quickcapture project"?s="quickcaptureproject":e==="pro report"?s="proreport":e==="pro report template"?s="proreporttemplate":e==="urban model"?s="urbanmodel":e==="web experience"?s="experiencebuilder":e==="web experience template"?s="webexperiencetemplate":e==="experience builder widget"?s="experiencebuilderwidget":e==="experience builder widget package"?s="experiencebuilderwidgetpackage":e==="workflow"?s="workflow":e==="kernel gateway connection"?s="kernelgatewayconnection":e==="insights script"?s="insightsscript":e==="hub initiative template"?s="hubinitiativetemplate":e==="storymap theme"?s="storymaptheme":e==="knowledge graph"?s="knowledgegraph":e==="knowledge studio project"?s="knowledgestudio":e==="native application"?s="nativeapp":e==="native application installer"?s="nativeappinstaller":e==="web link chart"?s="linkchart":e==="knowledge graph web investigation"?s="investigation":e==="ogcfeatureserver"?s="features":e==="pro project"?s="proproject":e==="insights workbook package"?s="insightsworkbookpackage":e==="apache parquet"?s="apacheparquet":e==="notebook code snippets"||e==="notebook code snippet library"?s="notebookcodesnippets":e==="suitability model"?s="suitabilitymodel":e==="esri classifier definition"?s="classifierdefinition":e==="esri classification schema"?s="classificationschema":e==="insights data engineering workbook"?s="dataengineeringworkbook":e==="insights data engineering model"?s="dataengineeringmodel":e==="deep learning studio project"?s="deeplearningproject":e==="discussion"?s="discussion":e==="allsource project"?s="allsourceproject":e==="api key"?s="apikey":e==="data pipeline"?s="datapipelines":e==="group layer"?(A=t.includes("Map"),s=A?"layergroup2d":"layergroup"):s=e==="media layer"?"onlinemedialayer":e==="form"?t.includes("Survey123")?"survey":"datafilesgray":e==="csv"?"csv":e==="image"?"image":"maps",s?Ri(i+s+r+".png"):null}get isLayer(){return this.type!=null&&tZ.has(this.type)}get itemCdnUrl(){return LA(this.itemUrl)}get itemPageUrl(){var t;const e=(t=this.portal)==null?void 0:t.itemPageUrl;return e&&this.id?`${e}?id=${this.id}`:null}get itemUrl(){var t;const e=(t=this.portal)==null?void 0:t.restUrl;return e&&this.id?`${e}/content/items/${this.id}`:null}get thumbnailUrl(){var i;const e=this.itemUrl,t=this.thumbnail;return e&&t?((i=this.portal)==null?void 0:i.normalizeUrl(`${e}/info/${t}?f=json`))??null:null}get userItemUrl(){var i,r,s;const e=(i=this.portal)==null?void 0:i.restUrl;if(!e)return null;const t=this.owner||((s=(r=this.portal)==null?void 0:r.user)==null?void 0:s.username);return t?`${e}/content/users/${this.ownerFolder?`${t}/${this.ownerFolder}`:t}/items/${this.id}`:null}load(e){const t=this.portal??(this.portal=Za.getDefault()),i=t.load(e).then(()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?t.request(this.itemUrl,{signal:e!=null?e.signal:null,query:{token:this.apiKey}}):{}).then(r=>{this.sourceJSON=r,this.read(r)});return this.addResolvingPromise(i),Promise.resolve(this)}async addRating(e){const t={method:"post",query:{}};return e instanceof IS&&(e=e.rating),e==null||isNaN(e)||typeof e!="number"||(t.query.rating=e),this.portal?(await this.portal.request(this.itemUrl+"/addRating",t),new IS({rating:e,created:new Date})):null}clone(){const e={access:this.access,accessInformation:this.accessInformation,applicationProxies:He(this.applicationProxies),avgRating:this.avgRating,categories:He(this.categories),created:He(this.created),culture:this.culture,description:this.description,extent:He(this.extent),groupCategories:He(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:He(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:He(this.screenshots),size:this.size,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:He(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:He(this.typeKeywords),url:this.url};this.loaded&&(e.loadStatus="loaded");const t=new dd({sourceJSON:this.sourceJSON}).set(e);return t._set("isOrgItem",this.isOrgItem),t}createPostQuery(){var i;const e=this.toJSON();for(const r of["tags","typeKeywords","categories"])e[r]=(i=e[r])==null?void 0:i.join(", ");const{extent:t}=e;return t&&(e.extent=JSON.stringify(t)),e}async deleteRating(){await this.portal.request(this.itemUrl+"/deleteRating",{method:"post"})}fetchData(e="json",t){return this.portal.request(this.itemUrl+"/data",{responseType:e,...t,query:{token:this.apiKey}})}async fetchRating(e){const t=await this.portal.request(this.itemUrl+"/rating",{query:{token:this.apiKey},...e});return t.rating!=null?(t.created=new Date(t.created),new IS(t)):null}fetchRelatedItems(e,t){return this.portal.requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...e,token:this.apiKey},...t},dd)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){return this.portal.request(this.itemUrl??"",{cacheBust:!0,query:{token:this.apiKey}}).then(e=>(this.sourceJSON=e,this.read(e),this))}update(e){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const t=e==null?void 0:e.data,i={method:"post"};i.query=this.createPostQuery();for(const r in i.query)i.query[r]===null&&(i.query[r]="");return i.query.clearEmptyFields=!0,t!=null&&(typeof t=="string"?i.query.text=t:typeof t=="object"&&(i.query.text=JSON.stringify(t))),this.portal.request(`${this.userItemUrl}/update`,i).then(()=>this.reload())}):Promise.reject(new Je("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async copy(e){if(!this.id)throw new Je("portal:item-does-not-exist","The item does not exist yet");await this.load();const{portal:t,itemUrl:i}=this;await t.signIn();const{copyResources:r,folder:s,tags:n,title:c}=e||{},o={method:"post",query:{copyPrivateResources:r==="all",folder:typeof s=="string"?s:s==null?void 0:s.id,includeResources:!!r,tags:n==null?void 0:n.join(","),title:c}},{itemId:f}=await t.request(`${i}/copy`,o);return new dd({id:f,portal:t})}updateThumbnail(e){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const t=e.thumbnail,i=e.filename,r={method:"post"};if(typeof t=="string")Cp(t)?r.query={data:t}:r.query={url:Xo(t)},i!=null&&(r.query.filename=i);else{const s=new FormData;i!=null?s.append("file",t,i):s.append("file",t),r.body=s}return this.portal.request(`${this.userItemUrl}/updateThumbnail`,r).then(()=>this.reload())}):Promise.reject(new Je("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(e={},t){const{fetchResources:i}=await ht(()=>import("./resourceUtils-CfE36DzP.js"),[]);return i(this,e,t)}async addResource(e,t,i){const{addOrUpdateResources:r}=await ht(()=>import("./resourceUtils-CfE36DzP.js"),[]);return e.portalItem=this,await r(this,[{resource:e,content:t,compress:i==null?void 0:i.compress,access:i==null?void 0:i.access}],"add",i),e}async removeResource(e,t){const{removeResource:i}=await ht(()=>import("./resourceUtils-CfE36DzP.js"),[]);if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new Je("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return i(this,e,t)}async removeAllResources(e){const{removeAllResources:t}=await ht(()=>import("./resourceUtils-CfE36DzP.js"),[]);return t(this,e)}resourceFromPath(e){return new KW({portalItem:this,path:e})}toJSON(){var i,r;const e=this.extent,t={accessInformation:this.accessInformation,categories:He(this.categories),created:(i=this.created)==null?void 0:i.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,isOrgItem:this.isOrgItem,licenseInfo:this.licenseInfo,modified:(r=this.modified)==null?void 0:r.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:He(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:He(this.typeKeywords),url:this.url};return I5(t)}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new dd({sourceJSON:e})}_getPostQuery(){const e=this.toJSON();for(const t in e)t==="tags"&&e[t]!==null&&(e[t]=e[t].join(", ")),t==="typeKeywords"&&e[t]!==null&&(e[t]=e[t].join(", ")),t==="extent"&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}};v([M({type:["private","shared","org","public"]})],ii.prototype,"access",void 0),v([M()],ii.prototype,"accessInformation",void 0),v([M({type:String})],ii.prototype,"apiKey",void 0),v([M({json:{read:{source:"appProxies"}}})],ii.prototype,"applicationProxies",void 0),v([M()],ii.prototype,"avgRating",void 0),v([M()],ii.prototype,"categories",void 0),v([M({type:Date})],ii.prototype,"created",void 0),v([M()],ii.prototype,"culture",void 0),v([M()],ii.prototype,"description",void 0),v([M({readOnly:!0})],ii.prototype,"displayName",null),v([M({type:Ui})],ii.prototype,"extent",void 0),v([mi("extent")],ii.prototype,"readExtent",null),v([M()],ii.prototype,"groupCategories",void 0),v([M({readOnly:!0})],ii.prototype,"iconUrl",null),v([M()],ii.prototype,"id",void 0),v([M({readOnly:!0})],ii.prototype,"isLayer",null),v([M({type:Boolean,readOnly:!0})],ii.prototype,"isOrgItem",void 0),v([M()],ii.prototype,"itemControl",void 0),v([M({readOnly:!0})],ii.prototype,"itemPageUrl",null),v([M({readOnly:!0})],ii.prototype,"itemUrl",null),v([M()],ii.prototype,"licenseInfo",void 0),v([M({type:Date})],ii.prototype,"modified",void 0),v([M()],ii.prototype,"name",void 0),v([M()],ii.prototype,"numComments",void 0),v([M()],ii.prototype,"numRatings",void 0),v([M()],ii.prototype,"numViews",void 0),v([M()],ii.prototype,"owner",void 0),v([M()],ii.prototype,"ownerFolder",void 0),v([M({type:Za})],ii.prototype,"portal",void 0),v([M()],ii.prototype,"screenshots",void 0),v([M()],ii.prototype,"size",void 0),v([M()],ii.prototype,"snippet",void 0),v([M()],ii.prototype,"sourceJSON",void 0),v([M({type:String})],ii.prototype,"sourceUrl",void 0),v([M({type:String})],ii.prototype,"spatialReference",void 0),v([M()],ii.prototype,"tags",void 0),v([M()],ii.prototype,"thumbnail",void 0),v([M({readOnly:!0})],ii.prototype,"thumbnailUrl",null),v([M()],ii.prototype,"title",void 0),v([M()],ii.prototype,"type",void 0),v([M()],ii.prototype,"typeKeywords",void 0),v([M({type:String,json:{read(e,t){var i;if(iZ.has(t.type)){const r=(i=this.portal)==null?void 0:i.restUrl;e||(e=r&&this.id?`${r}/content/items/${this.id}/data`:null)}return e}}})],ii.prototype,"url",void 0),v([M({readOnly:!0})],ii.prototype,"userItemUrl",null),ii=dd=v([fe("esri.portal.PortalItem")],ii);const _0=ii,vN=Object.freeze(Object.defineProperty({__proto__:null,default:_0},Symbol.toStringTag,{value:"Module"})),z$=/^([a-z]{2})(?:[-_]([A-Za-z]{2}))?$/,rZ={ar:!0,bg:!0,bs:!0,ca:!0,cs:!0,da:!0,de:!0,el:!0,en:!0,es:!0,et:!0,fi:!0,fr:!0,he:!0,hr:!0,hu:!0,id:!0,it:!0,ja:!0,ko:!0,lt:!0,lv:!0,nb:!0,nl:!0,pl:!0,"pt-BR":!0,"pt-PT":!0,ro:!0,ru:!0,sk:!0,sl:!0,sr:!0,sv:!0,th:!0,tr:!0,uk:!0,vi:!0,"zh-CN":!0,"zh-HK":!0,"zh-TW":!0};function F$(e){return e in rZ}const Ag=[],mm=new Map;function B$(e){for(const t of mm.keys())bN(e.pattern,t)&&mm.delete(t)}function sZ(e){return Ag.includes(e)||(B$(e),Ag.unshift(e)),er(()=>{const t=Ag.indexOf(e);t>-1&&(Ag.splice(t,1),B$(e))})}async function DA(e){const t=wo();mm.has(e)||mm.set(e,oZ(e,t));const i=mm.get(e);return i&&await aZ.add(i),i}function nZ(e){if(!z$.test(e))return null;const t=z$.exec(e);if(t===null)return null;const[,i,r]=t,s=i+(r?"-"+r.toUpperCase():"");return F$(s)?s:F$(i)?i:null}async function oZ(e,t){const i=[];for(const r of Ag)if(bN(r.pattern,e))try{return await r.fetchMessageBundle(e,t)}catch(s){i.push(s)}throw i.length?new Je("intl:message-bundle-error",`Errors occurred while loading "${e}"`,{errors:i}):new Je("intl:no-message-bundle-loader",`No loader found for message bundle "${e}"`)}function bN(e,t){return typeof e=="string"?t.startsWith(e):e.test(t)}$A(()=>{mm.clear()});const aZ=new class{constructor(){this._numLoading=0,this._dfd=null}async waitForAll(){this._dfd&&await this._dfd.promise}add(e){return this._increase(),e.then(()=>this._decrease(),()=>this._decrease()),this.waitForAll()}_increase(){this._numLoading++,this._dfd||(this._dfd=sa())}_decrease(){this._numLoading=Math.max(this._numLoading-1,0),this._dfd&&this._numLoading===0&&(this._dfd.resolve(),this._dfd=null)}};async function lZ(e){if(!e)return;const t=e.includes("-vector")?e.slice(0,e.indexOf("-vector")):e.includes("-3d")?e.slice(0,e.indexOf("-3d")):e,i=await DA("esri/t9n/basemaps");return i[e]||i[t]}const yE={satellite:{id:"satellite",classic:!0,get thumbnailUrl(){return Ri("esri/images/basemap/satellite.jpg")},baseMapLayers:[{id:"satellite-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1}]},hybrid:{id:"hybrid",classic:!0,get thumbnailUrl(){return Ri("esri/images/basemap/hybrid.jpg")},baseMapLayers:[{id:"hybrid-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1},{id:"hybrid-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/30d6b8271e1849cd9c3042060001f425/resources/styles/root.json",layerType:"VectorTileLayer",title:"Hybrid Reference Layer",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},terrain:{id:"terrain",classic:!0,get thumbnailUrl(){return Ri("esri/images/basemap/terrain.jpg")},baseMapLayers:[{id:"terrain-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Terrain Base",showLegend:!1,visibility:!0,opacity:1},{id:"terrain-reference-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Reference Overlay",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},oceans:{id:"oceans",classic:!0,get thumbnailUrl(){return Ri("esri/images/basemap/oceans.jpg")},baseMapLayers:[{id:"oceans-base-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Base",showLegend:!1,visibility:!0,opacity:1},{id:"oceans-reference-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},osm:{id:"osm",classic:!0,get thumbnailUrl(){return Ri("esri/images/basemap/osm.jpg")},baseMapLayers:[{id:"osm-base-layer",layerType:"OpenStreetMap",title:"Open Street Map",showLegend:!1,visibility:!0,opacity:1}]},"dark-gray-vector":{id:"dark-gray-vector",classic:!0,get thumbnailUrl(){return Ri("esri/images/basemap/dark-gray-vector.jpg")},baseMapLayers:[{id:"dark-gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/5e9b3685f4c24d8781073dd928ebda50/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Base",visibility:!0,opacity:1},{id:"dark-gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/747cb7a5329c478cbe6981076cc879c5/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get"dark-gray"(){return{...this["dark-gray-vector"],id:"dark-gray"}},"gray-vector":{id:"gray-vector",classic:!0,get thumbnailUrl(){return Ri("esri/images/basemap/gray-vector.jpg")},baseMapLayers:[{id:"gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/291da5eab3a0412593b66d384379f89f/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Base",visibility:!0,opacity:1},{id:"gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/1768e8369a214dfab4e2167d5c5f2454/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get gray(){return{...this["gray-vector"],id:"gray"}},"streets-vector":{id:"streets-vector",classic:!0,get thumbnailUrl(){return Ri("esri/images/basemap/streets-vector.jpg")},baseMapLayers:[{id:"streets-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/de26a3cf4cc9451298ea173c4b324736/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets",visibility:!0,opacity:1}]},get streets(){return{...this["streets-vector"],id:"streets"}},"topo-vector":{id:"topo-vector",classic:!0,get thumbnailUrl(){return Ri("esri/images/basemap/topo-vector.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"topo-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/7dc6cea0b1764a1f9af2e679f642f0f5/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Topo",visibility:!0,opacity:1}]},get topo(){return{...this["topo-vector"],id:"topo"}},"streets-night-vector":{id:"streets-night-vector",classic:!0,get thumbnailUrl(){return Ri("esri/images/basemap/streets-night.jpg")},baseMapLayers:[{id:"streets-night-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/86f556a2d1fd468181855a35e344567f/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Night",visibility:!0,opacity:1}]},"streets-relief-vector":{id:"streets-relief-vector",classic:!0,get thumbnailUrl(){return Ri("esri/images/basemap/streets-relief.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"streets-relief-vector-base-layer",styleUrl:"//www.arcgis.com/sharing/rest/content/items/b266e6d17fc345b498345613930fbd76/resources/styles/root.json",title:"World Streets Relief",layerType:"VectorTileLayer",visibility:!0,opacity:1}]},"streets-navigation-vector":{id:"streets-navigation-vector",classic:!0,get thumbnailUrl(){return Ri("esri/images/basemap/streets-navigation.jpg")},baseMapLayers:[{id:"streets-navigation-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/63c47b7177f946b49902c24129b87252/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Navigation",visibility:!0,opacity:1}]},"topo-3d":{id:"topo-3d",is3d:!0,get thumbnailUrl(){return Ri("esri/images/basemap/topo-3d.png")},baseMapLayers:[{id:"topo-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/1e7d1784d1ef4b79ba6764d0bd6c3150/resources/styles/root.json",layerType:"VectorTileLayer",title:"Topographic",visibility:!0,opacity:1},{id:"topo-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Trees_Thematic_v1/SceneServer",itemId:"f75fef56b2d944fe92ef9f7737b4f953",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"navigation-3d":{id:"navigation-3d",is3d:!0,get thumbnailUrl(){return Ri("esri/images/basemap/navigation-3d.jpg")},baseMapLayers:[{id:"navigation-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/ccc904ff872b4144b94934e55e32784b/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation",visibility:!0,opacity:1},{id:"navigation-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"streets-3d":{id:"streets-3d",is3d:!0,get thumbnailUrl(){return Ri("esri/images/basemap/streets-3d.png")},baseMapLayers:[{id:"streets-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/198298c4c64c4cb19de5b46aa00c198d/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"streets-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"streets-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"osm-3d":{id:"osm-3d",is3d:!0,get thumbnailUrl(){return Ri("esri/images/basemap/osm-3d.png")},baseMapLayers:[{id:"osm-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/8628d259c9d14bdc848771c23c513940/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap",visibility:!0,opacity:1},{id:"osm-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Trees_Thematic_v1/SceneServer",itemId:"f75fef56b2d944fe92ef9f7737b4f953",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"gray-3d":{id:"gray-3d",is3d:!0,get thumbnailUrl(){return Ri("esri/images/basemap/gray-3d.png")},baseMapLayers:[{id:"gray-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/01a14b466345455ba4176d2e6390db92/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"navigation-dark-3d":{id:"navigation-dark-3d",itemId:"5a1365328b4943f09a54cf5fd1205707",is3d:!0,baseMapLayers:[{id:"navigation-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/451a1777ab3f4bf095fae24a117439d9/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation Dark"},{id:"navigation-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"streets-dark-3d":{id:"streets-dark-3d",itemId:"8a4efa2c20484ec9b4557895e65736ff",is3d:!0,baseMapLayers:[{id:"streets-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/bc599b6d741a4ac084b7eea7bf8c5938/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Streets Night (for 3D)"},{id:"streets-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"streets-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"dark-gray-3d":{id:"dark-gray-3d",itemId:"a8b7322a5fe94002bb0f5e0eeb0c5c18",is3d:!0,baseMapLayers:[{id:"dark-gray-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/4178f71acb934fb89f169e7d667c20c6/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Dark Gray Canvas (for 3D)"},{id:"dark-gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"dark-gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"arcgis-imagery":{get thumbnailUrl(){return Ri("esri/images/basemap/hybrid.jpg")},title:"Imagery Hybrid",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Imagery",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Imagery:Labels",title:"Hybrid Reference Layer",isReference:!0}]},"arcgis-imagery-standard":{get thumbnailUrl(){return Ri("esri/images/basemap/satellite.jpg")},title:"Imagery",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Imagery",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"}]},"arcgis-imagery-labels":{title:"Hybrid [Reference]",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Imagery:Labels",title:"Hybrid Reference Layer",isReference:!0}]},"arcgis-light-gray":{get thumbnailUrl(){return Ri("esri/images/basemap/gray-vector.jpg")},title:"Light Gray Canvas",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:LightGray:Base",title:"Light Gray Canvas Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:LightGray:Labels",title:"Light Gray Canvas Labels",isReference:!0}]},"arcgis-dark-gray":{get thumbnailUrl(){return Ri("esri/images/basemap/dark-gray.jpg")},title:"Dark Gray Canvas",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:DarkGray:Base",title:"Dark Gray Canvas Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:DarkGray:Labels",title:"Dark Gray Canvas Labels",isReference:!0}]},"arcgis-navigation":{get thumbnailUrl(){return Ri("esri/images/basemap/streets-navigation.jpg")},title:"Navigation",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Navigation",title:"World Navigation Map"}]},"arcgis-navigation-night":{title:"Navigation (Dark Mode)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:NavigationNight",title:"World Navigation Map (Dark Mode)"}]},"arcgis-streets":{get thumbnailUrl(){return Ri("esri/images/basemap/streets-vector.jpg")},title:"Streets",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Streets",title:"World Street Map"}]},"arcgis-streets-night":{get thumbnailUrl(){return Ri("esri/images/basemap/streets-night.jpg")},title:"Streets (Night)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:StreetsNight",title:"World Street Map (Night)"}]},"arcgis-streets-relief":{get thumbnailUrl(){return Ri("esri/images/basemap/streets-relief.jpg")},title:"Streets (with Relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:StreetsRelief:Base",title:"World Street Map (with Relief)"}]},"arcgis-topographic":{get thumbnailUrl(){return Ri("esri/images/basemap/topo.jpg")},title:"Topographic",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Topographic:Base",title:"World Topographic Map"}]},"arcgis-oceans":{get thumbnailUrl(){return Ri("esri/images/basemap/oceans.jpg")},title:"Oceans",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Ocean Base",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Oceans:Labels",title:"World Ocean Reference",isReference:!0}]},"osm-standard":{title:"OpenStreetMap",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:Standard",title:"OpenStreetMap"}]},"osm-standard-relief":{title:"OpenStreetMap (with relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:StandardRelief:Base",layerType:"VectorTileLayer",title:"OpenStreetMap Relief Base"}]},"osm-streets":{title:"OpenStreetMap (Streets)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:Streets",title:"OpenStreetMap (Streets)"}]},"osm-streets-relief":{title:"OpenStreetMap (Streets with relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:StreetsRelief:Base",layerType:"VectorTileLayer",title:"OpenStreetMap Relief Base"}]},"osm-light-gray":{title:"OpenStreetMap (Light Gray Canvas)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:LightGray:Base",title:"OSM (Light Gray Base)"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:LightGray:Labels",title:"OSM (Light Gray Reference)",isReference:!0}]},"osm-dark-gray":{title:"OpenStreetMap (Dark Gray Canvas)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:DarkGray:Base",title:"OSM (Dark Gray Base)"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:DarkGray:Labels",title:"OSM (Dark Gray Reference)",isReference:!0}]},"arcgis-terrain":{title:"Terrain with Labels",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Terrain:Base",title:"World Terrain Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Terrain:Detail",title:"World Terrain Reference",isReference:!0}]},"arcgis-community":{title:"Community",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Community",title:"Community"}]},"arcgis-charted-territory":{title:"Charted Territory",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ChartedTerritory:Base",title:"Charted Territory"}]},"arcgis-colored-pencil":{title:"Colored Pencil",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ColoredPencil",title:"Colored Pencil"}]},"arcgis-nova":{title:"Nova",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Nova",title:"Nova"}]},"arcgis-modern-antique":{title:"Modern Antique",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ModernAntique:Base",title:"Modern Antique"}]},"arcgis-midcentury":{title:"Mid-Century",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Midcentury",title:"Mid-Century"}]},"arcgis-newspaper":{title:"Newspaper",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Newspaper",title:"Newspaper"}]},"arcgis-hillshade-light":{title:"Hillshade",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"}]},"arcgis-hillshade-dark":{title:"Hillshade (Dark)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade (Dark)",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade_Dark/MapServer"}]},"arcgis-human-geography":{title:"Human Geography",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Base",title:"Human Geography Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Detail",title:"Human Geography Detail",isReference:!0},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Label",title:"Human Geography Label",isReference:!0}]},"arcgis-human-geography-dark":{title:"Human Geography (Dark)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Base",title:"Human Geography Dark Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Detail",title:"Human Geography Dark Detail",isReference:!0},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Label",title:"Human Geography Dark Label",isReference:!0}]}},cZ=new Set(["ar","bs","ca","hr","cs","da","nl","en","et","fi","fr","de","el","he","hu","id","it","ja","ko","lv","lt","nb","pl","ro","ru","sr","es","sv","th","tr","uk","vi"]);let Iu=class extends Nt{constructor(t){super(t),this.id=null,this.language=null,this.places=null,this.serviceUrl="https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/webmaps",this.worldview=null}getLanguageParamValue(){if(this.language)return this.language;const t=wo().toLowerCase();switch(t){case"pt-br":return"pt-BR";case"pt-pt":return"pt-PT";case"zh-cn":return"zh-CN";case"zh-hk":return"zh-HK";case"zh-tw":return"zh-TW"}const i=GW(t);return i==="pt"?"pt-BR":i&&cZ.has(i)?i:"global"}};v([M()],Iu.prototype,"id",void 0),v([M()],Iu.prototype,"language",void 0),v([M()],Iu.prototype,"places",void 0),v([M()],Iu.prototype,"serviceUrl",void 0),v([M()],Iu.prototype,"worldview",void 0),Iu=v([fe("esri.support.BasemapStyle")],Iu);const uZ=Iu;function hZ(e){return e!=null&&typeof e=="object"&&"type"in e&&e.type==="subtype-group"&&"sublayers"in e}function Tf(e){return(e==null?void 0:e.type)==="subtype-sublayer"}const lge={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function cge(e){const t=e==null?void 0:e.type;return t==="building-scene"||t==="integrated-mesh"||t==="point-cloud"||t==="scene"}function Ex(e){var t;return(e==null?void 0:e.type)==="feature"&&!e.url&&((t=e.source)==null?void 0:t.type)==="memory"}function uge(e){var t;return((e==null?void 0:e.type)==="feature"||(e==null?void 0:e.type)==="subtype-group")&&((t=e.source)==null?void 0:t.type)==="feature-layer"}async function dZ(e,t){const i=bi==null?void 0:bi.findServerInfo(e);if((i==null?void 0:i.currentVersion)!=null)return i.owningSystemUrl||null;const r=e.toLowerCase().indexOf("/rest/services");if(r===-1)return null;const s=`${e.substring(0,r)}/rest/info`,n=t!=null?t.signal:null,{data:c}=await Qi(s,{query:{f:"json"},responseType:"json",signal:n});return(c==null?void 0:c.owningSystemUrl)||null}function pZ(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}function fZ(e){return pZ(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function mZ(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}function yZ(e){return!!mZ(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}const gZ=new Set(["bing-maps","imagery","imagery-tile","map-image","open-street-map","tile","unknown","unsupported","vector-tile","web-tile","wms","wmts"]),_Z=new Set(["csv","feature","geo-rss","geojson","group","imagery","imagery-tile","kml","map-image","map-notes","media","ogc-feature","oriented-imagery","route","stream","subtype-group","tile","unknown","unsupported","vector-tile","web-tile","wfs","wms","wmts"]);function vZ(e){return e.layerContainerType==="basemap"?gZ:e.layerContainerType==="operational-layers"?_Z:null}function bZ(e,t){if(t.restrictedWebMapWriting){const i=vZ(t);return i==null||i.has(e.type)&&!Ex(e)}return!0}function wZ(e,t){var i;if(t)if(Ex(e)){const r=ax("featureCollection.layers",t),s=(i=r==null?void 0:r[0])==null?void 0:i.layerDefinition;s&&U$(e,s)}else e.type!=="group"&&U$(e,t)}function U$(e,t){"maxScale"in e&&(t.maxScale=sw(e.maxScale)??void 0),"minScale"in e&&(t.minScale=sw(e.minScale)??void 0)}function xZ(e,t){if(wZ(e,t),t&&(t.id=e.id,"blendMode"in e&&(t.blendMode=e.blendMode,t.blendMode==="normal"&&delete t.blendMode),t.opacity=sw(e.opacity)??void 0,t.title=e.title||"Layer",t.visibility=e.visible,"legendEnabled"in e&&e.type!=="wmts"))if(Ex(e)){const i=t.featureCollection;i&&(i.showLegend=e.legendEnabled)}else t.showLegend=e.legendEnabled}function j$(e,t,i){if(!e.persistenceEnabled)return null;if(!("write"in e)||!e.write)return i!=null&&i.messages&&i.messages.push(new Je("layer:unsupported",`Layers (${e.title}, ${e.id}) of type '${e.declaredClass}' cannot be persisted`,{layer:e})),null;if(Ex(e)&&!e.isTable)t=e.resourceInfo;else if(bZ(e,i)){const r={};return e.write(r,i)?r:null}return t!=null&&xZ(e,t=He(t)),t}var Pg;let SZ=0;const TZ="esri.Basemap";let yo=Pg=class extends y_(dh){constructor(e){super(e),this.id=null,this.portalItem=null,this.spatialReference=null,this.style=null,this.thumbnailUrl=null,this.title="Basemap",this.id=Date.now().toString(16)+"-basemap-"+SZ++,this.baseLayers=new Bt,this.referenceLayers=new Bt;const t=r=>{r.parent&&r.parent!==this&&"remove"in r.parent&&r.parent.remove(r),r.parent=this,r.type==="elevation"&&_t.getLogger(this).error(`Layer '${r.title}, id:${r.id}' of type '${r.type}' is not supported as a basemap layer and will therefore be ignored.`)},i=r=>{r.parent=null};this.addHandles([this.baseLayers.on("after-add",r=>t(r.item)),this.referenceLayers.on("after-add",r=>t(r.item)),this.baseLayers.on("after-remove",r=>i(r.item)),this.referenceLayers.on("after-remove",r=>i(r.item))])}initialize(){this.when().catch(e=>{_t.getLogger(this).error("#load()",`Failed to load basemap (title: '${this.title}', id: '${this.id}')`,e)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const e=this.baseLayers.toArray();for(const i of e)i.destroy();const t=this.referenceLayers.toArray();for(const i of t)i.destroy();this.baseLayers.destroy(),this.referenceLayers.destroy(),this.portalItem=lr(this.portalItem)}normalizeCtorArgs(e){return e&&"resourceInfo"in e&&(this._set("resourceInfo",e.resourceInfo),delete(e={...e}).resourceInfo),e}set baseLayers(e){this._set("baseLayers",mp(e,this._get("baseLayers")))}_writeBaseLayers(e,t,i){const r=[];e&&(i={...i,layerContainerType:"basemap"},this.baseLayers.forEach(s=>{const n=j$(s,i.webmap?i.webmap.getLayerJSONFromResourceInfo(s):null,i);n!=null&&r.push(n)}),this.referenceLayers.forEach(s=>{const n=j$(s,i.webmap?i.webmap.getLayerJSONFromResourceInfo(s):null,i);n!=null&&(s.type!=="scene"&&(n.isReference=!0),r.push(n))})),t.baseMapLayers=r}set referenceLayers(e){this._set("referenceLayers",mp(e,this._get("referenceLayers")))}writeTitle(e,t){t.title=e||"Basemap"}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return K4(this,e=>{e(this.baseLayers,this.referenceLayers)})}clone(){const e={id:this.id,title:this.title,portalItem:this.portalItem,baseLayers:this.baseLayers.map(t=>Vb(t)?t.clone():t),referenceLayers:this.referenceLayers.map(t=>Vb(t)?t.clone():t)};return this.loaded&&(e.loadStatus="loaded"),new Pg({resourceInfo:this.resourceInfo}).set(e)}read(e,t){this.resourceInfo||this._set("resourceInfo",{data:e,context:t}),super.read(e,t)}write(e,t){var i;return e=e||{},t!=null&&t.origin||(t={origin:"web-map",...t}),super.write(e,t),!this.loaded&&((i=this.resourceInfo)!=null&&i.data.baseMapLayers)&&(e.baseMapLayers=this.resourceInfo.data.baseMapLayers.map(r=>{const s=He(r);return s.url&&na(s.url)&&(s.url=`https:${s.url}`),s.templateUrl&&na(s.templateUrl)&&(s.templateUrl=`https:${s.templateUrl}`),s})),e}async _loadFromSource(e){const{resourceInfo:t,portalItem:i,style:r}=this;mr(e);const s=[];if(t){const n=t.context?t.context.url:null;if(s.push(this._loadLayersFromJSON(t.data,n,e)),t.data.id&&!t.data.title){const c=t.data.id;s.push(lZ(c).then(o=>{o&&this.read({title:o},t.context)}))}}else i?s.push(this._loadFromItem(i,e)):r&&s.push(this._loadFromStylesService(r,e));await Promise.all(s)}async _loadLayersFromJSON(e,t,i){var f,g;const r=(f=this.resourceInfo)==null?void 0:f.context,s=((g=this.portalItem)==null?void 0:g.portal)||(r==null?void 0:r.portal)||null,n=MZ[(r==null?void 0:r.origin)||""]??"web-map",{populateOperationalLayers:c}=await ht(()=>import("./layersCreator-ua5OUPYt.js"),__vite__mapDeps([2,3,4,5,6])),o=[];if(mr(i),e.baseMapLayers&&Array.isArray(e.baseMapLayers)){const S={context:{...r,origin:n,url:t,portal:s,layerContainerType:"basemap"},defaultLayerType:"DefaultTileLayer"},I=z=>n==="web-scene"&&z.layerType==="ArcGISSceneServiceLayer"||z.isReference,A=c(this.baseLayers,e.baseMapLayers.filter(z=>!I(z)),S);o.push(A);const O=c(this.referenceLayers,e.baseMapLayers.filter(I),S);o.push(O)}await Promise.allSettled(o)}async _loadFromItem(e,t){const i=await e.load(t),r=await i.fetchData("json",t),s=Rr(e.itemUrl??"");return this._set("resourceInfo",{data:r.baseMap??{},context:{origin:EZ[e.type||""]??"web-map",portal:e.portal||Za.getDefault(),url:s}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:r.spatialReference},this.resourceInfo.context),this.read({title:e.title,thumbnailUrl:e.thumbnailUrl},{origin:"portal-item",portal:e.portal||Za.getDefault(),url:s}),this._loadLayersFromJSON(this.resourceInfo.data,s,t)}async _loadFromStylesService(e,t){const i=`${e.serviceUrl}/${e.id}`,r=(await Qi(i,{query:{language:e.getLanguageParamValue(),places:e.places,worldview:e.worldview},signal:t==null?void 0:t.signal})).data,s=Rr(i);return this._set("resourceInfo",{data:r.baseMap??{},context:{origin:"web-map",url:s}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:r.spatialReference},this.resourceInfo.context),this._loadLayersFromJSON(this.resourceInfo.data,s,t)}static fromId(e){const t=yE[e];return t?t.itemId?new Pg({portalItem:{id:t.itemId,portal:{url:"https://www.arcgis.com"}}}):Pg.fromJSON(t,{origin:t.is3d?"web-scene":"web-map"}):null}};v([M({json:{write:{ignoreOrigin:!0,target:"baseMapLayers",writer(e,t,i,r){this._writeBaseLayers(e,t,r)}},origins:{"web-scene":{write:{ignoreOrigin:!0,target:{baseMapLayers:{type:Bt}},writer(e,t,i,r){this._writeBaseLayers(e,t,r)}}}}}})],yo.prototype,"baseLayers",null),v([M({type:String,json:{origins:{"web-scene":{write:!0}}}})],yo.prototype,"id",void 0),v([M({type:_0})],yo.prototype,"portalItem",void 0),v([M()],yo.prototype,"referenceLayers",null),v([M({readOnly:!0})],yo.prototype,"resourceInfo",void 0),v([M({type:yi})],yo.prototype,"spatialReference",void 0),v([M({type:uZ})],yo.prototype,"style",void 0),v([M()],yo.prototype,"thumbnailUrl",void 0),v([M({type:String,json:{origins:{"web-scene":{write:{isRequired:!0}}}}})],yo.prototype,"title",void 0),v([ui("title")],yo.prototype,"writeTitle",null),yo=Pg=v([fe(TZ)],yo);const EZ={"Web Scene":"web-scene","Web Map":"web-map","Link Chart":"link-chart"},MZ={"web-scene":"web-scene","web-map":"web-map","link-chart":"link-chart"},v0=yo,IZ=Object.freeze(Object.defineProperty({__proto__:null,default:v0},Symbol.toStringTag,{value:"Module"})),_w={transparent:[0,0,0,0],black:[0,0,0,1],silver:[192,192,192,1],gray:[128,128,128,1],white:[255,255,255,1],maroon:[128,0,0,1],red:[255,0,0,1],purple:[128,0,128,1],fuchsia:[255,0,255,1],green:[0,128,0,1],lime:[0,255,0,1],olive:[128,128,0,1],yellow:[255,255,0,1],navy:[0,0,128,1],blue:[0,0,255,1],teal:[0,128,128,1],aqua:[0,255,255,1],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],blanchedalmond:[255,235,205,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],oldlace:[253,245,230,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],rebeccapurple:[102,51,153,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],whitesmoke:[245,245,245,1],yellowgreen:[154,205,50,1]};function wN(e){return!!_w[e]||!!_w[e.toLowerCase()]}function NA(e){return _w[e]??_w[e.toLowerCase()]}function AZ(e){return[...NA(e)]}function AS(e,t,i){i<0&&++i,i>1&&--i;const r=6*i;return r<1?e+(t-e)*r:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}function xN(e,t,i,r=1){const s=(e%360+360)%360/360,n=i<=.5?i*(t+1):i+t-i*t,c=2*i-n;return[Math.round(255*AS(c,n,s+1/3)),Math.round(255*AS(c,n,s)),Math.round(255*AS(c,n,s-1/3)),r]}function PZ(e){const t=e.length>5,i=t?8:4,r=(1<>=i,o[3]=s*f/255),f=c&r,c>>=i,o[2]=s*f,f=c&r,c>>=i,o[1]=s*f,f=c&r,c>>=i,o[0]=s*f,o}function Eh(){return[0,0,0]}function CZ(e){return[e[0],e[1],e[2]]}function v_(e,t,i){return[e,t,i]}function $Z(e,t=Eh()){const i=Math.min(3,e.length);for(let r=0;r0&&(n=1/Math.sqrt(n),e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n),e}function DN(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function tY(e,t,i){const r=t[0],s=t[1],n=t[2],c=i[0],o=i[1],f=i[2];return e[0]=s*f-n*o,e[1]=n*c-r*f,e[2]=r*o-s*c,e}function iY(e,t,i,r){const s=t[0],n=t[1],c=t[2];return e[0]=s+r*(i[0]-s),e[1]=n+r*(i[1]-n),e[2]=c+r*(i[2]-c),e}function rY(e,t,i,r,s,n){const c=n*n,o=c*(2*n-3)+1,f=c*(n-2)+n,g=c*(n-1),S=c*(3-2*n);return e[0]=t[0]*o+i[0]*f+r[0]*g+s[0]*S,e[1]=t[1]*o+i[1]*f+r[1]*g+s[1]*S,e[2]=t[2]*o+i[2]*f+r[2]*g+s[2]*S,e}function sY(e,t,i,r,s,n){const c=1-n,o=c*c,f=n*n,g=o*c,S=3*n*o,I=3*f*c,A=f*n;return e[0]=t[0]*g+i[0]*S+r[0]*I+s[0]*A,e[1]=t[1]*g+i[1]*S+r[1]*I+s[1]*A,e[2]=t[2]*g+i[2]*S+r[2]*I+s[2]*A,e}function nY(e,t){t=t||1;const i=Mx,r=2*i()*Math.PI,s=2*i()-1,n=Math.sqrt(1-s*s)*t;return e[0]=Math.cos(r)*n,e[1]=Math.sin(r)*n,e[2]=s*t,e}function oY(e,t,i){const r=t[0],s=t[1],n=t[2];return e[0]=i[0]*r+i[4]*s+i[8]*n+i[12],e[1]=i[1]*r+i[5]*s+i[9]*n+i[13],e[2]=i[2]*r+i[6]*s+i[10]*n+i[14],e}function aY(e,t,i){const r=t[0],s=t[1],n=t[2];return e[0]=r*i[0]+s*i[3]+n*i[6],e[1]=r*i[1]+s*i[4]+n*i[7],e[2]=r*i[2]+s*i[5]+n*i[8],e}function lY(e,t,i){const r=i[0],s=i[1],n=i[2],c=i[3],o=t[0],f=t[1],g=t[2],S=s*g-n*f,I=n*o-r*g,A=r*f-s*o,O=s*A-n*I,z=n*S-r*A,V=r*I-s*S,H=2*c;return e[0]=o+S*H+2*O,e[1]=f+I*H+2*z,e[2]=g+A*H+2*V,e}function cY(e,t,i,r){const s=[],n=[];return s[0]=t[0]-i[0],s[1]=t[1]-i[1],s[2]=t[2]-i[2],n[0]=s[0],n[1]=s[1]*Math.cos(r)-s[2]*Math.sin(r),n[2]=s[1]*Math.sin(r)+s[2]*Math.cos(r),e[0]=n[0]+i[0],e[1]=n[1]+i[1],e[2]=n[2]+i[2],e}function uY(e,t,i,r){const s=[],n=[];return s[0]=t[0]-i[0],s[1]=t[1]-i[1],s[2]=t[2]-i[2],n[0]=s[2]*Math.sin(r)+s[0]*Math.cos(r),n[1]=s[1],n[2]=s[2]*Math.cos(r)-s[0]*Math.sin(r),e[0]=n[0]+i[0],e[1]=n[1]+i[1],e[2]=n[2]+i[2],e}function hY(e,t,i,r){const s=[],n=[];return s[0]=t[0]-i[0],s[1]=t[1]-i[1],s[2]=t[2]-i[2],n[0]=s[0]*Math.cos(r)-s[1]*Math.sin(r),n[1]=s[0]*Math.sin(r)+s[1]*Math.cos(r),n[2]=s[2],e[0]=n[0]+i[0],e[1]=n[1]+i[1],e[2]=n[2]+i[2],e}function dY(e,t){gE(V$,e),gE(G$,t);const i=DN(V$,G$);return i>1?0:i<-1?Math.PI:Math.acos(i)}const V$=Eh(),G$=Eh();function pY(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"}function fY(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function mY(e,t){if(e===t)return!0;const i=e[0],r=e[1],s=e[2],n=t[0],c=t[1],o=t[2],f=aa();return Math.abs(i-n)<=f*Math.max(1,Math.abs(i),Math.abs(n))&&Math.abs(r-c)<=f*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(s-o)<=f*Math.max(1,Math.abs(s),Math.abs(o))}function yY(e,t,i){const r=i[0]-t[0],s=i[1]-t[1],n=i[2]-t[2];let c=r*r+s*s+n*n;return c>0?(c=1/Math.sqrt(c),e[0]=r*c,e[1]=s*c,e[2]=n*c,e):(e[0]=0,e[1]=0,e[2]=0,e)}const gY=PN,_Y=CN,vY=$N,bY=RN,wY=ON,xY=BA,SY=LN;Object.freeze(Object.defineProperty({__proto__:null,abs:WZ,add:GZ,angle:dY,bezier:sY,ceil:qZ,copy:VZ,cross:tY,direction:yY,dist:bY,distance:RN,div:vY,divide:$N,dot:DN,equals:mY,exactEquals:fY,floor:HZ,hermite:rY,inverse:eY,len:xY,length:BA,lerp:iY,max:JZ,min:YZ,mul:_Y,multiply:CN,negate:QZ,normalize:gE,random:nY,rotateX:cY,rotateY:uY,rotateZ:hY,round:KZ,scale:kN,scaleAndAdd:XZ,set:AN,sign:ZZ,sqrDist:wY,sqrLen:SY,squaredDistance:ON,squaredLength:LN,str:pY,sub:gY,subtract:PN,transformMat3:aY,transformMat4:oY,transformQuat:lY},Symbol.toStringTag,{value:"Module"}));const q$=new Float32Array(1);function hge(e){--e;for(let t=1;t<32;t<<=1)e|=e>>t;return e+1}function Ll(e,t,i){return Math.min(Math.max(e,t),i)}function dge(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e}function TY(e,t,i){return e+(t-e)*i}function pge(e,t,i,r,s){return TY(r,s,(e-t)/(i-t))}function NN(e){return e*Math.PI/180}function zN(e){return 180*e/Math.PI}function fge(e){return Math.acos(Ll(e,-1,1))}function FN(e){return Math.asin(Ll(e,-1,1))}function PS(e,t,i=1e-6){return e===t?!0:!Number.isFinite(e)||!Number.isFinite(t)?!1:(e>t?e-t:t-e)<=i}const vw=new DataView(new ArrayBuffer(Float64Array.BYTES_PER_ELEMENT));function EY(e){return vw.setFloat64(0,e),vw.getBigInt64(0)}function MY(e){return vw.setBigInt64(0,e),vw.getFloat64(0)}const CS=BigInt("1000000");IY(1);function IY(e){const t=EY(e=Math.abs(e)),i=MY(t<=CS?CS:t-CS);return Math.abs(e-i)}function mge(e){return BN(Math.max(-H$,Math.min(e,H$)))}function BN(e){return q$[0]=e,q$[0]}function yge(e,t){const i=BA(e),r=FN(e[2]/i),s=Math.atan2(e[1]/i,e[0]/i);return AN(t,i,r,s),t}function gge(e){const t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[3]*e[3]+e[4]*e[4]+e[5]*e[5],r=e[6]*e[6]+e[7]*e[7]+e[8]*e[8];return!(PS(t,1)&&PS(i,1)&&PS(r,1))}const H$=BN(34028234663852886e22);function tv(e){return Ll(oA(e),0,255)}function iv(e,t,i){return e=Number(e),isNaN(e)?i:ei?i:e}function rv(e,t){const i=e.toString(16).padStart(2,"0");return t?i.substring(0,1):i}let Zv=class gs{static blendColors(t,i,r,s=new gs){return s.r=Math.round(t.r+(i.r-t.r)*r),s.g=Math.round(t.g+(i.g-t.g)*r),s.b=Math.round(t.b+(i.b-t.b)*r),s.a=t.a+(i.a-t.a)*r,s._sanitize()}static fromRgb(t,i){const r=t.toLowerCase().match(/^(rgba?|hsla?)\(([\s\.\-,%0-9]+)\)/);if(r){const s=r[2].split(/\s*,\s*/),n=r[1];if(n==="rgb"&&s.length===3||n==="rgba"&&s.length===4){const c=s[0];if(c.charAt(c.length-1)==="%"){const o=s.map(f=>2.56*parseFloat(f));return s.length===4&&(o[3]=parseFloat(s[3])),gs.fromArray(o,i)}return gs.fromArray(s.map(o=>parseFloat(o)),i)}if(n==="hsl"&&s.length===3||n==="hsla"&&s.length===4)return gs.fromArray(xN(parseFloat(s[0]),parseFloat(s[1])/100,parseFloat(s[2])/100,parseFloat(s[3])),i)}return null}static fromHex(t,i=new gs){if(t[0]!=="#"||isNaN(+`0x${t.substring(1)}`))return null;switch(t.length){case 4:case 5:{const r=parseInt(t.substring(1,2),16),s=parseInt(t.substring(2,3),16),n=parseInt(t.substring(3,4),16),c=t.length===5?15:parseInt(t.substring(4),16);return gs.fromArray([r+16*r,s+16*s,n+16*n,(c+16*c)/255],i)}case 7:case 9:{const r=parseInt(t.substring(1,3),16),s=parseInt(t.substring(3,5),16),n=parseInt(t.substring(5,7),16),c=t.length===7?255:parseInt(t.substring(7),16);return gs.fromArray([r,s,n,c/255],i)}default:return null}}static fromArray(t,i=new gs){return i._set(Number(t[0]),Number(t[1]),Number(t[2]),Number(t[3])),isNaN(i.a)&&(i.a=1),i._sanitize()}static fromString(t,i){const r=wN(t)?NA(t):null;return r&&gs.fromArray(r,i)||gs.fromRgb(t,i)||gs.fromHex(t,i)}static fromJSON(t){return t!=null?new gs([t[0],t[1],t[2],(t[3]??255)/255]):void 0}static toUnitRGB(t){return t!=null?[t.r/255,t.g/255,t.b/255]:null}static toUnitRGBA(t){return t!=null?[t.r/255,t.g/255,t.b/255,t.a!=null?t.a:1]:null}constructor(t){this.r=255,this.g=255,this.b=255,this.a=1,t&&this.setColor(t)}get isBright(){return .299*this.r+.587*this.g+.114*this.b>=127}setColor(t){return typeof t=="string"?gs.fromString(t,this):Array.isArray(t)?gs.fromArray(t,this):(this._set(t.r??0,t.g??0,t.b??0,t.a??1),t instanceof gs||this._sanitize()),this}toRgb(){return[this.r,this.g,this.b]}toRgba(){return[this.r,this.g,this.b,this.a]}toHex(t){const i=(t==null?void 0:t.capitalize)??!1,r=(t==null?void 0:t.digits)??6,s=r===3||r===4,n=r===4||r===8,c=`#${rv(this.r,s)}${rv(this.g,s)}${rv(this.b,s)}${n?rv(Math.round(255*this.a),s):""}`;return i?c.toUpperCase():c}toCss(t=!1){const i=this.r+", "+this.g+", "+this.b;return t?`rgba(${i}, ${this.a})`:`rgb(${i})`}toString(){return this.toCss(!0)}toJSON(){return this.toArray()}toArray(t=gs.AlphaMode.ALWAYS){const i=tv(this.r),r=tv(this.g),s=tv(this.b);return t===gs.AlphaMode.ALWAYS||this.a!==1?[i,r,s,tv(255*this.a)]:[i,r,s]}clone(){return new gs(this.toRgba())}hash(){return this.r<<24|this.g<<16|this.b<<8|255*this.a}equals(t){return t!=null&&t.r===this.r&&t.g===this.g&&t.b===this.b&&t.a===this.a}_sanitize(){return this.r=Math.round(iv(this.r,0,255)),this.g=Math.round(iv(this.g,0,255)),this.b=Math.round(iv(this.b,0,255)),this.a=iv(this.a,0,1),this}_set(t,i,r,s){this.r=t,this.g=i,this.b=r,this.a=s}};Zv.prototype.declaredClass="esri.Color",function(e){var t;(t=e.AlphaMode||(e.AlphaMode={}))[t.ALWAYS=0]="ALWAYS",t[t.UNLESS_OPAQUE=1]="UNLESS_OPAQUE"}(Zv||(Zv={}));const zt=Zv;function _ge(e){}function AY(e){return()=>e}function Gt(e,t={}){const i=e instanceof ks?e:new ks(e,t),r={type:(t==null?void 0:t.ignoreUnknown)??1?i.apiValues:String,json:{type:i.jsonValues,read:!(t!=null&&t.readOnly)&&{reader:i.read},write:{writer:i.write}}};return(t==null?void 0:t.readOnly)!==void 0&&(r.readOnly=!!t.readOnly),(t==null?void 0:t.default)!==void 0&&(r.json.default=t.default),(t==null?void 0:t.name)!==void 0&&(r.json.name=t.name),(t==null?void 0:t.nonNullable)!==void 0&&(r.nonNullable=t.nonNullable),M(r)}var _E;let Yv=_E=class extends At{constructor(e){super(e),this.type="none"}clone(){return new _E({type:this.type})}};v([Gt({none:"none",stayAbove:"stay-above"})],Yv.prototype,"type",void 0),Yv=_E=v([fe("esri.ground.NavigationConstraint")],Yv);function UN(e){const t=oA(100*(1-e));return Math.max(0,Math.min(t,100))}function bw(e){const t=1-e/100;return Math.max(0,Math.min(t,1))}var vE;let bc=vE=class extends y_(dh){constructor(e){super(e),this.opacity=1,this.surfaceColor=null,this.navigationConstraint=null,this.layers=new Bt;const t=r=>{r.parent&&r.parent!==this&&"remove"in r.parent&&r.parent.remove(r),r.parent=this,r.type!=="elevation"&&r.type!=="base-elevation"&&_t.getLogger(this).error(`Layer '${r.title}, id:${r.id}' of type '${r.type}' is not supported as a ground layer and will therefore be ignored. Only layers of type 'elevation' are supported.`)},i=r=>{r.parent=null};this.addHandles([this.layers.on("after-add",r=>t(r.item)),this.layers.on("after-remove",r=>i(r.item))])}initialize(){this.when().catch(e=>{Ys(e)||_t.getLogger(this).error("#load()","Failed to load ground",e)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const e=this.layers.removeAll();for(const t of e)lr(t);this.layers.destroy()}normalizeCtorArgs(e){return e&&"resourceInfo"in e&&(this._set("resourceInfo",e.resourceInfo),delete(e={...e}).resourceInfo),e}set layers(e){this._set("layers",mp(e,this._get("layers")))}writeLayers(e,t,i,r){const s=[];e&&(r={...r,layerContainerType:"ground"},e.forEach(n=>{if("write"in n){const c={};AY(n)().write(c,r)&&s.push(c)}else r!=null&&r.messages&&r.messages.push(new Je("layer:unsupported",`Layers (${n.title}, ${n.id}) of type '${n.declaredClass}' cannot be persisted in the ground`,{layer:n}))})),t.layers=s}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return K4(this,e=>{e(this.layers)})}async queryElevation(e,t){await this.load({signal:t==null?void 0:t.signal});const{ElevationQuery:i}=await ht(()=>import("./ElevationQuery-DphYPRnK.js"),[]);mr(t);const r=new i,s=this.layers.filter(W$).toArray();return r.queryAll(s,e,t)}async createElevationSampler(e,t){await this.load({signal:t==null?void 0:t.signal});const{ElevationQuery:i}=await ht(()=>import("./ElevationQuery-DphYPRnK.js"),[]);mr(t);const r=new i,s=this.layers.filter(W$).toArray();return r.createSamplerAll(s,e,t)}clone(){const e={opacity:this.opacity,surfaceColor:He(this.surfaceColor),navigationConstraint:He(this.navigationConstraint),layers:this.layers.slice()};return this.loaded&&(e.loadStatus="loaded"),new vE({resourceInfo:this.resourceInfo}).set(e)}read(e,t){this.resourceInfo||this._set("resourceInfo",{data:e,context:t}),super.read(e,t)}_loadFromSource(e){const t=this.resourceInfo;return t?this._loadLayersFromJSON(t.data,t.context,e):Promise.resolve()}async _loadLayersFromJSON(e,t,i){const r=(t==null?void 0:t.origin)||"web-scene",s=(t==null?void 0:t.portal)||null,n=(t==null?void 0:t.url)||null,{populateOperationalLayers:c}=await ht(()=>import("./layersCreator-ua5OUPYt.js"),__vite__mapDeps([2,3,4,5,6]));mr(i);const o=[];if(e.layers&&Array.isArray(e.layers)){const f={context:{origin:r,url:n,portal:s,layerContainerType:"ground"},defaultLayerType:"ArcGISTiledElevationServiceLayer"};o.push(c(this.layers,e.layers,f))}await Promise.allSettled(o)}};function PY(e){return e&&"createElevationSampler"in e}function W$(e){return e.type==="elevation"||PY(e)}v([M({json:{read:!1}})],bc.prototype,"layers",null),v([ui("layers")],bc.prototype,"writeLayers",null),v([M({readOnly:!0})],bc.prototype,"resourceInfo",void 0),v([M({type:Number,nonNullable:!0,range:{min:0,max:1},json:{type:$r,read:{reader:bw,source:"transparency"},write:{writer:(e,t)=>{t.transparency=UN(e)},target:"transparency"}}})],bc.prototype,"opacity",void 0),v([M({type:zt,json:{type:[$r],write:(e,t)=>{t.surfaceColor=e.toJSON().slice(0,3)}}})],bc.prototype,"surfaceColor",void 0),v([M({type:Yv,json:{write:!0}})],bc.prototype,"navigationConstraint",void 0),bc=vE=v([fe("esri.Ground")],bc);const ww=bc;let Rf=class extends Bt{constructor(t){super(t),this.getCollections=null}initialize(){this.addHandles(DG(()=>this._refresh()))}destroy(){this.getCollections=null}_refresh(){const t=this.getCollections!=null?this.getCollections():null;if(t==null)return void this.removeAll();let i=0;for(const r of t)r!=null&&(i=this._processCollection(i,r));this.splice(i,this.length)}_createNewInstance(t){return new Bt(t)}_processCollection(t,i){if(!i)return t;const r=this.itemFilterFunction??(s=>!!s);for(const s of i)if(s){if(r(s)){const n=this.indexOf(s,t);n>=0?n!==t&&this.reorder(s,t):this.add(s,t),++t}if(this.getChildrenFunction){const n=this.getChildrenFunction(s);if(Array.isArray(n))for(const c of n)t=this._processCollection(t,c);else t=this._processCollection(t,n)}}return t}};v([M()],Rf.prototype,"getCollections",void 0),v([M()],Rf.prototype,"getChildrenFunction",void 0),v([M()],Rf.prototype,"itemFilterFunction",void 0),Rf=v([fe("esri.core.CollectionFlattener")],Rf);const W0=Rf;function CY(e){var t,i;return!(!(e&&typeof e=="object"&&"loaded"in e&&e.loaded&&((i=(t=fZ(e))==null?void 0:t.operations)!=null&&i.supportsEditing)&&"type"in e)||"editingEnabled"in e&&!yZ(e))}const $Y=/^-?(\d+(\.\d+)?)\s*((px)|(pt))?$/i,kY="screenUtils.toPt: input not recognized!",jN=96;function bge(e){return e?e/72*jN:0}function mh(e){return e?72*e/jN:0}function xr(e){if(typeof e=="string"){const t=e.match($Y);if(t){const i=Number(t[1]),r=t[3]&&t[3].toLowerCase(),s=e.charAt(0)==="-",n=r==="px"?mh(i):i;return s?-n:n}return console.warn(kY),null}return e}function Dn(e=0,t=0){return{x:e,y:t}}function wge(e=0,t=0){return[e,t]}function Ix(){const e=new Float32Array(16);return e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function RY(e){const t=new Float32Array(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function OY(e,t,i,r,s,n,c,o,f,g,S,I,A,O,z,V){const H=new Float32Array(16);return H[0]=e,H[1]=t,H[2]=i,H[3]=r,H[4]=s,H[5]=n,H[6]=c,H[7]=o,H[8]=f,H[9]=g,H[10]=S,H[11]=I,H[12]=A,H[13]=O,H[14]=z,H[15]=V,H}function LY(e,t){return new Float32Array(e,t,16)}const DY=Ix();Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:DY,clone:RY,create:Ix,createView:LY,fromValues:OY},Symbol.toStringTag,{value:"Module"}));function NY(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Mh(e,t,i,r,s,n,c,o,f,g,S,I,A,O,z,V,H){return e[0]=t,e[1]=i,e[2]=r,e[3]=s,e[4]=n,e[5]=c,e[6]=o,e[7]=f,e[8]=g,e[9]=S,e[10]=I,e[11]=A,e[12]=O,e[13]=z,e[14]=V,e[15]=H,e}function Ax(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Ih(e,t){if(e===t){const i=t[1],r=t[2],s=t[3],n=t[6],c=t[7],o=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=i,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=n,e[11]=t[14],e[12]=s,e[13]=c,e[14]=o}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function zY(e,t){return VN(e,t)||Ax(e),e}function VN(e,t){const i=t[0],r=t[1],s=t[2],n=t[3],c=t[4],o=t[5],f=t[6],g=t[7],S=t[8],I=t[9],A=t[10],O=t[11],z=t[12],V=t[13],H=t[14],Q=t[15],ve=i*o-r*c,me=i*f-s*c,ge=i*g-n*c,Ie=r*f-s*o,Ce=r*g-n*o,ze=s*g-n*f,je=S*V-I*z,tt=S*H-A*z,ut=S*Q-O*z,ot=I*H-A*V,et=I*Q-O*V,Et=A*Q-O*H;let dt=ve*Et-me*et+ge*ot+Ie*ut-Ce*tt+ze*je;return dt?(dt=1/dt,e[0]=(o*Et-f*et+g*ot)*dt,e[1]=(s*et-r*Et-n*ot)*dt,e[2]=(V*ze-H*Ce+Q*Ie)*dt,e[3]=(A*Ce-I*ze-O*Ie)*dt,e[4]=(f*ut-c*Et-g*tt)*dt,e[5]=(i*Et-s*ut+n*tt)*dt,e[6]=(H*ge-z*ze-Q*me)*dt,e[7]=(S*ze-A*ge+O*me)*dt,e[8]=(c*et-o*ut+g*je)*dt,e[9]=(r*ut-i*et-n*je)*dt,e[10]=(z*Ce-V*ge+Q*ve)*dt,e[11]=(I*ge-S*Ce-O*ve)*dt,e[12]=(o*tt-c*ot-f*je)*dt,e[13]=(i*ot-r*tt+s*je)*dt,e[14]=(V*me-z*Ie-H*ve)*dt,e[15]=(S*Ie-I*me+A*ve)*dt,e):null}function FY(e,t){const i=t[0],r=t[1],s=t[2],n=t[3],c=t[4],o=t[5],f=t[6],g=t[7],S=t[8],I=t[9],A=t[10],O=t[11],z=t[12],V=t[13],H=t[14],Q=t[15];return e[0]=o*(A*Q-O*H)-I*(f*Q-g*H)+V*(f*O-g*A),e[1]=-(r*(A*Q-O*H)-I*(s*Q-n*H)+V*(s*O-n*A)),e[2]=r*(f*Q-g*H)-o*(s*Q-n*H)+V*(s*g-n*f),e[3]=-(r*(f*O-g*A)-o*(s*O-n*A)+I*(s*g-n*f)),e[4]=-(c*(A*Q-O*H)-S*(f*Q-g*H)+z*(f*O-g*A)),e[5]=i*(A*Q-O*H)-S*(s*Q-n*H)+z*(s*O-n*A),e[6]=-(i*(f*Q-g*H)-c*(s*Q-n*H)+z*(s*g-n*f)),e[7]=i*(f*O-g*A)-c*(s*O-n*A)+S*(s*g-n*f),e[8]=c*(I*Q-O*V)-S*(o*Q-g*V)+z*(o*O-g*I),e[9]=-(i*(I*Q-O*V)-S*(r*Q-n*V)+z*(r*O-n*I)),e[10]=i*(o*Q-g*V)-c*(r*Q-n*V)+z*(r*g-n*o),e[11]=-(i*(o*O-g*I)-c*(r*O-n*I)+S*(r*g-n*o)),e[12]=-(c*(I*H-A*V)-S*(o*H-f*V)+z*(o*A-f*I)),e[13]=i*(I*H-A*V)-S*(r*H-s*V)+z*(r*A-s*I),e[14]=-(i*(o*H-f*V)-c*(r*H-s*V)+z*(r*f-s*o)),e[15]=i*(o*A-f*I)-c*(r*A-s*I)+S*(r*f-s*o),e}function BY(e){const t=e[0],i=e[1],r=e[2],s=e[3],n=e[4],c=e[5],o=e[6],f=e[7],g=e[8],S=e[9],I=e[10],A=e[11],O=e[12],z=e[13],V=e[14],H=e[15];return(t*c-i*n)*(I*H-A*V)-(t*o-r*n)*(S*H-A*z)+(t*f-s*n)*(S*V-I*z)+(i*o-r*c)*(g*H-A*O)-(i*f-s*c)*(g*V-I*O)+(r*f-s*o)*(g*z-S*O)}function GN(e,t,i){const r=t[0],s=t[1],n=t[2],c=t[3],o=t[4],f=t[5],g=t[6],S=t[7],I=t[8],A=t[9],O=t[10],z=t[11],V=t[12],H=t[13],Q=t[14],ve=t[15];let me=i[0],ge=i[1],Ie=i[2],Ce=i[3];return e[0]=me*r+ge*o+Ie*I+Ce*V,e[1]=me*s+ge*f+Ie*A+Ce*H,e[2]=me*n+ge*g+Ie*O+Ce*Q,e[3]=me*c+ge*S+Ie*z+Ce*ve,me=i[4],ge=i[5],Ie=i[6],Ce=i[7],e[4]=me*r+ge*o+Ie*I+Ce*V,e[5]=me*s+ge*f+Ie*A+Ce*H,e[6]=me*n+ge*g+Ie*O+Ce*Q,e[7]=me*c+ge*S+Ie*z+Ce*ve,me=i[8],ge=i[9],Ie=i[10],Ce=i[11],e[8]=me*r+ge*o+Ie*I+Ce*V,e[9]=me*s+ge*f+Ie*A+Ce*H,e[10]=me*n+ge*g+Ie*O+Ce*Q,e[11]=me*c+ge*S+Ie*z+Ce*ve,me=i[12],ge=i[13],Ie=i[14],Ce=i[15],e[12]=me*r+ge*o+Ie*I+Ce*V,e[13]=me*s+ge*f+Ie*A+Ce*H,e[14]=me*n+ge*g+Ie*O+Ce*Q,e[15]=me*c+ge*S+Ie*z+Ce*ve,e}function UY(e,t,i){const r=i[0],s=i[1],n=i[2];if(t===e)e[12]=t[0]*r+t[4]*s+t[8]*n+t[12],e[13]=t[1]*r+t[5]*s+t[9]*n+t[13],e[14]=t[2]*r+t[6]*s+t[10]*n+t[14],e[15]=t[3]*r+t[7]*s+t[11]*n+t[15];else{const c=t[0],o=t[1],f=t[2],g=t[3],S=t[4],I=t[5],A=t[6],O=t[7],z=t[8],V=t[9],H=t[10],Q=t[11];e[0]=c,e[1]=o,e[2]=f,e[3]=g,e[4]=S,e[5]=I,e[6]=A,e[7]=O,e[8]=z,e[9]=V,e[10]=H,e[11]=Q,e[12]=c*r+S*s+z*n+t[12],e[13]=o*r+I*s+V*n+t[13],e[14]=f*r+A*s+H*n+t[14],e[15]=g*r+O*s+Q*n+t[15]}return e}function jY(e,t,i){const r=i[0],s=i[1],n=i[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*s,e[5]=t[5]*s,e[6]=t[6]*s,e[7]=t[7]*s,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function VY(e,t,i,r){let s,n,c,o,f,g,S,I,A,O,z,V,H,Q,ve,me,ge,Ie,Ce,ze,je,tt,ut,ot,et=r[0],Et=r[1],dt=r[2],vi=Math.sqrt(et*et+Et*Et+dt*dt);return vi0?(i[0]=2*(o*c+S*r+f*n-g*s)/I,i[1]=2*(f*c+S*s+g*r-o*n)/I,i[2]=2*(g*c+S*n+o*s-f*r)/I):(i[0]=2*(o*c+S*r+f*n-g*s),i[1]=2*(f*c+S*s+g*r-o*n),i[2]=2*(g*c+S*n+o*s-f*r)),qN(e,t,i),e}const eJ=Eh();function tJ(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function iJ(e,t){const i=t[0],r=t[1],s=t[2],n=t[4],c=t[5],o=t[6],f=t[8],g=t[9],S=t[10];return e[0]=Math.sqrt(i*i+r*r+s*s),e[1]=Math.sqrt(n*n+c*c+o*o),e[2]=Math.sqrt(f*f+g*g+S*S),e}function rJ(e,t){const i=t[0]+t[5]+t[10];let r=0;return i>0?(r=2*Math.sqrt(i+1),e[3]=.25*r,e[0]=(t[6]-t[9])/r,e[1]=(t[8]-t[2])/r,e[2]=(t[1]-t[4])/r):t[0]>t[5]&&t[0]>t[10]?(r=2*Math.sqrt(1+t[0]-t[5]-t[10]),e[3]=(t[6]-t[9])/r,e[0]=.25*r,e[1]=(t[1]+t[4])/r,e[2]=(t[8]+t[2])/r):t[5]>t[10]?(r=2*Math.sqrt(1+t[5]-t[0]-t[10]),e[3]=(t[8]-t[2])/r,e[0]=(t[1]+t[4])/r,e[1]=.25*r,e[2]=(t[6]+t[9])/r):(r=2*Math.sqrt(1+t[10]-t[0]-t[5]),e[3]=(t[1]-t[4])/r,e[0]=(t[8]+t[2])/r,e[1]=(t[6]+t[9])/r,e[2]=.25*r),e}function sJ(e,t,i,r){const s=t[0],n=t[1],c=t[2],o=t[3],f=s+s,g=n+n,S=c+c,I=s*f,A=s*g,O=s*S,z=n*g,V=n*S,H=c*S,Q=o*f,ve=o*g,me=o*S,ge=r[0],Ie=r[1],Ce=r[2];return e[0]=(1-(z+H))*ge,e[1]=(A+me)*ge,e[2]=(O-ve)*ge,e[3]=0,e[4]=(A-me)*Ie,e[5]=(1-(I+H))*Ie,e[6]=(V+Q)*Ie,e[7]=0,e[8]=(O+ve)*Ce,e[9]=(V-Q)*Ce,e[10]=(1-(I+z))*Ce,e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e}function nJ(e,t,i,r,s){const n=t[0],c=t[1],o=t[2],f=t[3],g=n+n,S=c+c,I=o+o,A=n*g,O=n*S,z=n*I,V=c*S,H=c*I,Q=o*I,ve=f*g,me=f*S,ge=f*I,Ie=r[0],Ce=r[1],ze=r[2],je=s[0],tt=s[1],ut=s[2],ot=(1-(V+Q))*Ie,et=(O+ge)*Ie,Et=(z-me)*Ie,dt=(O-ge)*Ce,vi=(1-(A+Q))*Ce,$i=(H+ve)*Ce,Kt=(z+me)*ze,Ft=(H-ve)*ze,ji=(1-(A+V))*ze;return e[0]=ot,e[1]=et,e[2]=Et,e[3]=0,e[4]=dt,e[5]=vi,e[6]=$i,e[7]=0,e[8]=Kt,e[9]=Ft,e[10]=ji,e[11]=0,e[12]=i[0]+je-(ot*je+dt*tt+Kt*ut),e[13]=i[1]+tt-(et*je+vi*tt+Ft*ut),e[14]=i[2]+ut-(Et*je+$i*tt+ji*ut),e[15]=1,e}function oJ(e,t){const i=t[0],r=t[1],s=t[2],n=t[3],c=i+i,o=r+r,f=s+s,g=i*c,S=r*c,I=r*o,A=s*c,O=s*o,z=s*f,V=n*c,H=n*o,Q=n*f;return e[0]=1-I-z,e[1]=S+Q,e[2]=A-H,e[3]=0,e[4]=S-Q,e[5]=1-g-z,e[6]=O+V,e[7]=0,e[8]=A+H,e[9]=O-V,e[10]=1-g-I,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function aJ(e,t,i,r,s,n,c){const o=1/(i-t),f=1/(s-r),g=1/(n-c);return e[0]=2*n*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*n*f,e[6]=0,e[7]=0,e[8]=(i+t)*o,e[9]=(s+r)*f,e[10]=(c+n)*g,e[11]=-1,e[12]=0,e[13]=0,e[14]=c*n*2*g,e[15]=0,e}function lJ(e,t,i,r,s){const n=1/Math.tan(t/2);let c;return e[0]=n/i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,s!=null&&s!==1/0?(c=1/(r-s),e[10]=(s+r)*c,e[14]=2*s*r*c):(e[10]=-1,e[14]=-2*r),e}function cJ(e,t,i,r){const s=Math.tan(t.upDegrees*Math.PI/180),n=Math.tan(t.downDegrees*Math.PI/180),c=Math.tan(t.leftDegrees*Math.PI/180),o=Math.tan(t.rightDegrees*Math.PI/180),f=2/(c+o),g=2/(s+n);return e[0]=f,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=g,e[6]=0,e[7]=0,e[8]=-(c-o)*f*.5,e[9]=(s-n)*g*.5,e[10]=r/(i-r),e[11]=-1,e[12]=0,e[13]=0,e[14]=r*i/(i-r),e[15]=0,e}function uJ(e,t,i,r,s,n,c){const o=1/(t-i),f=1/(r-s),g=1/(n-c);return e[0]=-2*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*f,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*g,e[11]=0,e[12]=(t+i)*o,e[13]=(s+r)*f,e[14]=(c+n)*g,e[15]=1,e}function hJ(e,t,i,r){const s=t[0],n=t[1],c=t[2];let o=s-i[0],f=n-i[1],g=c-i[2];const S=aa();if(Math.abs(o)0&&(O=1/Math.sqrt(O),S*=O,I*=O,A*=O);let z=f*A-g*I,V=g*S-o*A,H=o*I-f*S;return O=z*z+V*V+H*H,O>0&&(O=1/Math.sqrt(O),z*=O,V*=O,H*=O),e[0]=z,e[1]=V,e[2]=H,e[3]=0,e[4]=I*H-A*V,e[5]=A*z-S*H,e[6]=S*V-I*z,e[7]=0,e[8]=S,e[9]=I,e[10]=A,e[11]=0,e[12]=s,e[13]=n,e[14]=c,e[15]=1,e}function pJ(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}function fJ(e){return Math.sqrt(e[0]**2+e[1]**2+e[2]**2+e[3]**2+e[4]**2+e[5]**2+e[6]**2+e[7]**2+e[8]**2+e[9]**2+e[10]**2+e[11]**2+e[12]**2+e[13]**2+e[14]**2+e[15]**2)}function mJ(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e[4]=t[4]+i[4],e[5]=t[5]+i[5],e[6]=t[6]+i[6],e[7]=t[7]+i[7],e[8]=t[8]+i[8],e[9]=t[9]+i[9],e[10]=t[10]+i[10],e[11]=t[11]+i[11],e[12]=t[12]+i[12],e[13]=t[13]+i[13],e[14]=t[14]+i[14],e[15]=t[15]+i[15],e}function HN(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e[3]=t[3]-i[3],e[4]=t[4]-i[4],e[5]=t[5]-i[5],e[6]=t[6]-i[6],e[7]=t[7]-i[7],e[8]=t[8]-i[8],e[9]=t[9]-i[9],e[10]=t[10]-i[10],e[11]=t[11]-i[11],e[12]=t[12]-i[12],e[13]=t[13]-i[13],e[14]=t[14]-i[14],e[15]=t[15]-i[15],e}function yJ(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12]*i,e[13]=t[13]*i,e[14]=t[14]*i,e[15]=t[15]*i,e}function gJ(e,t,i,r){return e[0]=t[0]+i[0]*r,e[1]=t[1]+i[1]*r,e[2]=t[2]+i[2]*r,e[3]=t[3]+i[3]*r,e[4]=t[4]+i[4]*r,e[5]=t[5]+i[5]*r,e[6]=t[6]+i[6]*r,e[7]=t[7]+i[7]*r,e[8]=t[8]+i[8]*r,e[9]=t[9]+i[9]*r,e[10]=t[10]+i[10]*r,e[11]=t[11]+i[11]*r,e[12]=t[12]+i[12]*r,e[13]=t[13]+i[13]*r,e[14]=t[14]+i[14]*r,e[15]=t[15]+i[15]*r,e}function _J(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function vJ(e,t){if(e===t)return!0;const i=e[0],r=e[1],s=e[2],n=e[3],c=e[4],o=e[5],f=e[6],g=e[7],S=e[8],I=e[9],A=e[10],O=e[11],z=e[12],V=e[13],H=e[14],Q=e[15],ve=t[0],me=t[1],ge=t[2],Ie=t[3],Ce=t[4],ze=t[5],je=t[6],tt=t[7],ut=t[8],ot=t[9],et=t[10],Et=t[11],dt=t[12],vi=t[13],$i=t[14],Kt=t[15],Ft=aa();return Math.abs(i-ve)<=Ft*Math.max(1,Math.abs(i),Math.abs(ve))&&Math.abs(r-me)<=Ft*Math.max(1,Math.abs(r),Math.abs(me))&&Math.abs(s-ge)<=Ft*Math.max(1,Math.abs(s),Math.abs(ge))&&Math.abs(n-Ie)<=Ft*Math.max(1,Math.abs(n),Math.abs(Ie))&&Math.abs(c-Ce)<=Ft*Math.max(1,Math.abs(c),Math.abs(Ce))&&Math.abs(o-ze)<=Ft*Math.max(1,Math.abs(o),Math.abs(ze))&&Math.abs(f-je)<=Ft*Math.max(1,Math.abs(f),Math.abs(je))&&Math.abs(g-tt)<=Ft*Math.max(1,Math.abs(g),Math.abs(tt))&&Math.abs(S-ut)<=Ft*Math.max(1,Math.abs(S),Math.abs(ut))&&Math.abs(I-ot)<=Ft*Math.max(1,Math.abs(I),Math.abs(ot))&&Math.abs(A-et)<=Ft*Math.max(1,Math.abs(A),Math.abs(et))&&Math.abs(O-Et)<=Ft*Math.max(1,Math.abs(O),Math.abs(Et))&&Math.abs(z-dt)<=Ft*Math.max(1,Math.abs(z),Math.abs(dt))&&Math.abs(V-vi)<=Ft*Math.max(1,Math.abs(V),Math.abs(vi))&&Math.abs(H-$i)<=Ft*Math.max(1,Math.abs(H),Math.abs($i))&&Math.abs(Q-Kt)<=Ft*Math.max(1,Math.abs(Q),Math.abs(Kt))}function bJ(e){const t=aa(),i=e[0],r=e[1],s=e[2],n=e[4],c=e[5],o=e[6],f=e[8],g=e[9],S=e[10];return Math.abs(1-(i*i+n*n+f*f))<=t&&Math.abs(1-(r*r+c*c+g*g))<=t&&Math.abs(1-(s*s+o*o+S*S))<=t}function wJ(e){return e[0]===1&&e[1]===0&&e[2]===0&&e[4]===0&&e[5]===1&&e[6]===0&&e[8]===0&&e[9]===0&&e[10]===1}const xJ=GN,SJ=HN;Object.freeze(Object.defineProperty({__proto__:null,add:mJ,adjoint:FY,copy:NY,determinant:BY,equals:vJ,exactEquals:_J,frob:fJ,fromQuat:oJ,fromQuat2:QY,fromRotation:YY,fromRotationTranslation:qN,fromRotationTranslationScale:sJ,fromRotationTranslationScaleOrigin:nJ,fromScaling:ZY,fromTranslation:WY,fromXRotation:JY,fromYRotation:KY,fromZRotation:XY,frustum:aJ,getRotation:rJ,getScaling:iJ,getTranslation:tJ,hasIdentityRotation:wJ,identity:Ax,invert:VN,invertOrIdentity:zY,isOrthoNormal:bJ,lookAt:hJ,mul:xJ,multiply:GN,multiplyScalar:yJ,multiplyScalarAndAdd:gJ,ortho:uJ,perspective:lJ,perspectiveFromFieldOfView:cJ,rotate:VY,rotateX:GY,rotateY:qY,rotateZ:HY,scale:jY,set:Mh,str:pJ,sub:SJ,subtract:HN,targetTo:dJ,translate:UY,transpose:Ih},Symbol.toStringTag,{value:"Module"}));const TJ=(e,t)=>{const i=Mh(e,t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1);return Ih(i,i)},EJ=(e,t)=>{const i=Mh(e,t,0,0,.5-.5*t,0,t,0,.5-.5*t,0,0,t,.5-.5*t,0,0,0,1);return Ih(i,i)},MJ=(e,t)=>{const i=1-t,r=Mh(e,.2126+.7874*i,.7152-.7152*i,.0722-.0722*i,0,.2126-.2126*i,.7152+.2848*i,.0722-.0722*i,0,.2126-.2126*i,.7152-.7152*i,.0722+.9278*i,0,0,0,0,1);return Ih(r,r)},IJ=(e,t)=>{const i=Math.sin(t*Math.PI/180),r=Math.cos(t*Math.PI/180),s=Mh(e,.213+.787*r-.213*i,.715-.715*r-.715*i,.072-.072*r+.928*i,0,.213-.213*r+.143*i,.715+.285*r+.14*i,.072-.072*r-.283*i,0,.213-.213*r-.787*i,.715-.715*r+.715*i,.072+.928*r+.072*i,0,0,0,0,1);return Ih(s,s)},AJ=(e,t)=>{const i=1-2*t,r=Mh(e,i,0,0,t,0,i,0,t,0,0,i,t,0,0,0,1);return Ih(r,r)},PJ=(e,t)=>{const i=Mh(e,.213+.787*t,.715-.715*t,.072-.072*t,0,.213-.213*t,.715+.285*t,.072-.072*t,0,.213-.213*t,.715-.715*t,.072+.928*t,0,0,0,0,1);return Ih(i,i)},CJ=(e,t)=>{const i=1-t,r=Mh(e,.393+.607*i,.769-.769*i,.189-.189*i,0,.349-.349*i,.686+.314*i,.168-.168*i,0,.272-.272*i,.534-.534*i,.131+.869*i,0,0,0,0,1);return Ih(r,r)};let WN=class ZN{constructor(t,i,r){this.strength=t,this.radius=i,this.threshold=r,this.type="bloom"}interpolate(t,i,r){this.strength=Yn(t.strength,i.strength,r),this.radius=Yn(t.radius,i.radius,r),this.threshold=Yn(t.threshold,i.threshold,r)}clone(){return new ZN(this.strength,this.radius,this.threshold)}toJSON(){return{type:"bloom",radius:b0(this.radius),strength:this.strength,threshold:this.threshold}}},YN=class JN{constructor(t){this.radius=t,this.type="blur"}interpolate(t,i,r){this.radius=Math.round(Yn(t.radius,i.radius,r))}clone(){return new JN(this.radius)}toJSON(){return{type:"blur",radius:b0(this.radius)}}},bE=class KN{constructor(t,i){this.type=t,this.amount=i,this.type!=="invert"&&this.type!=="grayscale"&&this.type!=="sepia"||(this.amount=Math.min(this.amount,1))}get colorMatrix(){return this._colorMatrix||this._updateMatrix(),this._colorMatrix}interpolate(t,i,r){this.amount=Yn(t.amount,i.amount,r),this._updateMatrix()}clone(){return new KN(this.type,this.amount)}toJSON(){return{type:this.type,amount:this.amount}}_updateMatrix(){const t=this._colorMatrix||Ix();switch(this.type){case"brightness":this._colorMatrix=TJ(t,this.amount);break;case"contrast":this._colorMatrix=EJ(t,this.amount);break;case"grayscale":this._colorMatrix=MJ(t,this.amount);break;case"invert":this._colorMatrix=AJ(t,this.amount);break;case"saturate":this._colorMatrix=PJ(t,this.amount);break;case"sepia":this._colorMatrix=CJ(t,this.amount)}}},XN=class QN{constructor(t,i,r,s){this.offsetX=t,this.offsetY=i,this.blurRadius=r,this.color=s,this.type="drop-shadow"}interpolate(t,i,r){this.offsetX=Yn(t.offsetX,i.offsetX,r),this.offsetY=Yn(t.offsetY,i.offsetY,r),this.blurRadius=Yn(t.blurRadius,i.blurRadius,r),this.color[0]=Math.round(Yn(t.color[0],i.color[0],r)),this.color[1]=Math.round(Yn(t.color[1],i.color[1],r)),this.color[2]=Math.round(Yn(t.color[2],i.color[2],r)),this.color[3]=Yn(t.color[3],i.color[3],r)}clone(){return new QN(this.offsetX,this.offsetY,this.blurRadius,[...this.color])}toJSON(){const t=[...this.color];return t[3]*=255,{type:"drop-shadow",xoffset:b0(this.offsetX),yoffset:b0(this.offsetY),blurRadius:b0(this.blurRadius),color:t}}},e6=class t6{constructor(t){this.angle=t,this.type="hue-rotate"}get colorMatrix(){return this._colorMatrix||this._updateMatrix(),this._colorMatrix}interpolate(t,i,r){this.angle=Yn(t.angle,i.angle,r),this._updateMatrix()}clone(){return new t6(this.angle)}toJSON(){return{type:"hue-rotate",angle:this.angle}}_updateMatrix(){const t=this._colorMatrix||Ix();this._colorMatrix=IJ(t,this.angle)}},i6=class r6{constructor(t){this.amount=t,this.type="opacity",this.amount=Math.min(this.amount,1)}interpolate(t,i,r){this.amount=Yn(t.amount,i.amount,r)}clone(){return new r6(this.amount)}toJSON(){return{type:"opacity",amount:this.amount}}};function Yn(e,t,i){return e+(t-e)*i}function b0(e){return Math.round(1e3*mh(e))/1e3}function $J(e){switch(e.type){case"grayscale":case"sepia":case"invert":return new bE(e.type,0);case"saturate":case"brightness":case"contrast":return new bE(e.type,1);case"opacity":return new i6(1);case"hue-rotate":return new e6(0);case"blur":return new YN(0);case"drop-shadow":return new XN(0,0,0,[...NA("transparent")]);case"bloom":return new WN(0,0,1)}}function kJ(e,t){const i=e.length>t.length?e:t;return(e.length>t.length?t:e).every((r,s)=>r.type===i[s].type)}function RJ(e,t){const i=e.length>t.length?e:t,r=e.length>t.length?t:e;for(let s=r.length;s_t.getLogger("esri.support.basemapUtils");function LJ(){return{}}function DJ(e){for(const t in e){const i=e[t];lr(i),delete e[t]}}function NJ(e,t){let i;if(typeof e=="string"){const r=e in yE,s=!r&&e.includes("/");if(!r&&!s){const n=Object.entries(yE).filter(([c,o])=>Ci.apiKey&&!o.classic||!Ci.apiKey&&(o.classic||o.is3d)).map(([c])=>`"${c}"`).sort().join(", ");return Z$().warn(`Unable to find basemap definition for: ${e}. Try one of these: ${n}`),null}t&&(i=t[e]),i||(i=r?v0.fromId(e):new v0({style:{id:e}}),t&&(t[e]=i))}else i=Fn(v0,e);return i!=null&&i.destroyed&&(Z$().warn("The provided basemap is already destroyed",{basemap:i}),i=null),i}function zJ(e){return new W0({getCollections:()=>[e.tables,e.layers],getChildrenFunction:t=>{const i=[];return"tables"in t&&i.push(t.tables),"layers"in t&&i.push(t.layers),i},itemFilterFunction:t=>{const i=t.parent;return!!i&&"tables"in i&&i.tables.includes(t)}})}function $S(e){for(const t of e.values())t==null||t.destroy();e.clear()}const Y$={"world-elevation":{id:"worldElevation",url:"//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer",layerType:"ArcGISTiledElevationServiceLayer"},"world-topobathymetry":{id:"worldTopoBathymetry",url:"//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/TopoBathy3D/ImageServer",layerType:"ArcGISTiledElevationServiceLayer"}};function FJ(e){let t=null;if(typeof e=="string")if(e in Y$){const i=Y$[e];t=new ww({resourceInfo:{data:{layers:[i]}}})}else _t.getLogger("esri.support.groundUtils").warn(`Unable to find ground definition for: ${e}. Try "world-elevation"`);else t=Fn(ww,e);return t}function Cm(e,t,i=!1){let{hasM:r,hasZ:s}=e;Array.isArray(t)?t.length!==4||r||s?t.length===3&&i&&!r?(s=!0,r=!1):t.length===3&&r&&s&&(r=!1,s=!1):(r=!0,s=!0):(s=!s&&t.hasZ&&(!r||t.hasM),r=!r&&t.hasM&&(!s||t.hasZ)),e.hasZ=s,e.hasM=r}var wE;function J$(e){return(t,i)=>t==null?i:i==null?t:e(t,i)}function BJ(e){return e&&(e.declaredClass==="esri.geometry.SpatialReference"||e.wkid!=null)}let Au=wE=class extends Th{constructor(...e){super(...e),this.points=[],this.type="multipoint"}normalizeCtorArgs(e,t){var s;if(!e&&!t)return{};const i={};Array.isArray(e)?(i.points=e,i.spatialReference=t):BJ(e)?i.spatialReference=e:(e.points&&(i.points=e.points),e.spatialReference&&(i.spatialReference=e.spatialReference),e.hasZ&&(i.hasZ=e.hasZ),e.hasM&&(i.hasM=e.hasM));const r=(s=i.points)==null?void 0:s[0];return r&&(i.hasZ===void 0&&i.hasM===void 0?(i.hasZ=r.length>2,i.hasM=!1):i.hasZ===void 0?i.hasZ=r.length>3:i.hasM===void 0&&(i.hasM=r.length>3)),i}get cache(){return this.commitProperty("points"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get extent(){const e=this.points;if(!e.length)return null;const t=new Ui,i=this.hasZ,r=this.hasM,s=i?3:2,n=e[0],c=J$(Math.min),o=J$(Math.max);let f,g,S,I,[A,O]=n,[z,V]=n;for(let H=0,Q=e.length;H2){const Ie=ve[2];f=c(f,Ie),S=o(S,Ie)}if(r&&ve.length>s){const Ie=ve[s];g=c(g,Ie),I=o(I,Ie)}}return t.xmin=A,t.ymin=O,t.xmax=z,t.ymax=V,t.spatialReference=this.spatialReference,i?(t.zmin=f,t.zmax=S):(t.zmin=void 0,t.zmax=void 0),r?(t.mmin=g,t.mmax=I):(t.mmin=void 0,t.mmax=void 0),t}writePoints(e,t){t.points=He(this.points)}addPoint(e){return Cm(this,e),Array.isArray(e)?this.points.push(e):this.points.push(e.toArray()),this.notifyChange("points"),this}clone(){const e={points:He(this.points),spatialReference:this.spatialReference};return this.hasZ&&(e.hasZ=!0),this.hasM&&(e.hasM=!0),new wE(e)}getPoint(e){if(!this._validateInputs(e))return null;const t=this.points[e],i={x:t[0],y:t[1],spatialReference:this.spatialReference};let r=2;return this.hasZ&&(i.z=t[2],r=3),this.hasM&&(i.m=t[r]),new ri(i)}removePoint(e){if(!this._validateInputs(e))return null;const t=new ri(this.points.splice(e,1)[0],this.spatialReference);return this.notifyChange("points"),t}setPoint(e,t){return this._validateInputs(e)?(Cm(this,t),Array.isArray(t)||(t=t.toArray()),this.points[e]=t,this.notifyChange("points"),this):this}toJSON(e){return this.write({},e)}_validateInputs(e){return e!=null&&e>=0&&e2&&t.length>2){const s=e[2]-t[2];return Math.sqrt(i*i+r*r+s*s)}return Math.sqrt(i*i+r*r)}function jJ(e,t,i){const r=e[0]+i*(t[0]-e[0]),s=e[1]+i*(t[1]-e[1]);return e.length>2&&t.length>2?[r,s,e[2]+i*(t[2]-e[2])]:[r,s]}function VJ(e,t,i,r){return GJ(e,t,i[r],i[r+1])}function GJ(e,t,i,r){const[s,n]=t,[c,o]=i,[f,g]=r,S=f-c,I=g-o,A=S*S+I*I,O=(s-c)*S+(n-o)*I,z=Math.min(1,Math.max(0,O/A));return e[0]=c+S*z,e[1]=o+I*z,e}function qJ(e,t,i,r,s,n){let c=i,o=r,f=s-c,g=n-o;if(f!==0||g!==0){const S=((e-c)*f+(t-o)*g)/(f*f+g*g);S>1?(c=s,o=n):S>0&&(c+=f*S,o+=g*S)}return f=e-c,g=t-o,f*f+g*g}function n6(e,t){return jJ(e,t,.5)}function o6(e,t=xw.X,i=xw.Y){let r=0;const s=e.length;let n=e[0];for(let c=0;c=0}function HJ(e){const t=e.length;return t>2&&sx(e[0],e[t-1])}function Sge(e){if("rings"in e&&(WJ(e),e.rings.length>0&&!o6(e.rings[0])))for(const t of e.rings)t.reverse()}function WJ(e){if("rings"in e)for(const t of e.rings)HJ(t)||t.push(t[0].slice())}function Tge(e){return e?e.hasZ?[e.xmax-e.xmin/2,e.ymax-e.ymin/2,e.zmax-e.zmin/2]:[e.xmax-e.xmin/2,e.ymax-e.ymin/2]:null}function ZJ(e){return e?YJ(e.rings,e.hasZ??!1):null}function YJ(e,t){if(!(e!=null&&e.length))return null;const i=[],r=[],s=t?[1/0,-1/0,1/0,-1/0,1/0,-1/0]:[1/0,-1/0,1/0,-1/0];for(let n=0,c=e.length;n{let o=n[2]-c[2];return o===0&&t&&(o=n[4]-c[4]),o}),r.length&&(i[0]=r[0][0],i[1]=r[0][1],t&&(i[2]=r[0][3]),(i[0]s[1]||i[1]s[3]||t&&(i[2]s[5]))&&(i.length=0)),!i.length){const n=e[0]&&e[0].length?JJ(e[0],t):null;if(!n)return null;i[0]=n[0],i[1]=n[1],t&&n.length>2&&(i[2]=n[2])}return i}function a6(e,t,i){let r=0,s=0,n=0,c=0,o=0;const f=e.length?e[0][0]:0,g=e.length?e[0][1]:0,S=e.length&&t?e[0][2]:0;for(let A=0;A2&&z.length>2){const ut=Q-S,ot=Ce-S,et=ve*ot-ze*ut;n+=(ut+ot)*et,o+=et}Vi[1]&&(i[1]=V),Hi[3]&&(i[3]=H),t&&(Qi[5]&&(i[5]=Q))}if(c>0&&(c*=-1),o>0&&(o*=-1),!c)return null;c*=.5,o*=.5;const I=[r/(6*c)+f,s/(6*c)+g,c];return t&&(i[4]===i[5]||o===0?(I[3]=(i[4]+i[5])/2,I[4]=0):(I[3]=n/(6*o)+S,I[4]=o)),I}function Ege(e,t){let i=0,r=0,s=0;e.nextPoint();const n=e.pathSize?e.x:0,c=e.pathSize?e.y:0;for(let o=0;ot[1]&&(t[1]=S),It[3]&&(t[3]=I)}return s>0&&(s*=-1),s?(s*=.5,[i/(6*s)+n,r/(6*s)+c,s]):null}function JJ(e,t){const i=t?[0,0,0]:[0,0],r=t?[0,0,0]:[0,0];let s=0,n=0,c=0,o=0;for(let f=0,g=e.length;f2&&I.length>2&&(i[2]=S[2],r[2]=I[2]);const A=s6(i,r);if(A){s+=A;const O=n6(S,I);n+=A*O[0],c+=A*O[1],t&&O.length>2&&(o+=A*O[2])}}}return s>0?t?[n/s,c/s,o/s]:[n/s,c/s]:e.length?e[0]:null}function KJ(e){const{hasZ:t,totalSize:i}=e;if(i===0)return null;const r=[],s=[],n=t?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY];for(e.reset();e.nextPath();){const c=a6(UJ(e),e.hasZ,n);c&&s.push(c)}if(s.sort((c,o)=>{let f=c[2]-o[2];return f===0&&t&&(f=c[4]-o[4]),f}),s.length&&(r[0]=s[0][0],r[1]=s[0][1],t&&(r[2]=s[0][3]),(r[0]n[1]||r[1]n[3]||t&&(r[2]n[5]))&&(r.length=0)),!r.length){e.reset(),e.nextPath();const c=e.pathSize?XJ(e):null;if(!c)return null;r[0]=c[0],r[1]=c[1],t&&c.length>2&&(r[2]=c[2])}return r}function XJ(e){const{hasZ:t}=e,i=t?[0,0,0]:[0,0],r=t?[0,0,0]:[0,0];let s=0,n=0,c=0,o=0;if(e.nextPoint()){let f=e.x,g=e.y,S=e.z;for(;e.nextPoint();){const I=e.x,A=e.y,O=e.z;i[0]=f,i[1]=g,r[0]=I,r[1]=A,t&&(i[2]=S,r[2]=O);const z=s6(i,r);if(z){s+=z;const V=n6(i,r);n+=z*V[0],c+=z*V[1],t&&V.length>2&&(o+=z*V[2])}f=I,g=A,S=O}}return s>0?t?[n/s,c/s,o/s]:[n/s,c/s]:e.pathSize?(e.seekPathStart(),e.nextPoint(),[e.x,e.y]):null}const QJ=1e-6;function Mge(e){let t=0;for(e.reset();e.nextPath();)t+=e.getCurrentRingArea();if(te[2]&&(e[2]=t[0]),t[1]e[3]&&(e[3]=t[1])}function Cge(e,t,i){if(t!=null)if("length"in t)xE(t)?(i[0]=Math.min(e[0],t[0]),i[1]=Math.min(e[1],t[1]),i[2]=Math.max(e[2],t[2]),i[3]=Math.max(e[3],t[3])):t.length!==2&&t.length!==3||(i[0]=Math.min(e[0],t[0]),i[1]=Math.min(e[1],t[1]),i[2]=Math.max(e[2],t[0]),i[3]=Math.max(e[3],t[1]));else switch(t.type){case"extent":i[0]=Math.min(e[0],t.xmin),i[1]=Math.min(e[1],t.ymin),i[2]=Math.max(e[2],t.xmax),i[3]=Math.max(e[3],t.ymax);break;case"point":i[0]=Math.min(e[0],t.x),i[1]=Math.min(e[1],t.y),i[2]=Math.max(e[2],t.x),i[3]=Math.max(e[3],t.y)}else l6(i,e)}function c6(e){return e==null||e[0]>=e[2]?0:e[2]-e[0]}function u6(e){return e==null||e[1]>=e[3]?0:e[3]-e[1]}function $ge(e){return c6(e)*u6(e)}function kge(e,t,i){return t>=e[0]&&i>=e[1]&&t<=e[2]&&i<=e[3]}function Rge(e,t){return Math.max(t[0],e[0])<=Math.min(t[2],e[2])&&Math.max(t[1],e[1])<=Math.min(t[3],e[3])}function rK(e,t){return t[0]>=e[0]&&t[2]<=e[2]&&t[1]>=e[1]&&t[3]<=e[3]}function Oge(e){return e?l6(e,K$):eo(K$)}function xE(e){return e!=null&&e.length===4}function Lge(e,t){return xE(e)&&xE(t)?e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]:e===t}const K$=[1/0,1/0,-1/0,-1/0],sK=[0,0,0,0];function h6(e){return e.xmin!==void 0&&e.ymin!==void 0&&e.xmax!==void 0&&e.ymax!==void 0}function d6(e){return e.points!==void 0}function p6(e){return e.x!==void 0&&e.y!==void 0}function f6(e){return e.paths!==void 0}function m6(e){return e.rings!==void 0}function y6(e){function t(i,r){return i==null?r:r==null?i:e(i,r)}return t}const oh=y6(Math.min),ah=y6(Math.max);function Dge(e,t){return f6(t)?$m(e,t.paths,!1,!1):m6(t)?$m(e,t.rings,!1,!1):d6(t)?UA(e,t.points,!1,!1,!1,!1):h6(t)?g6(e,t):(p6(t)&&(e[0]=t.x,e[1]=t.y,e[2]=t.x,e[3]=t.y),e)}function Nge(e){let t,i,r,s;for(e.reset(),t=r=1/0,i=s=-1/0;e.nextPath();){const n=nK(e);t=Math.min(n[0],t),r=Math.min(n[1],r),i=Math.max(n[2],i),s=Math.max(n[3],s)}return eo([t,r,i,s])}function nK(e){let t,i,r,s;for(t=r=1/0,i=s=-1/0;e.nextPoint();)t=Math.min(e.x,t),r=Math.min(e.y,r),i=Math.max(e.x,i),s=Math.max(e.y,s);return eo([t,r,i,s])}function zge(e,t){return f6(t)?$m(e,t.paths,!0,!1):m6(t)?$m(e,t.rings,!0,!1):d6(t)?UA(e,t.points,!0,!1,!0,!1):h6(t)?g6(e,t,!0,!1,!0,!1):(p6(t)&&(e[0]=t.x,e[1]=t.y,e[2]=t.z,e[3]=t.x,e[4]=t.y,e[5]=t.z),e)}function $m(e,t,i,r){const s=i?3:2;if(!t.length||!t[0].length)return null;let n,c,o,f,[g,S]=t[0][0],[I,A]=t[0][0];for(let O=0;O2){const me=H[2];n=oh(n,me),c=ah(c,me)}if(r&&H.length>s){const me=H[s];o=oh(n,me),f=ah(c,me)}}}return i?r?(e[0]=g,e[1]=S,e[2]=n,e[3]=o,e[4]=I,e[5]=A,e[6]=c,e[7]=f,e.length=8,e):(e[0]=g,e[1]=S,e[2]=n,e[3]=I,e[4]=A,e[5]=c,e.length=6,e):r?(e[0]=g,e[1]=S,e[2]=o,e[3]=I,e[4]=A,e[5]=f,e.length=6,e):(e[0]=g,e[1]=S,e[2]=I,e[3]=A,e.length=4,e)}function g6(e,t,i,r,s,n){const c=t.xmin,o=t.xmax,f=t.ymin,g=t.ymax;let S=t.zmin,I=t.zmax,A=t.mmin,O=t.mmax;return s?(S=S||0,I=I||0,n?(A=A||0,O=O||0,e[0]=c,e[1]=f,e[2]=S,e[3]=A,e[4]=o,e[5]=g,e[6]=I,e[7]=O,e):(e[0]=c,e[1]=f,e[2]=S,e[3]=o,e[4]=g,e[5]=I,e)):n?(A=A||0,O=O||0,e[0]=c,e[1]=f,e[2]=A,e[3]=o,e[4]=g,e[5]=O,e):(e[0]=c,e[1]=f,e[2]=o,e[3]=g,e)}function UA(e,t,i,r,s,n){const c=i?3:2,o=r&&n,f=i&&s;if(!t.length||!t[0].length)return null;let g,S,I,A,[O,z]=t[0],[V,H]=t[0];for(let Q=0;Q2){const Ie=ve[2];g=oh(g,Ie),S=ah(S,Ie)}if(o&&ve.length>c){const Ie=ve[c];I=oh(g,Ie),A=ah(S,Ie)}}return s?(g=g||0,S=S||0,n?(I=I||0,A=A||0,e[0]=O,e[1]=z,e[2]=g,e[3]=I,e[4]=V,e[5]=H,e[6]=S,e[7]=A,e):(e[0]=O,e[1]=z,e[2]=g,e[3]=V,e[4]=H,e[5]=S,e)):n?(I=I||0,A=A||0,e[0]=O,e[1]=z,e[2]=I,e[3]=V,e[4]=H,e[5]=A,e):(e[0]=O,e[1]=z,e[2]=V,e[3]=H,e)}function oK(e){return e.xmin!==void 0&&e.ymin!==void 0&&e.xmax!==void 0&&e.ymax!==void 0}function aK(e){return e.points!==void 0}function lK(e){return e.x!==void 0&&e.y!==void 0}function cK(e){return e.paths!==void 0}function uK(e){return e.rings!==void 0}const jA=[];function _6(e,t,i,r){return{xmin:e,ymin:t,xmax:i,ymax:r}}function v6(e,t,i,r,s,n){return{xmin:e,ymin:t,zmin:i,xmax:r,ymax:s,zmax:n}}function b6(e,t,i,r,s,n){return{xmin:e,ymin:t,mmin:i,xmax:r,ymax:s,mmax:n}}function w6(e,t,i,r,s,n,c,o){return{xmin:e,ymin:t,zmin:i,mmin:r,xmax:s,ymax:n,zmax:c,mmax:o}}function VA(e,t=!1,i=!1){return t?i?w6(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]):v6(e[0],e[1],e[2],e[3],e[4],e[5]):i?b6(e[0],e[1],e[2],e[3],e[4],e[5]):_6(e[0],e[1],e[2],e[3])}function Fge(e){return e?oK(e)?e:lK(e)?dK(e):uK(e)?x6(e):cK(e)?S6(e):aK(e)?hK(e):null:null}function hK(e){const{hasZ:t,hasM:i,points:r}=e;return VA(UA(jA,r,t??!1,i??!1),t,i)}function dK(e){const{x:t,y:i,z:r,m:s}=e,n=s!=null;return r!=null?n?w6(t,i,r,s,t,i,r,s):v6(t,i,r,t,i,r):n?b6(t,i,s,t,i,s):_6(t,i,t,i)}function x6(e){const{hasZ:t,hasM:i,rings:r}=e,s=$m(jA,r,t??!1,i??!1);return s?VA(s,t,i):null}function S6(e){const{hasZ:t,hasM:i,paths:r}=e,s=$m(jA,r,t??!1,i??!1);return s?VA(s,t,i):null}var Jv;function X$(e){return!Array.isArray(e[0])}let pl=Jv=class extends Th{static fromExtent(e){const t=e.clone().normalize(),i=e.spatialReference;let r=!1,s=!1;for(const c of t)c.hasZ&&(r=!0),c.hasM&&(s=!0);const n={rings:t.map(c=>{const o=[[c.xmin,c.ymin],[c.xmin,c.ymax],[c.xmax,c.ymax],[c.xmax,c.ymin],[c.xmin,c.ymin]];if(r&&c.hasZ){const f=c.zmin+.5*(c.zmax-c.zmin);for(let g=0;g2,r=n.length>3):i===void 0?i=r?n.length>3:n.length>2:r===void 0&&(r=i?n.length>3:n.length>2)),{rings:s,spatialReference:t,hasZ:i,hasM:r}}get cache(){return this.commitProperty("rings"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get centroid(){const e=ZJ(this);if(!e||isNaN(e[0])||isNaN(e[1])||this.hasZ&&isNaN(e[2]))return null;const t=new ri;return t.x=e[0],t.y=e[1],t.spatialReference=this.spatialReference,this.hasZ&&(t.z=e[2]),t}get extent(){const{spatialReference:e}=this,t=x6(this);if(!t)return null;const i=new Ui(t);return i.spatialReference=e,i}get isSelfIntersecting(){return BW(this.rings)}writeRings(e,t){t.rings=He(this.rings)}addRing(e){if(!e)return;const t=this.rings,i=t.length;if(X$(e)){const r=[];for(let s=0,n=e.length;ss===f&&n===g&&(c==null&&S==null||c===S)&&(o==null&&I==null||o===I);for(let s=0;sthis.hasZ?this.hasM?[i.x,i.y,i.z,i.m]:[i.x,i.y,i.z]:[i.x,i.y]):e,o6(t)}getPoint(e,t){if(!this._validateInputs(e,t))return null;const i=this.rings[e][t],r=this.hasZ,s=this.hasM;return r&&!s?new ri(i[0],i[1],i[2],void 0,this.spatialReference):s&&!r?new ri(i[0],i[1],void 0,i[2],this.spatialReference):r&&s?new ri(i[0],i[1],i[2],i[3],this.spatialReference):new ri(i[0],i[1],this.spatialReference)}insertPoint(e,t,i){return this._validateInputs(e,t,!0)?(Cm(this,i),Array.isArray(i)||(i=i.toArray()),this.rings[e].splice(t,0,i),this.notifyChange("rings"),this):this}removePoint(e,t){if(!this._validateInputs(e,t))return null;const i=new ri(this.rings[e].splice(t,1)[0],this.spatialReference);return this.notifyChange("rings"),i}removeRing(e){if(!this._validateInputs(e,null))return null;const t=this.rings.splice(e,1)[0],i=this.spatialReference,r=t.map(s=>new ri(s,i));return this.notifyChange("rings"),r}setPoint(e,t,i){return this._validateInputs(e,t)?(Cm(this,i),Array.isArray(i)||(i=i.toArray()),this.rings[e][t]=i,this.notifyChange("rings"),this):this}_validateInputs(e,t,i=!1){if(e==null||e<0||e>=this.rings.length)return!1;if(t!=null){const r=this.rings[e];if(i&&(t<0||t>r.length)||!i&&(t<0||t>=r.length))return!1}return!0}toJSON(e){return this.write({},e)}};v([M({readOnly:!0})],pl.prototype,"cache",null),v([M({readOnly:!0})],pl.prototype,"centroid",null),v([M({readOnly:!0})],pl.prototype,"extent",null),v([M({readOnly:!0})],pl.prototype,"isSelfIntersecting",null),v([M({type:[[[Number]]],json:{write:{isRequired:!0}}})],pl.prototype,"rings",void 0),v([ui("rings")],pl.prototype,"writeRings",null),pl=Jv=v([fe("esri.geometry.Polygon")],pl),pl.prototype.toJSON.isDefaultToJSON=!0;const yh=pl;var SE;function pK(e){return!Array.isArray(e[0])}let Pu=SE=class extends Th{constructor(...e){super(...e),this.paths=[],this.type="polyline"}normalizeCtorArgs(e,t){var c,o;let i,r,s=null,n=null;return e&&!Array.isArray(e)?(s=e.paths??null,t||(e.spatialReference?t=e.spatialReference:e.paths||(t=e)),i=e.hasZ,r=e.hasM):s=e,s=s||[],t=t||yi.WGS84,s.length&&((c=s[0])==null?void 0:c[0])!=null&&typeof s[0][0]=="number"&&(s=[s]),n=(o=s[0])==null?void 0:o[0],n&&(i===void 0&&r===void 0?(i=n.length>2,r=!1):i===void 0?i=!r&&n.length>3:r===void 0&&(r=!i&&n.length>3)),{paths:s,spatialReference:t,hasZ:i,hasM:r}}get cache(){return this.commitProperty("paths"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get extent(){const{spatialReference:e}=this,t=S6(this);if(!t)return null;const i=new Ui(t);return i.spatialReference=e,i}writePaths(e,t){t.paths=He(this.paths)}addPath(e){if(!e)return;const t=this.paths,i=t.length;if(pK(e)){const r=[];for(let s=0,n=e.length;snew ri(s,i));return this.notifyChange("paths"),r}removePoint(e,t){if(!this._validateInputs(e,t))return null;const i=new ri(this.paths[e].splice(t,1)[0],this.spatialReference);return this.notifyChange("paths"),i}setPoint(e,t,i){return this._validateInputs(e,t)?(Cm(this,i),Array.isArray(i)||(i=i.toArray()),this.paths[e][t]=i,this.notifyChange("paths"),this):this}_validateInputs(e,t,i=!1){if(e==null||e<0||e>=this.paths.length)return!1;if(t!=null){const r=this.paths[e];if(i&&(t<0||t>r.length)||!i&&(t<0||t>=r.length))return!1}return!0}toJSON(e){return this.write({},e)}};v([M({readOnly:!0})],Pu.prototype,"cache",null),v([M({readOnly:!0})],Pu.prototype,"extent",null),v([M({type:[[[Number]]],json:{write:{isRequired:!0}}})],Pu.prototype,"paths",void 0),v([ui("paths")],Pu.prototype,"writePaths",null),Pu=SE=v([fe("esri.geometry.Polyline")],Pu),Pu.prototype.toJSON.isDefaultToJSON=!0;const Ua=Pu,fK=Bn()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),Bge=Bn()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"});function T6(e){return e.xmin!==void 0&&e.ymin!==void 0&&e.xmax!==void 0&&e.ymax!==void 0}function E6(e){return e.points!==void 0}function M6(e){return e.x!==void 0&&e.y!==void 0}function I6(e){return e.paths!==void 0}function GA(e){return e.rings!==void 0}function km(e){return e==null?null:e instanceof Th?e:M6(e)?ri.fromJSON(e):I6(e)?Ua.fromJSON(e):GA(e)?yh.fromJSON(e):E6(e)?Px.fromJSON(e):T6(e)?Ui.fromJSON(e):null}function qA(e){return e?M6(e)?"esriGeometryPoint":I6(e)?"esriGeometryPolyline":GA(e)?"esriGeometryPolygon":T6(e)?"esriGeometryEnvelope":E6(e)?"esriGeometryMultipoint":null:null}const mK={esriGeometryPoint:ri,esriGeometryPolyline:Ua,esriGeometryPolygon:yh,esriGeometryEnvelope:Ui,esriGeometryMultipoint:Px};function yK(e){return e&&mK[e]||null}const Cx={base:Th,key:"type",typeMap:{extent:Ui,multipoint:Px,point:ri,polyline:Ua,polygon:yh}};Uc(Cx);let A6=0;const HA=e=>{let t=class extends e{constructor(...i){super(...i),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+A6++})}};return t=v([fe("esri.core.Identifiable")],t),t},WA=e=>{let t=class extends e{constructor(...i){super(...i),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:A6++})}};return t=v([fe("esri.core.NumericIdentifiable")],t),t};let Q$=class extends HA(class{}){};Q$=v([fe("esri.core.Identifiable")],Q$);async function gK(e){const t="portalItem"in e?e:{portalItem:e},{fromItem:i}=await ht(()=>import("./portalLayers-DU48R6fl.js").then(r=>r.p),__vite__mapDeps([3,4,5]));try{return await i(t)}catch(r){const s=t&&t.portalItem,n=(s==null?void 0:s.id)||"unset",c=s&&s.portal&&s.portal.url||Ci.portalUrl;throw _t.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+c+"', id: '"+n+"')",r),r}}let _K=0,us=class extends Sh.EventedMixin(HA(dh)){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new Ui(-180,-90,180,90,yi.WGS84),this.id=Date.now().toString(16)+"-layer-"+_K++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=yi.WGS84,this.title=null,this.type=null,this.url=null,this.visible=!0}static async fromArcGISServerUrl(t){const i=typeof t=="string"?{url:t}:t;return(await ht(()=>import("./arcgisLayers-fiEUw9dp.js"),__vite__mapDeps([7,4,8,5]))).fromUrl(i)}static fromPortalItem(t){return gK(t)}initialize(){this.when().catch(t=>{Ys(t)||_t.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:t})})}destroy(){const t=this.parent;if(t){const i=this;"layers"in t&&t.layers.includes(i)?t.layers.remove(i):"tables"in t&&t.tables.includes(i)?t.tables.remove(i):"baseLayers"in t&&t.baseLayers.includes(i)?t.baseLayers.remove(i):"referenceLayers"in t&&t.referenceLayers.includes(i)&&t.referenceLayers.remove(i),this._set("parent",null)}}get hasAttributionData(){return this.attributionDataUrl!=null}get parsedUrl(){return Rr(this.url)}async fetchAttributionData(){const t=this.attributionDataUrl;if(this.hasAttributionData&&t)return(await Qi(t,{query:{f:"json"},responseType:"json"})).data;throw new Je("layer:no-attribution-data","Layer does not have attribution data")}};v([M({type:String})],us.prototype,"attributionDataUrl",void 0),v([M({type:Ui})],us.prototype,"fullExtent",void 0),v([M({readOnly:!0})],us.prototype,"hasAttributionData",null),v([M({type:String,clonable:!1})],us.prototype,"id",void 0),v([M({type:Boolean,nonNullable:!0})],us.prototype,"legendEnabled",void 0),v([M({type:["show","hide","hide-children"]})],us.prototype,"listMode",void 0),v([M({type:Number,range:{min:0,max:1},nonNullable:!0})],us.prototype,"opacity",void 0),v([M({clonable:!1})],us.prototype,"parent",void 0),v([M({readOnly:!0})],us.prototype,"parsedUrl",null),v([M({type:Boolean,readOnly:!0})],us.prototype,"persistenceEnabled",void 0),v([M({type:Boolean})],us.prototype,"popupEnabled",void 0),v([M({type:Boolean})],us.prototype,"attributionVisible",void 0),v([M({type:yi})],us.prototype,"spatialReference",void 0),v([M({type:String})],us.prototype,"title",void 0),v([M({readOnly:!0,json:{read:!1}})],us.prototype,"type",void 0),v([M()],us.prototype,"url",void 0),v([M({type:Boolean,nonNullable:!0})],us.prototype,"visible",void 0),us=v([fe("esri.layers.Layer")],us);const P6=us;function TE(e,t,i){let r,s;if(e)for(let n=0,c=e.length;n{let t=class extends e{constructor(...i){super(...i),this.layers=new Bt;const r=c=>{c.parent&&"remove"in c.parent&&c.parent.remove(c)},s=c=>{c.parent=this,this.layerAdded(c),c.type!=="elevation"&&c.type!=="base-elevation"||_t.getLogger(this).error(`Layer 'title:${c.title}, id:${c.id}' of type '${c.type}' is not supported as an operational layer and will therefore be ignored.`)},n=c=>{c.parent=null,this.layerRemoved(c)};this.addHandles([this.layers.on("before-add",c=>r(c.item)),this.layers.on("after-add",c=>s(c.item)),this.layers.on("after-remove",c=>n(c.item))])}destroy(){const i=this.layers.toArray();for(const r of i)r.destroy();this.layers.destroy()}set layers(i){this._set("layers",mp(i,this._get("layers")))}add(i,r){const s=this.layers;if(r=s.getNextIndex(r),i instanceof P6){const n=i;n.parent===this?this.reorder(n,r):s.add(n,r)}else xh(i)?i.then(n=>{this.destroyed||this.add(n,r)}):_t.getLogger(this).error("#add()","The item being added is not a Layer or a Promise that resolves to a Layer.")}addMany(i,r){const s=this.layers;let n=s.getNextIndex(r);i.slice().forEach(c=>{c.parent!==this?(s.add(c,n),n+=1):this.reorder(c,n)})}findLayerById(i){return TE(this.layers,"id",i)}findLayerByUid(i){return TE(this.layers,"uid",i)}remove(i){return this.layers.remove(i)}removeMany(i){return this.layers.removeMany(i)}removeAll(){return this.layers.removeAll()}reorder(i,r){return this.layers.reorder(i,r)}layerAdded(i){}layerRemoved(i){}};return v([M()],t.prototype,"layers",null),t=v([fe("esri.support.LayersMixin")],t),t};function EE(e,t,i){if(e)for(let r=0,s=e.length;r{let t=class extends e{constructor(...i){super(...i),this.tables=new Bt,this.addHandles([this.tables.on("after-add",r=>{const s=r.item;s.parent&&s.parent!==this&&"tables"in s.parent&&s.parent.tables.remove(s),s.parent=this,s.type!=="feature"&&_t.getLogger(this).error(`Layer 'title:${s.title}, id:${s.id}' of type '${s.type}' is not supported as a table and will therefore be ignored.`)}),this.tables.on("after-remove",r=>{r.item.parent=null})])}destroy(){const i=this.tables.toArray();for(const r of i)r.destroy();this.tables.destroy()}set tables(i){this._set("tables",mp(i,this._get("tables")))}findTableById(i){return EE(this.tables,"id",i)}findTableByUid(i){return EE(this.tables,"uid",i)}};return v([M()],t.prototype,"tables",null),t=v([fe("esri.support.TablesMixin")],t),t};let Ea=class extends bK(vK(Sh.EventedMixin(Nt))){constructor(t){super(t),this.allLayers=new W0({getCollections:()=>{var i,r,s;return[(i=this.basemap)==null?void 0:i.baseLayers,(r=this.ground)==null?void 0:r.layers,this.layers,(s=this.basemap)==null?void 0:s.referenceLayers]},getChildrenFunction:i=>"layers"in i?i.layers:null}),this.allTables=zJ(this),this.basemap=null,this.editableLayers=new W0({getCollections:()=>[this.allLayers],itemFilterFunction:CY}),this.ground=new ww,this._basemapCache=LJ()}destroy(){DJ(this._basemapCache),this._basemapCache=null,this.allLayers.destroy(),this.allTables.destroy(),this.editableLayers.destroy(),this.basemap=lr(this.basemap),lr(this.ground),this._set("ground",null)}castBasemap(t){return NJ(t,this._basemapCache)}castGround(t){return FJ(t)??this._get("ground")}findLayerById(t){return this.allLayers.find(i=>i.id===t)}findTableById(t){return this.allTables.find(i=>i.id===t)}};v([M({readOnly:!0,dependsOn:[]})],Ea.prototype,"allLayers",void 0),v([M({readOnly:!0})],Ea.prototype,"allTables",void 0),v([M({type:v0,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],Ea.prototype,"basemap",void 0),v([Rs("basemap")],Ea.prototype,"castBasemap",null),v([M({readOnly:!0})],Ea.prototype,"editableLayers",void 0),v([M({type:ww,nonNullable:!0})],Ea.prototype,"ground",void 0),v([Rs("ground")],Ea.prototype,"castGround",null),v([M()],Ea.prototype,"undoRedo",void 0),Ea=v([fe("esri.Map")],Ea);const C6=Ea,jl=e=>{let t=class extends e{clone(){var f;const i=To(this);F5(i,"unable to clone instance of non-accessor class");const r=i.metadata,s=i.store,n={},c=new Map;for(const g in r){const S=r[g],I=s==null?void 0:s.originOf(g),A=S.clonable;if(S.readOnly||A===!1||I!==fi.USER&&I!==fi.DEFAULTS&&I!==fi.WEB_MAP&&I!==fi.WEB_SCENE)continue;const O=this[g];let z=null;z=typeof A=="function"?A(O):A==="reference"?O:$T(O),O!=null&&z==null||(I===fi.DEFAULTS?c.set(g,z):n[g]=z)}const o=new(Object.getPrototypeOf(this)).constructor(n);if(c.size){const g=(f=To(o))==null?void 0:f.store;if(g)for(const[S,I]of c)g.set(S,I,fi.DEFAULTS)}return o}};return t=v([fe("esri.core.Clonable")],t),t};let ME=class extends jl(Nt){};ME=v([fe("esri.core.Clonable")],ME);let pd=class extends ME{constructor(t){super(t),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(t){return t!=null&&this.row===t.row&&this.rows===t.rows&&this.column===t.column&&this.columns===t.columns}};v([M({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],pd.prototype,"row",void 0),v([M({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],pd.prototype,"column",void 0),v([M({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],pd.prototype,"rows",void 0),v([M({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],pd.prototype,"columns",void 0),pd=v([fe("esri.CameraLayout")],pd);const $6=pd;let ZA=class{constructor(t,i){this.min=t,this.max=i,this.range=i-t}ndiff(t,i=0){return Math.ceil((t-i)/this.range)*this.range+i}_normalize(t,i,r,s=0,n=!1){return(r-=s)i&&(r-=this.ndiff(r-i)),n&&r===i&&(r=t),r+s}normalize(t,i=0,r=!1){return this._normalize(this.min,this.max,t,i,r)}clamp(t,i=0){return Ll(t-i,this.min,this.max)+i}monotonic(t,i,r){return tt&&rwK.normalize(za(e)))],fl.prototype,"heading",void 0),v([M({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),Rs(e=>Ll(za(e),-180,180))],fl.prototype,"tilt",void 0),v([M({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],fl.prototype,"fov",void 0),v([M({type:$6,nonNullable:!0,json:{read:!1,write:!1}})],fl.prototype,"layout",void 0),fl=v([fe("esri.Camera")],fl);const xK=fl;var IE;let Cu=IE=class extends At{constructor(e){super(e),this.rotation=0,this.scale=0,this.targetGeometry=null,this.camera=null}castRotation(e){return(e%=360)<0&&(e+=360),e}clone(){return new IE({rotation:this.rotation,scale:this.scale,targetGeometry:this.targetGeometry!=null?this.targetGeometry.clone():null,camera:this.camera!=null?this.camera.clone():null})}};function kS(){return{enabled:!this.camera}}v([M({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:kS}}}}})],Cu.prototype,"rotation",void 0),v([Rs("rotation")],Cu.prototype,"castRotation",null),v([M({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:kS}}}}})],Cu.prototype,"scale",void 0),v([M({types:Cx,json:{read:km,write:!0,origins:{"web-scene":{read:km,write:{overridePolicy:kS}}}}})],Cu.prototype,"targetGeometry",void 0),v([M({type:xK,json:{write:!0}})],Cu.prototype,"camera",void 0),Cu=IE=v([fe("esri.Viewpoint")],Cu);const kl=Cu;function ti(e,t,i={}){return JA(e,t,i,k6)}function gh(e,t,i={}){return JA(e,t,i,R6)}function JA(e,t,i={},r){let s=null;const n=i.once?(c,o)=>{r(c)&&(Sr(s),t(c,o))}:(c,o)=>{r(c)&&t(c,o)};if(s=WG(e,n,i.sync,i.equals),i.initial){const c=e();n(c,c)}return s}function Sp(e,t,i,r={}){let s=null,n=null,c=null;function o(){var S;s&&n&&(n.remove(),(S=r.onListenerRemove)==null||S.call(r,s),s=null,n=null)}function f(S){r.once&&r.once&&Sr(c),i(S)}const g=ti(e,(S,I)=>{var A;o(),cx(S)&&(s=S,n=f_(S,t,f),(A=r.onListenerAdd)==null||A.call(r,S))},{sync:r.sync,initial:!0});return c=er(()=>{g.remove(),o()}),c}function $x(e,t){return SK(e,R6,t)}function SK(e,t,i){if(ra(i))return Promise.reject(jr());const r=e();if(t!=null&&t(r))return Promise.resolve(r);let s=null;function n(){s=Sr(s)}return new Promise((c,o)=>{s=h_([io(i,()=>{n(),o(jr())}),JA(e,f=>{n(),c(f)},{sync:!1,once:!0},t??k6)])})}function k6(e){return!0}function R6(e){return!!e}const Tp={sync:!0},_n={initial:!0},Fa={sync:!0,initial:!0};let Sw=class{constructor(t=i=>i.values().next().value){this._peeker=t,this._observable=new g_,this._items=new Set}get length(){return Rt(this._observable),this._items.size}clear(){this.length!==0&&(this._items.clear(),this._observable.notify())}last(){if(this.length===0)return;let t;for(t of this._items);return t}peek(){if(this.length!==0)return this._peeker(this._items)}push(t){this.contains(t)||(this._items.add(t),this._observable.notify())}contains(t){return Rt(this._observable),this._items.has(t)}pop(){if(this.length===0)return;const t=this.peek();return this._items.delete(t),this._observable.notify(),t}popLast(){if(this.length===0)return;const t=this.last();return this._items.delete(t),this._observable.notify(),t}remove(t){this.contains(t)&&(this._items.delete(t),this._observable.notify())}filter(t){const i=this.length;return this._items.forEach(r=>{t(r)||this._items.delete(r)}),i!==this._items.size&&this._observable.notify(),this}*[Symbol.iterator](){Rt(this._observable),yield*this._items}};const O6=new FinalizationRegistry(e=>{e.close()});function TK(e,t){O6.register(e,t,t)}function EK(e){O6.unregister(e)}const L6="worker:port-closed";var $s;(function(e){e[e.HANDSHAKE=0]="HANDSHAKE",e[e.OPEN=1]="OPEN",e[e.OPENED=2]="OPENED",e[e.RESPONSE=3]="RESPONSE",e[e.INVOKE=4]="INVOKE",e[e.ABORT=5]="ABORT",e[e.CLOSE=6]="CLOSE",e[e.OPEN_PORT=7]="OPEN_PORT",e[e.ON=8]="ON"})($s||($s={}));let MK=0;function D6(){return MK++}function IK(e){return e&&typeof e=="object"&&("result"in e||"transferList"in e)}function Z0(e){return e?typeof e=="string"?JSON.stringify({name:"message",message:e}):e.toJSON?JSON.stringify(e):JSON.stringify({name:e.name,message:e.message,details:e.details||{stack:e.stack}}):null}function KA(e,t,i,r){if(t.type===$s.OPEN_PORT)return void e.postMessage(t,[t.port]);if(t.type!==$s.INVOKE&&t.type!==$s.RESPONSE)return void e.postMessage(t);let s;if(IK(i)?(s=ek(i.transferList),t.data=i.result):(s=ek(r),t.data=i),s){if(Le("ff")){for(const n of s)if("byteLength"in n&&n.byteLength>267386880){const c="Worker call with large ArrayBuffer would crash Firefox";switch(t.type){case $s.INVOKE:throw c;case $s.RESPONSE:return void KA(e,{type:$s.RESPONSE,jobId:t.jobId,error:Z0(c)})}}}e.postMessage(t,s)}else e.postMessage(t)}function Y0(e){if(!e)return null;const t=e.data;return t?typeof t=="string"?JSON.parse(t):t:null}function ek(e){if(!(e!=null&&e.length))return null;if(Le("esri-workers-arraybuffer-transfer"))return e;const t=e.filter(i=>!AK(i));return t.length?t:null}function AK(e){var t;return e instanceof ArrayBuffer||((t=e==null?void 0:e.constructor)==null?void 0:t.name)==="ArrayBuffer"}async function PK(e){try{return await e}catch(t){const i=(t==null?void 0:t.name)===L6;if(!(Ys(t)||i))throw t;return}}function N6(e,t,i){return new Proxy({},{get:(r,s,n)=>(...c)=>{let o,f;const g=c[c.length-1];CK(g)&&(o=g.signal,f=g.transferList,c.pop());const S=e.apply(t?`${t}.${s.toString()}`:s.toString(),c,{transferList:f,signal:o});return i!=null&&i.ignoreConnectionErrors?PK(S):S}})}function CK(e){return typeof e=="object"&&!Array.isArray(e)&&e!=null&&("signal"in e||"transferList"in e||Object.keys(e).length===0)}const $K={statsWorker:()=>ht(()=>import("./statsWorker-CAnWqyLs.js"),__vite__mapDeps([9,10,11,12,13,14,15])),geometryEngineWorker:()=>ht(()=>import("./geometryEngineWorker-C9d969a6.js"),__vite__mapDeps([16,17,18,19])),CSVSourceWorker:()=>ht(()=>import("./CSVSourceWorker-DNn0ZitV.js"),__vite__mapDeps([20,21,19,22,23,24,25,26,27,28,29,30,31,32,33,11,10,12,13,14,15,34,35,36,37,38])),EdgeProcessingWorker:()=>ht(()=>import("./EdgeProcessingWorker-DXabLlxw.js"),__vite__mapDeps([39,40,41,42,43,44,45,46,47])),ElevationSamplerWorker:()=>ht(()=>import("./ElevationSamplerWorker-DR7iKj10.js"),__vite__mapDeps([48,27,49,50,51,52,53,54,55,56,57,58,41])),FeatureServiceSnappingSourceWorker:()=>ht(()=>import("./FeatureServiceSnappingSourceWorker-CRj73rBJ.js"),__vite__mapDeps([59,23,24,22,25,26,27,28,19,29,30,31,32,33,11,10,12,13,14,15,34,35,60,61,62,63])),GeoJSONSourceWorker:()=>ht(()=>import("./GeoJSONSourceWorker-CJxkfTXL.js"),__vite__mapDeps([64,24,22,25,23,26,27,28,19,29,30,31,32,33,11,10,12,13,14,15,34,35,65,21,37,38,66])),LercWorker:()=>ht(()=>import("./LercWorker-BTGjGtNo.js"),[]),MemorySourceWorker:()=>ht(()=>import("./MemorySourceWorker-DFsRya29.js"),__vite__mapDeps([67,24,22,25,68,23,26,27,28,19,29,30,31,32,33,11,10,12,13,14,15,34,35,37,38,66,21])),PBFDecoderWorker:()=>ht(()=>import("./PBFDecoderWorker-DLXRZcsS.js"),__vite__mapDeps([69,24,22,25,60,61])),FeaturePipelineWorker:()=>ht(()=>import("./FeaturePipelineWorker--iWINXTy.js"),__vite__mapDeps([70,71,72,73,74,75,76,77,78,22,79,80,81,38,82,43,83,84,34,32,31,28,24,25,19,85,86,29,30,33,11,10,12,13,14,15,35,62,60,61,63,87,65,21,37,66,88,89])),PointCloudWorker:()=>ht(()=>import("./PointCloudWorker-RLZ1Rh8W.js"),__vite__mapDeps([90,57,53,58,91,92,93,94,47,95,54,55,96])),RasterWorker:()=>ht(()=>import("./RasterWorker-CzY22QDJ.js"),__vite__mapDeps([97,98,99,100,101,102])),SceneLayerSnappingSourceWorker:()=>ht(()=>import("./SceneLayerSnappingSourceWorker-HITRlJJU.js"),__vite__mapDeps([103,104,105,96,53,54,58,106,43,44,45,46,40,41,42,47])),SceneLayerWorker:()=>ht(()=>import("./SceneLayerWorker-C6NfAzt5.js"),__vite__mapDeps([107,56,50,51,106,105,96,53,54,58,108,55,94,47,109,95,57])),WFSSourceWorker:()=>ht(()=>import("./WFSSourceWorker-DM2J6sPN.js"),__vite__mapDeps([110,24,22,25,23,26,27,28,19,29,30,31,32,33,11,10,12,13,14,15,34,35,65,21,66,111,112])),WorkerTileHandler:()=>ht(()=>import("./WorkerTileHandler-B1--DifF.js"),__vite__mapDeps([113,80,114,61,77,115,78])),Lyr3DWorker:()=>ht(()=>import("./Lyr3DWorker-DhzMvWrO.js"),[])},{CLOSE:tk,ABORT:ik,INVOKE:rk,RESPONSE:ug,OPEN_PORT:sk,ON:kK}=$s,RK=2;let OK=class{constructor(t){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=t,this._timer=null,this._process=this._process.bind(this)}push(t){t.type===$s.ABORT?this._cancelledJobIds.add(t.jobId):(this._invokeMessages.push(t),this._timer===null&&(this._timer=setTimeout(this._process,0)))}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null}_process(){this._timer=null;for(const t of this._invokeMessages)this._cancelledJobIds.has(t.jobId)||this._invoke(t);this._cancelledJobIds.clear(),this._invokeMessages.length=0}},_h=class Of{static connect(t){const i=new MessageChannel;let r;r=typeof t=="function"?new t:"default"in t&&typeof t.default=="function"?new t.default:t;const s=new Of(i.port1,{channel:i,client:r});return typeof r=="object"&&"remoteClient"in r&&(r.remoteClient=s),Of.clients.set(s,r),i.port2}static loadWorker(t){const i=$K[t];return i?i():Promise.resolve(null)}constructor(t,i,r){this._port=t,this._jobQueue=r,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new OK(s=>this._onInvokeMessage(s)),this._client=i.client,this._onMessage=this._onMessage.bind(this),this._channel=i.channel,this._schedule=i.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}close(){this._post({type:tk}),this._close()}isBusy(){return this._outJobs.size>0}invoke(t,i,r){return this.apply(t,[i],r)}apply(t,i,r){const s=r==null?void 0:r.signal,n=r==null?void 0:r.transferList;if(!this._port)return Promise.reject(new Je(L6,`Cannot call invoke('${t}'), port is closed`,{methodName:t,data:i}));const c=D6();return new Promise((o,f)=>{if(ra(s))return this._processWork(),void f(jr());const g=io(s,()=>{const I=this._outJobs.get(c);I&&(this._outJobs.delete(c),this._processWork(),Sr(I.abortHandle),this._post({type:ik,jobId:c}),f(jr()))}),S={resolve:o,reject:f,abortHandle:g,debugInfo:t};this._outJobs.set(c,S),this._post({type:rk,jobId:c,methodName:t,abortable:s!=null},i,n)})}createInvokeProxy(t,i){return N6(this,t,i)}on(t,i){const r=new MessageChannel;function s(n){i(n.data)}return this._port.postMessage({type:$s.ON,eventType:t,port:r.port2},[r.port2]),r.port1.addEventListener("message",s),r.port1.start(),er(()=>{r.port1.postMessage({type:$s.CLOSE}),r.port1.close(),r.port1.removeEventListener("message",s)})}jobAdded(){this._processWork()}openPort(){const t=new MessageChannel;return this._post({type:sk,port:t.port2}),t.port1}_processWork(){var c;if(this._outJobs.size>=RK)return;const t=(c=this._jobQueue)==null?void 0:c.pop();if(!t)return;const{methodName:i,data:r,invokeOptions:s,resolver:n}=t;this.apply(i,r,s).then(o=>n.resolve(o)).catch(o=>n.reject(o))}_close(){this._channel&&(this._channel=void 0),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach(t=>{Sr(t.abortHandle),t.reject(jr(`Worker closing, aborting job calling '${t.debugInfo}'`))}),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=null,this._client=null,this._schedule=null}_onMessage(t){this._schedule!=null?this._schedule(()=>this._processMessage(t)):this._processMessage(t)}_processMessage(t){const i=Y0(t);if(i)switch(i.type){case ug:this._onResponseMessage(i);break;case rk:this._invokeQueue.push(i);break;case ik:this._onAbortMessage(i);break;case tk:this._onCloseMessage();break;case sk:this._onOpenPortMessage(i);break;case kK:this._onOnMessage(i)}}_onAbortMessage(t){const i=this._inJobs,r=t.jobId,s=i.get(r);this._invokeQueue.push(t),s&&(s.controller&&s.controller.abort(),i.delete(r))}_onCloseMessage(){const t=this._client;this._close(),t&&"destroy"in t&&Of.clients.get(this)===t&&t.destroy(),Of.clients.delete(this),t!=null&&t.remoteClient&&(t.remoteClient=null)}_onInvokeMessage(t){const{methodName:i,jobId:r,data:s=[],abortable:n}=t,c=n?new AbortController:null,o=this._inJobs;let f,g=this._client,S=g[i];try{if(!S&&i&&i.includes(".")){const I=i.split(".");for(let A=0;A{o.has(r)&&(o.delete(r),this._post({type:ug,jobId:r},I))},I=>{o.has(r)&&(o.delete(r),Ys(I)||this._post({type:ug,jobId:r,error:Z0(I||{message:`Error encountered at method ${i}`})}))})):this._post({type:ug,jobId:r},f)}_onOpenPortMessage(t){new Of(t.port,{client:this._client})}_onOnMessage(t){const{port:i}=t,r=this._client.on(t.eventType,n=>{i.postMessage(n)}),s=f_(t.port,"message",n=>{const c=Y0(n);(c==null?void 0:c.type)===$s.CLOSE&&(s.remove(),r.remove(),i.close())})}_onResponseMessage(t){const{jobId:i,error:r,data:s}=t,n=this._outJobs;if(!n.has(i))return;const c=n.get(i);n.delete(i),this._processWork(),Sr(c.abortHandle),r?c.reject(Je.fromJSON(JSON.parse(r))):c.resolve(s)}_post(t,i,r){return KA(this._port,t,i,r)}};_h.kernelInfo={buildDate:U4,fullVersion:vA,revision:j4},_h.clients=new Map;let LK=class{constructor(){this._inUseClients=new Array,this._clients=new Array,this._clientPromises=new Array,this._ongoingJobsQueue=new Sw}destroy(){this.close()}get closed(){var t;return!((t=this._clients)!=null&&t.length)}open(t,i){return new Promise((r,s)=>{let n=!0;const c=o=>{mr(i.signal),n&&(n=!1,o())};this._clients.length=t.length,this._clientPromises.length=t.length,this._inUseClients.length=t.length;for(let o=0;o(this._clients[o]=new _h(g,i,this._ongoingJobsQueue),c(r),this._clients[o]),()=>(c(s),null)):(this._clients[o]=new _h(f,i,this._ongoingJobsQueue),this._clientPromises[o]=Promise.resolve(this._clients[o]),c(r))}})}broadcast(t,i,r){const s=new Array(this._clientPromises.length);for(let n=0;no==null?void 0:o.invoke(t,i,r))}return s}close(){let t;for(;t=this._ongoingJobsQueue.pop();)t.resolver.reject(jr(`Worker closing, aborting job calling '${t.methodName}'`));for(const i of this._clientPromises)i.then(r=>r==null?void 0:r.close());this._clients.length=0,this._clientPromises.length=0,this._inUseClients.length=0,EK(this)}invoke(t,i,r){return this.apply(t,[i],r)}apply(t,i,r){const s=sa();this._ongoingJobsQueue.push({methodName:t,data:i,invokeOptions:r,resolver:s});for(let n=0;no==null?void 0:o.jobAdded())}return s.promise}createInvokeProxy(t){return N6(this,t)}on(t,i){return Promise.all(this._clientPromises).then(()=>h_(this._clients.map(r=>r.on(t,i))))}openPorts(){return new Promise(t=>{const i=new Array(this._clientPromises.length);let r=i.length;for(let s=0;s{n&&(i[s]=n.openPort()),--r==0&&t(i)})})}get test(){return{numClients:this._clients.length}}};const DK={async request(e,t){var c,o;const i=e.options,r=i.responseType;i.signal=t==null?void 0:t.signal,i.responseType=r==="native"||r==="native-request-init"?"native-request-init":r&&["blob","json","text"].includes(r)&&((c=N4(e.url))!=null&&c.after)?r:"array-buffer";const s=await Qi(e.url,i),n={data:s.data,httpStatus:s.httpStatus,ssl:s.ssl};switch((o=s.requestOptions)==null?void 0:o.responseType){case"native-request-init":return delete n.data.signal,n;case"blob":n.data=await n.data.arrayBuffer();break;case"json":n.data=new TextEncoder().encode(JSON.stringify(n.data)).buffer;break;case"text":n.data=new TextEncoder().encode(n.data).buffer}return{result:n,transferList:[n.data]}}},nk=new Map([["AUS Central Standard Time","Australia/Darwin"],["AUS Eastern Standard Time","Australia/Sydney"],["Afghanistan Standard Time","Asia/Kabul"],["Alaskan Standard Time","America/Anchorage"],["Aleutian Standard Time","America/Adak"],["Altai Standard Time","Asia/Barnaul"],["Arab Standard Time","Asia/Riyadh"],["Arabian Standard Time","Asia/Dubai"],["Arabic Standard Time","Asia/Baghdad"],["Argentina Standard Time","America/Buenos_Aires"],["Astrakhan Standard Time","Europe/Astrakhan"],["Atlantic Standard Time","America/Halifax"],["Aus Central W. Standard Time","Australia/Eucla"],["Azerbaijan Standard Time","Asia/Baku"],["Azores Standard Time","Atlantic/Azores"],["Bahia Standard Time","America/Bahia"],["Bangladesh Standard Time","Asia/Dhaka"],["Belarus Standard Time","Europe/Minsk"],["Bougainville Standard Time","Pacific/Bougainville"],["Canada Central Standard Time","America/Regina"],["Cape Verde Standard Time","Atlantic/Cape_Verde"],["Caucasus Standard Time","Asia/Yerevan"],["Cen. Australia Standard Time","Australia/Adelaide"],["Central America Standard Time","America/Guatemala"],["Central Asia Standard Time","Asia/Almaty"],["Central Brazilian Standard Time","America/Cuiaba"],["Central Europe Standard Time","Europe/Budapest"],["Central European Standard Time","Europe/Warsaw"],["Central Pacific Standard Time","Pacific/Guadalcanal"],["Central Standard Time","America/Chicago"],["Central Standard Time (Mexico)","America/Mexico_City"],["Chatham Islands Standard Time","Pacific/Chatham"],["China Standard Time","Asia/Shanghai"],["Cuba Standard Time","America/Havana"],["Dateline Standard Time","Etc/GMT+12"],["E. Africa Standard Time","Africa/Nairobi"],["E. Australia Standard Time","Australia/Brisbane"],["E. Europe Standard Time","Europe/Chisinau"],["E. South America Standard Time","America/Sao_Paulo"],["Easter Island Standard Time","Pacific/Easter"],["Eastern Standard Time","America/New_York"],["Eastern Standard Time (Mexico)","America/Cancun"],["Egypt Standard Time","Africa/Cairo"],["Ekaterinburg Standard Time","Asia/Yekaterinburg"],["FLE Standard Time","Europe/Kiev"],["Fiji Standard Time","Pacific/Fiji"],["GMT Standard Time","Europe/London"],["GTB Standard Time","Europe/Bucharest"],["Georgian Standard Time","Asia/Tbilisi"],["Greenland Standard Time","America/Godthab"],["Greenwich Standard Time","Atlantic/Reykjavik"],["Haiti Standard Time","America/Port-au-Prince"],["Hawaiian Standard Time","Pacific/Honolulu"],["India Standard Time","Asia/Calcutta"],["Iran Standard Time","Asia/Tehran"],["Israel Standard Time","Asia/Jerusalem"],["Jordan Standard Time","Asia/Amman"],["Kaliningrad Standard Time","Europe/Kaliningrad"],["Korea Standard Time","Asia/Seoul"],["Libya Standard Time","Africa/Tripoli"],["Line Islands Standard Time","Pacific/Kiritimati"],["Lord Howe Standard Time","Australia/Lord_Howe"],["Magadan Standard Time","Asia/Magadan"],["Magallanes Standard Time","America/Punta_Arenas"],["Marquesas Standard Time","Pacific/Marquesas"],["Mauritius Standard Time","Indian/Mauritius"],["Middle East Standard Time","Asia/Beirut"],["Montevideo Standard Time","America/Montevideo"],["Morocco Standard Time","Africa/Casablanca"],["Mountain Standard Time","America/Denver"],["Mountain Standard Time (Mexico)","America/Mazatlan"],["Myanmar Standard Time","Asia/Rangoon"],["N. Central Asia Standard Time","Asia/Novosibirsk"],["Namibia Standard Time","Africa/Windhoek"],["Nepal Standard Time","Asia/Katmandu"],["New Zealand Standard Time","Pacific/Auckland"],["Newfoundland Standard Time","America/St_Johns"],["Norfolk Standard Time","Pacific/Norfolk"],["North Asia East Standard Time","Asia/Irkutsk"],["North Asia Standard Time","Asia/Krasnoyarsk"],["North Korea Standard Time","Asia/Pyongyang"],["Omsk Standard Time","Asia/Omsk"],["Pacific SA Standard Time","America/Santiago"],["Pacific Standard Time","America/Los_Angeles"],["Pacific Standard Time (Mexico)","America/Tijuana"],["Pakistan Standard Time","Asia/Karachi"],["Paraguay Standard Time","America/Asuncion"],["Qyzylorda Standard Time","Asia/Qyzylorda"],["Romance Standard Time","Europe/Paris"],["Russia Time Zone 10","Asia/Srednekolymsk"],["Russia Time Zone 11","Asia/Kamchatka"],["Russia Time Zone 3","Europe/Samara"],["Russian Standard Time","Europe/Moscow"],["SA Eastern Standard Time","America/Cayenne"],["SA Pacific Standard Time","America/Bogota"],["SA Western Standard Time","America/La_Paz"],["SE Asia Standard Time","Asia/Bangkok"],["Saint Pierre Standard Time","America/Miquelon"],["Sakhalin Standard Time","Asia/Sakhalin"],["Samoa Standard Time","Pacific/Apia"],["Sao Tome Standard Time","Africa/Sao_Tome"],["Saratov Standard Time","Europe/Saratov"],["Singapore Standard Time","Asia/Singapore"],["South Africa Standard Time","Africa/Johannesburg"],["South Sudan Standard Time","Africa/Juba"],["Sri Lanka Standard Time","Asia/Colombo"],["Sudan Standard Time","Africa/Khartoum"],["Syria Standard Time","Asia/Damascus"],["Taipei Standard Time","Asia/Taipei"],["Tasmania Standard Time","Australia/Hobart"],["Tocantins Standard Time","America/Araguaina"],["Tokyo Standard Time","Asia/Tokyo"],["Tomsk Standard Time","Asia/Tomsk"],["Tonga Standard Time","Pacific/Tongatapu"],["Transbaikal Standard Time","Asia/Chita"],["Turkey Standard Time","Europe/Istanbul"],["Turks And Caicos Standard Time","America/Grand_Turk"],["US Eastern Standard Time","America/Indianapolis"],["US Mountain Standard Time","America/Phoenix"],["UTC","Etc/GMT"],["UTC+01","Etc/GMT-1"],["UTC+02","Etc/GMT-2"],["UTC+03","Etc/GMT-3"],["UTC+04","Etc/GMT-4"],["UTC+05","Etc/GMT-5"],["UTC+06","Etc/GMT-6"],["UTC+07","Etc/GMT-7"],["UTC+08","Etc/GMT-8"],["UTC+09","Etc/GMT-9"],["UTC+10","Etc/GMT-10"],["UTC+11","Etc/GMT-11"],["UTC+12","Etc/GMT-12"],["UTC+13","Etc/GMT-13"],["UTC+14","Etc/GMT-14"],["UTC-01","Etc/GMT+1"],["UTC-02","Etc/GMT+2"],["UTC-03","Etc/GMT+3"],["UTC-04","Etc/GMT+4"],["UTC-05","Etc/GMT+5"],["UTC-06","Etc/GMT+6"],["UTC-07","Etc/GMT+7"],["UTC-08","Etc/GMT+8"],["UTC-09","Etc/GMT+9"],["UTC-10","Etc/GMT+10"],["UTC-11","Etc/GMT+11"],["UTC-12","Etc/GMT+12"],["Ulaanbaatar Standard Time","Asia/Ulaanbaatar"],["Venezuela Standard Time","America/Caracas"],["Vladivostok Standard Time","Asia/Vladivostok"],["Volgograd Standard Time","Europe/Volgograd"],["W. Australia Standard Time","Australia/Perth"],["W. Central Africa Standard Time","Africa/Lagos"],["W. Europe Standard Time","Europe/Berlin"],["W. Mongolia Standard Time","Asia/Hovd"],["West Asia Standard Time","Asia/Tashkent"],["West Bank Standard Time","Asia/Hebron"],["West Pacific Standard Time","Pacific/Port_Moresby"],["Yakutsk Standard Time","Asia/Yakutsk"],["Yukon Standard Time","America/Whitehorse"]]);class kp extends Error{}class NK extends kp{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class zK extends kp{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class FK extends kp{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class rm extends kp{}class z6 extends kp{constructor(t){super(`Invalid unit ${t}`)}}class Kn extends kp{}class wu extends kp{constructor(){super("Zone is an abstract class")}}const yt="numeric",Ya="short",xo="long",Tw={year:yt,month:yt,day:yt},F6={year:yt,month:Ya,day:yt},BK={year:yt,month:Ya,day:yt,weekday:Ya},B6={year:yt,month:xo,day:yt},U6={year:yt,month:xo,day:yt,weekday:xo},j6={hour:yt,minute:yt},V6={hour:yt,minute:yt,second:yt},G6={hour:yt,minute:yt,second:yt,timeZoneName:Ya},q6={hour:yt,minute:yt,second:yt,timeZoneName:xo},H6={hour:yt,minute:yt,hourCycle:"h23"},W6={hour:yt,minute:yt,second:yt,hourCycle:"h23"},Z6={hour:yt,minute:yt,second:yt,hourCycle:"h23",timeZoneName:Ya},Y6={hour:yt,minute:yt,second:yt,hourCycle:"h23",timeZoneName:xo},J6={year:yt,month:yt,day:yt,hour:yt,minute:yt},K6={year:yt,month:yt,day:yt,hour:yt,minute:yt,second:yt},X6={year:yt,month:Ya,day:yt,hour:yt,minute:yt},Q6={year:yt,month:Ya,day:yt,hour:yt,minute:yt,second:yt},UK={year:yt,month:Ya,day:yt,weekday:Ya,hour:yt,minute:yt},ez={year:yt,month:xo,day:yt,hour:yt,minute:yt,timeZoneName:Ya},tz={year:yt,month:xo,day:yt,hour:yt,minute:yt,second:yt,timeZoneName:Ya},iz={year:yt,month:xo,day:yt,weekday:xo,hour:yt,minute:yt,timeZoneName:xo},rz={year:yt,month:xo,day:yt,weekday:xo,hour:yt,minute:yt,second:yt,timeZoneName:xo};class b_{get type(){throw new wu}get name(){throw new wu}get ianaName(){return this.name}get isUniversal(){throw new wu}offsetName(t,i){throw new wu}formatOffset(t,i){throw new wu}offset(t){throw new wu}equals(t){throw new wu}get isValid(){throw new wu}}let RS=null;class kx extends b_{static get instance(){return RS===null&&(RS=new kx),RS}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:i,locale:r}){return dz(t,i,r)}formatOffset(t,i){return w0(this.offset(t),i)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let Kv={};function jK(e){return Kv[e]||(Kv[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Kv[e]}const VK={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function GK(e,t){const i=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(i),[,s,n,c,o,f,g,S]=r;return[c,s,n,o,f,g,S]}function qK(e,t){const i=e.formatToParts(t),r=[];for(let s=0;s=0?z:1e3+z,(A-O)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let ok={};function HK(e,t={}){const i=JSON.stringify([e,t]);let r=ok[i];return r||(r=new Intl.ListFormat(e,t),ok[i]=r),r}let AE={};function PE(e,t={}){const i=JSON.stringify([e,t]);let r=AE[i];return r||(r=new Intl.DateTimeFormat(e,t),AE[i]=r),r}let CE={};function WK(e,t={}){const i=JSON.stringify([e,t]);let r=CE[i];return r||(r=new Intl.NumberFormat(e,t),CE[i]=r),r}let $E={};function ZK(e,t={}){const{base:i,...r}=t,s=JSON.stringify([e,r]);let n=$E[s];return n||(n=new Intl.RelativeTimeFormat(e,t),$E[s]=n),n}let Cg=null;function YK(){return Cg||(Cg=new Intl.DateTimeFormat().resolvedOptions().locale,Cg)}let ak={};function JK(e){let t=ak[e];if(!t){const i=new Intl.Locale(e);t="getWeekInfo"in i?i.getWeekInfo():i.weekInfo,ak[e]=t}return t}function KK(e){const t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));const i=e.indexOf("-u-");if(i===-1)return[e];{let r,s;try{r=PE(e).resolvedOptions(),s=e}catch{const f=e.substring(0,i);r=PE(f).resolvedOptions(),s=f}const{numberingSystem:n,calendar:c}=r;return[s,n,c]}}function XK(e,t,i){return(i||t)&&(e.includes("-u-")||(e+="-u"),i&&(e+=`-ca-${i}`),t&&(e+=`-nu-${t}`)),e}function QK(e){const t=[];for(let i=1;i<=12;i++){const r=Jt.utc(2009,i,1);t.push(e(r))}return t}function eX(e){const t=[];for(let i=1;i<=7;i++){const r=Jt.utc(2016,11,13+i);t.push(e(r))}return t}function nv(e,t,i,r){const s=e.listingMode();return s==="error"?null:s==="en"?i(t):r(t)}function tX(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}class iX{constructor(t,i,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:s,floor:n,...c}=r;if(!i||Object.keys(c).length>0){const o={useGrouping:!1,...r};r.padTo>0&&(o.minimumIntegerDigits=r.padTo),this.inf=WK(t,o)}}format(t){if(this.inf){const i=this.floor?Math.floor(t):t;return this.inf.format(i)}else{const i=this.floor?Math.floor(t):t3(t,3);return ps(i,this.padTo)}}}class rX{constructor(t,i,r){this.opts=r,this.originalZone=void 0;let s;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const c=-1*(t.offset/60),o=c>=0?`Etc/GMT+${c}`:`Etc/GMT${c}`;t.offset!==0&&Ja.create(o).valid?(s=o,this.dt=t):(s="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,s=t.zone.name):(s="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const n={...this.opts};n.timeZone=n.timeZone||s,this.dtf=PE(i,n)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(i=>{if(i.type==="timeZoneName"){const r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...i,value:r}}else return i}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class sX{constructor(t,i,r){this.opts={style:"long",...r},!i&&uz()&&(this.rtf=ZK(t,r))}format(t,i){return this.rtf?this.rtf.format(t,i):TX(i,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,i){return this.rtf?this.rtf.formatToParts(t,i):[]}}const nX={firstDay:1,minimalDays:4,weekend:[6,7]};class Xi{static fromOpts(t){return Xi.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,i,r,s,n=!1){const c=t||rs.defaultLocale,o=c||(n?"en-US":YK()),f=i||rs.defaultNumberingSystem,g=r||rs.defaultOutputCalendar,S=kE(s)||rs.defaultWeekSettings;return new Xi(o,f,g,S,c)}static resetCache(){Cg=null,AE={},CE={},$E={}}static fromObject({locale:t,numberingSystem:i,outputCalendar:r,weekSettings:s}={}){return Xi.create(t,i,r,s)}constructor(t,i,r,s,n){const[c,o,f]=KK(t);this.locale=c,this.numberingSystem=i||o||null,this.outputCalendar=r||f||null,this.weekSettings=s,this.intl=XK(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=n,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=tX(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),i=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&i?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:Xi.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,kE(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,i=!1){return nv(this,t,mz,()=>{const r=i?{month:t,day:"numeric"}:{month:t},s=i?"format":"standalone";return this.monthsCache[s][t]||(this.monthsCache[s][t]=QK(n=>this.extract(n,r,"month"))),this.monthsCache[s][t]})}weekdays(t,i=!1){return nv(this,t,_z,()=>{const r=i?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},s=i?"format":"standalone";return this.weekdaysCache[s][t]||(this.weekdaysCache[s][t]=eX(n=>this.extract(n,r,"weekday"))),this.weekdaysCache[s][t]})}meridiems(){return nv(this,void 0,()=>vz,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Jt.utc(2016,11,13,9),Jt.utc(2016,11,13,19)].map(i=>this.extract(i,t,"dayperiod"))}return this.meridiemCache})}eras(t){return nv(this,t,bz,()=>{const i={era:t};return this.eraCache[t]||(this.eraCache[t]=[Jt.utc(-40,1,1),Jt.utc(2017,1,1)].map(r=>this.extract(r,i,"era"))),this.eraCache[t]})}extract(t,i,r){const s=this.dtFormatter(t,i),n=s.formatToParts(),c=n.find(o=>o.type.toLowerCase()===r);return c?c.value:null}numberFormatter(t={}){return new iX(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,i={}){return new rX(t,this.intl,i)}relFormatter(t={}){return new sX(this.intl,this.isEnglish(),t)}listFormatter(t={}){return HK(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:hz()?JK(this.locale):nX}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}}let OS=null;class gn extends b_{static get utcInstance(){return OS===null&&(OS=new gn(0)),OS}static instance(t){return t===0?gn.utcInstance:new gn(t)}static parseSpecifier(t){if(t){const i=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(i)return new gn(Lx(i[1],i[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${w0(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${w0(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,i){return w0(this.fixed,i)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class oX extends b_{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function ih(e,t){if(ni(e)||e===null)return t;if(e instanceof b_)return e;if(cX(e)){const i=e.toLowerCase();return i==="default"?t:i==="local"||i==="system"?kx.instance:i==="utc"||i==="gmt"?gn.utcInstance:gn.parseSpecifier(i)||Ja.create(e)}else return ap(e)?gn.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new oX(e)}let lk=()=>Date.now(),ck="system",uk=null,hk=null,dk=null,pk=60,fk,mk=null;class rs{static get now(){return lk}static set now(t){lk=t}static set defaultZone(t){ck=t}static get defaultZone(){return ih(ck,kx.instance)}static get defaultLocale(){return uk}static set defaultLocale(t){uk=t}static get defaultNumberingSystem(){return hk}static set defaultNumberingSystem(t){hk=t}static get defaultOutputCalendar(){return dk}static set defaultOutputCalendar(t){dk=t}static get defaultWeekSettings(){return mk}static set defaultWeekSettings(t){mk=kE(t)}static get twoDigitCutoffYear(){return pk}static set twoDigitCutoffYear(t){pk=t%100}static get throwOnInvalid(){return fk}static set throwOnInvalid(t){fk=t}static resetCaches(){Xi.resetCache(),Ja.resetCache()}}class ja{constructor(t,i){this.reason=t,this.explanation=i}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const sz=[0,31,59,90,120,151,181,212,243,273,304,334],nz=[0,31,60,91,121,152,182,213,244,274,305,335];function Qo(e,t){return new ja("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function XA(e,t,i){const r=new Date(Date.UTC(e,t-1,i));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const s=r.getUTCDay();return s===0?7:s}function oz(e,t,i){return i+(w_(e)?nz:sz)[t-1]}function az(e,t){const i=w_(e)?nz:sz,r=i.findIndex(n=>nJ0(r,t,i)?(g=r+1,f=1):g=r,{weekYear:g,weekNumber:f,weekday:o,...Dx(e)}}function yk(e,t=4,i=1){const{weekYear:r,weekNumber:s,weekday:n}=e,c=QA(XA(r,1,t),i),o=ym(r);let f=s*7+n-c-7+t,g;f<1?(g=r-1,f+=ym(g)):f>o?(g=r+1,f-=ym(r)):g=r;const{month:S,day:I}=az(g,f);return{year:g,month:S,day:I,...Dx(e)}}function LS(e){const{year:t,month:i,day:r}=e,s=oz(t,i,r);return{year:t,ordinal:s,...Dx(e)}}function gk(e){const{year:t,ordinal:i}=e,{month:r,day:s}=az(t,i);return{year:t,month:r,day:s,...Dx(e)}}function _k(e,t){if(!ni(e.localWeekday)||!ni(e.localWeekNumber)||!ni(e.localWeekYear)){if(!ni(e.weekday)||!ni(e.weekNumber)||!ni(e.weekYear))throw new rm("Cannot mix locale-based week fields with ISO-based week fields");return ni(e.localWeekday)||(e.weekday=e.localWeekday),ni(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),ni(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function aX(e,t=4,i=1){const r=Rx(e.weekYear),s=ea(e.weekNumber,1,J0(e.weekYear,t,i)),n=ea(e.weekday,1,7);return r?s?n?!1:Qo("weekday",e.weekday):Qo("week",e.weekNumber):Qo("weekYear",e.weekYear)}function lX(e){const t=Rx(e.year),i=ea(e.ordinal,1,ym(e.year));return t?i?!1:Qo("ordinal",e.ordinal):Qo("year",e.year)}function lz(e){const t=Rx(e.year),i=ea(e.month,1,12),r=ea(e.day,1,Mw(e.year,e.month));return t?i?r?!1:Qo("day",e.day):Qo("month",e.month):Qo("year",e.year)}function cz(e){const{hour:t,minute:i,second:r,millisecond:s}=e,n=ea(t,0,23)||t===24&&i===0&&r===0&&s===0,c=ea(i,0,59),o=ea(r,0,59),f=ea(s,0,999);return n?c?o?f?!1:Qo("millisecond",s):Qo("second",r):Qo("minute",i):Qo("hour",t)}function ni(e){return typeof e>"u"}function ap(e){return typeof e=="number"}function Rx(e){return typeof e=="number"&&e%1===0}function cX(e){return typeof e=="string"}function uX(e){return Object.prototype.toString.call(e)==="[object Date]"}function uz(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function hz(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function hX(e){return Array.isArray(e)?e:[e]}function vk(e,t,i){if(e.length!==0)return e.reduce((r,s)=>{const n=[t(s),s];return r&&i(r[0],n[0])===r[0]?r:n},null)[1]}function dX(e,t){return t.reduce((i,r)=>(i[r]=e[r],i),{})}function Rm(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function kE(e){if(e==null)return null;if(typeof e!="object")throw new Kn("Week settings must be an object");if(!ea(e.firstDay,1,7)||!ea(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!ea(t,1,7)))throw new Kn("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function ea(e,t,i){return Rx(e)&&e>=t&&e<=i}function pX(e,t){return e-t*Math.floor(e/t)}function ps(e,t=2){const i=e<0;let r;return i?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function Ku(e){if(!(ni(e)||e===null||e===""))return parseInt(e,10)}function td(e){if(!(ni(e)||e===null||e===""))return parseFloat(e)}function e3(e){if(!(ni(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function t3(e,t,i=!1){const r=10**t;return(i?Math.trunc:Math.round)(e*r)/r}function w_(e){return e%4===0&&(e%100!==0||e%400===0)}function ym(e){return w_(e)?366:365}function Mw(e,t){const i=pX(t-1,12)+1,r=e+(t-i)/12;return i===2?w_(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][i-1]}function Ox(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function bk(e,t,i){return-QA(XA(e,1,t),i)+t-1}function J0(e,t=4,i=1){const r=bk(e,t,i),s=bk(e+1,t,i);return(ym(e)-r+s)/7}function RE(e){return e>99?e:e>rs.twoDigitCutoffYear?1900+e:2e3+e}function dz(e,t,i,r=null){const s=new Date(e),n={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(n.timeZone=r);const c={timeZoneName:t,...n},o=new Intl.DateTimeFormat(i,c).formatToParts(s).find(f=>f.type.toLowerCase()==="timezonename");return o?o.value:null}function Lx(e,t){let i=parseInt(e,10);Number.isNaN(i)&&(i=0);const r=parseInt(t,10)||0,s=i<0||Object.is(i,-0)?-r:r;return i*60+s}function pz(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new Kn(`Invalid unit value ${e}`);return t}function Iw(e,t){const i={};for(const r in e)if(Rm(e,r)){const s=e[r];if(s==null)continue;i[t(r)]=pz(s)}return i}function w0(e,t){const i=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),s=e>=0?"+":"-";switch(t){case"short":return`${s}${ps(i,2)}:${ps(r,2)}`;case"narrow":return`${s}${i}${r>0?`:${r}`:""}`;case"techie":return`${s}${ps(i,2)}${ps(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Dx(e){return dX(e,["hour","minute","second","millisecond"])}const fX=["January","February","March","April","May","June","July","August","September","October","November","December"],fz=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],mX=["J","F","M","A","M","J","J","A","S","O","N","D"];function mz(e){switch(e){case"narrow":return[...mX];case"short":return[...fz];case"long":return[...fX];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const yz=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],gz=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],yX=["M","T","W","T","F","S","S"];function _z(e){switch(e){case"narrow":return[...yX];case"short":return[...gz];case"long":return[...yz];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const vz=["AM","PM"],gX=["Before Christ","Anno Domini"],_X=["BC","AD"],vX=["B","A"];function bz(e){switch(e){case"narrow":return[...vX];case"short":return[..._X];case"long":return[...gX];default:return null}}function bX(e){return vz[e.hour<12?0:1]}function wX(e,t){return _z(t)[e.weekday-1]}function xX(e,t){return mz(t)[e.month-1]}function SX(e,t){return bz(t)[e.year<0?0:1]}function TX(e,t,i="always",r=!1){const s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},n=["hours","minutes","seconds"].indexOf(e)===-1;if(i==="auto"&&n){const I=e==="days";switch(t){case 1:return I?"tomorrow":`next ${s[e][0]}`;case-1:return I?"yesterday":`last ${s[e][0]}`;case 0:return I?"today":`this ${s[e][0]}`}}const c=Object.is(t,-0)||t<0,o=Math.abs(t),f=o===1,g=s[e],S=r?f?g[1]:g[2]||g[1]:f?s[e][0]:e;return c?`${o} ${S} ago`:`in ${o} ${S}`}function wk(e,t){let i="";for(const r of e)r.literal?i+=r.val:i+=t(r.val);return i}const EX={D:Tw,DD:F6,DDD:B6,DDDD:U6,t:j6,tt:V6,ttt:G6,tttt:q6,T:H6,TT:W6,TTT:Z6,TTTT:Y6,f:J6,ff:X6,fff:ez,ffff:iz,F:K6,FF:Q6,FFF:tz,FFFF:rz};class yn{static create(t,i={}){return new yn(t,i)}static parseFormat(t){let i=null,r="",s=!1;const n=[];for(let c=0;c0&&n.push({literal:s||/^\s+$/.test(r),val:r}),i=null,r="",s=!s):s||o===i?r+=o:(r.length>0&&n.push({literal:/^\s+$/.test(r),val:r}),r=o,i=o)}return r.length>0&&n.push({literal:s||/^\s+$/.test(r),val:r}),n}static macroTokenToFormatOpts(t){return EX[t]}constructor(t,i){this.opts=i,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,i){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...i}).format()}dtFormatter(t,i={}){return this.loc.dtFormatter(t,{...this.opts,...i})}formatDateTime(t,i){return this.dtFormatter(t,i).format()}formatDateTimeParts(t,i){return this.dtFormatter(t,i).formatToParts()}formatInterval(t,i){return this.dtFormatter(t.start,i).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,i){return this.dtFormatter(t,i).resolvedOptions()}num(t,i=0){if(this.opts.forceSimple)return ps(t,i);const r={...this.opts};return i>0&&(r.padTo=i),this.loc.numberFormatter(r).format(t)}formatDateTimeFromString(t,i){const r=this.loc.listingMode()==="en",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",n=(O,z)=>this.loc.extract(t,O,z),c=O=>t.isOffsetFixed&&t.offset===0&&O.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,O.format):"",o=()=>r?bX(t):n({hour:"numeric",hourCycle:"h12"},"dayperiod"),f=(O,z)=>r?xX(t,O):n(z?{month:O}:{month:O,day:"numeric"},"month"),g=(O,z)=>r?wX(t,O):n(z?{weekday:O}:{weekday:O,month:"long",day:"numeric"},"weekday"),S=O=>{const z=yn.macroTokenToFormatOpts(O);return z?this.formatWithSystemDefault(t,z):O},I=O=>r?SX(t,O):n({era:O},"era"),A=O=>{switch(O){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return c({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return c({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return c({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return o();case"d":return s?n({day:"numeric"},"day"):this.num(t.day);case"dd":return s?n({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return g("short",!0);case"cccc":return g("long",!0);case"ccccc":return g("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return g("short",!1);case"EEEE":return g("long",!1);case"EEEEE":return g("narrow",!1);case"L":return s?n({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return s?n({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return f("short",!0);case"LLLL":return f("long",!0);case"LLLLL":return f("narrow",!0);case"M":return s?n({month:"numeric"},"month"):this.num(t.month);case"MM":return s?n({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return f("short",!1);case"MMMM":return f("long",!1);case"MMMMM":return f("narrow",!1);case"y":return s?n({year:"numeric"},"year"):this.num(t.year);case"yy":return s?n({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return s?n({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return s?n({year:"numeric"},"year"):this.num(t.year,6);case"G":return I("short");case"GG":return I("long");case"GGGGG":return I("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return S(O)}};return wk(yn.parseFormat(i),A)}formatDurationFromString(t,i){const r=f=>{switch(f[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=f=>g=>{const S=r(g);return S?this.num(f.get(S),g.length):g},n=yn.parseFormat(i),c=n.reduce((f,{literal:g,val:S})=>g?f:f.concat(S),[]),o=t.shiftTo(...c.map(r).filter(f=>f));return wk(n,s(o))}}const wz=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function qm(...e){const t=e.reduce((i,r)=>i+r.source,"");return RegExp(`^${t}$`)}function Hm(...e){return t=>e.reduce(([i,r,s],n)=>{const[c,o,f]=n(t,s);return[{...i,...c},o||r,f]},[{},null,1]).slice(0,2)}function Wm(e,...t){if(e==null)return[null,null];for(const[i,r]of t){const s=i.exec(e);if(s)return r(s)}return[null,null]}function xz(...e){return(t,i)=>{const r={};let s;for(s=0;sO!==void 0&&(z||O&&S)?-O:O;return[{years:A(td(i)),months:A(td(r)),weeks:A(td(s)),days:A(td(n)),hours:A(td(c)),minutes:A(td(o)),seconds:A(td(f),f==="-0"),milliseconds:A(e3(g),I)}]}const zX={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function s3(e,t,i,r,s,n,c){const o={year:t.length===2?RE(Ku(t)):Ku(t),month:fz.indexOf(i)+1,day:Ku(r),hour:Ku(s),minute:Ku(n)};return c&&(o.second=Ku(c)),e&&(o.weekday=e.length>3?yz.indexOf(e)+1:gz.indexOf(e)+1),o}const FX=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function BX(e){const[,t,i,r,s,n,c,o,f,g,S,I]=e,A=s3(t,s,r,i,n,c,o);let O;return f?O=zX[f]:g?O=0:O=Lx(S,I),[A,new gn(O)]}function UX(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const jX=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,VX=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,GX=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function xk(e){const[,t,i,r,s,n,c,o]=e;return[s3(t,s,r,i,n,c,o),gn.utcInstance]}function qX(e){const[,t,i,r,s,n,c,o]=e;return[s3(t,o,i,r,s,n,c),gn.utcInstance]}const HX=qm(IX,r3),WX=qm(AX,r3),ZX=qm(PX,r3),YX=qm(Tz),Mz=Hm(OX,Zm,x_,S_),JX=Hm(CX,Zm,x_,S_),KX=Hm($X,Zm,x_,S_),XX=Hm(Zm,x_,S_);function QX(e){return Wm(e,[HX,Mz],[WX,JX],[ZX,KX],[YX,XX])}function eQ(e){return Wm(UX(e),[FX,BX])}function tQ(e){return Wm(e,[jX,xk],[VX,xk],[GX,qX])}function iQ(e){return Wm(e,[DX,NX])}const rQ=Hm(Zm);function sQ(e){return Wm(e,[LX,rQ])}const nQ=qm(kX,RX),oQ=qm(Ez),aQ=Hm(Zm,x_,S_);function lQ(e){return Wm(e,[nQ,Mz],[oQ,aQ])}const Sk="Invalid Duration",Iz={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},cQ={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...Iz},Bo=146097/400,Ef=146097/4800,uQ={years:{quarters:4,months:12,weeks:Bo/7,days:Bo,hours:Bo*24,minutes:Bo*24*60,seconds:Bo*24*60*60,milliseconds:Bo*24*60*60*1e3},quarters:{months:3,weeks:Bo/28,days:Bo/4,hours:Bo*24/4,minutes:Bo*24*60/4,seconds:Bo*24*60*60/4,milliseconds:Bo*24*60*60*1e3/4},months:{weeks:Ef/7,days:Ef,hours:Ef*24,minutes:Ef*24*60,seconds:Ef*24*60*60,milliseconds:Ef*24*60*60*1e3},...Iz},Yd=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],hQ=Yd.slice(0).reverse();function xu(e,t,i=!1){const r={values:i?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Pi(r)}function Az(e,t){let i=t.milliseconds??0;for(const r of hQ.slice(1))t[r]&&(i+=t[r]*e[r].milliseconds);return i}function Tk(e,t){const i=Az(e,t)<0?-1:1;Yd.reduceRight((r,s)=>{if(ni(t[s]))return r;if(r){const n=t[r]*i,c=e[s][r],o=Math.floor(n/c);t[s]+=o*i,t[r]-=o*c*i}return s},null),Yd.reduce((r,s)=>{if(ni(t[s]))return r;if(r){const n=t[r]%1;t[r]-=n,t[s]+=n*e[r][s]}return s},null)}function dQ(e){const t={};for(const[i,r]of Object.entries(e))r!==0&&(t[i]=r);return t}class Pi{constructor(t){const i=t.conversionAccuracy==="longterm"||!1;let r=i?uQ:cQ;t.matrix&&(r=t.matrix),this.values=t.values,this.loc=t.loc||Xi.create(),this.conversionAccuracy=i?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(t,i){return Pi.fromObject({milliseconds:t},i)}static fromObject(t,i={}){if(t==null||typeof t!="object")throw new Kn(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new Pi({values:Iw(t,Pi.normalizeUnit),loc:Xi.fromObject(i),conversionAccuracy:i.conversionAccuracy,matrix:i.matrix})}static fromDurationLike(t){if(ap(t))return Pi.fromMillis(t);if(Pi.isDuration(t))return t;if(typeof t=="object")return Pi.fromObject(t);throw new Kn(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,i){const[r]=iQ(t);return r?Pi.fromObject(r,i):Pi.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,i){const[r]=sQ(t);return r?Pi.fromObject(r,i):Pi.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,i=null){if(!t)throw new Kn("need to specify a reason the Duration is invalid");const r=t instanceof ja?t:new ja(t,i);if(rs.throwOnInvalid)throw new FK(r);return new Pi({invalid:r})}static normalizeUnit(t){const i={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!i)throw new z6(t);return i}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,i={}){const r={...i,floor:i.round!==!1&&i.floor!==!1};return this.isValid?yn.create(this.loc,r).formatDurationFromString(this,t):Sk}toHuman(t={}){if(!this.isValid)return Sk;const i=Yd.map(r=>{const s=this.values[r];return ni(s)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:r.slice(0,-1)}).format(s)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(i)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=t3(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const i=this.toMillis();return i<0||i>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},Jt.fromMillis(i,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Az(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const i=Pi.fromDurationLike(t),r={};for(const s of Yd)(Rm(i.values,s)||Rm(this.values,s))&&(r[s]=i.get(s)+this.get(s));return xu(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const i=Pi.fromDurationLike(t);return this.plus(i.negate())}mapUnits(t){if(!this.isValid)return this;const i={};for(const r of Object.keys(this.values))i[r]=pz(t(this.values[r],r));return xu(this,{values:i},!0)}get(t){return this[Pi.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const i={...this.values,...Iw(t,Pi.normalizeUnit)};return xu(this,{values:i})}reconfigure({locale:t,numberingSystem:i,conversionAccuracy:r,matrix:s}={}){const c={loc:this.loc.clone({locale:t,numberingSystem:i}),matrix:s,conversionAccuracy:r};return xu(this,c)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return Tk(this.matrix,t),xu(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=dQ(this.normalize().shiftToAll().toObject());return xu(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(c=>Pi.normalizeUnit(c));const i={},r={},s=this.toObject();let n;for(const c of Yd)if(t.indexOf(c)>=0){n=c;let o=0;for(const g in r)o+=this.matrix[g][c]*r[g],r[g]=0;ap(s[c])&&(o+=s[c]);const f=Math.trunc(o);i[c]=f,r[c]=(o*1e3-f*1e3)/1e3}else ap(s[c])&&(r[c]=s[c]);for(const c in r)r[c]!==0&&(i[n]+=c===n?r[c]:r[c]/this.matrix[n][c]);return Tk(this.matrix,i),xu(this,{values:i},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const i of Object.keys(this.values))t[i]=this.values[i]===0?0:-this.values[i];return xu(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function i(r,s){return r===void 0||r===0?s===void 0||s===0:r===s}for(const r of Yd)if(!i(this.values[r],t.values[r]))return!1;return!0}}const Mf="Invalid Interval";function pQ(e,t){return!e||!e.isValid?Fr.invalid("missing or invalid start"):!t||!t.isValid?Fr.invalid("missing or invalid end"):tt:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:i}={}){return this.isValid?Fr.fromDateTimes(t||this.s,i||this.e):this}splitAt(...t){if(!this.isValid)return[];const i=t.map(dg).filter(c=>this.contains(c)).sort((c,o)=>c.toMillis()-o.toMillis()),r=[];let{s}=this,n=0;for(;s+this.e?this.e:c;r.push(Fr.fromDateTimes(s,o)),s=o,n+=1}return r}splitBy(t){const i=Pi.fromDurationLike(t);if(!this.isValid||!i.isValid||i.as("milliseconds")===0)return[];let{s:r}=this,s=1,n;const c=[];for(;rf*s));n=+o>+this.e?this.e:o,c.push(Fr.fromDateTimes(r,n)),r=n,s+=1}return c}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const i=this.s>t.s?this.s:t.s,r=this.e=r?null:Fr.fromDateTimes(i,r)}union(t){if(!this.isValid)return this;const i=this.st.e?this.e:t.e;return Fr.fromDateTimes(i,r)}static merge(t){const[i,r]=t.sort((s,n)=>s.s-n.s).reduce(([s,n],c)=>n?n.overlaps(c)||n.abutsStart(c)?[s,n.union(c)]:[s.concat([n]),c]:[s,c],[[],null]);return r&&i.push(r),i}static xor(t){let i=null,r=0;const s=[],n=t.map(f=>[{time:f.s,type:"s"},{time:f.e,type:"e"}]),c=Array.prototype.concat(...n),o=c.sort((f,g)=>f.time-g.time);for(const f of o)r+=f.type==="s"?1:-1,r===1?i=f.time:(i&&+i!=+f.time&&s.push(Fr.fromDateTimes(i,f.time)),i=null);return Fr.merge(s)}difference(...t){return Fr.xor([this].concat(t)).map(i=>this.intersection(i)).filter(i=>i&&!i.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Mf}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=Tw,i={}){return this.isValid?yn.create(this.s.loc.clone(i),t).formatInterval(this):Mf}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Mf}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Mf}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Mf}toFormat(t,{separator:i=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${i}${this.e.toFormat(t)}`:Mf}toDuration(t,i){return this.isValid?this.e.diff(this.s,t,i):Pi.invalid(this.invalidReason)}mapEndpoints(t){return Fr.fromDateTimes(t(this.s),t(this.e))}}class ov{static hasDST(t=rs.defaultZone){const i=Jt.now().setZone(t).set({month:12});return!t.isUniversal&&i.offset!==i.set({month:6}).offset}static isValidIANAZone(t){return Ja.isValidZone(t)}static normalizeZone(t){return ih(t,rs.defaultZone)}static getStartOfWeek({locale:t=null,locObj:i=null}={}){return(i||Xi.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:i=null}={}){return(i||Xi.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:i=null}={}){return(i||Xi.create(t)).getWeekendDays().slice()}static months(t="long",{locale:i=null,numberingSystem:r=null,locObj:s=null,outputCalendar:n="gregory"}={}){return(s||Xi.create(i,r,n)).months(t)}static monthsFormat(t="long",{locale:i=null,numberingSystem:r=null,locObj:s=null,outputCalendar:n="gregory"}={}){return(s||Xi.create(i,r,n)).months(t,!0)}static weekdays(t="long",{locale:i=null,numberingSystem:r=null,locObj:s=null}={}){return(s||Xi.create(i,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:i=null,numberingSystem:r=null,locObj:s=null}={}){return(s||Xi.create(i,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return Xi.create(t).meridiems()}static eras(t="short",{locale:i=null}={}){return Xi.create(i,null,"gregory").eras(t)}static features(){return{relative:uz(),localeWeek:hz()}}}function Ek(e,t){const i=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=i(t)-i(e);return Math.floor(Pi.fromMillis(r).as("days"))}function fQ(e,t,i){const r=[["years",(f,g)=>g.year-f.year],["quarters",(f,g)=>g.quarter-f.quarter+(g.year-f.year)*4],["months",(f,g)=>g.month-f.month+(g.year-f.year)*12],["weeks",(f,g)=>{const S=Ek(f,g);return(S-S%7)/7}],["days",Ek]],s={},n=e;let c,o;for(const[f,g]of r)i.indexOf(f)>=0&&(c=f,s[f]=g(e,t),o=n.plus(s),o>t?(s[f]--,e=n.plus(s),e>t&&(o=e,s[f]--,e=n.plus(s))):e=o);return[e,s,o,c]}function mQ(e,t,i,r){let[s,n,c,o]=fQ(e,t,i);const f=t-s,g=i.filter(I=>["hours","minutes","seconds","milliseconds"].indexOf(I)>=0);g.length===0&&(c0?Pi.fromMillis(f,r).shiftTo(...g).plus(S):S}const n3={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Mk={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},yQ=n3.hanidec.replace(/[\[|\]]/g,"").split("");function gQ(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let i=0;i=n&&r<=c&&(t+=r-n)}}return parseInt(t,10)}else return t}function ba({numberingSystem:e},t=""){return new RegExp(`${n3[e||"latn"]}${t}`)}const _Q="missing Intl.DateTimeFormat.formatToParts support";function Li(e,t=i=>i){return{regex:e,deser:([i])=>t(gQ(i))}}const vQ=" ",Pz=`[ ${vQ}]`,Cz=new RegExp(Pz,"g");function bQ(e){return e.replace(/\./g,"\\.?").replace(Cz,Pz)}function Ik(e){return e.replace(/\./g,"").replace(Cz," ").toLowerCase()}function wa(e,t){return e===null?null:{regex:RegExp(e.map(bQ).join("|")),deser:([i])=>e.findIndex(r=>Ik(i)===Ik(r))+t}}function Ak(e,t){return{regex:e,deser:([,i,r])=>Lx(i,r),groups:t}}function av(e){return{regex:e,deser:([t])=>t}}function wQ(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function xQ(e,t){const i=ba(t),r=ba(t,"{2}"),s=ba(t,"{3}"),n=ba(t,"{4}"),c=ba(t,"{6}"),o=ba(t,"{1,2}"),f=ba(t,"{1,3}"),g=ba(t,"{1,6}"),S=ba(t,"{1,9}"),I=ba(t,"{2,4}"),A=ba(t,"{4,6}"),O=H=>({regex:RegExp(wQ(H.val)),deser:([Q])=>Q,literal:!0}),V=(H=>{if(e.literal)return O(H);switch(H.val){case"G":return wa(t.eras("short"),0);case"GG":return wa(t.eras("long"),0);case"y":return Li(g);case"yy":return Li(I,RE);case"yyyy":return Li(n);case"yyyyy":return Li(A);case"yyyyyy":return Li(c);case"M":return Li(o);case"MM":return Li(r);case"MMM":return wa(t.months("short",!0),1);case"MMMM":return wa(t.months("long",!0),1);case"L":return Li(o);case"LL":return Li(r);case"LLL":return wa(t.months("short",!1),1);case"LLLL":return wa(t.months("long",!1),1);case"d":return Li(o);case"dd":return Li(r);case"o":return Li(f);case"ooo":return Li(s);case"HH":return Li(r);case"H":return Li(o);case"hh":return Li(r);case"h":return Li(o);case"mm":return Li(r);case"m":return Li(o);case"q":return Li(o);case"qq":return Li(r);case"s":return Li(o);case"ss":return Li(r);case"S":return Li(f);case"SSS":return Li(s);case"u":return av(S);case"uu":return av(o);case"uuu":return Li(i);case"a":return wa(t.meridiems(),0);case"kkkk":return Li(n);case"kk":return Li(I,RE);case"W":return Li(o);case"WW":return Li(r);case"E":case"c":return Li(i);case"EEE":return wa(t.weekdays("short",!1),1);case"EEEE":return wa(t.weekdays("long",!1),1);case"ccc":return wa(t.weekdays("short",!0),1);case"cccc":return wa(t.weekdays("long",!0),1);case"Z":case"ZZ":return Ak(new RegExp(`([+-]${o.source})(?::(${r.source}))?`),2);case"ZZZ":return Ak(new RegExp(`([+-]${o.source})(${r.source})?`),2);case"z":return av(/[a-z_+-/]{1,256}?/i);case" ":return av(/[^\S\n\r]/);default:return O(H)}})(e)||{invalidReason:_Q};return V.token=e,V}const SQ={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function TQ(e,t,i){const{type:r,value:s}=e;if(r==="literal"){const f=/^\s+$/.test(s);return{literal:!f,val:f?" ":s}}const n=t[r];let c=r;r==="hour"&&(t.hour12!=null?c=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?c="hour12":c="hour24":c=i.hour12?"hour12":"hour24");let o=SQ[c];if(typeof o=="object"&&(o=o[n]),o)return{literal:!1,val:o}}function EQ(e){return[`^${e.map(i=>i.regex).reduce((i,r)=>`${i}(${r.source})`,"")}$`,e]}function MQ(e,t,i){const r=e.match(t);if(r){const s={};let n=1;for(const c in i)if(Rm(i,c)){const o=i[c],f=o.groups?o.groups+1:1;!o.literal&&o.token&&(s[o.token.val[0]]=o.deser(r.slice(n,n+f))),n+=f}return[r,s]}else return[r,{}]}function IQ(e){const t=n=>{switch(n){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let i=null,r;return ni(e.z)||(i=Ja.create(e.z)),ni(e.Z)||(i||(i=new gn(e.Z)),r=e.Z),ni(e.q)||(e.M=(e.q-1)*3+1),ni(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),ni(e.u)||(e.S=e3(e.u)),[Object.keys(e).reduce((n,c)=>{const o=t(c);return o&&(n[o]=e[c]),n},{}),i,r]}let DS=null;function AQ(){return DS||(DS=Jt.fromMillis(1555555555555)),DS}function PQ(e,t){if(e.literal)return e;const i=yn.macroTokenToFormatOpts(e.val),r=Rz(i,t);return r==null||r.includes(void 0)?e:r}function $z(e,t){return Array.prototype.concat(...e.map(i=>PQ(i,t)))}function kz(e,t,i){const r=$z(yn.parseFormat(i),e),s=r.map(c=>xQ(c,e)),n=s.find(c=>c.invalidReason);if(n)return{input:t,tokens:r,invalidReason:n.invalidReason};{const[c,o]=EQ(s),f=RegExp(c,"i"),[g,S]=MQ(t,f,o),[I,A,O]=S?IQ(S):[null,null,void 0];if(Rm(S,"a")&&Rm(S,"H"))throw new rm("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:f,rawMatches:g,matches:S,result:I,zone:A,specificOffset:O}}}function CQ(e,t,i){const{result:r,zone:s,specificOffset:n,invalidReason:c}=kz(e,t,i);return[r,s,n,c]}function Rz(e,t){if(!e)return null;const r=yn.create(t,e).dtFormatter(AQ()),s=r.formatToParts(),n=r.resolvedOptions();return s.map(c=>TQ(c,e,n))}const NS="Invalid DateTime",Pk=864e13;function lv(e){return new ja("unsupported zone",`the zone "${e.name}" is not supported`)}function zS(e){return e.weekData===null&&(e.weekData=Ew(e.c)),e.weekData}function FS(e){return e.localWeekData===null&&(e.localWeekData=Ew(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function id(e,t){const i={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Jt({...i,...t,old:i})}function Oz(e,t,i){let r=e-t*60*1e3;const s=i.offset(r);if(t===s)return[r,t];r-=(s-t)*60*1e3;const n=i.offset(r);return s===n?[r,s]:[e-Math.min(s,n)*60*1e3,Math.max(s,n)]}function cv(e,t){e+=t*60*1e3;const i=new Date(e);return{year:i.getUTCFullYear(),month:i.getUTCMonth()+1,day:i.getUTCDate(),hour:i.getUTCHours(),minute:i.getUTCMinutes(),second:i.getUTCSeconds(),millisecond:i.getUTCMilliseconds()}}function Xv(e,t,i){return Oz(Ox(e),t,i)}function Ck(e,t){const i=e.o,r=e.c.year+Math.trunc(t.years),s=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,n={...e.c,year:r,month:s,day:Math.min(e.c.day,Mw(r,s))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},c=Pi.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),o=Ox(n);let[f,g]=Oz(o,i,e.zone);return c!==0&&(f+=c,g=e.zone.offset(f)),{ts:f,o:g}}function hg(e,t,i,r,s,n){const{setZone:c,zone:o}=i;if(e&&Object.keys(e).length!==0||t){const f=t||o,g=Jt.fromObject(e,{...i,zone:f,specificOffset:n});return c?g:g.setZone(o)}else return Jt.invalid(new ja("unparsable",`the input "${s}" can't be parsed as ${r}`))}function uv(e,t,i=!0){return e.isValid?yn.create(Xi.create("en-US"),{allowZ:i,forceSimple:!0}).formatDateTimeFromString(e,t):null}function BS(e,t){const i=e.c.year>9999||e.c.year<0;let r="";return i&&e.c.year>=0&&(r+="+"),r+=ps(e.c.year,i?6:4),t?(r+="-",r+=ps(e.c.month),r+="-",r+=ps(e.c.day)):(r+=ps(e.c.month),r+=ps(e.c.day)),r}function $k(e,t,i,r,s,n){let c=ps(e.c.hour);return t?(c+=":",c+=ps(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!i)&&(c+=":")):c+=ps(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!i)&&(c+=ps(e.c.second),(e.c.millisecond!==0||!r)&&(c+=".",c+=ps(e.c.millisecond,3))),s&&(e.isOffsetFixed&&e.offset===0&&!n?c+="Z":e.o<0?(c+="-",c+=ps(Math.trunc(-e.o/60)),c+=":",c+=ps(Math.trunc(-e.o%60))):(c+="+",c+=ps(Math.trunc(e.o/60)),c+=":",c+=ps(Math.trunc(e.o%60)))),n&&(c+="["+e.zone.ianaName+"]"),c}const Lz={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},$Q={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},kQ={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Dz=["year","month","day","hour","minute","second","millisecond"],RQ=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],OQ=["year","ordinal","hour","minute","second","millisecond"];function LQ(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new z6(e);return t}function kk(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return LQ(e)}}function Rk(e,t){const i=ih(t.zone,rs.defaultZone),r=Xi.fromObject(t),s=rs.now();let n,c;if(ni(e.year))n=s;else{for(const g of Dz)ni(e[g])&&(e[g]=Lz[g]);const o=lz(e)||cz(e);if(o)return Jt.invalid(o);const f=i.offset(s);[n,c]=Xv(e,f,i)}return new Jt({ts:n,zone:i,loc:r,o:c})}function Ok(e,t,i){const r=ni(i.round)?!0:i.round,s=(c,o)=>(c=t3(c,r||i.calendary?0:2,!0),t.loc.clone(i).relFormatter(i).format(c,o)),n=c=>i.calendary?t.hasSame(e,c)?0:t.startOf(c).diff(e.startOf(c),c).get(c):t.diff(e,c).get(c);if(i.unit)return s(n(i.unit),i.unit);for(const c of i.units){const o=n(c);if(Math.abs(o)>=1)return s(o,c)}return s(e>t?-0:0,i.units[i.units.length-1])}function Lk(e){let t={},i;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],i=Array.from(e).slice(0,e.length-1)):i=Array.from(e),[t,i]}class Jt{constructor(t){const i=t.zone||rs.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new ja("invalid input"):null)||(i.isValid?null:lv(i));this.ts=ni(t.ts)?rs.now():t.ts;let s=null,n=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(i))[s,n]=[t.old.c,t.old.o];else{const o=i.offset(this.ts);s=cv(this.ts,o),r=Number.isNaN(s.year)?new ja("invalid input"):null,s=r?null:s,n=r?null:o}this._zone=i,this.loc=t.loc||Xi.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=s,this.o=n,this.isLuxonDateTime=!0}static now(){return new Jt({})}static local(){const[t,i]=Lk(arguments),[r,s,n,c,o,f,g]=i;return Rk({year:r,month:s,day:n,hour:c,minute:o,second:f,millisecond:g},t)}static utc(){const[t,i]=Lk(arguments),[r,s,n,c,o,f,g]=i;return t.zone=gn.utcInstance,Rk({year:r,month:s,day:n,hour:c,minute:o,second:f,millisecond:g},t)}static fromJSDate(t,i={}){const r=uX(t)?t.valueOf():NaN;if(Number.isNaN(r))return Jt.invalid("invalid input");const s=ih(i.zone,rs.defaultZone);return s.isValid?new Jt({ts:r,zone:s,loc:Xi.fromObject(i)}):Jt.invalid(lv(s))}static fromMillis(t,i={}){if(ap(t))return t<-Pk||t>Pk?Jt.invalid("Timestamp out of range"):new Jt({ts:t,zone:ih(i.zone,rs.defaultZone),loc:Xi.fromObject(i)});throw new Kn(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,i={}){if(ap(t))return new Jt({ts:t*1e3,zone:ih(i.zone,rs.defaultZone),loc:Xi.fromObject(i)});throw new Kn("fromSeconds requires a numerical input")}static fromObject(t,i={}){t=t||{};const r=ih(i.zone,rs.defaultZone);if(!r.isValid)return Jt.invalid(lv(r));const s=Xi.fromObject(i),n=Iw(t,kk),{minDaysInFirstWeek:c,startOfWeek:o}=_k(n,s),f=rs.now(),g=ni(i.specificOffset)?r.offset(f):i.specificOffset,S=!ni(n.ordinal),I=!ni(n.year),A=!ni(n.month)||!ni(n.day),O=I||A,z=n.weekYear||n.weekNumber;if((O||S)&&z)throw new rm("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(A&&S)throw new rm("Can't mix ordinal dates with month/day");const V=z||n.weekday&&!O;let H,Q,ve=cv(f,g);V?(H=RQ,Q=$Q,ve=Ew(ve,c,o)):S?(H=OQ,Q=kQ,ve=LS(ve)):(H=Dz,Q=Lz);let me=!1;for(const ut of H){const ot=n[ut];ni(ot)?me?n[ut]=Q[ut]:n[ut]=ve[ut]:me=!0}const ge=V?aX(n,c,o):S?lX(n):lz(n),Ie=ge||cz(n);if(Ie)return Jt.invalid(Ie);const Ce=V?yk(n,c,o):S?gk(n):n,[ze,je]=Xv(Ce,g,r),tt=new Jt({ts:ze,zone:r,o:je,loc:s});return n.weekday&&O&&t.weekday!==tt.weekday?Jt.invalid("mismatched weekday",`you can't specify both a weekday of ${n.weekday} and a date of ${tt.toISO()}`):tt}static fromISO(t,i={}){const[r,s]=QX(t);return hg(r,s,i,"ISO 8601",t)}static fromRFC2822(t,i={}){const[r,s]=eQ(t);return hg(r,s,i,"RFC 2822",t)}static fromHTTP(t,i={}){const[r,s]=tQ(t);return hg(r,s,i,"HTTP",i)}static fromFormat(t,i,r={}){if(ni(t)||ni(i))throw new Kn("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:n=null}=r,c=Xi.fromOpts({locale:s,numberingSystem:n,defaultToEN:!0}),[o,f,g,S]=CQ(c,t,i);return S?Jt.invalid(S):hg(o,f,r,`format ${i}`,t,g)}static fromString(t,i,r={}){return Jt.fromFormat(t,i,r)}static fromSQL(t,i={}){const[r,s]=lQ(t);return hg(r,s,i,"SQL",t)}static invalid(t,i=null){if(!t)throw new Kn("need to specify a reason the DateTime is invalid");const r=t instanceof ja?t:new ja(t,i);if(rs.throwOnInvalid)throw new NK(r);return new Jt({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,i={}){const r=Rz(t,Xi.fromObject(i));return r?r.map(s=>s?s.val:null).join(""):null}static expandFormat(t,i={}){return $z(yn.parseFormat(t),Xi.fromObject(i)).map(s=>s.val).join("")}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?zS(this).weekYear:NaN}get weekNumber(){return this.isValid?zS(this).weekNumber:NaN}get weekday(){return this.isValid?zS(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?FS(this).weekday:NaN}get localWeekNumber(){return this.isValid?FS(this).weekNumber:NaN}get localWeekYear(){return this.isValid?FS(this).weekYear:NaN}get ordinal(){return this.isValid?LS(this.c).ordinal:NaN}get monthShort(){return this.isValid?ov.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?ov.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?ov.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?ov.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,i=6e4,r=Ox(this.c),s=this.zone.offset(r-t),n=this.zone.offset(r+t),c=this.zone.offset(r-s*i),o=this.zone.offset(r-n*i);if(c===o)return[this];const f=r-c*i,g=r-o*i,S=cv(f,c),I=cv(g,o);return S.hour===I.hour&&S.minute===I.minute&&S.second===I.second&&S.millisecond===I.millisecond?[id(this,{ts:f}),id(this,{ts:g})]:[this]}get isInLeapYear(){return w_(this.year)}get daysInMonth(){return Mw(this.year,this.month)}get daysInYear(){return this.isValid?ym(this.year):NaN}get weeksInWeekYear(){return this.isValid?J0(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?J0(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:i,numberingSystem:r,calendar:s}=yn.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:i,numberingSystem:r,outputCalendar:s}}toUTC(t=0,i={}){return this.setZone(gn.instance(t),i)}toLocal(){return this.setZone(rs.defaultZone)}setZone(t,{keepLocalTime:i=!1,keepCalendarTime:r=!1}={}){if(t=ih(t,rs.defaultZone),t.equals(this.zone))return this;if(t.isValid){let s=this.ts;if(i||r){const n=t.offset(this.ts),c=this.toObject();[s]=Xv(c,n,t)}return id(this,{ts:s,zone:t})}else return Jt.invalid(lv(t))}reconfigure({locale:t,numberingSystem:i,outputCalendar:r}={}){const s=this.loc.clone({locale:t,numberingSystem:i,outputCalendar:r});return id(this,{loc:s})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const i=Iw(t,kk),{minDaysInFirstWeek:r,startOfWeek:s}=_k(i,this.loc),n=!ni(i.weekYear)||!ni(i.weekNumber)||!ni(i.weekday),c=!ni(i.ordinal),o=!ni(i.year),f=!ni(i.month)||!ni(i.day),g=o||f,S=i.weekYear||i.weekNumber;if((g||c)&&S)throw new rm("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(f&&c)throw new rm("Can't mix ordinal dates with month/day");let I;n?I=yk({...Ew(this.c,r,s),...i},r,s):ni(i.ordinal)?(I={...this.toObject(),...i},ni(i.day)&&(I.day=Math.min(Mw(I.year,I.month),I.day))):I=gk({...LS(this.c),...i});const[A,O]=Xv(I,this.o,this.zone);return id(this,{ts:A,o:O})}plus(t){if(!this.isValid)return this;const i=Pi.fromDurationLike(t);return id(this,Ck(this,i))}minus(t){if(!this.isValid)return this;const i=Pi.fromDurationLike(t).negate();return id(this,Ck(this,i))}startOf(t,{useLocaleWeeks:i=!1}={}){if(!this.isValid)return this;const r={},s=Pi.normalizeUnit(t);switch(s){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(s==="weeks")if(i){const n=this.loc.getStartOfWeek(),{weekday:c}=this;cthis.valueOf(),o=c?this:t,f=c?t:this,g=mQ(o,f,n,s);return c?g.negate():g}diffNow(t="milliseconds",i={}){return this.diff(Jt.now(),t,i)}until(t){return this.isValid?Fr.fromDateTimes(this,t):this}hasSame(t,i,r){if(!this.isValid)return!1;const s=t.valueOf(),n=this.setZone(t.zone,{keepLocalTime:!0});return n.startOf(i,r)<=s&&s<=n.endOf(i,r)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const i=t.base||Jt.fromObject({},{zone:this.zone}),r=t.padding?thisi.valueOf(),Math.min)}static max(...t){if(!t.every(Jt.isDateTime))throw new Kn("max requires all arguments be DateTimes");return vk(t,i=>i.valueOf(),Math.max)}static fromFormatExplain(t,i,r={}){const{locale:s=null,numberingSystem:n=null}=r,c=Xi.fromOpts({locale:s,numberingSystem:n,defaultToEN:!0});return kz(c,t,i)}static fromStringExplain(t,i,r={}){return Jt.fromFormatExplain(t,i,r)}static get DATE_SHORT(){return Tw}static get DATE_MED(){return F6}static get DATE_MED_WITH_WEEKDAY(){return BK}static get DATE_FULL(){return B6}static get DATE_HUGE(){return U6}static get TIME_SIMPLE(){return j6}static get TIME_WITH_SECONDS(){return V6}static get TIME_WITH_SHORT_OFFSET(){return G6}static get TIME_WITH_LONG_OFFSET(){return q6}static get TIME_24_SIMPLE(){return H6}static get TIME_24_WITH_SECONDS(){return W6}static get TIME_24_WITH_SHORT_OFFSET(){return Z6}static get TIME_24_WITH_LONG_OFFSET(){return Y6}static get DATETIME_SHORT(){return J6}static get DATETIME_SHORT_WITH_SECONDS(){return K6}static get DATETIME_MED(){return X6}static get DATETIME_MED_WITH_SECONDS(){return Q6}static get DATETIME_MED_WITH_WEEKDAY(){return UK}static get DATETIME_FULL(){return ez}static get DATETIME_FULL_WITH_SECONDS(){return tz}static get DATETIME_HUGE(){return iz}static get DATETIME_HUGE_WITH_SECONDS(){return rz}}function dg(e){if(Jt.isDateTime(e))return e;if(e&&e.valueOf&&ap(e.valueOf()))return Jt.fromJSDate(e);if(e&&typeof e=="object")return Jt.fromObject(e);throw new Kn(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const Dl="system",o3="unknown",K0="UTC",DQ=Intl.DateTimeFormat().resolvedOptions().timeZone,NQ="shortOffset";function zQ(e){return"timeZoneIANA"in e}function FQ(e){return e.startsWith("UTC")}function Kge(e,t=!1){return{json:{read:{source:e,reader:(i,r)=>r[e]?BQ(r[e]):null},write:!!t&&{allowNull:!0,writer(i,r){r[e]=i?UQ(i):null}}}}}function BQ(e,t=Dl){return e?zQ(e)?e.timeZoneIANA:jQ(e,t):t}function UQ(e){return{timeZoneIANA:e}}function jQ(e,t=Dl){if(!e||!nk.has(e.timeZone))return t;const i=nk.get(e.timeZone);return FQ(e.timeZone)||e.respectsDaylightSaving?i:VQ(i)}function VQ(e){const t=Jt.local().setZone(e),i=Math.min(t.set({month:1,day:1}).offset,t.set({month:5}).offset);return i===0?"Etc/UTC":`Etc/GMT${gn.instance(-i).formatOffset(0,"narrow")}`}function Xge(e,t,i,r,s){if(t&&s==="date")return{timeZone:K0,timeZoneName:void 0};const n=r.timeStyle||r.hour,c=i===o3;return{timeZone:c?s==="timestamp-offset"?void 0:e??K0:i,timeZoneName:c&&n?NQ:void 0}}const GQ={year:void 0,month:void 0,day:void 0,weekday:void 0},qQ={hour:void 0,minute:void 0,second:void 0},Nz={timeZone:K0},cl={year:"numeric",month:"numeric",day:"numeric"},pg={year:"numeric",month:"long",day:"numeric"},fg={year:"numeric",month:"short",day:"numeric"},mg={year:"numeric",month:"long",weekday:"long",day:"numeric"},Xu={hour:"numeric",minute:"numeric"},fd={...Xu,second:"numeric"},zz={hourCycle:"h23"},yg={...Xu,...zz},gg={...fd,...zz},Fz={"short-date":cl,"short-date-short-time":{...cl,...Xu},"short-date-short-time-24":{...cl,...yg},"short-date-long-time":{...cl,...fd},"short-date-long-time-24":{...cl,...gg},"short-date-le":cl,"short-date-le-short-time":{...cl,...Xu},"short-date-le-short-time-24":{...cl,...yg},"short-date-le-long-time":{...cl,...fd},"short-date-le-long-time-24":{...cl,...gg},"long-month-day-year":pg,"long-month-day-year-short-time":{...pg,...Xu},"long-month-day-year-short-time-24":{...pg,...yg},"long-month-day-year-long-time":{...pg,...fd},"long-month-day-year-long-time-24":{...pg,...gg},"day-short-month-year":fg,"day-short-month-year-short-time":{...fg,...Xu},"day-short-month-year-short-time-24":{...fg,...yg},"day-short-month-year-long-time":{...fg,...fd},"day-short-month-year-long-time-24":{...fg,...gg},"long-date":mg,"long-date-short-time":{...mg,...Xu},"long-date-short-time-24":{...mg,...yg},"long-date-long-time":{...mg,...fd},"long-date-long-time-24":{...mg,...gg},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":Xu,"long-time":fd},HQ=Bn()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"}),Bz={ar:"ar-u-nu-latn-ca-gregory"};let OE=new WeakMap;const Nx=Fz["short-date-short-time"];function WQ(e){let t=OE.get(e);if(!t){const i=wo(),r=Bz[i]||i,s=l3(e.timeZone??Dl),n={...e,timeZone:s};t=new Intl.DateTimeFormat(r,n),OE.set(e,t)}return t}function Qge(e){return Fz[e]}function a3(e,t=Nx){return WQ(t).format(e)}function e0e(e,t=Nx){return a3(new Date(e),{...t,...Nz,...qQ})}function t0e(e,t=Nx){return a3(new Date(`1970-01-01T${e}Z`),{...t,...Nz,...GQ})}function i0e(e,t=Nx){if(t.timeZone)return a3(new Date(e),t);const i=Jt.fromISO(e,{setZone:!0}),r=wo(),s=Bz[r]??r,n=i.offset===0?K0:t.timeZone,c={...t,timeZone:n};return i.toLocaleString(c,{locale:s})}function l3(e){switch(e){case Dl:return DQ;case o3:return K0;default:return e}}$A(()=>{OE=new WeakMap});const ZQ={ar:"ar-u-nu-latn"};let Qv=new WeakMap,Uz={};function YQ(e){const t=e||Uz;if(!Qv.has(t)){const i=wo(),r=ZQ[wo()]||i;Qv.set(t,new Intl.NumberFormat(r,e))}return Qv.get(t)}function r0e(e={}){const t={};return e.digitSeparator!=null&&(t.useGrouping=e.digitSeparator),e.places!=null&&(t.minimumFractionDigits=t.maximumFractionDigits=e.places),t}function s0e(e,t){return Object.is(e,-0)&&(e=0),YQ(t).format(e)}$A(()=>{Qv=new WeakMap,Uz={}});async function JQ(e,t,i,r){const s=t.exec(i);if(!s)throw new Je("esri-intl:invalid-bundle",`Bundle id "${i}" is not compatible with the pattern "${t}"`);const n=s[1]?`${s[1]}/`:"",c=s[2],o=nZ(r),f=`${n}${c}.json`,g=o?`${n}${c}_${o}.json`:f;let S;try{S=await Dk(e(g))}catch(I){if(g===f)throw new Je("intl:unknown-bundle",`Bundle "${i}" cannot be loaded`,{error:I});try{S=await Dk(e(f))}catch(A){throw new Je("intl:unknown-bundle",`Bundle "${i}" cannot be loaded`,{error:A})}}return S}async function Dk(e){if(Nk.fetchBundleAsset!=null)return Nk.fetchBundleAsset(e);const t=await Qi(e,{responseType:"text"});return JSON.parse(t.data)}let KQ=class{constructor({base:t="",pattern:i,location:r=new URL(window.location.href)}){let s;s=typeof r=="string"?n=>new URL(n,new URL(r,window.location.href)).href:r instanceof URL?n=>new URL(n,r).href:r,this.pattern=typeof i=="string"?new RegExp(`^${i}`):i,this.getAssetUrl=s,t=t?t.endsWith("/")?t:t+"/":"",this.matcher=new RegExp(`^${t}(?:(.*)/)?(.*)$`)}fetchMessageBundle(t,i){return JQ(this.getAssetUrl,this.matcher,t,i)}};function XQ(e){return new KQ(e)}const Nk={};sZ(XQ({pattern:"esri/",location:Ri}));const QQ={};function eee(e){var i;const t={async:e.async,isDebug:e.isDebug,locale:e.locale,baseUrl:e.baseUrl,has:{...e.has},map:{...e.map},packages:((i=e.packages)==null?void 0:i.concat())||[],paths:{...e.paths}};return e.hasOwnProperty("async")||(t.async=!0),e.hasOwnProperty("isDebug")||(t.isDebug=!1),e.baseUrl||(t.baseUrl=QQ.baseUrl),t}let tee=class{constructor(){const t=document.createDocumentFragment();["addEventListener","dispatchEvent","removeEventListener"].forEach(i=>{this[i]=(...r)=>t[i](...r)})}},eb=class{constructor(){this._dispatcher=new tee,this._workerPostMessage({type:$s.HANDSHAKE})}terminate(){}get onmessage(){return this._onmessageHandler}set onmessage(t){this._onmessageHandler&&this.removeEventListener("message",this._onmessageHandler),this._onmessageHandler=t,t&&this.addEventListener("message",t)}get onmessageerror(){return this._onmessageerrorHandler}set onmessageerror(t){this._onmessageerrorHandler&&this.removeEventListener("messageerror",this._onmessageerrorHandler),this._onmessageerrorHandler=t,t&&this.addEventListener("messageerror",t)}get onerror(){return this._onerrorHandler}set onerror(t){this._onerrorHandler&&this.removeEventListener("error",this._onerrorHandler),this._onerrorHandler=t,t&&this.addEventListener("error",t)}postMessage(t){Yb(()=>{this._workerMessageHandler(new MessageEvent("message",{data:t}))})}dispatchEvent(t){return this._dispatcher.dispatchEvent(t)}addEventListener(t,i,r){this._dispatcher.addEventListener(t,i,r)}removeEventListener(t,i,r){this._dispatcher.removeEventListener(t,i,r)}_workerPostMessage(t){Yb(()=>{this.dispatchEvent(new MessageEvent("message",{data:t}))})}async _workerMessageHandler(t){const i=Y0(t);if(i&&i.type===$s.OPEN){const{modulePath:r,jobId:s}=i;let n=await _h.loadWorker(r);n||(n=await ht(()=>import(r),[]));const c=_h.connect(n);this._workerPostMessage({type:$s.OPENED,jobId:s,data:c})}}};const LE=()=>_t.getLogger("esri.core.workers.workerFactory"),{HANDSHAKE:iee}=$s,ree='let globalId=0;const outgoing=new Map,configuration=JSON.parse("{CONFIGURATION}");self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}function invokeStaticMessage(e,o,r){const t=r&&r.signal,n=globalId++;return new Promise(((r,s)=>{if(t){if(t.aborted)return s(createAbortError());t.addEventListener("abort",(()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:ABORT,jobId:n}),s(createAbortError()))}))}outgoing.set(n,{resolve:r,reject:s}),self.postMessage({type:INVOKE,jobId:n,methodName:e,abortable:null!=t,data:o})}))}let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,fullVersion:r}=configuration.kernelInfo,{revision:t,fullVersion:n,version:s}=e.kernelInfo;esriConfig.assetsPath!==esriConfig.defaultAssetsPath&&o!==t&&console.warn(`Version mismatch detected between ArcGIS Maps SDK for JavaScript modules and assets. For more information visit https://bit.ly/3QnsuSo.\\nModules version: ${r}\\nAssets version: ${n??s}\\nAssets path: ${esriConfig.assetsPath}`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case OPEN:let n;function t(e){const o=n.connect(e);self.postMessage({type:OPENED,jobId:r,data:o},[o])}"function"==typeof define&&define.amd?require([workerPath],(e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then((e=>e||new Promise((e=>{require([o.modulePath],e)})))).then(t)})):"System"in self&&"function"==typeof System.import?System.import(workerPath).then((e=>(n=e.default,checkWorkerRevision(n),n.loadWorker(o.modulePath)))).then((e=>e||System.import(o.modulePath))).then(t):esriConfig.workers.useDynamicImport?import(workerPath).then((e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then((e=>e||import(o.modulePath))).then(t)})):(self.RemoteClient||importScripts(workerPath),n=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(n),n.loadWorker(o.modulePath).then(t));break;case RESPONSE:if(outgoing.has(r)){const s=outgoing.get(r);outgoing.delete(r),o.error?s.reject(JSON.parse(o.error)):s.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});';let hv,dv;const zk="Failed to create Worker. Fallback to execute module in main thread";async function see(){if(!Le("esri-workers"))return Fk(new eb);if(!hv&&!dv)try{const t=ree.split('"{CONFIGURATION}"').join(`'${nee()}'`);hv=URL.createObjectURL(new Blob([t],{type:"text/javascript"}))}catch(t){dv=t||{}}let e;if(hv)try{e=new Worker(hv,{name:"esri-worker-"+oee++})}catch{LE().warn(zk,dv),e=new eb}else LE().warn(zk,dv),e=new eb;return Fk(e)}async function Fk(e){return new Promise(t=>{function i(s){const n=Y0(s);n&&n.type===iee&&(e.removeEventListener("message",i),e.removeEventListener("error",r),t(e))}function r(s){s.preventDefault(),e.removeEventListener("message",i),e.removeEventListener("error",r),LE().warn("Failed to create Worker. Fallback to execute module in main thread",s),(e=new eb).addEventListener("message",i),e.addEventListener("error",r)}e.addEventListener("message",i),e.addEventListener("error",r)})}function nee(){let e;if(Ci.default!=null){const s={...Ci};delete s.default,e=JSON.parse(JSON.stringify(s))}else e=JSON.parse(JSON.stringify(Ci));e.assetsPath=Xo(e.assetsPath),e.defaultAssetsPath=e.defaultAssetsPath?Xo(e.defaultAssetsPath):void 0,e.request.interceptors=[],e.log.interceptors=[],e.locale=wo(),e.has={"esri-csp-restrictions":Le("esri-csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":Le("esri-2d-update-debug"),"esri-2d-log-updating":Le("esri-2d-log-updating"),"featurelayer-pbf":Le("featurelayer-pbf"),"featurelayer-fast-triangulation-enabled":Le("featurelayer-fast-triangulation-enabled"),"featurelayer-simplify-thresholds":Le("featurelayer-simplify-thresholds"),"featurelayer-simplify-payload-size-factors":Le("featurelayer-simplify-payload-size-factors"),"featurelayer-simplify-mobile-factor":Le("featurelayer-simplify-mobile-factor"),"featurelayer-query-max-depth":Le("featurelayer-query-max-depth"),"featurelayer-query-pausing-enabled":Le("featurelayer-query-pausing-enabled"),"featurelayer-snapshot-enabled":Le("featurelayer-snapshot-enabled"),"esri-atomics":Le("esri-atomics"),"esri-shared-array-buffer":Le("esri-shared-array-buffer"),"esri-tiles-debug":Le("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":Le("esri-workers-arraybuffer-transfer"),"feature-polyline-generalization-factor":Le("feature-polyline-generalization-factor"),"host-webworker":1},e.workers.loaderUrl&&(e.workers.loaderUrl=Xo(e.workers.loaderUrl)),e.workers.workerPath?e.workers.workerPath=Xo(e.workers.workerPath):e.workers.workerPath=Xo(Ri("esri/core/workers/RemoteClient.js")),e.workers.useDynamicImport=!1;const t=Ci.workers.loaderConfig,i=eee({baseUrl:t==null?void 0:t.baseUrl,locale:wo(),has:{"csp-restrictions":1,"dojo-test-sniff":0,"host-webworker":1,...t==null?void 0:t.has},map:{...t==null?void 0:t.map},paths:{...t==null?void 0:t.paths},packages:(t==null?void 0:t.packages)||[]});return JSON.stringify({esriConfig:e,loaderConfig:i,kernelInfo:{buildDate:U4,fullVersion:vA,revision:j4}})}let oee=0;const{ABORT:Bk,INVOKE:aee,OPEN:lee,OPENED:cee,RESPONSE:_g}=$s;let uee=class jz{static async create(t){const i=await see();return new jz(i,t)}constructor(t,i){this._outJobs=new Map,this._inJobs=new Map,this.worker=t,this.id=i,t.addEventListener("message",this._onMessage.bind(this)),t.addEventListener("error",r=>{r.preventDefault(),_t.getLogger("esri.core.workers.WorkerOwner").error(r)})}terminate(){this.worker.terminate()}async open(t,i={}){const{signal:r}=i,s=D6();return new Promise((n,c)=>{const o={resolve:n,reject:c,abortHandle:iA(r,()=>{this._outJobs.delete(s),this._post({type:Bk,jobId:s})})};this._outJobs.set(s,o),this._post({type:lee,jobId:s,modulePath:t})})}_onMessage(t){const i=Y0(t);if(i)switch(i.type){case cee:this._onOpenedMessage(i);break;case _g:this._onResponseMessage(i);break;case Bk:this._onAbortMessage(i);break;case aee:this._onInvokeMessage(i)}}_onAbortMessage(t){const i=this._inJobs,r=t.jobId,s=i.get(r);s&&(s.controller&&s.controller.abort(),i.delete(r))}_onInvokeMessage(t){const{methodName:i,jobId:r,data:s,abortable:n}=t,c=n?new AbortController:null,o=this._inJobs,f=DK[i];let g;try{if(typeof f!="function")throw new TypeError(`${i} is not a function`);g=f.call(null,s,{signal:c?c.signal:null})}catch(S){return void this._post({type:_g,jobId:r,error:Z0(S)})}xh(g)?(o.set(r,{controller:c,promise:g}),g.then(S=>{o.has(r)&&(o.delete(r),this._post({type:_g,jobId:r},S))},S=>{o.has(r)&&(o.delete(r),S||(S={message:"Error encountered at method"+i}),Ys(S)||this._post({type:_g,jobId:r,error:Z0(S||{message:`Error encountered at method ${i}`})}))})):this._post({type:_g,jobId:r},g)}_onOpenedMessage(t){const{jobId:i,data:r}=t,s=this._outJobs.get(i);s&&(this._outJobs.delete(i),Sr(s.abortHandle),s.resolve(r))}_onResponseMessage(t){const{jobId:i,error:r,data:s}=t,n=this._outJobs.get(i);n&&(this._outJobs.delete(i),Sr(n.abortHandle),r?n.reject(Je.fromJSON(JSON.parse(r))):n.resolve(s))}_post(t,i,r){return KA(this.worker,t,i,r)}};const Uk=Le("host-browser")?Math.min(navigator.hardwareConcurrency-1,Le("workers-pool-size")):0;let Jd=Le("esri-mobile")?Math.min(Uk,3):Uk;Jd||(Jd=Le("safari")&&Le("mac")?7:2);let jk=0;const tb=[];function hee(){Vz()}async function pv(e,t){const i=new LK,{registryTarget:r,...s}=t;return await i.open(e,s),r&&TK(r,i),i}async function l0e(e,t={}){if(typeof e!="string")throw new Je("workers:undefined-module","modulePath is missing");let i=t.strategy||"distributed";if(Le("host-webworker")&&!Le("esri-workers")&&(i="local"),i==="local"){let r=await _h.loadWorker(e);r||(r=await ht(()=>import(e),[])),mr(t.signal);const s=t.client||r;return pv([_h.connect(r)],{...t,client:s})}if(await Vz(),mr(t.signal),i==="dedicated"){const r=jk++%Jd;return pv([await tb[r].open(e,t)],t)}if(t.maxNumWorkers&&t.maxNumWorkers>0){const r=Math.min(t.maxNumWorkers,Jd);if(rr.open(e,t)),t)}let fv=null;async function Vz(){if(fv)return fv;new AbortController;const e=[];for(let t=0;t(tb[t]=r,r));e.push(i)}return fv=Promise.all(e),fv}const Su=Or.radius,xa=Or.eccentricitySquared,dee={a1:Su*xa,a2:Su*xa*Su*xa,a3:Su*xa*xa/2,a4:Su*xa*Su*xa*2.5,a5:Su*xa+Su*xa*xa/2,a6:1-xa};1/294.9786982,1/298.257222101,Or.radius,Or.flattening,1/298.257222101,ph.radius,ph.flattening,1/192.0430107526882,$l.radius,$l.flattening,1/10.2079945799458,1/43.61604095563141,$l.radius;var be;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.SPHERICAL_ECEF=1]="SPHERICAL_ECEF",e[e.WGS84=2]="WGS84",e[e.WEB_MERCATOR=3]="WEB_MERCATOR",e[e.WGS84_ECEF=4]="WGS84_ECEF",e[e.CGCS2000=5]="CGCS2000",e[e.WGS84_COMPARABLE_LON_LAT=6]="WGS84_COMPARABLE_LON_LAT",e[e.SPHERICAL_MARS_PCPF=7]="SPHERICAL_MARS_PCPF",e[e.GCSMARS2000=8]="GCSMARS2000",e[e.SPHERICAL_MOON_PCPF=9]="SPHERICAL_MOON_PCPF",e[e.GCSMOON2000=10]="GCSMOON2000",e[e.LON_LAT=11]="LON_LAT",e[e.PLATE_CARREE=12]="PLATE_CARREE"})(be||(be={}));const Gz={[be.WGS84]:{[be.CGCS2000]:null,[be.GCSMARS2000]:null,[be.GCSMOON2000]:null,[be.LON_LAT]:Wi,[be.WGS84_COMPARABLE_LON_LAT]:Wi,[be.SPHERICAL_ECEF]:sm,[be.SPHERICAL_MARS_PCPF]:null,[be.SPHERICAL_MOON_PCPF]:null,[be.UNKNOWN]:null,[be.WEB_MERCATOR]:X0,[be.PLATE_CARREE]:Kd,[be.WGS84]:Wi,[be.WGS84_ECEF]:ep},[be.CGCS2000]:{[be.CGCS2000]:Wi,[be.GCSMARS2000]:null,[be.GCSMOON2000]:null,[be.LON_LAT]:Wi,[be.WGS84_COMPARABLE_LON_LAT]:Wi,[be.SPHERICAL_ECEF]:sm,[be.SPHERICAL_MARS_PCPF]:null,[be.SPHERICAL_MOON_PCPF]:null,[be.UNKNOWN]:null,[be.WEB_MERCATOR]:null,[be.PLATE_CARREE]:Kd,[be.WGS84]:null,[be.WGS84_ECEF]:ep},[be.GCSMARS2000]:{[be.CGCS2000]:null,[be.GCSMARS2000]:Wi,[be.GCSMOON2000]:null,[be.LON_LAT]:Wi,[be.WGS84_COMPARABLE_LON_LAT]:null,[be.SPHERICAL_ECEF]:null,[be.SPHERICAL_MARS_PCPF]:Gk,[be.SPHERICAL_MOON_PCPF]:null,[be.UNKNOWN]:null,[be.WEB_MERCATOR]:null,[be.PLATE_CARREE]:null,[be.WGS84]:null,[be.WGS84_ECEF]:null},[be.GCSMOON2000]:{[be.CGCS2000]:null,[be.GCSMARS2000]:null,[be.GCSMOON2000]:Wi,[be.LON_LAT]:Wi,[be.WGS84_COMPARABLE_LON_LAT]:null,[be.SPHERICAL_ECEF]:null,[be.SPHERICAL_MARS_PCPF]:null,[be.SPHERICAL_MOON_PCPF]:Vk,[be.UNKNOWN]:null,[be.WEB_MERCATOR]:null,[be.PLATE_CARREE]:null,[be.WGS84]:null,[be.WGS84_ECEF]:null},[be.WEB_MERCATOR]:{[be.CGCS2000]:null,[be.GCSMARS2000]:null,[be.GCSMOON2000]:null,[be.LON_LAT]:x0,[be.WGS84_COMPARABLE_LON_LAT]:x0,[be.SPHERICAL_ECEF]:fee,[be.SPHERICAL_MARS_PCPF]:null,[be.SPHERICAL_MOON_PCPF]:null,[be.UNKNOWN]:null,[be.WEB_MERCATOR]:Wi,[be.PLATE_CARREE]:gee,[be.WGS84]:x0,[be.WGS84_ECEF]:mee},[be.WGS84_ECEF]:{[be.CGCS2000]:tp,[be.GCSMARS2000]:null,[be.GCSMOON2000]:null,[be.LON_LAT]:tp,[be.WGS84_COMPARABLE_LON_LAT]:tp,[be.SPHERICAL_ECEF]:Mee,[be.SPHERICAL_MARS_PCPF]:null,[be.SPHERICAL_MOON_PCPF]:null,[be.UNKNOWN]:null,[be.WEB_MERCATOR]:Iee,[be.PLATE_CARREE]:_ee,[be.WGS84]:tp,[be.WGS84_ECEF]:Wi},[be.SPHERICAL_ECEF]:{[be.CGCS2000]:Qd,[be.GCSMARS2000]:null,[be.GCSMOON2000]:null,[be.LON_LAT]:Qd,[be.WGS84_COMPARABLE_LON_LAT]:Qd,[be.SPHERICAL_ECEF]:Wi,[be.SPHERICAL_MARS_PCPF]:null,[be.SPHERICAL_MOON_PCPF]:null,[be.UNKNOWN]:null,[be.WEB_MERCATOR]:See,[be.PLATE_CARREE]:vee,[be.WGS84]:Qd,[be.WGS84_ECEF]:Tee},[be.SPHERICAL_MARS_PCPF]:{[be.CGCS2000]:null,[be.GCSMARS2000]:Hk,[be.GCSMOON2000]:null,[be.LON_LAT]:Hk,[be.WGS84_COMPARABLE_LON_LAT]:null,[be.SPHERICAL_ECEF]:null,[be.SPHERICAL_MARS_PCPF]:Wi,[be.SPHERICAL_MOON_PCPF]:null,[be.UNKNOWN]:null,[be.WEB_MERCATOR]:null,[be.PLATE_CARREE]:null,[be.WGS84]:null,[be.WGS84_ECEF]:null},[be.SPHERICAL_MOON_PCPF]:{[be.CGCS2000]:null,[be.GCSMARS2000]:null,[be.GCSMOON2000]:qk,[be.LON_LAT]:qk,[be.WGS84_COMPARABLE_LON_LAT]:null,[be.SPHERICAL_ECEF]:null,[be.SPHERICAL_MARS_PCPF]:null,[be.SPHERICAL_MOON_PCPF]:Wi,[be.UNKNOWN]:null,[be.WEB_MERCATOR]:null,[be.PLATE_CARREE]:null,[be.WGS84]:null,[be.WGS84_ECEF]:null},[be.UNKNOWN]:{[be.CGCS2000]:null,[be.GCSMARS2000]:null,[be.GCSMOON2000]:null,[be.LON_LAT]:null,[be.WGS84_COMPARABLE_LON_LAT]:null,[be.SPHERICAL_ECEF]:null,[be.SPHERICAL_MARS_PCPF]:null,[be.SPHERICAL_MOON_PCPF]:null,[be.UNKNOWN]:Wi,[be.WEB_MERCATOR]:null,[be.PLATE_CARREE]:null,[be.WGS84]:null,[be.WGS84_ECEF]:null},[be.LON_LAT]:{[be.CGCS2000]:Wi,[be.GCSMARS2000]:Wi,[be.GCSMOON2000]:Wi,[be.LON_LAT]:Wi,[be.WGS84_COMPARABLE_LON_LAT]:Wi,[be.SPHERICAL_ECEF]:sm,[be.SPHERICAL_MARS_PCPF]:Gk,[be.SPHERICAL_MOON_PCPF]:Vk,[be.UNKNOWN]:null,[be.WEB_MERCATOR]:X0,[be.PLATE_CARREE]:Kd,[be.WGS84]:Wi,[be.WGS84_ECEF]:ep},[be.WGS84_COMPARABLE_LON_LAT]:{[be.CGCS2000]:null,[be.GCSMARS2000]:null,[be.GCSMOON2000]:null,[be.LON_LAT]:Wi,[be.WGS84_COMPARABLE_LON_LAT]:Wi,[be.SPHERICAL_ECEF]:sm,[be.SPHERICAL_MARS_PCPF]:null,[be.SPHERICAL_MOON_PCPF]:null,[be.UNKNOWN]:null,[be.WEB_MERCATOR]:null,[be.PLATE_CARREE]:Kd,[be.WGS84]:Wi,[be.WGS84_ECEF]:ep},[be.PLATE_CARREE]:{[be.CGCS2000]:Xd,[be.GCSMARS2000]:null,[be.GCSMOON2000]:null,[be.LON_LAT]:Xd,[be.WGS84_COMPARABLE_LON_LAT]:Xd,[be.SPHERICAL_ECEF]:bee,[be.SPHERICAL_MARS_PCPF]:null,[be.SPHERICAL_MOON_PCPF]:null,[be.UNKNOWN]:null,[be.WEB_MERCATOR]:wee,[be.PLATE_CARREE]:Wi,[be.WGS84]:Xd,[be.WGS84_ECEF]:xee}};function pee(e){const t=DE(e,Pee);return Gz[t][be.WGS84_COMPARABLE_LON_LAT]}function qz(e,t,i=Hz()){return e==null||t==null?null:Aee(e,t,i).projector}function DE(e,t){return e?t.spatialReference===e?t.spatialReferenceId:(t.spatialReference=e,"metersPerUnit"in t&&(t.metersPerUnit=$p(e,1)),yw(e)?t.spatialReferenceId=be.SPHERICAL_ECEF:G0(e)?t.spatialReferenceId=be.WGS84:gp(e)?t.spatialReferenceId=be.WEB_MERCATOR:eW(e)?t.spatialReferenceId=be.PLATE_CARREE:e.wkt===sW.wkt?t.spatialReferenceId=be.WGS84_ECEF:e.wkid===yp.CGCS2000?t.spatialReferenceId=be.CGCS2000:e.wkt===AA.wkt?t.spatialReferenceId=be.SPHERICAL_MARS_PCPF:e.wkt===PA.wkt?t.spatialReferenceId=be.SPHERICAL_MOON_PCPF:sN(e)?t.spatialReferenceId=be.GCSMARS2000:nN(e)?t.spatialReferenceId=be.GCSMOON2000:t.spatialReferenceId=be.UNKNOWN):be.UNKNOWN}function Wi(e,t,i,r){e!==i&&(i[r++]=e[t++],i[r++]=e[t++],i[r]=e[t])}function x0(e,t,i,r){i[r]=Lm*(e[t]/lp),i[r+1]=Lm*(Zz-2*Math.atan(Math.exp(-e[t+1]/lp))),i[r+2]=e[t+2]}function fee(e,t,i,r){const s=e[t]/lp,n=Zz-2*Math.atan(Math.exp(-e[t+1]/lp)),c=lp+e[t+2],o=Math.cos(n)*c;i[r]=Math.cos(s)*o,i[r+1]=Math.sin(s)*o,i[r+2]=Math.sin(n)*c}function mee(e,t,i,r){x0(e,t,i,r),ep(i,r,i,r)}function yee(e,t,i,r,s){const n=.4999999*zx,c=Ll(Om*e[t+1],-n,n),o=Math.sin(c);i[r++]=Om*e[t]*s.radius,i[r++]=s.halfSemiMajorAxis*Math.log((1+o)/(1-o)),i[r]=e[t+2]}function X0(e,t,i,r){yee(e,t,i,r,Or)}function Kd(e,t,i,r){i[r]=e[t]*Wk,i[r+1]=e[t+1]*Wk,i[r+2]=e[t+2]}function Xd(e,t,i,r){i[r]=e[t]*Zk,i[r+1]=e[t+1]*Zk,i[r+2]=e[t+2]}function gee(e,t,i,r){x0(e,t,i,r),Kd(i,r,i,r)}function _ee(e,t,i,r){tp(e,t,i,r),Kd(i,r,i,r)}function vee(e,t,i,r){Qd(e,t,i,r),Kd(i,r,i,r)}function bee(e,t,i,r){Xd(e,t,i,r),sm(i,r,i,r)}function wee(e,t,i,r){Xd(e,t,i,r),X0(i,r,i,r)}function xee(e,t,i,r){Xd(e,t,i,r),ep(i,r,i,r)}function c3(e,t,i,r,s){const n=s+e[t+2],c=Om*e[t+1],o=Om*e[t],f=Math.cos(c)*n;i[r]=Math.cos(o)*f,i[r+1]=Math.sin(o)*f,i[r+2]=Math.sin(c)*n}function Vk(e,t,i,r){c3(e,t,i,r,ph.radius)}function Gk(e,t,i,r){c3(e,t,i,r,$l.radius)}function sm(e,t,i,r){c3(e,t,i,r,Or.radius)}function u3(e,t,i,r,s){const n=e[t],c=e[t+1],o=e[t+2],f=Math.sqrt(n*n+c*c+o*o),g=FN(o/(f===0?1:f)),S=Math.atan2(c,n);i[r++]=Lm*S,i[r++]=Lm*g,i[r]=f-s}function qk(e,t,i,r){u3(e,t,i,r,ph.radius)}function Hk(e,t,i,r){u3(e,t,i,r,$l.radius)}function Qd(e,t,i,r){u3(e,t,i,r,Or.radius)}function See(e,t,i,r){Qd(e,t,i,r),X0(i,r,i,r)}function Tee(e,t,i,r){Qd(e,t,i,r),ep(i,r,i,r)}function Eee(e,t,i,r,s){const n=Om*e[t],c=Om*e[t+1],o=e[t+2],f=Math.sin(c),g=Math.cos(c),S=s.radius/Math.sqrt(1-s.eccentricitySquared*f*f);i[r++]=(S+o)*g*Math.cos(n),i[r++]=(S+o)*g*Math.sin(n),i[r++]=(S*(1-s.eccentricitySquared)+o)*f}function ep(e,t,i,r){Eee(e,t,i,r,Or)}function tp(e,t,i,r){const s=dee,n=e[t],c=e[t+1],o=e[t+2];let f,g,S,I,A,O,z,V,H,Q,ve,me,ge,Ie,Ce,ze,je,tt,ut,ot,et;f=Math.abs(o),g=n*n+c*c,S=Math.sqrt(g),I=g+o*o,A=Math.sqrt(I),ot=Math.atan2(c,n),O=o*o/I,z=g/I,Ie=s.a2/A,Ce=s.a3-s.a4/A,z>.3?(V=f/A*(1+z*(s.a1+Ie+O*Ce)/A),ut=Math.asin(V),Q=V*V,H=Math.sqrt(1-Q)):(H=S/A*(1-O*(s.a5-Ie-z*Ce)/A),ut=Math.acos(H),Q=1-H*H,V=Math.sqrt(Q)),ve=1-Or.eccentricitySquared*Q,me=Or.radius/Math.sqrt(ve),ge=s.a6*me,Ie=S-me*H,Ce=f-ge*V,je=H*Ie+V*Ce,ze=H*Ce-V*Ie,tt=ze/(ge/ve+je),ut+=tt,et=je+ze*tt/2,o<0&&(ut=-ut),i[r++]=Lm*ot,i[r++]=Lm*ut,i[r]=et}function Mee(e,t,i,r){tp(e,t,i,r),sm(i,r,i,r)}function Iee(e,t,i,r){tp(e,t,i,r),X0(i,r,i,r)}function Aee(e,t,i){if(e==null||t==null||i.source.spatialReference===e&&i.dest.spatialReference===t)return i;const r=DE(e,i.source),s=DE(t,i.dest);return r===be.UNKNOWN&&s===be.UNKNOWN?Js(e,t)?i.projector=Wi:i.projector=null:i.projector=Gz[r][s],i}function Hz(){return{source:{spatialReference:null,spatialReferenceId:be.UNKNOWN,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:be.UNKNOWN,metersPerUnit:1},projector:Wi}}const Pee={spatialReference:null,spatialReferenceId:be.UNKNOWN},c0e={spatialReference:null,spatialReferenceId:be.UNKNOWN},Wz=Hz(),Om=NN(1),Lm=zN(1),zx=Math.PI,Zz=.5*zx,lp=Or.radius,Wk=lp*zx/180,Zk=180/(lp*zx);function T_(e,t,i,r,s,n,c=1){const o=qz(t,s,Wz);if(o==null)return!1;if(o===Wi){if(e===r&&i===n)return!0;const g=i+3*c;for(let S=i,I=n;S=0;i--){const r=this.steps[i];t.steps.push(r.getInverse())}return t}getGTListEntry(){let t="";for(const i of this.steps)t+=i.uid.toString()+",";return t!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=t),this._gtlistentry}assignCachedGe(t,i,r){this._cachedProjection[$g.cacheKey(t,i)]=r}getCachedGeTransformation(t,i){let r="";for(const n of this.steps)r+=n.uid.toString()+",";r!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=r);const s=this._cachedProjection[$g.cacheKey(t,i)];return s===void 0?null:s}};function Cee(e,t,i){if(t==null||i==null||i.vcsWkid||Js(t,i)||fh(t)||fh(i))return null;const r=C$(t)/C$(i);if(r===1)return null;switch(e){case"point":case"esriGeometryPoint":return s=>$ee(s,r);case"polyline":case"esriGeometryPolyline":return s=>Ree(s,r);case"polygon":case"esriGeometryPolygon":return s=>kee(s,r);case"multipoint":case"esriGeometryMultipoint":return s=>Oee(s,r);case"extent":case"esriGeometryEnvelope":return s=>Lee(s,r);default:return null}}function $ee(e,t){(e==null?void 0:e.z)!=null&&(e.z*=t)}function kee(e,t){if(e)for(const i of e.rings)for(const r of i)r.length>2&&(r[2]*=t)}function Ree(e,t){if(e)for(const i of e.paths)for(const r of i)r.length>2&&(r[2]*=t)}function Oee(e,t){if(e)for(const i of e.points)i.length>2&&(i[2]*=t)}function Lee(e,t){e&&e.zmin!=null&&e.zmax!=null&&(e.zmin*=t,e.zmax*=t)}let qa=null,vh=null,S0=null,ib={};const h3=new g_;function Ah(){return!!qa&&EA()}function Yz(){return!!Ah()||(Rt(h3),bh(),!1)}function Jz(e,t){return!e||!t||Nl(e,t)||Yz()}function Dee(e,t){return!Nl(e,t)&&!Ah()}function bh(e){return S0==null&&(S0=Promise.all([X4(),ht(()=>import("./geometryEngineBase-CDbTTSsS.js"),[]).then(t=>t.g),ht(()=>import("./hydrated-D7zavlGk.js"),[])])),S0.then(([,t,{hydratedAdapter:i}])=>{mr(e),vh=i,qa=t.default,qa._enableProjection(JH),h3.notify()})}function Ph(e,t,i=null,r=null){return Array.isArray(e)?e.length===0?[]:zE(vh,e,e[0].spatialReference,t,i,r):zE(vh,[e],e.spatialReference,t,i,r)[0]}function zE(e,t,i,r,s=null,n=null){if(i==null||r==null)return t;if(Nl(i,r,s))return t.map(c=>rb(c,i,r));if(s==null&&yw(i))return t.map(c=>rb(c,i,yi.WGS84)).map(c=>Q0(c,r));if(s==null&&yw(r))return t.map(c=>Q0(c,yi.WGS84)).map(c=>rb(c,yi.WGS84,r));if(s==null){const c=Aw.cacheKey(i,r);ib[c]!==void 0?s=ib[c]:((s=Xz(i,r,void 0))==null&&(s=new Aw),ib[c]=s)}if(qa==null||e==null)throw new Fx;return n!=null?qa._project(e,t,i,r,s,n):qa._project(e,t,i,r,s)}function Nee(e,t){const i=Kz([e],t);return i.pending!=null?{pending:i.pending,geometry:null}:i.geometries!=null?{pending:null,geometry:i.geometries[0]}:{pending:null,geometry:null}}function Kz(e,t){if(!Ah()){for(const i of e)if(i!=null&&!Js(i.spatialReference,t)&&Ba(i.spatialReference)&&Ba(t)&&!Nl(i.spatialReference,t))return Rt(h3),{pending:bh(),geometries:null}}return{pending:null,geometries:e.map(i=>i==null?null:Js(i.spatialReference,t)?i:Ba(i.spatialReference)&&Ba(t)?Q0(i,t):null)}}function Xz(e,t,i=null){if(e==null||t==null)return null;if(qa==null||vh==null)throw new Fx;const r=qa._getTransformation(vh,e,t,i,i==null?void 0:i.spatialReference);return r!==null?Aw.fromGE(r):null}function zee(e,t,i=null){if(qa==null||vh==null)throw new Fx;const r=qa._getTransformationBySuitability(vh,e,t,i,i==null?void 0:i.spatialReference);if(r!==null){const s=[];for(const n of r)s.push(Aw.fromGE(n));return s}return[]}let Fx=class extends Je{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}};function Fee(){qa=null,vh=null,S0=null,ib={}}const Bee={get loadPromise(){return S0}};function Q0(e,t){try{const i=Ph(e,t);if(i==null)return null;"xmin"in e&&"xmin"in i&&(i.zmin=e.zmin,i.zmax=e.zmax);const r=Cee(i.type,e.spatialReference,t);return r!=null&&r(i),i}catch(i){if(!(i instanceof Fx))throw i;return null}}async function Uee(e,t,i){const r=e.spatialReference;return r!=null&&t!=null&&await d3(r,t,null,i),Q0(e,t)}function Nl(e,t,i){return!i&&(!!Js(e,t)||Ba(e)&&Ba(t)&&!!qz(e,t,Wz))}async function d3(e,t,i,r){if(Ah())return Jb(r);if(Array.isArray(e)){for(const{source:s,dest:n,geographicTransformation:c}of e)if(s&&n&&!Nl(s,n,c))return bh(r)}else if(e&&t&&!Nl(e,t,i))return bh(r);return Jb(r)}function rb(e,t,i){return e?"x"in e?Qz(e,t,new ri,i,0):"xmin"in e?rF(e,t,new Ui,i,0):"rings"in e?iF(e,t,new yh,i,0):"paths"in e?tF(e,t,new Ua,i,0):"points"in e?eF(e,t,new Px,i,0):null:null}function jee(e,t,i=t.spatialReference,r=0){return i!=null&&e.spatialReference!=null&&Qz(e,e.spatialReference,t,i,r)!=null}function Qz(e,t,i,r,s){fn[0]=e.x,fn[1]=e.y;const n=e.z;return fn[2]=n!==void 0?n:s,T_(fn,t,0,fn,r,0,1)?(i.x=fn[0],i.y=fn[1],i.spatialReference=r,n!==void 0||fh(r)?(i.z=fn[2],i.hasZ=!0):(i.z=void 0,i.hasZ=!1),e.m===void 0?(i.m=void 0,i.hasM=!1):(i.m=e.m,i.hasM=!0),i):null}function Vee(e,t,i=t.spatialReference,r=0){return e.spatialReference!=null&&i!=null&&eF(e,e.spatialReference,t,i,r)!=null}function eF(e,t,i,r,s){const{points:n,hasZ:c,hasM:o}=e,f=[],g=n.length,S=[];for(const A of n)S.push(A[0],A[1],c?A[2]:s);if(!T_(S,t,0,S,r,0,g))return null;const I=c||fh(r);for(let A=0;A=0;O--)I.unshift(new kc({level:O,scale:A,resolution:A})),A*=2}return new $u({dpi:96,lods:I,origin:new ri(0,0,s),size:[r,r],spatialReference:s})}const c=ro(s),o=e.origin?new ri({x:e.origin.x,y:e.origin.y,spatialReference:s}):new ri(c?{x:c.origin[0],y:c.origin[1],spatialReference:s}:{x:0,y:0,spatialReference:s}),f=96,g=1/($p(s)*39.37*f),S=[];if(i)for(let I=0;I{r.push(n.scale),t=n.scale>t?n.scale:t,i=n.scale=t.length-1)return t[t.length-1];const i=Math.floor(e),r=i+1;return t[i]/(t[i]/t[r])**(e-i)}scaleToZoom(e){const t=this.scales,i=t.length-1;let r=0;for(;re&&n=t?this.zoomToScale(Math.ceil(i)):this.zoomToScale(Math.floor(i))}tileAt(e,t,i,r){const s=this.lodAt(e);if(!s)return null;let n,c;if(typeof t=="number")n=t,c=i;else if(Js(t.spatialReference,this.spatialReference))n=t.x,c=t.y,r=i;else{const g=wx(t,this.spatialReference);if(g==null)return null;n=g.x,c=g.y,r=i}const o=s.resolution*this.size[0],f=s.resolution*this.size[1];return r||(r=new nF(null,0,0,0,eo())),r.level=e,r.row=Math.floor((this.origin.y-c)/f+.001),r.col=Math.floor((n-this.origin.x)/o+.001),this.updateTileInfo(r),r}updateTileInfo(e,t=$u.ExtrapolateOptions.NONE){let i=this.lodAt(e.level);if(!i&&t===$u.ExtrapolateOptions.POWER_OF_TWO){const c=this.lods[this.lods.length-1];c.levelArray.isArray(e)?e:typeof e=="number"?[e,e]:[256,256]})],qs.prototype,"size",void 0),v([mi("size",["rows","cols"])],qs.prototype,"readSize",null),v([ui("size",{cols:{type:$r},rows:{type:$r}})],qs.prototype,"writeSize",null),v([M({type:yi,json:{write:!0}})],qs.prototype,"spatialReference",void 0),qs=$u=v([fe("esri.layers.support.TileInfo")],qs),function(e){var t;(t=e.ExtrapolateOptions||(e.ExtrapolateOptions={}))[t.NONE=0]="NONE",t[t.POWER_OF_TWO=1]="POWER_OF_TWO"}(qs||(qs={}));const Ep=qs,sb={widthBreakpoint:{getValue(e){const t=e.viewSize[0],i=e.breakpoints,r=this.values;return t<=i.xsmall?r.xsmall:t<=i.small?r.small:t<=i.medium?r.medium:t<=i.large?r.large:r.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-width-xsmall esri-view-width-less-than-small esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",small:"esri-view-width-small esri-view-width-greater-than-xsmall esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",medium:"esri-view-width-medium esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-less-than-large esri-view-width-less-than-xlarge",large:"esri-view-width-large esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-less-than-xlarge",xlarge:"esri-view-width-xlarge esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-greater-than-large"}},heightBreakpoint:{getValue(e){const t=e.viewSize[1],i=e.breakpoints,r=this.values;return t<=i.xsmall?r.xsmall:t<=i.small?r.small:t<=i.medium?r.medium:t<=i.large?r.large:r.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-height-xsmall esri-view-height-less-than-small esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",small:"esri-view-height-small esri-view-height-greater-than-xsmall esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",medium:"esri-view-height-medium esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-less-than-large esri-view-height-less-than-xlarge",large:"esri-view-height-large esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-less-than-xlarge",xlarge:"esri-view-height-xlarge esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-greater-than-large"}},orientation:{getValue(e){const t=e.viewSize,i=t[0],r=t[1],s=this.values;return r>=i?s.portrait:s.landscape},values:{portrait:"portrait",landscape:"landscape"},valueToClassName:{portrait:"esri-view-orientation-portrait",landscape:"esri-view-orientation-landscape"}}},jS={xsmall:544,small:768,medium:992,large:1200};function Zee(e){const t=e;return t&&t.xsmall{let t=class extends e{constructor(...i){super(...i),this.orientation=null,this.widthBreakpoint=null,this.heightBreakpoint=null,this.breakpoints=jS}initialize(){this.addHandles(ti(()=>[this.breakpoints,this.size],()=>this._updateClassNames(),_n))}destroy(){this.destroyed||this._removeActiveClassNames()}set breakpoints(i){if(i===this._get("breakpoints"))return;const r=Zee(i);if(!r){const s=JSON.stringify(jS,null,2);console.warn("provided breakpoints are not valid, using defaults:"+s)}i=r?i:jS,this._set("breakpoints",{...i})}_updateClassNames(){if(!this.container)return;const i=kn.acquire(),r=kn.acquire();let s,n=!1;for(s in sb){const c=this[s],o=sb[s].getValue({viewSize:this.size,breakpoints:this.breakpoints});c!==o&&(n=!0,this[s]=o,VS(s,c).forEach(f=>r.push(f)),VS(s,o).forEach(f=>i.push(f)))}n&&(this._applyClassNameChanges(i,r),kn.release(i),kn.release(r))}_applyClassNameChanges(i,r){const s=this.container;s&&(r.forEach(n=>s.classList.remove(n)),i.forEach(n=>s.classList.add(n)))}_removeActiveClassNames(){const i=this.container;if(!i)return;let r;for(r in sb)VS(r,this[r]).forEach(s=>i.classList.remove(s))}};return v([M()],t.prototype,"breakpoints",null),v([M()],t.prototype,"orientation",void 0),v([M()],t.prototype,"widthBreakpoint",void 0),v([M()],t.prototype,"heightBreakpoint",void 0),t=v([fe("esri.views.BreakpointsOwner")],t),t};function p3(e){return typeof e=="string"?document.getElementById(e):e??null}function oF(e){for(;e.hasChildNodes();)e.removeChild(e.firstChild)}function Kk(e,t){const i=t.parentNode;i&&i.insertBefore(e,t)}function Xk(e,t){for(;;){const i=e.firstChild;if(!i)break;t.appendChild(i)}}let cp=class extends Nt{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll()}add(t,i,r={}){return this._installWatch(t,i,r,ti)}addWhen(t,i,r={}){return this._installWatch(t,i,r,gh)}addOnCollectionChange(t,i,{initial:r=!1,final:s=!1}={}){const n=++this._handleId;return this.addHandles([Sp(t,"after-changes",this._createSyncUpdatingCallback(),Tp),Sp(t,"change",i,{onListenerAdd:r?c=>i({added:c.toArray(),removed:[]}):void 0,onListenerRemove:s?c=>i({added:[],removed:c.toArray()}):void 0})],n),er(()=>this.removeHandles(n))}addPromise(t){if(t==null)return t;const i=++this._handleId;this.addHandles(er(()=>{this._pendingPromises.delete(t)&&(this._pendingPromises.size!==0||this.hasHandles(gv)||this._set("updating",!1))}),i),this._pendingPromises.add(t),this._set("updating",!0);const r=()=>this.removeHandles(i);return t.then(r,r),t}removeAll(){this._pendingPromises.clear(),this.removeAllHandles(),this._set("updating",!1)}_installWatch(t,i,r={},s){const n=++this._handleId;r.sync||this._installSyncUpdatingWatch(t,n);const c=s(t,i,r);return this.addHandles(c,n),er(()=>this.removeHandles(n))}_installSyncUpdatingWatch(t,i){const r=this._createSyncUpdatingCallback(),s=ti(t,r,{sync:!0,equals:()=>!1});return this.addHandles(s,i),s}_createSyncUpdatingCallback(){return()=>{this.removeHandles(gv),++this._scheduleHandleId;const t=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this.addHandles(m_(()=>{t===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this.removeHandles(gv))}),gv)}}};v([M({readOnly:!0})],cp.prototype,"updating",void 0),cp=v([fe("esri.core.support.UpdatingHandles")],cp);const gv=-42;/*! * @esri/arcgis-html-sanitizer - v3.0.1 - Tue Nov 15 2022 09:46:54 GMT-0800 (Pacific Standard Time) * Copyright (c) 2022 - Environmental Systems Research Institute, Inc. * Apache-2.0 @@ -41,7 +41,7 @@ var ZV=Object.defineProperty;var YV=(e,t,i)=>t in e?ZV(e,t,{enumerable:!0,config * http://ucdok.com * MIT License, see https://github.com/leizongmin/js-xss/blob/master/LICENSE for details */var Jee=function(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t},Fd={exports:{}},Lr={},e_={exports:{}},Rp={};function aF(){var e={};return e["align-content"]=!1,e["align-items"]=!1,e["align-self"]=!1,e["alignment-adjust"]=!1,e["alignment-baseline"]=!1,e.all=!1,e["anchor-point"]=!1,e.animation=!1,e["animation-delay"]=!1,e["animation-direction"]=!1,e["animation-duration"]=!1,e["animation-fill-mode"]=!1,e["animation-iteration-count"]=!1,e["animation-name"]=!1,e["animation-play-state"]=!1,e["animation-timing-function"]=!1,e.azimuth=!1,e["backface-visibility"]=!1,e.background=!0,e["background-attachment"]=!0,e["background-clip"]=!0,e["background-color"]=!0,e["background-image"]=!0,e["background-origin"]=!0,e["background-position"]=!0,e["background-repeat"]=!0,e["background-size"]=!0,e["baseline-shift"]=!1,e.binding=!1,e.bleed=!1,e["bookmark-label"]=!1,e["bookmark-level"]=!1,e["bookmark-state"]=!1,e.border=!0,e["border-bottom"]=!0,e["border-bottom-color"]=!0,e["border-bottom-left-radius"]=!0,e["border-bottom-right-radius"]=!0,e["border-bottom-style"]=!0,e["border-bottom-width"]=!0,e["border-collapse"]=!0,e["border-color"]=!0,e["border-image"]=!0,e["border-image-outset"]=!0,e["border-image-repeat"]=!0,e["border-image-slice"]=!0,e["border-image-source"]=!0,e["border-image-width"]=!0,e["border-left"]=!0,e["border-left-color"]=!0,e["border-left-style"]=!0,e["border-left-width"]=!0,e["border-radius"]=!0,e["border-right"]=!0,e["border-right-color"]=!0,e["border-right-style"]=!0,e["border-right-width"]=!0,e["border-spacing"]=!0,e["border-style"]=!0,e["border-top"]=!0,e["border-top-color"]=!0,e["border-top-left-radius"]=!0,e["border-top-right-radius"]=!0,e["border-top-style"]=!0,e["border-top-width"]=!0,e["border-width"]=!0,e.bottom=!1,e["box-decoration-break"]=!0,e["box-shadow"]=!0,e["box-sizing"]=!0,e["box-snap"]=!0,e["box-suppress"]=!0,e["break-after"]=!0,e["break-before"]=!0,e["break-inside"]=!0,e["caption-side"]=!1,e.chains=!1,e.clear=!0,e.clip=!1,e["clip-path"]=!1,e["clip-rule"]=!1,e.color=!0,e["color-interpolation-filters"]=!0,e["column-count"]=!1,e["column-fill"]=!1,e["column-gap"]=!1,e["column-rule"]=!1,e["column-rule-color"]=!1,e["column-rule-style"]=!1,e["column-rule-width"]=!1,e["column-span"]=!1,e["column-width"]=!1,e.columns=!1,e.contain=!1,e.content=!1,e["counter-increment"]=!1,e["counter-reset"]=!1,e["counter-set"]=!1,e.crop=!1,e.cue=!1,e["cue-after"]=!1,e["cue-before"]=!1,e.cursor=!1,e.direction=!1,e.display=!0,e["display-inside"]=!0,e["display-list"]=!0,e["display-outside"]=!0,e["dominant-baseline"]=!1,e.elevation=!1,e["empty-cells"]=!1,e.filter=!1,e.flex=!1,e["flex-basis"]=!1,e["flex-direction"]=!1,e["flex-flow"]=!1,e["flex-grow"]=!1,e["flex-shrink"]=!1,e["flex-wrap"]=!1,e.float=!1,e["float-offset"]=!1,e["flood-color"]=!1,e["flood-opacity"]=!1,e["flow-from"]=!1,e["flow-into"]=!1,e.font=!0,e["font-family"]=!0,e["font-feature-settings"]=!0,e["font-kerning"]=!0,e["font-language-override"]=!0,e["font-size"]=!0,e["font-size-adjust"]=!0,e["font-stretch"]=!0,e["font-style"]=!0,e["font-synthesis"]=!0,e["font-variant"]=!0,e["font-variant-alternates"]=!0,e["font-variant-caps"]=!0,e["font-variant-east-asian"]=!0,e["font-variant-ligatures"]=!0,e["font-variant-numeric"]=!0,e["font-variant-position"]=!0,e["font-weight"]=!0,e.grid=!1,e["grid-area"]=!1,e["grid-auto-columns"]=!1,e["grid-auto-flow"]=!1,e["grid-auto-rows"]=!1,e["grid-column"]=!1,e["grid-column-end"]=!1,e["grid-column-start"]=!1,e["grid-row"]=!1,e["grid-row-end"]=!1,e["grid-row-start"]=!1,e["grid-template"]=!1,e["grid-template-areas"]=!1,e["grid-template-columns"]=!1,e["grid-template-rows"]=!1,e["hanging-punctuation"]=!1,e.height=!0,e.hyphens=!1,e.icon=!1,e["image-orientation"]=!1,e["image-resolution"]=!1,e["ime-mode"]=!1,e["initial-letters"]=!1,e["inline-box-align"]=!1,e["justify-content"]=!1,e["justify-items"]=!1,e["justify-self"]=!1,e.left=!1,e["letter-spacing"]=!0,e["lighting-color"]=!0,e["line-box-contain"]=!1,e["line-break"]=!1,e["line-grid"]=!1,e["line-height"]=!1,e["line-snap"]=!1,e["line-stacking"]=!1,e["line-stacking-ruby"]=!1,e["line-stacking-shift"]=!1,e["line-stacking-strategy"]=!1,e["list-style"]=!0,e["list-style-image"]=!0,e["list-style-position"]=!0,e["list-style-type"]=!0,e.margin=!0,e["margin-bottom"]=!0,e["margin-left"]=!0,e["margin-right"]=!0,e["margin-top"]=!0,e["marker-offset"]=!1,e["marker-side"]=!1,e.marks=!1,e.mask=!1,e["mask-box"]=!1,e["mask-box-outset"]=!1,e["mask-box-repeat"]=!1,e["mask-box-slice"]=!1,e["mask-box-source"]=!1,e["mask-box-width"]=!1,e["mask-clip"]=!1,e["mask-image"]=!1,e["mask-origin"]=!1,e["mask-position"]=!1,e["mask-repeat"]=!1,e["mask-size"]=!1,e["mask-source-type"]=!1,e["mask-type"]=!1,e["max-height"]=!0,e["max-lines"]=!1,e["max-width"]=!0,e["min-height"]=!0,e["min-width"]=!0,e["move-to"]=!1,e["nav-down"]=!1,e["nav-index"]=!1,e["nav-left"]=!1,e["nav-right"]=!1,e["nav-up"]=!1,e["object-fit"]=!1,e["object-position"]=!1,e.opacity=!1,e.order=!1,e.orphans=!1,e.outline=!1,e["outline-color"]=!1,e["outline-offset"]=!1,e["outline-style"]=!1,e["outline-width"]=!1,e.overflow=!1,e["overflow-wrap"]=!1,e["overflow-x"]=!1,e["overflow-y"]=!1,e.padding=!0,e["padding-bottom"]=!0,e["padding-left"]=!0,e["padding-right"]=!0,e["padding-top"]=!0,e.page=!1,e["page-break-after"]=!1,e["page-break-before"]=!1,e["page-break-inside"]=!1,e["page-policy"]=!1,e.pause=!1,e["pause-after"]=!1,e["pause-before"]=!1,e.perspective=!1,e["perspective-origin"]=!1,e.pitch=!1,e["pitch-range"]=!1,e["play-during"]=!1,e.position=!1,e["presentation-level"]=!1,e.quotes=!1,e["region-fragment"]=!1,e.resize=!1,e.rest=!1,e["rest-after"]=!1,e["rest-before"]=!1,e.richness=!1,e.right=!1,e.rotation=!1,e["rotation-point"]=!1,e["ruby-align"]=!1,e["ruby-merge"]=!1,e["ruby-position"]=!1,e["shape-image-threshold"]=!1,e["shape-outside"]=!1,e["shape-margin"]=!1,e.size=!1,e.speak=!1,e["speak-as"]=!1,e["speak-header"]=!1,e["speak-numeral"]=!1,e["speak-punctuation"]=!1,e["speech-rate"]=!1,e.stress=!1,e["string-set"]=!1,e["tab-size"]=!1,e["table-layout"]=!1,e["text-align"]=!0,e["text-align-last"]=!0,e["text-combine-upright"]=!0,e["text-decoration"]=!0,e["text-decoration-color"]=!0,e["text-decoration-line"]=!0,e["text-decoration-skip"]=!0,e["text-decoration-style"]=!0,e["text-emphasis"]=!0,e["text-emphasis-color"]=!0,e["text-emphasis-position"]=!0,e["text-emphasis-style"]=!0,e["text-height"]=!0,e["text-indent"]=!0,e["text-justify"]=!0,e["text-orientation"]=!0,e["text-overflow"]=!0,e["text-shadow"]=!0,e["text-space-collapse"]=!0,e["text-transform"]=!0,e["text-underline-position"]=!0,e["text-wrap"]=!0,e.top=!1,e.transform=!1,e["transform-origin"]=!1,e["transform-style"]=!1,e.transition=!1,e["transition-delay"]=!1,e["transition-duration"]=!1,e["transition-property"]=!1,e["transition-timing-function"]=!1,e["unicode-bidi"]=!1,e["vertical-align"]=!1,e.visibility=!1,e["voice-balance"]=!1,e["voice-duration"]=!1,e["voice-family"]=!1,e["voice-pitch"]=!1,e["voice-range"]=!1,e["voice-rate"]=!1,e["voice-stress"]=!1,e["voice-volume"]=!1,e.volume=!1,e["white-space"]=!1,e.widows=!1,e.width=!0,e["will-change"]=!1,e["word-break"]=!0,e["word-spacing"]=!0,e["word-wrap"]=!0,e["wrap-flow"]=!1,e["wrap-through"]=!1,e["writing-mode"]=!1,e["z-index"]=!1,e}function Kee(e,t,i){}function Xee(e,t,i){}var Qee=/javascript\s*\:/img;function ete(e,t){return Qee.test(t)?"":t}Rp.whiteList=aF();Rp.getDefaultWhiteList=aF;Rp.onAttr=Kee;Rp.onIgnoreAttr=Xee;Rp.safeAttrValue=ete;var tte={indexOf:function(e,t){var i,r;if(Array.prototype.indexOf)return e.indexOf(t);for(i=0,r=e.length;i/g,yte=/"/g,gte=/"/g,_te=/&#([a-zA-Z0-9]*);?/gim,vte=/:?/gim,bte=/&newline;?/gim,vv=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,eR=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,tR=/u\s*r\s*l\s*\(.*/gi;function dF(e){return e.replace(yte,""")}function pF(e){return e.replace(gte,'"')}function fF(e){return e.replace(_te,function(i,r){return r[0]==="x"||r[0]==="X"?String.fromCharCode(parseInt(r.substr(1),16)):String.fromCharCode(parseInt(r,10))})}function mF(e){return e.replace(vte,":").replace(bte," ")}function yF(e){for(var t="",i=0,r=e.length;i",r);if(s===-1)break;i=s+3}return t}function Tte(e){var t=e.split("");return t=t.filter(function(i){var r=i.charCodeAt(0);return r===127?!1:r<=31?r===10||r===13:!0}),t.join("")}Lr.whiteList=cF();Lr.getDefaultWhiteList=cF;Lr.onTag=cte;Lr.onIgnoreTag=ute;Lr.onTagAttr=hte;Lr.onIgnoreTagAttr=dte;Lr.safeAttrValue=pte;Lr.escapeHtml=hF;Lr.escapeQuote=dF;Lr.unescapeQuote=pF;Lr.escapeHtmlEntities=fF;Lr.escapeDangerHtml5Entities=mF;Lr.clearNonPrintableCharacter=yF;Lr.friendlyAttrValue=gF;Lr.escapeAttrValue=_F;Lr.onIgnoreTagStripAll=wte;Lr.StripTagBody=xte;Lr.stripCommentTag=Ste;Lr.stripBlankChar=Tte;Lr.cssFilter=uF;Lr.getDefaultCSSWhiteList=lte;var Bx={},Qu=f3;function Ete(e){var t=Qu.spaceIndex(e),i;return t===-1?i=e.slice(1,-1):i=e.slice(1,t+1),i=Qu.trim(i).toLowerCase(),i.slice(0,1)==="/"&&(i=i.slice(1)),i.slice(-1)==="/"&&(i=i.slice(0,-1)),i}function Mte(e){return e.slice(0,2)===""){r+=i(e.slice(s,n)),S=e.slice(n,o+1),g=Ete(S),r+=t(n,r.length,g,S,Mte(S)),s=o+1,n=!1;continue}if(I==='"'||I==="'")for(var A=1,O=e.charAt(o-A);O.trim()===""||O==="=";){if(O==="="){c=I;continue e}O=e.charAt(o-++A)}}else if(I===c){c=!1;continue}}return s0;t--){var i=e[t];if(i!==" ")return i==="="?t:-1}}function Rte(e){return e[0]==='"'&&e[e.length-1]==='"'||e[0]==="'"&&e[e.length-1]==="'"}function iR(e){return Rte(e)?e.substr(1,e.length-2):e}Bx.parseTag=Ite;Bx.parseAttr=Pte;var Ote=e_.exports.FilterCSS,Ra=Lr,vF=Bx,Lte=vF.parseTag,Dte=vF.parseAttr,nb=f3;function bv(e){return e==null}function Nte(e){var t=nb.spaceIndex(e);if(t===-1)return{html:"",closing:e[e.length-2]==="/"};e=nb.trim(e.slice(t+1,-1));var i=e[e.length-1]==="/";return i&&(e=nb.trim(e.slice(0,-1))),{html:e,closing:i}}function zte(e){var t={};for(var i in e)t[i]=e[i];return t}function Fte(e){var t={};for(var i in e)Array.isArray(e[i])?t[i.toLowerCase()]=e[i].map(function(r){return r.toLowerCase()}):t[i.toLowerCase()]=e[i];return t}function bF(e){e=zte(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=Ra.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=Fte(e.whiteList||e.allowList):e.whiteList=Ra.whiteList,e.onTag=e.onTag||Ra.onTag,e.onTagAttr=e.onTagAttr||Ra.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||Ra.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||Ra.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||Ra.safeAttrValue,e.escapeHtml=e.escapeHtml||Ra.escapeHtml,this.options=e,e.css===!1?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new Ote(e.css))}bF.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,i=t.options,r=i.whiteList,s=i.onTag,n=i.onIgnoreTag,c=i.onTagAttr,o=i.onIgnoreTagAttr,f=i.safeAttrValue,g=i.escapeHtml,S=t.cssFilter;i.stripBlankChar&&(e=Ra.stripBlankChar(e)),i.allowCommentTag||(e=Ra.stripCommentTag(e));var I=!1;i.stripIgnoreTagBody&&(I=Ra.StripTagBody(i.stripIgnoreTagBody,n),n=I.onIgnoreTag);var A=Lte(e,function(O,z,V,H,Q){var ve={sourcePosition:O,position:z,isClosing:Q,isWhite:Object.prototype.hasOwnProperty.call(r,V)},me=s(V,H,ve);if(!bv(me))return me;if(ve.isWhite){if(ve.isClosing)return"";var ge=Nte(H),Ie=r[V],Ce=Dte(ge.html,function(ze,je){var tt=nb.indexOf(Ie,ze)!==-1,ut=c(V,ze,je,tt);return bv(ut)?tt?(je=f(V,ze,je,S),je?ze+'="'+je+'"':ze):(ut=o(V,ze,je,tt),bv(ut)?void 0:ut):ut});return H="<"+V,Ce&&(H+=" "+Ce),ge.closing&&(H+=" /"),H+=">",H}else return me=n(V,H,ve),bv(me)?g(H):me},g);return I&&(A=I.remove(A)),A};var Bte=bF;(function(e,t){var i=Lr,r=Bx,s=Bte;function n(o,f){var g=new s(f);return g.process(o)}t=e.exports=n,t.filterXSS=n,t.FilterXSS=s,function(){for(var o in i)t[o]=i[o];for(var f in r)t[f]=r[f]}();function c(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}c()&&(self.filterXSS=e.exports)})(Fd,Fd.exports);var Ute=function(){function e(t,i){var r=this;this.arcgisWhiteList={a:["href","style","target"],abbr:["title"],audio:["autoplay","controls","loop","muted","preload"],b:[],br:[],dd:["style"],div:["align","style"],dl:["style"],dt:["style"],em:[],figcaption:["style"],figure:["style"],font:["color","face","size","style"],h1:["style"],h2:["style"],h3:["style"],h4:["style"],h5:["style"],h6:["style"],hr:[],i:[],img:["alt","border","height","src","style","width"],li:[],ol:[],p:["style"],source:["media","src","type"],span:["style"],strong:[],sub:["style"],sup:["style"],table:["border","cellpadding","cellspacing","height","style","width"],tbody:[],tr:["align","height","style","valign"],td:["align","colspan","height","nowrap","rowspan","style","valign","width"],th:["align","colspan","height","nowrap","rowspan","style","valign","width"],u:[],ul:[],video:["autoplay","controls","height","loop","muted","poster","preload","width"]},this.allowedProtocols=["http","https","mailto","iform","tel","flow","lfmobile","arcgis-navigator","arcgis-appstudio-player","arcgis-survey123","arcgis-collector","arcgis-workforce","arcgis-explorer","arcgis-trek2there","arcgis-quickcapture","mspbi","comgooglemaps","pdfefile","pdfehttp","pdfehttps","boxapp","boxemm","awb","awbs","gropen","radarscope"],this.arcgisFilterOptions={allowCommentTag:!0,safeAttrValue:function(n,c,o,f){return n==="a"&&c==="href"||(n==="img"||n==="source")&&c==="src"?r.sanitizeUrl(o):Fd.exports.safeAttrValue(n,c,o,f)}},this._entityMap={"&":"8","<":"<",">":">",'"':""","'":"'","/":"/"};var s;t&&!i?s=t:t&&i?(s=Object.create(this.arcgisFilterOptions),Object.keys(t).forEach(function(n){n==="whiteList"?s.whiteList=r._extendObjectOfArrays([r.arcgisWhiteList,t.whiteList||{}]):s[n]=t[n]})):(s=Object.create(this.arcgisFilterOptions),s.whiteList=this.arcgisWhiteList),this.xssFilterOptions=s,this._xssFilter=new Fd.exports.FilterXSS(s)}return e.prototype.sanitize=function(t,i){switch(i===void 0&&(i={}),typeof t){case"number":return isNaN(t)||!isFinite(t)?null:t;case"boolean":return t;case"string":return this._xssFilter.process(t);case"object":return this._iterateOverObject(t,i);default:return i.allowUndefined&&typeof t>"u"?void 0:null}},e.prototype.sanitizeUrl=function(t,i){var r=(i??{}).isProtocolRequired,s=r===void 0?!0:r,n=this._trim(t.substring(0,t.indexOf(":"))),c=t==="/",o=/^#/.test(t),f=n&&this.allowedProtocols.indexOf(n.toLowerCase())>-1;return c||o||f?Fd.exports.escapeAttrValue(t):!n&&!s?Fd.exports.escapeAttrValue("https://".concat(t)):""},e.prototype.sanitizeHTMLAttribute=function(t,i,r,s){return typeof this.xssFilterOptions.safeAttrValue=="function"?this.xssFilterOptions.safeAttrValue(t,i,r,s):Fd.exports.safeAttrValue(t,i,r,s)},e.prototype.validate=function(t,i){i===void 0&&(i={});var r=this.sanitize(t,i);return{isValid:t===r,sanitized:r}},e.prototype.encodeHTML=function(t){var i=this;return String(t).replace(/[&<>"'\/]/g,function(r){return i._entityMap[r]})},e.prototype.encodeAttrValue=function(t){var i=/^[a-zA-Z0-9]$/;return String(t).replace(/[\x00-\xFF]/g,function(r,s){return i.test(r)?r:"&#x".concat(Number(t.charCodeAt(s)).toString(16),";")})},e.prototype._extendObjectOfArrays=function(t){var i={};return t.forEach(function(r){Object.keys(r).forEach(function(s){Array.isArray(r[s])&&Array.isArray(i[s])?i[s]=i[s].concat(r[s]):i[s]=r[s]})}),i},e.prototype._iterateOverObject=function(t,i){var r=this;i===void 0&&(i={});try{var s=!1,n=void 0;if(Array.isArray(t))n=t.reduce(function(o,f){var g=r.validate(f,i);return g.isValid?o.concat([f]):(s=!0,o.concat([g.sanitized]))},[]);else if(Jee(t)){var c=Object.keys(t);n=c.reduce(function(o,f){var g=t[f],S=r.validate(g,i);return S.isValid?o[f]=g:(s=!0,o[f]=S.sanitized),o},{})}else return i.allowUndefined&&typeof t>"u"?void 0:null;return s?n:t}catch{return null}},e.prototype._trim=function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},e}();const Ux=new Map;function wF(){Ux.clear()}function jte(e){return Ux.get(e)}function Vte(e,t){Ux.set(e,t)}function GS(e){Ux.delete(e)}const Gte=()=>_t.getLogger("esri.widgets.support.widgetUtils");function qte(...e){const t=kn.acquire();for(let r=0;r{const e=new Map,t=new ResizeObserver(r=>{var s;wF();for(const n of r)(s=e.get(n.target))==null||s(n)}),i=(r,s,n)=>(e.has(r)&&Gte().error("Already observing element",r),e.set(r,s),t.observe(r,n),er(()=>{t.unobserve(r),e.delete(r)}));return(r,s,n)=>{let c=null;return h_([ti(()=>typeof r=="function"?r():r,o=>{c==null||c.remove(),o&&(c=i(o,s,n))},Fa),er(()=>c==null?void 0:c.remove())])}})();function Hte(e){const t=e==null?void 0:e.closest("[dir]");return t!==null&&t instanceof HTMLElement&&t.dir==="rtl"||document.dir==="rtl"}function m0e(e){const t="data-node-ref";this[e.getAttribute(t)]=null}function y0e(e){const t="data-node-ref";this[e.getAttribute(t)]=e}const Wte=["dd","dl","dt","h1","h2","h3","h4","h5","h6","sub","sup","animate","animatetransform","circle","clippath","defs","ellipse","g","image","line","lineargradient","marker","mask","path","pattern","polygon","polyline","radialgradient","rect","stop","svg","switch","symbol","text","textpath","tspan","use"],Zte=Wte.reduce((e,t)=>(e[t]=[],e),{}),Yte=["align","alink","alt","bgcolor","border","cellpadding","cellspacing","class","color","cols","colspan","coords","d","dir","face","height","hspace","ismap","lang","marginheight","marginwidth","multiple","nohref","noresize","noshade","nowrap","ref","rel","rev","rows","rowspan","scrolling","shape","span","summary","tabindex","title","usemap","valign","value","vlink","vspace","width"],xF=new Ute({whiteList:Zte,onTagAttr:(e,t,i)=>{const r=`${t}="${i}"`;if(Yte.includes(t))return r},stripIgnoreTag:!0,stripIgnoreTagBody:["script","style"]},!0);function Jte(e){return e==="Enter"||e===" "}const SF="http://www.w3.org/",jx=`${SF}2000/svg`,TF=`${SF}1999/xlink`;let rR=[],m3=(e,t)=>{let i={};return Object.keys(e).forEach(r=>{i[r]=e[r]}),t&&Object.keys(t).forEach(r=>{i[r]=t[r]}),i},y3=(e,t)=>e.vnodeSelector===t.vnodeSelector&&(e.properties&&t.properties?e.properties.key===t.properties.key&&e.properties.bind===t.properties.bind:!e.properties&&!t.properties),EF=e=>{if(typeof e!="string")throw new Error("Style values must be strings")},Kte=(e,t,i)=>{if(t.vnodeSelector!==""){for(let r=i;r{let s=e[t];if(s.vnodeSelector==="")return;let n=s.properties;if(!(n&&(n.key===void 0?n.bind:n.key))){for(let c=0;c{if(e.properties){let t=e.properties.enterAnimation;t&&t(e.domNode,e.properties)}},BE=[],UE=!1,MF=e=>{(e.children||[]).forEach(MF),e.properties&&e.properties.afterRemoved&&e.properties.afterRemoved.apply(e.properties.bind||e.properties,[e.domNode])},sR=()=>{UE=!1,BE.forEach(MF),BE.length=0},nR=e=>{BE.push(e),UE||(UE=!0,typeof window<"u"&&"requestIdleCallback"in window?window.requestIdleCallback(sR,{timeout:16}):setTimeout(sR,16))},oR=e=>{let t=e.domNode;if(e.properties){let i=e.properties.exitAnimation;if(i)return t.style.pointerEvents="none",void i(t,()=>{t.parentNode&&(t.parentNode.removeChild(t),nR(e))},e.properties)}t.parentNode&&(t.parentNode.removeChild(t),nR(e))},Qte=(e,t,i)=>{if(!t)return;let r=i.eventHandlerInterceptor,s=Object.keys(t),n=s.length;for(let c=0;c{if(t)for(let r of t)nm(r,e,void 0,i)},IF=(e,t,i)=>{eie(e,t.children,i),t.text&&(e.textContent=t.text),Qte(e,t.properties,i),t.properties&&t.properties.afterCreate&&t.properties.afterCreate.apply(t.properties.bind||t.properties,[e,i,t.vnodeSelector,t.properties,t.children])},nm=(e,t,i,r)=>{let s,n=0,c=e.vnodeSelector,o=t.ownerDocument;if(c==="")s=e.domNode=o.createTextNode(e.text),i!==void 0?t.insertBefore(s,i):t.appendChild(s);else{for(let f=0;f<=c.length;++f){let g=c.charAt(f);if(f===c.length||g==="."||g==="#"){let S=c.charAt(n-1),I=c.slice(n,f);S==="."?s.classList.add(I):S==="#"?s.id=I:(I==="svg"&&(r=m3(r,{namespace:jx})),r.namespace!==void 0?s=e.domNode=o.createElementNS(r.namespace,I):(s=e.domNode=e.domNode||o.createElement(I),I==="input"&&e.properties&&e.properties.type!==void 0&&s.setAttribute("type",e.properties.type)),i!==void 0?t.insertBefore(s,i):s.parentNode!==t&&t.appendChild(s)),n=f+1}}IF(s,e,r)}},VE=(e,t,i)=>{t&&t.split(" ").forEach(r=>{r&&e.classList.toggle(r,i)})},tie=(e,t,i,r)=>{if(!i)return;let s=!1,n=Object.keys(i),c=n.length;for(let o=0;o{if(i===r)return!1;r=r||rR;let n,c=(i=i||rR).length,o=r.length,f=0,g=0,S=!1;for(;g=0){for(n=f;nf)for(n=f;n{let r=e.domNode,s=!1;if(e===t)return!1;let n=!1;if(t.vnodeSelector===""){if(t.text!==e.text){let c=r.ownerDocument.createTextNode(t.text);return r.parentNode.replaceChild(c,r),t.domNode=c,s=!0,s}t.domNode=r}else t.vnodeSelector.lastIndexOf("svg",0)===0&&(i=m3(i,{namespace:jx})),e.text!==t.text&&(n=!0,t.text===void 0?r.removeChild(r.firstChild):r.textContent=t.text),t.domNode=r,n=iie(t,r,e.children,t.children,i)||n,n=tie(r,e.properties,t.properties,i)||n,t.properties&&t.properties.afterUpdate&&t.properties.afterUpdate.apply(t.properties.bind||t.properties,[r,i,t.vnodeSelector,t.properties,t.children]);return n&&t.properties&&t.properties.updateAnimation&&t.properties.updateAnimation(r,t.properties,e.properties),s};let bg=(e,t)=>({getLastRender:()=>e,update:i=>{if(e.vnodeSelector!==i.vnodeSelector)throw new Error("The selector for the root VNode may not be changed. (consider using dom.merge and add one extra level to the virtual DOM)");let r=e;e=i,Cw(r,i,t)},domNode:e.domNode});const rie={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,t,i)=>{t.charAt(0)==="-"?e.style.setProperty(t,i):e.style[t]=i}};let Lf=e=>m3(rie,e),lh={create:(e,t)=>(t=Lf(t),nm(e,document.createElement("div"),void 0,t),bg(e,t)),append:(e,t,i)=>(i=Lf(i),nm(t,e,void 0,i),bg(t,i)),insertBefore:(e,t,i)=>(i=Lf(i),nm(t,e.parentNode,e,i),bg(t,i)),merge:(e,t,i)=>(i=Lf(i),t.domNode=e,IF(e,t,i),bg(t,i)),replace:(e,t,i)=>(i=Lf(i),nm(t,e.parentNode,e,i),e.parentNode.removeChild(e),bg(t,i))},AF,sie=(e,t)=>{let i=[];for(;e&&e!==t;)i.push(e),e=e.parentNode;return i};AF=Array.prototype.find?(e,t)=>e.find(t):(e,t)=>e.filter(t)[0];let nie=(e,t)=>{let i=e;return t.forEach(r=>{i=i&&i.children?AF(i.children,s=>s.domNode===r):void 0}),i},oie=(e,t,i)=>{let r=function(s){i("domEvent",s);let n=t(),c=sie(s.currentTarget,n.domNode);c.reverse();let o,f=nie(n.getLastRender(),c);return e.scheduleRender(),f&&(o=f.properties[`on${s.type}`].apply(f.properties.bind||this,arguments)),i("domEventProcessed",s),o};return(s,n,c,o)=>r},aR=e=>{let t,i,r=Lf(e),s=r.performanceLogger,n=!0,c=!1,o=[],f=[],g=(I,A,O)=>{let z,V=()=>z;r.eventHandlerInterceptor=oie(t,V,s),z=I(A,O(),r),o.push(z),f.push(O)},S=()=>{if(i=void 0,n){n=!1,s("renderStart",void 0);for(let I=0;I{i||c||(i=requestAnimationFrame(S))},stop:()=>{i&&(cancelAnimationFrame(i),i=void 0),c=!0},resume:()=>{c=!1,n=!0,t.scheduleRender()},append:(I,A)=>{g(lh.append,I,A)},insertBefore:(I,A)=>{g(lh.insertBefore,I,A)},merge:(I,A)=>{g(lh.merge,I,A)},replace:(I,A)=>{g(lh.replace,I,A)},detach:I=>{for(let A=0;A0}get updating(){var t;return((t=this._watchUpdatingTracking)==null?void 0:t.updating)??!1}initialize(){const t=document.createElement("div");t.className="esri-overlay-surface",this._set("surface",t),this._hiddenSurface=document.createElement("div"),this._hiddenSurface.setAttribute("style","visibility: hidden;"),t.appendChild(this._hiddenSurface),this._watchUpdatingTracking.addOnCollectionChange(()=>this.items,i=>{for(const r of i.added){const s=()=>r.render();this._callbacks.set(r,s),this._projector.append(this.surface,s)}for(const r of i.removed){const s=this._projector.detach(this._callbacks.get(r));this.surface.removeChild(s.domNode),this._callbacks.delete(r)}})}addItem(t){this.items.add(t)}removeItem(t){this.items.remove(t)}destroy(){this.items.removeAll(),this._callbacks.forEach(t=>this._projector.detach(t)),this._callbacks=null,this._projector=null,this._watchUpdatingTracking.destroy()}render(){this._projector.renderNow()}computeBoundingRect(t){const i=this._hiddenSurface,r=this._hiddenProjector;let s;const n=()=>(s=t.render(),s);r.append(i,n),r.renderNow();const c={left:0,top:0,right:0,bottom:0};if(s!=null&&s.domNode){const o=s.domNode.getBoundingClientRect();c.left=o.left,c.top=o.top,c.right=o.right,c.bottom=o.bottom}for(r.detach(n);i.firstChild;)i.removeChild(i.firstChild);return c}overlaps(t,i){const r=this.computeBoundingRect(t),s=this.computeBoundingRect(i);return Math.max(r.left,s.left)<=Math.min(r.right,s.right)&&Math.max(r.top,s.top)<=Math.min(r.bottom,s.bottom)}get hasVisibleItems(){return this.items.some(t=>t.visible)}async prepare(){await document.fonts.load(this._fontString()).catch(()=>{})}renderCanvas(t,i){const r=!!(i!=null&&i.disableDecorations);if(!this.items.some(n=>n.visible&&!(r&&n.isDecoration)))return;const s=t.getContext("2d");s.save(),s.font=this._fontString(),this.items.forEach(n=>{r&&n.isDecoration||(s.save(),n.renderCanvas(s),s.restore())}),s.restore()}_fontString(){return`10px ${getComputedStyle(this.surface).fontFamily}`}};v([M({readOnly:!0})],ku.prototype,"surface",void 0),v([M({readOnly:!0})],ku.prototype,"items",void 0),v([M({readOnly:!0})],ku.prototype,"needsRender",null),v([M({readOnly:!0})],ku.prototype,"_watchUpdatingTracking",void 0),v([M({readOnly:!0})],ku.prototype,"updating",null),ku=v([fe("esri.views.overlay.ViewOverlay")],ku);const lR=ku,HS=[0,0];function aie(e){const t=(e.ownerDocument||window.document).defaultView,i=e.getBoundingClientRect();return HS[0]=i.left+((t==null?void 0:t.pageXOffset)??0),HS[1]=i.top+((t==null?void 0:t.pageYOffset)??0),HS}function cR(e){e&&(oF(e),e.parentNode&&e.parentNode.removeChild(e))}function lie(e){const t=document.createElement("div");return e.appendChild(t),t}const wg=16,wv=750,cie=512,uie=2,hie=e=>{let t=class extends e{constructor(...i){super(...i),this._freqInfo={freq:wg,time:wv},this._overlayRenderTaskHandle=null,this.height=0,this.messagesCommon=null,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.ui=null,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([ti(()=>this.cursor,r=>{const{surface:s}=this;s&&s.setAttribute("data-cursor",r)}),ti(()=>this.navigating,r=>{const{surface:s}=this;s&&s.setAttribute("data-navigating",r.toString())})])}initialize(){const i=Le("mac"),r=async()=>{i&&(await $x(()=>this.ready),this.messagesCommon=await DA("esri/t9n/common").catch(()=>{}))};r(),this.addHandles([ti(()=>this.ui,(s,n)=>this._handleUIChange(s,n),_n),this.on("focus",()=>this.notifyChange("focused")),this.on("blur",()=>this.notifyChange("focused")),CA(r),ti(()=>[this.surface,this.messagesCommon],()=>{var s,n,c;i&&((c=this.surface)==null||c.setAttribute("aria-label",((n=(s=this.messagesCommon)==null?void 0:s.ariaLabels)==null?void 0:n.navigationMacVoiceOver)??""))})])}destroy(){this.destroyed||(this.ui=lr(this.ui),this.container=null)}get container(){return this._get("container")??null}set container(i){const r=this._get("container"),s=p3(i);if(s||typeof i!="string"||_t.getLogger(this).error("#container",`element with id '${i}' not found`),r===s)return;if(this._stopMeasuring(),r&&(r.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this.root&&(cR(this.root),this._set("root",null)),this.userContent&&(Xk(this.userContent,r),cR(this.userContent),this._set("userContent",null))),!s)return this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),void this._set("container",null);s.classList.add("esri-view");const n=document.createElement("div");n.className="esri-view-user-storage",Xk(s,n),s.appendChild(n),this._set("userContent",n);const c=document.createElement("div");c.className="esri-view-root",s.insertBefore(c,s.firstChild),this._set("root",c);const o=document.createElement("div");o.className="esri-view-surface",o.setAttribute("role","application"),o.tabIndex=0,c.appendChild(o),this._set("surface",o);const f=new lR;c.appendChild(f.surface),this._set("overlay",f),this.addHandles(ti(()=>f.needsRender,g=>{g&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=Mm({render:()=>{var S;return(S=this.overlay)==null?void 0:S.render()}}):this._overlayRenderTaskHandle=Sr(this._overlayRenderTaskHandle)})),this.forceDOMReadyCycle(),this._set("container",s),this._startMeasuring()}get focused(){const i=document.activeElement===this.surface;return document.hasFocus()&&i}get size(){return[this.width,this.height]}blur(){var i;(i=this.surface)==null||i.blur()}focus(){var i;(i=this.surface)==null||i.focus()}pageToContainer(i,r,s){const n=this.position;return i-=n?n[0]:0,r-=n?n[1]:0,s?(s[0]=i,s[1]=r):s=[i,r],s}containerToPage(i,r,s){const n=this.position;return i+=n?n[0]:0,r+=n?n[1]:0,s?(s[0]=i,s[1]=r):s=[i,r],s}_handleUIChange(i,r){this.removeHandles("ui"),r&&r!==i&&r.destroy(),i&&(i.view=this,this.addHandles(ti(()=>this.root,s=>{i.container=s?lie(s):null},_n),"ui")),this._set("ui",i)}_stopMeasuring(){this.removeHandles("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const i=this._freqInfo;i.freq=wg,i.time=wv,this.addHandles([f_(window,"resize",()=>{i.freq=wg,i.time=wv}),Mm({prepare:r=>{const s=this._measure(),n=this._freqInfo;if(n.time+=r.deltaTime,s&&(n.freq=wg,this._get("resizing")||this._set("resizing",!0)),n.time=cie&&this._get("resizing")&&this._set("resizing",!1)}})],"measuring"),this._measure(),this._position()}_measure(){const i=this.container,r=i?i.clientWidth:0,s=i?i.clientHeight:0;if(r===0||s===0)return this.suspended||this._set("suspended",!0),!1;const n=this.width,c=this.height;return r===n&&s===c?(this.suspended&&this._set("suspended",!1),!1):(this._set("width",r),this._set("height",s),this.suspended&&this._set("suspended",!1),this.emit("resize",{oldWidth:n,oldHeight:c,width:r,height:s}),!0)}_position(){const i=this.container,r=this.position,s=i&&aie(i);return!!s&&(!r||s[0]!==r[0]||s[1]!==r[1])&&(this._set("position",[s[0],s[1]]),!0)}forceDOMReadyCycle(){}};return v([M()],t.prototype,"container",null),v([M({readOnly:!0})],t.prototype,"focused",null),v([M({readOnly:!0})],t.prototype,"height",void 0),v([M()],t.prototype,"messagesCommon",void 0),v([M({type:lR})],t.prototype,"overlay",void 0),v([M({readOnly:!0})],t.prototype,"position",void 0),v([M({readOnly:!0})],t.prototype,"resizing",void 0),v([M({readOnly:!0})],t.prototype,"root",void 0),v([M({value:null,readOnly:!0})],t.prototype,"size",null),v([M({readOnly:!0})],t.prototype,"surface",void 0),v([M({readOnly:!0})],t.prototype,"suspended",void 0),v([M()],t.prototype,"ui",void 0),v([M({readOnly:!0})],t.prototype,"userContent",void 0),v([M({readOnly:!0})],t.prototype,"width",void 0),v([M()],t.prototype,"widthBreakpoint",void 0),t=v([fe("esri.views.DOMContainer")],t),t};let die=class{constructor(t,i){this._owner=i,this._properties={},this._afterDispatchHandle=null;for(const r in t){const s=t[r],n=new K5(s,void 0,void 0,2,2);this._properties[r]={pool:n,acquired:[]}}this._afterDispatchHandle=UG(()=>this._release())}destroy(){this._afterDispatchHandle&&(this._afterDispatchHandle.remove(),this._afterDispatchHandle=null);for(const t in this._properties){const i=this._properties[t];for(const r of i.acquired)p$(r)||i.pool.release(r);i.pool.destroy(),i.pool=null,i.acquired=null}this._properties=null,this._owner=null}get(t){const i=this._owner._get(t),r=this._properties[t];let s=r.pool.acquire();for(r.acquired.push(s);s===i;)r.acquired.push(s),s=r.pool.acquire();return s}_release(){for(const t in this._properties){const i=this._properties[t];let r=0;for(const s of i.acquired)p$(s)?i.acquired[r++]=s:i.pool.release(s);i.acquired.length=r}}};const pie=Le("mac")?"Meta":"Ctrl",fie=new Set(["Alt","Ctrl","Meta","Shift","Primary"]),mie=e=>fie.has(e);let yie=class{constructor(t,i=[]){this.eventType=t,this.keyModifiers=i}matches(t){if(t.type!==this.eventType)return!1;if(this.keyModifiers.length===0)return!0;const i=t.modifiers;for(const r of this.keyModifiers)if(!i.has(r))return!1;return!0}};const uR=()=>_t.getLogger("esri.views.input.InputHandler");let bs=class{constructor(t){this._manager=null,this._incoming={},this._outgoing={},this._incomingEventMatches=null,this._incomingEventTypes=null,this._outgoingEventTypes=null,this._hasSideEffects=t}get incomingEventMatches(){if(!this._incomingEventMatches){this._incomingEventMatches=[];for(const t in this._incoming){const i=this._incoming[t];for(const r of i)this._incomingEventMatches.push(r.match)}}return this._incomingEventMatches}get incomingEventTypes(){return this._incomingEventTypes||(this._incomingEventTypes=this.incomingEventMatches.map(t=>t.eventType)),this._incomingEventTypes}get outgoingEventTypes(){return this._outgoingEventTypes||(this._outgoingEventTypes=Object.keys(this._outgoing)),this._outgoingEventTypes}get hasSideEffects(){return this._hasSideEffects}get hasPendingInputs(){return!1}onInstall(t){this._manager?uR().error("This InputHandler has already been registered with an InputManager"):(t.setEventCallback(i=>this._handleEvent(i)),t.setUninstallCallback(()=>this._onUninstall()),this._manager=t)}onUninstall(){}registerIncoming(t,i,r){let s;typeof i=="function"?(r=i,s=[]):s=i||[];const n=typeof t=="string"?new yie(t,s):t,c=()=>{this._incomingEventTypes=null,this._incomingEventMatches=null},o=S=>{const I=this._incoming[S.match.eventType];if(I){const A=I.indexOf(S);I.splice(A,1),c(),this._manager&&this._manager.updateDependencies()}},f=new gie(n,r,{onPause:o,onRemove:o,onResume:S=>{const I=this._incoming[S.match.eventType];I&&!I.includes(S)&&(I.push(S),c(),this._manager&&this._manager.updateDependencies())}});let g=this._incoming[n.eventType];return g||(g=[],this._incoming[n.eventType]=g),g.push(f),c(),this._manager&&this._manager.updateDependencies(),f}registerOutgoing(t){if(this._outgoing[t])throw new Error("There is already a callback registered for this outgoing InputEvent: "+t);const i=new _ie(t,{onEmit:(r,s,n,c)=>{var o;(o=this._manager)==null||o.emit(r.eventType,s,n,c)},onRemove:r=>{var s;delete this._outgoing[r.eventType],(s=this._manager)==null||s.updateDependencies()}});return this._outgoing[t]=i,this._outgoingEventTypes=null,this._manager&&this._manager.updateDependencies(),i}startCapturingPointer(t){var i;(i=this._manager)==null||i.setPointerCapture(t,!0)}stopCapturingPointer(t){var i;(i=this._manager)==null||i.setPointerCapture(t,!1)}refreshHasPendingInputs(){var t;(t=this._manager)==null||t.refreshHasPendingInputs()}_onUninstall(){this._manager?(this.onUninstall(),this._manager=null):uR().error("This InputHandler is not registered with an InputManager")}_handleEvent(t){var r;const i=this._incoming[t.type];if(i){for(const s of i)if(s.match.matches(t)&&((r=s.callback)==null||r.call(s,t),t.shouldStopPropagation()))break}}},gie=class{constructor(t,i,r){this.match=t,this._callback=i,this._handler=r}pause(){this._handler.onPause(this)}resume(){this._handler.onResume(this)}remove(){this._handler.onRemove(this)}get callback(){return this._callback}},_ie=class{constructor(t,i){this.eventType=t,this._removed=!1,this._handler=i}emit(t,i,r){this._removed||this._handler.onEmit(this,t,i,r)}remove(){this._removed=!0,this._handler.onRemove(this)}},vie=class extends bs{constructor(t){super(!0),this._onChange=t,this._value="mouse",this._x=null,this._y=null,this.registerIncoming("pointer-move",i=>{this._update(i.data)})}_update(t){const i=t.native.pointerType==="touch"?"touch":"mouse",{x:r,y:s}=t;i===this._value&&this._x===r&&this._y===s||(this._value=i,this._x=r,this._y=s,this._onChange(i,r,s))}},bie=class{constructor(t,i){this._observable=new g_,this._value=t,this._equalityFunction=i}get value(){return Rt(this._observable),this._value}set value(t){this._equalityFunction(t,this._value)||(this._value=t,this._observable.notify())}mutate(t){t(this._value),this._observable.notify()}};function PF(e,t=$5){return new bie(e,t)}let wie=class extends bs{get multiTouchActive(){return this._multiTouchActive.value}constructor(){super(!0),this._activeTouchPointerIds=new Set,this._multiTouchActive=PF(!1),this._onPointerAdd=({data:t})=>{t.pointerType==="touch"&&(this._activeTouchPointerIds.add(t.native.pointerId),this._update())},this._onPointerRemove=({data:t})=>{t.pointerType==="touch"&&(this._activeTouchPointerIds.delete(t.native.pointerId),this._update())},this.registerIncoming("pointer-down",this._onPointerAdd),this.registerIncoming("pointer-up",this._onPointerRemove),this.registerIncoming("pointer-capture-lost",this._onPointerRemove),this.registerIncoming("pointer-cancel",this._onPointerRemove)}_update(){this._multiTouchActive.value=this._activeTouchPointerIds.size>1}},Go=class extends Nt{constructor(t){super(t),this._pointerCaptures=new Map,this._nameToGroup={},this._handlers=[],this._handlersPriority=[],this._currentPropagation=null,this._updateDependenciesAfterPropagation=!1,this._sourceEvents=new Set,this._keyModifiers=new Set,this._activeKeyModifiers=new Set,this._stoppedPropagationEventIds=new Set,this.primaryKey=pie,this._latestPointerType="mouse",this._propertiesPool=new die({latestPointerLocation:Tie},this),this.latestPointerLocation=null,this._paused=!1,this.test={timestamp:void 0,hasCurrentPropagation:()=>!!this._currentPropagation}}initialize(){this.eventSource.onEventReceived=this._onEventReceived.bind(this),this._installRecognizers()}destroy(){const t=Object.keys(this._nameToGroup);for(const i of t)this.uninstallHandlers(i);this.eventSource.destroy(),this._currentPropagation=null,this._propertiesPool.destroy()}get hasPendingInputs(){return this._handlers.some(t=>t.handler.hasPendingInputs)}get latestPointerType(){return this._latestPointerType}get multiTouchActive(){return this._multiTouchHandler.multiTouchActive}get updating(){return this.hasPendingInputs||this._paused}installHandlers(t,i,r=uh.INTERNAL){if(this._nameToGroup[t])return void _t.getLogger(this).error("There is already an InputHandler group registered under the name `"+t+"`");if(i.length===0)return void _t.getLogger(this).error("Can't register a group of zero handlers");const s={name:t,handlers:i.map(n=>({handler:n,active:!0,removed:!1,priorityIndex:0,groupPriority:r,eventCallback:null,uninstallCallback:null}))};this._nameToGroup[t]=s;for(let n=s.handlers.length-1;n>=0;n--){const c=s.handlers[n];this._handlers.push(c),c.handler.onInstall({updateDependencies:()=>{this.updateDependencies()},emit:(o,f,g,S,I)=>{this._emitInputEvent(c.priorityIndex+1,o,f,g,I,S)},setPointerCapture:(o,f)=>{this._setPointerCapture(s,c,o,f)},setEventCallback:o=>{c.eventCallback=o},setUninstallCallback:o=>{c.uninstallCallback=o},refreshHasPendingInputs:()=>{this.notifyChange("hasPendingInputs")}})}this.updateDependencies()}uninstallHandlers(t){const i=this._nameToGroup[t];i?(i.handlers.forEach(r=>{var s;r.removed=!0,(s=r.uninstallCallback)==null||s.call(r)}),delete this._nameToGroup[t],this._currentPropagation?this._currentPropagation.needsHandlerGarbageCollect=!0:this._garbageCollectRemovedHandlers()):_t.getLogger(this).error("There is no InputHandler group registered under the name `"+t+"`")}hasHandlers(t){return this._nameToGroup[t]!==void 0}isModifierKeyDown(t){return this._activeKeyModifiers&&this._activeKeyModifiers.has(t)}updateDependencies(){if(this._currentPropagation)return void(this._updateDependenciesAfterPropagation=!0);this._updateDependenciesAfterPropagation=!1;const t=new Set,i=new Set;this._handlersPriority=[];for(let r=this._handlers.length-1;r>=0;r--){const s=this._handlers[r];s.priorityIndex=r,this._handlersPriority.push(s)}this._handlersPriority=this._sortHandlersPriority(this._handlersPriority);for(let r=this._handlersPriority.length-1;r>=0;r--){const s=this._handlersPriority[r];s.priorityIndex=r;let n=s.handler.hasSideEffects;if(!n){for(const c of s.handler.outgoingEventTypes)if(t.has(c)){n=!0;break}}if(n)for(const c of s.handler.incomingEventMatches){t.add(c.eventType);for(const o of c.keyModifiers)mie(o)||i.add(o)}s.active=n}this._sourceEvents=t,this._keyModifiers=i,this._pointerCaptures.size>0&&this._sourceEvents.add("pointer-capture-lost"),this._keyModifiers.size>0&&(this._sourceEvents.add("key-down"),this._sourceEvents.add("key-up")),this.eventSource&&(this.eventSource.activeEvents=this._sourceEvents)}_setLatestPointer(t,i,r){this._latestPointerType=t;const s=this._get("latestPointerLocation");if(s==null||s.x!==i||s.y!==r){const n=this._propertiesPool.get("latestPointerLocation");n.x=i,n.y=r,this._set("latestPointerLocation",n)}}_onEventReceived(t,i){if(t==="pointer-capture-lost"){const n=i;this._pointerCaptures.delete(n.native.pointerId)}this._updateKeyModifiers(t,i);const r=this.test.timestamp!=null?this.test.timestamp:i.native?i.native.timestamp:void 0,s=i.native?i.native.cancelable:void 0;this._emitInputEventFromSource(t,i,r,s)}_updateKeyModifiers(t,i){if(!i)return;let r=!1;const s=()=>{if(!r){const o=new Set;this._activeKeyModifiers.forEach(f=>{o.add(f)}),this._activeKeyModifiers=o,r=!0}},n=(o,f)=>{f&&!this._activeKeyModifiers.has(o)?(s(),this._activeKeyModifiers.add(o)):!f&&this._activeKeyModifiers.has(o)&&(s(),this._activeKeyModifiers.delete(o))};if(t==="key-down"||t==="key-up"){const o=i.key;this._keyModifiers.has(o)&&n(o,t==="key-down")}const c=i.native;n("Alt",!(!c||!c.altKey)),n("Ctrl",!(!c||!c.ctrlKey)),n("Shift",!(!c||!c.shiftKey)),n("Meta",!(!c||!c.metaKey)),n("Primary",this._activeKeyModifiers.has(this.primaryKey))}_installRecognizers(){this._latestPointerHandler=new vie((t,i,r)=>this._setLatestPointer(t,i,r)),this._multiTouchHandler=new wie,this.installHandlers("input-manager-logic",[this._latestPointerHandler,this._multiTouchHandler],uh.ALWAYS),this.recognizers.length>0&&this.installHandlers("default",this.recognizers,uh.INTERNAL)}_setPointerCapture(t,i,r,s){const n=t.name+"-"+i.priorityIndex,c=this._pointerCaptures.get(r.pointerId)||new Set;this._pointerCaptures.set(r.pointerId,c),s?(c.add(n),c.size===1&&this.eventSource&&this.eventSource.setPointerCapture(r,!0)):c.has(n)&&(c.delete(n),c.size===0&&(this._pointerCaptures.delete(r.pointerId),this.eventSource&&this.eventSource.setPointerCapture(r,!1)))}_garbageCollectRemovedHandlers(){this._handlers=this._handlers.filter(t=>!t.removed),this.updateDependencies()}_emitInputEventFromSource(t,i,r,s){this._emitInputEvent(0,t,i,r,s)}_emitInputEvent(t,i,r,s,n,c){const o=s!==void 0?s:this._currentPropagation?this._currentPropagation.timestamp:performance.now(),f=n!==void 0&&n,g={event:new xie(i,r,o,c||this._activeKeyModifiers,f),priorityIndex:t};this._currentPropagation?this._currentPropagation.events.push(g):this._doNewPropagation(g)}_doNewPropagation(t){this._currentPropagation={events:new Sw,currentHandler:null,needsHandlerGarbageCollect:!1,timestamp:t.event.timestamp},this._currentPropagation.events.push(t),this._continuePropagation()}_continuePropagation(){var i,r,s;this._paused=!1;const t=this._currentPropagation;if(t){for(;t.events.length>0;){const{event:n,priorityIndex:c}=t.events.pop(),o=(i=n.data)==null?void 0:i.eventId;if(!(o!=null&&this._stoppedPropagationEventIds.has(o)))for(t.currentHandler=this._handlersPriority[c];t.currentHandler;){if(t.currentHandler.removed)t.needsHandlerGarbageCollect=!0;else{if(t.currentHandler.active&&!n.shouldStopPropagation()&&((s=(r=t.currentHandler).eventCallback)==null||s.call(r,n)),n.shouldStopPropagation()){o!=null&&this._stoppedPropagationEventIds.add(o);break}if(n.shouldPausePropagation(()=>this._continuePropagation()))return void this._pausePropagation({event:n,priorityIndex:t.currentHandler.priorityIndex+1})}t.currentHandler=this._handlersPriority[t.currentHandler.priorityIndex+1]}}t.needsHandlerGarbageCollect&&this._garbageCollectRemovedHandlers(),this.hasPendingInputs||this._stoppedPropagationEventIds.clear(),this._currentPropagation=null,this._updateDependenciesAfterPropagation&&this.updateDependencies()}}_pausePropagation(t){const i=new Sw;i.push(t);const r=this._currentPropagation;if(r){for(;r.events.length;)i.push(r.events.pop());r.events=i,r.currentHandler=null,this._paused=!0}}_compareHandlerPriority(t,i){if(t.handler.hasSideEffects!==i.handler.hasSideEffects)return t.handler.hasSideEffects?1:-1;if(t.groupPriority!==i.groupPriority)return t.groupPriority>i.groupPriority?-1:1;for(const r of t.handler.incomingEventMatches)for(const s of i.handler.incomingEventMatches){if(r.eventType!==s.eventType)continue;const n=r.keyModifiers.filter(c=>s.keyModifiers.includes(c));if(n.length===r.keyModifiers.length!=(n.length===s.keyModifiers.length))return r.keyModifiers.length>s.keyModifiers.length?-1:1}return t.priorityIndex>i.priorityIndex?-1:1}_sortHandlersPriority(t){const i=[];for(const r of t){let s=0;for(;s=0;)s++;i.splice(s,0,r)}return i}get debug(){const t=i=>{const r=this._setPointerCapture;this._setPointerCapture=()=>{},i(),this._setPointerCapture=r};return{injectEvent:(i,r)=>{t(()=>{this._onEventReceived(i,r)})},disablePointerCapture:t}}};v([M({readOnly:!0})],Go.prototype,"hasPendingInputs",null),v([M({constructOnly:!0})],Go.prototype,"eventSource",void 0),v([M({constructOnly:!0})],Go.prototype,"recognizers",void 0),v([M()],Go.prototype,"_latestPointerType",void 0),v([M()],Go.prototype,"latestPointerType",null),v([M()],Go.prototype,"multiTouchActive",null),v([M({readOnly:!0})],Go.prototype,"latestPointerLocation",void 0),v([M()],Go.prototype,"_paused",void 0),v([M({readOnly:!0})],Go.prototype,"updating",null),Go=v([fe("esri.views.input.InputManager")],Go);let xie=class{constructor(t,i,r,s,n){this.type=t,this.data=i,this.timestamp=r,this.modifiers=s,this.cancelable=n,this._propagationState=eh.NONE,this._resumeCallback=null}stopPropagation(){this._propagationState|=eh.STOPPED}shouldStopPropagation(){return(this._propagationState&eh.STOPPED)!=0}async(t){this._propagationState|=eh.PAUSED;const i=(r,s)=>{this._propagationState&=~eh.PAUSED;const n=this._resumeCallback;if(this._resumeCallback=null,n&&n(),s)throw r;return r};return(typeof t=="function"?t():t).then(r=>i(r,!1),r=>i(r,!0))}shouldPausePropagation(t){return!!(this._propagationState&eh.PAUSED)&&(this._resumeCallback=t,!0)}preventDefault(){this.data.native.preventDefault()}};var eh;(function(e){e[e.NONE=0]="NONE",e[e.STOPPED=1]="STOPPED",e[e.PAUSED=2]="PAUSED"})(eh||(eh={}));const uh={ALWAYS:1,DEFAULT:0,TOOL:-1,WIDGET:-2,INTERNAL:-3};let Sie=class{};const Tie=Sie;function ul(e){return e!=null&&"open"in e&&"declaredClass"in e}function hR(e){return e!=null&&"declaredClass"in e&&"dockOptions"in e}const Eie=e=>{let t=class extends e{constructor(){super(...arguments),this._popupSetupTask=null,this.popup={},this.popupEnabled=!0}initialize(){this.addHandles([ti(()=>[this.ui,this.popup],([i,r],s)=>{const n="popup",c="manual";if(s){const[o,f]=s;o&&ul(f)&&(f.view=null,hR(f)&&o.remove(f,n))}i&&ul(r)&&(r.view=this,hR(r)&&i.add(r,{key:n,position:c,internal:!0}))},_n),this.on("click",i=>{this.popup&&this.popupEnabled&&(i.pointerType!=="mouse"||i.button===0)&&(!ul(this.popup)&&"autoOpenEnabled"in this.popup&&this.popup.autoOpenEnabled===!1||(ul(this.popup)?this.popup.viewModel.handleViewClick(i):i.async(async()=>{await this.setupPopup(),ul(this.popup)&&!this.destroyed&&this.ready&&this.popupEnabled&&this.popup.viewModel.handleViewClick(i)})))},uh.WIDGET)]),$x(()=>this.ready&&this.popupEnabled&&!this.updating).then(()=>{ht(()=>import("./Popup-CMTUSIYl.js"),__vite__mapDeps([116,1,117,118,13,93,119,79,120,121,71,101,122,123,124,125,126,34,32,127,11,12,128,62,60,61,22,25,63,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,81,38,145,146,147,148,149,150,151,152,153,154,155,6,156,157]))})}destroy(){this.destroyed||this.closePopup()}async openPopup(i){if(ul(this.popup))return this.popup.open(i);try{if(await this.setupPopup(),!this.popup)return void _t.getLogger(this).error(new Je("view:null-popup","Popup is null and can't be opened"));this.popup.open(i)}catch{}}closePopup(){var i;(i=this._popupSetupTask)==null||i.abort(),ul(this.popup)&&this.popup.close()}async fetchPopupFeatures(i,r){return await this.when(),this._popupHitsToFeatures(await this._getPopupHits(i,r),r)}async setupPopup(){var i;if((i=this._popupSetupTask)==null||i.abort(),this.popup&&!ul(this.popup))return this._popupSetupTask=_x(async r=>{const{default:s}=await ht(()=>import("./Popup-CMTUSIYl.js"),__vite__mapDeps([116,1,117,118,13,93,119,79,120,121,71,101,122,123,124,125,126,34,32,127,11,12,128,62,60,61,22,25,63,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,81,38,145,146,147,148,149,150,151,152,153,154,155,6,156,157]));if(mr(r),!this.popup||ul(this.popup))return;const n=this.popup;delete n.open,delete n.close,this.popup=new s(n)}),this._popupSetupTask.promise}async _popupHitsToFeatures({location:i,hits:r},s){const n=[],c=[];let o=!1;const f=_G(s,Le("popup-view-fetch-timeout")??Iie),g=A=>{const O=new Mie(A);return c.push(O),n.push(O.promise),O},S=A=>{const O=c.at(-1);return O&&O.layerView===A&&!o?O:g(A)};for(const A of r)"graphic"in A?(S(A.layerView).graphics.push(A.graphic),o=!1):(n.push(A.layerView.fetchPopupFeaturesAtLocation(A.mapPoint,f)),o=!0);c.map(A=>A.resolve(f));const I=gG(n).then(A=>A.filter(O=>!!O).flat());return{pendingFeatures:n,allGraphicsPromise:I,location:i}}async _getPopupHits(i,r){const{hits:s,location:n}=await this.popupHitTest(i);mr(r);const c=[];for(const o of s)if("graphic"in o){if(this._isValidPopupGraphic(o.graphic,r)){const f=this._isValidPopupGraphicsLayerView(o.layerView)?o.layerView:void 0;c.push({graphic:o.graphic,layerView:f})}}else this._isValidPopupLocationLayerView(o.layerView)&&c.push({mapPoint:o.mapPoint,layerView:o.layerView});return{hits:c,location:n}}_isValidPopupGraphic(i,r){return i&&!!i.getEffectivePopupTemplate(r!=null&&r.defaultPopupTemplateEnabled)}_isValidPopupGraphicsLayerView(i){return!i||(!("layer"in i)||!i.suspended)&&"fetchPopupFeaturesFromGraphics"in i}_isValidPopupLocationLayerView(i){return(!("layer"in i)||!i.suspended)&&"fetchPopupFeaturesAtLocation"in i}};return v([M({cast(i){return!i||ul(i)||typeof i=="object"&&(i.open=r=>(Em(_t.getLogger(this),"view.popup is no longer created by default. view.popup.open() will stop working when the popup isn't created",{replacement:"Use view.openPopup() instead.",version:"4.27"}),this.openPopup(r)),i.close=()=>(Em(_t.getLogger(this),"view.popup is no longer created by default. view.popup.close() will stop working when the popup isn't created",{replacement:"Use view.closePopup() instead.",version:"4.27"}),this.closePopup())),i}})],t.prototype,"popup",void 0),v([M()],t.prototype,"popupEnabled",void 0),t=v([fe("esri.views.PopupView")],t),t};let Mie=class{constructor(t){this.layerView=t,this._resolver=sa(),this.graphics=[]}get promise(){return this._resolver.promise}resolve(t){const{layerView:i,graphics:r,_resolver:s}=this;if(!i)return s.resolve(r),s.promise;let n;return i.fetchPopupFeaturesFromGraphics(r,t).catch(c=>(n=c,null)).then(c=>{c?s.resolve(c):s.reject(n)}),s.promise}};const Iie=5e3,dR={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8};function up(e,t,i,r=Dl){const s=new Ja(l3(r)),n=Jt.fromJSDate(e,{zone:s}),c=i==="decades"||i==="centuries"?"year":CF(i);return i==="decades"&&(t*=10),i==="centuries"&&(t*=100),n.plus({[c]:t}).toJSDate()}function pR(e,t,i=Dl){const r=new Ja(l3(i)),s=Jt.fromJSDate(e,{zone:r});if(t==="decades"||t==="centuries"){const c=s.startOf("year"),{year:o}=c,f=o-o%(t==="decades"?10:100);return c.set({year:f}).toJSDate()}const n=CF(t);return s.startOf(n).toJSDate()}function C0e(e,t,i){return e===0?0:e*dR[t]/dR[i]}function CF(e){switch(e){case"milliseconds":return"millisecond";case"seconds":return"second";case"minutes":return"minute";case"hours":return"hour";case"days":return"day";case"weeks":return"week";case"months":return"month";case"years":return"year"}}var Ma;let vo=Ma=class extends At{static get allTime(){return fR}static get empty(){return Aie}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return t.end!=null?new Date(t.end):null}writeEnd(e,t){t.end=(e==null?void 0:e.getTime())??null}get isAllTime(){return this.equals(Ma.allTime)}get isEmpty(){return this.equals(Ma.empty)}readStart(e,t){return t.start!=null?new Date(t.start):null}writeStart(e,t){t.start=(e==null?void 0:e.getTime())??null}clone(){return new Ma({end:this.end,start:this.start})}equals(e){var n,c,o,f;if(!e)return!1;const t=((n=this.start)==null?void 0:n.getTime())??this.start,i=((c=this.end)==null?void 0:c.getTime())??this.end,r=((o=e.start)==null?void 0:o.getTime())??e.start,s=((f=e.end)==null?void 0:f.getTime())??e.end;return t===r&&i===s}expandTo(e,t=Dl){if(this.isEmpty||this.isAllTime)return this.clone();let i=this.start;i&&(i=pR(i,e,t));let r=this.end;if(r){const s=pR(r,e,t);r=r.getTime()===s.getTime()?s:up(s,1,e,t)}return new Ma({start:i,end:r})}intersection(e){var o,f,g,S;if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return Ma.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=((o=this.start)==null?void 0:o.getTime())??-1/0,i=((f=this.end)==null?void 0:f.getTime())??1/0,r=((g=e.start)==null?void 0:g.getTime())??-1/0,s=((S=e.end)==null?void 0:S.getTime())??1/0;let n,c;if(r>=t&&r<=i?n=r:t>=r&&t<=s&&(n=t),i>=r&&i<=s?c=i:s>=t&&s<=i&&(c=s),n!=null&&c!=null&&!isNaN(n)&&!isNaN(c)){const I=new Ma;return I.start=n===-1/0?null:new Date(n),I.end=c===1/0?null:new Date(c),I}return Ma.empty}offset(e,t,i=Dl){if(this.isEmpty||this.isAllTime)return this.clone();const r=new Ma,{start:s,end:n}=this;return s!=null&&(r.start=up(s,e,t,i)),n!=null&&(r.end=up(n,e,t,i)),r}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return fR.clone();const t=this.start!=null&&e.start!=null?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,i=this.end!=null&&e.end!=null?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new Ma({start:t,end:i})}};v([M({type:Date,json:{write:{allowNull:!0}}})],vo.prototype,"end",void 0),v([mi("end")],vo.prototype,"readEnd",null),v([ui("end")],vo.prototype,"writeEnd",null),v([M({readOnly:!0,json:{read:!1}})],vo.prototype,"isAllTime",null),v([M({readOnly:!0,json:{read:!1}})],vo.prototype,"isEmpty",null),v([M({type:Date,json:{write:{allowNull:!0}}})],vo.prototype,"start",void 0),v([mi("start")],vo.prototype,"readStart",null),v([ui("start")],vo.prototype,"writeStart",null),vo=Ma=v([fe("esri.TimeExtent")],vo);const fR=new vo,Aie=new vo({start:void 0,end:void 0}),E_=vo;let T0=class extends Bt{constructor(t){super(t),this.addHandles([this.on("before-add",i=>{i.item==null&&i.preventDefault()}),this.on("after-add",i=>this._own(i.item)),this.on("after-remove",i=>this._release(i.item))])}get owner(){return this._get("owner")}set owner(t){t!==this._get("owner")&&(this._releaseAll(),this._set("owner",t),this._ownAll())}_ownAll(){for(const t of this.items)this._own(t)}_releaseAll(){for(const t of this.items)this._release(t)}_createNewInstance(t){return this.itemType?new(Bt.ofType(this.itemType.Type))(t):new Bt(t)}};function mR(e,t){return{type:e,cast:Y4,set(i){const r=mp(i,this._get(t),e);r.owner=this,this._set(t,r)}}}v([M()],T0.prototype,"owner",null),T0=v([fe("esri.core.support.OwningCollection")],T0);var kg;const $w=Bn()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),$F=$w.jsonValues.slice();w7($F,"orthometric");const E0=Bn()({meter:"meters",foot:"feet","us-foot":"us-feet","clarke-foot":"clarke-feet","clarke-yard":"clarke-yards","clarke-link":"clarke-links","sears-yard":"sears-yards","sears-foot":"sears-feet","sears-chain":"sears-chains","benoit-1895-b-chain":"benoit-1895-b-chains","indian-yard":"indian-yards","indian-1937-yard":"indian-1937-yards","gold-coast-foot":"gold-coast-feet","sears-1922-truncated-chain":"sears-1922-truncated-chains","50-kilometers":"50-kilometers","150-kilometers":"150-kilometers"});let Ia=kg=class extends At{constructor(e){super(e),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(e,t,i){return $w.write(e,t,i)}readHeightModel(e,t,i){return $w.read(e)||(i!=null&&i.messages&&i.messages.push(Pie(e,{context:i})),null)}readHeightUnit(e,t,i){return E0.read(e)||(i!=null&&i.messages&&i.messages.push(yR(e,{context:i})),null)}readHeightUnitService(e,t,i){return lN(e)||E0.read(e)||(i!=null&&i.messages&&i.messages.push(yR(e,{context:i})),null)}readVertCRS(e,t){return t.vertCRS||t.ellipsoid||t.geoid}clone(){return new kg({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS})}equals(e){return!!e&&(this===e||this.heightModel===e.heightModel&&this.heightUnit===e.heightUnit&&this.vertCRS===e.vertCRS)}static deriveUnitFromSR(e,t){const i=mW(t);return new kg({heightModel:e.heightModel,heightUnit:i??void 0,vertCRS:e.vertCRS})}write(e,t){return t={origin:"web-scene",...t},super.write(e,t)}static fromJSON(e){if(!e)return null;const t=new kg;return t.read(e,{origin:"web-scene"}),t}};function yR(e,t){return new jc("height-unit:unsupported",`Height unit of value '${e}' is not supported`,t)}function Pie(e,t){return new jc("height-model:unsupported",`Height model of value '${e}' is not supported`,t)}v([M({type:$w.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:$F,default:"ellipsoidal"}}}})],Ia.prototype,"heightModel",void 0),v([ui("web-scene","heightModel")],Ia.prototype,"writeHeightModel",null),v([mi(["web-scene","service"],"heightModel")],Ia.prototype,"readHeightModel",null),v([M({type:E0.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:E0.jsonValues,write:E0.write}}}})],Ia.prototype,"heightUnit",void 0),v([mi("web-scene","heightUnit")],Ia.prototype,"readHeightUnit",null),v([mi("service","heightUnit")],Ia.prototype,"readHeightUnitService",null),v([M({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],Ia.prototype,"vertCRS",void 0),v([mi("service","vertCRS",["vertCRS","ellipsoid","geoid"])],Ia.prototype,"readVertCRS",null),Ia=kg=v([fe("esri.geometry.HeightModelInfo")],Ia);const g3=Ia;let kw=class extends T0{constructor(t){super(t),this.addHandles(this.on("before-add",i=>{i.item!=null&&i.item.parent===this.owner&&(_t.getLogger(this).warn("Analysis inside the collection must be unique. Not adding this element again."),i.preventDefault())}))}_own(t){t.parent=this.owner}_release(t){t.parent=null}};kw=v([fe("esri.support.AnalysesCollection")],kw);async function Cie(e,t){const{WhereClause:i}=await ht(()=>import("./WhereClause-Dzgyc0wk.js").then(r=>r.W),__vite__mapDeps([30,31,32]));return i.create(e,t)}function R0e(e,t){return e!=null&&e!==""?t!=null&&t!==""?`(${e}) AND (${t})`:e:t}function O0e(e){return typeof e=="number"}function _3(e){return typeof e=="string"||e instanceof String}const $ie="yyyy-MM-dd",kie="TT";var M0;(function(e){e.HM="HH:mm",e.HMS="HH:mm:ss",e.HMS_MS="HH:mm:ss.SSS"})(M0||(M0={}));const Rie=[M0.HMS_MS,M0.HMS,M0.HM,kie];function gR(e){if(!e||!_3(e))return null;const t=Jt.fromFormat(e,$ie);return t.isValid?t:null}function _R(e){return e&&_3(e)?U7(Rie,t=>{const i=Jt.fromFormat(e,t);return i.isValid?i:null})??null:null}function vR(e){if(!e||!_3(e))return null;const t=Jt.fromISO(e);return t.isValid?t:null}var Dm;(function(e){e.VALUE_OUT_OF_RANGE="domain-validation-error::value-out-of-range",e.INVALID_CODED_VALUE="domain-validation-error::invalid-coded-value"})(Dm||(Dm={}));const Oie=new Set(["integer","small-integer","big-integer","esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeBigInteger"]);function Lie(e){return e!=null&&Oie.has(e.type)}function kF(e){return e!=null&&(e.type==="date-only"||e.type==="esriFieldTypeDateOnly")}function RF(e){return e!=null&&(e.type==="timestamp-offset"||e.type==="esriFieldTypeTimestampOffset")}function OF(e){return e!=null&&(e.type==="time-only"||e.type==="esriFieldTypeTimeOnly")}function Die(e,t){const i=e==null?void 0:e.domain;if(!i)return null;switch(i.type){case"range":{const{min:r,max:s}=Nie(e);if(r!=null&&+ts)return Dm.VALUE_OUT_OF_RANGE;break}case"coded-value":case"codedValue":if(i.codedValues==null||i.codedValues.every(r=>r==null||r.code!==t))return Dm.INVALID_CODED_VALUE}return null}function Nie(e,t){const i=t??(e==null?void 0:e.domain);if(!i||i.type!=="range")return;const r="range"in i?i.range[0]:i.minValue,s="range"in i?i.range[1]:i.maxValue,n=Lie(e);return kF(e)||OF(e)||RF(e)?{...zie(e,s,r),isInteger:n}:{min:r!=null&&typeof r=="number"?r:null,max:s!=null&&typeof s=="number"?s:null,rawMin:r,rawMax:s,isInteger:n}}function zie(e,t,i){var r,s,n,c,o,f;return kF(e)?{min:(r=gR(i))==null?void 0:r.toMillis(),max:(s=gR(t))==null?void 0:s.toMillis(),rawMin:i,rawMax:t}:OF(e)?{min:(n=_R(i))==null?void 0:n.toMillis(),max:(c=_R(t))==null?void 0:c.toMillis(),rawMin:i,rawMax:t}:RF(e)?{min:(o=vR(i))==null?void 0:o.toMillis(),max:(f=vR(t))==null?void 0:f.toMillis(),rawMin:i,rawMax:t}:{max:null,min:null}}const Fie=()=>_t.getLogger("esri.support.arcadeOnDemand");let WS;function LF(){return WS||(WS=(async()=>{const e=await ht(()=>import("./arcadeUtils-BoaybaAR.js").then(t=>t.aK),__vite__mapDeps([158,31,32,159,36,24,22,25,34]));return{arcade:e.arcade,arcadeUtils:e,Dictionary:e.Dictionary,Feature:e.arcadeFeature}})()),WS}const L0e=(e,t,i)=>DF.create(e,t,i,null,["$feature","$view"],[]),D0e=(e,t,i,r)=>DF.create(e,t,i,r,["$feature","$view"],[]);let DF=class NF{constructor(t,i,r,s,n,c,o){this.services=null,this.script=t,this.evaluate=s;const f=Array.isArray(c)?c:c==null?void 0:c.fields;this.fields=f??[],this._syntaxTree=r,this._arcade=i,this._arcadeFeature=n,this._spatialReference=o,this._referencesGeometry=i.scriptTouchesGeometry(this._syntaxTree),this._referencesScale=this._arcade.referencesMember(this._syntaxTree,"scale")}static async create(t,i,r,s,n,c){const{arcade:o,Feature:f,Dictionary:g}=await LF(),S=yi.fromJSON(i);let I;try{I=o.parseScript(t,c)}catch(je){return Fie().error(new Je("arcade-bad-expression","Failed to parse arcade script",{script:t,error:je})),null}const A=n.reduce((je,tt)=>({...je,[tt]:null}),{});let O=null;s!=null&&(O=new g(s),O.immutable=!0,A.$config=null);const z=o.scriptUsesGeometryEngine(I),V=z&&o.enableGeometrySupport(),H=o.scriptUsesFeatureSet(I)&&o.enableFeatureSetSupport(),Q=o.scriptIsAsync(I),ve=Q&&o.enableAsyncSupport(),me={vars:A,spatialReference:S,useAsync:!!ve};await Promise.all([V,H,ve]);const ge=new Set;await o.loadDependentModules(ge,I,null,Q,z);const Ie=new g;Ie.immutable=!1,Ie.setField("scale",0);const Ce=o.compileScript(I,me),ze=(je,tt)=>{var ot;const ut=(ot=je.$view)==null?void 0:ot.timeZone;return"$view"in je&&je.$view&&(Ie.setField("scale",typeof je.$view=="object"&&"scale"in je.$view?je.$view.scale:void 0),je.$view=Ie),O&&(je.$config=O),Ce({vars:je,spatialReference:S,services:tt,timeZone:ut})};return new NF(t,o,I,ze,new f,r,S)}repurposeFeature(t){return t.geometry&&!t.geometry.spatialReference&&(t.geometry.spatialReference=this._spatialReference),this._arcadeFeature.repurposeFromGraphicLikeObject(t.geometry,t.attributes,{fields:this.fields}),this._arcadeFeature}referencesGeometry(){return this._referencesGeometry}referencesScale(){return this._referencesScale}};const Bie=/^([0-9_])/,Uie=/[^a-z0-9_\u0080-\uffff]+/gi;function N0e(e){return e==null?null:e.trim().replaceAll(Uie,"_").replace(Bie,"F$1")||null}const jie=["field","field2","field3","normalizationField","rotationInfo.field","proportionalSymbolInfo.field","proportionalSymbolInfo.normalizationField","colorInfo.field","colorInfo.normalizationField"],Vie=["field","normalizationField"];function z0e(e,t){if(e!=null&&t!=null){for(const i of Array.isArray(e)?e:[e])if(bR(jie,i,t),"visualVariables"in i&&i.visualVariables)for(const r of i.visualVariables)bR(Vie,r,t)}}function bR(e,t,i){if(e)for(const r of e){const s=ax(r,t),n=s&&typeof s!="function"&&i.get(s);n&&Ap(r,n.name,t)}}function F0e(e,t){var i;if(e!=null&&((i=t==null?void 0:t.fields)!=null&&i.length))if("startField"in e){const r=t.get(e.startField),s=t.get(e.endField);e.startField=(r==null?void 0:r.name)??null,e.endField=(s==null?void 0:s.name)??null}else{const r=t.get(e.startTimeField),s=t.get(e.endTimeField);e.startTimeField=(r==null?void 0:r.name)??null,e.endTimeField=(s==null?void 0:s.name)??null}}const ZS=new Set;function v3(e,t){return e&&t?(ZS.clear(),t_(ZS,e,t),Array.from(ZS).sort()):[]}function t_(e,t,i){var r;if(i)if((r=t==null?void 0:t.fields)!=null&&r.length)if(i.includes("*"))for(const{name:s}of t.fields)e.add(s);else for(const s of i)Vx(e,t,s);else{if(i.includes("*"))return e.clear(),void e.add("*");for(const s of i)s!=null&&e.add(s)}}function Vx(e,t,i){if(typeof i=="string")if(t){const r=t.get(i);r&&e.add(r.name)}else e.add(i)}function B0e(e,t){return t==null||e==null?[]:t.includes("*")?(e.fields??[]).map(i=>i.name):t}function U0e(e,t,i=1){if(!t||!e)return[];if(t.includes("*"))return["*"];const r=v3(e,t);return r.length/e.fields.length>=i?["*"]:r}async function wh(e,t,i){var n;if(!i)return;const{arcadeUtils:r}=await LF(),s=r.extractFieldNames(i,(n=t==null?void 0:t.fields)==null?void 0:n.map(c=>c.name));for(const c of s)Vx(e,t,c)}async function zF(e,t,i){if(i&&i!=="1=1"){const r=await Cie(i,t);if(!r.isStandardized)throw new Je("fieldUtils:collectFilterFields","Where clause is not standardized",{where:i});t_(e,t,r.fieldNames)}}function j0e({displayField:e,fields:t}){return e||(t!=null&&t.length?YS(t,"name-or-title")||YS(t,"unique-identifier")||YS(t,"type-or-category")||Gie(t):null)}function Gie(e){for(const t of e){if(!(t!=null&&t.name))continue;const i=t.name.toLowerCase();if(i.includes("name")||i.includes("title"))return t.name}return null}function YS(e,t){for(const i of e)if(i!=null&&i.valueType&&i.valueType===t)return i.name;return null}async function V0e(e,t){var r;if(!t)return;const i=(r=t.elevationInfo)==null?void 0:r.featureExpressionInfo;return i?i.collectRequiredFields(e,t.fieldsIndex):void 0}function qie(e,t,i){i.onStatisticExpression?wh(e,t,i.onStatisticExpression.expression):e.add(i.onStatisticField)}async function G0e(e,t,i){if(!t||!i||!("fields"in i))return;const r=[],s=i.popupTemplate;r.push(Hie(e,t,s)),i.fields&&r.push(...i.fields.map(async n=>qie(e,t.fieldsIndex,n))),await Promise.all(r)}async function Hie(e,t,i){const r=[];i!=null&&i.expressionInfos&&r.push(...i.expressionInfos.map(n=>wh(e,t.fieldsIndex,n.expression)));const s=i==null?void 0:i.content;if(Array.isArray(s))for(const n of s)n.type==="expression"&&n.expressionInfo&&r.push(wh(e,t.fieldsIndex,n.expressionInfo.expression));await Promise.all(r)}async function q0e(e,t,i){t&&(t.timeInfo&&(i!=null&&i.timeExtent)&&t_(e,t.fieldsIndex,[t.timeInfo.startField,t.timeInfo.endField]),t.floorInfo&&t_(e,t.fieldsIndex,[t.floorInfo.floorField]),(i==null?void 0:i.where)!=null&&await zF(e,t.fieldsIndex,i.where))}async function H0e(e,t,i){t&&i&&await Promise.all(i.map(r=>Wie(e,t,r)))}async function Wie(e,t,i){t&&i&&(i.valueExpression?await wh(e,t.fieldsIndex,i.valueExpression):i.field&&Vx(e,t.fieldsIndex,i.field))}function W0e(e){return e?v3(e.fieldsIndex,FF(e)):[]}function Zie(e){if(!e)return[];const t=e.geometryFieldsInfo;return t?v3(e.fieldsIndex,[t.shapeAreaField,t.shapeLengthField]):[]}const Yie=new Set(["oid","global-id","guid"]),Jie=new Set(["oid","global-id"]),Kie=[/^fnode_$/i,/^tnode_$/i,/^lpoly_$/i,/^rpoly_$/i,/^poly_$/i,/^shape$/i,/^shape_$/i,/^subclass$/i,/^subclass_$/i,/^rings_ok$/i,/^rings_nok$/i,/perimeter/i,/objectid/i,/_i$/i];function Xie(e){const t=new Set;BF(e).forEach(r=>t.add(r)),Zie(e).forEach(r=>t.add(r.toLowerCase()));const i=e&&"infoFor3D"in e?e.infoFor3D:void 0;return i&&(Object.values(i.assetMapFieldRoles).forEach(r=>t.add(r.toLowerCase())),Object.values(i.transformFieldRoles).forEach(r=>t.add(r.toLowerCase()))),Array.from(t)}function FF(e){if(!e)return[];const t="editFieldsInfo"in e&&e.editFieldsInfo;if(!t)return[];const{creationDateField:i,creatorField:r,editDateField:s,editorField:n}=t;return[i,r,s,n].filter(Boolean)}function BF(e){return FF(e).map(t=>t.toLowerCase())}function Z0e(e,t){var i;return e.editable&&!Yie.has(e.type)&&!BF(t).includes(((i=e.name)==null?void 0:i.toLowerCase())??"")}function Y0e(e,t){var r;const i=((r=e.name)==null?void 0:r.toLowerCase())??"";return!((t==null?void 0:t.objectIdField)!=null&&i===t.objectIdField.toLowerCase()||(t==null?void 0:t.globalIdField)!=null&&i===t.globalIdField.toLowerCase()||Xie(t).includes(i)||Jie.has(e.type)||Kie.some(s=>s.test(i)))}async function J0e(e,t){const{labelingInfo:i,fieldsIndex:r}=t;i!=null&&i.length&&await Promise.all(i.map(s=>Qie(e,r,s)))}async function Qie(e,t,i){if(!i)return;const r=i.getLabelExpression(),s=i.where;if(r.type==="arcade")await wh(e,t,r.expression);else{const n=r.expression.match(/{[^}]*}/g);n&&n.forEach(c=>{Vx(e,t,c.slice(1,-1))})}await zF(e,t,s)}function K0e(e){const t=e.defaultValue;return t!==void 0&&VF(e,t)?t:e.nullable?null:void 0}function X0e(e){const t=typeof e=="string"?{type:e}:e;return dre(t)?255:t.type==="esriFieldTypeDate"||t.type==="date"?8:void 0}function UF(e){return typeof e=="number"&&!isNaN(e)&&isFinite(e)}function ere(e){return e===null||UF(e)}function tre(e){return e===null||Number.isInteger(e)}function jF(e){return e!=null&&typeof e=="string"}function ire(e){return e===null||jF(e)}function rre(){return!0}function VF(e,t){let i;switch(e.type){case"date":case"integer":case"long":case"small-integer":case"big-integer":case"esriFieldTypeDate":case"esriFieldTypeInteger":case"esriFieldTypeLong":case"esriFieldTypeSmallInteger":case"esriFieldTypeBigInteger":i=e.nullable?tre:Number.isInteger;break;case"double":case"single":case"esriFieldTypeSingle":case"esriFieldTypeDouble":i=e.nullable?ere:UF;break;case"string":case"esriFieldTypeString":i=e.nullable?ire:jF;break;default:i=rre}return arguments.length===1?i:i(t)}const sre=["integer","small-integer","big-integer"],nre=["single","double"],ore=["esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeBigInteger"],are=["esriFieldTypeSingle","esriFieldTypeDouble"],lre=new Set([...sre,...ore]),cre=new Set([...nre,...are]),ure=s4(lre,cre);function hre(e){return e!=null&&ure.has(e.type)}function dre(e){return e!=null&&(e.type==="string"||e.type==="esriFieldTypeString")}function Q0e(e){return e!=null&&(e.type==="date"||e.type==="esriFieldTypeDate")}function e_e(e){return e!=null&&(e.type==="date-only"||e.type==="esriFieldTypeDateOnly")}function t_e(e){return e!=null&&(e.type==="timestamp-offset"||e.type==="esriFieldTypeTimestampOffset")}function i_e(e){return e!=null&&(e.type==="time-only"||e.type==="esriFieldTypeTimeOnly")}function r_e(e){return e!=null&&(e.type==="oid"||e.type==="esriFieldTypeOID")}function s_e(e){return e!=null&&(e.type==="global-id"||e.type==="esriFieldTypeGlobalID")}function n_e(e,t){return pre(e,t)===null}var Rw,Ow;function o_e(e){return e==null||typeof e=="number"&&isNaN(e)?null:e}function pre(e,t){return e==null||e.nullable&&t===null?null:hre(e)&&!fre(e.type,Number(t))?Rw.OUT_OF_RANGE:VF(e,t)?e.domain?Die(e,t):null:Ow.INVALID_TYPE}function fre(e,t){const i=typeof e=="string"?GF(e):e;if(!i)return!1;const r=i.min,s=i.max;return i.isInteger?Number.isInteger(t)&&t>=r&&t<=s:t>=r&&t<=s}function GF(e){switch(e){case"esriFieldTypeSmallInteger":case"small-integer":return mre;case"esriFieldTypeInteger":case"integer":return yre;case"esriFieldTypeBigInteger":case"big-integer":return gre;case"esriFieldTypeSingle":case"single":return _re;case"esriFieldTypeDouble":case"double":return vre}}(function(e){e.OUT_OF_RANGE="numeric-range-validation-error::out-of-range"})(Rw||(Rw={})),function(e){e.INVALID_TYPE="type-validation-error::invalid-type"}(Ow||(Ow={}));const mre={min:-32768,max:32767,isInteger:!0,rawMin:-32768,rawMax:32767},yre={min:-2147483648,max:2147483647,isInteger:!0,rawMin:-2147483648,rawMax:2147483647},gre={min:-Number.MAX_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,isInteger:!0,rawMin:-Number.MAX_SAFE_INTEGER,rawMax:Number.MAX_SAFE_INTEGER},_re={min:-34e37,max:12e37,isInteger:!1,rawMin:-34e37,rawMax:12e37},vre={min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isInteger:!1,rawMin:-Number.MAX_VALUE,rawMax:Number.MAX_VALUE};function a_e(e,t,i){switch(e){case Dm.INVALID_CODED_VALUE:return`Value ${i} is not in the coded domain - field: ${t.name}, domain: ${JSON.stringify(t.domain)}`;case Dm.VALUE_OUT_OF_RANGE:return`Value ${i} is out of the range of valid values - field: ${t.name}, domain: ${JSON.stringify(t.domain)}`;case Ow.INVALID_TYPE:return`Value ${i} is not a valid value for the field type - field: ${t.name}, type: ${t.type}, nullable: ${t.nullable}`;case Rw.OUT_OF_RANGE:{const{min:r,max:s}=GF(t.type);return`Value ${i} is out of range for the number type - field: ${t.name}, type: ${t.type}, value range is ${r} to ${s}`}}}function l_e(e,t){return!bre(e,t,null)}function bre(e,t,i){if(!(t!=null&&t.attributes)||!e){if(i!=null)for(const n of e??[])i.add(n);return!0}const r=new Set(Object.keys(t.attributes));let s=!1;for(const n of e)if(!r.has(n)){if(s=!0,i==null)break;i.add(n)}return s}function c_e(e){return!!e&&["raster.itempixelvalue","raster.servicepixelvalue"].some(t=>e.toLowerCase().startsWith(t))}let ob=class extends At{constructor(t){super(t),this.type=null}};v([M({type:["attachments","custom","fields","media","text","expression","relationship"],readOnly:!0,json:{read:!1,write:!0}})],ob.prototype,"type",void 0),ob=v([fe("esri.popup.content.Content")],ob);const Ch=ob;var GE;let md=GE=class extends Ch{constructor(e){super(e),this.description=null,this.displayType="auto",this.title=null,this.type="attachments"}clone(){return new GE({description:this.description,displayType:this.displayType,title:this.title})}};v([M({type:String,json:{write:!0}})],md.prototype,"description",void 0),v([M({type:["auto","preview","list"],json:{write:!0}})],md.prototype,"displayType",void 0),v([M({type:String,json:{write:!0}})],md.prototype,"title",void 0),v([M({type:["attachments"],readOnly:!0,json:{read:!1,write:!0}})],md.prototype,"type",void 0),md=GE=v([fe("esri.popup.content.AttachmentsContent")],md);const Lw=md;var qE;let yd=qE=class extends Ch{constructor(e){super(e),this.creator=null,this.destroyer=null,this.outFields=null,this.type="custom"}clone(){return new qE({creator:this.creator,destroyer:this.destroyer,outFields:Array.isArray(this.outFields)?He(this.outFields):null})}};v([M()],yd.prototype,"creator",void 0),v([M()],yd.prototype,"destroyer",void 0),v([M()],yd.prototype,"outFields",void 0),v([M({type:["custom"],readOnly:!0})],yd.prototype,"type",void 0),yd=qE=v([fe("esri.popup.content.CustomContent")],yd);const wre=yd;var HE;let Df=HE=class extends At{constructor(e){super(e),this.title=null,this.expression=null,this.returnType="dictionary"}clone(){return new HE({title:this.title,expression:this.expression})}};v([M({type:String,json:{write:!0}})],Df.prototype,"title",void 0),v([M({type:String,json:{write:!0}})],Df.prototype,"expression",void 0),v([M({type:["dictionary"],readOnly:!0,json:{read:!1,write:!0}})],Df.prototype,"returnType",void 0),Df=HE=v([fe("esri.popup.ElementExpressionInfo")],Df);const xre=Df;var WE;let Rg=WE=class extends Ch{constructor(e){super(e),this.expressionInfo=null,this.type="expression"}clone(){var e;return new WE({expressionInfo:(e=this.expressionInfo)==null?void 0:e.clone()})}};v([M({type:xre,json:{write:!0}})],Rg.prototype,"expressionInfo",void 0),v([M({type:["expression"],readOnly:!0,json:{read:!1,write:!0}})],Rg.prototype,"type",void 0),Rg=WE=v([fe("esri.popup.content.ExpressionContent")],Rg);const b3=Rg;let Nf=class extends jl(At){constructor(t){super(t),this.dateFormat=null,this.digitSeparator=!1,this.places=null}};v([Gt(HQ)],Nf.prototype,"dateFormat",void 0),v([M({type:Boolean,json:{write:!0}})],Nf.prototype,"digitSeparator",void 0),v([M({type:$r,json:{write:!0}})],Nf.prototype,"places",void 0),Nf=v([fe("esri.popup.support.FieldInfoFormat")],Nf);const Sre=Nf;var ZE;let Aa=ZE=class extends At{constructor(e){super(e),this.fieldName=null,this.format=null,this.isEditable=!0,this.label=null,this.stringFieldOption="text-box",this.statisticType=null,this.tooltip=null,this.visible=!0}clone(){return new ZE({fieldName:this.fieldName,format:this.format?He(this.format):null,isEditable:this.isEditable,label:this.label,stringFieldOption:this.stringFieldOption,statisticType:this.statisticType,tooltip:this.tooltip,visible:this.visible})}};v([M({type:String,json:{write:!0}})],Aa.prototype,"fieldName",void 0),v([M({type:Sre,json:{write:!0}})],Aa.prototype,"format",void 0),v([M({type:Boolean,json:{write:{alwaysWriteDefaults:!0},default:!0}})],Aa.prototype,"isEditable",void 0),v([M({type:String,json:{write:!0}})],Aa.prototype,"label",void 0),v([Gt(new ks({richtext:"rich-text",textarea:"text-area",textbox:"text-box"}),{default:"text-box"})],Aa.prototype,"stringFieldOption",void 0),v([M({type:["count","sum","min","max","avg","stddev","var"],json:{write:!0}})],Aa.prototype,"statisticType",void 0),v([M({type:String,json:{write:!0}})],Aa.prototype,"tooltip",void 0),v([M({type:Boolean,json:{write:!0}})],Aa.prototype,"visible",void 0),Aa=ZE=v([fe("esri.popup.FieldInfo")],Aa);const qF=Aa;var YE;let wc=YE=class extends Ch{constructor(e){super(e),this.attributes=null,this.description=null,this.fieldInfos=null,this.title=null,this.type="fields"}writeFieldInfos(e,t){t.fieldInfos=e&&e.map(i=>i.toJSON())}clone(){return new YE(He({attributes:this.attributes,description:this.description,fieldInfos:this.fieldInfos,title:this.title}))}};v([M({type:Object,json:{write:!0}})],wc.prototype,"attributes",void 0),v([M({type:String,json:{write:!0}})],wc.prototype,"description",void 0),v([M({type:[qF]})],wc.prototype,"fieldInfos",void 0),v([ui("fieldInfos")],wc.prototype,"writeFieldInfos",null),v([M({type:String,json:{write:!0}})],wc.prototype,"title",void 0),v([M({type:["fields"],readOnly:!0,json:{read:!1,write:!0}})],wc.prototype,"type",void 0),wc=YE=v([fe("esri.popup.content.FieldsContent")],wc);const Dw=wc;let gd=class extends At{constructor(t){super(t),this.altText=null,this.caption="",this.title="",this.type=null}};v([M({type:String,json:{write:!0}})],gd.prototype,"altText",void 0),v([M({type:String,json:{write:!0}})],gd.prototype,"caption",void 0),v([M({type:String,json:{write:!0}})],gd.prototype,"title",void 0),v([M({type:["image","bar-chart","column-chart","line-chart","pie-chart"],readOnly:!0,json:{read:!1,write:!0}})],gd.prototype,"type",void 0),gd=v([fe("esri.popup.content.mixins.MediaInfo")],gd);const w3=gd;var JE;let _d=JE=class extends Nt{constructor(e){super(e),this.color=null,this.fieldName=null,this.tooltip=null,this.value=null}clone(){return new JE({fieldName:this.fieldName,tooltip:this.tooltip,value:this.value})}};v([M()],_d.prototype,"color",void 0),v([M()],_d.prototype,"fieldName",void 0),v([M()],_d.prototype,"tooltip",void 0),v([M()],_d.prototype,"value",void 0),_d=JE=v([fe("esri.popup.content.support.ChartMediaInfoValueSeries")],_d);const Tre=_d;var KE;let Ru=KE=class extends At{constructor(e){super(e),this.colors=null,this.fields=[],this.normalizeField=null,this.series=[],this.tooltipField=null}clone(){return new KE({colors:He(this.colors),fields:He(this.fields),normalizeField:this.normalizeField,tooltipField:this.tooltipField})}};v([M({type:[zt],json:{type:[[$r]],write:!0}})],Ru.prototype,"colors",void 0),v([M({type:[String],json:{write:!0}})],Ru.prototype,"fields",void 0),v([M({type:String,json:{write:!0}})],Ru.prototype,"normalizeField",void 0),v([M({type:[Tre],json:{read:!1}})],Ru.prototype,"series",void 0),v([M({type:String,json:{write:!0}})],Ru.prototype,"tooltipField",void 0),Ru=KE=v([fe("esri.popup.content.support.ChartMediaInfoValue")],Ru);const Ere=Ru;let Og=class extends w3{constructor(t){super(t),this.type=null,this.value=null}};v([M({type:["bar-chart","column-chart","line-chart","pie-chart"],readOnly:!0,json:{read:!1,write:!0}})],Og.prototype,"type",void 0),v([M({type:Ere,json:{write:!0}})],Og.prototype,"value",void 0),Og=v([fe("esri.popup.content.mixins.ChartMediaInfo")],Og);const Gx=Og,qx=Bn()({barchart:"bar-chart",columnchart:"column-chart",linechart:"line-chart",piechart:"pie-chart"});var XE;let ab=XE=class extends Gx{constructor(e){super(e),this.type="bar-chart"}clone(){return new XE({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};v([M({type:["bar-chart"],readOnly:!0,json:{type:["barchart"],read:!1,write:qx.write}})],ab.prototype,"type",void 0),ab=XE=v([fe("esri.popup.content.BarChartMediaInfo")],ab);const HF=ab;var QE;let lb=QE=class extends Gx{constructor(e){super(e),this.type="column-chart"}clone(){return new QE({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};v([M({type:["column-chart"],readOnly:!0,json:{type:["columnchart"],read:!1,write:qx.write}})],lb.prototype,"type",void 0),lb=QE=v([fe("esri.popup.content.ColumnChartMediaInfo")],lb);const WF=lb;var eM;let Lg=eM=class extends At{constructor(e){super(e),this.linkURL=null,this.sourceURL=null}clone(){return new eM({linkURL:this.linkURL,sourceURL:this.sourceURL})}};v([M({type:String,json:{write:!0}})],Lg.prototype,"linkURL",void 0),v([M({type:String,json:{write:!0}})],Lg.prototype,"sourceURL",void 0),Lg=eM=v([fe("esri.popup.content.support.ImageMediaInfoValue")],Lg);const Mre=Lg;var tM;let zf=tM=class extends w3{constructor(e){super(e),this.refreshInterval=null,this.type="image",this.value=null}clone(){return new tM({altText:this.altText,title:this.title,caption:this.caption,refreshInterval:this.refreshInterval,value:this.value?this.value.clone():null})}};v([M({type:Number,json:{write:!0}})],zf.prototype,"refreshInterval",void 0),v([M({type:["image"],readOnly:!0,json:{read:!1,write:!0}})],zf.prototype,"type",void 0),v([M({type:Mre,json:{write:!0}})],zf.prototype,"value",void 0),zf=tM=v([fe("esri.popup.content.ImageMediaInfo")],zf);const ZF=zf;var iM;let cb=iM=class extends Gx{constructor(e){super(e),this.type="line-chart"}clone(){return new iM({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};v([M({type:["line-chart"],readOnly:!0,json:{type:["linechart"],read:!1,write:qx.write}})],cb.prototype,"type",void 0),cb=iM=v([fe("esri.popup.content.LineChartMediaInfo")],cb);const YF=cb;var rM;let ub=rM=class extends Gx{constructor(e){super(e),this.type="pie-chart"}clone(){return new rM({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};v([M({type:["pie-chart"],readOnly:!0,json:{type:["piechart"],read:!1,write:qx.write}})],ub.prototype,"type",void 0),ub=rM=v([fe("esri.popup.content.PieChartMediaInfo")],ub);const JF=ub,KF={base:w3,key:"type",defaultKeyValue:"image",typeMap:{"bar-chart":HF,"column-chart":WF,"line-chart":YF,"pie-chart":JF,image:ZF}};var sM;let Pa=sM=class extends Ch{constructor(e){super(e),this.activeMediaInfoIndex=null,this.attributes=null,this.description=null,this.mediaInfos=null,this.title=null,this.type="media"}readMediaInfos(e){return e&&e.map(t=>t.type==="image"?ZF.fromJSON(t):t.type==="barchart"?HF.fromJSON(t):t.type==="columnchart"?WF.fromJSON(t):t.type==="linechart"?YF.fromJSON(t):t.type==="piechart"?JF.fromJSON(t):void 0).filter(Boolean)}writeMediaInfos(e,t){t.mediaInfos=e&&e.map(i=>i.toJSON())}clone(){return new sM(He({activeMediaInfoIndex:this.activeMediaInfoIndex,attributes:this.attributes,description:this.description,mediaInfos:this.mediaInfos,title:this.title}))}};v([M()],Pa.prototype,"activeMediaInfoIndex",void 0),v([M({type:Object,json:{write:!0}})],Pa.prototype,"attributes",void 0),v([M({type:String,json:{write:!0}})],Pa.prototype,"description",void 0),v([M({types:[KF]})],Pa.prototype,"mediaInfos",void 0),v([mi("mediaInfos")],Pa.prototype,"readMediaInfos",null),v([ui("mediaInfos")],Pa.prototype,"writeMediaInfos",null),v([M({type:String,json:{write:!0}})],Pa.prototype,"title",void 0),v([M({type:["media"],readOnly:!0,json:{read:!1,write:!0}})],Pa.prototype,"type",void 0),Pa=sM=v([fe("esri.popup.content.MediaContent")],Pa);const Nw=Pa;var nM;let Dg=nM=class extends At{constructor(e){super(e),this.field=null,this.order=null}clone(){return new nM({field:this.field,order:this.order})}};v([M({type:String,json:{write:!0}})],Dg.prototype,"field",void 0),v([M({type:["asc","desc"],json:{write:!0}})],Dg.prototype,"order",void 0),Dg=nM=v([fe("esri.popup.support.RelatedRecordsInfoFieldOrder")],Dg);const XF=Dg;let yl=class extends jl(Ch){constructor(t){super(t),this.description=null,this.displayCount=null,this.displayType="list",this.orderByFields=null,this.relationshipId=null,this.title=null,this.type="relationship"}};v([M({type:String,json:{write:!0}})],yl.prototype,"description",void 0),v([M({type:Number,json:{type:$r,write:!0}})],yl.prototype,"displayCount",void 0),v([M({type:["list"],json:{write:!0}})],yl.prototype,"displayType",void 0),v([M({type:[XF],json:{write:!0}})],yl.prototype,"orderByFields",void 0),v([M({type:Number,json:{type:$r,write:!0}})],yl.prototype,"relationshipId",void 0),v([M({type:String,json:{write:!0}})],yl.prototype,"title",void 0),v([M({type:["relationship"],readOnly:!0,json:{read:!1,write:!0}})],yl.prototype,"type",void 0),yl=v([fe("esri.popup.content.RelationshipContent")],yl);const zw=yl;var oM;let Ng=oM=class extends Ch{constructor(e){super(e),this.text=null,this.type="text"}clone(){return new oM({text:this.text})}};v([M({type:String,json:{write:!0}})],Ng.prototype,"text",void 0),v([M({type:["text"],readOnly:!0,json:{read:!1,write:!0}})],Ng.prototype,"type",void 0),Ng=oM=v([fe("esri.popup.content.TextContent")],Ng);const Fw=Ng,Ire={base:null,key:"type",typeMap:{attachment:Lw,media:Nw,text:Fw,expression:b3,field:Dw,relationship:zw}};var aM;let vd=aM=class extends At{constructor(e){super(e),this.name=null,this.title=null,this.expression=null,this.returnType=null}clone(){return new aM({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};v([M({type:String,json:{write:!0}})],vd.prototype,"name",void 0),v([M({type:String,json:{write:!0}})],vd.prototype,"title",void 0),v([M({type:String,json:{write:!0}})],vd.prototype,"expression",void 0),v([M({type:["string","number"],json:{write:!0}})],vd.prototype,"returnType",void 0),vd=aM=v([fe("esri.popup.ExpressionInfo")],vd);const Are=vd;var lM;let zg=lM=class extends At{constructor(e){super(e),this.returnTopmostRaster=null,this.showNoDataRecords=null}clone(){return new lM({showNoDataRecords:this.showNoDataRecords,returnTopmostRaster:this.returnTopmostRaster})}};v([M({type:Boolean,json:{write:!0}})],zg.prototype,"returnTopmostRaster",void 0),v([M({type:Boolean,json:{write:!0}})],zg.prototype,"showNoDataRecords",void 0),zg=lM=v([fe("esri.popup.LayerOptions")],zg);const Pre=zg;var cM;let Fg=cM=class extends At{constructor(e){super(e),this.showRelatedRecords=null,this.orderByFields=null}clone(){return new cM({showRelatedRecords:this.showRelatedRecords,orderByFields:this.orderByFields?He(this.orderByFields):null})}};v([M({type:Boolean,json:{write:!0}})],Fg.prototype,"showRelatedRecords",void 0),v([M({type:[XF],json:{write:!0}})],Fg.prototype,"orderByFields",void 0),Fg=cM=v([fe("esri.popup.RelatedRecordsInfo")],Fg);const Cre=Fg;var uM;let qo=uM=class extends HA(Nt){constructor(e){super(e),this.active=!1,this.className=null,this.disabled=!1,this.icon=null,this.id=null,this.indicator=!1,this.title=null,this.type=null,this.visible=!0}clone(){return new uM({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible})}};v([M()],qo.prototype,"active",void 0),v([M()],qo.prototype,"className",void 0),v([M()],qo.prototype,"disabled",void 0),v([M()],qo.prototype,"icon",void 0),v([M()],qo.prototype,"id",void 0),v([M()],qo.prototype,"indicator",void 0),v([M()],qo.prototype,"title",void 0),v([M()],qo.prototype,"type",void 0),v([M()],qo.prototype,"visible",void 0),qo=uM=v([fe("esri.support.actions.ActionBase")],qo);const x3=qo;var hM;let hb=hM=class extends x3{constructor(e){super(e),this.image=null,this.type="button"}clone(){return new hM({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image})}};v([M()],hb.prototype,"image",void 0),hb=hM=v([fe("esri.support.Action.ActionButton")],hb);const $re=hb;var dM;let Bg=dM=class extends x3{constructor(e){super(e),this.image=null,this.type="toggle",this.value=!1}clone(){return new dM({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image,value:this.value})}};v([M()],Bg.prototype,"image",void 0),v([M()],Bg.prototype,"value",void 0),Bg=dM=v([fe("esri.support.Action.ActionToggle")],Bg);const kre=Bg,xg="relationships/",wR="expression/",Rre=Bt.ofType({key:"type",defaultKeyValue:"button",base:x3,typeMap:{button:$re,toggle:kre}}),Ore={base:Ch,key:"type",typeMap:{media:Nw,custom:wre,text:Fw,attachments:Lw,fields:Dw,expression:b3,relationship:zw}},Lre=new Set(["attachments","fields","media","text","expression","relationship"]);let _s=class extends jl(At){constructor(){super(...arguments),this.actions=null,this.content="",this.expressionInfos=null,this.fieldInfos=null,this.layerOptions=null,this.lastEditInfoEnabled=!0,this.outFields=null,this.overwriteActions=!1,this.returnGeometry=!1,this.title=""}castContent(t){return Array.isArray(t)?t.map(i=>Uc(Ore,i)):typeof t=="string"||typeof t=="function"||t instanceof HTMLElement||xh(t)?t:(_t.getLogger(this).error("content error","unsupported content value",{value:t}),null)}readContent(t,i){const{popupElements:r}=i;return Array.isArray(r)&&r.length>0?this._readPopupInfoElements(i.description,i.mediaInfos,r):this._readPopupInfo(i)}writeContent(t,i,r,s){typeof t!="string"?Array.isArray(t)&&(i.popupElements=t.filter(n=>Lre.has(n.type)).map(n=>n==null?void 0:n.toJSON(s)),i.popupElements.forEach(n=>{n.type==="attachments"?this._writeAttachmentContent(i):n.type==="media"?this._writeMediaContent(n,i):n.type==="text"?this._writeTextContent(n,i):n.type==="relationship"&&this._writeRelationshipContent(n,i)})):i.description=t}writeFieldInfos(t,i,r,s){const{content:n}=this,c=Array.isArray(n)?n:null;if(t){const o=c?c.filter(g=>g.type==="fields"):[],f=o.length&&o.every(g=>{var S;return(S=g.fieldInfos)==null?void 0:S.length});i.fieldInfos=t.filter(Boolean).map(g=>{const S=g.toJSON(s);return f&&(S.visible=!1),S})}if(c)for(const o of c)o.type==="fields"&&this._writeFieldsContent(o,i)}writeLayerOptions(t,i,r,s){i[r]=!t||t.showNoDataRecords===null&&t.returnTopmostRaster===null?null:t.toJSON(s)}writeTitle(t,i){i.title=t||""}async collectRequiredFields(t,i){const r=this.expressionInfos||[];await this._collectExpressionInfoFields(t,i,[...r,...this._getContentExpressionInfos(this.content,r)]),t_(t,i,[...this.outFields||[],...this._getActionsFields(this.actions),...this._getTitleFields(this.title),...this._getContentFields(this.content)])}async getRequiredFields(t){const i=new Set;return await this.collectRequiredFields(i,t),[...i].sort()}_writeFieldsContent(t,i){if(!Array.isArray(t.fieldInfos)||!t.fieldInfos.length)return;const r=He(t.fieldInfos);Array.isArray(i.fieldInfos)?r.forEach(s=>{const n=i.fieldInfos.find(c=>c.fieldName.toLowerCase()===s.fieldName.toLowerCase());n?n.visible=!0:i.fieldInfos.push(s)}):i.fieldInfos=r}_writeAttachmentContent(t){t.showAttachments||(t.showAttachments=!0)}_writeRelationshipContent(t,i){var n,c;const r=((n=t.orderByFields)==null?void 0:n.map(o=>this._toFieldOrderJSON(o,t.relationshipId)))||[],s=[...((c=i.relatedRecordsInfo)==null?void 0:c.orderByFields)||[],...r];i.relatedRecordsInfo={showRelatedRecords:!0,...(s==null?void 0:s.length)&&{orderByFields:s}}}_writeTextContent(t,i){!i.description&&t.text&&(i.description=t.text)}_writeMediaContent(t,i){if(!Array.isArray(t.mediaInfos)||!t.mediaInfos.length)return;const r=He(t.mediaInfos);Array.isArray(i.mediaInfos)?i.mediaInfos=[...i.mediaInfos,...r]:i.mediaInfos=r}_readPopupInfoElements(t,i,r){const s={description:!1,mediaInfos:!1};return r.map(n=>n.type==="media"?(n.mediaInfos||!i||s.mediaInfos||(n.mediaInfos=i,s.mediaInfos=!0),Nw.fromJSON(n)):n.type==="text"?(n.text||!t||s.description||(n.text=t,s.description=!0),Fw.fromJSON(n)):n.type==="attachments"?Lw.fromJSON(n):n.type==="fields"?Dw.fromJSON(n):n.type==="expression"?b3.fromJSON(n):n.type==="relationship"?zw.fromJSON(n):void 0).filter(Boolean)}_toRelationshipContent(t){const{field:i,order:r}=t;if(!(i!=null&&i.startsWith(xg)))return null;const s=i.replace(xg,"").split("/");if(s.length!==2)return null;const n=parseInt(s[0],10),c=s[1];return typeof n=="number"&&c?zw.fromJSON({relationshipId:n,orderByFields:[{field:c,order:r}]}):null}_toFieldOrderJSON(t,i){const{order:r,field:s}=t;return{field:`${xg}${i}/${s}`,order:r}}_readPopupInfo({description:t,mediaInfos:i,showAttachments:r,relatedRecordsInfo:s={showRelatedRecords:!1}}){const n=[];t?n.push(new Fw({text:t})):n.push(new Dw),Array.isArray(i)&&i.length&&n.push(Nw.fromJSON({mediaInfos:i})),r&&n.push(Lw.fromJSON({displayType:"auto"}));const{showRelatedRecords:c,orderByFields:o}=s;return c&&(o!=null&&o.length)&&o.forEach(f=>{const g=this._toRelationshipContent(f);g&&n.push(g)}),n.length?n:t}_getContentElementFields(t){const i=t==null?void 0:t.type;if(i==="attachments")return[...this._extractFieldNames(t.title),...this._extractFieldNames(t.description)];if(i==="custom")return t.outFields||[];if(i==="fields")return[...this._extractFieldNames(t.title),...this._extractFieldNames(t.description),...this._getFieldInfoFields(t.fieldInfos??this.fieldInfos)];if(i==="media"){const r=t.mediaInfos||[];return[...this._extractFieldNames(t.title),...this._extractFieldNames(t.description),...r.reduce((s,n)=>[...s,...this._getMediaInfoFields(n)],[])]}return i==="text"?this._extractFieldNames(t.text):[]}_getMediaInfoFields(t){const{caption:i,title:r,value:s}=t,n=s||{},{fields:c,normalizeField:o,tooltipField:f,sourceURL:g,linkURL:S}=n,I=[...this._extractFieldNames(r),...this._extractFieldNames(i),...this._extractFieldNames(g),...this._extractFieldNames(S),...c??[]];return o&&I.push(o),f&&I.push(f),I}_getContentExpressionInfos(t,i){return Array.isArray(t)?t.reduce((r,s)=>[...r,...s.type==="expression"&&s.expressionInfo?[s.expressionInfo]:[]],i):[]}_getContentFields(t){return typeof t=="string"?this._extractFieldNames(t):Array.isArray(t)?t.reduce((i,r)=>[...i,...this._getContentElementFields(r)],[]):[]}async _collectExpressionInfoFields(t,i,r){r&&await Promise.all(r.map(s=>wh(t,i,s.expression)))}_getFieldInfoFields(t){return t?t.filter(i=>i.visible===void 0||!!i.visible).map(i=>i.fieldName).filter(i=>!i.startsWith(xg)&&!i.startsWith(wR)):[]}_getActionsFields(t){return t?t.toArray().reduce((i,r)=>[...i,...this._getActionFields(r)],[]):[]}_getActionFields(t){const{className:i,title:r,type:s}=t,n=s==="button"||s==="toggle"?t.image:"";return[...this._extractFieldNames(r),...this._extractFieldNames(i),...this._extractFieldNames(n)]}_getTitleFields(t){return typeof t=="string"?this._extractFieldNames(t):[]}_extractFieldNames(t){if(!t||typeof t!="string")return[];const i=/{[^}]*}/g,r=t.match(i);if(!r)return[];const s=/\{(\w+):.+\}/,n=r.filter(c=>!(c.indexOf(`{${xg}`)===0||c.indexOf(`{${wR}`)===0)).map(c=>c.replace(s,"{$1}"));return n?n.map(c=>c.slice(1,-1)):[]}};v([M({type:Rre})],_s.prototype,"actions",void 0),v([M()],_s.prototype,"content",void 0),v([Rs("content")],_s.prototype,"castContent",null),v([mi("content",["description","fieldInfos","popupElements","mediaInfos","showAttachments","relatedRecordsInfo"])],_s.prototype,"readContent",null),v([ui("content",{popupElements:{type:Bt.ofType(Ire)},showAttachments:{type:Boolean},mediaInfos:{type:Bt.ofType(KF)},description:{type:String},relatedRecordsInfo:{type:Cre}})],_s.prototype,"writeContent",null),v([M({type:[Are],json:{write:!0}})],_s.prototype,"expressionInfos",void 0),v([M({type:[qF]})],_s.prototype,"fieldInfos",void 0),v([ui("fieldInfos")],_s.prototype,"writeFieldInfos",null),v([M({type:Pre})],_s.prototype,"layerOptions",void 0),v([ui("layerOptions")],_s.prototype,"writeLayerOptions",null),v([M({type:Boolean,json:{read:{source:"showLastEditInfo"},write:{target:"showLastEditInfo"},default:!0}})],_s.prototype,"lastEditInfoEnabled",void 0),v([M()],_s.prototype,"outFields",void 0),v([M()],_s.prototype,"overwriteActions",void 0),v([M()],_s.prototype,"returnGeometry",void 0),v([M({json:{type:String}})],_s.prototype,"title",void 0),v([ui("title")],_s.prototype,"writeTitle",null),_s=v([fe("esri.PopupTemplate")],_s);const Dre=_s,xR=new ks({esriSMS:"simple-marker",esriPMS:"picture-marker",esriSLS:"simple-line",esriSFS:"simple-fill",esriPFS:"picture-fill",esriTS:"text",esriSHD:"shield-label-symbol",PointSymbol3D:"point-3d",LineSymbol3D:"line-3d",PolygonSymbol3D:"polygon-3d",WebStyleSymbol:"web-style",MeshSymbol3D:"mesh-3d",LabelSymbol3D:"label-3d",CIMSymbolReference:"cim"});let Nre=0,Ff=class extends At{constructor(t){super(t),this.id="sym"+Nre++,this.type=null,this.color=new zt([0,0,0,1])}readColor(t){return(t==null?void 0:t[0])!=null?[t[0],t[1],t[2],t[3]/255]:t}async collectRequiredFields(t,i){}hash(){return JSON.stringify(this.toJSON())}clone(){}};v([M({type:xR.apiValues,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:xR.write}}})],Ff.prototype,"type",void 0),v([M({type:zt,json:{write:{allowNull:!0}}})],Ff.prototype,"color",void 0),v([mi("color")],Ff.prototype,"readColor",null),Ff=v([fe("esri.symbols.Symbol")],Ff);const Mo=Ff;var pM;let Ou=pM=class extends Mo{constructor(e){super(e),this.data=null,this.type="cim"}readData(e,t){return t}writeData(e,t){Object.assign(t,e)}async collectRequiredFields(e,t){var i;if(((i=this.data)==null?void 0:i.type)==="CIMSymbolReference"){const r=this.data.primitiveOverrides;if(r){const s=r.map(n=>{const c=n.valueExpressionInfo;return c?wh(e,t,c.expression):null});await Promise.all(s)}}}clone(){return new pM({data:He(this.data)})}hash(){return L5(JSON.stringify(this.data)).toString()}};v([M({json:{write:!1}})],Ou.prototype,"color",void 0),v([M({json:{write:!0}})],Ou.prototype,"data",void 0),v([mi("data",["symbol"])],Ou.prototype,"readData",null),v([ui("data",{})],Ou.prototype,"writeData",null),v([Gt({CIMSymbolReference:"cim"},{readOnly:!0})],Ou.prototype,"type",void 0),Ou=pM=v([fe("esri.symbols.CIMSymbol")],Ou);const Hx=Ou;let Bf=class extends At{constructor(t){super(t),this.enabled=!0,this.type=null,this.ignoreDrivers=!1}writeEnabled(t,i,r){t||(i[r]=t)}};v([M({type:Boolean,json:{read:{source:"enable"},write:{target:"enable"}}})],Bf.prototype,"enabled",void 0),v([ui("enabled")],Bf.prototype,"writeEnabled",null),v([M({type:["icon","object","line","path","fill","water","extrude","text"],readOnly:!0})],Bf.prototype,"type",void 0),Bf=v([fe("esri.symbols.Symbol3DLayer")],Bf);const Vl=Bf;function zre(e,t){const i=t.transparency!=null?bw(t.transparency):1,r=t.color;return r&&Array.isArray(r)?new zt([r[0]||0,r[1]||0,r[2]||0,i]):null}function Fre(e,t){t.color=e.toJSON().slice(0,3);const i=UN(e.a);i!==0&&(t.transparency=i)}const $h={type:zt,json:{type:[$r],default:null,read:{source:["color","transparency"],reader:zre},write:{target:{color:{type:[$r]},transparency:{type:$r}},writer:Fre}}},zl={type:Number,cast:xr,json:{write:!0}};let bd=class extends At{constructor(t){super(t),this.color=new zt([0,0,0,1]),this.extensionLength=0,this.size=mh(1)}clone(){}cloneProperties(){return{color:He(this.color),size:this.size,extensionLength:this.extensionLength}}};v([M({type:["solid","sketch"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],bd.prototype,"type",void 0),v([M($h)],bd.prototype,"color",void 0),v([M({...zl,json:{write:{overridePolicy:e=>({enabled:!!e})}}})],bd.prototype,"extensionLength",void 0),v([M(zl)],bd.prototype,"size",void 0),bd=v([fe("esri.symbols.edges.Edges3D")],bd);const S3=bd;var fM;let db=fM=class extends S3{constructor(e){super(e),this.type="sketch"}clone(){return new fM(this.cloneProperties())}};v([Gt({sketch:"sketch"},{readOnly:!0})],db.prototype,"type",void 0),db=fM=v([fe("esri.symbols.edges.SketchEdges3D")],db);const Bre=db;var mM;let pb=mM=class extends S3{constructor(e){super(e),this.type="solid"}clone(){return new mM(this.cloneProperties())}};v([Gt({solid:"solid"},{readOnly:!0})],pb.prototype,"type",void 0),pb=mM=v([fe("esri.symbols.support.SolidEdges3D")],pb);const Ure=pb,QF={types:{key:"type",base:S3,typeMap:{solid:Ure,sketch:Bre}},json:{write:!0}};var yM;let ia=yM=class extends At{constructor(e){super(e),this.color=null}clone(){const e={color:this.color!=null?this.color.clone():null};return new yM(e)}};v([M($h)],ia.prototype,"color",void 0),ia=yM=v([fe("esri.symbols.support.Symbol3DMaterial")],ia);var gM;let Lu=gM=class extends Vl{constructor(e){super(e),this.type="extrude",this.size=1,this.material=null,this.castShadows=!0,this.edges=null}clone(){return new gM({edges:this.edges&&this.edges.clone(),enabled:this.enabled,material:this.material!=null?this.material.clone():null,castShadows:this.castShadows,size:this.size})}};v([Gt({Extrude:"extrude"},{readOnly:!0})],Lu.prototype,"type",void 0),v([M({type:Number,json:{write:{enabled:!0,isRequired:!0}},nonNullable:!0})],Lu.prototype,"size",void 0),v([M({type:ia,json:{write:!0}})],Lu.prototype,"material",void 0),v([M({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],Lu.prototype,"castShadows",void 0),v([M(QF)],Lu.prototype,"edges",void 0),Lu=gM=v([fe("esri.symbols.ExtrudeSymbol3DLayer")],Lu);const e8=Lu;let Ug=class extends Mo{constructor(t){super(t),this.type="simple-line",this.width=.75}hash(){return`${this.type}.${this.width}`}};v([Gt({esriSLS:"simple-line"},{readOnly:!0})],Ug.prototype,"type",void 0),v([M({type:Number,cast:xr,json:{write:!0}})],Ug.prototype,"width",void 0),Ug=v([fe("esri.symbols.LineSymbol")],Ug);const jre=Ug,Vre=["begin","end","begin-end"],t8=["arrow","circle","square","diamond","cross","x"];var _M;let gl=_M=class extends At{constructor(e){super(e),this.placement="begin-end",this.type="line-marker",this.style="arrow"}writeStyle(e,t,i,r){t[i]=(r==null?void 0:r.origin)==="web-map"?"arrow":e}set color(e){this._set("color",e)}readColor(e){return(e==null?void 0:e[0])!=null?[e[0],e[1],e[2],e[3]/255]:e}writeColor(e,t,i,r){(r==null?void 0:r.origin)==="web-map"||(t[i]=e)}clone(){return new _M({color:He(this.color),placement:this.placement,style:this.style})}hash(){var e;return`${this.placement}.${(e=this.color)==null?void 0:e.hash()}.${this.style}`}};v([M({type:["begin","end","begin-end"],json:{write:!0}})],gl.prototype,"placement",void 0),v([Gt({"line-marker":"line-marker"},{readOnly:!0}),M({json:{origins:{"web-map":{write:!1}}}})],gl.prototype,"type",void 0),v([M({type:t8})],gl.prototype,"style",void 0),v([ui("style")],gl.prototype,"writeStyle",null),v([M({type:zt,value:null,json:{write:{allowNull:!0}}})],gl.prototype,"color",null),v([mi("color")],gl.prototype,"readColor",null),v([ui("color")],gl.prototype,"writeColor",null),gl=_M=v([fe("esri.symbols.LineSymbolMarker")],gl);const Gre=gl;var vM;const JS=new ks({esriSLSSolid:"solid",esriSLSDash:"dash",esriSLSDot:"dot",esriSLSDashDot:"dash-dot",esriSLSDashDotDot:"long-dash-dot-dot",esriSLSNull:"none",esriSLSInsideFrame:"inside-frame",esriSLSShortDash:"short-dash",esriSLSShortDot:"short-dot",esriSLSShortDashDot:"short-dash-dot",esriSLSShortDashDotDot:"short-dash-dot-dot",esriSLSLongDash:"long-dash",esriSLSLongDashDot:"long-dash-dot"});let xc=vM=class extends jre{constructor(...e){super(...e),this.type="simple-line",this.style="solid",this.cap="round",this.join="round",this.marker=null,this.miterLimit=2}normalizeCtorArgs(e,t,i,r,s,n){if(e&&typeof e!="string")return e;const c={};return e!=null&&(c.style=e),t!=null&&(c.color=t),i!=null&&(c.width=xr(i)),r!=null&&(c.cap=r),s!=null&&(c.join=s),n!=null&&(c.miterLimit=xr(n)),c}clone(){var e;return new vM({color:He(this.color),style:this.style,width:this.width,cap:this.cap,join:this.join,miterLimit:this.miterLimit,marker:(e=this.marker)==null?void 0:e.clone()})}hash(){var e,t;return`${super.hash()}.${(e=this.color)==null?void 0:e.hash()}.${this.style}.${this.cap}.${this.join}.${this.miterLimit}.${(t=this.marker)==null?void 0:t.hash()}`}};v([Gt({esriSLS:"simple-line"},{readOnly:!0})],xc.prototype,"type",void 0),v([M({type:JS.apiValues,json:{read:JS.read,write:JS.write}})],xc.prototype,"style",void 0),v([M({type:["butt","round","square"],json:{write:{overridePolicy:(e,t,i)=>({enabled:e!=="round"&&(i==null?void 0:i.origin)==null})}}})],xc.prototype,"cap",void 0),v([M({type:["miter","round","bevel"],json:{write:{overridePolicy:(e,t,i)=>({enabled:e!=="round"&&(i==null?void 0:i.origin)==null})}}})],xc.prototype,"join",void 0),v([M({types:{key:"type",base:null,defaultKeyValue:"line-marker",typeMap:{"line-marker":Gre}},json:{write:!0,origins:{"web-scene":{write:!1}}}})],xc.prototype,"marker",void 0),v([M({type:Number,json:{read:!1,write:!1}})],xc.prototype,"miterLimit",void 0),xc=vM=v([fe("esri.symbols.SimpleLineSymbol")],xc);const Ym=xc;let jg=class extends Mo{constructor(t){super(t),this.outline=null,this.type=null}hash(){return`${this.type}.${this.outline&&this.outline.hash()}`}};v([M({types:{key:"type",base:null,defaultKeyValue:"simple-line",typeMap:{"simple-line":Ym}},json:{default:null,write:!0}})],jg.prototype,"outline",void 0),v([M({type:["simple-fill","picture-fill"],readOnly:!0})],jg.prototype,"type",void 0),jg=v([fe("esri.symbols.FillSymbol")],jg);const i8=jg;let fb=class extends At{constructor(t){super(t)}clone(){}};v([M({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],fb.prototype,"type",void 0),fb=v([fe("esri.symbols.patterns.LinePattern3D")],fb);const r8=fb,qre=["dash","dash-dot","dot","long-dash","long-dash-dot","long-dash-dot-dot","none","short-dash","short-dash-dot","short-dash-dot-dot","short-dot","solid"];var bM;const Hre=Bn()({dash:"dash","dash-dot":"dash-dot","dash-dot-dot":"long-dash-dot-dot",dot:"dot","long-dash":"long-dash","long-dash-dot":"long-dash-dot",null:"none","short-dash":"short-dash","short-dash-dot":"short-dash-dot","short-dash-dot-dot":"short-dash-dot-dot","short-dot":"short-dot",solid:"solid"});let Vg=bM=class extends r8{constructor(e){super(e),this.type="style",this.style="solid"}clone(){const e={style:this.style};return new bM(e)}};v([M({type:["style"]})],Vg.prototype,"type",void 0),v([Gt(Hre),M({type:qre})],Vg.prototype,"style",void 0),Vg=bM=v([fe("esri.symbols.patterns.LineStylePattern3D")],Vg);const T3=Vg;let mb=class extends At{constructor(t){super(t)}clone(){}};v([M({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],mb.prototype,"type",void 0),mb=v([fe("esri.symbols.patterns.Pattern3D")],mb);const s8=mb,Wre=["backward-diagonal","cross","diagonal-cross","forward-diagonal","horizontal","none","solid","vertical"];var wM;let Gg=wM=class extends s8{constructor(e){super(e),this.type="style",this.style="solid"}clone(){const e={style:this.style};return new wM(e)}};v([M({type:["style"]})],Gg.prototype,"type",void 0),v([M({type:Wre,json:{read:!0,write:!0}})],Gg.prototype,"style",void 0),Gg=wM=v([fe("esri.symbols.patterns.StylePattern3D")],Gg);const n8=Gg,Zre={types:{key:"type",base:s8,typeMap:{style:n8}},json:{write:!0}},o8={types:{key:"type",base:r8,typeMap:{style:T3}},json:{write:!0}},I0=new zt("white");new zt("black");const Yre=new zt([255,255,255,0]);function Jre(e){return e.r===0&&e.g===0&&e.b===0}var xM;let A0=xM=class extends ia{constructor(e){super(e),this.colorMixMode=null}clone(){const e={color:this.color!=null?this.color.clone():null,colorMixMode:this.colorMixMode};return new xM(e)}};v([Gt({multiply:"multiply",replace:"replace",tint:"tint"})],A0.prototype,"colorMixMode",void 0),A0=xM=v([fe("esri.symbols.support.Symbol3DFillMaterial")],A0);function E3(e=tse){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function M3(e,t,i,r,s,n,c=E3()){return c[0]=e,c[1]=t,c[2]=i,c[3]=r,c[4]=s,c[5]=n,c}function S_e(e,t){const i=isFinite(e[2])||isFinite(e[5]);return new Ui(i?{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],zmin:e[2],zmax:e[5],spatialReference:t}:{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],spatialReference:t})}function T_e(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[3]),e[4]=Math.max(e[4],t[4]),e[5]=Math.max(e[5],t[5])}function E_e(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[0]),e[4]=Math.max(e[4],t[1]),e[5]=Math.max(e[5],t[2])}function M_e(e,t,i=0,r=t.length/3){let s=e[0],n=e[1],c=e[2],o=e[3],f=e[4],g=e[5];for(let S=0;S=e[3]?0:e[3]-e[0]}function Xre(e){return e[1]>=e[4]?0:e[4]-e[1]}function Qre(e){return e[2]>=e[5]?0:e[5]-e[2]}function I_e(e,t=[0,0,0]){return t[0]=Kre(e),t[1]=Xre(e),t[2]=Qre(e),t}function A_e(e,t,i=e){return i[0]=t[0],i[1]=t[1],i[2]=t[2],i!==e&&(i[3]=e[3],i[4]=e[4],i[5]=e[5]),i}function P_e(e,t,i=e){return i[3]=t[0],i[4]=t[1],i[5]=t[2],i!==e&&(i[0]=e[0],i[1]=e[1],i[2]=e[2]),e}function ese(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function C_e(e){return e?ese(e,TR):E3(TR)}function $_e(e,t){return e[0]=t[0],e[1]=t[1],e[2]=Number.NEGATIVE_INFINITY,e[3]=t[2],e[4]=t[3],e[5]=Number.POSITIVE_INFINITY,e}function k_e(e,t,i,r,s){return e[0]=t,e[1]=i,e[2]=Number.NEGATIVE_INFINITY,e[3]=r,e[4]=s,e[5]=Number.POSITIVE_INFINITY,e}function SR(e){return e.length===6}function R_e(e,t,i){if(e==null||t==null)return e===t;if(!SR(e)||!SR(t))return!1;if(i){for(let r=0;r{const t=za(e);return t===0?1:Ll(t,.1,4)},nonNullable:!0},cse=["left","right","center"],use=["baseline","top","middle","bottom"],c8={type:cse,nonNullable:!0},u8={type:use,nonNullable:!0},L_e=8;var TM;let Tc=TM=class extends At{constructor(e){super(e),this.decoration="none",this.family="sans-serif",this.size=9,this.style="normal",this.weight="normal"}castSize(e){return xr(e)}clone(){return new TM({decoration:this.decoration,family:this.family,size:this.size,style:this.style,weight:this.weight})}hash(){return`${this.decoration}.${this.family}.${this.size}.${this.style}.${this.weight}`}};v([M({type:ose,json:{default:"none",write:!0}})],Tc.prototype,"decoration",void 0),v([M({type:String,json:{write:!0}})],Tc.prototype,"family",void 0),v([M({type:Number,json:{write:{overridePolicy:(e,t,i)=>({enabled:!i||!i.textSymbol3D})}}})],Tc.prototype,"size",void 0),v([Rs("size")],Tc.prototype,"castSize",null),v([M({type:ase,json:{default:"normal",write:!0}})],Tc.prototype,"style",void 0),v([M({type:lse,json:{default:"normal",write:!0}})],Tc.prototype,"weight",void 0),Tc=TM=v([fe("esri.symbols.Font")],Tc);const Wx=Tc;var EM;const hse=Bn()({circle:"circle",square:"square",cross:"cross",x:"x",kite:"kite",triangle:"triangle"});let xd=EM=class extends At{constructor(e){super(e)}readHref(e,t,i){return e?__(e,i):t.dataURI}writeHref(e,t,i,r){e&&(Cp(e)?t.dataURI=e:(t.href=Sx(e,r),zn(t.href)&&(t.href=ta(t.href))))}clone(){return new EM({href:this.href,primitive:this.primitive})}};v([M({type:String,json:{write:!0,read:{source:["href","dataURI"]}}})],xd.prototype,"href",void 0),v([mi("href")],xd.prototype,"readHref",null),v([ui("href",{href:{type:String},dataURI:{type:String}})],xd.prototype,"writeHref",null),v([Gt(hse)],xd.prototype,"primitive",void 0),xd=EM=v([fe("esri.symbols.support.IconSymbol3DLayerResource")],xd);var MM;let om=MM=class extends Nt{constructor(){super(...arguments),this.x=0,this.y=0}clone(){return new MM({x:this.x,y:this.y})}};v([M({type:Number})],om.prototype,"x",void 0),v([M({type:Number})],om.prototype,"y",void 0),om=MM=v([fe("esri.symbols.support.Symbol3DAnchorPosition2D")],om);var IM;let qg=IM=class extends At{constructor(e){super(e),this.color=new zt([0,0,0,1]),this.size=mh(1)}clone(){const e={color:this.color!=null?this.color.clone():null,size:this.size};return new IM(e)}};v([M($h)],qg.prototype,"color",void 0),v([M(zl)],qg.prototype,"size",void 0),qg=IM=v([fe("esri.symbols.support.Symbol3DIconOutline")],qg);var Uf;const h8="esri.symbols.IconSymbol3DLayer";let _l=Uf=class extends Vl{constructor(e){super(e),this.material=null,this.resource=null,this.type="icon",this.size=12,this.anchor="center",this.anchorPosition=null,this.outline=null}clone(){return new Uf({anchor:this.anchor,anchorPosition:this.anchorPosition&&this.anchorPosition.clone(),enabled:this.enabled,material:this.material!=null?this.material.clone():null,outline:this.outline!=null?this.outline.clone():null,resource:this.resource&&this.resource.clone(),size:this.size})}static fromSimpleMarkerSymbol(e){const t=e.color||I0,i=ER(e),r=e.outline&&e.outline.width>0?{size:e.outline.width,color:(e.outline.color||I0).clone()}:null;return new Uf({size:e.size,resource:{primitive:pse(e.style)},material:{color:t},outline:r,anchor:i?"relative":void 0,anchorPosition:i})}static fromPictureMarkerSymbol(e){const t=!e.color||Jre(e.color)?I0:e.color,i=ER(e);return new Uf({size:e.width<=e.height?e.height:e.width,resource:{href:e.url},material:{color:t.clone()},anchor:i?"relative":void 0,anchorPosition:i})}static fromCIMSymbol(e){return new Uf({resource:{href:z4({mediaType:"application/json",data:JSON.stringify(e.data)})}})}};function ER(e){const t="width"in e?e.width:e.size,i="height"in e?e.height:e.size,r=MR(e.xoffset),s=MR(e.yoffset);return(r||s)&&t&&i?{x:-r/t,y:s/i}:null}function MR(e){return isFinite(e)?e:0}v([M({type:ia,json:{write:!0}})],_l.prototype,"material",void 0),v([M({type:xd,json:{write:!0}})],_l.prototype,"resource",void 0),v([Gt({Icon:"icon"},{readOnly:!0})],_l.prototype,"type",void 0),v([M(zl)],_l.prototype,"size",void 0),v([Gt({center:"center",left:"left",right:"right",top:"top",bottom:"bottom",topLeft:"top-left",topRight:"top-right",bottomLeft:"bottom-left",bottomRight:"bottom-right",relative:"relative"}),M({json:{default:"center"}})],_l.prototype,"anchor",void 0),v([M({type:om,json:{type:[Number],read:{reader:e=>new om({x:e[0],y:e[1]})},write:{writer:(e,t)=>{t.anchorPosition=[e.x,e.y]},overridePolicy(){return{enabled:this.anchor==="relative"}}}}})],_l.prototype,"anchorPosition",void 0),v([M({type:qg,json:{write:!0}})],_l.prototype,"outline",void 0),_l=Uf=v([fe(h8)],_l);const dse={circle:"circle",cross:"cross",diamond:"kite",square:"square",x:"x",triangle:"triangle",path:null};function pse(e){return dse[e]||(_t.getLogger(h8).warn(`${e} cannot be mapped to Icon symbol. Fallback to "circle"`),"circle")}const ip=_l;let Sd=class extends jl(At){constructor(t){super(t),this.type="style",this.placement="begin-end",this.style="arrow",this.color=null}equals(t){return t!=null&&t.placement===this.placement&&t.style===this.style&&(this.color==null&&t.color==null||this.color!=null&&t.color!=null&&this.color.toJSON()===t.color.toJSON())}};v([M({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],Sd.prototype,"type",void 0),v([M({type:Vre,json:{default:"begin-end",write:!0}})],Sd.prototype,"placement",void 0),v([M({type:t8,json:{default:"arrow",write:!0}})],Sd.prototype,"style",void 0),v([M({type:zt,json:{type:[$r],default:null,write:!0}})],Sd.prototype,"color",void 0),Sd=v([fe("esri.symbols.LineStyleMarker3D")],Sd);const AM=Sd;var gb;let vl=gb=class extends Vl{constructor(e){super(e),this.material=null,this.type="line",this.join="miter",this.cap="butt",this.size=mh(1),this.pattern=null,this.marker=null}clone(){const e={enabled:this.enabled,material:this.material!=null?this.material.clone():null,size:this.size,join:this.join,cap:this.cap,pattern:this.pattern!=null?this.pattern.clone():null,marker:this.marker!=null?this.marker.clone():null};return new gb(e)}static fromSimpleLineSymbol(e){var i;const t={enabled:!0,size:e.width??mh(1),cap:e.cap||"butt",join:e.join||"miter",pattern:e.style&&e.style!=="inside-frame"?new T3({style:e.style}):null,material:new ia({color:(e.color||I0).clone()}),marker:e.marker?new AM({placement:e.marker.placement,style:e.marker.style,color:((i=e.marker.color)==null?void 0:i.clone())??null}):null};return new gb(t)}};v([M({type:ia,json:{write:!0}})],vl.prototype,"material",void 0),v([Gt({Line:"line"},{readOnly:!0})],vl.prototype,"type",void 0),v([M({type:a8,json:{write:!0,default:"miter"}})],vl.prototype,"join",void 0),v([M({type:I3,json:{write:!0,default:"butt"}})],vl.prototype,"cap",void 0),v([M(zl)],vl.prototype,"size",void 0),v([M(o8)],vl.prototype,"pattern",void 0),v([M({types:{key:"type",base:AM,typeMap:{style:AM}},json:{write:!0}})],vl.prototype,"marker",void 0),vl=gb=v([fe("esri.symbols.LineSymbol3DLayer")],vl);const I_=vl;var PM;const fse=Bn()({sphere:"sphere",cylinder:"cylinder",cube:"cube",cone:"cone",diamond:"diamond",tetrahedron:"tetrahedron",invertedCone:"inverted-cone"});let Hg=PM=class extends At{clone(){return new PM({href:this.href,primitive:this.primitive})}};v([M({type:String,json:{read:RA,write:xp}})],Hg.prototype,"href",void 0),v([Gt(fse)],Hg.prototype,"primitive",void 0),Hg=PM=v([fe("esri.symbols.support.ObjectSymbol3DLayerResource")],Hg);var CM;let Bd=CM=class extends Nt{constructor(){super(...arguments),this.x=0,this.y=0,this.z=0}clone(){return new CM({x:this.x,y:this.y,z:this.z})}};v([M({type:Number})],Bd.prototype,"x",void 0),v([M({type:Number})],Bd.prototype,"y",void 0),v([M({type:Number})],Bd.prototype,"z",void 0),Bd=CM=v([fe("esri.symbols.support.Symbol3DAnchorPosition3D")],Bd);var $M;let hn=$M=class extends Vl{constructor(e){super(e),this.material=null,this.castShadows=!0,this.resource=null,this.type="object",this.width=void 0,this.height=void 0,this.depth=void 0,this.anchor=void 0,this.anchorPosition=void 0,this.heading=void 0,this.tilt=void 0,this.roll=void 0}clone(){var e,t,i;return new $M({heading:this.heading,tilt:this.tilt,roll:this.roll,anchor:this.anchor,anchorPosition:(e=this.anchorPosition)==null?void 0:e.clone(),depth:this.depth,enabled:this.enabled,height:this.height,material:((t=this.material)==null?void 0:t.clone())??null,castShadows:this.castShadows,resource:(i=this.resource)==null?void 0:i.clone(),width:this.width})}get isPrimitive(){return!this.resource||typeof this.resource.href!="string"}};v([M({type:ia,json:{write:!0}})],hn.prototype,"material",void 0),v([M({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],hn.prototype,"castShadows",void 0),v([M({type:Hg,json:{write:!0}})],hn.prototype,"resource",void 0),v([Gt({Object:"object"},{readOnly:!0})],hn.prototype,"type",void 0),v([M({type:Number,json:{write:!0}})],hn.prototype,"width",void 0),v([M({type:Number,json:{write:!0}})],hn.prototype,"height",void 0),v([M({type:Number,json:{write:!0}})],hn.prototype,"depth",void 0),v([Gt({center:"center",top:"top",bottom:"bottom",origin:"origin",relative:"relative"}),M({json:{default:"origin"}})],hn.prototype,"anchor",void 0),v([M({type:Bd,json:{type:[Number],read:{reader:e=>new Bd({x:e[0],y:e[1],z:e[2]})},write:{writer:(e,t)=>{t.anchorPosition=[e.x,e.y,e.z]},overridePolicy(){return{enabled:this.anchor==="relative"}}}}})],hn.prototype,"anchorPosition",void 0),v([M({type:Number,json:{write:!0}})],hn.prototype,"heading",void 0),v([M({type:Number,json:{write:!0}})],hn.prototype,"tilt",void 0),v([M({type:Number,json:{write:!0}})],hn.prototype,"roll",void 0),v([M({readOnly:!0})],hn.prototype,"isPrimitive",null),hn=$M=v([fe("esri.symbols.ObjectSymbol3DLayer")],hn);const A3=hn;var kM;let In=kM=class extends Vl{constructor(e){super(e),this.material=null,this.castShadows=!0,this.type="path",this.profile="circle",this.join="miter",this.cap="butt",this.width=void 0,this.height=void 0,this.anchor="center",this.profileRotation="all"}readWidth(e,t){return e??(t.height==null&&t.size!=null?t.size:void 0)}readHeight(e,t){return e??(t.width==null&&t.size!=null?t.size:void 0)}clone(){return new kM({enabled:this.enabled,material:this.material!=null?this.material.clone():null,castShadows:this.castShadows,profile:this.profile,join:this.join,cap:this.cap,width:this.width,height:this.height,profileRotation:this.profileRotation,anchor:this.anchor})}};v([M({type:ia,json:{write:!0}})],In.prototype,"material",void 0),v([M({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],In.prototype,"castShadows",void 0),v([Gt({Path:"path"},{readOnly:!0})],In.prototype,"type",void 0),v([M({type:["circle","quad"],json:{write:!0,default:"circle"}})],In.prototype,"profile",void 0),v([M({type:a8,json:{write:!0,default:"miter"}})],In.prototype,"join",void 0),v([M({type:nse,json:{write:!0,default:"butt"}})],In.prototype,"cap",void 0),v([M({type:Number,json:{write:{enabled:!0,target:{width:{type:Number},size:{type:Number}}}}})],In.prototype,"width",void 0),v([mi("width",["width","size","height"])],In.prototype,"readWidth",null),v([M({type:Number,json:{write:!0}})],In.prototype,"height",void 0),v([mi("height",["height","size","width"])],In.prototype,"readHeight",null),v([M({type:["center","bottom","top"],json:{write:!0,default:"center"}})],In.prototype,"anchor",void 0),v([M({type:["heading","all"],json:{write:!0,default:"all"}})],In.prototype,"profileRotation",void 0),In=kM=v([fe("esri.symbols.PathSymbol3DLayer")],In);const P3=In;var RM;let am=RM=class extends At{constructor(){super(...arguments),this.color=new zt([0,0,0,1]),this.size=0}clone(){const e={color:He(this.color),size:this.size};return new RM(e)}};v([M($h)],am.prototype,"color",void 0),v([M(zl)],am.prototype,"size",void 0),am=RM=v([fe("esri.symbols.support.Symbol3DHalo")],am);let P0=class extends jl(At){constructor(t){super(t),this.color=null}};v([M($h)],P0.prototype,"color",void 0),P0=v([fe("esri.symbols.support.Symbol3DTextBackground")],P0);var _b;let Hn=_b=class extends Vl{constructor(e){super(e),this._userSize=void 0,this.halo=null,this.horizontalAlignment="center",this.lineHeight=1,this.material=null,this.background=null,this.text=null,this.type="text",this.verticalAlignment="baseline"}get font(){return this._get("font")||null}set font(e){e!=null&&this._userSize!=null&&(e.size=this._userSize),this._set("font",e)}writeFont(e,t,i,r){const s={...r,textSymbol3D:!0};t.font=e.write({},s),delete t.font.size}get size(){var e;return this._userSize!=null?this._userSize:((e=this.font)==null?void 0:e.size)!=null?this.font.size:9}set size(e){this._userSize=e,this.font!=null&&(this.font.size=this._userSize),this.notifyChange("size")}clone(){const e=new _b({enabled:this.enabled,font:this.font&&He(this.font),halo:this.halo&&He(this.halo),horizontalAlignment:this.horizontalAlignment,lineHeight:this.lineHeight,material:this.material!=null?this.material.clone():null,text:this.text,verticalAlignment:this.verticalAlignment,background:He(this.background)});return e._userSize=this._userSize,e}static fromTextSymbol(e){return new _b({font:e.font!=null?e.font.clone():new Wx,halo:mse(e.haloColor,e.haloSize),horizontalAlignment:e.horizontalAlignment,lineHeight:e.lineHeight,material:e.color?new ia({color:e.color.clone()}):null,text:e.text,verticalAlignment:e.verticalAlignment,background:e.backgroundColor?new P0({color:e.backgroundColor.clone()}):null})}};function mse(e,t){return e&&t!=null&&t>0?new am({color:He(e),size:t}):null}v([M({type:Wx,json:{write:!0}})],Hn.prototype,"font",null),v([ui("font")],Hn.prototype,"writeFont",null),v([M({type:am,json:{write:!0}})],Hn.prototype,"halo",void 0),v([M({...c8,json:{default:"center",write:!0}})],Hn.prototype,"horizontalAlignment",void 0),v([M({...l8,json:{default:1,write:!0}})],Hn.prototype,"lineHeight",void 0),v([M({type:ia,json:{write:!0}})],Hn.prototype,"material",void 0),v([M({type:P0,json:{write:!0}})],Hn.prototype,"background",void 0),v([M(zl)],Hn.prototype,"size",null),v([M({type:String,json:{write:!0}})],Hn.prototype,"text",void 0),v([Gt({Text:"text"},{readOnly:!0})],Hn.prototype,"type",void 0),v([M({...u8,json:{default:"baseline",write:!0}})],Hn.prototype,"verticalAlignment",void 0),Hn=_b=v([fe("esri.symbols.TextSymbol3DLayer")],Hn);const Jm=Hn;var OM;let Du=OM=class extends Vl{constructor(e){super(e),this.color=LM.clone(),this.type="water",this.waterbodySize="medium",this.waveDirection=null,this.waveStrength="moderate"}clone(){return new OM({color:He(this.color),waterbodySize:this.waterbodySize,waveDirection:this.waveDirection,waveStrength:this.waveStrength})}};v([M({type:zt,nonNullable:!0,json:{type:[$r],write:(e,t,i)=>t[i]=e.toArray(zt.AlphaMode.UNLESS_OPAQUE),default:()=>LM.clone(),defaultEquals:e=>e.toCss(!0)===LM.toCss(!0)}})],Du.prototype,"color",void 0),v([Gt({Water:"water"},{readOnly:!0})],Du.prototype,"type",void 0),v([M({type:["small","medium","large"],json:{write:!0,default:"medium"}})],Du.prototype,"waterbodySize",void 0),v([M({type:Number,json:{write:!0,default:null}})],Du.prototype,"waveDirection",void 0),v([M({type:["calm","rippled","slight","moderate"],json:{write:!0,default:"moderate"}})],Du.prototype,"waveStrength",void 0),Du=OM=v([fe("esri.symbols.WaterSymbol3DLayer")],Du);const LM=new zt([0,119,190]),d8=Du;var DM;let Td=DM=class extends Nt{constructor(e){super(e),this.name=null,this.styleUrl=null,this.styleName=null,this.portal=null}clone(){return new DM({name:this.name,styleUrl:this.styleUrl,styleName:this.styleName,portal:this.portal})}};v([M({type:String})],Td.prototype,"name",void 0),v([M({type:String})],Td.prototype,"styleUrl",void 0),v([M({type:String})],Td.prototype,"styleName",void 0),v([M({type:Za})],Td.prototype,"portal",void 0),Td=DM=v([fe("esri.symbols.support.StyleOrigin")],Td);const NM=Td;var zM;let C0=zM=class extends Nt{constructor(){super(...arguments),this.url=""}clone(){return new zM({url:this.url})}};v([M({type:String})],C0.prototype,"url",void 0),C0=zM=v([fe("esri.symbols.support.Thumbnail")],C0);const p8={icon:ip,object:A3,line:I_,path:P3,fill:M_,extrude:e8,text:Jm,water:d8},yse=Bt.ofType({base:Vl,key:"type",typeMap:p8,errorContext:"symbol-layer"});let bl=class extends Mo{constructor(t){super(t),this.styleOrigin=null,this.thumbnail=null,this.type=null;const i=this.__accessor__&&this.__accessor__.metadata&&this.__accessor__.metadata.symbolLayers,r=i==null?void 0:i.type,s=r||Bt;this._set("symbolLayers",new s)}get color(){return null}set color(t){this.constructed&&_t.getLogger(this).error("Symbol3D does not support colors on the symbol level. Colors may be set on individual symbol layer materials instead.")}set symbolLayers(t){mp(t,this._get("symbolLayers"))}readStyleOrigin(t,i,r){if(t.styleUrl&&t.name){const s=__(t.styleUrl,r);return new NM({styleUrl:s,name:t.name})}if(t.styleName&&t.name)return new NM({portal:(r==null?void 0:r.portal)||Za.getDefault(),styleName:t.styleName,name:t.name});r!=null&&r.messages&&r.messages.push(new jc("symbol3d:incomplete-style-origin","Style origin requires either a 'styleUrl' or 'styleName' and a 'name' property",{context:r,definition:t}))}writeStyleOrigin(t,i,r,s){if(t.styleUrl&&t.name){let n=Sx(t.styleUrl,s);zn(n)&&(n=ta(n)),i.styleOrigin={styleUrl:n,name:t.name}}else t.styleName&&t.name&&(t.portal&&(s!=null&&s.portal)&&!D4(t.portal.restUrl,s.portal.restUrl)?s!=null&&s.messages&&s.messages.push(new jc("symbol:cross-portal","The symbol style origin cannot be persisted because it refers to an item on a different portal than the one being saved to.",{symbol:this})):i.styleOrigin={styleName:t.styleName,name:t.name})}normalizeCtorArgs(t){return t instanceof Vl||t&&p8[t.type]?{symbolLayers:[t]}:Array.isArray(t)?{symbolLayers:t}:t}};v([M({json:{read:!1,write:!1}})],bl.prototype,"color",null),v([M({type:yse,nonNullable:!0,json:{write:!0}}),Rs(Y4)],bl.prototype,"symbolLayers",null),v([M({type:NM})],bl.prototype,"styleOrigin",void 0),v([mi("styleOrigin")],bl.prototype,"readStyleOrigin",null),v([ui("styleOrigin",{"styleOrigin.styleUrl":{type:String},"styleOrigin.styleName":{type:String},"styleOrigin.name":{type:String}})],bl.prototype,"writeStyleOrigin",null),v([M({type:C0,json:{read:!1}})],bl.prototype,"thumbnail",void 0),v([M({type:["point-3d","line-3d","polygon-3d","mesh-3d","label-3d"],readOnly:!0})],bl.prototype,"type",void 0),bl=v([fe("esri.symbols.Symbol3D")],bl);const A_=bl;let Wg=class extends At{constructor(t){super(t),this.visible=!0}clone(){}};v([M({type:["line"],constructOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],Wg.prototype,"type",void 0),v([M({readOnly:!0})],Wg.prototype,"visible",void 0),Wg=v([fe("esri.symbols.callouts.Callout3D")],Wg);const f8=Wg;var FM;let vb=FM=class extends At{constructor(e){super(e),this.color=new zt("white")}clone(){return new FM({color:He(this.color)})}};v([M($h)],vb.prototype,"color",void 0),vb=FM=v([fe("esri.symbols.callouts.LineCallout3DBorder")],vb);const gse=vb;var BM;let Nu=BM=class extends f8{constructor(e){super(e),this.type="line",this.color=new zt([0,0,0,1]),this.size=mh(1),this.border=null}get visible(){return this.size>0&&this.color!=null&&this.color.a>0}clone(){return new BM({color:He(this.color),size:this.size,border:He(this.border)})}};v([Gt({line:"line"})],Nu.prototype,"type",void 0),v([M($h)],Nu.prototype,"color",void 0),v([M(zl)],Nu.prototype,"size",void 0),v([M({type:gse,json:{write:!0}})],Nu.prototype,"border",void 0),v([M({readOnly:!0})],Nu.prototype,"visible",null),Nu=BM=v([fe("esri.symbols.callouts.LineCallout3D")],Nu);const m8=Nu;function C3(e){if(!e)return!1;const t=e.verticalOffset;return!!t&&!(t.screenLength<=0||t.maxWorldLength!=null&&t.maxWorldLength<=0)}function y8(e){if(!e||!e.supportsCallout||!e.supportsCallout())return!1;const t=e.callout;return!!t&&!!t.visible&&!!C3(e)}const g8={types:{key:"type",base:f8,typeMap:{line:m8}},json:{write:!0}};var UM;let jf=UM=class extends At{constructor(e){super(e),this.screenLength=0,this.minWorldLength=0,this.maxWorldLength=null}clone(){return new UM({screenLength:this.screenLength,minWorldLength:this.minWorldLength,maxWorldLength:this.maxWorldLength})}};v([M(zl)],jf.prototype,"screenLength",void 0),v([M({type:Number,nonNullable:!0,json:{write:!0,default:0}})],jf.prototype,"minWorldLength",void 0),v([M({type:Number,json:{write:!0}})],jf.prototype,"maxWorldLength",void 0),jf=UM=v([fe("esri.symbols.support.Symbol3DVerticalOffset")],jf);const $3=jf;var bb;const _8=Bt.ofType({base:null,key:"type",typeMap:{text:Jm}});let zu=bb=class extends A_{constructor(e){super(e),this.verticalOffset=null,this.callout=null,this.styleOrigin=null,this.symbolLayers=new _8,this.type="label-3d"}supportsCallout(){return!0}hasVisibleCallout(){return y8(this)}hasVisibleVerticalOffset(){return C3(this)}clone(){return new bb({styleOrigin:He(this.styleOrigin),symbolLayers:He(this.symbolLayers),thumbnail:He(this.thumbnail),callout:He(this.callout),verticalOffset:He(this.verticalOffset)})}static fromTextSymbol(e){return new bb({symbolLayers:new Bt([Jm.fromTextSymbol(e)])})}};v([M({type:$3,json:{write:!0}})],zu.prototype,"verticalOffset",void 0),v([M(g8)],zu.prototype,"callout",void 0),v([M({json:{read:!1,write:!1}})],zu.prototype,"styleOrigin",void 0),v([M({type:_8})],zu.prototype,"symbolLayers",void 0),v([Gt({LabelSymbol3D:"label-3d"},{readOnly:!0})],zu.prototype,"type",void 0),zu=bb=v([fe("esri.symbols.LabelSymbol3D")],zu);const k3=zu;var wb;const v8=Bt.ofType({base:null,key:"type",typeMap:{line:I_,path:P3}}),_se=Bt.ofType({base:null,key:"type",typeMap:{line:I_,path:P3}});let Zg=wb=class extends A_{constructor(e){super(e),this.symbolLayers=new v8,this.type="line-3d"}clone(){return new wb({styleOrigin:He(this.styleOrigin),symbolLayers:He(this.symbolLayers),thumbnail:He(this.thumbnail)})}static fromSimpleLineSymbol(e){return new wb({symbolLayers:new Bt([I_.fromSimpleLineSymbol(e)])})}};v([M({type:v8,json:{type:_se}})],Zg.prototype,"symbolLayers",void 0),v([Gt({LineSymbol3D:"line-3d"},{readOnly:!0})],Zg.prototype,"type",void 0),Zg=wb=v([fe("esri.symbols.LineSymbol3D")],Zg);const R3=Zg;let Fu=class extends Mo{constructor(t){super(t),this.angle=0,this.type=null,this.xoffset=0,this.yoffset=0,this.size=9}hash(){return`${this.type}.${this.angle}.${this.size}.${this.xoffset}.${this.yoffset}`}};v([M({type:Number,json:{read:e=>e&&-1*e,write:(e,t)=>t.angle=e&&-1*e}})],Fu.prototype,"angle",void 0),v([M({type:["simple-marker","picture-marker"],readOnly:!0})],Fu.prototype,"type",void 0),v([M({type:Number,cast:xr,json:{write:!0}})],Fu.prototype,"xoffset",void 0),v([M({type:Number,cast:xr,json:{write:!0}})],Fu.prototype,"yoffset",void 0),v([M({type:Number,cast:e=>e==="auto"?e:xr(e),json:{write:!0}})],Fu.prototype,"size",void 0),Fu=v([fe("esri.symbols.MarkerSymbol")],Fu);const b8=Fu;var xb;const w8=Bt.ofType({base:null,key:"type",typeMap:{fill:M_}});let Yg=xb=class extends A_{constructor(e){super(e),this.symbolLayers=new w8,this.type="mesh-3d"}clone(){return new xb({styleOrigin:He(this.styleOrigin),symbolLayers:He(this.symbolLayers),thumbnail:He(this.thumbnail)})}static fromSimpleFillSymbol(e){return new xb({symbolLayers:new Bt([M_.fromSimpleFillSymbol(e)])})}};v([M({type:w8})],Yg.prototype,"symbolLayers",void 0),v([Gt({MeshSymbol3D:"mesh-3d"},{readOnly:!0})],Yg.prototype,"type",void 0),Yg=xb=v([fe("esri.symbols.MeshSymbol3D")],Yg);const O3=Yg;function vse(e,t,i){return t.imageData?z4({mediaType:t.contentType||"image/png",isBase64:!0,data:t.imageData}):x8(t.url,i)}function x8(e,t){if(!zn(e)){const i=wse(t);if(i)return fp(i,"images",e)}return __(e,t)}function bse(e,t,i,r){if(Cp(e)){const s=V0(e);if(!s)return;t.contentType=s.mediaType,t.imageData=s.data,i&&i.imageData===t.imageData&&i.url&&xp(i.url,t,"url",r)}else xp(e,t,"url",r)}const S8={json:{read:{source:["imageData","url"],reader:vse},write:{writer(e,t,i,r){bse(e,t,this.source,r)}}}},T8={readOnly:!0,json:{read:{source:["imageData","url"],reader(e,t,i){const r={};return t.imageData&&(r.imageData=t.imageData),t.contentType&&(r.contentType=t.contentType),t.url&&(r.url=x8(t.url,i)),r}}}};function wse(e){var s,n;if(!e)return null;const{origin:t,layer:i}=e;if(t!=="service"&&t!=="portal-item")return null;const r=i==null?void 0:i.type;return r==="feature"||r==="stream"?(s=i.parsedUrl)==null?void 0:s.path:r==="map-image"||r==="tile"?(n=e.url)==null?void 0:n.path:null}var jM;let Ho=jM=class extends i8{constructor(...e){super(...e),this.type="picture-fill",this.url=null,this.xscale=1,this.yscale=1,this.width=12,this.height=12,this.xoffset=0,this.yoffset=0,this.source=null}normalizeCtorArgs(e,t,i,r){if(e&&typeof e!="string"&&e.imageData==null)return e;const s={};return e&&(s.url=e),t&&(s.outline=t),i!=null&&(s.width=xr(i)),r!=null&&(s.height=xr(r)),s}clone(){const e=new jM({color:He(this.color),height:this.height,outline:this.outline&&this.outline.clone(),url:this.url,width:this.width,xoffset:this.xoffset,xscale:this.xscale,yoffset:this.yoffset,yscale:this.yscale});return e._set("source",He(this.source)),e}hash(){var e;return`${super.hash()}.${(e=this.color)==null?void 0:e.hash()}.${this.height}.${this.url}.${this.width}.${this.xoffset}.${this.xscale}.${this.yoffset}.${this.yscale}`}};v([Gt({esriPFS:"picture-fill"},{readOnly:!0})],Ho.prototype,"type",void 0),v([M(S8)],Ho.prototype,"url",void 0),v([M({type:Number,json:{write:!0}})],Ho.prototype,"xscale",void 0),v([M({type:Number,json:{write:!0}})],Ho.prototype,"yscale",void 0),v([M({type:Number,cast:xr,json:{write:!0}})],Ho.prototype,"width",void 0),v([M({type:Number,cast:xr,json:{write:!0}})],Ho.prototype,"height",void 0),v([M({type:Number,cast:xr,json:{write:!0}})],Ho.prototype,"xoffset",void 0),v([M({type:Number,cast:xr,json:{write:!0}})],Ho.prototype,"yoffset",void 0),v([M(T8)],Ho.prototype,"source",void 0),Ho=jM=v([fe("esri.symbols.PictureFillSymbol")],Ho);const E8=Ho;var VM;let Ca=VM=class extends b8{constructor(...e){super(...e),this.color=null,this.type="picture-marker",this.url=null,this.source=null,this.height=12,this.width=12,this.size=null}normalizeCtorArgs(e,t,i){if(e&&typeof e!="string"&&e.imageData==null)return e;const r={};return e&&(r.url=e),t!=null&&(r.width=xr(t)),i!=null&&(r.height=xr(i)),r}readHeight(e,t){return t.size||e}readWidth(e,t){return t.size||e}clone(){const e=new VM({angle:this.angle,height:this.height,url:this.url,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset});return e._set("source",He(this.source)),e}hash(){return`${super.hash()}.${this.height}.${this.url}.${this.width}`}};v([M({json:{write:!1}})],Ca.prototype,"color",void 0),v([Gt({esriPMS:"picture-marker"},{readOnly:!0})],Ca.prototype,"type",void 0),v([M(S8)],Ca.prototype,"url",void 0),v([M(T8)],Ca.prototype,"source",void 0),v([M({type:Number,cast:xr,json:{write:!0}})],Ca.prototype,"height",void 0),v([mi("height",["height","size"])],Ca.prototype,"readHeight",null),v([M({type:Number,cast:xr,json:{write:!0}})],Ca.prototype,"width",void 0),v([M({json:{write:!1}})],Ca.prototype,"size",void 0),Ca=VM=v([fe("esri.symbols.PictureMarkerSymbol")],Ca);const L3=Ca;var Ed;const M8=Bt.ofType({base:null,key:"type",typeMap:{icon:ip,object:A3,text:Jm}});let Md=Ed=class extends A_{constructor(e){super(e),this.verticalOffset=null,this.callout=null,this.symbolLayers=new M8,this.type="point-3d"}supportsCallout(){if((this.symbolLayers?this.symbolLayers.length:0)<1)return!1;for(const e of this.symbolLayers.items)switch(e.type){case"icon":case"text":case"object":continue;default:return!1}return!0}hasVisibleCallout(){return y8(this)}hasVisibleVerticalOffset(){return C3(this)}clone(){return new Ed({verticalOffset:He(this.verticalOffset),callout:He(this.callout),styleOrigin:He(this.styleOrigin),symbolLayers:He(this.symbolLayers),thumbnail:He(this.thumbnail)})}static fromSimpleMarkerSymbol(e){return new Ed({symbolLayers:new Bt([ip.fromSimpleMarkerSymbol(e)])})}static fromPictureMarkerSymbol(e){return new Ed({symbolLayers:new Bt([ip.fromPictureMarkerSymbol(e)])})}static fromCIMSymbol(e){var r,s;if(((s=(r=e.data)==null?void 0:r.symbol)==null?void 0:s.type)!=="CIMPointSymbol")return null;const i=e.data.symbol;return new Ed(i!=null&&i.callout?{symbolLayers:new Bt([ip.fromCIMSymbol(e)]),callout:new m8({size:.5,color:new zt([0,0,0])}),verticalOffset:new $3({screenLength:40})}:{symbolLayers:new Bt([ip.fromCIMSymbol(e)])})}static fromTextSymbol(e){return new Ed({symbolLayers:new Bt([Jm.fromTextSymbol(e)])})}};v([M({type:$3,json:{write:!0}})],Md.prototype,"verticalOffset",void 0),v([M(g8)],Md.prototype,"callout",void 0),v([M({type:M8,json:{origins:{"web-scene":{write:!0}}}})],Md.prototype,"symbolLayers",void 0),v([Gt({PointSymbol3D:"point-3d"},{readOnly:!0})],Md.prototype,"type",void 0),Md=Ed=v([fe("esri.symbols.PointSymbol3D")],Md);const D3=Md;var Jg;const I8=Bt.ofType({base:null,key:"type",typeMap:{extrude:e8,fill:M_,icon:ip,line:I_,object:A3,text:Jm,water:d8}});let Kg=Jg=class extends A_{constructor(e){super(e),this.symbolLayers=new I8,this.type="polygon-3d"}initialize(){const e=t=>{t.type==="line"&&Em(_t.getLogger(this),"LineSymbol3DLayer can not be used as a SymbolLayer with a PolygonSymbol3D symbol anymore.",{replacement:"Use FillSymbol3DLayer.outline instead.",version:"4.28"}),t.type==="text"&&Em(_t.getLogger(this),"TextSymbol3DLayer can not be used as a SymbolLayer with a PolygonSymbol3D symbol anymore.",{replacement:"Use Labels instead.",version:"4.28"})};for(const t of this.symbolLayers)e(t);this.addHandles(Sp(()=>this.symbolLayers,"after-add",({item:t})=>e(t),Tp))}clone(){return new Jg({styleOrigin:He(this.styleOrigin),symbolLayers:He(this.symbolLayers),thumbnail:He(this.thumbnail)})}static fromJSON(e){var i;const t=new Jg;if(t.read(e),t.symbolLayers.length===2&&t.symbolLayers.at(0).type==="fill"&&t.symbolLayers.at(1).type==="line"){const r=t.symbolLayers.at(0),s=t.symbolLayers.at(1);!s.enabled||(i=e.symbolLayers)!=null&&i[1]&&e.symbolLayers[1].enable===!1||(r.outline={size:s.size,color:s.material!=null?s.material.color:null}),t.symbolLayers.removeAt(1)}return t}static fromSimpleFillSymbol(e){return new Jg({symbolLayers:new Bt([M_.fromSimpleFillSymbol(e)])})}};v([M({type:I8,json:{write:!0}})],Kg.prototype,"symbolLayers",void 0),v([Gt({PolygonSymbol3D:"polygon-3d"},{readOnly:!0})],Kg.prototype,"type",void 0),Kg=Jg=v([fe("esri.symbols.PolygonSymbol3D")],Kg);const N3=Kg;var GM;const KS=new ks({esriSFSSolid:"solid",esriSFSNull:"none",esriSFSHorizontal:"horizontal",esriSFSVertical:"vertical",esriSFSForwardDiagonal:"forward-diagonal",esriSFSBackwardDiagonal:"backward-diagonal",esriSFSCross:"cross",esriSFSDiagonalCross:"diagonal-cross"});let Id=GM=class extends i8{constructor(...e){super(...e),this.color=new zt([0,0,0,.25]),this.outline=new Ym,this.type="simple-fill",this.style="solid"}normalizeCtorArgs(e,t,i){if(e&&typeof e!="string")return e;const r={};return e&&(r.style=e),t&&(r.outline=t),i&&(r.color=i),r}clone(){return new GM({color:He(this.color),outline:this.outline&&this.outline.clone(),style:this.style})}hash(){return`${super.hash()}${this.style}.${this.color&&this.color.hash()}`}};v([M()],Id.prototype,"color",void 0),v([M()],Id.prototype,"outline",void 0),v([Gt({esriSFS:"simple-fill"},{readOnly:!0})],Id.prototype,"type",void 0),v([M({type:KS.apiValues,json:{read:KS.read,write:KS.write}})],Id.prototype,"style",void 0),Id=GM=v([fe("esri.symbols.SimpleFillSymbol")],Id);const A8=Id;var qM;const XS=new ks({esriSMSCircle:"circle",esriSMSSquare:"square",esriSMSCross:"cross",esriSMSX:"x",esriSMSDiamond:"diamond",esriSMSTriangle:"triangle",esriSMSPath:"path"});let wl=qM=class extends b8{constructor(...e){super(...e),this.color=new zt([255,255,255,.25]),this.type="simple-marker",this.size=12,this.style="circle",this.outline=new Ym}normalizeCtorArgs(e,t,i,r){if(e&&typeof e!="string")return e;const s={};return e&&(s.style=e),t!=null&&(s.size=xr(t)),i&&(s.outline=i),r&&(s.color=r),s}writeColor(e,t){e&&this.style!=="x"&&this.style!=="cross"&&(t.color=e.toJSON()),e===null&&(t.color=null)}set path(e){this.style="path",this._set("path",e)}clone(){return new qM({angle:this.angle,color:He(this.color),outline:this.outline&&this.outline.clone(),path:this.path,size:this.size,style:this.style,xoffset:this.xoffset,yoffset:this.yoffset})}hash(){var e;return`${super.hash()}.${this.color&&this.color.hash()}.${this.path}.${this.style}.${(e=this.outline)==null?void 0:e.hash()}`}};v([M()],wl.prototype,"color",void 0),v([ui("color")],wl.prototype,"writeColor",null),v([Gt({esriSMS:"simple-marker"},{readOnly:!0})],wl.prototype,"type",void 0),v([M()],wl.prototype,"size",void 0),v([M({type:XS.apiValues,json:{read:XS.read,write:XS.write}})],wl.prototype,"style",void 0),v([M({type:String,json:{write:!0}})],wl.prototype,"path",null),v([M({types:{key:"type",base:null,defaultKeyValue:"simple-line",typeMap:{"simple-line":Ym}},json:{default:null,write:!0}})],wl.prototype,"outline",void 0),wl=qM=v([fe("esri.symbols.SimpleMarkerSymbol")],wl);const z3=wl;var HM;let pr=HM=class extends Mo{constructor(...e){super(...e),this.backgroundColor=null,this.borderLineColor=null,this.borderLineSize=null,this.font=new Wx,this.horizontalAlignment="center",this.kerning=!0,this.haloColor=null,this.haloSize=null,this.rightToLeft=null,this.rotated=!1,this.text="",this.type="text",this.verticalAlignment="baseline",this.xoffset=0,this.yoffset=0,this.angle=0,this.width=null,this.lineWidth=192,this.lineHeight=1}normalizeCtorArgs(e,t,i){if(e&&typeof e!="string")return e;const r={};return e&&(r.text=e),t&&(r.font=t),i&&(r.color=i),r}writeLineWidth(e,t,i,r){r&&typeof r!="string"?r.origin:t[i]=e}castLineWidth(e){return xr(e)}writeLineHeight(e,t,i,r){r&&typeof r!="string"?r.origin:t[i]=e}clone(){return new HM({angle:this.angle,backgroundColor:He(this.backgroundColor),borderLineColor:He(this.borderLineColor),borderLineSize:this.borderLineSize,color:He(this.color),font:this.font&&this.font.clone(),haloColor:He(this.haloColor),haloSize:this.haloSize,horizontalAlignment:this.horizontalAlignment,kerning:this.kerning,lineHeight:this.lineHeight,lineWidth:this.lineWidth,rightToLeft:this.rightToLeft,rotated:this.rotated,text:this.text,verticalAlignment:this.verticalAlignment,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset})}hash(){var e,t,i;return`${(e=this.backgroundColor)==null?void 0:e.hash()}.${this.borderLineColor}.${this.borderLineSize}.${(t=this.color)==null?void 0:t.hash()}.${this.font&&this.font.hash()}.${(i=this.haloColor)==null?void 0:i.hash()}.${this.haloSize}.${this.horizontalAlignment}.${this.kerning}.${this.rightToLeft}.${this.rotated}.${this.text}.${this.verticalAlignment}.${this.width}.${this.xoffset}.${this.yoffset}.${this.lineHeight}.${this.lineWidth}.${this.angle}`}};v([M({type:zt,json:{write:!0}})],pr.prototype,"backgroundColor",void 0),v([M({type:zt,json:{write:!0}})],pr.prototype,"borderLineColor",void 0),v([M({type:Number,json:{write:!0},cast:xr})],pr.prototype,"borderLineSize",void 0),v([M({type:Wx,json:{write:!0}})],pr.prototype,"font",void 0),v([M({...c8,json:{write:!0}})],pr.prototype,"horizontalAlignment",void 0),v([M({type:Boolean,json:{write:!0}})],pr.prototype,"kerning",void 0),v([M({type:zt,json:{write:!0}})],pr.prototype,"haloColor",void 0),v([M({type:Number,cast:xr,json:{write:!0}})],pr.prototype,"haloSize",void 0),v([M({type:Boolean,json:{write:!0}})],pr.prototype,"rightToLeft",void 0),v([M({type:Boolean,json:{write:!0}})],pr.prototype,"rotated",void 0),v([M({type:String,json:{write:!0}})],pr.prototype,"text",void 0),v([Gt({esriTS:"text"},{readOnly:!0})],pr.prototype,"type",void 0),v([M({...u8,json:{write:!0}})],pr.prototype,"verticalAlignment",void 0),v([M({type:Number,cast:xr,json:{write:!0}})],pr.prototype,"xoffset",void 0),v([M({type:Number,cast:xr,json:{write:!0}})],pr.prototype,"yoffset",void 0),v([M({type:Number,json:{read:e=>e&&-1*e,write:(e,t)=>t.angle=e&&-1*e}})],pr.prototype,"angle",void 0),v([M({type:Number,json:{write:!0}})],pr.prototype,"width",void 0),v([M({type:Number})],pr.prototype,"lineWidth",void 0),v([ui("lineWidth")],pr.prototype,"writeLineWidth",null),v([Rs("lineWidth")],pr.prototype,"castLineWidth",null),v([M(l8)],pr.prototype,"lineHeight",void 0),v([ui("lineHeight")],pr.prototype,"writeLineHeight",null),pr=HM=v([fe("esri.symbols.TextSymbol")],pr);const Zx=pr;var WM;let $a=WM=class extends Mo{constructor(e){super(e),this.color=null,this.styleName=null,this.portal=null,this.styleUrl=null,this.thumbnail=null,this.name=null,this.type="web-style"}get _fetchCacheKey(){const e=this.portal!=null?this.portal:Za.getDefault(),t=e.user?e.user.username:null;return`${this.styleName}:${this.styleUrl}:${this.name}:${t}:${e.url}`}read(e,t){this.portal=t==null?void 0:t.portal,super.read(e,t)}clone(){return new WM({name:this.name,styleUrl:this.styleUrl,styleName:this.styleName,portal:this.portal})}fetchSymbol(e){return this._fetchSymbol("webRef",e)}fetchCIMSymbol(e){return this._fetchSymbol("cimRef",e)}async _fetchSymbol(e,t){const i=t!=null?t.cache:null,r=i?this._fetchCacheKey:null;if(i!=null){const o=r&&i.get(r);if(o)return o.clone()}const{resolveWebStyleSymbol:s}=await ht(()=>import("./webStyleSymbolUtils-yt4cEoD8.js"),__vite__mapDeps([160,161,124,125]));mr(t);const n=s(this,{portal:this.portal},e,t);n.catch(o=>{_t.getLogger(this).error("#fetchSymbol()","Failed to create symbol from style",o)});const c=await n;return e==="webRef"&&c.type==="point-3d"||e==="cimRef"&&c.type==="cim"?(i!=null&&i.set(r,c.clone()),c):null}};v([M({json:{write:!1}})],$a.prototype,"color",void 0),v([M({type:String,json:{write:!0}})],$a.prototype,"styleName",void 0),v([M({type:Za,json:{write:!1}})],$a.prototype,"portal",void 0),v([M({type:String,json:{read:RA,write:xp}})],$a.prototype,"styleUrl",void 0),v([M({type:C0,json:{read:!1}})],$a.prototype,"thumbnail",void 0),v([M({type:String,json:{write:!0}})],$a.prototype,"name",void 0),v([Gt({styleSymbolReference:"web-style"},{readOnly:!0})],$a.prototype,"type",void 0),v([M()],$a.prototype,"_fetchCacheKey",null),$a=WM=v([fe("esri.symbols.WebStyleSymbol")],$a);const Yx=$a;function U_e(e){if(!e)return!1;switch(e.type){case"picture-fill":case"picture-marker":case"simple-fill":case"simple-line":case"simple-marker":case"text":case"cim":return!0;default:return!1}}function j_e(e){if(!e)return!1;switch(e.type){case"label-3d":case"line-3d":case"mesh-3d":case"point-3d":case"polygon-3d":return!0;default:return!1}}const F3={base:Mo,key:"type",typeMap:{"simple-fill":A8,"picture-fill":E8,"picture-marker":L3,"simple-line":Ym,"simple-marker":z3,text:Zx,"label-3d":k3,"line-3d":R3,"mesh-3d":O3,"point-3d":D3,"polygon-3d":N3,"web-style":Yx,cim:Hx},errorContext:"symbol"},V_e={base:Mo,key:"type",typeMap:{"picture-marker":L3,"simple-marker":z3,text:Zx,"web-style":Yx,cim:Hx},errorContext:"symbol"},G_e=aA({types:F3}),q_e={base:Mo,key:"type",typeMap:{"simple-fill":A8,"picture-fill":E8,"picture-marker":L3,"simple-line":Ym,"simple-marker":z3,text:Zx,"line-3d":R3,"mesh-3d":O3,"point-3d":D3,"polygon-3d":N3,"web-style":Yx,cim:Hx},errorContext:"symbol"},H_e={base:Mo,key:"type",typeMap:{text:Zx,"label-3d":k3},errorContext:"symbol"},W_e={base:Mo,key:"type",typeMap:{"line-3d":R3,"mesh-3d":O3,"point-3d":D3,"polygon-3d":N3,"web-style":Yx,cim:Hx},errorContext:"symbol"},Z_e={base:Mo,key:"type",typeMap:{"label-3d":k3},errorContext:"symbol"},Y_e=Uc(F3);var ZM;function xse(e){if(!e)return null;const t={};for(const i in e){const r=km(e[i]);r&&(t[i]=r)}return Object.keys(t).length!==0?t:null}function Sse(e){if(e==null)return null;const t={};for(const i in e){const r=e[i];r&&(t[i]=r.toJSON())}return Object.keys(t).length!==0?t:null}let An=ZM=class extends jl(At){constructor(...e){super(...e),this.isAggregate=!1,this.layer=null,this.origin=null,this.popupTemplate=null,this.sourceLayer=null,Object.defineProperty(this,"uid",{value:p0(),configurable:!0})}normalizeCtorArgs(e,t,i,r){return e&&!e.declaredClass?e:{geometry:e,symbol:t,attributes:i,popupTemplate:r}}set aggregateGeometries(e){const t=this._get("aggregateGeometries");JSON.stringify(t)!==JSON.stringify(e)&&this._set("aggregateGeometries",e)}set attributes(e){const t=this._get("attributes");t!==e&&(this._set("attributes",e),this._notifyLayer("attributes",t,e))}set geometry(e){const t=this._get("geometry");t!==e&&(this._set("geometry",e),this._notifyLayer("geometry",t,e))}set symbol(e){const t=this._get("symbol");t!==e&&(this._set("symbol",e),this._notifyLayer("symbol",t,e))}set visible(e){const t=this._get("visible");t!==e&&(this._set("visible",e),this._notifyLayer("visible",t,e))}cloneShallow(){return new ZM({aggregateGeometries:this.aggregateGeometries,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible,origin:this.origin})}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=this.origin&&"layer"in this.origin?this.origin.layer:null;for(const i of[t,this.sourceLayer,this.layer])if(i){if("popupTemplate"in i&&i.popupTemplate)return i.popupTemplate;if(e&&"defaultPopupTemplate"in i&&i.defaultPopupTemplate!=null)return i.defaultPopupTemplate}return null}getAttribute(e){var t;return(t=this.attributes)==null?void 0:t[e]}setAttribute(e,t){if(this.attributes){const i=this.getAttribute(e);this.attributes[e]=t,this._notifyLayer("attributes",i,t,e)}else this.attributes={[e]:t},this._notifyLayer("attributes",void 0,t,e)}getObjectId(){return this.sourceLayer&&"objectIdField"in this.sourceLayer&&this.sourceLayer.objectIdField?this.getAttribute(this.sourceLayer.objectIdField):null}toJSON(){var e;return{aggregateGeometries:Sse(this.aggregateGeometries),geometry:this.geometry!=null?this.geometry.toJSON():null,symbol:this.symbol!=null?this.symbol.toJSON():null,attributes:ZT(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:((e=this.popupTemplate)==null?void 0:e.toJSON())??null}}notifyGeometryChanged(){this._notifyLayer("geometry",this.geometry,this.geometry)}notifyMeshTransformChanged(e={}){const{geometry:t}=this;if((t==null?void 0:t.type)==="mesh"){const i={origin:t.origin,transform:t.transform};this._notifyLayer("origin-transform",i,i,e.action)}}_notifyLayer(e,t,i,r){if(!this.layer||!("graphicChanged"in this.layer))return;const s={graphic:this,property:e,oldValue:t,newValue:i};e==="origin-transform"&&(s.action=r),e==="attributes"&&(s.attributeName=r),this.layer.graphicChanged(s)}};v([M({value:null,json:{read:xse}})],An.prototype,"aggregateGeometries",null),v([M({value:null})],An.prototype,"attributes",null),v([M({value:null,types:Cx,json:{read:km}})],An.prototype,"geometry",null),v([M({type:Boolean})],An.prototype,"isAggregate",void 0),v([M({clonable:"reference"})],An.prototype,"layer",void 0),v([M({clonable:"reference"})],An.prototype,"origin",void 0),v([M({type:Dre})],An.prototype,"popupTemplate",void 0),v([M({clonable:"reference"})],An.prototype,"sourceLayer",void 0),v([M({value:null,types:F3})],An.prototype,"symbol",null),v([M({type:Boolean,value:!0})],An.prototype,"visible",null),An=ZM=v([fe("esri.Graphic")],An),function(e){e.generateUID=p0}(An||(An={}));const YM=An;let $0=class extends T0{_own(t){t.layer&&"remove"in t.layer&&t.layer!==this.owner&&t.layer.remove(t),t.layer=this.owner}_release(t){t.layer===this.owner&&(t.layer=null)}};v([W4({Type:YM,ensureType:Fn(YM)})],$0.prototype,"itemType",void 0),$0=v([fe("esri.support.GraphicsCollection")],$0);let Bu=class extends Nt{constructor(t){super(t),this.view=null,this.baseLayerViews=new Bt,this.referenceLayerViews=new Bt,this._loadingHandle=ti(()=>{var i,r;return(r=(i=this.view)==null?void 0:i.map)==null?void 0:r.basemap},i=>{i&&i.load().catch(()=>{})},_n)}destroy(){this._set("view",null),this._loadingHandle&&(this._loadingHandle.remove(),this._loadingHandle=null);for(const t of this.baseLayerViews)t.destroy();this.baseLayerViews.length=0;for(const t of this.referenceLayerViews)t.destroy();this.referenceLayerViews.length=0}get suspended(){return!this.view||this.view.suspended}get updating(){var i,r;if(this.view&&this.view.suspended)return!1;const t=(r=(i=this.view)==null?void 0:i.map)==null?void 0:r.basemap;return!!t&&!!t.loaded&&(this.baseLayerViews.some(s=>s.updating)||this.referenceLayerViews.some(s=>s.updating))}};v([M({constructOnly:!0})],Bu.prototype,"view",void 0),v([M({readOnly:!0})],Bu.prototype,"baseLayerViews",void 0),v([M({readOnly:!0})],Bu.prototype,"referenceLayerViews",void 0),v([M({readOnly:!0})],Bu.prototype,"suspended",null),v([M({type:Boolean,readOnly:!0})],Bu.prototype,"updating",null),Bu=v([fe("esri.views.BasemapView")],Bu);function Tse(e){return"tryRecycleWith"in e}let Ese=class{constructor(t,i,r){this.layer=t,this.view=i,this.layerViewImporter=r,this._controller=new AbortController,this._deferred=sa(),this._started=!1,this.done=!1,this.promise=this._deferred.promise,io(this._controller.signal,()=>{const s=new Je("cancelled:layerview-create","layerview creation cancelled",{layer:t});this._deferred.reject(s)})}tryRecycle(t){if(!this.done||!this.layerView||!Tse(this.layerView))return null;const i=this.layer.type,r=this._controller.signal;for(let s=0;s(mr(this._controller.signal),n.emit("layerview-destroy",{view:f,layerView:o}),f.emit("layerview-destroy",{view:f,layerView:o}),n.emit("layerview-create",{view:f,layerView:o}),f.emit("layerview-create",{view:f,layerView:o}),o)),new Promise((g,S)=>io(this._controller.signal,()=>S(jr())))]),this.promise}}return null}destroy(){this._controller.abort();const{layerView:t}=this;if(t){const{layer:i,view:r}=this;i.emit("layerview-destroy",{view:r,layerView:t}),r.emit("layerview-destroy",{layer:i,layerView:t})}this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null,this._map=null}async start(){var s,n;if(this._started)return;this._started=!0;const{_controller:{signal:t},layer:i,view:r}=this;this._map=r.map;try{let c,o;if(await i.load({signal:t}),i.prefetchResources&&await i.prefetchResources({signal:t}),Ise(i))c=await i.createLayerView(r,{signal:t});else{if(!this.layerViewImporter.hasLayerViewModule(i))throw new Je("layer:view-not-supported","No layerview implementation was found");const S=await this.layerViewImporter.importLayerView(i);mr(t),c="default"in S?new S.default({layer:i,view:r}):new S({layer:i,view:r})}const f=()=>{o=Sr(o),c.destroyed||c.destroy(),c.layer=null,c.parent=null,c.view=null,this.done=!0};o=io(t,f),mr(t);try{await c.when()}catch(S){throw f(),S}if(!((n=(s=this._map)==null?void 0:s.allLayers)==null?void 0:n.includes(i)))return f(),void this._deferred.reject(new Je("view:no-layerview-for-layer","The layer has been removed from the map",{layer:i}));this.layerView=c,i.emit("layerview-create",{view:r,layerView:c}),r.emit("layerview-create",{layer:i,layerView:c}),this.done=!0,this._deferred.resolve(c)}catch(c){i.emit("layerview-create-error",{view:r,error:c}),r.emit("layerview-create-error",{layer:i,error:c}),this.done=!0,this._deferred.reject(new Je("layerview:create-error","layerview creation failed",{layer:i,error:c}))}}},Wo=class extends Nt{constructor(t){super(t),this._layerLayerViewInfoMap=new Map,this._recyclingInfoMap=new Map,this._watchUpdatingTracking=new cp,this.supportsGround=!0,this._preloadLayerViewModules=()=>{var r;const i=(r=this.view.map)==null?void 0:r.allLayers;if(i)for(const s of i)this.layerViewImporter.hasLayerViewModule(s)&&this.layerViewImporter.importLayerView(s)},this._reschedule=()=>this.destroyed?Promise.reject():(this._workPromise==null&&(this._workPromise=sa(),this._workPromise.promise.catch(()=>{})),this.removeHandles("reschedule"),this.addHandles(m_(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{var f,g,S;if(this.destroyed)return;const i=this.view.map;if(this._map!==i&&(this.clear(),this._map=i),this._workPromise==null)return void this.notifyChange("updating");this.removeHandles("reschedule"),this.removeHandles("collection-change");const r=new Set,s=[],n=this.view.ready,c=I=>{if(I!=null){for(const A of I)if(A){r.add(A);const O=this._layerLayerViewInfoMap.get(A);O&&n?O.start():O||this._recyclingInfoMap.has(A)||s.push(A),"layers"in A&&A.layers&&c(A.layers)}}};for(const I of this._rootCollectionNames)c(Va(this,I));for(const[I,A]of this._layerLayerViewInfoMap)if(!r.has(I)){this._layerLayerViewInfoMap.delete(A.layer);const O=A.tryRecycle(s);O?(this.notifyChange("updating"),this._recyclingInfoMap.set(A.layer,A),O.then(()=>{this.notifyChange("updating"),this._recyclingInfoMap.delete(A.layer),this._layerLayerViewInfoMap.set(A.layer,A),this._reschedule()}).catch(()=>{this.notifyChange("updating"),this._recyclingInfoMap.delete(A.layer),A.destroy(),this._reschedule()})):A.destroy()}for(const[I,A]of this._recyclingInfoMap)r.has(I)||(this.notifyChange("updating"),this._recyclingInfoMap.delete(A.layer),A.destroy());for(const I of s)this._createLayerView(I);this._refreshCollections();const o=[(f=i==null?void 0:i.ground)==null?void 0:f.layers,(g=i==null?void 0:i.basemap)==null?void 0:g.baseLayers,(S=i==null?void 0:i.basemap)==null?void 0:S.referenceLayers,i==null?void 0:i.layers].filter(I=>!!I);r.forEach(I=>"layers"in I&&o.push(I.layers)),this.addHandles(o.map(I=>this._watchUpdatingTracking.addOnCollectionChange(()=>I,this._reschedule)),"collection-change"),this._workPromise.resolve(),this._workPromise=null}}initialize(){this.addHandles([Sp(()=>{var t,i;return(i=(t=this.view)==null?void 0:t.map)==null?void 0:i.allLayers},"change",this._preloadLayerViewModules,{onListenerAdd:this._preloadLayerViewModules}),ti(()=>{const t=this.view,i=t==null?void 0:t.map;return[i==null?void 0:i.basemap,i==null?void 0:i.ground,i==null?void 0:i.layers,t==null?void 0:t.ready]},()=>this._reschedule(),Fa)]),this._preloadLayerViewModules(),this._reschedule()}destroy(){this.clear(),$S(this._recyclingInfoMap),$S(this._layerLayerViewInfoMap),this._watchUpdatingTracking.destroy(),this._map=null,this._workPromise!=null&&(this._workPromise.reject(jr()),this._workPromise=null)}get _layersToLayerViews(){const t=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.layers","view.layerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"]];return this.supportsGround&&t.push(["view.map.ground.layers","view.groundView.layerViews"]),new Map(t)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return this._workPromise!=null||this._watchUpdatingTracking.updating||dx(this._layerLayerViewInfoMap,t=>!t.done)||this._recyclingInfoMap.size>0}get updatingRemaining(){let t=0;for(const i of this._layerLayerViewInfoMap.values())i.done||++t;return t}clear(){this.destroyed||($S(this._layerLayerViewInfoMap),this._refreshCollections())}async whenLayerView(t){if(await this._reschedule(),!this._layerLayerViewInfoMap.has(t)){if(this._recyclingInfoMap.has(t))return this._recyclingInfoMap.get(t).promise;throw new Je("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:t})}return this._layerLayerViewInfoMap.get(t).promise}_refreshCollections(){for(const[t,i]of this._layersToLayerViews)this._populateLayerViewsOwners(Va(this,t),Va(this,i),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining")}_populateLayerViewsOwners(t,i,r){if(!t||!i)return void(i&&i.removeAll());let s=0;for(const n of t){const c=this._layerLayerViewInfoMap.get(n);if(!(c!=null&&c.layerView))continue;const o=c.layerView;o.layer=n,o.parent=r,i.at(s)!==o&&i.splice(s,0,o),n.layers&&this._populateLayerViewsOwners(n.layers,o.layerViews,o),s+=1}s{}),this.layerViewImporter.hasLayerViewModule(t)&&this.layerViewImporter.importLayerView(t);const i=new Ese(t,this.view,this.layerViewImporter);i.promise.then(()=>this._refreshCollections(),r=>{r&&(Ys(r)||r.name==="cancelled:layerview-create")||_t.getLogger(this).error(`Failed to create layerview for layer title:'${t.title??"no title"}', id:'${t.id??"no id"}' of type '${t.type}'.`,{layer:t,error:r}),this._refreshCollections()}),this._layerLayerViewInfoMap.set(t,i),this.view.ready&&i.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining")}};v([M()],Wo.prototype,"_workPromise",void 0),v([M({readOnly:!0})],Wo.prototype,"_watchUpdatingTracking",void 0),v([M({readOnly:!0})],Wo.prototype,"_layersToLayerViews",null),v([M({readOnly:!0})],Wo.prototype,"_rootCollectionNames",null),v([M()],Wo.prototype,"layerViewImporter",void 0),v([M()],Wo.prototype,"supportsGround",void 0),v([M({readOnly:!0})],Wo.prototype,"updating",null),v([M({readOnly:!0})],Wo.prototype,"updatingRemaining",null),v([M({constructOnly:!0})],Wo.prototype,"view",void 0),Wo=v([fe("esri.views.LayerViewManager")],Wo);const Mse=Wo;function Ise(e){return"createLayerView"in e&&e.createLayerView!=null}let go=class extends Nt{constructor(t){super(t),this.factor=1.5,this.offset=Dn(0,0),this.position=null,this.size=120,this.maskUrl=null,this.maskEnabled=!0,this.overlayUrl=null,this.overlayEnabled=!0,this.visible=!0}get version(){return this.commitProperty("factor"),this.commitProperty("offset"),this.commitProperty("position"),this.commitProperty("visible"),this.commitProperty("size"),this.commitProperty("maskUrl"),this.commitProperty("maskEnabled"),this.commitProperty("overlayUrl"),this.commitProperty("overlayEnabled"),(this._get("version")||0)+1}};v([M({type:Number})],go.prototype,"factor",void 0),v([M({nonNullable:!0})],go.prototype,"offset",void 0),v([M()],go.prototype,"position",void 0),v([M({type:Number,range:{min:0}})],go.prototype,"size",void 0),v([M()],go.prototype,"maskUrl",void 0),v([M()],go.prototype,"maskEnabled",void 0),v([M()],go.prototype,"overlayUrl",void 0),v([M()],go.prototype,"overlayEnabled",void 0),v([M({readOnly:!0})],go.prototype,"version",null),v([M({type:Boolean})],go.prototype,"visible",void 0),go=v([fe("esri.views.Magnifier")],go);const P8=go;let Sb=class{constructor(t){this._observable=new g_,this._map=new Map(t)}get size(){return Rt(this._observable),this._map.size}clear(){this._map.size>0&&(this._map.clear(),this._observable.notify())}delete(t){const i=this._map.delete(t);return i&&this._observable.notify(),i}entries(){return Rt(this._observable),this._map.entries()}forEach(t,i){Rt(this._observable),this._map.forEach((r,s)=>t.call(i,r,s,this),i)}get(t){return Rt(this._observable),this._map.get(t)}has(t){return Rt(this._observable),this._map.has(t)}keys(){return Rt(this._observable),this._map.keys()}set(t,i){return this._map.set(t,i),this._observable.notify(),this}values(){return Rt(this._observable),this._map.values()}[Symbol.iterator](){return Rt(this._observable),this._map[Symbol.iterator]()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}};var JM;let Xg=JM=class extends At{constructor(e){super(e),this.name=null,this.code=null}clone(){return new JM({name:this.name,code:this.code})}};v([M({type:String,json:{write:!0}})],Xg.prototype,"name",void 0),v([M({type:[String,Number],json:{write:!0}})],Xg.prototype,"code",void 0),Xg=JM=v([fe("esri.layers.support.CodedValue")],Xg);const Ase=new ks({inherited:"inherited",codedValue:"coded-value",range:"range"});let Qg=class extends At{constructor(t){super(t),this.name=null,this.type=null}};v([M({type:String,json:{write:!0}})],Qg.prototype,"name",void 0),v([Gt(Ase)],Qg.prototype,"type",void 0),Qg=v([fe("esri.layers.support.Domain")],Qg);const Jx=Qg;var KM;let e0=KM=class extends Jx{constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const i=String(e);this.codedValues.some(r=>(String(r.code)===i&&(t=r.name),!!t))}return t}clone(){return new KM({codedValues:He(this.codedValues),name:this.name})}};v([M({type:[Xg],json:{write:!0}})],e0.prototype,"codedValues",void 0),v([Gt({codedValue:"coded-value"})],e0.prototype,"type",void 0),e0=KM=v([fe("esri.layers.support.CodedValueDomain")],e0);const C8=e0;var XM;let Tb=XM=class extends Jx{constructor(e){super(e),this.type="inherited"}clone(){return new XM}};v([Gt({inherited:"inherited"})],Tb.prototype,"type",void 0),Tb=XM=v([fe("esri.layers.support.InheritedDomain")],Tb);const $8=Tb;var QM;let Vf=QM=class extends Jx{constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new QM({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};v([M({json:{type:[Number],read:{source:"range",reader:(e,t)=>{var i;return(i=t.range)==null?void 0:i[1]}},write:{enabled:!1,overridePolicy(){return{enabled:this.maxValue!=null&&this.minValue==null}},target:"range",writer(e,t,i){t[i]=[this.minValue||0,e]}}}})],Vf.prototype,"maxValue",void 0),v([M({json:{type:[Number],read:{source:"range",reader:(e,t)=>{var i;return(i=t.range)==null?void 0:i[0]}},write:{target:"range",writer(e,t,i){t[i]=[e,this.maxValue||0]}}}})],Vf.prototype,"minValue",void 0),v([Gt({range:"range"})],Vf.prototype,"type",void 0),Vf=QM=v([fe("esri.layers.support.RangeDomain")],Vf);const k8=Vf,Pse={key:"type",base:Jx,typeMap:{range:k8,"coded-value":C8,inherited:$8}};function Cse(e){if(!(e!=null&&e.type))return null;switch(e.type){case"range":return k8.fromJSON(e);case"codedValue":return C8.fromJSON(e);case"inherited":return $8.fromJSON(e)}return null}const $se=new ks({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"});var eI;const kse=new ks({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let dn=eI=class extends At{constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let i=null;try{i=t?JSON.parse(t):null}catch{}return(i==null?void 0:i.value)??null}readValueType(e,{description:t}){let i=null;try{i=t?JSON.parse(t):null}catch{}return i?kse.fromJSON(i.fieldValueType):null}clone(){var e;return new eI({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:((e=this.domain)==null?void 0:e.clone())??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};v([M({type:String,json:{write:!0}})],dn.prototype,"alias",void 0),v([M({type:[String,Number],json:{write:{allowNull:!0}}})],dn.prototype,"defaultValue",void 0),v([M()],dn.prototype,"description",void 0),v([mi("description")],dn.prototype,"readDescription",null),v([M({types:Pse,json:{read:{reader:Cse},write:!0}})],dn.prototype,"domain",void 0),v([M({type:Boolean,json:{write:!0}})],dn.prototype,"editable",void 0),v([M({type:$r,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],dn.prototype,"length",void 0),v([M({type:String,json:{write:!0}})],dn.prototype,"name",void 0),v([M({type:Boolean,json:{write:!0}})],dn.prototype,"nullable",void 0),v([Gt($se)],dn.prototype,"type",void 0),v([M()],dn.prototype,"valueType",void 0),v([mi("valueType",["description"])],dn.prototype,"readValueType",null),v([M({type:Boolean,json:{read:!1}})],dn.prototype,"visible",void 0),dn=eI=v([fe("esri.layers.support.Field")],dn);const Rse=dn;var tI;let Gf=tI=class extends At{constructor(e){super(e),this.type="map-layer"}clone(){const{mapLayerId:e,gdbVersion:t}=this;return new tI({mapLayerId:e,gdbVersion:t})}};v([Gt({mapLayer:"map-layer"})],Gf.prototype,"type",void 0),v([M({type:$r,json:{write:!0}})],Gf.prototype,"mapLayerId",void 0),v([M({type:String,json:{write:!0}})],Gf.prototype,"gdbVersion",void 0),Gf=tI=v([fe("esri.layers.support.source.MapLayerSource")],Gf);var iI;let Ec=iI=class extends At{constructor(e){super(e),this.type="query-table"}clone(){const{workspaceId:e,query:t,oidFields:i,spatialReference:r,geometryType:s}=this,n={workspaceId:e,query:t,oidFields:i,spatialReference:(r==null?void 0:r.clone())??void 0,geometryType:s};return new iI(n)}};v([Gt({queryTable:"query-table"})],Ec.prototype,"type",void 0),v([M({type:String,json:{write:!0}})],Ec.prototype,"workspaceId",void 0),v([M({type:String,json:{write:!0}})],Ec.prototype,"query",void 0),v([M({type:String,json:{write:!0}})],Ec.prototype,"oidFields",void 0),v([M({type:yi,json:{write:!0}})],Ec.prototype,"spatialReference",void 0),v([Gt(fK)],Ec.prototype,"geometryType",void 0),Ec=iI=v([fe("esri.layers.support.source.QueryTableDataSource")],Ec);var rI;let qf=rI=class extends At{constructor(e){super(e),this.type="raster"}clone(){const{workspaceId:e,dataSourceName:t}=this;return new rI({workspaceId:e,dataSourceName:t})}};v([Gt({raster:"raster"})],qf.prototype,"type",void 0),v([M({type:String,json:{write:!0}})],qf.prototype,"dataSourceName",void 0),v([M({type:String,json:{write:!0}})],qf.prototype,"workspaceId",void 0),qf=rI=v([fe("esri.layers.support.source.RasterDataSource")],qf);var sI;let Ad=sI=class extends At{constructor(e){super(e),this.type="table"}clone(){const{workspaceId:e,gdbVersion:t,dataSourceName:i}=this;return new sI({workspaceId:e,gdbVersion:t,dataSourceName:i})}};v([Gt({table:"table"})],Ad.prototype,"type",void 0),v([M({type:String,json:{write:!0}})],Ad.prototype,"workspaceId",void 0),v([M({type:String,json:{write:!0}})],Ad.prototype,"gdbVersion",void 0),v([M({type:String,json:{write:!0}})],Ad.prototype,"dataSourceName",void 0),Ad=sI=v([fe("esri.layers.support.source.TableDataSource")],Ad);var nI,oI;const Ose=Bn()({esriLeftInnerJoin:"left-inner-join",esriLeftOuterJoin:"left-outer-join"});let _o=nI=class extends At{constructor(e){super(e),this.type="join-table"}readLeftTableSource(e,t,i){return IR()(e,t,i)}castLeftTableSource(e){return Uc(aI(),e)}readRightTableSource(e,t,i){return IR()(e,t,i)}castRightTableSource(e){return Uc(aI(),e)}clone(){const{leftTableKey:e,rightTableKey:t,leftTableSource:i,rightTableSource:r,joinType:s}=this,n={leftTableKey:e,rightTableKey:t,leftTableSource:(i==null?void 0:i.clone())??void 0,rightTableSource:(r==null?void 0:r.clone())??void 0,joinType:s};return new nI(n)}};v([Gt({joinTable:"join-table"})],_o.prototype,"type",void 0),v([M({type:String,json:{write:!0}})],_o.prototype,"leftTableKey",void 0),v([M({type:String,json:{write:!0}})],_o.prototype,"rightTableKey",void 0),v([M({json:{write:!0}})],_o.prototype,"leftTableSource",void 0),v([mi("leftTableSource")],_o.prototype,"readLeftTableSource",null),v([Rs("leftTableSource")],_o.prototype,"castLeftTableSource",null),v([M({json:{write:!0}})],_o.prototype,"rightTableSource",void 0),v([mi("rightTableSource")],_o.prototype,"readRightTableSource",null),v([Rs("rightTableSource")],_o.prototype,"castRightTableSource",null),v([Gt(Ose)],_o.prototype,"joinType",void 0),_o=nI=v([fe("esri.layers.support.source.JoinTableDataSource")],_o);let QS=null;function IR(){return QS||(QS=aA({types:aI()})),QS}let eT=null;function aI(){return eT||(eT={key:"type",base:null,typeMap:{"data-layer":Pc,"map-layer":Gf}}),eT}const Lse={key:"type",base:null,typeMap:{"join-table":_o,"query-table":Ec,raster:qf,table:Ad}};let Pc=oI=class extends At{constructor(e){super(e),this.type="data-layer"}clone(){const{fields:e,dataSource:t}=this;return new oI({fields:e,dataSource:t})}};v([Gt({dataLayer:"data-layer"})],Pc.prototype,"type",void 0),v([M({type:[Rse],json:{write:!0}})],Pc.prototype,"fields",void 0),v([M({types:Lse,json:{write:!0}})],Pc.prototype,"dataSource",void 0),Pc=oI=v([fe("esri.layers.support.source.DataLayerSource")],Pc),Pc.from=Fn(Pc);let Pd=class extends jl(At){constructor(t){super(t),this.onFields=null,this.operator=null,this.searchTerm=null,this.searchType=null}};v([M({type:[String],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.onFields!=null&&this.onFields.length>0}}}}})],Pd.prototype,"onFields",void 0),v([M({type:String,json:{write:!0}})],Pd.prototype,"operator",void 0),v([M({type:String,json:{write:!0}})],Pd.prototype,"searchTerm",void 0),v([M({type:String,json:{write:!0}})],Pd.prototype,"searchType",void 0),Pd=v([fe("esri.rest.support.FullTextSearch")],Pd);const Dse=Pd;var lI;const AR=new ks({upperLeft:"upper-left",lowerLeft:"lower-left"});let Cd=lI=class extends At{constructor(e){super(e),this.extent=null,this.mode="view",this.originPosition="upper-left",this.tolerance=1}clone(){return new lI(He({extent:this.extent,mode:this.mode,originPosition:this.originPosition,tolerance:this.tolerance}))}};v([M({type:Ui,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],Cd.prototype,"extent",void 0),v([M({type:["view","edit"],json:{write:!0}})],Cd.prototype,"mode",void 0),v([M({type:String,json:{read:AR.read,write:AR.write}})],Cd.prototype,"originPosition",void 0),v([M({type:Number,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],Cd.prototype,"tolerance",void 0),Cd=lI=v([fe("esri.rest.support.QuantizationParameters")],Cd);const R8=Cd,Nse=new ks({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"});var cI;const PR=new ks({count:"count",sum:"sum",min:"min",max:"max",avg:"avg",stddev:"stddev",var:"var",exceedslimit:"exceedslimit",percentile_cont:"percentile-continuous",percentile_disc:"percentile-discrete",EnvelopeAggregate:"envelope-aggregate",CentroidAggregate:"centroid-aggregate",ConvexHullAggregate:"convex-hull-aggregate"});let ka=cI=class extends At{constructor(e){super(e),this.maxPointCount=void 0,this.maxRecordCount=void 0,this.maxVertexCount=void 0,this.onStatisticField=null,this.outStatisticFieldName=null,this.statisticType=null,this.statisticParameters=null}writeStatisticParameters(e,t){this.statisticType!=="percentile-continuous"&&this.statisticType!=="percentile-discrete"||(t.statisticParameters=He(e))}clone(){return new cI({maxPointCount:this.maxPointCount,maxRecordCount:this.maxRecordCount,maxVertexCount:this.maxVertexCount,onStatisticField:this.onStatisticField,outStatisticFieldName:this.outStatisticFieldName,statisticType:this.statisticType,statisticParameters:He(this.statisticParameters)})}};v([M({type:Number,json:{write:!0}})],ka.prototype,"maxPointCount",void 0),v([M({type:Number,json:{write:!0}})],ka.prototype,"maxRecordCount",void 0),v([M({type:Number,json:{write:!0}})],ka.prototype,"maxVertexCount",void 0),v([M({type:String,json:{write:!0}})],ka.prototype,"onStatisticField",void 0),v([M({type:String,json:{write:!0}})],ka.prototype,"outStatisticFieldName",void 0),v([M({type:String,json:{read:{source:"statisticType",reader:PR.read},write:{target:"statisticType",writer:PR.write}}})],ka.prototype,"statisticType",void 0),v([M({type:Object})],ka.prototype,"statisticParameters",void 0),v([ui("statisticParameters")],ka.prototype,"writeStatisticParameters",null),ka=cI=v([fe("esri.rest.support.StatisticDefinition")],ka);const zse=ka;var Eb;const Fse=new ks({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let Ot=Eb=class extends At{static from(e){return px(Eb,e)}constructor(e){super(e),this.aggregateIds=null,this.cacheHint=void 0,this.compactGeometryEnabled=!1,this.datumTransformation=null,this.defaultSpatialReferenceEnabled=!1,this.distance=void 0,this.dynamicDataSource=void 0,this.formatOf3DObjects=null,this.fullText=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=void 0,this.groupByFieldsForStatistics=null,this.having=null,this.historicMoment=null,this.maxAllowableOffset=void 0,this.maxRecordCountFactor=1,this.multipatchOption=null,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.outStatistics=null,this.parameterValues=null,this.pixelSize=null,this.quantizationParameters=null,this.rangeValues=null,this.relationParameter=null,this.resultType=null,this.returnCentroid=!1,this.returnDistinctValues=!1,this.returnExceededLimitFeatures=!0,this.returnGeometry=!1,this.returnQueryGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.sourceSpatialReference=null,this.spatialRelationship="intersects",this.start=void 0,this.sqlFormat=null,this.text=null,this.timeExtent=null,this.timeReferenceUnknownClient=!1,this.units=null,this.where=null}castDatumTransformation(e){return typeof e=="number"||typeof e=="object"?e:null}writeHistoricMoment(e,t){t.historicMoment=e&&e.getTime()}writeParameterValues(e,t){if(e){const i={};for(const r in e){const s=e[r];Array.isArray(s)?i[r]=s.map(n=>n instanceof Date?n.getTime():n):s instanceof Date?i[r]=s.getTime():i[r]=s}t.parameterValues=i}}writeStart(e,t){t.resultOffset=this.start,t.resultRecordCount=this.num||10,t.where="1=1"}writeWhere(e,t){t.where=e||"1=1"}clone(){return new Eb(He({aggregateIds:this.aggregateIds,cacheHint:this.cacheHint,compactGeometryEnabled:this.compactGeometryEnabled,datumTransformation:this.datumTransformation,defaultSpatialReferenceEnabled:this.defaultSpatialReferenceEnabled,distance:this.distance,fullText:this.fullText,formatOf3DObjects:this.formatOf3DObjects,gdbVersion:this.gdbVersion,geometry:this.geometry,geometryPrecision:this.geometryPrecision,groupByFieldsForStatistics:this.groupByFieldsForStatistics,having:this.having,historicMoment:this.historicMoment!=null?new Date(this.historicMoment.getTime()):null,maxAllowableOffset:this.maxAllowableOffset,maxRecordCountFactor:this.maxRecordCountFactor,multipatchOption:this.multipatchOption,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,outStatistics:this.outStatistics,parameterValues:this.parameterValues,pixelSize:this.pixelSize,quantizationParameters:this.quantizationParameters,rangeValues:this.rangeValues,relationParameter:this.relationParameter,resultType:this.resultType,returnDistinctValues:this.returnDistinctValues,returnGeometry:this.returnGeometry,returnCentroid:this.returnCentroid,returnExceededLimitFeatures:this.returnExceededLimitFeatures,returnQueryGeometry:this.returnQueryGeometry,returnM:this.returnM,returnZ:this.returnZ,dynamicDataSource:this.dynamicDataSource,sourceSpatialReference:this.sourceSpatialReference,spatialRelationship:this.spatialRelationship,start:this.start,sqlFormat:this.sqlFormat,text:this.text,timeExtent:this.timeExtent,timeReferenceUnknownClient:this.timeReferenceUnknownClient,units:this.units,where:this.where}))}};Ot.MAX_MAX_RECORD_COUNT_FACTOR=5,v([M({json:{write:!0}})],Ot.prototype,"aggregateIds",void 0),v([M({type:Boolean,json:{write:!0}})],Ot.prototype,"cacheHint",void 0),v([M({type:Boolean,json:{default:!1,write:!0}})],Ot.prototype,"compactGeometryEnabled",void 0),v([M({json:{write:!0}})],Ot.prototype,"datumTransformation",void 0),v([Rs("datumTransformation")],Ot.prototype,"castDatumTransformation",null),v([M({type:Boolean,json:{default:!1,write:!0}})],Ot.prototype,"defaultSpatialReferenceEnabled",void 0),v([M({type:Number,json:{write:{overridePolicy:e=>({enabled:e>0})}}})],Ot.prototype,"distance",void 0),v([M({type:Pc,json:{write:!0}})],Ot.prototype,"dynamicDataSource",void 0),v([M({type:String,json:{write:!0}})],Ot.prototype,"formatOf3DObjects",void 0),v([M({type:[Dse],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.fullText!=null&&this.fullText.length>0}}}}})],Ot.prototype,"fullText",void 0),v([M({type:String,json:{write:!0}})],Ot.prototype,"gdbVersion",void 0),v([M({types:Cx,json:{read:km,write:!0}})],Ot.prototype,"geometry",void 0),v([M({type:Number,json:{write:!0}})],Ot.prototype,"geometryPrecision",void 0),v([M({type:[String],json:{write:!0}})],Ot.prototype,"groupByFieldsForStatistics",void 0),v([M({type:String,json:{write:!0}})],Ot.prototype,"having",void 0),v([M({type:Date})],Ot.prototype,"historicMoment",void 0),v([ui("historicMoment")],Ot.prototype,"writeHistoricMoment",null),v([M({type:Number,json:{write:!0}})],Ot.prototype,"maxAllowableOffset",void 0),v([M({type:Number,cast:e=>e<1?1:e>Ot.MAX_MAX_RECORD_COUNT_FACTOR?Ot.MAX_MAX_RECORD_COUNT_FACTOR:e,json:{write:{overridePolicy:e=>({enabled:e>1})}}})],Ot.prototype,"maxRecordCountFactor",void 0),v([M({type:["xyFootprint"],json:{write:!0}})],Ot.prototype,"multipatchOption",void 0),v([M({type:Number,json:{read:{source:"resultRecordCount"}}})],Ot.prototype,"num",void 0),v([M({json:{write:!0}})],Ot.prototype,"objectIds",void 0),v([M({type:[String],json:{write:!0}})],Ot.prototype,"orderByFields",void 0),v([M({type:[String],json:{write:!0}})],Ot.prototype,"outFields",void 0),v([M({type:yi,json:{name:"outSR",write:!0}})],Ot.prototype,"outSpatialReference",void 0),v([M({type:[zse],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.outStatistics!=null&&this.outStatistics.length>0}}}}})],Ot.prototype,"outStatistics",void 0),v([M({json:{write:!0}})],Ot.prototype,"parameterValues",void 0),v([ui("parameterValues")],Ot.prototype,"writeParameterValues",null),v([M({type:ri,json:{write:!0}})],Ot.prototype,"pixelSize",void 0),v([M({type:R8,json:{write:!0}})],Ot.prototype,"quantizationParameters",void 0),v([M({type:[Object],json:{write:!0}})],Ot.prototype,"rangeValues",void 0),v([M({type:String,json:{read:{source:"relationParam"},write:{target:"relationParam",overridePolicy(){return{enabled:this.spatialRelationship==="relation"}}}}})],Ot.prototype,"relationParameter",void 0),v([M({type:String,json:{write:!0}})],Ot.prototype,"resultType",void 0),v([M({type:Boolean,json:{default:!1,write:!0}})],Ot.prototype,"returnCentroid",void 0),v([M({type:Boolean,json:{default:!1,write:!0}})],Ot.prototype,"returnDistinctValues",void 0),v([M({type:Boolean,json:{default:!0,write:!0}})],Ot.prototype,"returnExceededLimitFeatures",void 0),v([M({type:Boolean,json:{write:!0}})],Ot.prototype,"returnGeometry",void 0),v([M({type:Boolean,json:{default:!1,write:!0}})],Ot.prototype,"returnQueryGeometry",void 0),v([M({type:Boolean,json:{default:!1,write:!0}})],Ot.prototype,"returnM",void 0),v([M({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],Ot.prototype,"returnZ",void 0),v([M({type:yi,json:{write:!0}})],Ot.prototype,"sourceSpatialReference",void 0),v([Gt(Nse,{ignoreUnknown:!1,name:"spatialRel"})],Ot.prototype,"spatialRelationship",void 0),v([M({type:Number,json:{read:{source:"resultOffset"}}})],Ot.prototype,"start",void 0),v([ui("start"),ui("num")],Ot.prototype,"writeStart",null),v([M({type:String,json:{write:!0}})],Ot.prototype,"sqlFormat",void 0),v([M({type:String,json:{write:!0}})],Ot.prototype,"text",void 0),v([M({type:E_,json:{write:!0}})],Ot.prototype,"timeExtent",void 0),v([M({type:Boolean,json:{default:!1,write:!0}})],Ot.prototype,"timeReferenceUnknownClient",void 0),v([Gt(Fse,{ignoreUnknown:!1}),M({json:{write:{overridePolicy(e){return{enabled:!!e&&this.distance!=null&&this.distance>0}}}}})],Ot.prototype,"units",void 0),v([M({type:String,json:{write:{overridePolicy(e){return{enabled:e!=null||this.start!=null&&this.start>0}}}}})],Ot.prototype,"where",void 0),v([ui("where")],Ot.prototype,"writeWhere",null),Ot=Eb=v([fe("esri.rest.support.Query")],Ot);const CR=Ot;let Mc=class extends Sh.EventedAccessor{constructor(t){super(t),this._selectionMap=new Sb,this._trashCan=[],this._layerEditHandles=new Bt,this._vizTaskId=0,this.showHighlight=!0}initialize(){this.addHandles([ti(()=>[this.view,this.showHighlight],()=>this._refreshVisualization()),Sp(()=>this.sources,"change",i=>{const r=this._selectionMap;for(const s of i.removed)r.delete(s);this._refreshListeners(),this._refreshVisualization()},{onListenerAdd:()=>this._refreshListeners()})]);const t=new Bt;this.view.when().then(()=>{this.view.map.allLayers.flatten(i=>"sublayers"in i&&i.sublayers?i.sublayers:null).forEach(i=>{(xv(i)&&!hZ(i)||Tf(i))&&t.add(i)}),this._set("sources",t)})}destroy(){this._layerEditHandles.drain(Sr)}get selections(){return Array.from(this._selectionMap.entries()).map(t=>{const[i,r]=t;return{layer:i,selection:[...r.selection]}})}get count(){let t=0;for(const i of this._selectionMap.values())t+=i.selection.length;return t}get hasSelection(){return this.count>0}get sources(){return this._get("sources")}set sources(t){this._set("sources",t)}async getSelectedFeatures(t,i={},r="layerView"){const{view:s,selections:n}=this,c=(t!==void 0?n.filter(o=>t.includes(o.layer)):n).filter(o=>o.selection.length>0).map(async o=>{const{layer:f,selection:g}=o,S=Tf(f)?f.parent:f;if(S==null||!$R(S))return null;if(r==="layer")return kR(S,g,i);const I=await s.whenLayerView(S);return kR(I,g,i)});return(await Promise.all(c)).filter(o=>o!==null)}updateSelection(t){const i=new Map;for(const[n,c]of this._selectionMap)i.set(n,[...c.selection]);let r=!1;const s=t.current.concat(t.added);for(const n of s){const c=n.sourceLayer,o=n.getObjectId();if(this.sources.includes(c)&&(xv(c)||Tf(c))&&o!==null){const f=nA(i,c,()=>[]);f.includes(o)||(f.push(o),r=!0)}}for(const n of t.removed){const c=n.sourceLayer,o=n.getObjectId();if(this.sources.includes(c)&&(xv(c)||Tf(c))&&o!==null){const f=i.get(c),g=f==null?void 0:f.indexOf(o);g!==void 0&&g>=0&&(f==null||f.splice(g,1),r=!0)}}if(r){const{_selectionMap:n,_trashCan:c}=this,o=[];for(const[f,g]of i){const S=n.get(f);S!==void 0&&c.push(S),n.set(f,{selection:g}),o.push({layer:f,selection:g,...YC(S!==void 0?S.selection:[],g)})}this._onSelectionChange(o)}}setSelection(t,i){this._setSelection(t,i)}getSelection(t){const i=this._selectionMap.get(t);return i==null?void 0:i.selection}appendToSelection(t,i){const r=this._selectionMap.get(t),s=r!==void 0?[...r.selection]:[];for(const n of i)s.includes(n)||s.push(n);this._setSelection(t,s)}removeFromSelection(t,i){const r=this._selectionMap.get(t);if(!r)return;const s=[];for(const n of r.selection)i.includes(n)||s.push(n);this._setSelection(t,s)}toggleInSelection(t,i){const r=this._selectionMap.get(t);if(!r||r.selection.length===0)return void this._setSelection(t,i);const s=new Set(r.selection),n=new Set(i),c=kG(s,n);this._setSelection(t,Array.from(c))}clear(){const t=this._selectionMap.values();this._trashCan.push(...t);const i=[];for(const[r,s]of this._selectionMap.entries())i.push({layer:r,added:[],removed:[...s.selection],selection:[]});this._selectionMap.clear(),this._onSelectionChange(i)}_onSelectionChange(t){this._refreshVisualization(),this.emit("selection-change",{view:this.view,changes:t})}_refreshVisualization(){var c;if(this.view==null||this.sources==null)return;for(this._vizTaskId++;this._trashCan.length>0;){const o=this._trashCan.pop();(c=o==null?void 0:o.highlightHandle)==null||c.remove()}const{sources:t,view:i,_selectionMap:r,showHighlight:s}=this,n=this._vizTaskId;for(const o of t){const f=r.get(o),g=Tf(o)?o.parent:o;g!=null&&$R(g)&&i.whenLayerView(g).then(S=>{var I;(I=f==null?void 0:f.highlightHandle)==null||I.remove(),f!==void 0&&s&&n===this._vizTaskId&&"highlight"in S&&typeof S.highlight=="function"&&f.selection.length>0&&(f.highlightHandle=S.highlight(f.selection,"selection"))})}}_refreshListeners(){this._layerEditHandles.drain(Sr);for(const t of this.sources){const i=Tf(t)?t.parent:t;if(i!=null&&xv(i)){const r=i.on("edits",s=>{this._handleEditChanges(s,t)});this._layerEditHandles.push(r)}}}_handleEditChanges(t,i){if(t.deletedFeatures!==void 0&&t.deletedFeatures.length>0&&this._selectionMap.has(i)){const r=t.deletedFeatures.filter(s=>s.error==null).map(s=>s.objectId).filter(N0);this.removeFromSelection(i,r)}}_setSelection(t,i){if(!this.sources.includes(t))throw new Error(`Cannot set selection on layer ${t.title} because it is not in 'sources'`);const r=this._selectionMap.get(t);if(r===void 0||!Use(r,{selection:i})){r!==void 0&&this._trashCan.push(r),this._selectionMap.set(t,{selection:[...i]});const s={layer:t,selection:[...i],...YC(r!==void 0?r.selection:[],i)};this._onSelectionChange([s])}}};v([M({readOnly:!0,nonNullable:!0})],Mc.prototype,"selections",null),v([M({readOnly:!0,nonNullable:!0})],Mc.prototype,"count",null),v([M({constructOnly:!0,nonNullable:!0})],Mc.prototype,"view",void 0),v([M({readOnly:!0,nonNullable:!0})],Mc.prototype,"hasSelection",null),v([M()],Mc.prototype,"showHighlight",void 0),v([M()],Mc.prototype,"sources",null),Mc=v([fe("esri.views.SelectionManager")],Mc);const xv=e=>e.createQuery!==void 0&&e.on!==void 0,Bse=e=>e.layer!==void 0,$R=e=>(e==null?void 0:e.when)!==void 0,Use=(e,t)=>{if(e==null&&t==null)return!0;if(e!=null&&t==null||e==null&&t!=null)return!1;if(e!=null&&t!=null&&e.selection!=null&&t.selection!=null){const i=[...e.selection],r=[...t.selection];if(i.length!==r.length)return!1;i.sort(),r.sort();for(let s=0;s{let r;if(Bse(e)){const s=e;r=s===void 0?null:await s.queryFeatures(new CR({...i,objectIds:t})).then(n=>({data:n,layer:e.layer}))}else{const s=e;r=s===void 0?null:await s.queryFeatures(new CR({...i,objectIds:t})).then(n=>({data:n,layer:s}))}return r},jse=Mc;let t0=class extends jl(Nt){constructor(t){super(t),this.accentColor=new zt([255,127,0]),this.textColor=new zt([255,255,255])}};v([M({type:zt,nonNullable:!0})],t0.prototype,"accentColor",void 0),v([M({type:zt,nonNullable:!0})],t0.prototype,"textColor",void 0),t0=v([fe("esri.views.Theme")],t0);const uI=t0;var RR;(function(e){e[e.Left=0]="Left",e[e.Middle=1]="Middle",e[e.Right=2]="Right"})(RR||(RR={}));const O8=["click","double-click","immediate-click","immediate-double-click","hold","drag","key-down","key-up","pointer-down","pointer-move","pointer-up","pointer-drag","mouse-wheel","pointer-enter","pointer-leave","gamepad","focus","blur"],L8={};function D8(e){return!!L8[e]}function Vse(e){for(const t of e)if(!D8(t))return!1;return!0}O8.forEach(e=>{L8[e]=!0});let Gse=class{constructor(t){this._handlers=new Map,this._counter=0,this._handlerCounts=new Map,this.view=t,this.inputManager=null}connect(t){t&&this.disconnect(),this.inputManager=t,this._handlers.forEach(({handler:i,priority:r},s)=>{var n;return(n=this.inputManager)==null?void 0:n.installHandlers(s,[i],r)})}disconnect(){this.inputManager&&this._handlers.forEach((t,i)=>{var r;return(r=this.inputManager)==null?void 0:r.uninstallHandlers(i)}),this.inputManager=null}destroy(){this.disconnect(),this._handlers.clear(),this.view=null}on(t,i,r,s){const n=Array.isArray(t)?t:t.split(",");if(!Vse(n))return n.some(D8)&&console.error("Error: registering input events and other events on the view at the same time is not supported."),null;let c,o;Array.isArray(i)?o=i:(c=i,o=[]),typeof r=="function"?c=r:s=r,s=s??uh.DEFAULT;const f=this._createUniqueGroupName(),g=new qse(this.view,n,o,c);this._handlers.set(f,{handler:g,priority:s});for(const S of n){const I=this._handlerCounts.get(S)||0;this._handlerCounts.set(S,I+1)}return this.inputManager&&this.inputManager.installHandlers(f,[g],s),er(()=>this._removeHandler(f,n))}hasHandler(t){return!!this._handlerCounts.get(t)}_removeHandler(t,i){if(this._handlers.has(t)){this._handlers.delete(t);for(const r of i){const s=this._handlerCounts.get(r);s===void 0?console.error("Trying to remove handler for event that has no handlers registered: ",r):s===1?this._handlerCounts.delete(r):this._handlerCounts.set(r,s-1)}}this.inputManager&&this.inputManager.uninstallHandlers(t)}_createUniqueGroupName(){return this._counter+=1,`viewEvents_${this._counter}`}},qse=class extends bs{constructor(t,i,r,s){super(!0),this._latestDragStart=void 0,this.view=t;for(const n of i)switch(n){case"click":this.registerIncoming("click",r,c=>s(this._wrapClick(c)));break;case"double-click":this.registerIncoming("double-click",r,c=>s(this._wrapDoubleClick(c)));break;case"immediate-click":this.registerIncoming("immediate-click",r,c=>s(this._wrapImmediateClick(c)));break;case"immediate-double-click":this.registerIncoming("immediate-double-click",r,c=>s(this._wrapImmediateDoubleClick(c)));break;case"hold":this.registerIncoming("hold",r,c=>s(this._wrapHold(c)));break;case"drag":this.registerIncoming("drag",r,c=>{const o=this._wrapDrag(c);o&&s(o)});break;case"key-down":this.registerIncoming("key-down",r,c=>s(this._wrapKeyDown(c)));break;case"key-up":this.registerIncoming("key-up",r,c=>s(this._wrapKeyUp(c)));break;case"pointer-down":this.registerIncoming("pointer-down",r,c=>s(this._wrapPointer(c,"pointer-down")));break;case"pointer-move":this.registerIncoming("pointer-move",r,c=>s(this._wrapPointer(c,"pointer-move")));break;case"pointer-up":this.registerIncoming("pointer-up",r,c=>s(this._wrapPointer(c,"pointer-up")));break;case"pointer-drag":this.registerIncoming("pointer-drag",r,c=>s(this._wrapPointerDrag(c)));break;case"mouse-wheel":this.registerIncoming("mouse-wheel",r,c=>s(this._wrapMouseWheel(c)));break;case"pointer-enter":this.registerIncoming("pointer-enter",r,c=>s(this._wrapPointer(c,"pointer-enter")));break;case"pointer-leave":this.registerIncoming("pointer-leave",r,c=>s(this._wrapPointer(c,"pointer-leave")));break;case"gamepad":this.registerIncoming("gamepad",r,c=>{s(this._wrapGamepad(c))});break;case"focus":this.registerIncoming("focus",r,c=>{s(this._wrapFocus(c))});break;case"blur":this.registerIncoming("blur",r,c=>{s(this._wrapBlur(c))})}}_wrapFocus(t){return{type:"focus",timestamp:t.timestamp,native:t.data.native,cancelable:t.cancelable,stopPropagation:()=>t.stopPropagation(),async:i=>t.async(i),preventDefault:()=>t.preventDefault()}}_wrapBlur(t){return{type:"blur",timestamp:t.timestamp,native:t.data.native,cancelable:t.cancelable,stopPropagation:()=>t.stopPropagation(),async:i=>t.async(i),preventDefault:()=>t.preventDefault()}}_wrapClick(t){const{pointerType:i,button:r,buttons:s,x:n,y:c,native:o,eventId:f}=t.data,{cancelable:g,timestamp:S}=t;return{type:"click",pointerType:i,button:r,buttons:s,x:n,y:c,native:o,timestamp:S,screenPoint:Dn(n,c),mapPoint:this._getMapPoint(n,c),eventId:f,cancelable:g,stopPropagation:()=>t.stopPropagation(),async:I=>t.async(I),preventDefault:()=>t.preventDefault()}}_wrapDoubleClick(t){const{pointerType:i,button:r,buttons:s,x:n,y:c,native:o,eventId:f}=t.data,{cancelable:g,timestamp:S}=t;return{type:"double-click",pointerType:i,button:r,buttons:s,x:n,y:c,native:o,timestamp:S,mapPoint:this._getMapPoint(n,c),eventId:f,cancelable:g,stopPropagation:()=>t.stopPropagation(),async:I=>t.async(I),preventDefault:()=>t.preventDefault()}}_wrapImmediateClick(t){const{pointerType:i,button:r,buttons:s,x:n,y:c,native:o,eventId:f}=t.data,g=o.pointerId,{cancelable:S,timestamp:I}=t;return{type:"immediate-click",pointerId:g,pointerType:i,button:r,buttons:s,x:n,y:c,native:o,timestamp:I,mapPoint:this._getMapPoint(n,c),eventId:f,cancelable:S,stopPropagation:()=>t.stopPropagation(),async:A=>t.async(A),preventDefault:()=>t.preventDefault()}}_wrapImmediateDoubleClick(t){const{pointerType:i,button:r,buttons:s,x:n,y:c,native:o,eventId:f}=t.data,g=o.pointerId,{cancelable:S,timestamp:I}=t;return{type:"immediate-double-click",pointerId:g,pointerType:i,button:r,buttons:s,x:n,y:c,native:o,timestamp:I,mapPoint:this._getMapPoint(n,c),eventId:f,cancelable:S,stopPropagation:()=>t.stopPropagation(),async:A=>t.async(A),preventDefault:()=>t.preventDefault()}}_wrapHold(t){const{pointerType:i,button:r,buttons:s,x:n,y:c,native:o}=t.data,{cancelable:f,timestamp:g}=t;return{type:"hold",pointerType:i,button:r,buttons:s,x:n,y:c,native:o,timestamp:g,mapPoint:this._getMapPoint(n,c),cancelable:f,stopPropagation:()=>t.stopPropagation(),async:S=>t.async(S),preventDefault:()=>t.preventDefault()}}_getMapPoint(t,i){return this.view.toMap(Dn(t,i),{exclude:[]})}_wrapDrag(t){const i=t.data,{x:r,y:s}=i.center,{action:n,pointerType:c,button:o}=i;if(n==="start"&&(this._latestDragStart=i),!this._latestDragStart)return;const f=i.pointer.native,g=i.buttons,{cancelable:S,timestamp:I}=t,A={x:this._latestDragStart.center.x,y:this._latestDragStart.center.y};return n==="end"&&(this._latestDragStart=void 0),{type:"drag",action:n,x:r,y:s,origin:A,pointerType:c,button:o,buttons:g,radius:i.radius,angle:zN(i.angle),native:f,timestamp:I,cancelable:S,stopPropagation:()=>t.stopPropagation(),async:O=>t.async(O),preventDefault:()=>t.preventDefault()}}_wrapKeyDown(t){const{key:i,repeat:r,native:s}=t.data,{cancelable:n,timestamp:c}=t;return{type:"key-down",key:i,repeat:r,native:s,timestamp:c,cancelable:n,stopPropagation:()=>t.stopPropagation(),async:o=>t.async(o),preventDefault:()=>t.preventDefault()}}_wrapKeyUp(t){const{key:i,native:r}=t.data,{cancelable:s,timestamp:n}=t;return{type:"key-up",key:i,native:r,timestamp:n,cancelable:s,stopPropagation:()=>t.stopPropagation(),async:c=>t.async(c),preventDefault:()=>t.preventDefault()}}_wrapPointer(t,i){const{x:r,y:s,button:n,buttons:c,native:o,eventId:f}=t.data,g=o.pointerId,S=o.pointerType,{cancelable:I,timestamp:A}=t;return{type:i,x:r,y:s,pointerId:g,pointerType:S,button:n,buttons:c,native:o,timestamp:A,eventId:f,cancelable:I,stopPropagation:()=>t.stopPropagation(),async:O=>t.async(O),preventDefault:()=>t.preventDefault()}}_wrapPointerDrag(t){const{x:i,y:r,buttons:s,native:n,eventId:c}=t.data.currentEvent,{button:o}=t.data.startEvent,f=t.data.startEvent.native.pointerId,g=t.data.startEvent.native.pointerType,S=t.data.action,I={x:t.data.startEvent.x,y:t.data.startEvent.y},{cancelable:A,timestamp:O}=t;return{type:"pointer-drag",x:i,y:r,pointerId:f,pointerType:g,button:o,buttons:s,action:S,origin:I,native:n,timestamp:O,eventId:c,cancelable:A,stopPropagation:()=>t.stopPropagation(),async:z=>t.async(z),preventDefault:()=>t.preventDefault()}}_wrapMouseWheel(t){const{cancelable:i,data:r,timestamp:s}=t,{x:n,y:c,deltaY:o,native:f}=r;return{type:"mouse-wheel",x:n,y:c,deltaY:o,native:f,timestamp:s,cancelable:i,stopPropagation:()=>t.stopPropagation(),async:g=>t.async(g),preventDefault:()=>t.preventDefault()}}_wrapGamepad(t){const{action:i,state:r,device:s}=t.data,{cancelable:n,timestamp:c}=t,{buttons:o,axes:f}=r;return{type:"gamepad",device:s,timestamp:c,action:i,buttons:o,axes:f,cancelable:n,stopPropagation:()=>t.stopPropagation(),async:g=>t.async(g),preventDefault:()=>t.preventDefault()}}};var i_,OR,LR;(function(e){e[e.USER=0]="USER",e[e.MANAGER=1]="MANAGER"})(i_||(i_={})),function(e){e[e.None=0]="None",e[e.Unfocused=1]="Unfocused",e[e.Focused=2]="Focused",e[e.Unselected=4]="Unselected",e[e.Selected=8]="Selected",e[e.All=15]="All"}(OR||(OR={})),function(e){e[e.None=0]="None",e[e.Custom1=16]="Custom1",e[e.Custom2=32]="Custom2",e[e.Custom3=64]="Custom3",e[e.Custom4=128]="Custom4",e[e.Custom5=256]="Custom5",e[e.Custom6=512]="Custom6",e[e.Custom7=1024]="Custom7",e[e.Custom8=2048]="Custom8",e[e.Custom9=4096]="Custom9",e[e.Custom10=8192]="Custom10",e[e.Custom11=16384]="Custom11",e[e.Custom12=32768]="Custom12",e[e.All=65520]="All"}(LR||(LR={}));function Hse(e){return[e.on("before-add",t=>{const i=t.item;if(i==null||e.includes(i))return _t.getLogger("esri.views.interactive.interactiveToolUtils").warn("Tool is either already in the list of tools or tool is `null`. Not adding tool."),void t.preventDefault();i.onAdd()}),e.on("after-remove",t=>{const i=t.item;i.active&&(i.view.activeTool=null),i.destroy()})]}function hI(e){return e.visible&&e.getEditableFlag!=null&&e.getEditableFlag(i_.USER)&&e.getEditableFlag(i_.MANAGER)}function xl(e){return Dn(e.x,e.y)}function N8(e,t){var r;const i=(r=e instanceof HTMLElement?e:e.surface)==null?void 0:r.getBoundingClientRect();return i?Dn(t.clientX-i.left,t.clientY-i.top):Dn(0,0)}function z8(e,t){return t instanceof Event?N8(e,t):xl(t)}function F8(e){if(e instanceof Event)return!0;if(typeof e=="object"&&"type"in e)switch(e.type){case"click":case"double-click":case"pointer-down":case"pointer-drag":case"pointer-enter":case"pointer-leave":case"pointer-up":case"pointer-move":case"immediate-click":case"immediate-double-click":case"hold":case"drag":case"mouse-wheel":return!0;default:return!1}return!1}let Wse=class{constructor(){this._pointerLocations=new Map,this._hoveredManipulators=new Map,this._grabbedManipulators=new Map,this._draggedManipulators=new Map,this._stopDrag=!1,this._revertToNullActiveTool=!1,this._cursor=null}get cursor(){return this._cursor}hasFocusedManipulators(){return this._grabbedManipulators.size>0||this._draggedManipulators.size>0}handleInputEvent(t,i){const r=()=>t.stopPropagation();switch(t.type){case"pointer-move":DR(t.pointerType)&&this._pointerLocations.set(t.pointerId,{x:t.x,y:t.y,pointerType:t.pointerType});break;case"drag":this._grabbedManipulators.size>0&&(this._stopDrag=!0),this._stopDrag&&(r(),t.action==="end"&&(this._stopDrag=!1));break;case"pointer-down":{if(!NR(t))break;const s=xl(t),n=this._intersect(s,t.pointerType,i.forEachTool);if(n==null)break;const c=n.manipulator,o=n.tool;c==null||o==null||!c.interactive||c.grabbable&&c.grabbableForEvent(t)||!c.grabbing||c.dragging||this._releaseManipulatorBeforeDragging(c,t,i),c!=null&&o!=null&&c.interactive&&c.grabbable&&c.grabbableForEvent(t)&&!c.grabbing&&(this._grabbedManipulators.set(t.pointerId,{manipulator:c,tool:o,start:s,pointerType:t.pointerType}),this._grabbedManipulators.size===1&&i.activeTool==null&&(this._revertToNullActiveTool=!0,i.setActiveTool(n.tool)),c.grabbing=!0,c.events.emit("grab-changed",{action:"start",pointerType:t.pointerType,screenPoint:s}),r());break}case"pointer-up":this._draggedManipulators.has(t.pointerId)||this._handlePointerEnd(t,i);break;case"pointer-drag":{if(!NR(t))break;const s=this._grabbedManipulators.get(t.pointerId),n=s==null?void 0:s.manipulator,c=s==null?void 0:s.tool;if(n==null||c==null)break;const o=xl(t);o.x=Ll(o.x,0,i.view.width),o.y=Ll(o.y,0,i.view.height);const f=s.start,g=this._draggedManipulators.get(t.pointerId);switch(t.action){case"start":case"update":t.action!=="update"&&this._grabbedManipulators.size!==1||(n.dragging=!0,g?n.events.emit("drag",{action:"update",start:f,screenPoint:o}):n.events.emit("drag",{action:"start",start:f,screenPoint:o,pointerType:t.pointerType}),this._draggedManipulators.set(t.pointerId,{tool:c,manipulator:n,start:f}));break;case"end":n.dragging=!1,g&&n.events.emit("drag",{action:"end",start:f,screenPoint:o}),this._draggedManipulators.delete(t.pointerId),this._handlePointerEnd(t,i)}r();break}case"immediate-click":{const s=xl(t),n=this._intersect(s,t.pointerType,i.forEachTool);if(Zse(t)||i.forEachTool(g=>{if((n==null||n.tool!==g||g.automaticManipulatorSelection)&&g.manipulators){let S=!1;g.manipulators.forEach(({manipulator:I})=>{I.selected&&(I.selected=!1,S=!0)}),S&&g.onManipulatorSelectionChanged&&g.onManipulatorSelectionChanged()}}),n==null)break;const{manipulator:c,tool:o}=n;if(!c.interactive)break;c.selectable&&o.automaticManipulatorSelection&&(c.selected=!c.selected,o.onManipulatorSelectionChanged&&o.onManipulatorSelectionChanged());const f=t.native.shiftKey;c.events.emit("immediate-click",{screenPoint:s,button:t.button,pointerType:t.pointerType,shiftKey:f,stopPropagation:r}),tT(c,r);break}case"click":{const s=xl(t),n=this._intersect(s,t.pointerType,i.forEachTool),c=n==null?void 0:n.manipulator;if(c==null||!c.interactive)break;const o=t.native.shiftKey;c.events.emit(t.type,{screenPoint:s,button:t.button,pointerType:t.pointerType,shiftKey:o}),r();break}case"double-click":{const s=xl(t),n=this._intersect(s,t.pointerType,i.forEachTool),c=n!=null?n.manipulator:null;if(c==null||!c.interactive)break;const o=t.native.shiftKey;c.events.emit("double-click",{screenPoint:s,button:t.button,pointerType:t.pointerType,shiftKey:o,stopPropagation:r}),tT(c,r);break}case"immediate-double-click":{const s=xl(t),n=this._intersect(s,t.pointerType,i.forEachTool),c=n!=null?n.manipulator:null;if(c==null||!c.interactive)break;const o=t.native.shiftKey;c.events.emit("immediate-double-click",{screenPoint:s,button:t.button,pointerType:t.pointerType,shiftKey:o,stopPropagation:r}),tT(c,r);break}}this._onFocusChange(i.forEachTool)}_releaseManipulatorBeforeDragging(t,i,r){t.grabbing=!1,t.events.emit("grab-changed",{action:"end",pointerType:i.pointerType,screenPoint:xl(i)}),this._grabbedManipulators.forEach(({manipulator:s},n)=>{s===t&&this._grabbedManipulators.delete(n)}),this._afterManipulatorRelease(r.setActiveTool)}_handlePointerEnd(t,i){var s;const r=(s=this._grabbedManipulators.get(t.pointerId))==null?void 0:s.manipulator;r!=null&&r.grabbing&&(r.grabbing=!1,r.events.emit("grab-changed",{action:"end",pointerType:t.pointerType,screenPoint:xl(t)}),this._grabbedManipulators.delete(t.pointerId),this._afterManipulatorRelease(i.setActiveTool))}_cursorFromMap(t){let i=null;return dx(t,({manipulator:r})=>!(r==null||!r.interactive)&&(r.grabbing&&r.grabCursor?(i=r.grabCursor,!0):!!r.cursor&&(i=r.cursor,!0))),i}_onFocusChange(t){this._updateCursor(),this._updateFocusedManipulatorTools(t)}_updateCursor(){this._grabbedManipulators.size>0?this._cursor=this._cursorFromMap(this._grabbedManipulators)||"grabbing":this._hoveredManipulators.size>0?this._cursor=this._cursorFromMap(this._hoveredManipulators)||"pointer":this._cursor=null}_updateFocusedManipulatorTools(t){const i=new Set,r=new Set;this._grabbedManipulators.forEach(({tool:s})=>{i.add(s)}),this._hoveredManipulators.forEach(({tool:s})=>{r.add(s)}),t(s=>{s.hasGrabbedManipulators=i.has(s),s.hasHoveredManipulators=r.has(s);const n=this._grabbedManipulators.values(),c=F7(n,({tool:o})=>o===s);s.firstGrabbedManipulator=c!=null?c.manipulator:null})}clearPointers(t,{forEachTool:i,setActiveTool:r},s=!0,n){const c=(o,f)=>o===t&&(n==null||n===f);this._grabbedManipulators.forEach(({tool:o,manipulator:f,pointerType:g},S)=>{c(o,f)&&(this._grabbedManipulators.delete(S),f.grabbing=!1,f.events.emit("grab-changed",{action:"end",screenPoint:null,pointerType:g}))}),this._draggedManipulators.forEach(({tool:o,manipulator:f},g)=>{c(o,f)&&(this._draggedManipulators.delete(g),f.dragging=!1,f.events.emit("drag",{action:"cancel"}))}),s&&this._hoveredManipulators.forEach(({tool:o,manipulator:f},g)=>{c(o,f)&&(this._hoveredManipulators.delete(g),f.hovering=!1)}),this._afterManipulatorRelease(r),this._onFocusChange(i)}_intersect(t,i,r){let s=null;return r(n=>{if(n.manipulators==null||!hI(n))return!1;const c=n.manipulators.intersect(t,i);return c!=null&&(s={tool:n,manipulator:c},!0)}),s}updateHoveredStateFromKnownPointers(t){this._pointerLocations.forEach((i,r)=>{this._updateHoveredStateForPointerAtScreenPosition(Dn(i.x,i.y),r,i.pointerType,t)})}handleHoverEvent(t,i){t.type!=="pointer-up"&&t.type!=="immediate-click"&&t.type!=="pointer-move"||!DR(t.pointerType)||this._updateHoveredStateForPointerAtScreenPosition(xl(t),t.pointerId,t.pointerType,i)}_updateHoveredStateForPointerAtScreenPosition(t,i,r,s){var o;let n=this._intersect(t,r,s);const c=(o=this._hoveredManipulators.get(i))==null?void 0:o.manipulator;n==null||n.manipulator.interactive||(n=null),n!=null&&c===n.manipulator||(c!=null&&(c.hovering=!1),n!=null?(n.manipulator.hovering=!0,this._hoveredManipulators.set(i,n)):this._hoveredManipulators.delete(i),this._onFocusChange(s))}_afterManipulatorRelease(t){this._grabbedManipulators.size===0&&this._revertToNullActiveTool&&(t(null),this._revertToNullActiveTool=!1)}};function DR(e){return e==="mouse"}function NR(e){return e.pointerType!=="mouse"||e.button===0}function Zse(e){return!!e.native.shiftKey}function tT(e,t){e!=null&&e.consumesClicks&&t()}const zR="attached",iT="tools",FR=1e3;let Sl=class extends Nt{constructor(t){super(t),this._updatingHandles=new cp,this._clock=Vm,this._manipulatorState=new Wse,this.tools=new Bt,this.cursor=null,this._interacting=!1,this._interactingTimeout=FR,this._interactingTimeoutHandle=null,this._forEachTool=i=>{for(const r of this.tools.items)if(i(r))return}}initialize(){this.addHandles([this.view.on(O8,t=>{this._handleInputEvent(t)},uh.TOOL),...Hse(this.tools),this.tools.on("before-add",({item:t})=>{this._updateToolEditableFlag(t)}),this.tools.on("before-remove",({item:t})=>{this._manipulatorState.clearPointers(t,this._manipulatorStateEventArgs),this._updateCursor()}),this.tools.on("change",()=>{this._refreshToolWatchers()})])}destroy(){this.activeTool=null,this.tools.drain(t=>t.destroy()),this._clearInteractingTimeout(),this._interacting=!1,this._updatingHandles.destroy()}get _manipulatorStateEventArgs(){return{forEachTool:this._forEachTool,activeTool:this.activeTool,setActiveTool:t=>{this.activeTool=t},view:this.view}}set activeTool(t){if(t!=null&&!this.view.ready)return void _t.getLogger(this).error("Cannot set active tool while view is not ready.");if(t===this.activeTool)return;const i=this.activeTool;this._set("activeTool",t),i!=null&&i.deactivate(),t!=null&&t.activate(),this._removeIncompleteTools(t);for(const r of this.tools){this._updateToolEditableFlag(r);const s=hI(r);this.activeTool!=null&&s||this._manipulatorState.clearPointers(r,this._manipulatorStateEventArgs,!s)}this._updateCursor()}get updating(){return this._updatingHandles.updating||this.tools.some(t=>t.updating)}get interacting(){return this._interacting}_clearInteractingTimeout(){this._interactingTimeoutHandle=Sr(this._interactingTimeoutHandle)}_startInteractingTimeout(){this._clearInteractingTimeout(),this._interactingTimeoutHandle=this._clock.setTimeout(()=>this._interacting=!1,this._interactingTimeout)}attach(){var t;this.view.type==="3d"?this.addHandles([ti(()=>{const{state:i}=this.view;return"camera"in i&&i.camera},()=>this._forEachManipulator(i=>i.onViewChange())),(t=this.view.elevationProvider)==null?void 0:t.on("elevation-change",i=>this._forEachManipulator(r=>r.onElevationChange(i)))],zR):this.addHandles(ti(()=>this.view.extent,()=>this._forEachManipulator(i=>i.onViewChange())))}detach(){this.activeTool=null,this.tools.removeAll(),this.removeHandles(zR),this._clearInteractingTimeout(),this._interacting=!1}_forEachManipulator(t){this._forEachTool(i=>{i.manipulators&&i.manipulators.forEach(({manipulator:r})=>t(r,i))})}_handleInputEvent(t){let i=!1;const r={...t,stopPropagation:()=>{i=!0,t.stopPropagation()}};this.activeTool!=null?this.activeTool.handleInputEvent&&this.activeTool.handleInputEvent(r):this._forEachTool(s=>{!i&&s.visible&&s.handleInputEvent(r)}),!i&&t.type==="key-down"&&t.key==="Escape"&&this.activeTool&&(t.stopPropagation(),this.activeTool=null),this._manipulatorState.handleInputEvent(r,this._manipulatorStateEventArgs),i||this.activeTool==null||this.activeTool.handleInputEventAfter(r),this._manipulatorState.handleHoverEvent(r,this._forEachTool),this._updateCursor(),t.type==="pointer-move"&&(this._manipulatorState.hasFocusedManipulators()||this.activeTool)&&(this._interacting=!0,this._startInteractingTimeout())}_refreshToolWatchers(){this.removeHandles(iT),this._forEachTool(t=>{if(t instanceof Nt){const i=ti(()=>[t.cursor,t.visible,t.editable],()=>{hI(t)||this._manipulatorState.clearPointers(t,this._manipulatorStateEventArgs),this._updateCursor()});this.addHandles(i,iT)}t.manipulators&&this.addHandles([t.manipulators.on("after-remove",i=>{this._manipulatorState.clearPointers(t,this._manipulatorStateEventArgs,!0,i.item.manipulator)}),t.manipulators.on("change",()=>{this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()})],iT)}),this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()}_updateToolEditableFlag(t){var i;(i=t.setEditableFlag)==null||i.call(t,i_.MANAGER,this.activeTool==null||t===this.activeTool)}_updateCursor(){let t=this._manipulatorState.cursor;t==null&&this._forEachTool(i=>!(i.cursor==null||!i.visible)&&(t=i.cursor,!0)),this._get("cursor")!==t&&this._set("cursor",t)}_removeIncompleteTools(t){this.tools.filter(i=>(t==null||i!==t)&&!i.created&&i.removeIncompleteOnCancel).forEach(i=>{this.tools.remove(i)})}get test(){const t=this;return{setClock:i=>this._clock=i,set interactingTimeoutEnabled(i){t._interactingTimeout=i?FR:0},get interactingTimeoutEnabled(){return t._interactingTimeout!==0}}}};v([M({constructOnly:!0,nonNullable:!0})],Sl.prototype,"view",void 0),v([M({value:null})],Sl.prototype,"activeTool",null),v([M({readOnly:!0,type:Bt})],Sl.prototype,"tools",void 0),v([M({readOnly:!0})],Sl.prototype,"cursor",void 0),v([M({readOnly:!0})],Sl.prototype,"updating",null),v([M()],Sl.prototype,"_interacting",void 0),v([M({readOnly:!0})],Sl.prototype,"interacting",null),Sl=v([fe("esri.views.ToolViewManager")],Sl);let Hf=class extends Nt{constructor(t){super(),this.nativeIndex=null,this._detectedDeviceType="unknown",t.mapping==="standard"?this._detectedDeviceType="standard":Yse.test(t.id)?this._detectedDeviceType="spacemouse":this._detectedDeviceType="unknown",this.nativeIndex=t.index}get native(){const t=navigator.getGamepads?navigator.getGamepads():[];return this.nativeIndex!=null&&this.nativeIndeximport("./geometryServiceUtils-CZ5hQKF0.js"),__vite__mapDeps([162,163])).then(t=>dI=t)),await rT,mr(e)}async function Y8(e,t,i,r){if(!e)return null;const s=e.spatialReference;return Ah()||Nl(s,t)?Ph(e,t):dI?dI.projectGeometry(e,t,i,r):(await Promise.race([ane(r),bh(r)]),Y8(e,t,i,r))}let qi=class extends Nt{constructor(t){super(t),this.required={tileInfo:!1,heightModelInfo:!1,extent:!1},this.defaultSpatialReference=null,this.userSpatialReference=null,this.sourcePreloadCount=10,this.priorityCollection=null,this.requiresExtentInSpatialReference=!0,this.suspended=!1,this._projectExtentTask={task:null,input:null,output:null,spatialReference:null}}destroy(){this._projectExtentTask.task&&(this._projectExtentTask.task=z0(this._projectExtentTask.task)),this._set("map",null)}get ready(){return!this._spatialReferenceTask.updating&&!this._tileInfoTask.updating&&!this._extentTask.updating}get heightModelInfoReady(){return!this._heightModelInfoTask.updating}get spatialReference(){return this.userSpatialReference!=null?this.userSpatialReference:this._spatialReferenceTask.spatialReference}get extent(){return this._extentTask.extent}get heightModelInfo(){return this._heightModelInfoTask.heightModelInfo}get vcsWkid(){return this._heightModelInfoTask.vcsWkid}get latestVcsWkid(){return this._heightModelInfoTask.latestVcsWkid}get viewingMode(){return this.userSpatialReference==null||this.userSpatialReference.equals(this._spatialReferenceTask.spatialReference)?this._spatialReferenceTask.viewingMode:null}get tileInfo(){return this._tileInfoTask.tileInfo}get mapCollections(){var r,s,n,c;const t=(r=this.map)==null?void 0:r.call(this),i=[];return this.priorityCollection!=null&&i.push(this.priorityCollection),i.push({parent:t==null?void 0:t.basemap,layers:(s=t==null?void 0:t.basemap)==null?void 0:s.baseLayers},{layers:t==null?void 0:t.layers},{parent:t==null?void 0:t.ground,layers:(n=t==null?void 0:t.ground)==null?void 0:n.layers},{parent:t==null?void 0:t.basemap,layers:(c=t==null?void 0:t.basemap)==null?void 0:c.referenceLayers}),i}get _allLayers(){return this._collectLayers(this.mapCollections)}get _spatialReferenceTask(){if(this.suspended)return this._get("_spatialReferenceTask")??{updating:!1};const{layers:t,updating:i}=this._allLayers;let r=null;for(const n of t){const c=this._getSupportedSpatialReferences(n);if(c.length>0){const o=this._narrowDownSpatialReferenceCandidates(r,c);o!=null&&(r=o)}if(r!=null&&r.length===1)break}if(i&&(r==null||r.length!==1))return{updating:!0};const s=this._pickSpatialReferenceCandidate(r);return{spatialReference:s!=null?s.spatialReference:null,viewingMode:s!=null?s.viewingMode:null,updating:!1}}get _tileInfoTask(){var r,s,n,c,o,f,g;if(!this.required.tileInfo)return this._get("_tileInfoTask")??{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const{layers:t,updating:i}=this._collectLayers([{parent:(s=(r=this.map)==null?void 0:r.call(this))==null?void 0:s.basemap,layers:(o=(c=(n=this.map)==null?void 0:n.call(this))==null?void 0:c.basemap)==null?void 0:o.baseLayers},{layers:(g=(f=this.map)==null?void 0:f.call(this))==null?void 0:g.layers}]);if(t&&t.length>0&&"tileInfo"in t[0]){const S=t[0].tileInfo;return{tileInfo:S&&S.spatialReference.equals(this.spatialReference)?S:null,updating:!1}}return{updating:i}}get _heightModelInfoTask(){var r,s,n;if(!this.required.heightModelInfo||this.suspended&&((r=this._get("_heightModelInfoTask"))!=null&&r.heightModelInfo))return this._get("_heightModelInfoTask")??{updating:!1};const{layers:t,updating:i}=this._allLayers;for(const c of t)if(nne(c)){const o=rne(c);if(o)return{heightModelInfo:o,vcsWkid:(s=c.spatialReference)==null?void 0:s.vcsWkid,latestVcsWkid:(n=c.spatialReference)==null?void 0:n.latestVcsWkid,updating:!1}}return{updating:i}}get _extentCandidatesTask(){if(this.suspended||!this.required.extent)return this._get("_extentCandidatesTask")??{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const t=this._allLayers,i=t.updating,r=[];for(const s of t.layers){const n="fullExtents"in s&&s.fullExtents||(s.fullExtent!=null?[s.fullExtent]:[]),c=this.requiresExtentInSpatialReference?null:n[0],o=n.find(f=>f.spatialReference.equals(this.spatialReference))??c;if(o)return{candidates:[{extent:o,layer:s}],updating:!1};if(this._getSupportedSpatialReferences(s).length>0)for(const f of n)r.push({extent:f,layer:s})}return{candidates:r,updating:i}}get _extentTask(){const{candidates:t,updating:i}=this._extentCandidatesTask;if(i)return{updating:i};if(t==null||t.length===0)return{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const r=this._pickExtentCandidate(t),s=this.spatialReference;return r.extent.equals(this._projectExtentTask.input)&&s.equals(this._projectExtentTask.spatialReference)?{extent:this._projectExtentTask.output,updating:this._projectExtentTask.task!=null&&!this._projectExtentTask.task.finished}:(this._projectExtentTask.task!=null&&(this._projectExtentTask.task=z0(this._projectExtentTask.task)),this._projectExtentTask={input:r.extent.clone(),output:null,spatialReference:s.clone(),task:_x(async n=>{try{const c=await Y8(r.extent,s,"portalItem"in r.layer?r.layer.portalItem:void 0,n);this._projectExtentTask={...this._projectExtentTask,task:null,output:c}}catch{if(ra(n))return;this._projectExtentTask={...this._projectExtentTask,task:null}}})},{updating:!0})}_narrowDownSpatialReferenceCandidates(t,i){if(t==null)return i;const r=[],s=(n,c)=>n!=null?c!=null?n===c&&n:n:c;for(const n of t)for(const c of i){if(!n.spatialReference.equals(c.spatialReference))continue;const o=s(n.viewingMode,c.viewingMode);if(o!==!1){r.push({spatialReference:n.spatialReference,viewingMode:o});break}}return r.length>0?r:null}_pickSpatialReferenceCandidate(t){const i=this.defaultSpatialReference;return t==null||t.length<1?i!=null?{spatialReference:i,viewingMode:null}:null:(i!=null&&t.length>1&&t.some(({spatialReference:r})=>r.equals(i))&&(t=t.filter(({spatialReference:r})=>r.equals(i))),t.length>1&&t.some(({viewingMode:r})=>r!==Bw.Local)&&(t=t.filter(({viewingMode:r})=>r!==Bw.Local)),t[0])}_getSupportedSpatialReferences(t){const i="supportedSpatialReferences"in t&&t.supportedSpatialReferences||(t.spatialReference?[t.spatialReference]:[]);if(i.length===0)return[];const r=[];for(const s of i){const n=this.getSpatialReferenceSupport({spatialReference:s,layer:t});if(n!=null){const c=n.constraints!=null?n.constraints:[{spatialReference:s,viewingMode:null}];for(const{spatialReference:o,viewingMode:f}of c)this.requiresExtentInSpatialReference&&this.userSpatialReference!=null&&!o.equals(this.userSpatialReference)||r.push({spatialReference:o,viewingMode:f})}}return r}_pickExtentCandidate(t){const i=this.spatialReference;return t.find(({extent:r})=>i.equals(r.spatialReference))||t[0]}_collectLayers(t){var r;if(this._loadMaybe((r=this.map)==null?void 0:r.call(this))!=="loaded")return{layers:[],updating:!0};const i=new lne;for(const s of t)if(this._collectCollection(s,i),i.preloading===this.sourcePreloadCount)break;return{layers:i.layers,updating:i.updating}}_collectCollection(t,i){if(t.layers){switch(this._loadMaybe(t.parent)){case"loading":return i.updating=!0,void++i.preloading;case"failed":return}for(const r of t.layers){switch(this._loadMaybe(r)){case"failed":continue;case"loading":i.updating=!0,++i.preloading;break;case"loaded":i.updating||i.layers.push(r),"layers"in r&&this._collectCollection({layers:r.layers},i)}if(i.preloading===this.sourcePreloadCount)break}}}_loadMaybe(t){return t&&"loadStatus"in t&&t.loadStatus!=null?t.loadStatus==="not-loaded"?(t.load().catch(i=>{Ys(i)||console.log(i)}),"loading"):t.loadStatus:"loaded"}};v([M()],qi.prototype,"required",void 0),v([M({constructOnly:!0})],qi.prototype,"map",void 0),v([M({constructOnly:!0})],qi.prototype,"getSpatialReferenceSupport",void 0),v([M()],qi.prototype,"defaultSpatialReference",void 0),v([M()],qi.prototype,"userSpatialReference",void 0),v([M()],qi.prototype,"sourcePreloadCount",void 0),v([M()],qi.prototype,"priorityCollection",void 0),v([M()],qi.prototype,"requiresExtentInSpatialReference",void 0),v([M()],qi.prototype,"suspended",void 0),v([M({readOnly:!0})],qi.prototype,"ready",null),v([M({readOnly:!0})],qi.prototype,"heightModelInfoReady",null),v([M({readOnly:!0})],qi.prototype,"spatialReference",null),v([M({readOnly:!0})],qi.prototype,"extent",null),v([M({readOnly:!0})],qi.prototype,"heightModelInfo",null),v([M({readOnly:!0})],qi.prototype,"vcsWkid",null),v([M({readOnly:!0})],qi.prototype,"latestVcsWkid",null),v([M({readOnly:!0})],qi.prototype,"viewingMode",null),v([M({readOnly:!0})],qi.prototype,"tileInfo",null),v([M({readOnly:!0})],qi.prototype,"mapCollections",null),v([M({readOnly:!0})],qi.prototype,"_allLayers",null),v([M({readOnly:!0})],qi.prototype,"_spatialReferenceTask",null),v([M({readOnly:!0})],qi.prototype,"_tileInfoTask",null),v([M({readOnly:!0})],qi.prototype,"_heightModelInfoTask",null),v([M({readOnly:!0})],qi.prototype,"_extentCandidatesTask",null),v([M()],qi.prototype,"_extentTask",null),v([M()],qi.prototype,"_projectExtentTask",void 0),qi=v([fe("esri.views.support.DefaultsFromMap")],qi);let lne=class{constructor(){this.layers=new Array,this.preloading=-1,this.updating=!1}};var r0;let Pt=r0=class extends Sh.EventedMixin(bA(Nt)){constructor(e){super(e),this._userSpatialReference=null,this._cursor=null,this.handles=new eA,this.updatingHandles=new cp,this.allLayerViews=new W0({getCollections:()=>{var t,i,r;return[(t=this.basemapView)==null?void 0:t.baseLayerViews,(i=this.groundView)==null?void 0:i.layerViews,this.layerViews,(r=this.basemapView)==null?void 0:r.referenceLayerViews]},getChildrenFunction:une}),this.groundView=null,this.basemapView=null,this.fatalError=null,this.graphics=new $0,this.analyses=new kw,this.typeSpecificPreconditionsReady=!0,this.layerViews=new Bt,this.magnifier=new P8,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this.spatialReferenceWarningDelay=1e3,this.supportsGround=!0,this.timeExtent=null,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this.input=new Xse,this.navigation=new U8,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new Gse(this),this.persistableViewModels=new Bt,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this.theme=null,this.handles.add(ti(()=>this.preconditionsReady,t=>{var r,s;const i=this.ready;if(t?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,r0.views.add(this)):(this._lockedSpatialReference=null,r0.views.remove(this)),this.notifyChange("spatialReference"),!t&&i)(r=this.toolViewManager)==null||r.detach(),this.analysisViewManager!=null&&this.analysisViewManager.detach(),(s=this.layerViewManager)==null||s.clear(),this._teardown();else if(t&&!i){try{this._startup()}catch(n){return void queueMicrotask(()=>{console.error("View._startup failed",n),this.fatalError=new Je("startup-error",null,n)})}this.analysisViewManager!=null&&this.analysisViewManager.attach(),this.toolViewManager.attach()}},Tp))}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then(()=>(this._isValid=!0,$x(()=>this.ready)))),this.basemapView=new Bu({view:this}),this.layerViewManager=new Mse({view:this,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},supportsGround:this.supportsGround}),this.toolViewManager=new Sl({view:this}),this._setupSpatialReferenceLogger(),this.selectionManager=new jse({view:this}),this.addHandles([ti(()=>this.initialExtentRequired,e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e},Fa),ti(()=>this.ready,e=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=e,this.defaultsFromMap.userSpatialReference=e?this.spatialReference:this._userSpatialReference)},Tp),ti(()=>this._userSpatialReference,e=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=e)},Fa)])}_setupSpatialReferenceLogger(){let e=null;this.addHandles([ti(()=>{var t;return(t=this.defaultsFromMap)==null?void 0:t.ready},t=>{var r;const i=((r=this.map)==null?void 0:r.allLayers.length)>0;if(t&&!this.spatialReference&&i){if(e!=null)return;const s=er(()=>e=z0(e));e=_x(async n=>{try{await t4(this.spatialReferenceWarningDelay,null,n)}catch{return}finally{e=null}_t.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}),this.addHandles(s,"spatial-reference-logger-task")}else this.removeHandles("spatial-reference-logger-task")},{sync:!0})])}destroy(){var e,t;this.destroyed||(r0.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=lr(this.graphics),this.analyses=lr(this.analyses),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),lr(this.analysisViewManager),this.toolViewManager=lr(this.toolViewManager),this.layerViewManager=lr(this.layerViewManager),this.selectionManager=lr(this.selectionManager),this.basemapView=lr(this.basemapView),(e=this.groundView)==null||e.destroy(),(t=this.layerViews)==null||t.forEach(i=>i.destroy()),this.layerViews.length=0,this.invalidate(),this._emitter.clear(),this.handles.destroy(),this.map=lr(this.map),this.updatingHandles.destroy())}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return _t.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){var e;return(e=this.toolViewManager)==null?void 0:e.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get animation(){return this._get("animation")}set animation(e){this._set("animation",e)}get center(){return null}get _defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new qi({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:e=>this.getSpatialReferenceSupport(e),...this._defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(e){this._set("extent",e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){var e;return!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||dh.isLoadable(this.map)&&!this.map.loaded||this.width===0||this.height===0||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._lockedSpatialReference&&!((e=this.defaultsFromMap)!=null&&e.ready)||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){e!==this._get("map")&&(e!=null&&e.destroyed&&(_t.getLogger(this).warn("#map","The provided map is already destroyed",{map:e}),e=null),dh.isLoadable(e)&&e.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",e))}get spatialReference(){var t,i;const e=this._userSpatialReference||this._lockedSpatialReference||this.getDefaultSpatialReference()||null;if(e&&((i=(t=this.defaultsFromMap)==null?void 0:t.required)!=null&&i.heightModelInfo)){const r=e.clone();return r.vcsWkid=this.defaultsFromMap.vcsWkid,r.latestVcsWkid=this.defaultsFromMap.latestVcsWkid,r}return e}set spatialReference(e){const t=!Js(e,this._get("spatialReference"));this._set("_userSpatialReference",e),t&&(this._set("spatialReference",e),this._spatialReferenceChanged(e))}_spatialReferenceChanged(e){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??Dl}set timeZone(e){const t=new Set(["etc/utc","etc/gmt","gmt"]),i=new Set(Intl.supportedValuesOf("timeZone").map(r=>r.toLowerCase()));this._userTimeZone=e,e===Dl||e===o3||t.has(e.toLowerCase())||i.has(e.toLowerCase())||_t.getLogger(this).warn("#timeZone",`the parsed value '${e}' may not be a valid IANA time zone`)}get tools(){var e;return(e=this.toolViewManager)==null?void 0:e.tools}get initialExtent(){var e;return(e=this.defaultsFromMap)==null?void 0:e.extent}get cursor(){var e;return((e=this.toolViewManager)==null?void 0:e.cursor)??this._cursor??"default"}set cursor(e){this._cursor=e,this.notifyChange("cursor")}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new uI}whenLayerView(e){var t;return((t=this.layerViewManager)==null?void 0:t.whenLayerView(e))??Promise.reject()}getDefaultSpatialReference(){var e;return(e=this.defaultsFromMap)==null?void 0:e.spatialReference}getDefaultHeightModelInfo(){var e;return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??((e=this.defaultsFromMap)==null?void 0:e.heightModelInfo)??null}getDefaultTimeZone(){return null}importLayerView(e){throw new Je("importLayerView() not implemented")}hasLayerViewModule(e){return!1}async validate(){}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return this.getSpatialReferenceSupport({spatialReference:e})!=null}when(e,t){return this.isResolved()&&!this.ready&&_t.getLogger(this).warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(e,t)}forceReadyCycle(){this.ready&&(gh(()=>this.destroyed||this.preconditionsReady===!1,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}};Pt.views=new Bt,v([M()],Pt.prototype,"_userSpatialReference",void 0),v([M()],Pt.prototype,"activeTool",null),v([M({readOnly:!0})],Pt.prototype,"allLayerViews",void 0),v([M()],Pt.prototype,"groundView",void 0),v([M()],Pt.prototype,"animation",null),v([M()],Pt.prototype,"basemapView",void 0),v([M()],Pt.prototype,"center",null),v([M({readOnly:!0})],Pt.prototype,"_defaultsFromMapSettings",null),v([M()],Pt.prototype,"defaultsFromMap",null),v([M()],Pt.prototype,"fatalError",void 0),v([M({type:Ui})],Pt.prototype,"extent",null),v([M(mR($0,"graphics"))],Pt.prototype,"graphics",void 0),v([M(mR(kw,"analyses"))],Pt.prototype,"analyses",void 0),v([M({readOnly:!0,type:g3})],Pt.prototype,"heightModelInfo",null),v([M({readOnly:!0})],Pt.prototype,"interacting",null),v([M({readOnly:!0})],Pt.prototype,"navigating",null),v([M({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_lockedSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],Pt.prototype,"preconditionsReady",null),v([M({readOnly:!0})],Pt.prototype,"typeSpecificPreconditionsReady",void 0),v([M({type:Bt,readOnly:!0})],Pt.prototype,"layerViews",void 0),v([M()],Pt.prototype,"resolution",null),v([M({type:P8})],Pt.prototype,"magnifier",void 0),v([M({value:null,type:C6})],Pt.prototype,"map",null),v([M()],Pt.prototype,"padding",void 0),v([M({readOnly:!0})],Pt.prototype,"ready",void 0),v([M({type:yi})],Pt.prototype,"spatialReference",null),v([M()],Pt.prototype,"spatialReferenceWarningDelay",void 0),v([M()],Pt.prototype,"stationary",null),v([M({readOnly:!0})],Pt.prototype,"supportsGround",void 0),v([M({type:E_})],Pt.prototype,"timeExtent",void 0),v([M({type:String,nonNullable:!0})],Pt.prototype,"timeZone",null),v([M()],Pt.prototype,"tools",null),v([M()],Pt.prototype,"toolViewManager",void 0),v([M({readOnly:!0})],Pt.prototype,"type",void 0),v([M({type:Number})],Pt.prototype,"scale",void 0),v([M({readOnly:!0})],Pt.prototype,"updating",void 0),v([M({readOnly:!0})],Pt.prototype,"initialExtentRequired",void 0),v([M({readOnly:!0})],Pt.prototype,"initialExtent",null),v([M()],Pt.prototype,"cursor",null),v([M({readOnly:!0})],Pt.prototype,"input",void 0),v([M({type:U8,nonNullable:!0})],Pt.prototype,"navigation",void 0),v([M()],Pt.prototype,"layerViewManager",void 0),v([M()],Pt.prototype,"analysisViewManager",void 0),v([M()],Pt.prototype,"selectionManager",void 0),v([M()],Pt.prototype,"width",void 0),v([M()],Pt.prototype,"height",void 0),v([M({readOnly:!0})],Pt.prototype,"resizing",void 0),v([M({value:null,readOnly:!0})],Pt.prototype,"size",null),v([M({readOnly:!0})],Pt.prototype,"suspended",void 0),v([M({readOnly:!0})],Pt.prototype,"viewEvents",void 0),v([M({readOnly:!0})],Pt.prototype,"persistableViewModels",void 0),v([M()],Pt.prototype,"_isValid",void 0),v([M()],Pt.prototype,"_readyCycleForced",void 0),v([M()],Pt.prototype,"_lockedSpatialReference",void 0),v([M()],Pt.prototype,"_userTimeZone",void 0),v([M()],Pt.prototype,"_lockedTimeZone",void 0),v([M({type:uI})],Pt.prototype,"theme",void 0),v([M({readOnly:!0,type:uI})],Pt.prototype,"effectiveTheme",null),Pt=r0=v([fe("esri.views.View")],Pt);const cne=Pt;function une(e){return e.layerViews}let ju=class extends cw{constructor(t){super(t),this.state="running",this.target=null,this._resolver=null}initialize(){this._resolver=sa(),this.addResolvingPromise(this._resolver.promise)}get done(){return this.state==="finished"||this.state==="stopped"}stop(){var t;this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","stopped"),(t=this._resolver)==null||t.reject(new Je("ViewAnimation stopped")))}finish(){var t;this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","finished"),(t=this._resolver)==null||t.resolve())}update(t,i){i||(i=xh(t)?"waiting-for-target":"running"),this._set("target",t),this._set("state",i)}};v([M({readOnly:!0})],ju.prototype,"done",null),v([M({readOnly:!0,type:String})],ju.prototype,"state",void 0),v([M()],ju.prototype,"target",void 0),ju=v([fe("esri.views.ViewAnimation")],ju),function(e){e.State={RUNNING:"running",STOPPED:"stopped",FINISHED:"finished",WAITING_FOR_TARGET:"waiting-for-target"}}(ju||(ju={}));const pI=ju;function rh(e,t,i,r){const s=3*e,n=3*(i-e)-s,c=1-s-n,o=3*t,f=3*(r-t)-o,g=1-o-f;function S(z){return((c*z+n)*z+s)*z}function I(z){return((g*z+f)*z+o)*z}function A(z){return(3*c*z+2*n)*z+s}function O(z,V){let H,Q,ve,me,ge,Ie;for(ve=z,Ie=0;Ie<8;Ie++){if(me=S(ve)-z,Math.abs(me)Q)return Q;for(;Hme?H=ve:Q=ve,ve=.5*(Q-H)+H}return ve}return function(z,V=1e-6){return I(O(z,V))}}const hne=/^cubic-bezier\((.*)\)/,Yo={};function dne(e){let t=Yo[e]||null;if(!t){const i=hne.exec(e);if(i){const r=i[1].split(",").map(s=>parseFloat(s.trim()));r.length!==4||r.some(s=>isNaN(s))||(t=rh.apply(rh,r))}}return t}Yo.ease=rh(.25,.1,.25,1),Yo.linear=rh(0,0,1,1),Yo.easeIn=Yo["ease-in"]=rh(.42,0,1,1),Yo.easeOut=Yo["ease-out"]=rh(0,0,.58,1),Yo.easeInOut=Yo["ease-in-out"]=rh(.42,0,.58,1);function pne(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function fne(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function mne(e,t,i,r,s,n,c){return e[0]=t,e[1]=i,e[2]=r,e[3]=s,e[4]=n,e[5]=c,e}function U3(e,t){const i=t[0],r=t[1],s=t[2],n=t[3],c=t[4],o=t[5];let f=i*n-r*s;return f?(f=1/f,e[0]=n*f,e[1]=-r*f,e[2]=-s*f,e[3]=i*f,e[4]=(s*o-n*c)*f,e[5]=(r*c-i*o)*f,e):null}function yne(e){return e[0]*e[3]-e[1]*e[2]}function J8(e,t,i){const r=t[0],s=t[1],n=t[2],c=t[3],o=t[4],f=t[5],g=i[0],S=i[1],I=i[2],A=i[3],O=i[4],z=i[5];return e[0]=r*g+n*S,e[1]=s*g+c*S,e[2]=r*I+n*A,e[3]=s*I+c*A,e[4]=r*O+n*z+o,e[5]=s*O+c*z+f,e}function Xx(e,t,i){const r=t[0],s=t[1],n=t[2],c=t[3],o=t[4],f=t[5],g=Math.sin(i),S=Math.cos(i);return e[0]=r*S+n*g,e[1]=s*S+c*g,e[2]=r*-g+n*S,e[3]=s*-g+c*S,e[4]=o,e[5]=f,e}function j3(e,t,i){const r=t[0],s=t[1],n=t[2],c=t[3],o=t[4],f=t[5],g=i[0],S=i[1];return e[0]=r*g,e[1]=s*g,e[2]=n*S,e[3]=c*S,e[4]=o,e[5]=f,e}function r_(e,t,i){const r=t[0],s=t[1],n=t[2],c=t[3],o=t[4],f=t[5],g=i[0],S=i[1];return e[0]=r,e[1]=s,e[2]=n,e[3]=c,e[4]=r*g+n*S+o,e[5]=s*g+c*S+f,e}function K8(e,t){const i=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=i,e[2]=-i,e[3]=r,e[4]=0,e[5]=0,e}function X8(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}function V3(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}function gne(e){return"mat2d("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+")"}function _ne(e){return Math.sqrt(e[0]**2+e[1]**2+e[2]**2+e[3]**2+e[4]**2+e[5]**2+1)}function vne(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e[4]=t[4]+i[4],e[5]=t[5]+i[5],e}function Q8(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e[3]=t[3]-i[3],e[4]=t[4]-i[4],e[5]=t[5]-i[5],e}function bne(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*i,e[5]=t[5]*i,e}function wne(e,t,i,r){return e[0]=t[0]+i[0]*r,e[1]=t[1]+i[1]*r,e[2]=t[2]+i[2]*r,e[3]=t[3]+i[3]*r,e[4]=t[4]+i[4]*r,e[5]=t[5]+i[5]*r,e}function xne(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}function Sne(e,t){const i=e[0],r=e[1],s=e[2],n=e[3],c=e[4],o=e[5],f=t[0],g=t[1],S=t[2],I=t[3],A=t[4],O=t[5],z=aa();return Math.abs(i-f)<=z*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(r-g)<=z*Math.max(1,Math.abs(r),Math.abs(g))&&Math.abs(s-S)<=z*Math.max(1,Math.abs(s),Math.abs(S))&&Math.abs(n-I)<=z*Math.max(1,Math.abs(n),Math.abs(I))&&Math.abs(c-A)<=z*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(o-O)<=z*Math.max(1,Math.abs(o),Math.abs(O))}const Tne=J8,Ene=Q8;Object.freeze(Object.defineProperty({__proto__:null,add:vne,copy:pne,determinant:yne,equals:Sne,exactEquals:xne,frob:_ne,fromRotation:K8,fromScaling:X8,fromTranslation:V3,identity:fne,invert:U3,mul:Tne,multiply:J8,multiplyScalar:bne,multiplyScalarAndAdd:wne,rotate:Xx,scale:j3,set:mne,str:gne,sub:Ene,subtract:Q8,translate:r_},Symbol.toStringTag,{value:"Module"}));function zc(){return[1,0,0,1,0,0]}function Mne(e){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function Ine(e,t,i,r,s,n){return[e,t,i,r,s,n]}function Ane(e,t){return new Float64Array(e,t,6)}const Pne=zc();Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:Pne,clone:Mne,create:zc,createView:Ane,fromValues:Ine},Symbol.toStringTag,{value:"Module"}));function s_(e,t){return e[0]=t[0],e[1]=t[1],e}function Cs(e,t,i){return e[0]=t,e[1]=i,e}function eB(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e}function n_(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e}function tB(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e}function iB(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e}function Cne(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}function $ne(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}function kne(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e}function Rne(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e}function One(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}function P_(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e}function Lne(e,t,i,r){return e[0]=t[0]+i[0]*r,e[1]=t[1]+i[1]*r,e}function Qx(e,t){const i=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(i*i+r*r)}function Uw(e,t){const i=t[0]-e[0],r=t[1]-e[1];return i*i+r*r}function jw(e){const t=e[0],i=e[1];return Math.sqrt(t*t+i*i)}function rB(e){const t=e[0],i=e[1];return t*t+i*i}function sB(e,t){return e[0]=-t[0],e[1]=-t[1],e}function Dne(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}function fI(e,t){const i=t[0],r=t[1];let s=i*i+r*r;return s>0&&(s=1/Math.sqrt(s),e[0]=t[0]*s,e[1]=t[1]*s),e}function nB(e,t){return e[0]*t[0]+e[1]*t[1]}function oB(e,t,i){const r=t[0]*i[1]-t[1]*i[0];return e[0]=e[1]=0,e[2]=r,e}function Nne(e,t,i,r){const s=t[0],n=t[1];return e[0]=s+r*(i[0]-s),e[1]=n+r*(i[1]-n),e}function zne(e,t){t=t||1;const i=2*Mx()*Math.PI;return e[0]=Math.cos(i)*t,e[1]=Math.sin(i)*t,e}function Fne(e,t,i){const r=t[0],s=t[1];return e[0]=i[0]*r+i[2]*s,e[1]=i[1]*r+i[3]*s,e}function La(e,t,i){const r=t[0],s=t[1];return e[0]=i[0]*r+i[2]*s+i[4],e[1]=i[1]*r+i[3]*s+i[5],e}function Bne(e,t,i){const r=t[0],s=t[1];return e[0]=i[0]*r+i[3]*s+i[6],e[1]=i[1]*r+i[4]*s+i[7],e}function Une(e,t,i){const r=t[0],s=t[1];return e[0]=i[0]*r+i[4]*s+i[12],e[1]=i[1]*r+i[5]*s+i[13],e}function jne(e,t,i,r){const s=t[0]-i[0],n=t[1]-i[1],c=Math.sin(r),o=Math.cos(r);return e[0]=s*o-n*c+i[0],e[1]=s*c+n*o+i[1],e}function Vne(e,t){const i=e[0],r=e[1],s=t[0],n=t[1];let c=i*i+r*r;c>0&&(c=1/Math.sqrt(c));let o=s*s+n*n;o>0&&(o=1/Math.sqrt(o));const f=(i*s+r*n)*c*o;return f>1?0:f<-1?Math.PI:Math.acos(f)}function Gne(e){return"vec2("+e[0]+", "+e[1]+")"}function qne(e,t){return e[0]===t[0]&&e[1]===t[1]}function Hne(e,t){const i=e[0],r=e[1],s=t[0],n=t[1],c=aa();return Math.abs(i-s)<=c*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(r-n)<=c*Math.max(1,Math.abs(r),Math.abs(n))}function Wne(e,t,i,r,s){let n=t[0]-i[0],c=t[1]-i[1];const o=(r[0]*n+r[1]*c)*(s-1);return n=r[0]*o,c=r[1]*o,e[0]=t[0]+n,e[1]=t[1]+c,e}const Zne=jw,G3=n_,Yne=tB,Jne=iB,Kne=Qx,Xne=Uw,Qne=rB;Object.freeze(Object.defineProperty({__proto__:null,add:eB,angle:Vne,ceil:Cne,copy:s_,cross:oB,dist:Kne,distance:Qx,div:Jne,divide:iB,dot:nB,equals:Hne,exactEquals:qne,floor:$ne,inverse:Dne,len:Zne,length:jw,lerp:Nne,max:Rne,min:kne,mul:Yne,multiply:tB,negate:sB,normalize:fI,projectAndScale:Wne,random:zne,rotate:jne,round:One,scale:P_,scaleAndAdd:Lne,set:Cs,sqrDist:Xne,sqrLen:Qne,squaredDistance:Uw,squaredLength:rB,str:Gne,sub:G3,subtract:n_,transformMat2:Fne,transformMat2d:La,transformMat3:Bne,transformMat4:Une},Symbol.toStringTag,{value:"Module"}));function Vr(){return[0,0]}function eoe(e){return[e[0],e[1]]}function C_(e,t){return[e,t]}function toe(e,t=Vr()){const i=Math.min(2,e.length);for(let r=0;rloe({item:c},t,i).item);else if(typeof n=="object")if(n.toJSON){const c=n.toJSON(i==null?void 0:i[s]);r[s]=t?c:JSON.stringify(c)}else r[s]=t?n:JSON.stringify(n);else r[s]=n}return r}async function coe(e,t,i,r){const s=aoe(e),n=t[0].spatialReference,c={...r,responseType:"json",query:{...s.query,f:"json",sr:rN(n),target:JSON.stringify({geometryType:qA(t[0]),geometries:t}),cutter:JSON.stringify(i)}},o=await Qi(s.path+"/cut",c),{cutIndexes:f,geometries:g=[]}=o.data;return{cutIndexes:f,geometries:g.map(S=>{const I=km(S);return I.spatialReference=n,I})}}function uoe(e){return{geometryType:qA(e[0]),geometries:e.map(t=>t.toJSON())}}function hoe(e,t,i){const r=yK(t);return e.map(s=>{const n=r.fromJSON(s);return n.spatialReference=i,n})}async function doe(e,t,i){const r=typeof e=="string"?Rr(e):e,s=t[0].spatialReference,n=qA(t[0]),c={...i,query:{...r.query,f:"json",sr:rN(s),geometries:JSON.stringify(uoe(t))}},{data:o}=await Qi(r.path+"/simplify",c);return hoe(o.geometries,n,s)}const dB=()=>_t.getLogger("esri.geometry.support.normalizeUtils");function poe(e){return e.type==="polygon"}function foe(e){return e[0].type==="polygon"}function moe(e){return e[0].type==="polyline"}function UR(e){const t=[];let i=0,r=0;for(let s=0;s1){for(let ve=1;ve<=z-1;ve++){const me=ve*t,ge=O*me+o,Ie=A*me+f;n.push([ge,Ie])}const V=(I+Math.floor(z-1)*t)/2,H=O*V+o,Q=A*V+f;n.push([H,Q])}n.push([g,S])}}return poe(e)?new yh({rings:r,spatialReference:e.spatialReference}):new Ua({paths:r,spatialReference:e.spatialReference})}function jR(e,t,i){if(t){const r=yoe(e,1e6);e=im(r,!0)}return i&&(e=hB(e,i)),e}function VR(e,t,i){if(Array.isArray(e)){const r=e[0];if(r>t){const s=rp(r,t);e[0]=r+s*(-2*t)}else if(rt){const s=rp(r,t);e=e.clone().offset(s*(-2*t),0)}else if(r{if(g[0]<180)return!0;{let S=0;for(let A=0;AS?O:S}S=Number(S.toFixed(9));const I=-360*rp(S,180);for(let A=0;AVR(Ce,o,f)),z.push(Ie)}else if(ge.type==="extent"){const Ie=ge.clone()._normalize(!1,!1,n);z.push(Ie.rings?new yh(Ie):Ie)}else if(ge.extent){const Ie=ge.extent,Ce=rp(Ie.xmin,f)*(2*o);let ze=Ce===0?ge.clone():hB(ge.clone(),Ce);Ie.offset(Ce,0),Ie.intersects(S)&&Ie.xmax!==o?(A=Ie.xmax>A?Ie.xmax:A,ze=jR(ze,c),O.push(ze),z.push("cut")):Ie.intersects(I)&&Ie.xmin!==f?(A=Ie.xmax*(2*o)>A?Ie.xmax*(2*o):A,ze=jR(ze,c,360),O.push(ze),z.push("cut")):z.push(ze)}else z.push(ge.clone());else z.push(ge);else z.push(ge);let V=rp(A,o),H=-90;const Q=V,ve=new Ua;for(;V>0;){const ge=360*V-180;ve.addPath([[ge,H],[ge,-1*H]]),H*=-1,V--}if(O.length>0&&Q>0){const ge=goe(O,await coe(r,O,ve,i)),Ie=[],Ce=[];for(let tt=0;tt1&&ot.rings.length>=et.rings.length?(Ie.push(ot),Ce.push("simplify")):Ce.push(c?Nc(ot):ot)}}if(!Ie.length)return Ce;const ze=await doe(r,Ie,i),je=[];for(let tt=0;ttn||fs)return t;switch(e.type){case"polygon":if(!(e.rings.length>1))return t;o=UR(e.rings);break;case"polyline":if(!(e.paths.length>1))return t;o=UR(e.paths);break;case"multipoint":o=e.points}const S=t.clone();for(let I=0;In?o=Math.ceil(Math.abs(t-n)/c):tn?f=Math.ceil(Math.abs(e-n)/c):en?g-=c:Ss)for(;e>s;)e-=n}return e}const fB=96,mB=39.37,boe=180/Math.PI;function yB(e){return e.wkid?e:e.spatialReference||yi.WGS84}function q3(e,t){return t.type?Cs(e,t.x,t.y):s_(e,t)}function gB(e){return $p(e)}function _m(e,t,i=0){let r=e.width,s=e.height;if(i!==0){const o=NN(i),f=Math.abs(Math.cos(o)),g=Math.abs(Math.sin(o));r=e.width*f+e.height*g,s=e.width*g+e.height*f}const n=Math.max(1,t[0]),c=Math.max(1,t[1]);return Math.max(r/n,s/c)*Poe(e.spatialReference)}async function s0(e,t,i,r){var o,f;let s,n;if(!e||Array.isArray(e)&&!e.length)return null;if(Bt.isCollection(e)&&(e=e.toArray()),Array.isArray(e)&&e.length&&typeof e[0]=="object"){const g=e.every(A=>"attributes"in A),S=e.some(A=>!A.geometry);let I=e;if(g&&S&&t&&t.allLayerViews){const A=new Map;for(const H of e){const Q=H.layer,ve=A.get(Q)||[],me=H.attributes[Q.objectIdField];me!=null&&ve.push(me),A.set(Q,ve)}const O=[];A.forEach((H,Q)=>{const ve=t.allLayerViews.find(me=>me.layer.id===Q.id);if(ve&&"queryFeatures"in ve){const me=Q.createQuery();me.objectIds=H,me.returnGeometry=!0,O.push(ve.queryFeatures(me))}});const z=await Promise.all(O),V=[];for(const H of z)if(H&&H.features&&H.features.length)for(const Q of H.features)Q.geometry!=null&&V.push(Q.geometry);I=V}for(const A of I)r=await s0(A,t,i,r);return r}if(Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number")s=new ri(e);else if(e instanceof Th)s=e;else if("geometry"in e){if(e.geometry)s=e.geometry;else if(e.layer){const g=e.layer,S=t.allLayerViews.find(I=>I.layer.id===g.id);if(S&&"queryFeatures"in S){const I=g.createQuery();I.objectIds=[e.attributes[g.objectIdField]],I.returnGeometry=!0;const A=await S.queryFeatures(I);s=(f=(o=A==null?void 0:A.features)==null?void 0:o[0])==null?void 0:f.geometry}}}if(s==null)return null;switch(s.type){case"point":n=new Ui({xmin:s.x,ymin:s.y,xmax:s.x,ymax:s.y,spatialReference:s.spatialReference});break;case"extent":case"multipoint":case"polygon":case"polyline":n=voe(s);break;default:n=s.extent}if(!n)return null;Ah()||Nl(n.spatialReference,i)||await bh();const c=Ph(n,i);return c?r=r?r.union(c):c:null}function woe(e){var t;if(e&&(!Array.isArray(e)||typeof e[0]!="number")&&(typeof e=="object"||Array.isArray(e)&&typeof e[0]=="object")){if("layer"in e&&((t=e.layer)==null?void 0:t.minScale)!=null&&e.layer.maxScale!=null){const i=e.layer;return{min:i.minScale,max:i.maxScale}}if(Array.isArray(e)&&e.length&&e.every(i=>"layer"in i)){let i=0,r=0;for(const s of e){const n=s.layer;n!=null&&n.minScale&&n.maxScale&&(i=n.minScaler?n.maxScale:r)}return i&&r?{min:i,max:r}:null}}}function sT(e,t){return Js(yB(e),t)?e:Ph(e,t)}async function xoe(e,t){var H;if(!e||!t)return new kl({targetGeometry:new ri,scale:0,rotation:0});let i=t.spatialReference;const{constraints:r,padding:s,viewpoint:n,size:c}=t,o=[s?c[0]-s.left-s.right:c[0],s?c[1]-s.top-s.bottom:c[1]];let f=null;e instanceof kl?f=e:e.viewpoint?f=e.viewpoint:e.target&&e.target.declaredClass==="esri.Viewpoint"&&(f=e.target);let g=null;f!=null&&f.targetGeometry?g=f.targetGeometry:e instanceof Ui?g=e:(e||e&&("center"in e||"extent"in e||"target"in e))&&(g=await s0(e.center,t,i)||await s0(e.extent,t,i)||await s0(e.target,t,i)||await s0(e,t,i)),!g&&(n!=null&&n.targetGeometry)?g=n.targetGeometry:!g&&t.extent&&(g=t.extent),i||(i=yB(t.spatialReference||t.extent||g)),Ah()||Js(g.spatialReference,i)||Nl(g.spatialReference,i)||await bh();const S=sT(g,i),I="center"in S?S.center:S;t.pickClosestTarget!==!1&&I.type==="point"&&((H=n.targetGeometry)==null?void 0:H.type)==="point"&&(I.x=pB(I.x,n.targetGeometry.x,I.spatialReference));let A=0;f?A=f.rotation:e.hasOwnProperty("rotation")?A=e.rotation:n&&(A=n.rotation);let O=0;if((f==null?void 0:f.targetGeometry)!=null&&f.targetGeometry.type==="point")O=f.scale;else if("scale"in e&&e.scale)O=e.scale;else if("zoom"in e&&e.zoom!==-1&&r&&r.effectiveLODs)O=r.zoomToScale(e.zoom);else if(Array.isArray(g)||g.type==="point"||g.type==="extent"&&g.width===0&&g.height===0){const Q=sT(t.extent,i);O=Q!=null?_m(Q,o,A):t.extent?_m(t.extent,o,A):n.scale}else O=_m(sT(g.extent,i),o,A);const z=woe(e.target??e);z&&(z.min&&z.minO&&(O=z.max));let V=new kl({targetGeometry:I,scale:O,rotation:A});return r&&(V=r.fit(V),r.constrainByGeometry(V),r.rotationEnabled||(V.rotation=n.rotation)),V}function Qa(e,t){const i=e.targetGeometry,r=t.targetGeometry;return i.x=r.x,i.y=r.y,i.spatialReference=r.spatialReference,e.scale=t.scale,e.rotation=t.rotation,e}function Soe(e,t,i){return i?Cs(e,.5*(t[0]-i.right+i.left),.5*(t[1]-i.bottom+i.top)):P_(e,t,.5)}const Toe=function(){const e=Vr();return function(t,i,r){const s=i.targetGeometry;q3(e,s);const n=.5*Km(i);return t.xmin=e[0]-n*r[0],t.ymin=e[1]-n*r[1],t.xmax=e[0]+n*r[0],t.ymax=e[1]+n*r[1],t.spatialReference=s.spatialReference,t}}();function Eoe(e,t,i,r,s){var n;return mI(e,t,i.center),e.scale=_m(i,r),(n=s==null?void 0:s.constraints)==null||n.constrain(e),e}function Moe(e,t,i,r){return Z3(e,t,i,r),U3(e,e)}const _B=function(){const e=Vr();return function(t,i,r){return G3(t,Coe(t,i),Soe(e,i,r))}}(),Ioe=function(){const e=zc(),t=Vr();return function(i,r,s,n){const c=Km(r),o=H3(r);return Cs(t,c,c),X8(e,t),Xx(e,e,o),r_(e,e,_B(t,s,n)),r_(e,e,[0,n.top-n.bottom]),Cs(i,e[4],e[5])}}();function Km(e){return e.scale*Aoe(e.targetGeometry)}function Aoe(e){return e!=null&&Ba(e.spatialReference)?1/(gB(e.spatialReference)*mB*fB):1}function H3(e){return FA(e.rotation)||0}function Poe(e){return Ba(e)?gB(e)*mB*fB:1}function Coe(e,t){return P_(e,t,.5)}const W3=function(){const e=Vr(),t=Vr(),i=Vr();return function(r,s,n,c,o,f){return sB(e,s),P_(t,n,.5*f),Cs(i,1/c*f,-1/c*f),V3(r,t),o&&Xx(r,r,o),j3(r,r,i),r_(r,r,e),r}}(),Z3=function(){const e=Vr();return function(t,i,r,s){const n=Km(i),c=H3(i);return q3(e,i.targetGeometry),W3(t,e,r,n,c,s)}}(),$oe=function(){const e=Vr();return function(t,i,r,s){const n=Km(i);return q3(e,i.targetGeometry),W3(t,e,r,n,0,s)}}();function koe(e){const t=ro(e);return t?t.valid[1]-t.valid[0]:0}function Roe(e,t){return Math.round(koe(e)/t)}const Ooe=function(){const e=Vr(),t=Vr(),i=[0,0,0];return function(r,s,n){n_(e,r,s),fI(e,e),n_(t,r,n),fI(t,t),oB(i,e,t);let c=Math.acos(nB(e,t)/(jw(e)*jw(t)))*boe;return i[2]<0&&(c=-c),isNaN(c)&&(c=0),c}}(),Loe=function(){const e=Vr();return function(t,i,r,s){const n=t.targetGeometry;return Qa(t,i),Ioe(e,i,r,s),n.x+=e[0],n.y+=e[1],t}}(),mI=function(e,t,i){Qa(e,t);const r=e.targetGeometry;return r.x=i.x,r.y=i.y,r.spatialReference=i.spatialReference,e},Doe=function(){const e=Vr();return function(t,i,r,s,n){n||(n="center"),G3(e,r,s),P_(e,e,.5);const c=e[0],o=e[1];switch(n){case"center":Cs(e,0,0);break;case"left":Cs(e,-c,0);break;case"top":Cs(e,0,o);break;case"right":Cs(e,c,0);break;case"bottom":Cs(e,0,-o);break;case"top-left":Cs(e,-c,o);break;case"bottom-left":Cs(e,-c,-o);break;case"top-right":Cs(e,c,o);break;case"bottom-right":Cs(e,c,-o)}return e2(t,i,e),t}}();function M1e(e,t,i){return Qa(e,t),e.rotation+=i,e}function Noe(e,t,i){return Qa(e,t),e.rotation=i,e}const zoe=function(){const e=Vr();return function(t,i,r,s,n){return Qa(t,i),isNaN(r)||r===0||(bB(e,s,i,n),t.scale=i.scale*r,wB(e,e,t,n),e2(t,t,Cs(e,e[0]-s[0],s[1]-e[1]))),t}}();function GR(e,t,i){return Qa(e,t),e.scale=i,e}const vB=function(){const e=Vr();return function(t,i,r,s,n,c){return Qa(t,i),isNaN(r)||r===0||(bB(e,n,i,c),t.scale=i.scale*r,t.rotation+=s,wB(e,e,t,c),e2(t,t,Cs(e,e[0]-n[0],n[1]-e[1]))),t}}(),I1e=function(){const e=Vr(),t=Vr();return function(i,r,s,n,c,o,f){return _B(t,o,f),eB(e,c,t),n?vB(i,r,s,n,e,o):zoe(i,r,s,e,o)}}(),bB=function(){const e=zc();return function(t,i,r,s){return La(t,i,Moe(e,r,s,1))}}(),wB=function(){const e=zc();return function(t,i,r,s){return La(t,i,Z3(e,r,s,1))}}(),e2=function(){const e=Vr(),t=zc();return function(i,r,s){Qa(i,r);const n=Km(r),c=i.targetGeometry;return K8(t,H3(r)),j3(t,t,C_(n,n)),La(e,s,t),c.x+=e[0],c.y+=e[1],i}}();let Foe=class{constructor(t,i,r,s){const n=t.targetGeometry,c=i.targetGeometry;s?typeof s=="string"&&(s=dne(s)||Yo.ease):s=Yo.ease,this.easing=s,this.duration=r,this.sCenterX=n.x,this.sCenterY=n.y,this.sScale=t.scale,this.sRotation=t.rotation,this.tCenterX=c.x,this.tCenterY=c.y,this.tScale=i.scale,this.tRotation=i.rotation,this.dCenterX=this.tCenterX-this.sCenterX,this.dCenterY=this.tCenterY-this.sCenterY,this.dScale=this.tScale-this.sScale,this.dRotation=this.tRotation-this.sRotation,this.dRotation>180?this.dRotation-=360:this.dRotation<-180&&(this.dRotation+=360)}applyRatio(t,i){const r=this.easing(i);let s,n,c,o;i>=1?(s=this.tCenterX,n=this.tCenterY,c=this.tRotation,o=this.tScale):(s=this.sCenterX+r*this.dCenterX,n=this.sCenterY+r*this.dCenterY,c=this.sRotation+r*this.dRotation,o=this.sScale+r*this.dScale),t.targetGeometry.x=s,t.targetGeometry.y=n,t.scale=o,t.rotation=c}},Vu=class extends Nt{constructor(t){super(t),this._animation=null,this.updateFunction=null,this.duration=200,this.transition=null,this.easing=Yo.ease,this.view=null,this.viewpoint=new kl({targetGeometry:new ri,scale:0,rotation:0}),this._updateTask=Mm({postRender:this._postRender.bind(this)}),this._updateTask.pause()}destroy(){this._updateTask=Sr(this._updateTask)}get animation(){return this._animation}set animation(t){this._animation=t,this.view&&(this.view.animation=t)}animate(t,i,r){this.stop();const s=this.viewpoint;Qa(s,i),this.transition=new Foe(this.viewpoint,t.target,(r==null?void 0:r.duration)||this.duration,(r==null?void 0:r.easing)||this.easing);const n=()=>{var c,o;this.animation===t&&this._updateTask&&(t.state==="finished"&&((c=this.transition)==null||c.applyRatio(this.viewpoint,1),(o=this.view)!=null&&o.state&&(this.view.state.viewpoint=this.viewpoint.clone())),this.animation=null,this.updateFunction=null)};return t.when(n,n),this._startTime=performance.now(),this._updateTask.resume(),this.animation=t,t}animateContinous(t,i){this.stop(),this.updateFunction=i,this.viewpoint=t;const r=new pI({target:t.clone()}),s=()=>{this.animation===r&&this._updateTask&&(this.animation=null,this.updateFunction=null)};return r.when(s,s),this._startTime=performance.now(),this._updateTask.resume(),this.animation=r,r}stop(){this.animation&&(this.animation.stop(),this.animation=null,this.updateFunction=null)}_postRender(t){var r,s;const i=this.animation;if(i&&i.state!==pI.State.STOPPED){if(this.updateFunction)this.updateFunction(this.viewpoint,t.deltaTime);else{const n=this.transition,c=(performance.now()-this._startTime)/n.duration,o=c>=1;n.applyRatio(this.viewpoint,c),o&&((r=this.animation)==null||r.finish())}(s=this.view)!=null&&s.state&&(this.view.state.viewpoint=this.viewpoint.clone())}else this._updateTask.pause()}};v([M()],Vu.prototype,"duration",void 0),v([M()],Vu.prototype,"transition",void 0),v([M()],Vu.prototype,"easing",void 0),v([M()],Vu.prototype,"view",void 0),v([M()],Vu.prototype,"viewpoint",void 0),Vu=v([fe("esri.views.2d.AnimationManager")],Vu);const Boe=Vu;let Uoe=class{constructor(t){this.view=t,this._stationaryHandle=null,this._frameTaskHandle=null,this._updateParameters=null,this._updateRequested=!1,this.stationary=!0,this.animationInProgress=!1,this.prepare=()=>{this._updateParameters&&(this._updateParameters.state=this.view.state,this._updateParameters.stationary=this.view.stationary,this._updateParameters.pixelRatio=window.devicePixelRatio,this._updateParameters.renderingOptions=this.view.renderingOptions)},this.update=()=>{var c,o;if(this._updateRequested=!1,(c=this.view)==null?void 0:c.destroyed)return;const{allLayerViews:i,graphicsView:r,labelManager:s,state:{id:n}}=this.view;i.forEach(this._updateLayerView,this),s!=null&&(s.lastUpdateId!==n&&(s.viewChange(),s.lastUpdateId=n),s.updateRequested&&s.processUpdate(this._updateParameters)),r!=null&&(r.lastUpdateId!==n&&(r.viewChange(),r.lastUpdateId=n),r.updateRequested&&r.processUpdate(this._updateParameters)),this.view.graphicsTileStore.setViewState(this._updateParameters.state),this.animationInProgress||this._updateRequested||((o=this._frameTaskHandle)==null||o.pause())}}destroy(){this.stop()}start(){if(this._frameTaskHandle)return;const t=this.view;this.stationary=t.stationary,this._updateParameters={state:t.state,pixelRatio:window.devicePixelRatio,stationary:this.stationary,renderingOptions:t.renderingOptions},this._stationaryHandle=ti(()=>t.stationary,i=>{this.stationary=i,this.requestFrame()}),this._frameTaskHandle=Mm(this),this.requestUpdate()}stop(){var t;this._frameTaskHandle&&(this._updateRequested=!1,(t=this._stationaryHandle)==null||t.remove(),this._frameTaskHandle.remove(),this._updateParameters=this._stationaryHandle=this._frameTaskHandle=null,this.stationary=!0,this.animationInProgress=!1)}requestUpdate(){this._updateRequested||(this._updateRequested=!0,this.requestFrame())}requestFrame(){this._frameTaskHandle&&this._frameTaskHandle.resume()}_updateLayerView(t){var s;if(!t.attached)return void this.requestUpdate();const i=this.view.state,r=t.lastUpdateId;r!=null&&(this.stationary||t.moving)||(t.moving=!0,t.moveStart()),r!==i.id&&t.viewChange(),this.stationary&&t.moving&&(t.moving=!1,t.moveEnd()),t.lastUpdateId=i.id,t.updateRequested&&t.processUpdate(this._updateParameters),"layerViews"in t&&((s=t.layerViews)==null||s.forEach(this._updateLayerView,this))}},Ib=class extends Nt{constructor(t){super(t),this._gotoTask=null}destroy(){this._gotoTask=null}async goTo(t,i){if(!t)return void _t.getLogger(this).error("#goTo()","target cannot be null or undefined");const r=new pI;this.view.animation=r,await $x(()=>this.view.ready,i);const s={animate:!0,...i},{extent:n,spatialReference:c,size:o,viewpoint:f,constraints:g,padding:S,allLayerViews:I}=this.view,A=xoe(t,{extent:n,spatialReference:c,size:o,viewpoint:f,constraints:g,padding:S,allLayerViews:I,pickClosestTarget:(i==null?void 0:i.pickClosestTarget)??!0});return r==null||r.update(A),this._gotoTask={},s.animate?this._gotoAnimated(A,s):this._gotoImmediate(A,s)}_gotoImmediate(t,i){const r=this._gotoTask,s=this.view.animation,n=t.then(c=>{if(mr(i),r!==this._gotoTask)throw new Je("view:goto-interrupted","Goto was interrupted");this.view.viewpoint=s.target=c,s.finish()});return this._cancellableGoTo(r,s,n,i)}_gotoAnimated(t,i){const r=this._gotoTask,s=this.view.animation;if(!s)return Promise.resolve();const n=t.then(c=>{if(mr(i),r!==this._gotoTask)throw new Je("view:goto-interrupted","Goto was interrupted");return s.update(c),this.view.animationManager.animate(s,this.view.viewpoint,i),s.when().then(()=>{},()=>{})});return this._cancellableGoTo(r,s,n,i)}_cancellableGoTo(t,i,r,s){const n=()=>t===this._gotoTask;return yG(r,s).finally(()=>{n()&&(i.done||i.stop())})}};v([M({constructOnly:!0})],Ib.prototype,"view",void 0),Ib=v([fe("esri.views.2d.GoToManager")],Ib);function ar(){return Promise.all([ht(()=>import("./webglDeps-BqalI_vm.js"),__vite__mapDeps([164,75,74,165,166])),ht(()=>import("./mapViewDeps-pgi5I2eW.js"),__vite__mapDeps([167,76,77,78,22,79,80,73,74,75,81,38,82,43,83,84,127,11,168,169,170,171,166,114,24,25,164,165,172,88,173,72,34,32,31,28,19,71,174,175,176,177,178,179,61,180,181,182,183,184,185,186,187,91,188]))])}const Sg=()=>ar().then(()=>ht(()=>import("./TileLayerView2D-BnlmUfzg.js"),__vite__mapDeps([189,76,77,78,22,79,80,73,74,75,81,38,82,43,83,84,127,11,169,170,171,166,114,24,25,172,88,173,72,34,32,31,28,19,71,61,181,175,176,182,183,91,190,191,187,192,193,194,185,186,195,196,197,198,199]))),If=()=>ar().then(()=>ht(()=>import("./FeatureLayerView2D-Dw_5zj3d.js").then(e=>e.F),__vite__mapDeps([200,71,170,83,74,137,129,192,193,186,76,77,78,22,79,80,73,75,81,38,82,43,84,187,171,166,114,24,25,85,122,147,154,144,124,12,168,169,181,201,197,199,195]))),qR={"base-dynamic":()=>ar().then(()=>ht(()=>import("./BaseDynamicLayerView2D-BqfsTH6m.js"),__vite__mapDeps([202,203,171,73,74,75,166,170,83,114,78,24,22,25,192,193,204,191,195]))),"base-tile":Sg,"bing-maps":Sg,catalog:()=>ar().then(()=>ht(()=>import("./CatalogLayerView2D-BuGdqUm1.js"),__vite__mapDeps([205,192,193,170,83,74]))),"catalog-dynamic-group":()=>ar().then(()=>ht(()=>import("./CatalogDynamicGroupLayerView2D-CqaPUHS1.js"),__vite__mapDeps([206,192,193,170,83,74]))),"catalog-footprint":()=>ar().then(()=>ht(()=>import("./CatalogFootprintLayerView2D-4V3pvH_N.js"),__vite__mapDeps([207,200,71,170,83,74,137,129,192,193,186,76,77,78,22,79,80,73,75,81,38,82,43,84,187,171,166,114,24,25,85,122,147,154,144,124,12,168,169,181,201,197,199,195]))),csv:If,"geo-rss":()=>ar().then(()=>ht(()=>import("./GeoRSSLayerView2D-DGBAg8jk.js"),__vite__mapDeps([208,120,121,93,71,101,122,123,124,125,126,34,32,127,79,11,12,129,192,193,170,83,74,184,185,186,76,77,78,22,80,73,75,81,38,82,43,84,187,171,166,114,24,25,181,91,182,72,31,28,19,183]))),feature:If,geojson:If,graphics:()=>ar().then(()=>ht(()=>import("./GraphicsLayerView2D-D7NawYZd.js"),__vite__mapDeps([209,83,192,193,170,74,184,185,186,76,77,78,22,79,80,73,75,81,38,82,43,84,187,171,166,114,24,25,181,91,182,34,32,127,11,72,31,28,19,71,183,201]))),group:()=>ar().then(()=>ht(()=>import("./GroupLayerView2D-ayVE8wm-.js"),__vite__mapDeps([210,192,193,170,83,74]))),imagery:()=>ar().then(()=>ht(()=>import("./ImageryLayerView2D-D5_CduBq.js"),__vite__mapDeps([211,212,75,74,166,98,171,73,170,83,114,78,24,22,25,192,193,182,34,32,76,77,79,80,81,38,82,43,84,127,11,72,31,28,19,71,181,183,194,185,186,187,91,203,191,204,102,199,195]))),"imagery-tile":()=>ar().then(()=>ht(()=>import("./ImageryTileLayerView2D-CxFrn228.js"),__vite__mapDeps([213,214,212,75,74,166,98,171,73,170,83,114,78,24,22,25,192,193,215,187,216,102,199,195]))),kml:()=>ar().then(()=>ht(()=>import("./KMLLayerView2D-B307IWZ8.js"),__vite__mapDeps([217,218,120,121,93,71,101,122,123,124,125,126,34,32,127,79,11,12,129,191,170,83,74,203,171,73,75,166,114,78,24,22,25,192,193,184,185,186,76,77,80,81,38,82,43,84,187,181,91,182,72,31,28,19,183,102,174,164,165,175,176,173,169,177,215]))),"knowledge-graph":()=>ar().then(()=>ht(()=>import("./KnowledgeGraphLayerView2D-CuM0qoPc.js"),__vite__mapDeps([219,192,193,170,83,74]))),"link-chart":()=>ar().then(()=>ht(()=>import("./KnowledgeGraphLayerView2D-CuM0qoPc.js"),__vite__mapDeps([219,192,193,170,83,74]))),"knowledge-graph-sublayer":If,"map-image":()=>ar().then(()=>ht(()=>import("./MapImageLayerView2D-iNdXAMVi.js"),__vite__mapDeps([220,203,171,73,74,75,166,170,83,114,78,24,22,25,192,193,182,34,32,76,77,79,80,81,38,82,43,84,127,11,72,31,28,19,71,181,183,194,185,186,187,91,204,191,221,197,198,195,196,199]))),"map-notes":()=>ar().then(()=>ht(()=>import("./MapNotesLayerView2D-DxdmUoTh.js"),__vite__mapDeps([222,83,192,193,170,74,184,185,186,76,77,78,22,79,80,73,75,81,38,82,43,84,187,171,166,114,24,25,181,91,182,34,32,127,11,72,31,28,19,71,183]))),media:()=>ar().then(()=>ht(()=>import("./MediaLayerView2D-vpnVWbi-.js"),__vite__mapDeps([223,121,93,71,101,122,123,124,125,120,126,34,32,127,79,11,12,224,183,53,76,77,78,22,80,73,74,75,81,38,82,43,83,84,169,170,171,166,114,24,25,172,88,173,72,31,28,19,61,181,175,176,182,91,180,192,193]))),"ogc-feature":()=>ar().then(()=>ht(()=>import("./OGCFeatureLayerView2D-DBRY7Ix7.js"),__vite__mapDeps([225,200,71,170,83,74,137,129,192,193,186,76,77,78,22,79,80,73,75,81,38,82,43,84,187,171,166,114,24,25,85,122,147,154,144,124,12,168,169,181,201,197,199,195]))),"open-street-map":Sg,"oriented-imagery":If,route:()=>ar().then(()=>ht(()=>import("./RouteLayerView2D-CcISu94y.js"),__vite__mapDeps([226,227,83,192,193,170,74,184,185,186,76,77,78,22,79,80,73,75,81,38,82,43,84,187,171,166,114,24,25,181,91,182,34,32,127,11,72,31,28,19,71,183]))),stream:()=>ar().then(()=>ht(()=>import("./StreamLayerView2D-Be7jZFcL.js"),__vite__mapDeps([228,129,200,71,170,83,74,137,192,193,186,76,77,78,22,79,80,73,75,81,38,82,43,84,187,171,166,114,24,25,85,122,147,154,144,124,12,168,169,181,201,197,199,195]))),"subtype-group":()=>ar().then(()=>ht(()=>import("./SubtypeGroupLayerView2D-BzijIwec.js"),__vite__mapDeps([229,200,71,170,83,74,137,129,192,193,186,76,77,78,22,79,80,73,75,81,38,82,43,84,187,171,166,114,24,25,85,122,147,154,144,124,12,168,169,181,201,197,199,195]))),tile:Sg,"vector-tile":()=>ar().then(()=>ht(()=>import("./VectorTileLayerView2D-Bu846VB2.js"),__vite__mapDeps([230,71,80,74,61,179,169,84,75,166,114,171,73,170,83,78,24,22,25,187,27,115,192,193]))),video:()=>ar().then(()=>ht(()=>import("./VideoLayerView2D-CtjQ6rEp.js"),__vite__mapDeps([231,232,192,193,170,83,74,184,185,186,76,77,78,22,79,80,73,75,81,38,82,43,84,187,171,166,114,24,25,181,91,182,34,32,127,11,72,31,28,19,71,183]))),wcs:()=>ar().then(()=>ht(()=>import("./ImageryTileLayerView2D-CxFrn228.js"),__vite__mapDeps([213,214,212,75,74,166,98,171,73,170,83,114,78,24,22,25,192,193,215,187,216,102,199,195]))),"web-tile":Sg,wfs:If,wms:()=>ar().then(()=>ht(()=>import("./WMSLayerView2D-D80tHNhN.js"),__vite__mapDeps([233,203,171,73,74,75,166,170,83,114,78,24,22,25,192,193,204,191,195,234]))),wmts:()=>ar().then(()=>ht(()=>import("./WMTSLayerView2D-CZBGPwsV.js"),__vite__mapDeps([235,190,191,170,83,74,171,73,75,166,114,78,24,22,25,187,192,193,195]))),"line-of-sight":null,"base-elevation":null,"building-scene":null,dimension:null,elevation:null,"integrated-mesh":null,"integrated-mesh-3dtiles":null,"point-cloud":null,voxel:null,scene:null,unknown:null,unsupported:null};function joe(e){const t=e.declaredClass?e.declaredClass.slice(e.declaredClass.lastIndexOf(".")+1):"Unknown",i=t.replaceAll(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new Je(`${i}:view-not-supported`,`${t} is not supported in 2D`)}const HR={hasLayerViewModule:e=>qR[e.type]!=null,importLayerView:e=>{const t=qR[e.type];if(t==null)throw joe(e);return t(e)}};function Voe(e,t){const{spatialReference:i}=t,r=[t.x,t.y];let s=Number.POSITIVE_INFINITY,n=0,c=0;const o=[0,0],f=e.type==="extent"?[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]:e.rings;for(const g of f)for(let S=0;SS.clone()),t.sort((S,I)=>I.scale-S.scale),t.forEach((S,I)=>S.level=I);for(const S of t)!f&&i>0&&i>=S.scale&&(c=S.level,f=!0),!g&&r>0&&r>=S.scale&&(o=e?e.level:-1,g=!0),e=S;s===-1&&(s=i===0?0:c),n===-1&&(n=r===0?t.length-1:o),s=Math.max(s,0),s=Math.min(s,t.length-1),n=Math.max(n,0),n=Math.min(n,t.length-1),s>n&&([s,n]=[n,s]),i=t[s].scale,r=t[n].scale,t.splice(0,s),t.splice(n-s+1,t.length),t.forEach((S,I)=>{this._lodByScale[S.scale]=S,this._scales[I]=S.scale}),this._set("effectiveLODs",t),this._set("effectiveMinZoom",s),this._set("effectiveMaxZoom",n),this._set("effectiveMinScale",i),this._set("effectiveMaxScale",r)}constrain(e,t){if(t&&e.scale===t.scale)return e;const i=this.effectiveMinScale,r=this.effectiveMaxScale,s=e.targetGeometry,n=t&&t.targetGeometry,c=r!==0&&e.scalei;if(c||o){const f=o?i:r;if(t&&n){const g=(f-t.scale)/(e.scale-t.scale);s.x=n.x+(s.x-n.x)*g,s.y=n.y+(s.y-n.y)*g}e.scale=f}return this.snapToZoom&&this.effectiveLODs&&(e.scale=this._getClosestScale(e.scale)),e}fit(e){if(!this.effectiveLODs||!this.snapToZoom)return this.constrain(e,null);const t=this.scaleToZoom(e.scale),i=Math.abs(t-Math.floor(t));return e.scale=this.zoomToScale(i>.99?Math.round(t):Math.floor(t)),e}zoomToScale(e){if(!this.effectiveLODs)return 0;e-=this.effectiveMinZoom,e=Math.max(0,e);const t=this._scales;if(e<=0)return t[0];if(e>=t.length)return t[t.length-1];const i=Math.round(e-.5),r=Math.round(e);return t[r]+(r-e)*(t[i]-t[r])}scaleToZoom(e){if(!this.effectiveLODs)return-1;const t=this._scales;let i,r;if(e>=t[0])return this.effectiveMinZoom;if(e<=t[t.length-1])return this.effectiveMaxZoom;for(let s=0;se&&rMath.abs(i-e)<=Math.abs(t-e)?i:t,this._scales[0])),this._lodByScale[e].scale}};v([M({readOnly:!0})],Wn.prototype,"effectiveLODs",void 0),v([M({readOnly:!0})],Wn.prototype,"effectiveMinZoom",void 0),v([M({readOnly:!0})],Wn.prototype,"effectiveMaxZoom",void 0),v([M({readOnly:!0})],Wn.prototype,"effectiveMinScale",void 0),v([M({readOnly:!0})],Wn.prototype,"effectiveMaxScale",void 0),v([M()],Wn.prototype,"lods",void 0),v([M()],Wn.prototype,"minZoom",void 0),v([M()],Wn.prototype,"maxZoom",void 0),v([M()],Wn.prototype,"minScale",void 0),v([M()],Wn.prototype,"maxScale",void 0),v([M()],Wn.prototype,"snapToZoom",void 0),Wn=_I=v([fe("esri.views.2d.constraints.ZoomConstraint")],Wn);const SB=Wn,Goe={base:null,key:"type",typeMap:{extent:Ui,polygon:yh}};let zr=class extends Nt{constructor(t){super(t),this.lods=null,this.minScale=0,this.maxScale=0,this.minZoom=-1,this.maxZoom=-1,this.rotationEnabled=!0,this.snapToZoom=!0,this.customConstraints=new Bt}destroy(){this.view=null}get effectiveLODs(){return this._zoom.effectiveLODs}get effectiveMinScale(){return this._zoom.effectiveMinScale}get effectiveMaxScale(){return this._zoom.effectiveMaxScale}get effectiveMinZoom(){return this._zoom.effectiveMinZoom}get effectiveMaxZoom(){return this._zoom.effectiveMaxZoom}set geometry(t){t?this._set("geometry",t):this._set("geometry",null)}get version(){var t,i,r;return`${(t=this._zoom)==null?void 0:t.uid}/${(i=this._rotation)==null?void 0:i.uid}/${(r=this._geometry)==null?void 0:r.uid}`}get _geometry(){var i,r;const t=this._get("_geometry");return t&&this.geometry===t.geometry&&((i=this.view)==null?void 0:i.constraintsInfo.spatialReference)===t.spatialReference?t:new Ud({geometry:this.geometry,spatialReference:(r=this.view)==null?void 0:r.constraintsInfo.spatialReference})}get _rotation(){return new xB({rotationEnabled:this.rotationEnabled})}get _zoom(){var f;const t=this._get("_zoom"),i=this.lods||((f=this.view)==null?void 0:f.constraintsInfo.lods),r=this.minZoom,s=this.maxZoom,n=this.minScale,c=this.maxScale,o=this.snapToZoom;return t&&t.lods===i&&t.minZoom===r&&t.maxZoom===s&&t.minScale===n&&t.maxScale===c&&t.snapToZoom===o?t:new SB({lods:i,minZoom:r,maxZoom:s,minScale:n,maxScale:c,snapToZoom:o})}canZoomInTo(t){const i=this.effectiveMaxScale;return i===0||t>=i}canZoomOutTo(t){const i=this.effectiveMinScale;return i===0||t<=i}constrain(t,i){return this._zoom.constrain(t,i),this._rotation.constrain(t,i),this._geometry.constrain(t,i),this.customConstraints.forEach(r=>r.constrain(t,i)),t}constrainByGeometry(t){return this._geometry.constrain(t),this.customConstraints.forEach(i=>{var r;return(r=i.applyPanConstraint)==null?void 0:r.call(i,t)}),t}fit(t){return this._zoom.fit(t)}zoomToScale(t){return this._zoom.zoomToScale(t)}scaleToZoom(t){return this._zoom.scaleToZoom(t)}snapScale(t){return this._zoom.snapToClosestScale(t)}snapToNextScale(t){return this._zoom.snapToNextScale(t)}snapToPreviousScale(t){return this._zoom.snapToPreviousScale(t)}};v([M({readOnly:!0})],zr.prototype,"effectiveLODs",null),v([M({readOnly:!0})],zr.prototype,"effectiveMinScale",null),v([M({readOnly:!0})],zr.prototype,"effectiveMaxScale",null),v([M({readOnly:!0})],zr.prototype,"effectiveMinZoom",null),v([M({readOnly:!0})],zr.prototype,"effectiveMaxZoom",null),v([M({types:Goe,value:null})],zr.prototype,"geometry",null),v([M({type:[kc]})],zr.prototype,"lods",void 0),v([M()],zr.prototype,"minScale",void 0),v([M()],zr.prototype,"maxScale",void 0),v([M()],zr.prototype,"minZoom",void 0),v([M()],zr.prototype,"maxZoom",void 0),v([M()],zr.prototype,"rotationEnabled",void 0),v([M()],zr.prototype,"snapToZoom",void 0),v([M({type:Bt})],zr.prototype,"customConstraints",void 0),v([M()],zr.prototype,"view",void 0),v([M({readOnly:!0})],zr.prototype,"version",null),v([M({type:Ud,readOnly:!0})],zr.prototype,"_geometry",null),v([M({type:xB})],zr.prototype,"_rotation",null),v([M({readOnly:!0,type:SB})],zr.prototype,"_zoom",null),zr=v([fe("esri.views.2d.MapViewConstraints")],zr);const TB=zr;let Fl=class kd{static getId(t,i,r,s){return typeof t=="object"?`${t.level}/${t.row}/${t.col}/${t.world}`:`${t}/${i}/${r}/${s}`}constructor(t,i,r,s){this.set(t,i,r,s)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(t){this.set(t)}get hash(){const t=4095&this.row,i=4095&this.col,r=63&this.level;return(3&this.world)<<30|i<<22|t<<8|r}acquire(t,i,r,s){this.set(t,i,r,s)}contains(t){const i=t.level-this.level;return i>=0&&this.row===t.row>>i&&this.col===t.col>>i&&this.world===t.world}containsChild(t){const i=t.level-this.level;return i>0&&this.row===t.row>>i&&this.col===t.col>>i&&this.world===t.world}equals(t){return this.level===t.level&&this.row===t.row&&this.col===t.col&&this.world===t.world}clone(){return new kd(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(t,i,r,s){if(t==null)this.level=0,this.row=0,this.col=0,this.world=0;else if(typeof t=="object")this.level=t.level||0,this.row=t.row||0,this.col=t.col||0,this.world=t.world||0;else if(typeof t=="string"){const[n,c,o,f]=t.split("/");this.level=parseFloat(n),this.row=parseFloat(c),this.col=parseFloat(o),this.world=parseFloat(f)}else this.level=+t,this.row=+i,this.col=+r,this.world=+s||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new kd(this.level-1,this.row>>1,this.col>>1,this.world)}getNeighborId(t,i){return`${this.level}/${this.row+i}/${this.col+t}/${this.world}`}getChildKeys(){const t=this.level+1,i=this.row<<1,r=this.col<<1,s=this.world;return[new kd(t,i,r,s),new kd(t,i,r+1,s),new kd(t,i+1,r,s),new kd(t,i+1,r+1,s)]}compareRowMajor(t){return this.rowt.row?1:this.colt.col?1:0}};Fl.pool=new Pp(Fl,null,null,25,50);function Tu(e,t){return[e,t]}function rd(e,t,i){return e[0]=t,e[1]=i,e}function qoe(e,t,i,r,s){return e[0]=t,e[1]=i,e[2]=r,e[3]=s,e}const Sa=new Fl("0/0/0/0");let Hoe=class EB{static create(t,i,r=null){const s=ro(t.spatialReference),n=i.origin||Tu(t.origin.x,t.origin.y),c=Tu(t.size[0]*i.resolution,t.size[1]*i.resolution),o=Tu(-1/0,-1/0),f=Tu(1/0,1/0),g=Tu(1/0,1/0);r!=null&&(rd(o,Math.max(0,Math.floor((r.xmin-n[0])/c[0])),Math.max(0,Math.floor((n[1]-r.ymax)/c[1]))),rd(f,Math.max(0,Math.floor((r.xmax-n[0])/c[0])),Math.max(0,Math.floor((n[1]-r.ymin)/c[1]))),rd(g,f[0]-o[0]+1,f[1]-o[1]+1));const{cols:S,rows:I}=i;let A,O,z,V;return!r&&S&&I&&(rd(o,S[0],I[0]),rd(f,S[1],I[1]),rd(g,S[1]-S[0]+1,I[1]-I[0]+1)),t.isWrappable?(A=Tu(Math.ceil(Math.round((s.valid[1]-s.valid[0])/i.resolution)/t.size[0]),g[1]),O=Tu(Math.floor((s.origin[0]-n[0])/c[0]),o[1]),z=Tu(A[0]+O[0]-1,f[1]),V=!0):(O=o,z=f,A=g,V=!1),new EB(i.level,i.resolution,i.scale,n,o,f,g,c,O,z,A,V)}constructor(t,i,r,s,n,c,o,f,g,S,I,A){this.level=t,this.resolution=i,this.scale=r,this.origin=s,this.first=n,this.last=c,this.size=o,this.norm=f,this.worldStart=g,this.worldEnd=S,this.worldSize=I,this.wrap=A}normalizeCol(t){if(!this.wrap)return t;const i=this.worldSize[0];return t<0?i-1-Math.abs((t+1)%i):t%i}denormalizeCol(t,i){return this.wrap?this.worldSize[0]*i+t:t}getWorldForColumn(t){return this.wrap?Math.floor(t/this.worldSize[0]):0}getFirstColumnForWorld(t){return t*this.worldSize[0]+this.first[0]}getLastColumnForWorld(t){return t*this.worldSize[0]+this.first[0]+this.size[0]-1}getColumnForX(t){return(t-this.origin[0])/this.norm[0]}getXForColumn(t){return this.origin[0]+t*this.norm[0]}getRowForY(t){return(this.origin[1]-t)/this.norm[1]}getYForRow(t){return this.origin[1]-t*this.norm[1]}getTileBounds(t,i,r=!1){Sa.set(i);const s=r?Sa.col:this.denormalizeCol(Sa.col,Sa.world),n=Sa.row;return qoe(t,this.getXForColumn(s),this.getYForRow(n+1),this.getXForColumn(s+1),this.getYForRow(n)),t}getTileCoords(t,i,r=!1){Sa.set(i);const s=r?Sa.col:this.denormalizeCol(Sa.col,Sa.world);return Array.isArray(t)?rd(t,this.getXForColumn(s),this.getYForRow(Sa.row)):(t.x=this.getXForColumn(s),t.y=this.getYForRow(Sa.row)),t}},o_=class{constructor(){this.spans=[]}acquire(t){this.lodInfo=t}release(){this.lodInfo=null,this.spans.length=0}*keys(){const t=this.lodInfo;for(const{row:i,colFrom:r,colTo:s}of this.spans)for(let n=r;n<=s;n++){const c=t.getWorldForColumn(n);yield new Fl(t.level,i,t.normalizeCol(n),c)}}forEach(t,i){const{spans:r,lodInfo:s}=this,{level:n}=s;if(r.length!==0)for(const{row:c,colFrom:o,colTo:f}of r)for(let g=o;g<=f;g++)t.call(i,n,c,s.normalizeCol(g),s.getWorldForColumn(g))}};o_.pool=new Pp(o_);let nT=class{constructor(t,i,r){this.row=t,this.colFrom=i,this.colTo=r}};const dr=new Fl("0/0/0/0");let Woe=class MB{static create(t,i){t[1]>i[1]&&([t,i]=[i,t]);const[r,s]=t,[n,c]=i,o=n-r,f=c-s,g=f!==0?o/f:0,S=(Math.ceil(s)-s)*g,I=(Math.floor(s)-s)*g;return new MB(r,Math.floor(s),Math.ceil(c),g,o<0?S:I,o<0?I:S,o<0?n:r,o<0?r:n)}constructor(t,i,r,s,n,c,o,f){this.x=t,this.ymin=i,this.ymax=r,this.invM=s,this.leftAdjust=n,this.rightAdjust=c,this.leftBound=o,this.rightBound=f}incrRow(){this.x+=this.invM}getLeftCol(){return Math.max(this.x+this.leftAdjust,this.leftBound)}getRightCol(){return Math.min(this.x+this.rightAdjust,this.rightBound)}};const fo=[[0,0],[0,0],[0,0],[0,0]],Zoe=1e-6;let Yoe=class{constructor(t,i=null,r=t.lods[0].level,s=t.lods[t.lods.length-1].level){this.tileInfo=t,this.fullExtent=i,this.scales=[],this._infoByScale={},this._infoByLevel={};const n=t.lods.filter(o=>o.level>=r&&o.level<=s);this.minScale=n[0].scale,this.maxScale=n[n.length-1].scale;const c=this._lodInfos=n.map(o=>Hoe.create(t,o,i));n.forEach((o,f)=>{this._infoByLevel[o.level]=c[f],this._infoByScale[o.scale]=c[f],this.scales[f]=o.scale},this),this._wrap=t.isWrappable}get spatialReference(){return this.tileInfo.spatialReference}getLODInfoAt(t){return this._infoByLevel[typeof t=="number"?t:t.level]}getTileBounds(t,i,r=!1){dr.set(i);const s=this._infoByLevel[dr.level];return s?s.getTileBounds(t,dr,r):t}getTileCoords(t,i,r=!1){dr.set(i);const s=this._infoByLevel[dr.level];return s?s.getTileCoords(t,dr,r):t}getTileCoverage(t,i=192,r=!0,s="closest"){if(!r&&(t.scale>this.minScale||t.scale100)return null;let H=[];for(f=I;f=0;Q--){const ve=H[Q];g=Math.min(g,ve.getLeftCol()),S=Math.max(S,ve.getRightCol())}if(g=Math.floor(g),S=Math.floor(S),f>=n.first[1]&&f<=n.last[1])if(o)if(n.size[0]n.last[0]||S=0;Q--){const ve=H[Q];ve.ymax>=f?ve.incrRow():H.splice(Q,1)}}return c}getTileParentId(t){dr.set(t);const i=this._infoByLevel[dr.level],r=this._lodInfos.indexOf(i)-1;return r<0?null:(this._getTileIdAtLOD(dr,this._lodInfos[r],dr),dr.id)}getTileResolution(t){const i=this._infoByLevel[typeof t=="object"?t.level:t];return i?i.resolution:-1}getTileScale(t){const i=this._infoByLevel[t.level];return i?i.scale:-1}intersects(t,i){dr.set(i);const r=this._infoByLevel[dr.level],s=t.lodInfo;if(s.resolution>r.resolution){this._getTileIdAtLOD(dr,s,dr);const c=s.denormalizeCol(dr.col,dr.world);for(const o of t.spans)if(o.row===dr.row&&o.colFrom<=c&&o.colTo>=c)return!0}if(s.resolution(V[0]=Math.min(V[0],H.row),V[1]=Math.max(V[1],H.row),V[2]=Math.min(V[2],H.colFrom),V[3]=Math.max(V[3],H.colTo),V),[1/0,-1/0,1/0,-1/0]),S=r.denormalizeCol(dr.col,dr.world),I=s.getColumnForX(r.getXForColumn(S)),A=s.getRowForY(r.getYForRow(dr.row)),O=s.getColumnForX(r.getXForColumn(S+1))-1,z=s.getRowForY(r.getYForRow(dr.row+1))-1;return!(I>g||Oo||zc.row===dr.row&&c.colFrom<=n&&c.colTo>=n)}normalizeBounds(t,i,r){if(t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],this._wrap){const s=ro(this.tileInfo.spatialReference),n=-r*(s.valid[1]-s.valid[0]);t[0]+=n,t[2]+=n}return t}getSmallestInfoForScale(t){const i=this.scales;if(this._infoByScale[t])return this._infoByScale[t];if(t>i[0])return this._infoByScale[i[0]];for(let r=1;ri[r]+Zoe)return this._infoByScale[i[r-1]];return this._infoByScale[i[i.length-1]]}getClosestInfoForScale(t){const i=this.scales;return this._infoByScale[t]||(t=i.reduce((r,s)=>Math.abs(s-t)=0;r--)if(tt.push(i)),this._controllers.clear(),t.forEach(i=>i.abort()),this._processingItems.clear(),this._cancelNext()}forEach(t){this._deferreds.forEach((i,r)=>t(r))}get(t){const i=this._deferreds.get(t);return i?i.promise:void 0}isOngoing(t){return this._processingItems.has(t)}has(t){return this._deferreds.has(t)}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(t,i){const r=this.get(t);if(r)return r;const s=new AbortController;let n=null;i&&(n=io(i,()=>s.abort()));const c=()=>{const S=this._processingItems.get(t);S&&S.controller.abort(),o(),g.reject(jr())},o=()=>{f.remove(),n!=null&&n.remove(),this._removeItem(t),this._queue.remove(t),this._scheduleNext()},f=iA(s.signal,c),g=sa();return this._deferreds.set(t,g),this._controllers.set(t,s),g.promise.then(o,o),this._queue.push(t),this._scheduleNext(),g.promise}last(){return this._queue.last()}lastPromise(){const t=this.last();return t?this.get(t):null}peek(){return this._queue.peek()}popLast(){var i;const t=this._queue.popLast();return t&&((i=this._deferreds.get(t))==null||i.reject(jr("Removed from queue")),this._removeItem(t)),t}reset(){const t=[];this._processingItems.forEach(i=>t.push(i)),this._processingItems.clear();for(const i of t)this._queue.push(i.item),i.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const t=[];for(;this._queue.length;)t.push(this._queue.pop());return this.clear(),t}get running(){return!this._pausedSignal.value&&this._queue.length>0&&this._processingItems.size0&&this._processingItems.size{this._schedule=null,this._next()}))}_next(){for(;this._queue.length>0&&this._processingItems.sizethis._processResult(s,n),n=>this._processError(s,n))):this._processResult(s,i)}get test(){return{update:t=>this.runTask(t)}}};function Xoe(e,t){return e.length=0,t.forEach(i=>e.push(i)),e}const oT=new Set,Tv=[],Af=new Map,WR=[0,0];let Gu=class extends Nt{constructor(t){super(t),this._keyToItem=new Map,this.concurrency=6,this.strategy="scale-first",this.tileInfoView=null}initialize(){const{concurrency:t,process:i,strategy:r}=this;this._queue=new Koe({concurrency:t,process:(s,n)=>{const c=this._keyToItem.get(s);return i(c,{signal:n})},peeker:r==="scale-first"?s=>this._peekByScaleFirst(s):s=>this._peekByCenterFirst(s)})}destroy(){this.clear(),this._queue=lr(this._queue)}get length(){return this._queue?this._queue.length:0}get onGoingCount(){return this._keyToItem.size}abort(t){const i=typeof t=="string"?t:t.id;this._queue.abort(i)}clear(){this._queue.clear(),this._keyToItem.clear()}has(t){return typeof t=="string"?this._keyToItem.has(t):this._keyToItem.has(t.id)}isOngoing(t){const i=typeof t=="string"?t:t.id;return this.has(i)&&this._queue.isOngoing(i)}pause(){this._queue.pause()}push(t){const i=t.key.id;if(this._queue.has(i))return this._queue.get(i);const r=this._queue.push(i),s=()=>{this._keyToItem.delete(i)};return this._keyToItem.set(i,t),r.then(s,s),r}reset(){this._queue.reset()}resume(){this._queue.resume()}_peekByScaleFirst(t){if(!this.state)return t.values().next().value;const i=this.tileInfoView;let r=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;t.forEach(S=>{const I=this._keyToItem.get(S),A=this.tileInfoView.getTileScale(I.key);Af.has(A)||(Af.set(A,[]),r=Math.max(A,r),s=Math.min(A,s)),Af.get(A).push(I.key),oT.add(A)});let n=this.state.scale;Af.has(n)||(Xoe(Tv,oT),Tv.sort((S,I)=>S-I),n=Tv.reduce((S,I)=>Math.abs(I-n){const A=o.denormalizeCol(S.col,S.world),O=o.denormalizeCol(I.col,I.world);return Math.sqrt((f-A)*(f-A)+(g-S.row)*(g-S.row))-Math.sqrt((f-O)*(f-O)+(g-I.row)*(g-I.row))}),oT.clear(),Af.clear(),c[0].id}_peekByCenterFirst(t){if(!this.state)return t.values().next().value;const i=this.tileInfoView,r=this.state.center;let s,n=Number.POSITIVE_INFINITY;return t.forEach(c=>{const o=this._keyToItem.get(c);i.getTileCoords(WR,o.key);const f=Qx(WR,r);fthis.maxSize&&n>=0;)n!==t&&(s=this._pruneAroundCenterTile(s,i,r,n)),n--;s>this.maxSize&&(s=this._pruneAroundCenterTile(s,i,r,t))}_pruneAroundCenterTile(t,i,r,s){const n=this._tileKeysPerLevel[s];if(!n||n.length===0)return t;const{size:c,origin:o}=this._tileInfoView.tileInfo,f=r*c[0],g=r*c[1],S=[0,0],I=[0,0];for(n.sort((A,O)=>(S[0]=o.x+f*(A.col+.5),S[1]=o.y-g*(A.row+.5),I[0]=o.x+f*(O.col+.5),I[1]=o.y-g*(O.row+.5),Uw(S,i)-Uw(I,i)));n.length>0;){const A=n.pop();if(this._removeTile(A.id),--t===this.maxSize)break}return t}_removeTile(t){const i=this._tilePerId.get(t);this._removedFunc&&i&&this._removedFunc(i),ZR(this._tilePerId,t)}};function ZR(e,t){e.delete(t)}const sd=new Fl(0,0,0,0),pc=new Map,nd=[],aT=[];let U1e=class{constructor(t){this._previousScale=Number.POSITIVE_INFINITY,this.cachePolicy="keep",this.coveragePolicy="closest",this.resampling=!0,this.tileIndex=new Map,this.tiles=[],this.buffer=192,this.acquireTile=t.acquireTile,this.releaseTile=t.releaseTile,this.tileInfoView=t.tileInfoView,t.resampling!=null&&(this.resampling=t.resampling),t.cachePolicy&&(this.cachePolicy=t.cachePolicy),t.coveragePolicy&&(this.coveragePolicy=t.coveragePolicy),t.buffer!=null&&(this.buffer=t.buffer),t.cacheSize&&(this._tileCache=new Qoe(t.cacheSize,this.tileInfoView,i=>{this.releaseTile(i)}))}destroy(){this.tileIndex.clear()}update(t){var Q,ve;const{resampling:i,tileIndex:r}=this,{scale:s,center:n,resolution:c}=t.state,{minScale:o,maxScale:f}=this.tileInfoView,g=!t.stationary&&s>this._previousScale;if(this._previousScale=s,!i&&(s>o||sme.visible=!0);let z=0,V=0;if(I.length>0)for(const{row:me,colFrom:ge,colTo:Ie}of I)for(let Ce=ge;Ce<=Ie;Ce++){z++;const ze=sd.set(O,me,A.normalizeCol(Ce),A.getWorldForColumn(Ce)).id;let je=r.get(ze);if(je)je.isReady?(pc.set(ze,je),V++):g||this._addParentTile(ze,pc);else{if((Q=this._tileCache)!=null&&Q.has(ze)){if(je=this._tileCache.pop(ze),this.tileIndex.set(ze,je),je.isReady){pc.set(ze,je),V++;continue}}else je=this.acquireTile(sd),this.tileIndex.set(ze,je);g||this._addParentTile(ze,pc)}}const H=V===z;for(const[me,ge]of r){if(pc.has(me))continue;sd.set(me);const Ie=this.tileInfoView.intersects(S,sd),Ce=this.cachePolicy==="purge"?sd.level!==O:sd.level>O;!Ie||!g&&H?!Ce&&Ie||nd.push(ge):ge.isReady?Ce&&this.cachePolicy==="purge"&&this._hasReadyAncestor(sd,O)?nd.push(ge):aT.push(ge):Ce&&nd.push(ge)}for(const me of aT)me.isReady&&pc.set(me.key.id,me);for(const me of nd)this._tileCache?this._tileCache.add(me):this.releaseTile(me),r.delete(me.key.id);for(const me of pc.values())this.tiles.push(me);for(const me of r.values())pc.has(me.key.id)||(me.visible=!1);(ve=this._tileCache)==null||ve.prune(O,n,c),o_.pool.release(S),aT.length=0,nd.length=0,pc.clear()}clear(){const{tileIndex:t}=this;for(const i of t.values())this.releaseTile(i);t.clear()}refresh(t){var i;for(const r of this.tileIndex.values())this.tiles.includes(r)?t(r):nd.push(r);for(const r of nd)this.releaseTile(r),this.tileIndex.delete(r.key.id);(i=this._tileCache)==null||i.clear()}updateCacheSize(t){this._tileCache&&(this._tileCache.maxSize=t)}_addParentTile(t,i){var n;let r=t,s=null;for(;r=this.tileInfoView.getTileParentId(r),r;)if(this.tileIndex.has(r)){if(s=this.tileIndex.get(r),s==null?void 0:s.isReady){i.has(s.key.id)||i.set(s.key.id,s);break}}else if((n=this._tileCache)!=null&&n.has(r)&&(s=this._tileCache.pop(r),this.tileIndex.set(r,s),s==null?void 0:s.isReady)){i.has(s.key.id)||i.set(s.key.id,s);break}}_hasReadyAncestor(t,i){const r=eo();this.tileInfoView.getTileBounds(r,t,!0);for(const s of this.tileIndex.values())if(s.isReady&&s.key.level>=i&&s.key.level=2}function Bae(e){return Array.isArray(e)&&e.length>=2}function Ev(e){return Fae(e)||Bae(e)}var bI;const cn=[0,0];let qu=bI=class extends At{constructor(e){super(e),this._viewpoint2D={center:Vr(),rotation:0,scale:0,spatialReference:void 0},this.center=[0,0],this.extent=new Ui,this.id=0,this.inverseTransform=zc(),this.resolution=0,this.rotation=0,this.scale=0,this.transform=zc(),this.transformNoRotation=zc(),this.displayMat3=Ab(),this.displayViewMat3=Ab(),this.viewMat3=Ab(),this.viewMat2d=IB(),this.worldScreenWidth=0,this.size=[0,0]}set pixelRatio(e){this._set("pixelRatio",e),this._update()}set size(e){this._set("size",e),this._update()}set viewpoint(e){if(e){const t=this._viewpoint2D,i=e.targetGeometry;t.center[0]=i.x,t.center[1]=i.y,t.rotation=e.rotation,t.scale=e.scale,t.spatialReference=i.spatialReference}this._update()}copy(e){const t=this.size,i=this.viewpoint;return i&&t?(this.viewpoint=Qa(i,e.viewpoint),this._set("size",s_(t,e.size))):(this.viewpoint=e.viewpoint.clone(),this._set("size",[e.size[0],e.size[1]])),this._set("pixelRatio",e.pixelRatio),this}clone(){return new bI({size:this.size,viewpoint:this.viewpoint.clone(),pixelRatio:this.pixelRatio})}toMap(e,t,i){return Ev(t)?La(e,t,this.inverseTransform):(cn[0]=t,cn[1]=i,La(e,cn,this.inverseTransform))}toScreen(e,t,i){return Ev(t)?La(e,t,this.transform):(cn[0]=t,cn[1]=i,La(e,cn,this.transform))}toScreenNoRotation(e,t,i){return Ev(t)?La(e,t,this.transformNoRotation):(cn[0]=t,cn[1]=i,La(e,cn,this.transformNoRotation))}toScreenClosest(e,t,i){Ev(t)?(cn[0]=t[0],cn[1]=t[1]):(cn[0]=t,cn[1]=i);const[r]=cn,{center:s,extent:n,spatialReference:c,transform:o}=this;return(rn.xmax)&&(cn[0]=pB(r,s[0],c)),La(e,cn,o)}getScreenTransform(e,t){const{center:i}=this._viewpoint2D,r=this._get("pixelRatio")||1,s=this._get("size");return W3(e,i,s,t,0,r),e}_update(){const{center:e,spatialReference:t,scale:i,rotation:r}=this._viewpoint2D,s=this._get("pixelRatio")||1,n=this._get("size"),c=new kl({targetGeometry:new ri(e[0],e[1],t),scale:i,rotation:r});if(this._set("viewpoint",c),!n||!t||!i)return;this.resolution=Km(c),this.rotation=r,this.scale=i,this.spatialReference=t,s_(this.center,e);const o=n[0]!==0?2/n[0]:0,f=n[1]!==0?-2/n[1]:0;PB(this.displayMat3,o,0,0,0,f,0,-1,1,1);const g=CB(this.viewMat3),S=Nm(n[0]/2,n[1]/2),I=Nm(-n[0]/2,-n[1]/2),A=FA(r);vI(g,g,S),$B(g,g,A),vI(g,g,I),Y3(this.displayViewMat3,this.displayMat3,g);const O=V3(this.viewMat2d,S);return Xx(O,O,A),r_(O,O,I),Toe(this.extent,c,n),Z3(this.transform,c,n,s),U3(this.inverseTransform,this.transform),$oe(this.transformNoRotation,c,n,s),this.worldScreenWidth=Roe(this.spatialReference,this.resolution),this._set("id",this.id+1),this}};v([M({readOnly:!0})],qu.prototype,"id",void 0),v([M({value:1,json:{write:!0}})],qu.prototype,"pixelRatio",null),v([M({json:{write:!0}})],qu.prototype,"size",null),v([M()],qu.prototype,"spatialReference",void 0),v([M({type:kl,json:{write:!0}})],qu.prototype,"viewpoint",null),qu=bI=v([fe("esri.views.2d.ViewState")],qu);const YR=qu;var wI,xI;let Rc=wI=class extends Nt{constructor(){super(...arguments),this.left=0,this.top=0,this.right=0,this.bottom=0}clone(){return new wI({left:this.left,top:this.top,right:this.right,bottom:this.bottom})}};v([M()],Rc.prototype,"left",void 0),v([M()],Rc.prototype,"top",void 0),v([M()],Rc.prototype,"right",void 0),v([M()],Rc.prototype,"bottom",void 0),Rc=wI=v([fe("esri.views.2d.PaddedViewState.Padding")],Rc);let Wf=xI=class extends YR{constructor(...e){super(...e),this.paddedViewState=new YR,this._updateContent=(()=>{const t=Vr();return()=>{const i=this._get("size"),r=this._get("padding");if(!i||!r)return;const s=this.paddedViewState;Cs(t,r.left+r.right,r.top+r.bottom),n_(t,i,t),s_(s.size,t);const n=s.viewpoint;n&&(this.viewpoint=n)}})(),this.addHandles(ti(()=>[this.size,this.padding],()=>this._updateContent(),Tp)),this.padding=new Rc,this.size=[0,0]}set padding(e){this._set("padding",e||new Rc)}set viewpoint(e){if(e){const t=e.clone();this.paddedViewState.viewpoint=e,Loe(t,e,this._get("size"),this._get("padding"));const i=this._viewpoint2D,r=t.targetGeometry;i.center[0]=r.x,i.center[1]=r.y,i.rotation=t.rotation,i.scale=t.scale,i.spatialReference=r.spatialReference,this._update()}}clone(){return new xI({padding:this.padding.clone(),size:this.size.slice(),viewpoint:this.paddedViewState.viewpoint.clone(),pixelRatio:this.pixelRatio})}};v([M()],Wf.prototype,"paddedViewState",void 0),v([M({type:Rc})],Wf.prototype,"padding",null),v([M()],Wf.prototype,"viewpoint",null),Wf=xI=v([fe("esri.views.2d.PaddedViewState")],Wf);const Uae=Wf;let Pn=class extends Nt{constructor(t){super(t),this.constraints=null,this.ready=!1,this.resizeAlign="center",this.addHandles([ti(()=>{var i;return(i=this.constraints)==null?void 0:i.version},i=>{this.constraints&&i&&this.ready&&(this.state.viewpoint=this.constraints.fit(this.state.paddedViewState.viewpoint))},Tp)])}get center(){if(!this.ready)return this._get("center");const{center:t,spatialReference:i}=this.state.paddedViewState;return this.state.commitProperty("id"),new ri({x:t[0],y:t[1],spatialReference:i})}set center(t){if(t==null)return;if(!this.ready)return void this._set("center",t);let i;try{i=this._project(t,this.state.spatialReference)}catch(s){return void _t.getLogger(this).error(new Je("mapview:invalid-center","could not project the value in the view's spatial reference",{input:t,error:s}))}const r=this.viewpoint;mI(r,r,i),this.viewpoint=r}get extent(){return this.ready?(this.state.commitProperty("id"),this.state.paddedViewState.extent.clone()):this._get("extent")}set extent(t){if(t==null)return;if(!t.width||!t.height)return void _t.getLogger(this).error(new Je("mapview:invalid-extent","invalid extent size"));if(!this.ready)return this._set("extent",t),this._set("center",void 0),this._set("viewpoint",void 0),this._set("scale",void 0),void this._set("zoom",void 0);let i;try{i=this._project(t,this.state.spatialReference)}catch(s){return void _t.getLogger(this).error(new Je("mapview:invalid-extent","could not project the value in the view's spatial reference",{error:s}))}const r=this.viewpoint;Eoe(r,r,i,this.state.size,{constraints:this.constraints}),this.viewpoint=r}get padding(){return this.ready?this.state.padding:this._get("padding")}set padding(t){this.ready?(this.state.padding=t,this._set("padding",this.state.padding)):this._set("padding",t)}get resolution(){return this.ready?(this.state.commitProperty("id"),this.state.resolution):0}get rotation(){return this.ready?(this.state.commitProperty("id"),this.state.rotation):this._get("rotation")}set rotation(t){if(isNaN(t))return;if(!this.ready)return void this._set("rotation",t);const i=this.viewpoint;Noe(i,i,t),this.viewpoint=i}get scale(){return this.ready?(this.state.commitProperty("id"),this.state.scale):this._get("scale")}set scale(t){if(!t||isNaN(t))return;if(!this.ready){this._set("scale",t),this._set("zoom",void 0);const r=this._get("extent");return void(r&&(this._set("extent",void 0),this._set("center",r.center)))}const i=this.viewpoint;GR(i,i,t),this.viewpoint=i}get viewpoint(){return this.ready?this.state.paddedViewState.viewpoint.clone():this._get("viewpoint")}set viewpoint(t){var n;if(t==null)return;if(!this.ready)return this._set("viewpoint",t),this._set("extent",void 0),this._set("center",void 0),this._set("zoom",void 0),void this._set("scale",void 0);let i,r;try{i=this._project(t,this.state.spatialReference),!t.scale||isNaN(t.scale)?r=new Je("mapview:invalid-viewpoint",`invalid scale value of ${t.scale}`):t.targetGeometry==null&&(r=new Je("mapview:invalid-viewpoint","geometry not defined"))}catch(c){r=new Je("mapview:invalid-viewpoint","could not project the value in the view's spatial reference",{error:c})}if(r)return void _t.getLogger(this).error(r);this._scaleBeforeChangingSpatialReference=null;const s=new kl({targetGeometry:new ri,scale:0,rotation:0});Qa(s,i),(n=this.constraints)==null||n.constrain(s,this.state.paddedViewState.viewpoint),this.state.viewpoint=s,this._set("viewpoint",s)}get zoom(){var t;return this.ready?((t=this.constraints)==null?void 0:t.scaleToZoom(this.scale))??-1:this._get("zoom")}set zoom(t){var s,n;if(!(t>=0))return;if(!this.ready){this._set("zoom",t),this._set("scale",void 0);const c=this._get("extent");return void(c&&(this._set("extent",void 0),this._set("center",c.center)))}const i=((s=this.constraints)==null?void 0:s.zoomToScale(t))??0;if(!i)return void this._set("zoom",-1);const r=this.viewpoint;GR(r,r,i),this.viewpoint=r,this._set("zoom",((n=this.constraints)==null?void 0:n.scaleToZoom(this.scale))??-1)}getUserStartupOptions(t){if(!t[0]&&!t[1])return{center:void 0,rotation:void 0,scale:void 0};const{padding:i,constraints:r}=this,s=this._get("center"),n=this._get("extent"),c=this._get("scale"),o=this._get("rotation"),f=this._get("viewpoint"),g=this._get("zoom"),S=g!=null&&r!=null&&r.zoomToScale(g)||void 0;let I,A,O;const z=f==null?void 0:f.rotation,V=f==null?void 0:f.targetGeometry;(V==null?void 0:V.type)==="extent"?I=V:(V==null?void 0:V.type)==="point"&&(A=V,O=f==null?void 0:f.scale);const H=n??I;return{center:s??A??(H==null?void 0:H.center),rotation:o??z,scale:(c??S??O??(H&&_m(H,[t[0]-i.left-i.right,t[1]-i.top-i.bottom])))||void 0}}startup(t,i,r,s){var c;const n=t.targetGeometry;try{this._project(t,r)}catch(o){_t.getLogger(this).warn(new jc("mapview:startup-projection-error","projection of initial viewpoint to the view's spatial reference, defaulting to the initial viewpoint.",{center:n.toJSON(),spatialReference:r,error:o})),t.targetGeometry=s||new ri({x:0,y:0,spatialReference:r})}(c=this.constraints)==null||c.fit(t),this._set("state",new Uae({padding:this.padding,size:i,viewpoint:t})),this._set("ready",!0)}teardown(){this._set("ready",!1);const{center:[t,i],spatialReference:r,rotation:s,scale:n}=this.state.paddedViewState,c=new ri({x:t,y:i,spatialReference:r});this._set("viewpoint",null),this._set("extent",null),this._set("center",c),this._set("zoom",-1),this._set("rotation",s),this._set("scale",n),this._set("state",null)}changeSpatialReference(t){var f;const i=this.state.paddedViewState.clone();if(this._scaleBeforeChangingSpatialReference==null)this._scaleBeforeChangingSpatialReference=i.scale;else{const g=i.viewpoint.clone();g.scale=this._scaleBeforeChangingSpatialReference,i.viewpoint=g}const r=i.clone(),[s,n]=i.center;let c=null;try{c=this._project(new ri({x:s,y:n,spatialReference:i.spatialReference}),t)}catch(g){EA()||_t.getLogger(this).warn(new jc("mapview:spatial-reference-change","could not project the view's center to the new spatial reference",{center:c==null?void 0:c.toJSON(),spatialReference:t,error:g}))}c||(c=new ri({x:0,y:0,spatialReference:t}));const o=mI(new kl({targetGeometry:new ri,scale:0,rotation:0}),i.viewpoint,c);r.viewpoint=o;try{const S=[i.size[0]/2,i.size[1]/2],I=[S[0]+20,S[1]],A=i.toMap([0,0],I),{x:O,y:z}=this._project(new ri({x:A[0],y:A[1],spatialReference:i.spatialReference}),t);A[0]=O,A[1]=z,r.toScreen(A,A);const V=Ooe(S,A,I),H=Math.hypot(A[0]-S[0],A[1]-S[1])/20;!Number.isFinite(H)||Math.abs(H)>4?(o.rotation=0,o.targetGeometry=new ri({x:0,y:0,spatialReference:t})):(o.scale*=H,o.scale>Le("mapview-srswitch-adjust-rotation-scale-threshold")?o.rotation=0:o.rotation+=Number.isFinite(V)?V:0)}catch{}(f=this._get("constraints"))==null||f.constrain(o,void 0),this._get("state").viewpoint=o}resize(t,i){var c;if(!this.ready)return;const r=this.state;let s=this.state.paddedViewState.viewpoint;const n=this.state.paddedViewState.size.concat();r.size=[t,i],Doe(s,s,n,this.state.paddedViewState.size,this.resizeAlign),s=((c=this.constraints)==null?void 0:c.constrain(s,void 0))??s,this.state.viewpoint=s}toMap(t){if(!this.ready)return null;const i=[0,0],[r,s]=this.state.toMap(i,[t.x,t.y]),n=this.state.spatialReference;return new ri({x:r,y:s,spatialReference:n})}toScreen(t,i){if(!this.ready)return null;const r=this._project(t,this.state.spatialReference),s=[r.x,r.y];return(i==null?void 0:i.pickClosestTarget)===!1?this.state.toScreen(s,s):this.state.toScreenClosest(s,s),Dn(s[0],s[1])}_project(t,i){var n;const r=(t==null?void 0:t.targetGeometry)||t;if(!i)return t;if(!r)return null;if(i.imageCoordinateSystem||(n=r.spatialReference)!=null&&n.imageCoordinateSystem||Js(i,r.spatialReference))return t;const s=Ph(r,i);if(!s)throw new Je("mapview:projection-not-possible","projecting input geometry to target spatial reference returned a null value",{geometry:r,spatialReference:i});return jae(t)?(t.targetGeometry=s,t):s}};function jae(e){return(e==null?void 0:e.declaredClass)==="esri.Viewpoint"}v([M({type:ri})],Pn.prototype,"center",null),v([M()],Pn.prototype,"constraints",void 0),v([M({type:Ui})],Pn.prototype,"extent",null),v([M({value:{top:0,right:0,bottom:0,left:0},cast:e=>({top:0,right:0,bottom:0,left:0,...e})})],Pn.prototype,"padding",null),v([M()],Pn.prototype,"ready",void 0),v([M()],Pn.prototype,"resizeAlign",void 0),v([M({readOnly:!0})],Pn.prototype,"resolution",null),v([M({type:Number})],Pn.prototype,"rotation",null),v([M({type:Number})],Pn.prototype,"scale",null),v([M({readOnly:!0})],Pn.prototype,"state",void 0),v([M({type:kl})],Pn.prototype,"viewpoint",null),v([M()],Pn.prototype,"zoom",null),Pn=v([fe("esri.views.2d.ViewStateManager")],Pn);function J3(e,t){switch(t){case"primary":return e.pointerType==="touch"||e.button===0;case"secondary":return e.pointerType!=="touch"&&e.button===2;case"tertiary":return e.pointerType!=="touch"&&e.button===1}}let JR=class extends bs{constructor(t,i){super(!0),this._view=t,this.registerIncoming("double-click",i,r=>this._handleDoubleClick(r,i))}_handleDoubleClick(t,i){J3(t.data,"primary")&&(t.stopPropagation(),i?this._view.mapViewNavigation.zoomOut([t.data.x,t.data.y]):this._view.mapViewNavigation.zoomIn([t.data.x,t.data.y]))}},Vae=class extends bs{constructor(t,i,r){super(!0),this.view=t,this.pointerType=i,this.registerIncoming("double-tap-drag",r,s=>this._handleDoubleTapDrag(s))}_handleDoubleTapDrag(t){const{data:i}=t,{pointerType:r}=i;if(r!==this.pointerType)return;t.stopPropagation();const{action:s,delta:n}=i,{view:c}=this,{mapViewNavigation:o}=c;switch(s){case"begin":{const{scale:f}=c;this._startScale=f,this._currentScale=f,this._previousDelta=n,o.begin();break}case"update":{if(this._previousDelta.y===n.y)return;this._previousDelta=n;const f=1.015**n.y,g=this._startScale*f,S=g/this._currentScale;o.setViewpointImmediate(S),this._currentScale=g;break}case"end":{const{constraints:f}=c,{effectiveLODs:g,snapToZoom:S}=f;if(!S||!g)return void o.end();const I=f.snapScale(this._currentScale),A=(n.y>0?Math.max(I,f.snapToPreviousScale(this._startScale)):Math.min(I,f.snapToNextScale(this._startScale)))/this._currentScale;o.zoom(A);break}}}},t2=class{constructor(t){this._callbacks=t,this._currentCount=0,this._callbacks.condition||(this._callbacks.condition=()=>!0)}handle(t){const i=t.data,r=i.pointers.size;switch(i.action){case"start":this._currentCount=r,this._emitStart(t);break;case"added":this._emitEnd(this._previousEvent),this._currentCount=r,this._emitStart(t);break;case"update":this._emitUpdate(t);break;case"removed":this._startEvent&&this._emitEnd(this._previousEvent),this._currentCount=r,this._emitStart(t);break;case"end":this._emitEnd(t),this._currentCount=0}this._previousEvent=t}_emitStart(t){var i,r;this._startEvent=t,(r=(i=this._callbacks).condition)!=null&&r.call(i,this._currentCount,t)&&this._callbacks.start(this._currentCount,t,this._startEvent)}_emitUpdate(t){var i,r;(r=(i=this._callbacks).condition)!=null&&r.call(i,this._currentCount,t)&&this._callbacks.update(this._currentCount,t,this._startEvent)}_emitEnd(t){var i,r;(r=(i=this._callbacks).condition)!=null&&r.call(i,this._currentCount,t)&&this._callbacks.end(this._currentCount,t,this._startEvent),this._startEvent=null}},Gae=class extends bs{constructor(t,i,r){super(!0),this.view=t,this.pointerAction=i,this.registerIncoming("drag",r,s=>this._handleDrag(s)),this.registerIncoming("pointer-down",()=>this.stopMomentumNavigation())}onInstall(t){super.onInstall(t),this._dragEventSeparator=new t2({start:(i,r)=>{this.view.mapViewNavigation.pan.begin(this.view,r.data),r.stopPropagation()},update:(i,r)=>{this.view.mapViewNavigation.pan.update(this.view,r.data),r.stopPropagation()},end:(i,r)=>{this.view.mapViewNavigation.pan.end(this.view,r.data),r.stopPropagation()},condition:(i,r)=>i===1&&J3(r.data,this.pointerAction)})}_handleDrag(t){const i=this.view.mapViewNavigation;i.pinch.zoomMomentum||i.pinch.rotateMomentum?this.stopMomentumNavigation():this._dragEventSeparator.handle(t)}stopMomentumNavigation(){this.view.mapViewNavigation.pan.stopMomentumNavigation()}},qae=class extends bs{constructor(t,i,r){super(!0),this._view=t,this.pointerAction=i;const s=this._view.mapViewNavigation;this._dragEventSeparator=new t2({start:(n,c)=>{s.rotate.begin(this._view,c.data),c.stopPropagation()},update:(n,c)=>{s.rotate.update(this._view,c.data),c.stopPropagation()},end:(n,c)=>{s.rotate.end(),c.stopPropagation()},condition:(n,c)=>n===1&&J3(c.data,this.pointerAction)}),this.registerIncoming("drag",r,n=>this._dragEventSeparator.handle(n))}};function Ta(e){let t=e*e;return e<0&&(t*=-1),t}function Hae(e){return e.translation[0]=0,e.translation[1]=0,e.translation[2]=0,e.heading=0,e.tilt=0,e}function Wae(e,t,i){const r=i,s=e.state,n=e.device,c=t.tiltDirection==="forward-down"?1:-1,o=1;return n.deviceType==="standard"?(r.translation[0]=Ta(s.axes[0]),r.translation[1]=Ta(s.axes[1]),r.translation[2]=Ta(s.buttons[7])-Ta(s.buttons[6]),r.heading=Ta(s.axes[2]),r.tilt=Ta(s.axes[3])):n.deviceType==="spacemouse"&&(r.translation[0]=1.2*Ta(s.axes[0]),r.translation[1]=1.2*Ta(s.axes[1]),r.translation[2]=2*-Ta(s.axes[2]),r.heading=1.2*Ta(s.axes[5]),r.tilt=1.2*Ta(s.axes[3])),r.tilt*=c,kN(r.translation,r.translation,o),r}function Zae(e){return e.translation[0]===0&&e.translation[1]===0&&e.translation[2]===0&&e.heading===0&&e.tilt===0&&e.zoom===0}let Yae=class extends bs{constructor(t){super(!0),this._view=t,this._frameTask=null,this._watchHandles=new eA,this._currentDevice=null,this._transformation={translation:[0,0,0],heading:0,tilt:0,zoom:0},this._handle=this.registerIncoming("gamepad",i=>this._handleGamePadEvent(i)),this._handle.pause()}onInstall(t){super.onInstall(t),this._watchHandles.add([ti(()=>{var i;return(i=this._view.navigation.gamepad)==null?void 0:i.enabled},i=>{i?(this._handle.resume(),this._frameTask||(this._frameTask=Mm({update:r=>this._frameUpdate(r.deltaTime)}))):(this._handle.pause(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null))},_n)])}onUninstall(){this._watchHandles.removeAll(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null),super.onUninstall()}_handleGamePadEvent(t){const i=this._view.navigation.gamepad.device;i&&t.data.device!==i||this._currentDevice&&this._currentDevice!==t.data.device||(t.data.action==="end"?(this._currentDevice=null,Hae(this._transformation)):(this._currentDevice=t.data.device,Wae(t.data,this._view.navigation.gamepad,this._transformation)))}_frameUpdate(t){const i=this._transformation;if(Zae(i))return;const r=this._view.viewpoint.clone(),s=this._view.navigation.gamepad.velocityFactor,n=Kae*s*t;e2(r,r,[i.translation[0]*n,-i.translation[1]*n]);const c=1+i.translation[2]*Xae*t,o=this._view.constraints.rotationEnabled?-i.heading*Jae*t:0,f=this._view.size,g=[f[0]/2,f[1]];vB(r,r,c,o,g,f);const S=this._view.constraints.constrain(r,this._view.viewpoint);this._view.viewpoint=S}};const Jae=.06,Kae=.7,Xae=6e-4;function zB(e){const t=()=>e(document.visibilityState==="visible");return document.addEventListener("visibilitychange",t),{remove:()=>document.addEventListener("visibilitychange",t)}}let Qae=class extends bs{constructor(t,i,r){super(!0),this.view=t,this.keys=i,this._isSticky=!1,this._pressedKeys=new Set,this._timeout=void 0,this._currentDirection=void 0,this._stickyKeyDuration=200,this._handleKey=s=>{const n=this._keyMap[s.data.key];if(s.modifiers.has("Meta")||s.modifiers.has("Ctrl"))return void this._stopMovement();if(n==null)return;s.stopPropagation(),s.preventDefault();const c=s.type==="key-down";if(this._pressedKeys[c?"add":"delete"](n),c){if(this._direction===n)return;this._direction=n,this._isSticky=!1,this._setTimeout(()=>{this._isSticky&&this._handlePopKey()})}else{const o=this._timeout===void 0,f=this._pressedKeys.size>0;o||f?this._handlePopKey():this._isSticky=!0}},this._handlePopKey=()=>{this._direction=Array.from(this._pressedKeys).pop(),this._direction==null&&this._stopMovement()},this._stopMovement=()=>{this._isSticky=!1,this._direction=void 0,this._pressedKeys.clear(),this._setTimeout(void 0)},this._keyMap={[i.left]:"left",[i.right]:"right",[i.up]:"up",[i.down]:"down"},this.registerIncoming("key-down",r,this._handleKey),this.registerIncoming("key-up",r,this._handleKey),this.registerIncoming("blur",r,this._stopMovement),this._visibilityHandle=zB(s=>s?null:this._stopMovement())}onUninstall(){var t;this._stopMovement(),(t=this._visibilityHandle)==null||t.remove()}get _direction(){return this._currentDirection}set _direction(t){const i=this._currentDirection!=null;if(t!=null){if(i||this.view.mapViewNavigation.begin(),this._currentDirection!==t)switch(t){case"left":this.view.mapViewNavigation.continousPanLeft();break;case"right":this.view.mapViewNavigation.continousPanRight();break;case"up":this.view.mapViewNavigation.continousPanUp();break;case"down":this.view.mapViewNavigation.continousPanDown()}}else i&&this.view.mapViewNavigation.stop();this._currentDirection=t}_setTimeout(t){clearTimeout(this._timeout),this._timeout=t===void 0?void 0:setTimeout(()=>{this._timeout=void 0,t()},this._stickyKeyDuration)}},ele=class extends bs{constructor(t,i,r){super(!0),this.view=t,this.keys=i,this._pressed=!1,this._keyToDirection={[i.clockwiseOption1]:"clockwise",[i.clockwiseOption2]:"clockwise",[i.counterClockwiseOption1]:"counterClockwise",[i.counterClockwiseOption2]:"counterClockwise",[i.resetOption1]:"reset",[i.resetOption2]:"reset"},this.registerIncoming("key-down",r,s=>this._handleKeyDown(s)),this.registerIncoming("key-up",r,s=>this._handleKeyUp(s)),this.registerIncoming("blur",r,()=>this._handleStop()),this._visibilityHandle=zB(s=>s?null:this._handleStop())}onUninstall(){var t;(t=this._visibilityHandle)==null||t.remove(),this._handleStop()}_handleKeyDown(t){t.data.repeat||this._handleKey(t,!0)}_handleKeyUp(t){this._handleKey(t,!1)}_handleStop(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(t,i){const r=t.modifiers;if(r.size>0&&!r.has("Shift")||!this.view.constraints.rotationEnabled)return;const s=this._keyToDirection[t.data.key];if(this._pressed=s!=null,this._pressed){if(t.preventDefault(),i)switch(this.view.mapViewNavigation.begin(),s){case"clockwise":this.view.mapViewNavigation.continousRotateClockwise();break;case"counterClockwise":this.view.mapViewNavigation.continousRotateCounterclockwise();break;case"reset":this.view.mapViewNavigation.resetRotation()}else this._pressed=!1,this.view.mapViewNavigation.stop();t.stopPropagation()}}};var lm;(function(e){e[e.IN=0]="IN",e[e.OUT=1]="OUT"})(lm||(lm={}));let tle=class extends bs{constructor(t,i,r){super(!0),this.view=t,this.keys=i,this._keysToZoomAction={},this.registerIncoming("key-down",r,s=>this._handleKeyDown(s)),i.zoomIn.forEach(s=>this._keysToZoomAction[s]=lm.IN),i.zoomOut.forEach(s=>this._keysToZoomAction[s]=lm.OUT)}_handleKeyDown(t){this._handleKey(t)}_handleKey(t){const i=t.modifiers;if(i.size>0&&!i.has("Shift"))return;const{key:r}=t.data;if(!(r in this._keysToZoomAction))return;const s=this._keysToZoomAction[r],{mapViewNavigation:n}=this.view;let c=null;switch(s){case lm.IN:c=n.zoomIn();break;case lm.OUT:c=n.zoomOut();break;default:return}n.begin(),c.then(()=>n.end()),t.stopPropagation()}};const ile=.6;let rle=class extends bs{constructor(t,i){super(!0),this._view=t,this._canZoom=!0,this.registerIncoming("mouse-wheel",i,r=>this._handleMouseWheel(r))}_handleMouseWheel(t){if(!this._view.navigation.mouseWheelZoomEnabled||(t.preventDefault(),t.stopPropagation(),!this._canZoom))return;const i=this._view.mapViewNavigation,{x:r,y:s,deltaY:n}=t.data,c=1/ile**(1/60*n),o=i.zoom(c,[r,s]);o&&(this._canZoom=!1,o.catch(()=>{}).then(()=>{this._canZoom=!0,i.end()}))}},sle=class extends bs{constructor(t){super(!0),this.view=t,this.registerIncoming("drag",r=>this._handleDrag(r)),this.registerIncoming("pointer-down",()=>this._stopMomentumNavigation());const i=this.view.mapViewNavigation;this._dragEventSeparator=new t2({start:(r,s)=>{i.pinch.begin(this.view,s.data),s.stopPropagation()},update:(r,s)=>{i.pinch.update(this.view,s.data),s.stopPropagation()},end:(r,s)=>{i.pinch.end(this.view),s.stopPropagation()},condition:r=>r>=2})}_handleDrag(t){this._dragEventSeparator.handle(t)}_stopMomentumNavigation(){this.view.mapViewNavigation.pinch.stopMomentumNavigation()}};function KR(e){const t=e.native;return t?{buttons:t.buttons.map(i=>i.pressed?i.value||1:0),axes:t.axes.map(i=>ale(i,e.axisThreshold))}:{buttons:[],axes:[]}}function nle(e,t){if(e.axes.length!==t.axes.length||e.buttons.length!==t.buttons.length)return!1;for(let i=0;i{this._connectGamepad(n.gamepad)},this._onDisconnectGamepad=n=>{const c=n.gamepad,o=c.index,f=this._inputDevices[o];f&&(this._emitGamepadEvent(c,KR(f),!1),this._inputDevices.splice(o,1),this._latestUpdate.splice(o,1),this._input.gamepad.devices.remove(f),this.ensurePollingState())},this._frameTask=null,this._latestUpdate=new Array,this._inputDevices=new Array,this._callback=null;const r="getGamepads"in window.navigator,s=window.isSecureContext;this.supported=r&&s,this.supported&&(this._forEachGamepad(n=>this._connectGamepad(n)),window.addEventListener("gamepadconnected",this._onConnectGamepad),window.addEventListener("gamepaddisconnected",this._onDisconnectGamepad),this.ensurePollingState())}destroy(){this.hasEventListeners=!1,this.supported&&(window.removeEventListener("gamepadconnected",this._onConnectGamepad),window.removeEventListener("gamepaddisconnected",this._onDisconnectGamepad))}set hasEventListeners(t){this._hasEventListeners!==t&&(this._hasEventListeners=t,this.ensurePollingState())}get _eventsEnabled(){return this.supported&&this._inputDevices.length>0&&this._hasEventListeners}set onEvent(t){this._callback=t}_connectGamepad(t){const i=new B3(t);i.deviceType!=="unknown"&&(this._inputDevices[t.index]=i,this._input.gamepad.devices.add(i)),this.ensurePollingState()}ensurePollingState(){this._eventsEnabled?this._startPolling():this._stopPolling()}_startPolling(){this._frameTask==null&&(this._frameTask=Mm({update:()=>this._readGamepadState()}))}_stopPolling(){this._frameTask!=null&&(this._frameTask.remove(),this._frameTask=null,this._latestUpdate=new Array)}_readGamepadState(){const t=document.hasFocus(),i=this._element.contains(document.activeElement),r=this._input.gamepad.enabledFocusMode==="document"&&!t||this._input.gamepad.enabledFocusMode==="view"&&!i;this._forEachGamepad(s=>{const n=this._inputDevices[s.index];if(!n)return;const c=this._latestUpdate[s.index],o=KR(n),f=r||ole(o);c&&(c.timestamp===s.timestamp||!c.active&&f||nle(c.state,o))||this._emitGamepadEvent(s,o,!f)})}_forEachGamepad(t){const i=window.navigator.getGamepads();for(let r=0;r{},this._activePointerCaptures=new Set,this._keyDownState=new Set,this._eventId=1,this._browserTouchPanningEnabled=!1,this._element=t,t.getAttribute("tabindex")||t.setAttribute("tabindex","0"),this._eventHandlers={"key-down":this._handleKey,"key-up":this._handleKey,"pointer-down":this._handlePointer,"pointer-move":this._handlePointerPreventDefault,"pointer-up":this._handlePointerPreventDefault,"pointer-enter":this._handlePointer,"pointer-leave":this._handlePointer,"pointer-cancel":this._handlePointer,"mouse-wheel":this._handleMouseWheel,"pointer-capture-lost":this._handlePointerCaptureLost},this._updateTouchAction(),this._element.addEventListener("keydown",this._preventAltKeyDefault),this._gamepadSource=new lle(t,this._input),this._gamepadSource.onEvent=r=>this._callback("gamepad",r)}destroy(){this._callback=()=>{},this.activeEvents=null,this._activePointerCaptures.forEach(t=>{this._releasePointerCaptureSafe(t)}),this._gamepadSource=lr(this._gamepadSource),this._activePointerCaptures=null,this._removeTouchAction(),this._element.removeEventListener("keydown",this._preventAltKeyDefault)}get browserTouchPanningEnabled(){return this._browserTouchPanningEnabled}set browserTouchPanningEnabled(t){this._browserTouchPanningEnabled=t,this._updateTouchAction(),this._updateTouchEventHandling()}set onEventReceived(t){this._callback=t}set activeEvents(t){for(const i in this._active)if(!t||!t.has(i)){const r=this._active[i];this._element.removeEventListener(lT[i],r),delete this._active[i]}t&&t.forEach(i=>{if(!this._active[i]&&lT[i]){const r=(this._eventHandlers[i]||this._handleDefault).bind(this,i);this._element.addEventListener(lT[i],r),this._active[i]=r}}),this._gamepadSource.hasEventListeners=(t==null?void 0:t.has("gamepad"))??!1}setPointerCapture(t,i){i?this._setPointerCatpureSafe(t.pointerId):(this._releasePointerCaptureSafe(t.pointerId),this._activePointerCaptures.delete(t.pointerId))}_updateTouchAction(){this._element.classList.remove(this._browserTouchPanningEnabled?Pf.touchNone:Pf.touchPan),this._element.classList.add(this._browserTouchPanningEnabled?Pf.touchPan:Pf.touchNone)}_updateTouchEventHandling(){this._browserTouchPanningEnabled?this._element.addEventListener("touchmove",this._preventMultiTouchPanning):this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_removeTouchAction(){this._element.classList.remove(Pf.touchNone),this._element.classList.remove(Pf.touchPan),this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_setPointerCatpureSafe(t){try{this._element.setPointerCapture(t),this._activePointerCaptures.add(t)}catch{}}_releasePointerCaptureSafe(t){try{if(this._element.hasPointerCapture&&!this._element.hasPointerCapture(t))return;this._element.releasePointerCapture(t)}catch{}}_updateNormalizedPointerLikeEvent(t,i){const r=N8(this._element,t);return BB.test.disableSubpixelCoordinates&&(r.x=Math.round(r.x),r.y=Math.round(r.y)),i.x=r.x,i.y=r.y,i}_handleKey(t,i){const{key:r}=i;r&&t==="key-up"&&this._keyDownState.delete(r);const s={native:i,key:r,repeat:!!r&&this._keyDownState.has(r)};r&&t==="key-down"&&this._keyDownState.add(s.key),this._callback(t,s)}_handlePointer(t,i){const r=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,pointerType:i.pointerType,button:i.button,buttons:i.buttons,eventId:this._eventId++});this._callback(t,r)}_handlePointerPreventDefault(t,i){const r=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,pointerType:i.pointerType,button:i.button,buttons:i.buttons,eventId:this._eventId++});i.preventDefault(),this._callback(t,r)}_handleMouseWheel(t,i){let r=i.deltaY;switch(i.deltaMode){case 0:XR&&(r=r/document.documentElement.clientHeight*600);break;case 1:r*=30;break;case 2:r*=900}XR?r*=.7:cle||hle?r*=.6:ule&&(r*=1.375);const s=100,n=Math.abs(r);n>s&&(r=r/n*200/(1+Math.exp(-.02*(n-s))));const c=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,deltaY:r});this._callback(t,c)}_handlePointerCaptureLost(t,i){this._activePointerCaptures.delete(i.pointerId),this._handleDefault(t,i)}_handleDefault(t,i){const r={native:i};i.preventDefault(),this._callback(t,r)}_preventAltKeyDefault(t){t.key==="Alt"&&t.preventDefault()}_preventMultiTouchPanning(t){t.touches.length>1&&t.preventDefault()}};FB.test={disableSubpixelCoordinates:!1};const lT={"key-down":"keydown","key-up":"keyup","pointer-down":"pointerdown","pointer-up":"pointerup","pointer-move":"pointermove","mouse-wheel":"wheel","pointer-capture-got":"gotpointercapture","pointer-capture-lost":"lostpointercapture","context-menu":"contextmenu","pointer-enter":"pointerenter","pointer-leave":"pointerleave","pointer-cancel":"pointercancel",focus:"focus",blur:"blur"};let dle=class extends bs{constructor(){super(!0),this.registerIncoming("context-menu",t=>{t.data.native.preventDefault()})}};const Ws={maximumClickDelay:300,movementUntilMouseDrag:1.5,movementUntilPenDrag:6,movementUntilTouchDrag:6,holdDelay:500,maximumDoubleClickDelay:250,maximumDoubleClickDistance:10,maximumDoubleTouchDelay:350,maximumDoubleTouchDistance:35};function Vw(e,t){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)}function ple(e,t){const i=t.x-e.x,r=t.y-e.y;return Math.sqrt(i*i+r*r)}function fle(e,t){if(t?(t.radius=0,t.center.x=0,t.center.y=0):t={radius:0,center:Dn()},e.length===0)return t;if(e.length===1)return t.center.x=e[0].x,t.center.y=e[0].y,t;if(e.length===2){const[me,ge]=e,[Ie,Ce]=[ge.x-me.x,ge.y-me.y];return t.radius=Math.sqrt(Ie*Ie+Ce*Ce)/2,t.center.x=(me.x+ge.x)/2,t.center.y=(me.y+ge.y)/2,t}let i=0,r=0;for(let me=0;meme.x-i),n=e.map(me=>me.y-r);let c=0,o=0,f=0,g=0,S=0,I=0,A=0;for(let me=0;methis._dragStart(c,o),update:(c,o)=>this._dragUpdate(o),end:(c,o)=>this._dragEnd(o)}),this.registerIncoming("drag",c=>this._dragEventSeparator.handle(c)),this.registerIncoming("pointer-down",c=>this._handlePointerDown(c)),this.registerIncoming("pointer-up",()=>this._handlePointerUp())}onUninstall(){this._pointerState.forEach(t=>{t.doubleTapTimeout=Sr(t.doubleTapTimeout)})}get hasPendingInputs(){return dx(this._pointerState,t=>t.doubleTapTimeout!=null)}_clearPointerDown(t){const i=this._pointerState.get(t);i&&(i.doubleTapTimeout=Sr(i.doubleTapTimeout),this._pointerState.delete(t),this.refreshHasPendingInputs())}_createDoubleTapDragData(t,i,r){const{button:s,buttons:n,pointer:c,pointers:o,pointerType:f,timestamp:g}=r;return{action:t,delta:i,button:s,buttons:n,pointer:c,pointers:o,pointerType:f,timestamp:g}}_dragStart(t,i){if(!this._doubleTapDragReady||t!==1)return;this._doubleTapDragReady=!1,this._doubleTapDragActive=!0;const{data:r,modifiers:s}=i,{center:n}=r;this._dragStartCenter=n;const c=this._createDoubleTapDragData("begin",Dn(0,0),r);this._doubleTapDrag.emit(c,void 0,s),i.stopPropagation()}_dragUpdate(t){if(!this._doubleTapDragActive)return;const{data:i,modifiers:r}=t,{center:s}=i,n=Dn(s.x-this._dragStartCenter.x,s.y-this._dragStartCenter.y),c=this._createDoubleTapDragData("update",n,i);this._doubleTapDrag.emit(c,void 0,r),t.stopPropagation()}_dragEnd(t){if(!this._doubleTapDragActive)return;const{data:i,modifiers:r}=t,{center:s}=i,n=Dn(s.x-this._dragStartCenter.x,s.y-this._dragStartCenter.y),c=this._createDoubleTapDragData("end",n,i);this._doubleTapDrag.emit(c,void 0,r),this._doubleTapDragActive=!1,t.stopPropagation()}_handlePointerDown(t){const{data:i}=t,r=hp(i),s=this._pointerState.get(r),{pointerType:n}=i.native;if(s){const c=n==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;this._clearPointerDown(r),Vw(s.event.data,i)>c?this._storePointerDown(t):this._doubleTapDragReady=!0}else this._storePointerDown(t)}_handlePointerUp(){this._doubleTapDragReady=!1}_storePointerDown(t){const{data:i}=t,{pointerType:r}=i.native,s=hp(i),n=r==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,c=this._clock.setTimeout(()=>this._clearPointerDown(s),n);this._pointerState.set(s,{event:t,doubleTapTimeout:c}),this.refreshHasPendingInputs()}},yle=class extends bs{constructor(t){super(!1),this._navigationTouch=t,this._startStateModifiers=new Set,this._activePointerMap=new Map,this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._drag=this.registerOutgoing("drag"),this.registerIncoming("pointer-drag",this._handlePointerDrag.bind(this)),this.registerIncoming("pointer-up",this._handlePointerUpAndPointerLost.bind(this)),this.registerIncoming("pointer-capture-lost",this._handlePointerUpAndPointerLost.bind(this)),this.registerIncoming("pointer-cancel",this._handlePointerUpAndPointerLost.bind(this))}_createPayload(t,i,r,s){return{action:t,pointerType:this._pointerType,button:this._mouseButton,buttons:i.buttons,timestamp:s,pointers:gle(this._activePointerMap),pointer:i,angle:r.angle,radius:r.radius,center:r.center}}_addPointer(t){const i=t.native.pointerId,r=Mv(this._activePointerMap).angle,s={event:t,initialAngle:0,lastAngle:0};this._activePointerMap.set(i,s);const n=Pb(s,UB(this._activePointerMap));s.initialAngle=n,s.lastAngle=n,this._updatePointerAngles(r)}_updatePointer(t){if(t&&t.x==null&&t.y==null)return;const i=t.native.pointerId,r=this._activePointerMap.get(i);r?r.event=t:this._addPointer(t)}_removePointer(t){const i=Mv(this._activePointerMap).angle;this._activePointerMap.delete(t),this._updatePointerAngles(i)}_updatePointerAngles(t){const i=Mv(this._activePointerMap);this._activePointerMap.forEach(r=>{r.initialAngle=Pb(r,i)-t,r.lastAngle=Pb(r,i)-t})}_emitEvent(t,i,r){const s=Mv(this._activePointerMap);this._drag.emit(this._createPayload(t,i,s,r),void 0,this._startStateModifiers)}_handlePointerUpAndPointerLost(t){const i=t.data.native.pointerId,r=t.timestamp;this._activePointerMap.get(i)&&(this._activePointerMap.size===1?(this._updatePointer(t.data),!this._isCurrentDragSuppressed&&this._emitEvent("end",t.data,r),this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._removePointer(i)):(this._removePointer(i),this._emitEvent("removed",t.data,t.timestamp)))}_handlePointerDrag(t){const i=t.data,r=i.currentEvent,s=t.timestamp;switch(i.action){case"start":case"update":this._isDragging?this._activePointerMap.has(r.native.pointerId)?(this._updatePointer(r),!this._isCurrentDragSuppressed&&this._emitEvent("update",r,s)):(this._addPointer(r),this._emitEvent("added",r,s),this._isCurrentDragSuppressed=this._isSuppressed):(this._updatePointer(r),this._pointerType=t.data.startEvent.pointerType,this._mouseButton=t.data.startEvent.button,this._startStateModifiers=t.modifiers,this._isDragging=!0,this._isCurrentDragSuppressed=this._isSuppressed,!this._isCurrentDragSuppressed&&this._emitEvent("start",r,s))}}get _isSuppressed(){return!!this._navigationTouch&&!this._navigationTouch.browserTouchPanEnabled&&this._pointerType==="touch"&&this._activePointerMap.size===1}};function UB(e){const t=[];return e.forEach(i=>{t.push(Dn(i.event.x,i.event.y))}),fle(t)}function Mv(e){const t=UB(e);let i=0;return e.forEach(r=>{let s=Pb(r,t),n=s-r.lastAngle;for(;n>Math.PI;)n-=2*Math.PI;for(;n<-Math.PI;)n+=2*Math.PI;s=r.lastAngle+n,r.lastAngle=s;const c=s-r.initialAngle;i+=c}),i/=e.size||1,{angle:i,radius:t.radius,center:t.center}}function gle(e){const t=new Map;return e.forEach((i,r)=>t.set(r,i.event)),t}function Pb(e,t){const i=e.event,r=i.x-t.center.x,s=i.y-t.center.y;return Math.atan2(s,r)}var eO;(function(e){e[e.Left=0]="Left",e[e.Middle=1]="Middle",e[e.Right=2]="Right",e[e.Back=3]="Back",e[e.Forward=4]="Forward",e[e.Undefined=-1]="Undefined"})(eO||(eO={}));let _le=class extends bs{constructor(t=Ws.maximumDoubleClickDelay,i=Ws.maximumDoubleClickDistance,r=Ws.maximumDoubleTouchDelay,s=Ws.maximumDoubleTouchDistance,n=Vm){super(!1),this._maximumDoubleClickDelay=t,this._maximumDoubleClickDistance=i,this._maximumDoubleTouchDelay=r,this._maximumDoubleTouchDistance=s,this._clock=n,this._pointerState=new Map,this._immediateDoubleClick=this.registerOutgoing("immediate-double-click"),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this)),this.registerIncoming("pointer-up",this._handlePointerUp.bind(this))}onUninstall(){this._pointerState.forEach(t=>{t.immediateDoubleClick&&t.immediateDoubleClick.timeoutHandle.remove()}),super.onUninstall()}_handlePointerDown(t){const i=t.data,r=hp(i);if(!this._pointerState.has(r)){const s={downButton:i.native.button,x:i.x,y:i.y,immediateDoubleClick:null};this._pointerState.set(r,s),this.startCapturingPointer(i.native)}}_handlePointerUp(t){const i=t.data,r=hp(i),s=this._pointerState.get(r);if(s&&s.downButton===i.native.button){const n=s.immediateDoubleClick,c=t.data.native.pointerType==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;n?(n.timeoutHandle.remove(),Vw(n,t.data)>c?this._startImmediateDoubleClick(t,s):(this._immediateDoubleClick.emit(t.data,void 0,n.modifiers),this._removeState(i))):Vw(s,t.data)>c?this._removeState(i):this._startImmediateDoubleClick(t,s)}}_startImmediateDoubleClick(t,i){const r=t.data.native.pointerType==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay;i.immediateDoubleClick={x:t.data.x,y:t.data.y,modifiers:t.modifiers,timeoutHandle:this._clock.setTimeout(()=>this._removeState(t.data),r)}}_removeState(t){const i=hp(t);this._pointerState.delete(i),this.stopCapturingPointer(t.native),this.refreshHasPendingInputs()}},vle=class extends bs{constructor(t=Ws.maximumClickDelay,i=Ws.movementUntilMouseDrag,r=Ws.movementUntilPenDrag,s=Ws.movementUntilTouchDrag,n=Ws.holdDelay,c=Vm){super(!1),this._maximumClickDelay=t,this._movementUntilMouseDrag=i,this._movementUntilPenDrag=r,this._movementUntilTouchDrag=s,this._holdDelay=n,this._clock=c,this._pointerState=new Map,this._pointerDrag=this.registerOutgoing("pointer-drag"),this._immediateClick=this.registerOutgoing("immediate-click"),this._pointerHold=this.registerOutgoing("hold"),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this)),this.registerIncoming("pointer-up",o=>{this._handlePointerLoss(o,"pointer-up")}),this.registerIncoming("pointer-capture-lost",o=>{this._handlePointerLoss(o,"pointer-capture-lost")}),this.registerIncoming("pointer-cancel",o=>{this._handlePointerLoss(o,"pointer-cancel")}),this._moveHandle=this.registerIncoming("pointer-move",this._handlePointerMove.bind(this)),this._moveHandle.pause()}onUninstall(){this._pointerState.forEach(t=>{t.holdTimeout=Sr(t.holdTimeout)}),super.onUninstall()}_handlePointerDown(t){const i=t.data,r=i.native.pointerId;let s=null;this._pointerState.size===0&&(s=this._clock.setTimeout(()=>{const c=this._pointerState.get(r);if(c){if(!c.isDragging){const o=c.previousEvent;this._pointerHold.emit(o,void 0,t.modifiers),c.holdEmitted=!0}c.holdTimeout=null}},this._holdDelay));const n={startEvent:i,previousEvent:i,startTimestamp:t.timestamp,isDragging:!1,downButton:i.native.button,holdTimeout:s,modifiers:new Set};this._pointerState.set(r,n),this.startCapturingPointer(i.native),this._moveHandle.resume(),this._pointerState.size>1&&this._startDragging(t)}_createPointerDragData(t,i,r){return{action:t,startEvent:i.startEvent,previousEvent:i.previousEvent,currentEvent:r}}_handlePointerMove(t){const i=t.data,r=i.native.pointerId,s=this._pointerState.get(r);s&&(s.isDragging?this._pointerDrag.emit(this._createPointerDragData("update",s,i),void 0,s.modifiers):ple(i,s.startEvent)>this._getDragThreshold(i.native.pointerType)&&this._startDragging(t),s.previousEvent=i)}_getDragThreshold(t){switch(t){case"touch":return this._movementUntilTouchDrag;case"pen":return this._movementUntilPenDrag;default:return this._movementUntilMouseDrag}}_startDragging(t){const i=t.data,r=i.native.pointerId;this._pointerState.forEach(s=>{s.holdTimeout!=null&&(s.holdTimeout.remove(),s.holdTimeout=null),s.isDragging||(s.modifiers=t.modifiers,s.isDragging=!0,r===s.startEvent.native.pointerId?this._pointerDrag.emit(this._createPointerDragData("start",s,i)):this._pointerDrag.emit(this._createPointerDragData("start",s,s.previousEvent),t.timestamp))})}_handlePointerLoss(t,i){const r=t.data,s=r.native.pointerId,n=this._pointerState.get(s);n&&(n.holdTimeout!=null&&(n.holdTimeout.remove(),n.holdTimeout=null),n.isDragging?this._pointerDrag.emit(this._createPointerDragData("end",n,i==="pointer-up"?r:n.previousEvent),void 0,n.modifiers):i==="pointer-up"&&n.downButton===r.native.button&&t.timestamp-n.startTimestamp<=this._maximumClickDelay&&!n.holdEmitted&&this._immediateClick.emit(r),this._pointerState.delete(s),this.stopCapturingPointer(r.native),this._pointerState.size===0&&this._moveHandle.pause())}},ble=class extends bs{constructor(t=Ws.maximumDoubleClickDelay,i=Ws.maximumDoubleClickDistance,r=Ws.maximumDoubleTouchDelay,s=Ws.maximumDoubleTouchDistance,n=Vm){super(!1),this._maximumDoubleClickDelay=t,this._maximumDoubleClickDistance=i,this._maximumDoubleTouchDelay=r,this._maximumDoubleTouchDistance=s,this._clock=n,this._pointerState=new Map,this._click=this.registerOutgoing("click"),this._doubleClick=this.registerOutgoing("double-click"),this.registerIncoming("immediate-click",this._handleImmediateClick.bind(this)),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this))}onUninstall(){this._pointerState.forEach(t=>t.doubleClickTimer=Sr(t.doubleClickTimer))}get hasPendingInputs(){return dx(this._pointerState,t=>t.doubleClickTimer!=null)}_clearDoubleClickTimer(t,i){const r=this._pointerState.get(t);r&&(r.doubleClickTimer=Sr(r.doubleClickTimer),i&&this._click.emit(r.event.data,void 0,r.event.modifiers),this._pointerState.delete(t),this.refreshHasPendingInputs())}_doubleClickTimeoutExceeded(t){const i=this._pointerState.get(t);i.pointerDownCount===1&&this._click.emit(i.event.data,void 0,i.event.modifiers),i.doubleClickTimer=null,this._pointerState.delete(t),this.refreshHasPendingInputs()}_getPointerId(t){const{pointerId:i,pointerType:r,button:s}=t.native;return r==="mouse"?`${i}:${s}`:`${r}`}_handleImmediateClick(t){const i=t.data,{pointerType:r}=i.native,s=this._getPointerId(i);if(!this._pointerState.has(s))return void this._startClick(t);const n=this._pointerState.get(s),{data:c,modifiers:o}=n.event,f=r==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;Vw(c,i)>f?(this._clearDoubleClickTimer(s,!0),this._startClick(t)):(this._clearDoubleClickTimer(s,!1),n.pointerDownCount===2&&this._doubleClick.emit(c,void 0,o))}_handlePointerDown(t){const i=hp(t.data),r=this._pointerState.get(i);r&&(r.pointerDownCount+=1)}_startClick(t){const{data:i}=t,{native:{pointerType:r}}=i,s=hp(i),n=r==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,c=this._clock.setTimeout(()=>this._doubleClickTimeoutExceeded(s),n);this._pointerState.set(s,{event:t,doubleClickTimer:c,pointerDownCount:1}),this.refreshHasPendingInputs()}};const Iv={counter:"Ctrl",pan:{left:"ArrowLeft",right:"ArrowRight",up:"ArrowUp",down:"ArrowDown"},zoom:{zoomIn:["=","+"],zoomOut:["-","_"]},rotate:{clockwiseOption1:"a",clockwiseOption2:"A",counterClockwiseOption1:"d",counterClockwiseOption2:"D",resetOption1:"n",resetOption2:"N"}};let Rd=class extends Nt{initialize(){const t=()=>{var i;return(i=this.view)==null?void 0:i.ready};this.addHandles([gh(()=>!t(),()=>this._disconnect()),gh(t,()=>this._connect())])}destroy(){this._disconnect()}get latestPointerType(){var t;return(t=this._inputManager)==null?void 0:t.latestPointerType}get latestPointerLocation(){var t;return(t=this._inputManager)==null?void 0:t.latestPointerLocation}get multiTouchActive(){var t;return((t=this._inputManager)==null?void 0:t.multiTouchActive)??!1}isModifierKeyDown(t){var i;return((i=this._inputManager)==null?void 0:i.isModifierKeyDown(t))??!1}_disconnect(){this.view.viewEvents.disconnect(),this._inputManager=lr(this._inputManager)}_connect(){const t=this.view.surface,i=new FB(t,this.view.input),r=[new _le,new vle,new ble,new yle(this.view.navigation),new mle],s=new Go({eventSource:i,recognizers:r});s.installHandlers("prevent-context-menu",[new dle],uh.INTERNAL),s.installHandlers("navigation",[new sle(this.view),new Yae(this.view),new rle(this.view),new JR(this.view),new JR(this.view,[Iv.counter]),new Gae(this.view,"primary"),new Qae(this.view,Iv.pan),new tle(this.view,Iv.zoom),new ele(this.view,Iv.rotate),new qae(this.view,"secondary"),new Vae(this.view,"touch")],uh.INTERNAL),this.view.viewEvents.connect(s),this._source=i,this._inputManager=s,ti(()=>{var n,c;return(c=(n=this.view)==null?void 0:n.navigation)==null?void 0:c.browserTouchPanEnabled},n=>{this._source&&(this._source.browserTouchPanningEnabled=!n)},_n)}get test(){return{inputManager:this._inputManager}}};v([M()],Rd.prototype,"view",void 0),v([M()],Rd.prototype,"latestPointerType",null),v([M()],Rd.prototype,"latestPointerLocation",null),v([M()],Rd.prototype,"multiTouchActive",null),Rd=v([fe("esri.views.2d.input.MapViewInputManager")],Rd);const wle=Rd;var cve=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xle(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tO,iO,rO,jB={exports:{}};tO=jB,iO=function(){function e(s,n,c,o,f){t(s,n,c||0,o||s.length-1,f||r)}function t(s,n,c,o,f){for(;o>c;){if(o-c>600){var g=o-c+1,S=n-c+1,I=Math.log(g),A=.5*Math.exp(2*I/3),O=.5*Math.sqrt(I*A*(g-A)/g)*(S-g/2<0?-1:1);t(s,n,Math.max(c,Math.floor(n-S*A/g+O)),Math.min(o,Math.floor(n+(g-S)*A/g+O)),f)}var z=s[n],V=c,H=o;for(i(s,c,n),f(s[o],z)>0&&i(s,c,o);V0;)H--}f(s[c],z)===0?i(s,c,H):i(s,++H,o),H<=n&&(c=H+1),n<=H&&(o=H-1)}}function i(s,n,c){var o=s[n];s[n]=s[c],s[c]=o}function r(s,n){return sn?1:0}return e},(rO=iO())!==void 0&&(tO.exports=rO);const Sle=xle(jB.exports);function Gw(e,t){if(!(this instanceof Gw))return new Gw(e,t);this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&(typeof t=="function"?this.toBBox=t:this._initFormat(t)),this.clear()}function Tle(e,t,i){if(!i)return t.indexOf(e);for(var r=0;r=e.minX&&t.maxY>=e.minY}function Zf(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function oO(e,t,i,r,s){for(var n,c=[t,i];c.length;)(i=c.pop())-(t=c.pop())<=r||(n=t+Math.ceil((i-t)/r/2)*r,Sle(e,n,t,i,s),c.push(t,n,n,i))}Gw.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,i=[],r=this.toBBox;if(!Pv(e,t))return i;for(var s,n,c,o,f=[];t;){for(s=0,n=t.children.length;s=0&&n[t].children.length>this._maxEntries;)this._split(n,t),t--;this._adjustParentBBoxes(s,n,t)},_split:function(e,t){var i=e[t],r=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,r);var n=this._chooseSplitIndex(i,s,r),c=Zf(i.children.splice(n,i.children.length-n));c.height=i.height,c.leaf=i.leaf,Cf(i,this.toBBox),Cf(c,this.toBBox),t?e[t-1].children.push(c):this._splitRoot(i,c)},_splitRoot:function(e,t){this.data=Zf([e,t]),this.data.height=e.height+1,this.data.leaf=!1,Cf(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,i){var r,s,n,c,o,f,g,S;for(f=g=1/0,r=t;r<=i-t;r++)c=Mle(s=o0(e,0,r,this.toBBox),n=o0(e,r,i,this.toBBox)),o=cT(s)+cT(n),c=t;s--)n=e.children[s],a0(f,e.leaf?c(n):n),g+=Av(f);return g},_adjustParentBBoxes:function(e,t,i){for(var r=i;r>=0;r--)a0(t[r],e)},_condense:function(e){for(var t,i=e.length-1;i>=0;i--)e[i].children.length===0?i>0?(t=e[i-1].children).splice(t.indexOf(e[i]),1):this.clear():Cf(e[i],this.toBBox)},_initFormat:function(e){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(e[0])),this.compareMinY=new Function("a","b",t.join(e[1])),this.toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}};let aO=class VB{constructor(t,i){this.key=new Fl(0,0,0,0),this.bounds=eo(),this.objectIds=new Set,this.key.set(i);const r=t.getLODInfoAt(this.key);this.tileInfoView=t,this.tileInfoView.getTileBounds(this.bounds,this.key,!0),this.resolution=r.resolution,this.scale=r.scale,this.level=r.level}get lod(){return this.tileInfoView.getLODInfoAt(this.key)}get id(){return this.key.id}get extent(){return Ui.fromBounds(this.bounds,this.tileInfoView.tileInfo.spatialReference)}get transform(){return{originPosition:"upperLeft",scale:[this.resolution,this.resolution],translate:[this.bounds[0],this.bounds[3]]}}createArcadeEvaluationOptions(t){return{$view:{scale:this.scale,timeZone:t}}}createChildTiles(){const t=this.key.getChildKeys(),i=kn.acquire();for(let r=0;rs?[eo([e[0],e[1],s,e[3]]),eo([r,e[1],r+e[2]-s,e[3]])]:e[0]({minX:i.bounds[0],minY:i.bounds[1],maxX:i.bounds[2],maxY:i.bounds[3]}):[".bounds[0]",".bounds[1]",".bounds[2]",".bounds[3]"]),this.tiles=[],this.tileScheme=t}destroy(){this.clear()}clear(){this.tiles.length=0,this._tiles.clear(),this._index.clear()}has(t){return this._tiles.has(t)}get(t){return this._tiles.get(t)}getIntersectingTiles(t){if(!t||c6(t)===0||u6(t)===0)return[];const i=Ale(t,this.tileScheme.spatialReference);return i!=null?[...new Set([...this.boundsIntersections(i[0]),...this.boundsIntersections(i[1])])]:this.boundsIntersections(t)}boundsIntersections(t){return this._index.search({minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]})}updateTiles(t){const i={added:[],removed:[]};for(const r of t.added)if(!this.has(r)){const s=new aO(this.tileScheme,r);this._tiles.set(r,s),this._index.insert(s),i.added.push(s)}for(const r of t.removed)if(this.has(r)){const s=this.get(r);this._tiles.delete(r),this._index.remove(s),i.removed.push(s)}this.tiles.length=0,this._tiles.forEach(r=>this.tiles.push(r)),(i.added.length||i.removed.length)&&this.emit("update",i)}setViewState(t){const i=this.tileScheme.getTileCoverage(t,0);if(!i)return;const{spans:r,lodInfo:s}=i,{level:n}=s;if(r.length>0)for(const{row:c,colFrom:o,colTo:f}of r)for(let g=o;g<=f;g++){const S=Ile.set(n,c,s.normalizeCol(g),s.getWorldForColumn(g)).id;if(hT.add(S),!this.has(S)){const I=new aO(this.tileScheme,S);this._tiles.set(S,I),this._index.insert(I),this.tiles.push(I),od.added.push(I)}}for(let c=this.tiles.length-1;c>=0;c--){const o=this.tiles[c];hT.has(o.id)||(this._tiles.delete(o.id),this.tiles.splice(c,1),this._index.remove(o),od.removed.push(o))}(od.added.length||od.removed.length)&&this.emit("update",od),o_.pool.release(i),hT.clear(),od.added.length=0,od.removed.length=0}},Hu=class extends Nt{constructor(){super(...arguments),this.color=new zt([0,255,255]),this.haloOpacity=1,this.fillOpacity=.25,this.multiHighlightEnabled=!1}equals(t){return this.color.equals(t.color)&&(this.haloColor||this.color).equals(t.haloColor||t.color)&&this.haloOpacity===t.haloOpacity&&this.fillOpacity===t.fillOpacity&&this.multiHighlightEnabled===t.multiHighlightEnabled}};v([M({type:zt})],Hu.prototype,"color",void 0),v([M({type:zt})],Hu.prototype,"haloColor",void 0),v([M()],Hu.prototype,"haloOpacity",void 0),v([M()],Hu.prototype,"fillOpacity",void 0),v([M()],Hu.prototype,"multiHighlightEnabled",void 0),Hu=v([fe("esri.views.2d.support.HighlightOptions")],Hu);const GB=Hu;async function Cle(e,t,i){const r=F8(t)?z8(e,t):t;if(!e.ready||isNaN(r.x)||isNaN(r.y))return{screenPoint:r,results:[]};let s=new Set;const n=new Set;let c=!1,o=null,f=null;i!=null&&i.include?cO(i.include,lO(e,A=>{s.add(A),dT(A,O=>n.add(O))},(A,O)=>{n.add(A),s.add(O)},A=>{o||(o=new Set),o.add(A)},A=>s.add(A),()=>c=!0)):(c=!0,s=new Set(e.allLayerViews),s.forEach(A=>{dT(A,O=>n.add(O))})),i!=null&&i.exclude&&cO(i.exclude,lO(e,A=>{s.delete(A),dT(A,O=>n.delete(O))},A=>n.delete(A),A=>{f||(f=new Set),f.add(A)}));const g=e.allLayerViews.filter(A=>!A.suspended&&s.has(A)).reverse(),S=e.toMap(r);let I=[...c?e.graphicsView.hitTest(S).map(A=>({type:"graphic",graphic:A,layer:null,mapPoint:S})):[],...await Promise.all(g.map(A=>A.hitTest(S,r)).toArray())].filter(N0).flat().filter(N0);return I=I.filter(A=>{var O;return A.type!=="graphic"||((O=A.layer)==null?void 0:O.type)!=="subtype-group"||n.has(A.graphic.layer)}),o&&(I=I.filter(A=>!("graphic"in A)||!A.graphic||(o==null?void 0:o.has(SI(A.graphic))))),f&&(I=I.filter(A=>!("graphic"in A)||!A.graphic||!(f!=null&&f.has(SI(A.graphic))))),{screenPoint:r,results:I}}function lO(e,t,i,r,s,n){return c=>{if(c instanceof YM){if(c.layer===e)n==null||n();else{const o=e.allLayerViews.find(f=>f.layer===c.layer);o&&(s==null||s(o))}r(SI(c))}else if(c.type==="subtype-sublayer"){const o=e.allLayerViews.find(f=>f.layer===c.parent);o&&i(c,o)}else{const o=e.allLayerViews.find(f=>f.layer===c);o&&t(o)}}}function cO(e,t){if(e)if(Gb(e))for(const i of e)if(Gb(i))for(const r of i)t(r);else t(i);else t(e)}function SI(e){var i,r;const t=e.getObjectId();return t?`${((i=e.layer)==null?void 0:i.uid)??((r=e.sourceLayer)==null?void 0:r.uid)??"MapView"}/${t}`:`"MapView/${e.uid}`}function dT({layer:e},t){e.type==="subtype-group"&&e.sublayers.forEach(i=>{t(i)})}function $le(e,t,i){const{ctx:r,canvas:s}=qB(e,i),n=r.getImageData(0,0,e.width,e.height),c=Ole(s,t);return HB(s),{dataUrl:c,data:n}}function kle(e,t){const{ctx:i,canvas:r}=qB(e,t),s=i.getImageData(0,0,e.width,e.height);return HB(r),s}function qB(e,t){const i=Rle();t.premultipliedAlpha&&Fle(e),i.width=e.width,i.height=e.height;const r=i.getContext("2d",{willReadFrequently:!0});return r.putImageData(e,0,0),t.flipY&&zle(r),{ctx:r,canvas:i}}function HB(e){e.width=0,e.height=0}function Rle(){return pT==null&&(pT=document.createElement("canvas")),pT}let pT=null;function Ole(e,t){const i=Ble[t.format],r=t.quality/100;return e.toDataURL(i,r)}function Lle(e,t){const i=Nle(e),r=jle[i];return{format:i,quality:Ll(t??r,0,100)}}function Dle(e,t){return t/Math.max(e[0],e[1])}function dve(e,t,i,r=0,s=0,n=e.width-r,c=e.height-s,o=!1){const{data:f}=e,{width:g,height:S,data:I}=t,A=n/g,O=c/S,z=Math.ceil(A/2),V=Math.ceil(O/2),H=e.width;for(let Q=0;Q=1)continue;let Ft=2*Kt*Kt*Kt-3*Kt*Kt+1;const ji=4*(r+vi+(s+ot)*H);tt+=Ft*f[ji+3],Ie+=Ft,!i&&f[ji+3]<255&&(Ft=Ft*f[ji+3]/255),Ce+=Ft*f[ji],ze+=Ft*f[ji+1],je+=Ft*f[ji+2],ge+=Ft}}I[me]=Ce/ge,I[me+1]=ze/ge,I[me+2]=je/ge,I[me+3]=tt/Ie}return t}function Nle(e){switch(e){case"png":case"jpg":case"jpeg":return e;default:return Ule}}function zle(e){e.save(),e.globalCompositeOperation="copy",e.scale(1,-1),e.translate(0,-e.canvas.height),e.drawImage(e.canvas,0,0),e.restore()}function Fle(e){const t=e.data,i=t.length;for(let r=0;r0){const n=255/s;t[r]=t[r]*n,t[r+1]=t[r+1]*n,t[r+2]=t[r+2]*n}}}const Ble={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg"},uO=98,Ule="png",jle={png:100,jpg:uO,jpeg:uO},WB={flipY:!0,premultipliedAlpha:!0};async function Vle(e,t){const i=await ZB(e,t),{format:r,quality:s}=Lle(t==null?void 0:t.format,t==null?void 0:t.quality);return $le(i,{format:r,quality:s,rotation:0,disableDecorations:!1},WB)}async function Gle(e,t){const i=await ZB(e,t);return kle(i,WB)}function ZB(e,t){const i=Wle(t||{},Hle(e.stage,e.size),e.size,e.padding),r=qle(t,e.allLayerViews);return e.stage.takeScreenshot(i,r,e.backgroundColor,t==null?void 0:t.rotation)}function qle(e={},t){if(!e.layers)return;const i=[];return e.layers.forEach(r=>{const s=t.find(n=>n.layer.id===r.id);s!=null&&s.container&&i.push(s.container)}),i}function Hle(e,t){return Math.min(4,Dle(t,Math.min(4096,e.context.parameters.maxTextureSize)))}function Wle(e,t,i,r){e.ignorePadding&&(r={left:0,right:0,top:0,bottom:0});let s=null;e.width!=null&&e.height!=null?s=[e.width,e.height]:e.width==null&&e.height!=null?s=[e.height,e.height]:e.width!=null&&e.height==null?s=[e.width,e.width]:e.width==null&&e.height==null&&(s=null);const n=i[0]-(r.left+r.right),c=i[1]-(r.top+r.bottom);let o,f,g=e.area||{x:0,y:0,width:n,height:c};if(s){const S=n/c,I=s[0]/s[1];if(I>S){const A=g.width/I;g={x:g.x,y:Math.round(g.y+(g.height-A)/2),width:g.width,height:Math.round(A)}}else{const A=g.height*I;g={x:Math.round(g.x+(g.width-A)/2),y:g.y,width:Math.round(A),height:g.height}}}else s=[g.width,g.height];return s[0]>g.width?(o=Math.min(s[0]/g.width,t),f=s[0]/g.width/o):(o=1,f=s[0]/g.width),{cropArea:{x:Math.round((g.x+r.left)*o),y:Math.round((g.y+r.top)*o),width:Math.round(g.width*o),height:Math.round(g.height*o)},outputScale:f,resolutionScale:o}}const hO=160;let l0=class extends Nt{constructor(){super(...arguments),this._timer=void 0}get stationary(){return!this._timer}flip(){this._timestamp=performance.now(),this._timer==null&&(this._timer=setInterval(()=>{performance.now()-this._timestamp>=hO&&this.clear()},hO))}clear(){this._timer&&(clearInterval(this._timer),this._timer=void 0)}};v([M()],l0.prototype,"_timer",void 0),v([M()],l0.prototype,"stationary",null),l0=v([fe("esri.views.2d.support.StationaryManager")],l0);const Zle=e=>e.includes("Brush");let YB=class{constructor(){this._names=new Map}begin(t){this._names.has(t)||(this._names.set(t,!1),Zle(t)&&this.record("Esri.FirstDraw"),performance.mark(`Esri.${t}.Start`))}end(t){this._names.has(t)&&!this._names.get(t)&&(this._names.set(t,!0),performance.mark(`Esri.${t}.End`))}record(t){this._names.has(t)||(this._names.set(t,!0),performance.mark(`Esri.${t}`))}};function dO(e,t={}){return e.getContext("webgl2",t)||null}let fT;function TI(){return fT||(fT=Kle()),fT}let Yle=class{constructor(){this.available=!1,this.majorPerformanceCaveat=!1,this.maxTextureSize=0,this.supportsVertexShaderSamplers=!1,this.supportsHighPrecisionFragment=!1,this.supportsColorBufferFloat=!1,this.supportsColorBufferFloatBlend=!1,this.supportsColorBufferHalfFloat=!1}};function Jle(e){if(typeof WebGL2RenderingContext>"u")return null;const t=document.createElement("canvas");if(!t)return null;let i=dO(t,{failIfMajorPerformanceCaveat:!0});if(i==null&&(i=dO(t),i!=null&&(e.majorPerformanceCaveat=!0)),i==null)return i;e.available=!0,e.maxTextureSize=i.getParameter(i.MAX_TEXTURE_SIZE),e.supportsVertexShaderSamplers=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0;const r=i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT);return r&&(e.supportsHighPrecisionFragment=r.precision>0),i}function Kle(){const e=new Yle,t=Jle(e);return t==null||(e.supportsColorBufferFloat=t.getExtension("EXT_color_buffer_float")!==null,e.supportsColorBufferFloatBlend=t.getExtension("EXT_float_blend")!==null,e.supportsColorBufferHalfFloat=e.supportsColorBufferFloat||t.getExtension("EXT_color_buffer_half_float")!==null),e}function Xle(e){const t=TI();return t.available?e==="3d"&&t.majorPerformanceCaveat?new Je("webgl:major-performance-caveat-detected","Your WebGL implementation doesn't seem to support hardware accelerated rendering. Check your browser settings or if your GPU is in a blocklist."):t.supportsHighPrecisionFragment?t.supportsVertexShaderSamplers?null:new Je("webgl:vertex-shader-samplers-required","WebGL support for vertex shader samplers is required but not supported."):new Je("webgl:high-precision-fragment-required","WebGL support for high precision fragment shaders is required but not supported."):new Je("webgl:required","WebGL2 is required but not supported.",new Error().stack)}function Qle(e){return e&&"nodeType"in e}function ece(e){return e&&typeof e.render=="function"}const pO={component:"esri-component"};let Od=class extends Nt{constructor(){super(...arguments),this.widget=null}destroy(){var t;this.node=null,(t=this.widget)==null||t.destroy()}get id(){var t,i;return this._get("id")??((t=this.widget)==null?void 0:t.id)??((i=this.node)==null?void 0:i.id)}set id(t){this._set("id",t)}set node(t){const i=this._get("node");t!==i&&(t&&t.classList.add(pO.component),i&&i.classList.remove(pO.component),this._set("node",t))}castNode(t){var i;return(i=this.widget)==null||i.destroy(),t?typeof t=="string"||Qle(t)?(this._set("widget",null),p3(t)):(ece(t)&&!t.domNode&&(t.domNode=document.createElement("div")),this._set("widget",t),t.domNode):(this._set("widget",null),null)}};v([M()],Od.prototype,"id",null),v([M()],Od.prototype,"node",null),v([Rs("node")],Od.prototype,"castNode",null),v([M({readOnly:!0})],Od.prototype,"widget",void 0),Od=v([fe("esri.views.ui.Component")],Od);const Cb=Od,JB="calcite-mode-";function tce(){return getComputedStyle(document.body).getPropertyValue("--esri-calcite-mode-name").replaceAll(/\s|'|"/g,"")}function ice(){return tce().startsWith("dark")}function rce(){return`${JB}${ice()?"dark":"light"}`}function sce(e){nce(e),e.classList.add(rce())}function nce(e){Array.from(e.classList).forEach(t=>{t.startsWith(JB)&&e.classList.remove(t)})}const oce={left:0,top:0,bottom:0,right:0},KB={bottom:30,top:15,right:15,left:15},fc="esri-ui",qn={ui:fc,corner:`${fc}-corner`,innerContainer:`${fc}-inner-container`,manualContainer:`${fc}-manual-container`,cornerContainer:`${fc}-corner-container`,topLeft:`${fc}-top-left`,topRight:`${fc}-top-right`,bottomLeft:`${fc}-bottom-left`,bottomRight:`${fc}-bottom-right`};function ace(e){return e&&!e._started&&typeof e.postMixInProperties=="function"&&typeof e.buildRendering=="function"&&typeof e.postCreate=="function"&&typeof e.startup=="function"}function Cv(e){return e===0?"0":`${e}px`}function mT(e){const t=typeof e=="object"&&e!==null&&Object.getPrototypeOf(e);return(t===null||t===Object.prototype)&&("component"in e||"index"in e||"position"in e)?e:null}function yT(e,{top:t,bottom:i,left:r,right:s}){e.style.top=t,e.style.bottom=i,e.style.left=r,e.style.right=s}let Tl=class extends Sh.EventedAccessor{constructor(t){super(t),this._cornerNameToContainerLookup={},this._positionNameToContainerLookup={},this._components=new Array,this._componentMap=new Map,this._locale=wo(),this.view=null,this._applyViewPadding=()=>{const i=this.container;i&&yT(i,this._toPixelPosition(this._getViewPadding()))},this._applyUIPadding=()=>{const i=this._innerContainer;i&&yT(i,this._toPixelPosition(this.padding))},this._initContainers()}initialize(){this.addHandles([ti(()=>{var t;return[(t=this.view)==null?void 0:t.padding,this.container]},this._applyViewPadding,_n),ti(()=>this.padding,this._applyUIPadding,_n),ti(()=>[this.container,this._locale],([t,i])=>{t&&t.setAttribute("lang",i)},_n),CA(t=>{this._locale=t})])}destroy(){this.container=null;for(const t of this._components)t.destroy();this._components.length=0,this._componentMap.clear()}set container(t){const i=this._get("container");t!==i&&(t&&(t.classList.add(qn.ui),sce(t),this._attachContainers(t)),i&&(i.classList.remove(qn.ui),yT(i,{top:"",bottom:"",left:"",right:""}),oF(i)),this._set("container",t))}get height(){var n;const t=((n=this.view)==null?void 0:n.height)??0;if(t===0)return t;const i=this._getViewPadding(),{top:r,bottom:s}=i;return Math.max(t-r-s,0)}get padding(){return this._get("padding")}set padding(t){this._overrideIfSome("padding",t)}castPadding(t){return typeof t=="number"?{bottom:t,top:t,right:t,left:t}:{...KB,...t}}get width(){var n;const t=((n=this.view)==null?void 0:n.width)??0;if(t===0)return t;const i=this._getViewPadding(),{left:r,right:s}=i;return Math.max(t-r-s,0)}add(t,i){let r,s,n;if(Array.isArray(t))return void t.forEach(o=>this.add(o,i));const c=mT(t);c&&({index:r,position:i,component:t,key:s}=c),i&&typeof i=="object"&&({index:r,key:s,position:i,internal:n}=i),!t||i&&!this._isValidPosition(i)||this._add(t,i,r,s,n)}remove(t,i){var s;if(!t)return;if(Array.isArray(t))return t.map(n=>this.remove(n,i));const r=this._find(t);if(r){if(this._componentMap.has(r)&&((s=this._componentMap.get(r))==null?void 0:s.key)!==i)return;const n=this._components.indexOf(r),c=r.node.parentNode;return c==null||c.removeChild(r.node),this._componentMap.delete(r),this._components.splice(n,1)[0]}}empty(t,i={removeInternal:!1}){if(Array.isArray(t)){for(const n of t)this.empty(n,i);return}const r=this._positionNameToContainerLookup[t??"manual"],s=Array.prototype.slice.call(r.children).map(n=>this._findByNode(n)).filter(n=>{var c;return n==null?!1:!(((c=this._componentMap.get(n))==null?void 0:c.internal)??!1)||i.removeInternal});for(const n of s)this.remove(n)}move(t,i){if(Array.isArray(t)&&t.forEach(c=>this.move(c,i)),!t)return;let r;const s=mT(t)||mT(i);if(s&&(r=s.index,i=s.position,t=s.component||t),i&&!this._isValidPosition(i))return;const n=this.remove(t);n&&this.add(n,{position:i,index:r})}find(t){if(!t)return null;const i=this._findById(t);return i&&(i.widget||i.node)}getComponents(t,i={includeInternal:!1}){return t?Array.isArray(t)?t.flatMap(r=>this._getComponentsAtPosition(r,i)):this._getComponentsAtPosition(t,i):this._components.filter(r=>{var s;return i.includeInternal||!((s=this._componentMap.get(r))!=null&&s.internal)}).map(({widget:r,node:s})=>r??s)}getPosition(t){for(const i in this._positionNameToContainerLookup)if(this._positionNameToContainerLookup[i].contains(t))return i;return null}_add(t,i,r,s,n){t instanceof Cb||(t=new Cb({node:t})),this._place({component:t,position:i,index:r}),this._components.push(t),this._componentMap.set(t,{key:s,internal:n})}_find(t){return t?t instanceof Cb?this._findByComponent(t):typeof t=="string"?this._findById(t):this._findByNode(t.domNode||t):null}_getViewPadding(){var t;return((t=this.view)==null?void 0:t.padding)??oce}_attachContainers(t){t.appendChild(this._innerContainer),t.appendChild(this._manualContainer)}_initContainers(){const t=document.createElement("div");t.classList.add(qn.innerContainer,qn.cornerContainer);const i=document.createElement("div");i.classList.add(qn.innerContainer,qn.manualContainer);const r=document.createElement("div");r.classList.add(qn.topLeft,qn.corner),t.appendChild(r);const s=document.createElement("div");s.classList.add(qn.topRight,qn.corner),t.appendChild(s);const n=document.createElement("div");n.classList.add(qn.bottomLeft,qn.corner),t.appendChild(n);const c=document.createElement("div");c.classList.add(qn.bottomRight,qn.corner),t.appendChild(c),this._innerContainer=t,this._manualContainer=i;const o=Hte();this._cornerNameToContainerLookup={"top-left":r,"top-right":s,"bottom-left":n,"bottom-right":c,"top-leading":o?s:r,"top-trailing":o?r:s,"bottom-leading":o?c:n,"bottom-trailing":o?n:c},this._positionNameToContainerLookup={manual:i,...this._cornerNameToContainerLookup}}_isValidPosition(t){return!!this._positionNameToContainerLookup[t]}_place(t){const i=t.position??"manual",{component:r,index:s}=t,n=this._positionNameToContainerLookup[i],c=s!=null&&s>-1;if(ace(r.widget)&&r.widget.startup(),!c)return void n.appendChild(r.node);const o=Array.from(n.children);if(s===0)return void(n.firstChild?Kk(r.node,n.firstChild):n.appendChild(r.node));s>=o.length?n.appendChild(r.node):Kk(r.node,o[s])}_toPixelPosition(t){return{top:Cv(t.top),left:Cv(t.left),right:Cv(t.right),bottom:Cv(t.bottom)}}_findByComponent(t){return this._components.find(i=>i===t)??null}_findById(t){return this._components.find(({id:i})=>i===t)??null}_findByNode(t){return this._components.find(({node:i})=>i===t)??null}_getComponentsAtPosition(t,i){const r=this._positionNameToContainerLookup[t];return Array.prototype.slice.call(r.children).map(s=>this._findByNode(s)).filter(N0).filter(s=>{var n;return i.includeInternal||!((n=this._componentMap.get(s))!=null&&n.internal)}).map(({widget:s,node:n})=>s??n)}};v([M()],Tl.prototype,"_locale",void 0),v([M()],Tl.prototype,"container",null),v([M()],Tl.prototype,"height",null),v([M({value:KB})],Tl.prototype,"padding",null),v([Rs("padding")],Tl.prototype,"castPadding",null),v([M()],Tl.prototype,"view",void 0),v([M()],Tl.prototype,"width",null),Tl=v([fe("esri.views.ui.UI")],Tl);const lce=Tl,cce="randomUUID"in crypto;function K3(){if(cce)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=i=>e[i].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function _ve(){return`{${K3().toUpperCase()}}`}function vve(){return`{${K3()}}`}const uce={handleInterceptedEvent:(e,t,i,r)=>(e.scheduleRender(),t.properties[`on${r.type}`].apply(t.properties.bind||i,[r]))},hce={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,t,i)=>{t.charAt(0)==="-"?e.style.setProperty(t,i):e.style[t]=i}},dce=e=>({...hce,...e}),pce=(e,t)=>{const i=[];for(;e&&e!==t;)i.push(e),e=e.parentNode;return i},fce=(e,t)=>e.find(t),fO=(e,t,i=!1)=>{let r=e;return t.forEach((s,n)=>{const c=r!=null&&r.children?fce(r.children,o=>o.domNode===s):void 0;i&&!c&&n!==t.length-1||(r=c)}),r},mce=e=>{let t;const i={...uce,...e},r=dce(i),s=r.performanceLogger;let n,c=!0,o=!1;const f=[],g=[],S=(A,O,z)=>{var Q;let V;r.eventHandlerInterceptor=(ve,me,ge,Ie)=>function(Ce){let ze;s("domEvent",Ce);const je=pce(Ce.currentTarget,V.domNode),tt=je.some(ot=>{var et;return customElements.get((et=ot==null?void 0:ot.tagName)==null?void 0:et.toLowerCase())});if(Ce.eventPhase===Event.CAPTURING_PHASE||!tt)je.reverse(),ze=fO(V.getLastRender(),je);else{const ot=Ce.composedPath(),et=ot.slice(ot.indexOf(Ce.currentTarget),ot.indexOf(V.domNode)).reverse();ze=fO(V.getLastRender(),et,!0)}let ut;return ze&&(ut=i.handleInterceptedEvent(t,ze,this,Ce)),s("domEventProcessed",Ce),ut},(Q=i.postProcessProjectionOptions)==null||Q.call(i,r);const H=z();V=A(O,H,r),r.eventHandlerInterceptor=void 0,f.push(V),g.push(z),i.afterFirstVNodeRendered&&i.afterFirstVNodeRendered(V,H)};let I=()=>{if(n=void 0,c){c=!1,s("renderStart",void 0);for(let A=0;A{n||o||(n=requestAnimationFrame(I))},stop:()=>{n&&(cancelAnimationFrame(n),n=void 0),o=!0},resume:()=>{o=!1,c=!0,t.scheduleRender()},append:(A,O)=>{S(lh.append,A,O)},insertBefore:(A,O)=>{S(lh.insertBefore,A,O)},merge:(A,O)=>{S(lh.merge,A,O)},replace:(A,O)=>{S(lh.replace,A,O)},detach:A=>{for(let O=0;O/g,yte=/"/g,gte=/"/g,_te=/&#([a-zA-Z0-9]*);?/gim,vte=/:?/gim,bte=/&newline;?/gim,vv=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,eR=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,tR=/u\s*r\s*l\s*\(.*/gi;function dF(e){return e.replace(yte,""")}function pF(e){return e.replace(gte,'"')}function fF(e){return e.replace(_te,function(i,r){return r[0]==="x"||r[0]==="X"?String.fromCharCode(parseInt(r.substr(1),16)):String.fromCharCode(parseInt(r,10))})}function mF(e){return e.replace(vte,":").replace(bte," ")}function yF(e){for(var t="",i=0,r=e.length;i",r);if(s===-1)break;i=s+3}return t}function Tte(e){var t=e.split("");return t=t.filter(function(i){var r=i.charCodeAt(0);return r===127?!1:r<=31?r===10||r===13:!0}),t.join("")}Lr.whiteList=cF();Lr.getDefaultWhiteList=cF;Lr.onTag=cte;Lr.onIgnoreTag=ute;Lr.onTagAttr=hte;Lr.onIgnoreTagAttr=dte;Lr.safeAttrValue=pte;Lr.escapeHtml=hF;Lr.escapeQuote=dF;Lr.unescapeQuote=pF;Lr.escapeHtmlEntities=fF;Lr.escapeDangerHtml5Entities=mF;Lr.clearNonPrintableCharacter=yF;Lr.friendlyAttrValue=gF;Lr.escapeAttrValue=_F;Lr.onIgnoreTagStripAll=wte;Lr.StripTagBody=xte;Lr.stripCommentTag=Ste;Lr.stripBlankChar=Tte;Lr.cssFilter=uF;Lr.getDefaultCSSWhiteList=lte;var Bx={},Qu=f3;function Ete(e){var t=Qu.spaceIndex(e),i;return t===-1?i=e.slice(1,-1):i=e.slice(1,t+1),i=Qu.trim(i).toLowerCase(),i.slice(0,1)==="/"&&(i=i.slice(1)),i.slice(-1)==="/"&&(i=i.slice(0,-1)),i}function Mte(e){return e.slice(0,2)===""){r+=i(e.slice(s,n)),S=e.slice(n,o+1),g=Ete(S),r+=t(n,r.length,g,S,Mte(S)),s=o+1,n=!1;continue}if(I==='"'||I==="'")for(var A=1,O=e.charAt(o-A);O.trim()===""||O==="=";){if(O==="="){c=I;continue e}O=e.charAt(o-++A)}}else if(I===c){c=!1;continue}}return s0;t--){var i=e[t];if(i!==" ")return i==="="?t:-1}}function Rte(e){return e[0]==='"'&&e[e.length-1]==='"'||e[0]==="'"&&e[e.length-1]==="'"}function iR(e){return Rte(e)?e.substr(1,e.length-2):e}Bx.parseTag=Ite;Bx.parseAttr=Pte;var Ote=e_.exports.FilterCSS,Ra=Lr,vF=Bx,Lte=vF.parseTag,Dte=vF.parseAttr,nb=f3;function bv(e){return e==null}function Nte(e){var t=nb.spaceIndex(e);if(t===-1)return{html:"",closing:e[e.length-2]==="/"};e=nb.trim(e.slice(t+1,-1));var i=e[e.length-1]==="/";return i&&(e=nb.trim(e.slice(0,-1))),{html:e,closing:i}}function zte(e){var t={};for(var i in e)t[i]=e[i];return t}function Fte(e){var t={};for(var i in e)Array.isArray(e[i])?t[i.toLowerCase()]=e[i].map(function(r){return r.toLowerCase()}):t[i.toLowerCase()]=e[i];return t}function bF(e){e=zte(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=Ra.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=Fte(e.whiteList||e.allowList):e.whiteList=Ra.whiteList,e.onTag=e.onTag||Ra.onTag,e.onTagAttr=e.onTagAttr||Ra.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||Ra.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||Ra.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||Ra.safeAttrValue,e.escapeHtml=e.escapeHtml||Ra.escapeHtml,this.options=e,e.css===!1?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new Ote(e.css))}bF.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,i=t.options,r=i.whiteList,s=i.onTag,n=i.onIgnoreTag,c=i.onTagAttr,o=i.onIgnoreTagAttr,f=i.safeAttrValue,g=i.escapeHtml,S=t.cssFilter;i.stripBlankChar&&(e=Ra.stripBlankChar(e)),i.allowCommentTag||(e=Ra.stripCommentTag(e));var I=!1;i.stripIgnoreTagBody&&(I=Ra.StripTagBody(i.stripIgnoreTagBody,n),n=I.onIgnoreTag);var A=Lte(e,function(O,z,V,H,Q){var ve={sourcePosition:O,position:z,isClosing:Q,isWhite:Object.prototype.hasOwnProperty.call(r,V)},me=s(V,H,ve);if(!bv(me))return me;if(ve.isWhite){if(ve.isClosing)return"";var ge=Nte(H),Ie=r[V],Ce=Dte(ge.html,function(ze,je){var tt=nb.indexOf(Ie,ze)!==-1,ut=c(V,ze,je,tt);return bv(ut)?tt?(je=f(V,ze,je,S),je?ze+'="'+je+'"':ze):(ut=o(V,ze,je,tt),bv(ut)?void 0:ut):ut});return H="<"+V,Ce&&(H+=" "+Ce),ge.closing&&(H+=" /"),H+=">",H}else return me=n(V,H,ve),bv(me)?g(H):me},g);return I&&(A=I.remove(A)),A};var Bte=bF;(function(e,t){var i=Lr,r=Bx,s=Bte;function n(o,f){var g=new s(f);return g.process(o)}t=e.exports=n,t.filterXSS=n,t.FilterXSS=s,function(){for(var o in i)t[o]=i[o];for(var f in r)t[f]=r[f]}();function c(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}c()&&(self.filterXSS=e.exports)})(Fd,Fd.exports);var Ute=function(){function e(t,i){var r=this;this.arcgisWhiteList={a:["href","style","target"],abbr:["title"],audio:["autoplay","controls","loop","muted","preload"],b:[],br:[],dd:["style"],div:["align","style"],dl:["style"],dt:["style"],em:[],figcaption:["style"],figure:["style"],font:["color","face","size","style"],h1:["style"],h2:["style"],h3:["style"],h4:["style"],h5:["style"],h6:["style"],hr:[],i:[],img:["alt","border","height","src","style","width"],li:[],ol:[],p:["style"],source:["media","src","type"],span:["style"],strong:[],sub:["style"],sup:["style"],table:["border","cellpadding","cellspacing","height","style","width"],tbody:[],tr:["align","height","style","valign"],td:["align","colspan","height","nowrap","rowspan","style","valign","width"],th:["align","colspan","height","nowrap","rowspan","style","valign","width"],u:[],ul:[],video:["autoplay","controls","height","loop","muted","poster","preload","width"]},this.allowedProtocols=["http","https","mailto","iform","tel","flow","lfmobile","arcgis-navigator","arcgis-appstudio-player","arcgis-survey123","arcgis-collector","arcgis-workforce","arcgis-explorer","arcgis-trek2there","arcgis-quickcapture","mspbi","comgooglemaps","pdfefile","pdfehttp","pdfehttps","boxapp","boxemm","awb","awbs","gropen","radarscope"],this.arcgisFilterOptions={allowCommentTag:!0,safeAttrValue:function(n,c,o,f){return n==="a"&&c==="href"||(n==="img"||n==="source")&&c==="src"?r.sanitizeUrl(o):Fd.exports.safeAttrValue(n,c,o,f)}},this._entityMap={"&":"8","<":"<",">":">",'"':""","'":"'","/":"/"};var s;t&&!i?s=t:t&&i?(s=Object.create(this.arcgisFilterOptions),Object.keys(t).forEach(function(n){n==="whiteList"?s.whiteList=r._extendObjectOfArrays([r.arcgisWhiteList,t.whiteList||{}]):s[n]=t[n]})):(s=Object.create(this.arcgisFilterOptions),s.whiteList=this.arcgisWhiteList),this.xssFilterOptions=s,this._xssFilter=new Fd.exports.FilterXSS(s)}return e.prototype.sanitize=function(t,i){switch(i===void 0&&(i={}),typeof t){case"number":return isNaN(t)||!isFinite(t)?null:t;case"boolean":return t;case"string":return this._xssFilter.process(t);case"object":return this._iterateOverObject(t,i);default:return i.allowUndefined&&typeof t>"u"?void 0:null}},e.prototype.sanitizeUrl=function(t,i){var r=(i??{}).isProtocolRequired,s=r===void 0?!0:r,n=this._trim(t.substring(0,t.indexOf(":"))),c=t==="/",o=/^#/.test(t),f=n&&this.allowedProtocols.indexOf(n.toLowerCase())>-1;return c||o||f?Fd.exports.escapeAttrValue(t):!n&&!s?Fd.exports.escapeAttrValue("https://".concat(t)):""},e.prototype.sanitizeHTMLAttribute=function(t,i,r,s){return typeof this.xssFilterOptions.safeAttrValue=="function"?this.xssFilterOptions.safeAttrValue(t,i,r,s):Fd.exports.safeAttrValue(t,i,r,s)},e.prototype.validate=function(t,i){i===void 0&&(i={});var r=this.sanitize(t,i);return{isValid:t===r,sanitized:r}},e.prototype.encodeHTML=function(t){var i=this;return String(t).replace(/[&<>"'\/]/g,function(r){return i._entityMap[r]})},e.prototype.encodeAttrValue=function(t){var i=/^[a-zA-Z0-9]$/;return String(t).replace(/[\x00-\xFF]/g,function(r,s){return i.test(r)?r:"&#x".concat(Number(t.charCodeAt(s)).toString(16),";")})},e.prototype._extendObjectOfArrays=function(t){var i={};return t.forEach(function(r){Object.keys(r).forEach(function(s){Array.isArray(r[s])&&Array.isArray(i[s])?i[s]=i[s].concat(r[s]):i[s]=r[s]})}),i},e.prototype._iterateOverObject=function(t,i){var r=this;i===void 0&&(i={});try{var s=!1,n=void 0;if(Array.isArray(t))n=t.reduce(function(o,f){var g=r.validate(f,i);return g.isValid?o.concat([f]):(s=!0,o.concat([g.sanitized]))},[]);else if(Jee(t)){var c=Object.keys(t);n=c.reduce(function(o,f){var g=t[f],S=r.validate(g,i);return S.isValid?o[f]=g:(s=!0,o[f]=S.sanitized),o},{})}else return i.allowUndefined&&typeof t>"u"?void 0:null;return s?n:t}catch{return null}},e.prototype._trim=function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},e}();const Ux=new Map;function wF(){Ux.clear()}function jte(e){return Ux.get(e)}function Vte(e,t){Ux.set(e,t)}function GS(e){Ux.delete(e)}const Gte=()=>_t.getLogger("esri.widgets.support.widgetUtils");function qte(...e){const t=kn.acquire();for(let r=0;r{const e=new Map,t=new ResizeObserver(r=>{var s;wF();for(const n of r)(s=e.get(n.target))==null||s(n)}),i=(r,s,n)=>(e.has(r)&&Gte().error("Already observing element",r),e.set(r,s),t.observe(r,n),er(()=>{t.unobserve(r),e.delete(r)}));return(r,s,n)=>{let c=null;return h_([ti(()=>typeof r=="function"?r():r,o=>{c==null||c.remove(),o&&(c=i(o,s,n))},Fa),er(()=>c==null?void 0:c.remove())])}})();function Hte(e){const t=e==null?void 0:e.closest("[dir]");return t!==null&&t instanceof HTMLElement&&t.dir==="rtl"||document.dir==="rtl"}function m0e(e){const t="data-node-ref";this[e.getAttribute(t)]=null}function y0e(e){const t="data-node-ref";this[e.getAttribute(t)]=e}const Wte=["dd","dl","dt","h1","h2","h3","h4","h5","h6","sub","sup","animate","animatetransform","circle","clippath","defs","ellipse","g","image","line","lineargradient","marker","mask","path","pattern","polygon","polyline","radialgradient","rect","stop","svg","switch","symbol","text","textpath","tspan","use"],Zte=Wte.reduce((e,t)=>(e[t]=[],e),{}),Yte=["align","alink","alt","bgcolor","border","cellpadding","cellspacing","class","color","cols","colspan","coords","d","dir","face","height","hspace","ismap","lang","marginheight","marginwidth","multiple","nohref","noresize","noshade","nowrap","ref","rel","rev","rows","rowspan","scrolling","shape","span","summary","tabindex","title","usemap","valign","value","vlink","vspace","width"],xF=new Ute({whiteList:Zte,onTagAttr:(e,t,i)=>{const r=`${t}="${i}"`;if(Yte.includes(t))return r},stripIgnoreTag:!0,stripIgnoreTagBody:["script","style"]},!0);function Jte(e){return e==="Enter"||e===" "}const SF="http://www.w3.org/",jx=`${SF}2000/svg`,TF=`${SF}1999/xlink`;let rR=[],m3=(e,t)=>{let i={};return Object.keys(e).forEach(r=>{i[r]=e[r]}),t&&Object.keys(t).forEach(r=>{i[r]=t[r]}),i},y3=(e,t)=>e.vnodeSelector===t.vnodeSelector&&(e.properties&&t.properties?e.properties.key===t.properties.key&&e.properties.bind===t.properties.bind:!e.properties&&!t.properties),EF=e=>{if(typeof e!="string")throw new Error("Style values must be strings")},Kte=(e,t,i)=>{if(t.vnodeSelector!==""){for(let r=i;r{let s=e[t];if(s.vnodeSelector==="")return;let n=s.properties;if(!(n&&(n.key===void 0?n.bind:n.key))){for(let c=0;c{if(e.properties){let t=e.properties.enterAnimation;t&&t(e.domNode,e.properties)}},BE=[],UE=!1,MF=e=>{(e.children||[]).forEach(MF),e.properties&&e.properties.afterRemoved&&e.properties.afterRemoved.apply(e.properties.bind||e.properties,[e.domNode])},sR=()=>{UE=!1,BE.forEach(MF),BE.length=0},nR=e=>{BE.push(e),UE||(UE=!0,typeof window<"u"&&"requestIdleCallback"in window?window.requestIdleCallback(sR,{timeout:16}):setTimeout(sR,16))},oR=e=>{let t=e.domNode;if(e.properties){let i=e.properties.exitAnimation;if(i)return t.style.pointerEvents="none",void i(t,()=>{t.parentNode&&(t.parentNode.removeChild(t),nR(e))},e.properties)}t.parentNode&&(t.parentNode.removeChild(t),nR(e))},Qte=(e,t,i)=>{if(!t)return;let r=i.eventHandlerInterceptor,s=Object.keys(t),n=s.length;for(let c=0;c{if(t)for(let r of t)nm(r,e,void 0,i)},IF=(e,t,i)=>{eie(e,t.children,i),t.text&&(e.textContent=t.text),Qte(e,t.properties,i),t.properties&&t.properties.afterCreate&&t.properties.afterCreate.apply(t.properties.bind||t.properties,[e,i,t.vnodeSelector,t.properties,t.children])},nm=(e,t,i,r)=>{let s,n=0,c=e.vnodeSelector,o=t.ownerDocument;if(c==="")s=e.domNode=o.createTextNode(e.text),i!==void 0?t.insertBefore(s,i):t.appendChild(s);else{for(let f=0;f<=c.length;++f){let g=c.charAt(f);if(f===c.length||g==="."||g==="#"){let S=c.charAt(n-1),I=c.slice(n,f);S==="."?s.classList.add(I):S==="#"?s.id=I:(I==="svg"&&(r=m3(r,{namespace:jx})),r.namespace!==void 0?s=e.domNode=o.createElementNS(r.namespace,I):(s=e.domNode=e.domNode||o.createElement(I),I==="input"&&e.properties&&e.properties.type!==void 0&&s.setAttribute("type",e.properties.type)),i!==void 0?t.insertBefore(s,i):s.parentNode!==t&&t.appendChild(s)),n=f+1}}IF(s,e,r)}},VE=(e,t,i)=>{t&&t.split(" ").forEach(r=>{r&&e.classList.toggle(r,i)})},tie=(e,t,i,r)=>{if(!i)return;let s=!1,n=Object.keys(i),c=n.length;for(let o=0;o{if(i===r)return!1;r=r||rR;let n,c=(i=i||rR).length,o=r.length,f=0,g=0,S=!1;for(;g=0){for(n=f;nf)for(n=f;n{let r=e.domNode,s=!1;if(e===t)return!1;let n=!1;if(t.vnodeSelector===""){if(t.text!==e.text){let c=r.ownerDocument.createTextNode(t.text);return r.parentNode.replaceChild(c,r),t.domNode=c,s=!0,s}t.domNode=r}else t.vnodeSelector.lastIndexOf("svg",0)===0&&(i=m3(i,{namespace:jx})),e.text!==t.text&&(n=!0,t.text===void 0?r.removeChild(r.firstChild):r.textContent=t.text),t.domNode=r,n=iie(t,r,e.children,t.children,i)||n,n=tie(r,e.properties,t.properties,i)||n,t.properties&&t.properties.afterUpdate&&t.properties.afterUpdate.apply(t.properties.bind||t.properties,[r,i,t.vnodeSelector,t.properties,t.children]);return n&&t.properties&&t.properties.updateAnimation&&t.properties.updateAnimation(r,t.properties,e.properties),s};let bg=(e,t)=>({getLastRender:()=>e,update:i=>{if(e.vnodeSelector!==i.vnodeSelector)throw new Error("The selector for the root VNode may not be changed. (consider using dom.merge and add one extra level to the virtual DOM)");let r=e;e=i,Cw(r,i,t)},domNode:e.domNode});const rie={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,t,i)=>{t.charAt(0)==="-"?e.style.setProperty(t,i):e.style[t]=i}};let Lf=e=>m3(rie,e),lh={create:(e,t)=>(t=Lf(t),nm(e,document.createElement("div"),void 0,t),bg(e,t)),append:(e,t,i)=>(i=Lf(i),nm(t,e,void 0,i),bg(t,i)),insertBefore:(e,t,i)=>(i=Lf(i),nm(t,e.parentNode,e,i),bg(t,i)),merge:(e,t,i)=>(i=Lf(i),t.domNode=e,IF(e,t,i),bg(t,i)),replace:(e,t,i)=>(i=Lf(i),nm(t,e.parentNode,e,i),e.parentNode.removeChild(e),bg(t,i))},AF,sie=(e,t)=>{let i=[];for(;e&&e!==t;)i.push(e),e=e.parentNode;return i};AF=Array.prototype.find?(e,t)=>e.find(t):(e,t)=>e.filter(t)[0];let nie=(e,t)=>{let i=e;return t.forEach(r=>{i=i&&i.children?AF(i.children,s=>s.domNode===r):void 0}),i},oie=(e,t,i)=>{let r=function(s){i("domEvent",s);let n=t(),c=sie(s.currentTarget,n.domNode);c.reverse();let o,f=nie(n.getLastRender(),c);return e.scheduleRender(),f&&(o=f.properties[`on${s.type}`].apply(f.properties.bind||this,arguments)),i("domEventProcessed",s),o};return(s,n,c,o)=>r},aR=e=>{let t,i,r=Lf(e),s=r.performanceLogger,n=!0,c=!1,o=[],f=[],g=(I,A,O)=>{let z,V=()=>z;r.eventHandlerInterceptor=oie(t,V,s),z=I(A,O(),r),o.push(z),f.push(O)},S=()=>{if(i=void 0,n){n=!1,s("renderStart",void 0);for(let I=0;I{i||c||(i=requestAnimationFrame(S))},stop:()=>{i&&(cancelAnimationFrame(i),i=void 0),c=!0},resume:()=>{c=!1,n=!0,t.scheduleRender()},append:(I,A)=>{g(lh.append,I,A)},insertBefore:(I,A)=>{g(lh.insertBefore,I,A)},merge:(I,A)=>{g(lh.merge,I,A)},replace:(I,A)=>{g(lh.replace,I,A)},detach:I=>{for(let A=0;A0}get updating(){var t;return((t=this._watchUpdatingTracking)==null?void 0:t.updating)??!1}initialize(){const t=document.createElement("div");t.className="esri-overlay-surface",this._set("surface",t),this._hiddenSurface=document.createElement("div"),this._hiddenSurface.setAttribute("style","visibility: hidden;"),t.appendChild(this._hiddenSurface),this._watchUpdatingTracking.addOnCollectionChange(()=>this.items,i=>{for(const r of i.added){const s=()=>r.render();this._callbacks.set(r,s),this._projector.append(this.surface,s)}for(const r of i.removed){const s=this._projector.detach(this._callbacks.get(r));this.surface.removeChild(s.domNode),this._callbacks.delete(r)}})}addItem(t){this.items.add(t)}removeItem(t){this.items.remove(t)}destroy(){this.items.removeAll(),this._callbacks.forEach(t=>this._projector.detach(t)),this._callbacks=null,this._projector=null,this._watchUpdatingTracking.destroy()}render(){this._projector.renderNow()}computeBoundingRect(t){const i=this._hiddenSurface,r=this._hiddenProjector;let s;const n=()=>(s=t.render(),s);r.append(i,n),r.renderNow();const c={left:0,top:0,right:0,bottom:0};if(s!=null&&s.domNode){const o=s.domNode.getBoundingClientRect();c.left=o.left,c.top=o.top,c.right=o.right,c.bottom=o.bottom}for(r.detach(n);i.firstChild;)i.removeChild(i.firstChild);return c}overlaps(t,i){const r=this.computeBoundingRect(t),s=this.computeBoundingRect(i);return Math.max(r.left,s.left)<=Math.min(r.right,s.right)&&Math.max(r.top,s.top)<=Math.min(r.bottom,s.bottom)}get hasVisibleItems(){return this.items.some(t=>t.visible)}async prepare(){await document.fonts.load(this._fontString()).catch(()=>{})}renderCanvas(t,i){const r=!!(i!=null&&i.disableDecorations);if(!this.items.some(n=>n.visible&&!(r&&n.isDecoration)))return;const s=t.getContext("2d");s.save(),s.font=this._fontString(),this.items.forEach(n=>{r&&n.isDecoration||(s.save(),n.renderCanvas(s),s.restore())}),s.restore()}_fontString(){return`10px ${getComputedStyle(this.surface).fontFamily}`}};v([M({readOnly:!0})],ku.prototype,"surface",void 0),v([M({readOnly:!0})],ku.prototype,"items",void 0),v([M({readOnly:!0})],ku.prototype,"needsRender",null),v([M({readOnly:!0})],ku.prototype,"_watchUpdatingTracking",void 0),v([M({readOnly:!0})],ku.prototype,"updating",null),ku=v([fe("esri.views.overlay.ViewOverlay")],ku);const lR=ku,HS=[0,0];function aie(e){const t=(e.ownerDocument||window.document).defaultView,i=e.getBoundingClientRect();return HS[0]=i.left+((t==null?void 0:t.pageXOffset)??0),HS[1]=i.top+((t==null?void 0:t.pageYOffset)??0),HS}function cR(e){e&&(oF(e),e.parentNode&&e.parentNode.removeChild(e))}function lie(e){const t=document.createElement("div");return e.appendChild(t),t}const wg=16,wv=750,cie=512,uie=2,hie=e=>{let t=class extends e{constructor(...i){super(...i),this._freqInfo={freq:wg,time:wv},this._overlayRenderTaskHandle=null,this.height=0,this.messagesCommon=null,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.ui=null,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([ti(()=>this.cursor,r=>{const{surface:s}=this;s&&s.setAttribute("data-cursor",r)}),ti(()=>this.navigating,r=>{const{surface:s}=this;s&&s.setAttribute("data-navigating",r.toString())})])}initialize(){const i=Le("mac"),r=async()=>{i&&(await $x(()=>this.ready),this.messagesCommon=await DA("esri/t9n/common").catch(()=>{}))};r(),this.addHandles([ti(()=>this.ui,(s,n)=>this._handleUIChange(s,n),_n),this.on("focus",()=>this.notifyChange("focused")),this.on("blur",()=>this.notifyChange("focused")),CA(r),ti(()=>[this.surface,this.messagesCommon],()=>{var s,n,c;i&&((c=this.surface)==null||c.setAttribute("aria-label",((n=(s=this.messagesCommon)==null?void 0:s.ariaLabels)==null?void 0:n.navigationMacVoiceOver)??""))})])}destroy(){this.destroyed||(this.ui=lr(this.ui),this.container=null)}get container(){return this._get("container")??null}set container(i){const r=this._get("container"),s=p3(i);if(s||typeof i!="string"||_t.getLogger(this).error("#container",`element with id '${i}' not found`),r===s)return;if(this._stopMeasuring(),r&&(r.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this.root&&(cR(this.root),this._set("root",null)),this.userContent&&(Xk(this.userContent,r),cR(this.userContent),this._set("userContent",null))),!s)return this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),void this._set("container",null);s.classList.add("esri-view");const n=document.createElement("div");n.className="esri-view-user-storage",Xk(s,n),s.appendChild(n),this._set("userContent",n);const c=document.createElement("div");c.className="esri-view-root",s.insertBefore(c,s.firstChild),this._set("root",c);const o=document.createElement("div");o.className="esri-view-surface",o.setAttribute("role","application"),o.tabIndex=0,c.appendChild(o),this._set("surface",o);const f=new lR;c.appendChild(f.surface),this._set("overlay",f),this.addHandles(ti(()=>f.needsRender,g=>{g&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=Mm({render:()=>{var S;return(S=this.overlay)==null?void 0:S.render()}}):this._overlayRenderTaskHandle=Sr(this._overlayRenderTaskHandle)})),this.forceDOMReadyCycle(),this._set("container",s),this._startMeasuring()}get focused(){const i=document.activeElement===this.surface;return document.hasFocus()&&i}get size(){return[this.width,this.height]}blur(){var i;(i=this.surface)==null||i.blur()}focus(){var i;(i=this.surface)==null||i.focus()}pageToContainer(i,r,s){const n=this.position;return i-=n?n[0]:0,r-=n?n[1]:0,s?(s[0]=i,s[1]=r):s=[i,r],s}containerToPage(i,r,s){const n=this.position;return i+=n?n[0]:0,r+=n?n[1]:0,s?(s[0]=i,s[1]=r):s=[i,r],s}_handleUIChange(i,r){this.removeHandles("ui"),r&&r!==i&&r.destroy(),i&&(i.view=this,this.addHandles(ti(()=>this.root,s=>{i.container=s?lie(s):null},_n),"ui")),this._set("ui",i)}_stopMeasuring(){this.removeHandles("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const i=this._freqInfo;i.freq=wg,i.time=wv,this.addHandles([f_(window,"resize",()=>{i.freq=wg,i.time=wv}),Mm({prepare:r=>{const s=this._measure(),n=this._freqInfo;if(n.time+=r.deltaTime,s&&(n.freq=wg,this._get("resizing")||this._set("resizing",!0)),n.time=cie&&this._get("resizing")&&this._set("resizing",!1)}})],"measuring"),this._measure(),this._position()}_measure(){const i=this.container,r=i?i.clientWidth:0,s=i?i.clientHeight:0;if(r===0||s===0)return this.suspended||this._set("suspended",!0),!1;const n=this.width,c=this.height;return r===n&&s===c?(this.suspended&&this._set("suspended",!1),!1):(this._set("width",r),this._set("height",s),this.suspended&&this._set("suspended",!1),this.emit("resize",{oldWidth:n,oldHeight:c,width:r,height:s}),!0)}_position(){const i=this.container,r=this.position,s=i&&aie(i);return!!s&&(!r||s[0]!==r[0]||s[1]!==r[1])&&(this._set("position",[s[0],s[1]]),!0)}forceDOMReadyCycle(){}};return v([M()],t.prototype,"container",null),v([M({readOnly:!0})],t.prototype,"focused",null),v([M({readOnly:!0})],t.prototype,"height",void 0),v([M()],t.prototype,"messagesCommon",void 0),v([M({type:lR})],t.prototype,"overlay",void 0),v([M({readOnly:!0})],t.prototype,"position",void 0),v([M({readOnly:!0})],t.prototype,"resizing",void 0),v([M({readOnly:!0})],t.prototype,"root",void 0),v([M({value:null,readOnly:!0})],t.prototype,"size",null),v([M({readOnly:!0})],t.prototype,"surface",void 0),v([M({readOnly:!0})],t.prototype,"suspended",void 0),v([M()],t.prototype,"ui",void 0),v([M({readOnly:!0})],t.prototype,"userContent",void 0),v([M({readOnly:!0})],t.prototype,"width",void 0),v([M()],t.prototype,"widthBreakpoint",void 0),t=v([fe("esri.views.DOMContainer")],t),t};let die=class{constructor(t,i){this._owner=i,this._properties={},this._afterDispatchHandle=null;for(const r in t){const s=t[r],n=new K5(s,void 0,void 0,2,2);this._properties[r]={pool:n,acquired:[]}}this._afterDispatchHandle=UG(()=>this._release())}destroy(){this._afterDispatchHandle&&(this._afterDispatchHandle.remove(),this._afterDispatchHandle=null);for(const t in this._properties){const i=this._properties[t];for(const r of i.acquired)p$(r)||i.pool.release(r);i.pool.destroy(),i.pool=null,i.acquired=null}this._properties=null,this._owner=null}get(t){const i=this._owner._get(t),r=this._properties[t];let s=r.pool.acquire();for(r.acquired.push(s);s===i;)r.acquired.push(s),s=r.pool.acquire();return s}_release(){for(const t in this._properties){const i=this._properties[t];let r=0;for(const s of i.acquired)p$(s)?i.acquired[r++]=s:i.pool.release(s);i.acquired.length=r}}};const pie=Le("mac")?"Meta":"Ctrl",fie=new Set(["Alt","Ctrl","Meta","Shift","Primary"]),mie=e=>fie.has(e);let yie=class{constructor(t,i=[]){this.eventType=t,this.keyModifiers=i}matches(t){if(t.type!==this.eventType)return!1;if(this.keyModifiers.length===0)return!0;const i=t.modifiers;for(const r of this.keyModifiers)if(!i.has(r))return!1;return!0}};const uR=()=>_t.getLogger("esri.views.input.InputHandler");let bs=class{constructor(t){this._manager=null,this._incoming={},this._outgoing={},this._incomingEventMatches=null,this._incomingEventTypes=null,this._outgoingEventTypes=null,this._hasSideEffects=t}get incomingEventMatches(){if(!this._incomingEventMatches){this._incomingEventMatches=[];for(const t in this._incoming){const i=this._incoming[t];for(const r of i)this._incomingEventMatches.push(r.match)}}return this._incomingEventMatches}get incomingEventTypes(){return this._incomingEventTypes||(this._incomingEventTypes=this.incomingEventMatches.map(t=>t.eventType)),this._incomingEventTypes}get outgoingEventTypes(){return this._outgoingEventTypes||(this._outgoingEventTypes=Object.keys(this._outgoing)),this._outgoingEventTypes}get hasSideEffects(){return this._hasSideEffects}get hasPendingInputs(){return!1}onInstall(t){this._manager?uR().error("This InputHandler has already been registered with an InputManager"):(t.setEventCallback(i=>this._handleEvent(i)),t.setUninstallCallback(()=>this._onUninstall()),this._manager=t)}onUninstall(){}registerIncoming(t,i,r){let s;typeof i=="function"?(r=i,s=[]):s=i||[];const n=typeof t=="string"?new yie(t,s):t,c=()=>{this._incomingEventTypes=null,this._incomingEventMatches=null},o=S=>{const I=this._incoming[S.match.eventType];if(I){const A=I.indexOf(S);I.splice(A,1),c(),this._manager&&this._manager.updateDependencies()}},f=new gie(n,r,{onPause:o,onRemove:o,onResume:S=>{const I=this._incoming[S.match.eventType];I&&!I.includes(S)&&(I.push(S),c(),this._manager&&this._manager.updateDependencies())}});let g=this._incoming[n.eventType];return g||(g=[],this._incoming[n.eventType]=g),g.push(f),c(),this._manager&&this._manager.updateDependencies(),f}registerOutgoing(t){if(this._outgoing[t])throw new Error("There is already a callback registered for this outgoing InputEvent: "+t);const i=new _ie(t,{onEmit:(r,s,n,c)=>{var o;(o=this._manager)==null||o.emit(r.eventType,s,n,c)},onRemove:r=>{var s;delete this._outgoing[r.eventType],(s=this._manager)==null||s.updateDependencies()}});return this._outgoing[t]=i,this._outgoingEventTypes=null,this._manager&&this._manager.updateDependencies(),i}startCapturingPointer(t){var i;(i=this._manager)==null||i.setPointerCapture(t,!0)}stopCapturingPointer(t){var i;(i=this._manager)==null||i.setPointerCapture(t,!1)}refreshHasPendingInputs(){var t;(t=this._manager)==null||t.refreshHasPendingInputs()}_onUninstall(){this._manager?(this.onUninstall(),this._manager=null):uR().error("This InputHandler is not registered with an InputManager")}_handleEvent(t){var r;const i=this._incoming[t.type];if(i){for(const s of i)if(s.match.matches(t)&&((r=s.callback)==null||r.call(s,t),t.shouldStopPropagation()))break}}},gie=class{constructor(t,i,r){this.match=t,this._callback=i,this._handler=r}pause(){this._handler.onPause(this)}resume(){this._handler.onResume(this)}remove(){this._handler.onRemove(this)}get callback(){return this._callback}},_ie=class{constructor(t,i){this.eventType=t,this._removed=!1,this._handler=i}emit(t,i,r){this._removed||this._handler.onEmit(this,t,i,r)}remove(){this._removed=!0,this._handler.onRemove(this)}},vie=class extends bs{constructor(t){super(!0),this._onChange=t,this._value="mouse",this._x=null,this._y=null,this.registerIncoming("pointer-move",i=>{this._update(i.data)})}_update(t){const i=t.native.pointerType==="touch"?"touch":"mouse",{x:r,y:s}=t;i===this._value&&this._x===r&&this._y===s||(this._value=i,this._x=r,this._y=s,this._onChange(i,r,s))}},bie=class{constructor(t,i){this._observable=new g_,this._value=t,this._equalityFunction=i}get value(){return Rt(this._observable),this._value}set value(t){this._equalityFunction(t,this._value)||(this._value=t,this._observable.notify())}mutate(t){t(this._value),this._observable.notify()}};function PF(e,t=$5){return new bie(e,t)}let wie=class extends bs{get multiTouchActive(){return this._multiTouchActive.value}constructor(){super(!0),this._activeTouchPointerIds=new Set,this._multiTouchActive=PF(!1),this._onPointerAdd=({data:t})=>{t.pointerType==="touch"&&(this._activeTouchPointerIds.add(t.native.pointerId),this._update())},this._onPointerRemove=({data:t})=>{t.pointerType==="touch"&&(this._activeTouchPointerIds.delete(t.native.pointerId),this._update())},this.registerIncoming("pointer-down",this._onPointerAdd),this.registerIncoming("pointer-up",this._onPointerRemove),this.registerIncoming("pointer-capture-lost",this._onPointerRemove),this.registerIncoming("pointer-cancel",this._onPointerRemove)}_update(){this._multiTouchActive.value=this._activeTouchPointerIds.size>1}},Go=class extends Nt{constructor(t){super(t),this._pointerCaptures=new Map,this._nameToGroup={},this._handlers=[],this._handlersPriority=[],this._currentPropagation=null,this._updateDependenciesAfterPropagation=!1,this._sourceEvents=new Set,this._keyModifiers=new Set,this._activeKeyModifiers=new Set,this._stoppedPropagationEventIds=new Set,this.primaryKey=pie,this._latestPointerType="mouse",this._propertiesPool=new die({latestPointerLocation:Tie},this),this.latestPointerLocation=null,this._paused=!1,this.test={timestamp:void 0,hasCurrentPropagation:()=>!!this._currentPropagation}}initialize(){this.eventSource.onEventReceived=this._onEventReceived.bind(this),this._installRecognizers()}destroy(){const t=Object.keys(this._nameToGroup);for(const i of t)this.uninstallHandlers(i);this.eventSource.destroy(),this._currentPropagation=null,this._propertiesPool.destroy()}get hasPendingInputs(){return this._handlers.some(t=>t.handler.hasPendingInputs)}get latestPointerType(){return this._latestPointerType}get multiTouchActive(){return this._multiTouchHandler.multiTouchActive}get updating(){return this.hasPendingInputs||this._paused}installHandlers(t,i,r=uh.INTERNAL){if(this._nameToGroup[t])return void _t.getLogger(this).error("There is already an InputHandler group registered under the name `"+t+"`");if(i.length===0)return void _t.getLogger(this).error("Can't register a group of zero handlers");const s={name:t,handlers:i.map(n=>({handler:n,active:!0,removed:!1,priorityIndex:0,groupPriority:r,eventCallback:null,uninstallCallback:null}))};this._nameToGroup[t]=s;for(let n=s.handlers.length-1;n>=0;n--){const c=s.handlers[n];this._handlers.push(c),c.handler.onInstall({updateDependencies:()=>{this.updateDependencies()},emit:(o,f,g,S,I)=>{this._emitInputEvent(c.priorityIndex+1,o,f,g,I,S)},setPointerCapture:(o,f)=>{this._setPointerCapture(s,c,o,f)},setEventCallback:o=>{c.eventCallback=o},setUninstallCallback:o=>{c.uninstallCallback=o},refreshHasPendingInputs:()=>{this.notifyChange("hasPendingInputs")}})}this.updateDependencies()}uninstallHandlers(t){const i=this._nameToGroup[t];i?(i.handlers.forEach(r=>{var s;r.removed=!0,(s=r.uninstallCallback)==null||s.call(r)}),delete this._nameToGroup[t],this._currentPropagation?this._currentPropagation.needsHandlerGarbageCollect=!0:this._garbageCollectRemovedHandlers()):_t.getLogger(this).error("There is no InputHandler group registered under the name `"+t+"`")}hasHandlers(t){return this._nameToGroup[t]!==void 0}isModifierKeyDown(t){return this._activeKeyModifiers&&this._activeKeyModifiers.has(t)}updateDependencies(){if(this._currentPropagation)return void(this._updateDependenciesAfterPropagation=!0);this._updateDependenciesAfterPropagation=!1;const t=new Set,i=new Set;this._handlersPriority=[];for(let r=this._handlers.length-1;r>=0;r--){const s=this._handlers[r];s.priorityIndex=r,this._handlersPriority.push(s)}this._handlersPriority=this._sortHandlersPriority(this._handlersPriority);for(let r=this._handlersPriority.length-1;r>=0;r--){const s=this._handlersPriority[r];s.priorityIndex=r;let n=s.handler.hasSideEffects;if(!n){for(const c of s.handler.outgoingEventTypes)if(t.has(c)){n=!0;break}}if(n)for(const c of s.handler.incomingEventMatches){t.add(c.eventType);for(const o of c.keyModifiers)mie(o)||i.add(o)}s.active=n}this._sourceEvents=t,this._keyModifiers=i,this._pointerCaptures.size>0&&this._sourceEvents.add("pointer-capture-lost"),this._keyModifiers.size>0&&(this._sourceEvents.add("key-down"),this._sourceEvents.add("key-up")),this.eventSource&&(this.eventSource.activeEvents=this._sourceEvents)}_setLatestPointer(t,i,r){this._latestPointerType=t;const s=this._get("latestPointerLocation");if(s==null||s.x!==i||s.y!==r){const n=this._propertiesPool.get("latestPointerLocation");n.x=i,n.y=r,this._set("latestPointerLocation",n)}}_onEventReceived(t,i){if(t==="pointer-capture-lost"){const n=i;this._pointerCaptures.delete(n.native.pointerId)}this._updateKeyModifiers(t,i);const r=this.test.timestamp!=null?this.test.timestamp:i.native?i.native.timestamp:void 0,s=i.native?i.native.cancelable:void 0;this._emitInputEventFromSource(t,i,r,s)}_updateKeyModifiers(t,i){if(!i)return;let r=!1;const s=()=>{if(!r){const o=new Set;this._activeKeyModifiers.forEach(f=>{o.add(f)}),this._activeKeyModifiers=o,r=!0}},n=(o,f)=>{f&&!this._activeKeyModifiers.has(o)?(s(),this._activeKeyModifiers.add(o)):!f&&this._activeKeyModifiers.has(o)&&(s(),this._activeKeyModifiers.delete(o))};if(t==="key-down"||t==="key-up"){const o=i.key;this._keyModifiers.has(o)&&n(o,t==="key-down")}const c=i.native;n("Alt",!(!c||!c.altKey)),n("Ctrl",!(!c||!c.ctrlKey)),n("Shift",!(!c||!c.shiftKey)),n("Meta",!(!c||!c.metaKey)),n("Primary",this._activeKeyModifiers.has(this.primaryKey))}_installRecognizers(){this._latestPointerHandler=new vie((t,i,r)=>this._setLatestPointer(t,i,r)),this._multiTouchHandler=new wie,this.installHandlers("input-manager-logic",[this._latestPointerHandler,this._multiTouchHandler],uh.ALWAYS),this.recognizers.length>0&&this.installHandlers("default",this.recognizers,uh.INTERNAL)}_setPointerCapture(t,i,r,s){const n=t.name+"-"+i.priorityIndex,c=this._pointerCaptures.get(r.pointerId)||new Set;this._pointerCaptures.set(r.pointerId,c),s?(c.add(n),c.size===1&&this.eventSource&&this.eventSource.setPointerCapture(r,!0)):c.has(n)&&(c.delete(n),c.size===0&&(this._pointerCaptures.delete(r.pointerId),this.eventSource&&this.eventSource.setPointerCapture(r,!1)))}_garbageCollectRemovedHandlers(){this._handlers=this._handlers.filter(t=>!t.removed),this.updateDependencies()}_emitInputEventFromSource(t,i,r,s){this._emitInputEvent(0,t,i,r,s)}_emitInputEvent(t,i,r,s,n,c){const o=s!==void 0?s:this._currentPropagation?this._currentPropagation.timestamp:performance.now(),f=n!==void 0&&n,g={event:new xie(i,r,o,c||this._activeKeyModifiers,f),priorityIndex:t};this._currentPropagation?this._currentPropagation.events.push(g):this._doNewPropagation(g)}_doNewPropagation(t){this._currentPropagation={events:new Sw,currentHandler:null,needsHandlerGarbageCollect:!1,timestamp:t.event.timestamp},this._currentPropagation.events.push(t),this._continuePropagation()}_continuePropagation(){var i,r,s;this._paused=!1;const t=this._currentPropagation;if(t){for(;t.events.length>0;){const{event:n,priorityIndex:c}=t.events.pop(),o=(i=n.data)==null?void 0:i.eventId;if(!(o!=null&&this._stoppedPropagationEventIds.has(o)))for(t.currentHandler=this._handlersPriority[c];t.currentHandler;){if(t.currentHandler.removed)t.needsHandlerGarbageCollect=!0;else{if(t.currentHandler.active&&!n.shouldStopPropagation()&&((s=(r=t.currentHandler).eventCallback)==null||s.call(r,n)),n.shouldStopPropagation()){o!=null&&this._stoppedPropagationEventIds.add(o);break}if(n.shouldPausePropagation(()=>this._continuePropagation()))return void this._pausePropagation({event:n,priorityIndex:t.currentHandler.priorityIndex+1})}t.currentHandler=this._handlersPriority[t.currentHandler.priorityIndex+1]}}t.needsHandlerGarbageCollect&&this._garbageCollectRemovedHandlers(),this.hasPendingInputs||this._stoppedPropagationEventIds.clear(),this._currentPropagation=null,this._updateDependenciesAfterPropagation&&this.updateDependencies()}}_pausePropagation(t){const i=new Sw;i.push(t);const r=this._currentPropagation;if(r){for(;r.events.length;)i.push(r.events.pop());r.events=i,r.currentHandler=null,this._paused=!0}}_compareHandlerPriority(t,i){if(t.handler.hasSideEffects!==i.handler.hasSideEffects)return t.handler.hasSideEffects?1:-1;if(t.groupPriority!==i.groupPriority)return t.groupPriority>i.groupPriority?-1:1;for(const r of t.handler.incomingEventMatches)for(const s of i.handler.incomingEventMatches){if(r.eventType!==s.eventType)continue;const n=r.keyModifiers.filter(c=>s.keyModifiers.includes(c));if(n.length===r.keyModifiers.length!=(n.length===s.keyModifiers.length))return r.keyModifiers.length>s.keyModifiers.length?-1:1}return t.priorityIndex>i.priorityIndex?-1:1}_sortHandlersPriority(t){const i=[];for(const r of t){let s=0;for(;s=0;)s++;i.splice(s,0,r)}return i}get debug(){const t=i=>{const r=this._setPointerCapture;this._setPointerCapture=()=>{},i(),this._setPointerCapture=r};return{injectEvent:(i,r)=>{t(()=>{this._onEventReceived(i,r)})},disablePointerCapture:t}}};v([M({readOnly:!0})],Go.prototype,"hasPendingInputs",null),v([M({constructOnly:!0})],Go.prototype,"eventSource",void 0),v([M({constructOnly:!0})],Go.prototype,"recognizers",void 0),v([M()],Go.prototype,"_latestPointerType",void 0),v([M()],Go.prototype,"latestPointerType",null),v([M()],Go.prototype,"multiTouchActive",null),v([M({readOnly:!0})],Go.prototype,"latestPointerLocation",void 0),v([M()],Go.prototype,"_paused",void 0),v([M({readOnly:!0})],Go.prototype,"updating",null),Go=v([fe("esri.views.input.InputManager")],Go);let xie=class{constructor(t,i,r,s,n){this.type=t,this.data=i,this.timestamp=r,this.modifiers=s,this.cancelable=n,this._propagationState=eh.NONE,this._resumeCallback=null}stopPropagation(){this._propagationState|=eh.STOPPED}shouldStopPropagation(){return(this._propagationState&eh.STOPPED)!=0}async(t){this._propagationState|=eh.PAUSED;const i=(r,s)=>{this._propagationState&=~eh.PAUSED;const n=this._resumeCallback;if(this._resumeCallback=null,n&&n(),s)throw r;return r};return(typeof t=="function"?t():t).then(r=>i(r,!1),r=>i(r,!0))}shouldPausePropagation(t){return!!(this._propagationState&eh.PAUSED)&&(this._resumeCallback=t,!0)}preventDefault(){this.data.native.preventDefault()}};var eh;(function(e){e[e.NONE=0]="NONE",e[e.STOPPED=1]="STOPPED",e[e.PAUSED=2]="PAUSED"})(eh||(eh={}));const uh={ALWAYS:1,DEFAULT:0,TOOL:-1,WIDGET:-2,INTERNAL:-3};let Sie=class{};const Tie=Sie;function ul(e){return e!=null&&"open"in e&&"declaredClass"in e}function hR(e){return e!=null&&"declaredClass"in e&&"dockOptions"in e}const Eie=e=>{let t=class extends e{constructor(){super(...arguments),this._popupSetupTask=null,this.popup={},this.popupEnabled=!0}initialize(){this.addHandles([ti(()=>[this.ui,this.popup],([i,r],s)=>{const n="popup",c="manual";if(s){const[o,f]=s;o&&ul(f)&&(f.view=null,hR(f)&&o.remove(f,n))}i&&ul(r)&&(r.view=this,hR(r)&&i.add(r,{key:n,position:c,internal:!0}))},_n),this.on("click",i=>{this.popup&&this.popupEnabled&&(i.pointerType!=="mouse"||i.button===0)&&(!ul(this.popup)&&"autoOpenEnabled"in this.popup&&this.popup.autoOpenEnabled===!1||(ul(this.popup)?this.popup.viewModel.handleViewClick(i):i.async(async()=>{await this.setupPopup(),ul(this.popup)&&!this.destroyed&&this.ready&&this.popupEnabled&&this.popup.viewModel.handleViewClick(i)})))},uh.WIDGET)]),$x(()=>this.ready&&this.popupEnabled&&!this.updating).then(()=>{ht(()=>import("./Popup-DSVql8fN.js"),__vite__mapDeps([116,1,117,118,13,93,119,79,120,121,71,101,122,123,124,125,126,34,32,127,11,12,128,62,60,61,22,25,63,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,81,38,145,146,147,148,149,150,151,152,153,154,155,6,156,157]))})}destroy(){this.destroyed||this.closePopup()}async openPopup(i){if(ul(this.popup))return this.popup.open(i);try{if(await this.setupPopup(),!this.popup)return void _t.getLogger(this).error(new Je("view:null-popup","Popup is null and can't be opened"));this.popup.open(i)}catch{}}closePopup(){var i;(i=this._popupSetupTask)==null||i.abort(),ul(this.popup)&&this.popup.close()}async fetchPopupFeatures(i,r){return await this.when(),this._popupHitsToFeatures(await this._getPopupHits(i,r),r)}async setupPopup(){var i;if((i=this._popupSetupTask)==null||i.abort(),this.popup&&!ul(this.popup))return this._popupSetupTask=_x(async r=>{const{default:s}=await ht(()=>import("./Popup-DSVql8fN.js"),__vite__mapDeps([116,1,117,118,13,93,119,79,120,121,71,101,122,123,124,125,126,34,32,127,11,12,128,62,60,61,22,25,63,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,81,38,145,146,147,148,149,150,151,152,153,154,155,6,156,157]));if(mr(r),!this.popup||ul(this.popup))return;const n=this.popup;delete n.open,delete n.close,this.popup=new s(n)}),this._popupSetupTask.promise}async _popupHitsToFeatures({location:i,hits:r},s){const n=[],c=[];let o=!1;const f=_G(s,Le("popup-view-fetch-timeout")??Iie),g=A=>{const O=new Mie(A);return c.push(O),n.push(O.promise),O},S=A=>{const O=c.at(-1);return O&&O.layerView===A&&!o?O:g(A)};for(const A of r)"graphic"in A?(S(A.layerView).graphics.push(A.graphic),o=!1):(n.push(A.layerView.fetchPopupFeaturesAtLocation(A.mapPoint,f)),o=!0);c.map(A=>A.resolve(f));const I=gG(n).then(A=>A.filter(O=>!!O).flat());return{pendingFeatures:n,allGraphicsPromise:I,location:i}}async _getPopupHits(i,r){const{hits:s,location:n}=await this.popupHitTest(i);mr(r);const c=[];for(const o of s)if("graphic"in o){if(this._isValidPopupGraphic(o.graphic,r)){const f=this._isValidPopupGraphicsLayerView(o.layerView)?o.layerView:void 0;c.push({graphic:o.graphic,layerView:f})}}else this._isValidPopupLocationLayerView(o.layerView)&&c.push({mapPoint:o.mapPoint,layerView:o.layerView});return{hits:c,location:n}}_isValidPopupGraphic(i,r){return i&&!!i.getEffectivePopupTemplate(r!=null&&r.defaultPopupTemplateEnabled)}_isValidPopupGraphicsLayerView(i){return!i||(!("layer"in i)||!i.suspended)&&"fetchPopupFeaturesFromGraphics"in i}_isValidPopupLocationLayerView(i){return(!("layer"in i)||!i.suspended)&&"fetchPopupFeaturesAtLocation"in i}};return v([M({cast(i){return!i||ul(i)||typeof i=="object"&&(i.open=r=>(Em(_t.getLogger(this),"view.popup is no longer created by default. view.popup.open() will stop working when the popup isn't created",{replacement:"Use view.openPopup() instead.",version:"4.27"}),this.openPopup(r)),i.close=()=>(Em(_t.getLogger(this),"view.popup is no longer created by default. view.popup.close() will stop working when the popup isn't created",{replacement:"Use view.closePopup() instead.",version:"4.27"}),this.closePopup())),i}})],t.prototype,"popup",void 0),v([M()],t.prototype,"popupEnabled",void 0),t=v([fe("esri.views.PopupView")],t),t};let Mie=class{constructor(t){this.layerView=t,this._resolver=sa(),this.graphics=[]}get promise(){return this._resolver.promise}resolve(t){const{layerView:i,graphics:r,_resolver:s}=this;if(!i)return s.resolve(r),s.promise;let n;return i.fetchPopupFeaturesFromGraphics(r,t).catch(c=>(n=c,null)).then(c=>{c?s.resolve(c):s.reject(n)}),s.promise}};const Iie=5e3,dR={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8};function up(e,t,i,r=Dl){const s=new Ja(l3(r)),n=Jt.fromJSDate(e,{zone:s}),c=i==="decades"||i==="centuries"?"year":CF(i);return i==="decades"&&(t*=10),i==="centuries"&&(t*=100),n.plus({[c]:t}).toJSDate()}function pR(e,t,i=Dl){const r=new Ja(l3(i)),s=Jt.fromJSDate(e,{zone:r});if(t==="decades"||t==="centuries"){const c=s.startOf("year"),{year:o}=c,f=o-o%(t==="decades"?10:100);return c.set({year:f}).toJSDate()}const n=CF(t);return s.startOf(n).toJSDate()}function C0e(e,t,i){return e===0?0:e*dR[t]/dR[i]}function CF(e){switch(e){case"milliseconds":return"millisecond";case"seconds":return"second";case"minutes":return"minute";case"hours":return"hour";case"days":return"day";case"weeks":return"week";case"months":return"month";case"years":return"year"}}var Ma;let vo=Ma=class extends At{static get allTime(){return fR}static get empty(){return Aie}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return t.end!=null?new Date(t.end):null}writeEnd(e,t){t.end=(e==null?void 0:e.getTime())??null}get isAllTime(){return this.equals(Ma.allTime)}get isEmpty(){return this.equals(Ma.empty)}readStart(e,t){return t.start!=null?new Date(t.start):null}writeStart(e,t){t.start=(e==null?void 0:e.getTime())??null}clone(){return new Ma({end:this.end,start:this.start})}equals(e){var n,c,o,f;if(!e)return!1;const t=((n=this.start)==null?void 0:n.getTime())??this.start,i=((c=this.end)==null?void 0:c.getTime())??this.end,r=((o=e.start)==null?void 0:o.getTime())??e.start,s=((f=e.end)==null?void 0:f.getTime())??e.end;return t===r&&i===s}expandTo(e,t=Dl){if(this.isEmpty||this.isAllTime)return this.clone();let i=this.start;i&&(i=pR(i,e,t));let r=this.end;if(r){const s=pR(r,e,t);r=r.getTime()===s.getTime()?s:up(s,1,e,t)}return new Ma({start:i,end:r})}intersection(e){var o,f,g,S;if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return Ma.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=((o=this.start)==null?void 0:o.getTime())??-1/0,i=((f=this.end)==null?void 0:f.getTime())??1/0,r=((g=e.start)==null?void 0:g.getTime())??-1/0,s=((S=e.end)==null?void 0:S.getTime())??1/0;let n,c;if(r>=t&&r<=i?n=r:t>=r&&t<=s&&(n=t),i>=r&&i<=s?c=i:s>=t&&s<=i&&(c=s),n!=null&&c!=null&&!isNaN(n)&&!isNaN(c)){const I=new Ma;return I.start=n===-1/0?null:new Date(n),I.end=c===1/0?null:new Date(c),I}return Ma.empty}offset(e,t,i=Dl){if(this.isEmpty||this.isAllTime)return this.clone();const r=new Ma,{start:s,end:n}=this;return s!=null&&(r.start=up(s,e,t,i)),n!=null&&(r.end=up(n,e,t,i)),r}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return fR.clone();const t=this.start!=null&&e.start!=null?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,i=this.end!=null&&e.end!=null?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new Ma({start:t,end:i})}};v([M({type:Date,json:{write:{allowNull:!0}}})],vo.prototype,"end",void 0),v([mi("end")],vo.prototype,"readEnd",null),v([ui("end")],vo.prototype,"writeEnd",null),v([M({readOnly:!0,json:{read:!1}})],vo.prototype,"isAllTime",null),v([M({readOnly:!0,json:{read:!1}})],vo.prototype,"isEmpty",null),v([M({type:Date,json:{write:{allowNull:!0}}})],vo.prototype,"start",void 0),v([mi("start")],vo.prototype,"readStart",null),v([ui("start")],vo.prototype,"writeStart",null),vo=Ma=v([fe("esri.TimeExtent")],vo);const fR=new vo,Aie=new vo({start:void 0,end:void 0}),E_=vo;let T0=class extends Bt{constructor(t){super(t),this.addHandles([this.on("before-add",i=>{i.item==null&&i.preventDefault()}),this.on("after-add",i=>this._own(i.item)),this.on("after-remove",i=>this._release(i.item))])}get owner(){return this._get("owner")}set owner(t){t!==this._get("owner")&&(this._releaseAll(),this._set("owner",t),this._ownAll())}_ownAll(){for(const t of this.items)this._own(t)}_releaseAll(){for(const t of this.items)this._release(t)}_createNewInstance(t){return this.itemType?new(Bt.ofType(this.itemType.Type))(t):new Bt(t)}};function mR(e,t){return{type:e,cast:Y4,set(i){const r=mp(i,this._get(t),e);r.owner=this,this._set(t,r)}}}v([M()],T0.prototype,"owner",null),T0=v([fe("esri.core.support.OwningCollection")],T0);var kg;const $w=Bn()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),$F=$w.jsonValues.slice();w7($F,"orthometric");const E0=Bn()({meter:"meters",foot:"feet","us-foot":"us-feet","clarke-foot":"clarke-feet","clarke-yard":"clarke-yards","clarke-link":"clarke-links","sears-yard":"sears-yards","sears-foot":"sears-feet","sears-chain":"sears-chains","benoit-1895-b-chain":"benoit-1895-b-chains","indian-yard":"indian-yards","indian-1937-yard":"indian-1937-yards","gold-coast-foot":"gold-coast-feet","sears-1922-truncated-chain":"sears-1922-truncated-chains","50-kilometers":"50-kilometers","150-kilometers":"150-kilometers"});let Ia=kg=class extends At{constructor(e){super(e),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(e,t,i){return $w.write(e,t,i)}readHeightModel(e,t,i){return $w.read(e)||(i!=null&&i.messages&&i.messages.push(Pie(e,{context:i})),null)}readHeightUnit(e,t,i){return E0.read(e)||(i!=null&&i.messages&&i.messages.push(yR(e,{context:i})),null)}readHeightUnitService(e,t,i){return lN(e)||E0.read(e)||(i!=null&&i.messages&&i.messages.push(yR(e,{context:i})),null)}readVertCRS(e,t){return t.vertCRS||t.ellipsoid||t.geoid}clone(){return new kg({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS})}equals(e){return!!e&&(this===e||this.heightModel===e.heightModel&&this.heightUnit===e.heightUnit&&this.vertCRS===e.vertCRS)}static deriveUnitFromSR(e,t){const i=mW(t);return new kg({heightModel:e.heightModel,heightUnit:i??void 0,vertCRS:e.vertCRS})}write(e,t){return t={origin:"web-scene",...t},super.write(e,t)}static fromJSON(e){if(!e)return null;const t=new kg;return t.read(e,{origin:"web-scene"}),t}};function yR(e,t){return new jc("height-unit:unsupported",`Height unit of value '${e}' is not supported`,t)}function Pie(e,t){return new jc("height-model:unsupported",`Height model of value '${e}' is not supported`,t)}v([M({type:$w.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:$F,default:"ellipsoidal"}}}})],Ia.prototype,"heightModel",void 0),v([ui("web-scene","heightModel")],Ia.prototype,"writeHeightModel",null),v([mi(["web-scene","service"],"heightModel")],Ia.prototype,"readHeightModel",null),v([M({type:E0.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:E0.jsonValues,write:E0.write}}}})],Ia.prototype,"heightUnit",void 0),v([mi("web-scene","heightUnit")],Ia.prototype,"readHeightUnit",null),v([mi("service","heightUnit")],Ia.prototype,"readHeightUnitService",null),v([M({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],Ia.prototype,"vertCRS",void 0),v([mi("service","vertCRS",["vertCRS","ellipsoid","geoid"])],Ia.prototype,"readVertCRS",null),Ia=kg=v([fe("esri.geometry.HeightModelInfo")],Ia);const g3=Ia;let kw=class extends T0{constructor(t){super(t),this.addHandles(this.on("before-add",i=>{i.item!=null&&i.item.parent===this.owner&&(_t.getLogger(this).warn("Analysis inside the collection must be unique. Not adding this element again."),i.preventDefault())}))}_own(t){t.parent=this.owner}_release(t){t.parent=null}};kw=v([fe("esri.support.AnalysesCollection")],kw);async function Cie(e,t){const{WhereClause:i}=await ht(()=>import("./WhereClause-Ctld7DSu.js").then(r=>r.W),__vite__mapDeps([30,31,32]));return i.create(e,t)}function R0e(e,t){return e!=null&&e!==""?t!=null&&t!==""?`(${e}) AND (${t})`:e:t}function O0e(e){return typeof e=="number"}function _3(e){return typeof e=="string"||e instanceof String}const $ie="yyyy-MM-dd",kie="TT";var M0;(function(e){e.HM="HH:mm",e.HMS="HH:mm:ss",e.HMS_MS="HH:mm:ss.SSS"})(M0||(M0={}));const Rie=[M0.HMS_MS,M0.HMS,M0.HM,kie];function gR(e){if(!e||!_3(e))return null;const t=Jt.fromFormat(e,$ie);return t.isValid?t:null}function _R(e){return e&&_3(e)?U7(Rie,t=>{const i=Jt.fromFormat(e,t);return i.isValid?i:null})??null:null}function vR(e){if(!e||!_3(e))return null;const t=Jt.fromISO(e);return t.isValid?t:null}var Dm;(function(e){e.VALUE_OUT_OF_RANGE="domain-validation-error::value-out-of-range",e.INVALID_CODED_VALUE="domain-validation-error::invalid-coded-value"})(Dm||(Dm={}));const Oie=new Set(["integer","small-integer","big-integer","esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeBigInteger"]);function Lie(e){return e!=null&&Oie.has(e.type)}function kF(e){return e!=null&&(e.type==="date-only"||e.type==="esriFieldTypeDateOnly")}function RF(e){return e!=null&&(e.type==="timestamp-offset"||e.type==="esriFieldTypeTimestampOffset")}function OF(e){return e!=null&&(e.type==="time-only"||e.type==="esriFieldTypeTimeOnly")}function Die(e,t){const i=e==null?void 0:e.domain;if(!i)return null;switch(i.type){case"range":{const{min:r,max:s}=Nie(e);if(r!=null&&+ts)return Dm.VALUE_OUT_OF_RANGE;break}case"coded-value":case"codedValue":if(i.codedValues==null||i.codedValues.every(r=>r==null||r.code!==t))return Dm.INVALID_CODED_VALUE}return null}function Nie(e,t){const i=t??(e==null?void 0:e.domain);if(!i||i.type!=="range")return;const r="range"in i?i.range[0]:i.minValue,s="range"in i?i.range[1]:i.maxValue,n=Lie(e);return kF(e)||OF(e)||RF(e)?{...zie(e,s,r),isInteger:n}:{min:r!=null&&typeof r=="number"?r:null,max:s!=null&&typeof s=="number"?s:null,rawMin:r,rawMax:s,isInteger:n}}function zie(e,t,i){var r,s,n,c,o,f;return kF(e)?{min:(r=gR(i))==null?void 0:r.toMillis(),max:(s=gR(t))==null?void 0:s.toMillis(),rawMin:i,rawMax:t}:OF(e)?{min:(n=_R(i))==null?void 0:n.toMillis(),max:(c=_R(t))==null?void 0:c.toMillis(),rawMin:i,rawMax:t}:RF(e)?{min:(o=vR(i))==null?void 0:o.toMillis(),max:(f=vR(t))==null?void 0:f.toMillis(),rawMin:i,rawMax:t}:{max:null,min:null}}const Fie=()=>_t.getLogger("esri.support.arcadeOnDemand");let WS;function LF(){return WS||(WS=(async()=>{const e=await ht(()=>import("./arcadeUtils-BxUF81hz.js").then(t=>t.aK),__vite__mapDeps([158,31,32,159,36,24,22,25,34]));return{arcade:e.arcade,arcadeUtils:e,Dictionary:e.Dictionary,Feature:e.arcadeFeature}})()),WS}const L0e=(e,t,i)=>DF.create(e,t,i,null,["$feature","$view"],[]),D0e=(e,t,i,r)=>DF.create(e,t,i,r,["$feature","$view"],[]);let DF=class NF{constructor(t,i,r,s,n,c,o){this.services=null,this.script=t,this.evaluate=s;const f=Array.isArray(c)?c:c==null?void 0:c.fields;this.fields=f??[],this._syntaxTree=r,this._arcade=i,this._arcadeFeature=n,this._spatialReference=o,this._referencesGeometry=i.scriptTouchesGeometry(this._syntaxTree),this._referencesScale=this._arcade.referencesMember(this._syntaxTree,"scale")}static async create(t,i,r,s,n,c){const{arcade:o,Feature:f,Dictionary:g}=await LF(),S=yi.fromJSON(i);let I;try{I=o.parseScript(t,c)}catch(je){return Fie().error(new Je("arcade-bad-expression","Failed to parse arcade script",{script:t,error:je})),null}const A=n.reduce((je,tt)=>({...je,[tt]:null}),{});let O=null;s!=null&&(O=new g(s),O.immutable=!0,A.$config=null);const z=o.scriptUsesGeometryEngine(I),V=z&&o.enableGeometrySupport(),H=o.scriptUsesFeatureSet(I)&&o.enableFeatureSetSupport(),Q=o.scriptIsAsync(I),ve=Q&&o.enableAsyncSupport(),me={vars:A,spatialReference:S,useAsync:!!ve};await Promise.all([V,H,ve]);const ge=new Set;await o.loadDependentModules(ge,I,null,Q,z);const Ie=new g;Ie.immutable=!1,Ie.setField("scale",0);const Ce=o.compileScript(I,me),ze=(je,tt)=>{var ot;const ut=(ot=je.$view)==null?void 0:ot.timeZone;return"$view"in je&&je.$view&&(Ie.setField("scale",typeof je.$view=="object"&&"scale"in je.$view?je.$view.scale:void 0),je.$view=Ie),O&&(je.$config=O),Ce({vars:je,spatialReference:S,services:tt,timeZone:ut})};return new NF(t,o,I,ze,new f,r,S)}repurposeFeature(t){return t.geometry&&!t.geometry.spatialReference&&(t.geometry.spatialReference=this._spatialReference),this._arcadeFeature.repurposeFromGraphicLikeObject(t.geometry,t.attributes,{fields:this.fields}),this._arcadeFeature}referencesGeometry(){return this._referencesGeometry}referencesScale(){return this._referencesScale}};const Bie=/^([0-9_])/,Uie=/[^a-z0-9_\u0080-\uffff]+/gi;function N0e(e){return e==null?null:e.trim().replaceAll(Uie,"_").replace(Bie,"F$1")||null}const jie=["field","field2","field3","normalizationField","rotationInfo.field","proportionalSymbolInfo.field","proportionalSymbolInfo.normalizationField","colorInfo.field","colorInfo.normalizationField"],Vie=["field","normalizationField"];function z0e(e,t){if(e!=null&&t!=null){for(const i of Array.isArray(e)?e:[e])if(bR(jie,i,t),"visualVariables"in i&&i.visualVariables)for(const r of i.visualVariables)bR(Vie,r,t)}}function bR(e,t,i){if(e)for(const r of e){const s=ax(r,t),n=s&&typeof s!="function"&&i.get(s);n&&Ap(r,n.name,t)}}function F0e(e,t){var i;if(e!=null&&((i=t==null?void 0:t.fields)!=null&&i.length))if("startField"in e){const r=t.get(e.startField),s=t.get(e.endField);e.startField=(r==null?void 0:r.name)??null,e.endField=(s==null?void 0:s.name)??null}else{const r=t.get(e.startTimeField),s=t.get(e.endTimeField);e.startTimeField=(r==null?void 0:r.name)??null,e.endTimeField=(s==null?void 0:s.name)??null}}const ZS=new Set;function v3(e,t){return e&&t?(ZS.clear(),t_(ZS,e,t),Array.from(ZS).sort()):[]}function t_(e,t,i){var r;if(i)if((r=t==null?void 0:t.fields)!=null&&r.length)if(i.includes("*"))for(const{name:s}of t.fields)e.add(s);else for(const s of i)Vx(e,t,s);else{if(i.includes("*"))return e.clear(),void e.add("*");for(const s of i)s!=null&&e.add(s)}}function Vx(e,t,i){if(typeof i=="string")if(t){const r=t.get(i);r&&e.add(r.name)}else e.add(i)}function B0e(e,t){return t==null||e==null?[]:t.includes("*")?(e.fields??[]).map(i=>i.name):t}function U0e(e,t,i=1){if(!t||!e)return[];if(t.includes("*"))return["*"];const r=v3(e,t);return r.length/e.fields.length>=i?["*"]:r}async function wh(e,t,i){var n;if(!i)return;const{arcadeUtils:r}=await LF(),s=r.extractFieldNames(i,(n=t==null?void 0:t.fields)==null?void 0:n.map(c=>c.name));for(const c of s)Vx(e,t,c)}async function zF(e,t,i){if(i&&i!=="1=1"){const r=await Cie(i,t);if(!r.isStandardized)throw new Je("fieldUtils:collectFilterFields","Where clause is not standardized",{where:i});t_(e,t,r.fieldNames)}}function j0e({displayField:e,fields:t}){return e||(t!=null&&t.length?YS(t,"name-or-title")||YS(t,"unique-identifier")||YS(t,"type-or-category")||Gie(t):null)}function Gie(e){for(const t of e){if(!(t!=null&&t.name))continue;const i=t.name.toLowerCase();if(i.includes("name")||i.includes("title"))return t.name}return null}function YS(e,t){for(const i of e)if(i!=null&&i.valueType&&i.valueType===t)return i.name;return null}async function V0e(e,t){var r;if(!t)return;const i=(r=t.elevationInfo)==null?void 0:r.featureExpressionInfo;return i?i.collectRequiredFields(e,t.fieldsIndex):void 0}function qie(e,t,i){i.onStatisticExpression?wh(e,t,i.onStatisticExpression.expression):e.add(i.onStatisticField)}async function G0e(e,t,i){if(!t||!i||!("fields"in i))return;const r=[],s=i.popupTemplate;r.push(Hie(e,t,s)),i.fields&&r.push(...i.fields.map(async n=>qie(e,t.fieldsIndex,n))),await Promise.all(r)}async function Hie(e,t,i){const r=[];i!=null&&i.expressionInfos&&r.push(...i.expressionInfos.map(n=>wh(e,t.fieldsIndex,n.expression)));const s=i==null?void 0:i.content;if(Array.isArray(s))for(const n of s)n.type==="expression"&&n.expressionInfo&&r.push(wh(e,t.fieldsIndex,n.expressionInfo.expression));await Promise.all(r)}async function q0e(e,t,i){t&&(t.timeInfo&&(i!=null&&i.timeExtent)&&t_(e,t.fieldsIndex,[t.timeInfo.startField,t.timeInfo.endField]),t.floorInfo&&t_(e,t.fieldsIndex,[t.floorInfo.floorField]),(i==null?void 0:i.where)!=null&&await zF(e,t.fieldsIndex,i.where))}async function H0e(e,t,i){t&&i&&await Promise.all(i.map(r=>Wie(e,t,r)))}async function Wie(e,t,i){t&&i&&(i.valueExpression?await wh(e,t.fieldsIndex,i.valueExpression):i.field&&Vx(e,t.fieldsIndex,i.field))}function W0e(e){return e?v3(e.fieldsIndex,FF(e)):[]}function Zie(e){if(!e)return[];const t=e.geometryFieldsInfo;return t?v3(e.fieldsIndex,[t.shapeAreaField,t.shapeLengthField]):[]}const Yie=new Set(["oid","global-id","guid"]),Jie=new Set(["oid","global-id"]),Kie=[/^fnode_$/i,/^tnode_$/i,/^lpoly_$/i,/^rpoly_$/i,/^poly_$/i,/^shape$/i,/^shape_$/i,/^subclass$/i,/^subclass_$/i,/^rings_ok$/i,/^rings_nok$/i,/perimeter/i,/objectid/i,/_i$/i];function Xie(e){const t=new Set;BF(e).forEach(r=>t.add(r)),Zie(e).forEach(r=>t.add(r.toLowerCase()));const i=e&&"infoFor3D"in e?e.infoFor3D:void 0;return i&&(Object.values(i.assetMapFieldRoles).forEach(r=>t.add(r.toLowerCase())),Object.values(i.transformFieldRoles).forEach(r=>t.add(r.toLowerCase()))),Array.from(t)}function FF(e){if(!e)return[];const t="editFieldsInfo"in e&&e.editFieldsInfo;if(!t)return[];const{creationDateField:i,creatorField:r,editDateField:s,editorField:n}=t;return[i,r,s,n].filter(Boolean)}function BF(e){return FF(e).map(t=>t.toLowerCase())}function Z0e(e,t){var i;return e.editable&&!Yie.has(e.type)&&!BF(t).includes(((i=e.name)==null?void 0:i.toLowerCase())??"")}function Y0e(e,t){var r;const i=((r=e.name)==null?void 0:r.toLowerCase())??"";return!((t==null?void 0:t.objectIdField)!=null&&i===t.objectIdField.toLowerCase()||(t==null?void 0:t.globalIdField)!=null&&i===t.globalIdField.toLowerCase()||Xie(t).includes(i)||Jie.has(e.type)||Kie.some(s=>s.test(i)))}async function J0e(e,t){const{labelingInfo:i,fieldsIndex:r}=t;i!=null&&i.length&&await Promise.all(i.map(s=>Qie(e,r,s)))}async function Qie(e,t,i){if(!i)return;const r=i.getLabelExpression(),s=i.where;if(r.type==="arcade")await wh(e,t,r.expression);else{const n=r.expression.match(/{[^}]*}/g);n&&n.forEach(c=>{Vx(e,t,c.slice(1,-1))})}await zF(e,t,s)}function K0e(e){const t=e.defaultValue;return t!==void 0&&VF(e,t)?t:e.nullable?null:void 0}function X0e(e){const t=typeof e=="string"?{type:e}:e;return dre(t)?255:t.type==="esriFieldTypeDate"||t.type==="date"?8:void 0}function UF(e){return typeof e=="number"&&!isNaN(e)&&isFinite(e)}function ere(e){return e===null||UF(e)}function tre(e){return e===null||Number.isInteger(e)}function jF(e){return e!=null&&typeof e=="string"}function ire(e){return e===null||jF(e)}function rre(){return!0}function VF(e,t){let i;switch(e.type){case"date":case"integer":case"long":case"small-integer":case"big-integer":case"esriFieldTypeDate":case"esriFieldTypeInteger":case"esriFieldTypeLong":case"esriFieldTypeSmallInteger":case"esriFieldTypeBigInteger":i=e.nullable?tre:Number.isInteger;break;case"double":case"single":case"esriFieldTypeSingle":case"esriFieldTypeDouble":i=e.nullable?ere:UF;break;case"string":case"esriFieldTypeString":i=e.nullable?ire:jF;break;default:i=rre}return arguments.length===1?i:i(t)}const sre=["integer","small-integer","big-integer"],nre=["single","double"],ore=["esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeBigInteger"],are=["esriFieldTypeSingle","esriFieldTypeDouble"],lre=new Set([...sre,...ore]),cre=new Set([...nre,...are]),ure=s4(lre,cre);function hre(e){return e!=null&&ure.has(e.type)}function dre(e){return e!=null&&(e.type==="string"||e.type==="esriFieldTypeString")}function Q0e(e){return e!=null&&(e.type==="date"||e.type==="esriFieldTypeDate")}function e_e(e){return e!=null&&(e.type==="date-only"||e.type==="esriFieldTypeDateOnly")}function t_e(e){return e!=null&&(e.type==="timestamp-offset"||e.type==="esriFieldTypeTimestampOffset")}function i_e(e){return e!=null&&(e.type==="time-only"||e.type==="esriFieldTypeTimeOnly")}function r_e(e){return e!=null&&(e.type==="oid"||e.type==="esriFieldTypeOID")}function s_e(e){return e!=null&&(e.type==="global-id"||e.type==="esriFieldTypeGlobalID")}function n_e(e,t){return pre(e,t)===null}var Rw,Ow;function o_e(e){return e==null||typeof e=="number"&&isNaN(e)?null:e}function pre(e,t){return e==null||e.nullable&&t===null?null:hre(e)&&!fre(e.type,Number(t))?Rw.OUT_OF_RANGE:VF(e,t)?e.domain?Die(e,t):null:Ow.INVALID_TYPE}function fre(e,t){const i=typeof e=="string"?GF(e):e;if(!i)return!1;const r=i.min,s=i.max;return i.isInteger?Number.isInteger(t)&&t>=r&&t<=s:t>=r&&t<=s}function GF(e){switch(e){case"esriFieldTypeSmallInteger":case"small-integer":return mre;case"esriFieldTypeInteger":case"integer":return yre;case"esriFieldTypeBigInteger":case"big-integer":return gre;case"esriFieldTypeSingle":case"single":return _re;case"esriFieldTypeDouble":case"double":return vre}}(function(e){e.OUT_OF_RANGE="numeric-range-validation-error::out-of-range"})(Rw||(Rw={})),function(e){e.INVALID_TYPE="type-validation-error::invalid-type"}(Ow||(Ow={}));const mre={min:-32768,max:32767,isInteger:!0,rawMin:-32768,rawMax:32767},yre={min:-2147483648,max:2147483647,isInteger:!0,rawMin:-2147483648,rawMax:2147483647},gre={min:-Number.MAX_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,isInteger:!0,rawMin:-Number.MAX_SAFE_INTEGER,rawMax:Number.MAX_SAFE_INTEGER},_re={min:-34e37,max:12e37,isInteger:!1,rawMin:-34e37,rawMax:12e37},vre={min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isInteger:!1,rawMin:-Number.MAX_VALUE,rawMax:Number.MAX_VALUE};function a_e(e,t,i){switch(e){case Dm.INVALID_CODED_VALUE:return`Value ${i} is not in the coded domain - field: ${t.name}, domain: ${JSON.stringify(t.domain)}`;case Dm.VALUE_OUT_OF_RANGE:return`Value ${i} is out of the range of valid values - field: ${t.name}, domain: ${JSON.stringify(t.domain)}`;case Ow.INVALID_TYPE:return`Value ${i} is not a valid value for the field type - field: ${t.name}, type: ${t.type}, nullable: ${t.nullable}`;case Rw.OUT_OF_RANGE:{const{min:r,max:s}=GF(t.type);return`Value ${i} is out of range for the number type - field: ${t.name}, type: ${t.type}, value range is ${r} to ${s}`}}}function l_e(e,t){return!bre(e,t,null)}function bre(e,t,i){if(!(t!=null&&t.attributes)||!e){if(i!=null)for(const n of e??[])i.add(n);return!0}const r=new Set(Object.keys(t.attributes));let s=!1;for(const n of e)if(!r.has(n)){if(s=!0,i==null)break;i.add(n)}return s}function c_e(e){return!!e&&["raster.itempixelvalue","raster.servicepixelvalue"].some(t=>e.toLowerCase().startsWith(t))}let ob=class extends At{constructor(t){super(t),this.type=null}};v([M({type:["attachments","custom","fields","media","text","expression","relationship"],readOnly:!0,json:{read:!1,write:!0}})],ob.prototype,"type",void 0),ob=v([fe("esri.popup.content.Content")],ob);const Ch=ob;var GE;let md=GE=class extends Ch{constructor(e){super(e),this.description=null,this.displayType="auto",this.title=null,this.type="attachments"}clone(){return new GE({description:this.description,displayType:this.displayType,title:this.title})}};v([M({type:String,json:{write:!0}})],md.prototype,"description",void 0),v([M({type:["auto","preview","list"],json:{write:!0}})],md.prototype,"displayType",void 0),v([M({type:String,json:{write:!0}})],md.prototype,"title",void 0),v([M({type:["attachments"],readOnly:!0,json:{read:!1,write:!0}})],md.prototype,"type",void 0),md=GE=v([fe("esri.popup.content.AttachmentsContent")],md);const Lw=md;var qE;let yd=qE=class extends Ch{constructor(e){super(e),this.creator=null,this.destroyer=null,this.outFields=null,this.type="custom"}clone(){return new qE({creator:this.creator,destroyer:this.destroyer,outFields:Array.isArray(this.outFields)?He(this.outFields):null})}};v([M()],yd.prototype,"creator",void 0),v([M()],yd.prototype,"destroyer",void 0),v([M()],yd.prototype,"outFields",void 0),v([M({type:["custom"],readOnly:!0})],yd.prototype,"type",void 0),yd=qE=v([fe("esri.popup.content.CustomContent")],yd);const wre=yd;var HE;let Df=HE=class extends At{constructor(e){super(e),this.title=null,this.expression=null,this.returnType="dictionary"}clone(){return new HE({title:this.title,expression:this.expression})}};v([M({type:String,json:{write:!0}})],Df.prototype,"title",void 0),v([M({type:String,json:{write:!0}})],Df.prototype,"expression",void 0),v([M({type:["dictionary"],readOnly:!0,json:{read:!1,write:!0}})],Df.prototype,"returnType",void 0),Df=HE=v([fe("esri.popup.ElementExpressionInfo")],Df);const xre=Df;var WE;let Rg=WE=class extends Ch{constructor(e){super(e),this.expressionInfo=null,this.type="expression"}clone(){var e;return new WE({expressionInfo:(e=this.expressionInfo)==null?void 0:e.clone()})}};v([M({type:xre,json:{write:!0}})],Rg.prototype,"expressionInfo",void 0),v([M({type:["expression"],readOnly:!0,json:{read:!1,write:!0}})],Rg.prototype,"type",void 0),Rg=WE=v([fe("esri.popup.content.ExpressionContent")],Rg);const b3=Rg;let Nf=class extends jl(At){constructor(t){super(t),this.dateFormat=null,this.digitSeparator=!1,this.places=null}};v([Gt(HQ)],Nf.prototype,"dateFormat",void 0),v([M({type:Boolean,json:{write:!0}})],Nf.prototype,"digitSeparator",void 0),v([M({type:$r,json:{write:!0}})],Nf.prototype,"places",void 0),Nf=v([fe("esri.popup.support.FieldInfoFormat")],Nf);const Sre=Nf;var ZE;let Aa=ZE=class extends At{constructor(e){super(e),this.fieldName=null,this.format=null,this.isEditable=!0,this.label=null,this.stringFieldOption="text-box",this.statisticType=null,this.tooltip=null,this.visible=!0}clone(){return new ZE({fieldName:this.fieldName,format:this.format?He(this.format):null,isEditable:this.isEditable,label:this.label,stringFieldOption:this.stringFieldOption,statisticType:this.statisticType,tooltip:this.tooltip,visible:this.visible})}};v([M({type:String,json:{write:!0}})],Aa.prototype,"fieldName",void 0),v([M({type:Sre,json:{write:!0}})],Aa.prototype,"format",void 0),v([M({type:Boolean,json:{write:{alwaysWriteDefaults:!0},default:!0}})],Aa.prototype,"isEditable",void 0),v([M({type:String,json:{write:!0}})],Aa.prototype,"label",void 0),v([Gt(new ks({richtext:"rich-text",textarea:"text-area",textbox:"text-box"}),{default:"text-box"})],Aa.prototype,"stringFieldOption",void 0),v([M({type:["count","sum","min","max","avg","stddev","var"],json:{write:!0}})],Aa.prototype,"statisticType",void 0),v([M({type:String,json:{write:!0}})],Aa.prototype,"tooltip",void 0),v([M({type:Boolean,json:{write:!0}})],Aa.prototype,"visible",void 0),Aa=ZE=v([fe("esri.popup.FieldInfo")],Aa);const qF=Aa;var YE;let wc=YE=class extends Ch{constructor(e){super(e),this.attributes=null,this.description=null,this.fieldInfos=null,this.title=null,this.type="fields"}writeFieldInfos(e,t){t.fieldInfos=e&&e.map(i=>i.toJSON())}clone(){return new YE(He({attributes:this.attributes,description:this.description,fieldInfos:this.fieldInfos,title:this.title}))}};v([M({type:Object,json:{write:!0}})],wc.prototype,"attributes",void 0),v([M({type:String,json:{write:!0}})],wc.prototype,"description",void 0),v([M({type:[qF]})],wc.prototype,"fieldInfos",void 0),v([ui("fieldInfos")],wc.prototype,"writeFieldInfos",null),v([M({type:String,json:{write:!0}})],wc.prototype,"title",void 0),v([M({type:["fields"],readOnly:!0,json:{read:!1,write:!0}})],wc.prototype,"type",void 0),wc=YE=v([fe("esri.popup.content.FieldsContent")],wc);const Dw=wc;let gd=class extends At{constructor(t){super(t),this.altText=null,this.caption="",this.title="",this.type=null}};v([M({type:String,json:{write:!0}})],gd.prototype,"altText",void 0),v([M({type:String,json:{write:!0}})],gd.prototype,"caption",void 0),v([M({type:String,json:{write:!0}})],gd.prototype,"title",void 0),v([M({type:["image","bar-chart","column-chart","line-chart","pie-chart"],readOnly:!0,json:{read:!1,write:!0}})],gd.prototype,"type",void 0),gd=v([fe("esri.popup.content.mixins.MediaInfo")],gd);const w3=gd;var JE;let _d=JE=class extends Nt{constructor(e){super(e),this.color=null,this.fieldName=null,this.tooltip=null,this.value=null}clone(){return new JE({fieldName:this.fieldName,tooltip:this.tooltip,value:this.value})}};v([M()],_d.prototype,"color",void 0),v([M()],_d.prototype,"fieldName",void 0),v([M()],_d.prototype,"tooltip",void 0),v([M()],_d.prototype,"value",void 0),_d=JE=v([fe("esri.popup.content.support.ChartMediaInfoValueSeries")],_d);const Tre=_d;var KE;let Ru=KE=class extends At{constructor(e){super(e),this.colors=null,this.fields=[],this.normalizeField=null,this.series=[],this.tooltipField=null}clone(){return new KE({colors:He(this.colors),fields:He(this.fields),normalizeField:this.normalizeField,tooltipField:this.tooltipField})}};v([M({type:[zt],json:{type:[[$r]],write:!0}})],Ru.prototype,"colors",void 0),v([M({type:[String],json:{write:!0}})],Ru.prototype,"fields",void 0),v([M({type:String,json:{write:!0}})],Ru.prototype,"normalizeField",void 0),v([M({type:[Tre],json:{read:!1}})],Ru.prototype,"series",void 0),v([M({type:String,json:{write:!0}})],Ru.prototype,"tooltipField",void 0),Ru=KE=v([fe("esri.popup.content.support.ChartMediaInfoValue")],Ru);const Ere=Ru;let Og=class extends w3{constructor(t){super(t),this.type=null,this.value=null}};v([M({type:["bar-chart","column-chart","line-chart","pie-chart"],readOnly:!0,json:{read:!1,write:!0}})],Og.prototype,"type",void 0),v([M({type:Ere,json:{write:!0}})],Og.prototype,"value",void 0),Og=v([fe("esri.popup.content.mixins.ChartMediaInfo")],Og);const Gx=Og,qx=Bn()({barchart:"bar-chart",columnchart:"column-chart",linechart:"line-chart",piechart:"pie-chart"});var XE;let ab=XE=class extends Gx{constructor(e){super(e),this.type="bar-chart"}clone(){return new XE({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};v([M({type:["bar-chart"],readOnly:!0,json:{type:["barchart"],read:!1,write:qx.write}})],ab.prototype,"type",void 0),ab=XE=v([fe("esri.popup.content.BarChartMediaInfo")],ab);const HF=ab;var QE;let lb=QE=class extends Gx{constructor(e){super(e),this.type="column-chart"}clone(){return new QE({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};v([M({type:["column-chart"],readOnly:!0,json:{type:["columnchart"],read:!1,write:qx.write}})],lb.prototype,"type",void 0),lb=QE=v([fe("esri.popup.content.ColumnChartMediaInfo")],lb);const WF=lb;var eM;let Lg=eM=class extends At{constructor(e){super(e),this.linkURL=null,this.sourceURL=null}clone(){return new eM({linkURL:this.linkURL,sourceURL:this.sourceURL})}};v([M({type:String,json:{write:!0}})],Lg.prototype,"linkURL",void 0),v([M({type:String,json:{write:!0}})],Lg.prototype,"sourceURL",void 0),Lg=eM=v([fe("esri.popup.content.support.ImageMediaInfoValue")],Lg);const Mre=Lg;var tM;let zf=tM=class extends w3{constructor(e){super(e),this.refreshInterval=null,this.type="image",this.value=null}clone(){return new tM({altText:this.altText,title:this.title,caption:this.caption,refreshInterval:this.refreshInterval,value:this.value?this.value.clone():null})}};v([M({type:Number,json:{write:!0}})],zf.prototype,"refreshInterval",void 0),v([M({type:["image"],readOnly:!0,json:{read:!1,write:!0}})],zf.prototype,"type",void 0),v([M({type:Mre,json:{write:!0}})],zf.prototype,"value",void 0),zf=tM=v([fe("esri.popup.content.ImageMediaInfo")],zf);const ZF=zf;var iM;let cb=iM=class extends Gx{constructor(e){super(e),this.type="line-chart"}clone(){return new iM({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};v([M({type:["line-chart"],readOnly:!0,json:{type:["linechart"],read:!1,write:qx.write}})],cb.prototype,"type",void 0),cb=iM=v([fe("esri.popup.content.LineChartMediaInfo")],cb);const YF=cb;var rM;let ub=rM=class extends Gx{constructor(e){super(e),this.type="pie-chart"}clone(){return new rM({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};v([M({type:["pie-chart"],readOnly:!0,json:{type:["piechart"],read:!1,write:qx.write}})],ub.prototype,"type",void 0),ub=rM=v([fe("esri.popup.content.PieChartMediaInfo")],ub);const JF=ub,KF={base:w3,key:"type",defaultKeyValue:"image",typeMap:{"bar-chart":HF,"column-chart":WF,"line-chart":YF,"pie-chart":JF,image:ZF}};var sM;let Pa=sM=class extends Ch{constructor(e){super(e),this.activeMediaInfoIndex=null,this.attributes=null,this.description=null,this.mediaInfos=null,this.title=null,this.type="media"}readMediaInfos(e){return e&&e.map(t=>t.type==="image"?ZF.fromJSON(t):t.type==="barchart"?HF.fromJSON(t):t.type==="columnchart"?WF.fromJSON(t):t.type==="linechart"?YF.fromJSON(t):t.type==="piechart"?JF.fromJSON(t):void 0).filter(Boolean)}writeMediaInfos(e,t){t.mediaInfos=e&&e.map(i=>i.toJSON())}clone(){return new sM(He({activeMediaInfoIndex:this.activeMediaInfoIndex,attributes:this.attributes,description:this.description,mediaInfos:this.mediaInfos,title:this.title}))}};v([M()],Pa.prototype,"activeMediaInfoIndex",void 0),v([M({type:Object,json:{write:!0}})],Pa.prototype,"attributes",void 0),v([M({type:String,json:{write:!0}})],Pa.prototype,"description",void 0),v([M({types:[KF]})],Pa.prototype,"mediaInfos",void 0),v([mi("mediaInfos")],Pa.prototype,"readMediaInfos",null),v([ui("mediaInfos")],Pa.prototype,"writeMediaInfos",null),v([M({type:String,json:{write:!0}})],Pa.prototype,"title",void 0),v([M({type:["media"],readOnly:!0,json:{read:!1,write:!0}})],Pa.prototype,"type",void 0),Pa=sM=v([fe("esri.popup.content.MediaContent")],Pa);const Nw=Pa;var nM;let Dg=nM=class extends At{constructor(e){super(e),this.field=null,this.order=null}clone(){return new nM({field:this.field,order:this.order})}};v([M({type:String,json:{write:!0}})],Dg.prototype,"field",void 0),v([M({type:["asc","desc"],json:{write:!0}})],Dg.prototype,"order",void 0),Dg=nM=v([fe("esri.popup.support.RelatedRecordsInfoFieldOrder")],Dg);const XF=Dg;let yl=class extends jl(Ch){constructor(t){super(t),this.description=null,this.displayCount=null,this.displayType="list",this.orderByFields=null,this.relationshipId=null,this.title=null,this.type="relationship"}};v([M({type:String,json:{write:!0}})],yl.prototype,"description",void 0),v([M({type:Number,json:{type:$r,write:!0}})],yl.prototype,"displayCount",void 0),v([M({type:["list"],json:{write:!0}})],yl.prototype,"displayType",void 0),v([M({type:[XF],json:{write:!0}})],yl.prototype,"orderByFields",void 0),v([M({type:Number,json:{type:$r,write:!0}})],yl.prototype,"relationshipId",void 0),v([M({type:String,json:{write:!0}})],yl.prototype,"title",void 0),v([M({type:["relationship"],readOnly:!0,json:{read:!1,write:!0}})],yl.prototype,"type",void 0),yl=v([fe("esri.popup.content.RelationshipContent")],yl);const zw=yl;var oM;let Ng=oM=class extends Ch{constructor(e){super(e),this.text=null,this.type="text"}clone(){return new oM({text:this.text})}};v([M({type:String,json:{write:!0}})],Ng.prototype,"text",void 0),v([M({type:["text"],readOnly:!0,json:{read:!1,write:!0}})],Ng.prototype,"type",void 0),Ng=oM=v([fe("esri.popup.content.TextContent")],Ng);const Fw=Ng,Ire={base:null,key:"type",typeMap:{attachment:Lw,media:Nw,text:Fw,expression:b3,field:Dw,relationship:zw}};var aM;let vd=aM=class extends At{constructor(e){super(e),this.name=null,this.title=null,this.expression=null,this.returnType=null}clone(){return new aM({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};v([M({type:String,json:{write:!0}})],vd.prototype,"name",void 0),v([M({type:String,json:{write:!0}})],vd.prototype,"title",void 0),v([M({type:String,json:{write:!0}})],vd.prototype,"expression",void 0),v([M({type:["string","number"],json:{write:!0}})],vd.prototype,"returnType",void 0),vd=aM=v([fe("esri.popup.ExpressionInfo")],vd);const Are=vd;var lM;let zg=lM=class extends At{constructor(e){super(e),this.returnTopmostRaster=null,this.showNoDataRecords=null}clone(){return new lM({showNoDataRecords:this.showNoDataRecords,returnTopmostRaster:this.returnTopmostRaster})}};v([M({type:Boolean,json:{write:!0}})],zg.prototype,"returnTopmostRaster",void 0),v([M({type:Boolean,json:{write:!0}})],zg.prototype,"showNoDataRecords",void 0),zg=lM=v([fe("esri.popup.LayerOptions")],zg);const Pre=zg;var cM;let Fg=cM=class extends At{constructor(e){super(e),this.showRelatedRecords=null,this.orderByFields=null}clone(){return new cM({showRelatedRecords:this.showRelatedRecords,orderByFields:this.orderByFields?He(this.orderByFields):null})}};v([M({type:Boolean,json:{write:!0}})],Fg.prototype,"showRelatedRecords",void 0),v([M({type:[XF],json:{write:!0}})],Fg.prototype,"orderByFields",void 0),Fg=cM=v([fe("esri.popup.RelatedRecordsInfo")],Fg);const Cre=Fg;var uM;let qo=uM=class extends HA(Nt){constructor(e){super(e),this.active=!1,this.className=null,this.disabled=!1,this.icon=null,this.id=null,this.indicator=!1,this.title=null,this.type=null,this.visible=!0}clone(){return new uM({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible})}};v([M()],qo.prototype,"active",void 0),v([M()],qo.prototype,"className",void 0),v([M()],qo.prototype,"disabled",void 0),v([M()],qo.prototype,"icon",void 0),v([M()],qo.prototype,"id",void 0),v([M()],qo.prototype,"indicator",void 0),v([M()],qo.prototype,"title",void 0),v([M()],qo.prototype,"type",void 0),v([M()],qo.prototype,"visible",void 0),qo=uM=v([fe("esri.support.actions.ActionBase")],qo);const x3=qo;var hM;let hb=hM=class extends x3{constructor(e){super(e),this.image=null,this.type="button"}clone(){return new hM({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image})}};v([M()],hb.prototype,"image",void 0),hb=hM=v([fe("esri.support.Action.ActionButton")],hb);const $re=hb;var dM;let Bg=dM=class extends x3{constructor(e){super(e),this.image=null,this.type="toggle",this.value=!1}clone(){return new dM({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image,value:this.value})}};v([M()],Bg.prototype,"image",void 0),v([M()],Bg.prototype,"value",void 0),Bg=dM=v([fe("esri.support.Action.ActionToggle")],Bg);const kre=Bg,xg="relationships/",wR="expression/",Rre=Bt.ofType({key:"type",defaultKeyValue:"button",base:x3,typeMap:{button:$re,toggle:kre}}),Ore={base:Ch,key:"type",typeMap:{media:Nw,custom:wre,text:Fw,attachments:Lw,fields:Dw,expression:b3,relationship:zw}},Lre=new Set(["attachments","fields","media","text","expression","relationship"]);let _s=class extends jl(At){constructor(){super(...arguments),this.actions=null,this.content="",this.expressionInfos=null,this.fieldInfos=null,this.layerOptions=null,this.lastEditInfoEnabled=!0,this.outFields=null,this.overwriteActions=!1,this.returnGeometry=!1,this.title=""}castContent(t){return Array.isArray(t)?t.map(i=>Uc(Ore,i)):typeof t=="string"||typeof t=="function"||t instanceof HTMLElement||xh(t)?t:(_t.getLogger(this).error("content error","unsupported content value",{value:t}),null)}readContent(t,i){const{popupElements:r}=i;return Array.isArray(r)&&r.length>0?this._readPopupInfoElements(i.description,i.mediaInfos,r):this._readPopupInfo(i)}writeContent(t,i,r,s){typeof t!="string"?Array.isArray(t)&&(i.popupElements=t.filter(n=>Lre.has(n.type)).map(n=>n==null?void 0:n.toJSON(s)),i.popupElements.forEach(n=>{n.type==="attachments"?this._writeAttachmentContent(i):n.type==="media"?this._writeMediaContent(n,i):n.type==="text"?this._writeTextContent(n,i):n.type==="relationship"&&this._writeRelationshipContent(n,i)})):i.description=t}writeFieldInfos(t,i,r,s){const{content:n}=this,c=Array.isArray(n)?n:null;if(t){const o=c?c.filter(g=>g.type==="fields"):[],f=o.length&&o.every(g=>{var S;return(S=g.fieldInfos)==null?void 0:S.length});i.fieldInfos=t.filter(Boolean).map(g=>{const S=g.toJSON(s);return f&&(S.visible=!1),S})}if(c)for(const o of c)o.type==="fields"&&this._writeFieldsContent(o,i)}writeLayerOptions(t,i,r,s){i[r]=!t||t.showNoDataRecords===null&&t.returnTopmostRaster===null?null:t.toJSON(s)}writeTitle(t,i){i.title=t||""}async collectRequiredFields(t,i){const r=this.expressionInfos||[];await this._collectExpressionInfoFields(t,i,[...r,...this._getContentExpressionInfos(this.content,r)]),t_(t,i,[...this.outFields||[],...this._getActionsFields(this.actions),...this._getTitleFields(this.title),...this._getContentFields(this.content)])}async getRequiredFields(t){const i=new Set;return await this.collectRequiredFields(i,t),[...i].sort()}_writeFieldsContent(t,i){if(!Array.isArray(t.fieldInfos)||!t.fieldInfos.length)return;const r=He(t.fieldInfos);Array.isArray(i.fieldInfos)?r.forEach(s=>{const n=i.fieldInfos.find(c=>c.fieldName.toLowerCase()===s.fieldName.toLowerCase());n?n.visible=!0:i.fieldInfos.push(s)}):i.fieldInfos=r}_writeAttachmentContent(t){t.showAttachments||(t.showAttachments=!0)}_writeRelationshipContent(t,i){var n,c;const r=((n=t.orderByFields)==null?void 0:n.map(o=>this._toFieldOrderJSON(o,t.relationshipId)))||[],s=[...((c=i.relatedRecordsInfo)==null?void 0:c.orderByFields)||[],...r];i.relatedRecordsInfo={showRelatedRecords:!0,...(s==null?void 0:s.length)&&{orderByFields:s}}}_writeTextContent(t,i){!i.description&&t.text&&(i.description=t.text)}_writeMediaContent(t,i){if(!Array.isArray(t.mediaInfos)||!t.mediaInfos.length)return;const r=He(t.mediaInfos);Array.isArray(i.mediaInfos)?i.mediaInfos=[...i.mediaInfos,...r]:i.mediaInfos=r}_readPopupInfoElements(t,i,r){const s={description:!1,mediaInfos:!1};return r.map(n=>n.type==="media"?(n.mediaInfos||!i||s.mediaInfos||(n.mediaInfos=i,s.mediaInfos=!0),Nw.fromJSON(n)):n.type==="text"?(n.text||!t||s.description||(n.text=t,s.description=!0),Fw.fromJSON(n)):n.type==="attachments"?Lw.fromJSON(n):n.type==="fields"?Dw.fromJSON(n):n.type==="expression"?b3.fromJSON(n):n.type==="relationship"?zw.fromJSON(n):void 0).filter(Boolean)}_toRelationshipContent(t){const{field:i,order:r}=t;if(!(i!=null&&i.startsWith(xg)))return null;const s=i.replace(xg,"").split("/");if(s.length!==2)return null;const n=parseInt(s[0],10),c=s[1];return typeof n=="number"&&c?zw.fromJSON({relationshipId:n,orderByFields:[{field:c,order:r}]}):null}_toFieldOrderJSON(t,i){const{order:r,field:s}=t;return{field:`${xg}${i}/${s}`,order:r}}_readPopupInfo({description:t,mediaInfos:i,showAttachments:r,relatedRecordsInfo:s={showRelatedRecords:!1}}){const n=[];t?n.push(new Fw({text:t})):n.push(new Dw),Array.isArray(i)&&i.length&&n.push(Nw.fromJSON({mediaInfos:i})),r&&n.push(Lw.fromJSON({displayType:"auto"}));const{showRelatedRecords:c,orderByFields:o}=s;return c&&(o!=null&&o.length)&&o.forEach(f=>{const g=this._toRelationshipContent(f);g&&n.push(g)}),n.length?n:t}_getContentElementFields(t){const i=t==null?void 0:t.type;if(i==="attachments")return[...this._extractFieldNames(t.title),...this._extractFieldNames(t.description)];if(i==="custom")return t.outFields||[];if(i==="fields")return[...this._extractFieldNames(t.title),...this._extractFieldNames(t.description),...this._getFieldInfoFields(t.fieldInfos??this.fieldInfos)];if(i==="media"){const r=t.mediaInfos||[];return[...this._extractFieldNames(t.title),...this._extractFieldNames(t.description),...r.reduce((s,n)=>[...s,...this._getMediaInfoFields(n)],[])]}return i==="text"?this._extractFieldNames(t.text):[]}_getMediaInfoFields(t){const{caption:i,title:r,value:s}=t,n=s||{},{fields:c,normalizeField:o,tooltipField:f,sourceURL:g,linkURL:S}=n,I=[...this._extractFieldNames(r),...this._extractFieldNames(i),...this._extractFieldNames(g),...this._extractFieldNames(S),...c??[]];return o&&I.push(o),f&&I.push(f),I}_getContentExpressionInfos(t,i){return Array.isArray(t)?t.reduce((r,s)=>[...r,...s.type==="expression"&&s.expressionInfo?[s.expressionInfo]:[]],i):[]}_getContentFields(t){return typeof t=="string"?this._extractFieldNames(t):Array.isArray(t)?t.reduce((i,r)=>[...i,...this._getContentElementFields(r)],[]):[]}async _collectExpressionInfoFields(t,i,r){r&&await Promise.all(r.map(s=>wh(t,i,s.expression)))}_getFieldInfoFields(t){return t?t.filter(i=>i.visible===void 0||!!i.visible).map(i=>i.fieldName).filter(i=>!i.startsWith(xg)&&!i.startsWith(wR)):[]}_getActionsFields(t){return t?t.toArray().reduce((i,r)=>[...i,...this._getActionFields(r)],[]):[]}_getActionFields(t){const{className:i,title:r,type:s}=t,n=s==="button"||s==="toggle"?t.image:"";return[...this._extractFieldNames(r),...this._extractFieldNames(i),...this._extractFieldNames(n)]}_getTitleFields(t){return typeof t=="string"?this._extractFieldNames(t):[]}_extractFieldNames(t){if(!t||typeof t!="string")return[];const i=/{[^}]*}/g,r=t.match(i);if(!r)return[];const s=/\{(\w+):.+\}/,n=r.filter(c=>!(c.indexOf(`{${xg}`)===0||c.indexOf(`{${wR}`)===0)).map(c=>c.replace(s,"{$1}"));return n?n.map(c=>c.slice(1,-1)):[]}};v([M({type:Rre})],_s.prototype,"actions",void 0),v([M()],_s.prototype,"content",void 0),v([Rs("content")],_s.prototype,"castContent",null),v([mi("content",["description","fieldInfos","popupElements","mediaInfos","showAttachments","relatedRecordsInfo"])],_s.prototype,"readContent",null),v([ui("content",{popupElements:{type:Bt.ofType(Ire)},showAttachments:{type:Boolean},mediaInfos:{type:Bt.ofType(KF)},description:{type:String},relatedRecordsInfo:{type:Cre}})],_s.prototype,"writeContent",null),v([M({type:[Are],json:{write:!0}})],_s.prototype,"expressionInfos",void 0),v([M({type:[qF]})],_s.prototype,"fieldInfos",void 0),v([ui("fieldInfos")],_s.prototype,"writeFieldInfos",null),v([M({type:Pre})],_s.prototype,"layerOptions",void 0),v([ui("layerOptions")],_s.prototype,"writeLayerOptions",null),v([M({type:Boolean,json:{read:{source:"showLastEditInfo"},write:{target:"showLastEditInfo"},default:!0}})],_s.prototype,"lastEditInfoEnabled",void 0),v([M()],_s.prototype,"outFields",void 0),v([M()],_s.prototype,"overwriteActions",void 0),v([M()],_s.prototype,"returnGeometry",void 0),v([M({json:{type:String}})],_s.prototype,"title",void 0),v([ui("title")],_s.prototype,"writeTitle",null),_s=v([fe("esri.PopupTemplate")],_s);const Dre=_s,xR=new ks({esriSMS:"simple-marker",esriPMS:"picture-marker",esriSLS:"simple-line",esriSFS:"simple-fill",esriPFS:"picture-fill",esriTS:"text",esriSHD:"shield-label-symbol",PointSymbol3D:"point-3d",LineSymbol3D:"line-3d",PolygonSymbol3D:"polygon-3d",WebStyleSymbol:"web-style",MeshSymbol3D:"mesh-3d",LabelSymbol3D:"label-3d",CIMSymbolReference:"cim"});let Nre=0,Ff=class extends At{constructor(t){super(t),this.id="sym"+Nre++,this.type=null,this.color=new zt([0,0,0,1])}readColor(t){return(t==null?void 0:t[0])!=null?[t[0],t[1],t[2],t[3]/255]:t}async collectRequiredFields(t,i){}hash(){return JSON.stringify(this.toJSON())}clone(){}};v([M({type:xR.apiValues,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:xR.write}}})],Ff.prototype,"type",void 0),v([M({type:zt,json:{write:{allowNull:!0}}})],Ff.prototype,"color",void 0),v([mi("color")],Ff.prototype,"readColor",null),Ff=v([fe("esri.symbols.Symbol")],Ff);const Mo=Ff;var pM;let Ou=pM=class extends Mo{constructor(e){super(e),this.data=null,this.type="cim"}readData(e,t){return t}writeData(e,t){Object.assign(t,e)}async collectRequiredFields(e,t){var i;if(((i=this.data)==null?void 0:i.type)==="CIMSymbolReference"){const r=this.data.primitiveOverrides;if(r){const s=r.map(n=>{const c=n.valueExpressionInfo;return c?wh(e,t,c.expression):null});await Promise.all(s)}}}clone(){return new pM({data:He(this.data)})}hash(){return L5(JSON.stringify(this.data)).toString()}};v([M({json:{write:!1}})],Ou.prototype,"color",void 0),v([M({json:{write:!0}})],Ou.prototype,"data",void 0),v([mi("data",["symbol"])],Ou.prototype,"readData",null),v([ui("data",{})],Ou.prototype,"writeData",null),v([Gt({CIMSymbolReference:"cim"},{readOnly:!0})],Ou.prototype,"type",void 0),Ou=pM=v([fe("esri.symbols.CIMSymbol")],Ou);const Hx=Ou;let Bf=class extends At{constructor(t){super(t),this.enabled=!0,this.type=null,this.ignoreDrivers=!1}writeEnabled(t,i,r){t||(i[r]=t)}};v([M({type:Boolean,json:{read:{source:"enable"},write:{target:"enable"}}})],Bf.prototype,"enabled",void 0),v([ui("enabled")],Bf.prototype,"writeEnabled",null),v([M({type:["icon","object","line","path","fill","water","extrude","text"],readOnly:!0})],Bf.prototype,"type",void 0),Bf=v([fe("esri.symbols.Symbol3DLayer")],Bf);const Vl=Bf;function zre(e,t){const i=t.transparency!=null?bw(t.transparency):1,r=t.color;return r&&Array.isArray(r)?new zt([r[0]||0,r[1]||0,r[2]||0,i]):null}function Fre(e,t){t.color=e.toJSON().slice(0,3);const i=UN(e.a);i!==0&&(t.transparency=i)}const $h={type:zt,json:{type:[$r],default:null,read:{source:["color","transparency"],reader:zre},write:{target:{color:{type:[$r]},transparency:{type:$r}},writer:Fre}}},zl={type:Number,cast:xr,json:{write:!0}};let bd=class extends At{constructor(t){super(t),this.color=new zt([0,0,0,1]),this.extensionLength=0,this.size=mh(1)}clone(){}cloneProperties(){return{color:He(this.color),size:this.size,extensionLength:this.extensionLength}}};v([M({type:["solid","sketch"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],bd.prototype,"type",void 0),v([M($h)],bd.prototype,"color",void 0),v([M({...zl,json:{write:{overridePolicy:e=>({enabled:!!e})}}})],bd.prototype,"extensionLength",void 0),v([M(zl)],bd.prototype,"size",void 0),bd=v([fe("esri.symbols.edges.Edges3D")],bd);const S3=bd;var fM;let db=fM=class extends S3{constructor(e){super(e),this.type="sketch"}clone(){return new fM(this.cloneProperties())}};v([Gt({sketch:"sketch"},{readOnly:!0})],db.prototype,"type",void 0),db=fM=v([fe("esri.symbols.edges.SketchEdges3D")],db);const Bre=db;var mM;let pb=mM=class extends S3{constructor(e){super(e),this.type="solid"}clone(){return new mM(this.cloneProperties())}};v([Gt({solid:"solid"},{readOnly:!0})],pb.prototype,"type",void 0),pb=mM=v([fe("esri.symbols.support.SolidEdges3D")],pb);const Ure=pb,QF={types:{key:"type",base:S3,typeMap:{solid:Ure,sketch:Bre}},json:{write:!0}};var yM;let ia=yM=class extends At{constructor(e){super(e),this.color=null}clone(){const e={color:this.color!=null?this.color.clone():null};return new yM(e)}};v([M($h)],ia.prototype,"color",void 0),ia=yM=v([fe("esri.symbols.support.Symbol3DMaterial")],ia);var gM;let Lu=gM=class extends Vl{constructor(e){super(e),this.type="extrude",this.size=1,this.material=null,this.castShadows=!0,this.edges=null}clone(){return new gM({edges:this.edges&&this.edges.clone(),enabled:this.enabled,material:this.material!=null?this.material.clone():null,castShadows:this.castShadows,size:this.size})}};v([Gt({Extrude:"extrude"},{readOnly:!0})],Lu.prototype,"type",void 0),v([M({type:Number,json:{write:{enabled:!0,isRequired:!0}},nonNullable:!0})],Lu.prototype,"size",void 0),v([M({type:ia,json:{write:!0}})],Lu.prototype,"material",void 0),v([M({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],Lu.prototype,"castShadows",void 0),v([M(QF)],Lu.prototype,"edges",void 0),Lu=gM=v([fe("esri.symbols.ExtrudeSymbol3DLayer")],Lu);const e8=Lu;let Ug=class extends Mo{constructor(t){super(t),this.type="simple-line",this.width=.75}hash(){return`${this.type}.${this.width}`}};v([Gt({esriSLS:"simple-line"},{readOnly:!0})],Ug.prototype,"type",void 0),v([M({type:Number,cast:xr,json:{write:!0}})],Ug.prototype,"width",void 0),Ug=v([fe("esri.symbols.LineSymbol")],Ug);const jre=Ug,Vre=["begin","end","begin-end"],t8=["arrow","circle","square","diamond","cross","x"];var _M;let gl=_M=class extends At{constructor(e){super(e),this.placement="begin-end",this.type="line-marker",this.style="arrow"}writeStyle(e,t,i,r){t[i]=(r==null?void 0:r.origin)==="web-map"?"arrow":e}set color(e){this._set("color",e)}readColor(e){return(e==null?void 0:e[0])!=null?[e[0],e[1],e[2],e[3]/255]:e}writeColor(e,t,i,r){(r==null?void 0:r.origin)==="web-map"||(t[i]=e)}clone(){return new _M({color:He(this.color),placement:this.placement,style:this.style})}hash(){var e;return`${this.placement}.${(e=this.color)==null?void 0:e.hash()}.${this.style}`}};v([M({type:["begin","end","begin-end"],json:{write:!0}})],gl.prototype,"placement",void 0),v([Gt({"line-marker":"line-marker"},{readOnly:!0}),M({json:{origins:{"web-map":{write:!1}}}})],gl.prototype,"type",void 0),v([M({type:t8})],gl.prototype,"style",void 0),v([ui("style")],gl.prototype,"writeStyle",null),v([M({type:zt,value:null,json:{write:{allowNull:!0}}})],gl.prototype,"color",null),v([mi("color")],gl.prototype,"readColor",null),v([ui("color")],gl.prototype,"writeColor",null),gl=_M=v([fe("esri.symbols.LineSymbolMarker")],gl);const Gre=gl;var vM;const JS=new ks({esriSLSSolid:"solid",esriSLSDash:"dash",esriSLSDot:"dot",esriSLSDashDot:"dash-dot",esriSLSDashDotDot:"long-dash-dot-dot",esriSLSNull:"none",esriSLSInsideFrame:"inside-frame",esriSLSShortDash:"short-dash",esriSLSShortDot:"short-dot",esriSLSShortDashDot:"short-dash-dot",esriSLSShortDashDotDot:"short-dash-dot-dot",esriSLSLongDash:"long-dash",esriSLSLongDashDot:"long-dash-dot"});let xc=vM=class extends jre{constructor(...e){super(...e),this.type="simple-line",this.style="solid",this.cap="round",this.join="round",this.marker=null,this.miterLimit=2}normalizeCtorArgs(e,t,i,r,s,n){if(e&&typeof e!="string")return e;const c={};return e!=null&&(c.style=e),t!=null&&(c.color=t),i!=null&&(c.width=xr(i)),r!=null&&(c.cap=r),s!=null&&(c.join=s),n!=null&&(c.miterLimit=xr(n)),c}clone(){var e;return new vM({color:He(this.color),style:this.style,width:this.width,cap:this.cap,join:this.join,miterLimit:this.miterLimit,marker:(e=this.marker)==null?void 0:e.clone()})}hash(){var e,t;return`${super.hash()}.${(e=this.color)==null?void 0:e.hash()}.${this.style}.${this.cap}.${this.join}.${this.miterLimit}.${(t=this.marker)==null?void 0:t.hash()}`}};v([Gt({esriSLS:"simple-line"},{readOnly:!0})],xc.prototype,"type",void 0),v([M({type:JS.apiValues,json:{read:JS.read,write:JS.write}})],xc.prototype,"style",void 0),v([M({type:["butt","round","square"],json:{write:{overridePolicy:(e,t,i)=>({enabled:e!=="round"&&(i==null?void 0:i.origin)==null})}}})],xc.prototype,"cap",void 0),v([M({type:["miter","round","bevel"],json:{write:{overridePolicy:(e,t,i)=>({enabled:e!=="round"&&(i==null?void 0:i.origin)==null})}}})],xc.prototype,"join",void 0),v([M({types:{key:"type",base:null,defaultKeyValue:"line-marker",typeMap:{"line-marker":Gre}},json:{write:!0,origins:{"web-scene":{write:!1}}}})],xc.prototype,"marker",void 0),v([M({type:Number,json:{read:!1,write:!1}})],xc.prototype,"miterLimit",void 0),xc=vM=v([fe("esri.symbols.SimpleLineSymbol")],xc);const Ym=xc;let jg=class extends Mo{constructor(t){super(t),this.outline=null,this.type=null}hash(){return`${this.type}.${this.outline&&this.outline.hash()}`}};v([M({types:{key:"type",base:null,defaultKeyValue:"simple-line",typeMap:{"simple-line":Ym}},json:{default:null,write:!0}})],jg.prototype,"outline",void 0),v([M({type:["simple-fill","picture-fill"],readOnly:!0})],jg.prototype,"type",void 0),jg=v([fe("esri.symbols.FillSymbol")],jg);const i8=jg;let fb=class extends At{constructor(t){super(t)}clone(){}};v([M({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],fb.prototype,"type",void 0),fb=v([fe("esri.symbols.patterns.LinePattern3D")],fb);const r8=fb,qre=["dash","dash-dot","dot","long-dash","long-dash-dot","long-dash-dot-dot","none","short-dash","short-dash-dot","short-dash-dot-dot","short-dot","solid"];var bM;const Hre=Bn()({dash:"dash","dash-dot":"dash-dot","dash-dot-dot":"long-dash-dot-dot",dot:"dot","long-dash":"long-dash","long-dash-dot":"long-dash-dot",null:"none","short-dash":"short-dash","short-dash-dot":"short-dash-dot","short-dash-dot-dot":"short-dash-dot-dot","short-dot":"short-dot",solid:"solid"});let Vg=bM=class extends r8{constructor(e){super(e),this.type="style",this.style="solid"}clone(){const e={style:this.style};return new bM(e)}};v([M({type:["style"]})],Vg.prototype,"type",void 0),v([Gt(Hre),M({type:qre})],Vg.prototype,"style",void 0),Vg=bM=v([fe("esri.symbols.patterns.LineStylePattern3D")],Vg);const T3=Vg;let mb=class extends At{constructor(t){super(t)}clone(){}};v([M({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],mb.prototype,"type",void 0),mb=v([fe("esri.symbols.patterns.Pattern3D")],mb);const s8=mb,Wre=["backward-diagonal","cross","diagonal-cross","forward-diagonal","horizontal","none","solid","vertical"];var wM;let Gg=wM=class extends s8{constructor(e){super(e),this.type="style",this.style="solid"}clone(){const e={style:this.style};return new wM(e)}};v([M({type:["style"]})],Gg.prototype,"type",void 0),v([M({type:Wre,json:{read:!0,write:!0}})],Gg.prototype,"style",void 0),Gg=wM=v([fe("esri.symbols.patterns.StylePattern3D")],Gg);const n8=Gg,Zre={types:{key:"type",base:s8,typeMap:{style:n8}},json:{write:!0}},o8={types:{key:"type",base:r8,typeMap:{style:T3}},json:{write:!0}},I0=new zt("white");new zt("black");const Yre=new zt([255,255,255,0]);function Jre(e){return e.r===0&&e.g===0&&e.b===0}var xM;let A0=xM=class extends ia{constructor(e){super(e),this.colorMixMode=null}clone(){const e={color:this.color!=null?this.color.clone():null,colorMixMode:this.colorMixMode};return new xM(e)}};v([Gt({multiply:"multiply",replace:"replace",tint:"tint"})],A0.prototype,"colorMixMode",void 0),A0=xM=v([fe("esri.symbols.support.Symbol3DFillMaterial")],A0);function E3(e=tse){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function M3(e,t,i,r,s,n,c=E3()){return c[0]=e,c[1]=t,c[2]=i,c[3]=r,c[4]=s,c[5]=n,c}function S_e(e,t){const i=isFinite(e[2])||isFinite(e[5]);return new Ui(i?{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],zmin:e[2],zmax:e[5],spatialReference:t}:{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],spatialReference:t})}function T_e(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[3]),e[4]=Math.max(e[4],t[4]),e[5]=Math.max(e[5],t[5])}function E_e(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[0]),e[4]=Math.max(e[4],t[1]),e[5]=Math.max(e[5],t[2])}function M_e(e,t,i=0,r=t.length/3){let s=e[0],n=e[1],c=e[2],o=e[3],f=e[4],g=e[5];for(let S=0;S=e[3]?0:e[3]-e[0]}function Xre(e){return e[1]>=e[4]?0:e[4]-e[1]}function Qre(e){return e[2]>=e[5]?0:e[5]-e[2]}function I_e(e,t=[0,0,0]){return t[0]=Kre(e),t[1]=Xre(e),t[2]=Qre(e),t}function A_e(e,t,i=e){return i[0]=t[0],i[1]=t[1],i[2]=t[2],i!==e&&(i[3]=e[3],i[4]=e[4],i[5]=e[5]),i}function P_e(e,t,i=e){return i[3]=t[0],i[4]=t[1],i[5]=t[2],i!==e&&(i[0]=e[0],i[1]=e[1],i[2]=e[2]),e}function ese(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function C_e(e){return e?ese(e,TR):E3(TR)}function $_e(e,t){return e[0]=t[0],e[1]=t[1],e[2]=Number.NEGATIVE_INFINITY,e[3]=t[2],e[4]=t[3],e[5]=Number.POSITIVE_INFINITY,e}function k_e(e,t,i,r,s){return e[0]=t,e[1]=i,e[2]=Number.NEGATIVE_INFINITY,e[3]=r,e[4]=s,e[5]=Number.POSITIVE_INFINITY,e}function SR(e){return e.length===6}function R_e(e,t,i){if(e==null||t==null)return e===t;if(!SR(e)||!SR(t))return!1;if(i){for(let r=0;r{const t=za(e);return t===0?1:Ll(t,.1,4)},nonNullable:!0},cse=["left","right","center"],use=["baseline","top","middle","bottom"],c8={type:cse,nonNullable:!0},u8={type:use,nonNullable:!0},L_e=8;var TM;let Tc=TM=class extends At{constructor(e){super(e),this.decoration="none",this.family="sans-serif",this.size=9,this.style="normal",this.weight="normal"}castSize(e){return xr(e)}clone(){return new TM({decoration:this.decoration,family:this.family,size:this.size,style:this.style,weight:this.weight})}hash(){return`${this.decoration}.${this.family}.${this.size}.${this.style}.${this.weight}`}};v([M({type:ose,json:{default:"none",write:!0}})],Tc.prototype,"decoration",void 0),v([M({type:String,json:{write:!0}})],Tc.prototype,"family",void 0),v([M({type:Number,json:{write:{overridePolicy:(e,t,i)=>({enabled:!i||!i.textSymbol3D})}}})],Tc.prototype,"size",void 0),v([Rs("size")],Tc.prototype,"castSize",null),v([M({type:ase,json:{default:"normal",write:!0}})],Tc.prototype,"style",void 0),v([M({type:lse,json:{default:"normal",write:!0}})],Tc.prototype,"weight",void 0),Tc=TM=v([fe("esri.symbols.Font")],Tc);const Wx=Tc;var EM;const hse=Bn()({circle:"circle",square:"square",cross:"cross",x:"x",kite:"kite",triangle:"triangle"});let xd=EM=class extends At{constructor(e){super(e)}readHref(e,t,i){return e?__(e,i):t.dataURI}writeHref(e,t,i,r){e&&(Cp(e)?t.dataURI=e:(t.href=Sx(e,r),zn(t.href)&&(t.href=ta(t.href))))}clone(){return new EM({href:this.href,primitive:this.primitive})}};v([M({type:String,json:{write:!0,read:{source:["href","dataURI"]}}})],xd.prototype,"href",void 0),v([mi("href")],xd.prototype,"readHref",null),v([ui("href",{href:{type:String},dataURI:{type:String}})],xd.prototype,"writeHref",null),v([Gt(hse)],xd.prototype,"primitive",void 0),xd=EM=v([fe("esri.symbols.support.IconSymbol3DLayerResource")],xd);var MM;let om=MM=class extends Nt{constructor(){super(...arguments),this.x=0,this.y=0}clone(){return new MM({x:this.x,y:this.y})}};v([M({type:Number})],om.prototype,"x",void 0),v([M({type:Number})],om.prototype,"y",void 0),om=MM=v([fe("esri.symbols.support.Symbol3DAnchorPosition2D")],om);var IM;let qg=IM=class extends At{constructor(e){super(e),this.color=new zt([0,0,0,1]),this.size=mh(1)}clone(){const e={color:this.color!=null?this.color.clone():null,size:this.size};return new IM(e)}};v([M($h)],qg.prototype,"color",void 0),v([M(zl)],qg.prototype,"size",void 0),qg=IM=v([fe("esri.symbols.support.Symbol3DIconOutline")],qg);var Uf;const h8="esri.symbols.IconSymbol3DLayer";let _l=Uf=class extends Vl{constructor(e){super(e),this.material=null,this.resource=null,this.type="icon",this.size=12,this.anchor="center",this.anchorPosition=null,this.outline=null}clone(){return new Uf({anchor:this.anchor,anchorPosition:this.anchorPosition&&this.anchorPosition.clone(),enabled:this.enabled,material:this.material!=null?this.material.clone():null,outline:this.outline!=null?this.outline.clone():null,resource:this.resource&&this.resource.clone(),size:this.size})}static fromSimpleMarkerSymbol(e){const t=e.color||I0,i=ER(e),r=e.outline&&e.outline.width>0?{size:e.outline.width,color:(e.outline.color||I0).clone()}:null;return new Uf({size:e.size,resource:{primitive:pse(e.style)},material:{color:t},outline:r,anchor:i?"relative":void 0,anchorPosition:i})}static fromPictureMarkerSymbol(e){const t=!e.color||Jre(e.color)?I0:e.color,i=ER(e);return new Uf({size:e.width<=e.height?e.height:e.width,resource:{href:e.url},material:{color:t.clone()},anchor:i?"relative":void 0,anchorPosition:i})}static fromCIMSymbol(e){return new Uf({resource:{href:z4({mediaType:"application/json",data:JSON.stringify(e.data)})}})}};function ER(e){const t="width"in e?e.width:e.size,i="height"in e?e.height:e.size,r=MR(e.xoffset),s=MR(e.yoffset);return(r||s)&&t&&i?{x:-r/t,y:s/i}:null}function MR(e){return isFinite(e)?e:0}v([M({type:ia,json:{write:!0}})],_l.prototype,"material",void 0),v([M({type:xd,json:{write:!0}})],_l.prototype,"resource",void 0),v([Gt({Icon:"icon"},{readOnly:!0})],_l.prototype,"type",void 0),v([M(zl)],_l.prototype,"size",void 0),v([Gt({center:"center",left:"left",right:"right",top:"top",bottom:"bottom",topLeft:"top-left",topRight:"top-right",bottomLeft:"bottom-left",bottomRight:"bottom-right",relative:"relative"}),M({json:{default:"center"}})],_l.prototype,"anchor",void 0),v([M({type:om,json:{type:[Number],read:{reader:e=>new om({x:e[0],y:e[1]})},write:{writer:(e,t)=>{t.anchorPosition=[e.x,e.y]},overridePolicy(){return{enabled:this.anchor==="relative"}}}}})],_l.prototype,"anchorPosition",void 0),v([M({type:qg,json:{write:!0}})],_l.prototype,"outline",void 0),_l=Uf=v([fe(h8)],_l);const dse={circle:"circle",cross:"cross",diamond:"kite",square:"square",x:"x",triangle:"triangle",path:null};function pse(e){return dse[e]||(_t.getLogger(h8).warn(`${e} cannot be mapped to Icon symbol. Fallback to "circle"`),"circle")}const ip=_l;let Sd=class extends jl(At){constructor(t){super(t),this.type="style",this.placement="begin-end",this.style="arrow",this.color=null}equals(t){return t!=null&&t.placement===this.placement&&t.style===this.style&&(this.color==null&&t.color==null||this.color!=null&&t.color!=null&&this.color.toJSON()===t.color.toJSON())}};v([M({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],Sd.prototype,"type",void 0),v([M({type:Vre,json:{default:"begin-end",write:!0}})],Sd.prototype,"placement",void 0),v([M({type:t8,json:{default:"arrow",write:!0}})],Sd.prototype,"style",void 0),v([M({type:zt,json:{type:[$r],default:null,write:!0}})],Sd.prototype,"color",void 0),Sd=v([fe("esri.symbols.LineStyleMarker3D")],Sd);const AM=Sd;var gb;let vl=gb=class extends Vl{constructor(e){super(e),this.material=null,this.type="line",this.join="miter",this.cap="butt",this.size=mh(1),this.pattern=null,this.marker=null}clone(){const e={enabled:this.enabled,material:this.material!=null?this.material.clone():null,size:this.size,join:this.join,cap:this.cap,pattern:this.pattern!=null?this.pattern.clone():null,marker:this.marker!=null?this.marker.clone():null};return new gb(e)}static fromSimpleLineSymbol(e){var i;const t={enabled:!0,size:e.width??mh(1),cap:e.cap||"butt",join:e.join||"miter",pattern:e.style&&e.style!=="inside-frame"?new T3({style:e.style}):null,material:new ia({color:(e.color||I0).clone()}),marker:e.marker?new AM({placement:e.marker.placement,style:e.marker.style,color:((i=e.marker.color)==null?void 0:i.clone())??null}):null};return new gb(t)}};v([M({type:ia,json:{write:!0}})],vl.prototype,"material",void 0),v([Gt({Line:"line"},{readOnly:!0})],vl.prototype,"type",void 0),v([M({type:a8,json:{write:!0,default:"miter"}})],vl.prototype,"join",void 0),v([M({type:I3,json:{write:!0,default:"butt"}})],vl.prototype,"cap",void 0),v([M(zl)],vl.prototype,"size",void 0),v([M(o8)],vl.prototype,"pattern",void 0),v([M({types:{key:"type",base:AM,typeMap:{style:AM}},json:{write:!0}})],vl.prototype,"marker",void 0),vl=gb=v([fe("esri.symbols.LineSymbol3DLayer")],vl);const I_=vl;var PM;const fse=Bn()({sphere:"sphere",cylinder:"cylinder",cube:"cube",cone:"cone",diamond:"diamond",tetrahedron:"tetrahedron",invertedCone:"inverted-cone"});let Hg=PM=class extends At{clone(){return new PM({href:this.href,primitive:this.primitive})}};v([M({type:String,json:{read:RA,write:xp}})],Hg.prototype,"href",void 0),v([Gt(fse)],Hg.prototype,"primitive",void 0),Hg=PM=v([fe("esri.symbols.support.ObjectSymbol3DLayerResource")],Hg);var CM;let Bd=CM=class extends Nt{constructor(){super(...arguments),this.x=0,this.y=0,this.z=0}clone(){return new CM({x:this.x,y:this.y,z:this.z})}};v([M({type:Number})],Bd.prototype,"x",void 0),v([M({type:Number})],Bd.prototype,"y",void 0),v([M({type:Number})],Bd.prototype,"z",void 0),Bd=CM=v([fe("esri.symbols.support.Symbol3DAnchorPosition3D")],Bd);var $M;let hn=$M=class extends Vl{constructor(e){super(e),this.material=null,this.castShadows=!0,this.resource=null,this.type="object",this.width=void 0,this.height=void 0,this.depth=void 0,this.anchor=void 0,this.anchorPosition=void 0,this.heading=void 0,this.tilt=void 0,this.roll=void 0}clone(){var e,t,i;return new $M({heading:this.heading,tilt:this.tilt,roll:this.roll,anchor:this.anchor,anchorPosition:(e=this.anchorPosition)==null?void 0:e.clone(),depth:this.depth,enabled:this.enabled,height:this.height,material:((t=this.material)==null?void 0:t.clone())??null,castShadows:this.castShadows,resource:(i=this.resource)==null?void 0:i.clone(),width:this.width})}get isPrimitive(){return!this.resource||typeof this.resource.href!="string"}};v([M({type:ia,json:{write:!0}})],hn.prototype,"material",void 0),v([M({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],hn.prototype,"castShadows",void 0),v([M({type:Hg,json:{write:!0}})],hn.prototype,"resource",void 0),v([Gt({Object:"object"},{readOnly:!0})],hn.prototype,"type",void 0),v([M({type:Number,json:{write:!0}})],hn.prototype,"width",void 0),v([M({type:Number,json:{write:!0}})],hn.prototype,"height",void 0),v([M({type:Number,json:{write:!0}})],hn.prototype,"depth",void 0),v([Gt({center:"center",top:"top",bottom:"bottom",origin:"origin",relative:"relative"}),M({json:{default:"origin"}})],hn.prototype,"anchor",void 0),v([M({type:Bd,json:{type:[Number],read:{reader:e=>new Bd({x:e[0],y:e[1],z:e[2]})},write:{writer:(e,t)=>{t.anchorPosition=[e.x,e.y,e.z]},overridePolicy(){return{enabled:this.anchor==="relative"}}}}})],hn.prototype,"anchorPosition",void 0),v([M({type:Number,json:{write:!0}})],hn.prototype,"heading",void 0),v([M({type:Number,json:{write:!0}})],hn.prototype,"tilt",void 0),v([M({type:Number,json:{write:!0}})],hn.prototype,"roll",void 0),v([M({readOnly:!0})],hn.prototype,"isPrimitive",null),hn=$M=v([fe("esri.symbols.ObjectSymbol3DLayer")],hn);const A3=hn;var kM;let In=kM=class extends Vl{constructor(e){super(e),this.material=null,this.castShadows=!0,this.type="path",this.profile="circle",this.join="miter",this.cap="butt",this.width=void 0,this.height=void 0,this.anchor="center",this.profileRotation="all"}readWidth(e,t){return e??(t.height==null&&t.size!=null?t.size:void 0)}readHeight(e,t){return e??(t.width==null&&t.size!=null?t.size:void 0)}clone(){return new kM({enabled:this.enabled,material:this.material!=null?this.material.clone():null,castShadows:this.castShadows,profile:this.profile,join:this.join,cap:this.cap,width:this.width,height:this.height,profileRotation:this.profileRotation,anchor:this.anchor})}};v([M({type:ia,json:{write:!0}})],In.prototype,"material",void 0),v([M({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],In.prototype,"castShadows",void 0),v([Gt({Path:"path"},{readOnly:!0})],In.prototype,"type",void 0),v([M({type:["circle","quad"],json:{write:!0,default:"circle"}})],In.prototype,"profile",void 0),v([M({type:a8,json:{write:!0,default:"miter"}})],In.prototype,"join",void 0),v([M({type:nse,json:{write:!0,default:"butt"}})],In.prototype,"cap",void 0),v([M({type:Number,json:{write:{enabled:!0,target:{width:{type:Number},size:{type:Number}}}}})],In.prototype,"width",void 0),v([mi("width",["width","size","height"])],In.prototype,"readWidth",null),v([M({type:Number,json:{write:!0}})],In.prototype,"height",void 0),v([mi("height",["height","size","width"])],In.prototype,"readHeight",null),v([M({type:["center","bottom","top"],json:{write:!0,default:"center"}})],In.prototype,"anchor",void 0),v([M({type:["heading","all"],json:{write:!0,default:"all"}})],In.prototype,"profileRotation",void 0),In=kM=v([fe("esri.symbols.PathSymbol3DLayer")],In);const P3=In;var RM;let am=RM=class extends At{constructor(){super(...arguments),this.color=new zt([0,0,0,1]),this.size=0}clone(){const e={color:He(this.color),size:this.size};return new RM(e)}};v([M($h)],am.prototype,"color",void 0),v([M(zl)],am.prototype,"size",void 0),am=RM=v([fe("esri.symbols.support.Symbol3DHalo")],am);let P0=class extends jl(At){constructor(t){super(t),this.color=null}};v([M($h)],P0.prototype,"color",void 0),P0=v([fe("esri.symbols.support.Symbol3DTextBackground")],P0);var _b;let Hn=_b=class extends Vl{constructor(e){super(e),this._userSize=void 0,this.halo=null,this.horizontalAlignment="center",this.lineHeight=1,this.material=null,this.background=null,this.text=null,this.type="text",this.verticalAlignment="baseline"}get font(){return this._get("font")||null}set font(e){e!=null&&this._userSize!=null&&(e.size=this._userSize),this._set("font",e)}writeFont(e,t,i,r){const s={...r,textSymbol3D:!0};t.font=e.write({},s),delete t.font.size}get size(){var e;return this._userSize!=null?this._userSize:((e=this.font)==null?void 0:e.size)!=null?this.font.size:9}set size(e){this._userSize=e,this.font!=null&&(this.font.size=this._userSize),this.notifyChange("size")}clone(){const e=new _b({enabled:this.enabled,font:this.font&&He(this.font),halo:this.halo&&He(this.halo),horizontalAlignment:this.horizontalAlignment,lineHeight:this.lineHeight,material:this.material!=null?this.material.clone():null,text:this.text,verticalAlignment:this.verticalAlignment,background:He(this.background)});return e._userSize=this._userSize,e}static fromTextSymbol(e){return new _b({font:e.font!=null?e.font.clone():new Wx,halo:mse(e.haloColor,e.haloSize),horizontalAlignment:e.horizontalAlignment,lineHeight:e.lineHeight,material:e.color?new ia({color:e.color.clone()}):null,text:e.text,verticalAlignment:e.verticalAlignment,background:e.backgroundColor?new P0({color:e.backgroundColor.clone()}):null})}};function mse(e,t){return e&&t!=null&&t>0?new am({color:He(e),size:t}):null}v([M({type:Wx,json:{write:!0}})],Hn.prototype,"font",null),v([ui("font")],Hn.prototype,"writeFont",null),v([M({type:am,json:{write:!0}})],Hn.prototype,"halo",void 0),v([M({...c8,json:{default:"center",write:!0}})],Hn.prototype,"horizontalAlignment",void 0),v([M({...l8,json:{default:1,write:!0}})],Hn.prototype,"lineHeight",void 0),v([M({type:ia,json:{write:!0}})],Hn.prototype,"material",void 0),v([M({type:P0,json:{write:!0}})],Hn.prototype,"background",void 0),v([M(zl)],Hn.prototype,"size",null),v([M({type:String,json:{write:!0}})],Hn.prototype,"text",void 0),v([Gt({Text:"text"},{readOnly:!0})],Hn.prototype,"type",void 0),v([M({...u8,json:{default:"baseline",write:!0}})],Hn.prototype,"verticalAlignment",void 0),Hn=_b=v([fe("esri.symbols.TextSymbol3DLayer")],Hn);const Jm=Hn;var OM;let Du=OM=class extends Vl{constructor(e){super(e),this.color=LM.clone(),this.type="water",this.waterbodySize="medium",this.waveDirection=null,this.waveStrength="moderate"}clone(){return new OM({color:He(this.color),waterbodySize:this.waterbodySize,waveDirection:this.waveDirection,waveStrength:this.waveStrength})}};v([M({type:zt,nonNullable:!0,json:{type:[$r],write:(e,t,i)=>t[i]=e.toArray(zt.AlphaMode.UNLESS_OPAQUE),default:()=>LM.clone(),defaultEquals:e=>e.toCss(!0)===LM.toCss(!0)}})],Du.prototype,"color",void 0),v([Gt({Water:"water"},{readOnly:!0})],Du.prototype,"type",void 0),v([M({type:["small","medium","large"],json:{write:!0,default:"medium"}})],Du.prototype,"waterbodySize",void 0),v([M({type:Number,json:{write:!0,default:null}})],Du.prototype,"waveDirection",void 0),v([M({type:["calm","rippled","slight","moderate"],json:{write:!0,default:"moderate"}})],Du.prototype,"waveStrength",void 0),Du=OM=v([fe("esri.symbols.WaterSymbol3DLayer")],Du);const LM=new zt([0,119,190]),d8=Du;var DM;let Td=DM=class extends Nt{constructor(e){super(e),this.name=null,this.styleUrl=null,this.styleName=null,this.portal=null}clone(){return new DM({name:this.name,styleUrl:this.styleUrl,styleName:this.styleName,portal:this.portal})}};v([M({type:String})],Td.prototype,"name",void 0),v([M({type:String})],Td.prototype,"styleUrl",void 0),v([M({type:String})],Td.prototype,"styleName",void 0),v([M({type:Za})],Td.prototype,"portal",void 0),Td=DM=v([fe("esri.symbols.support.StyleOrigin")],Td);const NM=Td;var zM;let C0=zM=class extends Nt{constructor(){super(...arguments),this.url=""}clone(){return new zM({url:this.url})}};v([M({type:String})],C0.prototype,"url",void 0),C0=zM=v([fe("esri.symbols.support.Thumbnail")],C0);const p8={icon:ip,object:A3,line:I_,path:P3,fill:M_,extrude:e8,text:Jm,water:d8},yse=Bt.ofType({base:Vl,key:"type",typeMap:p8,errorContext:"symbol-layer"});let bl=class extends Mo{constructor(t){super(t),this.styleOrigin=null,this.thumbnail=null,this.type=null;const i=this.__accessor__&&this.__accessor__.metadata&&this.__accessor__.metadata.symbolLayers,r=i==null?void 0:i.type,s=r||Bt;this._set("symbolLayers",new s)}get color(){return null}set color(t){this.constructed&&_t.getLogger(this).error("Symbol3D does not support colors on the symbol level. Colors may be set on individual symbol layer materials instead.")}set symbolLayers(t){mp(t,this._get("symbolLayers"))}readStyleOrigin(t,i,r){if(t.styleUrl&&t.name){const s=__(t.styleUrl,r);return new NM({styleUrl:s,name:t.name})}if(t.styleName&&t.name)return new NM({portal:(r==null?void 0:r.portal)||Za.getDefault(),styleName:t.styleName,name:t.name});r!=null&&r.messages&&r.messages.push(new jc("symbol3d:incomplete-style-origin","Style origin requires either a 'styleUrl' or 'styleName' and a 'name' property",{context:r,definition:t}))}writeStyleOrigin(t,i,r,s){if(t.styleUrl&&t.name){let n=Sx(t.styleUrl,s);zn(n)&&(n=ta(n)),i.styleOrigin={styleUrl:n,name:t.name}}else t.styleName&&t.name&&(t.portal&&(s!=null&&s.portal)&&!D4(t.portal.restUrl,s.portal.restUrl)?s!=null&&s.messages&&s.messages.push(new jc("symbol:cross-portal","The symbol style origin cannot be persisted because it refers to an item on a different portal than the one being saved to.",{symbol:this})):i.styleOrigin={styleName:t.styleName,name:t.name})}normalizeCtorArgs(t){return t instanceof Vl||t&&p8[t.type]?{symbolLayers:[t]}:Array.isArray(t)?{symbolLayers:t}:t}};v([M({json:{read:!1,write:!1}})],bl.prototype,"color",null),v([M({type:yse,nonNullable:!0,json:{write:!0}}),Rs(Y4)],bl.prototype,"symbolLayers",null),v([M({type:NM})],bl.prototype,"styleOrigin",void 0),v([mi("styleOrigin")],bl.prototype,"readStyleOrigin",null),v([ui("styleOrigin",{"styleOrigin.styleUrl":{type:String},"styleOrigin.styleName":{type:String},"styleOrigin.name":{type:String}})],bl.prototype,"writeStyleOrigin",null),v([M({type:C0,json:{read:!1}})],bl.prototype,"thumbnail",void 0),v([M({type:["point-3d","line-3d","polygon-3d","mesh-3d","label-3d"],readOnly:!0})],bl.prototype,"type",void 0),bl=v([fe("esri.symbols.Symbol3D")],bl);const A_=bl;let Wg=class extends At{constructor(t){super(t),this.visible=!0}clone(){}};v([M({type:["line"],constructOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],Wg.prototype,"type",void 0),v([M({readOnly:!0})],Wg.prototype,"visible",void 0),Wg=v([fe("esri.symbols.callouts.Callout3D")],Wg);const f8=Wg;var FM;let vb=FM=class extends At{constructor(e){super(e),this.color=new zt("white")}clone(){return new FM({color:He(this.color)})}};v([M($h)],vb.prototype,"color",void 0),vb=FM=v([fe("esri.symbols.callouts.LineCallout3DBorder")],vb);const gse=vb;var BM;let Nu=BM=class extends f8{constructor(e){super(e),this.type="line",this.color=new zt([0,0,0,1]),this.size=mh(1),this.border=null}get visible(){return this.size>0&&this.color!=null&&this.color.a>0}clone(){return new BM({color:He(this.color),size:this.size,border:He(this.border)})}};v([Gt({line:"line"})],Nu.prototype,"type",void 0),v([M($h)],Nu.prototype,"color",void 0),v([M(zl)],Nu.prototype,"size",void 0),v([M({type:gse,json:{write:!0}})],Nu.prototype,"border",void 0),v([M({readOnly:!0})],Nu.prototype,"visible",null),Nu=BM=v([fe("esri.symbols.callouts.LineCallout3D")],Nu);const m8=Nu;function C3(e){if(!e)return!1;const t=e.verticalOffset;return!!t&&!(t.screenLength<=0||t.maxWorldLength!=null&&t.maxWorldLength<=0)}function y8(e){if(!e||!e.supportsCallout||!e.supportsCallout())return!1;const t=e.callout;return!!t&&!!t.visible&&!!C3(e)}const g8={types:{key:"type",base:f8,typeMap:{line:m8}},json:{write:!0}};var UM;let jf=UM=class extends At{constructor(e){super(e),this.screenLength=0,this.minWorldLength=0,this.maxWorldLength=null}clone(){return new UM({screenLength:this.screenLength,minWorldLength:this.minWorldLength,maxWorldLength:this.maxWorldLength})}};v([M(zl)],jf.prototype,"screenLength",void 0),v([M({type:Number,nonNullable:!0,json:{write:!0,default:0}})],jf.prototype,"minWorldLength",void 0),v([M({type:Number,json:{write:!0}})],jf.prototype,"maxWorldLength",void 0),jf=UM=v([fe("esri.symbols.support.Symbol3DVerticalOffset")],jf);const $3=jf;var bb;const _8=Bt.ofType({base:null,key:"type",typeMap:{text:Jm}});let zu=bb=class extends A_{constructor(e){super(e),this.verticalOffset=null,this.callout=null,this.styleOrigin=null,this.symbolLayers=new _8,this.type="label-3d"}supportsCallout(){return!0}hasVisibleCallout(){return y8(this)}hasVisibleVerticalOffset(){return C3(this)}clone(){return new bb({styleOrigin:He(this.styleOrigin),symbolLayers:He(this.symbolLayers),thumbnail:He(this.thumbnail),callout:He(this.callout),verticalOffset:He(this.verticalOffset)})}static fromTextSymbol(e){return new bb({symbolLayers:new Bt([Jm.fromTextSymbol(e)])})}};v([M({type:$3,json:{write:!0}})],zu.prototype,"verticalOffset",void 0),v([M(g8)],zu.prototype,"callout",void 0),v([M({json:{read:!1,write:!1}})],zu.prototype,"styleOrigin",void 0),v([M({type:_8})],zu.prototype,"symbolLayers",void 0),v([Gt({LabelSymbol3D:"label-3d"},{readOnly:!0})],zu.prototype,"type",void 0),zu=bb=v([fe("esri.symbols.LabelSymbol3D")],zu);const k3=zu;var wb;const v8=Bt.ofType({base:null,key:"type",typeMap:{line:I_,path:P3}}),_se=Bt.ofType({base:null,key:"type",typeMap:{line:I_,path:P3}});let Zg=wb=class extends A_{constructor(e){super(e),this.symbolLayers=new v8,this.type="line-3d"}clone(){return new wb({styleOrigin:He(this.styleOrigin),symbolLayers:He(this.symbolLayers),thumbnail:He(this.thumbnail)})}static fromSimpleLineSymbol(e){return new wb({symbolLayers:new Bt([I_.fromSimpleLineSymbol(e)])})}};v([M({type:v8,json:{type:_se}})],Zg.prototype,"symbolLayers",void 0),v([Gt({LineSymbol3D:"line-3d"},{readOnly:!0})],Zg.prototype,"type",void 0),Zg=wb=v([fe("esri.symbols.LineSymbol3D")],Zg);const R3=Zg;let Fu=class extends Mo{constructor(t){super(t),this.angle=0,this.type=null,this.xoffset=0,this.yoffset=0,this.size=9}hash(){return`${this.type}.${this.angle}.${this.size}.${this.xoffset}.${this.yoffset}`}};v([M({type:Number,json:{read:e=>e&&-1*e,write:(e,t)=>t.angle=e&&-1*e}})],Fu.prototype,"angle",void 0),v([M({type:["simple-marker","picture-marker"],readOnly:!0})],Fu.prototype,"type",void 0),v([M({type:Number,cast:xr,json:{write:!0}})],Fu.prototype,"xoffset",void 0),v([M({type:Number,cast:xr,json:{write:!0}})],Fu.prototype,"yoffset",void 0),v([M({type:Number,cast:e=>e==="auto"?e:xr(e),json:{write:!0}})],Fu.prototype,"size",void 0),Fu=v([fe("esri.symbols.MarkerSymbol")],Fu);const b8=Fu;var xb;const w8=Bt.ofType({base:null,key:"type",typeMap:{fill:M_}});let Yg=xb=class extends A_{constructor(e){super(e),this.symbolLayers=new w8,this.type="mesh-3d"}clone(){return new xb({styleOrigin:He(this.styleOrigin),symbolLayers:He(this.symbolLayers),thumbnail:He(this.thumbnail)})}static fromSimpleFillSymbol(e){return new xb({symbolLayers:new Bt([M_.fromSimpleFillSymbol(e)])})}};v([M({type:w8})],Yg.prototype,"symbolLayers",void 0),v([Gt({MeshSymbol3D:"mesh-3d"},{readOnly:!0})],Yg.prototype,"type",void 0),Yg=xb=v([fe("esri.symbols.MeshSymbol3D")],Yg);const O3=Yg;function vse(e,t,i){return t.imageData?z4({mediaType:t.contentType||"image/png",isBase64:!0,data:t.imageData}):x8(t.url,i)}function x8(e,t){if(!zn(e)){const i=wse(t);if(i)return fp(i,"images",e)}return __(e,t)}function bse(e,t,i,r){if(Cp(e)){const s=V0(e);if(!s)return;t.contentType=s.mediaType,t.imageData=s.data,i&&i.imageData===t.imageData&&i.url&&xp(i.url,t,"url",r)}else xp(e,t,"url",r)}const S8={json:{read:{source:["imageData","url"],reader:vse},write:{writer(e,t,i,r){bse(e,t,this.source,r)}}}},T8={readOnly:!0,json:{read:{source:["imageData","url"],reader(e,t,i){const r={};return t.imageData&&(r.imageData=t.imageData),t.contentType&&(r.contentType=t.contentType),t.url&&(r.url=x8(t.url,i)),r}}}};function wse(e){var s,n;if(!e)return null;const{origin:t,layer:i}=e;if(t!=="service"&&t!=="portal-item")return null;const r=i==null?void 0:i.type;return r==="feature"||r==="stream"?(s=i.parsedUrl)==null?void 0:s.path:r==="map-image"||r==="tile"?(n=e.url)==null?void 0:n.path:null}var jM;let Ho=jM=class extends i8{constructor(...e){super(...e),this.type="picture-fill",this.url=null,this.xscale=1,this.yscale=1,this.width=12,this.height=12,this.xoffset=0,this.yoffset=0,this.source=null}normalizeCtorArgs(e,t,i,r){if(e&&typeof e!="string"&&e.imageData==null)return e;const s={};return e&&(s.url=e),t&&(s.outline=t),i!=null&&(s.width=xr(i)),r!=null&&(s.height=xr(r)),s}clone(){const e=new jM({color:He(this.color),height:this.height,outline:this.outline&&this.outline.clone(),url:this.url,width:this.width,xoffset:this.xoffset,xscale:this.xscale,yoffset:this.yoffset,yscale:this.yscale});return e._set("source",He(this.source)),e}hash(){var e;return`${super.hash()}.${(e=this.color)==null?void 0:e.hash()}.${this.height}.${this.url}.${this.width}.${this.xoffset}.${this.xscale}.${this.yoffset}.${this.yscale}`}};v([Gt({esriPFS:"picture-fill"},{readOnly:!0})],Ho.prototype,"type",void 0),v([M(S8)],Ho.prototype,"url",void 0),v([M({type:Number,json:{write:!0}})],Ho.prototype,"xscale",void 0),v([M({type:Number,json:{write:!0}})],Ho.prototype,"yscale",void 0),v([M({type:Number,cast:xr,json:{write:!0}})],Ho.prototype,"width",void 0),v([M({type:Number,cast:xr,json:{write:!0}})],Ho.prototype,"height",void 0),v([M({type:Number,cast:xr,json:{write:!0}})],Ho.prototype,"xoffset",void 0),v([M({type:Number,cast:xr,json:{write:!0}})],Ho.prototype,"yoffset",void 0),v([M(T8)],Ho.prototype,"source",void 0),Ho=jM=v([fe("esri.symbols.PictureFillSymbol")],Ho);const E8=Ho;var VM;let Ca=VM=class extends b8{constructor(...e){super(...e),this.color=null,this.type="picture-marker",this.url=null,this.source=null,this.height=12,this.width=12,this.size=null}normalizeCtorArgs(e,t,i){if(e&&typeof e!="string"&&e.imageData==null)return e;const r={};return e&&(r.url=e),t!=null&&(r.width=xr(t)),i!=null&&(r.height=xr(i)),r}readHeight(e,t){return t.size||e}readWidth(e,t){return t.size||e}clone(){const e=new VM({angle:this.angle,height:this.height,url:this.url,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset});return e._set("source",He(this.source)),e}hash(){return`${super.hash()}.${this.height}.${this.url}.${this.width}`}};v([M({json:{write:!1}})],Ca.prototype,"color",void 0),v([Gt({esriPMS:"picture-marker"},{readOnly:!0})],Ca.prototype,"type",void 0),v([M(S8)],Ca.prototype,"url",void 0),v([M(T8)],Ca.prototype,"source",void 0),v([M({type:Number,cast:xr,json:{write:!0}})],Ca.prototype,"height",void 0),v([mi("height",["height","size"])],Ca.prototype,"readHeight",null),v([M({type:Number,cast:xr,json:{write:!0}})],Ca.prototype,"width",void 0),v([M({json:{write:!1}})],Ca.prototype,"size",void 0),Ca=VM=v([fe("esri.symbols.PictureMarkerSymbol")],Ca);const L3=Ca;var Ed;const M8=Bt.ofType({base:null,key:"type",typeMap:{icon:ip,object:A3,text:Jm}});let Md=Ed=class extends A_{constructor(e){super(e),this.verticalOffset=null,this.callout=null,this.symbolLayers=new M8,this.type="point-3d"}supportsCallout(){if((this.symbolLayers?this.symbolLayers.length:0)<1)return!1;for(const e of this.symbolLayers.items)switch(e.type){case"icon":case"text":case"object":continue;default:return!1}return!0}hasVisibleCallout(){return y8(this)}hasVisibleVerticalOffset(){return C3(this)}clone(){return new Ed({verticalOffset:He(this.verticalOffset),callout:He(this.callout),styleOrigin:He(this.styleOrigin),symbolLayers:He(this.symbolLayers),thumbnail:He(this.thumbnail)})}static fromSimpleMarkerSymbol(e){return new Ed({symbolLayers:new Bt([ip.fromSimpleMarkerSymbol(e)])})}static fromPictureMarkerSymbol(e){return new Ed({symbolLayers:new Bt([ip.fromPictureMarkerSymbol(e)])})}static fromCIMSymbol(e){var r,s;if(((s=(r=e.data)==null?void 0:r.symbol)==null?void 0:s.type)!=="CIMPointSymbol")return null;const i=e.data.symbol;return new Ed(i!=null&&i.callout?{symbolLayers:new Bt([ip.fromCIMSymbol(e)]),callout:new m8({size:.5,color:new zt([0,0,0])}),verticalOffset:new $3({screenLength:40})}:{symbolLayers:new Bt([ip.fromCIMSymbol(e)])})}static fromTextSymbol(e){return new Ed({symbolLayers:new Bt([Jm.fromTextSymbol(e)])})}};v([M({type:$3,json:{write:!0}})],Md.prototype,"verticalOffset",void 0),v([M(g8)],Md.prototype,"callout",void 0),v([M({type:M8,json:{origins:{"web-scene":{write:!0}}}})],Md.prototype,"symbolLayers",void 0),v([Gt({PointSymbol3D:"point-3d"},{readOnly:!0})],Md.prototype,"type",void 0),Md=Ed=v([fe("esri.symbols.PointSymbol3D")],Md);const D3=Md;var Jg;const I8=Bt.ofType({base:null,key:"type",typeMap:{extrude:e8,fill:M_,icon:ip,line:I_,object:A3,text:Jm,water:d8}});let Kg=Jg=class extends A_{constructor(e){super(e),this.symbolLayers=new I8,this.type="polygon-3d"}initialize(){const e=t=>{t.type==="line"&&Em(_t.getLogger(this),"LineSymbol3DLayer can not be used as a SymbolLayer with a PolygonSymbol3D symbol anymore.",{replacement:"Use FillSymbol3DLayer.outline instead.",version:"4.28"}),t.type==="text"&&Em(_t.getLogger(this),"TextSymbol3DLayer can not be used as a SymbolLayer with a PolygonSymbol3D symbol anymore.",{replacement:"Use Labels instead.",version:"4.28"})};for(const t of this.symbolLayers)e(t);this.addHandles(Sp(()=>this.symbolLayers,"after-add",({item:t})=>e(t),Tp))}clone(){return new Jg({styleOrigin:He(this.styleOrigin),symbolLayers:He(this.symbolLayers),thumbnail:He(this.thumbnail)})}static fromJSON(e){var i;const t=new Jg;if(t.read(e),t.symbolLayers.length===2&&t.symbolLayers.at(0).type==="fill"&&t.symbolLayers.at(1).type==="line"){const r=t.symbolLayers.at(0),s=t.symbolLayers.at(1);!s.enabled||(i=e.symbolLayers)!=null&&i[1]&&e.symbolLayers[1].enable===!1||(r.outline={size:s.size,color:s.material!=null?s.material.color:null}),t.symbolLayers.removeAt(1)}return t}static fromSimpleFillSymbol(e){return new Jg({symbolLayers:new Bt([M_.fromSimpleFillSymbol(e)])})}};v([M({type:I8,json:{write:!0}})],Kg.prototype,"symbolLayers",void 0),v([Gt({PolygonSymbol3D:"polygon-3d"},{readOnly:!0})],Kg.prototype,"type",void 0),Kg=Jg=v([fe("esri.symbols.PolygonSymbol3D")],Kg);const N3=Kg;var GM;const KS=new ks({esriSFSSolid:"solid",esriSFSNull:"none",esriSFSHorizontal:"horizontal",esriSFSVertical:"vertical",esriSFSForwardDiagonal:"forward-diagonal",esriSFSBackwardDiagonal:"backward-diagonal",esriSFSCross:"cross",esriSFSDiagonalCross:"diagonal-cross"});let Id=GM=class extends i8{constructor(...e){super(...e),this.color=new zt([0,0,0,.25]),this.outline=new Ym,this.type="simple-fill",this.style="solid"}normalizeCtorArgs(e,t,i){if(e&&typeof e!="string")return e;const r={};return e&&(r.style=e),t&&(r.outline=t),i&&(r.color=i),r}clone(){return new GM({color:He(this.color),outline:this.outline&&this.outline.clone(),style:this.style})}hash(){return`${super.hash()}${this.style}.${this.color&&this.color.hash()}`}};v([M()],Id.prototype,"color",void 0),v([M()],Id.prototype,"outline",void 0),v([Gt({esriSFS:"simple-fill"},{readOnly:!0})],Id.prototype,"type",void 0),v([M({type:KS.apiValues,json:{read:KS.read,write:KS.write}})],Id.prototype,"style",void 0),Id=GM=v([fe("esri.symbols.SimpleFillSymbol")],Id);const A8=Id;var qM;const XS=new ks({esriSMSCircle:"circle",esriSMSSquare:"square",esriSMSCross:"cross",esriSMSX:"x",esriSMSDiamond:"diamond",esriSMSTriangle:"triangle",esriSMSPath:"path"});let wl=qM=class extends b8{constructor(...e){super(...e),this.color=new zt([255,255,255,.25]),this.type="simple-marker",this.size=12,this.style="circle",this.outline=new Ym}normalizeCtorArgs(e,t,i,r){if(e&&typeof e!="string")return e;const s={};return e&&(s.style=e),t!=null&&(s.size=xr(t)),i&&(s.outline=i),r&&(s.color=r),s}writeColor(e,t){e&&this.style!=="x"&&this.style!=="cross"&&(t.color=e.toJSON()),e===null&&(t.color=null)}set path(e){this.style="path",this._set("path",e)}clone(){return new qM({angle:this.angle,color:He(this.color),outline:this.outline&&this.outline.clone(),path:this.path,size:this.size,style:this.style,xoffset:this.xoffset,yoffset:this.yoffset})}hash(){var e;return`${super.hash()}.${this.color&&this.color.hash()}.${this.path}.${this.style}.${(e=this.outline)==null?void 0:e.hash()}`}};v([M()],wl.prototype,"color",void 0),v([ui("color")],wl.prototype,"writeColor",null),v([Gt({esriSMS:"simple-marker"},{readOnly:!0})],wl.prototype,"type",void 0),v([M()],wl.prototype,"size",void 0),v([M({type:XS.apiValues,json:{read:XS.read,write:XS.write}})],wl.prototype,"style",void 0),v([M({type:String,json:{write:!0}})],wl.prototype,"path",null),v([M({types:{key:"type",base:null,defaultKeyValue:"simple-line",typeMap:{"simple-line":Ym}},json:{default:null,write:!0}})],wl.prototype,"outline",void 0),wl=qM=v([fe("esri.symbols.SimpleMarkerSymbol")],wl);const z3=wl;var HM;let pr=HM=class extends Mo{constructor(...e){super(...e),this.backgroundColor=null,this.borderLineColor=null,this.borderLineSize=null,this.font=new Wx,this.horizontalAlignment="center",this.kerning=!0,this.haloColor=null,this.haloSize=null,this.rightToLeft=null,this.rotated=!1,this.text="",this.type="text",this.verticalAlignment="baseline",this.xoffset=0,this.yoffset=0,this.angle=0,this.width=null,this.lineWidth=192,this.lineHeight=1}normalizeCtorArgs(e,t,i){if(e&&typeof e!="string")return e;const r={};return e&&(r.text=e),t&&(r.font=t),i&&(r.color=i),r}writeLineWidth(e,t,i,r){r&&typeof r!="string"?r.origin:t[i]=e}castLineWidth(e){return xr(e)}writeLineHeight(e,t,i,r){r&&typeof r!="string"?r.origin:t[i]=e}clone(){return new HM({angle:this.angle,backgroundColor:He(this.backgroundColor),borderLineColor:He(this.borderLineColor),borderLineSize:this.borderLineSize,color:He(this.color),font:this.font&&this.font.clone(),haloColor:He(this.haloColor),haloSize:this.haloSize,horizontalAlignment:this.horizontalAlignment,kerning:this.kerning,lineHeight:this.lineHeight,lineWidth:this.lineWidth,rightToLeft:this.rightToLeft,rotated:this.rotated,text:this.text,verticalAlignment:this.verticalAlignment,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset})}hash(){var e,t,i;return`${(e=this.backgroundColor)==null?void 0:e.hash()}.${this.borderLineColor}.${this.borderLineSize}.${(t=this.color)==null?void 0:t.hash()}.${this.font&&this.font.hash()}.${(i=this.haloColor)==null?void 0:i.hash()}.${this.haloSize}.${this.horizontalAlignment}.${this.kerning}.${this.rightToLeft}.${this.rotated}.${this.text}.${this.verticalAlignment}.${this.width}.${this.xoffset}.${this.yoffset}.${this.lineHeight}.${this.lineWidth}.${this.angle}`}};v([M({type:zt,json:{write:!0}})],pr.prototype,"backgroundColor",void 0),v([M({type:zt,json:{write:!0}})],pr.prototype,"borderLineColor",void 0),v([M({type:Number,json:{write:!0},cast:xr})],pr.prototype,"borderLineSize",void 0),v([M({type:Wx,json:{write:!0}})],pr.prototype,"font",void 0),v([M({...c8,json:{write:!0}})],pr.prototype,"horizontalAlignment",void 0),v([M({type:Boolean,json:{write:!0}})],pr.prototype,"kerning",void 0),v([M({type:zt,json:{write:!0}})],pr.prototype,"haloColor",void 0),v([M({type:Number,cast:xr,json:{write:!0}})],pr.prototype,"haloSize",void 0),v([M({type:Boolean,json:{write:!0}})],pr.prototype,"rightToLeft",void 0),v([M({type:Boolean,json:{write:!0}})],pr.prototype,"rotated",void 0),v([M({type:String,json:{write:!0}})],pr.prototype,"text",void 0),v([Gt({esriTS:"text"},{readOnly:!0})],pr.prototype,"type",void 0),v([M({...u8,json:{write:!0}})],pr.prototype,"verticalAlignment",void 0),v([M({type:Number,cast:xr,json:{write:!0}})],pr.prototype,"xoffset",void 0),v([M({type:Number,cast:xr,json:{write:!0}})],pr.prototype,"yoffset",void 0),v([M({type:Number,json:{read:e=>e&&-1*e,write:(e,t)=>t.angle=e&&-1*e}})],pr.prototype,"angle",void 0),v([M({type:Number,json:{write:!0}})],pr.prototype,"width",void 0),v([M({type:Number})],pr.prototype,"lineWidth",void 0),v([ui("lineWidth")],pr.prototype,"writeLineWidth",null),v([Rs("lineWidth")],pr.prototype,"castLineWidth",null),v([M(l8)],pr.prototype,"lineHeight",void 0),v([ui("lineHeight")],pr.prototype,"writeLineHeight",null),pr=HM=v([fe("esri.symbols.TextSymbol")],pr);const Zx=pr;var WM;let $a=WM=class extends Mo{constructor(e){super(e),this.color=null,this.styleName=null,this.portal=null,this.styleUrl=null,this.thumbnail=null,this.name=null,this.type="web-style"}get _fetchCacheKey(){const e=this.portal!=null?this.portal:Za.getDefault(),t=e.user?e.user.username:null;return`${this.styleName}:${this.styleUrl}:${this.name}:${t}:${e.url}`}read(e,t){this.portal=t==null?void 0:t.portal,super.read(e,t)}clone(){return new WM({name:this.name,styleUrl:this.styleUrl,styleName:this.styleName,portal:this.portal})}fetchSymbol(e){return this._fetchSymbol("webRef",e)}fetchCIMSymbol(e){return this._fetchSymbol("cimRef",e)}async _fetchSymbol(e,t){const i=t!=null?t.cache:null,r=i?this._fetchCacheKey:null;if(i!=null){const o=r&&i.get(r);if(o)return o.clone()}const{resolveWebStyleSymbol:s}=await ht(()=>import("./webStyleSymbolUtils--Y3TqgZl.js"),__vite__mapDeps([160,161,124,125]));mr(t);const n=s(this,{portal:this.portal},e,t);n.catch(o=>{_t.getLogger(this).error("#fetchSymbol()","Failed to create symbol from style",o)});const c=await n;return e==="webRef"&&c.type==="point-3d"||e==="cimRef"&&c.type==="cim"?(i!=null&&i.set(r,c.clone()),c):null}};v([M({json:{write:!1}})],$a.prototype,"color",void 0),v([M({type:String,json:{write:!0}})],$a.prototype,"styleName",void 0),v([M({type:Za,json:{write:!1}})],$a.prototype,"portal",void 0),v([M({type:String,json:{read:RA,write:xp}})],$a.prototype,"styleUrl",void 0),v([M({type:C0,json:{read:!1}})],$a.prototype,"thumbnail",void 0),v([M({type:String,json:{write:!0}})],$a.prototype,"name",void 0),v([Gt({styleSymbolReference:"web-style"},{readOnly:!0})],$a.prototype,"type",void 0),v([M()],$a.prototype,"_fetchCacheKey",null),$a=WM=v([fe("esri.symbols.WebStyleSymbol")],$a);const Yx=$a;function U_e(e){if(!e)return!1;switch(e.type){case"picture-fill":case"picture-marker":case"simple-fill":case"simple-line":case"simple-marker":case"text":case"cim":return!0;default:return!1}}function j_e(e){if(!e)return!1;switch(e.type){case"label-3d":case"line-3d":case"mesh-3d":case"point-3d":case"polygon-3d":return!0;default:return!1}}const F3={base:Mo,key:"type",typeMap:{"simple-fill":A8,"picture-fill":E8,"picture-marker":L3,"simple-line":Ym,"simple-marker":z3,text:Zx,"label-3d":k3,"line-3d":R3,"mesh-3d":O3,"point-3d":D3,"polygon-3d":N3,"web-style":Yx,cim:Hx},errorContext:"symbol"},V_e={base:Mo,key:"type",typeMap:{"picture-marker":L3,"simple-marker":z3,text:Zx,"web-style":Yx,cim:Hx},errorContext:"symbol"},G_e=aA({types:F3}),q_e={base:Mo,key:"type",typeMap:{"simple-fill":A8,"picture-fill":E8,"picture-marker":L3,"simple-line":Ym,"simple-marker":z3,text:Zx,"line-3d":R3,"mesh-3d":O3,"point-3d":D3,"polygon-3d":N3,"web-style":Yx,cim:Hx},errorContext:"symbol"},H_e={base:Mo,key:"type",typeMap:{text:Zx,"label-3d":k3},errorContext:"symbol"},W_e={base:Mo,key:"type",typeMap:{"line-3d":R3,"mesh-3d":O3,"point-3d":D3,"polygon-3d":N3,"web-style":Yx,cim:Hx},errorContext:"symbol"},Z_e={base:Mo,key:"type",typeMap:{"label-3d":k3},errorContext:"symbol"},Y_e=Uc(F3);var ZM;function xse(e){if(!e)return null;const t={};for(const i in e){const r=km(e[i]);r&&(t[i]=r)}return Object.keys(t).length!==0?t:null}function Sse(e){if(e==null)return null;const t={};for(const i in e){const r=e[i];r&&(t[i]=r.toJSON())}return Object.keys(t).length!==0?t:null}let An=ZM=class extends jl(At){constructor(...e){super(...e),this.isAggregate=!1,this.layer=null,this.origin=null,this.popupTemplate=null,this.sourceLayer=null,Object.defineProperty(this,"uid",{value:p0(),configurable:!0})}normalizeCtorArgs(e,t,i,r){return e&&!e.declaredClass?e:{geometry:e,symbol:t,attributes:i,popupTemplate:r}}set aggregateGeometries(e){const t=this._get("aggregateGeometries");JSON.stringify(t)!==JSON.stringify(e)&&this._set("aggregateGeometries",e)}set attributes(e){const t=this._get("attributes");t!==e&&(this._set("attributes",e),this._notifyLayer("attributes",t,e))}set geometry(e){const t=this._get("geometry");t!==e&&(this._set("geometry",e),this._notifyLayer("geometry",t,e))}set symbol(e){const t=this._get("symbol");t!==e&&(this._set("symbol",e),this._notifyLayer("symbol",t,e))}set visible(e){const t=this._get("visible");t!==e&&(this._set("visible",e),this._notifyLayer("visible",t,e))}cloneShallow(){return new ZM({aggregateGeometries:this.aggregateGeometries,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible,origin:this.origin})}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=this.origin&&"layer"in this.origin?this.origin.layer:null;for(const i of[t,this.sourceLayer,this.layer])if(i){if("popupTemplate"in i&&i.popupTemplate)return i.popupTemplate;if(e&&"defaultPopupTemplate"in i&&i.defaultPopupTemplate!=null)return i.defaultPopupTemplate}return null}getAttribute(e){var t;return(t=this.attributes)==null?void 0:t[e]}setAttribute(e,t){if(this.attributes){const i=this.getAttribute(e);this.attributes[e]=t,this._notifyLayer("attributes",i,t,e)}else this.attributes={[e]:t},this._notifyLayer("attributes",void 0,t,e)}getObjectId(){return this.sourceLayer&&"objectIdField"in this.sourceLayer&&this.sourceLayer.objectIdField?this.getAttribute(this.sourceLayer.objectIdField):null}toJSON(){var e;return{aggregateGeometries:Sse(this.aggregateGeometries),geometry:this.geometry!=null?this.geometry.toJSON():null,symbol:this.symbol!=null?this.symbol.toJSON():null,attributes:ZT(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:((e=this.popupTemplate)==null?void 0:e.toJSON())??null}}notifyGeometryChanged(){this._notifyLayer("geometry",this.geometry,this.geometry)}notifyMeshTransformChanged(e={}){const{geometry:t}=this;if((t==null?void 0:t.type)==="mesh"){const i={origin:t.origin,transform:t.transform};this._notifyLayer("origin-transform",i,i,e.action)}}_notifyLayer(e,t,i,r){if(!this.layer||!("graphicChanged"in this.layer))return;const s={graphic:this,property:e,oldValue:t,newValue:i};e==="origin-transform"&&(s.action=r),e==="attributes"&&(s.attributeName=r),this.layer.graphicChanged(s)}};v([M({value:null,json:{read:xse}})],An.prototype,"aggregateGeometries",null),v([M({value:null})],An.prototype,"attributes",null),v([M({value:null,types:Cx,json:{read:km}})],An.prototype,"geometry",null),v([M({type:Boolean})],An.prototype,"isAggregate",void 0),v([M({clonable:"reference"})],An.prototype,"layer",void 0),v([M({clonable:"reference"})],An.prototype,"origin",void 0),v([M({type:Dre})],An.prototype,"popupTemplate",void 0),v([M({clonable:"reference"})],An.prototype,"sourceLayer",void 0),v([M({value:null,types:F3})],An.prototype,"symbol",null),v([M({type:Boolean,value:!0})],An.prototype,"visible",null),An=ZM=v([fe("esri.Graphic")],An),function(e){e.generateUID=p0}(An||(An={}));const YM=An;let $0=class extends T0{_own(t){t.layer&&"remove"in t.layer&&t.layer!==this.owner&&t.layer.remove(t),t.layer=this.owner}_release(t){t.layer===this.owner&&(t.layer=null)}};v([W4({Type:YM,ensureType:Fn(YM)})],$0.prototype,"itemType",void 0),$0=v([fe("esri.support.GraphicsCollection")],$0);let Bu=class extends Nt{constructor(t){super(t),this.view=null,this.baseLayerViews=new Bt,this.referenceLayerViews=new Bt,this._loadingHandle=ti(()=>{var i,r;return(r=(i=this.view)==null?void 0:i.map)==null?void 0:r.basemap},i=>{i&&i.load().catch(()=>{})},_n)}destroy(){this._set("view",null),this._loadingHandle&&(this._loadingHandle.remove(),this._loadingHandle=null);for(const t of this.baseLayerViews)t.destroy();this.baseLayerViews.length=0;for(const t of this.referenceLayerViews)t.destroy();this.referenceLayerViews.length=0}get suspended(){return!this.view||this.view.suspended}get updating(){var i,r;if(this.view&&this.view.suspended)return!1;const t=(r=(i=this.view)==null?void 0:i.map)==null?void 0:r.basemap;return!!t&&!!t.loaded&&(this.baseLayerViews.some(s=>s.updating)||this.referenceLayerViews.some(s=>s.updating))}};v([M({constructOnly:!0})],Bu.prototype,"view",void 0),v([M({readOnly:!0})],Bu.prototype,"baseLayerViews",void 0),v([M({readOnly:!0})],Bu.prototype,"referenceLayerViews",void 0),v([M({readOnly:!0})],Bu.prototype,"suspended",null),v([M({type:Boolean,readOnly:!0})],Bu.prototype,"updating",null),Bu=v([fe("esri.views.BasemapView")],Bu);function Tse(e){return"tryRecycleWith"in e}let Ese=class{constructor(t,i,r){this.layer=t,this.view=i,this.layerViewImporter=r,this._controller=new AbortController,this._deferred=sa(),this._started=!1,this.done=!1,this.promise=this._deferred.promise,io(this._controller.signal,()=>{const s=new Je("cancelled:layerview-create","layerview creation cancelled",{layer:t});this._deferred.reject(s)})}tryRecycle(t){if(!this.done||!this.layerView||!Tse(this.layerView))return null;const i=this.layer.type,r=this._controller.signal;for(let s=0;s(mr(this._controller.signal),n.emit("layerview-destroy",{view:f,layerView:o}),f.emit("layerview-destroy",{view:f,layerView:o}),n.emit("layerview-create",{view:f,layerView:o}),f.emit("layerview-create",{view:f,layerView:o}),o)),new Promise((g,S)=>io(this._controller.signal,()=>S(jr())))]),this.promise}}return null}destroy(){this._controller.abort();const{layerView:t}=this;if(t){const{layer:i,view:r}=this;i.emit("layerview-destroy",{view:r,layerView:t}),r.emit("layerview-destroy",{layer:i,layerView:t})}this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null,this._map=null}async start(){var s,n;if(this._started)return;this._started=!0;const{_controller:{signal:t},layer:i,view:r}=this;this._map=r.map;try{let c,o;if(await i.load({signal:t}),i.prefetchResources&&await i.prefetchResources({signal:t}),Ise(i))c=await i.createLayerView(r,{signal:t});else{if(!this.layerViewImporter.hasLayerViewModule(i))throw new Je("layer:view-not-supported","No layerview implementation was found");const S=await this.layerViewImporter.importLayerView(i);mr(t),c="default"in S?new S.default({layer:i,view:r}):new S({layer:i,view:r})}const f=()=>{o=Sr(o),c.destroyed||c.destroy(),c.layer=null,c.parent=null,c.view=null,this.done=!0};o=io(t,f),mr(t);try{await c.when()}catch(S){throw f(),S}if(!((n=(s=this._map)==null?void 0:s.allLayers)==null?void 0:n.includes(i)))return f(),void this._deferred.reject(new Je("view:no-layerview-for-layer","The layer has been removed from the map",{layer:i}));this.layerView=c,i.emit("layerview-create",{view:r,layerView:c}),r.emit("layerview-create",{layer:i,layerView:c}),this.done=!0,this._deferred.resolve(c)}catch(c){i.emit("layerview-create-error",{view:r,error:c}),r.emit("layerview-create-error",{layer:i,error:c}),this.done=!0,this._deferred.reject(new Je("layerview:create-error","layerview creation failed",{layer:i,error:c}))}}},Wo=class extends Nt{constructor(t){super(t),this._layerLayerViewInfoMap=new Map,this._recyclingInfoMap=new Map,this._watchUpdatingTracking=new cp,this.supportsGround=!0,this._preloadLayerViewModules=()=>{var r;const i=(r=this.view.map)==null?void 0:r.allLayers;if(i)for(const s of i)this.layerViewImporter.hasLayerViewModule(s)&&this.layerViewImporter.importLayerView(s)},this._reschedule=()=>this.destroyed?Promise.reject():(this._workPromise==null&&(this._workPromise=sa(),this._workPromise.promise.catch(()=>{})),this.removeHandles("reschedule"),this.addHandles(m_(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{var f,g,S;if(this.destroyed)return;const i=this.view.map;if(this._map!==i&&(this.clear(),this._map=i),this._workPromise==null)return void this.notifyChange("updating");this.removeHandles("reschedule"),this.removeHandles("collection-change");const r=new Set,s=[],n=this.view.ready,c=I=>{if(I!=null){for(const A of I)if(A){r.add(A);const O=this._layerLayerViewInfoMap.get(A);O&&n?O.start():O||this._recyclingInfoMap.has(A)||s.push(A),"layers"in A&&A.layers&&c(A.layers)}}};for(const I of this._rootCollectionNames)c(Va(this,I));for(const[I,A]of this._layerLayerViewInfoMap)if(!r.has(I)){this._layerLayerViewInfoMap.delete(A.layer);const O=A.tryRecycle(s);O?(this.notifyChange("updating"),this._recyclingInfoMap.set(A.layer,A),O.then(()=>{this.notifyChange("updating"),this._recyclingInfoMap.delete(A.layer),this._layerLayerViewInfoMap.set(A.layer,A),this._reschedule()}).catch(()=>{this.notifyChange("updating"),this._recyclingInfoMap.delete(A.layer),A.destroy(),this._reschedule()})):A.destroy()}for(const[I,A]of this._recyclingInfoMap)r.has(I)||(this.notifyChange("updating"),this._recyclingInfoMap.delete(A.layer),A.destroy());for(const I of s)this._createLayerView(I);this._refreshCollections();const o=[(f=i==null?void 0:i.ground)==null?void 0:f.layers,(g=i==null?void 0:i.basemap)==null?void 0:g.baseLayers,(S=i==null?void 0:i.basemap)==null?void 0:S.referenceLayers,i==null?void 0:i.layers].filter(I=>!!I);r.forEach(I=>"layers"in I&&o.push(I.layers)),this.addHandles(o.map(I=>this._watchUpdatingTracking.addOnCollectionChange(()=>I,this._reschedule)),"collection-change"),this._workPromise.resolve(),this._workPromise=null}}initialize(){this.addHandles([Sp(()=>{var t,i;return(i=(t=this.view)==null?void 0:t.map)==null?void 0:i.allLayers},"change",this._preloadLayerViewModules,{onListenerAdd:this._preloadLayerViewModules}),ti(()=>{const t=this.view,i=t==null?void 0:t.map;return[i==null?void 0:i.basemap,i==null?void 0:i.ground,i==null?void 0:i.layers,t==null?void 0:t.ready]},()=>this._reschedule(),Fa)]),this._preloadLayerViewModules(),this._reschedule()}destroy(){this.clear(),$S(this._recyclingInfoMap),$S(this._layerLayerViewInfoMap),this._watchUpdatingTracking.destroy(),this._map=null,this._workPromise!=null&&(this._workPromise.reject(jr()),this._workPromise=null)}get _layersToLayerViews(){const t=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.layers","view.layerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"]];return this.supportsGround&&t.push(["view.map.ground.layers","view.groundView.layerViews"]),new Map(t)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return this._workPromise!=null||this._watchUpdatingTracking.updating||dx(this._layerLayerViewInfoMap,t=>!t.done)||this._recyclingInfoMap.size>0}get updatingRemaining(){let t=0;for(const i of this._layerLayerViewInfoMap.values())i.done||++t;return t}clear(){this.destroyed||($S(this._layerLayerViewInfoMap),this._refreshCollections())}async whenLayerView(t){if(await this._reschedule(),!this._layerLayerViewInfoMap.has(t)){if(this._recyclingInfoMap.has(t))return this._recyclingInfoMap.get(t).promise;throw new Je("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:t})}return this._layerLayerViewInfoMap.get(t).promise}_refreshCollections(){for(const[t,i]of this._layersToLayerViews)this._populateLayerViewsOwners(Va(this,t),Va(this,i),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining")}_populateLayerViewsOwners(t,i,r){if(!t||!i)return void(i&&i.removeAll());let s=0;for(const n of t){const c=this._layerLayerViewInfoMap.get(n);if(!(c!=null&&c.layerView))continue;const o=c.layerView;o.layer=n,o.parent=r,i.at(s)!==o&&i.splice(s,0,o),n.layers&&this._populateLayerViewsOwners(n.layers,o.layerViews,o),s+=1}s{}),this.layerViewImporter.hasLayerViewModule(t)&&this.layerViewImporter.importLayerView(t);const i=new Ese(t,this.view,this.layerViewImporter);i.promise.then(()=>this._refreshCollections(),r=>{r&&(Ys(r)||r.name==="cancelled:layerview-create")||_t.getLogger(this).error(`Failed to create layerview for layer title:'${t.title??"no title"}', id:'${t.id??"no id"}' of type '${t.type}'.`,{layer:t,error:r}),this._refreshCollections()}),this._layerLayerViewInfoMap.set(t,i),this.view.ready&&i.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining")}};v([M()],Wo.prototype,"_workPromise",void 0),v([M({readOnly:!0})],Wo.prototype,"_watchUpdatingTracking",void 0),v([M({readOnly:!0})],Wo.prototype,"_layersToLayerViews",null),v([M({readOnly:!0})],Wo.prototype,"_rootCollectionNames",null),v([M()],Wo.prototype,"layerViewImporter",void 0),v([M()],Wo.prototype,"supportsGround",void 0),v([M({readOnly:!0})],Wo.prototype,"updating",null),v([M({readOnly:!0})],Wo.prototype,"updatingRemaining",null),v([M({constructOnly:!0})],Wo.prototype,"view",void 0),Wo=v([fe("esri.views.LayerViewManager")],Wo);const Mse=Wo;function Ise(e){return"createLayerView"in e&&e.createLayerView!=null}let go=class extends Nt{constructor(t){super(t),this.factor=1.5,this.offset=Dn(0,0),this.position=null,this.size=120,this.maskUrl=null,this.maskEnabled=!0,this.overlayUrl=null,this.overlayEnabled=!0,this.visible=!0}get version(){return this.commitProperty("factor"),this.commitProperty("offset"),this.commitProperty("position"),this.commitProperty("visible"),this.commitProperty("size"),this.commitProperty("maskUrl"),this.commitProperty("maskEnabled"),this.commitProperty("overlayUrl"),this.commitProperty("overlayEnabled"),(this._get("version")||0)+1}};v([M({type:Number})],go.prototype,"factor",void 0),v([M({nonNullable:!0})],go.prototype,"offset",void 0),v([M()],go.prototype,"position",void 0),v([M({type:Number,range:{min:0}})],go.prototype,"size",void 0),v([M()],go.prototype,"maskUrl",void 0),v([M()],go.prototype,"maskEnabled",void 0),v([M()],go.prototype,"overlayUrl",void 0),v([M()],go.prototype,"overlayEnabled",void 0),v([M({readOnly:!0})],go.prototype,"version",null),v([M({type:Boolean})],go.prototype,"visible",void 0),go=v([fe("esri.views.Magnifier")],go);const P8=go;let Sb=class{constructor(t){this._observable=new g_,this._map=new Map(t)}get size(){return Rt(this._observable),this._map.size}clear(){this._map.size>0&&(this._map.clear(),this._observable.notify())}delete(t){const i=this._map.delete(t);return i&&this._observable.notify(),i}entries(){return Rt(this._observable),this._map.entries()}forEach(t,i){Rt(this._observable),this._map.forEach((r,s)=>t.call(i,r,s,this),i)}get(t){return Rt(this._observable),this._map.get(t)}has(t){return Rt(this._observable),this._map.has(t)}keys(){return Rt(this._observable),this._map.keys()}set(t,i){return this._map.set(t,i),this._observable.notify(),this}values(){return Rt(this._observable),this._map.values()}[Symbol.iterator](){return Rt(this._observable),this._map[Symbol.iterator]()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}};var JM;let Xg=JM=class extends At{constructor(e){super(e),this.name=null,this.code=null}clone(){return new JM({name:this.name,code:this.code})}};v([M({type:String,json:{write:!0}})],Xg.prototype,"name",void 0),v([M({type:[String,Number],json:{write:!0}})],Xg.prototype,"code",void 0),Xg=JM=v([fe("esri.layers.support.CodedValue")],Xg);const Ase=new ks({inherited:"inherited",codedValue:"coded-value",range:"range"});let Qg=class extends At{constructor(t){super(t),this.name=null,this.type=null}};v([M({type:String,json:{write:!0}})],Qg.prototype,"name",void 0),v([Gt(Ase)],Qg.prototype,"type",void 0),Qg=v([fe("esri.layers.support.Domain")],Qg);const Jx=Qg;var KM;let e0=KM=class extends Jx{constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const i=String(e);this.codedValues.some(r=>(String(r.code)===i&&(t=r.name),!!t))}return t}clone(){return new KM({codedValues:He(this.codedValues),name:this.name})}};v([M({type:[Xg],json:{write:!0}})],e0.prototype,"codedValues",void 0),v([Gt({codedValue:"coded-value"})],e0.prototype,"type",void 0),e0=KM=v([fe("esri.layers.support.CodedValueDomain")],e0);const C8=e0;var XM;let Tb=XM=class extends Jx{constructor(e){super(e),this.type="inherited"}clone(){return new XM}};v([Gt({inherited:"inherited"})],Tb.prototype,"type",void 0),Tb=XM=v([fe("esri.layers.support.InheritedDomain")],Tb);const $8=Tb;var QM;let Vf=QM=class extends Jx{constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new QM({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};v([M({json:{type:[Number],read:{source:"range",reader:(e,t)=>{var i;return(i=t.range)==null?void 0:i[1]}},write:{enabled:!1,overridePolicy(){return{enabled:this.maxValue!=null&&this.minValue==null}},target:"range",writer(e,t,i){t[i]=[this.minValue||0,e]}}}})],Vf.prototype,"maxValue",void 0),v([M({json:{type:[Number],read:{source:"range",reader:(e,t)=>{var i;return(i=t.range)==null?void 0:i[0]}},write:{target:"range",writer(e,t,i){t[i]=[e,this.maxValue||0]}}}})],Vf.prototype,"minValue",void 0),v([Gt({range:"range"})],Vf.prototype,"type",void 0),Vf=QM=v([fe("esri.layers.support.RangeDomain")],Vf);const k8=Vf,Pse={key:"type",base:Jx,typeMap:{range:k8,"coded-value":C8,inherited:$8}};function Cse(e){if(!(e!=null&&e.type))return null;switch(e.type){case"range":return k8.fromJSON(e);case"codedValue":return C8.fromJSON(e);case"inherited":return $8.fromJSON(e)}return null}const $se=new ks({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"});var eI;const kse=new ks({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let dn=eI=class extends At{constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let i=null;try{i=t?JSON.parse(t):null}catch{}return(i==null?void 0:i.value)??null}readValueType(e,{description:t}){let i=null;try{i=t?JSON.parse(t):null}catch{}return i?kse.fromJSON(i.fieldValueType):null}clone(){var e;return new eI({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:((e=this.domain)==null?void 0:e.clone())??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};v([M({type:String,json:{write:!0}})],dn.prototype,"alias",void 0),v([M({type:[String,Number],json:{write:{allowNull:!0}}})],dn.prototype,"defaultValue",void 0),v([M()],dn.prototype,"description",void 0),v([mi("description")],dn.prototype,"readDescription",null),v([M({types:Pse,json:{read:{reader:Cse},write:!0}})],dn.prototype,"domain",void 0),v([M({type:Boolean,json:{write:!0}})],dn.prototype,"editable",void 0),v([M({type:$r,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],dn.prototype,"length",void 0),v([M({type:String,json:{write:!0}})],dn.prototype,"name",void 0),v([M({type:Boolean,json:{write:!0}})],dn.prototype,"nullable",void 0),v([Gt($se)],dn.prototype,"type",void 0),v([M()],dn.prototype,"valueType",void 0),v([mi("valueType",["description"])],dn.prototype,"readValueType",null),v([M({type:Boolean,json:{read:!1}})],dn.prototype,"visible",void 0),dn=eI=v([fe("esri.layers.support.Field")],dn);const Rse=dn;var tI;let Gf=tI=class extends At{constructor(e){super(e),this.type="map-layer"}clone(){const{mapLayerId:e,gdbVersion:t}=this;return new tI({mapLayerId:e,gdbVersion:t})}};v([Gt({mapLayer:"map-layer"})],Gf.prototype,"type",void 0),v([M({type:$r,json:{write:!0}})],Gf.prototype,"mapLayerId",void 0),v([M({type:String,json:{write:!0}})],Gf.prototype,"gdbVersion",void 0),Gf=tI=v([fe("esri.layers.support.source.MapLayerSource")],Gf);var iI;let Ec=iI=class extends At{constructor(e){super(e),this.type="query-table"}clone(){const{workspaceId:e,query:t,oidFields:i,spatialReference:r,geometryType:s}=this,n={workspaceId:e,query:t,oidFields:i,spatialReference:(r==null?void 0:r.clone())??void 0,geometryType:s};return new iI(n)}};v([Gt({queryTable:"query-table"})],Ec.prototype,"type",void 0),v([M({type:String,json:{write:!0}})],Ec.prototype,"workspaceId",void 0),v([M({type:String,json:{write:!0}})],Ec.prototype,"query",void 0),v([M({type:String,json:{write:!0}})],Ec.prototype,"oidFields",void 0),v([M({type:yi,json:{write:!0}})],Ec.prototype,"spatialReference",void 0),v([Gt(fK)],Ec.prototype,"geometryType",void 0),Ec=iI=v([fe("esri.layers.support.source.QueryTableDataSource")],Ec);var rI;let qf=rI=class extends At{constructor(e){super(e),this.type="raster"}clone(){const{workspaceId:e,dataSourceName:t}=this;return new rI({workspaceId:e,dataSourceName:t})}};v([Gt({raster:"raster"})],qf.prototype,"type",void 0),v([M({type:String,json:{write:!0}})],qf.prototype,"dataSourceName",void 0),v([M({type:String,json:{write:!0}})],qf.prototype,"workspaceId",void 0),qf=rI=v([fe("esri.layers.support.source.RasterDataSource")],qf);var sI;let Ad=sI=class extends At{constructor(e){super(e),this.type="table"}clone(){const{workspaceId:e,gdbVersion:t,dataSourceName:i}=this;return new sI({workspaceId:e,gdbVersion:t,dataSourceName:i})}};v([Gt({table:"table"})],Ad.prototype,"type",void 0),v([M({type:String,json:{write:!0}})],Ad.prototype,"workspaceId",void 0),v([M({type:String,json:{write:!0}})],Ad.prototype,"gdbVersion",void 0),v([M({type:String,json:{write:!0}})],Ad.prototype,"dataSourceName",void 0),Ad=sI=v([fe("esri.layers.support.source.TableDataSource")],Ad);var nI,oI;const Ose=Bn()({esriLeftInnerJoin:"left-inner-join",esriLeftOuterJoin:"left-outer-join"});let _o=nI=class extends At{constructor(e){super(e),this.type="join-table"}readLeftTableSource(e,t,i){return IR()(e,t,i)}castLeftTableSource(e){return Uc(aI(),e)}readRightTableSource(e,t,i){return IR()(e,t,i)}castRightTableSource(e){return Uc(aI(),e)}clone(){const{leftTableKey:e,rightTableKey:t,leftTableSource:i,rightTableSource:r,joinType:s}=this,n={leftTableKey:e,rightTableKey:t,leftTableSource:(i==null?void 0:i.clone())??void 0,rightTableSource:(r==null?void 0:r.clone())??void 0,joinType:s};return new nI(n)}};v([Gt({joinTable:"join-table"})],_o.prototype,"type",void 0),v([M({type:String,json:{write:!0}})],_o.prototype,"leftTableKey",void 0),v([M({type:String,json:{write:!0}})],_o.prototype,"rightTableKey",void 0),v([M({json:{write:!0}})],_o.prototype,"leftTableSource",void 0),v([mi("leftTableSource")],_o.prototype,"readLeftTableSource",null),v([Rs("leftTableSource")],_o.prototype,"castLeftTableSource",null),v([M({json:{write:!0}})],_o.prototype,"rightTableSource",void 0),v([mi("rightTableSource")],_o.prototype,"readRightTableSource",null),v([Rs("rightTableSource")],_o.prototype,"castRightTableSource",null),v([Gt(Ose)],_o.prototype,"joinType",void 0),_o=nI=v([fe("esri.layers.support.source.JoinTableDataSource")],_o);let QS=null;function IR(){return QS||(QS=aA({types:aI()})),QS}let eT=null;function aI(){return eT||(eT={key:"type",base:null,typeMap:{"data-layer":Pc,"map-layer":Gf}}),eT}const Lse={key:"type",base:null,typeMap:{"join-table":_o,"query-table":Ec,raster:qf,table:Ad}};let Pc=oI=class extends At{constructor(e){super(e),this.type="data-layer"}clone(){const{fields:e,dataSource:t}=this;return new oI({fields:e,dataSource:t})}};v([Gt({dataLayer:"data-layer"})],Pc.prototype,"type",void 0),v([M({type:[Rse],json:{write:!0}})],Pc.prototype,"fields",void 0),v([M({types:Lse,json:{write:!0}})],Pc.prototype,"dataSource",void 0),Pc=oI=v([fe("esri.layers.support.source.DataLayerSource")],Pc),Pc.from=Fn(Pc);let Pd=class extends jl(At){constructor(t){super(t),this.onFields=null,this.operator=null,this.searchTerm=null,this.searchType=null}};v([M({type:[String],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.onFields!=null&&this.onFields.length>0}}}}})],Pd.prototype,"onFields",void 0),v([M({type:String,json:{write:!0}})],Pd.prototype,"operator",void 0),v([M({type:String,json:{write:!0}})],Pd.prototype,"searchTerm",void 0),v([M({type:String,json:{write:!0}})],Pd.prototype,"searchType",void 0),Pd=v([fe("esri.rest.support.FullTextSearch")],Pd);const Dse=Pd;var lI;const AR=new ks({upperLeft:"upper-left",lowerLeft:"lower-left"});let Cd=lI=class extends At{constructor(e){super(e),this.extent=null,this.mode="view",this.originPosition="upper-left",this.tolerance=1}clone(){return new lI(He({extent:this.extent,mode:this.mode,originPosition:this.originPosition,tolerance:this.tolerance}))}};v([M({type:Ui,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],Cd.prototype,"extent",void 0),v([M({type:["view","edit"],json:{write:!0}})],Cd.prototype,"mode",void 0),v([M({type:String,json:{read:AR.read,write:AR.write}})],Cd.prototype,"originPosition",void 0),v([M({type:Number,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],Cd.prototype,"tolerance",void 0),Cd=lI=v([fe("esri.rest.support.QuantizationParameters")],Cd);const R8=Cd,Nse=new ks({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"});var cI;const PR=new ks({count:"count",sum:"sum",min:"min",max:"max",avg:"avg",stddev:"stddev",var:"var",exceedslimit:"exceedslimit",percentile_cont:"percentile-continuous",percentile_disc:"percentile-discrete",EnvelopeAggregate:"envelope-aggregate",CentroidAggregate:"centroid-aggregate",ConvexHullAggregate:"convex-hull-aggregate"});let ka=cI=class extends At{constructor(e){super(e),this.maxPointCount=void 0,this.maxRecordCount=void 0,this.maxVertexCount=void 0,this.onStatisticField=null,this.outStatisticFieldName=null,this.statisticType=null,this.statisticParameters=null}writeStatisticParameters(e,t){this.statisticType!=="percentile-continuous"&&this.statisticType!=="percentile-discrete"||(t.statisticParameters=He(e))}clone(){return new cI({maxPointCount:this.maxPointCount,maxRecordCount:this.maxRecordCount,maxVertexCount:this.maxVertexCount,onStatisticField:this.onStatisticField,outStatisticFieldName:this.outStatisticFieldName,statisticType:this.statisticType,statisticParameters:He(this.statisticParameters)})}};v([M({type:Number,json:{write:!0}})],ka.prototype,"maxPointCount",void 0),v([M({type:Number,json:{write:!0}})],ka.prototype,"maxRecordCount",void 0),v([M({type:Number,json:{write:!0}})],ka.prototype,"maxVertexCount",void 0),v([M({type:String,json:{write:!0}})],ka.prototype,"onStatisticField",void 0),v([M({type:String,json:{write:!0}})],ka.prototype,"outStatisticFieldName",void 0),v([M({type:String,json:{read:{source:"statisticType",reader:PR.read},write:{target:"statisticType",writer:PR.write}}})],ka.prototype,"statisticType",void 0),v([M({type:Object})],ka.prototype,"statisticParameters",void 0),v([ui("statisticParameters")],ka.prototype,"writeStatisticParameters",null),ka=cI=v([fe("esri.rest.support.StatisticDefinition")],ka);const zse=ka;var Eb;const Fse=new ks({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let Ot=Eb=class extends At{static from(e){return px(Eb,e)}constructor(e){super(e),this.aggregateIds=null,this.cacheHint=void 0,this.compactGeometryEnabled=!1,this.datumTransformation=null,this.defaultSpatialReferenceEnabled=!1,this.distance=void 0,this.dynamicDataSource=void 0,this.formatOf3DObjects=null,this.fullText=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=void 0,this.groupByFieldsForStatistics=null,this.having=null,this.historicMoment=null,this.maxAllowableOffset=void 0,this.maxRecordCountFactor=1,this.multipatchOption=null,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.outStatistics=null,this.parameterValues=null,this.pixelSize=null,this.quantizationParameters=null,this.rangeValues=null,this.relationParameter=null,this.resultType=null,this.returnCentroid=!1,this.returnDistinctValues=!1,this.returnExceededLimitFeatures=!0,this.returnGeometry=!1,this.returnQueryGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.sourceSpatialReference=null,this.spatialRelationship="intersects",this.start=void 0,this.sqlFormat=null,this.text=null,this.timeExtent=null,this.timeReferenceUnknownClient=!1,this.units=null,this.where=null}castDatumTransformation(e){return typeof e=="number"||typeof e=="object"?e:null}writeHistoricMoment(e,t){t.historicMoment=e&&e.getTime()}writeParameterValues(e,t){if(e){const i={};for(const r in e){const s=e[r];Array.isArray(s)?i[r]=s.map(n=>n instanceof Date?n.getTime():n):s instanceof Date?i[r]=s.getTime():i[r]=s}t.parameterValues=i}}writeStart(e,t){t.resultOffset=this.start,t.resultRecordCount=this.num||10,t.where="1=1"}writeWhere(e,t){t.where=e||"1=1"}clone(){return new Eb(He({aggregateIds:this.aggregateIds,cacheHint:this.cacheHint,compactGeometryEnabled:this.compactGeometryEnabled,datumTransformation:this.datumTransformation,defaultSpatialReferenceEnabled:this.defaultSpatialReferenceEnabled,distance:this.distance,fullText:this.fullText,formatOf3DObjects:this.formatOf3DObjects,gdbVersion:this.gdbVersion,geometry:this.geometry,geometryPrecision:this.geometryPrecision,groupByFieldsForStatistics:this.groupByFieldsForStatistics,having:this.having,historicMoment:this.historicMoment!=null?new Date(this.historicMoment.getTime()):null,maxAllowableOffset:this.maxAllowableOffset,maxRecordCountFactor:this.maxRecordCountFactor,multipatchOption:this.multipatchOption,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,outStatistics:this.outStatistics,parameterValues:this.parameterValues,pixelSize:this.pixelSize,quantizationParameters:this.quantizationParameters,rangeValues:this.rangeValues,relationParameter:this.relationParameter,resultType:this.resultType,returnDistinctValues:this.returnDistinctValues,returnGeometry:this.returnGeometry,returnCentroid:this.returnCentroid,returnExceededLimitFeatures:this.returnExceededLimitFeatures,returnQueryGeometry:this.returnQueryGeometry,returnM:this.returnM,returnZ:this.returnZ,dynamicDataSource:this.dynamicDataSource,sourceSpatialReference:this.sourceSpatialReference,spatialRelationship:this.spatialRelationship,start:this.start,sqlFormat:this.sqlFormat,text:this.text,timeExtent:this.timeExtent,timeReferenceUnknownClient:this.timeReferenceUnknownClient,units:this.units,where:this.where}))}};Ot.MAX_MAX_RECORD_COUNT_FACTOR=5,v([M({json:{write:!0}})],Ot.prototype,"aggregateIds",void 0),v([M({type:Boolean,json:{write:!0}})],Ot.prototype,"cacheHint",void 0),v([M({type:Boolean,json:{default:!1,write:!0}})],Ot.prototype,"compactGeometryEnabled",void 0),v([M({json:{write:!0}})],Ot.prototype,"datumTransformation",void 0),v([Rs("datumTransformation")],Ot.prototype,"castDatumTransformation",null),v([M({type:Boolean,json:{default:!1,write:!0}})],Ot.prototype,"defaultSpatialReferenceEnabled",void 0),v([M({type:Number,json:{write:{overridePolicy:e=>({enabled:e>0})}}})],Ot.prototype,"distance",void 0),v([M({type:Pc,json:{write:!0}})],Ot.prototype,"dynamicDataSource",void 0),v([M({type:String,json:{write:!0}})],Ot.prototype,"formatOf3DObjects",void 0),v([M({type:[Dse],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.fullText!=null&&this.fullText.length>0}}}}})],Ot.prototype,"fullText",void 0),v([M({type:String,json:{write:!0}})],Ot.prototype,"gdbVersion",void 0),v([M({types:Cx,json:{read:km,write:!0}})],Ot.prototype,"geometry",void 0),v([M({type:Number,json:{write:!0}})],Ot.prototype,"geometryPrecision",void 0),v([M({type:[String],json:{write:!0}})],Ot.prototype,"groupByFieldsForStatistics",void 0),v([M({type:String,json:{write:!0}})],Ot.prototype,"having",void 0),v([M({type:Date})],Ot.prototype,"historicMoment",void 0),v([ui("historicMoment")],Ot.prototype,"writeHistoricMoment",null),v([M({type:Number,json:{write:!0}})],Ot.prototype,"maxAllowableOffset",void 0),v([M({type:Number,cast:e=>e<1?1:e>Ot.MAX_MAX_RECORD_COUNT_FACTOR?Ot.MAX_MAX_RECORD_COUNT_FACTOR:e,json:{write:{overridePolicy:e=>({enabled:e>1})}}})],Ot.prototype,"maxRecordCountFactor",void 0),v([M({type:["xyFootprint"],json:{write:!0}})],Ot.prototype,"multipatchOption",void 0),v([M({type:Number,json:{read:{source:"resultRecordCount"}}})],Ot.prototype,"num",void 0),v([M({json:{write:!0}})],Ot.prototype,"objectIds",void 0),v([M({type:[String],json:{write:!0}})],Ot.prototype,"orderByFields",void 0),v([M({type:[String],json:{write:!0}})],Ot.prototype,"outFields",void 0),v([M({type:yi,json:{name:"outSR",write:!0}})],Ot.prototype,"outSpatialReference",void 0),v([M({type:[zse],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.outStatistics!=null&&this.outStatistics.length>0}}}}})],Ot.prototype,"outStatistics",void 0),v([M({json:{write:!0}})],Ot.prototype,"parameterValues",void 0),v([ui("parameterValues")],Ot.prototype,"writeParameterValues",null),v([M({type:ri,json:{write:!0}})],Ot.prototype,"pixelSize",void 0),v([M({type:R8,json:{write:!0}})],Ot.prototype,"quantizationParameters",void 0),v([M({type:[Object],json:{write:!0}})],Ot.prototype,"rangeValues",void 0),v([M({type:String,json:{read:{source:"relationParam"},write:{target:"relationParam",overridePolicy(){return{enabled:this.spatialRelationship==="relation"}}}}})],Ot.prototype,"relationParameter",void 0),v([M({type:String,json:{write:!0}})],Ot.prototype,"resultType",void 0),v([M({type:Boolean,json:{default:!1,write:!0}})],Ot.prototype,"returnCentroid",void 0),v([M({type:Boolean,json:{default:!1,write:!0}})],Ot.prototype,"returnDistinctValues",void 0),v([M({type:Boolean,json:{default:!0,write:!0}})],Ot.prototype,"returnExceededLimitFeatures",void 0),v([M({type:Boolean,json:{write:!0}})],Ot.prototype,"returnGeometry",void 0),v([M({type:Boolean,json:{default:!1,write:!0}})],Ot.prototype,"returnQueryGeometry",void 0),v([M({type:Boolean,json:{default:!1,write:!0}})],Ot.prototype,"returnM",void 0),v([M({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],Ot.prototype,"returnZ",void 0),v([M({type:yi,json:{write:!0}})],Ot.prototype,"sourceSpatialReference",void 0),v([Gt(Nse,{ignoreUnknown:!1,name:"spatialRel"})],Ot.prototype,"spatialRelationship",void 0),v([M({type:Number,json:{read:{source:"resultOffset"}}})],Ot.prototype,"start",void 0),v([ui("start"),ui("num")],Ot.prototype,"writeStart",null),v([M({type:String,json:{write:!0}})],Ot.prototype,"sqlFormat",void 0),v([M({type:String,json:{write:!0}})],Ot.prototype,"text",void 0),v([M({type:E_,json:{write:!0}})],Ot.prototype,"timeExtent",void 0),v([M({type:Boolean,json:{default:!1,write:!0}})],Ot.prototype,"timeReferenceUnknownClient",void 0),v([Gt(Fse,{ignoreUnknown:!1}),M({json:{write:{overridePolicy(e){return{enabled:!!e&&this.distance!=null&&this.distance>0}}}}})],Ot.prototype,"units",void 0),v([M({type:String,json:{write:{overridePolicy(e){return{enabled:e!=null||this.start!=null&&this.start>0}}}}})],Ot.prototype,"where",void 0),v([ui("where")],Ot.prototype,"writeWhere",null),Ot=Eb=v([fe("esri.rest.support.Query")],Ot);const CR=Ot;let Mc=class extends Sh.EventedAccessor{constructor(t){super(t),this._selectionMap=new Sb,this._trashCan=[],this._layerEditHandles=new Bt,this._vizTaskId=0,this.showHighlight=!0}initialize(){this.addHandles([ti(()=>[this.view,this.showHighlight],()=>this._refreshVisualization()),Sp(()=>this.sources,"change",i=>{const r=this._selectionMap;for(const s of i.removed)r.delete(s);this._refreshListeners(),this._refreshVisualization()},{onListenerAdd:()=>this._refreshListeners()})]);const t=new Bt;this.view.when().then(()=>{this.view.map.allLayers.flatten(i=>"sublayers"in i&&i.sublayers?i.sublayers:null).forEach(i=>{(xv(i)&&!hZ(i)||Tf(i))&&t.add(i)}),this._set("sources",t)})}destroy(){this._layerEditHandles.drain(Sr)}get selections(){return Array.from(this._selectionMap.entries()).map(t=>{const[i,r]=t;return{layer:i,selection:[...r.selection]}})}get count(){let t=0;for(const i of this._selectionMap.values())t+=i.selection.length;return t}get hasSelection(){return this.count>0}get sources(){return this._get("sources")}set sources(t){this._set("sources",t)}async getSelectedFeatures(t,i={},r="layerView"){const{view:s,selections:n}=this,c=(t!==void 0?n.filter(o=>t.includes(o.layer)):n).filter(o=>o.selection.length>0).map(async o=>{const{layer:f,selection:g}=o,S=Tf(f)?f.parent:f;if(S==null||!$R(S))return null;if(r==="layer")return kR(S,g,i);const I=await s.whenLayerView(S);return kR(I,g,i)});return(await Promise.all(c)).filter(o=>o!==null)}updateSelection(t){const i=new Map;for(const[n,c]of this._selectionMap)i.set(n,[...c.selection]);let r=!1;const s=t.current.concat(t.added);for(const n of s){const c=n.sourceLayer,o=n.getObjectId();if(this.sources.includes(c)&&(xv(c)||Tf(c))&&o!==null){const f=nA(i,c,()=>[]);f.includes(o)||(f.push(o),r=!0)}}for(const n of t.removed){const c=n.sourceLayer,o=n.getObjectId();if(this.sources.includes(c)&&(xv(c)||Tf(c))&&o!==null){const f=i.get(c),g=f==null?void 0:f.indexOf(o);g!==void 0&&g>=0&&(f==null||f.splice(g,1),r=!0)}}if(r){const{_selectionMap:n,_trashCan:c}=this,o=[];for(const[f,g]of i){const S=n.get(f);S!==void 0&&c.push(S),n.set(f,{selection:g}),o.push({layer:f,selection:g,...YC(S!==void 0?S.selection:[],g)})}this._onSelectionChange(o)}}setSelection(t,i){this._setSelection(t,i)}getSelection(t){const i=this._selectionMap.get(t);return i==null?void 0:i.selection}appendToSelection(t,i){const r=this._selectionMap.get(t),s=r!==void 0?[...r.selection]:[];for(const n of i)s.includes(n)||s.push(n);this._setSelection(t,s)}removeFromSelection(t,i){const r=this._selectionMap.get(t);if(!r)return;const s=[];for(const n of r.selection)i.includes(n)||s.push(n);this._setSelection(t,s)}toggleInSelection(t,i){const r=this._selectionMap.get(t);if(!r||r.selection.length===0)return void this._setSelection(t,i);const s=new Set(r.selection),n=new Set(i),c=kG(s,n);this._setSelection(t,Array.from(c))}clear(){const t=this._selectionMap.values();this._trashCan.push(...t);const i=[];for(const[r,s]of this._selectionMap.entries())i.push({layer:r,added:[],removed:[...s.selection],selection:[]});this._selectionMap.clear(),this._onSelectionChange(i)}_onSelectionChange(t){this._refreshVisualization(),this.emit("selection-change",{view:this.view,changes:t})}_refreshVisualization(){var c;if(this.view==null||this.sources==null)return;for(this._vizTaskId++;this._trashCan.length>0;){const o=this._trashCan.pop();(c=o==null?void 0:o.highlightHandle)==null||c.remove()}const{sources:t,view:i,_selectionMap:r,showHighlight:s}=this,n=this._vizTaskId;for(const o of t){const f=r.get(o),g=Tf(o)?o.parent:o;g!=null&&$R(g)&&i.whenLayerView(g).then(S=>{var I;(I=f==null?void 0:f.highlightHandle)==null||I.remove(),f!==void 0&&s&&n===this._vizTaskId&&"highlight"in S&&typeof S.highlight=="function"&&f.selection.length>0&&(f.highlightHandle=S.highlight(f.selection,"selection"))})}}_refreshListeners(){this._layerEditHandles.drain(Sr);for(const t of this.sources){const i=Tf(t)?t.parent:t;if(i!=null&&xv(i)){const r=i.on("edits",s=>{this._handleEditChanges(s,t)});this._layerEditHandles.push(r)}}}_handleEditChanges(t,i){if(t.deletedFeatures!==void 0&&t.deletedFeatures.length>0&&this._selectionMap.has(i)){const r=t.deletedFeatures.filter(s=>s.error==null).map(s=>s.objectId).filter(N0);this.removeFromSelection(i,r)}}_setSelection(t,i){if(!this.sources.includes(t))throw new Error(`Cannot set selection on layer ${t.title} because it is not in 'sources'`);const r=this._selectionMap.get(t);if(r===void 0||!Use(r,{selection:i})){r!==void 0&&this._trashCan.push(r),this._selectionMap.set(t,{selection:[...i]});const s={layer:t,selection:[...i],...YC(r!==void 0?r.selection:[],i)};this._onSelectionChange([s])}}};v([M({readOnly:!0,nonNullable:!0})],Mc.prototype,"selections",null),v([M({readOnly:!0,nonNullable:!0})],Mc.prototype,"count",null),v([M({constructOnly:!0,nonNullable:!0})],Mc.prototype,"view",void 0),v([M({readOnly:!0,nonNullable:!0})],Mc.prototype,"hasSelection",null),v([M()],Mc.prototype,"showHighlight",void 0),v([M()],Mc.prototype,"sources",null),Mc=v([fe("esri.views.SelectionManager")],Mc);const xv=e=>e.createQuery!==void 0&&e.on!==void 0,Bse=e=>e.layer!==void 0,$R=e=>(e==null?void 0:e.when)!==void 0,Use=(e,t)=>{if(e==null&&t==null)return!0;if(e!=null&&t==null||e==null&&t!=null)return!1;if(e!=null&&t!=null&&e.selection!=null&&t.selection!=null){const i=[...e.selection],r=[...t.selection];if(i.length!==r.length)return!1;i.sort(),r.sort();for(let s=0;s{let r;if(Bse(e)){const s=e;r=s===void 0?null:await s.queryFeatures(new CR({...i,objectIds:t})).then(n=>({data:n,layer:e.layer}))}else{const s=e;r=s===void 0?null:await s.queryFeatures(new CR({...i,objectIds:t})).then(n=>({data:n,layer:s}))}return r},jse=Mc;let t0=class extends jl(Nt){constructor(t){super(t),this.accentColor=new zt([255,127,0]),this.textColor=new zt([255,255,255])}};v([M({type:zt,nonNullable:!0})],t0.prototype,"accentColor",void 0),v([M({type:zt,nonNullable:!0})],t0.prototype,"textColor",void 0),t0=v([fe("esri.views.Theme")],t0);const uI=t0;var RR;(function(e){e[e.Left=0]="Left",e[e.Middle=1]="Middle",e[e.Right=2]="Right"})(RR||(RR={}));const O8=["click","double-click","immediate-click","immediate-double-click","hold","drag","key-down","key-up","pointer-down","pointer-move","pointer-up","pointer-drag","mouse-wheel","pointer-enter","pointer-leave","gamepad","focus","blur"],L8={};function D8(e){return!!L8[e]}function Vse(e){for(const t of e)if(!D8(t))return!1;return!0}O8.forEach(e=>{L8[e]=!0});let Gse=class{constructor(t){this._handlers=new Map,this._counter=0,this._handlerCounts=new Map,this.view=t,this.inputManager=null}connect(t){t&&this.disconnect(),this.inputManager=t,this._handlers.forEach(({handler:i,priority:r},s)=>{var n;return(n=this.inputManager)==null?void 0:n.installHandlers(s,[i],r)})}disconnect(){this.inputManager&&this._handlers.forEach((t,i)=>{var r;return(r=this.inputManager)==null?void 0:r.uninstallHandlers(i)}),this.inputManager=null}destroy(){this.disconnect(),this._handlers.clear(),this.view=null}on(t,i,r,s){const n=Array.isArray(t)?t:t.split(",");if(!Vse(n))return n.some(D8)&&console.error("Error: registering input events and other events on the view at the same time is not supported."),null;let c,o;Array.isArray(i)?o=i:(c=i,o=[]),typeof r=="function"?c=r:s=r,s=s??uh.DEFAULT;const f=this._createUniqueGroupName(),g=new qse(this.view,n,o,c);this._handlers.set(f,{handler:g,priority:s});for(const S of n){const I=this._handlerCounts.get(S)||0;this._handlerCounts.set(S,I+1)}return this.inputManager&&this.inputManager.installHandlers(f,[g],s),er(()=>this._removeHandler(f,n))}hasHandler(t){return!!this._handlerCounts.get(t)}_removeHandler(t,i){if(this._handlers.has(t)){this._handlers.delete(t);for(const r of i){const s=this._handlerCounts.get(r);s===void 0?console.error("Trying to remove handler for event that has no handlers registered: ",r):s===1?this._handlerCounts.delete(r):this._handlerCounts.set(r,s-1)}}this.inputManager&&this.inputManager.uninstallHandlers(t)}_createUniqueGroupName(){return this._counter+=1,`viewEvents_${this._counter}`}},qse=class extends bs{constructor(t,i,r,s){super(!0),this._latestDragStart=void 0,this.view=t;for(const n of i)switch(n){case"click":this.registerIncoming("click",r,c=>s(this._wrapClick(c)));break;case"double-click":this.registerIncoming("double-click",r,c=>s(this._wrapDoubleClick(c)));break;case"immediate-click":this.registerIncoming("immediate-click",r,c=>s(this._wrapImmediateClick(c)));break;case"immediate-double-click":this.registerIncoming("immediate-double-click",r,c=>s(this._wrapImmediateDoubleClick(c)));break;case"hold":this.registerIncoming("hold",r,c=>s(this._wrapHold(c)));break;case"drag":this.registerIncoming("drag",r,c=>{const o=this._wrapDrag(c);o&&s(o)});break;case"key-down":this.registerIncoming("key-down",r,c=>s(this._wrapKeyDown(c)));break;case"key-up":this.registerIncoming("key-up",r,c=>s(this._wrapKeyUp(c)));break;case"pointer-down":this.registerIncoming("pointer-down",r,c=>s(this._wrapPointer(c,"pointer-down")));break;case"pointer-move":this.registerIncoming("pointer-move",r,c=>s(this._wrapPointer(c,"pointer-move")));break;case"pointer-up":this.registerIncoming("pointer-up",r,c=>s(this._wrapPointer(c,"pointer-up")));break;case"pointer-drag":this.registerIncoming("pointer-drag",r,c=>s(this._wrapPointerDrag(c)));break;case"mouse-wheel":this.registerIncoming("mouse-wheel",r,c=>s(this._wrapMouseWheel(c)));break;case"pointer-enter":this.registerIncoming("pointer-enter",r,c=>s(this._wrapPointer(c,"pointer-enter")));break;case"pointer-leave":this.registerIncoming("pointer-leave",r,c=>s(this._wrapPointer(c,"pointer-leave")));break;case"gamepad":this.registerIncoming("gamepad",r,c=>{s(this._wrapGamepad(c))});break;case"focus":this.registerIncoming("focus",r,c=>{s(this._wrapFocus(c))});break;case"blur":this.registerIncoming("blur",r,c=>{s(this._wrapBlur(c))})}}_wrapFocus(t){return{type:"focus",timestamp:t.timestamp,native:t.data.native,cancelable:t.cancelable,stopPropagation:()=>t.stopPropagation(),async:i=>t.async(i),preventDefault:()=>t.preventDefault()}}_wrapBlur(t){return{type:"blur",timestamp:t.timestamp,native:t.data.native,cancelable:t.cancelable,stopPropagation:()=>t.stopPropagation(),async:i=>t.async(i),preventDefault:()=>t.preventDefault()}}_wrapClick(t){const{pointerType:i,button:r,buttons:s,x:n,y:c,native:o,eventId:f}=t.data,{cancelable:g,timestamp:S}=t;return{type:"click",pointerType:i,button:r,buttons:s,x:n,y:c,native:o,timestamp:S,screenPoint:Dn(n,c),mapPoint:this._getMapPoint(n,c),eventId:f,cancelable:g,stopPropagation:()=>t.stopPropagation(),async:I=>t.async(I),preventDefault:()=>t.preventDefault()}}_wrapDoubleClick(t){const{pointerType:i,button:r,buttons:s,x:n,y:c,native:o,eventId:f}=t.data,{cancelable:g,timestamp:S}=t;return{type:"double-click",pointerType:i,button:r,buttons:s,x:n,y:c,native:o,timestamp:S,mapPoint:this._getMapPoint(n,c),eventId:f,cancelable:g,stopPropagation:()=>t.stopPropagation(),async:I=>t.async(I),preventDefault:()=>t.preventDefault()}}_wrapImmediateClick(t){const{pointerType:i,button:r,buttons:s,x:n,y:c,native:o,eventId:f}=t.data,g=o.pointerId,{cancelable:S,timestamp:I}=t;return{type:"immediate-click",pointerId:g,pointerType:i,button:r,buttons:s,x:n,y:c,native:o,timestamp:I,mapPoint:this._getMapPoint(n,c),eventId:f,cancelable:S,stopPropagation:()=>t.stopPropagation(),async:A=>t.async(A),preventDefault:()=>t.preventDefault()}}_wrapImmediateDoubleClick(t){const{pointerType:i,button:r,buttons:s,x:n,y:c,native:o,eventId:f}=t.data,g=o.pointerId,{cancelable:S,timestamp:I}=t;return{type:"immediate-double-click",pointerId:g,pointerType:i,button:r,buttons:s,x:n,y:c,native:o,timestamp:I,mapPoint:this._getMapPoint(n,c),eventId:f,cancelable:S,stopPropagation:()=>t.stopPropagation(),async:A=>t.async(A),preventDefault:()=>t.preventDefault()}}_wrapHold(t){const{pointerType:i,button:r,buttons:s,x:n,y:c,native:o}=t.data,{cancelable:f,timestamp:g}=t;return{type:"hold",pointerType:i,button:r,buttons:s,x:n,y:c,native:o,timestamp:g,mapPoint:this._getMapPoint(n,c),cancelable:f,stopPropagation:()=>t.stopPropagation(),async:S=>t.async(S),preventDefault:()=>t.preventDefault()}}_getMapPoint(t,i){return this.view.toMap(Dn(t,i),{exclude:[]})}_wrapDrag(t){const i=t.data,{x:r,y:s}=i.center,{action:n,pointerType:c,button:o}=i;if(n==="start"&&(this._latestDragStart=i),!this._latestDragStart)return;const f=i.pointer.native,g=i.buttons,{cancelable:S,timestamp:I}=t,A={x:this._latestDragStart.center.x,y:this._latestDragStart.center.y};return n==="end"&&(this._latestDragStart=void 0),{type:"drag",action:n,x:r,y:s,origin:A,pointerType:c,button:o,buttons:g,radius:i.radius,angle:zN(i.angle),native:f,timestamp:I,cancelable:S,stopPropagation:()=>t.stopPropagation(),async:O=>t.async(O),preventDefault:()=>t.preventDefault()}}_wrapKeyDown(t){const{key:i,repeat:r,native:s}=t.data,{cancelable:n,timestamp:c}=t;return{type:"key-down",key:i,repeat:r,native:s,timestamp:c,cancelable:n,stopPropagation:()=>t.stopPropagation(),async:o=>t.async(o),preventDefault:()=>t.preventDefault()}}_wrapKeyUp(t){const{key:i,native:r}=t.data,{cancelable:s,timestamp:n}=t;return{type:"key-up",key:i,native:r,timestamp:n,cancelable:s,stopPropagation:()=>t.stopPropagation(),async:c=>t.async(c),preventDefault:()=>t.preventDefault()}}_wrapPointer(t,i){const{x:r,y:s,button:n,buttons:c,native:o,eventId:f}=t.data,g=o.pointerId,S=o.pointerType,{cancelable:I,timestamp:A}=t;return{type:i,x:r,y:s,pointerId:g,pointerType:S,button:n,buttons:c,native:o,timestamp:A,eventId:f,cancelable:I,stopPropagation:()=>t.stopPropagation(),async:O=>t.async(O),preventDefault:()=>t.preventDefault()}}_wrapPointerDrag(t){const{x:i,y:r,buttons:s,native:n,eventId:c}=t.data.currentEvent,{button:o}=t.data.startEvent,f=t.data.startEvent.native.pointerId,g=t.data.startEvent.native.pointerType,S=t.data.action,I={x:t.data.startEvent.x,y:t.data.startEvent.y},{cancelable:A,timestamp:O}=t;return{type:"pointer-drag",x:i,y:r,pointerId:f,pointerType:g,button:o,buttons:s,action:S,origin:I,native:n,timestamp:O,eventId:c,cancelable:A,stopPropagation:()=>t.stopPropagation(),async:z=>t.async(z),preventDefault:()=>t.preventDefault()}}_wrapMouseWheel(t){const{cancelable:i,data:r,timestamp:s}=t,{x:n,y:c,deltaY:o,native:f}=r;return{type:"mouse-wheel",x:n,y:c,deltaY:o,native:f,timestamp:s,cancelable:i,stopPropagation:()=>t.stopPropagation(),async:g=>t.async(g),preventDefault:()=>t.preventDefault()}}_wrapGamepad(t){const{action:i,state:r,device:s}=t.data,{cancelable:n,timestamp:c}=t,{buttons:o,axes:f}=r;return{type:"gamepad",device:s,timestamp:c,action:i,buttons:o,axes:f,cancelable:n,stopPropagation:()=>t.stopPropagation(),async:g=>t.async(g),preventDefault:()=>t.preventDefault()}}};var i_,OR,LR;(function(e){e[e.USER=0]="USER",e[e.MANAGER=1]="MANAGER"})(i_||(i_={})),function(e){e[e.None=0]="None",e[e.Unfocused=1]="Unfocused",e[e.Focused=2]="Focused",e[e.Unselected=4]="Unselected",e[e.Selected=8]="Selected",e[e.All=15]="All"}(OR||(OR={})),function(e){e[e.None=0]="None",e[e.Custom1=16]="Custom1",e[e.Custom2=32]="Custom2",e[e.Custom3=64]="Custom3",e[e.Custom4=128]="Custom4",e[e.Custom5=256]="Custom5",e[e.Custom6=512]="Custom6",e[e.Custom7=1024]="Custom7",e[e.Custom8=2048]="Custom8",e[e.Custom9=4096]="Custom9",e[e.Custom10=8192]="Custom10",e[e.Custom11=16384]="Custom11",e[e.Custom12=32768]="Custom12",e[e.All=65520]="All"}(LR||(LR={}));function Hse(e){return[e.on("before-add",t=>{const i=t.item;if(i==null||e.includes(i))return _t.getLogger("esri.views.interactive.interactiveToolUtils").warn("Tool is either already in the list of tools or tool is `null`. Not adding tool."),void t.preventDefault();i.onAdd()}),e.on("after-remove",t=>{const i=t.item;i.active&&(i.view.activeTool=null),i.destroy()})]}function hI(e){return e.visible&&e.getEditableFlag!=null&&e.getEditableFlag(i_.USER)&&e.getEditableFlag(i_.MANAGER)}function xl(e){return Dn(e.x,e.y)}function N8(e,t){var r;const i=(r=e instanceof HTMLElement?e:e.surface)==null?void 0:r.getBoundingClientRect();return i?Dn(t.clientX-i.left,t.clientY-i.top):Dn(0,0)}function z8(e,t){return t instanceof Event?N8(e,t):xl(t)}function F8(e){if(e instanceof Event)return!0;if(typeof e=="object"&&"type"in e)switch(e.type){case"click":case"double-click":case"pointer-down":case"pointer-drag":case"pointer-enter":case"pointer-leave":case"pointer-up":case"pointer-move":case"immediate-click":case"immediate-double-click":case"hold":case"drag":case"mouse-wheel":return!0;default:return!1}return!1}let Wse=class{constructor(){this._pointerLocations=new Map,this._hoveredManipulators=new Map,this._grabbedManipulators=new Map,this._draggedManipulators=new Map,this._stopDrag=!1,this._revertToNullActiveTool=!1,this._cursor=null}get cursor(){return this._cursor}hasFocusedManipulators(){return this._grabbedManipulators.size>0||this._draggedManipulators.size>0}handleInputEvent(t,i){const r=()=>t.stopPropagation();switch(t.type){case"pointer-move":DR(t.pointerType)&&this._pointerLocations.set(t.pointerId,{x:t.x,y:t.y,pointerType:t.pointerType});break;case"drag":this._grabbedManipulators.size>0&&(this._stopDrag=!0),this._stopDrag&&(r(),t.action==="end"&&(this._stopDrag=!1));break;case"pointer-down":{if(!NR(t))break;const s=xl(t),n=this._intersect(s,t.pointerType,i.forEachTool);if(n==null)break;const c=n.manipulator,o=n.tool;c==null||o==null||!c.interactive||c.grabbable&&c.grabbableForEvent(t)||!c.grabbing||c.dragging||this._releaseManipulatorBeforeDragging(c,t,i),c!=null&&o!=null&&c.interactive&&c.grabbable&&c.grabbableForEvent(t)&&!c.grabbing&&(this._grabbedManipulators.set(t.pointerId,{manipulator:c,tool:o,start:s,pointerType:t.pointerType}),this._grabbedManipulators.size===1&&i.activeTool==null&&(this._revertToNullActiveTool=!0,i.setActiveTool(n.tool)),c.grabbing=!0,c.events.emit("grab-changed",{action:"start",pointerType:t.pointerType,screenPoint:s}),r());break}case"pointer-up":this._draggedManipulators.has(t.pointerId)||this._handlePointerEnd(t,i);break;case"pointer-drag":{if(!NR(t))break;const s=this._grabbedManipulators.get(t.pointerId),n=s==null?void 0:s.manipulator,c=s==null?void 0:s.tool;if(n==null||c==null)break;const o=xl(t);o.x=Ll(o.x,0,i.view.width),o.y=Ll(o.y,0,i.view.height);const f=s.start,g=this._draggedManipulators.get(t.pointerId);switch(t.action){case"start":case"update":t.action!=="update"&&this._grabbedManipulators.size!==1||(n.dragging=!0,g?n.events.emit("drag",{action:"update",start:f,screenPoint:o}):n.events.emit("drag",{action:"start",start:f,screenPoint:o,pointerType:t.pointerType}),this._draggedManipulators.set(t.pointerId,{tool:c,manipulator:n,start:f}));break;case"end":n.dragging=!1,g&&n.events.emit("drag",{action:"end",start:f,screenPoint:o}),this._draggedManipulators.delete(t.pointerId),this._handlePointerEnd(t,i)}r();break}case"immediate-click":{const s=xl(t),n=this._intersect(s,t.pointerType,i.forEachTool);if(Zse(t)||i.forEachTool(g=>{if((n==null||n.tool!==g||g.automaticManipulatorSelection)&&g.manipulators){let S=!1;g.manipulators.forEach(({manipulator:I})=>{I.selected&&(I.selected=!1,S=!0)}),S&&g.onManipulatorSelectionChanged&&g.onManipulatorSelectionChanged()}}),n==null)break;const{manipulator:c,tool:o}=n;if(!c.interactive)break;c.selectable&&o.automaticManipulatorSelection&&(c.selected=!c.selected,o.onManipulatorSelectionChanged&&o.onManipulatorSelectionChanged());const f=t.native.shiftKey;c.events.emit("immediate-click",{screenPoint:s,button:t.button,pointerType:t.pointerType,shiftKey:f,stopPropagation:r}),tT(c,r);break}case"click":{const s=xl(t),n=this._intersect(s,t.pointerType,i.forEachTool),c=n==null?void 0:n.manipulator;if(c==null||!c.interactive)break;const o=t.native.shiftKey;c.events.emit(t.type,{screenPoint:s,button:t.button,pointerType:t.pointerType,shiftKey:o}),r();break}case"double-click":{const s=xl(t),n=this._intersect(s,t.pointerType,i.forEachTool),c=n!=null?n.manipulator:null;if(c==null||!c.interactive)break;const o=t.native.shiftKey;c.events.emit("double-click",{screenPoint:s,button:t.button,pointerType:t.pointerType,shiftKey:o,stopPropagation:r}),tT(c,r);break}case"immediate-double-click":{const s=xl(t),n=this._intersect(s,t.pointerType,i.forEachTool),c=n!=null?n.manipulator:null;if(c==null||!c.interactive)break;const o=t.native.shiftKey;c.events.emit("immediate-double-click",{screenPoint:s,button:t.button,pointerType:t.pointerType,shiftKey:o,stopPropagation:r}),tT(c,r);break}}this._onFocusChange(i.forEachTool)}_releaseManipulatorBeforeDragging(t,i,r){t.grabbing=!1,t.events.emit("grab-changed",{action:"end",pointerType:i.pointerType,screenPoint:xl(i)}),this._grabbedManipulators.forEach(({manipulator:s},n)=>{s===t&&this._grabbedManipulators.delete(n)}),this._afterManipulatorRelease(r.setActiveTool)}_handlePointerEnd(t,i){var s;const r=(s=this._grabbedManipulators.get(t.pointerId))==null?void 0:s.manipulator;r!=null&&r.grabbing&&(r.grabbing=!1,r.events.emit("grab-changed",{action:"end",pointerType:t.pointerType,screenPoint:xl(t)}),this._grabbedManipulators.delete(t.pointerId),this._afterManipulatorRelease(i.setActiveTool))}_cursorFromMap(t){let i=null;return dx(t,({manipulator:r})=>!(r==null||!r.interactive)&&(r.grabbing&&r.grabCursor?(i=r.grabCursor,!0):!!r.cursor&&(i=r.cursor,!0))),i}_onFocusChange(t){this._updateCursor(),this._updateFocusedManipulatorTools(t)}_updateCursor(){this._grabbedManipulators.size>0?this._cursor=this._cursorFromMap(this._grabbedManipulators)||"grabbing":this._hoveredManipulators.size>0?this._cursor=this._cursorFromMap(this._hoveredManipulators)||"pointer":this._cursor=null}_updateFocusedManipulatorTools(t){const i=new Set,r=new Set;this._grabbedManipulators.forEach(({tool:s})=>{i.add(s)}),this._hoveredManipulators.forEach(({tool:s})=>{r.add(s)}),t(s=>{s.hasGrabbedManipulators=i.has(s),s.hasHoveredManipulators=r.has(s);const n=this._grabbedManipulators.values(),c=F7(n,({tool:o})=>o===s);s.firstGrabbedManipulator=c!=null?c.manipulator:null})}clearPointers(t,{forEachTool:i,setActiveTool:r},s=!0,n){const c=(o,f)=>o===t&&(n==null||n===f);this._grabbedManipulators.forEach(({tool:o,manipulator:f,pointerType:g},S)=>{c(o,f)&&(this._grabbedManipulators.delete(S),f.grabbing=!1,f.events.emit("grab-changed",{action:"end",screenPoint:null,pointerType:g}))}),this._draggedManipulators.forEach(({tool:o,manipulator:f},g)=>{c(o,f)&&(this._draggedManipulators.delete(g),f.dragging=!1,f.events.emit("drag",{action:"cancel"}))}),s&&this._hoveredManipulators.forEach(({tool:o,manipulator:f},g)=>{c(o,f)&&(this._hoveredManipulators.delete(g),f.hovering=!1)}),this._afterManipulatorRelease(r),this._onFocusChange(i)}_intersect(t,i,r){let s=null;return r(n=>{if(n.manipulators==null||!hI(n))return!1;const c=n.manipulators.intersect(t,i);return c!=null&&(s={tool:n,manipulator:c},!0)}),s}updateHoveredStateFromKnownPointers(t){this._pointerLocations.forEach((i,r)=>{this._updateHoveredStateForPointerAtScreenPosition(Dn(i.x,i.y),r,i.pointerType,t)})}handleHoverEvent(t,i){t.type!=="pointer-up"&&t.type!=="immediate-click"&&t.type!=="pointer-move"||!DR(t.pointerType)||this._updateHoveredStateForPointerAtScreenPosition(xl(t),t.pointerId,t.pointerType,i)}_updateHoveredStateForPointerAtScreenPosition(t,i,r,s){var o;let n=this._intersect(t,r,s);const c=(o=this._hoveredManipulators.get(i))==null?void 0:o.manipulator;n==null||n.manipulator.interactive||(n=null),n!=null&&c===n.manipulator||(c!=null&&(c.hovering=!1),n!=null?(n.manipulator.hovering=!0,this._hoveredManipulators.set(i,n)):this._hoveredManipulators.delete(i),this._onFocusChange(s))}_afterManipulatorRelease(t){this._grabbedManipulators.size===0&&this._revertToNullActiveTool&&(t(null),this._revertToNullActiveTool=!1)}};function DR(e){return e==="mouse"}function NR(e){return e.pointerType!=="mouse"||e.button===0}function Zse(e){return!!e.native.shiftKey}function tT(e,t){e!=null&&e.consumesClicks&&t()}const zR="attached",iT="tools",FR=1e3;let Sl=class extends Nt{constructor(t){super(t),this._updatingHandles=new cp,this._clock=Vm,this._manipulatorState=new Wse,this.tools=new Bt,this.cursor=null,this._interacting=!1,this._interactingTimeout=FR,this._interactingTimeoutHandle=null,this._forEachTool=i=>{for(const r of this.tools.items)if(i(r))return}}initialize(){this.addHandles([this.view.on(O8,t=>{this._handleInputEvent(t)},uh.TOOL),...Hse(this.tools),this.tools.on("before-add",({item:t})=>{this._updateToolEditableFlag(t)}),this.tools.on("before-remove",({item:t})=>{this._manipulatorState.clearPointers(t,this._manipulatorStateEventArgs),this._updateCursor()}),this.tools.on("change",()=>{this._refreshToolWatchers()})])}destroy(){this.activeTool=null,this.tools.drain(t=>t.destroy()),this._clearInteractingTimeout(),this._interacting=!1,this._updatingHandles.destroy()}get _manipulatorStateEventArgs(){return{forEachTool:this._forEachTool,activeTool:this.activeTool,setActiveTool:t=>{this.activeTool=t},view:this.view}}set activeTool(t){if(t!=null&&!this.view.ready)return void _t.getLogger(this).error("Cannot set active tool while view is not ready.");if(t===this.activeTool)return;const i=this.activeTool;this._set("activeTool",t),i!=null&&i.deactivate(),t!=null&&t.activate(),this._removeIncompleteTools(t);for(const r of this.tools){this._updateToolEditableFlag(r);const s=hI(r);this.activeTool!=null&&s||this._manipulatorState.clearPointers(r,this._manipulatorStateEventArgs,!s)}this._updateCursor()}get updating(){return this._updatingHandles.updating||this.tools.some(t=>t.updating)}get interacting(){return this._interacting}_clearInteractingTimeout(){this._interactingTimeoutHandle=Sr(this._interactingTimeoutHandle)}_startInteractingTimeout(){this._clearInteractingTimeout(),this._interactingTimeoutHandle=this._clock.setTimeout(()=>this._interacting=!1,this._interactingTimeout)}attach(){var t;this.view.type==="3d"?this.addHandles([ti(()=>{const{state:i}=this.view;return"camera"in i&&i.camera},()=>this._forEachManipulator(i=>i.onViewChange())),(t=this.view.elevationProvider)==null?void 0:t.on("elevation-change",i=>this._forEachManipulator(r=>r.onElevationChange(i)))],zR):this.addHandles(ti(()=>this.view.extent,()=>this._forEachManipulator(i=>i.onViewChange())))}detach(){this.activeTool=null,this.tools.removeAll(),this.removeHandles(zR),this._clearInteractingTimeout(),this._interacting=!1}_forEachManipulator(t){this._forEachTool(i=>{i.manipulators&&i.manipulators.forEach(({manipulator:r})=>t(r,i))})}_handleInputEvent(t){let i=!1;const r={...t,stopPropagation:()=>{i=!0,t.stopPropagation()}};this.activeTool!=null?this.activeTool.handleInputEvent&&this.activeTool.handleInputEvent(r):this._forEachTool(s=>{!i&&s.visible&&s.handleInputEvent(r)}),!i&&t.type==="key-down"&&t.key==="Escape"&&this.activeTool&&(t.stopPropagation(),this.activeTool=null),this._manipulatorState.handleInputEvent(r,this._manipulatorStateEventArgs),i||this.activeTool==null||this.activeTool.handleInputEventAfter(r),this._manipulatorState.handleHoverEvent(r,this._forEachTool),this._updateCursor(),t.type==="pointer-move"&&(this._manipulatorState.hasFocusedManipulators()||this.activeTool)&&(this._interacting=!0,this._startInteractingTimeout())}_refreshToolWatchers(){this.removeHandles(iT),this._forEachTool(t=>{if(t instanceof Nt){const i=ti(()=>[t.cursor,t.visible,t.editable],()=>{hI(t)||this._manipulatorState.clearPointers(t,this._manipulatorStateEventArgs),this._updateCursor()});this.addHandles(i,iT)}t.manipulators&&this.addHandles([t.manipulators.on("after-remove",i=>{this._manipulatorState.clearPointers(t,this._manipulatorStateEventArgs,!0,i.item.manipulator)}),t.manipulators.on("change",()=>{this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()})],iT)}),this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()}_updateToolEditableFlag(t){var i;(i=t.setEditableFlag)==null||i.call(t,i_.MANAGER,this.activeTool==null||t===this.activeTool)}_updateCursor(){let t=this._manipulatorState.cursor;t==null&&this._forEachTool(i=>!(i.cursor==null||!i.visible)&&(t=i.cursor,!0)),this._get("cursor")!==t&&this._set("cursor",t)}_removeIncompleteTools(t){this.tools.filter(i=>(t==null||i!==t)&&!i.created&&i.removeIncompleteOnCancel).forEach(i=>{this.tools.remove(i)})}get test(){const t=this;return{setClock:i=>this._clock=i,set interactingTimeoutEnabled(i){t._interactingTimeout=i?FR:0},get interactingTimeoutEnabled(){return t._interactingTimeout!==0}}}};v([M({constructOnly:!0,nonNullable:!0})],Sl.prototype,"view",void 0),v([M({value:null})],Sl.prototype,"activeTool",null),v([M({readOnly:!0,type:Bt})],Sl.prototype,"tools",void 0),v([M({readOnly:!0})],Sl.prototype,"cursor",void 0),v([M({readOnly:!0})],Sl.prototype,"updating",null),v([M()],Sl.prototype,"_interacting",void 0),v([M({readOnly:!0})],Sl.prototype,"interacting",null),Sl=v([fe("esri.views.ToolViewManager")],Sl);let Hf=class extends Nt{constructor(t){super(),this.nativeIndex=null,this._detectedDeviceType="unknown",t.mapping==="standard"?this._detectedDeviceType="standard":Yse.test(t.id)?this._detectedDeviceType="spacemouse":this._detectedDeviceType="unknown",this.nativeIndex=t.index}get native(){const t=navigator.getGamepads?navigator.getGamepads():[];return this.nativeIndex!=null&&this.nativeIndeximport("./geometryServiceUtils-CdocmtDi.js"),__vite__mapDeps([162,163])).then(t=>dI=t)),await rT,mr(e)}async function Y8(e,t,i,r){if(!e)return null;const s=e.spatialReference;return Ah()||Nl(s,t)?Ph(e,t):dI?dI.projectGeometry(e,t,i,r):(await Promise.race([ane(r),bh(r)]),Y8(e,t,i,r))}let qi=class extends Nt{constructor(t){super(t),this.required={tileInfo:!1,heightModelInfo:!1,extent:!1},this.defaultSpatialReference=null,this.userSpatialReference=null,this.sourcePreloadCount=10,this.priorityCollection=null,this.requiresExtentInSpatialReference=!0,this.suspended=!1,this._projectExtentTask={task:null,input:null,output:null,spatialReference:null}}destroy(){this._projectExtentTask.task&&(this._projectExtentTask.task=z0(this._projectExtentTask.task)),this._set("map",null)}get ready(){return!this._spatialReferenceTask.updating&&!this._tileInfoTask.updating&&!this._extentTask.updating}get heightModelInfoReady(){return!this._heightModelInfoTask.updating}get spatialReference(){return this.userSpatialReference!=null?this.userSpatialReference:this._spatialReferenceTask.spatialReference}get extent(){return this._extentTask.extent}get heightModelInfo(){return this._heightModelInfoTask.heightModelInfo}get vcsWkid(){return this._heightModelInfoTask.vcsWkid}get latestVcsWkid(){return this._heightModelInfoTask.latestVcsWkid}get viewingMode(){return this.userSpatialReference==null||this.userSpatialReference.equals(this._spatialReferenceTask.spatialReference)?this._spatialReferenceTask.viewingMode:null}get tileInfo(){return this._tileInfoTask.tileInfo}get mapCollections(){var r,s,n,c;const t=(r=this.map)==null?void 0:r.call(this),i=[];return this.priorityCollection!=null&&i.push(this.priorityCollection),i.push({parent:t==null?void 0:t.basemap,layers:(s=t==null?void 0:t.basemap)==null?void 0:s.baseLayers},{layers:t==null?void 0:t.layers},{parent:t==null?void 0:t.ground,layers:(n=t==null?void 0:t.ground)==null?void 0:n.layers},{parent:t==null?void 0:t.basemap,layers:(c=t==null?void 0:t.basemap)==null?void 0:c.referenceLayers}),i}get _allLayers(){return this._collectLayers(this.mapCollections)}get _spatialReferenceTask(){if(this.suspended)return this._get("_spatialReferenceTask")??{updating:!1};const{layers:t,updating:i}=this._allLayers;let r=null;for(const n of t){const c=this._getSupportedSpatialReferences(n);if(c.length>0){const o=this._narrowDownSpatialReferenceCandidates(r,c);o!=null&&(r=o)}if(r!=null&&r.length===1)break}if(i&&(r==null||r.length!==1))return{updating:!0};const s=this._pickSpatialReferenceCandidate(r);return{spatialReference:s!=null?s.spatialReference:null,viewingMode:s!=null?s.viewingMode:null,updating:!1}}get _tileInfoTask(){var r,s,n,c,o,f,g;if(!this.required.tileInfo)return this._get("_tileInfoTask")??{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const{layers:t,updating:i}=this._collectLayers([{parent:(s=(r=this.map)==null?void 0:r.call(this))==null?void 0:s.basemap,layers:(o=(c=(n=this.map)==null?void 0:n.call(this))==null?void 0:c.basemap)==null?void 0:o.baseLayers},{layers:(g=(f=this.map)==null?void 0:f.call(this))==null?void 0:g.layers}]);if(t&&t.length>0&&"tileInfo"in t[0]){const S=t[0].tileInfo;return{tileInfo:S&&S.spatialReference.equals(this.spatialReference)?S:null,updating:!1}}return{updating:i}}get _heightModelInfoTask(){var r,s,n;if(!this.required.heightModelInfo||this.suspended&&((r=this._get("_heightModelInfoTask"))!=null&&r.heightModelInfo))return this._get("_heightModelInfoTask")??{updating:!1};const{layers:t,updating:i}=this._allLayers;for(const c of t)if(nne(c)){const o=rne(c);if(o)return{heightModelInfo:o,vcsWkid:(s=c.spatialReference)==null?void 0:s.vcsWkid,latestVcsWkid:(n=c.spatialReference)==null?void 0:n.latestVcsWkid,updating:!1}}return{updating:i}}get _extentCandidatesTask(){if(this.suspended||!this.required.extent)return this._get("_extentCandidatesTask")??{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const t=this._allLayers,i=t.updating,r=[];for(const s of t.layers){const n="fullExtents"in s&&s.fullExtents||(s.fullExtent!=null?[s.fullExtent]:[]),c=this.requiresExtentInSpatialReference?null:n[0],o=n.find(f=>f.spatialReference.equals(this.spatialReference))??c;if(o)return{candidates:[{extent:o,layer:s}],updating:!1};if(this._getSupportedSpatialReferences(s).length>0)for(const f of n)r.push({extent:f,layer:s})}return{candidates:r,updating:i}}get _extentTask(){const{candidates:t,updating:i}=this._extentCandidatesTask;if(i)return{updating:i};if(t==null||t.length===0)return{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const r=this._pickExtentCandidate(t),s=this.spatialReference;return r.extent.equals(this._projectExtentTask.input)&&s.equals(this._projectExtentTask.spatialReference)?{extent:this._projectExtentTask.output,updating:this._projectExtentTask.task!=null&&!this._projectExtentTask.task.finished}:(this._projectExtentTask.task!=null&&(this._projectExtentTask.task=z0(this._projectExtentTask.task)),this._projectExtentTask={input:r.extent.clone(),output:null,spatialReference:s.clone(),task:_x(async n=>{try{const c=await Y8(r.extent,s,"portalItem"in r.layer?r.layer.portalItem:void 0,n);this._projectExtentTask={...this._projectExtentTask,task:null,output:c}}catch{if(ra(n))return;this._projectExtentTask={...this._projectExtentTask,task:null}}})},{updating:!0})}_narrowDownSpatialReferenceCandidates(t,i){if(t==null)return i;const r=[],s=(n,c)=>n!=null?c!=null?n===c&&n:n:c;for(const n of t)for(const c of i){if(!n.spatialReference.equals(c.spatialReference))continue;const o=s(n.viewingMode,c.viewingMode);if(o!==!1){r.push({spatialReference:n.spatialReference,viewingMode:o});break}}return r.length>0?r:null}_pickSpatialReferenceCandidate(t){const i=this.defaultSpatialReference;return t==null||t.length<1?i!=null?{spatialReference:i,viewingMode:null}:null:(i!=null&&t.length>1&&t.some(({spatialReference:r})=>r.equals(i))&&(t=t.filter(({spatialReference:r})=>r.equals(i))),t.length>1&&t.some(({viewingMode:r})=>r!==Bw.Local)&&(t=t.filter(({viewingMode:r})=>r!==Bw.Local)),t[0])}_getSupportedSpatialReferences(t){const i="supportedSpatialReferences"in t&&t.supportedSpatialReferences||(t.spatialReference?[t.spatialReference]:[]);if(i.length===0)return[];const r=[];for(const s of i){const n=this.getSpatialReferenceSupport({spatialReference:s,layer:t});if(n!=null){const c=n.constraints!=null?n.constraints:[{spatialReference:s,viewingMode:null}];for(const{spatialReference:o,viewingMode:f}of c)this.requiresExtentInSpatialReference&&this.userSpatialReference!=null&&!o.equals(this.userSpatialReference)||r.push({spatialReference:o,viewingMode:f})}}return r}_pickExtentCandidate(t){const i=this.spatialReference;return t.find(({extent:r})=>i.equals(r.spatialReference))||t[0]}_collectLayers(t){var r;if(this._loadMaybe((r=this.map)==null?void 0:r.call(this))!=="loaded")return{layers:[],updating:!0};const i=new lne;for(const s of t)if(this._collectCollection(s,i),i.preloading===this.sourcePreloadCount)break;return{layers:i.layers,updating:i.updating}}_collectCollection(t,i){if(t.layers){switch(this._loadMaybe(t.parent)){case"loading":return i.updating=!0,void++i.preloading;case"failed":return}for(const r of t.layers){switch(this._loadMaybe(r)){case"failed":continue;case"loading":i.updating=!0,++i.preloading;break;case"loaded":i.updating||i.layers.push(r),"layers"in r&&this._collectCollection({layers:r.layers},i)}if(i.preloading===this.sourcePreloadCount)break}}}_loadMaybe(t){return t&&"loadStatus"in t&&t.loadStatus!=null?t.loadStatus==="not-loaded"?(t.load().catch(i=>{Ys(i)||console.log(i)}),"loading"):t.loadStatus:"loaded"}};v([M()],qi.prototype,"required",void 0),v([M({constructOnly:!0})],qi.prototype,"map",void 0),v([M({constructOnly:!0})],qi.prototype,"getSpatialReferenceSupport",void 0),v([M()],qi.prototype,"defaultSpatialReference",void 0),v([M()],qi.prototype,"userSpatialReference",void 0),v([M()],qi.prototype,"sourcePreloadCount",void 0),v([M()],qi.prototype,"priorityCollection",void 0),v([M()],qi.prototype,"requiresExtentInSpatialReference",void 0),v([M()],qi.prototype,"suspended",void 0),v([M({readOnly:!0})],qi.prototype,"ready",null),v([M({readOnly:!0})],qi.prototype,"heightModelInfoReady",null),v([M({readOnly:!0})],qi.prototype,"spatialReference",null),v([M({readOnly:!0})],qi.prototype,"extent",null),v([M({readOnly:!0})],qi.prototype,"heightModelInfo",null),v([M({readOnly:!0})],qi.prototype,"vcsWkid",null),v([M({readOnly:!0})],qi.prototype,"latestVcsWkid",null),v([M({readOnly:!0})],qi.prototype,"viewingMode",null),v([M({readOnly:!0})],qi.prototype,"tileInfo",null),v([M({readOnly:!0})],qi.prototype,"mapCollections",null),v([M({readOnly:!0})],qi.prototype,"_allLayers",null),v([M({readOnly:!0})],qi.prototype,"_spatialReferenceTask",null),v([M({readOnly:!0})],qi.prototype,"_tileInfoTask",null),v([M({readOnly:!0})],qi.prototype,"_heightModelInfoTask",null),v([M({readOnly:!0})],qi.prototype,"_extentCandidatesTask",null),v([M()],qi.prototype,"_extentTask",null),v([M()],qi.prototype,"_projectExtentTask",void 0),qi=v([fe("esri.views.support.DefaultsFromMap")],qi);let lne=class{constructor(){this.layers=new Array,this.preloading=-1,this.updating=!1}};var r0;let Pt=r0=class extends Sh.EventedMixin(bA(Nt)){constructor(e){super(e),this._userSpatialReference=null,this._cursor=null,this.handles=new eA,this.updatingHandles=new cp,this.allLayerViews=new W0({getCollections:()=>{var t,i,r;return[(t=this.basemapView)==null?void 0:t.baseLayerViews,(i=this.groundView)==null?void 0:i.layerViews,this.layerViews,(r=this.basemapView)==null?void 0:r.referenceLayerViews]},getChildrenFunction:une}),this.groundView=null,this.basemapView=null,this.fatalError=null,this.graphics=new $0,this.analyses=new kw,this.typeSpecificPreconditionsReady=!0,this.layerViews=new Bt,this.magnifier=new P8,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this.spatialReferenceWarningDelay=1e3,this.supportsGround=!0,this.timeExtent=null,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this.input=new Xse,this.navigation=new U8,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new Gse(this),this.persistableViewModels=new Bt,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this.theme=null,this.handles.add(ti(()=>this.preconditionsReady,t=>{var r,s;const i=this.ready;if(t?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,r0.views.add(this)):(this._lockedSpatialReference=null,r0.views.remove(this)),this.notifyChange("spatialReference"),!t&&i)(r=this.toolViewManager)==null||r.detach(),this.analysisViewManager!=null&&this.analysisViewManager.detach(),(s=this.layerViewManager)==null||s.clear(),this._teardown();else if(t&&!i){try{this._startup()}catch(n){return void queueMicrotask(()=>{console.error("View._startup failed",n),this.fatalError=new Je("startup-error",null,n)})}this.analysisViewManager!=null&&this.analysisViewManager.attach(),this.toolViewManager.attach()}},Tp))}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then(()=>(this._isValid=!0,$x(()=>this.ready)))),this.basemapView=new Bu({view:this}),this.layerViewManager=new Mse({view:this,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},supportsGround:this.supportsGround}),this.toolViewManager=new Sl({view:this}),this._setupSpatialReferenceLogger(),this.selectionManager=new jse({view:this}),this.addHandles([ti(()=>this.initialExtentRequired,e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e},Fa),ti(()=>this.ready,e=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=e,this.defaultsFromMap.userSpatialReference=e?this.spatialReference:this._userSpatialReference)},Tp),ti(()=>this._userSpatialReference,e=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=e)},Fa)])}_setupSpatialReferenceLogger(){let e=null;this.addHandles([ti(()=>{var t;return(t=this.defaultsFromMap)==null?void 0:t.ready},t=>{var r;const i=((r=this.map)==null?void 0:r.allLayers.length)>0;if(t&&!this.spatialReference&&i){if(e!=null)return;const s=er(()=>e=z0(e));e=_x(async n=>{try{await t4(this.spatialReferenceWarningDelay,null,n)}catch{return}finally{e=null}_t.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}),this.addHandles(s,"spatial-reference-logger-task")}else this.removeHandles("spatial-reference-logger-task")},{sync:!0})])}destroy(){var e,t;this.destroyed||(r0.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=lr(this.graphics),this.analyses=lr(this.analyses),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),lr(this.analysisViewManager),this.toolViewManager=lr(this.toolViewManager),this.layerViewManager=lr(this.layerViewManager),this.selectionManager=lr(this.selectionManager),this.basemapView=lr(this.basemapView),(e=this.groundView)==null||e.destroy(),(t=this.layerViews)==null||t.forEach(i=>i.destroy()),this.layerViews.length=0,this.invalidate(),this._emitter.clear(),this.handles.destroy(),this.map=lr(this.map),this.updatingHandles.destroy())}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return _t.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){var e;return(e=this.toolViewManager)==null?void 0:e.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get animation(){return this._get("animation")}set animation(e){this._set("animation",e)}get center(){return null}get _defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new qi({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:e=>this.getSpatialReferenceSupport(e),...this._defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(e){this._set("extent",e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){var e;return!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||dh.isLoadable(this.map)&&!this.map.loaded||this.width===0||this.height===0||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._lockedSpatialReference&&!((e=this.defaultsFromMap)!=null&&e.ready)||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(e){e!==this._get("map")&&(e!=null&&e.destroyed&&(_t.getLogger(this).warn("#map","The provided map is already destroyed",{map:e}),e=null),dh.isLoadable(e)&&e.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",e))}get spatialReference(){var t,i;const e=this._userSpatialReference||this._lockedSpatialReference||this.getDefaultSpatialReference()||null;if(e&&((i=(t=this.defaultsFromMap)==null?void 0:t.required)!=null&&i.heightModelInfo)){const r=e.clone();return r.vcsWkid=this.defaultsFromMap.vcsWkid,r.latestVcsWkid=this.defaultsFromMap.latestVcsWkid,r}return e}set spatialReference(e){const t=!Js(e,this._get("spatialReference"));this._set("_userSpatialReference",e),t&&(this._set("spatialReference",e),this._spatialReferenceChanged(e))}_spatialReferenceChanged(e){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??Dl}set timeZone(e){const t=new Set(["etc/utc","etc/gmt","gmt"]),i=new Set(Intl.supportedValuesOf("timeZone").map(r=>r.toLowerCase()));this._userTimeZone=e,e===Dl||e===o3||t.has(e.toLowerCase())||i.has(e.toLowerCase())||_t.getLogger(this).warn("#timeZone",`the parsed value '${e}' may not be a valid IANA time zone`)}get tools(){var e;return(e=this.toolViewManager)==null?void 0:e.tools}get initialExtent(){var e;return(e=this.defaultsFromMap)==null?void 0:e.extent}get cursor(){var e;return((e=this.toolViewManager)==null?void 0:e.cursor)??this._cursor??"default"}set cursor(e){this._cursor=e,this.notifyChange("cursor")}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new uI}whenLayerView(e){var t;return((t=this.layerViewManager)==null?void 0:t.whenLayerView(e))??Promise.reject()}getDefaultSpatialReference(){var e;return(e=this.defaultsFromMap)==null?void 0:e.spatialReference}getDefaultHeightModelInfo(){var e;return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??((e=this.defaultsFromMap)==null?void 0:e.heightModelInfo)??null}getDefaultTimeZone(){return null}importLayerView(e){throw new Je("importLayerView() not implemented")}hasLayerViewModule(e){return!1}async validate(){}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return this.getSpatialReferenceSupport({spatialReference:e})!=null}when(e,t){return this.isResolved()&&!this.ready&&_t.getLogger(this).warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(e,t)}forceReadyCycle(){this.ready&&(gh(()=>this.destroyed||this.preconditionsReady===!1,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}};Pt.views=new Bt,v([M()],Pt.prototype,"_userSpatialReference",void 0),v([M()],Pt.prototype,"activeTool",null),v([M({readOnly:!0})],Pt.prototype,"allLayerViews",void 0),v([M()],Pt.prototype,"groundView",void 0),v([M()],Pt.prototype,"animation",null),v([M()],Pt.prototype,"basemapView",void 0),v([M()],Pt.prototype,"center",null),v([M({readOnly:!0})],Pt.prototype,"_defaultsFromMapSettings",null),v([M()],Pt.prototype,"defaultsFromMap",null),v([M()],Pt.prototype,"fatalError",void 0),v([M({type:Ui})],Pt.prototype,"extent",null),v([M(mR($0,"graphics"))],Pt.prototype,"graphics",void 0),v([M(mR(kw,"analyses"))],Pt.prototype,"analyses",void 0),v([M({readOnly:!0,type:g3})],Pt.prototype,"heightModelInfo",null),v([M({readOnly:!0})],Pt.prototype,"interacting",null),v([M({readOnly:!0})],Pt.prototype,"navigating",null),v([M({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_lockedSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],Pt.prototype,"preconditionsReady",null),v([M({readOnly:!0})],Pt.prototype,"typeSpecificPreconditionsReady",void 0),v([M({type:Bt,readOnly:!0})],Pt.prototype,"layerViews",void 0),v([M()],Pt.prototype,"resolution",null),v([M({type:P8})],Pt.prototype,"magnifier",void 0),v([M({value:null,type:C6})],Pt.prototype,"map",null),v([M()],Pt.prototype,"padding",void 0),v([M({readOnly:!0})],Pt.prototype,"ready",void 0),v([M({type:yi})],Pt.prototype,"spatialReference",null),v([M()],Pt.prototype,"spatialReferenceWarningDelay",void 0),v([M()],Pt.prototype,"stationary",null),v([M({readOnly:!0})],Pt.prototype,"supportsGround",void 0),v([M({type:E_})],Pt.prototype,"timeExtent",void 0),v([M({type:String,nonNullable:!0})],Pt.prototype,"timeZone",null),v([M()],Pt.prototype,"tools",null),v([M()],Pt.prototype,"toolViewManager",void 0),v([M({readOnly:!0})],Pt.prototype,"type",void 0),v([M({type:Number})],Pt.prototype,"scale",void 0),v([M({readOnly:!0})],Pt.prototype,"updating",void 0),v([M({readOnly:!0})],Pt.prototype,"initialExtentRequired",void 0),v([M({readOnly:!0})],Pt.prototype,"initialExtent",null),v([M()],Pt.prototype,"cursor",null),v([M({readOnly:!0})],Pt.prototype,"input",void 0),v([M({type:U8,nonNullable:!0})],Pt.prototype,"navigation",void 0),v([M()],Pt.prototype,"layerViewManager",void 0),v([M()],Pt.prototype,"analysisViewManager",void 0),v([M()],Pt.prototype,"selectionManager",void 0),v([M()],Pt.prototype,"width",void 0),v([M()],Pt.prototype,"height",void 0),v([M({readOnly:!0})],Pt.prototype,"resizing",void 0),v([M({value:null,readOnly:!0})],Pt.prototype,"size",null),v([M({readOnly:!0})],Pt.prototype,"suspended",void 0),v([M({readOnly:!0})],Pt.prototype,"viewEvents",void 0),v([M({readOnly:!0})],Pt.prototype,"persistableViewModels",void 0),v([M()],Pt.prototype,"_isValid",void 0),v([M()],Pt.prototype,"_readyCycleForced",void 0),v([M()],Pt.prototype,"_lockedSpatialReference",void 0),v([M()],Pt.prototype,"_userTimeZone",void 0),v([M()],Pt.prototype,"_lockedTimeZone",void 0),v([M({type:uI})],Pt.prototype,"theme",void 0),v([M({readOnly:!0,type:uI})],Pt.prototype,"effectiveTheme",null),Pt=r0=v([fe("esri.views.View")],Pt);const cne=Pt;function une(e){return e.layerViews}let ju=class extends cw{constructor(t){super(t),this.state="running",this.target=null,this._resolver=null}initialize(){this._resolver=sa(),this.addResolvingPromise(this._resolver.promise)}get done(){return this.state==="finished"||this.state==="stopped"}stop(){var t;this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","stopped"),(t=this._resolver)==null||t.reject(new Je("ViewAnimation stopped")))}finish(){var t;this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","finished"),(t=this._resolver)==null||t.resolve())}update(t,i){i||(i=xh(t)?"waiting-for-target":"running"),this._set("target",t),this._set("state",i)}};v([M({readOnly:!0})],ju.prototype,"done",null),v([M({readOnly:!0,type:String})],ju.prototype,"state",void 0),v([M()],ju.prototype,"target",void 0),ju=v([fe("esri.views.ViewAnimation")],ju),function(e){e.State={RUNNING:"running",STOPPED:"stopped",FINISHED:"finished",WAITING_FOR_TARGET:"waiting-for-target"}}(ju||(ju={}));const pI=ju;function rh(e,t,i,r){const s=3*e,n=3*(i-e)-s,c=1-s-n,o=3*t,f=3*(r-t)-o,g=1-o-f;function S(z){return((c*z+n)*z+s)*z}function I(z){return((g*z+f)*z+o)*z}function A(z){return(3*c*z+2*n)*z+s}function O(z,V){let H,Q,ve,me,ge,Ie;for(ve=z,Ie=0;Ie<8;Ie++){if(me=S(ve)-z,Math.abs(me)Q)return Q;for(;Hme?H=ve:Q=ve,ve=.5*(Q-H)+H}return ve}return function(z,V=1e-6){return I(O(z,V))}}const hne=/^cubic-bezier\((.*)\)/,Yo={};function dne(e){let t=Yo[e]||null;if(!t){const i=hne.exec(e);if(i){const r=i[1].split(",").map(s=>parseFloat(s.trim()));r.length!==4||r.some(s=>isNaN(s))||(t=rh.apply(rh,r))}}return t}Yo.ease=rh(.25,.1,.25,1),Yo.linear=rh(0,0,1,1),Yo.easeIn=Yo["ease-in"]=rh(.42,0,1,1),Yo.easeOut=Yo["ease-out"]=rh(0,0,.58,1),Yo.easeInOut=Yo["ease-in-out"]=rh(.42,0,.58,1);function pne(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function fne(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function mne(e,t,i,r,s,n,c){return e[0]=t,e[1]=i,e[2]=r,e[3]=s,e[4]=n,e[5]=c,e}function U3(e,t){const i=t[0],r=t[1],s=t[2],n=t[3],c=t[4],o=t[5];let f=i*n-r*s;return f?(f=1/f,e[0]=n*f,e[1]=-r*f,e[2]=-s*f,e[3]=i*f,e[4]=(s*o-n*c)*f,e[5]=(r*c-i*o)*f,e):null}function yne(e){return e[0]*e[3]-e[1]*e[2]}function J8(e,t,i){const r=t[0],s=t[1],n=t[2],c=t[3],o=t[4],f=t[5],g=i[0],S=i[1],I=i[2],A=i[3],O=i[4],z=i[5];return e[0]=r*g+n*S,e[1]=s*g+c*S,e[2]=r*I+n*A,e[3]=s*I+c*A,e[4]=r*O+n*z+o,e[5]=s*O+c*z+f,e}function Xx(e,t,i){const r=t[0],s=t[1],n=t[2],c=t[3],o=t[4],f=t[5],g=Math.sin(i),S=Math.cos(i);return e[0]=r*S+n*g,e[1]=s*S+c*g,e[2]=r*-g+n*S,e[3]=s*-g+c*S,e[4]=o,e[5]=f,e}function j3(e,t,i){const r=t[0],s=t[1],n=t[2],c=t[3],o=t[4],f=t[5],g=i[0],S=i[1];return e[0]=r*g,e[1]=s*g,e[2]=n*S,e[3]=c*S,e[4]=o,e[5]=f,e}function r_(e,t,i){const r=t[0],s=t[1],n=t[2],c=t[3],o=t[4],f=t[5],g=i[0],S=i[1];return e[0]=r,e[1]=s,e[2]=n,e[3]=c,e[4]=r*g+n*S+o,e[5]=s*g+c*S+f,e}function K8(e,t){const i=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=i,e[2]=-i,e[3]=r,e[4]=0,e[5]=0,e}function X8(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e}function V3(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e}function gne(e){return"mat2d("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+")"}function _ne(e){return Math.sqrt(e[0]**2+e[1]**2+e[2]**2+e[3]**2+e[4]**2+e[5]**2+1)}function vne(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e[4]=t[4]+i[4],e[5]=t[5]+i[5],e}function Q8(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e[3]=t[3]-i[3],e[4]=t[4]-i[4],e[5]=t[5]-i[5],e}function bne(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*i,e[5]=t[5]*i,e}function wne(e,t,i,r){return e[0]=t[0]+i[0]*r,e[1]=t[1]+i[1]*r,e[2]=t[2]+i[2]*r,e[3]=t[3]+i[3]*r,e[4]=t[4]+i[4]*r,e[5]=t[5]+i[5]*r,e}function xne(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]}function Sne(e,t){const i=e[0],r=e[1],s=e[2],n=e[3],c=e[4],o=e[5],f=t[0],g=t[1],S=t[2],I=t[3],A=t[4],O=t[5],z=aa();return Math.abs(i-f)<=z*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(r-g)<=z*Math.max(1,Math.abs(r),Math.abs(g))&&Math.abs(s-S)<=z*Math.max(1,Math.abs(s),Math.abs(S))&&Math.abs(n-I)<=z*Math.max(1,Math.abs(n),Math.abs(I))&&Math.abs(c-A)<=z*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(o-O)<=z*Math.max(1,Math.abs(o),Math.abs(O))}const Tne=J8,Ene=Q8;Object.freeze(Object.defineProperty({__proto__:null,add:vne,copy:pne,determinant:yne,equals:Sne,exactEquals:xne,frob:_ne,fromRotation:K8,fromScaling:X8,fromTranslation:V3,identity:fne,invert:U3,mul:Tne,multiply:J8,multiplyScalar:bne,multiplyScalarAndAdd:wne,rotate:Xx,scale:j3,set:mne,str:gne,sub:Ene,subtract:Q8,translate:r_},Symbol.toStringTag,{value:"Module"}));function zc(){return[1,0,0,1,0,0]}function Mne(e){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function Ine(e,t,i,r,s,n){return[e,t,i,r,s,n]}function Ane(e,t){return new Float64Array(e,t,6)}const Pne=zc();Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:Pne,clone:Mne,create:zc,createView:Ane,fromValues:Ine},Symbol.toStringTag,{value:"Module"}));function s_(e,t){return e[0]=t[0],e[1]=t[1],e}function Cs(e,t,i){return e[0]=t,e[1]=i,e}function eB(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e}function n_(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e}function tB(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e}function iB(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e}function Cne(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}function $ne(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}function kne(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e}function Rne(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e}function One(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}function P_(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e}function Lne(e,t,i,r){return e[0]=t[0]+i[0]*r,e[1]=t[1]+i[1]*r,e}function Qx(e,t){const i=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(i*i+r*r)}function Uw(e,t){const i=t[0]-e[0],r=t[1]-e[1];return i*i+r*r}function jw(e){const t=e[0],i=e[1];return Math.sqrt(t*t+i*i)}function rB(e){const t=e[0],i=e[1];return t*t+i*i}function sB(e,t){return e[0]=-t[0],e[1]=-t[1],e}function Dne(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}function fI(e,t){const i=t[0],r=t[1];let s=i*i+r*r;return s>0&&(s=1/Math.sqrt(s),e[0]=t[0]*s,e[1]=t[1]*s),e}function nB(e,t){return e[0]*t[0]+e[1]*t[1]}function oB(e,t,i){const r=t[0]*i[1]-t[1]*i[0];return e[0]=e[1]=0,e[2]=r,e}function Nne(e,t,i,r){const s=t[0],n=t[1];return e[0]=s+r*(i[0]-s),e[1]=n+r*(i[1]-n),e}function zne(e,t){t=t||1;const i=2*Mx()*Math.PI;return e[0]=Math.cos(i)*t,e[1]=Math.sin(i)*t,e}function Fne(e,t,i){const r=t[0],s=t[1];return e[0]=i[0]*r+i[2]*s,e[1]=i[1]*r+i[3]*s,e}function La(e,t,i){const r=t[0],s=t[1];return e[0]=i[0]*r+i[2]*s+i[4],e[1]=i[1]*r+i[3]*s+i[5],e}function Bne(e,t,i){const r=t[0],s=t[1];return e[0]=i[0]*r+i[3]*s+i[6],e[1]=i[1]*r+i[4]*s+i[7],e}function Une(e,t,i){const r=t[0],s=t[1];return e[0]=i[0]*r+i[4]*s+i[12],e[1]=i[1]*r+i[5]*s+i[13],e}function jne(e,t,i,r){const s=t[0]-i[0],n=t[1]-i[1],c=Math.sin(r),o=Math.cos(r);return e[0]=s*o-n*c+i[0],e[1]=s*c+n*o+i[1],e}function Vne(e,t){const i=e[0],r=e[1],s=t[0],n=t[1];let c=i*i+r*r;c>0&&(c=1/Math.sqrt(c));let o=s*s+n*n;o>0&&(o=1/Math.sqrt(o));const f=(i*s+r*n)*c*o;return f>1?0:f<-1?Math.PI:Math.acos(f)}function Gne(e){return"vec2("+e[0]+", "+e[1]+")"}function qne(e,t){return e[0]===t[0]&&e[1]===t[1]}function Hne(e,t){const i=e[0],r=e[1],s=t[0],n=t[1],c=aa();return Math.abs(i-s)<=c*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(r-n)<=c*Math.max(1,Math.abs(r),Math.abs(n))}function Wne(e,t,i,r,s){let n=t[0]-i[0],c=t[1]-i[1];const o=(r[0]*n+r[1]*c)*(s-1);return n=r[0]*o,c=r[1]*o,e[0]=t[0]+n,e[1]=t[1]+c,e}const Zne=jw,G3=n_,Yne=tB,Jne=iB,Kne=Qx,Xne=Uw,Qne=rB;Object.freeze(Object.defineProperty({__proto__:null,add:eB,angle:Vne,ceil:Cne,copy:s_,cross:oB,dist:Kne,distance:Qx,div:Jne,divide:iB,dot:nB,equals:Hne,exactEquals:qne,floor:$ne,inverse:Dne,len:Zne,length:jw,lerp:Nne,max:Rne,min:kne,mul:Yne,multiply:tB,negate:sB,normalize:fI,projectAndScale:Wne,random:zne,rotate:jne,round:One,scale:P_,scaleAndAdd:Lne,set:Cs,sqrDist:Xne,sqrLen:Qne,squaredDistance:Uw,squaredLength:rB,str:Gne,sub:G3,subtract:n_,transformMat2:Fne,transformMat2d:La,transformMat3:Bne,transformMat4:Une},Symbol.toStringTag,{value:"Module"}));function Vr(){return[0,0]}function eoe(e){return[e[0],e[1]]}function C_(e,t){return[e,t]}function toe(e,t=Vr()){const i=Math.min(2,e.length);for(let r=0;rloe({item:c},t,i).item);else if(typeof n=="object")if(n.toJSON){const c=n.toJSON(i==null?void 0:i[s]);r[s]=t?c:JSON.stringify(c)}else r[s]=t?n:JSON.stringify(n);else r[s]=n}return r}async function coe(e,t,i,r){const s=aoe(e),n=t[0].spatialReference,c={...r,responseType:"json",query:{...s.query,f:"json",sr:rN(n),target:JSON.stringify({geometryType:qA(t[0]),geometries:t}),cutter:JSON.stringify(i)}},o=await Qi(s.path+"/cut",c),{cutIndexes:f,geometries:g=[]}=o.data;return{cutIndexes:f,geometries:g.map(S=>{const I=km(S);return I.spatialReference=n,I})}}function uoe(e){return{geometryType:qA(e[0]),geometries:e.map(t=>t.toJSON())}}function hoe(e,t,i){const r=yK(t);return e.map(s=>{const n=r.fromJSON(s);return n.spatialReference=i,n})}async function doe(e,t,i){const r=typeof e=="string"?Rr(e):e,s=t[0].spatialReference,n=qA(t[0]),c={...i,query:{...r.query,f:"json",sr:rN(s),geometries:JSON.stringify(uoe(t))}},{data:o}=await Qi(r.path+"/simplify",c);return hoe(o.geometries,n,s)}const dB=()=>_t.getLogger("esri.geometry.support.normalizeUtils");function poe(e){return e.type==="polygon"}function foe(e){return e[0].type==="polygon"}function moe(e){return e[0].type==="polyline"}function UR(e){const t=[];let i=0,r=0;for(let s=0;s1){for(let ve=1;ve<=z-1;ve++){const me=ve*t,ge=O*me+o,Ie=A*me+f;n.push([ge,Ie])}const V=(I+Math.floor(z-1)*t)/2,H=O*V+o,Q=A*V+f;n.push([H,Q])}n.push([g,S])}}return poe(e)?new yh({rings:r,spatialReference:e.spatialReference}):new Ua({paths:r,spatialReference:e.spatialReference})}function jR(e,t,i){if(t){const r=yoe(e,1e6);e=im(r,!0)}return i&&(e=hB(e,i)),e}function VR(e,t,i){if(Array.isArray(e)){const r=e[0];if(r>t){const s=rp(r,t);e[0]=r+s*(-2*t)}else if(rt){const s=rp(r,t);e=e.clone().offset(s*(-2*t),0)}else if(r{if(g[0]<180)return!0;{let S=0;for(let A=0;AS?O:S}S=Number(S.toFixed(9));const I=-360*rp(S,180);for(let A=0;AVR(Ce,o,f)),z.push(Ie)}else if(ge.type==="extent"){const Ie=ge.clone()._normalize(!1,!1,n);z.push(Ie.rings?new yh(Ie):Ie)}else if(ge.extent){const Ie=ge.extent,Ce=rp(Ie.xmin,f)*(2*o);let ze=Ce===0?ge.clone():hB(ge.clone(),Ce);Ie.offset(Ce,0),Ie.intersects(S)&&Ie.xmax!==o?(A=Ie.xmax>A?Ie.xmax:A,ze=jR(ze,c),O.push(ze),z.push("cut")):Ie.intersects(I)&&Ie.xmin!==f?(A=Ie.xmax*(2*o)>A?Ie.xmax*(2*o):A,ze=jR(ze,c,360),O.push(ze),z.push("cut")):z.push(ze)}else z.push(ge.clone());else z.push(ge);else z.push(ge);let V=rp(A,o),H=-90;const Q=V,ve=new Ua;for(;V>0;){const ge=360*V-180;ve.addPath([[ge,H],[ge,-1*H]]),H*=-1,V--}if(O.length>0&&Q>0){const ge=goe(O,await coe(r,O,ve,i)),Ie=[],Ce=[];for(let tt=0;tt1&&ot.rings.length>=et.rings.length?(Ie.push(ot),Ce.push("simplify")):Ce.push(c?Nc(ot):ot)}}if(!Ie.length)return Ce;const ze=await doe(r,Ie,i),je=[];for(let tt=0;ttn||fs)return t;switch(e.type){case"polygon":if(!(e.rings.length>1))return t;o=UR(e.rings);break;case"polyline":if(!(e.paths.length>1))return t;o=UR(e.paths);break;case"multipoint":o=e.points}const S=t.clone();for(let I=0;In?o=Math.ceil(Math.abs(t-n)/c):tn?f=Math.ceil(Math.abs(e-n)/c):en?g-=c:Ss)for(;e>s;)e-=n}return e}const fB=96,mB=39.37,boe=180/Math.PI;function yB(e){return e.wkid?e:e.spatialReference||yi.WGS84}function q3(e,t){return t.type?Cs(e,t.x,t.y):s_(e,t)}function gB(e){return $p(e)}function _m(e,t,i=0){let r=e.width,s=e.height;if(i!==0){const o=NN(i),f=Math.abs(Math.cos(o)),g=Math.abs(Math.sin(o));r=e.width*f+e.height*g,s=e.width*g+e.height*f}const n=Math.max(1,t[0]),c=Math.max(1,t[1]);return Math.max(r/n,s/c)*Poe(e.spatialReference)}async function s0(e,t,i,r){var o,f;let s,n;if(!e||Array.isArray(e)&&!e.length)return null;if(Bt.isCollection(e)&&(e=e.toArray()),Array.isArray(e)&&e.length&&typeof e[0]=="object"){const g=e.every(A=>"attributes"in A),S=e.some(A=>!A.geometry);let I=e;if(g&&S&&t&&t.allLayerViews){const A=new Map;for(const H of e){const Q=H.layer,ve=A.get(Q)||[],me=H.attributes[Q.objectIdField];me!=null&&ve.push(me),A.set(Q,ve)}const O=[];A.forEach((H,Q)=>{const ve=t.allLayerViews.find(me=>me.layer.id===Q.id);if(ve&&"queryFeatures"in ve){const me=Q.createQuery();me.objectIds=H,me.returnGeometry=!0,O.push(ve.queryFeatures(me))}});const z=await Promise.all(O),V=[];for(const H of z)if(H&&H.features&&H.features.length)for(const Q of H.features)Q.geometry!=null&&V.push(Q.geometry);I=V}for(const A of I)r=await s0(A,t,i,r);return r}if(Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number")s=new ri(e);else if(e instanceof Th)s=e;else if("geometry"in e){if(e.geometry)s=e.geometry;else if(e.layer){const g=e.layer,S=t.allLayerViews.find(I=>I.layer.id===g.id);if(S&&"queryFeatures"in S){const I=g.createQuery();I.objectIds=[e.attributes[g.objectIdField]],I.returnGeometry=!0;const A=await S.queryFeatures(I);s=(f=(o=A==null?void 0:A.features)==null?void 0:o[0])==null?void 0:f.geometry}}}if(s==null)return null;switch(s.type){case"point":n=new Ui({xmin:s.x,ymin:s.y,xmax:s.x,ymax:s.y,spatialReference:s.spatialReference});break;case"extent":case"multipoint":case"polygon":case"polyline":n=voe(s);break;default:n=s.extent}if(!n)return null;Ah()||Nl(n.spatialReference,i)||await bh();const c=Ph(n,i);return c?r=r?r.union(c):c:null}function woe(e){var t;if(e&&(!Array.isArray(e)||typeof e[0]!="number")&&(typeof e=="object"||Array.isArray(e)&&typeof e[0]=="object")){if("layer"in e&&((t=e.layer)==null?void 0:t.minScale)!=null&&e.layer.maxScale!=null){const i=e.layer;return{min:i.minScale,max:i.maxScale}}if(Array.isArray(e)&&e.length&&e.every(i=>"layer"in i)){let i=0,r=0;for(const s of e){const n=s.layer;n!=null&&n.minScale&&n.maxScale&&(i=n.minScaler?n.maxScale:r)}return i&&r?{min:i,max:r}:null}}}function sT(e,t){return Js(yB(e),t)?e:Ph(e,t)}async function xoe(e,t){var H;if(!e||!t)return new kl({targetGeometry:new ri,scale:0,rotation:0});let i=t.spatialReference;const{constraints:r,padding:s,viewpoint:n,size:c}=t,o=[s?c[0]-s.left-s.right:c[0],s?c[1]-s.top-s.bottom:c[1]];let f=null;e instanceof kl?f=e:e.viewpoint?f=e.viewpoint:e.target&&e.target.declaredClass==="esri.Viewpoint"&&(f=e.target);let g=null;f!=null&&f.targetGeometry?g=f.targetGeometry:e instanceof Ui?g=e:(e||e&&("center"in e||"extent"in e||"target"in e))&&(g=await s0(e.center,t,i)||await s0(e.extent,t,i)||await s0(e.target,t,i)||await s0(e,t,i)),!g&&(n!=null&&n.targetGeometry)?g=n.targetGeometry:!g&&t.extent&&(g=t.extent),i||(i=yB(t.spatialReference||t.extent||g)),Ah()||Js(g.spatialReference,i)||Nl(g.spatialReference,i)||await bh();const S=sT(g,i),I="center"in S?S.center:S;t.pickClosestTarget!==!1&&I.type==="point"&&((H=n.targetGeometry)==null?void 0:H.type)==="point"&&(I.x=pB(I.x,n.targetGeometry.x,I.spatialReference));let A=0;f?A=f.rotation:e.hasOwnProperty("rotation")?A=e.rotation:n&&(A=n.rotation);let O=0;if((f==null?void 0:f.targetGeometry)!=null&&f.targetGeometry.type==="point")O=f.scale;else if("scale"in e&&e.scale)O=e.scale;else if("zoom"in e&&e.zoom!==-1&&r&&r.effectiveLODs)O=r.zoomToScale(e.zoom);else if(Array.isArray(g)||g.type==="point"||g.type==="extent"&&g.width===0&&g.height===0){const Q=sT(t.extent,i);O=Q!=null?_m(Q,o,A):t.extent?_m(t.extent,o,A):n.scale}else O=_m(sT(g.extent,i),o,A);const z=woe(e.target??e);z&&(z.min&&z.minO&&(O=z.max));let V=new kl({targetGeometry:I,scale:O,rotation:A});return r&&(V=r.fit(V),r.constrainByGeometry(V),r.rotationEnabled||(V.rotation=n.rotation)),V}function Qa(e,t){const i=e.targetGeometry,r=t.targetGeometry;return i.x=r.x,i.y=r.y,i.spatialReference=r.spatialReference,e.scale=t.scale,e.rotation=t.rotation,e}function Soe(e,t,i){return i?Cs(e,.5*(t[0]-i.right+i.left),.5*(t[1]-i.bottom+i.top)):P_(e,t,.5)}const Toe=function(){const e=Vr();return function(t,i,r){const s=i.targetGeometry;q3(e,s);const n=.5*Km(i);return t.xmin=e[0]-n*r[0],t.ymin=e[1]-n*r[1],t.xmax=e[0]+n*r[0],t.ymax=e[1]+n*r[1],t.spatialReference=s.spatialReference,t}}();function Eoe(e,t,i,r,s){var n;return mI(e,t,i.center),e.scale=_m(i,r),(n=s==null?void 0:s.constraints)==null||n.constrain(e),e}function Moe(e,t,i,r){return Z3(e,t,i,r),U3(e,e)}const _B=function(){const e=Vr();return function(t,i,r){return G3(t,Coe(t,i),Soe(e,i,r))}}(),Ioe=function(){const e=zc(),t=Vr();return function(i,r,s,n){const c=Km(r),o=H3(r);return Cs(t,c,c),X8(e,t),Xx(e,e,o),r_(e,e,_B(t,s,n)),r_(e,e,[0,n.top-n.bottom]),Cs(i,e[4],e[5])}}();function Km(e){return e.scale*Aoe(e.targetGeometry)}function Aoe(e){return e!=null&&Ba(e.spatialReference)?1/(gB(e.spatialReference)*mB*fB):1}function H3(e){return FA(e.rotation)||0}function Poe(e){return Ba(e)?gB(e)*mB*fB:1}function Coe(e,t){return P_(e,t,.5)}const W3=function(){const e=Vr(),t=Vr(),i=Vr();return function(r,s,n,c,o,f){return sB(e,s),P_(t,n,.5*f),Cs(i,1/c*f,-1/c*f),V3(r,t),o&&Xx(r,r,o),j3(r,r,i),r_(r,r,e),r}}(),Z3=function(){const e=Vr();return function(t,i,r,s){const n=Km(i),c=H3(i);return q3(e,i.targetGeometry),W3(t,e,r,n,c,s)}}(),$oe=function(){const e=Vr();return function(t,i,r,s){const n=Km(i);return q3(e,i.targetGeometry),W3(t,e,r,n,0,s)}}();function koe(e){const t=ro(e);return t?t.valid[1]-t.valid[0]:0}function Roe(e,t){return Math.round(koe(e)/t)}const Ooe=function(){const e=Vr(),t=Vr(),i=[0,0,0];return function(r,s,n){n_(e,r,s),fI(e,e),n_(t,r,n),fI(t,t),oB(i,e,t);let c=Math.acos(nB(e,t)/(jw(e)*jw(t)))*boe;return i[2]<0&&(c=-c),isNaN(c)&&(c=0),c}}(),Loe=function(){const e=Vr();return function(t,i,r,s){const n=t.targetGeometry;return Qa(t,i),Ioe(e,i,r,s),n.x+=e[0],n.y+=e[1],t}}(),mI=function(e,t,i){Qa(e,t);const r=e.targetGeometry;return r.x=i.x,r.y=i.y,r.spatialReference=i.spatialReference,e},Doe=function(){const e=Vr();return function(t,i,r,s,n){n||(n="center"),G3(e,r,s),P_(e,e,.5);const c=e[0],o=e[1];switch(n){case"center":Cs(e,0,0);break;case"left":Cs(e,-c,0);break;case"top":Cs(e,0,o);break;case"right":Cs(e,c,0);break;case"bottom":Cs(e,0,-o);break;case"top-left":Cs(e,-c,o);break;case"bottom-left":Cs(e,-c,-o);break;case"top-right":Cs(e,c,o);break;case"bottom-right":Cs(e,c,-o)}return e2(t,i,e),t}}();function M1e(e,t,i){return Qa(e,t),e.rotation+=i,e}function Noe(e,t,i){return Qa(e,t),e.rotation=i,e}const zoe=function(){const e=Vr();return function(t,i,r,s,n){return Qa(t,i),isNaN(r)||r===0||(bB(e,s,i,n),t.scale=i.scale*r,wB(e,e,t,n),e2(t,t,Cs(e,e[0]-s[0],s[1]-e[1]))),t}}();function GR(e,t,i){return Qa(e,t),e.scale=i,e}const vB=function(){const e=Vr();return function(t,i,r,s,n,c){return Qa(t,i),isNaN(r)||r===0||(bB(e,n,i,c),t.scale=i.scale*r,t.rotation+=s,wB(e,e,t,c),e2(t,t,Cs(e,e[0]-n[0],n[1]-e[1]))),t}}(),I1e=function(){const e=Vr(),t=Vr();return function(i,r,s,n,c,o,f){return _B(t,o,f),eB(e,c,t),n?vB(i,r,s,n,e,o):zoe(i,r,s,e,o)}}(),bB=function(){const e=zc();return function(t,i,r,s){return La(t,i,Moe(e,r,s,1))}}(),wB=function(){const e=zc();return function(t,i,r,s){return La(t,i,Z3(e,r,s,1))}}(),e2=function(){const e=Vr(),t=zc();return function(i,r,s){Qa(i,r);const n=Km(r),c=i.targetGeometry;return K8(t,H3(r)),j3(t,t,C_(n,n)),La(e,s,t),c.x+=e[0],c.y+=e[1],i}}();let Foe=class{constructor(t,i,r,s){const n=t.targetGeometry,c=i.targetGeometry;s?typeof s=="string"&&(s=dne(s)||Yo.ease):s=Yo.ease,this.easing=s,this.duration=r,this.sCenterX=n.x,this.sCenterY=n.y,this.sScale=t.scale,this.sRotation=t.rotation,this.tCenterX=c.x,this.tCenterY=c.y,this.tScale=i.scale,this.tRotation=i.rotation,this.dCenterX=this.tCenterX-this.sCenterX,this.dCenterY=this.tCenterY-this.sCenterY,this.dScale=this.tScale-this.sScale,this.dRotation=this.tRotation-this.sRotation,this.dRotation>180?this.dRotation-=360:this.dRotation<-180&&(this.dRotation+=360)}applyRatio(t,i){const r=this.easing(i);let s,n,c,o;i>=1?(s=this.tCenterX,n=this.tCenterY,c=this.tRotation,o=this.tScale):(s=this.sCenterX+r*this.dCenterX,n=this.sCenterY+r*this.dCenterY,c=this.sRotation+r*this.dRotation,o=this.sScale+r*this.dScale),t.targetGeometry.x=s,t.targetGeometry.y=n,t.scale=o,t.rotation=c}},Vu=class extends Nt{constructor(t){super(t),this._animation=null,this.updateFunction=null,this.duration=200,this.transition=null,this.easing=Yo.ease,this.view=null,this.viewpoint=new kl({targetGeometry:new ri,scale:0,rotation:0}),this._updateTask=Mm({postRender:this._postRender.bind(this)}),this._updateTask.pause()}destroy(){this._updateTask=Sr(this._updateTask)}get animation(){return this._animation}set animation(t){this._animation=t,this.view&&(this.view.animation=t)}animate(t,i,r){this.stop();const s=this.viewpoint;Qa(s,i),this.transition=new Foe(this.viewpoint,t.target,(r==null?void 0:r.duration)||this.duration,(r==null?void 0:r.easing)||this.easing);const n=()=>{var c,o;this.animation===t&&this._updateTask&&(t.state==="finished"&&((c=this.transition)==null||c.applyRatio(this.viewpoint,1),(o=this.view)!=null&&o.state&&(this.view.state.viewpoint=this.viewpoint.clone())),this.animation=null,this.updateFunction=null)};return t.when(n,n),this._startTime=performance.now(),this._updateTask.resume(),this.animation=t,t}animateContinous(t,i){this.stop(),this.updateFunction=i,this.viewpoint=t;const r=new pI({target:t.clone()}),s=()=>{this.animation===r&&this._updateTask&&(this.animation=null,this.updateFunction=null)};return r.when(s,s),this._startTime=performance.now(),this._updateTask.resume(),this.animation=r,r}stop(){this.animation&&(this.animation.stop(),this.animation=null,this.updateFunction=null)}_postRender(t){var r,s;const i=this.animation;if(i&&i.state!==pI.State.STOPPED){if(this.updateFunction)this.updateFunction(this.viewpoint,t.deltaTime);else{const n=this.transition,c=(performance.now()-this._startTime)/n.duration,o=c>=1;n.applyRatio(this.viewpoint,c),o&&((r=this.animation)==null||r.finish())}(s=this.view)!=null&&s.state&&(this.view.state.viewpoint=this.viewpoint.clone())}else this._updateTask.pause()}};v([M()],Vu.prototype,"duration",void 0),v([M()],Vu.prototype,"transition",void 0),v([M()],Vu.prototype,"easing",void 0),v([M()],Vu.prototype,"view",void 0),v([M()],Vu.prototype,"viewpoint",void 0),Vu=v([fe("esri.views.2d.AnimationManager")],Vu);const Boe=Vu;let Uoe=class{constructor(t){this.view=t,this._stationaryHandle=null,this._frameTaskHandle=null,this._updateParameters=null,this._updateRequested=!1,this.stationary=!0,this.animationInProgress=!1,this.prepare=()=>{this._updateParameters&&(this._updateParameters.state=this.view.state,this._updateParameters.stationary=this.view.stationary,this._updateParameters.pixelRatio=window.devicePixelRatio,this._updateParameters.renderingOptions=this.view.renderingOptions)},this.update=()=>{var c,o;if(this._updateRequested=!1,(c=this.view)==null?void 0:c.destroyed)return;const{allLayerViews:i,graphicsView:r,labelManager:s,state:{id:n}}=this.view;i.forEach(this._updateLayerView,this),s!=null&&(s.lastUpdateId!==n&&(s.viewChange(),s.lastUpdateId=n),s.updateRequested&&s.processUpdate(this._updateParameters)),r!=null&&(r.lastUpdateId!==n&&(r.viewChange(),r.lastUpdateId=n),r.updateRequested&&r.processUpdate(this._updateParameters)),this.view.graphicsTileStore.setViewState(this._updateParameters.state),this.animationInProgress||this._updateRequested||((o=this._frameTaskHandle)==null||o.pause())}}destroy(){this.stop()}start(){if(this._frameTaskHandle)return;const t=this.view;this.stationary=t.stationary,this._updateParameters={state:t.state,pixelRatio:window.devicePixelRatio,stationary:this.stationary,renderingOptions:t.renderingOptions},this._stationaryHandle=ti(()=>t.stationary,i=>{this.stationary=i,this.requestFrame()}),this._frameTaskHandle=Mm(this),this.requestUpdate()}stop(){var t;this._frameTaskHandle&&(this._updateRequested=!1,(t=this._stationaryHandle)==null||t.remove(),this._frameTaskHandle.remove(),this._updateParameters=this._stationaryHandle=this._frameTaskHandle=null,this.stationary=!0,this.animationInProgress=!1)}requestUpdate(){this._updateRequested||(this._updateRequested=!0,this.requestFrame())}requestFrame(){this._frameTaskHandle&&this._frameTaskHandle.resume()}_updateLayerView(t){var s;if(!t.attached)return void this.requestUpdate();const i=this.view.state,r=t.lastUpdateId;r!=null&&(this.stationary||t.moving)||(t.moving=!0,t.moveStart()),r!==i.id&&t.viewChange(),this.stationary&&t.moving&&(t.moving=!1,t.moveEnd()),t.lastUpdateId=i.id,t.updateRequested&&t.processUpdate(this._updateParameters),"layerViews"in t&&((s=t.layerViews)==null||s.forEach(this._updateLayerView,this))}},Ib=class extends Nt{constructor(t){super(t),this._gotoTask=null}destroy(){this._gotoTask=null}async goTo(t,i){if(!t)return void _t.getLogger(this).error("#goTo()","target cannot be null or undefined");const r=new pI;this.view.animation=r,await $x(()=>this.view.ready,i);const s={animate:!0,...i},{extent:n,spatialReference:c,size:o,viewpoint:f,constraints:g,padding:S,allLayerViews:I}=this.view,A=xoe(t,{extent:n,spatialReference:c,size:o,viewpoint:f,constraints:g,padding:S,allLayerViews:I,pickClosestTarget:(i==null?void 0:i.pickClosestTarget)??!0});return r==null||r.update(A),this._gotoTask={},s.animate?this._gotoAnimated(A,s):this._gotoImmediate(A,s)}_gotoImmediate(t,i){const r=this._gotoTask,s=this.view.animation,n=t.then(c=>{if(mr(i),r!==this._gotoTask)throw new Je("view:goto-interrupted","Goto was interrupted");this.view.viewpoint=s.target=c,s.finish()});return this._cancellableGoTo(r,s,n,i)}_gotoAnimated(t,i){const r=this._gotoTask,s=this.view.animation;if(!s)return Promise.resolve();const n=t.then(c=>{if(mr(i),r!==this._gotoTask)throw new Je("view:goto-interrupted","Goto was interrupted");return s.update(c),this.view.animationManager.animate(s,this.view.viewpoint,i),s.when().then(()=>{},()=>{})});return this._cancellableGoTo(r,s,n,i)}_cancellableGoTo(t,i,r,s){const n=()=>t===this._gotoTask;return yG(r,s).finally(()=>{n()&&(i.done||i.stop())})}};v([M({constructOnly:!0})],Ib.prototype,"view",void 0),Ib=v([fe("esri.views.2d.GoToManager")],Ib);function ar(){return Promise.all([ht(()=>import("./webglDeps-Cjw3mzdd.js"),__vite__mapDeps([164,75,74,165,166])),ht(()=>import("./mapViewDeps-B6Hg404o.js"),__vite__mapDeps([167,76,77,78,22,79,80,73,74,75,81,38,82,43,83,84,127,11,168,169,170,171,166,114,24,25,164,165,172,88,173,72,34,32,31,28,19,71,174,175,176,177,178,179,61,180,181,182,183,184,185,186,187,91,188]))])}const Sg=()=>ar().then(()=>ht(()=>import("./TileLayerView2D-CoWYvoLX.js"),__vite__mapDeps([189,76,77,78,22,79,80,73,74,75,81,38,82,43,83,84,127,11,169,170,171,166,114,24,25,172,88,173,72,34,32,31,28,19,71,61,181,175,176,182,183,91,190,191,187,192,193,194,185,186,195,196,197,198,199]))),If=()=>ar().then(()=>ht(()=>import("./FeatureLayerView2D-B6lIa9Lt.js").then(e=>e.F),__vite__mapDeps([200,71,170,83,74,137,129,192,193,186,76,77,78,22,79,80,73,75,81,38,82,43,84,187,171,166,114,24,25,85,122,147,154,144,124,12,168,169,181,201,197,199,195]))),qR={"base-dynamic":()=>ar().then(()=>ht(()=>import("./BaseDynamicLayerView2D-DSmk7XW5.js"),__vite__mapDeps([202,203,171,73,74,75,166,170,83,114,78,24,22,25,192,193,204,191,195]))),"base-tile":Sg,"bing-maps":Sg,catalog:()=>ar().then(()=>ht(()=>import("./CatalogLayerView2D-d-xBXyF9.js"),__vite__mapDeps([205,192,193,170,83,74]))),"catalog-dynamic-group":()=>ar().then(()=>ht(()=>import("./CatalogDynamicGroupLayerView2D-CyoAbf0b.js"),__vite__mapDeps([206,192,193,170,83,74]))),"catalog-footprint":()=>ar().then(()=>ht(()=>import("./CatalogFootprintLayerView2D-KePfoiS2.js"),__vite__mapDeps([207,200,71,170,83,74,137,129,192,193,186,76,77,78,22,79,80,73,75,81,38,82,43,84,187,171,166,114,24,25,85,122,147,154,144,124,12,168,169,181,201,197,199,195]))),csv:If,"geo-rss":()=>ar().then(()=>ht(()=>import("./GeoRSSLayerView2D-DvkynA-l.js"),__vite__mapDeps([208,120,121,93,71,101,122,123,124,125,126,34,32,127,79,11,12,129,192,193,170,83,74,184,185,186,76,77,78,22,80,73,75,81,38,82,43,84,187,171,166,114,24,25,181,91,182,72,31,28,19,183]))),feature:If,geojson:If,graphics:()=>ar().then(()=>ht(()=>import("./GraphicsLayerView2D-CtKxPbzt.js"),__vite__mapDeps([209,83,192,193,170,74,184,185,186,76,77,78,22,79,80,73,75,81,38,82,43,84,187,171,166,114,24,25,181,91,182,34,32,127,11,72,31,28,19,71,183,201]))),group:()=>ar().then(()=>ht(()=>import("./GroupLayerView2D-BVygDtT5.js"),__vite__mapDeps([210,192,193,170,83,74]))),imagery:()=>ar().then(()=>ht(()=>import("./ImageryLayerView2D-Cd1bppq2.js"),__vite__mapDeps([211,212,75,74,166,98,171,73,170,83,114,78,24,22,25,192,193,182,34,32,76,77,79,80,81,38,82,43,84,127,11,72,31,28,19,71,181,183,194,185,186,187,91,203,191,204,102,199,195]))),"imagery-tile":()=>ar().then(()=>ht(()=>import("./ImageryTileLayerView2D-DAJXGdeV.js"),__vite__mapDeps([213,214,212,75,74,166,98,171,73,170,83,114,78,24,22,25,192,193,215,187,216,102,199,195]))),kml:()=>ar().then(()=>ht(()=>import("./KMLLayerView2D-BTxXwgAN.js"),__vite__mapDeps([217,218,120,121,93,71,101,122,123,124,125,126,34,32,127,79,11,12,129,191,170,83,74,203,171,73,75,166,114,78,24,22,25,192,193,184,185,186,76,77,80,81,38,82,43,84,187,181,91,182,72,31,28,19,183,102,174,164,165,175,176,173,169,177,215]))),"knowledge-graph":()=>ar().then(()=>ht(()=>import("./KnowledgeGraphLayerView2D-DZm8ubx6.js"),__vite__mapDeps([219,192,193,170,83,74]))),"link-chart":()=>ar().then(()=>ht(()=>import("./KnowledgeGraphLayerView2D-DZm8ubx6.js"),__vite__mapDeps([219,192,193,170,83,74]))),"knowledge-graph-sublayer":If,"map-image":()=>ar().then(()=>ht(()=>import("./MapImageLayerView2D-Cq7vZ1xD.js"),__vite__mapDeps([220,203,171,73,74,75,166,170,83,114,78,24,22,25,192,193,182,34,32,76,77,79,80,81,38,82,43,84,127,11,72,31,28,19,71,181,183,194,185,186,187,91,204,191,221,197,198,195,196,199]))),"map-notes":()=>ar().then(()=>ht(()=>import("./MapNotesLayerView2D-DgCKO3Zc.js"),__vite__mapDeps([222,83,192,193,170,74,184,185,186,76,77,78,22,79,80,73,75,81,38,82,43,84,187,171,166,114,24,25,181,91,182,34,32,127,11,72,31,28,19,71,183]))),media:()=>ar().then(()=>ht(()=>import("./MediaLayerView2D-CfaV01hI.js"),__vite__mapDeps([223,121,93,71,101,122,123,124,125,120,126,34,32,127,79,11,12,224,183,53,76,77,78,22,80,73,74,75,81,38,82,43,83,84,169,170,171,166,114,24,25,172,88,173,72,31,28,19,61,181,175,176,182,91,180,192,193]))),"ogc-feature":()=>ar().then(()=>ht(()=>import("./OGCFeatureLayerView2D-BT1AiNl1.js"),__vite__mapDeps([225,200,71,170,83,74,137,129,192,193,186,76,77,78,22,79,80,73,75,81,38,82,43,84,187,171,166,114,24,25,85,122,147,154,144,124,12,168,169,181,201,197,199,195]))),"open-street-map":Sg,"oriented-imagery":If,route:()=>ar().then(()=>ht(()=>import("./RouteLayerView2D-CjJummeL.js"),__vite__mapDeps([226,227,83,192,193,170,74,184,185,186,76,77,78,22,79,80,73,75,81,38,82,43,84,187,171,166,114,24,25,181,91,182,34,32,127,11,72,31,28,19,71,183]))),stream:()=>ar().then(()=>ht(()=>import("./StreamLayerView2D-DqZHXc4V.js"),__vite__mapDeps([228,129,200,71,170,83,74,137,192,193,186,76,77,78,22,79,80,73,75,81,38,82,43,84,187,171,166,114,24,25,85,122,147,154,144,124,12,168,169,181,201,197,199,195]))),"subtype-group":()=>ar().then(()=>ht(()=>import("./SubtypeGroupLayerView2D-DykSTPs3.js"),__vite__mapDeps([229,200,71,170,83,74,137,129,192,193,186,76,77,78,22,79,80,73,75,81,38,82,43,84,187,171,166,114,24,25,85,122,147,154,144,124,12,168,169,181,201,197,199,195]))),tile:Sg,"vector-tile":()=>ar().then(()=>ht(()=>import("./VectorTileLayerView2D-BLrO1BgS.js"),__vite__mapDeps([230,71,80,74,61,179,169,84,75,166,114,171,73,170,83,78,24,22,25,187,27,115,192,193]))),video:()=>ar().then(()=>ht(()=>import("./VideoLayerView2D-Vkk8l0f8.js"),__vite__mapDeps([231,232,192,193,170,83,74,184,185,186,76,77,78,22,79,80,73,75,81,38,82,43,84,187,171,166,114,24,25,181,91,182,34,32,127,11,72,31,28,19,71,183]))),wcs:()=>ar().then(()=>ht(()=>import("./ImageryTileLayerView2D-DAJXGdeV.js"),__vite__mapDeps([213,214,212,75,74,166,98,171,73,170,83,114,78,24,22,25,192,193,215,187,216,102,199,195]))),"web-tile":Sg,wfs:If,wms:()=>ar().then(()=>ht(()=>import("./WMSLayerView2D-BHemqaDF.js"),__vite__mapDeps([233,203,171,73,74,75,166,170,83,114,78,24,22,25,192,193,204,191,195,234]))),wmts:()=>ar().then(()=>ht(()=>import("./WMTSLayerView2D-D7P1L341.js"),__vite__mapDeps([235,190,191,170,83,74,171,73,75,166,114,78,24,22,25,187,192,193,195]))),"line-of-sight":null,"base-elevation":null,"building-scene":null,dimension:null,elevation:null,"integrated-mesh":null,"integrated-mesh-3dtiles":null,"point-cloud":null,voxel:null,scene:null,unknown:null,unsupported:null};function joe(e){const t=e.declaredClass?e.declaredClass.slice(e.declaredClass.lastIndexOf(".")+1):"Unknown",i=t.replaceAll(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new Je(`${i}:view-not-supported`,`${t} is not supported in 2D`)}const HR={hasLayerViewModule:e=>qR[e.type]!=null,importLayerView:e=>{const t=qR[e.type];if(t==null)throw joe(e);return t(e)}};function Voe(e,t){const{spatialReference:i}=t,r=[t.x,t.y];let s=Number.POSITIVE_INFINITY,n=0,c=0;const o=[0,0],f=e.type==="extent"?[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]:e.rings;for(const g of f)for(let S=0;SS.clone()),t.sort((S,I)=>I.scale-S.scale),t.forEach((S,I)=>S.level=I);for(const S of t)!f&&i>0&&i>=S.scale&&(c=S.level,f=!0),!g&&r>0&&r>=S.scale&&(o=e?e.level:-1,g=!0),e=S;s===-1&&(s=i===0?0:c),n===-1&&(n=r===0?t.length-1:o),s=Math.max(s,0),s=Math.min(s,t.length-1),n=Math.max(n,0),n=Math.min(n,t.length-1),s>n&&([s,n]=[n,s]),i=t[s].scale,r=t[n].scale,t.splice(0,s),t.splice(n-s+1,t.length),t.forEach((S,I)=>{this._lodByScale[S.scale]=S,this._scales[I]=S.scale}),this._set("effectiveLODs",t),this._set("effectiveMinZoom",s),this._set("effectiveMaxZoom",n),this._set("effectiveMinScale",i),this._set("effectiveMaxScale",r)}constrain(e,t){if(t&&e.scale===t.scale)return e;const i=this.effectiveMinScale,r=this.effectiveMaxScale,s=e.targetGeometry,n=t&&t.targetGeometry,c=r!==0&&e.scalei;if(c||o){const f=o?i:r;if(t&&n){const g=(f-t.scale)/(e.scale-t.scale);s.x=n.x+(s.x-n.x)*g,s.y=n.y+(s.y-n.y)*g}e.scale=f}return this.snapToZoom&&this.effectiveLODs&&(e.scale=this._getClosestScale(e.scale)),e}fit(e){if(!this.effectiveLODs||!this.snapToZoom)return this.constrain(e,null);const t=this.scaleToZoom(e.scale),i=Math.abs(t-Math.floor(t));return e.scale=this.zoomToScale(i>.99?Math.round(t):Math.floor(t)),e}zoomToScale(e){if(!this.effectiveLODs)return 0;e-=this.effectiveMinZoom,e=Math.max(0,e);const t=this._scales;if(e<=0)return t[0];if(e>=t.length)return t[t.length-1];const i=Math.round(e-.5),r=Math.round(e);return t[r]+(r-e)*(t[i]-t[r])}scaleToZoom(e){if(!this.effectiveLODs)return-1;const t=this._scales;let i,r;if(e>=t[0])return this.effectiveMinZoom;if(e<=t[t.length-1])return this.effectiveMaxZoom;for(let s=0;se&&rMath.abs(i-e)<=Math.abs(t-e)?i:t,this._scales[0])),this._lodByScale[e].scale}};v([M({readOnly:!0})],Wn.prototype,"effectiveLODs",void 0),v([M({readOnly:!0})],Wn.prototype,"effectiveMinZoom",void 0),v([M({readOnly:!0})],Wn.prototype,"effectiveMaxZoom",void 0),v([M({readOnly:!0})],Wn.prototype,"effectiveMinScale",void 0),v([M({readOnly:!0})],Wn.prototype,"effectiveMaxScale",void 0),v([M()],Wn.prototype,"lods",void 0),v([M()],Wn.prototype,"minZoom",void 0),v([M()],Wn.prototype,"maxZoom",void 0),v([M()],Wn.prototype,"minScale",void 0),v([M()],Wn.prototype,"maxScale",void 0),v([M()],Wn.prototype,"snapToZoom",void 0),Wn=_I=v([fe("esri.views.2d.constraints.ZoomConstraint")],Wn);const SB=Wn,Goe={base:null,key:"type",typeMap:{extent:Ui,polygon:yh}};let zr=class extends Nt{constructor(t){super(t),this.lods=null,this.minScale=0,this.maxScale=0,this.minZoom=-1,this.maxZoom=-1,this.rotationEnabled=!0,this.snapToZoom=!0,this.customConstraints=new Bt}destroy(){this.view=null}get effectiveLODs(){return this._zoom.effectiveLODs}get effectiveMinScale(){return this._zoom.effectiveMinScale}get effectiveMaxScale(){return this._zoom.effectiveMaxScale}get effectiveMinZoom(){return this._zoom.effectiveMinZoom}get effectiveMaxZoom(){return this._zoom.effectiveMaxZoom}set geometry(t){t?this._set("geometry",t):this._set("geometry",null)}get version(){var t,i,r;return`${(t=this._zoom)==null?void 0:t.uid}/${(i=this._rotation)==null?void 0:i.uid}/${(r=this._geometry)==null?void 0:r.uid}`}get _geometry(){var i,r;const t=this._get("_geometry");return t&&this.geometry===t.geometry&&((i=this.view)==null?void 0:i.constraintsInfo.spatialReference)===t.spatialReference?t:new Ud({geometry:this.geometry,spatialReference:(r=this.view)==null?void 0:r.constraintsInfo.spatialReference})}get _rotation(){return new xB({rotationEnabled:this.rotationEnabled})}get _zoom(){var f;const t=this._get("_zoom"),i=this.lods||((f=this.view)==null?void 0:f.constraintsInfo.lods),r=this.minZoom,s=this.maxZoom,n=this.minScale,c=this.maxScale,o=this.snapToZoom;return t&&t.lods===i&&t.minZoom===r&&t.maxZoom===s&&t.minScale===n&&t.maxScale===c&&t.snapToZoom===o?t:new SB({lods:i,minZoom:r,maxZoom:s,minScale:n,maxScale:c,snapToZoom:o})}canZoomInTo(t){const i=this.effectiveMaxScale;return i===0||t>=i}canZoomOutTo(t){const i=this.effectiveMinScale;return i===0||t<=i}constrain(t,i){return this._zoom.constrain(t,i),this._rotation.constrain(t,i),this._geometry.constrain(t,i),this.customConstraints.forEach(r=>r.constrain(t,i)),t}constrainByGeometry(t){return this._geometry.constrain(t),this.customConstraints.forEach(i=>{var r;return(r=i.applyPanConstraint)==null?void 0:r.call(i,t)}),t}fit(t){return this._zoom.fit(t)}zoomToScale(t){return this._zoom.zoomToScale(t)}scaleToZoom(t){return this._zoom.scaleToZoom(t)}snapScale(t){return this._zoom.snapToClosestScale(t)}snapToNextScale(t){return this._zoom.snapToNextScale(t)}snapToPreviousScale(t){return this._zoom.snapToPreviousScale(t)}};v([M({readOnly:!0})],zr.prototype,"effectiveLODs",null),v([M({readOnly:!0})],zr.prototype,"effectiveMinScale",null),v([M({readOnly:!0})],zr.prototype,"effectiveMaxScale",null),v([M({readOnly:!0})],zr.prototype,"effectiveMinZoom",null),v([M({readOnly:!0})],zr.prototype,"effectiveMaxZoom",null),v([M({types:Goe,value:null})],zr.prototype,"geometry",null),v([M({type:[kc]})],zr.prototype,"lods",void 0),v([M()],zr.prototype,"minScale",void 0),v([M()],zr.prototype,"maxScale",void 0),v([M()],zr.prototype,"minZoom",void 0),v([M()],zr.prototype,"maxZoom",void 0),v([M()],zr.prototype,"rotationEnabled",void 0),v([M()],zr.prototype,"snapToZoom",void 0),v([M({type:Bt})],zr.prototype,"customConstraints",void 0),v([M()],zr.prototype,"view",void 0),v([M({readOnly:!0})],zr.prototype,"version",null),v([M({type:Ud,readOnly:!0})],zr.prototype,"_geometry",null),v([M({type:xB})],zr.prototype,"_rotation",null),v([M({readOnly:!0,type:SB})],zr.prototype,"_zoom",null),zr=v([fe("esri.views.2d.MapViewConstraints")],zr);const TB=zr;let Fl=class kd{static getId(t,i,r,s){return typeof t=="object"?`${t.level}/${t.row}/${t.col}/${t.world}`:`${t}/${i}/${r}/${s}`}constructor(t,i,r,s){this.set(t,i,r,s)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(t){this.set(t)}get hash(){const t=4095&this.row,i=4095&this.col,r=63&this.level;return(3&this.world)<<30|i<<22|t<<8|r}acquire(t,i,r,s){this.set(t,i,r,s)}contains(t){const i=t.level-this.level;return i>=0&&this.row===t.row>>i&&this.col===t.col>>i&&this.world===t.world}containsChild(t){const i=t.level-this.level;return i>0&&this.row===t.row>>i&&this.col===t.col>>i&&this.world===t.world}equals(t){return this.level===t.level&&this.row===t.row&&this.col===t.col&&this.world===t.world}clone(){return new kd(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(t,i,r,s){if(t==null)this.level=0,this.row=0,this.col=0,this.world=0;else if(typeof t=="object")this.level=t.level||0,this.row=t.row||0,this.col=t.col||0,this.world=t.world||0;else if(typeof t=="string"){const[n,c,o,f]=t.split("/");this.level=parseFloat(n),this.row=parseFloat(c),this.col=parseFloat(o),this.world=parseFloat(f)}else this.level=+t,this.row=+i,this.col=+r,this.world=+s||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new kd(this.level-1,this.row>>1,this.col>>1,this.world)}getNeighborId(t,i){return`${this.level}/${this.row+i}/${this.col+t}/${this.world}`}getChildKeys(){const t=this.level+1,i=this.row<<1,r=this.col<<1,s=this.world;return[new kd(t,i,r,s),new kd(t,i,r+1,s),new kd(t,i+1,r,s),new kd(t,i+1,r+1,s)]}compareRowMajor(t){return this.rowt.row?1:this.colt.col?1:0}};Fl.pool=new Pp(Fl,null,null,25,50);function Tu(e,t){return[e,t]}function rd(e,t,i){return e[0]=t,e[1]=i,e}function qoe(e,t,i,r,s){return e[0]=t,e[1]=i,e[2]=r,e[3]=s,e}const Sa=new Fl("0/0/0/0");let Hoe=class EB{static create(t,i,r=null){const s=ro(t.spatialReference),n=i.origin||Tu(t.origin.x,t.origin.y),c=Tu(t.size[0]*i.resolution,t.size[1]*i.resolution),o=Tu(-1/0,-1/0),f=Tu(1/0,1/0),g=Tu(1/0,1/0);r!=null&&(rd(o,Math.max(0,Math.floor((r.xmin-n[0])/c[0])),Math.max(0,Math.floor((n[1]-r.ymax)/c[1]))),rd(f,Math.max(0,Math.floor((r.xmax-n[0])/c[0])),Math.max(0,Math.floor((n[1]-r.ymin)/c[1]))),rd(g,f[0]-o[0]+1,f[1]-o[1]+1));const{cols:S,rows:I}=i;let A,O,z,V;return!r&&S&&I&&(rd(o,S[0],I[0]),rd(f,S[1],I[1]),rd(g,S[1]-S[0]+1,I[1]-I[0]+1)),t.isWrappable?(A=Tu(Math.ceil(Math.round((s.valid[1]-s.valid[0])/i.resolution)/t.size[0]),g[1]),O=Tu(Math.floor((s.origin[0]-n[0])/c[0]),o[1]),z=Tu(A[0]+O[0]-1,f[1]),V=!0):(O=o,z=f,A=g,V=!1),new EB(i.level,i.resolution,i.scale,n,o,f,g,c,O,z,A,V)}constructor(t,i,r,s,n,c,o,f,g,S,I,A){this.level=t,this.resolution=i,this.scale=r,this.origin=s,this.first=n,this.last=c,this.size=o,this.norm=f,this.worldStart=g,this.worldEnd=S,this.worldSize=I,this.wrap=A}normalizeCol(t){if(!this.wrap)return t;const i=this.worldSize[0];return t<0?i-1-Math.abs((t+1)%i):t%i}denormalizeCol(t,i){return this.wrap?this.worldSize[0]*i+t:t}getWorldForColumn(t){return this.wrap?Math.floor(t/this.worldSize[0]):0}getFirstColumnForWorld(t){return t*this.worldSize[0]+this.first[0]}getLastColumnForWorld(t){return t*this.worldSize[0]+this.first[0]+this.size[0]-1}getColumnForX(t){return(t-this.origin[0])/this.norm[0]}getXForColumn(t){return this.origin[0]+t*this.norm[0]}getRowForY(t){return(this.origin[1]-t)/this.norm[1]}getYForRow(t){return this.origin[1]-t*this.norm[1]}getTileBounds(t,i,r=!1){Sa.set(i);const s=r?Sa.col:this.denormalizeCol(Sa.col,Sa.world),n=Sa.row;return qoe(t,this.getXForColumn(s),this.getYForRow(n+1),this.getXForColumn(s+1),this.getYForRow(n)),t}getTileCoords(t,i,r=!1){Sa.set(i);const s=r?Sa.col:this.denormalizeCol(Sa.col,Sa.world);return Array.isArray(t)?rd(t,this.getXForColumn(s),this.getYForRow(Sa.row)):(t.x=this.getXForColumn(s),t.y=this.getYForRow(Sa.row)),t}},o_=class{constructor(){this.spans=[]}acquire(t){this.lodInfo=t}release(){this.lodInfo=null,this.spans.length=0}*keys(){const t=this.lodInfo;for(const{row:i,colFrom:r,colTo:s}of this.spans)for(let n=r;n<=s;n++){const c=t.getWorldForColumn(n);yield new Fl(t.level,i,t.normalizeCol(n),c)}}forEach(t,i){const{spans:r,lodInfo:s}=this,{level:n}=s;if(r.length!==0)for(const{row:c,colFrom:o,colTo:f}of r)for(let g=o;g<=f;g++)t.call(i,n,c,s.normalizeCol(g),s.getWorldForColumn(g))}};o_.pool=new Pp(o_);let nT=class{constructor(t,i,r){this.row=t,this.colFrom=i,this.colTo=r}};const dr=new Fl("0/0/0/0");let Woe=class MB{static create(t,i){t[1]>i[1]&&([t,i]=[i,t]);const[r,s]=t,[n,c]=i,o=n-r,f=c-s,g=f!==0?o/f:0,S=(Math.ceil(s)-s)*g,I=(Math.floor(s)-s)*g;return new MB(r,Math.floor(s),Math.ceil(c),g,o<0?S:I,o<0?I:S,o<0?n:r,o<0?r:n)}constructor(t,i,r,s,n,c,o,f){this.x=t,this.ymin=i,this.ymax=r,this.invM=s,this.leftAdjust=n,this.rightAdjust=c,this.leftBound=o,this.rightBound=f}incrRow(){this.x+=this.invM}getLeftCol(){return Math.max(this.x+this.leftAdjust,this.leftBound)}getRightCol(){return Math.min(this.x+this.rightAdjust,this.rightBound)}};const fo=[[0,0],[0,0],[0,0],[0,0]],Zoe=1e-6;let Yoe=class{constructor(t,i=null,r=t.lods[0].level,s=t.lods[t.lods.length-1].level){this.tileInfo=t,this.fullExtent=i,this.scales=[],this._infoByScale={},this._infoByLevel={};const n=t.lods.filter(o=>o.level>=r&&o.level<=s);this.minScale=n[0].scale,this.maxScale=n[n.length-1].scale;const c=this._lodInfos=n.map(o=>Hoe.create(t,o,i));n.forEach((o,f)=>{this._infoByLevel[o.level]=c[f],this._infoByScale[o.scale]=c[f],this.scales[f]=o.scale},this),this._wrap=t.isWrappable}get spatialReference(){return this.tileInfo.spatialReference}getLODInfoAt(t){return this._infoByLevel[typeof t=="number"?t:t.level]}getTileBounds(t,i,r=!1){dr.set(i);const s=this._infoByLevel[dr.level];return s?s.getTileBounds(t,dr,r):t}getTileCoords(t,i,r=!1){dr.set(i);const s=this._infoByLevel[dr.level];return s?s.getTileCoords(t,dr,r):t}getTileCoverage(t,i=192,r=!0,s="closest"){if(!r&&(t.scale>this.minScale||t.scale100)return null;let H=[];for(f=I;f=0;Q--){const ve=H[Q];g=Math.min(g,ve.getLeftCol()),S=Math.max(S,ve.getRightCol())}if(g=Math.floor(g),S=Math.floor(S),f>=n.first[1]&&f<=n.last[1])if(o)if(n.size[0]n.last[0]||S=0;Q--){const ve=H[Q];ve.ymax>=f?ve.incrRow():H.splice(Q,1)}}return c}getTileParentId(t){dr.set(t);const i=this._infoByLevel[dr.level],r=this._lodInfos.indexOf(i)-1;return r<0?null:(this._getTileIdAtLOD(dr,this._lodInfos[r],dr),dr.id)}getTileResolution(t){const i=this._infoByLevel[typeof t=="object"?t.level:t];return i?i.resolution:-1}getTileScale(t){const i=this._infoByLevel[t.level];return i?i.scale:-1}intersects(t,i){dr.set(i);const r=this._infoByLevel[dr.level],s=t.lodInfo;if(s.resolution>r.resolution){this._getTileIdAtLOD(dr,s,dr);const c=s.denormalizeCol(dr.col,dr.world);for(const o of t.spans)if(o.row===dr.row&&o.colFrom<=c&&o.colTo>=c)return!0}if(s.resolution(V[0]=Math.min(V[0],H.row),V[1]=Math.max(V[1],H.row),V[2]=Math.min(V[2],H.colFrom),V[3]=Math.max(V[3],H.colTo),V),[1/0,-1/0,1/0,-1/0]),S=r.denormalizeCol(dr.col,dr.world),I=s.getColumnForX(r.getXForColumn(S)),A=s.getRowForY(r.getYForRow(dr.row)),O=s.getColumnForX(r.getXForColumn(S+1))-1,z=s.getRowForY(r.getYForRow(dr.row+1))-1;return!(I>g||Oo||zc.row===dr.row&&c.colFrom<=n&&c.colTo>=n)}normalizeBounds(t,i,r){if(t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],this._wrap){const s=ro(this.tileInfo.spatialReference),n=-r*(s.valid[1]-s.valid[0]);t[0]+=n,t[2]+=n}return t}getSmallestInfoForScale(t){const i=this.scales;if(this._infoByScale[t])return this._infoByScale[t];if(t>i[0])return this._infoByScale[i[0]];for(let r=1;ri[r]+Zoe)return this._infoByScale[i[r-1]];return this._infoByScale[i[i.length-1]]}getClosestInfoForScale(t){const i=this.scales;return this._infoByScale[t]||(t=i.reduce((r,s)=>Math.abs(s-t)=0;r--)if(tt.push(i)),this._controllers.clear(),t.forEach(i=>i.abort()),this._processingItems.clear(),this._cancelNext()}forEach(t){this._deferreds.forEach((i,r)=>t(r))}get(t){const i=this._deferreds.get(t);return i?i.promise:void 0}isOngoing(t){return this._processingItems.has(t)}has(t){return this._deferreds.has(t)}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(t,i){const r=this.get(t);if(r)return r;const s=new AbortController;let n=null;i&&(n=io(i,()=>s.abort()));const c=()=>{const S=this._processingItems.get(t);S&&S.controller.abort(),o(),g.reject(jr())},o=()=>{f.remove(),n!=null&&n.remove(),this._removeItem(t),this._queue.remove(t),this._scheduleNext()},f=iA(s.signal,c),g=sa();return this._deferreds.set(t,g),this._controllers.set(t,s),g.promise.then(o,o),this._queue.push(t),this._scheduleNext(),g.promise}last(){return this._queue.last()}lastPromise(){const t=this.last();return t?this.get(t):null}peek(){return this._queue.peek()}popLast(){var i;const t=this._queue.popLast();return t&&((i=this._deferreds.get(t))==null||i.reject(jr("Removed from queue")),this._removeItem(t)),t}reset(){const t=[];this._processingItems.forEach(i=>t.push(i)),this._processingItems.clear();for(const i of t)this._queue.push(i.item),i.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const t=[];for(;this._queue.length;)t.push(this._queue.pop());return this.clear(),t}get running(){return!this._pausedSignal.value&&this._queue.length>0&&this._processingItems.size0&&this._processingItems.size{this._schedule=null,this._next()}))}_next(){for(;this._queue.length>0&&this._processingItems.sizethis._processResult(s,n),n=>this._processError(s,n))):this._processResult(s,i)}get test(){return{update:t=>this.runTask(t)}}};function Xoe(e,t){return e.length=0,t.forEach(i=>e.push(i)),e}const oT=new Set,Tv=[],Af=new Map,WR=[0,0];let Gu=class extends Nt{constructor(t){super(t),this._keyToItem=new Map,this.concurrency=6,this.strategy="scale-first",this.tileInfoView=null}initialize(){const{concurrency:t,process:i,strategy:r}=this;this._queue=new Koe({concurrency:t,process:(s,n)=>{const c=this._keyToItem.get(s);return i(c,{signal:n})},peeker:r==="scale-first"?s=>this._peekByScaleFirst(s):s=>this._peekByCenterFirst(s)})}destroy(){this.clear(),this._queue=lr(this._queue)}get length(){return this._queue?this._queue.length:0}get onGoingCount(){return this._keyToItem.size}abort(t){const i=typeof t=="string"?t:t.id;this._queue.abort(i)}clear(){this._queue.clear(),this._keyToItem.clear()}has(t){return typeof t=="string"?this._keyToItem.has(t):this._keyToItem.has(t.id)}isOngoing(t){const i=typeof t=="string"?t:t.id;return this.has(i)&&this._queue.isOngoing(i)}pause(){this._queue.pause()}push(t){const i=t.key.id;if(this._queue.has(i))return this._queue.get(i);const r=this._queue.push(i),s=()=>{this._keyToItem.delete(i)};return this._keyToItem.set(i,t),r.then(s,s),r}reset(){this._queue.reset()}resume(){this._queue.resume()}_peekByScaleFirst(t){if(!this.state)return t.values().next().value;const i=this.tileInfoView;let r=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;t.forEach(S=>{const I=this._keyToItem.get(S),A=this.tileInfoView.getTileScale(I.key);Af.has(A)||(Af.set(A,[]),r=Math.max(A,r),s=Math.min(A,s)),Af.get(A).push(I.key),oT.add(A)});let n=this.state.scale;Af.has(n)||(Xoe(Tv,oT),Tv.sort((S,I)=>S-I),n=Tv.reduce((S,I)=>Math.abs(I-n){const A=o.denormalizeCol(S.col,S.world),O=o.denormalizeCol(I.col,I.world);return Math.sqrt((f-A)*(f-A)+(g-S.row)*(g-S.row))-Math.sqrt((f-O)*(f-O)+(g-I.row)*(g-I.row))}),oT.clear(),Af.clear(),c[0].id}_peekByCenterFirst(t){if(!this.state)return t.values().next().value;const i=this.tileInfoView,r=this.state.center;let s,n=Number.POSITIVE_INFINITY;return t.forEach(c=>{const o=this._keyToItem.get(c);i.getTileCoords(WR,o.key);const f=Qx(WR,r);fthis.maxSize&&n>=0;)n!==t&&(s=this._pruneAroundCenterTile(s,i,r,n)),n--;s>this.maxSize&&(s=this._pruneAroundCenterTile(s,i,r,t))}_pruneAroundCenterTile(t,i,r,s){const n=this._tileKeysPerLevel[s];if(!n||n.length===0)return t;const{size:c,origin:o}=this._tileInfoView.tileInfo,f=r*c[0],g=r*c[1],S=[0,0],I=[0,0];for(n.sort((A,O)=>(S[0]=o.x+f*(A.col+.5),S[1]=o.y-g*(A.row+.5),I[0]=o.x+f*(O.col+.5),I[1]=o.y-g*(O.row+.5),Uw(S,i)-Uw(I,i)));n.length>0;){const A=n.pop();if(this._removeTile(A.id),--t===this.maxSize)break}return t}_removeTile(t){const i=this._tilePerId.get(t);this._removedFunc&&i&&this._removedFunc(i),ZR(this._tilePerId,t)}};function ZR(e,t){e.delete(t)}const sd=new Fl(0,0,0,0),pc=new Map,nd=[],aT=[];let U1e=class{constructor(t){this._previousScale=Number.POSITIVE_INFINITY,this.cachePolicy="keep",this.coveragePolicy="closest",this.resampling=!0,this.tileIndex=new Map,this.tiles=[],this.buffer=192,this.acquireTile=t.acquireTile,this.releaseTile=t.releaseTile,this.tileInfoView=t.tileInfoView,t.resampling!=null&&(this.resampling=t.resampling),t.cachePolicy&&(this.cachePolicy=t.cachePolicy),t.coveragePolicy&&(this.coveragePolicy=t.coveragePolicy),t.buffer!=null&&(this.buffer=t.buffer),t.cacheSize&&(this._tileCache=new Qoe(t.cacheSize,this.tileInfoView,i=>{this.releaseTile(i)}))}destroy(){this.tileIndex.clear()}update(t){var Q,ve;const{resampling:i,tileIndex:r}=this,{scale:s,center:n,resolution:c}=t.state,{minScale:o,maxScale:f}=this.tileInfoView,g=!t.stationary&&s>this._previousScale;if(this._previousScale=s,!i&&(s>o||sme.visible=!0);let z=0,V=0;if(I.length>0)for(const{row:me,colFrom:ge,colTo:Ie}of I)for(let Ce=ge;Ce<=Ie;Ce++){z++;const ze=sd.set(O,me,A.normalizeCol(Ce),A.getWorldForColumn(Ce)).id;let je=r.get(ze);if(je)je.isReady?(pc.set(ze,je),V++):g||this._addParentTile(ze,pc);else{if((Q=this._tileCache)!=null&&Q.has(ze)){if(je=this._tileCache.pop(ze),this.tileIndex.set(ze,je),je.isReady){pc.set(ze,je),V++;continue}}else je=this.acquireTile(sd),this.tileIndex.set(ze,je);g||this._addParentTile(ze,pc)}}const H=V===z;for(const[me,ge]of r){if(pc.has(me))continue;sd.set(me);const Ie=this.tileInfoView.intersects(S,sd),Ce=this.cachePolicy==="purge"?sd.level!==O:sd.level>O;!Ie||!g&&H?!Ce&&Ie||nd.push(ge):ge.isReady?Ce&&this.cachePolicy==="purge"&&this._hasReadyAncestor(sd,O)?nd.push(ge):aT.push(ge):Ce&&nd.push(ge)}for(const me of aT)me.isReady&&pc.set(me.key.id,me);for(const me of nd)this._tileCache?this._tileCache.add(me):this.releaseTile(me),r.delete(me.key.id);for(const me of pc.values())this.tiles.push(me);for(const me of r.values())pc.has(me.key.id)||(me.visible=!1);(ve=this._tileCache)==null||ve.prune(O,n,c),o_.pool.release(S),aT.length=0,nd.length=0,pc.clear()}clear(){const{tileIndex:t}=this;for(const i of t.values())this.releaseTile(i);t.clear()}refresh(t){var i;for(const r of this.tileIndex.values())this.tiles.includes(r)?t(r):nd.push(r);for(const r of nd)this.releaseTile(r),this.tileIndex.delete(r.key.id);(i=this._tileCache)==null||i.clear()}updateCacheSize(t){this._tileCache&&(this._tileCache.maxSize=t)}_addParentTile(t,i){var n;let r=t,s=null;for(;r=this.tileInfoView.getTileParentId(r),r;)if(this.tileIndex.has(r)){if(s=this.tileIndex.get(r),s==null?void 0:s.isReady){i.has(s.key.id)||i.set(s.key.id,s);break}}else if((n=this._tileCache)!=null&&n.has(r)&&(s=this._tileCache.pop(r),this.tileIndex.set(r,s),s==null?void 0:s.isReady)){i.has(s.key.id)||i.set(s.key.id,s);break}}_hasReadyAncestor(t,i){const r=eo();this.tileInfoView.getTileBounds(r,t,!0);for(const s of this.tileIndex.values())if(s.isReady&&s.key.level>=i&&s.key.level=2}function Bae(e){return Array.isArray(e)&&e.length>=2}function Ev(e){return Fae(e)||Bae(e)}var bI;const cn=[0,0];let qu=bI=class extends At{constructor(e){super(e),this._viewpoint2D={center:Vr(),rotation:0,scale:0,spatialReference:void 0},this.center=[0,0],this.extent=new Ui,this.id=0,this.inverseTransform=zc(),this.resolution=0,this.rotation=0,this.scale=0,this.transform=zc(),this.transformNoRotation=zc(),this.displayMat3=Ab(),this.displayViewMat3=Ab(),this.viewMat3=Ab(),this.viewMat2d=IB(),this.worldScreenWidth=0,this.size=[0,0]}set pixelRatio(e){this._set("pixelRatio",e),this._update()}set size(e){this._set("size",e),this._update()}set viewpoint(e){if(e){const t=this._viewpoint2D,i=e.targetGeometry;t.center[0]=i.x,t.center[1]=i.y,t.rotation=e.rotation,t.scale=e.scale,t.spatialReference=i.spatialReference}this._update()}copy(e){const t=this.size,i=this.viewpoint;return i&&t?(this.viewpoint=Qa(i,e.viewpoint),this._set("size",s_(t,e.size))):(this.viewpoint=e.viewpoint.clone(),this._set("size",[e.size[0],e.size[1]])),this._set("pixelRatio",e.pixelRatio),this}clone(){return new bI({size:this.size,viewpoint:this.viewpoint.clone(),pixelRatio:this.pixelRatio})}toMap(e,t,i){return Ev(t)?La(e,t,this.inverseTransform):(cn[0]=t,cn[1]=i,La(e,cn,this.inverseTransform))}toScreen(e,t,i){return Ev(t)?La(e,t,this.transform):(cn[0]=t,cn[1]=i,La(e,cn,this.transform))}toScreenNoRotation(e,t,i){return Ev(t)?La(e,t,this.transformNoRotation):(cn[0]=t,cn[1]=i,La(e,cn,this.transformNoRotation))}toScreenClosest(e,t,i){Ev(t)?(cn[0]=t[0],cn[1]=t[1]):(cn[0]=t,cn[1]=i);const[r]=cn,{center:s,extent:n,spatialReference:c,transform:o}=this;return(rn.xmax)&&(cn[0]=pB(r,s[0],c)),La(e,cn,o)}getScreenTransform(e,t){const{center:i}=this._viewpoint2D,r=this._get("pixelRatio")||1,s=this._get("size");return W3(e,i,s,t,0,r),e}_update(){const{center:e,spatialReference:t,scale:i,rotation:r}=this._viewpoint2D,s=this._get("pixelRatio")||1,n=this._get("size"),c=new kl({targetGeometry:new ri(e[0],e[1],t),scale:i,rotation:r});if(this._set("viewpoint",c),!n||!t||!i)return;this.resolution=Km(c),this.rotation=r,this.scale=i,this.spatialReference=t,s_(this.center,e);const o=n[0]!==0?2/n[0]:0,f=n[1]!==0?-2/n[1]:0;PB(this.displayMat3,o,0,0,0,f,0,-1,1,1);const g=CB(this.viewMat3),S=Nm(n[0]/2,n[1]/2),I=Nm(-n[0]/2,-n[1]/2),A=FA(r);vI(g,g,S),$B(g,g,A),vI(g,g,I),Y3(this.displayViewMat3,this.displayMat3,g);const O=V3(this.viewMat2d,S);return Xx(O,O,A),r_(O,O,I),Toe(this.extent,c,n),Z3(this.transform,c,n,s),U3(this.inverseTransform,this.transform),$oe(this.transformNoRotation,c,n,s),this.worldScreenWidth=Roe(this.spatialReference,this.resolution),this._set("id",this.id+1),this}};v([M({readOnly:!0})],qu.prototype,"id",void 0),v([M({value:1,json:{write:!0}})],qu.prototype,"pixelRatio",null),v([M({json:{write:!0}})],qu.prototype,"size",null),v([M()],qu.prototype,"spatialReference",void 0),v([M({type:kl,json:{write:!0}})],qu.prototype,"viewpoint",null),qu=bI=v([fe("esri.views.2d.ViewState")],qu);const YR=qu;var wI,xI;let Rc=wI=class extends Nt{constructor(){super(...arguments),this.left=0,this.top=0,this.right=0,this.bottom=0}clone(){return new wI({left:this.left,top:this.top,right:this.right,bottom:this.bottom})}};v([M()],Rc.prototype,"left",void 0),v([M()],Rc.prototype,"top",void 0),v([M()],Rc.prototype,"right",void 0),v([M()],Rc.prototype,"bottom",void 0),Rc=wI=v([fe("esri.views.2d.PaddedViewState.Padding")],Rc);let Wf=xI=class extends YR{constructor(...e){super(...e),this.paddedViewState=new YR,this._updateContent=(()=>{const t=Vr();return()=>{const i=this._get("size"),r=this._get("padding");if(!i||!r)return;const s=this.paddedViewState;Cs(t,r.left+r.right,r.top+r.bottom),n_(t,i,t),s_(s.size,t);const n=s.viewpoint;n&&(this.viewpoint=n)}})(),this.addHandles(ti(()=>[this.size,this.padding],()=>this._updateContent(),Tp)),this.padding=new Rc,this.size=[0,0]}set padding(e){this._set("padding",e||new Rc)}set viewpoint(e){if(e){const t=e.clone();this.paddedViewState.viewpoint=e,Loe(t,e,this._get("size"),this._get("padding"));const i=this._viewpoint2D,r=t.targetGeometry;i.center[0]=r.x,i.center[1]=r.y,i.rotation=t.rotation,i.scale=t.scale,i.spatialReference=r.spatialReference,this._update()}}clone(){return new xI({padding:this.padding.clone(),size:this.size.slice(),viewpoint:this.paddedViewState.viewpoint.clone(),pixelRatio:this.pixelRatio})}};v([M()],Wf.prototype,"paddedViewState",void 0),v([M({type:Rc})],Wf.prototype,"padding",null),v([M()],Wf.prototype,"viewpoint",null),Wf=xI=v([fe("esri.views.2d.PaddedViewState")],Wf);const Uae=Wf;let Pn=class extends Nt{constructor(t){super(t),this.constraints=null,this.ready=!1,this.resizeAlign="center",this.addHandles([ti(()=>{var i;return(i=this.constraints)==null?void 0:i.version},i=>{this.constraints&&i&&this.ready&&(this.state.viewpoint=this.constraints.fit(this.state.paddedViewState.viewpoint))},Tp)])}get center(){if(!this.ready)return this._get("center");const{center:t,spatialReference:i}=this.state.paddedViewState;return this.state.commitProperty("id"),new ri({x:t[0],y:t[1],spatialReference:i})}set center(t){if(t==null)return;if(!this.ready)return void this._set("center",t);let i;try{i=this._project(t,this.state.spatialReference)}catch(s){return void _t.getLogger(this).error(new Je("mapview:invalid-center","could not project the value in the view's spatial reference",{input:t,error:s}))}const r=this.viewpoint;mI(r,r,i),this.viewpoint=r}get extent(){return this.ready?(this.state.commitProperty("id"),this.state.paddedViewState.extent.clone()):this._get("extent")}set extent(t){if(t==null)return;if(!t.width||!t.height)return void _t.getLogger(this).error(new Je("mapview:invalid-extent","invalid extent size"));if(!this.ready)return this._set("extent",t),this._set("center",void 0),this._set("viewpoint",void 0),this._set("scale",void 0),void this._set("zoom",void 0);let i;try{i=this._project(t,this.state.spatialReference)}catch(s){return void _t.getLogger(this).error(new Je("mapview:invalid-extent","could not project the value in the view's spatial reference",{error:s}))}const r=this.viewpoint;Eoe(r,r,i,this.state.size,{constraints:this.constraints}),this.viewpoint=r}get padding(){return this.ready?this.state.padding:this._get("padding")}set padding(t){this.ready?(this.state.padding=t,this._set("padding",this.state.padding)):this._set("padding",t)}get resolution(){return this.ready?(this.state.commitProperty("id"),this.state.resolution):0}get rotation(){return this.ready?(this.state.commitProperty("id"),this.state.rotation):this._get("rotation")}set rotation(t){if(isNaN(t))return;if(!this.ready)return void this._set("rotation",t);const i=this.viewpoint;Noe(i,i,t),this.viewpoint=i}get scale(){return this.ready?(this.state.commitProperty("id"),this.state.scale):this._get("scale")}set scale(t){if(!t||isNaN(t))return;if(!this.ready){this._set("scale",t),this._set("zoom",void 0);const r=this._get("extent");return void(r&&(this._set("extent",void 0),this._set("center",r.center)))}const i=this.viewpoint;GR(i,i,t),this.viewpoint=i}get viewpoint(){return this.ready?this.state.paddedViewState.viewpoint.clone():this._get("viewpoint")}set viewpoint(t){var n;if(t==null)return;if(!this.ready)return this._set("viewpoint",t),this._set("extent",void 0),this._set("center",void 0),this._set("zoom",void 0),void this._set("scale",void 0);let i,r;try{i=this._project(t,this.state.spatialReference),!t.scale||isNaN(t.scale)?r=new Je("mapview:invalid-viewpoint",`invalid scale value of ${t.scale}`):t.targetGeometry==null&&(r=new Je("mapview:invalid-viewpoint","geometry not defined"))}catch(c){r=new Je("mapview:invalid-viewpoint","could not project the value in the view's spatial reference",{error:c})}if(r)return void _t.getLogger(this).error(r);this._scaleBeforeChangingSpatialReference=null;const s=new kl({targetGeometry:new ri,scale:0,rotation:0});Qa(s,i),(n=this.constraints)==null||n.constrain(s,this.state.paddedViewState.viewpoint),this.state.viewpoint=s,this._set("viewpoint",s)}get zoom(){var t;return this.ready?((t=this.constraints)==null?void 0:t.scaleToZoom(this.scale))??-1:this._get("zoom")}set zoom(t){var s,n;if(!(t>=0))return;if(!this.ready){this._set("zoom",t),this._set("scale",void 0);const c=this._get("extent");return void(c&&(this._set("extent",void 0),this._set("center",c.center)))}const i=((s=this.constraints)==null?void 0:s.zoomToScale(t))??0;if(!i)return void this._set("zoom",-1);const r=this.viewpoint;GR(r,r,i),this.viewpoint=r,this._set("zoom",((n=this.constraints)==null?void 0:n.scaleToZoom(this.scale))??-1)}getUserStartupOptions(t){if(!t[0]&&!t[1])return{center:void 0,rotation:void 0,scale:void 0};const{padding:i,constraints:r}=this,s=this._get("center"),n=this._get("extent"),c=this._get("scale"),o=this._get("rotation"),f=this._get("viewpoint"),g=this._get("zoom"),S=g!=null&&r!=null&&r.zoomToScale(g)||void 0;let I,A,O;const z=f==null?void 0:f.rotation,V=f==null?void 0:f.targetGeometry;(V==null?void 0:V.type)==="extent"?I=V:(V==null?void 0:V.type)==="point"&&(A=V,O=f==null?void 0:f.scale);const H=n??I;return{center:s??A??(H==null?void 0:H.center),rotation:o??z,scale:(c??S??O??(H&&_m(H,[t[0]-i.left-i.right,t[1]-i.top-i.bottom])))||void 0}}startup(t,i,r,s){var c;const n=t.targetGeometry;try{this._project(t,r)}catch(o){_t.getLogger(this).warn(new jc("mapview:startup-projection-error","projection of initial viewpoint to the view's spatial reference, defaulting to the initial viewpoint.",{center:n.toJSON(),spatialReference:r,error:o})),t.targetGeometry=s||new ri({x:0,y:0,spatialReference:r})}(c=this.constraints)==null||c.fit(t),this._set("state",new Uae({padding:this.padding,size:i,viewpoint:t})),this._set("ready",!0)}teardown(){this._set("ready",!1);const{center:[t,i],spatialReference:r,rotation:s,scale:n}=this.state.paddedViewState,c=new ri({x:t,y:i,spatialReference:r});this._set("viewpoint",null),this._set("extent",null),this._set("center",c),this._set("zoom",-1),this._set("rotation",s),this._set("scale",n),this._set("state",null)}changeSpatialReference(t){var f;const i=this.state.paddedViewState.clone();if(this._scaleBeforeChangingSpatialReference==null)this._scaleBeforeChangingSpatialReference=i.scale;else{const g=i.viewpoint.clone();g.scale=this._scaleBeforeChangingSpatialReference,i.viewpoint=g}const r=i.clone(),[s,n]=i.center;let c=null;try{c=this._project(new ri({x:s,y:n,spatialReference:i.spatialReference}),t)}catch(g){EA()||_t.getLogger(this).warn(new jc("mapview:spatial-reference-change","could not project the view's center to the new spatial reference",{center:c==null?void 0:c.toJSON(),spatialReference:t,error:g}))}c||(c=new ri({x:0,y:0,spatialReference:t}));const o=mI(new kl({targetGeometry:new ri,scale:0,rotation:0}),i.viewpoint,c);r.viewpoint=o;try{const S=[i.size[0]/2,i.size[1]/2],I=[S[0]+20,S[1]],A=i.toMap([0,0],I),{x:O,y:z}=this._project(new ri({x:A[0],y:A[1],spatialReference:i.spatialReference}),t);A[0]=O,A[1]=z,r.toScreen(A,A);const V=Ooe(S,A,I),H=Math.hypot(A[0]-S[0],A[1]-S[1])/20;!Number.isFinite(H)||Math.abs(H)>4?(o.rotation=0,o.targetGeometry=new ri({x:0,y:0,spatialReference:t})):(o.scale*=H,o.scale>Le("mapview-srswitch-adjust-rotation-scale-threshold")?o.rotation=0:o.rotation+=Number.isFinite(V)?V:0)}catch{}(f=this._get("constraints"))==null||f.constrain(o,void 0),this._get("state").viewpoint=o}resize(t,i){var c;if(!this.ready)return;const r=this.state;let s=this.state.paddedViewState.viewpoint;const n=this.state.paddedViewState.size.concat();r.size=[t,i],Doe(s,s,n,this.state.paddedViewState.size,this.resizeAlign),s=((c=this.constraints)==null?void 0:c.constrain(s,void 0))??s,this.state.viewpoint=s}toMap(t){if(!this.ready)return null;const i=[0,0],[r,s]=this.state.toMap(i,[t.x,t.y]),n=this.state.spatialReference;return new ri({x:r,y:s,spatialReference:n})}toScreen(t,i){if(!this.ready)return null;const r=this._project(t,this.state.spatialReference),s=[r.x,r.y];return(i==null?void 0:i.pickClosestTarget)===!1?this.state.toScreen(s,s):this.state.toScreenClosest(s,s),Dn(s[0],s[1])}_project(t,i){var n;const r=(t==null?void 0:t.targetGeometry)||t;if(!i)return t;if(!r)return null;if(i.imageCoordinateSystem||(n=r.spatialReference)!=null&&n.imageCoordinateSystem||Js(i,r.spatialReference))return t;const s=Ph(r,i);if(!s)throw new Je("mapview:projection-not-possible","projecting input geometry to target spatial reference returned a null value",{geometry:r,spatialReference:i});return jae(t)?(t.targetGeometry=s,t):s}};function jae(e){return(e==null?void 0:e.declaredClass)==="esri.Viewpoint"}v([M({type:ri})],Pn.prototype,"center",null),v([M()],Pn.prototype,"constraints",void 0),v([M({type:Ui})],Pn.prototype,"extent",null),v([M({value:{top:0,right:0,bottom:0,left:0},cast:e=>({top:0,right:0,bottom:0,left:0,...e})})],Pn.prototype,"padding",null),v([M()],Pn.prototype,"ready",void 0),v([M()],Pn.prototype,"resizeAlign",void 0),v([M({readOnly:!0})],Pn.prototype,"resolution",null),v([M({type:Number})],Pn.prototype,"rotation",null),v([M({type:Number})],Pn.prototype,"scale",null),v([M({readOnly:!0})],Pn.prototype,"state",void 0),v([M({type:kl})],Pn.prototype,"viewpoint",null),v([M()],Pn.prototype,"zoom",null),Pn=v([fe("esri.views.2d.ViewStateManager")],Pn);function J3(e,t){switch(t){case"primary":return e.pointerType==="touch"||e.button===0;case"secondary":return e.pointerType!=="touch"&&e.button===2;case"tertiary":return e.pointerType!=="touch"&&e.button===1}}let JR=class extends bs{constructor(t,i){super(!0),this._view=t,this.registerIncoming("double-click",i,r=>this._handleDoubleClick(r,i))}_handleDoubleClick(t,i){J3(t.data,"primary")&&(t.stopPropagation(),i?this._view.mapViewNavigation.zoomOut([t.data.x,t.data.y]):this._view.mapViewNavigation.zoomIn([t.data.x,t.data.y]))}},Vae=class extends bs{constructor(t,i,r){super(!0),this.view=t,this.pointerType=i,this.registerIncoming("double-tap-drag",r,s=>this._handleDoubleTapDrag(s))}_handleDoubleTapDrag(t){const{data:i}=t,{pointerType:r}=i;if(r!==this.pointerType)return;t.stopPropagation();const{action:s,delta:n}=i,{view:c}=this,{mapViewNavigation:o}=c;switch(s){case"begin":{const{scale:f}=c;this._startScale=f,this._currentScale=f,this._previousDelta=n,o.begin();break}case"update":{if(this._previousDelta.y===n.y)return;this._previousDelta=n;const f=1.015**n.y,g=this._startScale*f,S=g/this._currentScale;o.setViewpointImmediate(S),this._currentScale=g;break}case"end":{const{constraints:f}=c,{effectiveLODs:g,snapToZoom:S}=f;if(!S||!g)return void o.end();const I=f.snapScale(this._currentScale),A=(n.y>0?Math.max(I,f.snapToPreviousScale(this._startScale)):Math.min(I,f.snapToNextScale(this._startScale)))/this._currentScale;o.zoom(A);break}}}},t2=class{constructor(t){this._callbacks=t,this._currentCount=0,this._callbacks.condition||(this._callbacks.condition=()=>!0)}handle(t){const i=t.data,r=i.pointers.size;switch(i.action){case"start":this._currentCount=r,this._emitStart(t);break;case"added":this._emitEnd(this._previousEvent),this._currentCount=r,this._emitStart(t);break;case"update":this._emitUpdate(t);break;case"removed":this._startEvent&&this._emitEnd(this._previousEvent),this._currentCount=r,this._emitStart(t);break;case"end":this._emitEnd(t),this._currentCount=0}this._previousEvent=t}_emitStart(t){var i,r;this._startEvent=t,(r=(i=this._callbacks).condition)!=null&&r.call(i,this._currentCount,t)&&this._callbacks.start(this._currentCount,t,this._startEvent)}_emitUpdate(t){var i,r;(r=(i=this._callbacks).condition)!=null&&r.call(i,this._currentCount,t)&&this._callbacks.update(this._currentCount,t,this._startEvent)}_emitEnd(t){var i,r;(r=(i=this._callbacks).condition)!=null&&r.call(i,this._currentCount,t)&&this._callbacks.end(this._currentCount,t,this._startEvent),this._startEvent=null}},Gae=class extends bs{constructor(t,i,r){super(!0),this.view=t,this.pointerAction=i,this.registerIncoming("drag",r,s=>this._handleDrag(s)),this.registerIncoming("pointer-down",()=>this.stopMomentumNavigation())}onInstall(t){super.onInstall(t),this._dragEventSeparator=new t2({start:(i,r)=>{this.view.mapViewNavigation.pan.begin(this.view,r.data),r.stopPropagation()},update:(i,r)=>{this.view.mapViewNavigation.pan.update(this.view,r.data),r.stopPropagation()},end:(i,r)=>{this.view.mapViewNavigation.pan.end(this.view,r.data),r.stopPropagation()},condition:(i,r)=>i===1&&J3(r.data,this.pointerAction)})}_handleDrag(t){const i=this.view.mapViewNavigation;i.pinch.zoomMomentum||i.pinch.rotateMomentum?this.stopMomentumNavigation():this._dragEventSeparator.handle(t)}stopMomentumNavigation(){this.view.mapViewNavigation.pan.stopMomentumNavigation()}},qae=class extends bs{constructor(t,i,r){super(!0),this._view=t,this.pointerAction=i;const s=this._view.mapViewNavigation;this._dragEventSeparator=new t2({start:(n,c)=>{s.rotate.begin(this._view,c.data),c.stopPropagation()},update:(n,c)=>{s.rotate.update(this._view,c.data),c.stopPropagation()},end:(n,c)=>{s.rotate.end(),c.stopPropagation()},condition:(n,c)=>n===1&&J3(c.data,this.pointerAction)}),this.registerIncoming("drag",r,n=>this._dragEventSeparator.handle(n))}};function Ta(e){let t=e*e;return e<0&&(t*=-1),t}function Hae(e){return e.translation[0]=0,e.translation[1]=0,e.translation[2]=0,e.heading=0,e.tilt=0,e}function Wae(e,t,i){const r=i,s=e.state,n=e.device,c=t.tiltDirection==="forward-down"?1:-1,o=1;return n.deviceType==="standard"?(r.translation[0]=Ta(s.axes[0]),r.translation[1]=Ta(s.axes[1]),r.translation[2]=Ta(s.buttons[7])-Ta(s.buttons[6]),r.heading=Ta(s.axes[2]),r.tilt=Ta(s.axes[3])):n.deviceType==="spacemouse"&&(r.translation[0]=1.2*Ta(s.axes[0]),r.translation[1]=1.2*Ta(s.axes[1]),r.translation[2]=2*-Ta(s.axes[2]),r.heading=1.2*Ta(s.axes[5]),r.tilt=1.2*Ta(s.axes[3])),r.tilt*=c,kN(r.translation,r.translation,o),r}function Zae(e){return e.translation[0]===0&&e.translation[1]===0&&e.translation[2]===0&&e.heading===0&&e.tilt===0&&e.zoom===0}let Yae=class extends bs{constructor(t){super(!0),this._view=t,this._frameTask=null,this._watchHandles=new eA,this._currentDevice=null,this._transformation={translation:[0,0,0],heading:0,tilt:0,zoom:0},this._handle=this.registerIncoming("gamepad",i=>this._handleGamePadEvent(i)),this._handle.pause()}onInstall(t){super.onInstall(t),this._watchHandles.add([ti(()=>{var i;return(i=this._view.navigation.gamepad)==null?void 0:i.enabled},i=>{i?(this._handle.resume(),this._frameTask||(this._frameTask=Mm({update:r=>this._frameUpdate(r.deltaTime)}))):(this._handle.pause(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null))},_n)])}onUninstall(){this._watchHandles.removeAll(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null),super.onUninstall()}_handleGamePadEvent(t){const i=this._view.navigation.gamepad.device;i&&t.data.device!==i||this._currentDevice&&this._currentDevice!==t.data.device||(t.data.action==="end"?(this._currentDevice=null,Hae(this._transformation)):(this._currentDevice=t.data.device,Wae(t.data,this._view.navigation.gamepad,this._transformation)))}_frameUpdate(t){const i=this._transformation;if(Zae(i))return;const r=this._view.viewpoint.clone(),s=this._view.navigation.gamepad.velocityFactor,n=Kae*s*t;e2(r,r,[i.translation[0]*n,-i.translation[1]*n]);const c=1+i.translation[2]*Xae*t,o=this._view.constraints.rotationEnabled?-i.heading*Jae*t:0,f=this._view.size,g=[f[0]/2,f[1]];vB(r,r,c,o,g,f);const S=this._view.constraints.constrain(r,this._view.viewpoint);this._view.viewpoint=S}};const Jae=.06,Kae=.7,Xae=6e-4;function zB(e){const t=()=>e(document.visibilityState==="visible");return document.addEventListener("visibilitychange",t),{remove:()=>document.addEventListener("visibilitychange",t)}}let Qae=class extends bs{constructor(t,i,r){super(!0),this.view=t,this.keys=i,this._isSticky=!1,this._pressedKeys=new Set,this._timeout=void 0,this._currentDirection=void 0,this._stickyKeyDuration=200,this._handleKey=s=>{const n=this._keyMap[s.data.key];if(s.modifiers.has("Meta")||s.modifiers.has("Ctrl"))return void this._stopMovement();if(n==null)return;s.stopPropagation(),s.preventDefault();const c=s.type==="key-down";if(this._pressedKeys[c?"add":"delete"](n),c){if(this._direction===n)return;this._direction=n,this._isSticky=!1,this._setTimeout(()=>{this._isSticky&&this._handlePopKey()})}else{const o=this._timeout===void 0,f=this._pressedKeys.size>0;o||f?this._handlePopKey():this._isSticky=!0}},this._handlePopKey=()=>{this._direction=Array.from(this._pressedKeys).pop(),this._direction==null&&this._stopMovement()},this._stopMovement=()=>{this._isSticky=!1,this._direction=void 0,this._pressedKeys.clear(),this._setTimeout(void 0)},this._keyMap={[i.left]:"left",[i.right]:"right",[i.up]:"up",[i.down]:"down"},this.registerIncoming("key-down",r,this._handleKey),this.registerIncoming("key-up",r,this._handleKey),this.registerIncoming("blur",r,this._stopMovement),this._visibilityHandle=zB(s=>s?null:this._stopMovement())}onUninstall(){var t;this._stopMovement(),(t=this._visibilityHandle)==null||t.remove()}get _direction(){return this._currentDirection}set _direction(t){const i=this._currentDirection!=null;if(t!=null){if(i||this.view.mapViewNavigation.begin(),this._currentDirection!==t)switch(t){case"left":this.view.mapViewNavigation.continousPanLeft();break;case"right":this.view.mapViewNavigation.continousPanRight();break;case"up":this.view.mapViewNavigation.continousPanUp();break;case"down":this.view.mapViewNavigation.continousPanDown()}}else i&&this.view.mapViewNavigation.stop();this._currentDirection=t}_setTimeout(t){clearTimeout(this._timeout),this._timeout=t===void 0?void 0:setTimeout(()=>{this._timeout=void 0,t()},this._stickyKeyDuration)}},ele=class extends bs{constructor(t,i,r){super(!0),this.view=t,this.keys=i,this._pressed=!1,this._keyToDirection={[i.clockwiseOption1]:"clockwise",[i.clockwiseOption2]:"clockwise",[i.counterClockwiseOption1]:"counterClockwise",[i.counterClockwiseOption2]:"counterClockwise",[i.resetOption1]:"reset",[i.resetOption2]:"reset"},this.registerIncoming("key-down",r,s=>this._handleKeyDown(s)),this.registerIncoming("key-up",r,s=>this._handleKeyUp(s)),this.registerIncoming("blur",r,()=>this._handleStop()),this._visibilityHandle=zB(s=>s?null:this._handleStop())}onUninstall(){var t;(t=this._visibilityHandle)==null||t.remove(),this._handleStop()}_handleKeyDown(t){t.data.repeat||this._handleKey(t,!0)}_handleKeyUp(t){this._handleKey(t,!1)}_handleStop(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(t,i){const r=t.modifiers;if(r.size>0&&!r.has("Shift")||!this.view.constraints.rotationEnabled)return;const s=this._keyToDirection[t.data.key];if(this._pressed=s!=null,this._pressed){if(t.preventDefault(),i)switch(this.view.mapViewNavigation.begin(),s){case"clockwise":this.view.mapViewNavigation.continousRotateClockwise();break;case"counterClockwise":this.view.mapViewNavigation.continousRotateCounterclockwise();break;case"reset":this.view.mapViewNavigation.resetRotation()}else this._pressed=!1,this.view.mapViewNavigation.stop();t.stopPropagation()}}};var lm;(function(e){e[e.IN=0]="IN",e[e.OUT=1]="OUT"})(lm||(lm={}));let tle=class extends bs{constructor(t,i,r){super(!0),this.view=t,this.keys=i,this._keysToZoomAction={},this.registerIncoming("key-down",r,s=>this._handleKeyDown(s)),i.zoomIn.forEach(s=>this._keysToZoomAction[s]=lm.IN),i.zoomOut.forEach(s=>this._keysToZoomAction[s]=lm.OUT)}_handleKeyDown(t){this._handleKey(t)}_handleKey(t){const i=t.modifiers;if(i.size>0&&!i.has("Shift"))return;const{key:r}=t.data;if(!(r in this._keysToZoomAction))return;const s=this._keysToZoomAction[r],{mapViewNavigation:n}=this.view;let c=null;switch(s){case lm.IN:c=n.zoomIn();break;case lm.OUT:c=n.zoomOut();break;default:return}n.begin(),c.then(()=>n.end()),t.stopPropagation()}};const ile=.6;let rle=class extends bs{constructor(t,i){super(!0),this._view=t,this._canZoom=!0,this.registerIncoming("mouse-wheel",i,r=>this._handleMouseWheel(r))}_handleMouseWheel(t){if(!this._view.navigation.mouseWheelZoomEnabled||(t.preventDefault(),t.stopPropagation(),!this._canZoom))return;const i=this._view.mapViewNavigation,{x:r,y:s,deltaY:n}=t.data,c=1/ile**(1/60*n),o=i.zoom(c,[r,s]);o&&(this._canZoom=!1,o.catch(()=>{}).then(()=>{this._canZoom=!0,i.end()}))}},sle=class extends bs{constructor(t){super(!0),this.view=t,this.registerIncoming("drag",r=>this._handleDrag(r)),this.registerIncoming("pointer-down",()=>this._stopMomentumNavigation());const i=this.view.mapViewNavigation;this._dragEventSeparator=new t2({start:(r,s)=>{i.pinch.begin(this.view,s.data),s.stopPropagation()},update:(r,s)=>{i.pinch.update(this.view,s.data),s.stopPropagation()},end:(r,s)=>{i.pinch.end(this.view),s.stopPropagation()},condition:r=>r>=2})}_handleDrag(t){this._dragEventSeparator.handle(t)}_stopMomentumNavigation(){this.view.mapViewNavigation.pinch.stopMomentumNavigation()}};function KR(e){const t=e.native;return t?{buttons:t.buttons.map(i=>i.pressed?i.value||1:0),axes:t.axes.map(i=>ale(i,e.axisThreshold))}:{buttons:[],axes:[]}}function nle(e,t){if(e.axes.length!==t.axes.length||e.buttons.length!==t.buttons.length)return!1;for(let i=0;i{this._connectGamepad(n.gamepad)},this._onDisconnectGamepad=n=>{const c=n.gamepad,o=c.index,f=this._inputDevices[o];f&&(this._emitGamepadEvent(c,KR(f),!1),this._inputDevices.splice(o,1),this._latestUpdate.splice(o,1),this._input.gamepad.devices.remove(f),this.ensurePollingState())},this._frameTask=null,this._latestUpdate=new Array,this._inputDevices=new Array,this._callback=null;const r="getGamepads"in window.navigator,s=window.isSecureContext;this.supported=r&&s,this.supported&&(this._forEachGamepad(n=>this._connectGamepad(n)),window.addEventListener("gamepadconnected",this._onConnectGamepad),window.addEventListener("gamepaddisconnected",this._onDisconnectGamepad),this.ensurePollingState())}destroy(){this.hasEventListeners=!1,this.supported&&(window.removeEventListener("gamepadconnected",this._onConnectGamepad),window.removeEventListener("gamepaddisconnected",this._onDisconnectGamepad))}set hasEventListeners(t){this._hasEventListeners!==t&&(this._hasEventListeners=t,this.ensurePollingState())}get _eventsEnabled(){return this.supported&&this._inputDevices.length>0&&this._hasEventListeners}set onEvent(t){this._callback=t}_connectGamepad(t){const i=new B3(t);i.deviceType!=="unknown"&&(this._inputDevices[t.index]=i,this._input.gamepad.devices.add(i)),this.ensurePollingState()}ensurePollingState(){this._eventsEnabled?this._startPolling():this._stopPolling()}_startPolling(){this._frameTask==null&&(this._frameTask=Mm({update:()=>this._readGamepadState()}))}_stopPolling(){this._frameTask!=null&&(this._frameTask.remove(),this._frameTask=null,this._latestUpdate=new Array)}_readGamepadState(){const t=document.hasFocus(),i=this._element.contains(document.activeElement),r=this._input.gamepad.enabledFocusMode==="document"&&!t||this._input.gamepad.enabledFocusMode==="view"&&!i;this._forEachGamepad(s=>{const n=this._inputDevices[s.index];if(!n)return;const c=this._latestUpdate[s.index],o=KR(n),f=r||ole(o);c&&(c.timestamp===s.timestamp||!c.active&&f||nle(c.state,o))||this._emitGamepadEvent(s,o,!f)})}_forEachGamepad(t){const i=window.navigator.getGamepads();for(let r=0;r{},this._activePointerCaptures=new Set,this._keyDownState=new Set,this._eventId=1,this._browserTouchPanningEnabled=!1,this._element=t,t.getAttribute("tabindex")||t.setAttribute("tabindex","0"),this._eventHandlers={"key-down":this._handleKey,"key-up":this._handleKey,"pointer-down":this._handlePointer,"pointer-move":this._handlePointerPreventDefault,"pointer-up":this._handlePointerPreventDefault,"pointer-enter":this._handlePointer,"pointer-leave":this._handlePointer,"pointer-cancel":this._handlePointer,"mouse-wheel":this._handleMouseWheel,"pointer-capture-lost":this._handlePointerCaptureLost},this._updateTouchAction(),this._element.addEventListener("keydown",this._preventAltKeyDefault),this._gamepadSource=new lle(t,this._input),this._gamepadSource.onEvent=r=>this._callback("gamepad",r)}destroy(){this._callback=()=>{},this.activeEvents=null,this._activePointerCaptures.forEach(t=>{this._releasePointerCaptureSafe(t)}),this._gamepadSource=lr(this._gamepadSource),this._activePointerCaptures=null,this._removeTouchAction(),this._element.removeEventListener("keydown",this._preventAltKeyDefault)}get browserTouchPanningEnabled(){return this._browserTouchPanningEnabled}set browserTouchPanningEnabled(t){this._browserTouchPanningEnabled=t,this._updateTouchAction(),this._updateTouchEventHandling()}set onEventReceived(t){this._callback=t}set activeEvents(t){for(const i in this._active)if(!t||!t.has(i)){const r=this._active[i];this._element.removeEventListener(lT[i],r),delete this._active[i]}t&&t.forEach(i=>{if(!this._active[i]&&lT[i]){const r=(this._eventHandlers[i]||this._handleDefault).bind(this,i);this._element.addEventListener(lT[i],r),this._active[i]=r}}),this._gamepadSource.hasEventListeners=(t==null?void 0:t.has("gamepad"))??!1}setPointerCapture(t,i){i?this._setPointerCatpureSafe(t.pointerId):(this._releasePointerCaptureSafe(t.pointerId),this._activePointerCaptures.delete(t.pointerId))}_updateTouchAction(){this._element.classList.remove(this._browserTouchPanningEnabled?Pf.touchNone:Pf.touchPan),this._element.classList.add(this._browserTouchPanningEnabled?Pf.touchPan:Pf.touchNone)}_updateTouchEventHandling(){this._browserTouchPanningEnabled?this._element.addEventListener("touchmove",this._preventMultiTouchPanning):this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_removeTouchAction(){this._element.classList.remove(Pf.touchNone),this._element.classList.remove(Pf.touchPan),this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_setPointerCatpureSafe(t){try{this._element.setPointerCapture(t),this._activePointerCaptures.add(t)}catch{}}_releasePointerCaptureSafe(t){try{if(this._element.hasPointerCapture&&!this._element.hasPointerCapture(t))return;this._element.releasePointerCapture(t)}catch{}}_updateNormalizedPointerLikeEvent(t,i){const r=N8(this._element,t);return BB.test.disableSubpixelCoordinates&&(r.x=Math.round(r.x),r.y=Math.round(r.y)),i.x=r.x,i.y=r.y,i}_handleKey(t,i){const{key:r}=i;r&&t==="key-up"&&this._keyDownState.delete(r);const s={native:i,key:r,repeat:!!r&&this._keyDownState.has(r)};r&&t==="key-down"&&this._keyDownState.add(s.key),this._callback(t,s)}_handlePointer(t,i){const r=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,pointerType:i.pointerType,button:i.button,buttons:i.buttons,eventId:this._eventId++});this._callback(t,r)}_handlePointerPreventDefault(t,i){const r=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,pointerType:i.pointerType,button:i.button,buttons:i.buttons,eventId:this._eventId++});i.preventDefault(),this._callback(t,r)}_handleMouseWheel(t,i){let r=i.deltaY;switch(i.deltaMode){case 0:XR&&(r=r/document.documentElement.clientHeight*600);break;case 1:r*=30;break;case 2:r*=900}XR?r*=.7:cle||hle?r*=.6:ule&&(r*=1.375);const s=100,n=Math.abs(r);n>s&&(r=r/n*200/(1+Math.exp(-.02*(n-s))));const c=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,deltaY:r});this._callback(t,c)}_handlePointerCaptureLost(t,i){this._activePointerCaptures.delete(i.pointerId),this._handleDefault(t,i)}_handleDefault(t,i){const r={native:i};i.preventDefault(),this._callback(t,r)}_preventAltKeyDefault(t){t.key==="Alt"&&t.preventDefault()}_preventMultiTouchPanning(t){t.touches.length>1&&t.preventDefault()}};FB.test={disableSubpixelCoordinates:!1};const lT={"key-down":"keydown","key-up":"keyup","pointer-down":"pointerdown","pointer-up":"pointerup","pointer-move":"pointermove","mouse-wheel":"wheel","pointer-capture-got":"gotpointercapture","pointer-capture-lost":"lostpointercapture","context-menu":"contextmenu","pointer-enter":"pointerenter","pointer-leave":"pointerleave","pointer-cancel":"pointercancel",focus:"focus",blur:"blur"};let dle=class extends bs{constructor(){super(!0),this.registerIncoming("context-menu",t=>{t.data.native.preventDefault()})}};const Ws={maximumClickDelay:300,movementUntilMouseDrag:1.5,movementUntilPenDrag:6,movementUntilTouchDrag:6,holdDelay:500,maximumDoubleClickDelay:250,maximumDoubleClickDistance:10,maximumDoubleTouchDelay:350,maximumDoubleTouchDistance:35};function Vw(e,t){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)}function ple(e,t){const i=t.x-e.x,r=t.y-e.y;return Math.sqrt(i*i+r*r)}function fle(e,t){if(t?(t.radius=0,t.center.x=0,t.center.y=0):t={radius:0,center:Dn()},e.length===0)return t;if(e.length===1)return t.center.x=e[0].x,t.center.y=e[0].y,t;if(e.length===2){const[me,ge]=e,[Ie,Ce]=[ge.x-me.x,ge.y-me.y];return t.radius=Math.sqrt(Ie*Ie+Ce*Ce)/2,t.center.x=(me.x+ge.x)/2,t.center.y=(me.y+ge.y)/2,t}let i=0,r=0;for(let me=0;meme.x-i),n=e.map(me=>me.y-r);let c=0,o=0,f=0,g=0,S=0,I=0,A=0;for(let me=0;methis._dragStart(c,o),update:(c,o)=>this._dragUpdate(o),end:(c,o)=>this._dragEnd(o)}),this.registerIncoming("drag",c=>this._dragEventSeparator.handle(c)),this.registerIncoming("pointer-down",c=>this._handlePointerDown(c)),this.registerIncoming("pointer-up",()=>this._handlePointerUp())}onUninstall(){this._pointerState.forEach(t=>{t.doubleTapTimeout=Sr(t.doubleTapTimeout)})}get hasPendingInputs(){return dx(this._pointerState,t=>t.doubleTapTimeout!=null)}_clearPointerDown(t){const i=this._pointerState.get(t);i&&(i.doubleTapTimeout=Sr(i.doubleTapTimeout),this._pointerState.delete(t),this.refreshHasPendingInputs())}_createDoubleTapDragData(t,i,r){const{button:s,buttons:n,pointer:c,pointers:o,pointerType:f,timestamp:g}=r;return{action:t,delta:i,button:s,buttons:n,pointer:c,pointers:o,pointerType:f,timestamp:g}}_dragStart(t,i){if(!this._doubleTapDragReady||t!==1)return;this._doubleTapDragReady=!1,this._doubleTapDragActive=!0;const{data:r,modifiers:s}=i,{center:n}=r;this._dragStartCenter=n;const c=this._createDoubleTapDragData("begin",Dn(0,0),r);this._doubleTapDrag.emit(c,void 0,s),i.stopPropagation()}_dragUpdate(t){if(!this._doubleTapDragActive)return;const{data:i,modifiers:r}=t,{center:s}=i,n=Dn(s.x-this._dragStartCenter.x,s.y-this._dragStartCenter.y),c=this._createDoubleTapDragData("update",n,i);this._doubleTapDrag.emit(c,void 0,r),t.stopPropagation()}_dragEnd(t){if(!this._doubleTapDragActive)return;const{data:i,modifiers:r}=t,{center:s}=i,n=Dn(s.x-this._dragStartCenter.x,s.y-this._dragStartCenter.y),c=this._createDoubleTapDragData("end",n,i);this._doubleTapDrag.emit(c,void 0,r),this._doubleTapDragActive=!1,t.stopPropagation()}_handlePointerDown(t){const{data:i}=t,r=hp(i),s=this._pointerState.get(r),{pointerType:n}=i.native;if(s){const c=n==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;this._clearPointerDown(r),Vw(s.event.data,i)>c?this._storePointerDown(t):this._doubleTapDragReady=!0}else this._storePointerDown(t)}_handlePointerUp(){this._doubleTapDragReady=!1}_storePointerDown(t){const{data:i}=t,{pointerType:r}=i.native,s=hp(i),n=r==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,c=this._clock.setTimeout(()=>this._clearPointerDown(s),n);this._pointerState.set(s,{event:t,doubleTapTimeout:c}),this.refreshHasPendingInputs()}},yle=class extends bs{constructor(t){super(!1),this._navigationTouch=t,this._startStateModifiers=new Set,this._activePointerMap=new Map,this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._drag=this.registerOutgoing("drag"),this.registerIncoming("pointer-drag",this._handlePointerDrag.bind(this)),this.registerIncoming("pointer-up",this._handlePointerUpAndPointerLost.bind(this)),this.registerIncoming("pointer-capture-lost",this._handlePointerUpAndPointerLost.bind(this)),this.registerIncoming("pointer-cancel",this._handlePointerUpAndPointerLost.bind(this))}_createPayload(t,i,r,s){return{action:t,pointerType:this._pointerType,button:this._mouseButton,buttons:i.buttons,timestamp:s,pointers:gle(this._activePointerMap),pointer:i,angle:r.angle,radius:r.radius,center:r.center}}_addPointer(t){const i=t.native.pointerId,r=Mv(this._activePointerMap).angle,s={event:t,initialAngle:0,lastAngle:0};this._activePointerMap.set(i,s);const n=Pb(s,UB(this._activePointerMap));s.initialAngle=n,s.lastAngle=n,this._updatePointerAngles(r)}_updatePointer(t){if(t&&t.x==null&&t.y==null)return;const i=t.native.pointerId,r=this._activePointerMap.get(i);r?r.event=t:this._addPointer(t)}_removePointer(t){const i=Mv(this._activePointerMap).angle;this._activePointerMap.delete(t),this._updatePointerAngles(i)}_updatePointerAngles(t){const i=Mv(this._activePointerMap);this._activePointerMap.forEach(r=>{r.initialAngle=Pb(r,i)-t,r.lastAngle=Pb(r,i)-t})}_emitEvent(t,i,r){const s=Mv(this._activePointerMap);this._drag.emit(this._createPayload(t,i,s,r),void 0,this._startStateModifiers)}_handlePointerUpAndPointerLost(t){const i=t.data.native.pointerId,r=t.timestamp;this._activePointerMap.get(i)&&(this._activePointerMap.size===1?(this._updatePointer(t.data),!this._isCurrentDragSuppressed&&this._emitEvent("end",t.data,r),this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._removePointer(i)):(this._removePointer(i),this._emitEvent("removed",t.data,t.timestamp)))}_handlePointerDrag(t){const i=t.data,r=i.currentEvent,s=t.timestamp;switch(i.action){case"start":case"update":this._isDragging?this._activePointerMap.has(r.native.pointerId)?(this._updatePointer(r),!this._isCurrentDragSuppressed&&this._emitEvent("update",r,s)):(this._addPointer(r),this._emitEvent("added",r,s),this._isCurrentDragSuppressed=this._isSuppressed):(this._updatePointer(r),this._pointerType=t.data.startEvent.pointerType,this._mouseButton=t.data.startEvent.button,this._startStateModifiers=t.modifiers,this._isDragging=!0,this._isCurrentDragSuppressed=this._isSuppressed,!this._isCurrentDragSuppressed&&this._emitEvent("start",r,s))}}get _isSuppressed(){return!!this._navigationTouch&&!this._navigationTouch.browserTouchPanEnabled&&this._pointerType==="touch"&&this._activePointerMap.size===1}};function UB(e){const t=[];return e.forEach(i=>{t.push(Dn(i.event.x,i.event.y))}),fle(t)}function Mv(e){const t=UB(e);let i=0;return e.forEach(r=>{let s=Pb(r,t),n=s-r.lastAngle;for(;n>Math.PI;)n-=2*Math.PI;for(;n<-Math.PI;)n+=2*Math.PI;s=r.lastAngle+n,r.lastAngle=s;const c=s-r.initialAngle;i+=c}),i/=e.size||1,{angle:i,radius:t.radius,center:t.center}}function gle(e){const t=new Map;return e.forEach((i,r)=>t.set(r,i.event)),t}function Pb(e,t){const i=e.event,r=i.x-t.center.x,s=i.y-t.center.y;return Math.atan2(s,r)}var eO;(function(e){e[e.Left=0]="Left",e[e.Middle=1]="Middle",e[e.Right=2]="Right",e[e.Back=3]="Back",e[e.Forward=4]="Forward",e[e.Undefined=-1]="Undefined"})(eO||(eO={}));let _le=class extends bs{constructor(t=Ws.maximumDoubleClickDelay,i=Ws.maximumDoubleClickDistance,r=Ws.maximumDoubleTouchDelay,s=Ws.maximumDoubleTouchDistance,n=Vm){super(!1),this._maximumDoubleClickDelay=t,this._maximumDoubleClickDistance=i,this._maximumDoubleTouchDelay=r,this._maximumDoubleTouchDistance=s,this._clock=n,this._pointerState=new Map,this._immediateDoubleClick=this.registerOutgoing("immediate-double-click"),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this)),this.registerIncoming("pointer-up",this._handlePointerUp.bind(this))}onUninstall(){this._pointerState.forEach(t=>{t.immediateDoubleClick&&t.immediateDoubleClick.timeoutHandle.remove()}),super.onUninstall()}_handlePointerDown(t){const i=t.data,r=hp(i);if(!this._pointerState.has(r)){const s={downButton:i.native.button,x:i.x,y:i.y,immediateDoubleClick:null};this._pointerState.set(r,s),this.startCapturingPointer(i.native)}}_handlePointerUp(t){const i=t.data,r=hp(i),s=this._pointerState.get(r);if(s&&s.downButton===i.native.button){const n=s.immediateDoubleClick,c=t.data.native.pointerType==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;n?(n.timeoutHandle.remove(),Vw(n,t.data)>c?this._startImmediateDoubleClick(t,s):(this._immediateDoubleClick.emit(t.data,void 0,n.modifiers),this._removeState(i))):Vw(s,t.data)>c?this._removeState(i):this._startImmediateDoubleClick(t,s)}}_startImmediateDoubleClick(t,i){const r=t.data.native.pointerType==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay;i.immediateDoubleClick={x:t.data.x,y:t.data.y,modifiers:t.modifiers,timeoutHandle:this._clock.setTimeout(()=>this._removeState(t.data),r)}}_removeState(t){const i=hp(t);this._pointerState.delete(i),this.stopCapturingPointer(t.native),this.refreshHasPendingInputs()}},vle=class extends bs{constructor(t=Ws.maximumClickDelay,i=Ws.movementUntilMouseDrag,r=Ws.movementUntilPenDrag,s=Ws.movementUntilTouchDrag,n=Ws.holdDelay,c=Vm){super(!1),this._maximumClickDelay=t,this._movementUntilMouseDrag=i,this._movementUntilPenDrag=r,this._movementUntilTouchDrag=s,this._holdDelay=n,this._clock=c,this._pointerState=new Map,this._pointerDrag=this.registerOutgoing("pointer-drag"),this._immediateClick=this.registerOutgoing("immediate-click"),this._pointerHold=this.registerOutgoing("hold"),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this)),this.registerIncoming("pointer-up",o=>{this._handlePointerLoss(o,"pointer-up")}),this.registerIncoming("pointer-capture-lost",o=>{this._handlePointerLoss(o,"pointer-capture-lost")}),this.registerIncoming("pointer-cancel",o=>{this._handlePointerLoss(o,"pointer-cancel")}),this._moveHandle=this.registerIncoming("pointer-move",this._handlePointerMove.bind(this)),this._moveHandle.pause()}onUninstall(){this._pointerState.forEach(t=>{t.holdTimeout=Sr(t.holdTimeout)}),super.onUninstall()}_handlePointerDown(t){const i=t.data,r=i.native.pointerId;let s=null;this._pointerState.size===0&&(s=this._clock.setTimeout(()=>{const c=this._pointerState.get(r);if(c){if(!c.isDragging){const o=c.previousEvent;this._pointerHold.emit(o,void 0,t.modifiers),c.holdEmitted=!0}c.holdTimeout=null}},this._holdDelay));const n={startEvent:i,previousEvent:i,startTimestamp:t.timestamp,isDragging:!1,downButton:i.native.button,holdTimeout:s,modifiers:new Set};this._pointerState.set(r,n),this.startCapturingPointer(i.native),this._moveHandle.resume(),this._pointerState.size>1&&this._startDragging(t)}_createPointerDragData(t,i,r){return{action:t,startEvent:i.startEvent,previousEvent:i.previousEvent,currentEvent:r}}_handlePointerMove(t){const i=t.data,r=i.native.pointerId,s=this._pointerState.get(r);s&&(s.isDragging?this._pointerDrag.emit(this._createPointerDragData("update",s,i),void 0,s.modifiers):ple(i,s.startEvent)>this._getDragThreshold(i.native.pointerType)&&this._startDragging(t),s.previousEvent=i)}_getDragThreshold(t){switch(t){case"touch":return this._movementUntilTouchDrag;case"pen":return this._movementUntilPenDrag;default:return this._movementUntilMouseDrag}}_startDragging(t){const i=t.data,r=i.native.pointerId;this._pointerState.forEach(s=>{s.holdTimeout!=null&&(s.holdTimeout.remove(),s.holdTimeout=null),s.isDragging||(s.modifiers=t.modifiers,s.isDragging=!0,r===s.startEvent.native.pointerId?this._pointerDrag.emit(this._createPointerDragData("start",s,i)):this._pointerDrag.emit(this._createPointerDragData("start",s,s.previousEvent),t.timestamp))})}_handlePointerLoss(t,i){const r=t.data,s=r.native.pointerId,n=this._pointerState.get(s);n&&(n.holdTimeout!=null&&(n.holdTimeout.remove(),n.holdTimeout=null),n.isDragging?this._pointerDrag.emit(this._createPointerDragData("end",n,i==="pointer-up"?r:n.previousEvent),void 0,n.modifiers):i==="pointer-up"&&n.downButton===r.native.button&&t.timestamp-n.startTimestamp<=this._maximumClickDelay&&!n.holdEmitted&&this._immediateClick.emit(r),this._pointerState.delete(s),this.stopCapturingPointer(r.native),this._pointerState.size===0&&this._moveHandle.pause())}},ble=class extends bs{constructor(t=Ws.maximumDoubleClickDelay,i=Ws.maximumDoubleClickDistance,r=Ws.maximumDoubleTouchDelay,s=Ws.maximumDoubleTouchDistance,n=Vm){super(!1),this._maximumDoubleClickDelay=t,this._maximumDoubleClickDistance=i,this._maximumDoubleTouchDelay=r,this._maximumDoubleTouchDistance=s,this._clock=n,this._pointerState=new Map,this._click=this.registerOutgoing("click"),this._doubleClick=this.registerOutgoing("double-click"),this.registerIncoming("immediate-click",this._handleImmediateClick.bind(this)),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this))}onUninstall(){this._pointerState.forEach(t=>t.doubleClickTimer=Sr(t.doubleClickTimer))}get hasPendingInputs(){return dx(this._pointerState,t=>t.doubleClickTimer!=null)}_clearDoubleClickTimer(t,i){const r=this._pointerState.get(t);r&&(r.doubleClickTimer=Sr(r.doubleClickTimer),i&&this._click.emit(r.event.data,void 0,r.event.modifiers),this._pointerState.delete(t),this.refreshHasPendingInputs())}_doubleClickTimeoutExceeded(t){const i=this._pointerState.get(t);i.pointerDownCount===1&&this._click.emit(i.event.data,void 0,i.event.modifiers),i.doubleClickTimer=null,this._pointerState.delete(t),this.refreshHasPendingInputs()}_getPointerId(t){const{pointerId:i,pointerType:r,button:s}=t.native;return r==="mouse"?`${i}:${s}`:`${r}`}_handleImmediateClick(t){const i=t.data,{pointerType:r}=i.native,s=this._getPointerId(i);if(!this._pointerState.has(s))return void this._startClick(t);const n=this._pointerState.get(s),{data:c,modifiers:o}=n.event,f=r==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;Vw(c,i)>f?(this._clearDoubleClickTimer(s,!0),this._startClick(t)):(this._clearDoubleClickTimer(s,!1),n.pointerDownCount===2&&this._doubleClick.emit(c,void 0,o))}_handlePointerDown(t){const i=hp(t.data),r=this._pointerState.get(i);r&&(r.pointerDownCount+=1)}_startClick(t){const{data:i}=t,{native:{pointerType:r}}=i,s=hp(i),n=r==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,c=this._clock.setTimeout(()=>this._doubleClickTimeoutExceeded(s),n);this._pointerState.set(s,{event:t,doubleClickTimer:c,pointerDownCount:1}),this.refreshHasPendingInputs()}};const Iv={counter:"Ctrl",pan:{left:"ArrowLeft",right:"ArrowRight",up:"ArrowUp",down:"ArrowDown"},zoom:{zoomIn:["=","+"],zoomOut:["-","_"]},rotate:{clockwiseOption1:"a",clockwiseOption2:"A",counterClockwiseOption1:"d",counterClockwiseOption2:"D",resetOption1:"n",resetOption2:"N"}};let Rd=class extends Nt{initialize(){const t=()=>{var i;return(i=this.view)==null?void 0:i.ready};this.addHandles([gh(()=>!t(),()=>this._disconnect()),gh(t,()=>this._connect())])}destroy(){this._disconnect()}get latestPointerType(){var t;return(t=this._inputManager)==null?void 0:t.latestPointerType}get latestPointerLocation(){var t;return(t=this._inputManager)==null?void 0:t.latestPointerLocation}get multiTouchActive(){var t;return((t=this._inputManager)==null?void 0:t.multiTouchActive)??!1}isModifierKeyDown(t){var i;return((i=this._inputManager)==null?void 0:i.isModifierKeyDown(t))??!1}_disconnect(){this.view.viewEvents.disconnect(),this._inputManager=lr(this._inputManager)}_connect(){const t=this.view.surface,i=new FB(t,this.view.input),r=[new _le,new vle,new ble,new yle(this.view.navigation),new mle],s=new Go({eventSource:i,recognizers:r});s.installHandlers("prevent-context-menu",[new dle],uh.INTERNAL),s.installHandlers("navigation",[new sle(this.view),new Yae(this.view),new rle(this.view),new JR(this.view),new JR(this.view,[Iv.counter]),new Gae(this.view,"primary"),new Qae(this.view,Iv.pan),new tle(this.view,Iv.zoom),new ele(this.view,Iv.rotate),new qae(this.view,"secondary"),new Vae(this.view,"touch")],uh.INTERNAL),this.view.viewEvents.connect(s),this._source=i,this._inputManager=s,ti(()=>{var n,c;return(c=(n=this.view)==null?void 0:n.navigation)==null?void 0:c.browserTouchPanEnabled},n=>{this._source&&(this._source.browserTouchPanningEnabled=!n)},_n)}get test(){return{inputManager:this._inputManager}}};v([M()],Rd.prototype,"view",void 0),v([M()],Rd.prototype,"latestPointerType",null),v([M()],Rd.prototype,"latestPointerLocation",null),v([M()],Rd.prototype,"multiTouchActive",null),Rd=v([fe("esri.views.2d.input.MapViewInputManager")],Rd);const wle=Rd;var cve=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xle(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tO,iO,rO,jB={exports:{}};tO=jB,iO=function(){function e(s,n,c,o,f){t(s,n,c||0,o||s.length-1,f||r)}function t(s,n,c,o,f){for(;o>c;){if(o-c>600){var g=o-c+1,S=n-c+1,I=Math.log(g),A=.5*Math.exp(2*I/3),O=.5*Math.sqrt(I*A*(g-A)/g)*(S-g/2<0?-1:1);t(s,n,Math.max(c,Math.floor(n-S*A/g+O)),Math.min(o,Math.floor(n+(g-S)*A/g+O)),f)}var z=s[n],V=c,H=o;for(i(s,c,n),f(s[o],z)>0&&i(s,c,o);V0;)H--}f(s[c],z)===0?i(s,c,H):i(s,++H,o),H<=n&&(c=H+1),n<=H&&(o=H-1)}}function i(s,n,c){var o=s[n];s[n]=s[c],s[c]=o}function r(s,n){return sn?1:0}return e},(rO=iO())!==void 0&&(tO.exports=rO);const Sle=xle(jB.exports);function Gw(e,t){if(!(this instanceof Gw))return new Gw(e,t);this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&(typeof t=="function"?this.toBBox=t:this._initFormat(t)),this.clear()}function Tle(e,t,i){if(!i)return t.indexOf(e);for(var r=0;r=e.minX&&t.maxY>=e.minY}function Zf(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function oO(e,t,i,r,s){for(var n,c=[t,i];c.length;)(i=c.pop())-(t=c.pop())<=r||(n=t+Math.ceil((i-t)/r/2)*r,Sle(e,n,t,i,s),c.push(t,n,n,i))}Gw.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,i=[],r=this.toBBox;if(!Pv(e,t))return i;for(var s,n,c,o,f=[];t;){for(s=0,n=t.children.length;s=0&&n[t].children.length>this._maxEntries;)this._split(n,t),t--;this._adjustParentBBoxes(s,n,t)},_split:function(e,t){var i=e[t],r=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,r);var n=this._chooseSplitIndex(i,s,r),c=Zf(i.children.splice(n,i.children.length-n));c.height=i.height,c.leaf=i.leaf,Cf(i,this.toBBox),Cf(c,this.toBBox),t?e[t-1].children.push(c):this._splitRoot(i,c)},_splitRoot:function(e,t){this.data=Zf([e,t]),this.data.height=e.height+1,this.data.leaf=!1,Cf(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,i){var r,s,n,c,o,f,g,S;for(f=g=1/0,r=t;r<=i-t;r++)c=Mle(s=o0(e,0,r,this.toBBox),n=o0(e,r,i,this.toBBox)),o=cT(s)+cT(n),c=t;s--)n=e.children[s],a0(f,e.leaf?c(n):n),g+=Av(f);return g},_adjustParentBBoxes:function(e,t,i){for(var r=i;r>=0;r--)a0(t[r],e)},_condense:function(e){for(var t,i=e.length-1;i>=0;i--)e[i].children.length===0?i>0?(t=e[i-1].children).splice(t.indexOf(e[i]),1):this.clear():Cf(e[i],this.toBBox)},_initFormat:function(e){var t=["return a"," - b",";"];this.compareMinX=new Function("a","b",t.join(e[0])),this.compareMinY=new Function("a","b",t.join(e[1])),this.toBBox=new Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}};let aO=class VB{constructor(t,i){this.key=new Fl(0,0,0,0),this.bounds=eo(),this.objectIds=new Set,this.key.set(i);const r=t.getLODInfoAt(this.key);this.tileInfoView=t,this.tileInfoView.getTileBounds(this.bounds,this.key,!0),this.resolution=r.resolution,this.scale=r.scale,this.level=r.level}get lod(){return this.tileInfoView.getLODInfoAt(this.key)}get id(){return this.key.id}get extent(){return Ui.fromBounds(this.bounds,this.tileInfoView.tileInfo.spatialReference)}get transform(){return{originPosition:"upperLeft",scale:[this.resolution,this.resolution],translate:[this.bounds[0],this.bounds[3]]}}createArcadeEvaluationOptions(t){return{$view:{scale:this.scale,timeZone:t}}}createChildTiles(){const t=this.key.getChildKeys(),i=kn.acquire();for(let r=0;rs?[eo([e[0],e[1],s,e[3]]),eo([r,e[1],r+e[2]-s,e[3]])]:e[0]({minX:i.bounds[0],minY:i.bounds[1],maxX:i.bounds[2],maxY:i.bounds[3]}):[".bounds[0]",".bounds[1]",".bounds[2]",".bounds[3]"]),this.tiles=[],this.tileScheme=t}destroy(){this.clear()}clear(){this.tiles.length=0,this._tiles.clear(),this._index.clear()}has(t){return this._tiles.has(t)}get(t){return this._tiles.get(t)}getIntersectingTiles(t){if(!t||c6(t)===0||u6(t)===0)return[];const i=Ale(t,this.tileScheme.spatialReference);return i!=null?[...new Set([...this.boundsIntersections(i[0]),...this.boundsIntersections(i[1])])]:this.boundsIntersections(t)}boundsIntersections(t){return this._index.search({minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]})}updateTiles(t){const i={added:[],removed:[]};for(const r of t.added)if(!this.has(r)){const s=new aO(this.tileScheme,r);this._tiles.set(r,s),this._index.insert(s),i.added.push(s)}for(const r of t.removed)if(this.has(r)){const s=this.get(r);this._tiles.delete(r),this._index.remove(s),i.removed.push(s)}this.tiles.length=0,this._tiles.forEach(r=>this.tiles.push(r)),(i.added.length||i.removed.length)&&this.emit("update",i)}setViewState(t){const i=this.tileScheme.getTileCoverage(t,0);if(!i)return;const{spans:r,lodInfo:s}=i,{level:n}=s;if(r.length>0)for(const{row:c,colFrom:o,colTo:f}of r)for(let g=o;g<=f;g++){const S=Ile.set(n,c,s.normalizeCol(g),s.getWorldForColumn(g)).id;if(hT.add(S),!this.has(S)){const I=new aO(this.tileScheme,S);this._tiles.set(S,I),this._index.insert(I),this.tiles.push(I),od.added.push(I)}}for(let c=this.tiles.length-1;c>=0;c--){const o=this.tiles[c];hT.has(o.id)||(this._tiles.delete(o.id),this.tiles.splice(c,1),this._index.remove(o),od.removed.push(o))}(od.added.length||od.removed.length)&&this.emit("update",od),o_.pool.release(i),hT.clear(),od.added.length=0,od.removed.length=0}},Hu=class extends Nt{constructor(){super(...arguments),this.color=new zt([0,255,255]),this.haloOpacity=1,this.fillOpacity=.25,this.multiHighlightEnabled=!1}equals(t){return this.color.equals(t.color)&&(this.haloColor||this.color).equals(t.haloColor||t.color)&&this.haloOpacity===t.haloOpacity&&this.fillOpacity===t.fillOpacity&&this.multiHighlightEnabled===t.multiHighlightEnabled}};v([M({type:zt})],Hu.prototype,"color",void 0),v([M({type:zt})],Hu.prototype,"haloColor",void 0),v([M()],Hu.prototype,"haloOpacity",void 0),v([M()],Hu.prototype,"fillOpacity",void 0),v([M()],Hu.prototype,"multiHighlightEnabled",void 0),Hu=v([fe("esri.views.2d.support.HighlightOptions")],Hu);const GB=Hu;async function Cle(e,t,i){const r=F8(t)?z8(e,t):t;if(!e.ready||isNaN(r.x)||isNaN(r.y))return{screenPoint:r,results:[]};let s=new Set;const n=new Set;let c=!1,o=null,f=null;i!=null&&i.include?cO(i.include,lO(e,A=>{s.add(A),dT(A,O=>n.add(O))},(A,O)=>{n.add(A),s.add(O)},A=>{o||(o=new Set),o.add(A)},A=>s.add(A),()=>c=!0)):(c=!0,s=new Set(e.allLayerViews),s.forEach(A=>{dT(A,O=>n.add(O))})),i!=null&&i.exclude&&cO(i.exclude,lO(e,A=>{s.delete(A),dT(A,O=>n.delete(O))},A=>n.delete(A),A=>{f||(f=new Set),f.add(A)}));const g=e.allLayerViews.filter(A=>!A.suspended&&s.has(A)).reverse(),S=e.toMap(r);let I=[...c?e.graphicsView.hitTest(S).map(A=>({type:"graphic",graphic:A,layer:null,mapPoint:S})):[],...await Promise.all(g.map(A=>A.hitTest(S,r)).toArray())].filter(N0).flat().filter(N0);return I=I.filter(A=>{var O;return A.type!=="graphic"||((O=A.layer)==null?void 0:O.type)!=="subtype-group"||n.has(A.graphic.layer)}),o&&(I=I.filter(A=>!("graphic"in A)||!A.graphic||(o==null?void 0:o.has(SI(A.graphic))))),f&&(I=I.filter(A=>!("graphic"in A)||!A.graphic||!(f!=null&&f.has(SI(A.graphic))))),{screenPoint:r,results:I}}function lO(e,t,i,r,s,n){return c=>{if(c instanceof YM){if(c.layer===e)n==null||n();else{const o=e.allLayerViews.find(f=>f.layer===c.layer);o&&(s==null||s(o))}r(SI(c))}else if(c.type==="subtype-sublayer"){const o=e.allLayerViews.find(f=>f.layer===c.parent);o&&i(c,o)}else{const o=e.allLayerViews.find(f=>f.layer===c);o&&t(o)}}}function cO(e,t){if(e)if(Gb(e))for(const i of e)if(Gb(i))for(const r of i)t(r);else t(i);else t(e)}function SI(e){var i,r;const t=e.getObjectId();return t?`${((i=e.layer)==null?void 0:i.uid)??((r=e.sourceLayer)==null?void 0:r.uid)??"MapView"}/${t}`:`"MapView/${e.uid}`}function dT({layer:e},t){e.type==="subtype-group"&&e.sublayers.forEach(i=>{t(i)})}function $le(e,t,i){const{ctx:r,canvas:s}=qB(e,i),n=r.getImageData(0,0,e.width,e.height),c=Ole(s,t);return HB(s),{dataUrl:c,data:n}}function kle(e,t){const{ctx:i,canvas:r}=qB(e,t),s=i.getImageData(0,0,e.width,e.height);return HB(r),s}function qB(e,t){const i=Rle();t.premultipliedAlpha&&Fle(e),i.width=e.width,i.height=e.height;const r=i.getContext("2d",{willReadFrequently:!0});return r.putImageData(e,0,0),t.flipY&&zle(r),{ctx:r,canvas:i}}function HB(e){e.width=0,e.height=0}function Rle(){return pT==null&&(pT=document.createElement("canvas")),pT}let pT=null;function Ole(e,t){const i=Ble[t.format],r=t.quality/100;return e.toDataURL(i,r)}function Lle(e,t){const i=Nle(e),r=jle[i];return{format:i,quality:Ll(t??r,0,100)}}function Dle(e,t){return t/Math.max(e[0],e[1])}function dve(e,t,i,r=0,s=0,n=e.width-r,c=e.height-s,o=!1){const{data:f}=e,{width:g,height:S,data:I}=t,A=n/g,O=c/S,z=Math.ceil(A/2),V=Math.ceil(O/2),H=e.width;for(let Q=0;Q=1)continue;let Ft=2*Kt*Kt*Kt-3*Kt*Kt+1;const ji=4*(r+vi+(s+ot)*H);tt+=Ft*f[ji+3],Ie+=Ft,!i&&f[ji+3]<255&&(Ft=Ft*f[ji+3]/255),Ce+=Ft*f[ji],ze+=Ft*f[ji+1],je+=Ft*f[ji+2],ge+=Ft}}I[me]=Ce/ge,I[me+1]=ze/ge,I[me+2]=je/ge,I[me+3]=tt/Ie}return t}function Nle(e){switch(e){case"png":case"jpg":case"jpeg":return e;default:return Ule}}function zle(e){e.save(),e.globalCompositeOperation="copy",e.scale(1,-1),e.translate(0,-e.canvas.height),e.drawImage(e.canvas,0,0),e.restore()}function Fle(e){const t=e.data,i=t.length;for(let r=0;r0){const n=255/s;t[r]=t[r]*n,t[r+1]=t[r+1]*n,t[r+2]=t[r+2]*n}}}const Ble={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg"},uO=98,Ule="png",jle={png:100,jpg:uO,jpeg:uO},WB={flipY:!0,premultipliedAlpha:!0};async function Vle(e,t){const i=await ZB(e,t),{format:r,quality:s}=Lle(t==null?void 0:t.format,t==null?void 0:t.quality);return $le(i,{format:r,quality:s,rotation:0,disableDecorations:!1},WB)}async function Gle(e,t){const i=await ZB(e,t);return kle(i,WB)}function ZB(e,t){const i=Wle(t||{},Hle(e.stage,e.size),e.size,e.padding),r=qle(t,e.allLayerViews);return e.stage.takeScreenshot(i,r,e.backgroundColor,t==null?void 0:t.rotation)}function qle(e={},t){if(!e.layers)return;const i=[];return e.layers.forEach(r=>{const s=t.find(n=>n.layer.id===r.id);s!=null&&s.container&&i.push(s.container)}),i}function Hle(e,t){return Math.min(4,Dle(t,Math.min(4096,e.context.parameters.maxTextureSize)))}function Wle(e,t,i,r){e.ignorePadding&&(r={left:0,right:0,top:0,bottom:0});let s=null;e.width!=null&&e.height!=null?s=[e.width,e.height]:e.width==null&&e.height!=null?s=[e.height,e.height]:e.width!=null&&e.height==null?s=[e.width,e.width]:e.width==null&&e.height==null&&(s=null);const n=i[0]-(r.left+r.right),c=i[1]-(r.top+r.bottom);let o,f,g=e.area||{x:0,y:0,width:n,height:c};if(s){const S=n/c,I=s[0]/s[1];if(I>S){const A=g.width/I;g={x:g.x,y:Math.round(g.y+(g.height-A)/2),width:g.width,height:Math.round(A)}}else{const A=g.height*I;g={x:Math.round(g.x+(g.width-A)/2),y:g.y,width:Math.round(A),height:g.height}}}else s=[g.width,g.height];return s[0]>g.width?(o=Math.min(s[0]/g.width,t),f=s[0]/g.width/o):(o=1,f=s[0]/g.width),{cropArea:{x:Math.round((g.x+r.left)*o),y:Math.round((g.y+r.top)*o),width:Math.round(g.width*o),height:Math.round(g.height*o)},outputScale:f,resolutionScale:o}}const hO=160;let l0=class extends Nt{constructor(){super(...arguments),this._timer=void 0}get stationary(){return!this._timer}flip(){this._timestamp=performance.now(),this._timer==null&&(this._timer=setInterval(()=>{performance.now()-this._timestamp>=hO&&this.clear()},hO))}clear(){this._timer&&(clearInterval(this._timer),this._timer=void 0)}};v([M()],l0.prototype,"_timer",void 0),v([M()],l0.prototype,"stationary",null),l0=v([fe("esri.views.2d.support.StationaryManager")],l0);const Zle=e=>e.includes("Brush");let YB=class{constructor(){this._names=new Map}begin(t){this._names.has(t)||(this._names.set(t,!1),Zle(t)&&this.record("Esri.FirstDraw"),performance.mark(`Esri.${t}.Start`))}end(t){this._names.has(t)&&!this._names.get(t)&&(this._names.set(t,!0),performance.mark(`Esri.${t}.End`))}record(t){this._names.has(t)||(this._names.set(t,!0),performance.mark(`Esri.${t}`))}};function dO(e,t={}){return e.getContext("webgl2",t)||null}let fT;function TI(){return fT||(fT=Kle()),fT}let Yle=class{constructor(){this.available=!1,this.majorPerformanceCaveat=!1,this.maxTextureSize=0,this.supportsVertexShaderSamplers=!1,this.supportsHighPrecisionFragment=!1,this.supportsColorBufferFloat=!1,this.supportsColorBufferFloatBlend=!1,this.supportsColorBufferHalfFloat=!1}};function Jle(e){if(typeof WebGL2RenderingContext>"u")return null;const t=document.createElement("canvas");if(!t)return null;let i=dO(t,{failIfMajorPerformanceCaveat:!0});if(i==null&&(i=dO(t),i!=null&&(e.majorPerformanceCaveat=!0)),i==null)return i;e.available=!0,e.maxTextureSize=i.getParameter(i.MAX_TEXTURE_SIZE),e.supportsVertexShaderSamplers=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0;const r=i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT);return r&&(e.supportsHighPrecisionFragment=r.precision>0),i}function Kle(){const e=new Yle,t=Jle(e);return t==null||(e.supportsColorBufferFloat=t.getExtension("EXT_color_buffer_float")!==null,e.supportsColorBufferFloatBlend=t.getExtension("EXT_float_blend")!==null,e.supportsColorBufferHalfFloat=e.supportsColorBufferFloat||t.getExtension("EXT_color_buffer_half_float")!==null),e}function Xle(e){const t=TI();return t.available?e==="3d"&&t.majorPerformanceCaveat?new Je("webgl:major-performance-caveat-detected","Your WebGL implementation doesn't seem to support hardware accelerated rendering. Check your browser settings or if your GPU is in a blocklist."):t.supportsHighPrecisionFragment?t.supportsVertexShaderSamplers?null:new Je("webgl:vertex-shader-samplers-required","WebGL support for vertex shader samplers is required but not supported."):new Je("webgl:high-precision-fragment-required","WebGL support for high precision fragment shaders is required but not supported."):new Je("webgl:required","WebGL2 is required but not supported.",new Error().stack)}function Qle(e){return e&&"nodeType"in e}function ece(e){return e&&typeof e.render=="function"}const pO={component:"esri-component"};let Od=class extends Nt{constructor(){super(...arguments),this.widget=null}destroy(){var t;this.node=null,(t=this.widget)==null||t.destroy()}get id(){var t,i;return this._get("id")??((t=this.widget)==null?void 0:t.id)??((i=this.node)==null?void 0:i.id)}set id(t){this._set("id",t)}set node(t){const i=this._get("node");t!==i&&(t&&t.classList.add(pO.component),i&&i.classList.remove(pO.component),this._set("node",t))}castNode(t){var i;return(i=this.widget)==null||i.destroy(),t?typeof t=="string"||Qle(t)?(this._set("widget",null),p3(t)):(ece(t)&&!t.domNode&&(t.domNode=document.createElement("div")),this._set("widget",t),t.domNode):(this._set("widget",null),null)}};v([M()],Od.prototype,"id",null),v([M()],Od.prototype,"node",null),v([Rs("node")],Od.prototype,"castNode",null),v([M({readOnly:!0})],Od.prototype,"widget",void 0),Od=v([fe("esri.views.ui.Component")],Od);const Cb=Od,JB="calcite-mode-";function tce(){return getComputedStyle(document.body).getPropertyValue("--esri-calcite-mode-name").replaceAll(/\s|'|"/g,"")}function ice(){return tce().startsWith("dark")}function rce(){return`${JB}${ice()?"dark":"light"}`}function sce(e){nce(e),e.classList.add(rce())}function nce(e){Array.from(e.classList).forEach(t=>{t.startsWith(JB)&&e.classList.remove(t)})}const oce={left:0,top:0,bottom:0,right:0},KB={bottom:30,top:15,right:15,left:15},fc="esri-ui",qn={ui:fc,corner:`${fc}-corner`,innerContainer:`${fc}-inner-container`,manualContainer:`${fc}-manual-container`,cornerContainer:`${fc}-corner-container`,topLeft:`${fc}-top-left`,topRight:`${fc}-top-right`,bottomLeft:`${fc}-bottom-left`,bottomRight:`${fc}-bottom-right`};function ace(e){return e&&!e._started&&typeof e.postMixInProperties=="function"&&typeof e.buildRendering=="function"&&typeof e.postCreate=="function"&&typeof e.startup=="function"}function Cv(e){return e===0?"0":`${e}px`}function mT(e){const t=typeof e=="object"&&e!==null&&Object.getPrototypeOf(e);return(t===null||t===Object.prototype)&&("component"in e||"index"in e||"position"in e)?e:null}function yT(e,{top:t,bottom:i,left:r,right:s}){e.style.top=t,e.style.bottom=i,e.style.left=r,e.style.right=s}let Tl=class extends Sh.EventedAccessor{constructor(t){super(t),this._cornerNameToContainerLookup={},this._positionNameToContainerLookup={},this._components=new Array,this._componentMap=new Map,this._locale=wo(),this.view=null,this._applyViewPadding=()=>{const i=this.container;i&&yT(i,this._toPixelPosition(this._getViewPadding()))},this._applyUIPadding=()=>{const i=this._innerContainer;i&&yT(i,this._toPixelPosition(this.padding))},this._initContainers()}initialize(){this.addHandles([ti(()=>{var t;return[(t=this.view)==null?void 0:t.padding,this.container]},this._applyViewPadding,_n),ti(()=>this.padding,this._applyUIPadding,_n),ti(()=>[this.container,this._locale],([t,i])=>{t&&t.setAttribute("lang",i)},_n),CA(t=>{this._locale=t})])}destroy(){this.container=null;for(const t of this._components)t.destroy();this._components.length=0,this._componentMap.clear()}set container(t){const i=this._get("container");t!==i&&(t&&(t.classList.add(qn.ui),sce(t),this._attachContainers(t)),i&&(i.classList.remove(qn.ui),yT(i,{top:"",bottom:"",left:"",right:""}),oF(i)),this._set("container",t))}get height(){var n;const t=((n=this.view)==null?void 0:n.height)??0;if(t===0)return t;const i=this._getViewPadding(),{top:r,bottom:s}=i;return Math.max(t-r-s,0)}get padding(){return this._get("padding")}set padding(t){this._overrideIfSome("padding",t)}castPadding(t){return typeof t=="number"?{bottom:t,top:t,right:t,left:t}:{...KB,...t}}get width(){var n;const t=((n=this.view)==null?void 0:n.width)??0;if(t===0)return t;const i=this._getViewPadding(),{left:r,right:s}=i;return Math.max(t-r-s,0)}add(t,i){let r,s,n;if(Array.isArray(t))return void t.forEach(o=>this.add(o,i));const c=mT(t);c&&({index:r,position:i,component:t,key:s}=c),i&&typeof i=="object"&&({index:r,key:s,position:i,internal:n}=i),!t||i&&!this._isValidPosition(i)||this._add(t,i,r,s,n)}remove(t,i){var s;if(!t)return;if(Array.isArray(t))return t.map(n=>this.remove(n,i));const r=this._find(t);if(r){if(this._componentMap.has(r)&&((s=this._componentMap.get(r))==null?void 0:s.key)!==i)return;const n=this._components.indexOf(r),c=r.node.parentNode;return c==null||c.removeChild(r.node),this._componentMap.delete(r),this._components.splice(n,1)[0]}}empty(t,i={removeInternal:!1}){if(Array.isArray(t)){for(const n of t)this.empty(n,i);return}const r=this._positionNameToContainerLookup[t??"manual"],s=Array.prototype.slice.call(r.children).map(n=>this._findByNode(n)).filter(n=>{var c;return n==null?!1:!(((c=this._componentMap.get(n))==null?void 0:c.internal)??!1)||i.removeInternal});for(const n of s)this.remove(n)}move(t,i){if(Array.isArray(t)&&t.forEach(c=>this.move(c,i)),!t)return;let r;const s=mT(t)||mT(i);if(s&&(r=s.index,i=s.position,t=s.component||t),i&&!this._isValidPosition(i))return;const n=this.remove(t);n&&this.add(n,{position:i,index:r})}find(t){if(!t)return null;const i=this._findById(t);return i&&(i.widget||i.node)}getComponents(t,i={includeInternal:!1}){return t?Array.isArray(t)?t.flatMap(r=>this._getComponentsAtPosition(r,i)):this._getComponentsAtPosition(t,i):this._components.filter(r=>{var s;return i.includeInternal||!((s=this._componentMap.get(r))!=null&&s.internal)}).map(({widget:r,node:s})=>r??s)}getPosition(t){for(const i in this._positionNameToContainerLookup)if(this._positionNameToContainerLookup[i].contains(t))return i;return null}_add(t,i,r,s,n){t instanceof Cb||(t=new Cb({node:t})),this._place({component:t,position:i,index:r}),this._components.push(t),this._componentMap.set(t,{key:s,internal:n})}_find(t){return t?t instanceof Cb?this._findByComponent(t):typeof t=="string"?this._findById(t):this._findByNode(t.domNode||t):null}_getViewPadding(){var t;return((t=this.view)==null?void 0:t.padding)??oce}_attachContainers(t){t.appendChild(this._innerContainer),t.appendChild(this._manualContainer)}_initContainers(){const t=document.createElement("div");t.classList.add(qn.innerContainer,qn.cornerContainer);const i=document.createElement("div");i.classList.add(qn.innerContainer,qn.manualContainer);const r=document.createElement("div");r.classList.add(qn.topLeft,qn.corner),t.appendChild(r);const s=document.createElement("div");s.classList.add(qn.topRight,qn.corner),t.appendChild(s);const n=document.createElement("div");n.classList.add(qn.bottomLeft,qn.corner),t.appendChild(n);const c=document.createElement("div");c.classList.add(qn.bottomRight,qn.corner),t.appendChild(c),this._innerContainer=t,this._manualContainer=i;const o=Hte();this._cornerNameToContainerLookup={"top-left":r,"top-right":s,"bottom-left":n,"bottom-right":c,"top-leading":o?s:r,"top-trailing":o?r:s,"bottom-leading":o?c:n,"bottom-trailing":o?n:c},this._positionNameToContainerLookup={manual:i,...this._cornerNameToContainerLookup}}_isValidPosition(t){return!!this._positionNameToContainerLookup[t]}_place(t){const i=t.position??"manual",{component:r,index:s}=t,n=this._positionNameToContainerLookup[i],c=s!=null&&s>-1;if(ace(r.widget)&&r.widget.startup(),!c)return void n.appendChild(r.node);const o=Array.from(n.children);if(s===0)return void(n.firstChild?Kk(r.node,n.firstChild):n.appendChild(r.node));s>=o.length?n.appendChild(r.node):Kk(r.node,o[s])}_toPixelPosition(t){return{top:Cv(t.top),left:Cv(t.left),right:Cv(t.right),bottom:Cv(t.bottom)}}_findByComponent(t){return this._components.find(i=>i===t)??null}_findById(t){return this._components.find(({id:i})=>i===t)??null}_findByNode(t){return this._components.find(({node:i})=>i===t)??null}_getComponentsAtPosition(t,i){const r=this._positionNameToContainerLookup[t];return Array.prototype.slice.call(r.children).map(s=>this._findByNode(s)).filter(N0).filter(s=>{var n;return i.includeInternal||!((n=this._componentMap.get(s))!=null&&n.internal)}).map(({widget:s,node:n})=>s??n)}};v([M()],Tl.prototype,"_locale",void 0),v([M()],Tl.prototype,"container",null),v([M()],Tl.prototype,"height",null),v([M({value:KB})],Tl.prototype,"padding",null),v([Rs("padding")],Tl.prototype,"castPadding",null),v([M()],Tl.prototype,"view",void 0),v([M()],Tl.prototype,"width",null),Tl=v([fe("esri.views.ui.UI")],Tl);const lce=Tl,cce="randomUUID"in crypto;function K3(){if(cce)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=i=>e[i].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function _ve(){return`{${K3().toUpperCase()}}`}function vve(){return`{${K3()}}`}const uce={handleInterceptedEvent:(e,t,i,r)=>(e.scheduleRender(),t.properties[`on${r.type}`].apply(t.properties.bind||i,[r]))},hce={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(e,t,i)=>{t.charAt(0)==="-"?e.style.setProperty(t,i):e.style[t]=i}},dce=e=>({...hce,...e}),pce=(e,t)=>{const i=[];for(;e&&e!==t;)i.push(e),e=e.parentNode;return i},fce=(e,t)=>e.find(t),fO=(e,t,i=!1)=>{let r=e;return t.forEach((s,n)=>{const c=r!=null&&r.children?fce(r.children,o=>o.domNode===s):void 0;i&&!c&&n!==t.length-1||(r=c)}),r},mce=e=>{let t;const i={...uce,...e},r=dce(i),s=r.performanceLogger;let n,c=!0,o=!1;const f=[],g=[],S=(A,O,z)=>{var Q;let V;r.eventHandlerInterceptor=(ve,me,ge,Ie)=>function(Ce){let ze;s("domEvent",Ce);const je=pce(Ce.currentTarget,V.domNode),tt=je.some(ot=>{var et;return customElements.get((et=ot==null?void 0:ot.tagName)==null?void 0:et.toLowerCase())});if(Ce.eventPhase===Event.CAPTURING_PHASE||!tt)je.reverse(),ze=fO(V.getLastRender(),je);else{const ot=Ce.composedPath(),et=ot.slice(ot.indexOf(Ce.currentTarget),ot.indexOf(V.domNode)).reverse();ze=fO(V.getLastRender(),et,!0)}let ut;return ze&&(ut=i.handleInterceptedEvent(t,ze,this,Ce)),s("domEventProcessed",Ce),ut},(Q=i.postProcessProjectionOptions)==null||Q.call(i,r);const H=z();V=A(O,H,r),r.eventHandlerInterceptor=void 0,f.push(V),g.push(z),i.afterFirstVNodeRendered&&i.afterFirstVNodeRendered(V,H)};let I=()=>{if(n=void 0,c){c=!1,s("renderStart",void 0);for(let A=0;A{n||o||(n=requestAnimationFrame(I))},stop:()=>{n&&(cancelAnimationFrame(n),n=void 0),o=!0},resume:()=>{o=!1,c=!0,t.scheduleRender()},append:(A,O)=>{S(lh.append,A,O)},insertBefore:(A,O)=>{S(lh.insertBefore,A,O)},merge:(A,O)=>{S(lh.merge,A,O)},replace:(A,O)=>{S(lh.replace,A,O)},detach:A=>{for(let O=0;Ot in e?ZV(e,t,{enumerable:!0,config * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.7.1 - */function IO(){const{classList:e}=document.body,t=window.matchMedia("(prefers-color-scheme: dark)").matches,i=()=>e.contains(QB)||e.contains(XB)&&t?"dark":"light",r=c=>document.body.dispatchEvent(new CustomEvent("calciteModeChange",{bubbles:!0,detail:{mode:c}})),s=c=>{n!==c&&r(c),n=c};let n=i();r(n),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",c=>s(c.matches?"dark":"light")),new MutationObserver(()=>s(i())).observe(document.body,{attributes:!0,attributeFilter:["class"]})}function lue(){typeof window<"u"&&typeof location<"u"&&typeof document<"u"&&window.location===location&&window.document===document&&(document.readyState==="interactive"?IO():document.addEventListener("DOMContentLoaded",()=>IO(),{once:!0}))}const cue=lue;cue();let yU;function uue(){try{gce(".")}catch{_ce(Xo(Ri(yU)))}}function iP(e){var i;const t=[];for(const r of Object.keys(e))customElements.get(`calcite-${r}`)||t.push((i=e[r])==null?void 0:i.call(e));return t.length>0?Promise.all(t):null}yU="components/assets";const gU=Symbol("widget"),_U=Symbol("widget-test-data"),hue=[],due={},Yw=new WeakMap;function vU(e,t){let i=t.children;if(i!=null&&i.length)for(let s=0;sbU(e))),queueMicrotask(()=>{c[_U].projector.renderNow()})}function fue(e,t,i,{widgetProperties:r}){var n;const s=Yw.get(e);s&&(s.set(r),(n=s.afterUpdate)==null||n.call(s,s,e))}function bU(e){var i;const t=Yw.get(e);t&&((i=t.afterRemoved)==null||i.call(t,t,e),t.destroy(),Yw.delete(e))}function Jw(e){return typeof e=="function"&&e[gU]}const R_={arrowDown:"esri-icon-arrow-down",arrowUp:"esri-icon-arrow-up",basemap:"esri-icon-basemap",bookmark:"esri-icon-bookmark",calendar:"esri-icon-calendar",checkMark:"esri-icon-check-mark",checkboxUnchecked:"esri-icon-checkbox-unchecked",close:"esri-icon-close",collapse:"esri-icon-collapse",defaultAction:"esri-icon-default-action",description:"esri-icon-description",directions:"esri-icon-directions",dockBottom:"esri-icon-dock-bottom",dockLeft:"esri-icon-dock-left",dockRight:"esri-icon-dock-right",down:"esri-icon-down",downArrow:"esri-icon-down-arrow",download:"esri-icon-download",dragHorizontal:"esri-icon-drag-horizontal",dragVertical:"esri-icon-drag-vertical",duplicate:"esri-icon-duplicate",edit:"esri-icon-edit",elevationProfile:"esri-icon-elevation-profile",environmentSettings:"esri-icon-environment-settings",erase:"esri-icon-erase",error:"esri-icon-error",expand:"esri-icon-expand",fontFallbackText:"esri-icon-font-fallback-text",forward:"esri-icon-forward",gear:"esri-icon-gear",handleHorizontal:"esri-icon-handle-horizontal",handleVertical:"esri-icon-handle-vertical",home:"esri-icon-home",icon:"esri-icon",launchLinkExternal:"esri-icon-launch-link-external",layerList:"esri-icon-layer-list",layers:"esri-icon-layers",left:"esri-icon-left",leftArrows:"esri-icon-left-arrow",leftTriangleArrow:"esri-icon-left-triangle-arrow",lineOfSight:"esri-icon-line-of-sight",link:"esri-icon-link",linkExternal:"esri-icon-link-external",linkHorizontal:"esri-icon-link-horizontal",loadingIndicator:"esri-icon-loading-indicator",locate:"esri-icon-locate",locateCircled:"esri-icon-locate-circled",locked:"esri-icon-locked",mapPin:"esri-icon-map-pin",maximize:"esri-icon-maximize",measure:"esri-icon-measure",measureArea:"esri-icon-measure-area",measureBuildingHeightShadow:"esri-icon-measure-building-height-shadow",measureLine:"esri-icon-measure-line",menu:"esri-icon-menu",minimize:"esri-icon-minimize",minus:"esri-icon-minus",nonVisible:"esri-icon-non-visible",northNavigation:"esri-icon-north-navigation",noticeTriangle:"esri-icon-notice-triangle",organization:"esri-icon-organization",pan:"esri-icon-pan",pan2:"esri-icon-pan2",partlyCloudy:"esri-icon-partly-cloudy",pause:"esri-icon-pause",play:"esri-icon-play",playCircled:"esri-icon-play-circled",plus:"esri-icon-plus",polyline:"esri-icon-polyline",printer:"esri-icon-printer",radioChecked:"esri-icon-radio-checked",radioUnchecked:"esri-icon-radio-unchecked",refresh:"esri-icon-refresh",reverse:"esri-icon-reverse",right:"esri-icon-right",rightArrow:"esri-icon-right-arrow",rightTriangleArrow:"esri-icon-right-triangle-arrow",rotate:"esri-icon-rotate",save:"esri-icon-save",search:"esri-icon-search",settings2:"esri-icon-settings2",slice:"esri-icon-slice",swap:"esri-icon-swap",table:"esri-icon-table",timeClock:"esri-icon-time-clock",tracking:"esri-icon-tracking",trash:"esri-icon-trash",unlockedLinkHorizontal:"esri-icon-unlocked-link-horizontal",up:"esri-icon-up",upArrow:"esri-icon-up-arrow",upDownArrows:"esri-icon-up-down-arrows",urbanModel:"esri-icon-urban-model",vertexGps:"esri-icon-vertex-gps",visible:"esri-icon-visible",zoomInFixed:"esri-icon-zoom-in-fixed",zoomInMagnifyingGlass:"esri-icon-zoom-in-magnifying-glass",zoomOutFixed:"esri-icon-zoom-out-fixed",zoomToObject:"esri-icon-zoom-to-object"},AO=new Set;function mue(e){AO.add(e),e.finally(()=>AO.delete(e))}var wU;const yue="esri.widgets.Widget";let gue=0;const _ue={widgetIcon:R_.checkboxUnchecked};function xU(e,t){for(const i in t)e[i]!=null&&(typeof e[i]=="object"&&typeof t[i]=="object"?xU(e[i],t==null?void 0:t[i]):e[i]=t[i]);return e}const vue=mce({postProcessProjectionOptions(e){const t=e.eventHandlerInterceptor,i=/capture$/i;e.eventHandlerInterceptor=(r,s,n,c)=>{const o=t==null?void 0:t(r,s,n,c),f=i.test(r);if(!((r=r.replace(i,"")).toLowerCase()in n)||f){const g=r[2].toLowerCase()+r.slice(3),S=O=>o==null?void 0:o.call(n,O);n.addEventListener(g,S,f);const I=()=>n.removeEventListener(g,S,f),A=c.afterRemoved;c.afterRemoved=O=>{A==null||A(O),I()}}return o}},handleInterceptedEvent(e,t,i,r){const{eventPhase:s,type:n}=r,c=s===Event.CAPTURING_PHASE;let o=`on${n}${c?"capture":""}`;const f=t.properties;(f&&o in f||(o=`on${n[0].toUpperCase()}${n.slice(1)}${c?"Capture":""}`,f&&o in f))&&(wF(),e.scheduleRender(),f[o].call(f.bind||i,r))}});let gT=!1,hs=class extends bA(Sh.EventedAccessor){constructor(t,i){super(t,i),this._attached=!1,this._projector=vue,this._readyForTrueRender=!1,this.iconClass=_ue.widgetIcon,this.icon=null,this.key=this,this.autoRenderingEnabled=!0,this._loadLocale=vG(async()=>{var o;if((o=this._messageBundleProps)!=null&&o.length){const f=await Promise.allSettled(this._messageBundleProps.map(async({bundlePath:g,propertyName:S})=>{if(this.destroyed)return;let I=await DA(g);this.uiStrings&&Object.keys(this.uiStrings)&&(I=xU(He(I),this.uiStrings)),this[S]=I}));if(this.destroyed)return;for(const g of f)g.status==="rejected"&&_t.getLogger(this).error("widget-intl:locale-error",this.declaredClass,g.reason)}await this.loadLocale()}),uue();const r="esri-widget-uid-"+K3(),s=this.render.bind(this);this._trackingTarget=new hx(()=>{this.autoRenderingEnabled&&this.scheduleRender()});const n=()=>{var I;if(!this._readyForTrueRender||this.destroyed)return null;const o=s();let f=o.properties;f||(o.properties=f={});const{key:g}=f;if(g||(f.key=r),Jw(o.vnodeSelector)){if(!this.visible)return{vnodeSelector:"div",properties:{key:`${r}-hidden`,class:"",styles:{display:"none"}},domNode:null,children:void 0,text:void 0}}else this.visible?f.styles||(f.styles={}):(f.class="",f.styles={display:"none"}),f.styles.display||(f.styles.display="");let S=0;return(I=o.children)==null||I.forEach(A=>{if(Jw(A.vnodeSelector))return;let{properties:O}=A;O||(A.properties=O={}),O.key||(O.key=`${this.id}--${S++}`)}),vU(this,o)};this.render=()=>{if(gT)return n();let o=jte(this)??null;if(o)return o;this._trackingTarget.clear(),gT=!0;try{o=Bc(this._trackingTarget,n)}catch(f){throw console.error(f),f}finally{gT=!1}return o&&Vte(this,o),o};const c=this.beforeFirstRender();c?this._resourcesFetch=c.then(()=>{this._readyForTrueRender=!0,this._postInitialize()}):(this._resourcesFetch=Promise.resolve().then(()=>{this._postInitialize()}),this._readyForTrueRender=!0),this.addResolvingPromise(this._resourcesFetch),mue(this._resourcesFetch)}normalizeCtorArgs(t,i){const r={...t};return i&&(r.container=i),r}postInitialize(){}beforeFirstRender(){var i;const t=this.loadDependencies();return(i=this._messageBundleProps)!=null&&i.length||t?Promise.all([t,this._loadLocale()]).then(()=>{}).catch(l$):null}loadDependencies(){return null}loadLocale(){return null}destroy(){this.destroyed||(lr(this._trackingTarget),lr(this.viewModel),this._detach(this.container),this._set("container",null),this._emitter.clear(),this.render=()=>null,this._projector=null,GS(this))}set container(t){this._get("container")||this._set("container",t)}castContainer(t){return p3(t)}get domNode(){return this.container}set domNode(t){this.container=t}get id(){var t;return this._get("id")||((t=this.container)==null?void 0:t.id)||Date.now().toString(16)+"-widget-"+gue++}set id(t){t&&this._set("id",t)}get label(){return this.declaredClass.split(".").pop()}set label(t){this._overrideIfSome("label",t)}get renderable(){return this._resourcesFetch}get visible(){return this._get("visible")}set visible(t){this._set("visible",t)}get[(wU=gU,_U)](){return{projector:this._projector}}render(){throw new Error("not implemented")}scheduleRender(){this.destroyed||(GS(this),this._projector.scheduleRender())}own(t){z5(_t.getLogger(this),"`Widget.own()` is deprecated in favor of 'Widget.addHandles()'",{replacement:"Widget.addHandles()",version:"4.28"}),this.addHandles(t)}classes(...t){return qte.apply(this,t)}renderNow(){GS(this),this._projector.renderNow()}_postInitialize(){var i;if(this.destroyed)return;this.scheduleRender(),(i=this._delegatedEventNames)!=null&&i.length&&this.addHandles(ti(()=>this.viewModel,(r,s)=>{s&&this.removeHandles("delegated-events"),r&&cx(r)&&this.addHandles(this._delegatedEventNames.map(n=>f_(r,n,c=>{this.emit(n,c)})),"delegated-events")},Fa)),this.postInitialize();const t=async()=>{await this._loadLocale().catch(l$),this.scheduleRender()};this.addHandles([CA(t),ti(()=>this.uiStrings,t),gh(()=>this.container,r=>{this.destroyed||this._attach(r)},{initial:!0,once:!0})])}_attach(t){t&&(this._projector.merge(t,this.render),this._attached=!0)}_detach(t){var i;this._attached&&(this._projector.detach(this.render),this._attached=!1),(i=t==null?void 0:t.parentNode)==null||i.removeChild(t)}};hs[wU]=!0,v([M()],hs.prototype,"_readyForTrueRender",void 0),v([M({value:null})],hs.prototype,"container",null),v([Rs("container")],hs.prototype,"castContainer",null),v([M()],hs.prototype,"iconClass",void 0),v([M()],hs.prototype,"icon",void 0),v([M()],hs.prototype,"id",null),v([M()],hs.prototype,"label",null),v([M()],hs.prototype,"renderable",null),v([M()],hs.prototype,"uiStrings",void 0),v([M()],hs.prototype,"viewModel",void 0),v([M({value:!0})],hs.prototype,"visible",null),v([M()],hs.prototype,"key",void 0),v([M()],hs.prototype,"children",void 0),v([M()],hs.prototype,"afterCreate",void 0),v([M()],hs.prototype,"afterUpdate",void 0),v([M()],hs.prototype,"afterRemoved",void 0),hs=v([fe(yue)],hs);const r2=hs,bue=new Map;function wue(e){return bue.get(e)}function PO(e,t){return e&&"copyright"in e&&(!t||typeof e.originOf=="function"&&e.originOf("copyright")==="user")}function xue(e,t){return e.length!==t.length||e.some((i,r)=>i.text!==t[r].text)}function Tg(e,t,i){!i||!t||e.find(r=>r.layerView===t&&r.text===i)||e.push({text:i,layerView:t})}function Sue(e){return e.type==="bing-maps"}const mc=[];let Kf=class extends Nt{constructor(t){super(t),this._clear=()=>{this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.removeHandles("suspension"),this.notifyChange("state")},this._pendingAttributions=new Set,this._fetchedAttributionData=new Map,this.items=new Bt,this.view=null,this._allLayerViewsChange=i=>{var s;this.removeHandles("suspension"),this.removeHandles("visible-geometry-changed");const r=(s=this.view)==null?void 0:s.allLayerViews;r&&(this.addHandles(r.map(n=>ti(()=>{var c;return[n.suspended,(c=n.layer)==null?void 0:c.attributionVisible]},()=>this._updateAttributionItems())).toArray(),"suspension"),r.forEach(n=>{n.declaredClass==="esri.views.3d.layers.Tiles3DLayerView3D"&&this.addHandles(n.on("visible-geometry-changed",()=>this._updateAttributionItems()),"visible-geometry-changed")})),i!=null&&i.removed&&i.removed.forEach(n=>{this._pendingAttributions.delete(n),this._fetchedAttributionData.delete(n)}),this._updateAttributionItems()},this.addHandles([Sp(()=>{var i;return(i=this.view)==null?void 0:i.allLayerViews},"change",i=>this._allLayerViewsChange(i),{onListenerAdd:()=>this._allLayerViewsChange(),onListenerRemove:this._clear}),gh(()=>{var i;return((i=this.view)==null?void 0:i.stationary)===!0},()=>this._updateAttributionItems())])}destroy(){this.view=null,this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.items.removeAll()}get state(){var t;return(t=this.view)!=null&&t.ready?this._pendingAttributions.size>0?"loading":"ready":"disabled"}_updateAttributionItems(){const t=this.view,i=t==null?void 0:t.allLayerViews;if(mc.length=0,!t||!i)return void this._clear();i.forEach(s=>{var o,f;if(s.suspended||!((o=s.layer)!=null&&o.attributionVisible))return;const n=s.layer;if(PO(n,"user"))return void Tg(mc,s,n.copyright);if(n.hasAttributionData){if(this._fetchedAttributionData.has(s)){const g=this._fetchedAttributionData.get(s);return void(g?Tg(mc,s,this._getDynamicAttribution(g,t,n)):PO(n)&&Tg(mc,s,n.copyright))}return void this._fetchAttributionData(s)}const c="portalItem"in n?(f=n.portalItem)==null?void 0:f.accessInformation:void 0;Tg(mc,s,c||n.copyright)});const r=i.find(s=>{var n;return((n=s.layer)==null?void 0:n.type)==="integrated-mesh-3dtiles"});if(this.view&&r){const s=wue(this.view);if(s){const n=s.getAttributionText();for(let c=0;c{const A=I.id,O=!g.has(A)&&f&&I.extent&&xx(I.extent,f);return O&&g.add(A),O}).sort((I,A)=>A.score-I.score||I.objectId-A.objectId).map(I=>I.attribution).join(", "):""}};v([M({readOnly:!0,type:Bt})],Kf.prototype,"items",void 0),v([M({readOnly:!0})],Kf.prototype,"state",null),v([M()],Kf.prototype,"view",void 0),Kf=v([fe("esri.widgets.Attribution.AttributionViewModel")],Kf);const SU=Kf,Rl={anchor:"esri-widget__anchor",anchorDisabled:"esri-widget__anchor--disabled",button:"esri-button",buttonDisabled:"esri-button--disabled",buttonHalf:"esri-button--half",buttonSecondary:"esri-button--secondary",buttonSmall:"esri-button--small",buttonTertiary:"esri-button--tertiary",buttonThird:"esri-button--third",disabled:"esri-disabled",disabledElement:"esri-disabled-element",empty:"esri-widget__content--empty",emptyIllustration:"esri-widget__content-illustration--empty",heading:"esri-widget__heading",hidden:"esri-hidden",input:"esri-input",interactive:"esri-interactive",loader:"esri-widget__loader",loaderAnimation:"esri-widget__loader-animation",loaderText:"esri-widget__loader-text",menu:"esri-menu",menuHeader:"esri-menu__header",menuItem:"esri-menu__list-item",menuItemActive:"esri-menu__list-item--active",menuItemFocus:"esri-menu__list-item--focus",menuList:"esri-menu__list",noBookmarksIcon:"esri-widget__no-bookmark-icon",panel:"esri-widget--panel",panelHeightOnly:"esri-widget--panel-height-only",primaryTick:"primary-tick",primaryTickAmPm:"primary-tick__ampm",primaryTickLabel:"primary-tick__label",rotating:"esri-rotating",secondaryTick:"secondary-tick",select:"esri-select",table:"esri-widget__table",widget:"esri-widget",widgetButton:"esri-widget--button",widgetButtonActive:"esri-widget--button-active",widgetDisabled:"esri-widget--disabled"};function Tue(){return function(e,t){if(!e[t])throw new TypeError(`Cannot auto bind undefined function '${String(t)}'`);return{value:Mue(e[t])}}}function Eue(e){const t=e==null?void 0:e.type;return e instanceof KeyboardEvent||t==="keyup"||t==="keydown"||t==="keypress"}function Mue(e){return function(t,...i){Eue(t)?Jte(t.key)&&(t.preventDefault(),t.stopPropagation(),t.target.click()):e.call(this,t,...i)}}function s2(e){return(t,i)=>{t.hasOwnProperty("_messageBundleProps")||(t._messageBundleProps=t._messageBundleProps?t._messageBundleProps.slice():[]),t._messageBundleProps.push({bundlePath:e,propertyName:i})}}var Iue=function(e){return{vnodeSelector:"",properties:void 0,children:void 0,text:e.toString(),domNode:null}},TU=function(e,t){for(var i=0,r=e.length;ir.forEach(({target:s})=>this._checkSourceTextOverflow(s))),this.iconClass=ad.widgetIcon,this.icon=null,this.itemDelimiter=" | ",this.messages=null,this.viewModel=new SU}initialize(){this.addHandles(Sp(()=>{var t;return(t=this.viewModel)==null?void 0:t.items},"change",()=>this.scheduleRender()))}destroy(){var t;(t=this._resizeObserver)==null||t.disconnect()}get _isInteractive(){return this._isOpen||this._attributionTextOverflowed}get attributionText(){return this.viewModel.items.reduce((t,i)=>(t.includes(i.text)||t.push(i.text),t),[]).join(this.itemDelimiter)}get label(){var t;return((t=this.messages)==null?void 0:t.widgetLabel)??""}set label(t){this._overrideIfSome("label",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const t={[ad.open]:this._isOpen};return to("div",{bind:this,class:this.classes(ad.base,Rl.widget,t),dir:"ltr",onclick:this._toggleState,onkeydown:this._toggleState},this._renderSourcesNode(),this._renderPoweredBy())}_renderPoweredBy(){return to("div",{class:ad.poweredBy},"Powered by"," ",to("a",{class:ad.link,href:"https://www.esri.com/",rel:"noreferrer",target:"_blank"},"Esri"))}_renderSourcesNode(){const t=this._isOpen,i=this._isInteractive,r=i?0:void 0,{attributionText:s}=this,n={[ad.sourcesOpen]:t,[Rl.interactive]:i};return to("div",{afterCreate:this._afterSourcesNodeCreate,bind:this,class:this.classes(ad.sources,n),innerHTML:s,tabIndex:r})}_afterSourcesNodeCreate(t){this._prevSourceNodeHeight=t.clientWidth,this._resizeObserver.observe(t)}_checkSourceTextOverflow(t){let i=!1;const{clientHeight:r,clientWidth:s,scrollWidth:n}=t,c=n>s,o=this._attributionTextOverflowed!==c;if(this._attributionTextOverflowed=c,o&&(i=!0),this._isOpen){const f=r{let t=class extends e{constructor(...i){super(...i),this.goToOverride=null,this.view=null}callGoTo(i){const{view:r}=this;return F5(r),this.goToOverride?this.goToOverride(r,i):r.goTo(i.target,i.options)}};return v([M()],t.prototype,"goToOverride",void 0),v([M()],t.prototype,"view",void 0),t=v([fe("esri.widgets.support.GoTo")],t),t},kue="esri.widgets.CompassViewModel";let Ld=class extends $ue(Nt){constructor(t){super(t),this.orientation={x:0,y:0,z:0},this.view=null,this._updateForCamera=this._updateForCamera.bind(this),this._updateForRotation=this._updateForRotation.bind(this),this._updateRotationWatcher=this._updateRotationWatcher.bind(this)}initialize(){this.addHandles(ti(()=>this.view,this._updateRotationWatcher,_n))}destroy(){this.view=null}get canShowNorth(){return Cue(this.view)}get state(){var t;return!((t=this.view)!=null&&t.ready)||this.view.type==="2d"&&!this.view.constraints.rotationEnabled?"disabled":this.canShowNorth?"compass":"rotation"}reset(){var i,r;if(!((i=this.view)!=null&&i.ready))return;const t={};((r=this.view)==null?void 0:r.type)==="2d"?t.rotation=0:t.heading=0,this.callGoTo({target:t})}_updateForRotation(t){t!=null&&(this.orientation={z:t})}_updateForCamera(t){if(!t)return;const i=-t.heading;this.orientation={x:0,y:0,z:i}}_updateRotationWatcher(t){this.removeAllHandles(),t&&this.addHandles(t.type==="2d"?ti(()=>t==null?void 0:t.rotation,this._updateForRotation,_n):ti(()=>t==null?void 0:t.camera,this._updateForCamera,_n))}};v([M({readOnly:!0})],Ld.prototype,"canShowNorth",null),v([M()],Ld.prototype,"orientation",void 0),v([M({readOnly:!0})],Ld.prototype,"state",null),v([M()],Ld.prototype,"view",void 0),Ld=v([fe(kue)],Ld);const EU=Ld,CO="esri-compass",_T={base:CO,widgetIcon:R_.locateCircled,iconContainer:`${CO}__icon-container`};let El=class extends r2{constructor(t,i){super(t,i),this.iconClass=_T.widgetIcon,this.icon=null,this.messages=null,this.viewModel=new EU,this._reset=()=>{this.viewModel.reset()},this._toRotationTransform=r=>({transform:`rotateZ(${r.z}deg)`})}loadDependencies(){return iP({button:()=>ht(()=>import("./calcite-button-CMjDkjDb.js"),__vite__mapDeps([236,237,238,239,240,241,242,243,244,245,246,247])),icon:()=>ht(()=>import("./calcite-icon-CHcIXU52.js"),__vite__mapDeps([248,246,238,239,245]))})}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(t){this.viewModel.goToOverride=t}get label(){var t;return((t=this.messages)==null?void 0:t.widgetLabel)??""}set label(t){this._overrideIfSome("label",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}reset(){return this.viewModel.reset()}render(){const{orientation:t,state:i}=this.viewModel,r=i==="rotation"?"arrow-up":"compass-needle",s=this.icon??r,{messages:n}=this;return to("div",{class:this.classes(_T.base,Rl.widget)},to("calcite-button",{class:Rl.widgetButton,disabled:i==="disabled",kind:"neutral",label:n.reset,onclick:this._reset,round:!0,scale:"s",title:n.reset},to("div",{"aria-hidden":"true",class:_T.iconContainer,title:n.reset},to("calcite-icon",{icon:s,scale:"m",styles:this._toRotationTransform(t)}))))}};v([M()],El.prototype,"goToOverride",null),v([M()],El.prototype,"iconClass",void 0),v([M()],El.prototype,"icon",void 0),v([M()],El.prototype,"label",null),v([M(),s2("esri/widgets/Compass/t9n/Compass")],El.prototype,"messages",void 0),v([M()],El.prototype,"view",null),v([M({type:EU})],El.prototype,"viewModel",void 0),El=v([fe("esri.widgets.Compass")],El);const Rue=El,$O="esri-navigation-toggle",vT={base:$O,widgetIcon:R_.pan2,isLayoutHorizontal:`${$O}--horizontal`};let Xf=class extends Nt{constructor(t){super(t),this.navigationMode="pan",this.view=null}initialize(){this.addHandles(gh(()=>{var t;return(t=this.view)==null?void 0:t.inputManager},()=>this._setNavigationMode()))}destroy(){this.view=null}get state(){var t,i;return(t=this.view)!=null&&t.ready&&((i=this.view)==null?void 0:i.type)==="3d"?"ready":"disabled"}toggle(){this.state!=="disabled"&&(this.navigationMode=this.navigationMode!=="pan"?"pan":"rotate",this._setNavigationMode())}_setNavigationMode(){var i;const t=(i=this.view)==null?void 0:i.inputManager;t&&(t.primaryDragAction=this.navigationMode==="pan"?"pan":"rotate")}};v([M({readOnly:!0})],Xf.prototype,"state",null),v([M()],Xf.prototype,"navigationMode",void 0),v([M()],Xf.prototype,"view",void 0),Xf=v([fe("esri.widgets.NavigationToggleViewModel")],Xf);const MU=Xf;let Ml=class extends r2{constructor(t,i){super(t,i),this.iconClass=vT.widgetIcon,this.icon=null,this.messages=null,this.viewModel=new MU,this.toggle=()=>this.viewModel.toggle(),this._panButton=null,this._rotateButton=null,this._toggle=()=>{var s;const r=((s=this.viewModel)==null?void 0:s.navigationMode)==="pan"?this._rotateButton:this._panButton;r==null||r.setFocus(),this.toggle()}}loadDependencies(){return iP({button:()=>ht(()=>import("./calcite-button-CMjDkjDb.js"),__vite__mapDeps([236,237,238,239,240,241,242,243,244,245,246,247]))})}get label(){var t;return((t=this.messages)==null?void 0:t.widgetLabel)??""}set label(t){this._overrideIfSome("label",t)}set layout(t){t!=="horizontal"&&(t="vertical"),this._set("layout",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){var s,n;const t=((s=this.viewModel)==null?void 0:s.state)==="disabled",i=((n=this.viewModel)==null?void 0:n.navigationMode)==="pan",r=this.messages.toggle;return to("div",{class:this.classes(vT.base,Rl.widget,{[vT.isLayoutHorizontal]:this.layout==="horizontal"})},to("calcite-button",{afterCreate:c=>{this._panButton=c},appearance:i?"outline-fill":"solid",class:Rl.widgetButton,disabled:t,iconStart:"move",kind:"neutral",label:r,onclick:this._toggle,tabIndex:i?void 0:-1,title:r}),to("calcite-button",{afterCreate:c=>{this._rotateButton=c},appearance:i?"solid":"outline-fill",class:Rl.widgetButton,disabled:t,iconStart:"rotate",kind:"neutral",label:r,onclick:this._toggle,tabIndex:i?-1:void 0,title:r}))}};v([M()],Ml.prototype,"iconClass",void 0),v([M()],Ml.prototype,"icon",void 0),v([M()],Ml.prototype,"label",null),v([M({value:"vertical"})],Ml.prototype,"layout",null),v([M(),s2("esri/widgets/NavigationToggle/t9n/NavigationToggle")],Ml.prototype,"messages",void 0),v([M()],Ml.prototype,"view",null),v([M({type:MU})],Ml.prototype,"viewModel",void 0),Ml=v([fe("esri.widgets.NavigationToggle")],Ml);const Oue=Ml;let Dd=class extends Nt{get canZoomIn(){var r,s,n;if(!((r=this.view)==null?void 0:r.ready))return!1;const i=(n=(s=this.view)==null?void 0:s.constraints)==null?void 0:n.effectiveMaxScale;return i===0||this._scale>i}get canZoomOut(){var s;const{view:t}=this;if(!(t==null?void 0:t.ready))return!1;const r=(s=t.constraints)==null?void 0:s.effectiveMinScale;return r===0||this._scalethis.viewModel.zoomIn(),this.zoomOut=()=>this.viewModel.zoomOut()}loadDependencies(){return iP({button:()=>ht(()=>import("./calcite-button-CMjDkjDb.js"),__vite__mapDeps([236,237,238,239,240,241,242,243,244,245,246,247]))})}get label(){var t;return((t=this.messages)==null?void 0:t.widgetLabel)??""}set label(t){this._overrideIfSome("label",t)}set layout(t){t!=="horizontal"&&(t="vertical"),this._set("layout",t)}set view(t){this.viewModel.view=t}get view(){return this.viewModel.view}render(){const t={[bT.horizontalLayout]:this.layout==="horizontal"},{canZoomIn:i,canZoomOut:r}=this.viewModel,{zoomIn:s,zoomOut:n}=this.messages;return to("div",{class:this.classes(bT.base,Rl.widget,t)},to("calcite-button",{class:Rl.widgetButton,disabled:!i,iconStart:"plus",kind:"neutral",label:s,onclick:this.zoomIn,title:s}),to("calcite-button",{class:Rl.widgetButton,disabled:!r,iconStart:"minus",kind:"neutral",label:n,onclick:this.zoomOut,title:n}))}};v([M()],Il.prototype,"iconClass",void 0),v([M()],Il.prototype,"icon",void 0),v([M()],Il.prototype,"label",null),v([M({value:"vertical"})],Il.prototype,"layout",null),v([M(),s2("esri/widgets/Zoom/t9n/Zoom")],Il.prototype,"messages",void 0),v([M()],Il.prototype,"view",null),v([M({type:IU})],Il.prototype,"viewModel",void 0),Il=v([fe("esri.widgets.Zoom")],Il);const Nue=Il;function zue(e){return(e==null?void 0:e.view)!==void 0}let $b=class extends lce{constructor(t){super(t),this._defaultPositionLookup={attribution:"manual",compass:"top-left","navigation-toggle":"top-left",zoom:"top-left"},this.components=[],this._updateViewAwareWidgets=i=>{this.components.forEach(r=>{const s=this._find(r),n=s==null?void 0:s.widget;zue(n)&&(n.view=i)})},this._componentsWatcher=(i,r)=>{this._removeComponents(r),this._addComponents(i),this._adjustPadding(i)}}initialize(){this.addHandles([ti(()=>this.components,this._componentsWatcher,_n),ti(()=>this.view,this._updateViewAwareWidgets,_n)])}_add(t,i,r,s,n){let c=t;if(typeof t=="string"&&this._defaultPositionLookup[t]){if(this._find(t))return;c=this._createComponent(t)}super._add(c,i,r,s,n)}_removeComponents(t){t.forEach(i=>{const r=this._find(i);r&&(this.remove(r),r.destroy())})}_adjustPadding(t){if(!t.includes("attribution")&&!this._isOverridden("padding")){const{top:i}=this.padding;this.padding=i}}_addComponents(t){this.constructed&&t.forEach(i=>this.add(this._createComponent(i),this._defaultPositionLookup[i]))}_createComponent(t){const i=this._createWidget(t);return new Cb({id:t,node:i})}_createWidget(t){const{view:i}=this;switch(t){case"attribution":return new Pue({view:i});case"compass":return new Rue({view:i});case"navigation-toggle":return new Oue({view:i});case"zoom":return new Nue({view:i})}}};v([M()],$b.prototype,"components",void 0),$b=v([fe("esri.views.ui.DefaultUI")],$b);const AU=$b;let kb=class extends AU{constructor(t){super(t),this.components=["attribution","zoom"]}};v([M()],kb.prototype,"components",void 0),kb=v([fe("esri.views.ui.2d.DefaultUI2D")],kb);const PU=kb;function kO(e){return e!=null&&typeof e=="object"&&"declaredClass"in e&&e.declaredClass==="esri.WebMap"}var AI;let Rb=AI=class extends At{constructor(e){super(e),this.color=new zt([0,0,0,1])}clone(){return new AI(He({color:this.color}))}};v([M({type:zt,json:{write:!0}})],Rb.prototype,"color",void 0),Rb=AI=v([fe("esri.webmap.background.ColorBackground")],Rb);const Fue=Rb;let CU,$U,kU,RU,OU,LU;async function Bue(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:i,MapViewNavigation:r,MagnifierView2D:s,Stage:n}]=await Promise.all([ht(()=>import("./webglDeps-BqalI_vm.js"),__vite__mapDeps([164,75,74,165,166])),ht(()=>import("./mapViewDeps-pgi5I2eW.js"),__vite__mapDeps([167,76,77,78,22,79,80,73,74,75,81,38,82,43,83,84,127,11,168,169,170,171,166,114,24,25,164,165,172,88,173,72,34,32,31,28,19,71,174,175,176,177,178,179,61,180,181,182,183,184,185,186,187,91,188]))]);$U=e,kU=t,RU=i,OU=r,LU=s,CU=n}let Yt=class extends Yee(Eie(hie(cne))){constructor(t){super(t),this._magnifierView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new W0({getCollections:()=>{var i,r;return[(i=this.basemapView)==null?void 0:i.baseLayerViews,this.layerViews,(r=this.basemapView)==null?void 0:r.referenceLayerViews]},getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.fullOpacity=1,this.goToManager=new Ib({view:this}),this.graphicsView=null,this.stateManager=new Pn({constraints:new TB({view:this})}),this.stationaryManager=new l0,this.labelManager=null,this.mapViewNavigation=null,this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.supportsGround=!1,this.frameTask=new Uoe(this),this.floors=new Bt,this.highlightOptions=new GB,this.inputManager=new wle({view:this}),this.map=null,this.spatialReferenceLocked=!1,this.timeline=new YB,this.type="2d",this.ui=new PU,this.test={takeScreenshot:async i=>Gle(this._getScreenshotView(i),i)},this.padding={top:0,right:0,bottom:0,left:0},this.addHandles([ti(()=>this.viewpoint,()=>this.stationaryManager.flip(),Tp),this.on("resize",i=>this.stateManager.resize(i.width,i.height))]),hee()}destroy(){this._set("preconditionsReady",!1),this.frameTask=lr(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new Ple(this.featuresTilingScheme)}get constraintsInfo(){var r,s;const t=(r=this.defaultsFromMap)==null?void 0:r.tileInfo,i=this.spatialReference;return{lods:(s=t==null?void 0:t.spatialReference)!=null&&s.equals(i)?t.lods:null,spatialReference:i}}get state(){return this.stateManager.state}get initialExtentRequired(){var o;if(!this.stateManager)return!1;const{scale:t,constraints:i,center:r,viewpoint:s,extent:n}=this;let c=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&((o=this.map.initialViewProperties)!=null&&o.viewpoint))&&!n&&(i!=null&&i.effectiveLODs||(c=-1),(!r||t===0&&c===-1)&&((s==null?void 0:s.targetGeometry)==null||s.targetGeometry.type!=="extent"&&!s.scale))}get _defaultsFromMapSettings(){return{required:{tileInfo:!0,heightModelInfo:!1,extent:!1},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get typeSpecificPreconditionsReady(){const t=this._getDefaultViewpoint();if(!t)return!1;const i=t.targetGeometry,r=this.spatialReference;return Jz(i.spatialReference,r)}set animation(t){const i=this._get("animation");if(t===i)return;if(i&&i.stop(),t!==this.animationManager.animation&&this.animationManager.stop(),!t||t.isFulfilled())return this._set("animation",null),void(this.frameTask.animationInProgress=!1);this._set("animation",t),this.frameTask.animationInProgress=!0;const r=()=>{var s;this.destroyed||(t===this._get("animation")&&(this._set("animation",null),(s=this.frameTask)==null||s.requestFrame()),this.frameTask.animationInProgress=!1)};t.when(r,r)}get background(){return kO(this.map)?this.map.initialViewProperties.background:null}set background(t){this._override("background",t)}get center(){var t;return((t=this.stateManager)==null?void 0:t.center)??null}set center(t){this.stateManager.center=t}get constraints(){var t;return(t=this.stateManager)==null?void 0:t.constraints}set constraints(t){t.view=this;const i=this.stateManager.constraints;this.stateManager.constraints=t,i==null||i.destroy()}get extent(){var t;return((t=this.stateManager)==null?void 0:t.extent)??null}set extent(t){this.stateManager.extent=t}get padding(){var t;return(t=this.stateManager)==null?void 0:t.padding}set padding(t){this.stateManager&&(this.stateManager.padding=t)}get rendering(){var t;return((t=this.stage)==null?void 0:t.renderRequested)??!1}get resizeAlign(){return this.stateManager.resizeAlign}set resizeAlign(t){this.stateManager.resizeAlign=t}get resolution(){return this.stateManager.resolution??0}get rotation(){return this.stateManager.rotation??0}set rotation(t){const{rotationEnabled:i}=this.constraints;this.constraints.rotationEnabled=!0,this.stateManager.rotation=t,this.constraints.rotationEnabled=i}get scale(){var t;return((t=this.stateManager)==null?void 0:t.scale)??0}set scale(t){this.stateManager&&(this.stateManager.scale=t)}get stationary(){return!this.animation&&!this.navigating&&!this.resizing&&this.stationaryManager.stationary}get updating(){var i,r,s;const t=!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||this.layerViewManager.updating===!0||this.labelManager.updating===!0||this.graphicsView.updating===!0||this.allLayerViews.some(n=>!n.destroyed&&!("layerViews"in n)&&n.updating===!0));if(Le("esri-2d-log-updating")){const n=this.allLayerViews.reduce((c,o)=>({...c,[`${o.layer.id}(${o.layer.type})`]:!o.destroyed&&!("layerViews"in o)&&o.updating}),{});console.log(`Updating MapView: ${t} + */function IO(){const{classList:e}=document.body,t=window.matchMedia("(prefers-color-scheme: dark)").matches,i=()=>e.contains(QB)||e.contains(XB)&&t?"dark":"light",r=c=>document.body.dispatchEvent(new CustomEvent("calciteModeChange",{bubbles:!0,detail:{mode:c}})),s=c=>{n!==c&&r(c),n=c};let n=i();r(n),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",c=>s(c.matches?"dark":"light")),new MutationObserver(()=>s(i())).observe(document.body,{attributes:!0,attributeFilter:["class"]})}function lue(){typeof window<"u"&&typeof location<"u"&&typeof document<"u"&&window.location===location&&window.document===document&&(document.readyState==="interactive"?IO():document.addEventListener("DOMContentLoaded",()=>IO(),{once:!0}))}const cue=lue;cue();let yU;function uue(){try{gce(".")}catch{_ce(Xo(Ri(yU)))}}function iP(e){var i;const t=[];for(const r of Object.keys(e))customElements.get(`calcite-${r}`)||t.push((i=e[r])==null?void 0:i.call(e));return t.length>0?Promise.all(t):null}yU="components/assets";const gU=Symbol("widget"),_U=Symbol("widget-test-data"),hue=[],due={},Yw=new WeakMap;function vU(e,t){let i=t.children;if(i!=null&&i.length)for(let s=0;sbU(e))),queueMicrotask(()=>{c[_U].projector.renderNow()})}function fue(e,t,i,{widgetProperties:r}){var n;const s=Yw.get(e);s&&(s.set(r),(n=s.afterUpdate)==null||n.call(s,s,e))}function bU(e){var i;const t=Yw.get(e);t&&((i=t.afterRemoved)==null||i.call(t,t,e),t.destroy(),Yw.delete(e))}function Jw(e){return typeof e=="function"&&e[gU]}const R_={arrowDown:"esri-icon-arrow-down",arrowUp:"esri-icon-arrow-up",basemap:"esri-icon-basemap",bookmark:"esri-icon-bookmark",calendar:"esri-icon-calendar",checkMark:"esri-icon-check-mark",checkboxUnchecked:"esri-icon-checkbox-unchecked",close:"esri-icon-close",collapse:"esri-icon-collapse",defaultAction:"esri-icon-default-action",description:"esri-icon-description",directions:"esri-icon-directions",dockBottom:"esri-icon-dock-bottom",dockLeft:"esri-icon-dock-left",dockRight:"esri-icon-dock-right",down:"esri-icon-down",downArrow:"esri-icon-down-arrow",download:"esri-icon-download",dragHorizontal:"esri-icon-drag-horizontal",dragVertical:"esri-icon-drag-vertical",duplicate:"esri-icon-duplicate",edit:"esri-icon-edit",elevationProfile:"esri-icon-elevation-profile",environmentSettings:"esri-icon-environment-settings",erase:"esri-icon-erase",error:"esri-icon-error",expand:"esri-icon-expand",fontFallbackText:"esri-icon-font-fallback-text",forward:"esri-icon-forward",gear:"esri-icon-gear",handleHorizontal:"esri-icon-handle-horizontal",handleVertical:"esri-icon-handle-vertical",home:"esri-icon-home",icon:"esri-icon",launchLinkExternal:"esri-icon-launch-link-external",layerList:"esri-icon-layer-list",layers:"esri-icon-layers",left:"esri-icon-left",leftArrows:"esri-icon-left-arrow",leftTriangleArrow:"esri-icon-left-triangle-arrow",lineOfSight:"esri-icon-line-of-sight",link:"esri-icon-link",linkExternal:"esri-icon-link-external",linkHorizontal:"esri-icon-link-horizontal",loadingIndicator:"esri-icon-loading-indicator",locate:"esri-icon-locate",locateCircled:"esri-icon-locate-circled",locked:"esri-icon-locked",mapPin:"esri-icon-map-pin",maximize:"esri-icon-maximize",measure:"esri-icon-measure",measureArea:"esri-icon-measure-area",measureBuildingHeightShadow:"esri-icon-measure-building-height-shadow",measureLine:"esri-icon-measure-line",menu:"esri-icon-menu",minimize:"esri-icon-minimize",minus:"esri-icon-minus",nonVisible:"esri-icon-non-visible",northNavigation:"esri-icon-north-navigation",noticeTriangle:"esri-icon-notice-triangle",organization:"esri-icon-organization",pan:"esri-icon-pan",pan2:"esri-icon-pan2",partlyCloudy:"esri-icon-partly-cloudy",pause:"esri-icon-pause",play:"esri-icon-play",playCircled:"esri-icon-play-circled",plus:"esri-icon-plus",polyline:"esri-icon-polyline",printer:"esri-icon-printer",radioChecked:"esri-icon-radio-checked",radioUnchecked:"esri-icon-radio-unchecked",refresh:"esri-icon-refresh",reverse:"esri-icon-reverse",right:"esri-icon-right",rightArrow:"esri-icon-right-arrow",rightTriangleArrow:"esri-icon-right-triangle-arrow",rotate:"esri-icon-rotate",save:"esri-icon-save",search:"esri-icon-search",settings2:"esri-icon-settings2",slice:"esri-icon-slice",swap:"esri-icon-swap",table:"esri-icon-table",timeClock:"esri-icon-time-clock",tracking:"esri-icon-tracking",trash:"esri-icon-trash",unlockedLinkHorizontal:"esri-icon-unlocked-link-horizontal",up:"esri-icon-up",upArrow:"esri-icon-up-arrow",upDownArrows:"esri-icon-up-down-arrows",urbanModel:"esri-icon-urban-model",vertexGps:"esri-icon-vertex-gps",visible:"esri-icon-visible",zoomInFixed:"esri-icon-zoom-in-fixed",zoomInMagnifyingGlass:"esri-icon-zoom-in-magnifying-glass",zoomOutFixed:"esri-icon-zoom-out-fixed",zoomToObject:"esri-icon-zoom-to-object"},AO=new Set;function mue(e){AO.add(e),e.finally(()=>AO.delete(e))}var wU;const yue="esri.widgets.Widget";let gue=0;const _ue={widgetIcon:R_.checkboxUnchecked};function xU(e,t){for(const i in t)e[i]!=null&&(typeof e[i]=="object"&&typeof t[i]=="object"?xU(e[i],t==null?void 0:t[i]):e[i]=t[i]);return e}const vue=mce({postProcessProjectionOptions(e){const t=e.eventHandlerInterceptor,i=/capture$/i;e.eventHandlerInterceptor=(r,s,n,c)=>{const o=t==null?void 0:t(r,s,n,c),f=i.test(r);if(!((r=r.replace(i,"")).toLowerCase()in n)||f){const g=r[2].toLowerCase()+r.slice(3),S=O=>o==null?void 0:o.call(n,O);n.addEventListener(g,S,f);const I=()=>n.removeEventListener(g,S,f),A=c.afterRemoved;c.afterRemoved=O=>{A==null||A(O),I()}}return o}},handleInterceptedEvent(e,t,i,r){const{eventPhase:s,type:n}=r,c=s===Event.CAPTURING_PHASE;let o=`on${n}${c?"capture":""}`;const f=t.properties;(f&&o in f||(o=`on${n[0].toUpperCase()}${n.slice(1)}${c?"Capture":""}`,f&&o in f))&&(wF(),e.scheduleRender(),f[o].call(f.bind||i,r))}});let gT=!1,hs=class extends bA(Sh.EventedAccessor){constructor(t,i){super(t,i),this._attached=!1,this._projector=vue,this._readyForTrueRender=!1,this.iconClass=_ue.widgetIcon,this.icon=null,this.key=this,this.autoRenderingEnabled=!0,this._loadLocale=vG(async()=>{var o;if((o=this._messageBundleProps)!=null&&o.length){const f=await Promise.allSettled(this._messageBundleProps.map(async({bundlePath:g,propertyName:S})=>{if(this.destroyed)return;let I=await DA(g);this.uiStrings&&Object.keys(this.uiStrings)&&(I=xU(He(I),this.uiStrings)),this[S]=I}));if(this.destroyed)return;for(const g of f)g.status==="rejected"&&_t.getLogger(this).error("widget-intl:locale-error",this.declaredClass,g.reason)}await this.loadLocale()}),uue();const r="esri-widget-uid-"+K3(),s=this.render.bind(this);this._trackingTarget=new hx(()=>{this.autoRenderingEnabled&&this.scheduleRender()});const n=()=>{var I;if(!this._readyForTrueRender||this.destroyed)return null;const o=s();let f=o.properties;f||(o.properties=f={});const{key:g}=f;if(g||(f.key=r),Jw(o.vnodeSelector)){if(!this.visible)return{vnodeSelector:"div",properties:{key:`${r}-hidden`,class:"",styles:{display:"none"}},domNode:null,children:void 0,text:void 0}}else this.visible?f.styles||(f.styles={}):(f.class="",f.styles={display:"none"}),f.styles.display||(f.styles.display="");let S=0;return(I=o.children)==null||I.forEach(A=>{if(Jw(A.vnodeSelector))return;let{properties:O}=A;O||(A.properties=O={}),O.key||(O.key=`${this.id}--${S++}`)}),vU(this,o)};this.render=()=>{if(gT)return n();let o=jte(this)??null;if(o)return o;this._trackingTarget.clear(),gT=!0;try{o=Bc(this._trackingTarget,n)}catch(f){throw console.error(f),f}finally{gT=!1}return o&&Vte(this,o),o};const c=this.beforeFirstRender();c?this._resourcesFetch=c.then(()=>{this._readyForTrueRender=!0,this._postInitialize()}):(this._resourcesFetch=Promise.resolve().then(()=>{this._postInitialize()}),this._readyForTrueRender=!0),this.addResolvingPromise(this._resourcesFetch),mue(this._resourcesFetch)}normalizeCtorArgs(t,i){const r={...t};return i&&(r.container=i),r}postInitialize(){}beforeFirstRender(){var i;const t=this.loadDependencies();return(i=this._messageBundleProps)!=null&&i.length||t?Promise.all([t,this._loadLocale()]).then(()=>{}).catch(l$):null}loadDependencies(){return null}loadLocale(){return null}destroy(){this.destroyed||(lr(this._trackingTarget),lr(this.viewModel),this._detach(this.container),this._set("container",null),this._emitter.clear(),this.render=()=>null,this._projector=null,GS(this))}set container(t){this._get("container")||this._set("container",t)}castContainer(t){return p3(t)}get domNode(){return this.container}set domNode(t){this.container=t}get id(){var t;return this._get("id")||((t=this.container)==null?void 0:t.id)||Date.now().toString(16)+"-widget-"+gue++}set id(t){t&&this._set("id",t)}get label(){return this.declaredClass.split(".").pop()}set label(t){this._overrideIfSome("label",t)}get renderable(){return this._resourcesFetch}get visible(){return this._get("visible")}set visible(t){this._set("visible",t)}get[(wU=gU,_U)](){return{projector:this._projector}}render(){throw new Error("not implemented")}scheduleRender(){this.destroyed||(GS(this),this._projector.scheduleRender())}own(t){z5(_t.getLogger(this),"`Widget.own()` is deprecated in favor of 'Widget.addHandles()'",{replacement:"Widget.addHandles()",version:"4.28"}),this.addHandles(t)}classes(...t){return qte.apply(this,t)}renderNow(){GS(this),this._projector.renderNow()}_postInitialize(){var i;if(this.destroyed)return;this.scheduleRender(),(i=this._delegatedEventNames)!=null&&i.length&&this.addHandles(ti(()=>this.viewModel,(r,s)=>{s&&this.removeHandles("delegated-events"),r&&cx(r)&&this.addHandles(this._delegatedEventNames.map(n=>f_(r,n,c=>{this.emit(n,c)})),"delegated-events")},Fa)),this.postInitialize();const t=async()=>{await this._loadLocale().catch(l$),this.scheduleRender()};this.addHandles([CA(t),ti(()=>this.uiStrings,t),gh(()=>this.container,r=>{this.destroyed||this._attach(r)},{initial:!0,once:!0})])}_attach(t){t&&(this._projector.merge(t,this.render),this._attached=!0)}_detach(t){var i;this._attached&&(this._projector.detach(this.render),this._attached=!1),(i=t==null?void 0:t.parentNode)==null||i.removeChild(t)}};hs[wU]=!0,v([M()],hs.prototype,"_readyForTrueRender",void 0),v([M({value:null})],hs.prototype,"container",null),v([Rs("container")],hs.prototype,"castContainer",null),v([M()],hs.prototype,"iconClass",void 0),v([M()],hs.prototype,"icon",void 0),v([M()],hs.prototype,"id",null),v([M()],hs.prototype,"label",null),v([M()],hs.prototype,"renderable",null),v([M()],hs.prototype,"uiStrings",void 0),v([M()],hs.prototype,"viewModel",void 0),v([M({value:!0})],hs.prototype,"visible",null),v([M()],hs.prototype,"key",void 0),v([M()],hs.prototype,"children",void 0),v([M()],hs.prototype,"afterCreate",void 0),v([M()],hs.prototype,"afterUpdate",void 0),v([M()],hs.prototype,"afterRemoved",void 0),hs=v([fe(yue)],hs);const r2=hs,bue=new Map;function wue(e){return bue.get(e)}function PO(e,t){return e&&"copyright"in e&&(!t||typeof e.originOf=="function"&&e.originOf("copyright")==="user")}function xue(e,t){return e.length!==t.length||e.some((i,r)=>i.text!==t[r].text)}function Tg(e,t,i){!i||!t||e.find(r=>r.layerView===t&&r.text===i)||e.push({text:i,layerView:t})}function Sue(e){return e.type==="bing-maps"}const mc=[];let Kf=class extends Nt{constructor(t){super(t),this._clear=()=>{this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.removeHandles("suspension"),this.notifyChange("state")},this._pendingAttributions=new Set,this._fetchedAttributionData=new Map,this.items=new Bt,this.view=null,this._allLayerViewsChange=i=>{var s;this.removeHandles("suspension"),this.removeHandles("visible-geometry-changed");const r=(s=this.view)==null?void 0:s.allLayerViews;r&&(this.addHandles(r.map(n=>ti(()=>{var c;return[n.suspended,(c=n.layer)==null?void 0:c.attributionVisible]},()=>this._updateAttributionItems())).toArray(),"suspension"),r.forEach(n=>{n.declaredClass==="esri.views.3d.layers.Tiles3DLayerView3D"&&this.addHandles(n.on("visible-geometry-changed",()=>this._updateAttributionItems()),"visible-geometry-changed")})),i!=null&&i.removed&&i.removed.forEach(n=>{this._pendingAttributions.delete(n),this._fetchedAttributionData.delete(n)}),this._updateAttributionItems()},this.addHandles([Sp(()=>{var i;return(i=this.view)==null?void 0:i.allLayerViews},"change",i=>this._allLayerViewsChange(i),{onListenerAdd:()=>this._allLayerViewsChange(),onListenerRemove:this._clear}),gh(()=>{var i;return((i=this.view)==null?void 0:i.stationary)===!0},()=>this._updateAttributionItems())])}destroy(){this.view=null,this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.items.removeAll()}get state(){var t;return(t=this.view)!=null&&t.ready?this._pendingAttributions.size>0?"loading":"ready":"disabled"}_updateAttributionItems(){const t=this.view,i=t==null?void 0:t.allLayerViews;if(mc.length=0,!t||!i)return void this._clear();i.forEach(s=>{var o,f;if(s.suspended||!((o=s.layer)!=null&&o.attributionVisible))return;const n=s.layer;if(PO(n,"user"))return void Tg(mc,s,n.copyright);if(n.hasAttributionData){if(this._fetchedAttributionData.has(s)){const g=this._fetchedAttributionData.get(s);return void(g?Tg(mc,s,this._getDynamicAttribution(g,t,n)):PO(n)&&Tg(mc,s,n.copyright))}return void this._fetchAttributionData(s)}const c="portalItem"in n?(f=n.portalItem)==null?void 0:f.accessInformation:void 0;Tg(mc,s,c||n.copyright)});const r=i.find(s=>{var n;return((n=s.layer)==null?void 0:n.type)==="integrated-mesh-3dtiles"});if(this.view&&r){const s=wue(this.view);if(s){const n=s.getAttributionText();for(let c=0;c{const A=I.id,O=!g.has(A)&&f&&I.extent&&xx(I.extent,f);return O&&g.add(A),O}).sort((I,A)=>A.score-I.score||I.objectId-A.objectId).map(I=>I.attribution).join(", "):""}};v([M({readOnly:!0,type:Bt})],Kf.prototype,"items",void 0),v([M({readOnly:!0})],Kf.prototype,"state",null),v([M()],Kf.prototype,"view",void 0),Kf=v([fe("esri.widgets.Attribution.AttributionViewModel")],Kf);const SU=Kf,Rl={anchor:"esri-widget__anchor",anchorDisabled:"esri-widget__anchor--disabled",button:"esri-button",buttonDisabled:"esri-button--disabled",buttonHalf:"esri-button--half",buttonSecondary:"esri-button--secondary",buttonSmall:"esri-button--small",buttonTertiary:"esri-button--tertiary",buttonThird:"esri-button--third",disabled:"esri-disabled",disabledElement:"esri-disabled-element",empty:"esri-widget__content--empty",emptyIllustration:"esri-widget__content-illustration--empty",heading:"esri-widget__heading",hidden:"esri-hidden",input:"esri-input",interactive:"esri-interactive",loader:"esri-widget__loader",loaderAnimation:"esri-widget__loader-animation",loaderText:"esri-widget__loader-text",menu:"esri-menu",menuHeader:"esri-menu__header",menuItem:"esri-menu__list-item",menuItemActive:"esri-menu__list-item--active",menuItemFocus:"esri-menu__list-item--focus",menuList:"esri-menu__list",noBookmarksIcon:"esri-widget__no-bookmark-icon",panel:"esri-widget--panel",panelHeightOnly:"esri-widget--panel-height-only",primaryTick:"primary-tick",primaryTickAmPm:"primary-tick__ampm",primaryTickLabel:"primary-tick__label",rotating:"esri-rotating",secondaryTick:"secondary-tick",select:"esri-select",table:"esri-widget__table",widget:"esri-widget",widgetButton:"esri-widget--button",widgetButtonActive:"esri-widget--button-active",widgetDisabled:"esri-widget--disabled"};function Tue(){return function(e,t){if(!e[t])throw new TypeError(`Cannot auto bind undefined function '${String(t)}'`);return{value:Mue(e[t])}}}function Eue(e){const t=e==null?void 0:e.type;return e instanceof KeyboardEvent||t==="keyup"||t==="keydown"||t==="keypress"}function Mue(e){return function(t,...i){Eue(t)?Jte(t.key)&&(t.preventDefault(),t.stopPropagation(),t.target.click()):e.call(this,t,...i)}}function s2(e){return(t,i)=>{t.hasOwnProperty("_messageBundleProps")||(t._messageBundleProps=t._messageBundleProps?t._messageBundleProps.slice():[]),t._messageBundleProps.push({bundlePath:e,propertyName:i})}}var Iue=function(e){return{vnodeSelector:"",properties:void 0,children:void 0,text:e.toString(),domNode:null}},TU=function(e,t){for(var i=0,r=e.length;ir.forEach(({target:s})=>this._checkSourceTextOverflow(s))),this.iconClass=ad.widgetIcon,this.icon=null,this.itemDelimiter=" | ",this.messages=null,this.viewModel=new SU}initialize(){this.addHandles(Sp(()=>{var t;return(t=this.viewModel)==null?void 0:t.items},"change",()=>this.scheduleRender()))}destroy(){var t;(t=this._resizeObserver)==null||t.disconnect()}get _isInteractive(){return this._isOpen||this._attributionTextOverflowed}get attributionText(){return this.viewModel.items.reduce((t,i)=>(t.includes(i.text)||t.push(i.text),t),[]).join(this.itemDelimiter)}get label(){var t;return((t=this.messages)==null?void 0:t.widgetLabel)??""}set label(t){this._overrideIfSome("label",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const t={[ad.open]:this._isOpen};return to("div",{bind:this,class:this.classes(ad.base,Rl.widget,t),dir:"ltr",onclick:this._toggleState,onkeydown:this._toggleState},this._renderSourcesNode(),this._renderPoweredBy())}_renderPoweredBy(){return to("div",{class:ad.poweredBy},"Powered by"," ",to("a",{class:ad.link,href:"https://www.esri.com/",rel:"noreferrer",target:"_blank"},"Esri"))}_renderSourcesNode(){const t=this._isOpen,i=this._isInteractive,r=i?0:void 0,{attributionText:s}=this,n={[ad.sourcesOpen]:t,[Rl.interactive]:i};return to("div",{afterCreate:this._afterSourcesNodeCreate,bind:this,class:this.classes(ad.sources,n),innerHTML:s,tabIndex:r})}_afterSourcesNodeCreate(t){this._prevSourceNodeHeight=t.clientWidth,this._resizeObserver.observe(t)}_checkSourceTextOverflow(t){let i=!1;const{clientHeight:r,clientWidth:s,scrollWidth:n}=t,c=n>s,o=this._attributionTextOverflowed!==c;if(this._attributionTextOverflowed=c,o&&(i=!0),this._isOpen){const f=r{let t=class extends e{constructor(...i){super(...i),this.goToOverride=null,this.view=null}callGoTo(i){const{view:r}=this;return F5(r),this.goToOverride?this.goToOverride(r,i):r.goTo(i.target,i.options)}};return v([M()],t.prototype,"goToOverride",void 0),v([M()],t.prototype,"view",void 0),t=v([fe("esri.widgets.support.GoTo")],t),t},kue="esri.widgets.CompassViewModel";let Ld=class extends $ue(Nt){constructor(t){super(t),this.orientation={x:0,y:0,z:0},this.view=null,this._updateForCamera=this._updateForCamera.bind(this),this._updateForRotation=this._updateForRotation.bind(this),this._updateRotationWatcher=this._updateRotationWatcher.bind(this)}initialize(){this.addHandles(ti(()=>this.view,this._updateRotationWatcher,_n))}destroy(){this.view=null}get canShowNorth(){return Cue(this.view)}get state(){var t;return!((t=this.view)!=null&&t.ready)||this.view.type==="2d"&&!this.view.constraints.rotationEnabled?"disabled":this.canShowNorth?"compass":"rotation"}reset(){var i,r;if(!((i=this.view)!=null&&i.ready))return;const t={};((r=this.view)==null?void 0:r.type)==="2d"?t.rotation=0:t.heading=0,this.callGoTo({target:t})}_updateForRotation(t){t!=null&&(this.orientation={z:t})}_updateForCamera(t){if(!t)return;const i=-t.heading;this.orientation={x:0,y:0,z:i}}_updateRotationWatcher(t){this.removeAllHandles(),t&&this.addHandles(t.type==="2d"?ti(()=>t==null?void 0:t.rotation,this._updateForRotation,_n):ti(()=>t==null?void 0:t.camera,this._updateForCamera,_n))}};v([M({readOnly:!0})],Ld.prototype,"canShowNorth",null),v([M()],Ld.prototype,"orientation",void 0),v([M({readOnly:!0})],Ld.prototype,"state",null),v([M()],Ld.prototype,"view",void 0),Ld=v([fe(kue)],Ld);const EU=Ld,CO="esri-compass",_T={base:CO,widgetIcon:R_.locateCircled,iconContainer:`${CO}__icon-container`};let El=class extends r2{constructor(t,i){super(t,i),this.iconClass=_T.widgetIcon,this.icon=null,this.messages=null,this.viewModel=new EU,this._reset=()=>{this.viewModel.reset()},this._toRotationTransform=r=>({transform:`rotateZ(${r.z}deg)`})}loadDependencies(){return iP({button:()=>ht(()=>import("./calcite-button-CWS09kHr.js"),__vite__mapDeps([236,237,238,239,240,241,242,243,244,245,246,247])),icon:()=>ht(()=>import("./calcite-icon-BCYnyK8T.js"),__vite__mapDeps([248,246,238,239,245]))})}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(t){this.viewModel.goToOverride=t}get label(){var t;return((t=this.messages)==null?void 0:t.widgetLabel)??""}set label(t){this._overrideIfSome("label",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}reset(){return this.viewModel.reset()}render(){const{orientation:t,state:i}=this.viewModel,r=i==="rotation"?"arrow-up":"compass-needle",s=this.icon??r,{messages:n}=this;return to("div",{class:this.classes(_T.base,Rl.widget)},to("calcite-button",{class:Rl.widgetButton,disabled:i==="disabled",kind:"neutral",label:n.reset,onclick:this._reset,round:!0,scale:"s",title:n.reset},to("div",{"aria-hidden":"true",class:_T.iconContainer,title:n.reset},to("calcite-icon",{icon:s,scale:"m",styles:this._toRotationTransform(t)}))))}};v([M()],El.prototype,"goToOverride",null),v([M()],El.prototype,"iconClass",void 0),v([M()],El.prototype,"icon",void 0),v([M()],El.prototype,"label",null),v([M(),s2("esri/widgets/Compass/t9n/Compass")],El.prototype,"messages",void 0),v([M()],El.prototype,"view",null),v([M({type:EU})],El.prototype,"viewModel",void 0),El=v([fe("esri.widgets.Compass")],El);const Rue=El,$O="esri-navigation-toggle",vT={base:$O,widgetIcon:R_.pan2,isLayoutHorizontal:`${$O}--horizontal`};let Xf=class extends Nt{constructor(t){super(t),this.navigationMode="pan",this.view=null}initialize(){this.addHandles(gh(()=>{var t;return(t=this.view)==null?void 0:t.inputManager},()=>this._setNavigationMode()))}destroy(){this.view=null}get state(){var t,i;return(t=this.view)!=null&&t.ready&&((i=this.view)==null?void 0:i.type)==="3d"?"ready":"disabled"}toggle(){this.state!=="disabled"&&(this.navigationMode=this.navigationMode!=="pan"?"pan":"rotate",this._setNavigationMode())}_setNavigationMode(){var i;const t=(i=this.view)==null?void 0:i.inputManager;t&&(t.primaryDragAction=this.navigationMode==="pan"?"pan":"rotate")}};v([M({readOnly:!0})],Xf.prototype,"state",null),v([M()],Xf.prototype,"navigationMode",void 0),v([M()],Xf.prototype,"view",void 0),Xf=v([fe("esri.widgets.NavigationToggleViewModel")],Xf);const MU=Xf;let Ml=class extends r2{constructor(t,i){super(t,i),this.iconClass=vT.widgetIcon,this.icon=null,this.messages=null,this.viewModel=new MU,this.toggle=()=>this.viewModel.toggle(),this._panButton=null,this._rotateButton=null,this._toggle=()=>{var s;const r=((s=this.viewModel)==null?void 0:s.navigationMode)==="pan"?this._rotateButton:this._panButton;r==null||r.setFocus(),this.toggle()}}loadDependencies(){return iP({button:()=>ht(()=>import("./calcite-button-CWS09kHr.js"),__vite__mapDeps([236,237,238,239,240,241,242,243,244,245,246,247]))})}get label(){var t;return((t=this.messages)==null?void 0:t.widgetLabel)??""}set label(t){this._overrideIfSome("label",t)}set layout(t){t!=="horizontal"&&(t="vertical"),this._set("layout",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){var s,n;const t=((s=this.viewModel)==null?void 0:s.state)==="disabled",i=((n=this.viewModel)==null?void 0:n.navigationMode)==="pan",r=this.messages.toggle;return to("div",{class:this.classes(vT.base,Rl.widget,{[vT.isLayoutHorizontal]:this.layout==="horizontal"})},to("calcite-button",{afterCreate:c=>{this._panButton=c},appearance:i?"outline-fill":"solid",class:Rl.widgetButton,disabled:t,iconStart:"move",kind:"neutral",label:r,onclick:this._toggle,tabIndex:i?void 0:-1,title:r}),to("calcite-button",{afterCreate:c=>{this._rotateButton=c},appearance:i?"solid":"outline-fill",class:Rl.widgetButton,disabled:t,iconStart:"rotate",kind:"neutral",label:r,onclick:this._toggle,tabIndex:i?-1:void 0,title:r}))}};v([M()],Ml.prototype,"iconClass",void 0),v([M()],Ml.prototype,"icon",void 0),v([M()],Ml.prototype,"label",null),v([M({value:"vertical"})],Ml.prototype,"layout",null),v([M(),s2("esri/widgets/NavigationToggle/t9n/NavigationToggle")],Ml.prototype,"messages",void 0),v([M()],Ml.prototype,"view",null),v([M({type:MU})],Ml.prototype,"viewModel",void 0),Ml=v([fe("esri.widgets.NavigationToggle")],Ml);const Oue=Ml;let Dd=class extends Nt{get canZoomIn(){var r,s,n;if(!((r=this.view)==null?void 0:r.ready))return!1;const i=(n=(s=this.view)==null?void 0:s.constraints)==null?void 0:n.effectiveMaxScale;return i===0||this._scale>i}get canZoomOut(){var s;const{view:t}=this;if(!(t==null?void 0:t.ready))return!1;const r=(s=t.constraints)==null?void 0:s.effectiveMinScale;return r===0||this._scalethis.viewModel.zoomIn(),this.zoomOut=()=>this.viewModel.zoomOut()}loadDependencies(){return iP({button:()=>ht(()=>import("./calcite-button-CWS09kHr.js"),__vite__mapDeps([236,237,238,239,240,241,242,243,244,245,246,247]))})}get label(){var t;return((t=this.messages)==null?void 0:t.widgetLabel)??""}set label(t){this._overrideIfSome("label",t)}set layout(t){t!=="horizontal"&&(t="vertical"),this._set("layout",t)}set view(t){this.viewModel.view=t}get view(){return this.viewModel.view}render(){const t={[bT.horizontalLayout]:this.layout==="horizontal"},{canZoomIn:i,canZoomOut:r}=this.viewModel,{zoomIn:s,zoomOut:n}=this.messages;return to("div",{class:this.classes(bT.base,Rl.widget,t)},to("calcite-button",{class:Rl.widgetButton,disabled:!i,iconStart:"plus",kind:"neutral",label:s,onclick:this.zoomIn,title:s}),to("calcite-button",{class:Rl.widgetButton,disabled:!r,iconStart:"minus",kind:"neutral",label:n,onclick:this.zoomOut,title:n}))}};v([M()],Il.prototype,"iconClass",void 0),v([M()],Il.prototype,"icon",void 0),v([M()],Il.prototype,"label",null),v([M({value:"vertical"})],Il.prototype,"layout",null),v([M(),s2("esri/widgets/Zoom/t9n/Zoom")],Il.prototype,"messages",void 0),v([M()],Il.prototype,"view",null),v([M({type:IU})],Il.prototype,"viewModel",void 0),Il=v([fe("esri.widgets.Zoom")],Il);const Nue=Il;function zue(e){return(e==null?void 0:e.view)!==void 0}let $b=class extends lce{constructor(t){super(t),this._defaultPositionLookup={attribution:"manual",compass:"top-left","navigation-toggle":"top-left",zoom:"top-left"},this.components=[],this._updateViewAwareWidgets=i=>{this.components.forEach(r=>{const s=this._find(r),n=s==null?void 0:s.widget;zue(n)&&(n.view=i)})},this._componentsWatcher=(i,r)=>{this._removeComponents(r),this._addComponents(i),this._adjustPadding(i)}}initialize(){this.addHandles([ti(()=>this.components,this._componentsWatcher,_n),ti(()=>this.view,this._updateViewAwareWidgets,_n)])}_add(t,i,r,s,n){let c=t;if(typeof t=="string"&&this._defaultPositionLookup[t]){if(this._find(t))return;c=this._createComponent(t)}super._add(c,i,r,s,n)}_removeComponents(t){t.forEach(i=>{const r=this._find(i);r&&(this.remove(r),r.destroy())})}_adjustPadding(t){if(!t.includes("attribution")&&!this._isOverridden("padding")){const{top:i}=this.padding;this.padding=i}}_addComponents(t){this.constructed&&t.forEach(i=>this.add(this._createComponent(i),this._defaultPositionLookup[i]))}_createComponent(t){const i=this._createWidget(t);return new Cb({id:t,node:i})}_createWidget(t){const{view:i}=this;switch(t){case"attribution":return new Pue({view:i});case"compass":return new Rue({view:i});case"navigation-toggle":return new Oue({view:i});case"zoom":return new Nue({view:i})}}};v([M()],$b.prototype,"components",void 0),$b=v([fe("esri.views.ui.DefaultUI")],$b);const AU=$b;let kb=class extends AU{constructor(t){super(t),this.components=["attribution","zoom"]}};v([M()],kb.prototype,"components",void 0),kb=v([fe("esri.views.ui.2d.DefaultUI2D")],kb);const PU=kb;function kO(e){return e!=null&&typeof e=="object"&&"declaredClass"in e&&e.declaredClass==="esri.WebMap"}var AI;let Rb=AI=class extends At{constructor(e){super(e),this.color=new zt([0,0,0,1])}clone(){return new AI(He({color:this.color}))}};v([M({type:zt,json:{write:!0}})],Rb.prototype,"color",void 0),Rb=AI=v([fe("esri.webmap.background.ColorBackground")],Rb);const Fue=Rb;let CU,$U,kU,RU,OU,LU;async function Bue(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:i,MapViewNavigation:r,MagnifierView2D:s,Stage:n}]=await Promise.all([ht(()=>import("./webglDeps-Cjw3mzdd.js"),__vite__mapDeps([164,75,74,165,166])),ht(()=>import("./mapViewDeps-B6Hg404o.js"),__vite__mapDeps([167,76,77,78,22,79,80,73,74,75,81,38,82,43,83,84,127,11,168,169,170,171,166,114,24,25,164,165,172,88,173,72,34,32,31,28,19,71,174,175,176,177,178,179,61,180,181,182,183,184,185,186,187,91,188]))]);$U=e,kU=t,RU=i,OU=r,LU=s,CU=n}let Yt=class extends Yee(Eie(hie(cne))){constructor(t){super(t),this._magnifierView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new W0({getCollections:()=>{var i,r;return[(i=this.basemapView)==null?void 0:i.baseLayerViews,this.layerViews,(r=this.basemapView)==null?void 0:r.referenceLayerViews]},getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.fullOpacity=1,this.goToManager=new Ib({view:this}),this.graphicsView=null,this.stateManager=new Pn({constraints:new TB({view:this})}),this.stationaryManager=new l0,this.labelManager=null,this.mapViewNavigation=null,this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.supportsGround=!1,this.frameTask=new Uoe(this),this.floors=new Bt,this.highlightOptions=new GB,this.inputManager=new wle({view:this}),this.map=null,this.spatialReferenceLocked=!1,this.timeline=new YB,this.type="2d",this.ui=new PU,this.test={takeScreenshot:async i=>Gle(this._getScreenshotView(i),i)},this.padding={top:0,right:0,bottom:0,left:0},this.addHandles([ti(()=>this.viewpoint,()=>this.stationaryManager.flip(),Tp),this.on("resize",i=>this.stateManager.resize(i.width,i.height))]),hee()}destroy(){this._set("preconditionsReady",!1),this.frameTask=lr(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new Ple(this.featuresTilingScheme)}get constraintsInfo(){var r,s;const t=(r=this.defaultsFromMap)==null?void 0:r.tileInfo,i=this.spatialReference;return{lods:(s=t==null?void 0:t.spatialReference)!=null&&s.equals(i)?t.lods:null,spatialReference:i}}get state(){return this.stateManager.state}get initialExtentRequired(){var o;if(!this.stateManager)return!1;const{scale:t,constraints:i,center:r,viewpoint:s,extent:n}=this;let c=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&((o=this.map.initialViewProperties)!=null&&o.viewpoint))&&!n&&(i!=null&&i.effectiveLODs||(c=-1),(!r||t===0&&c===-1)&&((s==null?void 0:s.targetGeometry)==null||s.targetGeometry.type!=="extent"&&!s.scale))}get _defaultsFromMapSettings(){return{required:{tileInfo:!0,heightModelInfo:!1,extent:!1},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get typeSpecificPreconditionsReady(){const t=this._getDefaultViewpoint();if(!t)return!1;const i=t.targetGeometry,r=this.spatialReference;return Jz(i.spatialReference,r)}set animation(t){const i=this._get("animation");if(t===i)return;if(i&&i.stop(),t!==this.animationManager.animation&&this.animationManager.stop(),!t||t.isFulfilled())return this._set("animation",null),void(this.frameTask.animationInProgress=!1);this._set("animation",t),this.frameTask.animationInProgress=!0;const r=()=>{var s;this.destroyed||(t===this._get("animation")&&(this._set("animation",null),(s=this.frameTask)==null||s.requestFrame()),this.frameTask.animationInProgress=!1)};t.when(r,r)}get background(){return kO(this.map)?this.map.initialViewProperties.background:null}set background(t){this._override("background",t)}get center(){var t;return((t=this.stateManager)==null?void 0:t.center)??null}set center(t){this.stateManager.center=t}get constraints(){var t;return(t=this.stateManager)==null?void 0:t.constraints}set constraints(t){t.view=this;const i=this.stateManager.constraints;this.stateManager.constraints=t,i==null||i.destroy()}get extent(){var t;return((t=this.stateManager)==null?void 0:t.extent)??null}set extent(t){this.stateManager.extent=t}get padding(){var t;return(t=this.stateManager)==null?void 0:t.padding}set padding(t){this.stateManager&&(this.stateManager.padding=t)}get rendering(){var t;return((t=this.stage)==null?void 0:t.renderRequested)??!1}get resizeAlign(){return this.stateManager.resizeAlign}set resizeAlign(t){this.stateManager.resizeAlign=t}get resolution(){return this.stateManager.resolution??0}get rotation(){return this.stateManager.rotation??0}set rotation(t){const{rotationEnabled:i}=this.constraints;this.constraints.rotationEnabled=!0,this.stateManager.rotation=t,this.constraints.rotationEnabled=i}get scale(){var t;return((t=this.stateManager)==null?void 0:t.scale)??0}set scale(t){this.stateManager&&(this.stateManager.scale=t)}get stationary(){return!this.animation&&!this.navigating&&!this.resizing&&this.stationaryManager.stationary}get updating(){var i,r,s;const t=!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||this.layerViewManager.updating===!0||this.labelManager.updating===!0||this.graphicsView.updating===!0||this.allLayerViews.some(n=>!n.destroyed&&!("layerViews"in n)&&n.updating===!0));if(Le("esri-2d-log-updating")){const n=this.allLayerViews.reduce((c,o)=>({...c,[`${o.layer.id}(${o.layer.type})`]:!o.destroyed&&!("layerViews"in o)&&o.updating}),{});console.log(`Updating MapView: ${t} -> Null LayerViewManager: ${!this.layerViewManager} -> Null LabelManager: ${!this.labelManager} -> Null GraphicsView: ${!this.graphicsView} @@ -63,7 +63,7 @@ var ZV=Object.defineProperty;var YV=(e,t,i)=>t in e?ZV(e,t,{enumerable:!0,config `+A+` | `+g.line+" | "+O+` `+A+" | "+i("",f.column-1," ")+i("",z,"^")}else n+=` - at `+S}return n},t.buildMessage=function(s,n){var c={literal:function(O){return'"'+f(O.text)+'"'},class:function(O){var z=O.parts.map(function(V){return Array.isArray(V)?g(V[0])+"-"+g(V[1]):g(V)});return"["+(O.inverted?"^":"")+z.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(O){return O.description}};function o(O){return O.charCodeAt(0).toString(16).toUpperCase()}function f(O){return O.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(z){return"\\x0"+o(z)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(z){return"\\x"+o(z)})}function g(O){return O.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(z){return"\\x0"+o(z)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(z){return"\\x"+o(z)})}function S(O){return c[O.type](O)}function I(O){var z,V,H=O.map(S);if(H.sort(),H.length>0){for(z=1,V=1;z{if(!Number.isFinite(i.scale)||i.scale<=0)throw new Je("effect:invalid-scale","scale must be finite and greater than 0",{stop:i});return{scale:i.scale,effects:FO(i.value)}});t.sort((i,r)=>r.effects.length-i.effects.length);for(let i=0;ir.scale-i.scale),t}function FO(e){let t;if(!e)return[];try{t=ihe.parse(e)}catch(i){throw new Je("effect:invalid-syntax","Invalid effect syntax",{value:e,error:i})}return t.map(i=>rhe(i))}function rhe(e){try{switch(e.name){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":return she(e);case"opacity":return nhe(e);case"hue-rotate":return ohe(e);case"blur":return ahe(e);case"drop-shadow":return lhe(e);case"bloom":return che(e)}}catch(t){throw t.details.filter=e,t}throw new Je("effect:unknown-effect",`Effect '${e.name}' is not supported`,{effect:e})}function she(e){let t=1;return Qm(e.parameters,1),e.parameters.length===1&&(t=Da(e.parameters[0])),new bE(e.name,t)}function nhe(e){let t=1;return Qm(e.parameters,1),e.parameters.length===1&&(t=Da(e.parameters[0])),new i6(t)}function ohe(e){let t=0;return Qm(e.parameters,1),e.parameters.length===1&&(t=mhe(e.parameters[0])),new e6(t)}function ahe(e){let t=0;return Qm(e.parameters,1),e.parameters.length===1&&(t=nP(e.parameters[0]),O_(t,e.parameters[0])),new YN(t)}function lhe(e){const t=[];let i=null;for(const r of e.parameters)if(r.type==="color"){if(t.length&&Object.freeze(t),i)throw new Je("effect:type-error","Accepts only one color",{});i=yhe(r)}else{const s=nP(r);if(Object.isFrozen(t))throw new Je("effect:type-error"," parameters not consecutive",{lengths:t});t.push(s),t.length===3&&O_(s,r)}if(t.length<2||t.length>3)throw new Je("effect:type-error",`Expected {2,3}, Actual: {${t.length}}`,{lengths:t});return new XN(t[0],t[1],t[2]||0,i||UU("black"))}function che(e){let t=1,i=0,r=0;return Qm(e.parameters,3),e.parameters[0]&&(t=Da(e.parameters[0])),e.parameters[1]&&(i=nP(e.parameters[1]),O_(i,e.parameters[1])),e.parameters[2]&&(r=Da(e.parameters[2])),new WN(t,i,r)}function Qm(e,t){if(e.length>t)throw new Je("effect:type-error",`Function supports up to ${t} parameters, Actual: ${e.length}`,{parameters:e})}function n2(e){if(e.type==="color")return"";if(e.unit){if(e.unit in sP)return"";if(e.unit in rP)return"";if(e.unit==="%")return""}return""}function O_(e,t){if(e<0)throw new Je("effect:type-error",`Negative values are not allowed, Actual: ${e}`,{term:t})}function uhe(e){if(e.type!=="quantity"||e.unit!==null)throw new Je("effect:type-error",`Expected , Actual: ${n2(e)}`,{term:e})}function hhe(e){if(e.type!=="quantity"||e.unit!==null&&e.unit!=="%")throw new Je("effect:type-error",`Expected or , Actual: ${n2(e)}`,{term:e})}const rP={deg:1,grad:.9,rad:180/Math.PI,turn:360};function dhe(e){if(e.type!=="quantity"||!(e.value===0&&e.unit===null||e.unit&&rP[e.unit]!=null))throw new Je("effect:type-error",`Expected , Actual: ${n2(e)}`,{term:e})}const sP={px:1,cm:96/2.54,mm:96/2.54/10,in:96,pc:16,pt:96/72};function phe(e){if(e.type!=="quantity"||!(e.value===0&&e.unit===null||e.unit&&sP[e.unit]!=null))throw new Je("effect:type-error",`Expected , Actual: ${n2(e)}`,{term:e})}function Da(e){hhe(e);const t=e.value;return O_(t,e),e.unit==="%"?.01*t:t}function fhe(e){return uhe(e),O_(e.value,e),e.value}function mhe(e){return dhe(e),e.value*rP[e.unit]||0}function nP(e){return phe(e),e.value*sP[e.unit]||0}function yhe(e){switch(e.colorType){case"hex":return PZ(e.value);case"named":return UU(e.value);case"function":return vhe(e.value)}}function UU(e){if(!wN(e))throw new Je("effect:unknown-color",`color '${e}' isn't valid`,{namedColor:e});return AZ(e)}const ghe=/^rgba?/i,_he=/^hsla?/i;function vhe(e){if(Qm(e.parameters,4),ghe.test(e.name))return[Da(e.parameters[0]),Da(e.parameters[1]),Da(e.parameters[2]),e.parameters[3]?Da(e.parameters[3]):1];if(_he.test(e.name))return xN(fhe(e.parameters[0]),Da(e.parameters[1]),Da(e.parameters[2]),e.parameters[3]?Da(e.parameters[3]):1);throw new Je("effect:syntax-error",`Invalid color function '${e.name}'`,{colorFunction:e})}function bhe(e,t,i){var r;try{return She(e)}catch(s){(r=i==null?void 0:i.messages)==null||r.push(s)}return null}function whe(e,t,i,r){try{const s=xhe(e);Ap(i,s,t)}catch(s){r.messages&&r.messages.push(s)}}function xhe(e){const t=BU(e);return t?OJ(t)?t.map(i=>i.toJSON()):t.map(({scale:i,effects:r})=>({scale:i,value:r.map(s=>s.toJSON())})):null}function She(e){if(!e||e.length===0)return null;if(The(e)){const t=[];for(const i of e)t.push({scale:i.scale,value:BO(i.value)});return t}return BO(e)}function The(e){const t=e[0];return!!t&&"scale"in t}function BO(e){if(!(e!=null&&e.length))return"";const t=[];for(const i of e){let r=[];switch(i.type){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":case"opacity":r=[yc(i,"amount")];break;case"blur":r=[yc(i,"radius","pt")];break;case"hue-rotate":r=[yc(i,"angle","deg")];break;case"drop-shadow":r=[yc(i,"xoffset","pt"),yc(i,"yoffset","pt"),yc(i,"blurRadius","pt"),Ehe(i,"color")];break;case"bloom":r=[yc(i,"strength"),yc(i,"radius","pt"),yc(i,"threshold")]}const s=`${i.type}(${r.filter(Boolean).join(" ")})`;BU(s),t.push(s)}return t.join(" ")}function yc(e,t,i){if(e[t]==null)throw new Je("effect:missing-parameter",`Missing parameter '${t}' in ${e.type} effect`,{effect:e});return i?e[t]+i:""+e[t]}function Ehe(e,t){if(e[t]==null)throw new Je("effect:missing-parameter",`Missing parameter '${t}' in ${e.type} effect`,{effect:e});const i=e[t];return`rgba(${i[0]||0}, ${i[1]||0}, ${i[2]||0}, ${i[3]/255||0})`}const UO={read:{reader:bhe},write:{allowNull:!0,writer:whe}},Mhe=e=>{let t=class extends e{constructor(){super(...arguments),this.blendMode="normal",this.effect=null}};return v([M({type:["average","color-burn","color-dodge","color","darken","destination-atop","destination-in","destination-out","destination-over","difference","exclusion","hard-light","hue","invert","lighten","lighter","luminosity","minus","multiply","normal","overlay","plus","reflect","saturation","screen","soft-light","source-atop","source-in","source-out","vivid-light","xor"],nonNullable:!0,json:{read:!1,write:!1,origins:{"web-map":{read:!0,write:!0},"portal-item":{read:!0,write:!0}}}})],t.prototype,"blendMode",void 0),v([M({json:{read:!1,write:!1,origins:{"web-map":UO,"portal-item":UO}}})],t.prototype,"effect",void 0),t=v([fe("esri.layers.mixins.BlendLayer")],t),t},Ihe=e=>{let t=class extends e{constructor(){super(...arguments),this.customParameters=null}};return v([M({type:Object,json:{write:{overridePolicy:i=>({enabled:!!(i&&Object.keys(i).length>0)})}}})],t.prototype,"customParameters",void 0),t=v([fe("esri.layers.mixins.CustomParametersMixin")],t),t},Ka=(e=>e)(["operational-layers","basemap","ground"]),jO={ArcGISAnnotationLayer:!0,ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,CatalogLayer:!0,CSV:!0,GeoRSS:!0,GeoJSON:!0,GroupLayer:!0,KML:!0,KnowledgeGraphLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},VO={ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,WMS:!0,WebTiledLayer:!0,BingMapsAerial:!0,BingMapsRoad:!0,BingMapsHybrid:!0},GO={ArcGISFeatureLayer:!0,SubtypeGroupTable:!0},Ahe={"web-scene/operational-layers":{ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledElevationServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BuildingSceneLayer:!0,GroupLayer:!0,IntegratedMeshLayer:!0,OGCFeatureLayer:!0,PointCloudLayer:!0,WebTiledLayer:!0,CSV:!0,GeoJSON:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,KML:!0,RasterDataLayer:!0,Voxel:!0,LineOfSightLayer:!0,IntegratedMesh3DTilesLayer:!0},"web-scene/basemap":{ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,WebTiledLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,ArcGISImageServiceLayer:!0,WMS:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0},"web-scene/ground":{ArcGISTiledElevationServiceLayer:!0,RasterDataElevationLayer:!0},"web-scene/tables":{ArcGISFeatureLayer:!0},"web-map/operational-layers":jO,"web-map/basemap":VO,"web-map/tables":GO,"link-chart/operational-layers":{...jO,LinkChartLayer:!0},"link-chart/basemap":VO,"link-chart/tables":GO,"portal-item/operational-layers":{ArcGISFeatureLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISImageServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,PointCloudLayer:!0,BuildingSceneLayer:!0,IntegratedMeshLayer:!0,IntegratedMesh3DTilesLayer:!0,MediaLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0}};function Phe(e){if(!e)return e;const{start:t,end:i}=e;return new E_({start:t!=null?up(t,-t.getTimezoneOffset(),"minutes"):t,end:i!=null?up(i,-i.getTimezoneOffset(),"minutes"):i})}function Che(e){if(!e)return e;const{start:t,end:i}=e;return new E_({start:t!=null?up(t,t.getTimezoneOffset(),"minutes"):t,end:i!=null?up(i,i.getTimezoneOffset(),"minutes"):i})}var kI;let c0=kI=class extends At{constructor(e){super(e)}async collectRequiredFields(e,t){return wh(e,t,this.expression)}clone(){return new kI({expression:this.expression,title:this.title})}equals(e){return this.expression===e.expression&&this.title===e.title}};v([M({type:String,json:{write:!0}})],c0.prototype,"expression",void 0),v([M({type:String,json:{write:!0}})],c0.prototype,"title",void 0),c0=kI=v([fe("esri.layers.support.FeatureExpressionInfo")],c0);const qO=c0,jU={unknown:1,inches:Uo(1,"meters","inches"),feet:Uo(1,"meters","feet"),"us-feet":Uo(1,"meters","us-feet"),yards:Uo(1,"meters","yards"),miles:Uo(1,"meters","miles"),"nautical-miles":Uo(1,"meters","nautical-miles"),millimeters:Uo(1,"meters","millimeters"),centimeters:Uo(1,"meters","centimeters"),decimeters:Uo(1,"meters","decimeters"),meters:Uo(1,"meters","meters"),kilometers:Uo(1,"meters","kilometers"),"decimal-degrees":1/fW(1,"meters",Or.radius)};function Jve(e){return 1/(jU[e]||1)}function $he(){const e=Object.keys(jU);return e.sort(),e}const khe=$he();var RI;const kv=Bn()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),HO=new ks({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let Ic=RI=class extends At{constructor(e){super(e),this.offset=null}readFeatureExpressionInfo(e,t){return e??(t.featureExpression&&t.featureExpression.value===0?{expression:"0"}:void 0)}writeFeatureExpressionInfo(e,t,i,r){t[i]=e.write({},r),e.expression==="0"&&(t.featureExpression={value:0})}get mode(){const{offset:e,featureExpressionInfo:t}=this;return this._isOverridden("mode")?this._get("mode"):e!=null||t?"relative-to-ground":"on-the-ground"}set mode(e){this._override("mode",e)}set unit(e){this._set("unit",e)}write(e,t){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(e,t):null}clone(){return new RI({mode:this.mode,offset:this.offset,featureExpressionInfo:this.featureExpressionInfo?this.featureExpressionInfo.clone():void 0,unit:this.unit})}equals(e){return this.mode===e.mode&&this.offset===e.offset&&this.unit===e.unit&&B7(this.featureExpressionInfo,e.featureExpressionInfo)}};v([M({type:qO,json:{write:!0}})],Ic.prototype,"featureExpressionInfo",void 0),v([mi("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],Ic.prototype,"readFeatureExpressionInfo",null),v([ui("featureExpressionInfo",{featureExpressionInfo:{type:qO},"featureExpression.value":{type:[0]}})],Ic.prototype,"writeFeatureExpressionInfo",null),v([M({type:kv.apiValues,nonNullable:!0,json:{type:kv.jsonValues,read:kv.read,write:{writer:kv.write,isRequired:!0}}})],Ic.prototype,"mode",null),v([M({type:Number,json:{write:!0}})],Ic.prototype,"offset",void 0),v([M({type:khe,json:{type:String,read:HO.read,write:HO.write}})],Ic.prototype,"unit",null),Ic=RI=v([fe("esri.layers.support.ElevationInfo")],Ic);const Rhe=Ic,Kve={type:Boolean,value:!0,json:{origins:{service:{read:!1,write:!1},"web-map":{read:!1,write:!1}},name:"screenSizePerspective",write:{enabled:!0,layerContainerTypes:Ka}}},Xve={type:Boolean,value:!0,json:{name:"disablePopup",read:{reader:(e,t)=>!t.disablePopup},write:{enabled:!0,writer(e,t,i){t[i]=!e}}}},Qve={type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",write:{enabled:!0,layerContainerTypes:Ka}}},ebe={type:String,json:{origins:{"portal-item":{write:!1}},write:{isRequired:!0,ignoreOrigin:!0,writer:xp}}},tbe={type:Boolean,value:!0,nonNullable:!0,json:{origins:{service:{read:{enabled:!1}}},name:"showLegend",write:{enabled:!0,layerContainerTypes:Ka}}},ibe={value:null,type:Rhe,json:{origins:{service:{name:"elevationInfo",write:!0}},name:"layerDefinition.elevationInfo",write:{enabled:!0,layerContainerTypes:Ka}}};function rbe(e){return{type:e,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}}}const VU={write:{enabled:!0,layerContainerTypes:Ka},read:!0},OI={type:Number,json:{origins:{"web-document":VU,"portal-item":{write:!0}}}},sbe={...OI,json:{...OI.json,origins:{"web-document":{...VU,write:{enabled:!0,layerContainerTypes:Ka,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}}}},read:{source:["layerDefinition.drawingInfo.transparency","drawingInfo.transparency"],reader:(e,t,i)=>{var r;return i&&i.origin!=="service"||!t.drawingInfo||t.drawingInfo.transparency===void 0?(r=t.layerDefinition)!=null&&r.drawingInfo&&t.layerDefinition.drawingInfo.transparency!==void 0?bw(t.layerDefinition.drawingInfo.transparency):void 0:bw(t.drawingInfo.transparency)}}}},nbe={type:E_,readOnly:!0,get(){var f,g,S;const e=((f=this.layer)==null?void 0:f.timeInfo)!=null?this.layer:((g=this.i3slayer)==null?void 0:g.timeInfo)!=null?this.i3slayer:null;if(e==null)return null;const{datesInUnknownTimezone:t,timeOffset:i,useViewTime:r}=e,s=(S=this.view)==null?void 0:S.timeExtent;let n=e.timeExtent;t&&(n=Che(n));let c=r?s&&n?s.intersection(n):s||n:n;if(!c||c.isEmpty||c.isAllTime)return c;i&&(c=c.offset(-i.value,i.unit)),t&&(c=Phe(c));const o=this._get("timeExtent");return c.equals(o)?o:c}},obe={type:Ui,readOnly:!0,json:{origins:{service:{read:{source:["fullExtent","spatialReference"],reader:(e,t)=>{const i=Ui.fromJSON(e);return t.spatialReference!=null&&typeof t.spatialReference=="object"&&(i.spatialReference=yi.fromJSON(t.spatialReference)),i}}}},read:!1}},abe={type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}}}},lbe={type:Number,json:{origins:{service:{write:{enabled:!1}},"web-scene":{name:"layerDefinition.minScale",write:{enabled:!0,layerContainerTypes:Ka}}},name:"layerDefinition.minScale",write:!0}},cbe={type:Number,json:{origins:{service:{write:{enabled:!1}},"web-scene":{name:"layerDefinition.maxScale",write:{enabled:!0,layerContainerTypes:Ka}}},name:"layerDefinition.maxScale",write:!0}},Ohe={json:{write:{ignoreOrigin:!0,layerContainerTypes:Ka},origins:{"web-map":{read:!1,write:!1}}}},Lhe=e=>{let t=class extends e{constructor(){super(...arguments),this.persistenceEnabled=!0,this.title=null}readId(i,r,s){var n;return((n=s==null?void 0:s.portalItem)==null?void 0:n.type)==="Group Layer"?void 0:i}writeListMode(i,r,s,n){(n&&n.layerContainerType==="ground"||i&&Oq(this,s,{},n))&&(r[s]=i)}writeOperationalLayerType(i,r,s,n){i&&(n==null?void 0:n.layerContainerType)!=="tables"&&(r.layerType=i)}writeTitle(i,r){r.title=i??"Layer"}read(i,r){r&&(r.layer=this),$q(this,i,s=>super.read(i,s),r)}write(i,r){var c,o;if(!this.persistenceEnabled)return null;if(r!=null&&r.origin){const f=`${r.origin}/${r.layerContainerType||"operational-layers"}`,g=Ahe[f];let S=!!(g!=null&&g[this.operationalLayerType]);if(this.operationalLayerType==="ArcGISTiledElevationServiceLayer"&&f==="web-scene/operational-layers"&&(S=!1),this.operationalLayerType==="ArcGISDimensionLayer"&&f==="web-map/operational-layers"&&(S=!1),!S)return(c=r.messages)==null||c.push(new Je("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${f}'`,{layer:this})),null}const s=super.write(i,{...r,layer:this}),n=!!r&&!!r.messages&&!!r.messages.filter(f=>f instanceof Je&&f.name==="web-document-write:property-required").length;return yx(s==null?void 0:s.url)?((o=r==null?void 0:r.messages)==null||o.push(new Je("layer:invalid-url",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using a Blob URL cannot be written to web scenes and web maps`,{layer:this})),null):!this.url&&n?null:s}beforeSave(){}};return v([M({type:String,json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0}},"portal-item":{write:!1}}}})],t.prototype,"id",void 0),v([mi("id",["id"])],t.prototype,"readId",null),v([M(Ohe)],t.prototype,"listMode",void 0),v([ui("listMode")],t.prototype,"writeListMode",null),v([M({type:String,readOnly:!0,json:{read:!1,write:{target:"layerType",ignoreOrigin:!0},origins:{"portal-item":{write:!1},"web-scene":{name:"layerType",read:!1,write:{enabled:!0,ignoreOrigin:!0,layerContainerTypes:Ka}}}}})],t.prototype,"operationalLayerType",void 0),v([ui("operationalLayerType")],t.prototype,"writeOperationalLayerType",null),v([M(OI)],t.prototype,"opacity",void 0),v([M({type:Boolean,readOnly:!1})],t.prototype,"persistenceEnabled",void 0),v([M({type:String,json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}},"portal-item":{write:!1}}},value:"Layer"})],t.prototype,"title",void 0),v([ui("title"),ui(["web-scene"],"title")],t.prototype,"writeTitle",null),v([M({type:Boolean,json:{origins:{"web-scene":{name:"visibility",write:{enabled:!0,layerContainerTypes:Ka}}},name:"visibility",write:!0}})],t.prototype,"visible",void 0),t=v([fe("esri.layers.mixins.OperationalLayer")],t),t};async function Dhe(e){const t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return im(e);const i=yi.WGS84;return await d3(t,i),Ph(e,i)}function Nhe(e,t){if(!GU(e,t)){const i=e.typeKeywords;i?i.push(t):e.typeKeywords=[t]}}function GU(e,t){var i;return!!((i=e.typeKeywords)!=null&&i.includes(t))}function ube(e){return GU(e,Fhe.HOSTED_SERVICE)}function zhe(e,t){const i=e.typeKeywords;if(i){const r=i.indexOf(t);r>-1&&i.splice(r,1)}}function hbe(e,t,i){i?Nhe(e,t):zhe(e,t)}async function dbe(e){const t=e.clone().normalize();let i;if(t.length>1)for(const r of t)i?r.width>i.width&&(i=r):i=r;else i=t[0];return Dhe(i)}const Fhe={DEVELOPER_BASEMAP:"DeveloperBasemap",JSAPI:"ArcGIS API for JavaScript",METADATA:"Metadata",MULTI_LAYER:"Multilayer",SINGLE_LAYER:"Singlelayer",TABLE:"Table",HOSTED_SERVICE:"Hosted Service",LOCAL_SCENE:"ViewingMode-Local",TILED_IMAGERY:"Tiled Imagery",GROUP_LAYER_MAP:"Map"};function WO(e){var f;const{portal:t,isOrgItem:i,itemControl:r}=e,s=(f=t.user)==null?void 0:f.privileges;let n=!s||s.includes("features:user:edit"),c=!!i&&!!(s!=null&&s.includes("features:user:fullEdit"));const o=r==="update"||r==="admin";return o?c=n=!0:c&&(n=!0),{features:{edit:n,fullEdit:c},content:{updateItem:o}}}const Bhe=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=lr(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(i){i!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",i))}readPortalItem(i,r,s){if(r.itemId)return new _0({id:r.itemId,portal:s==null?void 0:s.portal})}writePortalItem(i,r){i!=null&&i.id&&(r.itemId=i.id)}async loadFromPortal(i,r){var s;if((s=this.portalItem)!=null&&s.id)try{const{load:n}=await ht(()=>import("./layersLoader-NUfQIBq4.js"),__vite__mapDeps([249,8,5,3,4,2,6]));return mr(r),await n({instance:this,supportedTypes:i.supportedTypes,validateItem:i.validateItem,supportsData:i.supportsData,layerModuleTypeMap:i.layerModuleTypeMap},r)}catch(n){throw Ys(n)||_t.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id}) + at `+S}return n},t.buildMessage=function(s,n){var c={literal:function(O){return'"'+f(O.text)+'"'},class:function(O){var z=O.parts.map(function(V){return Array.isArray(V)?g(V[0])+"-"+g(V[1]):g(V)});return"["+(O.inverted?"^":"")+z.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(O){return O.description}};function o(O){return O.charCodeAt(0).toString(16).toUpperCase()}function f(O){return O.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(z){return"\\x0"+o(z)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(z){return"\\x"+o(z)})}function g(O){return O.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(z){return"\\x0"+o(z)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(z){return"\\x"+o(z)})}function S(O){return c[O.type](O)}function I(O){var z,V,H=O.map(S);if(H.sort(),H.length>0){for(z=1,V=1;z{if(!Number.isFinite(i.scale)||i.scale<=0)throw new Je("effect:invalid-scale","scale must be finite and greater than 0",{stop:i});return{scale:i.scale,effects:FO(i.value)}});t.sort((i,r)=>r.effects.length-i.effects.length);for(let i=0;ir.scale-i.scale),t}function FO(e){let t;if(!e)return[];try{t=ihe.parse(e)}catch(i){throw new Je("effect:invalid-syntax","Invalid effect syntax",{value:e,error:i})}return t.map(i=>rhe(i))}function rhe(e){try{switch(e.name){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":return she(e);case"opacity":return nhe(e);case"hue-rotate":return ohe(e);case"blur":return ahe(e);case"drop-shadow":return lhe(e);case"bloom":return che(e)}}catch(t){throw t.details.filter=e,t}throw new Je("effect:unknown-effect",`Effect '${e.name}' is not supported`,{effect:e})}function she(e){let t=1;return Qm(e.parameters,1),e.parameters.length===1&&(t=Da(e.parameters[0])),new bE(e.name,t)}function nhe(e){let t=1;return Qm(e.parameters,1),e.parameters.length===1&&(t=Da(e.parameters[0])),new i6(t)}function ohe(e){let t=0;return Qm(e.parameters,1),e.parameters.length===1&&(t=mhe(e.parameters[0])),new e6(t)}function ahe(e){let t=0;return Qm(e.parameters,1),e.parameters.length===1&&(t=nP(e.parameters[0]),O_(t,e.parameters[0])),new YN(t)}function lhe(e){const t=[];let i=null;for(const r of e.parameters)if(r.type==="color"){if(t.length&&Object.freeze(t),i)throw new Je("effect:type-error","Accepts only one color",{});i=yhe(r)}else{const s=nP(r);if(Object.isFrozen(t))throw new Je("effect:type-error"," parameters not consecutive",{lengths:t});t.push(s),t.length===3&&O_(s,r)}if(t.length<2||t.length>3)throw new Je("effect:type-error",`Expected {2,3}, Actual: {${t.length}}`,{lengths:t});return new XN(t[0],t[1],t[2]||0,i||UU("black"))}function che(e){let t=1,i=0,r=0;return Qm(e.parameters,3),e.parameters[0]&&(t=Da(e.parameters[0])),e.parameters[1]&&(i=nP(e.parameters[1]),O_(i,e.parameters[1])),e.parameters[2]&&(r=Da(e.parameters[2])),new WN(t,i,r)}function Qm(e,t){if(e.length>t)throw new Je("effect:type-error",`Function supports up to ${t} parameters, Actual: ${e.length}`,{parameters:e})}function n2(e){if(e.type==="color")return"";if(e.unit){if(e.unit in sP)return"";if(e.unit in rP)return"";if(e.unit==="%")return""}return""}function O_(e,t){if(e<0)throw new Je("effect:type-error",`Negative values are not allowed, Actual: ${e}`,{term:t})}function uhe(e){if(e.type!=="quantity"||e.unit!==null)throw new Je("effect:type-error",`Expected , Actual: ${n2(e)}`,{term:e})}function hhe(e){if(e.type!=="quantity"||e.unit!==null&&e.unit!=="%")throw new Je("effect:type-error",`Expected or , Actual: ${n2(e)}`,{term:e})}const rP={deg:1,grad:.9,rad:180/Math.PI,turn:360};function dhe(e){if(e.type!=="quantity"||!(e.value===0&&e.unit===null||e.unit&&rP[e.unit]!=null))throw new Je("effect:type-error",`Expected , Actual: ${n2(e)}`,{term:e})}const sP={px:1,cm:96/2.54,mm:96/2.54/10,in:96,pc:16,pt:96/72};function phe(e){if(e.type!=="quantity"||!(e.value===0&&e.unit===null||e.unit&&sP[e.unit]!=null))throw new Je("effect:type-error",`Expected , Actual: ${n2(e)}`,{term:e})}function Da(e){hhe(e);const t=e.value;return O_(t,e),e.unit==="%"?.01*t:t}function fhe(e){return uhe(e),O_(e.value,e),e.value}function mhe(e){return dhe(e),e.value*rP[e.unit]||0}function nP(e){return phe(e),e.value*sP[e.unit]||0}function yhe(e){switch(e.colorType){case"hex":return PZ(e.value);case"named":return UU(e.value);case"function":return vhe(e.value)}}function UU(e){if(!wN(e))throw new Je("effect:unknown-color",`color '${e}' isn't valid`,{namedColor:e});return AZ(e)}const ghe=/^rgba?/i,_he=/^hsla?/i;function vhe(e){if(Qm(e.parameters,4),ghe.test(e.name))return[Da(e.parameters[0]),Da(e.parameters[1]),Da(e.parameters[2]),e.parameters[3]?Da(e.parameters[3]):1];if(_he.test(e.name))return xN(fhe(e.parameters[0]),Da(e.parameters[1]),Da(e.parameters[2]),e.parameters[3]?Da(e.parameters[3]):1);throw new Je("effect:syntax-error",`Invalid color function '${e.name}'`,{colorFunction:e})}function bhe(e,t,i){var r;try{return She(e)}catch(s){(r=i==null?void 0:i.messages)==null||r.push(s)}return null}function whe(e,t,i,r){try{const s=xhe(e);Ap(i,s,t)}catch(s){r.messages&&r.messages.push(s)}}function xhe(e){const t=BU(e);return t?OJ(t)?t.map(i=>i.toJSON()):t.map(({scale:i,effects:r})=>({scale:i,value:r.map(s=>s.toJSON())})):null}function She(e){if(!e||e.length===0)return null;if(The(e)){const t=[];for(const i of e)t.push({scale:i.scale,value:BO(i.value)});return t}return BO(e)}function The(e){const t=e[0];return!!t&&"scale"in t}function BO(e){if(!(e!=null&&e.length))return"";const t=[];for(const i of e){let r=[];switch(i.type){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":case"opacity":r=[yc(i,"amount")];break;case"blur":r=[yc(i,"radius","pt")];break;case"hue-rotate":r=[yc(i,"angle","deg")];break;case"drop-shadow":r=[yc(i,"xoffset","pt"),yc(i,"yoffset","pt"),yc(i,"blurRadius","pt"),Ehe(i,"color")];break;case"bloom":r=[yc(i,"strength"),yc(i,"radius","pt"),yc(i,"threshold")]}const s=`${i.type}(${r.filter(Boolean).join(" ")})`;BU(s),t.push(s)}return t.join(" ")}function yc(e,t,i){if(e[t]==null)throw new Je("effect:missing-parameter",`Missing parameter '${t}' in ${e.type} effect`,{effect:e});return i?e[t]+i:""+e[t]}function Ehe(e,t){if(e[t]==null)throw new Je("effect:missing-parameter",`Missing parameter '${t}' in ${e.type} effect`,{effect:e});const i=e[t];return`rgba(${i[0]||0}, ${i[1]||0}, ${i[2]||0}, ${i[3]/255||0})`}const UO={read:{reader:bhe},write:{allowNull:!0,writer:whe}},Mhe=e=>{let t=class extends e{constructor(){super(...arguments),this.blendMode="normal",this.effect=null}};return v([M({type:["average","color-burn","color-dodge","color","darken","destination-atop","destination-in","destination-out","destination-over","difference","exclusion","hard-light","hue","invert","lighten","lighter","luminosity","minus","multiply","normal","overlay","plus","reflect","saturation","screen","soft-light","source-atop","source-in","source-out","vivid-light","xor"],nonNullable:!0,json:{read:!1,write:!1,origins:{"web-map":{read:!0,write:!0},"portal-item":{read:!0,write:!0}}}})],t.prototype,"blendMode",void 0),v([M({json:{read:!1,write:!1,origins:{"web-map":UO,"portal-item":UO}}})],t.prototype,"effect",void 0),t=v([fe("esri.layers.mixins.BlendLayer")],t),t},Ihe=e=>{let t=class extends e{constructor(){super(...arguments),this.customParameters=null}};return v([M({type:Object,json:{write:{overridePolicy:i=>({enabled:!!(i&&Object.keys(i).length>0)})}}})],t.prototype,"customParameters",void 0),t=v([fe("esri.layers.mixins.CustomParametersMixin")],t),t},Ka=(e=>e)(["operational-layers","basemap","ground"]),jO={ArcGISAnnotationLayer:!0,ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,CatalogLayer:!0,CSV:!0,GeoRSS:!0,GeoJSON:!0,GroupLayer:!0,KML:!0,KnowledgeGraphLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},VO={ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,WMS:!0,WebTiledLayer:!0,BingMapsAerial:!0,BingMapsRoad:!0,BingMapsHybrid:!0},GO={ArcGISFeatureLayer:!0,SubtypeGroupTable:!0},Ahe={"web-scene/operational-layers":{ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledElevationServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BuildingSceneLayer:!0,GroupLayer:!0,IntegratedMeshLayer:!0,OGCFeatureLayer:!0,PointCloudLayer:!0,WebTiledLayer:!0,CSV:!0,GeoJSON:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,KML:!0,RasterDataLayer:!0,Voxel:!0,LineOfSightLayer:!0,IntegratedMesh3DTilesLayer:!0},"web-scene/basemap":{ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,WebTiledLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,ArcGISImageServiceLayer:!0,WMS:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0},"web-scene/ground":{ArcGISTiledElevationServiceLayer:!0,RasterDataElevationLayer:!0},"web-scene/tables":{ArcGISFeatureLayer:!0},"web-map/operational-layers":jO,"web-map/basemap":VO,"web-map/tables":GO,"link-chart/operational-layers":{...jO,LinkChartLayer:!0},"link-chart/basemap":VO,"link-chart/tables":GO,"portal-item/operational-layers":{ArcGISFeatureLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISImageServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,PointCloudLayer:!0,BuildingSceneLayer:!0,IntegratedMeshLayer:!0,IntegratedMesh3DTilesLayer:!0,MediaLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0}};function Phe(e){if(!e)return e;const{start:t,end:i}=e;return new E_({start:t!=null?up(t,-t.getTimezoneOffset(),"minutes"):t,end:i!=null?up(i,-i.getTimezoneOffset(),"minutes"):i})}function Che(e){if(!e)return e;const{start:t,end:i}=e;return new E_({start:t!=null?up(t,t.getTimezoneOffset(),"minutes"):t,end:i!=null?up(i,i.getTimezoneOffset(),"minutes"):i})}var kI;let c0=kI=class extends At{constructor(e){super(e)}async collectRequiredFields(e,t){return wh(e,t,this.expression)}clone(){return new kI({expression:this.expression,title:this.title})}equals(e){return this.expression===e.expression&&this.title===e.title}};v([M({type:String,json:{write:!0}})],c0.prototype,"expression",void 0),v([M({type:String,json:{write:!0}})],c0.prototype,"title",void 0),c0=kI=v([fe("esri.layers.support.FeatureExpressionInfo")],c0);const qO=c0,jU={unknown:1,inches:Uo(1,"meters","inches"),feet:Uo(1,"meters","feet"),"us-feet":Uo(1,"meters","us-feet"),yards:Uo(1,"meters","yards"),miles:Uo(1,"meters","miles"),"nautical-miles":Uo(1,"meters","nautical-miles"),millimeters:Uo(1,"meters","millimeters"),centimeters:Uo(1,"meters","centimeters"),decimeters:Uo(1,"meters","decimeters"),meters:Uo(1,"meters","meters"),kilometers:Uo(1,"meters","kilometers"),"decimal-degrees":1/fW(1,"meters",Or.radius)};function Jve(e){return 1/(jU[e]||1)}function $he(){const e=Object.keys(jU);return e.sort(),e}const khe=$he();var RI;const kv=Bn()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),HO=new ks({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let Ic=RI=class extends At{constructor(e){super(e),this.offset=null}readFeatureExpressionInfo(e,t){return e??(t.featureExpression&&t.featureExpression.value===0?{expression:"0"}:void 0)}writeFeatureExpressionInfo(e,t,i,r){t[i]=e.write({},r),e.expression==="0"&&(t.featureExpression={value:0})}get mode(){const{offset:e,featureExpressionInfo:t}=this;return this._isOverridden("mode")?this._get("mode"):e!=null||t?"relative-to-ground":"on-the-ground"}set mode(e){this._override("mode",e)}set unit(e){this._set("unit",e)}write(e,t){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(e,t):null}clone(){return new RI({mode:this.mode,offset:this.offset,featureExpressionInfo:this.featureExpressionInfo?this.featureExpressionInfo.clone():void 0,unit:this.unit})}equals(e){return this.mode===e.mode&&this.offset===e.offset&&this.unit===e.unit&&B7(this.featureExpressionInfo,e.featureExpressionInfo)}};v([M({type:qO,json:{write:!0}})],Ic.prototype,"featureExpressionInfo",void 0),v([mi("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],Ic.prototype,"readFeatureExpressionInfo",null),v([ui("featureExpressionInfo",{featureExpressionInfo:{type:qO},"featureExpression.value":{type:[0]}})],Ic.prototype,"writeFeatureExpressionInfo",null),v([M({type:kv.apiValues,nonNullable:!0,json:{type:kv.jsonValues,read:kv.read,write:{writer:kv.write,isRequired:!0}}})],Ic.prototype,"mode",null),v([M({type:Number,json:{write:!0}})],Ic.prototype,"offset",void 0),v([M({type:khe,json:{type:String,read:HO.read,write:HO.write}})],Ic.prototype,"unit",null),Ic=RI=v([fe("esri.layers.support.ElevationInfo")],Ic);const Rhe=Ic,Kve={type:Boolean,value:!0,json:{origins:{service:{read:!1,write:!1},"web-map":{read:!1,write:!1}},name:"screenSizePerspective",write:{enabled:!0,layerContainerTypes:Ka}}},Xve={type:Boolean,value:!0,json:{name:"disablePopup",read:{reader:(e,t)=>!t.disablePopup},write:{enabled:!0,writer(e,t,i){t[i]=!e}}}},Qve={type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",write:{enabled:!0,layerContainerTypes:Ka}}},ebe={type:String,json:{origins:{"portal-item":{write:!1}},write:{isRequired:!0,ignoreOrigin:!0,writer:xp}}},tbe={type:Boolean,value:!0,nonNullable:!0,json:{origins:{service:{read:{enabled:!1}}},name:"showLegend",write:{enabled:!0,layerContainerTypes:Ka}}},ibe={value:null,type:Rhe,json:{origins:{service:{name:"elevationInfo",write:!0}},name:"layerDefinition.elevationInfo",write:{enabled:!0,layerContainerTypes:Ka}}};function rbe(e){return{type:e,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}}}const VU={write:{enabled:!0,layerContainerTypes:Ka},read:!0},OI={type:Number,json:{origins:{"web-document":VU,"portal-item":{write:!0}}}},sbe={...OI,json:{...OI.json,origins:{"web-document":{...VU,write:{enabled:!0,layerContainerTypes:Ka,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}}}},read:{source:["layerDefinition.drawingInfo.transparency","drawingInfo.transparency"],reader:(e,t,i)=>{var r;return i&&i.origin!=="service"||!t.drawingInfo||t.drawingInfo.transparency===void 0?(r=t.layerDefinition)!=null&&r.drawingInfo&&t.layerDefinition.drawingInfo.transparency!==void 0?bw(t.layerDefinition.drawingInfo.transparency):void 0:bw(t.drawingInfo.transparency)}}}},nbe={type:E_,readOnly:!0,get(){var f,g,S;const e=((f=this.layer)==null?void 0:f.timeInfo)!=null?this.layer:((g=this.i3slayer)==null?void 0:g.timeInfo)!=null?this.i3slayer:null;if(e==null)return null;const{datesInUnknownTimezone:t,timeOffset:i,useViewTime:r}=e,s=(S=this.view)==null?void 0:S.timeExtent;let n=e.timeExtent;t&&(n=Che(n));let c=r?s&&n?s.intersection(n):s||n:n;if(!c||c.isEmpty||c.isAllTime)return c;i&&(c=c.offset(-i.value,i.unit)),t&&(c=Phe(c));const o=this._get("timeExtent");return c.equals(o)?o:c}},obe={type:Ui,readOnly:!0,json:{origins:{service:{read:{source:["fullExtent","spatialReference"],reader:(e,t)=>{const i=Ui.fromJSON(e);return t.spatialReference!=null&&typeof t.spatialReference=="object"&&(i.spatialReference=yi.fromJSON(t.spatialReference)),i}}}},read:!1}},abe={type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}}}},lbe={type:Number,json:{origins:{service:{write:{enabled:!1}},"web-scene":{name:"layerDefinition.minScale",write:{enabled:!0,layerContainerTypes:Ka}}},name:"layerDefinition.minScale",write:!0}},cbe={type:Number,json:{origins:{service:{write:{enabled:!1}},"web-scene":{name:"layerDefinition.maxScale",write:{enabled:!0,layerContainerTypes:Ka}}},name:"layerDefinition.maxScale",write:!0}},Ohe={json:{write:{ignoreOrigin:!0,layerContainerTypes:Ka},origins:{"web-map":{read:!1,write:!1}}}},Lhe=e=>{let t=class extends e{constructor(){super(...arguments),this.persistenceEnabled=!0,this.title=null}readId(i,r,s){var n;return((n=s==null?void 0:s.portalItem)==null?void 0:n.type)==="Group Layer"?void 0:i}writeListMode(i,r,s,n){(n&&n.layerContainerType==="ground"||i&&Oq(this,s,{},n))&&(r[s]=i)}writeOperationalLayerType(i,r,s,n){i&&(n==null?void 0:n.layerContainerType)!=="tables"&&(r.layerType=i)}writeTitle(i,r){r.title=i??"Layer"}read(i,r){r&&(r.layer=this),$q(this,i,s=>super.read(i,s),r)}write(i,r){var c,o;if(!this.persistenceEnabled)return null;if(r!=null&&r.origin){const f=`${r.origin}/${r.layerContainerType||"operational-layers"}`,g=Ahe[f];let S=!!(g!=null&&g[this.operationalLayerType]);if(this.operationalLayerType==="ArcGISTiledElevationServiceLayer"&&f==="web-scene/operational-layers"&&(S=!1),this.operationalLayerType==="ArcGISDimensionLayer"&&f==="web-map/operational-layers"&&(S=!1),!S)return(c=r.messages)==null||c.push(new Je("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${f}'`,{layer:this})),null}const s=super.write(i,{...r,layer:this}),n=!!r&&!!r.messages&&!!r.messages.filter(f=>f instanceof Je&&f.name==="web-document-write:property-required").length;return yx(s==null?void 0:s.url)?((o=r==null?void 0:r.messages)==null||o.push(new Je("layer:invalid-url",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using a Blob URL cannot be written to web scenes and web maps`,{layer:this})),null):!this.url&&n?null:s}beforeSave(){}};return v([M({type:String,json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0}},"portal-item":{write:!1}}}})],t.prototype,"id",void 0),v([mi("id",["id"])],t.prototype,"readId",null),v([M(Ohe)],t.prototype,"listMode",void 0),v([ui("listMode")],t.prototype,"writeListMode",null),v([M({type:String,readOnly:!0,json:{read:!1,write:{target:"layerType",ignoreOrigin:!0},origins:{"portal-item":{write:!1},"web-scene":{name:"layerType",read:!1,write:{enabled:!0,ignoreOrigin:!0,layerContainerTypes:Ka}}}}})],t.prototype,"operationalLayerType",void 0),v([ui("operationalLayerType")],t.prototype,"writeOperationalLayerType",null),v([M(OI)],t.prototype,"opacity",void 0),v([M({type:Boolean,readOnly:!1})],t.prototype,"persistenceEnabled",void 0),v([M({type:String,json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}},"portal-item":{write:!1}}},value:"Layer"})],t.prototype,"title",void 0),v([ui("title"),ui(["web-scene"],"title")],t.prototype,"writeTitle",null),v([M({type:Boolean,json:{origins:{"web-scene":{name:"visibility",write:{enabled:!0,layerContainerTypes:Ka}}},name:"visibility",write:!0}})],t.prototype,"visible",void 0),t=v([fe("esri.layers.mixins.OperationalLayer")],t),t};async function Dhe(e){const t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return im(e);const i=yi.WGS84;return await d3(t,i),Ph(e,i)}function Nhe(e,t){if(!GU(e,t)){const i=e.typeKeywords;i?i.push(t):e.typeKeywords=[t]}}function GU(e,t){var i;return!!((i=e.typeKeywords)!=null&&i.includes(t))}function ube(e){return GU(e,Fhe.HOSTED_SERVICE)}function zhe(e,t){const i=e.typeKeywords;if(i){const r=i.indexOf(t);r>-1&&i.splice(r,1)}}function hbe(e,t,i){i?Nhe(e,t):zhe(e,t)}async function dbe(e){const t=e.clone().normalize();let i;if(t.length>1)for(const r of t)i?r.width>i.width&&(i=r):i=r;else i=t[0];return Dhe(i)}const Fhe={DEVELOPER_BASEMAP:"DeveloperBasemap",JSAPI:"ArcGIS API for JavaScript",METADATA:"Metadata",MULTI_LAYER:"Multilayer",SINGLE_LAYER:"Singlelayer",TABLE:"Table",HOSTED_SERVICE:"Hosted Service",LOCAL_SCENE:"ViewingMode-Local",TILED_IMAGERY:"Tiled Imagery",GROUP_LAYER_MAP:"Map"};function WO(e){var f;const{portal:t,isOrgItem:i,itemControl:r}=e,s=(f=t.user)==null?void 0:f.privileges;let n=!s||s.includes("features:user:edit"),c=!!i&&!!(s!=null&&s.includes("features:user:fullEdit"));const o=r==="update"||r==="admin";return o?c=n=!0:c&&(n=!0),{features:{edit:n,fullEdit:c},content:{updateItem:o}}}const Bhe=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=lr(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(i){i!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",i))}readPortalItem(i,r,s){if(r.itemId)return new _0({id:r.itemId,portal:s==null?void 0:s.portal})}writePortalItem(i,r){i!=null&&i.id&&(r.itemId=i.id)}async loadFromPortal(i,r){var s;if((s=this.portalItem)!=null&&s.id)try{const{load:n}=await ht(()=>import("./layersLoader-CBGHpR45.js"),__vite__mapDeps([249,8,5,3,4,2,6]));return mr(r),await n({instance:this,supportedTypes:i.supportedTypes,validateItem:i.validateItem,supportsData:i.supportsData,layerModuleTypeMap:i.layerModuleTypeMap},r)}catch(n){throw Ys(n)||_t.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id}) ${n}`),n}}async finishLoadEditablePortalLayer(i){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(i).catch(r=>(Na(r),!0)))}async setUserPrivileges(i,r){if(!Ci.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(r);if(this.url)try{const{features:{edit:s,fullEdit:n},content:{updateItem:c}}=await this._fetchUserPrivileges(i,r);this._set("userHasEditingPrivileges",s),this._set("userHasFullEditingPrivileges",n),this._set("userHasUpdateItemPrivileges",c)}catch(s){Na(s)}}async _fetchUserPrivileges(i,r){let s=this.portalItem;if(!i||!s||!s.loaded||s.sourceUrl)return this._fetchFallbackUserPrivileges(r);const n=i===s.id;if(n&&s.portal.user)return WO(s);let c,o;if(n)c=s.portal.url;else try{c=await dZ(this.url,r)}catch(I){Na(I)}if(!c||!Qq(c,s.portal.url))return this._fetchFallbackUserPrivileges(r);try{const I=r!=null?r.signal:null;o=await(bi==null?void 0:bi.getCredential(`${c}/sharing`,{prompt:!1,signal:I}))}catch(I){Na(I)}const f=!0,g=!1,S=!1;if(!o)return{features:{edit:f,fullEdit:g},content:{updateItem:S}};try{if(n?await s.reload():(s=new _0({id:i,portal:{url:c}}),await s.load(r)),s.portal.user)return WO(s)}catch(I){Na(I)}return{features:{edit:f,fullEdit:g},content:{updateItem:S}}}async _fetchFallbackUserPrivileges(i){let r=!0;try{r=await this._fetchUserHasEditingPrivileges(i)}catch(s){Na(s)}return{features:{edit:r,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(i){const r=this.url?bi==null?void 0:bi.findCredential(this.url):null;if(!r)return!0;const s=Rv.credential===r?Rv.user:await this._fetchEditingUser(i);return Rv.credential=r,Rv.user=s,(s==null?void 0:s.privileges)==null||s.privileges.includes("features:user:edit")}async _fetchEditingUser(i){var S,I;const r=(I=(S=this.portalItem)==null?void 0:S.portal)==null?void 0:I.user;if(r)return r;const s=bi.findServerInfo(this.url??"");if(!(s!=null&&s.owningSystemUrl))return null;const n=`${s.owningSystemUrl}/sharing/rest`,c=Za.getDefault();if(c&&c.loaded&&ta(c.restUrl)===ta(n))return c.user;const o=`${n}/community/self`,f=i!=null?i.signal:null,g=await SA(Qi(o,{authMode:"no-prompt",query:{f:"json"},signal:f}));return g.ok?kA.fromJSON(g.value.data):null}read(i,r){r&&(r.layer=this),super.read(i,r)}write(i,r){var c;const s=r==null?void 0:r.portal,n=((c=this.portalItem)==null?void 0:c.id)&&(this.portalItem.portal||Za.getDefault());return s&&n&&!D4(n.restUrl,s.restUrl)?(r.messages&&r.messages.push(new Je("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(i,{...r,layer:this})}};return v([M({type:_0})],t.prototype,"portalItem",null),v([mi("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),v([ui("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),v([M({clonable:!1})],t.prototype,"resourceReferences",void 0),v([M({type:Boolean,readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),v([M({type:Boolean,readOnly:!0})],t.prototype,"userHasFullEditingPrivileges",void 0),v([M({type:Boolean,readOnly:!0})],t.prototype,"userHasUpdateItemPrivileges",void 0),t=v([fe("esri.layers.mixins.PortalLayer")],t),t},Rv={credential:null,user:null},Uhe=e=>{let t=class extends e{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const i={minScale:this.minScale,maxScale:this.maxScale},r=this.parent;r&&"effectiveScaleRange"in r&&jhe(i,r.effectiveScaleRange);const s=this._get("effectiveScaleRange");return s&&s.minScale===i.minScale&&s.maxScale===i.maxScale?s:i}};return v([M({type:Number,nonNullable:!0,json:{write:!0}})],t.prototype,"minScale",void 0),v([M({type:Number,nonNullable:!0,json:{write:!0}})],t.prototype,"maxScale",void 0),v([M({readOnly:!0})],t.prototype,"effectiveScaleRange",null),t=v([fe("esri.layers.mixins.ScaleRangeLayer")],t),t};function jhe(e,t){return e.minScale=e.minScale>0?t.minScale>0?Math.min(e.minScale,t.minScale):e.minScale:t.minScale,e.maxScale=e.maxScale>0?t.maxScale>0?Math.max(e.maxScale,t.maxScale):e.maxScale:t.maxScale,e}let Ov=null;function Vhe(e){if(Ov)return Ov;const t={lossy:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",lossless:"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",alpha:"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",animation:"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"};return Ov=new Promise(i=>{const r=new Image;r.onload=()=>{r.onload=r.onerror=null,i(r.width>0&&r.height>0)},r.onerror=()=>{r.onload=r.onerror=null,i(!1)},r.src="data:image/webp;base64,"+t[e]}),Ov}const ZO=1.15;let YO=class{constructor(t,i){this._spriteSource=t,this._maxTextureSize=i,this.devicePixelRatio=1,this._spriteImageFormat="png",this._isRetina=!1,this._spritesData={},this.image=null,this.width=null,this.height=null,this.loadStatus="not-loaded",t.type==="url"&&t.spriteFormat&&(this._spriteImageFormat=t.spriteFormat),t.pixelRatio&&(this.devicePixelRatio=t.pixelRatio),this.baseURL=t.spriteUrl}get spriteNames(){const t=[];for(const i in this._spritesData)t.push(i);return t.sort(),t}getSpriteInfo(t){return this._spritesData?this._spritesData[t]:null}async load(t){if(this.baseURL){this.loadStatus="loading";try{await this._loadSprites(t),this.loadStatus="loaded"}catch{this.loadStatus="failed"}}else this.loadStatus="failed"}async _loadSprites(t){this._isRetina=this.devicePixelRatio>ZO;const{width:i,height:r,data:s,json:n}=await this._getSpriteData(this._spriteSource,t),c=Object.keys(n);if(!c||c.length===0||!s)return this._spritesData=this.image=null,void(this.width=this.height=0);this._spritesData=n,this.width=i,this.height=r;const o=Math.max(this._maxTextureSize,4096);if(i>o||r>o){const g=`Sprite resource for style ${this.baseURL} is bigger than the maximum allowed of ${o} pixels}`;throw _t.getLogger("esri.layers.support.SpriteSource").error(g),new Je("SpriteSource",g)}let f;for(let g=0;gt.data.index)),this._tileIndexPromise}async dataKey(t,i){const r=await this.fetchTileIndex();return mr(i),this._getIndexedDataKey(r,t)}_getIndexedDataKey(t,i){const r=[i];if(i.level<0||i.row<0||i.col<0||i.row>>i.level>0||i.col>>i.level>0)return null;let s=i;for(;s.level!==0;)s=new Fl(s.level-1,s.row>>1,s.col>>1,s.world),r.push(s);let n,c,o=t,f=r.pop();if(o===1)return f;for(;r.length;)if(n=r.pop(),c=(1&n.col)+((1&n.row)<<1),o){if(o[c]===0){f=null;break}if(o[c]===1){f=n;break}f=n,o=o[c]}return f}},qhe=class{constructor(t,i){this._tilemap=t,this._tileIndexUrl=i}destroy(){this._tilemap=lr(this._tilemap),this._tileIndexPromise=null}async fetchTileIndex(t){return this._tileIndexPromise||(this._tileIndexPromise=Qi(this._tileIndexUrl,{query:{...t==null?void 0:t.query}}).then(i=>i.data.index)),this._tileIndexPromise}dataKey(t,i){const{level:r,row:s,col:n}=t,c=new Fl(t);return this._tilemap.fetchAvailabilityUpsample(r,s,n,c,i).then(()=>(c.world=t.world,c)).catch(o=>{if(Ys(o))throw o;return null})}},Hhe=class{constructor(t){this._tileUrl=t,this._promise=null,this._abortController=null,this._abortOptions=[]}getData(t){var r;(this._promise==null||ra((r=this._abortController)==null?void 0:r.signal))&&(this._promise=this._makeRequest(this._tileUrl));const i=this._abortOptions;return i.push(t),io(t,()=>{i.every(s=>ra(s))&&this._abortController.abort()}),this._promise.then(s=>He(s))}async _makeRequest(t){this._abortController=new AbortController;const{data:i}=await Qi(t,{responseType:"array-buffer",signal:this._abortController.signal});return i}};const KO=new Map;function Whe(e,t,i,r,s){const n=Rr(e),c=n.query;if(c)for(const[f,g]of Object.entries(c))switch(g){case"{x}":c[f]=r.toString();break;case"{y}":c[f]=i.toString();break;case"{z}":c[f]=t.toString()}const o=n.path;return Zhe(Pl(o.replaceAll(/\{z\}/gi,t.toString()).replaceAll(/\{y\}/gi,i.toString()).replaceAll(/\{x\}/gi,r.toString()),{...n.query}),s)}function Zhe(e,t){return nA(KO,e,()=>new Hhe(e)).getData(t).finally(()=>KO.delete(e))}let Yhe=class{constructor(t,i,r){this.tilemap=null,this.tileInfo=null,this.capabilities=null,this.fullExtent=null,this.initialExtent=null,this.name=t,this.sourceUrl=i;const s=Rr(this.sourceUrl),n=He(r),c=n.tiles;if(s)for(let A=0;AA.toLowerCase().trim()),f=(r==null?void 0:r.exportTilesAllowed)===!0,g=(o==null?void 0:o.includes("tilemap"))===!0,S=f&&r.hasOwnProperty("maxExportTilesCount")?r.maxExportTilesCount:0;this.capabilities={operations:{supportsExportTiles:f,supportsTileMap:g},exportTiles:f?{maxExportTilesCount:+S}:null},this.tileInfo=Ep.fromJSON(n.tileInfo);const I=r.tileMap?Pl(fp(s.path,r.tileMap),s.query??{}):null;g?(this.type="vector-tile",this.tilemap=new qhe(new Zo({layer:{parsedUrl:s,tileInfo:this.tileInfo},minLOD:n.minLOD??this.tileInfo.lods[0].level,maxLOD:n.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}),I)):I&&(this.tilemap=new Ghe(I)),this.fullExtent=Ui.fromJSON(r.fullExtent),this.initialExtent=Ui.fromJSON(r.initialExtent)}destroy(){var t;(t=this.tilemap)==null||t.destroy()}async getRefKey(t,i){var r;return await((r=this.tilemap)==null?void 0:r.dataKey(t,i))??t}requestTile(t,i,r,s){const n=this.tileServers[i%this.tileServers.length];return Whe(n,t,i,r,s)}isCompatibleWith(t){const i=this.tileInfo,r=t.tileInfo;if(!i.spatialReference.equals(r.spatialReference)||!i.origin.equals(r.origin)||Math.round(i.dpi)!==Math.round(r.dpi))return!1;const s=i.lods,n=r.lods,c=Math.min(s.length,n.length);for(let o=0;o=Lv||Math.abs(i.y-r.y)>=Lv)return!1;let s,n;e.lods[0].scale>t.lods[0].scale?(s=e,n=t):(n=e,s=t);for(let c=s.lods[0].scale;c>=n.lods[n.lods.length-1].scale-Lv;c/=2)if(Math.abs(c-n.lods[0].scale)t.lods[0].scale?e.lods[0]:t.lods[0],f=e.lods[e.lods.length-1].scale<=t.lods[t.lods.length-1].scale?e.lods[e.lods.length-1]:t.lods[t.lods.length-1],g=o.scale,S=o.resolution,I=f.scale,A=[];let O=g,z=S,V=0;for(;O>I;)A.push(new kc({level:V,resolution:z,scale:O})),V++,O/=2,z/=2;return new Ep({size:[i,i],dpi:s,format:r||"pbf",origin:n,lods:A,spatialReference:c})}var LI,DI,QO,eL,tL,iL,rL,sL,nL,oL,aL,lL,cL,uL,hL,dL,pL,fL,mL,yL,gL,_L,vL,bL,wL,xL,SL,TL,EL,ML,IL,AL,PL,CL,$L,kL,RL,OL,LL,DL,NL,zL,FL,BL,UL,jL,VL,GL,qL,HL,WL,ZL,YL,JL,KL,XL,QL,eD,tD,iD,rD;(function(e){e[e.BUTT=0]="BUTT",e[e.ROUND=1]="ROUND",e[e.SQUARE=2]="SQUARE",e[e.UNKNOWN=4]="UNKNOWN"})(LI||(LI={})),function(e){e[e.BEVEL=0]="BEVEL",e[e.ROUND=1]="ROUND",e[e.MITER=2]="MITER",e[e.UNKNOWN=4]="UNKNOWN"}(DI||(DI={})),function(e){e[e.SCREEN=0]="SCREEN",e[e.MAP=1]="MAP"}(QO||(QO={})),function(e){e[e.Tint=0]="Tint",e[e.Ignore=1]="Ignore",e[e.Multiply=99]="Multiply"}(eL||(eL={})),function(e){e.Both="Both",e.JustBegin="JustBegin",e.JustEnd="JustEnd",e.None="None"}(tL||(tL={})),function(e){e[e.Mosaic=0]="Mosaic",e[e.Centered=1]="Centered"}(iL||(iL={})),function(e){e[e.Normal=0]="Normal",e[e.Superscript=1]="Superscript",e[e.Subscript=2]="Subscript"}(rL||(rL={})),function(e){e[e.MSSymbol=0]="MSSymbol",e[e.Unicode=1]="Unicode"}(sL||(sL={})),function(e){e[e.Unspecified=0]="Unspecified",e[e.TrueType=1]="TrueType",e[e.PSOpenType=2]="PSOpenType",e[e.TTOpenType=3]="TTOpenType",e[e.Type1=4]="Type1"}(nL||(nL={})),function(e){e[e.Display=0]="Display",e[e.Map=1]="Map"}(oL||(oL={})),function(e){e.None="None",e.Loop="Loop",e.Oscillate="Oscillate"}(aL||(aL={})),function(e){e[e.Z=0]="Z",e[e.X=1]="X",e[e.Y=2]="Y"}(lL||(lL={})),function(e){e[e.XYZ=0]="XYZ",e[e.ZXY=1]="ZXY",e[e.YXZ=2]="YXZ"}(cL||(cL={})),function(e){e[e.Rectangle=0]="Rectangle",e[e.RoundedRectangle=1]="RoundedRectangle",e[e.Oval=2]="Oval"}(uL||(uL={})),function(e){e[e.None=0]="None",e[e.Alpha=1]="Alpha",e[e.Screen=2]="Screen",e[e.Multiply=3]="Multiply",e[e.Add=4]="Add"}(hL||(hL={})),function(e){e[e.TTB=0]="TTB",e[e.RTL=1]="RTL",e[e.BTT=2]="BTT"}(dL||(dL={})),function(e){e[e.None=0]="None",e[e.SignPost=1]="SignPost",e[e.FaceNearPlane=2]="FaceNearPlane"}(pL||(pL={})),function(e){e[e.Float=0]="Float",e[e.String=1]="String",e[e.Boolean=2]="Boolean"}(fL||(fL={})),function(e){e[e.Intersect=0]="Intersect",e[e.Subtract=1]="Subtract"}(mL||(mL={})),function(e){e.OpenEnded="OpenEnded",e.Block="Block",e.Crossed="Crossed"}(yL||(yL={})),function(e){e.FullGeometry="FullGeometry",e.PerpendicularFromFirstSegment="PerpendicularFromFirstSegment",e.ReversedFirstSegment="ReversedFirstSegment",e.PerpendicularToSecondSegment="PerpendicularToSecondSegment",e.SecondSegmentWithTicks="SecondSegmentWithTicks",e.DoublePerpendicular="DoublePerpendicular",e.OppositeToFirstSegment="OppositeToFirstSegment",e.TriplePerpendicular="TriplePerpendicular",e.HalfCircleFirstSegment="HalfCircleFirstSegment",e.HalfCircleSecondSegment="HalfCircleSecondSegment",e.HalfCircleExtended="HalfCircleExtended",e.OpenCircle="OpenCircle",e.CoverageEdgesWithTicks="CoverageEdgesWithTicks",e.GapExtentWithDoubleTicks="GapExtentWithDoubleTicks",e.GapExtentMidline="GapExtentMidline",e.Chevron="Chevron",e.PerpendicularWithArc="PerpendicularWithArc",e.ClosedHalfCircle="ClosedHalfCircle",e.TripleParallelExtended="TripleParallelExtended",e.ParallelWithTicks="ParallelWithTicks",e.Parallel="Parallel",e.PerpendicularToFirstSegment="PerpendicularToFirstSegment",e.ParallelOffset="ParallelOffset",e.OffsetOpposite="OffsetOpposite",e.OffsetSame="OffsetSame",e.CircleWithArc="CircleWithArc",e.DoubleJog="DoubleJog",e.PerpendicularOffset="PerpendicularOffset",e.LineExcludingLastSegment="LineExcludingLastSegment",e.MultivertexArrow="MultivertexArrow",e.CrossedArrow="CrossedArrow",e.ChevronArrow="ChevronArrow",e.ChevronArrowOffset="ChevronArrowOffset",e.PartialFirstSegment="PartialFirstSegment",e.Arch="Arch",e.CurvedParallelTicks="CurvedParallelTicks",e.Arc90Degrees="Arc90Degrees"}(gL||(gL={})),function(e){e.Mitered="Mitered",e.Bevelled="Bevelled",e.Rounded="Rounded",e.Square="Square",e.TrueBuffer="TrueBuffer"}(_L||(_L={})),function(e){e.ClosePath="ClosePath",e.ConvexHull="ConvexHull",e.RectangularBox="RectangularBox"}(vL||(vL={})),function(e){e.BeginningOfLine="BeginningOfLine",e.EndOfLine="EndOfLine"}(bL||(bL={})),function(e){e.Mitered="Mitered",e.Bevelled="Bevelled",e.Rounded="Rounded",e.Square="Square"}(wL||(wL={})),function(e){e.Fast="Fast",e.Accurate="Accurate"}(xL||(xL={})),function(e){e.BeginningOfLine="BeginningOfLine",e.EndOfLine="EndOfLine"}(SL||(SL={})),function(e){e.Sinus="Sinus",e.Square="Square",e.Triangle="Triangle",e.Random="Random"}(TL||(TL={})),function(e){e[e.None=0]="None",e[e.Default=1]="Default",e[e.Force=2]="Force"}(EL||(EL={})),function(e){e[e.Buffered=0]="Buffered",e[e.Left=1]="Left",e[e.Right=2]="Right",e[e.AlongLine=3]="AlongLine"}(ML||(ML={})),function(e){e[e.Linear=0]="Linear",e[e.Rectangular=1]="Rectangular",e[e.Circular=2]="Circular",e[e.Buffered=3]="Buffered"}(IL||(IL={})),function(e){e[e.Discrete=0]="Discrete",e[e.Continuous=1]="Continuous"}(AL||(AL={})),function(e){e[e.AcrossLine=0]="AcrossLine",e[e.AloneLine=1]="AloneLine"}(PL||(PL={})),function(e){e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.Center=2]="Center",e[e.Justify=3]="Justify"}(CL||(CL={})),function(e){e[e.Base=0]="Base",e[e.MidPoint=1]="MidPoint",e[e.ThreePoint=2]="ThreePoint",e[e.FourPoint=3]="FourPoint",e[e.Underline=4]="Underline",e[e.CircularCW=5]="CircularCW",e[e.CircularCCW=6]="CircularCCW"}($L||($L={})),function(e){e.Butt="Butt",e.Round="Round",e.Square="Square"}(kL||(kL={})),function(e){e.NoConstraint="NoConstraint",e.HalfPattern="HalfPattern",e.HalfGap="HalfGap",e.FullPattern="FullPattern",e.FullGap="FullGap",e.Custom="Custom"}(RL||(RL={})),function(e){e[e.None=-1]="None",e[e.Custom=0]="Custom",e[e.Circle=1]="Circle",e[e.OpenArrow=2]="OpenArrow",e[e.ClosedArrow=3]="ClosedArrow",e[e.Diamond=4]="Diamond"}(OL||(OL={})),function(e){e[e.ExtraLeading=0]="ExtraLeading",e[e.Multiple=1]="Multiple",e[e.Exact=2]="Exact"}(LL||(LL={})),function(e){e.Bevel="Bevel",e.Round="Round",e.Miter="Miter"}(DL||(DL={})),function(e){e[e.Default=0]="Default",e[e.String=1]="String",e[e.Numeric=2]="Numeric"}(NL||(NL={})),function(e){e[e.InsidePolygon=0]="InsidePolygon",e[e.PolygonCenter=1]="PolygonCenter",e[e.RandomlyInsidePolygon=2]="RandomlyInsidePolygon"}(zL||(zL={})),function(e){e[e.Tint=0]="Tint",e[e.Replace=1]="Replace",e[e.Multiply=2]="Multiply"}(FL||(FL={})),function(e){e[e.ClipAtBoundary=0]="ClipAtBoundary",e[e.RemoveIfCenterOutsideBoundary=1]="RemoveIfCenterOutsideBoundary",e[e.DoNotTouchBoundary=2]="DoNotTouchBoundary",e[e.DoNotClip=3]="DoNotClip"}(BL||(BL={})),function(e){e.NoConstraint="NoConstraint",e.WithMarkers="WithMarkers",e.WithFullGap="WithFullGap",e.WithHalfGap="WithHalfGap",e.Custom="Custom"}(UL||(UL={})),function(e){e.Fixed="Fixed",e.Random="Random",e.RandomFixedQuantity="RandomFixedQuantity"}(jL||(jL={})),function(e){e.LineMiddle="LineMiddle",e.LineBeginning="LineBeginning",e.LineEnd="LineEnd",e.SegmentMidpoint="SegmentMidpoint"}(VL||(VL={})),function(e){e.OnPolygon="OnPolygon",e.CenterOfMass="CenterOfMass",e.BoundingBoxCenter="BoundingBoxCenter"}(GL||(GL={})),function(e){e[e.Low=0]="Low",e[e.Medium=1]="Medium",e[e.High=2]="High"}(qL||(qL={})),function(e){e[e.MarkerCenter=0]="MarkerCenter",e[e.MarkerBounds=1]="MarkerBounds"}(HL||(HL={})),function(e){e[e.None=0]="None",e[e.PropUniform=1]="PropUniform",e[e.PropNonuniform=2]="PropNonuniform",e[e.DifUniform=3]="DifUniform",e[e.DifNonuniform=4]="DifNonuniform"}(WL||(WL={})),function(e){e.Tube="Tube",e.Strip="Strip",e.Wall="Wall"}(ZL||(ZL={})),function(e){e[e.Random=0]="Random",e[e.Increasing=1]="Increasing",e[e.Decreasing=2]="Decreasing",e[e.IncreasingThenDecreasing=3]="IncreasingThenDecreasing"}(YL||(YL={})),function(e){e[e.Relative=0]="Relative",e[e.Absolute=1]="Absolute"}(JL||(JL={})),function(e){e[e.Normal=0]="Normal",e[e.LowerCase=1]="LowerCase",e[e.Allcaps=2]="Allcaps"}(KL||(KL={})),function(e){e[e.LTR=0]="LTR",e[e.RTL=1]="RTL"}(XL||(XL={})),function(e){e.Draft="Draft",e.Picture="Picture",e.Text="Text"}(QL||(QL={})),function(e){e[e.Top=0]="Top",e[e.Center=1]="Center",e[e.Baseline=2]="Baseline",e[e.Bottom=3]="Bottom"}(eD||(eD={})),function(e){e[e.Right=0]="Right",e[e.Upright=1]="Upright"}(tD||(tD={})),function(e){e[e.Small=0]="Small",e[e.Medium=1]="Medium",e[e.Large=2]="Large"}(iD||(iD={})),function(e){e[e.Calm=0]="Calm",e[e.Rippled=1]="Rippled",e[e.Slight=2]="Slight",e[e.Moderate=3]="Moderate"}(rD||(rD={}));var Br,Gd,NI,Ol,zI,Kw,FI,qd,BI;(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"})(Br||(Br={})),function(e){e[e.VISIBLE=0]="VISIBLE",e[e.NONE=1]="NONE"}(Gd||(Gd={})),function(e){e[e.POINT=0]="POINT",e[e.LINE=1]="LINE",e[e.LINE_CENTER=2]="LINE_CENTER"}(NI||(NI={})),function(e){e[e.MAP=0]="MAP",e[e.VIEWPORT=1]="VIEWPORT",e[e.AUTO=2]="AUTO"}(Ol||(Ol={})),function(e){e[e.AUTO=0]="AUTO",e[e.LEFT=1]="LEFT",e[e.CENTER=2]="CENTER",e[e.RIGHT=3]="RIGHT"}(zI||(zI={})),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"}(Kw||(Kw={})),function(e){e[e.NONE=0]="NONE",e[e.UPPERCASE=1]="UPPERCASE",e[e.LOWERCASE=2]="LOWERCASE"}(FI||(FI={})),function(e){e[e.MAP=0]="MAP",e[e.VIEWPORT=1]="VIEWPORT"}(qd||(qd={})),function(e){e[e.HORIZONTAL=0]="HORIZONTAL",e[e.VERTICAL=1]="VERTICAL"}(BI||(BI={}));let is=class{};is.backgroundLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:Gd.VISIBLE}},is.fillLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:Gd.VISIBLE}},is.lineLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:Gd.VISIBLE},"line-cap":{type:"enum",values:["butt","round","square"],default:LI.BUTT},"line-join":{type:"enum",values:["bevel","round","miter"],default:DI.MITER},"line-miter-limit":{type:"number",default:2},"line-round-limit":{type:"number",default:1.05}},is.symbolLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:Gd.VISIBLE},"symbol-avoid-edges":{type:"boolean",default:!1},"symbol-placement":{type:"enum",values:["point","line","line-center"],default:NI.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:Kw.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:Ol.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:Kw.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:zI.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:Ol.AUTO},"text-size":{type:"number",minimum:0,default:16},"text-transform":{type:"enum",values:["none","uppercase","lowercase"],default:FI.NONE},"text-writing-mode":{type:"array",value:"enum",values:["horizontal","vertical"],default:[BI.HORIZONTAL]}},is.circleLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:Gd.VISIBLE}},is.backgroundPaintDefinition={"background-color":{type:"color",default:[0,0,0,1]},"background-opacity":{type:"number",minimum:0,maximum:1,default:1},"background-pattern":{type:"string"}},is.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:qd.MAP}},is.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:qd.MAP},"line-width":{type:"number",minimum:0,default:1}},is.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:qd.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:qd.MAP}},is.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}},is.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:qd.MAP}};var sD,Vc,nD;(function(e){e[e.FILL=1]="FILL",e[e.LINE=2]="LINE",e[e.SYMBOL=3]="SYMBOL",e[e.CIRCLE=4]="CIRCLE"})(sD||(sD={})),function(e){e[e.BACKGROUND=0]="BACKGROUND",e[e.FILL=1]="FILL",e[e.OUTLINE=2]="OUTLINE",e[e.LINE=3]="LINE",e[e.ICON=4]="ICON",e[e.CIRCLE=5]="CIRCLE",e[e.TEXT=6]="TEXT",e[e.TILEINFO=7]="TILEINFO"}(Vc||(Vc={})),function(e){e[e.PAINTER_CHANGED=0]="PAINTER_CHANGED",e[e.LAYOUT_CHANGED=1]="LAYOUT_CHANGED",e[e.LAYER_CHANGED=2]="LAYER_CHANGED",e[e.LAYER_REMOVED=3]="LAYER_REMOVED",e[e.SPRITES_CHANGED=4]="SPRITES_CHANGED"}(nD||(nD={}));const rde=512;var Jo,As;(function(e){e[e.Unknown=0]="Unknown",e[e.Point=1]="Point",e[e.LineString=2]="LineString",e[e.Polygon=3]="Polygon"})(Jo||(Jo={}));let Hs=class Ob{constructor(t,i){this.x=t,this.y=i}clone(){return new Ob(this.x,this.y)}equals(t,i){return t===this.x&&i===this.y}isEqual(t){return t.x===this.x&&t.y===this.y}setCoords(t,i){return this.x=t,this.y=i,this}normalize(){const t=this.x,i=this.y,r=Math.sqrt(t*t+i*i);return this.x/=r,this.y/=r,this}rightPerpendicular(){const t=this.x;return this.x=this.y,this.y=-t,this}leftPerpendicular(){const t=this.x;return this.x=-this.y,this.y=t,this}move(t,i){return this.x+=t,this.y+=i,this}assign(t){return this.x=t.x,this.y=t.y,this}assignAdd(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this}assignSub(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this}rotate(t,i){const r=this.x,s=this.y;return this.x=r*t-s*i,this.y=r*i+s*t,this}scale(t){return this.x*=t,this.y*=t,this}length(){const t=this.x,i=this.y;return Math.sqrt(t*t+i*i)}sub(t){return this.x-=t.x,this.y-=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}static distance(t,i){const r=i.x-t.x,s=i.y-t.y;return Math.sqrt(r*r+s*s)}static add(t,i){return new Ob(t.x+i.x,t.y+i.y)}static sub(t,i){return new Ob(t.x-i.x,t.y-i.y)}},Dv=class{constructor(t,i,r){this.ratio=t,this.x=i,this.y=r}},wbe=class{constructor(t,i,r,s=8,n=8){this._lines=[],this._starts=[],this.validateTessellation=!0,this._pixelRatio=s,this._pixelMargin=n,this._tileSize=rde*s,this._dz=t,this._yPos=i,this._xPos=r}setPixelMargin(t){t!==this._pixelMargin&&(this._pixelMargin=t,this.setExtent(this._extent))}setExtent(t){this._extent=t,this._finalRatio=this._tileSize/t*(1<>this._dz;i>r&&(i=r),this._margin=i,this._xmin=r*this._xPos-i,this._ymin=r*this._yPos-i,this._xmax=this._xmin+r+2*i,this._ymax=this._ymin+r+2*i}reset(t){this._type=t,this._lines=[],this._starts=[],this._line=null,this._start=0}moveTo(t,i){this._pushLine(),this._prevIsIn=this._isIn(t,i),this._moveTo(t,i,this._prevIsIn),this._prevPt=new Hs(t,i),this._firstPt=new Hs(t,i),this._dist=0}lineTo(t,i){const r=this._isIn(t,i),s=new Hs(t,i),n=Hs.distance(this._prevPt,s);let c,o,f,g,S,I,A,O;if(r)this._prevIsIn?this._lineTo(t,i,!0):(c=this._prevPt,o=s,f=this._intersect(o,c),this._start=this._dist+n*(1-this._r),this._lineTo(f.x,f.y,!0),this._lineTo(o.x,o.y,!0));else if(this._prevIsIn)o=this._prevPt,c=s,f=this._intersect(o,c),this._lineTo(f.x,f.y,!0),this._lineTo(c.x,c.y,!1);else{const z=this._prevPt,V=s;if(z.x<=this._xmin&&V.x<=this._xmin||z.x>=this._xmax&&V.x>=this._xmax||z.y<=this._ymin&&V.y<=this._ymin||z.y>=this._ymax&&V.y>=this._ymax)this._lineTo(V.x,V.y,!1);else{const H=[];if((z.xthis._xmin||z.x>this._xmin&&V.x=this._ymax?I=!0:H.push(new Dv(g,this._xmin,O))),(z.xthis._xmax||z.x>this._xmax&&V.x=this._ymax?I=!0:H.push(new Dv(g,this._xmax,O))),(z.ythis._ymin||z.y>this._ymin&&V.y=this._xmax?S=!0:H.push(new Dv(g,A,this._ymin))),(z.ythis._ymax||z.y>this._ymax&&V.y=this._xmax?S=!0:H.push(new Dv(g,A,this._ymax))),H.length===0)S?I?this._lineTo(this._xmax,this._ymax,!0):this._lineTo(this._xmax,this._ymin,!0):I?this._lineTo(this._xmin,this._ymax,!0):this._lineTo(this._xmin,this._ymin,!0);else if(H.length>1&&H[0].ratio>H[1].ratio)this._start=this._dist+n*H[1].ratio,this._lineTo(H[1].x,H[1].y,!0),this._lineTo(H[0].x,H[0].y,!0);else{this._start=this._dist+n*H[0].ratio;for(let Q=0;Q2){const t=this._firstPt,i=this._prevPt;t.x===i.x&&t.y===i.y||this.lineTo(t.x,t.y);const r=this._line;let s=r.length;for(;s>=4&&(r[0].x===r[1].x&&r[0].x===r[s-2].x||r[0].y===r[1].y&&r[0].y===r[s-2].y);)r.pop(),r[0].x=r[s-2].x,r[0].y=r[s-2].y,--s}}result(t=!0){return this._pushLine(),this._lines.length===0?null:(this._type===Jo.Polygon&&t&&sde.simplify(this._tileSize,this._margin*this._finalRatio,this._lines),this._lines)}resultWithStarts(){if(this._type!==Jo.LineString)throw new Error("Only valid for lines");this._pushLine();const t=this._lines,i=t.length;if(i===0)return null;const r=[];for(let s=0;s=this._xmin&&t<=this._xmax&&i>=this._ymin&&i<=this._ymax}_intersect(t,i){let r,s,n;if(i.x>=this._xmin&&i.x<=this._xmax)s=i.y<=this._ymin?this._ymin:this._ymax,n=(s-t.y)/(i.y-t.y),r=t.x+n*(i.x-t.x);else if(i.y>=this._ymin&&i.y<=this._ymax)r=i.x<=this._xmin?this._xmin:this._xmax,n=(r-t.x)/(i.x-t.x),s=t.y+n*(i.y-t.y);else{s=i.y<=this._ymin?this._ymin:this._ymax,r=i.x<=this._xmin?this._xmin:this._xmax;const c=(r-t.x)/(i.x-t.x),o=(s-t.y)/(i.y-t.y);c0&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===Jo.LineString?this._line.length>1&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===Jo.Polygon&&this._line.length>3&&(this._lines.push(this._line),this._starts.push(this._start))),this._line=[],this._start=0}_moveTo(t,i,r){this._type!==Jo.Polygon?r&&(t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.push(new Hs(t,i))):(r||(tthis._xmax&&(t=this._xmax),ithis._ymax&&(i=this._ymax)),t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.push(new Hs(t,i)),this._isH=!1,this._isV=!1)}_lineTo(t,i,r){let s,n;if(this._type!==Jo.Polygon)if(r){if(t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.length>0&&(s=this._line[this._line.length-1],s.equals(t,i)))return;this._line.push(new Hs(t,i))}else this._line&&this._line.length>0&&this._pushLine();else if(r||(tthis._xmax&&(t=this._xmax),ithis._ymax&&(i=this._ymax)),t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line&&this._line.length>0){s=this._line[this._line.length-1];const c=s.x===t,o=s.y===i;if(c&&o)return;this._isH&&c||this._isV&&o?(s.x=t,s.y=i,n=this._line[this._line.length-2],n.x===t&&n.y===i?(this._line.pop(),this._line.length<=1?(this._isH=!1,this._isV=!1):(n=this._line[this._line.length-2],this._isH=n.x===t,this._isV=n.y===i)):(this._isH=n.x===t,this._isV=n.y===i)):(this._line.push(new Hs(t,i)),this._isH=c,this._isV=o)}else this._line.push(new Hs(t,i))}},Sbe=class{setExtent(t){this._ratio=t===4096?1:4096/t}get validateTessellation(){return this._ratio<1}reset(t){this._lines=[],this._line=null}moveTo(t,i){this._line&&this._lines.push(this._line),this._line=[];const r=this._ratio;this._line.push(new Hs(t*r,i*r))}lineTo(t,i){const r=this._ratio;this._line.push(new Hs(t*r,i*r))}close(){const t=this._line;t&&!t[0].isEqual(t[t.length-1])&&t.push(t[0])}result(){return this._line&&this._lines.push(this._line),this._lines.length===0?null:this._lines}};(function(e){e[e.sideLeft=0]="sideLeft",e[e.sideRight=1]="sideRight",e[e.sideTop=2]="sideTop",e[e.sideBottom=3]="sideBottom"})(As||(As={}));let sde=class Zu{static simplify(t,i,r){if(!r)return;const s=-i,n=t+i,c=-i,o=t+i,f=[],g=[],S=r.length;for(let A=0;Az.y?(f.push(A),f.push(Q),f.push(As.sideLeft),f.push(-1)):(g.push(A),g.push(Q),g.push(As.sideLeft),g.push(-1))),V.x>=n&&(V.y=o&&(V.x>z.x?(f.push(A),f.push(Q),f.push(As.sideBottom),f.push(-1)):(g.push(A),g.push(Q),g.push(As.sideBottom),g.push(-1)))),V=z}if(f.length===0||g.length===0)return;Zu.fillParent(r,g,f),Zu.fillParent(r,f,g);const I=[];Zu.calcDeltas(I,g,f),Zu.calcDeltas(I,f,g),Zu.addDeltas(I,r)}static fillParent(t,i,r){const s=r.length,n=i.length;for(let c=0;c1&&s[c-2]===n?0:(s.push(n),Zu.calcDelta(n,r,i,s)+1)}static addDeltas(t,i){const r=t.length;let s=0;for(let n=0;ns&&(s=c)}for(let n=0;ne>=t&&e<=i||e>=i&&e<=t,Ebe=Number.POSITIVE_INFINITY,oP=Math.PI,Mbe=2*oP,nde=128/oP,ode=256/360,Ibe=oP/180,ade=1/Math.LN2;function ZU(e,t){return(e%=t)>=0?e:e+t}function Abe(e){return ZU(e*nde,256)}function Pbe(e){return ZU(e*ode,256)}function Cbe(e){return Math.log(e)*ade}function Cn(e,t,i){return e*(1-i)+t*i}const lde=8,cde=14,ude=16;function $be(e){return lde+Math.max((e-cde)*ude,0)}function hde(e,t,i){let r,s,n,c=0;for(const o of i){r=o.length;for(let f=1;ft!=n.y>t&&((n.x-s.x)*(t-s.y)-(n.y-s.y)*(e-s.x)>0?c++:c--)}return c!==0}function YU(e,t,i,r){let s,n,c,o;const f=r*r;for(const g of i){const S=g.length;if(!(S<2)){s=g[0].x,n=g[0].y;for(let I=1;I0){for(let ze=0;ze4)s++,ze={dataIndex:s,count:0,offset:0},me!==4&&(r[Ce]=ze),t.push({location:-1,name:"a_data_"+s,count:me,type:Q,normalized:ge}),je=Math.ceil(Math.max(Ie/4,1));else{const tt=t[ze.dataIndex];tt.count+=me,je=Math.ceil(Math.max(tt.count*ve/4,1))-Math.ceil(Math.max(ze.offset/4,1))}z.push({dataIndex:ze.dataIndex,offset:ze.offset,bufferElementsToAdd:je}),ze.offset+=Ie,ze.count+=me}}for(const I of t)switch(I.type){case pi.BYTE:case pi.UNSIGNED_BYTE:I.count=4;break;case pi.SHORT:case pi.UNSIGNED_SHORT:I.count+=I.count%2}this._buildVertexBufferLayout(t);let f=0;const g=this._layoutInfo.geometry;for(const I of g)this._locations.set(I.name,f++);const S=this._layoutInfo.opacity;if(S)for(const I of S)this._locations.set(I.name,f++);this._buildShaderInfo(t,i),this._propertyEncodingInfo=i}_buildVertexBufferLayout(t){const i={},r=this.geometryInfo();let s=r[0].stride;if(t.length===0)i.geometry=r;else{const n=[];let c=s;for(const o of t)s+=LD(o.type)*o.count;for(const o of r)n.push(new Zs(o.name,o.count,o.type,o.offset,s,o.normalized));for(const o of t)n.push(new Zs(o.name,o.count,o.type,c,s,o.normalized)),c+=LD(o.type)*o.count;i.geometry=n}this.opacityInfo()&&(i.opacity=this.opacityInfo()),this._layoutInfo=i,this._stride=s}_buildShaderInfo(t,i){let r=` `,s=` `;const n=[];for(const g of t)r+=`attribute ${this._getType(g.count)} ${g.name}; @@ -661,4 +661,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho monaco.config({ paths: { vs: '...' } }) For more please check the link https://github.com/suren-atoyan/monaco-loader#config - `},e5=nme(cme)(Q9),ume={config:ame},hme=function(){for(var t=arguments.length,i=new Array(t),r=0;r{t5.config({paths:{vs:"https://unpkg.com/monaco-editor/min/vs"}}),c=await t5.init(),i(3,n=c.editor.create(o,{value:r,language:s||"json",theme:"vs-light"}))}),jm(()=>{var S;(S=n.getModel())==null||S.dispose(),n.dispose()});function g(S){Tm[S?"unshift":"push"](()=>{o=S,i(0,o)})}return e.$$set=S=>{"content"in S&&i(1,r=S.content),"language"in S&&i(2,s=S.language)},e.$$.update=()=>{e.$$.dirty&10&&n&&n.setValue(r),e.$$.dirty&8&&n&&n.onDidChangeModelContent(()=>{const S=n.getValue();f("change",S)})},[o,r,s,n,g]}class i5 extends Ul{constructor(t){super(),Bl(this,t,xme,wme,Xa,{content:1,language:2})}}async function rj(e){const t=`${e}/resources/styles/root.json`,i=await fetch(t);if(!i.ok)throw new Error(`Failed to fetch Esri style JSON: ${i.statusText}`);return i.json()}async function Sme(e,t){const i=e.endsWith("/")?e.slice(0,-1):e;t||(t=await rj(i));const r=JSON.parse(JSON.stringify(t));if(r.sprite&&(r.sprite=`${i}/resources/${r.sprite.replace("../","")}`),r.glyphs&&(r.glyphs=`${i}/resources/${r.glyphs.replace("../","")}`),r.sources)for(const s in r.sources){const n=r.sources[s];n.type==="vector"&&n.url&&(n.url=`${i}/${n.url.replace("../../","")}`)}return r}async function Tme(e,t){const i=e.endsWith("/")?e.slice(0,-1):e;if(t||(t=await rj(i)),t.sources)for(const r in t.sources){const s=t.sources[r];if(s.type==="vector"&&s.url){const n={...s};n.tiles=[`${s.url}tile/{z}/{y}/{x}.pbf`],delete n.url,t.sources[r]=n}}return t}function Eme(e){let t,i,r,s,n,c,o,f,g,S,I,A,O,z,V,H,Q,ve,me,ge,Ie,Ce,ze,je,tt,ut,ot,et,Et,dt,vi,$i,Kt,Ft,ji,Gr;function yr(oi){e[10](oi)}let sr={language:"json"};e[2]!==void 0&&(sr.content=e[2]),c=new i5({props:sr}),Tm.push(()=>PT(c,"content",yr)),c.$on("change",e[6]),V=new Kpe({});function fs(oi){e[12](oi)}let qr={language:"json"};return e[3]!==void 0&&(qr.content=e[3]),je=new i5({props:qr}),Tm.push(()=>PT(je,"content",fs)),je.$on("change",e[7]),Kt=new Ofe({}),{c(){t=ds("div"),t.innerHTML='

',i=Ps(),r=ds("div"),s=ds("div"),n=ds("div"),Xn(c.$$.fragment),f=Ps(),g=ds("div"),S=ds("input"),I=Ps(),A=ds("button"),A.textContent="Fetch",O=Ps(),z=ds("div"),Xn(V.$$.fragment),H=Ps(),Q=ds("div"),ve=ds("button"),ve.textContent="⇨",me=Ps(),ge=ds("button"),ge.textContent="⇦",Ie=Ps(),Ce=ds("div"),ze=ds("div"),Xn(je.$$.fragment),ut=Ps(),ot=ds("div"),et=ds("input"),Et=Ps(),dt=ds("button"),dt.textContent="Fetch",vi=Ps(),$i=ds("div"),Xn(Kt.$$.fragment),rr(t,"class","navbar bg-gray-500 shadow-lg"),rr(n,"class","flex-1 p-4 overflow-auto bg-gray-50"),rr(S,"type","text"),rr(S,"placeholder","Enter URL"),rr(S,"class","input input-bordered w-full mr-2"),rr(A,"class","btn btn-outline"),rr(g,"class","flex items-center p-4 bg-gray-200"),rr(z,"class","flex-1"),rr(s,"class","flex-1 flex flex-col sm:h-full"),rr(ve,"class","btn btn-outline-white btn-md mx-2 md:my-2"),rr(ge,"class","btn btn-outline-white btn-md mx-2 md:my-2"),rr(Q,"class","flex justify-center items-center p-2 bg-gray-500 shadow z-10 w-full md:w-16 h-full md:flex-col sm:flex-row"),rr(ze,"class","flex-1 p-4 overflow-auto bg-gray-50"),rr(et,"type","text"),rr(et,"placeholder","Enter URL"),rr(et,"class","input input-bordered w-full mr-2"),rr(dt,"class","btn btn-outline"),rr(ot,"class","flex items-center p-4 bg-gray-200"),rr($i,"class","flex-1"),rr(Ce,"class","flex-1 flex flex-col sm:h-full"),rr(r,"class","flex flex-col md:flex-row h-screen")},m(oi,gr){Qn(oi,t,gr),Qn(oi,i,gr),Qn(oi,r,gr),wr(r,s),wr(s,n),Rn(c,n,null),wr(s,f),wr(s,g),wr(g,S),q1(S,e[0]),wr(g,I),wr(g,A),wr(s,O),wr(s,z),Rn(V,z,null),wr(r,H),wr(r,Q),wr(Q,ve),wr(Q,me),wr(Q,ge),wr(r,Ie),wr(r,Ce),wr(Ce,ze),Rn(je,ze,null),wr(Ce,ut),wr(Ce,ot),wr(ot,et),q1(et,e[1]),wr(ot,Et),wr(ot,dt),wr(Ce,vi),wr(Ce,$i),Rn(Kt,$i,null),Ft=!0,ji||(Gr=[ld(S,"input",e[11]),ld(A,"click",e[4]),ld(ve,"click",e[8]),ld(ge,"click",e[9]),ld(et,"input",e[13]),ld(dt,"click",e[5])],ji=!0)},p(oi,[gr]){const Tr={};!o&&gr&4&&(o=!0,Tr.content=oi[2],AT(()=>o=!1)),c.$set(Tr),gr&1&&S.value!==oi[0]&&q1(S,oi[0]);const Hr={};!tt&&gr&8&&(tt=!0,Hr.content=oi[3],AT(()=>tt=!1)),je.$set(Hr),gr&2&&et.value!==oi[1]&&q1(et,oi[1])},i(oi){Ft||(Ur(c.$$.fragment,oi),Ur(V.$$.fragment,oi),Ur(je.$$.fragment,oi),Ur(Kt.$$.fragment,oi),Ft=!0)},o(oi){vs(c.$$.fragment,oi),vs(V.$$.fragment,oi),vs(je.$$.fragment,oi),vs(Kt.$$.fragment,oi),Ft=!1},d(oi){oi&&(Ln(t),Ln(i),Ln(r)),On(c),On(V),On(je),On(Kt),ji=!1,Ip(Gr)}}}function Mme(e,t,i){let r,s;Wa(e,Yu,Q=>i(2,r=Q)),Wa(e,cd,Q=>i(3,s=Q));let n="",c="";async function o(){if(n)try{const Q=await Sme(n);Yu.set(JSON.stringify(Q,null,2)),m7.set(n)}catch(Q){console.error("Failed to convert style:",Q)}}async function f(){if(c)try{const Q=await fetch(c);if(!Q.ok)throw new Error(`HTTP error! status: ${Q.status}`);const ve=await Q.json();cd.set(JSON.stringify(ve,null,2)),y7.set(c)}catch(Q){console.error("Failed to convert style:",Q)}}function g(Q){Yu.set(Q.detail)}function S(Q){cd.set(Q.detail)}async function I(){const Q=await Tme(n,JSON.parse(jb(Yu)));cd.set(JSON.stringify(Q,null,2))}function A(){Yu.set(jb(cd))}rx(()=>{I()});function O(Q){r=Q,Yu.set(r)}function z(){n=this.value,i(0,n)}function V(Q){s=Q,cd.set(s)}function H(){c=this.value,i(1,c)}return I(),[n,c,r,s,o,f,g,S,I,A,O,z,V,H]}class Ime extends Ul{constructor(t){super(),Bl(this,t,Mme,Eme,Xa,{})}}Op.setRTLTextPlugin("https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js",!0);new Ime({target:document.getElementById("app")});export{Zpe as $,aL as A,nye as B,W0 as C,yD as D,Le as E,T6 as F,Js as G,dge as H,Ll as I,V0 as J,Fq as K,mD as L,Qi as M,Je as N,Q0e as O,_n as P,hre as Q,r_e as R,s_e as S,K0e as T,bD as U,Bt as V,K0 as W,o3 as X,gn as Y,nA as Z,ht as _,Fl as a,Cx as a$,Ja as a0,i_e as a1,ZT as a2,N0e as a3,BQ as a4,b_ as a5,To as a6,Nt as a7,GB as a8,zt as a9,ri as aA,yh as aB,Ua as aC,Px as aD,Ui as aE,O5 as aF,ax as aG,s0e as aH,a3 as aI,e_e as aJ,t_e as aK,Xge as aL,Qge as aM,i0e as aN,t0e as aO,e0e as aP,Pc as aQ,ui as aR,yi as aS,Fn as aT,At as aU,He as aV,aoe as aW,CR as aX,ks as aY,mi as aZ,Rse as a_,M6 as aa,GA as ab,I6 as ac,E6 as ad,SR as ae,k_e as af,iK as ag,F5 as ah,eo as ai,ro as aj,gp as ak,Sv as al,Dge as am,hB as an,WJ as ao,rp as ap,Pp as aq,xle as ar,SA as as,mr as at,jc as au,Kx as av,_0 as aw,Za as ax,Na as ay,bi as az,Ys as b,Cye as b$,km as b0,Ap as b1,E_ as b2,F0e as b3,jl as b4,Cse as b5,v3 as b6,g1e as b7,qF as b8,Z0e as b9,rE as bA,pw as bB,Xz as bC,Pl as bD,Ci as bE,E3 as bF,TR as bG,zge as bH,T_e as bI,R_e as bJ,nbe as bK,F0 as bL,CT as bM,Sle as bN,_5 as bO,Mhe as bP,Uhe as bQ,Rhe as bR,mR as bS,P6 as bT,tne as bU,Aye as bV,Rr as bW,lge as bX,ede as bY,GU as bZ,fp as b_,c_e as ba,Sre as bb,Dw as bc,Lw as bd,j0e as be,Y0e as bf,mh as bg,bge as bh,Cde as bi,lP as bj,C$ as bk,Cee as bl,_ge as bm,jU as bn,$p as bo,Zye as bp,PS as bq,W0e as br,fi as bs,Ah as bt,bh as bu,Ph as bv,Nl as bw,tE as bx,fr as by,eE as bz,$0 as c,Im as c$,iU as c0,xve as c1,Sve as c2,Eve as c3,Tce as c4,gce as c5,tW as c6,dR as c7,LF as c8,Gt as c9,Mx as cA,fw as cB,$se as cC,X0e as cD,_x as cE,qA as cF,G0 as cG,pre as cH,a_e as cI,dre as cJ,o_e as cK,Ba as cL,mge as cM,zN as cN,Or as cO,Xo as cP,wx as cQ,Aw as cR,CZ as cS,VZ as cT,PN as cU,LN as cV,kN as cW,GZ as cX,Yb as cY,Hme as cZ,sH as c_,Sh as ca,$_e as cb,Oge as cc,wo as cd,Ume as ce,hge as cf,A7 as cg,$7 as ch,Em as ci,aa as cj,mde as ck,gde as cl,_de as cm,Tde as cn,Pde as co,r9 as cp,s9 as cq,Ade as cr,Lde as cs,Dde as ct,DN as cu,tY as cv,xY as cw,gE as cx,Eh as cy,v_ as cz,v as d,ehe as d$,_A as d0,F7 as d1,d3 as d2,fK as d3,m1e as d4,__ as d5,cH as d6,j_e as d7,C0 as d8,NM as d9,f4 as dA,lx as dB,RA as dC,Sx as dD,H0 as dE,nh as dF,zn as dG,QW as dH,yx as dI,eZ as dJ,Eye as dK,oge as dL,the as dM,que as dN,Ihe as dO,rN as dP,K4 as dQ,Kge as dR,$r as dS,Zx as dT,Cge as dU,Nee as dV,Lge as dW,Age as dX,K$ as dY,Ep as dZ,kc as d_,K3 as da,sye as db,rA as dc,V4 as dd,sx as de,sa as df,yZ as dg,fZ as dh,_ve as di,_oe as dj,n_e as dk,MA as dl,y_ as dm,HA as dn,Lhe as dp,Bhe as dq,zU as dr,abe as ds,tbe as dt,ebe as du,Mo as dv,Ym as dw,L3 as dx,z3 as dy,A8 as dz,er as e,dZ as e$,pp as e0,Rs as e1,oY as e2,T_ as e3,sW as e4,YZ as e5,JZ as e6,gY as e7,ibe as e8,m_ as e9,dO as eA,MD as eB,z0 as eC,yH as eD,pA as eE,h_ as eF,iA as eG,CB as eH,vI as eI,Nm as eJ,$B as eK,hae as eL,Y3 as eM,l$ as eN,Ab as eO,L0e as eP,Qde as eQ,ta as eR,Lc as eS,vve as eT,DG as eU,Ka as eV,c$ as eW,aA as eX,q_e as eY,Cie as eZ,Uye as e_,Mve as ea,wve as eb,l0e as ec,Cme as ed,Kue as ee,I_e as ef,O_e as eg,YC as eh,dbe as ei,zhe as ej,hbe as ek,Fhe as el,uge as em,Nhe as en,_be as eo,T1e as ep,loe as eq,px as er,cve as es,Th as et,xh as eu,im as ev,Nc as ew,Sye as ex,Rye as ey,Tp as ez,fe as f,koe as f$,xr as f0,H_e as f1,Z_e as f2,cge as f3,bhe as f4,whe as f5,Yx as f6,D3 as f7,R3 as f8,O3 as f9,z0e as fA,Qve as fB,OI as fC,Xve as fD,Kve as fE,bK as fF,vK as fG,zJ as fH,j$ as fI,Fa as fJ,$x as fK,jme as fL,Bge as fM,fm as fN,uH as fO,na as fP,cbe as fQ,lbe as fR,y1e as fS,sbe as fT,Vr as fU,Wme as fV,f_ as fW,xD as fX,Dn as fY,E1e as fZ,uae as f_,N3 as fa,k3 as fb,G_e as fc,A_ as fd,_ye as fe,Ige as ff,AN as fg,aY as fh,oae as fi,Cs as fj,lae as fk,PB as fl,Hs as fm,tm as fn,zE as fo,I7 as fp,lY as fq,hoe as fr,nF as fs,rb as ft,Yye as fu,$ye as fv,dh as fw,t4 as fx,yG as fy,xp as fz,ti as g,q8 as g$,fN as g0,NW as g1,oD as g2,aD as g3,lD as g4,pi as g5,FD as g6,lwe as g7,cwe as g8,fwe as g9,p0 as gA,RZ as gB,WZ as gC,wY as gD,SY as gE,yae as gF,kde as gG,eW as gH,qz as gI,aW as gJ,Bw as gK,BA as gL,XZ as gM,ZZ as gN,CN as gO,NZ as gP,fY as gQ,fge as gR,ey as gS,RN as gT,YY as gU,xw as gV,yge as gW,ON as gX,iY as gY,Ri as gZ,g3 as g_,uwe as ga,hwe as gb,dwe as gc,pwe as gd,C7 as ge,ED as gf,U_e as gg,Bye as gh,OZ as gi,ia as gj,Bn as gk,C0e as gl,rW as gm,AA as gn,PA as go,vx as gp,bx as gq,Ih as gr,DE as gs,Pee as gt,c0e as gu,be as gv,WY as gw,Gz as gx,Ax as gy,NN as gz,Yoe as h,bve as h$,_1e as h0,v1e as h1,qee as h2,ube as h3,oA as h4,Gf as h5,Hb as h6,OO as h7,b1e as h8,Oq as h9,VN as hA,_J as hB,sae as hC,ege as hD,Hye as hE,sN as hF,nN as hG,Iae as hH,jY as hI,Uo as hJ,vJ as hK,GN as hL,KI as hM,XI as hN,ME as hO,wK as hP,za as hQ,Kz as hR,B7 as hS,M3 as hT,E_e as hU,S_e as hV,B0e as hW,bw as hX,q as hY,Wye as hZ,Hue as h_,kge as ha,rK as hb,hD as hc,dD as hd,cD as he,pD as hf,Wpe as hg,LI as hh,DI as hi,Jt as hj,bA as hk,W4 as hl,F3 as hm,Ohe as hn,UN as ho,S7 as hp,Zme as hq,oye as hr,aye as hs,_ae as ht,gge as hu,rJ as hv,LZ as hw,DZ as hx,$Z as hy,sJ as hz,Dre as i,PI as i$,cp as i0,Jye as i1,Kye as i2,yS as i3,s2 as i4,r2 as i5,iP as i6,to as i7,rce as i8,I5 as i9,M5 as iA,Ome as iB,Lbe as iC,TD as iD,SD as iE,m0 as iF,Hv as iG,Fge as iH,uN as iI,OW as iJ,UW as iK,xx as iL,tge as iM,Are as iN,BU as iO,kJ as iP,RJ as iQ,ywe as iR,fD as iS,ewe as iT,L5 as iU,RB as iV,Jve as iW,s4 as iX,dye as iY,hye as iZ,$G as i_,io as ia,ra as ib,Tye as ic,zq as id,mx as ie,kye as ig,Tve as ih,t_ as ii,Kbe as ij,YJ as ik,ZJ as il,Sge as im,Rge as io,Gw as ip,Hpe as iq,AD as ir,wD as is,gD as it,V_e as iu,Zs as iv,Lme as iw,yY as ix,uD as iy,E5 as iz,YM as j,Sbe as j$,CG as j0,Nme as j1,M7 as j2,$ge as j3,_h as j4,aae as j5,jne as j6,Nne as j7,C_ as j8,pge as j9,Hx as jA,wh as jB,JG as jC,qme as jD,Vx as jE,Ol as jF,Ibe as jG,oP as jH,Kw as jI,Ebe as jJ,Abe as jK,ZU as jL,Mbe as jM,pde as jN,sD as jO,kn as jP,FI as jQ,NI as jR,Fwe as jS,Bwe as jT,BI as jU,zI as jV,Jo as jW,Cbe as jX,Cn as jY,$be as jZ,wbe as j_,FA as ja,WA as jb,Cp as jc,Mye as jd,e4 as je,O0e as jf,x6 as jg,Tge as jh,PF as ji,jr as jj,X5 as jk,Sr as jl,eA as jm,u$ as jn,Zue as jo,qve as jp,ux as jq,ese as jr,Iye as js,zse as jt,dae as ju,ID as jv,Obe as jw,RD as jx,kD as jy,D0e as jz,vG as k,Uc as k$,Br as k0,nD as k1,cm as k2,rbe as k3,WH as k4,QF as k5,obe as k6,Fme as k7,Bme as k8,zme as k9,kbe as kA,P7 as kB,Cae as kC,qd as kD,Gd as kE,Dwe as kF,Q0 as kG,o6 as kH,tse as kI,M_e as kJ,yA as kK,nJ as kL,iJ as kM,eY as kN,tJ as kO,z5 as kP,gx as kQ,Va as kR,UZ as kS,TY as kT,$N as kU,DD as kV,Nbe as kW,ND as kX,l_ as kY,Pse as kZ,XF as k_,tH as ka,JY as kb,UY as kc,VY as kd,gG as ke,T5 as kf,Koe as kg,ine as kh,GW as ki,qye as kj,Zo as kk,swe as kl,vwe as km,uh as kn,kl as ko,e2 as kp,wge as kq,_B as kr,eB as ks,vB as kt,Soe as ku,M1e as kv,Ooe as kw,s_ as kx,I1e as ky,o_ as kz,vD as l,r0e as l$,W_e as l0,L7 as l1,Y_e as l2,Nie as l3,Dl as l4,Lwe as l5,Sb as l6,twe as l7,QO as l8,tL as l9,Iwe as lA,fne as lB,j3 as lC,Xx as lD,r_ as lE,zc as lF,Vc as lG,Twe as lH,nwe as lI,owe as lJ,Ewe as lK,Pwe as lL,Awe as lM,mwe as lN,bwe as lO,YB as lP,Mm as lQ,Cwe as lR,dve as lS,Pye as lT,Xye as lU,Nse as lV,nq as lW,LK as lX,aO as lY,H$ as lZ,aE as l_,TI as la,J0e as lb,V0e as lc,q0e as ld,G0e as le,H0e as lf,l_e as lg,U0e as lh,awe as li,mne as lj,IB as lk,J8 as ll,$we as lm,kwe as ln,Rwe as lo,Owe as lp,wwe as lq,Swe as lr,xwe as ls,Pme as lt,gwe as lu,_we as lv,Mwe as lw,Jbe as lx,cE as ly,D4 as lz,F1e as m,Lae as m$,Rl as m0,y0e as m1,m0e as m2,Hte as m3,R_ as m4,qte as m5,kme as m6,Tre as m7,ice as m8,xre as m9,GL as mA,Mge as mB,L_e as mC,K8 as mD,rae as mE,La as mF,rwe as mG,iwe as mH,kL as mI,DL as mJ,QL as mK,dL as mL,rL as mM,sL as mN,nL as mO,EL as mP,XL as mQ,tD as mR,pL as mS,Wx as mT,Pge as mU,Pbe as mV,Qbe as mW,Xbe as mX,$me as mY,yye as mZ,bY as m_,Nw as ma,Fw as mb,Vme as mc,Pve as md,g_ as me,Rt as mf,aR as mg,x3 as mh,$re as mi,kre as mj,$ue as mk,xge as ml,wL as mm,yL as mn,UJ as mo,gL as mp,RL as mq,_L as mr,Nge as ms,TL as mt,UL as mu,jL as mv,VL as mw,nK as mx,Ege as my,GJ as mz,R0e as n,Dae as n0,_H as n1,A_e as n2,P_e as n3,Rme as n4,wJ as n5,bJ as n6,soe as n7,T7 as n8,C_e as n9,u0e as na,d0e as nb,Uwe as nc,PD as o,gh as p,N0 as q,U1e as r,_t as s,roe as t,lr as u,_D as v,mp as w,Y4 as x,M as y,Sp as z}; + `},e5=nme(cme)(Q9),ume={config:ame},hme=function(){for(var t=arguments.length,i=new Array(t),r=0;r{t5.config({paths:{vs:"https://unpkg.com/monaco-editor/min/vs"}}),c=await t5.init(),i(3,n=c.editor.create(o,{value:r,language:s||"json",theme:"vs-light"}))}),jm(()=>{var S;(S=n.getModel())==null||S.dispose(),n.dispose()});function g(S){Tm[S?"unshift":"push"](()=>{o=S,i(0,o)})}return e.$$set=S=>{"content"in S&&i(1,r=S.content),"language"in S&&i(2,s=S.language)},e.$$.update=()=>{e.$$.dirty&10&&n&&n.setValue(r),e.$$.dirty&8&&n&&n.onDidChangeModelContent(()=>{const S=n.getValue();f("change",S)})},[o,r,s,n,g]}class i5 extends Ul{constructor(t){super(),Bl(this,t,xme,wme,Xa,{content:1,language:2})}}async function rj(e){const t=`${e}/resources/styles/root.json`,i=await fetch(t);if(!i.ok)throw new Error(`Failed to fetch Esri style JSON: ${i.statusText}`);return i.json()}async function Sme(e,t){const i=e.endsWith("/")?e.slice(0,-1):e;t||(t=await rj(i));const r=JSON.parse(JSON.stringify(t));if(r.sprite&&(r.sprite=`${i}/resources/${r.sprite.replace("../","")}`),r.glyphs&&(r.glyphs=`${i}/resources/${r.glyphs.replace("../","")}`),r.sources)for(const s in r.sources){const n=r.sources[s];n.type==="vector"&&n.url&&(n.url=`${i}/${n.url.replace("../../","")}`)}return r}async function Tme(e,t){const i=e.endsWith("/")?e.slice(0,-1):e;if(t||(t=await rj(i)),t.sources)for(const r in t.sources){const s=t.sources[r];if(s.type==="vector"&&s.url){const n={...s};n.tiles=[`${s.url}tile/{z}/{y}/{x}.pbf`],delete n.url,t.sources[r]=n}}return t}function Eme(e){let t,i,r,s,n,c,o,f,g,S,I,A,O,z,V,H,Q,ve,me,ge,Ie,Ce,ze,je,tt,ut,ot,et,Et,dt,vi,$i,Kt,Ft,ji,Gr;function yr(oi){e[10](oi)}let sr={language:"json"};e[2]!==void 0&&(sr.content=e[2]),c=new i5({props:sr}),Tm.push(()=>PT(c,"content",yr)),c.$on("change",e[6]),V=new Kpe({});function fs(oi){e[12](oi)}let qr={language:"json"};return e[3]!==void 0&&(qr.content=e[3]),je=new i5({props:qr}),Tm.push(()=>PT(je,"content",fs)),je.$on("change",e[7]),Kt=new Ofe({}),{c(){t=ds("div"),t.innerHTML=' ',i=Ps(),r=ds("div"),s=ds("div"),n=ds("div"),Xn(c.$$.fragment),f=Ps(),g=ds("div"),S=ds("input"),I=Ps(),A=ds("button"),A.textContent="Fetch",O=Ps(),z=ds("div"),Xn(V.$$.fragment),H=Ps(),Q=ds("div"),ve=ds("button"),ve.textContent="⇨",me=Ps(),ge=ds("button"),ge.textContent="⇦",Ie=Ps(),Ce=ds("div"),ze=ds("div"),Xn(je.$$.fragment),ut=Ps(),ot=ds("div"),et=ds("input"),Et=Ps(),dt=ds("button"),dt.textContent="Fetch",vi=Ps(),$i=ds("div"),Xn(Kt.$$.fragment),rr(t,"class","navbar bg-gray-500 shadow-lg"),rr(n,"class","flex-1 p-4 overflow-auto bg-gray-50"),rr(S,"type","text"),rr(S,"placeholder","Enter URL"),rr(S,"class","input input-bordered w-full mr-2"),rr(A,"class","btn btn-outline"),rr(g,"class","flex items-center p-4 bg-gray-200"),rr(z,"class","flex-1"),rr(s,"class","flex-1 flex flex-col sm:h-full"),rr(ve,"class","btn btn-outline-white btn-md mx-2 md:my-2"),rr(ge,"class","btn btn-outline-white btn-md mx-2 md:my-2"),rr(Q,"class","flex justify-center items-center p-2 bg-gray-500 shadow z-10 w-full md:w-16 md:flex-col sm:flex-row"),rr(ze,"class","flex-1 p-4 overflow-auto bg-gray-50"),rr(et,"type","text"),rr(et,"placeholder","Enter URL"),rr(et,"class","input input-bordered w-full mr-2"),rr(dt,"class","btn btn-outline"),rr(ot,"class","flex items-center p-4 bg-gray-200"),rr($i,"class","flex-1"),rr(Ce,"class","flex-1 flex flex-col sm:h-full"),rr(r,"class","flex flex-col md:flex-row h-screen")},m(oi,gr){Qn(oi,t,gr),Qn(oi,i,gr),Qn(oi,r,gr),wr(r,s),wr(s,n),Rn(c,n,null),wr(s,f),wr(s,g),wr(g,S),q1(S,e[0]),wr(g,I),wr(g,A),wr(s,O),wr(s,z),Rn(V,z,null),wr(r,H),wr(r,Q),wr(Q,ve),wr(Q,me),wr(Q,ge),wr(r,Ie),wr(r,Ce),wr(Ce,ze),Rn(je,ze,null),wr(Ce,ut),wr(Ce,ot),wr(ot,et),q1(et,e[1]),wr(ot,Et),wr(ot,dt),wr(Ce,vi),wr(Ce,$i),Rn(Kt,$i,null),Ft=!0,ji||(Gr=[ld(S,"input",e[11]),ld(A,"click",e[4]),ld(ve,"click",e[8]),ld(ge,"click",e[9]),ld(et,"input",e[13]),ld(dt,"click",e[5])],ji=!0)},p(oi,[gr]){const Tr={};!o&&gr&4&&(o=!0,Tr.content=oi[2],AT(()=>o=!1)),c.$set(Tr),gr&1&&S.value!==oi[0]&&q1(S,oi[0]);const Hr={};!tt&&gr&8&&(tt=!0,Hr.content=oi[3],AT(()=>tt=!1)),je.$set(Hr),gr&2&&et.value!==oi[1]&&q1(et,oi[1])},i(oi){Ft||(Ur(c.$$.fragment,oi),Ur(V.$$.fragment,oi),Ur(je.$$.fragment,oi),Ur(Kt.$$.fragment,oi),Ft=!0)},o(oi){vs(c.$$.fragment,oi),vs(V.$$.fragment,oi),vs(je.$$.fragment,oi),vs(Kt.$$.fragment,oi),Ft=!1},d(oi){oi&&(Ln(t),Ln(i),Ln(r)),On(c),On(V),On(je),On(Kt),ji=!1,Ip(Gr)}}}function Mme(e,t,i){let r,s;Wa(e,Yu,Q=>i(2,r=Q)),Wa(e,cd,Q=>i(3,s=Q));let n="",c="";async function o(){if(n)try{const Q=await Sme(n);Yu.set(JSON.stringify(Q,null,2)),m7.set(n)}catch(Q){console.error("Failed to convert style:",Q)}}async function f(){if(c)try{const Q=await fetch(c);if(!Q.ok)throw new Error(`HTTP error! status: ${Q.status}`);const ve=await Q.json();cd.set(JSON.stringify(ve,null,2)),y7.set(c)}catch(Q){console.error("Failed to convert style:",Q)}}function g(Q){Yu.set(Q.detail)}function S(Q){cd.set(Q.detail)}async function I(){const Q=await Tme(n,JSON.parse(jb(Yu)));cd.set(JSON.stringify(Q,null,2))}function A(){Yu.set(jb(cd))}rx(()=>{I()});function O(Q){r=Q,Yu.set(r)}function z(){n=this.value,i(0,n)}function V(Q){s=Q,cd.set(s)}function H(){c=this.value,i(1,c)}return I(),[n,c,r,s,o,f,g,S,I,A,O,z,V,H]}class Ime extends Ul{constructor(t){super(),Bl(this,t,Mme,Eme,Xa,{})}}Op.setRTLTextPlugin("https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js",!0);new Ime({target:document.getElementById("app")});export{Zpe as $,aL as A,nye as B,W0 as C,yD as D,Le as E,T6 as F,Js as G,dge as H,Ll as I,V0 as J,Fq as K,mD as L,Qi as M,Je as N,Q0e as O,_n as P,hre as Q,r_e as R,s_e as S,K0e as T,bD as U,Bt as V,K0 as W,o3 as X,gn as Y,nA as Z,ht as _,Fl as a,Cx as a$,Ja as a0,i_e as a1,ZT as a2,N0e as a3,BQ as a4,b_ as a5,To as a6,Nt as a7,GB as a8,zt as a9,ri as aA,yh as aB,Ua as aC,Px as aD,Ui as aE,O5 as aF,ax as aG,s0e as aH,a3 as aI,e_e as aJ,t_e as aK,Xge as aL,Qge as aM,i0e as aN,t0e as aO,e0e as aP,Pc as aQ,ui as aR,yi as aS,Fn as aT,At as aU,He as aV,aoe as aW,CR as aX,ks as aY,mi as aZ,Rse as a_,M6 as aa,GA as ab,I6 as ac,E6 as ad,SR as ae,k_e as af,iK as ag,F5 as ah,eo as ai,ro as aj,gp as ak,Sv as al,Dge as am,hB as an,WJ as ao,rp as ap,Pp as aq,xle as ar,SA as as,mr as at,jc as au,Kx as av,_0 as aw,Za as ax,Na as ay,bi as az,Ys as b,Cye as b$,km as b0,Ap as b1,E_ as b2,F0e as b3,jl as b4,Cse as b5,v3 as b6,g1e as b7,qF as b8,Z0e as b9,rE as bA,pw as bB,Xz as bC,Pl as bD,Ci as bE,E3 as bF,TR as bG,zge as bH,T_e as bI,R_e as bJ,nbe as bK,F0 as bL,CT as bM,Sle as bN,_5 as bO,Mhe as bP,Uhe as bQ,Rhe as bR,mR as bS,P6 as bT,tne as bU,Aye as bV,Rr as bW,lge as bX,ede as bY,GU as bZ,fp as b_,c_e as ba,Sre as bb,Dw as bc,Lw as bd,j0e as be,Y0e as bf,mh as bg,bge as bh,Cde as bi,lP as bj,C$ as bk,Cee as bl,_ge as bm,jU as bn,$p as bo,Zye as bp,PS as bq,W0e as br,fi as bs,Ah as bt,bh as bu,Ph as bv,Nl as bw,tE as bx,fr as by,eE as bz,$0 as c,Im as c$,iU as c0,xve as c1,Sve as c2,Eve as c3,Tce as c4,gce as c5,tW as c6,dR as c7,LF as c8,Gt as c9,Mx as cA,fw as cB,$se as cC,X0e as cD,_x as cE,qA as cF,G0 as cG,pre as cH,a_e as cI,dre as cJ,o_e as cK,Ba as cL,mge as cM,zN as cN,Or as cO,Xo as cP,wx as cQ,Aw as cR,CZ as cS,VZ as cT,PN as cU,LN as cV,kN as cW,GZ as cX,Yb as cY,Hme as cZ,sH as c_,Sh as ca,$_e as cb,Oge as cc,wo as cd,Ume as ce,hge as cf,A7 as cg,$7 as ch,Em as ci,aa as cj,mde as ck,gde as cl,_de as cm,Tde as cn,Pde as co,r9 as cp,s9 as cq,Ade as cr,Lde as cs,Dde as ct,DN as cu,tY as cv,xY as cw,gE as cx,Eh as cy,v_ as cz,v as d,ehe as d$,_A as d0,F7 as d1,d3 as d2,fK as d3,m1e as d4,__ as d5,cH as d6,j_e as d7,C0 as d8,NM as d9,f4 as dA,lx as dB,RA as dC,Sx as dD,H0 as dE,nh as dF,zn as dG,QW as dH,yx as dI,eZ as dJ,Eye as dK,oge as dL,the as dM,que as dN,Ihe as dO,rN as dP,K4 as dQ,Kge as dR,$r as dS,Zx as dT,Cge as dU,Nee as dV,Lge as dW,Age as dX,K$ as dY,Ep as dZ,kc as d_,K3 as da,sye as db,rA as dc,V4 as dd,sx as de,sa as df,yZ as dg,fZ as dh,_ve as di,_oe as dj,n_e as dk,MA as dl,y_ as dm,HA as dn,Lhe as dp,Bhe as dq,zU as dr,abe as ds,tbe as dt,ebe as du,Mo as dv,Ym as dw,L3 as dx,z3 as dy,A8 as dz,er as e,dZ as e$,pp as e0,Rs as e1,oY as e2,T_ as e3,sW as e4,YZ as e5,JZ as e6,gY as e7,ibe as e8,m_ as e9,dO as eA,MD as eB,z0 as eC,yH as eD,pA as eE,h_ as eF,iA as eG,CB as eH,vI as eI,Nm as eJ,$B as eK,hae as eL,Y3 as eM,l$ as eN,Ab as eO,L0e as eP,Qde as eQ,ta as eR,Lc as eS,vve as eT,DG as eU,Ka as eV,c$ as eW,aA as eX,q_e as eY,Cie as eZ,Uye as e_,Mve as ea,wve as eb,l0e as ec,Cme as ed,Kue as ee,I_e as ef,O_e as eg,YC as eh,dbe as ei,zhe as ej,hbe as ek,Fhe as el,uge as em,Nhe as en,_be as eo,T1e as ep,loe as eq,px as er,cve as es,Th as et,xh as eu,im as ev,Nc as ew,Sye as ex,Rye as ey,Tp as ez,fe as f,koe as f$,xr as f0,H_e as f1,Z_e as f2,cge as f3,bhe as f4,whe as f5,Yx as f6,D3 as f7,R3 as f8,O3 as f9,z0e as fA,Qve as fB,OI as fC,Xve as fD,Kve as fE,bK as fF,vK as fG,zJ as fH,j$ as fI,Fa as fJ,$x as fK,jme as fL,Bge as fM,fm as fN,uH as fO,na as fP,cbe as fQ,lbe as fR,y1e as fS,sbe as fT,Vr as fU,Wme as fV,f_ as fW,xD as fX,Dn as fY,E1e as fZ,uae as f_,N3 as fa,k3 as fb,G_e as fc,A_ as fd,_ye as fe,Ige as ff,AN as fg,aY as fh,oae as fi,Cs as fj,lae as fk,PB as fl,Hs as fm,tm as fn,zE as fo,I7 as fp,lY as fq,hoe as fr,nF as fs,rb as ft,Yye as fu,$ye as fv,dh as fw,t4 as fx,yG as fy,xp as fz,ti as g,q8 as g$,fN as g0,NW as g1,oD as g2,aD as g3,lD as g4,pi as g5,FD as g6,lwe as g7,cwe as g8,fwe as g9,p0 as gA,RZ as gB,WZ as gC,wY as gD,SY as gE,yae as gF,kde as gG,eW as gH,qz as gI,aW as gJ,Bw as gK,BA as gL,XZ as gM,ZZ as gN,CN as gO,NZ as gP,fY as gQ,fge as gR,ey as gS,RN as gT,YY as gU,xw as gV,yge as gW,ON as gX,iY as gY,Ri as gZ,g3 as g_,uwe as ga,hwe as gb,dwe as gc,pwe as gd,C7 as ge,ED as gf,U_e as gg,Bye as gh,OZ as gi,ia as gj,Bn as gk,C0e as gl,rW as gm,AA as gn,PA as go,vx as gp,bx as gq,Ih as gr,DE as gs,Pee as gt,c0e as gu,be as gv,WY as gw,Gz as gx,Ax as gy,NN as gz,Yoe as h,bve as h$,_1e as h0,v1e as h1,qee as h2,ube as h3,oA as h4,Gf as h5,Hb as h6,OO as h7,b1e as h8,Oq as h9,VN as hA,_J as hB,sae as hC,ege as hD,Hye as hE,sN as hF,nN as hG,Iae as hH,jY as hI,Uo as hJ,vJ as hK,GN as hL,KI as hM,XI as hN,ME as hO,wK as hP,za as hQ,Kz as hR,B7 as hS,M3 as hT,E_e as hU,S_e as hV,B0e as hW,bw as hX,q as hY,Wye as hZ,Hue as h_,kge as ha,rK as hb,hD as hc,dD as hd,cD as he,pD as hf,Wpe as hg,LI as hh,DI as hi,Jt as hj,bA as hk,W4 as hl,F3 as hm,Ohe as hn,UN as ho,S7 as hp,Zme as hq,oye as hr,aye as hs,_ae as ht,gge as hu,rJ as hv,LZ as hw,DZ as hx,$Z as hy,sJ as hz,Dre as i,PI as i$,cp as i0,Jye as i1,Kye as i2,yS as i3,s2 as i4,r2 as i5,iP as i6,to as i7,rce as i8,I5 as i9,M5 as iA,Ome as iB,Lbe as iC,TD as iD,SD as iE,m0 as iF,Hv as iG,Fge as iH,uN as iI,OW as iJ,UW as iK,xx as iL,tge as iM,Are as iN,BU as iO,kJ as iP,RJ as iQ,ywe as iR,fD as iS,ewe as iT,L5 as iU,RB as iV,Jve as iW,s4 as iX,dye as iY,hye as iZ,$G as i_,io as ia,ra as ib,Tye as ic,zq as id,mx as ie,kye as ig,Tve as ih,t_ as ii,Kbe as ij,YJ as ik,ZJ as il,Sge as im,Rge as io,Gw as ip,Hpe as iq,AD as ir,wD as is,gD as it,V_e as iu,Zs as iv,Lme as iw,yY as ix,uD as iy,E5 as iz,YM as j,Sbe as j$,CG as j0,Nme as j1,M7 as j2,$ge as j3,_h as j4,aae as j5,jne as j6,Nne as j7,C_ as j8,pge as j9,Hx as jA,wh as jB,JG as jC,qme as jD,Vx as jE,Ol as jF,Ibe as jG,oP as jH,Kw as jI,Ebe as jJ,Abe as jK,ZU as jL,Mbe as jM,pde as jN,sD as jO,kn as jP,FI as jQ,NI as jR,Fwe as jS,Bwe as jT,BI as jU,zI as jV,Jo as jW,Cbe as jX,Cn as jY,$be as jZ,wbe as j_,FA as ja,WA as jb,Cp as jc,Mye as jd,e4 as je,O0e as jf,x6 as jg,Tge as jh,PF as ji,jr as jj,X5 as jk,Sr as jl,eA as jm,u$ as jn,Zue as jo,qve as jp,ux as jq,ese as jr,Iye as js,zse as jt,dae as ju,ID as jv,Obe as jw,RD as jx,kD as jy,D0e as jz,vG as k,Uc as k$,Br as k0,nD as k1,cm as k2,rbe as k3,WH as k4,QF as k5,obe as k6,Fme as k7,Bme as k8,zme as k9,kbe as kA,P7 as kB,Cae as kC,qd as kD,Gd as kE,Dwe as kF,Q0 as kG,o6 as kH,tse as kI,M_e as kJ,yA as kK,nJ as kL,iJ as kM,eY as kN,tJ as kO,z5 as kP,gx as kQ,Va as kR,UZ as kS,TY as kT,$N as kU,DD as kV,Nbe as kW,ND as kX,l_ as kY,Pse as kZ,XF as k_,tH as ka,JY as kb,UY as kc,VY as kd,gG as ke,T5 as kf,Koe as kg,ine as kh,GW as ki,qye as kj,Zo as kk,swe as kl,vwe as km,uh as kn,kl as ko,e2 as kp,wge as kq,_B as kr,eB as ks,vB as kt,Soe as ku,M1e as kv,Ooe as kw,s_ as kx,I1e as ky,o_ as kz,vD as l,r0e as l$,W_e as l0,L7 as l1,Y_e as l2,Nie as l3,Dl as l4,Lwe as l5,Sb as l6,twe as l7,QO as l8,tL as l9,Iwe as lA,fne as lB,j3 as lC,Xx as lD,r_ as lE,zc as lF,Vc as lG,Twe as lH,nwe as lI,owe as lJ,Ewe as lK,Pwe as lL,Awe as lM,mwe as lN,bwe as lO,YB as lP,Mm as lQ,Cwe as lR,dve as lS,Pye as lT,Xye as lU,Nse as lV,nq as lW,LK as lX,aO as lY,H$ as lZ,aE as l_,TI as la,J0e as lb,V0e as lc,q0e as ld,G0e as le,H0e as lf,l_e as lg,U0e as lh,awe as li,mne as lj,IB as lk,J8 as ll,$we as lm,kwe as ln,Rwe as lo,Owe as lp,wwe as lq,Swe as lr,xwe as ls,Pme as lt,gwe as lu,_we as lv,Mwe as lw,Jbe as lx,cE as ly,D4 as lz,F1e as m,Lae as m$,Rl as m0,y0e as m1,m0e as m2,Hte as m3,R_ as m4,qte as m5,kme as m6,Tre as m7,ice as m8,xre as m9,GL as mA,Mge as mB,L_e as mC,K8 as mD,rae as mE,La as mF,rwe as mG,iwe as mH,kL as mI,DL as mJ,QL as mK,dL as mL,rL as mM,sL as mN,nL as mO,EL as mP,XL as mQ,tD as mR,pL as mS,Wx as mT,Pge as mU,Pbe as mV,Qbe as mW,Xbe as mX,$me as mY,yye as mZ,bY as m_,Nw as ma,Fw as mb,Vme as mc,Pve as md,g_ as me,Rt as mf,aR as mg,x3 as mh,$re as mi,kre as mj,$ue as mk,xge as ml,wL as mm,yL as mn,UJ as mo,gL as mp,RL as mq,_L as mr,Nge as ms,TL as mt,UL as mu,jL as mv,VL as mw,nK as mx,Ege as my,GJ as mz,R0e as n,Dae as n0,_H as n1,A_e as n2,P_e as n3,Rme as n4,wJ as n5,bJ as n6,soe as n7,T7 as n8,C_e as n9,u0e as na,d0e as nb,Uwe as nc,PD as o,gh as p,N0 as q,U1e as r,_t as s,roe as t,lr as u,_D as v,mp as w,Y4 as x,M as y,Sp as z}; diff --git a/assets/input2-BT_6gQkP.js b/assets/input2-D8djCUJ5.js similarity index 98% rename from assets/input2-BT_6gQkP.js rename to assets/input2-D8djCUJ5.js index 803469e..81b2b5e 100644 --- a/assets/input2-BT_6gQkP.js +++ b/assets/input2-D8djCUJ5.js @@ -1,4 +1,4 @@ -import{c0 as n,c2 as w,c3 as z,c4 as H,h$ as S,eb as y}from"./index-CEWggaxV.js";import{r as x,g as D,l as I,v as B}from"./dom-DPsTWDAQ.js";import{s as N,c as M,i as E,d as F,H as P}from"./form-D5ySy5kP.js";import{c as A,d as K,u as U,I as j}from"./interactive-BR2V27xp.js";import{n as c,i as m,p as W,e as R,f as q,u as $,c as _,a as G,d as Y,b as Z,s as J,B as Q,g as X}from"./t9n-gKZJT8eY.js";import{c as ee,d as te,g as V}from"./label2-BT0TPJM3.js";import{s as ie,a as ne,c as se}from"./loadable-DylQ3Aza.js";import{c as ae}from"./observers-MZ9Ss0UR.js";import{g as v}from"./component-WqEOSVCt.js";import{d as L}from"./icon-BuW41TqN.js";/*! +import{c0 as n,c2 as w,c3 as z,c4 as H,h$ as S,eb as y}from"./index-BjUNJPVf.js";import{r as x,g as D,l as I,v as B}from"./dom-DPsTWDAQ.js";import{s as N,c as M,i as E,d as F,H as P}from"./form-BC9xTZIq.js";import{c as A,d as K,u as U,I as j}from"./interactive-5-lo-GR7.js";import{n as c,i as m,p as W,e as R,f as q,u as $,c as _,a as G,d as Y,b as Z,s as J,B as Q,g as X}from"./t9n-pVz2fW_o.js";import{c as ee,d as te,g as V}from"./label2-BT0TPJM3.js";import{s as ie,a as ne,c as se}from"./loadable-CreDQ1Dd.js";import{c as ae}from"./observers-B6R0JooC.js";import{g as v}from"./component-WqEOSVCt.js";import{d as L}from"./icon-BXpWZdRl.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.7.1 diff --git a/assets/interactive-BR2V27xp.js b/assets/interactive-5-lo-GR7.js similarity index 97% rename from assets/interactive-BR2V27xp.js rename to assets/interactive-5-lo-GR7.js index 175f698..4c78306 100644 --- a/assets/interactive-BR2V27xp.js +++ b/assets/interactive-5-lo-GR7.js @@ -1,4 +1,4 @@ -import{c0 as b}from"./index-CEWggaxV.js";/*! +import{c0 as b}from"./index-BjUNJPVf.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.7.1 diff --git a/assets/jsonUtils-BseLl1fZ.js b/assets/jsonUtils-Dw332y6z.js similarity index 98% rename from assets/jsonUtils-BseLl1fZ.js rename to assets/jsonUtils-Dw332y6z.js index f7c6150..a256044 100644 --- a/assets/jsonUtils-BseLl1fZ.js +++ b/assets/jsonUtils-Dw332y6z.js @@ -1 +1 @@ -import{d as i,y as r,a9 as w,dS as ue,f as x,aU as N,ee as pe,b as ye,s as D,M as X,c8 as de,N as ce,jz as he,aV as y,jA as me,jB as O,aR as K,e1 as ge,jC as be,dw as Z,dz as Y,c9 as A,b4 as F,f0 as ee,a6 as fe,e9 as we,jD as ve,dy as te,jE as Se,q as xe,eX as $e,au as je}from"./index-CEWggaxV.js";import{v as L,p as P,j as _e,n as Ie,A as ie,w as se}from"./UniqueValueRenderer-BlkUix3g.js";import{r as Ve}from"./Version-Bd0QsIQ5.js";import{Z as De}from"./FieldsIndex-CLgRNeJ_.js";import{f as Pe}from"./OverrideHelper-B4ryGWZb.js";import{v as Ee,q as Re}from"./utils-p-5Bbga5.js";import{a as Ne,e as Ce,c as qe}from"./heatmapUtils-Clt5rJzr.js";var H;let C=H=class extends N{constructor(e){super(e),this.color=null,this.ratio=null}clone(){return new H({color:this.color&&this.color.clone(),ratio:this.ratio})}};i([r({type:w,json:{type:[ue],default:null,write:!0}})],C.prototype,"color",void 0),i([r({type:Number,json:{write:!0}})],C.prototype,"ratio",void 0),C=H=i([x("esri.renderers.support.HeatmapColorStop")],C);const q=C,Q="esri.renderers.support.DictionaryLoader",Te={type:"CIMSimpleLineCallout",lineSymbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",width:.5,color:[0,0,0,255]}]}};class re{constructor(t,s,o){this.config=null,this.fieldMap=null,this.url=null,this._ongoingRequests=new Map,this._symbolCache=new pe(100),this._dictionaryVersion=null,this._fieldIndex=null,this._dictionaryPromise=null,this.url=t,this.config=s,this.fieldMap=o}getSymbolFields(){return this._symbolFields}async getSymbolAsync(t,s){let o;this._dictionaryPromise||(this._dictionaryPromise=this.fetchResources(s));try{o=await this._dictionaryPromise}catch(p){if(ye(p))return this._dictionaryPromise=null,null}const a=this._dictionaryVersion&&this._dictionaryVersion.since(4,0),u={};if(this.fieldMap)for(const p of this._symbolFields){const c=Ee(this.fieldMap[p],this._fieldIndex);if(c){const l=t.attributes[c];u[p]=a?l:l!=null?""+t.attributes[c]:""}else u[p]=""}let n=null;try{n=o==null?void 0:o(u,s)}catch{return null}if(!n||typeof n!="string"||n==="invalid")return null;const $=n.split(";"),_=[],m=[];for(const p of $)if(p)if(p.includes("po:")){const c=p.substr(3).split("|");if(c.length===3){const l=c[0],g=c[1];let b=c[2];if(g==="DashTemplate")b=b.split(" ").map(v=>Number(v));else if(g==="Color"){const v=new w(b).toRgba();b=[v[0],v[1],v[2],255*v[3]]}else b=Number(b);m.push({primitiveName:l,propertyName:g,value:b,defaultValue:null})}}else if(p.includes("|")){for(const c of p.split("|"))if(this._itemNames.has(c)){_.push(c);break}}else this._itemNames.has(p)&&_.push(p);const E=t.geometry==null||!t.geometry.hasZ&&t.geometry.type==="point";return this._cimPartsToCIMSymbol(t,_,m,E,s)}async fetchResources(t){if(this._dictionaryPromise)return this._dictionaryPromise;if(!this.url)return void D.getLogger(Q).error("no valid URL!");const s=X(this.url+"/resources/styles/dictionary-info.json",{responseType:"json",query:{f:"json"},signal:t!=null?t.signal:null}),[{data:o}]=await Promise.all([s,de()]);if(!o)throw this._dictionaryPromise=null,new ce("esri.renderers.DictionaryRenderer","Bad dictionary data!");const{authoringInfo:a,dictionary_version:u,expression:n,itemsNames:$}=o,_=n;let m=!1;u&&(this._dictionaryVersion=Ve.parse(u),m=this._dictionaryVersion.since(4,0)),this._refSymbolUrlTemplate=this.url+"/"+o.cimRefTemplateUrl,this._itemNames=new Set($),this._symbolFields=a.symbol;const E={};if(this.config){const l=this.config;for(const g in l)E[g]=l[g]}if(a.configuration)for(const l of a.configuration)E.hasOwnProperty(l.name)||(E[l.name]=l.value);const p=[];if(t!=null&&t.fields&&this.fieldMap)for(const l in this.fieldMap){const g=this.fieldMap[l],b=t.fields.filter(v=>v.name.toLowerCase()===(g==null?void 0:g.toLowerCase()));b.length>0&&p.push({...b[0],type:m?b[0].type:"esriFieldTypeString"})}p.length>0&&(this._fieldIndex=new De(p));const c=he(_,t!=null?t.spatialReference:null,p,E).then(l=>{const g={scale:0};return(b,v)=>{if(l==null)return null;const ae=l.repurposeFeature({geometry:null,attributes:b});return g.scale=v!=null?v.scale??void 0:void 0,l.evaluate({$feature:ae,$view:g},l.services)}}).catch(l=>(D.getLogger(Q).error("Creating dictinoary expression failed:",l),null));return this._dictionaryPromise=c,c}async _cimPartsToCIMSymbol(t,s,o,a,u){const n=new Array(s.length);for(let m=0;mn.data);const a=this._refSymbolUrlTemplate.replaceAll(/\{itemName\}/gi,t),u=X(a,{responseType:"json",query:{f:"json"},...s});this._ongoingRequests.set(t,u),u.finally(()=>this._ongoingRequests.delete(t));try{const n=await u;return this._symbolCache.put(t,n.data),n.data}catch(n){throw n}}_combineSymbolParts(t,s,o){if(!t||t.length===0)return null;const a={...t[0]};if(t.length>1){a.symbolLayers=[];for(const u of t){const n=u;a.symbolLayers.unshift(...n.symbolLayers)}}return o&&(a.callout=Te),{type:"CIMSymbolReference",symbol:a,primitiveOverrides:s}}}var k;let S=k=class extends L(P){constructor(e){super(e),this.config=null,this.fieldMap=null,this.scaleExpression=null,this.scaleExpressionTitle=null,this.url=null,this.type="dictionary"}get _loader(){return new re(this.url,this.config,this.fieldMap)}writeData(e,t){e&&(t.scalingExpressionInfo={expression:e,returnType:"number"})}writeVisualVariables(e,t,s,o){o!=null&&o.origin||super.writeVisualVariables(e,t,s,o)}clone(){return new k({config:y(this.config),scaleExpression:this.scaleExpression,scaleExpressionTitle:this.scaleExpressionTitle,fieldMap:y(this.fieldMap),url:y(this.url),visualVariables:y(this.visualVariables)})}async getSymbolAsync(e,t){return this._loader.getSymbolAsync(e,t)}async collectRequiredFields(e,t){await this.collectVVRequiredFields(e,t),this.scaleExpression&&await O(e,t,this.scaleExpression);for(const s in this.fieldMap){const o=this.fieldMap[s];t.has(o)&&e.add(o)}}get arcadeRequired(){return!0}getSymbol(){return null}getSymbols(){return[]}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((e,t)=>e+t.getAttributeHash(),"")}getMeshHash(){return`${this.url}-${JSON.stringify(this.fieldMap)}`}getSymbolFields(){return this._loader.getSymbolFields()}};i([r({type:re})],S.prototype,"_loader",null),i([r({type:Object,json:{read:{source:"configuration"},write:{target:"configuration"}}})],S.prototype,"config",void 0),i([r({type:Object,json:{write:!0}})],S.prototype,"fieldMap",void 0),i([r({type:String,json:{read:{source:"scalingExpressionInfo.expression"},write:!0}})],S.prototype,"scaleExpression",void 0),i([K("scaleExpression")],S.prototype,"writeData",null),i([r({type:String,json:{read:{source:"scalingExpressionInfo.title"},write:{target:"scalingExpressionInfo.title",overridePolicy(e){return{enabled:!!e&&!!this.scaleExpression}}}}})],S.prototype,"scaleExpressionTitle",void 0),i([r({type:String,json:{write:!0}})],S.prototype,"url",void 0),i([K("visualVariables")],S.prototype,"writeVisualVariables",null),S=k=i([x("esri.renderers.DictionaryRenderer")],S);const Me=S;var B;let j=B=class extends N{constructor(e){super(e),this.color=null,this.field=null,this.label=null,this.valueExpression=null,this.valueExpressionTitle=null}castField(e){return e==null?e:typeof e=="function"?(D.getLogger(this).error(".field: field must be a string value"),null):be(e)}getAttributeHash(){return`${this.field}-${this.valueExpression}`}clone(){var e;return new B({color:(e=this.color)==null?void 0:e.clone(),field:this.field,label:this.label,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};i([r({type:w,json:{type:[Number],write:!0}})],j.prototype,"color",void 0),i([r({type:String,json:{write:!0}})],j.prototype,"field",void 0),i([ge("field")],j.prototype,"castField",null),i([r({type:String,json:{write:!0}})],j.prototype,"label",void 0),i([r({type:String,json:{write:!0}})],j.prototype,"valueExpression",void 0),i([r({type:String,json:{write:!0}})],j.prototype,"valueExpressionTitle",void 0),j=B=i([x("esri.renderers.support.AttributeColorInfo")],j);const oe=j;var z;let T=z=class extends N{constructor(){super(...arguments),this.unit=null}clone(){return new z({unit:this.unit})}};i([r({type:String,json:{write:!0}})],T.prototype,"unit",void 0),T=z=i([x("esri.renderers.support.DotDensityLegendOptions")],T);const Oe=T;var U;let h=U=class extends L(P){constructor(e){super(e),this.attributes=null,this.backgroundColor=new w([0,0,0,0]),this.dotBlendingEnabled=!0,this.dotShape="square",this.dotSize=1,this.legendOptions=null,this.outline=new Z,this.dotValue=null,this.referenceScale=null,this.seed=1,this.type="dot-density"}calculateDotValue(e){if(this.referenceScale==null)return this.dotValue;const t=e/this.referenceScale*this.dotValue;return t<1?1:t}getSymbol(){return new Y({outline:this.outline})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}getAttributeHash(){var e;return((e=this.attributes)==null?void 0:e.reduce((t,s)=>t+s.getAttributeHash(),""))??""}getMeshHash(){return JSON.stringify(this.outline)}clone(){return new U({attributes:y(this.attributes),backgroundColor:y(this.backgroundColor),dotBlendingEnabled:y(this.dotBlendingEnabled),dotShape:y(this.dotShape),dotSize:y(this.dotSize),dotValue:y(this.dotValue),legendOptions:y(this.legendOptions),outline:y(this.outline),referenceScale:y(this.referenceScale),seed:y(this.seed),visualVariables:y(this.visualVariables),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}getControllerHash(){var t;return`${(t=this.attributes)==null?void 0:t.map(s=>s.field||s.valueExpression||"")}-${this.outline&&JSON.stringify(this.outline.toJSON())||""}`}async collectRequiredFields(e,t){await this.collectVVRequiredFields(e,t);for(const s of this.attributes??[])s.valueExpression&&await O(e,t,s.valueExpression),s.field&&e.add(s.field)}};i([r({type:[oe],json:{write:!0}})],h.prototype,"attributes",void 0),i([r({type:w,json:{write:!0}})],h.prototype,"backgroundColor",void 0),i([r({type:Boolean,json:{write:!0}})],h.prototype,"dotBlendingEnabled",void 0),i([r({type:String,json:{write:!1}})],h.prototype,"dotShape",void 0),i([r({type:Number,json:{write:!0}})],h.prototype,"dotSize",void 0),i([r({type:Oe,json:{write:!0}})],h.prototype,"legendOptions",void 0),i([r({type:Z,json:{default:null,write:!0}})],h.prototype,"outline",void 0),i([r({type:Number,json:{write:!0}})],h.prototype,"dotValue",void 0),i([r({type:Number,json:{write:!0}})],h.prototype,"referenceScale",void 0),i([r({type:Number,json:{write:!0}})],h.prototype,"seed",void 0),i([A({dotDensity:"dot-density"})],h.prototype,"type",void 0),h=U=i([x("esri.renderers.DotDensityRenderer")],h);const Ae=h;let R=class extends F(N){constructor(){super(...arguments),this.minLabel=null,this.maxLabel=null,this.title=null}};i([r({type:String,json:{write:!0}})],R.prototype,"minLabel",void 0),i([r({type:String,json:{write:!0}})],R.prototype,"maxLabel",void 0),i([r({type:String,json:{write:!0}})],R.prototype,"title",void 0),R=i([x("esri.renderers.support.HeatmapLegendOptions")],R);var J;function W(e){if(e!=null){const{maxDensity:t,minDensity:s,radius:o}=e;if(t!=null||s!=null||o!=null){const{blurRadius:a,maxPixelIntensity:u,minPixelIntensity:n,...$}=e;return $}}return e}let d=J=class extends P{constructor(e){super(e),this.authoringInfo=null,this.colorStops=[new q({ratio:0,color:new w("rgba(255, 140, 0, 0)")}),new q({ratio:.75,color:new w("rgba(255, 140, 0, 1)")}),new q({ratio:.9,color:new w("rgba(255, 0, 0, 1)")})],this.field=null,this.legendOptions=null,this.maxDensity=.04,this.minDensity=0,this.radius=18,this.referenceScale=0,this.type="heatmap",this.valueExpression=null,this.valueExpressionTitle=null,this._warnedProps={blurRadius:!1,maxPixelIntensity:!1,minPixelIntensity:!1}}normalizeCtorArgs(e){return W(e)}get blurRadius(){return Ne(this.radius)}set blurRadius(e){const t=this.maxPixelIntensity,s=this.minPixelIntensity;this._set("radius",Ce(e)),this._warnAboutDeprecatedGaussianBlurProp("blurRadius","radius"),this._set("maxDensity",t*this._pixelIntensityToDensity),this._set("minDensity",s*this._pixelIntensityToDensity)}get maxPixelIntensity(){return this.maxDensity/this._pixelIntensityToDensity}set maxPixelIntensity(e){this._set("maxDensity",e*this._pixelIntensityToDensity),this._warnAboutDeprecatedGaussianBlurProp("maxPixelIntensity","maxDensity")}get minPixelIntensity(){return this.minDensity/this._pixelIntensityToDensity}set minPixelIntensity(e){this._set("minDensity",e*this._pixelIntensityToDensity),this._warnAboutDeprecatedGaussianBlurProp("minPixelIntensity","minDensity")}get _pixelIntensityToDensity(){return 24/(qe**2*this.blurRadius**4)}_warnAboutDeprecatedGaussianBlurProp(e,t){this._warnedProps[e]||fe(this).getDefaultOrigin()==="user"&&(this._warnedProps[e]=!0,we(()=>{ve(D.getLogger(this),e,{replacement:`${String(t)} (suggested value: ${this._get(t)})`,version:"4.24"})}))}read(e,t){e=W(e),super.read(e,t)}getSymbol(){return new te}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}async collectRequiredFields(e,t){const s=this.field,o=this.valueExpression;s&&typeof s=="string"&&Se(e,t,s),o&&typeof o=="string"&&await O(e,t,o)}getAttributeHash(){return null}getMeshHash(){return`${JSON.stringify(this.colorStops)}.${this.blurRadius}.${this.field}`}clone(){return new J({authoringInfo:this.authoringInfo&&this.authoringInfo.clone(),colorStops:y(this.colorStops),field:this.field,legendOptions:y(this.legendOptions),maxDensity:this.maxDensity,minDensity:this.minDensity,radius:this.radius,referenceScale:this.referenceScale,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};i([r({type:_e,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],d.prototype,"authoringInfo",void 0),i([r({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],d.prototype,"blurRadius",null),i([r({type:[q],json:{write:!0}})],d.prototype,"colorStops",void 0),i([r({type:String,json:{write:!0}})],d.prototype,"field",void 0),i([r({type:R,json:{write:!0}})],d.prototype,"legendOptions",void 0),i([r({type:Number,json:{write:!0}})],d.prototype,"maxDensity",void 0),i([r({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],d.prototype,"maxPixelIntensity",null),i([r({type:Number,json:{write:!0}})],d.prototype,"minDensity",void 0),i([r({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],d.prototype,"minPixelIntensity",null),i([r({type:Number,cast:ee,json:{write:!0}})],d.prototype,"radius",void 0),i([r({type:Number,range:{min:0},json:{default:0,write:!0}})],d.prototype,"referenceScale",void 0),i([A({heatmap:"heatmap"})],d.prototype,"type",void 0),i([r({type:String,json:{write:!0,origins:{"web-document":{write:!1},"portal-item":{write:!1}}}})],d.prototype,"valueExpression",void 0),i([r({type:String})],d.prototype,"valueExpressionTitle",void 0),i([r({readOnly:!0})],d.prototype,"_pixelIntensityToDensity",null),d=J=i([x("esri.renderers.HeatmapRenderer")],d);const ne=d;let V=class extends F(N){constructor(){super(...arguments),this.color=new w([0,0,0,0]),this.label=null,this.threshold=0}};i([r({type:w,json:{write:!0}})],V.prototype,"color",void 0),i([r({type:String,json:{write:!0}})],V.prototype,"label",void 0),i([r({type:Number,range:{min:0,max:1},json:{write:!0}})],V.prototype,"threshold",void 0),V=i([x("esri.renderers.support.OthersCategory")],V);let M=class extends F(N){constructor(){super(...arguments),this.title=null}};i([r({type:String,json:{write:!0}})],M.prototype,"title",void 0),M=i([x("esri.renderers.support.PieChartLegendOptions")],M);let f=class extends L(F(P)){constructor(t){super(t),this.attributes=null,this.backgroundFillSymbol=null,this.defaultColor=new w([0,0,0,0]),this.defaultLabel=null,this.holePercentage=0,this.othersCategory=new V,this.legendOptions=null,this.outline=null,this.size=12,this.type="pie-chart"}getSymbol(){var t;return new te({size:this.size?this.size/2+(((t=this.outline)==null?void 0:t.width)||0):0})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol(),this.backgroundFillSymbol].filter(xe)}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((t,s)=>t+s.getAttributeHash(),"")}getMeshHash(){return this.getSymbols().reduce((t,s)=>t+JSON.stringify(s),"")}async collectRequiredFields(t,s){await this.collectVVRequiredFields(t,s);for(const o of this.attributes)o.valueExpression&&await O(t,s,o.valueExpression),o.field&&t.add(o.field)}};i([r({type:[oe],json:{write:!0}})],f.prototype,"attributes",void 0),i([r({type:Y,json:{default:null,write:!0}})],f.prototype,"backgroundFillSymbol",void 0),i([r({type:w,json:{write:!0}})],f.prototype,"defaultColor",void 0),i([r({type:String,json:{write:!0}})],f.prototype,"defaultLabel",void 0),i([r({type:Number,range:{min:0,max:1},json:{write:!0}})],f.prototype,"holePercentage",void 0),i([r({type:V,json:{write:!0}})],f.prototype,"othersCategory",void 0),i([r({type:M,json:{write:!0}})],f.prototype,"legendOptions",void 0),i([r({type:Z,json:{default:null,write:!0}})],f.prototype,"outline",void 0),i([r({type:Number,cast:ee,json:{write:!0}})],f.prototype,"size",void 0),i([A({pieChart:"pie-chart"})],f.prototype,"type",void 0),f=i([x("esri.renderers.PieChartRenderer")],f);const Fe=f;var G;let I=G=class extends L(P){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.type="simple"}async collectRequiredFields(e,t){await Promise.all([this.collectSymbolFields(e,t),this.collectVVRequiredFields(e,t)])}async collectSymbolFields(e,t){await Promise.all(this.getSymbols().map(s=>s.collectRequiredFields(e,t)))}getSymbol(e,t){return this.symbol}async getSymbolAsync(e,t){return this.symbol}getSymbols(){return this.symbol?[this.symbol]:[]}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((e,t)=>e+t.getAttributeHash(),"")}getMeshHash(){return this.getSymbols().reduce((e,t)=>e+JSON.stringify(t),"")}get arcadeRequired(){return this.arcadeRequiredForVisualVariables}clone(){return new G({description:this.description,label:this.label,symbol:this.symbol&&this.symbol.clone(),visualVariables:y(this.visualVariables),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}};i([r({type:String,json:{write:!0}})],I.prototype,"description",void 0),i([r({type:String,json:{write:!0}})],I.prototype,"label",void 0),i([r(Ie)],I.prototype,"symbol",void 0),i([A({simple:"simple"})],I.prototype,"type",void 0),I=G=i([x("esri.renderers.SimpleRenderer")],I);const le=I,Le={key:"type",base:P,typeMap:{heatmap:ne,simple:le,"unique-value":ie,"class-breaks":se,"dot-density":Ae,dictionary:Me,"pie-chart":Fe},errorContext:"renderer"},st={key:"type",base:P,typeMap:{simple:le,"unique-value":ie,"class-breaks":se,heatmap:ne},errorContext:"renderer",validate:He};function He(e){switch(e.type){case"simple":return ke(e);case"unique-value":return Be(e);case"class-breaks":return ze(e);case"heatmap":return e}}function ke(e){if(e.symbol)return e;D.getLogger("esri.renderers.support.types").error("Removed invalid 'simple' renderer without a symbol from web scene.")}function Be(e){const t=e.uniqueValueInfos,s=t==null?void 0:t.filter(({symbol:o,label:a},u)=>(o||D.getLogger("esri.renderers.support.types").error(`Removed invalid unique value info ([${u}] ${a}) without a symbol from web scene.`),!!o));return(s==null?void 0:s.length)!==(t==null?void 0:t.length)&&(e.uniqueValueInfos=s),e}function ze(e){const t=e.classBreakInfos,s=t==null?void 0:t.filter(({symbol:o,label:a},u)=>(o||D.getLogger("esri.renderers.support.types").error(`Removed invalid class break info ([${u}] ${a}) without a symbol from web scene.`),!!o));return(s==null?void 0:s.length)!==(t==null?void 0:t.length)&&(e.classBreakInfos=s),e}function rt(e,t){return Je(e,null,t)}const Ue=$e({types:Le});function Je(e,t,s){return e?e&&(e.styleName||e.styleUrl)&&e.type!=="uniqueValue"?(s!=null&&s.messages&&s.messages.push(new je("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+e.type+"'",{definition:e,context:s})),null):Ue(e,t,s):null}export{Le as a,q as l,le as m,Je as o,rt as t,st as u}; +import{d as i,y as r,a9 as w,dS as ue,f as x,aU as N,ee as pe,b as ye,s as D,M as X,c8 as de,N as ce,jz as he,aV as y,jA as me,jB as O,aR as K,e1 as ge,jC as be,dw as Z,dz as Y,c9 as A,b4 as F,f0 as ee,a6 as fe,e9 as we,jD as ve,dy as te,jE as Se,q as xe,eX as $e,au as je}from"./index-BjUNJPVf.js";import{v as L,p as P,j as _e,n as Ie,A as ie,w as se}from"./UniqueValueRenderer-7V9Bhr-D.js";import{r as Ve}from"./Version-Dqq_CHBG.js";import{Z as De}from"./FieldsIndex-CK-0B5n9.js";import{f as Pe}from"./OverrideHelper-DxFZBnGL.js";import{v as Ee,q as Re}from"./utils-CuXO_Zzq.js";import{a as Ne,e as Ce,c as qe}from"./heatmapUtils-BSteZBTj.js";var H;let C=H=class extends N{constructor(e){super(e),this.color=null,this.ratio=null}clone(){return new H({color:this.color&&this.color.clone(),ratio:this.ratio})}};i([r({type:w,json:{type:[ue],default:null,write:!0}})],C.prototype,"color",void 0),i([r({type:Number,json:{write:!0}})],C.prototype,"ratio",void 0),C=H=i([x("esri.renderers.support.HeatmapColorStop")],C);const q=C,Q="esri.renderers.support.DictionaryLoader",Te={type:"CIMSimpleLineCallout",lineSymbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",width:.5,color:[0,0,0,255]}]}};class re{constructor(t,s,o){this.config=null,this.fieldMap=null,this.url=null,this._ongoingRequests=new Map,this._symbolCache=new pe(100),this._dictionaryVersion=null,this._fieldIndex=null,this._dictionaryPromise=null,this.url=t,this.config=s,this.fieldMap=o}getSymbolFields(){return this._symbolFields}async getSymbolAsync(t,s){let o;this._dictionaryPromise||(this._dictionaryPromise=this.fetchResources(s));try{o=await this._dictionaryPromise}catch(p){if(ye(p))return this._dictionaryPromise=null,null}const a=this._dictionaryVersion&&this._dictionaryVersion.since(4,0),u={};if(this.fieldMap)for(const p of this._symbolFields){const c=Ee(this.fieldMap[p],this._fieldIndex);if(c){const l=t.attributes[c];u[p]=a?l:l!=null?""+t.attributes[c]:""}else u[p]=""}let n=null;try{n=o==null?void 0:o(u,s)}catch{return null}if(!n||typeof n!="string"||n==="invalid")return null;const $=n.split(";"),_=[],m=[];for(const p of $)if(p)if(p.includes("po:")){const c=p.substr(3).split("|");if(c.length===3){const l=c[0],g=c[1];let b=c[2];if(g==="DashTemplate")b=b.split(" ").map(v=>Number(v));else if(g==="Color"){const v=new w(b).toRgba();b=[v[0],v[1],v[2],255*v[3]]}else b=Number(b);m.push({primitiveName:l,propertyName:g,value:b,defaultValue:null})}}else if(p.includes("|")){for(const c of p.split("|"))if(this._itemNames.has(c)){_.push(c);break}}else this._itemNames.has(p)&&_.push(p);const E=t.geometry==null||!t.geometry.hasZ&&t.geometry.type==="point";return this._cimPartsToCIMSymbol(t,_,m,E,s)}async fetchResources(t){if(this._dictionaryPromise)return this._dictionaryPromise;if(!this.url)return void D.getLogger(Q).error("no valid URL!");const s=X(this.url+"/resources/styles/dictionary-info.json",{responseType:"json",query:{f:"json"},signal:t!=null?t.signal:null}),[{data:o}]=await Promise.all([s,de()]);if(!o)throw this._dictionaryPromise=null,new ce("esri.renderers.DictionaryRenderer","Bad dictionary data!");const{authoringInfo:a,dictionary_version:u,expression:n,itemsNames:$}=o,_=n;let m=!1;u&&(this._dictionaryVersion=Ve.parse(u),m=this._dictionaryVersion.since(4,0)),this._refSymbolUrlTemplate=this.url+"/"+o.cimRefTemplateUrl,this._itemNames=new Set($),this._symbolFields=a.symbol;const E={};if(this.config){const l=this.config;for(const g in l)E[g]=l[g]}if(a.configuration)for(const l of a.configuration)E.hasOwnProperty(l.name)||(E[l.name]=l.value);const p=[];if(t!=null&&t.fields&&this.fieldMap)for(const l in this.fieldMap){const g=this.fieldMap[l],b=t.fields.filter(v=>v.name.toLowerCase()===(g==null?void 0:g.toLowerCase()));b.length>0&&p.push({...b[0],type:m?b[0].type:"esriFieldTypeString"})}p.length>0&&(this._fieldIndex=new De(p));const c=he(_,t!=null?t.spatialReference:null,p,E).then(l=>{const g={scale:0};return(b,v)=>{if(l==null)return null;const ae=l.repurposeFeature({geometry:null,attributes:b});return g.scale=v!=null?v.scale??void 0:void 0,l.evaluate({$feature:ae,$view:g},l.services)}}).catch(l=>(D.getLogger(Q).error("Creating dictinoary expression failed:",l),null));return this._dictionaryPromise=c,c}async _cimPartsToCIMSymbol(t,s,o,a,u){const n=new Array(s.length);for(let m=0;mn.data);const a=this._refSymbolUrlTemplate.replaceAll(/\{itemName\}/gi,t),u=X(a,{responseType:"json",query:{f:"json"},...s});this._ongoingRequests.set(t,u),u.finally(()=>this._ongoingRequests.delete(t));try{const n=await u;return this._symbolCache.put(t,n.data),n.data}catch(n){throw n}}_combineSymbolParts(t,s,o){if(!t||t.length===0)return null;const a={...t[0]};if(t.length>1){a.symbolLayers=[];for(const u of t){const n=u;a.symbolLayers.unshift(...n.symbolLayers)}}return o&&(a.callout=Te),{type:"CIMSymbolReference",symbol:a,primitiveOverrides:s}}}var k;let S=k=class extends L(P){constructor(e){super(e),this.config=null,this.fieldMap=null,this.scaleExpression=null,this.scaleExpressionTitle=null,this.url=null,this.type="dictionary"}get _loader(){return new re(this.url,this.config,this.fieldMap)}writeData(e,t){e&&(t.scalingExpressionInfo={expression:e,returnType:"number"})}writeVisualVariables(e,t,s,o){o!=null&&o.origin||super.writeVisualVariables(e,t,s,o)}clone(){return new k({config:y(this.config),scaleExpression:this.scaleExpression,scaleExpressionTitle:this.scaleExpressionTitle,fieldMap:y(this.fieldMap),url:y(this.url),visualVariables:y(this.visualVariables)})}async getSymbolAsync(e,t){return this._loader.getSymbolAsync(e,t)}async collectRequiredFields(e,t){await this.collectVVRequiredFields(e,t),this.scaleExpression&&await O(e,t,this.scaleExpression);for(const s in this.fieldMap){const o=this.fieldMap[s];t.has(o)&&e.add(o)}}get arcadeRequired(){return!0}getSymbol(){return null}getSymbols(){return[]}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((e,t)=>e+t.getAttributeHash(),"")}getMeshHash(){return`${this.url}-${JSON.stringify(this.fieldMap)}`}getSymbolFields(){return this._loader.getSymbolFields()}};i([r({type:re})],S.prototype,"_loader",null),i([r({type:Object,json:{read:{source:"configuration"},write:{target:"configuration"}}})],S.prototype,"config",void 0),i([r({type:Object,json:{write:!0}})],S.prototype,"fieldMap",void 0),i([r({type:String,json:{read:{source:"scalingExpressionInfo.expression"},write:!0}})],S.prototype,"scaleExpression",void 0),i([K("scaleExpression")],S.prototype,"writeData",null),i([r({type:String,json:{read:{source:"scalingExpressionInfo.title"},write:{target:"scalingExpressionInfo.title",overridePolicy(e){return{enabled:!!e&&!!this.scaleExpression}}}}})],S.prototype,"scaleExpressionTitle",void 0),i([r({type:String,json:{write:!0}})],S.prototype,"url",void 0),i([K("visualVariables")],S.prototype,"writeVisualVariables",null),S=k=i([x("esri.renderers.DictionaryRenderer")],S);const Me=S;var B;let j=B=class extends N{constructor(e){super(e),this.color=null,this.field=null,this.label=null,this.valueExpression=null,this.valueExpressionTitle=null}castField(e){return e==null?e:typeof e=="function"?(D.getLogger(this).error(".field: field must be a string value"),null):be(e)}getAttributeHash(){return`${this.field}-${this.valueExpression}`}clone(){var e;return new B({color:(e=this.color)==null?void 0:e.clone(),field:this.field,label:this.label,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};i([r({type:w,json:{type:[Number],write:!0}})],j.prototype,"color",void 0),i([r({type:String,json:{write:!0}})],j.prototype,"field",void 0),i([ge("field")],j.prototype,"castField",null),i([r({type:String,json:{write:!0}})],j.prototype,"label",void 0),i([r({type:String,json:{write:!0}})],j.prototype,"valueExpression",void 0),i([r({type:String,json:{write:!0}})],j.prototype,"valueExpressionTitle",void 0),j=B=i([x("esri.renderers.support.AttributeColorInfo")],j);const oe=j;var z;let T=z=class extends N{constructor(){super(...arguments),this.unit=null}clone(){return new z({unit:this.unit})}};i([r({type:String,json:{write:!0}})],T.prototype,"unit",void 0),T=z=i([x("esri.renderers.support.DotDensityLegendOptions")],T);const Oe=T;var U;let h=U=class extends L(P){constructor(e){super(e),this.attributes=null,this.backgroundColor=new w([0,0,0,0]),this.dotBlendingEnabled=!0,this.dotShape="square",this.dotSize=1,this.legendOptions=null,this.outline=new Z,this.dotValue=null,this.referenceScale=null,this.seed=1,this.type="dot-density"}calculateDotValue(e){if(this.referenceScale==null)return this.dotValue;const t=e/this.referenceScale*this.dotValue;return t<1?1:t}getSymbol(){return new Y({outline:this.outline})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}getAttributeHash(){var e;return((e=this.attributes)==null?void 0:e.reduce((t,s)=>t+s.getAttributeHash(),""))??""}getMeshHash(){return JSON.stringify(this.outline)}clone(){return new U({attributes:y(this.attributes),backgroundColor:y(this.backgroundColor),dotBlendingEnabled:y(this.dotBlendingEnabled),dotShape:y(this.dotShape),dotSize:y(this.dotSize),dotValue:y(this.dotValue),legendOptions:y(this.legendOptions),outline:y(this.outline),referenceScale:y(this.referenceScale),seed:y(this.seed),visualVariables:y(this.visualVariables),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}getControllerHash(){var t;return`${(t=this.attributes)==null?void 0:t.map(s=>s.field||s.valueExpression||"")}-${this.outline&&JSON.stringify(this.outline.toJSON())||""}`}async collectRequiredFields(e,t){await this.collectVVRequiredFields(e,t);for(const s of this.attributes??[])s.valueExpression&&await O(e,t,s.valueExpression),s.field&&e.add(s.field)}};i([r({type:[oe],json:{write:!0}})],h.prototype,"attributes",void 0),i([r({type:w,json:{write:!0}})],h.prototype,"backgroundColor",void 0),i([r({type:Boolean,json:{write:!0}})],h.prototype,"dotBlendingEnabled",void 0),i([r({type:String,json:{write:!1}})],h.prototype,"dotShape",void 0),i([r({type:Number,json:{write:!0}})],h.prototype,"dotSize",void 0),i([r({type:Oe,json:{write:!0}})],h.prototype,"legendOptions",void 0),i([r({type:Z,json:{default:null,write:!0}})],h.prototype,"outline",void 0),i([r({type:Number,json:{write:!0}})],h.prototype,"dotValue",void 0),i([r({type:Number,json:{write:!0}})],h.prototype,"referenceScale",void 0),i([r({type:Number,json:{write:!0}})],h.prototype,"seed",void 0),i([A({dotDensity:"dot-density"})],h.prototype,"type",void 0),h=U=i([x("esri.renderers.DotDensityRenderer")],h);const Ae=h;let R=class extends F(N){constructor(){super(...arguments),this.minLabel=null,this.maxLabel=null,this.title=null}};i([r({type:String,json:{write:!0}})],R.prototype,"minLabel",void 0),i([r({type:String,json:{write:!0}})],R.prototype,"maxLabel",void 0),i([r({type:String,json:{write:!0}})],R.prototype,"title",void 0),R=i([x("esri.renderers.support.HeatmapLegendOptions")],R);var J;function W(e){if(e!=null){const{maxDensity:t,minDensity:s,radius:o}=e;if(t!=null||s!=null||o!=null){const{blurRadius:a,maxPixelIntensity:u,minPixelIntensity:n,...$}=e;return $}}return e}let d=J=class extends P{constructor(e){super(e),this.authoringInfo=null,this.colorStops=[new q({ratio:0,color:new w("rgba(255, 140, 0, 0)")}),new q({ratio:.75,color:new w("rgba(255, 140, 0, 1)")}),new q({ratio:.9,color:new w("rgba(255, 0, 0, 1)")})],this.field=null,this.legendOptions=null,this.maxDensity=.04,this.minDensity=0,this.radius=18,this.referenceScale=0,this.type="heatmap",this.valueExpression=null,this.valueExpressionTitle=null,this._warnedProps={blurRadius:!1,maxPixelIntensity:!1,minPixelIntensity:!1}}normalizeCtorArgs(e){return W(e)}get blurRadius(){return Ne(this.radius)}set blurRadius(e){const t=this.maxPixelIntensity,s=this.minPixelIntensity;this._set("radius",Ce(e)),this._warnAboutDeprecatedGaussianBlurProp("blurRadius","radius"),this._set("maxDensity",t*this._pixelIntensityToDensity),this._set("minDensity",s*this._pixelIntensityToDensity)}get maxPixelIntensity(){return this.maxDensity/this._pixelIntensityToDensity}set maxPixelIntensity(e){this._set("maxDensity",e*this._pixelIntensityToDensity),this._warnAboutDeprecatedGaussianBlurProp("maxPixelIntensity","maxDensity")}get minPixelIntensity(){return this.minDensity/this._pixelIntensityToDensity}set minPixelIntensity(e){this._set("minDensity",e*this._pixelIntensityToDensity),this._warnAboutDeprecatedGaussianBlurProp("minPixelIntensity","minDensity")}get _pixelIntensityToDensity(){return 24/(qe**2*this.blurRadius**4)}_warnAboutDeprecatedGaussianBlurProp(e,t){this._warnedProps[e]||fe(this).getDefaultOrigin()==="user"&&(this._warnedProps[e]=!0,we(()=>{ve(D.getLogger(this),e,{replacement:`${String(t)} (suggested value: ${this._get(t)})`,version:"4.24"})}))}read(e,t){e=W(e),super.read(e,t)}getSymbol(){return new te}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}async collectRequiredFields(e,t){const s=this.field,o=this.valueExpression;s&&typeof s=="string"&&Se(e,t,s),o&&typeof o=="string"&&await O(e,t,o)}getAttributeHash(){return null}getMeshHash(){return`${JSON.stringify(this.colorStops)}.${this.blurRadius}.${this.field}`}clone(){return new J({authoringInfo:this.authoringInfo&&this.authoringInfo.clone(),colorStops:y(this.colorStops),field:this.field,legendOptions:y(this.legendOptions),maxDensity:this.maxDensity,minDensity:this.minDensity,radius:this.radius,referenceScale:this.referenceScale,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};i([r({type:_e,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],d.prototype,"authoringInfo",void 0),i([r({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],d.prototype,"blurRadius",null),i([r({type:[q],json:{write:!0}})],d.prototype,"colorStops",void 0),i([r({type:String,json:{write:!0}})],d.prototype,"field",void 0),i([r({type:R,json:{write:!0}})],d.prototype,"legendOptions",void 0),i([r({type:Number,json:{write:!0}})],d.prototype,"maxDensity",void 0),i([r({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],d.prototype,"maxPixelIntensity",null),i([r({type:Number,json:{write:!0}})],d.prototype,"minDensity",void 0),i([r({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],d.prototype,"minPixelIntensity",null),i([r({type:Number,cast:ee,json:{write:!0}})],d.prototype,"radius",void 0),i([r({type:Number,range:{min:0},json:{default:0,write:!0}})],d.prototype,"referenceScale",void 0),i([A({heatmap:"heatmap"})],d.prototype,"type",void 0),i([r({type:String,json:{write:!0,origins:{"web-document":{write:!1},"portal-item":{write:!1}}}})],d.prototype,"valueExpression",void 0),i([r({type:String})],d.prototype,"valueExpressionTitle",void 0),i([r({readOnly:!0})],d.prototype,"_pixelIntensityToDensity",null),d=J=i([x("esri.renderers.HeatmapRenderer")],d);const ne=d;let V=class extends F(N){constructor(){super(...arguments),this.color=new w([0,0,0,0]),this.label=null,this.threshold=0}};i([r({type:w,json:{write:!0}})],V.prototype,"color",void 0),i([r({type:String,json:{write:!0}})],V.prototype,"label",void 0),i([r({type:Number,range:{min:0,max:1},json:{write:!0}})],V.prototype,"threshold",void 0),V=i([x("esri.renderers.support.OthersCategory")],V);let M=class extends F(N){constructor(){super(...arguments),this.title=null}};i([r({type:String,json:{write:!0}})],M.prototype,"title",void 0),M=i([x("esri.renderers.support.PieChartLegendOptions")],M);let f=class extends L(F(P)){constructor(t){super(t),this.attributes=null,this.backgroundFillSymbol=null,this.defaultColor=new w([0,0,0,0]),this.defaultLabel=null,this.holePercentage=0,this.othersCategory=new V,this.legendOptions=null,this.outline=null,this.size=12,this.type="pie-chart"}getSymbol(){var t;return new te({size:this.size?this.size/2+(((t=this.outline)==null?void 0:t.width)||0):0})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol(),this.backgroundFillSymbol].filter(xe)}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((t,s)=>t+s.getAttributeHash(),"")}getMeshHash(){return this.getSymbols().reduce((t,s)=>t+JSON.stringify(s),"")}async collectRequiredFields(t,s){await this.collectVVRequiredFields(t,s);for(const o of this.attributes)o.valueExpression&&await O(t,s,o.valueExpression),o.field&&t.add(o.field)}};i([r({type:[oe],json:{write:!0}})],f.prototype,"attributes",void 0),i([r({type:Y,json:{default:null,write:!0}})],f.prototype,"backgroundFillSymbol",void 0),i([r({type:w,json:{write:!0}})],f.prototype,"defaultColor",void 0),i([r({type:String,json:{write:!0}})],f.prototype,"defaultLabel",void 0),i([r({type:Number,range:{min:0,max:1},json:{write:!0}})],f.prototype,"holePercentage",void 0),i([r({type:V,json:{write:!0}})],f.prototype,"othersCategory",void 0),i([r({type:M,json:{write:!0}})],f.prototype,"legendOptions",void 0),i([r({type:Z,json:{default:null,write:!0}})],f.prototype,"outline",void 0),i([r({type:Number,cast:ee,json:{write:!0}})],f.prototype,"size",void 0),i([A({pieChart:"pie-chart"})],f.prototype,"type",void 0),f=i([x("esri.renderers.PieChartRenderer")],f);const Fe=f;var G;let I=G=class extends L(P){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.type="simple"}async collectRequiredFields(e,t){await Promise.all([this.collectSymbolFields(e,t),this.collectVVRequiredFields(e,t)])}async collectSymbolFields(e,t){await Promise.all(this.getSymbols().map(s=>s.collectRequiredFields(e,t)))}getSymbol(e,t){return this.symbol}async getSymbolAsync(e,t){return this.symbol}getSymbols(){return this.symbol?[this.symbol]:[]}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((e,t)=>e+t.getAttributeHash(),"")}getMeshHash(){return this.getSymbols().reduce((e,t)=>e+JSON.stringify(t),"")}get arcadeRequired(){return this.arcadeRequiredForVisualVariables}clone(){return new G({description:this.description,label:this.label,symbol:this.symbol&&this.symbol.clone(),visualVariables:y(this.visualVariables),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}};i([r({type:String,json:{write:!0}})],I.prototype,"description",void 0),i([r({type:String,json:{write:!0}})],I.prototype,"label",void 0),i([r(Ie)],I.prototype,"symbol",void 0),i([A({simple:"simple"})],I.prototype,"type",void 0),I=G=i([x("esri.renderers.SimpleRenderer")],I);const le=I,Le={key:"type",base:P,typeMap:{heatmap:ne,simple:le,"unique-value":ie,"class-breaks":se,"dot-density":Ae,dictionary:Me,"pie-chart":Fe},errorContext:"renderer"},st={key:"type",base:P,typeMap:{simple:le,"unique-value":ie,"class-breaks":se,heatmap:ne},errorContext:"renderer",validate:He};function He(e){switch(e.type){case"simple":return ke(e);case"unique-value":return Be(e);case"class-breaks":return ze(e);case"heatmap":return e}}function ke(e){if(e.symbol)return e;D.getLogger("esri.renderers.support.types").error("Removed invalid 'simple' renderer without a symbol from web scene.")}function Be(e){const t=e.uniqueValueInfos,s=t==null?void 0:t.filter(({symbol:o,label:a},u)=>(o||D.getLogger("esri.renderers.support.types").error(`Removed invalid unique value info ([${u}] ${a}) without a symbol from web scene.`),!!o));return(s==null?void 0:s.length)!==(t==null?void 0:t.length)&&(e.uniqueValueInfos=s),e}function ze(e){const t=e.classBreakInfos,s=t==null?void 0:t.filter(({symbol:o,label:a},u)=>(o||D.getLogger("esri.renderers.support.types").error(`Removed invalid class break info ([${u}] ${a}) without a symbol from web scene.`),!!o));return(s==null?void 0:s.length)!==(t==null?void 0:t.length)&&(e.classBreakInfos=s),e}function rt(e,t){return Je(e,null,t)}const Ue=$e({types:Le});function Je(e,t,s){return e?e&&(e.styleName||e.styleUrl)&&e.type!=="uniqueValue"?(s!=null&&s.messages&&s.messages.push(new je("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+e.type+"'",{definition:e,context:s})),null):Ue(e,t,s):null}export{Le as a,q as l,le as m,Je as o,rt as t,st as u}; diff --git a/assets/jsonUtils-qYmXvGJ1.js b/assets/jsonUtils-Ox5U0P0F.js similarity index 97% rename from assets/jsonUtils-qYmXvGJ1.js rename to assets/jsonUtils-Ox5U0P0F.js index 99a1a78..ac1f4cf 100644 --- a/assets/jsonUtils-qYmXvGJ1.js +++ b/assets/jsonUtils-Ox5U0P0F.js @@ -1 +1 @@ -import{d7 as u,f6 as p,N as b,f7 as y,dw as w,f8 as g,dy as h,dx as x,dz as C,f9 as D,fa as I,dT as L,fb as M,f3 as $,fc as k,fd as v}from"./index-CEWggaxV.js";const a={retainId:!1,ignoreDrivers:!1,hasLabelingContext:!0};function T(e,s=a){var i,f;if(!e)return{symbol:null};const{retainId:t=a.retainId,ignoreDrivers:o=a.ignoreDrivers,hasLabelingContext:r=a.hasLabelingContext,retainCIM:l=a.retainCIM}=s;let n=null;if(u(e)||e instanceof p)n=e.clone();else if(e.type==="cim"){const m=(f=(i=e.data)==null?void 0:i.symbol)==null?void 0:f.type;if(m!=="CIMPointSymbol")return{error:new b("symbol-conversion:unsupported-cim-symbol",`CIM symbol of type '${m||"unknown"}' is unsupported in 3D`,{symbol:e})};n=l?e.clone():y.fromCIMSymbol(e)}else if(e instanceof w)n=g.fromSimpleLineSymbol(e);else if(e instanceof h)n=y.fromSimpleMarkerSymbol(e);else if(e instanceof x)n=y.fromPictureMarkerSymbol(e);else if(e instanceof C)n=s.geometryType&&s.geometryType==="mesh"?D.fromSimpleFillSymbol(e):I.fromSimpleFillSymbol(e);else{if(!(e instanceof L))return{error:new b("symbol-conversion:unsupported-2d-symbol",`2D symbol of type '${e.type||e.declaredClass}' is unsupported in 3D`,{symbol:e})};n=r?M.fromTextSymbol(e):y.fromTextSymbol(e)}return t&&n&&n.type!=="cim"&&(n.id=e.id),o&&u(n)&&n.symbolLayers.forEach(m=>m.ignoreDrivers=!0),{symbol:n}}function P(e,s,t,o){const r=d(e,{},{context:o,isLabelSymbol:!1});r!=null&&(s[t]=r)}function U(e,s,t,o){const r=d(e,{},{context:o,isLabelSymbol:!0});r!=null&&(s[t]=r)}function c(e){return e instanceof v||e instanceof p}function d(e,s,t){if(e==null)return null;const{context:o,isLabelSymbol:r}=t,l=o==null?void 0:o.origin,n=o==null?void 0:o.messages;if(l==="web-scene"&&!c(e)){const i=T(e,{retainCIM:!0,hasLabelingContext:r});return i.symbol!=null?i.symbol.write(s,o):(n==null||n.push(new b("symbol:unsupported",`Symbols of type '${e.declaredClass}' are not supported in scenes. Use 3D symbology instead when working with WebScene and SceneView`,{symbol:e,context:o,error:i.error})),null)}return(l==="web-map"||l==="portal-item"&&!$(o==null?void 0:o.layer))&&c(e)?(n==null||n.push(new b("symbol:unsupported",`Symbols of type '${e.declaredClass}' are not supported in web maps and portal items. Use 2D symbology and CIMSymbol instead when working with MapView`,{symbol:e,context:o})),null):e.write(s,o)}function V(e,s){return k(e,null,s)}export{V as b,U as i,P as l}; +import{d7 as u,f6 as p,N as b,f7 as y,dw as w,f8 as g,dy as h,dx as x,dz as C,f9 as D,fa as I,dT as L,fb as M,f3 as $,fc as k,fd as v}from"./index-BjUNJPVf.js";const a={retainId:!1,ignoreDrivers:!1,hasLabelingContext:!0};function T(e,s=a){var i,f;if(!e)return{symbol:null};const{retainId:t=a.retainId,ignoreDrivers:o=a.ignoreDrivers,hasLabelingContext:r=a.hasLabelingContext,retainCIM:l=a.retainCIM}=s;let n=null;if(u(e)||e instanceof p)n=e.clone();else if(e.type==="cim"){const m=(f=(i=e.data)==null?void 0:i.symbol)==null?void 0:f.type;if(m!=="CIMPointSymbol")return{error:new b("symbol-conversion:unsupported-cim-symbol",`CIM symbol of type '${m||"unknown"}' is unsupported in 3D`,{symbol:e})};n=l?e.clone():y.fromCIMSymbol(e)}else if(e instanceof w)n=g.fromSimpleLineSymbol(e);else if(e instanceof h)n=y.fromSimpleMarkerSymbol(e);else if(e instanceof x)n=y.fromPictureMarkerSymbol(e);else if(e instanceof C)n=s.geometryType&&s.geometryType==="mesh"?D.fromSimpleFillSymbol(e):I.fromSimpleFillSymbol(e);else{if(!(e instanceof L))return{error:new b("symbol-conversion:unsupported-2d-symbol",`2D symbol of type '${e.type||e.declaredClass}' is unsupported in 3D`,{symbol:e})};n=r?M.fromTextSymbol(e):y.fromTextSymbol(e)}return t&&n&&n.type!=="cim"&&(n.id=e.id),o&&u(n)&&n.symbolLayers.forEach(m=>m.ignoreDrivers=!0),{symbol:n}}function P(e,s,t,o){const r=d(e,{},{context:o,isLabelSymbol:!1});r!=null&&(s[t]=r)}function U(e,s,t,o){const r=d(e,{},{context:o,isLabelSymbol:!0});r!=null&&(s[t]=r)}function c(e){return e instanceof v||e instanceof p}function d(e,s,t){if(e==null)return null;const{context:o,isLabelSymbol:r}=t,l=o==null?void 0:o.origin,n=o==null?void 0:o.messages;if(l==="web-scene"&&!c(e)){const i=T(e,{retainCIM:!0,hasLabelingContext:r});return i.symbol!=null?i.symbol.write(s,o):(n==null||n.push(new b("symbol:unsupported",`Symbols of type '${e.declaredClass}' are not supported in scenes. Use 3D symbology instead when working with WebScene and SceneView`,{symbol:e,context:o,error:i.error})),null)}return(l==="web-map"||l==="portal-item"&&!$(o==null?void 0:o.layer))&&c(e)?(n==null||n.push(new b("symbol:unsupported",`Symbols of type '${e.declaredClass}' are not supported in web maps and portal items. Use 2D symbology and CIMSymbol instead when working with MapView`,{symbol:e,context:o})),null):e.write(s,o)}function V(e,s){return k(e,null,s)}export{V as b,U as i,P as l}; diff --git a/assets/kmlUtils-Dl7cXNEs.js b/assets/kmlUtils-C6tn6hG1.js similarity index 94% rename from assets/kmlUtils-Dl7cXNEs.js rename to assets/kmlUtils-C6tn6hG1.js index 9e4d1a8..66de691 100644 --- a/assets/kmlUtils-Dl7cXNEs.js +++ b/assets/kmlUtils-C6tn6hG1.js @@ -1 +1 @@ -import{aV as d,az as I,bD as w,bE as k,M as E,bF as h,bG as b,bH as g,bI as S,bJ as x,aS as v,i as $}from"./index-CEWggaxV.js";import{t as F}from"./jsonUtils-BseLl1fZ.js";import{d as M}from"./FeatureSet-CYJUZgOk.js";const O={esriGeometryPoint:"points",esriGeometryPolyline:"polylines",esriGeometryPolygon:"polygons"};function L(s){var u;const r=s.folders||[],e=r.slice(),o=new Map,i=new Map,f=new Map,a=new Map,c=new Map,l={esriGeometryPoint:i,esriGeometryPolyline:f,esriGeometryPolygon:a};(((u=s.featureCollection)==null?void 0:u.layers)||[]).forEach(t=>{const p=d(t);p.featureSet.features=[];const y=t.featureSet.geometryType;o.set(y,p);const m=t.layerDefinition.objectIdField;y==="esriGeometryPoint"?G(i,m,t.featureSet.features):y==="esriGeometryPolyline"?G(f,m,t.featureSet.features):y==="esriGeometryPolygon"&&G(a,m,t.featureSet.features)}),s.groundOverlays&&s.groundOverlays.forEach(t=>{c.set(t.id,t)}),r.forEach(t=>{t.networkLinkIds.forEach(p=>{const y=j(p,t.id,s.networkLinks);y&&e.push(y)})}),e.forEach(t=>{var p;if(t.featureInfos){t.points=d(o.get("esriGeometryPoint")),t.polylines=d(o.get("esriGeometryPolyline")),t.polygons=d(o.get("esriGeometryPolygon")),t.mapImages=[];for(const y of t.featureInfos)switch(y.type){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":{const m=l[y.type].get(y.id);m&&((p=t[O[y.type]])==null||p.featureSet.features.push(m));break}case"GroundOverlay":{const m=c.get(y.id);m&&t.mapImages.push(m);break}}t.fullExtent=P([t])}});const n=P(e);return{folders:r,sublayers:e,extent:n}}function N(s,r,e,o){var a;const i=(a=I)==null?void 0:a.findCredential(s);s=w(s,{token:i==null?void 0:i.token});const f=k.kmlServiceUrl;return E(f,{query:{url:s,model:"simple",folders:"",refresh:e!==0||void 0,outSR:JSON.stringify(r)},responseType:"json",signal:o})}function T(s,r,e=null,o=[]){const i=[],f={},a=r.sublayers,c=new Set(r.folders.map(l=>l.id));return a.forEach(l=>{var u;const n=new s;if(e?n.read(l,e):n.read(l),o.length&&c.has(n.id)&&(n.visible=o.includes(n.id)),f[l.id]=n,l.parentFolderId!=null&&l.parentFolderId!==-1){const t=f[l.parentFolderId];t.sublayers||(t.sublayers=[]),(u=t.sublayers)==null||u.unshift(n)}else i.unshift(n)}),i}function G(s,r,e){e.forEach(o=>{s.set(o.attributes[r],o)})}function J(s,r){let e;return r.some(o=>o.id===s&&(e=o,!0)),e}function j(s,r,e){const o=J(s,e);return o&&(o.parentFolderId=r,o.networkLink=o),o}async function R(s){const r=M.fromJSON(s.featureSet).features,e=s.layerDefinition,o=F(e.drawingInfo.renderer),i=$.fromJSON(s.popupInfo),f=[];for(const a of r){const c=await o.getSymbolAsync(a);a.symbol=c,a.popupTemplate=i,a.visible=!0,f.push(a)}return f}function P(s){var o,i,f,a,c,l;const r=h(b),e=h(b);for(const n of s){if((i=(o=n.polygons)==null?void 0:o.featureSet)!=null&&i.features)for(const u of n.polygons.featureSet.features)g(r,u.geometry),S(e,r);if((a=(f=n.polylines)==null?void 0:f.featureSet)!=null&&a.features)for(const u of n.polylines.featureSet.features)g(r,u.geometry),S(e,r);if((l=(c=n.points)==null?void 0:c.featureSet)!=null&&l.features)for(const u of n.points.featureSet.features)g(r,u.geometry),S(e,r);if(n.mapImages)for(const u of n.mapImages)g(r,u.extent),S(e,r)}return x(e,b)?void 0:{xmin:e[0],ymin:e[1],zmin:e[2],xmax:e[3],ymax:e[4],zmax:e[5],spatialReference:v.WGS84}}export{T as S,R as b,L as d,N as g,P as j}; +import{aV as d,az as I,bD as w,bE as k,M as E,bF as h,bG as b,bH as g,bI as S,bJ as x,aS as v,i as $}from"./index-BjUNJPVf.js";import{t as F}from"./jsonUtils-Dw332y6z.js";import{d as M}from"./FeatureSet-opEn8ou8.js";const O={esriGeometryPoint:"points",esriGeometryPolyline:"polylines",esriGeometryPolygon:"polygons"};function L(s){var u;const r=s.folders||[],e=r.slice(),o=new Map,i=new Map,f=new Map,a=new Map,c=new Map,l={esriGeometryPoint:i,esriGeometryPolyline:f,esriGeometryPolygon:a};(((u=s.featureCollection)==null?void 0:u.layers)||[]).forEach(t=>{const p=d(t);p.featureSet.features=[];const y=t.featureSet.geometryType;o.set(y,p);const m=t.layerDefinition.objectIdField;y==="esriGeometryPoint"?G(i,m,t.featureSet.features):y==="esriGeometryPolyline"?G(f,m,t.featureSet.features):y==="esriGeometryPolygon"&&G(a,m,t.featureSet.features)}),s.groundOverlays&&s.groundOverlays.forEach(t=>{c.set(t.id,t)}),r.forEach(t=>{t.networkLinkIds.forEach(p=>{const y=j(p,t.id,s.networkLinks);y&&e.push(y)})}),e.forEach(t=>{var p;if(t.featureInfos){t.points=d(o.get("esriGeometryPoint")),t.polylines=d(o.get("esriGeometryPolyline")),t.polygons=d(o.get("esriGeometryPolygon")),t.mapImages=[];for(const y of t.featureInfos)switch(y.type){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":{const m=l[y.type].get(y.id);m&&((p=t[O[y.type]])==null||p.featureSet.features.push(m));break}case"GroundOverlay":{const m=c.get(y.id);m&&t.mapImages.push(m);break}}t.fullExtent=P([t])}});const n=P(e);return{folders:r,sublayers:e,extent:n}}function N(s,r,e,o){var a;const i=(a=I)==null?void 0:a.findCredential(s);s=w(s,{token:i==null?void 0:i.token});const f=k.kmlServiceUrl;return E(f,{query:{url:s,model:"simple",folders:"",refresh:e!==0||void 0,outSR:JSON.stringify(r)},responseType:"json",signal:o})}function T(s,r,e=null,o=[]){const i=[],f={},a=r.sublayers,c=new Set(r.folders.map(l=>l.id));return a.forEach(l=>{var u;const n=new s;if(e?n.read(l,e):n.read(l),o.length&&c.has(n.id)&&(n.visible=o.includes(n.id)),f[l.id]=n,l.parentFolderId!=null&&l.parentFolderId!==-1){const t=f[l.parentFolderId];t.sublayers||(t.sublayers=[]),(u=t.sublayers)==null||u.unshift(n)}else i.unshift(n)}),i}function G(s,r,e){e.forEach(o=>{s.set(o.attributes[r],o)})}function J(s,r){let e;return r.some(o=>o.id===s&&(e=o,!0)),e}function j(s,r,e){const o=J(s,e);return o&&(o.parentFolderId=r,o.networkLink=o),o}async function R(s){const r=M.fromJSON(s.featureSet).features,e=s.layerDefinition,o=F(e.drawingInfo.renderer),i=$.fromJSON(s.popupInfo),f=[];for(const a of r){const c=await o.getSymbolAsync(a);a.symbol=c,a.popupTemplate=i,a.visible=!0,f.push(a)}return f}function P(s){var o,i,f,a,c,l;const r=h(b),e=h(b);for(const n of s){if((i=(o=n.polygons)==null?void 0:o.featureSet)!=null&&i.features)for(const u of n.polygons.featureSet.features)g(r,u.geometry),S(e,r);if((a=(f=n.polylines)==null?void 0:f.featureSet)!=null&&a.features)for(const u of n.polylines.featureSet.features)g(r,u.geometry),S(e,r);if((l=(c=n.points)==null?void 0:c.featureSet)!=null&&l.features)for(const u of n.points.featureSet.features)g(r,u.geometry),S(e,r);if(n.mapImages)for(const u of n.mapImages)g(r,u.extent),S(e,r)}return x(e,b)?void 0:{xmin:e[0],ymin:e[1],zmin:e[2],xmax:e[3],ymax:e[4],zmax:e[5],spatialReference:v.WGS84}}export{T as S,R as b,L as d,N as g,P as j}; diff --git a/assets/knowledgeGraphService-pVNmnapY.js b/assets/knowledgeGraphService-yi4prBvu.js similarity index 98% rename from assets/knowledgeGraphService-pVNmnapY.js rename to assets/knowledgeGraphService-yi4prBvu.js index 0429465..51bc184 100644 --- a/assets/knowledgeGraphService-pVNmnapY.js +++ b/assets/knowledgeGraphService-yi4prBvu.js @@ -1,7 +1,7 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/arcgis-knowledge-client-core-simd-B2yfXWvw.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css","assets/arcgis-knowledge-client-core-DKjhP7CP.js"] + __vite__mapDeps.viteFileDeps = ["assets/arcgis-knowledge-client-core-simd-IaMmXPr_.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css","assets/arcgis-knowledge-client-core-B0fFx-E4.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{d as a,y as s,f as v,a7 as W,aU as k,aS as Y,E as Ue,_ as he,gZ as fe,N as d,et as ie,aD as ve,aA as Ie,aC as ae,aB as se,s as Ge,M as F,az as qe}from"./index-CEWggaxV.js";import{m as Re,p as be,t as Ye,c as Qe}from"./GraphQueryStreaming-ofadKoJ9.js";let L=class extends W{constructor(r){super(r),this.resultRows=[]}};a([s()],L.prototype,"resultRows",void 0),L=a([v("esri.rest.knowledgeGraph.GraphQueryResult")],L);const ge=L;let C=class extends W{constructor(r){super(r),this.resultRowsStream=new ReadableStream}};a([s()],C.prototype,"resultRowsStream",void 0),C=a([v("esri.rest.knowledgeGraph.GraphQueryResult")],C);const _e=C;let b=class extends k{constructor(r){super(r),this.name=null,this.unique=null,this.ascending=null,this.description=null,this.fieldNames=null}};a([s({type:String,json:{write:!0}})],b.prototype,"name",void 0),a([s({type:Boolean,json:{write:!0}})],b.prototype,"unique",void 0),a([s({type:Boolean,json:{write:!0}})],b.prototype,"ascending",void 0),a([s({type:String,json:{write:!0}})],b.prototype,"description",void 0),a([s({type:[String],json:{write:!0}})],b.prototype,"fieldNames",void 0),b=a([v("esri.rest.knowledgeGraph.FieldIndex")],b);const Se=b;let _=class extends k{constructor(r){super(r),this.name=null,this.alias=null,this.fieldType=null,this.geometryType=null,this.hasM=null,this.hasZ=null,this.nullable=null,this.editable=null,this.required=null,this.defaultVisibility=null,this.systemMaintained=null,this.role=null,this.defaultValue=null}};a([s({type:String,json:{write:!0}})],_.prototype,"name",void 0),a([s({type:String,json:{write:!0}})],_.prototype,"alias",void 0),a([s({type:String,json:{write:!0}})],_.prototype,"fieldType",void 0),a([s({type:String,json:{write:!0}})],_.prototype,"geometryType",void 0),a([s({type:Boolean,json:{write:!0}})],_.prototype,"hasM",void 0),a([s({type:Boolean,json:{write:!0}})],_.prototype,"hasZ",void 0),a([s({type:Boolean,json:{write:!0}})],_.prototype,"nullable",void 0),a([s({type:Boolean,json:{write:!0}})],_.prototype,"editable",void 0),a([s({type:Boolean,json:{write:!0}})],_.prototype,"required",void 0),a([s({type:Boolean,json:{write:!0}})],_.prototype,"defaultVisibility",void 0),a([s({type:Boolean,json:{write:!0}})],_.prototype,"systemMaintained",void 0),a([s()],_.prototype,"role",void 0),a([s({type:Object,json:{type:String,write:{writer:(e,r)=>{r.defaultValue=e!=null?e.toString():null}}}})],_.prototype,"defaultValue",void 0),_=a([v("esri.rest.knowledgeGraph.GraphProperty")],_);const Me=_;let R=class extends k{constructor(r){super(r),this.name=null,this.alias=null,this.role=null,this.strict=null,this.properties=null,this.fieldIndexes=null}};a([s({type:String,json:{write:!0}})],R.prototype,"name",void 0),a([s({type:String,json:{write:!0}})],R.prototype,"alias",void 0),a([s({type:String,json:{write:!0}})],R.prototype,"role",void 0),a([s({type:Boolean,json:{write:!0}})],R.prototype,"strict",void 0),a([s({type:[Me],json:{write:!0}})],R.prototype,"properties",void 0),a([s({type:[Se],json:{write:!0}})],R.prototype,"fieldIndexes",void 0),R=a([v("esri.rest.knowledgeGraph.GraphObjectType")],R);const xe=R;let X=class extends xe{constructor(r){super(r)}};X=a([v("esri.rest.knowledgeGraph.EntityType")],X);const Oe=X;let U=class extends xe{constructor(r){super(r),this.endPoints=[]}};a([s()],U.prototype,"endPoints",void 0),U=a([v("esri.rest.knowledgeGraph.RelationshipType")],U);const Pe=U;let E=class extends k{constructor(e){super(e),this.timestamp=null,this.spatialReference=null,this.strict=null,this.objectIdField=null,this.globalIdField=null,this.arcgisManaged=null,this.identifierInfo=null,this.searchIndexes=null,this.entityTypes=null,this.relationshipTypes=null}};a([s({type:Date,json:{type:Number,write:{writer:(e,r)=>{r.timestamp=e==null?void 0:e.getTime()}}}})],E.prototype,"timestamp",void 0),a([s({type:Y,json:{write:!0}})],E.prototype,"spatialReference",void 0),a([s({type:Boolean,json:{write:!0}})],E.prototype,"strict",void 0),a([s({type:String,json:{write:!0}})],E.prototype,"objectIdField",void 0),a([s({type:String,json:{write:!0}})],E.prototype,"globalIdField",void 0),a([s()],E.prototype,"arcgisManaged",void 0),a([s()],E.prototype,"identifierInfo",void 0),a([s()],E.prototype,"searchIndexes",void 0),a([s({type:[Oe],json:{write:!0}})],E.prototype,"entityTypes",void 0),a([s({type:[Pe],json:{write:!0}})],E.prototype,"relationshipTypes",void 0),E=a([v("esri.rest.knowledgeGraph.DataModel")],E);const ke=E;let f=class extends k{constructor(r){super(r),this.capabilities=[],this.supportsSearch=!1,this.supportedQueryFormats=[],this.allowGeometryUpdates=!1,this.searchMaxRecordCount=null,this.serviceCapabilities=null,this.maxRecordCount=null,this.description="",this.copyrightText="",this.units="",this.spatialReference=null,this.currentVersion=null,this.dateFieldsTimeReference=null,this.serviceItemId="",this.supportsDocuments=!1,this.dataEditingNotSupported=!1,this.schemaEditingNotSupported=!1}};a([s({type:[String],json:{write:!0}})],f.prototype,"capabilities",void 0),a([s({type:Boolean,json:{write:!0}})],f.prototype,"supportsSearch",void 0),a([s({type:[String],json:{write:!0}})],f.prototype,"supportedQueryFormats",void 0),a([s({type:Boolean,json:{write:!0}})],f.prototype,"allowGeometryUpdates",void 0),a([s({type:Number,json:{write:!0}})],f.prototype,"searchMaxRecordCount",void 0),a([s({type:Object,json:{write:!0}})],f.prototype,"serviceCapabilities",void 0),a([s({type:Number,json:{write:!0}})],f.prototype,"maxRecordCount",void 0),a([s({type:String,json:{write:!0}})],f.prototype,"description",void 0),a([s({type:String,json:{write:!0}})],f.prototype,"copyrightText",void 0),a([s({type:String,json:{write:!0}})],f.prototype,"units",void 0),a([s({type:Object,json:{write:!0}})],f.prototype,"spatialReference",void 0),a([s({type:Number,json:{write:!0}})],f.prototype,"currentVersion",void 0),a([s({type:Object,json:{write:!0}})],f.prototype,"dateFieldsTimeReference",void 0),a([s({type:String,json:{write:!0}})],f.prototype,"serviceItemId",void 0),a([s({type:Boolean,json:{write:!0}})],f.prototype,"supportsDocuments",void 0),a([s({type:Boolean,json:{write:!0}})],f.prototype,"dataEditingNotSupported",void 0),a([s({type:Boolean,json:{write:!0}})],f.prototype,"schemaEditingNotSupported",void 0),f=a([v("esri.rest.knowledgeGraph.ServiceDefinition")],f);const je=f;let O=class extends k{constructor(r){super(r),this.dataModel=null,this.serviceDefinition=null}};a([s({type:String,json:{write:!0}})],O.prototype,"url",void 0),a([s({type:ke,json:{write:!0}})],O.prototype,"dataModel",void 0),a([s({type:je,json:{write:!0}})],O.prototype,"serviceDefinition",void 0),O=a([v("esri.rest.knowledgeGraph.KnowledgeGraph")],O);const Be=O,me="esri/rest/knowledgeGraph/wasmInterface/";let K;async function S(){const e=K;if(e)return e;const r=Ue("wasm-simd");return K=Ve(r),K}async function Ve(e){if(e){const{default:t}=await he(()=>import("./arcgis-knowledge-client-core-simd-B2yfXWvw.js"),__vite__mapDeps([0,1,2])).then(n=>n.a);return t({locateFile:n=>fe(me+n)})}const{default:r}=await he(()=>import("./arcgis-knowledge-client-core-DKjhP7CP.js"),__vite__mapDeps([3,1,2])).then(t=>t.a);return r({locateFile:t=>fe(me+t)})}function $e(e,r){const t=new r.ArrayValue;return t.deleteLater(),e.forEach(n=>{t.add_value(pe(n,r))}),t}function Fe(e,r){const t=new r.ObjectValue;t.deleteLater();for(const[n,o]of Object.entries(e))t.set_key_value(n,pe(o,r));return t}function le(e,r){if(e instanceof ve)return Ze(e,r);if(e instanceof Ie)return Je(e,r);if(e instanceof ae||e instanceof se)return Ke(e,r);throw new d("knowledge-graph:unsupported-geometry","Only Point, Multipoint, Polyline, and Polygon geometry are supported by ArcGIS Knowledge",{geometry:e})}function We(e,r){r.input_quantization_parameters={xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}function He(e,r,t){if(!e.extent)throw new d("knowledge-graph:illegal-output-quantization","The Output quantization provided to the encoder had an illegal value as part of its extent",e.extent);if(!e.quantizeMode)throw new d("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal mode setting",e.quantizeMode);if(!e.tolerance)throw new d("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal tolerance setting",e.quantizeMode);r.output_quantization_parameters={extent:{xmax:e.extent.xmax,ymax:e.extent.ymax,xmin:e.extent.xmin,ymin:e.extent.ymin},quantize_mode:t.esriQuantizeMode[e.quantizeMode],tolerance:e.tolerance}}function pe(e,r){if(e==null)return"";if(typeof e!="object"||e instanceof Date)return e;if(e instanceof ie)return le(e,r);if(Array.isArray(e)){const t=new r.ArrayValue;return t.deleteLater(),e.forEach(n=>{t.add_value(pe(n,r))}),t}return Fe(e,r)}function Ke(e,r){const t=new r.GeometryValue;t.deleteLater(),t.has_z=e.hasZ,t.has_m=e.hasM;const n=[],o=[];let i=[];e instanceof ae?(t.geometry_type=r.esriGeometryType.esriGeometryPolyline,i=e.paths):e instanceof se&&(t.geometry_type=r.esriGeometryType.esriGeometryPolygon,i=e.rings);let l=0,p=0;return i.forEach(u=>{let c=0;u.forEach(h=>{c++,h.forEach(m=>{n[p]=m,p++})}),o[l]=c,l++}),t.coords=new Float64Array(n),t.lengths=new Uint32Array(o),t}function Ze(e,r){const t=new r.GeometryValue;t.deleteLater(),t.geometry_type=t.geometry_type=r.esriGeometryType.esriGeometryMultipoint,t.has_z=e.hasZ,t.has_m=e.hasM;const n=[],o=[];o[0]=e.points.length;let i=0;return e.points.forEach(l=>{l.forEach(p=>{n[i]=p,i++})}),t.coords=new Float64Array(n),t.lengths=new Uint32Array(o),t}function Je(e,r){const t=new r.GeometryValue;t.deleteLater(),t.geometry_type=r.esriGeometryType.esriGeometryPoint,t.has_z=e.hasZ,t.has_m=e.hasM;const n=[],o=[];o[0]=1,n[0]=e.x,n[1]=e.y;let i=2;return e.hasZ&&(n[i]=e.z,i++),e.hasM&&(n[i]=e.m,i++),t.coords=new Float64Array(n),t.lengths=new Uint32Array(o),t}function A(e,r){if(!e.typeName)throw new d("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits");if(e instanceof Re){const t=new r.EntityValue;t.deleteLater(),t.type_name=e.typeName;for(const[n,o]of Object.entries(e.properties))t.set_key_value(n,we(o,r));return e.id&&t.set_id(e.id),t}if(e instanceof be){const t=new r.RelationshipValue;t.deleteLater(),t.type_name=e.typeName;for(const[n,o]of Object.entries(e.properties))t.set_key_value(n,we(o,r));return e.id&&t.set_id(e.id),e.originId&&e.destinationId&&t.set_related_entity_ids(e.originId,e.destinationId),t}throw new d("knowledge-graph:applyEdits-encoding-failure","Could not determine the type of a named graph object passed to the encoder")}function Xe(e){return{xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}function we(e,r){return e==null?"":typeof e!="object"||e instanceof Date?e:e instanceof ie?le(e,r):""}let M=class extends W{constructor(r){super(r),this.name=null,this.supportedCategory=null,this.analyzers=[],this.searchProperties=new Map}};a([s()],M.prototype,"name",void 0),a([s()],M.prototype,"supportedCategory",void 0),a([s()],M.prototype,"analyzers",void 0),a([s()],M.prototype,"searchProperties",void 0),M=a([v("esri.rest.knowledgeGraph.SearchIndex")],M);const et=M;var Q,B,V,ee,te,re,ne;(function(e){e[e.Regular=0]="Regular",e[e.Provenance=1]="Provenance",e[e.Document=2]="Document"})(Q||(Q={})),function(e){e[e.esriFieldTypeSmallInteger=0]="esriFieldTypeSmallInteger",e[e.esriFieldTypeInteger=1]="esriFieldTypeInteger",e[e.esriFieldTypeSingle=2]="esriFieldTypeSingle",e[e.esriFieldTypeDouble=3]="esriFieldTypeDouble",e[e.esriFieldTypeString=4]="esriFieldTypeString",e[e.esriFieldTypeDate=5]="esriFieldTypeDate",e[e.esriFieldTypeOID=6]="esriFieldTypeOID",e[e.esriFieldTypeGeometry=7]="esriFieldTypeGeometry",e[e.esriFieldTypeBlob=8]="esriFieldTypeBlob",e[e.esriFieldTypeRaster=9]="esriFieldTypeRaster",e[e.esriFieldTypeGUID=10]="esriFieldTypeGUID",e[e.esriFieldTypeGlobalID=11]="esriFieldTypeGlobalID",e[e.esriFieldTypeXML=12]="esriFieldTypeXML",e[e.esriFieldTypeBigInteger=13]="esriFieldTypeBigInteger",e[e.esriFieldTypeDateOnly=14]="esriFieldTypeDateOnly",e[e.esriFieldTypeTimeOnly=15]="esriFieldTypeTimeOnly",e[e.esriFieldTypeTimestampOffset=16]="esriFieldTypeTimestampOffset"}(B||(B={})),function(e){e[e.esriGeometryNull=0]="esriGeometryNull",e[e.esriGeometryPoint=1]="esriGeometryPoint",e[e.esriGeometryMultipoint=2]="esriGeometryMultipoint",e[e.esriGeometryPolyline=3]="esriGeometryPolyline",e[e.esriGeometryPolygon=4]="esriGeometryPolygon",e[e.esriGeometryEnvelope=5]="esriGeometryEnvelope",e[e.esriGeometryAny=6]="esriGeometryAny",e[e.esriGeometryMultiPatch=7]="esriGeometryMultiPatch"}(V||(V={})),function(e){e[e.esriMethodHintUNSPECIFIED=0]="esriMethodHintUNSPECIFIED",e[e.esriUUIDESRI=1]="esriUUIDESRI",e[e.esriUUIDRFC4122=2]="esriUUIDRFC4122"}(ee||(ee={})),function(e){e[e.esriTypeUNSPECIFIED=0]="esriTypeUNSPECIFIED",e[e.esriTypeEntity=1]="esriTypeEntity",e[e.esriTypeRelationship=2]="esriTypeRelationship",e[e.esriTypeBoth=4]="esriTypeBoth"}(te||(te={})),function(e){e[e.esriGraphPropertyUNSPECIFIED=0]="esriGraphPropertyUNSPECIFIED",e[e.esriGraphPropertyRegular=1]="esriGraphPropertyRegular",e[e.esriGraphPropertyDocumentName=2]="esriGraphPropertyDocumentName",e[e.esriGraphPropertyDocumentTitle=3]="esriGraphPropertyDocumentTitle",e[e.esriGraphPropertyDocumentUrl=4]="esriGraphPropertyDocumentUrl",e[e.esriGraphPropertyDocumentText=5]="esriGraphPropertyDocumentText",e[e.esriGraphPropertyDocumentKeywords=6]="esriGraphPropertyDocumentKeywords",e[e.esriGraphPropertyDocumentContentType=7]="esriGraphPropertyDocumentContentType",e[e.esriGraphPropertyDocumentMetadata=8]="esriGraphPropertyDocumentMetadata",e[e.esriGraphPropertyDocumentFileExtension=9]="esriGraphPropertyDocumentFileExtension"}(re||(re={})),function(e){e[e.esriIdentifierInfoTypeUNSPECIFIED=0]="esriIdentifierInfoTypeUNSPECIFIED",e[e.esriIdentifierInfoTypeDatabaseNative=1]="esriIdentifierInfoTypeDatabaseNative",e[e.esriIdentifierInfoTypeUniformProperty=2]="esriIdentifierInfoTypeUniformProperty"}(ne||(ne={}));function tt(e){var r,t,n,o,i,l,p,u,c,h,m;return e.deleteLater(),new ke({timestamp:e.timestamp,spatialReference:new Y(e.spatial_reference),strict:e.strict,objectIdField:e.objectid_property,globalIdField:e.globalid_property,arcgisManaged:e.arcgis_managed,identifierInfo:{identifierMappingInfo:{identifierInfoType:ne[(n=(t=(r=e.identifier_info)==null?void 0:r.identifier_mapping_info)==null?void 0:t.identifier_info_type)==null?void 0:n.value],databaseNativeIdentifier:(i=(o=e.identifier_info)==null?void 0:o.identifier_mapping_info)==null?void 0:i.database_native_identifier,uniformPropertyIdentifier:{identifierPropertyName:(u=(p=(l=e.identifier_info)==null?void 0:l.identifier_mapping_info)==null?void 0:p.uniform_property_identifier)==null?void 0:u.identifier_property_name}},identifierGenerationInfo:{uuidMethodHint:ee[(m=(h=(c=e.identifier_info)==null?void 0:c.identifier_generation_info)==null?void 0:h.uuid_method_hint)==null?void 0:m.value]}},searchIndexes:ut(e.search_indexes),entityTypes:at(e.entity_types),relationshipTypes:dt(e.relationship_types)})}function rt(e){return e.deleteLater(),new Oe(De(e))}function nt(e){return e.deleteLater(),new Se({name:e.name,unique:e.unique,ascending:e.ascending,description:e.description,fieldNames:st(e.fields)})}function De(e){return{name:e.name,alias:e.alias,role:Q[e.role.value]?Q[e.role.value]:null,strict:e.strict,properties:lt(e.properties),fieldIndexes:pt(e.field_indexes)}}function ot(e){return e.deleteLater(),new Me({alias:e.alias,name:e.name,fieldType:B[e.field_type.value]?B[e.field_type.value]:null,geometryType:V[e.geometry_type.value]?V[e.geometry_type.value]:null,hasM:e.has_m,hasZ:e.has_z,nullable:e.nullable,editable:e.editable,required:e.required,defaultVisibility:e.default_visibility,systemMaintained:e.system_maintained,role:re[e.role.value],defaultValue:e.default_value})}function it(e){e.deleteLater();const r=De(e),t=[];for(let n=0;n{const c=[];for(let h=0;hGe.getLogger("esri.rest.knowledgeGraph.WasmToQueryResponseObjConstructors"),gt={decodedWasmObjToQueryResponseObj:(e,r,t)=>{if(e==null)return null;if(typeof e!="object"||"getDate"in e)return e;if("geometry_type"in e)switch(e.geometry_type.value){case null:return null;case T.ESRI_GEOMETRY_POINT:return yt(e,t);case T.ESRI_GEOMETRY_MULTIPOINT:return ct(e,t);case T.ESRI_GEOMETRY_POLYLINE:return ht(e,t);case T.ESRI_GEOMETRY_POLYGON:return ft(e,t);case T.ESRI_GEOMETRY_ENVELOPE:case T.ESRI_GEOMETRY_MULTI_PATCH:return z().warnOnce("Envelope and Multipatch are not supported on knowledge entities, but one of those geometry types was detected. Result interpreted as null"),null;case T.ESRI_GEOMETRY_NULL:case T.ESRI_GEOMETRY_ANY:default:return z().warnOnce("Unknown or blank geometry type returned - Result interpreted as null"),null}else{if(!("object_value_type"in e))return z().warnOnce("A decoded value came back of a type that is not supported. Result interpreted as null"),null;switch(e.object_value_type.value){case x.OBJECT:return mt(e,r,t);case x.ENTITY:return Ae(e,r,t);case x.RELATIONSHIP:return ze(e,r,t);case x.PATH:return wt(e,r,t);case x.ARRAY:return _t(e,r,t);default:return z().warnOnce("Unknown graph object type detected! Result interpreted as null"),null}}}};function _t(e,r,t){const n=[],o=e.count();for(let i=0;i{const r=new Be({url:e}),t=[];return t.push(D(r)),t.push(Le(r)),await Promise.all(t),r},refreshDataModel:async e=>{e.dataModel=await Ce(e)},refreshServiceDefinition:async e=>{var t,n;const r=(await F(e.url,{query:{f:"json"}})).data;return r.capabilities=(t=r==null?void 0:r.capabilities)==null?void 0:t.split(","),r.supportedQueryFormats=(n=r==null?void 0:r.supportedQueryFormats)==null?void 0:n.split(","),e.serviceDefinition=new je(r),e.serviceDefinition},executeQueryStreaming:async(e,r,t)=>{const n=`${e.url}/graph/query`;await Z(e);const o=await J(n,t);o.data.body=await Ot(r,e);const i=await q(o.data.url,o.data);if(e.dataModel)return new _e({resultRowsStream:await Te(i,e.dataModel,r.outputSpatialReference??void 0)});throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},executeApplyEdits:async(e,r,t)=>{var i;if((i=e.serviceDefinition)!=null&&i.dataEditingNotSupported)throw new d("knowledge-graph:data-editing-not-supported","The Knowledge Graph Service definition indicated that data editing is not supported");const n=`${e.url}/graph/applyEdits`;await Z(e);const o=await J(n,t);return o.data.body=await xt(r,e),kt(await q(o.data.url,o.data))},executeQuery:async(e,r,t)=>{var p;const n=`${e.url}/graph/query`,o=await F(n,{responseType:"array-buffer",query:{f:"pbf",openCypherQuery:r.openCypherQuery,...t==null?void 0:t.query},signal:t==null?void 0:t.signal,timeout:t==null?void 0:t.timeout}),i=(p=o.getHeader)==null?void 0:p.call(o,"content-type"),l=o.data;if(i!=null&&i.includes("application/x-protobuf")){const u=new(await S()).GraphQueryDecoder;if(u.deleteLater(),e.dataModel)return new ge({resultRows:oe(u,l,e.dataModel)});throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:i,data:o.data})},executeSearch:async(e,r,t)=>{var u;const n=r.typeCategoryFilter,o=`${e.url}/graph/search`,i=await F(o,{responseType:"array-buffer",query:{f:"pbf",searchQuery:`"${r.searchQuery}"`,typeCategoryFilter:n,...t==null?void 0:t.query},signal:t==null?void 0:t.signal,timeout:t==null?void 0:t.timeout}),l=(u=i.getHeader)==null?void 0:u.call(i,"content-type"),p=i.data;if(l!=null&&l.includes("application/x-protobuf")){const c=new(await S()).GraphQueryDecoder;if(c.deleteLater(),e.dataModel)return new ge({resultRows:oe(c,p,e.dataModel)});throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:l,data:i.data})},executeSearchStreaming:async(e,r,t)=>{const n=`${e.url}/graph/search`;await Z(e);const o=await J(n,t);o.data.body=await Pt(r);const i=await q(o.data.url,o.data);if(e.dataModel)return new _e({resultRowsStream:await Te(i,e.dataModel)});throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},_fetchWrapper:async(e,r)=>fetch(e,r)};async function vt(e,r,t){return G.executeApplyEdits(e,r,t)}async function It(e,r,t){return G.executeQuery(e,r,t)}async function Gt(e,r,t){return G.executeQueryStreaming(e,r,t)}async function Rt(e,r,t){return G.executeSearch(e,r,t)}async function bt(e,r,t){return G.executeSearchStreaming(e,r,t)}async function St(e){return G.fetchKnowledgeGraph(e)}async function D(e){return G.refreshDataModel(e)}async function Le(e){return G.refreshServiceDefinition(e)}async function q(e,r){return G._fetchWrapper(e,r)}async function Z(e){var t;((t=qe)==null?void 0:t.findCredential(e.url))||(e.dataModel?await Ce(e):await D(e))}function $(e,r,t){if(e.error_code!==0)throw new d(r,t,{errorCode:e.error_code,errorMessage:e.error_message})}function Mt(e,r,t,n){r==null?t.set_param_key_value(e,""):typeof r!="object"||r instanceof Date?t.set_param_key_value(e,r):r instanceof ie?t.set_param_key_value(e,le(r,n)):r instanceof Array?t.set_param_key_value(e,$e(r,n)):t.set_param_key_value(e,Fe(r,n))}async function xt(e,r){var l,p,u,c,h,m,y,w,ye;if(r.dataModel||await D(r),!r.dataModel)throw new d("knowledge-graph:data-model-undefined","Encoding could not proceed because a data model was not provided and it could not be determined from the service");const t=await S(),n=!!((l=e.options)!=null&&l.cascadeDelete),o=new t.GraphApplyEditsEncoder(t.SpatialReferenceUtil.WGS84(),(p=e.options)!=null&&p.inputQuantizationParameters?Xe((u=e.options)==null?void 0:u.inputQuantizationParameters):t.InputQuantizationUtil.WGS84_lossless());o.deleteLater(),o.cascade_delete=n;try{let I;(c=e.entityAdds)==null||c.forEach(g=>{I=o.add_entity(A(g,t)),$(I,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),(h=e.relationshipAdds)==null||h.forEach(g=>{if(!g.originId||!g.destinationId)throw new d("knowledge-graph:relationship-origin-destination-missing","When adding a new relationship, you must provide both an origin and destination id on the appropriate class property");I=o.add_relationship(A(g,t)),$(I,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),(m=e.entityUpdates)==null||m.forEach(g=>{if(!g.id)throw new d("knowledge-graph:entity-id-missing","When updating an entity or relationship, you must specify the id on the class level property");I=o.update_entity(A(g,t)),$(I,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),(y=e.relationshipUpdates)==null||y.forEach(g=>{if(!g.id)throw new d("knowledge-graph:relationship-id-missing","When updating an entity or relationship, you must specify the id on the class level property");I=o.update_relationship(A(g,t)),$(I,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),(w=e.entityDeletes)==null||w.forEach(g=>{var j;if(!g.typeName)throw new d("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const N=o.make_delete_helper(g.typeName,!0);N.deleteLater(),(j=g.ids)==null||j.forEach(H=>{N.delete_by_id(H)})}),(ye=e.relationshipDeletes)==null||ye.forEach(g=>{var j;if(!g.typeName)throw new d("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const N=o.make_delete_helper(g.typeName,!1);(j=g.ids)==null||j.forEach(H=>{N.delete_by_id(H)})}),o.encode()}catch(I){throw new d("knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed",{error:I})}const i=o.get_encoding_result();return $(i.error,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed"),structuredClone(i.get_byte_buffer())}async function Ot(e,r){var i,l;const t=await S(),n=new t.GraphQueryRequestEncoder;if(n.deleteLater(),e.outputSpatialReference?n.output_spatial_reference={wkid:e.outputSpatialReference.wkid,latestWkid:e.outputSpatialReference.latestWkid,vcsWkid:e.outputSpatialReference.vcsWkid,latestVcsWkid:e.outputSpatialReference.latestVcsWkid,wkt:e.outputSpatialReference.wkt??""}:n.output_spatial_reference=t.SpatialReferenceUtil.WGS84(),n.open_cypher_query=e.openCypherQuery,e.bindParameters)for(const[p,u]of Object.entries(e.bindParameters))Mt(p,u,n,t);if(e.bindGeometryQuantizationParameters)We(e.bindGeometryQuantizationParameters,n);else{if(r.dataModel||await D(r),((l=(i=r.dataModel)==null?void 0:i.spatialReference)==null?void 0:l.wkid)!==4326)throw new d("knowledge-graph:SR-quantization-mismatch","If the DataModel indicates a coordinate system other than WGS84, inputQuantizationParameters must be provided to the query encoder");n.input_quantization_parameters=t.InputQuantizationUtil.WGS84_lossless()}e.outputQuantizationParameters&&He(e.outputQuantizationParameters,n,t);try{n.encode()}catch(p){throw new d("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{error:p})}const o=n.get_encoding_result();if(o.error.error_code!==0)throw new d("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{errorCode:o.error.error_code,errorMessage:o.error.error_message});return structuredClone(o.get_byte_buffer())}async function Pt(e){var o;const r=await S(),t=new r.GraphSearchRequestEncoder;if(t.deleteLater(),t.search_query=e.searchQuery,t.type_category_filter=r.esriNamedTypeCategory[e.typeCategoryFilter],e.returnSearchContext===!0&&(t.return_search_context=e.returnSearchContext),e.start!=null&&e.start>0&&(t.start_index=e.start),e.num!=null&&(t.max_num_results=e.num),e.idsFilter!=null&&Array.isArray(e.idsFilter)&&e.idsFilter.length>0)try{t.set_ids_filter($e(e.idsFilter,r))}catch(i){throw new d("knowledge-graph:ids-format-error","Attempting to set ids filter failed. This is usually caused by an incorrectly formatted UUID string",{error:i})}(o=e.namedTypesFilter)==null||o.forEach(i=>{t.add_named_type_filter(i)});try{t.encode()}catch(i){throw new d("knowledge-graph:search-encoding-failed","Attempting to encode the search failed",{error:i})}const n=t.get_encoding_result();if(n.error.error_code!==0)throw new d("knowledge-graph:search-encoding-failed","Attempting to get encoding result from the query failed",{errorCode:n.error.error_code,errorMessage:n.error.error_message});return structuredClone(n.get_byte_buffer())}async function J(e,r){return F(e,{responseType:"native-request-init",method:"post",query:{f:"pbf",...r==null?void 0:r.query},body:"x",headers:{"Content-Type":"application/octet-stream"},signal:r==null?void 0:r.signal,timeout:r==null?void 0:r.timeout})}async function kt(e){const r=e.headers.get("content-type");if(r!=null&&r.includes("application/x-protobuf")){const t=await e.arrayBuffer(),n=new(await S()).GraphApplyEditsDecoder;return n.deleteLater(),n.decode(new Uint8Array(t)),Tt(n)}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:r,data:e.text()})}function oe(e,r,t,n=new Y({wkid:Y.WGS84.wkid})){e.push_buffer(new Uint8Array(r));const o=[];let i=0;for(;e.next_row();){i||(i=e.get_header_keys().size());const l=new Array(i);for(let p=0;p{if(c){let y;if(l.has_error()&&(y=new d("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded",{errorCode:l.error.error_code,errorMessage:l.error.error_message})),i.releaseLock(),y)throw p.error(y),y;return void p.close()}const m=oe(l,h,r,t);return m.length>0&&p.enqueue(m),u()})}}})}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:e.text()})}async function Ce(e){var i;const r=`${e.url}/dataModel/queryDataModel`,t=await F(r,{responseType:"array-buffer",query:{f:"pbf"}}),n=(i=t.getHeader)==null?void 0:i.call(t,"content-type"),o=t.data;if(n!=null&&n.includes("application/x-protobuf")){const l=(await S()).decode_data_model_from_protocol_buffer(new Uint8Array(o));if(!l)throw new d("knowledge-graph:data-model-decode-failure","The server responded to the data model query, but the response failed to be decoded. This typically occurs when the Knowledge JS API (4.26 or later) is used with an unsupported backend (11.0 or earlier)");return tt(l)}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:t.data})}const Bt=Object.freeze(Object.defineProperty({__proto__:null,_fetchWrapper:q,executeApplyEdits:vt,executeQuery:It,executeQueryStreaming:Gt,executeSearch:Rt,executeSearchStreaming:bt,fetchKnowledgeGraph:St,kgRestServices:G,refreshDataModel:D,refreshServiceDefinition:Le},Symbol.toStringTag,{value:"Module"}));export{Gt as G,St as T,Bt as k,Pe as p,Oe as t}; +import{d as a,y as s,f as v,a7 as W,aU as k,aS as Y,E as Ue,_ as he,gZ as fe,N as d,et as ie,aD as ve,aA as Ie,aC as ae,aB as se,s as Ge,M as F,az as qe}from"./index-BjUNJPVf.js";import{m as Re,p as be,t as Ye,c as Qe}from"./GraphQueryStreaming-BDRIPeal.js";let L=class extends W{constructor(r){super(r),this.resultRows=[]}};a([s()],L.prototype,"resultRows",void 0),L=a([v("esri.rest.knowledgeGraph.GraphQueryResult")],L);const ge=L;let C=class extends W{constructor(r){super(r),this.resultRowsStream=new ReadableStream}};a([s()],C.prototype,"resultRowsStream",void 0),C=a([v("esri.rest.knowledgeGraph.GraphQueryResult")],C);const _e=C;let b=class extends k{constructor(r){super(r),this.name=null,this.unique=null,this.ascending=null,this.description=null,this.fieldNames=null}};a([s({type:String,json:{write:!0}})],b.prototype,"name",void 0),a([s({type:Boolean,json:{write:!0}})],b.prototype,"unique",void 0),a([s({type:Boolean,json:{write:!0}})],b.prototype,"ascending",void 0),a([s({type:String,json:{write:!0}})],b.prototype,"description",void 0),a([s({type:[String],json:{write:!0}})],b.prototype,"fieldNames",void 0),b=a([v("esri.rest.knowledgeGraph.FieldIndex")],b);const Se=b;let _=class extends k{constructor(r){super(r),this.name=null,this.alias=null,this.fieldType=null,this.geometryType=null,this.hasM=null,this.hasZ=null,this.nullable=null,this.editable=null,this.required=null,this.defaultVisibility=null,this.systemMaintained=null,this.role=null,this.defaultValue=null}};a([s({type:String,json:{write:!0}})],_.prototype,"name",void 0),a([s({type:String,json:{write:!0}})],_.prototype,"alias",void 0),a([s({type:String,json:{write:!0}})],_.prototype,"fieldType",void 0),a([s({type:String,json:{write:!0}})],_.prototype,"geometryType",void 0),a([s({type:Boolean,json:{write:!0}})],_.prototype,"hasM",void 0),a([s({type:Boolean,json:{write:!0}})],_.prototype,"hasZ",void 0),a([s({type:Boolean,json:{write:!0}})],_.prototype,"nullable",void 0),a([s({type:Boolean,json:{write:!0}})],_.prototype,"editable",void 0),a([s({type:Boolean,json:{write:!0}})],_.prototype,"required",void 0),a([s({type:Boolean,json:{write:!0}})],_.prototype,"defaultVisibility",void 0),a([s({type:Boolean,json:{write:!0}})],_.prototype,"systemMaintained",void 0),a([s()],_.prototype,"role",void 0),a([s({type:Object,json:{type:String,write:{writer:(e,r)=>{r.defaultValue=e!=null?e.toString():null}}}})],_.prototype,"defaultValue",void 0),_=a([v("esri.rest.knowledgeGraph.GraphProperty")],_);const Me=_;let R=class extends k{constructor(r){super(r),this.name=null,this.alias=null,this.role=null,this.strict=null,this.properties=null,this.fieldIndexes=null}};a([s({type:String,json:{write:!0}})],R.prototype,"name",void 0),a([s({type:String,json:{write:!0}})],R.prototype,"alias",void 0),a([s({type:String,json:{write:!0}})],R.prototype,"role",void 0),a([s({type:Boolean,json:{write:!0}})],R.prototype,"strict",void 0),a([s({type:[Me],json:{write:!0}})],R.prototype,"properties",void 0),a([s({type:[Se],json:{write:!0}})],R.prototype,"fieldIndexes",void 0),R=a([v("esri.rest.knowledgeGraph.GraphObjectType")],R);const xe=R;let X=class extends xe{constructor(r){super(r)}};X=a([v("esri.rest.knowledgeGraph.EntityType")],X);const Oe=X;let U=class extends xe{constructor(r){super(r),this.endPoints=[]}};a([s()],U.prototype,"endPoints",void 0),U=a([v("esri.rest.knowledgeGraph.RelationshipType")],U);const Pe=U;let E=class extends k{constructor(e){super(e),this.timestamp=null,this.spatialReference=null,this.strict=null,this.objectIdField=null,this.globalIdField=null,this.arcgisManaged=null,this.identifierInfo=null,this.searchIndexes=null,this.entityTypes=null,this.relationshipTypes=null}};a([s({type:Date,json:{type:Number,write:{writer:(e,r)=>{r.timestamp=e==null?void 0:e.getTime()}}}})],E.prototype,"timestamp",void 0),a([s({type:Y,json:{write:!0}})],E.prototype,"spatialReference",void 0),a([s({type:Boolean,json:{write:!0}})],E.prototype,"strict",void 0),a([s({type:String,json:{write:!0}})],E.prototype,"objectIdField",void 0),a([s({type:String,json:{write:!0}})],E.prototype,"globalIdField",void 0),a([s()],E.prototype,"arcgisManaged",void 0),a([s()],E.prototype,"identifierInfo",void 0),a([s()],E.prototype,"searchIndexes",void 0),a([s({type:[Oe],json:{write:!0}})],E.prototype,"entityTypes",void 0),a([s({type:[Pe],json:{write:!0}})],E.prototype,"relationshipTypes",void 0),E=a([v("esri.rest.knowledgeGraph.DataModel")],E);const ke=E;let f=class extends k{constructor(r){super(r),this.capabilities=[],this.supportsSearch=!1,this.supportedQueryFormats=[],this.allowGeometryUpdates=!1,this.searchMaxRecordCount=null,this.serviceCapabilities=null,this.maxRecordCount=null,this.description="",this.copyrightText="",this.units="",this.spatialReference=null,this.currentVersion=null,this.dateFieldsTimeReference=null,this.serviceItemId="",this.supportsDocuments=!1,this.dataEditingNotSupported=!1,this.schemaEditingNotSupported=!1}};a([s({type:[String],json:{write:!0}})],f.prototype,"capabilities",void 0),a([s({type:Boolean,json:{write:!0}})],f.prototype,"supportsSearch",void 0),a([s({type:[String],json:{write:!0}})],f.prototype,"supportedQueryFormats",void 0),a([s({type:Boolean,json:{write:!0}})],f.prototype,"allowGeometryUpdates",void 0),a([s({type:Number,json:{write:!0}})],f.prototype,"searchMaxRecordCount",void 0),a([s({type:Object,json:{write:!0}})],f.prototype,"serviceCapabilities",void 0),a([s({type:Number,json:{write:!0}})],f.prototype,"maxRecordCount",void 0),a([s({type:String,json:{write:!0}})],f.prototype,"description",void 0),a([s({type:String,json:{write:!0}})],f.prototype,"copyrightText",void 0),a([s({type:String,json:{write:!0}})],f.prototype,"units",void 0),a([s({type:Object,json:{write:!0}})],f.prototype,"spatialReference",void 0),a([s({type:Number,json:{write:!0}})],f.prototype,"currentVersion",void 0),a([s({type:Object,json:{write:!0}})],f.prototype,"dateFieldsTimeReference",void 0),a([s({type:String,json:{write:!0}})],f.prototype,"serviceItemId",void 0),a([s({type:Boolean,json:{write:!0}})],f.prototype,"supportsDocuments",void 0),a([s({type:Boolean,json:{write:!0}})],f.prototype,"dataEditingNotSupported",void 0),a([s({type:Boolean,json:{write:!0}})],f.prototype,"schemaEditingNotSupported",void 0),f=a([v("esri.rest.knowledgeGraph.ServiceDefinition")],f);const je=f;let O=class extends k{constructor(r){super(r),this.dataModel=null,this.serviceDefinition=null}};a([s({type:String,json:{write:!0}})],O.prototype,"url",void 0),a([s({type:ke,json:{write:!0}})],O.prototype,"dataModel",void 0),a([s({type:je,json:{write:!0}})],O.prototype,"serviceDefinition",void 0),O=a([v("esri.rest.knowledgeGraph.KnowledgeGraph")],O);const Be=O,me="esri/rest/knowledgeGraph/wasmInterface/";let K;async function S(){const e=K;if(e)return e;const r=Ue("wasm-simd");return K=Ve(r),K}async function Ve(e){if(e){const{default:t}=await he(()=>import("./arcgis-knowledge-client-core-simd-IaMmXPr_.js"),__vite__mapDeps([0,1,2])).then(n=>n.a);return t({locateFile:n=>fe(me+n)})}const{default:r}=await he(()=>import("./arcgis-knowledge-client-core-B0fFx-E4.js"),__vite__mapDeps([3,1,2])).then(t=>t.a);return r({locateFile:t=>fe(me+t)})}function $e(e,r){const t=new r.ArrayValue;return t.deleteLater(),e.forEach(n=>{t.add_value(pe(n,r))}),t}function Fe(e,r){const t=new r.ObjectValue;t.deleteLater();for(const[n,o]of Object.entries(e))t.set_key_value(n,pe(o,r));return t}function le(e,r){if(e instanceof ve)return Ze(e,r);if(e instanceof Ie)return Je(e,r);if(e instanceof ae||e instanceof se)return Ke(e,r);throw new d("knowledge-graph:unsupported-geometry","Only Point, Multipoint, Polyline, and Polygon geometry are supported by ArcGIS Knowledge",{geometry:e})}function We(e,r){r.input_quantization_parameters={xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}function He(e,r,t){if(!e.extent)throw new d("knowledge-graph:illegal-output-quantization","The Output quantization provided to the encoder had an illegal value as part of its extent",e.extent);if(!e.quantizeMode)throw new d("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal mode setting",e.quantizeMode);if(!e.tolerance)throw new d("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal tolerance setting",e.quantizeMode);r.output_quantization_parameters={extent:{xmax:e.extent.xmax,ymax:e.extent.ymax,xmin:e.extent.xmin,ymin:e.extent.ymin},quantize_mode:t.esriQuantizeMode[e.quantizeMode],tolerance:e.tolerance}}function pe(e,r){if(e==null)return"";if(typeof e!="object"||e instanceof Date)return e;if(e instanceof ie)return le(e,r);if(Array.isArray(e)){const t=new r.ArrayValue;return t.deleteLater(),e.forEach(n=>{t.add_value(pe(n,r))}),t}return Fe(e,r)}function Ke(e,r){const t=new r.GeometryValue;t.deleteLater(),t.has_z=e.hasZ,t.has_m=e.hasM;const n=[],o=[];let i=[];e instanceof ae?(t.geometry_type=r.esriGeometryType.esriGeometryPolyline,i=e.paths):e instanceof se&&(t.geometry_type=r.esriGeometryType.esriGeometryPolygon,i=e.rings);let l=0,p=0;return i.forEach(u=>{let c=0;u.forEach(h=>{c++,h.forEach(m=>{n[p]=m,p++})}),o[l]=c,l++}),t.coords=new Float64Array(n),t.lengths=new Uint32Array(o),t}function Ze(e,r){const t=new r.GeometryValue;t.deleteLater(),t.geometry_type=t.geometry_type=r.esriGeometryType.esriGeometryMultipoint,t.has_z=e.hasZ,t.has_m=e.hasM;const n=[],o=[];o[0]=e.points.length;let i=0;return e.points.forEach(l=>{l.forEach(p=>{n[i]=p,i++})}),t.coords=new Float64Array(n),t.lengths=new Uint32Array(o),t}function Je(e,r){const t=new r.GeometryValue;t.deleteLater(),t.geometry_type=r.esriGeometryType.esriGeometryPoint,t.has_z=e.hasZ,t.has_m=e.hasM;const n=[],o=[];o[0]=1,n[0]=e.x,n[1]=e.y;let i=2;return e.hasZ&&(n[i]=e.z,i++),e.hasM&&(n[i]=e.m,i++),t.coords=new Float64Array(n),t.lengths=new Uint32Array(o),t}function A(e,r){if(!e.typeName)throw new d("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits");if(e instanceof Re){const t=new r.EntityValue;t.deleteLater(),t.type_name=e.typeName;for(const[n,o]of Object.entries(e.properties))t.set_key_value(n,we(o,r));return e.id&&t.set_id(e.id),t}if(e instanceof be){const t=new r.RelationshipValue;t.deleteLater(),t.type_name=e.typeName;for(const[n,o]of Object.entries(e.properties))t.set_key_value(n,we(o,r));return e.id&&t.set_id(e.id),e.originId&&e.destinationId&&t.set_related_entity_ids(e.originId,e.destinationId),t}throw new d("knowledge-graph:applyEdits-encoding-failure","Could not determine the type of a named graph object passed to the encoder")}function Xe(e){return{xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}function we(e,r){return e==null?"":typeof e!="object"||e instanceof Date?e:e instanceof ie?le(e,r):""}let M=class extends W{constructor(r){super(r),this.name=null,this.supportedCategory=null,this.analyzers=[],this.searchProperties=new Map}};a([s()],M.prototype,"name",void 0),a([s()],M.prototype,"supportedCategory",void 0),a([s()],M.prototype,"analyzers",void 0),a([s()],M.prototype,"searchProperties",void 0),M=a([v("esri.rest.knowledgeGraph.SearchIndex")],M);const et=M;var Q,B,V,ee,te,re,ne;(function(e){e[e.Regular=0]="Regular",e[e.Provenance=1]="Provenance",e[e.Document=2]="Document"})(Q||(Q={})),function(e){e[e.esriFieldTypeSmallInteger=0]="esriFieldTypeSmallInteger",e[e.esriFieldTypeInteger=1]="esriFieldTypeInteger",e[e.esriFieldTypeSingle=2]="esriFieldTypeSingle",e[e.esriFieldTypeDouble=3]="esriFieldTypeDouble",e[e.esriFieldTypeString=4]="esriFieldTypeString",e[e.esriFieldTypeDate=5]="esriFieldTypeDate",e[e.esriFieldTypeOID=6]="esriFieldTypeOID",e[e.esriFieldTypeGeometry=7]="esriFieldTypeGeometry",e[e.esriFieldTypeBlob=8]="esriFieldTypeBlob",e[e.esriFieldTypeRaster=9]="esriFieldTypeRaster",e[e.esriFieldTypeGUID=10]="esriFieldTypeGUID",e[e.esriFieldTypeGlobalID=11]="esriFieldTypeGlobalID",e[e.esriFieldTypeXML=12]="esriFieldTypeXML",e[e.esriFieldTypeBigInteger=13]="esriFieldTypeBigInteger",e[e.esriFieldTypeDateOnly=14]="esriFieldTypeDateOnly",e[e.esriFieldTypeTimeOnly=15]="esriFieldTypeTimeOnly",e[e.esriFieldTypeTimestampOffset=16]="esriFieldTypeTimestampOffset"}(B||(B={})),function(e){e[e.esriGeometryNull=0]="esriGeometryNull",e[e.esriGeometryPoint=1]="esriGeometryPoint",e[e.esriGeometryMultipoint=2]="esriGeometryMultipoint",e[e.esriGeometryPolyline=3]="esriGeometryPolyline",e[e.esriGeometryPolygon=4]="esriGeometryPolygon",e[e.esriGeometryEnvelope=5]="esriGeometryEnvelope",e[e.esriGeometryAny=6]="esriGeometryAny",e[e.esriGeometryMultiPatch=7]="esriGeometryMultiPatch"}(V||(V={})),function(e){e[e.esriMethodHintUNSPECIFIED=0]="esriMethodHintUNSPECIFIED",e[e.esriUUIDESRI=1]="esriUUIDESRI",e[e.esriUUIDRFC4122=2]="esriUUIDRFC4122"}(ee||(ee={})),function(e){e[e.esriTypeUNSPECIFIED=0]="esriTypeUNSPECIFIED",e[e.esriTypeEntity=1]="esriTypeEntity",e[e.esriTypeRelationship=2]="esriTypeRelationship",e[e.esriTypeBoth=4]="esriTypeBoth"}(te||(te={})),function(e){e[e.esriGraphPropertyUNSPECIFIED=0]="esriGraphPropertyUNSPECIFIED",e[e.esriGraphPropertyRegular=1]="esriGraphPropertyRegular",e[e.esriGraphPropertyDocumentName=2]="esriGraphPropertyDocumentName",e[e.esriGraphPropertyDocumentTitle=3]="esriGraphPropertyDocumentTitle",e[e.esriGraphPropertyDocumentUrl=4]="esriGraphPropertyDocumentUrl",e[e.esriGraphPropertyDocumentText=5]="esriGraphPropertyDocumentText",e[e.esriGraphPropertyDocumentKeywords=6]="esriGraphPropertyDocumentKeywords",e[e.esriGraphPropertyDocumentContentType=7]="esriGraphPropertyDocumentContentType",e[e.esriGraphPropertyDocumentMetadata=8]="esriGraphPropertyDocumentMetadata",e[e.esriGraphPropertyDocumentFileExtension=9]="esriGraphPropertyDocumentFileExtension"}(re||(re={})),function(e){e[e.esriIdentifierInfoTypeUNSPECIFIED=0]="esriIdentifierInfoTypeUNSPECIFIED",e[e.esriIdentifierInfoTypeDatabaseNative=1]="esriIdentifierInfoTypeDatabaseNative",e[e.esriIdentifierInfoTypeUniformProperty=2]="esriIdentifierInfoTypeUniformProperty"}(ne||(ne={}));function tt(e){var r,t,n,o,i,l,p,u,c,h,m;return e.deleteLater(),new ke({timestamp:e.timestamp,spatialReference:new Y(e.spatial_reference),strict:e.strict,objectIdField:e.objectid_property,globalIdField:e.globalid_property,arcgisManaged:e.arcgis_managed,identifierInfo:{identifierMappingInfo:{identifierInfoType:ne[(n=(t=(r=e.identifier_info)==null?void 0:r.identifier_mapping_info)==null?void 0:t.identifier_info_type)==null?void 0:n.value],databaseNativeIdentifier:(i=(o=e.identifier_info)==null?void 0:o.identifier_mapping_info)==null?void 0:i.database_native_identifier,uniformPropertyIdentifier:{identifierPropertyName:(u=(p=(l=e.identifier_info)==null?void 0:l.identifier_mapping_info)==null?void 0:p.uniform_property_identifier)==null?void 0:u.identifier_property_name}},identifierGenerationInfo:{uuidMethodHint:ee[(m=(h=(c=e.identifier_info)==null?void 0:c.identifier_generation_info)==null?void 0:h.uuid_method_hint)==null?void 0:m.value]}},searchIndexes:ut(e.search_indexes),entityTypes:at(e.entity_types),relationshipTypes:dt(e.relationship_types)})}function rt(e){return e.deleteLater(),new Oe(De(e))}function nt(e){return e.deleteLater(),new Se({name:e.name,unique:e.unique,ascending:e.ascending,description:e.description,fieldNames:st(e.fields)})}function De(e){return{name:e.name,alias:e.alias,role:Q[e.role.value]?Q[e.role.value]:null,strict:e.strict,properties:lt(e.properties),fieldIndexes:pt(e.field_indexes)}}function ot(e){return e.deleteLater(),new Me({alias:e.alias,name:e.name,fieldType:B[e.field_type.value]?B[e.field_type.value]:null,geometryType:V[e.geometry_type.value]?V[e.geometry_type.value]:null,hasM:e.has_m,hasZ:e.has_z,nullable:e.nullable,editable:e.editable,required:e.required,defaultVisibility:e.default_visibility,systemMaintained:e.system_maintained,role:re[e.role.value],defaultValue:e.default_value})}function it(e){e.deleteLater();const r=De(e),t=[];for(let n=0;n{const c=[];for(let h=0;hGe.getLogger("esri.rest.knowledgeGraph.WasmToQueryResponseObjConstructors"),gt={decodedWasmObjToQueryResponseObj:(e,r,t)=>{if(e==null)return null;if(typeof e!="object"||"getDate"in e)return e;if("geometry_type"in e)switch(e.geometry_type.value){case null:return null;case T.ESRI_GEOMETRY_POINT:return yt(e,t);case T.ESRI_GEOMETRY_MULTIPOINT:return ct(e,t);case T.ESRI_GEOMETRY_POLYLINE:return ht(e,t);case T.ESRI_GEOMETRY_POLYGON:return ft(e,t);case T.ESRI_GEOMETRY_ENVELOPE:case T.ESRI_GEOMETRY_MULTI_PATCH:return z().warnOnce("Envelope and Multipatch are not supported on knowledge entities, but one of those geometry types was detected. Result interpreted as null"),null;case T.ESRI_GEOMETRY_NULL:case T.ESRI_GEOMETRY_ANY:default:return z().warnOnce("Unknown or blank geometry type returned - Result interpreted as null"),null}else{if(!("object_value_type"in e))return z().warnOnce("A decoded value came back of a type that is not supported. Result interpreted as null"),null;switch(e.object_value_type.value){case x.OBJECT:return mt(e,r,t);case x.ENTITY:return Ae(e,r,t);case x.RELATIONSHIP:return ze(e,r,t);case x.PATH:return wt(e,r,t);case x.ARRAY:return _t(e,r,t);default:return z().warnOnce("Unknown graph object type detected! Result interpreted as null"),null}}}};function _t(e,r,t){const n=[],o=e.count();for(let i=0;i{const r=new Be({url:e}),t=[];return t.push(D(r)),t.push(Le(r)),await Promise.all(t),r},refreshDataModel:async e=>{e.dataModel=await Ce(e)},refreshServiceDefinition:async e=>{var t,n;const r=(await F(e.url,{query:{f:"json"}})).data;return r.capabilities=(t=r==null?void 0:r.capabilities)==null?void 0:t.split(","),r.supportedQueryFormats=(n=r==null?void 0:r.supportedQueryFormats)==null?void 0:n.split(","),e.serviceDefinition=new je(r),e.serviceDefinition},executeQueryStreaming:async(e,r,t)=>{const n=`${e.url}/graph/query`;await Z(e);const o=await J(n,t);o.data.body=await Ot(r,e);const i=await q(o.data.url,o.data);if(e.dataModel)return new _e({resultRowsStream:await Te(i,e.dataModel,r.outputSpatialReference??void 0)});throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},executeApplyEdits:async(e,r,t)=>{var i;if((i=e.serviceDefinition)!=null&&i.dataEditingNotSupported)throw new d("knowledge-graph:data-editing-not-supported","The Knowledge Graph Service definition indicated that data editing is not supported");const n=`${e.url}/graph/applyEdits`;await Z(e);const o=await J(n,t);return o.data.body=await xt(r,e),kt(await q(o.data.url,o.data))},executeQuery:async(e,r,t)=>{var p;const n=`${e.url}/graph/query`,o=await F(n,{responseType:"array-buffer",query:{f:"pbf",openCypherQuery:r.openCypherQuery,...t==null?void 0:t.query},signal:t==null?void 0:t.signal,timeout:t==null?void 0:t.timeout}),i=(p=o.getHeader)==null?void 0:p.call(o,"content-type"),l=o.data;if(i!=null&&i.includes("application/x-protobuf")){const u=new(await S()).GraphQueryDecoder;if(u.deleteLater(),e.dataModel)return new ge({resultRows:oe(u,l,e.dataModel)});throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:i,data:o.data})},executeSearch:async(e,r,t)=>{var u;const n=r.typeCategoryFilter,o=`${e.url}/graph/search`,i=await F(o,{responseType:"array-buffer",query:{f:"pbf",searchQuery:`"${r.searchQuery}"`,typeCategoryFilter:n,...t==null?void 0:t.query},signal:t==null?void 0:t.signal,timeout:t==null?void 0:t.timeout}),l=(u=i.getHeader)==null?void 0:u.call(i,"content-type"),p=i.data;if(l!=null&&l.includes("application/x-protobuf")){const c=new(await S()).GraphQueryDecoder;if(c.deleteLater(),e.dataModel)return new ge({resultRows:oe(c,p,e.dataModel)});throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:l,data:i.data})},executeSearchStreaming:async(e,r,t)=>{const n=`${e.url}/graph/search`;await Z(e);const o=await J(n,t);o.data.body=await Pt(r);const i=await q(o.data.url,o.data);if(e.dataModel)return new _e({resultRowsStream:await Te(i,e.dataModel)});throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},_fetchWrapper:async(e,r)=>fetch(e,r)};async function vt(e,r,t){return G.executeApplyEdits(e,r,t)}async function It(e,r,t){return G.executeQuery(e,r,t)}async function Gt(e,r,t){return G.executeQueryStreaming(e,r,t)}async function Rt(e,r,t){return G.executeSearch(e,r,t)}async function bt(e,r,t){return G.executeSearchStreaming(e,r,t)}async function St(e){return G.fetchKnowledgeGraph(e)}async function D(e){return G.refreshDataModel(e)}async function Le(e){return G.refreshServiceDefinition(e)}async function q(e,r){return G._fetchWrapper(e,r)}async function Z(e){var t;((t=qe)==null?void 0:t.findCredential(e.url))||(e.dataModel?await Ce(e):await D(e))}function $(e,r,t){if(e.error_code!==0)throw new d(r,t,{errorCode:e.error_code,errorMessage:e.error_message})}function Mt(e,r,t,n){r==null?t.set_param_key_value(e,""):typeof r!="object"||r instanceof Date?t.set_param_key_value(e,r):r instanceof ie?t.set_param_key_value(e,le(r,n)):r instanceof Array?t.set_param_key_value(e,$e(r,n)):t.set_param_key_value(e,Fe(r,n))}async function xt(e,r){var l,p,u,c,h,m,y,w,ye;if(r.dataModel||await D(r),!r.dataModel)throw new d("knowledge-graph:data-model-undefined","Encoding could not proceed because a data model was not provided and it could not be determined from the service");const t=await S(),n=!!((l=e.options)!=null&&l.cascadeDelete),o=new t.GraphApplyEditsEncoder(t.SpatialReferenceUtil.WGS84(),(p=e.options)!=null&&p.inputQuantizationParameters?Xe((u=e.options)==null?void 0:u.inputQuantizationParameters):t.InputQuantizationUtil.WGS84_lossless());o.deleteLater(),o.cascade_delete=n;try{let I;(c=e.entityAdds)==null||c.forEach(g=>{I=o.add_entity(A(g,t)),$(I,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),(h=e.relationshipAdds)==null||h.forEach(g=>{if(!g.originId||!g.destinationId)throw new d("knowledge-graph:relationship-origin-destination-missing","When adding a new relationship, you must provide both an origin and destination id on the appropriate class property");I=o.add_relationship(A(g,t)),$(I,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),(m=e.entityUpdates)==null||m.forEach(g=>{if(!g.id)throw new d("knowledge-graph:entity-id-missing","When updating an entity or relationship, you must specify the id on the class level property");I=o.update_entity(A(g,t)),$(I,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),(y=e.relationshipUpdates)==null||y.forEach(g=>{if(!g.id)throw new d("knowledge-graph:relationship-id-missing","When updating an entity or relationship, you must specify the id on the class level property");I=o.update_relationship(A(g,t)),$(I,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),(w=e.entityDeletes)==null||w.forEach(g=>{var j;if(!g.typeName)throw new d("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const N=o.make_delete_helper(g.typeName,!0);N.deleteLater(),(j=g.ids)==null||j.forEach(H=>{N.delete_by_id(H)})}),(ye=e.relationshipDeletes)==null||ye.forEach(g=>{var j;if(!g.typeName)throw new d("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const N=o.make_delete_helper(g.typeName,!1);(j=g.ids)==null||j.forEach(H=>{N.delete_by_id(H)})}),o.encode()}catch(I){throw new d("knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed",{error:I})}const i=o.get_encoding_result();return $(i.error,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed"),structuredClone(i.get_byte_buffer())}async function Ot(e,r){var i,l;const t=await S(),n=new t.GraphQueryRequestEncoder;if(n.deleteLater(),e.outputSpatialReference?n.output_spatial_reference={wkid:e.outputSpatialReference.wkid,latestWkid:e.outputSpatialReference.latestWkid,vcsWkid:e.outputSpatialReference.vcsWkid,latestVcsWkid:e.outputSpatialReference.latestVcsWkid,wkt:e.outputSpatialReference.wkt??""}:n.output_spatial_reference=t.SpatialReferenceUtil.WGS84(),n.open_cypher_query=e.openCypherQuery,e.bindParameters)for(const[p,u]of Object.entries(e.bindParameters))Mt(p,u,n,t);if(e.bindGeometryQuantizationParameters)We(e.bindGeometryQuantizationParameters,n);else{if(r.dataModel||await D(r),((l=(i=r.dataModel)==null?void 0:i.spatialReference)==null?void 0:l.wkid)!==4326)throw new d("knowledge-graph:SR-quantization-mismatch","If the DataModel indicates a coordinate system other than WGS84, inputQuantizationParameters must be provided to the query encoder");n.input_quantization_parameters=t.InputQuantizationUtil.WGS84_lossless()}e.outputQuantizationParameters&&He(e.outputQuantizationParameters,n,t);try{n.encode()}catch(p){throw new d("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{error:p})}const o=n.get_encoding_result();if(o.error.error_code!==0)throw new d("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{errorCode:o.error.error_code,errorMessage:o.error.error_message});return structuredClone(o.get_byte_buffer())}async function Pt(e){var o;const r=await S(),t=new r.GraphSearchRequestEncoder;if(t.deleteLater(),t.search_query=e.searchQuery,t.type_category_filter=r.esriNamedTypeCategory[e.typeCategoryFilter],e.returnSearchContext===!0&&(t.return_search_context=e.returnSearchContext),e.start!=null&&e.start>0&&(t.start_index=e.start),e.num!=null&&(t.max_num_results=e.num),e.idsFilter!=null&&Array.isArray(e.idsFilter)&&e.idsFilter.length>0)try{t.set_ids_filter($e(e.idsFilter,r))}catch(i){throw new d("knowledge-graph:ids-format-error","Attempting to set ids filter failed. This is usually caused by an incorrectly formatted UUID string",{error:i})}(o=e.namedTypesFilter)==null||o.forEach(i=>{t.add_named_type_filter(i)});try{t.encode()}catch(i){throw new d("knowledge-graph:search-encoding-failed","Attempting to encode the search failed",{error:i})}const n=t.get_encoding_result();if(n.error.error_code!==0)throw new d("knowledge-graph:search-encoding-failed","Attempting to get encoding result from the query failed",{errorCode:n.error.error_code,errorMessage:n.error.error_message});return structuredClone(n.get_byte_buffer())}async function J(e,r){return F(e,{responseType:"native-request-init",method:"post",query:{f:"pbf",...r==null?void 0:r.query},body:"x",headers:{"Content-Type":"application/octet-stream"},signal:r==null?void 0:r.signal,timeout:r==null?void 0:r.timeout})}async function kt(e){const r=e.headers.get("content-type");if(r!=null&&r.includes("application/x-protobuf")){const t=await e.arrayBuffer(),n=new(await S()).GraphApplyEditsDecoder;return n.deleteLater(),n.decode(new Uint8Array(t)),Tt(n)}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:r,data:e.text()})}function oe(e,r,t,n=new Y({wkid:Y.WGS84.wkid})){e.push_buffer(new Uint8Array(r));const o=[];let i=0;for(;e.next_row();){i||(i=e.get_header_keys().size());const l=new Array(i);for(let p=0;p{if(c){let y;if(l.has_error()&&(y=new d("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded",{errorCode:l.error.error_code,errorMessage:l.error.error_message})),i.releaseLock(),y)throw p.error(y),y;return void p.close()}const m=oe(l,h,r,t);return m.length>0&&p.enqueue(m),u()})}}})}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:e.text()})}async function Ce(e){var i;const r=`${e.url}/dataModel/queryDataModel`,t=await F(r,{responseType:"array-buffer",query:{f:"pbf"}}),n=(i=t.getHeader)==null?void 0:i.call(t,"content-type"),o=t.data;if(n!=null&&n.includes("application/x-protobuf")){const l=(await S()).decode_data_model_from_protocol_buffer(new Uint8Array(o));if(!l)throw new d("knowledge-graph:data-model-decode-failure","The server responded to the data model query, but the response failed to be decoded. This typically occurs when the Knowledge JS API (4.26 or later) is used with an unsupported backend (11.0 or earlier)");return tt(l)}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:t.data})}const Bt=Object.freeze(Object.defineProperty({__proto__:null,_fetchWrapper:q,executeApplyEdits:vt,executeQuery:It,executeQueryStreaming:Gt,executeSearch:Rt,executeSearchStreaming:bt,fetchKnowledgeGraph:St,kgRestServices:G,refreshDataModel:D,refreshServiceDefinition:Le},Symbol.toStringTag,{value:"Module"}));export{Gt as G,St as T,Bt as k,Pe as p,Oe as t}; diff --git a/assets/knowledgegraph-x8GOX0-O.js b/assets/knowledgegraph-CifNQGEf.js similarity index 84% rename from assets/knowledgegraph-x8GOX0-O.js rename to assets/knowledgegraph-CifNQGEf.js index 6490763..f337c95 100644 --- a/assets/knowledgegraph-x8GOX0-O.js +++ b/assets/knowledgegraph-CifNQGEf.js @@ -1,7 +1,7 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/knowledgeGraphService-pVNmnapY.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css","assets/GraphQueryStreaming-ofadKoJ9.js"] + __vite__mapDeps.viteFileDeps = ["assets/knowledgeGraphService-yi4prBvu.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css","assets/GraphQueryStreaming-BDRIPeal.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{ax as _,_ as G,bE as J,bt as Q,bu as V,bv as K,aS as I,aw as M,et as E,ev as U,ew as j}from"./index-CEWggaxV.js";import{a as P,b as u,r as p,x as B,d as T,G as y,a9 as C,v as L,N as W,U as b,q as O,E as q,X as k,k as X,t as Y,aa as z,ab as A,ac as H}from"./arcadeUtils-BoaybaAR.js";import{l as Z}from"./portalUtils-mNGSLeDa.js";import{p as $,n as tt}from"./project-DmZZCyH4.js";import{a as nt,m as et,t as rt,p as at,c as it}from"./GraphQueryStreaming-ofadKoJ9.js";import"./TimeOnly-Cm47ew5I.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./ImmutableArray-BlMso3qf.js";import"./number-Bu1a2qyF.js";import"./featureConversionUtils-CmP9mw0r.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./FieldsIndex-CLgRNeJ_.js";let c=null;async function ot(t){const n=J.geometryServiceUrl??"";if(!n){Q()||await V();for(const e of t)e.container[e.indexer]=K(e.container[e.indexer],I.WGS84);return}const r=t.map(e=>e.container[e.indexer]),i=new $({geometries:r,outSpatialReference:I.WGS84}),s=await tt(n,i);for(let e=0;eimport("./knowledgeGraphService-pVNmnapY.js").then(i=>i.k),__vite__mapDeps([0,1,2,3]))),await c.fetchKnowledgeGraph(r.url)}function v(t,n,r,i,s){if(t===null)return null;if(y(t)||q(t))return t;if(k(t)||k(t))return t.toJSDate();if(X(t))return t.toStorageFormat();if(Y(t))return t.toStorageString();if(z(t)){const e={};for(const a of t.keys())e[a]=v(t.field(a),n,r,i,s),e[a]instanceof E&&s.push({container:e,indexer:a});return e}if(b(t)){const e=t.map(a=>v(a,n,r,i,s));for(let a=0;aw(r,n)):t instanceof et?{graphTypeName:t.typeName,id:t.id,graphType:"entity",properties:R(t.properties,n)}:t instanceof rt?{graphType:"object",properties:R(t.properties,n)}:t instanceof at?{graphTypeName:t.typeName,id:t.id,graphType:"relationship",originId:t.originId??null,destinationId:t.destinationId??null,properties:R(t.properties,n)}:t instanceof it?{graphType:"path",path:t.path?t.path.map(r=>w(r,n)):null}:A(t)?st(t,n):y(t)||q(t)||H(t)?t:null}function vt(t){t.mode==="async"&&(t.functions.knowledgegraphbyportalitem=function(n,r){return t.standardFunctionAsync(n,r,(i,s,e)=>{var d,m;if(P(e,2,2,n,r),e[0]===null)throw new u(n,p.PortalRequired,r);if(e[0]instanceof B){const f=T(e[1]);let h=null;return h=(d=n.services)!=null&&d.portal?n.services.portal:_.getDefault(),D(Z(e[0],h),f)}if(y(e[0])===!1)throw new u(n,p.InvalidParameter,r);const a=T(e[0]);return D(((m=n.services)==null?void 0:m.portal)??_.getDefault(),a)})},t.signatures.push({name:"knowledgegraphbyportalitem",min:2,max:2}),t.functions.querygraph=function(n,r){return t.standardFunctionAsync(n,r,async(i,s,e)=>{var x;P(e,2,4,n,r);const a=e[0];if(!C(a))throw new u(n,p.InvalidParameter,r);const d=e[1];if(!y(d))throw new u(n,p.InvalidParameter,r);c===null&&(c=await G(()=>import("./knowledgeGraphService-pVNmnapY.js").then(o=>o.k),__vite__mapDeps([0,1,2,3])));let m=null;const f=L(e[2],null);if(!(f instanceof W||f===null))throw new u(n,p.InvalidParameter,r);if(f){let o=[];m=v(f,!0,!1,n,o),o=o.filter(l=>!l.container[l.indexer].spatialReference.isWGS84),o.length>0&&await ot(o)}const h=new nt({openCypherQuery:d,bindParameters:m});(((x=a==null?void 0:a.serviceDefinition)==null?void 0:x.currentVersion)??11.3)>11.2&&(h.outputSpatialReference=n.spatialReference);const F=(await c.executeQueryStreaming(a,h)).resultRowsStream.getReader(),S=[];try{for(;;){const{done:o,value:l}=await F.read();if(o)break;if(b(l))for(const g of l)S.push(w(g,n));else{const g=[];for(const N of l)g.push(w(l[N],n));S.push(g)}}}catch(o){throw o}return W.convertJsonToArcade(S,O(n),!1,!0)})},t.signatures.push({name:"querygraph",min:2,max:4}))}export{vt as registerFunctions}; +import{ax as _,_ as G,bE as J,bt as Q,bu as V,bv as K,aS as I,aw as M,et as E,ev as U,ew as j}from"./index-BjUNJPVf.js";import{a as P,b as u,r as p,x as B,d as T,G as y,a9 as C,v as L,N as W,U as b,q as O,E as q,X as k,k as X,t as Y,aa as z,ab as A,ac as H}from"./arcadeUtils-BxUF81hz.js";import{l as Z}from"./portalUtils-ApkRv-Dr.js";import{p as $,n as tt}from"./project-DaC2Outd.js";import{a as nt,m as et,t as rt,p as at,c as it}from"./GraphQueryStreaming-BDRIPeal.js";import"./TimeOnly-BXSODLxA.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./ImmutableArray-BlMso3qf.js";import"./number-CJqenc9O.js";import"./featureConversionUtils-BHhm7bvm.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./FieldsIndex-CK-0B5n9.js";let c=null;async function ot(t){const n=J.geometryServiceUrl??"";if(!n){Q()||await V();for(const e of t)e.container[e.indexer]=K(e.container[e.indexer],I.WGS84);return}const r=t.map(e=>e.container[e.indexer]),i=new $({geometries:r,outSpatialReference:I.WGS84}),s=await tt(n,i);for(let e=0;eimport("./knowledgeGraphService-yi4prBvu.js").then(i=>i.k),__vite__mapDeps([0,1,2,3]))),await c.fetchKnowledgeGraph(r.url)}function v(t,n,r,i,s){if(t===null)return null;if(y(t)||q(t))return t;if(k(t)||k(t))return t.toJSDate();if(X(t))return t.toStorageFormat();if(Y(t))return t.toStorageString();if(z(t)){const e={};for(const a of t.keys())e[a]=v(t.field(a),n,r,i,s),e[a]instanceof E&&s.push({container:e,indexer:a});return e}if(b(t)){const e=t.map(a=>v(a,n,r,i,s));for(let a=0;aw(r,n)):t instanceof et?{graphTypeName:t.typeName,id:t.id,graphType:"entity",properties:R(t.properties,n)}:t instanceof rt?{graphType:"object",properties:R(t.properties,n)}:t instanceof at?{graphTypeName:t.typeName,id:t.id,graphType:"relationship",originId:t.originId??null,destinationId:t.destinationId??null,properties:R(t.properties,n)}:t instanceof it?{graphType:"path",path:t.path?t.path.map(r=>w(r,n)):null}:A(t)?st(t,n):y(t)||q(t)||H(t)?t:null}function vt(t){t.mode==="async"&&(t.functions.knowledgegraphbyportalitem=function(n,r){return t.standardFunctionAsync(n,r,(i,s,e)=>{var d,m;if(P(e,2,2,n,r),e[0]===null)throw new u(n,p.PortalRequired,r);if(e[0]instanceof B){const f=T(e[1]);let h=null;return h=(d=n.services)!=null&&d.portal?n.services.portal:_.getDefault(),D(Z(e[0],h),f)}if(y(e[0])===!1)throw new u(n,p.InvalidParameter,r);const a=T(e[0]);return D(((m=n.services)==null?void 0:m.portal)??_.getDefault(),a)})},t.signatures.push({name:"knowledgegraphbyportalitem",min:2,max:2}),t.functions.querygraph=function(n,r){return t.standardFunctionAsync(n,r,async(i,s,e)=>{var x;P(e,2,4,n,r);const a=e[0];if(!C(a))throw new u(n,p.InvalidParameter,r);const d=e[1];if(!y(d))throw new u(n,p.InvalidParameter,r);c===null&&(c=await G(()=>import("./knowledgeGraphService-yi4prBvu.js").then(o=>o.k),__vite__mapDeps([0,1,2,3])));let m=null;const f=L(e[2],null);if(!(f instanceof W||f===null))throw new u(n,p.InvalidParameter,r);if(f){let o=[];m=v(f,!0,!1,n,o),o=o.filter(l=>!l.container[l.indexer].spatialReference.isWGS84),o.length>0&&await ot(o)}const h=new nt({openCypherQuery:d,bindParameters:m});(((x=a==null?void 0:a.serviceDefinition)==null?void 0:x.currentVersion)??11.3)>11.2&&(h.outputSpatialReference=n.spatialReference);const F=(await c.executeQueryStreaming(a,h)).resultRowsStream.getReader(),S=[];try{for(;;){const{done:o,value:l}=await F.read();if(o)break;if(b(l))for(const g of l)S.push(w(g,n));else{const g=[];for(const N of l)g.push(w(l[N],n));S.push(g)}}}catch(o){throw o}return W.convertJsonToArcade(S,O(n),!1,!0)})},t.signatures.push({name:"querygraph",min:2,max:4}))}export{vt as registerFunctions}; diff --git a/assets/labelUtils-Dnqx6jl5.js b/assets/labelUtils-3p0-m-Ee.js similarity index 93% rename from assets/labelUtils-Dnqx6jl5.js rename to assets/labelUtils-3p0-m-Ee.js index c9585a7..0c37934 100644 --- a/assets/labelUtils-Dnqx6jl5.js +++ b/assets/labelUtils-3p0-m-Ee.js @@ -1 +1 @@ -import{dy as l,dw as i,dz as c,dT as f,aF as x}from"./index-CEWggaxV.js";import{l as $,o as m,S as w,t as g,r as E,s as y,y as S}from"./defaultsJSON-CHAaurhX.js";const T=l.fromJSON($),j=i.fromJSON(m),k=c.fromJSON(w),q=f.fromJSON(g),B=l.fromJSON(E),C=i.fromJSON(y),G=c.fromJSON(S),r="__begin__",o="__end__",b=new RegExp(r,"ig"),N=new RegExp(o,"ig"),t=new RegExp("^"+r,"i"),a=new RegExp(o+"$","i"),s='"',d=s+" + ",R=" + "+s;function _(n){return n.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function H(n){return n.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function u(n){const e={expression:"",type:"none"};return n.labelExpressionInfo?n.labelExpressionInfo.value?(e.expression=n.labelExpressionInfo.value,e.type="conventional"):n.labelExpressionInfo.expression&&(e.expression=n.labelExpressionInfo.expression,e.type="arcade"):n.labelExpression!=null&&(e.expression=_(n.labelExpression),e.type="conventional"),e}function K(n){const e=u(n);if(!e)return null;switch(e.type){case"conventional":return O(e.expression);case"arcade":return e.expression}return null}function L(n){const e=u(n);if(!e)return null;switch(e.type){case"conventional":return v(e.expression);case"arcade":return D(e.expression)}return null}function O(n){let e;return n?(e=x(n,p=>r+'$feature["'+p+'"]'+o),e=t.test(e)?e.replace(t,""):s+e,e=a.test(e)?e.replace(a,""):e+s,e=e.replaceAll(b,d).replaceAll(N,R)):e='""',e}const J=/^\s*\{([^}]+)\}\s*$/i;function v(n){const e=n==null?void 0:n.match(J);return(e==null?void 0:e[1].trim())||null}const A=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*$/i,I=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,h=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])([\w\s]+)(\1)\s*\));?\s*$/i;function D(n){if(!n)return null;let e=A.exec(n)||I.exec(n);return e?e[1]||e[3]:(e=h.exec(n),e?e[2]:null)}export{B as N,C as O,T as S,D as _,q as a,j as b,k as c,K as f,L as g,_ as p,H as u,O as w,u as x,G as y}; +import{dy as l,dw as i,dz as c,dT as f,aF as x}from"./index-BjUNJPVf.js";import{l as $,o as m,S as w,t as g,r as E,s as y,y as S}from"./defaultsJSON-CHAaurhX.js";const T=l.fromJSON($),j=i.fromJSON(m),k=c.fromJSON(w),q=f.fromJSON(g),B=l.fromJSON(E),C=i.fromJSON(y),G=c.fromJSON(S),r="__begin__",o="__end__",b=new RegExp(r,"ig"),N=new RegExp(o,"ig"),t=new RegExp("^"+r,"i"),a=new RegExp(o+"$","i"),s='"',d=s+" + ",R=" + "+s;function _(n){return n.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function H(n){return n.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function u(n){const e={expression:"",type:"none"};return n.labelExpressionInfo?n.labelExpressionInfo.value?(e.expression=n.labelExpressionInfo.value,e.type="conventional"):n.labelExpressionInfo.expression&&(e.expression=n.labelExpressionInfo.expression,e.type="arcade"):n.labelExpression!=null&&(e.expression=_(n.labelExpression),e.type="conventional"),e}function K(n){const e=u(n);if(!e)return null;switch(e.type){case"conventional":return O(e.expression);case"arcade":return e.expression}return null}function L(n){const e=u(n);if(!e)return null;switch(e.type){case"conventional":return v(e.expression);case"arcade":return D(e.expression)}return null}function O(n){let e;return n?(e=x(n,p=>r+'$feature["'+p+'"]'+o),e=t.test(e)?e.replace(t,""):s+e,e=a.test(e)?e.replace(a,""):e+s,e=e.replaceAll(b,d).replaceAll(N,R)):e='""',e}const J=/^\s*\{([^}]+)\}\s*$/i;function v(n){const e=n==null?void 0:n.match(J);return(e==null?void 0:e[1].trim())||null}const A=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*$/i,I=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,h=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])([\w\s]+)(\1)\s*\));?\s*$/i;function D(n){if(!n)return null;let e=A.exec(n)||I.exec(n);return e?e[1]||e[3]:(e=h.exec(n),e?e[2]:null)}export{B as N,C as O,T as S,D as _,q as a,j as b,k as c,K as f,L as g,_ as p,H as u,O as w,u as x,G as y}; diff --git a/assets/labelingInfo-CijajRsc.js b/assets/labelingInfo-DqAUis6e.js similarity index 90% rename from assets/labelingInfo-CijajRsc.js rename to assets/labelingInfo-DqAUis6e.js index 371c5c3..d40bd67 100644 --- a/assets/labelingInfo-CijajRsc.js +++ b/assets/labelingInfo-DqAUis6e.js @@ -1 +1 @@ -import{aV as c,N as f,s as u}from"./index-CEWggaxV.js";import{C as p}from"./LabelClass-6cZokw8y.js";const l=()=>u.getLogger("esri.layers.support.labelingInfo"),b=/\[([^\[\]]+)\]/gi;function h(e,t,o){return e?e.map(n=>{var s;const r=new p;if(r.read(n,o),r.labelExpression){const i=t.fields||((s=t.layerDefinition)==null?void 0:s.fields)||this.fields;r.labelExpression=r.labelExpression.replaceAll(b,(d,a)=>`[${m(a,i)}]`)}return r}):null}function m(e,t){if(!t)return e;const o=e.toLowerCase();for(let n=0;ng(n,t))?[]:o}function g(e,t){const o=e.labelPlacement,n=y[t];if(!e.symbol)return l().warn("No ILabelClass symbol specified."),!0;if(!n)return l().error(new f("labeling:unsupported-geometry-type",`Unable to create labels for layer, geometry type '${t}' is not supported`)),!0;if(!n.includes(o)){const r=n[0];o&&l().warn(`Found invalid label placement type ${o} for ${t}. Defaulting to ${r}`),e.labelPlacement=r}return!1}export{v as c,h as i}; +import{aV as c,N as f,s as u}from"./index-BjUNJPVf.js";import{C as p}from"./LabelClass-CeatfK8u.js";const l=()=>u.getLogger("esri.layers.support.labelingInfo"),b=/\[([^\[\]]+)\]/gi;function h(e,t,o){return e?e.map(n=>{var s;const r=new p;if(r.read(n,o),r.labelExpression){const i=t.fields||((s=t.layerDefinition)==null?void 0:s.fields)||this.fields;r.labelExpression=r.labelExpression.replaceAll(b,(d,a)=>`[${m(a,i)}]`)}return r}):null}function m(e,t){if(!t)return e;const o=e.toLowerCase();for(let n=0;ng(n,t))?[]:o}function g(e,t){const o=e.labelPlacement,n=y[t];if(!e.symbol)return l().warn("No ILabelClass symbol specified."),!0;if(!n)return l().error(new f("labeling:unsupported-geometry-type",`Unable to create labels for layer, geometry type '${t}' is not supported`)),!0;if(!n.includes(o)){const r=n[0];o&&l().warn(`Found invalid label placement type ${o} for ${t}. Defaulting to ${r}`),e.labelPlacement=r}return!1}export{v as c,h as i}; diff --git a/assets/layersCreator-ByGguThJ.js b/assets/layersCreator-ua5OUPYt.js similarity index 95% rename from assets/layersCreator-ByGguThJ.js rename to assets/layersCreator-ua5OUPYt.js index c1afa87..8060f8b 100644 --- a/assets/layersCreator-ByGguThJ.js +++ b/assets/layersCreator-ua5OUPYt.js @@ -1 +1 @@ -import{aw as I,V as M}from"./index-CEWggaxV.js";import{w as A,e as b}from"./portalLayers-B6YNSnGP.js";import{a as L}from"./lazyLayerLoader-s-GqbiwM.js";import{t as w}from"./styleUtils-B_Iy1DTk.js";import"./associatedFeatureServiceUtils-BIEHgyxo.js";function v(e){return u(e,"notes")}function h(e){return u(e,"markup")}function C(e){return u(e,"route")}function u(e,r){return!(!e.layerType||e.layerType!=="ArcGISFeatureLayer")&&e.featureCollectionType===r}async function F(e,r,a){if(!r)return;const t=r.map(y=>x(y,a)),i=await Promise.allSettled(t);for(const y of i)y.status==="rejected"||y.value&&e.add(y.value)}const W={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",PointCloudLayer:"PointCloudLayer",ArcGISSceneServiceLayer:"SceneLayer",IntegratedMeshLayer:"IntegratedMeshLayer",OGCFeatureLayer:"OGCFeatureLayer",BuildingSceneLayer:"BuildingSceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",GroupLayer:"GroupLayer",GeoJSON:"GeoJSONLayer",WebTiledLayer:"WebTileLayer",CSV:"CSVLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",KML:"KMLLayer",RasterDataLayer:"UnsupportedLayer",Voxel:"VoxelLayer",LineOfSightLayer:"LineOfSightLayer"},O={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},V={ArcGISFeatureLayer:"FeatureLayer"},k={ArcGISTiledMapServiceLayer:"TileLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",OpenStreetMap:"OpenStreetMapLayer",WebTiledLayer:"WebTileLayer",VectorTileLayer:"VectorTileLayer",ArcGISImageServiceLayer:"UnsupportedLayer",WMS:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",DefaultTileLayer:"TileLayer"},T={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoRSS:"GeoRSSLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",KnowledgeGraphLayer:"UnsupportedLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},g={ArcGISFeatureLayer:"FeatureLayer",SubtypeGroupTable:"UnsupportedLayer"},G={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WebTiledLayer:"WebTileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer"},B={...T,LinkChartLayer:"LinkChartLayer"},D={...g},U={...G};async function x(e,r){return E(await R(e,r),e,r)}async function E(e,r,a){const t=new e;return t.read(r,a.context),t.type==="group"&&(r.layerType==="GroupLayer"?await K(t,r,a):S(r)?J(t,r,a.context):f(r)&&await P(t,r,a.context)),await w(t,a.context),t}async function R(e,r){var c,o;const a=r.context,t=N(a);let i=e.layerType||e.type;!i&&(r!=null&&r.defaultLayerType)&&(i=r.defaultLayerType);const y=t[i];let n=y?L[y]:L.UnknownLayer;if(S(e)){const s=a==null?void 0:a.portal;if(e.itemId){const l=new I({id:e.itemId,portal:s});await l.load();const p=(await A(l,new b)).className||"UnknownLayer";n=L[p]}}else i==="ArcGISFeatureLayer"?v(e)||h(e)?n=L.MapNotesLayer:C(e)?n=L.RouteLayer:f(e)&&(n=L.GroupLayer):(c=e.wmtsInfo)!=null&&c.url&&e.wmtsInfo.layerIdentifier?n=L.WMTSLayer:i==="WFS"&&((o=e.wfsInfo)==null?void 0:o.version)!=="2.0.0"&&(n=L.UnsupportedLayer);return n()}function f(e){var r,a;return e.layerType!=="ArcGISFeatureLayer"||S(e)?!1:(((a=(r=e.featureCollection)==null?void 0:r.layers)==null?void 0:a.length)??0)>1}function S(e){return e.type==="Feature Collection"}function N(e){let r;switch(e.origin){case"web-scene":switch(e.layerContainerType){case"basemap":r=k;break;case"ground":r=O;break;case"tables":r=V;break;default:r=W}break;case"link-chart":switch(e.layerContainerType){case"basemap":r=U;break;case"tables":r=D;break;default:r=B}break;default:switch(e.layerContainerType){case"basemap":r=G;break;case"tables":r=g;break;default:r=T}}return r}async function K(e,r,a){const t=new M,i=F(t,Array.isArray(r.layers)?r.layers:[],a);try{try{if(await i,e.type==="group")return e.layers.addMany(t),e}catch(y){e.destroy();for(const n of t)n.destroy();throw y}}catch(y){throw y}}function J(e,r,a){r.itemId&&(e.portalItem=new I({id:r.itemId,portal:a==null?void 0:a.portal}),e.when(()=>{var i,y;const t=n=>{var s,l;const c=n.layerId;m(n,e,r,c,a);const o=(l=(s=r.featureCollection)==null?void 0:s.layers)==null?void 0:l[c];o&&n.read(o,a)};(i=e.layers)==null||i.forEach(t),(y=e.tables)==null||y.forEach(t)}))}async function P(e,r,a){var o;const t=L.FeatureLayer,i=await t(),y=r.featureCollection,n=y==null?void 0:y.showLegend,c=(o=y==null?void 0:y.layers)==null?void 0:o.map((s,l)=>{const p=new i;p.read(s,a);const d={...a,ignoreDefaults:!0};return m(p,e,r,l,d),n!=null&&p.read({showLegend:n},d),p});e.layers.addMany(c??[])}function m(e,r,a,t,i){var y;e.read({id:`${r.id}-sublayer-${t}`,visibility:((y=a.visibleLayers)==null?void 0:y.includes(t))??!0},i)}export{K as populateGroupLayer,F as populateOperationalLayers}; +import{aw as I,V as M}from"./index-BjUNJPVf.js";import{w as A,e as b}from"./portalLayers-DU48R6fl.js";import{a as L}from"./lazyLayerLoader-Cu0XtDD2.js";import{t as w}from"./styleUtils--I7zqeL6.js";import"./associatedFeatureServiceUtils-nLeTqfYC.js";function v(e){return u(e,"notes")}function h(e){return u(e,"markup")}function C(e){return u(e,"route")}function u(e,r){return!(!e.layerType||e.layerType!=="ArcGISFeatureLayer")&&e.featureCollectionType===r}async function F(e,r,a){if(!r)return;const t=r.map(y=>x(y,a)),i=await Promise.allSettled(t);for(const y of i)y.status==="rejected"||y.value&&e.add(y.value)}const W={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",PointCloudLayer:"PointCloudLayer",ArcGISSceneServiceLayer:"SceneLayer",IntegratedMeshLayer:"IntegratedMeshLayer",OGCFeatureLayer:"OGCFeatureLayer",BuildingSceneLayer:"BuildingSceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",GroupLayer:"GroupLayer",GeoJSON:"GeoJSONLayer",WebTiledLayer:"WebTileLayer",CSV:"CSVLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",KML:"KMLLayer",RasterDataLayer:"UnsupportedLayer",Voxel:"VoxelLayer",LineOfSightLayer:"LineOfSightLayer"},O={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},V={ArcGISFeatureLayer:"FeatureLayer"},k={ArcGISTiledMapServiceLayer:"TileLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",OpenStreetMap:"OpenStreetMapLayer",WebTiledLayer:"WebTileLayer",VectorTileLayer:"VectorTileLayer",ArcGISImageServiceLayer:"UnsupportedLayer",WMS:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",DefaultTileLayer:"TileLayer"},T={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoRSS:"GeoRSSLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",KnowledgeGraphLayer:"UnsupportedLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},g={ArcGISFeatureLayer:"FeatureLayer",SubtypeGroupTable:"UnsupportedLayer"},G={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WebTiledLayer:"WebTileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer"},B={...T,LinkChartLayer:"LinkChartLayer"},D={...g},U={...G};async function x(e,r){return E(await R(e,r),e,r)}async function E(e,r,a){const t=new e;return t.read(r,a.context),t.type==="group"&&(r.layerType==="GroupLayer"?await K(t,r,a):S(r)?J(t,r,a.context):f(r)&&await P(t,r,a.context)),await w(t,a.context),t}async function R(e,r){var c,o;const a=r.context,t=N(a);let i=e.layerType||e.type;!i&&(r!=null&&r.defaultLayerType)&&(i=r.defaultLayerType);const y=t[i];let n=y?L[y]:L.UnknownLayer;if(S(e)){const s=a==null?void 0:a.portal;if(e.itemId){const l=new I({id:e.itemId,portal:s});await l.load();const p=(await A(l,new b)).className||"UnknownLayer";n=L[p]}}else i==="ArcGISFeatureLayer"?v(e)||h(e)?n=L.MapNotesLayer:C(e)?n=L.RouteLayer:f(e)&&(n=L.GroupLayer):(c=e.wmtsInfo)!=null&&c.url&&e.wmtsInfo.layerIdentifier?n=L.WMTSLayer:i==="WFS"&&((o=e.wfsInfo)==null?void 0:o.version)!=="2.0.0"&&(n=L.UnsupportedLayer);return n()}function f(e){var r,a;return e.layerType!=="ArcGISFeatureLayer"||S(e)?!1:(((a=(r=e.featureCollection)==null?void 0:r.layers)==null?void 0:a.length)??0)>1}function S(e){return e.type==="Feature Collection"}function N(e){let r;switch(e.origin){case"web-scene":switch(e.layerContainerType){case"basemap":r=k;break;case"ground":r=O;break;case"tables":r=V;break;default:r=W}break;case"link-chart":switch(e.layerContainerType){case"basemap":r=U;break;case"tables":r=D;break;default:r=B}break;default:switch(e.layerContainerType){case"basemap":r=G;break;case"tables":r=g;break;default:r=T}}return r}async function K(e,r,a){const t=new M,i=F(t,Array.isArray(r.layers)?r.layers:[],a);try{try{if(await i,e.type==="group")return e.layers.addMany(t),e}catch(y){e.destroy();for(const n of t)n.destroy();throw y}}catch(y){throw y}}function J(e,r,a){r.itemId&&(e.portalItem=new I({id:r.itemId,portal:a==null?void 0:a.portal}),e.when(()=>{var i,y;const t=n=>{var s,l;const c=n.layerId;m(n,e,r,c,a);const o=(l=(s=r.featureCollection)==null?void 0:s.layers)==null?void 0:l[c];o&&n.read(o,a)};(i=e.layers)==null||i.forEach(t),(y=e.tables)==null||y.forEach(t)}))}async function P(e,r,a){var o;const t=L.FeatureLayer,i=await t(),y=r.featureCollection,n=y==null?void 0:y.showLegend,c=(o=y==null?void 0:y.layers)==null?void 0:o.map((s,l)=>{const p=new i;p.read(s,a);const d={...a,ignoreDefaults:!0};return m(p,e,r,l,d),n!=null&&p.read({showLegend:n},d),p});e.layers.addMany(c??[])}function m(e,r,a,t,i){var y;e.read({id:`${r.id}-sublayer-${t}`,visibility:((y=a.visibleLayers)==null?void 0:y.includes(t))??!0},i)}export{K as populateGroupLayer,F as populateOperationalLayers}; diff --git a/assets/layersLoader-NUfQIBq4.js b/assets/layersLoader-CBGHpR45.js similarity index 93% rename from assets/layersLoader-NUfQIBq4.js rename to assets/layersLoader-CBGHpR45.js index 03f7a6a..c9a80fe 100644 --- a/assets/layersLoader-NUfQIBq4.js +++ b/assets/layersLoader-CBGHpR45.js @@ -1 +1 @@ -import{N as w,bY as T,bZ as C,ax as E,av as $}from"./index-CEWggaxV.js";import{t as j}from"./fetchService-C38RarY2.js";import{l as S,a as N,n as M,u as O,i as R,c as J,s as P,t as v,r as Q,e as x}from"./portalLayers-B6YNSnGP.js";import{populateGroupLayer as Y}from"./layersCreator-ByGguThJ.js";import{t as Z,a as q}from"./lazyLayerLoader-s-GqbiwM.js";import{t as z}from"./styleUtils-B_Iy1DTk.js";import"./associatedFeatureServiceUtils-BIEHgyxo.js";async function ue(e,a){const r=e.instance.portalItem;if(r!=null&&r.id)return await r.load(a),A(e),e.validateItem&&e.validateItem(r),B(e,a)}function A(e){const a=e.instance.portalItem;if(!(a!=null&&a.type)||!e.supportedTypes.includes(a.type))throw new w("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}'",{type:a==null?void 0:a.type,expectedType:e.supportedTypes.join(", ")})}async function B(e,a){const r=e.instance,t=r.portalItem;if(!t)return;const{url:o,title:n}=t,i=T(t,"portal-item");if(r.type==="group")return H(r,i,e);o&&r.type!=="media"&&r.read({url:o},i);const s=new x,l=await F(e,s,a);return l&&r.read(l,i),r.resourceReferences={portalItem:t,paths:i.readResourcePaths??[]},r.type!=="subtype-group"&&r.read({title:n},i),z(r,i)}async function H(e,a,r){const t=e.portalItem;if(!e.sourceIsPortalItem)return;const{title:o,type:n}=t;if(n==="Group Layer"){if(!C(t,"Map"))throw new w("portal:invalid-layer-item-typekeyword","'Group Layer' item without 'Map' type keyword is not supported");return K(e)}return e.read({title:o},a),U(e,r)}async function K(e){const a=e.portalItem,r=await a.fetchData("json");if(!r)return;const t=T(a,"web-map");e.read(r,t),await Y(e,r,{context:t}),e.resourceReferences={portalItem:a,paths:t.readResourcePaths??[]}}async function U(e,a){var f;let r;const{portalItem:t}=e;if(!t)return;const o=t.type,n=a.layerModuleTypeMap;switch(o){case"Feature Service":case"Feature Collection":r=n.FeatureLayer;break;case"Stream Service":r=n.StreamLayer;break;case"Scene Service":r=n.SceneLayer;break;default:throw new w("portal:unsupported-item-type-as-group",`The item type '${o}' is not supported as a 'IGroupLayer'`)}const i=new x;let[s,l]=await Promise.all([r(),F(a,i)]),u=()=>s;if(o==="Feature Service"){const D=(f=S(l))==null?void 0:f.customParameters;l=t.url?await N(l,t.url,i):{};const b=M(l),c=O(l),d=R(l),y=[];if(b.length||c!=null&&c.length){b.length&&y.push("SubtypeGroupLayer"),c!=null&&c.length&&y.push("OrientedImageryLayer"),d!=null&&d.length&&y.push("CatalogLayer");const g=[];for(const p of y){const m=n[p];g.push(m())}const k=await Promise.all(g),I=new Map;y.forEach((p,m)=>{I.set(p,k[m])}),u=p=>p.layerType?I.get(p.layerType)??s:s}const G=await te(t.url,{customParameters:D,loadContext:i});return await h(e,u,l,G)}return o==="Scene Service"&&t.url&&(l=await J(t,l,i)),P(l)>0?await h(e,u,l):await V(e,u)}async function V(e,a){var o,n;const{portalItem:r}=e;if(!(r!=null&&r.url))return;const t=await Z(r.url);t&&h(e,a,{layers:(o=t.layers)==null?void 0:o.map(v),tables:(n=t.tables)==null?void 0:n.map(v)})}async function h(e,a,r,t){var i;let o=r.layers||[];const n=r.tables||[];if(((i=e.portalItem)==null?void 0:i.type)==="Feature Collection"?(o.forEach((s,l)=>{var u;s.id=l,((u=s==null?void 0:s.layerDefinition)==null?void 0:u.type)==="Table"&&n.push(s)}),o=o.filter(s=>{var l;return((l=s==null?void 0:s.layerDefinition)==null?void 0:l.type)!=="Table"})):(o.reverse(),n.reverse()),o.forEach(s=>{const l=t==null?void 0:t(s);if(l||!t){const u=L(e,a(s),r,s,l);e.add(u)}}),n.length){const s=await q.FeatureLayer();n.forEach(l=>{const u=t==null?void 0:t(l);if(u||!t){const f=L(e,s,r,l,u);e.tables.add(f)}})}}function L(e,a,r,t,o){const n=e.portalItem,i={portalItem:n.clone(),layerId:t.id};t.url!=null&&(i.url=t.url);const s=new a(i);if("sourceJSON"in s&&(s.sourceJSON=o),s.type!=="subtype-group"&&s.type!=="catalog"&&(s.sublayerTitleMode="service-name"),n.type==="Feature Collection"){const l={origin:"portal-item",portal:n.portal||E.getDefault()};s.read(t,l);const u=r.showLegend;u!=null&&s.read({showLegend:u},l)}return s}async function F(e,a,r){if(e.supportsData===!1)return;const t=e.instance,o=t.portalItem;if(!o)return;let n=null;try{n=await o.fetchData("json",r)}catch{}if(_(t)){let i=null;const s=await W(o,n,a);if((n!=null&&n.layers||n!=null&&n.tables)&&s>0){if(t.layerId==null){const l=M(n);t.layerId=t.type==="subtype-group"?l==null?void 0:l[0]:Q(n)}i=X(n,t),i&&n.showLegend!=null&&(i.showLegend=n.showLegend)}return s>1&&"sublayerTitleMode"in t&&t.sublayerTitleMode!=="service-name"&&(t.sublayerTitleMode="item-title-and-service-name"),i}return n}async function W(e,a,r){var n,i,s,l,u;if(a!=null&&a.layers&&(a!=null&&a.tables))return P(a);const t=$(e.url);if(!t)return 1;const o=await r.fetchServiceMetadata(t.url.path,{customParameters:(n=S(a))==null?void 0:n.customParameters}).catch(()=>null);return(((i=a==null?void 0:a.layers)==null?void 0:i.length)??((s=o==null?void 0:o.layers)==null?void 0:s.length)??0)+(((l=a==null?void 0:a.tables)==null?void 0:l.length)??((u=o==null?void 0:o.tables)==null?void 0:u.length)??0)}function X(e,a){var o,n;const{layerId:r}=a,t=((o=e.layers)==null?void 0:o.find(i=>i.id===r))||((n=e.tables)==null?void 0:n.find(i=>i.id===r));return t&&ee(t,a)?t:null}function _(e){return e.type!=="stream"&&"layerId"in e}function ee(e,a){return!(a.type==="feature"&&"layerType"in e&&e.layerType==="SubtypeGroupLayer"||a.type==="subtype-group"&&!("layerType"in e))}async function te(e,a){const{layersJSON:r}=await j(e,a);if(!r)return null;const t=[...r.layers,...r.tables];return o=>t.find(n=>n.id===o.id)}export{ue as load}; +import{N as w,bY as T,bZ as C,ax as E,av as $}from"./index-BjUNJPVf.js";import{t as j}from"./fetchService-Crgml5qT.js";import{l as S,a as N,n as M,u as O,i as R,c as J,s as P,t as v,r as Q,e as x}from"./portalLayers-DU48R6fl.js";import{populateGroupLayer as Y}from"./layersCreator-ua5OUPYt.js";import{t as Z,a as q}from"./lazyLayerLoader-Cu0XtDD2.js";import{t as z}from"./styleUtils--I7zqeL6.js";import"./associatedFeatureServiceUtils-nLeTqfYC.js";async function ue(e,a){const r=e.instance.portalItem;if(r!=null&&r.id)return await r.load(a),A(e),e.validateItem&&e.validateItem(r),B(e,a)}function A(e){const a=e.instance.portalItem;if(!(a!=null&&a.type)||!e.supportedTypes.includes(a.type))throw new w("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}'",{type:a==null?void 0:a.type,expectedType:e.supportedTypes.join(", ")})}async function B(e,a){const r=e.instance,t=r.portalItem;if(!t)return;const{url:o,title:n}=t,i=T(t,"portal-item");if(r.type==="group")return H(r,i,e);o&&r.type!=="media"&&r.read({url:o},i);const s=new x,l=await F(e,s,a);return l&&r.read(l,i),r.resourceReferences={portalItem:t,paths:i.readResourcePaths??[]},r.type!=="subtype-group"&&r.read({title:n},i),z(r,i)}async function H(e,a,r){const t=e.portalItem;if(!e.sourceIsPortalItem)return;const{title:o,type:n}=t;if(n==="Group Layer"){if(!C(t,"Map"))throw new w("portal:invalid-layer-item-typekeyword","'Group Layer' item without 'Map' type keyword is not supported");return K(e)}return e.read({title:o},a),U(e,r)}async function K(e){const a=e.portalItem,r=await a.fetchData("json");if(!r)return;const t=T(a,"web-map");e.read(r,t),await Y(e,r,{context:t}),e.resourceReferences={portalItem:a,paths:t.readResourcePaths??[]}}async function U(e,a){var f;let r;const{portalItem:t}=e;if(!t)return;const o=t.type,n=a.layerModuleTypeMap;switch(o){case"Feature Service":case"Feature Collection":r=n.FeatureLayer;break;case"Stream Service":r=n.StreamLayer;break;case"Scene Service":r=n.SceneLayer;break;default:throw new w("portal:unsupported-item-type-as-group",`The item type '${o}' is not supported as a 'IGroupLayer'`)}const i=new x;let[s,l]=await Promise.all([r(),F(a,i)]),u=()=>s;if(o==="Feature Service"){const D=(f=S(l))==null?void 0:f.customParameters;l=t.url?await N(l,t.url,i):{};const b=M(l),c=O(l),d=R(l),y=[];if(b.length||c!=null&&c.length){b.length&&y.push("SubtypeGroupLayer"),c!=null&&c.length&&y.push("OrientedImageryLayer"),d!=null&&d.length&&y.push("CatalogLayer");const g=[];for(const p of y){const m=n[p];g.push(m())}const k=await Promise.all(g),I=new Map;y.forEach((p,m)=>{I.set(p,k[m])}),u=p=>p.layerType?I.get(p.layerType)??s:s}const G=await te(t.url,{customParameters:D,loadContext:i});return await h(e,u,l,G)}return o==="Scene Service"&&t.url&&(l=await J(t,l,i)),P(l)>0?await h(e,u,l):await V(e,u)}async function V(e,a){var o,n;const{portalItem:r}=e;if(!(r!=null&&r.url))return;const t=await Z(r.url);t&&h(e,a,{layers:(o=t.layers)==null?void 0:o.map(v),tables:(n=t.tables)==null?void 0:n.map(v)})}async function h(e,a,r,t){var i;let o=r.layers||[];const n=r.tables||[];if(((i=e.portalItem)==null?void 0:i.type)==="Feature Collection"?(o.forEach((s,l)=>{var u;s.id=l,((u=s==null?void 0:s.layerDefinition)==null?void 0:u.type)==="Table"&&n.push(s)}),o=o.filter(s=>{var l;return((l=s==null?void 0:s.layerDefinition)==null?void 0:l.type)!=="Table"})):(o.reverse(),n.reverse()),o.forEach(s=>{const l=t==null?void 0:t(s);if(l||!t){const u=L(e,a(s),r,s,l);e.add(u)}}),n.length){const s=await q.FeatureLayer();n.forEach(l=>{const u=t==null?void 0:t(l);if(u||!t){const f=L(e,s,r,l,u);e.tables.add(f)}})}}function L(e,a,r,t,o){const n=e.portalItem,i={portalItem:n.clone(),layerId:t.id};t.url!=null&&(i.url=t.url);const s=new a(i);if("sourceJSON"in s&&(s.sourceJSON=o),s.type!=="subtype-group"&&s.type!=="catalog"&&(s.sublayerTitleMode="service-name"),n.type==="Feature Collection"){const l={origin:"portal-item",portal:n.portal||E.getDefault()};s.read(t,l);const u=r.showLegend;u!=null&&s.read({showLegend:u},l)}return s}async function F(e,a,r){if(e.supportsData===!1)return;const t=e.instance,o=t.portalItem;if(!o)return;let n=null;try{n=await o.fetchData("json",r)}catch{}if(_(t)){let i=null;const s=await W(o,n,a);if((n!=null&&n.layers||n!=null&&n.tables)&&s>0){if(t.layerId==null){const l=M(n);t.layerId=t.type==="subtype-group"?l==null?void 0:l[0]:Q(n)}i=X(n,t),i&&n.showLegend!=null&&(i.showLegend=n.showLegend)}return s>1&&"sublayerTitleMode"in t&&t.sublayerTitleMode!=="service-name"&&(t.sublayerTitleMode="item-title-and-service-name"),i}return n}async function W(e,a,r){var n,i,s,l,u;if(a!=null&&a.layers&&(a!=null&&a.tables))return P(a);const t=$(e.url);if(!t)return 1;const o=await r.fetchServiceMetadata(t.url.path,{customParameters:(n=S(a))==null?void 0:n.customParameters}).catch(()=>null);return(((i=a==null?void 0:a.layers)==null?void 0:i.length)??((s=o==null?void 0:o.layers)==null?void 0:s.length)??0)+(((l=a==null?void 0:a.tables)==null?void 0:l.length)??((u=o==null?void 0:o.tables)==null?void 0:u.length)??0)}function X(e,a){var o,n;const{layerId:r}=a,t=((o=e.layers)==null?void 0:o.find(i=>i.id===r))||((n=e.tables)==null?void 0:n.find(i=>i.id===r));return t&&ee(t,a)?t:null}function _(e){return e.type!=="stream"&&"layerId"in e}function ee(e,a){return!(a.type==="feature"&&"layerType"in e&&e.layerType==="SubtypeGroupLayer"||a.type==="subtype-group"&&!("layerType"in e))}async function te(e,a){const{layersJSON:r}=await j(e,a);if(!r)return null;const t=[...r.layers,...r.tables];return o=>t.find(n=>n.id===o.id)}export{ue as load}; diff --git a/assets/lazyLayerLoader-Cu0XtDD2.js b/assets/lazyLayerLoader-Cu0XtDD2.js new file mode 100644 index 0000000..c316e44 --- /dev/null +++ b/assets/lazyLayerLoader-Cu0XtDD2.js @@ -0,0 +1,7 @@ +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/BingMapsLayer-CPBW-ptl.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css","assets/RefreshableLayer-_r2TPtol.js","assets/imageBitmapUtils-BVxrhFkK.js","assets/BuildingSceneLayer-DAfQRDdR.js","assets/UniqueValueRenderer-7V9Bhr-D.js","assets/ColorStop-DCGjAKLC.js","assets/diffUtils-uUoMDFQS.js","assets/colorRamps-CcakIWlU.js","assets/sizeVariableUtils-Cmcuvw-4.js","assets/visualVariableUtils-BX9G5gNQ.js","assets/jsonUtils-Ox5U0P0F.js","assets/styleUtils-DOUOskVZ.js","assets/jsonUtils-Dw332y6z.js","assets/Version-Dqq_CHBG.js","assets/FieldsIndex-CK-0B5n9.js","assets/UnknownTimeZone-CK7VjgF3.js","assets/OverrideHelper-DxFZBnGL.js","assets/utils-CuXO_Zzq.js","assets/quantizationUtils-CfV316jZ.js","assets/heatmapUtils-BSteZBTj.js","assets/FeatureLayer-BHxNIHhy.js","assets/FormTemplate-BGxtsGX6.js","assets/editsZScale-Bfe6gH1b.js","assets/queryZScale-Dwvn5BlQ.js","assets/FeatureSet-opEn8ou8.js","assets/EditBusLayer-OslMX9fF.js","assets/FeatureEffectLayer-DarO4Ctx.js","assets/FeatureEffect-DBbkrS6j.js","assets/FeatureLayerBase-D0I-Escx.js","assets/featureLayerUtils-lwqyOSrl.js","assets/AttachmentQuery-DmEAIZff.js","assets/RelationshipQuery-BDJrOxaX.js","assets/LayerFloorInfo-DlYNbO-A.js","assets/serviceCapabilitiesUtils-DiP90Uds.js","assets/FeatureReductionLayer-CK-tyM-9.js","assets/FeatureReductionSelection-t3T7oa8H.js","assets/LabelClass-CeatfK8u.js","assets/labelUtils-3p0-m-Ee.js","assets/defaultsJSON-CHAaurhX.js","assets/MD5-C9MwAd2G.js","assets/OrderedLayer-dLoPhxcx.js","assets/OrderByInfo-DKyk5GLW.js","assets/TemporalLayer-CKICYnEl.js","assets/TimeInfo-DooETFWC.js","assets/FeatureTemplate-FZNGA_Ik.js","assets/FeatureType-CwUl8Nf5.js","assets/fieldProperties-DnrQXLBM.js","assets/labelingInfo-DqAUis6e.js","assets/versionUtils-BIAEZzrm.js","assets/styleUtils--I7zqeL6.js","assets/TopFeaturesQuery-CVQjqlfM.js","assets/popupUtils-DlZin22m.js","assets/interfaces-CL2NbQte.js","assets/capabilities-DXGHT-QH.js","assets/SceneService-DbS150xR.js","assets/originUtils-D69mHv66.js","assets/multiOriginJSONSupportUtils-C0wm8_Yw.js","assets/resourceUtils-p9pTIVIi.js","assets/resourceUtils-CfE36DzP.js","assets/saveAPIKeyUtils-YRBbgdzi.js","assets/saveUtils-CGGzyvzv.js","assets/I3SLayerDefinitions-Bc0e5Sgz.js","assets/I3SUtil-Bs1mZiKI.js","assets/mat4f64-CSKppSlJ.js","assets/computeTranslationToOriginAndRotation-BeE3rOSz.js","assets/sphere-F1imyuMS.js","assets/ObjectStack-BAIuPeIh.js","assets/plane-DxOTtTwj.js","assets/mat3f64-q3fE-ZOt.js","assets/quatf64-Bdb9ZJJK.js","assets/I3SBinaryReader-Bg6QQKyW.js","assets/VertexAttribute-BlT9lbVY.js","assets/symbolColorUtils-C9Wp-TPe.js","assets/orientedBoundingBox-sJmHxD3E.js","assets/quat-C0wQB0HB.js","assets/popupUtils-Do2GfZME.js","assets/associatedFeatureServiceUtils-nLeTqfYC.js","assets/elevationInfoUtils-DIYaTlLQ.js","assets/CatalogLayer-4790y54a.js","assets/utils-CY1ReiSd.js","assets/ClassBreaksDefinition-Djcxa8Lp.js","assets/FeatureLayerSource-3cjHhwgM.js","assets/meshVertexSpaceUtils-DwMoblqo.js","assets/MeshLocalVertexSpace-DRvwbFTJ.js","assets/vec3-DdRUbala.js","assets/External-DIoD7Bb4.js","assets/infoFor3D-DsOdlPuA.js","assets/editingSupport-4MwIplWk.js","assets/clientSideDefaults-BQP5n3lX.js","assets/QueryEngineCapabilities-CTDe3LlQ.js","assets/QueryTask-Cl66pG_V.js","assets/executeForIds-CZ3M8IZd.js","assets/query-Bk_ITqRK.js","assets/pbfQueryUtils-CSeFSIjv.js","assets/pbf-Du8sFEWo.js","assets/OptimizedGeometry-CQuTPb9g.js","assets/OptimizedFeatureSet-Blu9Ckm7.js","assets/executeQueryJSON-COxi_Fac.js","assets/executeQueryPBF-DROgTCuZ.js","assets/featureConversionUtils-BHhm7bvm.js","assets/CSVLayer-DfX_NRk3.js","assets/DimensionLayer-CKhQnsO-.js","assets/Analysis-yEzECn2p.js","assets/ElevationLayer-QYZSSLWB.js","assets/GeoJSONLayer-ibYVKi1c.js","assets/GeoRSSLayer-DBDQfWhL.js","assets/GroupLayer-6WnGm0lP.js","assets/ImageryLayer-BuJz_D0q.js","assets/ImageHistogramParameters-DYfx5K-s.js","assets/multidimensionalUtils-u3oUX4w1.js","assets/dataUtils-DzOfgSpi.js","assets/RasterSymbolizer-BN7ge8gb.js","assets/utils-Dx_a2yJw.js","assets/AttachmentInfo-Cm6dhnUr.js","assets/ImageryTileLayer-BEBkov6O.js","assets/RawBlockCache-DNGqU_D7.js","assets/rasterProjectionHelper-CHkyWbma.js","assets/utils-CBTVfSGR.js","assets/IntegratedMeshLayer-D8IB-5_i.js","assets/persistable-3OEDOKAC.js","assets/resourceExtension-CiV172Z4.js","assets/KMLLayer-dXg6eYPC.js","assets/kmlUtils-C6tn6hG1.js","assets/LineOfSightLayer-fNRdYlBe.js","assets/LinkChartLayer-B9wu3mvA.js","assets/geohashUtils-DEscCvdk.js","assets/timeSupport-DXkhlToK.js","assets/json-Wa8cmqdu.js","assets/knowledgeGraphService-yi4prBvu.js","assets/GraphQueryStreaming-BDRIPeal.js","assets/FeatureStore-CRMzrhIt.js","assets/BoundsStore-DRDtG3Mk.js","assets/PooledRBush-BlFOlUgK.js","assets/QueryEngine-loUu1VUW.js","assets/WhereClause-Ctld7DSu.js","assets/TimeOnly-BXSODLxA.js","assets/utils-BKh1cxpi.js","assets/utils-Bzmbfe7p.js","assets/RenderState-DaVlEYWY.js","assets/MapImageLayer-l41pl51g.js","assets/scaleUtils-DWXMiS7R.js","assets/SublayersOwner-CywL6RlY.js","assets/sublayerUtils-GrJ1gnTG.js","assets/ExportImageParameters-CXqmEVur.js","assets/floorFilterUtils-DZ5C6FQv.js","assets/MapNotesLayer-CPjCDXnt.js","assets/GraphicsLayer-g4hVfoZU.js","assets/objectIdUtils-4dd1rf9p.js","assets/MediaLayer-CdtBPk34.js","assets/imageUtils-ChIDAvDr.js","assets/perspectiveUtils-DhC7L1B1.js","assets/normalizeUtilsSync-73yZ0QwV.js","assets/OGCFeatureLayer-_EJqre42.js","assets/ogcFeatureUtils-B_dc0icr.js","assets/geojson-AjfTISUf.js","assets/date-M6n_RqpC.js","assets/sourceUtils-BNTaqxhX.js","assets/OpenStreetMapLayer-BXLAjAfp.js","assets/WebTileLayer-IRzcPxtS.js","assets/OrientedImageryLayer-DxeUAz8W.js","assets/PointCloudLayer-CsBDV7DT.js","assets/PointCloudUniqueValueRenderer-DGqW3DIg.js","assets/RouteLayer-DIjUW0_h.js","assets/Stop-D_lBQff2.js","assets/SceneLayer-DVZLLmFB.js","assets/Mesh--rTzs1p1.js","assets/georeference-DqFdARS7.js","assets/DoubleArray--0pYeNcV.js","assets/BufferView-3om6S_aJ.js","assets/earcut-CWKXDqDj.js","assets/Indices-BRm9v2lM.js","assets/deduplicate-BR6i8Xk0.js","assets/triangle-DmKBscqo.js","assets/Util-CS5u4Lec.js","assets/lineSegment-BYtydnRZ.js","assets/basicInterfaces-GbxEOYtk.js","assets/uploadAssetErrors-DCHo_tDX.js","assets/StreamLayer-CxayZLf7.js","assets/SubtypeGroupLayer-DoVLJ5RR.js","assets/TileLayer-MOTdXvSA.js","assets/IntegratedMesh3DTilesLayer-BxjpzO7W.js","assets/UnknownLayer-BSjgqi4d.js","assets/UnsupportedLayer-CYwmIZG0.js","assets/VoxelLayer-pjuHsY2A.js","assets/WFSLayer-DypvB2tP.js","assets/wfsUtils-p2GOBpZe.js","assets/xmlUtils-CtUoQO7q.js","assets/WMSLayer-5SlLwEaR.js","assets/crsUtils-DAndLU68.js","assets/ExportWMSImageParameters-Bl6JFYua.js","assets/WMTSLayer-DfNOT9ZM.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} +import{M as r,_ as a}from"./index-BjUNJPVf.js";async function o(t,_){const{data:e}=await r(t,{responseType:"json",query:{f:"json",..._==null?void 0:_.customParameters,token:_==null?void 0:_.apiKey}});return e}const u={BingMapsLayer:async()=>(await a(()=>import("./BingMapsLayer-CPBW-ptl.js"),__vite__mapDeps([0,1,2,3,4]))).default,BuildingSceneLayer:async()=>(await a(()=>import("./BuildingSceneLayer-DAfQRDdR.js"),__vite__mapDeps([5,1,2,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,3,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79]))).default,CatalogLayer:async()=>(await a(()=>import("./CatalogLayer-4790y54a.js"),__vite__mapDeps([80,1,2,43,81,82,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,28,29,38,39,40,49,53,83,84,85,86,87,88,89,27,90,91,92,93,94,95,96,97,98,25,99,26,100,101,31,32,33,24,30,34,35,42,3,44,45,48,50]))).default,CSVLayer:async()=>(await a(()=>import("./CSVLayer-DfX_NRk3.js"),__vite__mapDeps([102,1,2,22,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,3,44,45,46,47,48,49,50,51,52,53,54,90,91]))).default,DimensionLayer:async()=>(await a(()=>import("./DimensionLayer-CKhQnsO-.js"),__vite__mapDeps([103,1,2,104]))).default,ElevationLayer:async()=>(await a(()=>import("./ElevationLayer-QYZSSLWB.js"),__vite__mapDeps([105,1,2]))).default,FeatureLayer:async()=>(await a(()=>import("./FeatureLayer-BHxNIHhy.js"),__vite__mapDeps([22,1,2,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,3,44,45,46,47,48,49,50,51,52,53,54]))).default,GeoJSONLayer:async()=>(await a(()=>import("./GeoJSONLayer-ibYVKi1c.js"),__vite__mapDeps([106,1,2,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,90,91,40,26,28,29,36,37,31,32,33,38,39,41,42,43,3,44,45,46,48,49,53]))).default,GeoRSSLayer:async()=>(await a(()=>import("./GeoRSSLayer-DBDQfWhL.js"),__vite__mapDeps([107,1,2,3]))).default,GroupLayer:async()=>(await a(()=>import("./GroupLayer-6WnGm0lP.js"),__vite__mapDeps([108,1,2,54,62]))).default,ImageryLayer:async()=>(await a(()=>import("./ImageryLayer-BuJz_D0q.js"),__vite__mapDeps([109,1,2,110,111,112,6,7,8,9,10,11,12,13,113,114,19,82,26,16,17,4,99,94,95,96,97,98,25,115,32,93,33,52,3,44,45,50,53,54]))).default,ImageryTileLayer:async()=>(await a(()=>import("./ImageryTileLayer-BEBkov6O.js"),__vite__mapDeps([116,1,2,110,111,112,6,7,8,9,10,11,12,13,113,114,19,82,26,117,118,119,3,44,45,53,54]))).default,IntegratedMeshLayer:async()=>(await a(()=>import("./IntegratedMeshLayer-D8IB-5_i.js"),__vite__mapDeps([120,1,2,121,41,58,122,56,57,59,60,61,62,63,79]))).default,KMLLayer:async()=>(await a(()=>import("./KMLLayer-dXg6eYPC.js"),__vite__mapDeps([123,1,2,3,124,14,6,7,8,9,10,11,12,13,15,16,17,18,19,20,21,26]))).default,LineOfSightLayer:async()=>(await a(()=>import("./LineOfSightLayer-fNRdYlBe.js"),__vite__mapDeps([125,1,2,104,121,41,58,122,79]))).default,LinkChartLayer:async()=>(await a(()=>import("./LinkChartLayer-B9wu3mvA.js"),__vite__mapDeps([126,1,2,127,101,97,98,128,129,130,131,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,132,133,134,135,136,137,91,138,139,81,82,140,90,40,48,36,37,31,32,33,38,39,41,3,26,53]))).default,MapImageLayer:async()=>(await a(()=>import("./MapImageLayer-l41pl51g.js"),__vite__mapDeps([141,1,2,142,143,15,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,92,88,93,94,95,96,97,98,25,99,26,100,101,47,46,38,39,40,49,34,35,32,53,144,3,44,45,145,146,4,50]))).default,MapNotesLayer:async()=>(await a(()=>import("./MapNotesLayer-CPjCDXnt.js"),__vite__mapDeps([147,1,2,22,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,3,44,45,46,47,48,49,50,51,52,53,54,148,149]))).default,MediaLayer:async()=>(await a(()=>import("./MediaLayer-CdtBPk34.js"),__vite__mapDeps([150,1,2,151,152,153,70,122,133,134,54]))).default,OGCFeatureLayer:async()=>(await a(()=>import("./OGCFeatureLayer-_EJqre42.js"),__vite__mapDeps([154,1,2,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,155,101,97,98,156,157,90,91,40,158,26,28,29,36,37,31,32,33,38,39,41,42,43,3,44,45,47,46,48,49,53]))).default,OpenStreetMapLayer:async()=>(await a(()=>import("./OpenStreetMapLayer-BXLAjAfp.js"),__vite__mapDeps([159,1,2,160,3,4]))).default,OrientedImageryLayer:async()=>(await a(()=>import("./OrientedImageryLayer-DxeUAz8W.js"),__vite__mapDeps([161,1,2,22,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,3,44,45,46,47,48,49,50,51,52,53,54]))).default,PointCloudLayer:async()=>(await a(()=>import("./PointCloudLayer-CsBDV7DT.js"),__vite__mapDeps([162,1,2,56,57,58,59,60,61,62,48,16,17,163,7,79,53]))).default,RouteLayer:async()=>(await a(()=>import("./RouteLayer-DIjUW0_h.js"),__vite__mapDeps([164,1,2,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,57,58,165,26]))).default,SceneLayer:async()=>(await a(()=>import("./SceneLayer-DVZLLmFB.js"),__vite__mapDeps([166,1,2,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,167,168,70,65,66,169,76,71,84,85,86,170,151,171,172,173,69,174,175,68,176,177,73,87,88,178,27,56,57,58,59,60,61,62,55,45,78,31,32,33,37,48,63,38,39,40,49,34,121,41,122,51,79,53,64,67,72,74,75,77]))).default,StreamLayer:async()=>(await a(()=>import("./StreamLayer-CxayZLf7.js"),__vite__mapDeps([179,1,2,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,28,29,36,37,31,32,33,38,39,40,41,3,44,45,48,49,51,53,54]))).default,SubtypeGroupLayer:async()=>(await a(()=>import("./SubtypeGroupLayer-DoVLJ5RR.js"),__vite__mapDeps([180,1,2,27,30,31,14,6,7,8,9,10,11,12,13,15,16,17,18,19,20,21,32,33,34,35,3,44,45,48,23,46,38,39,40,49,53,50,54]))).default,TileLayer:async()=>(await a(()=>import("./TileLayer-MOTdXvSA.js"),__vite__mapDeps([181,1,2,143,15,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,92,88,93,94,95,96,97,98,25,99,26,100,101,47,46,38,39,40,49,34,35,32,53,144,3,4]))).default,IntegratedMesh3DTilesLayer:async()=>(await a(()=>import("./IntegratedMesh3DTilesLayer-BxjpzO7W.js"),__vite__mapDeps([182,1,2,79]))).default,UnknownLayer:async()=>(await a(()=>import("./UnknownLayer-BSjgqi4d.js"),__vite__mapDeps([183,1,2]))).default,UnsupportedLayer:async()=>(await a(()=>import("./UnsupportedLayer-CYwmIZG0.js"),__vite__mapDeps([184,1,2]))).default,VectorTileLayer:async()=>(await a(()=>import("./index-BjUNJPVf.js").then(t=>t.nc),__vite__mapDeps([1,2]))).default,VoxelLayer:async()=>(await a(()=>import("./VoxelLayer-pjuHsY2A.js"),__vite__mapDeps([185,1,2,56,57,58,59,60,61,62,121,41,122,76,70,71,53]))).default,WFSLayer:async()=>(await a(()=>import("./WFSLayer-DypvB2tP.js"),__vite__mapDeps([186,1,2,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,90,91,40,187,156,157,97,188,26,28,29,36,37,31,32,33,38,39,41,42,43,3,44,45,48,49,53]))).default,WMSLayer:async()=>(await a(()=>import("./WMSLayer-5SlLwEaR.js"),__vite__mapDeps([189,1,2,142,3,44,45,190,191,4]))).default,WMTSLayer:async()=>(await a(()=>import("./WMTSLayer-DfNOT9ZM.js"),__vite__mapDeps([192,1,2,160,3,4,190,188]))).default,WebTileLayer:async()=>(await a(()=>import("./WebTileLayer-IRzcPxtS.js").then(t=>t.W),__vite__mapDeps([160,1,2,3,4]))).default};export{u as a,o as t}; diff --git a/assets/lazyLayerLoader-s-GqbiwM.js b/assets/lazyLayerLoader-s-GqbiwM.js deleted file mode 100644 index 0f0cb64..0000000 --- a/assets/lazyLayerLoader-s-GqbiwM.js +++ /dev/null @@ -1,7 +0,0 @@ -function __vite__mapDeps(indexes) { - if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/BingMapsLayer-CvxOjLC9.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css","assets/RefreshableLayer-1EkEhJeI.js","assets/imageBitmapUtils-C0nKXf5P.js","assets/BuildingSceneLayer-Bhih74F5.js","assets/UniqueValueRenderer-BlkUix3g.js","assets/ColorStop-44hBlQ14.js","assets/diffUtils-B4YFa5Ju.js","assets/colorRamps-BJydlf0f.js","assets/sizeVariableUtils-Cmcuvw-4.js","assets/visualVariableUtils-z2k12BH8.js","assets/jsonUtils-qYmXvGJ1.js","assets/styleUtils-CnV_Xzhi.js","assets/jsonUtils-BseLl1fZ.js","assets/Version-Bd0QsIQ5.js","assets/FieldsIndex-CLgRNeJ_.js","assets/UnknownTimeZone-DF0BqWCR.js","assets/OverrideHelper-B4ryGWZb.js","assets/utils-p-5Bbga5.js","assets/quantizationUtils-CUjGHrU3.js","assets/heatmapUtils-Clt5rJzr.js","assets/FeatureLayer-D0kMrROG.js","assets/FormTemplate-eV18QveB.js","assets/editsZScale-CQCGPEjO.js","assets/queryZScale-DN4aFXYn.js","assets/FeatureSet-CYJUZgOk.js","assets/EditBusLayer-SG7oYwiY.js","assets/FeatureEffectLayer-CLTrRFqx.js","assets/FeatureEffect-ByrbZlne.js","assets/FeatureLayerBase-DPJuwFpX.js","assets/featureLayerUtils-BhDaw8pS.js","assets/AttachmentQuery-D61mmWw4.js","assets/RelationshipQuery-DDK72Kwc.js","assets/LayerFloorInfo-Cdq3ulNh.js","assets/serviceCapabilitiesUtils-t8SL4e_j.js","assets/FeatureReductionLayer-DncGsNIN.js","assets/FeatureReductionSelection-BY3KVXac.js","assets/LabelClass-6cZokw8y.js","assets/labelUtils-Dnqx6jl5.js","assets/defaultsJSON-CHAaurhX.js","assets/MD5-C9MwAd2G.js","assets/OrderedLayer-Do089KpQ.js","assets/OrderByInfo-DKzv2-WS.js","assets/TemporalLayer-qq3v_i3q.js","assets/TimeInfo-3TVmpFSA.js","assets/FeatureTemplate-DcprAdTM.js","assets/FeatureType-By3BEr9z.js","assets/fieldProperties-DMs4wT6-.js","assets/labelingInfo-CijajRsc.js","assets/versionUtils-CaceEUVY.js","assets/styleUtils-B_Iy1DTk.js","assets/TopFeaturesQuery-B8kC7n5h.js","assets/popupUtils-DAFYyAvw.js","assets/interfaces-CL2NbQte.js","assets/capabilities-BQHqqlJu.js","assets/SceneService-l5OfqT0E.js","assets/originUtils-D69mHv66.js","assets/multiOriginJSONSupportUtils-C0wm8_Yw.js","assets/resourceUtils-Cu1-5qu3.js","assets/resourceUtils-CjqYbm2Q.js","assets/saveAPIKeyUtils-BiX1lQSW.js","assets/saveUtils-BzCRy3uR.js","assets/I3SLayerDefinitions-B6gGfNoh.js","assets/I3SUtil-DxFIPSkh.js","assets/mat4f64-CSKppSlJ.js","assets/computeTranslationToOriginAndRotation-DOOKw0d1.js","assets/sphere-DHd2K2LR.js","assets/ObjectStack-CF0cQvd2.js","assets/plane-py4f_JCU.js","assets/mat3f64-q3fE-ZOt.js","assets/quatf64-Bdb9ZJJK.js","assets/I3SBinaryReader-N_Is4gxa.js","assets/VertexAttribute-BlT9lbVY.js","assets/symbolColorUtils-D_minlYz.js","assets/orientedBoundingBox-BQdJNYvE.js","assets/quat-CoKEr4Zu.js","assets/popupUtils-BovqErR_.js","assets/associatedFeatureServiceUtils-BIEHgyxo.js","assets/elevationInfoUtils-Dag_mzct.js","assets/CatalogLayer-BLgHCc1c.js","assets/utils-GMt8_G3w.js","assets/ClassBreaksDefinition-D281x8Sj.js","assets/FeatureLayerSource-BeuGtrZI.js","assets/meshVertexSpaceUtils-BFWpJFSd.js","assets/MeshLocalVertexSpace-Cltwu1Kq.js","assets/vec3-CjYmIfaa.js","assets/External-DC51KyR4.js","assets/infoFor3D-DsOdlPuA.js","assets/editingSupport-DWTRjmy9.js","assets/clientSideDefaults-CgRgH99f.js","assets/QueryEngineCapabilities-CTDe3LlQ.js","assets/QueryTask-CjHwD7wL.js","assets/executeForIds-BjeEaIen.js","assets/query-BM8R3sQ6.js","assets/pbfQueryUtils-CLRSFGBm.js","assets/pbf-D9QZb8S8.js","assets/OptimizedGeometry-CQuTPb9g.js","assets/OptimizedFeatureSet-Blu9Ckm7.js","assets/executeQueryJSON-DngjHRnE.js","assets/executeQueryPBF-BYY2Ipuh.js","assets/featureConversionUtils-CmP9mw0r.js","assets/CSVLayer-BGm6RUOY.js","assets/DimensionLayer-CS8-5O4l.js","assets/Analysis-DeH3QoWt.js","assets/ElevationLayer-D3CeIkQP.js","assets/GeoJSONLayer-BEhPE7YN.js","assets/GeoRSSLayer-8bgy1uXP.js","assets/GroupLayer-BGdGYmtj.js","assets/ImageryLayer-Dz6vNBYB.js","assets/ImageHistogramParameters-CsWWZYhj.js","assets/multidimensionalUtils-uKyVhR8j.js","assets/dataUtils-BFJflGP5.js","assets/RasterSymbolizer-D7OwkKeP.js","assets/utils-kx2f2Fff.js","assets/AttachmentInfo-DEdzaB9S.js","assets/ImageryTileLayer-B8fBMD3Z.js","assets/RawBlockCache-D9cjIDVu.js","assets/rasterProjectionHelper-Bwvi37wQ.js","assets/utils-CMvkNhle.js","assets/IntegratedMeshLayer-DkCYLSWg.js","assets/persistable-uPSrwVmW.js","assets/resourceExtension-orEjzZQo.js","assets/KMLLayer-D6CvdHt0.js","assets/kmlUtils-Dl7cXNEs.js","assets/LineOfSightLayer-CjQ9MBRQ.js","assets/LinkChartLayer-BS3nw-u_.js","assets/geohashUtils-CTQSvgbV.js","assets/timeSupport-BjRbXIpn.js","assets/json-Wa8cmqdu.js","assets/knowledgeGraphService-pVNmnapY.js","assets/GraphQueryStreaming-ofadKoJ9.js","assets/FeatureStore-CqSz6SOQ.js","assets/BoundsStore-DMoG4U0L.js","assets/PooledRBush-BsFBmw1o.js","assets/QueryEngine-RpcY23Sv.js","assets/WhereClause-Dzgyc0wk.js","assets/TimeOnly-Cm47ew5I.js","assets/utils-B8iadP2F.js","assets/utils-SjO_-1JL.js","assets/RenderState-DaVlEYWY.js","assets/MapImageLayer-DqX26yH_.js","assets/scaleUtils-Bqauo1zZ.js","assets/SublayersOwner-CJjJUh6G.js","assets/sublayerUtils-BPYHHPMV.js","assets/ExportImageParameters-DVsh-7G1.js","assets/floorFilterUtils-DZ5C6FQv.js","assets/MapNotesLayer-BXf_uYaT.js","assets/GraphicsLayer-CexPXXFK.js","assets/objectIdUtils-4dd1rf9p.js","assets/MediaLayer-DrFcRt_9.js","assets/imageUtils-DNanu5Rn.js","assets/perspectiveUtils-24oy2YlR.js","assets/normalizeUtilsSync-B6VufdiX.js","assets/OGCFeatureLayer-BfwwYuSp.js","assets/ogcFeatureUtils-D4df60hh.js","assets/geojson-BLwRz6JF.js","assets/date-M6n_RqpC.js","assets/sourceUtils-QX9lwl5p.js","assets/OpenStreetMapLayer-BmVWZwKB.js","assets/WebTileLayer-D3HPOkPd.js","assets/OrientedImageryLayer-Cb-G1CjI.js","assets/PointCloudLayer-ClQsf0Mo.js","assets/PointCloudUniqueValueRenderer-CdXEaMW5.js","assets/RouteLayer-Ba4tA3kd.js","assets/Stop-VHT4QwcG.js","assets/SceneLayer-DiSvX6ty.js","assets/Mesh-9oOqPmbT.js","assets/georeference-DtjTZVKi.js","assets/DoubleArray-DxyNBrRi.js","assets/BufferView-Ao_K-5Vg.js","assets/earcut-hRlx3adE.js","assets/Indices-Dv-cCjFT.js","assets/deduplicate-Bk22TunD.js","assets/triangle-CU37cZF1.js","assets/Util-BS8sJGjF.js","assets/lineSegment-B9UF3nEF.js","assets/basicInterfaces-GbxEOYtk.js","assets/uploadAssetErrors-D_dYSFa_.js","assets/StreamLayer-BoGXecN6.js","assets/SubtypeGroupLayer-DOR5l1_M.js","assets/TileLayer-CULgL3B_.js","assets/IntegratedMesh3DTilesLayer-DO6ACvdE.js","assets/UnknownLayer-BeNlyNrR.js","assets/UnsupportedLayer-bFwEkP2I.js","assets/VoxelLayer-C6oRPxv0.js","assets/WFSLayer-B8MZMVqa.js","assets/wfsUtils-DeNqsSXH.js","assets/xmlUtils-CtUoQO7q.js","assets/WMSLayer-CBKAceAl.js","assets/crsUtils-DAndLU68.js","assets/ExportWMSImageParameters-D7gw-oIo.js","assets/WMTSLayer-B_E4A-J6.js"] - } - return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) -} -import{M as r,_ as a}from"./index-CEWggaxV.js";async function o(t,_){const{data:e}=await r(t,{responseType:"json",query:{f:"json",..._==null?void 0:_.customParameters,token:_==null?void 0:_.apiKey}});return e}const u={BingMapsLayer:async()=>(await a(()=>import("./BingMapsLayer-CvxOjLC9.js"),__vite__mapDeps([0,1,2,3,4]))).default,BuildingSceneLayer:async()=>(await a(()=>import("./BuildingSceneLayer-Bhih74F5.js"),__vite__mapDeps([5,1,2,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,3,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79]))).default,CatalogLayer:async()=>(await a(()=>import("./CatalogLayer-BLgHCc1c.js"),__vite__mapDeps([80,1,2,43,81,82,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,28,29,38,39,40,49,53,83,84,85,86,87,88,89,27,90,91,92,93,94,95,96,97,98,25,99,26,100,101,31,32,33,24,30,34,35,42,3,44,45,48,50]))).default,CSVLayer:async()=>(await a(()=>import("./CSVLayer-BGm6RUOY.js"),__vite__mapDeps([102,1,2,22,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,3,44,45,46,47,48,49,50,51,52,53,54,90,91]))).default,DimensionLayer:async()=>(await a(()=>import("./DimensionLayer-CS8-5O4l.js"),__vite__mapDeps([103,1,2,104]))).default,ElevationLayer:async()=>(await a(()=>import("./ElevationLayer-D3CeIkQP.js"),__vite__mapDeps([105,1,2]))).default,FeatureLayer:async()=>(await a(()=>import("./FeatureLayer-D0kMrROG.js"),__vite__mapDeps([22,1,2,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,3,44,45,46,47,48,49,50,51,52,53,54]))).default,GeoJSONLayer:async()=>(await a(()=>import("./GeoJSONLayer-BEhPE7YN.js"),__vite__mapDeps([106,1,2,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,90,91,40,26,28,29,36,37,31,32,33,38,39,41,42,43,3,44,45,46,48,49,53]))).default,GeoRSSLayer:async()=>(await a(()=>import("./GeoRSSLayer-8bgy1uXP.js"),__vite__mapDeps([107,1,2,3]))).default,GroupLayer:async()=>(await a(()=>import("./GroupLayer-BGdGYmtj.js"),__vite__mapDeps([108,1,2,54,62]))).default,ImageryLayer:async()=>(await a(()=>import("./ImageryLayer-Dz6vNBYB.js"),__vite__mapDeps([109,1,2,110,111,112,6,7,8,9,10,11,12,13,113,114,19,82,26,16,17,4,99,94,95,96,97,98,25,115,32,93,33,52,3,44,45,50,53,54]))).default,ImageryTileLayer:async()=>(await a(()=>import("./ImageryTileLayer-B8fBMD3Z.js"),__vite__mapDeps([116,1,2,110,111,112,6,7,8,9,10,11,12,13,113,114,19,82,26,117,118,119,3,44,45,53,54]))).default,IntegratedMeshLayer:async()=>(await a(()=>import("./IntegratedMeshLayer-DkCYLSWg.js"),__vite__mapDeps([120,1,2,121,41,58,122,56,57,59,60,61,62,63,79]))).default,KMLLayer:async()=>(await a(()=>import("./KMLLayer-D6CvdHt0.js"),__vite__mapDeps([123,1,2,3,124,14,6,7,8,9,10,11,12,13,15,16,17,18,19,20,21,26]))).default,LineOfSightLayer:async()=>(await a(()=>import("./LineOfSightLayer-CjQ9MBRQ.js"),__vite__mapDeps([125,1,2,104,121,41,58,122,79]))).default,LinkChartLayer:async()=>(await a(()=>import("./LinkChartLayer-BS3nw-u_.js"),__vite__mapDeps([126,1,2,127,101,97,98,128,129,130,131,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,132,133,134,135,136,137,91,138,139,81,82,140,90,40,48,36,37,31,32,33,38,39,41,3,26,53]))).default,MapImageLayer:async()=>(await a(()=>import("./MapImageLayer-DqX26yH_.js"),__vite__mapDeps([141,1,2,142,143,15,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,92,88,93,94,95,96,97,98,25,99,26,100,101,47,46,38,39,40,49,34,35,32,53,144,3,44,45,145,146,4,50]))).default,MapNotesLayer:async()=>(await a(()=>import("./MapNotesLayer-BXf_uYaT.js"),__vite__mapDeps([147,1,2,22,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,3,44,45,46,47,48,49,50,51,52,53,54,148,149]))).default,MediaLayer:async()=>(await a(()=>import("./MediaLayer-DrFcRt_9.js"),__vite__mapDeps([150,1,2,151,152,153,70,122,133,134,54]))).default,OGCFeatureLayer:async()=>(await a(()=>import("./OGCFeatureLayer-BfwwYuSp.js"),__vite__mapDeps([154,1,2,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,155,101,97,98,156,157,90,91,40,158,26,28,29,36,37,31,32,33,38,39,41,42,43,3,44,45,47,46,48,49,53]))).default,OpenStreetMapLayer:async()=>(await a(()=>import("./OpenStreetMapLayer-BmVWZwKB.js"),__vite__mapDeps([159,1,2,160,3,4]))).default,OrientedImageryLayer:async()=>(await a(()=>import("./OrientedImageryLayer-Cb-G1CjI.js"),__vite__mapDeps([161,1,2,22,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,3,44,45,46,47,48,49,50,51,52,53,54]))).default,PointCloudLayer:async()=>(await a(()=>import("./PointCloudLayer-ClQsf0Mo.js"),__vite__mapDeps([162,1,2,56,57,58,59,60,61,62,48,16,17,163,7,79,53]))).default,RouteLayer:async()=>(await a(()=>import("./RouteLayer-Ba4tA3kd.js"),__vite__mapDeps([164,1,2,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,57,58,165,26]))).default,SceneLayer:async()=>(await a(()=>import("./SceneLayer-DiSvX6ty.js"),__vite__mapDeps([166,1,2,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,167,168,70,65,66,169,76,71,84,85,86,170,151,171,172,173,69,174,175,68,176,177,73,87,88,178,27,56,57,58,59,60,61,62,55,45,78,31,32,33,37,48,63,38,39,40,49,34,121,41,122,51,79,53,64,67,72,74,75,77]))).default,StreamLayer:async()=>(await a(()=>import("./StreamLayer-BoGXecN6.js"),__vite__mapDeps([179,1,2,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,28,29,36,37,31,32,33,38,39,40,41,3,44,45,48,49,51,53,54]))).default,SubtypeGroupLayer:async()=>(await a(()=>import("./SubtypeGroupLayer-DOR5l1_M.js"),__vite__mapDeps([180,1,2,27,30,31,14,6,7,8,9,10,11,12,13,15,16,17,18,19,20,21,32,33,34,35,3,44,45,48,23,46,38,39,40,49,53,50,54]))).default,TileLayer:async()=>(await a(()=>import("./TileLayer-CULgL3B_.js"),__vite__mapDeps([181,1,2,143,15,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,92,88,93,94,95,96,97,98,25,99,26,100,101,47,46,38,39,40,49,34,35,32,53,144,3,4]))).default,IntegratedMesh3DTilesLayer:async()=>(await a(()=>import("./IntegratedMesh3DTilesLayer-DO6ACvdE.js"),__vite__mapDeps([182,1,2,79]))).default,UnknownLayer:async()=>(await a(()=>import("./UnknownLayer-BeNlyNrR.js"),__vite__mapDeps([183,1,2]))).default,UnsupportedLayer:async()=>(await a(()=>import("./UnsupportedLayer-bFwEkP2I.js"),__vite__mapDeps([184,1,2]))).default,VectorTileLayer:async()=>(await a(()=>import("./index-CEWggaxV.js").then(t=>t.nc),__vite__mapDeps([1,2]))).default,VoxelLayer:async()=>(await a(()=>import("./VoxelLayer-C6oRPxv0.js"),__vite__mapDeps([185,1,2,56,57,58,59,60,61,62,121,41,122,76,70,71,53]))).default,WFSLayer:async()=>(await a(()=>import("./WFSLayer-B8MZMVqa.js"),__vite__mapDeps([186,1,2,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,90,91,40,187,156,157,97,188,26,28,29,36,37,31,32,33,38,39,41,42,43,3,44,45,48,49,53]))).default,WMSLayer:async()=>(await a(()=>import("./WMSLayer-CBKAceAl.js"),__vite__mapDeps([189,1,2,142,3,44,45,190,191,4]))).default,WMTSLayer:async()=>(await a(()=>import("./WMTSLayer-B_E4A-J6.js"),__vite__mapDeps([192,1,2,160,3,4,190,188]))).default,WebTileLayer:async()=>(await a(()=>import("./WebTileLayer-D3HPOkPd.js").then(t=>t.W),__vite__mapDeps([160,1,2,3,4]))).default};export{u as a,o as t}; diff --git a/assets/lclayout-BGy-0MYF.js b/assets/lclayout-QKV44p2z.js similarity index 99% rename from assets/lclayout-BGy-0MYF.js rename to assets/lclayout-QKV44p2z.js index a58705d..5788feb 100644 --- a/assets/lclayout-BGy-0MYF.js +++ b/assets/lclayout-QKV44p2z.js @@ -1,3 +1,3 @@ -import{ar as Ct}from"./index-CEWggaxV.js";var Nr,q,Jr,Zr={exports:{}};Nr=Zr,q=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,typeof __filename<"u"&&(q=q||__filename),Jr=function(fr={}){var dr,L,i=fr;i.ready=new Promise((r,e)=>{dr=r,L=e});var nr,G,X,hr=Object.assign({},i),ar="./this.program",pr=typeof window=="object",k=typeof importScripts=="function",mr=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",E="";function Kr(r){return i.locateFile?i.locateFile(r,E):E+r}if(mr){var vr=require("fs"),ir=require("path");E=k?ir.dirname(E)+"/":__dirname+"/",nr=(r,e)=>(r=Z(r)?new URL(r):ir.normalize(r),vr.readFileSync(r,e?void 0:"utf8")),X=r=>{var e=nr(r,!0);return e.buffer||(e=new Uint8Array(e)),e},G=(r,e,t,n=!0)=>{r=Z(r)?new URL(r):ir.normalize(r),vr.readFile(r,n?void 0:"utf8",(a,o)=>{a?t(a):e(n?o.buffer:o)})},!i.thisProgram&&process.argv.length>1&&(ar=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),i.inspect=()=>"[Emscripten Module object]"}else(pr||k)&&(k?E=self.location.href:typeof document<"u"&&document.currentScript&&(E=document.currentScript.src),q&&(E=q),E=E.indexOf("blob:")!==0?E.substr(0,E.replace(/[?#].*/,"").lastIndexOf("/")+1):"",nr=r=>{var e=new XMLHttpRequest;return e.open("GET",r,!1),e.send(null),e.responseText},k&&(X=r=>{var e=new XMLHttpRequest;return e.open("GET",r,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),G=(r,e,t)=>{var n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="arraybuffer",n.onload=()=>{n.status==200||n.status==0&&n.response?e(n.response):t()},n.onerror=t,n.send(null)});i.print||console.log.bind(console);var U,N,H=i.printErr||console.error.bind(console);Object.assign(i,hr),hr=null,i.arguments&&i.arguments,i.thisProgram&&(ar=i.thisProgram),i.quit&&i.quit,i.wasmBinary&&(U=i.wasmBinary),i.noExitRuntime,typeof WebAssembly!="object"&&or("no native wasm support detected");var S,y,I,J,g,p,gr,yr,wr=!1;function _r(){var r=N.buffer;i.HEAP8=S=new Int8Array(r),i.HEAP16=I=new Int16Array(r),i.HEAPU8=y=new Uint8Array(r),i.HEAPU16=J=new Uint16Array(r),i.HEAP32=g=new Int32Array(r),i.HEAPU32=p=new Uint32Array(r),i.HEAPF32=gr=new Float32Array(r),i.HEAPF64=yr=new Float64Array(r)}var br=[],Ar=[],Tr=[];function Qr(){if(i.preRun)for(typeof i.preRun=="function"&&(i.preRun=[i.preRun]);i.preRun.length;)te(i.preRun.shift());ur(br)}function re(){ur(Ar)}function ee(){if(i.postRun)for(typeof i.postRun=="function"&&(i.postRun=[i.postRun]);i.postRun.length;)ae(i.postRun.shift());ur(Tr)}function te(r){br.unshift(r)}function ne(r){Ar.unshift(r)}function ae(r){Tr.unshift(r)}var O=0,Y=null;function ie(r){O++,i.monitorRunDependencies&&i.monitorRunDependencies(O)}function oe(r){if(O--,i.monitorRunDependencies&&i.monitorRunDependencies(O),O==0&&Y){var e=Y;Y=null,e()}}function or(r){i.onAbort&&i.onAbort(r),H(r="Aborted("+r+")"),wr=!0,r+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(r);throw L(e),e}var z,ue="data:application/octet-stream;base64,";function Cr(r){return r.startsWith(ue)}function Z(r){return r.startsWith("file://")}function Er(r){if(r==z&&U)return new Uint8Array(U);if(X)return X(r);throw"both async and sync fetching of the wasm failed"}function se(r){if(!U&&(pr||k)){if(typeof fetch=="function"&&!Z(r))return fetch(r,{credentials:"same-origin"}).then(e=>{if(!e.ok)throw"failed to load wasm binary file at '"+r+"'";return e.arrayBuffer()}).catch(()=>Er(r));if(G)return new Promise((e,t)=>{G(r,n=>e(new Uint8Array(n)),t)})}return Promise.resolve().then(()=>Er(r))}function Fr(r,e,t){return se(r).then(n=>WebAssembly.instantiate(n,e)).then(n=>n).then(t,n=>{H(`failed to asynchronously prepare wasm: ${n}`),or(n)})}function le(r,e,t,n){return r||typeof WebAssembly.instantiateStreaming!="function"||Cr(e)||Z(e)||mr||typeof fetch!="function"?Fr(e,t,n):fetch(e,{credentials:"same-origin"}).then(a=>WebAssembly.instantiateStreaming(a,t).then(n,function(o){return H(`wasm streaming compile failed: ${o}`),H("falling back to ArrayBuffer instantiation"),Fr(e,t,n)}))}function ce(){var r={a:At};function e(n,a){return w=n.exports,N=w.w,_r(),$r=w.y,ne(w.x),oe(),w}function t(n){e(n.instance)}if(ie(),i.instantiateWasm)try{return i.instantiateWasm(r,e)}catch(n){H(`Module.instantiateWasm callback failed with error: ${n}`),L(n)}return le(U,z,r,t).catch(L),{}}Cr(z="lclayout.wasm")||(z=Kr(z));var ur=r=>{for(;r.length>0;)r.shift()(i)};function fe(r){this.excPtr=r,this.ptr=r-24,this.set_type=function(e){p[this.ptr+4>>2]=e},this.get_type=function(){return p[this.ptr+4>>2]},this.set_destructor=function(e){p[this.ptr+8>>2]=e},this.get_destructor=function(){return p[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,S[this.ptr+12>>0]=e},this.get_caught=function(){return S[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,S[this.ptr+13>>0]=e},this.get_rethrown=function(){return S[this.ptr+13>>0]!=0},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)},this.set_adjusted_ptr=function(e){p[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return p[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Gr(this.get_type()))return p[this.excPtr>>2];var e=this.get_adjusted_ptr();return e!==0?e:this.excPtr}}var Pr,Sr,Wr,de=(r,e,t)=>{throw new fe(r).init(e,t),r},he=(r,e,t,n,a)=>{},pe=()=>{for(var r=new Array(256),e=0;e<256;++e)r[e]=String.fromCharCode(e);Pr=r},T=r=>{for(var e="",t=r;y[t];)e+=Pr[y[t++]];return e},$={},x={},K={},C=r=>{throw new Sr(r)},Mr=r=>{throw new Wr(r)},jr=(r,e,t)=>{function n(l){var c=t(l);c.length!==r.length&&Mr("Mismatched type converter count");for(var f=0;f{x.hasOwnProperty(l)?a[c]=x[l]:(o.push(l),$.hasOwnProperty(l)||($[l]=[]),$[l].push(()=>{a[c]=x[l],++s===o.length&&n(a)}))}),o.length===0&&n(a)};function me(r,e,t={}){var n=e.name;if(r||C(`type "${n}" must have a positive integer typeid pointer`),x.hasOwnProperty(r)){if(t.ignoreDuplicateRegistrations)return;C(`Cannot register type '${n}' twice`)}if(x[r]=e,delete K[r],$.hasOwnProperty(r)){var a=$[r];delete $[r],a.forEach(o=>o())}}function W(r,e,t={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");return me(r,e,t)}var D=8,ve=(r,e,t,n)=>{W(r,{name:e=T(e),fromWireType:function(a){return!!a},toWireType:function(a,o){return o?t:n},argPackAdvance:D,readValueFromPointer:function(a){return this.fromWireType(y[a])},destructorFunction:null})},ge=(r,e,t)=>{r=T(r),jr([],[e],function(n){return n=n[0],i[r]=n.fromWireType(t),[]})};function ye(){Object.assign(Rr.prototype,{get(r){return this.allocated[r]},has(r){return this.allocated[r]!==void 0},allocate(r){var e=this.freelist.pop()||this.allocated.length;return this.allocated[e]=r,e},free(r){this.allocated[r]=void 0,this.freelist.push(r)}})}function Rr(){this.allocated=[void 0],this.freelist=[]}var F=new Rr,we=r=>{r>=F.reserved&&--F.get(r).refcount==0&&F.free(r)},_e=()=>{for(var r=0,e=F.reserved;e{F.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),F.reserved=F.allocated.length,i.count_emval_handles=_e},Or={toValue:r=>(r||C("Cannot use deleted val. handle = "+r),F.get(r).value),toHandle:r=>{switch(r){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return F.allocate({refcount:1,value:r})}}};function Dr(r){return this.fromWireType(g[r>>2])}var Ae=(r,e)=>{W(r,{name:e=T(e),fromWireType:t=>{var n=Or.toValue(t);return we(t),n},toWireType:(t,n)=>Or.toHandle(n),argPackAdvance:D,readValueFromPointer:Dr,destructorFunction:null})},Te=(r,e)=>{switch(e){case 4:return function(t){return this.fromWireType(gr[t>>2])};case 8:return function(t){return this.fromWireType(yr[t>>3])};default:throw new TypeError(`invalid float width (${e}): ${r}`)}},Ce=(r,e,t)=>{W(r,{name:e=T(e),fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:D,readValueFromPointer:Te(e,t),destructorFunction:null})},Ee=48,Fe=57,Pe=r=>{if(r===void 0)return"_unknown";var e=(r=r.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return e>=Ee&&e<=Fe?`_${r}`:r},Se=r=>{for(;r.length;){var e=r.pop();r.pop()(e)}};function We(r,e,t,n,a,o){var s=e.length;s<2&&C("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var l=e[1]!==null&&t!==null,c=!1,f=1;f{if(r[e].overloadTable===void 0){var n=r[e];r[e]=function(){return r[e].overloadTable.hasOwnProperty(arguments.length)||C(`Function '${t}' called with an invalid number of arguments (${arguments.length}) - expects one of (${r[e].overloadTable})!`),r[e].overloadTable[arguments.length].apply(this,arguments)},r[e].overloadTable=[],r[e].overloadTable[n.argCount]=n}},je=(r,e,t)=>{i.hasOwnProperty(r)?((t===void 0||i[r].overloadTable!==void 0&&i[r].overloadTable[t]!==void 0)&&C(`Cannot register public name '${r}' twice`),Me(i,r,r),i.hasOwnProperty(t)&&C(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),i[r].overloadTable[t]=e):(i[r]=e,t!==void 0&&(i[r].numArguments=t))},Re=(r,e)=>{for(var t=[],n=0;n>2]);return t},Oe=(r,e,t)=>{i.hasOwnProperty(r)||Mr("Replacing nonexistant public symbol"),i[r].overloadTable!==void 0&&t!==void 0?i[r].overloadTable[t]=e:(i[r]=e,i[r].argCount=t)},De=(r,e,t)=>{var n=i["dynCall_"+r];return t&&t.length?n.apply(null,[e].concat(t)):n.call(null,e)},Q=[],xr=r=>{var e=Q[r];return e||(r>=Q.length&&(Q.length=r+1),Q[r]=e=$r.get(r)),e},$e=(r,e,t)=>r.includes("j")?De(r,e,t):xr(e).apply(null,t),xe=(r,e)=>{var t=[];return function(){return t.length=0,Object.assign(t,arguments),$e(r,e,t)}},ke=(r,e)=>{function t(){return r.includes("j")?xe(r,e):xr(e)}r=T(r);var n=t();return typeof n!="function"&&C(`unknown function pointer with signature ${r}: ${e}`),n};function Ue(r,e){return{[r=Pe(r)]:function(){return e.apply(this,arguments)}}[r]}var kr,He=(r,e)=>{var t=Ue(e,function(n){this.name=e,this.message=n;var a=new Error(n).stack;a!==void 0&&(this.stack=this.toString()+` +import{ar as Ct}from"./index-BjUNJPVf.js";var Nr,q,Jr,Zr={exports:{}};Nr=Zr,q=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,typeof __filename<"u"&&(q=q||__filename),Jr=function(fr={}){var dr,L,i=fr;i.ready=new Promise((r,e)=>{dr=r,L=e});var nr,G,X,hr=Object.assign({},i),ar="./this.program",pr=typeof window=="object",k=typeof importScripts=="function",mr=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",E="";function Kr(r){return i.locateFile?i.locateFile(r,E):E+r}if(mr){var vr=require("fs"),ir=require("path");E=k?ir.dirname(E)+"/":__dirname+"/",nr=(r,e)=>(r=Z(r)?new URL(r):ir.normalize(r),vr.readFileSync(r,e?void 0:"utf8")),X=r=>{var e=nr(r,!0);return e.buffer||(e=new Uint8Array(e)),e},G=(r,e,t,n=!0)=>{r=Z(r)?new URL(r):ir.normalize(r),vr.readFile(r,n?void 0:"utf8",(a,o)=>{a?t(a):e(n?o.buffer:o)})},!i.thisProgram&&process.argv.length>1&&(ar=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),i.inspect=()=>"[Emscripten Module object]"}else(pr||k)&&(k?E=self.location.href:typeof document<"u"&&document.currentScript&&(E=document.currentScript.src),q&&(E=q),E=E.indexOf("blob:")!==0?E.substr(0,E.replace(/[?#].*/,"").lastIndexOf("/")+1):"",nr=r=>{var e=new XMLHttpRequest;return e.open("GET",r,!1),e.send(null),e.responseText},k&&(X=r=>{var e=new XMLHttpRequest;return e.open("GET",r,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),G=(r,e,t)=>{var n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="arraybuffer",n.onload=()=>{n.status==200||n.status==0&&n.response?e(n.response):t()},n.onerror=t,n.send(null)});i.print||console.log.bind(console);var U,N,H=i.printErr||console.error.bind(console);Object.assign(i,hr),hr=null,i.arguments&&i.arguments,i.thisProgram&&(ar=i.thisProgram),i.quit&&i.quit,i.wasmBinary&&(U=i.wasmBinary),i.noExitRuntime,typeof WebAssembly!="object"&&or("no native wasm support detected");var S,y,I,J,g,p,gr,yr,wr=!1;function _r(){var r=N.buffer;i.HEAP8=S=new Int8Array(r),i.HEAP16=I=new Int16Array(r),i.HEAPU8=y=new Uint8Array(r),i.HEAPU16=J=new Uint16Array(r),i.HEAP32=g=new Int32Array(r),i.HEAPU32=p=new Uint32Array(r),i.HEAPF32=gr=new Float32Array(r),i.HEAPF64=yr=new Float64Array(r)}var br=[],Ar=[],Tr=[];function Qr(){if(i.preRun)for(typeof i.preRun=="function"&&(i.preRun=[i.preRun]);i.preRun.length;)te(i.preRun.shift());ur(br)}function re(){ur(Ar)}function ee(){if(i.postRun)for(typeof i.postRun=="function"&&(i.postRun=[i.postRun]);i.postRun.length;)ae(i.postRun.shift());ur(Tr)}function te(r){br.unshift(r)}function ne(r){Ar.unshift(r)}function ae(r){Tr.unshift(r)}var O=0,Y=null;function ie(r){O++,i.monitorRunDependencies&&i.monitorRunDependencies(O)}function oe(r){if(O--,i.monitorRunDependencies&&i.monitorRunDependencies(O),O==0&&Y){var e=Y;Y=null,e()}}function or(r){i.onAbort&&i.onAbort(r),H(r="Aborted("+r+")"),wr=!0,r+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(r);throw L(e),e}var z,ue="data:application/octet-stream;base64,";function Cr(r){return r.startsWith(ue)}function Z(r){return r.startsWith("file://")}function Er(r){if(r==z&&U)return new Uint8Array(U);if(X)return X(r);throw"both async and sync fetching of the wasm failed"}function se(r){if(!U&&(pr||k)){if(typeof fetch=="function"&&!Z(r))return fetch(r,{credentials:"same-origin"}).then(e=>{if(!e.ok)throw"failed to load wasm binary file at '"+r+"'";return e.arrayBuffer()}).catch(()=>Er(r));if(G)return new Promise((e,t)=>{G(r,n=>e(new Uint8Array(n)),t)})}return Promise.resolve().then(()=>Er(r))}function Fr(r,e,t){return se(r).then(n=>WebAssembly.instantiate(n,e)).then(n=>n).then(t,n=>{H(`failed to asynchronously prepare wasm: ${n}`),or(n)})}function le(r,e,t,n){return r||typeof WebAssembly.instantiateStreaming!="function"||Cr(e)||Z(e)||mr||typeof fetch!="function"?Fr(e,t,n):fetch(e,{credentials:"same-origin"}).then(a=>WebAssembly.instantiateStreaming(a,t).then(n,function(o){return H(`wasm streaming compile failed: ${o}`),H("falling back to ArrayBuffer instantiation"),Fr(e,t,n)}))}function ce(){var r={a:At};function e(n,a){return w=n.exports,N=w.w,_r(),$r=w.y,ne(w.x),oe(),w}function t(n){e(n.instance)}if(ie(),i.instantiateWasm)try{return i.instantiateWasm(r,e)}catch(n){H(`Module.instantiateWasm callback failed with error: ${n}`),L(n)}return le(U,z,r,t).catch(L),{}}Cr(z="lclayout.wasm")||(z=Kr(z));var ur=r=>{for(;r.length>0;)r.shift()(i)};function fe(r){this.excPtr=r,this.ptr=r-24,this.set_type=function(e){p[this.ptr+4>>2]=e},this.get_type=function(){return p[this.ptr+4>>2]},this.set_destructor=function(e){p[this.ptr+8>>2]=e},this.get_destructor=function(){return p[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,S[this.ptr+12>>0]=e},this.get_caught=function(){return S[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,S[this.ptr+13>>0]=e},this.get_rethrown=function(){return S[this.ptr+13>>0]!=0},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)},this.set_adjusted_ptr=function(e){p[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return p[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Gr(this.get_type()))return p[this.excPtr>>2];var e=this.get_adjusted_ptr();return e!==0?e:this.excPtr}}var Pr,Sr,Wr,de=(r,e,t)=>{throw new fe(r).init(e,t),r},he=(r,e,t,n,a)=>{},pe=()=>{for(var r=new Array(256),e=0;e<256;++e)r[e]=String.fromCharCode(e);Pr=r},T=r=>{for(var e="",t=r;y[t];)e+=Pr[y[t++]];return e},$={},x={},K={},C=r=>{throw new Sr(r)},Mr=r=>{throw new Wr(r)},jr=(r,e,t)=>{function n(l){var c=t(l);c.length!==r.length&&Mr("Mismatched type converter count");for(var f=0;f{x.hasOwnProperty(l)?a[c]=x[l]:(o.push(l),$.hasOwnProperty(l)||($[l]=[]),$[l].push(()=>{a[c]=x[l],++s===o.length&&n(a)}))}),o.length===0&&n(a)};function me(r,e,t={}){var n=e.name;if(r||C(`type "${n}" must have a positive integer typeid pointer`),x.hasOwnProperty(r)){if(t.ignoreDuplicateRegistrations)return;C(`Cannot register type '${n}' twice`)}if(x[r]=e,delete K[r],$.hasOwnProperty(r)){var a=$[r];delete $[r],a.forEach(o=>o())}}function W(r,e,t={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");return me(r,e,t)}var D=8,ve=(r,e,t,n)=>{W(r,{name:e=T(e),fromWireType:function(a){return!!a},toWireType:function(a,o){return o?t:n},argPackAdvance:D,readValueFromPointer:function(a){return this.fromWireType(y[a])},destructorFunction:null})},ge=(r,e,t)=>{r=T(r),jr([],[e],function(n){return n=n[0],i[r]=n.fromWireType(t),[]})};function ye(){Object.assign(Rr.prototype,{get(r){return this.allocated[r]},has(r){return this.allocated[r]!==void 0},allocate(r){var e=this.freelist.pop()||this.allocated.length;return this.allocated[e]=r,e},free(r){this.allocated[r]=void 0,this.freelist.push(r)}})}function Rr(){this.allocated=[void 0],this.freelist=[]}var F=new Rr,we=r=>{r>=F.reserved&&--F.get(r).refcount==0&&F.free(r)},_e=()=>{for(var r=0,e=F.reserved;e{F.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),F.reserved=F.allocated.length,i.count_emval_handles=_e},Or={toValue:r=>(r||C("Cannot use deleted val. handle = "+r),F.get(r).value),toHandle:r=>{switch(r){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return F.allocate({refcount:1,value:r})}}};function Dr(r){return this.fromWireType(g[r>>2])}var Ae=(r,e)=>{W(r,{name:e=T(e),fromWireType:t=>{var n=Or.toValue(t);return we(t),n},toWireType:(t,n)=>Or.toHandle(n),argPackAdvance:D,readValueFromPointer:Dr,destructorFunction:null})},Te=(r,e)=>{switch(e){case 4:return function(t){return this.fromWireType(gr[t>>2])};case 8:return function(t){return this.fromWireType(yr[t>>3])};default:throw new TypeError(`invalid float width (${e}): ${r}`)}},Ce=(r,e,t)=>{W(r,{name:e=T(e),fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:D,readValueFromPointer:Te(e,t),destructorFunction:null})},Ee=48,Fe=57,Pe=r=>{if(r===void 0)return"_unknown";var e=(r=r.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return e>=Ee&&e<=Fe?`_${r}`:r},Se=r=>{for(;r.length;){var e=r.pop();r.pop()(e)}};function We(r,e,t,n,a,o){var s=e.length;s<2&&C("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var l=e[1]!==null&&t!==null,c=!1,f=1;f{if(r[e].overloadTable===void 0){var n=r[e];r[e]=function(){return r[e].overloadTable.hasOwnProperty(arguments.length)||C(`Function '${t}' called with an invalid number of arguments (${arguments.length}) - expects one of (${r[e].overloadTable})!`),r[e].overloadTable[arguments.length].apply(this,arguments)},r[e].overloadTable=[],r[e].overloadTable[n.argCount]=n}},je=(r,e,t)=>{i.hasOwnProperty(r)?((t===void 0||i[r].overloadTable!==void 0&&i[r].overloadTable[t]!==void 0)&&C(`Cannot register public name '${r}' twice`),Me(i,r,r),i.hasOwnProperty(t)&&C(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),i[r].overloadTable[t]=e):(i[r]=e,t!==void 0&&(i[r].numArguments=t))},Re=(r,e)=>{for(var t=[],n=0;n>2]);return t},Oe=(r,e,t)=>{i.hasOwnProperty(r)||Mr("Replacing nonexistant public symbol"),i[r].overloadTable!==void 0&&t!==void 0?i[r].overloadTable[t]=e:(i[r]=e,i[r].argCount=t)},De=(r,e,t)=>{var n=i["dynCall_"+r];return t&&t.length?n.apply(null,[e].concat(t)):n.call(null,e)},Q=[],xr=r=>{var e=Q[r];return e||(r>=Q.length&&(Q.length=r+1),Q[r]=e=$r.get(r)),e},$e=(r,e,t)=>r.includes("j")?De(r,e,t):xr(e).apply(null,t),xe=(r,e)=>{var t=[];return function(){return t.length=0,Object.assign(t,arguments),$e(r,e,t)}},ke=(r,e)=>{function t(){return r.includes("j")?xe(r,e):xr(e)}r=T(r);var n=t();return typeof n!="function"&&C(`unknown function pointer with signature ${r}: ${e}`),n};function Ue(r,e){return{[r=Pe(r)]:function(){return e.apply(this,arguments)}}[r]}var kr,He=(r,e)=>{var t=Ue(e,function(n){this.name=e,this.message=n;var a=new Error(n).stack;a!==void 0&&(this.stack=this.toString()+` `+a.replace(/^Error(:[^\n]*)?\n/,""))});return t.prototype=Object.create(r.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},t},Ie=r=>{var e=Lr(r),t=T(e);return M(e),t},Ye=(r,e)=>{var t=[],n={};function a(o){n[o]||x[o]||(K[o]?K[o].forEach(a):(t.push(o),n[o]=!0))}throw e.forEach(a),new kr(`${r}: `+t.map(Ie).join([", "]))},ze=(r,e,t,n,a,o,s)=>{var l=Re(e,t);r=T(r),a=ke(n,a),je(r,function(){Ye(`Cannot call ${r} due to unbound types`,l)},e-1),jr([],l,function(c){var f=[c[0],null].concat(c.slice(1));return Oe(r,We(r,f,null,a,o),e-1),[]})},Ve=(r,e,t)=>{switch(e){case 1:return t?n=>S[n>>0]:n=>y[n>>0];case 2:return t?n=>I[n>>1]:n=>J[n>>1];case 4:return t?n=>g[n>>2]:n=>p[n>>2];default:throw new TypeError(`invalid integer width (${e}): ${r}`)}},Be=(r,e,t,n,a)=>{e=T(e);var o=f=>f;if(n===0){var s=32-8*t;o=f=>f<>>s}var l=e.includes("unsigned"),c=(f,h)=>{};W(r,{name:e,fromWireType:o,toWireType:l?function(f,h){return c(h,this.name),h>>>0}:function(f,h){return c(h,this.name),h},argPackAdvance:D,readValueFromPointer:Ve(e,t,n!==0),destructorFunction:null})},qe=(r,e,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];function a(o){var s=p[o>>2],l=p[o+4>>2];return new n(S.buffer,l,s)}W(r,{name:t=T(t),fromWireType:a,argPackAdvance:D,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})};function Le(r){return this.fromWireType(p[r>>2])}var Ur,Hr=(r,e,t,n)=>{if(!(n>0))return 0;for(var a=t,o=t+n-1,s=0;s=55296&&l<=57343&&(l=65536+((1023&l)<<10)|1023&r.charCodeAt(++s)),l<=127){if(t>=o)break;e[t++]=l}else if(l<=2047){if(t+1>=o)break;e[t++]=192|l>>6,e[t++]=128|63&l}else if(l<=65535){if(t+2>=o)break;e[t++]=224|l>>12,e[t++]=128|l>>6&63,e[t++]=128|63&l}else{if(t+3>=o)break;e[t++]=240|l>>18,e[t++]=128|l>>12&63,e[t++]=128|l>>6&63,e[t++]=128|63&l}}return e[t]=0,t-a},Ge=(r,e,t)=>Hr(r,y,e,t),Ir=r=>{for(var e=0,t=0;t=55296&&n<=57343?(e+=4,++t):e+=3}return e},Yr=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,Xe=(r,e,t)=>{for(var n=e+t,a=e;r[a]&&!(a>=n);)++a;if(a-e>16&&r.buffer&&Yr)return Yr.decode(r.subarray(e,a));for(var o="";e>10,56320|1023&f)}}else o+=String.fromCharCode((31&s)<<6|l)}else o+=String.fromCharCode(s)}return o},sr=(r,e)=>r?Xe(y,r,e):"",Ne=(r,e)=>{var t=(e=T(e))==="std::string";W(r,{name:e,fromWireType(n){var a,o=p[n>>2],s=n+4;if(t)for(var l=s,c=0;c<=o;++c){var f=s+c;if(c==o||y[f]==0){var h=sr(l,f-l);a===void 0?a=h:(a+="\0",a+=h),l=f+1}}else{var v=new Array(o);for(c=0;c>2]=o,t&&s)Ge(a,c,o+1);else if(s)for(var f=0;f255&&(M(c),C("String has UTF-16 code units that do not fit in 8 bits")),y[c+f]=h}else for(f=0;f{for(var t=r,n=t>>1,a=n+e/2;!(n>=a)&&J[n];)++n;if((t=n<<1)-r>32&&zr)return zr.decode(y.subarray(r,t));for(var o="",s=0;!(s>=e/2);++s){var l=I[r+2*s>>1];if(l==0)break;o+=String.fromCharCode(l)}return o},Ze=(r,e,t)=>{if(t===void 0&&(t=2147483647),t<2)return 0;for(var n=e,a=(t-=2)<2*r.length?t/2:r.length,o=0;o>1]=s,e+=2}return I[e>>1]=0,e-n},Ke=r=>2*r.length,Qe=(r,e)=>{for(var t=0,n="";!(t>=e/4);){var a=g[r+4*t>>2];if(a==0)break;if(++t,a>=65536){var o=a-65536;n+=String.fromCharCode(55296|o>>10,56320|1023&o)}else n+=String.fromCharCode(a)}return n},rt=(r,e,t)=>{if(t===void 0&&(t=2147483647),t<4)return 0;for(var n=e,a=n+t-4,o=0;o=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&r.charCodeAt(++o)),g[e>>2]=s,(e+=4)+4>a)break}return g[e>>2]=0,e-n},et=r=>{for(var e=0,t=0;t=55296&&n<=57343&&++t,e+=4}return e},tt=(r,e,t)=>{var n,a,o,s,l;t=T(t),e===2?(n=Je,a=Ze,s=Ke,o=()=>J,l=1):e===4&&(n=Qe,a=rt,s=et,o=()=>p,l=2),W(r,{name:t,fromWireType:c=>{for(var f,h=p[c>>2],v=o(),m=c+4,A=0;A<=h;++A){var P=c+4+A*e;if(A==h||v[P>>l]==0){var j=n(m,P-m);f===void 0?f=j:(f+="\0",f+=j),m=P+e}}return M(c),f},toWireType:(c,f)=>{typeof f!="string"&&C(`Cannot pass non-string to C++ string type ${t}`);var h=s(f),v=cr(4+h+e);return p[v>>2]=h>>l,a(f,v+4,h+e),c!==null&&c.push(M,v),v},argPackAdvance:D,readValueFromPointer:Dr,destructorFunction(c){M(c)}})},nt=(r,e)=>{W(r,{isVoid:!0,name:e=T(e),argPackAdvance:0,fromWireType:()=>{},toWireType:(t,n)=>{}})},at=!0,it=()=>at,ot=()=>{or("")},ut=()=>Date.now(),Vr=()=>2147483648,st=()=>Vr();Ur=()=>performance.now();var lt=(r,e,t)=>y.copyWithin(r,e,e+t),ct=r=>{var e=(r-N.buffer.byteLength+65535)/65536;try{return N.grow(e),_r(),1}catch{}},ft=r=>{var e=y.length;r>>>=0;var t=Vr();if(r>t)return!1;for(var n=(l,c)=>l+(c-l%c)%c,a=1;a<=4;a*=2){var o=e*(1+.2/a);o=Math.min(o,r+100663296);var s=Math.min(t,n(Math.max(r,o),65536));if(ct(s))return!0}return!1},lr={},dt=()=>ar||"./this.program",V=()=>{if(!V.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:dt()};for(var e in lr)lr[e]===void 0?delete r[e]:r[e]=lr[e];var t=[];for(var e in r)t.push(`${e}=${r[e]}`);V.strings=t}return V.strings},ht=(r,e)=>{for(var t=0;t>0]=r.charCodeAt(t);S[e>>0]=0},pt=(r,e)=>{var t=0;return V().forEach((n,a)=>{var o=e+t;p[r+4*a>>2]=o,ht(n,o),t+=n.length+1}),0},mt=(r,e)=>{var t=V();p[r>>2]=t.length;var n=0;return t.forEach(a=>n+=a.length+1),p[e>>2]=n,0},rr=r=>r%4==0&&(r%100!=0||r%400==0),vt=(r,e)=>{for(var t=0,n=0;n<=e;t+=r[n++]);return t},Br=[31,29,31,30,31,30,31,31,30,31,30,31],qr=[31,28,31,30,31,30,31,31,30,31,30,31],gt=(r,e)=>{for(var t=new Date(r.getTime());e>0;){var n=rr(t.getFullYear()),a=t.getMonth(),o=(n?Br:qr)[a];if(!(e>o-t.getDate()))return t.setDate(t.getDate()+e),t;e-=o-t.getDate()+1,t.setDate(1),a<11?t.setMonth(a+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return t};function yt(r,e,t){var n=t>0?t:Ir(r)+1,a=new Array(n),o=Hr(r,a,0,a.length);return e&&(a.length=o),a}var wt=(r,e)=>{S.set(r,e)},_t=(r,e,t,n)=>{var a=p[n+40>>2],o={tm_sec:g[n>>2],tm_min:g[n+4>>2],tm_hour:g[n+8>>2],tm_mday:g[n+12>>2],tm_mon:g[n+16>>2],tm_year:g[n+20>>2],tm_wday:g[n+24>>2],tm_yday:g[n+28>>2],tm_isdst:g[n+32>>2],tm_gmtoff:g[n+36>>2],tm_zone:a?sr(a):""},s=sr(t),l={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var c in l)s=s.replace(new RegExp(c,"g"),l[c]);var f=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],h=["January","February","March","April","May","June","July","August","September","October","November","December"];function v(u,d,_){for(var b=typeof u=="number"?u.toString():u||"";b.length0?1:0}var b;return(b=_(u.getFullYear()-d.getFullYear()))===0&&(b=_(u.getMonth()-d.getMonth()))===0&&(b=_(u.getDate()-d.getDate())),b}function P(u){switch(u.getDay()){case 0:return new Date(u.getFullYear()-1,11,29);case 1:return u;case 2:return new Date(u.getFullYear(),0,3);case 3:return new Date(u.getFullYear(),0,2);case 4:return new Date(u.getFullYear(),0,1);case 5:return new Date(u.getFullYear()-1,11,31);case 6:return new Date(u.getFullYear()-1,11,30)}}function j(u){var d=gt(new Date(u.tm_year+1900,0,1),u.tm_yday),_=new Date(d.getFullYear(),0,4),b=new Date(d.getFullYear()+1,0,4),tr=P(_),Tt=P(b);return A(tr,d)<=0?A(Tt,d)<=0?d.getFullYear()+1:d.getFullYear():d.getFullYear()-1}var R={"%a":u=>f[u.tm_wday].substring(0,3),"%A":u=>f[u.tm_wday],"%b":u=>h[u.tm_mon].substring(0,3),"%B":u=>h[u.tm_mon],"%C":u=>m((u.tm_year+1900)/100|0,2),"%d":u=>m(u.tm_mday,2),"%e":u=>v(u.tm_mday,2," "),"%g":u=>j(u).toString().substring(2),"%G":u=>j(u),"%H":u=>m(u.tm_hour,2),"%I":u=>{var d=u.tm_hour;return d==0?d=12:d>12&&(d-=12),m(d,2)},"%j":u=>m(u.tm_mday+vt(rr(u.tm_year+1900)?Br:qr,u.tm_mon-1),3),"%m":u=>m(u.tm_mon+1,2),"%M":u=>m(u.tm_min,2),"%n":()=>` `,"%p":u=>u.tm_hour>=0&&u.tm_hour<12?"AM":"PM","%S":u=>m(u.tm_sec,2),"%t":()=>" ","%u":u=>u.tm_wday||7,"%U":u=>{var d=u.tm_yday+7-u.tm_wday;return m(Math.floor(d/7),2)},"%V":u=>{var d=Math.floor((u.tm_yday+7-(u.tm_wday+6)%7)/7);if((u.tm_wday+371-u.tm_yday-2)%7<=2&&d++,d){if(d==53){var _=(u.tm_wday+371-u.tm_yday)%7;_==4||_==3&&rr(u.tm_year)||(d=1)}}else{d=52;var b=(u.tm_wday+7-u.tm_yday-1)%7;(b==4||b==5&&rr(u.tm_year%400-1))&&d++}return m(d,2)},"%w":u=>u.tm_wday,"%W":u=>{var d=u.tm_yday+7-(u.tm_wday+6)%7;return m(Math.floor(d/7),2)},"%y":u=>(u.tm_year+1900).toString().substring(2),"%Y":u=>u.tm_year+1900,"%z":u=>{var d=u.tm_gmtoff,_=d>=0;return d=(d=Math.abs(d)/60)/60*100+d%60,(_?"+":"-")+("0000"+d).slice(-4)},"%Z":u=>u.tm_zone,"%%":()=>"%"};for(var c in s=s.replace(/%%/g,"\0\0"),R)s.includes(c)&&(s=s.replace(new RegExp(c,"g"),R[c](o)));var B=yt(s=s.replace(/\0\0/g,"%"),!1);return B.length>e?0:(wt(B,r),B.length-1)},bt=(r,e,t,n,a)=>_t(r,e,t,n);pe(),Sr=i.BindingError=class extends Error{constructor(r){super(r),this.name="BindingError"}},Wr=i.InternalError=class extends Error{constructor(r){super(r),this.name="InternalError"}},ye(),be(),kr=i.UnboundTypeError=He(Error,"UnboundTypeError");var At={a:de,m:he,k:ve,i:ge,j:Ae,h:Ce,b:ze,d:Be,c:qe,g:Ne,e:tt,l:nt,r:it,f:ot,s:ut,n:st,u:Ur,v:lt,t:ft,p:pt,q:mt,o:bt},w=ce(),Lr=r=>(Lr=w.z)(r);i.__embind_initialize_bindings=()=>(i.__embind_initialize_bindings=w.A)();var er,cr=i._malloc=r=>(cr=i._malloc=w.B)(r),M=i._free=r=>(M=i._free=w.C)(r),Gr=r=>(Gr=w.D)(r);function Xr(){function r(){er||(er=!0,i.calledRun=!0,wr||(re(),dr(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),ee()))}O>0||(Qr(),O>0||(i.setStatus?(i.setStatus("Running..."),setTimeout(function(){setTimeout(function(){i.setStatus("")},1),r()},1)):r()))}if(i.dynCall_viijii=(r,e,t,n,a,o,s)=>(i.dynCall_viijii=w.E)(r,e,t,n,a,o,s),i.dynCall_iiiiij=(r,e,t,n,a,o,s)=>(i.dynCall_iiiiij=w.F)(r,e,t,n,a,o,s),i.dynCall_iiiiijj=(r,e,t,n,a,o,s,l,c)=>(i.dynCall_iiiiijj=w.G)(r,e,t,n,a,o,s,l,c),i.dynCall_iiiiiijj=(r,e,t,n,a,o,s,l,c,f)=>(i.dynCall_iiiiiijj=w.H)(r,e,t,n,a,o,s,l,c,f),Y=function r(){er||Xr(),er||(Y=r)},i.preInit)for(typeof i.preInit=="function"&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return Xr(),fr.ready},Nr.exports=Jr;const Et=Ct(Zr.exports),Pt=Object.freeze(Object.defineProperty({__proto__:null,default:Et},Symbol.toStringTag,{value:"Module"}));export{Pt as l}; diff --git a/assets/lerc-wasm-IbDLBMkK.js b/assets/lerc-wasm-lV1hYBlU.js similarity index 99% rename from assets/lerc-wasm-IbDLBMkK.js rename to assets/lerc-wasm-lV1hYBlU.js index 68a73fb..7c496a9 100644 --- a/assets/lerc-wasm-IbDLBMkK.js +++ b/assets/lerc-wasm-lV1hYBlU.js @@ -1 +1 @@ -import{ar as jn}from"./index-CEWggaxV.js";var en,w,tn,rn={exports:{}};en=rn,w=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,typeof __filename<"u"&&(w=w||__filename),tn=function(t){var U,I;(t=(t=t||{})!==void 0?t:{}).ready=new Promise(function(n,e){U=n,I=e});var P,b,A,j,R,T,q=Object.assign({},t),C=typeof window=="object",d=typeof importScripts=="function",F=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",c="";function on(n){return t.locateFile?t.locateFile(n,c):c+n}F?(c=d?require("path").dirname(c)+"/":__dirname+"/",T=()=>{R||(j=require("fs"),R=require("path"))},P=function(n,e){return T(),n=R.normalize(n),j.readFileSync(n,e?void 0:"utf8")},A=n=>{var e=P(n,!0);return e.buffer||(e=new Uint8Array(e)),e},b=(n,e,r)=>{T(),n=R.normalize(n),j.readFile(n,function(o,s){o?r(o):e(s.buffer)})},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",function(n){if(!(n instanceof Pn))throw n}),process.on("unhandledRejection",function(n){throw n}),t.inspect=function(){return"[Emscripten Module object]"}):(C||d)&&(d?c=self.location.href:typeof document<"u"&&document.currentScript&&(c=document.currentScript.src),w&&(c=w),c=c.indexOf("blob:")!==0?c.substr(0,c.replace(/[?#].*/,"").lastIndexOf("/")+1):"",P=n=>{var e=new XMLHttpRequest;return e.open("GET",n,!1),e.send(null),e.responseText},d&&(A=n=>{var e=new XMLHttpRequest;return e.open("GET",n,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),b=(n,e,r)=>{var o=new XMLHttpRequest;o.open("GET",n,!0),o.responseType="arraybuffer",o.onload=()=>{o.status==200||o.status==0&&o.response?e(o.response):r()},o.onerror=r,o.send(null)}),t.print||console.log.bind(console);var m,H,_=t.printErr||console.warn.bind(console);Object.assign(t,q),q=null,t.arguments&&t.arguments,t.thisProgram&&t.thisProgram,t.quit&&t.quit,t.wasmBinary&&(m=t.wasmBinary),t.noExitRuntime,typeof WebAssembly!="object"&&v("no native wasm support detected");var O,y,x,h,p,B,k=!1,z=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function un(n,e,r){for(var o=e+r,s=e;n[s]&&!(s>=o);)++s;if(s-e>16&&n.buffer&&z)return z.decode(n.subarray(e,s));for(var u="";e>10,56320|1023&nn)}}else u+=String.fromCharCode((31&i)<<6|f)}else u+=String.fromCharCode(i)}return u}function M(n,e){return n?un(x,n,e):""}function L(n){O=n,t.HEAP8=y=new Int8Array(n),t.HEAP16=new Int16Array(n),t.HEAP32=h=new Int32Array(n),t.HEAPU8=x=new Uint8Array(n),t.HEAPU16=new Uint16Array(n),t.HEAPU32=p=new Uint32Array(n),t.HEAPF32=new Float32Array(n),t.HEAPF64=new Float64Array(n)}t.INITIAL_MEMORY;var G=[],X=[],N=[];function sn(){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)fn(t.preRun.shift());W(G)}function an(){W(X)}function cn(){if(t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)ln(t.postRun.shift());W(N)}function fn(n){G.unshift(n)}function pn(n){X.unshift(n)}function ln(n){N.unshift(n)}var l=0,g=null;function hn(n){l++,t.monitorRunDependencies&&t.monitorRunDependencies(l)}function dn(n){if(l--,t.monitorRunDependencies&&t.monitorRunDependencies(l),l==0&&g){var e=g;g=null,e()}}function v(n){t.onAbort&&t.onAbort(n),_(n="Aborted("+n+")"),k=!0,n+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(n);throw I(e),e}var a,mn="data:application/octet-stream;base64,";function Y(n){return n.startsWith(mn)}function $(n){return n.startsWith("file://")}function J(n){try{if(n==a&&m)return new Uint8Array(m);if(A)return A(n);throw"both async and sync fetching of the wasm failed"}catch(e){v(e)}}function _n(){if(!m&&(C||d)){if(typeof fetch=="function"&&!$(a))return fetch(a,{credentials:"same-origin"}).then(function(n){if(!n.ok)throw"failed to load wasm binary file at '"+a+"'";return n.arrayBuffer()}).catch(function(){return J(a)});if(b)return new Promise(function(n,e){b(a,function(r){n(new Uint8Array(r))},e)})}return Promise.resolve().then(function(){return J(a)})}function yn(){var n={a:In};function e(u,i){var f=u.exports;t.asm=f,L((H=t.asm.g).buffer),B=t.asm.m,pn(t.asm.h),dn()}function r(u){e(u.instance)}function o(u){return _n().then(function(i){return WebAssembly.instantiate(i,n)}).then(function(i){return i}).then(u,function(i){_("failed to asynchronously prepare wasm: "+i),v(i)})}function s(){return m||typeof WebAssembly.instantiateStreaming!="function"||Y(a)||$(a)||F||typeof fetch!="function"?o(r):fetch(a,{credentials:"same-origin"}).then(function(u){return WebAssembly.instantiateStreaming(u,n).then(r,function(i){return _("wasm streaming compile failed: "+i),_("falling back to ArrayBuffer instantiation"),o(r)})})}if(hn(),t.instantiateWasm)try{return t.instantiateWasm(n,e)}catch(u){return _("Module.instantiateWasm callback failed with error: "+u),!1}return s().catch(I),{}}function W(n){for(;n.length>0;){var e=n.shift();if(typeof e!="function"){var r=e.func;typeof r=="number"?e.arg===void 0?K(r)():K(r)(e.arg):r(e.arg===void 0?null:e.arg)}else e(t)}}Y(a="lerc-wasm.wasm")||(a=on(a));var S=[];function K(n){var e=S[n];return e||(n>=S.length&&(S.length=n+1),S[n]=e=B.get(n)),e}function gn(n,e,r,o){v("Assertion failed: "+M(n)+", at: "+[e?M(e):"unknown filename",r,o?M(o):"unknown function"])}function vn(n){return Q(n+24)+24}function wn(n){this.excPtr=n,this.ptr=n-24,this.set_type=function(e){p[this.ptr+4>>2]=e},this.get_type=function(){return p[this.ptr+4>>2]},this.set_destructor=function(e){p[this.ptr+8>>2]=e},this.get_destructor=function(){return p[this.ptr+8>>2]},this.set_refcount=function(e){h[this.ptr>>2]=e},this.set_caught=function(e){e=e?1:0,y[this.ptr+12>>0]=e},this.get_caught=function(){return y[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,y[this.ptr+13>>0]=e},this.get_rethrown=function(){return y[this.ptr+13>>0]!=0},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=h[this.ptr>>2];h[this.ptr>>2]=e+1},this.release_ref=function(){var e=h[this.ptr>>2];return h[this.ptr>>2]=e-1,e===1},this.set_adjusted_ptr=function(e){p[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return p[this.ptr+16>>2]},this.get_exception_ptr=function(){if(V(this.get_type()))return p[this.excPtr>>2];var e=this.get_adjusted_ptr();return e!==0?e:this.excPtr}}function bn(n,e,r){throw new wn(n).init(e,r),n}function An(){v("")}function Rn(n,e,r){x.copyWithin(n,e,e+r)}function xn(){return 2147483648}function Sn(n){try{return H.grow(n-O.byteLength+65535>>>16),L(H.buffer),1}catch{}}function En(n){var e=x.length;n>>>=0;var r=xn();if(n>r)return!1;let o=(i,f)=>i+(f-i%f)%f;for(var s=1;s<=4;s*=2){var u=e*(1+.2/s);if(u=Math.min(u,n+100663296),Sn(Math.min(r,o(Math.max(n,u),65536))))return!0}return!1}var In={a:gn,c:vn,b:bn,d:An,f:Rn,e:En};yn(),t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.h).apply(null,arguments)},t._lerc_getBlobInfo=function(){return(t._lerc_getBlobInfo=t.asm.i).apply(null,arguments)},t._lerc_getDataRanges=function(){return(t._lerc_getDataRanges=t.asm.j).apply(null,arguments)},t._lerc_decode=function(){return(t._lerc_decode=t.asm.k).apply(null,arguments)},t._lerc_decode_4D=function(){return(t._lerc_decode_4D=t.asm.l).apply(null,arguments)};var Q=t._malloc=function(){return(Q=t._malloc=t.asm.n).apply(null,arguments)};t._free=function(){return(t._free=t.asm.o).apply(null,arguments)};var E,V=t.___cxa_is_pointer_type=function(){return(V=t.___cxa_is_pointer_type=t.asm.p).apply(null,arguments)};function Pn(n){this.name="ExitStatus",this.message="Program terminated with exit("+n+")",this.status=n}function D(n){function e(){E||(E=!0,t.calledRun=!0,k||(an(),U(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),cn()))}l>0||(sn(),l>0||(t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),e()},1)):e()))}if(g=function n(){E||D(),E||(g=n)},t.run=D,t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();return D(),t.ready},en.exports=tn;const Tn=jn(rn.exports),Mn=Object.freeze(Object.defineProperty({__proto__:null,default:Tn},Symbol.toStringTag,{value:"Module"}));export{Mn as l}; +import{ar as jn}from"./index-BjUNJPVf.js";var en,w,tn,rn={exports:{}};en=rn,w=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,typeof __filename<"u"&&(w=w||__filename),tn=function(t){var U,I;(t=(t=t||{})!==void 0?t:{}).ready=new Promise(function(n,e){U=n,I=e});var P,b,A,j,R,T,q=Object.assign({},t),C=typeof window=="object",d=typeof importScripts=="function",F=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",c="";function on(n){return t.locateFile?t.locateFile(n,c):c+n}F?(c=d?require("path").dirname(c)+"/":__dirname+"/",T=()=>{R||(j=require("fs"),R=require("path"))},P=function(n,e){return T(),n=R.normalize(n),j.readFileSync(n,e?void 0:"utf8")},A=n=>{var e=P(n,!0);return e.buffer||(e=new Uint8Array(e)),e},b=(n,e,r)=>{T(),n=R.normalize(n),j.readFile(n,function(o,s){o?r(o):e(s.buffer)})},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",function(n){if(!(n instanceof Pn))throw n}),process.on("unhandledRejection",function(n){throw n}),t.inspect=function(){return"[Emscripten Module object]"}):(C||d)&&(d?c=self.location.href:typeof document<"u"&&document.currentScript&&(c=document.currentScript.src),w&&(c=w),c=c.indexOf("blob:")!==0?c.substr(0,c.replace(/[?#].*/,"").lastIndexOf("/")+1):"",P=n=>{var e=new XMLHttpRequest;return e.open("GET",n,!1),e.send(null),e.responseText},d&&(A=n=>{var e=new XMLHttpRequest;return e.open("GET",n,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),b=(n,e,r)=>{var o=new XMLHttpRequest;o.open("GET",n,!0),o.responseType="arraybuffer",o.onload=()=>{o.status==200||o.status==0&&o.response?e(o.response):r()},o.onerror=r,o.send(null)}),t.print||console.log.bind(console);var m,H,_=t.printErr||console.warn.bind(console);Object.assign(t,q),q=null,t.arguments&&t.arguments,t.thisProgram&&t.thisProgram,t.quit&&t.quit,t.wasmBinary&&(m=t.wasmBinary),t.noExitRuntime,typeof WebAssembly!="object"&&v("no native wasm support detected");var O,y,x,h,p,B,k=!1,z=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function un(n,e,r){for(var o=e+r,s=e;n[s]&&!(s>=o);)++s;if(s-e>16&&n.buffer&&z)return z.decode(n.subarray(e,s));for(var u="";e>10,56320|1023&nn)}}else u+=String.fromCharCode((31&i)<<6|f)}else u+=String.fromCharCode(i)}return u}function M(n,e){return n?un(x,n,e):""}function L(n){O=n,t.HEAP8=y=new Int8Array(n),t.HEAP16=new Int16Array(n),t.HEAP32=h=new Int32Array(n),t.HEAPU8=x=new Uint8Array(n),t.HEAPU16=new Uint16Array(n),t.HEAPU32=p=new Uint32Array(n),t.HEAPF32=new Float32Array(n),t.HEAPF64=new Float64Array(n)}t.INITIAL_MEMORY;var G=[],X=[],N=[];function sn(){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)fn(t.preRun.shift());W(G)}function an(){W(X)}function cn(){if(t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)ln(t.postRun.shift());W(N)}function fn(n){G.unshift(n)}function pn(n){X.unshift(n)}function ln(n){N.unshift(n)}var l=0,g=null;function hn(n){l++,t.monitorRunDependencies&&t.monitorRunDependencies(l)}function dn(n){if(l--,t.monitorRunDependencies&&t.monitorRunDependencies(l),l==0&&g){var e=g;g=null,e()}}function v(n){t.onAbort&&t.onAbort(n),_(n="Aborted("+n+")"),k=!0,n+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(n);throw I(e),e}var a,mn="data:application/octet-stream;base64,";function Y(n){return n.startsWith(mn)}function $(n){return n.startsWith("file://")}function J(n){try{if(n==a&&m)return new Uint8Array(m);if(A)return A(n);throw"both async and sync fetching of the wasm failed"}catch(e){v(e)}}function _n(){if(!m&&(C||d)){if(typeof fetch=="function"&&!$(a))return fetch(a,{credentials:"same-origin"}).then(function(n){if(!n.ok)throw"failed to load wasm binary file at '"+a+"'";return n.arrayBuffer()}).catch(function(){return J(a)});if(b)return new Promise(function(n,e){b(a,function(r){n(new Uint8Array(r))},e)})}return Promise.resolve().then(function(){return J(a)})}function yn(){var n={a:In};function e(u,i){var f=u.exports;t.asm=f,L((H=t.asm.g).buffer),B=t.asm.m,pn(t.asm.h),dn()}function r(u){e(u.instance)}function o(u){return _n().then(function(i){return WebAssembly.instantiate(i,n)}).then(function(i){return i}).then(u,function(i){_("failed to asynchronously prepare wasm: "+i),v(i)})}function s(){return m||typeof WebAssembly.instantiateStreaming!="function"||Y(a)||$(a)||F||typeof fetch!="function"?o(r):fetch(a,{credentials:"same-origin"}).then(function(u){return WebAssembly.instantiateStreaming(u,n).then(r,function(i){return _("wasm streaming compile failed: "+i),_("falling back to ArrayBuffer instantiation"),o(r)})})}if(hn(),t.instantiateWasm)try{return t.instantiateWasm(n,e)}catch(u){return _("Module.instantiateWasm callback failed with error: "+u),!1}return s().catch(I),{}}function W(n){for(;n.length>0;){var e=n.shift();if(typeof e!="function"){var r=e.func;typeof r=="number"?e.arg===void 0?K(r)():K(r)(e.arg):r(e.arg===void 0?null:e.arg)}else e(t)}}Y(a="lerc-wasm.wasm")||(a=on(a));var S=[];function K(n){var e=S[n];return e||(n>=S.length&&(S.length=n+1),S[n]=e=B.get(n)),e}function gn(n,e,r,o){v("Assertion failed: "+M(n)+", at: "+[e?M(e):"unknown filename",r,o?M(o):"unknown function"])}function vn(n){return Q(n+24)+24}function wn(n){this.excPtr=n,this.ptr=n-24,this.set_type=function(e){p[this.ptr+4>>2]=e},this.get_type=function(){return p[this.ptr+4>>2]},this.set_destructor=function(e){p[this.ptr+8>>2]=e},this.get_destructor=function(){return p[this.ptr+8>>2]},this.set_refcount=function(e){h[this.ptr>>2]=e},this.set_caught=function(e){e=e?1:0,y[this.ptr+12>>0]=e},this.get_caught=function(){return y[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,y[this.ptr+13>>0]=e},this.get_rethrown=function(){return y[this.ptr+13>>0]!=0},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=h[this.ptr>>2];h[this.ptr>>2]=e+1},this.release_ref=function(){var e=h[this.ptr>>2];return h[this.ptr>>2]=e-1,e===1},this.set_adjusted_ptr=function(e){p[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return p[this.ptr+16>>2]},this.get_exception_ptr=function(){if(V(this.get_type()))return p[this.excPtr>>2];var e=this.get_adjusted_ptr();return e!==0?e:this.excPtr}}function bn(n,e,r){throw new wn(n).init(e,r),n}function An(){v("")}function Rn(n,e,r){x.copyWithin(n,e,e+r)}function xn(){return 2147483648}function Sn(n){try{return H.grow(n-O.byteLength+65535>>>16),L(H.buffer),1}catch{}}function En(n){var e=x.length;n>>>=0;var r=xn();if(n>r)return!1;let o=(i,f)=>i+(f-i%f)%f;for(var s=1;s<=4;s*=2){var u=e*(1+.2/s);if(u=Math.min(u,n+100663296),Sn(Math.min(r,o(Math.max(n,u),65536))))return!0}return!1}var In={a:gn,c:vn,b:bn,d:An,f:Rn,e:En};yn(),t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.h).apply(null,arguments)},t._lerc_getBlobInfo=function(){return(t._lerc_getBlobInfo=t.asm.i).apply(null,arguments)},t._lerc_getDataRanges=function(){return(t._lerc_getDataRanges=t.asm.j).apply(null,arguments)},t._lerc_decode=function(){return(t._lerc_decode=t.asm.k).apply(null,arguments)},t._lerc_decode_4D=function(){return(t._lerc_decode_4D=t.asm.l).apply(null,arguments)};var Q=t._malloc=function(){return(Q=t._malloc=t.asm.n).apply(null,arguments)};t._free=function(){return(t._free=t.asm.o).apply(null,arguments)};var E,V=t.___cxa_is_pointer_type=function(){return(V=t.___cxa_is_pointer_type=t.asm.p).apply(null,arguments)};function Pn(n){this.name="ExitStatus",this.message="Program terminated with exit("+n+")",this.status=n}function D(n){function e(){E||(E=!0,t.calledRun=!0,k||(an(),U(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),cn()))}l>0||(sn(),l>0||(t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),e()},1)):e()))}if(g=function n(){E||D(),E||(g=n)},t.run=D,t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();return D(),t.ready},en.exports=tn;const Tn=jn(rn.exports),Mn=Object.freeze(Object.defineProperty({__proto__:null,default:Tn},Symbol.toStringTag,{value:"Module"}));export{Mn as l}; diff --git a/assets/libtess-CR3C3MJB.js b/assets/libtess-B_UHPwdK.js similarity index 99% rename from assets/libtess-CR3C3MJB.js rename to assets/libtess-B_UHPwdK.js index 3aa2734..e1dc0dc 100644 --- a/assets/libtess-CR3C3MJB.js +++ b/assets/libtess-B_UHPwdK.js @@ -1 +1 @@ -import{ar as Mt}from"./index-CEWggaxV.js";function Ut(v,w){for(var p=0;pe[h]})}}}return Object.freeze(Object.defineProperty(v,Symbol.toStringTag,{value:"Module"}))}var et,k,nt,ot={exports:{}};et=ot,k=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,nt=function(v={}){var w,p,e=v;e.ready=new Promise((t,n)=>{w=t,p=n});var h=Object.assign({},e),g=typeof window=="object",I=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var M,l="";function it(t){return e.locateFile?e.locateFile(t,l):l+t}(g||I)&&(I?l=self.location.href:typeof document<"u"&&document.currentScript&&(l=document.currentScript.src),k&&(l=k),l=l.indexOf("blob:")!==0?l.substr(0,l.replace(/[?#].*/,"").lastIndexOf("/")+1):"",I&&(M=t=>{var n=new XMLHttpRequest;return n.open("GET",t,!1),n.responseType="arraybuffer",n.send(null),new Uint8Array(n.response)}));var A,x,at=e.print||console.log.bind(console),b=e.printErr||console.error.bind(console);Object.assign(e,h),h=null,e.arguments&&e.arguments,e.thisProgram&&e.thisProgram,e.quit&&e.quit,e.wasmBinary&&(A=e.wasmBinary),typeof WebAssembly!="object"&&Y("no native wasm support detected");var T,j,q=!1;function L(){var t=x.buffer;e.HEAP8=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAPU8=T=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAP32=new Int32Array(t),e.HEAPU32=j=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}var $=[],z=[],N=[];function ut(){if(e.preRun)for(typeof e.preRun=="function"&&(e.preRun=[e.preRun]);e.preRun.length;)st(e.preRun.shift());U($)}function ft(){U(z)}function ct(){if(e.postRun)for(typeof e.postRun=="function"&&(e.postRun=[e.postRun]);e.postRun.length;)pt(e.postRun.shift());U(N)}function st(t){$.unshift(t)}function lt(t){z.unshift(t)}function pt(t){N.unshift(t)}var y=0,E=null;function ht(t){var n;y++,(n=e.monitorRunDependencies)==null||n.call(e,y)}function mt(t){var o;if(y--,(o=e.monitorRunDependencies)==null||o.call(e,y),y==0&&E){var n=E;E=null,n()}}function Y(t){var o;(o=e.onAbort)==null||o.call(e,t),b(t="Aborted("+t+")"),q=!0,t+=". Build with -sASSERTIONS for more info.";var n=new WebAssembly.RuntimeError(t);throw p(n),n}var R,yt="data:application/octet-stream;base64,",G=t=>t.startsWith(yt);function X(t){if(t==R&&A)return new Uint8Array(A);if(M)return M(t);throw"both async and sync fetching of the wasm failed"}function dt(t){return A||!g&&!I||typeof fetch!="function"?Promise.resolve().then(()=>X(t)):fetch(t,{credentials:"same-origin"}).then(n=>{if(!n.ok)throw"failed to load wasm binary file at '"+t+"'";return n.arrayBuffer()}).catch(()=>X(t))}function J(t,n,o){return dt(t).then(r=>WebAssembly.instantiate(r,n)).then(r=>r).then(o,r=>{b(`failed to asynchronously prepare wasm: ${r}`),Y(r)})}function vt(t,n,o,r){return t||typeof WebAssembly.instantiateStreaming!="function"||G(n)||typeof fetch!="function"?J(n,o,r):fetch(n,{credentials:"same-origin"}).then(i=>WebAssembly.instantiateStreaming(i,o).then(r,function(a){return b(`wasm streaming compile failed: ${a}`),b("falling back to ArrayBuffer instantiation"),J(n,o,r)}))}function gt(){var t={a:Ht};function n(r,i){return s=r.exports,x=s.i,L(),K=s.m,lt(s.j),mt(),s}function o(r){n(r.instance)}if(ht(),e.instantiateWasm)try{return e.instantiateWasm(t,n)}catch(r){b(`Module.instantiateWasm callback failed with error: ${r}`),p(r)}return vt(A,R,t,o).catch(p),{}}G(R="libtess.wasm")||(R=it(R));var U=t=>{for(;t.length>0;)t.shift()(e)};e.noExitRuntime;var K,bt=()=>{throw 1/0},wt=(t,n,o)=>T.copyWithin(t,n,n+o),At=()=>2147483648,Et=t=>{var n=(t-x.buffer.byteLength+65535)/65536;try{return x.grow(n),L(),1}catch{}},Rt=t=>{var n=T.length;t>>>=0;var o=At();if(t>o)return!1;for(var r=(f,c)=>f+(c-f%c)%c,i=1;i<=4;i*=2){var a=n*(1+.2/i);a=Math.min(a,t+100663296);var u=Math.min(o,r(Math.max(t,a),65536));if(Et(u))return!0}return!1},Pt=[null,[],[]],Q=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,St=(t,n,o)=>{for(var r=n+o,i=n;t[i]&&!(i>=r);)++i;if(i-n>16&&t.buffer&&Q)return Q.decode(t.subarray(n,i));for(var a="";n>10,56320|1023&H)}}else a+=String.fromCharCode((31&u)<<6|f)}else a+=String.fromCharCode(u)}return a},_t=(t,n)=>{var o=Pt[t];n===0||n===10?((t===1?at:b)(St(o,0)),o.length=0):o.push(n)},O=[],W=t=>{var n=O[t];return n||(t>=O.length&&(O.length=t+1),O[t]=n=K.get(t)),n},Ht={e:bt,g:wt,f:Rt,c:(t,n,o,r)=>{for(var i=0,a=0;a>2],f=j[n+4>>2];n+=8;for(var c=0;c>2]=i,0},b:Tt,h:jt,d:xt,a:It},s=gt();e._malloc=t=>(e._malloc=s.k)(t),e._free=t=>(e._free=s.l)(t),e._triangulate=(t,n,o,r,i,a)=>(e._triangulate=s.n)(t,n,o,r,i,a);var C,P=(t,n)=>(P=s.o)(t,n),S=()=>(S=s.p)(),_=t=>(_=s.q)(t);function It(t,n,o){var r=S();try{W(t)(n,o)}catch(i){if(_(r),i!==i+0)throw i;P(1,0)}}function xt(t,n){var o=S();try{W(t)(n)}catch(r){if(_(o),r!==r+0)throw r;P(1,0)}}function Tt(t,n){var o=S();try{return W(t)(n)}catch(r){if(_(o),r!==r+0)throw r;P(1,0)}}function jt(t,n,o,r){var i=S();try{return W(t)(n,o,r)}catch(a){if(_(i),a!==a+0)throw a;P(1,0)}}function V(){function t(){C||(C=!0,e.calledRun=!0,q||(ft(),w(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),ct()))}y>0||(ut(),y>0||(e.setStatus?(e.setStatus("Running..."),setTimeout(function(){setTimeout(function(){e.setStatus("")},1),t()},1)):t()))}if(E=function t(){C||V(),C||(E=t)},e.preInit)for(typeof e.preInit=="function"&&(e.preInit=[e.preInit]);e.preInit.length>0;)e.preInit.pop()();V();let B=null,m=null,d=null,F=null;const Ot=2,Z=4e3;let tt=0;const Wt=(t,n,o)=>{B||(B=e._triangulate);let r=e.HEAPF32;const i=e.HEAP32.BYTES_PER_ELEMENT,a=2,u=r.BYTES_PER_ELEMENT;o>tt&&(tt=o,d&&(e._free(d),d=0),m&&(e._free(m),m=0)),d||(d=e._malloc(o*u)),F||(F=e._malloc(Z*i));const f=o*Ot;m||(m=e._malloc(f*u)),r=e.HEAPF32,r.set(t,d/u),e.HEAP32.set(n,F/i);const c=f/a,H=B(d,F,Math.min(n.length,Z),a,m,c),Ct=H*a;r=e.HEAPF32;const Ft=r.slice(m/u,m/u+Ct),D={};return D.buffer=Ft,D.vertexCount=H,D};return e.triangulate=Wt,v.ready},et.exports=nt;var rt=ot.exports;const Dt=Ut({__proto__:null,default:Mt(rt)},[rt]);export{Dt as l}; +import{ar as Mt}from"./index-BjUNJPVf.js";function Ut(v,w){for(var p=0;pe[h]})}}}return Object.freeze(Object.defineProperty(v,Symbol.toStringTag,{value:"Module"}))}var et,k,nt,ot={exports:{}};et=ot,k=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,nt=function(v={}){var w,p,e=v;e.ready=new Promise((t,n)=>{w=t,p=n});var h=Object.assign({},e),g=typeof window=="object",I=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var M,l="";function it(t){return e.locateFile?e.locateFile(t,l):l+t}(g||I)&&(I?l=self.location.href:typeof document<"u"&&document.currentScript&&(l=document.currentScript.src),k&&(l=k),l=l.indexOf("blob:")!==0?l.substr(0,l.replace(/[?#].*/,"").lastIndexOf("/")+1):"",I&&(M=t=>{var n=new XMLHttpRequest;return n.open("GET",t,!1),n.responseType="arraybuffer",n.send(null),new Uint8Array(n.response)}));var A,x,at=e.print||console.log.bind(console),b=e.printErr||console.error.bind(console);Object.assign(e,h),h=null,e.arguments&&e.arguments,e.thisProgram&&e.thisProgram,e.quit&&e.quit,e.wasmBinary&&(A=e.wasmBinary),typeof WebAssembly!="object"&&Y("no native wasm support detected");var T,j,q=!1;function L(){var t=x.buffer;e.HEAP8=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAPU8=T=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAP32=new Int32Array(t),e.HEAPU32=j=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}var $=[],z=[],N=[];function ut(){if(e.preRun)for(typeof e.preRun=="function"&&(e.preRun=[e.preRun]);e.preRun.length;)st(e.preRun.shift());U($)}function ft(){U(z)}function ct(){if(e.postRun)for(typeof e.postRun=="function"&&(e.postRun=[e.postRun]);e.postRun.length;)pt(e.postRun.shift());U(N)}function st(t){$.unshift(t)}function lt(t){z.unshift(t)}function pt(t){N.unshift(t)}var y=0,E=null;function ht(t){var n;y++,(n=e.monitorRunDependencies)==null||n.call(e,y)}function mt(t){var o;if(y--,(o=e.monitorRunDependencies)==null||o.call(e,y),y==0&&E){var n=E;E=null,n()}}function Y(t){var o;(o=e.onAbort)==null||o.call(e,t),b(t="Aborted("+t+")"),q=!0,t+=". Build with -sASSERTIONS for more info.";var n=new WebAssembly.RuntimeError(t);throw p(n),n}var R,yt="data:application/octet-stream;base64,",G=t=>t.startsWith(yt);function X(t){if(t==R&&A)return new Uint8Array(A);if(M)return M(t);throw"both async and sync fetching of the wasm failed"}function dt(t){return A||!g&&!I||typeof fetch!="function"?Promise.resolve().then(()=>X(t)):fetch(t,{credentials:"same-origin"}).then(n=>{if(!n.ok)throw"failed to load wasm binary file at '"+t+"'";return n.arrayBuffer()}).catch(()=>X(t))}function J(t,n,o){return dt(t).then(r=>WebAssembly.instantiate(r,n)).then(r=>r).then(o,r=>{b(`failed to asynchronously prepare wasm: ${r}`),Y(r)})}function vt(t,n,o,r){return t||typeof WebAssembly.instantiateStreaming!="function"||G(n)||typeof fetch!="function"?J(n,o,r):fetch(n,{credentials:"same-origin"}).then(i=>WebAssembly.instantiateStreaming(i,o).then(r,function(a){return b(`wasm streaming compile failed: ${a}`),b("falling back to ArrayBuffer instantiation"),J(n,o,r)}))}function gt(){var t={a:Ht};function n(r,i){return s=r.exports,x=s.i,L(),K=s.m,lt(s.j),mt(),s}function o(r){n(r.instance)}if(ht(),e.instantiateWasm)try{return e.instantiateWasm(t,n)}catch(r){b(`Module.instantiateWasm callback failed with error: ${r}`),p(r)}return vt(A,R,t,o).catch(p),{}}G(R="libtess.wasm")||(R=it(R));var U=t=>{for(;t.length>0;)t.shift()(e)};e.noExitRuntime;var K,bt=()=>{throw 1/0},wt=(t,n,o)=>T.copyWithin(t,n,n+o),At=()=>2147483648,Et=t=>{var n=(t-x.buffer.byteLength+65535)/65536;try{return x.grow(n),L(),1}catch{}},Rt=t=>{var n=T.length;t>>>=0;var o=At();if(t>o)return!1;for(var r=(f,c)=>f+(c-f%c)%c,i=1;i<=4;i*=2){var a=n*(1+.2/i);a=Math.min(a,t+100663296);var u=Math.min(o,r(Math.max(t,a),65536));if(Et(u))return!0}return!1},Pt=[null,[],[]],Q=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,St=(t,n,o)=>{for(var r=n+o,i=n;t[i]&&!(i>=r);)++i;if(i-n>16&&t.buffer&&Q)return Q.decode(t.subarray(n,i));for(var a="";n>10,56320|1023&H)}}else a+=String.fromCharCode((31&u)<<6|f)}else a+=String.fromCharCode(u)}return a},_t=(t,n)=>{var o=Pt[t];n===0||n===10?((t===1?at:b)(St(o,0)),o.length=0):o.push(n)},O=[],W=t=>{var n=O[t];return n||(t>=O.length&&(O.length=t+1),O[t]=n=K.get(t)),n},Ht={e:bt,g:wt,f:Rt,c:(t,n,o,r)=>{for(var i=0,a=0;a>2],f=j[n+4>>2];n+=8;for(var c=0;c>2]=i,0},b:Tt,h:jt,d:xt,a:It},s=gt();e._malloc=t=>(e._malloc=s.k)(t),e._free=t=>(e._free=s.l)(t),e._triangulate=(t,n,o,r,i,a)=>(e._triangulate=s.n)(t,n,o,r,i,a);var C,P=(t,n)=>(P=s.o)(t,n),S=()=>(S=s.p)(),_=t=>(_=s.q)(t);function It(t,n,o){var r=S();try{W(t)(n,o)}catch(i){if(_(r),i!==i+0)throw i;P(1,0)}}function xt(t,n){var o=S();try{W(t)(n)}catch(r){if(_(o),r!==r+0)throw r;P(1,0)}}function Tt(t,n){var o=S();try{return W(t)(n)}catch(r){if(_(o),r!==r+0)throw r;P(1,0)}}function jt(t,n,o,r){var i=S();try{return W(t)(n,o,r)}catch(a){if(_(i),a!==a+0)throw a;P(1,0)}}function V(){function t(){C||(C=!0,e.calledRun=!0,q||(ft(),w(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),ct()))}y>0||(ut(),y>0||(e.setStatus?(e.setStatus("Running..."),setTimeout(function(){setTimeout(function(){e.setStatus("")},1),t()},1)):t()))}if(E=function t(){C||V(),C||(E=t)},e.preInit)for(typeof e.preInit=="function"&&(e.preInit=[e.preInit]);e.preInit.length>0;)e.preInit.pop()();V();let B=null,m=null,d=null,F=null;const Ot=2,Z=4e3;let tt=0;const Wt=(t,n,o)=>{B||(B=e._triangulate);let r=e.HEAPF32;const i=e.HEAP32.BYTES_PER_ELEMENT,a=2,u=r.BYTES_PER_ELEMENT;o>tt&&(tt=o,d&&(e._free(d),d=0),m&&(e._free(m),m=0)),d||(d=e._malloc(o*u)),F||(F=e._malloc(Z*i));const f=o*Ot;m||(m=e._malloc(f*u)),r=e.HEAPF32,r.set(t,d/u),e.HEAP32.set(n,F/i);const c=f/a,H=B(d,F,Math.min(n.length,Z),a,m,c),Ct=H*a;r=e.HEAPF32;const Ft=r.slice(m/u,m/u+Ct),D={};return D.buffer=Ft,D.vertexCount=H,D};return e.triangulate=Wt,v.ready},et.exports=nt;var rt=ot.exports;const Dt=Ut({__proto__:null,default:Mt(rt)},[rt]);export{Dt as l}; diff --git a/assets/libtess-asm-DL92duA_.js b/assets/libtess-asm-rVi5NxzN.js similarity index 99% rename from assets/libtess-asm-DL92duA_.js rename to assets/libtess-asm-rVi5NxzN.js index 2e3cb90..2986d77 100644 --- a/assets/libtess-asm-DL92duA_.js +++ b/assets/libtess-asm-rVi5NxzN.js @@ -1 +1 @@ -import{ar as P4}from"./index-CEWggaxV.js";function U4(M2,W2){for(var v2=0;v2E[d2]})}}}return Object.freeze(Object.defineProperty(M2,Symbol.toStringTag,{value:"Module"}))}var d1,S0,h1,y1={exports:{}};d1=y1,S0=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,h1=function(M2={}){var W2,v2,E=M2;E.ready=new Promise((p,C)=>{W2=p,v2=C});var d2=Object.assign({},E),P2=typeof window=="object",Y2=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var o0,l2="";function p1(p){return E.locateFile?E.locateFile(p,l2):l2+p}(P2||Y2)&&(Y2?l2=self.location.href:typeof document<"u"&&document.currentScript&&(l2=document.currentScript.src),S0&&(l2=S0),l2=l2.indexOf("blob:")!==0?l2.substr(0,l2.replace(/[?#].*/,"").lastIndexOf("/")+1):"",Y2&&(o0=p=>{var C=new XMLHttpRequest;return C.open("GET",p,!1),C.responseType="arraybuffer",C.send(null),new Uint8Array(C.response)}));var U2,m1=E.print||console.log.bind(console),_2=E.printErr||console.error.bind(console);Object.assign(E,d2),d2=null,E.arguments&&E.arguments,E.thisProgram&&E.thisProgram,E.quit&&E.quit,E.wasmBinary&&(U2=E.wasmBinary);var F2,h2={Memory:function(p){this.buffer=new ArrayBuffer(65536*p.initial)},Module:function(p){},Instance:function(p,C){this.exports=function(B){function U(K){return K.set=function(V,t2){this[V]=t2},K.get=function(V){return this[V]},K}for(var F,H=new Uint8Array(123),D=25;D>=0;--D)H[48+D]=52+D,H[65+D]=D,H[97+D]=26+D;function x(K,V,t2){for(var a2,d,n2=0,i=V,w=t2.length,G2=V+(3*w>>2)-(t2[w-2]=="=")-(t2[w-1]=="=");n2>4,i>2),i>>0<=244){if(3&(f=(o=i[854])>>>(a=(k=n>>>0<11?16:n+11&504)>>>3|0)|0)){f=3456+(n=(a=a+(1&(-1^f))|0)<<3)|0,e=i[n+3464>>2],(0|f)!=(0|(n=i[e+8>>2]))?(i[n+12>>2]=f,i[f+8>>2]=n):(v=3416,h=i2(a)&o,i[v>>2]=h),n=e+8|0,f=a<<3,i[e+4>>2]=3|f,i[4+(f=f+e|0)>>2]=1|i[f+4>>2];break i}if((A=i[856])>>>0>=k>>>0)break b;if(f){f=3456+(n=(e=e0((0-(n=2<>2],(0|f)!=(0|(n=i[t+8>>2]))?(i[n+12>>2]=f,i[f+8>>2]=n):(o=i2(e)&o,i[854]=o),i[t+4>>2]=3|k,e=(n=e<<3)-k|0,i[4+(a=t+k|0)>>2]=1|e,i[n+t>>2]=e,A&&(f=3456+(-8&A)|0,b=i[859],(n=1<<(A>>>3))&o?n=i[f+8>>2]:(i[854]=n|o,n=f),i[f+8>>2]=b,i[n+12>>2]=b,i[b+12>>2]=f,i[b+8>>2]=n),n=t+8|0,i[859]=a,i[856]=e;break i}if(!(r=i[855]))break b;for(a=i[3720+(e0(r)<<2)>>2],t=(-8&i[a+4>>2])-k|0,f=a;(n=i[f+16>>2])||(n=i[f+20>>2]);)t=(e=(f=(-8&i[n+4>>2])-k|0)>>>0>>0)?f:t,a=e?n:a,f=n;if(s=i[a+24>>2],(0|(e=i[a+12>>2]))!=(0|a)){n=i[a+8>>2],i[n+12>>2]=e,i[e+8>>2]=n;break f}if(!(n=i[(f=a+20|0)>>2])){if(!(n=i[a+16>>2]))break o;f=a+16|0}for(;b=f,e=n,(n=i[(f=n+20|0)>>2])||(f=e+16|0,n=i[e+16>>2]););i[b>>2]=0;break f}if(k=-1,!(n>>>0>4294967231)&&(k=-8&(n=n+11|0),r=i[855])){t=0-k|0,o=0,k>>>0<256||(o=31,k>>>0>16777215||(o=62+((k>>>38-(n=s2(n>>>8|0))&1)-(n<<1)|0)|0));k:{c:{if(f=i[3720+(o<<2)>>2])for(n=0,a=k<<((0|o)!=31?25-(o>>>1|0)|0:0);;){if(!((b=(-8&i[f+4>>2])-k|0)>>>0>=t>>>0||(e=f,t=b))){t=0,n=f;break c}if(b=i[f+20>>2],f=i[16+((a>>>29&4)+f|0)>>2],n=b?(0|b)==(0|f)?n:b:n,a<<=1,!f)break}else n=0;if(!(n|e)){if(e=0,!(n=(0-(n=2<>2]}if(!n)break k}for(;t=(a=(f=(-8&i[n+4>>2])-k|0)>>>0>>0)?f:t,e=a?n:e,n=(f=i[n+16>>2])||i[n+20>>2];);}if(!(!e|i[856]-k>>>0<=t>>>0)){if(o=i[e+24>>2],(0|e)!=(0|(a=i[e+12>>2]))){n=i[e+8>>2],i[n+12>>2]=a,i[a+8>>2]=n;break a}if(!(n=i[(f=e+20|0)>>2])){if(!(n=i[e+16>>2]))break u;f=e+16|0}for(;b=f,a=n,(n=i[(f=n+20|0)>>2])||(f=a+16|0,n=i[a+16>>2]););i[b>>2]=0;break a}}}if((n=i[856])>>>0>=k>>>0){e=i[859],(f=n-k|0)>>>0>=16?(i[4+(a=e+k|0)>>2]=1|f,i[n+e>>2]=f,i[e+4>>2]=3|k):(i[e+4>>2]=3|n,i[4+(n=n+e|0)>>2]=1|i[n+4>>2],a=0,f=0),i[856]=f,i[859]=a,n=e+8|0;break i}if((s=i[857])>>>0>k>>>0){f=s-k|0,i[857]=f,n=(a=i[860])+k|0,i[860]=n,i[n+4>>2]=1|f,i[a+4>>2]=3|k,n=a+8|0;break i}if(n=0,t=k+47|0,i[972]?a=i[974]:(i[975]=-1,i[976]=-1,i[973]=4096,i[974]=4096,i[972]=l+12&-16^1431655768,i[977]=0,i[965]=0,a=4096),(f=(o=t+a|0)&(b=0-a|0))>>>0<=k>>>0||(e=i[964])&&e>>>0<(r=(a=i[962])+f|0)>>>0|a>>>0>=r>>>0)break i;b:{if(!(4&w[3860])){k:{c:{A:{r:{if(e=i[860])for(n=3864;;){if((a=i[n>>2])>>>0<=e>>>0&e>>>0>2]>>>0)break r;if(!(n=i[n+8>>2]))break}if((0|(a=T2(0)))==-1||(o=f,(n=(e=i[973])-1|0)&a&&(o=(f-a|0)+(n+a&0-e)|0),o>>>0<=k>>>0)||(e=i[964])&&e>>>0<(b=(n=i[962])+o|0)>>>0|n>>>0>=b>>>0)break k;if((0|a)!=(0|(n=T2(o))))break A;break b}if((0|(a=T2(o=b&o-s)))==(i[n>>2]+i[n+4>>2]|0))break c;n=a}if((0|n)==-1)break k;if(k+48>>>0<=o>>>0){a=n;break b}if((0|T2(a=(a=i[974])+(t-o|0)&0-a))==-1)break k;o=a+o|0,a=n;break b}if((0|a)!=-1)break b}i[965]=4|i[965]}if((0|(a=T2(f)))==-1|(0|(n=T2(0)))==-1|n>>>0<=a>>>0||(o=n-a|0)>>>0<=k+40>>>0)break n}n=i[962]+o|0,i[962]=n,n>>>0>i0[963]&&(i[963]=n);b:{if(t=i[860]){for(n=3864;;){if(((e=i[n>>2])+(f=i[n+4>>2])|0)==(0|a))break b;if(!(n=i[n+8>>2]))break}break t}for((n=i[858])>>>0<=a>>>0&&n||(i[858]=a),n=0,i[967]=o,i[966]=a,i[862]=-1,i[863]=i[972],i[969]=0;f=3456+(e=n<<3)|0,i[e+3464>>2]=f,i[e+3468>>2]=f,(0|(n=n+1|0))!=32;);f=(e=o-40|0)-(n=-8-a&7)|0,i[857]=f,n=n+a|0,i[860]=n,i[n+4>>2]=1|f,i[4+(a+e|0)>>2]=40,i[861]=i[976];break e}if(8&i[n+12>>2]|a>>>0<=t>>>0|e>>>0>t>>>0)break t;i[n+4>>2]=f+o,a=(n=-8-t&7)+t|0,i[860]=a,n=(f=i[857]+o|0)-n|0,i[857]=n,i[a+4>>2]=1|n,i[4+(f+t|0)>>2]=40,i[861]=i[976];break e}e=0;break f}a=0;break a}i0[858]>a>>>0&&(i[858]=a),f=a+o|0,n=3864;t:{u:{o:{for(;;){if((0|f)!=i[n>>2]){if(n=i[n+8>>2])continue;break o}break}if(!(8&w[n+12|0]))break u}for(n=3864;!((f=i[n>>2])>>>0<=t>>>0&&(b=f+i[n+4>>2]|0)>>>0>t>>>0);)n=i[n+8>>2];for(f=(e=o-40|0)-(n=-8-a&7)|0,i[857]=f,n=n+a|0,i[860]=n,i[n+4>>2]=1|f,i[4+(a+e|0)>>2]=40,i[861]=i[976],i[(e=(n=(b+(39-b&7)|0)-47|0)>>>0>>0?t:n)+4>>2]=27,n=i[969],i[e+16>>2]=i[968],i[e+20>>2]=n,n=i[967],i[e+8>>2]=i[966],i[e+12>>2]=n,i[968]=e+8,i[967]=o,i[966]=a,i[969]=0,n=e+24|0;i[n+4>>2]=7,f=n+8|0,n=n+4|0,f>>>0>>0;);if((0|e)==(0|t))break e;if(i[e+4>>2]=-2&i[e+4>>2],b=e-t|0,i[t+4>>2]=1|b,i[e>>2]=b,b>>>0<=255){f=3456+(-8&b)|0,(a=i[854])&(n=1<<(b>>>3))?n=i[f+8>>2]:(i[854]=n|a,n=f),i[f+8>>2]=t,i[n+12>>2]=t,i[t+12>>2]=f,i[t+8>>2]=n;break e}if(n=31,b>>>0<=16777215&&(n=62+((b>>>38-(n=s2(b>>>8|0))&1)-(n<<1)|0)|0),i[t+28>>2]=n,i[t+16>>2]=0,i[t+20>>2]=0,f=3720+(n<<2)|0,(e=i[855])&(a=1<>>1|0)|0:0),e=i[f>>2];;){if((0|b)==(-8&i[(f=e)+4>>2]))break t;if(a=n>>>29|0,n<<=1,!(e=i[16+(a=(4&a)+f|0)>>2]))break}i[a+16>>2]=t}else i[855]=a|e,i[f>>2]=t;i[t+24>>2]=f,i[t+12>>2]=t,i[t+8>>2]=t;break e}i[n>>2]=a,i[n+4>>2]=i[n+4>>2]+o,i[4+(r=(-8-a&7)+a|0)>>2]=3|k,o=(t=f+(-8-f&7)|0)-(s=k+r|0)|0;u:if(i[860]!=(0|t))if(i[859]!=(0|t)){if((3&(a=i[t+4>>2]))==1){b=-8&a;o:if(a>>>0<=255){if((0|(f=i[t+12>>2]))==(0|(n=i[t+8>>2]))){v=3416,h=i[854]&i2(a>>>3|0),i[v>>2]=h;break o}i[n+12>>2]=f,i[f+8>>2]=n}else{k=i[t+24>>2];b:if((0|t)==(0|(n=i[t+12>>2]))){k:{if(!(a=i[(f=t+20|0)>>2])){if(!(a=i[t+16>>2]))break k;f=t+16|0}for(;e=f,(a=i[(f=(n=a)+20|0)>>2])||(f=n+16|0,a=i[n+16>>2]););i[e>>2]=0;break b}n=0}else f=i[t+8>>2],i[f+12>>2]=n,i[n+8>>2]=f;if(k){a=i[t+28>>2];b:{if(i[(f=3720+(a<<2)|0)>>2]==(0|t)){if(i[f>>2]=n,n)break b;v=3420,h=i[855]&i2(a),i[v>>2]=h;break o}if(i[k+(i[k+16>>2]==(0|t)?16:20)>>2]=n,!n)break o}i[n+24>>2]=k,(f=i[t+16>>2])&&(i[n+16>>2]=f,i[f+24>>2]=n),(f=i[t+20>>2])&&(i[n+20>>2]=f,i[f+24>>2]=n)}}o=b+o|0,a=i[4+(t=t+b|0)>>2]}if(i[t+4>>2]=-2&a,i[s+4>>2]=1|o,i[o+s>>2]=o,o>>>0<=255)f=3456+(-8&o)|0,(a=i[854])&(n=1<<(o>>>3))?n=i[f+8>>2]:(i[854]=n|a,n=f),i[f+8>>2]=s,i[n+12>>2]=s,i[s+12>>2]=f,i[s+8>>2]=n;else{a=31,o>>>0<=16777215&&(a=62+((o>>>38-(n=s2(o>>>8|0))&1)-(n<<1)|0)|0),i[s+28>>2]=a,i[s+16>>2]=0,i[s+20>>2]=0,f=3720+(a<<2)|0;o:{if((e=i[855])&(n=1<>>1|0)|0:0),n=i[f>>2];;){if(f=n,(-8&i[n+4>>2])==(0|o))break o;if(e=a>>>29|0,a<<=1,!(n=i[16+(e=(4&e)+n|0)>>2]))break}i[e+16>>2]=s}else i[855]=n|e,i[f>>2]=s;i[s+24>>2]=f,i[s+12>>2]=s,i[s+8>>2]=s;break u}n=i[f+8>>2],i[n+12>>2]=s,i[f+8>>2]=s,i[s+24>>2]=0,i[s+12>>2]=f,i[s+8>>2]=n}}else i[859]=s,n=i[856]+o|0,i[856]=n,i[s+4>>2]=1|n,i[n+s>>2]=n;else i[860]=s,n=i[857]+o|0,i[857]=n,i[s+4>>2]=1|n;n=r+8|0;break i}n=i[f+8>>2],i[n+12>>2]=t,i[f+8>>2]=t,i[t+24>>2]=0,i[t+12>>2]=f,i[t+8>>2]=n}if(!((n=i[857])>>>0<=k>>>0)){f=n-k|0,i[857]=f,n=(a=i[860])+k|0,i[860]=n,i[n+4>>2]=1|f,i[a+4>>2]=3|k,n=a+8|0;break i}}i[806]=48,n=0;break i}a:if(o){f=i[e+28>>2];n:{if(i[(n=3720+(f<<2)|0)>>2]==(0|e)){if(i[n>>2]=a,a)break n;r=i2(f)&r,i[855]=r;break a}if(i[o+(i[o+16>>2]==(0|e)?16:20)>>2]=a,!a)break a}i[a+24>>2]=o,(n=i[e+16>>2])&&(i[a+16>>2]=n,i[n+24>>2]=a),(n=i[e+20>>2])&&(i[a+20>>2]=n,i[n+24>>2]=a)}a:if(t>>>0<=15)n=t+k|0,i[e+4>>2]=3|n,i[4+(n=n+e|0)>>2]=1|i[n+4>>2];else if(i[e+4>>2]=3|k,i[4+(b=e+k|0)>>2]=1|t,i[t+b>>2]=t,t>>>0<=255)f=3456+(-8&t)|0,(a=i[854])&(n=1<<(t>>>3))?n=i[f+8>>2]:(i[854]=n|a,n=f),i[f+8>>2]=b,i[n+12>>2]=b,i[b+12>>2]=f,i[b+8>>2]=n;else{n=31,t>>>0<=16777215&&(n=62+((t>>>38-(n=s2(t>>>8|0))&1)-(n<<1)|0)|0),i[b+28>>2]=n,i[b+16>>2]=0,i[b+20>>2]=0,f=3720+(n<<2)|0;n:{if((a=1<>>1|0)|0:0),k=i[f>>2];;){if((-8&i[(f=k)+4>>2])==(0|t))break n;if(a=n>>>29|0,n<<=1,!(k=i[16+(a=(4&a)+f|0)>>2]))break}i[a+16>>2]=b}else i[855]=a|r,i[f>>2]=b;i[b+24>>2]=f,i[b+12>>2]=b,i[b+8>>2]=b;break a}n=i[f+8>>2],i[n+12>>2]=b,i[f+8>>2]=b,i[b+24>>2]=0,i[b+12>>2]=f,i[b+8>>2]=n}n=e+8|0;break i}f:if(s){f=i[a+28>>2];a:{if(i[(n=3720+(f<<2)|0)>>2]==(0|a)){if(i[n>>2]=e,e)break a;v=3420,h=i2(f)&r,i[v>>2]=h;break f}if(i[s+(i[s+16>>2]==(0|a)?16:20)>>2]=e,!e)break f}i[e+24>>2]=s,(n=i[a+16>>2])&&(i[e+16>>2]=n,i[n+24>>2]=e),(n=i[a+20>>2])&&(i[e+20>>2]=n,i[n+24>>2]=e)}t>>>0<=15?(n=t+k|0,i[a+4>>2]=3|n,i[4+(n=n+a|0)>>2]=1|i[n+4>>2]):(i[a+4>>2]=3|k,i[4+(e=a+k|0)>>2]=1|t,i[e+t>>2]=t,A&&(f=3456+(-8&A)|0,b=i[859],(n=1<<(A>>>3))&o?n=i[f+8>>2]:(i[854]=n|o,n=f),i[f+8>>2]=b,i[n+12>>2]=b,i[b+12>>2]=f,i[b+8>>2]=n),i[859]=e,i[856]=t),n=a+8|0}return _=l+16|0,0|n}function J0(n,f){var a=u(0),e=0,t=u(0),b=u(0),o=0,k=u(0),s=0,r=u(0),A=u(0),l=0,v=0,h=u(0),y=0,m=0,g=0,I=0,S=0,M=0,P=0,T=0,O=u(0),G=0,Y=0,f2=0;_=s=_-144|0,Y=i[i[i[f+4>>2]+8>>2]>>2],T=i[Y>>2],I=i[T+16>>2],S=i[i[T+4>>2]+16>>2],P=i[f>>2],g=i[i[P+4>>2]+16>>2],y=i[P+16>>2],J(g,i[n+72>>2],y)>u(0)&&(a=c[g+28>>2],b=c[g+32>>2],e=i[n+72>>2],t=c[e+28>>2],k=c[e+32>>2],A=c[y+28>>2],q[s+40>>3]=c[y+32>>2],q[s+32>>3]=A,q[s+24>>3]=k,q[s+16>>3]=t,q[s+8>>3]=b,q[s>>3]=a,A1(1098,s));i:{f:{a:if((0|y)!=(0|I)&&(k=(a=c[y+32>>2])<=(b=c[g+32>>2])?a:b,b=c[I+32>>2],!(k>((t=c[S+32>>2])<=b?b:t)))){n:{if(!(!((t=c[y+28>>2])<(k=c[I+28>>2]))&(!(a<=b)|t!=k))){if(!(J(S,y,I)>u(0)))break n;break a}if(J(g,I,y)>2])<(b=c[y+28>>2])|a==b&c[l+32>>2]<=c[y+32>>2]?(o=M,M=l):o=l,(a=c[e+28>>2])>(b=c[v+28>>2])|a==b&c[v+32>>2]<=c[e+32>>2]?(a=b,l=e,e=v):l=v,(b=c[M+28>>2])>2]<=c[e+32>>2]?(b=a,v=l,m=e,l=o,e=M):(v=o,m=M);n:if((t=c[l+28>>2])>b|t==b&c[m+32>>2]<=c[l+32>>2])if(!((A=c[v+28>>2])>t)&(!(c[l+32>>2]<=c[v+32>>2])|t!=A))if(a=J(e,m,l),t=J(e,v,l),b=c[m+28>>2],(k=(a=(o=u(a-t)>2],a=u(u(b+r)*u(.5)),t==u(0))break n;a=u(u(u(r-b)*u(k/u(k+t)))+b)}else a=c[v+28>>2],a=u(u(u(b-a)*u(t/u(k+t)))+a);else{if(a=u(0),k=u(t-b),h=u(b-c[e+28>>2]),(O=u(k+h))>u(0)&&(a=c[((o=k>h)?e:l)+32>>2],a=u(u(u(a-c[(o?l:e)+32>>2])*u((o?h:k)/O))+u(c[m+32>>2]-a))),A=u(A-t),(h=u(k+A))>u(0)&&(r=c[((o=k>2],r=u(u(u(r-c[(o?v:m)+32>>2])*u((o?k:A)/h))+u(c[l+32>>2]-r))),(A=(a=(o=u(a+r)>2]=a,(a=c[e+32>>2])<(b=c[l+32>>2])|a==b&c[e+28>>2]<=c[l+28>>2]?(o=l,l=e):o=e,(a=c[v+32>>2])>(b=c[m+32>>2])|a==b&c[m+28>>2]<=c[v+28>>2]?(a=b,e=v,v=m):e=m,(b=c[l+32>>2])>2]<=c[v+28>>2]?(b=a,M=e,m=v,e=o,v=l):(M=o,m=l);n:{e:if((t=c[e+32>>2])>b|t==b&c[m+28>>2]<=c[e+28>>2]){if(!(!((r=c[M+32>>2])>t)&(!(c[e+28>>2]<=c[M+28>>2])|t!=r))){if(a=u(0),k=u(0),A=u(t-b),h=u(b-c[v+32>>2]),(O=u(A+h))>u(0)&&(k=c[((o=A>h)?v:e)+28>>2],k=u(u(u(k-c[(o?e:v)+28>>2])*u((o?h:A)/O))+u(c[m+28>>2]-k))),r=u(r-t),(h=u(A+r))>u(0)&&(a=c[((o=r>A)?m:M)+28>>2],a=u(u(u(a-c[(o?M:m)+28>>2])*u((o?A:r)/h))+u(c[e+28>>2]-a))),(k=(k=(e=u(k+a)>2]=u(A*u(k/u(k+a)))+b;break n}c[s+88>>2]=u(u(b-t)*u(a/u(k+a)))+t;break n}if(a=u(0),k=u(0),A=u(t-b),h=c[v+32>>2],O=u(b-h),u(A+O)>u(0)&&(k=c[m+28>>2],k=u(u(u(k-c[e+28>>2])*O)+u(A*u(k-c[v+28>>2])))),t=u(t-r),A=u(r-h),u(t+A)>u(0)&&(a=c[M+28>>2],a=u(u(u(a-c[e+28>>2])*A)+u(t*u(a-c[v+28>>2])))),(t=(t=(e=u(k-a)>2]=u(b+r)*u(.5);break n}c[s+88>>2]=u(u(r-b)*u(t/u(t+a)))+b;break n}c[s+88>>2]=u(u(b-r)*u(a/u(t+a)))+r;break n}c[s+88>>2]=u(b+t)*u(.5)}b=c[s+84>>2],o=i[n+72>>2];n:{if(b<(a=c[o+28>>2]))t=c[o+32>>2];else if(a!=b||!((t=c[o+32>>2])>=c[s+88>>2]))break n;c[s+88>>2]=t,c[s+84>>2]=a,b=a}(a=r=c[(e=y)+28>>2])<(t=c[I+28>>2])||a==t&&c[e+32>>2]<=c[I+32>>2]||(a=t,e=I);n:{if(a>2];else if(a!=b||!((k=c[e+32>>2])<=c[s+88>>2]))break n;c[s+88>>2]=k,c[s+84>>2]=a,b=a}if(!(b==r&c[s+88>>2]==c[y+32>>2])&(t!=b|c[s+88>>2]!=c[I+32>>2])){n:{e:{if(!((b=c[o+28>>2])==c[g+28>>2]&c[g+32>>2]==c[o+32>>2])){if(J(g,o,s+56|0)>=u(0))break e;o=i[n+72>>2],b=c[o+28>>2]}if(b==c[S+28>>2]&c[S+32>>2]==c[o+32>>2]||!(J(S,o,s+56|0)<=u(0)))break n}if((0|(e=i[n+72>>2]))==(0|S)){if(!o2(i[P+4>>2])||!Z(i[T+4>>2],P))break i;for(e=i[i[f>>2]+16>>2];f=i[i[i[f+4>>2]+4>>2]>>2],l=i[f>>2],(0|e)==i[l+16>>2];);if(w[f+15|0]&&(o=0,(e=A2(i[i[i[i[i[f+4>>2]+8>>2]>>2]>>2]+4>>2],i[l+12>>2]))&&$(i[f>>2])&&(i[f>>2]=e,d[f+15|0]=0,i[e+24>>2]=f,o=i[i[i[f+4>>2]+4>>2]>>2]),f=o),!f)break i;o=i[i[i[f+4>>2]+8>>2]>>2],e=i[o>>2],L2(n,o,Y),f2=1,S2(n,f,i[i[e+4>>2]+12>>2],e,e,1);break a}if((0|e)==(0|g)){if(!o2(i[T+4>>2])||!Z(i[P+12>>2],i[i[T+4>>2]+12>>2]))break i;for(o=i[i[i[f>>2]+4>>2]+16>>2],e=f;e=i[i[i[e+4>>2]+4>>2]>>2],(0|o)==i[i[i[e>>2]+4>>2]+16>>2];);o=i[i[i[i[i[i[e+4>>2]+8>>2]>>2]>>2]+4>>2]+8>>2],i[f>>2]=i[i[T+4>>2]+12>>2],f2=1,S2(n,e,i[L2(n,f,0)+8>>2],i[i[P+4>>2]+8>>2],o,1);break a}if(J(g,e,s+56|0)>=u(0)){if(d[f+14|0]=1,d[i[i[i[f+4>>2]+4>>2]>>2]+14|0]=1,!o2(i[P+4>>2]))break i;o=i[P+16>>2],e=i[n+72>>2],c[o+28>>2]=c[e+28>>2],c[o+32>>2]=c[e+32>>2]}else e=i[n+72>>2];if(!(J(S,e,s+56|0)<=u(0)))break a;if(d[Y+14|0]=1,d[f+14|0]=1,!o2(i[T+4>>2]))break i;f=i[T+16>>2],n=i[n+72>>2],c[f+28>>2]=c[n+28>>2],c[f+32>>2]=c[n+32>>2];break a}if(!o2(i[P+4>>2])||!o2(i[T+4>>2])||!Z(i[i[T+4>>2]+12>>2],P))break i;if(e=i[P+16>>2],c[e+28>>2]=c[s+84>>2],c[e+32>>2]=c[s+88>>2],o=X0(i[n+68>>2],e),e=i[P+16>>2],i[e+36>>2]=o,(0|o)==2147483647)break f;i[s+112>>2]=i[y+12>>2],i[s+116>>2]=i[g+12>>2],i[s+120>>2]=i[I+12>>2],i[s+124>>2]=i[S+12>>2],i[e+24>>2]=0,i[e+16>>2]=0,i[e+20>>2]=0,a=c[e+28>>2],r=(b=u(c[g+28>>2]-a))>2],t=u(c[g+32>>2]-b),k=u(r+(t>2]-a))>2]-b),r=u(r+(t>2]=t,k=u(.5*+r/G),c[s+100>>2]=k,r=u(u(u(t*c[y+16>>2])+u(c[g+16>>2]*k))+u(0)),c[e+16>>2]=r,A=u(u(u(t*c[y+20>>2])+u(c[g+20>>2]*k))+u(0)),c[e+20>>2]=A,k=u(u(u(t*c[y+24>>2])+u(c[g+24>>2]*k))+u(0)),c[e+24>>2]=k,h=(t=u(c[I+28>>2]-a))>2]-b),t=u(h+(t>2]-a))>2]-b),a=u(h+(a>2]=a,b=u(.5*+t/G),c[s+108>>2]=b,t=u(r+u(u(a*c[I+16>>2])+u(c[S+16>>2]*b))),c[e+16>>2]=t,r=u(A+u(u(a*c[I+20>>2])+u(c[S+20>>2]*b))),c[e+20>>2]=r,a=u(k+u(u(a*c[I+24>>2])+u(c[S+24>>2]*b))),c[e+24>>2]=a,c[s+140>>2]=a,c[s+136>>2]=r,c[s+132>>2]=t,i[e+12>>2]=0,e=e+12|0,(0|(o=i[n+1736>>2]))==10?R[i[n+76>>2]](s+132|0,s+112|0,s+96|0,e):R[0|o](s+132|0,s+112|0,s+96|0,e,i[n+1896>>2]),i[e>>2]|w[n+60|0]||((0|(e=i[n+1732>>2]))==11?R[i[n+12>>2]](100156):R[0|e](100156,i[n+1896>>2]),d[n+60|0]=1),d[Y+14|0]=1,d[f+14|0]=1,d[i[i[i[f+4>>2]+4>>2]>>2]+14|0]=1}else c0(n,f)}return _=s+144|0,f2}y0(i[n+68>>2]),i[n+68>>2]=0}k2(n+1740|0,1),b2()}function n4(n,f,a,e,t,b){n|=0,f|=0,a|=0,e|=0,t|=0,b|=0;for(var o=0,k=0,s=0,r=0,A=0,l=u(0),v=0,h=u(0),y=u(0),m=0,g=0,I=0,S=0,M=0,P=0;(o=i[1776+(k=r<<2)>>2])&&(i[o>>2]=0),(o=i[1776+(4|k)>>2])&&(i[o>>2]=0),(o=i[1776+(8|k)>>2])&&(i[o>>2]=0),(o=i[1776+(12|k)>>2])&&(i[o>>2]=0),(0|(r=r+4|0))!=100;);if((r=i[544])||(r=j(16),i[544]=r),i[r+8>>2]=b,i[r+4>>2]=0,i[r+12>>2]=e,i[r>>2]=t,(r=i[545])||((t=j(1900))?(i[t+100>>2]=12,i[t+96>>2]=13,i[t+92>>2]=14,i[t+88>>2]=15,n2[t+80>>1]=0,i[t+52>>2]=0,i[t+56>>2]=100130,i[t+16>>2]=0,i[t+20>>2]=0,i[t>>2]=0,i[t+1896>>2]=0,i[t+1736>>2]=10,i[t+1732>>2]=11,i[t+1728>>2]=6,i[t+1724>>2]=5,i[t+1720>>2]=4,i[t+1716>>2]=3,i[t+104>>2]=16,i[t+76>>2]=17,i[t+12>>2]=18,i[t+24>>2]=0):t=0,i[545]=t,B2(t,100107,31),B2(i[545],100100,32),B2(i[545],100102,33),B2(i[545],100105,34),B2(i[545],100103,35),B2(i[545],100104,36),i[i[545]+56>>2]=100130,t=i[545],c[t+16>>2]=0,c[t+24>>2]=1,c[t+20>>2]=0,r=i[545]),t=0,b=i[544],i[r>>2]&&p2(r,0),i[r+112>>2]=0,i[r>>2]=1,d[r+108|0]=0,i[r+1896>>2]=b,i[r+8>>2]=0,(0|a)>0)for(b=0;;){if(I=i[(b<<2)+f>>2],o=i[545],i[o>>2]!=1&&p2(o,1),i[o>>2]=2,i[o+4>>2]=0,i[o+112>>2]>0&&(d[o+108|0]=1),r=0,(0|I)>0)for(;;){A=i[545],i[A>>2]!=2&&p2(A,2),v=(L(t+r|0,e)<<2)+n|0;i:{f:{if(w[A+108|0]){if(!r0(A)){if((0|(k=i[A+1732>>2]))!=11)break f;R[i[A+12>>2]](100902);break i}i[A+4>>2]=0}if(P=(m=+(h=(S=(m=+(l=c[v+4>>2]))<-1e37)?u(-9999999933815813e21):l))>1e37,s=(g=+(y=(M=(g=+(l=c[v>>2]))<-1e37)?u(-9999999933815813e21):l))>1e37,((o=+(l=c[v+8>>2])<-1e37)|(k=+(l=o?u(-9999999933815813e21):l)>1e37)|S|m>1e37||g>1e37||M)&&((0|(o=i[A+1732>>2]))==11?R[i[A+12>>2]](100155):R[0|o](100155,i[A+1896>>2])),h=P?u(9999999933815813e21):h,y=s?u(9999999933815813e21):y,!i[A+8>>2]){if((0|(o=i[A+112>>2]))<=99){c[124+(s=A+(o<<4)|0)>>2]=k?u(9999999933815813e21):l,c[s+120>>2]=h,c[s+116>>2]=y,i[s+128>>2]=v,i[A+112>>2]=o+1;break i}if(!r0(A)){if((0|(k=i[A+1732>>2]))!=11)break f;R[i[A+12>>2]](100902);break i}}a:{n:{if(!(o=i[A+4>>2])){if(!(k=s0(i[A+8>>2])))break a;if(Z(k,i[k+4>>2]))break n;break a}if(!o2(o))break a;k=i[o+12>>2]}o=i[k+16>>2],c[o+16>>2]=y,i[o+12>>2]=v,i[o+24>>2]=0,c[o+20>>2]=h,i[k+28>>2]=1,i[i[k+4>>2]+28>>2]=-1,i[A+4>>2]=k;break i}if((0|(k=i[A+1732>>2]))==11){R[i[A+12>>2]](100902);break i}}R[0|k](100902,i[A+1896>>2])}if((0|I)==(0|(r=r+1|0)))break}if(o=i[545],i[o>>2]!=2&&p2(o,2),i[o>>2]=1,t=t+I|0,(0|(b=b+1|0))==(0|a))break}s=i[545],n=j(40),i[n>>2]=0,k=k1(t=s+1740|0,1,n,4),o=W,n=0;i:{f:{for(;;){if(n){if((0|(f=i[s+1732>>2]))!=11){if(n=i[s+1896>>2],i[978]=0,I2(0|f,100902,0|n),n=i[978],i[978]=0,f=-1,n&&(e=i[979])){if(!(f=X(i[n>>2],k,o)))break f;W=e}if(n=W,(0|f)==1)continue;break i}if(n=i[s+12>>2],i[978]=0,Z0(0|n,100902),n=i[978],i[978]=0,f=-1,n&&(e=i[979])){if(!(f=X(i[n>>2],k,o)))break f;W=e}if(n=W,(0|f)==1)continue;break i}if(i[s>>2]!=1){if(i[978]=0,I2(19,0|s,1),n=i[978],i[978]=0,f=-1,n&&(e=i[979])){if(!(f=X(i[n>>2],k,o)))break f;W=e}if(n=W,(0|f)==1)continue}if(i[s>>2]=0,!i[s+8>>2]){if(!(w[s+80|0]|i[s+104>>2]!=16)){if(i[978]=0,a=0|f0(20,0|s),n=i[978],i[978]=0,f=-1,n&&(e=i[979])){if(!(f=X(i[n>>2],k,o)))break f;W=e}if(n=W,(0|f)==1)continue;if(a){i[s+1896>>2]=0;break i}}if(i[978]=0,a=0|f0(21,0|s),n=i[978],i[978]=0,f=-1,n&&(e=i[979])){if(!(f=X(i[n>>2],k,o)))break f;W=e}if(n=W,(0|f)==1)continue;if(!a){if(i[978]=0,I2(22,0|t,1),n=i[978],i[978]=0,n&&(e=i[979])){if(!X(i[n>>2],k,o))break f;W=e}n=W;continue}}if(i[978]=0,V0(s),n=i[978],i[978]=0,f=-1,n&&(e=i[979])){if(!(f=X(i[n>>2],k,o)))break f;W=e}if(n=W,(0|f)!=1){if(i[978]=0,a=0|f0(24,0|s),n=i[978],i[978]=0,f=-1,n&&(e=i[979])){if(!(f=X(i[n>>2],k,o)))break f;W=e}if(n=W,(0|f)!=1)if(a){b=i[s+8>>2];a:{n:{if(!w[s+60|0]){if(w[s+81|0]?(i[978]=0,a=0|a4(25,0|b,1,1)):(i[978]=0,a=0|f0(26,0|b)),n=i[978],i[978]=0,f=-1,n&&(e=i[979])){if(!(f=X(i[n>>2],k,o)))break f;W=e}if(n=W,(0|f)==1)continue;if(!a){if(i[978]=0,I2(22,0|t,1),n=i[978],i[978]=0,n&&(e=i[979])){if(!X(i[n>>2],k,o))break f;W=e}n=W;continue}if(i[s+88>>2]!=15|i[s+100>>2]!=12|i[s+96>>2]!=13|i[s+92>>2]!=14||i[s+1716>>2]!=3|i[s+1728>>2]!=6|i[s+1724>>2]!=5||i[s+1720>>2]!=4)if(w[s+81|0]){if(i[978]=0,I2(27,0|s,0|b),n=i[978],i[978]=0,f=-1,n&&(e=i[979])){if(!(f=X(i[n>>2],k,o)))break f;W=e}if(n=W,(0|f)==1)continue}else{if(i[978]=0,I2(28,0|s,0|b),n=i[978],i[978]=0,f=-1,n&&(e=i[979])){if(!(f=X(i[n>>2],k,o)))break f;W=e}if(n=W,(0|f)==1)continue}if(i[s+104>>2]!=16){if(i[978]=0,$0(b),n=i[978],i[978]=0,f=-1,n&&(e=i[979])){if(!(f=X(i[n>>2],k,o)))break f;W=e}if(n=W,(0|f)==1)continue;if(n=i[s+104>>2],i[978]=0,Z0(0|n,0|b),n=i[978],i[978]=0,f=-1,!n||!(e=i[979]))break a;if(f=X(i[n>>2],k,o))break n;break f}}if(i[978]=0,d0(b),n=i[978],i[978]=0,f=-1,n&&(e=i[979])){if(!(f=X(i[n>>2],k,o)))break f;W=e}if(n=W,(0|f)==1)continue;i[s+8>>2]=0,i[s+1896>>2]=0;break i}W=e}if(n=W,(0|f)!=1)break}else{if(i[978]=0,I2(22,0|t,1),n=i[978],i[978]=0,n&&(e=i[979])){if(!X(i[n>>2],k,o))break f;W=e}n=W}}}i[s+1896>>2]=0,i[s+8>>2]=0;break i}Q(k),k2(n,e),b2()}return Q(k),i[i[544]+4>>2]}function e4(n,f,a,e,t,b){n|=0,f=+f,a|=0,e|=0,t|=0,b|=0;var o=0,k=0,s=0,r=0,A=0,l=0,v=0,h=0,y=0,m=0,g=0,I=0,S=0,M=0,P=0,T=0,O=0,G=0,Y=0,f2=0,E2=0;_=h=_-560|0,i[h+44>>2]=0,u0(+f),o=0|c2(1),c2(0),(0|o)<0?(M=1,O=1034,u0(+(f=-f)),o=0|c2(1),c2(0)):2048&t?(M=1,O=1037):(O=(M=1&t)?1040:1035,Y=!M);i:if((2146435072&o)!=2146435072){P=h+16|0;f:{a:{n:{if(f=u1(f,h+44|0),(f+=f)!=0){if(o=i[h+44>>2],i[h+44>>2]=o-1,(0|(T=32|b))!=97)break n;break f}if((0|(T=32|b))==97)break f;A=i[h+44>>2],l=(0|e)<0?6:e;break a}A=o-29|0,i[h+44>>2]=A,f*=268435456,l=(0|e)<0?6:e}for(k=m=(h+48|0)+((0|A)>=0?288:0)|0;e=f<4294967296&f>=0?~~f>>>0:0,i[k>>2]=e,k=k+4|0,(f=1e9*(f-+(e>>>0)))!=0;);if((0|A)<=0)e=A,o=k,s=m;else for(s=m,e=A;;){if(r=(0|e)>=29?29:e,!(s>>>0>(o=k-4|0)>>>0)){for(y=0;e=i[o>>2],v=31&r,G=y,(63&r)>>>0>=32?(y=e<>>32-v,e<<=v),y=y+g|0,f2=o,E2=(v=G+e|0)-h0(y=i1(v,e>>>0>v>>>0?y+1|0:y,1e9),r2,1e9,0)|0,i[f2>>2]=E2,s>>>0<=(o=o-4|0)>>>0;);y&&(i[(s=s-4|0)>>2]=y)}for(;s>>>0<(o=k)>>>0&&!i[(k=o-4|0)>>2];);if(e=i[h+44>>2]-r|0,i[h+44>>2]=e,k=o,!((0|e)>0))break}if((0|e)<0)for(S=1+((l+25>>>0)/9|0)|0,g=(0|T)==102;;){if(v=(0|(e=0-e|0))>=9?9:e,o>>>0<=s>>>0)k=i[s>>2];else{for(y=1e9>>>v|0,r=-1<>2],i[k>>2]=G+(e>>>v|0),e=L(y,e&r),(k=k+4|0)>>>0>>0;);k=i[s>>2],e&&(i[o>>2]=e,o=o+4|0)}if(e=v+i[h+44>>2]|0,i[h+44>>2]=e,s=(!k<<2)+s|0,o=o-(k=g?m:s)>>2>(0|S)?k+(S<<2)|0:o,!((0|e)<0))break}if(e=0,!(o>>>0<=s>>>0||(e=L(m-s>>2,9),k=10,(r=i[s>>2])>>>0<10)))for(;e=e+1|0,r>>>0>=(k=L(k,10))>>>0;);if((0|(k=(l-((0|T)!=102?e:0)|0)-((0|T)==103&(0|l)!=0)|0))<(L(o-m>>2,9)-9|0)){if(A=(S=((h+48|0)+((0|A)<0?4:292)|0)+((r=(0|(y=k+9216|0))/9|0)<<2)|0)-4096|0,k=10,(0|(v=y-L(r,9)|0))<=7)for(;k=L(k,10),(0|(v=v+1|0))!=8;);if(!(!(v=(g=i[A>>2])-L(k,y=(g>>>0)/(k>>>0)|0)|0)&(0|(r=S-4092|0))==(0|o))&&(!(1&y)&&(f=9007199254740992,!(1&d[S-4100|0])|(0|k)!=1e9|s>>>0>=A>>>0)||(f=9007199254740994),I=(0|o)==(0|r)?1:1.5,I=(r=k>>>1|0)>>>0>v>>>0?.5:(0|r)==(0|v)?I:1.5,w[0|O]!=45|Y||(I=-I,f=-f),r=g-v|0,i[A>>2]=r,f+I!=f)){if(e=k+r|0,i[A>>2]=e,e>>>0>=1e9)for(;i[A>>2]=0,(A=A-4|0)>>>0>>0&&(i[(s=s-4|0)>>2]=0),e=i[A>>2]+1|0,i[A>>2]=e,e>>>0>999999999;);if(e=L(m-s>>2,9),k=10,!((r=i[s>>2])>>>0<10))for(;e=e+1|0,r>>>0>=(k=L(k,10))>>>0;);}o=o>>>0>(k=A+4|0)>>>0?k:o}for(;r=o,!(y=o>>>0<=s>>>0)&&!i[(o=o-4|0)>>2];);if((0|T)==103){if(l=((o=(0|(k=l||1))>(0|e)&(0|e)>-5)?-1^e:-1)+k|0,b=(o?-1:-2)+b|0,!(A=8&t)){if(o=-9,!y&&(A=i[r-4>>2])&&(v=10,o=0,!((A>>>0)%10|0))){for(;k=o,o=o+1|0,!((A>>>0)%((v=L(v,10))>>>0)|0););o=-1^k}k=L(r-m>>2,9),(-33&b)!=70?(A=0,l=(0|(o=(0|(o=((e+k|0)+o|0)-9|0))>0?o:0))>(0|l)?l:o):(A=0,l=(0|(o=(0|(o=(o+k|0)-9|0))>0?o:0))>(0|l)?l:o)}}else A=8&t;if(v=-1,(0|((y=A|l)?2147483645:2147483646))<(0|l))break i;if(g=1+(((0|y)!=0)+l|0)|0,(0|(k=-33&b))!=70){if((P-(o=Q2(((o=e>>31)^e)-o|0,0,P))|0)<=1)for(;d[0|(o=o-1|0)]=48,(P-o|0)<2;);if(d[0|(S=o-2|0)]=b,d[o-1|0]=(0|e)<0?45:43,(0|(o=P-S|0))>(2147483647^g))break i}else{if((2147483647^g)<(0|e))break i;o=(0|e)>0?e:0}if((0|(e=o+g|0))>(2147483647^M))break i;z(n,32,a,g=e+M|0,t),N(n,O,M),z(n,48,a,g,65536^t);a:{n:{e:{if((0|k)==70){for(e=8|(b=h+16|0),A=9|b,s=k=s>>>0>m>>>0?m:s;;){o=Q2(i[s>>2],0,A);t:if((0|k)==(0|s))(0|o)==(0|A)&&(d[h+24|0]=48,o=e);else{if(h+16>>>0>=o>>>0)break t;for(;d[0|(o=o-1|0)]=48,h+16>>>0>>0;);}if(N(n,o,A-o|0),!(m>>>0>=(s=s+4|0)>>>0))break}if(y&&N(n,1069,1),(0|l)<=0|s>>>0>=r>>>0)break e;for(;;){if((o=Q2(i[s>>2],0,A))>>>0>h+16>>>0)for(;d[0|(o=o-1|0)]=48,h+16>>>0>>0;);if(N(n,o,(0|l)>=9?9:l),o=l-9|0,r>>>0<=(s=s+4|0)>>>0)break n;if(e=(0|l)>9,l=o,!e)break}break n}t:if(!((0|l)<0))for(m=s>>>0>>0?r:s+4|0,e=8|(b=h+16|0),r=9|b,k=s;;){(0|r)==(0|(o=Q2(i[k>>2],0,r)))&&(d[h+24|0]=48,o=e);u:if((0|k)==(0|s))N(n,o,1),o=o+1|0,A|l&&N(n,1069,1);else{if(h+16>>>0>=o>>>0)break u;for(;d[0|(o=o-1|0)]=48,h+16>>>0>>0;);}if(N(n,o,(0|(b=r-o|0))<(0|l)?b:l),l=l-b|0,m>>>0<=(k=k+4|0)>>>0)break t;if(!((0|l)>=0))break}z(n,48,l+18|0,18,0),N(n,S,P-S|0);break a}o=l}z(n,48,o+9|0,9,0)}z(n,32,a,g,8192^t),v=(0|a)<(0|g)?g:a;break i}if(A=(b<<26>>31&9)+O|0,!(e>>>0>11)){for(o=12-e|0,I=16;I*=16,o=o-1|0;);f=w[0|A]!=45?f+I-I:-(I+(-f-I))}for((0|P)==(0|(o=Q2(((o=i[h+44>>2])^(k=o>>31))-k|0,0,P)))&&(d[h+15|0]=48,o=h+15|0),m=2|M,s=32&b,k=i[h+44>>2],d[0|(l=o-2|0)]=b+15,d[o-1|0]=(0|k)<0?45:43,o=8&t,k=h+16|0;b=k,r=$1(f)<2147483648?~~f:-2147483648,d[0|k]=s|w[r+1600|0],!((0|e)>0|o)&(f=16*(f-+(0|r)))==0|((k=b+1|0)-(h+16|0)|0)!=1||(d[b+1|0]=46,k=b+2|0),f!=0;);v=-1,(2147483645-(b=(o=P-l|0)+m|0)|0)<(0|e)||(r=b,s=k-(b=h+16|0)|0,z(n,32,a,k=r+(e=e&&(s-2|0)<(0|e)?e+2|0:s)|0,t),N(n,A,m),z(n,48,a,k,65536^t),N(n,b,s),z(n,48,e-s|0,0,0),N(n,l,o),z(n,32,a,k,8192^t),v=(0|a)<(0|k)?k:a)}else z(n,32,a,o=M+3|0,-65537&t),N(n,O,M),e=32&b,N(n,f!=f?e?1053:1061:e?1057:1065,3),z(n,32,a,o,8192^t),v=(0|a)<(0|o)?o:a;return _=h+560|0,0|v}function N0(n,f,a,e,t,b){var o=0,k=0,s=0,r=0,A=0,l=0,v=0,h=0,y=0,m=0,g=0,I=0,S=0,M=0,P=0,T=0,O=0,G=0,Y=0,f2=0,E2=0;_=s=_-80|0,i[s+76>>2]=f,O=t-192|0,G=e-384|0,f2=s+55|0,I=s+56|0;i:{f:{a:{n:{e:for(;;){o=0;t:for(;;){if(r=f,(2147483647^y)<(0|o))break n;y=o+y|0;u:{o:{b:{if(k=w[0|(o=f)])for(;;){k:{c:if(f=255&k){if((0|f)!=37)break k;for(k=o;;){if(w[k+1|0]!=37){f=k;break c}if(o=o+1|0,l=w[k+2|0],k=f=k+2|0,(0|l)!=37)break}}else f=o;if((0|(o=o-r|0))>(0|(Y=2147483647^y)))break n;if(n&&N(n,r,o),o)continue t;i[s+76>>2]=f,o=f+1|0,m=-1,k=d[f+1|0]-48|0,w[f+2|0]!=36|k>>>0>=10||(m=k,S=1,o=f+3|0),i[s+76>>2]=o,v=0;c:if((f=(k=d[0|o])-32|0)>>>0>31)l=o;else if(l=o,75913&(f=1<>2]=l,v|=f,(f=(k=d[o+1|0])-32|0)>>>0>=32)break c;if(o=l,!(75913&(f=1<>2]}else{if(k=l+1|0,w[l+2|0]!=36|d[l+1|0]-48>>>0>=10){if(S)break b;if(!n){i[s+76>>2]=k,S=0,g=0;break c}f=i[a>>2],i[a>>2]=f+4,S=0,f=i[f>>2]}else f=d[0|k],k=l+3|0,S=1,n?f=i[(f<<3)+G>>2]:(i[(f<<2)+O>>2]=10,f=0);if(i[s+76>>2]=k,g=f,(0|f)>=0)break c;g=0-f|0,v|=8192}if(o=0,A=-1,w[0|k]==46)if(w[k+1|0]!=42)i[s+76>>2]=k+1,A=c1(s+76|0),f=i[s+76>>2],P=1;else{if(f=k+2|0,w[k+3|0]!=36|d[k+2|0]-48>>>0>=10){if(S)break b;n?(k=i[a>>2],i[a>>2]=k+4,A=i[k>>2]):A=0}else f=d[0|f],n?A=i[(f<<3)+G>>2]:(i[(f<<2)+O>>2]=10,A=0),f=k+4|0;i[s+76>>2]=f,P=(0|A)>=0}else f=k,P=0;for(;;){if(T=o,l=28,h=f,(k=d[0|f])-123>>>0<4294967238)break a;if(f=f+1|0,!((o=w[1071+(k+L(o,58)|0)|0])-1>>>0<8))break}i[s+76>>2]=f;c:if((0|o)==27){if((0|m)>=0)break a;if(o=0,!n)continue t}else{if(!o)break a;if((0|m)>=0){if(!n){i[(m<<2)+t>>2]=o;continue e}o=i[4+(k=(m<<3)+e|0)>>2],i[s+64>>2]=i[k>>2],i[s+68>>2]=o;break c}if(!n)break u;a1(s- -64|0,o,a)}if(32&w[0|n])break f;k=-65537&v,v=8192&v?k:v,m=0,M=1024,l=I;c:{A:{r:{w:{y:{p:{v:{s:{l:{d:{m:{g:{E:{h:{C:{switch(o=d[0|h],(o=T&&(15&o)==3?-45&o:o)-88|0){case 11:break c;case 9:case 13:case 14:case 15:break A;case 27:break v;case 12:case 17:break d;case 23:break m;case 0:case 32:break g;case 24:break E;case 22:break h;case 29:break C;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 10:case 16:case 18:case 19:case 20:case 21:case 25:case 26:case 28:case 30:case 31:break o}switch(o-65|0){case 0:case 4:case 5:case 6:break A;case 2:break y;case 1:case 3:break o}if((0|o)==83)break p;break o}r=i[s+64>>2],k=i[s+68>>2],M=1024;break l}o=0;h:switch(255&T){case 0:case 1:case 6:i[i[s+64>>2]>>2]=y;continue t;case 2:r=i[s+64>>2],i[r>>2]=y,i[r+4>>2]=y>>31;continue t;case 3:n2[i[s+64>>2]>>1]=y;continue t;case 4:d[i[s+64>>2]]=y;continue t;case 7:break h;default:continue t}r=i[s+64>>2],i[r>>2]=y,i[r+4>>2]=y>>31;continue t}A=A>>>0<=8?8:A,v|=8,o=120}if(f=I,(r=i[s+64>>2])|(k=i[s+68>>2]))for(E2=32&o;d[0|(f=f-1|0)]=E2|w[1600+(15&r)|0],T=!k&r>>>0>15|(0|k)!=0,h=k,k=k>>>4|0,r=(15&h)<<28|r>>>4,T;);if(r=f,!(i[s+64>>2]|i[s+68>>2])|!(8&v))break s;M=1024+(o>>>4|0)|0,m=2;break s}if(f=I,k=o=i[s+68>>2],o|(r=i[s+64>>2]))for(;d[0|(f=f-1|0)]=7&r|48,h=!k&r>>>0>7|(0|k)!=0,k=(o=k)>>>3|0,r=(7&o)<<29|r>>>3,h;);if(r=f,!(8&v))break s;A=(0|(f=I-f|0))<(0|A)?A:f+1|0;break s}r=i[s+64>>2],k=f=i[s+68>>2],(0|f)<0?(k=o=0-(f+((0|r)!=0)|0)|0,r=0-r|0,i[s+64>>2]=r,i[s+68>>2]=o,m=1,M=1024):2048&v?(m=1,M=1025):M=(m=1&v)?1026:1024}r=Q2(r,k,I)}if((0|A)<0&P)break n;if(v=P?-65537&v:v,!(A|((f=i[s+64>>2])|(o=i[s+68>>2]))!=0)){r=I,A=0;break o}A=(0|(f=!(f|o)+(I-r|0)|0))<(0|A)?A:f;break o}h=l=A>>>0>=2147483647?2147483647:A,v=(0|l)!=0;v:{s:{l:{d:if(!(!(3&(f=r=(f=i[s+64>>2])||1071))|!l))for(;;){if(!w[0|f])break l;if(v=(0|(h=h-1|0))!=0,!(3&(f=f+1|0)))break d;if(!h)break}if(!v)break s;if(!(!w[0|f]|h>>>0<4))for(;;){if((-1^(o=i[f>>2]))&o-16843009&-2139062144)break l;if(f=f+4|0,!((h=h-4|0)>>>0>3))break}if(!h)break s}for(;;){if(!w[0|f])break v;if(f=f+1|0,!(h=h-1|0))break}}f=0}if(l=(f=f?f-r|0:l)+r|0,(0|A)>=0){v=k,A=f;break o}if(v=k,A=f,w[0|l])break n;break o}if(A){k=i[s+64>>2];break w}o=0,z(n,32,g,0,v);break r}i[s+12>>2]=0,i[s+8>>2]=i[s+64>>2],k=s+8|0,i[s+64>>2]=k,A=-1}for(o=0;;){if(r=i[k>>2]){if((0|(r=t1(s+4|0,r)))<0)break f;if(!(r>>>0>A-o>>>0)&&(k=k+4|0,A>>>0>(o=o+r|0)>>>0))continue}break}if(l=61,(0|o)<0)break a;if(z(n,32,g,o,v),o)for(l=0,k=i[s+64>>2];;){if(!(r=i[k>>2])||(l=(r=t1(A=s+4|0,r))+l|0)>>>0>o>>>0)break r;if(N(n,A,r),k=k+4|0,!(o>>>0>l>>>0))break}else o=0}z(n,32,g,o,8192^v),o=(0|o)<(0|g)?g:o;continue t}if((0|A)<0&P)break n;if(l=61,(0|(o=0|R[0|b](n,q[s+64>>3],g,A,v,o)))>=0)continue t;break a}d[s+55|0]=i[s+64>>2],A=1,r=f2,v=k;break o}k=w[o+1|0],o=o+1|0}if(n)break i;if(!S)break u;for(o=1;;){if(n=i[(o<<2)+t>>2]){if(a1((o<<3)+e|0,n,a),y=1,(0|(o=o+1|0))!=10)continue;break i}break}if(y=1,o>>>0>=10)break i;for(;;){if(i[(o<<2)+t>>2])break b;if((0|(o=o+1|0))==10)break}break i}l=28;break a}if((0|(f=(0|(k=l-r|0))<(0|A)?A:k))>(2147483647^m))break n;if(l=61,(0|Y)<(0|(o=(0|(A=f+m|0))<(0|g)?g:A)))break a;z(n,32,o,A,v),N(n,M,m),z(n,48,o,A,65536^v),z(n,48,f,k,0),N(n,r,k),z(n,32,o,A,8192^v),f=i[s+76>>2];continue}break}break}y=0;break i}l=61}i[806]=l}y=-1}return _=s+80|0,y}function t4(n){n|=0;var f=0,a=0,e=0,t=0,b=0,o=0,k=0,s=0,r=u(0),A=0,l=u(0),v=0,h=0,y=0,m=0,g=0,I=0,S=0,M=0,P=0;_=o=_-48|0,d[n+60|0]=0;i:{if(f=i[n+8>>2],(0|(a=i[f+64>>2]))!=(0|(s=f- -64|0)))for(;;){f=i[a+12>>2],e=i[a>>2],b=i[a+16>>2],t=i[i[a+4>>2]+16>>2];f:{if(!(c[b+28>>2]!=c[t+28>>2]|c[b+32>>2]!=c[t+32>>2]|i[f+12>>2]==(0|a))){if(l0(n,f,a),$(a)){t=i[f+12>>2];break f}break i}t=f,f=a}if(i[t+12>>2]==(0|f)){if((0|f)!=(0|t)&&(e=(0|e)!=(0|t)&i[e+4>>2]!=(0|t)?e:i[e>>2],!$(t))||(a=(0|f)==(0|e)|i[e+4>>2]==(0|f)?i[e>>2]:e,!$(f)))break i}else a=e;if((0|a)==(0|s))break}(a=j(28))?((f=j(28))?(i[f+8>>2]=0,i[f+12>>2]=32,t=j(132),i[f>>2]=t,t?(e=j(264),i[f+4>>2]=e,e?(i[f+24>>2]=8,i[f+16>>2]=0,i[f+20>>2]=0,i[t+4>>2]=1,i[e+8>>2]=0):(Q(t),Q(f),f=0)):(Q(f),f=0)):f=0,i[a>>2]=f,f?(e=j(128),i[a+4>>2]=e,e?(i[a+24>>2]=8,i[a+20>>2]=0,i[a+12>>2]=0,i[a+16>>2]=32):(Q(i[f+4>>2]),Q(i[f>>2]),Q(f),Q(a),a=0)):(Q(a),a=0)):a=0,h=a,i[n+68>>2]=h;f:if(h){a=e=i[n+8>>2];a:{n:{for(;;){if((0|e)!=(0|(a=i[a>>2]))){if(f=X0(h,a),i[a+36>>2]=f,(0|f)!=2147483647)continue;break n}break}if(_=I=_-400|0,e=j(4+(f=(S=i[h+12>>2])<<2)|0),i[h+8>>2]=e,_=I+400|0,e){if((t=(f+e|0)-4|0)>>>0>=e>>>0)for(f=i[h+4>>2],a=e;i[a>>2]=f,f=f+4|0,t>>>0>=(a=a+4|0)>>>0;);for(i[I+4>>2]=t,i[I>>2]=e,v=8|I,M=2016473283,b=I;;){if((s=i[v-4>>2])>>>0>(k=i[b>>2])+40>>>0)for(;;){for(M=L(M,1539415821)+1|0,m=i[(f=((M>>>0)%(1+(s-k>>2)>>>0)<<2)+k|0)>>2],i[f>>2]=i[k>>2],i[k>>2]=m,f=s+4|0,a=k-4|0;;){e=f,t=a,a=a+4|0,A=i[t+4>>2],g=i[A>>2],r=c[g+28>>2],y=i[m>>2];e:if(!(r<(l=c[y+28>>2])))for(;;){if(f=a,!(!(c[g+32>>2]<=c[y+32>>2])|r!=l))break e;if(a=f+4|0,t=f,A=i[f+4>>2],g=i[A>>2],l>(r=c[g+28>>2]))break}v=i[(f=e-4|0)>>2],g=i[v>>2];e:if(!(l<(r=c[g+28>>2])))for(;;){if(!(!(c[y+32>>2]<=c[g+32>>2])|r!=l))break e;if(e=f,v=i[(f=f-4|0)>>2],g=i[v>>2],l<(r=c[g+28>>2]))break}if(i[a>>2]=v,i[f>>2]=A,!(f>>>0>a>>>0))break}if(v=i[a>>2],i[a>>2]=A,i[f>>2]=v,(a-k|0)<(s-f|0)?(f=e,a=s,s=t):(f=k,a=t,k=e),i[b+4>>2]=a,i[b>>2]=f,b=b+8|0,!(k+40>>>0>>0))break}if(v=b,(A=k+4|0)>>>0<=s>>>0)for(;;){y=i[A>>2];e:if(!(k>>>0>=(f=a=A)>>>0))for(;;){if(b=i[y>>2],r=c[b+28>>2],t=i[(f=a-4|0)>>2],e=i[t>>2],r<(l=c[e+28>>2])){f=a;break e}if(!(!(c[b+32>>2]<=c[e+32>>2])|r!=l)){f=a;break e}if(i[a>>2]=t,a=f,!(k>>>0>>0))break}if(i[f>>2]=y,!((A=A+4|0)>>>0<=s>>>0))break}if(!(I>>>0<=(b=v-8|0)>>>0))break}if(i[h+20>>2]=1,i[h+16>>2]=S,S=i[h>>2],(0|(b=i[S+8>>2]))>0)for(y=i[S+4>>2],m=i[S>>2],f=b;;){for(t=f,h=y+((A=i[m+(f<<2)>>2])<<3)|0,a=f;(0|b)<=(0|(f=a<<1))||(k=i[y+(i[m+((e=1|f)<<2)>>2]<<3)>>2],r=c[k+28>>2],s=i[y+(i[m+(f<<2)>>2]<<3)>>2],!(r<(l=c[s+28>>2]))&(!(c[k+32>>2]<=c[s+32>>2])|r!=l)||(f=e)),!((0|f)>(0|b)||(v=i[h>>2],r=c[v+28>>2],k=i[m+(f<<2)>>2],e=i[(s=y+(k<<3)|0)>>2],r<(l=c[e+28>>2])|r==l&c[v+32>>2]<=c[e+32>>2]));)i[m+(a<<2)>>2]=k,i[s+4>>2]=a,a=f;if(i[m+(a<<2)>>2]=A,i[h+4>>2]=a,f=t-1|0,!((0|t)>1))break}i[S+20>>2]=1,a=1}else a=0;if(a)break a}y0(i[n+68>>2]),i[n+68>>2]=0;break f}if((f=j(20))&&(i[f+16>>2]=9,i[f+12>>2]=n,i[f>>2]=0,i[f+8>>2]=f,i[f+4>>2]=f),i[n+64>>2]=f,!f)break i;if(o1(n,u(-3999999973526325e22)),o1(n,u(3999999973526325e22)),f=v0(i[n+68>>2]))for(;;){a:if(a=b1(i[n+68>>2]))for(;;){if(c[a+28>>2]!=c[f+28>>2]|c[a+32>>2]!=c[f+32>>2])break a;if(t=i[v0(i[n+68>>2])+8>>2],e=i[f+8>>2],i[o+24>>2]=0,i[o+28>>2]=0,i[o+16>>2]=0,i[o+20>>2]=0,i[o+8>>2]=0,i[o+12>>2]=0,i[o>>2]=1056964608,i[o+4>>2]=1056964608,a=i[e+16>>2],i[o+16>>2]=i[a+12>>2],i[o+20>>2]=i[i[t+16>>2]+12>>2],c[o+36>>2]=c[a+16>>2],c[o+40>>2]=c[a+20>>2],c[o+44>>2]=c[a+24>>2],i[a+12>>2]=0,b=a+12|0,(0|(a=i[n+1736>>2]))==10?R[i[n+76>>2]](o+36|0,o+16|0,o,b):R[0|a](o+36|0,o+16|0,o,b,i[n+1896>>2]),i[b>>2]||(i[b>>2]=i[o+16>>2]),!Z(e,t))break i;if(!(a=b1(i[n+68>>2])))break}if(a0(n,f),!(f=v0(i[n+68>>2])))break}for(a=i[i[i[n+64>>2]+4>>2]>>2],i[n+72>>2]=i[i[a>>2]+16>>2];i[i[a>>2]+24>>2]=0,m2(i[a+4>>2]),Q(a),f=i[n+64>>2],a=i[i[f+4>>2]>>2];);if((0|f)!=(0|(a=i[f+4>>2])))for(;Q(a),(0|f)!=(0|(a=i[a+4>>2])););if(Q(f),y0(i[n+68>>2]),P=1,f=i[n+8>>2],(0|(n=i[f+40>>2]))!=(0|(a=f+40|0)))for(;;){if(e=i[n+8>>2],n=i[n>>2],(0|e)==i[i[e+12>>2]+12>>2]&&(f=i[e+8>>2],i[f+28>>2]=i[f+28>>2]+i[e+28>>2],f=i[f+4>>2],i[f+28>>2]=i[f+28>>2]+i[i[e+4>>2]+28>>2],!$(e))){P=0;break f}if((0|n)==(0|a))break}}return _=o+48|0,0|P}k2(n+1740|0,1),b2()}function a0(n,f){var a=0,e=0,t=0,b=0,o=u(0),k=0,s=0,r=u(0),A=0,l=0,v=0;_=v=_-16|0,i[n+72>>2]=f,a=t=i[f+8>>2];i:{f:{a:{for(;;){if(e=i[a+24>>2])break a;if((0|t)==(0|(a=i[a+8>>2])))break}for(i[v>>2]=i[t+4>>2],t=a=i[n+64>>2];t=i[t+4>>2],(e=i[t>>2])&&!(0|R[i[a+16>>2]](i[a+12>>2],v,e)););if(e=i[t>>2],t=i[i[i[e+4>>2]+8>>2]>>2],k=i[t>>2],b=i[e>>2],J(i[i[b+4>>2]+16>>2],f,i[b+16>>2])==u(0)){if(o=c[f+28>>2],a=i[e>>2],t=i[a+16>>2],!(o!=c[t+28>>2]|c[t+32>>2]!=c[f+32>>2])){l0(n,a,i[f+8>>2]);break f}if(b=i[a+4>>2],t=i[b+16>>2],!(o==c[t+28>>2]&c[t+32>>2]==c[f+32>>2])){if(!o2(b))break i;if(w[e+15|0]){if(!$(i[a+8>>2]))break i;d[e+15|0]=0}if(!Z(i[f+8>>2],a))break i;a0(n,f);break f}for(;e=i[i[i[e+4>>2]+4>>2]>>2],(0|t)==i[i[i[e>>2]+4>>2]+16>>2];);if(t=i[i[i[e+4>>2]+8>>2]>>2],k=i[t>>2],b=i[k+4>>2],a=i[b+8>>2],w[t+15|0]){if(i[k+24>>2]=0,m2(i[t+4>>2]),Q(t),!$(b))break i;b=i[i[a+4>>2]+12>>2]}if(!Z(i[f+8>>2],b))break i;s=i[b+8>>2],t=i[i[a+4>>2]+16>>2],o=c[t+28>>2],k=i[a+16>>2],S2(n,e,s,a,f=o<(r=c[k+28>>2])|o==r&c[t+32>>2]<=c[k+32>>2]?a:0,1);break f}if(s=w[e+12|0],k=i[k+4>>2],A=i[k+16>>2],o=c[A+28>>2],l=i[i[b+4>>2]+16>>2],a=e,o<(r=c[l+28>>2])||o==r&&(a=e,c[A+32>>2]<=c[l+32>>2])||(a=t),s|w[a+15|0]){n:{if((0|e)==(0|a)){if(t=A2(i[i[f+8>>2]+4>>2],i[b+12>>2]))break n;break i}if(!(t=A2(i[i[k+8>>2]+4>>2],i[f+8>>2])))break i;t=i[t+4>>2]}if(w[a+15|0]){if($(i[a>>2])){i[a>>2]=t,d[a+15|0]=0,i[t+24>>2]=a,a0(n,f);break f}break i}if(!(a=j(16))||(i[a>>2]=t,e=w0(i[n+64>>2],i[e+4>>2],a),i[a+4>>2]=e,!e))break i;d[a+13|0]=0,d[a+14|0]=0,d[a+15|0]=0,i[t+24>>2]=a,b=i[n+56>>2],t=i[i[a>>2]+28>>2]+i[i[i[e+4>>2]>>2]+8>>2]|0,i[a+8>>2]=t;n:{e:switch(b-100130|0){case 0:e=1&t;break n;case 1:e=(0|t)!=0;break n;case 2:e=(0|t)>0;break n;case 3:e=t>>>31|0;break n;case 4:break e;default:break n}e=t-2>>>0<4294967293}d[a+12|0]=e,a0(n,f);break f}S2(a=n,e,n=i[f+8>>2],n,0,1);break f}for(f=i[i[e>>2]+16>>2];e=i[i[i[e+4>>2]+4>>2]>>2],a=i[e>>2],(0|f)==i[a+16>>2];);if(w[e+15|0]&&(!(f=A2(i[i[i[i[i[e+4>>2]+8>>2]>>2]>>2]+4>>2],i[a+12>>2]))||!$(i[e>>2])||(i[e>>2]=f,d[e+15|0]=0,i[f+24>>2]=e,!(e=i[i[i[e+4>>2]+4>>2]>>2]))))break i;if(f=i[i[i[e+4>>2]+8>>2]>>2],a=i[f>>2],f=L2(n,f,0),(0|a)!=(0|(t=i[f+8>>2])))S2(n,e,t,a,a,1);else{if(t=i[e>>2],A=i[i[i[e+4>>2]+8>>2]>>2],k=i[A>>2],i[i[t+4>>2]+16>>2]!=i[i[k+4>>2]+16>>2]&&J0(n,e),l=1,b=i[n+72>>2],o=c[b+28>>2],s=i[t+16>>2],!(o!=c[s+28>>2]|c[s+32>>2]!=c[b+32>>2])){if(!Z(i[i[a+4>>2]+12>>2],t))break i;for(a=i[i[e>>2]+16>>2];e=i[i[i[e+4>>2]+4>>2]>>2],b=i[e>>2],(0|a)==i[b+16>>2];);if(w[e+15|0]&&(!(a=A2(i[i[i[i[i[e+4>>2]+8>>2]>>2]>>2]+4>>2],i[b+12>>2]))||!$(i[e>>2])||(i[e>>2]=a,d[e+15|0]=0,i[a+24>>2]=e,!(e=i[i[i[e+4>>2]+4>>2]>>2]))))break i;b=i[i[i[e+4>>2]+8>>2]>>2],a=i[b>>2],L2(n,b,A),b=i[n+72>>2],o=c[b+28>>2],l=0}a:{if(r=o,s=i[k+16>>2],r!=(o=c[s+28>>2])|c[s+32>>2]!=c[b+32>>2]){if(l)break a}else{if(!Z(f,i[i[k+4>>2]+12>>2]))break i;f=L2(n,A,0)}S2(n,e,i[f+8>>2],a,a,1);break f}if(a=i[t+16>>2],!((r=c[a+28>>2])>o)&(!(c[s+32>>2]<=c[a+32>>2])|o!=r)||(t=i[i[k+4>>2]+12>>2]),!(f=A2(i[i[f+8>>2]+4>>2],t)))break i;S2(n,e,f,a=i[f+8>>2],a,0),d[i[i[f+4>>2]+24>>2]+15|0]=1,K0(n,e)}}return void(_=v+16|0)}k2(n+1740|0,1),b2()}function V0(n){n|=0;var f=0,a=0,e=0,t=u(0),b=u(0),o=0,k=0,s=u(0),r=0,A=u(0),l=u(0),v=0,h=0,y=u(0),m=u(0),g=u(0),I=u(0),S=u(0),M=u(0),P=u(0),T=u(0),O=u(0),G=u(0),Y=u(0),f2=0,E2=0,p0=0,m0=0,g0=0,E0=0,C0=0,R0=0,I0=u(0);h=i[n+8>>2],f=_-80|0,I=c[n+16>>2],c[f+8>>2]=I,S=c[n+20>>2],c[f+12>>2]=S,M=c[n+24>>2],c[f+16>>2]=M,r=i[h>>2];i:if(E2=I==u(0)&S==u(0)&M==u(0)){if(i[f+76>>2]=-42943038,i[f+68>>2]=-42943038,i[f+72>>2]=-42943038,i[f+64>>2]=2104540610,i[f+56>>2]=2104540610,i[f+60>>2]=2104540610,(0|h)!=(0|r)){for(g=u(19999999867631625e21),O=u(-19999999867631625e21),P=u(-19999999867631625e21),T=u(19999999867631625e21),G=u(-19999999867631625e21),Y=u(19999999867631625e21),A=u(-19999999867631625e21),s=u(19999999867631625e21),y=u(-19999999867631625e21),b=u(19999999867631625e21),l=u(-19999999867631625e21),m=u(19999999867631625e21),a=r;A=(e=(t=c[a+24>>2])>A)?t:A,O=e?t:O,s=(v=t>2])>y)?t:y,P=k?t:P,b=(f2=b>t)?t:b,T=f2?t:T,l=(o=(t=c[a+16>>2])>l)?t:l,G=o?t:G,p0=o?a:p0,m=(o=t>2])););i[f+20>>2]=m0,c[f+56>>2]=Y,c[f+68>>2]=G,i[f+32>>2]=p0,c[f+60>>2]=T,i[f+24>>2]=R0,c[f+72>>2]=P,i[f+36>>2]=C0,c[f+64>>2]=g,i[f+28>>2]=E0,c[f+76>>2]=O,i[f+40>>2]=g0,s=u(A-s),A=u(l-m),b=u(y-b)}else A=u(-3999999973526325e22),s=u(-3999999973526325e22),b=u(-3999999973526325e22);if(a=2,e=(k=b>A)<<2,v=k,o=f+56|0,v=u(c[(k=f+68|0)+e>>2]-c[o+e>>2])>2]>=c[e+k>>2])i[f+8>>2]=0,i[f+12>>2]=0;else{if(a=i[(e=v<<2)+(f+20|0)>>2],e=i[e+(f+32|0)>>2],G=c[e+16>>2],g=u(c[a+16>>2]-G),c[f+44>>2]=g,Y=c[e+20>>2],l=u(c[a+20>>2]-Y),c[f+48>>2]=l,I0=c[e+24>>2],m=u(c[a+24>>2]-I0),O=u(-g),(0|h)!=(0|r)){for(T=u(-l),P=u(-m),b=u(0),a=r;s=u(c[a+20>>2]-Y),t=u(c[a+16>>2]-G),A=u(u(g*s)+u(t*T)),y=u(c[a+24>>2]-I0),s=u(u(l*y)+u(s*P)),t=u(u(m*t)+u(y*O)),(y=u(u(A*A)+u(u(s*s)+u(t*t))))>b&&(M=A,S=t,I=s,b=y),(0|h)!=(0|(a=i[a>>2])););if(c[f+16>>2]=M,c[f+12>>2]=S,c[f+8>>2]=I,!(b<=u(0)))break i}else P=u(-m),T=u(-l);i[f+16>>2]=0,i[f+8>>2]=0,i[f+12>>2]=0,a=(l(g>2],a=(m(b>2]=1065353216,M=c[f+16>>2],I=c[f+8>>2],S=c[f+12>>2]}if(k=f+8|0,e=(S(I>2],a=n+28|0,f=(M(b>2]=0,i[(o=((0|(o=f+1|0))!=3?o:0)<<2)+a>>2]=1065353216,i[(f=(f+2>>>0)%3<<2)+a>>2]=0,i[(a=n+40|0)+e>>2]=0,e=c[e+k>>2]>u(0),c[a+o>>2]=u(e?-0:0),c[f+a>>2]=u(e?1:-1),!(e=(0|h)==(0|r)))for(a=r;f=i[a+20>>2],i[a+28>>2]=i[a+16>>2],i[a+32>>2]=f,(0|h)!=(0|(a=i[a>>2])););if(E2&&(0|(f=i[h+40>>2]))!=(0|(k=h+40|0))){for(b=u(0);;){if(o=i[f+8>>2],i[(a=o)+28>>2]>0)for(;v=i[a+16>>2],f2=i[i[a+4>>2]+16>>2],b=u(u(u(c[v+28>>2]-c[f2+28>>2])*u(c[v+32>>2]+c[f2+32>>2]))+b),(0|o)!=(0|(a=i[a+12>>2])););if((0|k)==(0|(f=i[f>>2])))break}if(b>2]=-c[r+32>>2],(0|(r=i[r>>2]))!=(0|h););c[n+40>>2]=-c[n+40>>2],c[n+44>>2]=-c[n+44>>2],c[n+48>>2]=-c[n+48>>2]}}}function o4(n,f){f|=0;var a=0,e=0,t=0,b=0,o=0,k=0,s=0,r=0,A=0,l=0,v=0,h=0,y=0,m=0,g=0,I=0,S=0,M=0,P=0;if(_=k=_-16|0,i[84+(n|=0)>>2]=0,!(a=(0|(r=i[f+40>>2]))==(0|(h=f+40|0)))){for(f=r;d[f+20|0]=0,(0|h)!=(0|(f=i[f>>2])););if(!a){for(;;){if(!(w[r+20|0]|!w[r+21|0])){if(o=i[r+8>>2],w[n+80|0])f=1,a=1;else{b=0,t=0,f=0,e=i[(a=o)+20>>2];i:if(w[e+21|0])for(;;){if(w[(f=e)+20|0]){f=t;break i}if(d[f+20|0]=1,i[f+16>>2]=t,b=b+1|0,t=f,a=i[a+8>>2],e=i[a+20>>2],!w[e+21|0])break}e=i[o+4>>2],t=i[e+20>>2];i:{f:if(!w[t+21|0]|w[t+20|0]){if(y=o,!f)break i}else for(a=f;;){if(d[(f=t)+20|0]=1,i[f+16>>2]=a,b=b+1|0,y=i[e+12>>2],e=i[y+4>>2],t=i[e+20>>2],!w[t+21|0])break f;if(a=f,w[t+20|0])break}for(;d[f+20|0]=0,f=i[f+16>>2];);}m=(0|b)>1,t=0,e=0,f=0,A=i[o+12>>2],a=i[(s=A)+20>>2];i:if(w[a+21|0])for(;;){if(w[(f=a)+20|0]){f=e;break i}if(d[f+20|0]=1,i[f+16>>2]=e,t=t+1|0,e=f,s=i[s+8>>2],a=i[s+20>>2],!w[a+21|0])break}l=m?b:1,e=i[A+4>>2],b=i[e+20>>2];i:{f:if(!w[b+21|0]|w[b+20|0]){if(!f)break i}else for(a=f;;){if(d[(f=b)+20|0]=1,i[f+16>>2]=a,t=t+1|0,A=i[e+12>>2],e=i[A+4>>2],b=i[e+20>>2],!w[b+21|0])break f;if(a=f,w[b+20|0])break}for(;d[f+20|0]=0,f=i[f+16>>2];);}g=(0|t)>(0|l),b=0,e=0,f=0,v=i[i[o+8>>2]+4>>2],a=i[(s=v)+20>>2];i:if(w[a+21|0])for(;;){if(w[(f=a)+20|0]){f=e;break i}if(d[f+20|0]=1,i[f+16>>2]=e,b=b+1|0,e=f,s=i[s+8>>2],a=i[s+20>>2],!w[a+21|0])break}s=g?t:l,e=i[v+4>>2],t=i[e+20>>2];i:{f:if(!w[t+21|0]|w[t+20|0]){if(!f)break i}else for(a=f;;){if(d[(f=t)+20|0]=1,i[f+16>>2]=a,b=b+1|0,v=i[e+12>>2],e=i[v+4>>2],t=i[e+20>>2],!w[t+21|0])break f;if(a=f,w[t+20|0])break}for(;d[f+20|0]=0,f=i[f+16>>2];);}A0(f=k+4|0,o),I=i[k+12>>2],S=i[k+8>>2],a=i[k+4>>2],A0(f,i[o+12>>2]),M=i[k+12>>2],P=i[k+8>>2],l=i[k+4>>2],A0(f,i[i[o+8>>2]+4>>2]),f=b,(0|(f=(t=(0|(f=(e=(0|(f=(b=(0|b)>(0|s))?f:s))<(0|a))?a:f))<(0|l))?l:f))>=(0|(a=i[k+4>>2]))?(o=t?P:e?S:b?v:g?A:m?y:o,a=t?M:e?I:b||g||m?2:1):(o=i[k+8>>2],f=a,a=i[k+12>>2])}R[0|a](n,o,f)}if((0|h)==(0|(r=i[r>>2])))break}if(o=i[n+84>>2]){for((0|(f=i[n+1716>>2]))==3?R[i[n+88>>2]](4):R[0|f](4,i[n+1896>>2]),b=-1;;){for(f=i[o+8>>2];w[n+80|0]&&(0|(a=!(e=w[i[i[f+4>>2]+20>>2]+21|0])))!=(0|b)&&((0|(t=i[n+1720>>2]))==4?R[i[n+92>>2]](!e):R[0|t](!e,i[n+1896>>2]),b=a),(0|(a=i[n+1724>>2]))==5?R[i[n+96>>2]](i[i[f+16>>2]+12>>2]):R[0|a](i[i[f+16>>2]+12>>2],i[n+1896>>2]),(0|(f=i[f+12>>2]))!=i[o+8>>2];);if(!(o=i[o+16>>2]))break}(0|(f=i[n+1728>>2]))==6?R[i[n+100>>2]]():R[0|f](i[n+1896>>2]),i[n+84>>2]=0}}}_=k+16|0}function Q(n){var f=0,a=0,e=0,t=0,b=0,o=0,k=0,s=0,r=0;i:if(n|=0){b=(e=n-8|0)+(n=-8&(f=i[n-4>>2]))|0;f:if(!(1&f)){if(!(2&f)||(e=e-(f=i[e>>2])|0)>>>0>>0<=255){if(t=f>>>3|0,(0|(f=i[e+12>>2]))==(0|(a=i[e+8>>2]))){s=3416,r=i[854]&i2(t),i[s>>2]=r;break f}i[a+12>>2]=f,i[f+8>>2]=a;break f}if(k=i[e+24>>2],(0|e)!=(0|(f=i[e+12>>2]))){a=i[e+8>>2],i[a+12>>2]=f,i[f+8>>2]=a;break a}if(!(a=i[(t=e+20|0)>>2])){if(!(a=i[e+16>>2]))break n;t=e+16|0}for(;o=t,(a=i[(t=(f=a)+20|0)>>2])||(t=f+16|0,a=i[f+16>>2]););i[o>>2]=0;break a}if((3&(f=i[b+4>>2]))!=3)break f;return i[856]=n,i[b+4>>2]=-2&f,i[e+4>>2]=1|n,void(i[b>>2]=n)}f=0}if(k){a=i[e+28>>2];a:{if(i[(t=3720+(a<<2)|0)>>2]==(0|e)){if(i[t>>2]=f,f)break a;s=3420,r=i[855]&i2(a),i[s>>2]=r;break f}if(i[k+(i[k+16>>2]==(0|e)?16:20)>>2]=f,!f)break f}i[f+24>>2]=k,(a=i[e+16>>2])&&(i[f+16>>2]=a,i[a+24>>2]=f),(a=i[e+20>>2])&&(i[f+20>>2]=a,i[a+24>>2]=f)}}if(!(e>>>0>=b>>>0)&&1&(f=i[b+4>>2])){f:{a:{n:{e:{if(!(2&f)){if(i[860]==(0|b)){if(i[860]=e,n=i[857]+n|0,i[857]=n,i[e+4>>2]=1|n,i[859]!=(0|e))break i;return i[856]=0,void(i[859]=0)}if(i[859]==(0|b))return i[859]=e,n=i[856]+n|0,i[856]=n,i[e+4>>2]=1|n,void(i[n+e>>2]=n);if(n=(-8&f)+n|0,f>>>0<=255){if(t=f>>>3|0,(0|(f=i[b+12>>2]))==(0|(a=i[b+8>>2]))){s=3416,r=i[854]&i2(t),i[s>>2]=r;break a}i[a+12>>2]=f,i[f+8>>2]=a;break a}if(k=i[b+24>>2],(0|b)!=(0|(f=i[b+12>>2]))){a=i[b+8>>2],i[a+12>>2]=f,i[f+8>>2]=a;break n}if(!(a=i[(t=b+20|0)>>2])){if(!(a=i[b+16>>2]))break e;t=b+16|0}for(;o=t,(a=i[(t=(f=a)+20|0)>>2])||(t=f+16|0,a=i[f+16>>2]););i[o>>2]=0;break n}i[b+4>>2]=-2&f,i[e+4>>2]=1|n,i[n+e>>2]=n;break f}f=0}if(k){a=i[b+28>>2];n:{if(i[(t=3720+(a<<2)|0)>>2]==(0|b)){if(i[t>>2]=f,f)break n;s=3420,r=i[855]&i2(a),i[s>>2]=r;break a}if(i[k+(i[k+16>>2]==(0|b)?16:20)>>2]=f,!f)break a}i[f+24>>2]=k,(a=i[b+16>>2])&&(i[f+16>>2]=a,i[a+24>>2]=f),(a=i[b+20>>2])&&(i[f+20>>2]=a,i[a+24>>2]=f)}}if(i[e+4>>2]=1|n,i[n+e>>2]=n,i[859]==(0|e))return void(i[856]=n)}if(n>>>0<=255)return f=3456+(-8&n)|0,(a=i[854])&(n=1<<(n>>>3))?n=i[f+8>>2]:(i[854]=n|a,n=f),i[f+8>>2]=e,i[n+12>>2]=e,i[e+12>>2]=f,void(i[e+8>>2]=n);a=31,n>>>0<=16777215&&(a=62+((n>>>38-(f=s2(n>>>8|0))&1)-(f<<1)|0)|0),i[e+28>>2]=a,i[e+16>>2]=0,i[e+20>>2]=0,f=3720+(a<<2)|0;f:{a:{if((t=i[855])&(o=1<>>1|0)|0:0),f=i[f>>2];;){if(t=f,(-8&i[f+4>>2])==(0|n))break a;if(o=a>>>29|0,a<<=1,!(f=i[16+(o=f+(4&o)|0)>>2]))break}i[o+16>>2]=e,i[e+24>>2]=t}else i[855]=t|o,i[f>>2]=e,i[e+24>>2]=f;i[e+12>>2]=e,i[e+8>>2]=e;break f}n=i[t+8>>2],i[n+12>>2]=e,i[t+8>>2]=e,i[e+24>>2]=0,i[e+12>>2]=t,i[e+8>>2]=n}n=i[862]-1|0,i[862]=n||-1}}}function z0(n,f){var a=0,e=0,t=0,b=0,o=0,k=0,s=0,r=0;b=n+f|0;i:{f:if(!(1&(a=i[n+4>>2]))){if(!(2&a))break i;f=(a=i[n>>2])+f|0;a:{n:{e:{if((0|(n=n-a|0))!=i[859]){if(a>>>0<=255){if((0|(e=i[n+8>>2]))!=(0|(t=i[n+12>>2])))break e;s=3416,r=i[854]&i2(a>>>3|0),i[s>>2]=r;break f}if(k=i[n+24>>2],(0|(a=i[n+12>>2]))!=(0|n)){e=i[n+8>>2],i[e+12>>2]=a,i[a+8>>2]=e;break a}if(!(e=i[(t=n+20|0)>>2])){if(!(e=i[n+16>>2]))break n;t=n+16|0}for(;o=t,(e=i[(t=(a=e)+20|0)>>2])||(t=a+16|0,e=i[a+16>>2]););i[o>>2]=0;break a}if((3&(a=i[b+4>>2]))!=3)break f;return i[856]=f,i[b+4>>2]=-2&a,i[n+4>>2]=1|f,void(i[b>>2]=f)}i[e+12>>2]=t,i[t+8>>2]=e;break f}a=0}if(k){e=i[n+28>>2];a:{if(i[(t=3720+(e<<2)|0)>>2]==(0|n)){if(i[t>>2]=a,a)break a;s=3420,r=i[855]&i2(e),i[s>>2]=r;break f}if(i[k+(i[k+16>>2]==(0|n)?16:20)>>2]=a,!a)break f}i[a+24>>2]=k,(e=i[n+16>>2])&&(i[a+16>>2]=e,i[e+24>>2]=a),(e=i[n+20>>2])&&(i[a+20>>2]=e,i[e+24>>2]=a)}}f:{a:{n:{e:{if(!(2&(a=i[b+4>>2]))){if(i[860]==(0|b)){if(i[860]=n,f=i[857]+f|0,i[857]=f,i[n+4>>2]=1|f,i[859]!=(0|n))break i;return i[856]=0,void(i[859]=0)}if(i[859]==(0|b))return i[859]=n,f=i[856]+f|0,i[856]=f,i[n+4>>2]=1|f,void(i[n+f>>2]=f);if(f=(-8&a)+f|0,a>>>0<=255){if(t=a>>>3|0,(0|(a=i[b+12>>2]))==(0|(e=i[b+8>>2]))){s=3416,r=i[854]&i2(t),i[s>>2]=r;break a}i[e+12>>2]=a,i[a+8>>2]=e;break a}if(k=i[b+24>>2],(0|b)!=(0|(a=i[b+12>>2]))){e=i[b+8>>2],i[e+12>>2]=a,i[a+8>>2]=e;break n}if(!(e=i[(t=b+20|0)>>2])){if(!(e=i[b+16>>2]))break e;t=b+16|0}for(;o=t,(e=i[(t=(a=e)+20|0)>>2])||(t=a+16|0,e=i[a+16>>2]););i[o>>2]=0;break n}i[b+4>>2]=-2&a,i[n+4>>2]=1|f,i[n+f>>2]=f;break f}a=0}if(k){e=i[b+28>>2];n:{if(i[(t=3720+(e<<2)|0)>>2]==(0|b)){if(i[t>>2]=a,a)break n;s=3420,r=i[855]&i2(e),i[s>>2]=r;break a}if(i[k+(i[k+16>>2]==(0|b)?16:20)>>2]=a,!a)break a}i[a+24>>2]=k,(e=i[b+16>>2])&&(i[a+16>>2]=e,i[e+24>>2]=a),(e=i[b+20>>2])&&(i[a+20>>2]=e,i[e+24>>2]=a)}}if(i[n+4>>2]=1|f,i[n+f>>2]=f,i[859]==(0|n))return void(i[856]=f)}if(f>>>0<=255)return a=3456+(-8&f)|0,(e=i[854])&(f=1<<(f>>>3))?f=i[a+8>>2]:(i[854]=f|e,f=a),i[a+8>>2]=n,i[f+12>>2]=n,i[n+12>>2]=a,void(i[n+8>>2]=f);e=31,f>>>0<=16777215&&(e=62+((f>>>38-(a=s2(f>>>8|0))&1)-(a<<1)|0)|0),i[n+28>>2]=e,i[n+16>>2]=0,i[n+20>>2]=0,a=3720+(e<<2)|0;f:{if((t=i[855])&(o=1<>>1|0)|0:0),a=i[a>>2];;){if(t=a,(-8&i[a+4>>2])==(0|f))break f;if(o=e>>>29|0,e<<=1,!(a=i[16+(o=a+(4&o)|0)>>2]))break}i[o+16>>2]=n,i[n+24>>2]=t}else i[855]=t|o,i[a>>2]=n,i[n+24>>2]=a;return i[n+12>>2]=n,void(i[n+8>>2]=n)}f=i[t+8>>2],i[f+12>>2]=n,i[t+8>>2]=n,i[n+24>>2]=0,i[n+12>>2]=t,i[n+8>>2]=f}}function b4(n){n|=0;var f=0,a=0,e=u(0),t=u(0),b=u(0),o=u(0),k=u(0),s=0,r=u(0),A=0,l=0,v=u(0),h=u(0),y=0,m=u(0),g=u(0),I=0,S=u(0),M=u(0),P=u(0),T=u(0),O=u(0),G=u(0),Y=0;i:{f:if(!((0|(y=i[n+112>>2]))<3)){if(I=116+((Y=y<<4)+n|0)|0,S=c[n+124>>2],M=c[n+120>>2],o=c[n+24>>2],P=c[n+116>>2],r=c[n+16>>2],k=c[n+20>>2],!(r!=u(0)|k!=u(0))&o==u(0))for(a=n+148|0,o=u(0),k=u(0),r=u(0),e=v=u(c[(f=n+132|0)>>2]-P),t=h=u(c[n+136>>2]-M),m=b=u(c[n+140>>2]-S);T=u(c[f+20>>2]-M),O=u(c[a>>2]-P),G=u(u(e*T)-u(O*t)),g=u(c[f+24>>2]-S),t=u(u(t*g)-u(T*m)),e=u(u(m*O)-u(g*e)),u(u(G*o)+u(u(t*r)+u(k*e)))>=u(0)?(o=u(o+G),k=u(k+e),t=u(r+t)):(o=u(o-G),k=u(k-e),t=u(r-t)),r=t,e=O,t=T,m=g,I>>>0>(a=(f=a)+16|0)>>>0;);else v=u(c[n+132>>2]-P),h=u(c[n+136>>2]-M),b=u(c[n+140>>2]-S);for(a=n+148|0,f=A=n+132|0;;){e=b,b=h,s=f,t=v,h=u(c[f+20>>2]-M),v=u(c[(f=a)>>2]-P),g=u(u(u(t*h)-u(b*v))*o),m=b,b=u(c[s+24>>2]-S);a:if((e=u(g+u(u(u(u(m*b)-u(h*e))*r)+u(k*u(u(e*v)-u(b*t))))))!=u(0)){if(e>u(0)){if(a=0,s=(0|l)<0,l=1,!s)break a;break i}if(a=0,s=(0|l)>0,l=-1,s)break i}if(!(I>>>0>(a=f+16|0)>>>0))break}if(l){a=1;a:{n:switch(i[n+56>>2]-100132|0){case 0:if((0|l)>=0)break a;break f;case 2:break i;case 1:break n;default:break a}if((0|l)>0)break f}(0|(f=i[n+1716>>2]))==3?R[i[n+88>>2]](w[n+81|0]?2:(0|y)<4?4:6):R[0|f](w[n+81|0]?2:(0|y)<4?4:6,i[n+1896>>2]),(0|(f=i[n+1724>>2]))==5?R[i[n+96>>2]](i[n+128>>2]):R[0|f](i[n+128>>2],i[n+1896>>2]);a:if((0|l)<=0){if((0|y)<2)break a;for(f=Y+100|0;a=n+f|0,(0|(s=i[n+1724>>2]))==5?R[i[n+96>>2]](i[a+12>>2]):R[0|s](i[a+12>>2],i[n+1896>>2]),a=(0|f)>132,f=f-16|0,a;);}else if(!(A>>>0>=I>>>0))for(;(0|(f=i[n+1724>>2]))==5?R[i[n+96>>2]](i[A+12>>2]):R[0|f](i[A+12>>2],i[n+1896>>2]),I>>>0>(A=A+16|0)>>>0;);(0|(f=i[n+1728>>2]))==6?R[i[n+100>>2]]():R[0|f](i[n+1896>>2])}}a=1}return 0|a}function c0(n,f){var a=0,e=0,t=0,b=0,o=u(0),k=0,s=u(0),r=0,A=0,l=0,v=0,h=0,y=0,m=0,g=0,I=0,S=0,M=0,P=0;i:{l=i[f>>2],t=i[l+16>>2],s=c[t+28>>2],a=i[i[i[f+4>>2]+8>>2]>>2],v=i[a>>2],b=i[v+16>>2];f:{if(!(!(s<(o=c[b+28>>2]))&(!(c[t+32>>2]<=c[b+32>>2])|s!=o))){if(J(i[i[v+4>>2]+16>>2],t,b)>u(0))break f;if(t=i[l+16>>2],b=i[v+16>>2],!(c[t+28>>2]==c[b+28>>2]&c[t+32>>2]==c[b+32>>2])){if(!o2(i[v+4>>2])||!Z(l,i[i[v+4>>2]+12>>2]))break i;return d[a+14|0]=1,d[f+14|0]=1,1}if(e=1,(0|t)==(0|b))break f;if(k=i[n+68>>2],(0|(b=i[t+36>>2]))>=0){if(h=i[k>>2],r=i[h>>2],A=i[h+4>>2],f=i[4+(I=A+(b<<3)|0)>>2],m=i[h+8>>2],g=i[r+(m<<2)>>2],i[r+(f<<2)>>2]=g,M=e=(g<<3)+A|0,i[e+4>>2]=f,S=m-1|0,i[h+8>>2]=S,(0|f)<(0|m)){a:{if((0|f)<2||(a=i[(i[r+(f<<1&-4)>>2]<<3)+A>>2],o=c[a+28>>2],y=i[e>>2],o<(s=c[y+28>>2])||!(!(c[a+32>>2]<=c[y+32>>2])|s!=o)))for(P=(g<<3)+A|0;;){if((0|S)<=(0|(a=f<<1))||(k=i[(i[r+((e=1|a)<<2)>>2]<<3)+A>>2],s=c[k+28>>2],t=i[(i[r+(a<<2)>>2]<<3)+A>>2],!(s<(o=c[t+28>>2]))&(!(c[k+32>>2]<=c[t+32>>2])|s!=o)||(a=e)),(0|a)>=(0|m)){a=f;break a}if(y=i[P>>2],s=c[y+28>>2],k=i[r+(a<<2)>>2],e=i[(t=(k<<3)+A|0)>>2],s<(o=c[e+28>>2])){a=f;break a}if(!(!(c[y+32>>2]<=c[e+32>>2])|s!=o)){a=f;break a}i[r+(f<<2)>>2]=k,i[t+4>>2]=f,f=a}for(;;){if(k=i[r+((a=f>>>1|0)<<2)>>2],e=i[(t=(k<<3)+A|0)>>2],(o=c[e+28>>2])>2]<=c[y+32>>2])|s!=o)){a=f;break a}if(i[r+(f<<2)>>2]=k,i[t+4>>2]=f,e=f>>>0>3,f=a,!e)break}}i[r+(a<<2)>>2]=g,i[M+4>>2]=a}i[I>>2]=0,i[I+4>>2]=i[h+16>>2],i[h+16>>2]=b}else{i[i[k+4>>2]+((-1^b)<<2)>>2]=0;a:if(!((0|(f=i[k+12>>2]))<=0))for(b=i[k+8>>2]-4|0;;){if(i[i[b+(f<<2)>>2]>>2])break a;if(a=f-1|0,i[k+12>>2]=a,e=(0|f)>1,f=a,!e)break}}return l0(n,i[i[v+4>>2]+12>>2],l),1}if(!(J(i[i[l+4>>2]+16>>2],b,t)>2]+4>>2]>>2]+14|0]=1,!o2(i[l+4>>2])||!Z(i[i[v+4>>2]+12>>2],l)))break i}return e}k2(n+1740|0,1),b2()}function n0(n,f){var a=0,e=0,t=0,b=0,o=0,k=0,s=0,r=0,A=0,l=0,v=0,h=0,y=0;if(!n)return j(f);if(f>>>0>=4294967232)return i[806]=48,0;b=f>>>0<11?16:f+11&-8,e=-8&(s=i[4+(t=n-8|0)>>2]);i:if(3&s){o=e+t|0;f:if(e>>>0>=b>>>0){if((a=e-b|0)>>>0<16)break f;i[t+4>>2]=1&s|b|2,i[4+(e=t+b|0)>>2]=3|a,i[o+4>>2]=1|i[o+4>>2],z0(e,a)}else if(i[860]!=(0|o))if(i[859]!=(0|o)){if(2&(k=i[o+4>>2])||(r=e+(-8&k)|0)>>>0>>0)break i;l=r-b|0;a:if(k>>>0<=255){if((0|(a=i[o+12>>2]))==(0|(e=i[o+8>>2]))){h=3416,y=i[854]&i2(k>>>3|0),i[h>>2]=y;break a}i[e+12>>2]=a,i[a+8>>2]=e}else{A=i[o+24>>2];n:if((0|o)==(0|(e=i[o+12>>2]))){e:{if(!(k=i[(a=o+20|0)>>2])){if(!(k=i[o+16>>2]))break e;a=o+16|0}for(;v=a,(k=i[(a=(e=k)+20|0)>>2])||(a=e+16|0,k=i[e+16>>2]););i[v>>2]=0;break n}e=0}else a=i[o+8>>2],i[a+12>>2]=e,i[e+8>>2]=a;if(A){a=i[o+28>>2];n:{if(i[(k=3720+(a<<2)|0)>>2]==(0|o)){if(i[k>>2]=e,e)break n;h=3420,y=i[855]&i2(a),i[h>>2]=y;break a}if(i[(i[A+16>>2]==(0|o)?16:20)+A>>2]=e,!e)break a}i[e+24>>2]=A,(a=i[o+16>>2])&&(i[e+16>>2]=a,i[a+24>>2]=e),(a=i[o+20>>2])&&(i[e+20>>2]=a,i[a+24>>2]=e)}}l>>>0<=15?(i[t+4>>2]=1&s|r|2,i[4+(a=t+r|0)>>2]=1|i[a+4>>2]):(i[t+4>>2]=1&s|b|2,i[4+(a=t+b|0)>>2]=3|l,i[4+(e=t+r|0)>>2]=1|i[e+4>>2],z0(a,l))}else{if((e=e+i[856]|0)>>>0>>0)break i;(a=e-b|0)>>>0>=16?(i[t+4>>2]=1&s|b|2,i[4+(k=t+b|0)>>2]=1|a,i[(e=e+t|0)>>2]=a,i[e+4>>2]=-2&i[e+4>>2]):(i[t+4>>2]=e|1&s|2,i[4+(a=e+t|0)>>2]=1|i[a+4>>2],a=0),i[859]=k,i[856]=a}else{if((e=e+i[857]|0)>>>0<=b>>>0)break i;i[t+4>>2]=1&s|b|2,e=e-b|0,i[4+(a=t+b|0)>>2]=1|e,i[857]=e,i[860]=a}a=t}else{if(b>>>0<256||e>>>0>=b+4>>>0&&(a=t,e-b>>>0<=i[974]<<1>>>0))break i;a=0}return a?a+8|0:(a=j(f))?(q0(a,n,f>>>0>(t=(3&(t=i[n-4>>2])?-4:-8)+(-8&t)|0)>>>0?t:f),Q(n),a):0}function K0(n,f){var a=0,e=0,t=0,b=0,o=0,k=0,s=u(0),r=0,A=u(0);for(e=i[i[i[f+4>>2]+8>>2]>>2];;){i:{if(w[e+14|0])for(;e=i[i[i[(f=e)+4>>2]+8>>2]>>2],w[e+14|0];);f:{a:{n:{e:{if(w[f+14|0])a=f;else if(!(a=i[i[i[f+4>>2]+4>>2]>>2])||(e=f,!w[a+14|0]))break e;d[a+14|0]=0,t=i[a>>2],f=i[i[t+4>>2]+16>>2],o=i[e>>2];t:if((0|f)!=i[i[o+4>>2]+16>>2]){s=c[f+28>>2],r=i[i[i[a+4>>2]+8>>2]>>2],b=i[r>>2],k=i[i[b+4>>2]+16>>2];u:{if(!(!(s<(A=c[k+28>>2]))&(!(c[f+32>>2]<=c[k+32>>2])|s!=A))){if(J(f,k,i[t+16>>2])>2]+4>>2]>>2]+14|0]=1,!(f=o2(t)))break f;if(Z(i[b+4>>2],f))break u;break i}if(J(k,f,i[b+16>>2])>u(0)){f=a;break t}if(d[r+14|0]=1,d[a+14|0]=1,!(f=o2(b))||!Z(i[t+12>>2],i[b+4>>2]))break i;f=i[f+4>>2]}if(d[i[f+20>>2]+21|0]=w[a+12|0],w[e+15|0]){if(i[i[e>>2]+24>>2]=0,m2(i[e+4>>2]),Q(e),!$(o))break i;e=i[i[i[a+4>>2]+8>>2]>>2],o=i[e>>2],f=a}else if(w[a+15|0]){if(i[i[a>>2]+24>>2]=0,m2(i[a+4>>2]),Q(a),!$(t))break i;f=i[i[i[e+4>>2]+4>>2]>>2],t=i[f>>2]}else f=a}else f=a;if(i[t+16>>2]==i[o+16>>2])break a;if(a=i[i[t+4>>2]+16>>2],b=i[i[o+4>>2]+16>>2],w[e+15|0]|w[f+15|0]|(0|a)==(0|b)||(0|(k=a))!=(0|(a=i[n+72>>2]))&(0|a)!=(0|b))break n;if(!J0(n,f))break a}return}c0(n,f)}if(i[t+16>>2]!=i[o+16>>2]||(b=i[t+4>>2],a=i[o+4>>2],i[b+16>>2]!=i[a+16>>2]))continue;if(i[o+28>>2]=i[o+28>>2]+i[t+28>>2],i[a+28>>2]=i[a+28>>2]+i[b+28>>2],i[i[f>>2]+24>>2]=0,m2(i[f+4>>2]),Q(f),!$(t))break i;f=i[i[i[e+4>>2]+4>>2]>>2];continue}}break}k2(n+1740|0,1),b2()}function k4(n){n|=0;var f=0,a=0,e=0,t=u(0),b=u(0),o=0,k=0,s=0,r=0;if((0|(f=i[n+40>>2]))!=(0|(s=n+40|0)))for(;;){if(n=i[f>>2],w[f+21|0]){for(f=f+8|0;f=i[f>>2],e=i[i[f+4>>2]+16>>2],t=c[e+28>>2],a=i[f+16>>2],!(!(t<(b=c[a+28>>2]))&(!(c[e+32>>2]<=c[a+32>>2])|t!=b));)f=i[f+8>>2]+4|0;for(;!(!(t>b)&(!(c[a+32>>2]<=c[e+32>>2])|t!=b));)f=i[f+12>>2],a=i[f+16>>2],b=c[a+28>>2],e=i[i[f+4>>2]+16>>2],t=c[e+28>>2];i:{if((0|(e=i[i[f+8>>2]+4>>2]))!=i[f+12>>2])for(;;){if(a=i[i[f+4>>2]+16>>2],t=c[a+28>>2],o=i[e+16>>2],!(t<(b=c[o+28>>2]))&(!(c[a+32>>2]<=c[o+32>>2])|t!=b)){f:if(i[e+12>>2]!=(0|f))for(;;){if(a=i[i[f+8>>2]+4>>2],o=i[a+16>>2],t=c[o+28>>2],k=i[i[a+4>>2]+16>>2],!(t<(b=c[k+28>>2])|t==b&c[o+32>>2]<=c[k+32>>2])){if(!(J(i[i[f+4>>2]+16>>2],i[f+16>>2],o)>=u(0)))break f;a=i[i[f+8>>2]+4>>2]}if(f=A2(f,a),a=0,!f)break i;if((0|(f=i[f+4>>2]))==i[e+12>>2])break}f=i[f+12>>2]}else{f:if((0|(a=i[e+12>>2]))!=(0|f))for(o=e+12|0;;){if(k=i[i[a+4>>2]+16>>2],t=c[k+28>>2],r=i[a+16>>2],!(t<(b=c[r+28>>2])|t==b&c[k+32>>2]<=c[r+32>>2])){if(!(J(i[e+16>>2],i[i[e+4>>2]+16>>2],k)<=u(0)))break f;a=i[o>>2]}if(e=A2(a,e),a=0,!e)break i;if(o=(e=i[e+4>>2])+12|0,(0|(a=i[e+12>>2]))==(0|f))break}e=i[i[e+8>>2]+4>>2]}if(i[f+12>>2]==(0|e))break}if(a=i[e+12>>2],i[a+12>>2]!=(0|f))for(;;){if(e=A2(a,e),a=0,!e)break i;if(e=i[e+4>>2],a=i[e+12>>2],i[a+12>>2]==(0|f))break}a=1}if(!a)return 0}if((0|s)==(0|(f=n)))break}return 1}function S2(n,f,a,e,t,b){var o=0,k=0,s=0,r=0,A=0;i:{for(;;){if(k=i[a+4>>2],!(o=j(16))||(i[o>>2]=k,s=w0(i[n+64>>2],i[f+4>>2],o),i[o+4>>2]=s,!s))break i;if(d[o+13|0]=0,d[o+14|0]=0,d[o+15|0]=0,i[k+24>>2]=o,(0|e)==(0|(a=i[a+8>>2])))break}if(a=i[i[i[f+4>>2]+8>>2]>>2],k=i[i[a>>2]+4>>2],t=t||i[k+8>>2],i[k+16>>2]==i[t+16>>2]){if(i[k+8>>2]!=(0|t)&&(!Z(i[i[k+4>>2]+12>>2],k)||!Z(i[i[t+4>>2]+12>>2],k)))break i;e=(t=i[f+8>>2])-(s=i[k+28>>2])|0,i[a+8>>2]=e;f:{a:switch(i[n+56>>2]-100130|0){case 4:o=e-2>>>0<4294967293;break f;case 3:o=e>>>31|0;break f;case 2:o=(0|e)>0;break f;case 1:o=(0|t)!=(0|s);break f;case 0:break a;default:break f}o=1&e}if(d[a+12|0]=o,d[f+14|0]=1,s=i[i[i[a+4>>2]+8>>2]>>2],e=i[i[s>>2]+4>>2],i[e+16>>2]==i[k+16>>2])for(t=a+4|0;;){if(f=s,i[(o=e)+8>>2]!=(0|k)&&(!Z(i[i[o+4>>2]+12>>2],o)||!Z(i[i[k+4>>2]+12>>2],o)))break i;e=(r=i[a+8>>2])-(A=i[o+28>>2])|0,i[f+8>>2]=e;f:{a:switch(i[n+56>>2]-100130|0){case 0:s=1&e;break f;case 1:s=(0|r)!=(0|A);break f;case 2:s=(0|e)>0;break f;case 3:s=e>>>31|0;break f;case 4:break a;default:break f}s=e-2>>>0<4294967293}if(d[f+12|0]=s,d[a+14|0]=1,c0(n,a)&&(i[o+28>>2]=i[o+28>>2]+i[k+28>>2],e=i[o+4>>2],i[e+28>>2]=i[e+28>>2]+i[i[k+4>>2]+28>>2],i[i[a>>2]+24>>2]=0,m2(i[t>>2]),Q(a),!$(k)))break i;if(t=f+4|0,s=i[i[i[(a=f)+4>>2]+8>>2]>>2],e=i[i[s>>2]+4>>2],k=o,i[e+16>>2]!=i[o+16>>2])break}else f=a}return d[f+14|0]=1,void(b&&K0(n,f))}k2(n+1740|0,1),b2()}function $(n){var f=0,a=0,e=0,t=0,b=0,o=0;if(t=i[n+4>>2],(0|(o=i[t+20>>2]))!=(0|(a=i[n+20>>2]))){for(f=e=i[a+8>>2];i[f+20>>2]=o,(0|e)!=(0|(f=i[f+12>>2])););f=i[a>>2],e=i[a+4>>2],i[f+4>>2]=e,i[e>>2]=f,Q(a)}if((0|(e=i[n+8>>2]))!=(0|n)){if(b=i[n+4>>2],f=i[b+12>>2],i[i[b+20>>2]+8>>2]=f,i[i[n+16>>2]+8>>2]=e,b=i[f+8>>2],i[i[e+4>>2]+12>>2]=f,i[i[b+4>>2]+12>>2]=n,i[n+8>>2]=b,i[f+8>>2]=e,(0|a)==(0|o)){if(!(a=j(24)))return 0;for(f=i[n+20>>2],e=i[f+4>>2],i[a+4>>2]=e,i[e>>2]=a,i[a>>2]=f,i[f+4>>2]=a,i[a+12>>2]=0,i[a+16>>2]=0,i[a+8>>2]=n,d[a+20|0]=0,d[a+21|0]=w[f+21|0],f=n;i[f+20>>2]=a,(0|(f=i[f+12>>2]))!=(0|n););}}else{for(a=i[n+16>>2],f=e=i[a+8>>2];i[f+16>>2]=0,(0|e)!=(0|(f=i[f+8>>2])););f=i[a>>2],e=i[a+4>>2],i[f+4>>2]=e,i[e>>2]=f,Q(a)}if((0|(f=i[t+8>>2]))!=(0|t))a=i[i[t+4>>2]+12>>2],i[i[n+20>>2]+8>>2]=a,i[i[t+16>>2]+8>>2]=f,e=i[a+8>>2],i[i[f+4>>2]+12>>2]=a,i[i[e+4>>2]+12>>2]=t,i[t+8>>2]=e,i[a+8>>2]=f;else{for(a=i[t+16>>2],f=e=i[a+8>>2];i[f+16>>2]=0,(0|e)!=(0|(f=i[f+8>>2])););for(f=i[a>>2],e=i[a+4>>2],i[f+4>>2]=e,i[e>>2]=f,Q(a),a=i[t+20>>2],f=t=i[a+8>>2];i[f+20>>2]=0,(0|t)!=(0|(f=i[f+12>>2])););f=i[a>>2],t=i[a+4>>2],i[f+4>>2]=t,i[t>>2]=f,Q(a)}return f=i[n+4>>2],f=i[(n=n>>>0>f>>>0?f:n)>>2],a=i[i[n+4>>2]>>2],i[i[f+4>>2]>>2]=a,i[i[a+4>>2]>>2]=f,Q(n),1}function A2(n,f){var a=0,e=0,t=0,b=0,o=0,k=0,s=0,r=0,A=0,l=0;i:if(a=j(64)){if(k=i[n+4>>2],b=i[(e=n>>>0>k>>>0?k:n)+4>>2],t=i[b>>2],i[a+32>>2]=t,i[i[t+4>>2]>>2]=a,i[a>>2]=e,e=b,b=a+32|0,i[e>>2]=b,i[a+16>>2]=0,i[a+20>>2]=0,i[a+12>>2]=b,i[a+4>>2]=b,i[a+24>>2]=0,i[a+28>>2]=0,i[a+48>>2]=0,i[a+52>>2]=0,i[a+44>>2]=a,i[a+40>>2]=b,i[a+36>>2]=a,i[a+56>>2]=0,i[a+60>>2]=0,i[a+8>>2]=a,t=b,s=a,(0|(e=o=i[f+20>>2]))!=(0|(r=i[n+20>>2]))){for(e=t=i[e+8>>2];i[e+20>>2]=r,(0|t)!=(0|(e=i[e+12>>2])););e=i[o>>2],t=i[o+4>>2],i[e+4>>2]=t,i[t>>2]=e,Q(o),k=i[n+4>>2],s=i[a+8>>2],t=i[s+4>>2],e=i[n+20>>2]}if(n=i[n+12>>2],A=i[n+8>>2],i[t+12>>2]=n,i[i[A+4>>2]+12>>2]=a,i[a+8>>2]=A,i[n+8>>2]=s,n=i[f+8>>2],t=i[a+40>>2],i[i[t+4>>2]+12>>2]=f,i[i[n+4>>2]+12>>2]=b,i[a+40>>2]=n,i[f+8>>2]=t,i[a+16>>2]=i[k+16>>2],n=i[f+16>>2],i[a+52>>2]=e,i[a+48>>2]=n,i[a+20>>2]=e,i[e+8>>2]=b,(0|o)==(0|r)){if(!(n=j(24)))break i;for(f=i[e+4>>2],i[n+4>>2]=f,i[f>>2]=n,i[n>>2]=e,i[e+4>>2]=n,i[n+12>>2]=0,i[n+16>>2]=0,i[n+8>>2]=a,d[n+20|0]=0,d[n+21|0]=w[e+21|0],e=a;i[e+20>>2]=n,(0|(e=i[e+12>>2]))!=(0|a););}l=a}return l}function q0(n,f,a){var e=0,t=0;if(a>>>0>=512)f4(0|n,0|f,0|a);else{e=n+a|0;i:if(3&(n^f))if(e>>>0<4)a=n;else if((t=e-4|0)>>>0>>0)a=n;else for(a=n;d[0|a]=w[0|f],d[a+1|0]=w[f+1|0],d[a+2|0]=w[f+2|0],d[a+3|0]=w[f+3|0],f=f+4|0,t>>>0>=(a=a+4|0)>>>0;);else{f:if(3&n)if(a)for(a=n;;){if(d[0|a]=w[0|f],f=f+1|0,!(3&(a=a+1|0)))break f;if(!(a>>>0>>0))break}else a=n;else a=n;if(!((n=-4&e)>>>0<64||(t=n+-64|0)>>>0>>0))for(;i[a>>2]=i[f>>2],i[a+4>>2]=i[f+4>>2],i[a+8>>2]=i[f+8>>2],i[a+12>>2]=i[f+12>>2],i[a+16>>2]=i[f+16>>2],i[a+20>>2]=i[f+20>>2],i[a+24>>2]=i[f+24>>2],i[a+28>>2]=i[f+28>>2],i[a+32>>2]=i[f+32>>2],i[a+36>>2]=i[f+36>>2],i[a+40>>2]=i[f+40>>2],i[a+44>>2]=i[f+44>>2],i[a+48>>2]=i[f+48>>2],i[a+52>>2]=i[f+52>>2],i[a+56>>2]=i[f+56>>2],i[a+60>>2]=i[f+60>>2],f=f- -64|0,t>>>0>=(a=a- -64|0)>>>0;);if(n>>>0<=a>>>0)break i;for(;i[a>>2]=i[f>>2],f=f+4|0,n>>>0>(a=a+4|0)>>>0;);}if(a>>>0>>0)for(;d[0|a]=w[0|f],f=f+1|0,(0|e)!=(0|(a=a+1|0)););}}function o2(n){var f=0,a=0,e=0,t=0,b=0,o=0;if(b=n,n=0,(f=j(64))&&(e=i[b+4>>2],t=i[(a=e>>>0>>0?e:b)+4>>2],o=i[t>>2],i[f+32>>2]=o,i[i[o+4>>2]>>2]=f,i[f>>2]=a,a=f+32|0,i[t>>2]=a,i[f+16>>2]=0,i[f+20>>2]=0,i[f+12>>2]=a,i[f+4>>2]=a,i[f+24>>2]=0,i[f+28>>2]=0,i[f+48>>2]=0,i[f+52>>2]=0,i[f+40>>2]=a,i[f+36>>2]=f,i[f+56>>2]=0,i[f+60>>2]=0,i[f+8>>2]=f,t=i[b+12>>2],o=i[t+8>>2],i[f+44>>2]=t,i[i[o+4>>2]+12>>2]=f,i[f+8>>2]=o,i[t+8>>2]=f,t=i[e+16>>2],i[f+16>>2]=t,e=j(40))){for(n=i[t+4>>2],i[e+4>>2]=n,i[n>>2]=e,i[e>>2]=t,i[t+4>>2]=e,i[e+12>>2]=0,i[e+8>>2]=a,n=a;i[n+16>>2]=e,(0|a)!=(0|(n=i[n+8>>2])););n=i[b+20>>2],i[f+20>>2]=n,i[f+52>>2]=n,n=f}return n?(f=i[n+4>>2],n=i[b+4>>2],a=i[i[n+4>>2]+12>>2],e=i[a+8>>2],t=i[n+8>>2],i[i[t+4>>2]+12>>2]=a,i[i[e+4>>2]+12>>2]=n,i[n+8>>2]=e,i[a+8>>2]=t,a=i[f+8>>2],e=i[n+8>>2],i[i[e+4>>2]+12>>2]=f,i[i[a+4>>2]+12>>2]=n,i[n+8>>2]=a,i[f+8>>2]=e,i[n+16>>2]=i[f+16>>2],a=i[f+4>>2],i[i[a+16>>2]+8>>2]=a,i[a+20>>2]=i[n+20>>2],i[f+28>>2]=i[b+28>>2],i[a+28>>2]=i[n+28>>2],f):0}function $0(n){var f=0,a=0,e=0,t=0,b=0,o=0,k=0,s=0,r=0;if((0|(t=i[40+(n|=0)>>2]))!=(0|(k=n+40|0)))for(;;){if(r=i[t>>2],!w[t+21|0]){for(s=i[t+8>>2],n=i[s+12>>2];;){if(i[n+20>>2]=0,o=i[n+12>>2],f=i[n+4>>2],!i[f+20>>2]){if(e=i[n+16>>2],(0|(a=i[n+8>>2]))!=(0|n))i[e+8>>2]=a,e=i[f+12>>2],b=i[e+8>>2],i[i[a+4>>2]+12>>2]=e,i[i[b+4>>2]+12>>2]=n,i[n+8>>2]=b,i[e+8>>2]=a;else{for(f=a=i[e+8>>2];i[f+16>>2]=0,(0|a)!=(0|(f=i[f+8>>2])););f=i[e>>2],a=i[e+4>>2],i[f+4>>2]=a,i[a>>2]=f,Q(e),f=i[n+4>>2]}if(e=i[f+16>>2],(0|(a=i[f+8>>2]))!=(0|f))i[e+8>>2]=a,e=i[i[f+4>>2]+12>>2],b=i[e+8>>2],i[i[a+4>>2]+12>>2]=e,i[i[b+4>>2]+12>>2]=f,i[f+8>>2]=b,i[e+8>>2]=a;else{for(f=a=i[e+8>>2];i[f+16>>2]=0,(0|a)!=(0|(f=i[f+8>>2])););f=i[e>>2],a=i[e+4>>2],i[f+4>>2]=a,i[a>>2]=f,Q(e),f=i[n+4>>2]}e=i[(f=n>>>0>f>>>0?f:n)>>2],a=i[i[f+4>>2]>>2],i[i[e+4>>2]>>2]=a,i[i[a+4>>2]>>2]=e,Q(f)}if(f=(0|n)!=(0|s),n=o,!f)break}n=i[t>>2],o=i[t+4>>2],i[n+4>>2]=o,i[o>>2]=n,Q(t)}if((0|k)==(0|(t=r)))break}}function Z(n,f){var a=0,e=0,t=0,b=0,o=0,k=0;if((0|n)!=(0|f)){if((0|(e=i[f+16>>2]))!=(0|(o=i[n+16>>2]))){for(a=t=i[e+8>>2];i[a+16>>2]=o,(0|t)!=(0|(a=i[a+8>>2])););a=i[e>>2],t=i[e+4>>2],i[a+4>>2]=t,i[t>>2]=a,Q(e)}if((0|(k=i[n+20>>2]))!=(0|(t=i[f+20>>2]))){for(a=b=i[t+8>>2];i[a+20>>2]=k,(0|b)!=(0|(a=i[a+12>>2])););a=i[t>>2],b=i[t+4>>2],i[a+4>>2]=b,i[b>>2]=a,Q(t)}if(a=i[n+8>>2],b=i[f+8>>2],i[i[b+4>>2]+12>>2]=n,i[i[a+4>>2]+12>>2]=f,i[f+8>>2]=a,i[n+8>>2]=b,(0|e)==(0|o)){if(!(e=j(40)))return 0;for(a=i[n+16>>2],o=i[a+4>>2],i[e+4>>2]=o,i[o>>2]=e,i[e>>2]=a,i[a+4>>2]=e,i[e+12>>2]=0,i[e+8>>2]=f,a=f;i[a+16>>2]=e,(0|(a=i[a+8>>2]))!=(0|f););i[i[n+16>>2]+8>>2]=n}if((0|t)==(0|k)){if(!(e=j(24)))return 0;for(a=i[n+20>>2],t=i[a+4>>2],i[e+4>>2]=t,i[t>>2]=e,i[e>>2]=a,i[a+4>>2]=e,i[e+12>>2]=0,i[e+16>>2]=0,i[e+8>>2]=f,d[e+20|0]=0,d[e+21|0]=w[a+21|0],a=f;i[a+20>>2]=e,(0|(a=i[a+12>>2]))!=(0|f););i[i[n+20>>2]+8>>2]=n}}return 1}function X0(n,f){var a=0,e=0,t=0,b=0,o=0,k=0,s=u(0),r=0,A=0,l=u(0);if(i[n+20>>2]){e=f,a=i[n>>2],n=i[a+8>>2]+1|0,i[a+8>>2]=n;i:{if(!((0|(f=i[a+12>>2]))>=n<<1)){if(i[a+12>>2]=f<<1,t=i[a+4>>2],f=n0(b=i[a>>2],f<<3|4),i[a>>2]=f,!f){i[a>>2]=b,t=2147483647;break i}if(f=n0(i[a+4>>2],8+(i[a+12>>2]<<3)|0),i[a+4>>2]=f,!f){i[a+4>>2]=t,t=2147483647;break i}}if(b=i[a+4>>2],t=n,(f=i[a+16>>2])&&(i[a+16>>2]=i[4+(b+(f<<3)|0)>>2],t=f),o=i[a>>2],i[o+(n<<2)>>2]=t,i[(k=b+(t<<3)|0)>>2]=e,i[k+4>>2]=n,i[a+20>>2]){f:if(n>>>0<2)f=n;else for(s=c[e+28>>2];;){if(a=i[((f=n>>1)<<2)+o>>2],A=i[(r=b+(a<<3)|0)>>2],(l=c[A+28>>2])>2]<=c[e+32>>2])|s!=l)){f=n;break f}if(i[(n<<2)+o>>2]=a,i[r+4>>2]=n,!((n=f)>>>0>1))break}i[(f<<2)+o>>2]=t,i[k+4>>2]=f}}return t}if(e=(a=i[n+12>>2])+1|0,i[n+12>>2]=e,t=i[n+4>>2],(0|(b=e))<(0|(e=i[n+16>>2])))e=t;else if(i[n+16>>2]=e<<1,e=n0(t,e<<3),i[n+4>>2]=e,!e)return i[n+4>>2]=t,2147483647;return i[(a<<2)+e>>2]=f,-1^a}function s0(n){var f=0,a=0,e=0,t=0,b=0,o=0,k=0;b=j(40),o=j(40);i:{if(!(e=j(24))||!b|!o){if(b&&Q(b),o&&Q(o),!e)break i;return Q(e),0}if(!(f=j(64)))return 0;for(a=i[n+68>>2],t=i[(a=a>>>0<(t=n- -64|0)>>>0?a:t)+4>>2],k=i[t>>2],i[f+32>>2]=k,i[i[k+4>>2]>>2]=f,i[f>>2]=a,a=t,t=f+32|0,i[a>>2]=t,i[f+16>>2]=0,i[f+20>>2]=0,i[f+12>>2]=t,i[f+4>>2]=t,i[f+24>>2]=0,i[f+28>>2]=0,i[f+48>>2]=0,i[f+52>>2]=0,i[f+44>>2]=f,i[f+40>>2]=t,i[f+36>>2]=f,i[f+56>>2]=0,i[f+60>>2]=0,i[f+8>>2]=f,a=i[n+4>>2],i[b+4>>2]=a,i[a>>2]=b,i[b+12>>2]=0,i[b+8>>2]=f,a=f;i[a+16>>2]=b,(0|(a=i[a+8>>2]))!=(0|f););for(i[o+4>>2]=b,i[b>>2]=o,i[o>>2]=n,i[n+4>>2]=o,i[o+12>>2]=0,i[o+8>>2]=t,a=t;i[a+16>>2]=o,(0|t)!=(0|(a=i[a+8>>2])););for(a=i[n+44>>2],i[e+4>>2]=a,i[a>>2]=e,i[e>>2]=n+40,i[n+44>>2]=e,i[e+12>>2]=0,i[e+16>>2]=0,i[e+8>>2]=f,d[e+20|0]=0,d[e+21|0]=w[n+61|0],a=f;i[a+20>>2]=e,(0|(a=i[a+12>>2]))!=(0|f););}return f}function r0(n){n|=0;var f=0,a=0,e=0,t=0,b=0,o=u(0);if((f=j(128))&&(i[f+8>>2]=0,i[f+12>>2]=0,a=f+40|0,i[f+44>>2]=a,i[f+48>>2]=0,i[f+52>>2]=0,i[f+40>>2]=a,n2[f+54>>1]=0,n2[f+56>>1]=0,n2[f+58>>1]=0,n2[f+60>>1]=0,i[f+72>>2]=0,i[f+76>>2]=0,a=f+96|0,i[f+68>>2]=a,e=f- -64|0,i[f+64>>2]=e,i[f+80>>2]=0,i[f+84>>2]=0,i[f+88>>2]=0,i[f+92>>2]=0,i[f+104>>2]=0,i[f+108>>2]=0,i[f+100>>2]=e,i[f+96>>2]=a,i[f+112>>2]=0,i[f+116>>2]=0,i[f+120>>2]=0,i[f+124>>2]=0,i[f>>2]=f,i[f+4>>2]=f),i[n+8>>2]=f,!f)return 0;i:{if((0|(f=i[n+112>>2]))>0)for(t=116+((f<<4)+n|0)|0,a=n+116|0,f=i[n+4>>2];;){b=i[a+12>>2];f:{if(!f){if(e=0,!(f=s0(i[n+8>>2])))break i;if(Z(f,i[f+4>>2]))break f;break i}if(!o2(f))return 0;f=i[f+12>>2]}if(e=i[f+16>>2],i[e+12>>2]=b,c[e+16>>2]=c[a>>2],o=c[a+4>>2],i[e+24>>2]=0,c[e+20>>2]=o,i[f+28>>2]=1,i[i[f+4>>2]+28>>2]=-1,i[n+4>>2]=f,!(t>>>0>(a=a+16|0)>>>0))break}d[n+108|0]=0,i[n+112>>2]=0,e=1}return 0|e}function u4(n,f,a){f|=0,a|=0,(0|(a=i[1716+(n|=0)>>2]))==3?R[i[n+88>>2]](5):R[0|a](5,i[n+1896>>2]),(0|(a=i[n+1724>>2]))==5?R[i[n+96>>2]](i[i[f+16>>2]+12>>2]):R[0|a](i[i[f+16>>2]+12>>2],i[n+1896>>2]),(0|(a=i[n+1724>>2]))==5?R[i[n+96>>2]](i[i[i[f+4>>2]+16>>2]+12>>2]):R[0|a](i[i[i[f+4>>2]+16>>2]+12>>2],i[n+1896>>2]),a=i[f+20>>2];i:if(w[a+21|0])for(;;){if(w[a+20|0]||(d[a+20|0]=1,f=i[i[f+12>>2]+4>>2],(0|(a=i[n+1724>>2]))==5?R[i[n+96>>2]](i[i[f+16>>2]+12>>2]):R[0|a](i[i[f+16>>2]+12>>2],i[n+1896>>2]),a=i[f+20>>2],!w[a+21|0]|w[a+20|0]))break i;if(d[a+20|0]=1,f=i[f+8>>2],(0|(a=i[n+1724>>2]))==5?R[i[n+96>>2]](i[i[i[f+4>>2]+16>>2]+12>>2]):R[0|a](i[i[i[f+4>>2]+16>>2]+12>>2],i[n+1896>>2]),a=i[f+20>>2],!w[a+21|0])break}(0|(f=i[n+1728>>2]))==6?R[i[n+100>>2]]():R[0|f](i[n+1896>>2])}function p2(n,f){f|=0;var a=0;if((0|(a=i[(n|=0)>>2]))!=(0|f))for(;;){i:if(f>>>0>a>>>0){f:switch(0|a){case 0:(0|(a=i[n+1732>>2]))==11?R[i[n+12>>2]](100151):R[0|a](100151,i[n+1896>>2]),i[n>>2]&&p2(n,0),i[n+112>>2]=0,a=1,i[n>>2]=1,d[n+108|0]=0,i[n+1896>>2]=0,i[n+8>>2]=0;break i;case 1:break f;default:break i}if((0|(a=i[n+1732>>2]))==11?R[i[n+12>>2]](100152):R[0|a](100152,i[n+1896>>2]),i[n>>2]!=1&&p2(n,1),i[n>>2]=2,i[n+4>>2]=0,a=2,i[n+112>>2]<=0)break i;d[n+108|0]=1}else{f:switch(a-1|0){case 1:(0|(a=i[n+1732>>2]))==11?R[i[n+12>>2]](100154):R[0|a](100154,i[n+1896>>2]),i[n>>2]!=2&&p2(n,2),a=1,i[n>>2]=1;break i;case 0:break f;default:break i}(0|(a=i[n+1732>>2]))==11?R[i[n+12>>2]](100153):R[0|a](100153,i[n+1896>>2]),(a=i[n+8>>2])&&d0(a),a=0,i[n+8>>2]=0,i[n>>2]=0,i[n+4>>2]=0}if((0|f)==(0|a))break}}function A0(n,f){var a=0,e=0,t=0,b=0,o=0,k=0;i[n+8>>2]=7,i[n+4>>2]=0,a=i[f+20>>2];i:if(w[a+21|0]){t=f;f:{a:{for(;;){if(w[a+20|0])break i;if(d[a+20|0]=1,i[a+16>>2]=e,t=i[i[t+12>>2]+4>>2],e=i[t+20>>2],w[e+21|0]){if(w[e+20|0])break a;if(d[e+20|0]=1,i[e+16>>2]=a,b=b+2|0,t=i[t+8>>2],a=i[t+20>>2],w[a+21|0])continue;break i}break}b|=1;break f}b|=1}e=a}else t=f;o=i[f+4>>2],a=i[o+20>>2];i:if(!(!w[a+21|0]|w[a+20|0])){f:{a:{for(;;){if(d[a+20|0]=1,i[a+16>>2]=e,f=i[o+12>>2],o=i[f+4>>2],e=i[o+20>>2],w[e+21|0]){if(w[e+20|0])break a;if(d[e+20|0]=1,i[e+16>>2]=a,k=k+2|0,f=i[i[o+8>>2]+4>>2],o=i[f+4>>2],a=i[o+20>>2],!w[a+21|0])break i;if(!w[a+20|0])continue;break i}break}k|=1;break f}k|=1}e=a}a=b+k|0,i[n>>2]=a;i:{if(1&b){if(!(1&k))break i;i[n>>2]=a-1,f=f+8|0}else f=t+4|0;f=i[f>>2]}if(i[n+4>>2]=f,e)for(;d[e+20|0]=0,e=i[e+16>>2];);}function i1(n,f,a){var e=0,t=0,b=0,o=0,k=0,s=0,r=0,A=0,l=0;i:{f:{a:{n:{e:{t:{u:{o:{b:{k:{if(f){if(!a)break k;break b}r2=0,n=(n>>>0)/(a>>>0)|0;break i}if(!n)break o;break u}if(!(a-1&a))break t;o=0-(b=(s2(a)+33|0)-s2(f)|0)|0;break n}r2=0,n=(f>>>0)/0|0;break i}if((e=32-s2(f)|0)>>>0<31)break e;break a}if((0|a)==1)break f;a=31&(b=e0(a)),(63&b)>>>0>=32?n=f>>>a|0:(e=f>>>a|0,n=((1<>>a),r2=e;break i}b=e+1|0,o=63-e|0}if(t=31&(e=63&b),e>>>0>=32?(e=0,k=f>>>t|0):(e=f>>>t|0,k=((1<>>t),t=31&(o&=63),o>>>0>=32?(f=n<>>32-t|f<>>31,k=(e=k<<1|f>>>31)-(r=a&(t=l-(s+(e>>>0>o>>>0)|0)>>31))|0,e=s-(e>>>0>>0)|0,f=f<<1|n>>>31,n=A|n<<1,A=1&t,b=b-1|0;);r2=f<<1|n>>>31,n=A|n<<1;break i}n=0,f=0}r2=f}return n}function c4(n,f,a){f|=0,a|=0;var e=0,t=0,b=0,o=0,k=0,s=0,r=0;_=b=_-32|0,e=i[28+(n|=0)>>2],i[b+16>>2]=e,o=i[n+20>>2],i[b+28>>2]=a,i[b+24>>2]=f,f=o-e|0,i[b+20>>2]=f,o=f+a|0,s=2;i:{f:{f=b+16|0,(e=0|Y0(i[n+60>>2],0|f,2,b+12|0))?(i[806]=e,e=-1):e=0;a:{if(e)e=f;else for(;;){if((0|(t=i[b+12>>2]))==(0|o))break a;if((0|t)<0){e=f;break f}if(k=t-((r=(k=i[f+4>>2])>>>0>>0)?k:0)|0,i[(e=(r<<3)+f|0)>>2]=k+i[e>>2],i[(f=(r?12:4)+f|0)>>2]=i[f>>2]-k,o=o-t|0,f=e,s=s-r|0,(t=0|Y0(i[n+60>>2],0|f,0|s,b+12|0))?(i[806]=t,t=-1):t=0,t)break}if((0|o)!=-1)break f}f=i[n+44>>2],i[n+28>>2]=f,i[n+20>>2]=f,i[n+16>>2]=f+i[n+48>>2],n=a;break i}i[n+28>>2]=0,i[n+16>>2]=0,i[n+20>>2]=0,i[n>>2]=32|i[n>>2],n=0,(0|s)!=2&&(n=a-i[e+4>>2]|0)}return _=b+32|0,0|n}function f1(n){var f=0,a=0,e=0,t=0,b=0,o=0,k=u(0),s=0,r=u(0),A=0,l=0,v=0,h=0,y=0;if(t=i[n+4>>2],a=i[n>>2],e=i[a+4>>2],y=i[(f=t+(e<<3)|0)>>2],!((0|(b=i[n+8>>2]))<=0)&&(A=i[(b<<2)+a>>2],i[a+4>>2]=A,i[4+(l=(A<<3)+t|0)>>2]=1,i[f>>2]=0,i[f+4>>2]=i[n+16>>2],v=b-1|0,i[n+8>>2]=v,i[n+16>>2]=e,(0|b)!=1)){for(f=1;(0|v)<=(0|(n=f<<1))||(o=i[(i[((e=1|n)<<2)+a>>2]<<3)+t>>2],k=c[o+28>>2],s=i[(i[(n<<2)+a>>2]<<3)+t>>2],!(k<(r=c[s+28>>2]))&(!(c[o+32>>2]<=c[s+32>>2])|k!=r)||(n=e)),!((0|n)>=(0|b)||(e=i[l>>2],k=c[e+28>>2],o=i[(n<<2)+a>>2],h=i[(s=(o<<3)+t|0)>>2],k<(r=c[h+28>>2])|k==r&c[e+32>>2]<=c[h+32>>2]));)i[(f<<2)+a>>2]=o,i[s+4>>2]=f,f=n;i[(f<<2)+a>>2]=A,i[l+4>>2]=f}return y}function a1(n,f,a){switch(f-9|0){case 0:return f=i[a>>2],i[a>>2]=f+4,void(i[n>>2]=i[f>>2]);case 6:return f=i[a>>2],i[a>>2]=f+4,f=n2[f>>1],i[n>>2]=f,void(i[n+4>>2]=f>>31);case 7:return f=i[a>>2],i[a>>2]=f+4,i[n>>2]=G2[f>>1],void(i[n+4>>2]=0);case 8:return f=i[a>>2],i[a>>2]=f+4,f=d[0|f],i[n>>2]=f,void(i[n+4>>2]=f>>31);case 9:return f=i[a>>2],i[a>>2]=f+4,i[n>>2]=w[0|f],void(i[n+4>>2]=0);case 16:return f=i[a>>2]+7&-8,i[a>>2]=f+8,void(q[n>>3]=q[f>>3]);case 17:b2();default:return;case 1:case 4:case 14:return f=i[a>>2],i[a>>2]=f+4,f=i[f>>2],i[n>>2]=f,void(i[n+4>>2]=f>>31);case 2:case 5:case 11:case 15:return f=i[a>>2],i[a>>2]=f+4,i[n>>2]=i[f>>2],void(i[n+4>>2]=0);case 3:case 10:case 12:case 13:}f=i[a>>2]+7&-8,i[a>>2]=f+8,a=i[f+4>>2],i[n>>2]=i[f>>2],i[n+4>>2]=a}function s4(n,f,a){f|=0,a|=0,(0|(a=i[1716+(n|=0)>>2]))==3?R[i[n+88>>2]](6):R[0|a](6,i[n+1896>>2]),(0|(a=i[n+1724>>2]))==5?R[i[n+96>>2]](i[i[f+16>>2]+12>>2]):R[0|a](i[i[f+16>>2]+12>>2],i[n+1896>>2]),(0|(a=i[n+1724>>2]))==5?R[i[n+96>>2]](i[i[i[f+4>>2]+16>>2]+12>>2]):R[0|a](i[i[i[f+4>>2]+16>>2]+12>>2],i[n+1896>>2]),a=i[f+20>>2];i:if(w[a+21|0])for(;;){if(w[a+20|0])break i;if(d[a+20|0]=1,f=i[f+8>>2],(0|(a=i[n+1724>>2]))==5?R[i[n+96>>2]](i[i[i[f+4>>2]+16>>2]+12>>2]):R[0|a](i[i[i[f+4>>2]+16>>2]+12>>2],i[n+1896>>2]),a=i[f+20>>2],!w[a+21|0])break}(0|(f=i[n+1728>>2]))==6?R[i[n+100>>2]]():R[0|f](i[n+1896>>2])}function n1(n,f,a){var e=0,t=0;if(a&&(d[0|n]=f,d[(e=n+a|0)-1|0]=f,!(a>>>0<3||(d[n+2|0]=f,d[n+1|0]=f,d[e-3|0]=f,d[e-2|0]=f,a>>>0<7||(d[n+3|0]=f,d[e-4|0]=f,a>>>0<9||(t=(e=0-n&3)+n|0,n=L(255&f,16843009),i[t>>2]=n,i[(f=(a=a-e&-4)+t|0)-4>>2]=n,a>>>0<9||(i[t+8>>2]=n,i[t+4>>2]=n,i[f-8>>2]=n,i[f-12>>2]=n,a>>>0<25||(i[t+24>>2]=n,i[t+20>>2]=n,i[t+16>>2]=n,i[t+12>>2]=n,i[f-16>>2]=n,i[f-20>>2]=n,i[f-24>>2]=n,i[f-28>>2]=n,(a=a-(f=4&t|24)|0)>>>0<32))))))))for(n=h0(n,0,1,1),e=r2,f=f+t|0;i[f+24>>2]=n,i[f+28>>2]=e,i[f+16>>2]=n,i[f+20>>2]=e,i[f+8>>2]=n,i[f+12>>2]=e,i[f>>2]=n,i[f+4>>2]=e,f=f+32|0,(a=a-32|0)>>>0>31;);}function J(n,f,a){var e=u(0),t=0,b=0,o=u(0),k=u(0),s=0,r=u(0),A=u(0),l=u(0);_=b=_+-64|0;i:{f:{if(!(!(s=(e=c[f+28>>2])>(k=c[n+28>>2]))&(!(c[n+32>>2]<=c[f+32>>2])|e!=k))){if((o=c[a+28>>2])>e|e==o&c[f+32>>2]<=c[a+32>>2])break i;if(t=1,s)break f}t=0,e==k&&(t=c[n+32>>2]<=c[f+32>>2])}s=t,t=1,(o=c[a+28>>2])>e||(t=0,e==o&&(t=c[f+32>>2]<=c[a+32>>2])),r=c[n+32>>2],A=c[f+32>>2],l=c[a+32>>2],q[b+40>>3]=o,q[b+24>>3]=e,q[b+48>>3]=l,q[b+32>>3]=A,q[b+16>>3]=r,q[b+8>>3]=k,i[b+4>>2]=t,i[b>>2]=s,A1(1092,b),o=c[a+28>>2],k=c[n+28>>2],e=c[f+28>>2]}return r=u(0),_=b- -64|0,k=u(e-k),e=u(o-e),u(k+e)>u(0)&&(o=c[f+32>>2],r=u(u(u(o-c[a+32>>2])*k)+u(e*u(o-c[n+32>>2])))),r}function B2(n,f,a){switch(f-100100|0){case 0:return void(i[n+88>>2]=a||15);case 6:return void(i[n+1716>>2]=a||3);case 4:return d[n+80|0]=(0|a)!=0,void(i[n+92>>2]=a||14);case 10:return d[n+80|0]=(0|a)!=0,void(i[n+1720>>2]=a||4);case 1:return void(i[n+96>>2]=a||13);case 7:return void(i[n+1724>>2]=a||5);case 2:return void(i[n+100>>2]=a||12);case 8:return void(i[n+1728>>2]=a||6);case 3:return void(i[n+12>>2]=a||18);case 9:return void(i[n+1732>>2]=a||11);case 5:return void(i[n+76>>2]=a||17);case 11:return void(i[n+1736>>2]=a||10);case 12:return void(i[n+104>>2]=a||16)}(0|(f=i[n+1732>>2]))==11?R[i[n+12>>2]](100900):R[0|f](100900,i[n+1896>>2])}function L2(n,f,a){var e=0,t=0,b=0,o=0;e=i[f>>2];i:{if((0|f)!=(0|a))for(;;){if(d[f+15|0]=0,o=i[f+4>>2],b=i[i[o+8>>2]>>2],t=i[b>>2],i[t+16>>2]!=i[e+16>>2]){if(!w[b+15|0])return n=w[f+12|0],a=i[e+20>>2],i[a+8>>2]=e,d[a+21|0]=n,i[e+24>>2]=0,m2(o),Q(f),e;if(!(t=A2(i[i[e+8>>2]+4>>2],i[t+4>>2]))||!$(i[b>>2]))break i;i[b>>2]=t,d[b+15|0]=0,i[t+24>>2]=b}if(i[e+8>>2]!=(0|t)&&(!Z(i[i[t+4>>2]+12>>2],t)||!Z(e,t)))break i;if(t=w[f+12|0],e=i[f>>2],o=i[e+20>>2],i[o+8>>2]=e,d[o+21|0]=t,i[e+24>>2]=0,m2(i[f+4>>2]),Q(f),e=i[b>>2],(0|a)==(0|(f=b)))break}return e}k2(n+1740|0,1),b2()}function l0(n,f,a){var e=0,t=0,b=0;_=e=_-48|0,i[e+24>>2]=0,i[e+28>>2]=0,i[e+16>>2]=0,i[e+20>>2]=0,i[e+8>>2]=0,i[e+12>>2]=0,i[e>>2]=1056964608,i[e+4>>2]=1056964608,t=i[f+16>>2],i[e+16>>2]=i[t+12>>2],i[e+20>>2]=i[i[a+16>>2]+12>>2],c[e+36>>2]=c[t+16>>2],c[e+40>>2]=c[t+20>>2],c[e+44>>2]=c[t+24>>2],i[t+12>>2]=0,t=t+12|0,(0|(b=i[n+1736>>2]))==10?R[i[n+76>>2]](e+36|0,e+16|0,e,t):R[0|b](e+36|0,e+16|0,e,t,i[n+1896>>2]),i[t>>2]||(i[t>>2]=i[e+16>>2]),Z(f,a)||(k2(n+1740|0,1),b2()),_=e+48|0}function r4(n,f){n|=0;var a=0,e=0,t=0;if((0|(a=i[40+(f|=0)>>2]))!=(0|(e=f+40|0)))for(;;){if(w[a+21|0]){for((0|(f=i[n+1716>>2]))==3?R[i[n+88>>2]](2):R[0|f](2,i[n+1896>>2]),f=i[a+8>>2];(0|(t=i[n+1724>>2]))==5?R[i[n+96>>2]](i[i[f+16>>2]+12>>2]):R[0|t](i[i[f+16>>2]+12>>2],i[n+1896>>2]),(0|(f=i[f+12>>2]))!=i[a+8>>2];);(0|(f=i[n+1728>>2]))==6?R[i[n+100>>2]]():R[0|f](i[n+1896>>2])}if((0|e)==(0|(a=i[a>>2])))break}}function e1(n,f,a){var e=0,t=0,b=0;if(_=e=_-208|0,i[e+204>>2]=f,n1(f=e+160|0,0,40),i[e+200>>2]=i[e+204>>2],!((0|N0(0,n,e+200|0,e+80|0,f,a))<0)){f=i[423]<0,t=i[404],i[404]=-33&t;i:{f:{if(i[416]){if(i[408])break f}else i[416]=80,i[411]=0,i[408]=0,i[409]=0,b=i[415],i[415]=e;if(r1(1616))break i}N0(1616,n,e+200|0,e+80|0,e+160|0,a)}b&&(R[i[413]](1616,0,0),i[416]=0,i[415]=b,i[411]=0,i[408]=0,i[409]=0),i[404]=i[404]|32&t}_=e+208|0}function t1(n,f){if(!n)return 0;i:{f:{if(n){if(f>>>0<=127)break f;if(i[i[845]>>2]){if(f>>>0<=2047){d[n+1|0]=63&f|128,d[0|n]=f>>>6|192,n=2;break i}if(!((-8192&f)!=57344&f>>>0>=55296)){d[n+2|0]=63&f|128,d[0|n]=f>>>12|224,d[n+1|0]=f>>>6&63|128,n=3;break i}if(f-65536>>>0<=1048575){d[n+3|0]=63&f|128,d[0|n]=f>>>18|240,d[n+2|0]=f>>>6&63|128,d[n+1|0]=f>>>12&63|128,n=4;break i}}else if((-128&f)==57216)break f;i[806]=25,n=-1}else n=1;break i}d[0|n]=f,n=1}return n}function A4(n,f,a){n|=0,f|=0,a|=0;var e=0,t=0,b=u(0),o=u(0);return a=i[a>>2],e=i[i[a+4>>2]+16>>2],f=i[f>>2],(0|(t=i[i[f+4>>2]+16>>2]))==(0|(n=i[n+72>>2]))?(0|n)==(0|e)?(f=i[f+16>>2],b=c[f+28>>2],a=i[a+16>>2],!(b<(o=c[a+28>>2]))&(!(c[f+32>>2]<=c[a+32>>2])|b!=o)?J(n,a,f)>=u(0)|0:J(n,f,a)<=u(0)|0):J(e,n,i[a+16>>2])<=u(0)|0:(f=i[f+16>>2],(0|n)==(0|e)?J(t,n,f)>=u(0)|0:s1(t,n,f)>=s1(i[i[a+4>>2]+16>>2],n,i[a+16>>2])|0)}function v0(n){var f=0,a=0,e=0,t=0,b=0,o=u(0),k=u(0);if(!(f=i[n+12>>2]))return f1(i[n>>2]);if(e=i[n+8>>2],t=i[i[(e+(f<<2)|0)-4>>2]>>2],a=i[n>>2],i[a+8>>2]&&(b=i[i[a+4>>2]+(i[i[a>>2]+4>>2]<<3)>>2],!(!((o=c[b+28>>2])<(k=c[t+28>>2]))&(!(c[b+32>>2]<=c[t+32>>2])|o!=k))))return f1(a);for(a=e-8|0,e=((0|f)>0?1:f)-1|0;;){if((0|f)<2)return i[n+12>>2]=e,t;if(b=f<<2,f=f-1|0,i[i[a+b>>2]>>2])break}return i[n+12>>2]=f,t}function l4(n,f,a){f|=0,a|=0;var e=0,t=0,b=0,o=0;b=1;i:if((0|(e=i[64+(n|=0)>>2]))!=(0|(t=n- -64|0))){if(o=0-f|0,!a){for(;;)if(n=w[i[e+20>>2]+21|0],i[e+28>>2]=(0|n)!=w[i[i[e+4>>2]+20>>2]+21|0]?n?f:o:0,(0|t)==(0|(e=i[e>>2])))break i}for(;;){if(n=i[e>>2],(0|(a=w[i[e+20>>2]+21|0]))==w[i[i[e+4>>2]+20>>2]+21|0]){if(!$(e)){b=0;break i}}else i[e+28>>2]=a?f:o;if((0|t)==(0|(e=n)))break}}return 0|b}function N(n,f,a){var e=0,t=0,b=0;if(!(32&w[0|n]))i:{if(!(e=i[n+16>>2])){if(r1(n))break i;e=i[n+16>>2]}if(e-(t=i[n+20>>2])>>>0>>0)R[i[n+36>>2]](n,f,a);else{f:{a:if(!(!a|i[n+80>>2]<0)){for(e=a;;){if(w[(b=f+e|0)-1|0]!=10){if(e=e-1|0)continue;break a}break}if(R[i[n+36>>2]](n,f,e)>>>0>>0)break i;a=a-e|0,t=i[n+20>>2];break f}b=f}q0(t,b,a),i[n+20>>2]=i[n+20>>2]+a}}}function o1(n,f){var a=0,e=0,t=0;(a=j(16))&&(t=s0(i[n+8>>2]))&&(e=i[t+16>>2],c[e+32>>2]=f,i[e+28>>2]=2112929218,e=i[i[t+4>>2]+16>>2],c[e+32>>2]=f,i[e+28>>2]=-34554430,i[n+72>>2]=e,d[a+15|0]=0,d[a+12|0]=0,i[a+8>>2]=0,i[a>>2]=t,d[a+13|0]=1,d[a+14|0]=0,e=a,a=w0(t=i[n+64>>2],t,a),i[e+4>>2]=a,a)||(k2(n+1740|0,1),b2())}function d0(n){var f=0,a=0,e=0;if((0|(f=i[40+(n|=0)>>2]))!=(0|(a=n+40|0)))for(;e=i[f>>2],Q(f),(0|a)!=(0|(f=e)););if((0|(f=i[n>>2]))!=(0|n))for(;e=i[f>>2],Q(f),(0|(f=e))!=(0|n););if((0|(f=i[n+64>>2]))!=(0|(a=n- -64|0)))for(;e=i[f>>2],Q(f),(0|a)!=(0|(f=e)););Q(n)}function b1(n){var f=0,a=u(0),e=u(0);if(!(f=i[n+12>>2]))return n=i[n>>2],i[i[n+4>>2]+(i[i[n>>2]+4>>2]<<3)>>2];f=i[i[(i[n+8>>2]+(f<<2)|0)-4>>2]>>2],n=i[n>>2];i:{if(i[n+8>>2]&&(n=i[i[n+4>>2]+(i[i[n>>2]+4>>2]<<3)>>2],(a=c[n+28>>2])<(e=c[f+28>>2])||a==e&&c[n+32>>2]<=c[f+32>>2]))break i;n=f}return n}function v4(n,f,a,e){n|=0,f|=0,a|=0,e|=0,a=0;i:{if(f=i[456]){if(!((a=i[f>>2])>>>0<100001)){f=j(12);break i}}else f=j(1200008),i[f+4>>2]=12,i[f>>2]=0,i[456]=f;i[f>>2]=a+1,f=8+(L(a,12)+f|0)|0}c[f>>2]=c[n>>2],c[f+4>>2]=c[n+4>>2],c[f+8>>2]=c[n+8>>2],i[e>>2]=f}function Q2(n,f,a){var e=0,t=0,b=0,o=0;if(f)for(;b=a=a-1|0,o=(t=n)-h0(n=i1(n,f,10),e=r2,10,0)|48,d[0|b]=o,t=f>>>0>9,f=e,t;);if(n)for(;f=(n>>>0)/10|0,d[0|(a=a-1|0)]=n-L(f,10)|48,e=n>>>0>9,n=f,e;);return a}function k1(n,f,a,e){var t=0,b=0,o=0;if(b=i[980]+1|0,i[980]=b,i[n>>2]=b,e)for(;;){if(!i[(t=(o<<3)+a|0)>>2])return i[t>>2]=b,i[t+4>>2]=f,i[t+8>>2]=0,W=e,a;if((0|(o=o+1|0))==(0|e))break}return t=n,n=e<<1,f=k1(t,f,n0(a,e<<4|8),n),W=n,f}function u1(n,f){var a=0,e=0,t=0;if(u0(+n),e=0|c2(1),t=0|c2(0),(0|(a=e>>>20&2047))!=2047){if(!a)return n==0?a=0:(n=u1(18446744073709552e3*n,f),a=i[f>>2]+-64|0),i[f>>2]=a,n;i[f>>2]=a-1022,L0(0,0|t),L0(1,-2146435073&e|1071644672),n=+K1()}return n}function c1(n){var f=0,a=0,e=0;if(d[i[n>>2]]-48>>>0>=10)return 0;for(;e=i[n>>2],a=-1,f>>>0<=214748364&&(a=(0|(a=d[0|e]-48|0))>(2147483647^(f=L(f,10)))?-1:a+f|0),i[n>>2]=e+1,f=a,d[e+1|0]-48>>>0<10;);return f}function s1(n,f,a){var e=u(0),t=u(0),b=0,o=u(0),k=u(0);return e=c[f+28>>2],t=u(e-c[n+28>>2]),e=u(c[a+28>>2]-e),(o=u(t+e))>u(0)?(k=c[((b=e>t)?n:a)+32>>2],e=u(u(u(k-c[(b?a:n)+32>>2])*u((b?t:e)/o))+u(c[f+32>>2]-k))):e=u(0),e}function h0(n,f,a,e){var t=0,b=0,o=0,k=0,s=0,r=0;return r=L(t=a>>>16|0,b=n>>>16|0),t=(65535&(b=((s=L(o=65535&a,k=65535&n))>>>16|0)+L(b,o)|0))+L(t,k)|0,r2=(L(f,a)+r|0)+L(n,e)+(b>>>16)+(t>>>16)|0,65535&s|t<<16}function w0(n,f,a){for(var e=0;f=i[f+8>>2],(e=i[f>>2])&&!(0|R[i[n+16>>2]](i[n+12>>2],e,a)););return(n=j(12))&&(i[n>>2]=a,a=i[f+4>>2],i[n+4>>2]=a,i[a+8>>2]=n,i[n+8>>2]=f,i[f+4>>2]=n),n}function z(n,f,a,e,t){var b=0;if(_=b=_-256|0,!(73728&t|(0|a)<=(0|e))){if(n1(b,255&f,(a=(e=a-e|0)>>>0<256)?e:256),!a)for(;N(n,b,256),(e=e-256|0)>>>0>255;);N(n,b,e)}_=b+256|0}function r1(n){var f=0;return f=i[n+72>>2],i[n+72>>2]=f-1|f,8&(f=i[n>>2])?(i[n>>2]=32|f,-1):(i[n+4>>2]=0,i[n+8>>2]=0,f=i[n+44>>2],i[n+28>>2]=f,i[n+20>>2]=f,i[n+16>>2]=f+i[n+48>>2],0)}function X(n,f,a){var e=0,t=0,b=0;i:if(a)for(;;){if(!(b=i[(t=(e<<3)+f|0)>>2]))break i;if((0|n)==(0|b))return i[t+4>>2];if((0|(e=e+1|0))==(0|a))break}return 0}function T2(n){var f=0,a=0;i:{if(!((n=(f=i[440])+(a=n+7&-8)|0)>>>0<=f>>>0&&a)&&(n>>>0<=v1()<<16>>>0||0|i4(0|n)))break i;return i[806]=48,-1}return i[440]=n,f}function d4(n,f){n|=0;var a=0,e=0;(0|(a=i[4+(f|=0)>>2]))>2]&&(e=i[f>>2]+(L(i[f+12>>2],a)<<2)|0,c[e>>2]=c[n>>2],c[e+4>>2]=c[n+4>>2],i[f+4>>2]=a+1)}function h4(n,f){n|=0,f|=0;var a=u(0),e=u(0);if((a=c[n+28>>2])<(e=c[f+28>>2]))n=1;else{if(a!=e)return 0;n=c[n+32>>2]<=c[f+32>>2]}return 0|n}function y0(n){var f=0;(f=i[n>>2])&&(Q(i[f+4>>2]),Q(i[f>>2]),Q(f)),(f=i[n+8>>2])&&Q(f),(f=i[n+4>>2])&&Q(f),Q(n)}function w4(n){n|=0;var f=0;_=f=_-16|0,i[f>>2]=n,_=n=_-16|0,i[n+12>>2]=f,e1(1078,f,0),_=n+16|0,_=f+16|0}function y4(n,f,a){n|=0,f=i[20+(f|=0)>>2],i[f+16>>2]=i[n+84>>2],i[n+84>>2]=f,d[f+20|0]=1}function m2(n){var f=0,a=0;f=i[n+4>>2],a=i[n+8>>2],i[f+8>>2]=a,i[a+4>>2]=f,Q(n)}function i2(n){var f=0;return(-1>>>(f=31&n)&-2)<>>n}function A1(n,f){var a=0;_=a=_-16|0,i[a+12>>2]=f,e1(n,f,40),_=a+16|0}function k2(n,f){n|=0,f|=0,i[978]||(i[978]=n,i[979]=f),X1()}function p4(n,f){n|=0,f|=0,i[978]||(i[978]=n,i[979]=f)}function m4(n,f,a,e){return r2=0,0}function g4(n,f,a,e,t){}function e0(n){return n?31-s2(n-1^n)|0:32}function E4(n,f,a,e){}function C4(){i[845]=3260,i[827]=42}function R4(n){return 0}function t0(n,f){}function I4(){return 0|_}function S4(n){_=n|=0}function g2(n){}function l1(){}F=w,e2();var R=U([null,y4,s4,t0,t0,t0,g2,u4,h4,A4,g4,t0,l1,g2,g2,g2,g2,E4,g2,p2,b4,r0,k2,V0,t4,l4,k4,r4,o4,$0,d0,d4,g2,l1,v4,w4,g2,R4,c4,m4,e4]);function v1(){return a2.byteLength/65536|0}function M4(n){n|=0;var f=0|v1(),a=f+n|0;if(fp.startsWith(T0);function W0(p){if(p==x2&&U2)return new Uint8Array(U2);var C=E1(p);if(C)return C;if(o0)return o0(p);throw"both async and sync fetching of the wasm failed"}function F1(p){return U2||N2(p)||!P2&&!Y2||typeof fetch!="function"?Promise.resolve().then(()=>W0(p)):fetch(p,{credentials:"same-origin"}).then(C=>{if(!C.ok)throw"failed to load wasm binary file at '"+p+"'";return C.arrayBuffer()}).catch(()=>W0(p))}function H0(p,C,B){return F1(p).then(U=>h2.instantiate(U,C)).then(U=>U).then(B,U=>{_2(`failed to asynchronously prepare wasm: ${U}`),Q0(U)})}function B1(p,C,B,U){return p||typeof h2.instantiateStreaming!="function"||N2(C)||typeof fetch!="function"?H0(C,B,U):fetch(C,{credentials:"same-origin"}).then(F=>h2.instantiateStreaming(F,B).then(U,function(H){return _2(`wasm streaming compile failed: ${H}`),_2("falling back to ArrayBuffer instantiation"),H0(C,B,U)}))}function Q1(){var p={a:L1};function C(U,F){return u2=U.exports,x0=u2.m,M1(u2.j),_1(),u2}function B(U){C(U.instance)}if(U1(),E.instantiateWasm)try{return E.instantiateWasm(p,C)}catch(U){_2(`Module.instantiateWasm callback failed with error: ${U}`),v2(U)}return B1(U2,x2,p,B).catch(v2),{}}N2(x2="libtess-asm.wasm")||(x2=p1(x2));var b0=p=>{for(;p.length>0;)p.shift()(E)};E.noExitRuntime;var x0,T1=()=>{throw 1/0},W1=(p,C,B)=>Z2.copyWithin(p,C,C+B),H1=()=>2147483648,x1=p=>{var C=(p-F2.buffer.byteLength+65535)/65536;try{return F2.grow(C),P0(),1}catch{}},O1=p=>{var C=Z2.length;p>>>=0;var B=H1();if(p>B)return!1;for(var U=(x,e2)=>x+(e2-x%e2)%e2,F=1;F<=4;F*=2){var H=C*(1+.2/F);H=Math.min(H,p+100663296);var D=Math.min(B,U(Math.max(p,H),65536));if(x1(D))return!0}return!1},j1=[null,[],[]],O0=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,D1=(p,C,B)=>{for(var U=C+B,F=C;p[F]&&!(F>=U);)++F;if(F-C>16&&p.buffer&&O0)return O0.decode(p.subarray(C,F));for(var H="";C>10,56320|1023&y2)}}else H+=String.fromCharCode((31&D)<<6|x)}else H+=String.fromCharCode(D)}return H},G1=(p,C)=>{var B=j1[p];C===0||C===10?((p===1?m1:_2)(D1(B,0)),B.length=0):B.push(C)},V2=[],z2=p=>{var C=V2[p];return C||(p>=V2.length&&(V2.length=p+1),V2[p]=C=x0.get(p)),C},L1={f:T1,h:W1,g:O1,d:(p,C,B,U)=>{for(var F=0,H=0;H>2],x=J2[C+4>>2];C+=8;for(var e2=0;e2>2]=F,0},c:J1,i:N1,e:Z1,b:Y1,a:F2},u2=Q1();E._malloc=p=>(E._malloc=u2.k)(p),E._free=p=>(E._free=u2.l)(p),E._triangulate=(p,C,B,U,F,H)=>(E._triangulate=u2.n)(p,C,B,U,F,H);var K2,O2=(p,C)=>(O2=u2.o)(p,C),j2=()=>(j2=u2.p)(),D2=p=>(D2=u2.q)(p);function Y1(p,C,B){var U=j2();try{z2(p)(C,B)}catch(F){if(D2(U),F!==F+0)throw F;O2(1,0)}}function Z1(p,C){var B=j2();try{z2(p)(C)}catch(U){if(D2(B),U!==U+0)throw U;O2(1,0)}}function J1(p,C){var B=j2();try{return z2(p)(C)}catch(U){if(D2(B),U!==U+0)throw U;O2(1,0)}}function N1(p,C,B,U){var F=j2();try{return z2(p)(C,B,U)}catch(H){if(D2(F),H!==H+0)throw H;O2(1,0)}}function j0(){function p(){K2||(K2=!0,E.calledRun=!0,M0||(R1(),W2(E),E.onRuntimeInitialized&&E.onRuntimeInitialized(),I1()))}C2>0||(C1(),C2>0||(E.setStatus?(E.setStatus("Running..."),setTimeout(function(){setTimeout(function(){E.setStatus("")},1),p()},1)):p()))}if(H2=function p(){K2||j0(),K2||(H2=p)},E.preInit)for(typeof E.preInit=="function"&&(E.preInit=[E.preInit]);E.preInit.length>0;)E.preInit.pop()();j0();let k0=null,w2=null,R2=null,q2=null;const V1=2,D0=4e3;let G0=0;const z1=(p,C,B)=>{k0||(k0=E._triangulate);let U=E.HEAPF32;const F=E.HEAP32.BYTES_PER_ELEMENT,H=2,D=U.BYTES_PER_ELEMENT;B>G0&&(G0=B,R2&&(E._free(R2),R2=0),w2&&(E._free(w2),w2=0)),R2||(R2=E._malloc(B*D)),q2||(q2=E._malloc(D0*F));const x=B*V1;w2||(w2=E._malloc(x*D)),U=E.HEAPF32,U.set(p,R2/D),E.HEAP32.set(C,q2/F);const e2=x/H,y2=k0(R2,q2,Math.min(C.length,D0),H,w2,e2),$2=y2*H;U=E.HEAPF32;const X2=U.slice(w2/D,w2/D+$2),c2={};return c2.buffer=X2,c2.vertexCount=y2,c2};return E.triangulate=z1,M2.ready},d1.exports=h1;var w1=y1.exports;const F4=U4({__proto__:null,default:P4(w1)},[w1]);export{F4 as l}; +import{ar as P4}from"./index-BjUNJPVf.js";function U4(M2,W2){for(var v2=0;v2E[d2]})}}}return Object.freeze(Object.defineProperty(M2,Symbol.toStringTag,{value:"Module"}))}var d1,S0,h1,y1={exports:{}};d1=y1,S0=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,h1=function(M2={}){var W2,v2,E=M2;E.ready=new Promise((p,C)=>{W2=p,v2=C});var d2=Object.assign({},E),P2=typeof window=="object",Y2=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var o0,l2="";function p1(p){return E.locateFile?E.locateFile(p,l2):l2+p}(P2||Y2)&&(Y2?l2=self.location.href:typeof document<"u"&&document.currentScript&&(l2=document.currentScript.src),S0&&(l2=S0),l2=l2.indexOf("blob:")!==0?l2.substr(0,l2.replace(/[?#].*/,"").lastIndexOf("/")+1):"",Y2&&(o0=p=>{var C=new XMLHttpRequest;return C.open("GET",p,!1),C.responseType="arraybuffer",C.send(null),new Uint8Array(C.response)}));var U2,m1=E.print||console.log.bind(console),_2=E.printErr||console.error.bind(console);Object.assign(E,d2),d2=null,E.arguments&&E.arguments,E.thisProgram&&E.thisProgram,E.quit&&E.quit,E.wasmBinary&&(U2=E.wasmBinary);var F2,h2={Memory:function(p){this.buffer=new ArrayBuffer(65536*p.initial)},Module:function(p){},Instance:function(p,C){this.exports=function(B){function U(K){return K.set=function(V,t2){this[V]=t2},K.get=function(V){return this[V]},K}for(var F,H=new Uint8Array(123),D=25;D>=0;--D)H[48+D]=52+D,H[65+D]=D,H[97+D]=26+D;function x(K,V,t2){for(var a2,d,n2=0,i=V,w=t2.length,G2=V+(3*w>>2)-(t2[w-2]=="=")-(t2[w-1]=="=");n2>4,i>2),i>>0<=244){if(3&(f=(o=i[854])>>>(a=(k=n>>>0<11?16:n+11&504)>>>3|0)|0)){f=3456+(n=(a=a+(1&(-1^f))|0)<<3)|0,e=i[n+3464>>2],(0|f)!=(0|(n=i[e+8>>2]))?(i[n+12>>2]=f,i[f+8>>2]=n):(v=3416,h=i2(a)&o,i[v>>2]=h),n=e+8|0,f=a<<3,i[e+4>>2]=3|f,i[4+(f=f+e|0)>>2]=1|i[f+4>>2];break i}if((A=i[856])>>>0>=k>>>0)break b;if(f){f=3456+(n=(e=e0((0-(n=2<>2],(0|f)!=(0|(n=i[t+8>>2]))?(i[n+12>>2]=f,i[f+8>>2]=n):(o=i2(e)&o,i[854]=o),i[t+4>>2]=3|k,e=(n=e<<3)-k|0,i[4+(a=t+k|0)>>2]=1|e,i[n+t>>2]=e,A&&(f=3456+(-8&A)|0,b=i[859],(n=1<<(A>>>3))&o?n=i[f+8>>2]:(i[854]=n|o,n=f),i[f+8>>2]=b,i[n+12>>2]=b,i[b+12>>2]=f,i[b+8>>2]=n),n=t+8|0,i[859]=a,i[856]=e;break i}if(!(r=i[855]))break b;for(a=i[3720+(e0(r)<<2)>>2],t=(-8&i[a+4>>2])-k|0,f=a;(n=i[f+16>>2])||(n=i[f+20>>2]);)t=(e=(f=(-8&i[n+4>>2])-k|0)>>>0>>0)?f:t,a=e?n:a,f=n;if(s=i[a+24>>2],(0|(e=i[a+12>>2]))!=(0|a)){n=i[a+8>>2],i[n+12>>2]=e,i[e+8>>2]=n;break f}if(!(n=i[(f=a+20|0)>>2])){if(!(n=i[a+16>>2]))break o;f=a+16|0}for(;b=f,e=n,(n=i[(f=n+20|0)>>2])||(f=e+16|0,n=i[e+16>>2]););i[b>>2]=0;break f}if(k=-1,!(n>>>0>4294967231)&&(k=-8&(n=n+11|0),r=i[855])){t=0-k|0,o=0,k>>>0<256||(o=31,k>>>0>16777215||(o=62+((k>>>38-(n=s2(n>>>8|0))&1)-(n<<1)|0)|0));k:{c:{if(f=i[3720+(o<<2)>>2])for(n=0,a=k<<((0|o)!=31?25-(o>>>1|0)|0:0);;){if(!((b=(-8&i[f+4>>2])-k|0)>>>0>=t>>>0||(e=f,t=b))){t=0,n=f;break c}if(b=i[f+20>>2],f=i[16+((a>>>29&4)+f|0)>>2],n=b?(0|b)==(0|f)?n:b:n,a<<=1,!f)break}else n=0;if(!(n|e)){if(e=0,!(n=(0-(n=2<>2]}if(!n)break k}for(;t=(a=(f=(-8&i[n+4>>2])-k|0)>>>0>>0)?f:t,e=a?n:e,n=(f=i[n+16>>2])||i[n+20>>2];);}if(!(!e|i[856]-k>>>0<=t>>>0)){if(o=i[e+24>>2],(0|e)!=(0|(a=i[e+12>>2]))){n=i[e+8>>2],i[n+12>>2]=a,i[a+8>>2]=n;break a}if(!(n=i[(f=e+20|0)>>2])){if(!(n=i[e+16>>2]))break u;f=e+16|0}for(;b=f,a=n,(n=i[(f=n+20|0)>>2])||(f=a+16|0,n=i[a+16>>2]););i[b>>2]=0;break a}}}if((n=i[856])>>>0>=k>>>0){e=i[859],(f=n-k|0)>>>0>=16?(i[4+(a=e+k|0)>>2]=1|f,i[n+e>>2]=f,i[e+4>>2]=3|k):(i[e+4>>2]=3|n,i[4+(n=n+e|0)>>2]=1|i[n+4>>2],a=0,f=0),i[856]=f,i[859]=a,n=e+8|0;break i}if((s=i[857])>>>0>k>>>0){f=s-k|0,i[857]=f,n=(a=i[860])+k|0,i[860]=n,i[n+4>>2]=1|f,i[a+4>>2]=3|k,n=a+8|0;break i}if(n=0,t=k+47|0,i[972]?a=i[974]:(i[975]=-1,i[976]=-1,i[973]=4096,i[974]=4096,i[972]=l+12&-16^1431655768,i[977]=0,i[965]=0,a=4096),(f=(o=t+a|0)&(b=0-a|0))>>>0<=k>>>0||(e=i[964])&&e>>>0<(r=(a=i[962])+f|0)>>>0|a>>>0>=r>>>0)break i;b:{if(!(4&w[3860])){k:{c:{A:{r:{if(e=i[860])for(n=3864;;){if((a=i[n>>2])>>>0<=e>>>0&e>>>0>2]>>>0)break r;if(!(n=i[n+8>>2]))break}if((0|(a=T2(0)))==-1||(o=f,(n=(e=i[973])-1|0)&a&&(o=(f-a|0)+(n+a&0-e)|0),o>>>0<=k>>>0)||(e=i[964])&&e>>>0<(b=(n=i[962])+o|0)>>>0|n>>>0>=b>>>0)break k;if((0|a)!=(0|(n=T2(o))))break A;break b}if((0|(a=T2(o=b&o-s)))==(i[n>>2]+i[n+4>>2]|0))break c;n=a}if((0|n)==-1)break k;if(k+48>>>0<=o>>>0){a=n;break b}if((0|T2(a=(a=i[974])+(t-o|0)&0-a))==-1)break k;o=a+o|0,a=n;break b}if((0|a)!=-1)break b}i[965]=4|i[965]}if((0|(a=T2(f)))==-1|(0|(n=T2(0)))==-1|n>>>0<=a>>>0||(o=n-a|0)>>>0<=k+40>>>0)break n}n=i[962]+o|0,i[962]=n,n>>>0>i0[963]&&(i[963]=n);b:{if(t=i[860]){for(n=3864;;){if(((e=i[n>>2])+(f=i[n+4>>2])|0)==(0|a))break b;if(!(n=i[n+8>>2]))break}break t}for((n=i[858])>>>0<=a>>>0&&n||(i[858]=a),n=0,i[967]=o,i[966]=a,i[862]=-1,i[863]=i[972],i[969]=0;f=3456+(e=n<<3)|0,i[e+3464>>2]=f,i[e+3468>>2]=f,(0|(n=n+1|0))!=32;);f=(e=o-40|0)-(n=-8-a&7)|0,i[857]=f,n=n+a|0,i[860]=n,i[n+4>>2]=1|f,i[4+(a+e|0)>>2]=40,i[861]=i[976];break e}if(8&i[n+12>>2]|a>>>0<=t>>>0|e>>>0>t>>>0)break t;i[n+4>>2]=f+o,a=(n=-8-t&7)+t|0,i[860]=a,n=(f=i[857]+o|0)-n|0,i[857]=n,i[a+4>>2]=1|n,i[4+(f+t|0)>>2]=40,i[861]=i[976];break e}e=0;break f}a=0;break a}i0[858]>a>>>0&&(i[858]=a),f=a+o|0,n=3864;t:{u:{o:{for(;;){if((0|f)!=i[n>>2]){if(n=i[n+8>>2])continue;break o}break}if(!(8&w[n+12|0]))break u}for(n=3864;!((f=i[n>>2])>>>0<=t>>>0&&(b=f+i[n+4>>2]|0)>>>0>t>>>0);)n=i[n+8>>2];for(f=(e=o-40|0)-(n=-8-a&7)|0,i[857]=f,n=n+a|0,i[860]=n,i[n+4>>2]=1|f,i[4+(a+e|0)>>2]=40,i[861]=i[976],i[(e=(n=(b+(39-b&7)|0)-47|0)>>>0>>0?t:n)+4>>2]=27,n=i[969],i[e+16>>2]=i[968],i[e+20>>2]=n,n=i[967],i[e+8>>2]=i[966],i[e+12>>2]=n,i[968]=e+8,i[967]=o,i[966]=a,i[969]=0,n=e+24|0;i[n+4>>2]=7,f=n+8|0,n=n+4|0,f>>>0>>0;);if((0|e)==(0|t))break e;if(i[e+4>>2]=-2&i[e+4>>2],b=e-t|0,i[t+4>>2]=1|b,i[e>>2]=b,b>>>0<=255){f=3456+(-8&b)|0,(a=i[854])&(n=1<<(b>>>3))?n=i[f+8>>2]:(i[854]=n|a,n=f),i[f+8>>2]=t,i[n+12>>2]=t,i[t+12>>2]=f,i[t+8>>2]=n;break e}if(n=31,b>>>0<=16777215&&(n=62+((b>>>38-(n=s2(b>>>8|0))&1)-(n<<1)|0)|0),i[t+28>>2]=n,i[t+16>>2]=0,i[t+20>>2]=0,f=3720+(n<<2)|0,(e=i[855])&(a=1<>>1|0)|0:0),e=i[f>>2];;){if((0|b)==(-8&i[(f=e)+4>>2]))break t;if(a=n>>>29|0,n<<=1,!(e=i[16+(a=(4&a)+f|0)>>2]))break}i[a+16>>2]=t}else i[855]=a|e,i[f>>2]=t;i[t+24>>2]=f,i[t+12>>2]=t,i[t+8>>2]=t;break e}i[n>>2]=a,i[n+4>>2]=i[n+4>>2]+o,i[4+(r=(-8-a&7)+a|0)>>2]=3|k,o=(t=f+(-8-f&7)|0)-(s=k+r|0)|0;u:if(i[860]!=(0|t))if(i[859]!=(0|t)){if((3&(a=i[t+4>>2]))==1){b=-8&a;o:if(a>>>0<=255){if((0|(f=i[t+12>>2]))==(0|(n=i[t+8>>2]))){v=3416,h=i[854]&i2(a>>>3|0),i[v>>2]=h;break o}i[n+12>>2]=f,i[f+8>>2]=n}else{k=i[t+24>>2];b:if((0|t)==(0|(n=i[t+12>>2]))){k:{if(!(a=i[(f=t+20|0)>>2])){if(!(a=i[t+16>>2]))break k;f=t+16|0}for(;e=f,(a=i[(f=(n=a)+20|0)>>2])||(f=n+16|0,a=i[n+16>>2]););i[e>>2]=0;break b}n=0}else f=i[t+8>>2],i[f+12>>2]=n,i[n+8>>2]=f;if(k){a=i[t+28>>2];b:{if(i[(f=3720+(a<<2)|0)>>2]==(0|t)){if(i[f>>2]=n,n)break b;v=3420,h=i[855]&i2(a),i[v>>2]=h;break o}if(i[k+(i[k+16>>2]==(0|t)?16:20)>>2]=n,!n)break o}i[n+24>>2]=k,(f=i[t+16>>2])&&(i[n+16>>2]=f,i[f+24>>2]=n),(f=i[t+20>>2])&&(i[n+20>>2]=f,i[f+24>>2]=n)}}o=b+o|0,a=i[4+(t=t+b|0)>>2]}if(i[t+4>>2]=-2&a,i[s+4>>2]=1|o,i[o+s>>2]=o,o>>>0<=255)f=3456+(-8&o)|0,(a=i[854])&(n=1<<(o>>>3))?n=i[f+8>>2]:(i[854]=n|a,n=f),i[f+8>>2]=s,i[n+12>>2]=s,i[s+12>>2]=f,i[s+8>>2]=n;else{a=31,o>>>0<=16777215&&(a=62+((o>>>38-(n=s2(o>>>8|0))&1)-(n<<1)|0)|0),i[s+28>>2]=a,i[s+16>>2]=0,i[s+20>>2]=0,f=3720+(a<<2)|0;o:{if((e=i[855])&(n=1<>>1|0)|0:0),n=i[f>>2];;){if(f=n,(-8&i[n+4>>2])==(0|o))break o;if(e=a>>>29|0,a<<=1,!(n=i[16+(e=(4&e)+n|0)>>2]))break}i[e+16>>2]=s}else i[855]=n|e,i[f>>2]=s;i[s+24>>2]=f,i[s+12>>2]=s,i[s+8>>2]=s;break u}n=i[f+8>>2],i[n+12>>2]=s,i[f+8>>2]=s,i[s+24>>2]=0,i[s+12>>2]=f,i[s+8>>2]=n}}else i[859]=s,n=i[856]+o|0,i[856]=n,i[s+4>>2]=1|n,i[n+s>>2]=n;else i[860]=s,n=i[857]+o|0,i[857]=n,i[s+4>>2]=1|n;n=r+8|0;break i}n=i[f+8>>2],i[n+12>>2]=t,i[f+8>>2]=t,i[t+24>>2]=0,i[t+12>>2]=f,i[t+8>>2]=n}if(!((n=i[857])>>>0<=k>>>0)){f=n-k|0,i[857]=f,n=(a=i[860])+k|0,i[860]=n,i[n+4>>2]=1|f,i[a+4>>2]=3|k,n=a+8|0;break i}}i[806]=48,n=0;break i}a:if(o){f=i[e+28>>2];n:{if(i[(n=3720+(f<<2)|0)>>2]==(0|e)){if(i[n>>2]=a,a)break n;r=i2(f)&r,i[855]=r;break a}if(i[o+(i[o+16>>2]==(0|e)?16:20)>>2]=a,!a)break a}i[a+24>>2]=o,(n=i[e+16>>2])&&(i[a+16>>2]=n,i[n+24>>2]=a),(n=i[e+20>>2])&&(i[a+20>>2]=n,i[n+24>>2]=a)}a:if(t>>>0<=15)n=t+k|0,i[e+4>>2]=3|n,i[4+(n=n+e|0)>>2]=1|i[n+4>>2];else if(i[e+4>>2]=3|k,i[4+(b=e+k|0)>>2]=1|t,i[t+b>>2]=t,t>>>0<=255)f=3456+(-8&t)|0,(a=i[854])&(n=1<<(t>>>3))?n=i[f+8>>2]:(i[854]=n|a,n=f),i[f+8>>2]=b,i[n+12>>2]=b,i[b+12>>2]=f,i[b+8>>2]=n;else{n=31,t>>>0<=16777215&&(n=62+((t>>>38-(n=s2(t>>>8|0))&1)-(n<<1)|0)|0),i[b+28>>2]=n,i[b+16>>2]=0,i[b+20>>2]=0,f=3720+(n<<2)|0;n:{if((a=1<>>1|0)|0:0),k=i[f>>2];;){if((-8&i[(f=k)+4>>2])==(0|t))break n;if(a=n>>>29|0,n<<=1,!(k=i[16+(a=(4&a)+f|0)>>2]))break}i[a+16>>2]=b}else i[855]=a|r,i[f>>2]=b;i[b+24>>2]=f,i[b+12>>2]=b,i[b+8>>2]=b;break a}n=i[f+8>>2],i[n+12>>2]=b,i[f+8>>2]=b,i[b+24>>2]=0,i[b+12>>2]=f,i[b+8>>2]=n}n=e+8|0;break i}f:if(s){f=i[a+28>>2];a:{if(i[(n=3720+(f<<2)|0)>>2]==(0|a)){if(i[n>>2]=e,e)break a;v=3420,h=i2(f)&r,i[v>>2]=h;break f}if(i[s+(i[s+16>>2]==(0|a)?16:20)>>2]=e,!e)break f}i[e+24>>2]=s,(n=i[a+16>>2])&&(i[e+16>>2]=n,i[n+24>>2]=e),(n=i[a+20>>2])&&(i[e+20>>2]=n,i[n+24>>2]=e)}t>>>0<=15?(n=t+k|0,i[a+4>>2]=3|n,i[4+(n=n+a|0)>>2]=1|i[n+4>>2]):(i[a+4>>2]=3|k,i[4+(e=a+k|0)>>2]=1|t,i[e+t>>2]=t,A&&(f=3456+(-8&A)|0,b=i[859],(n=1<<(A>>>3))&o?n=i[f+8>>2]:(i[854]=n|o,n=f),i[f+8>>2]=b,i[n+12>>2]=b,i[b+12>>2]=f,i[b+8>>2]=n),i[859]=e,i[856]=t),n=a+8|0}return _=l+16|0,0|n}function J0(n,f){var a=u(0),e=0,t=u(0),b=u(0),o=0,k=u(0),s=0,r=u(0),A=u(0),l=0,v=0,h=u(0),y=0,m=0,g=0,I=0,S=0,M=0,P=0,T=0,O=u(0),G=0,Y=0,f2=0;_=s=_-144|0,Y=i[i[i[f+4>>2]+8>>2]>>2],T=i[Y>>2],I=i[T+16>>2],S=i[i[T+4>>2]+16>>2],P=i[f>>2],g=i[i[P+4>>2]+16>>2],y=i[P+16>>2],J(g,i[n+72>>2],y)>u(0)&&(a=c[g+28>>2],b=c[g+32>>2],e=i[n+72>>2],t=c[e+28>>2],k=c[e+32>>2],A=c[y+28>>2],q[s+40>>3]=c[y+32>>2],q[s+32>>3]=A,q[s+24>>3]=k,q[s+16>>3]=t,q[s+8>>3]=b,q[s>>3]=a,A1(1098,s));i:{f:{a:if((0|y)!=(0|I)&&(k=(a=c[y+32>>2])<=(b=c[g+32>>2])?a:b,b=c[I+32>>2],!(k>((t=c[S+32>>2])<=b?b:t)))){n:{if(!(!((t=c[y+28>>2])<(k=c[I+28>>2]))&(!(a<=b)|t!=k))){if(!(J(S,y,I)>u(0)))break n;break a}if(J(g,I,y)>2])<(b=c[y+28>>2])|a==b&c[l+32>>2]<=c[y+32>>2]?(o=M,M=l):o=l,(a=c[e+28>>2])>(b=c[v+28>>2])|a==b&c[v+32>>2]<=c[e+32>>2]?(a=b,l=e,e=v):l=v,(b=c[M+28>>2])>2]<=c[e+32>>2]?(b=a,v=l,m=e,l=o,e=M):(v=o,m=M);n:if((t=c[l+28>>2])>b|t==b&c[m+32>>2]<=c[l+32>>2])if(!((A=c[v+28>>2])>t)&(!(c[l+32>>2]<=c[v+32>>2])|t!=A))if(a=J(e,m,l),t=J(e,v,l),b=c[m+28>>2],(k=(a=(o=u(a-t)>2],a=u(u(b+r)*u(.5)),t==u(0))break n;a=u(u(u(r-b)*u(k/u(k+t)))+b)}else a=c[v+28>>2],a=u(u(u(b-a)*u(t/u(k+t)))+a);else{if(a=u(0),k=u(t-b),h=u(b-c[e+28>>2]),(O=u(k+h))>u(0)&&(a=c[((o=k>h)?e:l)+32>>2],a=u(u(u(a-c[(o?l:e)+32>>2])*u((o?h:k)/O))+u(c[m+32>>2]-a))),A=u(A-t),(h=u(k+A))>u(0)&&(r=c[((o=k>2],r=u(u(u(r-c[(o?v:m)+32>>2])*u((o?k:A)/h))+u(c[l+32>>2]-r))),(A=(a=(o=u(a+r)>2]=a,(a=c[e+32>>2])<(b=c[l+32>>2])|a==b&c[e+28>>2]<=c[l+28>>2]?(o=l,l=e):o=e,(a=c[v+32>>2])>(b=c[m+32>>2])|a==b&c[m+28>>2]<=c[v+28>>2]?(a=b,e=v,v=m):e=m,(b=c[l+32>>2])>2]<=c[v+28>>2]?(b=a,M=e,m=v,e=o,v=l):(M=o,m=l);n:{e:if((t=c[e+32>>2])>b|t==b&c[m+28>>2]<=c[e+28>>2]){if(!(!((r=c[M+32>>2])>t)&(!(c[e+28>>2]<=c[M+28>>2])|t!=r))){if(a=u(0),k=u(0),A=u(t-b),h=u(b-c[v+32>>2]),(O=u(A+h))>u(0)&&(k=c[((o=A>h)?v:e)+28>>2],k=u(u(u(k-c[(o?e:v)+28>>2])*u((o?h:A)/O))+u(c[m+28>>2]-k))),r=u(r-t),(h=u(A+r))>u(0)&&(a=c[((o=r>A)?m:M)+28>>2],a=u(u(u(a-c[(o?M:m)+28>>2])*u((o?A:r)/h))+u(c[e+28>>2]-a))),(k=(k=(e=u(k+a)>2]=u(A*u(k/u(k+a)))+b;break n}c[s+88>>2]=u(u(b-t)*u(a/u(k+a)))+t;break n}if(a=u(0),k=u(0),A=u(t-b),h=c[v+32>>2],O=u(b-h),u(A+O)>u(0)&&(k=c[m+28>>2],k=u(u(u(k-c[e+28>>2])*O)+u(A*u(k-c[v+28>>2])))),t=u(t-r),A=u(r-h),u(t+A)>u(0)&&(a=c[M+28>>2],a=u(u(u(a-c[e+28>>2])*A)+u(t*u(a-c[v+28>>2])))),(t=(t=(e=u(k-a)>2]=u(b+r)*u(.5);break n}c[s+88>>2]=u(u(r-b)*u(t/u(t+a)))+b;break n}c[s+88>>2]=u(u(b-r)*u(a/u(t+a)))+r;break n}c[s+88>>2]=u(b+t)*u(.5)}b=c[s+84>>2],o=i[n+72>>2];n:{if(b<(a=c[o+28>>2]))t=c[o+32>>2];else if(a!=b||!((t=c[o+32>>2])>=c[s+88>>2]))break n;c[s+88>>2]=t,c[s+84>>2]=a,b=a}(a=r=c[(e=y)+28>>2])<(t=c[I+28>>2])||a==t&&c[e+32>>2]<=c[I+32>>2]||(a=t,e=I);n:{if(a>2];else if(a!=b||!((k=c[e+32>>2])<=c[s+88>>2]))break n;c[s+88>>2]=k,c[s+84>>2]=a,b=a}if(!(b==r&c[s+88>>2]==c[y+32>>2])&(t!=b|c[s+88>>2]!=c[I+32>>2])){n:{e:{if(!((b=c[o+28>>2])==c[g+28>>2]&c[g+32>>2]==c[o+32>>2])){if(J(g,o,s+56|0)>=u(0))break e;o=i[n+72>>2],b=c[o+28>>2]}if(b==c[S+28>>2]&c[S+32>>2]==c[o+32>>2]||!(J(S,o,s+56|0)<=u(0)))break n}if((0|(e=i[n+72>>2]))==(0|S)){if(!o2(i[P+4>>2])||!Z(i[T+4>>2],P))break i;for(e=i[i[f>>2]+16>>2];f=i[i[i[f+4>>2]+4>>2]>>2],l=i[f>>2],(0|e)==i[l+16>>2];);if(w[f+15|0]&&(o=0,(e=A2(i[i[i[i[i[f+4>>2]+8>>2]>>2]>>2]+4>>2],i[l+12>>2]))&&$(i[f>>2])&&(i[f>>2]=e,d[f+15|0]=0,i[e+24>>2]=f,o=i[i[i[f+4>>2]+4>>2]>>2]),f=o),!f)break i;o=i[i[i[f+4>>2]+8>>2]>>2],e=i[o>>2],L2(n,o,Y),f2=1,S2(n,f,i[i[e+4>>2]+12>>2],e,e,1);break a}if((0|e)==(0|g)){if(!o2(i[T+4>>2])||!Z(i[P+12>>2],i[i[T+4>>2]+12>>2]))break i;for(o=i[i[i[f>>2]+4>>2]+16>>2],e=f;e=i[i[i[e+4>>2]+4>>2]>>2],(0|o)==i[i[i[e>>2]+4>>2]+16>>2];);o=i[i[i[i[i[i[e+4>>2]+8>>2]>>2]>>2]+4>>2]+8>>2],i[f>>2]=i[i[T+4>>2]+12>>2],f2=1,S2(n,e,i[L2(n,f,0)+8>>2],i[i[P+4>>2]+8>>2],o,1);break a}if(J(g,e,s+56|0)>=u(0)){if(d[f+14|0]=1,d[i[i[i[f+4>>2]+4>>2]>>2]+14|0]=1,!o2(i[P+4>>2]))break i;o=i[P+16>>2],e=i[n+72>>2],c[o+28>>2]=c[e+28>>2],c[o+32>>2]=c[e+32>>2]}else e=i[n+72>>2];if(!(J(S,e,s+56|0)<=u(0)))break a;if(d[Y+14|0]=1,d[f+14|0]=1,!o2(i[T+4>>2]))break i;f=i[T+16>>2],n=i[n+72>>2],c[f+28>>2]=c[n+28>>2],c[f+32>>2]=c[n+32>>2];break a}if(!o2(i[P+4>>2])||!o2(i[T+4>>2])||!Z(i[i[T+4>>2]+12>>2],P))break i;if(e=i[P+16>>2],c[e+28>>2]=c[s+84>>2],c[e+32>>2]=c[s+88>>2],o=X0(i[n+68>>2],e),e=i[P+16>>2],i[e+36>>2]=o,(0|o)==2147483647)break f;i[s+112>>2]=i[y+12>>2],i[s+116>>2]=i[g+12>>2],i[s+120>>2]=i[I+12>>2],i[s+124>>2]=i[S+12>>2],i[e+24>>2]=0,i[e+16>>2]=0,i[e+20>>2]=0,a=c[e+28>>2],r=(b=u(c[g+28>>2]-a))>2],t=u(c[g+32>>2]-b),k=u(r+(t>2]-a))>2]-b),r=u(r+(t>2]=t,k=u(.5*+r/G),c[s+100>>2]=k,r=u(u(u(t*c[y+16>>2])+u(c[g+16>>2]*k))+u(0)),c[e+16>>2]=r,A=u(u(u(t*c[y+20>>2])+u(c[g+20>>2]*k))+u(0)),c[e+20>>2]=A,k=u(u(u(t*c[y+24>>2])+u(c[g+24>>2]*k))+u(0)),c[e+24>>2]=k,h=(t=u(c[I+28>>2]-a))>2]-b),t=u(h+(t>2]-a))>2]-b),a=u(h+(a>2]=a,b=u(.5*+t/G),c[s+108>>2]=b,t=u(r+u(u(a*c[I+16>>2])+u(c[S+16>>2]*b))),c[e+16>>2]=t,r=u(A+u(u(a*c[I+20>>2])+u(c[S+20>>2]*b))),c[e+20>>2]=r,a=u(k+u(u(a*c[I+24>>2])+u(c[S+24>>2]*b))),c[e+24>>2]=a,c[s+140>>2]=a,c[s+136>>2]=r,c[s+132>>2]=t,i[e+12>>2]=0,e=e+12|0,(0|(o=i[n+1736>>2]))==10?R[i[n+76>>2]](s+132|0,s+112|0,s+96|0,e):R[0|o](s+132|0,s+112|0,s+96|0,e,i[n+1896>>2]),i[e>>2]|w[n+60|0]||((0|(e=i[n+1732>>2]))==11?R[i[n+12>>2]](100156):R[0|e](100156,i[n+1896>>2]),d[n+60|0]=1),d[Y+14|0]=1,d[f+14|0]=1,d[i[i[i[f+4>>2]+4>>2]>>2]+14|0]=1}else c0(n,f)}return _=s+144|0,f2}y0(i[n+68>>2]),i[n+68>>2]=0}k2(n+1740|0,1),b2()}function n4(n,f,a,e,t,b){n|=0,f|=0,a|=0,e|=0,t|=0,b|=0;for(var o=0,k=0,s=0,r=0,A=0,l=u(0),v=0,h=u(0),y=u(0),m=0,g=0,I=0,S=0,M=0,P=0;(o=i[1776+(k=r<<2)>>2])&&(i[o>>2]=0),(o=i[1776+(4|k)>>2])&&(i[o>>2]=0),(o=i[1776+(8|k)>>2])&&(i[o>>2]=0),(o=i[1776+(12|k)>>2])&&(i[o>>2]=0),(0|(r=r+4|0))!=100;);if((r=i[544])||(r=j(16),i[544]=r),i[r+8>>2]=b,i[r+4>>2]=0,i[r+12>>2]=e,i[r>>2]=t,(r=i[545])||((t=j(1900))?(i[t+100>>2]=12,i[t+96>>2]=13,i[t+92>>2]=14,i[t+88>>2]=15,n2[t+80>>1]=0,i[t+52>>2]=0,i[t+56>>2]=100130,i[t+16>>2]=0,i[t+20>>2]=0,i[t>>2]=0,i[t+1896>>2]=0,i[t+1736>>2]=10,i[t+1732>>2]=11,i[t+1728>>2]=6,i[t+1724>>2]=5,i[t+1720>>2]=4,i[t+1716>>2]=3,i[t+104>>2]=16,i[t+76>>2]=17,i[t+12>>2]=18,i[t+24>>2]=0):t=0,i[545]=t,B2(t,100107,31),B2(i[545],100100,32),B2(i[545],100102,33),B2(i[545],100105,34),B2(i[545],100103,35),B2(i[545],100104,36),i[i[545]+56>>2]=100130,t=i[545],c[t+16>>2]=0,c[t+24>>2]=1,c[t+20>>2]=0,r=i[545]),t=0,b=i[544],i[r>>2]&&p2(r,0),i[r+112>>2]=0,i[r>>2]=1,d[r+108|0]=0,i[r+1896>>2]=b,i[r+8>>2]=0,(0|a)>0)for(b=0;;){if(I=i[(b<<2)+f>>2],o=i[545],i[o>>2]!=1&&p2(o,1),i[o>>2]=2,i[o+4>>2]=0,i[o+112>>2]>0&&(d[o+108|0]=1),r=0,(0|I)>0)for(;;){A=i[545],i[A>>2]!=2&&p2(A,2),v=(L(t+r|0,e)<<2)+n|0;i:{f:{if(w[A+108|0]){if(!r0(A)){if((0|(k=i[A+1732>>2]))!=11)break f;R[i[A+12>>2]](100902);break i}i[A+4>>2]=0}if(P=(m=+(h=(S=(m=+(l=c[v+4>>2]))<-1e37)?u(-9999999933815813e21):l))>1e37,s=(g=+(y=(M=(g=+(l=c[v>>2]))<-1e37)?u(-9999999933815813e21):l))>1e37,((o=+(l=c[v+8>>2])<-1e37)|(k=+(l=o?u(-9999999933815813e21):l)>1e37)|S|m>1e37||g>1e37||M)&&((0|(o=i[A+1732>>2]))==11?R[i[A+12>>2]](100155):R[0|o](100155,i[A+1896>>2])),h=P?u(9999999933815813e21):h,y=s?u(9999999933815813e21):y,!i[A+8>>2]){if((0|(o=i[A+112>>2]))<=99){c[124+(s=A+(o<<4)|0)>>2]=k?u(9999999933815813e21):l,c[s+120>>2]=h,c[s+116>>2]=y,i[s+128>>2]=v,i[A+112>>2]=o+1;break i}if(!r0(A)){if((0|(k=i[A+1732>>2]))!=11)break f;R[i[A+12>>2]](100902);break i}}a:{n:{if(!(o=i[A+4>>2])){if(!(k=s0(i[A+8>>2])))break a;if(Z(k,i[k+4>>2]))break n;break a}if(!o2(o))break a;k=i[o+12>>2]}o=i[k+16>>2],c[o+16>>2]=y,i[o+12>>2]=v,i[o+24>>2]=0,c[o+20>>2]=h,i[k+28>>2]=1,i[i[k+4>>2]+28>>2]=-1,i[A+4>>2]=k;break i}if((0|(k=i[A+1732>>2]))==11){R[i[A+12>>2]](100902);break i}}R[0|k](100902,i[A+1896>>2])}if((0|I)==(0|(r=r+1|0)))break}if(o=i[545],i[o>>2]!=2&&p2(o,2),i[o>>2]=1,t=t+I|0,(0|(b=b+1|0))==(0|a))break}s=i[545],n=j(40),i[n>>2]=0,k=k1(t=s+1740|0,1,n,4),o=W,n=0;i:{f:{for(;;){if(n){if((0|(f=i[s+1732>>2]))!=11){if(n=i[s+1896>>2],i[978]=0,I2(0|f,100902,0|n),n=i[978],i[978]=0,f=-1,n&&(e=i[979])){if(!(f=X(i[n>>2],k,o)))break f;W=e}if(n=W,(0|f)==1)continue;break i}if(n=i[s+12>>2],i[978]=0,Z0(0|n,100902),n=i[978],i[978]=0,f=-1,n&&(e=i[979])){if(!(f=X(i[n>>2],k,o)))break f;W=e}if(n=W,(0|f)==1)continue;break i}if(i[s>>2]!=1){if(i[978]=0,I2(19,0|s,1),n=i[978],i[978]=0,f=-1,n&&(e=i[979])){if(!(f=X(i[n>>2],k,o)))break f;W=e}if(n=W,(0|f)==1)continue}if(i[s>>2]=0,!i[s+8>>2]){if(!(w[s+80|0]|i[s+104>>2]!=16)){if(i[978]=0,a=0|f0(20,0|s),n=i[978],i[978]=0,f=-1,n&&(e=i[979])){if(!(f=X(i[n>>2],k,o)))break f;W=e}if(n=W,(0|f)==1)continue;if(a){i[s+1896>>2]=0;break i}}if(i[978]=0,a=0|f0(21,0|s),n=i[978],i[978]=0,f=-1,n&&(e=i[979])){if(!(f=X(i[n>>2],k,o)))break f;W=e}if(n=W,(0|f)==1)continue;if(!a){if(i[978]=0,I2(22,0|t,1),n=i[978],i[978]=0,n&&(e=i[979])){if(!X(i[n>>2],k,o))break f;W=e}n=W;continue}}if(i[978]=0,V0(s),n=i[978],i[978]=0,f=-1,n&&(e=i[979])){if(!(f=X(i[n>>2],k,o)))break f;W=e}if(n=W,(0|f)!=1){if(i[978]=0,a=0|f0(24,0|s),n=i[978],i[978]=0,f=-1,n&&(e=i[979])){if(!(f=X(i[n>>2],k,o)))break f;W=e}if(n=W,(0|f)!=1)if(a){b=i[s+8>>2];a:{n:{if(!w[s+60|0]){if(w[s+81|0]?(i[978]=0,a=0|a4(25,0|b,1,1)):(i[978]=0,a=0|f0(26,0|b)),n=i[978],i[978]=0,f=-1,n&&(e=i[979])){if(!(f=X(i[n>>2],k,o)))break f;W=e}if(n=W,(0|f)==1)continue;if(!a){if(i[978]=0,I2(22,0|t,1),n=i[978],i[978]=0,n&&(e=i[979])){if(!X(i[n>>2],k,o))break f;W=e}n=W;continue}if(i[s+88>>2]!=15|i[s+100>>2]!=12|i[s+96>>2]!=13|i[s+92>>2]!=14||i[s+1716>>2]!=3|i[s+1728>>2]!=6|i[s+1724>>2]!=5||i[s+1720>>2]!=4)if(w[s+81|0]){if(i[978]=0,I2(27,0|s,0|b),n=i[978],i[978]=0,f=-1,n&&(e=i[979])){if(!(f=X(i[n>>2],k,o)))break f;W=e}if(n=W,(0|f)==1)continue}else{if(i[978]=0,I2(28,0|s,0|b),n=i[978],i[978]=0,f=-1,n&&(e=i[979])){if(!(f=X(i[n>>2],k,o)))break f;W=e}if(n=W,(0|f)==1)continue}if(i[s+104>>2]!=16){if(i[978]=0,$0(b),n=i[978],i[978]=0,f=-1,n&&(e=i[979])){if(!(f=X(i[n>>2],k,o)))break f;W=e}if(n=W,(0|f)==1)continue;if(n=i[s+104>>2],i[978]=0,Z0(0|n,0|b),n=i[978],i[978]=0,f=-1,!n||!(e=i[979]))break a;if(f=X(i[n>>2],k,o))break n;break f}}if(i[978]=0,d0(b),n=i[978],i[978]=0,f=-1,n&&(e=i[979])){if(!(f=X(i[n>>2],k,o)))break f;W=e}if(n=W,(0|f)==1)continue;i[s+8>>2]=0,i[s+1896>>2]=0;break i}W=e}if(n=W,(0|f)!=1)break}else{if(i[978]=0,I2(22,0|t,1),n=i[978],i[978]=0,n&&(e=i[979])){if(!X(i[n>>2],k,o))break f;W=e}n=W}}}i[s+1896>>2]=0,i[s+8>>2]=0;break i}Q(k),k2(n,e),b2()}return Q(k),i[i[544]+4>>2]}function e4(n,f,a,e,t,b){n|=0,f=+f,a|=0,e|=0,t|=0,b|=0;var o=0,k=0,s=0,r=0,A=0,l=0,v=0,h=0,y=0,m=0,g=0,I=0,S=0,M=0,P=0,T=0,O=0,G=0,Y=0,f2=0,E2=0;_=h=_-560|0,i[h+44>>2]=0,u0(+f),o=0|c2(1),c2(0),(0|o)<0?(M=1,O=1034,u0(+(f=-f)),o=0|c2(1),c2(0)):2048&t?(M=1,O=1037):(O=(M=1&t)?1040:1035,Y=!M);i:if((2146435072&o)!=2146435072){P=h+16|0;f:{a:{n:{if(f=u1(f,h+44|0),(f+=f)!=0){if(o=i[h+44>>2],i[h+44>>2]=o-1,(0|(T=32|b))!=97)break n;break f}if((0|(T=32|b))==97)break f;A=i[h+44>>2],l=(0|e)<0?6:e;break a}A=o-29|0,i[h+44>>2]=A,f*=268435456,l=(0|e)<0?6:e}for(k=m=(h+48|0)+((0|A)>=0?288:0)|0;e=f<4294967296&f>=0?~~f>>>0:0,i[k>>2]=e,k=k+4|0,(f=1e9*(f-+(e>>>0)))!=0;);if((0|A)<=0)e=A,o=k,s=m;else for(s=m,e=A;;){if(r=(0|e)>=29?29:e,!(s>>>0>(o=k-4|0)>>>0)){for(y=0;e=i[o>>2],v=31&r,G=y,(63&r)>>>0>=32?(y=e<>>32-v,e<<=v),y=y+g|0,f2=o,E2=(v=G+e|0)-h0(y=i1(v,e>>>0>v>>>0?y+1|0:y,1e9),r2,1e9,0)|0,i[f2>>2]=E2,s>>>0<=(o=o-4|0)>>>0;);y&&(i[(s=s-4|0)>>2]=y)}for(;s>>>0<(o=k)>>>0&&!i[(k=o-4|0)>>2];);if(e=i[h+44>>2]-r|0,i[h+44>>2]=e,k=o,!((0|e)>0))break}if((0|e)<0)for(S=1+((l+25>>>0)/9|0)|0,g=(0|T)==102;;){if(v=(0|(e=0-e|0))>=9?9:e,o>>>0<=s>>>0)k=i[s>>2];else{for(y=1e9>>>v|0,r=-1<>2],i[k>>2]=G+(e>>>v|0),e=L(y,e&r),(k=k+4|0)>>>0>>0;);k=i[s>>2],e&&(i[o>>2]=e,o=o+4|0)}if(e=v+i[h+44>>2]|0,i[h+44>>2]=e,s=(!k<<2)+s|0,o=o-(k=g?m:s)>>2>(0|S)?k+(S<<2)|0:o,!((0|e)<0))break}if(e=0,!(o>>>0<=s>>>0||(e=L(m-s>>2,9),k=10,(r=i[s>>2])>>>0<10)))for(;e=e+1|0,r>>>0>=(k=L(k,10))>>>0;);if((0|(k=(l-((0|T)!=102?e:0)|0)-((0|T)==103&(0|l)!=0)|0))<(L(o-m>>2,9)-9|0)){if(A=(S=((h+48|0)+((0|A)<0?4:292)|0)+((r=(0|(y=k+9216|0))/9|0)<<2)|0)-4096|0,k=10,(0|(v=y-L(r,9)|0))<=7)for(;k=L(k,10),(0|(v=v+1|0))!=8;);if(!(!(v=(g=i[A>>2])-L(k,y=(g>>>0)/(k>>>0)|0)|0)&(0|(r=S-4092|0))==(0|o))&&(!(1&y)&&(f=9007199254740992,!(1&d[S-4100|0])|(0|k)!=1e9|s>>>0>=A>>>0)||(f=9007199254740994),I=(0|o)==(0|r)?1:1.5,I=(r=k>>>1|0)>>>0>v>>>0?.5:(0|r)==(0|v)?I:1.5,w[0|O]!=45|Y||(I=-I,f=-f),r=g-v|0,i[A>>2]=r,f+I!=f)){if(e=k+r|0,i[A>>2]=e,e>>>0>=1e9)for(;i[A>>2]=0,(A=A-4|0)>>>0>>0&&(i[(s=s-4|0)>>2]=0),e=i[A>>2]+1|0,i[A>>2]=e,e>>>0>999999999;);if(e=L(m-s>>2,9),k=10,!((r=i[s>>2])>>>0<10))for(;e=e+1|0,r>>>0>=(k=L(k,10))>>>0;);}o=o>>>0>(k=A+4|0)>>>0?k:o}for(;r=o,!(y=o>>>0<=s>>>0)&&!i[(o=o-4|0)>>2];);if((0|T)==103){if(l=((o=(0|(k=l||1))>(0|e)&(0|e)>-5)?-1^e:-1)+k|0,b=(o?-1:-2)+b|0,!(A=8&t)){if(o=-9,!y&&(A=i[r-4>>2])&&(v=10,o=0,!((A>>>0)%10|0))){for(;k=o,o=o+1|0,!((A>>>0)%((v=L(v,10))>>>0)|0););o=-1^k}k=L(r-m>>2,9),(-33&b)!=70?(A=0,l=(0|(o=(0|(o=((e+k|0)+o|0)-9|0))>0?o:0))>(0|l)?l:o):(A=0,l=(0|(o=(0|(o=(o+k|0)-9|0))>0?o:0))>(0|l)?l:o)}}else A=8&t;if(v=-1,(0|((y=A|l)?2147483645:2147483646))<(0|l))break i;if(g=1+(((0|y)!=0)+l|0)|0,(0|(k=-33&b))!=70){if((P-(o=Q2(((o=e>>31)^e)-o|0,0,P))|0)<=1)for(;d[0|(o=o-1|0)]=48,(P-o|0)<2;);if(d[0|(S=o-2|0)]=b,d[o-1|0]=(0|e)<0?45:43,(0|(o=P-S|0))>(2147483647^g))break i}else{if((2147483647^g)<(0|e))break i;o=(0|e)>0?e:0}if((0|(e=o+g|0))>(2147483647^M))break i;z(n,32,a,g=e+M|0,t),N(n,O,M),z(n,48,a,g,65536^t);a:{n:{e:{if((0|k)==70){for(e=8|(b=h+16|0),A=9|b,s=k=s>>>0>m>>>0?m:s;;){o=Q2(i[s>>2],0,A);t:if((0|k)==(0|s))(0|o)==(0|A)&&(d[h+24|0]=48,o=e);else{if(h+16>>>0>=o>>>0)break t;for(;d[0|(o=o-1|0)]=48,h+16>>>0>>0;);}if(N(n,o,A-o|0),!(m>>>0>=(s=s+4|0)>>>0))break}if(y&&N(n,1069,1),(0|l)<=0|s>>>0>=r>>>0)break e;for(;;){if((o=Q2(i[s>>2],0,A))>>>0>h+16>>>0)for(;d[0|(o=o-1|0)]=48,h+16>>>0>>0;);if(N(n,o,(0|l)>=9?9:l),o=l-9|0,r>>>0<=(s=s+4|0)>>>0)break n;if(e=(0|l)>9,l=o,!e)break}break n}t:if(!((0|l)<0))for(m=s>>>0>>0?r:s+4|0,e=8|(b=h+16|0),r=9|b,k=s;;){(0|r)==(0|(o=Q2(i[k>>2],0,r)))&&(d[h+24|0]=48,o=e);u:if((0|k)==(0|s))N(n,o,1),o=o+1|0,A|l&&N(n,1069,1);else{if(h+16>>>0>=o>>>0)break u;for(;d[0|(o=o-1|0)]=48,h+16>>>0>>0;);}if(N(n,o,(0|(b=r-o|0))<(0|l)?b:l),l=l-b|0,m>>>0<=(k=k+4|0)>>>0)break t;if(!((0|l)>=0))break}z(n,48,l+18|0,18,0),N(n,S,P-S|0);break a}o=l}z(n,48,o+9|0,9,0)}z(n,32,a,g,8192^t),v=(0|a)<(0|g)?g:a;break i}if(A=(b<<26>>31&9)+O|0,!(e>>>0>11)){for(o=12-e|0,I=16;I*=16,o=o-1|0;);f=w[0|A]!=45?f+I-I:-(I+(-f-I))}for((0|P)==(0|(o=Q2(((o=i[h+44>>2])^(k=o>>31))-k|0,0,P)))&&(d[h+15|0]=48,o=h+15|0),m=2|M,s=32&b,k=i[h+44>>2],d[0|(l=o-2|0)]=b+15,d[o-1|0]=(0|k)<0?45:43,o=8&t,k=h+16|0;b=k,r=$1(f)<2147483648?~~f:-2147483648,d[0|k]=s|w[r+1600|0],!((0|e)>0|o)&(f=16*(f-+(0|r)))==0|((k=b+1|0)-(h+16|0)|0)!=1||(d[b+1|0]=46,k=b+2|0),f!=0;);v=-1,(2147483645-(b=(o=P-l|0)+m|0)|0)<(0|e)||(r=b,s=k-(b=h+16|0)|0,z(n,32,a,k=r+(e=e&&(s-2|0)<(0|e)?e+2|0:s)|0,t),N(n,A,m),z(n,48,a,k,65536^t),N(n,b,s),z(n,48,e-s|0,0,0),N(n,l,o),z(n,32,a,k,8192^t),v=(0|a)<(0|k)?k:a)}else z(n,32,a,o=M+3|0,-65537&t),N(n,O,M),e=32&b,N(n,f!=f?e?1053:1061:e?1057:1065,3),z(n,32,a,o,8192^t),v=(0|a)<(0|o)?o:a;return _=h+560|0,0|v}function N0(n,f,a,e,t,b){var o=0,k=0,s=0,r=0,A=0,l=0,v=0,h=0,y=0,m=0,g=0,I=0,S=0,M=0,P=0,T=0,O=0,G=0,Y=0,f2=0,E2=0;_=s=_-80|0,i[s+76>>2]=f,O=t-192|0,G=e-384|0,f2=s+55|0,I=s+56|0;i:{f:{a:{n:{e:for(;;){o=0;t:for(;;){if(r=f,(2147483647^y)<(0|o))break n;y=o+y|0;u:{o:{b:{if(k=w[0|(o=f)])for(;;){k:{c:if(f=255&k){if((0|f)!=37)break k;for(k=o;;){if(w[k+1|0]!=37){f=k;break c}if(o=o+1|0,l=w[k+2|0],k=f=k+2|0,(0|l)!=37)break}}else f=o;if((0|(o=o-r|0))>(0|(Y=2147483647^y)))break n;if(n&&N(n,r,o),o)continue t;i[s+76>>2]=f,o=f+1|0,m=-1,k=d[f+1|0]-48|0,w[f+2|0]!=36|k>>>0>=10||(m=k,S=1,o=f+3|0),i[s+76>>2]=o,v=0;c:if((f=(k=d[0|o])-32|0)>>>0>31)l=o;else if(l=o,75913&(f=1<>2]=l,v|=f,(f=(k=d[o+1|0])-32|0)>>>0>=32)break c;if(o=l,!(75913&(f=1<>2]}else{if(k=l+1|0,w[l+2|0]!=36|d[l+1|0]-48>>>0>=10){if(S)break b;if(!n){i[s+76>>2]=k,S=0,g=0;break c}f=i[a>>2],i[a>>2]=f+4,S=0,f=i[f>>2]}else f=d[0|k],k=l+3|0,S=1,n?f=i[(f<<3)+G>>2]:(i[(f<<2)+O>>2]=10,f=0);if(i[s+76>>2]=k,g=f,(0|f)>=0)break c;g=0-f|0,v|=8192}if(o=0,A=-1,w[0|k]==46)if(w[k+1|0]!=42)i[s+76>>2]=k+1,A=c1(s+76|0),f=i[s+76>>2],P=1;else{if(f=k+2|0,w[k+3|0]!=36|d[k+2|0]-48>>>0>=10){if(S)break b;n?(k=i[a>>2],i[a>>2]=k+4,A=i[k>>2]):A=0}else f=d[0|f],n?A=i[(f<<3)+G>>2]:(i[(f<<2)+O>>2]=10,A=0),f=k+4|0;i[s+76>>2]=f,P=(0|A)>=0}else f=k,P=0;for(;;){if(T=o,l=28,h=f,(k=d[0|f])-123>>>0<4294967238)break a;if(f=f+1|0,!((o=w[1071+(k+L(o,58)|0)|0])-1>>>0<8))break}i[s+76>>2]=f;c:if((0|o)==27){if((0|m)>=0)break a;if(o=0,!n)continue t}else{if(!o)break a;if((0|m)>=0){if(!n){i[(m<<2)+t>>2]=o;continue e}o=i[4+(k=(m<<3)+e|0)>>2],i[s+64>>2]=i[k>>2],i[s+68>>2]=o;break c}if(!n)break u;a1(s- -64|0,o,a)}if(32&w[0|n])break f;k=-65537&v,v=8192&v?k:v,m=0,M=1024,l=I;c:{A:{r:{w:{y:{p:{v:{s:{l:{d:{m:{g:{E:{h:{C:{switch(o=d[0|h],(o=T&&(15&o)==3?-45&o:o)-88|0){case 11:break c;case 9:case 13:case 14:case 15:break A;case 27:break v;case 12:case 17:break d;case 23:break m;case 0:case 32:break g;case 24:break E;case 22:break h;case 29:break C;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 10:case 16:case 18:case 19:case 20:case 21:case 25:case 26:case 28:case 30:case 31:break o}switch(o-65|0){case 0:case 4:case 5:case 6:break A;case 2:break y;case 1:case 3:break o}if((0|o)==83)break p;break o}r=i[s+64>>2],k=i[s+68>>2],M=1024;break l}o=0;h:switch(255&T){case 0:case 1:case 6:i[i[s+64>>2]>>2]=y;continue t;case 2:r=i[s+64>>2],i[r>>2]=y,i[r+4>>2]=y>>31;continue t;case 3:n2[i[s+64>>2]>>1]=y;continue t;case 4:d[i[s+64>>2]]=y;continue t;case 7:break h;default:continue t}r=i[s+64>>2],i[r>>2]=y,i[r+4>>2]=y>>31;continue t}A=A>>>0<=8?8:A,v|=8,o=120}if(f=I,(r=i[s+64>>2])|(k=i[s+68>>2]))for(E2=32&o;d[0|(f=f-1|0)]=E2|w[1600+(15&r)|0],T=!k&r>>>0>15|(0|k)!=0,h=k,k=k>>>4|0,r=(15&h)<<28|r>>>4,T;);if(r=f,!(i[s+64>>2]|i[s+68>>2])|!(8&v))break s;M=1024+(o>>>4|0)|0,m=2;break s}if(f=I,k=o=i[s+68>>2],o|(r=i[s+64>>2]))for(;d[0|(f=f-1|0)]=7&r|48,h=!k&r>>>0>7|(0|k)!=0,k=(o=k)>>>3|0,r=(7&o)<<29|r>>>3,h;);if(r=f,!(8&v))break s;A=(0|(f=I-f|0))<(0|A)?A:f+1|0;break s}r=i[s+64>>2],k=f=i[s+68>>2],(0|f)<0?(k=o=0-(f+((0|r)!=0)|0)|0,r=0-r|0,i[s+64>>2]=r,i[s+68>>2]=o,m=1,M=1024):2048&v?(m=1,M=1025):M=(m=1&v)?1026:1024}r=Q2(r,k,I)}if((0|A)<0&P)break n;if(v=P?-65537&v:v,!(A|((f=i[s+64>>2])|(o=i[s+68>>2]))!=0)){r=I,A=0;break o}A=(0|(f=!(f|o)+(I-r|0)|0))<(0|A)?A:f;break o}h=l=A>>>0>=2147483647?2147483647:A,v=(0|l)!=0;v:{s:{l:{d:if(!(!(3&(f=r=(f=i[s+64>>2])||1071))|!l))for(;;){if(!w[0|f])break l;if(v=(0|(h=h-1|0))!=0,!(3&(f=f+1|0)))break d;if(!h)break}if(!v)break s;if(!(!w[0|f]|h>>>0<4))for(;;){if((-1^(o=i[f>>2]))&o-16843009&-2139062144)break l;if(f=f+4|0,!((h=h-4|0)>>>0>3))break}if(!h)break s}for(;;){if(!w[0|f])break v;if(f=f+1|0,!(h=h-1|0))break}}f=0}if(l=(f=f?f-r|0:l)+r|0,(0|A)>=0){v=k,A=f;break o}if(v=k,A=f,w[0|l])break n;break o}if(A){k=i[s+64>>2];break w}o=0,z(n,32,g,0,v);break r}i[s+12>>2]=0,i[s+8>>2]=i[s+64>>2],k=s+8|0,i[s+64>>2]=k,A=-1}for(o=0;;){if(r=i[k>>2]){if((0|(r=t1(s+4|0,r)))<0)break f;if(!(r>>>0>A-o>>>0)&&(k=k+4|0,A>>>0>(o=o+r|0)>>>0))continue}break}if(l=61,(0|o)<0)break a;if(z(n,32,g,o,v),o)for(l=0,k=i[s+64>>2];;){if(!(r=i[k>>2])||(l=(r=t1(A=s+4|0,r))+l|0)>>>0>o>>>0)break r;if(N(n,A,r),k=k+4|0,!(o>>>0>l>>>0))break}else o=0}z(n,32,g,o,8192^v),o=(0|o)<(0|g)?g:o;continue t}if((0|A)<0&P)break n;if(l=61,(0|(o=0|R[0|b](n,q[s+64>>3],g,A,v,o)))>=0)continue t;break a}d[s+55|0]=i[s+64>>2],A=1,r=f2,v=k;break o}k=w[o+1|0],o=o+1|0}if(n)break i;if(!S)break u;for(o=1;;){if(n=i[(o<<2)+t>>2]){if(a1((o<<3)+e|0,n,a),y=1,(0|(o=o+1|0))!=10)continue;break i}break}if(y=1,o>>>0>=10)break i;for(;;){if(i[(o<<2)+t>>2])break b;if((0|(o=o+1|0))==10)break}break i}l=28;break a}if((0|(f=(0|(k=l-r|0))<(0|A)?A:k))>(2147483647^m))break n;if(l=61,(0|Y)<(0|(o=(0|(A=f+m|0))<(0|g)?g:A)))break a;z(n,32,o,A,v),N(n,M,m),z(n,48,o,A,65536^v),z(n,48,f,k,0),N(n,r,k),z(n,32,o,A,8192^v),f=i[s+76>>2];continue}break}break}y=0;break i}l=61}i[806]=l}y=-1}return _=s+80|0,y}function t4(n){n|=0;var f=0,a=0,e=0,t=0,b=0,o=0,k=0,s=0,r=u(0),A=0,l=u(0),v=0,h=0,y=0,m=0,g=0,I=0,S=0,M=0,P=0;_=o=_-48|0,d[n+60|0]=0;i:{if(f=i[n+8>>2],(0|(a=i[f+64>>2]))!=(0|(s=f- -64|0)))for(;;){f=i[a+12>>2],e=i[a>>2],b=i[a+16>>2],t=i[i[a+4>>2]+16>>2];f:{if(!(c[b+28>>2]!=c[t+28>>2]|c[b+32>>2]!=c[t+32>>2]|i[f+12>>2]==(0|a))){if(l0(n,f,a),$(a)){t=i[f+12>>2];break f}break i}t=f,f=a}if(i[t+12>>2]==(0|f)){if((0|f)!=(0|t)&&(e=(0|e)!=(0|t)&i[e+4>>2]!=(0|t)?e:i[e>>2],!$(t))||(a=(0|f)==(0|e)|i[e+4>>2]==(0|f)?i[e>>2]:e,!$(f)))break i}else a=e;if((0|a)==(0|s))break}(a=j(28))?((f=j(28))?(i[f+8>>2]=0,i[f+12>>2]=32,t=j(132),i[f>>2]=t,t?(e=j(264),i[f+4>>2]=e,e?(i[f+24>>2]=8,i[f+16>>2]=0,i[f+20>>2]=0,i[t+4>>2]=1,i[e+8>>2]=0):(Q(t),Q(f),f=0)):(Q(f),f=0)):f=0,i[a>>2]=f,f?(e=j(128),i[a+4>>2]=e,e?(i[a+24>>2]=8,i[a+20>>2]=0,i[a+12>>2]=0,i[a+16>>2]=32):(Q(i[f+4>>2]),Q(i[f>>2]),Q(f),Q(a),a=0)):(Q(a),a=0)):a=0,h=a,i[n+68>>2]=h;f:if(h){a=e=i[n+8>>2];a:{n:{for(;;){if((0|e)!=(0|(a=i[a>>2]))){if(f=X0(h,a),i[a+36>>2]=f,(0|f)!=2147483647)continue;break n}break}if(_=I=_-400|0,e=j(4+(f=(S=i[h+12>>2])<<2)|0),i[h+8>>2]=e,_=I+400|0,e){if((t=(f+e|0)-4|0)>>>0>=e>>>0)for(f=i[h+4>>2],a=e;i[a>>2]=f,f=f+4|0,t>>>0>=(a=a+4|0)>>>0;);for(i[I+4>>2]=t,i[I>>2]=e,v=8|I,M=2016473283,b=I;;){if((s=i[v-4>>2])>>>0>(k=i[b>>2])+40>>>0)for(;;){for(M=L(M,1539415821)+1|0,m=i[(f=((M>>>0)%(1+(s-k>>2)>>>0)<<2)+k|0)>>2],i[f>>2]=i[k>>2],i[k>>2]=m,f=s+4|0,a=k-4|0;;){e=f,t=a,a=a+4|0,A=i[t+4>>2],g=i[A>>2],r=c[g+28>>2],y=i[m>>2];e:if(!(r<(l=c[y+28>>2])))for(;;){if(f=a,!(!(c[g+32>>2]<=c[y+32>>2])|r!=l))break e;if(a=f+4|0,t=f,A=i[f+4>>2],g=i[A>>2],l>(r=c[g+28>>2]))break}v=i[(f=e-4|0)>>2],g=i[v>>2];e:if(!(l<(r=c[g+28>>2])))for(;;){if(!(!(c[y+32>>2]<=c[g+32>>2])|r!=l))break e;if(e=f,v=i[(f=f-4|0)>>2],g=i[v>>2],l<(r=c[g+28>>2]))break}if(i[a>>2]=v,i[f>>2]=A,!(f>>>0>a>>>0))break}if(v=i[a>>2],i[a>>2]=A,i[f>>2]=v,(a-k|0)<(s-f|0)?(f=e,a=s,s=t):(f=k,a=t,k=e),i[b+4>>2]=a,i[b>>2]=f,b=b+8|0,!(k+40>>>0>>0))break}if(v=b,(A=k+4|0)>>>0<=s>>>0)for(;;){y=i[A>>2];e:if(!(k>>>0>=(f=a=A)>>>0))for(;;){if(b=i[y>>2],r=c[b+28>>2],t=i[(f=a-4|0)>>2],e=i[t>>2],r<(l=c[e+28>>2])){f=a;break e}if(!(!(c[b+32>>2]<=c[e+32>>2])|r!=l)){f=a;break e}if(i[a>>2]=t,a=f,!(k>>>0>>0))break}if(i[f>>2]=y,!((A=A+4|0)>>>0<=s>>>0))break}if(!(I>>>0<=(b=v-8|0)>>>0))break}if(i[h+20>>2]=1,i[h+16>>2]=S,S=i[h>>2],(0|(b=i[S+8>>2]))>0)for(y=i[S+4>>2],m=i[S>>2],f=b;;){for(t=f,h=y+((A=i[m+(f<<2)>>2])<<3)|0,a=f;(0|b)<=(0|(f=a<<1))||(k=i[y+(i[m+((e=1|f)<<2)>>2]<<3)>>2],r=c[k+28>>2],s=i[y+(i[m+(f<<2)>>2]<<3)>>2],!(r<(l=c[s+28>>2]))&(!(c[k+32>>2]<=c[s+32>>2])|r!=l)||(f=e)),!((0|f)>(0|b)||(v=i[h>>2],r=c[v+28>>2],k=i[m+(f<<2)>>2],e=i[(s=y+(k<<3)|0)>>2],r<(l=c[e+28>>2])|r==l&c[v+32>>2]<=c[e+32>>2]));)i[m+(a<<2)>>2]=k,i[s+4>>2]=a,a=f;if(i[m+(a<<2)>>2]=A,i[h+4>>2]=a,f=t-1|0,!((0|t)>1))break}i[S+20>>2]=1,a=1}else a=0;if(a)break a}y0(i[n+68>>2]),i[n+68>>2]=0;break f}if((f=j(20))&&(i[f+16>>2]=9,i[f+12>>2]=n,i[f>>2]=0,i[f+8>>2]=f,i[f+4>>2]=f),i[n+64>>2]=f,!f)break i;if(o1(n,u(-3999999973526325e22)),o1(n,u(3999999973526325e22)),f=v0(i[n+68>>2]))for(;;){a:if(a=b1(i[n+68>>2]))for(;;){if(c[a+28>>2]!=c[f+28>>2]|c[a+32>>2]!=c[f+32>>2])break a;if(t=i[v0(i[n+68>>2])+8>>2],e=i[f+8>>2],i[o+24>>2]=0,i[o+28>>2]=0,i[o+16>>2]=0,i[o+20>>2]=0,i[o+8>>2]=0,i[o+12>>2]=0,i[o>>2]=1056964608,i[o+4>>2]=1056964608,a=i[e+16>>2],i[o+16>>2]=i[a+12>>2],i[o+20>>2]=i[i[t+16>>2]+12>>2],c[o+36>>2]=c[a+16>>2],c[o+40>>2]=c[a+20>>2],c[o+44>>2]=c[a+24>>2],i[a+12>>2]=0,b=a+12|0,(0|(a=i[n+1736>>2]))==10?R[i[n+76>>2]](o+36|0,o+16|0,o,b):R[0|a](o+36|0,o+16|0,o,b,i[n+1896>>2]),i[b>>2]||(i[b>>2]=i[o+16>>2]),!Z(e,t))break i;if(!(a=b1(i[n+68>>2])))break}if(a0(n,f),!(f=v0(i[n+68>>2])))break}for(a=i[i[i[n+64>>2]+4>>2]>>2],i[n+72>>2]=i[i[a>>2]+16>>2];i[i[a>>2]+24>>2]=0,m2(i[a+4>>2]),Q(a),f=i[n+64>>2],a=i[i[f+4>>2]>>2];);if((0|f)!=(0|(a=i[f+4>>2])))for(;Q(a),(0|f)!=(0|(a=i[a+4>>2])););if(Q(f),y0(i[n+68>>2]),P=1,f=i[n+8>>2],(0|(n=i[f+40>>2]))!=(0|(a=f+40|0)))for(;;){if(e=i[n+8>>2],n=i[n>>2],(0|e)==i[i[e+12>>2]+12>>2]&&(f=i[e+8>>2],i[f+28>>2]=i[f+28>>2]+i[e+28>>2],f=i[f+4>>2],i[f+28>>2]=i[f+28>>2]+i[i[e+4>>2]+28>>2],!$(e))){P=0;break f}if((0|n)==(0|a))break}}return _=o+48|0,0|P}k2(n+1740|0,1),b2()}function a0(n,f){var a=0,e=0,t=0,b=0,o=u(0),k=0,s=0,r=u(0),A=0,l=0,v=0;_=v=_-16|0,i[n+72>>2]=f,a=t=i[f+8>>2];i:{f:{a:{for(;;){if(e=i[a+24>>2])break a;if((0|t)==(0|(a=i[a+8>>2])))break}for(i[v>>2]=i[t+4>>2],t=a=i[n+64>>2];t=i[t+4>>2],(e=i[t>>2])&&!(0|R[i[a+16>>2]](i[a+12>>2],v,e)););if(e=i[t>>2],t=i[i[i[e+4>>2]+8>>2]>>2],k=i[t>>2],b=i[e>>2],J(i[i[b+4>>2]+16>>2],f,i[b+16>>2])==u(0)){if(o=c[f+28>>2],a=i[e>>2],t=i[a+16>>2],!(o!=c[t+28>>2]|c[t+32>>2]!=c[f+32>>2])){l0(n,a,i[f+8>>2]);break f}if(b=i[a+4>>2],t=i[b+16>>2],!(o==c[t+28>>2]&c[t+32>>2]==c[f+32>>2])){if(!o2(b))break i;if(w[e+15|0]){if(!$(i[a+8>>2]))break i;d[e+15|0]=0}if(!Z(i[f+8>>2],a))break i;a0(n,f);break f}for(;e=i[i[i[e+4>>2]+4>>2]>>2],(0|t)==i[i[i[e>>2]+4>>2]+16>>2];);if(t=i[i[i[e+4>>2]+8>>2]>>2],k=i[t>>2],b=i[k+4>>2],a=i[b+8>>2],w[t+15|0]){if(i[k+24>>2]=0,m2(i[t+4>>2]),Q(t),!$(b))break i;b=i[i[a+4>>2]+12>>2]}if(!Z(i[f+8>>2],b))break i;s=i[b+8>>2],t=i[i[a+4>>2]+16>>2],o=c[t+28>>2],k=i[a+16>>2],S2(n,e,s,a,f=o<(r=c[k+28>>2])|o==r&c[t+32>>2]<=c[k+32>>2]?a:0,1);break f}if(s=w[e+12|0],k=i[k+4>>2],A=i[k+16>>2],o=c[A+28>>2],l=i[i[b+4>>2]+16>>2],a=e,o<(r=c[l+28>>2])||o==r&&(a=e,c[A+32>>2]<=c[l+32>>2])||(a=t),s|w[a+15|0]){n:{if((0|e)==(0|a)){if(t=A2(i[i[f+8>>2]+4>>2],i[b+12>>2]))break n;break i}if(!(t=A2(i[i[k+8>>2]+4>>2],i[f+8>>2])))break i;t=i[t+4>>2]}if(w[a+15|0]){if($(i[a>>2])){i[a>>2]=t,d[a+15|0]=0,i[t+24>>2]=a,a0(n,f);break f}break i}if(!(a=j(16))||(i[a>>2]=t,e=w0(i[n+64>>2],i[e+4>>2],a),i[a+4>>2]=e,!e))break i;d[a+13|0]=0,d[a+14|0]=0,d[a+15|0]=0,i[t+24>>2]=a,b=i[n+56>>2],t=i[i[a>>2]+28>>2]+i[i[i[e+4>>2]>>2]+8>>2]|0,i[a+8>>2]=t;n:{e:switch(b-100130|0){case 0:e=1&t;break n;case 1:e=(0|t)!=0;break n;case 2:e=(0|t)>0;break n;case 3:e=t>>>31|0;break n;case 4:break e;default:break n}e=t-2>>>0<4294967293}d[a+12|0]=e,a0(n,f);break f}S2(a=n,e,n=i[f+8>>2],n,0,1);break f}for(f=i[i[e>>2]+16>>2];e=i[i[i[e+4>>2]+4>>2]>>2],a=i[e>>2],(0|f)==i[a+16>>2];);if(w[e+15|0]&&(!(f=A2(i[i[i[i[i[e+4>>2]+8>>2]>>2]>>2]+4>>2],i[a+12>>2]))||!$(i[e>>2])||(i[e>>2]=f,d[e+15|0]=0,i[f+24>>2]=e,!(e=i[i[i[e+4>>2]+4>>2]>>2]))))break i;if(f=i[i[i[e+4>>2]+8>>2]>>2],a=i[f>>2],f=L2(n,f,0),(0|a)!=(0|(t=i[f+8>>2])))S2(n,e,t,a,a,1);else{if(t=i[e>>2],A=i[i[i[e+4>>2]+8>>2]>>2],k=i[A>>2],i[i[t+4>>2]+16>>2]!=i[i[k+4>>2]+16>>2]&&J0(n,e),l=1,b=i[n+72>>2],o=c[b+28>>2],s=i[t+16>>2],!(o!=c[s+28>>2]|c[s+32>>2]!=c[b+32>>2])){if(!Z(i[i[a+4>>2]+12>>2],t))break i;for(a=i[i[e>>2]+16>>2];e=i[i[i[e+4>>2]+4>>2]>>2],b=i[e>>2],(0|a)==i[b+16>>2];);if(w[e+15|0]&&(!(a=A2(i[i[i[i[i[e+4>>2]+8>>2]>>2]>>2]+4>>2],i[b+12>>2]))||!$(i[e>>2])||(i[e>>2]=a,d[e+15|0]=0,i[a+24>>2]=e,!(e=i[i[i[e+4>>2]+4>>2]>>2]))))break i;b=i[i[i[e+4>>2]+8>>2]>>2],a=i[b>>2],L2(n,b,A),b=i[n+72>>2],o=c[b+28>>2],l=0}a:{if(r=o,s=i[k+16>>2],r!=(o=c[s+28>>2])|c[s+32>>2]!=c[b+32>>2]){if(l)break a}else{if(!Z(f,i[i[k+4>>2]+12>>2]))break i;f=L2(n,A,0)}S2(n,e,i[f+8>>2],a,a,1);break f}if(a=i[t+16>>2],!((r=c[a+28>>2])>o)&(!(c[s+32>>2]<=c[a+32>>2])|o!=r)||(t=i[i[k+4>>2]+12>>2]),!(f=A2(i[i[f+8>>2]+4>>2],t)))break i;S2(n,e,f,a=i[f+8>>2],a,0),d[i[i[f+4>>2]+24>>2]+15|0]=1,K0(n,e)}}return void(_=v+16|0)}k2(n+1740|0,1),b2()}function V0(n){n|=0;var f=0,a=0,e=0,t=u(0),b=u(0),o=0,k=0,s=u(0),r=0,A=u(0),l=u(0),v=0,h=0,y=u(0),m=u(0),g=u(0),I=u(0),S=u(0),M=u(0),P=u(0),T=u(0),O=u(0),G=u(0),Y=u(0),f2=0,E2=0,p0=0,m0=0,g0=0,E0=0,C0=0,R0=0,I0=u(0);h=i[n+8>>2],f=_-80|0,I=c[n+16>>2],c[f+8>>2]=I,S=c[n+20>>2],c[f+12>>2]=S,M=c[n+24>>2],c[f+16>>2]=M,r=i[h>>2];i:if(E2=I==u(0)&S==u(0)&M==u(0)){if(i[f+76>>2]=-42943038,i[f+68>>2]=-42943038,i[f+72>>2]=-42943038,i[f+64>>2]=2104540610,i[f+56>>2]=2104540610,i[f+60>>2]=2104540610,(0|h)!=(0|r)){for(g=u(19999999867631625e21),O=u(-19999999867631625e21),P=u(-19999999867631625e21),T=u(19999999867631625e21),G=u(-19999999867631625e21),Y=u(19999999867631625e21),A=u(-19999999867631625e21),s=u(19999999867631625e21),y=u(-19999999867631625e21),b=u(19999999867631625e21),l=u(-19999999867631625e21),m=u(19999999867631625e21),a=r;A=(e=(t=c[a+24>>2])>A)?t:A,O=e?t:O,s=(v=t>2])>y)?t:y,P=k?t:P,b=(f2=b>t)?t:b,T=f2?t:T,l=(o=(t=c[a+16>>2])>l)?t:l,G=o?t:G,p0=o?a:p0,m=(o=t>2])););i[f+20>>2]=m0,c[f+56>>2]=Y,c[f+68>>2]=G,i[f+32>>2]=p0,c[f+60>>2]=T,i[f+24>>2]=R0,c[f+72>>2]=P,i[f+36>>2]=C0,c[f+64>>2]=g,i[f+28>>2]=E0,c[f+76>>2]=O,i[f+40>>2]=g0,s=u(A-s),A=u(l-m),b=u(y-b)}else A=u(-3999999973526325e22),s=u(-3999999973526325e22),b=u(-3999999973526325e22);if(a=2,e=(k=b>A)<<2,v=k,o=f+56|0,v=u(c[(k=f+68|0)+e>>2]-c[o+e>>2])>2]>=c[e+k>>2])i[f+8>>2]=0,i[f+12>>2]=0;else{if(a=i[(e=v<<2)+(f+20|0)>>2],e=i[e+(f+32|0)>>2],G=c[e+16>>2],g=u(c[a+16>>2]-G),c[f+44>>2]=g,Y=c[e+20>>2],l=u(c[a+20>>2]-Y),c[f+48>>2]=l,I0=c[e+24>>2],m=u(c[a+24>>2]-I0),O=u(-g),(0|h)!=(0|r)){for(T=u(-l),P=u(-m),b=u(0),a=r;s=u(c[a+20>>2]-Y),t=u(c[a+16>>2]-G),A=u(u(g*s)+u(t*T)),y=u(c[a+24>>2]-I0),s=u(u(l*y)+u(s*P)),t=u(u(m*t)+u(y*O)),(y=u(u(A*A)+u(u(s*s)+u(t*t))))>b&&(M=A,S=t,I=s,b=y),(0|h)!=(0|(a=i[a>>2])););if(c[f+16>>2]=M,c[f+12>>2]=S,c[f+8>>2]=I,!(b<=u(0)))break i}else P=u(-m),T=u(-l);i[f+16>>2]=0,i[f+8>>2]=0,i[f+12>>2]=0,a=(l(g>2],a=(m(b>2]=1065353216,M=c[f+16>>2],I=c[f+8>>2],S=c[f+12>>2]}if(k=f+8|0,e=(S(I>2],a=n+28|0,f=(M(b>2]=0,i[(o=((0|(o=f+1|0))!=3?o:0)<<2)+a>>2]=1065353216,i[(f=(f+2>>>0)%3<<2)+a>>2]=0,i[(a=n+40|0)+e>>2]=0,e=c[e+k>>2]>u(0),c[a+o>>2]=u(e?-0:0),c[f+a>>2]=u(e?1:-1),!(e=(0|h)==(0|r)))for(a=r;f=i[a+20>>2],i[a+28>>2]=i[a+16>>2],i[a+32>>2]=f,(0|h)!=(0|(a=i[a>>2])););if(E2&&(0|(f=i[h+40>>2]))!=(0|(k=h+40|0))){for(b=u(0);;){if(o=i[f+8>>2],i[(a=o)+28>>2]>0)for(;v=i[a+16>>2],f2=i[i[a+4>>2]+16>>2],b=u(u(u(c[v+28>>2]-c[f2+28>>2])*u(c[v+32>>2]+c[f2+32>>2]))+b),(0|o)!=(0|(a=i[a+12>>2])););if((0|k)==(0|(f=i[f>>2])))break}if(b>2]=-c[r+32>>2],(0|(r=i[r>>2]))!=(0|h););c[n+40>>2]=-c[n+40>>2],c[n+44>>2]=-c[n+44>>2],c[n+48>>2]=-c[n+48>>2]}}}function o4(n,f){f|=0;var a=0,e=0,t=0,b=0,o=0,k=0,s=0,r=0,A=0,l=0,v=0,h=0,y=0,m=0,g=0,I=0,S=0,M=0,P=0;if(_=k=_-16|0,i[84+(n|=0)>>2]=0,!(a=(0|(r=i[f+40>>2]))==(0|(h=f+40|0)))){for(f=r;d[f+20|0]=0,(0|h)!=(0|(f=i[f>>2])););if(!a){for(;;){if(!(w[r+20|0]|!w[r+21|0])){if(o=i[r+8>>2],w[n+80|0])f=1,a=1;else{b=0,t=0,f=0,e=i[(a=o)+20>>2];i:if(w[e+21|0])for(;;){if(w[(f=e)+20|0]){f=t;break i}if(d[f+20|0]=1,i[f+16>>2]=t,b=b+1|0,t=f,a=i[a+8>>2],e=i[a+20>>2],!w[e+21|0])break}e=i[o+4>>2],t=i[e+20>>2];i:{f:if(!w[t+21|0]|w[t+20|0]){if(y=o,!f)break i}else for(a=f;;){if(d[(f=t)+20|0]=1,i[f+16>>2]=a,b=b+1|0,y=i[e+12>>2],e=i[y+4>>2],t=i[e+20>>2],!w[t+21|0])break f;if(a=f,w[t+20|0])break}for(;d[f+20|0]=0,f=i[f+16>>2];);}m=(0|b)>1,t=0,e=0,f=0,A=i[o+12>>2],a=i[(s=A)+20>>2];i:if(w[a+21|0])for(;;){if(w[(f=a)+20|0]){f=e;break i}if(d[f+20|0]=1,i[f+16>>2]=e,t=t+1|0,e=f,s=i[s+8>>2],a=i[s+20>>2],!w[a+21|0])break}l=m?b:1,e=i[A+4>>2],b=i[e+20>>2];i:{f:if(!w[b+21|0]|w[b+20|0]){if(!f)break i}else for(a=f;;){if(d[(f=b)+20|0]=1,i[f+16>>2]=a,t=t+1|0,A=i[e+12>>2],e=i[A+4>>2],b=i[e+20>>2],!w[b+21|0])break f;if(a=f,w[b+20|0])break}for(;d[f+20|0]=0,f=i[f+16>>2];);}g=(0|t)>(0|l),b=0,e=0,f=0,v=i[i[o+8>>2]+4>>2],a=i[(s=v)+20>>2];i:if(w[a+21|0])for(;;){if(w[(f=a)+20|0]){f=e;break i}if(d[f+20|0]=1,i[f+16>>2]=e,b=b+1|0,e=f,s=i[s+8>>2],a=i[s+20>>2],!w[a+21|0])break}s=g?t:l,e=i[v+4>>2],t=i[e+20>>2];i:{f:if(!w[t+21|0]|w[t+20|0]){if(!f)break i}else for(a=f;;){if(d[(f=t)+20|0]=1,i[f+16>>2]=a,b=b+1|0,v=i[e+12>>2],e=i[v+4>>2],t=i[e+20>>2],!w[t+21|0])break f;if(a=f,w[t+20|0])break}for(;d[f+20|0]=0,f=i[f+16>>2];);}A0(f=k+4|0,o),I=i[k+12>>2],S=i[k+8>>2],a=i[k+4>>2],A0(f,i[o+12>>2]),M=i[k+12>>2],P=i[k+8>>2],l=i[k+4>>2],A0(f,i[i[o+8>>2]+4>>2]),f=b,(0|(f=(t=(0|(f=(e=(0|(f=(b=(0|b)>(0|s))?f:s))<(0|a))?a:f))<(0|l))?l:f))>=(0|(a=i[k+4>>2]))?(o=t?P:e?S:b?v:g?A:m?y:o,a=t?M:e?I:b||g||m?2:1):(o=i[k+8>>2],f=a,a=i[k+12>>2])}R[0|a](n,o,f)}if((0|h)==(0|(r=i[r>>2])))break}if(o=i[n+84>>2]){for((0|(f=i[n+1716>>2]))==3?R[i[n+88>>2]](4):R[0|f](4,i[n+1896>>2]),b=-1;;){for(f=i[o+8>>2];w[n+80|0]&&(0|(a=!(e=w[i[i[f+4>>2]+20>>2]+21|0])))!=(0|b)&&((0|(t=i[n+1720>>2]))==4?R[i[n+92>>2]](!e):R[0|t](!e,i[n+1896>>2]),b=a),(0|(a=i[n+1724>>2]))==5?R[i[n+96>>2]](i[i[f+16>>2]+12>>2]):R[0|a](i[i[f+16>>2]+12>>2],i[n+1896>>2]),(0|(f=i[f+12>>2]))!=i[o+8>>2];);if(!(o=i[o+16>>2]))break}(0|(f=i[n+1728>>2]))==6?R[i[n+100>>2]]():R[0|f](i[n+1896>>2]),i[n+84>>2]=0}}}_=k+16|0}function Q(n){var f=0,a=0,e=0,t=0,b=0,o=0,k=0,s=0,r=0;i:if(n|=0){b=(e=n-8|0)+(n=-8&(f=i[n-4>>2]))|0;f:if(!(1&f)){if(!(2&f)||(e=e-(f=i[e>>2])|0)>>>0>>0<=255){if(t=f>>>3|0,(0|(f=i[e+12>>2]))==(0|(a=i[e+8>>2]))){s=3416,r=i[854]&i2(t),i[s>>2]=r;break f}i[a+12>>2]=f,i[f+8>>2]=a;break f}if(k=i[e+24>>2],(0|e)!=(0|(f=i[e+12>>2]))){a=i[e+8>>2],i[a+12>>2]=f,i[f+8>>2]=a;break a}if(!(a=i[(t=e+20|0)>>2])){if(!(a=i[e+16>>2]))break n;t=e+16|0}for(;o=t,(a=i[(t=(f=a)+20|0)>>2])||(t=f+16|0,a=i[f+16>>2]););i[o>>2]=0;break a}if((3&(f=i[b+4>>2]))!=3)break f;return i[856]=n,i[b+4>>2]=-2&f,i[e+4>>2]=1|n,void(i[b>>2]=n)}f=0}if(k){a=i[e+28>>2];a:{if(i[(t=3720+(a<<2)|0)>>2]==(0|e)){if(i[t>>2]=f,f)break a;s=3420,r=i[855]&i2(a),i[s>>2]=r;break f}if(i[k+(i[k+16>>2]==(0|e)?16:20)>>2]=f,!f)break f}i[f+24>>2]=k,(a=i[e+16>>2])&&(i[f+16>>2]=a,i[a+24>>2]=f),(a=i[e+20>>2])&&(i[f+20>>2]=a,i[a+24>>2]=f)}}if(!(e>>>0>=b>>>0)&&1&(f=i[b+4>>2])){f:{a:{n:{e:{if(!(2&f)){if(i[860]==(0|b)){if(i[860]=e,n=i[857]+n|0,i[857]=n,i[e+4>>2]=1|n,i[859]!=(0|e))break i;return i[856]=0,void(i[859]=0)}if(i[859]==(0|b))return i[859]=e,n=i[856]+n|0,i[856]=n,i[e+4>>2]=1|n,void(i[n+e>>2]=n);if(n=(-8&f)+n|0,f>>>0<=255){if(t=f>>>3|0,(0|(f=i[b+12>>2]))==(0|(a=i[b+8>>2]))){s=3416,r=i[854]&i2(t),i[s>>2]=r;break a}i[a+12>>2]=f,i[f+8>>2]=a;break a}if(k=i[b+24>>2],(0|b)!=(0|(f=i[b+12>>2]))){a=i[b+8>>2],i[a+12>>2]=f,i[f+8>>2]=a;break n}if(!(a=i[(t=b+20|0)>>2])){if(!(a=i[b+16>>2]))break e;t=b+16|0}for(;o=t,(a=i[(t=(f=a)+20|0)>>2])||(t=f+16|0,a=i[f+16>>2]););i[o>>2]=0;break n}i[b+4>>2]=-2&f,i[e+4>>2]=1|n,i[n+e>>2]=n;break f}f=0}if(k){a=i[b+28>>2];n:{if(i[(t=3720+(a<<2)|0)>>2]==(0|b)){if(i[t>>2]=f,f)break n;s=3420,r=i[855]&i2(a),i[s>>2]=r;break a}if(i[k+(i[k+16>>2]==(0|b)?16:20)>>2]=f,!f)break a}i[f+24>>2]=k,(a=i[b+16>>2])&&(i[f+16>>2]=a,i[a+24>>2]=f),(a=i[b+20>>2])&&(i[f+20>>2]=a,i[a+24>>2]=f)}}if(i[e+4>>2]=1|n,i[n+e>>2]=n,i[859]==(0|e))return void(i[856]=n)}if(n>>>0<=255)return f=3456+(-8&n)|0,(a=i[854])&(n=1<<(n>>>3))?n=i[f+8>>2]:(i[854]=n|a,n=f),i[f+8>>2]=e,i[n+12>>2]=e,i[e+12>>2]=f,void(i[e+8>>2]=n);a=31,n>>>0<=16777215&&(a=62+((n>>>38-(f=s2(n>>>8|0))&1)-(f<<1)|0)|0),i[e+28>>2]=a,i[e+16>>2]=0,i[e+20>>2]=0,f=3720+(a<<2)|0;f:{a:{if((t=i[855])&(o=1<>>1|0)|0:0),f=i[f>>2];;){if(t=f,(-8&i[f+4>>2])==(0|n))break a;if(o=a>>>29|0,a<<=1,!(f=i[16+(o=f+(4&o)|0)>>2]))break}i[o+16>>2]=e,i[e+24>>2]=t}else i[855]=t|o,i[f>>2]=e,i[e+24>>2]=f;i[e+12>>2]=e,i[e+8>>2]=e;break f}n=i[t+8>>2],i[n+12>>2]=e,i[t+8>>2]=e,i[e+24>>2]=0,i[e+12>>2]=t,i[e+8>>2]=n}n=i[862]-1|0,i[862]=n||-1}}}function z0(n,f){var a=0,e=0,t=0,b=0,o=0,k=0,s=0,r=0;b=n+f|0;i:{f:if(!(1&(a=i[n+4>>2]))){if(!(2&a))break i;f=(a=i[n>>2])+f|0;a:{n:{e:{if((0|(n=n-a|0))!=i[859]){if(a>>>0<=255){if((0|(e=i[n+8>>2]))!=(0|(t=i[n+12>>2])))break e;s=3416,r=i[854]&i2(a>>>3|0),i[s>>2]=r;break f}if(k=i[n+24>>2],(0|(a=i[n+12>>2]))!=(0|n)){e=i[n+8>>2],i[e+12>>2]=a,i[a+8>>2]=e;break a}if(!(e=i[(t=n+20|0)>>2])){if(!(e=i[n+16>>2]))break n;t=n+16|0}for(;o=t,(e=i[(t=(a=e)+20|0)>>2])||(t=a+16|0,e=i[a+16>>2]););i[o>>2]=0;break a}if((3&(a=i[b+4>>2]))!=3)break f;return i[856]=f,i[b+4>>2]=-2&a,i[n+4>>2]=1|f,void(i[b>>2]=f)}i[e+12>>2]=t,i[t+8>>2]=e;break f}a=0}if(k){e=i[n+28>>2];a:{if(i[(t=3720+(e<<2)|0)>>2]==(0|n)){if(i[t>>2]=a,a)break a;s=3420,r=i[855]&i2(e),i[s>>2]=r;break f}if(i[k+(i[k+16>>2]==(0|n)?16:20)>>2]=a,!a)break f}i[a+24>>2]=k,(e=i[n+16>>2])&&(i[a+16>>2]=e,i[e+24>>2]=a),(e=i[n+20>>2])&&(i[a+20>>2]=e,i[e+24>>2]=a)}}f:{a:{n:{e:{if(!(2&(a=i[b+4>>2]))){if(i[860]==(0|b)){if(i[860]=n,f=i[857]+f|0,i[857]=f,i[n+4>>2]=1|f,i[859]!=(0|n))break i;return i[856]=0,void(i[859]=0)}if(i[859]==(0|b))return i[859]=n,f=i[856]+f|0,i[856]=f,i[n+4>>2]=1|f,void(i[n+f>>2]=f);if(f=(-8&a)+f|0,a>>>0<=255){if(t=a>>>3|0,(0|(a=i[b+12>>2]))==(0|(e=i[b+8>>2]))){s=3416,r=i[854]&i2(t),i[s>>2]=r;break a}i[e+12>>2]=a,i[a+8>>2]=e;break a}if(k=i[b+24>>2],(0|b)!=(0|(a=i[b+12>>2]))){e=i[b+8>>2],i[e+12>>2]=a,i[a+8>>2]=e;break n}if(!(e=i[(t=b+20|0)>>2])){if(!(e=i[b+16>>2]))break e;t=b+16|0}for(;o=t,(e=i[(t=(a=e)+20|0)>>2])||(t=a+16|0,e=i[a+16>>2]););i[o>>2]=0;break n}i[b+4>>2]=-2&a,i[n+4>>2]=1|f,i[n+f>>2]=f;break f}a=0}if(k){e=i[b+28>>2];n:{if(i[(t=3720+(e<<2)|0)>>2]==(0|b)){if(i[t>>2]=a,a)break n;s=3420,r=i[855]&i2(e),i[s>>2]=r;break a}if(i[k+(i[k+16>>2]==(0|b)?16:20)>>2]=a,!a)break a}i[a+24>>2]=k,(e=i[b+16>>2])&&(i[a+16>>2]=e,i[e+24>>2]=a),(e=i[b+20>>2])&&(i[a+20>>2]=e,i[e+24>>2]=a)}}if(i[n+4>>2]=1|f,i[n+f>>2]=f,i[859]==(0|n))return void(i[856]=f)}if(f>>>0<=255)return a=3456+(-8&f)|0,(e=i[854])&(f=1<<(f>>>3))?f=i[a+8>>2]:(i[854]=f|e,f=a),i[a+8>>2]=n,i[f+12>>2]=n,i[n+12>>2]=a,void(i[n+8>>2]=f);e=31,f>>>0<=16777215&&(e=62+((f>>>38-(a=s2(f>>>8|0))&1)-(a<<1)|0)|0),i[n+28>>2]=e,i[n+16>>2]=0,i[n+20>>2]=0,a=3720+(e<<2)|0;f:{if((t=i[855])&(o=1<>>1|0)|0:0),a=i[a>>2];;){if(t=a,(-8&i[a+4>>2])==(0|f))break f;if(o=e>>>29|0,e<<=1,!(a=i[16+(o=a+(4&o)|0)>>2]))break}i[o+16>>2]=n,i[n+24>>2]=t}else i[855]=t|o,i[a>>2]=n,i[n+24>>2]=a;return i[n+12>>2]=n,void(i[n+8>>2]=n)}f=i[t+8>>2],i[f+12>>2]=n,i[t+8>>2]=n,i[n+24>>2]=0,i[n+12>>2]=t,i[n+8>>2]=f}}function b4(n){n|=0;var f=0,a=0,e=u(0),t=u(0),b=u(0),o=u(0),k=u(0),s=0,r=u(0),A=0,l=0,v=u(0),h=u(0),y=0,m=u(0),g=u(0),I=0,S=u(0),M=u(0),P=u(0),T=u(0),O=u(0),G=u(0),Y=0;i:{f:if(!((0|(y=i[n+112>>2]))<3)){if(I=116+((Y=y<<4)+n|0)|0,S=c[n+124>>2],M=c[n+120>>2],o=c[n+24>>2],P=c[n+116>>2],r=c[n+16>>2],k=c[n+20>>2],!(r!=u(0)|k!=u(0))&o==u(0))for(a=n+148|0,o=u(0),k=u(0),r=u(0),e=v=u(c[(f=n+132|0)>>2]-P),t=h=u(c[n+136>>2]-M),m=b=u(c[n+140>>2]-S);T=u(c[f+20>>2]-M),O=u(c[a>>2]-P),G=u(u(e*T)-u(O*t)),g=u(c[f+24>>2]-S),t=u(u(t*g)-u(T*m)),e=u(u(m*O)-u(g*e)),u(u(G*o)+u(u(t*r)+u(k*e)))>=u(0)?(o=u(o+G),k=u(k+e),t=u(r+t)):(o=u(o-G),k=u(k-e),t=u(r-t)),r=t,e=O,t=T,m=g,I>>>0>(a=(f=a)+16|0)>>>0;);else v=u(c[n+132>>2]-P),h=u(c[n+136>>2]-M),b=u(c[n+140>>2]-S);for(a=n+148|0,f=A=n+132|0;;){e=b,b=h,s=f,t=v,h=u(c[f+20>>2]-M),v=u(c[(f=a)>>2]-P),g=u(u(u(t*h)-u(b*v))*o),m=b,b=u(c[s+24>>2]-S);a:if((e=u(g+u(u(u(u(m*b)-u(h*e))*r)+u(k*u(u(e*v)-u(b*t))))))!=u(0)){if(e>u(0)){if(a=0,s=(0|l)<0,l=1,!s)break a;break i}if(a=0,s=(0|l)>0,l=-1,s)break i}if(!(I>>>0>(a=f+16|0)>>>0))break}if(l){a=1;a:{n:switch(i[n+56>>2]-100132|0){case 0:if((0|l)>=0)break a;break f;case 2:break i;case 1:break n;default:break a}if((0|l)>0)break f}(0|(f=i[n+1716>>2]))==3?R[i[n+88>>2]](w[n+81|0]?2:(0|y)<4?4:6):R[0|f](w[n+81|0]?2:(0|y)<4?4:6,i[n+1896>>2]),(0|(f=i[n+1724>>2]))==5?R[i[n+96>>2]](i[n+128>>2]):R[0|f](i[n+128>>2],i[n+1896>>2]);a:if((0|l)<=0){if((0|y)<2)break a;for(f=Y+100|0;a=n+f|0,(0|(s=i[n+1724>>2]))==5?R[i[n+96>>2]](i[a+12>>2]):R[0|s](i[a+12>>2],i[n+1896>>2]),a=(0|f)>132,f=f-16|0,a;);}else if(!(A>>>0>=I>>>0))for(;(0|(f=i[n+1724>>2]))==5?R[i[n+96>>2]](i[A+12>>2]):R[0|f](i[A+12>>2],i[n+1896>>2]),I>>>0>(A=A+16|0)>>>0;);(0|(f=i[n+1728>>2]))==6?R[i[n+100>>2]]():R[0|f](i[n+1896>>2])}}a=1}return 0|a}function c0(n,f){var a=0,e=0,t=0,b=0,o=u(0),k=0,s=u(0),r=0,A=0,l=0,v=0,h=0,y=0,m=0,g=0,I=0,S=0,M=0,P=0;i:{l=i[f>>2],t=i[l+16>>2],s=c[t+28>>2],a=i[i[i[f+4>>2]+8>>2]>>2],v=i[a>>2],b=i[v+16>>2];f:{if(!(!(s<(o=c[b+28>>2]))&(!(c[t+32>>2]<=c[b+32>>2])|s!=o))){if(J(i[i[v+4>>2]+16>>2],t,b)>u(0))break f;if(t=i[l+16>>2],b=i[v+16>>2],!(c[t+28>>2]==c[b+28>>2]&c[t+32>>2]==c[b+32>>2])){if(!o2(i[v+4>>2])||!Z(l,i[i[v+4>>2]+12>>2]))break i;return d[a+14|0]=1,d[f+14|0]=1,1}if(e=1,(0|t)==(0|b))break f;if(k=i[n+68>>2],(0|(b=i[t+36>>2]))>=0){if(h=i[k>>2],r=i[h>>2],A=i[h+4>>2],f=i[4+(I=A+(b<<3)|0)>>2],m=i[h+8>>2],g=i[r+(m<<2)>>2],i[r+(f<<2)>>2]=g,M=e=(g<<3)+A|0,i[e+4>>2]=f,S=m-1|0,i[h+8>>2]=S,(0|f)<(0|m)){a:{if((0|f)<2||(a=i[(i[r+(f<<1&-4)>>2]<<3)+A>>2],o=c[a+28>>2],y=i[e>>2],o<(s=c[y+28>>2])||!(!(c[a+32>>2]<=c[y+32>>2])|s!=o)))for(P=(g<<3)+A|0;;){if((0|S)<=(0|(a=f<<1))||(k=i[(i[r+((e=1|a)<<2)>>2]<<3)+A>>2],s=c[k+28>>2],t=i[(i[r+(a<<2)>>2]<<3)+A>>2],!(s<(o=c[t+28>>2]))&(!(c[k+32>>2]<=c[t+32>>2])|s!=o)||(a=e)),(0|a)>=(0|m)){a=f;break a}if(y=i[P>>2],s=c[y+28>>2],k=i[r+(a<<2)>>2],e=i[(t=(k<<3)+A|0)>>2],s<(o=c[e+28>>2])){a=f;break a}if(!(!(c[y+32>>2]<=c[e+32>>2])|s!=o)){a=f;break a}i[r+(f<<2)>>2]=k,i[t+4>>2]=f,f=a}for(;;){if(k=i[r+((a=f>>>1|0)<<2)>>2],e=i[(t=(k<<3)+A|0)>>2],(o=c[e+28>>2])>2]<=c[y+32>>2])|s!=o)){a=f;break a}if(i[r+(f<<2)>>2]=k,i[t+4>>2]=f,e=f>>>0>3,f=a,!e)break}}i[r+(a<<2)>>2]=g,i[M+4>>2]=a}i[I>>2]=0,i[I+4>>2]=i[h+16>>2],i[h+16>>2]=b}else{i[i[k+4>>2]+((-1^b)<<2)>>2]=0;a:if(!((0|(f=i[k+12>>2]))<=0))for(b=i[k+8>>2]-4|0;;){if(i[i[b+(f<<2)>>2]>>2])break a;if(a=f-1|0,i[k+12>>2]=a,e=(0|f)>1,f=a,!e)break}}return l0(n,i[i[v+4>>2]+12>>2],l),1}if(!(J(i[i[l+4>>2]+16>>2],b,t)>2]+4>>2]>>2]+14|0]=1,!o2(i[l+4>>2])||!Z(i[i[v+4>>2]+12>>2],l)))break i}return e}k2(n+1740|0,1),b2()}function n0(n,f){var a=0,e=0,t=0,b=0,o=0,k=0,s=0,r=0,A=0,l=0,v=0,h=0,y=0;if(!n)return j(f);if(f>>>0>=4294967232)return i[806]=48,0;b=f>>>0<11?16:f+11&-8,e=-8&(s=i[4+(t=n-8|0)>>2]);i:if(3&s){o=e+t|0;f:if(e>>>0>=b>>>0){if((a=e-b|0)>>>0<16)break f;i[t+4>>2]=1&s|b|2,i[4+(e=t+b|0)>>2]=3|a,i[o+4>>2]=1|i[o+4>>2],z0(e,a)}else if(i[860]!=(0|o))if(i[859]!=(0|o)){if(2&(k=i[o+4>>2])||(r=e+(-8&k)|0)>>>0>>0)break i;l=r-b|0;a:if(k>>>0<=255){if((0|(a=i[o+12>>2]))==(0|(e=i[o+8>>2]))){h=3416,y=i[854]&i2(k>>>3|0),i[h>>2]=y;break a}i[e+12>>2]=a,i[a+8>>2]=e}else{A=i[o+24>>2];n:if((0|o)==(0|(e=i[o+12>>2]))){e:{if(!(k=i[(a=o+20|0)>>2])){if(!(k=i[o+16>>2]))break e;a=o+16|0}for(;v=a,(k=i[(a=(e=k)+20|0)>>2])||(a=e+16|0,k=i[e+16>>2]););i[v>>2]=0;break n}e=0}else a=i[o+8>>2],i[a+12>>2]=e,i[e+8>>2]=a;if(A){a=i[o+28>>2];n:{if(i[(k=3720+(a<<2)|0)>>2]==(0|o)){if(i[k>>2]=e,e)break n;h=3420,y=i[855]&i2(a),i[h>>2]=y;break a}if(i[(i[A+16>>2]==(0|o)?16:20)+A>>2]=e,!e)break a}i[e+24>>2]=A,(a=i[o+16>>2])&&(i[e+16>>2]=a,i[a+24>>2]=e),(a=i[o+20>>2])&&(i[e+20>>2]=a,i[a+24>>2]=e)}}l>>>0<=15?(i[t+4>>2]=1&s|r|2,i[4+(a=t+r|0)>>2]=1|i[a+4>>2]):(i[t+4>>2]=1&s|b|2,i[4+(a=t+b|0)>>2]=3|l,i[4+(e=t+r|0)>>2]=1|i[e+4>>2],z0(a,l))}else{if((e=e+i[856]|0)>>>0>>0)break i;(a=e-b|0)>>>0>=16?(i[t+4>>2]=1&s|b|2,i[4+(k=t+b|0)>>2]=1|a,i[(e=e+t|0)>>2]=a,i[e+4>>2]=-2&i[e+4>>2]):(i[t+4>>2]=e|1&s|2,i[4+(a=e+t|0)>>2]=1|i[a+4>>2],a=0),i[859]=k,i[856]=a}else{if((e=e+i[857]|0)>>>0<=b>>>0)break i;i[t+4>>2]=1&s|b|2,e=e-b|0,i[4+(a=t+b|0)>>2]=1|e,i[857]=e,i[860]=a}a=t}else{if(b>>>0<256||e>>>0>=b+4>>>0&&(a=t,e-b>>>0<=i[974]<<1>>>0))break i;a=0}return a?a+8|0:(a=j(f))?(q0(a,n,f>>>0>(t=(3&(t=i[n-4>>2])?-4:-8)+(-8&t)|0)>>>0?t:f),Q(n),a):0}function K0(n,f){var a=0,e=0,t=0,b=0,o=0,k=0,s=u(0),r=0,A=u(0);for(e=i[i[i[f+4>>2]+8>>2]>>2];;){i:{if(w[e+14|0])for(;e=i[i[i[(f=e)+4>>2]+8>>2]>>2],w[e+14|0];);f:{a:{n:{e:{if(w[f+14|0])a=f;else if(!(a=i[i[i[f+4>>2]+4>>2]>>2])||(e=f,!w[a+14|0]))break e;d[a+14|0]=0,t=i[a>>2],f=i[i[t+4>>2]+16>>2],o=i[e>>2];t:if((0|f)!=i[i[o+4>>2]+16>>2]){s=c[f+28>>2],r=i[i[i[a+4>>2]+8>>2]>>2],b=i[r>>2],k=i[i[b+4>>2]+16>>2];u:{if(!(!(s<(A=c[k+28>>2]))&(!(c[f+32>>2]<=c[k+32>>2])|s!=A))){if(J(f,k,i[t+16>>2])>2]+4>>2]>>2]+14|0]=1,!(f=o2(t)))break f;if(Z(i[b+4>>2],f))break u;break i}if(J(k,f,i[b+16>>2])>u(0)){f=a;break t}if(d[r+14|0]=1,d[a+14|0]=1,!(f=o2(b))||!Z(i[t+12>>2],i[b+4>>2]))break i;f=i[f+4>>2]}if(d[i[f+20>>2]+21|0]=w[a+12|0],w[e+15|0]){if(i[i[e>>2]+24>>2]=0,m2(i[e+4>>2]),Q(e),!$(o))break i;e=i[i[i[a+4>>2]+8>>2]>>2],o=i[e>>2],f=a}else if(w[a+15|0]){if(i[i[a>>2]+24>>2]=0,m2(i[a+4>>2]),Q(a),!$(t))break i;f=i[i[i[e+4>>2]+4>>2]>>2],t=i[f>>2]}else f=a}else f=a;if(i[t+16>>2]==i[o+16>>2])break a;if(a=i[i[t+4>>2]+16>>2],b=i[i[o+4>>2]+16>>2],w[e+15|0]|w[f+15|0]|(0|a)==(0|b)||(0|(k=a))!=(0|(a=i[n+72>>2]))&(0|a)!=(0|b))break n;if(!J0(n,f))break a}return}c0(n,f)}if(i[t+16>>2]!=i[o+16>>2]||(b=i[t+4>>2],a=i[o+4>>2],i[b+16>>2]!=i[a+16>>2]))continue;if(i[o+28>>2]=i[o+28>>2]+i[t+28>>2],i[a+28>>2]=i[a+28>>2]+i[b+28>>2],i[i[f>>2]+24>>2]=0,m2(i[f+4>>2]),Q(f),!$(t))break i;f=i[i[i[e+4>>2]+4>>2]>>2];continue}}break}k2(n+1740|0,1),b2()}function k4(n){n|=0;var f=0,a=0,e=0,t=u(0),b=u(0),o=0,k=0,s=0,r=0;if((0|(f=i[n+40>>2]))!=(0|(s=n+40|0)))for(;;){if(n=i[f>>2],w[f+21|0]){for(f=f+8|0;f=i[f>>2],e=i[i[f+4>>2]+16>>2],t=c[e+28>>2],a=i[f+16>>2],!(!(t<(b=c[a+28>>2]))&(!(c[e+32>>2]<=c[a+32>>2])|t!=b));)f=i[f+8>>2]+4|0;for(;!(!(t>b)&(!(c[a+32>>2]<=c[e+32>>2])|t!=b));)f=i[f+12>>2],a=i[f+16>>2],b=c[a+28>>2],e=i[i[f+4>>2]+16>>2],t=c[e+28>>2];i:{if((0|(e=i[i[f+8>>2]+4>>2]))!=i[f+12>>2])for(;;){if(a=i[i[f+4>>2]+16>>2],t=c[a+28>>2],o=i[e+16>>2],!(t<(b=c[o+28>>2]))&(!(c[a+32>>2]<=c[o+32>>2])|t!=b)){f:if(i[e+12>>2]!=(0|f))for(;;){if(a=i[i[f+8>>2]+4>>2],o=i[a+16>>2],t=c[o+28>>2],k=i[i[a+4>>2]+16>>2],!(t<(b=c[k+28>>2])|t==b&c[o+32>>2]<=c[k+32>>2])){if(!(J(i[i[f+4>>2]+16>>2],i[f+16>>2],o)>=u(0)))break f;a=i[i[f+8>>2]+4>>2]}if(f=A2(f,a),a=0,!f)break i;if((0|(f=i[f+4>>2]))==i[e+12>>2])break}f=i[f+12>>2]}else{f:if((0|(a=i[e+12>>2]))!=(0|f))for(o=e+12|0;;){if(k=i[i[a+4>>2]+16>>2],t=c[k+28>>2],r=i[a+16>>2],!(t<(b=c[r+28>>2])|t==b&c[k+32>>2]<=c[r+32>>2])){if(!(J(i[e+16>>2],i[i[e+4>>2]+16>>2],k)<=u(0)))break f;a=i[o>>2]}if(e=A2(a,e),a=0,!e)break i;if(o=(e=i[e+4>>2])+12|0,(0|(a=i[e+12>>2]))==(0|f))break}e=i[i[e+8>>2]+4>>2]}if(i[f+12>>2]==(0|e))break}if(a=i[e+12>>2],i[a+12>>2]!=(0|f))for(;;){if(e=A2(a,e),a=0,!e)break i;if(e=i[e+4>>2],a=i[e+12>>2],i[a+12>>2]==(0|f))break}a=1}if(!a)return 0}if((0|s)==(0|(f=n)))break}return 1}function S2(n,f,a,e,t,b){var o=0,k=0,s=0,r=0,A=0;i:{for(;;){if(k=i[a+4>>2],!(o=j(16))||(i[o>>2]=k,s=w0(i[n+64>>2],i[f+4>>2],o),i[o+4>>2]=s,!s))break i;if(d[o+13|0]=0,d[o+14|0]=0,d[o+15|0]=0,i[k+24>>2]=o,(0|e)==(0|(a=i[a+8>>2])))break}if(a=i[i[i[f+4>>2]+8>>2]>>2],k=i[i[a>>2]+4>>2],t=t||i[k+8>>2],i[k+16>>2]==i[t+16>>2]){if(i[k+8>>2]!=(0|t)&&(!Z(i[i[k+4>>2]+12>>2],k)||!Z(i[i[t+4>>2]+12>>2],k)))break i;e=(t=i[f+8>>2])-(s=i[k+28>>2])|0,i[a+8>>2]=e;f:{a:switch(i[n+56>>2]-100130|0){case 4:o=e-2>>>0<4294967293;break f;case 3:o=e>>>31|0;break f;case 2:o=(0|e)>0;break f;case 1:o=(0|t)!=(0|s);break f;case 0:break a;default:break f}o=1&e}if(d[a+12|0]=o,d[f+14|0]=1,s=i[i[i[a+4>>2]+8>>2]>>2],e=i[i[s>>2]+4>>2],i[e+16>>2]==i[k+16>>2])for(t=a+4|0;;){if(f=s,i[(o=e)+8>>2]!=(0|k)&&(!Z(i[i[o+4>>2]+12>>2],o)||!Z(i[i[k+4>>2]+12>>2],o)))break i;e=(r=i[a+8>>2])-(A=i[o+28>>2])|0,i[f+8>>2]=e;f:{a:switch(i[n+56>>2]-100130|0){case 0:s=1&e;break f;case 1:s=(0|r)!=(0|A);break f;case 2:s=(0|e)>0;break f;case 3:s=e>>>31|0;break f;case 4:break a;default:break f}s=e-2>>>0<4294967293}if(d[f+12|0]=s,d[a+14|0]=1,c0(n,a)&&(i[o+28>>2]=i[o+28>>2]+i[k+28>>2],e=i[o+4>>2],i[e+28>>2]=i[e+28>>2]+i[i[k+4>>2]+28>>2],i[i[a>>2]+24>>2]=0,m2(i[t>>2]),Q(a),!$(k)))break i;if(t=f+4|0,s=i[i[i[(a=f)+4>>2]+8>>2]>>2],e=i[i[s>>2]+4>>2],k=o,i[e+16>>2]!=i[o+16>>2])break}else f=a}return d[f+14|0]=1,void(b&&K0(n,f))}k2(n+1740|0,1),b2()}function $(n){var f=0,a=0,e=0,t=0,b=0,o=0;if(t=i[n+4>>2],(0|(o=i[t+20>>2]))!=(0|(a=i[n+20>>2]))){for(f=e=i[a+8>>2];i[f+20>>2]=o,(0|e)!=(0|(f=i[f+12>>2])););f=i[a>>2],e=i[a+4>>2],i[f+4>>2]=e,i[e>>2]=f,Q(a)}if((0|(e=i[n+8>>2]))!=(0|n)){if(b=i[n+4>>2],f=i[b+12>>2],i[i[b+20>>2]+8>>2]=f,i[i[n+16>>2]+8>>2]=e,b=i[f+8>>2],i[i[e+4>>2]+12>>2]=f,i[i[b+4>>2]+12>>2]=n,i[n+8>>2]=b,i[f+8>>2]=e,(0|a)==(0|o)){if(!(a=j(24)))return 0;for(f=i[n+20>>2],e=i[f+4>>2],i[a+4>>2]=e,i[e>>2]=a,i[a>>2]=f,i[f+4>>2]=a,i[a+12>>2]=0,i[a+16>>2]=0,i[a+8>>2]=n,d[a+20|0]=0,d[a+21|0]=w[f+21|0],f=n;i[f+20>>2]=a,(0|(f=i[f+12>>2]))!=(0|n););}}else{for(a=i[n+16>>2],f=e=i[a+8>>2];i[f+16>>2]=0,(0|e)!=(0|(f=i[f+8>>2])););f=i[a>>2],e=i[a+4>>2],i[f+4>>2]=e,i[e>>2]=f,Q(a)}if((0|(f=i[t+8>>2]))!=(0|t))a=i[i[t+4>>2]+12>>2],i[i[n+20>>2]+8>>2]=a,i[i[t+16>>2]+8>>2]=f,e=i[a+8>>2],i[i[f+4>>2]+12>>2]=a,i[i[e+4>>2]+12>>2]=t,i[t+8>>2]=e,i[a+8>>2]=f;else{for(a=i[t+16>>2],f=e=i[a+8>>2];i[f+16>>2]=0,(0|e)!=(0|(f=i[f+8>>2])););for(f=i[a>>2],e=i[a+4>>2],i[f+4>>2]=e,i[e>>2]=f,Q(a),a=i[t+20>>2],f=t=i[a+8>>2];i[f+20>>2]=0,(0|t)!=(0|(f=i[f+12>>2])););f=i[a>>2],t=i[a+4>>2],i[f+4>>2]=t,i[t>>2]=f,Q(a)}return f=i[n+4>>2],f=i[(n=n>>>0>f>>>0?f:n)>>2],a=i[i[n+4>>2]>>2],i[i[f+4>>2]>>2]=a,i[i[a+4>>2]>>2]=f,Q(n),1}function A2(n,f){var a=0,e=0,t=0,b=0,o=0,k=0,s=0,r=0,A=0,l=0;i:if(a=j(64)){if(k=i[n+4>>2],b=i[(e=n>>>0>k>>>0?k:n)+4>>2],t=i[b>>2],i[a+32>>2]=t,i[i[t+4>>2]>>2]=a,i[a>>2]=e,e=b,b=a+32|0,i[e>>2]=b,i[a+16>>2]=0,i[a+20>>2]=0,i[a+12>>2]=b,i[a+4>>2]=b,i[a+24>>2]=0,i[a+28>>2]=0,i[a+48>>2]=0,i[a+52>>2]=0,i[a+44>>2]=a,i[a+40>>2]=b,i[a+36>>2]=a,i[a+56>>2]=0,i[a+60>>2]=0,i[a+8>>2]=a,t=b,s=a,(0|(e=o=i[f+20>>2]))!=(0|(r=i[n+20>>2]))){for(e=t=i[e+8>>2];i[e+20>>2]=r,(0|t)!=(0|(e=i[e+12>>2])););e=i[o>>2],t=i[o+4>>2],i[e+4>>2]=t,i[t>>2]=e,Q(o),k=i[n+4>>2],s=i[a+8>>2],t=i[s+4>>2],e=i[n+20>>2]}if(n=i[n+12>>2],A=i[n+8>>2],i[t+12>>2]=n,i[i[A+4>>2]+12>>2]=a,i[a+8>>2]=A,i[n+8>>2]=s,n=i[f+8>>2],t=i[a+40>>2],i[i[t+4>>2]+12>>2]=f,i[i[n+4>>2]+12>>2]=b,i[a+40>>2]=n,i[f+8>>2]=t,i[a+16>>2]=i[k+16>>2],n=i[f+16>>2],i[a+52>>2]=e,i[a+48>>2]=n,i[a+20>>2]=e,i[e+8>>2]=b,(0|o)==(0|r)){if(!(n=j(24)))break i;for(f=i[e+4>>2],i[n+4>>2]=f,i[f>>2]=n,i[n>>2]=e,i[e+4>>2]=n,i[n+12>>2]=0,i[n+16>>2]=0,i[n+8>>2]=a,d[n+20|0]=0,d[n+21|0]=w[e+21|0],e=a;i[e+20>>2]=n,(0|(e=i[e+12>>2]))!=(0|a););}l=a}return l}function q0(n,f,a){var e=0,t=0;if(a>>>0>=512)f4(0|n,0|f,0|a);else{e=n+a|0;i:if(3&(n^f))if(e>>>0<4)a=n;else if((t=e-4|0)>>>0>>0)a=n;else for(a=n;d[0|a]=w[0|f],d[a+1|0]=w[f+1|0],d[a+2|0]=w[f+2|0],d[a+3|0]=w[f+3|0],f=f+4|0,t>>>0>=(a=a+4|0)>>>0;);else{f:if(3&n)if(a)for(a=n;;){if(d[0|a]=w[0|f],f=f+1|0,!(3&(a=a+1|0)))break f;if(!(a>>>0>>0))break}else a=n;else a=n;if(!((n=-4&e)>>>0<64||(t=n+-64|0)>>>0>>0))for(;i[a>>2]=i[f>>2],i[a+4>>2]=i[f+4>>2],i[a+8>>2]=i[f+8>>2],i[a+12>>2]=i[f+12>>2],i[a+16>>2]=i[f+16>>2],i[a+20>>2]=i[f+20>>2],i[a+24>>2]=i[f+24>>2],i[a+28>>2]=i[f+28>>2],i[a+32>>2]=i[f+32>>2],i[a+36>>2]=i[f+36>>2],i[a+40>>2]=i[f+40>>2],i[a+44>>2]=i[f+44>>2],i[a+48>>2]=i[f+48>>2],i[a+52>>2]=i[f+52>>2],i[a+56>>2]=i[f+56>>2],i[a+60>>2]=i[f+60>>2],f=f- -64|0,t>>>0>=(a=a- -64|0)>>>0;);if(n>>>0<=a>>>0)break i;for(;i[a>>2]=i[f>>2],f=f+4|0,n>>>0>(a=a+4|0)>>>0;);}if(a>>>0>>0)for(;d[0|a]=w[0|f],f=f+1|0,(0|e)!=(0|(a=a+1|0)););}}function o2(n){var f=0,a=0,e=0,t=0,b=0,o=0;if(b=n,n=0,(f=j(64))&&(e=i[b+4>>2],t=i[(a=e>>>0>>0?e:b)+4>>2],o=i[t>>2],i[f+32>>2]=o,i[i[o+4>>2]>>2]=f,i[f>>2]=a,a=f+32|0,i[t>>2]=a,i[f+16>>2]=0,i[f+20>>2]=0,i[f+12>>2]=a,i[f+4>>2]=a,i[f+24>>2]=0,i[f+28>>2]=0,i[f+48>>2]=0,i[f+52>>2]=0,i[f+40>>2]=a,i[f+36>>2]=f,i[f+56>>2]=0,i[f+60>>2]=0,i[f+8>>2]=f,t=i[b+12>>2],o=i[t+8>>2],i[f+44>>2]=t,i[i[o+4>>2]+12>>2]=f,i[f+8>>2]=o,i[t+8>>2]=f,t=i[e+16>>2],i[f+16>>2]=t,e=j(40))){for(n=i[t+4>>2],i[e+4>>2]=n,i[n>>2]=e,i[e>>2]=t,i[t+4>>2]=e,i[e+12>>2]=0,i[e+8>>2]=a,n=a;i[n+16>>2]=e,(0|a)!=(0|(n=i[n+8>>2])););n=i[b+20>>2],i[f+20>>2]=n,i[f+52>>2]=n,n=f}return n?(f=i[n+4>>2],n=i[b+4>>2],a=i[i[n+4>>2]+12>>2],e=i[a+8>>2],t=i[n+8>>2],i[i[t+4>>2]+12>>2]=a,i[i[e+4>>2]+12>>2]=n,i[n+8>>2]=e,i[a+8>>2]=t,a=i[f+8>>2],e=i[n+8>>2],i[i[e+4>>2]+12>>2]=f,i[i[a+4>>2]+12>>2]=n,i[n+8>>2]=a,i[f+8>>2]=e,i[n+16>>2]=i[f+16>>2],a=i[f+4>>2],i[i[a+16>>2]+8>>2]=a,i[a+20>>2]=i[n+20>>2],i[f+28>>2]=i[b+28>>2],i[a+28>>2]=i[n+28>>2],f):0}function $0(n){var f=0,a=0,e=0,t=0,b=0,o=0,k=0,s=0,r=0;if((0|(t=i[40+(n|=0)>>2]))!=(0|(k=n+40|0)))for(;;){if(r=i[t>>2],!w[t+21|0]){for(s=i[t+8>>2],n=i[s+12>>2];;){if(i[n+20>>2]=0,o=i[n+12>>2],f=i[n+4>>2],!i[f+20>>2]){if(e=i[n+16>>2],(0|(a=i[n+8>>2]))!=(0|n))i[e+8>>2]=a,e=i[f+12>>2],b=i[e+8>>2],i[i[a+4>>2]+12>>2]=e,i[i[b+4>>2]+12>>2]=n,i[n+8>>2]=b,i[e+8>>2]=a;else{for(f=a=i[e+8>>2];i[f+16>>2]=0,(0|a)!=(0|(f=i[f+8>>2])););f=i[e>>2],a=i[e+4>>2],i[f+4>>2]=a,i[a>>2]=f,Q(e),f=i[n+4>>2]}if(e=i[f+16>>2],(0|(a=i[f+8>>2]))!=(0|f))i[e+8>>2]=a,e=i[i[f+4>>2]+12>>2],b=i[e+8>>2],i[i[a+4>>2]+12>>2]=e,i[i[b+4>>2]+12>>2]=f,i[f+8>>2]=b,i[e+8>>2]=a;else{for(f=a=i[e+8>>2];i[f+16>>2]=0,(0|a)!=(0|(f=i[f+8>>2])););f=i[e>>2],a=i[e+4>>2],i[f+4>>2]=a,i[a>>2]=f,Q(e),f=i[n+4>>2]}e=i[(f=n>>>0>f>>>0?f:n)>>2],a=i[i[f+4>>2]>>2],i[i[e+4>>2]>>2]=a,i[i[a+4>>2]>>2]=e,Q(f)}if(f=(0|n)!=(0|s),n=o,!f)break}n=i[t>>2],o=i[t+4>>2],i[n+4>>2]=o,i[o>>2]=n,Q(t)}if((0|k)==(0|(t=r)))break}}function Z(n,f){var a=0,e=0,t=0,b=0,o=0,k=0;if((0|n)!=(0|f)){if((0|(e=i[f+16>>2]))!=(0|(o=i[n+16>>2]))){for(a=t=i[e+8>>2];i[a+16>>2]=o,(0|t)!=(0|(a=i[a+8>>2])););a=i[e>>2],t=i[e+4>>2],i[a+4>>2]=t,i[t>>2]=a,Q(e)}if((0|(k=i[n+20>>2]))!=(0|(t=i[f+20>>2]))){for(a=b=i[t+8>>2];i[a+20>>2]=k,(0|b)!=(0|(a=i[a+12>>2])););a=i[t>>2],b=i[t+4>>2],i[a+4>>2]=b,i[b>>2]=a,Q(t)}if(a=i[n+8>>2],b=i[f+8>>2],i[i[b+4>>2]+12>>2]=n,i[i[a+4>>2]+12>>2]=f,i[f+8>>2]=a,i[n+8>>2]=b,(0|e)==(0|o)){if(!(e=j(40)))return 0;for(a=i[n+16>>2],o=i[a+4>>2],i[e+4>>2]=o,i[o>>2]=e,i[e>>2]=a,i[a+4>>2]=e,i[e+12>>2]=0,i[e+8>>2]=f,a=f;i[a+16>>2]=e,(0|(a=i[a+8>>2]))!=(0|f););i[i[n+16>>2]+8>>2]=n}if((0|t)==(0|k)){if(!(e=j(24)))return 0;for(a=i[n+20>>2],t=i[a+4>>2],i[e+4>>2]=t,i[t>>2]=e,i[e>>2]=a,i[a+4>>2]=e,i[e+12>>2]=0,i[e+16>>2]=0,i[e+8>>2]=f,d[e+20|0]=0,d[e+21|0]=w[a+21|0],a=f;i[a+20>>2]=e,(0|(a=i[a+12>>2]))!=(0|f););i[i[n+20>>2]+8>>2]=n}}return 1}function X0(n,f){var a=0,e=0,t=0,b=0,o=0,k=0,s=u(0),r=0,A=0,l=u(0);if(i[n+20>>2]){e=f,a=i[n>>2],n=i[a+8>>2]+1|0,i[a+8>>2]=n;i:{if(!((0|(f=i[a+12>>2]))>=n<<1)){if(i[a+12>>2]=f<<1,t=i[a+4>>2],f=n0(b=i[a>>2],f<<3|4),i[a>>2]=f,!f){i[a>>2]=b,t=2147483647;break i}if(f=n0(i[a+4>>2],8+(i[a+12>>2]<<3)|0),i[a+4>>2]=f,!f){i[a+4>>2]=t,t=2147483647;break i}}if(b=i[a+4>>2],t=n,(f=i[a+16>>2])&&(i[a+16>>2]=i[4+(b+(f<<3)|0)>>2],t=f),o=i[a>>2],i[o+(n<<2)>>2]=t,i[(k=b+(t<<3)|0)>>2]=e,i[k+4>>2]=n,i[a+20>>2]){f:if(n>>>0<2)f=n;else for(s=c[e+28>>2];;){if(a=i[((f=n>>1)<<2)+o>>2],A=i[(r=b+(a<<3)|0)>>2],(l=c[A+28>>2])>2]<=c[e+32>>2])|s!=l)){f=n;break f}if(i[(n<<2)+o>>2]=a,i[r+4>>2]=n,!((n=f)>>>0>1))break}i[(f<<2)+o>>2]=t,i[k+4>>2]=f}}return t}if(e=(a=i[n+12>>2])+1|0,i[n+12>>2]=e,t=i[n+4>>2],(0|(b=e))<(0|(e=i[n+16>>2])))e=t;else if(i[n+16>>2]=e<<1,e=n0(t,e<<3),i[n+4>>2]=e,!e)return i[n+4>>2]=t,2147483647;return i[(a<<2)+e>>2]=f,-1^a}function s0(n){var f=0,a=0,e=0,t=0,b=0,o=0,k=0;b=j(40),o=j(40);i:{if(!(e=j(24))||!b|!o){if(b&&Q(b),o&&Q(o),!e)break i;return Q(e),0}if(!(f=j(64)))return 0;for(a=i[n+68>>2],t=i[(a=a>>>0<(t=n- -64|0)>>>0?a:t)+4>>2],k=i[t>>2],i[f+32>>2]=k,i[i[k+4>>2]>>2]=f,i[f>>2]=a,a=t,t=f+32|0,i[a>>2]=t,i[f+16>>2]=0,i[f+20>>2]=0,i[f+12>>2]=t,i[f+4>>2]=t,i[f+24>>2]=0,i[f+28>>2]=0,i[f+48>>2]=0,i[f+52>>2]=0,i[f+44>>2]=f,i[f+40>>2]=t,i[f+36>>2]=f,i[f+56>>2]=0,i[f+60>>2]=0,i[f+8>>2]=f,a=i[n+4>>2],i[b+4>>2]=a,i[a>>2]=b,i[b+12>>2]=0,i[b+8>>2]=f,a=f;i[a+16>>2]=b,(0|(a=i[a+8>>2]))!=(0|f););for(i[o+4>>2]=b,i[b>>2]=o,i[o>>2]=n,i[n+4>>2]=o,i[o+12>>2]=0,i[o+8>>2]=t,a=t;i[a+16>>2]=o,(0|t)!=(0|(a=i[a+8>>2])););for(a=i[n+44>>2],i[e+4>>2]=a,i[a>>2]=e,i[e>>2]=n+40,i[n+44>>2]=e,i[e+12>>2]=0,i[e+16>>2]=0,i[e+8>>2]=f,d[e+20|0]=0,d[e+21|0]=w[n+61|0],a=f;i[a+20>>2]=e,(0|(a=i[a+12>>2]))!=(0|f););}return f}function r0(n){n|=0;var f=0,a=0,e=0,t=0,b=0,o=u(0);if((f=j(128))&&(i[f+8>>2]=0,i[f+12>>2]=0,a=f+40|0,i[f+44>>2]=a,i[f+48>>2]=0,i[f+52>>2]=0,i[f+40>>2]=a,n2[f+54>>1]=0,n2[f+56>>1]=0,n2[f+58>>1]=0,n2[f+60>>1]=0,i[f+72>>2]=0,i[f+76>>2]=0,a=f+96|0,i[f+68>>2]=a,e=f- -64|0,i[f+64>>2]=e,i[f+80>>2]=0,i[f+84>>2]=0,i[f+88>>2]=0,i[f+92>>2]=0,i[f+104>>2]=0,i[f+108>>2]=0,i[f+100>>2]=e,i[f+96>>2]=a,i[f+112>>2]=0,i[f+116>>2]=0,i[f+120>>2]=0,i[f+124>>2]=0,i[f>>2]=f,i[f+4>>2]=f),i[n+8>>2]=f,!f)return 0;i:{if((0|(f=i[n+112>>2]))>0)for(t=116+((f<<4)+n|0)|0,a=n+116|0,f=i[n+4>>2];;){b=i[a+12>>2];f:{if(!f){if(e=0,!(f=s0(i[n+8>>2])))break i;if(Z(f,i[f+4>>2]))break f;break i}if(!o2(f))return 0;f=i[f+12>>2]}if(e=i[f+16>>2],i[e+12>>2]=b,c[e+16>>2]=c[a>>2],o=c[a+4>>2],i[e+24>>2]=0,c[e+20>>2]=o,i[f+28>>2]=1,i[i[f+4>>2]+28>>2]=-1,i[n+4>>2]=f,!(t>>>0>(a=a+16|0)>>>0))break}d[n+108|0]=0,i[n+112>>2]=0,e=1}return 0|e}function u4(n,f,a){f|=0,a|=0,(0|(a=i[1716+(n|=0)>>2]))==3?R[i[n+88>>2]](5):R[0|a](5,i[n+1896>>2]),(0|(a=i[n+1724>>2]))==5?R[i[n+96>>2]](i[i[f+16>>2]+12>>2]):R[0|a](i[i[f+16>>2]+12>>2],i[n+1896>>2]),(0|(a=i[n+1724>>2]))==5?R[i[n+96>>2]](i[i[i[f+4>>2]+16>>2]+12>>2]):R[0|a](i[i[i[f+4>>2]+16>>2]+12>>2],i[n+1896>>2]),a=i[f+20>>2];i:if(w[a+21|0])for(;;){if(w[a+20|0]||(d[a+20|0]=1,f=i[i[f+12>>2]+4>>2],(0|(a=i[n+1724>>2]))==5?R[i[n+96>>2]](i[i[f+16>>2]+12>>2]):R[0|a](i[i[f+16>>2]+12>>2],i[n+1896>>2]),a=i[f+20>>2],!w[a+21|0]|w[a+20|0]))break i;if(d[a+20|0]=1,f=i[f+8>>2],(0|(a=i[n+1724>>2]))==5?R[i[n+96>>2]](i[i[i[f+4>>2]+16>>2]+12>>2]):R[0|a](i[i[i[f+4>>2]+16>>2]+12>>2],i[n+1896>>2]),a=i[f+20>>2],!w[a+21|0])break}(0|(f=i[n+1728>>2]))==6?R[i[n+100>>2]]():R[0|f](i[n+1896>>2])}function p2(n,f){f|=0;var a=0;if((0|(a=i[(n|=0)>>2]))!=(0|f))for(;;){i:if(f>>>0>a>>>0){f:switch(0|a){case 0:(0|(a=i[n+1732>>2]))==11?R[i[n+12>>2]](100151):R[0|a](100151,i[n+1896>>2]),i[n>>2]&&p2(n,0),i[n+112>>2]=0,a=1,i[n>>2]=1,d[n+108|0]=0,i[n+1896>>2]=0,i[n+8>>2]=0;break i;case 1:break f;default:break i}if((0|(a=i[n+1732>>2]))==11?R[i[n+12>>2]](100152):R[0|a](100152,i[n+1896>>2]),i[n>>2]!=1&&p2(n,1),i[n>>2]=2,i[n+4>>2]=0,a=2,i[n+112>>2]<=0)break i;d[n+108|0]=1}else{f:switch(a-1|0){case 1:(0|(a=i[n+1732>>2]))==11?R[i[n+12>>2]](100154):R[0|a](100154,i[n+1896>>2]),i[n>>2]!=2&&p2(n,2),a=1,i[n>>2]=1;break i;case 0:break f;default:break i}(0|(a=i[n+1732>>2]))==11?R[i[n+12>>2]](100153):R[0|a](100153,i[n+1896>>2]),(a=i[n+8>>2])&&d0(a),a=0,i[n+8>>2]=0,i[n>>2]=0,i[n+4>>2]=0}if((0|f)==(0|a))break}}function A0(n,f){var a=0,e=0,t=0,b=0,o=0,k=0;i[n+8>>2]=7,i[n+4>>2]=0,a=i[f+20>>2];i:if(w[a+21|0]){t=f;f:{a:{for(;;){if(w[a+20|0])break i;if(d[a+20|0]=1,i[a+16>>2]=e,t=i[i[t+12>>2]+4>>2],e=i[t+20>>2],w[e+21|0]){if(w[e+20|0])break a;if(d[e+20|0]=1,i[e+16>>2]=a,b=b+2|0,t=i[t+8>>2],a=i[t+20>>2],w[a+21|0])continue;break i}break}b|=1;break f}b|=1}e=a}else t=f;o=i[f+4>>2],a=i[o+20>>2];i:if(!(!w[a+21|0]|w[a+20|0])){f:{a:{for(;;){if(d[a+20|0]=1,i[a+16>>2]=e,f=i[o+12>>2],o=i[f+4>>2],e=i[o+20>>2],w[e+21|0]){if(w[e+20|0])break a;if(d[e+20|0]=1,i[e+16>>2]=a,k=k+2|0,f=i[i[o+8>>2]+4>>2],o=i[f+4>>2],a=i[o+20>>2],!w[a+21|0])break i;if(!w[a+20|0])continue;break i}break}k|=1;break f}k|=1}e=a}a=b+k|0,i[n>>2]=a;i:{if(1&b){if(!(1&k))break i;i[n>>2]=a-1,f=f+8|0}else f=t+4|0;f=i[f>>2]}if(i[n+4>>2]=f,e)for(;d[e+20|0]=0,e=i[e+16>>2];);}function i1(n,f,a){var e=0,t=0,b=0,o=0,k=0,s=0,r=0,A=0,l=0;i:{f:{a:{n:{e:{t:{u:{o:{b:{k:{if(f){if(!a)break k;break b}r2=0,n=(n>>>0)/(a>>>0)|0;break i}if(!n)break o;break u}if(!(a-1&a))break t;o=0-(b=(s2(a)+33|0)-s2(f)|0)|0;break n}r2=0,n=(f>>>0)/0|0;break i}if((e=32-s2(f)|0)>>>0<31)break e;break a}if((0|a)==1)break f;a=31&(b=e0(a)),(63&b)>>>0>=32?n=f>>>a|0:(e=f>>>a|0,n=((1<>>a),r2=e;break i}b=e+1|0,o=63-e|0}if(t=31&(e=63&b),e>>>0>=32?(e=0,k=f>>>t|0):(e=f>>>t|0,k=((1<>>t),t=31&(o&=63),o>>>0>=32?(f=n<>>32-t|f<>>31,k=(e=k<<1|f>>>31)-(r=a&(t=l-(s+(e>>>0>o>>>0)|0)>>31))|0,e=s-(e>>>0>>0)|0,f=f<<1|n>>>31,n=A|n<<1,A=1&t,b=b-1|0;);r2=f<<1|n>>>31,n=A|n<<1;break i}n=0,f=0}r2=f}return n}function c4(n,f,a){f|=0,a|=0;var e=0,t=0,b=0,o=0,k=0,s=0,r=0;_=b=_-32|0,e=i[28+(n|=0)>>2],i[b+16>>2]=e,o=i[n+20>>2],i[b+28>>2]=a,i[b+24>>2]=f,f=o-e|0,i[b+20>>2]=f,o=f+a|0,s=2;i:{f:{f=b+16|0,(e=0|Y0(i[n+60>>2],0|f,2,b+12|0))?(i[806]=e,e=-1):e=0;a:{if(e)e=f;else for(;;){if((0|(t=i[b+12>>2]))==(0|o))break a;if((0|t)<0){e=f;break f}if(k=t-((r=(k=i[f+4>>2])>>>0>>0)?k:0)|0,i[(e=(r<<3)+f|0)>>2]=k+i[e>>2],i[(f=(r?12:4)+f|0)>>2]=i[f>>2]-k,o=o-t|0,f=e,s=s-r|0,(t=0|Y0(i[n+60>>2],0|f,0|s,b+12|0))?(i[806]=t,t=-1):t=0,t)break}if((0|o)!=-1)break f}f=i[n+44>>2],i[n+28>>2]=f,i[n+20>>2]=f,i[n+16>>2]=f+i[n+48>>2],n=a;break i}i[n+28>>2]=0,i[n+16>>2]=0,i[n+20>>2]=0,i[n>>2]=32|i[n>>2],n=0,(0|s)!=2&&(n=a-i[e+4>>2]|0)}return _=b+32|0,0|n}function f1(n){var f=0,a=0,e=0,t=0,b=0,o=0,k=u(0),s=0,r=u(0),A=0,l=0,v=0,h=0,y=0;if(t=i[n+4>>2],a=i[n>>2],e=i[a+4>>2],y=i[(f=t+(e<<3)|0)>>2],!((0|(b=i[n+8>>2]))<=0)&&(A=i[(b<<2)+a>>2],i[a+4>>2]=A,i[4+(l=(A<<3)+t|0)>>2]=1,i[f>>2]=0,i[f+4>>2]=i[n+16>>2],v=b-1|0,i[n+8>>2]=v,i[n+16>>2]=e,(0|b)!=1)){for(f=1;(0|v)<=(0|(n=f<<1))||(o=i[(i[((e=1|n)<<2)+a>>2]<<3)+t>>2],k=c[o+28>>2],s=i[(i[(n<<2)+a>>2]<<3)+t>>2],!(k<(r=c[s+28>>2]))&(!(c[o+32>>2]<=c[s+32>>2])|k!=r)||(n=e)),!((0|n)>=(0|b)||(e=i[l>>2],k=c[e+28>>2],o=i[(n<<2)+a>>2],h=i[(s=(o<<3)+t|0)>>2],k<(r=c[h+28>>2])|k==r&c[e+32>>2]<=c[h+32>>2]));)i[(f<<2)+a>>2]=o,i[s+4>>2]=f,f=n;i[(f<<2)+a>>2]=A,i[l+4>>2]=f}return y}function a1(n,f,a){switch(f-9|0){case 0:return f=i[a>>2],i[a>>2]=f+4,void(i[n>>2]=i[f>>2]);case 6:return f=i[a>>2],i[a>>2]=f+4,f=n2[f>>1],i[n>>2]=f,void(i[n+4>>2]=f>>31);case 7:return f=i[a>>2],i[a>>2]=f+4,i[n>>2]=G2[f>>1],void(i[n+4>>2]=0);case 8:return f=i[a>>2],i[a>>2]=f+4,f=d[0|f],i[n>>2]=f,void(i[n+4>>2]=f>>31);case 9:return f=i[a>>2],i[a>>2]=f+4,i[n>>2]=w[0|f],void(i[n+4>>2]=0);case 16:return f=i[a>>2]+7&-8,i[a>>2]=f+8,void(q[n>>3]=q[f>>3]);case 17:b2();default:return;case 1:case 4:case 14:return f=i[a>>2],i[a>>2]=f+4,f=i[f>>2],i[n>>2]=f,void(i[n+4>>2]=f>>31);case 2:case 5:case 11:case 15:return f=i[a>>2],i[a>>2]=f+4,i[n>>2]=i[f>>2],void(i[n+4>>2]=0);case 3:case 10:case 12:case 13:}f=i[a>>2]+7&-8,i[a>>2]=f+8,a=i[f+4>>2],i[n>>2]=i[f>>2],i[n+4>>2]=a}function s4(n,f,a){f|=0,a|=0,(0|(a=i[1716+(n|=0)>>2]))==3?R[i[n+88>>2]](6):R[0|a](6,i[n+1896>>2]),(0|(a=i[n+1724>>2]))==5?R[i[n+96>>2]](i[i[f+16>>2]+12>>2]):R[0|a](i[i[f+16>>2]+12>>2],i[n+1896>>2]),(0|(a=i[n+1724>>2]))==5?R[i[n+96>>2]](i[i[i[f+4>>2]+16>>2]+12>>2]):R[0|a](i[i[i[f+4>>2]+16>>2]+12>>2],i[n+1896>>2]),a=i[f+20>>2];i:if(w[a+21|0])for(;;){if(w[a+20|0])break i;if(d[a+20|0]=1,f=i[f+8>>2],(0|(a=i[n+1724>>2]))==5?R[i[n+96>>2]](i[i[i[f+4>>2]+16>>2]+12>>2]):R[0|a](i[i[i[f+4>>2]+16>>2]+12>>2],i[n+1896>>2]),a=i[f+20>>2],!w[a+21|0])break}(0|(f=i[n+1728>>2]))==6?R[i[n+100>>2]]():R[0|f](i[n+1896>>2])}function n1(n,f,a){var e=0,t=0;if(a&&(d[0|n]=f,d[(e=n+a|0)-1|0]=f,!(a>>>0<3||(d[n+2|0]=f,d[n+1|0]=f,d[e-3|0]=f,d[e-2|0]=f,a>>>0<7||(d[n+3|0]=f,d[e-4|0]=f,a>>>0<9||(t=(e=0-n&3)+n|0,n=L(255&f,16843009),i[t>>2]=n,i[(f=(a=a-e&-4)+t|0)-4>>2]=n,a>>>0<9||(i[t+8>>2]=n,i[t+4>>2]=n,i[f-8>>2]=n,i[f-12>>2]=n,a>>>0<25||(i[t+24>>2]=n,i[t+20>>2]=n,i[t+16>>2]=n,i[t+12>>2]=n,i[f-16>>2]=n,i[f-20>>2]=n,i[f-24>>2]=n,i[f-28>>2]=n,(a=a-(f=4&t|24)|0)>>>0<32))))))))for(n=h0(n,0,1,1),e=r2,f=f+t|0;i[f+24>>2]=n,i[f+28>>2]=e,i[f+16>>2]=n,i[f+20>>2]=e,i[f+8>>2]=n,i[f+12>>2]=e,i[f>>2]=n,i[f+4>>2]=e,f=f+32|0,(a=a-32|0)>>>0>31;);}function J(n,f,a){var e=u(0),t=0,b=0,o=u(0),k=u(0),s=0,r=u(0),A=u(0),l=u(0);_=b=_+-64|0;i:{f:{if(!(!(s=(e=c[f+28>>2])>(k=c[n+28>>2]))&(!(c[n+32>>2]<=c[f+32>>2])|e!=k))){if((o=c[a+28>>2])>e|e==o&c[f+32>>2]<=c[a+32>>2])break i;if(t=1,s)break f}t=0,e==k&&(t=c[n+32>>2]<=c[f+32>>2])}s=t,t=1,(o=c[a+28>>2])>e||(t=0,e==o&&(t=c[f+32>>2]<=c[a+32>>2])),r=c[n+32>>2],A=c[f+32>>2],l=c[a+32>>2],q[b+40>>3]=o,q[b+24>>3]=e,q[b+48>>3]=l,q[b+32>>3]=A,q[b+16>>3]=r,q[b+8>>3]=k,i[b+4>>2]=t,i[b>>2]=s,A1(1092,b),o=c[a+28>>2],k=c[n+28>>2],e=c[f+28>>2]}return r=u(0),_=b- -64|0,k=u(e-k),e=u(o-e),u(k+e)>u(0)&&(o=c[f+32>>2],r=u(u(u(o-c[a+32>>2])*k)+u(e*u(o-c[n+32>>2])))),r}function B2(n,f,a){switch(f-100100|0){case 0:return void(i[n+88>>2]=a||15);case 6:return void(i[n+1716>>2]=a||3);case 4:return d[n+80|0]=(0|a)!=0,void(i[n+92>>2]=a||14);case 10:return d[n+80|0]=(0|a)!=0,void(i[n+1720>>2]=a||4);case 1:return void(i[n+96>>2]=a||13);case 7:return void(i[n+1724>>2]=a||5);case 2:return void(i[n+100>>2]=a||12);case 8:return void(i[n+1728>>2]=a||6);case 3:return void(i[n+12>>2]=a||18);case 9:return void(i[n+1732>>2]=a||11);case 5:return void(i[n+76>>2]=a||17);case 11:return void(i[n+1736>>2]=a||10);case 12:return void(i[n+104>>2]=a||16)}(0|(f=i[n+1732>>2]))==11?R[i[n+12>>2]](100900):R[0|f](100900,i[n+1896>>2])}function L2(n,f,a){var e=0,t=0,b=0,o=0;e=i[f>>2];i:{if((0|f)!=(0|a))for(;;){if(d[f+15|0]=0,o=i[f+4>>2],b=i[i[o+8>>2]>>2],t=i[b>>2],i[t+16>>2]!=i[e+16>>2]){if(!w[b+15|0])return n=w[f+12|0],a=i[e+20>>2],i[a+8>>2]=e,d[a+21|0]=n,i[e+24>>2]=0,m2(o),Q(f),e;if(!(t=A2(i[i[e+8>>2]+4>>2],i[t+4>>2]))||!$(i[b>>2]))break i;i[b>>2]=t,d[b+15|0]=0,i[t+24>>2]=b}if(i[e+8>>2]!=(0|t)&&(!Z(i[i[t+4>>2]+12>>2],t)||!Z(e,t)))break i;if(t=w[f+12|0],e=i[f>>2],o=i[e+20>>2],i[o+8>>2]=e,d[o+21|0]=t,i[e+24>>2]=0,m2(i[f+4>>2]),Q(f),e=i[b>>2],(0|a)==(0|(f=b)))break}return e}k2(n+1740|0,1),b2()}function l0(n,f,a){var e=0,t=0,b=0;_=e=_-48|0,i[e+24>>2]=0,i[e+28>>2]=0,i[e+16>>2]=0,i[e+20>>2]=0,i[e+8>>2]=0,i[e+12>>2]=0,i[e>>2]=1056964608,i[e+4>>2]=1056964608,t=i[f+16>>2],i[e+16>>2]=i[t+12>>2],i[e+20>>2]=i[i[a+16>>2]+12>>2],c[e+36>>2]=c[t+16>>2],c[e+40>>2]=c[t+20>>2],c[e+44>>2]=c[t+24>>2],i[t+12>>2]=0,t=t+12|0,(0|(b=i[n+1736>>2]))==10?R[i[n+76>>2]](e+36|0,e+16|0,e,t):R[0|b](e+36|0,e+16|0,e,t,i[n+1896>>2]),i[t>>2]||(i[t>>2]=i[e+16>>2]),Z(f,a)||(k2(n+1740|0,1),b2()),_=e+48|0}function r4(n,f){n|=0;var a=0,e=0,t=0;if((0|(a=i[40+(f|=0)>>2]))!=(0|(e=f+40|0)))for(;;){if(w[a+21|0]){for((0|(f=i[n+1716>>2]))==3?R[i[n+88>>2]](2):R[0|f](2,i[n+1896>>2]),f=i[a+8>>2];(0|(t=i[n+1724>>2]))==5?R[i[n+96>>2]](i[i[f+16>>2]+12>>2]):R[0|t](i[i[f+16>>2]+12>>2],i[n+1896>>2]),(0|(f=i[f+12>>2]))!=i[a+8>>2];);(0|(f=i[n+1728>>2]))==6?R[i[n+100>>2]]():R[0|f](i[n+1896>>2])}if((0|e)==(0|(a=i[a>>2])))break}}function e1(n,f,a){var e=0,t=0,b=0;if(_=e=_-208|0,i[e+204>>2]=f,n1(f=e+160|0,0,40),i[e+200>>2]=i[e+204>>2],!((0|N0(0,n,e+200|0,e+80|0,f,a))<0)){f=i[423]<0,t=i[404],i[404]=-33&t;i:{f:{if(i[416]){if(i[408])break f}else i[416]=80,i[411]=0,i[408]=0,i[409]=0,b=i[415],i[415]=e;if(r1(1616))break i}N0(1616,n,e+200|0,e+80|0,e+160|0,a)}b&&(R[i[413]](1616,0,0),i[416]=0,i[415]=b,i[411]=0,i[408]=0,i[409]=0),i[404]=i[404]|32&t}_=e+208|0}function t1(n,f){if(!n)return 0;i:{f:{if(n){if(f>>>0<=127)break f;if(i[i[845]>>2]){if(f>>>0<=2047){d[n+1|0]=63&f|128,d[0|n]=f>>>6|192,n=2;break i}if(!((-8192&f)!=57344&f>>>0>=55296)){d[n+2|0]=63&f|128,d[0|n]=f>>>12|224,d[n+1|0]=f>>>6&63|128,n=3;break i}if(f-65536>>>0<=1048575){d[n+3|0]=63&f|128,d[0|n]=f>>>18|240,d[n+2|0]=f>>>6&63|128,d[n+1|0]=f>>>12&63|128,n=4;break i}}else if((-128&f)==57216)break f;i[806]=25,n=-1}else n=1;break i}d[0|n]=f,n=1}return n}function A4(n,f,a){n|=0,f|=0,a|=0;var e=0,t=0,b=u(0),o=u(0);return a=i[a>>2],e=i[i[a+4>>2]+16>>2],f=i[f>>2],(0|(t=i[i[f+4>>2]+16>>2]))==(0|(n=i[n+72>>2]))?(0|n)==(0|e)?(f=i[f+16>>2],b=c[f+28>>2],a=i[a+16>>2],!(b<(o=c[a+28>>2]))&(!(c[f+32>>2]<=c[a+32>>2])|b!=o)?J(n,a,f)>=u(0)|0:J(n,f,a)<=u(0)|0):J(e,n,i[a+16>>2])<=u(0)|0:(f=i[f+16>>2],(0|n)==(0|e)?J(t,n,f)>=u(0)|0:s1(t,n,f)>=s1(i[i[a+4>>2]+16>>2],n,i[a+16>>2])|0)}function v0(n){var f=0,a=0,e=0,t=0,b=0,o=u(0),k=u(0);if(!(f=i[n+12>>2]))return f1(i[n>>2]);if(e=i[n+8>>2],t=i[i[(e+(f<<2)|0)-4>>2]>>2],a=i[n>>2],i[a+8>>2]&&(b=i[i[a+4>>2]+(i[i[a>>2]+4>>2]<<3)>>2],!(!((o=c[b+28>>2])<(k=c[t+28>>2]))&(!(c[b+32>>2]<=c[t+32>>2])|o!=k))))return f1(a);for(a=e-8|0,e=((0|f)>0?1:f)-1|0;;){if((0|f)<2)return i[n+12>>2]=e,t;if(b=f<<2,f=f-1|0,i[i[a+b>>2]>>2])break}return i[n+12>>2]=f,t}function l4(n,f,a){f|=0,a|=0;var e=0,t=0,b=0,o=0;b=1;i:if((0|(e=i[64+(n|=0)>>2]))!=(0|(t=n- -64|0))){if(o=0-f|0,!a){for(;;)if(n=w[i[e+20>>2]+21|0],i[e+28>>2]=(0|n)!=w[i[i[e+4>>2]+20>>2]+21|0]?n?f:o:0,(0|t)==(0|(e=i[e>>2])))break i}for(;;){if(n=i[e>>2],(0|(a=w[i[e+20>>2]+21|0]))==w[i[i[e+4>>2]+20>>2]+21|0]){if(!$(e)){b=0;break i}}else i[e+28>>2]=a?f:o;if((0|t)==(0|(e=n)))break}}return 0|b}function N(n,f,a){var e=0,t=0,b=0;if(!(32&w[0|n]))i:{if(!(e=i[n+16>>2])){if(r1(n))break i;e=i[n+16>>2]}if(e-(t=i[n+20>>2])>>>0>>0)R[i[n+36>>2]](n,f,a);else{f:{a:if(!(!a|i[n+80>>2]<0)){for(e=a;;){if(w[(b=f+e|0)-1|0]!=10){if(e=e-1|0)continue;break a}break}if(R[i[n+36>>2]](n,f,e)>>>0>>0)break i;a=a-e|0,t=i[n+20>>2];break f}b=f}q0(t,b,a),i[n+20>>2]=i[n+20>>2]+a}}}function o1(n,f){var a=0,e=0,t=0;(a=j(16))&&(t=s0(i[n+8>>2]))&&(e=i[t+16>>2],c[e+32>>2]=f,i[e+28>>2]=2112929218,e=i[i[t+4>>2]+16>>2],c[e+32>>2]=f,i[e+28>>2]=-34554430,i[n+72>>2]=e,d[a+15|0]=0,d[a+12|0]=0,i[a+8>>2]=0,i[a>>2]=t,d[a+13|0]=1,d[a+14|0]=0,e=a,a=w0(t=i[n+64>>2],t,a),i[e+4>>2]=a,a)||(k2(n+1740|0,1),b2())}function d0(n){var f=0,a=0,e=0;if((0|(f=i[40+(n|=0)>>2]))!=(0|(a=n+40|0)))for(;e=i[f>>2],Q(f),(0|a)!=(0|(f=e)););if((0|(f=i[n>>2]))!=(0|n))for(;e=i[f>>2],Q(f),(0|(f=e))!=(0|n););if((0|(f=i[n+64>>2]))!=(0|(a=n- -64|0)))for(;e=i[f>>2],Q(f),(0|a)!=(0|(f=e)););Q(n)}function b1(n){var f=0,a=u(0),e=u(0);if(!(f=i[n+12>>2]))return n=i[n>>2],i[i[n+4>>2]+(i[i[n>>2]+4>>2]<<3)>>2];f=i[i[(i[n+8>>2]+(f<<2)|0)-4>>2]>>2],n=i[n>>2];i:{if(i[n+8>>2]&&(n=i[i[n+4>>2]+(i[i[n>>2]+4>>2]<<3)>>2],(a=c[n+28>>2])<(e=c[f+28>>2])||a==e&&c[n+32>>2]<=c[f+32>>2]))break i;n=f}return n}function v4(n,f,a,e){n|=0,f|=0,a|=0,e|=0,a=0;i:{if(f=i[456]){if(!((a=i[f>>2])>>>0<100001)){f=j(12);break i}}else f=j(1200008),i[f+4>>2]=12,i[f>>2]=0,i[456]=f;i[f>>2]=a+1,f=8+(L(a,12)+f|0)|0}c[f>>2]=c[n>>2],c[f+4>>2]=c[n+4>>2],c[f+8>>2]=c[n+8>>2],i[e>>2]=f}function Q2(n,f,a){var e=0,t=0,b=0,o=0;if(f)for(;b=a=a-1|0,o=(t=n)-h0(n=i1(n,f,10),e=r2,10,0)|48,d[0|b]=o,t=f>>>0>9,f=e,t;);if(n)for(;f=(n>>>0)/10|0,d[0|(a=a-1|0)]=n-L(f,10)|48,e=n>>>0>9,n=f,e;);return a}function k1(n,f,a,e){var t=0,b=0,o=0;if(b=i[980]+1|0,i[980]=b,i[n>>2]=b,e)for(;;){if(!i[(t=(o<<3)+a|0)>>2])return i[t>>2]=b,i[t+4>>2]=f,i[t+8>>2]=0,W=e,a;if((0|(o=o+1|0))==(0|e))break}return t=n,n=e<<1,f=k1(t,f,n0(a,e<<4|8),n),W=n,f}function u1(n,f){var a=0,e=0,t=0;if(u0(+n),e=0|c2(1),t=0|c2(0),(0|(a=e>>>20&2047))!=2047){if(!a)return n==0?a=0:(n=u1(18446744073709552e3*n,f),a=i[f>>2]+-64|0),i[f>>2]=a,n;i[f>>2]=a-1022,L0(0,0|t),L0(1,-2146435073&e|1071644672),n=+K1()}return n}function c1(n){var f=0,a=0,e=0;if(d[i[n>>2]]-48>>>0>=10)return 0;for(;e=i[n>>2],a=-1,f>>>0<=214748364&&(a=(0|(a=d[0|e]-48|0))>(2147483647^(f=L(f,10)))?-1:a+f|0),i[n>>2]=e+1,f=a,d[e+1|0]-48>>>0<10;);return f}function s1(n,f,a){var e=u(0),t=u(0),b=0,o=u(0),k=u(0);return e=c[f+28>>2],t=u(e-c[n+28>>2]),e=u(c[a+28>>2]-e),(o=u(t+e))>u(0)?(k=c[((b=e>t)?n:a)+32>>2],e=u(u(u(k-c[(b?a:n)+32>>2])*u((b?t:e)/o))+u(c[f+32>>2]-k))):e=u(0),e}function h0(n,f,a,e){var t=0,b=0,o=0,k=0,s=0,r=0;return r=L(t=a>>>16|0,b=n>>>16|0),t=(65535&(b=((s=L(o=65535&a,k=65535&n))>>>16|0)+L(b,o)|0))+L(t,k)|0,r2=(L(f,a)+r|0)+L(n,e)+(b>>>16)+(t>>>16)|0,65535&s|t<<16}function w0(n,f,a){for(var e=0;f=i[f+8>>2],(e=i[f>>2])&&!(0|R[i[n+16>>2]](i[n+12>>2],e,a)););return(n=j(12))&&(i[n>>2]=a,a=i[f+4>>2],i[n+4>>2]=a,i[a+8>>2]=n,i[n+8>>2]=f,i[f+4>>2]=n),n}function z(n,f,a,e,t){var b=0;if(_=b=_-256|0,!(73728&t|(0|a)<=(0|e))){if(n1(b,255&f,(a=(e=a-e|0)>>>0<256)?e:256),!a)for(;N(n,b,256),(e=e-256|0)>>>0>255;);N(n,b,e)}_=b+256|0}function r1(n){var f=0;return f=i[n+72>>2],i[n+72>>2]=f-1|f,8&(f=i[n>>2])?(i[n>>2]=32|f,-1):(i[n+4>>2]=0,i[n+8>>2]=0,f=i[n+44>>2],i[n+28>>2]=f,i[n+20>>2]=f,i[n+16>>2]=f+i[n+48>>2],0)}function X(n,f,a){var e=0,t=0,b=0;i:if(a)for(;;){if(!(b=i[(t=(e<<3)+f|0)>>2]))break i;if((0|n)==(0|b))return i[t+4>>2];if((0|(e=e+1|0))==(0|a))break}return 0}function T2(n){var f=0,a=0;i:{if(!((n=(f=i[440])+(a=n+7&-8)|0)>>>0<=f>>>0&&a)&&(n>>>0<=v1()<<16>>>0||0|i4(0|n)))break i;return i[806]=48,-1}return i[440]=n,f}function d4(n,f){n|=0;var a=0,e=0;(0|(a=i[4+(f|=0)>>2]))>2]&&(e=i[f>>2]+(L(i[f+12>>2],a)<<2)|0,c[e>>2]=c[n>>2],c[e+4>>2]=c[n+4>>2],i[f+4>>2]=a+1)}function h4(n,f){n|=0,f|=0;var a=u(0),e=u(0);if((a=c[n+28>>2])<(e=c[f+28>>2]))n=1;else{if(a!=e)return 0;n=c[n+32>>2]<=c[f+32>>2]}return 0|n}function y0(n){var f=0;(f=i[n>>2])&&(Q(i[f+4>>2]),Q(i[f>>2]),Q(f)),(f=i[n+8>>2])&&Q(f),(f=i[n+4>>2])&&Q(f),Q(n)}function w4(n){n|=0;var f=0;_=f=_-16|0,i[f>>2]=n,_=n=_-16|0,i[n+12>>2]=f,e1(1078,f,0),_=n+16|0,_=f+16|0}function y4(n,f,a){n|=0,f=i[20+(f|=0)>>2],i[f+16>>2]=i[n+84>>2],i[n+84>>2]=f,d[f+20|0]=1}function m2(n){var f=0,a=0;f=i[n+4>>2],a=i[n+8>>2],i[f+8>>2]=a,i[a+4>>2]=f,Q(n)}function i2(n){var f=0;return(-1>>>(f=31&n)&-2)<>>n}function A1(n,f){var a=0;_=a=_-16|0,i[a+12>>2]=f,e1(n,f,40),_=a+16|0}function k2(n,f){n|=0,f|=0,i[978]||(i[978]=n,i[979]=f),X1()}function p4(n,f){n|=0,f|=0,i[978]||(i[978]=n,i[979]=f)}function m4(n,f,a,e){return r2=0,0}function g4(n,f,a,e,t){}function e0(n){return n?31-s2(n-1^n)|0:32}function E4(n,f,a,e){}function C4(){i[845]=3260,i[827]=42}function R4(n){return 0}function t0(n,f){}function I4(){return 0|_}function S4(n){_=n|=0}function g2(n){}function l1(){}F=w,e2();var R=U([null,y4,s4,t0,t0,t0,g2,u4,h4,A4,g4,t0,l1,g2,g2,g2,g2,E4,g2,p2,b4,r0,k2,V0,t4,l4,k4,r4,o4,$0,d0,d4,g2,l1,v4,w4,g2,R4,c4,m4,e4]);function v1(){return a2.byteLength/65536|0}function M4(n){n|=0;var f=0|v1(),a=f+n|0;if(fp.startsWith(T0);function W0(p){if(p==x2&&U2)return new Uint8Array(U2);var C=E1(p);if(C)return C;if(o0)return o0(p);throw"both async and sync fetching of the wasm failed"}function F1(p){return U2||N2(p)||!P2&&!Y2||typeof fetch!="function"?Promise.resolve().then(()=>W0(p)):fetch(p,{credentials:"same-origin"}).then(C=>{if(!C.ok)throw"failed to load wasm binary file at '"+p+"'";return C.arrayBuffer()}).catch(()=>W0(p))}function H0(p,C,B){return F1(p).then(U=>h2.instantiate(U,C)).then(U=>U).then(B,U=>{_2(`failed to asynchronously prepare wasm: ${U}`),Q0(U)})}function B1(p,C,B,U){return p||typeof h2.instantiateStreaming!="function"||N2(C)||typeof fetch!="function"?H0(C,B,U):fetch(C,{credentials:"same-origin"}).then(F=>h2.instantiateStreaming(F,B).then(U,function(H){return _2(`wasm streaming compile failed: ${H}`),_2("falling back to ArrayBuffer instantiation"),H0(C,B,U)}))}function Q1(){var p={a:L1};function C(U,F){return u2=U.exports,x0=u2.m,M1(u2.j),_1(),u2}function B(U){C(U.instance)}if(U1(),E.instantiateWasm)try{return E.instantiateWasm(p,C)}catch(U){_2(`Module.instantiateWasm callback failed with error: ${U}`),v2(U)}return B1(U2,x2,p,B).catch(v2),{}}N2(x2="libtess-asm.wasm")||(x2=p1(x2));var b0=p=>{for(;p.length>0;)p.shift()(E)};E.noExitRuntime;var x0,T1=()=>{throw 1/0},W1=(p,C,B)=>Z2.copyWithin(p,C,C+B),H1=()=>2147483648,x1=p=>{var C=(p-F2.buffer.byteLength+65535)/65536;try{return F2.grow(C),P0(),1}catch{}},O1=p=>{var C=Z2.length;p>>>=0;var B=H1();if(p>B)return!1;for(var U=(x,e2)=>x+(e2-x%e2)%e2,F=1;F<=4;F*=2){var H=C*(1+.2/F);H=Math.min(H,p+100663296);var D=Math.min(B,U(Math.max(p,H),65536));if(x1(D))return!0}return!1},j1=[null,[],[]],O0=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,D1=(p,C,B)=>{for(var U=C+B,F=C;p[F]&&!(F>=U);)++F;if(F-C>16&&p.buffer&&O0)return O0.decode(p.subarray(C,F));for(var H="";C>10,56320|1023&y2)}}else H+=String.fromCharCode((31&D)<<6|x)}else H+=String.fromCharCode(D)}return H},G1=(p,C)=>{var B=j1[p];C===0||C===10?((p===1?m1:_2)(D1(B,0)),B.length=0):B.push(C)},V2=[],z2=p=>{var C=V2[p];return C||(p>=V2.length&&(V2.length=p+1),V2[p]=C=x0.get(p)),C},L1={f:T1,h:W1,g:O1,d:(p,C,B,U)=>{for(var F=0,H=0;H>2],x=J2[C+4>>2];C+=8;for(var e2=0;e2>2]=F,0},c:J1,i:N1,e:Z1,b:Y1,a:F2},u2=Q1();E._malloc=p=>(E._malloc=u2.k)(p),E._free=p=>(E._free=u2.l)(p),E._triangulate=(p,C,B,U,F,H)=>(E._triangulate=u2.n)(p,C,B,U,F,H);var K2,O2=(p,C)=>(O2=u2.o)(p,C),j2=()=>(j2=u2.p)(),D2=p=>(D2=u2.q)(p);function Y1(p,C,B){var U=j2();try{z2(p)(C,B)}catch(F){if(D2(U),F!==F+0)throw F;O2(1,0)}}function Z1(p,C){var B=j2();try{z2(p)(C)}catch(U){if(D2(B),U!==U+0)throw U;O2(1,0)}}function J1(p,C){var B=j2();try{return z2(p)(C)}catch(U){if(D2(B),U!==U+0)throw U;O2(1,0)}}function N1(p,C,B,U){var F=j2();try{return z2(p)(C,B,U)}catch(H){if(D2(F),H!==H+0)throw H;O2(1,0)}}function j0(){function p(){K2||(K2=!0,E.calledRun=!0,M0||(R1(),W2(E),E.onRuntimeInitialized&&E.onRuntimeInitialized(),I1()))}C2>0||(C1(),C2>0||(E.setStatus?(E.setStatus("Running..."),setTimeout(function(){setTimeout(function(){E.setStatus("")},1),p()},1)):p()))}if(H2=function p(){K2||j0(),K2||(H2=p)},E.preInit)for(typeof E.preInit=="function"&&(E.preInit=[E.preInit]);E.preInit.length>0;)E.preInit.pop()();j0();let k0=null,w2=null,R2=null,q2=null;const V1=2,D0=4e3;let G0=0;const z1=(p,C,B)=>{k0||(k0=E._triangulate);let U=E.HEAPF32;const F=E.HEAP32.BYTES_PER_ELEMENT,H=2,D=U.BYTES_PER_ELEMENT;B>G0&&(G0=B,R2&&(E._free(R2),R2=0),w2&&(E._free(w2),w2=0)),R2||(R2=E._malloc(B*D)),q2||(q2=E._malloc(D0*F));const x=B*V1;w2||(w2=E._malloc(x*D)),U=E.HEAPF32,U.set(p,R2/D),E.HEAP32.set(C,q2/F);const e2=x/H,y2=k0(R2,q2,Math.min(C.length,D0),H,w2,e2),$2=y2*H;U=E.HEAPF32;const X2=U.slice(w2/D,w2/D+$2),c2={};return c2.buffer=X2,c2.vertexCount=y2,c2};return E.triangulate=z1,M2.ready},d1.exports=h1;var w1=y1.exports;const F4=U4({__proto__:null,default:P4(w1)},[w1]);export{F4 as l}; diff --git a/assets/lineSegment-B9UF3nEF.js b/assets/lineSegment-BYtydnRZ.js similarity index 76% rename from assets/lineSegment-B9UF3nEF.js rename to assets/lineSegment-BYtydnRZ.js index 3f445a3..e5d79e9 100644 --- a/assets/lineSegment-B9UF3nEF.js +++ b/assets/lineSegment-BYtydnRZ.js @@ -1 +1 @@ -import{cS as t,cy as e,cT as g,cU as s,cu as p,cV as b,cW as h,I as j,cX as w}from"./index-CEWggaxV.js";import{s as x}from"./ObjectStack-CF0cQvd2.js";import{c as y}from"./plane-py4f_JCU.js";function u(r){return r?{origin:t(r.origin),vector:t(r.vector)}:{origin:e(),vector:e()}}function T(r,n,o=u()){return g(o.origin,r),s(o.vector,n,r),o}function U(r,n,o){return A(r,n,0,1,o)}function A(r,n,o,a,c){const{vector:i,origin:v}=r,f=s(y.get(),n,v),m=p(i,f)/b(i);return h(c,i,j(m,o,a)),w(c,c,r.origin)}new x(()=>u());export{T as b,U as j,u as v}; +import{cS as t,cy as e,cT as g,cU as s,cu as p,cV as b,cW as h,I as j,cX as w}from"./index-BjUNJPVf.js";import{s as x}from"./ObjectStack-BAIuPeIh.js";import{c as y}from"./plane-DxOTtTwj.js";function u(r){return r?{origin:t(r.origin),vector:t(r.vector)}:{origin:e(),vector:e()}}function T(r,n,o=u()){return g(o.origin,r),s(o.vector,n,r),o}function U(r,n,o){return A(r,n,0,1,o)}function A(r,n,o,a,c){const{vector:i,origin:v}=r,f=s(y.get(),n,v),m=p(i,f)/b(i);return h(c,i,j(m,o,a)),w(c,c,r.origin)}new x(()=>u());export{T as b,U as j,u as v}; diff --git a/assets/loadGLTFMesh-CbP8-zjv.js b/assets/loadGLTFMesh-DdWfwp7n.js similarity index 82% rename from assets/loadGLTFMesh-CbP8-zjv.js rename to assets/loadGLTFMesh-DdWfwp7n.js index 138c687..5cdd466 100644 --- a/assets/loadGLTFMesh-CbP8-zjv.js +++ b/assets/loadGLTFMesh-DdWfwp7n.js @@ -1,4 +1,4 @@ -import{M as z,Z as R,a9 as w,ht as B,hu as S,D as b,gS as F,cz as P,cN as D}from"./index-CEWggaxV.js";import{e as C}from"./mat3f64-q3fE-ZOt.js";import{l as L,m as N,a as G,h as U,c as V}from"./Mesh-9oOqPmbT.js";import{c as O,x as I,L as q,O as A,i as j,E as K,T as Q,u as Z}from"./BufferView-Ao_K-5Vg.js";import{e as k,f as H,a as J,o as E}from"./vec3-CjYmIfaa.js";import{n as W,l as X,o as Y,f as ee,r as te,a as re,b as v,c as ne,d as oe,e as M,g as se,h as le,i as ae}from"./DefaultMaterial_COLOR_GAMMA-CWI-ZW7Q.js";import{e as ie}from"./types-D0PSWh4d.js";import{V as ue}from"./georeference-DtjTZVKi.js";import{r as ce}from"./resourceUtils-BqKyAr0B.js";import"./imageUtils-DNanu5Rn.js";import"./MeshLocalVertexSpace-Cltwu1Kq.js";import"./meshVertexSpaceUtils-BFWpJFSd.js";import"./earcut-hRlx3adE.js";import"./DoubleArray-DxyNBrRi.js";import"./Indices-Dv-cCjFT.js";import"./deduplicate-Bk22TunD.js";import"./plane-py4f_JCU.js";import"./mat4f64-CSKppSlJ.js";import"./quatf64-Bdb9ZJJK.js";import"./triangle-CU37cZF1.js";import"./Util-BS8sJGjF.js";import"./ObjectStack-CF0cQvd2.js";import"./lineSegment-B9UF3nEF.js";import"./basicInterfaces-GbxEOYtk.js";import"./VertexAttribute-BlT9lbVY.js";import"./External-DC51KyR4.js";import"./infoFor3D-DsOdlPuA.js";import"./quat-CoKEr4Zu.js";import"./computeTranslationToOriginAndRotation-DOOKw0d1.js";import"./Version-Bd0QsIQ5.js";function fe(e,t,r){const u=e.typedBuffer,o=e.typedBufferStride,l=t.typedBuffer,c=t.typedBufferStride,a=r?r.count:t.count;let s=((r==null?void 0:r.dstIndex)??0)*o,m=((r==null?void 0:r.srcIndex)??0)*c;for(let i=0;ic.set(h,ge($))),o.materials.forEach(($,h)=>a.set(h,$e($,c)));const s=xe(l);for(const $ of s.parts)ye(s,$,a);const{position:m,normal:i,tangent:n,color:f,texCoord0:p}=s.vertexAttributes,x={position:m.typedBuffer,normal:i!=null?i.typedBuffer:null,tangent:n!=null?n.typedBuffer:null,uv:p!=null?p.typedBuffer:null,color:f!=null?f.typedBuffer:null},g=ue(x,e,r);return{transform:g.transform,vertexSpace:g.vertexSpace,components:s.components,spatialReference:e.spatialReference,vertexAttributes:new L({position:g.vertexAttributes.position,normal:g.vertexAttributes.normal,tangent:g.vertexAttributes.tangent,color:x.color,uv:x.uv})}}function pe(e){const t=e==null?void 0:e.resolveFile;return t?{busy:!1,request:async(r,u,o)=>{const l=(t==null?void 0:t(r))??r;return(await z(l,{responseType:u==="image"?"image":u==="binary"?"array-buffer":"json",signal:o!=null?o.signal:null})).data}}:null}function T(e,t){if(e==null)return"-";const r=e.typedBuffer;return`${R(t,r.buffer,()=>t.size)}/${r.byteOffset}/${r.byteLength}`}function de(e){return e!=null?e.toString():"-"}function xe(e){let t=0;const r={color:!1,tangent:!1,normal:!1,texCoord0:!1},u=new Map,o=new Map,l=[];for(const c of e.parts){const{attributes:{position:a,normal:s,color:m,tangent:i,texCoord0:n}}=c,f=` +import{M as z,Z as R,a9 as w,ht as B,hu as S,D as b,gS as F,cz as P,cN as D}from"./index-BjUNJPVf.js";import{e as C}from"./mat3f64-q3fE-ZOt.js";import{l as L,m as N,a as G,h as U,c as V}from"./Mesh--rTzs1p1.js";import{c as O,x as I,L as q,O as A,i as j,E as K,T as Q,u as Z}from"./BufferView-3om6S_aJ.js";import{e as k,f as H,a as J,o as E}from"./vec3-DdRUbala.js";import{n as W,l as X,o as Y,f as ee,r as te,a as re,b as v,c as ne,d as oe,e as M,g as se,h as le,i as ae}from"./DefaultMaterial_COLOR_GAMMA-BQtlD4-o.js";import{e as ie}from"./types-D0PSWh4d.js";import{V as ue}from"./georeference-DqFdARS7.js";import{r as ce}from"./resourceUtils-BHmy1O5x.js";import"./imageUtils-ChIDAvDr.js";import"./MeshLocalVertexSpace-DRvwbFTJ.js";import"./meshVertexSpaceUtils-DwMoblqo.js";import"./earcut-CWKXDqDj.js";import"./DoubleArray--0pYeNcV.js";import"./Indices-BRm9v2lM.js";import"./deduplicate-BR6i8Xk0.js";import"./plane-DxOTtTwj.js";import"./mat4f64-CSKppSlJ.js";import"./quatf64-Bdb9ZJJK.js";import"./triangle-DmKBscqo.js";import"./Util-CS5u4Lec.js";import"./ObjectStack-BAIuPeIh.js";import"./lineSegment-BYtydnRZ.js";import"./basicInterfaces-GbxEOYtk.js";import"./VertexAttribute-BlT9lbVY.js";import"./External-DIoD7Bb4.js";import"./infoFor3D-DsOdlPuA.js";import"./quat-C0wQB0HB.js";import"./computeTranslationToOriginAndRotation-BeE3rOSz.js";import"./Version-Dqq_CHBG.js";function fe(e,t,r){const u=e.typedBuffer,o=e.typedBufferStride,l=t.typedBuffer,c=t.typedBufferStride,a=r?r.count:t.count;let s=((r==null?void 0:r.dstIndex)??0)*o,m=((r==null?void 0:r.srcIndex)??0)*c;for(let i=0;ic.set(h,ge($))),o.materials.forEach(($,h)=>a.set(h,$e($,c)));const s=xe(l);for(const $ of s.parts)ye(s,$,a);const{position:m,normal:i,tangent:n,color:f,texCoord0:p}=s.vertexAttributes,x={position:m.typedBuffer,normal:i!=null?i.typedBuffer:null,tangent:n!=null?n.typedBuffer:null,uv:p!=null?p.typedBuffer:null,color:f!=null?f.typedBuffer:null},g=ue(x,e,r);return{transform:g.transform,vertexSpace:g.vertexSpace,components:s.components,spatialReference:e.spatialReference,vertexAttributes:new L({position:g.vertexAttributes.position,normal:g.vertexAttributes.normal,tangent:g.vertexAttributes.tangent,color:x.color,uv:x.uv})}}function pe(e){const t=e==null?void 0:e.resolveFile;return t?{busy:!1,request:async(r,u,o)=>{const l=(t==null?void 0:t(r))??r;return(await z(l,{responseType:u==="image"?"image":u==="binary"?"array-buffer":"json",signal:o!=null?o.signal:null})).data}}:null}function T(e,t){if(e==null)return"-";const r=e.typedBuffer;return`${R(t,r.buffer,()=>t.size)}/${r.byteOffset}/${r.byteLength}`}function de(e){return e!=null?e.toString():"-"}function xe(e){let t=0;const r={color:!1,tangent:!1,normal:!1,texCoord0:!1},u=new Map,o=new Map,l=[];for(const c of e.parts){const{attributes:{position:a,normal:s,color:m,tangent:i,texCoord0:n}}=c,f=` ${T(a,u)}/ ${T(s,u)}/ ${T(m,u)}/ diff --git a/assets/loadable-DylQ3Aza.js b/assets/loadable-CreDQ1Dd.js similarity index 90% rename from assets/loadable-DylQ3Aza.js rename to assets/loadable-CreDQ1Dd.js index 1c969a5..dfc220e 100644 --- a/assets/loadable-DylQ3Aza.js +++ b/assets/loadable-CreDQ1Dd.js @@ -1,4 +1,4 @@ -import{c1 as t}from"./index-CEWggaxV.js";/*! +import{c1 as t}from"./index-BjUNJPVf.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.7.1 diff --git a/assets/loader-DQtzvvHl.js b/assets/loader-Bjz1lIB0.js similarity index 99% rename from assets/loader-DQtzvvHl.js rename to assets/loader-Bjz1lIB0.js index 28b19c8..77e5adf 100644 --- a/assets/loader-DQtzvvHl.js +++ b/assets/loader-Bjz1lIB0.js @@ -1,4 +1,4 @@ -import{c2 as b,c3 as x,c0 as e,c4 as w}from"./index-CEWggaxV.js";import{g as E}from"./guid-DQtJl1SZ.js";/*! +import{c2 as b,c3 as x,c0 as e,c4 as w}from"./index-BjUNJPVf.js";import{g as E}from"./guid-DQtJl1SZ.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.7.1 diff --git a/assets/lyr3DWorker-BxsCtwuN.js b/assets/lyr3DWorker-CH63Ctm0.js similarity index 99% rename from assets/lyr3DWorker-BxsCtwuN.js rename to assets/lyr3DWorker-CH63Ctm0.js index ccd96cf..e2364f9 100644 --- a/assets/lyr3DWorker-BxsCtwuN.js +++ b/assets/lyr3DWorker-CH63Ctm0.js @@ -1,4 +1,4 @@ -import{ar as Qn,es as zr}from"./index-CEWggaxV.js";var De,Nr,Pe,Se={exports:{}};De=Se,Nr=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,Pe=function(Br={}){var Lr,cr,l=Br;l.ready=new Promise((r,e)=>{Lr=r,cr=e});var br,Ur,Hr=Object.assign({},l),Ir="./this.program",Vr=(r,e)=>{throw e},$e=!0,V="";function Te(r){return l.locateFile?l.locateFile(r,V):V+r}typeof document<"u"&&document.currentScript&&(V=document.currentScript.src),Nr&&(V=Nr),V=V.indexOf("blob:")!==0?V.substr(0,V.replace(/[?#].*/,"").lastIndexOf("/")+1):"",br=r=>{var e=new XMLHttpRequest;return e.open("GET",r,!1),e.send(null),e.responseText},Ur=(r,e,t)=>{var n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="arraybuffer",n.onload=()=>{n.status==200||n.status==0&&n.response?e(n.response):t()},n.onerror=t,n.send(null)};var or,fr,Yr=l.print||console.log.bind(console),Y=l.printErr||console.error.bind(console);Object.assign(l,Hr),Hr=null,l.arguments&&l.arguments,l.thisProgram&&(Ir=l.thisProgram),l.quit&&(Vr=l.quit),l.wasmBinary&&(or=l.wasmBinary),typeof WebAssembly!="object"&&Q("no native wasm support detected");var P,C,q,mr,y,w,qr,Xr,kr=!1;function Gr(r,e){r||Q(e)}function Jr(){var r=fr.buffer;l.HEAP8=P=new Int8Array(r),l.HEAP16=q=new Int16Array(r),l.HEAPU8=C=new Uint8Array(r),l.HEAPU16=mr=new Uint16Array(r),l.HEAP32=y=new Int32Array(r),l.HEAPU32=w=new Uint32Array(r),l.HEAPF32=qr=new Float32Array(r),l.HEAPF64=Xr=new Float64Array(r)}var Zr=[],Kr=[],Qr=[];function Ce(){if(l.preRun)for(typeof l.preRun=="function"&&(l.preRun=[l.preRun]);l.preRun.length;)xe(l.preRun.shift());Fr(Zr)}function Me(){l.noFSInit||o.init.initialized||o.init(),o.ignorePermissions=!1,Fr(Kr)}function je(){if(l.postRun)for(typeof l.postRun=="function"&&(l.postRun=[l.postRun]);l.postRun.length;)Re(l.postRun.shift());Fr(Qr)}function xe(r){Zr.unshift(r)}function Oe(r){Kr.unshift(r)}function Re(r){Qr.unshift(r)}var G=0,ar=null;function eo(r){return r}function hr(r){G++,l.monitorRunDependencies&&l.monitorRunDependencies(G)}function ir(r){if(G--,l.monitorRunDependencies&&l.monitorRunDependencies(G),G==0&&ar){var e=ar;ar=null,e()}}function Q(r){l.onAbort&&l.onAbort(r),Y(r="Aborted("+r+")"),kr=!0,r+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(r);throw cr(e),e}var sr,E,S,We="data:application/octet-stream;base64,",re=r=>r.startsWith(We);function ee(r){if(r==sr&&or)return new Uint8Array(or);throw"both async and sync fetching of the wasm failed"}function ze(r){return!or&&$e&&typeof fetch=="function"?fetch(r,{credentials:"same-origin"}).then(e=>{if(!e.ok)throw"failed to load wasm binary file at '"+r+"'";return e.arrayBuffer()}).catch(()=>ee(r)):Promise.resolve().then(()=>ee(r))}function te(r,e,t){return ze(r).then(n=>WebAssembly.instantiate(n,e)).then(n=>n).then(t,n=>{Y(`failed to asynchronously prepare wasm: ${n}`),Q(n)})}function Ne(r,e,t,n){return r||typeof WebAssembly.instantiateStreaming!="function"||re(e)||typeof fetch!="function"?te(e,t,n):fetch(e,{credentials:"same-origin"}).then(a=>WebAssembly.instantiateStreaming(a,t).then(n,function(i){return Y(`wasm streaming compile failed: ${i}`),Y("falling back to ArrayBuffer instantiation"),te(e,t,n)}))}function Be(){var r={a:Ln};function e(n,a){return A=n.exports,fr=A._,Jr(),K=A.aa,Oe(A.$),ir(),A}function t(n){e(n.instance)}if(hr(),l.instantiateWasm)try{return l.instantiateWasm(r,e)}catch(n){Y(`Module.instantiateWasm callback failed with error: ${n}`),cr(n)}return Ne(or,sr,r,t).catch(cr),{}}function Le(r){this.name="ExitStatus",this.message=`Program terminated with exit(${r})`,this.status=r}re(sr="lyr3DWorker.wasm")||(sr=Te(sr));var Fr=r=>{for(;r.length>0;)r.shift()(l)},Ue=l.noExitRuntime||!0;function He(r){this.excPtr=r,this.ptr=r-24,this.set_type=function(e){w[this.ptr+4>>2]=e},this.get_type=function(){return w[this.ptr+4>>2]},this.set_destructor=function(e){w[this.ptr+8>>2]=e},this.get_destructor=function(){return w[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,P[this.ptr+12>>0]=e},this.get_caught=function(){return P[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,P[this.ptr+13>>0]=e},this.get_rethrown=function(){return P[this.ptr+13>>0]!=0},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)},this.set_adjusted_ptr=function(e){w[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return w[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Fe(this.get_type()))return w[this.excPtr>>2];var e=this.get_adjusted_ptr();return e!==0?e:this.excPtr}}var Ie=(r,e,t)=>{throw new He(r).init(e,t),r},Ve=r=>(y[be()>>2]=r,r),b={isAbs:r=>r.charAt(0)==="/",splitPath:r=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(r).slice(1),normalizeArray:(r,e)=>{for(var t=0,n=r.length-1;n>=0;n--){var a=r[n];a==="."?r.splice(n,1):a===".."?(r.splice(n,1),t++):t&&(r.splice(n,1),t--)}if(e)for(;t;t--)r.unshift("..");return r},normalize:r=>{var e=b.isAbs(r),t=r.substr(-1)==="/";return(r=b.normalizeArray(r.split("/").filter(n=>!!n),!e).join("/"))||e||(r="."),r&&t&&(r+="/"),(e?"/":"")+r},dirname:r=>{var e=b.splitPath(r),t=e[0],n=e[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:r=>{if(r==="/")return"/";var e=(r=(r=b.normalize(r)).replace(/\/$/,"")).lastIndexOf("/");return e===-1?r:r.substr(e+1)},join:function(){var r=Array.prototype.slice.call(arguments);return b.normalize(r.join("/"))},join2:(r,e)=>b.normalize(r+"/"+e)},Ye=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return r=>crypto.getRandomValues(r);Q("initRandomDevice")},ne=r=>(ne=Ye())(r),L={resolve:function(){for(var r="",e=!1,t=arguments.length-1;t>=-1&&!e;t--){var n=t>=0?arguments[t]:o.cwd();if(typeof n!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";r=n+"/"+r,e=b.isAbs(n)}return(e?"/":"")+(r=b.normalizeArray(r.split("/").filter(a=>!!a),!e).join("/"))||"."},relative:(r,e)=>{function t(c){for(var m=0;m=0&&c[h]==="";h--);return m>h?[]:c.slice(m,h-m+1)}r=L.resolve(r).substr(1),e=L.resolve(e).substr(1);for(var n=t(r.split("/")),a=t(e.split("/")),i=Math.min(n.length,a.length),s=i,u=0;u{for(var n=e+t,a=e;r[a]&&!(a>=n);)++a;if(a-e>16&&r.buffer&&oe)return oe.decode(r.subarray(e,a));for(var i="";e>10,56320|1023&c)}}else i+=String.fromCharCode((31&s)<<6|u)}else i+=String.fromCharCode(s)}return i},Ar=[],Dr=r=>{for(var e=0,t=0;t=55296&&n<=57343?(e+=4,++t):e+=3}return e},Pr=(r,e,t,n)=>{if(!(n>0))return 0;for(var a=t,i=t+n-1,s=0;s=55296&&u<=57343&&(u=65536+((1023&u)<<10)|1023&r.charCodeAt(++s)),u<=127){if(t>=i)break;e[t++]=u}else if(u<=2047){if(t+1>=i)break;e[t++]=192|u>>6,e[t++]=128|63&u}else if(u<=65535){if(t+2>=i)break;e[t++]=224|u>>12,e[t++]=128|u>>6&63,e[t++]=128|63&u}else{if(t+3>=i)break;e[t++]=240|u>>18,e[t++]=128|u>>12&63,e[t++]=128|u>>6&63,e[t++]=128|63&u}}return e[t]=0,t-a};function Sr(r,e,t){var n=t>0?t:Dr(r)+1,a=new Array(n),i=Pr(r,a,0,a.length);return e&&(a.length=i),a}var qe=()=>{if(!Ar.length){var r=null;if(typeof window<"u"&&typeof window.prompt=="function"?(r=window.prompt("Input: "))!==null&&(r+=` +import{ar as Qn,es as zr}from"./index-BjUNJPVf.js";var De,Nr,Pe,Se={exports:{}};De=Se,Nr=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,Pe=function(Br={}){var Lr,cr,l=Br;l.ready=new Promise((r,e)=>{Lr=r,cr=e});var br,Ur,Hr=Object.assign({},l),Ir="./this.program",Vr=(r,e)=>{throw e},$e=!0,V="";function Te(r){return l.locateFile?l.locateFile(r,V):V+r}typeof document<"u"&&document.currentScript&&(V=document.currentScript.src),Nr&&(V=Nr),V=V.indexOf("blob:")!==0?V.substr(0,V.replace(/[?#].*/,"").lastIndexOf("/")+1):"",br=r=>{var e=new XMLHttpRequest;return e.open("GET",r,!1),e.send(null),e.responseText},Ur=(r,e,t)=>{var n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="arraybuffer",n.onload=()=>{n.status==200||n.status==0&&n.response?e(n.response):t()},n.onerror=t,n.send(null)};var or,fr,Yr=l.print||console.log.bind(console),Y=l.printErr||console.error.bind(console);Object.assign(l,Hr),Hr=null,l.arguments&&l.arguments,l.thisProgram&&(Ir=l.thisProgram),l.quit&&(Vr=l.quit),l.wasmBinary&&(or=l.wasmBinary),typeof WebAssembly!="object"&&Q("no native wasm support detected");var P,C,q,mr,y,w,qr,Xr,kr=!1;function Gr(r,e){r||Q(e)}function Jr(){var r=fr.buffer;l.HEAP8=P=new Int8Array(r),l.HEAP16=q=new Int16Array(r),l.HEAPU8=C=new Uint8Array(r),l.HEAPU16=mr=new Uint16Array(r),l.HEAP32=y=new Int32Array(r),l.HEAPU32=w=new Uint32Array(r),l.HEAPF32=qr=new Float32Array(r),l.HEAPF64=Xr=new Float64Array(r)}var Zr=[],Kr=[],Qr=[];function Ce(){if(l.preRun)for(typeof l.preRun=="function"&&(l.preRun=[l.preRun]);l.preRun.length;)xe(l.preRun.shift());Fr(Zr)}function Me(){l.noFSInit||o.init.initialized||o.init(),o.ignorePermissions=!1,Fr(Kr)}function je(){if(l.postRun)for(typeof l.postRun=="function"&&(l.postRun=[l.postRun]);l.postRun.length;)Re(l.postRun.shift());Fr(Qr)}function xe(r){Zr.unshift(r)}function Oe(r){Kr.unshift(r)}function Re(r){Qr.unshift(r)}var G=0,ar=null;function eo(r){return r}function hr(r){G++,l.monitorRunDependencies&&l.monitorRunDependencies(G)}function ir(r){if(G--,l.monitorRunDependencies&&l.monitorRunDependencies(G),G==0&&ar){var e=ar;ar=null,e()}}function Q(r){l.onAbort&&l.onAbort(r),Y(r="Aborted("+r+")"),kr=!0,r+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(r);throw cr(e),e}var sr,E,S,We="data:application/octet-stream;base64,",re=r=>r.startsWith(We);function ee(r){if(r==sr&&or)return new Uint8Array(or);throw"both async and sync fetching of the wasm failed"}function ze(r){return!or&&$e&&typeof fetch=="function"?fetch(r,{credentials:"same-origin"}).then(e=>{if(!e.ok)throw"failed to load wasm binary file at '"+r+"'";return e.arrayBuffer()}).catch(()=>ee(r)):Promise.resolve().then(()=>ee(r))}function te(r,e,t){return ze(r).then(n=>WebAssembly.instantiate(n,e)).then(n=>n).then(t,n=>{Y(`failed to asynchronously prepare wasm: ${n}`),Q(n)})}function Ne(r,e,t,n){return r||typeof WebAssembly.instantiateStreaming!="function"||re(e)||typeof fetch!="function"?te(e,t,n):fetch(e,{credentials:"same-origin"}).then(a=>WebAssembly.instantiateStreaming(a,t).then(n,function(i){return Y(`wasm streaming compile failed: ${i}`),Y("falling back to ArrayBuffer instantiation"),te(e,t,n)}))}function Be(){var r={a:Ln};function e(n,a){return A=n.exports,fr=A._,Jr(),K=A.aa,Oe(A.$),ir(),A}function t(n){e(n.instance)}if(hr(),l.instantiateWasm)try{return l.instantiateWasm(r,e)}catch(n){Y(`Module.instantiateWasm callback failed with error: ${n}`),cr(n)}return Ne(or,sr,r,t).catch(cr),{}}function Le(r){this.name="ExitStatus",this.message=`Program terminated with exit(${r})`,this.status=r}re(sr="lyr3DWorker.wasm")||(sr=Te(sr));var Fr=r=>{for(;r.length>0;)r.shift()(l)},Ue=l.noExitRuntime||!0;function He(r){this.excPtr=r,this.ptr=r-24,this.set_type=function(e){w[this.ptr+4>>2]=e},this.get_type=function(){return w[this.ptr+4>>2]},this.set_destructor=function(e){w[this.ptr+8>>2]=e},this.get_destructor=function(){return w[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,P[this.ptr+12>>0]=e},this.get_caught=function(){return P[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,P[this.ptr+13>>0]=e},this.get_rethrown=function(){return P[this.ptr+13>>0]!=0},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)},this.set_adjusted_ptr=function(e){w[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return w[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Fe(this.get_type()))return w[this.excPtr>>2];var e=this.get_adjusted_ptr();return e!==0?e:this.excPtr}}var Ie=(r,e,t)=>{throw new He(r).init(e,t),r},Ve=r=>(y[be()>>2]=r,r),b={isAbs:r=>r.charAt(0)==="/",splitPath:r=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(r).slice(1),normalizeArray:(r,e)=>{for(var t=0,n=r.length-1;n>=0;n--){var a=r[n];a==="."?r.splice(n,1):a===".."?(r.splice(n,1),t++):t&&(r.splice(n,1),t--)}if(e)for(;t;t--)r.unshift("..");return r},normalize:r=>{var e=b.isAbs(r),t=r.substr(-1)==="/";return(r=b.normalizeArray(r.split("/").filter(n=>!!n),!e).join("/"))||e||(r="."),r&&t&&(r+="/"),(e?"/":"")+r},dirname:r=>{var e=b.splitPath(r),t=e[0],n=e[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:r=>{if(r==="/")return"/";var e=(r=(r=b.normalize(r)).replace(/\/$/,"")).lastIndexOf("/");return e===-1?r:r.substr(e+1)},join:function(){var r=Array.prototype.slice.call(arguments);return b.normalize(r.join("/"))},join2:(r,e)=>b.normalize(r+"/"+e)},Ye=()=>{if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function")return r=>crypto.getRandomValues(r);Q("initRandomDevice")},ne=r=>(ne=Ye())(r),L={resolve:function(){for(var r="",e=!1,t=arguments.length-1;t>=-1&&!e;t--){var n=t>=0?arguments[t]:o.cwd();if(typeof n!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";r=n+"/"+r,e=b.isAbs(n)}return(e?"/":"")+(r=b.normalizeArray(r.split("/").filter(a=>!!a),!e).join("/"))||"."},relative:(r,e)=>{function t(c){for(var m=0;m=0&&c[h]==="";h--);return m>h?[]:c.slice(m,h-m+1)}r=L.resolve(r).substr(1),e=L.resolve(e).substr(1);for(var n=t(r.split("/")),a=t(e.split("/")),i=Math.min(n.length,a.length),s=i,u=0;u{for(var n=e+t,a=e;r[a]&&!(a>=n);)++a;if(a-e>16&&r.buffer&&oe)return oe.decode(r.subarray(e,a));for(var i="";e>10,56320|1023&c)}}else i+=String.fromCharCode((31&s)<<6|u)}else i+=String.fromCharCode(s)}return i},Ar=[],Dr=r=>{for(var e=0,t=0;t=55296&&n<=57343?(e+=4,++t):e+=3}return e},Pr=(r,e,t,n)=>{if(!(n>0))return 0;for(var a=t,i=t+n-1,s=0;s=55296&&u<=57343&&(u=65536+((1023&u)<<10)|1023&r.charCodeAt(++s)),u<=127){if(t>=i)break;e[t++]=u}else if(u<=2047){if(t+1>=i)break;e[t++]=192|u>>6,e[t++]=128|63&u}else if(u<=65535){if(t+2>=i)break;e[t++]=224|u>>12,e[t++]=128|u>>6&63,e[t++]=128|63&u}else{if(t+3>=i)break;e[t++]=240|u>>18,e[t++]=128|u>>12&63,e[t++]=128|u>>6&63,e[t++]=128|63&u}}return e[t]=0,t-a};function Sr(r,e,t){var n=t>0?t:Dr(r)+1,a=new Array(n),i=Pr(r,a,0,a.length);return e&&(a.length=i),a}var qe=()=>{if(!Ar.length){var r=null;if(typeof window<"u"&&typeof window.prompt=="function"?(r=window.prompt("Input: "))!==null&&(r+=` `):typeof readline=="function"&&(r=readline())!==null&&(r+=` `),!r)return null;Ar=Sr(r,!0)}return Ar.shift()},J={ttys:[],init(){},shutdown(){},register(r,e){J.ttys[r]={input:[],output:[],ops:e},o.registerDevice(r,J.stream_ops)},stream_ops:{open(r){var e=J.ttys[r.node.rdev];if(!e)throw new o.ErrnoError(43);r.tty=e,r.seekable=!1},close(r){r.tty.ops.fsync(r.tty)},fsync(r){r.tty.ops.fsync(r.tty)},read(r,e,t,n,a){if(!r.tty||!r.tty.ops.get_char)throw new o.ErrnoError(60);for(var i=0,s=0;sqe(),put_char(r,e){e===null||e===10?(Yr(rr(r.output,0)),r.output=[]):e!=0&&r.output.push(e)},fsync(r){r.output&&r.output.length>0&&(Yr(rr(r.output,0)),r.output=[])},ioctl_tcgets:r=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(r,e,t)=>0,ioctl_tiocgwinsz:r=>[24,80]},default_tty1_ops:{put_char(r,e){e===null||e===10?(Y(rr(r.output,0)),r.output=[]):e!=0&&r.output.push(e)},fsync(r){r.output&&r.output.length>0&&(Y(rr(r.output,0)),r.output=[])}}},ae=r=>{Q()},g={ops_table:null,mount:r=>g.createNode(null,"/",16895,0),createNode(r,e,t,n){if(o.isBlkdev(t)||o.isFIFO(t))throw new o.ErrnoError(63);g.ops_table||(g.ops_table={dir:{node:{getattr:g.node_ops.getattr,setattr:g.node_ops.setattr,lookup:g.node_ops.lookup,mknod:g.node_ops.mknod,rename:g.node_ops.rename,unlink:g.node_ops.unlink,rmdir:g.node_ops.rmdir,readdir:g.node_ops.readdir,symlink:g.node_ops.symlink},stream:{llseek:g.stream_ops.llseek}},file:{node:{getattr:g.node_ops.getattr,setattr:g.node_ops.setattr},stream:{llseek:g.stream_ops.llseek,read:g.stream_ops.read,write:g.stream_ops.write,allocate:g.stream_ops.allocate,mmap:g.stream_ops.mmap,msync:g.stream_ops.msync}},link:{node:{getattr:g.node_ops.getattr,setattr:g.node_ops.setattr,readlink:g.node_ops.readlink},stream:{}},chrdev:{node:{getattr:g.node_ops.getattr,setattr:g.node_ops.setattr},stream:o.chrdev_stream_ops}});var a=o.createNode(r,e,t,n);return o.isDir(a.mode)?(a.node_ops=g.ops_table.dir.node,a.stream_ops=g.ops_table.dir.stream,a.contents={}):o.isFile(a.mode)?(a.node_ops=g.ops_table.file.node,a.stream_ops=g.ops_table.file.stream,a.usedBytes=0,a.contents=null):o.isLink(a.mode)?(a.node_ops=g.ops_table.link.node,a.stream_ops=g.ops_table.link.stream):o.isChrdev(a.mode)&&(a.node_ops=g.ops_table.chrdev.node,a.stream_ops=g.ops_table.chrdev.stream),a.timestamp=Date.now(),r&&(r.contents[e]=a,r.timestamp=a.timestamp),a},getFileDataAsTypedArray:r=>r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0),expandFileStorage(r,e){var t=r.contents?r.contents.length:0;if(!(t>=e)){var n=1048576;e=Math.max(e,t*(t>>0),t!=0&&(e=Math.max(e,256));var a=r.contents;r.contents=new Uint8Array(e),r.usedBytes>0&&r.contents.set(a.subarray(0,r.usedBytes),0)}},resizeFileStorage(r,e){if(r.usedBytes!=e)if(e==0)r.contents=null,r.usedBytes=0;else{var t=r.contents;r.contents=new Uint8Array(e),t&&r.contents.set(t.subarray(0,Math.min(e,r.usedBytes))),r.usedBytes=e}},node_ops:{getattr(r){var e={};return e.dev=o.isChrdev(r.mode)?r.id:1,e.ino=r.id,e.mode=r.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=r.rdev,o.isDir(r.mode)?e.size=4096:o.isFile(r.mode)?e.size=r.usedBytes:o.isLink(r.mode)?e.size=r.link.length:e.size=0,e.atime=new Date(r.timestamp),e.mtime=new Date(r.timestamp),e.ctime=new Date(r.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr(r,e){e.mode!==void 0&&(r.mode=e.mode),e.timestamp!==void 0&&(r.timestamp=e.timestamp),e.size!==void 0&&g.resizeFileStorage(r,e.size)},lookup(r,e){throw o.genericErrors[44]},mknod:(r,e,t,n)=>g.createNode(r,e,t,n),rename(r,e,t){if(o.isDir(r.mode)){var n;try{n=o.lookupNode(e,t)}catch{}if(n)for(var a in n.contents)throw new o.ErrnoError(55)}delete r.parent.contents[r.name],r.parent.timestamp=Date.now(),r.name=t,e.contents[t]=r,e.timestamp=r.parent.timestamp,r.parent=e},unlink(r,e){delete r.contents[e],r.timestamp=Date.now()},rmdir(r,e){var t=o.lookupNode(r,e);for(var n in t.contents)throw new o.ErrnoError(55);delete r.contents[e],r.timestamp=Date.now()},readdir(r){var e=[".",".."];for(var t in r.contents)r.contents.hasOwnProperty(t)&&e.push(t);return e},symlink(r,e,t){var n=g.createNode(r,e,41471,0);return n.link=t,n},readlink(r){if(!o.isLink(r.mode))throw new o.ErrnoError(28);return r.link}},stream_ops:{read(r,e,t,n,a){var i=r.node.contents;if(a>=r.node.usedBytes)return 0;var s=Math.min(r.node.usedBytes-a,n);if(s>8&&i.subarray)e.set(i.subarray(a,a+s),t);else for(var u=0;u0||t+e(g.stream_ops.write(r,e,0,n,t,!1),0)}},Xe=(r,e,t,n)=>{var a=n?"":`al ${r}`;Ur(r,i=>{Gr(i,`Loading data file "${r}" failed (no arrayBuffer).`),e(new Uint8Array(i)),a&&ir()},i=>{if(!t)throw`Loading data file "${r}" failed.`;t()}),a&&hr()},Ge=(r,e,t,n,a,i)=>o.createDataFile(r,e,t,n,a,i),Je=l.preloadPlugins||[],Ze=(r,e,t,n)=>{typeof Browser<"u"&&Browser.init();var a=!1;return Je.forEach(i=>{a||i.canHandle(e)&&(i.handle(r,e,t,n),a=!0)}),a},Ke=(r,e,t,n,a,i,s,u,d,c)=>{var m=e?L.resolve(b.join2(r,e)):r;function h(p){function _(k){c&&c(),u||Ge(r,e,k,n,a,d),i&&i(),ir()}Ze(p,m,_,()=>{s&&s(),ir()})||_(p)}hr(),typeof t=="string"?Xe(t,p=>h(p),s):h(t)},Qe=r=>{var e={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[r];if(e===void 0)throw new Error(`Unknown file open mode: ${r}`);return e},$r=(r,e)=>{var t=0;return r&&(t|=365),e&&(t|=146),t},o={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath(r,e={}){if(!(r=L.resolve(r)))return{path:"",node:null};var t={follow_mount:!0,recurse_count:0};if((e=Object.assign(t,e)).recurse_count>8)throw new o.ErrnoError(32);for(var n=r.split("/").filter(m=>!!m),a=o.root,i="/",s=0;s40)throw new o.ErrnoError(32)}}return{path:i,node:a}},getPath(r){for(var e;;){if(o.isRoot(r)){var t=r.mount.mountpoint;return e?t[t.length-1]!=="/"?`${t}/${e}`:t+e:t}e=e?`${r.name}/${e}`:r.name,r=r.parent}},hashName(r,e){for(var t=0,n=0;n>>0)%o.nameTable.length},hashAddNode(r){var e=o.hashName(r.parent.id,r.name);r.name_next=o.nameTable[e],o.nameTable[e]=r},hashRemoveNode(r){var e=o.hashName(r.parent.id,r.name);if(o.nameTable[e]===r)o.nameTable[e]=r.name_next;else for(var t=o.nameTable[e];t;){if(t.name_next===r){t.name_next=r.name_next;break}t=t.name_next}},lookupNode(r,e){var t=o.mayLookup(r);if(t)throw new o.ErrnoError(t,r);for(var n=o.hashName(r.id,e),a=o.nameTable[n];a;a=a.name_next){var i=a.name;if(a.parent.id===r.id&&i===e)return a}return o.lookup(r,e)},createNode(r,e,t,n){var a=new o.FSNode(r,e,t,n);return o.hashAddNode(a),a},destroyNode(r){o.hashRemoveNode(r)},isRoot:r=>r===r.parent,isMountpoint:r=>!!r.mounted,isFile:r=>(61440&r)==32768,isDir:r=>(61440&r)==16384,isLink:r=>(61440&r)==40960,isChrdev:r=>(61440&r)==8192,isBlkdev:r=>(61440&r)==24576,isFIFO:r=>(61440&r)==4096,isSocket:r=>(49152&r)==49152,flagsToPermissionString(r){var e=["r","w","rw"][3&r];return 512&r&&(e+="w"),e},nodePermissions:(r,e)=>o.ignorePermissions||(!e.includes("r")||292&r.mode)&&(!e.includes("w")||146&r.mode)&&(!e.includes("x")||73&r.mode)?0:2,mayLookup(r){var e=o.nodePermissions(r,"x");return e||(r.node_ops.lookup?0:2)},mayCreate(r,e){try{return o.lookupNode(r,e),20}catch{}return o.nodePermissions(r,"wx")},mayDelete(r,e,t){var n;try{n=o.lookupNode(r,e)}catch(i){return i.errno}var a=o.nodePermissions(r,"wx");if(a)return a;if(t){if(!o.isDir(n.mode))return 54;if(o.isRoot(n)||o.getPath(n)===o.cwd())return 10}else if(o.isDir(n.mode))return 31;return 0},mayOpen:(r,e)=>r?o.isLink(r.mode)?32:o.isDir(r.mode)&&(o.flagsToPermissionString(e)!=="r"||512&e)?31:o.nodePermissions(r,o.flagsToPermissionString(e)):44,MAX_OPEN_FDS:4096,nextfd(){for(var r=0;r<=o.MAX_OPEN_FDS;r++)if(!o.streams[r])return r;throw new o.ErrnoError(33)},getStreamChecked(r){var e=o.getStream(r);if(!e)throw new o.ErrnoError(8);return e},getStream:r=>o.streams[r],createStream:(r,e=-1)=>(o.FSStream||(o.FSStream=function(){this.shared={}},o.FSStream.prototype={},Object.defineProperties(o.FSStream.prototype,{object:{get(){return this.node},set(t){this.node=t}},isRead:{get(){return(2097155&this.flags)!=1}},isWrite:{get(){return(2097155&this.flags)!=0}},isAppend:{get(){return 1024&this.flags}},flags:{get(){return this.shared.flags},set(t){this.shared.flags=t}},position:{get(){return this.shared.position},set(t){this.shared.position=t}}})),r=Object.assign(new o.FSStream,r),e==-1&&(e=o.nextfd()),r.fd=e,o.streams[e]=r,r),closeStream(r){o.streams[r]=null},chrdev_stream_ops:{open(r){var e=o.getDevice(r.node.rdev);r.stream_ops=e.stream_ops,r.stream_ops.open&&r.stream_ops.open(r)},llseek(){throw new o.ErrnoError(70)}},major:r=>r>>8,minor:r=>255&r,makedev:(r,e)=>r<<8|e,registerDevice(r,e){o.devices[r]={stream_ops:e}},getDevice:r=>o.devices[r],getMounts(r){for(var e=[],t=[r];t.length;){var n=t.pop();e.push(n),t.push.apply(t,n.mounts)}return e},syncfs(r,e){typeof r=="function"&&(e=r,r=!1),o.syncFSRequests++,o.syncFSRequests>1&&Y(`warning: ${o.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=o.getMounts(o.root.mount),n=0;function a(s){return o.syncFSRequests--,e(s)}function i(s){if(s)return i.errored?void 0:(i.errored=!0,a(s));++n>=t.length&&a(null)}t.forEach(s=>{if(!s.type.syncfs)return i(null);s.type.syncfs(s,r,i)})},mount(r,e,t){var n,a=t==="/",i=!t;if(a&&o.root)throw new o.ErrnoError(10);if(!a&&!i){var s=o.lookupPath(t,{follow_mount:!1});if(t=s.path,n=s.node,o.isMountpoint(n))throw new o.ErrnoError(10);if(!o.isDir(n.mode))throw new o.ErrnoError(54)}var u={type:r,opts:e,mountpoint:t,mounts:[]},d=r.mount(u);return d.mount=u,u.root=d,a?o.root=d:n&&(n.mounted=u,n.mount&&n.mount.mounts.push(u)),d},unmount(r){var e=o.lookupPath(r,{follow_mount:!1});if(!o.isMountpoint(e.node))throw new o.ErrnoError(28);var t=e.node,n=t.mounted,a=o.getMounts(n);Object.keys(o.nameTable).forEach(s=>{for(var u=o.nameTable[s];u;){var d=u.name_next;a.includes(u.mount)&&o.destroyNode(u),u=d}}),t.mounted=null;var i=t.mount.mounts.indexOf(n);t.mount.mounts.splice(i,1)},lookup:(r,e)=>r.node_ops.lookup(r,e),mknod(r,e,t){var n=o.lookupPath(r,{parent:!0}).node,a=b.basename(r);if(!a||a==="."||a==="..")throw new o.ErrnoError(28);var i=o.mayCreate(n,a);if(i)throw new o.ErrnoError(i);if(!n.node_ops.mknod)throw new o.ErrnoError(63);return n.node_ops.mknod(n,a,e,t)},create:(r,e)=>(e=e!==void 0?e:438,e&=4095,e|=32768,o.mknod(r,e,0)),mkdir:(r,e)=>(e=e!==void 0?e:511,e&=1023,e|=16384,o.mknod(r,e,0)),mkdirTree(r,e){for(var t=r.split("/"),n="",a=0;a(t===void 0&&(t=e,e=438),e|=8192,o.mknod(r,e,t)),symlink(r,e){if(!L.resolve(r))throw new o.ErrnoError(44);var t=o.lookupPath(e,{parent:!0}).node;if(!t)throw new o.ErrnoError(44);var n=b.basename(e),a=o.mayCreate(t,n);if(a)throw new o.ErrnoError(a);if(!t.node_ops.symlink)throw new o.ErrnoError(63);return t.node_ops.symlink(t,n,r)},rename(r,e){var t,n,a=b.dirname(r),i=b.dirname(e),s=b.basename(r),u=b.basename(e);if(t=o.lookupPath(r,{parent:!0}).node,n=o.lookupPath(e,{parent:!0}).node,!t||!n)throw new o.ErrnoError(44);if(t.mount!==n.mount)throw new o.ErrnoError(75);var d,c=o.lookupNode(t,s),m=L.relative(r,i);if(m.charAt(0)!==".")throw new o.ErrnoError(28);if((m=L.relative(e,a)).charAt(0)!==".")throw new o.ErrnoError(55);try{d=o.lookupNode(n,u)}catch{}if(c!==d){var h=o.isDir(c.mode),p=o.mayDelete(t,s,h);if(p)throw new o.ErrnoError(p);if(p=d?o.mayDelete(n,u,h):o.mayCreate(n,u))throw new o.ErrnoError(p);if(!t.node_ops.rename)throw new o.ErrnoError(63);if(o.isMountpoint(c)||d&&o.isMountpoint(d))throw new o.ErrnoError(10);if(n!==t&&(p=o.nodePermissions(t,"w")))throw new o.ErrnoError(p);o.hashRemoveNode(c);try{t.node_ops.rename(c,n,u)}catch(_){throw _}finally{o.hashAddNode(c)}}},rmdir(r){var e=o.lookupPath(r,{parent:!0}).node,t=b.basename(r),n=o.lookupNode(e,t),a=o.mayDelete(e,t,!0);if(a)throw new o.ErrnoError(a);if(!e.node_ops.rmdir)throw new o.ErrnoError(63);if(o.isMountpoint(n))throw new o.ErrnoError(10);e.node_ops.rmdir(e,t),o.destroyNode(n)},readdir(r){var e=o.lookupPath(r,{follow:!0}).node;if(!e.node_ops.readdir)throw new o.ErrnoError(54);return e.node_ops.readdir(e)},unlink(r){var e=o.lookupPath(r,{parent:!0}).node;if(!e)throw new o.ErrnoError(44);var t=b.basename(r),n=o.lookupNode(e,t),a=o.mayDelete(e,t,!1);if(a)throw new o.ErrnoError(a);if(!e.node_ops.unlink)throw new o.ErrnoError(63);if(o.isMountpoint(n))throw new o.ErrnoError(10);e.node_ops.unlink(e,t),o.destroyNode(n)},readlink(r){var e=o.lookupPath(r).node;if(!e)throw new o.ErrnoError(44);if(!e.node_ops.readlink)throw new o.ErrnoError(28);return L.resolve(o.getPath(e.parent),e.node_ops.readlink(e))},stat(r,e){var t=o.lookupPath(r,{follow:!e}).node;if(!t)throw new o.ErrnoError(44);if(!t.node_ops.getattr)throw new o.ErrnoError(63);return t.node_ops.getattr(t)},lstat:r=>o.stat(r,!0),chmod(r,e,t){var n;if(!(n=typeof r=="string"?o.lookupPath(r,{follow:!t}).node:r).node_ops.setattr)throw new o.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,timestamp:Date.now()})},lchmod(r,e){o.chmod(r,e,!0)},fchmod(r,e){var t=o.getStreamChecked(r);o.chmod(t.node,e)},chown(r,e,t,n){var a;if(!(a=typeof r=="string"?o.lookupPath(r,{follow:!n}).node:r).node_ops.setattr)throw new o.ErrnoError(63);a.node_ops.setattr(a,{timestamp:Date.now()})},lchown(r,e,t){o.chown(r,e,t,!0)},fchown(r,e,t){var n=o.getStreamChecked(r);o.chown(n.node,e,t)},truncate(r,e){if(e<0)throw new o.ErrnoError(28);var t;if(!(t=typeof r=="string"?o.lookupPath(r,{follow:!0}).node:r).node_ops.setattr)throw new o.ErrnoError(63);if(o.isDir(t.mode))throw new o.ErrnoError(31);if(!o.isFile(t.mode))throw new o.ErrnoError(28);var n=o.nodePermissions(t,"w");if(n)throw new o.ErrnoError(n);t.node_ops.setattr(t,{size:e,timestamp:Date.now()})},ftruncate(r,e){var t=o.getStreamChecked(r);if(!(2097155&t.flags))throw new o.ErrnoError(28);o.truncate(t.node,e)},utime(r,e,t){var n=o.lookupPath(r,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(e,t)})},open(r,e,t){if(r==="")throw new o.ErrnoError(44);var n;if(t=t===void 0?438:t,t=64&(e=typeof e=="string"?Qe(e):e)?4095&t|32768:0,typeof r=="object")n=r;else{r=b.normalize(r);try{n=o.lookupPath(r,{follow:!(131072&e)}).node}catch{}}var a=!1;if(64&e)if(n){if(128&e)throw new o.ErrnoError(20)}else n=o.mknod(r,t,0),a=!0;if(!n)throw new o.ErrnoError(44);if(o.isChrdev(n.mode)&&(e&=-513),65536&e&&!o.isDir(n.mode))throw new o.ErrnoError(54);if(!a){var i=o.mayOpen(n,e);if(i)throw new o.ErrnoError(i)}512&e&&!a&&o.truncate(n,0),e&=-131713;var s=o.createStream({node:n,path:o.getPath(n),flags:e,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!l.logReadFiles||1&e||(o.readFiles||(o.readFiles={}),r in o.readFiles||(o.readFiles[r]=1)),s},close(r){if(o.isClosed(r))throw new o.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(e){throw e}finally{o.closeStream(r.fd)}r.fd=null},isClosed:r=>r.fd===null,llseek(r,e,t){if(o.isClosed(r))throw new o.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new o.ErrnoError(70);if(t!=0&&t!=1&&t!=2)throw new o.ErrnoError(28);return r.position=r.stream_ops.llseek(r,e,t),r.ungotten=[],r.position},read(r,e,t,n,a){if(n<0||a<0)throw new o.ErrnoError(28);if(o.isClosed(r))throw new o.ErrnoError(8);if((2097155&r.flags)==1)throw new o.ErrnoError(8);if(o.isDir(r.node.mode))throw new o.ErrnoError(31);if(!r.stream_ops.read)throw new o.ErrnoError(28);var i=a!==void 0;if(i){if(!r.seekable)throw new o.ErrnoError(70)}else a=r.position;var s=r.stream_ops.read(r,e,t,n,a);return i||(r.position+=s),s},write(r,e,t,n,a,i){if(n<0||a<0)throw new o.ErrnoError(28);if(o.isClosed(r))throw new o.ErrnoError(8);if(!(2097155&r.flags))throw new o.ErrnoError(8);if(o.isDir(r.node.mode))throw new o.ErrnoError(31);if(!r.stream_ops.write)throw new o.ErrnoError(28);r.seekable&&1024&r.flags&&o.llseek(r,0,2);var s=a!==void 0;if(s){if(!r.seekable)throw new o.ErrnoError(70)}else a=r.position;var u=r.stream_ops.write(r,e,t,n,a,i);return s||(r.position+=u),u},allocate(r,e,t){if(o.isClosed(r))throw new o.ErrnoError(8);if(e<0||t<=0)throw new o.ErrnoError(28);if(!(2097155&r.flags))throw new o.ErrnoError(8);if(!o.isFile(r.node.mode)&&!o.isDir(r.node.mode))throw new o.ErrnoError(43);if(!r.stream_ops.allocate)throw new o.ErrnoError(138);r.stream_ops.allocate(r,e,t)},mmap(r,e,t,n,a){if(2&n&&!(2&a)&&(2097155&r.flags)!=2)throw new o.ErrnoError(2);if((2097155&r.flags)==1)throw new o.ErrnoError(2);if(!r.stream_ops.mmap)throw new o.ErrnoError(43);return r.stream_ops.mmap(r,e,t,n,a)},msync:(r,e,t,n,a)=>r.stream_ops.msync?r.stream_ops.msync(r,e,t,n,a):0,munmap:r=>0,ioctl(r,e,t){if(!r.stream_ops.ioctl)throw new o.ErrnoError(59);return r.stream_ops.ioctl(r,e,t)},readFile(r,e={}){if(e.flags=e.flags||0,e.encoding=e.encoding||"binary",e.encoding!=="utf8"&&e.encoding!=="binary")throw new Error(`Invalid encoding type "${e.encoding}"`);var t,n=o.open(r,e.flags),a=o.stat(r).size,i=new Uint8Array(a);return o.read(n,i,0,a,0),e.encoding==="utf8"?t=rr(i,0):e.encoding==="binary"&&(t=i),o.close(n),t},writeFile(r,e,t={}){t.flags=t.flags||577;var n=o.open(r,t.flags,t.mode);if(typeof e=="string"){var a=new Uint8Array(Dr(e)+1),i=Pr(e,a,0,a.length);o.write(n,a,0,i,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");o.write(n,e,0,e.byteLength,void 0,t.canOwn)}o.close(n)},cwd:()=>o.currentPath,chdir(r){var e=o.lookupPath(r,{follow:!0});if(e.node===null)throw new o.ErrnoError(44);if(!o.isDir(e.node.mode))throw new o.ErrnoError(54);var t=o.nodePermissions(e.node,"x");if(t)throw new o.ErrnoError(t);o.currentPath=e.path},createDefaultDirectories(){o.mkdir("/tmp"),o.mkdir("/home"),o.mkdir("/home/web_user")},createDefaultDevices(){o.mkdir("/dev"),o.registerDevice(o.makedev(1,3),{read:()=>0,write:(n,a,i,s,u)=>s}),o.mkdev("/dev/null",o.makedev(1,3)),J.register(o.makedev(5,0),J.default_tty_ops),J.register(o.makedev(6,0),J.default_tty1_ops),o.mkdev("/dev/tty",o.makedev(5,0)),o.mkdev("/dev/tty1",o.makedev(6,0));var r=new Uint8Array(1024),e=0,t=()=>(e===0&&(e=ne(r).byteLength),r[--e]);o.createDevice("/dev","random",t),o.createDevice("/dev","urandom",t),o.mkdir("/dev/shm"),o.mkdir("/dev/shm/tmp")},createSpecialDirectories(){o.mkdir("/proc");var r=o.mkdir("/proc/self");o.mkdir("/proc/self/fd"),o.mount({mount(){var e=o.createNode(r,"fd",16895,73);return e.node_ops={lookup(t,n){var a=+n,i=o.getStreamChecked(a),s={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>i.path}};return s.parent=s,s}},e}},{},"/proc/self/fd")},createStandardStreams(){l.stdin?o.createDevice("/dev","stdin",l.stdin):o.symlink("/dev/tty","/dev/stdin"),l.stdout?o.createDevice("/dev","stdout",null,l.stdout):o.symlink("/dev/tty","/dev/stdout"),l.stderr?o.createDevice("/dev","stderr",null,l.stderr):o.symlink("/dev/tty1","/dev/stderr"),o.open("/dev/stdin",0),o.open("/dev/stdout",1),o.open("/dev/stderr",1)},ensureErrnoError(){o.ErrnoError||(o.ErrnoError=function(r,e){this.name="ErrnoError",this.node=e,this.setErrno=function(t){this.errno=t},this.setErrno(r),this.message="FS error"},o.ErrnoError.prototype=new Error,o.ErrnoError.prototype.constructor=o.ErrnoError,[44].forEach(r=>{o.genericErrors[r]=new o.ErrnoError(r),o.genericErrors[r].stack=""}))},staticInit(){o.ensureErrnoError(),o.nameTable=new Array(4096),o.mount(g,{},"/"),o.createDefaultDirectories(),o.createDefaultDevices(),o.createSpecialDirectories(),o.filesystems={MEMFS:g}},init(r,e,t){o.init.initialized=!0,o.ensureErrnoError(),l.stdin=r||l.stdin,l.stdout=e||l.stdout,l.stderr=t||l.stderr,o.createStandardStreams()},quit(){o.init.initialized=!1;for(var r=0;r=k.length)return 0;var T=Math.min(k.length-_,p);if(k.slice)for(var D=0;D{var m=s.stream_ops[c];u[c]=function(){return o.forceLoadFile(s),m.apply(null,arguments)}}),u.read=(c,m,h,p,_)=>(o.forceLoadFile(s),d(c,m,h,p,_)),u.mmap=(c,m,h,p,_)=>{o.forceLoadFile(s);var k=ae();if(!k)throw new o.ErrnoError(48);return d(c,P,k,m,h),{ptr:k,allocated:!0}},s.stream_ops=u,s}},er=(r,e)=>r?rr(C,r,e):"",F={DEFAULT_POLLMASK:5,calculateAt(r,e,t){if(b.isAbs(e))return e;var n;if(n=r===-100?o.cwd():F.getStreamFromFD(r).path,e.length==0){if(!t)throw new o.ErrnoError(44);return n}return b.join2(n,e)},doStat(r,e,t){try{var n=r(e)}catch(u){if(u&&u.node&&b.normalize(e)!==b.normalize(o.getPath(u.node)))return-54;throw u}y[t>>2]=n.dev,y[t+4>>2]=n.mode,w[t+8>>2]=n.nlink,y[t+12>>2]=n.uid,y[t+16>>2]=n.gid,y[t+20>>2]=n.rdev,S=[n.size>>>0,(E=n.size,+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],y[t+24>>2]=S[0],y[t+28>>2]=S[1],y[t+32>>2]=4096,y[t+36>>2]=n.blocks;var a=n.atime.getTime(),i=n.mtime.getTime(),s=n.ctime.getTime();return S=[Math.floor(a/1e3)>>>0,(E=Math.floor(a/1e3),+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],y[t+40>>2]=S[0],y[t+44>>2]=S[1],w[t+48>>2]=a%1e3*1e3,S=[Math.floor(i/1e3)>>>0,(E=Math.floor(i/1e3),+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],y[t+56>>2]=S[0],y[t+60>>2]=S[1],w[t+64>>2]=i%1e3*1e3,S=[Math.floor(s/1e3)>>>0,(E=Math.floor(s/1e3),+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],y[t+72>>2]=S[0],y[t+76>>2]=S[1],w[t+80>>2]=s%1e3*1e3,S=[n.ino>>>0,(E=n.ino,+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],y[t+88>>2]=S[0],y[t+92>>2]=S[1],0},doMsync(r,e,t,n,a){if(!o.isFile(e.node.mode))throw new o.ErrnoError(43);if(2&n)return 0;var i=C.slice(r,r+t);o.msync(e,i,a,t,n)},varargs:void 0,get(){var r=y[+F.varargs>>2];return F.varargs+=4,r},getp:()=>F.get(),getStr:r=>er(r),getStreamFromFD:r=>o.getStreamChecked(r)};function rt(r,e,t){F.varargs=t;try{var n=F.getStreamFromFD(r);switch(e){case 0:if((a=F.get())<0)return-28;for(;o.streams[a];)a++;return o.createStream(n,a).fd;case 1:case 2:case 6:case 7:return 0;case 3:return n.flags;case 4:var a=F.get();return n.flags|=a,0;case 5:return a=F.getp(),q[a+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return Ve(28),-1}}catch(i){if(o===void 0||i.name!=="ErrnoError")throw i;return-i.errno}}function et(r,e,t){F.varargs=t;try{var n=F.getStreamFromFD(r);switch(e){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var a=n.tty.ops.ioctl_tcgets(n),i=F.getp();y[i>>2]=a.c_iflag||0,y[i+4>>2]=a.c_oflag||0,y[i+8>>2]=a.c_cflag||0,y[i+12>>2]=a.c_lflag||0;for(var s=0;s<32;s++)P[i+s+17>>0]=a.c_cc[s]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){i=F.getp();var u=y[i>>2],d=y[i+4>>2],c=y[i+8>>2],m=y[i+12>>2],h=[];for(s=0;s<32;s++)h.push(P[i+s+17>>0]);return n.tty.ops.ioctl_tcsets(n.tty,e,{c_iflag:u,c_oflag:d,c_cflag:c,c_lflag:m,c_cc:h})}return 0;case 21519:return n.tty?(i=F.getp(),y[i>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return i=F.getp(),o.ioctl(n,e,i);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var p=n.tty.ops.ioctl_tiocgwinsz(n.tty);i=F.getp(),q[i>>1]=p[0],q[i+2>>1]=p[1]}return 0;default:return-28}}catch(_){if(o===void 0||_.name!=="ErrnoError")throw _;return-_.errno}}function tt(r,e,t,n){F.varargs=n;try{e=F.getStr(e),e=F.calculateAt(r,e);var a=n?F.get():0;return o.open(e,t,a).fd}catch(i){if(o===void 0||i.name!=="ErrnoError")throw i;return-i.errno}}var pr={},Tr=r=>{for(;r.length;){var e=r.pop();r.pop()(e)}};function Cr(r){return this.fromWireType(y[r>>2])}var ie,se,ue,tr={},Z={},vr={},le=r=>{throw new ie(r)},de=(r,e,t)=>{function n(u){var d=t(u);d.length!==r.length&&le("Mismatched type converter count");for(var c=0;c{Z.hasOwnProperty(u)?a[d]=Z[u]:(i.push(u),tr.hasOwnProperty(u)||(tr[u]=[]),tr[u].push(()=>{a[d]=Z[u],++s===i.length&&n(a)}))}),i.length===0&&n(a)},nt=r=>{var e=pr[r];delete pr[r];var t=e.rawConstructor,n=e.rawDestructor,a=e.fields,i=a.map(s=>s.getterReturnType).concat(a.map(s=>s.setterArgumentType));de([r],i,s=>{var u={};return a.forEach((d,c)=>{var m=d.fieldName,h=s[c],p=d.getter,_=d.getterContext,k=s[c+a.length],T=d.setter,D=d.setterContext;u[m]={read:I=>h.fromWireType(p(_,I)),write:(I,f)=>{var v=[];T(D,I,k.toWireType(v,f)),Tr(v)}}}),[{name:e.name,fromWireType:d=>{var c={};for(var m in u)c[m]=u[m].read(d);return n(d),c},toWireType:(d,c)=>{for(var m in u)if(!(m in c))throw new TypeError(`Missing field: "${m}"`);var h=t();for(m in u)u[m].write(h,c[m]);return d!==null&&d.push(n,h),h},argPackAdvance:X,readValueFromPointer:Cr,destructorFunction:n}]})},ot=(r,e,t,n,a)=>{},at=()=>{for(var r=new Array(256),e=0;e<256;++e)r[e]=String.fromCharCode(e);se=r},M=r=>{for(var e="",t=r;C[t];)e+=se[C[t++]];return e},O=r=>{throw new ue(r)};function it(r,e,t={}){var n=e.name;if(r||O(`type "${n}" must have a positive integer typeid pointer`),Z.hasOwnProperty(r)){if(t.ignoreDuplicateRegistrations)return;O(`Cannot register type '${n}' twice`)}if(Z[r]=e,delete vr[r],tr.hasOwnProperty(r)){var a=tr[r];delete tr[r],a.forEach(i=>i())}}function U(r,e,t={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");return it(r,e,t)}var X=8,st=(r,e,t,n)=>{U(r,{name:e=M(e),fromWireType:function(a){return!!a},toWireType:function(a,i){return i?t:n},argPackAdvance:X,readValueFromPointer:function(a){return this.fromWireType(C[a])},destructorFunction:null})};function ut(){Object.assign(ce.prototype,{get(r){return this.allocated[r]},has(r){return this.allocated[r]!==void 0},allocate(r){var e=this.freelist.pop()||this.allocated.length;return this.allocated[e]=r,e},free(r){this.allocated[r]=void 0,this.freelist.push(r)}})}function ce(){this.allocated=[void 0],this.freelist=[]}var W=new ce,Mr=r=>{r>=W.reserved&&--W.get(r).refcount==0&&W.free(r)},lt=()=>{for(var r=0,e=W.reserved;e{W.allocated.push({value:void 0},{value:null},{value:!0},{value:!1}),W.reserved=W.allocated.length,l.count_emval_handles=lt},$={toValue:r=>(r||O("Cannot use deleted val. handle = "+r),W.get(r).value),toHandle:r=>{switch(r){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return W.allocate({refcount:1,value:r})}}},ct=(r,e)=>{U(r,{name:e=M(e),fromWireType:t=>{var n=$.toValue(t);return Mr(t),n},toWireType:(t,n)=>$.toHandle(n),argPackAdvance:X,readValueFromPointer:Cr,destructorFunction:null})},ft=(r,e)=>{switch(e){case 4:return function(t){return this.fromWireType(qr[t>>2])};case 8:return function(t){return this.fromWireType(Xr[t>>3])};default:throw new TypeError(`invalid float width (${e}): ${r}`)}},mt=(r,e,t)=>{U(r,{name:e=M(e),fromWireType:n=>n,toWireType:(n,a)=>a,argPackAdvance:X,readValueFromPointer:ft(e,t),destructorFunction:null})},ht=48,pt=57,vt=r=>{if(r===void 0)return"_unknown";var e=(r=r.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return e>=ht&&e<=pt?`_${r}`:r};function yt(r,e,t,n,a,i){var s=e.length;s<2&&O("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var u=e[1]!==null&&t!==null,d=!1,c=1;c{if(r[e].overloadTable===void 0){var n=r[e];r[e]=function(){return r[e].overloadTable.hasOwnProperty(arguments.length)||O(`Function '${t}' called with an invalid number of arguments (${arguments.length}) - expects one of (${r[e].overloadTable})!`),r[e].overloadTable[arguments.length].apply(this,arguments)},r[e].overloadTable=[],r[e].overloadTable[n.argCount]=n}},wt=(r,e,t)=>{l.hasOwnProperty(r)?((t===void 0||l[r].overloadTable!==void 0&&l[r].overloadTable[t]!==void 0)&&O(`Cannot register public name '${r}' twice`),gt(l,r,r),l.hasOwnProperty(t)&&O(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),l[r].overloadTable[t]=e):(l[r]=e,t!==void 0&&(l[r].numArguments=t))},_t=(r,e)=>{for(var t=[],n=0;n>2]);return t},Et=(r,e,t)=>{l.hasOwnProperty(r)||le("Replacing nonexistant public symbol"),l[r].overloadTable!==void 0&&t!==void 0?l[r].overloadTable[t]=e:(l[r]=e,l[r].argCount=t)},bt=(r,e,t)=>{var n=l["dynCall_"+r];return t&&t.length?n.apply(null,[e].concat(t)):n.call(null,e)},ur=[],R=r=>{var e=ur[r];return e||(r>=ur.length&&(ur.length=r+1),ur[r]=e=K.get(r)),e},kt=(r,e,t)=>r.includes("j")?bt(r,e,t):R(e).apply(null,t),Ft=(r,e)=>{var t=[];return function(){return t.length=0,Object.assign(t,arguments),kt(r,e,t)}},lr=(r,e)=>{function t(){return r.includes("j")?Ft(r,e):R(e)}r=M(r);var n=t();return typeof n!="function"&&O(`unknown function pointer with signature ${r}: ${e}`),n};function At(r,e){return{[r=vt(r)]:function(){return e.apply(this,arguments)}}[r]}var fe,Dt=(r,e)=>{var t=At(e,function(n){this.name=e,this.message=n;var a=new Error(n).stack;a!==void 0&&(this.stack=this.toString()+` `+a.replace(/^Error(:[^\n]*)?\n/,""))});return t.prototype=Object.create(r.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},t},me=r=>{var e=ke(r),t=M(e);return H(e),t},Pt=(r,e)=>{var t=[],n={};function a(i){n[i]||Z[i]||(vr[i]?vr[i].forEach(a):(t.push(i),n[i]=!0))}throw e.forEach(a),new fe(`${r}: `+t.map(me).join([", "]))},St=r=>{const e=(r=r.trim()).indexOf("(");return e!==-1?(Gr(r[r.length-1]==")","Parentheses for argument names should match."),r.substr(0,e)):r},$t=(r,e,t,n,a,i,s)=>{var u=_t(e,t);r=M(r),r=St(r),a=lr(n,a),wt(r,function(){Pt(`Cannot call ${r} due to unbound types`,u)},e-1),de([],u,function(d){var c=[d[0],null].concat(d.slice(1));return Et(r,yt(r,c,null,a,i),e-1),[]})},Tt=(r,e,t)=>{switch(e){case 1:return t?n=>P[n>>0]:n=>C[n>>0];case 2:return t?n=>q[n>>1]:n=>mr[n>>1];case 4:return t?n=>y[n>>2]:n=>w[n>>2];default:throw new TypeError(`invalid integer width (${e}): ${r}`)}},Ct=(r,e,t,n,a)=>{e=M(e);var i=c=>c;if(n===0){var s=32-8*t;i=c=>c<>>s}var u=e.includes("unsigned"),d=(c,m)=>{};U(r,{name:e,fromWireType:i,toWireType:u?function(c,m){return d(m,this.name),m>>>0}:function(c,m){return d(m,this.name),m},argPackAdvance:X,readValueFromPointer:Tt(e,t,n!==0),destructorFunction:null})},Mt=(r,e,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];function a(i){var s=w[i>>2],u=w[i+4>>2];return new n(P.buffer,u,s)}U(r,{name:t=M(t),fromWireType:a,argPackAdvance:X,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})};function jt(r){return this.fromWireType(w[r>>2])}var xt=(r,e,t)=>Pr(r,C,e,t),Ot=(r,e)=>{var t=(e=M(e))==="std::string";U(r,{name:e,fromWireType(n){var a,i=w[n>>2],s=n+4;if(t)for(var u=s,d=0;d<=i;++d){var c=s+d;if(d==i||C[c]==0){var m=er(u,c-u);a===void 0?a=m:(a+="\0",a+=m),u=c+1}}else{var h=new Array(i);for(d=0;d>2]=i,t&&s)xt(a,d,i+1);else if(s)for(var c=0;c255&&(H(d),O("String has UTF-16 code units that do not fit in 8 bits")),C[d+c]=m}else for(c=0;c{for(var t=r,n=t>>1,a=n+e/2;!(n>=a)&&mr[n];)++n;if((t=n<<1)-r>32&&he)return he.decode(C.subarray(r,t));for(var i="",s=0;!(s>=e/2);++s){var u=q[r+2*s>>1];if(u==0)break;i+=String.fromCharCode(u)}return i},Wt=(r,e,t)=>{if(t===void 0&&(t=2147483647),t<2)return 0;for(var n=e,a=(t-=2)<2*r.length?t/2:r.length,i=0;i>1]=s,e+=2}return q[e>>1]=0,e-n},zt=r=>2*r.length,Nt=(r,e)=>{for(var t=0,n="";!(t>=e/4);){var a=y[r+4*t>>2];if(a==0)break;if(++t,a>=65536){var i=a-65536;n+=String.fromCharCode(55296|i>>10,56320|1023&i)}else n+=String.fromCharCode(a)}return n},Bt=(r,e,t)=>{if(t===void 0&&(t=2147483647),t<4)return 0;for(var n=e,a=n+t-4,i=0;i=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&r.charCodeAt(++i)),y[e>>2]=s,(e+=4)+4>a)break}return y[e>>2]=0,e-n},Lt=r=>{for(var e=0,t=0;t=55296&&n<=57343&&++t,e+=4}return e},Ut=(r,e,t)=>{var n,a,i,s,u;t=M(t),e===2?(n=Rt,a=Wt,s=zt,i=()=>mr,u=1):e===4&&(n=Nt,a=Bt,s=Lt,i=()=>w,u=2),U(r,{name:t,fromWireType:d=>{for(var c,m=w[d>>2],h=i(),p=d+4,_=0;_<=m;++_){var k=d+4+_*e;if(_==m||h[k>>u]==0){var T=n(p,k-p);c===void 0?c=T:(c+="\0",c+=T),p=k+e}}return H(d),c},toWireType:(d,c)=>{typeof c!="string"&&O(`Cannot pass non-string to C++ string type ${t}`);var m=s(c),h=Wr(4+m+e);return w[h>>2]=m>>u,a(c,h+4,m+e),d!==null&&d.push(H,h),h},argPackAdvance:X,readValueFromPointer:Cr,destructorFunction(d){H(d)}})},Ht=(r,e,t,n,a,i)=>{pr[r]={name:M(e),rawConstructor:lr(t,n),rawDestructor:lr(a,i),fields:[]}},It=(r,e,t,n,a,i,s,u,d,c)=>{pr[r].fields.push({fieldName:M(e),getterReturnType:t,getter:lr(n,a),getterContext:i,setterArgumentType:s,setter:lr(u,d),setterContext:c})},Vt=(r,e)=>{U(r,{isVoid:!0,name:e=M(e),argPackAdvance:0,fromWireType:()=>{},toWireType:(t,n)=>{}})},Yt=r=>{do{var e=w[r>>2],t=w[(r+=4)>>2],n=w[(r+=4)>>2];r+=4;var a=er(e);o.createPath("/",b.dirname(a),!0,!0),o.createDataFile(a,null,P.subarray(n,n+t),!0,!0,!0)}while(w[r>>2])},qt=()=>{throw 1/0},jr=(r,e)=>{var t=Z[r];return t===void 0&&O(e+" has unknown type "+me(r)),t},Xt=(r,e,t)=>{r=$.toValue(r),e=jr(e,"emval::as");var n=[],a=$.toHandle(n);return w[t>>2]=a,e.toWireType(n,r)},Gt={},xr=r=>{var e=Gt[r];return e===void 0?M(r):e},Or=[],Jt=(r,e,t,n,a)=>{var i=[],s=(r=Or[r])(e=$.toValue(e),t=xr(t),i,a);return i.length&&(w[n>>2]=$.toHandle(i)),s},pe=()=>{if(typeof globalThis=="object")return globalThis;function r(e){e.$$$embind_global$$$=e;var t=typeof $$$embind_global$$$=="object"&&e.$$$embind_global$$$==e;return t||delete e.$$$embind_global$$$,t}if(typeof $$$embind_global$$$=="object"||(typeof zr=="object"&&r(zr)?$$$embind_global$$$=zr:typeof self=="object"&&r(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},Zt=r=>r===0?$.toHandle(pe()):(r=xr(r),$.toHandle(pe()[r])),Kt=r=>{var e=Or.length;return Or.push(r),e},Qt=(r,e)=>{for(var t=new Array(r),n=0;n>2],"parameter "+n);return t},rn=(r,e)=>{var t=Qt(r,e),n=t.shift();r--;var a=new Array(r);return Kt((i,s,u,d)=>{for(var c=0,m=0;m(r=$.toValue(r),e=$.toValue(e),$.toHandle(r[e])),tn=r=>{r>4&&(W.get(r).refcount+=1)},nn=()=>$.toHandle([]),on=r=>$.toHandle(xr(r)),an=r=>{var e=$.toValue(r);Tr(e),Mr(r)},sn=(r,e,t)=>{r=$.toValue(r),e=$.toValue(e),t=$.toValue(t),r[e]=t},un=(r,e)=>{var t=(r=jr(r,"_emval_take_value")).readValueFromPointer(e);return $.toHandle(t)},ln=()=>{Q("")},dn=(r,e,t)=>C.copyWithin(r,e,e+t),cn=()=>2147483648,fn=r=>{var e=(r-fr.buffer.byteLength+65535)/65536;try{return fr.grow(e),Jr(),1}catch{}},mn=r=>{var e=C.length;r>>>=0;var t=cn();if(r>t)return!1;for(var n=(u,d)=>u+(d-u%d)%d,a=1;a<=4;a*=2){var i=e*(1+.2/a);i=Math.min(i,r+100663296);var s=Math.min(t,n(Math.max(r,i),65536));if(fn(s))return!0}return!1},Rr={},hn=()=>Ir||"./this.program",dr=()=>{if(!dr.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:hn()};for(var e in Rr)Rr[e]===void 0?delete r[e]:r[e]=Rr[e];var t=[];for(var e in r)t.push(`${e}=${r[e]}`);dr.strings=t}return dr.strings},pn=(r,e)=>{for(var t=0;t>0]=r.charCodeAt(t);P[e>>0]=0},vn=(r,e)=>{var t=0;return dr().forEach((n,a)=>{var i=e+t;w[r+4*a>>2]=i,pn(n,i),t+=n.length+1}),0},yn=(r,e)=>{var t=dr();w[r>>2]=t.length;var n=0;return t.forEach(a=>n+=a.length+1),w[e>>2]=n,0},gn=0,wn=()=>Ue||gn>0,_n=r=>{wn()||(l.onExit&&l.onExit(r),kr=!0),Vr(r,new Le(r))},En=(r,e)=>{_n(r)};function bn(r){try{var e=F.getStreamFromFD(r);return o.close(e),0}catch(t){if(o===void 0||t.name!=="ErrnoError")throw t;return t.errno}}var kn=(r,e,t,n)=>{for(var a=0,i=0;i>2],u=w[e+4>>2];e+=8;var d=o.read(r,P,s,u,n);if(d<0)return-1;if(a+=d,d>2]=i,0}catch(s){if(o===void 0||s.name!=="ErrnoError")throw s;return s.errno}}var An=(r,e)=>e+2097152>>>0<4194305-!!r?(r>>>0)+4294967296*e:NaN;function Dn(r,e,t,n,a){var i=An(e,t);try{if(isNaN(i))return 61;var s=F.getStreamFromFD(r);return o.llseek(s,i,n),S=[s.position>>>0,(E=s.position,+Math.abs(E)>=1?E>0?+Math.floor(E/4294967296)>>>0:~~+Math.ceil((E-+(~~E>>>0))/4294967296)>>>0:0)],y[a>>2]=S[0],y[a+4>>2]=S[1],s.getdents&&i===0&&n===0&&(s.getdents=null),0}catch(u){if(o===void 0||u.name!=="ErrnoError")throw u;return u.errno}}var Pn=(r,e,t,n)=>{for(var a=0,i=0;i>2],u=w[e+4>>2];e+=8;var d=o.write(r,P,s,u,n);if(d<0)return-1;a+=d,n!==void 0&&(n+=d)}return a};function Sn(r,e,t,n){try{var a=F.getStreamFromFD(r),i=Pn(a,e,t);return w[n>>2]=i,0}catch(s){if(o===void 0||s.name!=="ErrnoError")throw s;return s.errno}}var nr,yr=r=>r%4==0&&(r%100!=0||r%400==0),$n=(r,e)=>{for(var t=0,n=0;n<=e;t+=r[n++]);return t},ve=[31,29,31,30,31,30,31,31,30,31,30,31],ye=[31,28,31,30,31,30,31,31,30,31,30,31],Tn=(r,e)=>{for(var t=new Date(r.getTime());e>0;){var n=yr(t.getFullYear()),a=t.getMonth(),i=(n?ve:ye)[a];if(!(e>i-t.getDate()))return t.setDate(t.getDate()+e),t;e-=i-t.getDate()+1,t.setDate(1),a<11?t.setMonth(a+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return t},Cn=(r,e)=>{P.set(r,e)},Mn=(r,e,t,n)=>{var a=w[n+40>>2],i={tm_sec:y[n>>2],tm_min:y[n+4>>2],tm_hour:y[n+8>>2],tm_mday:y[n+12>>2],tm_mon:y[n+16>>2],tm_year:y[n+20>>2],tm_wday:y[n+24>>2],tm_yday:y[n+28>>2],tm_isdst:y[n+32>>2],tm_gmtoff:y[n+36>>2],tm_zone:a?er(a):""},s=er(t),u={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var d in u)s=s.replace(new RegExp(d,"g"),u[d]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],m=["January","February","March","April","May","June","July","August","September","October","November","December"];function h(f,v,j){for(var x=typeof f=="number"?f.toString():f||"";x.length0?1:0}var x;return(x=j(f.getFullYear()-v.getFullYear()))===0&&(x=j(f.getMonth()-v.getMonth()))===0&&(x=j(f.getDate()-v.getDate())),x}function k(f){switch(f.getDay()){case 0:return new Date(f.getFullYear()-1,11,29);case 1:return f;case 2:return new Date(f.getFullYear(),0,3);case 3:return new Date(f.getFullYear(),0,2);case 4:return new Date(f.getFullYear(),0,1);case 5:return new Date(f.getFullYear()-1,11,31);case 6:return new Date(f.getFullYear()-1,11,30)}}function T(f){var v=Tn(new Date(f.tm_year+1900,0,1),f.tm_yday),j=new Date(v.getFullYear(),0,4),x=new Date(v.getFullYear()+1,0,4),Er=k(j),Kn=k(x);return _(Er,v)<=0?_(Kn,v)<=0?v.getFullYear()+1:v.getFullYear():v.getFullYear()-1}var D={"%a":f=>c[f.tm_wday].substring(0,3),"%A":f=>c[f.tm_wday],"%b":f=>m[f.tm_mon].substring(0,3),"%B":f=>m[f.tm_mon],"%C":f=>p((f.tm_year+1900)/100|0,2),"%d":f=>p(f.tm_mday,2),"%e":f=>h(f.tm_mday,2," "),"%g":f=>T(f).toString().substring(2),"%G":f=>T(f),"%H":f=>p(f.tm_hour,2),"%I":f=>{var v=f.tm_hour;return v==0?v=12:v>12&&(v-=12),p(v,2)},"%j":f=>p(f.tm_mday+$n(yr(f.tm_year+1900)?ve:ye,f.tm_mon-1),3),"%m":f=>p(f.tm_mon+1,2),"%M":f=>p(f.tm_min,2),"%n":()=>` diff --git a/assets/mapViewDeps-pgi5I2eW.js b/assets/mapViewDeps-B6Hg404o.js similarity index 98% rename from assets/mapViewDeps-pgi5I2eW.js rename to assets/mapViewDeps-B6Hg404o.js index 858d005..8be0917 100644 --- a/assets/mapViewDeps-pgi5I2eW.js +++ b/assets/mapViewDeps-B6Hg404o.js @@ -1,4 +1,4 @@ -import{eQ as $t,l8 as xe,iU as zt,aV as Ft,bh as ie,s as Ne,bg as Dt,lA as Lt,ca as Nt,eA as Ke,eF as Ut,fW as Vt,E as H,lB as Gt,lC as Ht,lD as Wt,gz as qt,lE as jt,lF as Xt,lG as A,fV as S,g4 as v,g3 as ne,fX as Ue,v as C,D as E,eN as Yt,M as de,ia as Kt,jj as Jt,$ as j,N as re,lH as Te,kg as Qt,at as Ve,b as Je,bE as Zt,lI as ei,lJ as Qe,L as D,lK as ti,df as ii,eG as ri,lL as si,lM as ai,cy as Ce,eO as Ge,hf as $e,iS as Ee,fg as Re,ju as ni,f_ as Ze,eK as oi,eI as li,j8 as hi,ja as ci,g6 as De,lN as he,iv as et,g5 as Le,iR as ui,is as He,lO as Bt,U as We,iB as di,he as tt,hc as ze,ji as pi,lP as _i,lQ as mi,jl as it,lR as fi,l as gi,lS as yi,_ as rt,jm as vi,u as bi,eC as wi,g as Fe,P as xi,I as st,cE as Mi,lT as Oi}from"./index-CEWggaxV.js";import{aU as at,aV as Pi,K as ae,aW as Si,t as Ti,aX as Ci,aY as Ei}from"./UpdateTracking2D-nj9Q-3df.js";import{o as Ri,f as F,B as zi,b as Fi,p as ge,I as O,D as Be,h as se,L as ye,T as ke,x as nt,w as Bi,P as ki,A as Ai,F as Ii,E as $i,z as kt,t as B,u as Di}from"./utils-p-5Bbga5.js";import{f as ce}from"./OverrideHelper-B4ryGWZb.js";import{f as ot,m as lt,e as Li,a as Ni}from"./SDFHelper-CSK796Wb.js";import{A as ve,E as L,t as Ui,g as Vi,o as ht,h as Gi,i as Hi}from"./Container-CB7SlLB9.js";import{d as Wi,e as ct,a as Q,c as ut,h as dt,i as qi,m as ji}from"./WGLContainer-B_Pv-8Yi.js";import{a as Xi,e as Me,o as qe}from"./ProgramTemplate-BICQrNzS.js";import{glslifyDefineMap as Pe}from"./webglDeps-BqalI_vm.js";import{e as pt,r as Yi,t as Ki,a as Ji,n as Qi,b as Zi,c as er}from"./MagnifierPrograms-B5-grLP-.js";import{d as cn,f as un}from"./MagnifierPrograms-B5-grLP-.js";import{h as je,x as N,i as Xe,s as tr}from"./Program-DLRmaKpw.js";import{o as ir,w as rr}from"./RenderingContext-2weDpoeh.js";import{p as sr,s as ar}from"./imageUtils-DNanu5Rn.js";import{e as nr,i as or}from"./rasterizingUtils-DXTinem2.js";import{t as $}from"./Rect-CUzevAry.js";import{e as R,m as X}from"./Texture-DJgkMrSB.js";import{n as _t}from"./pbf-D9QZb8S8.js";import{o as lr}from"./floatRGBA-BLm-Rhaq.js";import{j as hr,M as cr,y as ur}from"./LabelMetric-D2hbzzy_.js";import{f as dr}from"./utils-CJVw5T-r.js";import{F as pr,T as _r}from"./FeatureCommandQueue-Btq_FXyi.js";import{$ as pn}from"./GraphicsView2D-DbbthiwV.js";import{t as mn}from"./GraphicContainer-CbvswCG0.js";import{t as mt}from"./requestImageUtils-Dzwz9ori.js";import"./TurboLine-CkxIB4ZX.js";import"./earcut-hRlx3adE.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./labelUtils-Dnqx6jl5.js";import"./defaultsJSON-CHAaurhX.js";import"./BindType-BmZEZMMh.js";import"./Util-BS8sJGjF.js";import"./highlightReasons-DbgbcWKM.js";import"./constants-D5zmR9t2.js";import"./quantizationUtils-CUjGHrU3.js";import"./config-MDUrh2eL.js";import"./featureConversionUtils-CmP9mw0r.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./NestedMap-DgiGbX8E.js";import"./CircularArray-DfLrgW_-.js";import"./testSVGPremultipliedAlpha-B0ipOzbU.js";import"./AttributeStore-Ck-75lnq.js";import"./FieldsIndex-CLgRNeJ_.js";import"./UnknownTimeZone-DF0BqWCR.js";import"./TimeOnly-Cm47ew5I.js";import"./timeSupport-BjRbXIpn.js";import"./json-Wa8cmqdu.js";import"./diffUtils-B4YFa5Ju.js";import"./OrderIndependentTransparency-C747AfeB.js";import"./basicInterfaces-GbxEOYtk.js";import"./doublePrecisionUtils-B0owpBza.js";import"./normalizeUtilsSync-B6VufdiX.js";import"./AGraphicContainer-Dby-baET.js";import"./TechniqueInstance-CSsTmbek.js";import"./TileContainer-Ci6dOowA.js";import"./vec3f32-nZdmKIgz.js";const mr=()=>Ne.getLogger("esri.symbols.cim.cimAnalyzer");function fr(u){const e=u.markerPlacement;return e&&e.angleToLine?xe.MAP:xe.SCREEN}class gr{constructor(e){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[],e&&(this._resourceManager=e)}analyzeSymbolReference(e,t,i){if(this._cimLayers=i??[],!e)return this._cimLayers;if(this._reset(),e.primitiveOverrides){this._primitiveOverrides=e.primitiveOverrides;for(const r of this._primitiveOverrides){const a=r.valueExpressionInfo;if(a)this._setPoMap(r.primitiveName,r.propertyName,a);else if(r.value!=null){let s=r.value;r.propertyName.includes("Color")&&($t(s)&&(s=Ri(s)),s=F(s)),this._setPoMap(r.primitiveName,r.propertyName,s)}}}return this._analyzeSymbol(e.symbol,t),this._cimLayers}_reset(){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[]}_analyzeSymbol(e,t){switch(e==null?void 0:e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this._analyzeMultiLayerSymbol(e,t)}}_analyzeMultiLayerSymbol(e,t){const i=e==null?void 0:e.symbolLayers;if(!i)return;const r=e.effects;let a=xe.SCREEN;const s=zi(e)??0;e.type==="CIMPointSymbol"&&e.angleAlignment==="Map"&&(a=xe.MAP);const n=e.type==="CIMPolygonSymbol";let o=i.length;for(;o--;){const l=i[o];if(!l||l.enable===!1)continue;let h;r!=null&&r.length&&(h=[...r]);const c=l.effects;c!=null&&c.length&&(r?h.push(...c):h=[...c]);let d=null;if(h){d=[];for(const _ of h){const f=ce.findEffectOverrides(_,this._primitiveOverrides);f&&d.push(f)}}const p=[];switch(ce.findApplicableOverrides(l,this._primitiveOverrides,p),l.type){case"CIMSolidFill":this._analyzeSolidFill(l,d);break;case"CIMPictureFill":this._analyzePictureFill(l,d);break;case"CIMHatchFill":this._analyzeHatchFill(l,d);break;case"CIMGradientFill":this._analyzeGradientFill(l,d);break;case"CIMSolidStroke":this._analyzeSolidStroke(l,d,n,s);break;case"CIMPictureStroke":this._analyzePictureStroke(l,d,n,s);break;case"CIMGradientStroke":this._analyzeGradientStroke(l,d,n,s);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":{e.type!=="CIMLineSymbol"&&e.type!=="CIMPolygonSymbol"||(a=fr(l));const _=[],f=l.primitiveName;f&&_.push(f);const g=n&&Fi(l.markerPlacement);this._analyzeMarker(l,d,null,_,a,s,t,[],!1,g);break}default:mr().error("Cannot analyze CIM layer",l.type)}}}_analyzeSolidFill(e,t){const{primitiveName:i,type:r}=e,a=F(e.color);this._cimLayers.push({type:"fill",spriteRasterizationParam:null,colorLocked:!!e.colorLocked,color:this._getValueOrOverrideExpression(r,i,"Color",a),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:t,applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!1})}_analyzePictureFill(e,t){const{primitiveName:i,type:r}=e,a=ge(e),s=O(e.height,B.CIMPictureFill.height);let n=O(e.scaleX,1);if("width"in e&&typeof e.width=="number"){const l=e.width;let h=1;const c=this._resourceManager.getResource(e.url);c!=null&&(h=c.width/c.height),n/=h*(s/l)}const o={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(i,r)};this._cimLayers.push({type:"fill",spriteRasterizationParam:o,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(r,i,"TintColor",a),height:this._getValueOrOverrideExpression(r,i,"Height",s),scaleX:this._getValueOrOverrideExpression(r,i,"ScaleX",n),angle:this._getValueOrOverrideExpression(r,i,"Rotation",O(e.rotation)),offsetX:this._getValueOrOverrideExpression(r,i,"OffsetX",O(e.offsetX)),offsetY:this._getValueOrOverrideExpression(r,i,"OffsetY",O(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1})}_analyzeHatchFill(e,t){var h,c,d;const{primitiveName:i,type:r}=e,a=this._analyzeMaterialOverrides(i,["Rotation","OffsetX","OffsetY"]),s=this._normalizePrimitiveOverrideProps(a);let n=[255,255,255,1],o=!1;if((h=e.lineSymbol)!=null&&h.symbolLayers)for(const p of e.lineSymbol.symbolLayers){if(p.type!=="CIMSolidStroke")continue;const _=p.primitiveName??i;o||!_||p.colorLocked||((c=this._poMap[_])==null?void 0:c.Color)==null&&((d=this._poMap[_])==null?void 0:d.StrokeColor)==null||(n=F(p.color),n=this._maybeGetValueOrOverrideExpression(_,"StrokeColor")??this._getValueOrOverrideExpression(r,_,"Color",n),o=!0);const f=this._maybeGetValueOrOverrideExpression(_,"StrokeWidth");if(f){let g=null,y=null;typeof f=="number"?g=f:y=f.valueExpressionInfo;let m=s.find(M=>M.propertyName==="strokeWidth");m?m.propertyName="width":(m={type:"CIMPrimitiveOverride",primitiveName:_,propertyName:"width",valueExpressionInfo:y,value:g,defaultValue:Be(r,"width")},s.push(m))}}const l={type:"sprite-rasterization-param",resource:e,overrides:s};this._cimLayers.push({type:"fill",spriteRasterizationParam:l,colorLocked:!!e.colorLocked,effects:t,color:n,height:this._getValueOrOverrideExpression(r,i,"Separation",O(e.separation,B.CIMHatchFill.separation)),scaleX:1,angle:this._getValueOrOverrideExpression(r,i,"Rotation",O(e.rotation)),offsetX:this._getValueOrOverrideExpression(r,i,"OffsetX",O(e.offsetX)),offsetY:this._getValueOrOverrideExpression(r,i,"OffsetY",O(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!o})}_analyzeGradientFill(e,t){this._cimLayers.push({type:"fill",spriteRasterizationParam:null,colorLocked:!!e.colorLocked,effects:t,color:[128,128,128,1],height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1})}_analyzeSolidStroke(e,t,i,r){const{primitiveName:a,type:s}=e,n=F(e.color),o=O(e.width,B.CIMSolidStroke.width),l=se(e.capStyle,B.CIMSolidStroke.capstyle),h=se(e.joinStyle,B.CIMSolidStroke.joinstyle),c=e.miterLimit;let d,p,_=[];if(this._analyzePrimitiveOverrides(a,t,null,null)&&(_=this._getPrimitiveMaterialOverrides(a,s)),t&&t instanceof Array&&t.length>0){const g=t[t.length-1].effect;g&&g.type==="CIMGeometricEffectDashes"&&g.lineDashEnding==="NoConstraint"&&g.offsetAlongLine===null&&(d=g.dashTemplate,p=g.scaleDash,(t=[...t]).pop())}const f=d!==void 0?{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:d,capStyle:l},overrides:_}:null;this._cimLayers.push({type:"line",spriteRasterizationParam:f,isOutline:i,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(s,a,"Color",n),width:this._getValueOrOverrideExpression(s,a,"Width",o),cap:this._getValueOrOverrideExpression(s,a,"CapStyle",l),join:this._getValueOrOverrideExpression(s,a,"JoinStyle",h),miterLimit:c&&this._getValueOrOverrideExpression(s,a,"MiterLimit",c),referenceWidth:r,zOrder:Ae(e.name),dashTemplate:d,scaleDash:p,sampleAlphaOnly:!0})}_analyzePictureStroke(e,t,i,r){const{primitiveName:a,type:s}=e,n=ge(e),o=O(e.width,B.CIMPictureStroke.width),l=se(e.capStyle,B.CIMPictureStroke.capstyle),h=se(e.joinStyle,B.CIMPictureStroke.joinstyle),c=e.miterLimit,d={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(a,s)};this._cimLayers.push({type:"line",spriteRasterizationParam:d,isOutline:i,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(s,a,"TintColor",n),width:this._getValueOrOverrideExpression(s,a,"Width",o),cap:this._getValueOrOverrideExpression(s,a,"CapStyle",l),join:this._getValueOrOverrideExpression(s,a,"JoinStyle",h),miterLimit:c&&this._getValueOrOverrideExpression(s,a,"MiterLimit",c),referenceWidth:r,zOrder:Ae(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}_analyzeGradientStroke(e,t,i,r){const{primitiveName:a,type:s}=e,n=O(e.width,B.CIMSolidStroke.width),o=se(e.capStyle,B.CIMGradientStroke.capstyle),l=se(e.joinStyle,B.CIMGradientStroke.joinstyle),h=e.miterLimit;this._cimLayers.push({type:"line",spriteRasterizationParam:null,isOutline:i,colorLocked:!!e.colorLocked,effects:t,color:[128,128,128,1],width:this._getValueOrOverrideExpression(s,a,"Width",n),cap:this._getValueOrOverrideExpression(s,a,"CapStyle",o),join:this._getValueOrOverrideExpression(s,a,"JoinStyle",l),miterLimit:h&&this._getValueOrOverrideExpression(s,a,"MiterLimit",h),referenceWidth:r,zOrder:Ae(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}_analyzeMarker(e,t,i,r,a,s,n,o,l=!1,h=!1){if(l||(l=!!e.colorLocked),this._analyzeMarkerInsidePolygon(e,t,l))return;const c=O(e.size,B.CIMVectorMarker.size),d=O(e.rotation),p=O(e.offsetX),_=O(e.offsetY),{primitiveName:f,type:g}=e,y=this._getValueOrOverrideExpression(g,f,"Size",c),m=this._getValueOrOverrideExpression(g,f,"Rotation",d),M=this._getValueOrOverrideExpression(g,f,"OffsetX",p),w=this._getValueOrOverrideExpression(g,f,"OffsetY",_);switch(e.type){case"CIMPictureMarker":this._analyzePictureMarker(e,t,i,r,a,s,y,m,M,w,o,l,h);break;case"CIMVectorMarker":this._analyzeVectorMarker(e,t,i,r,a,s,y,m,M,w,o,n,l,h)}}_analyzeMarkerInsidePolygon(e,t,i){const{markerPlacement:r,type:a}=e;if(!r||r.type!=="CIMMarkerPlacementInsidePolygon")return!1;if(a==="CIMVectorMarker"||a==="CIMPictureMarker"){const d=e.primitiveName;if(d&&this._analyzePrimitiveOverrides([d],t,null,null))return!1;const p=r.primitiveName;if(p&&this._analyzePrimitiveOverrides([p],t,null,null))return!1;if(a==="CIMVectorMarker"){const{markerGraphics:_}=e;if(_)for(const f of _){const{symbol:g}=f;if((g==null?void 0:g.type)==="CIMPolygonSymbol"&&g.symbolLayers){const{symbolLayers:y}=g;for(const m of y)if(m.type==="CIMSolidStroke")return!1}}}else{const{animatedSymbolProperties:_}=e;if(_)return!1}}const s=Math.abs(r.stepX),n=Math.abs(r.stepY);if(s===0||n===0)return!0;let o,l;if(r.gridType==="Random"){const d=Dt(Lt),p=Math.max(Math.floor(d/s),1);o=n*Math.max(Math.floor(d/n),1),l=p*s/o}else r.shiftOddRows?(o=2*n,l=s/n*.5):(o=n,l=s/n);const h=ge(e),c=e.type==="CIMCharacterMarker"?null:{type:"sprite-rasterization-param",resource:e,overrides:[]};return this._cimLayers.push({type:"fill",spriteRasterizationParam:c,colorLocked:i,effects:t,color:h,height:o,scaleX:l,angle:r.gridAngle,offsetX:O(r.offsetX),offsetY:O(r.offsetY),applyRandomOffset:r.gridType==="Random",sampleAlphaOnly:e.type!=="CIMPictureMarker",hasUnresolvedReplacementColor:!0}),!0}_analyzePictureMarker(e,t,i,r,a,s,n,o,l,h,c,d,p){var T,P,z,U,k,W,V,q;const{primitiveName:_,type:f}=e;let g=O(e.scaleX,1);const y=ge(e);i||(i=this._createMarkerPlacementOverrideExpression(e.markerPlacement));const m=this._createAnimatedSymbolPropertiesOverrideExpression(e.animatedSymbolProperties),M=e.anchorPoint??{x:0,y:0};if("width"in e&&typeof e.width=="number"){const Y=e.width;let K=1;const G=this._resourceManager.getResource(e.url);G!=null&&(K=G.width/G.height),g/=K*(O(e.size)/Y)}const w=[...r];let x;e.primitiveName&&w.push(e.primitiveName),e.animatedSymbolProperties||m?x={type:"animated",url:e.url,urlHash:"H"+zt(e.url),playAnimation:(T=e.animatedSymbolProperties)==null?void 0:T.playAnimation,reverseAnimation:(P=e.animatedSymbolProperties)==null?void 0:P.reverseAnimation,randomizeStartTime:(z=e.animatedSymbolProperties)==null?void 0:z.randomizeStartTime,randomizeStartSeed:(U=e.animatedSymbolProperties)==null?void 0:U.randomizeStartSeed,startTimeOffset:(k=e.animatedSymbolProperties)==null?void 0:k.startTimeOffset,duration:(W=e.animatedSymbolProperties)==null?void 0:W.duration,repeatType:(V=e.animatedSymbolProperties)==null?void 0:V.repeatType,repeatDelay:(q=e.animatedSymbolProperties)==null?void 0:q.repeatDelay}:(x=Ft(e),x.markerPlacement=null);const b={type:"sprite-rasterization-param",resource:x,overrides:this._getMaterialOverrides(w,f)};m&&b.overrides.push(...m.overrides),this._cimLayers.push({type:"marker",spriteRasterizationParam:b,colorLocked:d,effects:t,scaleSymbolsProportionally:!1,alignment:a,size:n,scaleX:this._getValueOrOverrideExpression(f,_,"ScaleX",g),rotation:o,offsetX:l,offsetY:h,transform:{type:"cim-marker-transform-param",params:c},color:this._getValueOrOverrideExpression(f,_,"TintColor",y),anchorPoint:{x:M.x,y:M.y},isAbsoluteAnchorPoint:e.anchorPointUnits!=="Relative",outlineColor:[0,0,0,0],outlineWidth:0,frameHeight:0,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:s,sizeRatio:1,isOutline:p,markerPlacement:i,animatedSymbolProperties:m})}_analyzeVectorMarker(e,t,i,r,a,s,n,o,l,h,c,d,p,_){const f=e.markerGraphics;if(!f)return;const g=e.frame;let y=0;if(y=g?g.ymax-g.ymin:s,y){const m={offsetX:l,offsetY:h,rotation:o,size:n,frameHeight:y,rotateClockWise:!!e.rotateClockwise};c=[...c,m]}i||(i=this._createMarkerPlacementOverrideExpression(e.markerPlacement));for(const m of f)if(m){const M=m.symbol;if(!M)continue;const w=m.primitiveName;let x;if(w&&r.push(w),(M.type==="CIMPointSymbol"||M.type==="CIMTextSymbol")&&g){let b=0,T=0;const P=m.geometry;"x"in P&&"y"in P&&(b+=P.x-.5*(g.xmin+g.xmax),T+=P.y-.5*(g.ymin+g.ymax));const z=e.anchorPoint;z&&(e.anchorPointUnits==="Absolute"?(b-=z.x,T-=z.y):g&&(b-=(g.xmax-g.xmin)*z.x,T-=(g.ymax-g.ymin)*z.y));const U={offsetX:b,offsetY:T,rotation:0,size:0,frameHeight:0,rotateClockWise:!1};x=[...c,U]}switch(M.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":d||vr(M)?this._analyzeMultiLayerGraphicNonSDF(e,t,i,null,m,r,a,s,x??c,y,p,_):this._analyzeMultiLayerGraphic(e,t,i,null,m,r,a,s,x??c,y,p,_);break;case"CIMTextSymbol":this._analyzeTextGraphic(t,i,m,r,a,s,x??c,p)}w&&r.pop()}}_analyzeMultiLayerGraphic(e,t,i,r,a,s,n,o,l,h,c,d){const p=a.symbol,_=p.symbolLayers;if(!_)return;let f=_.length;if(yr(_))return void this._analyzeCompositeMarkerGraphic(e,t,i,r,a,_,n,o,l,h,c,d);const g=this._resourceManager.geometryEngine,y=at.applyEffects(p.effects,a.geometry,g);if(y)for(;f--;){const m=_[f];if(!m||m.enable===!1)continue;const M=m.primitiveName;switch(M&&s.push(M),m.type){case"CIMSolidFill":case"CIMSolidStroke":{const w=at.applyEffects(m.effects,y,g),x=ot(w);if(!x)continue;const b=e.anchorPointUnits!=="Relative",[T,P,z,U]=lt(x,e.frame,e.size,e.anchorPoint,b),k=m.type==="CIMSolidFill",W={type:"sdf",geom:w,asFill:k},{path:V}=m,q=k?F(ye(m)):V==null?F(ke(m)):[0,0,0,0],Y=k?[0,0,0,0]:F(ke(m)),K=nt(m)??0;if(!k&&!K)break;const G=a.primitiveName;let _e=null;k&&!m.colorLocked&&(_e=this._maybeGetValueOrOverrideExpression(G,"FillColor"));let oe=null;k||m.colorLocked||(oe=this._maybeGetValueOrOverrideExpression(G,"StrokeColor"));const Se=_e??this._getValueOrOverrideExpression(m.type,M,"Color",q),me=oe??this._getValueOrOverrideExpression(m.type,M,"Color",Y),Z=this._maybeGetValueOrOverrideExpression(G,"StrokeWidth")??this._getValueOrOverrideExpression(m.type,M,"Width",K),fe=V?{type:"sprite-rasterization-param",resource:{type:"path",path:V,asFill:k},overrides:[]}:{type:"sprite-rasterization-param",resource:W,overrides:[]};this._cimLayers.push({type:"marker",spriteRasterizationParam:fe,colorLocked:!!m.colorLocked||!!c,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:n,anchorPoint:{x:P,y:z},isAbsoluteAnchorPoint:b,size:h,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:l},frameHeight:h,widthRatio:U,rotateClockwise:!1,referenceSize:o,sizeRatio:T,color:Se,outlineColor:me,outlineWidth:Z,isOutline:d,markerPlacement:i,animatedSymbolProperties:r});break}case"CIMPictureMarker":case"CIMVectorMarker":m.markerPlacement?this._analyzeMultiLayerGraphicNonSDF(e,t,i,r,a,s,n,o,l,h,!!m.colorLocked||!!c,d):this._analyzeMarker(m,t,i,s,n,o,!1,l,c,d);break;default:this._analyzeMultiLayerGraphicNonSDF(e,t,i,r,a,s,n,o,l,h,!!m.colorLocked||!!c,d)}M&&s.pop()}}_analyzeTextGraphic(e,t,i,r,a,s,n,o){var me;const l=[];ce.findApplicableOverrides(i,this._primitiveOverrides,l);const h=i.geometry;if(!("x"in h)||!("y"in h))return;const c=i.symbol,d=Bi(c),p=ki(c.fontStyleName),_=Pi(c.fontFamilyName);c.font={family:_,decoration:d,...p};const f=O(c.height,B.CIMTextSymbol.height),g=O(c.angle),y=O(c.offsetX),m=O(c.offsetY),M=F(ye(c));let w=F(ke(c)),x=nt(c)??0;x||(w=F(ye(c.haloSymbol)),x=O(c.haloSize));let b=!1;if((me=c.symbol)!=null&&me.symbolLayers)for(const Z of c.symbol.symbolLayers)F(ye(Z))!=null&&(b=!!Z.colorLocked);const T=i.primitiveName;let P=null;b||(P=this._maybeGetValueOrOverrideExpression(T,"FillColor"));const z=this._maybeGetValueOrOverrideExpression(T,"TextSize"),U=this._maybeGetValueOrOverrideExpression(T,"TextAngle"),k=this._maybeGetValueOrOverrideExpression(T,"TextOffsetX"),W=this._maybeGetValueOrOverrideExpression(T,"TextOffsetY");let V=null,q=null,Y=0;if(c.callout&&c.callout.type==="CIMBackgroundCallout"){const Z=c.callout;if(Z.backgroundSymbol){const fe=Z.backgroundSymbol.symbolLayers;if(fe)for(const le of fe)le.type==="CIMSolidFill"?V=F(le.color):le.type==="CIMSolidStroke"&&(q=F(le.color),Y=O(le.width,B.CIMSolidStroke.width))}}const K=this._getValueOrOverrideExpression(c.type,i.primitiveName,"TextString",i.textString??"");if(K==null)return;const{fontStyleName:G}=c,_e=_+(G?"-"+G.toLowerCase():"-regular"),oe=this._getMaterialOverrides(r,c.type);oe.push(...this._getPrimitiveMaterialOverrides(i.primitiveName,c.type));const Se={type:"text-rasterization-param",resource:{type:"text",textString:i.textString??"",font:c.font,symbol:c,primitiveName:i.primitiveName},overrides:oe};this._cimLayers.push({type:"text",lineWidth:null,textRasterizationParam:Se,colorLocked:!!o||!!b,effects:e,alignment:a,anchorPoint:{x:0,y:0},isAbsoluteAnchorPoint:!1,fontName:_e,decoration:d,weight:p.weight,style:p.style,size:z??f,angle:U??g,offsetX:k??y,offsetY:W??m,transform:{type:"cim-marker-transform-param",params:n},horizontalAlignment:Ai(c.horizontalAlignment),verticalAlignment:Ii(c.verticalAlignment),text:K,color:P??this._getValueOrOverrideExpression(c.type,i.primitiveName,"Color",M),outlineColor:w,outlineSize:x,backgroundColor:V,borderLineColor:q,borderLineWidth:Y,referenceSize:s,sizeRatio:1,markerPlacement:t})}_analyzeMultiLayerGraphicNonSDF(e,t,i,r,a,s,n,o,l,h,c,d){const p=this._buildSimpleMarker(e,a),_=e.primitiveName,f=this._analyzeMaterialOverrides(_,["Rotation","OffsetX","OffsetY"]),g=this._normalizePrimitiveOverrideProps(f),[y,m,M]=ae.getTextureAnchor(p,this._resourceManager),w=this._getMaterialOverrides(s,e.type);w.push(...g);const x={type:"sprite-rasterization-param",resource:{...p,avoidSDFRasterization:!0},overrides:w};this._cimLayers.push({type:"marker",spriteRasterizationParam:x,colorLocked:c,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:n,anchorPoint:{x:y,y:m},isAbsoluteAnchorPoint:!1,size:h,rotation:0,offsetX:0,offsetY:0,transform:{type:"cim-marker-transform-param",params:l},color:[255,255,255,1],outlineColor:[0,0,0,0],outlineWidth:0,scaleX:1,frameHeight:h,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:o,sizeRatio:M/ie(e.size),isOutline:d,markerPlacement:i,animatedSymbolProperties:r})}_createMarkerPlacementOverrideExpression(e){if(!e)return null;const t=[];return ce.findApplicableOverrides(e,this._primitiveOverrides,t),{type:"cim-marker-placement-info",placement:e,overrides:ft(t)}}_createAnimatedSymbolPropertiesOverrideExpression(e){if(!e)return null;const t=[];return ce.findApplicableOverrides(e,this._primitiveOverrides,t),{type:"cim-animation-info",animation:e,overrides:ft(t)}}_buildSimpleMarker(e,t){return{type:e.type,enable:!0,name:e.name,colorLocked:e.colorLocked,primitiveName:e.primitiveName,anchorPoint:e.anchorPoint,anchorPointUnits:e.anchorPointUnits,offsetX:0,offsetY:0,rotateClockwise:e.rotateClockwise,rotation:0,size:e.size,billboardMode3D:e.billboardMode3D,depth3D:e.depth3D,frame:e.frame,markerGraphics:[t],scaleSymbolsProportionally:e.scaleSymbolsProportionally,respectFrame:e.respectFrame,clippingPath:e.clippingPath}}_analyzeCompositeMarkerGraphic(e,t,i,r,a,s,n,o,l,h,c,d){const p=a.geometry,_=s[0],f=s[1],g=ot(p);if(!g)return;const y=e.anchorPointUnits!=="Relative",[m,M,w,x]=lt(g,e.frame,e.size,e.anchorPoint,y),{path:b}=f,T=f.primitiveName,P=_.primitiveName,z=a.primitiveName;let U=null;f.colorLocked||c||(U=this._maybeGetValueOrOverrideExpression(z,"FillColor"));const k=U??this._getValueOrOverrideExpression(f.type,T,"Color",F(f.color));let W=null;_.colorLocked||c||(W=this._maybeGetValueOrOverrideExpression(z,"StrokeColor"));const V=W??this._getValueOrOverrideExpression(_.type,P,"Color",F(_.color)),q=this._maybeGetValueOrOverrideExpression(z,"StrokeWidth")??this._getValueOrOverrideExpression(_.type,P,"Width",O(_.width,B.CIMSolidStroke.width)),Y={type:"sprite-rasterization-param",resource:b?{type:"path",path:b,asFill:!0}:{type:"sdf",geom:p,asFill:!0},overrides:[]};this._cimLayers.push({type:"marker",spriteRasterizationParam:Y,colorLocked:c,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:n,anchorPoint:{x:M,y:w},isAbsoluteAnchorPoint:y,size:h,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:l},frameHeight:h,widthRatio:x,rotateClockwise:!1,referenceSize:o,sizeRatio:m,color:k,outlineColor:V,outlineWidth:q,isOutline:d,markerPlacement:i,animatedSymbolProperties:r})}_setPoMap(e,t,i){let r;this._poMap[e]?r=this._poMap[e]:(r={},this._poMap[e]=r),r[t]=i}_maybeGetValueOrOverrideExpression(e,t,i){return this._getValueOrOverrideExpression("",e,t,i,!1)}_getValueOrOverrideExpression(e,t,i,r,a=!0){if(a&&!$i(r)&&(r=Be(e,i.toLowerCase())),t==null)return r;const s=this._poMap[t];if(s==null)return r;const n=s[i];return typeof n=="string"||typeof n=="number"||Array.isArray(n)?n:n?{valueExpressionInfo:n,defaultValue:r}:r}_analyzePrimitiveOverrides(e,t,i,r){if(e==null)return!1;typeof e=="string"&&(e=[e]);for(const a of this._primitiveOverrides)if(e.includes(a.primitiveName)&&a.valueExpressionInfo)return!0;if(t!=null){for(const a of t)if((a==null?void 0:a.overrides.length)>0)return!0}if(i!=null){for(const a of i)if((a==null?void 0:a.overrides.length)>0)return!0}if(r!=null){for(const a of r)if((a==null?void 0:a.overrides.length)>0)return!0}return!1}_getMaterialOverrides(e,t){if(!e)return[];const i=[];for(const r of e)i.push(...this._getPrimitiveMaterialOverrides(r,t));return i}_getPrimitiveMaterialOverrides(e,t){if(!e)return[];const i=this._normalizePrimitiveOverrideProps(this._primitiveOverrides.filter(r=>r.primitiveName===e));return i.forEach(r=>r.defaultValue=Be(t,r.propertyName.toLowerCase())),i}_analyzeMaterialOverrides(e,t){return this._primitiveOverrides.filter(i=>i.primitiveName!==e||!t.includes(i.propertyName))}_normalizePrimitiveOverrideProps(e){return e.map(t=>({...t,propertyName:kt(t.propertyName)}))}}function Ae(u){if(u&&u.indexOf("Level_")===0){const e=parseInt(u.substr(6),10);if(!isNaN(e))return e}return 0}const yr=u=>u&&u.length===2&&u[0].enable&&u[1].enable&&u[0].type==="CIMSolidStroke"&&u[1].type==="CIMSolidFill"&&u[0].path==null&&u[1].path==null&&!u[0].effects&&!u[1].effects;function vr(u){const e=u.symbolLayers;if(!e||e.length!==2)return!1;const t=e.find(r=>{var a;return(a=r.effects)==null?void 0:a.find(s=>s.type==="CIMGeometricEffectDashes"&&s.dashTemplate!=null)}),i=e.find(r=>{var a;return(a=r.effects)==null?void 0:a.find(s=>s.type==="CIMGeometricEffectAddControlPoints")});return!!t||!!i}function ft(u){return Ft(u).map(e=>({...e,propertyName:kt(e.propertyName)}))}let br=class{constructor(e){this.events=new Nt,this._hasMajorPerformanceCaveat=!1,this._lastRenderFrameCounter=0,this._canvas=document.createElement("canvas"),this._canvas.setAttribute("style","width: 100%; height:100%; display:block; willChange:transform");const t={failIfMajorPerformanceCaveat:!0,alpha:!0,antialias:!1,depth:!0,stencil:!0};e.appendChild(this._canvas);let i=Ke(this._canvas,t);i||(i=Ke(this._canvas,{...t,failIfMajorPerformanceCaveat:!1}),this._hasMajorPerformanceCaveat=!0),this._gl=i,this._handles=Ut([Vt(this._canvas,"webglcontextlost",r=>this.events.emit("webgl-context-lost",r))])}destroy(){var e;(e=this._canvas.parentNode)==null||e.removeChild(this._canvas),this._canvas=null,this._handles.remove(),this._gl=null}get gl(){return this._gl}render(e,t){if(this._hasMajorPerformanceCaveat||H("esri-force-performance-mode")){if(++this._lastRenderFrameCounter>=H("esri-performance-mode-frames-between-render")&&(t(),this._lastRenderViewState=e.state.clone(),this._lastRenderFrameCounter=0),this._lastRenderViewState){const[i,r,a,s,n,o]=this._computeViewTransform(this._lastRenderViewState,e.state);this._canvas.style.transform=`matrix(${i}, ${r}, ${a}, ${s}, ${n}, ${o})`}}else t()}resize(e){const t=this._canvas,i=t.style,{state:{size:r},pixelRatio:a}=e,s=r[0],n=r[1],o=Math.round(s*a),l=Math.round(n*a);t.width===o&&t.height===l||(t.width=o,t.height=l),i.width=s+"px",i.height=n+"px"}_computeViewTransform(e,t){const[i,r]=e.center,[a,s]=t.center,[n,o]=e.toScreen([0,0],a,s),[l,h]=e.toScreen([0,0],i,r),c=l-n,d=h-o,p=e.scale/t.scale,_=t.rotation-e.rotation,f=Xt();return Gt(f),Ht(f,f,[p,p]),Wt(f,f,qt(_)),jt(f,f,[c,d]),f}};const wr={background:{"background.frag":`#ifdef PATTERN +import{eQ as $t,l8 as xe,iU as zt,aV as Ft,bh as ie,s as Ne,bg as Dt,lA as Lt,ca as Nt,eA as Ke,eF as Ut,fW as Vt,E as H,lB as Gt,lC as Ht,lD as Wt,gz as qt,lE as jt,lF as Xt,lG as A,fV as S,g4 as v,g3 as ne,fX as Ue,v as C,D as E,eN as Yt,M as de,ia as Kt,jj as Jt,$ as j,N as re,lH as Te,kg as Qt,at as Ve,b as Je,bE as Zt,lI as ei,lJ as Qe,L as D,lK as ti,df as ii,eG as ri,lL as si,lM as ai,cy as Ce,eO as Ge,hf as $e,iS as Ee,fg as Re,ju as ni,f_ as Ze,eK as oi,eI as li,j8 as hi,ja as ci,g6 as De,lN as he,iv as et,g5 as Le,iR as ui,is as He,lO as Bt,U as We,iB as di,he as tt,hc as ze,ji as pi,lP as _i,lQ as mi,jl as it,lR as fi,l as gi,lS as yi,_ as rt,jm as vi,u as bi,eC as wi,g as Fe,P as xi,I as st,cE as Mi,lT as Oi}from"./index-BjUNJPVf.js";import{aU as at,aV as Pi,K as ae,aW as Si,t as Ti,aX as Ci,aY as Ei}from"./UpdateTracking2D-Ds_Gdrxd.js";import{o as Ri,f as F,B as zi,b as Fi,p as ge,I as O,D as Be,h as se,L as ye,T as ke,x as nt,w as Bi,P as ki,A as Ai,F as Ii,E as $i,z as kt,t as B,u as Di}from"./utils-CuXO_Zzq.js";import{f as ce}from"./OverrideHelper-DxFZBnGL.js";import{f as ot,m as lt,e as Li,a as Ni}from"./SDFHelper-kKuXhauo.js";import{A as ve,E as L,t as Ui,g as Vi,o as ht,h as Gi,i as Hi}from"./Container-_n5wCgez.js";import{d as Wi,e as ct,a as Q,c as ut,h as dt,i as qi,m as ji}from"./WGLContainer-DgZNq7b0.js";import{a as Xi,e as Me,o as qe}from"./ProgramTemplate-Ck2I0bIi.js";import{glslifyDefineMap as Pe}from"./webglDeps-Cjw3mzdd.js";import{e as pt,r as Yi,t as Ki,a as Ji,n as Qi,b as Zi,c as er}from"./MagnifierPrograms-Dy7jbVaV.js";import{d as cn,f as un}from"./MagnifierPrograms-Dy7jbVaV.js";import{h as je,x as N,i as Xe,s as tr}from"./Program-DBsYtQ00.js";import{o as ir,w as rr}from"./RenderingContext-vSxDymNY.js";import{p as sr,s as ar}from"./imageUtils-ChIDAvDr.js";import{e as nr,i as or}from"./rasterizingUtils-D-sJQSSt.js";import{t as $}from"./Rect-CUzevAry.js";import{e as R,m as X}from"./Texture-S4dD-WHn.js";import{n as _t}from"./pbf-Du8sFEWo.js";import{o as lr}from"./floatRGBA-Cs54GdjG.js";import{j as hr,M as cr,y as ur}from"./LabelMetric-BcUxDImF.js";import{f as dr}from"./utils-D-nPH6yJ.js";import{F as pr,T as _r}from"./FeatureCommandQueue-DI81F3gA.js";import{$ as pn}from"./GraphicsView2D-B7H8XAnI.js";import{t as mn}from"./GraphicContainer-Bue3JF2r.js";import{t as mt}from"./requestImageUtils-BHJ_ulwE.js";import"./TurboLine-DNQdPIXo.js";import"./earcut-CWKXDqDj.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./labelUtils-3p0-m-Ee.js";import"./defaultsJSON-CHAaurhX.js";import"./BindType-BmZEZMMh.js";import"./Util-CS5u4Lec.js";import"./highlightReasons-BOU4mnPE.js";import"./constants-D5zmR9t2.js";import"./quantizationUtils-CfV316jZ.js";import"./config-MDUrh2eL.js";import"./featureConversionUtils-BHhm7bvm.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./NestedMap-DgiGbX8E.js";import"./CircularArray-DfLrgW_-.js";import"./testSVGPremultipliedAlpha-BUMQhQ4O.js";import"./AttributeStore-Bm6hLtR1.js";import"./FieldsIndex-CK-0B5n9.js";import"./UnknownTimeZone-CK7VjgF3.js";import"./TimeOnly-BXSODLxA.js";import"./timeSupport-DXkhlToK.js";import"./json-Wa8cmqdu.js";import"./diffUtils-uUoMDFQS.js";import"./OrderIndependentTransparency-Btph8gYx.js";import"./basicInterfaces-GbxEOYtk.js";import"./doublePrecisionUtils-B0owpBza.js";import"./normalizeUtilsSync-73yZ0QwV.js";import"./AGraphicContainer-BXk7Eu6w.js";import"./TechniqueInstance-XtnK2qy2.js";import"./TileContainer-Bs-vXdD_.js";import"./vec3f32-nZdmKIgz.js";const mr=()=>Ne.getLogger("esri.symbols.cim.cimAnalyzer");function fr(u){const e=u.markerPlacement;return e&&e.angleToLine?xe.MAP:xe.SCREEN}class gr{constructor(e){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[],e&&(this._resourceManager=e)}analyzeSymbolReference(e,t,i){if(this._cimLayers=i??[],!e)return this._cimLayers;if(this._reset(),e.primitiveOverrides){this._primitiveOverrides=e.primitiveOverrides;for(const r of this._primitiveOverrides){const a=r.valueExpressionInfo;if(a)this._setPoMap(r.primitiveName,r.propertyName,a);else if(r.value!=null){let s=r.value;r.propertyName.includes("Color")&&($t(s)&&(s=Ri(s)),s=F(s)),this._setPoMap(r.primitiveName,r.propertyName,s)}}}return this._analyzeSymbol(e.symbol,t),this._cimLayers}_reset(){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[]}_analyzeSymbol(e,t){switch(e==null?void 0:e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this._analyzeMultiLayerSymbol(e,t)}}_analyzeMultiLayerSymbol(e,t){const i=e==null?void 0:e.symbolLayers;if(!i)return;const r=e.effects;let a=xe.SCREEN;const s=zi(e)??0;e.type==="CIMPointSymbol"&&e.angleAlignment==="Map"&&(a=xe.MAP);const n=e.type==="CIMPolygonSymbol";let o=i.length;for(;o--;){const l=i[o];if(!l||l.enable===!1)continue;let h;r!=null&&r.length&&(h=[...r]);const c=l.effects;c!=null&&c.length&&(r?h.push(...c):h=[...c]);let d=null;if(h){d=[];for(const _ of h){const f=ce.findEffectOverrides(_,this._primitiveOverrides);f&&d.push(f)}}const p=[];switch(ce.findApplicableOverrides(l,this._primitiveOverrides,p),l.type){case"CIMSolidFill":this._analyzeSolidFill(l,d);break;case"CIMPictureFill":this._analyzePictureFill(l,d);break;case"CIMHatchFill":this._analyzeHatchFill(l,d);break;case"CIMGradientFill":this._analyzeGradientFill(l,d);break;case"CIMSolidStroke":this._analyzeSolidStroke(l,d,n,s);break;case"CIMPictureStroke":this._analyzePictureStroke(l,d,n,s);break;case"CIMGradientStroke":this._analyzeGradientStroke(l,d,n,s);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":{e.type!=="CIMLineSymbol"&&e.type!=="CIMPolygonSymbol"||(a=fr(l));const _=[],f=l.primitiveName;f&&_.push(f);const g=n&&Fi(l.markerPlacement);this._analyzeMarker(l,d,null,_,a,s,t,[],!1,g);break}default:mr().error("Cannot analyze CIM layer",l.type)}}}_analyzeSolidFill(e,t){const{primitiveName:i,type:r}=e,a=F(e.color);this._cimLayers.push({type:"fill",spriteRasterizationParam:null,colorLocked:!!e.colorLocked,color:this._getValueOrOverrideExpression(r,i,"Color",a),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:t,applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!1})}_analyzePictureFill(e,t){const{primitiveName:i,type:r}=e,a=ge(e),s=O(e.height,B.CIMPictureFill.height);let n=O(e.scaleX,1);if("width"in e&&typeof e.width=="number"){const l=e.width;let h=1;const c=this._resourceManager.getResource(e.url);c!=null&&(h=c.width/c.height),n/=h*(s/l)}const o={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(i,r)};this._cimLayers.push({type:"fill",spriteRasterizationParam:o,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(r,i,"TintColor",a),height:this._getValueOrOverrideExpression(r,i,"Height",s),scaleX:this._getValueOrOverrideExpression(r,i,"ScaleX",n),angle:this._getValueOrOverrideExpression(r,i,"Rotation",O(e.rotation)),offsetX:this._getValueOrOverrideExpression(r,i,"OffsetX",O(e.offsetX)),offsetY:this._getValueOrOverrideExpression(r,i,"OffsetY",O(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1})}_analyzeHatchFill(e,t){var h,c,d;const{primitiveName:i,type:r}=e,a=this._analyzeMaterialOverrides(i,["Rotation","OffsetX","OffsetY"]),s=this._normalizePrimitiveOverrideProps(a);let n=[255,255,255,1],o=!1;if((h=e.lineSymbol)!=null&&h.symbolLayers)for(const p of e.lineSymbol.symbolLayers){if(p.type!=="CIMSolidStroke")continue;const _=p.primitiveName??i;o||!_||p.colorLocked||((c=this._poMap[_])==null?void 0:c.Color)==null&&((d=this._poMap[_])==null?void 0:d.StrokeColor)==null||(n=F(p.color),n=this._maybeGetValueOrOverrideExpression(_,"StrokeColor")??this._getValueOrOverrideExpression(r,_,"Color",n),o=!0);const f=this._maybeGetValueOrOverrideExpression(_,"StrokeWidth");if(f){let g=null,y=null;typeof f=="number"?g=f:y=f.valueExpressionInfo;let m=s.find(M=>M.propertyName==="strokeWidth");m?m.propertyName="width":(m={type:"CIMPrimitiveOverride",primitiveName:_,propertyName:"width",valueExpressionInfo:y,value:g,defaultValue:Be(r,"width")},s.push(m))}}const l={type:"sprite-rasterization-param",resource:e,overrides:s};this._cimLayers.push({type:"fill",spriteRasterizationParam:l,colorLocked:!!e.colorLocked,effects:t,color:n,height:this._getValueOrOverrideExpression(r,i,"Separation",O(e.separation,B.CIMHatchFill.separation)),scaleX:1,angle:this._getValueOrOverrideExpression(r,i,"Rotation",O(e.rotation)),offsetX:this._getValueOrOverrideExpression(r,i,"OffsetX",O(e.offsetX)),offsetY:this._getValueOrOverrideExpression(r,i,"OffsetY",O(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!o})}_analyzeGradientFill(e,t){this._cimLayers.push({type:"fill",spriteRasterizationParam:null,colorLocked:!!e.colorLocked,effects:t,color:[128,128,128,1],height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1})}_analyzeSolidStroke(e,t,i,r){const{primitiveName:a,type:s}=e,n=F(e.color),o=O(e.width,B.CIMSolidStroke.width),l=se(e.capStyle,B.CIMSolidStroke.capstyle),h=se(e.joinStyle,B.CIMSolidStroke.joinstyle),c=e.miterLimit;let d,p,_=[];if(this._analyzePrimitiveOverrides(a,t,null,null)&&(_=this._getPrimitiveMaterialOverrides(a,s)),t&&t instanceof Array&&t.length>0){const g=t[t.length-1].effect;g&&g.type==="CIMGeometricEffectDashes"&&g.lineDashEnding==="NoConstraint"&&g.offsetAlongLine===null&&(d=g.dashTemplate,p=g.scaleDash,(t=[...t]).pop())}const f=d!==void 0?{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:d,capStyle:l},overrides:_}:null;this._cimLayers.push({type:"line",spriteRasterizationParam:f,isOutline:i,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(s,a,"Color",n),width:this._getValueOrOverrideExpression(s,a,"Width",o),cap:this._getValueOrOverrideExpression(s,a,"CapStyle",l),join:this._getValueOrOverrideExpression(s,a,"JoinStyle",h),miterLimit:c&&this._getValueOrOverrideExpression(s,a,"MiterLimit",c),referenceWidth:r,zOrder:Ae(e.name),dashTemplate:d,scaleDash:p,sampleAlphaOnly:!0})}_analyzePictureStroke(e,t,i,r){const{primitiveName:a,type:s}=e,n=ge(e),o=O(e.width,B.CIMPictureStroke.width),l=se(e.capStyle,B.CIMPictureStroke.capstyle),h=se(e.joinStyle,B.CIMPictureStroke.joinstyle),c=e.miterLimit,d={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(a,s)};this._cimLayers.push({type:"line",spriteRasterizationParam:d,isOutline:i,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(s,a,"TintColor",n),width:this._getValueOrOverrideExpression(s,a,"Width",o),cap:this._getValueOrOverrideExpression(s,a,"CapStyle",l),join:this._getValueOrOverrideExpression(s,a,"JoinStyle",h),miterLimit:c&&this._getValueOrOverrideExpression(s,a,"MiterLimit",c),referenceWidth:r,zOrder:Ae(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}_analyzeGradientStroke(e,t,i,r){const{primitiveName:a,type:s}=e,n=O(e.width,B.CIMSolidStroke.width),o=se(e.capStyle,B.CIMGradientStroke.capstyle),l=se(e.joinStyle,B.CIMGradientStroke.joinstyle),h=e.miterLimit;this._cimLayers.push({type:"line",spriteRasterizationParam:null,isOutline:i,colorLocked:!!e.colorLocked,effects:t,color:[128,128,128,1],width:this._getValueOrOverrideExpression(s,a,"Width",n),cap:this._getValueOrOverrideExpression(s,a,"CapStyle",o),join:this._getValueOrOverrideExpression(s,a,"JoinStyle",l),miterLimit:h&&this._getValueOrOverrideExpression(s,a,"MiterLimit",h),referenceWidth:r,zOrder:Ae(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}_analyzeMarker(e,t,i,r,a,s,n,o,l=!1,h=!1){if(l||(l=!!e.colorLocked),this._analyzeMarkerInsidePolygon(e,t,l))return;const c=O(e.size,B.CIMVectorMarker.size),d=O(e.rotation),p=O(e.offsetX),_=O(e.offsetY),{primitiveName:f,type:g}=e,y=this._getValueOrOverrideExpression(g,f,"Size",c),m=this._getValueOrOverrideExpression(g,f,"Rotation",d),M=this._getValueOrOverrideExpression(g,f,"OffsetX",p),w=this._getValueOrOverrideExpression(g,f,"OffsetY",_);switch(e.type){case"CIMPictureMarker":this._analyzePictureMarker(e,t,i,r,a,s,y,m,M,w,o,l,h);break;case"CIMVectorMarker":this._analyzeVectorMarker(e,t,i,r,a,s,y,m,M,w,o,n,l,h)}}_analyzeMarkerInsidePolygon(e,t,i){const{markerPlacement:r,type:a}=e;if(!r||r.type!=="CIMMarkerPlacementInsidePolygon")return!1;if(a==="CIMVectorMarker"||a==="CIMPictureMarker"){const d=e.primitiveName;if(d&&this._analyzePrimitiveOverrides([d],t,null,null))return!1;const p=r.primitiveName;if(p&&this._analyzePrimitiveOverrides([p],t,null,null))return!1;if(a==="CIMVectorMarker"){const{markerGraphics:_}=e;if(_)for(const f of _){const{symbol:g}=f;if((g==null?void 0:g.type)==="CIMPolygonSymbol"&&g.symbolLayers){const{symbolLayers:y}=g;for(const m of y)if(m.type==="CIMSolidStroke")return!1}}}else{const{animatedSymbolProperties:_}=e;if(_)return!1}}const s=Math.abs(r.stepX),n=Math.abs(r.stepY);if(s===0||n===0)return!0;let o,l;if(r.gridType==="Random"){const d=Dt(Lt),p=Math.max(Math.floor(d/s),1);o=n*Math.max(Math.floor(d/n),1),l=p*s/o}else r.shiftOddRows?(o=2*n,l=s/n*.5):(o=n,l=s/n);const h=ge(e),c=e.type==="CIMCharacterMarker"?null:{type:"sprite-rasterization-param",resource:e,overrides:[]};return this._cimLayers.push({type:"fill",spriteRasterizationParam:c,colorLocked:i,effects:t,color:h,height:o,scaleX:l,angle:r.gridAngle,offsetX:O(r.offsetX),offsetY:O(r.offsetY),applyRandomOffset:r.gridType==="Random",sampleAlphaOnly:e.type!=="CIMPictureMarker",hasUnresolvedReplacementColor:!0}),!0}_analyzePictureMarker(e,t,i,r,a,s,n,o,l,h,c,d,p){var T,P,z,U,k,W,V,q;const{primitiveName:_,type:f}=e;let g=O(e.scaleX,1);const y=ge(e);i||(i=this._createMarkerPlacementOverrideExpression(e.markerPlacement));const m=this._createAnimatedSymbolPropertiesOverrideExpression(e.animatedSymbolProperties),M=e.anchorPoint??{x:0,y:0};if("width"in e&&typeof e.width=="number"){const Y=e.width;let K=1;const G=this._resourceManager.getResource(e.url);G!=null&&(K=G.width/G.height),g/=K*(O(e.size)/Y)}const w=[...r];let x;e.primitiveName&&w.push(e.primitiveName),e.animatedSymbolProperties||m?x={type:"animated",url:e.url,urlHash:"H"+zt(e.url),playAnimation:(T=e.animatedSymbolProperties)==null?void 0:T.playAnimation,reverseAnimation:(P=e.animatedSymbolProperties)==null?void 0:P.reverseAnimation,randomizeStartTime:(z=e.animatedSymbolProperties)==null?void 0:z.randomizeStartTime,randomizeStartSeed:(U=e.animatedSymbolProperties)==null?void 0:U.randomizeStartSeed,startTimeOffset:(k=e.animatedSymbolProperties)==null?void 0:k.startTimeOffset,duration:(W=e.animatedSymbolProperties)==null?void 0:W.duration,repeatType:(V=e.animatedSymbolProperties)==null?void 0:V.repeatType,repeatDelay:(q=e.animatedSymbolProperties)==null?void 0:q.repeatDelay}:(x=Ft(e),x.markerPlacement=null);const b={type:"sprite-rasterization-param",resource:x,overrides:this._getMaterialOverrides(w,f)};m&&b.overrides.push(...m.overrides),this._cimLayers.push({type:"marker",spriteRasterizationParam:b,colorLocked:d,effects:t,scaleSymbolsProportionally:!1,alignment:a,size:n,scaleX:this._getValueOrOverrideExpression(f,_,"ScaleX",g),rotation:o,offsetX:l,offsetY:h,transform:{type:"cim-marker-transform-param",params:c},color:this._getValueOrOverrideExpression(f,_,"TintColor",y),anchorPoint:{x:M.x,y:M.y},isAbsoluteAnchorPoint:e.anchorPointUnits!=="Relative",outlineColor:[0,0,0,0],outlineWidth:0,frameHeight:0,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:s,sizeRatio:1,isOutline:p,markerPlacement:i,animatedSymbolProperties:m})}_analyzeVectorMarker(e,t,i,r,a,s,n,o,l,h,c,d,p,_){const f=e.markerGraphics;if(!f)return;const g=e.frame;let y=0;if(y=g?g.ymax-g.ymin:s,y){const m={offsetX:l,offsetY:h,rotation:o,size:n,frameHeight:y,rotateClockWise:!!e.rotateClockwise};c=[...c,m]}i||(i=this._createMarkerPlacementOverrideExpression(e.markerPlacement));for(const m of f)if(m){const M=m.symbol;if(!M)continue;const w=m.primitiveName;let x;if(w&&r.push(w),(M.type==="CIMPointSymbol"||M.type==="CIMTextSymbol")&&g){let b=0,T=0;const P=m.geometry;"x"in P&&"y"in P&&(b+=P.x-.5*(g.xmin+g.xmax),T+=P.y-.5*(g.ymin+g.ymax));const z=e.anchorPoint;z&&(e.anchorPointUnits==="Absolute"?(b-=z.x,T-=z.y):g&&(b-=(g.xmax-g.xmin)*z.x,T-=(g.ymax-g.ymin)*z.y));const U={offsetX:b,offsetY:T,rotation:0,size:0,frameHeight:0,rotateClockWise:!1};x=[...c,U]}switch(M.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":d||vr(M)?this._analyzeMultiLayerGraphicNonSDF(e,t,i,null,m,r,a,s,x??c,y,p,_):this._analyzeMultiLayerGraphic(e,t,i,null,m,r,a,s,x??c,y,p,_);break;case"CIMTextSymbol":this._analyzeTextGraphic(t,i,m,r,a,s,x??c,p)}w&&r.pop()}}_analyzeMultiLayerGraphic(e,t,i,r,a,s,n,o,l,h,c,d){const p=a.symbol,_=p.symbolLayers;if(!_)return;let f=_.length;if(yr(_))return void this._analyzeCompositeMarkerGraphic(e,t,i,r,a,_,n,o,l,h,c,d);const g=this._resourceManager.geometryEngine,y=at.applyEffects(p.effects,a.geometry,g);if(y)for(;f--;){const m=_[f];if(!m||m.enable===!1)continue;const M=m.primitiveName;switch(M&&s.push(M),m.type){case"CIMSolidFill":case"CIMSolidStroke":{const w=at.applyEffects(m.effects,y,g),x=ot(w);if(!x)continue;const b=e.anchorPointUnits!=="Relative",[T,P,z,U]=lt(x,e.frame,e.size,e.anchorPoint,b),k=m.type==="CIMSolidFill",W={type:"sdf",geom:w,asFill:k},{path:V}=m,q=k?F(ye(m)):V==null?F(ke(m)):[0,0,0,0],Y=k?[0,0,0,0]:F(ke(m)),K=nt(m)??0;if(!k&&!K)break;const G=a.primitiveName;let _e=null;k&&!m.colorLocked&&(_e=this._maybeGetValueOrOverrideExpression(G,"FillColor"));let oe=null;k||m.colorLocked||(oe=this._maybeGetValueOrOverrideExpression(G,"StrokeColor"));const Se=_e??this._getValueOrOverrideExpression(m.type,M,"Color",q),me=oe??this._getValueOrOverrideExpression(m.type,M,"Color",Y),Z=this._maybeGetValueOrOverrideExpression(G,"StrokeWidth")??this._getValueOrOverrideExpression(m.type,M,"Width",K),fe=V?{type:"sprite-rasterization-param",resource:{type:"path",path:V,asFill:k},overrides:[]}:{type:"sprite-rasterization-param",resource:W,overrides:[]};this._cimLayers.push({type:"marker",spriteRasterizationParam:fe,colorLocked:!!m.colorLocked||!!c,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:n,anchorPoint:{x:P,y:z},isAbsoluteAnchorPoint:b,size:h,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:l},frameHeight:h,widthRatio:U,rotateClockwise:!1,referenceSize:o,sizeRatio:T,color:Se,outlineColor:me,outlineWidth:Z,isOutline:d,markerPlacement:i,animatedSymbolProperties:r});break}case"CIMPictureMarker":case"CIMVectorMarker":m.markerPlacement?this._analyzeMultiLayerGraphicNonSDF(e,t,i,r,a,s,n,o,l,h,!!m.colorLocked||!!c,d):this._analyzeMarker(m,t,i,s,n,o,!1,l,c,d);break;default:this._analyzeMultiLayerGraphicNonSDF(e,t,i,r,a,s,n,o,l,h,!!m.colorLocked||!!c,d)}M&&s.pop()}}_analyzeTextGraphic(e,t,i,r,a,s,n,o){var me;const l=[];ce.findApplicableOverrides(i,this._primitiveOverrides,l);const h=i.geometry;if(!("x"in h)||!("y"in h))return;const c=i.symbol,d=Bi(c),p=ki(c.fontStyleName),_=Pi(c.fontFamilyName);c.font={family:_,decoration:d,...p};const f=O(c.height,B.CIMTextSymbol.height),g=O(c.angle),y=O(c.offsetX),m=O(c.offsetY),M=F(ye(c));let w=F(ke(c)),x=nt(c)??0;x||(w=F(ye(c.haloSymbol)),x=O(c.haloSize));let b=!1;if((me=c.symbol)!=null&&me.symbolLayers)for(const Z of c.symbol.symbolLayers)F(ye(Z))!=null&&(b=!!Z.colorLocked);const T=i.primitiveName;let P=null;b||(P=this._maybeGetValueOrOverrideExpression(T,"FillColor"));const z=this._maybeGetValueOrOverrideExpression(T,"TextSize"),U=this._maybeGetValueOrOverrideExpression(T,"TextAngle"),k=this._maybeGetValueOrOverrideExpression(T,"TextOffsetX"),W=this._maybeGetValueOrOverrideExpression(T,"TextOffsetY");let V=null,q=null,Y=0;if(c.callout&&c.callout.type==="CIMBackgroundCallout"){const Z=c.callout;if(Z.backgroundSymbol){const fe=Z.backgroundSymbol.symbolLayers;if(fe)for(const le of fe)le.type==="CIMSolidFill"?V=F(le.color):le.type==="CIMSolidStroke"&&(q=F(le.color),Y=O(le.width,B.CIMSolidStroke.width))}}const K=this._getValueOrOverrideExpression(c.type,i.primitiveName,"TextString",i.textString??"");if(K==null)return;const{fontStyleName:G}=c,_e=_+(G?"-"+G.toLowerCase():"-regular"),oe=this._getMaterialOverrides(r,c.type);oe.push(...this._getPrimitiveMaterialOverrides(i.primitiveName,c.type));const Se={type:"text-rasterization-param",resource:{type:"text",textString:i.textString??"",font:c.font,symbol:c,primitiveName:i.primitiveName},overrides:oe};this._cimLayers.push({type:"text",lineWidth:null,textRasterizationParam:Se,colorLocked:!!o||!!b,effects:e,alignment:a,anchorPoint:{x:0,y:0},isAbsoluteAnchorPoint:!1,fontName:_e,decoration:d,weight:p.weight,style:p.style,size:z??f,angle:U??g,offsetX:k??y,offsetY:W??m,transform:{type:"cim-marker-transform-param",params:n},horizontalAlignment:Ai(c.horizontalAlignment),verticalAlignment:Ii(c.verticalAlignment),text:K,color:P??this._getValueOrOverrideExpression(c.type,i.primitiveName,"Color",M),outlineColor:w,outlineSize:x,backgroundColor:V,borderLineColor:q,borderLineWidth:Y,referenceSize:s,sizeRatio:1,markerPlacement:t})}_analyzeMultiLayerGraphicNonSDF(e,t,i,r,a,s,n,o,l,h,c,d){const p=this._buildSimpleMarker(e,a),_=e.primitiveName,f=this._analyzeMaterialOverrides(_,["Rotation","OffsetX","OffsetY"]),g=this._normalizePrimitiveOverrideProps(f),[y,m,M]=ae.getTextureAnchor(p,this._resourceManager),w=this._getMaterialOverrides(s,e.type);w.push(...g);const x={type:"sprite-rasterization-param",resource:{...p,avoidSDFRasterization:!0},overrides:w};this._cimLayers.push({type:"marker",spriteRasterizationParam:x,colorLocked:c,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:n,anchorPoint:{x:y,y:m},isAbsoluteAnchorPoint:!1,size:h,rotation:0,offsetX:0,offsetY:0,transform:{type:"cim-marker-transform-param",params:l},color:[255,255,255,1],outlineColor:[0,0,0,0],outlineWidth:0,scaleX:1,frameHeight:h,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:o,sizeRatio:M/ie(e.size),isOutline:d,markerPlacement:i,animatedSymbolProperties:r})}_createMarkerPlacementOverrideExpression(e){if(!e)return null;const t=[];return ce.findApplicableOverrides(e,this._primitiveOverrides,t),{type:"cim-marker-placement-info",placement:e,overrides:ft(t)}}_createAnimatedSymbolPropertiesOverrideExpression(e){if(!e)return null;const t=[];return ce.findApplicableOverrides(e,this._primitiveOverrides,t),{type:"cim-animation-info",animation:e,overrides:ft(t)}}_buildSimpleMarker(e,t){return{type:e.type,enable:!0,name:e.name,colorLocked:e.colorLocked,primitiveName:e.primitiveName,anchorPoint:e.anchorPoint,anchorPointUnits:e.anchorPointUnits,offsetX:0,offsetY:0,rotateClockwise:e.rotateClockwise,rotation:0,size:e.size,billboardMode3D:e.billboardMode3D,depth3D:e.depth3D,frame:e.frame,markerGraphics:[t],scaleSymbolsProportionally:e.scaleSymbolsProportionally,respectFrame:e.respectFrame,clippingPath:e.clippingPath}}_analyzeCompositeMarkerGraphic(e,t,i,r,a,s,n,o,l,h,c,d){const p=a.geometry,_=s[0],f=s[1],g=ot(p);if(!g)return;const y=e.anchorPointUnits!=="Relative",[m,M,w,x]=lt(g,e.frame,e.size,e.anchorPoint,y),{path:b}=f,T=f.primitiveName,P=_.primitiveName,z=a.primitiveName;let U=null;f.colorLocked||c||(U=this._maybeGetValueOrOverrideExpression(z,"FillColor"));const k=U??this._getValueOrOverrideExpression(f.type,T,"Color",F(f.color));let W=null;_.colorLocked||c||(W=this._maybeGetValueOrOverrideExpression(z,"StrokeColor"));const V=W??this._getValueOrOverrideExpression(_.type,P,"Color",F(_.color)),q=this._maybeGetValueOrOverrideExpression(z,"StrokeWidth")??this._getValueOrOverrideExpression(_.type,P,"Width",O(_.width,B.CIMSolidStroke.width)),Y={type:"sprite-rasterization-param",resource:b?{type:"path",path:b,asFill:!0}:{type:"sdf",geom:p,asFill:!0},overrides:[]};this._cimLayers.push({type:"marker",spriteRasterizationParam:Y,colorLocked:c,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:n,anchorPoint:{x:M,y:w},isAbsoluteAnchorPoint:y,size:h,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:l},frameHeight:h,widthRatio:x,rotateClockwise:!1,referenceSize:o,sizeRatio:m,color:k,outlineColor:V,outlineWidth:q,isOutline:d,markerPlacement:i,animatedSymbolProperties:r})}_setPoMap(e,t,i){let r;this._poMap[e]?r=this._poMap[e]:(r={},this._poMap[e]=r),r[t]=i}_maybeGetValueOrOverrideExpression(e,t,i){return this._getValueOrOverrideExpression("",e,t,i,!1)}_getValueOrOverrideExpression(e,t,i,r,a=!0){if(a&&!$i(r)&&(r=Be(e,i.toLowerCase())),t==null)return r;const s=this._poMap[t];if(s==null)return r;const n=s[i];return typeof n=="string"||typeof n=="number"||Array.isArray(n)?n:n?{valueExpressionInfo:n,defaultValue:r}:r}_analyzePrimitiveOverrides(e,t,i,r){if(e==null)return!1;typeof e=="string"&&(e=[e]);for(const a of this._primitiveOverrides)if(e.includes(a.primitiveName)&&a.valueExpressionInfo)return!0;if(t!=null){for(const a of t)if((a==null?void 0:a.overrides.length)>0)return!0}if(i!=null){for(const a of i)if((a==null?void 0:a.overrides.length)>0)return!0}if(r!=null){for(const a of r)if((a==null?void 0:a.overrides.length)>0)return!0}return!1}_getMaterialOverrides(e,t){if(!e)return[];const i=[];for(const r of e)i.push(...this._getPrimitiveMaterialOverrides(r,t));return i}_getPrimitiveMaterialOverrides(e,t){if(!e)return[];const i=this._normalizePrimitiveOverrideProps(this._primitiveOverrides.filter(r=>r.primitiveName===e));return i.forEach(r=>r.defaultValue=Be(t,r.propertyName.toLowerCase())),i}_analyzeMaterialOverrides(e,t){return this._primitiveOverrides.filter(i=>i.primitiveName!==e||!t.includes(i.propertyName))}_normalizePrimitiveOverrideProps(e){return e.map(t=>({...t,propertyName:kt(t.propertyName)}))}}function Ae(u){if(u&&u.indexOf("Level_")===0){const e=parseInt(u.substr(6),10);if(!isNaN(e))return e}return 0}const yr=u=>u&&u.length===2&&u[0].enable&&u[1].enable&&u[0].type==="CIMSolidStroke"&&u[1].type==="CIMSolidFill"&&u[0].path==null&&u[1].path==null&&!u[0].effects&&!u[1].effects;function vr(u){const e=u.symbolLayers;if(!e||e.length!==2)return!1;const t=e.find(r=>{var a;return(a=r.effects)==null?void 0:a.find(s=>s.type==="CIMGeometricEffectDashes"&&s.dashTemplate!=null)}),i=e.find(r=>{var a;return(a=r.effects)==null?void 0:a.find(s=>s.type==="CIMGeometricEffectAddControlPoints")});return!!t||!!i}function ft(u){return Ft(u).map(e=>({...e,propertyName:kt(e.propertyName)}))}let br=class{constructor(e){this.events=new Nt,this._hasMajorPerformanceCaveat=!1,this._lastRenderFrameCounter=0,this._canvas=document.createElement("canvas"),this._canvas.setAttribute("style","width: 100%; height:100%; display:block; willChange:transform");const t={failIfMajorPerformanceCaveat:!0,alpha:!0,antialias:!1,depth:!0,stencil:!0};e.appendChild(this._canvas);let i=Ke(this._canvas,t);i||(i=Ke(this._canvas,{...t,failIfMajorPerformanceCaveat:!1}),this._hasMajorPerformanceCaveat=!0),this._gl=i,this._handles=Ut([Vt(this._canvas,"webglcontextlost",r=>this.events.emit("webgl-context-lost",r))])}destroy(){var e;(e=this._canvas.parentNode)==null||e.removeChild(this._canvas),this._canvas=null,this._handles.remove(),this._gl=null}get gl(){return this._gl}render(e,t){if(this._hasMajorPerformanceCaveat||H("esri-force-performance-mode")){if(++this._lastRenderFrameCounter>=H("esri-performance-mode-frames-between-render")&&(t(),this._lastRenderViewState=e.state.clone(),this._lastRenderFrameCounter=0),this._lastRenderViewState){const[i,r,a,s,n,o]=this._computeViewTransform(this._lastRenderViewState,e.state);this._canvas.style.transform=`matrix(${i}, ${r}, ${a}, ${s}, ${n}, ${o})`}}else t()}resize(e){const t=this._canvas,i=t.style,{state:{size:r},pixelRatio:a}=e,s=r[0],n=r[1],o=Math.round(s*a),l=Math.round(n*a);t.width===o&&t.height===l||(t.width=o,t.height=l),i.width=s+"px",i.height=n+"px"}_computeViewTransform(e,t){const[i,r]=e.center,[a,s]=t.center,[n,o]=e.toScreen([0,0],a,s),[l,h]=e.toScreen([0,0],i,r),c=l-n,d=h-o,p=e.scale/t.scale,_=t.rotation-e.rotation,f=Xt();return Gt(f),Ht(f,f,[p,p]),Wt(f,f,qt(_)),jt(f,f,[c,d]),f}};const wr={background:{"background.frag":`#ifdef PATTERN uniform lowp float u_opacity; uniform lowp sampler2D u_texture; varying mediump vec4 v_tlbr; diff --git a/assets/mediaLayerUtils-LvFj83T-.js b/assets/mediaLayerUtils-DFCF50LE.js similarity index 73% rename from assets/mediaLayerUtils-LvFj83T-.js rename to assets/mediaLayerUtils-DFCF50LE.js index e5f06f6..3ca8b0a 100644 --- a/assets/mediaLayerUtils-LvFj83T-.js +++ b/assets/mediaLayerUtils-DFCF50LE.js @@ -1 +1 @@ -import{$ as l,j as c}from"./utils-2LBmsoaQ.js";import{eo as y,ei as f,ej as d,el as v}from"./index-CEWggaxV.js";import{p as s}from"./resourceUtils-Cu1-5qu3.js";import"./originUtils-D69mHv66.js";import"./multiOriginJSONSupportUtils-C0wm8_Yw.js";import"./saveAPIKeyUtils-BiX1lQSW.js";import"./saveUtils-BzCRy3uR.js";import"./resourceUtils-CjqYbm2Q.js";const o="Media Layer",x="media-layer-save",N="media-layer-save-as",n=["media-layer:unsupported-source"];function i(e){return{isValid:e.type==="media",errorMessage:"Layer.type should be 'media'"}}function m(e){return y(e,"portal-item",!0)}function p(e){return e.layerJSON}async function A(e,r){const{title:a,fullExtent:t}=e;r.title||(r.title=a),r.extent=t?await f(t):null,d(r,v.METADATA)}async function M(e,r){return l({layer:e,itemType:o,validateLayer:i,createJSONContext:a=>m(a),createItemData:p,errorNamePrefix:x,supplementalUnsupportedErrors:n,saveResources:(a,t)=>s(e.resourceReferences,t)},r)}async function O(e,r,a){return c({layer:e,itemType:o,validateLayer:i,createJSONContext:t=>m(t),createItemData:p,errorNamePrefix:N,supplementalUnsupportedErrors:n,newItem:r,setItemProperties:A,saveResources:(t,u)=>s(e.resourceReferences,u)},a)}export{M as save,O as saveAs}; +import{$ as l,j as c}from"./utils-iOpWi7jV.js";import{eo as y,ei as f,ej as d,el as v}from"./index-BjUNJPVf.js";import{p as s}from"./resourceUtils-p9pTIVIi.js";import"./originUtils-D69mHv66.js";import"./multiOriginJSONSupportUtils-C0wm8_Yw.js";import"./saveAPIKeyUtils-YRBbgdzi.js";import"./saveUtils-CGGzyvzv.js";import"./resourceUtils-CfE36DzP.js";const o="Media Layer",x="media-layer-save",N="media-layer-save-as",n=["media-layer:unsupported-source"];function i(e){return{isValid:e.type==="media",errorMessage:"Layer.type should be 'media'"}}function m(e){return y(e,"portal-item",!0)}function p(e){return e.layerJSON}async function A(e,r){const{title:a,fullExtent:t}=e;r.title||(r.title=a),r.extent=t?await f(t):null,d(r,v.METADATA)}async function M(e,r){return l({layer:e,itemType:o,validateLayer:i,createJSONContext:a=>m(a),createItemData:p,errorNamePrefix:x,supplementalUnsupportedErrors:n,saveResources:(a,t)=>s(e.resourceReferences,t)},r)}async function O(e,r,a){return c({layer:e,itemType:o,validateLayer:i,createJSONContext:t=>m(t),createItemData:p,errorNamePrefix:N,supplementalUnsupportedErrors:n,newItem:r,setItemProperties:A,saveResources:(t,u)=>s(e.resourceReferences,u)},a)}export{M as save,O as saveAs}; diff --git a/assets/meshFeatureSet-DmiifJYC.js b/assets/meshFeatureSet-BCixIf_6.js similarity index 77% rename from assets/meshFeatureSet-DmiifJYC.js rename to assets/meshFeatureSet-BCixIf_6.js index 4858913..b6b5af7 100644 --- a/assets/meshFeatureSet-DmiifJYC.js +++ b/assets/meshFeatureSet-BCixIf_6.js @@ -1 +1 @@ -import{aS as E,j as S,aE as y,aA as w,Z as h,s as D}from"./index-CEWggaxV.js";import{$ as d}from"./Mesh-9oOqPmbT.js";import{d as M}from"./georeference-DtjTZVKi.js";import{o as N,i as F}from"./External-DC51KyR4.js";import{s as T}from"./infoFor3D-DsOdlPuA.js";import{d as I}from"./FeatureSet-CYJUZgOk.js";import"./imageUtils-DNanu5Rn.js";import"./MeshLocalVertexSpace-Cltwu1Kq.js";import"./meshVertexSpaceUtils-BFWpJFSd.js";import"./vec3-CjYmIfaa.js";import"./earcut-hRlx3adE.js";import"./DoubleArray-DxyNBrRi.js";import"./Indices-Dv-cCjFT.js";import"./deduplicate-Bk22TunD.js";import"./plane-py4f_JCU.js";import"./mat3f64-q3fE-ZOt.js";import"./mat4f64-CSKppSlJ.js";import"./quatf64-Bdb9ZJJK.js";import"./triangle-CU37cZF1.js";import"./Util-BS8sJGjF.js";import"./ObjectStack-CF0cQvd2.js";import"./lineSegment-B9UF3nEF.js";import"./basicInterfaces-GbxEOYtk.js";import"./VertexAttribute-BlT9lbVY.js";import"./quat-CoKEr4Zu.js";import"./computeTranslationToOriginAndRotation-DOOKw0d1.js";import"./BufferView-Ao_K-5Vg.js";const l=()=>D.getLogger("esri.rest.support.meshFeatureSet");function it(t,e,r){const o=r.features;r.features=[],delete r.geometryType;const n=I.fromJSON(r);if(n.geometryType="mesh",!r.assetMaps)return n;const s=$(e,r.assetMaps),i=t.sourceSpatialReference??E.WGS84,p=r.globalIdFieldName,{outFields:a}=t,f=a!=null&&a.length>0?x(a.includes("*")?null:new Set(a)):()=>({});for(const m of o){const u=A(m,p,i,e,s);u!=null&&n.features.push(new S({geometry:u,attributes:f(m)}))}return n}function x(t){return({attributes:e})=>{if(!e)return{};if(!t)return e;for(const r in e)t.has(r)||delete e[r];return e}}function A(t,e,r,o,n){const s=t.attributes[e],i=n.get(s);if(i==null)return l().error("mesh-feature-set:asset-not-found","Service returned a feature which was not found in the asset map",t),null;if(!t.geometry)return l().error("mesh-feature-set:no-geometry","Service returned a feature without geometry",t),null;const p=L(t,r,o),a=y.fromJSON(t.geometry);a.spatialReference=r;const f=O(t.attributes,o),m=r.isGeographic?"local":"georeferenced",u=P(i);return u?d.createWithExternalSource(p,u,{extent:a,transform:f,vertexSpace:m}):d.createIncomplete(p,{extent:a,transform:f,vertexSpace:m})}function L({attributes:t},e,{transformFieldRoles:r}){const o=t[r.originX],n=t[r.originY],s=t[r.originZ];return new w({x:o,y:n,z:s,spatialReference:e})}function O(t,{transformFieldRoles:e}){return new M({translation:[t[e.translationX],-t[e.translationZ],t[e.translationY]],rotationAxis:[t[e.rotationX],-t[e.rotationZ],t[e.rotationY]],rotationAngle:t[e.rotationDeg],scale:[t[e.scaleX],t[e.scaleZ],t[e.scaleY]]})}var c;function $(t,e){const r=new Map;for(const o of e){const n=o.parentGlobalId;if(n==null)continue;const s=o.assetName,i=o.assetType,p=o.assetHash,a=o.assetURL,f=o.conversionStatus,m=o.seqNo,u=T(i,t.supportedFormats);if(!u){l().error("mesh-feature-set:unknown-format",`Service returned an asset of type ${i}, but it does not list it as a supported type`);continue}const g=h(r,n,()=>({files:new Map}));h(g.files,s,()=>({name:s,type:i,mimeType:u,status:b(f),parts:[]})).parts[m]={hash:p,url:a}}return r}function P(t){const e=Array.from(t.files.values()),r=new Array;for(const o of e){if(o.status!==c.COMPLETED)return null;const n=new Array;for(const s of o.parts){if(!s)return null;n.push(new N(s.url,s.hash))}r.push(new F(o.name,o.mimeType,n))}return r}function b(t){switch(t){case"COMPLETED":case"SUBMITTED":return c.COMPLETED;case"INPROGRESS":return c.PENDING;default:return c.FAILED}}(function(t){t[t.FAILED=0]="FAILED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"})(c||(c={}));export{$ as assetMapFromAssetMapsJSON,A as extractMesh,it as meshFeatureSetFromJSON}; +import{aS as E,j as S,aE as y,aA as w,Z as h,s as D}from"./index-BjUNJPVf.js";import{$ as d}from"./Mesh--rTzs1p1.js";import{d as M}from"./georeference-DqFdARS7.js";import{o as N,i as F}from"./External-DIoD7Bb4.js";import{s as T}from"./infoFor3D-DsOdlPuA.js";import{d as I}from"./FeatureSet-opEn8ou8.js";import"./imageUtils-ChIDAvDr.js";import"./MeshLocalVertexSpace-DRvwbFTJ.js";import"./meshVertexSpaceUtils-DwMoblqo.js";import"./vec3-DdRUbala.js";import"./earcut-CWKXDqDj.js";import"./DoubleArray--0pYeNcV.js";import"./Indices-BRm9v2lM.js";import"./deduplicate-BR6i8Xk0.js";import"./plane-DxOTtTwj.js";import"./mat3f64-q3fE-ZOt.js";import"./mat4f64-CSKppSlJ.js";import"./quatf64-Bdb9ZJJK.js";import"./triangle-DmKBscqo.js";import"./Util-CS5u4Lec.js";import"./ObjectStack-BAIuPeIh.js";import"./lineSegment-BYtydnRZ.js";import"./basicInterfaces-GbxEOYtk.js";import"./VertexAttribute-BlT9lbVY.js";import"./quat-C0wQB0HB.js";import"./computeTranslationToOriginAndRotation-BeE3rOSz.js";import"./BufferView-3om6S_aJ.js";const l=()=>D.getLogger("esri.rest.support.meshFeatureSet");function it(t,e,r){const o=r.features;r.features=[],delete r.geometryType;const n=I.fromJSON(r);if(n.geometryType="mesh",!r.assetMaps)return n;const s=$(e,r.assetMaps),i=t.sourceSpatialReference??E.WGS84,p=r.globalIdFieldName,{outFields:a}=t,f=a!=null&&a.length>0?x(a.includes("*")?null:new Set(a)):()=>({});for(const m of o){const u=A(m,p,i,e,s);u!=null&&n.features.push(new S({geometry:u,attributes:f(m)}))}return n}function x(t){return({attributes:e})=>{if(!e)return{};if(!t)return e;for(const r in e)t.has(r)||delete e[r];return e}}function A(t,e,r,o,n){const s=t.attributes[e],i=n.get(s);if(i==null)return l().error("mesh-feature-set:asset-not-found","Service returned a feature which was not found in the asset map",t),null;if(!t.geometry)return l().error("mesh-feature-set:no-geometry","Service returned a feature without geometry",t),null;const p=L(t,r,o),a=y.fromJSON(t.geometry);a.spatialReference=r;const f=O(t.attributes,o),m=r.isGeographic?"local":"georeferenced",u=P(i);return u?d.createWithExternalSource(p,u,{extent:a,transform:f,vertexSpace:m}):d.createIncomplete(p,{extent:a,transform:f,vertexSpace:m})}function L({attributes:t},e,{transformFieldRoles:r}){const o=t[r.originX],n=t[r.originY],s=t[r.originZ];return new w({x:o,y:n,z:s,spatialReference:e})}function O(t,{transformFieldRoles:e}){return new M({translation:[t[e.translationX],-t[e.translationZ],t[e.translationY]],rotationAxis:[t[e.rotationX],-t[e.rotationZ],t[e.rotationY]],rotationAngle:t[e.rotationDeg],scale:[t[e.scaleX],t[e.scaleZ],t[e.scaleY]]})}var c;function $(t,e){const r=new Map;for(const o of e){const n=o.parentGlobalId;if(n==null)continue;const s=o.assetName,i=o.assetType,p=o.assetHash,a=o.assetURL,f=o.conversionStatus,m=o.seqNo,u=T(i,t.supportedFormats);if(!u){l().error("mesh-feature-set:unknown-format",`Service returned an asset of type ${i}, but it does not list it as a supported type`);continue}const g=h(r,n,()=>({files:new Map}));h(g.files,s,()=>({name:s,type:i,mimeType:u,status:b(f),parts:[]})).parts[m]={hash:p,url:a}}return r}function P(t){const e=Array.from(t.files.values()),r=new Array;for(const o of e){if(o.status!==c.COMPLETED)return null;const n=new Array;for(const s of o.parts){if(!s)return null;n.push(new N(s.url,s.hash))}r.push(new F(o.name,o.mimeType,n))}return r}function b(t){switch(t){case"COMPLETED":case"SUBMITTED":return c.COMPLETED;case"INPROGRESS":return c.PENDING;default:return c.FAILED}}(function(t){t[t.FAILED=0]="FAILED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"})(c||(c={}));export{$ as assetMapFromAssetMapsJSON,A as extractMesh,it as meshFeatureSetFromJSON}; diff --git a/assets/meshVertexSpaceUtils-BFWpJFSd.js b/assets/meshVertexSpaceUtils-DwMoblqo.js similarity index 87% rename from assets/meshVertexSpaceUtils-BFWpJFSd.js rename to assets/meshVertexSpaceUtils-DwMoblqo.js index c2dce7a..4960a0b 100644 --- a/assets/meshVertexSpaceUtils-BFWpJFSd.js +++ b/assets/meshVertexSpaceUtils-DwMoblqo.js @@ -1 +1 @@ -import{aA as p,ci as f,s as l}from"./index-CEWggaxV.js";import{a as s,i as n}from"./MeshLocalVertexSpace-Cltwu1Kq.js";import{i as x}from"./vec3-CjYmIfaa.js";function g(){return l.getLogger("esri.geometry.Mesh")}function d(r){const{vertexSpace:e}=r;if(e.origin!=null)return r.clone();const{anchor:c}=r,i=c.clone(),a=new n({origin:[i.x,i.y,i.z]}),o=r.cloneWithVertexSpace(a),{position:t}=o.vertexAttributes;return o.vertexAttributes.position=x(new Float64Array(t.length),t,[-i.x,-i.y,-(i.z??0)]),o.vertexAttributesChanged(),o}function u(r){return r.origin!=null}function m(r){return u(r.vertexSpace)}function S(r,e){if(!u(r))return null;const[c,i,a]=r.origin;return new p({x:c,y:i,z:a,spatialReference:e})}function b(r,e){const{x:c,y:i,z:a,spatialReference:o}=r,t=[c,i,a??0];if((e==null?void 0:e.geographic)!==void 0){if(f(g(),"option: geographic",{replacement:"use vertexSpace option instead",version:"4.29",warnOnce:!0}),!(e!=null&&e.vertexSpace))return e!=null&&e.geographic?new s({origin:t}):new n({origin:t});g().warn("Deprecated geographic flag ignored since vertexSpace option is provided.")}if(!(e!=null&&e.vertexSpace))return o.isGeographic||o.isWebMercator?new s({origin:t}):new n({origin:t});switch(e.vertexSpace){case"local":return new s({origin:t});case"georeferenced":return new n({origin:t});case"georeferenced-absolute":return new n}}function y(r){return r.isGeographic||r.isWebMercator?"local":"georeferenced"}function A(r,e){return r==="local"?new s({origin:e}):new n({origin:e})}export{d as a,b as f,u as g,A as h,y as l,m as p,S as u}; +import{aA as p,ci as f,s as l}from"./index-BjUNJPVf.js";import{a as s,i as n}from"./MeshLocalVertexSpace-DRvwbFTJ.js";import{i as x}from"./vec3-DdRUbala.js";function g(){return l.getLogger("esri.geometry.Mesh")}function d(r){const{vertexSpace:e}=r;if(e.origin!=null)return r.clone();const{anchor:c}=r,i=c.clone(),a=new n({origin:[i.x,i.y,i.z]}),o=r.cloneWithVertexSpace(a),{position:t}=o.vertexAttributes;return o.vertexAttributes.position=x(new Float64Array(t.length),t,[-i.x,-i.y,-(i.z??0)]),o.vertexAttributesChanged(),o}function u(r){return r.origin!=null}function m(r){return u(r.vertexSpace)}function S(r,e){if(!u(r))return null;const[c,i,a]=r.origin;return new p({x:c,y:i,z:a,spatialReference:e})}function b(r,e){const{x:c,y:i,z:a,spatialReference:o}=r,t=[c,i,a??0];if((e==null?void 0:e.geographic)!==void 0){if(f(g(),"option: geographic",{replacement:"use vertexSpace option instead",version:"4.29",warnOnce:!0}),!(e!=null&&e.vertexSpace))return e!=null&&e.geographic?new s({origin:t}):new n({origin:t});g().warn("Deprecated geographic flag ignored since vertexSpace option is provided.")}if(!(e!=null&&e.vertexSpace))return o.isGeographic||o.isWebMercator?new s({origin:t}):new n({origin:t});switch(e.vertexSpace){case"local":return new s({origin:t});case"georeferenced":return new n({origin:t});case"georeferenced-absolute":return new n}}function y(r){return r.isGeographic||r.isWebMercator?"local":"georeferenced"}function A(r,e){return r==="local"?new s({origin:e}):new n({origin:e})}export{d as a,b as f,u as g,A as h,y as l,m as p,S as u}; diff --git a/assets/multidimensionalUtils-uKyVhR8j.js b/assets/multidimensionalUtils-u3oUX4w1.js similarity index 99% rename from assets/multidimensionalUtils-uKyVhR8j.js rename to assets/multidimensionalUtils-u3oUX4w1.js index 72c8ac6..812ab10 100644 --- a/assets/multidimensionalUtils-uKyVhR8j.js +++ b/assets/multidimensionalUtils-u3oUX4w1.js @@ -1 +1 @@ -import{d as h,y as g,fe as v,f as U,aU as x,aV as k,q as F}from"./index-CEWggaxV.js";var y;let d=y=class extends x{constructor(e){super(e),this.variableName=null,this.dimensionName=null,this.values=[],this.isSlice=!1}clone(){return new y({variableName:this.variableName,dimensionName:this.dimensionName,values:k(this.values),isSlice:this.isSlice})}};h([g({type:String,json:{write:!0}})],d.prototype,"variableName",void 0),h([g({type:String,json:{write:!0}})],d.prototype,"dimensionName",void 0),h([g({type:v.array(v.oneOf([v.native(Number),v.array(v.native(Number))])),json:{write:!0}})],d.prototype,"values",void 0),h([g({type:Boolean,json:{write:!0}})],d.prototype,"isSlice",void 0),d=y=h([U("esri.layers.support.DimensionalDefinition")],d);const N=d;function D(e,n,i){var t;const o=n.shift();if(i.length===0){const s=[];i.push({sliceId:-1,multidimensionalDefinition:s})}const a=i.length;for(let s=0;s{i.push({sliceId:-1,multidimensionalDefinition:[...m,{variableName:e,dimensionName:o.name,values:[l]}]})})}n.length&&D(e,n,i)}function L(e,n){const i=[];let o=0;return(n?e.variables.filter(a=>a.name.toLowerCase()===n.toLowerCase()):[...e.variables].sort((a,t)=>a.name>t.name?1:-1)).forEach(a=>{const t=[],s=[...a.dimensions].sort((m,l)=>m.name>l.name?-1:1);D(a.name,s,t),t.forEach(m=>{i.push({...m,sliceId:o++})})}),i}function j(e,n,i){let o=e;if(n&&(n=[...n].sort((a,t)=>a.dimensionName{t.length&&(o=o.filter(m=>{const l=m.multidimensionalDefinition.find(r=>r.dimensionName===a);if(l==null)return!1;const u=l.values[0];return typeof u=="number"?typeof t[0]=="number"?t.includes(u):t.some(r=>r[0]<=u&&r[1]>=u):typeof t[0]=="number"?t.some(r=>u[0]<=r&&u[1]>=r):s?t.some(r=>r[0]===u[0]&&r[0]===u[1]):t.some(r=>r[0]>=u[0]&&r[0]<=u[1]||r[1]>=u[0]&&r[1]<=u[1]||r[0]u[1])}))}),o.length&&(i==null?void 0:i.start)!=null&&i.end!=null){const a=i.start.getTime(),t=i.end.getTime(),s=o[0].multidimensionalDefinition.findIndex(m=>m.dimensionName==="StdTime");s>-1&&(o=o.filter(m=>{const l=m.multidimensionalDefinition[s].values[0];return a<=l&&t>=l}))}return o.map(a=>a.sliceId)}function w(e,n){return Array.isArray(e)?n[0]===n[1]?e[0]===n[0]||e[1]===n[0]:e[0]>=n[0]&&e[0]<=n[1]&&e[1]>=n[0]&&e[1]<=n[1]:e>=n[0]&&e<=n[1]}function A(e,n){return e[0]<=n[0]&&e[1]>=n[0]||e[0]<=n[1]&&e[1]>=n[1]||e[0]>=n[0]&&e[1]<=n[1]}function M(e){return e.length===1?[e[0],e[0]]:[e[0],e[e.length-1]]}function C(e,n,i){var s,m;if(!((s=n==null?void 0:n.subsetDefinitions)!=null&&s.length))return e;let o;if(i){const{variables:l}=n;if(l.length&&!l.includes(i))return null;const u=n.subsetDefinitions.find(r=>r.dimensionName===e.name&&r.variableName===i);if(!((m=u==null?void 0:u.values)!=null&&m.length))return e;o=M(u.values)}else{const l=n.dimensions.find(({name:u})=>u===e.name);o=l==null?void 0:l.extent}const a=o;if(!(a!=null&&a.length))return e;const t=e.values.filter(l=>w(l,a));return{...e,extent:[...a],values:t}}function T(e,n,i){var a;if(!((a=n==null?void 0:n.subsetDefinitions)!=null&&a.length))return!1;const{variables:o}=n;if(o.length&&e.some(({variableName:t})=>t&&!o.includes(t)))return!0;for(let t=0;t(s.variableName===""||l.variableName===s.variableName)&&l.dimensionName===s.dimensionName);if(m!=null&&m.values.length){const l=M(m.values);if(!s.isSlice&&s.values.length===2&&!Array.isArray(s.values[0])&&s.values[0]!==s.values[1]&&i){if(!A(s.values,l))return!0}else if(s.values.some(u=>!w(u,l)))return!0}}return!1}function R(e,n){if(e==null)return{isOutside:!1};const{geometry:i,timeExtent:o,multidimensionalDefinition:a}=n;let t=null;if(o!=null&&(t=Y(e,o),t==null))return{isOutside:!0};const{areaOfInterest:s}=e;if(s&&i){const m=i.type==="point"?i:i.type==="extent"?i.center:i.type==="polygon"?i.centroid:null;if(m&&!s.contains(m))return{isOutside:!0}}return a!=null&&a.length&&T(a,e,!0)?{isOutside:!0}:{isOutside:!1,intersection:{geometry:i,timeExtent:t,multidimensionalDefinition:a}}}function Y(e,n){const i=e.dimensions.find(({name:s})=>s==="StdTime");if(i==null||n.start==null&&n.end==null)return n;n=n.clone();const{start:o,end:a}=n.toJSON(),t=o===a?[o]:o!=null&&a!=null?[o,a]:[o??a];return t.length===2&&(i!=null&&i.extent.length)&&(t[0]=Math.max(t[0],i.extent[0]),t[1]=Math.min(t[1],i.extent[1]??i.extent[0]),t[1]t.variables.includes(f))),l?u.find(({name:f})=>f===l)??u[0]:u[0]}function $(e,n={}){const i=I(e,n);if(!i)return null;const o=[],{dimensions:a,name:t}=i;if(a.length===0)return[new N({variableName:t,dimensionName:"",values:[],isSlice:!0})];for(let s=0;s{if(n.values==null)return!0;const i=n.values.length;return i===0||i>1||!n.isSlice&&Array.isArray(n.values[0])})}function q(e,n){var o;if(n==null||e==null)return null;let i=n.variables.map(a=>({...a}));return(o=e==null?void 0:e.variables)!=null&&o.length&&(i=i.filter(({name:a})=>e.variables.includes(a)),i.forEach(a=>{a.dimensions=a.dimensions.map(t=>C(t,e,a.name)).filter(F)})),i}function O(e,n){var m;const{values:i}=n;if(i!=null&&i.length){const l=Array.isArray(i[0]),u=Array.isArray(e);return l!==u?-1:l&&u?i.findIndex(r=>r[0]===e[0]&&r[1]===e[1]):i.indexOf(e)}const{extent:o}=n;if(Array.isArray(e)||eo[1])return-1;const a=n.interval||1;if(n.unit!=="ISO8601")return Math.round((e-o[0])/a);const t=o[0];let s=-1;switch(((m=n.intervalUnit)==null?void 0:m.toLowerCase())||"seconds"){case"seconds":s=Math.round((e-t)/1e3/a);break;case"minutes":s=Math.round((e-t)/6e4/a);break;case"hours":s=Math.round((e-t)/36e5/a);break;case"days":s=Math.round((e-t)/864e5/a);break;case"months":{const l=new Date(e).getUTCFullYear()-new Date(t).getUTCFullYear(),u=new Date(t).getUTCMonth(),r=new Date(e).getUTCMonth();s=l===0?r-u:r+11-u+12*(l-1)}break;case"years":s=Math.round((new Date(e).getUTCFullYear()-new Date(t).getUTCFullYear())/a);break;case"decades":s=Math.round((new Date(e).getUTCFullYear()-new Date(t).getUTCFullYear())/10/a)}return s}function p(e){var s,m;let n=(s=e.values)==null?void 0:s.length;if(n)return n;const{extent:i,unit:o}=e,a=e.interval||1,t=i?i[1]-i[0]:0;if(o!=="ISO8601")return Math.round(t/a);switch(((m=e.intervalUnit)==null?void 0:m.toLowerCase())??"seconds"){case"seconds":n=Math.round(t/1e3/a);break;case"minutes":n=Math.round(t/6e4/a);break;case"hours":n=Math.round(t/36e5/a);break;case"days":n=Math.round(t/864e5/a);break;case"months":{const l=new Date(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear(),u=new Date(i[0]).getUTCMonth(),r=new Date(i[1]).getUTCMonth();n=l===0?r-u+1:r+11-u+12*(l-1)+1}break;case"years":n=Math.round((new Date(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear())/a);break;case"decades":n=Math.round((new Date(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear())/10/a);break;default:n=0}return n}function z(e,n){let i=0;const o=e[0].variableName,a=[...n.variables].sort((t,s)=>t.name>s.name?1:-1);for(let t=0;tr.name>c.name?-1:1);if(s.name!==o){i+=m.map(r=>p(r)).reduce((r,c)=>r*c);continue}const l=m.map(r=>p(r)),u=m.length;for(let r=0;rb.dimensionName===m[r].name);if(c==null)return null;const f=O(c.values[0],m[r]);if(f===-1)return null;l.shift(),i+=r===u-1?f:f*l.reduce((b,S)=>b*S)}break}return i}export{z as D,j as a,$ as d,I as f,q as g,V as h,L as i,R as m,T as o,N as p}; +import{d as h,y as g,fe as v,f as U,aU as x,aV as k,q as F}from"./index-BjUNJPVf.js";var y;let d=y=class extends x{constructor(e){super(e),this.variableName=null,this.dimensionName=null,this.values=[],this.isSlice=!1}clone(){return new y({variableName:this.variableName,dimensionName:this.dimensionName,values:k(this.values),isSlice:this.isSlice})}};h([g({type:String,json:{write:!0}})],d.prototype,"variableName",void 0),h([g({type:String,json:{write:!0}})],d.prototype,"dimensionName",void 0),h([g({type:v.array(v.oneOf([v.native(Number),v.array(v.native(Number))])),json:{write:!0}})],d.prototype,"values",void 0),h([g({type:Boolean,json:{write:!0}})],d.prototype,"isSlice",void 0),d=y=h([U("esri.layers.support.DimensionalDefinition")],d);const N=d;function D(e,n,i){var t;const o=n.shift();if(i.length===0){const s=[];i.push({sliceId:-1,multidimensionalDefinition:s})}const a=i.length;for(let s=0;s{i.push({sliceId:-1,multidimensionalDefinition:[...m,{variableName:e,dimensionName:o.name,values:[l]}]})})}n.length&&D(e,n,i)}function L(e,n){const i=[];let o=0;return(n?e.variables.filter(a=>a.name.toLowerCase()===n.toLowerCase()):[...e.variables].sort((a,t)=>a.name>t.name?1:-1)).forEach(a=>{const t=[],s=[...a.dimensions].sort((m,l)=>m.name>l.name?-1:1);D(a.name,s,t),t.forEach(m=>{i.push({...m,sliceId:o++})})}),i}function j(e,n,i){let o=e;if(n&&(n=[...n].sort((a,t)=>a.dimensionName{t.length&&(o=o.filter(m=>{const l=m.multidimensionalDefinition.find(r=>r.dimensionName===a);if(l==null)return!1;const u=l.values[0];return typeof u=="number"?typeof t[0]=="number"?t.includes(u):t.some(r=>r[0]<=u&&r[1]>=u):typeof t[0]=="number"?t.some(r=>u[0]<=r&&u[1]>=r):s?t.some(r=>r[0]===u[0]&&r[0]===u[1]):t.some(r=>r[0]>=u[0]&&r[0]<=u[1]||r[1]>=u[0]&&r[1]<=u[1]||r[0]u[1])}))}),o.length&&(i==null?void 0:i.start)!=null&&i.end!=null){const a=i.start.getTime(),t=i.end.getTime(),s=o[0].multidimensionalDefinition.findIndex(m=>m.dimensionName==="StdTime");s>-1&&(o=o.filter(m=>{const l=m.multidimensionalDefinition[s].values[0];return a<=l&&t>=l}))}return o.map(a=>a.sliceId)}function w(e,n){return Array.isArray(e)?n[0]===n[1]?e[0]===n[0]||e[1]===n[0]:e[0]>=n[0]&&e[0]<=n[1]&&e[1]>=n[0]&&e[1]<=n[1]:e>=n[0]&&e<=n[1]}function A(e,n){return e[0]<=n[0]&&e[1]>=n[0]||e[0]<=n[1]&&e[1]>=n[1]||e[0]>=n[0]&&e[1]<=n[1]}function M(e){return e.length===1?[e[0],e[0]]:[e[0],e[e.length-1]]}function C(e,n,i){var s,m;if(!((s=n==null?void 0:n.subsetDefinitions)!=null&&s.length))return e;let o;if(i){const{variables:l}=n;if(l.length&&!l.includes(i))return null;const u=n.subsetDefinitions.find(r=>r.dimensionName===e.name&&r.variableName===i);if(!((m=u==null?void 0:u.values)!=null&&m.length))return e;o=M(u.values)}else{const l=n.dimensions.find(({name:u})=>u===e.name);o=l==null?void 0:l.extent}const a=o;if(!(a!=null&&a.length))return e;const t=e.values.filter(l=>w(l,a));return{...e,extent:[...a],values:t}}function T(e,n,i){var a;if(!((a=n==null?void 0:n.subsetDefinitions)!=null&&a.length))return!1;const{variables:o}=n;if(o.length&&e.some(({variableName:t})=>t&&!o.includes(t)))return!0;for(let t=0;t(s.variableName===""||l.variableName===s.variableName)&&l.dimensionName===s.dimensionName);if(m!=null&&m.values.length){const l=M(m.values);if(!s.isSlice&&s.values.length===2&&!Array.isArray(s.values[0])&&s.values[0]!==s.values[1]&&i){if(!A(s.values,l))return!0}else if(s.values.some(u=>!w(u,l)))return!0}}return!1}function R(e,n){if(e==null)return{isOutside:!1};const{geometry:i,timeExtent:o,multidimensionalDefinition:a}=n;let t=null;if(o!=null&&(t=Y(e,o),t==null))return{isOutside:!0};const{areaOfInterest:s}=e;if(s&&i){const m=i.type==="point"?i:i.type==="extent"?i.center:i.type==="polygon"?i.centroid:null;if(m&&!s.contains(m))return{isOutside:!0}}return a!=null&&a.length&&T(a,e,!0)?{isOutside:!0}:{isOutside:!1,intersection:{geometry:i,timeExtent:t,multidimensionalDefinition:a}}}function Y(e,n){const i=e.dimensions.find(({name:s})=>s==="StdTime");if(i==null||n.start==null&&n.end==null)return n;n=n.clone();const{start:o,end:a}=n.toJSON(),t=o===a?[o]:o!=null&&a!=null?[o,a]:[o??a];return t.length===2&&(i!=null&&i.extent.length)&&(t[0]=Math.max(t[0],i.extent[0]),t[1]=Math.min(t[1],i.extent[1]??i.extent[0]),t[1]t.variables.includes(f))),l?u.find(({name:f})=>f===l)??u[0]:u[0]}function $(e,n={}){const i=I(e,n);if(!i)return null;const o=[],{dimensions:a,name:t}=i;if(a.length===0)return[new N({variableName:t,dimensionName:"",values:[],isSlice:!0})];for(let s=0;s{if(n.values==null)return!0;const i=n.values.length;return i===0||i>1||!n.isSlice&&Array.isArray(n.values[0])})}function q(e,n){var o;if(n==null||e==null)return null;let i=n.variables.map(a=>({...a}));return(o=e==null?void 0:e.variables)!=null&&o.length&&(i=i.filter(({name:a})=>e.variables.includes(a)),i.forEach(a=>{a.dimensions=a.dimensions.map(t=>C(t,e,a.name)).filter(F)})),i}function O(e,n){var m;const{values:i}=n;if(i!=null&&i.length){const l=Array.isArray(i[0]),u=Array.isArray(e);return l!==u?-1:l&&u?i.findIndex(r=>r[0]===e[0]&&r[1]===e[1]):i.indexOf(e)}const{extent:o}=n;if(Array.isArray(e)||eo[1])return-1;const a=n.interval||1;if(n.unit!=="ISO8601")return Math.round((e-o[0])/a);const t=o[0];let s=-1;switch(((m=n.intervalUnit)==null?void 0:m.toLowerCase())||"seconds"){case"seconds":s=Math.round((e-t)/1e3/a);break;case"minutes":s=Math.round((e-t)/6e4/a);break;case"hours":s=Math.round((e-t)/36e5/a);break;case"days":s=Math.round((e-t)/864e5/a);break;case"months":{const l=new Date(e).getUTCFullYear()-new Date(t).getUTCFullYear(),u=new Date(t).getUTCMonth(),r=new Date(e).getUTCMonth();s=l===0?r-u:r+11-u+12*(l-1)}break;case"years":s=Math.round((new Date(e).getUTCFullYear()-new Date(t).getUTCFullYear())/a);break;case"decades":s=Math.round((new Date(e).getUTCFullYear()-new Date(t).getUTCFullYear())/10/a)}return s}function p(e){var s,m;let n=(s=e.values)==null?void 0:s.length;if(n)return n;const{extent:i,unit:o}=e,a=e.interval||1,t=i?i[1]-i[0]:0;if(o!=="ISO8601")return Math.round(t/a);switch(((m=e.intervalUnit)==null?void 0:m.toLowerCase())??"seconds"){case"seconds":n=Math.round(t/1e3/a);break;case"minutes":n=Math.round(t/6e4/a);break;case"hours":n=Math.round(t/36e5/a);break;case"days":n=Math.round(t/864e5/a);break;case"months":{const l=new Date(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear(),u=new Date(i[0]).getUTCMonth(),r=new Date(i[1]).getUTCMonth();n=l===0?r-u+1:r+11-u+12*(l-1)+1}break;case"years":n=Math.round((new Date(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear())/a);break;case"decades":n=Math.round((new Date(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear())/10/a);break;default:n=0}return n}function z(e,n){let i=0;const o=e[0].variableName,a=[...n.variables].sort((t,s)=>t.name>s.name?1:-1);for(let t=0;tr.name>c.name?-1:1);if(s.name!==o){i+=m.map(r=>p(r)).reduce((r,c)=>r*c);continue}const l=m.map(r=>p(r)),u=m.length;for(let r=0;rb.dimensionName===m[r].name);if(c==null)return null;const f=O(c.values[0],m[r]);if(f===-1)return null;l.shift(),i+=r===u-1?f:f*l.reduce((b,S)=>b*S)}break}return i}export{z as D,j as a,$ as d,I as f,q as g,V as h,L as i,R as m,T as o,N as p}; diff --git a/assets/normalizeUtilsSync-B6VufdiX.js b/assets/normalizeUtilsSync-73yZ0QwV.js similarity index 98% rename from assets/normalizeUtilsSync-B6VufdiX.js rename to assets/normalizeUtilsSync-73yZ0QwV.js index 67a9636..d90167d 100644 --- a/assets/normalizeUtilsSync-B6VufdiX.js +++ b/assets/normalizeUtilsSync-73yZ0QwV.js @@ -1 +1 @@ -import{ai as V,aj as A,a2 as X,ak as j,al as T,aa as F,ad as J,F as N,ab as R,ac as k,am as $,an as q,ao as z,ap as p}from"./index-CEWggaxV.js";function K(t){return M(t,!0)}function Q(t){return M(t,!1)}function M(t,s){if(t==null)return null;const i=t.spatialReference,n=A(i),e=X(t)?t.toJSON():t;if(!n)return e;const h=j(i)?102100:4326,u=T[h].maxX,x=T[h].minX;if(F(e))return S(e,u,x);if(J(e))return e.points=e.points.map(o=>S(o,u,x)),e;if(N(e))return B(e,n);if(R(e)||k(e)){const o=$(E,e),r={xmin:o[0],ymin:o[1],xmax:o[2],ymax:o[3]},a=p(r.xmin,x)*(2*u),_=a===0?e:q(e,a);return r.xmin+=a,r.xmax+=a,r.xmax>u?L(_,u,s):r.xminn.extent);return i.length<2?i[0]||t:i.length>2?(t.xmin=s.valid[0],t.xmax=s.valid[1],t):{rings:i.map(n=>[[n.xmin,n.ymin],[n.xmin,n.ymax],[n.xmax,n.ymax],[n.xmax,n.ymin],[n.xmin,n.ymin]])}}function S(t,s,i){if(Array.isArray(t)){const n=t[0];if(n>s){const e=p(n,s);t[0]=n+e*(-2*s)}else if(ns){const e=p(n,s);t.x+=e*(-2*s)}else if(n0;if(x>2*r){const v={xmin:hl||b?i.push(new m({xmin:a,ymin:n,xmax:r,ymax:e},[_]),new m({xmin:o,ymin:n,xmax:l,ymax:e},[c])):i.push(new m({xmin:a,ymin:n,xmax:l,ymax:e},[_]));return i}function w(t,s){const[i,n]=s.valid,e=2*n;let h,u=0;return t>n?(h=Math.ceil(Math.abs(t-n)/e),t-=h*e,u=h):t=t.xmin&&s<=t.xmax&&i>=t.ymin&&i<=t.ymax}function L(t,s,i=!0){const n=!k(t);if(n&&z(t),i)return new G().cut(t,s);const e=n?t.rings:t.paths,h=n?4:2,u=e.length,x=-2*s;for(let o=0;o=h){const a=[];for(const _ of r)a.push([_[0]+x,_[1]]);e.push(a)}}return n?t.rings=e:t.paths=e,t}class m{constructor(s,i){this.extent=s,this.frameIds=i}}const E=V();class G{constructor(){this._linesIn=[],this._linesOut=[]}cut(s,i){let n;if(this._xCut=i,s.rings)this._closed=!0,n=s.rings,this._minPts=4;else{if(!s.paths)return null;this._closed=!1,n=s.paths,this._minPts=2}for(const h of n){if(!h||h.length=this._minPts&&n.push(h);const e=-2*this._xCut;for(const h of this._linesOut)if(h&&h.length>=this._minPts){for(const u of h)u[0]+=e;n.push(h)}return this._closed?s.rings=n:s.paths=n,s}moveTo(s){this._pushLineIn(),this._pushLineOut(),this._prevSide=this._side(s[0]),this._moveTo(s[0],s[1],this._prevSide),this._prevPt=s,this._firstPt=s}lineTo(s){const i=this._side(s[0]);if(i*this._prevSide==-1){const n=this._intersect(this._prevPt,s);this._lineTo(this._xCut,n,0),this._prevSide=0,this._lineTo(s[0],s[1],i)}else this._lineTo(s[0],s[1],i);this._prevSide=i,this._prevPt=s}close(){const s=this._firstPt,i=this._prevPt;s[0]===i[0]&&s[1]===i[1]||this.lineTo(s),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(s,i,n){this._closed?(this._lineIn.push([n<=0?s:this._xCut,i]),this._lineOut.push([n>=0?s:this._xCut,i])):(n<=0&&this._lineIn.push([s,i]),n>=0&&this._lineOut.push([s,i]))}_lineTo(s,i,n){this._closed?(this._addPolyVertex(this._lineIn,n<=0?s:this._xCut,i),this._addPolyVertex(this._lineOut,n>=0?s:this._xCut,i)):n<0?(this._prevSide===0&&this._pushLineOut(),this._lineIn.push([s,i])):n>0?(this._prevSide===0&&this._pushLineIn(),this._lineOut.push([s,i])):this._prevSide<0?(this._lineIn.push([s,i]),this._lineOut.push([s,i])):this._prevSide>0&&(this._lineOut.push([s,i]),this._lineIn.push([s,i]))}_addPolyVertex(s,i,n){const e=s.length;e>1&&s[e-1][0]===i&&s[e-2][0]===i?s[e-1][1]=n:s.push([i,n])}_checkClosingPt(s){const i=s.length;i>3&&s[0][0]===this._xCut&&s[i-2][0]===this._xCut&&s[1][0]===this._xCut&&(s[0][1]=s[i-2][1],s.pop())}_side(s){return sthis._xCut?1:0}_intersect(s,i){const n=(this._xCut-s[0])/(i[0]-s[0]);return s[1]+n*(i[1]-s[1])}_pushLineIn(){this._lineIn&&this._lineIn.length>=this._minPts&&this._linesIn.push(this._lineIn),this._lineIn=[]}_pushLineOut(){this._lineOut&&this._lineOut.length>=this._minPts&&this._linesOut.push(this._lineOut),this._lineOut=[]}}export{Q as a,K as p}; +import{ai as V,aj as A,a2 as X,ak as j,al as T,aa as F,ad as J,F as N,ab as R,ac as k,am as $,an as q,ao as z,ap as p}from"./index-BjUNJPVf.js";function K(t){return M(t,!0)}function Q(t){return M(t,!1)}function M(t,s){if(t==null)return null;const i=t.spatialReference,n=A(i),e=X(t)?t.toJSON():t;if(!n)return e;const h=j(i)?102100:4326,u=T[h].maxX,x=T[h].minX;if(F(e))return S(e,u,x);if(J(e))return e.points=e.points.map(o=>S(o,u,x)),e;if(N(e))return B(e,n);if(R(e)||k(e)){const o=$(E,e),r={xmin:o[0],ymin:o[1],xmax:o[2],ymax:o[3]},a=p(r.xmin,x)*(2*u),_=a===0?e:q(e,a);return r.xmin+=a,r.xmax+=a,r.xmax>u?L(_,u,s):r.xminn.extent);return i.length<2?i[0]||t:i.length>2?(t.xmin=s.valid[0],t.xmax=s.valid[1],t):{rings:i.map(n=>[[n.xmin,n.ymin],[n.xmin,n.ymax],[n.xmax,n.ymax],[n.xmax,n.ymin],[n.xmin,n.ymin]])}}function S(t,s,i){if(Array.isArray(t)){const n=t[0];if(n>s){const e=p(n,s);t[0]=n+e*(-2*s)}else if(ns){const e=p(n,s);t.x+=e*(-2*s)}else if(n0;if(x>2*r){const v={xmin:hl||b?i.push(new m({xmin:a,ymin:n,xmax:r,ymax:e},[_]),new m({xmin:o,ymin:n,xmax:l,ymax:e},[c])):i.push(new m({xmin:a,ymin:n,xmax:l,ymax:e},[_]));return i}function w(t,s){const[i,n]=s.valid,e=2*n;let h,u=0;return t>n?(h=Math.ceil(Math.abs(t-n)/e),t-=h*e,u=h):t=t.xmin&&s<=t.xmax&&i>=t.ymin&&i<=t.ymax}function L(t,s,i=!0){const n=!k(t);if(n&&z(t),i)return new G().cut(t,s);const e=n?t.rings:t.paths,h=n?4:2,u=e.length,x=-2*s;for(let o=0;o=h){const a=[];for(const _ of r)a.push([_[0]+x,_[1]]);e.push(a)}}return n?t.rings=e:t.paths=e,t}class m{constructor(s,i){this.extent=s,this.frameIds=i}}const E=V();class G{constructor(){this._linesIn=[],this._linesOut=[]}cut(s,i){let n;if(this._xCut=i,s.rings)this._closed=!0,n=s.rings,this._minPts=4;else{if(!s.paths)return null;this._closed=!1,n=s.paths,this._minPts=2}for(const h of n){if(!h||h.length=this._minPts&&n.push(h);const e=-2*this._xCut;for(const h of this._linesOut)if(h&&h.length>=this._minPts){for(const u of h)u[0]+=e;n.push(h)}return this._closed?s.rings=n:s.paths=n,s}moveTo(s){this._pushLineIn(),this._pushLineOut(),this._prevSide=this._side(s[0]),this._moveTo(s[0],s[1],this._prevSide),this._prevPt=s,this._firstPt=s}lineTo(s){const i=this._side(s[0]);if(i*this._prevSide==-1){const n=this._intersect(this._prevPt,s);this._lineTo(this._xCut,n,0),this._prevSide=0,this._lineTo(s[0],s[1],i)}else this._lineTo(s[0],s[1],i);this._prevSide=i,this._prevPt=s}close(){const s=this._firstPt,i=this._prevPt;s[0]===i[0]&&s[1]===i[1]||this.lineTo(s),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(s,i,n){this._closed?(this._lineIn.push([n<=0?s:this._xCut,i]),this._lineOut.push([n>=0?s:this._xCut,i])):(n<=0&&this._lineIn.push([s,i]),n>=0&&this._lineOut.push([s,i]))}_lineTo(s,i,n){this._closed?(this._addPolyVertex(this._lineIn,n<=0?s:this._xCut,i),this._addPolyVertex(this._lineOut,n>=0?s:this._xCut,i)):n<0?(this._prevSide===0&&this._pushLineOut(),this._lineIn.push([s,i])):n>0?(this._prevSide===0&&this._pushLineIn(),this._lineOut.push([s,i])):this._prevSide<0?(this._lineIn.push([s,i]),this._lineOut.push([s,i])):this._prevSide>0&&(this._lineOut.push([s,i]),this._lineIn.push([s,i]))}_addPolyVertex(s,i,n){const e=s.length;e>1&&s[e-1][0]===i&&s[e-2][0]===i?s[e-1][1]=n:s.push([i,n])}_checkClosingPt(s){const i=s.length;i>3&&s[0][0]===this._xCut&&s[i-2][0]===this._xCut&&s[1][0]===this._xCut&&(s[0][1]=s[i-2][1],s.pop())}_side(s){return sthis._xCut?1:0}_intersect(s,i){const n=(this._xCut-s[0])/(i[0]-s[0]);return s[1]+n*(i[1]-s[1])}_pushLineIn(){this._lineIn&&this._lineIn.length>=this._minPts&&this._linesIn.push(this._lineIn),this._lineIn=[]}_pushLineOut(){this._lineOut&&this._lineOut.length>=this._minPts&&this._linesOut.push(this._lineOut),this._lineOut=[]}}export{Q as a,K as p}; diff --git a/assets/number-Bu1a2qyF.js b/assets/number-CJqenc9O.js similarity index 98% rename from assets/number-Bu1a2qyF.js rename to assets/number-CJqenc9O.js index 903445c..483c6cb 100644 --- a/assets/number-Bu1a2qyF.js +++ b/assets/number-CJqenc9O.js @@ -1 +1 @@ -import{cd as E,ce as S}from"./index-CEWggaxV.js";const x={ar:[".",","],bg:[","," "],bs:[",","."],ca:[",","."],cs:[","," "],da:[",","."],de:[",","."],"de-ch":[".","’"],el:[",","."],en:[".",","],"en-au":[".",","],es:[",","."],"es-mx":[".",","],et:[","," "],fi:[","," "],fr:[","," "],"fr-ch":[","," "],he:[".",","],hi:[".",",","#,##,##0.###"],hr:[",","."],hu:[","," "],id:[",","."],it:[",","."],"it-ch":[".","’"],ja:[".",","],ko:[".",","],lt:[","," "],lv:[","," "],mk:[",","."],nb:[","," "],nl:[",","."],pl:[","," "],pt:[",","."],"pt-pt":[","," "],ro:[",","."],ru:[","," "],sk:[","," "],sl:[",","."],sr:[",","."],sv:[","," "],th:[".",","],tr:[",","."],uk:[","," "],vi:[",","."],zh:[".",","]};function w(e=E()){let t=(e=e.toLowerCase())in x;if(!t){const l=e.split("-");l.length>1&&l[0]in x&&(e=l[0],t=!0),t||(e="en")}const[n,r,s="#,##0.###"]=x[e];return{decimal:n,group:r,pattern:s}}function I(e,t){const n=w((t={...t}).locale);t.customs=n;const r=t.pattern||n.pattern;return isNaN(e)||Math.abs(e)===1/0?null:v(e,r,t)}const N=/[#0,]*[#0](?:\.0*#*)?/;function v(e,t,n){const r=(n=n||{}).customs.group,s=n.customs.decimal,l=t.split(";"),o=l[0];if((t=l[e<0?1:0]||"-"+o).includes("%"))e*=100;else if(t.includes("‰"))e*=1e3;else{if(t.includes("¤"))throw new Error("currency notation not supported");if(t.includes("E"))throw new Error("exponential notation not supported")}const d=N,u=o.match(d);if(!u)throw new Error("unable to find a number expression in pattern: "+t);return n.fractional===!1&&(n.places=0),t.replace(d,z(e,u[0],{decimal:s,group:r,places:n.places,round:n.round}))}function z(e,t,n){(n=n||{}).places===!0&&(n.places=0),n.places===1/0&&(n.places=6);const r=t.split("."),s=typeof n.places=="string"&&n.places.indexOf(",");let l=n.places;s?l=n.places.substring(s+1):+l>=0||(l=(r[1]||[]).length),n.round<0||(e=Number(e.toFixed(Number(l))));const o=String(Math.abs(e)).split("."),d=o[1]||"";if(r[1]||n.places){s&&(n.places=n.places.substring(0,s));const i=n.places!==void 0?n.places:r[1]&&r[1].lastIndexOf("0")+1;+i>d.length&&(o[1]=d.padEnd(Number(i),"0")),+lo[0].length&&(o[0]=o[0].padStart(g,"0")),u.includes("#")||(o[0]=o[0].substr(o[0].length-g)));let p,c,a=r[0].lastIndexOf(",");if(a!==-1){p=r[0].length-a-1;const i=r[0].substr(0,a);a=i.lastIndexOf(","),a!==-1&&(c=i.length-a-1)}const f=[];for(let i=o[0];i;){const m=i.length-p;f.push(m>0?i.substr(m):i),i=m>0?i.slice(0,m):"",c&&(p=c,c=void 0)}return o[0]=f.reverse().join(n.group||","),o.join(n.decimal||".")}function O(e){const t=w((e=e||{}).locale),n=e.pattern||t.pattern,r=t.group,s=t.decimal;let l=1;if(n.includes("%"))l/=100;else if(n.includes("‰"))l/=1e3;else if(n.includes("¤"))throw new Error("currency notation not supported");const o=n.split(";");return o.length===1&&o.push("-"+o[0]),{regexp:h(o,u=>(u="(?:"+S(u,".")+")").replace(N,g=>{const p={signed:!1,separator:e.strict?r:[r,""],fractional:e.fractional,decimal:s,exponent:!1},c=g.split(".");let a=e.places;c.length===1&&l!==1&&(c[1]="###"),c.length===1||a===0?p.fractional=!1:(a===void 0&&(a=e.pattern?c[1].lastIndexOf("0")+1:1/0),a&&e.fractional==null&&(p.fractional=!0),!e.places&&+a1&&(p.groupSize=f.pop().length,f.length>1&&(p.groupSize2=f.pop().length)),"("+y(p)+")"}),!0).replaceAll(/[\xa0 ]/g,"[\\s\\xa0]"),group:r,decimal:s,factor:l}}function A(e,t){const n=O(t),r=new RegExp("^"+n.regexp+"$").exec(e);if(!r)return NaN;let s=r[1];if(!r[1]){if(!r[2])return NaN;s=r[2],n.factor*=-1}return s=s.replaceAll(new RegExp("["+n.group+"\\s\\xa0]","g"),"").replace(n.decimal,"."),Number(s)*n.factor}function y(e){"places"in(e=e||{})||(e.places=1/0),typeof e.decimal!="string"&&(e.decimal="."),"fractional"in e&&!String(e.places).startsWith("0")||(e.fractional=[!0,!1]),"exponent"in e||(e.exponent=[!0,!1]),"eSigned"in e||(e.eSigned=[!0,!1]);const t=b(e),n=h(e.fractional,s=>{let l="";return s&&e.places!==0&&(l="\\"+e.decimal,e.places===1/0?l="(?:"+l+"\\d+)?":l+="\\d{"+e.places+"}"),l},!0);let r=t+n;return n&&(r="(?:(?:"+r+")|(?:"+n+"))"),r+h(e.exponent,s=>s?"([eE]"+b({signed:e.eSigned})+")":"")}function b(e){return"signed"in(e=e||{})||(e.signed=[!0,!1]),"separator"in e?"groupSize"in e||(e.groupSize=3):e.separator="",h(e.signed,t=>t?"[-+]":"",!0)+h(e.separator,t=>{if(!t)return"(?:\\d+)";(t=S(t))===" "?t="\\s":t===" "&&(t="\\s\\xa0");const n=e.groupSize,r=e.groupSize2;if(r){const s="(?:0|[1-9]\\d{0,"+(r-1)+"}(?:["+t+"]\\d{"+r+"})*["+t+"]\\d{"+n+"})";return n-r>0?"(?:"+s+"|(?:0|[1-9]\\d{0,"+(n-1)+"}))":s}return"(?:0|[1-9]\\d{0,"+(n-1)+"}(?:["+t+"]\\d{"+n+"})*)"},!0)}const h=(e,t,n)=>{if(!(e instanceof Array))return t(e);const r=[];for(let s=0;s"("+(t?"?:":"")+e+")";export{O as a,A as p,I as s}; +import{cd as E,ce as S}from"./index-BjUNJPVf.js";const x={ar:[".",","],bg:[","," "],bs:[",","."],ca:[",","."],cs:[","," "],da:[",","."],de:[",","."],"de-ch":[".","’"],el:[",","."],en:[".",","],"en-au":[".",","],es:[",","."],"es-mx":[".",","],et:[","," "],fi:[","," "],fr:[","," "],"fr-ch":[","," "],he:[".",","],hi:[".",",","#,##,##0.###"],hr:[",","."],hu:[","," "],id:[",","."],it:[",","."],"it-ch":[".","’"],ja:[".",","],ko:[".",","],lt:[","," "],lv:[","," "],mk:[",","."],nb:[","," "],nl:[",","."],pl:[","," "],pt:[",","."],"pt-pt":[","," "],ro:[",","."],ru:[","," "],sk:[","," "],sl:[",","."],sr:[",","."],sv:[","," "],th:[".",","],tr:[",","."],uk:[","," "],vi:[",","."],zh:[".",","]};function w(e=E()){let t=(e=e.toLowerCase())in x;if(!t){const l=e.split("-");l.length>1&&l[0]in x&&(e=l[0],t=!0),t||(e="en")}const[n,r,s="#,##0.###"]=x[e];return{decimal:n,group:r,pattern:s}}function I(e,t){const n=w((t={...t}).locale);t.customs=n;const r=t.pattern||n.pattern;return isNaN(e)||Math.abs(e)===1/0?null:v(e,r,t)}const N=/[#0,]*[#0](?:\.0*#*)?/;function v(e,t,n){const r=(n=n||{}).customs.group,s=n.customs.decimal,l=t.split(";"),o=l[0];if((t=l[e<0?1:0]||"-"+o).includes("%"))e*=100;else if(t.includes("‰"))e*=1e3;else{if(t.includes("¤"))throw new Error("currency notation not supported");if(t.includes("E"))throw new Error("exponential notation not supported")}const d=N,u=o.match(d);if(!u)throw new Error("unable to find a number expression in pattern: "+t);return n.fractional===!1&&(n.places=0),t.replace(d,z(e,u[0],{decimal:s,group:r,places:n.places,round:n.round}))}function z(e,t,n){(n=n||{}).places===!0&&(n.places=0),n.places===1/0&&(n.places=6);const r=t.split("."),s=typeof n.places=="string"&&n.places.indexOf(",");let l=n.places;s?l=n.places.substring(s+1):+l>=0||(l=(r[1]||[]).length),n.round<0||(e=Number(e.toFixed(Number(l))));const o=String(Math.abs(e)).split("."),d=o[1]||"";if(r[1]||n.places){s&&(n.places=n.places.substring(0,s));const i=n.places!==void 0?n.places:r[1]&&r[1].lastIndexOf("0")+1;+i>d.length&&(o[1]=d.padEnd(Number(i),"0")),+lo[0].length&&(o[0]=o[0].padStart(g,"0")),u.includes("#")||(o[0]=o[0].substr(o[0].length-g)));let p,c,a=r[0].lastIndexOf(",");if(a!==-1){p=r[0].length-a-1;const i=r[0].substr(0,a);a=i.lastIndexOf(","),a!==-1&&(c=i.length-a-1)}const f=[];for(let i=o[0];i;){const m=i.length-p;f.push(m>0?i.substr(m):i),i=m>0?i.slice(0,m):"",c&&(p=c,c=void 0)}return o[0]=f.reverse().join(n.group||","),o.join(n.decimal||".")}function O(e){const t=w((e=e||{}).locale),n=e.pattern||t.pattern,r=t.group,s=t.decimal;let l=1;if(n.includes("%"))l/=100;else if(n.includes("‰"))l/=1e3;else if(n.includes("¤"))throw new Error("currency notation not supported");const o=n.split(";");return o.length===1&&o.push("-"+o[0]),{regexp:h(o,u=>(u="(?:"+S(u,".")+")").replace(N,g=>{const p={signed:!1,separator:e.strict?r:[r,""],fractional:e.fractional,decimal:s,exponent:!1},c=g.split(".");let a=e.places;c.length===1&&l!==1&&(c[1]="###"),c.length===1||a===0?p.fractional=!1:(a===void 0&&(a=e.pattern?c[1].lastIndexOf("0")+1:1/0),a&&e.fractional==null&&(p.fractional=!0),!e.places&&+a1&&(p.groupSize=f.pop().length,f.length>1&&(p.groupSize2=f.pop().length)),"("+y(p)+")"}),!0).replaceAll(/[\xa0 ]/g,"[\\s\\xa0]"),group:r,decimal:s,factor:l}}function A(e,t){const n=O(t),r=new RegExp("^"+n.regexp+"$").exec(e);if(!r)return NaN;let s=r[1];if(!r[1]){if(!r[2])return NaN;s=r[2],n.factor*=-1}return s=s.replaceAll(new RegExp("["+n.group+"\\s\\xa0]","g"),"").replace(n.decimal,"."),Number(s)*n.factor}function y(e){"places"in(e=e||{})||(e.places=1/0),typeof e.decimal!="string"&&(e.decimal="."),"fractional"in e&&!String(e.places).startsWith("0")||(e.fractional=[!0,!1]),"exponent"in e||(e.exponent=[!0,!1]),"eSigned"in e||(e.eSigned=[!0,!1]);const t=b(e),n=h(e.fractional,s=>{let l="";return s&&e.places!==0&&(l="\\"+e.decimal,e.places===1/0?l="(?:"+l+"\\d+)?":l+="\\d{"+e.places+"}"),l},!0);let r=t+n;return n&&(r="(?:(?:"+r+")|(?:"+n+"))"),r+h(e.exponent,s=>s?"([eE]"+b({signed:e.eSigned})+")":"")}function b(e){return"signed"in(e=e||{})||(e.signed=[!0,!1]),"separator"in e?"groupSize"in e||(e.groupSize=3):e.separator="",h(e.signed,t=>t?"[-+]":"",!0)+h(e.separator,t=>{if(!t)return"(?:\\d+)";(t=S(t))===" "?t="\\s":t===" "&&(t="\\s\\xa0");const n=e.groupSize,r=e.groupSize2;if(r){const s="(?:0|[1-9]\\d{0,"+(r-1)+"}(?:["+t+"]\\d{"+r+"})*["+t+"]\\d{"+n+"})";return n-r>0?"(?:"+s+"|(?:0|[1-9]\\d{0,"+(n-1)+"}))":s}return"(?:0|[1-9]\\d{0,"+(n-1)+"}(?:["+t+"]\\d{"+n+"})*)"},!0)}const h=(e,t,n)=>{if(!(e instanceof Array))return t(e);const r=[];for(let s=0;s"("+(t?"?:":"")+e+")";export{O as a,A as p,I as s}; diff --git a/assets/objectResourceUtils-BVnDNNos.js b/assets/objectResourceUtils-BlC7hkco.js similarity index 99% rename from assets/objectResourceUtils-BVnDNNos.js rename to assets/objectResourceUtils-BlC7hkco.js index aa415cd..d3e89e0 100644 --- a/assets/objectResourceUtils-BVnDNNos.js +++ b/assets/objectResourceUtils-BlC7hkco.js @@ -1,10 +1,10 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/basis_transcoder-CY0Zu9W4.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css"] + __vite__mapDeps.viteFileDeps = ["assets/basis_transcoder-gYrXvU8A.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{a as Fa}from"./devEnvironmentUtils-Blrp8lZ5.js";import{ch as mo,cg as Ba,iz as za,gA as fo,fg as q,cX as fe,cW as pe,m_ as Ga,cy as G,e2 as we,m$ as Va,n0 as Ua,eM as Vr,_ as xt,gZ as ja,ir as Ee,v as Pe,L as Je,s as _r,N as Gt,D as Ge,ca as Ha,dI as Ur,jc as Wa,fp as st,kf as lt,at as jr,n1 as ka,ia as qa,jj as Ya,fV as It,jl as Xa,bm as Qe,hq as Ne,eu as Ja,kT as Za,bF as Ka,n2 as Qa,n3 as ei,cv as ti,cx as br,I as po,n4 as ri,cz as He,gL as Se,gM as je,gK as Lt,n5 as vo,n6 as go,g3 as oi,bL as ai,hf as Ae,iS as le,gQ as ii,gB as Vt,cU as We,kc as lr,d as m,ht as cr,cl as ne,bj as Er,gS as Sr,y as W,f as xo,a7 as To,n7 as _o,gT as ni,fU as yr,fj as Ze,g as si,fJ as li,B as ci,iC as di,g2 as ui,hy as dr,cT as hi,cu as mi,fh as fi,E as pi,n8 as vi,as as bo,M as gi,ay as Eo,n9 as So,hU as $t,hA as xi,kU as Hr,gY as Ti}from"./index-CEWggaxV.js";import{t as Zt,e as Tt,o as et}from"./mat3f64-q3fE-ZOt.js";import{o as Nt,r as _i,e as Ut}from"./mat4f64-CSKppSlJ.js";import{x as jt,c as ur,y as bi,u as Ei,q as Si,i as Pt,L as yi,O as Ci,E as wi}from"./BufferView-Ao_K-5Vg.js";import{r as Ai,n as Mi,u as Wr}from"./vec3-CjYmIfaa.js";import{l as Oi,n as Ri,i as Ve,o as Ii,j as Li,k as $i,u as kr,t as Ni,m as Pi}from"./DefaultMaterial_COLOR_GAMMA-CWI-ZW7Q.js";import{r as Kt}from"./resourceUtils-BqKyAr0B.js";import{t as Di}from"./NestedMap-DgiGbX8E.js";import{r as yo}from"./Version-Bd0QsIQ5.js";import{t as Fi,l as Co}from"./Indices-Dv-cCjFT.js";import{t as wo}from"./requestImageUtils-Dzwz9ori.js";import{O as Bi,L as zi,t as Ue}from"./orientedBoundingBox-BQdJNYvE.js";import{t as Gi,u as dt,a as hr,i as Vi,N as Me,s as Z,e as Oe,n as _t}from"./basicInterfaces-GbxEOYtk.js";import{d as Ui,e as Fe,o as ji}from"./triangle-CU37cZF1.js";import{s as Y}from"./Util-BS8sJGjF.js";import{e as f}from"./VertexAttribute-BlT9lbVY.js";import{m as ke,a as Hi,e as Ao,c as Wi}from"./Texture-DJgkMrSB.js";import{H as ki}from"./InterleavedLayout-Dd1W8HCo.js";import{o as s,n as bt,S as Cr,_ as wr,a as Ke,c as qi,A as Yi,h as Xi,l as Ji,b as Zi,d as Ki,e as Qi}from"./OrderIndependentTransparency-C747AfeB.js";import{w as Mo,Z as ye}from"./sphere-DHd2K2LR.js";import{a as F}from"./BindType-BmZEZMMh.js";import{n as _e}from"./symbolColorUtils-D_minlYz.js";import{o as en,r as tn}from"./doublePrecisionUtils-B0owpBza.js";import"./RenderState-DaVlEYWY.js";import"./quat-CoKEr4Zu.js";import"./quatf64-Bdb9ZJJK.js";import"./computeTranslationToOriginAndRotation-DOOKw0d1.js";import"./plane-py4f_JCU.js";import"./ObjectStack-CF0cQvd2.js";import"./lineSegment-B9UF3nEF.js";import"./types-D0PSWh4d.js";function Et(t,e=!1){return t<=mo?e?new Array(t).fill(0):new Array(t):new Float32Array(t)}function rn(t){if(t.length1&&pe(e,e,1/n),n>0}function nn(t,e,r){if(!t)return!1;q(r,0,0,0),q(se,0,0,0);let o=0,i=0;const{size:a,data:n,indices:l}=t,c=l.length-1,u=c+(e?2:0);for(let d=0;d0?(fe(r,r,pe(J,J,v)),o+=v):o===0&&(fe(se,se,J),i++)}return o!==0?(pe(r,r,1/o),!0):i!==0&&(pe(r,se,1/i),!0)}const J=G(),be=G(),St=G(),se=G();let sn=class{constructor(e){this.channel=e,this.id=fo()}};function ln(t,e){return t==null&&(t=[]),t.push(e),t}function cn(t,e){if(t==null)return null;const r=t.filter(o=>o!==e);return r.length===0?null:r}let Oo=class Ro extends Ar{constructor(e,r,o=null,i=Fe.Mesh,a=null,n=-1){super(),this.material=e,this.mapPositions=o,this.type=i,this.objectAndLayerIdColor=a,this.edgeIndicesLength=n,this.visible=!0,this._attributes=new Map,this._boundingInfo=null;for(const[l,c]of r)this._attributes.set(l,{...c,indices:Fi(c.indices)}),l===f.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._attributes.get(l).indices.length:this.edgeIndicesLength)}instantiate(e={}){const r=new Ro(e.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._attributes.forEach((o,i)=>{o.exclusive=!1,r._attributes.set(i,o)}),r._boundingInfo=this._boundingInfo,r.transformation=e.transformation||this.transformation,r}get attributes(){return this._attributes}getMutableAttribute(e){let r=this._attributes.get(e);return r&&!r.exclusive&&(r={...r,exclusive:!0,data:rn(r.data)},this._attributes.set(e,r)),r}setAttributeData(e,r){const o=this._attributes.get(e);o&&this._attributes.set(e,{...o,exclusive:!0,data:r})}get indexCount(){const e=this._attributes.values().next().value.indices;return(e==null?void 0:e.length)??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo==null&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return!!(this.type===Fe.Mesh?this._computeAttachmentOriginTriangles(e):this.type===Fe.Line?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(this._transformation!=null&&we(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){const r=this.attributes.get(f.POSITION);return on(r,e)}_computeAttachmentOriginLines(e){const r=this.attributes.get(f.POSITION);return nn(r,dn(this.material.parameters,r),e)}_computeAttachmentOriginPoints(e){const r=this.attributes.get(f.POSITION);return an(r,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.attributes.get(f.POSITION);if(!e||e.indices.length===0)return null;const r=this.type===Fe.Mesh?3:1;Y(e.indices.length%r==0,"Indexing error: "+e.indices.length+" not divisible by "+r);const o=Co(e.indices.length/r);return new ji(o,r,e)}get transformation(){return this._transformation??Nt}set transformation(e){this._transformation=e&&e!==Nt?_i(e):null}addHighlight(){const e=new sn(Gi.Highlight);return this.highlights=ln(this.highlights,e),e}removeHighlight(e){this.highlights=cn(this.highlights,e)}};function dn(t,e){return!(!("isClosed"in t)||!t.isClosed)&&e.indices.length>2}function it(t){if(t==null)return null;const e=t.offset!=null?t.offset:Va,r=t.rotation!=null?t.rotation:0,o=t.scale!=null?t.scale:Ua,i=Zt(1,0,0,0,1,0,e[0],e[1],1),a=Zt(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),n=Zt(o[0],0,0,0,o[1],0,0,0,1),l=Tt();return Vr(l,a,n),Vr(l,i,l),l}let un=class{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}},hn=class{constructor(e,r,o){this.name=e,this.lodThreshold=r,this.pivotOffset=o,this.stageResources=new un,this.numberOfVertices=0}};function mn(){if(Qt==null){const t=e=>ja(`esri/libs/basisu/${e}`);Qt=xt(()=>import("./basis_transcoder-CY0Zu9W4.js"),__vite__mapDeps([0,1,2])).then(e=>e.b).then(({default:e})=>e({locateFile:t}).then(r=>(r.initializeBasis(),delete r.then,r)))}return Qt}let Qt;var De;(function(t){t[t.ETC1_RGB=0]="ETC1_RGB",t[t.ETC2_RGBA=1]="ETC2_RGBA",t[t.BC1_RGB=2]="BC1_RGB",t[t.BC3_RGBA=3]="BC3_RGBA",t[t.BC4_R=4]="BC4_R",t[t.BC5_RG=5]="BC5_RG",t[t.BC7_M6_RGB=6]="BC7_M6_RGB",t[t.BC7_M5_RGBA=7]="BC7_M5_RGBA",t[t.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",t[t.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",t[t.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",t[t.ATC_RGB=11]="ATC_RGB",t[t.ATC_RGBA=12]="ATC_RGBA",t[t.FXT1_RGB=17]="FXT1_RGB",t[t.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",t[t.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",t[t.ETC2_EAC_R11=20]="ETC2_EAC_R11",t[t.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",t[t.RGBA32=13]="RGBA32",t[t.RGB565=14]="RGB565",t[t.BGR565=15]="BGR565",t[t.RGBA4444=16]="RGBA4444"})(De||(De={}));let de=null,yt=null;async function Io(){return yt==null&&(yt=mn(),de=await yt),yt}function fn(t,e){if(de==null)return t.byteLength;const r=new de.BasisFile(new Uint8Array(t)),o=$o(r)?Lo(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),e):0;return r.close(),r.delete(),o}function pn(t,e){if(de==null)return t.byteLength;const r=new de.KTX2File(new Uint8Array(t)),o=No(r)?Lo(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),e):0;return r.close(),r.delete(),o}function Lo(t,e,r,o,i){const a=Hi(e?Ee.COMPRESSED_RGBA8_ETC2_EAC:Ee.COMPRESSED_RGB8_ETC2),n=i&&t>1?(4**t-1)/(3*4**(t-1)):1;return Math.ceil(r*o*a*n)}function $o(t){return t.getNumImages()>=1&&!t.isUASTC()}function No(t){return t.getFaces()>=1&&t.isETC1S()}async function vn(t,e,r){de==null&&(de=await Io());const o=new de.BasisFile(new Uint8Array(r));if(!$o(o))return null;o.startTranscoding();const i=Po(t,e,o.getNumLevels(0),o.getHasAlpha(),o.getImageWidth(0,0),o.getImageHeight(0,0),(a,n)=>o.getImageTranscodedSizeInBytes(0,a,n),(a,n,l)=>o.transcodeImage(l,0,a,n,0,0));return o.close(),o.delete(),i}async function gn(t,e,r){de==null&&(de=await Io());const o=new de.KTX2File(new Uint8Array(r));if(!No(o))return null;o.startTranscoding();const i=Po(t,e,o.getLevels(),o.getHasAlpha(),o.getWidth(),o.getHeight(),(a,n)=>o.getImageTranscodedSizeInBytes(a,0,0,n),(a,n,l)=>o.transcodeImage(l,a,0,0,n,0,-1,-1));return o.close(),o.delete(),i}function Po(t,e,r,o,i,a,n,l){const{compressedTextureETC:c,compressedTextureS3TC:u}=t.capabilities,[d,h]=c?o?[De.ETC2_RGBA,Ee.COMPRESSED_RGBA8_ETC2_EAC]:[De.ETC1_RGB,Ee.COMPRESSED_RGB8_ETC2]:u?o?[De.BC3_RGBA,Ee.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[De.BC1_RGB,Ee.COMPRESSED_RGB_S3TC_DXT1_EXT]:[De.RGBA32,Pe.RGBA],p=e.hasMipmap?r:Math.min(1,r),x=[];for(let v=0;v1,e.samplingMode=e.hasMipmap?Je.LINEAR_MIPMAP_LINEAR:Je.LINEAR,e.width=i,e.height=a,new ke(t,e,{type:"compressed",levels:x})}const Ct=()=>_r.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil"),xn=542327876,Tn=131072,_n=4;function Mr(t){return t.charCodeAt(0)+(t.charCodeAt(1)<<8)+(t.charCodeAt(2)<<16)+(t.charCodeAt(3)<<24)}function bn(t){return String.fromCharCode(255&t,t>>8&255,t>>16&255,t>>24&255)}const En=Mr("DXT1"),Sn=Mr("DXT3"),yn=Mr("DXT5"),Cn=31,wn=0,An=1,Mn=2,On=3,Rn=4,In=7,Ln=20,$n=21;function Nn(t,e,r){const o=Pn(r,e.hasMipmap??!1);if(o==null)throw new Error("DDS texture data is null");const{textureData:i,internalFormat:a,width:n,height:l}=o;return e.samplingMode=i.levels.length>1?Je.LINEAR_MIPMAP_LINEAR:Je.LINEAR,e.hasMipmap=i.levels.length>1,e.internalFormat=a,e.width=n,e.height=l,new ke(t,e,i)}function Pn(t,e){const r=new Int32Array(t,0,Cn);if(r[wn]!==xn)return Ct().error("Invalid magic number in DDS header"),null;if(!(r[Ln]&_n))return Ct().error("Unsupported format, must contain a FourCC code"),null;const o=r[$n];let i,a;switch(o){case En:i=8,a=Ee.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case Sn:i=16,a=Ee.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case yn:i=16,a=Ee.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return Ct().error("Unsupported FourCC code:",bn(o)),null}let n=1,l=r[Rn],c=r[On];!(3&l)&&!(3&c)||(Ct().warn("Rounding up compressed texture size to nearest multiple of 4."),l=l+3&-4,c=c+3&-4);const u=l,d=c;let h,p;r[Mn]&Tn&&e!==!1&&(n=Math.max(1,r[In]));let x=r[An]+4;const v=[];for(let y=0;y>2)*(c+3>>2)*i,h=new Uint8Array(t,x,p),v.push(h),x+=p,l=Math.max(1,l>>1),c=Math.max(1,c>>1);return{textureData:{type:"compressed",levels:v},internalFormat:a,width:u,height:d}}function Dn(t,e){let a=t.width*t.height;if(a<4096)return t instanceof ImageData?Do(t):t;let n=t.width,l=t.height;do n=Math.ceil(n/2),l=Math.ceil(l/2),a=n*l;while(a>1048576||e!=null&&(n>e||l>e));return Or(t,n,l)}function Fn(t,e){const r=Math.max(t.width,t.height);if(r<=e)return t;const o=e/r;return Or(t,Math.round(t.width*o),Math.round(t.height*o))}function Or(t,e,r){if(t instanceof ImageData)return Or(Do(t),e,r);const o=document.createElement("canvas");return o.width=e,o.height=r,o.getContext("2d").drawImage(t,0,0,o.width,o.height),o}function Do(t){const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const r=e.getContext("2d");if(r==null)throw new Gt("Failed to create 2d context from HTMLCanvasElement");return r.putImageData(t,0,0),e}let Fo=class extends Ar{get parameters(){return this._parameters}constructor(e,r){super(),this._data=e,this.type=Fe.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new Ha,this._parameters={...zn,...r},this._startPreload(e)}dispose(){this.unload(),this._data=this.frameUpdate=void 0}_startPreload(e){e!=null&&(e instanceof HTMLVideoElement?(this.frameUpdate=r=>this._frameUpdate(e,r),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!(Ur(e.src)||e.preload==="auto"&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const r=!e.paused;if(e.src=e.src,r&&e.autoplay){const o=()=>{e.removeEventListener("canplay",o),e.play()};e.addEventListener("canplay",o)}}}_startPreloadImageElement(e){Wa(e.src)||Ur(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const r=new Ao;return r.wrapMode=this._parameters.wrap??Ge.REPEAT,r.flipped=!this._parameters.noUnpackFlip,r.samplingMode=this._parameters.mipmap?Je.LINEAR_MIPMAP_LINEAR:Je.LINEAR,r.hasMipmap=!!this._parameters.mipmap,r.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,r.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),r}get glTexture(){return this._glTexture}get memoryEstimate(){var e;return((e=this._glTexture)==null?void 0:e.usedMemory)||Bn(this._data,this._parameters)}load(e){if(this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const r=this._data;return r==null?(this._glTexture=new ke(e,this._createDescriptor(e),null),this._glTexture):(this._parameters.reloadable||(this._data=void 0),typeof r=="string"?this._loadFromURL(e,r):r instanceof Image?this._loadFromImageElement(e,r):r instanceof HTMLVideoElement?this._loadFromVideoElement(e,r):r instanceof ImageData||r instanceof HTMLCanvasElement?this._loadFromImage(e,r):(st(r)||lt(r))&&this._parameters.encoding===dt.DDS_ENCODING?this._loadFromDDSData(e,r):(st(r)||lt(r))&&this._parameters.encoding===dt.KTX2_ENCODING?this._loadFromKTX2(e,r):(st(r)||lt(r))&&this._parameters.encoding===dt.BASIS_ENCODING?this._loadFromBasis(e,r):lt(r)?this._loadFromPixelData(e,r):st(r)?this._loadFromPixelData(e,new Uint8Array(r)):null)}_frameUpdate(e,r){return this._glTexture==null||e.readyStategn(e,this._createDescriptor(e),r).then(o=>(this._glTexture=o,o)))}_loadFromBasis(e,r){return this._loadAsync(()=>vn(e,this._createDescriptor(e),r).then(o=>(this._glTexture=o,o)))}_loadFromPixelData(e,r){Y(this._parameters.width>0&&this._parameters.height>0);const o=this._createDescriptor(e);return o.pixelFormat=this._parameters.components===1?Pe.LUMINANCE:this._parameters.components===3?Pe.RGB:Pe.RGBA,o.width=this._parameters.width??0,o.height=this._parameters.height??0,this._glTexture=new ke(e,o,r),this._glTexture}_loadFromURL(e,r){return this._loadAsync(async o=>{const i=await wo(r,{signal:o});return jr(o),this._loadFromImage(e,i)})}_loadFromImageElement(e,r){return r.complete?this._loadFromImage(e,r):this._loadAsync(async o=>{const i=await ka(r,r.src,!1,o);return jr(o),this._loadFromImage(e,i)})}_loadFromVideoElement(e,r){return r.readyState>=ut.HAVE_CURRENT_DATA?this._loadFromImage(e,r):this._loadFromVideoElementAsync(e,r)}_loadFromVideoElementAsync(e,r){return this._loadAsync(o=>new Promise((i,a)=>{const n=()=>{r.removeEventListener("loadeddata",l),r.removeEventListener("error",c),Xa(u)},l=()=>{r.readyState>=ut.HAVE_CURRENT_DATA&&(n(),i(this._loadFromImage(e,r)))},c=d=>{n(),a(d||new Gt("Failed to load video"))};r.addEventListener("loadeddata",l),r.addEventListener("error",c);const u=qa(o,()=>c(Ya()))}))}_loadFromImage(e,r){let o=r;if(!(o instanceof HTMLVideoElement)){const{maxTextureSize:n}=e.parameters;o=this._parameters.downsampleUncompressed?Dn(o,n):Fn(o,n)}const i=Bo(o);this._parameters.width=i.width,this._parameters.height=i.height;const a=this._createDescriptor(e);return a.pixelFormat=this._parameters.components===3?Pe.RGB:Pe.RGBA,a.width=i.width,a.height=i.height,this._glTexture=new ke(e,a,o),this._glTexture}_loadAsync(e){const r=new AbortController;this._loadingController=r;const o=e(r.signal);this._loadingPromise=o;const i=()=>{this._loadingController===r&&(this._loadingController=null),this._loadingPromise===o&&(this._loadingPromise=null)};return o.then(i,i),o}unload(){if(this._glTexture=It(this._glTexture),this._loadingController!=null){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}};function Bn(t,e){if(t==null)return 0;if(st(t)||lt(t))return e.encoding===dt.KTX2_ENCODING?pn(t,!!e.mipmap):e.encoding===dt.BASIS_ENCODING?fn(t,!!e.mipmap):t.byteLength;const{width:r,height:o}=t instanceof Image||t instanceof ImageData||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement?Bo(t):e;return(e.mipmap?4/3:1)*r*o*(e.components||4)||0}function Bo(t){return t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t}var ut;(function(t){t[t.HAVE_NOTHING=0]="HAVE_NOTHING",t[t.HAVE_METADATA=1]="HAVE_METADATA",t[t.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",t[t.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",t[t.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA"})(ut||(ut={}));const zn={wrap:{s:Ge.REPEAT,t:Ge.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1,downsampleUncompressed:!1};var T;function er(t){return t===T.Shadow||t===T.ShadowHighlight||t===T.ShadowExcludeHighlight}function tr(t){return jn(t)||t===T.Normal}function Gn(t){return t===T.Highlight||t===T.ObjectAndLayerIdColor}function Vn(t){return t===T.Color||t===T.Alpha}function Un(t){return Vn(t)||Gn(t)}function jn(t){return Un(t)||t===T.LinearDepth}(function(t){t[t.Color=0]="Color",t[t.LinearDepth=1]="LinearDepth",t[t.Depth=2]="Depth",t[t.Normal=3]="Normal",t[t.Shadow=4]="Shadow",t[t.ShadowHighlight=5]="ShadowHighlight",t[t.ShadowExcludeHighlight=6]="ShadowExcludeHighlight",t[t.Highlight=7]="Highlight",t[t.Alpha=8]="Alpha",t[t.ObjectAndLayerIdColor=9]="ObjectAndLayerIdColor",t[t.CompositeColor=10]="CompositeColor",t[t.COUNT=11]="COUNT"})(T||(T={}));function Ht(t,e){switch(e.normalType){case j.Compressed:t.attributes.add(f.NORMALCOMPRESSED,"vec2"),t.vertex.code.add(s`vec3 decompressNormal(vec2 normal) { +import{a as Fa}from"./devEnvironmentUtils-Blrp8lZ5.js";import{ch as mo,cg as Ba,iz as za,gA as fo,fg as q,cX as fe,cW as pe,m_ as Ga,cy as G,e2 as we,m$ as Va,n0 as Ua,eM as Vr,_ as xt,gZ as ja,ir as Ee,v as Pe,L as Je,s as _r,N as Gt,D as Ge,ca as Ha,dI as Ur,jc as Wa,fp as st,kf as lt,at as jr,n1 as ka,ia as qa,jj as Ya,fV as It,jl as Xa,bm as Qe,hq as Ne,eu as Ja,kT as Za,bF as Ka,n2 as Qa,n3 as ei,cv as ti,cx as br,I as po,n4 as ri,cz as He,gL as Se,gM as je,gK as Lt,n5 as vo,n6 as go,g3 as oi,bL as ai,hf as Ae,iS as le,gQ as ii,gB as Vt,cU as We,kc as lr,d as m,ht as cr,cl as ne,bj as Er,gS as Sr,y as W,f as xo,a7 as To,n7 as _o,gT as ni,fU as yr,fj as Ze,g as si,fJ as li,B as ci,iC as di,g2 as ui,hy as dr,cT as hi,cu as mi,fh as fi,E as pi,n8 as vi,as as bo,M as gi,ay as Eo,n9 as So,hU as $t,hA as xi,kU as Hr,gY as Ti}from"./index-BjUNJPVf.js";import{t as Zt,e as Tt,o as et}from"./mat3f64-q3fE-ZOt.js";import{o as Nt,r as _i,e as Ut}from"./mat4f64-CSKppSlJ.js";import{x as jt,c as ur,y as bi,u as Ei,q as Si,i as Pt,L as yi,O as Ci,E as wi}from"./BufferView-3om6S_aJ.js";import{r as Ai,n as Mi,u as Wr}from"./vec3-DdRUbala.js";import{l as Oi,n as Ri,i as Ve,o as Ii,j as Li,k as $i,u as kr,t as Ni,m as Pi}from"./DefaultMaterial_COLOR_GAMMA-BQtlD4-o.js";import{r as Kt}from"./resourceUtils-BHmy1O5x.js";import{t as Di}from"./NestedMap-DgiGbX8E.js";import{r as yo}from"./Version-Dqq_CHBG.js";import{t as Fi,l as Co}from"./Indices-BRm9v2lM.js";import{t as wo}from"./requestImageUtils-BHJ_ulwE.js";import{O as Bi,L as zi,t as Ue}from"./orientedBoundingBox-sJmHxD3E.js";import{t as Gi,u as dt,a as hr,i as Vi,N as Me,s as Z,e as Oe,n as _t}from"./basicInterfaces-GbxEOYtk.js";import{d as Ui,e as Fe,o as ji}from"./triangle-DmKBscqo.js";import{s as Y}from"./Util-CS5u4Lec.js";import{e as f}from"./VertexAttribute-BlT9lbVY.js";import{m as ke,a as Hi,e as Ao,c as Wi}from"./Texture-S4dD-WHn.js";import{H as ki}from"./InterleavedLayout-Cinhb-cY.js";import{o as s,n as bt,S as Cr,_ as wr,a as Ke,c as qi,A as Yi,h as Xi,l as Ji,b as Zi,d as Ki,e as Qi}from"./OrderIndependentTransparency-Btph8gYx.js";import{w as Mo,Z as ye}from"./sphere-F1imyuMS.js";import{a as F}from"./BindType-BmZEZMMh.js";import{n as _e}from"./symbolColorUtils-C9Wp-TPe.js";import{o as en,r as tn}from"./doublePrecisionUtils-B0owpBza.js";import"./RenderState-DaVlEYWY.js";import"./quat-C0wQB0HB.js";import"./quatf64-Bdb9ZJJK.js";import"./computeTranslationToOriginAndRotation-BeE3rOSz.js";import"./plane-DxOTtTwj.js";import"./ObjectStack-BAIuPeIh.js";import"./lineSegment-BYtydnRZ.js";import"./types-D0PSWh4d.js";function Et(t,e=!1){return t<=mo?e?new Array(t).fill(0):new Array(t):new Float32Array(t)}function rn(t){if(t.length1&&pe(e,e,1/n),n>0}function nn(t,e,r){if(!t)return!1;q(r,0,0,0),q(se,0,0,0);let o=0,i=0;const{size:a,data:n,indices:l}=t,c=l.length-1,u=c+(e?2:0);for(let d=0;d0?(fe(r,r,pe(J,J,v)),o+=v):o===0&&(fe(se,se,J),i++)}return o!==0?(pe(r,r,1/o),!0):i!==0&&(pe(r,se,1/i),!0)}const J=G(),be=G(),St=G(),se=G();let sn=class{constructor(e){this.channel=e,this.id=fo()}};function ln(t,e){return t==null&&(t=[]),t.push(e),t}function cn(t,e){if(t==null)return null;const r=t.filter(o=>o!==e);return r.length===0?null:r}let Oo=class Ro extends Ar{constructor(e,r,o=null,i=Fe.Mesh,a=null,n=-1){super(),this.material=e,this.mapPositions=o,this.type=i,this.objectAndLayerIdColor=a,this.edgeIndicesLength=n,this.visible=!0,this._attributes=new Map,this._boundingInfo=null;for(const[l,c]of r)this._attributes.set(l,{...c,indices:Fi(c.indices)}),l===f.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._attributes.get(l).indices.length:this.edgeIndicesLength)}instantiate(e={}){const r=new Ro(e.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._attributes.forEach((o,i)=>{o.exclusive=!1,r._attributes.set(i,o)}),r._boundingInfo=this._boundingInfo,r.transformation=e.transformation||this.transformation,r}get attributes(){return this._attributes}getMutableAttribute(e){let r=this._attributes.get(e);return r&&!r.exclusive&&(r={...r,exclusive:!0,data:rn(r.data)},this._attributes.set(e,r)),r}setAttributeData(e,r){const o=this._attributes.get(e);o&&this._attributes.set(e,{...o,exclusive:!0,data:r})}get indexCount(){const e=this._attributes.values().next().value.indices;return(e==null?void 0:e.length)??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo==null&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return!!(this.type===Fe.Mesh?this._computeAttachmentOriginTriangles(e):this.type===Fe.Line?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(this._transformation!=null&&we(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){const r=this.attributes.get(f.POSITION);return on(r,e)}_computeAttachmentOriginLines(e){const r=this.attributes.get(f.POSITION);return nn(r,dn(this.material.parameters,r),e)}_computeAttachmentOriginPoints(e){const r=this.attributes.get(f.POSITION);return an(r,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.attributes.get(f.POSITION);if(!e||e.indices.length===0)return null;const r=this.type===Fe.Mesh?3:1;Y(e.indices.length%r==0,"Indexing error: "+e.indices.length+" not divisible by "+r);const o=Co(e.indices.length/r);return new ji(o,r,e)}get transformation(){return this._transformation??Nt}set transformation(e){this._transformation=e&&e!==Nt?_i(e):null}addHighlight(){const e=new sn(Gi.Highlight);return this.highlights=ln(this.highlights,e),e}removeHighlight(e){this.highlights=cn(this.highlights,e)}};function dn(t,e){return!(!("isClosed"in t)||!t.isClosed)&&e.indices.length>2}function it(t){if(t==null)return null;const e=t.offset!=null?t.offset:Va,r=t.rotation!=null?t.rotation:0,o=t.scale!=null?t.scale:Ua,i=Zt(1,0,0,0,1,0,e[0],e[1],1),a=Zt(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),n=Zt(o[0],0,0,0,o[1],0,0,0,1),l=Tt();return Vr(l,a,n),Vr(l,i,l),l}let un=class{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}},hn=class{constructor(e,r,o){this.name=e,this.lodThreshold=r,this.pivotOffset=o,this.stageResources=new un,this.numberOfVertices=0}};function mn(){if(Qt==null){const t=e=>ja(`esri/libs/basisu/${e}`);Qt=xt(()=>import("./basis_transcoder-gYrXvU8A.js"),__vite__mapDeps([0,1,2])).then(e=>e.b).then(({default:e})=>e({locateFile:t}).then(r=>(r.initializeBasis(),delete r.then,r)))}return Qt}let Qt;var De;(function(t){t[t.ETC1_RGB=0]="ETC1_RGB",t[t.ETC2_RGBA=1]="ETC2_RGBA",t[t.BC1_RGB=2]="BC1_RGB",t[t.BC3_RGBA=3]="BC3_RGBA",t[t.BC4_R=4]="BC4_R",t[t.BC5_RG=5]="BC5_RG",t[t.BC7_M6_RGB=6]="BC7_M6_RGB",t[t.BC7_M5_RGBA=7]="BC7_M5_RGBA",t[t.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",t[t.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",t[t.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",t[t.ATC_RGB=11]="ATC_RGB",t[t.ATC_RGBA=12]="ATC_RGBA",t[t.FXT1_RGB=17]="FXT1_RGB",t[t.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",t[t.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",t[t.ETC2_EAC_R11=20]="ETC2_EAC_R11",t[t.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",t[t.RGBA32=13]="RGBA32",t[t.RGB565=14]="RGB565",t[t.BGR565=15]="BGR565",t[t.RGBA4444=16]="RGBA4444"})(De||(De={}));let de=null,yt=null;async function Io(){return yt==null&&(yt=mn(),de=await yt),yt}function fn(t,e){if(de==null)return t.byteLength;const r=new de.BasisFile(new Uint8Array(t)),o=$o(r)?Lo(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),e):0;return r.close(),r.delete(),o}function pn(t,e){if(de==null)return t.byteLength;const r=new de.KTX2File(new Uint8Array(t)),o=No(r)?Lo(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),e):0;return r.close(),r.delete(),o}function Lo(t,e,r,o,i){const a=Hi(e?Ee.COMPRESSED_RGBA8_ETC2_EAC:Ee.COMPRESSED_RGB8_ETC2),n=i&&t>1?(4**t-1)/(3*4**(t-1)):1;return Math.ceil(r*o*a*n)}function $o(t){return t.getNumImages()>=1&&!t.isUASTC()}function No(t){return t.getFaces()>=1&&t.isETC1S()}async function vn(t,e,r){de==null&&(de=await Io());const o=new de.BasisFile(new Uint8Array(r));if(!$o(o))return null;o.startTranscoding();const i=Po(t,e,o.getNumLevels(0),o.getHasAlpha(),o.getImageWidth(0,0),o.getImageHeight(0,0),(a,n)=>o.getImageTranscodedSizeInBytes(0,a,n),(a,n,l)=>o.transcodeImage(l,0,a,n,0,0));return o.close(),o.delete(),i}async function gn(t,e,r){de==null&&(de=await Io());const o=new de.KTX2File(new Uint8Array(r));if(!No(o))return null;o.startTranscoding();const i=Po(t,e,o.getLevels(),o.getHasAlpha(),o.getWidth(),o.getHeight(),(a,n)=>o.getImageTranscodedSizeInBytes(a,0,0,n),(a,n,l)=>o.transcodeImage(l,a,0,0,n,0,-1,-1));return o.close(),o.delete(),i}function Po(t,e,r,o,i,a,n,l){const{compressedTextureETC:c,compressedTextureS3TC:u}=t.capabilities,[d,h]=c?o?[De.ETC2_RGBA,Ee.COMPRESSED_RGBA8_ETC2_EAC]:[De.ETC1_RGB,Ee.COMPRESSED_RGB8_ETC2]:u?o?[De.BC3_RGBA,Ee.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[De.BC1_RGB,Ee.COMPRESSED_RGB_S3TC_DXT1_EXT]:[De.RGBA32,Pe.RGBA],p=e.hasMipmap?r:Math.min(1,r),x=[];for(let v=0;v1,e.samplingMode=e.hasMipmap?Je.LINEAR_MIPMAP_LINEAR:Je.LINEAR,e.width=i,e.height=a,new ke(t,e,{type:"compressed",levels:x})}const Ct=()=>_r.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil"),xn=542327876,Tn=131072,_n=4;function Mr(t){return t.charCodeAt(0)+(t.charCodeAt(1)<<8)+(t.charCodeAt(2)<<16)+(t.charCodeAt(3)<<24)}function bn(t){return String.fromCharCode(255&t,t>>8&255,t>>16&255,t>>24&255)}const En=Mr("DXT1"),Sn=Mr("DXT3"),yn=Mr("DXT5"),Cn=31,wn=0,An=1,Mn=2,On=3,Rn=4,In=7,Ln=20,$n=21;function Nn(t,e,r){const o=Pn(r,e.hasMipmap??!1);if(o==null)throw new Error("DDS texture data is null");const{textureData:i,internalFormat:a,width:n,height:l}=o;return e.samplingMode=i.levels.length>1?Je.LINEAR_MIPMAP_LINEAR:Je.LINEAR,e.hasMipmap=i.levels.length>1,e.internalFormat=a,e.width=n,e.height=l,new ke(t,e,i)}function Pn(t,e){const r=new Int32Array(t,0,Cn);if(r[wn]!==xn)return Ct().error("Invalid magic number in DDS header"),null;if(!(r[Ln]&_n))return Ct().error("Unsupported format, must contain a FourCC code"),null;const o=r[$n];let i,a;switch(o){case En:i=8,a=Ee.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case Sn:i=16,a=Ee.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case yn:i=16,a=Ee.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return Ct().error("Unsupported FourCC code:",bn(o)),null}let n=1,l=r[Rn],c=r[On];!(3&l)&&!(3&c)||(Ct().warn("Rounding up compressed texture size to nearest multiple of 4."),l=l+3&-4,c=c+3&-4);const u=l,d=c;let h,p;r[Mn]&Tn&&e!==!1&&(n=Math.max(1,r[In]));let x=r[An]+4;const v=[];for(let y=0;y>2)*(c+3>>2)*i,h=new Uint8Array(t,x,p),v.push(h),x+=p,l=Math.max(1,l>>1),c=Math.max(1,c>>1);return{textureData:{type:"compressed",levels:v},internalFormat:a,width:u,height:d}}function Dn(t,e){let a=t.width*t.height;if(a<4096)return t instanceof ImageData?Do(t):t;let n=t.width,l=t.height;do n=Math.ceil(n/2),l=Math.ceil(l/2),a=n*l;while(a>1048576||e!=null&&(n>e||l>e));return Or(t,n,l)}function Fn(t,e){const r=Math.max(t.width,t.height);if(r<=e)return t;const o=e/r;return Or(t,Math.round(t.width*o),Math.round(t.height*o))}function Or(t,e,r){if(t instanceof ImageData)return Or(Do(t),e,r);const o=document.createElement("canvas");return o.width=e,o.height=r,o.getContext("2d").drawImage(t,0,0,o.width,o.height),o}function Do(t){const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const r=e.getContext("2d");if(r==null)throw new Gt("Failed to create 2d context from HTMLCanvasElement");return r.putImageData(t,0,0),e}let Fo=class extends Ar{get parameters(){return this._parameters}constructor(e,r){super(),this._data=e,this.type=Fe.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new Ha,this._parameters={...zn,...r},this._startPreload(e)}dispose(){this.unload(),this._data=this.frameUpdate=void 0}_startPreload(e){e!=null&&(e instanceof HTMLVideoElement?(this.frameUpdate=r=>this._frameUpdate(e,r),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!(Ur(e.src)||e.preload==="auto"&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const r=!e.paused;if(e.src=e.src,r&&e.autoplay){const o=()=>{e.removeEventListener("canplay",o),e.play()};e.addEventListener("canplay",o)}}}_startPreloadImageElement(e){Wa(e.src)||Ur(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const r=new Ao;return r.wrapMode=this._parameters.wrap??Ge.REPEAT,r.flipped=!this._parameters.noUnpackFlip,r.samplingMode=this._parameters.mipmap?Je.LINEAR_MIPMAP_LINEAR:Je.LINEAR,r.hasMipmap=!!this._parameters.mipmap,r.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,r.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),r}get glTexture(){return this._glTexture}get memoryEstimate(){var e;return((e=this._glTexture)==null?void 0:e.usedMemory)||Bn(this._data,this._parameters)}load(e){if(this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const r=this._data;return r==null?(this._glTexture=new ke(e,this._createDescriptor(e),null),this._glTexture):(this._parameters.reloadable||(this._data=void 0),typeof r=="string"?this._loadFromURL(e,r):r instanceof Image?this._loadFromImageElement(e,r):r instanceof HTMLVideoElement?this._loadFromVideoElement(e,r):r instanceof ImageData||r instanceof HTMLCanvasElement?this._loadFromImage(e,r):(st(r)||lt(r))&&this._parameters.encoding===dt.DDS_ENCODING?this._loadFromDDSData(e,r):(st(r)||lt(r))&&this._parameters.encoding===dt.KTX2_ENCODING?this._loadFromKTX2(e,r):(st(r)||lt(r))&&this._parameters.encoding===dt.BASIS_ENCODING?this._loadFromBasis(e,r):lt(r)?this._loadFromPixelData(e,r):st(r)?this._loadFromPixelData(e,new Uint8Array(r)):null)}_frameUpdate(e,r){return this._glTexture==null||e.readyStategn(e,this._createDescriptor(e),r).then(o=>(this._glTexture=o,o)))}_loadFromBasis(e,r){return this._loadAsync(()=>vn(e,this._createDescriptor(e),r).then(o=>(this._glTexture=o,o)))}_loadFromPixelData(e,r){Y(this._parameters.width>0&&this._parameters.height>0);const o=this._createDescriptor(e);return o.pixelFormat=this._parameters.components===1?Pe.LUMINANCE:this._parameters.components===3?Pe.RGB:Pe.RGBA,o.width=this._parameters.width??0,o.height=this._parameters.height??0,this._glTexture=new ke(e,o,r),this._glTexture}_loadFromURL(e,r){return this._loadAsync(async o=>{const i=await wo(r,{signal:o});return jr(o),this._loadFromImage(e,i)})}_loadFromImageElement(e,r){return r.complete?this._loadFromImage(e,r):this._loadAsync(async o=>{const i=await ka(r,r.src,!1,o);return jr(o),this._loadFromImage(e,i)})}_loadFromVideoElement(e,r){return r.readyState>=ut.HAVE_CURRENT_DATA?this._loadFromImage(e,r):this._loadFromVideoElementAsync(e,r)}_loadFromVideoElementAsync(e,r){return this._loadAsync(o=>new Promise((i,a)=>{const n=()=>{r.removeEventListener("loadeddata",l),r.removeEventListener("error",c),Xa(u)},l=()=>{r.readyState>=ut.HAVE_CURRENT_DATA&&(n(),i(this._loadFromImage(e,r)))},c=d=>{n(),a(d||new Gt("Failed to load video"))};r.addEventListener("loadeddata",l),r.addEventListener("error",c);const u=qa(o,()=>c(Ya()))}))}_loadFromImage(e,r){let o=r;if(!(o instanceof HTMLVideoElement)){const{maxTextureSize:n}=e.parameters;o=this._parameters.downsampleUncompressed?Dn(o,n):Fn(o,n)}const i=Bo(o);this._parameters.width=i.width,this._parameters.height=i.height;const a=this._createDescriptor(e);return a.pixelFormat=this._parameters.components===3?Pe.RGB:Pe.RGBA,a.width=i.width,a.height=i.height,this._glTexture=new ke(e,a,o),this._glTexture}_loadAsync(e){const r=new AbortController;this._loadingController=r;const o=e(r.signal);this._loadingPromise=o;const i=()=>{this._loadingController===r&&(this._loadingController=null),this._loadingPromise===o&&(this._loadingPromise=null)};return o.then(i,i),o}unload(){if(this._glTexture=It(this._glTexture),this._loadingController!=null){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}};function Bn(t,e){if(t==null)return 0;if(st(t)||lt(t))return e.encoding===dt.KTX2_ENCODING?pn(t,!!e.mipmap):e.encoding===dt.BASIS_ENCODING?fn(t,!!e.mipmap):t.byteLength;const{width:r,height:o}=t instanceof Image||t instanceof ImageData||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement?Bo(t):e;return(e.mipmap?4/3:1)*r*o*(e.components||4)||0}function Bo(t){return t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t}var ut;(function(t){t[t.HAVE_NOTHING=0]="HAVE_NOTHING",t[t.HAVE_METADATA=1]="HAVE_METADATA",t[t.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",t[t.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",t[t.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA"})(ut||(ut={}));const zn={wrap:{s:Ge.REPEAT,t:Ge.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1,downsampleUncompressed:!1};var T;function er(t){return t===T.Shadow||t===T.ShadowHighlight||t===T.ShadowExcludeHighlight}function tr(t){return jn(t)||t===T.Normal}function Gn(t){return t===T.Highlight||t===T.ObjectAndLayerIdColor}function Vn(t){return t===T.Color||t===T.Alpha}function Un(t){return Vn(t)||Gn(t)}function jn(t){return Un(t)||t===T.LinearDepth}(function(t){t[t.Color=0]="Color",t[t.LinearDepth=1]="LinearDepth",t[t.Depth=2]="Depth",t[t.Normal=3]="Normal",t[t.Shadow=4]="Shadow",t[t.ShadowHighlight=5]="ShadowHighlight",t[t.ShadowExcludeHighlight=6]="ShadowExcludeHighlight",t[t.Highlight=7]="Highlight",t[t.Alpha=8]="Alpha",t[t.ObjectAndLayerIdColor=9]="ObjectAndLayerIdColor",t[t.CompositeColor=10]="CompositeColor",t[t.COUNT=11]="COUNT"})(T||(T={}));function Ht(t,e){switch(e.normalType){case j.Compressed:t.attributes.add(f.NORMALCOMPRESSED,"vec2"),t.vertex.code.add(s`vec3 decompressNormal(vec2 normal) { float z = 1.0 - abs(normal.x) - abs(normal.y); return vec3(normal + sign(normal) * min(z, 0.0), z); } diff --git a/assets/observers-MZ9Ss0UR.js b/assets/observers-B6R0JooC.js similarity index 95% rename from assets/observers-MZ9Ss0UR.js rename to assets/observers-B6R0JooC.js index 9218d5b..f33940f 100644 --- a/assets/observers-MZ9Ss0UR.js +++ b/assets/observers-B6R0JooC.js @@ -1,4 +1,4 @@ -import"./index-CEWggaxV.js";/*! +import"./index-BjUNJPVf.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.7.1 diff --git a/assets/ogcFeatureUtils-D4df60hh.js b/assets/ogcFeatureUtils-B_dc0icr.js similarity index 95% rename from assets/ogcFeatureUtils-D4df60hh.js rename to assets/ogcFeatureUtils-B_dc0icr.js index 31d9380..fdf3dfe 100644 --- a/assets/ogcFeatureUtils-D4df60hh.js +++ b/assets/ogcFeatureUtils-B_dc0icr.js @@ -1 +1 @@ -import{N as j,cP as q,bD as Y,M as $,cC as ee,W as ne,aS as x,cQ as L,cB as te,bW as A,s as ie}from"./index-CEWggaxV.js";import{l as ae,r as re,o as se}from"./featureConversionUtils-CmP9mw0r.js";import{e as oe}from"./OptimizedFeatureSet-Blu9Ckm7.js";import{E as le,I as ce,N as ue}from"./geojson-BLwRz6JF.js";import{o as de}from"./clientSideDefaults-CgRgH99f.js";import{p as fe}from"./sourceUtils-QX9lwl5p.js";import{Z as E}from"./FieldsIndex-CLgRNeJ_.js";const W=()=>ie.getLogger("esri.layers.ogc.ogcFeatureUtils"),J="startindex",me=new Set([J,"offset"]),_="http://www.opengis.net/def/crs/",Ne=`${_}OGC/1.3/CRS84`;var l;async function ve(e,n,t={},i=5){const{links:a}=e,o=p(a,"items",l.geojson)||p(a,"http://www.opengis.net/def/rel/ogc/1.0/items",l.geojson);if(o==null)throw new j("ogc-feature-layer:missing-items-page","Missing items url");const{apiKey:d,customParameters:c,signal:g}=t,f=q(o.href,e.landingPage.url),y={limit:i,...c,token:d},T=Y(f,y),G={accept:l.geojson},{data:S}=await $(T,{signal:g,headers:G}),N=Fe(T,i,S.links)??J;le(S);const m=ce(S,{geometryType:n.geometryType}),F=n.fields||m.fields||[],D=n.hasZ!=null?n.hasZ:m.hasZ,w=m.geometryType,b=n.objectIdField||m.objectIdFieldName||"OBJECTID";let s=n.timeInfo;const v=F.find(({name:r})=>r===b);if(v)v.editable=!1,v.nullable=!1;else{if(!m.objectIdFieldType)throw new j("ogc-feature-layer:missing-feature-id","Collection geojson require a feature id as a unique identifier");F.unshift({name:b,alias:b,type:m.objectIdFieldType==="number"?"esriFieldTypeOID":"esriFieldTypeString",editable:!1,nullable:!1})}if(b!==m.objectIdFieldName){const r=F.find(({name:u})=>u===m.objectIdFieldName);r&&(r.type="esriFieldTypeInteger")}F===m.fields&&m.unknownFields.length>0&&W().warn({name:"ogc-feature-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:m.unknownFields}});for(const r of F){if(r.name==null&&(r.name=r.alias),r.alias==null&&(r.alias=r.name),r.type!=="esriFieldTypeOID"&&r.type!=="esriFieldTypeGlobalID"&&(r.editable=r.editable==null||!!r.editable,r.nullable=r.nullable==null||!!r.nullable),!r.name)throw new j("ogc-feature-layer:invalid-field-name","field name is missing",{field:r});if(!ee.jsonValues.includes(r.type))throw new j("ogc-feature-layer:invalid-field-type",`invalid type for field "${r.name}"`,{field:r})}if(s){const r=new E(F);if(s.startTimeField){const u=r.get(s.startTimeField);u?(s.startTimeField=u.name,u.type="esriFieldTypeDate"):s.startTimeField=null}if(s.endTimeField){const u=r.get(s.endTimeField);u?(s.endTimeField=u.name,u.type="esriFieldTypeDate"):s.endTimeField=null}if(s.trackIdField){const u=r.get(s.trackIdField);u?s.trackIdField=u.name:(s.trackIdField=null,W().warn({name:"ogc-feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:s}}))}s.timeReference||(s.timeReference={timeZoneIANA:ne}),s.startTimeField||s.endTimeField||(W().warn({name:"ogc-feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:s}}),s=null)}return{drawingInfo:w?de(w):null,extent:he(e),geometryType:w,fields:F,hasZ:!!D,objectIdField:b,paginationParameter:N,timeInfo:s}}async function Pe(e,n={}){const{links:t,url:i}=e,a=p(t,"data",l.json)||p(t,"http://www.opengis.net/def/rel/ogc/1.0/data",l.json);if(a==null)throw new j("ogc-feature-layer:missing-collections-page","Missing collections url");const{apiKey:o,customParameters:d,signal:c}=n,g=q(a.href,i),{data:f}=await $(g,{signal:c,headers:{accept:l.json},query:{...d,token:o}});for(const y of f.collections)y.landingPage=e;return f}async function Oe(e,n={}){const{links:t,url:i}=e,a=p(t,"conformance",l.json)||p(t,"http://www.opengis.net/def/rel/ogc/1.0/conformance",l.json);if(a==null)throw new j("ogc-feature-layer:missing-conformance-page","Missing conformance url");const{apiKey:o,customParameters:d,signal:c}=n,g=q(a.href,i),{data:f}=await $(g,{signal:c,headers:{accept:l.json},query:{...d,token:o}});return f}async function qe(e,n={}){const{apiKey:t,customParameters:i,signal:a}=n,{data:o}=await $(e,{signal:a,headers:{accept:l.json},query:{...i,token:t}});return o.url=e,o}async function Ce(e,n={}){const{links:t,url:i}=e,a=p(t,"service-desc",l.openapi);if(a==null)return W().warn("ogc-feature-layer:missing-openapi-page","The OGC API-Features server does not have an OpenAPI page."),null;const{apiKey:o,customParameters:d,signal:c}=n,g=q(a.href,i),{data:f}=await $(g,{signal:c,headers:{accept:l.openapi},query:{...d,token:o}});return f}function We(e){const n=/^http:\/\/www\.opengis.net\/def\/crs\/(?.*)\/(?.*)\/(?.*)$/i.exec(e),t=n==null?void 0:n.groups;if(!t)return null;const{authority:i,code:a}=t;switch(i.toLowerCase()){case"ogc":switch(a.toLowerCase()){case"crs27":return x.GCS_NAD_1927.wkid;case"crs83":return 4269;case"crs84":case"crs84h":return x.WGS84.wkid;default:return null}case"esri":case"epsg":{const o=Number.parseInt(a,10);return Number.isNaN(o)?null:o}default:return null}}async function Ge(e,n,t){const i=await pe(e,n,t);return ae(i)}async function pe(e,n,t){const{collection:{links:i,landingPage:{url:a}},layerDefinition:o,maxRecordCount:d,queryParameters:{apiKey:c,customParameters:g},spatialReference:f,supportedCrs:y}=e,T=p(i,"items",l.geojson)||p(i,"http://www.opengis.net/def/rel/ogc/1.0/items",l.geojson);if(T==null)throw new j("ogc-feature-layer:missing-items-page","Missing items url");const{geometry:G,num:S,start:N,timeExtent:m,where:F}=n;if(n.objectIds)throw new j("ogc-feature-layer:query-by-objectids-not-supported","Queries with object ids are not supported");const D=x.fromJSON(f),w=n.outSpatialReference??D,b=w.isWGS84?null:z(w,y),s=be(G,y),v=ye(m),r=we(F),u=S??(N==null?d:10),B=N===0?void 0:N,{fields:R,geometryType:C,hasZ:Z,objectIdField:P,paginationParameter:Q}=o,U=q(T.href,a),{data:K}=await $(U,{...t,query:{...g,...s,crs:b,datetime:v,query:r,limit:u,[Q]:B,token:c},headers:{accept:l.geojson}}),O=ue(K,{geometryType:C,hasZ:Z,objectIdField:P}),V=O.length===u&&!!p(K.links??[],"next",l.geojson),H=new E(R);for(const h of O){const k={};fe(H,k,h.attributes),k[P]=h.attributes[P],h.attributes=k}if(!b&&w.isWebMercator){for(const h of O)if(h.geometry!=null&&C!=null){const k=re(h.geometry,C,Z,!1);k.spatialReference=x.WGS84,h.geometry=se(L(k,w))}}for(const h of O)h.objectId=h.attributes[P];const X=b||!b&&w.isWebMercator?w.toJSON():te,I=new oe;return I.exceededTransferLimit=V,I.features=O,I.fields=R,I.geometryType=C,I.hasZ=Z,I.objectIdFieldName=P,I.spatialReference=X,I}function ge(e){return e!=null&&e.type==="extent"}function z(e,n){const{isWebMercator:t,wkid:i}=e;if(!i)return null;const a=t?n[3857]??n[102100]??n[102113]??n[900913]:n[e.wkid];return a?`${_}${a}`:null}function M(e){if(e==null)return"";const{xmin:n,ymin:t,xmax:i,ymax:a}=e;return`${n},${t},${i},${a}`}function ye(e){if(e==null)return null;const{start:n,end:t}=e;return`${n!=null?n.toISOString():".."}/${t!=null?t.toISOString():".."}`}function we(e){return e!=null&&e&&e!=="1=1"?e:null}function be(e,n){if(!ge(e))return null;const{spatialReference:t}=e;if(!t||t.isWGS84)return{bbox:M(e)};const i=z(t,n);return i!=null?{bbox:M(e),"bbox-crs":i}:t.isWebMercator?{bbox:M(L(e,x.WGS84))}:null}function he(e){var c;const n=(c=e.extent)==null?void 0:c.spatial;if(!n)return null;const t=n.bbox[0],i=t.length===4,[a,o]=t,d=i?void 0:t[2];return{xmin:a,ymin:o,xmax:i?t[2]:t[3],ymax:i?t[3]:t[4],zmin:d,zmax:i?void 0:t[5],spatialReference:x.WGS84.toJSON()}}function p(e,n,t){return e.find(({rel:i,type:a})=>i===n&&a===t)??e.find(({rel:i,type:a})=>i===n&&!a)}function Fe(e,n,t){var f;if(!t)return;const i=p(t,"next",l.geojson),a=(f=A(i==null?void 0:i.href))==null?void 0:f.query;if(!a)return;const o=A(e).query,d=Object.keys(o??{}),c=Object.entries(a).filter(([y])=>!d.includes(y)).find(([y,T])=>me.has(y.toLowerCase())&&Number.parseInt(T,10)===n);return c==null?void 0:c[0]}(function(e){e.json="application/json",e.geojson="application/geo+json",e.openapi="application/vnd.oai.openapi+json;version=3.0"})(l||(l={}));export{pe as $,We as C,Pe as N,Oe as O,qe as P,Ge as R,_ as k,Ce as q,ve as v,Ne as x}; +import{N as j,cP as q,bD as Y,M as $,cC as ee,W as ne,aS as x,cQ as L,cB as te,bW as A,s as ie}from"./index-BjUNJPVf.js";import{l as ae,r as re,o as se}from"./featureConversionUtils-BHhm7bvm.js";import{e as oe}from"./OptimizedFeatureSet-Blu9Ckm7.js";import{E as le,I as ce,N as ue}from"./geojson-AjfTISUf.js";import{o as de}from"./clientSideDefaults-BQP5n3lX.js";import{p as fe}from"./sourceUtils-BNTaqxhX.js";import{Z as E}from"./FieldsIndex-CK-0B5n9.js";const W=()=>ie.getLogger("esri.layers.ogc.ogcFeatureUtils"),J="startindex",me=new Set([J,"offset"]),_="http://www.opengis.net/def/crs/",Ne=`${_}OGC/1.3/CRS84`;var l;async function ve(e,n,t={},i=5){const{links:a}=e,o=p(a,"items",l.geojson)||p(a,"http://www.opengis.net/def/rel/ogc/1.0/items",l.geojson);if(o==null)throw new j("ogc-feature-layer:missing-items-page","Missing items url");const{apiKey:d,customParameters:c,signal:g}=t,f=q(o.href,e.landingPage.url),y={limit:i,...c,token:d},T=Y(f,y),G={accept:l.geojson},{data:S}=await $(T,{signal:g,headers:G}),N=Fe(T,i,S.links)??J;le(S);const m=ce(S,{geometryType:n.geometryType}),F=n.fields||m.fields||[],D=n.hasZ!=null?n.hasZ:m.hasZ,w=m.geometryType,b=n.objectIdField||m.objectIdFieldName||"OBJECTID";let s=n.timeInfo;const v=F.find(({name:r})=>r===b);if(v)v.editable=!1,v.nullable=!1;else{if(!m.objectIdFieldType)throw new j("ogc-feature-layer:missing-feature-id","Collection geojson require a feature id as a unique identifier");F.unshift({name:b,alias:b,type:m.objectIdFieldType==="number"?"esriFieldTypeOID":"esriFieldTypeString",editable:!1,nullable:!1})}if(b!==m.objectIdFieldName){const r=F.find(({name:u})=>u===m.objectIdFieldName);r&&(r.type="esriFieldTypeInteger")}F===m.fields&&m.unknownFields.length>0&&W().warn({name:"ogc-feature-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:m.unknownFields}});for(const r of F){if(r.name==null&&(r.name=r.alias),r.alias==null&&(r.alias=r.name),r.type!=="esriFieldTypeOID"&&r.type!=="esriFieldTypeGlobalID"&&(r.editable=r.editable==null||!!r.editable,r.nullable=r.nullable==null||!!r.nullable),!r.name)throw new j("ogc-feature-layer:invalid-field-name","field name is missing",{field:r});if(!ee.jsonValues.includes(r.type))throw new j("ogc-feature-layer:invalid-field-type",`invalid type for field "${r.name}"`,{field:r})}if(s){const r=new E(F);if(s.startTimeField){const u=r.get(s.startTimeField);u?(s.startTimeField=u.name,u.type="esriFieldTypeDate"):s.startTimeField=null}if(s.endTimeField){const u=r.get(s.endTimeField);u?(s.endTimeField=u.name,u.type="esriFieldTypeDate"):s.endTimeField=null}if(s.trackIdField){const u=r.get(s.trackIdField);u?s.trackIdField=u.name:(s.trackIdField=null,W().warn({name:"ogc-feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:s}}))}s.timeReference||(s.timeReference={timeZoneIANA:ne}),s.startTimeField||s.endTimeField||(W().warn({name:"ogc-feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:s}}),s=null)}return{drawingInfo:w?de(w):null,extent:he(e),geometryType:w,fields:F,hasZ:!!D,objectIdField:b,paginationParameter:N,timeInfo:s}}async function Pe(e,n={}){const{links:t,url:i}=e,a=p(t,"data",l.json)||p(t,"http://www.opengis.net/def/rel/ogc/1.0/data",l.json);if(a==null)throw new j("ogc-feature-layer:missing-collections-page","Missing collections url");const{apiKey:o,customParameters:d,signal:c}=n,g=q(a.href,i),{data:f}=await $(g,{signal:c,headers:{accept:l.json},query:{...d,token:o}});for(const y of f.collections)y.landingPage=e;return f}async function Oe(e,n={}){const{links:t,url:i}=e,a=p(t,"conformance",l.json)||p(t,"http://www.opengis.net/def/rel/ogc/1.0/conformance",l.json);if(a==null)throw new j("ogc-feature-layer:missing-conformance-page","Missing conformance url");const{apiKey:o,customParameters:d,signal:c}=n,g=q(a.href,i),{data:f}=await $(g,{signal:c,headers:{accept:l.json},query:{...d,token:o}});return f}async function qe(e,n={}){const{apiKey:t,customParameters:i,signal:a}=n,{data:o}=await $(e,{signal:a,headers:{accept:l.json},query:{...i,token:t}});return o.url=e,o}async function Ce(e,n={}){const{links:t,url:i}=e,a=p(t,"service-desc",l.openapi);if(a==null)return W().warn("ogc-feature-layer:missing-openapi-page","The OGC API-Features server does not have an OpenAPI page."),null;const{apiKey:o,customParameters:d,signal:c}=n,g=q(a.href,i),{data:f}=await $(g,{signal:c,headers:{accept:l.openapi},query:{...d,token:o}});return f}function We(e){const n=/^http:\/\/www\.opengis.net\/def\/crs\/(?.*)\/(?.*)\/(?.*)$/i.exec(e),t=n==null?void 0:n.groups;if(!t)return null;const{authority:i,code:a}=t;switch(i.toLowerCase()){case"ogc":switch(a.toLowerCase()){case"crs27":return x.GCS_NAD_1927.wkid;case"crs83":return 4269;case"crs84":case"crs84h":return x.WGS84.wkid;default:return null}case"esri":case"epsg":{const o=Number.parseInt(a,10);return Number.isNaN(o)?null:o}default:return null}}async function Ge(e,n,t){const i=await pe(e,n,t);return ae(i)}async function pe(e,n,t){const{collection:{links:i,landingPage:{url:a}},layerDefinition:o,maxRecordCount:d,queryParameters:{apiKey:c,customParameters:g},spatialReference:f,supportedCrs:y}=e,T=p(i,"items",l.geojson)||p(i,"http://www.opengis.net/def/rel/ogc/1.0/items",l.geojson);if(T==null)throw new j("ogc-feature-layer:missing-items-page","Missing items url");const{geometry:G,num:S,start:N,timeExtent:m,where:F}=n;if(n.objectIds)throw new j("ogc-feature-layer:query-by-objectids-not-supported","Queries with object ids are not supported");const D=x.fromJSON(f),w=n.outSpatialReference??D,b=w.isWGS84?null:z(w,y),s=be(G,y),v=ye(m),r=we(F),u=S??(N==null?d:10),B=N===0?void 0:N,{fields:R,geometryType:C,hasZ:Z,objectIdField:P,paginationParameter:Q}=o,U=q(T.href,a),{data:K}=await $(U,{...t,query:{...g,...s,crs:b,datetime:v,query:r,limit:u,[Q]:B,token:c},headers:{accept:l.geojson}}),O=ue(K,{geometryType:C,hasZ:Z,objectIdField:P}),V=O.length===u&&!!p(K.links??[],"next",l.geojson),H=new E(R);for(const h of O){const k={};fe(H,k,h.attributes),k[P]=h.attributes[P],h.attributes=k}if(!b&&w.isWebMercator){for(const h of O)if(h.geometry!=null&&C!=null){const k=re(h.geometry,C,Z,!1);k.spatialReference=x.WGS84,h.geometry=se(L(k,w))}}for(const h of O)h.objectId=h.attributes[P];const X=b||!b&&w.isWebMercator?w.toJSON():te,I=new oe;return I.exceededTransferLimit=V,I.features=O,I.fields=R,I.geometryType=C,I.hasZ=Z,I.objectIdFieldName=P,I.spatialReference=X,I}function ge(e){return e!=null&&e.type==="extent"}function z(e,n){const{isWebMercator:t,wkid:i}=e;if(!i)return null;const a=t?n[3857]??n[102100]??n[102113]??n[900913]:n[e.wkid];return a?`${_}${a}`:null}function M(e){if(e==null)return"";const{xmin:n,ymin:t,xmax:i,ymax:a}=e;return`${n},${t},${i},${a}`}function ye(e){if(e==null)return null;const{start:n,end:t}=e;return`${n!=null?n.toISOString():".."}/${t!=null?t.toISOString():".."}`}function we(e){return e!=null&&e&&e!=="1=1"?e:null}function be(e,n){if(!ge(e))return null;const{spatialReference:t}=e;if(!t||t.isWGS84)return{bbox:M(e)};const i=z(t,n);return i!=null?{bbox:M(e),"bbox-crs":i}:t.isWebMercator?{bbox:M(L(e,x.WGS84))}:null}function he(e){var c;const n=(c=e.extent)==null?void 0:c.spatial;if(!n)return null;const t=n.bbox[0],i=t.length===4,[a,o]=t,d=i?void 0:t[2];return{xmin:a,ymin:o,xmax:i?t[2]:t[3],ymax:i?t[3]:t[4],zmin:d,zmax:i?void 0:t[5],spatialReference:x.WGS84.toJSON()}}function p(e,n,t){return e.find(({rel:i,type:a})=>i===n&&a===t)??e.find(({rel:i,type:a})=>i===n&&!a)}function Fe(e,n,t){var f;if(!t)return;const i=p(t,"next",l.geojson),a=(f=A(i==null?void 0:i.href))==null?void 0:f.query;if(!a)return;const o=A(e).query,d=Object.keys(o??{}),c=Object.entries(a).filter(([y])=>!d.includes(y)).find(([y,T])=>me.has(y.toLowerCase())&&Number.parseInt(T,10)===n);return c==null?void 0:c[0]}(function(e){e.json="application/json",e.geojson="application/geo+json",e.openapi="application/vnd.oai.openapi+json;version=3.0"})(l||(l={}));export{pe as $,We as C,Pe as N,Oe as O,qe as P,Ge as R,_ as k,Ce as q,ve as v,Ne as x}; diff --git a/assets/openCloseComponent-CP78bYQO.js b/assets/openCloseComponent-7TDD8Qsp.js similarity index 97% rename from assets/openCloseComponent-CP78bYQO.js rename to assets/openCloseComponent-7TDD8Qsp.js index 3ebd21e..27946c1 100644 --- a/assets/openCloseComponent-CP78bYQO.js +++ b/assets/openCloseComponent-7TDD8Qsp.js @@ -1,4 +1,4 @@ -import{ea as v}from"./index-CEWggaxV.js";/*! +import{ea as v}from"./index-BjUNJPVf.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.7.1 diff --git a/assets/orientedBoundingBox-BQdJNYvE.js b/assets/orientedBoundingBox-sJmHxD3E.js similarity index 98% rename from assets/orientedBoundingBox-BQdJNYvE.js rename to assets/orientedBoundingBox-sJmHxD3E.js index 2a15343..4891b81 100644 --- a/assets/orientedBoundingBox-BQdJNYvE.js +++ b/assets/orientedBoundingBox-sJmHxD3E.js @@ -1 +1 @@ -import{cW as it,cX as lt,cy as d,fU as Lt,cz as $t,gB as Ut,fg as Z,fq as w,gC as mt,gD as At,gE as kt,gF as qt,f_ as ta,fh as aa,gG as sa,gH as Ft,e3 as xt,gI as Xt,bj as ea,e7 as Wt,e6 as ia,gJ as na,gK as oa,e5 as ha,gL as Ct,gM as gt,gN as ra,gO as ca,gP as Et}from"./index-CEWggaxV.js";import{t as ua,e as da}from"./mat3f64-q3fE-ZOt.js";import{e as fa}from"./mat4f64-CSKppSlJ.js";import{X as la,O as k,x as ma}from"./quat-CoKEr4Zu.js";import{o as Bt,e as St}from"./quatf64-Bdb9ZJJK.js";import{a as _t,R as _a}from"./computeTranslationToOriginAndRotation-DOOKw0d1.js";import{c as Qt,o as ga,F as It}from"./plane-py4f_JCU.js";class pt{constructor(t,a,s=a){this.data=t,this.size=a,this.stride=s}}class Da extends pt{constructor(t,a,s,n=!1,o=s){super(t,s,o),this.indices=a,this.exclusive=n}}const nt=1e-6,ot=d(),bt=d();function ba(e,t){const{data:a,size:s}=e,n=a.length/s;if(n<=0)return;const o=new ya(e);Nt(ot,o.minProj,o.maxProj),dt(ot,ot,.5),p(bt,o.maxProj,o.minProj);const h=yt(bt),c=new Na;c.quality=h,n<14&&(e=new pt(new Float64Array(o.buffer,112,42),3));const i=d(),r=d(),b=d(),m=d(),z=d(),A=d(),M=d();switch(Ma(o,e,M,i,r,b,m,z,A,c)){case 1:return void Yt(ot,bt,t);case 2:return void Ia(e,m,t)}Pa(e,M,i,r,b,m,z,A,c),Ot(e,c.b0,c.b1,c.b2,at,st);const v=d();p(v,st,at),c.quality=yt(v),c.qualitys&&(s=h,n=o)}S(t,e.minVert[n]),S(a,e.maxVert[n])}const N=[0,0,0];function ja(e,t,a,s){const{data:n,size:o}=e;let h=Number.NEGATIVE_INFINITY,c=0;for(let i=0;ih&&(h=m,c=i)}return S(s,n,c),h}const _=Lt();function xa(e,t,a,s,n){za(e,t,_,n,s);const o=Jt(a,t);_[1]-nt<=o&&(s[0]=void 0),_[0]+nt>=o&&(n[0]=void 0)}const Tt=d(),vt=d(),Ht=d(),J=d(),K=d(),Mt=d();function D(e,t,a,s,n,o){if(Zt(t)a[1]&&(a[1]=i,S(n,o,c))}}function Yt(e,t,a){a.center=e,a.halfSize=it(t,t,.5),a.quaternion=Bt}const H=d(),L=d(),ct=d(),at=d(),st=d(),Gt=d();function Ia(e,t,a){S(H,t),Math.abs(t[0])>Math.abs(t[1])&&Math.abs(t[0])>Math.abs(t[2])?H[0]=0:Math.abs(t[1])>Math.abs(t[2])?H[1]=0:H[2]=0,Zt(H)this.maxProj[0]&&(this.maxProj[0]=r,o[0]=i),r=h[i+1],rthis.maxProj[1]&&(this.maxProj[1]=r,o[1]=i),r=h[i+2],rthis.maxProj[2]&&(this.maxProj[2]=r,o[2]=i),r=h[i]+h[i+1]+h[i+2],rthis.maxProj[3]&&(this.maxProj[3]=r,o[3]=i),r=h[i]+h[i+1]-h[i+2],rthis.maxProj[4]&&(this.maxProj[4]=r,o[4]=i),r=h[i]-h[i+1]+h[i+2],rthis.maxProj[5]&&(this.maxProj[5]=r,o[5]=i),r=h[i]-h[i+1]-h[i+2],rthis.maxProj[6]&&(this.maxProj[6]=r,o[6]=i)}for(let i=0;i<$;++i){let r=n[i];S(this.minVert[i],h,r),r=o[i],S(this.maxVert[i],h,r)}}},Na=class{constructor(){this.b0=$t(1,0,0),this.b1=$t(0,1,0),this.b2=$t(0,0,1),this.quality=0}};function yt(e){return e[0]*e[1]+e[0]*e[2]+e[1]*e[2]}function Nt(e,t,a){e[0]=t[0]+a[0],e[1]=t[1]+a[1],e[2]=t[2]+a[2]}function p(e,t,a){e[0]=t[0]-a[0],e[1]=t[1]-a[1],e[2]=t[2]-a[2]}function dt(e,t,a){e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a}function S(e,t,a=0){e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2]}function V(e,t,a){const s=t[0],n=t[1],o=t[2],h=a[0],c=a[1],i=a[2];e[0]=n*i-o*c,e[1]=o*h-s*i,e[2]=s*c-n*h}function g(e,t){const a=t[0]*t[0]+t[1]*t[1]+t[2]*t[2];if(a>0){const s=1/Math.sqrt(a);e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s}}function Zt(e){return e[0]*e[0]+e[1]*e[1]+e[2]*e[2]}function wt(e,t){const a=t[0]-e[0],s=t[1]-e[1],n=t[2]-e[2];return a*a+s*s+n*n}function Jt(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function wa(e,t){const a=t[0]+t[4]+t[8];if(a>0){let s=Math.sqrt(a+1);e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s}else{let s=0;t[4]>t[0]&&(s=1),t[8]>t[3*s+s]&&(s=2);const n=(s+1)%3,o=(s+2)%3;let h=Math.sqrt(t[3*s+s]-t[3*n+n]-t[3*o+o]+1);e[s]=.5*h,h=.5/h,e[3]=(t[3*n+o]-t[3*o+n])*h,e[n]=(t[3*n+s]+t[3*s+n])*h,e[o]=(t[3*o+s]+t[3*s+o])*h}return e}class ft{constructor(t=Ut,a=Ha,s=Bt){this._data=[t[0],t[1],t[2],a[0],a[1],a[2],s[0],s[1],s[2],s[3]]}clone(){const t=new ft;return t._data=this._data.slice(),t}invalidate(){this._data[3]=-1}get isValid(){return this._data[3]>=0}static fromData(t){const a=new ft;return a._data=t.slice(),a}static fromJSON(t){return new ft(t.center,t.halfSize,t.quaternion)}copy(t){this._data=t.data.slice()}get center(){return Z(Qt.get(),this._data[0],this._data[1],this._data[2])}get centerX(){return this._data[0]}get centerY(){return this._data[1]}get centerZ(){return this._data[2]}getCenter(t){return t[0]=this._data[0],t[1]=this._data[1],t[2]=this._data[2],t}set center(t){this._data[0]=t[0],this._data[1]=t[1],this._data[2]=t[2]}setCenter(t,a,s){this._data[0]=t,this._data[1]=a,this._data[2]=s}get halfSize(){return Z(Qt.get(),this._data[3],this._data[4],this._data[5])}get halfSizeX(){return this._data[3]}get halfSizeY(){return this._data[4]}get halfSizeZ(){return this._data[5]}getHalfSize(t){return t[0]=this._data[3],t[1]=this._data[4],t[2]=this._data[5],t}set halfSize(t){this._data[3]=t[0],this._data[4]=t[1],this._data[5]=t[2]}get quaternion(){return la(ga.get(),this._data[6],this._data[7],this._data[8],this._data[9])}getQuaternion(t){return t[0]=this._data[6],t[1]=this._data[7],t[2]=this._data[8],t[3]=this._data[9],t}set quaternion(t){this._data[6]=t[0],this._data[7]=t[1],this._data[8]=t[2],this._data[9]=t[3]}get data(){return this._data}getCorners(t){const a=l,s=this._data;a[0]=s[6],a[1]=s[7],a[2]=s[8],a[3]=s[9];for(let n=0;n<8;++n){const o=t[n];o[0]=(1&n?-1:1)*s[3],o[1]=(2&n?-1:1)*s[4],o[2]=(4&n?-1:1)*s[5],w(o,o,a),o[0]+=s[0],o[1]+=s[1],o[2]+=s[2]}}isVisible(t){return this.intersectPlane(t[0])<=0&&this.intersectPlane(t[1])<=0&&this.intersectPlane(t[2])<=0&&this.intersectPlane(t[3])<=0&&this.intersectPlane(t[4])<=0&&this.intersectPlane(t[5])<=0}get radius(){const t=this._data[3],a=this._data[4],s=this._data[5];return Math.sqrt(t*t+a*a+s*s)}intersectSphere(t){u[0]=this._data[0]-t[0],u[1]=this._data[1]-t[1],u[2]=this._data[2]-t[2];const a=this.getQuaternion(G);return k(l,a),w(u,u,l),mt(u,u),Y[0]=Math.min(u[0],this._data[3]),Y[1]=Math.min(u[1],this._data[4]),Y[2]=Math.min(u[2],this._data[5]),At(Y,u)o*o)&&(l[0]=-s[6],l[1]=-s[7],l[2]=-s[8],l[3]=s[9],w(u,u,l),mt(u,u),Y[0]=Math.min(u[0],s[3]),Y[1]=Math.min(u[1],s[4]),Y[2]=Math.min(u[2],s[5]),At(Y,u)s?1:a<-s?-1:0}intersectRay(t,a,s=0){const n=this._data,o=l;o[0]=-n[6],o[1]=-n[7],o[2]=-n[8],o[3]=n[9],u[0]=t[0]-n[0],u[1]=t[1]-n[1],u[2]=t[2]-n[2];const h=w(u,u,l),c=w(Y,a,l);let i=-1/0,r=1/0;const b=this.getHalfSize(et);for(let m=0;m<3;m++){const z=h[m],A=c[m],M=b[m]+s;if(Math.abs(A)>1e-6){const v=(M-z)/A,P=(-M-z)/A;i=Math.max(i,Math.min(v,P)),r=Math.min(r,Math.max(v,P))}else if(z>M||z<-M)return!1}return i<=r}projectedArea(t,a,s,n){const o=this.getQuaternion(G);k(l,o),u[0]=t[0]-this._data[0],u[1]=t[1]-this._data[1],u[2]=t[2]-this._data[2],w(u,u,l);const h=this.getHalfSize(et),c=u[0]<-h[0]?-1:u[0]>h[0]?1:0,i=u[1]<-h[1]?-1:u[1]>h[1]?1:0,r=u[2]<-h[2]?-1:u[2]>h[2]?1:0,b=Math.abs(c)+Math.abs(i)+Math.abs(r);if(b===0)return 1/0;const m=b===1?4:6,z=6*(c+3*i+9*r+13);qt(U,o),ta(U,U,h);const A=this.getCenter(E);for(let P=0;P>1)-1),aa(u,u,U),lt(O,A,u),O[3]=1,sa(O,O,a);const Vt=1/Math.max(1e-6,O[3]);F[2*P]=O[0]*Vt,F[2*P+1]=O[1]*Vt}const M=2*m-2;let v=F[0]*(F[3]-F[M+1])+F[M]*(F[1]-F[M-1]);for(let P=2;P{const e=new Int8Array(162);let t=0;const a=s=>{for(let n=0;n0?1+t/r:1,m=i>0?1+a/i:1,z=(m+b)/2,A=(m-b)/2;it(x,C,A),n.halfSize=gt(x,x,c,z),it(x,C,z),gt(x,x,c,A),ra(f,f),ca(f,x,f);const M=e.getQuaternion(pa);n.center=w(f,f,M)}}else{n.center=gt(f,h,Et,(a+t)/2);const i=w(f,Et,l);mt(i,i),n.halfSize=gt(C,c,i,(a-t)/2)}return n}function Fa(e,t,a,s,n){t.getCenter(E),E[2]+=n;const o=_t(a);xt(E,e,0,E,o,0,1),Kt(o,t,E,a,s)}function Ca(e,t,a,s,n){t.getCenter(E),E[2]+=n,Kt(e,t,E,a,s)}function Kt(e,t,a,s,n){const o=t.getQuaternion(G),h=qt(U,o),c=t.getHalfSize(et);for(let i=0;i<8;++i){for(let r=0;r<3;++r)T[r]=c[r]*(i&1<s&&(s=h,n=o)}S(t,e.minVert[n]),S(a,e.maxVert[n])}const N=[0,0,0];function ja(e,t,a,s){const{data:n,size:o}=e;let h=Number.NEGATIVE_INFINITY,c=0;for(let i=0;ih&&(h=m,c=i)}return S(s,n,c),h}const _=Lt();function xa(e,t,a,s,n){za(e,t,_,n,s);const o=Jt(a,t);_[1]-nt<=o&&(s[0]=void 0),_[0]+nt>=o&&(n[0]=void 0)}const Tt=d(),vt=d(),Ht=d(),J=d(),K=d(),Mt=d();function D(e,t,a,s,n,o){if(Zt(t)a[1]&&(a[1]=i,S(n,o,c))}}function Yt(e,t,a){a.center=e,a.halfSize=it(t,t,.5),a.quaternion=Bt}const H=d(),L=d(),ct=d(),at=d(),st=d(),Gt=d();function Ia(e,t,a){S(H,t),Math.abs(t[0])>Math.abs(t[1])&&Math.abs(t[0])>Math.abs(t[2])?H[0]=0:Math.abs(t[1])>Math.abs(t[2])?H[1]=0:H[2]=0,Zt(H)this.maxProj[0]&&(this.maxProj[0]=r,o[0]=i),r=h[i+1],rthis.maxProj[1]&&(this.maxProj[1]=r,o[1]=i),r=h[i+2],rthis.maxProj[2]&&(this.maxProj[2]=r,o[2]=i),r=h[i]+h[i+1]+h[i+2],rthis.maxProj[3]&&(this.maxProj[3]=r,o[3]=i),r=h[i]+h[i+1]-h[i+2],rthis.maxProj[4]&&(this.maxProj[4]=r,o[4]=i),r=h[i]-h[i+1]+h[i+2],rthis.maxProj[5]&&(this.maxProj[5]=r,o[5]=i),r=h[i]-h[i+1]-h[i+2],rthis.maxProj[6]&&(this.maxProj[6]=r,o[6]=i)}for(let i=0;i<$;++i){let r=n[i];S(this.minVert[i],h,r),r=o[i],S(this.maxVert[i],h,r)}}},Na=class{constructor(){this.b0=$t(1,0,0),this.b1=$t(0,1,0),this.b2=$t(0,0,1),this.quality=0}};function yt(e){return e[0]*e[1]+e[0]*e[2]+e[1]*e[2]}function Nt(e,t,a){e[0]=t[0]+a[0],e[1]=t[1]+a[1],e[2]=t[2]+a[2]}function p(e,t,a){e[0]=t[0]-a[0],e[1]=t[1]-a[1],e[2]=t[2]-a[2]}function dt(e,t,a){e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a}function S(e,t,a=0){e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2]}function V(e,t,a){const s=t[0],n=t[1],o=t[2],h=a[0],c=a[1],i=a[2];e[0]=n*i-o*c,e[1]=o*h-s*i,e[2]=s*c-n*h}function g(e,t){const a=t[0]*t[0]+t[1]*t[1]+t[2]*t[2];if(a>0){const s=1/Math.sqrt(a);e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s}}function Zt(e){return e[0]*e[0]+e[1]*e[1]+e[2]*e[2]}function wt(e,t){const a=t[0]-e[0],s=t[1]-e[1],n=t[2]-e[2];return a*a+s*s+n*n}function Jt(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function wa(e,t){const a=t[0]+t[4]+t[8];if(a>0){let s=Math.sqrt(a+1);e[3]=.5*s,s=.5/s,e[0]=(t[5]-t[7])*s,e[1]=(t[6]-t[2])*s,e[2]=(t[1]-t[3])*s}else{let s=0;t[4]>t[0]&&(s=1),t[8]>t[3*s+s]&&(s=2);const n=(s+1)%3,o=(s+2)%3;let h=Math.sqrt(t[3*s+s]-t[3*n+n]-t[3*o+o]+1);e[s]=.5*h,h=.5/h,e[3]=(t[3*n+o]-t[3*o+n])*h,e[n]=(t[3*n+s]+t[3*s+n])*h,e[o]=(t[3*o+s]+t[3*s+o])*h}return e}class ft{constructor(t=Ut,a=Ha,s=Bt){this._data=[t[0],t[1],t[2],a[0],a[1],a[2],s[0],s[1],s[2],s[3]]}clone(){const t=new ft;return t._data=this._data.slice(),t}invalidate(){this._data[3]=-1}get isValid(){return this._data[3]>=0}static fromData(t){const a=new ft;return a._data=t.slice(),a}static fromJSON(t){return new ft(t.center,t.halfSize,t.quaternion)}copy(t){this._data=t.data.slice()}get center(){return Z(Qt.get(),this._data[0],this._data[1],this._data[2])}get centerX(){return this._data[0]}get centerY(){return this._data[1]}get centerZ(){return this._data[2]}getCenter(t){return t[0]=this._data[0],t[1]=this._data[1],t[2]=this._data[2],t}set center(t){this._data[0]=t[0],this._data[1]=t[1],this._data[2]=t[2]}setCenter(t,a,s){this._data[0]=t,this._data[1]=a,this._data[2]=s}get halfSize(){return Z(Qt.get(),this._data[3],this._data[4],this._data[5])}get halfSizeX(){return this._data[3]}get halfSizeY(){return this._data[4]}get halfSizeZ(){return this._data[5]}getHalfSize(t){return t[0]=this._data[3],t[1]=this._data[4],t[2]=this._data[5],t}set halfSize(t){this._data[3]=t[0],this._data[4]=t[1],this._data[5]=t[2]}get quaternion(){return la(ga.get(),this._data[6],this._data[7],this._data[8],this._data[9])}getQuaternion(t){return t[0]=this._data[6],t[1]=this._data[7],t[2]=this._data[8],t[3]=this._data[9],t}set quaternion(t){this._data[6]=t[0],this._data[7]=t[1],this._data[8]=t[2],this._data[9]=t[3]}get data(){return this._data}getCorners(t){const a=l,s=this._data;a[0]=s[6],a[1]=s[7],a[2]=s[8],a[3]=s[9];for(let n=0;n<8;++n){const o=t[n];o[0]=(1&n?-1:1)*s[3],o[1]=(2&n?-1:1)*s[4],o[2]=(4&n?-1:1)*s[5],w(o,o,a),o[0]+=s[0],o[1]+=s[1],o[2]+=s[2]}}isVisible(t){return this.intersectPlane(t[0])<=0&&this.intersectPlane(t[1])<=0&&this.intersectPlane(t[2])<=0&&this.intersectPlane(t[3])<=0&&this.intersectPlane(t[4])<=0&&this.intersectPlane(t[5])<=0}get radius(){const t=this._data[3],a=this._data[4],s=this._data[5];return Math.sqrt(t*t+a*a+s*s)}intersectSphere(t){u[0]=this._data[0]-t[0],u[1]=this._data[1]-t[1],u[2]=this._data[2]-t[2];const a=this.getQuaternion(G);return k(l,a),w(u,u,l),mt(u,u),Y[0]=Math.min(u[0],this._data[3]),Y[1]=Math.min(u[1],this._data[4]),Y[2]=Math.min(u[2],this._data[5]),At(Y,u)o*o)&&(l[0]=-s[6],l[1]=-s[7],l[2]=-s[8],l[3]=s[9],w(u,u,l),mt(u,u),Y[0]=Math.min(u[0],s[3]),Y[1]=Math.min(u[1],s[4]),Y[2]=Math.min(u[2],s[5]),At(Y,u)s?1:a<-s?-1:0}intersectRay(t,a,s=0){const n=this._data,o=l;o[0]=-n[6],o[1]=-n[7],o[2]=-n[8],o[3]=n[9],u[0]=t[0]-n[0],u[1]=t[1]-n[1],u[2]=t[2]-n[2];const h=w(u,u,l),c=w(Y,a,l);let i=-1/0,r=1/0;const b=this.getHalfSize(et);for(let m=0;m<3;m++){const z=h[m],A=c[m],M=b[m]+s;if(Math.abs(A)>1e-6){const v=(M-z)/A,P=(-M-z)/A;i=Math.max(i,Math.min(v,P)),r=Math.min(r,Math.max(v,P))}else if(z>M||z<-M)return!1}return i<=r}projectedArea(t,a,s,n){const o=this.getQuaternion(G);k(l,o),u[0]=t[0]-this._data[0],u[1]=t[1]-this._data[1],u[2]=t[2]-this._data[2],w(u,u,l);const h=this.getHalfSize(et),c=u[0]<-h[0]?-1:u[0]>h[0]?1:0,i=u[1]<-h[1]?-1:u[1]>h[1]?1:0,r=u[2]<-h[2]?-1:u[2]>h[2]?1:0,b=Math.abs(c)+Math.abs(i)+Math.abs(r);if(b===0)return 1/0;const m=b===1?4:6,z=6*(c+3*i+9*r+13);qt(U,o),ta(U,U,h);const A=this.getCenter(E);for(let P=0;P>1)-1),aa(u,u,U),lt(O,A,u),O[3]=1,sa(O,O,a);const Vt=1/Math.max(1e-6,O[3]);F[2*P]=O[0]*Vt,F[2*P+1]=O[1]*Vt}const M=2*m-2;let v=F[0]*(F[3]-F[M+1])+F[M]*(F[1]-F[M-1]);for(let P=2;P{const e=new Int8Array(162);let t=0;const a=s=>{for(let n=0;n0?1+t/r:1,m=i>0?1+a/i:1,z=(m+b)/2,A=(m-b)/2;it(x,C,A),n.halfSize=gt(x,x,c,z),it(x,C,z),gt(x,x,c,A),ra(f,f),ca(f,x,f);const M=e.getQuaternion(pa);n.center=w(f,f,M)}}else{n.center=gt(f,h,Et,(a+t)/2);const i=w(f,Et,l);mt(i,i),n.halfSize=gt(C,c,i,(a-t)/2)}return n}function Fa(e,t,a,s,n){t.getCenter(E),E[2]+=n;const o=_t(a);xt(E,e,0,E,o,0,1),Kt(o,t,E,a,s)}function Ca(e,t,a,s,n){t.getCenter(E),E[2]+=n,Kt(e,t,E,a,s)}function Kt(e,t,a,s,n){const o=t.getQuaternion(G),h=qt(U,o),c=t.getHalfSize(et);for(let i=0;i<8;++i){for(let r=0;r<3;++r)T[r]=c[r]*(i&1<>3,this._dataType=7&i,!t||t===this._tag)break;this.skip()}return!0}next(){if(this._pos===this._end)return!1;const t=this._decodeVarint();return this._tag=t>>3,this._dataType=7&t,!0}empty(){return this._pos>=this._end}tag(){return this._tag}getInt32(){return this._decodeVarint()}getInt64(){return this._decodeVarint()}getUInt32(){let t=4294967295;if(t=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128||(t=(t|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128)||(t=(t|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128)||(t=(t|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128)||(t=(t|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128))return t;throw new Error("Varint overflow")}getUInt64(){return this._decodeVarint()}getSInt32(){const t=this.getUInt32();return t>>>1^-(1&t)|0}getSInt64(){return this._decodeSVarint()}getBool(){const t=this._data[this._pos]!==0;return this._skip(1),t}getEnum(){return this._decodeVarint()}getFixed64(){const t=this._dataView,i=this._pos,s=t.getUint32(i,!0)+t.getUint32(i+4,!0)*p;return this._skip(8),s}getSFixed64(){const t=this._dataView,i=this._pos,s=t.getUint32(i,!0)+t.getInt32(i+4,!0)*p;return this._skip(8),s}getDouble(){const t=this._dataView.getFloat64(this._pos,!0);return this._skip(8),t}getFixed32(){const t=this._dataView.getUint32(this._pos,!0);return this._skip(4),t}getSFixed32(){const t=this._dataView.getInt32(this._pos,!0);return this._skip(4),t}getFloat(){const t=this._dataView.getFloat32(this._pos,!0);return this._skip(4),t}getString(){const t=this._getLength(),i=this._pos,s=this._toString(this._data,i,i+t);return this._skip(t),s}getBytes(){const t=this._getLength(),i=this._pos,s=this._toBytes(this._data,i,i+t);return this._skip(t),s}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(t,i,s,e){const r=this.getMessage(),a=t(r,i,s,e);return r.release(),a}processMessage(t){const i=this.getMessage(),s=t(i);return i.release(),s}getMessage(){const t=this._getLength(),i=o.pool.acquire();return i._init(this._data,this._dataView,this._pos,this._pos+t),this._skip(t),i}release(){o.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case h.varint:this._decodeVarint();break;case h.fixed64:this._skip(8);break;case h.delimited:this._skip(this._getLength());break;case h.fixed32:this._skip(4);break;default:throw new Error("Invalid data type!")}}skipLen(t){this._skip(t)}_skip(t){if(this._pos+t>this._end)throw new Error("Attempt to skip past the end of buffer!");this._pos+=t}_decodeVarint(){const t=this._data;let i=this._pos,s=0,e=0;if(this._end-i>=10)do{if(e=t[i++],s|=127&e,(128&e)==0||(e=t[i++],s|=(127&e)<<7,(128&e)==0)||(e=t[i++],s|=(127&e)<<14,(128&e)==0)||(e=t[i++],s|=(127&e)<<21,(128&e)==0)||(e=t[i++],s+=268435456*(127&e),(128&e)==0)||(e=t[i++],s+=34359738368*(127&e),(128&e)==0)||(e=t[i++],s+=4398046511104*(127&e),(128&e)==0)||(e=t[i++],s+=562949953421312*(127&e),(128&e)==0)||(e=t[i++],s+=72057594037927940*(127&e),(128&e)==0)||(e=t[i++],s+=9223372036854776e3*(127&e),(128&e)==0))break;throw new Error("Varint too long!")}while(!1);else{let r=1;for(;i!==this._end&&(e=t[i],(128&e)!=0);)++i,s+=(127&e)*r,r*=128;if(i===this._end)throw new Error("Varint overrun!");++i,s+=e*r}return this._pos=i,s}_decodeSVarint(){const t=this._data;let i,s=0,e=0;const r=1&t[this._pos];if(e=t[this._pos++],s|=127&e,(128&e)==0||(e=t[this._pos++],s|=(127&e)<<7,(128&e)==0)||(e=t[this._pos++],s|=(127&e)<<14,(128&e)==0)||(e=t[this._pos++],s|=(127&e)<<21,(128&e)==0)||(e=t[this._pos++],s+=268435456*(127&e),(128&e)==0)||(e=t[this._pos++],s+=34359738368*(127&e),(128&e)==0)||(e=t[this._pos++],s+=4398046511104*(127&e),(128&e)==0))return r?-(s+1)/2:s/2;if(i=BigInt(s),e=t[this._pos++],i+=0x2000000000000n*BigInt(127&e),(128&e)==0||(e=t[this._pos++],i+=0x100000000000000n*BigInt(127&e),(128&e)==0)||(e=t[this._pos++],i+=0x8000000000000000n*BigInt(127&e),(128&e)==0))return Number(r?-(i+1n)/2n:i/2n);throw new Error("Varint too long!")}_getLength(){if(this._dataType!==h.delimited)throw new Error("Not a delimited data type!");return this._decodeVarint()}_getLengthUnsafe(){return this.getUInt32()}_toString(t,i,s){if((s=Math.min(this._end,s))-i>f){const a=t.subarray(i,s);return u.decode(a)}let e="",r="";for(let a=i;a{n._data=null,n._dataView=null});export{o as n}; +import{E as d,aq as g}from"./index-BjUNJPVf.js";var h;(function(n){n[n.varint=0]="varint",n[n.fixed64=1]="fixed64",n[n.delimited=2]="delimited",n[n.fixed32=5]="fixed32",n[n.unknown=99]="unknown"})(h||(h={}));const p=4294967296,u=new TextDecoder("utf-8"),f=d("safari")||d("ios")?6:d("ff")?12:32;class o{constructor(t,i,s=0,e=t?t.byteLength:0){this._tag=0,this._dataType=h.unknown,this._init(t,i,s,e)}_init(t,i,s,e){this._data=t,this._dataView=i,this._pos=s,this._end=e}asUnsafe(){return this}clone(){return new o(this._data,this._dataView,this._pos,this._end)}pos(){return this._pos}move(t){this._pos=t}nextTag(t){for(;;){if(this._pos===this._end)return!1;const i=this._decodeVarint();if(this._tag=i>>3,this._dataType=7&i,!t||t===this._tag)break;this.skip()}return!0}next(){if(this._pos===this._end)return!1;const t=this._decodeVarint();return this._tag=t>>3,this._dataType=7&t,!0}empty(){return this._pos>=this._end}tag(){return this._tag}getInt32(){return this._decodeVarint()}getInt64(){return this._decodeVarint()}getUInt32(){let t=4294967295;if(t=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128||(t=(t|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128)||(t=(t|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128)||(t=(t|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128)||(t=(t|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128))return t;throw new Error("Varint overflow")}getUInt64(){return this._decodeVarint()}getSInt32(){const t=this.getUInt32();return t>>>1^-(1&t)|0}getSInt64(){return this._decodeSVarint()}getBool(){const t=this._data[this._pos]!==0;return this._skip(1),t}getEnum(){return this._decodeVarint()}getFixed64(){const t=this._dataView,i=this._pos,s=t.getUint32(i,!0)+t.getUint32(i+4,!0)*p;return this._skip(8),s}getSFixed64(){const t=this._dataView,i=this._pos,s=t.getUint32(i,!0)+t.getInt32(i+4,!0)*p;return this._skip(8),s}getDouble(){const t=this._dataView.getFloat64(this._pos,!0);return this._skip(8),t}getFixed32(){const t=this._dataView.getUint32(this._pos,!0);return this._skip(4),t}getSFixed32(){const t=this._dataView.getInt32(this._pos,!0);return this._skip(4),t}getFloat(){const t=this._dataView.getFloat32(this._pos,!0);return this._skip(4),t}getString(){const t=this._getLength(),i=this._pos,s=this._toString(this._data,i,i+t);return this._skip(t),s}getBytes(){const t=this._getLength(),i=this._pos,s=this._toBytes(this._data,i,i+t);return this._skip(t),s}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(t,i,s,e){const r=this.getMessage(),a=t(r,i,s,e);return r.release(),a}processMessage(t){const i=this.getMessage(),s=t(i);return i.release(),s}getMessage(){const t=this._getLength(),i=o.pool.acquire();return i._init(this._data,this._dataView,this._pos,this._pos+t),this._skip(t),i}release(){o.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case h.varint:this._decodeVarint();break;case h.fixed64:this._skip(8);break;case h.delimited:this._skip(this._getLength());break;case h.fixed32:this._skip(4);break;default:throw new Error("Invalid data type!")}}skipLen(t){this._skip(t)}_skip(t){if(this._pos+t>this._end)throw new Error("Attempt to skip past the end of buffer!");this._pos+=t}_decodeVarint(){const t=this._data;let i=this._pos,s=0,e=0;if(this._end-i>=10)do{if(e=t[i++],s|=127&e,(128&e)==0||(e=t[i++],s|=(127&e)<<7,(128&e)==0)||(e=t[i++],s|=(127&e)<<14,(128&e)==0)||(e=t[i++],s|=(127&e)<<21,(128&e)==0)||(e=t[i++],s+=268435456*(127&e),(128&e)==0)||(e=t[i++],s+=34359738368*(127&e),(128&e)==0)||(e=t[i++],s+=4398046511104*(127&e),(128&e)==0)||(e=t[i++],s+=562949953421312*(127&e),(128&e)==0)||(e=t[i++],s+=72057594037927940*(127&e),(128&e)==0)||(e=t[i++],s+=9223372036854776e3*(127&e),(128&e)==0))break;throw new Error("Varint too long!")}while(!1);else{let r=1;for(;i!==this._end&&(e=t[i],(128&e)!=0);)++i,s+=(127&e)*r,r*=128;if(i===this._end)throw new Error("Varint overrun!");++i,s+=e*r}return this._pos=i,s}_decodeSVarint(){const t=this._data;let i,s=0,e=0;const r=1&t[this._pos];if(e=t[this._pos++],s|=127&e,(128&e)==0||(e=t[this._pos++],s|=(127&e)<<7,(128&e)==0)||(e=t[this._pos++],s|=(127&e)<<14,(128&e)==0)||(e=t[this._pos++],s|=(127&e)<<21,(128&e)==0)||(e=t[this._pos++],s+=268435456*(127&e),(128&e)==0)||(e=t[this._pos++],s+=34359738368*(127&e),(128&e)==0)||(e=t[this._pos++],s+=4398046511104*(127&e),(128&e)==0))return r?-(s+1)/2:s/2;if(i=BigInt(s),e=t[this._pos++],i+=0x2000000000000n*BigInt(127&e),(128&e)==0||(e=t[this._pos++],i+=0x100000000000000n*BigInt(127&e),(128&e)==0)||(e=t[this._pos++],i+=0x8000000000000000n*BigInt(127&e),(128&e)==0))return Number(r?-(i+1n)/2n:i/2n);throw new Error("Varint too long!")}_getLength(){if(this._dataType!==h.delimited)throw new Error("Not a delimited data type!");return this._decodeVarint()}_getLengthUnsafe(){return this.getUInt32()}_toString(t,i,s){if((s=Math.min(this._end,s))-i>f){const a=t.subarray(i,s);return u.decode(a)}let e="",r="";for(let a=i;a{n._data=null,n._dataView=null});export{o as n}; diff --git a/assets/pbfQueryUtils-CLRSFGBm.js b/assets/pbfQueryUtils-CSeFSIjv.js similarity index 98% rename from assets/pbfQueryUtils-CLRSFGBm.js rename to assets/pbfQueryUtils-CSeFSIjv.js index be7d56b..a062a96 100644 --- a/assets/pbfQueryUtils-CLRSFGBm.js +++ b/assets/pbfQueryUtils-CSeFSIjv.js @@ -1 +1 @@ -import{G as I,bk as d,N as w}from"./index-CEWggaxV.js";import{n as S}from"./pbf-D9QZb8S8.js";import{s as U,t as G,e as y}from"./OptimizedGeometry-CQuTPb9g.js";import{e as D}from"./OptimizedFeatureSet-Blu9Ckm7.js";const F=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"];let Y=class{constructor(e){this._options=e,this.geometryTypes=F,this._coordinatePtr=0,this._vertexDimension=0}createFeatureResult(){return new D}prepareFeatures(e){this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++}finishFeatureResult(e){if(!(e!=null&&e.features)||!e.hasZ||!this._options.sourceSpatialReference||!e.spatialReference||I(e.spatialReference,this._options.sourceSpatialReference)||e.spatialReference.vcsWkid)return;const a=d(this._options.sourceSpatialReference)/d(e.spatialReference);if(a!==1)for(const n of e.features){if(!U(n))continue;const s=n.geometry.coords;for(let r=2;ra+n,0)*this._vertexDimension,this._coordinatePtr=0}addCoordinate(e,a){e.coords[this._coordinatePtr++]=a}addCoordinatePoint(e,a){e.coords.push(a)}addLength(e,a){e.lengths.push(a)}addQueryGeometry(e,a){e.queryGeometry=a.queryGeometry,e.queryGeometryType=a.queryGeometryType}createPointGeometry(){return new y}};const b=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeBigInteger","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"],h=["sqlTypeBigInt","sqlTypeBinary","sqlTypeBit","sqlTypeChar","sqlTypeDate","sqlTypeDecimal","sqlTypeDouble","sqlTypeFloat","sqlTypeGeometry","sqlTypeGUID","sqlTypeInteger","sqlTypeLongNVarchar","sqlTypeLongVarbinary","sqlTypeLongVarchar","sqlTypeNChar","sqlTypeNVarchar","sqlTypeOther","sqlTypeReal","sqlTypeSmallInt","sqlTypeSqlXml","sqlTypeTime","sqlTypeTimestamp","sqlTypeTimestamp2","sqlTypeTinyInt","sqlTypeVarbinary","sqlTypeVarchar"],k=["upperLeft","lowerLeft"];function m(t){return t>=b.length?null:b[t]}function R(t){return t>=h.length?null:h[t]}function T(t){return t>=k.length?null:k[t]}function q(t,e){return e>=t.geometryTypes.length?null:t.geometryTypes[e]}function x(t,e,a){const s=t.asUnsafe(),r=e.createPointGeometry(a);for(;s.next();)switch(s.tag()){case 3:{const o=s.getUInt32(),i=s.pos()+o;let c=0;for(;s.pos()a+n,0)*this._vertexDimension,this._coordinatePtr=0}addCoordinate(e,a){e.coords[this._coordinatePtr++]=a}addCoordinatePoint(e,a){e.coords.push(a)}addLength(e,a){e.lengths.push(a)}addQueryGeometry(e,a){e.queryGeometry=a.queryGeometry,e.queryGeometryType=a.queryGeometryType}createPointGeometry(){return new y}};const b=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeBigInteger","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"],h=["sqlTypeBigInt","sqlTypeBinary","sqlTypeBit","sqlTypeChar","sqlTypeDate","sqlTypeDecimal","sqlTypeDouble","sqlTypeFloat","sqlTypeGeometry","sqlTypeGUID","sqlTypeInteger","sqlTypeLongNVarchar","sqlTypeLongVarbinary","sqlTypeLongVarchar","sqlTypeNChar","sqlTypeNVarchar","sqlTypeOther","sqlTypeReal","sqlTypeSmallInt","sqlTypeSqlXml","sqlTypeTime","sqlTypeTimestamp","sqlTypeTimestamp2","sqlTypeTinyInt","sqlTypeVarbinary","sqlTypeVarchar"],k=["upperLeft","lowerLeft"];function m(t){return t>=b.length?null:b[t]}function R(t){return t>=h.length?null:h[t]}function T(t){return t>=k.length?null:k[t]}function q(t,e){return e>=t.geometryTypes.length?null:t.geometryTypes[e]}function x(t,e,a){const s=t.asUnsafe(),r=e.createPointGeometry(a);for(;s.next();)switch(s.tag()){case 3:{const o=s.getUInt32(),i=s.pos()+o;let c=0;for(;s.pos(){Ee=e,ce=_});var se,Q,ee,be=Object.assign({},t),me="./this.program",Te=typeof window=="object",B=typeof importScripts=="function",Oe=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",Y="";function fr(e){return t.locateFile?t.locateFile(e,Y):Y+e}if(Oe){var Se=require("fs"),Pe=require("path");Y=B?Pe.dirname(Y)+"/":__dirname+"/",se=(e,_)=>(e=pe(e)?new URL(e):Pe.normalize(e),Se.readFileSync(e,_?void 0:"utf8")),ee=e=>{var _=se(e,!0);return _.buffer||(_=new Uint8Array(_)),_},Q=(e,_,r,p=!0)=>{e=pe(e)?new URL(e):Pe.normalize(e),Se.readFile(e,p?void 0:"utf8",(i,c)=>{i?r(i):_(p?c.buffer:c)})},!t.thisProgram&&process.argv.length>1&&(me=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),t.inspect=()=>"[Emscripten Module object]"}else(Te||B)&&(B?Y=self.location.href:typeof document<"u"&&document.currentScript&&(Y=document.currentScript.src),J&&(Y=J),Y=Y.indexOf("blob:")!==0?Y.substr(0,Y.replace(/[?#].*/,"").lastIndexOf("/")+1):"",se=e=>{var _=new XMLHttpRequest;return _.open("GET",e,!1),_.send(null),_.responseText},B&&(ee=e=>{var _=new XMLHttpRequest;return _.open("GET",e,!1),_.responseType="arraybuffer",_.send(null),new Uint8Array(_.response)}),Q=(e,_,r)=>{var p=new XMLHttpRequest;p.open("GET",e,!0),p.responseType="arraybuffer",p.onload=()=>{p.status==200||p.status==0&&p.response?_(p.response):r()},p.onerror=r,p.send(null)});var ae,te,Er=console.log.bind(console),K=console.error.bind(console);Object.assign(t,be),be=null,typeof WebAssembly!="object"&&W("no native wasm support detected");var X,Z,_e,D,j,re,oe,Ne=!1;function ge(e,_){e||W(_)}function he(){var e=te.buffer;t.HEAP8=X=new Int8Array(e),t.HEAP16=_e=new Int16Array(e),t.HEAPU8=Z=new Uint8Array(e),t.HEAPU16=new Uint16Array(e),t.HEAP32=D=new Int32Array(e),t.HEAPU32=j=new Uint32Array(e),t.HEAPF32=re=new Float32Array(e),t.HEAPF64=oe=new Float64Array(e)}var br=[],le=[],mr=[];function Tr(){ye(br)}function Or(){ye(le)}function Sr(){ye(mr)}function Nr(e){le.unshift(e)}var ne=0,V=null;function hr(e){ne++}function lr(e){if(--ne==0&&V){var _=V;V=null,_()}}function W(e){K(e="Aborted("+e+")"),Ne=!0,e+=". Build with -sASSERTIONS for more info.";var _=new WebAssembly.RuntimeError(e);throw ce(_),_}var q,Mr="data:application/octet-stream;base64,";function Me(e){return e.startsWith(Mr)}function pe(e){return e.startsWith("file://")}function ve(e){if(e==q&&ae)return new Uint8Array(ae);if(ee)return ee(e);throw"both async and sync fetching of the wasm failed"}function vr(e){if(Te||B){if(typeof fetch=="function"&&!pe(e))return fetch(e,{credentials:"same-origin"}).then(_=>{if(!_.ok)throw"failed to load wasm binary file at '"+e+"'";return _.arrayBuffer()}).catch(()=>ve(e));if(Q)return new Promise((_,r)=>{Q(e,p=>_(new Uint8Array(p)),r)})}return Promise.resolve().then(()=>ve(e))}function De(e,_,r){return vr(e).then(p=>WebAssembly.instantiate(p,_)).then(p=>p).then(r,p=>{K(`failed to asynchronously prepare wasm: ${p}`),W(p)})}function Dr(e,_,r,p){return e||typeof WebAssembly.instantiateStreaming!="function"||Me(_)||pe(_)||Oe||typeof fetch!="function"?De(_,r,p):fetch(_,{credentials:"same-origin"}).then(i=>WebAssembly.instantiateStreaming(i,r).then(p,function(c){return K(`wasm streaming compile failed: ${c}`),K("falling back to ArrayBuffer instantiation"),De(_,r,p)}))}function Rr(){var e={a:qr};function _(p,i){return o=p.exports,te=o.t,he(),Nr(o.u),lr(),o}function r(p){_(p.instance)}return hr(),Dr(ae,q,e,r).catch(ce),{}}Me(q="pe-wasm.wasm")||(q=fr(q));var ye=e=>{for(;e.length>0;)e.shift()(t)};function Ar(e,_="i8"){switch(_.endsWith("*")&&(_="*"),_){case"i1":case"i8":return X[e>>0];case"i16":return _e[e>>1];case"i32":return D[e>>2];case"i64":W("to do getValue(i64) use WASM_BIGINT");case"float":return re[e>>2];case"double":return oe[e>>3];case"*":return j[e>>2];default:W(`invalid type for getValue: ${_}`)}}var Re=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,Ae=(e,_,r)=>{for(var p=_+r,i=_;e[i]&&!(i>=p);)++i;if(i-_>16&&e.buffer&&Re)return Re.decode(e.subarray(_,i));for(var c="";_>10,56320|1023&z)}}else c+=String.fromCharCode((31&g)<<6|a)}else c+=String.fromCharCode(g)}return c},L=(e,_)=>e?Ae(Z,e,_):"";function Gr(e,_,r){return 0}var Ge=(e,_,r,p)=>{if(!(p>0))return 0;for(var i=r,c=r+p-1,g=0;g=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++g)),a<=127){if(r>=c)break;_[r++]=a}else if(a<=2047){if(r+1>=c)break;_[r++]=192|a>>6,_[r++]=128|63&a}else if(a<=65535){if(r+2>=c)break;_[r++]=224|a>>12,_[r++]=128|a>>6&63,_[r++]=128|63&a}else{if(r+3>=c)break;_[r++]=240|a>>18,_[r++]=128|a>>12&63,_[r++]=128|a>>6&63,_[r++]=128|63&a}}return _[r]=0,r-i},Cr=(e,_,r)=>Ge(e,Z,_,r);function Ir(e,_,r){return 0}function jr(e,_,r,p){}var Ur=e=>e%4==0&&(e%100!=0||e%400==0),Lr=[0,31,60,91,121,152,182,213,244,274,305,335],Fr=[0,31,59,90,120,151,181,212,243,273,304,334],Yr=e=>(Ur(e.getFullYear())?Lr:Fr)[e.getMonth()]+e.getDate()-1,wr=(e,_)=>_+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*_:NaN;function xr(e,_,r){var p=wr(e,_),i=new Date(1e3*p);D[r>>2]=i.getSeconds(),D[r+4>>2]=i.getMinutes(),D[r+8>>2]=i.getHours(),D[r+12>>2]=i.getDate(),D[r+16>>2]=i.getMonth(),D[r+20>>2]=i.getFullYear()-1900,D[r+24>>2]=i.getDay();var c=0|Yr(i);D[r+28>>2]=c,D[r+36>>2]=-60*i.getTimezoneOffset();var g=new Date(i.getFullYear(),0,1),a=new Date(i.getFullYear(),6,1).getTimezoneOffset(),C=g.getTimezoneOffset(),z=0|(a!=C&&i.getTimezoneOffset()==Math.min(C,a));D[r+32>>2]=z}var Ce=e=>{for(var _=0,r=0;r=55296&&p<=57343?(_+=4,++r):_+=3}return _},Ie=e=>{var _=Ce(e)+1,r=je(_);return r&&Cr(e,r,_),r},Hr=()=>2147483648,Xr=e=>{var _=(e-te.buffer.byteLength+65535)/65536;try{return te.grow(_),he(),1}catch{}},ue={},zr=()=>me||"./this.program",k=()=>{if(!k.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:zr()};for(var _ in ue)ue[_]===void 0?delete e[_]:e[_]=ue[_];var r=[];for(var _ in e)r.push(`${_}=${e[_]}`);k.strings=r}return k.strings},Zr=(e,_)=>{for(var r=0;r>0]=e.charCodeAt(r);X[_>>0]=0};function Wr(e,_,r,p,i){return 70}var Br=[null,[],[]],Kr=(e,_)=>{var r=Br[e];_===0||_===10?((e===1?Er:K)(Ae(r,0)),r.length=0):r.push(_)};function Vr(e,_,r){var p=r>0?r:Ce(e)+1,i=new Array(p),c=Ge(e,i,0,i.length);return _&&(i.length=c),i}var qr={c:Gr,r:(e,_,r)=>{},h:Ir,d:jr,p:e=>{},o:(e,_)=>{},q:(e,_,r)=>{},j:xr,n:(e,_,r)=>{var p=new Date().getFullYear(),i=new Date(p,0,1),c=new Date(p,6,1),g=i.getTimezoneOffset(),a=c.getTimezoneOffset(),C=Math.max(g,a);function z(io){var gr=io.toTimeString().match(/\(([A-Za-z ]+)\)$/);return gr?gr[1]:"GMT"}j[e>>2]=60*C,D[_>>2]=+(g!=a);var no=z(i),po=z(c),Pr=Ie(no),ar=Ie(po);a>2]=Pr,j[r+4>>2]=ar):(j[r>>2]=ar,j[r+4>>2]=Pr)},l:()=>{W("")},i:()=>Date.now(),s:(e,_,r)=>Z.copyWithin(e,_,_+r),m:e=>{var _=Z.length;e>>>=0;var r=Hr();if(e>r)return!1;for(var p=(a,C)=>a+(C-a%C)%C,i=1;i<=4;i*=2){var c=_*(1+.2/i);c=Math.min(c,e+100663296);var g=Math.min(r,p(Math.max(e,c),65536));if(Xr(g))return!0}return!1},e:(e,_)=>{var r=0;return k().forEach((p,i)=>{var c=_+r;j[e+4*i>>2]=c,Zr(p,c),r+=p.length+1}),0},f:(e,_)=>{var r=k();j[e>>2]=r.length;var p=0;return r.forEach(i=>p+=i.length+1),j[_>>2]=p,0},a:e=>52,g:(e,_,r,p)=>52,k:Wr,b:(e,_,r,p)=>{for(var i=0,c=0;c>2],a=j[_+4>>2];_+=8;for(var C=0;C>2]=i,0}},o=Rr();t._webidl_free=e=>(t._webidl_free=o.v)(e),t._webidl_malloc=e=>(t._webidl_malloc=o.w)(e);var ie,je=e=>(je=o.x)(e),Ue=t._emscripten_bind_PeObject_getCode_0=e=>(Ue=t._emscripten_bind_PeObject_getCode_0=o.y)(e),Le=t._emscripten_bind_PeObject_getName_1=(e,_)=>(Le=t._emscripten_bind_PeObject_getName_1=o.z)(e,_),Fe=t._emscripten_bind_PeObject_getType_0=e=>(Fe=t._emscripten_bind_PeObject_getType_0=o.A)(e),Ye=t._emscripten_bind_PeCoordsys_getCode_0=e=>(Ye=t._emscripten_bind_PeCoordsys_getCode_0=o.B)(e),we=t._emscripten_bind_PeCoordsys_getName_1=(e,_)=>(we=t._emscripten_bind_PeCoordsys_getName_1=o.C)(e,_),xe=t._emscripten_bind_PeCoordsys_getType_0=e=>(xe=t._emscripten_bind_PeCoordsys_getType_0=o.D)(e),He=t._emscripten_bind_VoidPtr___destroy___0=e=>(He=t._emscripten_bind_VoidPtr___destroy___0=o.E)(e),Xe=t._emscripten_bind_PeDatum_getSpheroid_0=e=>(Xe=t._emscripten_bind_PeDatum_getSpheroid_0=o.F)(e),ze=t._emscripten_bind_PeDatum_getCode_0=e=>(ze=t._emscripten_bind_PeDatum_getCode_0=o.G)(e),Ze=t._emscripten_bind_PeDatum_getName_1=(e,_)=>(Ze=t._emscripten_bind_PeDatum_getName_1=o.H)(e,_),We=t._emscripten_bind_PeDatum_getType_0=e=>(We=t._emscripten_bind_PeDatum_getType_0=o.I)(e),Be=t._emscripten_bind_PeDefs_get_PE_BUFFER_MAX_0=e=>(Be=t._emscripten_bind_PeDefs_get_PE_BUFFER_MAX_0=o.J)(e),Ke=t._emscripten_bind_PeDefs_get_PE_NAME_MAX_0=e=>(Ke=t._emscripten_bind_PeDefs_get_PE_NAME_MAX_0=o.K)(e),Ve=t._emscripten_bind_PeDefs_get_PE_MGRS_MAX_0=e=>(Ve=t._emscripten_bind_PeDefs_get_PE_MGRS_MAX_0=o.L)(e),qe=t._emscripten_bind_PeDefs_get_PE_USNG_MAX_0=e=>(qe=t._emscripten_bind_PeDefs_get_PE_USNG_MAX_0=o.M)(e),ke=t._emscripten_bind_PeDefs_get_PE_DD_MAX_0=e=>(ke=t._emscripten_bind_PeDefs_get_PE_DD_MAX_0=o.N)(e),$e=t._emscripten_bind_PeDefs_get_PE_DMS_MAX_0=e=>($e=t._emscripten_bind_PeDefs_get_PE_DMS_MAX_0=o.O)(e),Je=t._emscripten_bind_PeDefs_get_PE_DDM_MAX_0=e=>(Je=t._emscripten_bind_PeDefs_get_PE_DDM_MAX_0=o.P)(e),Qe=t._emscripten_bind_PeDefs_get_PE_UTM_MAX_0=e=>(Qe=t._emscripten_bind_PeDefs_get_PE_UTM_MAX_0=o.Q)(e),et=t._emscripten_bind_PeDefs_get_PE_PARM_MAX_0=e=>(et=t._emscripten_bind_PeDefs_get_PE_PARM_MAX_0=o.R)(e),tt=t._emscripten_bind_PeDefs_get_PE_TYPE_NONE_0=e=>(tt=t._emscripten_bind_PeDefs_get_PE_TYPE_NONE_0=o.S)(e),_t=t._emscripten_bind_PeDefs_get_PE_TYPE_GEOGCS_0=e=>(_t=t._emscripten_bind_PeDefs_get_PE_TYPE_GEOGCS_0=o.T)(e),rt=t._emscripten_bind_PeDefs_get_PE_TYPE_PROJCS_0=e=>(rt=t._emscripten_bind_PeDefs_get_PE_TYPE_PROJCS_0=o.U)(e),ot=t._emscripten_bind_PeDefs_get_PE_TYPE_GEOGTRAN_0=e=>(ot=t._emscripten_bind_PeDefs_get_PE_TYPE_GEOGTRAN_0=o.V)(e),nt=t._emscripten_bind_PeDefs_get_PE_TYPE_COORDSYS_0=e=>(nt=t._emscripten_bind_PeDefs_get_PE_TYPE_COORDSYS_0=o.W)(e),pt=t._emscripten_bind_PeDefs_get_PE_TYPE_UNIT_0=e=>(pt=t._emscripten_bind_PeDefs_get_PE_TYPE_UNIT_0=o.X)(e),it=t._emscripten_bind_PeDefs_get_PE_TYPE_LINUNIT_0=e=>(it=t._emscripten_bind_PeDefs_get_PE_TYPE_LINUNIT_0=o.Y)(e),ct=t._emscripten_bind_PeDefs_get_PE_STR_OPTS_NONE_0=e=>(ct=t._emscripten_bind_PeDefs_get_PE_STR_OPTS_NONE_0=o.Z)(e),st=t._emscripten_bind_PeDefs_get_PE_STR_AUTH_NONE_0=e=>(st=t._emscripten_bind_PeDefs_get_PE_STR_AUTH_NONE_0=o._)(e),Pt=t._emscripten_bind_PeDefs_get_PE_STR_AUTH_TOP_0=e=>(Pt=t._emscripten_bind_PeDefs_get_PE_STR_AUTH_TOP_0=o.$)(e),at=t._emscripten_bind_PeDefs_get_PE_STR_NAME_CANON_0=e=>(at=t._emscripten_bind_PeDefs_get_PE_STR_NAME_CANON_0=o.aa)(e),gt=t._emscripten_bind_PeDefs_get_PE_STR_FMT_WKT_0=e=>(gt=t._emscripten_bind_PeDefs_get_PE_STR_FMT_WKT_0=o.ba)(e),yt=t._emscripten_bind_PeDefs_get_PE_STR_FMT_WKT2_0=e=>(yt=t._emscripten_bind_PeDefs_get_PE_STR_FMT_WKT2_0=o.ca)(e),ut=t._emscripten_bind_PeDefs_get_PE_PARM_X0_0=e=>(ut=t._emscripten_bind_PeDefs_get_PE_PARM_X0_0=o.da)(e),dt=t._emscripten_bind_PeDefs_get_PE_PARM_ND_0=e=>(dt=t._emscripten_bind_PeDefs_get_PE_PARM_ND_0=o.ea)(e),ft=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_1_TO_2_0=e=>(ft=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_1_TO_2_0=o.fa)(e),Et=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_2_TO_1_0=e=>(Et=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_2_TO_1_0=o.ga)(e),bt=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_P_TO_G_0=e=>(bt=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_P_TO_G_0=o.ha)(e),mt=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_G_TO_P_0=e=>(mt=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_G_TO_P_0=o.ia)(e),Tt=t._emscripten_bind_PeDefs_get_PE_HORIZON_RECT_0=e=>(Tt=t._emscripten_bind_PeDefs_get_PE_HORIZON_RECT_0=o.ja)(e),Ot=t._emscripten_bind_PeDefs_get_PE_HORIZON_POLY_0=e=>(Ot=t._emscripten_bind_PeDefs_get_PE_HORIZON_POLY_0=o.ka)(e),St=t._emscripten_bind_PeDefs_get_PE_HORIZON_LINE_0=e=>(St=t._emscripten_bind_PeDefs_get_PE_HORIZON_LINE_0=o.la)(e),Nt=t._emscripten_bind_PeDefs_get_PE_HORIZON_DELTA_0=e=>(Nt=t._emscripten_bind_PeDefs_get_PE_HORIZON_DELTA_0=o.ma)(e),ht=t._emscripten_bind_PeFactory_initialize_1=(e,_)=>(ht=t._emscripten_bind_PeFactory_initialize_1=o.na)(e,_),lt=t._emscripten_bind_PeFactory_factoryByType_2=(e,_,r)=>(lt=t._emscripten_bind_PeFactory_factoryByType_2=o.oa)(e,_,r),Mt=t._emscripten_bind_PeFactory_fromString_2=(e,_,r)=>(Mt=t._emscripten_bind_PeFactory_fromString_2=o.pa)(e,_,r),vt=t._emscripten_bind_PeFactory_getCode_1=(e,_)=>(vt=t._emscripten_bind_PeFactory_getCode_1=o.qa)(e,_),Dt=t._emscripten_bind_PeGCSExtent_PeGCSExtent_6=(e,_,r,p,i,c)=>(Dt=t._emscripten_bind_PeGCSExtent_PeGCSExtent_6=o.ra)(e,_,r,p,i,c),Rt=t._emscripten_bind_PeGCSExtent_getLLon_0=e=>(Rt=t._emscripten_bind_PeGCSExtent_getLLon_0=o.sa)(e),At=t._emscripten_bind_PeGCSExtent_getSLat_0=e=>(At=t._emscripten_bind_PeGCSExtent_getSLat_0=o.ta)(e),Gt=t._emscripten_bind_PeGCSExtent_getRLon_0=e=>(Gt=t._emscripten_bind_PeGCSExtent_getRLon_0=o.ua)(e),Ct=t._emscripten_bind_PeGCSExtent_getNLat_0=e=>(Ct=t._emscripten_bind_PeGCSExtent_getNLat_0=o.va)(e),It=t._emscripten_bind_PeGCSExtent___destroy___0=e=>(It=t._emscripten_bind_PeGCSExtent___destroy___0=o.wa)(e),jt=t._emscripten_bind_PeGeogcs_getDatum_0=e=>(jt=t._emscripten_bind_PeGeogcs_getDatum_0=o.xa)(e),Ut=t._emscripten_bind_PeGeogcs_getPrimem_0=e=>(Ut=t._emscripten_bind_PeGeogcs_getPrimem_0=o.ya)(e),Lt=t._emscripten_bind_PeGeogcs_getUnit_0=e=>(Lt=t._emscripten_bind_PeGeogcs_getUnit_0=o.za)(e),Ft=t._emscripten_bind_PeGeogcs_getCode_0=e=>(Ft=t._emscripten_bind_PeGeogcs_getCode_0=o.Aa)(e),Yt=t._emscripten_bind_PeGeogcs_getName_1=(e,_)=>(Yt=t._emscripten_bind_PeGeogcs_getName_1=o.Ba)(e,_),wt=t._emscripten_bind_PeGeogcs_getType_0=e=>(wt=t._emscripten_bind_PeGeogcs_getType_0=o.Ca)(e),xt=t._emscripten_bind_PeGeogtran_isEqual_1=(e,_)=>(xt=t._emscripten_bind_PeGeogtran_isEqual_1=o.Da)(e,_),Ht=t._emscripten_bind_PeGeogtran_getGeogcs1_0=e=>(Ht=t._emscripten_bind_PeGeogtran_getGeogcs1_0=o.Ea)(e),Xt=t._emscripten_bind_PeGeogtran_getGeogcs2_0=e=>(Xt=t._emscripten_bind_PeGeogtran_getGeogcs2_0=o.Fa)(e),zt=t._emscripten_bind_PeGeogtran_getParameters_0=e=>(zt=t._emscripten_bind_PeGeogtran_getParameters_0=o.Ga)(e),Zt=t._emscripten_bind_PeGeogtran_loadConstants_0=e=>(Zt=t._emscripten_bind_PeGeogtran_loadConstants_0=o.Ha)(e),Wt=t._emscripten_bind_PeGeogtran_getCode_0=e=>(Wt=t._emscripten_bind_PeGeogtran_getCode_0=o.Ia)(e),Bt=t._emscripten_bind_PeGeogtran_getName_1=(e,_)=>(Bt=t._emscripten_bind_PeGeogtran_getName_1=o.Ja)(e,_),Kt=t._emscripten_bind_PeGeogtran_getType_0=e=>(Kt=t._emscripten_bind_PeGeogtran_getType_0=o.Ka)(e),Vt=t._emscripten_bind_PeGTlistExtended_getGTlist_6=(e,_,r,p,i,c,g)=>(Vt=t._emscripten_bind_PeGTlistExtended_getGTlist_6=o.La)(e,_,r,p,i,c,g),qt=t._emscripten_bind_PeGTlistExtended_get_PE_GTLIST_OPTS_COMMON_0=e=>(qt=t._emscripten_bind_PeGTlistExtended_get_PE_GTLIST_OPTS_COMMON_0=o.Ma)(e),kt=t._emscripten_bind_PeGTlistExtendedEntry_getEntries_0=e=>(kt=t._emscripten_bind_PeGTlistExtendedEntry_getEntries_0=o.Na)(e),$t=t._emscripten_bind_PeGTlistExtendedEntry_getSteps_0=e=>($t=t._emscripten_bind_PeGTlistExtendedEntry_getSteps_0=o.Oa)(e),Jt=t._emscripten_bind_PeGTlistExtendedEntry_Delete_1=(e,_)=>(Jt=t._emscripten_bind_PeGTlistExtendedEntry_Delete_1=o.Pa)(e,_),Qt=t._emscripten_bind_PeGTlistExtendedGTs_getDirection_0=e=>(Qt=t._emscripten_bind_PeGTlistExtendedGTs_getDirection_0=o.Qa)(e),e_=t._emscripten_bind_PeGTlistExtendedGTs_getGeogtran_0=e=>(e_=t._emscripten_bind_PeGTlistExtendedGTs_getGeogtran_0=o.Ra)(e),t_=t._emscripten_bind_PeHorizon_getNump_0=e=>(t_=t._emscripten_bind_PeHorizon_getNump_0=o.Sa)(e),__=t._emscripten_bind_PeHorizon_getKind_0=e=>(__=t._emscripten_bind_PeHorizon_getKind_0=o.Ta)(e),r_=t._emscripten_bind_PeHorizon_getInclusive_0=e=>(r_=t._emscripten_bind_PeHorizon_getInclusive_0=o.Ua)(e),o_=t._emscripten_bind_PeHorizon_getSize_0=e=>(o_=t._emscripten_bind_PeHorizon_getSize_0=o.Va)(e),n_=t._emscripten_bind_PeHorizon_getCoord_0=e=>(n_=t._emscripten_bind_PeHorizon_getCoord_0=o.Wa)(e),p_=t._emscripten_bind_PeInteger_PeInteger_1=e=>(p_=t._emscripten_bind_PeInteger_PeInteger_1=o.Xa)(e),i_=t._emscripten_bind_PeInteger_get_val_0=e=>(i_=t._emscripten_bind_PeInteger_get_val_0=o.Ya)(e),c_=t._emscripten_bind_PeInteger_set_val_1=(e,_)=>(c_=t._emscripten_bind_PeInteger_set_val_1=o.Za)(e,_),s_=t._emscripten_bind_PeInteger___destroy___0=e=>(s_=t._emscripten_bind_PeInteger___destroy___0=o._a)(e),P_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_NEW_0=e=>(P_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_NEW_0=o.$a)(e),a_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_OLD_0=e=>(a_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_OLD_0=o.ab)(e),g_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_AUTO_0=e=>(g_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_AUTO_0=o.bb)(e),y_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_180_ZONE_1_PLUS_0=e=>(y_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_180_ZONE_1_PLUS_0=o.cb)(e),u_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_ADD_SPACES_0=e=>(u_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_ADD_SPACES_0=o.db)(e),d_=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NONE_0=e=>(d_=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NONE_0=o.eb)(e),f_=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_0=e=>(f_=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_0=o.fb)(e),E_=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_STRICT_0=e=>(E_=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_STRICT_0=o.gb)(e),b_=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_ADD_SPACES_0=e=>(b_=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_ADD_SPACES_0=o.hb)(e),m_=t._emscripten_bind_PeParameter_getValue_0=e=>(m_=t._emscripten_bind_PeParameter_getValue_0=o.ib)(e),T_=t._emscripten_bind_PeParameter_getCode_0=e=>(T_=t._emscripten_bind_PeParameter_getCode_0=o.jb)(e),O_=t._emscripten_bind_PeParameter_getName_1=(e,_)=>(O_=t._emscripten_bind_PeParameter_getName_1=o.kb)(e,_),S_=t._emscripten_bind_PeParameter_getType_0=e=>(S_=t._emscripten_bind_PeParameter_getType_0=o.lb)(e),N_=t._emscripten_bind_PePCSInfo_getCentralMeridian_0=e=>(N_=t._emscripten_bind_PePCSInfo_getCentralMeridian_0=o.mb)(e),h_=t._emscripten_bind_PePCSInfo_getDomainMinx_0=e=>(h_=t._emscripten_bind_PePCSInfo_getDomainMinx_0=o.nb)(e),l_=t._emscripten_bind_PePCSInfo_getDomainMiny_0=e=>(l_=t._emscripten_bind_PePCSInfo_getDomainMiny_0=o.ob)(e),M_=t._emscripten_bind_PePCSInfo_getDomainMaxx_0=e=>(M_=t._emscripten_bind_PePCSInfo_getDomainMaxx_0=o.pb)(e),v_=t._emscripten_bind_PePCSInfo_getDomainMaxy_0=e=>(v_=t._emscripten_bind_PePCSInfo_getDomainMaxy_0=o.qb)(e),D_=t._emscripten_bind_PePCSInfo_getNorthPoleLocation_0=e=>(D_=t._emscripten_bind_PePCSInfo_getNorthPoleLocation_0=o.rb)(e),R_=t._emscripten_bind_PePCSInfo_getNorthPoleGeometry_0=e=>(R_=t._emscripten_bind_PePCSInfo_getNorthPoleGeometry_0=o.sb)(e),A_=t._emscripten_bind_PePCSInfo_getSouthPoleLocation_0=e=>(A_=t._emscripten_bind_PePCSInfo_getSouthPoleLocation_0=o.tb)(e),G_=t._emscripten_bind_PePCSInfo_getSouthPoleGeometry_0=e=>(G_=t._emscripten_bind_PePCSInfo_getSouthPoleGeometry_0=o.ub)(e),C_=t._emscripten_bind_PePCSInfo_isDensificationNeeded_0=e=>(C_=t._emscripten_bind_PePCSInfo_isDensificationNeeded_0=o.vb)(e),I_=t._emscripten_bind_PePCSInfo_isGcsHorizonMultiOverlap_0=e=>(I_=t._emscripten_bind_PePCSInfo_isGcsHorizonMultiOverlap_0=o.wb)(e),j_=t._emscripten_bind_PePCSInfo_isPannableRectangle_0=e=>(j_=t._emscripten_bind_PePCSInfo_isPannableRectangle_0=o.xb)(e),U_=t._emscripten_bind_PePCSInfo_generate_2=(e,_,r)=>(U_=t._emscripten_bind_PePCSInfo_generate_2=o.yb)(e,_,r),L_=t._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_NONE_0=e=>(L_=t._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_NONE_0=o.zb)(e),F_=t._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_DOMAIN_0=e=>(F_=t._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_DOMAIN_0=o.Ab)(e),Y_=t._emscripten_bind_PePCSInfo_get_PE_POLE_OUTSIDE_BOUNDARY_0=e=>(Y_=t._emscripten_bind_PePCSInfo_get_PE_POLE_OUTSIDE_BOUNDARY_0=o.Bb)(e),w_=t._emscripten_bind_PePCSInfo_get_PE_POLE_POINT_0=e=>(w_=t._emscripten_bind_PePCSInfo_get_PE_POLE_POINT_0=o.Cb)(e),x_=t._emscripten_bind_PePrimem_getLongitude_0=e=>(x_=t._emscripten_bind_PePrimem_getLongitude_0=o.Db)(e),H_=t._emscripten_bind_PePrimem_getCode_0=e=>(H_=t._emscripten_bind_PePrimem_getCode_0=o.Eb)(e),X_=t._emscripten_bind_PePrimem_getName_1=(e,_)=>(X_=t._emscripten_bind_PePrimem_getName_1=o.Fb)(e,_),z_=t._emscripten_bind_PePrimem_getType_0=e=>(z_=t._emscripten_bind_PePrimem_getType_0=o.Gb)(e),Z_=t._emscripten_bind_PeProjcs_getGeogcs_0=e=>(Z_=t._emscripten_bind_PeProjcs_getGeogcs_0=o.Hb)(e),W_=t._emscripten_bind_PeProjcs_getParameters_0=e=>(W_=t._emscripten_bind_PeProjcs_getParameters_0=o.Ib)(e),B_=t._emscripten_bind_PeProjcs_getUnit_0=e=>(B_=t._emscripten_bind_PeProjcs_getUnit_0=o.Jb)(e),K_=t._emscripten_bind_PeProjcs_loadConstants_0=e=>(K_=t._emscripten_bind_PeProjcs_loadConstants_0=o.Kb)(e),V_=t._emscripten_bind_PeProjcs_horizonGcsGenerate_0=e=>(V_=t._emscripten_bind_PeProjcs_horizonGcsGenerate_0=o.Lb)(e),q_=t._emscripten_bind_PeProjcs_horizonPcsGenerate_0=e=>(q_=t._emscripten_bind_PeProjcs_horizonPcsGenerate_0=o.Mb)(e),k_=t._emscripten_bind_PeProjcs_getCode_0=e=>(k_=t._emscripten_bind_PeProjcs_getCode_0=o.Nb)(e),$_=t._emscripten_bind_PeProjcs_getName_1=(e,_)=>($_=t._emscripten_bind_PeProjcs_getName_1=o.Ob)(e,_),J_=t._emscripten_bind_PeProjcs_getType_0=e=>(J_=t._emscripten_bind_PeProjcs_getType_0=o.Pb)(e),Q_=t._emscripten_bind_PeSpheroid_getAxis_0=e=>(Q_=t._emscripten_bind_PeSpheroid_getAxis_0=o.Qb)(e),er=t._emscripten_bind_PeSpheroid_getFlattening_0=e=>(er=t._emscripten_bind_PeSpheroid_getFlattening_0=o.Rb)(e),tr=t._emscripten_bind_PeSpheroid_getCode_0=e=>(tr=t._emscripten_bind_PeSpheroid_getCode_0=o.Sb)(e),_r=t._emscripten_bind_PeSpheroid_getName_1=(e,_)=>(_r=t._emscripten_bind_PeSpheroid_getName_1=o.Tb)(e,_),rr=t._emscripten_bind_PeSpheroid_getType_0=e=>(rr=t._emscripten_bind_PeSpheroid_getType_0=o.Ub)(e),or=t._emscripten_bind_PeUnit_getUnitFactor_0=e=>(or=t._emscripten_bind_PeUnit_getUnitFactor_0=o.Vb)(e),nr=t._emscripten_bind_PeUnit_getCode_0=e=>(nr=t._emscripten_bind_PeUnit_getCode_0=o.Wb)(e),pr=t._emscripten_bind_PeUnit_getName_1=(e,_)=>(pr=t._emscripten_bind_PeUnit_getName_1=o.Xb)(e,_),ir=t._emscripten_bind_PeUnit_getType_0=e=>(ir=t._emscripten_bind_PeUnit_getType_0=o.Yb)(e),cr=t._emscripten_bind_PeVersion_version_string_0=e=>(cr=t._emscripten_bind_PeVersion_version_string_0=o.Zb)(e);function sr(){function e(){ie||(ie=!0,t.calledRun=!0,Ne||(Or(),Ee(t),Sr()))}ne>0||(Tr(),ne>0||e())}function d(){}function $(e){return(e||d).__cache__}function T(e,_){var r=$(_),p=r[e];return p||((p=Object.create((_||d).prototype)).ptr=e,r[e]=p)}function kr(e,_){return T(e.ptr,_)}function $r(e){if(!e.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";e.__destroy__(),delete $(e.__class__)[e.ptr]}function Jr(e,_){return e.ptr===_.ptr}function Qr(e){return e.ptr}function eo(e){return e.__class__}t._pe_getPeGTlistExtendedEntrySize=()=>(t._pe_getPeGTlistExtendedEntrySize=o._b)(),t._pe_getPeGTlistExtendedGTsSize=()=>(t._pe_getPeGTlistExtendedGTsSize=o.$b)(),t._pe_getPeHorizonSize=()=>(t._pe_getPeHorizonSize=o.ac)(),t._pe_geog_to_geog=(e,_,r,p,i)=>(t._pe_geog_to_geog=o.cc)(e,_,r,p,i),t._pe_geog_to_proj=(e,_,r)=>(t._pe_geog_to_proj=o.dc)(e,_,r),t._pe_geog_to_dd=(e,_,r,p,i)=>(t._pe_geog_to_dd=o.ec)(e,_,r,p,i),t._pe_dd_to_geog=(e,_,r,p)=>(t._pe_dd_to_geog=o.fc)(e,_,r,p),t._pe_geog_to_ddm=(e,_,r,p,i)=>(t._pe_geog_to_ddm=o.gc)(e,_,r,p,i),t._pe_ddm_to_geog=(e,_,r,p)=>(t._pe_ddm_to_geog=o.hc)(e,_,r,p),t._pe_geog_to_dms=(e,_,r,p,i)=>(t._pe_geog_to_dms=o.ic)(e,_,r,p,i),t._pe_dms_to_geog=(e,_,r,p)=>(t._pe_dms_to_geog=o.jc)(e,_,r,p),t._pe_geog_to_mgrs_extended=(e,_,r,p,i,c,g)=>(t._pe_geog_to_mgrs_extended=o.kc)(e,_,r,p,i,c,g),t._pe_mgrs_to_geog_extended=(e,_,r,p,i)=>(t._pe_mgrs_to_geog_extended=o.lc)(e,_,r,p,i),t._pe_geog_to_usng=(e,_,r,p,i,c,g)=>(t._pe_geog_to_usng=o.mc)(e,_,r,p,i,c,g),t._pe_usng_to_geog=(e,_,r,p)=>(t._pe_usng_to_geog=o.nc)(e,_,r,p),t._pe_geog_to_utm=(e,_,r,p,i)=>(t._pe_geog_to_utm=o.oc)(e,_,r,p,i),t._pe_utm_to_geog=(e,_,r,p,i)=>(t._pe_utm_to_geog=o.pc)(e,_,r,p,i),t._pe_object_to_string_ext=(e,_,r)=>(t._pe_object_to_string_ext=o.qc)(e,_,r),t._pe_proj_to_geog_center=(e,_,r,p)=>(t._pe_proj_to_geog_center=o.rc)(e,_,r,p),t.___start_em_js=2033306,t.___stop_em_js=2033404,t.getValue=Ar,t.UTF8ToString=L,V=function e(){ie||sr(),ie||(V=e)},sr(),d.prototype=Object.create(d.prototype),d.prototype.constructor=d,d.prototype.__class__=d,d.__cache__={},t.WrapperObject=d,t.getCache=$,t.wrapPointer=T,t.castObject=kr,t.NULL=T(0),t.destroy=$r,t.compare=Jr,t.getPointer=Qr,t.getClass=eo;var P={buffer:0,size:0,pos:0,temps:[],needed:0,prepare(){if(P.needed){for(var e=0;e=P.size?(ge(i>0),P.needed+=i,r=t._webidl_malloc(i),P.temps.push(r)):(r=P.buffer+P.pos,P.pos+=i),r},copy(e,_,r){switch(r>>>=0,_.BYTES_PER_ELEMENT){case 2:r>>>=1;break;case 4:r>>>=2;break;case 8:r>>>=3}for(var p=0;p{Ee=e,ce=_});var se,Q,ee,be=Object.assign({},t),me="./this.program",Te=typeof window=="object",B=typeof importScripts=="function",Oe=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",Y="";function fr(e){return t.locateFile?t.locateFile(e,Y):Y+e}if(Oe){var Se=require("fs"),Pe=require("path");Y=B?Pe.dirname(Y)+"/":__dirname+"/",se=(e,_)=>(e=pe(e)?new URL(e):Pe.normalize(e),Se.readFileSync(e,_?void 0:"utf8")),ee=e=>{var _=se(e,!0);return _.buffer||(_=new Uint8Array(_)),_},Q=(e,_,r,p=!0)=>{e=pe(e)?new URL(e):Pe.normalize(e),Se.readFile(e,p?void 0:"utf8",(i,c)=>{i?r(i):_(p?c.buffer:c)})},!t.thisProgram&&process.argv.length>1&&(me=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),t.inspect=()=>"[Emscripten Module object]"}else(Te||B)&&(B?Y=self.location.href:typeof document<"u"&&document.currentScript&&(Y=document.currentScript.src),J&&(Y=J),Y=Y.indexOf("blob:")!==0?Y.substr(0,Y.replace(/[?#].*/,"").lastIndexOf("/")+1):"",se=e=>{var _=new XMLHttpRequest;return _.open("GET",e,!1),_.send(null),_.responseText},B&&(ee=e=>{var _=new XMLHttpRequest;return _.open("GET",e,!1),_.responseType="arraybuffer",_.send(null),new Uint8Array(_.response)}),Q=(e,_,r)=>{var p=new XMLHttpRequest;p.open("GET",e,!0),p.responseType="arraybuffer",p.onload=()=>{p.status==200||p.status==0&&p.response?_(p.response):r()},p.onerror=r,p.send(null)});var ae,te,Er=console.log.bind(console),K=console.error.bind(console);Object.assign(t,be),be=null,typeof WebAssembly!="object"&&W("no native wasm support detected");var X,Z,_e,D,j,re,oe,Ne=!1;function ge(e,_){e||W(_)}function he(){var e=te.buffer;t.HEAP8=X=new Int8Array(e),t.HEAP16=_e=new Int16Array(e),t.HEAPU8=Z=new Uint8Array(e),t.HEAPU16=new Uint16Array(e),t.HEAP32=D=new Int32Array(e),t.HEAPU32=j=new Uint32Array(e),t.HEAPF32=re=new Float32Array(e),t.HEAPF64=oe=new Float64Array(e)}var br=[],le=[],mr=[];function Tr(){ye(br)}function Or(){ye(le)}function Sr(){ye(mr)}function Nr(e){le.unshift(e)}var ne=0,V=null;function hr(e){ne++}function lr(e){if(--ne==0&&V){var _=V;V=null,_()}}function W(e){K(e="Aborted("+e+")"),Ne=!0,e+=". Build with -sASSERTIONS for more info.";var _=new WebAssembly.RuntimeError(e);throw ce(_),_}var q,Mr="data:application/octet-stream;base64,";function Me(e){return e.startsWith(Mr)}function pe(e){return e.startsWith("file://")}function ve(e){if(e==q&&ae)return new Uint8Array(ae);if(ee)return ee(e);throw"both async and sync fetching of the wasm failed"}function vr(e){if(Te||B){if(typeof fetch=="function"&&!pe(e))return fetch(e,{credentials:"same-origin"}).then(_=>{if(!_.ok)throw"failed to load wasm binary file at '"+e+"'";return _.arrayBuffer()}).catch(()=>ve(e));if(Q)return new Promise((_,r)=>{Q(e,p=>_(new Uint8Array(p)),r)})}return Promise.resolve().then(()=>ve(e))}function De(e,_,r){return vr(e).then(p=>WebAssembly.instantiate(p,_)).then(p=>p).then(r,p=>{K(`failed to asynchronously prepare wasm: ${p}`),W(p)})}function Dr(e,_,r,p){return e||typeof WebAssembly.instantiateStreaming!="function"||Me(_)||pe(_)||Oe||typeof fetch!="function"?De(_,r,p):fetch(_,{credentials:"same-origin"}).then(i=>WebAssembly.instantiateStreaming(i,r).then(p,function(c){return K(`wasm streaming compile failed: ${c}`),K("falling back to ArrayBuffer instantiation"),De(_,r,p)}))}function Rr(){var e={a:qr};function _(p,i){return o=p.exports,te=o.t,he(),Nr(o.u),lr(),o}function r(p){_(p.instance)}return hr(),Dr(ae,q,e,r).catch(ce),{}}Me(q="pe-wasm.wasm")||(q=fr(q));var ye=e=>{for(;e.length>0;)e.shift()(t)};function Ar(e,_="i8"){switch(_.endsWith("*")&&(_="*"),_){case"i1":case"i8":return X[e>>0];case"i16":return _e[e>>1];case"i32":return D[e>>2];case"i64":W("to do getValue(i64) use WASM_BIGINT");case"float":return re[e>>2];case"double":return oe[e>>3];case"*":return j[e>>2];default:W(`invalid type for getValue: ${_}`)}}var Re=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,Ae=(e,_,r)=>{for(var p=_+r,i=_;e[i]&&!(i>=p);)++i;if(i-_>16&&e.buffer&&Re)return Re.decode(e.subarray(_,i));for(var c="";_>10,56320|1023&z)}}else c+=String.fromCharCode((31&g)<<6|a)}else c+=String.fromCharCode(g)}return c},L=(e,_)=>e?Ae(Z,e,_):"";function Gr(e,_,r){return 0}var Ge=(e,_,r,p)=>{if(!(p>0))return 0;for(var i=r,c=r+p-1,g=0;g=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++g)),a<=127){if(r>=c)break;_[r++]=a}else if(a<=2047){if(r+1>=c)break;_[r++]=192|a>>6,_[r++]=128|63&a}else if(a<=65535){if(r+2>=c)break;_[r++]=224|a>>12,_[r++]=128|a>>6&63,_[r++]=128|63&a}else{if(r+3>=c)break;_[r++]=240|a>>18,_[r++]=128|a>>12&63,_[r++]=128|a>>6&63,_[r++]=128|63&a}}return _[r]=0,r-i},Cr=(e,_,r)=>Ge(e,Z,_,r);function Ir(e,_,r){return 0}function jr(e,_,r,p){}var Ur=e=>e%4==0&&(e%100!=0||e%400==0),Lr=[0,31,60,91,121,152,182,213,244,274,305,335],Fr=[0,31,59,90,120,151,181,212,243,273,304,334],Yr=e=>(Ur(e.getFullYear())?Lr:Fr)[e.getMonth()]+e.getDate()-1,wr=(e,_)=>_+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*_:NaN;function xr(e,_,r){var p=wr(e,_),i=new Date(1e3*p);D[r>>2]=i.getSeconds(),D[r+4>>2]=i.getMinutes(),D[r+8>>2]=i.getHours(),D[r+12>>2]=i.getDate(),D[r+16>>2]=i.getMonth(),D[r+20>>2]=i.getFullYear()-1900,D[r+24>>2]=i.getDay();var c=0|Yr(i);D[r+28>>2]=c,D[r+36>>2]=-60*i.getTimezoneOffset();var g=new Date(i.getFullYear(),0,1),a=new Date(i.getFullYear(),6,1).getTimezoneOffset(),C=g.getTimezoneOffset(),z=0|(a!=C&&i.getTimezoneOffset()==Math.min(C,a));D[r+32>>2]=z}var Ce=e=>{for(var _=0,r=0;r=55296&&p<=57343?(_+=4,++r):_+=3}return _},Ie=e=>{var _=Ce(e)+1,r=je(_);return r&&Cr(e,r,_),r},Hr=()=>2147483648,Xr=e=>{var _=(e-te.buffer.byteLength+65535)/65536;try{return te.grow(_),he(),1}catch{}},ue={},zr=()=>me||"./this.program",k=()=>{if(!k.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:zr()};for(var _ in ue)ue[_]===void 0?delete e[_]:e[_]=ue[_];var r=[];for(var _ in e)r.push(`${_}=${e[_]}`);k.strings=r}return k.strings},Zr=(e,_)=>{for(var r=0;r>0]=e.charCodeAt(r);X[_>>0]=0};function Wr(e,_,r,p,i){return 70}var Br=[null,[],[]],Kr=(e,_)=>{var r=Br[e];_===0||_===10?((e===1?Er:K)(Ae(r,0)),r.length=0):r.push(_)};function Vr(e,_,r){var p=r>0?r:Ce(e)+1,i=new Array(p),c=Ge(e,i,0,i.length);return _&&(i.length=c),i}var qr={c:Gr,r:(e,_,r)=>{},h:Ir,d:jr,p:e=>{},o:(e,_)=>{},q:(e,_,r)=>{},j:xr,n:(e,_,r)=>{var p=new Date().getFullYear(),i=new Date(p,0,1),c=new Date(p,6,1),g=i.getTimezoneOffset(),a=c.getTimezoneOffset(),C=Math.max(g,a);function z(io){var gr=io.toTimeString().match(/\(([A-Za-z ]+)\)$/);return gr?gr[1]:"GMT"}j[e>>2]=60*C,D[_>>2]=+(g!=a);var no=z(i),po=z(c),Pr=Ie(no),ar=Ie(po);a>2]=Pr,j[r+4>>2]=ar):(j[r>>2]=ar,j[r+4>>2]=Pr)},l:()=>{W("")},i:()=>Date.now(),s:(e,_,r)=>Z.copyWithin(e,_,_+r),m:e=>{var _=Z.length;e>>>=0;var r=Hr();if(e>r)return!1;for(var p=(a,C)=>a+(C-a%C)%C,i=1;i<=4;i*=2){var c=_*(1+.2/i);c=Math.min(c,e+100663296);var g=Math.min(r,p(Math.max(e,c),65536));if(Xr(g))return!0}return!1},e:(e,_)=>{var r=0;return k().forEach((p,i)=>{var c=_+r;j[e+4*i>>2]=c,Zr(p,c),r+=p.length+1}),0},f:(e,_)=>{var r=k();j[e>>2]=r.length;var p=0;return r.forEach(i=>p+=i.length+1),j[_>>2]=p,0},a:e=>52,g:(e,_,r,p)=>52,k:Wr,b:(e,_,r,p)=>{for(var i=0,c=0;c>2],a=j[_+4>>2];_+=8;for(var C=0;C>2]=i,0}},o=Rr();t._webidl_free=e=>(t._webidl_free=o.v)(e),t._webidl_malloc=e=>(t._webidl_malloc=o.w)(e);var ie,je=e=>(je=o.x)(e),Ue=t._emscripten_bind_PeObject_getCode_0=e=>(Ue=t._emscripten_bind_PeObject_getCode_0=o.y)(e),Le=t._emscripten_bind_PeObject_getName_1=(e,_)=>(Le=t._emscripten_bind_PeObject_getName_1=o.z)(e,_),Fe=t._emscripten_bind_PeObject_getType_0=e=>(Fe=t._emscripten_bind_PeObject_getType_0=o.A)(e),Ye=t._emscripten_bind_PeCoordsys_getCode_0=e=>(Ye=t._emscripten_bind_PeCoordsys_getCode_0=o.B)(e),we=t._emscripten_bind_PeCoordsys_getName_1=(e,_)=>(we=t._emscripten_bind_PeCoordsys_getName_1=o.C)(e,_),xe=t._emscripten_bind_PeCoordsys_getType_0=e=>(xe=t._emscripten_bind_PeCoordsys_getType_0=o.D)(e),He=t._emscripten_bind_VoidPtr___destroy___0=e=>(He=t._emscripten_bind_VoidPtr___destroy___0=o.E)(e),Xe=t._emscripten_bind_PeDatum_getSpheroid_0=e=>(Xe=t._emscripten_bind_PeDatum_getSpheroid_0=o.F)(e),ze=t._emscripten_bind_PeDatum_getCode_0=e=>(ze=t._emscripten_bind_PeDatum_getCode_0=o.G)(e),Ze=t._emscripten_bind_PeDatum_getName_1=(e,_)=>(Ze=t._emscripten_bind_PeDatum_getName_1=o.H)(e,_),We=t._emscripten_bind_PeDatum_getType_0=e=>(We=t._emscripten_bind_PeDatum_getType_0=o.I)(e),Be=t._emscripten_bind_PeDefs_get_PE_BUFFER_MAX_0=e=>(Be=t._emscripten_bind_PeDefs_get_PE_BUFFER_MAX_0=o.J)(e),Ke=t._emscripten_bind_PeDefs_get_PE_NAME_MAX_0=e=>(Ke=t._emscripten_bind_PeDefs_get_PE_NAME_MAX_0=o.K)(e),Ve=t._emscripten_bind_PeDefs_get_PE_MGRS_MAX_0=e=>(Ve=t._emscripten_bind_PeDefs_get_PE_MGRS_MAX_0=o.L)(e),qe=t._emscripten_bind_PeDefs_get_PE_USNG_MAX_0=e=>(qe=t._emscripten_bind_PeDefs_get_PE_USNG_MAX_0=o.M)(e),ke=t._emscripten_bind_PeDefs_get_PE_DD_MAX_0=e=>(ke=t._emscripten_bind_PeDefs_get_PE_DD_MAX_0=o.N)(e),$e=t._emscripten_bind_PeDefs_get_PE_DMS_MAX_0=e=>($e=t._emscripten_bind_PeDefs_get_PE_DMS_MAX_0=o.O)(e),Je=t._emscripten_bind_PeDefs_get_PE_DDM_MAX_0=e=>(Je=t._emscripten_bind_PeDefs_get_PE_DDM_MAX_0=o.P)(e),Qe=t._emscripten_bind_PeDefs_get_PE_UTM_MAX_0=e=>(Qe=t._emscripten_bind_PeDefs_get_PE_UTM_MAX_0=o.Q)(e),et=t._emscripten_bind_PeDefs_get_PE_PARM_MAX_0=e=>(et=t._emscripten_bind_PeDefs_get_PE_PARM_MAX_0=o.R)(e),tt=t._emscripten_bind_PeDefs_get_PE_TYPE_NONE_0=e=>(tt=t._emscripten_bind_PeDefs_get_PE_TYPE_NONE_0=o.S)(e),_t=t._emscripten_bind_PeDefs_get_PE_TYPE_GEOGCS_0=e=>(_t=t._emscripten_bind_PeDefs_get_PE_TYPE_GEOGCS_0=o.T)(e),rt=t._emscripten_bind_PeDefs_get_PE_TYPE_PROJCS_0=e=>(rt=t._emscripten_bind_PeDefs_get_PE_TYPE_PROJCS_0=o.U)(e),ot=t._emscripten_bind_PeDefs_get_PE_TYPE_GEOGTRAN_0=e=>(ot=t._emscripten_bind_PeDefs_get_PE_TYPE_GEOGTRAN_0=o.V)(e),nt=t._emscripten_bind_PeDefs_get_PE_TYPE_COORDSYS_0=e=>(nt=t._emscripten_bind_PeDefs_get_PE_TYPE_COORDSYS_0=o.W)(e),pt=t._emscripten_bind_PeDefs_get_PE_TYPE_UNIT_0=e=>(pt=t._emscripten_bind_PeDefs_get_PE_TYPE_UNIT_0=o.X)(e),it=t._emscripten_bind_PeDefs_get_PE_TYPE_LINUNIT_0=e=>(it=t._emscripten_bind_PeDefs_get_PE_TYPE_LINUNIT_0=o.Y)(e),ct=t._emscripten_bind_PeDefs_get_PE_STR_OPTS_NONE_0=e=>(ct=t._emscripten_bind_PeDefs_get_PE_STR_OPTS_NONE_0=o.Z)(e),st=t._emscripten_bind_PeDefs_get_PE_STR_AUTH_NONE_0=e=>(st=t._emscripten_bind_PeDefs_get_PE_STR_AUTH_NONE_0=o._)(e),Pt=t._emscripten_bind_PeDefs_get_PE_STR_AUTH_TOP_0=e=>(Pt=t._emscripten_bind_PeDefs_get_PE_STR_AUTH_TOP_0=o.$)(e),at=t._emscripten_bind_PeDefs_get_PE_STR_NAME_CANON_0=e=>(at=t._emscripten_bind_PeDefs_get_PE_STR_NAME_CANON_0=o.aa)(e),gt=t._emscripten_bind_PeDefs_get_PE_STR_FMT_WKT_0=e=>(gt=t._emscripten_bind_PeDefs_get_PE_STR_FMT_WKT_0=o.ba)(e),yt=t._emscripten_bind_PeDefs_get_PE_STR_FMT_WKT2_0=e=>(yt=t._emscripten_bind_PeDefs_get_PE_STR_FMT_WKT2_0=o.ca)(e),ut=t._emscripten_bind_PeDefs_get_PE_PARM_X0_0=e=>(ut=t._emscripten_bind_PeDefs_get_PE_PARM_X0_0=o.da)(e),dt=t._emscripten_bind_PeDefs_get_PE_PARM_ND_0=e=>(dt=t._emscripten_bind_PeDefs_get_PE_PARM_ND_0=o.ea)(e),ft=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_1_TO_2_0=e=>(ft=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_1_TO_2_0=o.fa)(e),Et=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_2_TO_1_0=e=>(Et=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_2_TO_1_0=o.ga)(e),bt=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_P_TO_G_0=e=>(bt=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_P_TO_G_0=o.ha)(e),mt=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_G_TO_P_0=e=>(mt=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_G_TO_P_0=o.ia)(e),Tt=t._emscripten_bind_PeDefs_get_PE_HORIZON_RECT_0=e=>(Tt=t._emscripten_bind_PeDefs_get_PE_HORIZON_RECT_0=o.ja)(e),Ot=t._emscripten_bind_PeDefs_get_PE_HORIZON_POLY_0=e=>(Ot=t._emscripten_bind_PeDefs_get_PE_HORIZON_POLY_0=o.ka)(e),St=t._emscripten_bind_PeDefs_get_PE_HORIZON_LINE_0=e=>(St=t._emscripten_bind_PeDefs_get_PE_HORIZON_LINE_0=o.la)(e),Nt=t._emscripten_bind_PeDefs_get_PE_HORIZON_DELTA_0=e=>(Nt=t._emscripten_bind_PeDefs_get_PE_HORIZON_DELTA_0=o.ma)(e),ht=t._emscripten_bind_PeFactory_initialize_1=(e,_)=>(ht=t._emscripten_bind_PeFactory_initialize_1=o.na)(e,_),lt=t._emscripten_bind_PeFactory_factoryByType_2=(e,_,r)=>(lt=t._emscripten_bind_PeFactory_factoryByType_2=o.oa)(e,_,r),Mt=t._emscripten_bind_PeFactory_fromString_2=(e,_,r)=>(Mt=t._emscripten_bind_PeFactory_fromString_2=o.pa)(e,_,r),vt=t._emscripten_bind_PeFactory_getCode_1=(e,_)=>(vt=t._emscripten_bind_PeFactory_getCode_1=o.qa)(e,_),Dt=t._emscripten_bind_PeGCSExtent_PeGCSExtent_6=(e,_,r,p,i,c)=>(Dt=t._emscripten_bind_PeGCSExtent_PeGCSExtent_6=o.ra)(e,_,r,p,i,c),Rt=t._emscripten_bind_PeGCSExtent_getLLon_0=e=>(Rt=t._emscripten_bind_PeGCSExtent_getLLon_0=o.sa)(e),At=t._emscripten_bind_PeGCSExtent_getSLat_0=e=>(At=t._emscripten_bind_PeGCSExtent_getSLat_0=o.ta)(e),Gt=t._emscripten_bind_PeGCSExtent_getRLon_0=e=>(Gt=t._emscripten_bind_PeGCSExtent_getRLon_0=o.ua)(e),Ct=t._emscripten_bind_PeGCSExtent_getNLat_0=e=>(Ct=t._emscripten_bind_PeGCSExtent_getNLat_0=o.va)(e),It=t._emscripten_bind_PeGCSExtent___destroy___0=e=>(It=t._emscripten_bind_PeGCSExtent___destroy___0=o.wa)(e),jt=t._emscripten_bind_PeGeogcs_getDatum_0=e=>(jt=t._emscripten_bind_PeGeogcs_getDatum_0=o.xa)(e),Ut=t._emscripten_bind_PeGeogcs_getPrimem_0=e=>(Ut=t._emscripten_bind_PeGeogcs_getPrimem_0=o.ya)(e),Lt=t._emscripten_bind_PeGeogcs_getUnit_0=e=>(Lt=t._emscripten_bind_PeGeogcs_getUnit_0=o.za)(e),Ft=t._emscripten_bind_PeGeogcs_getCode_0=e=>(Ft=t._emscripten_bind_PeGeogcs_getCode_0=o.Aa)(e),Yt=t._emscripten_bind_PeGeogcs_getName_1=(e,_)=>(Yt=t._emscripten_bind_PeGeogcs_getName_1=o.Ba)(e,_),wt=t._emscripten_bind_PeGeogcs_getType_0=e=>(wt=t._emscripten_bind_PeGeogcs_getType_0=o.Ca)(e),xt=t._emscripten_bind_PeGeogtran_isEqual_1=(e,_)=>(xt=t._emscripten_bind_PeGeogtran_isEqual_1=o.Da)(e,_),Ht=t._emscripten_bind_PeGeogtran_getGeogcs1_0=e=>(Ht=t._emscripten_bind_PeGeogtran_getGeogcs1_0=o.Ea)(e),Xt=t._emscripten_bind_PeGeogtran_getGeogcs2_0=e=>(Xt=t._emscripten_bind_PeGeogtran_getGeogcs2_0=o.Fa)(e),zt=t._emscripten_bind_PeGeogtran_getParameters_0=e=>(zt=t._emscripten_bind_PeGeogtran_getParameters_0=o.Ga)(e),Zt=t._emscripten_bind_PeGeogtran_loadConstants_0=e=>(Zt=t._emscripten_bind_PeGeogtran_loadConstants_0=o.Ha)(e),Wt=t._emscripten_bind_PeGeogtran_getCode_0=e=>(Wt=t._emscripten_bind_PeGeogtran_getCode_0=o.Ia)(e),Bt=t._emscripten_bind_PeGeogtran_getName_1=(e,_)=>(Bt=t._emscripten_bind_PeGeogtran_getName_1=o.Ja)(e,_),Kt=t._emscripten_bind_PeGeogtran_getType_0=e=>(Kt=t._emscripten_bind_PeGeogtran_getType_0=o.Ka)(e),Vt=t._emscripten_bind_PeGTlistExtended_getGTlist_6=(e,_,r,p,i,c,g)=>(Vt=t._emscripten_bind_PeGTlistExtended_getGTlist_6=o.La)(e,_,r,p,i,c,g),qt=t._emscripten_bind_PeGTlistExtended_get_PE_GTLIST_OPTS_COMMON_0=e=>(qt=t._emscripten_bind_PeGTlistExtended_get_PE_GTLIST_OPTS_COMMON_0=o.Ma)(e),kt=t._emscripten_bind_PeGTlistExtendedEntry_getEntries_0=e=>(kt=t._emscripten_bind_PeGTlistExtendedEntry_getEntries_0=o.Na)(e),$t=t._emscripten_bind_PeGTlistExtendedEntry_getSteps_0=e=>($t=t._emscripten_bind_PeGTlistExtendedEntry_getSteps_0=o.Oa)(e),Jt=t._emscripten_bind_PeGTlistExtendedEntry_Delete_1=(e,_)=>(Jt=t._emscripten_bind_PeGTlistExtendedEntry_Delete_1=o.Pa)(e,_),Qt=t._emscripten_bind_PeGTlistExtendedGTs_getDirection_0=e=>(Qt=t._emscripten_bind_PeGTlistExtendedGTs_getDirection_0=o.Qa)(e),e_=t._emscripten_bind_PeGTlistExtendedGTs_getGeogtran_0=e=>(e_=t._emscripten_bind_PeGTlistExtendedGTs_getGeogtran_0=o.Ra)(e),t_=t._emscripten_bind_PeHorizon_getNump_0=e=>(t_=t._emscripten_bind_PeHorizon_getNump_0=o.Sa)(e),__=t._emscripten_bind_PeHorizon_getKind_0=e=>(__=t._emscripten_bind_PeHorizon_getKind_0=o.Ta)(e),r_=t._emscripten_bind_PeHorizon_getInclusive_0=e=>(r_=t._emscripten_bind_PeHorizon_getInclusive_0=o.Ua)(e),o_=t._emscripten_bind_PeHorizon_getSize_0=e=>(o_=t._emscripten_bind_PeHorizon_getSize_0=o.Va)(e),n_=t._emscripten_bind_PeHorizon_getCoord_0=e=>(n_=t._emscripten_bind_PeHorizon_getCoord_0=o.Wa)(e),p_=t._emscripten_bind_PeInteger_PeInteger_1=e=>(p_=t._emscripten_bind_PeInteger_PeInteger_1=o.Xa)(e),i_=t._emscripten_bind_PeInteger_get_val_0=e=>(i_=t._emscripten_bind_PeInteger_get_val_0=o.Ya)(e),c_=t._emscripten_bind_PeInteger_set_val_1=(e,_)=>(c_=t._emscripten_bind_PeInteger_set_val_1=o.Za)(e,_),s_=t._emscripten_bind_PeInteger___destroy___0=e=>(s_=t._emscripten_bind_PeInteger___destroy___0=o._a)(e),P_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_NEW_0=e=>(P_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_NEW_0=o.$a)(e),a_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_OLD_0=e=>(a_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_OLD_0=o.ab)(e),g_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_AUTO_0=e=>(g_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_AUTO_0=o.bb)(e),y_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_180_ZONE_1_PLUS_0=e=>(y_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_180_ZONE_1_PLUS_0=o.cb)(e),u_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_ADD_SPACES_0=e=>(u_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_ADD_SPACES_0=o.db)(e),d_=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NONE_0=e=>(d_=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NONE_0=o.eb)(e),f_=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_0=e=>(f_=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_0=o.fb)(e),E_=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_STRICT_0=e=>(E_=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_STRICT_0=o.gb)(e),b_=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_ADD_SPACES_0=e=>(b_=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_ADD_SPACES_0=o.hb)(e),m_=t._emscripten_bind_PeParameter_getValue_0=e=>(m_=t._emscripten_bind_PeParameter_getValue_0=o.ib)(e),T_=t._emscripten_bind_PeParameter_getCode_0=e=>(T_=t._emscripten_bind_PeParameter_getCode_0=o.jb)(e),O_=t._emscripten_bind_PeParameter_getName_1=(e,_)=>(O_=t._emscripten_bind_PeParameter_getName_1=o.kb)(e,_),S_=t._emscripten_bind_PeParameter_getType_0=e=>(S_=t._emscripten_bind_PeParameter_getType_0=o.lb)(e),N_=t._emscripten_bind_PePCSInfo_getCentralMeridian_0=e=>(N_=t._emscripten_bind_PePCSInfo_getCentralMeridian_0=o.mb)(e),h_=t._emscripten_bind_PePCSInfo_getDomainMinx_0=e=>(h_=t._emscripten_bind_PePCSInfo_getDomainMinx_0=o.nb)(e),l_=t._emscripten_bind_PePCSInfo_getDomainMiny_0=e=>(l_=t._emscripten_bind_PePCSInfo_getDomainMiny_0=o.ob)(e),M_=t._emscripten_bind_PePCSInfo_getDomainMaxx_0=e=>(M_=t._emscripten_bind_PePCSInfo_getDomainMaxx_0=o.pb)(e),v_=t._emscripten_bind_PePCSInfo_getDomainMaxy_0=e=>(v_=t._emscripten_bind_PePCSInfo_getDomainMaxy_0=o.qb)(e),D_=t._emscripten_bind_PePCSInfo_getNorthPoleLocation_0=e=>(D_=t._emscripten_bind_PePCSInfo_getNorthPoleLocation_0=o.rb)(e),R_=t._emscripten_bind_PePCSInfo_getNorthPoleGeometry_0=e=>(R_=t._emscripten_bind_PePCSInfo_getNorthPoleGeometry_0=o.sb)(e),A_=t._emscripten_bind_PePCSInfo_getSouthPoleLocation_0=e=>(A_=t._emscripten_bind_PePCSInfo_getSouthPoleLocation_0=o.tb)(e),G_=t._emscripten_bind_PePCSInfo_getSouthPoleGeometry_0=e=>(G_=t._emscripten_bind_PePCSInfo_getSouthPoleGeometry_0=o.ub)(e),C_=t._emscripten_bind_PePCSInfo_isDensificationNeeded_0=e=>(C_=t._emscripten_bind_PePCSInfo_isDensificationNeeded_0=o.vb)(e),I_=t._emscripten_bind_PePCSInfo_isGcsHorizonMultiOverlap_0=e=>(I_=t._emscripten_bind_PePCSInfo_isGcsHorizonMultiOverlap_0=o.wb)(e),j_=t._emscripten_bind_PePCSInfo_isPannableRectangle_0=e=>(j_=t._emscripten_bind_PePCSInfo_isPannableRectangle_0=o.xb)(e),U_=t._emscripten_bind_PePCSInfo_generate_2=(e,_,r)=>(U_=t._emscripten_bind_PePCSInfo_generate_2=o.yb)(e,_,r),L_=t._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_NONE_0=e=>(L_=t._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_NONE_0=o.zb)(e),F_=t._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_DOMAIN_0=e=>(F_=t._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_DOMAIN_0=o.Ab)(e),Y_=t._emscripten_bind_PePCSInfo_get_PE_POLE_OUTSIDE_BOUNDARY_0=e=>(Y_=t._emscripten_bind_PePCSInfo_get_PE_POLE_OUTSIDE_BOUNDARY_0=o.Bb)(e),w_=t._emscripten_bind_PePCSInfo_get_PE_POLE_POINT_0=e=>(w_=t._emscripten_bind_PePCSInfo_get_PE_POLE_POINT_0=o.Cb)(e),x_=t._emscripten_bind_PePrimem_getLongitude_0=e=>(x_=t._emscripten_bind_PePrimem_getLongitude_0=o.Db)(e),H_=t._emscripten_bind_PePrimem_getCode_0=e=>(H_=t._emscripten_bind_PePrimem_getCode_0=o.Eb)(e),X_=t._emscripten_bind_PePrimem_getName_1=(e,_)=>(X_=t._emscripten_bind_PePrimem_getName_1=o.Fb)(e,_),z_=t._emscripten_bind_PePrimem_getType_0=e=>(z_=t._emscripten_bind_PePrimem_getType_0=o.Gb)(e),Z_=t._emscripten_bind_PeProjcs_getGeogcs_0=e=>(Z_=t._emscripten_bind_PeProjcs_getGeogcs_0=o.Hb)(e),W_=t._emscripten_bind_PeProjcs_getParameters_0=e=>(W_=t._emscripten_bind_PeProjcs_getParameters_0=o.Ib)(e),B_=t._emscripten_bind_PeProjcs_getUnit_0=e=>(B_=t._emscripten_bind_PeProjcs_getUnit_0=o.Jb)(e),K_=t._emscripten_bind_PeProjcs_loadConstants_0=e=>(K_=t._emscripten_bind_PeProjcs_loadConstants_0=o.Kb)(e),V_=t._emscripten_bind_PeProjcs_horizonGcsGenerate_0=e=>(V_=t._emscripten_bind_PeProjcs_horizonGcsGenerate_0=o.Lb)(e),q_=t._emscripten_bind_PeProjcs_horizonPcsGenerate_0=e=>(q_=t._emscripten_bind_PeProjcs_horizonPcsGenerate_0=o.Mb)(e),k_=t._emscripten_bind_PeProjcs_getCode_0=e=>(k_=t._emscripten_bind_PeProjcs_getCode_0=o.Nb)(e),$_=t._emscripten_bind_PeProjcs_getName_1=(e,_)=>($_=t._emscripten_bind_PeProjcs_getName_1=o.Ob)(e,_),J_=t._emscripten_bind_PeProjcs_getType_0=e=>(J_=t._emscripten_bind_PeProjcs_getType_0=o.Pb)(e),Q_=t._emscripten_bind_PeSpheroid_getAxis_0=e=>(Q_=t._emscripten_bind_PeSpheroid_getAxis_0=o.Qb)(e),er=t._emscripten_bind_PeSpheroid_getFlattening_0=e=>(er=t._emscripten_bind_PeSpheroid_getFlattening_0=o.Rb)(e),tr=t._emscripten_bind_PeSpheroid_getCode_0=e=>(tr=t._emscripten_bind_PeSpheroid_getCode_0=o.Sb)(e),_r=t._emscripten_bind_PeSpheroid_getName_1=(e,_)=>(_r=t._emscripten_bind_PeSpheroid_getName_1=o.Tb)(e,_),rr=t._emscripten_bind_PeSpheroid_getType_0=e=>(rr=t._emscripten_bind_PeSpheroid_getType_0=o.Ub)(e),or=t._emscripten_bind_PeUnit_getUnitFactor_0=e=>(or=t._emscripten_bind_PeUnit_getUnitFactor_0=o.Vb)(e),nr=t._emscripten_bind_PeUnit_getCode_0=e=>(nr=t._emscripten_bind_PeUnit_getCode_0=o.Wb)(e),pr=t._emscripten_bind_PeUnit_getName_1=(e,_)=>(pr=t._emscripten_bind_PeUnit_getName_1=o.Xb)(e,_),ir=t._emscripten_bind_PeUnit_getType_0=e=>(ir=t._emscripten_bind_PeUnit_getType_0=o.Yb)(e),cr=t._emscripten_bind_PeVersion_version_string_0=e=>(cr=t._emscripten_bind_PeVersion_version_string_0=o.Zb)(e);function sr(){function e(){ie||(ie=!0,t.calledRun=!0,Ne||(Or(),Ee(t),Sr()))}ne>0||(Tr(),ne>0||e())}function d(){}function $(e){return(e||d).__cache__}function T(e,_){var r=$(_),p=r[e];return p||((p=Object.create((_||d).prototype)).ptr=e,r[e]=p)}function kr(e,_){return T(e.ptr,_)}function $r(e){if(!e.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";e.__destroy__(),delete $(e.__class__)[e.ptr]}function Jr(e,_){return e.ptr===_.ptr}function Qr(e){return e.ptr}function eo(e){return e.__class__}t._pe_getPeGTlistExtendedEntrySize=()=>(t._pe_getPeGTlistExtendedEntrySize=o._b)(),t._pe_getPeGTlistExtendedGTsSize=()=>(t._pe_getPeGTlistExtendedGTsSize=o.$b)(),t._pe_getPeHorizonSize=()=>(t._pe_getPeHorizonSize=o.ac)(),t._pe_geog_to_geog=(e,_,r,p,i)=>(t._pe_geog_to_geog=o.cc)(e,_,r,p,i),t._pe_geog_to_proj=(e,_,r)=>(t._pe_geog_to_proj=o.dc)(e,_,r),t._pe_geog_to_dd=(e,_,r,p,i)=>(t._pe_geog_to_dd=o.ec)(e,_,r,p,i),t._pe_dd_to_geog=(e,_,r,p)=>(t._pe_dd_to_geog=o.fc)(e,_,r,p),t._pe_geog_to_ddm=(e,_,r,p,i)=>(t._pe_geog_to_ddm=o.gc)(e,_,r,p,i),t._pe_ddm_to_geog=(e,_,r,p)=>(t._pe_ddm_to_geog=o.hc)(e,_,r,p),t._pe_geog_to_dms=(e,_,r,p,i)=>(t._pe_geog_to_dms=o.ic)(e,_,r,p,i),t._pe_dms_to_geog=(e,_,r,p)=>(t._pe_dms_to_geog=o.jc)(e,_,r,p),t._pe_geog_to_mgrs_extended=(e,_,r,p,i,c,g)=>(t._pe_geog_to_mgrs_extended=o.kc)(e,_,r,p,i,c,g),t._pe_mgrs_to_geog_extended=(e,_,r,p,i)=>(t._pe_mgrs_to_geog_extended=o.lc)(e,_,r,p,i),t._pe_geog_to_usng=(e,_,r,p,i,c,g)=>(t._pe_geog_to_usng=o.mc)(e,_,r,p,i,c,g),t._pe_usng_to_geog=(e,_,r,p)=>(t._pe_usng_to_geog=o.nc)(e,_,r,p),t._pe_geog_to_utm=(e,_,r,p,i)=>(t._pe_geog_to_utm=o.oc)(e,_,r,p,i),t._pe_utm_to_geog=(e,_,r,p,i)=>(t._pe_utm_to_geog=o.pc)(e,_,r,p,i),t._pe_object_to_string_ext=(e,_,r)=>(t._pe_object_to_string_ext=o.qc)(e,_,r),t._pe_proj_to_geog_center=(e,_,r,p)=>(t._pe_proj_to_geog_center=o.rc)(e,_,r,p),t.___start_em_js=2033306,t.___stop_em_js=2033404,t.getValue=Ar,t.UTF8ToString=L,V=function e(){ie||sr(),ie||(V=e)},sr(),d.prototype=Object.create(d.prototype),d.prototype.constructor=d,d.prototype.__class__=d,d.__cache__={},t.WrapperObject=d,t.getCache=$,t.wrapPointer=T,t.castObject=kr,t.NULL=T(0),t.destroy=$r,t.compare=Jr,t.getPointer=Qr,t.getClass=eo;var P={buffer:0,size:0,pos:0,temps:[],needed:0,prepare(){if(P.needed){for(var e=0;e=P.size?(ge(i>0),P.needed+=i,r=t._webidl_malloc(i),P.temps.push(r)):(r=P.buffer+P.pos,P.pos+=i),r},copy(e,_,r){switch(r>>>=0,_.BYTES_PER_ELEMENT){case 2:r>>>=1;break;case 4:r>>>=2;break;case 8:r>>>=3}for(var p=0;p{const s=D(e,t,n);for(const a of o){const i=j(t,a,n);for(const r in s)i[r]=s[r]}}}function D(e,o,t){if((e==null?void 0:e.type)==="resource")return E(e,o,t);switch((e==null?void 0:e.type)??"other"){case"other":return{read:!0,write:!0};case"url":{const{read:n,write:s}=H;return{read:n,write:s}}}}function E(e,o,t){const n=N(o,t);return{type:String,read:(s,a,i)=>{const r=b(s,a,i);return n.type===String?r:typeof n.type=="function"?new n.type({url:r}):void 0},write:{writer(s,a,i,r){if(!(r!=null&&r.resources))return typeof s=="string"?void(a[i]=v(s,r)):void(a[i]=s.write({},r));const c=V(s),p=v(c,{...r,verifyItemRelativeUrls:r!=null&&r.verifyItemRelativeUrls?{writtenUrls:r.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},x.NO),l=n.type!==String&&(!B(this)||(r==null?void 0:r.origin)&&this.originIdOf(t)>P(r.origin)),d={object:this,propertyName:t,value:s,targetUrl:p,dest:a,targetPropertyName:i,context:r,params:e};r!=null&&r.portalItem&&p&&!A(p)?l&&(e!=null&&e.contentAddressed)?g(d):l?G(d):L(d):r!=null&&r.portalItem&&(p==null||S(p)!=null||w(p)||l)?g(d):a[i]=p}}}}function g(e){var h;const{targetUrl:o,params:t,value:n,context:s,dest:a,targetPropertyName:i}=e;if(!s.portalItem)return;const r=R(o),c=I(n,o,s);if(t!=null&&t.contentAddressed&&c.type!=="json")return void((h=s.messages)==null?void 0:h.push(new O("persistable:contentAddressingUnsupported",`Property "${i}" is trying to serializing a resource with content of type ${c.type} with content addressing. Content addressing is only supported for json resources.`,{content:c})));const p=t!=null&&t.contentAddressed&&c.type==="json"?z(c.jsonString):(r==null?void 0:r.filename)??F(),l=J((t==null?void 0:t.prefix)??(r==null?void 0:r.prefix),p),d=`${l}.${y(c)}`;if(t!=null&&t.contentAddressed&&s.resources&&c.type==="json"){const m=s.resources.toKeep.find(({resource:f})=>f.path===d)??s.resources.toAdd.find(({resource:f})=>f.path===d);if(m)return void(a[i]=m.resource.itemRelativeUrl)}const u=s.portalItem.resourceFromPath(d);w(o)&&s.resources&&s.resources.pendingOperations.push(K(o).then(m=>{u.path=`${l}.${y({type:"blob",blob:m})}`,a[i]=u.itemRelativeUrl}).catch(()=>{}));const $=(t==null?void 0:t.compress)??!1;s.resources&&U({...e,resource:u,content:c,compress:$,updates:s.resources.toAdd}),a[i]=u.itemRelativeUrl}function G(e){const{context:o,targetUrl:t,params:n,value:s,dest:a,targetPropertyName:i}=e;if(!o.portalItem)return;const r=o.portalItem.resourceFromPath(t),c=I(s,t,o),p=y(c),l=C(r.path),d=(n==null?void 0:n.compress)??!1;p===l?(o.resources&&U({...e,resource:r,content:c,compress:d,updates:o.resources.toUpdate}),a[i]=t):g(e)}function L({context:e,targetUrl:o,dest:t,targetPropertyName:n}){e.portalItem&&e.resources&&(e.resources.toKeep.push({resource:e.portalItem.resourceFromPath(o),compress:!1}),t[n]=o)}function U({object:e,propertyName:o,updates:t,resource:n,content:s,compress:a}){const i=r=>{Y(e,o,r)};t.push({resource:n,content:s,compress:a,finish:i})}function I(e,o,t){return typeof e=="string"?{type:"url",url:o}:{type:"json",jsonString:JSON.stringify(e.toJSON(t))}}function V(e){return e==null?null:typeof e=="string"?e:e.url}function Y(e,o,t){typeof e[o]=="string"?e[o]=t.url:e[o].url=t.url}export{M as j}; +import{dA as j,dB as N,dC as b,dD as v,dE as x,dF as P,dG as A,dH as S,dI as w,dJ as R,N as O,da as F,b_ as J,dK as K,b$ as C,dL as H}from"./index-BjUNJPVf.js";import{x as z}from"./MD5-C9MwAd2G.js";import{i as B}from"./multiOriginJSONSupportUtils-C0wm8_Yw.js";import{p as y}from"./resourceExtension-CiV172Z4.js";function M(e){const o=(e==null?void 0:e.origins)??[void 0];return(t,n)=>{const s=D(e,t,n);for(const a of o){const i=j(t,a,n);for(const r in s)i[r]=s[r]}}}function D(e,o,t){if((e==null?void 0:e.type)==="resource")return E(e,o,t);switch((e==null?void 0:e.type)??"other"){case"other":return{read:!0,write:!0};case"url":{const{read:n,write:s}=H;return{read:n,write:s}}}}function E(e,o,t){const n=N(o,t);return{type:String,read:(s,a,i)=>{const r=b(s,a,i);return n.type===String?r:typeof n.type=="function"?new n.type({url:r}):void 0},write:{writer(s,a,i,r){if(!(r!=null&&r.resources))return typeof s=="string"?void(a[i]=v(s,r)):void(a[i]=s.write({},r));const c=V(s),p=v(c,{...r,verifyItemRelativeUrls:r!=null&&r.verifyItemRelativeUrls?{writtenUrls:r.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},x.NO),l=n.type!==String&&(!B(this)||(r==null?void 0:r.origin)&&this.originIdOf(t)>P(r.origin)),d={object:this,propertyName:t,value:s,targetUrl:p,dest:a,targetPropertyName:i,context:r,params:e};r!=null&&r.portalItem&&p&&!A(p)?l&&(e!=null&&e.contentAddressed)?g(d):l?G(d):L(d):r!=null&&r.portalItem&&(p==null||S(p)!=null||w(p)||l)?g(d):a[i]=p}}}}function g(e){var h;const{targetUrl:o,params:t,value:n,context:s,dest:a,targetPropertyName:i}=e;if(!s.portalItem)return;const r=R(o),c=I(n,o,s);if(t!=null&&t.contentAddressed&&c.type!=="json")return void((h=s.messages)==null?void 0:h.push(new O("persistable:contentAddressingUnsupported",`Property "${i}" is trying to serializing a resource with content of type ${c.type} with content addressing. Content addressing is only supported for json resources.`,{content:c})));const p=t!=null&&t.contentAddressed&&c.type==="json"?z(c.jsonString):(r==null?void 0:r.filename)??F(),l=J((t==null?void 0:t.prefix)??(r==null?void 0:r.prefix),p),d=`${l}.${y(c)}`;if(t!=null&&t.contentAddressed&&s.resources&&c.type==="json"){const m=s.resources.toKeep.find(({resource:f})=>f.path===d)??s.resources.toAdd.find(({resource:f})=>f.path===d);if(m)return void(a[i]=m.resource.itemRelativeUrl)}const u=s.portalItem.resourceFromPath(d);w(o)&&s.resources&&s.resources.pendingOperations.push(K(o).then(m=>{u.path=`${l}.${y({type:"blob",blob:m})}`,a[i]=u.itemRelativeUrl}).catch(()=>{}));const $=(t==null?void 0:t.compress)??!1;s.resources&&U({...e,resource:u,content:c,compress:$,updates:s.resources.toAdd}),a[i]=u.itemRelativeUrl}function G(e){const{context:o,targetUrl:t,params:n,value:s,dest:a,targetPropertyName:i}=e;if(!o.portalItem)return;const r=o.portalItem.resourceFromPath(t),c=I(s,t,o),p=y(c),l=C(r.path),d=(n==null?void 0:n.compress)??!1;p===l?(o.resources&&U({...e,resource:r,content:c,compress:d,updates:o.resources.toUpdate}),a[i]=t):g(e)}function L({context:e,targetUrl:o,dest:t,targetPropertyName:n}){e.portalItem&&e.resources&&(e.resources.toKeep.push({resource:e.portalItem.resourceFromPath(o),compress:!1}),t[n]=o)}function U({object:e,propertyName:o,updates:t,resource:n,content:s,compress:a}){const i=r=>{Y(e,o,r)};t.push({resource:n,content:s,compress:a,finish:i})}function I(e,o,t){return typeof e=="string"?{type:"url",url:o}:{type:"json",jsonString:JSON.stringify(e.toJSON(t))}}function V(e){return e==null?null:typeof e=="string"?e:e.url}function Y(e,o,t){typeof e[o]=="string"?e[o]=t.url:e[o].url=t.url}export{M as j}; diff --git a/assets/perspectiveUtils-24oy2YlR.js b/assets/perspectiveUtils-DhC7L1B1.js similarity index 91% rename from assets/perspectiveUtils-24oy2YlR.js rename to assets/perspectiveUtils-DhC7L1B1.js index 8e79aca..485b8b0 100644 --- a/assets/perspectiveUtils-24oy2YlR.js +++ b/assets/perspectiveUtils-DhC7L1B1.js @@ -1 +1 @@ -import{d as t,y as l,f as V,a7 as k,ff as p,dV as w,aB as E,fg as g,fh as h,fi as m,fj as c,eM as x,fk as z,fl as f,cy as J}from"./index-CEWggaxV.js";import{p as K}from"./normalizeUtilsSync-B6VufdiX.js";import{e as d}from"./mat3f64-q3fE-ZOt.js";let s=class extends k{constructor(o){super(o)}get bounds(){const o=this.coords;return(o==null?void 0:o.extent)==null?null:p(o.extent)}get coords(){var e;const o=(e=this.element.georeference)==null?void 0:e.coords;return w(o,this.spatialReference).geometry}get normalizedCoords(){return E.fromJSON(K(this.coords))}get normalizedBounds(){const o=this.normalizedCoords!=null?this.normalizedCoords.extent:null;return o!=null?p(o):null}};t([l()],s.prototype,"spatialReference",void 0),t([l()],s.prototype,"element",void 0),t([l()],s.prototype,"bounds",null),t([l()],s.prototype,"coords",null),t([l()],s.prototype,"normalizedCoords",null),t([l()],s.prototype,"normalizedBounds",null),s=t([V("esri.layers.support.MediaElementView")],s);const r=J(),a=d(),u=d(),i=d();function A(o,e,n){return g(r,e[0],e[1],1),h(r,r,m(a,n)),r[2]===0?c(o,r[0],r[1]):c(o,r[0]/r[2],r[1]/r[2])}function D(o,e,n){return y(u,e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]),y(i,n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]),x(o,z(u,u),i),o[8]!==0&&(o[0]/=o[8],o[1]/=o[8],o[2]/=o[8],o[3]/=o[8],o[4]/=o[8],o[5]/=o[8],o[6]/=o[8],o[7]/=o[8],o[8]/=o[8]),o}function y(o,e,n,j,C,v,B,S,$){f(o,e,j,v,n,C,B,1,1,1),g(r,S,$,1),z(a,o);const[b,M,R]=h(r,r,m(a,a));return f(a,b,0,0,0,M,0,0,0,R),x(o,a,o)}export{D as j,s as m,A as p}; +import{d as t,y as l,f as V,a7 as k,ff as p,dV as w,aB as E,fg as g,fh as h,fi as m,fj as c,eM as x,fk as z,fl as f,cy as J}from"./index-BjUNJPVf.js";import{p as K}from"./normalizeUtilsSync-73yZ0QwV.js";import{e as d}from"./mat3f64-q3fE-ZOt.js";let s=class extends k{constructor(o){super(o)}get bounds(){const o=this.coords;return(o==null?void 0:o.extent)==null?null:p(o.extent)}get coords(){var e;const o=(e=this.element.georeference)==null?void 0:e.coords;return w(o,this.spatialReference).geometry}get normalizedCoords(){return E.fromJSON(K(this.coords))}get normalizedBounds(){const o=this.normalizedCoords!=null?this.normalizedCoords.extent:null;return o!=null?p(o):null}};t([l()],s.prototype,"spatialReference",void 0),t([l()],s.prototype,"element",void 0),t([l()],s.prototype,"bounds",null),t([l()],s.prototype,"coords",null),t([l()],s.prototype,"normalizedCoords",null),t([l()],s.prototype,"normalizedBounds",null),s=t([V("esri.layers.support.MediaElementView")],s);const r=J(),a=d(),u=d(),i=d();function A(o,e,n){return g(r,e[0],e[1],1),h(r,r,m(a,n)),r[2]===0?c(o,r[0],r[1]):c(o,r[0]/r[2],r[1]/r[2])}function D(o,e,n){return y(u,e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]),y(i,n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]),x(o,z(u,u),i),o[8]!==0&&(o[0]/=o[8],o[1]/=o[8],o[2]/=o[8],o[3]/=o[8],o[4]/=o[8],o[5]/=o[8],o[6]/=o[8],o[7]/=o[8],o[8]/=o[8]),o}function y(o,e,n,j,C,v,B,S,$){f(o,e,j,v,n,C,B,1,1,1),g(r,S,$,1),z(a,o);const[b,M,R]=h(r,r,m(a,a));return f(a,b,0,0,0,M,0,0,0,R),x(o,a,o)}export{D as j,s as m,A as p}; diff --git a/assets/pieChart-D4IZYqRN.js b/assets/pieChart-BW1iYy_W.js similarity index 98% rename from assets/pieChart-D4IZYqRN.js rename to assets/pieChart-BW1iYy_W.js index 0ba450c..a0f5245 100644 --- a/assets/pieChart-D4IZYqRN.js +++ b/assets/pieChart-BW1iYy_W.js @@ -1 +1 @@ -import{ed as E}from"./index-CEWggaxV.js";import{R as Te,D as Ne,U as Se,V as Ie,k as M}from"./Tick-B3uT4_8g.js";import{s as Le,al as Ce,b as je,ap as v,ah as Re,ad as ae,as as Me,ar as F,at as pe,au as ye,ak as be,w as A,av as H,aw as O,ax as ve,ae as Oe,i as me,ay as Be,r as we,C as re,an as Fe,a as He}from"./Theme-Bdh3gaKt.js";import{s as Xe}from"./ColorSet-DDQ4d9ui.js";import{l as Ye}from"./DefaultTheme-QXTOOsyZ.js";class te extends Le{constructor(){super(...arguments),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeRadialText("",this.textStyle)})}_afterNew(){super._afterNew()}_beforeChanged(){super._beforeChanged(),this._display.clear(),this.isDirty("textType")&&(this._display.textType=this.get("textType"),this.markDirtyBounds()),this.isDirty("radius")&&(this._display.radius=this.get("radius"),this.markDirtyBounds()),this.isDirty("startAngle")&&(this._display.startAngle=(this.get("startAngle",0)+90)*ve,this.markDirtyBounds()),this.isDirty("inside")&&(this._display.inside=this.get("inside"),this.markDirtyBounds()),this.isDirty("orientation")&&(this._display.orientation=this.get("orientation"),this.markDirtyBounds()),this.isDirty("kerning")&&(this._display.kerning=this.get("kerning"),this.markDirtyBounds())}}Object.defineProperty(te,"className",{enumerable:!0,configurable:!0,writable:!0,value:"RadialText"}),Object.defineProperty(te,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Le.classNames.concat([te.className])});class ie extends Ce{constructor(){super(...arguments),Object.defineProperty(this,"_flipped",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this._textKeys.push("textType","kerning"),super._afterNew()}_makeText(){this._text=this.children.push(te.new(this._root,{}))}baseRadius(){const t=this.getPrivate("radius",0),e=this.getPrivate("innerRadius",0),i=this.get("baseRadius",0);return e+F(i,t-e)}radius(){const t=this.get("inside",!1);return this.baseRadius()+this.get("radius",0)*(t?-1:1)}_updateChildren(){if(super._updateChildren(),this.isDirty("baseRadius")||this.isPrivateDirty("radius")||this.isPrivateDirty("innerRadius")||this.isDirty("labelAngle")||this.isDirty("radius")||this.isDirty("inside")||this.isDirty("orientation")||this.isDirty("textType")){const t=this.get("textType","adjusted"),e=this.get("inside",!1),i=this.get("orientation");let s=Oe(this.get("labelAngle",0));this._text.set("startAngle",this.get("labelAngle",0)),this._text.set("inside",e);const r=O(s),l=H(s);let a=this.baseRadius(),y=this.radius();if(this._display.angle=0,t=="circular")this.setAll({paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}),this._text.set("orientation",i),this._text.set("radius",y);else{a==0&&(s=0,y=0);let o=y*l,n=y*r;t=="radial"?(this.setRaw("x",o),this.setRaw("y",n),s<90||s>270||i!="auto"?(this._display.angle=s,this._flipped=!1):(this._display.angle=s+180,this._flipped=!0),this._dirty.rotation=!1):t=="adjusted"?(this.setRaw("centerX",v),this.setRaw("centerY",v),this.setRaw("x",o),this.setRaw("y",n)):t=="regular"&&(this.setRaw("x",o),this.setRaw("y",n))}this.markDirtyPosition(),this.markDirtyBounds()}}_updatePosition(){const t=this.get("textType","regular"),e=this.get("inside",!1);let i=0,s=0,r=this.get("labelAngle",0),l=this.localBounds(),a=l.right-l.left,y=l.bottom-l.top;if(t=="radial"){if(this._flipped){let o=this.get("centerX");o instanceof ae&&(a*=1-2*o.value),i=a*H(r),s=a*O(r)}}else e||t!="adjusted"||(i=a/2*H(r),s=y/2*O(r));this.setRaw("dx",i),this.setRaw("dy",s),super._updatePosition()}get text(){return this._text}}Object.defineProperty(ie,"className",{enumerable:!0,configurable:!0,writable:!0,value:"RadialLabel"}),Object.defineProperty(ie,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ce.classNames.concat([ie.className])});const Ae=Math.abs,_=Math.atan2,B=Math.cos,Ve=Math.max,fe=Math.min,C=Math.sin,$=Math.sqrt,x=1e-12,q=Math.PI,ne=q/2,ze=2*q;function We(d){return d>1?0:d<-1?q:Math.acos(d)}function Pe(d){return d>=1?ne:d<=-1?-ne:Math.asin(d)}function $e(d){return d.innerRadius}function Ue(d){return d.outerRadius}function Ke(d){return d.startAngle}function qe(d){return d.endAngle}function Je(d){return d&&d.padAngle}function Qe(d,t,e,i,s,r,l,a){var y=e-d,o=i-t,n=l-s,g=a-r,h=g*y-n*o;if(!(h*hD*D+V*V&&(S=X,I=Y),{cx:S,cy:I,x01:-n,y01:-g,x11:S*(s/T-1),y11:I*(s/T-1)}}function Ge(){var d=$e,t=Ue,e=M(0),i=null,s=Ke,r=qe,l=Je,a=null,y=Ie(o);function o(){var n,g,h=+d.apply(this,arguments),c=+t.apply(this,arguments),b=s.apply(this,arguments)-ne,f=r.apply(this,arguments)-ne,P=Ae(f-b),m=f>b;if(a||(a=n=y()),cx)if(P>ze-x)a.moveTo(c*B(b),c*C(b)),a.arc(0,0,c,b,f,!m),h>x&&(a.moveTo(h*B(f),h*C(f)),a.arc(0,0,h,f,b,m));else{var u,p,R=b,T=f,w=b,N=f,S=P,I=P,X=l.apply(this,arguments)/2,Y=X>x&&(i?+i.apply(this,arguments):$(h*h+c*c)),L=fe(Ae(c-h)/2,+e.apply(this,arguments)),k=L,D=L;if(Y>x){var V=Pe(Y/h*C(X)),le=Pe(Y/c*C(X));(S-=2*V)>x?(w+=V*=m?1:-1,N-=V):(S=0,w=N=(b+f)/2),(I-=2*le)>x?(R+=le*=m?1:-1,T-=le):(I=0,R=T=(b+f)/2)}var z=c*B(R),W=c*C(R),J=h*B(N),Q=h*C(N);if(L>x){var j,G=c*B(T),Z=c*C(T),oe=h*B(w),ue=h*C(w);if(Px?D>x?(u=ee(oe,ue,z,W,c,D,m),p=ee(G,Z,J,Q,c,D,m),a.moveTo(u.cx+u.x01,u.cy+u.y01),Dx&&S>x?k>x?(u=ee(J,Q,G,Z,h,-k,m),p=ee(z,W,oe,ue,h,-k,m),a.lineTo(u.cx+u.x01,u.cy+u.y01),k=360&&l==0&&(i=0,s=0),{x:i,y:s}}_beforeChanged(){super._beforeChanged(),(this.isDirty("radius")||this.isDirty("arc")||this.isDirty("innerRadius")||this.isDirty("startAngle")||this.isDirty("dRadius")||this.isDirty("dInnerRadius")||this.isDirty("cornerRadius")||this.isDirty("shiftRadius"))&&(this._clear=!0)}_changed(){if(super._changed(),this._clear){let t=this.get("startAngle",0),e=this.get("arc",0);const i=this._generator;e<0&&(t+=e,e*=-1),e>.1&&i.cornerRadius(this.get("cornerRadius",0)),i.context(this._display);let s=this.get("radius",0),r=this.get("innerRadius",0);s+=this.get("dRadius",0),r+=this.get("dInnerRadius",0),r<0&&(r=s+r),i({innerRadius:r,outerRadius:s,startAngle:(t+90)*ve,endAngle:(t+e+90)*ve});let l=t+e/2;this.ix=H(l),this.iy=O(l);const a=this.get("shiftRadius",0);this.setRaw("dx",this.ix*a),this.setRaw("dy",this.iy*a),this.markDirtyPosition()}}}Object.defineProperty(se,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Slice"}),Object.defineProperty(se,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:je.classNames.concat([se.className])});class Ze extends Fe{setupDefaultRules(){super.setupDefaultRules();const t=this._root.interfaceColors,e=this.rule.bind(this);e("PercentSeries").setAll({legendLabelText:"{category}",legendValueText:"{valuePercentTotal.formatNumber('0.00p')}",colors:Xe.new(this._root,{}),width:we,height:we}),e("PieChart").setAll({radius:He(80),startAngle:-90,endAngle:270}),e("PieSeries").setAll({alignLabels:!0,startAngle:-90,endAngle:270}),e("PieSeries").states.create("hidden",{endAngle:-90,opacity:0}),e("Slice",["pie"]).setAll({position:"absolute",isMeasured:!1,x:0,y:0,toggleKey:"active",tooltipText:"{category}: {valuePercentTotal.formatNumber('0.00p')}",strokeWidth:1,strokeOpacity:1,role:"figure",lineJoin:"round"}),e("Slice",["pie"]).states.create("active",{shiftRadius:20,scale:1}),e("Slice",["pie"]).states.create("hoverActive",{scale:1.04}),e("Slice",["pie"]).states.create("hover",{scale:1.04}),e("RadialLabel",["pie"]).setAll({textType:"aligned",radius:10,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",paddingTop:5,paddingBottom:5,populateText:!0}),e("Tick",["pie"]).setAll({location:1}),e("SlicedChart").setAll({paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10}),e("FunnelSeries").setAll({startLocation:0,endLocation:1,orientation:"vertical",alignLabels:!0,sequencedInterpolation:!0}),e("FunnelSlice").setAll({interactive:!0,expandDistance:0}),e("FunnelSlice").states.create("hover",{expandDistance:.15}),e("Label",["funnel"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:v}),e("Label",["funnel","horizontal"]).setAll({centerX:0,centerY:v,rotation:-90}),e("Label",["funnel","vertical"]).setAll({centerY:v,centerX:0}),e("Tick",["funnel"]).setAll({location:1}),e("FunnelSlice",["funnel","link"]).setAll({fillOpacity:.5,strokeOpacity:0,expandDistance:-.1}),e("FunnelSlice",["funnel","link","vertical"]).setAll({height:10}),e("FunnelSlice",["funnel","link","horizontal"]).setAll({width:10}),e("PyramidSeries").setAll({valueIs:"area"}),e("FunnelSlice",["pyramid","link"]).setAll({fillOpacity:.5}),e("FunnelSlice",["pyramid","link","vertical"]).setAll({height:0}),e("FunnelSlice",["pyramid","link","horizontal"]).setAll({width:0}),e("FunnelSlice",["pyramid"]).setAll({interactive:!0,expandDistance:0}),e("FunnelSlice",["pyramid"]).states.create("hover",{expandDistance:.15}),e("Label",["pyramid"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:v}),e("Label",["pyramid","horizontal"]).setAll({centerX:0,centerY:v,rotation:-90}),e("Label",["pyramid","vertical"]).setAll({centerY:v,centerX:0}),e("Tick",["pyramid"]).setAll({location:1}),e("FunnelSlice",["pictorial"]).setAll({interactive:!0,tooltipText:"{category}: {valuePercentTotal.formatNumber('0.00p')}"}),e("Label",["pictorial"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:v}),e("Label",["pictorial","horizontal"]).setAll({centerX:0,centerY:v,rotation:-90}),e("Label",["pictorial","vertical"]).setAll({centerY:v,centerX:0}),e("FunnelSlice",["pictorial","link"]).setAll({fillOpacity:.5,width:0,height:0}),e("Tick",["pictorial"]).setAll({location:.5});{const i=e("Graphics",["pictorial","background"]);i.setAll({fillOpacity:.2}),Ye(i,"fill",t,"alternativeBackground")}}}class U extends Te{_afterNew(){this._defaultThemes.push(Ze.new(this._root)),super._afterNew(),this.chartContainer.children.push(this.seriesContainer),this.seriesContainer.children.push(this.bulletsContainer)}_processSeries(t){super._processSeries(t),this.seriesContainer.children.moveValue(this.bulletsContainer,this.seriesContainer.children.length-1)}}Object.defineProperty(U,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PercentChart"}),Object.defineProperty(U,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Te.classNames.concat([U.className])});class K extends Ne{constructor(){super(...arguments),Object.defineProperty(this,"slicesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(me.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"labelsContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(me.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"ticksContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(me.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"_lLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_rLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_hLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"slices",{enumerable:!0,configurable:!0,writable:!0,value:this._makeSlices()}),Object.defineProperty(this,"labels",{enumerable:!0,configurable:!0,writable:!0,value:this._makeLabels()}),Object.defineProperty(this,"ticks",{enumerable:!0,configurable:!0,writable:!0,value:this._makeTicks()})}makeSlice(t){const e=this.slicesContainer.children.push(this.slices.make());return e.on("fill",()=>{this.updateLegendMarker(t)}),e.on("stroke",()=>{this.updateLegendMarker(t)}),e._setDataItem(t),t.set("slice",e),this.slices.push(e),e}makeLabel(t){const e=this.labelsContainer.children.push(this.labels.make());return e._setDataItem(t),t.set("label",e),this.labels.push(e),e}_shouldMakeBullet(t){return t.get("value")!=null}makeTick(t){const e=this.ticksContainer.children.push(this.ticks.make());return e._setDataItem(t),t.set("tick",e),this.ticks.push(e),e}_afterNew(){this.fields.push("category","fill"),super._afterNew()}_onDataClear(){const t=this.get("colors");t&&t.reset()}_prepareChildren(){if(super._prepareChildren(),this._lLabels=[],this._rLabels=[],this._hLabels=[],this._valuesDirty){let t=0,e=0,i=0,s=1/0,r=0;A(this._dataItems,l=>{let a=l.get("valueWorking",0);t+=a,e+=Math.abs(a)}),A(this._dataItems,l=>{let a=l.get("valueWorking",0);a>i&&(i=a),asuper.show}});return E(this,void 0,void 0,function*(){let i=[];i.push(e.show.call(this,t)),i.push(this._sequencedShowHide(!0,t)),yield Promise.all(i)})}hide(t){const e=Object.create(null,{hide:{get:()=>super.hide}});return E(this,void 0,void 0,function*(){let i=[];i.push(e.hide.call(this,t)),i.push(this._sequencedShowHide(!1,t)),yield Promise.all(i)})}_updateChildren(){super._updateChildren(),this._valuesDirty&&A(this._dataItems,t=>{t.get("label").text.markDirtyText()}),(this.isDirty("legendLabelText")||this.isDirty("legendValueText"))&&A(this._dataItems,t=>{this.updateLegendValue(t)}),this._arrange()}_arrange(){this._arrangeDown(this._lLabels),this._arrangeUp(this._lLabels),this._arrangeDown(this._rLabels),this._arrangeUp(this._rLabels),this._arrangeLeft(this._hLabels),this._arrangeRight(this._hLabels),A(this.dataItems,t=>{this._updateTick(t)})}_afterChanged(){super._afterChanged(),this._arrange()}processDataItem(t){if(super.processDataItem(t),t.get("fill")==null){let e=this.get("colors");e&&t.setRaw("fill",e.next())}}showDataItem(t,e){const i=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return E(this,void 0,void 0,function*(){const s=[i.showDataItem.call(this,t,e)];re(e)||(e=this.get("stateAnimationDuration",0));const r=this.get("stateAnimationEasing");let l=t.get("value");const a=t.animate({key:"valueWorking",to:l,duration:e,easing:r});a&&s.push(a.waitForStop());const y=t.get("tick");y&&s.push(y.show(e));const o=t.get("label");o&&s.push(o.show(e));const n=t.get("slice");n&&s.push(n.show(e)),n.get("active")&&n.states.applyAnimate("active"),yield Promise.all(s)})}hideDataItem(t,e){const i=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return E(this,void 0,void 0,function*(){const s=[i.hideDataItem.call(this,t,e)],r=this.states.create("hidden",{});re(e)||(e=r.get("stateAnimationDuration",this.get("stateAnimationDuration",0)));const l=r.get("stateAnimationEasing",this.get("stateAnimationEasing")),a=t.animate({key:"valueWorking",to:0,duration:e,easing:l});a&&s.push(a.waitForStop());const y=t.get("tick");y&&s.push(y.hide(e));const o=t.get("label");o&&s.push(o.hide(e));const n=t.get("slice");n.hideTooltip(),n&&s.push(n.hide(e)),yield Promise.all(s)})}disposeDataItem(t){super.disposeDataItem(t);let e=t.get("label");e&&(this.labels.removeValue(e),e.dispose());let i=t.get("tick");i&&(this.ticks.removeValue(i),i.dispose());let s=t.get("slice");s&&(this.slices.removeValue(s),s.dispose())}hoverDataItem(t){const e=t.get("slice");e&&!e.isHidden()&&e.hover()}unhoverDataItem(t){const e=t.get("slice");e&&e.unhover()}updateLegendMarker(t){if(t){const e=t.get("slice");if(e){const i=t.get("legendDataItem");if(i){const s=i.get("markerRectangle");A(Be,r=>{e.get(r)!=null&&s.set(r,e.get(r))})}}}}_arrangeDown(t){if(t){let e=this._getNextDown();t.sort((i,s)=>i.y>s.y?1:i.y{const s=i.label.adjustedLocalBounds();let r=s.top;i.y+ri.ys.y?-1:0),A(t,i=>{const s=i.label.adjustedLocalBounds();let r=s.bottom;i.y+r>e&&(i.y=e-r),i.label.set("y",i.y),e=i.y+s.top})}}_arrangeRight(t){if(t){let e=0;t.sort((i,s)=>i.y>s.y?1:i.y{const s=i.label.adjustedLocalBounds();let r=s.left;i.y+ri.ys.y?-1:0),A(t,i=>{const s=i.label.adjustedLocalBounds();let r=s.right;i.y+r>e&&(i.y=e-r),i.label.set("x",i.y),e=i.y+s.left})}}_updateSize(){super._updateSize(),this.markDirty()}_updateTick(t){}_dispose(){super._dispose();const t=this.chart;t&&t.series.removeValue(this)}}Object.defineProperty(K,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PercentSeries"}),Object.defineProperty(K,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ne.classNames.concat([K.className])});class _e extends U{constructor(){super(...arguments),Object.defineProperty(this,"_maxRadius",{enumerable:!0,configurable:!0,writable:!0,value:1})}_afterNew(){super._afterNew(),this.seriesContainer.setAll({x:v,y:v})}_prepareChildren(){super._prepareChildren();const t=this.chartContainer,e=t.innerWidth(),i=t.innerHeight(),s=this.get("startAngle",0),r=this.get("endAngle",0),l=this.get("innerRadius");let a=Re(0,0,s,r,1);const y=e/(a.right-a.left),o=i/(a.bottom-a.top);let n={left:0,right:0,top:0,bottom:0};if(l instanceof ae){let c=l.value,b=Math.min(y,o);c=Math.max(b*c,b-Math.min(i,e))/b,n=Re(0,0,s,r,c),this.setPrivateRaw("irModifyer",c/l.value)}a=Me([a,n]);const g=this._maxRadius;this._maxRadius=Math.min(y,o);const h=F(this.get("radius",0),this._maxRadius);this.seriesContainer.setAll({dy:-h*(a.bottom+a.top)/2,dx:-h*(a.right+a.left)/2}),(this.isDirty("startAngle")||this.isDirty("endAngle")||g!=this._maxRadius)&&this.series.each(c=>{c._markDirtyKey("startAngle")}),(this.isDirty("innerRadius")||this.isDirty("radius"))&&this.series.each(c=>{c._markDirtyKey("innerRadius")})}radius(t){let e=F(this.get("radius",0),this._maxRadius),i=F(this.get("innerRadius",0),e);if(t){let s=this.series.indexOf(t),r=this.series.length,l=t.get("radius");return l!=null?i+F(l,e-i):i+(e-i)/r*(s+1)}return e}innerRadius(t){const e=this.radius();let i=F(this.get("innerRadius",0),e);if(i<0&&(i=e+i),t){let s=this.series.indexOf(t),r=this.series.length,l=t.get("innerRadius");return l!=null?i+F(l,e-i):i+(e-i)/r*s}return i}}Object.defineProperty(_e,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PieChart"}),Object.defineProperty(_e,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:U.classNames.concat([_e.className])});class xe extends K{_makeSlices(){return new pe(ye.new({}),()=>se._new(this._root,{themeTags:be(this.slices.template.get("themeTags",[]),["pie","series"])},[this.slices.template]))}_makeLabels(){return new pe(ye.new({}),()=>ie._new(this._root,{themeTags:be(this.labels.template.get("themeTags",[]),["pie","series"])},[this.labels.template]))}_makeTicks(){return new pe(ye.new({}),()=>Se._new(this._root,{themeTags:be(this.ticks.template.get("themeTags",[]),["pie","series"])},[this.ticks.template]))}processDataItem(t){super.processDataItem(t);const e=this.makeSlice(t);e.on("scale",()=>{this._updateTick(t)}),e.on("shiftRadius",()=>{this._updateTick(t)}),e.events.on("positionchanged",()=>{this._updateTick(t)});const i=this.makeLabel(t);i.events.on("positionchanged",()=>{this._updateTick(t)}),this.makeTick(t),e.events.on("positionchanged",()=>{i.markDirty()})}_getNextUp(){const t=this.chart;return t?t._maxRadius:this.labelsContainer.maxHeight()/2}_getNextDown(){const t=this.chart;return t?-t._maxRadius:-this.labelsContainer.maxHeight()/2}_prepareChildren(){super._prepareChildren();const t=this.chart;if(t){if(this.isDirty("alignLabels")){let e=this.labels.template;if(this.get("alignLabels"))e.set("textType","aligned");else{let i=e.get("textType");i!=null&&i!="aligned"||e.set("textType","adjusted")}}if(this._valuesDirty||this.isDirty("radius")||this.isDirty("innerRadius")||this.isDirty("startAngle")||this.isDirty("endAngle")||this.isDirty("alignLabels")){this.markDirtyBounds();const e=this.get("startAngle",t.get("startAngle",-90)),i=this.get("endAngle",t.get("endAngle",270))-e;let s=e;const r=t.radius(this);this.setPrivateRaw("radius",r);let l=t.innerRadius(this)*t.getPrivate("irModifyer",1);l<0&&(l=r+l),A(this._dataItems,a=>{this.updateLegendValue(a);let y=i*a.get("valuePercentTotal")/100;const o=a.get("slice");if(o){o.set("radius",r),o.set("innerRadius",l),o.set("startAngle",s),o.set("arc",y);const h=a.get("fill");o._setDefault("fill",h),o._setDefault("stroke",h)}let n=Oe(s+y/2);const g=a.get("label");if(g&&(g.setPrivate("radius",r),g.setPrivate("innerRadius",l),g.set("labelAngle",n),g.get("textType")=="aligned")){let h=r+g.get("radius",0),c=r*O(n);n>90&&n<=270?(g.isHidden()||g.isHiding()||this._lLabels.push({label:g,y:c}),h*=-1,h-=this.labelsContainer.get("paddingLeft",0),g.set("centerX",we),g.setPrivateRaw("left",!0)):(g.isHidden()||g.isHiding()||this._rLabels.push({label:g,y:c}),h+=this.labelsContainer.get("paddingRight",0),g.set("centerX",0),g.setPrivateRaw("left",!1)),g.set("x",h),g.set("y",r*O(n))}s+=y,this._updateTick(a)})}}}_updateTick(t){const e=t.get("tick"),i=t.get("label"),s=t.get("slice"),r=e.get("location",1);if(e&&i&&s){const l=(s.get("shiftRadius",0)+s.get("radius",0))*s.get("scale",1)*r,a=i.get("labelAngle",0),y=H(a),o=O(a),n=this.labelsContainer,g=n.get("paddingLeft",0),h=n.get("paddingRight",0);let c=0,b=0;c=i.x(),b=i.y();let f=[];if(c!=0&&b!=0){if(i.get("textType")=="circular"){const m=i.radius()-i.get("paddingBottom",0),u=i.get("labelAngle",0);c=m*H(u),b=m*O(u)}let P=-h;i.getPrivate("left")&&(P=g),f=[{x:s.x()+l*y,y:s.y()+l*o},{x:c+P,y:b},{x:c,y:b}]}e.set("points",f)}}_positionBullet(t){const e=t.get("sprite");if(e){const i=e.dataItem.get("slice");if(i){const s=i.get("innerRadius",0),r=i.get("radius",0),l=i.get("startAngle",0)+i.get("arc",0)*t.get("locationX",.5),a=s+(r-s)*t.get("locationY",.5);e.setAll({x:H(l)*a,y:O(l)*a})}}}}Object.defineProperty(xe,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PieSeries"}),Object.defineProperty(xe,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:K.classNames.concat([xe.className])});export{_e as PieChartAm5,xe as PieSeriesAm5}; +import{ed as E}from"./index-BjUNJPVf.js";import{R as Te,D as Ne,U as Se,V as Ie,k as M}from"./Tick-DedlQq8S.js";import{s as Le,al as Ce,b as je,ap as v,ah as Re,ad as ae,as as Me,ar as F,at as pe,au as ye,ak as be,w as A,av as H,aw as O,ax as ve,ae as Oe,i as me,ay as Be,r as we,C as re,an as Fe,a as He}from"./Theme-6HY29PEY.js";import{s as Xe}from"./ColorSet-wEWjQ87p.js";import{l as Ye}from"./DefaultTheme-Ze4cVXuP.js";class te extends Le{constructor(){super(...arguments),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeRadialText("",this.textStyle)})}_afterNew(){super._afterNew()}_beforeChanged(){super._beforeChanged(),this._display.clear(),this.isDirty("textType")&&(this._display.textType=this.get("textType"),this.markDirtyBounds()),this.isDirty("radius")&&(this._display.radius=this.get("radius"),this.markDirtyBounds()),this.isDirty("startAngle")&&(this._display.startAngle=(this.get("startAngle",0)+90)*ve,this.markDirtyBounds()),this.isDirty("inside")&&(this._display.inside=this.get("inside"),this.markDirtyBounds()),this.isDirty("orientation")&&(this._display.orientation=this.get("orientation"),this.markDirtyBounds()),this.isDirty("kerning")&&(this._display.kerning=this.get("kerning"),this.markDirtyBounds())}}Object.defineProperty(te,"className",{enumerable:!0,configurable:!0,writable:!0,value:"RadialText"}),Object.defineProperty(te,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Le.classNames.concat([te.className])});class ie extends Ce{constructor(){super(...arguments),Object.defineProperty(this,"_flipped",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this._textKeys.push("textType","kerning"),super._afterNew()}_makeText(){this._text=this.children.push(te.new(this._root,{}))}baseRadius(){const t=this.getPrivate("radius",0),e=this.getPrivate("innerRadius",0),i=this.get("baseRadius",0);return e+F(i,t-e)}radius(){const t=this.get("inside",!1);return this.baseRadius()+this.get("radius",0)*(t?-1:1)}_updateChildren(){if(super._updateChildren(),this.isDirty("baseRadius")||this.isPrivateDirty("radius")||this.isPrivateDirty("innerRadius")||this.isDirty("labelAngle")||this.isDirty("radius")||this.isDirty("inside")||this.isDirty("orientation")||this.isDirty("textType")){const t=this.get("textType","adjusted"),e=this.get("inside",!1),i=this.get("orientation");let s=Oe(this.get("labelAngle",0));this._text.set("startAngle",this.get("labelAngle",0)),this._text.set("inside",e);const r=O(s),l=H(s);let a=this.baseRadius(),y=this.radius();if(this._display.angle=0,t=="circular")this.setAll({paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}),this._text.set("orientation",i),this._text.set("radius",y);else{a==0&&(s=0,y=0);let o=y*l,n=y*r;t=="radial"?(this.setRaw("x",o),this.setRaw("y",n),s<90||s>270||i!="auto"?(this._display.angle=s,this._flipped=!1):(this._display.angle=s+180,this._flipped=!0),this._dirty.rotation=!1):t=="adjusted"?(this.setRaw("centerX",v),this.setRaw("centerY",v),this.setRaw("x",o),this.setRaw("y",n)):t=="regular"&&(this.setRaw("x",o),this.setRaw("y",n))}this.markDirtyPosition(),this.markDirtyBounds()}}_updatePosition(){const t=this.get("textType","regular"),e=this.get("inside",!1);let i=0,s=0,r=this.get("labelAngle",0),l=this.localBounds(),a=l.right-l.left,y=l.bottom-l.top;if(t=="radial"){if(this._flipped){let o=this.get("centerX");o instanceof ae&&(a*=1-2*o.value),i=a*H(r),s=a*O(r)}}else e||t!="adjusted"||(i=a/2*H(r),s=y/2*O(r));this.setRaw("dx",i),this.setRaw("dy",s),super._updatePosition()}get text(){return this._text}}Object.defineProperty(ie,"className",{enumerable:!0,configurable:!0,writable:!0,value:"RadialLabel"}),Object.defineProperty(ie,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ce.classNames.concat([ie.className])});const Ae=Math.abs,_=Math.atan2,B=Math.cos,Ve=Math.max,fe=Math.min,C=Math.sin,$=Math.sqrt,x=1e-12,q=Math.PI,ne=q/2,ze=2*q;function We(d){return d>1?0:d<-1?q:Math.acos(d)}function Pe(d){return d>=1?ne:d<=-1?-ne:Math.asin(d)}function $e(d){return d.innerRadius}function Ue(d){return d.outerRadius}function Ke(d){return d.startAngle}function qe(d){return d.endAngle}function Je(d){return d&&d.padAngle}function Qe(d,t,e,i,s,r,l,a){var y=e-d,o=i-t,n=l-s,g=a-r,h=g*y-n*o;if(!(h*hD*D+V*V&&(S=X,I=Y),{cx:S,cy:I,x01:-n,y01:-g,x11:S*(s/T-1),y11:I*(s/T-1)}}function Ge(){var d=$e,t=Ue,e=M(0),i=null,s=Ke,r=qe,l=Je,a=null,y=Ie(o);function o(){var n,g,h=+d.apply(this,arguments),c=+t.apply(this,arguments),b=s.apply(this,arguments)-ne,f=r.apply(this,arguments)-ne,P=Ae(f-b),m=f>b;if(a||(a=n=y()),cx)if(P>ze-x)a.moveTo(c*B(b),c*C(b)),a.arc(0,0,c,b,f,!m),h>x&&(a.moveTo(h*B(f),h*C(f)),a.arc(0,0,h,f,b,m));else{var u,p,R=b,T=f,w=b,N=f,S=P,I=P,X=l.apply(this,arguments)/2,Y=X>x&&(i?+i.apply(this,arguments):$(h*h+c*c)),L=fe(Ae(c-h)/2,+e.apply(this,arguments)),k=L,D=L;if(Y>x){var V=Pe(Y/h*C(X)),le=Pe(Y/c*C(X));(S-=2*V)>x?(w+=V*=m?1:-1,N-=V):(S=0,w=N=(b+f)/2),(I-=2*le)>x?(R+=le*=m?1:-1,T-=le):(I=0,R=T=(b+f)/2)}var z=c*B(R),W=c*C(R),J=h*B(N),Q=h*C(N);if(L>x){var j,G=c*B(T),Z=c*C(T),oe=h*B(w),ue=h*C(w);if(Px?D>x?(u=ee(oe,ue,z,W,c,D,m),p=ee(G,Z,J,Q,c,D,m),a.moveTo(u.cx+u.x01,u.cy+u.y01),Dx&&S>x?k>x?(u=ee(J,Q,G,Z,h,-k,m),p=ee(z,W,oe,ue,h,-k,m),a.lineTo(u.cx+u.x01,u.cy+u.y01),k=360&&l==0&&(i=0,s=0),{x:i,y:s}}_beforeChanged(){super._beforeChanged(),(this.isDirty("radius")||this.isDirty("arc")||this.isDirty("innerRadius")||this.isDirty("startAngle")||this.isDirty("dRadius")||this.isDirty("dInnerRadius")||this.isDirty("cornerRadius")||this.isDirty("shiftRadius"))&&(this._clear=!0)}_changed(){if(super._changed(),this._clear){let t=this.get("startAngle",0),e=this.get("arc",0);const i=this._generator;e<0&&(t+=e,e*=-1),e>.1&&i.cornerRadius(this.get("cornerRadius",0)),i.context(this._display);let s=this.get("radius",0),r=this.get("innerRadius",0);s+=this.get("dRadius",0),r+=this.get("dInnerRadius",0),r<0&&(r=s+r),i({innerRadius:r,outerRadius:s,startAngle:(t+90)*ve,endAngle:(t+e+90)*ve});let l=t+e/2;this.ix=H(l),this.iy=O(l);const a=this.get("shiftRadius",0);this.setRaw("dx",this.ix*a),this.setRaw("dy",this.iy*a),this.markDirtyPosition()}}}Object.defineProperty(se,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Slice"}),Object.defineProperty(se,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:je.classNames.concat([se.className])});class Ze extends Fe{setupDefaultRules(){super.setupDefaultRules();const t=this._root.interfaceColors,e=this.rule.bind(this);e("PercentSeries").setAll({legendLabelText:"{category}",legendValueText:"{valuePercentTotal.formatNumber('0.00p')}",colors:Xe.new(this._root,{}),width:we,height:we}),e("PieChart").setAll({radius:He(80),startAngle:-90,endAngle:270}),e("PieSeries").setAll({alignLabels:!0,startAngle:-90,endAngle:270}),e("PieSeries").states.create("hidden",{endAngle:-90,opacity:0}),e("Slice",["pie"]).setAll({position:"absolute",isMeasured:!1,x:0,y:0,toggleKey:"active",tooltipText:"{category}: {valuePercentTotal.formatNumber('0.00p')}",strokeWidth:1,strokeOpacity:1,role:"figure",lineJoin:"round"}),e("Slice",["pie"]).states.create("active",{shiftRadius:20,scale:1}),e("Slice",["pie"]).states.create("hoverActive",{scale:1.04}),e("Slice",["pie"]).states.create("hover",{scale:1.04}),e("RadialLabel",["pie"]).setAll({textType:"aligned",radius:10,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",paddingTop:5,paddingBottom:5,populateText:!0}),e("Tick",["pie"]).setAll({location:1}),e("SlicedChart").setAll({paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10}),e("FunnelSeries").setAll({startLocation:0,endLocation:1,orientation:"vertical",alignLabels:!0,sequencedInterpolation:!0}),e("FunnelSlice").setAll({interactive:!0,expandDistance:0}),e("FunnelSlice").states.create("hover",{expandDistance:.15}),e("Label",["funnel"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:v}),e("Label",["funnel","horizontal"]).setAll({centerX:0,centerY:v,rotation:-90}),e("Label",["funnel","vertical"]).setAll({centerY:v,centerX:0}),e("Tick",["funnel"]).setAll({location:1}),e("FunnelSlice",["funnel","link"]).setAll({fillOpacity:.5,strokeOpacity:0,expandDistance:-.1}),e("FunnelSlice",["funnel","link","vertical"]).setAll({height:10}),e("FunnelSlice",["funnel","link","horizontal"]).setAll({width:10}),e("PyramidSeries").setAll({valueIs:"area"}),e("FunnelSlice",["pyramid","link"]).setAll({fillOpacity:.5}),e("FunnelSlice",["pyramid","link","vertical"]).setAll({height:0}),e("FunnelSlice",["pyramid","link","horizontal"]).setAll({width:0}),e("FunnelSlice",["pyramid"]).setAll({interactive:!0,expandDistance:0}),e("FunnelSlice",["pyramid"]).states.create("hover",{expandDistance:.15}),e("Label",["pyramid"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:v}),e("Label",["pyramid","horizontal"]).setAll({centerX:0,centerY:v,rotation:-90}),e("Label",["pyramid","vertical"]).setAll({centerY:v,centerX:0}),e("Tick",["pyramid"]).setAll({location:1}),e("FunnelSlice",["pictorial"]).setAll({interactive:!0,tooltipText:"{category}: {valuePercentTotal.formatNumber('0.00p')}"}),e("Label",["pictorial"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:v}),e("Label",["pictorial","horizontal"]).setAll({centerX:0,centerY:v,rotation:-90}),e("Label",["pictorial","vertical"]).setAll({centerY:v,centerX:0}),e("FunnelSlice",["pictorial","link"]).setAll({fillOpacity:.5,width:0,height:0}),e("Tick",["pictorial"]).setAll({location:.5});{const i=e("Graphics",["pictorial","background"]);i.setAll({fillOpacity:.2}),Ye(i,"fill",t,"alternativeBackground")}}}class U extends Te{_afterNew(){this._defaultThemes.push(Ze.new(this._root)),super._afterNew(),this.chartContainer.children.push(this.seriesContainer),this.seriesContainer.children.push(this.bulletsContainer)}_processSeries(t){super._processSeries(t),this.seriesContainer.children.moveValue(this.bulletsContainer,this.seriesContainer.children.length-1)}}Object.defineProperty(U,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PercentChart"}),Object.defineProperty(U,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Te.classNames.concat([U.className])});class K extends Ne{constructor(){super(...arguments),Object.defineProperty(this,"slicesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(me.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"labelsContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(me.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"ticksContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(me.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"_lLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_rLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_hLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"slices",{enumerable:!0,configurable:!0,writable:!0,value:this._makeSlices()}),Object.defineProperty(this,"labels",{enumerable:!0,configurable:!0,writable:!0,value:this._makeLabels()}),Object.defineProperty(this,"ticks",{enumerable:!0,configurable:!0,writable:!0,value:this._makeTicks()})}makeSlice(t){const e=this.slicesContainer.children.push(this.slices.make());return e.on("fill",()=>{this.updateLegendMarker(t)}),e.on("stroke",()=>{this.updateLegendMarker(t)}),e._setDataItem(t),t.set("slice",e),this.slices.push(e),e}makeLabel(t){const e=this.labelsContainer.children.push(this.labels.make());return e._setDataItem(t),t.set("label",e),this.labels.push(e),e}_shouldMakeBullet(t){return t.get("value")!=null}makeTick(t){const e=this.ticksContainer.children.push(this.ticks.make());return e._setDataItem(t),t.set("tick",e),this.ticks.push(e),e}_afterNew(){this.fields.push("category","fill"),super._afterNew()}_onDataClear(){const t=this.get("colors");t&&t.reset()}_prepareChildren(){if(super._prepareChildren(),this._lLabels=[],this._rLabels=[],this._hLabels=[],this._valuesDirty){let t=0,e=0,i=0,s=1/0,r=0;A(this._dataItems,l=>{let a=l.get("valueWorking",0);t+=a,e+=Math.abs(a)}),A(this._dataItems,l=>{let a=l.get("valueWorking",0);a>i&&(i=a),asuper.show}});return E(this,void 0,void 0,function*(){let i=[];i.push(e.show.call(this,t)),i.push(this._sequencedShowHide(!0,t)),yield Promise.all(i)})}hide(t){const e=Object.create(null,{hide:{get:()=>super.hide}});return E(this,void 0,void 0,function*(){let i=[];i.push(e.hide.call(this,t)),i.push(this._sequencedShowHide(!1,t)),yield Promise.all(i)})}_updateChildren(){super._updateChildren(),this._valuesDirty&&A(this._dataItems,t=>{t.get("label").text.markDirtyText()}),(this.isDirty("legendLabelText")||this.isDirty("legendValueText"))&&A(this._dataItems,t=>{this.updateLegendValue(t)}),this._arrange()}_arrange(){this._arrangeDown(this._lLabels),this._arrangeUp(this._lLabels),this._arrangeDown(this._rLabels),this._arrangeUp(this._rLabels),this._arrangeLeft(this._hLabels),this._arrangeRight(this._hLabels),A(this.dataItems,t=>{this._updateTick(t)})}_afterChanged(){super._afterChanged(),this._arrange()}processDataItem(t){if(super.processDataItem(t),t.get("fill")==null){let e=this.get("colors");e&&t.setRaw("fill",e.next())}}showDataItem(t,e){const i=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return E(this,void 0,void 0,function*(){const s=[i.showDataItem.call(this,t,e)];re(e)||(e=this.get("stateAnimationDuration",0));const r=this.get("stateAnimationEasing");let l=t.get("value");const a=t.animate({key:"valueWorking",to:l,duration:e,easing:r});a&&s.push(a.waitForStop());const y=t.get("tick");y&&s.push(y.show(e));const o=t.get("label");o&&s.push(o.show(e));const n=t.get("slice");n&&s.push(n.show(e)),n.get("active")&&n.states.applyAnimate("active"),yield Promise.all(s)})}hideDataItem(t,e){const i=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return E(this,void 0,void 0,function*(){const s=[i.hideDataItem.call(this,t,e)],r=this.states.create("hidden",{});re(e)||(e=r.get("stateAnimationDuration",this.get("stateAnimationDuration",0)));const l=r.get("stateAnimationEasing",this.get("stateAnimationEasing")),a=t.animate({key:"valueWorking",to:0,duration:e,easing:l});a&&s.push(a.waitForStop());const y=t.get("tick");y&&s.push(y.hide(e));const o=t.get("label");o&&s.push(o.hide(e));const n=t.get("slice");n.hideTooltip(),n&&s.push(n.hide(e)),yield Promise.all(s)})}disposeDataItem(t){super.disposeDataItem(t);let e=t.get("label");e&&(this.labels.removeValue(e),e.dispose());let i=t.get("tick");i&&(this.ticks.removeValue(i),i.dispose());let s=t.get("slice");s&&(this.slices.removeValue(s),s.dispose())}hoverDataItem(t){const e=t.get("slice");e&&!e.isHidden()&&e.hover()}unhoverDataItem(t){const e=t.get("slice");e&&e.unhover()}updateLegendMarker(t){if(t){const e=t.get("slice");if(e){const i=t.get("legendDataItem");if(i){const s=i.get("markerRectangle");A(Be,r=>{e.get(r)!=null&&s.set(r,e.get(r))})}}}}_arrangeDown(t){if(t){let e=this._getNextDown();t.sort((i,s)=>i.y>s.y?1:i.y{const s=i.label.adjustedLocalBounds();let r=s.top;i.y+ri.ys.y?-1:0),A(t,i=>{const s=i.label.adjustedLocalBounds();let r=s.bottom;i.y+r>e&&(i.y=e-r),i.label.set("y",i.y),e=i.y+s.top})}}_arrangeRight(t){if(t){let e=0;t.sort((i,s)=>i.y>s.y?1:i.y{const s=i.label.adjustedLocalBounds();let r=s.left;i.y+ri.ys.y?-1:0),A(t,i=>{const s=i.label.adjustedLocalBounds();let r=s.right;i.y+r>e&&(i.y=e-r),i.label.set("x",i.y),e=i.y+s.left})}}_updateSize(){super._updateSize(),this.markDirty()}_updateTick(t){}_dispose(){super._dispose();const t=this.chart;t&&t.series.removeValue(this)}}Object.defineProperty(K,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PercentSeries"}),Object.defineProperty(K,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ne.classNames.concat([K.className])});class _e extends U{constructor(){super(...arguments),Object.defineProperty(this,"_maxRadius",{enumerable:!0,configurable:!0,writable:!0,value:1})}_afterNew(){super._afterNew(),this.seriesContainer.setAll({x:v,y:v})}_prepareChildren(){super._prepareChildren();const t=this.chartContainer,e=t.innerWidth(),i=t.innerHeight(),s=this.get("startAngle",0),r=this.get("endAngle",0),l=this.get("innerRadius");let a=Re(0,0,s,r,1);const y=e/(a.right-a.left),o=i/(a.bottom-a.top);let n={left:0,right:0,top:0,bottom:0};if(l instanceof ae){let c=l.value,b=Math.min(y,o);c=Math.max(b*c,b-Math.min(i,e))/b,n=Re(0,0,s,r,c),this.setPrivateRaw("irModifyer",c/l.value)}a=Me([a,n]);const g=this._maxRadius;this._maxRadius=Math.min(y,o);const h=F(this.get("radius",0),this._maxRadius);this.seriesContainer.setAll({dy:-h*(a.bottom+a.top)/2,dx:-h*(a.right+a.left)/2}),(this.isDirty("startAngle")||this.isDirty("endAngle")||g!=this._maxRadius)&&this.series.each(c=>{c._markDirtyKey("startAngle")}),(this.isDirty("innerRadius")||this.isDirty("radius"))&&this.series.each(c=>{c._markDirtyKey("innerRadius")})}radius(t){let e=F(this.get("radius",0),this._maxRadius),i=F(this.get("innerRadius",0),e);if(t){let s=this.series.indexOf(t),r=this.series.length,l=t.get("radius");return l!=null?i+F(l,e-i):i+(e-i)/r*(s+1)}return e}innerRadius(t){const e=this.radius();let i=F(this.get("innerRadius",0),e);if(i<0&&(i=e+i),t){let s=this.series.indexOf(t),r=this.series.length,l=t.get("innerRadius");return l!=null?i+F(l,e-i):i+(e-i)/r*s}return i}}Object.defineProperty(_e,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PieChart"}),Object.defineProperty(_e,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:U.classNames.concat([_e.className])});class xe extends K{_makeSlices(){return new pe(ye.new({}),()=>se._new(this._root,{themeTags:be(this.slices.template.get("themeTags",[]),["pie","series"])},[this.slices.template]))}_makeLabels(){return new pe(ye.new({}),()=>ie._new(this._root,{themeTags:be(this.labels.template.get("themeTags",[]),["pie","series"])},[this.labels.template]))}_makeTicks(){return new pe(ye.new({}),()=>Se._new(this._root,{themeTags:be(this.ticks.template.get("themeTags",[]),["pie","series"])},[this.ticks.template]))}processDataItem(t){super.processDataItem(t);const e=this.makeSlice(t);e.on("scale",()=>{this._updateTick(t)}),e.on("shiftRadius",()=>{this._updateTick(t)}),e.events.on("positionchanged",()=>{this._updateTick(t)});const i=this.makeLabel(t);i.events.on("positionchanged",()=>{this._updateTick(t)}),this.makeTick(t),e.events.on("positionchanged",()=>{i.markDirty()})}_getNextUp(){const t=this.chart;return t?t._maxRadius:this.labelsContainer.maxHeight()/2}_getNextDown(){const t=this.chart;return t?-t._maxRadius:-this.labelsContainer.maxHeight()/2}_prepareChildren(){super._prepareChildren();const t=this.chart;if(t){if(this.isDirty("alignLabels")){let e=this.labels.template;if(this.get("alignLabels"))e.set("textType","aligned");else{let i=e.get("textType");i!=null&&i!="aligned"||e.set("textType","adjusted")}}if(this._valuesDirty||this.isDirty("radius")||this.isDirty("innerRadius")||this.isDirty("startAngle")||this.isDirty("endAngle")||this.isDirty("alignLabels")){this.markDirtyBounds();const e=this.get("startAngle",t.get("startAngle",-90)),i=this.get("endAngle",t.get("endAngle",270))-e;let s=e;const r=t.radius(this);this.setPrivateRaw("radius",r);let l=t.innerRadius(this)*t.getPrivate("irModifyer",1);l<0&&(l=r+l),A(this._dataItems,a=>{this.updateLegendValue(a);let y=i*a.get("valuePercentTotal")/100;const o=a.get("slice");if(o){o.set("radius",r),o.set("innerRadius",l),o.set("startAngle",s),o.set("arc",y);const h=a.get("fill");o._setDefault("fill",h),o._setDefault("stroke",h)}let n=Oe(s+y/2);const g=a.get("label");if(g&&(g.setPrivate("radius",r),g.setPrivate("innerRadius",l),g.set("labelAngle",n),g.get("textType")=="aligned")){let h=r+g.get("radius",0),c=r*O(n);n>90&&n<=270?(g.isHidden()||g.isHiding()||this._lLabels.push({label:g,y:c}),h*=-1,h-=this.labelsContainer.get("paddingLeft",0),g.set("centerX",we),g.setPrivateRaw("left",!0)):(g.isHidden()||g.isHiding()||this._rLabels.push({label:g,y:c}),h+=this.labelsContainer.get("paddingRight",0),g.set("centerX",0),g.setPrivateRaw("left",!1)),g.set("x",h),g.set("y",r*O(n))}s+=y,this._updateTick(a)})}}}_updateTick(t){const e=t.get("tick"),i=t.get("label"),s=t.get("slice"),r=e.get("location",1);if(e&&i&&s){const l=(s.get("shiftRadius",0)+s.get("radius",0))*s.get("scale",1)*r,a=i.get("labelAngle",0),y=H(a),o=O(a),n=this.labelsContainer,g=n.get("paddingLeft",0),h=n.get("paddingRight",0);let c=0,b=0;c=i.x(),b=i.y();let f=[];if(c!=0&&b!=0){if(i.get("textType")=="circular"){const m=i.radius()-i.get("paddingBottom",0),u=i.get("labelAngle",0);c=m*H(u),b=m*O(u)}let P=-h;i.getPrivate("left")&&(P=g),f=[{x:s.x()+l*y,y:s.y()+l*o},{x:c+P,y:b},{x:c,y:b}]}e.set("points",f)}}_positionBullet(t){const e=t.get("sprite");if(e){const i=e.dataItem.get("slice");if(i){const s=i.get("innerRadius",0),r=i.get("radius",0),l=i.get("startAngle",0)+i.get("arc",0)*t.get("locationX",.5),a=s+(r-s)*t.get("locationY",.5);e.setAll({x:H(l)*a,y:O(l)*a})}}}}Object.defineProperty(xe,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PieSeries"}),Object.defineProperty(xe,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:K.classNames.concat([xe.className])});export{_e as PieChartAm5,xe as PieSeriesAm5}; diff --git a/assets/plane-py4f_JCU.js b/assets/plane-DxOTtTwj.js similarity index 96% rename from assets/plane-py4f_JCU.js rename to assets/plane-DxOTtTwj.js index ee4cc28..111db57 100644 --- a/assets/plane-py4f_JCU.js +++ b/assets/plane-DxOTtTwj.js @@ -1 +1 @@ -import{cY as V,fU as $,cy as f,bj as X,gQ as F,cU as T,cx as p,cu as b}from"./index-CEWggaxV.js";import{e as x}from"./mat3f64-q3fE-ZOt.js";import{e as y}from"./mat4f64-CSKppSlJ.js";import{e as C}from"./quatf64-Bdb9ZJJK.js";class r{constructor(e){this._create=e,this._items=new Array,this._itemsPtr=0}get(){return this._itemsPtr===0&&V(()=>this._reset()),this._itemsPtr>=this._items.length&&this._items.push(this._create()),this._items[this._itemsPtr++]}_reset(){const e=2*this._itemsPtr;this._items.length>e&&(this._items.length=e),this._itemsPtr=0}static createVec2f64(){return new r($)}static createVec3f64(){return new r(f)}static createVec4f64(){return new r(X)}static createMat3f64(){return new r(x)}static createMat4f64(){return new r(y)}static createQuatf64(){return new r(C)}get test(){return{length:this._items.length}}}r.createVec2f64();const z=r.createVec3f64();r.createVec4f64();r.createMat3f64();const G=r.createMat4f64(),Z=r.createQuatf64();function L(t=Y){return[t[0],t[1],t[2],t[3]]}function d(t){return t}function Q(t,e,c,s=L()){const h=c[0]-e[0],I=c[1]-e[1],a=c[2]-e[2],i=t[0]-e[0],w=t[1]-e[1],A=t[2]-e[2],_=I*A-a*w,E=a*i-h*A,P=h*w-I*i,l=_*_+E*E+P*P,g=Math.abs(l-1)>1e-5&&l>1e-12?1/Math.sqrt(l):1;return s[0]=_*g,s[1]=E*g,s[2]=P*g,s[3]=-(s[0]*t[0]+s[1]*t[1]+s[2]*t[2]),s}function O(t,e,c,s=0,h=Math.floor(c*(1/3)),I=Math.floor(c*(2/3))){if(c<3)return!1;e(o,s);let a=h,i=!1;for(;athis._reset()),this._itemsPtr>=this._items.length&&this._items.push(this._create()),this._items[this._itemsPtr++]}_reset(){const e=2*this._itemsPtr;this._items.length>e&&(this._items.length=e),this._itemsPtr=0}static createVec2f64(){return new r($)}static createVec3f64(){return new r(f)}static createVec4f64(){return new r(X)}static createMat3f64(){return new r(x)}static createMat4f64(){return new r(y)}static createQuatf64(){return new r(C)}get test(){return{length:this._items.length}}}r.createVec2f64();const z=r.createVec3f64();r.createVec4f64();r.createMat3f64();const G=r.createMat4f64(),Z=r.createQuatf64();function L(t=Y){return[t[0],t[1],t[2],t[3]]}function d(t){return t}function Q(t,e,c,s=L()){const h=c[0]-e[0],I=c[1]-e[1],a=c[2]-e[2],i=t[0]-e[0],w=t[1]-e[1],A=t[2]-e[2],_=I*A-a*w,E=a*i-h*A,P=h*w-I*i,l=_*_+E*E+P*P,g=Math.abs(l-1)>1e-5&&l>1e-12?1/Math.sqrt(l):1;return s[0]=_*g,s[1]=E*g,s[2]=P*g,s[3]=-(s[0]*t[0]+s[1]*t[1]+s[2]*t[2]),s}function O(t,e,c,s=0,h=Math.floor(c*(1/3)),I=Math.floor(c*(2/3))){if(c<3)return!1;e(o,s);let a=h,i=!1;for(;ai.visibleFieldNames?i.visibleFieldNames.has(e.name):F(e,i);function v(e,i){const a=e;return i&&(e=e.filter(t=>!i.includes(t.type))),e===a&&(e=e.slice()),e.sort(I),e}function I(e,i){return e.type==="oid"?-1:i.type==="oid"?1:n(e)?-1:n(i)?1:(e.alias||e.name).toLocaleLowerCase().localeCompare((i.alias||i.name).toLocaleLowerCase())}function L(e,i){const a=i==null?void 0:i.visibleFieldNames;return v(e.fields??[],(i==null?void 0:i.ignoreFieldTypes)||h).map(t=>new f({fieldName:t.name,isEditable:m(t,e),label:t.alias,format:C(t),visible:y(t,{...e,visibleFieldNames:a})}))}function C(e){switch(e.type){case"small-integer":case"integer":case"single":return new s({digitSeparator:!0,places:0});case"double":return new s({digitSeparator:!0,places:2});case"string":return b(e.name)?new s({digitSeparator:!0,places:0}):null;default:return null}}function N(){return[new p,new w]}function $(e){const i=g(e),{titleBase:a}=e;return i?`${a}: {${i.trim()}}`:a??""}function n(e){return(e.name&&e.name.toLowerCase())==="name"?!0:(e.alias&&e.alias.toLowerCase())==="name"}const h=["geometry","blob","raster","guid","xml"];export{B as p}; +import{i as u,b8 as f,b9 as m,ba as b,bb as s,bc as p,bd as w,be as g,bf as F}from"./index-BjUNJPVf.js";function B({displayField:e,editFieldsInfo:i,fields:a,objectIdField:t,title:r},o){if(!a)return null;const l=L({editFieldsInfo:i,fields:a,objectIdField:t},o);if(!l.length)return null;const c=$({titleBase:r,fields:a,displayField:e}),d=N();return new u({title:c,content:d,fieldInfos:l})}const y=(e,i)=>i.visibleFieldNames?i.visibleFieldNames.has(e.name):F(e,i);function v(e,i){const a=e;return i&&(e=e.filter(t=>!i.includes(t.type))),e===a&&(e=e.slice()),e.sort(I),e}function I(e,i){return e.type==="oid"?-1:i.type==="oid"?1:n(e)?-1:n(i)?1:(e.alias||e.name).toLocaleLowerCase().localeCompare((i.alias||i.name).toLocaleLowerCase())}function L(e,i){const a=i==null?void 0:i.visibleFieldNames;return v(e.fields??[],(i==null?void 0:i.ignoreFieldTypes)||h).map(t=>new f({fieldName:t.name,isEditable:m(t,e),label:t.alias,format:C(t),visible:y(t,{...e,visibleFieldNames:a})}))}function C(e){switch(e.type){case"small-integer":case"integer":case"single":return new s({digitSeparator:!0,places:0});case"double":return new s({digitSeparator:!0,places:2});case"string":return b(e.name)?new s({digitSeparator:!0,places:0}):null;default:return null}}function N(){return[new p,new w]}function $(e){const i=g(e),{titleBase:a}=e;return i?`${a}: {${i.trim()}}`:a??""}function n(e){return(e.name&&e.name.toLowerCase())==="name"?!0:(e.alias&&e.alias.toLowerCase())==="name"}const h=["geometry","blob","raster","guid","xml"];export{B as p}; diff --git a/assets/popupUtils-BovqErR_.js b/assets/popupUtils-Do2GfZME.js similarity index 91% rename from assets/popupUtils-BovqErR_.js rename to assets/popupUtils-Do2GfZME.js index ae60b38..9d6db04 100644 --- a/assets/popupUtils-BovqErR_.js +++ b/assets/popupUtils-Do2GfZME.js @@ -1 +1 @@ -import{br as h,b6 as m}from"./index-CEWggaxV.js";async function x(e,d=e.popupTemplate){var n,o;if(d==null)return[];const s=await d.getRequiredFields(e.fieldsIndex),{lastEditInfoEnabled:r}=d,{objectIdField:u,typeIdField:i,globalIdField:p,relationships:a}=e;if(s.includes("*"))return["*"];const c=r?h(e):[],l=m(e.fieldsIndex,[...s,...c]);return i&&l.push(i),l&&u&&((n=e.fieldsIndex)!=null&&n.has(u))&&!l.includes(u)&&l.push(u),l&&p&&((o=e.fieldsIndex)!=null&&o.has(p))&&!l.includes(p)&&l.push(p),a&&a.forEach(I=>{var f;const{keyField:t}=I;l&&t&&((f=e.fieldsIndex)!=null&&f.has(t))&&!l.includes(t)&&l.push(t)}),l}function T(e,d){return e.popupTemplate?e.popupTemplate:d!=null&&d.defaultPopupTemplateEnabled&&e.defaultPopupTemplate!=null?e.defaultPopupTemplate:null}export{x as n,T as p}; +import{br as h,b6 as m}from"./index-BjUNJPVf.js";async function x(e,d=e.popupTemplate){var n,o;if(d==null)return[];const s=await d.getRequiredFields(e.fieldsIndex),{lastEditInfoEnabled:r}=d,{objectIdField:u,typeIdField:i,globalIdField:p,relationships:a}=e;if(s.includes("*"))return["*"];const c=r?h(e):[],l=m(e.fieldsIndex,[...s,...c]);return i&&l.push(i),l&&u&&((n=e.fieldsIndex)!=null&&n.has(u))&&!l.includes(u)&&l.push(u),l&&p&&((o=e.fieldsIndex)!=null&&o.has(p))&&!l.includes(p)&&l.push(p),a&&a.forEach(I=>{var f;const{keyField:t}=I;l&&t&&((f=e.fieldsIndex)!=null&&f.has(t))&&!l.includes(t)&&l.push(t)}),l}function T(e,d){return e.popupTemplate?e.popupTemplate:d!=null&&d.defaultPopupTemplateEnabled&&e.defaultPopupTemplate!=null?e.defaultPopupTemplate:null}export{x as n,T as p}; diff --git a/assets/portalLayers-B6YNSnGP.js b/assets/portalLayers-DU48R6fl.js similarity index 97% rename from assets/portalLayers-B6YNSnGP.js rename to assets/portalLayers-DU48R6fl.js index be655e9..7ae73e3 100644 --- a/assets/portalLayers-B6YNSnGP.js +++ b/assets/portalLayers-DU48R6fl.js @@ -1 +1 @@ -import{aw as h,N as g,bX as d,bZ as L}from"./index-CEWggaxV.js";import{s as N}from"./associatedFeatureServiceUtils-BIEHgyxo.js";import{t as v,a as M}from"./lazyLayerLoader-s-GqbiwM.js";class P{constructor(){this._serviceMetadatas=new Map,this._itemDatas=new Map}async fetchServiceMetadata(t,a){const r=this._serviceMetadatas.get(t);if(r)return r;const s=await v(t,a);return this._serviceMetadatas.set(t,s),s}async fetchItemData(t){const{id:a}=t;if(!a)return null;const{_itemDatas:r}=this;if(r.has(a))return r.get(a);const s=await t.fetchData();return r.set(a,s),s}async fetchCustomParameters(t,a){const r=await this.fetchItemData(t);return r&&typeof r=="object"&&(a?a(r):r.customParameters)||null}}function m(e){const t={id:e.id,name:e.name};return e.type==="Oriented Imagery Layer"&&(t.layerType="OrientedImageryLayer"),t}async function T(e,t,a){var r,s,c;if((e==null?void 0:e.layers)==null||(e==null?void 0:e.tables)==null){const i=await a.fetchServiceMetadata(t,{customParameters:(r=f(e))==null?void 0:r.customParameters});(e=e||{}).layers=e.layers||((s=i==null?void 0:i.layers)==null?void 0:s.map(m)),e.tables=e.tables||((c=i==null?void 0:i.tables)==null?void 0:c.map(m))}return e}function C(e){const{layers:t,tables:a}=e;return t!=null&&t.length?t[0].id:a!=null&&a.length?a[0].id:null}function f(e){if(!e)return null;const{layers:t,tables:a}=e;return t!=null&&t.length?t[0]:a!=null&&a.length?a[0]:null}function S(e){var t,a;return(((t=e==null?void 0:e.layers)==null?void 0:t.length)??0)+(((a=e==null?void 0:e.tables)==null?void 0:a.length)??0)}function O(e){var a;const t=[];return(a=e==null?void 0:e.layers)==null||a.forEach(r=>{r.layerType==="SubtypeGroupLayer"&&t.push(r.id)}),t}function D(e){var t;return(t=e==null?void 0:e.layers)==null?void 0:t.filter(({layerType:a})=>a==="OrientedImageryLayer").map(({id:a})=>a)}function G(e){var t;return(t=e==null?void 0:e.layers)==null?void 0:t.filter(({layerType:a})=>a==="CatalogLayer").map(({id:a})=>a)}async function F(e,t,a){var c,i,l,u;if(!(e!=null&&e.url))return t??{};if(t??(t={}),!t.layers){const n=await a.fetchServiceMetadata(e.url);t.layers=(c=n.layers)==null?void 0:c.map(m)}const{serverUrl:r,portalItem:s}=await N(e.url,{sceneLayerItem:e,customParameters:(i=f(t))==null?void 0:i.customParameters}).catch(()=>({serverUrl:null,portalItem:null}));if(r==null)return t.tables=[],t;if(!t.tables&&s){const n=await s.fetchData();if(n!=null&&n.tables)t.tables=n.tables.map(m);else{const o=await a.fetchServiceMetadata(r,{customParameters:(l=f(n))==null?void 0:l.customParameters});t.tables=(u=o==null?void 0:o.tables)==null?void 0:u.map(m)}}if(t.tables)for(const n of t.tables)n.url=`${r}/${n.id}`;return t}async function _(e){!e.portalItem||e.portalItem instanceof h||(e={...e,portalItem:new h(e.portalItem)});const t=await $(e.portalItem);return new t.constructor({portalItem:e.portalItem,...t.properties})}async function $(e){await e.load();const t=new P;return j(await I(e,t))}async function I(e,t){switch(e.type){case"3DTiles Service":return E();case"CSV":return R();case"Feature Collection":return K(e);case"Feature Service":return W(e,t);case"Feed":return B();case"GeoJson":return A();case"Group Layer":return H();case"Image Service":return U(e,t);case"KML":return z();case"Map Service":return V(e,t);case"Media Layer":return Q();case"Scene Service":return J(e,t);case"Stream Service":return k();case"Vector Tile Service":return x();case"WFS":return X();case"WMS":return Z();case"WMTS":return q();default:throw new g("portal:unknown-item-type","Unknown item type '${type}'",{type:e.type})}}async function j(e){const t=e.className,a=M[t];return{constructor:await a(),properties:e.properties}}async function V(e,t){return await Y(e,t)?{className:"TileLayer"}:{className:"MapImageLayer"}}async function W(e,t){const a=await b(e,t);if(typeof a=="object"){const{sourceJSON:r,className:s}=a,c={sourceJSON:r};return a.id!=null&&(c.layerId=a.id),{className:s||"FeatureLayer",properties:c}}return{className:"GroupLayer"}}async function J(e,t){var r;const a=await b(e,t,async()=>{try{if(!e.url)return[];const{serverUrl:s}=await N(e.url,{sceneLayerItem:e}),c=await t.fetchServiceMetadata(s);return(c==null?void 0:c.tables)??[]}catch{return[]}});if(typeof a=="object"){const s={};let c;if(a.id!=null?(s.layerId=a.id,c=`${e.url}/layers/${a.id}`):c=e.url,(r=e.typeKeywords)==null?void 0:r.length){for(const l of Object.keys(d))if(e.typeKeywords.includes(l))return{className:d[l]}}const i=await t.fetchServiceMetadata(c,{customParameters:await t.fetchCustomParameters(e,l=>{var u;return(u=f(l))==null?void 0:u.customParameters})});return{className:d[i==null?void 0:i.layerType]||"SceneLayer",properties:s}}if(a===!1){const s=await t.fetchServiceMetadata(e.url);if((s==null?void 0:s.layerType)==="Voxel")return{className:"VoxelLayer"}}return{className:"GroupLayer"}}async function K(e){await e.load();const t=L(e,"Map Notes"),a=L(e,"Markup");if(t||a)return{className:"MapNotesLayer"};if(L(e,"Route Layer"))return{className:"RouteLayer"};const r=await e.fetchData();return S(r)===1?{className:"FeatureLayer"}:{className:"GroupLayer"}}async function U(e,t){var u,n,o;await e.load();const a=((u=e.typeKeywords)==null?void 0:u.map(y=>y.toLowerCase()))??[];if(a.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(a.includes("tiled imagery"))return{className:"ImageryTileLayer"};const r=await t.fetchItemData(e),s=r==null?void 0:r.layerType;if(s==="ArcGISTiledImageServiceLayer")return{className:"ImageryTileLayer"};if(s==="ArcGISImageServiceLayer")return{className:"ImageryLayer"};const c=await t.fetchServiceMetadata(e.url,{customParameters:await t.fetchCustomParameters(e)}),i=(n=c.cacheType)==null?void 0:n.toLowerCase(),l=(o=c.capabilities)==null?void 0:o.toLowerCase().includes("tilesonly");return i==="map"||l?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}function k(){return{className:"StreamLayer"}}function x(){return{className:"VectorTileLayer"}}function A(){return{className:"GeoJSONLayer"}}function E(){return{className:"IntegratedMesh3DTilesLayer"}}function R(){return{className:"CSVLayer"}}function z(){return{className:"KMLLayer"}}function X(){return{className:"WFSLayer"}}function Z(){return{className:"WMSLayer"}}function q(){return{className:"WMTSLayer"}}function B(){return{className:"StreamLayer"}}function H(){return{className:"GroupLayer"}}function Q(){return{className:"MediaLayer"}}async function Y(e,t){const{tileInfo:a}=await t.fetchServiceMetadata(e.url,{customParameters:await t.fetchCustomParameters(e)});return a}async function b(e,t,a){const{url:r,type:s}=e,c=s==="Feature Service";if(!r)return{};if(/\/\d+$/.test(r)){if(c){const u=await t.fetchServiceMetadata(r,{customParameters:await t.fetchCustomParameters(e,n=>{var o;return(o=f(n))==null?void 0:o.customParameters})});if(u.type==="Oriented Imagery Layer")return{id:u.id,className:"OrientedImageryLayer",sourceJSON:u}}return{}}await e.load();let i=await t.fetchItemData(e);if(c){const u=await T(i,r,t),n=w(u);if(typeof n=="object"){const o=O(u),y=D(u),p=G(u);n.className=n.id!=null&&o.includes(n.id)?"SubtypeGroupLayer":n.id!=null&&(y!=null&&y.includes(n.id))?"OrientedImageryLayer":n.id!=null&&(p!=null&&p.includes(n.id))?"CatalogLayer":"FeatureLayer"}return n}if(s==="Scene Service"&&(i=await F(e,i,t)),S(i)>0)return w(i);const l=await t.fetchServiceMetadata(r);return a&&(l.tables=await a()),w(l)}function w(e){return S(e)===1&&{id:C(e)}}const re=Object.freeze(Object.defineProperty({__proto__:null,fromItem:_,selectLayerClassPath:I},Symbol.toStringTag,{value:"Module"}));export{T as a,F as c,P as e,G as i,f as l,O as n,re as p,C as r,S as s,m as t,D as u,I as w}; +import{aw as h,N as g,bX as d,bZ as L}from"./index-BjUNJPVf.js";import{s as N}from"./associatedFeatureServiceUtils-nLeTqfYC.js";import{t as v,a as M}from"./lazyLayerLoader-Cu0XtDD2.js";class P{constructor(){this._serviceMetadatas=new Map,this._itemDatas=new Map}async fetchServiceMetadata(t,a){const r=this._serviceMetadatas.get(t);if(r)return r;const s=await v(t,a);return this._serviceMetadatas.set(t,s),s}async fetchItemData(t){const{id:a}=t;if(!a)return null;const{_itemDatas:r}=this;if(r.has(a))return r.get(a);const s=await t.fetchData();return r.set(a,s),s}async fetchCustomParameters(t,a){const r=await this.fetchItemData(t);return r&&typeof r=="object"&&(a?a(r):r.customParameters)||null}}function m(e){const t={id:e.id,name:e.name};return e.type==="Oriented Imagery Layer"&&(t.layerType="OrientedImageryLayer"),t}async function T(e,t,a){var r,s,c;if((e==null?void 0:e.layers)==null||(e==null?void 0:e.tables)==null){const i=await a.fetchServiceMetadata(t,{customParameters:(r=f(e))==null?void 0:r.customParameters});(e=e||{}).layers=e.layers||((s=i==null?void 0:i.layers)==null?void 0:s.map(m)),e.tables=e.tables||((c=i==null?void 0:i.tables)==null?void 0:c.map(m))}return e}function C(e){const{layers:t,tables:a}=e;return t!=null&&t.length?t[0].id:a!=null&&a.length?a[0].id:null}function f(e){if(!e)return null;const{layers:t,tables:a}=e;return t!=null&&t.length?t[0]:a!=null&&a.length?a[0]:null}function S(e){var t,a;return(((t=e==null?void 0:e.layers)==null?void 0:t.length)??0)+(((a=e==null?void 0:e.tables)==null?void 0:a.length)??0)}function O(e){var a;const t=[];return(a=e==null?void 0:e.layers)==null||a.forEach(r=>{r.layerType==="SubtypeGroupLayer"&&t.push(r.id)}),t}function D(e){var t;return(t=e==null?void 0:e.layers)==null?void 0:t.filter(({layerType:a})=>a==="OrientedImageryLayer").map(({id:a})=>a)}function G(e){var t;return(t=e==null?void 0:e.layers)==null?void 0:t.filter(({layerType:a})=>a==="CatalogLayer").map(({id:a})=>a)}async function F(e,t,a){var c,i,l,u;if(!(e!=null&&e.url))return t??{};if(t??(t={}),!t.layers){const n=await a.fetchServiceMetadata(e.url);t.layers=(c=n.layers)==null?void 0:c.map(m)}const{serverUrl:r,portalItem:s}=await N(e.url,{sceneLayerItem:e,customParameters:(i=f(t))==null?void 0:i.customParameters}).catch(()=>({serverUrl:null,portalItem:null}));if(r==null)return t.tables=[],t;if(!t.tables&&s){const n=await s.fetchData();if(n!=null&&n.tables)t.tables=n.tables.map(m);else{const o=await a.fetchServiceMetadata(r,{customParameters:(l=f(n))==null?void 0:l.customParameters});t.tables=(u=o==null?void 0:o.tables)==null?void 0:u.map(m)}}if(t.tables)for(const n of t.tables)n.url=`${r}/${n.id}`;return t}async function _(e){!e.portalItem||e.portalItem instanceof h||(e={...e,portalItem:new h(e.portalItem)});const t=await $(e.portalItem);return new t.constructor({portalItem:e.portalItem,...t.properties})}async function $(e){await e.load();const t=new P;return j(await I(e,t))}async function I(e,t){switch(e.type){case"3DTiles Service":return E();case"CSV":return R();case"Feature Collection":return K(e);case"Feature Service":return W(e,t);case"Feed":return B();case"GeoJson":return A();case"Group Layer":return H();case"Image Service":return U(e,t);case"KML":return z();case"Map Service":return V(e,t);case"Media Layer":return Q();case"Scene Service":return J(e,t);case"Stream Service":return k();case"Vector Tile Service":return x();case"WFS":return X();case"WMS":return Z();case"WMTS":return q();default:throw new g("portal:unknown-item-type","Unknown item type '${type}'",{type:e.type})}}async function j(e){const t=e.className,a=M[t];return{constructor:await a(),properties:e.properties}}async function V(e,t){return await Y(e,t)?{className:"TileLayer"}:{className:"MapImageLayer"}}async function W(e,t){const a=await b(e,t);if(typeof a=="object"){const{sourceJSON:r,className:s}=a,c={sourceJSON:r};return a.id!=null&&(c.layerId=a.id),{className:s||"FeatureLayer",properties:c}}return{className:"GroupLayer"}}async function J(e,t){var r;const a=await b(e,t,async()=>{try{if(!e.url)return[];const{serverUrl:s}=await N(e.url,{sceneLayerItem:e}),c=await t.fetchServiceMetadata(s);return(c==null?void 0:c.tables)??[]}catch{return[]}});if(typeof a=="object"){const s={};let c;if(a.id!=null?(s.layerId=a.id,c=`${e.url}/layers/${a.id}`):c=e.url,(r=e.typeKeywords)==null?void 0:r.length){for(const l of Object.keys(d))if(e.typeKeywords.includes(l))return{className:d[l]}}const i=await t.fetchServiceMetadata(c,{customParameters:await t.fetchCustomParameters(e,l=>{var u;return(u=f(l))==null?void 0:u.customParameters})});return{className:d[i==null?void 0:i.layerType]||"SceneLayer",properties:s}}if(a===!1){const s=await t.fetchServiceMetadata(e.url);if((s==null?void 0:s.layerType)==="Voxel")return{className:"VoxelLayer"}}return{className:"GroupLayer"}}async function K(e){await e.load();const t=L(e,"Map Notes"),a=L(e,"Markup");if(t||a)return{className:"MapNotesLayer"};if(L(e,"Route Layer"))return{className:"RouteLayer"};const r=await e.fetchData();return S(r)===1?{className:"FeatureLayer"}:{className:"GroupLayer"}}async function U(e,t){var u,n,o;await e.load();const a=((u=e.typeKeywords)==null?void 0:u.map(y=>y.toLowerCase()))??[];if(a.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(a.includes("tiled imagery"))return{className:"ImageryTileLayer"};const r=await t.fetchItemData(e),s=r==null?void 0:r.layerType;if(s==="ArcGISTiledImageServiceLayer")return{className:"ImageryTileLayer"};if(s==="ArcGISImageServiceLayer")return{className:"ImageryLayer"};const c=await t.fetchServiceMetadata(e.url,{customParameters:await t.fetchCustomParameters(e)}),i=(n=c.cacheType)==null?void 0:n.toLowerCase(),l=(o=c.capabilities)==null?void 0:o.toLowerCase().includes("tilesonly");return i==="map"||l?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}function k(){return{className:"StreamLayer"}}function x(){return{className:"VectorTileLayer"}}function A(){return{className:"GeoJSONLayer"}}function E(){return{className:"IntegratedMesh3DTilesLayer"}}function R(){return{className:"CSVLayer"}}function z(){return{className:"KMLLayer"}}function X(){return{className:"WFSLayer"}}function Z(){return{className:"WMSLayer"}}function q(){return{className:"WMTSLayer"}}function B(){return{className:"StreamLayer"}}function H(){return{className:"GroupLayer"}}function Q(){return{className:"MediaLayer"}}async function Y(e,t){const{tileInfo:a}=await t.fetchServiceMetadata(e.url,{customParameters:await t.fetchCustomParameters(e)});return a}async function b(e,t,a){const{url:r,type:s}=e,c=s==="Feature Service";if(!r)return{};if(/\/\d+$/.test(r)){if(c){const u=await t.fetchServiceMetadata(r,{customParameters:await t.fetchCustomParameters(e,n=>{var o;return(o=f(n))==null?void 0:o.customParameters})});if(u.type==="Oriented Imagery Layer")return{id:u.id,className:"OrientedImageryLayer",sourceJSON:u}}return{}}await e.load();let i=await t.fetchItemData(e);if(c){const u=await T(i,r,t),n=w(u);if(typeof n=="object"){const o=O(u),y=D(u),p=G(u);n.className=n.id!=null&&o.includes(n.id)?"SubtypeGroupLayer":n.id!=null&&(y!=null&&y.includes(n.id))?"OrientedImageryLayer":n.id!=null&&(p!=null&&p.includes(n.id))?"CatalogLayer":"FeatureLayer"}return n}if(s==="Scene Service"&&(i=await F(e,i,t)),S(i)>0)return w(i);const l=await t.fetchServiceMetadata(r);return a&&(l.tables=await a()),w(l)}function w(e){return S(e)===1&&{id:C(e)}}const re=Object.freeze(Object.defineProperty({__proto__:null,fromItem:_,selectLayerClassPath:I},Symbol.toStringTag,{value:"Module"}));export{T as a,F as c,P as e,G as i,f as l,O as n,re as p,C as r,S as s,m as t,D as u,I as w}; diff --git a/assets/portalUtils-ApkRv-Dr.js b/assets/portalUtils-ApkRv-Dr.js new file mode 100644 index 0000000..c04246a --- /dev/null +++ b/assets/portalUtils-ApkRv-Dr.js @@ -0,0 +1 @@ +import{ax as u}from"./index-BjUNJPVf.js";function l(r,n){return r===null?n:new u({url:r.field("url")})}export{l}; diff --git a/assets/portalUtils-mNGSLeDa.js b/assets/portalUtils-mNGSLeDa.js deleted file mode 100644 index 03d4d6f..0000000 --- a/assets/portalUtils-mNGSLeDa.js +++ /dev/null @@ -1 +0,0 @@ -import{ax as u}from"./index-CEWggaxV.js";function l(r,n){return r===null?n:new u({url:r.field("url")})}export{l}; diff --git a/assets/project-DmZZCyH4.js b/assets/project-DaC2Outd.js similarity index 94% rename from assets/project-DmZZCyH4.js rename to assets/project-DaC2Outd.js index 4b2d038..e9969fa 100644 --- a/assets/project-DmZZCyH4.js +++ b/assets/project-DaC2Outd.js @@ -1 +1 @@ -import{d as s,y as i,f as l,aU as h,dP as n,cF as f,aT as S,aW as g,ep as y,M as R,fr as w}from"./index-CEWggaxV.js";let e=class extends h{constructor(o){super(o),this.geometries=[],this.outSpatialReference=null,this.transformation=null,this.transformForward=null}toJSON(){const o=this.geometries.map(a=>a.toJSON()),t=this.geometries[0],r={};return r.outSR=n(this.outSpatialReference),r.inSR=n(t.spatialReference),r.geometries=JSON.stringify({geometryType:f(t),geometries:o}),this.transformation&&(r.transformation=this.transformation.wkid||JSON.stringify(this.transformation)),this.transformForward!=null&&(r.transformForward=this.transformForward),r}};s([i()],e.prototype,"geometries",void 0),s([i({json:{read:{source:"outSR"}}})],e.prototype,"outSpatialReference",void 0),s([i()],e.prototype,"transformation",void 0),s([i()],e.prototype,"transformForward",void 0),e=s([l("esri.rest.support.ProjectParameters")],e);const F=e,j=S(F);async function N(o,t,r){t=j(t);const a=g(o),p={...a.query,f:"json",...t.toJSON()},c=t.outSpatialReference,m=f(t.geometries[0]),u=y(p,r);return R(a.path+"/project",u).then(({data:{geometries:d}})=>w(d,m,c))}export{N as n,F as p}; +import{d as s,y as i,f as l,aU as h,dP as n,cF as f,aT as S,aW as g,ep as y,M as R,fr as w}from"./index-BjUNJPVf.js";let e=class extends h{constructor(o){super(o),this.geometries=[],this.outSpatialReference=null,this.transformation=null,this.transformForward=null}toJSON(){const o=this.geometries.map(a=>a.toJSON()),t=this.geometries[0],r={};return r.outSR=n(this.outSpatialReference),r.inSR=n(t.spatialReference),r.geometries=JSON.stringify({geometryType:f(t),geometries:o}),this.transformation&&(r.transformation=this.transformation.wkid||JSON.stringify(this.transformation)),this.transformForward!=null&&(r.transformForward=this.transformForward),r}};s([i()],e.prototype,"geometries",void 0),s([i({json:{read:{source:"outSR"}}})],e.prototype,"outSpatialReference",void 0),s([i()],e.prototype,"transformation",void 0),s([i()],e.prototype,"transformForward",void 0),e=s([l("esri.rest.support.ProjectParameters")],e);const F=e,j=S(F);async function N(o,t,r){t=j(t);const a=g(o),p={...a.query,f:"json",...t.toJSON()},c=t.outSpatialReference,m=f(t.geometries[0]),u=y(p,r);return R(a.path+"/project",u).then(({data:{geometries:d}})=>w(d,m,c))}export{N as n,F as p}; diff --git a/assets/quantizationUtils-CUjGHrU3.js b/assets/quantizationUtils-CfV316jZ.js similarity index 95% rename from assets/quantizationUtils-CUjGHrU3.js rename to assets/quantizationUtils-CfV316jZ.js index dd5be88..ba457a4 100644 --- a/assets/quantizationUtils-CUjGHrU3.js +++ b/assets/quantizationUtils-CfV316jZ.js @@ -1 +1 @@ -import"./index-CEWggaxV.js";const s=(t,r,n)=>[r,n],i=(t,r,n)=>[r,n,t[2]],f=(t,r,n)=>[r,n,t[2],t[3]];function A(t){return t?{originPosition:t.originPosition==="upper-left"?"upperLeft":t.originPosition==="lower-left"?"lowerLeft":t.originPosition,scale:t.tolerance?[t.tolerance,t.tolerance]:[1,1],translate:t.extent!=null?[t.extent.xmin,t.extent.ymax]:[0,0]}:null}function y({scale:t,translate:r},n){return Math.round((n-r[0])/t[0])}function z({scale:t,translate:r},n){return Math.round((r[1]-n)/t[1])}function g({scale:t,translate:r},n){return n*t[0]+r[0]}function p({scale:t,translate:r},n){return r[1]-n*t[1]}function x(t,r,n){const o=new Array(n.length);if(!n.length)return o;const[u,m]=t.scale;let l=g(t,n[0][0]),c=p(t,n[0][1]);o[0]=r(n[0],l,c);for(let e=1;e[r,n],i=(t,r,n)=>[r,n,t[2]],f=(t,r,n)=>[r,n,t[2],t[3]];function A(t){return t?{originPosition:t.originPosition==="upper-left"?"upperLeft":t.originPosition==="lower-left"?"lowerLeft":t.originPosition,scale:t.tolerance?[t.tolerance,t.tolerance]:[1,1],translate:t.extent!=null?[t.extent.xmin,t.extent.ymax]:[0,0]}:null}function y({scale:t,translate:r},n){return Math.round((n-r[0])/t[0])}function z({scale:t,translate:r},n){return Math.round((r[1]-n)/t[1])}function g({scale:t,translate:r},n){return n*t[0]+r[0]}function p({scale:t,translate:r},n){return r[1]-n*t[1]}function x(t,r,n){const o=new Array(n.length);if(!n.length)return o;const[u,m]=t.scale;let l=g(t,n[0][0]),c=p(t,n[0][1]);o[0]=r(n[0],l,c);for(let e=1;eI()?(a[0]=c[0]/o,a[1]=c[1]/o,a[2]=c[2]/o):(a[0]=1,a[1]=0,a[2]=0),r}function j(a,c,r){const o=c[0],s=c[1],e=c[2],t=c[3],i=r[0],u=r[1],n=r[2],h=r[3];return a[0]=o*h+t*i+s*n-e*u,a[1]=s*h+t*u+e*i-o*n,a[2]=e*h+t*n+o*u-s*i,a[3]=t*h-o*i-s*u-e*n,a}function Q(a,c,r){r*=.5;const o=c[0],s=c[1],e=c[2],t=c[3],i=Math.sin(r),u=Math.cos(r);return a[0]=o*u+t*i,a[1]=s*u+e*i,a[2]=e*u-s*i,a[3]=t*u-o*i,a}function R(a,c,r){r*=.5;const o=c[0],s=c[1],e=c[2],t=c[3],i=Math.sin(r),u=Math.cos(r);return a[0]=o*u-e*i,a[1]=s*u+t*i,a[2]=e*u+o*i,a[3]=t*u-s*i,a}function U(a,c,r){r*=.5;const o=c[0],s=c[1],e=c[2],t=c[3],i=Math.sin(r),u=Math.cos(r);return a[0]=o*u+s*i,a[1]=s*u-o*i,a[2]=e*u+t*i,a[3]=t*u-e*i,a}function V(a,c){const r=c[0],o=c[1],s=c[2];return a[0]=r,a[1]=o,a[2]=s,a[3]=Math.sqrt(Math.abs(1-r*r-o*o-s*s)),a}function d(a,c,r,o){const s=c[0],e=c[1],t=c[2],i=c[3];let u,n,h,l,f,m=r[0],$=r[1],p=r[2],q=r[3];return n=s*m+e*$+t*p+i*q,n<0&&(n=-n,m=-m,$=-$,p=-p,q=-q),1-n>I()?(u=Math.acos(n),h=Math.sin(u),l=Math.sin((1-o)*u)/h,f=Math.sin(o*u)/h):(l=1-o,f=o),a[0]=l*s+f*m,a[1]=l*e+f*$,a[2]=l*t+f*p,a[3]=l*i+f*q,a}function aa(a){const c=J,r=c(),o=c(),s=c(),e=Math.sqrt(1-r),t=Math.sqrt(r);return a[0]=e*Math.sin(2*Math.PI*o),a[1]=e*Math.cos(2*Math.PI*o),a[2]=t*Math.sin(2*Math.PI*s),a[3]=t*Math.cos(2*Math.PI*s),a}function ca(a,c){const r=c[0],o=c[1],s=c[2],e=c[3],t=r*r+o*o+s*s+e*e,i=t?1/t:0;return a[0]=-r*i,a[1]=-o*i,a[2]=-s*i,a[3]=e*i,a}function oa(a,c){return a[0]=-c[0],a[1]=-c[1],a[2]=-c[2],a[3]=c[3],a}function z(a,c){const r=c[0]+c[4]+c[8];let o;if(r>0)o=Math.sqrt(r+1),a[3]=.5*o,o=.5/o,a[0]=(c[5]-c[7])*o,a[1]=(c[6]-c[2])*o,a[2]=(c[1]-c[3])*o;else{let s=0;c[4]>c[0]&&(s=1),c[8]>c[3*s+s]&&(s=2);const e=(s+1)%3,t=(s+2)%3;o=Math.sqrt(c[3*s+s]-c[3*e+e]-c[3*t+t]+1),a[s]=.5*o,o=.5/o,a[3]=(c[3*e+t]-c[3*t+e])*o,a[e]=(c[3*e+s]+c[3*s+e])*o,a[t]=(c[3*t+s]+c[3*s+t])*o}return a}function sa(a,c,r,o){const s=.5*Math.PI/180;c*=s,r*=s,o*=s;const e=Math.sin(c),t=Math.cos(c),i=Math.sin(r),u=Math.cos(r),n=Math.sin(o),h=Math.cos(o);return a[0]=e*u*h-t*i*n,a[1]=t*i*h+e*u*n,a[2]=t*u*n-e*i*h,a[3]=t*u*h+e*i*n,a}function ra(a){return"quat("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+")"}const ea=O,ta=S,ia=T,ua=j,na=Y,ha=k,Ma=w,v=W,la=v,E=X,fa=E,y=Z,ma=B,$a=C;function pa(a,c,r){const o=D(c,r);return o<-.999999?(g(M,qa,c),F(M)<1e-6&&g(M,da,c),G(M,M),b(a,M,Math.PI),a):o>.999999?(a[0]=0,a[1]=0,a[2]=0,a[3]=1,a):(g(M,c,r),a[0]=M[0],a[1]=M[1],a[2]=M[2],a[3]=1+o,y(a,a))}const M=H(),qa=_(1,0,0),da=_(0,1,0);function ga(a,c,r,o,s,e){return d(P,c,s,e),d(x,r,o,e),d(a,P,x,2*e*(1-e)),a}const P=A(),x=A();function ya(a,c,r,o){const s=Pa;return s[0]=r[0],s[3]=r[1],s[6]=r[2],s[1]=o[0],s[4]=o[1],s[7]=o[2],s[2]=-c[0],s[5]=-c[1],s[8]=-c[2],y(a,z(a,s))}const Pa=L();Object.freeze(Object.defineProperty({__proto__:null,add:ia,calculateW:V,conjugate:oa,copy:ea,dot:ha,equals:$a,exactEquals:ma,fromEuler:sa,fromMat3:z,getAxisAngle:N,identity:K,invert:ca,len:la,length:v,lerp:Ma,mul:ua,multiply:j,normalize:y,random:aa,rotateX:Q,rotateY:R,rotateZ:U,rotationTo:pa,scale:na,set:ta,setAxes:ya,setAxisAngle:b,slerp:d,sqlerp:ga,sqrLen:fa,squaredLength:E,str:ra},Symbol.toStringTag,{value:"Module"}));export{b as I,ma as N,oa as O,sa as T,ta as X,N as v,j as x}; +import{e as L}from"./mat3f64-q3fE-ZOt.js";import{e as A}from"./quatf64-Bdb9ZJJK.js";import{cj as I,ck as O,cl as S,cm as T,cn as Y,co as k,bi as w,cp as W,cq as X,cr as Z,cs as B,ct as C,cu as D,cv as g,cw as F,cx as G,cy as H,cz as _,cA as J}from"./index-BjUNJPVf.js";function K(a){return a[0]=0,a[1]=0,a[2]=0,a[3]=1,a}function b(a,c,r){r*=.5;const o=Math.sin(r);return a[0]=o*c[0],a[1]=o*c[1],a[2]=o*c[2],a[3]=Math.cos(r),a}function N(a,c){const r=2*Math.acos(c[3]),o=Math.sin(r/2);return o>I()?(a[0]=c[0]/o,a[1]=c[1]/o,a[2]=c[2]/o):(a[0]=1,a[1]=0,a[2]=0),r}function j(a,c,r){const o=c[0],s=c[1],e=c[2],t=c[3],i=r[0],u=r[1],n=r[2],h=r[3];return a[0]=o*h+t*i+s*n-e*u,a[1]=s*h+t*u+e*i-o*n,a[2]=e*h+t*n+o*u-s*i,a[3]=t*h-o*i-s*u-e*n,a}function Q(a,c,r){r*=.5;const o=c[0],s=c[1],e=c[2],t=c[3],i=Math.sin(r),u=Math.cos(r);return a[0]=o*u+t*i,a[1]=s*u+e*i,a[2]=e*u-s*i,a[3]=t*u-o*i,a}function R(a,c,r){r*=.5;const o=c[0],s=c[1],e=c[2],t=c[3],i=Math.sin(r),u=Math.cos(r);return a[0]=o*u-e*i,a[1]=s*u+t*i,a[2]=e*u+o*i,a[3]=t*u-s*i,a}function U(a,c,r){r*=.5;const o=c[0],s=c[1],e=c[2],t=c[3],i=Math.sin(r),u=Math.cos(r);return a[0]=o*u+s*i,a[1]=s*u-o*i,a[2]=e*u+t*i,a[3]=t*u-e*i,a}function V(a,c){const r=c[0],o=c[1],s=c[2];return a[0]=r,a[1]=o,a[2]=s,a[3]=Math.sqrt(Math.abs(1-r*r-o*o-s*s)),a}function d(a,c,r,o){const s=c[0],e=c[1],t=c[2],i=c[3];let u,n,h,l,f,m=r[0],$=r[1],p=r[2],q=r[3];return n=s*m+e*$+t*p+i*q,n<0&&(n=-n,m=-m,$=-$,p=-p,q=-q),1-n>I()?(u=Math.acos(n),h=Math.sin(u),l=Math.sin((1-o)*u)/h,f=Math.sin(o*u)/h):(l=1-o,f=o),a[0]=l*s+f*m,a[1]=l*e+f*$,a[2]=l*t+f*p,a[3]=l*i+f*q,a}function aa(a){const c=J,r=c(),o=c(),s=c(),e=Math.sqrt(1-r),t=Math.sqrt(r);return a[0]=e*Math.sin(2*Math.PI*o),a[1]=e*Math.cos(2*Math.PI*o),a[2]=t*Math.sin(2*Math.PI*s),a[3]=t*Math.cos(2*Math.PI*s),a}function ca(a,c){const r=c[0],o=c[1],s=c[2],e=c[3],t=r*r+o*o+s*s+e*e,i=t?1/t:0;return a[0]=-r*i,a[1]=-o*i,a[2]=-s*i,a[3]=e*i,a}function oa(a,c){return a[0]=-c[0],a[1]=-c[1],a[2]=-c[2],a[3]=c[3],a}function z(a,c){const r=c[0]+c[4]+c[8];let o;if(r>0)o=Math.sqrt(r+1),a[3]=.5*o,o=.5/o,a[0]=(c[5]-c[7])*o,a[1]=(c[6]-c[2])*o,a[2]=(c[1]-c[3])*o;else{let s=0;c[4]>c[0]&&(s=1),c[8]>c[3*s+s]&&(s=2);const e=(s+1)%3,t=(s+2)%3;o=Math.sqrt(c[3*s+s]-c[3*e+e]-c[3*t+t]+1),a[s]=.5*o,o=.5/o,a[3]=(c[3*e+t]-c[3*t+e])*o,a[e]=(c[3*e+s]+c[3*s+e])*o,a[t]=(c[3*t+s]+c[3*s+t])*o}return a}function sa(a,c,r,o){const s=.5*Math.PI/180;c*=s,r*=s,o*=s;const e=Math.sin(c),t=Math.cos(c),i=Math.sin(r),u=Math.cos(r),n=Math.sin(o),h=Math.cos(o);return a[0]=e*u*h-t*i*n,a[1]=t*i*h+e*u*n,a[2]=t*u*n-e*i*h,a[3]=t*u*h+e*i*n,a}function ra(a){return"quat("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+")"}const ea=O,ta=S,ia=T,ua=j,na=Y,ha=k,Ma=w,v=W,la=v,E=X,fa=E,y=Z,ma=B,$a=C;function pa(a,c,r){const o=D(c,r);return o<-.999999?(g(M,qa,c),F(M)<1e-6&&g(M,da,c),G(M,M),b(a,M,Math.PI),a):o>.999999?(a[0]=0,a[1]=0,a[2]=0,a[3]=1,a):(g(M,c,r),a[0]=M[0],a[1]=M[1],a[2]=M[2],a[3]=1+o,y(a,a))}const M=H(),qa=_(1,0,0),da=_(0,1,0);function ga(a,c,r,o,s,e){return d(P,c,s,e),d(x,r,o,e),d(a,P,x,2*e*(1-e)),a}const P=A(),x=A();function ya(a,c,r,o){const s=Pa;return s[0]=r[0],s[3]=r[1],s[6]=r[2],s[1]=o[0],s[4]=o[1],s[7]=o[2],s[2]=-c[0],s[5]=-c[1],s[8]=-c[2],y(a,z(a,s))}const Pa=L();Object.freeze(Object.defineProperty({__proto__:null,add:ia,calculateW:V,conjugate:oa,copy:ea,dot:ha,equals:$a,exactEquals:ma,fromEuler:sa,fromMat3:z,getAxisAngle:N,identity:K,invert:ca,len:la,length:v,lerp:Ma,mul:ua,multiply:j,normalize:y,random:aa,rotateX:Q,rotateY:R,rotateZ:U,rotationTo:pa,scale:na,set:ta,setAxes:ya,setAxisAngle:b,slerp:d,sqlerp:ga,sqrLen:fa,squaredLength:E,str:ra},Symbol.toStringTag,{value:"Module"}));export{b as I,ma as N,oa as O,sa as T,ta as X,N as v,j as x}; diff --git a/assets/query-BM8R3sQ6.js b/assets/query-Bk_ITqRK.js similarity index 96% rename from assets/query-BM8R3sQ6.js rename to assets/query-Bk_ITqRK.js index 89fa208..85dd1dd 100644 --- a/assets/query-BM8R3sQ6.js +++ b/assets/query-Bk_ITqRK.js @@ -1 +1 @@ -import{bW as S,dj as x,M as E,b_ as O,dP as f,cF as g}from"./index-CEWggaxV.js";import{t as R}from"./pbfQueryUtils-CLRSFGBm.js";import{t as F}from"./queryZScale-DN4aFXYn.js";function p(r){const e={};for(const i in r){if(i==="declaredClass")continue;const t=r[i];if(t!=null&&typeof t!="function")if(Array.isArray(t)){e[i]=[];for(let n=0;no.data.attachmentGroups)}async function x(n,t,e){const{objectIds:a}=t,o=[];for(const s of a)o.push(p(n.path+"/"+s+"/attachments",e));return Promise.all(o).then(s=>a.map((c,r)=>({parentObjectId:c,attachmentInfos:s[r].data.attachmentInfos})))}export{w as executeAttachmentQuery,x as fetchAttachments,k as processAttachmentQueryResult}; +import{ex as h,ey as f,M as p}from"./index-BjUNJPVf.js";import{t as d}from"./query-Bk_ITqRK.js";import{a as y}from"./AttachmentInfo-Cm6dhnUr.js";import"./pbfQueryUtils-CSeFSIjv.js";import"./pbf-Du8sFEWo.js";import"./OptimizedGeometry-CQuTPb9g.js";import"./OptimizedFeatureSet-Blu9Ckm7.js";import"./queryZScale-Dwvn5BlQ.js";function l(n){const t=n.toJSON();return t.attachmentTypes&&(t.attachmentTypes=t.attachmentTypes.join(",")),t.keywords&&(t.keywords=t.keywords.join(",")),t.globalIds&&(t.globalIds=t.globalIds.join(",")),t.objectIds&&(t.objectIds=t.objectIds.join(",")),t.size&&(t.size=t.size.join(",")),t}function k(n,t){const e={};for(const a of t){const{parentObjectId:o,parentGlobalId:s,attachmentInfos:c}=a;for(const r of c){const{id:i}=r,u=h(f(`${n.path}/${o}/attachments/${i}`)),m=y.fromJSON(r);m.set({url:u,parentObjectId:o,parentGlobalId:s}),e[o]?e[o].push(m):e[o]=[m]}}return e}function w(n,t,e){let a={query:d({...n.query,f:"json",...l(t)})};return e&&(a={...e,...a,query:{...e.query,...a.query}}),p(n.path+"/queryAttachments",a).then(o=>o.data.attachmentGroups)}async function x(n,t,e){const{objectIds:a}=t,o=[];for(const s of a)o.push(p(n.path+"/"+s+"/attachments",e));return Promise.all(o).then(s=>a.map((c,r)=>({parentObjectId:c,attachmentInfos:s[r].data.attachmentInfos})))}export{w as executeAttachmentQuery,x as fetchAttachments,k as processAttachmentQueryResult}; diff --git a/assets/queryTopFeatures-CtNPRLBc.js b/assets/queryTopFeatures-BZWuOU3o.js similarity index 94% rename from assets/queryTopFeatures-CtNPRLBc.js rename to assets/queryTopFeatures-BZWuOU3o.js index 6294f6a..c96cf8b 100644 --- a/assets/queryTopFeatures-CtNPRLBc.js +++ b/assets/queryTopFeatures-BZWuOU3o.js @@ -1 +1 @@ -import{bW as c,dj as m,M as F,b_ as f,cF as E,dP as a}from"./index-CEWggaxV.js";import{t as j}from"./query-BM8R3sQ6.js";import{t as x}from"./queryZScale-DN4aFXYn.js";const p="Layer does not support extent calculation.";function O(o,e){var u,y;const n=o.geometry,t=o.toJSON(),r=t;if(n!=null&&(r.geometry=JSON.stringify(n),r.geometryType=E(n),r.inSR=a(n.spatialReference)),(u=t.topFilter)!=null&&u.groupByFields&&(r.topFilter.groupByFields=t.topFilter.groupByFields.join(",")),(y=t.topFilter)!=null&&y.orderByFields&&(r.topFilter.orderByFields=t.topFilter.orderByFields.join(",")),t.topFilter&&(r.topFilter=JSON.stringify(r.topFilter)),t.objectIds&&(r.objectIds=t.objectIds.join(",")),t.orderByFields&&(r.orderByFields=t.orderByFields.join(",")),t.outFields&&!(e!=null&&e.returnCountOnly||e!=null&&e.returnExtentOnly||e!=null&&e.returnIdsOnly)?t.outFields.includes("*")?r.outFields="*":r.outFields=t.outFields.join(","):delete r.outFields,t.outSR?r.outSR=a(t.outSR):n&&t.returnGeometry&&(r.outSR=r.inSR),t.returnGeometry&&delete t.returnGeometry,t.timeExtent){const i=t.timeExtent,{start:s,end:l}=i;s==null&&l==null||(r.time=s===l?s:`${s??"null"},${l??"null"}`),delete t.timeExtent}return r}async function b(o,e,n,t){const r=await d(o,e,"json",t);return x(e,n,r.data),r}async function I(o,e,n){return e.timeExtent!=null&&e.timeExtent.isEmpty?{data:{objectIds:[]}}:d(o,e,"json",n,{returnIdsOnly:!0})}async function R(o,e,n){return e.timeExtent!=null&&e.timeExtent.isEmpty?{data:{count:0,extent:null}}:d(o,e,"json",n,{returnExtentOnly:!0,returnCountOnly:!0}).then(t=>{const r=t.data;if(r.hasOwnProperty("extent"))return t;if(r.features)throw new Error(p);if(r.hasOwnProperty("count"))throw new Error(p);return t})}function h(o,e,n){return e.timeExtent!=null&&e.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):d(o,e,"json",n,{returnIdsOnly:!0,returnCountOnly:!0})}function d(o,e,n,t={},r={}){const u=typeof o=="string"?c(o):o,y=e.geometry?[e.geometry]:[];return t.responseType=n==="pbf"?"array-buffer":"json",m(y,null,t).then(i=>{const s=i==null?void 0:i[0];s!=null&&((e=e.clone()).geometry=s);const l=j({...u.query,f:n,...r,...O(e,r)});return F(f(u.path,"queryTopFeatures"),{...t,query:{...l,...t.query}})})}export{h as a,R as d,I as m,b as p}; +import{bW as c,dj as m,M as F,b_ as f,cF as E,dP as a}from"./index-BjUNJPVf.js";import{t as j}from"./query-Bk_ITqRK.js";import{t as x}from"./queryZScale-Dwvn5BlQ.js";const p="Layer does not support extent calculation.";function O(o,e){var u,y;const n=o.geometry,t=o.toJSON(),r=t;if(n!=null&&(r.geometry=JSON.stringify(n),r.geometryType=E(n),r.inSR=a(n.spatialReference)),(u=t.topFilter)!=null&&u.groupByFields&&(r.topFilter.groupByFields=t.topFilter.groupByFields.join(",")),(y=t.topFilter)!=null&&y.orderByFields&&(r.topFilter.orderByFields=t.topFilter.orderByFields.join(",")),t.topFilter&&(r.topFilter=JSON.stringify(r.topFilter)),t.objectIds&&(r.objectIds=t.objectIds.join(",")),t.orderByFields&&(r.orderByFields=t.orderByFields.join(",")),t.outFields&&!(e!=null&&e.returnCountOnly||e!=null&&e.returnExtentOnly||e!=null&&e.returnIdsOnly)?t.outFields.includes("*")?r.outFields="*":r.outFields=t.outFields.join(","):delete r.outFields,t.outSR?r.outSR=a(t.outSR):n&&t.returnGeometry&&(r.outSR=r.inSR),t.returnGeometry&&delete t.returnGeometry,t.timeExtent){const i=t.timeExtent,{start:s,end:l}=i;s==null&&l==null||(r.time=s===l?s:`${s??"null"},${l??"null"}`),delete t.timeExtent}return r}async function b(o,e,n,t){const r=await d(o,e,"json",t);return x(e,n,r.data),r}async function I(o,e,n){return e.timeExtent!=null&&e.timeExtent.isEmpty?{data:{objectIds:[]}}:d(o,e,"json",n,{returnIdsOnly:!0})}async function R(o,e,n){return e.timeExtent!=null&&e.timeExtent.isEmpty?{data:{count:0,extent:null}}:d(o,e,"json",n,{returnExtentOnly:!0,returnCountOnly:!0}).then(t=>{const r=t.data;if(r.hasOwnProperty("extent"))return t;if(r.features)throw new Error(p);if(r.hasOwnProperty("count"))throw new Error(p);return t})}function h(o,e,n){return e.timeExtent!=null&&e.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):d(o,e,"json",n,{returnIdsOnly:!0,returnCountOnly:!0})}function d(o,e,n,t={},r={}){const u=typeof o=="string"?c(o):o,y=e.geometry?[e.geometry]:[];return t.responseType=n==="pbf"?"array-buffer":"json",m(y,null,t).then(i=>{const s=i==null?void 0:i[0];s!=null&&((e=e.clone()).geometry=s);const l=j({...u.query,f:n,...r,...O(e,r)});return F(f(u.path,"queryTopFeatures"),{...t,query:{...l,...t.query}})})}export{h as a,R as d,I as m,b as p}; diff --git a/assets/queryZScale-DN4aFXYn.js b/assets/queryZScale-Dwvn5BlQ.js similarity index 70% rename from assets/queryZScale-DN4aFXYn.js rename to assets/queryZScale-Dwvn5BlQ.js index f170db0..b42f1e5 100644 --- a/assets/queryZScale-DN4aFXYn.js +++ b/assets/queryZScale-Dwvn5BlQ.js @@ -1 +1 @@ -import{bl as a}from"./index-CEWggaxV.js";function u(o,f,e){if(!(e!=null&&e.features)||!e.hasZ)return;const t=a(e.geometryType,f,o.outSpatialReference);if(t!=null)for(const n of e.features)t(n.geometry)}export{u as t}; +import{bl as a}from"./index-BjUNJPVf.js";function u(o,f,e){if(!(e!=null&&e.features)||!e.hasZ)return;const t=a(e.geometryType,f,o.outSpatialReference);if(t!=null)for(const n of e.features)t(n.geometry)}export{u as t}; diff --git a/assets/rasterProjectionHelper-Bwvi37wQ.js b/assets/rasterProjectionHelper-CHkyWbma.js similarity index 99% rename from assets/rasterProjectionHelper-Bwvi37wQ.js rename to assets/rasterProjectionHelper-CHkyWbma.js index 4647793..684387c 100644 --- a/assets/rasterProjectionHelper-Bwvi37wQ.js +++ b/assets/rasterProjectionHelper-CHkyWbma.js @@ -1 +1 @@ -import{bt as nn,bu as Sn,aE as A,bv as $,bo as O,q as Pn,aB as pn,aA as N,aj as Gn,bw as Nn,N as kn,bx as C,by as v,bz as sn,bA as En,bB as Tn,aS as vn,bC as an}from"./index-CEWggaxV.js";var Z;function gn(n,t,e){return!Nn(n,t,e)}function I(n,t,e){const s=gn(n,t,e);if(s&&!nn())throw new kn("rasterprojectionhelper-project","projection engine is not loaded");return s}(function(n){n[n.None=0]="None",n[n.North=1]="North",n[n.South=2]="South",n[n.Both=3]="Both"})(Z||(Z={}));const rn=(n,t,e,s=0)=>{if(e[0]===1)return[0,0];let a=1,i=-1,o=1,f=-1;for(let u=0;un[u]?n[u]:a,i=i>n[u]?i:n[u],o=o>n[u+1]?n[u+1]:o,f=f>n[u+1]?f:n[u+1]);const{cols:l,rows:r}=t,c=(i-a)/l/e[0],M=(f-o)/r/e[1],y=2*s;let x=0,h=!1,p=[0,0];for(let u=0;ux&&(x=w+b,p=[w,b]),y&&x>y){h=!0;break}}if(h)break}return p},Cn={3395:20037508342789244e-9,3410:17334193943686873e-9,3857:20037508342788905e-9,3975:17367530445161372e-9,4087:20037508342789244e-9,4088:20015108787169147e-9,6933:17367530445161372e-9,32662:20037508342789244e-9,53001:2001508679602057e-8,53002:1000754339801029e-8,53003:2001508679602057e-8,53004:2001508679602057e-8,53016:14152803599503474e-9,53017:17333573624304302e-9,53034:2001508679602057e-8,53079:20015114352186374e-9,53080:20015114352186374e-9,54001:20037508342789244e-9,54002:10018754171394624e-9,54003:20037508342789244e-9,54004:20037508342789244e-9,54016:14168658027268292e-9,54017:1736753044516137e-8,54034:20037508342789244e-9,54079:20037508342789244e-9,54080:20037508342789244e-9,54100:20037508342789244e-9,54101:20037508342789244e-9},F=32,q=4,D=q,H=new Map,V=new Map,Y=500;async function Fn(){nn()||await Sn()}function _n(n,t,e){return I(n.spatialReference,t),e?an(t,n.spatialReference,n):an(n.spatialReference,t,n)}function ln(n,t,e,s=null){const a=n.spatialReference;if(a.equals(t))return n;I(a,t,s);const i=e.center,o=new A({xmin:i.x-n.x/2,xmax:i.x+n.x/2,ymin:i.y-n.y/2,ymax:i.y+n.y/2,spatialReference:a}),f=$(o,t,s),l=_(t);let r;if(f==null||l!=null&&f.width>=l){const c=O(a)/O(t);r={x:n.x*c,y:n.y*c}}else r={x:f.width,y:f.height};return r}function k(n,t=.01){return O(n)?t/O(n):0}function cn(n,t,e=null,s=!0){const a=n.spatialReference;if(a.equals(t))return n;I(a,t,e);const i=$(n,t,e);return s&&i&&yn([n],[i],a,t),i}function yn(n,t,e,s){const a=J(e,!0),i=J(s,!0),o=k(e,Y),f=k(s,Y);if(o&&a!=null&&i!=null)for(let l=0;l=i[1]-f&&Math.abs(c-a[0])new N(f[0],f[1],e)),o=$(i,s,a);return a&&yn(i,o,e,s),o.map(f=>f?[f.x,f.y]:[NaN,NaN])}function fn(n){const{inSR:t,outSR:e,datumTransformation:s}=n,a=W(t),{points:i,mask:o}=tn(n,a);if(!t.isGeographic){const l=t.wkid?C.coordsys(t.wkid):C.fromString(t.isGeographic?v.PE_TYPE_GEOGCS:v.PE_TYPE_PROJCS,t.wkt2||t.wkt);sn.projToGeog(l,i.length,i)}if(s!=null&&s.steps.length){let l;if(e.isGeographic&&(l=i.map(([c])=>c>179.9955?1:c<-179.9955?-1:0)),s.steps.forEach(c=>{const M=c.wkid?C.geogtran(c.wkid):C.fromString(v.PE_TYPE_GEOGTRAN,c.wkt);En.geogToGeog(M,i.length,i,null,c.isInverse?v.PE_TRANSFORM_2_TO_1:v.PE_TRANSFORM_1_TO_2)}),l)for(let c=0;c179.9955?1:y<-179.9955?-1:0;M&&x&&M!==x&&(i[c][0]=M>0?y+360:y-360)}}if(!e.isGeographic){const l=W(e,!0),r=l!=null&&l.isEnvelope?[l.bbox[1],l.bbox[3]]:[-90,90];In(i,r);const c=e.wkid?C.coordsys(e.wkid):C.fromString(e.isGeographic?v.PE_TYPE_GEOGCS:v.PE_TYPE_PROJCS,e.wkt2||e.wkt);sn.geogToProj(c,i.length,i)}let f=i;if(o&&i.length!==o.length){f=[];for(let l=0,r=0;lu.getInclusive()===1&&u.getKind()===1);if(!o){if(o=a.find(u=>u.getInclusive()===1&&u.getKind()===0),!o)return null;i=!0}const f=e?0:(s.getNorthPoleLocation()===2?1:0)|(s.getSouthPoleLocation()===2?2:0),l=s.isPannableRectangle(),r=o.getCoord();if(i)return{isEnvelope:i,isPannable:l,vertices:r,coef:null,bbox:[r[0][0]-t,r[0][1]-t,r[1][0]+t,r[1][1]+t],poleLocation:f};let c=0;const M=[];let[y,x]=r[0],[h,p]=r[0];for(let u=0,R=r.length;um?h:m,p=p>g?p:g}return{isEnvelope:!1,isPannable:l,vertices:r,coef:M,bbox:[y,x,h,p],poleLocation:f}}function tn(n,t){const e=[],{cols:s,rows:a,xres:i,yres:o,usePixelCenter:f}=n;let{xmin:l,ymax:r}=n;if(f&&(l+=i/2,r-=o/2),t==null){for(let x=0;x=x&&g<=p;for(let w=0;w=h&&b<=u&&(e.push([g,b]),c[m]=1)}}return{points:e,mask:c}}const M=t.coef,y=[];for(let x=0;x=w&&h<=b){const L=g*h+d;p.push(L),u.push(T)}}let R=p;if(p.length>2){let m=u[0]===2?0:u[0],g=p[0];R=[];for(let d=1;dd-w)}else p[0]>p[1]&&(R=[p[1],p[0]]);y.push(R)}for(let x=0,h=0;x=m[0]&&p<=m[1]&&(e.push([p,R]),c[h]=1);else if(m.length>2){let g=!1;for(let d=0;d=m[d]&&p<=m[d+1]){g=!0;break}g&&(e.push([p,R]),c[h]=1)}}}return{points:e,mask:c}}function In(n,t){const[e,s]=t;for(let a=0;as)&&(n[a]=[NaN,NaN])}}function dn(n,t){const e=_(n[0].spatialReference);if(n.length<2||e==null||(t=t??k(n[0].spatialReference),(n=n.filter(f=>f.width>t)).length===1))return n[0];let{xmin:s,xmax:a,ymin:i,ymax:o}=n[0];for(let f=1;fk(a)){const{xmin:r,xmax:c}=n;for(let M=0;M<=i;M++){const y=M===0?r:-o/2,x=M===i?c-o*M:o/2;l[M]=new A({xmin:y,xmax:x,ymin:n.ymin,ymax:n.ymax,spatialReference:a})}}return dn(l.map(r=>xn(r,t,e,s)).filter(Pn))}function qn(n,t,e){if(n.type==="extent"){const{xmin:s,ymin:a,xmax:i,ymax:o,spatialReference:f}=n;n=new pn({rings:[[[s,o],[i,o],[i,a],[s,a],[s,o]]],spatialReference:f})}return n.spatialReference.equals(t)?n:(I(n.spatialReference,t,e),$(n,t,e))}function Ln(n,t){const e=_(t);if(e==null)return null;let{xmin:s,ymin:a,xmax:i,ymax:o}=n;const f=n.spatialReference,l=new pn({spatialReference:f,rings:[[[s,a],[i,a],[i,o],[s,o],[s,a]]]}),r=$(l,t);if(r.rings.length!==2||!r.rings[0].length||!r.rings[1].length)return null;const{rings:c}=r,M=k(f),y=new A({spatialReference:t});for(let x=0;x<2;x++){s=i=c[x][0][0],a=o=c[x][0][1];for(let h=0;hc[x][h][0]?c[x][h][0]:s,i=ic[x][h][1]?c[x][h][1]:a,o=o=o.ymax))return null;if(!s||!o)return o;const f=J(i,!0),l=J(t,!0);if(f==null||l==null)return o;const r=k(i,.001),c=k(i,Y),M=k(t,.001);if(Math.abs(o.xmin-l[0])c){o.xmin=l[0];const h=[];h.push(new N(n.xmax,n.ymin,i)),h.push(new N(n.xmax,(n.ymin+n.ymax)/2,i)),h.push(new N(n.xmax,n.ymax,i));const p=h.map(u=>cn(u,t,e)).filter(u=>!isNaN(u==null?void 0:u.x)).map(u=>u.x);o.xmax=Math.max.apply(null,p)}if(xc){o.xmax=l[1];const h=[];h.push(new N(n.xmin,n.ymin,i)),h.push(new N(n.xmin,(n.ymin+n.ymax)/2,i)),h.push(new N(n.xmin,n.ymax,i));const p=h.map(u=>cn(u,t,e)).filter(u=>!isNaN(u==null?void 0:u.x)).map(u=>u.x);o.xmin=Math.min.apply(null,p)}}else{const y=k(t,.001);Math.abs(o.xmin-l[0])0&&s.outofBoundPointCountD)&&(gn(l,r,n.datumTransformation)&&(l.isGeographic||W(l)),e=[q,q],s=Q({...n,spacing:e}),a={cols:s.size[0]+1,rows:s.size[1]+1},o=rn(s.offsets,a,e,D)),s.error=o,e[0]>1&&(s.coefficients=mn(s.offsets,a,i)),n.includeGCSGrid&&!l.isGeographic&&!l.isWebMercator)if(r.isGeographic)s.gcsGrid={offsets:s.offsets,coefficients:s.coefficients,spacing:e};else{const c=W(l);if(c!=null&&!c.isEnvelope){const M=On(l),y=Mn(n.projectedExtent,M),{offsets:x}=Q({...n,srcBufferExtent:y,spacing:e}),h=mn(x,a,i);s.gcsGrid={offsets:x,coefficients:h,spacing:e}}}return s}function Q(n){const{projectedExtent:t,srcBufferExtent:e,pixelSize:s,datumTransformation:a,rasterTransform:i}=n,o=t.spatialReference,f=e.spatialReference,l=I(o,f),{xmin:r,ymin:c,xmax:M,ymax:y}=t,x=_(f),h=x!=null&&(n.hasWrapAround||(i==null?void 0:i.type)==="gcs-shift"),p=n.spacing||[F,F],u=p[0]*s.x,R=p[1]*s.y,m=p[0]===1,g=Math.ceil((M-r)/u-.1/p[0])+(m?0:1),d=Math.ceil((y-c)/R-.1/p[1])+(m?0:1),w=zn({cols:g,rows:d,xmin:r,ymax:y,xres:u,yres:R,inSR:o,outSR:f,datumTransformation:a,preferPE:p[0]<=q,usePixelCenter:m}),b=[];let T,L=0;const j=m?-1:NaN,{xmin:S,xmax:P,ymax:E,width:X,height:K}=e,Rn=k(f,Y),bn=x!=null&&S>0&&P>x/2;let en=!1;if(l){const z=W(o);en=z!=null&&z.poleLocation>0}for(let z=0;zP&&G[0]>x/2-Rn?G[0]-=x:h&&z===0&&G[0]<0&&bn&&!i&&(G[0]+=x),!G||isNaN(G[0])||isNaN(G[1]))b.push(j),b.push(j),U.push(null),L++;else{if(i){const on=i.inverseTransform(new N({x:G[0],y:G[1],spatialReference:f}));G=[on.x,on.y]}U.push(G),z>0&&h&&T[B]&&G[0]P&&G[0]>x&&(G[0]-=x)),b.push((G[0]-S)/X),b.push((E-G[1])/K)}}T=U}return{offsets:b,error:null,coefficients:null,outofBoundPointCount:L,spacing:p,size:m?[g,d]:[g-1,d-1]}}function mn(n,t,e){const{cols:s,rows:a}=t,i=new Float32Array((s-1)*(a-1)*2*6),o=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),f=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let l=0;la){const f=n.xmin-a;o=-Math.ceil(f/i)}return new A({spatialReference:n.spatialReference,xmin:n.xmin+o*i,ymin:n.ymin,xmax:n.xmax+o*i,ymax:n.ymax})}function Kn(n,t,e){var h;const{storageInfo:s,pixelSize:a}=t;let i=0,o=!1;const{pyramidResolutions:f}=s,l=((h=s.tileInfo.format)==null?void 0:h.toLowerCase())==="mixed"?Math.max(1,Math.min(3,s.tileInfo.dpi/96)):1,r=(n.x+n.y)/2/l;if(f!=null&&f.length){const p=f[f.length-1],u=(p.x+p.y)/2,R=(a.x+a.y)/2;if(r<=R)i=0;else if(r>=u)i=f.length,o=r/u>8;else{let g,d=R;for(let w=1;w<=f.length;w++){if(g=(f[w-1].x+f[w-1].y)/2,r<=g){r===g?i=w:e==="down"?(i=w-1,o=r/d>8):i=e==="up"||r-d>g-r||r/d>2?w:w-1;break}d=g}}const m=i===0?a:f[i-1];return o&&Math.min(m.x,m.y)*O(t.spatialReference)>19567&&(o=!1),{pyramidLevel:i,pyramidResolution:new N({x:m.x,y:m.y,spatialReference:t.spatialReference}),excessiveReading:o}}const c=Math.log(n.x/a.x)/Math.LN2,M=Math.log(n.y/a.y)/Math.LN2,y=t.storageInfo.maximumPyramidLevel||0;i=e==="down"?Math.floor(Math.min(c,M)):e==="up"?Math.ceil(Math.max(c,M)):Math.round((c+M)/2),i<0?i=0:i>y&&(o=i>y+3,i=y);const x=2**i;return{pyramidLevel:i,pyramidResolution:new N({x:x*t.nativePixelSize.x,y:x*t.nativePixelSize.y,spatialReference:t.spatialReference}),excessiveReading:o}}function Bn(n,t){const{pixelSize:e,extent:s}=n,a=_n(s,t,!1);return Mn(jn(s,(e.x+e.y)/16),t,a)}function Un(n,t,e){var j;const s=(e==null?void 0:e.tileSize)??512,a=(e==null?void 0:e.alignGlobalDatasetWithAGOL)??!0,i=!!(e!=null&&e.limitToSrcResolution),{extent:o,spatialReference:f,pixelSize:l}=n,r=ln(new N({x:l.x,y:l.y,spatialReference:f}),t,o);if(r==null)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const c=(r.x+r.y)/2,M=O(t),y=c*M*96*39.37,x=t.isGeographic?256/s*2958287637958547e-7:256/s*591657527591555e-6;let h=n.dataType==="vector-magdir"||n.dataType==="vector-uv";const p=Bn(n,t),u=Math.min(Math.ceil(Math.log(Math.min(n.width,n.height)/32)/Math.LN2),Math.ceil(Math.log(x/2/y)/Math.LN2));if(!h&&a&&(t.isGeographic||t.isWebMercator)){const S=_(t);if(h=wn(p)>0||S!=null&&p.width>S/4,!h&&S!=null){let P=-1;if(u<3)P=2**u*c*s;else if(n.storageInfo){const{maximumPyramidLevel:X=0,pyramidScalingFactor:K=2}=n.storageInfo;P=K**X*c*s}const E=Math.ceil(S/P);h=E===1||E===2&&S/2-p.xmax=L;)m/=d,R.x/=d,R.y/=d,w.push(m),b.push({x:R.x,y:R.y});if(i){const S=.001*l.x;let P=b.findIndex(E=>E.x>=l.x-S&&E.x<=l.x+S);P>-1?(b.length=P+1,w.length=P+1):(P=b.findIndex(E=>E.x<=l.x+S),P>0&&(b.length=P,w.length=P))}return{projectedPixelSize:r,scales:w,srcResolutions:b,isCustomTilingScheme:!h}}export{ln as C,_ as D,Mn as J,gn as M,Fn as T,qn as U,wn as V,Yn as Z,Un as a,Jn as e,cn as j,Xn as o,Kn as r,Bn as s,_n as v}; +import{bt as nn,bu as Sn,aE as A,bv as $,bo as O,q as Pn,aB as pn,aA as N,aj as Gn,bw as Nn,N as kn,bx as C,by as v,bz as sn,bA as En,bB as Tn,aS as vn,bC as an}from"./index-BjUNJPVf.js";var Z;function gn(n,t,e){return!Nn(n,t,e)}function I(n,t,e){const s=gn(n,t,e);if(s&&!nn())throw new kn("rasterprojectionhelper-project","projection engine is not loaded");return s}(function(n){n[n.None=0]="None",n[n.North=1]="North",n[n.South=2]="South",n[n.Both=3]="Both"})(Z||(Z={}));const rn=(n,t,e,s=0)=>{if(e[0]===1)return[0,0];let a=1,i=-1,o=1,f=-1;for(let u=0;un[u]?n[u]:a,i=i>n[u]?i:n[u],o=o>n[u+1]?n[u+1]:o,f=f>n[u+1]?f:n[u+1]);const{cols:l,rows:r}=t,c=(i-a)/l/e[0],M=(f-o)/r/e[1],y=2*s;let x=0,h=!1,p=[0,0];for(let u=0;ux&&(x=w+b,p=[w,b]),y&&x>y){h=!0;break}}if(h)break}return p},Cn={3395:20037508342789244e-9,3410:17334193943686873e-9,3857:20037508342788905e-9,3975:17367530445161372e-9,4087:20037508342789244e-9,4088:20015108787169147e-9,6933:17367530445161372e-9,32662:20037508342789244e-9,53001:2001508679602057e-8,53002:1000754339801029e-8,53003:2001508679602057e-8,53004:2001508679602057e-8,53016:14152803599503474e-9,53017:17333573624304302e-9,53034:2001508679602057e-8,53079:20015114352186374e-9,53080:20015114352186374e-9,54001:20037508342789244e-9,54002:10018754171394624e-9,54003:20037508342789244e-9,54004:20037508342789244e-9,54016:14168658027268292e-9,54017:1736753044516137e-8,54034:20037508342789244e-9,54079:20037508342789244e-9,54080:20037508342789244e-9,54100:20037508342789244e-9,54101:20037508342789244e-9},F=32,q=4,D=q,H=new Map,V=new Map,Y=500;async function Fn(){nn()||await Sn()}function _n(n,t,e){return I(n.spatialReference,t),e?an(t,n.spatialReference,n):an(n.spatialReference,t,n)}function ln(n,t,e,s=null){const a=n.spatialReference;if(a.equals(t))return n;I(a,t,s);const i=e.center,o=new A({xmin:i.x-n.x/2,xmax:i.x+n.x/2,ymin:i.y-n.y/2,ymax:i.y+n.y/2,spatialReference:a}),f=$(o,t,s),l=_(t);let r;if(f==null||l!=null&&f.width>=l){const c=O(a)/O(t);r={x:n.x*c,y:n.y*c}}else r={x:f.width,y:f.height};return r}function k(n,t=.01){return O(n)?t/O(n):0}function cn(n,t,e=null,s=!0){const a=n.spatialReference;if(a.equals(t))return n;I(a,t,e);const i=$(n,t,e);return s&&i&&yn([n],[i],a,t),i}function yn(n,t,e,s){const a=J(e,!0),i=J(s,!0),o=k(e,Y),f=k(s,Y);if(o&&a!=null&&i!=null)for(let l=0;l=i[1]-f&&Math.abs(c-a[0])new N(f[0],f[1],e)),o=$(i,s,a);return a&&yn(i,o,e,s),o.map(f=>f?[f.x,f.y]:[NaN,NaN])}function fn(n){const{inSR:t,outSR:e,datumTransformation:s}=n,a=W(t),{points:i,mask:o}=tn(n,a);if(!t.isGeographic){const l=t.wkid?C.coordsys(t.wkid):C.fromString(t.isGeographic?v.PE_TYPE_GEOGCS:v.PE_TYPE_PROJCS,t.wkt2||t.wkt);sn.projToGeog(l,i.length,i)}if(s!=null&&s.steps.length){let l;if(e.isGeographic&&(l=i.map(([c])=>c>179.9955?1:c<-179.9955?-1:0)),s.steps.forEach(c=>{const M=c.wkid?C.geogtran(c.wkid):C.fromString(v.PE_TYPE_GEOGTRAN,c.wkt);En.geogToGeog(M,i.length,i,null,c.isInverse?v.PE_TRANSFORM_2_TO_1:v.PE_TRANSFORM_1_TO_2)}),l)for(let c=0;c179.9955?1:y<-179.9955?-1:0;M&&x&&M!==x&&(i[c][0]=M>0?y+360:y-360)}}if(!e.isGeographic){const l=W(e,!0),r=l!=null&&l.isEnvelope?[l.bbox[1],l.bbox[3]]:[-90,90];In(i,r);const c=e.wkid?C.coordsys(e.wkid):C.fromString(e.isGeographic?v.PE_TYPE_GEOGCS:v.PE_TYPE_PROJCS,e.wkt2||e.wkt);sn.geogToProj(c,i.length,i)}let f=i;if(o&&i.length!==o.length){f=[];for(let l=0,r=0;lu.getInclusive()===1&&u.getKind()===1);if(!o){if(o=a.find(u=>u.getInclusive()===1&&u.getKind()===0),!o)return null;i=!0}const f=e?0:(s.getNorthPoleLocation()===2?1:0)|(s.getSouthPoleLocation()===2?2:0),l=s.isPannableRectangle(),r=o.getCoord();if(i)return{isEnvelope:i,isPannable:l,vertices:r,coef:null,bbox:[r[0][0]-t,r[0][1]-t,r[1][0]+t,r[1][1]+t],poleLocation:f};let c=0;const M=[];let[y,x]=r[0],[h,p]=r[0];for(let u=0,R=r.length;um?h:m,p=p>g?p:g}return{isEnvelope:!1,isPannable:l,vertices:r,coef:M,bbox:[y,x,h,p],poleLocation:f}}function tn(n,t){const e=[],{cols:s,rows:a,xres:i,yres:o,usePixelCenter:f}=n;let{xmin:l,ymax:r}=n;if(f&&(l+=i/2,r-=o/2),t==null){for(let x=0;x=x&&g<=p;for(let w=0;w=h&&b<=u&&(e.push([g,b]),c[m]=1)}}return{points:e,mask:c}}const M=t.coef,y=[];for(let x=0;x=w&&h<=b){const L=g*h+d;p.push(L),u.push(T)}}let R=p;if(p.length>2){let m=u[0]===2?0:u[0],g=p[0];R=[];for(let d=1;dd-w)}else p[0]>p[1]&&(R=[p[1],p[0]]);y.push(R)}for(let x=0,h=0;x=m[0]&&p<=m[1]&&(e.push([p,R]),c[h]=1);else if(m.length>2){let g=!1;for(let d=0;d=m[d]&&p<=m[d+1]){g=!0;break}g&&(e.push([p,R]),c[h]=1)}}}return{points:e,mask:c}}function In(n,t){const[e,s]=t;for(let a=0;as)&&(n[a]=[NaN,NaN])}}function dn(n,t){const e=_(n[0].spatialReference);if(n.length<2||e==null||(t=t??k(n[0].spatialReference),(n=n.filter(f=>f.width>t)).length===1))return n[0];let{xmin:s,xmax:a,ymin:i,ymax:o}=n[0];for(let f=1;fk(a)){const{xmin:r,xmax:c}=n;for(let M=0;M<=i;M++){const y=M===0?r:-o/2,x=M===i?c-o*M:o/2;l[M]=new A({xmin:y,xmax:x,ymin:n.ymin,ymax:n.ymax,spatialReference:a})}}return dn(l.map(r=>xn(r,t,e,s)).filter(Pn))}function qn(n,t,e){if(n.type==="extent"){const{xmin:s,ymin:a,xmax:i,ymax:o,spatialReference:f}=n;n=new pn({rings:[[[s,o],[i,o],[i,a],[s,a],[s,o]]],spatialReference:f})}return n.spatialReference.equals(t)?n:(I(n.spatialReference,t,e),$(n,t,e))}function Ln(n,t){const e=_(t);if(e==null)return null;let{xmin:s,ymin:a,xmax:i,ymax:o}=n;const f=n.spatialReference,l=new pn({spatialReference:f,rings:[[[s,a],[i,a],[i,o],[s,o],[s,a]]]}),r=$(l,t);if(r.rings.length!==2||!r.rings[0].length||!r.rings[1].length)return null;const{rings:c}=r,M=k(f),y=new A({spatialReference:t});for(let x=0;x<2;x++){s=i=c[x][0][0],a=o=c[x][0][1];for(let h=0;hc[x][h][0]?c[x][h][0]:s,i=ic[x][h][1]?c[x][h][1]:a,o=o=o.ymax))return null;if(!s||!o)return o;const f=J(i,!0),l=J(t,!0);if(f==null||l==null)return o;const r=k(i,.001),c=k(i,Y),M=k(t,.001);if(Math.abs(o.xmin-l[0])c){o.xmin=l[0];const h=[];h.push(new N(n.xmax,n.ymin,i)),h.push(new N(n.xmax,(n.ymin+n.ymax)/2,i)),h.push(new N(n.xmax,n.ymax,i));const p=h.map(u=>cn(u,t,e)).filter(u=>!isNaN(u==null?void 0:u.x)).map(u=>u.x);o.xmax=Math.max.apply(null,p)}if(xc){o.xmax=l[1];const h=[];h.push(new N(n.xmin,n.ymin,i)),h.push(new N(n.xmin,(n.ymin+n.ymax)/2,i)),h.push(new N(n.xmin,n.ymax,i));const p=h.map(u=>cn(u,t,e)).filter(u=>!isNaN(u==null?void 0:u.x)).map(u=>u.x);o.xmin=Math.min.apply(null,p)}}else{const y=k(t,.001);Math.abs(o.xmin-l[0])0&&s.outofBoundPointCountD)&&(gn(l,r,n.datumTransformation)&&(l.isGeographic||W(l)),e=[q,q],s=Q({...n,spacing:e}),a={cols:s.size[0]+1,rows:s.size[1]+1},o=rn(s.offsets,a,e,D)),s.error=o,e[0]>1&&(s.coefficients=mn(s.offsets,a,i)),n.includeGCSGrid&&!l.isGeographic&&!l.isWebMercator)if(r.isGeographic)s.gcsGrid={offsets:s.offsets,coefficients:s.coefficients,spacing:e};else{const c=W(l);if(c!=null&&!c.isEnvelope){const M=On(l),y=Mn(n.projectedExtent,M),{offsets:x}=Q({...n,srcBufferExtent:y,spacing:e}),h=mn(x,a,i);s.gcsGrid={offsets:x,coefficients:h,spacing:e}}}return s}function Q(n){const{projectedExtent:t,srcBufferExtent:e,pixelSize:s,datumTransformation:a,rasterTransform:i}=n,o=t.spatialReference,f=e.spatialReference,l=I(o,f),{xmin:r,ymin:c,xmax:M,ymax:y}=t,x=_(f),h=x!=null&&(n.hasWrapAround||(i==null?void 0:i.type)==="gcs-shift"),p=n.spacing||[F,F],u=p[0]*s.x,R=p[1]*s.y,m=p[0]===1,g=Math.ceil((M-r)/u-.1/p[0])+(m?0:1),d=Math.ceil((y-c)/R-.1/p[1])+(m?0:1),w=zn({cols:g,rows:d,xmin:r,ymax:y,xres:u,yres:R,inSR:o,outSR:f,datumTransformation:a,preferPE:p[0]<=q,usePixelCenter:m}),b=[];let T,L=0;const j=m?-1:NaN,{xmin:S,xmax:P,ymax:E,width:X,height:K}=e,Rn=k(f,Y),bn=x!=null&&S>0&&P>x/2;let en=!1;if(l){const z=W(o);en=z!=null&&z.poleLocation>0}for(let z=0;zP&&G[0]>x/2-Rn?G[0]-=x:h&&z===0&&G[0]<0&&bn&&!i&&(G[0]+=x),!G||isNaN(G[0])||isNaN(G[1]))b.push(j),b.push(j),U.push(null),L++;else{if(i){const on=i.inverseTransform(new N({x:G[0],y:G[1],spatialReference:f}));G=[on.x,on.y]}U.push(G),z>0&&h&&T[B]&&G[0]P&&G[0]>x&&(G[0]-=x)),b.push((G[0]-S)/X),b.push((E-G[1])/K)}}T=U}return{offsets:b,error:null,coefficients:null,outofBoundPointCount:L,spacing:p,size:m?[g,d]:[g-1,d-1]}}function mn(n,t,e){const{cols:s,rows:a}=t,i=new Float32Array((s-1)*(a-1)*2*6),o=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),f=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let l=0;la){const f=n.xmin-a;o=-Math.ceil(f/i)}return new A({spatialReference:n.spatialReference,xmin:n.xmin+o*i,ymin:n.ymin,xmax:n.xmax+o*i,ymax:n.ymax})}function Kn(n,t,e){var h;const{storageInfo:s,pixelSize:a}=t;let i=0,o=!1;const{pyramidResolutions:f}=s,l=((h=s.tileInfo.format)==null?void 0:h.toLowerCase())==="mixed"?Math.max(1,Math.min(3,s.tileInfo.dpi/96)):1,r=(n.x+n.y)/2/l;if(f!=null&&f.length){const p=f[f.length-1],u=(p.x+p.y)/2,R=(a.x+a.y)/2;if(r<=R)i=0;else if(r>=u)i=f.length,o=r/u>8;else{let g,d=R;for(let w=1;w<=f.length;w++){if(g=(f[w-1].x+f[w-1].y)/2,r<=g){r===g?i=w:e==="down"?(i=w-1,o=r/d>8):i=e==="up"||r-d>g-r||r/d>2?w:w-1;break}d=g}}const m=i===0?a:f[i-1];return o&&Math.min(m.x,m.y)*O(t.spatialReference)>19567&&(o=!1),{pyramidLevel:i,pyramidResolution:new N({x:m.x,y:m.y,spatialReference:t.spatialReference}),excessiveReading:o}}const c=Math.log(n.x/a.x)/Math.LN2,M=Math.log(n.y/a.y)/Math.LN2,y=t.storageInfo.maximumPyramidLevel||0;i=e==="down"?Math.floor(Math.min(c,M)):e==="up"?Math.ceil(Math.max(c,M)):Math.round((c+M)/2),i<0?i=0:i>y&&(o=i>y+3,i=y);const x=2**i;return{pyramidLevel:i,pyramidResolution:new N({x:x*t.nativePixelSize.x,y:x*t.nativePixelSize.y,spatialReference:t.spatialReference}),excessiveReading:o}}function Bn(n,t){const{pixelSize:e,extent:s}=n,a=_n(s,t,!1);return Mn(jn(s,(e.x+e.y)/16),t,a)}function Un(n,t,e){var j;const s=(e==null?void 0:e.tileSize)??512,a=(e==null?void 0:e.alignGlobalDatasetWithAGOL)??!0,i=!!(e!=null&&e.limitToSrcResolution),{extent:o,spatialReference:f,pixelSize:l}=n,r=ln(new N({x:l.x,y:l.y,spatialReference:f}),t,o);if(r==null)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const c=(r.x+r.y)/2,M=O(t),y=c*M*96*39.37,x=t.isGeographic?256/s*2958287637958547e-7:256/s*591657527591555e-6;let h=n.dataType==="vector-magdir"||n.dataType==="vector-uv";const p=Bn(n,t),u=Math.min(Math.ceil(Math.log(Math.min(n.width,n.height)/32)/Math.LN2),Math.ceil(Math.log(x/2/y)/Math.LN2));if(!h&&a&&(t.isGeographic||t.isWebMercator)){const S=_(t);if(h=wn(p)>0||S!=null&&p.width>S/4,!h&&S!=null){let P=-1;if(u<3)P=2**u*c*s;else if(n.storageInfo){const{maximumPyramidLevel:X=0,pyramidScalingFactor:K=2}=n.storageInfo;P=K**X*c*s}const E=Math.ceil(S/P);h=E===1||E===2&&S/2-p.xmax=L;)m/=d,R.x/=d,R.y/=d,w.push(m),b.push({x:R.x,y:R.y});if(i){const S=.001*l.x;let P=b.findIndex(E=>E.x>=l.x-S&&E.x<=l.x+S);P>-1?(b.length=P+1,w.length=P+1):(P=b.findIndex(E=>E.x<=l.x+S),P>0&&(b.length=P,w.length=P))}return{projectedPixelSize:r,scales:w,srcResolutions:b,isCustomTilingScheme:!h}}export{ln as C,_ as D,Mn as J,gn as M,Fn as T,qn as U,wn as V,Yn as Z,Un as a,Jn as e,cn as j,Xn as o,Kn as r,Bn as s,_n as v}; diff --git a/assets/rasterUtils-Dgn5fnGK.js b/assets/rasterUtils-DEPcL5Ca.js similarity index 98% rename from assets/rasterUtils-Dgn5fnGK.js rename to assets/rasterUtils-DEPcL5Ca.js index f29f072..c1daab8 100644 --- a/assets/rasterUtils-Dgn5fnGK.js +++ b/assets/rasterUtils-DEPcL5Ca.js @@ -1 +1 @@ -import{l as C,U as A,L as _,D as T,o as s,t as E,v as d}from"./index-CEWggaxV.js";import{e as h,m as O}from"./Texture-DJgkMrSB.js";function w(e,n,t="nearest",i=!1){var c;const a=!(i&&n.pixelType==="u8"),o=a?A.FLOAT:A.UNSIGNED_BYTE,u=n.pixels==null||n.pixels.length===0?null:a?n.getAsRGBAFloat():n.getAsRGBA(),f=(c=e.capabilities.textureFloat)==null?void 0:c.textureFloatLinear,r=new h;return r.width=n.width,r.height=n.height,r.internalFormat=a?C.RGBA32F:d.RGBA,r.samplingMode=!f||t!=="bilinear"&&t!=="cubic"?_.NEAREST:_.LINEAR,r.dataType=o,r.wrapMode=T.CLAMP_TO_EDGE,new O(e,r,u)}function F(e,n){const{spacing:t,offsets:i,coefficients:a,size:[o,u]}=n,f=t[0]>1,r=new h;r.width=f?4*o:o,r.height=u,r.internalFormat=C.RGBA32F,r.dataType=A.FLOAT,r.samplingMode=_.NEAREST,r.wrapMode=T.CLAMP_TO_EDGE;const c=new Float32Array(f?o*u*16:2*i.length);if(f&&a!=null)for(let m=0,l=0;m{const a=n.get(i)||n.get(i+"[0]");a&&L(e,i,t[i],a)})}function I(e,n,t,i){t.length===i.length&&(i.some(a=>a==null)||t.some(a=>a==null)||t.forEach((a,o)=>{n.setUniform1i(a,o),e.bindTexture(i[o],o)}))}function L(e,n,t,i){if(i===null||t==null)return!1;const{info:a}=i;switch(a.type){case s.FLOAT:a.size>1?e.setUniform1fv(n,t):e.setUniform1f(n,t);break;case s.FLOAT_VEC2:e.setUniform2fv(n,t);break;case s.FLOAT_VEC3:e.setUniform3fv(n,t);break;case s.FLOAT_VEC4:e.setUniform4fv(n,t);break;case s.FLOAT_MAT3:e.setUniformMatrix3fv(n,t);break;case s.FLOAT_MAT4:e.setUniformMatrix4fv(n,t);break;case s.INT:a.size>1?e.setUniform1iv(n,t):e.setUniform1i(n,t);break;case s.BOOL:e.setUniform1i(n,t?1:0);break;case s.INT_VEC2:case s.BOOL_VEC2:e.setUniform2iv(n,t);break;case s.INT_VEC3:case s.BOOL_VEC3:e.setUniform3iv(n,t);break;case s.INT_VEC4:case s.BOOL_VEC4:e.setUniform4iv(n,t);break;default:return!1}return!0}export{v as A,I as O,N as T,G as _,F as c,w as f,V as g,B as h,x as l,M as m,k as p}; +import{l as C,U as A,L as _,D as T,o as s,t as E,v as d}from"./index-BjUNJPVf.js";import{e as h,m as O}from"./Texture-S4dD-WHn.js";function w(e,n,t="nearest",i=!1){var c;const a=!(i&&n.pixelType==="u8"),o=a?A.FLOAT:A.UNSIGNED_BYTE,u=n.pixels==null||n.pixels.length===0?null:a?n.getAsRGBAFloat():n.getAsRGBA(),f=(c=e.capabilities.textureFloat)==null?void 0:c.textureFloatLinear,r=new h;return r.width=n.width,r.height=n.height,r.internalFormat=a?C.RGBA32F:d.RGBA,r.samplingMode=!f||t!=="bilinear"&&t!=="cubic"?_.NEAREST:_.LINEAR,r.dataType=o,r.wrapMode=T.CLAMP_TO_EDGE,new O(e,r,u)}function F(e,n){const{spacing:t,offsets:i,coefficients:a,size:[o,u]}=n,f=t[0]>1,r=new h;r.width=f?4*o:o,r.height=u,r.internalFormat=C.RGBA32F,r.dataType=A.FLOAT,r.samplingMode=_.NEAREST,r.wrapMode=T.CLAMP_TO_EDGE;const c=new Float32Array(f?o*u*16:2*i.length);if(f&&a!=null)for(let m=0,l=0;m{const a=n.get(i)||n.get(i+"[0]");a&&L(e,i,t[i],a)})}function I(e,n,t,i){t.length===i.length&&(i.some(a=>a==null)||t.some(a=>a==null)||t.forEach((a,o)=>{n.setUniform1i(a,o),e.bindTexture(i[o],o)}))}function L(e,n,t,i){if(i===null||t==null)return!1;const{info:a}=i;switch(a.type){case s.FLOAT:a.size>1?e.setUniform1fv(n,t):e.setUniform1f(n,t);break;case s.FLOAT_VEC2:e.setUniform2fv(n,t);break;case s.FLOAT_VEC3:e.setUniform3fv(n,t);break;case s.FLOAT_VEC4:e.setUniform4fv(n,t);break;case s.FLOAT_MAT3:e.setUniformMatrix3fv(n,t);break;case s.FLOAT_MAT4:e.setUniformMatrix4fv(n,t);break;case s.INT:a.size>1?e.setUniform1iv(n,t):e.setUniform1i(n,t);break;case s.BOOL:e.setUniform1i(n,t?1:0);break;case s.INT_VEC2:case s.BOOL_VEC2:e.setUniform2iv(n,t);break;case s.INT_VEC3:case s.BOOL_VEC3:e.setUniform3iv(n,t);break;case s.INT_VEC4:case s.BOOL_VEC4:e.setUniform4iv(n,t);break;default:return!1}return!0}export{v as A,I as O,N as T,G as _,F as c,w as f,V as g,B as h,x as l,M as m,k as p}; diff --git a/assets/rasterizingUtils-DXTinem2.js b/assets/rasterizingUtils-D-sJQSSt.js similarity index 93% rename from assets/rasterizingUtils-DXTinem2.js rename to assets/rasterizingUtils-D-sJQSSt.js index 7a4b9ec..89d27f3 100644 --- a/assets/rasterizingUtils-DXTinem2.js +++ b/assets/rasterizingUtils-D-sJQSSt.js @@ -1 +1 @@ -import{o as x}from"./floatRGBA-BLm-Rhaq.js";import{H as u}from"./index-CEWggaxV.js";import{o as C}from"./constants-D5zmR9t2.js";const y=e=>e==="vertical"||e==="horizontal"||e==="cross"||e==="esriSFSCross"||e==="esriSFSVertical"||e==="esriSFSHorizontal";function z(e,T,d){const r=T.style,l=u(Math.ceil(d)),t=y(r)?8*l:16*l,o=2*l;e.width=t,e.height=t;const a=e.getContext("2d");a.strokeStyle="#FFFFFF",a.lineWidth=l,a.beginPath(),r!=="vertical"&&r!=="cross"&&r!=="esriSFSCross"&&r!=="esriSFSVertical"||(a.moveTo(t/2,-o),a.lineTo(t/2,t+o)),r!=="horizontal"&&r!=="cross"&&r!=="esriSFSCross"&&r!=="esriSFSHorizontal"||(a.moveTo(-o,t/2),a.lineTo(t+o,t/2)),r!=="backward-diagonal"&&r!=="diagonal-cross"&&r!=="esriSFSDiagonalCross"&&r!=="esriSFSBackwardDiagonal"||(a.moveTo(-o,-o),a.lineTo(t+o,t+o),a.moveTo(t-o,-o),a.lineTo(t+o,o),a.moveTo(-o,t-o),a.lineTo(o,t+o)),r!=="forward-diagonal"&&r!=="diagonal-cross"&&r!=="esriSFSForwardDiagonal"&&r!=="esriSFSDiagonalCross"||(a.moveTo(t+o,-o),a.lineTo(-o,t+o),a.moveTo(o,-o),a.lineTo(-o,o),a.moveTo(t+o,t-o),a.lineTo(t-o,t+o)),a.stroke();const g=a.getImageData(0,0,e.width,e.height),n=new Uint8Array(g.data);let h;for(let i=0;ie==="vertical"||e==="horizontal"||e==="cross"||e==="esriSFSCross"||e==="esriSFSVertical"||e==="esriSFSHorizontal";function z(e,T,d){const r=T.style,l=u(Math.ceil(d)),t=y(r)?8*l:16*l,o=2*l;e.width=t,e.height=t;const a=e.getContext("2d");a.strokeStyle="#FFFFFF",a.lineWidth=l,a.beginPath(),r!=="vertical"&&r!=="cross"&&r!=="esriSFSCross"&&r!=="esriSFSVertical"||(a.moveTo(t/2,-o),a.lineTo(t/2,t+o)),r!=="horizontal"&&r!=="cross"&&r!=="esriSFSCross"&&r!=="esriSFSHorizontal"||(a.moveTo(-o,t/2),a.lineTo(t+o,t/2)),r!=="backward-diagonal"&&r!=="diagonal-cross"&&r!=="esriSFSDiagonalCross"&&r!=="esriSFSBackwardDiagonal"||(a.moveTo(-o,-o),a.lineTo(t+o,t+o),a.moveTo(t-o,-o),a.lineTo(t+o,o),a.moveTo(-o,t-o),a.lineTo(o,t+o)),r!=="forward-diagonal"&&r!=="diagonal-cross"&&r!=="esriSFSForwardDiagonal"&&r!=="esriSFSDiagonalCross"||(a.moveTo(t+o,-o),a.lineTo(-o,t+o),a.moveTo(o,-o),a.lineTo(-o,o),a.moveTo(t+o,t-o),a.lineTo(t-o,t+o)),a.stroke();const g=a.getImageData(0,0,e.width,e.height),n=new Uint8Array(g.data);let h;for(let i=0;i{let n,r,l,u,s;if(e.data)if(e.data instanceof ArrayBuffer){if(!(t!=="json"&&t!=="text"&&t!=="blob"||(n=new Blob([e.data]),t!=="json"&&t!=="text"||(u=await n.text(),t!=="json")))){try{r=JSON.parse(u||null)}catch(i){const b={...i,url:o,requestOptions:a};throw new p("request:server",i.message,b)}if(r.error){const i={...r.error,url:o,requestOptions:a};throw new p("request:server",r.error.message,i)}}}else t==="native"&&(e.data.signal=c,l=await fetch(e.data.url,e.data),e.httpStatus=l.status);switch(t){case"blob":s=n;break;case"json":s=r;break;case"native":s=l;break;case"text":s=u;break;default:s=e.data}return{data:s,httpStatus:e.httpStatus,requestOptions:a,ssl:e.ssl,url:o}})}export{d as execute}; +import{N as p}from"./index-BjUNJPVf.js";function d(o,a){let t=a.responseType;t?t!=="array-buffer"&&t!=="blob"&&t!=="json"&&t!=="native"&&t!=="native-request-init"&&t!=="text"&&(t="text"):t="json",a.responseType=t;const c=a.signal;return delete a.signal,globalThis.invokeStaticMessage("request",{url:o,options:a},{signal:c}).then(async e=>{let n,r,l,u,s;if(e.data)if(e.data instanceof ArrayBuffer){if(!(t!=="json"&&t!=="text"&&t!=="blob"||(n=new Blob([e.data]),t!=="json"&&t!=="text"||(u=await n.text(),t!=="json")))){try{r=JSON.parse(u||null)}catch(i){const b={...i,url:o,requestOptions:a};throw new p("request:server",i.message,b)}if(r.error){const i={...r.error,url:o,requestOptions:a};throw new p("request:server",r.error.message,i)}}}else t==="native"&&(e.data.signal=c,l=await fetch(e.data.url,e.data),e.httpStatus=l.status);switch(t){case"blob":s=n;break;case"json":s=r;break;case"native":s=l;break;case"text":s=u;break;default:s=e.data}return{data:s,httpStatus:e.httpStatus,requestOptions:a,ssl:e.ssl,url:o}})}export{d as execute}; diff --git a/assets/requestImageUtils-Dzwz9ori.js b/assets/requestImageUtils-BHJ_ulwE.js similarity index 54% rename from assets/requestImageUtils-Dzwz9ori.js rename to assets/requestImageUtils-BHJ_ulwE.js index b4b5bf6..e850717 100644 --- a/assets/requestImageUtils-Dzwz9ori.js +++ b/assets/requestImageUtils-BHJ_ulwE.js @@ -1 +1 @@ -import{M as n}from"./index-CEWggaxV.js";async function r(a,t){const{data:e}=await n(a,{responseType:"image",...t});return e}export{r as t}; +import{M as n}from"./index-BjUNJPVf.js";async function r(a,t){const{data:e}=await n(a,{responseType:"image",...t});return e}export{r as t}; diff --git a/assets/resourceExtension-orEjzZQo.js b/assets/resourceExtension-CiV172Z4.js similarity index 88% rename from assets/resourceExtension-orEjzZQo.js rename to assets/resourceExtension-CiV172Z4.js index 1e10c47..c7f0328 100644 --- a/assets/resourceExtension-orEjzZQo.js +++ b/assets/resourceExtension-CiV172Z4.js @@ -1 +1 @@ -import{b$ as a}from"./index-CEWggaxV.js";function m(p){return i[e(p)]||l}function e(p){return p.type==="json"?"application/json":p.type==="blob"?p.blob.type:g(p.url)}function g(p){const o=a(p);return t[o]||n}const i={},n="text/plain",l=i[n],t={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"};for(const p in t)i[t[p]]=p;export{m as p}; +import{b$ as a}from"./index-BjUNJPVf.js";function m(p){return i[e(p)]||l}function e(p){return p.type==="json"?"application/json":p.type==="blob"?p.blob.type:g(p.url)}function g(p){const o=a(p);return t[o]||n}const i={},n="text/plain",l=i[n],t={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"};for(const p in t)i[t[p]]=p;export{m as p}; diff --git a/assets/resourceUtils-BqKyAr0B.js b/assets/resourceUtils-BHmy1O5x.js similarity index 92% rename from assets/resourceUtils-BqKyAr0B.js rename to assets/resourceUtils-BHmy1O5x.js index 9e5e966..4802f16 100644 --- a/assets/resourceUtils-BqKyAr0B.js +++ b/assets/resourceUtils-BHmy1O5x.js @@ -1 +1 @@ -import{E as L}from"./index-CEWggaxV.js";import{u as d}from"./basicInterfaces-GbxEOYtk.js";class h{constructor(r){this.data=r,this.type="encoded-mesh-texture",this.encoding=d.KTX2_ENCODING}}function w(e){return(e==null?void 0:e.type)==="encoded-mesh-texture"}async function E(e){const r=new Blob([e]),o=await r.text();return JSON.parse(o)}async function f(e,r){if(r===d.KTX2_ENCODING)return new h(e);const o=new Blob([e],{type:r}),n=URL.createObjectURL(o),t=new Image;if(L("esri-iPhone"))return new Promise((c,m)=>{const s=()=>{a(),c(t)},i=u=>{a(),m(u)},a=()=>{URL.revokeObjectURL(n),t.removeEventListener("load",s),t.removeEventListener("error",i)};t.addEventListener("load",s),t.addEventListener("error",i),t.src=n});try{t.src=n,await t.decode()}catch{console.warn("Failed decoding HTMLImageElement")}return URL.revokeObjectURL(n),t}export{E as n,f as o,w as r,h as t}; +import{E as L}from"./index-BjUNJPVf.js";import{u as d}from"./basicInterfaces-GbxEOYtk.js";class h{constructor(r){this.data=r,this.type="encoded-mesh-texture",this.encoding=d.KTX2_ENCODING}}function w(e){return(e==null?void 0:e.type)==="encoded-mesh-texture"}async function E(e){const r=new Blob([e]),o=await r.text();return JSON.parse(o)}async function f(e,r){if(r===d.KTX2_ENCODING)return new h(e);const o=new Blob([e],{type:r}),n=URL.createObjectURL(o),t=new Image;if(L("esri-iPhone"))return new Promise((c,m)=>{const s=()=>{a(),c(t)},i=u=>{a(),m(u)},a=()=>{URL.revokeObjectURL(n),t.removeEventListener("load",s),t.removeEventListener("error",i)};t.addEventListener("load",s),t.addEventListener("error",i),t.src=n});try{t.src=n,await t.decode()}catch{console.warn("Failed decoding HTMLImageElement")}return URL.revokeObjectURL(n),t}export{E as n,f as o,w as r,h as t}; diff --git a/assets/resourceUtils-CjqYbm2Q.js b/assets/resourceUtils-CfE36DzP.js similarity index 97% rename from assets/resourceUtils-CjqYbm2Q.js rename to assets/resourceUtils-CfE36DzP.js index 48ce0ac..30e9373 100644 --- a/assets/resourceUtils-CjqYbm2Q.js +++ b/assets/resourceUtils-CfE36DzP.js @@ -1 +1 @@ -import{b_ as p,N as h,b$ as R,M as x}from"./index-CEWggaxV.js";async function q(e,t={},s){await e.load(s);const r=p(e.itemUrl,"resources"),{start:a=1,num:m=10,sortOrder:n="asc",sortField:f="resource"}=t,l={query:{start:a,num:m,sortOrder:n,sortField:f,token:e.apiKey},signal:s==null?void 0:s.signal},o=await e.portal.request(r,l);return{total:o.total,nextStart:o.nextStart,resources:o.resources.map(({created:d,size:c,resource:i})=>({created:new Date(d),size:c,resource:e.resourceFromPath(i)}))}}async function F(e,t,s,r){const a=new Map;for(const{resource:n,content:f,compress:l,access:o}of t){if(!n.hasPath())throw new h(`portal-item-resource-${s}:invalid-path`,"Resource does not have a valid path");const[d,c]=g(n.path),i=`${d}/${l??""}/${o??""}`;a.has(i)||a.set(i,{prefix:d,compress:l,access:o,files:[]}),a.get(i).files.push({fileName:c,content:f})}await e.load(r);const m=p(e.userItemUrl,s==="add"?"addResources":"updateResources");for(const{prefix:n,compress:f,access:l,files:o}of a.values())for(let c=0;c({created:new Date(d),size:c,resource:e.resourceFromPath(i)}))}}async function F(e,t,s,r){const a=new Map;for(const{resource:n,content:f,compress:l,access:o}of t){if(!n.hasPath())throw new h(`portal-item-resource-${s}:invalid-path`,"Resource does not have a valid path");const[d,c]=g(n.path),i=`${d}/${l??""}/${o??""}`;a.has(i)||a.set(i,{prefix:d,compress:l,access:o,files:[]}),a.get(i).files.push({fileName:c,content:f})}await e.load(r);const m=p(e.userItemUrl,s==="add"?"addResources":"updateResources");for(const{prefix:n,compress:f,access:l,files:o}of a.values())for(let c=0;c __vite__mapDeps.viteFileDeps[i]) } -import{da as g,_ as v,db as S,at as y,N as E,dc as P}from"./index-CEWggaxV.js";import{getSiblingOfSameTypeI as $,contentToBlob as m}from"./resourceUtils-CjqYbm2Q.js";async function R(s,t,o){const r=await w(s,t,o);await I(r,t,o)}async function T(s,t,o,r,a){const c=await w(o,r,a);await s.update({data:t}),await I(c,r,a)}async function w(s,t,o){if(!(t!=null&&t.resources))return;const r=t.portalItem===s.portalItem?new Set(s.paths):new Set;s.paths.length=0,s.portalItem=t.portalItem;const a=new Set(t.resources.toKeep.map(e=>e.resource.path)),c=new Set,f=[];a.forEach(e=>{r.delete(e),s.paths.push(e)});const u=[],h=[],p=[];for(const e of t.resources.toUpdate)if(r.delete(e.resource.path),a.has(e.resource.path)||c.has(e.resource.path)){const{resource:n,content:_,finish:d}=e,i=$(n,g());s.paths.push(i.path),u.push({resource:i,content:await m(_),compress:e.compress}),d&&p.push(()=>d(i))}else{s.paths.push(e.resource.path),h.push({resource:e.resource,content:await m(e.content),compress:e.compress});const n=e.finish;n&&p.push(()=>n(e.resource)),c.add(e.resource.path)}for(const e of t.resources.toAdd)if(s.paths.push(e.resource.path),r.has(e.resource.path))r.delete(e.resource.path);else{u.push({resource:e.resource,content:await m(e.content),compress:e.compress});const n=e.finish;n&&p.push(()=>n(e.resource))}if(u.length||h.length){const{addOrUpdateResources:e}=await v(()=>import("./resourceUtils-CjqYbm2Q.js"),__vite__mapDeps([0,1,2]));await e(t.portalItem,u,"add",o),await e(t.portalItem,h,"update",o)}if(p.forEach(e=>e()),f.length===0)return r;const l=await S(f);if(y(o),l.length>0)throw new E("save:resources","Failed to save one or more resources",{errors:l});return r}async function I(s,t,o){if(!s||!t.portalItem)return;const r=[];for(const a of s){const c=t.portalItem.resourceFromPath(a);r.push(c.portalItem.removeResource(c,o))}await P(r)}export{T as n,R as p}; +import{da as g,_ as v,db as S,at as y,N as E,dc as P}from"./index-BjUNJPVf.js";import{getSiblingOfSameTypeI as $,contentToBlob as m}from"./resourceUtils-CfE36DzP.js";async function R(s,t,o){const r=await w(s,t,o);await I(r,t,o)}async function T(s,t,o,r,a){const c=await w(o,r,a);await s.update({data:t}),await I(c,r,a)}async function w(s,t,o){if(!(t!=null&&t.resources))return;const r=t.portalItem===s.portalItem?new Set(s.paths):new Set;s.paths.length=0,s.portalItem=t.portalItem;const a=new Set(t.resources.toKeep.map(e=>e.resource.path)),c=new Set,f=[];a.forEach(e=>{r.delete(e),s.paths.push(e)});const u=[],h=[],p=[];for(const e of t.resources.toUpdate)if(r.delete(e.resource.path),a.has(e.resource.path)||c.has(e.resource.path)){const{resource:n,content:_,finish:d}=e,i=$(n,g());s.paths.push(i.path),u.push({resource:i,content:await m(_),compress:e.compress}),d&&p.push(()=>d(i))}else{s.paths.push(e.resource.path),h.push({resource:e.resource,content:await m(e.content),compress:e.compress});const n=e.finish;n&&p.push(()=>n(e.resource)),c.add(e.resource.path)}for(const e of t.resources.toAdd)if(s.paths.push(e.resource.path),r.has(e.resource.path))r.delete(e.resource.path);else{u.push({resource:e.resource,content:await m(e.content),compress:e.compress});const n=e.finish;n&&p.push(()=>n(e.resource))}if(u.length||h.length){const{addOrUpdateResources:e}=await v(()=>import("./resourceUtils-CfE36DzP.js"),__vite__mapDeps([0,1,2]));await e(t.portalItem,u,"add",o),await e(t.portalItem,h,"update",o)}if(p.forEach(e=>e()),f.length===0)return r;const l=await S(f);if(y(o),l.length>0)throw new E("save:resources","Failed to save one or more resources",{errors:l});return r}async function I(s,t,o){if(!s||!t.portalItem)return;const r=[];for(const a of s){const c=t.portalItem.resourceFromPath(a);r.push(c.portalItem.removeResource(c,o))}await P(r)}export{T as n,R as p}; diff --git a/assets/saveAPIKeyUtils-BiX1lQSW.js b/assets/saveAPIKeyUtils-YRBbgdzi.js similarity index 73% rename from assets/saveAPIKeyUtils-BiX1lQSW.js rename to assets/saveAPIKeyUtils-YRBbgdzi.js index a9a6c1d..17c9d4c 100644 --- a/assets/saveAPIKeyUtils-BiX1lQSW.js +++ b/assets/saveAPIKeyUtils-YRBbgdzi.js @@ -1 +1 @@ -import{bE as o,dd as p,N as i}from"./index-CEWggaxV.js";function t(a){if(o.apiKey&&p(a.portal.url))throw new i("save-api-key-utils:api-key-not-supported",`Saving is not supported on ${a.portal.url} when using an api key`)}export{t as i}; +import{bE as o,dd as p,N as i}from"./index-BjUNJPVf.js";function t(a){if(o.apiKey&&p(a.portal.url))throw new i("save-api-key-utils:api-key-not-supported",`Saving is not supported on ${a.portal.url} when using an api key`)}export{t as i}; diff --git a/assets/saveUtils-BzCRy3uR.js b/assets/saveUtils-CGGzyvzv.js similarity index 93% rename from assets/saveUtils-BzCRy3uR.js rename to assets/saveUtils-CGGzyvzv.js index 0f5ec93..6fd9346 100644 --- a/assets/saveUtils-BzCRy3uR.js +++ b/assets/saveUtils-CGGzyvzv.js @@ -1 +1 @@ -import{N as l}from"./index-CEWggaxV.js";async function d(t){const s=[];for(const o of t.allLayers)if("beforeSave"in o&&typeof o.beforeSave=="function"){const e=o.beforeSave();e&&s.push(e)}await Promise.allSettled(s)}const i=new Set(["layer:unsupported","property:unsupported","symbol:unsupported","symbol-layer:unsupported","url:unsupported"]);function f(t,s,o){let e=(t.messages??[]).filter(({type:r})=>r==="error").map(({name:r,message:a,details:p})=>new l(r,a,p));if(t.blockedRelativeUrls&&(e=e.concat(t.blockedRelativeUrls.map(r=>new l("url:unsupported",`Relative url '${r}' is not supported`)))),o){const{ignoreUnsupported:r,supplementalUnsupportedErrors:a=[],requiredPropertyChecksDisabled:p}=o;r&&(e=e.filter(({name:n})=>!(i.has(n)||a.includes(n)))),p&&(e=e.filter(n=>n.name!=="web-document-write:property-required"))}if(e.length>0)throw new l(s.errorName,"Failed to save due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:e})}export{d as r,f as t}; +import{N as l}from"./index-BjUNJPVf.js";async function d(t){const s=[];for(const o of t.allLayers)if("beforeSave"in o&&typeof o.beforeSave=="function"){const e=o.beforeSave();e&&s.push(e)}await Promise.allSettled(s)}const i=new Set(["layer:unsupported","property:unsupported","symbol:unsupported","symbol-layer:unsupported","url:unsupported"]);function f(t,s,o){let e=(t.messages??[]).filter(({type:r})=>r==="error").map(({name:r,message:a,details:p})=>new l(r,a,p));if(t.blockedRelativeUrls&&(e=e.concat(t.blockedRelativeUrls.map(r=>new l("url:unsupported",`Relative url '${r}' is not supported`)))),o){const{ignoreUnsupported:r,supplementalUnsupportedErrors:a=[],requiredPropertyChecksDisabled:p}=o;r&&(e=e.filter(({name:n})=>!(i.has(n)||a.includes(n)))),p&&(e=e.filter(n=>n.name!=="web-document-write:property-required"))}if(e.length>0)throw new l(s.errorName,"Failed to save due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:e})}export{d as r,f as t}; diff --git a/assets/scaleUtils-Bqauo1zZ.js b/assets/scaleUtils-DWXMiS7R.js similarity index 82% rename from assets/scaleUtils-Bqauo1zZ.js rename to assets/scaleUtils-DWXMiS7R.js index 8da2eba..894ac91 100644 --- a/assets/scaleUtils-Bqauo1zZ.js +++ b/assets/scaleUtils-DWXMiS7R.js @@ -1 +1 @@ -import{bo as u,bp as i,bq as c}from"./index-CEWggaxV.js";const e=96;function d(n,t){const r=t||n.extent,o=n.width,a=u(r==null?void 0:r.spatialReference);return r&&o?r.width/o*a*i*e:0}function b(n,t){return n/(u(t)*i*e)}function h(n,t,r){return f(n,t)&&s(n,r)}function f(n,t){return t===0||c(n,t)||nt}export{h as d,d as i,b as o}; +import{bo as u,bp as i,bq as c}from"./index-BjUNJPVf.js";const e=96;function d(n,t){const r=t||n.extent,o=n.width,a=u(r==null?void 0:r.spatialReference);return r&&o?r.width/o*a*i*e:0}function b(n,t){return n/(u(t)*i*e)}function h(n,t,r){return f(n,t)&&s(n,r)}function f(n,t){return t===0||c(n,t)||nt}export{h as d,d as i,b as o}; diff --git a/assets/scrim-DPpUFS3O.js b/assets/scrim-CUXJVHyU.js similarity index 91% rename from assets/scrim-DPpUFS3O.js rename to assets/scrim-CUXJVHyU.js index 931fbc8..86b4d8b 100644 --- a/assets/scrim-DPpUFS3O.js +++ b/assets/scrim-CUXJVHyU.js @@ -1,4 +1,4 @@ -import{c2 as o,c3 as r,c0 as t}from"./index-CEWggaxV.js";import{u as l,c as d,a as h,s as m,d as f,b as g}from"./t9n-gKZJT8eY.js";import{c as u}from"./observers-MZ9Ss0UR.js";import{k as p}from"./dom-DPsTWDAQ.js";import{d as v}from"./loader-DQtzvvHl.js";/*! +import{c2 as o,c3 as r,c0 as t}from"./index-BjUNJPVf.js";import{u as l,c as d,a as h,s as m,d as f,b as g}from"./t9n-pVz2fW_o.js";import{c as u}from"./observers-B6R0JooC.js";import{k as p}from"./dom-DPsTWDAQ.js";import{d as v}from"./loader-Bjz1lIB0.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.7.1 diff --git a/assets/serviceCapabilitiesUtils-t8SL4e_j.js b/assets/serviceCapabilitiesUtils-DiP90Uds.js similarity index 98% rename from assets/serviceCapabilitiesUtils-t8SL4e_j.js rename to assets/serviceCapabilitiesUtils-DiP90Uds.js index f906282..044c9d0 100644 --- a/assets/serviceCapabilitiesUtils-t8SL4e_j.js +++ b/assets/serviceCapabilitiesUtils-DiP90Uds.js @@ -1 +1 @@ -import{av as g,E as S,b7 as A}from"./index-CEWggaxV.js";function t(s,e,r){return!!h(s,e,r)}function c(s,e,r){return h(s,e,r)}function h(s,e,r){return s&&s.hasOwnProperty(e)?s[e]:r}const Q={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"};function v(s){var r;const e=(r=s==null?void 0:s.supportedSpatialAggregationStatistics)==null?void 0:r.map(p=>p.toLowerCase());return{envelope:!!(e!=null&&e.includes("envelopeaggregate")),centroid:!!(e!=null&&e.includes("centroidaggregate")),convexHull:!!(e!=null&&e.includes("convexhullaggregate"))}}function d(s,e){var p;const r=(p=s==null?void 0:s.supportedOperationsWithCacheHint)==null?void 0:p.map(o=>o.toLowerCase());return!!(r!=null&&r.includes(e.toLowerCase()))}function M(s,e){return{analytics:R(s),attachment:f(s),data:x(s),metadata:T(s),operations:F(s.capabilities,s,e),query:w(s,e),queryRelated:E(s),queryTopFeatures:D(s),editing:b(s)}}function R(s){return{supportsCacheHint:d(s.advancedQueryCapabilities,"queryAnalytics")}}function f(s){const e=s.attachmentProperties,r={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:d(s.advancedQueryCapabilities,"queryAttachments"),supportsResize:t(s,"supportsAttachmentsResizing",!1)};return e&&Array.isArray(e)&&e.forEach(p=>{const o=Q[p.name];o&&(r[o]=!!p.isEnabled)}),r}function x(s){return{isVersioned:t(s,"isDataVersioned",!1),supportsAttachment:t(s,"hasAttachments",!1),supportsM:t(s,"hasM",!1),supportsZ:t(s,"hasZ",!1)}}function T(s){return{supportsAdvancedFieldProperties:t(s,"supportsFieldDescriptionProperty",!1)}}function F(s,e,r){const p=s?s.toLowerCase().split(",").map(C=>C.trim()):[],o=r?g(r):null,l=p.includes(o!=null&&o.serverType==="MapServer"?"data":"query"),u=p.includes("editing")&&!e.datesInUnknownTimezone;let a=u&&p.includes("create"),n=u&&p.includes("delete"),i=u&&p.includes("update");const y=p.includes("changetracking"),m=e.advancedQueryCapabilities;return u&&!(a||n||i)&&(a=n=i=!0),{supportsCalculate:t(e,"supportsCalculate",!1),supportsTruncate:t(e,"supportsTruncate",!1),supportsValidateSql:t(e,"supportsValidateSql",!1),supportsAdd:a,supportsDelete:n,supportsEditing:u,supportsChangeTracking:y,supportsQuery:l,supportsQueryAnalytics:t(m,"supportsQueryAnalytic",!1),supportsQueryAttachments:t(m,"supportsQueryAttachments",!1),supportsQueryTopFeatures:t(m,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:t(e,"supportsAttachmentsResizing",!1),supportsSync:p.includes("sync"),supportsUpdate:i,supportsExceedsLimitStatistics:t(e,"supportsExceedsLimitStatistics",!1),supportsAsyncConvert3D:t(e,"supportsAsyncConvert3D",!1)}}function w(s,e){const r=s.advancedQueryCapabilities,p=s.ownershipBasedAccessControlForFeatures,o=s.archivingInfo,l=s.currentVersion,u=e==null?void 0:e.includes("MapServer"),a=!u||l>=S("mapserver-pbf-version-support"),n=A(e),i=new Set((s.supportedQueryFormats??"").split(",").map(y=>y.toLowerCase().trim()));return{supportsStatistics:t(r,"supportsStatistics",s.supportsStatistics),supportsPercentileStatistics:t(r,"supportsPercentileStatistics",!1),supportsSpatialAggregationStatistics:t(r,"supportsSpatialAggregationStatistics",!1),supportedSpatialAggregationStatistics:v(r),supportsCentroid:t(r,"supportsReturningGeometryCentroid",!1),supportsDistance:t(r,"supportsQueryWithDistance",!1),supportsDistinct:t(r,"supportsDistinct",s.supportsAdvancedQueries),supportsExtent:t(r,"supportsReturningQueryExtent",!1),supportsGeometryProperties:t(r,"supportsReturningGeometryProperties",!1),supportsHavingClause:t(r,"supportsHavingClause",!1),supportsOrderBy:t(r,"supportsOrderBy",s.supportsAdvancedQueries),supportsPagination:t(r,"supportsPagination",!1),supportsQuantization:t(s,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:t(s,"supportsQuantizationEditMode",!1),supportsQueryGeometry:t(s,"supportsReturningQueryGeometry",!1),supportsResultType:t(r,"supportsQueryWithResultType",!1),supportsMaxRecordCountFactor:t(r,"supportsMaxRecordCountFactor",!1),supportsSqlExpression:t(r,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:t(s,"useStandardizedQueries",!1),supportsTopFeaturesQuery:t(r,"supportsTopFeaturesQuery",!1),supportsQueryByAnonymous:t(p,"allowAnonymousToQuery",!0),supportsQueryByOthers:t(p,"allowOthersToQuery",!0),supportsHistoricMoment:t(o,"supportsQueryWithHistoricMoment",!1),supportsFormatPBF:a&&i.has("pbf"),supportsDisjointSpatialRelationship:t(r,"supportsDisjointSpatialRel",!1),supportsCacheHint:t(r,"supportsQueryWithCacheHint",!1)||d(r,"query"),supportsDefaultSpatialReference:t(r,"supportsDefaultSR",!1),supportsCompactGeometry:n,supportsFullTextSearch:t(r,"supportsFullTextSearch",!1),maxRecordCountFactor:c(s,"maxRecordCountFactor",void 0),maxRecordCount:c(s,"maxRecordCount",void 0),standardMaxRecordCount:c(s,"standardMaxRecordCount",void 0),tileMaxRecordCount:c(s,"tileMaxRecordCount",void 0)}}function E(s){const e=s.advancedQueryCapabilities,r=t(e,"supportsAdvancedQueryRelated",!1);return{supportsPagination:t(e,"supportsQueryRelatedPagination",!1),supportsCount:r,supportsOrderBy:r,supportsCacheHint:d(e,"queryRelated")}}function D(s){return{supportsCacheHint:d(s.advancedQueryCapabilities,"queryTopFilter")}}function b(s){const e=s.ownershipBasedAccessControlForFeatures,r=s?s.advancedEditingCapabilities:void 0;return{supportsGeometryUpdate:t(s,"allowGeometryUpdates",!0),supportsGlobalId:t(s,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:t(s,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:t(s,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:t(s,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:t(s,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:t(e,"allowAnonymousToDelete",!0),supportsDeleteByOthers:t(e,"allowOthersToDelete",!0),supportsUpdateByAnonymous:t(e,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:t(e,"allowOthersToUpdate",!0),supportsAsyncApplyEdits:t(r,"supportsAsyncApplyEdits",!1),zDefault:c(s,"zDefault",void 0)}}export{M as a}; +import{av as g,E as S,b7 as A}from"./index-BjUNJPVf.js";function t(s,e,r){return!!h(s,e,r)}function c(s,e,r){return h(s,e,r)}function h(s,e,r){return s&&s.hasOwnProperty(e)?s[e]:r}const Q={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"};function v(s){var r;const e=(r=s==null?void 0:s.supportedSpatialAggregationStatistics)==null?void 0:r.map(p=>p.toLowerCase());return{envelope:!!(e!=null&&e.includes("envelopeaggregate")),centroid:!!(e!=null&&e.includes("centroidaggregate")),convexHull:!!(e!=null&&e.includes("convexhullaggregate"))}}function d(s,e){var p;const r=(p=s==null?void 0:s.supportedOperationsWithCacheHint)==null?void 0:p.map(o=>o.toLowerCase());return!!(r!=null&&r.includes(e.toLowerCase()))}function M(s,e){return{analytics:R(s),attachment:f(s),data:x(s),metadata:T(s),operations:F(s.capabilities,s,e),query:w(s,e),queryRelated:E(s),queryTopFeatures:D(s),editing:b(s)}}function R(s){return{supportsCacheHint:d(s.advancedQueryCapabilities,"queryAnalytics")}}function f(s){const e=s.attachmentProperties,r={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:d(s.advancedQueryCapabilities,"queryAttachments"),supportsResize:t(s,"supportsAttachmentsResizing",!1)};return e&&Array.isArray(e)&&e.forEach(p=>{const o=Q[p.name];o&&(r[o]=!!p.isEnabled)}),r}function x(s){return{isVersioned:t(s,"isDataVersioned",!1),supportsAttachment:t(s,"hasAttachments",!1),supportsM:t(s,"hasM",!1),supportsZ:t(s,"hasZ",!1)}}function T(s){return{supportsAdvancedFieldProperties:t(s,"supportsFieldDescriptionProperty",!1)}}function F(s,e,r){const p=s?s.toLowerCase().split(",").map(C=>C.trim()):[],o=r?g(r):null,l=p.includes(o!=null&&o.serverType==="MapServer"?"data":"query"),u=p.includes("editing")&&!e.datesInUnknownTimezone;let a=u&&p.includes("create"),n=u&&p.includes("delete"),i=u&&p.includes("update");const y=p.includes("changetracking"),m=e.advancedQueryCapabilities;return u&&!(a||n||i)&&(a=n=i=!0),{supportsCalculate:t(e,"supportsCalculate",!1),supportsTruncate:t(e,"supportsTruncate",!1),supportsValidateSql:t(e,"supportsValidateSql",!1),supportsAdd:a,supportsDelete:n,supportsEditing:u,supportsChangeTracking:y,supportsQuery:l,supportsQueryAnalytics:t(m,"supportsQueryAnalytic",!1),supportsQueryAttachments:t(m,"supportsQueryAttachments",!1),supportsQueryTopFeatures:t(m,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:t(e,"supportsAttachmentsResizing",!1),supportsSync:p.includes("sync"),supportsUpdate:i,supportsExceedsLimitStatistics:t(e,"supportsExceedsLimitStatistics",!1),supportsAsyncConvert3D:t(e,"supportsAsyncConvert3D",!1)}}function w(s,e){const r=s.advancedQueryCapabilities,p=s.ownershipBasedAccessControlForFeatures,o=s.archivingInfo,l=s.currentVersion,u=e==null?void 0:e.includes("MapServer"),a=!u||l>=S("mapserver-pbf-version-support"),n=A(e),i=new Set((s.supportedQueryFormats??"").split(",").map(y=>y.toLowerCase().trim()));return{supportsStatistics:t(r,"supportsStatistics",s.supportsStatistics),supportsPercentileStatistics:t(r,"supportsPercentileStatistics",!1),supportsSpatialAggregationStatistics:t(r,"supportsSpatialAggregationStatistics",!1),supportedSpatialAggregationStatistics:v(r),supportsCentroid:t(r,"supportsReturningGeometryCentroid",!1),supportsDistance:t(r,"supportsQueryWithDistance",!1),supportsDistinct:t(r,"supportsDistinct",s.supportsAdvancedQueries),supportsExtent:t(r,"supportsReturningQueryExtent",!1),supportsGeometryProperties:t(r,"supportsReturningGeometryProperties",!1),supportsHavingClause:t(r,"supportsHavingClause",!1),supportsOrderBy:t(r,"supportsOrderBy",s.supportsAdvancedQueries),supportsPagination:t(r,"supportsPagination",!1),supportsQuantization:t(s,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:t(s,"supportsQuantizationEditMode",!1),supportsQueryGeometry:t(s,"supportsReturningQueryGeometry",!1),supportsResultType:t(r,"supportsQueryWithResultType",!1),supportsMaxRecordCountFactor:t(r,"supportsMaxRecordCountFactor",!1),supportsSqlExpression:t(r,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:t(s,"useStandardizedQueries",!1),supportsTopFeaturesQuery:t(r,"supportsTopFeaturesQuery",!1),supportsQueryByAnonymous:t(p,"allowAnonymousToQuery",!0),supportsQueryByOthers:t(p,"allowOthersToQuery",!0),supportsHistoricMoment:t(o,"supportsQueryWithHistoricMoment",!1),supportsFormatPBF:a&&i.has("pbf"),supportsDisjointSpatialRelationship:t(r,"supportsDisjointSpatialRel",!1),supportsCacheHint:t(r,"supportsQueryWithCacheHint",!1)||d(r,"query"),supportsDefaultSpatialReference:t(r,"supportsDefaultSR",!1),supportsCompactGeometry:n,supportsFullTextSearch:t(r,"supportsFullTextSearch",!1),maxRecordCountFactor:c(s,"maxRecordCountFactor",void 0),maxRecordCount:c(s,"maxRecordCount",void 0),standardMaxRecordCount:c(s,"standardMaxRecordCount",void 0),tileMaxRecordCount:c(s,"tileMaxRecordCount",void 0)}}function E(s){const e=s.advancedQueryCapabilities,r=t(e,"supportsAdvancedQueryRelated",!1);return{supportsPagination:t(e,"supportsQueryRelatedPagination",!1),supportsCount:r,supportsOrderBy:r,supportsCacheHint:d(e,"queryRelated")}}function D(s){return{supportsCacheHint:d(s.advancedQueryCapabilities,"queryTopFilter")}}function b(s){const e=s.ownershipBasedAccessControlForFeatures,r=s?s.advancedEditingCapabilities:void 0;return{supportsGeometryUpdate:t(s,"allowGeometryUpdates",!0),supportsGlobalId:t(s,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:t(s,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:t(s,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:t(s,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:t(s,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:t(e,"allowAnonymousToDelete",!0),supportsDeleteByOthers:t(e,"allowOthersToDelete",!0),supportsUpdateByAnonymous:t(e,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:t(e,"allowOthersToUpdate",!0),supportsAsyncApplyEdits:t(r,"supportsAsyncApplyEdits",!1),zDefault:c(s,"zDefault",void 0)}}export{M as a}; diff --git a/assets/sourceUtils-QX9lwl5p.js b/assets/sourceUtils-BNTaqxhX.js similarity index 81% rename from assets/sourceUtils-QX9lwl5p.js rename to assets/sourceUtils-BNTaqxhX.js index 44d7acc..2b313b9 100644 --- a/assets/sourceUtils-QX9lwl5p.js +++ b/assets/sourceUtils-BNTaqxhX.js @@ -1,7 +1,7 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/geometryEngineJSON-D-7-cYHZ.js","assets/geometryEngineBase-C5__2Su1.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css","assets/json-Wa8cmqdu.js"] + __vite__mapDeps.viteFileDeps = ["assets/geometryEngineJSON-BfS7Q-po.js","assets/geometryEngineBase-CDbTTSsS.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css","assets/json-Wa8cmqdu.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{cH as d,cI as h,Q as g,cJ as m,O as p,cK as y,cL as a,_ as w}from"./index-CEWggaxV.js";import{n as _}from"./date-M6n_RqpC.js";class I{constructor(){this.code=null,this.description=null}}class b{constructor(r){this.error=new I,this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error.description=r}}function l(n){return new b(n)}class q{constructor(r){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=r}}function A(n){return new q(n)}const u=new Set;function F(n,r,e,f=!1){u.clear();for(const i in e){const t=n.get(i);if(!t)continue;const o=P(t,e[i]);if(u.add(t.name),t&&(f||t.editable)){const c=d(t,o);if(c)return l(h(c,t,o));r[t.name]=o}}for(const i of(n==null?void 0:n.requiredFields)??[])if(!u.has(i.name))return l(`missing required field "${i.name}"`);return null}function P(n,r){let e=r;return g(n)&&typeof r=="string"?e=parseFloat(r):m(n)&&r!=null&&typeof r!="string"?e=String(r):p(n)&&typeof r=="string"&&(e=_(r)),y(e)}let s;function G(n,r){if(!n||!a(r))return n;if("rings"in n||"paths"in n){if(s==null)throw new TypeError("geometry engine not loaded");return s.simplify(r,n)}return n}async function j(){return s==null&&(s=await w(()=>import("./geometryEngineJSON-D-7-cYHZ.js").then(n=>n.g),__vite__mapDeps([0,1,2,3,4]))),s}async function L(n,r){!a(n)||r!=="esriGeometryPolygon"&&r!=="esriGeometryPolyline"||await j()}export{A as d,l as f,L as j,F as p,G as y}; +import{cH as d,cI as h,Q as g,cJ as m,O as p,cK as y,cL as a,_ as w}from"./index-BjUNJPVf.js";import{n as _}from"./date-M6n_RqpC.js";class I{constructor(){this.code=null,this.description=null}}class b{constructor(r){this.error=new I,this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error.description=r}}function l(n){return new b(n)}class q{constructor(r){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=r}}function A(n){return new q(n)}const u=new Set;function F(n,r,e,f=!1){u.clear();for(const i in e){const t=n.get(i);if(!t)continue;const o=P(t,e[i]);if(u.add(t.name),t&&(f||t.editable)){const c=d(t,o);if(c)return l(h(c,t,o));r[t.name]=o}}for(const i of(n==null?void 0:n.requiredFields)??[])if(!u.has(i.name))return l(`missing required field "${i.name}"`);return null}function P(n,r){let e=r;return g(n)&&typeof r=="string"?e=parseFloat(r):m(n)&&r!=null&&typeof r!="string"?e=String(r):p(n)&&typeof r=="string"&&(e=_(r)),y(e)}let s;function G(n,r){if(!n||!a(r))return n;if("rings"in n||"paths"in n){if(s==null)throw new TypeError("geometry engine not loaded");return s.simplify(r,n)}return n}async function j(){return s==null&&(s=await w(()=>import("./geometryEngineJSON-BfS7Q-po.js").then(n=>n.g),__vite__mapDeps([0,1,2,3,4]))),s}async function L(n,r){!a(n)||r!=="esriGeometryPolygon"&&r!=="esriGeometryPolyline"||await j()}export{A as d,l as f,L as j,F as p,G as y}; diff --git a/assets/sphere-DHd2K2LR.js b/assets/sphere-F1imyuMS.js similarity index 95% rename from assets/sphere-DHd2K2LR.js rename to assets/sphere-F1imyuMS.js index a8523af..970032c 100644 --- a/assets/sphere-DHd2K2LR.js +++ b/assets/sphere-F1imyuMS.js @@ -1 +1 @@ -import{cu as O,gL as a,gR as v,cS as P,cy as l,cT as N,cU as g,cX as M,cW as d,bj as w,ct as E,ck as b,gS as V,s as B,cj as D,gT as X,cv as T,gU as F,e2 as G,cV as H,gV as p,cx as I,gW as _,fg as j,gX as J,gY as K,gM as Q}from"./index-CEWggaxV.js";import{s as tt}from"./ObjectStack-CF0cQvd2.js";import{c as f,f as nt}from"./plane-py4f_JCU.js";function et(t,e){const n=O(t,e)/(a(t)*a(e));return-v(n)}function z(t){return t?q(P(t.origin),P(t.direction)):q(l(),l())}function q(t,e){return{origin:t,direction:e}}function qt(t,e){const n=it.get();return n.origin=t,n.direction=e,n}function ot(t,e,n=z()){return N(n.origin,t),g(n.direction,e,t),n}function rt(t,e,n){const o=O(t.direction,g(n,e,t.origin));return M(n,t.origin,d(n,t.direction,o)),n}const it=new tt(()=>z()),ct=A();function A(){return w()}const st=E,ut=E;function C(t,e){return b(e,t)}function at(t,e){return V(t[0],t[1],t[2],e)}function ft(t){return t}function gt(t){t[0]=t[1]=t[2]=t[3]=0}function lt(t,e){return t[0]=t[1]=t[2]=0,t[3]=e,t}function $(t){return t[3]}function dt(t){return t}function ht(t,e,n,o){return V(t,e,n,o)}function pt(t,e,n){return t!==n&&(n[0]=t[0],n[1]=t[1],n[2]=t[2]),n[3]=t[3]+e,n}function mt(t,e,n){return B.getLogger("esri.geometry.support.sphere").error("sphere.setExtent is not yet supported"),t!==n&&C(t,n),n}function S(t,e,n){if(e==null||!U(t,e,m))return!1;let{t0:o,t1:r}=m;if((o<0||r0)&&(o=r),o<0)return!1;if(n){const{origin:i,direction:c}=e;n[0]=i[0]+c[0]*o,n[1]=i[1]+c[1]*o,n[2]=i[2]+c[2]*o}return!0}function Mt(t,e,n){const o=ot(e,n);if(!U(t,o,m))return[];const{origin:r,direction:i}=o,{t0:c,t1:s}=m,u=h=>{const y=l();return Q(y,r,i,h),L(t,y,y)};return Math.abs(c-s)z()),ct=A();function A(){return w()}const st=E,ut=E;function C(t,e){return b(e,t)}function at(t,e){return V(t[0],t[1],t[2],e)}function ft(t){return t}function gt(t){t[0]=t[1]=t[2]=t[3]=0}function lt(t,e){return t[0]=t[1]=t[2]=0,t[3]=e,t}function $(t){return t[3]}function dt(t){return t}function ht(t,e,n,o){return V(t,e,n,o)}function pt(t,e,n){return t!==n&&(n[0]=t[0],n[1]=t[1],n[2]=t[2]),n[3]=t[3]+e,n}function mt(t,e,n){return B.getLogger("esri.geometry.support.sphere").error("sphere.setExtent is not yet supported"),t!==n&&C(t,n),n}function S(t,e,n){if(e==null||!U(t,e,m))return!1;let{t0:o,t1:r}=m;if((o<0||r0)&&(o=r),o<0)return!1;if(n){const{origin:i,direction:c}=e;n[0]=i[0]+c[0]*o,n[1]=i[1]+c[1]*o,n[2]=i[2]+c[2]*o}return!0}function Mt(t,e,n){const o=ot(e,n);if(!U(t,o,m))return[];const{origin:r,direction:i}=o,{t0:c,t1:s}=m,u=h=>{const y=l();return Q(y,r,i,h),L(t,y,y)};return Math.abs(c-s)!!o("enable-feature:force-wosr"),N=()=>o.add("enable-feature:direct-3d-object-feature-layer-display",!0,!0,!0),j=()=>o.add("enable-feature:direct-3d-object-feature-layer-display",!1,!0,!0),U=()=>o.add("enable-i3s-patching",!0,!0,!0),R=()=>o.add("enable-i3s-patching",!1,!0,!0),k=()=>!!o("enable-feature:SceneLayer-editing"),S=(e="i3s-patching")=>{switch(R(),j(),o.add("enable-feature:SceneLayer-editing",!0,!0,!0),e){case"feature-layer-view":N();break;case"i3s-patching":U()}};S("i3s-patching");let c={};async function I(e,r){try{return{data:(await C(e,r)).data,baseUrl:p(e),styleUrl:e}}catch(t){return h(t),null}}function q(e,r,t){const n=r.portal!=null?r.portal:w.getDefault();let s;const a=`${n.url} - ${n.user&&n.user.username} - ${e}`;return c[a]||(c[a]=A(e,n,t).then(l=>(s=l,l.fetchData())).then(l=>({data:l,baseUrl:s.itemUrl??"",styleName:e}))),c[a]}function A(e,r,t){return r.load(t).then(()=>{const n=new g({disableExtraQuery:!0,query:`owner:${u} AND type:${y} AND typekeywords:"${e}"`});return r.queryItems(n,t)}).then(({results:n})=>{var l;let s=null;const a=e.toLowerCase();if(n&&Array.isArray(n)){for(const i of n)if(((l=i.typeKeywords)==null?void 0:l.some(d=>d.toLowerCase()===a))&&i.type===y&&i.owner===u){s=i;break}}if(!s)throw new f("symbolstyleutils:style-not-found",`The style '${e}' could not be found`,{styleName:e});return s.load(t)})}function x(e,r,t){return(e==null?void 0:e.styleUrl)!=null?I(e.styleUrl,t):(e==null?void 0:e.styleName)!=null?q(e.styleName,r,t):Promise.reject(new f("symbolstyleutils:style-url-and-name-missing","Either styleUrl or styleName is required to resolve a style"))}function E(e){return e===null||e.type==="CIMSymbolReference"?e:{type:"CIMSymbolReference",symbol:e}}function M(e,r,t=["gltf"]){if(r==="cimRef")return e.cimRef;if(e.formatInfos&&!$())for(const n of t){const s=e.formatInfos.find(a=>a.type===n);if(s)return s.href}return e.webRef}function C(e,r){const t={responseType:"json",query:{f:"json"},...r};return m(b(e),t)}const u="esri_en",y="Style",v="https://cdn.arcgis.com/sharing/rest/content/items/220936cc6ed342c9937abd8f180e7d1e/resources/styles/cim/{SymbolName}.json?f=json";export{C as b,x as c,M as d,k as n,E as p,v as w}; +import{E as o,N as f,M as m,eR as b,d6 as p,ay as h,ax as w,eS as g}from"./index-BjUNJPVf.js";const $=()=>!!o("enable-feature:force-wosr"),N=()=>o.add("enable-feature:direct-3d-object-feature-layer-display",!0,!0,!0),j=()=>o.add("enable-feature:direct-3d-object-feature-layer-display",!1,!0,!0),U=()=>o.add("enable-i3s-patching",!0,!0,!0),R=()=>o.add("enable-i3s-patching",!1,!0,!0),k=()=>!!o("enable-feature:SceneLayer-editing"),S=(e="i3s-patching")=>{switch(R(),j(),o.add("enable-feature:SceneLayer-editing",!0,!0,!0),e){case"feature-layer-view":N();break;case"i3s-patching":U()}};S("i3s-patching");let c={};async function I(e,r){try{return{data:(await C(e,r)).data,baseUrl:p(e),styleUrl:e}}catch(t){return h(t),null}}function q(e,r,t){const n=r.portal!=null?r.portal:w.getDefault();let s;const a=`${n.url} - ${n.user&&n.user.username} - ${e}`;return c[a]||(c[a]=A(e,n,t).then(l=>(s=l,l.fetchData())).then(l=>({data:l,baseUrl:s.itemUrl??"",styleName:e}))),c[a]}function A(e,r,t){return r.load(t).then(()=>{const n=new g({disableExtraQuery:!0,query:`owner:${u} AND type:${y} AND typekeywords:"${e}"`});return r.queryItems(n,t)}).then(({results:n})=>{var l;let s=null;const a=e.toLowerCase();if(n&&Array.isArray(n)){for(const i of n)if(((l=i.typeKeywords)==null?void 0:l.some(d=>d.toLowerCase()===a))&&i.type===y&&i.owner===u){s=i;break}}if(!s)throw new f("symbolstyleutils:style-not-found",`The style '${e}' could not be found`,{styleName:e});return s.load(t)})}function x(e,r,t){return(e==null?void 0:e.styleUrl)!=null?I(e.styleUrl,t):(e==null?void 0:e.styleName)!=null?q(e.styleName,r,t):Promise.reject(new f("symbolstyleutils:style-url-and-name-missing","Either styleUrl or styleName is required to resolve a style"))}function E(e){return e===null||e.type==="CIMSymbolReference"?e:{type:"CIMSymbolReference",symbol:e}}function M(e,r,t=["gltf"]){if(r==="cimRef")return e.cimRef;if(e.formatInfos&&!$())for(const n of t){const s=e.formatInfos.find(a=>a.type===n);if(s)return s.href}return e.webRef}function C(e,r){const t={responseType:"json",query:{f:"json"},...r};return m(b(e),t)}const u="esri_en",y="Style",v="https://cdn.arcgis.com/sharing/rest/content/items/220936cc6ed342c9937abd8f180e7d1e/resources/styles/cim/{SymbolName}.json?f=json";export{C as b,x as c,M as d,k as n,E as p,v as w}; diff --git a/assets/sublayerUtils-BPYHHPMV.js b/assets/sublayerUtils-GrJ1gnTG.js similarity index 94% rename from assets/sublayerUtils-BPYHHPMV.js rename to assets/sublayerUtils-GrJ1gnTG.js index fc36aa2..8d93820 100644 --- a/assets/sublayerUtils-BPYHHPMV.js +++ b/assets/sublayerUtils-GrJ1gnTG.js @@ -1 +1 @@ -import{bs as l}from"./index-CEWggaxV.js";function a(e,r,i){return r.flatten(({sublayers:n})=>n).length!==e.length?!0:!!e.some(n=>n.originIdOf("minScale")>i||n.originIdOf("maxScale")>i||n.originIdOf("renderer")>i||n.originIdOf("labelingInfo")>i||n.originIdOf("opacity")>i||n.originIdOf("labelsVisible")>i||n.originIdOf("source")>i)||!f(e,r)}function g(e,r,i){return!!e.some(o=>{const n=o.source;return!(!n||n.type==="map-layer"&&n.mapLayerId===o.id&&(n.gdbVersion==null||n.gdbVersion===i))||o.originIdOf("renderer")>l.SERVICE||o.originIdOf("labelingInfo")>l.SERVICE||o.originIdOf("opacity")>l.SERVICE||o.originIdOf("labelsVisible")>l.SERVICE})||!f(e,r)}function f(e,r){if(!(e!=null&&e.length)||r==null)return!0;const i=r.slice().reverse().flatten(({sublayers:t})=>t&&t.toArray().reverse()).map(t=>t.id).toArray();if(e.length>i.length)return!1;let o=0;const n=i.length;for(const{id:t}of e){for(;o=n)return!1}return!0}function u(e){return!!e&&e.some(r=>{var i;return r.minScale!=null||((i=r.layerDefinition)==null?void 0:i.minScale)!=null})}export{a as e,g as n,u as o}; +import{bs as l}from"./index-BjUNJPVf.js";function a(e,r,i){return r.flatten(({sublayers:n})=>n).length!==e.length?!0:!!e.some(n=>n.originIdOf("minScale")>i||n.originIdOf("maxScale")>i||n.originIdOf("renderer")>i||n.originIdOf("labelingInfo")>i||n.originIdOf("opacity")>i||n.originIdOf("labelsVisible")>i||n.originIdOf("source")>i)||!f(e,r)}function g(e,r,i){return!!e.some(o=>{const n=o.source;return!(!n||n.type==="map-layer"&&n.mapLayerId===o.id&&(n.gdbVersion==null||n.gdbVersion===i))||o.originIdOf("renderer")>l.SERVICE||o.originIdOf("labelingInfo")>l.SERVICE||o.originIdOf("opacity")>l.SERVICE||o.originIdOf("labelsVisible")>l.SERVICE})||!f(e,r)}function f(e,r){if(!(e!=null&&e.length)||r==null)return!0;const i=r.slice().reverse().flatten(({sublayers:t})=>t&&t.toArray().reverse()).map(t=>t.id).toArray();if(e.length>i.length)return!1;let o=0;const n=i.length;for(const{id:t}of e){for(;o=n)return!1}return!0}function u(e){return!!e&&e.some(r=>{var i;return r.minScale!=null||((i=r.layerDefinition)==null?void 0:i.minScale)!=null})}export{a as e,g as n,u as o}; diff --git a/assets/substitute-DxAztrfK.js b/assets/substitute-Bz_UrLGp.js similarity index 87% rename from assets/substitute-DxAztrfK.js rename to assets/substitute-Bz_UrLGp.js index 6808eaa..d94ce86 100644 --- a/assets/substitute-DxAztrfK.js +++ b/assets/substitute-Bz_UrLGp.js @@ -1 +1 @@ -import{aF as l,aG as d,aH as a,aI as u,s as p}from"./index-CEWggaxV.js";const m=()=>p.getLogger("esri.intl.substitute");function h(e,t,r={}){const{format:n={}}=r;return l(e,s=>b(s,t,n))}function b(e,t,r){let n,s;const o=e.indexOf(":");if(o===-1?n=e.trim():(n=e.slice(0,o).trim(),s=e.slice(o+1).trim()),!n)return"";const i=d(n,t);if(i==null)return"";const f=(s?r==null?void 0:r[s]:null)??(r==null?void 0:r[n]);return f?g(i,f):s?w(i,s):c(i)}function g(e,t){switch(t.type){case"date":return u(e,t.intlOptions);case"number":return a(e,t.intlOptions);default:return m().warn("missing format descriptor for key {key}"),c(e)}}function w(e,t){switch(t.toLowerCase()){case"dateformat":return u(e);case"numberformat":return a(e);default:return m().warn(`inline format is unsupported since 4.12: ${t}`),/^(dateformat|datestring)/i.test(t)?u(e):/^numberformat/i.test(t)?a(e):c(e)}}function c(e){switch(typeof e){case"string":return e;case"number":return a(e);case"boolean":return""+e;default:return e instanceof Date?u(e):""}}export{h as s}; +import{aF as l,aG as d,aH as a,aI as u,s as p}from"./index-BjUNJPVf.js";const m=()=>p.getLogger("esri.intl.substitute");function h(e,t,r={}){const{format:n={}}=r;return l(e,s=>b(s,t,n))}function b(e,t,r){let n,s;const o=e.indexOf(":");if(o===-1?n=e.trim():(n=e.slice(0,o).trim(),s=e.slice(o+1).trim()),!n)return"";const i=d(n,t);if(i==null)return"";const f=(s?r==null?void 0:r[s]:null)??(r==null?void 0:r[n]);return f?g(i,f):s?w(i,s):c(i)}function g(e,t){switch(t.type){case"date":return u(e,t.intlOptions);case"number":return a(e,t.intlOptions);default:return m().warn("missing format descriptor for key {key}"),c(e)}}function w(e,t){switch(t.toLowerCase()){case"dateformat":return u(e);case"numberformat":return a(e);default:return m().warn(`inline format is unsupported since 4.12: ${t}`),/^(dateformat|datestring)/i.test(t)?u(e):/^numberformat/i.test(t)?a(e):c(e)}}function c(e){switch(typeof e){case"string":return e;case"number":return a(e);case"boolean":return""+e;default:return e instanceof Date?u(e):""}}export{h as s}; diff --git a/assets/symbolColorUtils-D_minlYz.js b/assets/symbolColorUtils-C9Wp-TPe.js similarity index 61% rename from assets/symbolColorUtils-D_minlYz.js rename to assets/symbolColorUtils-C9Wp-TPe.js index 3d0cf5e..fd14a80 100644 --- a/assets/symbolColorUtils-D_minlYz.js +++ b/assets/symbolColorUtils-C9Wp-TPe.js @@ -1 +1 @@ -import"./index-CEWggaxV.js";var n;(function(e){e[e.Multiply=1]="Multiply",e[e.Ignore=2]="Ignore",e[e.Replace=3]="Replace",e[e.Tint=4]="Tint"})(n||(n={}));export{n}; +import"./index-BjUNJPVf.js";var n;(function(e){e[e.Multiply=1]="Multiply",e[e.Ignore=2]="Ignore",e[e.Replace=3]="Replace",e[e.Tint=4]="Tint"})(n||(n={}));export{n}; diff --git a/assets/symbolLayerUtils-BNd9Ueha.js b/assets/symbolLayerUtils-r4EvpcG3.js similarity index 54% rename from assets/symbolLayerUtils-BNd9Ueha.js rename to assets/symbolLayerUtils-r4EvpcG3.js index d05e672..17e8d09 100644 --- a/assets/symbolLayerUtils-BNd9Ueha.js +++ b/assets/symbolLayerUtils-r4EvpcG3.js @@ -1,7 +1,7 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/objectResourceUtils-BVnDNNos.js","assets/devEnvironmentUtils-Blrp8lZ5.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css","assets/mat3f64-q3fE-ZOt.js","assets/mat4f64-CSKppSlJ.js","assets/BufferView-Ao_K-5Vg.js","assets/vec3-CjYmIfaa.js","assets/DefaultMaterial_COLOR_GAMMA-CWI-ZW7Q.js","assets/Version-Bd0QsIQ5.js","assets/quat-CoKEr4Zu.js","assets/quatf64-Bdb9ZJJK.js","assets/resourceUtils-BqKyAr0B.js","assets/basicInterfaces-GbxEOYtk.js","assets/Indices-Dv-cCjFT.js","assets/NestedMap-DgiGbX8E.js","assets/requestImageUtils-Dzwz9ori.js","assets/orientedBoundingBox-BQdJNYvE.js","assets/computeTranslationToOriginAndRotation-DOOKw0d1.js","assets/plane-py4f_JCU.js","assets/triangle-CU37cZF1.js","assets/Util-BS8sJGjF.js","assets/ObjectStack-CF0cQvd2.js","assets/lineSegment-B9UF3nEF.js","assets/VertexAttribute-BlT9lbVY.js","assets/Texture-DJgkMrSB.js","assets/InterleavedLayout-Dd1W8HCo.js","assets/types-D0PSWh4d.js","assets/OrderIndependentTransparency-C747AfeB.js","assets/sphere-DHd2K2LR.js","assets/BindType-BmZEZMMh.js","assets/symbolColorUtils-D_minlYz.js","assets/doublePrecisionUtils-B0owpBza.js","assets/RenderState-DaVlEYWY.js"] + __vite__mapDeps.viteFileDeps = ["assets/objectResourceUtils-BlC7hkco.js","assets/devEnvironmentUtils-Blrp8lZ5.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css","assets/mat3f64-q3fE-ZOt.js","assets/mat4f64-CSKppSlJ.js","assets/BufferView-3om6S_aJ.js","assets/vec3-DdRUbala.js","assets/DefaultMaterial_COLOR_GAMMA-BQtlD4-o.js","assets/Version-Dqq_CHBG.js","assets/quat-C0wQB0HB.js","assets/quatf64-Bdb9ZJJK.js","assets/resourceUtils-BHmy1O5x.js","assets/basicInterfaces-GbxEOYtk.js","assets/Indices-BRm9v2lM.js","assets/NestedMap-DgiGbX8E.js","assets/requestImageUtils-BHJ_ulwE.js","assets/orientedBoundingBox-sJmHxD3E.js","assets/computeTranslationToOriginAndRotation-BeE3rOSz.js","assets/plane-DxOTtTwj.js","assets/triangle-DmKBscqo.js","assets/Util-CS5u4Lec.js","assets/ObjectStack-BAIuPeIh.js","assets/lineSegment-BYtydnRZ.js","assets/VertexAttribute-BlT9lbVY.js","assets/Texture-S4dD-WHn.js","assets/InterleavedLayout-Cinhb-cY.js","assets/types-D0PSWh4d.js","assets/OrderIndependentTransparency-Btph8gYx.js","assets/sphere-F1imyuMS.js","assets/BindType-BmZEZMMh.js","assets/symbolColorUtils-C9Wp-TPe.js","assets/doublePrecisionUtils-B0owpBza.js","assets/RenderState-DaVlEYWY.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{ee as d,N as n,M as v,_ as y,ef as c,bF as p,eg as b,cy as l}from"./index-CEWggaxV.js";let s=f();function f(){return new d(50)}function g(){s=f()}async function T(r,i){var o,t;if((o=r.resource)!=null&&o.href)return w(r.resource.href).then(e=>[e.width,e.height]);if((t=r.resource)!=null&&t.primitive)return i!=null?[i,i]:[256,256];throw new n("symbol3d:invalid-symbol-layer","symbol layers of type Icon must have either an href or a primitive resource")}function w(r){return v(r,{responseType:"image"}).then(i=>i.data)}async function $(r,i=null){var t;if(!r.isPrimitive){const e=r.resource.href;if(!e)throw new n("symbol:invalid-resource","The symbol does not have a valid resource");const a=s.get(e);if(a!==void 0)return a;const{fetch:h}=await y(()=>import("./objectResourceUtils-BVnDNNos.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33])),m=await h(e,{disableTextures:!0}),u=c(m.referenceBoundingBox,l());return s.put(e,u),u}if(!((t=r.resource)!=null&&t.primitive))throw new n("symbol:invalid-resource","The symbol does not have a valid resource");const o=p(b(r.resource.primitive));if(i!=null)for(let e=0;e[e.width,e.height]);if((t=r.resource)!=null&&t.primitive)return i!=null?[i,i]:[256,256];throw new n("symbol3d:invalid-symbol-layer","symbol layers of type Icon must have either an href or a primitive resource")}function w(r){return v(r,{responseType:"image"}).then(i=>i.data)}async function $(r,i=null){var t;if(!r.isPrimitive){const e=r.resource.href;if(!e)throw new n("symbol:invalid-resource","The symbol does not have a valid resource");const a=s.get(e);if(a!==void 0)return a;const{fetch:h}=await y(()=>import("./objectResourceUtils-BlC7hkco.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33])),m=await h(e,{disableTextures:!0}),u=c(m.referenceBoundingBox,l());return s.put(e,u),u}if(!((t=r.resource)!=null&&t.primitive))throw new n("symbol:invalid-resource","The symbol does not have a valid resource");const o=p(b(r.resource.primitive));if(i!=null)for(let e=0;et.createQuery(),r=>{t.deleteQuery(r),i=!1},r=>t.getQueryParameter(r,t.QUERY_RESULT_AVAILABLE),r=>t.getQueryParameter(r,t.QUERY_RESULT),()=>t.getParameter(e.GPU_DISJOINT_EXT),r=>{i||(i=!0,t.beginQuery(e.TIME_ELAPSED_EXT,r))},()=>{t.endQuery(e.TIME_ELAPSED_EXT),i=!1},r=>e.queryCounterEXT(r,e.TIMESTAMP_EXT),()=>t.getQuery(e.TIMESTAMP_EXT,e.QUERY_COUNTER_BITS_EXT)):(e=t.getExtension("EXT_disjoint_timer_query"),e?new d(()=>e.createQueryEXT(),r=>{e.deleteQueryEXT(r),i=!1},r=>e.getQueryObjectEXT(r,e.QUERY_RESULT_AVAILABLE_EXT),r=>e.getQueryObjectEXT(r,e.QUERY_RESULT_EXT),()=>t.getParameter(e.GPU_DISJOINT_EXT),r=>{i||(i=!0,e.beginQueryEXT(e.TIME_ELAPSED_EXT,r))},()=>{e.endQueryEXT(e.TIME_ELAPSED_EXT),i=!1},r=>e.queryCounterEXT(r,e.TIMESTAMP_EXT),()=>e.getQueryEXT(e.TIMESTAMP_EXT,e.QUERY_COUNTER_BITS_EXT)):null)}class P{constructor(){this._result=!1}dispose(){this._program=X(this._program)}get result(){return this._program!=null&&(this._result=this._test(this._program),this.dispose()),this._result}}class F extends P{constructor(s){super(),this._rctx=s;const e=` +import{m as A}from"./WGLContainer-DgZNq7b0.js";import{x as f,h as v}from"./Program-DBsYtQ00.js";import{fV as X,D as m,L as l,fX as I,g2 as Q,g3 as R,v as S,U}from"./index-BjUNJPVf.js";import{e as p,m as x}from"./Texture-S4dD-WHn.js";import{o as M}from"./ProgramTemplate-Ck2I0bIi.js";class d{constructor(s,e,r,n,u,E,o,_,T){this.createQuery=s,this.deleteQuery=e,this.resultAvailable=r,this.getResult=n,this.disjoint=u,this.beginTimeElapsed=E,this.endTimeElapsed=o,this.createTimestamp=_,this.timestampBits=T}}let i=!1;function O(t,s){if(s.disjointTimerQuery)return null;let e=t.getExtension("EXT_disjoint_timer_query_webgl2");return e?new d(()=>t.createQuery(),r=>{t.deleteQuery(r),i=!1},r=>t.getQueryParameter(r,t.QUERY_RESULT_AVAILABLE),r=>t.getQueryParameter(r,t.QUERY_RESULT),()=>t.getParameter(e.GPU_DISJOINT_EXT),r=>{i||(i=!0,t.beginQuery(e.TIME_ELAPSED_EXT,r))},()=>{t.endQuery(e.TIME_ELAPSED_EXT),i=!1},r=>e.queryCounterEXT(r,e.TIMESTAMP_EXT),()=>t.getQuery(e.TIMESTAMP_EXT,e.QUERY_COUNTER_BITS_EXT)):(e=t.getExtension("EXT_disjoint_timer_query"),e?new d(()=>e.createQueryEXT(),r=>{e.deleteQueryEXT(r),i=!1},r=>e.getQueryObjectEXT(r,e.QUERY_RESULT_AVAILABLE_EXT),r=>e.getQueryObjectEXT(r,e.QUERY_RESULT_EXT),()=>t.getParameter(e.GPU_DISJOINT_EXT),r=>{i||(i=!0,e.beginQueryEXT(e.TIME_ELAPSED_EXT,r))},()=>{e.endQueryEXT(e.TIME_ELAPSED_EXT),i=!1},r=>e.queryCounterEXT(r,e.TIMESTAMP_EXT),()=>e.getQueryEXT(e.TIMESTAMP_EXT,e.QUERY_COUNTER_BITS_EXT)):null)}class P{constructor(){this._result=!1}dispose(){this._program=X(this._program)}get result(){return this._program!=null&&(this._result=this._test(this._program),this.dispose()),this._result}}class F extends P{constructor(s){super(),this._rctx=s;const e=` precision highp float; attribute vec2 a_pos; diff --git a/assets/timeSupport-BjRbXIpn.js b/assets/timeSupport-DXkhlToK.js similarity index 95% rename from assets/timeSupport-BjRbXIpn.js rename to assets/timeSupport-DXkhlToK.js index 8889fe4..a9c247a 100644 --- a/assets/timeSupport-BjRbXIpn.js +++ b/assets/timeSupport-DXkhlToK.js @@ -1,7 +1,7 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/geometryEngineJSON-D-7-cYHZ.js","assets/geometryEngineBase-C5__2Su1.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css","assets/json-Wa8cmqdu.js"] + __vite__mapDeps.viteFileDeps = ["assets/geometryEngineJSON-BfS7Q-po.js","assets/geometryEngineBase-CDbTTSsS.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css","assets/json-Wa8cmqdu.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{fn as se,iF as oe,G as O,df as le,iG as B,ak as V,fo as D,q as ae,d2 as ue,cL as G,aY as ce,iH as fe,dj as me,b0 as pe,F as _,ab as w,ac as he,bw as ye,iI as ge,dl as Ie,cB as Z,_ as H,iJ as Re,iK as Se,iL as de,iM as Ne,N as E,cF as $e}from"./index-CEWggaxV.js";import{h as _e,a as v,I as xe,x as F,$ as Te,H as be,U as Ge,K as z}from"./featureConversionUtils-CmP9mw0r.js";import{e as x}from"./OptimizedGeometry-CQuTPb9g.js";import{t as K}from"./json-Wa8cmqdu.js";const C=new x,we=new x,A=new x,d={esriGeometryPoint:F,esriGeometryPolyline:Te,esriGeometryPolygon:be,esriGeometryMultipoint:Ge};function st(e,t,n,r=e.hasZ,i=e.hasM){if(t==null)return null;const s=e.hasZ&&r,o=e.hasM&&i;if(n){const l=v(A,t,e.hasZ,e.hasM,"esriGeometryPoint",n,r,i);return F(l,s,o)}return F(t,s,o)}function b(e,t,n,r,i,s,o=t,l=n){var f,m,h;const a=t&&o,u=n&&l,c=r!=null?"coords"in r?r:r.geometry:null;if(c==null)return null;if(i){let p=_e(we,c,t,n,e,i,o,l);return s&&(p=v(A,p,a,u,e,s)),((f=d[e])==null?void 0:f.call(d,p,a,u))??null}if(s){const p=v(A,c,t,n,e,s,o,l);return((m=d[e])==null?void 0:m.call(d,p,a,u))??null}return xe(C,c,t,n,o,l),((h=d[e])==null?void 0:h.call(d,C,a,u))??null}function ot(e){return e&&W in e?JSON.parse(JSON.stringify(e,Ee)):e}const W="_geVersion",Ee=(e,t)=>e!==W?t:void 0;function j(e,t){return e?t?4:3:t?3:2}function lt(e,t,n,r){if(!(t!=null&&t.lengths.length))return null;e.lengths.length&&(e.lengths.length=0),e.coords.length&&(e.coords.length=0);const i=e.coords,s=[],o=n?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],{lengths:l,coords:a}=t,u=j(n,r);let c=0;for(const f of l){const m=Me(o,a,c,f,n,r);m&&s.push(m),c+=f*u}if(s.sort((f,m)=>{let h=f[2]-m[2];return h===0&&n&&(h=f[4]-m[4]),h}),s.length){let f=6*s[0][2];i[0]=s[0][0]/f,i[1]=s[0][1]/f,n&&(f=6*s[0][4],i[2]=f!==0?s[0][3]/f:0),(i[0]o[1]||i[1]o[3]||n&&(i[2]o[5]))&&(i.length=0)}if(!i.length){const f=t.lengths[0]?Pe(a,0,l[0],n,r):null;if(!f)return null;i[0]=f[0],i[1]=f[1],n&&f.length>2&&(i[2]=f[2])}return e}function Me(e,t,n,r,i,s){const o=j(i,s);let l=n,a=n+o,u=0,c=0,f=0,m=0,h=0;for(let N=0,T=r-1;Ne[1]&&(e[1]=y),ge[3]&&(e[3]=g),i&&(Re[5]&&(e[5]=R))}if(m>0&&(m*=-1),h>0&&(h*=-1),!m)return null;const p=[u,c,.5*m];return i&&(p[3]=f,p[4]=.5*h),p}function Pe(e,t,n,r,i){const s=j(r,i);let o=t,l=t+s,a=0,u=0,c=0,f=0;for(let m=0,h=n-1;m0?r?[u/a,c/a,f/a]:[u/a,c/a]:n>0?r?[e[t],e[t+1],e[t+2]]:[e[t],e[t+1]]:null}function ve(e,t,n,r){const i=n-e,s=r-t;return Math.sqrt(i*i+s*s)}function Fe(e,t,n,r,i,s){const o=r-e,l=i-t,a=s-n;return Math.sqrt(o*o+l*l+a*a)}function Ae(e,t,n,r){return[e+.5*(n-e),t+.5*(r-t)]}function Oe(e,t,n,r,i,s){return[e+.5*(r-e),t+.5*(i-t),n+.5*(s-n)]}const M=[0,0];function k(e,t){if(!t)return null;if("x"in t){const n={x:0,y:0};return[n.x,n.y]=e(t.x,t.y,M),t.z!=null&&(n.z=t.z),t.m!=null&&(n.m=t.m),n}if("xmin"in t){const n={xmin:0,ymin:0,xmax:0,ymax:0};return[n.xmin,n.ymin]=e(t.xmin,t.ymin,M),[n.xmax,n.ymax]=e(t.xmax,t.ymax,M),t.hasZ&&(n.zmin=t.zmin,n.zmax=t.zmax,n.hasZ=!0),t.hasM&&(n.mmin=t.mmin,n.mmax=t.mmax,n.hasM=!0),n}return"rings"in t?{rings:J(t.rings,e),hasM:t.hasM,hasZ:t.hasZ}:"paths"in t?{paths:J(t.paths,e),hasM:t.hasM,hasZ:t.hasZ}:"points"in t?{points:X(t.points,e),hasM:t.hasM,hasZ:t.hasZ}:null}function J(e,t){const n=[];for(const r of e)n.push(X(r,t));return n}function X(e,t){const n=[];for(const r of e){const i=t(r[0],r[1],[0,0]);n.push(i),r.length>2&&i.push(r[2]),r.length>3&&i.push(r[3])}return n}async function q(e,t){if(!e||!t)return;const n=Array.isArray(e)?e.map(r=>r.geometry!=null?r.geometry.spatialReference:null).filter(ae):[e];await ue(n.map(r=>({source:r,dest:t})))}const Q=k.bind(null,se),ee=k.bind(null,oe);function te(e,t,n,r){if(!e||(n||(n=t,t=e.spatialReference),!G(t)||!G(n)||O(t,n)))return e;if(B(t,n)){const i=V(n)?Q(e):ee(e);return i.spatialReference=n,i}return D(K,[e],t,n,null,r)[0]}class Ve{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(t,n,r,i){if(!(t!=null&&t.length)||!n||!r||O(n,r))return t;const s={geometries:t,inSpatialReference:n,outSpatialReference:r,geographicTransformation:i,resolve:le()};return this._jobs.push(s),this._timer??(this._timer=setTimeout(this._process,10)),s.resolve.promise}_process(){this._timer=null;const t=this._jobs.shift();if(!t)return;const{geometries:n,inSpatialReference:r,outSpatialReference:i,resolve:s,geographicTransformation:o}=t;B(r,i)?V(i)?s(n.map(Q)):s(n.map(ee)):s(D(K,n,r,i,o,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}}const je=new Ve;function at(e,t,n,r){return je.push(e,t,n,r)}const qe=new ce({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),L=Object.freeze({});async function ut(e,t,n){const{outFields:r,orderByFields:i,groupByFieldsForStatistics:s,outStatistics:o}=e;if(r)for(let l=0;lte(r,Z));return(await ze())(o.spatialReference,o,t,s)}async function ze(){return(await H(()=>import("./geometryEngineJSON-D-7-cYHZ.js").then(e=>e.g),__vite__mapDeps([0,1,2,3,4]))).geodesicBuffer}function Ce(e){return e==="mesh"?Re:Se(e)}function re(e,t){return e?t?4:3:t?3:2}function Je(e,t,n,r){return ie(e,t,n,r.coords[0],r.coords[1])}function Le(e,t,n,r,i,s){const o=re(i,s),{coords:l,lengths:a}=r;if(!a)return!1;for(let u=0,c=0;u=o||p=o)&&f+(o-m)/(p-m)*(h-f)import("./geometryEngineJSON-D-7-cYHZ.js").then(e=>e.g),__vite__mapDeps([0,1,2,3,4]))}function ct(e,t,n,r,i){if(w(t)&&n==="esriGeometryPoint"&&(e==="esriSpatialRelIntersects"||e==="esriSpatialRelContains")){const s=z(new x,t,!1,!1);return Promise.resolve(o=>Je(s,!1,!1,o))}if(w(t)&&n==="esriGeometryMultipoint"){const s=z(new x,t,!1,!1);if(e==="esriSpatialRelContains")return Promise.resolve(o=>Le(s,!1,!1,o,r,i))}if(_(t)&&n==="esriGeometryPoint"&&(e==="esriSpatialRelIntersects"||e==="esriSpatialRelContains"))return Promise.resolve(s=>de(t,b(n,r,i,s)));if(_(t)&&n==="esriGeometryMultipoint"&&e==="esriSpatialRelContains")return Promise.resolve(s=>Ne(t,b(n,r,i,s)));if(_(t)&&e==="esriSpatialRelIntersects"){const s=Ce(n);return Promise.resolve(o=>s(t,b(n,r,i,o)))}return ke().then(s=>{const o=s[De[e]].bind(null,t.spatialReference,t);return l=>o(b(n,r,i,l))})}async function ft(e,t,n){var s;const{spatialRel:r,geometry:i}=e;if(i){if(!He(r))throw new E(P,"Unsupported query spatial relationship",{query:e});if(G(i.spatialReference)&&G(n)){if(!Ke(i))throw new E(P,"Unsupported query geometry type",{query:e});if(!We(t))throw new E(P,"Unsupported layer geometry type",{query:e});if(e.outSR)return q((s=e.geometry)==null?void 0:s.spatialReference,e.outSR)}}}function mt(e){if(_(e))return!0;if(w(e)){for(const t of e.rings)if(t.length!==5||t[0][0]!==t[1][0]||t[0][0]!==t[4][0]||t[2][0]!==t[3][0]||t[0][1]!==t[3][1]||t[0][1]!==t[4][1]||t[1][1]!==t[2][1])return!1;return!0}return!1}async function pt(e,t){if(!e)return null;const n=t.featureAdapter,{startTimeField:r,endTimeField:i}=e;let s=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;if(r&&i)await t.forEach(l=>{const a=n.getAttribute(l,r),u=n.getAttribute(l,i);a==null||isNaN(a)||(s=Math.min(s,a)),u==null||isNaN(u)||(o=Math.max(o,u))});else{const l=r||i;await t.forEach(a=>{const u=n.getAttribute(a,l);u==null||isNaN(u)||(s=Math.min(s,u),o=Math.max(o,u))})}return{start:s,end:o}}function ht(e,t,n){var a;if(!t||!e)return null;const{startTimeField:r,endTimeField:i}=e;if(!r&&!i)return null;const{start:s,end:o}=t;if(s===null&&o===null)return null;if(s===void 0&&o===void 0)return et();const l=((a=n.getAttributeAsTimestamp)==null?void 0:a.bind(n))??n.getAttribute.bind(n);return r&&i?Xe(l,r,i,s,o):Qe(l,r||i,s,o)}function Xe(e,t,n,r,i){return r!=null&&i!=null?s=>{const o=e(s,t),l=e(s,n);return(o==null||o<=i)&&(l==null||l>=r)}:r!=null?s=>{const o=e(s,n);return o==null||o>=r}:i!=null?s=>{const o=e(s,t);return o==null||o<=i}:void 0}function Qe(e,t,n,r){return n!=null&&r!=null&&n===r?i=>e(i,t)===n:n!=null&&r!=null?i=>{const s=e(i,t);return s!=null&&s>=n&&s<=r}:n!=null?i=>{const s=e(i,t);return s!=null&&s>=n}:r!=null?i=>{const s=e(i,t);return s!=null&&s<=r}:void 0}function et(){return()=>!1}export{mt as I,ft as P,ut as S,b as a,Ue as b,pt as c,at as d,L as g,ot as h,te as j,lt as n,ht as t,ct as v,q as x,st as y}; +import{fn as se,iF as oe,G as O,df as le,iG as B,ak as V,fo as D,q as ae,d2 as ue,cL as G,aY as ce,iH as fe,dj as me,b0 as pe,F as _,ab as w,ac as he,bw as ye,iI as ge,dl as Ie,cB as Z,_ as H,iJ as Re,iK as Se,iL as de,iM as Ne,N as E,cF as $e}from"./index-BjUNJPVf.js";import{h as _e,a as v,I as xe,x as F,$ as Te,H as be,U as Ge,K as z}from"./featureConversionUtils-BHhm7bvm.js";import{e as x}from"./OptimizedGeometry-CQuTPb9g.js";import{t as K}from"./json-Wa8cmqdu.js";const C=new x,we=new x,A=new x,d={esriGeometryPoint:F,esriGeometryPolyline:Te,esriGeometryPolygon:be,esriGeometryMultipoint:Ge};function st(e,t,n,r=e.hasZ,i=e.hasM){if(t==null)return null;const s=e.hasZ&&r,o=e.hasM&&i;if(n){const l=v(A,t,e.hasZ,e.hasM,"esriGeometryPoint",n,r,i);return F(l,s,o)}return F(t,s,o)}function b(e,t,n,r,i,s,o=t,l=n){var f,m,h;const a=t&&o,u=n&&l,c=r!=null?"coords"in r?r:r.geometry:null;if(c==null)return null;if(i){let p=_e(we,c,t,n,e,i,o,l);return s&&(p=v(A,p,a,u,e,s)),((f=d[e])==null?void 0:f.call(d,p,a,u))??null}if(s){const p=v(A,c,t,n,e,s,o,l);return((m=d[e])==null?void 0:m.call(d,p,a,u))??null}return xe(C,c,t,n,o,l),((h=d[e])==null?void 0:h.call(d,C,a,u))??null}function ot(e){return e&&W in e?JSON.parse(JSON.stringify(e,Ee)):e}const W="_geVersion",Ee=(e,t)=>e!==W?t:void 0;function j(e,t){return e?t?4:3:t?3:2}function lt(e,t,n,r){if(!(t!=null&&t.lengths.length))return null;e.lengths.length&&(e.lengths.length=0),e.coords.length&&(e.coords.length=0);const i=e.coords,s=[],o=n?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],{lengths:l,coords:a}=t,u=j(n,r);let c=0;for(const f of l){const m=Me(o,a,c,f,n,r);m&&s.push(m),c+=f*u}if(s.sort((f,m)=>{let h=f[2]-m[2];return h===0&&n&&(h=f[4]-m[4]),h}),s.length){let f=6*s[0][2];i[0]=s[0][0]/f,i[1]=s[0][1]/f,n&&(f=6*s[0][4],i[2]=f!==0?s[0][3]/f:0),(i[0]o[1]||i[1]o[3]||n&&(i[2]o[5]))&&(i.length=0)}if(!i.length){const f=t.lengths[0]?Pe(a,0,l[0],n,r):null;if(!f)return null;i[0]=f[0],i[1]=f[1],n&&f.length>2&&(i[2]=f[2])}return e}function Me(e,t,n,r,i,s){const o=j(i,s);let l=n,a=n+o,u=0,c=0,f=0,m=0,h=0;for(let N=0,T=r-1;Ne[1]&&(e[1]=y),ge[3]&&(e[3]=g),i&&(Re[5]&&(e[5]=R))}if(m>0&&(m*=-1),h>0&&(h*=-1),!m)return null;const p=[u,c,.5*m];return i&&(p[3]=f,p[4]=.5*h),p}function Pe(e,t,n,r,i){const s=j(r,i);let o=t,l=t+s,a=0,u=0,c=0,f=0;for(let m=0,h=n-1;m0?r?[u/a,c/a,f/a]:[u/a,c/a]:n>0?r?[e[t],e[t+1],e[t+2]]:[e[t],e[t+1]]:null}function ve(e,t,n,r){const i=n-e,s=r-t;return Math.sqrt(i*i+s*s)}function Fe(e,t,n,r,i,s){const o=r-e,l=i-t,a=s-n;return Math.sqrt(o*o+l*l+a*a)}function Ae(e,t,n,r){return[e+.5*(n-e),t+.5*(r-t)]}function Oe(e,t,n,r,i,s){return[e+.5*(r-e),t+.5*(i-t),n+.5*(s-n)]}const M=[0,0];function k(e,t){if(!t)return null;if("x"in t){const n={x:0,y:0};return[n.x,n.y]=e(t.x,t.y,M),t.z!=null&&(n.z=t.z),t.m!=null&&(n.m=t.m),n}if("xmin"in t){const n={xmin:0,ymin:0,xmax:0,ymax:0};return[n.xmin,n.ymin]=e(t.xmin,t.ymin,M),[n.xmax,n.ymax]=e(t.xmax,t.ymax,M),t.hasZ&&(n.zmin=t.zmin,n.zmax=t.zmax,n.hasZ=!0),t.hasM&&(n.mmin=t.mmin,n.mmax=t.mmax,n.hasM=!0),n}return"rings"in t?{rings:J(t.rings,e),hasM:t.hasM,hasZ:t.hasZ}:"paths"in t?{paths:J(t.paths,e),hasM:t.hasM,hasZ:t.hasZ}:"points"in t?{points:X(t.points,e),hasM:t.hasM,hasZ:t.hasZ}:null}function J(e,t){const n=[];for(const r of e)n.push(X(r,t));return n}function X(e,t){const n=[];for(const r of e){const i=t(r[0],r[1],[0,0]);n.push(i),r.length>2&&i.push(r[2]),r.length>3&&i.push(r[3])}return n}async function q(e,t){if(!e||!t)return;const n=Array.isArray(e)?e.map(r=>r.geometry!=null?r.geometry.spatialReference:null).filter(ae):[e];await ue(n.map(r=>({source:r,dest:t})))}const Q=k.bind(null,se),ee=k.bind(null,oe);function te(e,t,n,r){if(!e||(n||(n=t,t=e.spatialReference),!G(t)||!G(n)||O(t,n)))return e;if(B(t,n)){const i=V(n)?Q(e):ee(e);return i.spatialReference=n,i}return D(K,[e],t,n,null,r)[0]}class Ve{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(t,n,r,i){if(!(t!=null&&t.length)||!n||!r||O(n,r))return t;const s={geometries:t,inSpatialReference:n,outSpatialReference:r,geographicTransformation:i,resolve:le()};return this._jobs.push(s),this._timer??(this._timer=setTimeout(this._process,10)),s.resolve.promise}_process(){this._timer=null;const t=this._jobs.shift();if(!t)return;const{geometries:n,inSpatialReference:r,outSpatialReference:i,resolve:s,geographicTransformation:o}=t;B(r,i)?V(i)?s(n.map(Q)):s(n.map(ee)):s(D(K,n,r,i,o,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}}const je=new Ve;function at(e,t,n,r){return je.push(e,t,n,r)}const qe=new ce({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),L=Object.freeze({});async function ut(e,t,n){const{outFields:r,orderByFields:i,groupByFieldsForStatistics:s,outStatistics:o}=e;if(r)for(let l=0;lte(r,Z));return(await ze())(o.spatialReference,o,t,s)}async function ze(){return(await H(()=>import("./geometryEngineJSON-BfS7Q-po.js").then(e=>e.g),__vite__mapDeps([0,1,2,3,4]))).geodesicBuffer}function Ce(e){return e==="mesh"?Re:Se(e)}function re(e,t){return e?t?4:3:t?3:2}function Je(e,t,n,r){return ie(e,t,n,r.coords[0],r.coords[1])}function Le(e,t,n,r,i,s){const o=re(i,s),{coords:l,lengths:a}=r;if(!a)return!1;for(let u=0,c=0;u=o||p=o)&&f+(o-m)/(p-m)*(h-f)import("./geometryEngineJSON-BfS7Q-po.js").then(e=>e.g),__vite__mapDeps([0,1,2,3,4]))}function ct(e,t,n,r,i){if(w(t)&&n==="esriGeometryPoint"&&(e==="esriSpatialRelIntersects"||e==="esriSpatialRelContains")){const s=z(new x,t,!1,!1);return Promise.resolve(o=>Je(s,!1,!1,o))}if(w(t)&&n==="esriGeometryMultipoint"){const s=z(new x,t,!1,!1);if(e==="esriSpatialRelContains")return Promise.resolve(o=>Le(s,!1,!1,o,r,i))}if(_(t)&&n==="esriGeometryPoint"&&(e==="esriSpatialRelIntersects"||e==="esriSpatialRelContains"))return Promise.resolve(s=>de(t,b(n,r,i,s)));if(_(t)&&n==="esriGeometryMultipoint"&&e==="esriSpatialRelContains")return Promise.resolve(s=>Ne(t,b(n,r,i,s)));if(_(t)&&e==="esriSpatialRelIntersects"){const s=Ce(n);return Promise.resolve(o=>s(t,b(n,r,i,o)))}return ke().then(s=>{const o=s[De[e]].bind(null,t.spatialReference,t);return l=>o(b(n,r,i,l))})}async function ft(e,t,n){var s;const{spatialRel:r,geometry:i}=e;if(i){if(!He(r))throw new E(P,"Unsupported query spatial relationship",{query:e});if(G(i.spatialReference)&&G(n)){if(!Ke(i))throw new E(P,"Unsupported query geometry type",{query:e});if(!We(t))throw new E(P,"Unsupported layer geometry type",{query:e});if(e.outSR)return q((s=e.geometry)==null?void 0:s.spatialReference,e.outSR)}}}function mt(e){if(_(e))return!0;if(w(e)){for(const t of e.rings)if(t.length!==5||t[0][0]!==t[1][0]||t[0][0]!==t[4][0]||t[2][0]!==t[3][0]||t[0][1]!==t[3][1]||t[0][1]!==t[4][1]||t[1][1]!==t[2][1])return!1;return!0}return!1}async function pt(e,t){if(!e)return null;const n=t.featureAdapter,{startTimeField:r,endTimeField:i}=e;let s=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;if(r&&i)await t.forEach(l=>{const a=n.getAttribute(l,r),u=n.getAttribute(l,i);a==null||isNaN(a)||(s=Math.min(s,a)),u==null||isNaN(u)||(o=Math.max(o,u))});else{const l=r||i;await t.forEach(a=>{const u=n.getAttribute(a,l);u==null||isNaN(u)||(s=Math.min(s,u),o=Math.max(o,u))})}return{start:s,end:o}}function ht(e,t,n){var a;if(!t||!e)return null;const{startTimeField:r,endTimeField:i}=e;if(!r&&!i)return null;const{start:s,end:o}=t;if(s===null&&o===null)return null;if(s===void 0&&o===void 0)return et();const l=((a=n.getAttributeAsTimestamp)==null?void 0:a.bind(n))??n.getAttribute.bind(n);return r&&i?Xe(l,r,i,s,o):Qe(l,r||i,s,o)}function Xe(e,t,n,r,i){return r!=null&&i!=null?s=>{const o=e(s,t),l=e(s,n);return(o==null||o<=i)&&(l==null||l>=r)}:r!=null?s=>{const o=e(s,n);return o==null||o>=r}:i!=null?s=>{const o=e(s,t);return o==null||o<=i}:void 0}function Qe(e,t,n,r){return n!=null&&r!=null&&n===r?i=>e(i,t)===n:n!=null&&r!=null?i=>{const s=e(i,t);return s!=null&&s>=n&&s<=r}:n!=null?i=>{const s=e(i,t);return s!=null&&s>=n}:r!=null?i=>{const s=e(i,t);return s!=null&&s<=r}:void 0}function et(){return()=>!1}export{mt as I,ft as P,ut as S,b as a,Ue as b,pt as c,at as d,L as g,ot as h,te as j,lt as n,ht as t,ct as v,q as x,st as y}; diff --git a/assets/triangle-CU37cZF1.js b/assets/triangle-DmKBscqo.js similarity index 90% rename from assets/triangle-CU37cZF1.js rename to assets/triangle-DmKBscqo.js index 22d17f5..fc3c7a6 100644 --- a/assets/triangle-CU37cZF1.js +++ b/assets/triangle-DmKBscqo.js @@ -1 +1 @@ -import{bL as j,cz as C,cS as w,gY as A,cy as x,gX as N,cU as L,gL as $,cv as q}from"./index-CEWggaxV.js";import{s as g}from"./Util-BS8sJGjF.js";import{s as U}from"./ObjectStack-CF0cQvd2.js";import{v as S}from"./lineSegment-B9UF3nEF.js";import"./plane-py4f_JCU.js";var z;(function(i){i[i.Layer=0]="Layer",i[i.Object=1]="Object",i[i.Mesh=2]="Mesh",i[i.Line=3]="Line",i[i.Point=4]="Point",i[i.Material=5]="Material",i[i.Texture=6]="Texture",i[i.COUNT=7]="COUNT"})(z||(z={}));class T{constructor(o,d,u){this.primitiveIndices=o,this._numIndexPerPrimitive=d,this.position=u,this._children=void 0,g(o.length>=1),g(u.size===3||u.size===4);const{data:s,size:l,indices:p}=u;g(p.length%this._numIndexPerPrimitive==0),g(p.length>=o.length*this._numIndexPerPrimitive);const I=o.length;let e=l*p[this._numIndexPerPrimitive*o[0]];f.clear(),f.push(e);const n=C(s[e],s[e+1],s[e+2]),t=w(n);for(let a=0;a0&&++e;if(e<2)return;const n=new Array(8);for(let t=0;t<8;++t)n[t]=s[t]>0?new Uint32Array(s[t]):void 0;for(let t=0;t<8;++t)s[t]=0;for(let t=0;tX());const y=x(),O=x();export{F as d,z as e,T as o}; +import{bL as j,cz as C,cS as w,gY as A,cy as x,gX as N,cU as L,gL as $,cv as q}from"./index-BjUNJPVf.js";import{s as g}from"./Util-CS5u4Lec.js";import{s as U}from"./ObjectStack-BAIuPeIh.js";import{v as S}from"./lineSegment-BYtydnRZ.js";import"./plane-DxOTtTwj.js";var z;(function(i){i[i.Layer=0]="Layer",i[i.Object=1]="Object",i[i.Mesh=2]="Mesh",i[i.Line=3]="Line",i[i.Point=4]="Point",i[i.Material=5]="Material",i[i.Texture=6]="Texture",i[i.COUNT=7]="COUNT"})(z||(z={}));class T{constructor(o,d,u){this.primitiveIndices=o,this._numIndexPerPrimitive=d,this.position=u,this._children=void 0,g(o.length>=1),g(u.size===3||u.size===4);const{data:s,size:l,indices:p}=u;g(p.length%this._numIndexPerPrimitive==0),g(p.length>=o.length*this._numIndexPerPrimitive);const I=o.length;let e=l*p[this._numIndexPerPrimitive*o[0]];f.clear(),f.push(e);const n=C(s[e],s[e+1],s[e+2]),t=w(n);for(let a=0;a0&&++e;if(e<2)return;const n=new Array(8);for(let t=0;t<8;++t)n[t]=s[t]>0?new Uint32Array(s[t]):void 0;for(let t=0;t<8;++t)s[t]=0;for(let t=0;tX());const y=x(),O=x();export{F as d,z as e,T as o}; diff --git a/assets/uploadAssetErrors-D_dYSFa_.js b/assets/uploadAssetErrors-DCHo_tDX.js similarity index 95% rename from assets/uploadAssetErrors-D_dYSFa_.js rename to assets/uploadAssetErrors-DCHo_tDX.js index 7d206a9..6a05aaf 100644 --- a/assets/uploadAssetErrors-D_dYSFa_.js +++ b/assets/uploadAssetErrors-DCHo_tDX.js @@ -1 +1 @@ -import{N as s}from"./index-CEWggaxV.js";const o="upload-assets",r=()=>new Error;class a extends s{constructor(){super(`${o}:unsupported`,"Layer does not support asset uploads.",r())}}class p extends s{constructor(){super(`${o}:no-glb-support`,"Layer does not support glb.",r())}}class d extends s{constructor(){super(`${o}:no-supported-source`,"No supported external source found",r())}}class l extends s{constructor(){super(`${o}:not-base-64`,"Expected gltf data in base64 format after conversion.",r())}}class c extends s{constructor(){super(`${o}:unable-to-prepare-options`,"Unable to prepare uploadAsset request options.",r())}}class i extends s{constructor(n,t){super(`${o}:bad-response`,`Bad response. Uploaded ${n} items and received ${t} results.`,r())}}class m extends s{constructor(n,t){super(`${o}-layer:upload-failed`,`Failed to upload mesh file ${n}. Error code: ${(t==null?void 0:t.code)??"-1"}. Error message: ${(t==null?void 0:t.messages)??"unknown"}`,r())}}class $ extends s{constructor(n){super(`${o}-layer:unsupported-format`,`The service allowed us to upload an asset of FormatID ${n}, but it does not list it in its supported formats.`,r())}}class f extends s{constructor(){super(`${o}:convert3D-failed`,"convert3D failed.")}}class x extends s{constructor(){super("invalid-input:no-model","No supported model found")}}class b extends s{constructor(){super("invalid-input:multiple-models","Multiple supported models found")}}export{i as a,$ as c,m as d,x as i,f as l,b as m,d as n,c as p,a as r,p as t,l as u}; +import{N as s}from"./index-BjUNJPVf.js";const o="upload-assets",r=()=>new Error;class a extends s{constructor(){super(`${o}:unsupported`,"Layer does not support asset uploads.",r())}}class p extends s{constructor(){super(`${o}:no-glb-support`,"Layer does not support glb.",r())}}class d extends s{constructor(){super(`${o}:no-supported-source`,"No supported external source found",r())}}class l extends s{constructor(){super(`${o}:not-base-64`,"Expected gltf data in base64 format after conversion.",r())}}class c extends s{constructor(){super(`${o}:unable-to-prepare-options`,"Unable to prepare uploadAsset request options.",r())}}class i extends s{constructor(n,t){super(`${o}:bad-response`,`Bad response. Uploaded ${n} items and received ${t} results.`,r())}}class m extends s{constructor(n,t){super(`${o}-layer:upload-failed`,`Failed to upload mesh file ${n}. Error code: ${(t==null?void 0:t.code)??"-1"}. Error message: ${(t==null?void 0:t.messages)??"unknown"}`,r())}}class $ extends s{constructor(n){super(`${o}-layer:unsupported-format`,`The service allowed us to upload an asset of FormatID ${n}, but it does not list it in its supported formats.`,r())}}class f extends s{constructor(){super(`${o}:convert3D-failed`,"convert3D failed.")}}class x extends s{constructor(){super("invalid-input:no-model","No supported model found")}}class b extends s{constructor(){super("invalid-input:multiple-models","Multiple supported models found")}}export{i as a,$ as c,m as d,x as i,f as l,b as m,d as n,c as p,a as r,p as t,l as u}; diff --git a/assets/uploadAssets-Do4zQv1Y.js b/assets/uploadAssets-CYfQLTBV.js similarity index 97% rename from assets/uploadAssets-Do4zQv1Y.js rename to assets/uploadAssets-CYfQLTBV.js index 58b6527..84b04c2 100644 --- a/assets/uploadAssets-Do4zQv1Y.js +++ b/assets/uploadAssets-CYfQLTBV.js @@ -1 +1 @@ -import{E as _,Z as Q,e as X,hr as I,B as A,hs as N,b_ as h,M as f,at as u,b7 as Y,di as ss,fx as es,ay as ts,fv as os,s as as}from"./index-CEWggaxV.js";import{h as ns,N as rs,i as S,o as x,A as is}from"./External-DC51KyR4.js";import{r as cs,n as ls,a as us,d as ps,c as U,l as ms,t as fs,u as ds,p as hs}from"./uploadAssetErrors-D_dYSFa_.js";import{s as gs,u as k,i as ws}from"./infoFor3D-DsOdlPuA.js";const M={upload:{createFromFiles:.8,loadMesh:.2},uploadAssetBlobs:{prepareAssetItems:.9,uploadAssetItems:.1},uploadConvertibleSource:{uploadEditSource:.5,serviceAssetsToGlb:.5},uploadLocalMesh:{meshToAssetBlob:.5,uploadAssetBlobs:.5}};function g(t,e=o=>{},s){return new ys(t,e,s)}let ys=class{constructor(e,s=a=>{},o){if(this.onProgress=s,this.taskName=o,this._progressMap=new Map,this._startTime=void 0,this._timingsMap=new Map,typeof e=="number"){this._weights={};for(let a=0;a({start:o,end:0}));s===1&&(a.end=o)}this.emitProgress()}simulate(e,s){return D(o=>this.setProgress(e,o),s)}makeOnProgress(e){return s=>this.setProgress(e,s)}};function D(t=s=>{},e=$s){const s=performance.now();t(0);const o=setInterval(()=>{const a=performance.now()-s,n=1-Math.exp(-a/e);t(n)},Ms);return X(()=>{clearInterval(o),t(1)})}function Ps(t,e=bs){return I(N(t*B/e))}function Ts(t,e=As){return I(N(t*B/e))}const bs=10,As=10,B=8e-6,Ms=A(50),$s=A(1e3),O=1e6,E=20*O,Fs=2e9,js=3;async function vs({data:t,name:e,description:s},o,a){let n=null;try{const r=h(o,"uploads"),i=h(r,"info"),{data:c}=await f(i,{query:{f:"json"},responseType:"json"});u(a);const p=Y(o),l=c.maxUploadFileSize*O,d=p?Fs:l,b=p?Math.min(E,l):E;if(t.size>d)throw new Error("Data too large");const L=h(r,"register"),{data:$}=await f(L,{query:{f:"json",itemName:_s(e),description:s},responseType:"json",method:"post"});if(u(a),!$.success)throw new Error("Registration failed");const{itemID:H}=$.item;n=h(r,H);const G=h(n,"uploadPart"),F=Math.ceil(t.size/b),w=new Array;for(let m=0;m{for(;y.length!==0;){const m=w.length-y.length,P=y.pop(),T=new FormData,V=J.simulate(m,Ps(P.size));try{T.append("f","json"),T.append("file",P),T.append("partId",`${m}`);const{data:Z}=await f(G,{timeout:0,body:T,responseType:"json",method:"post"});if(u(a),!Z.success)throw new Error("Part upload failed")}finally{V.remove()}}};for(let m=0;mP).join(",")},responseType:"json",method:"post"});if(u(a),!v.success)throw new Error("Commit failed");return v.item}catch(r){if(n!=null){const i=h(n,"delete");await f(i,{query:{f:"json"},responseType:"json",method:"post"})}throw r}}function _s(t){return t.replaceAll("/","_").replaceAll("\\","_")}async function se(t,e,s){var n;const o=t.length;if(!o)return(n=s==null?void 0:s.onProgress)==null||n.call(s,1),[];const a=g(o,s==null?void 0:s.onProgress,"uploadAssets");return Promise.all(t.map((r,i)=>Es(r,e,{...s,onProgress:a.makeOnProgress(i)})))}async function Es(t,{layer:e,ongoingUploads:s},o){var r;const a=s.get(t);if(a)return a;if(!Js(e))throw new cs;if(Is(t,e))return(r=o==null?void 0:o.onProgress)==null||r.call(o,1),t;const n=Ns(t,e,o);s.set(t,n);try{await n}finally{s.delete(t)}return t}function Is(t,e){const{parsedUrl:s}=e;return s!=null&&t.metadata.externalSources.some(o=>ns(o,s))}async function Ns(t,e,s){const{metadata:o}=t,{displaySource:a}=o,n=C(a==null?void 0:a.source,e),r=!!n,i=o.externalSources.length>0,c=r?Ss(n,e,s):i?xs(t,e,s):Us(t,e,s),p=await c;return u(s),t.addExternalSources([p]),t}async function Ss(t,e,s){return{source:await q(t,e,s),original:!0}}async function xs(t,e,s){const o=z(e),{externalSources:a}=t.metadata,n=Ds(a,e);if(!n)throw new ls;const r=g(M.uploadConvertibleSource,s==null?void 0:s.onProgress,"uploadConvertibleSource"),i=await q(n,e,{onProgress:r.makeOnProgress("uploadEditSource")});t.addExternalSources([{source:i,original:!0}]);const c=n.reduce((l,{asset:d})=>d instanceof File?l+d.size:l,0),p=r.simulate("serviceAssetsToGlb",Ts(c));try{return{source:await Ls(i,e,o)}}finally{p.remove()}}async function Us(t,e,s){const o=g(M.uploadLocalMesh,s==null?void 0:s.onProgress,"uploadLocalMesh"),a=ks(t,e,{...s,onProgress:o.makeOnProgress("meshToAssetBlob")});return{source:await R([a],e,{...s,onProgress:o.makeOnProgress("uploadAssetBlobs")}),extent:t.extent.clone(),original:!0}}async function ks(t,e,s){const o=z(e),a=await t.load(s),n=await a.toBinaryGLTF({ignoreLocalTransform:!0});u(s);const r=await n.buffer();return u(s),{blob:new Blob([r.data],{type:r.type}),assetName:`${ss()}.glb`,assetType:o}}function Ds(t,e){for(const s of t){const o=C(s.source,e);if(o)return o}return null}function C(t,e){if(!t)return null;const{infoFor3D:{supportedFormats:s,editFormats:o}}=e,a=is(t),n=new Array;let r=!1;for(let i=0;iOs(o,s)),e,s)}async function R(t,e,s){const o=g(M.uploadAssetBlobs,s==null?void 0:s.onProgress,"uploadAssetBlobs"),a=await qs(t,e,{...s,onProgress:o.makeOnProgress("prepareAssetItems")});u(s);const n=a.map(({item:i})=>i),{uploadResults:r}=await Rs(n,e,{...s,onProgress:o.makeOnProgress("uploadAssetItems")});return u(s),t.map((i,c)=>zs(a[c],r[c],e))}async function Os(t,e){const{asset:s,assetType:o}=t;if(s instanceof File)return{blob:s,assetName:s.name,assetType:o};const a=await s.toBlob(e);return u(e),{blob:a,assetName:s.assetName,assetType:o}}async function Cs(t,e,s){const{blob:o,assetType:a,assetName:n}=t;let r=null;try{const i=await vs({data:o,name:n},e.url,s);u(s),r={assetType:a,assetUploadId:i.itemID}}catch(i){ts(i),Ws().warnOnce(`Service ${e.url} does not support the REST Uploads API.`)}if(!r){const i=await os(o);if(u(s),!i.isBase64)throw new ds;r={assetType:a,assetData:i.data}}if(!r)throw new hs;return{item:r,assetName:n}}function qs(t,e,s){const o=g(t.length,s==null?void 0:s.onProgress,"prepareAssetItems");return Promise.all(t.map(async(a,n)=>{const r=Cs(await a,e,{...s,onProgress:o.makeOnProgress(n)});return u(s),r}))}async function Rs(t,e,s){const o=D(s==null?void 0:s.onProgress);try{const a=await f(h(e.parsedUrl.path,"uploadAssets"),{timeout:0,query:{f:"json",assets:JSON.stringify(t)},method:"post",responseType:"json"});if(u(s),a.data.uploadResults.length!==t.length)throw new us(t.length,a.data.uploadResults.length);return a.data}finally{o.remove()}}function zs(t,e,s){const{success:o}=e;if(!o){const{error:p}=e;throw new ps(t.assetName,p)}const{assetHash:a}=e,{assetName:n,item:{assetType:r}}=t,{infoFor3D:{supportedFormats:i}}=s,c=gs(r,i);if(!c)throw new U(r);return new S(n,c,[new x(`${s.parsedUrl.path}/assets/${a}`,a)])}async function Ls(t,e,s){var p;const o=t.map(({assetName:l,parts:d})=>({assetName:l,assetHash:d[0].partHash})),a=(p=e.capabilities)==null?void 0:p.operations.supportsAsyncConvert3D,n={f:"json",assets:JSON.stringify(o),transportType:"esriTransportTypeUrl",targetFormat:s,async:a},r=h(e.parsedUrl.path,"convert3D");let i;try{i=(await(a?Gs:Hs)(r,{query:n,responseType:"json",timeout:0})).data}catch{throw new ms}const{supportedFormats:c}=e.infoFor3D;return i.assets.map(l=>{const d=k(l.contentType,c);if(!d)throw new U(d);return new S(l.assetName,l.contentType,[new x(l.assetURL,l.assetHash)])})}function Hs(t,e){return f(t,e)}async function Gs(t,e){const s=(await f(t,e)).data.statusUrl;for(;;){const o=(await f(s,{query:{f:"json"},responseType:"json"})).data;switch(o.status){case"Completed":return f(o.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new Error(o.status);case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new Error}await es(Ks)}}function Js(t){return!!t.infoFor3D&&!!t.url}function z(t){const{infoFor3D:e}=t,s=k("model/gltf-binary",e.supportedFormats)??ws("glb",e.supportedFormats);if(!s)throw new fs;return s}function Ws(){return as.getLogger("esri.layers.graphics.sources.support.uploadAssets")}const Ks=A(1e3);export{se as uploadAssets}; +import{E as _,Z as Q,e as X,hr as I,B as A,hs as N,b_ as h,M as f,at as u,b7 as Y,di as ss,fx as es,ay as ts,fv as os,s as as}from"./index-BjUNJPVf.js";import{h as ns,N as rs,i as S,o as x,A as is}from"./External-DIoD7Bb4.js";import{r as cs,n as ls,a as us,d as ps,c as U,l as ms,t as fs,u as ds,p as hs}from"./uploadAssetErrors-DCHo_tDX.js";import{s as gs,u as k,i as ws}from"./infoFor3D-DsOdlPuA.js";const M={upload:{createFromFiles:.8,loadMesh:.2},uploadAssetBlobs:{prepareAssetItems:.9,uploadAssetItems:.1},uploadConvertibleSource:{uploadEditSource:.5,serviceAssetsToGlb:.5},uploadLocalMesh:{meshToAssetBlob:.5,uploadAssetBlobs:.5}};function g(t,e=o=>{},s){return new ys(t,e,s)}let ys=class{constructor(e,s=a=>{},o){if(this.onProgress=s,this.taskName=o,this._progressMap=new Map,this._startTime=void 0,this._timingsMap=new Map,typeof e=="number"){this._weights={};for(let a=0;a({start:o,end:0}));s===1&&(a.end=o)}this.emitProgress()}simulate(e,s){return D(o=>this.setProgress(e,o),s)}makeOnProgress(e){return s=>this.setProgress(e,s)}};function D(t=s=>{},e=$s){const s=performance.now();t(0);const o=setInterval(()=>{const a=performance.now()-s,n=1-Math.exp(-a/e);t(n)},Ms);return X(()=>{clearInterval(o),t(1)})}function Ps(t,e=bs){return I(N(t*B/e))}function Ts(t,e=As){return I(N(t*B/e))}const bs=10,As=10,B=8e-6,Ms=A(50),$s=A(1e3),O=1e6,E=20*O,Fs=2e9,js=3;async function vs({data:t,name:e,description:s},o,a){let n=null;try{const r=h(o,"uploads"),i=h(r,"info"),{data:c}=await f(i,{query:{f:"json"},responseType:"json"});u(a);const p=Y(o),l=c.maxUploadFileSize*O,d=p?Fs:l,b=p?Math.min(E,l):E;if(t.size>d)throw new Error("Data too large");const L=h(r,"register"),{data:$}=await f(L,{query:{f:"json",itemName:_s(e),description:s},responseType:"json",method:"post"});if(u(a),!$.success)throw new Error("Registration failed");const{itemID:H}=$.item;n=h(r,H);const G=h(n,"uploadPart"),F=Math.ceil(t.size/b),w=new Array;for(let m=0;m{for(;y.length!==0;){const m=w.length-y.length,P=y.pop(),T=new FormData,V=J.simulate(m,Ps(P.size));try{T.append("f","json"),T.append("file",P),T.append("partId",`${m}`);const{data:Z}=await f(G,{timeout:0,body:T,responseType:"json",method:"post"});if(u(a),!Z.success)throw new Error("Part upload failed")}finally{V.remove()}}};for(let m=0;mP).join(",")},responseType:"json",method:"post"});if(u(a),!v.success)throw new Error("Commit failed");return v.item}catch(r){if(n!=null){const i=h(n,"delete");await f(i,{query:{f:"json"},responseType:"json",method:"post"})}throw r}}function _s(t){return t.replaceAll("/","_").replaceAll("\\","_")}async function se(t,e,s){var n;const o=t.length;if(!o)return(n=s==null?void 0:s.onProgress)==null||n.call(s,1),[];const a=g(o,s==null?void 0:s.onProgress,"uploadAssets");return Promise.all(t.map((r,i)=>Es(r,e,{...s,onProgress:a.makeOnProgress(i)})))}async function Es(t,{layer:e,ongoingUploads:s},o){var r;const a=s.get(t);if(a)return a;if(!Js(e))throw new cs;if(Is(t,e))return(r=o==null?void 0:o.onProgress)==null||r.call(o,1),t;const n=Ns(t,e,o);s.set(t,n);try{await n}finally{s.delete(t)}return t}function Is(t,e){const{parsedUrl:s}=e;return s!=null&&t.metadata.externalSources.some(o=>ns(o,s))}async function Ns(t,e,s){const{metadata:o}=t,{displaySource:a}=o,n=C(a==null?void 0:a.source,e),r=!!n,i=o.externalSources.length>0,c=r?Ss(n,e,s):i?xs(t,e,s):Us(t,e,s),p=await c;return u(s),t.addExternalSources([p]),t}async function Ss(t,e,s){return{source:await q(t,e,s),original:!0}}async function xs(t,e,s){const o=z(e),{externalSources:a}=t.metadata,n=Ds(a,e);if(!n)throw new ls;const r=g(M.uploadConvertibleSource,s==null?void 0:s.onProgress,"uploadConvertibleSource"),i=await q(n,e,{onProgress:r.makeOnProgress("uploadEditSource")});t.addExternalSources([{source:i,original:!0}]);const c=n.reduce((l,{asset:d})=>d instanceof File?l+d.size:l,0),p=r.simulate("serviceAssetsToGlb",Ts(c));try{return{source:await Ls(i,e,o)}}finally{p.remove()}}async function Us(t,e,s){const o=g(M.uploadLocalMesh,s==null?void 0:s.onProgress,"uploadLocalMesh"),a=ks(t,e,{...s,onProgress:o.makeOnProgress("meshToAssetBlob")});return{source:await R([a],e,{...s,onProgress:o.makeOnProgress("uploadAssetBlobs")}),extent:t.extent.clone(),original:!0}}async function ks(t,e,s){const o=z(e),a=await t.load(s),n=await a.toBinaryGLTF({ignoreLocalTransform:!0});u(s);const r=await n.buffer();return u(s),{blob:new Blob([r.data],{type:r.type}),assetName:`${ss()}.glb`,assetType:o}}function Ds(t,e){for(const s of t){const o=C(s.source,e);if(o)return o}return null}function C(t,e){if(!t)return null;const{infoFor3D:{supportedFormats:s,editFormats:o}}=e,a=is(t),n=new Array;let r=!1;for(let i=0;iOs(o,s)),e,s)}async function R(t,e,s){const o=g(M.uploadAssetBlobs,s==null?void 0:s.onProgress,"uploadAssetBlobs"),a=await qs(t,e,{...s,onProgress:o.makeOnProgress("prepareAssetItems")});u(s);const n=a.map(({item:i})=>i),{uploadResults:r}=await Rs(n,e,{...s,onProgress:o.makeOnProgress("uploadAssetItems")});return u(s),t.map((i,c)=>zs(a[c],r[c],e))}async function Os(t,e){const{asset:s,assetType:o}=t;if(s instanceof File)return{blob:s,assetName:s.name,assetType:o};const a=await s.toBlob(e);return u(e),{blob:a,assetName:s.assetName,assetType:o}}async function Cs(t,e,s){const{blob:o,assetType:a,assetName:n}=t;let r=null;try{const i=await vs({data:o,name:n},e.url,s);u(s),r={assetType:a,assetUploadId:i.itemID}}catch(i){ts(i),Ws().warnOnce(`Service ${e.url} does not support the REST Uploads API.`)}if(!r){const i=await os(o);if(u(s),!i.isBase64)throw new ds;r={assetType:a,assetData:i.data}}if(!r)throw new hs;return{item:r,assetName:n}}function qs(t,e,s){const o=g(t.length,s==null?void 0:s.onProgress,"prepareAssetItems");return Promise.all(t.map(async(a,n)=>{const r=Cs(await a,e,{...s,onProgress:o.makeOnProgress(n)});return u(s),r}))}async function Rs(t,e,s){const o=D(s==null?void 0:s.onProgress);try{const a=await f(h(e.parsedUrl.path,"uploadAssets"),{timeout:0,query:{f:"json",assets:JSON.stringify(t)},method:"post",responseType:"json"});if(u(s),a.data.uploadResults.length!==t.length)throw new us(t.length,a.data.uploadResults.length);return a.data}finally{o.remove()}}function zs(t,e,s){const{success:o}=e;if(!o){const{error:p}=e;throw new ps(t.assetName,p)}const{assetHash:a}=e,{assetName:n,item:{assetType:r}}=t,{infoFor3D:{supportedFormats:i}}=s,c=gs(r,i);if(!c)throw new U(r);return new S(n,c,[new x(`${s.parsedUrl.path}/assets/${a}`,a)])}async function Ls(t,e,s){var p;const o=t.map(({assetName:l,parts:d})=>({assetName:l,assetHash:d[0].partHash})),a=(p=e.capabilities)==null?void 0:p.operations.supportsAsyncConvert3D,n={f:"json",assets:JSON.stringify(o),transportType:"esriTransportTypeUrl",targetFormat:s,async:a},r=h(e.parsedUrl.path,"convert3D");let i;try{i=(await(a?Gs:Hs)(r,{query:n,responseType:"json",timeout:0})).data}catch{throw new ms}const{supportedFormats:c}=e.infoFor3D;return i.assets.map(l=>{const d=k(l.contentType,c);if(!d)throw new U(d);return new S(l.assetName,l.contentType,[new x(l.assetURL,l.assetHash)])})}function Hs(t,e){return f(t,e)}async function Gs(t,e){const s=(await f(t,e)).data.statusUrl;for(;;){const o=(await f(s,{query:{f:"json"},responseType:"json"})).data;switch(o.status){case"Completed":return f(o.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new Error(o.status);case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new Error}await es(Ks)}}function Js(t){return!!t.infoFor3D&&!!t.url}function z(t){const{infoFor3D:e}=t,s=k("model/gltf-binary",e.supportedFormats)??ws("glb",e.supportedFormats);if(!s)throw new fs;return s}function Ws(){return as.getLogger("esri.layers.graphics.sources.support.uploadAssets")}const Ks=A(1e3);export{se as uploadAssets}; diff --git a/assets/utils-B8iadP2F.js b/assets/utils-BKh1cxpi.js similarity index 89% rename from assets/utils-B8iadP2F.js rename to assets/utils-BKh1cxpi.js index dc4da88..c8284a4 100644 --- a/assets/utils-B8iadP2F.js +++ b/assets/utils-BKh1cxpi.js @@ -1 +1 @@ -import{c6 as G,aj as j,aA as z,c7 as E,a1 as A,c8 as L,aS as O,bh as V}from"./index-CEWggaxV.js";import{L as Z}from"./quantizationUtils-CUjGHrU3.js";import{l as D,u as P}from"./heatmapUtils-Clt5rJzr.js";import{Z as R}from"./utils-SjO_-1JL.js";import{c as T,B as S}from"./utils-GMt8_G3w.js";let c=null;const U=/^(?([0-1][0-9])|([2][0-3])):(?[0-5][0-9])(:(?[0-5][0-9]))?([.](?\d+))?$/;function Y(t,e,s){return t.x<0?t.x+=e:t.x>s&&(t.x-=e),t}function J(t,e,s,o){const r=G(s)?j(s):null,m=r?Math.round((r.valid[1]-r.valid[0])/e.scale[0]):null;return t.map(i=>{const a=new z(i.geometry);return Z(e,a,a,a.hasZ,a.hasM),i.geometry=r?Y(a,m??0,o[0]):a,i})}function K(t,e=18,s,o,r){const m=new Float64Array(o*r);e=Math.round(V(e));let i=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;const M=P(s);for(const{geometry:h,attributes:N}of t){const{x:$,y:u}=h,I=Math.max(0,$-e),g=Math.max(0,u-e),F=Math.min(r,u+e),b=Math.min(o,$+e),p=+M(N);for(let f=g;fl.name.toLowerCase()===o.toLowerCase())),N=!!h&&A(h),$=!!h&&R(h),u=t.valueExpression,I=t.normalizationType,g=t.normalizationField,F=t.normalizationTotal,b=[],p=t.viewInfoParams;let f=null,d=null;if(u){if(!c){const{arcadeUtils:l}=await L();c=l}c.hasGeometryOperations(u)&&await c.enableGeometryOperations(),f=c.createFunction(u),d=p?c.getViewInfo({viewingMode:p.viewingMode,scale:p.scale,spatialReference:new O(p.spatialReference)}):null}const y=t.fieldInfos,w=!(e[0]&&"declaredClass"in e[0]&&e[0].declaredClass==="esri.Graphic")&&y?{fields:y}:null;return e.forEach(l=>{const x=l.attributes;let n;if(u){const v=w?{...l,layer:w}:l,C=c.createExecContext(v,d,M);n=c.executeFunction(f,C)}else x&&(n=x[o],r?(n=`${T(n)}${i}${T(x[r])}`,m&&(n=`${n}${i}${T(x[m])}`)):typeof n=="string"&&s&&($?n=n?new Date(n).getTime():null:N&&(n=n?_(n):null)));if(I&&typeof n=="number"&&isFinite(n)){const v=x&&parseFloat(x[g]);n=S(n,I,v,F)}b.push(n)}),b}export{Q as b,J as j,_ as w,K as x}; +import{c6 as G,aj as j,aA as z,c7 as E,a1 as A,c8 as L,aS as O,bh as V}from"./index-BjUNJPVf.js";import{L as Z}from"./quantizationUtils-CfV316jZ.js";import{l as D,u as P}from"./heatmapUtils-BSteZBTj.js";import{Z as R}from"./utils-Bzmbfe7p.js";import{c as T,B as S}from"./utils-CY1ReiSd.js";let c=null;const U=/^(?([0-1][0-9])|([2][0-3])):(?[0-5][0-9])(:(?[0-5][0-9]))?([.](?\d+))?$/;function Y(t,e,s){return t.x<0?t.x+=e:t.x>s&&(t.x-=e),t}function J(t,e,s,o){const r=G(s)?j(s):null,m=r?Math.round((r.valid[1]-r.valid[0])/e.scale[0]):null;return t.map(i=>{const a=new z(i.geometry);return Z(e,a,a,a.hasZ,a.hasM),i.geometry=r?Y(a,m??0,o[0]):a,i})}function K(t,e=18,s,o,r){const m=new Float64Array(o*r);e=Math.round(V(e));let i=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;const M=P(s);for(const{geometry:h,attributes:N}of t){const{x:$,y:u}=h,I=Math.max(0,$-e),g=Math.max(0,u-e),F=Math.min(r,u+e),b=Math.min(o,$+e),p=+M(N);for(let f=g;fl.name.toLowerCase()===o.toLowerCase())),N=!!h&&A(h),$=!!h&&R(h),u=t.valueExpression,I=t.normalizationType,g=t.normalizationField,F=t.normalizationTotal,b=[],p=t.viewInfoParams;let f=null,d=null;if(u){if(!c){const{arcadeUtils:l}=await L();c=l}c.hasGeometryOperations(u)&&await c.enableGeometryOperations(),f=c.createFunction(u),d=p?c.getViewInfo({viewingMode:p.viewingMode,scale:p.scale,spatialReference:new O(p.spatialReference)}):null}const y=t.fieldInfos,w=!(e[0]&&"declaredClass"in e[0]&&e[0].declaredClass==="esri.Graphic")&&y?{fields:y}:null;return e.forEach(l=>{const x=l.attributes;let n;if(u){const v=w?{...l,layer:w}:l,C=c.createExecContext(v,d,M);n=c.executeFunction(f,C)}else x&&(n=x[o],r?(n=`${T(n)}${i}${T(x[r])}`,m&&(n=`${n}${i}${T(x[m])}`)):typeof n=="string"&&s&&($?n=n?new Date(n).getTime():null:N&&(n=n?_(n):null)));if(I&&typeof n=="number"&&isFinite(n)){const v=x&&parseFloat(x[g]);n=S(n,I,v,F)}b.push(n)}),b}export{Q as b,J as j,_ as w,K as x}; diff --git a/assets/utils-SjO_-1JL.js b/assets/utils-Bzmbfe7p.js similarity index 93% rename from assets/utils-SjO_-1JL.js rename to assets/utils-Bzmbfe7p.js index cf451bb..02196d7 100644 --- a/assets/utils-SjO_-1JL.js +++ b/assets/utils-Bzmbfe7p.js @@ -1 +1 @@ -import{O as d,aJ as p,aK as u,aL as y,aM as i,aI as r,aN as g,aO as h,W as Z,aP as l}from"./index-CEWggaxV.js";function v(e){return d(e)||p(e)||u(e)}function w(e,c){const{format:o,timeZoneOptions:n,fieldType:m}=c??{};let a,s;if(n&&({timeZone:a,timeZoneName:s}=y(n.layerTimeZone,n.datesInUnknownTimezone,n.viewTimeZone,i(o||"short-date-short-time"),m)),typeof e=="string"&&isNaN(Date.parse(m==="time-only"?`1970-01-01T${e}Z`:e)))return e;switch(m){case"date-only":{const t=i(o||"short-date");return typeof e=="string"?l(e,{...t}):r(e,{...t,timeZone:Z})}case"time-only":{const t=i(o||"short-time");return typeof e=="string"?h(e,t):r(e,{...t,timeZone:Z})}case"timestamp-offset":{if(!a&&typeof e=="string"&&new Date(e).toISOString()!==e)return e;const t=o||n?i(o||"short-date-short-time"):void 0,f=t?{...t,timeZone:a,timeZoneName:s}:void 0;return typeof e=="string"?g(e,f):r(e,f)}default:{const t=o||n?i(o||"short-date-short-time"):void 0;return r(typeof e=="string"?new Date(e):e,t?{...t,timeZone:a,timeZoneName:s}:void 0)}}}export{w as N,v as Z}; +import{O as d,aJ as p,aK as u,aL as y,aM as i,aI as r,aN as g,aO as h,W as Z,aP as l}from"./index-BjUNJPVf.js";function v(e){return d(e)||p(e)||u(e)}function w(e,c){const{format:o,timeZoneOptions:n,fieldType:m}=c??{};let a,s;if(n&&({timeZone:a,timeZoneName:s}=y(n.layerTimeZone,n.datesInUnknownTimezone,n.viewTimeZone,i(o||"short-date-short-time"),m)),typeof e=="string"&&isNaN(Date.parse(m==="time-only"?`1970-01-01T${e}Z`:e)))return e;switch(m){case"date-only":{const t=i(o||"short-date");return typeof e=="string"?l(e,{...t}):r(e,{...t,timeZone:Z})}case"time-only":{const t=i(o||"short-time");return typeof e=="string"?h(e,t):r(e,{...t,timeZone:Z})}case"timestamp-offset":{if(!a&&typeof e=="string"&&new Date(e).toISOString()!==e)return e;const t=o||n?i(o||"short-date-short-time"):void 0,f=t?{...t,timeZone:a,timeZoneName:s}:void 0;return typeof e=="string"?g(e,f):r(e,f)}default:{const t=o||n?i(o||"short-date-short-time"):void 0;return r(typeof e=="string"?new Date(e):e,t?{...t,timeZone:a,timeZoneName:s}:void 0)}}}export{w as N,v as Z}; diff --git a/assets/utils-CMvkNhle.js b/assets/utils-CBTVfSGR.js similarity index 99% rename from assets/utils-CMvkNhle.js rename to assets/utils-CBTVfSGR.js index f45b9e6..71a641e 100644 --- a/assets/utils-CMvkNhle.js +++ b/assets/utils-CBTVfSGR.js @@ -1 +1 @@ -import{d as c,y as m,f as A,aU as $e,e1 as rs,aY as jt,c9 as Y,aV as L,a$ as vs,b0 as ws,aZ as Ct,aR as _t,lZ as kt,N as Bt,kY as _e,aA as Be,aE as bs}from"./index-CEWggaxV.js";import{u as w,r as nt,i as vt,o as As,t as Ts,n as Fe,v as os,d as Xt,w as is,x as Ps,y as K,z as $s,A as Fs,B as Ns,C as Is}from"./dataUtils-BFJflGP5.js";import{a as Rs,s as ks,v as Vt,C as Cs,w as as,e as je,x as _s,y as Bs,z as Kt,E as js,H as Ss,I as Jt,J as Ms,M as Os,K as Ds}from"./RasterSymbolizer-D7OwkKeP.js";import{m as Gs,p as Es}from"./colorRamps-BJydlf0f.js";let Ut=class extends $e{constructor(){super(...arguments),this.raster=void 0}};c([m({json:{write:!0}})],Ut.prototype,"raster",void 0),Ut=c([A("esri.layers.support.rasterFunctions.AspectFunctionArguments")],Ut);const D=Ut;var Yt;let wt=Yt=class extends D{constructor(){super(...arguments),this.raster2=void 0}get rasters(){return[this.raster,this.raster2]}clone(){return new Yt({raster:this.raster,raster2:this.raster2,operation:this.operation})}};c([m({json:{write:!0}})],wt.prototype,"operation",void 0),c([m({json:{write:!0}})],wt.prototype,"raster2",void 0),c([m({readOnly:!0})],wt.prototype,"rasters",null),wt=Yt=c([A("esri.layers.support.rasterFunctions.ArithmeticFunctionArguments")],wt);const zs=wt,Vs=new Set(["slope","aspect","curvature","hillshade","shadedrelief","statistics"]);let S=class extends $e{constructor(){super(...arguments),this.functionArguments=null,this.readingBufferSize=0,this.id=-1,this.isNoopProcess=!1,this.rawInputBandIds=[],this.rawSourceRasterInfos=null,this.isInputBandIdsSwizzled=!1,this.swizzledBandSelection=[],this.isBranch=!1,this._bindingResult=null}get supportsGPU(){return this._bindingResult.supportsGPU}get flatWebGLFunctionChain(){var u;const t=this.getWebGLProcessorDefinition();if(!t)return null;const e=[t],{parameters:s}=t;let o=s.rasters||s.raster&&[s.raster];for(;o!=null&&o.length;){e.unshift(...o);const l=[];for(let p=0;p=0;l--)e[l].isNoopProcess&&e.splice(l,1);let r=!1;for(let l=0;l1}const a=e.some(({name:l})=>Vs.has(l.toLowerCase())),{rawSourceRasterInfos:n}=this;return{functions:e,hasBranches:r,hasFocalFunction:a,isSourceSingleBand:((u=n==null?void 0:n[0])==null?void 0:u.bandCount)===1}}bind(t,e=!1,s=-1){this.id=s+1;const o=this._getRasterValues();let r=!0;for(let a=0;athis._readRasterValue(o,t));return this._processPixels({...t,pixelBlocks:s})}processInputBandIds(){const t=this._getRasterValues().filter(this._isRasterFunctionValue);let e;if(t.length>1){const r=t.map(n=>n.processInputBandIds()[0]);this.rawInputBandIds=r,this.isInputBandIdsSwizzled=this.rawInputBandIds.some((n,u)=>n!==u);const a=t.filter(n=>n.functionName==="ExtractBand");return a.length&&a.forEach((n,u)=>{n.isInputBandIdsSwizzled=!0,n.swizzledBandSelection=[u,u,u]}),this.rawInputBandIds}const s=t[0];if(s){if(e=s.processInputBandIds(),s.isInputBandIdsSwizzled)return this.rawInputBandIds=e,e}else{e=[];const{bandCount:r}=this.sourceRasterInfos[0];for(let a=0;ar!==a),this.rawInputBandIds=o,this.rawInputBandIds}getPrimaryRasters(){const t=[],e=[];return this._getPrimaryRasters(this,t,e),{rasters:t,rasterIds:e}}getWebGLProcessorDefinition(){const t=this._getWebGLParameters(),{raster:e,rasters:s}=this.functionArguments;return s&&Array.isArray(s)&&s.length?(t.rasters=s.map(o=>this._isRasterFunctionValue(o)?o.getWebGLProcessorDefinition():typeof o=="number"?{name:"Constant",parameters:{value:o},pixelType:"f32",id:-1,isNoopProcess:!1}:{name:"Identity",parameters:{value:o},pixelType:"f32",id:-1,isNoopProcess:!1}),t.rasters.some(o=>o!=null)||(t.rasters=null)):this._isRasterFunctionValue(e)&&(t.raster=e.getWebGLProcessorDefinition()),{name:this.functionName,parameters:t,pixelType:this.outputPixelType,id:this.id,isNoopProcess:this.isNoopProcess}}getClippingGeometries(){const t=[];this.functionName==="Clip"&&t.push(this.functionArguments);const{raster:e,rasters:s}=this.functionArguments;if(s&&Array.isArray(s)&&s.length)s.forEach(o=>{if(this._isRasterFunctionValue(o)){const r=o.getClippingGeometries();t.push(...r)}});else if(this._isRasterFunctionValue(e)){const o=e.getClippingGeometries();t.push(...o)}return t}_getOutputPixelType(t){return this.outputPixelType==="unknown"?t:this.outputPixelType??t}_getWebGLParameters(){return{}}_getInputBandIds(t){return t}_removeStatsHistColormapVAT(t){t.statistics=null,t.histograms=null,t.colormap=null,t.attributeTable=null}_getRasterValues(){const{rasterArgumentNames:t}=this;return t[0]==="rasters"?this.functionArguments.rasters??[]:t.flatMap(e=>this.functionArguments[e])}_getSourceRasterInfos(t){const e=this._getRasterValues(),{rasterInfos:s,rasterIds:o}=t;if(e.length===0)return s;const r=e.map(n=>n&&typeof n=="object"&&"bind"in n&&n.rasterInfo?n.rasterInfo:typeof n=="string"&&o.includes(n)?s[o.indexOf(n)]:typeof n!="number"?s[0]:void 0),a=r.find(n=>n)??s[0];return r.forEach((n,u)=>{n===void 0&&(r[u]=a)}),r}_getPrimaryRasterId(t){return t==null?void 0:t.rasterId}_getPrimaryRasters(t,e=[],s=[]){for(let o=0;oe?o.slice(0,e):null),r&&r.length!==e&&(t.histograms=r.length>e?r.slice(0,e):null),s.BAND_COUNT&&Number(s.BAND_COUNT)!==e&&(t.keyProperties={...s,BAND_COUNT:typeof s.BAND_COUNT=="string"?String(e):e})}};c([m({json:{write:!0}})],S.prototype,"functionName",void 0),c([m({json:{write:!0}})],S.prototype,"functionArguments",void 0),c([m()],S.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}}),rs(i=>i==null?void 0:i.toLowerCase())],S.prototype,"outputPixelType",void 0),c([m({json:{write:!0}})],S.prototype,"mainPrimaryRasterId",void 0),c([m()],S.prototype,"sourceRasters",void 0),c([m({type:[Rs],json:{write:!0}})],S.prototype,"sourceRasterInfos",void 0),c([m({json:{write:!0}})],S.prototype,"rasterInfo",void 0),c([m({json:{write:!0}})],S.prototype,"readingBufferSize",void 0),c([m({json:{write:!0}})],S.prototype,"id",void 0),c([m()],S.prototype,"isNoopProcess",void 0),c([m()],S.prototype,"supportsGPU",null),c([m()],S.prototype,"rawInputBandIds",void 0),c([m()],S.prototype,"rawSourceRasterInfos",void 0),c([m()],S.prototype,"isInputBandIdsSwizzled",void 0),c([m()],S.prototype,"swizzledBandSelection",void 0),c([m()],S.prototype,"isBranch",void 0),c([m({readOnly:!0})],S.prototype,"flatWebGLFunctionChain",null),c([m()],S.prototype,"_bindingResult",void 0),S=c([A("esri.layers.support.rasterFunctions.BaseRasterFunction")],S);const G=S,$={userDefined:-1,lineDetectionHorizontal:0,lineDetectionVertical:1,lineDetectionLeftDiagonal:2,lineDetectionRightDiagonal:3,gradientNorth:4,gradientWest:5,gradientEast:6,gradientSouth:7,gradientNorthEast:8,gradientNorthWest:9,smoothArithmeticMean:10,smoothing3x3:11,smoothing5x5:12,sharpening3x3:13,sharpening5x5:14,laplacian3x3:15,laplacian5x5:16,sobelHorizontal:17,sobelVertical:18,sharpen:19,sharpen2:20,pointSpread:21,none:255},Us={plus:1,minus:2,times:3,sqrt:4,power:5,abs:10,divide:23,exp:25,exp10:26,exp2:27,int:30,float:32,ln:35,log10:36,log2:37,mod:44,negate:45,roundDown:48,roundUp:49,square:53,floatDivide:64,floorDivide:65},U={bitwiseAnd:11,bitwiseLeftShift:12,bitwiseNot:13,bitwiseOr:14,bitwiseRightShift:15,bitwiseXOr:16,booleanAnd:17,booleanNot:18,booleanOr:19,booleanXOr:20,equalTo:24,greaterThan:28,greaterThanEqual:29,lessThan:33,lessThanEqual:34,isNull:31,notEqual:46},H={acos:6,asin:7,atan:8,atanh:9,cos:21,cosh:22,sin:51,sinh:52,tan:56,tanh:57,acosh:59,asinh:60,atan2:61},Ls={majority:38,max:39,mean:40,med:41,min:42,minority:43,range:47,stddev:54,sum:55,variety:58,majorityIgnoreNoData:66,maxIgnoreNoData:67,meanIgnoreNoData:68,medIgnoreNoData:69,minIgnoreNoData:70,minorityIgnoreNoData:71,rangeIgnoreNoData:72,stddevIgnoreNoData:73,sumIgnoreNoData:74,varietyIgnoreNoData:75},us={setNull:50,conditional:78},Se={...Us,...U,...H,...Ls,...us},ls=new Map([[H.acos,{domain:[0,Math.PI],isInteger:!1}],[H.asin,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[H.atan,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[H.cos,{domain:[-1,1],isInteger:!1}],[H.sin,{domain:[-1,1],isInteger:!1}],[U.booleanAnd,{domain:[0,1],isInteger:!0}],[U.booleanNot,{domain:[0,1],isInteger:!0}],[U.booleanOr,{domain:[0,1],isInteger:!0}],[U.booleanXOr,{domain:[0,1],isInteger:!0}],[U.equalTo,{domain:[0,1],isInteger:!0}],[U.notEqual,{domain:[0,1],isInteger:!0}],[U.greaterThan,{domain:[0,1],isInteger:!0}],[U.greaterThanEqual,{domain:[0,1],isInteger:!0}],[U.lessThan,{domain:[0,1],isInteger:!0}],[U.lessThanEqual,{domain:[0,1],isInteger:!0}],[U.isNull,{domain:[0,1],isInteger:!0}]]);function Me(i){return ls.get(i)}const Oe=[0,2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,2,1,1,1,999,999,1,1,999,1,1,2,999,999,2,2,999,999,999,999,999,999,999,999,999,999,3,999,3];function Ws(i,t=!1){const e=i.map(n=>n.mask),s=e.filter(n=>n!=null),o=i[0].pixels[0].length;if(s.length===0||t&&s.length!==e.length)return new Uint8Array(o).fill(255);const r=s[0],a=new Uint8Array(r);if(s.length===1)return a;if(!t){for(let n=1;n=1?t[u]=0:a[u]=Math.atanh(l)}return a}const n=s===H.asin?Math.asin:Math.acos;for(let u=0;u1?t[u]=0:a[u]=n(l)}return a}function en(i,t,e,s){const[o]=i,r=o.length,a=w.createEmptyBand(e,r);for(let n=0;n>o[n]);return a}function ln(i,t,e){const[s,o]=i,r=s.length,a=w.createEmptyBand(e,r);for(let n=0;no[n]?1:0);return a}function An(i,t,e){const[s,o]=i,r=s.length,a=w.createEmptyBand(e,r);for(let n=0;n=o[n]?1:0);return a}function Tn(i,t,e){const[s,o]=i,r=s.length,a=w.createEmptyBand(e,r);for(let n=0;np&&(u=p)}a[n]=u}return a}function ze(i,t,e){const s=i.length;if(s<2)return i[0];const[o]=i,r=o.length,a=w.createEmptyBand(e,r);for(let n=0;nh&&(u=h)}a[n]=l-u}return a}function Ve(i,t,e){const s=i.length;if(s<2)return i[0];const[o]=i,r=o.length,a=w.createEmptyBand(e,r);for(let n=0;np&&(p=l,u=h);r[n]=u}return r}function He(i,t,e){const s=i.length;if(s<=2)return ps(i,t,e);const o=i[0].length,r=w.createEmptyBand(e,o),a=new Map;for(let n=0;nr?t[n]=0:s[n]=a?Math.round(u):u}}function hs(i,t,e={}){kn();let s=Ws(i,t>=66&&t<=75);const{outputPixelType:o="f32"}=e,r=!j.has(t)||e.processAsMultiband,a=r?i[0].pixels.length:1,n=[];for(let l=0;lg.pixels):i.map(g=>g.pixels[l]);let h,f=!0;if(t===us.setNull){const g=Rn(p,s,o);h=g.band,s=g.mask,f=!1}else T.has(t)?h=T.get(t)(p,s,"f64"):O.has(t)?h=t===H.asin||t===H.acos||t===H.atanh?tn(p,s,"f64",t):en(p,s,"f64",O.get(t)):Ht.has(t)?h=sn(p,s,"f64",Ht.get(t)):j.has(t)?h=j.get(t)(p,s,"f64"):(h=p[0],f=!1);if(f&&t!==U.isNull&&!ls.has(t)){const g=w.createEmptyBand(o,h.length);s||(s=new Uint8Array(h.length).fill(255)),Cn(h,s,o,g),h=g}n.push(h)}const u=i[0];return new w({width:u.width,height:u.height,pixelType:o,mask:t===U.isNull?null:s,pixels:n})}function _n(i,t,e){return hs(i,t=[null,1,2,3,23,5,44][t]??1,{outputPixelType:e})}let bt=class extends G{constructor(){super(...arguments),this.functionName="Arithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){const{operation:t}=this.functionArguments;if(t<1||t>6)return{success:!1,supportsGPU:!1,error:"unsupported operation"};const e=this.sourceRasterInfos[0].clone();return this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,{success:!0,supportsGPU:e.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;return(e==null?void 0:e[0])==null||(e==null?void 0:e[1])==null?null:_n(e,this.functionArguments.operation,this.outputPixelType)}_getWebGLParameters(){const{operation:t}=this.functionArguments,e=["","plus","minus","times","divide","power","mod"][t],s=this.outputPixelType??"f32";let[o,r]=vt(s);const a=nt(s);return a&&(o-=1e-4,r+=1e-4),{imageCount:2,operationName:e,domainRange:[o,r],isOutputRounded:a}}};c([m({json:{write:!0,name:"rasterFunction"}})],bt.prototype,"functionName",void 0),c([m({type:zs,json:{write:!0,name:"rasterFunctionArguments"}})],bt.prototype,"functionArguments",void 0),c([m()],bt.prototype,"rasterArgumentNames",void 0),bt=c([A("esri.layers.support.rasterFunctions.ArithmeticFunction")],bt);const Bn=bt;var Zt;let Qt=Zt=class extends D{clone(){return new Zt({raster:this.raster})}};Qt=Zt=c([A("esri.layers.support.rasterFunctions.AspectFunctionArguments")],Qt);const jn=Qt;let rt=class extends G{constructor(){super(...arguments),this.functionName="Aspect",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){var s;const t=this.sourceRasterInfos[0];this.isGCS=((s=t.spatialReference)==null?void 0:s.isGeographic)??!1,this.outputPixelType=this._getOutputPixelType("f32");const e=t.clone();return e.pixelType=this.outputPixelType,e.statistics=[{min:-1,max:360,avg:180,stddev:30}],e.histograms=null,e.colormap=null,e.attributeTable=null,e.bandCount=1,this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){var n;const e=(n=t.pixelBlocks)==null?void 0:n[0];if(e==null)return null;const{extent:s,primaryPixelSizes:o}=t,r=o==null?void 0:o[0],a=r??(s?{x:s.width/e.width,y:s.height/e.height}:{x:1,y:1});return ks(e,{resolution:a})}};c([m({json:{write:!0,name:"rasterFunction"}})],rt.prototype,"functionName",void 0),c([m({type:jn,json:{write:!0,name:"rasterFunctionArguments"}})],rt.prototype,"functionArguments",void 0),c([m()],rt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],rt.prototype,"isGCS",void 0),rt=c([A("esri.layers.support.rasterFunctions.AspectFunction")],rt);const Sn=rt,Mn=new Set(["+","-","*","/","(",")"]);function On(i,t){(i=i.replaceAll(" ","")).startsWith("-")&&(i="0"+i),i.startsWith("+")&&(i=i.slice(1,i.length));const e=i.split(""),s=[],o=[];let r="";for(let a=0;a-1)e>0&&(o+=t+1);else{for(let a=0;a0&&(o+=t+1)}let r=0;for(let a=0;a0;){const{numIndex:a,opIndex:n}=En(o);if(s=Dn(i,o[n],r[a],r[a+1]),o.length===1)break;o=Gn(o,n),r.splice(a,2,s)}return[s]}const Vn=new jt({0:"custom",1:"ndvi",2:"savi",3:"tsavi",4:"msavi",5:"gemi",6:"pvi",7:"gvitm",8:"sultan",9:"vari",10:"gndvi",11:"sr",12:"ndvi-re",13:"sr-re",14:"mtvi2",15:"rtvi-core",16:"ci-re",17:"ci-g",18:"ndwi",19:"evi",20:"iron-oxide",21:"ferrous-minerals",22:"clay-minerals",23:"wndwi",24:"bai",25:"nbr",26:"ndbi",27:"ndmi",28:"ndsi",29:"mndwi"},{useNumericKeys:!0});function Un(i,t){if(!As(i))return i;const{equation:e,method:s}=t,o=t.bandIndexes.map(p=>p-1),{pixels:r,mask:a}=i;let n;switch(s){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":n=Ke(a,r[o[0]],r[o[1]]);break;case"ndwi":n=Ke(a,r[o[1]],r[o[0]]);break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":n=Wn(a,r[o[0]],r[o[1]]);break;case"ci-g":case"ci-re":n=qn(a,r[o[0]],r[o[1]]);break;case"savi":n=Hn(a,r[o[0]],r[o[1]],o[2]+1);break;case"tsavi":n=Xn(a,r[o[0]],r[o[1]],o[2]+1,o[3]+1,o[4]+1);break;case"msavi":n=Jn(a,r[o[0]],r[o[1]]);break;case"gemi":n=Kn(a,r[o[0]],r[o[1]]);break;case"pvi":n=Yn(a,r[o[0]],r[o[1]],o[2]+1,o[3]+1);break;case"gvitm":n=Zn(a,[r[o[0]],r[o[1]],r[o[2]],r[o[3]],r[o[4]],r[o[5]]]);break;case"sultan":n=Qn(a,[r[o[0]],r[o[1]],r[o[2]],r[o[3]],r[o[4]]]);break;case"vari":n=tr(a,[r[o[0]],r[o[1]],r[o[2]]]);break;case"mtvi2":n=er(a,[r[o[0]],r[o[1]],r[o[2]]]);break;case"rtvi-core":n=sr(a,[r[o[0]],r[o[1]],r[o[2]]]);break;case"evi":n=nr(a,[r[o[0]],r[o[1]],r[o[2]]]);break;case"wndwi":n=rr(a,[r[o[0]],r[o[1]],r[o[2]]],o[3]?o[3]+1:.5);break;case"bai":n=or(a,r[o[0]],r[o[1]]);break;case"custom":n=zn(a,r,e);break;default:return i}const u=a!=null?new Uint8Array(a.length):null;a!=null&&u!=null&&u.set(a);const l=new w({width:i.width,height:i.height,pixelType:"f32",pixels:n,mask:u});return l.updateStatistics(),l}function Ln(i,t,e,s){const{mask:o,pixels:r,width:a,height:n}=i,u=r[e],l=r[t],p=l.length,h=s?new Uint8Array(p):new Float32Array(p),f=s?100:1,g=s?100.5:0;for(let y=0;yparseFloat(n));return Un(e,{method:s,bandIndexes:r,equation:o})}_getWebGLParameters(){const t=this.functionArguments.bandIndexes.split(" ").map(n=>parseFloat(n)-1);t.length===2&&t.push(0);const e=this.isInputBandIdsSwizzled?[0,1,2]:t;let s,o;const r=new Float32Array(3),{method:a}=this.functionArguments;switch(a){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":s=z([e[0],e[1],0]),o="ndxi";break;case"ndwi":s=z([e[1],e[0],0]),o="ndxi";break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":s=z([e[0],e[1],0]),o="sr";break;case"ci-g":case"ci-re":s=z([e[0],e[1],0]),o="ci";break;case"savi":s=z([e[0],e[1],0]),o="savi",r[0]=t[2]+1;break;case"tsavi":s=z([e[0],e[1],0]),o="tsavi",r[0]=t[2]+1,r[1]=t[3]+1,r[2]=t[4]+1;break;case"msavi":s=z([e[0],e[1],0]),o="msavi";break;case"gemi":s=z([e[0],e[1],0]),o="gemi";break;case"pvi":s=z([e[0],e[1],0]),o="tsavi",r[0]=t[2]+1,r[1]=t[3]+1;break;case"vari":s=z([e[0],e[1],e[2]]),o="vari";break;case"mtvi2":s=z([e[0],e[1],e[2]]),o="mtvi";break;case"rtvi-core":s=z([e[0],e[1],e[2]]),o="rtvicore";break;case"evi":s=z([e[0],e[1],e[2]]),o="evi";break;case"wndwi":s=z([e[0],e[1],0]),o="wndwi",r[0]=t[3]?t[3]+1:.5;break;case"bai":s=z([e[1],e[0],0]),o="bai";break;default:s=z([0,1,2]),o="custom"}return{bandIndexMat3:s,indexType:o,adjustments:r}}_getInputBandIds(t){if(this.functionArguments.method==="custom")return t;const e=this.functionArguments.bandIndexes.split(" ").map(n=>parseFloat(n)-1),s=t.length,o=e.map(n=>n>=s?s-1:n),r=ar.has(this.functionArguments.method)?3:2,a=o.slice(0,r).map(n=>t[n]);return a.length===2&&a.push(0),a}};c([m({json:{write:!0,name:"rasterFunction"}})],At.prototype,"functionName",void 0),c([m({type:ir,json:{write:!0,name:"rasterFunctionArguments"}})],At.prototype,"functionArguments",void 0),c([m()],At.prototype,"rasterArgumentNames",void 0),At=c([A("esri.layers.support.rasterFunctions.BandArithmeticFunction")],At);const ur=At;var ee;const Ye=new jt({1:"outside",2:"inside"},{useNumericKeys:!0});let Ot=ee=class extends D{constructor(){super(...arguments),this.clippingType="outside"}clone(){return new ee({clippingGeometry:this.clippingGeometry.clone(),clippingType:this.clippingType})}};c([m({types:vs,json:{read:ws,write:!0}})],Ot.prototype,"clippingGeometry",void 0),c([m({json:{read:Ye.read,write:Ye.write}})],Ot.prototype,"clippingType",void 0),Ot=ee=c([A("esri.layers.support.rasterFunctions.ClipFunctionArguments")],Ot);const lr=Ot;let ot=class extends G{constructor(){super(...arguments),this.functionName="Clip",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone();return this.outputPixelType=this._getOutputPixelType(t.pixelType),t.pixelType=this.outputPixelType,this.rasterInfo=t,{success:!0,supportsGPU:!0}}_processPixels(t){var e;return(e=t.pixelBlocks)==null?void 0:e[0]}_getWebGLParameters(){const{clippingGeometry:t,clippingType:e}=this.functionArguments;return{clippingGeometry:t.toJSON(),clippingType:e}}};c([m({json:{write:!0,name:"rasterFunction"}})],ot.prototype,"functionName",void 0),c([m({type:lr,json:{write:!0,name:"rasterFunctionArguments"}})],ot.prototype,"functionArguments",void 0),c([m()],ot.prototype,"rasterArgumentNames",void 0),c([m()],ot.prototype,"isNoopProcess",void 0),ot=c([A("esri.layers.support.rasterFunctions.ClipFunction")],ot);const cr=ot;var se;let X=se=class extends D{castColormapName(i){if(!i)return null;const t=i.toLowerCase();return Cs.includes(t)?t:null}readColorRamp(i){return Es(i)}readColorRampName(i,t){if(!i)return null;const e=Vt.jsonValues.find(s=>s.toLowerCase()===i.toLowerCase());return e?Vt.fromJSON(e):null}clone(){var i;return new se({colormap:L(this.colormap),colormapName:this.colormapName,colorRamp:(i=this.colorRamp)==null?void 0:i.clone(),colorRampName:this.colorRampName})}};c([m({type:[[Number]],json:{write:!0}})],X.prototype,"colormap",void 0),c([m({type:String,json:{write:!0}})],X.prototype,"colormapName",void 0),c([rs("colormapName")],X.prototype,"castColormapName",null),c([m({types:Gs,json:{write:!0}})],X.prototype,"colorRamp",void 0),c([Ct("colorRamp")],X.prototype,"readColorRamp",null),c([m({type:Vt.apiValues,json:{type:Vt.jsonValues,write:Vt.write}})],X.prototype,"colorRampName",void 0),c([Ct("colorRampName")],X.prototype,"readColorRampName",null),X=se=c([A("esri.layers.support.rasterFunctions.ColormapFunctionArguments")],X);const pr=X,hr=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[112,75,3],[113,76,3],[114,77,3],[115,77,3],[116,78,3],[117,79,3],[118,79,3],[119,80,3],[121,81,4],[122,82,4],[123,82,4],[124,83,4],[125,84,4],[126,84,4],[127,85,4],[128,86,4],[129,86,4],[130,87,4],[131,88,4],[132,89,4],[133,89,4],[134,90,4],[135,91,4],[136,91,4],[137,92,4],[138,93,4],[139,94,4],[140,94,4],[142,95,5],[143,96,5],[144,96,5],[145,97,5],[146,98,5],[147,99,5],[148,99,5],[149,100,5],[150,101,5],[151,101,5],[152,102,5],[153,103,5],[154,104,5],[155,104,5],[156,105,5],[157,106,5],[158,106,5],[159,107,5],[160,108,5],[161,108,5],[162,109,5],[164,110,6],[165,111,6],[166,111,6],[167,112,6],[168,113,6],[169,113,6],[170,114,6],[171,115,6],[172,116,6],[173,116,6],[174,117,6],[245,0,0],[245,5,0],[245,10,0],[246,15,0],[246,20,0],[246,25,0],[246,30,0],[247,35,0],[247,40,0],[247,45,0],[247,50,0],[247,55,0],[248,60,0],[248,65,0],[248,70,0],[248,75,0],[249,81,0],[249,86,0],[249,91,0],[249,96,0],[250,101,0],[250,106,0],[250,111,0],[250,116,0],[250,121,0],[251,126,0],[251,131,0],[251,136,0],[251,141,0],[252,146,0],[252,151,0],[252,156,0],[252,156,0],[251,159,0],[250,162,0],[249,165,0],[248,168,0],[247,171,0],[246,174,0],[245,177,0],[245,179,0],[244,182,0],[243,185,0],[242,188,0],[241,191,0],[240,194,0],[239,197,0],[238,200,0],[237,203,0],[236,206,0],[235,209,0],[234,212,0],[233,215,0],[232,218,0],[231,221,0],[230,224,0],[230,226,0],[229,229,0],[228,232,0],[227,235,0],[226,238,0],[225,241,0],[224,244,0],[223,247,0],[165,247,0],[163,244,0],[161,240,0],[158,237,0],[156,233,1],[154,230,1],[152,227,1],[149,223,1],[147,220,1],[145,216,1],[143,213,1],[140,210,2],[138,206,2],[136,203,2],[134,200,2],[132,196,2],[129,193,2],[127,189,2],[125,186,3],[123,183,3],[120,179,3],[118,176,3],[116,172,3],[114,169,3],[111,166,3],[109,162,4],[107,159,4],[105,155,4],[103,152,4],[100,149,4],[98,145,4],[96,142,4],[94,138,5],[91,135,5],[89,132,5],[87,128,5],[85,125,5],[82,121,5],[80,118,5],[78,115,6],[76,111,6],[73,108,6],[71,105,6],[69,101,6],[67,98,6],[65,94,6],[62,91,7],[60,88,7],[58,84,7],[56,81,7],[53,77,7],[51,74,7],[49,71,7],[47,67,8],[44,64,8],[42,60,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8]],mr=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[245,20,0],[245,24,0],[245,29,0],[245,31,0],[247,33,0],[247,33,0],[247,37,0],[247,41,0],[247,41,0],[247,41,0],[247,45,0],[247,45,0],[247,47,0],[247,49,0],[247,49,0],[247,54,0],[247,54,0],[247,56,0],[247,58,0],[247,58,0],[250,62,0],[250,62,0],[250,62,0],[250,67,0],[250,67,0],[250,67,0],[250,69,0],[250,71,0],[250,71,0],[250,75,0],[250,75,0],[250,78,0],[250,79,0],[250,79,0],[250,79,0],[250,81,0],[250,83,0],[250,83,0],[250,87,0],[250,87,0],[250,90,0],[250,92,0],[252,93,0],[252,93,0],[252,97,0],[252,97,0],[252,97,0],[252,97,0],[252,101,0],[252,101,0],[252,101,0],[252,101,0],[252,105,0],[252,105,0],[252,107,0],[252,109,0],[252,109,0],[252,113,13],[255,118,20],[255,119,23],[255,121,25],[255,126,33],[255,132,38],[255,133,40],[255,135,43],[255,141,48],[255,144,54],[255,150,59],[255,152,61],[255,153,64],[255,159,69],[255,163,77],[255,165,79],[255,168,82],[255,174,87],[255,176,92],[255,181,97],[255,183,99],[255,186,102],[255,191,107],[255,197,115],[255,201,120],[255,203,123],[255,205,125],[255,209,130],[255,214,138],[255,216,141],[255,218,143],[255,224,150],[255,228,156],[255,234,163],[255,236,165],[255,238,168],[255,243,173],[255,248,181],[255,252,186],[253,252,186],[250,252,187],[244,250,180],[238,247,176],[234,246,173],[231,245,169],[223,240,163],[217,237,157],[211,235,150],[205,233,146],[200,230,142],[195,227,136],[189,224,132],[184,222,126],[180,220,123],[174,217,119],[169,214,114],[163,212,108],[160,210,105],[154,207,101],[148,204,96],[143,201,93],[138,199,88],[134,197,84],[130,194,81],[126,191,77],[117,189,70],[115,186,68],[112,184,64],[106,181,60],[100,179,55],[94,176,49],[92,174,47],[90,173,45],[81,168,37],[75,166,33],[71,163,28],[66,160,24],[62,158,21],[56,156,14],[51,153,0],[51,153,0],[51,153,0],[50,150,0],[50,150,0],[50,150,0],[50,150,0],[49,148,0],[49,148,0],[49,148,0],[48,145,0],[48,145,0],[48,145,0],[48,145,0],[48,143,0],[48,143,0],[48,143,0],[48,143,0],[47,140,0],[47,140,0],[47,140,0],[47,140,0],[46,138,0],[46,138,0],[46,138,0],[46,138,0],[45,135,0],[45,135,0],[45,135,0],[45,135,0],[44,133,0],[44,133,0],[44,133,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[42,128,0],[42,128,0],[42,128,0],[42,125,0],[42,125,0],[42,125,0],[42,125,0],[41,122,0],[41,122,0],[41,122,0],[41,122,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[39,117,0],[39,117,0],[39,117,0],[39,117,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0]];function Re(i,t){const e=[],s=[];for(let r=0;r[s,...e]),t):null}let Z=class extends G{constructor(){super(...arguments),this.functionName="Colormap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"colormap-function: source data must be single band"};let{colormap:e,colormapName:s,colorRamp:o,colorRampName:r}=this.functionArguments;if(!(e!=null&&e.length))if(o)e=je(o,{interpolateAlpha:!0});else if(r){const u=_s(r);u&&(e=je(u))}else s&&(e=vr(s));if(!(e!=null&&e.length))return{success:!1,supportsGPU:!1,error:"colormap-function: missing colormap argument"};const a=this._getOutputPixelType(t.pixelType);this.outputPixelType=a.startsWith("f")?"s32":a;const n=t.clone();return n.pixelType=this.outputPixelType,n.colormap=e,n.bandCount=1,this.rasterInfo=n,{success:!0,supportsGPU:!0}}_processPixels(t){var s;let e=(s=t.pixelBlocks)==null?void 0:s[0];return!e||nt(e.pixelType)||(e=e.clone(),e.clamp(this.outputPixelType)),e}};c([m({json:{write:!0,name:"rasterFunction"}})],Z.prototype,"functionName",void 0),c([m({type:pr,json:{write:!0,name:"rasterFunctionArguments"}})],Z.prototype,"functionArguments",void 0),c([m()],Z.prototype,"rasterArgumentNames",void 0),c([m()],Z.prototype,"isNoopProcess",void 0),c([m({json:{write:!0}})],Z.prototype,"indexedColormap",void 0),Z=c([A("esri.layers.support.rasterFunctions.ColormapFunction")],Z);const wr=Z;var ne;let Dt=ne=class extends D{constructor(){super(...arguments),this.rasters=[]}writeRasters(i,t){t.rasters=i.map(e=>typeof e=="number"||typeof e=="string"?e:e.toJSON())}clone(){return new ne({rasters:L(this.rasters)})}};c([m({json:{write:!0}})],Dt.prototype,"rasters",void 0),c([_t("rasters")],Dt.prototype,"writeRasters",null),Dt=ne=c([A("esri.layers.support.rasterFunctions.CompositeBandFunctionArguments")],Dt);const br=Dt;let Tt=class extends G{constructor(){super(...arguments),this.functionName="CompositeBand",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const s=e.clone();if(s.attributeTable=null,s.colormap=null,s.pixelType=this.outputPixelType,s.bandCount=t.map(({bandCount:r})=>r).reduce((r,a)=>r+a),t.every(({statistics:r})=>r!=null&&r.length)){const r=[];t.forEach(({statistics:a})=>a!=null&&r.push(...a)),s.statistics=r}if(t.every(({histograms:r})=>r!=null&&r.length)){const r=[];t.forEach(({histograms:a})=>a!=null&&r.push(...a)),s.histograms=r}s.bandCount>1&&(s.colormap=null,s.attributeTable=null);const o=t.every(r=>{var a;return(a=r.keyProperties.BandProperties)==null?void 0:a.length})?t.flatMap(r=>r.keyProperties.BandProperties):void 0;return s.keyProperties={...s.keyProperties,BandProperties:o},this.rasterInfo=s,{success:!0,supportsGPU:s.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;return e?(e==null?void 0:e[0])==null?null:Ts(e):null}_getWebGLParameters(){return{bandCount:this.rasterInfo.bandCount}}};c([m({json:{write:!0,name:"rasterFunction"}})],Tt.prototype,"functionName",void 0),c([m({type:br,json:{write:!0,name:"rasterFunctionArguments"}})],Tt.prototype,"functionArguments",void 0),c([m()],Tt.prototype,"rasterArgumentNames",void 0),Tt=c([A("esri.layers.support.rasterFunctions.CompositeBandFunction")],Tt);const Ar=Tt;var re;let Gt=re=class extends D{constructor(){super(...arguments),this.contrastOffset=0,this.brightnessOffset=0}clone(){return new re({contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset,raster:this.raster})}};c([m({json:{write:!0}})],Gt.prototype,"contrastOffset",void 0),c([m({json:{write:!0}})],Gt.prototype,"brightnessOffset",void 0),Gt=re=c([A("esri.layers.support.rasterFunctions.ContrastBrightnessFunctionArguments")],Gt);const Tr=Gt;let it=class extends G{constructor(){super(...arguments),this.functionName="ContrastBrightness",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];if(e.pixelType!=="u8")return{success:!1,supportsGPU:!1,error:"Only unsigned 8 bit raster is supported by ContrastBrightness function."};this.outputPixelType=this._getOutputPixelType("u8");const s=e.clone();this._removeStatsHistColormapVAT(s),this.rasterInfo=s;const{contrastOffset:o,brightnessOffset:r}=this.functionArguments;return this.lookup=Bs(o,r),{success:!0,supportsGPU:!0}}_processPixels(t){var s;const e=(s=t.pixelBlocks)==null?void 0:s[0];return e==null?null:Fe(e,{lut:e.pixels.map(()=>this.lookup),offset:0,outputPixelType:"u8"})}_getWebGLParameters(){const{contrastOffset:t,brightnessOffset:e}=this.functionArguments;return{contrastOffset:t,brightnessOffset:e}}};c([m({json:{write:!0,name:"rasterFunction"}})],it.prototype,"functionName",void 0),c([m({type:Tr,json:{write:!0,name:"rasterFunctionArguments"}})],it.prototype,"functionArguments",void 0),c([m()],it.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],it.prototype,"lookup",void 0),it=c([A("esri.layers.support.rasterFunctions.ContrastBrightnessFunction")],it);const Pr=it;function ke(i,t,e,s,o){const r=Math.floor(s/2);for(let n=0;no+r);return e===-1||s===0||s===1?t:t.map(o=>o/s)}_bindSourceRasters(){const{convolutionType:t,rows:e,cols:s,kernel:o}=this.functionArguments;if(!Object.values($).includes(t))return{success:!1,supportsGPU:!1,error:`convolution-function: the specified kernel type is not supported ${t}`};if(t!==$.none&&e*s!==o.length)return{success:!1,supportsGPU:!1,error:"convolution-function: the specified rows and cols do not match the length of the kernel"};const r=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(r.pixelType);const a=r.clone();a.pixelType=this.outputPixelType;const n=[$.none,$.sharpen,$.sharpen2,$.sharpening3x3,$.sharpening5x5];return(t===-1||this.outputPixelType!=="u8"&&!n.includes(t))&&(a.statistics=null,a.histograms=null),a.colormap=null,a.attributeTable=null,this.rasterInfo=a,{success:!0,supportsGPU:o.length<=Qe}}_processPixels(t){var a;const e=(a=t.pixelBlocks)==null?void 0:a[0];if(e==null||this.functionArguments.convolutionType===$.none)return e;const{rows:s,cols:o}=this.functionArguments,{_normalizedKernel:r}=this;return Rr(e,{kernel:r,rows:s,cols:o,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const t=new Float32Array(Qe);return t.set(this._normalizedKernel),{kernelRows:this.functionArguments.rows,kernelCols:this.functionArguments.cols,kernel:t,clampRange:vt(this.outputPixelType)}}};c([m({json:{write:!0,name:"rasterFunction"}})],ut.prototype,"functionName",void 0),c([m({type:kr,json:{write:!0,name:"rasterFunctionArguments"}})],ut.prototype,"functionArguments",void 0),c([m()],ut.prototype,"rasterArgumentNames",void 0),c([m()],ut.prototype,"_normalizedKernel",null),ut=c([A("esri.layers.support.rasterFunctions.ConvolutionFunction")],ut);const Cr=ut;var ie;const ms=new jt({0:"standard",1:"platform",2:"profile"},{useNumericKeys:!0});let Pt=ie=class extends D{constructor(){super(...arguments),this.curvatureType="standard",this.zFactor=1}readCurvatureType(i,t){return ms.fromJSON(t.type??t.curvatureType??0)}clone(){return new ie({curvatureType:this.curvatureType,zFactor:this.zFactor,raster:this.raster})}};c([m({json:{write:{target:"type"}}}),Y(ms)],Pt.prototype,"curvatureType",void 0),c([Ct("curvatureType",["type","curvatureType"])],Pt.prototype,"readCurvatureType",null),c([m({type:Number,json:{write:!0}})],Pt.prototype,"zFactor",void 0),Pt=ie=c([A("esri.layers.support.rasterFunctions.CurvatureFunctionArguments")],Pt);const _r=Pt;let lt=class extends G{constructor(){super(...arguments),this.functionName="Curvature",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){var e;this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0].clone();return t.pixelType=this.outputPixelType,t.bandCount=1,this._removeStatsHistColormapVAT(t),this.rasterInfo=t,this.isGCS=((e=t.spatialReference)==null?void 0:e.isGeographic)??!1,{success:!0,supportsGPU:!0}}_processPixels(t){var p;const e=(p=t.pixelBlocks)==null?void 0:p[0];if(e==null)return null;const{zFactor:s,curvatureType:o}=this.functionArguments,{extent:r,primaryPixelSizes:a}=t,n=a==null?void 0:a[0],u=n??(r?{x:r.width/e.width,y:r.height/e.height}:{x:1,y:1}),l=this.isGCS&&s>=1?s*Kt:s;return js(e,{zFactor:l,curvatureType:o,resolution:u})}_getWebGLParameters(){const{zFactor:t,curvatureType:e}=this.functionArguments;return{curvatureType:e,zFactor:this.isGCS&&t>=1?t*Kt:t}}};c([m({json:{write:!0,name:"rasterFunction"}})],lt.prototype,"functionName",void 0),c([m({type:_r,json:{write:!0,name:"rasterFunctionArguments"}})],lt.prototype,"functionArguments",void 0),c([m()],lt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],lt.prototype,"isGCS",void 0),lt=c([A("esri.layers.support.rasterFunctions.CurvatureFunction")],lt);const Br=lt;var ae;let J=ae=class extends D{constructor(){super(...arguments),this.bandIds=[],this.bandNames=[],this.bandWavelengths=[],this.missingBandAction=os.bestMatch}clone(){var i,t,e;return new ae({bandIds:(i=this.bandIds)==null?void 0:i.slice(),bandNames:(t=this.bandNames)==null?void 0:t.slice(),bandWavelengths:(e=this.bandWavelengths)==null?void 0:e.slice(),missingBandAction:this.missingBandAction,method:this.method,wavelengthMatchTolerance:this.wavelengthMatchTolerance})}};c([m({json:{write:!0}})],J.prototype,"bandIds",void 0),c([m({json:{write:!0}})],J.prototype,"bandNames",void 0),c([m({json:{write:!0}})],J.prototype,"bandWavelengths",void 0),c([Y({0:"name",1:"wavelength",2:"id"})],J.prototype,"method",void 0),c([m({json:{write:!0}})],J.prototype,"missingBandAction",void 0),c([m({json:{write:!0}})],J.prototype,"wavelengthMatchTolerance",void 0),J=ae=c([A("esri.layers.support.rasterFunctions.ExtractBandFunctionArguments")],J);const jr=J;let $t=class extends G{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){var b;const{functionArguments:t,sourceRasterInfos:e}=this,s=e[0],{method:o,bandNames:r,bandWavelengths:a,bandIds:n,missingBandAction:u}=t,l=(r==null?void 0:r.length)&&(o==="name"||o!=="id"&&!(n!=null&&n.length)),p=(a==null?void 0:a.length)&&(o==="wavelength"||o!=="id"&&!(n!=null&&n.length)),h=u===os.fail,f=l?this._matchBandNames(s,r):p?this._matchBandWavelengths(s,a,h):this._matchBandIds(s,n,h);if(f==null)return{success:!1,supportsGPU:!1,error:`extract-band-function: Invalid ${l?"band names":p?"band wavelengths":"band ids"} for the imagery data source`};this.functionArguments.bandIds=f,this.functionArguments.method="id",this.outputPixelType=this._getOutputPixelType("f32");const g=s.clone();g.pixelType=this.outputPixelType,g.bandCount=f.length;const{statistics:x,histograms:y}=g;x!=null&&x.length&&(g.statistics=f.map(v=>x[v]||x[x.length-1])),y!=null&&y.length&&(g.histograms=f.map(v=>y[v]||y[y.length-1]));let d=(b=g.keyProperties)==null?void 0:b.BandProperties;return d!=null&&d.length&&(d=f.map(v=>v>=d.length?d[d.length-1]:d[v]),g.keyProperties={...g.keyProperties,BandProperties:d}),this.rasterInfo=g,{success:!0,supportsGPU:g.bandCount<=3}}_processPixels(t){var r;const e=(r=t.pixelBlocks)==null?void 0:r[0];if(e==null)return null;const s=e.pixels.length,o=this.functionArguments.bandIds.map(a=>a>=s?s-1:a);return e.extractBands(o)}_getWebGLParameters(){let t;if(this.isInputBandIdsSwizzled)t=this.swizzledBandSelection.length?this.swizzledBandSelection:[0,1,2];else{t=[...this.functionArguments.bandIds],t.length===0?t=[0,1,2]:t.length<3&&(t[1]=t[1]??t[0],t[2]=t[2]??t[1]);for(let e=0;e<3;e++)t[e]=Math.min(t[e],2)}return{bandIndexMat3:z(t)}}_getInputBandIds(t){const e=t.length;return this.functionArguments.bandIds.map(s=>s>=e?e-1:s).map(s=>t[s])}_matchBandNames(t,e){const s=t.bandInfos.map(({name:r})=>r.toLowerCase()),o=[];for(let r=0;ru.startsWith("nearinfrared_1")),n===-1&&(n=s.findIndex(u=>u.startsWith("nearinfrared")))),n===-1)return null;o.push(n)}return o}_matchBandIds(t,e,s){const{bandCount:o}=t;return!(e!=null&&e.length)||s&&e.some(r=>r<0||r>=o)?null:e}_matchBandWavelengths(t,e,s){const{bandInfos:o}=t,r=[];for(let u=0;u=x.minWavelength&&l<=x.maxWavelength,d=Math.abs(l-(x.minWavelength+x.maxWavelength)/2);y?dx?x:Ns+o);return t.map(s=>s/e)}_bindSourceRasters(){const{conversionParameters:t}=this.functionArguments;if(!(t!=null&&t.length))return{success:!1,supportsGPU:!1,error:"missing valid conversion parameters."};const e=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType;const s=t.length===3||e.bandCount===3&&t.length>3;return e.bandCount=1,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,{success:!0,supportsGPU:s}}_processPixels(t){var s;const e=(s=t.pixelBlocks)==null?void 0:s[0];return e==null?null:Mr(e,this._normalizedWeights,this.outputPixelType)}_getWebGLParameters(){return{weights:this._normalizedWeights}}};c([m({json:{write:!0,name:"rasterFunction"}})],ct.prototype,"functionName",void 0),c([m({type:Or,json:{write:!0,name:"rasterFunctionArguments"}})],ct.prototype,"functionArguments",void 0),c([m()],ct.prototype,"rasterArgumentNames",void 0),c([m()],ct.prototype,"_normalizedWeights",null),ct=c([A("esri.layers.support.rasterFunctions.GrayscaleFunction")],ct);const Dr=ct;var le;let pt=le=class extends D{constructor(){super(...arguments),this.rasters=[],this.processAsMultiband=!0}writeRasters(i,t){t.rasters=i.map(e=>typeof e=="number"||typeof e=="string"?e:e.toJSON())}clone(){return new le({operation:this.operation,processAsMultiband:this.processAsMultiband,rasters:L(this.rasters)})}};c([m({json:{write:!0}})],pt.prototype,"operation",void 0),c([m({json:{write:!0}})],pt.prototype,"rasters",void 0),c([_t("rasters")],pt.prototype,"writeRasters",null),c([m({json:{write:!0}})],pt.prototype,"processAsMultiband",void 0),pt=le=c([A("esri.layers.support.rasterFunctions.LocalFunctionArguments")],pt);const Gr=pt;let Ft=class extends G{constructor(){super(...arguments),this.functionName="Local",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0],{bandCount:s}=e,{processAsMultiband:o}=this.functionArguments;if(t.some(l=>l.bandCount!==s))return{success:!1,supportsGPU:!1,error:"local-function: input rasters do not have same band count"};const{operation:r,rasters:a}=this.functionArguments,n=Oe[r];if(!(n===999||a.length===n||a.length<=1&&n===1))return{success:!1,supportsGPU:!1,error:`local-function: the length of functionArguments.rasters does not match operation's requirement: ${n}`};const u=e.clone();return u.bandCount=n!==999||o?s:1,this._removeStatsHistColormapVAT(u),this._updateStatistics(u),this._updatePixelType(u),this.rasterInfo=u,{success:!0,supportsGPU:u.bandCount===1&&n<=3&&(r<11||r>16)}}_processPixels(t){const{pixelBlocks:e}=t;return e==null||e.some(s=>s==null)?null:hs(e,this.functionArguments.operation,{processAsMultiband:this.functionArguments.processAsMultiband,outputPixelType:this.outputPixelType??void 0})}_getWebGLParameters(){var u;const{operation:t}=this.functionArguments,e=Oe[t],s=((u=Object.keys(Se).find(l=>Se[l]===t))==null?void 0:u.toLowerCase())??"undefined",o=this.outputPixelType??"f32";let[r,a]=vt(o);const n=nt(o);return n&&(r-=1e-4,a+=1e-4),{imageCount:e,operationName:s,domainRange:[r,a],isOutputRounded:n}}_updateStatistics(t){var r,a;const e=this.sourceRasterInfos[0],{operation:s}=this.functionArguments,o=(r=Me(s))==null?void 0:r.domain;if(o){t.statistics=[];for(let n=0;n({min:-n.max,max:-n.min,avg:n.avg!=null?-n.avg:void 0,stddev:n.stddev!=null?-n.stddev:void 0})))}_updatePixelType(t){const{statistics:e,pixelType:s}=this.sourceRasterInfos[0],{operation:o}=this.functionArguments,{domain:r,isInteger:a}=Me(o)??{domain:null,isInteger:!1};let n="f32";if(r&&a)n=Xt(r[0],r[1]);else if(o===30){const u=e==null?void 0:e[0];n=u?Xt(u.min,u.max):nt(s)?s:"s32"}else if(o===45&&nt(s)){const u=e==null?void 0:e.map(({max:f})=>-f),l=e==null?void 0:e.map(({min:f})=>-f),p=u!=null&&u.length?Math.min(...u):null,h=l!=null&&l.length?Math.min(...l):null;n=p!=null&&h!=null?Xt(p,h):s.startsWith("s")?s.replace("s","u"):s==="u1"||s==="u2"||s==="u4"?"s8":s==="u8"?"s16":"s32"}t.pixelType=this.outputPixelType=this._getOutputPixelType(n)}};c([m({json:{write:!0,name:"rasterFunction"}})],Ft.prototype,"functionName",void 0),c([m({type:Gr,json:{write:!0,name:"rasterFunctionArguments"}})],Ft.prototype,"functionArguments",void 0),c([m()],Ft.prototype,"rasterArgumentNames",void 0),Ft=c([A("esri.layers.support.rasterFunctions.LocalFunction")],Ft);const Er=Ft;var ce;let ht=ce=class extends D{constructor(){super(...arguments),this.includedRanges=null,this.noDataValues=null,this.noDataInterpretation=is.matchAny}get normalizedNoDataValues(){const{noDataValues:i}=this;if(!(i!=null&&i.length))return null;let t=!1;const e=i.map(s=>{if(typeof s=="number")return t=!0,[s];if(typeof s=="string"){const o=s.trim().split(" ").filter(r=>r.trim()!=="").map(r=>Number(r));return t=t||o.length>0,o.length===0?null:o}return null});return t?e:null}clone(){var i,t;return new ce({includedRanges:((i=this.includedRanges)==null?void 0:i.slice())??[],noDataValues:((t=this.noDataValues)==null?void 0:t.slice())??[],noDataInterpretation:this.noDataInterpretation})}};c([m({json:{write:!0}})],ht.prototype,"includedRanges",void 0),c([m({json:{write:!0}})],ht.prototype,"noDataValues",void 0),c([m()],ht.prototype,"normalizedNoDataValues",null),c([m({json:{write:!0}})],ht.prototype,"noDataInterpretation",void 0),ht=ce=c([A("esri.layers.support.rasterFunctions.MaskFunctionArguments")],ht);const zr=ht;let mt=class extends G{constructor(){super(...arguments),this.functionName="Mask",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,this.rasterInfo=t;const{includedRanges:s,normalizedNoDataValues:o}=this.functionArguments;if(!(s!=null&&s.length)&&!(o!=null&&o.length))return{success:!1,supportsGPU:!1,error:"missing includedRanges or noDataValues argument"};let r=[];for(let n=0;n{var u;return(n==null?void 0:n.length)===((u=o[0])==null?void 0:u.length)});return{success:!0,supportsGPU:(!s||s.length<=2*K)&&(!o||a&&o[0].length<=K)}}_processPixels(t){var l;const e=(l=t.pixelBlocks)==null?void 0:l[0];if(e==null)return null;const{outputPixelType:s,lookups:o}=this,{includedRanges:r,noDataInterpretation:a,normalizedNoDataValues:n}=this.functionArguments,u=a===is.matchAll;return $s(e,{includedRanges:r,noDataValues:n,outputPixelType:s,matchAll:u,lookups:o})}_getWebGLParameters(){var r;const{includedRanges:t,normalizedNoDataValues:e}=this.functionArguments,s=new Float32Array(K);s.fill(kt),(r=e==null?void 0:e[0])!=null&&r.length&&s.set(e[0]);const o=new Float32Array(K);for(let a=0;a=o.bandCount)return{success:!1,supportsGPU:!1,error:"ndvi-function: source raster has insufficient amount of raster bands"};const a=o.clone();a.pixelType=this.outputPixelType,a.colormap=null,a.histograms=null,a.bandCount=1,a.keyProperties={...a.keyProperties,BandProperties:void 0};const[n,u,l,p]=t?[-1,1,0,.1]:[0,200,100,10];return a.statistics=[{min:n,max:u,avg:l,stddev:p}],this.rasterInfo=a,{success:!0,supportsGPU:!0}}_processPixels(t){var a;const e=(a=t.pixelBlocks)==null?void 0:a[0];if(e==null)return null;const{visibleBandID:s,infraredBandID:o,scientificOutput:r}=this.functionArguments;return Ln(e,s,o,!r)}_getWebGLParameters(){const{visibleBandID:t,infraredBandID:e,scientificOutput:s}=this.functionArguments,o=this.isInputBandIdsSwizzled?[0,1,2]:[e,t,0];return{bandIndexMat3:z(o),scaled:!s}}_getInputBandIds(t){const{visibleBandID:e,infraredBandID:s}=this.functionArguments;return[s,e,0].map(o=>t[o])}};c([m({json:{write:!0,name:"rasterFunction"}})],It.prototype,"functionName",void 0),c([m({type:Ur,json:{write:!0,name:"rasterFunctionArguments"}})],It.prototype,"functionArguments",void 0),c([m()],It.prototype,"rasterArgumentNames",void 0),It=c([A("esri.layers.support.rasterFunctions.NDVIFunction")],It);const Lr=It;var he;let Q=he=class extends D{constructor(){super(...arguments),this.inputRanges=null,this.outputValues=null,this.noDataRanges=null,this.allowUnmatched=!1,this.isLastInputRangeInclusive=!1}clone(){return new he({inputRanges:[...this.inputRanges],outputValues:[...this.outputValues],noDataRanges:[...this.noDataRanges],allowUnmatched:this.allowUnmatched,isLastInputRangeInclusive:this.isLastInputRangeInclusive})}};c([m({json:{write:!0}})],Q.prototype,"inputRanges",void 0),c([m({json:{write:!0}})],Q.prototype,"outputValues",void 0),c([m({json:{write:!0}})],Q.prototype,"noDataRanges",void 0),c([m({json:{write:!0}})],Q.prototype,"allowUnmatched",void 0),c([m({json:{write:!0}})],Q.prototype,"isLastInputRangeInclusive",void 0),Q=he=c([A("esri.layers.support.rasterFunctions.RemapFunctionArguments")],Q);const Wr=Q;let ft=class extends G{constructor(){super(...arguments),this.functionName="Remap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,t.colormap=null,t.histograms=null,t.bandCount=1,t.attributeTable=null;const{statistics:s}=t,{allowUnmatched:o,outputValues:r,inputRanges:a,noDataRanges:n,isLastInputRangeInclusive:u}=this.functionArguments;if(s!=null&&s.length&&(r!=null&&r.length))if(o){const l=Math.min.apply(null,[...r,s[0].min]),p=Math.max.apply(null,[...r,s[0].max]);t.statistics=[{...s[0],min:l,max:p}]}else{let l=r[0],p=l;for(let h=0;hr[h]?r[h]:l,p=p>r[h]?p:r[h];t.statistics=[{...s[0],min:l,max:p}]}return this.rasterInfo=t,this.lookup=o?null:Fs({srcPixelType:e,inputRanges:a,outputValues:r,noDataRanges:n,allowUnmatched:o,isLastInputRangeInclusive:u,outputPixelType:this.outputPixelType}),{success:!0,supportsGPU:(!r||r.length<=K)&&(!n||n.length<=K)}}_processPixels(t){var p;const e=(p=t.pixelBlocks)==null?void 0:p[0];if(e==null)return null;const{lookup:s,outputPixelType:o}=this;if(s){const h=Fe(e,{lut:[s.lut],offset:s.offset,outputPixelType:o});return h!=null&&s.mask&&(h.mask=Ns(e.pixels[0],e.mask,s.mask,s.offset,"u8")),h}const{inputRanges:r,outputValues:a,noDataRanges:n,allowUnmatched:u,isLastInputRangeInclusive:l}=this.functionArguments;return Is(e,{inputRanges:r,outputValues:a,noDataRanges:n,outputPixelType:o,allowUnmatched:u,isLastInputRangeInclusive:l})}_getWebGLParameters(){const{allowUnmatched:t,noDataRanges:e,isLastInputRangeInclusive:s}=this.functionArguments,o=new Float32Array(3*K),r=1e-5,a=this.functionArguments.inputRanges??[],n=this.functionArguments.outputValues??[],u=n.length;for(let p=0;p0&&(o[3*p]-=r),(p=1?t*Kt:t,slopeType:e,pixelSizeFactor:s??0,pixelSizePower:o??0}}};c([m({json:{write:!0,name:"rasterFunction"}})],dt.prototype,"functionName",void 0),c([m({type:Xr,json:{write:!0,name:"rasterFunctionArguments"}})],dt.prototype,"functionArguments",void 0),c([m()],dt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],dt.prototype,"isGCS",void 0),dt=c([A("esri.layers.support.rasterFunctions.SlopeFunction")],dt);const Jr=dt,ts=new jt({1:"min",2:"max",3:"mean",4:"stddev",5:"median",6:"majority",7:"minority"},{useNumericKeys:!0});function Kr(i,t){const{fillNoDataOnly:e}=t,{band:s,width:o,height:r,mask:a,outBand:n}=i;if(e&&!a)return void n.set(s);const{statisticsType:u,kernelRows:l,kernelCols:p}=t,h=u==="stddev",f=o*r,g=new Float64Array(f),x=new Float64Array(f),y=new Uint32Array(f);for(let F=0;Fv-R),a?(f[y+d]=b[Math.floor((b.length-1)/2)],g[y+d]=b.length):n[y+d]=b[Math.floor((b.length-1)/2)])}}if(a)for(let x=p;xF&&(F=E,N=P);a?(x[b+v]=N,y[b+v]=R.size):n[b+v]=N}}if(a)for(let d=p;d1&&(n!=null&&n.length)&&(v=w.combineBandMasks(n));const R=new w({pixelType:d,width:r,height:a,pixels:h,bandMasks:n&&b.length?b:null,mask:v});return R.updateStatistics(),R}var fe;let gt=fe=class extends D{constructor(){super(...arguments),this.rows=3,this.cols=3,this.fillNoDataOnly=!1,this.statisticsType="min"}clone(){return new fe({rows:this.rows,cols:this.cols,fillNoDataOnly:this.fillNoDataOnly,statisticsType:this.statisticsType,raster:L(this.raster)})}};c([m({json:{write:!0,read:{source:["kernelRows","rows"],reader:(i,t)=>Number(i??(t==null?void 0:t.kernelRows)??3)}}})],gt.prototype,"rows",void 0),c([m({json:{write:!0,read:{source:["kernelCols","cols"],reader:(i,t)=>Number(i??(t==null?void 0:t.kernelCols)??3)}}})],gt.prototype,"cols",void 0),c([m({json:{write:!0}})],gt.prototype,"fillNoDataOnly",void 0),c([m({json:{read:{source:["statisticsType","type"],reader:(i,t)=>ts.fromJSON((t==null?void 0:t.statisticsType)??(t==null?void 0:t.type))??"min"},write:{target:"type"}}}),Y(ts)],gt.prototype,"statisticsType",void 0),gt=fe=c([A("esri.layers.support.rasterFunctions.StatisticsFunctionArguments")],gt);const eo=gt;let Rt=class extends G{constructor(){super(...arguments),this.functionName="Statistics",this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{type:t}=this.functionArguments.toJSON();if(t<1||t>7)return{success:!1,supportsGPU:!1,error:`statistics-function: the given statistics type is not supported ${t}`};const e=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const s=e.clone();s.pixelType=this.outputPixelType;const{statisticsType:o}=this.functionArguments;return o==="stddev"&&this._removeStatsHistColormapVAT(s),this.rasterInfo=s,{success:!0,supportsGPU:s.bandCount<=3&&t<5}}_processPixels(t){var n;const e=(n=t.pixelBlocks)==null?void 0:n[0];if(e==null)return e;const{statisticsType:s,rows:o,cols:r,fillNoDataOnly:a}=this.functionArguments;return to(e,{kernelRows:o,kernelCols:r,fillNoDataOnly:a,outputPixelType:this.outputPixelType,statisticsType:s,mirrorEdges:!0})}_getWebGLParameters(){const{rows:t,cols:e,statisticsType:s,fillNoDataOnly:o}=this.functionArguments;return{fillNoDataOnly:o,kernelRows:t,kernelCols:e,statisticsType:s,clampRange:vt(this.outputPixelType)}}};c([m({json:{write:!0,name:"rasterFunction"}})],Rt.prototype,"functionName",void 0),c([m({type:eo,json:{write:!0,name:"rasterFunctionArguments"}})],Rt.prototype,"functionArguments",void 0),c([m()],Rt.prototype,"rasterArgumentNames",void 0),Rt=c([A("esri.layers.support.rasterFunctions.StatisticsFunction")],Rt);const so=Rt;var de;let yt=de=class extends D{constructor(){super(...arguments),this.statistics=null,this.histograms=null}readStatistics(i,t){if(!(i!=null&&i.length))return null;const e=[];return i.forEach(s=>{const o={min:s.min,max:s.max,avg:s.avg??s.mean,stddev:s.stddev??s.standardDeviation};e.push(o)}),e}writeStatistics(i,t,e){if(!(i!=null&&i.length))return;const s=[];i.forEach(o=>{const r={...o,mean:o.avg,standardDeviation:o.stddev};delete r.avg,delete r.stddev,s.push(r)}),t[e]=s}clone(){return new de({statistics:L(this.statistics),histograms:L(this.histograms)})}};c([m({json:{write:!0}})],yt.prototype,"statistics",void 0),c([Ct("statistics")],yt.prototype,"readStatistics",null),c([_t("statistics")],yt.prototype,"writeStatistics",null),c([m({json:{write:!0}})],yt.prototype,"histograms",void 0),yt=de=c([A("esri.layers.support.rasterFunctions.StatisticsHistogramFunctionArguments")],yt);const no=yt;let et=class extends G{constructor(){super(...arguments),this.functionName="StatisticsHistogram",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType("u8");const e=t.clone(),{statistics:s,histograms:o}=this.functionArguments;return o&&(e.histograms=o),s&&(e.statistics=s),this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){var e;return(e=t.pixelBlocks)==null?void 0:e[0]}};c([m({json:{write:!0,name:"rasterFunction"}})],et.prototype,"functionName",void 0),c([m({type:no,json:{write:!0,name:"rasterFunctionArguments"}})],et.prototype,"functionArguments",void 0),c([m()],et.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],et.prototype,"indexedColormap",void 0),c([m()],et.prototype,"isNoopProcess",void 0),et=c([A("esri.layers.support.rasterFunctions.StatisticsHistogramFunction")],et);const ro=et;var ge;const oo=new jt({0:"none",3:"standard-deviation",4:"histogram-equalization",5:"min-max",6:"percent-clip",9:"sigmoid"},{useNumericKeys:!0});let V=ge=class extends D{constructor(){super(...arguments),this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.histograms=null,this.statistics=null,this.stretchType="none",this.useGamma=!1}writeStatistics(i,t,e){i!=null&&i.length&&(Array.isArray(i[0])||(i=i.map(s=>[s.min,s.max,s.avg,s.stddev])),t[e]=i)}clone(){return new ge({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:L(this.statistics),gamma:L(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,histograms:L(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment,raster:this.raster})}};c([m({type:Boolean,json:{write:!0}})],V.prototype,"computeGamma",void 0),c([m({type:Boolean,json:{name:"dra",write:!0}})],V.prototype,"dynamicRangeAdjustment",void 0),c([m({type:[Number],json:{write:!0}})],V.prototype,"gamma",void 0),c([m()],V.prototype,"histograms",void 0),c([m({type:Number,json:{write:!0}})],V.prototype,"maxPercent",void 0),c([m({type:Number,json:{write:!0}})],V.prototype,"minPercent",void 0),c([m({type:Number,json:{write:!0}})],V.prototype,"numberOfStandardDeviations",void 0),c([m({type:Number,json:{name:"max",write:!0}})],V.prototype,"outputMax",void 0),c([m({type:Number,json:{name:"min",write:!0}})],V.prototype,"outputMin",void 0),c([m({type:Number,json:{write:!0}})],V.prototype,"sigmoidStrengthLevel",void 0),c([m({json:{type:[[Number]],write:!0}})],V.prototype,"statistics",void 0),c([_t("statistics")],V.prototype,"writeStatistics",null),c([Y(oo)],V.prototype,"stretchType",void 0),c([m({type:Boolean,json:{write:!0}})],V.prototype,"useGamma",void 0),V=ge=c([A("esri.layers.support.rasterFunctions.StretchFunctionArguments")],V);const io=V;let st=class extends G{constructor(){super(...arguments),this.functionName="Stretch",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null,this.cutOffs=null}_bindSourceRasters(){this.lookup=null,this.cutOffs=null;const t=this.sourceRasterInfos[0],{pixelType:e}=t,{functionArguments:s}=this,{dynamicRangeAdjustment:o,gamma:r,useGamma:a}=s;if(!o&&["u8","u16","s8","s16"].includes(e)){const u=Jt(s.toJSON(),{rasterInfo:t}),l=nt(this.outputPixelType)?"round":"float";this.lookup=Ms({pixelType:e,...u,gamma:a?r:null,rounding:l}),this.cutOffs=u}else o||(this.cutOffs=Jt(s.toJSON(),{rasterInfo:t}));this.outputPixelType=this._getOutputPixelType(e);const n=t.clone();return n.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(n),this.outputPixelType==="u8"&&(n.keyProperties.DataType="processed"),this.rasterInfo=n,{success:!0,supportsGPU:!o}}_processPixels(t){var n;const e=(n=t.pixelBlocks)==null?void 0:n[0];if(e==null)return e;const{lookup:s}=this;if(s)return Fe(e,{...s,outputPixelType:this.rasterInfo.pixelType});const{functionArguments:o}=this,r=this.cutOffs||Jt(o.toJSON(),{rasterInfo:this.sourceRasterInfos[0],pixelBlock:e}),a=o.useGamma?o.gamma:null;return Os(e,{...r,gamma:a,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const{outputMin:t=0,outputMax:e=255,gamma:s,useGamma:o}=this.functionArguments,r=this.rasterInfo.bandCount>=2?3:1,a=o&&(s!=null&&s.length)?Ds(r,s):[1,1,1],{minCutOff:n,maxCutOff:u}=this.cutOffs??{minCutOff:[0,0,0],maxCutOff:[255,255,255]};n.length===1&&(n[1]=n[2]=n[0],u[1]=u[2]=u[0]);const l=new Float32Array(r);let p;for(p=0;p1||t.pixelType.startsWith("f"))return{success:!1,supportsGPU:!1,error:"table-function: Source data must be single band and integer pixel type."};const{attributeTableAsRecordSet:e}=this.functionArguments;if(!e)return{success:!1,supportsGPU:!1,error:"table-function: Missing attributeTableAsRecordSet argument."};this.outputPixelType=this._getOutputPixelType(t.pixelType);const s=t.clone();return s.pixelType=this.outputPixelType,s.bandCount=1,s.dataType!=="thematic"&&(s.keyProperties=s.keyProperties?{...s.keyProperties,DataType:"thematic"}:{DataType:"thematic"}),this.rasterInfo=s,{success:!0,supportsGPU:!0}}_processPixels(t){var e;return(e=t.pixelBlocks)==null?void 0:e[0]}};c([m({json:{write:!0,name:"rasterFunction"}})],xt.prototype,"functionName",void 0),c([m({type:uo,json:{write:!0,name:"rasterFunctionArguments"}})],xt.prototype,"functionArguments",void 0),c([m()],xt.prototype,"rasterArgumentNames",void 0),c([m()],xt.prototype,"isNoopProcess",void 0),xt=c([A("esri.layers.support.rasterFunctions.TableFunction")],xt);const lo=xt,M=new Map;function co(i,t){const{rasterFunctionArguments:e}=i;e&&(e.rasters||[e.raster]).forEach(s=>{s&&typeof s!="number"&&(typeof s=="string"?s.startsWith("http")&&(t.includes(s)||t.push(s)):"rasterFunctionArguments"in s&&co(s,t))})}function Xo(i,t){if(t=t??{},"function"in(i=L(i))&&"arguments"in i&&i.arguments){const e=gs(i,new Map,t);if(we(e),!e.renderingRule)throw new Bt("raster-function-helper","Unsupported raster function json.");i=e.renderingRule}if("rasterFunction"in i)return fs(i=xe(i),t);throw new Bt("raster-function-helper","unsupported raster function json.")}function po(i,t){return t[0]==="rasters"&&Array.isArray(i.rasters)?i.rasters:t.map(e=>i[e])}function es(i){return!!(i&&typeof i=="object"&&i.rasterFunction&&i.rasterFunctionArguments)}function xe(i){var o;const{rasterFunction:t,rasterFunctionArguments:e}=i,s={};for(const r in e){let a=e[r];const n=r.toLowerCase();if(n==="rasters"&&Array.isArray(a))s.rasters=a.map(u=>es(u)?xe(u):u);else switch(es(a)&&(a=xe(a)),n){case"dra":s.dra=a;break;case"pspower":s.psPower=a;break;case"pszfactor":s.psZFactor=a;break;case"bandids":s.bandIds=a;break;default:s[r[0].toLowerCase()+r.slice(1)]=a}}return t!=="Local"||(o=s.rasters)!=null&&o.length||(s.rasters=["$$"]),{...i,rasterFunctionArguments:s}}function fs(i,t){var f,g;const{rasterFunction:e,rasterFunctionArguments:s}=i,o=(f=i.outputPixelType)==null?void 0:f.toLowerCase();if(e==null||!M.has(e))throw new Bt("raster-function-helper",`unsupported raster function: ${e}`);const r=M.get(e),a=(typeof r.ctor=="function"?r.ctor:r.ctor.default).fromJSON({...i,outputPixelType:o}),{rasterArgumentNames:n}=a,u=[],l=po(s,n),p=n[0]==="rasters",h=[];for(let x=0;xtypeof r=="object"&&r.type==="RasterFunctionVariable"?ve(r,t):r);if("value"in e&&["number","string","boolean"].includes(typeof e.value))return e.value;if(i.isDataset&&e.type!=="Scalar")return"$$";if(!("type"in e))return e;let s=e;switch(e.type){case"Scalar":s=e.value;break;case"AlgorithmicColorRamp":s=ss(e);break;case"MultiPartColorRamp":s={type:"multipart",colorRamps:e.ArrayOfColorRamp.map(ss)};break;case"ArgumentArray":if((o=e.elements)!=null&&o.length&&e.elements[0].type!=="RasterStatistics"){const r=[];for(let a=0;a{if(typeof n=="object")if(n._object_ref_id!=null){if(!e.has(n._object_ref_id))throw new Bt("raster-function-helper",`unsupported raster function json. _object_ref_id: ${r} does not exist`);const l=e.get(a);l&&typeof l=="object"?Object.assign(n,l):r[u]=l}else we({renderingRule:n,templates:e})}));else{if(!e.has(a))throw new Bt("raster-function-helper",`unsupported raster function json. _object_ref_id: ${a} does not exist`);const n=e.get(a);o!=="_object_ref_id"?s[o]=n:n&&typeof n=="object"&&Object.assign(s,n)}}}function ho(i){var t;(t=i.Statistics)!=null&&t.length&&typeof i.Statistics=="object"&&(i.Statistics=i.Statistics.map(e=>[e.min,e.max,e.mean,e.standardDeviation])),i.NumberOfStandardDeviation!=null&&(i.NumberOfStandardDeviations=i.NumberOfStandardDeviation,delete i.NumberOfStandardDeviation)}function mo(i){var t,e;((e=(t=i.ColorRamp)==null?void 0:t.type)==null?void 0:e.toLowerCase())==="randomcolorramp"&&(delete i.ColorRamp,i.ColormapName="Random"),i.ColorSchemeType===0&&delete i.ColorRamp}function fo(i){i.ConvolutionType!=null&&(i.Type=i.ConvolutionType,delete i.ConvolutionType)}function go(i){var t;(t=i.NoDataValues)!=null&&t.length&&typeof i.NoDataValues[0]=="string"&&(i.NoDataValues=i.NoDataValues.filter(e=>e!=="").map(e=>Number(e)))}M.set("Arithmetic",{desc:"Arithmetic Function",ctor:Bn,rasterArgumentNames:["rasters"]}),M.set("Aspect",{desc:"Aspect Function",ctor:Sn,rasterArgumentNames:["raster"]}),M.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:ur,rasterArgumentNames:["raster"]}),M.set("Colormap",{desc:"Colormap Function",ctor:wr,rasterArgumentNames:["raster"]}),M.set("CompositeBand",{desc:"CompositeBand Function",ctor:Ar,rasterArgumentNames:["rasters"]}),M.set("Convolution",{desc:"Convolution Function",ctor:Cr,rasterArgumentNames:["raster"]}),M.set("ContrastBrightness",{desc:"Contrast Brightness Function",ctor:Pr,rasterArgumentNames:["raster"]}),M.set("ExtractBand",{desc:"ExtractBand Function",ctor:Sr,rasterArgumentNames:["raster"]}),M.set("Curvature",{desc:"Curvature Function",ctor:Br,rasterArgumentNames:["raster"]}),M.set("Grayscale",{desc:"Grayscale Function",ctor:Dr,rasterArgumentNames:["raster"]}),M.set("Clip",{desc:"Clip Function",ctor:cr,rasterArgumentNames:["raster"]}),M.set("Local",{desc:"Local Function",ctor:Er,rasterArgumentNames:["rasters"]}),M.set("Mask",{desc:"Mask Function",ctor:Vr,rasterArgumentNames:["raster"]}),M.set("NDVI",{desc:"NDVI Function",ctor:Lr,rasterArgumentNames:["raster"]}),M.set("Remap",{desc:"Remap Function",ctor:qr,rasterArgumentNames:["raster"]}),M.set("Slope",{desc:"Slope Function",ctor:Jr,rasterArgumentNames:["raster"]}),M.set("Statistics",{desc:"Focal Statistics Function",ctor:so,rasterArgumentNames:["raster"]}),M.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:ro,rasterArgumentNames:["raster"]}),M.set("Stretch",{desc:"Stretch Function",ctor:ao,rasterArgumentNames:["raster"]}),M.set("Table",{desc:"Attribute Table Function",ctor:lo,rasterArgumentNames:["raster"]});let Et=class extends $e{get affectsPixelSize(){return!1}forwardTransform(i){return i}inverseTransform(i){return i}};c([m()],Et.prototype,"affectsPixelSize",null),c([m({json:{write:!0}})],Et.prototype,"spatialReference",void 0),Et=c([A("esri.layers.support.rasterTransforms.BaseRasterTransform")],Et);const Ce=Et;var be;let zt=be=class extends Ce{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(i){return(i=i.clone()).type==="point"?(i.x>180+this.tolerance&&(i.x-=360),i):(i.xmin>=180-this.tolerance?(i.xmax-=360,i.xmin-=360):i.xmax>180+this.tolerance&&(i.xmin=-180,i.xmax=180),i)}inverseTransform(i){return(i=i.clone()).type==="point"?(i.x<-this.tolerance&&(i.x+=360),i):(i.xmin<-this.tolerance&&(i.xmin+=360,i.xmax+=360),i)}clone(){return new be({tolerance:this.tolerance})}};c([Y({GCSShiftXform:"gcs-shift"})],zt.prototype,"type",void 0),c([m()],zt.prototype,"tolerance",void 0),zt=be=c([A("esri.layers.support.rasterTransforms.GCSShiftTransform")],zt);const yo=zt;var Ae;let qt=Ae=class extends Ce{constructor(){super(...arguments),this.type="identity"}clone(){return new Ae}};c([Y({IdentityXform:"identity"})],qt.prototype,"type",void 0),qt=Ae=c([A("esri.layers.support.rasterTransforms.IdentityTransform")],qt);const xo=qt;var Te;function Pe(i,t,e){const{x:s,y:o}=t;if(e<2)return{x:i[0]+s*i[2]+o*i[4],y:i[1]+s*i[3]+o*i[5]};if(e===2){const f=s*s,g=o*o,x=s*o;return{x:i[0]+s*i[2]+o*i[4]+f*i[6]+x*i[8]+g*i[10],y:i[1]+s*i[3]+o*i[5]+f*i[7]+x*i[9]+g*i[11]}}const r=s*s,a=o*o,n=s*o,u=r*s,l=r*o,p=s*a,h=o*a;return{x:i[0]+s*i[2]+o*i[4]+r*i[6]+n*i[8]+a*i[10]+u*i[12]+l*i[14]+p*i[16]+h*i[18],y:i[1]+s*i[3]+o*i[5]+r*i[7]+n*i[9]+a*i[11]+u*i[13]+l*i[15]+p*i[17]+h*i[19]}}function ns(i,t,e){const{xmin:s,ymin:o,xmax:r,ymax:a,spatialReference:n}=t;let u=[];if(e<2)u.push({x:s,y:a}),u.push({x:r,y:a}),u.push({x:s,y:o}),u.push({x:r,y:o});else{let h=10;for(let f=0;fPe(i,h,e));const l=u.map(h=>h.x),p=u.map(h=>h.y);return new bs({xmin:Math.min.apply(null,l),xmax:Math.max.apply(null,l),ymin:Math.min.apply(null,p),ymax:Math.max.apply(null,p),spatialReference:n})}function vo(i){const[t,e,s,o,r,a]=i,n=s*a-r*o,u=r*o-s*a;return[(r*e-t*a)/n,(s*e-t*o)/u,a/n,o/u,-r/n,-s/u]}let q=Te=class extends Ce{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(i,t){const{coeffX:e,coeffY:s}=t;if(!(e!=null&&e.length)||!(s!=null&&s.length)||e.length!==s.length)return null;const o=[];for(let r=0;r0}forwardTransform(i){if(i.type==="point"){const t=Pe(this.forwardCoefficients,i,this.polynomialOrder);return new Be({x:t.x,y:t.y,spatialReference:i.spatialReference})}return ns(this.forwardCoefficients,i,this.polynomialOrder)}inverseTransform(i){if(i.type==="point"){const t=Pe(this.inverseCoefficients,i,this.polynomialOrder);return new Be({x:t.x,y:t.y,spatialReference:i.spatialReference})}return ns(this.inverseCoefficients,i,this.polynomialOrder)}clone(){return new Te({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};c([m({json:{write:!0}})],q.prototype,"polynomialOrder",void 0),c([m()],q.prototype,"forwardCoefficients",void 0),c([Ct("forwardCoefficients",["coeffX","coeffY"])],q.prototype,"readForwardCoefficients",null),c([_t("forwardCoefficients")],q.prototype,"writeForwardCoefficients",null),c([m({json:{write:!0}})],q.prototype,"inverseCoefficients",null),c([Ct("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],q.prototype,"readInverseCoefficients",null),c([_t("inverseCoefficients")],q.prototype,"writeInverseCoefficients",null),c([m()],q.prototype,"affectsPixelSize",null),c([Y({PolynomialXform:"polynomial"})],q.prototype,"type",void 0),q=Te=c([A("esri.layers.support.rasterTransforms.PolynomialTransform")],q);const wo=q,xs={GCSShiftXform:yo,IdentityXform:xo,PolynomialXform:wo},bo=Object.keys(xs);function Jo(i){const t=i==null?void 0:i.type;return!i||bo.includes(t)}function Ko(i){if(!(i==null?void 0:i.type))return null;const e=xs[i==null?void 0:i.type];if(e){const s=new e;return s.read(i),s}return null}export{co as N,Xo as R,yo as c,Jo as f,Ko as i,wo as y}; +import{d as c,y as m,f as A,aU as $e,e1 as rs,aY as jt,c9 as Y,aV as L,a$ as vs,b0 as ws,aZ as Ct,aR as _t,lZ as kt,N as Bt,kY as _e,aA as Be,aE as bs}from"./index-BjUNJPVf.js";import{u as w,r as nt,i as vt,o as As,t as Ts,n as Fe,v as os,d as Xt,w as is,x as Ps,y as K,z as $s,A as Fs,B as Ns,C as Is}from"./dataUtils-DzOfgSpi.js";import{a as Rs,s as ks,v as Vt,C as Cs,w as as,e as je,x as _s,y as Bs,z as Kt,E as js,H as Ss,I as Jt,J as Ms,M as Os,K as Ds}from"./RasterSymbolizer-BN7ge8gb.js";import{m as Gs,p as Es}from"./colorRamps-CcakIWlU.js";let Ut=class extends $e{constructor(){super(...arguments),this.raster=void 0}};c([m({json:{write:!0}})],Ut.prototype,"raster",void 0),Ut=c([A("esri.layers.support.rasterFunctions.AspectFunctionArguments")],Ut);const D=Ut;var Yt;let wt=Yt=class extends D{constructor(){super(...arguments),this.raster2=void 0}get rasters(){return[this.raster,this.raster2]}clone(){return new Yt({raster:this.raster,raster2:this.raster2,operation:this.operation})}};c([m({json:{write:!0}})],wt.prototype,"operation",void 0),c([m({json:{write:!0}})],wt.prototype,"raster2",void 0),c([m({readOnly:!0})],wt.prototype,"rasters",null),wt=Yt=c([A("esri.layers.support.rasterFunctions.ArithmeticFunctionArguments")],wt);const zs=wt,Vs=new Set(["slope","aspect","curvature","hillshade","shadedrelief","statistics"]);let S=class extends $e{constructor(){super(...arguments),this.functionArguments=null,this.readingBufferSize=0,this.id=-1,this.isNoopProcess=!1,this.rawInputBandIds=[],this.rawSourceRasterInfos=null,this.isInputBandIdsSwizzled=!1,this.swizzledBandSelection=[],this.isBranch=!1,this._bindingResult=null}get supportsGPU(){return this._bindingResult.supportsGPU}get flatWebGLFunctionChain(){var u;const t=this.getWebGLProcessorDefinition();if(!t)return null;const e=[t],{parameters:s}=t;let o=s.rasters||s.raster&&[s.raster];for(;o!=null&&o.length;){e.unshift(...o);const l=[];for(let p=0;p=0;l--)e[l].isNoopProcess&&e.splice(l,1);let r=!1;for(let l=0;l1}const a=e.some(({name:l})=>Vs.has(l.toLowerCase())),{rawSourceRasterInfos:n}=this;return{functions:e,hasBranches:r,hasFocalFunction:a,isSourceSingleBand:((u=n==null?void 0:n[0])==null?void 0:u.bandCount)===1}}bind(t,e=!1,s=-1){this.id=s+1;const o=this._getRasterValues();let r=!0;for(let a=0;athis._readRasterValue(o,t));return this._processPixels({...t,pixelBlocks:s})}processInputBandIds(){const t=this._getRasterValues().filter(this._isRasterFunctionValue);let e;if(t.length>1){const r=t.map(n=>n.processInputBandIds()[0]);this.rawInputBandIds=r,this.isInputBandIdsSwizzled=this.rawInputBandIds.some((n,u)=>n!==u);const a=t.filter(n=>n.functionName==="ExtractBand");return a.length&&a.forEach((n,u)=>{n.isInputBandIdsSwizzled=!0,n.swizzledBandSelection=[u,u,u]}),this.rawInputBandIds}const s=t[0];if(s){if(e=s.processInputBandIds(),s.isInputBandIdsSwizzled)return this.rawInputBandIds=e,e}else{e=[];const{bandCount:r}=this.sourceRasterInfos[0];for(let a=0;ar!==a),this.rawInputBandIds=o,this.rawInputBandIds}getPrimaryRasters(){const t=[],e=[];return this._getPrimaryRasters(this,t,e),{rasters:t,rasterIds:e}}getWebGLProcessorDefinition(){const t=this._getWebGLParameters(),{raster:e,rasters:s}=this.functionArguments;return s&&Array.isArray(s)&&s.length?(t.rasters=s.map(o=>this._isRasterFunctionValue(o)?o.getWebGLProcessorDefinition():typeof o=="number"?{name:"Constant",parameters:{value:o},pixelType:"f32",id:-1,isNoopProcess:!1}:{name:"Identity",parameters:{value:o},pixelType:"f32",id:-1,isNoopProcess:!1}),t.rasters.some(o=>o!=null)||(t.rasters=null)):this._isRasterFunctionValue(e)&&(t.raster=e.getWebGLProcessorDefinition()),{name:this.functionName,parameters:t,pixelType:this.outputPixelType,id:this.id,isNoopProcess:this.isNoopProcess}}getClippingGeometries(){const t=[];this.functionName==="Clip"&&t.push(this.functionArguments);const{raster:e,rasters:s}=this.functionArguments;if(s&&Array.isArray(s)&&s.length)s.forEach(o=>{if(this._isRasterFunctionValue(o)){const r=o.getClippingGeometries();t.push(...r)}});else if(this._isRasterFunctionValue(e)){const o=e.getClippingGeometries();t.push(...o)}return t}_getOutputPixelType(t){return this.outputPixelType==="unknown"?t:this.outputPixelType??t}_getWebGLParameters(){return{}}_getInputBandIds(t){return t}_removeStatsHistColormapVAT(t){t.statistics=null,t.histograms=null,t.colormap=null,t.attributeTable=null}_getRasterValues(){const{rasterArgumentNames:t}=this;return t[0]==="rasters"?this.functionArguments.rasters??[]:t.flatMap(e=>this.functionArguments[e])}_getSourceRasterInfos(t){const e=this._getRasterValues(),{rasterInfos:s,rasterIds:o}=t;if(e.length===0)return s;const r=e.map(n=>n&&typeof n=="object"&&"bind"in n&&n.rasterInfo?n.rasterInfo:typeof n=="string"&&o.includes(n)?s[o.indexOf(n)]:typeof n!="number"?s[0]:void 0),a=r.find(n=>n)??s[0];return r.forEach((n,u)=>{n===void 0&&(r[u]=a)}),r}_getPrimaryRasterId(t){return t==null?void 0:t.rasterId}_getPrimaryRasters(t,e=[],s=[]){for(let o=0;oe?o.slice(0,e):null),r&&r.length!==e&&(t.histograms=r.length>e?r.slice(0,e):null),s.BAND_COUNT&&Number(s.BAND_COUNT)!==e&&(t.keyProperties={...s,BAND_COUNT:typeof s.BAND_COUNT=="string"?String(e):e})}};c([m({json:{write:!0}})],S.prototype,"functionName",void 0),c([m({json:{write:!0}})],S.prototype,"functionArguments",void 0),c([m()],S.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}}),rs(i=>i==null?void 0:i.toLowerCase())],S.prototype,"outputPixelType",void 0),c([m({json:{write:!0}})],S.prototype,"mainPrimaryRasterId",void 0),c([m()],S.prototype,"sourceRasters",void 0),c([m({type:[Rs],json:{write:!0}})],S.prototype,"sourceRasterInfos",void 0),c([m({json:{write:!0}})],S.prototype,"rasterInfo",void 0),c([m({json:{write:!0}})],S.prototype,"readingBufferSize",void 0),c([m({json:{write:!0}})],S.prototype,"id",void 0),c([m()],S.prototype,"isNoopProcess",void 0),c([m()],S.prototype,"supportsGPU",null),c([m()],S.prototype,"rawInputBandIds",void 0),c([m()],S.prototype,"rawSourceRasterInfos",void 0),c([m()],S.prototype,"isInputBandIdsSwizzled",void 0),c([m()],S.prototype,"swizzledBandSelection",void 0),c([m()],S.prototype,"isBranch",void 0),c([m({readOnly:!0})],S.prototype,"flatWebGLFunctionChain",null),c([m()],S.prototype,"_bindingResult",void 0),S=c([A("esri.layers.support.rasterFunctions.BaseRasterFunction")],S);const G=S,$={userDefined:-1,lineDetectionHorizontal:0,lineDetectionVertical:1,lineDetectionLeftDiagonal:2,lineDetectionRightDiagonal:3,gradientNorth:4,gradientWest:5,gradientEast:6,gradientSouth:7,gradientNorthEast:8,gradientNorthWest:9,smoothArithmeticMean:10,smoothing3x3:11,smoothing5x5:12,sharpening3x3:13,sharpening5x5:14,laplacian3x3:15,laplacian5x5:16,sobelHorizontal:17,sobelVertical:18,sharpen:19,sharpen2:20,pointSpread:21,none:255},Us={plus:1,minus:2,times:3,sqrt:4,power:5,abs:10,divide:23,exp:25,exp10:26,exp2:27,int:30,float:32,ln:35,log10:36,log2:37,mod:44,negate:45,roundDown:48,roundUp:49,square:53,floatDivide:64,floorDivide:65},U={bitwiseAnd:11,bitwiseLeftShift:12,bitwiseNot:13,bitwiseOr:14,bitwiseRightShift:15,bitwiseXOr:16,booleanAnd:17,booleanNot:18,booleanOr:19,booleanXOr:20,equalTo:24,greaterThan:28,greaterThanEqual:29,lessThan:33,lessThanEqual:34,isNull:31,notEqual:46},H={acos:6,asin:7,atan:8,atanh:9,cos:21,cosh:22,sin:51,sinh:52,tan:56,tanh:57,acosh:59,asinh:60,atan2:61},Ls={majority:38,max:39,mean:40,med:41,min:42,minority:43,range:47,stddev:54,sum:55,variety:58,majorityIgnoreNoData:66,maxIgnoreNoData:67,meanIgnoreNoData:68,medIgnoreNoData:69,minIgnoreNoData:70,minorityIgnoreNoData:71,rangeIgnoreNoData:72,stddevIgnoreNoData:73,sumIgnoreNoData:74,varietyIgnoreNoData:75},us={setNull:50,conditional:78},Se={...Us,...U,...H,...Ls,...us},ls=new Map([[H.acos,{domain:[0,Math.PI],isInteger:!1}],[H.asin,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[H.atan,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[H.cos,{domain:[-1,1],isInteger:!1}],[H.sin,{domain:[-1,1],isInteger:!1}],[U.booleanAnd,{domain:[0,1],isInteger:!0}],[U.booleanNot,{domain:[0,1],isInteger:!0}],[U.booleanOr,{domain:[0,1],isInteger:!0}],[U.booleanXOr,{domain:[0,1],isInteger:!0}],[U.equalTo,{domain:[0,1],isInteger:!0}],[U.notEqual,{domain:[0,1],isInteger:!0}],[U.greaterThan,{domain:[0,1],isInteger:!0}],[U.greaterThanEqual,{domain:[0,1],isInteger:!0}],[U.lessThan,{domain:[0,1],isInteger:!0}],[U.lessThanEqual,{domain:[0,1],isInteger:!0}],[U.isNull,{domain:[0,1],isInteger:!0}]]);function Me(i){return ls.get(i)}const Oe=[0,2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,2,1,1,1,999,999,1,1,999,1,1,2,999,999,2,2,999,999,999,999,999,999,999,999,999,999,3,999,3];function Ws(i,t=!1){const e=i.map(n=>n.mask),s=e.filter(n=>n!=null),o=i[0].pixels[0].length;if(s.length===0||t&&s.length!==e.length)return new Uint8Array(o).fill(255);const r=s[0],a=new Uint8Array(r);if(s.length===1)return a;if(!t){for(let n=1;n=1?t[u]=0:a[u]=Math.atanh(l)}return a}const n=s===H.asin?Math.asin:Math.acos;for(let u=0;u1?t[u]=0:a[u]=n(l)}return a}function en(i,t,e,s){const[o]=i,r=o.length,a=w.createEmptyBand(e,r);for(let n=0;n>o[n]);return a}function ln(i,t,e){const[s,o]=i,r=s.length,a=w.createEmptyBand(e,r);for(let n=0;no[n]?1:0);return a}function An(i,t,e){const[s,o]=i,r=s.length,a=w.createEmptyBand(e,r);for(let n=0;n=o[n]?1:0);return a}function Tn(i,t,e){const[s,o]=i,r=s.length,a=w.createEmptyBand(e,r);for(let n=0;np&&(u=p)}a[n]=u}return a}function ze(i,t,e){const s=i.length;if(s<2)return i[0];const[o]=i,r=o.length,a=w.createEmptyBand(e,r);for(let n=0;nh&&(u=h)}a[n]=l-u}return a}function Ve(i,t,e){const s=i.length;if(s<2)return i[0];const[o]=i,r=o.length,a=w.createEmptyBand(e,r);for(let n=0;np&&(p=l,u=h);r[n]=u}return r}function He(i,t,e){const s=i.length;if(s<=2)return ps(i,t,e);const o=i[0].length,r=w.createEmptyBand(e,o),a=new Map;for(let n=0;nr?t[n]=0:s[n]=a?Math.round(u):u}}function hs(i,t,e={}){kn();let s=Ws(i,t>=66&&t<=75);const{outputPixelType:o="f32"}=e,r=!j.has(t)||e.processAsMultiband,a=r?i[0].pixels.length:1,n=[];for(let l=0;lg.pixels):i.map(g=>g.pixels[l]);let h,f=!0;if(t===us.setNull){const g=Rn(p,s,o);h=g.band,s=g.mask,f=!1}else T.has(t)?h=T.get(t)(p,s,"f64"):O.has(t)?h=t===H.asin||t===H.acos||t===H.atanh?tn(p,s,"f64",t):en(p,s,"f64",O.get(t)):Ht.has(t)?h=sn(p,s,"f64",Ht.get(t)):j.has(t)?h=j.get(t)(p,s,"f64"):(h=p[0],f=!1);if(f&&t!==U.isNull&&!ls.has(t)){const g=w.createEmptyBand(o,h.length);s||(s=new Uint8Array(h.length).fill(255)),Cn(h,s,o,g),h=g}n.push(h)}const u=i[0];return new w({width:u.width,height:u.height,pixelType:o,mask:t===U.isNull?null:s,pixels:n})}function _n(i,t,e){return hs(i,t=[null,1,2,3,23,5,44][t]??1,{outputPixelType:e})}let bt=class extends G{constructor(){super(...arguments),this.functionName="Arithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){const{operation:t}=this.functionArguments;if(t<1||t>6)return{success:!1,supportsGPU:!1,error:"unsupported operation"};const e=this.sourceRasterInfos[0].clone();return this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,{success:!0,supportsGPU:e.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;return(e==null?void 0:e[0])==null||(e==null?void 0:e[1])==null?null:_n(e,this.functionArguments.operation,this.outputPixelType)}_getWebGLParameters(){const{operation:t}=this.functionArguments,e=["","plus","minus","times","divide","power","mod"][t],s=this.outputPixelType??"f32";let[o,r]=vt(s);const a=nt(s);return a&&(o-=1e-4,r+=1e-4),{imageCount:2,operationName:e,domainRange:[o,r],isOutputRounded:a}}};c([m({json:{write:!0,name:"rasterFunction"}})],bt.prototype,"functionName",void 0),c([m({type:zs,json:{write:!0,name:"rasterFunctionArguments"}})],bt.prototype,"functionArguments",void 0),c([m()],bt.prototype,"rasterArgumentNames",void 0),bt=c([A("esri.layers.support.rasterFunctions.ArithmeticFunction")],bt);const Bn=bt;var Zt;let Qt=Zt=class extends D{clone(){return new Zt({raster:this.raster})}};Qt=Zt=c([A("esri.layers.support.rasterFunctions.AspectFunctionArguments")],Qt);const jn=Qt;let rt=class extends G{constructor(){super(...arguments),this.functionName="Aspect",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){var s;const t=this.sourceRasterInfos[0];this.isGCS=((s=t.spatialReference)==null?void 0:s.isGeographic)??!1,this.outputPixelType=this._getOutputPixelType("f32");const e=t.clone();return e.pixelType=this.outputPixelType,e.statistics=[{min:-1,max:360,avg:180,stddev:30}],e.histograms=null,e.colormap=null,e.attributeTable=null,e.bandCount=1,this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){var n;const e=(n=t.pixelBlocks)==null?void 0:n[0];if(e==null)return null;const{extent:s,primaryPixelSizes:o}=t,r=o==null?void 0:o[0],a=r??(s?{x:s.width/e.width,y:s.height/e.height}:{x:1,y:1});return ks(e,{resolution:a})}};c([m({json:{write:!0,name:"rasterFunction"}})],rt.prototype,"functionName",void 0),c([m({type:jn,json:{write:!0,name:"rasterFunctionArguments"}})],rt.prototype,"functionArguments",void 0),c([m()],rt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],rt.prototype,"isGCS",void 0),rt=c([A("esri.layers.support.rasterFunctions.AspectFunction")],rt);const Sn=rt,Mn=new Set(["+","-","*","/","(",")"]);function On(i,t){(i=i.replaceAll(" ","")).startsWith("-")&&(i="0"+i),i.startsWith("+")&&(i=i.slice(1,i.length));const e=i.split(""),s=[],o=[];let r="";for(let a=0;a-1)e>0&&(o+=t+1);else{for(let a=0;a0&&(o+=t+1)}let r=0;for(let a=0;a0;){const{numIndex:a,opIndex:n}=En(o);if(s=Dn(i,o[n],r[a],r[a+1]),o.length===1)break;o=Gn(o,n),r.splice(a,2,s)}return[s]}const Vn=new jt({0:"custom",1:"ndvi",2:"savi",3:"tsavi",4:"msavi",5:"gemi",6:"pvi",7:"gvitm",8:"sultan",9:"vari",10:"gndvi",11:"sr",12:"ndvi-re",13:"sr-re",14:"mtvi2",15:"rtvi-core",16:"ci-re",17:"ci-g",18:"ndwi",19:"evi",20:"iron-oxide",21:"ferrous-minerals",22:"clay-minerals",23:"wndwi",24:"bai",25:"nbr",26:"ndbi",27:"ndmi",28:"ndsi",29:"mndwi"},{useNumericKeys:!0});function Un(i,t){if(!As(i))return i;const{equation:e,method:s}=t,o=t.bandIndexes.map(p=>p-1),{pixels:r,mask:a}=i;let n;switch(s){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":n=Ke(a,r[o[0]],r[o[1]]);break;case"ndwi":n=Ke(a,r[o[1]],r[o[0]]);break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":n=Wn(a,r[o[0]],r[o[1]]);break;case"ci-g":case"ci-re":n=qn(a,r[o[0]],r[o[1]]);break;case"savi":n=Hn(a,r[o[0]],r[o[1]],o[2]+1);break;case"tsavi":n=Xn(a,r[o[0]],r[o[1]],o[2]+1,o[3]+1,o[4]+1);break;case"msavi":n=Jn(a,r[o[0]],r[o[1]]);break;case"gemi":n=Kn(a,r[o[0]],r[o[1]]);break;case"pvi":n=Yn(a,r[o[0]],r[o[1]],o[2]+1,o[3]+1);break;case"gvitm":n=Zn(a,[r[o[0]],r[o[1]],r[o[2]],r[o[3]],r[o[4]],r[o[5]]]);break;case"sultan":n=Qn(a,[r[o[0]],r[o[1]],r[o[2]],r[o[3]],r[o[4]]]);break;case"vari":n=tr(a,[r[o[0]],r[o[1]],r[o[2]]]);break;case"mtvi2":n=er(a,[r[o[0]],r[o[1]],r[o[2]]]);break;case"rtvi-core":n=sr(a,[r[o[0]],r[o[1]],r[o[2]]]);break;case"evi":n=nr(a,[r[o[0]],r[o[1]],r[o[2]]]);break;case"wndwi":n=rr(a,[r[o[0]],r[o[1]],r[o[2]]],o[3]?o[3]+1:.5);break;case"bai":n=or(a,r[o[0]],r[o[1]]);break;case"custom":n=zn(a,r,e);break;default:return i}const u=a!=null?new Uint8Array(a.length):null;a!=null&&u!=null&&u.set(a);const l=new w({width:i.width,height:i.height,pixelType:"f32",pixels:n,mask:u});return l.updateStatistics(),l}function Ln(i,t,e,s){const{mask:o,pixels:r,width:a,height:n}=i,u=r[e],l=r[t],p=l.length,h=s?new Uint8Array(p):new Float32Array(p),f=s?100:1,g=s?100.5:0;for(let y=0;yparseFloat(n));return Un(e,{method:s,bandIndexes:r,equation:o})}_getWebGLParameters(){const t=this.functionArguments.bandIndexes.split(" ").map(n=>parseFloat(n)-1);t.length===2&&t.push(0);const e=this.isInputBandIdsSwizzled?[0,1,2]:t;let s,o;const r=new Float32Array(3),{method:a}=this.functionArguments;switch(a){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":s=z([e[0],e[1],0]),o="ndxi";break;case"ndwi":s=z([e[1],e[0],0]),o="ndxi";break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":s=z([e[0],e[1],0]),o="sr";break;case"ci-g":case"ci-re":s=z([e[0],e[1],0]),o="ci";break;case"savi":s=z([e[0],e[1],0]),o="savi",r[0]=t[2]+1;break;case"tsavi":s=z([e[0],e[1],0]),o="tsavi",r[0]=t[2]+1,r[1]=t[3]+1,r[2]=t[4]+1;break;case"msavi":s=z([e[0],e[1],0]),o="msavi";break;case"gemi":s=z([e[0],e[1],0]),o="gemi";break;case"pvi":s=z([e[0],e[1],0]),o="tsavi",r[0]=t[2]+1,r[1]=t[3]+1;break;case"vari":s=z([e[0],e[1],e[2]]),o="vari";break;case"mtvi2":s=z([e[0],e[1],e[2]]),o="mtvi";break;case"rtvi-core":s=z([e[0],e[1],e[2]]),o="rtvicore";break;case"evi":s=z([e[0],e[1],e[2]]),o="evi";break;case"wndwi":s=z([e[0],e[1],0]),o="wndwi",r[0]=t[3]?t[3]+1:.5;break;case"bai":s=z([e[1],e[0],0]),o="bai";break;default:s=z([0,1,2]),o="custom"}return{bandIndexMat3:s,indexType:o,adjustments:r}}_getInputBandIds(t){if(this.functionArguments.method==="custom")return t;const e=this.functionArguments.bandIndexes.split(" ").map(n=>parseFloat(n)-1),s=t.length,o=e.map(n=>n>=s?s-1:n),r=ar.has(this.functionArguments.method)?3:2,a=o.slice(0,r).map(n=>t[n]);return a.length===2&&a.push(0),a}};c([m({json:{write:!0,name:"rasterFunction"}})],At.prototype,"functionName",void 0),c([m({type:ir,json:{write:!0,name:"rasterFunctionArguments"}})],At.prototype,"functionArguments",void 0),c([m()],At.prototype,"rasterArgumentNames",void 0),At=c([A("esri.layers.support.rasterFunctions.BandArithmeticFunction")],At);const ur=At;var ee;const Ye=new jt({1:"outside",2:"inside"},{useNumericKeys:!0});let Ot=ee=class extends D{constructor(){super(...arguments),this.clippingType="outside"}clone(){return new ee({clippingGeometry:this.clippingGeometry.clone(),clippingType:this.clippingType})}};c([m({types:vs,json:{read:ws,write:!0}})],Ot.prototype,"clippingGeometry",void 0),c([m({json:{read:Ye.read,write:Ye.write}})],Ot.prototype,"clippingType",void 0),Ot=ee=c([A("esri.layers.support.rasterFunctions.ClipFunctionArguments")],Ot);const lr=Ot;let ot=class extends G{constructor(){super(...arguments),this.functionName="Clip",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone();return this.outputPixelType=this._getOutputPixelType(t.pixelType),t.pixelType=this.outputPixelType,this.rasterInfo=t,{success:!0,supportsGPU:!0}}_processPixels(t){var e;return(e=t.pixelBlocks)==null?void 0:e[0]}_getWebGLParameters(){const{clippingGeometry:t,clippingType:e}=this.functionArguments;return{clippingGeometry:t.toJSON(),clippingType:e}}};c([m({json:{write:!0,name:"rasterFunction"}})],ot.prototype,"functionName",void 0),c([m({type:lr,json:{write:!0,name:"rasterFunctionArguments"}})],ot.prototype,"functionArguments",void 0),c([m()],ot.prototype,"rasterArgumentNames",void 0),c([m()],ot.prototype,"isNoopProcess",void 0),ot=c([A("esri.layers.support.rasterFunctions.ClipFunction")],ot);const cr=ot;var se;let X=se=class extends D{castColormapName(i){if(!i)return null;const t=i.toLowerCase();return Cs.includes(t)?t:null}readColorRamp(i){return Es(i)}readColorRampName(i,t){if(!i)return null;const e=Vt.jsonValues.find(s=>s.toLowerCase()===i.toLowerCase());return e?Vt.fromJSON(e):null}clone(){var i;return new se({colormap:L(this.colormap),colormapName:this.colormapName,colorRamp:(i=this.colorRamp)==null?void 0:i.clone(),colorRampName:this.colorRampName})}};c([m({type:[[Number]],json:{write:!0}})],X.prototype,"colormap",void 0),c([m({type:String,json:{write:!0}})],X.prototype,"colormapName",void 0),c([rs("colormapName")],X.prototype,"castColormapName",null),c([m({types:Gs,json:{write:!0}})],X.prototype,"colorRamp",void 0),c([Ct("colorRamp")],X.prototype,"readColorRamp",null),c([m({type:Vt.apiValues,json:{type:Vt.jsonValues,write:Vt.write}})],X.prototype,"colorRampName",void 0),c([Ct("colorRampName")],X.prototype,"readColorRampName",null),X=se=c([A("esri.layers.support.rasterFunctions.ColormapFunctionArguments")],X);const pr=X,hr=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[112,75,3],[113,76,3],[114,77,3],[115,77,3],[116,78,3],[117,79,3],[118,79,3],[119,80,3],[121,81,4],[122,82,4],[123,82,4],[124,83,4],[125,84,4],[126,84,4],[127,85,4],[128,86,4],[129,86,4],[130,87,4],[131,88,4],[132,89,4],[133,89,4],[134,90,4],[135,91,4],[136,91,4],[137,92,4],[138,93,4],[139,94,4],[140,94,4],[142,95,5],[143,96,5],[144,96,5],[145,97,5],[146,98,5],[147,99,5],[148,99,5],[149,100,5],[150,101,5],[151,101,5],[152,102,5],[153,103,5],[154,104,5],[155,104,5],[156,105,5],[157,106,5],[158,106,5],[159,107,5],[160,108,5],[161,108,5],[162,109,5],[164,110,6],[165,111,6],[166,111,6],[167,112,6],[168,113,6],[169,113,6],[170,114,6],[171,115,6],[172,116,6],[173,116,6],[174,117,6],[245,0,0],[245,5,0],[245,10,0],[246,15,0],[246,20,0],[246,25,0],[246,30,0],[247,35,0],[247,40,0],[247,45,0],[247,50,0],[247,55,0],[248,60,0],[248,65,0],[248,70,0],[248,75,0],[249,81,0],[249,86,0],[249,91,0],[249,96,0],[250,101,0],[250,106,0],[250,111,0],[250,116,0],[250,121,0],[251,126,0],[251,131,0],[251,136,0],[251,141,0],[252,146,0],[252,151,0],[252,156,0],[252,156,0],[251,159,0],[250,162,0],[249,165,0],[248,168,0],[247,171,0],[246,174,0],[245,177,0],[245,179,0],[244,182,0],[243,185,0],[242,188,0],[241,191,0],[240,194,0],[239,197,0],[238,200,0],[237,203,0],[236,206,0],[235,209,0],[234,212,0],[233,215,0],[232,218,0],[231,221,0],[230,224,0],[230,226,0],[229,229,0],[228,232,0],[227,235,0],[226,238,0],[225,241,0],[224,244,0],[223,247,0],[165,247,0],[163,244,0],[161,240,0],[158,237,0],[156,233,1],[154,230,1],[152,227,1],[149,223,1],[147,220,1],[145,216,1],[143,213,1],[140,210,2],[138,206,2],[136,203,2],[134,200,2],[132,196,2],[129,193,2],[127,189,2],[125,186,3],[123,183,3],[120,179,3],[118,176,3],[116,172,3],[114,169,3],[111,166,3],[109,162,4],[107,159,4],[105,155,4],[103,152,4],[100,149,4],[98,145,4],[96,142,4],[94,138,5],[91,135,5],[89,132,5],[87,128,5],[85,125,5],[82,121,5],[80,118,5],[78,115,6],[76,111,6],[73,108,6],[71,105,6],[69,101,6],[67,98,6],[65,94,6],[62,91,7],[60,88,7],[58,84,7],[56,81,7],[53,77,7],[51,74,7],[49,71,7],[47,67,8],[44,64,8],[42,60,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8]],mr=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[245,20,0],[245,24,0],[245,29,0],[245,31,0],[247,33,0],[247,33,0],[247,37,0],[247,41,0],[247,41,0],[247,41,0],[247,45,0],[247,45,0],[247,47,0],[247,49,0],[247,49,0],[247,54,0],[247,54,0],[247,56,0],[247,58,0],[247,58,0],[250,62,0],[250,62,0],[250,62,0],[250,67,0],[250,67,0],[250,67,0],[250,69,0],[250,71,0],[250,71,0],[250,75,0],[250,75,0],[250,78,0],[250,79,0],[250,79,0],[250,79,0],[250,81,0],[250,83,0],[250,83,0],[250,87,0],[250,87,0],[250,90,0],[250,92,0],[252,93,0],[252,93,0],[252,97,0],[252,97,0],[252,97,0],[252,97,0],[252,101,0],[252,101,0],[252,101,0],[252,101,0],[252,105,0],[252,105,0],[252,107,0],[252,109,0],[252,109,0],[252,113,13],[255,118,20],[255,119,23],[255,121,25],[255,126,33],[255,132,38],[255,133,40],[255,135,43],[255,141,48],[255,144,54],[255,150,59],[255,152,61],[255,153,64],[255,159,69],[255,163,77],[255,165,79],[255,168,82],[255,174,87],[255,176,92],[255,181,97],[255,183,99],[255,186,102],[255,191,107],[255,197,115],[255,201,120],[255,203,123],[255,205,125],[255,209,130],[255,214,138],[255,216,141],[255,218,143],[255,224,150],[255,228,156],[255,234,163],[255,236,165],[255,238,168],[255,243,173],[255,248,181],[255,252,186],[253,252,186],[250,252,187],[244,250,180],[238,247,176],[234,246,173],[231,245,169],[223,240,163],[217,237,157],[211,235,150],[205,233,146],[200,230,142],[195,227,136],[189,224,132],[184,222,126],[180,220,123],[174,217,119],[169,214,114],[163,212,108],[160,210,105],[154,207,101],[148,204,96],[143,201,93],[138,199,88],[134,197,84],[130,194,81],[126,191,77],[117,189,70],[115,186,68],[112,184,64],[106,181,60],[100,179,55],[94,176,49],[92,174,47],[90,173,45],[81,168,37],[75,166,33],[71,163,28],[66,160,24],[62,158,21],[56,156,14],[51,153,0],[51,153,0],[51,153,0],[50,150,0],[50,150,0],[50,150,0],[50,150,0],[49,148,0],[49,148,0],[49,148,0],[48,145,0],[48,145,0],[48,145,0],[48,145,0],[48,143,0],[48,143,0],[48,143,0],[48,143,0],[47,140,0],[47,140,0],[47,140,0],[47,140,0],[46,138,0],[46,138,0],[46,138,0],[46,138,0],[45,135,0],[45,135,0],[45,135,0],[45,135,0],[44,133,0],[44,133,0],[44,133,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[42,128,0],[42,128,0],[42,128,0],[42,125,0],[42,125,0],[42,125,0],[42,125,0],[41,122,0],[41,122,0],[41,122,0],[41,122,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[39,117,0],[39,117,0],[39,117,0],[39,117,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0]];function Re(i,t){const e=[],s=[];for(let r=0;r[s,...e]),t):null}let Z=class extends G{constructor(){super(...arguments),this.functionName="Colormap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"colormap-function: source data must be single band"};let{colormap:e,colormapName:s,colorRamp:o,colorRampName:r}=this.functionArguments;if(!(e!=null&&e.length))if(o)e=je(o,{interpolateAlpha:!0});else if(r){const u=_s(r);u&&(e=je(u))}else s&&(e=vr(s));if(!(e!=null&&e.length))return{success:!1,supportsGPU:!1,error:"colormap-function: missing colormap argument"};const a=this._getOutputPixelType(t.pixelType);this.outputPixelType=a.startsWith("f")?"s32":a;const n=t.clone();return n.pixelType=this.outputPixelType,n.colormap=e,n.bandCount=1,this.rasterInfo=n,{success:!0,supportsGPU:!0}}_processPixels(t){var s;let e=(s=t.pixelBlocks)==null?void 0:s[0];return!e||nt(e.pixelType)||(e=e.clone(),e.clamp(this.outputPixelType)),e}};c([m({json:{write:!0,name:"rasterFunction"}})],Z.prototype,"functionName",void 0),c([m({type:pr,json:{write:!0,name:"rasterFunctionArguments"}})],Z.prototype,"functionArguments",void 0),c([m()],Z.prototype,"rasterArgumentNames",void 0),c([m()],Z.prototype,"isNoopProcess",void 0),c([m({json:{write:!0}})],Z.prototype,"indexedColormap",void 0),Z=c([A("esri.layers.support.rasterFunctions.ColormapFunction")],Z);const wr=Z;var ne;let Dt=ne=class extends D{constructor(){super(...arguments),this.rasters=[]}writeRasters(i,t){t.rasters=i.map(e=>typeof e=="number"||typeof e=="string"?e:e.toJSON())}clone(){return new ne({rasters:L(this.rasters)})}};c([m({json:{write:!0}})],Dt.prototype,"rasters",void 0),c([_t("rasters")],Dt.prototype,"writeRasters",null),Dt=ne=c([A("esri.layers.support.rasterFunctions.CompositeBandFunctionArguments")],Dt);const br=Dt;let Tt=class extends G{constructor(){super(...arguments),this.functionName="CompositeBand",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const s=e.clone();if(s.attributeTable=null,s.colormap=null,s.pixelType=this.outputPixelType,s.bandCount=t.map(({bandCount:r})=>r).reduce((r,a)=>r+a),t.every(({statistics:r})=>r!=null&&r.length)){const r=[];t.forEach(({statistics:a})=>a!=null&&r.push(...a)),s.statistics=r}if(t.every(({histograms:r})=>r!=null&&r.length)){const r=[];t.forEach(({histograms:a})=>a!=null&&r.push(...a)),s.histograms=r}s.bandCount>1&&(s.colormap=null,s.attributeTable=null);const o=t.every(r=>{var a;return(a=r.keyProperties.BandProperties)==null?void 0:a.length})?t.flatMap(r=>r.keyProperties.BandProperties):void 0;return s.keyProperties={...s.keyProperties,BandProperties:o},this.rasterInfo=s,{success:!0,supportsGPU:s.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;return e?(e==null?void 0:e[0])==null?null:Ts(e):null}_getWebGLParameters(){return{bandCount:this.rasterInfo.bandCount}}};c([m({json:{write:!0,name:"rasterFunction"}})],Tt.prototype,"functionName",void 0),c([m({type:br,json:{write:!0,name:"rasterFunctionArguments"}})],Tt.prototype,"functionArguments",void 0),c([m()],Tt.prototype,"rasterArgumentNames",void 0),Tt=c([A("esri.layers.support.rasterFunctions.CompositeBandFunction")],Tt);const Ar=Tt;var re;let Gt=re=class extends D{constructor(){super(...arguments),this.contrastOffset=0,this.brightnessOffset=0}clone(){return new re({contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset,raster:this.raster})}};c([m({json:{write:!0}})],Gt.prototype,"contrastOffset",void 0),c([m({json:{write:!0}})],Gt.prototype,"brightnessOffset",void 0),Gt=re=c([A("esri.layers.support.rasterFunctions.ContrastBrightnessFunctionArguments")],Gt);const Tr=Gt;let it=class extends G{constructor(){super(...arguments),this.functionName="ContrastBrightness",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];if(e.pixelType!=="u8")return{success:!1,supportsGPU:!1,error:"Only unsigned 8 bit raster is supported by ContrastBrightness function."};this.outputPixelType=this._getOutputPixelType("u8");const s=e.clone();this._removeStatsHistColormapVAT(s),this.rasterInfo=s;const{contrastOffset:o,brightnessOffset:r}=this.functionArguments;return this.lookup=Bs(o,r),{success:!0,supportsGPU:!0}}_processPixels(t){var s;const e=(s=t.pixelBlocks)==null?void 0:s[0];return e==null?null:Fe(e,{lut:e.pixels.map(()=>this.lookup),offset:0,outputPixelType:"u8"})}_getWebGLParameters(){const{contrastOffset:t,brightnessOffset:e}=this.functionArguments;return{contrastOffset:t,brightnessOffset:e}}};c([m({json:{write:!0,name:"rasterFunction"}})],it.prototype,"functionName",void 0),c([m({type:Tr,json:{write:!0,name:"rasterFunctionArguments"}})],it.prototype,"functionArguments",void 0),c([m()],it.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],it.prototype,"lookup",void 0),it=c([A("esri.layers.support.rasterFunctions.ContrastBrightnessFunction")],it);const Pr=it;function ke(i,t,e,s,o){const r=Math.floor(s/2);for(let n=0;no+r);return e===-1||s===0||s===1?t:t.map(o=>o/s)}_bindSourceRasters(){const{convolutionType:t,rows:e,cols:s,kernel:o}=this.functionArguments;if(!Object.values($).includes(t))return{success:!1,supportsGPU:!1,error:`convolution-function: the specified kernel type is not supported ${t}`};if(t!==$.none&&e*s!==o.length)return{success:!1,supportsGPU:!1,error:"convolution-function: the specified rows and cols do not match the length of the kernel"};const r=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(r.pixelType);const a=r.clone();a.pixelType=this.outputPixelType;const n=[$.none,$.sharpen,$.sharpen2,$.sharpening3x3,$.sharpening5x5];return(t===-1||this.outputPixelType!=="u8"&&!n.includes(t))&&(a.statistics=null,a.histograms=null),a.colormap=null,a.attributeTable=null,this.rasterInfo=a,{success:!0,supportsGPU:o.length<=Qe}}_processPixels(t){var a;const e=(a=t.pixelBlocks)==null?void 0:a[0];if(e==null||this.functionArguments.convolutionType===$.none)return e;const{rows:s,cols:o}=this.functionArguments,{_normalizedKernel:r}=this;return Rr(e,{kernel:r,rows:s,cols:o,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const t=new Float32Array(Qe);return t.set(this._normalizedKernel),{kernelRows:this.functionArguments.rows,kernelCols:this.functionArguments.cols,kernel:t,clampRange:vt(this.outputPixelType)}}};c([m({json:{write:!0,name:"rasterFunction"}})],ut.prototype,"functionName",void 0),c([m({type:kr,json:{write:!0,name:"rasterFunctionArguments"}})],ut.prototype,"functionArguments",void 0),c([m()],ut.prototype,"rasterArgumentNames",void 0),c([m()],ut.prototype,"_normalizedKernel",null),ut=c([A("esri.layers.support.rasterFunctions.ConvolutionFunction")],ut);const Cr=ut;var ie;const ms=new jt({0:"standard",1:"platform",2:"profile"},{useNumericKeys:!0});let Pt=ie=class extends D{constructor(){super(...arguments),this.curvatureType="standard",this.zFactor=1}readCurvatureType(i,t){return ms.fromJSON(t.type??t.curvatureType??0)}clone(){return new ie({curvatureType:this.curvatureType,zFactor:this.zFactor,raster:this.raster})}};c([m({json:{write:{target:"type"}}}),Y(ms)],Pt.prototype,"curvatureType",void 0),c([Ct("curvatureType",["type","curvatureType"])],Pt.prototype,"readCurvatureType",null),c([m({type:Number,json:{write:!0}})],Pt.prototype,"zFactor",void 0),Pt=ie=c([A("esri.layers.support.rasterFunctions.CurvatureFunctionArguments")],Pt);const _r=Pt;let lt=class extends G{constructor(){super(...arguments),this.functionName="Curvature",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){var e;this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0].clone();return t.pixelType=this.outputPixelType,t.bandCount=1,this._removeStatsHistColormapVAT(t),this.rasterInfo=t,this.isGCS=((e=t.spatialReference)==null?void 0:e.isGeographic)??!1,{success:!0,supportsGPU:!0}}_processPixels(t){var p;const e=(p=t.pixelBlocks)==null?void 0:p[0];if(e==null)return null;const{zFactor:s,curvatureType:o}=this.functionArguments,{extent:r,primaryPixelSizes:a}=t,n=a==null?void 0:a[0],u=n??(r?{x:r.width/e.width,y:r.height/e.height}:{x:1,y:1}),l=this.isGCS&&s>=1?s*Kt:s;return js(e,{zFactor:l,curvatureType:o,resolution:u})}_getWebGLParameters(){const{zFactor:t,curvatureType:e}=this.functionArguments;return{curvatureType:e,zFactor:this.isGCS&&t>=1?t*Kt:t}}};c([m({json:{write:!0,name:"rasterFunction"}})],lt.prototype,"functionName",void 0),c([m({type:_r,json:{write:!0,name:"rasterFunctionArguments"}})],lt.prototype,"functionArguments",void 0),c([m()],lt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],lt.prototype,"isGCS",void 0),lt=c([A("esri.layers.support.rasterFunctions.CurvatureFunction")],lt);const Br=lt;var ae;let J=ae=class extends D{constructor(){super(...arguments),this.bandIds=[],this.bandNames=[],this.bandWavelengths=[],this.missingBandAction=os.bestMatch}clone(){var i,t,e;return new ae({bandIds:(i=this.bandIds)==null?void 0:i.slice(),bandNames:(t=this.bandNames)==null?void 0:t.slice(),bandWavelengths:(e=this.bandWavelengths)==null?void 0:e.slice(),missingBandAction:this.missingBandAction,method:this.method,wavelengthMatchTolerance:this.wavelengthMatchTolerance})}};c([m({json:{write:!0}})],J.prototype,"bandIds",void 0),c([m({json:{write:!0}})],J.prototype,"bandNames",void 0),c([m({json:{write:!0}})],J.prototype,"bandWavelengths",void 0),c([Y({0:"name",1:"wavelength",2:"id"})],J.prototype,"method",void 0),c([m({json:{write:!0}})],J.prototype,"missingBandAction",void 0),c([m({json:{write:!0}})],J.prototype,"wavelengthMatchTolerance",void 0),J=ae=c([A("esri.layers.support.rasterFunctions.ExtractBandFunctionArguments")],J);const jr=J;let $t=class extends G{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){var b;const{functionArguments:t,sourceRasterInfos:e}=this,s=e[0],{method:o,bandNames:r,bandWavelengths:a,bandIds:n,missingBandAction:u}=t,l=(r==null?void 0:r.length)&&(o==="name"||o!=="id"&&!(n!=null&&n.length)),p=(a==null?void 0:a.length)&&(o==="wavelength"||o!=="id"&&!(n!=null&&n.length)),h=u===os.fail,f=l?this._matchBandNames(s,r):p?this._matchBandWavelengths(s,a,h):this._matchBandIds(s,n,h);if(f==null)return{success:!1,supportsGPU:!1,error:`extract-band-function: Invalid ${l?"band names":p?"band wavelengths":"band ids"} for the imagery data source`};this.functionArguments.bandIds=f,this.functionArguments.method="id",this.outputPixelType=this._getOutputPixelType("f32");const g=s.clone();g.pixelType=this.outputPixelType,g.bandCount=f.length;const{statistics:x,histograms:y}=g;x!=null&&x.length&&(g.statistics=f.map(v=>x[v]||x[x.length-1])),y!=null&&y.length&&(g.histograms=f.map(v=>y[v]||y[y.length-1]));let d=(b=g.keyProperties)==null?void 0:b.BandProperties;return d!=null&&d.length&&(d=f.map(v=>v>=d.length?d[d.length-1]:d[v]),g.keyProperties={...g.keyProperties,BandProperties:d}),this.rasterInfo=g,{success:!0,supportsGPU:g.bandCount<=3}}_processPixels(t){var r;const e=(r=t.pixelBlocks)==null?void 0:r[0];if(e==null)return null;const s=e.pixels.length,o=this.functionArguments.bandIds.map(a=>a>=s?s-1:a);return e.extractBands(o)}_getWebGLParameters(){let t;if(this.isInputBandIdsSwizzled)t=this.swizzledBandSelection.length?this.swizzledBandSelection:[0,1,2];else{t=[...this.functionArguments.bandIds],t.length===0?t=[0,1,2]:t.length<3&&(t[1]=t[1]??t[0],t[2]=t[2]??t[1]);for(let e=0;e<3;e++)t[e]=Math.min(t[e],2)}return{bandIndexMat3:z(t)}}_getInputBandIds(t){const e=t.length;return this.functionArguments.bandIds.map(s=>s>=e?e-1:s).map(s=>t[s])}_matchBandNames(t,e){const s=t.bandInfos.map(({name:r})=>r.toLowerCase()),o=[];for(let r=0;ru.startsWith("nearinfrared_1")),n===-1&&(n=s.findIndex(u=>u.startsWith("nearinfrared")))),n===-1)return null;o.push(n)}return o}_matchBandIds(t,e,s){const{bandCount:o}=t;return!(e!=null&&e.length)||s&&e.some(r=>r<0||r>=o)?null:e}_matchBandWavelengths(t,e,s){const{bandInfos:o}=t,r=[];for(let u=0;u=x.minWavelength&&l<=x.maxWavelength,d=Math.abs(l-(x.minWavelength+x.maxWavelength)/2);y?dx?x:Ns+o);return t.map(s=>s/e)}_bindSourceRasters(){const{conversionParameters:t}=this.functionArguments;if(!(t!=null&&t.length))return{success:!1,supportsGPU:!1,error:"missing valid conversion parameters."};const e=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType;const s=t.length===3||e.bandCount===3&&t.length>3;return e.bandCount=1,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,{success:!0,supportsGPU:s}}_processPixels(t){var s;const e=(s=t.pixelBlocks)==null?void 0:s[0];return e==null?null:Mr(e,this._normalizedWeights,this.outputPixelType)}_getWebGLParameters(){return{weights:this._normalizedWeights}}};c([m({json:{write:!0,name:"rasterFunction"}})],ct.prototype,"functionName",void 0),c([m({type:Or,json:{write:!0,name:"rasterFunctionArguments"}})],ct.prototype,"functionArguments",void 0),c([m()],ct.prototype,"rasterArgumentNames",void 0),c([m()],ct.prototype,"_normalizedWeights",null),ct=c([A("esri.layers.support.rasterFunctions.GrayscaleFunction")],ct);const Dr=ct;var le;let pt=le=class extends D{constructor(){super(...arguments),this.rasters=[],this.processAsMultiband=!0}writeRasters(i,t){t.rasters=i.map(e=>typeof e=="number"||typeof e=="string"?e:e.toJSON())}clone(){return new le({operation:this.operation,processAsMultiband:this.processAsMultiband,rasters:L(this.rasters)})}};c([m({json:{write:!0}})],pt.prototype,"operation",void 0),c([m({json:{write:!0}})],pt.prototype,"rasters",void 0),c([_t("rasters")],pt.prototype,"writeRasters",null),c([m({json:{write:!0}})],pt.prototype,"processAsMultiband",void 0),pt=le=c([A("esri.layers.support.rasterFunctions.LocalFunctionArguments")],pt);const Gr=pt;let Ft=class extends G{constructor(){super(...arguments),this.functionName="Local",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0],{bandCount:s}=e,{processAsMultiband:o}=this.functionArguments;if(t.some(l=>l.bandCount!==s))return{success:!1,supportsGPU:!1,error:"local-function: input rasters do not have same band count"};const{operation:r,rasters:a}=this.functionArguments,n=Oe[r];if(!(n===999||a.length===n||a.length<=1&&n===1))return{success:!1,supportsGPU:!1,error:`local-function: the length of functionArguments.rasters does not match operation's requirement: ${n}`};const u=e.clone();return u.bandCount=n!==999||o?s:1,this._removeStatsHistColormapVAT(u),this._updateStatistics(u),this._updatePixelType(u),this.rasterInfo=u,{success:!0,supportsGPU:u.bandCount===1&&n<=3&&(r<11||r>16)}}_processPixels(t){const{pixelBlocks:e}=t;return e==null||e.some(s=>s==null)?null:hs(e,this.functionArguments.operation,{processAsMultiband:this.functionArguments.processAsMultiband,outputPixelType:this.outputPixelType??void 0})}_getWebGLParameters(){var u;const{operation:t}=this.functionArguments,e=Oe[t],s=((u=Object.keys(Se).find(l=>Se[l]===t))==null?void 0:u.toLowerCase())??"undefined",o=this.outputPixelType??"f32";let[r,a]=vt(o);const n=nt(o);return n&&(r-=1e-4,a+=1e-4),{imageCount:e,operationName:s,domainRange:[r,a],isOutputRounded:n}}_updateStatistics(t){var r,a;const e=this.sourceRasterInfos[0],{operation:s}=this.functionArguments,o=(r=Me(s))==null?void 0:r.domain;if(o){t.statistics=[];for(let n=0;n({min:-n.max,max:-n.min,avg:n.avg!=null?-n.avg:void 0,stddev:n.stddev!=null?-n.stddev:void 0})))}_updatePixelType(t){const{statistics:e,pixelType:s}=this.sourceRasterInfos[0],{operation:o}=this.functionArguments,{domain:r,isInteger:a}=Me(o)??{domain:null,isInteger:!1};let n="f32";if(r&&a)n=Xt(r[0],r[1]);else if(o===30){const u=e==null?void 0:e[0];n=u?Xt(u.min,u.max):nt(s)?s:"s32"}else if(o===45&&nt(s)){const u=e==null?void 0:e.map(({max:f})=>-f),l=e==null?void 0:e.map(({min:f})=>-f),p=u!=null&&u.length?Math.min(...u):null,h=l!=null&&l.length?Math.min(...l):null;n=p!=null&&h!=null?Xt(p,h):s.startsWith("s")?s.replace("s","u"):s==="u1"||s==="u2"||s==="u4"?"s8":s==="u8"?"s16":"s32"}t.pixelType=this.outputPixelType=this._getOutputPixelType(n)}};c([m({json:{write:!0,name:"rasterFunction"}})],Ft.prototype,"functionName",void 0),c([m({type:Gr,json:{write:!0,name:"rasterFunctionArguments"}})],Ft.prototype,"functionArguments",void 0),c([m()],Ft.prototype,"rasterArgumentNames",void 0),Ft=c([A("esri.layers.support.rasterFunctions.LocalFunction")],Ft);const Er=Ft;var ce;let ht=ce=class extends D{constructor(){super(...arguments),this.includedRanges=null,this.noDataValues=null,this.noDataInterpretation=is.matchAny}get normalizedNoDataValues(){const{noDataValues:i}=this;if(!(i!=null&&i.length))return null;let t=!1;const e=i.map(s=>{if(typeof s=="number")return t=!0,[s];if(typeof s=="string"){const o=s.trim().split(" ").filter(r=>r.trim()!=="").map(r=>Number(r));return t=t||o.length>0,o.length===0?null:o}return null});return t?e:null}clone(){var i,t;return new ce({includedRanges:((i=this.includedRanges)==null?void 0:i.slice())??[],noDataValues:((t=this.noDataValues)==null?void 0:t.slice())??[],noDataInterpretation:this.noDataInterpretation})}};c([m({json:{write:!0}})],ht.prototype,"includedRanges",void 0),c([m({json:{write:!0}})],ht.prototype,"noDataValues",void 0),c([m()],ht.prototype,"normalizedNoDataValues",null),c([m({json:{write:!0}})],ht.prototype,"noDataInterpretation",void 0),ht=ce=c([A("esri.layers.support.rasterFunctions.MaskFunctionArguments")],ht);const zr=ht;let mt=class extends G{constructor(){super(...arguments),this.functionName="Mask",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,this.rasterInfo=t;const{includedRanges:s,normalizedNoDataValues:o}=this.functionArguments;if(!(s!=null&&s.length)&&!(o!=null&&o.length))return{success:!1,supportsGPU:!1,error:"missing includedRanges or noDataValues argument"};let r=[];for(let n=0;n{var u;return(n==null?void 0:n.length)===((u=o[0])==null?void 0:u.length)});return{success:!0,supportsGPU:(!s||s.length<=2*K)&&(!o||a&&o[0].length<=K)}}_processPixels(t){var l;const e=(l=t.pixelBlocks)==null?void 0:l[0];if(e==null)return null;const{outputPixelType:s,lookups:o}=this,{includedRanges:r,noDataInterpretation:a,normalizedNoDataValues:n}=this.functionArguments,u=a===is.matchAll;return $s(e,{includedRanges:r,noDataValues:n,outputPixelType:s,matchAll:u,lookups:o})}_getWebGLParameters(){var r;const{includedRanges:t,normalizedNoDataValues:e}=this.functionArguments,s=new Float32Array(K);s.fill(kt),(r=e==null?void 0:e[0])!=null&&r.length&&s.set(e[0]);const o=new Float32Array(K);for(let a=0;a=o.bandCount)return{success:!1,supportsGPU:!1,error:"ndvi-function: source raster has insufficient amount of raster bands"};const a=o.clone();a.pixelType=this.outputPixelType,a.colormap=null,a.histograms=null,a.bandCount=1,a.keyProperties={...a.keyProperties,BandProperties:void 0};const[n,u,l,p]=t?[-1,1,0,.1]:[0,200,100,10];return a.statistics=[{min:n,max:u,avg:l,stddev:p}],this.rasterInfo=a,{success:!0,supportsGPU:!0}}_processPixels(t){var a;const e=(a=t.pixelBlocks)==null?void 0:a[0];if(e==null)return null;const{visibleBandID:s,infraredBandID:o,scientificOutput:r}=this.functionArguments;return Ln(e,s,o,!r)}_getWebGLParameters(){const{visibleBandID:t,infraredBandID:e,scientificOutput:s}=this.functionArguments,o=this.isInputBandIdsSwizzled?[0,1,2]:[e,t,0];return{bandIndexMat3:z(o),scaled:!s}}_getInputBandIds(t){const{visibleBandID:e,infraredBandID:s}=this.functionArguments;return[s,e,0].map(o=>t[o])}};c([m({json:{write:!0,name:"rasterFunction"}})],It.prototype,"functionName",void 0),c([m({type:Ur,json:{write:!0,name:"rasterFunctionArguments"}})],It.prototype,"functionArguments",void 0),c([m()],It.prototype,"rasterArgumentNames",void 0),It=c([A("esri.layers.support.rasterFunctions.NDVIFunction")],It);const Lr=It;var he;let Q=he=class extends D{constructor(){super(...arguments),this.inputRanges=null,this.outputValues=null,this.noDataRanges=null,this.allowUnmatched=!1,this.isLastInputRangeInclusive=!1}clone(){return new he({inputRanges:[...this.inputRanges],outputValues:[...this.outputValues],noDataRanges:[...this.noDataRanges],allowUnmatched:this.allowUnmatched,isLastInputRangeInclusive:this.isLastInputRangeInclusive})}};c([m({json:{write:!0}})],Q.prototype,"inputRanges",void 0),c([m({json:{write:!0}})],Q.prototype,"outputValues",void 0),c([m({json:{write:!0}})],Q.prototype,"noDataRanges",void 0),c([m({json:{write:!0}})],Q.prototype,"allowUnmatched",void 0),c([m({json:{write:!0}})],Q.prototype,"isLastInputRangeInclusive",void 0),Q=he=c([A("esri.layers.support.rasterFunctions.RemapFunctionArguments")],Q);const Wr=Q;let ft=class extends G{constructor(){super(...arguments),this.functionName="Remap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,t.colormap=null,t.histograms=null,t.bandCount=1,t.attributeTable=null;const{statistics:s}=t,{allowUnmatched:o,outputValues:r,inputRanges:a,noDataRanges:n,isLastInputRangeInclusive:u}=this.functionArguments;if(s!=null&&s.length&&(r!=null&&r.length))if(o){const l=Math.min.apply(null,[...r,s[0].min]),p=Math.max.apply(null,[...r,s[0].max]);t.statistics=[{...s[0],min:l,max:p}]}else{let l=r[0],p=l;for(let h=0;hr[h]?r[h]:l,p=p>r[h]?p:r[h];t.statistics=[{...s[0],min:l,max:p}]}return this.rasterInfo=t,this.lookup=o?null:Fs({srcPixelType:e,inputRanges:a,outputValues:r,noDataRanges:n,allowUnmatched:o,isLastInputRangeInclusive:u,outputPixelType:this.outputPixelType}),{success:!0,supportsGPU:(!r||r.length<=K)&&(!n||n.length<=K)}}_processPixels(t){var p;const e=(p=t.pixelBlocks)==null?void 0:p[0];if(e==null)return null;const{lookup:s,outputPixelType:o}=this;if(s){const h=Fe(e,{lut:[s.lut],offset:s.offset,outputPixelType:o});return h!=null&&s.mask&&(h.mask=Ns(e.pixels[0],e.mask,s.mask,s.offset,"u8")),h}const{inputRanges:r,outputValues:a,noDataRanges:n,allowUnmatched:u,isLastInputRangeInclusive:l}=this.functionArguments;return Is(e,{inputRanges:r,outputValues:a,noDataRanges:n,outputPixelType:o,allowUnmatched:u,isLastInputRangeInclusive:l})}_getWebGLParameters(){const{allowUnmatched:t,noDataRanges:e,isLastInputRangeInclusive:s}=this.functionArguments,o=new Float32Array(3*K),r=1e-5,a=this.functionArguments.inputRanges??[],n=this.functionArguments.outputValues??[],u=n.length;for(let p=0;p0&&(o[3*p]-=r),(p=1?t*Kt:t,slopeType:e,pixelSizeFactor:s??0,pixelSizePower:o??0}}};c([m({json:{write:!0,name:"rasterFunction"}})],dt.prototype,"functionName",void 0),c([m({type:Xr,json:{write:!0,name:"rasterFunctionArguments"}})],dt.prototype,"functionArguments",void 0),c([m()],dt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],dt.prototype,"isGCS",void 0),dt=c([A("esri.layers.support.rasterFunctions.SlopeFunction")],dt);const Jr=dt,ts=new jt({1:"min",2:"max",3:"mean",4:"stddev",5:"median",6:"majority",7:"minority"},{useNumericKeys:!0});function Kr(i,t){const{fillNoDataOnly:e}=t,{band:s,width:o,height:r,mask:a,outBand:n}=i;if(e&&!a)return void n.set(s);const{statisticsType:u,kernelRows:l,kernelCols:p}=t,h=u==="stddev",f=o*r,g=new Float64Array(f),x=new Float64Array(f),y=new Uint32Array(f);for(let F=0;Fv-R),a?(f[y+d]=b[Math.floor((b.length-1)/2)],g[y+d]=b.length):n[y+d]=b[Math.floor((b.length-1)/2)])}}if(a)for(let x=p;xF&&(F=E,N=P);a?(x[b+v]=N,y[b+v]=R.size):n[b+v]=N}}if(a)for(let d=p;d1&&(n!=null&&n.length)&&(v=w.combineBandMasks(n));const R=new w({pixelType:d,width:r,height:a,pixels:h,bandMasks:n&&b.length?b:null,mask:v});return R.updateStatistics(),R}var fe;let gt=fe=class extends D{constructor(){super(...arguments),this.rows=3,this.cols=3,this.fillNoDataOnly=!1,this.statisticsType="min"}clone(){return new fe({rows:this.rows,cols:this.cols,fillNoDataOnly:this.fillNoDataOnly,statisticsType:this.statisticsType,raster:L(this.raster)})}};c([m({json:{write:!0,read:{source:["kernelRows","rows"],reader:(i,t)=>Number(i??(t==null?void 0:t.kernelRows)??3)}}})],gt.prototype,"rows",void 0),c([m({json:{write:!0,read:{source:["kernelCols","cols"],reader:(i,t)=>Number(i??(t==null?void 0:t.kernelCols)??3)}}})],gt.prototype,"cols",void 0),c([m({json:{write:!0}})],gt.prototype,"fillNoDataOnly",void 0),c([m({json:{read:{source:["statisticsType","type"],reader:(i,t)=>ts.fromJSON((t==null?void 0:t.statisticsType)??(t==null?void 0:t.type))??"min"},write:{target:"type"}}}),Y(ts)],gt.prototype,"statisticsType",void 0),gt=fe=c([A("esri.layers.support.rasterFunctions.StatisticsFunctionArguments")],gt);const eo=gt;let Rt=class extends G{constructor(){super(...arguments),this.functionName="Statistics",this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{type:t}=this.functionArguments.toJSON();if(t<1||t>7)return{success:!1,supportsGPU:!1,error:`statistics-function: the given statistics type is not supported ${t}`};const e=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const s=e.clone();s.pixelType=this.outputPixelType;const{statisticsType:o}=this.functionArguments;return o==="stddev"&&this._removeStatsHistColormapVAT(s),this.rasterInfo=s,{success:!0,supportsGPU:s.bandCount<=3&&t<5}}_processPixels(t){var n;const e=(n=t.pixelBlocks)==null?void 0:n[0];if(e==null)return e;const{statisticsType:s,rows:o,cols:r,fillNoDataOnly:a}=this.functionArguments;return to(e,{kernelRows:o,kernelCols:r,fillNoDataOnly:a,outputPixelType:this.outputPixelType,statisticsType:s,mirrorEdges:!0})}_getWebGLParameters(){const{rows:t,cols:e,statisticsType:s,fillNoDataOnly:o}=this.functionArguments;return{fillNoDataOnly:o,kernelRows:t,kernelCols:e,statisticsType:s,clampRange:vt(this.outputPixelType)}}};c([m({json:{write:!0,name:"rasterFunction"}})],Rt.prototype,"functionName",void 0),c([m({type:eo,json:{write:!0,name:"rasterFunctionArguments"}})],Rt.prototype,"functionArguments",void 0),c([m()],Rt.prototype,"rasterArgumentNames",void 0),Rt=c([A("esri.layers.support.rasterFunctions.StatisticsFunction")],Rt);const so=Rt;var de;let yt=de=class extends D{constructor(){super(...arguments),this.statistics=null,this.histograms=null}readStatistics(i,t){if(!(i!=null&&i.length))return null;const e=[];return i.forEach(s=>{const o={min:s.min,max:s.max,avg:s.avg??s.mean,stddev:s.stddev??s.standardDeviation};e.push(o)}),e}writeStatistics(i,t,e){if(!(i!=null&&i.length))return;const s=[];i.forEach(o=>{const r={...o,mean:o.avg,standardDeviation:o.stddev};delete r.avg,delete r.stddev,s.push(r)}),t[e]=s}clone(){return new de({statistics:L(this.statistics),histograms:L(this.histograms)})}};c([m({json:{write:!0}})],yt.prototype,"statistics",void 0),c([Ct("statistics")],yt.prototype,"readStatistics",null),c([_t("statistics")],yt.prototype,"writeStatistics",null),c([m({json:{write:!0}})],yt.prototype,"histograms",void 0),yt=de=c([A("esri.layers.support.rasterFunctions.StatisticsHistogramFunctionArguments")],yt);const no=yt;let et=class extends G{constructor(){super(...arguments),this.functionName="StatisticsHistogram",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType("u8");const e=t.clone(),{statistics:s,histograms:o}=this.functionArguments;return o&&(e.histograms=o),s&&(e.statistics=s),this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){var e;return(e=t.pixelBlocks)==null?void 0:e[0]}};c([m({json:{write:!0,name:"rasterFunction"}})],et.prototype,"functionName",void 0),c([m({type:no,json:{write:!0,name:"rasterFunctionArguments"}})],et.prototype,"functionArguments",void 0),c([m()],et.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],et.prototype,"indexedColormap",void 0),c([m()],et.prototype,"isNoopProcess",void 0),et=c([A("esri.layers.support.rasterFunctions.StatisticsHistogramFunction")],et);const ro=et;var ge;const oo=new jt({0:"none",3:"standard-deviation",4:"histogram-equalization",5:"min-max",6:"percent-clip",9:"sigmoid"},{useNumericKeys:!0});let V=ge=class extends D{constructor(){super(...arguments),this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.histograms=null,this.statistics=null,this.stretchType="none",this.useGamma=!1}writeStatistics(i,t,e){i!=null&&i.length&&(Array.isArray(i[0])||(i=i.map(s=>[s.min,s.max,s.avg,s.stddev])),t[e]=i)}clone(){return new ge({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:L(this.statistics),gamma:L(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,histograms:L(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment,raster:this.raster})}};c([m({type:Boolean,json:{write:!0}})],V.prototype,"computeGamma",void 0),c([m({type:Boolean,json:{name:"dra",write:!0}})],V.prototype,"dynamicRangeAdjustment",void 0),c([m({type:[Number],json:{write:!0}})],V.prototype,"gamma",void 0),c([m()],V.prototype,"histograms",void 0),c([m({type:Number,json:{write:!0}})],V.prototype,"maxPercent",void 0),c([m({type:Number,json:{write:!0}})],V.prototype,"minPercent",void 0),c([m({type:Number,json:{write:!0}})],V.prototype,"numberOfStandardDeviations",void 0),c([m({type:Number,json:{name:"max",write:!0}})],V.prototype,"outputMax",void 0),c([m({type:Number,json:{name:"min",write:!0}})],V.prototype,"outputMin",void 0),c([m({type:Number,json:{write:!0}})],V.prototype,"sigmoidStrengthLevel",void 0),c([m({json:{type:[[Number]],write:!0}})],V.prototype,"statistics",void 0),c([_t("statistics")],V.prototype,"writeStatistics",null),c([Y(oo)],V.prototype,"stretchType",void 0),c([m({type:Boolean,json:{write:!0}})],V.prototype,"useGamma",void 0),V=ge=c([A("esri.layers.support.rasterFunctions.StretchFunctionArguments")],V);const io=V;let st=class extends G{constructor(){super(...arguments),this.functionName="Stretch",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null,this.cutOffs=null}_bindSourceRasters(){this.lookup=null,this.cutOffs=null;const t=this.sourceRasterInfos[0],{pixelType:e}=t,{functionArguments:s}=this,{dynamicRangeAdjustment:o,gamma:r,useGamma:a}=s;if(!o&&["u8","u16","s8","s16"].includes(e)){const u=Jt(s.toJSON(),{rasterInfo:t}),l=nt(this.outputPixelType)?"round":"float";this.lookup=Ms({pixelType:e,...u,gamma:a?r:null,rounding:l}),this.cutOffs=u}else o||(this.cutOffs=Jt(s.toJSON(),{rasterInfo:t}));this.outputPixelType=this._getOutputPixelType(e);const n=t.clone();return n.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(n),this.outputPixelType==="u8"&&(n.keyProperties.DataType="processed"),this.rasterInfo=n,{success:!0,supportsGPU:!o}}_processPixels(t){var n;const e=(n=t.pixelBlocks)==null?void 0:n[0];if(e==null)return e;const{lookup:s}=this;if(s)return Fe(e,{...s,outputPixelType:this.rasterInfo.pixelType});const{functionArguments:o}=this,r=this.cutOffs||Jt(o.toJSON(),{rasterInfo:this.sourceRasterInfos[0],pixelBlock:e}),a=o.useGamma?o.gamma:null;return Os(e,{...r,gamma:a,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const{outputMin:t=0,outputMax:e=255,gamma:s,useGamma:o}=this.functionArguments,r=this.rasterInfo.bandCount>=2?3:1,a=o&&(s!=null&&s.length)?Ds(r,s):[1,1,1],{minCutOff:n,maxCutOff:u}=this.cutOffs??{minCutOff:[0,0,0],maxCutOff:[255,255,255]};n.length===1&&(n[1]=n[2]=n[0],u[1]=u[2]=u[0]);const l=new Float32Array(r);let p;for(p=0;p1||t.pixelType.startsWith("f"))return{success:!1,supportsGPU:!1,error:"table-function: Source data must be single band and integer pixel type."};const{attributeTableAsRecordSet:e}=this.functionArguments;if(!e)return{success:!1,supportsGPU:!1,error:"table-function: Missing attributeTableAsRecordSet argument."};this.outputPixelType=this._getOutputPixelType(t.pixelType);const s=t.clone();return s.pixelType=this.outputPixelType,s.bandCount=1,s.dataType!=="thematic"&&(s.keyProperties=s.keyProperties?{...s.keyProperties,DataType:"thematic"}:{DataType:"thematic"}),this.rasterInfo=s,{success:!0,supportsGPU:!0}}_processPixels(t){var e;return(e=t.pixelBlocks)==null?void 0:e[0]}};c([m({json:{write:!0,name:"rasterFunction"}})],xt.prototype,"functionName",void 0),c([m({type:uo,json:{write:!0,name:"rasterFunctionArguments"}})],xt.prototype,"functionArguments",void 0),c([m()],xt.prototype,"rasterArgumentNames",void 0),c([m()],xt.prototype,"isNoopProcess",void 0),xt=c([A("esri.layers.support.rasterFunctions.TableFunction")],xt);const lo=xt,M=new Map;function co(i,t){const{rasterFunctionArguments:e}=i;e&&(e.rasters||[e.raster]).forEach(s=>{s&&typeof s!="number"&&(typeof s=="string"?s.startsWith("http")&&(t.includes(s)||t.push(s)):"rasterFunctionArguments"in s&&co(s,t))})}function Xo(i,t){if(t=t??{},"function"in(i=L(i))&&"arguments"in i&&i.arguments){const e=gs(i,new Map,t);if(we(e),!e.renderingRule)throw new Bt("raster-function-helper","Unsupported raster function json.");i=e.renderingRule}if("rasterFunction"in i)return fs(i=xe(i),t);throw new Bt("raster-function-helper","unsupported raster function json.")}function po(i,t){return t[0]==="rasters"&&Array.isArray(i.rasters)?i.rasters:t.map(e=>i[e])}function es(i){return!!(i&&typeof i=="object"&&i.rasterFunction&&i.rasterFunctionArguments)}function xe(i){var o;const{rasterFunction:t,rasterFunctionArguments:e}=i,s={};for(const r in e){let a=e[r];const n=r.toLowerCase();if(n==="rasters"&&Array.isArray(a))s.rasters=a.map(u=>es(u)?xe(u):u);else switch(es(a)&&(a=xe(a)),n){case"dra":s.dra=a;break;case"pspower":s.psPower=a;break;case"pszfactor":s.psZFactor=a;break;case"bandids":s.bandIds=a;break;default:s[r[0].toLowerCase()+r.slice(1)]=a}}return t!=="Local"||(o=s.rasters)!=null&&o.length||(s.rasters=["$$"]),{...i,rasterFunctionArguments:s}}function fs(i,t){var f,g;const{rasterFunction:e,rasterFunctionArguments:s}=i,o=(f=i.outputPixelType)==null?void 0:f.toLowerCase();if(e==null||!M.has(e))throw new Bt("raster-function-helper",`unsupported raster function: ${e}`);const r=M.get(e),a=(typeof r.ctor=="function"?r.ctor:r.ctor.default).fromJSON({...i,outputPixelType:o}),{rasterArgumentNames:n}=a,u=[],l=po(s,n),p=n[0]==="rasters",h=[];for(let x=0;xtypeof r=="object"&&r.type==="RasterFunctionVariable"?ve(r,t):r);if("value"in e&&["number","string","boolean"].includes(typeof e.value))return e.value;if(i.isDataset&&e.type!=="Scalar")return"$$";if(!("type"in e))return e;let s=e;switch(e.type){case"Scalar":s=e.value;break;case"AlgorithmicColorRamp":s=ss(e);break;case"MultiPartColorRamp":s={type:"multipart",colorRamps:e.ArrayOfColorRamp.map(ss)};break;case"ArgumentArray":if((o=e.elements)!=null&&o.length&&e.elements[0].type!=="RasterStatistics"){const r=[];for(let a=0;a{if(typeof n=="object")if(n._object_ref_id!=null){if(!e.has(n._object_ref_id))throw new Bt("raster-function-helper",`unsupported raster function json. _object_ref_id: ${r} does not exist`);const l=e.get(a);l&&typeof l=="object"?Object.assign(n,l):r[u]=l}else we({renderingRule:n,templates:e})}));else{if(!e.has(a))throw new Bt("raster-function-helper",`unsupported raster function json. _object_ref_id: ${a} does not exist`);const n=e.get(a);o!=="_object_ref_id"?s[o]=n:n&&typeof n=="object"&&Object.assign(s,n)}}}function ho(i){var t;(t=i.Statistics)!=null&&t.length&&typeof i.Statistics=="object"&&(i.Statistics=i.Statistics.map(e=>[e.min,e.max,e.mean,e.standardDeviation])),i.NumberOfStandardDeviation!=null&&(i.NumberOfStandardDeviations=i.NumberOfStandardDeviation,delete i.NumberOfStandardDeviation)}function mo(i){var t,e;((e=(t=i.ColorRamp)==null?void 0:t.type)==null?void 0:e.toLowerCase())==="randomcolorramp"&&(delete i.ColorRamp,i.ColormapName="Random"),i.ColorSchemeType===0&&delete i.ColorRamp}function fo(i){i.ConvolutionType!=null&&(i.Type=i.ConvolutionType,delete i.ConvolutionType)}function go(i){var t;(t=i.NoDataValues)!=null&&t.length&&typeof i.NoDataValues[0]=="string"&&(i.NoDataValues=i.NoDataValues.filter(e=>e!=="").map(e=>Number(e)))}M.set("Arithmetic",{desc:"Arithmetic Function",ctor:Bn,rasterArgumentNames:["rasters"]}),M.set("Aspect",{desc:"Aspect Function",ctor:Sn,rasterArgumentNames:["raster"]}),M.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:ur,rasterArgumentNames:["raster"]}),M.set("Colormap",{desc:"Colormap Function",ctor:wr,rasterArgumentNames:["raster"]}),M.set("CompositeBand",{desc:"CompositeBand Function",ctor:Ar,rasterArgumentNames:["rasters"]}),M.set("Convolution",{desc:"Convolution Function",ctor:Cr,rasterArgumentNames:["raster"]}),M.set("ContrastBrightness",{desc:"Contrast Brightness Function",ctor:Pr,rasterArgumentNames:["raster"]}),M.set("ExtractBand",{desc:"ExtractBand Function",ctor:Sr,rasterArgumentNames:["raster"]}),M.set("Curvature",{desc:"Curvature Function",ctor:Br,rasterArgumentNames:["raster"]}),M.set("Grayscale",{desc:"Grayscale Function",ctor:Dr,rasterArgumentNames:["raster"]}),M.set("Clip",{desc:"Clip Function",ctor:cr,rasterArgumentNames:["raster"]}),M.set("Local",{desc:"Local Function",ctor:Er,rasterArgumentNames:["rasters"]}),M.set("Mask",{desc:"Mask Function",ctor:Vr,rasterArgumentNames:["raster"]}),M.set("NDVI",{desc:"NDVI Function",ctor:Lr,rasterArgumentNames:["raster"]}),M.set("Remap",{desc:"Remap Function",ctor:qr,rasterArgumentNames:["raster"]}),M.set("Slope",{desc:"Slope Function",ctor:Jr,rasterArgumentNames:["raster"]}),M.set("Statistics",{desc:"Focal Statistics Function",ctor:so,rasterArgumentNames:["raster"]}),M.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:ro,rasterArgumentNames:["raster"]}),M.set("Stretch",{desc:"Stretch Function",ctor:ao,rasterArgumentNames:["raster"]}),M.set("Table",{desc:"Attribute Table Function",ctor:lo,rasterArgumentNames:["raster"]});let Et=class extends $e{get affectsPixelSize(){return!1}forwardTransform(i){return i}inverseTransform(i){return i}};c([m()],Et.prototype,"affectsPixelSize",null),c([m({json:{write:!0}})],Et.prototype,"spatialReference",void 0),Et=c([A("esri.layers.support.rasterTransforms.BaseRasterTransform")],Et);const Ce=Et;var be;let zt=be=class extends Ce{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(i){return(i=i.clone()).type==="point"?(i.x>180+this.tolerance&&(i.x-=360),i):(i.xmin>=180-this.tolerance?(i.xmax-=360,i.xmin-=360):i.xmax>180+this.tolerance&&(i.xmin=-180,i.xmax=180),i)}inverseTransform(i){return(i=i.clone()).type==="point"?(i.x<-this.tolerance&&(i.x+=360),i):(i.xmin<-this.tolerance&&(i.xmin+=360,i.xmax+=360),i)}clone(){return new be({tolerance:this.tolerance})}};c([Y({GCSShiftXform:"gcs-shift"})],zt.prototype,"type",void 0),c([m()],zt.prototype,"tolerance",void 0),zt=be=c([A("esri.layers.support.rasterTransforms.GCSShiftTransform")],zt);const yo=zt;var Ae;let qt=Ae=class extends Ce{constructor(){super(...arguments),this.type="identity"}clone(){return new Ae}};c([Y({IdentityXform:"identity"})],qt.prototype,"type",void 0),qt=Ae=c([A("esri.layers.support.rasterTransforms.IdentityTransform")],qt);const xo=qt;var Te;function Pe(i,t,e){const{x:s,y:o}=t;if(e<2)return{x:i[0]+s*i[2]+o*i[4],y:i[1]+s*i[3]+o*i[5]};if(e===2){const f=s*s,g=o*o,x=s*o;return{x:i[0]+s*i[2]+o*i[4]+f*i[6]+x*i[8]+g*i[10],y:i[1]+s*i[3]+o*i[5]+f*i[7]+x*i[9]+g*i[11]}}const r=s*s,a=o*o,n=s*o,u=r*s,l=r*o,p=s*a,h=o*a;return{x:i[0]+s*i[2]+o*i[4]+r*i[6]+n*i[8]+a*i[10]+u*i[12]+l*i[14]+p*i[16]+h*i[18],y:i[1]+s*i[3]+o*i[5]+r*i[7]+n*i[9]+a*i[11]+u*i[13]+l*i[15]+p*i[17]+h*i[19]}}function ns(i,t,e){const{xmin:s,ymin:o,xmax:r,ymax:a,spatialReference:n}=t;let u=[];if(e<2)u.push({x:s,y:a}),u.push({x:r,y:a}),u.push({x:s,y:o}),u.push({x:r,y:o});else{let h=10;for(let f=0;fPe(i,h,e));const l=u.map(h=>h.x),p=u.map(h=>h.y);return new bs({xmin:Math.min.apply(null,l),xmax:Math.max.apply(null,l),ymin:Math.min.apply(null,p),ymax:Math.max.apply(null,p),spatialReference:n})}function vo(i){const[t,e,s,o,r,a]=i,n=s*a-r*o,u=r*o-s*a;return[(r*e-t*a)/n,(s*e-t*o)/u,a/n,o/u,-r/n,-s/u]}let q=Te=class extends Ce{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(i,t){const{coeffX:e,coeffY:s}=t;if(!(e!=null&&e.length)||!(s!=null&&s.length)||e.length!==s.length)return null;const o=[];for(let r=0;r0}forwardTransform(i){if(i.type==="point"){const t=Pe(this.forwardCoefficients,i,this.polynomialOrder);return new Be({x:t.x,y:t.y,spatialReference:i.spatialReference})}return ns(this.forwardCoefficients,i,this.polynomialOrder)}inverseTransform(i){if(i.type==="point"){const t=Pe(this.inverseCoefficients,i,this.polynomialOrder);return new Be({x:t.x,y:t.y,spatialReference:i.spatialReference})}return ns(this.inverseCoefficients,i,this.polynomialOrder)}clone(){return new Te({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};c([m({json:{write:!0}})],q.prototype,"polynomialOrder",void 0),c([m()],q.prototype,"forwardCoefficients",void 0),c([Ct("forwardCoefficients",["coeffX","coeffY"])],q.prototype,"readForwardCoefficients",null),c([_t("forwardCoefficients")],q.prototype,"writeForwardCoefficients",null),c([m({json:{write:!0}})],q.prototype,"inverseCoefficients",null),c([Ct("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],q.prototype,"readInverseCoefficients",null),c([_t("inverseCoefficients")],q.prototype,"writeInverseCoefficients",null),c([m()],q.prototype,"affectsPixelSize",null),c([Y({PolynomialXform:"polynomial"})],q.prototype,"type",void 0),q=Te=c([A("esri.layers.support.rasterTransforms.PolynomialTransform")],q);const wo=q,xs={GCSShiftXform:yo,IdentityXform:xo,PolynomialXform:wo},bo=Object.keys(xs);function Jo(i){const t=i==null?void 0:i.type;return!i||bo.includes(t)}function Ko(i){if(!(i==null?void 0:i.type))return null;const e=xs[i==null?void 0:i.type];if(e){const s=new e;return s.read(i),s}return null}export{co as N,Xo as R,yo as c,Jo as f,Ko as i,wo as y}; diff --git a/assets/utils-GMt8_G3w.js b/assets/utils-CY1ReiSd.js similarity index 98% rename from assets/utils-GMt8_G3w.js rename to assets/utils-CY1ReiSd.js index 8862a93..dbb7dc1 100644 --- a/assets/utils-GMt8_G3w.js +++ b/assets/utils-CY1ReiSd.js @@ -1 +1 @@ -import{d as N}from"./ClassBreaksDefinition-D281x8Sj.js";import{s as k}from"./index-CEWggaxV.js";const q=()=>k.getLogger("esri.rest.support.generateRendererUtils");function g(t,e){return Number(t.toFixed(e))}function C(t){const{normalizationTotal:e}=t;return{classBreaks:w(t),normalizationTotal:e}}function w(t){const e=t.definition,{classificationMethod:l,normalizationType:n,definedInterval:u}=e,i=e.breakCount??1,c=[];let o=t.values;if(o.length===0)return[];o=o.sort((m,d)=>m-d);const f=o[0],p=o[o.length-1];if(l==="equal-interval")if(o.length>=i){const m=(p-f)/i;let d=f;for(let r=1;r{c.push({minValue:m,maxValue:m,label:b(m,m,n)})});else if(l==="natural-breaks"){const m=E(o),d=t.valueFrequency||m.valueFrequency,r=B(m.uniqueValues,d,i);let a=f;for(let s=1;ss){const h=g(m.uniqueValues[r[s]],6);c.push({minValue:a,maxValue:h,label:b(a,h,n)}),a=h}c.push({minValue:a,maxValue:p,label:b(a,p,n)})}else if(l==="quantile")if(o.length>=i&&f!==p){let m=f,d=Math.ceil(o.length/i),r=0;for(let a=1;ao.length&&(s=o.length-1),s<0&&(s=0),c.push({minValue:m,maxValue:o[s],label:b(m,o[s],n)}),m=o[s],r+=d,d=Math.ceil((o.length-r)/(i-a))}c.push({minValue:m,maxValue:p,label:b(m,p,n)})}else{let m=-1;for(let d=0;d=1;V--){const F=g(m-(V-.5)*r,6);c.push({minValue:s,maxValue:F,label:b(s,F,n)}),s=F,a++}let h=g(m+.5*r,6);c.push({minValue:s,maxValue:h,label:b(s,h,n)}),s=h,a++;for(let V=1;V<=i;V++)h=a===2*i?p:g(m+(V+.5)*r,6),c.push({minValue:s,maxValue:h,label:b(s,h,n)}),s=h,a++}}else if(l==="defined-interval"){if(!u)return c;const m=o[0],d=o[o.length-1],r=Math.ceil((d-m)/u);let a=m;for(let s=1;sn&&(l=n);for(let c=0;c0&&s!==t[a+1]&&Math.abs(m-f[a])>Math.abs(m-f[a-1]))t[a]=s;else if(aMath.abs(m-f[a+1])){t[a+1]=s-1;break}d=o,o=0,i=[],c=[];for(let a=0;ad){for(let a=0;a0;r--)for(;l[r]!==l[r-1]+1;){l[r]=l[r]-1;const a=v(r-1,l,n,u);f=a.sbMean,c=a.sbSdcm;const s=v(r,l,n,u);if(p=s.sbMean,o=s.sbSdcm,!(c+o=1?1:i>=.5?.5:.25,i}function P(t){let e=0;for(let l=0;li!=null).sort(),n=l.length,u={count:n,min:l[0],max:l[n-1]};return t.supportsNullCount&&(u.nullcount=e.length-n),t.percentileParams&&(u.median=$(e,t.percentileParams)),u}function W(t){const{values:e,useSampleStdDev:l,supportsNullCount:n}=t;let u=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,c=null,o=null,f=null,p=null,m=0;const d=t.minValue==null?-1/0:t.minValue,r=t.maxValue==null?1/0:t.maxValue;for(const s of e)Number.isFinite(s)?s>=d&&s<=r&&(c=c===null?s:c+s,u=Math.min(u,s),i=Math.max(i,s),m++):typeof s=="string"&&m++;if(m&&c!=null){o=c/m;let s=0;for(const h of e)Number.isFinite(h)&&h>=d&&h<=r&&(s+=(h-o)**2);p=l?m>1?s/(m-1):0:m>0?s/m:0,f=Math.sqrt(p)}else u=null,i=null;const a={avg:o,count:m,max:i,min:u,stddev:f,sum:c,variance:p};return n&&(a.nullcount=e.length-m),t.percentileParams&&(a.median=$(e,t.percentileParams)),a}function $(t,e){const{fieldType:l,value:n,orderBy:u,isDiscrete:i}=e,c=X(l,u==="desc");if((t=[...t].filter(a=>a!=null).sort((a,s)=>c(a,s))).length===0)return null;if(n<=0)return t[0];if(n>=1)return t[t.length-1];const o=(t.length-1)*n,f=Math.floor(o),p=f+1,m=o%1,d=t[f],r=t[p];return p>=t.length||i||typeof d=="string"||typeof r=="string"?d:d*(1-m)+r*m}function X(t,e){if(t){if(R.has(t))return S(e);if(H.has(t))return M(e,!1);if(t==="esriFieldTypeTimestampOffset")return lt(e);const i=M(e,!0);if(t==="esriFieldTypeString")return i;if(t==="esriFieldTypeGUID"||t==="esriFieldTypeGlobalID")return(c,o)=>i(I(c),I(o))}const l=e?1:-1,n=S(e),u=M(e,!0);return(i,c)=>typeof i=="number"&&typeof c=="number"?n(i,c):typeof i=="string"&&typeof c=="string"?u(i,c):l}const T=(t,e)=>t==null?e==null?0:1:e==null?-1:null,y=(t,e)=>t==null?e==null?0:-1:e==null?1:null;function Z(t){return t?T:y}const tt=(t,e)=>y(t,e)??(t===e?0:new Date(t).getTime()-new Date(e).getTime()),et=(t,e)=>T(t,e)??(t===e?0:new Date(e).getTime()-new Date(t).getTime());function lt(t){return t?et:tt}const nt=(t,e)=>y(t,e)??(t===e?0:tT(t,e)??(t===e?0:t{const i=l(n,u);return i??((n=n.toUpperCase())>(u=u.toUpperCase())?-1:n{const i=l(n,u);return i??((n=n.toUpperCase())<(u=u.toUpperCase())?-1:n>u?1:0)}}const it=(t,e)=>T(t,e)??e-t,ut=(t,e)=>y(t,e)??t-e;function S(t){return t?it:ut}function I(t){return t.substr(24,12)+t.substr(19,4)+t.substr(16,2)+t.substr(14,2)+t.substr(11,2)+t.substr(9,2)+t.substr(6,2)+t.substr(4,2)+t.substr(2,2)+t.substr(0,2)}function bt(t,e){let l;for(l in t)J.includes(l)&&(Number.isFinite(t[l])||(t[l]=null));return e&&["avg","stddev","variance"].forEach(n=>{t[n]!=null&&(t[n]=Math.ceil(t[n]??0))}),t}function Vt(t){const e={};for(let l of t)(l==null||typeof l=="string"&&l.trim()==="")&&(l=null),e[l]==null?e[l]={count:1,data:l}:e[l].count++;return{count:e}}function z(t){return(t==null?void 0:t.type)!=="coded-value"?[]:t.codedValues.map(e=>e.code)}function gt(t,e,l,n){const u=t.count,i=[];if(l&&e){const c=[],o=z(e[0]);for(const f of o)if(e[1]){const p=z(e[1]);for(const m of p)if(e[2]){const d=z(e[2]);for(const r of d)c.push(`${x(f)}${n}${x(m)}${n}${x(r)}`)}else c.push(`${x(f)}${n}${x(m)}`)}else c.push(f);for(const f of c)u.hasOwnProperty(f)||(u[f]={data:f,count:0})}for(const c in u){const o=u[c];i.push({value:o.data,count:o.count,label:o.label})}return{uniqueValueInfos:i}}function vt(t,e,l,n){let u=null;switch(e){case"log":t!==0&&(u=Math.log(t)*Math.LOG10E);break;case"percent-of-total":Number.isFinite(n)&&n!==0&&(u=t/n*100);break;case"field":Number.isFinite(l)&&l!==0&&(u=t/l);break;case"natural-log":t>0&&(u=Math.log(t));break;case"square-root":t>0&&(u=t**.5)}return u}function ot(t,e){const l=st({field:e.field,normalizationType:e.normalizationType,normalizationField:e.normalizationField,classificationMethod:e.classificationMethod,standardDeviationInterval:e.standardDeviationInterval,breakCount:e.numClasses||Y});return t=rt(t,e.minValue,e.maxValue),C({definition:l,values:t,normalizationTotal:e.normalizationTotal})}function rt(t,e,l){const n=e??-1/0,u=l??1/0;return t.filter(i=>Number.isFinite(i)&&i>=n&&i<=u)}function st(t){const{breakCount:e,field:l,normalizationField:n,normalizationType:u}=t,i=t.classificationMethod||A,c=i==="standard-deviation"?t.standardDeviationInterval||_:void 0;return new N({breakCount:e,classificationField:l,classificationMethod:i,normalizationField:u==="field"?n:void 0,normalizationType:u,standardDeviationInterval:c})}function xt(t,e){var f,p;let l=t.classBreaks;const n=l.length,u=(f=l[0])==null?void 0:f.minValue,i=(p=l[n-1])==null?void 0:p.maxValue,c=e==="standard-deviation",o=Q;return l=l.map(m=>{const d=m.label,r={minValue:m.minValue,maxValue:m.maxValue,label:d};if(c&&d){const a=d.match(o),s=(a==null?void 0:a.map(h=>+h.trim()))??[];s.length===2?(r.minStdDev=s[0],r.maxStdDev=s[1],s[0]<0&&s[1]>0&&(r.hasAvg=!0)):s.length===1&&(d.includes("<")?(r.minStdDev=null,r.maxStdDev=s[0]):d.includes(">")&&(r.minStdDev=s[0],r.maxStdDev=null))}return r}),{minValue:u,maxValue:i,classBreakInfos:l,normalizationTotal:t.normalizationTotal}}function Tt(t,e){const l=ct(t,e);if(l.min==null&&l.max==null)return{bins:[],minValue:l.min,maxValue:l.max,normalizationTotal:e.normalizationTotal};const n=l.intervals,u=l.min??0,i=l.max??0,c=n.map((o,f)=>({minValue:n[f][0],maxValue:n[f][1],count:0}));for(const o of t)if(o!=null&&o>=u&&o<=i){const f=mt(n,o);f>-1&&c[f].count++}return{bins:c,minValue:u,maxValue:i,normalizationTotal:e.normalizationTotal}}function ct(t,e){const{field:l,classificationMethod:n,standardDeviationInterval:u,normalizationType:i,normalizationField:c,normalizationTotal:o,minValue:f,maxValue:p}=e,m=e.numBins||j;let d=null,r=null,a=null;if((!n||n==="equal-interval")&&!i){if(f!=null&&p!=null)d=f,r=p;else{const s=W({values:t,minValue:f,maxValue:p,useSampleStdDev:!i,supportsNullCount:K({normalizationType:i,normalizationField:c,minValue:f,maxValue:p})});d=s.min??null,r=s.max??null}a=ft(d??0,r??0,m)}else{const{classBreaks:s}=ot(t,{field:l,normalizationType:i,normalizationField:c,normalizationTotal:o,classificationMethod:n,standardDeviationInterval:u,minValue:f,maxValue:p,numClasses:m});d=s[0].minValue,r=s[s.length-1].maxValue,a=s.map(h=>[h.minValue,h.maxValue])}return{min:d,max:r,intervals:a}}function mt(t,e){let l=-1;for(let n=t.length-1;n>=0;n--)if(e>=t[n][0]){l=n;break}return l}function ft(t,e,l){const n=(e-t)/l,u=[];let i,c=t;for(let o=1;o<=l;o++)i=c+n,i=Number(i.toFixed(16)),u.push([c,o===l?e:i]),c=i;return u}export{gt as $,vt as B,bt as C,ot as E,xt as P,X as T,Tt as U,x as c,ht as d,K as f,Vt as k,W as p,$ as v}; +import{d as N}from"./ClassBreaksDefinition-Djcxa8Lp.js";import{s as k}from"./index-BjUNJPVf.js";const q=()=>k.getLogger("esri.rest.support.generateRendererUtils");function g(t,e){return Number(t.toFixed(e))}function C(t){const{normalizationTotal:e}=t;return{classBreaks:w(t),normalizationTotal:e}}function w(t){const e=t.definition,{classificationMethod:l,normalizationType:n,definedInterval:u}=e,i=e.breakCount??1,c=[];let o=t.values;if(o.length===0)return[];o=o.sort((m,d)=>m-d);const f=o[0],p=o[o.length-1];if(l==="equal-interval")if(o.length>=i){const m=(p-f)/i;let d=f;for(let r=1;r{c.push({minValue:m,maxValue:m,label:b(m,m,n)})});else if(l==="natural-breaks"){const m=E(o),d=t.valueFrequency||m.valueFrequency,r=B(m.uniqueValues,d,i);let a=f;for(let s=1;ss){const h=g(m.uniqueValues[r[s]],6);c.push({minValue:a,maxValue:h,label:b(a,h,n)}),a=h}c.push({minValue:a,maxValue:p,label:b(a,p,n)})}else if(l==="quantile")if(o.length>=i&&f!==p){let m=f,d=Math.ceil(o.length/i),r=0;for(let a=1;ao.length&&(s=o.length-1),s<0&&(s=0),c.push({minValue:m,maxValue:o[s],label:b(m,o[s],n)}),m=o[s],r+=d,d=Math.ceil((o.length-r)/(i-a))}c.push({minValue:m,maxValue:p,label:b(m,p,n)})}else{let m=-1;for(let d=0;d=1;V--){const F=g(m-(V-.5)*r,6);c.push({minValue:s,maxValue:F,label:b(s,F,n)}),s=F,a++}let h=g(m+.5*r,6);c.push({minValue:s,maxValue:h,label:b(s,h,n)}),s=h,a++;for(let V=1;V<=i;V++)h=a===2*i?p:g(m+(V+.5)*r,6),c.push({minValue:s,maxValue:h,label:b(s,h,n)}),s=h,a++}}else if(l==="defined-interval"){if(!u)return c;const m=o[0],d=o[o.length-1],r=Math.ceil((d-m)/u);let a=m;for(let s=1;sn&&(l=n);for(let c=0;c0&&s!==t[a+1]&&Math.abs(m-f[a])>Math.abs(m-f[a-1]))t[a]=s;else if(aMath.abs(m-f[a+1])){t[a+1]=s-1;break}d=o,o=0,i=[],c=[];for(let a=0;ad){for(let a=0;a0;r--)for(;l[r]!==l[r-1]+1;){l[r]=l[r]-1;const a=v(r-1,l,n,u);f=a.sbMean,c=a.sbSdcm;const s=v(r,l,n,u);if(p=s.sbMean,o=s.sbSdcm,!(c+o=1?1:i>=.5?.5:.25,i}function P(t){let e=0;for(let l=0;li!=null).sort(),n=l.length,u={count:n,min:l[0],max:l[n-1]};return t.supportsNullCount&&(u.nullcount=e.length-n),t.percentileParams&&(u.median=$(e,t.percentileParams)),u}function W(t){const{values:e,useSampleStdDev:l,supportsNullCount:n}=t;let u=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,c=null,o=null,f=null,p=null,m=0;const d=t.minValue==null?-1/0:t.minValue,r=t.maxValue==null?1/0:t.maxValue;for(const s of e)Number.isFinite(s)?s>=d&&s<=r&&(c=c===null?s:c+s,u=Math.min(u,s),i=Math.max(i,s),m++):typeof s=="string"&&m++;if(m&&c!=null){o=c/m;let s=0;for(const h of e)Number.isFinite(h)&&h>=d&&h<=r&&(s+=(h-o)**2);p=l?m>1?s/(m-1):0:m>0?s/m:0,f=Math.sqrt(p)}else u=null,i=null;const a={avg:o,count:m,max:i,min:u,stddev:f,sum:c,variance:p};return n&&(a.nullcount=e.length-m),t.percentileParams&&(a.median=$(e,t.percentileParams)),a}function $(t,e){const{fieldType:l,value:n,orderBy:u,isDiscrete:i}=e,c=X(l,u==="desc");if((t=[...t].filter(a=>a!=null).sort((a,s)=>c(a,s))).length===0)return null;if(n<=0)return t[0];if(n>=1)return t[t.length-1];const o=(t.length-1)*n,f=Math.floor(o),p=f+1,m=o%1,d=t[f],r=t[p];return p>=t.length||i||typeof d=="string"||typeof r=="string"?d:d*(1-m)+r*m}function X(t,e){if(t){if(R.has(t))return S(e);if(H.has(t))return M(e,!1);if(t==="esriFieldTypeTimestampOffset")return lt(e);const i=M(e,!0);if(t==="esriFieldTypeString")return i;if(t==="esriFieldTypeGUID"||t==="esriFieldTypeGlobalID")return(c,o)=>i(I(c),I(o))}const l=e?1:-1,n=S(e),u=M(e,!0);return(i,c)=>typeof i=="number"&&typeof c=="number"?n(i,c):typeof i=="string"&&typeof c=="string"?u(i,c):l}const T=(t,e)=>t==null?e==null?0:1:e==null?-1:null,y=(t,e)=>t==null?e==null?0:-1:e==null?1:null;function Z(t){return t?T:y}const tt=(t,e)=>y(t,e)??(t===e?0:new Date(t).getTime()-new Date(e).getTime()),et=(t,e)=>T(t,e)??(t===e?0:new Date(e).getTime()-new Date(t).getTime());function lt(t){return t?et:tt}const nt=(t,e)=>y(t,e)??(t===e?0:tT(t,e)??(t===e?0:t{const i=l(n,u);return i??((n=n.toUpperCase())>(u=u.toUpperCase())?-1:n{const i=l(n,u);return i??((n=n.toUpperCase())<(u=u.toUpperCase())?-1:n>u?1:0)}}const it=(t,e)=>T(t,e)??e-t,ut=(t,e)=>y(t,e)??t-e;function S(t){return t?it:ut}function I(t){return t.substr(24,12)+t.substr(19,4)+t.substr(16,2)+t.substr(14,2)+t.substr(11,2)+t.substr(9,2)+t.substr(6,2)+t.substr(4,2)+t.substr(2,2)+t.substr(0,2)}function bt(t,e){let l;for(l in t)J.includes(l)&&(Number.isFinite(t[l])||(t[l]=null));return e&&["avg","stddev","variance"].forEach(n=>{t[n]!=null&&(t[n]=Math.ceil(t[n]??0))}),t}function Vt(t){const e={};for(let l of t)(l==null||typeof l=="string"&&l.trim()==="")&&(l=null),e[l]==null?e[l]={count:1,data:l}:e[l].count++;return{count:e}}function z(t){return(t==null?void 0:t.type)!=="coded-value"?[]:t.codedValues.map(e=>e.code)}function gt(t,e,l,n){const u=t.count,i=[];if(l&&e){const c=[],o=z(e[0]);for(const f of o)if(e[1]){const p=z(e[1]);for(const m of p)if(e[2]){const d=z(e[2]);for(const r of d)c.push(`${x(f)}${n}${x(m)}${n}${x(r)}`)}else c.push(`${x(f)}${n}${x(m)}`)}else c.push(f);for(const f of c)u.hasOwnProperty(f)||(u[f]={data:f,count:0})}for(const c in u){const o=u[c];i.push({value:o.data,count:o.count,label:o.label})}return{uniqueValueInfos:i}}function vt(t,e,l,n){let u=null;switch(e){case"log":t!==0&&(u=Math.log(t)*Math.LOG10E);break;case"percent-of-total":Number.isFinite(n)&&n!==0&&(u=t/n*100);break;case"field":Number.isFinite(l)&&l!==0&&(u=t/l);break;case"natural-log":t>0&&(u=Math.log(t));break;case"square-root":t>0&&(u=t**.5)}return u}function ot(t,e){const l=st({field:e.field,normalizationType:e.normalizationType,normalizationField:e.normalizationField,classificationMethod:e.classificationMethod,standardDeviationInterval:e.standardDeviationInterval,breakCount:e.numClasses||Y});return t=rt(t,e.minValue,e.maxValue),C({definition:l,values:t,normalizationTotal:e.normalizationTotal})}function rt(t,e,l){const n=e??-1/0,u=l??1/0;return t.filter(i=>Number.isFinite(i)&&i>=n&&i<=u)}function st(t){const{breakCount:e,field:l,normalizationField:n,normalizationType:u}=t,i=t.classificationMethod||A,c=i==="standard-deviation"?t.standardDeviationInterval||_:void 0;return new N({breakCount:e,classificationField:l,classificationMethod:i,normalizationField:u==="field"?n:void 0,normalizationType:u,standardDeviationInterval:c})}function xt(t,e){var f,p;let l=t.classBreaks;const n=l.length,u=(f=l[0])==null?void 0:f.minValue,i=(p=l[n-1])==null?void 0:p.maxValue,c=e==="standard-deviation",o=Q;return l=l.map(m=>{const d=m.label,r={minValue:m.minValue,maxValue:m.maxValue,label:d};if(c&&d){const a=d.match(o),s=(a==null?void 0:a.map(h=>+h.trim()))??[];s.length===2?(r.minStdDev=s[0],r.maxStdDev=s[1],s[0]<0&&s[1]>0&&(r.hasAvg=!0)):s.length===1&&(d.includes("<")?(r.minStdDev=null,r.maxStdDev=s[0]):d.includes(">")&&(r.minStdDev=s[0],r.maxStdDev=null))}return r}),{minValue:u,maxValue:i,classBreakInfos:l,normalizationTotal:t.normalizationTotal}}function Tt(t,e){const l=ct(t,e);if(l.min==null&&l.max==null)return{bins:[],minValue:l.min,maxValue:l.max,normalizationTotal:e.normalizationTotal};const n=l.intervals,u=l.min??0,i=l.max??0,c=n.map((o,f)=>({minValue:n[f][0],maxValue:n[f][1],count:0}));for(const o of t)if(o!=null&&o>=u&&o<=i){const f=mt(n,o);f>-1&&c[f].count++}return{bins:c,minValue:u,maxValue:i,normalizationTotal:e.normalizationTotal}}function ct(t,e){const{field:l,classificationMethod:n,standardDeviationInterval:u,normalizationType:i,normalizationField:c,normalizationTotal:o,minValue:f,maxValue:p}=e,m=e.numBins||j;let d=null,r=null,a=null;if((!n||n==="equal-interval")&&!i){if(f!=null&&p!=null)d=f,r=p;else{const s=W({values:t,minValue:f,maxValue:p,useSampleStdDev:!i,supportsNullCount:K({normalizationType:i,normalizationField:c,minValue:f,maxValue:p})});d=s.min??null,r=s.max??null}a=ft(d??0,r??0,m)}else{const{classBreaks:s}=ot(t,{field:l,normalizationType:i,normalizationField:c,normalizationTotal:o,classificationMethod:n,standardDeviationInterval:u,minValue:f,maxValue:p,numClasses:m});d=s[0].minValue,r=s[s.length-1].maxValue,a=s.map(h=>[h.minValue,h.maxValue])}return{min:d,max:r,intervals:a}}function mt(t,e){let l=-1;for(let n=t.length-1;n>=0;n--)if(e>=t[n][0]){l=n;break}return l}function ft(t,e,l){const n=(e-t)/l,u=[];let i,c=t;for(let o=1;o<=l;o++)i=c+n,i=Number(i.toFixed(16)),u.push([c,o===l?e:i]),c=i;return u}export{gt as $,vt as B,bt as C,ot as E,xt as P,X as T,Tt as U,x as c,ht as d,K as f,Vt as k,W as p,$ as v}; diff --git a/assets/utils-p-5Bbga5.js b/assets/utils-CuXO_Zzq.js similarity index 97% rename from assets/utils-p-5Bbga5.js rename to assets/utils-CuXO_Zzq.js index 6360317..1fb55bd 100644 --- a/assets/utils-p-5Bbga5.js +++ b/assets/utils-CuXO_Zzq.js @@ -1,8 +1,8 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/geometryEngineJSON-D-7-cYHZ.js","assets/geometryEngineBase-C5__2Su1.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css","assets/json-Wa8cmqdu.js"] + __vite__mapDeps.viteFileDeps = ["assets/geometryEngineJSON-BfS7Q-po.js","assets/geometryEngineBase-CDbTTSsS.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css","assets/json-Wa8cmqdu.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{_ as N}from"./index-CEWggaxV.js";const V={color:[128,128,128,1],outlinecolor:[0,0,0,1],backgroundcolor:[128,128,128,1],borderLineColor:[0,0,0,1]},S={CIMVectorMarker:{scalesymbolsproportionally:!1,respectframe:!0,anchorpointunits:"Relative",offsetX:0,offsetY:0,rotateclockwise:!1,rotation:0,size:10,enable:!0,colorlocked:!1},CIMPictureMarker:{scalex:1,texturefilter:"Draft",anchorpointunits:"Relative",offsetx:0,offsety:0,rotateclockwise:!1,rotation:0,size:10,enable:!0,colorlocked:!1},CIMTextSymbol:{angle:0,anglex:0,angley:0,halosize:1,height:10,horizontalalignment:"Left",kerning:!0,letterspacing:0,letterwidth:100,ligatures:!0,linegap:0,offsetx:0,offsety:0,strikethrough:!1,textcase:"Normal",textstring:"",underline:!1,verticalalignment:"Bottom",enable:!0,colorlocked:!1},CIMSolidStroke:{capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMPictureStroke:{texturefilter:"Draft",capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMGradientStroke:{capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMSolidFill:{enable:!0,colorocked:!1},CIMPictureFill:{offsetx:0,offsety:0,rotation:0,scalex:1,height:10,texturefilter:"Draft",enable:!0,colorlocked:!1},CIMHatchFill:{offsetx:0,offsety:0,rotation:0,separation:4,enable:!0,colorlocked:!1},CIMGeometricEffectAddControlPoints:{angletolerance:120},CIMGeometricEffectArrow:{arrowtype:"OpenEnded",width:5},CIMGeometricEffectBuffer:{size:1},CIMGeometricEffectCut:{begincut:1,endcut:1,middlecut:0,invert:!1},CIMGeometricEffectDashes:{customendingoffset:0,linedashending:"NoConstraint",offsetalongline:0},CIMGeometricEffectDonut:{method:"Mitered",option:"Accurate",width:2},CIMGeometricEffectJog:{angle:225,length:20,position:50},CIMGeometricEffectControlMeasureLine:{rule:"FullGeometry"},CIMGeometricEffectMove:{offsetx:1,offsety:-1},CIMGeometricEffectOffset:{method:"Square",offset:1,option:"Fast"},CIMGeometricEffectRotate:{angle:15},CIMGeometricEffectScale:{xscalefactor:1.15,yscalefactor:1.15},CIMGeometricEffectWave:{amplitude:2,period:3,seed:1,waveform:"Sinus"},CIMMarkerPlacementAlongLine:{customendingoffset:0,endings:"WithHalfGap",offsetalongline:0,placeperpart:!0,angletoline:!0,offset:0},CIMMarkerPlacementAtExtremities:{extremityplacement:"Both",offsetalongline:0,angletoline:!0,offset:0},CIMMarkerPlacementAtRatioPositions:{beginposition:0,endposition:0,flipfirst:!0,angletoline:!0,offset:0},CIMMarkerPlacementInsidePolygon:{gridangle:0,gridtype:"Fixed",offsetx:0,offsety:0,randomness:100,seed:0,shiftoddrows:!1,stepx:16,stepy:16,clipping:"ClipAtBoundary"},CIMMarkerPlacementOnLine:{relativeto:"LineMiddle",startpointoffset:0,angletoline:!0,offset:0},CIMMarkerPlacementOnVertices:{placeperpart:!0,placeoncontrolpoints:!0,placeonendpoints:!0,placeonregularvertices:!0,angletoline:!0,offset:0},CIMMarkerPlacementPolygonCenter:{method:"OnPolygon",offsetx:0,offsety:0,clipatboundary:!1},CIMAnimatedSymbolProperties:{playanimation:!1,reverseanimation:!1,randomizestarttime:!1,randomizestartseed:0,starttimeoffset:0,duration:3,endingduration:3,useendingduration:!1,repeattype:"Loop",repeatdelay:0}};function X(e){return[e.r,e.g,e.b,e.a]}const B=` /-, -`;function x(e){let t=e.length;for(;t--;)if(!B.includes(e.charAt(t)))return!1;return!0}function Y(e,t){const r=[];let o=0,n=-1;do if(n=e.indexOf("[",o),n>=o){if(n>o){const i=e.substr(o,n-o);r.push([i,null,x(i)])}if(o=n+1,n=e.indexOf("]",o),n>=o){if(n>o){const i=t[e.substr(o,n-o)];i&&r.push([null,i,!1])}o=n+1}}while(n!==-1);if(o=-1&&C<=1&&(s=2*C*C*C-3*C*C+1,s>0&&(f=4*(k+g*t),w+=s*e[f+3],h+=s,e[f+3]<255&&(s=s*e[f+3]/250),I+=s*e[f],b+=s*e[f+1],P+=s*e[f+2],p+=s))}}o[d]=I/p,o[d+1]=b/p,o[d+2]=P/p,o[d+3]=w/h}}function j(e){return e?[e[0],e[1],e[2],e[3]/255]:[0,0,0,0]}function K(e){var t;return((t=e.data)==null?void 0:t.symbol)??null}function Q(e){return e.type==="CIMVectorMarker"||e.type==="CIMPictureMarker"||e.type==="CIMBarChartMarker"||e.type==="CIMCharacterMarker"||e.type==="CIMPieChartMarker"||e.type==="CIMStackedBarChartMarker"}function Z(e){return e.type==="CIMGradientStroke"||e.type==="CIMPictureStroke"||e.type==="CIMSolidStroke"}function ee(e){return e!=null&&(e.type==="CIMGradientFill"||e.type==="CIMHatchFill"||e.type==="CIMPictureFill"||e.type==="CIMSolidFill"||e.type==="CIMWaterFill")}function q(e){return e!=null&&(e.type==="CIMMarkerPlacementAlongLineRandomSize"||e.type==="CIMMarkerPlacementAlongLineSameSize"||e.type==="CIMMarkerPlacementAlongLineVariableSize"||e.type==="CIMMarkerPlacementAtExtremities"||e.type==="CIMMarkerPlacementAtMeasuredUnits"||e.type==="CIMMarkerPlacementAtRatioPositions"||e.type==="CIMMarkerPlacementOnLine"||e.type==="CIMMarkerPlacementOnVertices")}const te=(e,t=0)=>e==null||isNaN(e)?t:e,re=(e,t)=>e??t,oe=e=>e.tintColor?j(e.tintColor):[255,255,255,1],ne=e=>{if(!e)return!1;for(const t of e)switch(t.type){case"CIMGeometricEffectBuffer":case"CIMGeometricEffectOffset":case"CIMGeometricEffectDonut":return!0}return!1};function ie(){return N(()=>import("./geometryEngineJSON-D-7-cYHZ.js").then(e=>e.g),__vite__mapDeps([0,1,2,3,4]))}function ae(e){if(!e)return"normal";switch(e.toLowerCase()){case"italic":return"italic";case"oblique":return"oblique";default:return"normal"}}function le(e){if(!e)return"normal";switch(e.toLowerCase()){case"bold":return"bold";case"bolder":return"bolder";case"lighter":return"lighter";default:return"normal"}}function se(e){let t="normal",r="normal";if(e){const o=e.toLowerCase();o.includes("italic")?t="italic":o.includes("oblique")&&(t="oblique"),o.includes("bold")?r="bold":o.includes("light")&&(r="lighter")}return{style:t,weight:r}}function ce(e){return e.underline?"underline":e.strikethrough?"line-through":"none"}function G(e){if(!e)return null;switch(e.type){case"CIMPolygonSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const r=G(t);if(r!=null)return r}break;case"CIMTextSymbol":return G(e.symbol);case"CIMSolidFill":return e.color}return null}function E(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":{const t=e.symbolLayers;if(t)for(const r of t){const o=E(r);if(o!=null)return o}break}case"CIMTextSymbol":return E(e.symbol);case"CIMSolidStroke":return e.color}}function A(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const r=A(t);if(r!==void 0)return r}break;case"CIMTextSymbol":return A(e.symbol);case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return e.width}}function fe(e){switch(e){case"Left":default:return"left";case"Right":return"right";case"Center":case"Justify":return"center"}}function ue(e){switch(e){case"Top":default:return"top";case"Center":return"middle";case"Baseline":return"baseline";case"Bottom":return"bottom"}}function Me(e){return(e?Object.keys(e):[]).map(t=>({name:t,alias:t,type:typeof e[t]=="string"?"esriFieldTypeString":"esriFieldTypeDouble"}))}const me=e=>e.includes("data:image/svg+xml");function ye(e){return e&&e.charAt(0).toLowerCase()+e.substring(1)}function de(e,t,r,o,n,i){const{infos:m}=i;let a=1,l=0,y=0,u=0;for(const{offsetX:d,offsetY:s,rotation:p,size:h,frameHeight:I,rotateClockWise:b}of m)y=z(d,s,l,a,y),u=v(d,s,l,a,u),I&&(a*=h/I),l=T(p,b,l);const c=z(o,n,l,a,y),M=v(o,n,l,a,u);return{size:e*a,rotation:T(t,r,l),offsetX:c,offsetY:M}}function H(e){if(e==null)return!1;if(Array.isArray(e))return e.every(t=>H(t));switch(typeof e){case"string":return!!e;case"number":return!isNaN(e)}}function Ce(e,t){if(t==="color"||t==="outlinecolor"||t==="backgroundcolor"||t==="borderLineColor")return[...V[t]];const r=S[e];if(!r||typeof r[t]=="boolean")throw new Error(`InternalError: default value for type ${e}.`);return r[t]}function pe(e){return e!=null&&e.dashTemplate&&typeof e.dashTemplate=="string"&&(e.dashTemplate=e.dashTemplate.split(" ").map(Number)),e}function F(e){if(e==null)return"Normal";switch(e.type){case"CIMTextSymbol":return e.textCase??"Normal";case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const t=e.symbolLayers;if(!t)return"Normal";for(const r of t)if(r.type==="CIMVectorMarker")return F(r)}break;case"CIMVectorMarker":{const t=e.markerGraphics;if(!t)return"Normal";for(const r of t)if(r.symbol)return F(r.symbol)}}return"Normal"}function Ie(e){if(e)switch(e.type){case"CIMTextSymbol":return e.height;case"CIMPointSymbol":{let t=0;if(e.symbolLayers){for(const r of e.symbolLayers)if(r)switch(r.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const o=r.size??S.CIMVectorMarker.size;o>t&&(t=o);break}}}return t}case"CIMLineSymbol":case"CIMPolygonSymbol":{let t=0;if(e.symbolLayers){for(const r of e.symbolLayers)if(r)switch(r.type){case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const o=r.width;o!=null&&o>t&&(t=o);break}case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":if(r.markerPlacement&&q(r.markerPlacement)){const o=r.size??S.CIMVectorMarker.size;o>t&&(t=o)}break;case"CIMPictureFill":{const o=r.height;o!=null&&o>t&&(t=o)}}}return t}}}function W(e,t){if(t!==null){const r=t.get(e);return r?r.name:e}return e}function v(e,t,r,o,n){const i=r*Math.PI/180;if(i){const m=Math.cos(i);return(Math.sin(i)*e+m*t)*o+n}return t*o+n}function z(e,t,r,o,n){const i=r*Math.PI/180;return i?(Math.cos(i)*e-Math.sin(i)*t)*o+n:e*o+n}function T(e,t,r){return t?r-e:r+e}export{fe as A,Ie as B,ee as C,Ce as D,H as E,ue as F,Me as G,te as I,G as L,K as M,me as N,de as O,se as P,ae as S,E as T,q as b,ne as d,j as f,le as g,re as h,pe as j,ie as k,U as l,Z as m,X as o,oe as p,F as q,Y as s,S as t,$ as u,W as v,ce as w,A as x,Q as y,ye as z}; +import{_ as N}from"./index-BjUNJPVf.js";const V={color:[128,128,128,1],outlinecolor:[0,0,0,1],backgroundcolor:[128,128,128,1],borderLineColor:[0,0,0,1]},S={CIMVectorMarker:{scalesymbolsproportionally:!1,respectframe:!0,anchorpointunits:"Relative",offsetX:0,offsetY:0,rotateclockwise:!1,rotation:0,size:10,enable:!0,colorlocked:!1},CIMPictureMarker:{scalex:1,texturefilter:"Draft",anchorpointunits:"Relative",offsetx:0,offsety:0,rotateclockwise:!1,rotation:0,size:10,enable:!0,colorlocked:!1},CIMTextSymbol:{angle:0,anglex:0,angley:0,halosize:1,height:10,horizontalalignment:"Left",kerning:!0,letterspacing:0,letterwidth:100,ligatures:!0,linegap:0,offsetx:0,offsety:0,strikethrough:!1,textcase:"Normal",textstring:"",underline:!1,verticalalignment:"Bottom",enable:!0,colorlocked:!1},CIMSolidStroke:{capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMPictureStroke:{texturefilter:"Draft",capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMGradientStroke:{capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMSolidFill:{enable:!0,colorocked:!1},CIMPictureFill:{offsetx:0,offsety:0,rotation:0,scalex:1,height:10,texturefilter:"Draft",enable:!0,colorlocked:!1},CIMHatchFill:{offsetx:0,offsety:0,rotation:0,separation:4,enable:!0,colorlocked:!1},CIMGeometricEffectAddControlPoints:{angletolerance:120},CIMGeometricEffectArrow:{arrowtype:"OpenEnded",width:5},CIMGeometricEffectBuffer:{size:1},CIMGeometricEffectCut:{begincut:1,endcut:1,middlecut:0,invert:!1},CIMGeometricEffectDashes:{customendingoffset:0,linedashending:"NoConstraint",offsetalongline:0},CIMGeometricEffectDonut:{method:"Mitered",option:"Accurate",width:2},CIMGeometricEffectJog:{angle:225,length:20,position:50},CIMGeometricEffectControlMeasureLine:{rule:"FullGeometry"},CIMGeometricEffectMove:{offsetx:1,offsety:-1},CIMGeometricEffectOffset:{method:"Square",offset:1,option:"Fast"},CIMGeometricEffectRotate:{angle:15},CIMGeometricEffectScale:{xscalefactor:1.15,yscalefactor:1.15},CIMGeometricEffectWave:{amplitude:2,period:3,seed:1,waveform:"Sinus"},CIMMarkerPlacementAlongLine:{customendingoffset:0,endings:"WithHalfGap",offsetalongline:0,placeperpart:!0,angletoline:!0,offset:0},CIMMarkerPlacementAtExtremities:{extremityplacement:"Both",offsetalongline:0,angletoline:!0,offset:0},CIMMarkerPlacementAtRatioPositions:{beginposition:0,endposition:0,flipfirst:!0,angletoline:!0,offset:0},CIMMarkerPlacementInsidePolygon:{gridangle:0,gridtype:"Fixed",offsetx:0,offsety:0,randomness:100,seed:0,shiftoddrows:!1,stepx:16,stepy:16,clipping:"ClipAtBoundary"},CIMMarkerPlacementOnLine:{relativeto:"LineMiddle",startpointoffset:0,angletoline:!0,offset:0},CIMMarkerPlacementOnVertices:{placeperpart:!0,placeoncontrolpoints:!0,placeonendpoints:!0,placeonregularvertices:!0,angletoline:!0,offset:0},CIMMarkerPlacementPolygonCenter:{method:"OnPolygon",offsetx:0,offsety:0,clipatboundary:!1},CIMAnimatedSymbolProperties:{playanimation:!1,reverseanimation:!1,randomizestarttime:!1,randomizestartseed:0,starttimeoffset:0,duration:3,endingduration:3,useendingduration:!1,repeattype:"Loop",repeatdelay:0}};function X(e){return[e.r,e.g,e.b,e.a]}const B=` /-, +`;function x(e){let t=e.length;for(;t--;)if(!B.includes(e.charAt(t)))return!1;return!0}function Y(e,t){const r=[];let o=0,n=-1;do if(n=e.indexOf("[",o),n>=o){if(n>o){const i=e.substr(o,n-o);r.push([i,null,x(i)])}if(o=n+1,n=e.indexOf("]",o),n>=o){if(n>o){const i=t[e.substr(o,n-o)];i&&r.push([null,i,!1])}o=n+1}}while(n!==-1);if(o=-1&&C<=1&&(s=2*C*C*C-3*C*C+1,s>0&&(f=4*(k+g*t),w+=s*e[f+3],h+=s,e[f+3]<255&&(s=s*e[f+3]/250),I+=s*e[f],b+=s*e[f+1],P+=s*e[f+2],p+=s))}}o[d]=I/p,o[d+1]=b/p,o[d+2]=P/p,o[d+3]=w/h}}function j(e){return e?[e[0],e[1],e[2],e[3]/255]:[0,0,0,0]}function K(e){var t;return((t=e.data)==null?void 0:t.symbol)??null}function Q(e){return e.type==="CIMVectorMarker"||e.type==="CIMPictureMarker"||e.type==="CIMBarChartMarker"||e.type==="CIMCharacterMarker"||e.type==="CIMPieChartMarker"||e.type==="CIMStackedBarChartMarker"}function Z(e){return e.type==="CIMGradientStroke"||e.type==="CIMPictureStroke"||e.type==="CIMSolidStroke"}function ee(e){return e!=null&&(e.type==="CIMGradientFill"||e.type==="CIMHatchFill"||e.type==="CIMPictureFill"||e.type==="CIMSolidFill"||e.type==="CIMWaterFill")}function q(e){return e!=null&&(e.type==="CIMMarkerPlacementAlongLineRandomSize"||e.type==="CIMMarkerPlacementAlongLineSameSize"||e.type==="CIMMarkerPlacementAlongLineVariableSize"||e.type==="CIMMarkerPlacementAtExtremities"||e.type==="CIMMarkerPlacementAtMeasuredUnits"||e.type==="CIMMarkerPlacementAtRatioPositions"||e.type==="CIMMarkerPlacementOnLine"||e.type==="CIMMarkerPlacementOnVertices")}const te=(e,t=0)=>e==null||isNaN(e)?t:e,re=(e,t)=>e??t,oe=e=>e.tintColor?j(e.tintColor):[255,255,255,1],ne=e=>{if(!e)return!1;for(const t of e)switch(t.type){case"CIMGeometricEffectBuffer":case"CIMGeometricEffectOffset":case"CIMGeometricEffectDonut":return!0}return!1};function ie(){return N(()=>import("./geometryEngineJSON-BfS7Q-po.js").then(e=>e.g),__vite__mapDeps([0,1,2,3,4]))}function ae(e){if(!e)return"normal";switch(e.toLowerCase()){case"italic":return"italic";case"oblique":return"oblique";default:return"normal"}}function le(e){if(!e)return"normal";switch(e.toLowerCase()){case"bold":return"bold";case"bolder":return"bolder";case"lighter":return"lighter";default:return"normal"}}function se(e){let t="normal",r="normal";if(e){const o=e.toLowerCase();o.includes("italic")?t="italic":o.includes("oblique")&&(t="oblique"),o.includes("bold")?r="bold":o.includes("light")&&(r="lighter")}return{style:t,weight:r}}function ce(e){return e.underline?"underline":e.strikethrough?"line-through":"none"}function G(e){if(!e)return null;switch(e.type){case"CIMPolygonSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const r=G(t);if(r!=null)return r}break;case"CIMTextSymbol":return G(e.symbol);case"CIMSolidFill":return e.color}return null}function E(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":{const t=e.symbolLayers;if(t)for(const r of t){const o=E(r);if(o!=null)return o}break}case"CIMTextSymbol":return E(e.symbol);case"CIMSolidStroke":return e.color}}function A(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(e.symbolLayers)for(const t of e.symbolLayers){const r=A(t);if(r!==void 0)return r}break;case"CIMTextSymbol":return A(e.symbol);case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return e.width}}function fe(e){switch(e){case"Left":default:return"left";case"Right":return"right";case"Center":case"Justify":return"center"}}function ue(e){switch(e){case"Top":default:return"top";case"Center":return"middle";case"Baseline":return"baseline";case"Bottom":return"bottom"}}function Me(e){return(e?Object.keys(e):[]).map(t=>({name:t,alias:t,type:typeof e[t]=="string"?"esriFieldTypeString":"esriFieldTypeDouble"}))}const me=e=>e.includes("data:image/svg+xml");function ye(e){return e&&e.charAt(0).toLowerCase()+e.substring(1)}function de(e,t,r,o,n,i){const{infos:m}=i;let a=1,l=0,y=0,u=0;for(const{offsetX:d,offsetY:s,rotation:p,size:h,frameHeight:I,rotateClockWise:b}of m)y=z(d,s,l,a,y),u=v(d,s,l,a,u),I&&(a*=h/I),l=T(p,b,l);const c=z(o,n,l,a,y),M=v(o,n,l,a,u);return{size:e*a,rotation:T(t,r,l),offsetX:c,offsetY:M}}function H(e){if(e==null)return!1;if(Array.isArray(e))return e.every(t=>H(t));switch(typeof e){case"string":return!!e;case"number":return!isNaN(e)}}function Ce(e,t){if(t==="color"||t==="outlinecolor"||t==="backgroundcolor"||t==="borderLineColor")return[...V[t]];const r=S[e];if(!r||typeof r[t]=="boolean")throw new Error(`InternalError: default value for type ${e}.`);return r[t]}function pe(e){return e!=null&&e.dashTemplate&&typeof e.dashTemplate=="string"&&(e.dashTemplate=e.dashTemplate.split(" ").map(Number)),e}function F(e){if(e==null)return"Normal";switch(e.type){case"CIMTextSymbol":return e.textCase??"Normal";case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const t=e.symbolLayers;if(!t)return"Normal";for(const r of t)if(r.type==="CIMVectorMarker")return F(r)}break;case"CIMVectorMarker":{const t=e.markerGraphics;if(!t)return"Normal";for(const r of t)if(r.symbol)return F(r.symbol)}}return"Normal"}function Ie(e){if(e)switch(e.type){case"CIMTextSymbol":return e.height;case"CIMPointSymbol":{let t=0;if(e.symbolLayers){for(const r of e.symbolLayers)if(r)switch(r.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const o=r.size??S.CIMVectorMarker.size;o>t&&(t=o);break}}}return t}case"CIMLineSymbol":case"CIMPolygonSymbol":{let t=0;if(e.symbolLayers){for(const r of e.symbolLayers)if(r)switch(r.type){case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const o=r.width;o!=null&&o>t&&(t=o);break}case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":if(r.markerPlacement&&q(r.markerPlacement)){const o=r.size??S.CIMVectorMarker.size;o>t&&(t=o)}break;case"CIMPictureFill":{const o=r.height;o!=null&&o>t&&(t=o)}}}return t}}}function W(e,t){if(t!==null){const r=t.get(e);return r?r.name:e}return e}function v(e,t,r,o,n){const i=r*Math.PI/180;if(i){const m=Math.cos(i);return(Math.sin(i)*e+m*t)*o+n}return t*o+n}function z(e,t,r,o,n){const i=r*Math.PI/180;return i?(Math.cos(i)*e-Math.sin(i)*t)*o+n:e*o+n}function T(e,t,r){return t?r-e:r+e}export{fe as A,Ie as B,ee as C,Ce as D,H as E,ue as F,Me as G,te as I,G as L,K as M,me as N,de as O,se as P,ae as S,E as T,q as b,ne as d,j as f,le as g,re as h,pe as j,ie as k,U as l,Z as m,X as o,oe as p,F as q,Y as s,S as t,$ as u,W as v,ce as w,A as x,Q as y,ye as z}; diff --git a/assets/utils-CJVw5T-r.js b/assets/utils-D-nPH6yJ.js similarity index 95% rename from assets/utils-CJVw5T-r.js rename to assets/utils-D-nPH6yJ.js index 9411d7a..4a2c115 100644 --- a/assets/utils-CJVw5T-r.js +++ b/assets/utils-D-nPH6yJ.js @@ -1 +1 @@ -import{e as f,A as m,B as s}from"./index-CEWggaxV.js";import{e as l}from"./AttributeStore-Ck-75lnq.js";function d(e){return s(e.frameDurations.reduce((t,n)=>t+n,0))}function _(e){const{width:t,height:n}=e,o=e.frameDurations.reverse(),r=i=>{const a=e.frameDurations.length-1-i;return e.getFrame(a)};return{frameCount:e.frameCount,duration:e.duration,frameDurations:o,getFrame:r,width:t,height:n}}function F(e,t){const{width:n,height:o,getFrame:r}=e,i=t/e.duration,a=e.frameDurations.map(u=>s(u*i));return{frameCount:e.frameCount,duration:e.duration,frameDurations:a,getFrame:r,width:n,height:o}}function p(e,t){const{width:n,height:o,getFrame:r}=e,i=e.frameDurations.slice(),a=i.shift();return i.unshift(s(a+t)),{frameCount:e.frameCount,duration:e.duration+t,frameDurations:i,getFrame:r,width:n,height:o}}function c(e,t){const{width:n,height:o,getFrame:r}=e,i=e.frameDurations.slice(),a=i.pop();return i.push(s(a+t)),{frameCount:e.frameCount,duration:e.duration+t,frameDurations:i,getFrame:r,width:n,height:o}}class g{constructor(t,n,o,r){this._animation=t,this._repeatType=o,this._onFrameData=r,this._direction=1,this._currentFrame=0,this.timeToFrame=this._animation.frameDurations[this._currentFrame];let i=0;for(;n>i;)i+=this.timeToFrame,this.nextFrame();const a=this._animation.getFrame(this._currentFrame);this._onFrameData(a)}nextFrame(){if(this._currentFrame+=this._direction,this._direction>0){if(this._currentFrame===this._animation.frameDurations.length)switch(this._repeatType){case m.None:this._currentFrame-=this._direction;break;case m.Loop:this._currentFrame=0;break;case m.Oscillate:this._currentFrame-=this._direction,this._direction=-1}}else if(this._currentFrame===-1)switch(this._repeatType){case m.None:this._currentFrame-=this._direction;break;case m.Loop:this._currentFrame=this._animation.frameDurations.length-1;break;case m.Oscillate:this._currentFrame-=this._direction,this._direction=1}this.timeToFrame=this._animation.frameDurations[this._currentFrame];const t=this._animation.getFrame(this._currentFrame);this._onFrameData(t)}}function D(e,t,n,o){let r,{repeatType:i}=t;if(i==null&&(i=m.Loop),t.reverseAnimation===!0&&(e=_(e)),t.duration!=null&&(e=F(e,s(1e3*t.duration))),t.repeatDelay!=null){const a=1e3*t.repeatDelay;i===m.Loop?e=c(e,s(a)):i===m.Oscillate&&(e=p(c(e,s(a/2)),s(a/2)))}if(t.startTimeOffset!=null)r=s(1e3*t.startTimeOffset);else if(t.randomizeStartTime!=null){const u=t.randomizeStartSeed!=null?t.randomizeStartSeed:82749913,h=l(n,u);r=s(h*d(e))}else r=s(0);return new g(e,r,i,o)}function y(e,t,n,o){const r=t.playAnimation==null||t.playAnimation,i=D(e,t,n,o);let a,u=i.timeToFrame;function h(){a=r?setTimeout(()=>{i.nextFrame(),u=i.timeToFrame,h()},u):void 0}return h(),f(()=>r&&clearTimeout(a))}export{y as f}; +import{e as f,A as m,B as s}from"./index-BjUNJPVf.js";import{e as l}from"./AttributeStore-Bm6hLtR1.js";function d(e){return s(e.frameDurations.reduce((t,n)=>t+n,0))}function _(e){const{width:t,height:n}=e,o=e.frameDurations.reverse(),r=i=>{const a=e.frameDurations.length-1-i;return e.getFrame(a)};return{frameCount:e.frameCount,duration:e.duration,frameDurations:o,getFrame:r,width:t,height:n}}function F(e,t){const{width:n,height:o,getFrame:r}=e,i=t/e.duration,a=e.frameDurations.map(u=>s(u*i));return{frameCount:e.frameCount,duration:e.duration,frameDurations:a,getFrame:r,width:n,height:o}}function p(e,t){const{width:n,height:o,getFrame:r}=e,i=e.frameDurations.slice(),a=i.shift();return i.unshift(s(a+t)),{frameCount:e.frameCount,duration:e.duration+t,frameDurations:i,getFrame:r,width:n,height:o}}function c(e,t){const{width:n,height:o,getFrame:r}=e,i=e.frameDurations.slice(),a=i.pop();return i.push(s(a+t)),{frameCount:e.frameCount,duration:e.duration+t,frameDurations:i,getFrame:r,width:n,height:o}}class g{constructor(t,n,o,r){this._animation=t,this._repeatType=o,this._onFrameData=r,this._direction=1,this._currentFrame=0,this.timeToFrame=this._animation.frameDurations[this._currentFrame];let i=0;for(;n>i;)i+=this.timeToFrame,this.nextFrame();const a=this._animation.getFrame(this._currentFrame);this._onFrameData(a)}nextFrame(){if(this._currentFrame+=this._direction,this._direction>0){if(this._currentFrame===this._animation.frameDurations.length)switch(this._repeatType){case m.None:this._currentFrame-=this._direction;break;case m.Loop:this._currentFrame=0;break;case m.Oscillate:this._currentFrame-=this._direction,this._direction=-1}}else if(this._currentFrame===-1)switch(this._repeatType){case m.None:this._currentFrame-=this._direction;break;case m.Loop:this._currentFrame=this._animation.frameDurations.length-1;break;case m.Oscillate:this._currentFrame-=this._direction,this._direction=1}this.timeToFrame=this._animation.frameDurations[this._currentFrame];const t=this._animation.getFrame(this._currentFrame);this._onFrameData(t)}}function D(e,t,n,o){let r,{repeatType:i}=t;if(i==null&&(i=m.Loop),t.reverseAnimation===!0&&(e=_(e)),t.duration!=null&&(e=F(e,s(1e3*t.duration))),t.repeatDelay!=null){const a=1e3*t.repeatDelay;i===m.Loop?e=c(e,s(a)):i===m.Oscillate&&(e=p(c(e,s(a/2)),s(a/2)))}if(t.startTimeOffset!=null)r=s(1e3*t.startTimeOffset);else if(t.randomizeStartTime!=null){const u=t.randomizeStartSeed!=null?t.randomizeStartSeed:82749913,h=l(n,u);r=s(h*d(e))}else r=s(0);return new g(e,r,i,o)}function y(e,t,n,o){const r=t.playAnimation==null||t.playAnimation,i=D(e,t,n,o);let a,u=i.timeToFrame;function h(){a=r?setTimeout(()=>{i.nextFrame(),u=i.timeToFrame,h()},u):void 0}return h(),f(()=>r&&clearTimeout(a))}export{y as f}; diff --git a/assets/utils-kx2f2Fff.js b/assets/utils-Dx_a2yJw.js similarity index 92% rename from assets/utils-kx2f2Fff.js rename to assets/utils-Dx_a2yJw.js index 6873ea3..9973a4f 100644 --- a/assets/utils-kx2f2Fff.js +++ b/assets/utils-Dx_a2yJw.js @@ -1,7 +1,7 @@ function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["assets/symbolLayerUtils-BNd9Ueha.js","assets/index-CEWggaxV.js","assets/index-BJXAwoda.css"] + __vite__mapDeps.viteFileDeps = ["assets/symbolLayerUtils-r4EvpcG3.js","assets/index-BjUNJPVf.js","assets/index-BJXAwoda.css"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } -import{a9 as a,ee as k,d7 as y,gg as m,gh as g,gi as S,_ as M,gj as C}from"./index-CEWggaxV.js";import{M as I,f as z,m as L,y as j,b as _}from"./utils-p-5Bbga5.js";function x(o){const t=[];return b(I(o),t),t.length?new a(z(t[0])):null}function b(o,t){var e;if(!o)return;let n;n=o.type==="CIMTextSymbol"?o.symbol:o;const l=o.type==="CIMPolygonSymbol";if(n!=null&&n.symbolLayers){for(const r of n.symbolLayers)if(!(r.colorLocked||l&&(L(r)||j(r)&&r.markerPlacement&&_(r.markerPlacement))))switch(r.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":r.tintColor&&p(t,r.tintColor);break;case"CIMVectorMarker":(e=r.markerGraphics)==null||e.forEach(c=>{b(c.symbol,t)});break;case"CIMSolidStroke":case"CIMSolidFill":p(t,r.color);break;case"CIMHatchFill":b(r.lineSymbol,t)}}}function p(o,t){for(const n of o)if(n.join(".")===t.join("."))return;o.push(t)}new k(1e3);new a([128,128,128]);const P=new a("white");function U(o,t){if(!o)return null;let n=null;return y(o)?n=$(o):m(o)&&(n=o.type==="cim"?x(o):o.color?new a(o.color):null),n?h(n,t):null}function $(o){const t=o.symbolLayers;if(!t)return null;let n=null;return t.forEach(l=>{var e;l.type==="object"&&((e=l.resource)!=null&&e.href)||(n=l.type==="water"?l.color:l.material?l.material.color:null)}),n?new a(n):null}function h(o,t){if(t==null||o==null)return o;const n=o.toRgba();return n[3]=n[3]*t,new a(n)}function v(o,t,n){const l=o.symbolLayers;if(!l)return;const e=r=>h(t=t??r??(n!=null?P:null),n);l.forEach(r=>{var c,s;if(r.type!=="object"||!((c=r.resource)!=null&&c.href)||t)if(r.type==="water")r.color=e(r.color);else{const i=r.material!=null?r.material.color:null,u=e(i);r.material==null?r.material=new C({color:u}):r.material.color=u,n!=null&&"outline"in r&&((s=r.outline)==null?void 0:s.color)!=null&&(r.outline.color=h(r.outline.color,n))}})}function E(o,t,n){var l;(t=t??o.color)&&(o.color=h(t,n)),n!=null&&"outline"in o&&((l=o.outline)!=null&&l.color)&&(o.outline.color=h(o.outline.color,n))}function q(o,t,n){o&&(t||n!=null)&&(t&&(t=new a(t)),y(o)?v(o,t,n):m(o)&&E(o,t,n))}async function R(o,t){const n=o.symbolLayers;n&&await g(n,async l=>F(l,t))}async function F(o,t){switch(o.type){case"extrude":D(o,t);break;case"icon":case"line":case"text":O(o,t);break;case"path":V(o,t);break;case"object":await T(o,t)}}function O(o,t){const n=w(t);n!=null&&(o.size=n)}function w(o){for(const t of o)if(typeof t=="number")return t;return null}function D(o,t){o.size=typeof t[2]=="number"?t[2]:0}async function T(o,t){const{resourceSize:n,symbolSize:l}=await A(o),e=d(t,n,l);o.width=f(t[0],l[0],n[0],e),o.depth=f(t[1],l[1],n[1],e),o.height=f(t[2],l[2],n[2],e)}function V(o,t){const n=d(t,S,[o.width,void 0,o.height]);o.width=f(t[0],o.width,1,n),o.height=f(t[2],o.height,1,n)}function d(o,t,n){for(let l=0;l<3;l++){const e=o[l];switch(e){case"symbol-value":{const r=n[l];return r!=null?r/t[l]:1}case"proportional":break;default:if(e&&t[l])return e/t[l]}}return 1}async function A(o){const{computeObjectLayerResourceSize:t}=await M(()=>import("./symbolLayerUtils-BNd9Ueha.js"),__vite__mapDeps([0,1,2])),n=await t(o,10),{width:l,height:e,depth:r}=o,c=[l,r,e];let s=1;for(let i=0;i<3;i++){const u=c[i];if(u!=null){s=u/n[i];break}}for(let i=0;i<3;i++)c[i]==null&&(c[i]=n[i]*s);return{resourceSize:n,symbolSize:c}}function f(o,t,n,l){switch(o){case"proportional":return n*l;case"symbol-value":return t??n;default:return o}}function G(o,t){const n=w(t);if(n!=null)switch(o.type){case"simple-marker":o.size=n;break;case"picture-marker":{const l=o.width/o.height;l>1?(o.width=n,o.height=n*l):(o.width=n*l,o.height=n);break}case"simple-line":o.width=n;break;case"text":o.font.size=n}}async function B(o,t){if(o&&t)return y(o)?R(o,t):void(m(o)&&G(o,t))}function J(o,t,n){if(o&&t!=null)if(y(o)){const l=o.symbolLayers;l&&l.forEach(e=>{if(e&&e.type==="object")switch(n){case"tilt":e.tilt=(e.tilt??0)+t;break;case"roll":e.roll=(e.roll??0)+t;break;default:e.heading=(e.heading??0)+t}})}else m(o)&&(o.type!=="simple-marker"&&o.type!=="picture-marker"&&o.type!=="text"||(o.angle+=t))}async function K(o,t){return await o.fetchSymbol(t)||o.fetchCIMSymbol(t)}export{J as D,K as N,B as R,q as g,U as h}; +import{a9 as a,ee as k,d7 as y,gg as m,gh as g,gi as S,_ as M,gj as C}from"./index-BjUNJPVf.js";import{M as I,f as z,m as L,y as j,b as _}from"./utils-CuXO_Zzq.js";function x(o){const t=[];return b(I(o),t),t.length?new a(z(t[0])):null}function b(o,t){var e;if(!o)return;let n;n=o.type==="CIMTextSymbol"?o.symbol:o;const l=o.type==="CIMPolygonSymbol";if(n!=null&&n.symbolLayers){for(const r of n.symbolLayers)if(!(r.colorLocked||l&&(L(r)||j(r)&&r.markerPlacement&&_(r.markerPlacement))))switch(r.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":r.tintColor&&p(t,r.tintColor);break;case"CIMVectorMarker":(e=r.markerGraphics)==null||e.forEach(c=>{b(c.symbol,t)});break;case"CIMSolidStroke":case"CIMSolidFill":p(t,r.color);break;case"CIMHatchFill":b(r.lineSymbol,t)}}}function p(o,t){for(const n of o)if(n.join(".")===t.join("."))return;o.push(t)}new k(1e3);new a([128,128,128]);const P=new a("white");function U(o,t){if(!o)return null;let n=null;return y(o)?n=$(o):m(o)&&(n=o.type==="cim"?x(o):o.color?new a(o.color):null),n?h(n,t):null}function $(o){const t=o.symbolLayers;if(!t)return null;let n=null;return t.forEach(l=>{var e;l.type==="object"&&((e=l.resource)!=null&&e.href)||(n=l.type==="water"?l.color:l.material?l.material.color:null)}),n?new a(n):null}function h(o,t){if(t==null||o==null)return o;const n=o.toRgba();return n[3]=n[3]*t,new a(n)}function v(o,t,n){const l=o.symbolLayers;if(!l)return;const e=r=>h(t=t??r??(n!=null?P:null),n);l.forEach(r=>{var c,s;if(r.type!=="object"||!((c=r.resource)!=null&&c.href)||t)if(r.type==="water")r.color=e(r.color);else{const i=r.material!=null?r.material.color:null,u=e(i);r.material==null?r.material=new C({color:u}):r.material.color=u,n!=null&&"outline"in r&&((s=r.outline)==null?void 0:s.color)!=null&&(r.outline.color=h(r.outline.color,n))}})}function E(o,t,n){var l;(t=t??o.color)&&(o.color=h(t,n)),n!=null&&"outline"in o&&((l=o.outline)!=null&&l.color)&&(o.outline.color=h(o.outline.color,n))}function q(o,t,n){o&&(t||n!=null)&&(t&&(t=new a(t)),y(o)?v(o,t,n):m(o)&&E(o,t,n))}async function R(o,t){const n=o.symbolLayers;n&&await g(n,async l=>F(l,t))}async function F(o,t){switch(o.type){case"extrude":D(o,t);break;case"icon":case"line":case"text":O(o,t);break;case"path":V(o,t);break;case"object":await T(o,t)}}function O(o,t){const n=w(t);n!=null&&(o.size=n)}function w(o){for(const t of o)if(typeof t=="number")return t;return null}function D(o,t){o.size=typeof t[2]=="number"?t[2]:0}async function T(o,t){const{resourceSize:n,symbolSize:l}=await A(o),e=d(t,n,l);o.width=f(t[0],l[0],n[0],e),o.depth=f(t[1],l[1],n[1],e),o.height=f(t[2],l[2],n[2],e)}function V(o,t){const n=d(t,S,[o.width,void 0,o.height]);o.width=f(t[0],o.width,1,n),o.height=f(t[2],o.height,1,n)}function d(o,t,n){for(let l=0;l<3;l++){const e=o[l];switch(e){case"symbol-value":{const r=n[l];return r!=null?r/t[l]:1}case"proportional":break;default:if(e&&t[l])return e/t[l]}}return 1}async function A(o){const{computeObjectLayerResourceSize:t}=await M(()=>import("./symbolLayerUtils-r4EvpcG3.js"),__vite__mapDeps([0,1,2])),n=await t(o,10),{width:l,height:e,depth:r}=o,c=[l,r,e];let s=1;for(let i=0;i<3;i++){const u=c[i];if(u!=null){s=u/n[i];break}}for(let i=0;i<3;i++)c[i]==null&&(c[i]=n[i]*s);return{resourceSize:n,symbolSize:c}}function f(o,t,n,l){switch(o){case"proportional":return n*l;case"symbol-value":return t??n;default:return o}}function G(o,t){const n=w(t);if(n!=null)switch(o.type){case"simple-marker":o.size=n;break;case"picture-marker":{const l=o.width/o.height;l>1?(o.width=n,o.height=n*l):(o.width=n*l,o.height=n);break}case"simple-line":o.width=n;break;case"text":o.font.size=n}}async function B(o,t){if(o&&t)return y(o)?R(o,t):void(m(o)&&G(o,t))}function J(o,t,n){if(o&&t!=null)if(y(o)){const l=o.symbolLayers;l&&l.forEach(e=>{if(e&&e.type==="object")switch(n){case"tilt":e.tilt=(e.tilt??0)+t;break;case"roll":e.roll=(e.roll??0)+t;break;default:e.heading=(e.heading??0)+t}})}else m(o)&&(o.type!=="simple-marker"&&o.type!=="picture-marker"&&o.type!=="text"||(o.angle+=t))}async function K(o,t){return await o.fetchSymbol(t)||o.fetchCIMSymbol(t)}export{J as D,K as N,B as R,q as g,U as h}; diff --git a/assets/utils-2LBmsoaQ.js b/assets/utils-iOpWi7jV.js similarity index 93% rename from assets/utils-2LBmsoaQ.js rename to assets/utils-iOpWi7jV.js index 6e4f6dd..9149411 100644 --- a/assets/utils-2LBmsoaQ.js +++ b/assets/utils-iOpWi7jV.js @@ -1 +1 @@ -import{aw as x,ax as N,eo as h,en as P,N as c,el as S}from"./index-CEWggaxV.js";import{i as f}from"./originUtils-D69mHv66.js";import{i as b}from"./saveAPIKeyUtils-BiX1lQSW.js";import{t as g}from"./saveUtils-BzCRy3uR.js";function O(e,a,r){const t=r(e);if(!t.isValid)throw new c(`${a}:invalid-parameters`,t.errorMessage,{layer:e})}async function d(e){const{layer:a,errorNamePrefix:r,validateLayer:t}=e;await a.load(),O(a,r,t)}function u(e,a){return`Layer (title: ${e.title}, id: ${e.id}) of type '${e.declaredClass}' ${a}`}function y(e){const{item:a,errorNamePrefix:r,layer:t,validateItem:o}=e;if(b(a),J(e),o){const s=o(a);if(!s.isValid)throw new c(`${r}:invalid-parameters`,s.errorMessage,{layer:t})}}function J(e){const{item:a,itemType:r,additionalItemType:t,errorNamePrefix:o,layer:s}=e,l=[r];if(t&&l.push(t),!l.includes(a.type)){const n=l.map(i=>`'${i}'`).join(", ");throw new c(`${o}:portal-item-wrong-type`,`Portal item type should be one of: "${n}"`,{item:a,layer:s})}}function E(e){const{layer:a,errorNamePrefix:r}=e,{portalItem:t}=a;if(!t)throw new c(`${r}:portal-item-not-set`,u(a,"requires the portalItem property to be set"));if(!t.loaded)throw new c(`${r}:portal-item-not-loaded`,u(a,"cannot be saved to a portal item that does not exist or is inaccessible"));y({...e,item:t})}function U(e){const{newItem:a,itemType:r}=e;let t=x.from(a);return t.id&&(t=t.clone(),t.id=null),t.type??(t.type=r),t.portal??(t.portal=N.getDefault()),y({...e,item:t}),t}function w(e){return h(e,"portal-item")}async function I(e,a,r){var o;"beforeSave"in e&&typeof e.beforeSave=="function"&&await e.beforeSave();const t=e.write({},a);return await Promise.all(((o=a.resources)==null?void 0:o.pendingOperations)??[]),g(a,{errorName:"layer-write:unsupported"},r),t}function $(e){P(e,S.JSAPI),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((a,r,t)=>t.indexOf(a)===r))}async function C(e,a,r){var o;const t=e.portal;await t.signIn(),await((o=t.user)==null?void 0:o.addItem({item:e,data:a,folder:r==null?void 0:r.folder}))}async function L(e,a){const{layer:r,createItemData:t,createJSONContext:o,saveResources:s,supplementalUnsupportedErrors:l}=e;await d(e),E(e);const n=r.portalItem,i=o?o(n):w(n),p=await I(r,i,{...a,supplementalUnsupportedErrors:l}),m=await t({layer:r,layerJSON:p},n);return $(n),await n.update({data:m}),f(i),await(s==null?void 0:s(n,i)),n}async function M(e,a){const{layer:r,createItemData:t,createJSONContext:o,setItemProperties:s,saveResources:l,supplementalUnsupportedErrors:n}=e;await d(e);const i=U(e),p=o?o(i):w(i),m=await I(r,p,{...a,supplementalUnsupportedErrors:n}),v=await t({layer:r,layerJSON:m},i);return await s(r,i),$(i),await C(i,v,a),r.portalItem=i,f(p),await(l==null?void 0:l(i,p)),i}export{L as $,I,C as P,u as c,E as d,M as j,O as l,$ as v,w,U as y}; +import{aw as x,ax as N,eo as h,en as P,N as c,el as S}from"./index-BjUNJPVf.js";import{i as f}from"./originUtils-D69mHv66.js";import{i as b}from"./saveAPIKeyUtils-YRBbgdzi.js";import{t as g}from"./saveUtils-CGGzyvzv.js";function O(e,a,r){const t=r(e);if(!t.isValid)throw new c(`${a}:invalid-parameters`,t.errorMessage,{layer:e})}async function d(e){const{layer:a,errorNamePrefix:r,validateLayer:t}=e;await a.load(),O(a,r,t)}function u(e,a){return`Layer (title: ${e.title}, id: ${e.id}) of type '${e.declaredClass}' ${a}`}function y(e){const{item:a,errorNamePrefix:r,layer:t,validateItem:o}=e;if(b(a),J(e),o){const s=o(a);if(!s.isValid)throw new c(`${r}:invalid-parameters`,s.errorMessage,{layer:t})}}function J(e){const{item:a,itemType:r,additionalItemType:t,errorNamePrefix:o,layer:s}=e,l=[r];if(t&&l.push(t),!l.includes(a.type)){const n=l.map(i=>`'${i}'`).join(", ");throw new c(`${o}:portal-item-wrong-type`,`Portal item type should be one of: "${n}"`,{item:a,layer:s})}}function E(e){const{layer:a,errorNamePrefix:r}=e,{portalItem:t}=a;if(!t)throw new c(`${r}:portal-item-not-set`,u(a,"requires the portalItem property to be set"));if(!t.loaded)throw new c(`${r}:portal-item-not-loaded`,u(a,"cannot be saved to a portal item that does not exist or is inaccessible"));y({...e,item:t})}function U(e){const{newItem:a,itemType:r}=e;let t=x.from(a);return t.id&&(t=t.clone(),t.id=null),t.type??(t.type=r),t.portal??(t.portal=N.getDefault()),y({...e,item:t}),t}function w(e){return h(e,"portal-item")}async function I(e,a,r){var o;"beforeSave"in e&&typeof e.beforeSave=="function"&&await e.beforeSave();const t=e.write({},a);return await Promise.all(((o=a.resources)==null?void 0:o.pendingOperations)??[]),g(a,{errorName:"layer-write:unsupported"},r),t}function $(e){P(e,S.JSAPI),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((a,r,t)=>t.indexOf(a)===r))}async function C(e,a,r){var o;const t=e.portal;await t.signIn(),await((o=t.user)==null?void 0:o.addItem({item:e,data:a,folder:r==null?void 0:r.folder}))}async function L(e,a){const{layer:r,createItemData:t,createJSONContext:o,saveResources:s,supplementalUnsupportedErrors:l}=e;await d(e),E(e);const n=r.portalItem,i=o?o(n):w(n),p=await I(r,i,{...a,supplementalUnsupportedErrors:l}),m=await t({layer:r,layerJSON:p},n);return $(n),await n.update({data:m}),f(i),await(s==null?void 0:s(n,i)),n}async function M(e,a){const{layer:r,createItemData:t,createJSONContext:o,setItemProperties:s,saveResources:l,supplementalUnsupportedErrors:n}=e;await d(e);const i=U(e),p=o?o(i):w(i),m=await I(r,p,{...a,supplementalUnsupportedErrors:n}),v=await t({layer:r,layerJSON:m},i);return await s(r,i),$(i),await C(i,v,a),r.portalItem=i,f(p),await(l==null?void 0:l(i,p)),i}export{L as $,I,C as P,u as c,E as d,M as j,O as l,$ as v,w,U as y}; diff --git a/assets/utils3-D-MRQhiW.js b/assets/utils3-DOn9OzWH.js similarity index 98% rename from assets/utils3-D-MRQhiW.js rename to assets/utils3-DOn9OzWH.js index c47895e..a0d7c45 100644 --- a/assets/utils3-D-MRQhiW.js +++ b/assets/utils3-DOn9OzWH.js @@ -1,4 +1,4 @@ -import"./index-CEWggaxV.js";/*! +import"./index-BjUNJPVf.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. * v2.7.1 diff --git a/assets/vec3-CjYmIfaa.js b/assets/vec3-DdRUbala.js similarity index 97% rename from assets/vec3-CjYmIfaa.js rename to assets/vec3-DdRUbala.js index d67a600..c2faeaf 100644 --- a/assets/vec3-CjYmIfaa.js +++ b/assets/vec3-DdRUbala.js @@ -1 +1 @@ -import{s as O}from"./index-CEWggaxV.js";const $=()=>O.getLogger("esri.views.3d.support.buffer.math");function q(e,n,t){V(e.typedBuffer,n.typedBuffer,t,e.typedBufferStride,n.typedBufferStride)}function V(e,n,t,f=3,d=f){if(e.length/f!==Math.ceil(n.length/d))return e;const u=e.length/f,r=t[0],i=t[1],o=t[2],l=t[4],s=t[5],h=t[6],p=t[8],S=t[9],M=t[10],y=t[12],B=t[13],m=t[14];let a=0,c=0;for(let g=0;g0){const p=1/Math.sqrt(h);e[r]=p*o,e[r+1]=p*l,e[r+2]=p*s}u+=f,r+=t}}function T(e,n,t){const f=Math.min(e.count,n.count),d=e.typedBuffer,u=e.typedBufferStride,r=n.typedBuffer,i=n.typedBufferStride;let o=0,l=0;for(let s=0;s>t,d[l+1]=r[o+1]>>t,d[l+2]=r[o+2]>>t,o+=i,l+=u}Object.freeze(Object.defineProperty({__proto__:null,normalize:j,normalizeView:R,scale:z,scaleView:L,shiftRight:T,transformMat3:_,transformMat3View:x,transformMat4:V,transformMat4View:q,translate:P},Symbol.toStringTag,{value:"Module"}));export{R as a,$ as b,q as e,x as f,P as i,_ as n,L as o,V as r,j as s,z as u}; +import{s as O}from"./index-BjUNJPVf.js";const $=()=>O.getLogger("esri.views.3d.support.buffer.math");function q(e,n,t){V(e.typedBuffer,n.typedBuffer,t,e.typedBufferStride,n.typedBufferStride)}function V(e,n,t,f=3,d=f){if(e.length/f!==Math.ceil(n.length/d))return e;const u=e.length/f,r=t[0],i=t[1],o=t[2],l=t[4],s=t[5],h=t[6],p=t[8],S=t[9],M=t[10],y=t[12],B=t[13],m=t[14];let a=0,c=0;for(let g=0;g0){const p=1/Math.sqrt(h);e[r]=p*o,e[r+1]=p*l,e[r+2]=p*s}u+=f,r+=t}}function T(e,n,t){const f=Math.min(e.count,n.count),d=e.typedBuffer,u=e.typedBufferStride,r=n.typedBuffer,i=n.typedBufferStride;let o=0,l=0;for(let s=0;s>t,d[l+1]=r[o+1]>>t,d[l+2]=r[o+2]>>t,o+=i,l+=u}Object.freeze(Object.defineProperty({__proto__:null,normalize:j,normalizeView:R,scale:z,scaleView:L,shiftRight:T,transformMat3:_,transformMat3View:x,transformMat4:V,transformMat4View:q,translate:P},Symbol.toStringTag,{value:"Module"}));export{R as a,$ as b,q as e,x as f,P as i,_ as n,L as o,V as r,j as s,z as u}; diff --git a/assets/versionUtils-CaceEUVY.js b/assets/versionUtils-BIAEZzrm.js similarity index 98% rename from assets/versionUtils-CaceEUVY.js rename to assets/versionUtils-BIAEZzrm.js index 2276c8f..8a6f865 100644 --- a/assets/versionUtils-CaceEUVY.js +++ b/assets/versionUtils-BIAEZzrm.js @@ -1 +1 @@ -import{b7 as f}from"./index-CEWggaxV.js";const e=[];function l(d,t){if(f(d.url??""))return!0;const{wkid:o}=t;for(const r of e){if((d.version??0)>=r[0])return!0;if(typeof r[1]=="function"&&(r[1]=r[1]()),r[1].has(o))return!1}return!0}e.push([10.91,()=>{const d=new Set([9709,9716,9741,9761,9766]);for(let t=9712;t<=9713;t++)d.add(t);for(let t=9748;t<=9749;t++)d.add(t);for(let t=20904;t<=20932;t++)d.add(t);for(let t=21004;t<=21032;t++)d.add(t);for(let t=21207;t<=21264;t++)d.add(t);for(let t=21307;t<=21364;t++)d.add(t);for(let t=23301;t<=23333;t++)d.add(t);for(let t=102759;t<=102760;t++)d.add(t);for(let t=102934;t<=102955;t++)d.add(t);return d}]),e.push([10.9,()=>{const d=new Set([9300,9354,9364,9367,9373,9377,9387,9456,9473,9498,9678,9680,29874,103599,103872,104028]);for(let t=9356;t<=9360;t++)d.add(t);for(let t=9404;t<=9407;t++)d.add(t);for(let t=9476;t<=9482;t++)d.add(t);for(let t=9487;t<=9494;t++)d.add(t);for(let t=9697;t<=9699;t++)d.add(t);return d}]),e.push([10.81,()=>{const d=new Set([9265,9333,103598,103699]);for(let t=9248;t<=9254;t++)d.add(t);for(let t=9271;t<=9273;t++)d.add(t);for(let t=9284;t<=9285;t++)d.add(t);for(let t=21453;t<=21463;t++)d.add(t);return d}]),e.push([10.8,()=>{const d=new Set([8088,8395,8428,8433,8531,8687,8692,8694,8699,8900,9003,9006,9009,9012,9017,9191]);for(let t=8035;t<=8036;t++)d.add(t);for(let t=8455;t<=8456;t++)d.add(t);for(let t=8518;t<=8529;t++)d.add(t);for(let t=8533;t<=8536;t++)d.add(t);for(let t=8538;t<=8540;t++)d.add(t);for(let t=8677;t<=8679;t++)d.add(t);for(let t=8902;t<=8903;t++)d.add(t);for(let t=8907;t<=8910;t++)d.add(t);for(let t=8949;t<=8951;t++)d.add(t);for(let t=8972;t<=8987;t++)d.add(t);for(let t=9039;t<=9040;t++)d.add(t);for(let t=9068;t<=9069;t++)d.add(t);for(let t=9140;t<=9141;t++)d.add(t);for(let t=9148;t<=9150;t++)d.add(t);for(let t=9153;t<=9159;t++)d.add(t);for(let t=9205;t<=9218;t++)d.add(t);for(let t=9221;t<=9222;t++)d.add(t);for(let t=54098;t<=54101;t++)d.add(t);return d}]),e.push([10.71,()=>{const d=new Set([6316]);for(let t=8351;t<=8353;t++)d.add(t);for(let t=9294;t<=9297;t++)d.add(t);for(let t=22619;t<=22621;t++)d.add(t);for(let t=103586;t<=103594;t++)d.add(t);return d}]),e.push([10.7,()=>{const d=new Set([8387,8391,8427,8545,8682,8685,8818,31370,104022,104024,104975]);for(let t=8065;t<=8068;t++)d.add(t);for(let t=8082;t<=8083;t++)d.add(t);for(let t=8379;t<=8385;t++)d.add(t);for(let t=8836;t<=8840;t++)d.add(t);for(let t=8857;t<=8860;t++)d.add(t);for(let t=53035;t<=53037;t++)d.add(t);for(let t=54090;t<=54091;t++)d.add(t);for(let t=102498;t<=102499;t++)d.add(t);return d}]),e.push([10.61,()=>new Set([102497])]),e.push([10.6,()=>{const d=new Set([7803,7805,7887,8086,8232,8237,8240,8246,8249,8252,8255,9019,9391]);for(let t=7755;t<=7787;t++)d.add(t);for(let t=7791;t<=7795;t++)d.add(t);for(let t=7799;t<=7801;t++)d.add(t);for(let t=7825;t<=7831;t++)d.add(t);for(let t=7877;t<=7878;t++)d.add(t);for(let t=7882;t<=7883;t++)d.add(t);for(let t=7991;t<=7992;t++)d.add(t);for(let t=8042;t<=8043;t++)d.add(t);for(let t=8058;t<=8059;t++)d.add(t);for(let t=8311;t<=8348;t++)d.add(t);for(let t=9060;t<=9067;t++)d.add(t);for(let t=102562;t<=102568;t++)d.add(t);for(let t=102799;t<=102900;t++)d.add(t);return d}]);export{l as e}; +import{b7 as f}from"./index-BjUNJPVf.js";const e=[];function l(d,t){if(f(d.url??""))return!0;const{wkid:o}=t;for(const r of e){if((d.version??0)>=r[0])return!0;if(typeof r[1]=="function"&&(r[1]=r[1]()),r[1].has(o))return!1}return!0}e.push([10.91,()=>{const d=new Set([9709,9716,9741,9761,9766]);for(let t=9712;t<=9713;t++)d.add(t);for(let t=9748;t<=9749;t++)d.add(t);for(let t=20904;t<=20932;t++)d.add(t);for(let t=21004;t<=21032;t++)d.add(t);for(let t=21207;t<=21264;t++)d.add(t);for(let t=21307;t<=21364;t++)d.add(t);for(let t=23301;t<=23333;t++)d.add(t);for(let t=102759;t<=102760;t++)d.add(t);for(let t=102934;t<=102955;t++)d.add(t);return d}]),e.push([10.9,()=>{const d=new Set([9300,9354,9364,9367,9373,9377,9387,9456,9473,9498,9678,9680,29874,103599,103872,104028]);for(let t=9356;t<=9360;t++)d.add(t);for(let t=9404;t<=9407;t++)d.add(t);for(let t=9476;t<=9482;t++)d.add(t);for(let t=9487;t<=9494;t++)d.add(t);for(let t=9697;t<=9699;t++)d.add(t);return d}]),e.push([10.81,()=>{const d=new Set([9265,9333,103598,103699]);for(let t=9248;t<=9254;t++)d.add(t);for(let t=9271;t<=9273;t++)d.add(t);for(let t=9284;t<=9285;t++)d.add(t);for(let t=21453;t<=21463;t++)d.add(t);return d}]),e.push([10.8,()=>{const d=new Set([8088,8395,8428,8433,8531,8687,8692,8694,8699,8900,9003,9006,9009,9012,9017,9191]);for(let t=8035;t<=8036;t++)d.add(t);for(let t=8455;t<=8456;t++)d.add(t);for(let t=8518;t<=8529;t++)d.add(t);for(let t=8533;t<=8536;t++)d.add(t);for(let t=8538;t<=8540;t++)d.add(t);for(let t=8677;t<=8679;t++)d.add(t);for(let t=8902;t<=8903;t++)d.add(t);for(let t=8907;t<=8910;t++)d.add(t);for(let t=8949;t<=8951;t++)d.add(t);for(let t=8972;t<=8987;t++)d.add(t);for(let t=9039;t<=9040;t++)d.add(t);for(let t=9068;t<=9069;t++)d.add(t);for(let t=9140;t<=9141;t++)d.add(t);for(let t=9148;t<=9150;t++)d.add(t);for(let t=9153;t<=9159;t++)d.add(t);for(let t=9205;t<=9218;t++)d.add(t);for(let t=9221;t<=9222;t++)d.add(t);for(let t=54098;t<=54101;t++)d.add(t);return d}]),e.push([10.71,()=>{const d=new Set([6316]);for(let t=8351;t<=8353;t++)d.add(t);for(let t=9294;t<=9297;t++)d.add(t);for(let t=22619;t<=22621;t++)d.add(t);for(let t=103586;t<=103594;t++)d.add(t);return d}]),e.push([10.7,()=>{const d=new Set([8387,8391,8427,8545,8682,8685,8818,31370,104022,104024,104975]);for(let t=8065;t<=8068;t++)d.add(t);for(let t=8082;t<=8083;t++)d.add(t);for(let t=8379;t<=8385;t++)d.add(t);for(let t=8836;t<=8840;t++)d.add(t);for(let t=8857;t<=8860;t++)d.add(t);for(let t=53035;t<=53037;t++)d.add(t);for(let t=54090;t<=54091;t++)d.add(t);for(let t=102498;t<=102499;t++)d.add(t);return d}]),e.push([10.61,()=>new Set([102497])]),e.push([10.6,()=>{const d=new Set([7803,7805,7887,8086,8232,8237,8240,8246,8249,8252,8255,9019,9391]);for(let t=7755;t<=7787;t++)d.add(t);for(let t=7791;t<=7795;t++)d.add(t);for(let t=7799;t<=7801;t++)d.add(t);for(let t=7825;t<=7831;t++)d.add(t);for(let t=7877;t<=7878;t++)d.add(t);for(let t=7882;t<=7883;t++)d.add(t);for(let t=7991;t<=7992;t++)d.add(t);for(let t=8042;t<=8043;t++)d.add(t);for(let t=8058;t<=8059;t++)d.add(t);for(let t=8311;t<=8348;t++)d.add(t);for(let t=9060;t<=9067;t++)d.add(t);for(let t=102562;t<=102568;t++)d.add(t);for(let t=102799;t<=102900;t++)d.add(t);return d}]);export{l as e}; diff --git a/assets/visualVariableUtils-z2k12BH8.js b/assets/visualVariableUtils-BX9G5gNQ.js similarity index 98% rename from assets/visualVariableUtils-z2k12BH8.js rename to assets/visualVariableUtils-BX9G5gNQ.js index e29dfd4..1823bae 100644 --- a/assets/visualVariableUtils-z2k12BH8.js +++ b/assets/visualVariableUtils-BX9G5gNQ.js @@ -1 +1 @@ -import{j as R,bm as N,s as k,a9 as C,bn as U}from"./index-CEWggaxV.js";import{i as x,n as S,l as y,e as T}from"./sizeVariableUtils-Cmcuvw-4.js";const g=()=>k.getLogger("esri.renderers.visualVariables.support.visualVariableUtils"),D=new R,w=Math.PI,Q=/^\s*(return\s+)?\$view\.scale\s*(;)?\s*$/i;function q(r,t,a){const e="visualVariables"in r&&r.visualVariables?r.visualVariables.find(c=>c.type==="color"):r;if(!e)return;if(e.declaredClass!=="esri.renderers.visualVariables.ColorVariable")return void g().warn("The visualVariable should be an instance of esri.renderers.visualVariables.ColorVariable");const s=typeof t=="number",n=s?null:t,l=n==null?void 0:n.attributes;let o=s?t:null;const i=e.field,{ipData:f,hasExpression:p}=e.cache;let u=e.cache.compiledFunc;if(!i&&!p){const c=e.stops;return c&&c[0]&&c[0].color}if(typeof o!="number")if(p){if((a==null?void 0:a.arcade)==null)return void g().error("Use of arcade expressions requires an arcade context");const c={viewingMode:a.viewingMode,scale:a.scale,spatialReference:a.spatialReference},d=a.arcade.arcadeUtils,m=d.getViewInfo(c),V=d.createExecContext(n,m,a.timeZone);if(!u){const z=d.createSyntaxTree(e.valueExpression);u=d.createFunction(z),e.cache.compiledFunc=u}o=d.executeFunction(u,V)}else l&&(o=l[i]);const v=e.normalizationField,b=l!=null&&v!=null?parseFloat(l[v]):void 0;if(o!=null&&(!v||s||!isNaN(b)&&b!==0)){isNaN(b)||s||(o/=b);const c=E(o,f);if(c){const d=c[0],m=c[1],V=d===m?e.stops[d].color:C.blendColors(e.stops[d].color,e.stops[m].color,c[2],a!=null?a.color:void 0);return new C(V)}}}function I(r,t,a){const e="visualVariables"in r&&r.visualVariables?r.visualVariables.find(c=>c.type==="opacity"):r;if(!e)return;if(e.declaredClass!=="esri.renderers.visualVariables.OpacityVariable")return void g().warn("The visualVariable should be an instance of esri.renderers.visualVariables.OpacityVariable");const s=typeof t=="number",n=s?null:t,l=n==null?void 0:n.attributes;let o=s?t:null;const i=e.field,{ipData:f,hasExpression:p}=e.cache;let u=e.cache.compiledFunc;if(!i&&!p){const c=e.stops;return c&&c[0]&&c[0].opacity}if(typeof o!="number")if(p){if((a==null?void 0:a.arcade)==null)return void g().error("Use of arcade expressions requires an arcade context");const c={viewingMode:a.viewingMode,scale:a.scale,spatialReference:a.spatialReference},d=a.arcade.arcadeUtils,m=d.getViewInfo(c),V=d.createExecContext(n,m,a.timeZone);if(!u){const z=d.createSyntaxTree(e.valueExpression);u=d.createFunction(z),e.cache.compiledFunc=u}o=d.executeFunction(u,V)}else l&&(o=l[i]);const v=e.normalizationField,b=l!=null&&v!=null?parseFloat(l[v]):void 0;if(o!=null&&(!v||s||!isNaN(b)&&b!==0)){isNaN(b)||s||(o/=b);const c=E(o,f);if(c){const d=c[0],m=c[1];if(d===m)return e.stops[d].opacity;{const V=e.stops[d].opacity;return V+(e.stops[m].opacity-V)*c[2]}}}}function A(r,t,a){const e="visualVariables"in r&&r.visualVariables?r.visualVariables.find(b=>b.type==="rotation"):r;if(!e)return;if(e.declaredClass!=="esri.renderers.visualVariables.RotationVariable")return void g().warn("The visualVariable should be an instance of esri.renderers.visualVariables.RotationVariable");const s=e.axis||"heading",n=s==="heading"&&e.rotationType==="arithmetic"?90:0,l=s==="heading"&&e.rotationType==="arithmetic"?-1:1,o=typeof t=="number"?null:t,i=o==null?void 0:o.attributes,f=e.field,{hasExpression:p}=e.cache;let u=e.cache.compiledFunc,v=0;if(!f&&!p)return v;if(p){if((a==null?void 0:a.arcade)==null)return void g().error("Use of arcade expressions requires an arcade context");const b={viewingMode:a.viewingMode,scale:a.scale,spatialReference:a.spatialReference},c=a.arcade.arcadeUtils,d=c.getViewInfo(b),m=c.createExecContext(o,d,a.timeZone);if(!u){const V=c.createSyntaxTree(e.valueExpression);u=c.createFunction(V),e.cache.compiledFunc=u}v=c.executeFunction(u,m)}else i&&(v=i[f]||0);return v=typeof v!="number"||isNaN(v)?null:n+l*v,v}function O(r,t,a){const e=typeof t=="number",s=e?null:t,n=s==null?void 0:s.attributes;let l=e?t:null;const{isScaleDriven:o}=r.cache;let i=r.cache.compiledFunc;if(o){const p=a!=null?a.scale:void 0,u=a!=null?a.view:void 0;l=p==null||u==="3d"?Z(r):p}else if(!e)switch(r.inputValueType){case S.Expression:{if((a==null?void 0:a.arcade)==null)return void g().error("Use of arcade expressions requires an arcade context");const p={viewingMode:a.viewingMode,scale:a.scale,spatialReference:a.spatialReference},u=a.arcade.arcadeUtils,v=u.getViewInfo(p),b=u.createExecContext(s,v,a.timeZone);if(!i){const c=u.createSyntaxTree(r.valueExpression);i=u.createFunction(c),r.cache.compiledFunc=i}l=u.executeFunction(i,b);break}case S.Field:n&&(l=n[r.field]);break;case S.Unknown:l=null}if(!y(l))return null;if(e||!r.normalizationField)return l;const f=n?parseFloat(n[r.normalizationField]):null;return y(f)&&f!==0?l/f:null}function Z(r){let t=null,a=null;const e=r.stops;return e?(t=e[0].value,a=e[e.length-1].value):(t=r.minDataValue||0,a=r.maxDataValue||0),(t+a)/2}function F(r,t,a){const e="visualVariables"in r&&r.visualVariables?r.visualVariables.find(n=>n.type==="size"):r;if(!e)return;if(e.declaredClass!=="esri.renderers.visualVariables.SizeVariable")return void g().warn("The visualVariable should be an instance of esri.renderers.visualVariables.SizeVariable");const s=H(O(e,t,a),e,t,a,e.cache.ipData);return s==null||isNaN(s)?0:s}function h(r,t,a){return r==null?null:T(r)?F(r,t,a):y(r)?r:null}function M(r,t,a){return y(a)&&r>a?a:y(t)&&r=t.maxDataValue)return l;if(n==null||l==null)return null;if(t.scaleBy==="area"&&o){const i=o==="circle",f=i?w*(n/2)**2:n*n,p=f+s*((i?w*(l/2)**2:l*l)-f);return i?2*Math.sqrt(p/w):Math.sqrt(p)}return n+s*(l-n)}function B(r,t,a,e){const s=e!=null?e.shape:void 0,n=r/t.minDataValue,l=h(t.minSize,a,e),o=h(t.maxSize,a,e);let i=null;return i=s==="circle"?2*Math.sqrt(n*(l/2)**2):s==="square"||s==="diamond"||s==="image"?Math.sqrt(n*l**2):n*l,M(i,l,o)}function W(r,t,a,e,s){var i,f,p;const[n,l,o]=E(r,s);if(n===l)return h((i=t.stops)==null?void 0:i[n].size,a,e);{const u=h((f=t.stops)==null?void 0:f[n].size,a,e);return u+(h((p=t.stops)==null?void 0:p[l].size,a,e)-u)*o}}function G(r,t,a,e){const s=((e==null?void 0:e.resolution)??1)*U[t.valueUnit],n=h(t.minSize,a,e),l=h(t.maxSize,a,e),{valueRepresentation:o}=t;let i=null;return i=o==="area"?2*Math.sqrt(r/w)/s:o==="radius"||o==="distance"?2*r/s:r/s,M(i,n,l)}function H(r,t,a,e,s){switch(t.transformationType){case x.Additive:return L(r,t,a,e);case x.Constant:return P(t,a,e);case x.ClampedLinear:return j(r,t,a,e);case x.Proportional:return B(r,t,a,e);case x.Stops:return W(r,t,a,e,s);case x.RealWorldSize:return G(r,t,a,e);case x.Identity:return r;case x.Unknown:return null}}function X(r,t,a){const{isScaleDriven:e}=r.cache;if(!(e&&a==="3d"||t))return null;const s={scale:t,view:a};let n=h(r.minSize,D,s),l=h(r.maxSize,D,s);if(n!=null||l!=null){if(n>l){const o=l;l=n,n=o}return{minSize:n,maxSize:l}}}function Y(r,t,a){if(!r.visualVariables)return;const e=[],s=[],n=[],l=[],o=[];for(const i of r.visualVariables)switch(i.type){case"color":s.push(i);break;case"opacity":n.push(i);break;case"rotation":o.push(i);break;case"size":l.push(i)}return s.forEach(i=>{const f=q(i,t,a);e.push({variable:i,value:f})}),n.forEach(i=>{const f=I(i,t,a);e.push({variable:i,value:f})}),o.forEach(i=>{const f=A(i,t,a);e.push({variable:i,value:f})}),l.forEach(i=>{const f=F(i,t,a);e.push({variable:i,value:f})}),e.filter(i=>i.value!=null)}function E(r,t){if(!t)return;let a=0,e=t.length-1;return t.some((s,n)=>rk.getLogger("esri.renderers.visualVariables.support.visualVariableUtils"),D=new R,w=Math.PI,Q=/^\s*(return\s+)?\$view\.scale\s*(;)?\s*$/i;function q(r,t,a){const e="visualVariables"in r&&r.visualVariables?r.visualVariables.find(c=>c.type==="color"):r;if(!e)return;if(e.declaredClass!=="esri.renderers.visualVariables.ColorVariable")return void g().warn("The visualVariable should be an instance of esri.renderers.visualVariables.ColorVariable");const s=typeof t=="number",n=s?null:t,l=n==null?void 0:n.attributes;let o=s?t:null;const i=e.field,{ipData:f,hasExpression:p}=e.cache;let u=e.cache.compiledFunc;if(!i&&!p){const c=e.stops;return c&&c[0]&&c[0].color}if(typeof o!="number")if(p){if((a==null?void 0:a.arcade)==null)return void g().error("Use of arcade expressions requires an arcade context");const c={viewingMode:a.viewingMode,scale:a.scale,spatialReference:a.spatialReference},d=a.arcade.arcadeUtils,m=d.getViewInfo(c),V=d.createExecContext(n,m,a.timeZone);if(!u){const z=d.createSyntaxTree(e.valueExpression);u=d.createFunction(z),e.cache.compiledFunc=u}o=d.executeFunction(u,V)}else l&&(o=l[i]);const v=e.normalizationField,b=l!=null&&v!=null?parseFloat(l[v]):void 0;if(o!=null&&(!v||s||!isNaN(b)&&b!==0)){isNaN(b)||s||(o/=b);const c=E(o,f);if(c){const d=c[0],m=c[1],V=d===m?e.stops[d].color:C.blendColors(e.stops[d].color,e.stops[m].color,c[2],a!=null?a.color:void 0);return new C(V)}}}function I(r,t,a){const e="visualVariables"in r&&r.visualVariables?r.visualVariables.find(c=>c.type==="opacity"):r;if(!e)return;if(e.declaredClass!=="esri.renderers.visualVariables.OpacityVariable")return void g().warn("The visualVariable should be an instance of esri.renderers.visualVariables.OpacityVariable");const s=typeof t=="number",n=s?null:t,l=n==null?void 0:n.attributes;let o=s?t:null;const i=e.field,{ipData:f,hasExpression:p}=e.cache;let u=e.cache.compiledFunc;if(!i&&!p){const c=e.stops;return c&&c[0]&&c[0].opacity}if(typeof o!="number")if(p){if((a==null?void 0:a.arcade)==null)return void g().error("Use of arcade expressions requires an arcade context");const c={viewingMode:a.viewingMode,scale:a.scale,spatialReference:a.spatialReference},d=a.arcade.arcadeUtils,m=d.getViewInfo(c),V=d.createExecContext(n,m,a.timeZone);if(!u){const z=d.createSyntaxTree(e.valueExpression);u=d.createFunction(z),e.cache.compiledFunc=u}o=d.executeFunction(u,V)}else l&&(o=l[i]);const v=e.normalizationField,b=l!=null&&v!=null?parseFloat(l[v]):void 0;if(o!=null&&(!v||s||!isNaN(b)&&b!==0)){isNaN(b)||s||(o/=b);const c=E(o,f);if(c){const d=c[0],m=c[1];if(d===m)return e.stops[d].opacity;{const V=e.stops[d].opacity;return V+(e.stops[m].opacity-V)*c[2]}}}}function A(r,t,a){const e="visualVariables"in r&&r.visualVariables?r.visualVariables.find(b=>b.type==="rotation"):r;if(!e)return;if(e.declaredClass!=="esri.renderers.visualVariables.RotationVariable")return void g().warn("The visualVariable should be an instance of esri.renderers.visualVariables.RotationVariable");const s=e.axis||"heading",n=s==="heading"&&e.rotationType==="arithmetic"?90:0,l=s==="heading"&&e.rotationType==="arithmetic"?-1:1,o=typeof t=="number"?null:t,i=o==null?void 0:o.attributes,f=e.field,{hasExpression:p}=e.cache;let u=e.cache.compiledFunc,v=0;if(!f&&!p)return v;if(p){if((a==null?void 0:a.arcade)==null)return void g().error("Use of arcade expressions requires an arcade context");const b={viewingMode:a.viewingMode,scale:a.scale,spatialReference:a.spatialReference},c=a.arcade.arcadeUtils,d=c.getViewInfo(b),m=c.createExecContext(o,d,a.timeZone);if(!u){const V=c.createSyntaxTree(e.valueExpression);u=c.createFunction(V),e.cache.compiledFunc=u}v=c.executeFunction(u,m)}else i&&(v=i[f]||0);return v=typeof v!="number"||isNaN(v)?null:n+l*v,v}function O(r,t,a){const e=typeof t=="number",s=e?null:t,n=s==null?void 0:s.attributes;let l=e?t:null;const{isScaleDriven:o}=r.cache;let i=r.cache.compiledFunc;if(o){const p=a!=null?a.scale:void 0,u=a!=null?a.view:void 0;l=p==null||u==="3d"?Z(r):p}else if(!e)switch(r.inputValueType){case S.Expression:{if((a==null?void 0:a.arcade)==null)return void g().error("Use of arcade expressions requires an arcade context");const p={viewingMode:a.viewingMode,scale:a.scale,spatialReference:a.spatialReference},u=a.arcade.arcadeUtils,v=u.getViewInfo(p),b=u.createExecContext(s,v,a.timeZone);if(!i){const c=u.createSyntaxTree(r.valueExpression);i=u.createFunction(c),r.cache.compiledFunc=i}l=u.executeFunction(i,b);break}case S.Field:n&&(l=n[r.field]);break;case S.Unknown:l=null}if(!y(l))return null;if(e||!r.normalizationField)return l;const f=n?parseFloat(n[r.normalizationField]):null;return y(f)&&f!==0?l/f:null}function Z(r){let t=null,a=null;const e=r.stops;return e?(t=e[0].value,a=e[e.length-1].value):(t=r.minDataValue||0,a=r.maxDataValue||0),(t+a)/2}function F(r,t,a){const e="visualVariables"in r&&r.visualVariables?r.visualVariables.find(n=>n.type==="size"):r;if(!e)return;if(e.declaredClass!=="esri.renderers.visualVariables.SizeVariable")return void g().warn("The visualVariable should be an instance of esri.renderers.visualVariables.SizeVariable");const s=H(O(e,t,a),e,t,a,e.cache.ipData);return s==null||isNaN(s)?0:s}function h(r,t,a){return r==null?null:T(r)?F(r,t,a):y(r)?r:null}function M(r,t,a){return y(a)&&r>a?a:y(t)&&r=t.maxDataValue)return l;if(n==null||l==null)return null;if(t.scaleBy==="area"&&o){const i=o==="circle",f=i?w*(n/2)**2:n*n,p=f+s*((i?w*(l/2)**2:l*l)-f);return i?2*Math.sqrt(p/w):Math.sqrt(p)}return n+s*(l-n)}function B(r,t,a,e){const s=e!=null?e.shape:void 0,n=r/t.minDataValue,l=h(t.minSize,a,e),o=h(t.maxSize,a,e);let i=null;return i=s==="circle"?2*Math.sqrt(n*(l/2)**2):s==="square"||s==="diamond"||s==="image"?Math.sqrt(n*l**2):n*l,M(i,l,o)}function W(r,t,a,e,s){var i,f,p;const[n,l,o]=E(r,s);if(n===l)return h((i=t.stops)==null?void 0:i[n].size,a,e);{const u=h((f=t.stops)==null?void 0:f[n].size,a,e);return u+(h((p=t.stops)==null?void 0:p[l].size,a,e)-u)*o}}function G(r,t,a,e){const s=((e==null?void 0:e.resolution)??1)*U[t.valueUnit],n=h(t.minSize,a,e),l=h(t.maxSize,a,e),{valueRepresentation:o}=t;let i=null;return i=o==="area"?2*Math.sqrt(r/w)/s:o==="radius"||o==="distance"?2*r/s:r/s,M(i,n,l)}function H(r,t,a,e,s){switch(t.transformationType){case x.Additive:return L(r,t,a,e);case x.Constant:return P(t,a,e);case x.ClampedLinear:return j(r,t,a,e);case x.Proportional:return B(r,t,a,e);case x.Stops:return W(r,t,a,e,s);case x.RealWorldSize:return G(r,t,a,e);case x.Identity:return r;case x.Unknown:return null}}function X(r,t,a){const{isScaleDriven:e}=r.cache;if(!(e&&a==="3d"||t))return null;const s={scale:t,view:a};let n=h(r.minSize,D,s),l=h(r.maxSize,D,s);if(n!=null||l!=null){if(n>l){const o=l;l=n,n=o}return{minSize:n,maxSize:l}}}function Y(r,t,a){if(!r.visualVariables)return;const e=[],s=[],n=[],l=[],o=[];for(const i of r.visualVariables)switch(i.type){case"color":s.push(i);break;case"opacity":n.push(i);break;case"rotation":o.push(i);break;case"size":l.push(i)}return s.forEach(i=>{const f=q(i,t,a);e.push({variable:i,value:f})}),n.forEach(i=>{const f=I(i,t,a);e.push({variable:i,value:f})}),o.forEach(i=>{const f=A(i,t,a);e.push({variable:i,value:f})}),l.forEach(i=>{const f=F(i,t,a);e.push({variable:i,value:f})}),e.filter(i=>i.value!=null)}function E(r,t){if(!t)return;let a=0,e=t.length-1;return t.some((s,n)=>rQ(s,n,e,l,E,a))}function M(t,e){return e.items.find(l=>l.name===t)}function Q(t,e,l,a,n,s){var c,d;const o=(l==null?void 0:l.portal)!=null?l.portal:D.getDefault(),p={portal:o,url:b(t.baseUrl),origin:"portal-item"},m=M(e,t.data);if(!m){const y=`The symbol name '${e}' could not be found`;return Promise.reject(new w("symbolstyleutils:symbol-name-not-found",y,{symbolName:e}))}let i=g(n(m,a),p),u=((c=m.thumbnail)==null?void 0:c.href)??null;const f=(d=m.thumbnail)==null?void 0:d.imageData;W()&&(i=N(i)??"",u=N(u));const O={portal:o,url:b(U(i)),origin:"portal-item"};return j(i,s).then(y=>{const F=a==="cimRef"?x(y.data):y.data,r=P(F,O);if(r&&R(r)){if(u){const I=g(u,p);r.thumbnail=new h({url:I})}else f&&(r.thumbnail=new h({url:`data:image/png;base64,${f}`}));t.styleUrl?r.styleOrigin=new S({portal:l.portal,styleUrl:t.styleUrl,name:e}):t.styleName&&(r.styleOrigin=new S({portal:l.portal,styleName:t.styleName,name:e}))}return r})}function T(t,e,l){const a=A.replaceAll(/\{SymbolName\}/gi,t),n=e.portal!=null?e.portal:D.getDefault();return j(a,l).then(s=>{const o=x(s.data);return P(o,{portal:n,url:b(U(a)),origin:"portal-item"})})}export{Q as fetchSymbolFromStyle,M as getStyleItemFromStyle,B as resolveWebStyleSymbol}; +import{N as w,ax as D,bW as b,d5 as g,d6 as U,d7 as R,d8 as h,d9 as S}from"./index-BjUNJPVf.js";import{c as W,a as N}from"./devEnvironmentUtils-Blrp8lZ5.js";import{b as P}from"./jsonUtils-Ox5U0P0F.js";import{c as v,b as j,p as x,w as A,d as E}from"./styleUtils-DOUOskVZ.js";function B(t,e,l,a){const n=t.name;return n==null?Promise.reject(new w("symbolstyleutils:style-symbol-reference-name-missing","Missing name in style symbol reference")):t.styleName&&t.styleName==="Esri2DPointSymbolsStyle"?T(n,e,a):v(t,e,a).then(s=>Q(s,n,e,l,E,a))}function M(t,e){return e.items.find(l=>l.name===t)}function Q(t,e,l,a,n,s){var c,d;const o=(l==null?void 0:l.portal)!=null?l.portal:D.getDefault(),p={portal:o,url:b(t.baseUrl),origin:"portal-item"},m=M(e,t.data);if(!m){const y=`The symbol name '${e}' could not be found`;return Promise.reject(new w("symbolstyleutils:symbol-name-not-found",y,{symbolName:e}))}let i=g(n(m,a),p),u=((c=m.thumbnail)==null?void 0:c.href)??null;const f=(d=m.thumbnail)==null?void 0:d.imageData;W()&&(i=N(i)??"",u=N(u));const O={portal:o,url:b(U(i)),origin:"portal-item"};return j(i,s).then(y=>{const F=a==="cimRef"?x(y.data):y.data,r=P(F,O);if(r&&R(r)){if(u){const I=g(u,p);r.thumbnail=new h({url:I})}else f&&(r.thumbnail=new h({url:`data:image/png;base64,${f}`}));t.styleUrl?r.styleOrigin=new S({portal:l.portal,styleUrl:t.styleUrl,name:e}):t.styleName&&(r.styleOrigin=new S({portal:l.portal,styleName:t.styleName,name:e}))}return r})}function T(t,e,l){const a=A.replaceAll(/\{SymbolName\}/gi,t),n=e.portal!=null?e.portal:D.getDefault();return j(a,l).then(s=>{const o=x(s.data);return P(o,{portal:n,url:b(U(a)),origin:"portal-item"})})}export{Q as fetchSymbolFromStyle,M as getStyleItemFromStyle,B as resolveWebStyleSymbol}; diff --git a/assets/webglDeps-BqalI_vm.js b/assets/webglDeps-Cjw3mzdd.js similarity index 82% rename from assets/webglDeps-BqalI_vm.js rename to assets/webglDeps-Cjw3mzdd.js index 6bb7cc8..37f7251 100644 --- a/assets/webglDeps-BqalI_vm.js +++ b/assets/webglDeps-Cjw3mzdd.js @@ -1,4 +1,4 @@ -import{r as c}from"./Program-DLRmaKpw.js";import{h as _,x as g,s as y}from"./Program-DLRmaKpw.js";import{t as m}from"./NestedMap-DgiGbX8E.js";import{a as E,o as F,e as O}from"./ProgramTemplate-BICQrNzS.js";import{m as v}from"./Texture-DJgkMrSB.js";import{eA as w}from"./index-CEWggaxV.js";let l=class{constructor(e){this._rctx=e,this._store=new m}dispose(){this._store.forEach(e=>e.forEach(t=>t.dispose())),this._store.clear()}acquire(e,t,r,n){const o=this._store.get(e,t);if(o!=null)return o.ref(),o;const s=new c(this._rctx,e,t,r,n);return s.ref(),this._store.set(e,t,s),s}get test(){let e=0;return this._store.forEach(t=>t.forEach(r=>e+=r.hasGLName?2:1)),{cachedWebGLProgramObjects:e}}};function p(f){const{options:e,value:t}=f;return typeof e[t]=="number"}function x(f){let e="";for(const t in f){const r=f[t];if(typeof r=="boolean")r&&(e+=`#define ${t} +import{r as c}from"./Program-DBsYtQ00.js";import{h as _,x as g,s as y}from"./Program-DBsYtQ00.js";import{t as m}from"./NestedMap-DgiGbX8E.js";import{a as E,o as F,e as O}from"./ProgramTemplate-Ck2I0bIi.js";import{m as v}from"./Texture-S4dD-WHn.js";import{eA as w}from"./index-BjUNJPVf.js";let l=class{constructor(e){this._rctx=e,this._store=new m}dispose(){this._store.forEach(e=>e.forEach(t=>t.dispose())),this._store.clear()}acquire(e,t,r,n){const o=this._store.get(e,t);if(o!=null)return o.ref(),o;const s=new c(this._rctx,e,t,r,n);return s.ref(),this._store.set(e,t,s),s}get test(){let e=0;return this._store.forEach(t=>t.forEach(r=>e+=r.hasGLName?2:1)),{cachedWebGLProgramObjects:e}}};function p(f){const{options:e,value:t}=f;return typeof e[t]=="number"}function x(f){let e="";for(const t in f){const r=f[t];if(typeof r=="boolean")r&&(e+=`#define ${t} `);else if(typeof r=="number")e+=`#define ${t} ${r.toFixed()} `;else if(typeof r=="object")if(p(r)){const{value:n,options:o,namespace:s}=r,a=s?`${s}_`:"";for(const i in o)e+=`#define ${a}${i} ${o[i].toFixed()} `;e+=`#define ${t} ${a}${n} diff --git a/assets/wfsUtils-DeNqsSXH.js b/assets/wfsUtils-p2GOBpZe.js similarity index 98% rename from assets/wfsUtils-DeNqsSXH.js rename to assets/wfsUtils-p2GOBpZe.js index 2cc1398..9e5b522 100644 --- a/assets/wfsUtils-DeNqsSXH.js +++ b/assets/wfsUtils-p2GOBpZe.js @@ -1 +1 @@ -import{M as b,cZ as D,N as l,c_ as V,c$ as R,d0 as k,d1 as S,aS as E,aE as j,G as L,d2 as O,bv as W,a_ as m,d3 as Y,d4 as X,cB as _,cD as F}from"./index-CEWggaxV.js";import{u as q}from"./geojson-BLwRz6JF.js";import{o as x,n as g}from"./xmlUtils-CtUoQO7q.js";const C="xlink:href",f="2.0.0",$="__esri_wfs_id__",z="wfs-layer:getWFSLayerTypeInfo-error",Q="wfs-layer:empty-service",G="wfs-layer:feature-type-not-found",B="wfs-layer:geojson-not-supported",H="wfs-layer:kvp-encoding-not-supported",J="wfs-layer:malformed-json",N="wfs-layer:unknown-geometry-type",K="wfs-layer:unknown-field-type",Z="wfs-layer:unsupported-spatial-reference",ee="wfs-layer:unsupported-wfs-version";async function Se(r,t){const e=te((await b(r,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"GetCapabilities",VERSION:f,...t==null?void 0:t.customParameters},signal:t==null?void 0:t.signal})).data);return ne(r,e),e}function te(r){const t=I(r);we(t),M(t);const e=t.firstElementChild,a=D(se(e));return{operations:re(e),get featureTypes(){return Array.from(a())},readFeatureTypes:a}}const ae=["json","application/json","geojson","application/json; subtype=geojson","application/geo+json"];function P(r){for(const t of ae){const e=r.findIndex(a=>a.toLowerCase()===t);if(e>=0)return r[e]}return null}function re(r){let t=!1;const e={GetCapabilities:{url:""},DescribeFeatureType:{url:""},GetFeature:{url:"",outputFormat:null,supportsPagination:!1}},a=[],n=[];if(x(r,{OperationsMetadata:{Parameter:s=>{if(s.getAttribute("name")==="outputFormat")return{AllowedValues:{Value:({textContent:o})=>{o&&a.push(o)}}}},Operation:s=>{switch(s.getAttribute("name")){case"GetCapabilities":return{DCP:{HTTP:{Get:o=>{e.GetCapabilities.url=o.getAttribute(C)}}}};case"DescribeFeatureType":return{DCP:{HTTP:{Get:o=>{e.DescribeFeatureType.url=o.getAttribute(C)}}}};case"GetFeature":return{DCP:{HTTP:{Get:o=>{e.GetFeature.url=o.getAttribute(C)}}},Parameter:o=>{if(o.getAttribute("name")==="outputFormat")return{AllowedValues:{Value:({textContent:i})=>{i&&n.push(i)}}}}}}},Constraint:s=>{switch(s.getAttribute("name")){case"KVPEncoding":return{DefaultValue:o=>{t=o.textContent.toLowerCase()==="true"}};case"ImplementsResultPaging":return{DefaultValue:o=>{e.GetFeature.supportsPagination=o.textContent.toLowerCase()==="true"}}}}}}),e.GetFeature.outputFormat=P(n)??P(a),!t)throw new l(H,"WFS service doesn't support key/value pair (KVP) encoding");if(e.GetFeature.outputFormat==null)throw new l(B,"WFS service doesn't support GeoJSON output format");return e}function ne(r,t){V(r)&&(R(r,t.operations.DescribeFeatureType.url,!0)&&(t.operations.DescribeFeatureType.url=k(t.operations.DescribeFeatureType.url)),R(r,t.operations.GetFeature.url,!0)&&(t.operations.GetFeature.url=k(t.operations.GetFeature.url)))}function A(r){var e,a,n;const t=parseInt(((n=(a=(e=r.textContent)==null?void 0:e.match(/(?\d+$)/i))==null?void 0:a.groups)==null?void 0:n.wkid)??"",10);if(!Number.isNaN(t))return t}function se(r){return g(r,{FeatureTypeList:{FeatureType:t=>{const e={typeName:"undefined:undefined",name:"",title:"",description:"",extent:null,namespacePrefix:"",namespaceUri:"",defaultSpatialReference:4326,supportedSpatialReferences:[]},a=new Set;return x(t,{Name:n=>{const{name:s,prefix:o}=w(n.textContent);e.typeName=`${o}:${s}`,e.name=s,e.namespacePrefix=o,e.namespaceUri=n.lookupNamespaceURI(o)},Abstract:n=>{e.description=n.textContent},Title:n=>{e.title=n.textContent},WGS84BoundingBox:n=>{e.extent=oe(n)},DefaultCRS:n=>{const s=A(n);s&&(e.defaultSpatialReference=s,a.add(s))},OtherCRS:n=>{const s=A(n);s&&a.add(s)}}),e.title||(e.title=e.name),a.add(4326),e.supportedSpatialReferences.push(...a),e}}})}function oe(r){let t,e,a,n;for(const s of r.children)switch(s.localName){case"LowerCorner":[t,e]=s.textContent.split(" ").map(o=>Number.parseFloat(o));break;case"UpperCorner":[a,n]=s.textContent.split(" ").map(o=>Number.parseFloat(o))}return{xmin:t,ymin:e,xmax:a,ymax:n,spatialReference:_}}function ie(r,t,e){return S(r,a=>e?a.name===t&&a.namespaceUri===e:a.typeName===t||a.name===t)}async function xe(r,t,e,a={}){const{featureType:n,extent:s}=await ue(r,t,e,a),{spatialReference:o}=be(r.operations.GetFeature.url,n,a.spatialReference),{fields:i,geometryType:p,swapXY:c,objectIdField:u,geometryField:d}=await pe(r,n,o,a);return{url:r.operations.GetCapabilities.url,name:n.name,namespaceUri:n.namespaceUri,fields:i,geometryField:d,geometryType:p,objectIdField:u,spatialReference:a.spatialReference??new E({wkid:n.defaultSpatialReference}),extent:s,swapXY:c,wfsCapabilities:r,customParameters:a.customParameters}}async function ue(r,t,e,a={}){const n=r.readFeatureTypes(),s=t?ie(n,t,e):n.next().value,{spatialReference:o=new E({wkid:s==null?void 0:s.defaultSpatialReference})}=a;if(s==null)throw t?new l(G,`The type '${t}' could not be found in the service`):new l(Q,"The service is empty");let i=new j({...s.extent,spatialReference:E.WGS84});if(!L(i.spatialReference,o))try{await O(i.spatialReference,o,void 0,a),i=W(i,o)}catch{throw new l(Z,"Projection not supported")}return{extent:i,spatialReference:o,featureType:s}}async function pe(r,t,e,a={}){var y,T,h;const{typeName:n}=t,[s,o]=await Promise.allSettled([de(r.operations.DescribeFeatureType.url,n,a),ce(r,n,e,a)]),i=U=>new l(z,`An error occurred while getting info about the feature type '${n}'`,{error:U});if(s.status==="rejected")throw i(s.reason);if(o.status==="rejected")throw i(o.reason);const{fields:p,errors:c}=s.value??{},u=((y=s.value)==null?void 0:y.geometryType)||((T=o.value)==null?void 0:T.geometryType),d=((h=o.value)==null?void 0:h.swapXY)??!1;if(u==null)throw new l(N,`The geometry type could not be determined for type '${n}`,{typeName:n,geometryType:u,fields:p,errors:c});return{...le(p??[]),geometryType:u,swapXY:d}}function le(r){const t=r.find(a=>a.type==="geometry");let e=r.find(a=>a.type==="oid");return r=r.filter(a=>a.type!=="geometry"),e||(e=new m({name:$,type:"oid",alias:$}),r.unshift(e)),{geometryField:(t==null?void 0:t.name)??null,objectIdField:e.name,fields:r}}async function ce(r,t,e,a={}){var c;let n,s=!1;const[o,i]=await Promise.all([ge(r.operations.GetFeature.url,t,e,r.operations.GetFeature.outputFormat,{...a,count:1}),b(r.operations.GetFeature.url,{responseType:"text",query:v(t,e,void 0,{...a,count:1}),signal:a==null?void 0:a.signal})]),p=o.type==="FeatureCollection"&&((c=o.features[0])==null?void 0:c.geometry);if(p){let u;switch(n=Y.fromJSON(q(p.type)),p.type){case"Point":u=p.coordinates;break;case"LineString":case"MultiPoint":u=p.coordinates[0];break;case"MultiLineString":case"Polygon":u=p.coordinates[0][0];break;case"MultiPolygon":u=p.coordinates[0][0][0]}const d=/<[^>]*pos[^>]*> *(-?\d+(?:\.\d+)?) (-?\d+(?:\.\d+)?)/.exec(i.data);if(d){const y=u[0].toFixed(3),T=u[1].toFixed(3),h=parseFloat(d[1]).toFixed(3);y===parseFloat(d[2]).toFixed(3)&&T===h&&(s=!0)}}return{geometryType:n,swapXY:s}}async function de(r,t,e){return ye(t,(await b(r,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"DescribeFeatureType",VERSION:f,TYPENAME:t,TYPENAMES:t,...e==null?void 0:e.customParameters},signal:e==null?void 0:e.signal})).data)}function ye(r,t){const{name:e}=w(r),a=I(t);M(a);const n=S(g(a.firstElementChild,{element:s=>s}),s=>s.getAttribute("name")===e);if(n!=null){const s=n.getAttribute("type"),o=s?S(g(a.firstElementChild,{complexType:i=>i}),i=>i.getAttribute("name")===w(s).name):S(g(n,{complexType:i=>i}),()=>!0);if(o)return fe(o)}throw new l(G,`Type '${r}' not found in document`,{document:new XMLSerializer().serializeToString(a)})}const me=new Set(["objectid","fid"]);function fe(r){const t=[],e=[];let a;const n=g(r,{complexContent:{extension:{sequence:{element:s=>s}}}});for(const s of n){const o=s.getAttribute("name");if(!o)continue;let i,p;if(s.hasAttribute("type")?i=w(s.getAttribute("type")).name:x(s,{simpleType:{restriction:d=>(i=w(d.getAttribute("base")).name,{maxLength:y=>{p=+y.getAttribute("value")}})}}),!i)continue;const c=s.getAttribute("nillable")==="true";let u=!1;switch(i.toLowerCase()){case"integer":case"nonpositiveinteger":case"negativeinteger":case"long":case"int":case"short":case"byte":case"nonnegativeinteger":case"unsignedlong":case"unsignedint":case"unsignedshort":case"unsignedbyte":case"positiveinteger":e.push(new m({name:o,alias:o,type:"integer",nullable:c,length:F("integer")}));break;case"float":case"double":case"decimal":e.push(new m({name:o,alias:o,type:"double",nullable:c,length:F("double")}));break;case"boolean":case"string":case"gyearmonth":case"gyear":case"gmonthday":case"gday":case"gmonth":case"anyuri":case"qname":case"notation":case"normalizedstring":case"token":case"language":case"idrefs":case"entities":case"nmtoken":case"nmtokens":case"name":case"ncname":case"id":case"idref":case"entity":case"duration":case"time":e.push(new m({name:o,alias:o,type:"string",nullable:c,length:p??F("string")}));break;case"datetime":case"date":e.push(new m({name:o,alias:o,type:"date",nullable:c,length:p??F("date")}));break;case"pointpropertytype":a="point",u=!0;break;case"multipointpropertytype":a="multipoint",u=!0;break;case"curvepropertytype":case"multicurvepropertytype":case"multilinestringpropertytype":a="polyline",u=!0;break;case"surfacepropertytype":case"multisurfacepropertytype":case"multipolygonpropertytype":a="polygon",u=!0;break;case"geometrypropertytype":case"multigeometrypropertytype":u=!0,t.push(new l(N,`geometry type '${i}' is not supported`,{type:new XMLSerializer().serializeToString(r)}));break;default:t.push(new l(K,`Unknown field type '${i}'`,{type:new XMLSerializer().serializeToString(r)}))}u&&e.push(new m({name:o,alias:o,type:"geometry",nullable:c}))}for(const s of e)if(s.type==="integer"&&!s.nullable&&me.has(s.name.toLowerCase())){s.type="oid";break}return{geometryType:a,fields:e,errors:t}}async function ge(r,t,e,a,n){let{data:s}=await b(r,{responseType:"text",query:v(t,e,a,n),signal:n==null?void 0:n.signal});s=s.replaceAll(/": +(-?\d+),(\d+)(,)?/g,'": $1.$2$3');try{return JSON.parse(s)}catch(o){throw new l(J,"Error while parsing the response",{response:s,error:o})}}function v(r,t,e,a){const n=typeof t=="number"?t:t.wkid;return{SERVICE:"WFS",REQUEST:"GetFeature",VERSION:f,TYPENAMES:r,OUTPUTFORMAT:e,SRSNAME:"EPSG:"+n,STARTINDEX:a==null?void 0:a.startIndex,COUNT:a==null?void 0:a.count,...a==null?void 0:a.customParameters}}async function Ce(r,t,e){const a=await b(r,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"GetFeature",VERSION:f,TYPENAMES:t,RESULTTYPE:"hits",...e==null?void 0:e.customParameters},signal:e==null?void 0:e.signal}),n=/numberMatched=["'](?\d+)["']/gi.exec(a.data);if(n!=null&&n.groups)return+n.groups.numberMatched}function I(r){return new DOMParser().parseFromString(r.trim(),"text/xml")}function w(r){const[t,e]=r.split(":");return{prefix:e?t:"",name:e??t}}function we(r){var e;const t=(e=r.firstElementChild)==null?void 0:e.getAttribute("version");if(t&&t!==f)throw new l(ee,`Unsupported WFS version ${t}. Supported version: ${f}`)}function M(r){let t="",e="";if(x(r.firstElementChild,{Exception:a=>(t=a.getAttribute("exceptionCode"),{ExceptionText:n=>{e=n.textContent}})}),t)throw new l(`wfs-layer:${t}`,e)}function be(r,t,e){const a={wkid:t.defaultSpatialReference},n=(e==null?void 0:e.wkid)!=null?{wkid:e.wkid}:a;return{spatialReference:n,getFeatureSpatialReference:X(r)||n.wkid&&t.supportedSpatialReferences.includes(n.wkid)?{wkid:n.wkid}:{wkid:t.defaultSpatialReference}}}export{ge as K,$ as S,ie as W,xe as Y,Ce as e,be as o,Se as v,le as z}; +import{M as b,cZ as D,N as l,c_ as V,c$ as R,d0 as k,d1 as S,aS as E,aE as j,G as L,d2 as O,bv as W,a_ as m,d3 as Y,d4 as X,cB as _,cD as F}from"./index-BjUNJPVf.js";import{u as q}from"./geojson-AjfTISUf.js";import{o as x,n as g}from"./xmlUtils-CtUoQO7q.js";const C="xlink:href",f="2.0.0",$="__esri_wfs_id__",z="wfs-layer:getWFSLayerTypeInfo-error",Q="wfs-layer:empty-service",G="wfs-layer:feature-type-not-found",B="wfs-layer:geojson-not-supported",H="wfs-layer:kvp-encoding-not-supported",J="wfs-layer:malformed-json",N="wfs-layer:unknown-geometry-type",K="wfs-layer:unknown-field-type",Z="wfs-layer:unsupported-spatial-reference",ee="wfs-layer:unsupported-wfs-version";async function Se(r,t){const e=te((await b(r,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"GetCapabilities",VERSION:f,...t==null?void 0:t.customParameters},signal:t==null?void 0:t.signal})).data);return ne(r,e),e}function te(r){const t=I(r);we(t),M(t);const e=t.firstElementChild,a=D(se(e));return{operations:re(e),get featureTypes(){return Array.from(a())},readFeatureTypes:a}}const ae=["json","application/json","geojson","application/json; subtype=geojson","application/geo+json"];function P(r){for(const t of ae){const e=r.findIndex(a=>a.toLowerCase()===t);if(e>=0)return r[e]}return null}function re(r){let t=!1;const e={GetCapabilities:{url:""},DescribeFeatureType:{url:""},GetFeature:{url:"",outputFormat:null,supportsPagination:!1}},a=[],n=[];if(x(r,{OperationsMetadata:{Parameter:s=>{if(s.getAttribute("name")==="outputFormat")return{AllowedValues:{Value:({textContent:o})=>{o&&a.push(o)}}}},Operation:s=>{switch(s.getAttribute("name")){case"GetCapabilities":return{DCP:{HTTP:{Get:o=>{e.GetCapabilities.url=o.getAttribute(C)}}}};case"DescribeFeatureType":return{DCP:{HTTP:{Get:o=>{e.DescribeFeatureType.url=o.getAttribute(C)}}}};case"GetFeature":return{DCP:{HTTP:{Get:o=>{e.GetFeature.url=o.getAttribute(C)}}},Parameter:o=>{if(o.getAttribute("name")==="outputFormat")return{AllowedValues:{Value:({textContent:i})=>{i&&n.push(i)}}}}}}},Constraint:s=>{switch(s.getAttribute("name")){case"KVPEncoding":return{DefaultValue:o=>{t=o.textContent.toLowerCase()==="true"}};case"ImplementsResultPaging":return{DefaultValue:o=>{e.GetFeature.supportsPagination=o.textContent.toLowerCase()==="true"}}}}}}),e.GetFeature.outputFormat=P(n)??P(a),!t)throw new l(H,"WFS service doesn't support key/value pair (KVP) encoding");if(e.GetFeature.outputFormat==null)throw new l(B,"WFS service doesn't support GeoJSON output format");return e}function ne(r,t){V(r)&&(R(r,t.operations.DescribeFeatureType.url,!0)&&(t.operations.DescribeFeatureType.url=k(t.operations.DescribeFeatureType.url)),R(r,t.operations.GetFeature.url,!0)&&(t.operations.GetFeature.url=k(t.operations.GetFeature.url)))}function A(r){var e,a,n;const t=parseInt(((n=(a=(e=r.textContent)==null?void 0:e.match(/(?\d+$)/i))==null?void 0:a.groups)==null?void 0:n.wkid)??"",10);if(!Number.isNaN(t))return t}function se(r){return g(r,{FeatureTypeList:{FeatureType:t=>{const e={typeName:"undefined:undefined",name:"",title:"",description:"",extent:null,namespacePrefix:"",namespaceUri:"",defaultSpatialReference:4326,supportedSpatialReferences:[]},a=new Set;return x(t,{Name:n=>{const{name:s,prefix:o}=w(n.textContent);e.typeName=`${o}:${s}`,e.name=s,e.namespacePrefix=o,e.namespaceUri=n.lookupNamespaceURI(o)},Abstract:n=>{e.description=n.textContent},Title:n=>{e.title=n.textContent},WGS84BoundingBox:n=>{e.extent=oe(n)},DefaultCRS:n=>{const s=A(n);s&&(e.defaultSpatialReference=s,a.add(s))},OtherCRS:n=>{const s=A(n);s&&a.add(s)}}),e.title||(e.title=e.name),a.add(4326),e.supportedSpatialReferences.push(...a),e}}})}function oe(r){let t,e,a,n;for(const s of r.children)switch(s.localName){case"LowerCorner":[t,e]=s.textContent.split(" ").map(o=>Number.parseFloat(o));break;case"UpperCorner":[a,n]=s.textContent.split(" ").map(o=>Number.parseFloat(o))}return{xmin:t,ymin:e,xmax:a,ymax:n,spatialReference:_}}function ie(r,t,e){return S(r,a=>e?a.name===t&&a.namespaceUri===e:a.typeName===t||a.name===t)}async function xe(r,t,e,a={}){const{featureType:n,extent:s}=await ue(r,t,e,a),{spatialReference:o}=be(r.operations.GetFeature.url,n,a.spatialReference),{fields:i,geometryType:p,swapXY:c,objectIdField:u,geometryField:d}=await pe(r,n,o,a);return{url:r.operations.GetCapabilities.url,name:n.name,namespaceUri:n.namespaceUri,fields:i,geometryField:d,geometryType:p,objectIdField:u,spatialReference:a.spatialReference??new E({wkid:n.defaultSpatialReference}),extent:s,swapXY:c,wfsCapabilities:r,customParameters:a.customParameters}}async function ue(r,t,e,a={}){const n=r.readFeatureTypes(),s=t?ie(n,t,e):n.next().value,{spatialReference:o=new E({wkid:s==null?void 0:s.defaultSpatialReference})}=a;if(s==null)throw t?new l(G,`The type '${t}' could not be found in the service`):new l(Q,"The service is empty");let i=new j({...s.extent,spatialReference:E.WGS84});if(!L(i.spatialReference,o))try{await O(i.spatialReference,o,void 0,a),i=W(i,o)}catch{throw new l(Z,"Projection not supported")}return{extent:i,spatialReference:o,featureType:s}}async function pe(r,t,e,a={}){var y,T,h;const{typeName:n}=t,[s,o]=await Promise.allSettled([de(r.operations.DescribeFeatureType.url,n,a),ce(r,n,e,a)]),i=U=>new l(z,`An error occurred while getting info about the feature type '${n}'`,{error:U});if(s.status==="rejected")throw i(s.reason);if(o.status==="rejected")throw i(o.reason);const{fields:p,errors:c}=s.value??{},u=((y=s.value)==null?void 0:y.geometryType)||((T=o.value)==null?void 0:T.geometryType),d=((h=o.value)==null?void 0:h.swapXY)??!1;if(u==null)throw new l(N,`The geometry type could not be determined for type '${n}`,{typeName:n,geometryType:u,fields:p,errors:c});return{...le(p??[]),geometryType:u,swapXY:d}}function le(r){const t=r.find(a=>a.type==="geometry");let e=r.find(a=>a.type==="oid");return r=r.filter(a=>a.type!=="geometry"),e||(e=new m({name:$,type:"oid",alias:$}),r.unshift(e)),{geometryField:(t==null?void 0:t.name)??null,objectIdField:e.name,fields:r}}async function ce(r,t,e,a={}){var c;let n,s=!1;const[o,i]=await Promise.all([ge(r.operations.GetFeature.url,t,e,r.operations.GetFeature.outputFormat,{...a,count:1}),b(r.operations.GetFeature.url,{responseType:"text",query:v(t,e,void 0,{...a,count:1}),signal:a==null?void 0:a.signal})]),p=o.type==="FeatureCollection"&&((c=o.features[0])==null?void 0:c.geometry);if(p){let u;switch(n=Y.fromJSON(q(p.type)),p.type){case"Point":u=p.coordinates;break;case"LineString":case"MultiPoint":u=p.coordinates[0];break;case"MultiLineString":case"Polygon":u=p.coordinates[0][0];break;case"MultiPolygon":u=p.coordinates[0][0][0]}const d=/<[^>]*pos[^>]*> *(-?\d+(?:\.\d+)?) (-?\d+(?:\.\d+)?)/.exec(i.data);if(d){const y=u[0].toFixed(3),T=u[1].toFixed(3),h=parseFloat(d[1]).toFixed(3);y===parseFloat(d[2]).toFixed(3)&&T===h&&(s=!0)}}return{geometryType:n,swapXY:s}}async function de(r,t,e){return ye(t,(await b(r,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"DescribeFeatureType",VERSION:f,TYPENAME:t,TYPENAMES:t,...e==null?void 0:e.customParameters},signal:e==null?void 0:e.signal})).data)}function ye(r,t){const{name:e}=w(r),a=I(t);M(a);const n=S(g(a.firstElementChild,{element:s=>s}),s=>s.getAttribute("name")===e);if(n!=null){const s=n.getAttribute("type"),o=s?S(g(a.firstElementChild,{complexType:i=>i}),i=>i.getAttribute("name")===w(s).name):S(g(n,{complexType:i=>i}),()=>!0);if(o)return fe(o)}throw new l(G,`Type '${r}' not found in document`,{document:new XMLSerializer().serializeToString(a)})}const me=new Set(["objectid","fid"]);function fe(r){const t=[],e=[];let a;const n=g(r,{complexContent:{extension:{sequence:{element:s=>s}}}});for(const s of n){const o=s.getAttribute("name");if(!o)continue;let i,p;if(s.hasAttribute("type")?i=w(s.getAttribute("type")).name:x(s,{simpleType:{restriction:d=>(i=w(d.getAttribute("base")).name,{maxLength:y=>{p=+y.getAttribute("value")}})}}),!i)continue;const c=s.getAttribute("nillable")==="true";let u=!1;switch(i.toLowerCase()){case"integer":case"nonpositiveinteger":case"negativeinteger":case"long":case"int":case"short":case"byte":case"nonnegativeinteger":case"unsignedlong":case"unsignedint":case"unsignedshort":case"unsignedbyte":case"positiveinteger":e.push(new m({name:o,alias:o,type:"integer",nullable:c,length:F("integer")}));break;case"float":case"double":case"decimal":e.push(new m({name:o,alias:o,type:"double",nullable:c,length:F("double")}));break;case"boolean":case"string":case"gyearmonth":case"gyear":case"gmonthday":case"gday":case"gmonth":case"anyuri":case"qname":case"notation":case"normalizedstring":case"token":case"language":case"idrefs":case"entities":case"nmtoken":case"nmtokens":case"name":case"ncname":case"id":case"idref":case"entity":case"duration":case"time":e.push(new m({name:o,alias:o,type:"string",nullable:c,length:p??F("string")}));break;case"datetime":case"date":e.push(new m({name:o,alias:o,type:"date",nullable:c,length:p??F("date")}));break;case"pointpropertytype":a="point",u=!0;break;case"multipointpropertytype":a="multipoint",u=!0;break;case"curvepropertytype":case"multicurvepropertytype":case"multilinestringpropertytype":a="polyline",u=!0;break;case"surfacepropertytype":case"multisurfacepropertytype":case"multipolygonpropertytype":a="polygon",u=!0;break;case"geometrypropertytype":case"multigeometrypropertytype":u=!0,t.push(new l(N,`geometry type '${i}' is not supported`,{type:new XMLSerializer().serializeToString(r)}));break;default:t.push(new l(K,`Unknown field type '${i}'`,{type:new XMLSerializer().serializeToString(r)}))}u&&e.push(new m({name:o,alias:o,type:"geometry",nullable:c}))}for(const s of e)if(s.type==="integer"&&!s.nullable&&me.has(s.name.toLowerCase())){s.type="oid";break}return{geometryType:a,fields:e,errors:t}}async function ge(r,t,e,a,n){let{data:s}=await b(r,{responseType:"text",query:v(t,e,a,n),signal:n==null?void 0:n.signal});s=s.replaceAll(/": +(-?\d+),(\d+)(,)?/g,'": $1.$2$3');try{return JSON.parse(s)}catch(o){throw new l(J,"Error while parsing the response",{response:s,error:o})}}function v(r,t,e,a){const n=typeof t=="number"?t:t.wkid;return{SERVICE:"WFS",REQUEST:"GetFeature",VERSION:f,TYPENAMES:r,OUTPUTFORMAT:e,SRSNAME:"EPSG:"+n,STARTINDEX:a==null?void 0:a.startIndex,COUNT:a==null?void 0:a.count,...a==null?void 0:a.customParameters}}async function Ce(r,t,e){const a=await b(r,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"GetFeature",VERSION:f,TYPENAMES:t,RESULTTYPE:"hits",...e==null?void 0:e.customParameters},signal:e==null?void 0:e.signal}),n=/numberMatched=["'](?\d+)["']/gi.exec(a.data);if(n!=null&&n.groups)return+n.groups.numberMatched}function I(r){return new DOMParser().parseFromString(r.trim(),"text/xml")}function w(r){const[t,e]=r.split(":");return{prefix:e?t:"",name:e??t}}function we(r){var e;const t=(e=r.firstElementChild)==null?void 0:e.getAttribute("version");if(t&&t!==f)throw new l(ee,`Unsupported WFS version ${t}. Supported version: ${f}`)}function M(r){let t="",e="";if(x(r.firstElementChild,{Exception:a=>(t=a.getAttribute("exceptionCode"),{ExceptionText:n=>{e=n.textContent}})}),t)throw new l(`wfs-layer:${t}`,e)}function be(r,t,e){const a={wkid:t.defaultSpatialReference},n=(e==null?void 0:e.wkid)!=null?{wkid:e.wkid}:a;return{spatialReference:n,getFeatureSpatialReference:X(r)||n.wkid&&t.supportedSpatialReferences.includes(n.wkid)?{wkid:n.wkid}:{wkid:t.defaultSpatialReference}}}export{ge as K,$ as S,ie as W,xe as Y,Ce as e,be as o,Se as v,le as z}; diff --git a/assets/xyChart-CZRgKOoN.js b/assets/xyChart-Dpn5biYD.js similarity index 99% rename from assets/xyChart-CZRgKOoN.js rename to assets/xyChart-Dpn5biYD.js index 87f9d47..a961d55 100644 --- a/assets/xyChart-CZRgKOoN.js +++ b/assets/xyChart-Dpn5biYD.js @@ -1 +1 @@ -import{aD as It,i as S,r as k,b as G,z as nt,a3 as te,h as ct,aE as ee,N as mt,W as gt,w,aF as Ct,C as v,aG as Ot,ak as F,q as Xt,c as ie,aH as j,aI as se,a6 as ae,aJ as oe,am as kt,al as Vt,ar as _t,aK as Gt,at as B,au as E,aL as q,K as ne,an as re,ap as ht,aa as Yt,F as dt,a as tt,ad as et,aA as Et,f as St,aM as Ft,aN as le,m as he,ay as Lt}from"./Theme-Bdh3gaKt.js";import{s as Rt}from"./ColorSet-DDQ4d9ui.js";import{l as Y}from"./DefaultTheme-QXTOOsyZ.js";import{R as Nt,D as zt,_ as Bt,g as ot,U as Wt,V as Ut,k as V,I as de}from"./Tick-B3uT4_8g.js";import{o as ce,n as jt}from"./Button-BD3vvwHs.js";import{ed as it}from"./index-CEWggaxV.js";function Ht(P){return typeof P=="object"&&"length"in P?P:Array.from(P)}function Zt(P){this._context=P}function $t(P){return new Zt(P)}function qt(P){return P[0]}function Kt(P){return P[1]}function Jt(P,t){var e=V(!0),i=null,s=$t,a=null,n=Ut(r);function r(o){var l,c,h,d=(o=Ht(o)).length,g=!1;for(i==null&&(a=s(h=n())),l=0;l<=d;++l)!(l=g;--p)r.point(x[p],b[p]);r.lineEnd(),r.areaEnd()}f&&(x[d]=+P(m,d,h),b[d]=+t(m,d,h),r.point(i?+i(m,d,h):x[d],e?+e(m,d,h):b[d]))}if(u)return r=null,u+""||null}function c(){return Jt().defined(s).curve(n).context(a)}return P=typeof P=="function"?P:P===void 0?qt:V(+P),t=typeof t=="function"?t:V(t===void 0?0:+t),e=typeof e=="function"?e:e===void 0?Kt:V(+e),l.x=function(h){return arguments.length?(P=typeof h=="function"?h:V(+h),i=null,l):P},l.x0=function(h){return arguments.length?(P=typeof h=="function"?h:V(+h),l):P},l.x1=function(h){return arguments.length?(i=h==null?null:typeof h=="function"?h:V(+h),l):i},l.y=function(h){return arguments.length?(t=typeof h=="function"?h:V(+h),e=null,l):t},l.y0=function(h){return arguments.length?(t=typeof h=="function"?h:V(+h),l):t},l.y1=function(h){return arguments.length?(e=h==null?null:typeof h=="function"?h:V(+h),l):e},l.lineX0=l.lineY0=function(){return c().x(P).y(t)},l.lineY1=function(){return c().x(P).y(e)},l.lineX1=function(){return c().x(i).y(t)},l.defined=function(h){return arguments.length?(s=typeof h=="function"?h:V(!!h),l):s},l.curve=function(h){return arguments.length?(n=h,a!=null&&(r=n(a)),l):n},l.context=function(h){return arguments.length?(h==null?a=r=null:r=n(a=h),l):a},l}Zt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(P,t){switch(P=+P,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(P,t):this._context.moveTo(P,t);break;case 1:this._point=2;default:this._context.lineTo(P,t)}}};class ue extends re{setupDefaultRules(){super.setupDefaultRules();const t=this._root.interfaceColors,e=this._root.language,i=this.rule.bind(this);i("XYChart").setAll({colors:Rt.new(this._root,{}),paddingLeft:20,paddingRight:20,paddingTop:16,paddingBottom:16,panX:!1,panY:!1,wheelStep:.25,arrangeTooltips:!0,pinchZoomX:!1,pinchZoomY:!1}),i("XYSeries").setAll({legendLabelText:"{name}"}),i("XYChart",["scrollbar","chart"]).setAll({paddingBottom:0,paddingLeft:0,paddingTop:0,paddingRight:0,colors:Rt.new(this._root,{saturation:0})});{const o=i("Graphics",["scrollbar","overlay"]);o.setAll({fillOpacity:.5}),Y(o,"fill",t,"background")}i("RoundedRectangle",["xy","scrollbar","thumb"]).setAll({cornerRadiusTR:0,cornerRadiusTL:0,cornerRadiusBR:0,cornerRadiusBL:0,fillOpacity:0,focusable:!0}),i("RoundedRectangle",["xy","scrollbar","thumb"]).states.create("hover",{fillOpacity:.4}),i("RoundedRectangle",["xy","scrollbar","chart","background"]).setAll({cornerRadiusTL:0,cornerRadiusBL:0,cornerRadiusTR:0,cornerRadiusBR:0}),i("RoundedRectangle",["xy","scrollbar","chart","background","resize","button"]).setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),i("AxisRendererX",["xy","chart","scrollbar"]).setAll({strokeOpacity:0,inside:!0}),i("AxisRendererY",["xy","chart","scrollbar"]).setAll({strokeOpacity:0,inside:!0,minGridDistance:5}),i("AxisLabel",["xy","scrollbar","x"]).setAll({opacity:.5,centerY:k,minPosition:.01,maxPosition:.99,fontSize:"0.8em"}),i("AxisLabel",["category"]).setAll({text:"{category}",populateText:!0}),i("AxisLabel",["x"]).setAll({centerY:0}),i("AxisLabel",["x","inside"]).setAll({centerY:k}),i("AxisLabel",["x","inside","opposite"]).setAll({centerY:0}),i("AxisLabel",["x","opposite"]).setAll({centerY:k}),i("AxisLabel",["y"]).setAll({centerX:k}),i("AxisLabel",["y","inside"]).setAll({centerX:0}),i("AxisLabel",["y","inside","opposite"]).setAll({centerX:k}),i("AxisLabel",["y","opposite"]).setAll({centerX:0}),i("AxisLabel",["minor"]).setAll({fontSize:"0.6em"}),i("AxisLabel",["xy","scrollbar","y"]).setAll({visible:!1}),i("Grid",["xy","scrollbar","y"]).setAll({visible:!1}),i("Grid",["xy","scrollbar","x"]).setAll({opacity:.5}),i("XYCursor").setAll({behavior:"none",layer:30,exportable:!1,snapToSeriesBy:"xy",moveThreshold:1});{const o=i("Grid",["cursor","x"]);o.setAll({strokeOpacity:.8,strokeDasharray:[2,2],ariaLabel:e.translate("Use left and right arrows to move selection")}),Y(o,"stroke",t,"alternativeBackground")}{const o=i("Grid",["cursor","y"]);o.setAll({strokeOpacity:.8,strokeDasharray:[2,2],ariaLabel:e.translate("Use up and down arrows to move selection")}),Y(o,"stroke",t,"alternativeBackground")}{const o=i("Graphics",["cursor","selection"]);o.setAll({fillOpacity:.15}),Y(o,"fill",t,"alternativeBackground")}i("Axis").setAll({start:0,end:1,minZoomCount:1,maxZoomCount:1/0,maxZoomFactor:1e3,maxDeviation:.1,snapTooltip:!0,tooltipLocation:.5,panX:!0,panY:!0,zoomX:!0,zoomY:!0,fixAxisSize:!0}),i("AxisLabel").setAll({location:.5,multiLocation:0,centerX:ht,centerY:ht,paddingTop:3,paddingBottom:3,paddingLeft:5,paddingRight:5}),i("Container",["axis","header"]).setAll({layer:30}),i("Rectangle",["axis","header","background"]).setAll({crisp:!0});{const o=i("AxisRenderer");o.setAll({crisp:!0,strokeOpacity:0}),Y(o,"stroke",t,"grid")}i("AxisRendererX").setAll({minGridDistance:120,opposite:!1,inversed:!1,cellStartLocation:0,cellEndLocation:1,width:k}),i("AxisRendererY").setAll({minGridDistance:40,opposite:!1,inversed:!1,cellStartLocation:0,cellEndLocation:1,height:k});{const o=i("Rectangle",["axis","thumb"]);o.setAll({fillOpacity:0}),Y(o,"fill",t,"alternativeBackground"),o.states.create("hover",{fillOpacity:.1})}i("Rectangle",["axis","thumb","x"]).setAll({cursorOverStyle:"ew-resize"}),i("Rectangle",["axis","thumb","y"]).setAll({cursorOverStyle:"ns-resize"});{const o=i("Grid");o.setAll({location:0,strokeOpacity:.15,crisp:!0}),Y(o,"stroke",t,"grid")}{const o=i("Grid",["minor"]);o.setAll({location:0,strokeOpacity:.07,crisp:!0}),Y(o,"stroke",t,"grid")}i("Grid",["base"]).setAll({strokeOpacity:.3});{const o=i("Graphics",["axis","fill"]);o.setAll({visible:!1,isMeasured:!1,position:"absolute",fillOpacity:.05}),Y(o,"fill",t,"alternativeBackground")}i("Graphics",["axis","fill","range"]).setAll({isMeasured:!0}),i("Graphics",["series","fill","range"]).setAll({visible:!1,isMeasured:!0}),i("Grid",["series","range"]).setAll({visible:!1}),i("AxisTick",["series","range"]).setAll({visible:!1}),i("AxisLabel",["series","range"]).setAll({visible:!1});{const o=i("AxisTick");o.setAll({location:.5,multiLocation:0,strokeOpacity:1,isMeasured:!1,position:"absolute",visible:!1}),Y(o,"stroke",t,"grid")}i("CategoryAxis").setAll({startLocation:0,endLocation:1,fillRule:(o,l)=>{const c=o.get("axisFill");c&&(v(l)&&l%2!=0?c.setPrivate("visible",!1):c.setPrivate("visible",!0))}});const s=[{timeUnit:"millisecond",count:1},{timeUnit:"millisecond",count:5},{timeUnit:"millisecond",count:10},{timeUnit:"millisecond",count:50},{timeUnit:"millisecond",count:100},{timeUnit:"millisecond",count:500},{timeUnit:"second",count:1},{timeUnit:"second",count:5},{timeUnit:"second",count:10},{timeUnit:"second",count:30},{timeUnit:"minute",count:1},{timeUnit:"minute",count:5},{timeUnit:"minute",count:10},{timeUnit:"minute",count:15},{timeUnit:"minute",count:30},{timeUnit:"hour",count:1},{timeUnit:"hour",count:3},{timeUnit:"hour",count:6},{timeUnit:"hour",count:12},{timeUnit:"day",count:1},{timeUnit:"day",count:2},{timeUnit:"day",count:3},{timeUnit:"day",count:4},{timeUnit:"day",count:5},{timeUnit:"week",count:1},{timeUnit:"month",count:1},{timeUnit:"month",count:2},{timeUnit:"month",count:3},{timeUnit:"month",count:6},{timeUnit:"year",count:1},{timeUnit:"year",count:2},{timeUnit:"year",count:5},{timeUnit:"year",count:10},{timeUnit:"year",count:50},{timeUnit:"year",count:100},{timeUnit:"year",count:200},{timeUnit:"year",count:500},{timeUnit:"year",count:1e3},{timeUnit:"year",count:2e3},{timeUnit:"year",count:5e3},{timeUnit:"year",count:1e4},{timeUnit:"year",count:1e5}],a={millisecond:e.translate("_date_millisecond"),second:e.translate("_date_second"),minute:e.translate("_date_minute"),hour:e.translate("_date_hour"),day:e.translate("_date_day"),week:e.translate("_date_day"),month:e.translate("_date_month"),year:e.translate("_date_year")},n={millisecond:e.translate("_date_millisecond"),second:e.translate("_date_second"),minute:e.translate("_date_minute"),hour:e.translate("_date_day"),day:e.translate("_date_day"),week:e.translate("_date_day"),month:e.translate("_date_month")+" "+e.translate("_date_year"),year:e.translate("_date_year")},r={millisecond:e.translate("_date_millisecond_full"),second:e.translate("_date_second_full"),minute:e.translate("_date_minute_full"),hour:e.translate("_date_hour_full"),day:e.translate("_date_day_full"),week:e.translate("_date_week_full"),month:e.translate("_date_month_full"),year:e.translate("_date_year")};i("CategoryDateAxis").setAll({markUnitChange:!0,gridIntervals:Yt(s),dateFormats:dt(a),periodChangeDateFormats:dt(n)}),i("DateAxis").setAll({maxZoomFactor:null,strictMinMax:!0,startLocation:0,endLocation:1,markUnitChange:!0,groupData:!1,groupCount:500,gridIntervals:Yt(s),dateFormats:dt(a),periodChangeDateFormats:dt(n),tooltipDateFormats:r,groupIntervals:[{timeUnit:"millisecond",count:1},{timeUnit:"millisecond",count:10},{timeUnit:"millisecond",count:100},{timeUnit:"second",count:1},{timeUnit:"second",count:10},{timeUnit:"minute",count:1},{timeUnit:"minute",count:10},{timeUnit:"hour",count:1},{timeUnit:"day",count:1},{timeUnit:"week",count:1},{timeUnit:"month",count:1},{timeUnit:"year",count:1}],fillRule:o=>{const l=o.get("axisFill");if(l){const c=o.component,h=o.get("value"),d=o.get("endValue"),g=c.intervalDuration(),p=c.getPrivate("baseInterval"),m=c.getPrivate("gridInterval",p);let u=c.getPrivate("min",0);if(u=de(new Date(u),m.timeUnit,m.count,this._root.locale.firstDayOfWeek,this._root.utc,void 0,this._root.timezone).getTime(),h!=null&&d!=null){const _=Math.round(Math.round((h-u)/g))/2;_==Math.round(_)?l.setPrivate("visible",!0):l.setPrivate("visible",!1)}}}}),i("GaplessDateAxis").setAll({fillRule:o=>{const l=o.get("axisFill");if(l){const c=o.get("index");let h=!1;v(c)&&c%2!=0||(h=!0),l.setPrivate("visible",h)}}}),i("ValueAxis").setAll({baseValue:0,logarithmic:!1,strictMinMax:!1,autoZoom:!0,fillRule:o=>{const l=o.get("axisFill");if(l){const c=o.component,h=o.get("value"),d=c.getPrivate("step");v(h)&&v(d)&&(j(h/d/2,5)==Math.round(h/d/2)?l.setPrivate("visible",!1):l.setPrivate("visible",!0))}}}),i("DurationAxis").setAll({baseUnit:"second"}),i("XYSeries").setAll({maskBullets:!0,stackToNegative:!0,locationX:.5,locationY:.5,snapTooltip:!1,openValueXGrouped:"open",openValueYGrouped:"open",valueXGrouped:"close",valueYGrouped:"close",seriesTooltipTarget:"series"}),i("BaseColumnSeries").setAll({adjustBulletPosition:!0}),i("ColumnSeries").setAll({clustered:!0}),i("RoundedRectangle",["series","column"]).setAll({position:"absolute",isMeasured:!1,width:tt(70),height:tt(70),strokeWidth:1,strokeOpacity:1,cornerRadiusBL:0,cornerRadiusTL:0,cornerRadiusBR:0,cornerRadiusTR:0,fillOpacity:1,role:"figure"}),i("LineSeries").setAll({connect:!0,autoGapCount:1.1,stackToNegative:!1}),i("Graphics",["series","stroke"]).setAll({position:"absolute",strokeWidth:1,strokeOpacity:1,isMeasured:!1}),i("Graphics",["series","fill"]).setAll({visible:!1,fillOpacity:0,position:"absolute",strokeWidth:0,strokeOpacity:0,isMeasured:!1}),i("Graphics",["line","series","legend","marker","stroke"]).setAll({draw:(o,l)=>{const c=l.parent;if(c){const h=c.height(),d=c.width();o.moveTo(0,h/2),o.lineTo(d,h/2)}}});{const o=i("Graphics",["line","series","legend","marker","stroke"]).states.create("disabled",{});Y(o,"stroke",t,"disabled")}i("Graphics",["line","series","legend","marker","fill"]).setAll({draw:(o,l)=>{const c=l.parent;if(c){const h=c.height(),d=c.width();o.moveTo(0,0),o.lineTo(d,0),o.lineTo(d,h),o.lineTo(0,h),o.lineTo(0,0)}}});{const o=i("Graphics",["line","series","legend","marker","fill"]).states.create("disabled",{});Y(o,"stroke",t,"disabled")}i("SmoothedXYLineSeries").setAll({tension:.5}),i("SmoothedXLineSeries").setAll({tension:.5}),i("SmoothedYLineSeries").setAll({tension:.5}),i("Candlestick").setAll({position:"absolute",isMeasured:!1,width:tt(50),height:tt(50),strokeWidth:1,strokeOpacity:1,cornerRadiusBL:0,cornerRadiusTL:0,cornerRadiusBR:0,cornerRadiusTR:0,fillOpacity:1,role:"figure"}),i("OHLC").setAll({width:tt(80),height:tt(80)}),i("CandlestickSeries").setAll({lowValueXGrouped:"low",lowValueYGrouped:"low",highValueXGrouped:"high",highValueYGrouped:"high",openValueXGrouped:"open",openValueYGrouped:"open",valueXGrouped:"close",valueYGrouped:"close"});{const o=i("Rectangle",["column","autocolor"]).states.create("riseFromOpen",{});Y(o,"fill",t,"positive"),Y(o,"stroke",t,"positive")}{const o=i("Rectangle",["column","autocolor"]).states.create("dropFromOpen",{});Y(o,"fill",t,"negative"),Y(o,"stroke",t,"negative")}i("Rectangle",["column","autocolor","pro"]).states.create("riseFromOpen",{fillOpacity:0}),i("Rectangle",["column","autocolor","pro"]).states.create("dropFromOpen",{fillOpacity:1});{const o=i("Rectangle",["column","autocolor","pro"]).states.create("riseFromPrevious",{});Y(o,"fill",t,"positive"),Y(o,"stroke",t,"positive")}{const o=i("Rectangle",["column","autocolor","pro"]).states.create("dropFromPrevious",{});Y(o,"fill",t,"negative"),Y(o,"stroke",t,"negative")}i("RoundedRectangle",["rangegrip"]).setAll({strokeOpacity:0,fillOpacity:0,strokeWidth:1,width:12,height:12});{const o=i("Graphics",["rangegrip","button","icon"]);o.setAll({interactive:!1,crisp:!0,strokeOpacity:.5,draw:l=>{l.moveTo(0,.5),l.lineTo(0,12.5),l.moveTo(2,.5),l.lineTo(2,12.5),l.moveTo(4,.5),l.lineTo(4,12.5)}}),Y(o,"stroke",t,"secondaryButtonText")}i("Button",["rangegrip"]).setAll({draggable:!0,paddingTop:0,paddingBottom:0}),i("Button",["rangegrip","vertical"]).setAll({rotation:90,cursorOverStyle:"ns-resize",centerX:ht}),i("Button",["rangegrip","horizontal"]).setAll({cursorOverStyle:"ew-resize",centerX:ht}),i("Button",["rangegrip","vertical","left"]).setAll({centerY:k}),i("Button",["rangegrip","vertical","right"]).setAll({centerY:0}),i("Button",["rangegrip","horizontal","top"]).setAll({centerY:0}),i("Button",["rangegrip","horizontal","bottom"]).setAll({centerY:k})}}class ft extends Nt{constructor(){super(...arguments),Object.defineProperty(this,"xAxes",{enumerable:!0,configurable:!0,writable:!0,value:new It}),Object.defineProperty(this,"yAxes",{enumerable:!0,configurable:!0,writable:!0,value:new It}),Object.defineProperty(this,"topAxesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.chartContainer.children.push(S.new(this._root,{width:k,layout:this._root.verticalLayout}))}),Object.defineProperty(this,"yAxesAndPlotContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.chartContainer.children.push(S.new(this._root,{width:k,height:k,layout:this._root.horizontalLayout}))}),Object.defineProperty(this,"bottomAxesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.chartContainer.children.push(S.new(this._root,{width:k,layout:this._root.verticalLayout}))}),Object.defineProperty(this,"leftAxesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.yAxesAndPlotContainer.children.push(S.new(this._root,{height:k,layout:this._root.horizontalLayout}))}),Object.defineProperty(this,"plotsContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.yAxesAndPlotContainer.children.push(S.new(this._root,{width:k,height:k,maskContent:!1}))}),Object.defineProperty(this,"plotContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.plotsContainer.children.push(S.new(this._root,{width:k,height:k}))}),Object.defineProperty(this,"topPlotContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.plotsContainer.children.push(S.new(this._root,{width:k,height:k}))}),Object.defineProperty(this,"gridContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.plotContainer.children.push(S.new(this._root,{width:k,height:k,isMeasured:!1}))}),Object.defineProperty(this,"topGridContainer",{enumerable:!0,configurable:!0,writable:!0,value:S.new(this._root,{width:k,height:k,isMeasured:!1})}),Object.defineProperty(this,"rightAxesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.yAxesAndPlotContainer.children.push(S.new(this._root,{height:k,layout:this._root.horizontalLayout}))}),Object.defineProperty(this,"axisHeadersContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.plotContainer.children.push(S.new(this._root,{}))}),Object.defineProperty(this,"zoomOutButton",{enumerable:!0,configurable:!0,writable:!0,value:this.topPlotContainer.children.push(ce.new(this._root,{themeTags:["zoom"],icon:G.new(this._root,{themeTags:["button","icon"]})}))}),Object.defineProperty(this,"_movePoint",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0}}),Object.defineProperty(this,"_wheelDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_otherCharts",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_movePoints",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_downStartX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downEndX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downStartY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downEndY",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){this._defaultThemes.push(ue.new(this._root)),super._afterNew(),this._disposers.push(this.xAxes),this._disposers.push(this.yAxes);const t=this._root;let e=this._root.verticalLayout;const i=this.zoomOutButton;i.events.on("click",()=>{this.zoomOut()}),i.hide(0),i.states.lookup("default").set("opacity",1),this.chartContainer.set("layout",e);const s=this.plotContainer;s.children.push(this.seriesContainer),this._disposers.push(this._processAxis(this.xAxes,this.bottomAxesContainer)),this._disposers.push(this._processAxis(this.yAxes,this.leftAxesContainer)),s.children.push(this.topGridContainer),s.children.push(this.bulletsContainer),s.set("interactive",!0),s.set("interactiveChildren",!1),s.set("background",nt.new(t,{themeTags:["xy","background"],fill:te.fromHex(0),fillOpacity:0})),this._disposers.push(s.events.on("pointerdown",a=>{this._handlePlotDown(a)})),this._disposers.push(s.events.on("globalpointerup",a=>{this._handlePlotUp(a)})),this._disposers.push(s.events.on("globalpointermove",a=>{this._handlePlotMove(a)})),this._maskGrid(),this._setUpTouch()}_beforeChanged(){super._beforeChanged(),(this.isDirty("pinchZoomX")||this.isDirty("pinchZoomY")||this.get("panX")||this.get("panY"))&&this._setUpTouch()}_setUpTouch(){this.plotContainer._display.cancelTouch||(this.plotContainer._display.cancelTouch=!!(this.get("pinchZoomX")||this.get("pinchZoomY")||this.get("panX")||this.get("panY")))}_maskGrid(){this.gridContainer.set("maskContent",!0),this.topGridContainer.set("maskContent",!0)}_removeSeries(t){t._unstack(),t._posXDp&&t._posXDp.dispose(),t._posYDp&&t._posYDp.dispose(),t.set("baseAxis",void 0);const e=t.get("xAxis");e&&(ct(e.series,t),e.markDirtyExtremes());const i=t.get("yAxis");i&&(ct(i.series,t),i.markDirtyExtremes());const s=this.get("cursor");if(s){const a=s.get("snapToSeries");a&&ct(a,t)}super._removeSeries(t)}handleWheel(t){const e=this.get("wheelX"),i=this.get("wheelY"),s=this.plotContainer,a=t.originalEvent;if(!ee(a,this))return;a.preventDefault();const n=s.toLocal(t.point),r=this.get("wheelStep",.2),o=a.deltaY/100,l=a.deltaX/100,c=this.get("wheelZoomPositionX"),h=this.get("wheelZoomPositionY");e!=="zoomX"&&e!=="zoomXY"||l==0||this.xAxes.each(d=>{if(d.get("zoomX")){let g=d.get("start"),p=d.get("end"),m=d.fixPosition(n.x/s.width());c!=null&&(m=c);let u=g-r*(p-g)*l*m,_=p+r*(p-g)*l*(1-m);1/(_-u){if(d.get("zoomX")){let g=d.get("start"),p=d.get("end"),m=d.fixPosition(n.x/s.width());c!=null&&(m=c);let u=g-r*(p-g)*o*m,_=p+r*(p-g)*o*(1-m);1/(_-u){if(d.get("zoomY")){let g=d.get("start"),p=d.get("end"),m=d.fixPosition(n.y/s.height());h!=null&&(m=h);let u=g-r*(p-g)*l*m,_=p+r*(p-g)*l*(1-m);1/(_-u){if(d.get("zoomY")){let g=d.get("start"),p=d.get("end"),m=d.fixPosition(n.y/s.height());h!=null&&(m=h);let u=g-r*(p-g)*o*m,_=p+r*(p-g)*o*(1-m);1/(_-u){if(d.get("panX")){let g=d.get("start"),p=d.get("end"),m=this._getWheelSign(d)*r*(p-g)*l,u=g+m,_=p+m,f=this._fixWheel(u,_);u=f[0],_=f[1],this._handleWheelAnimation(d.zoom(u,_))}}),i!=="panX"&&i!=="panXY"||o==0||this.xAxes.each(d=>{if(d.get("panX")){let g=d.get("start"),p=d.get("end"),m=this._getWheelSign(d)*r*(p-g)*o,u=g+m,_=p+m,f=this._fixWheel(u,_);u=f[0],_=f[1],this._handleWheelAnimation(d.zoom(u,_))}}),e!=="panY"&&e!=="panXY"||l==0||this.yAxes.each(d=>{if(d.get("panY")){let g=d.get("start"),p=d.get("end"),m=this._getWheelSign(d)*r*(p-g)*l,u=g+m,_=p+m,f=this._fixWheel(u,_);u=f[0],_=f[1],this._handleWheelAnimation(d.zoom(u,_))}}),i!=="panY"&&i!=="panXY"||o==0||this.yAxes.each(d=>{if(d.get("panY")){let g=d.get("start"),p=d.get("end"),m=this._getWheelSign(d)*r*(p-g)*o,u=g-m,_=p-m,f=this._fixWheel(u,_);u=f[0],_=f[1],this._handleWheelAnimation(d.zoom(u,_))}})}_handleSetWheel(){const t=this.get("wheelX"),e=this.get("wheelY"),i=this.plotContainer;t!=="none"||e!=="none"?(this._wheelDp=i.events.on("wheel",s=>{const a=s.originalEvent;(t!=="none"&&Math.abs(a.deltaX)!=0||e!=="none"&&Math.abs(a.deltaY)!=0)&&this.handleWheel(s)}),this._disposers.push(this._wheelDp)):this._wheelDp&&this._wheelDp.dispose()}_getWheelSign(t){let e=1;return t.get("renderer").get("inversed")&&(e=-1),e}_fixWheel(t,e){const i=e-t;return t<0&&(e=(t=0)+i),e>1&&(t=(e=1)-i),[t,e]}_handlePlotDown(t){const e=t.originalEvent;if(e.button==2)return;const i=this.plotContainer;let s=i.toLocal(t.point);if((this.get("pinchZoomX")||this.get("pinchZoomY"))&&e.pointerId&&mt(i._downPoints).length>0){const a=this.xAxes.getIndex(0),n=this.yAxes.getIndex(0);a&&(this._downStartX=a.get("start",0),this._downEndX=a.get("end",1)),n&&(this._downStartY=n.get("start",0),this._downEndY=n.get("end",1))}if((this.get("panX")||this.get("panY"))&&s.x>=0&&s.y>=0&&s.x<=i.width()&&s.y<=this.height()){this._downPoint={x:e.clientX,y:e.clientY};const a=this.get("panX"),n=this.get("panY");a&&this.xAxes.each(o=>{o._panStart=o.get("start"),o._panEnd=o.get("end")}),n&&this.yAxes.each(o=>{o._panStart=o.get("start"),o._panEnd=o.get("end")});const r="panstarted";this.events.isEnabled(r)&&this.events.dispatch(r,{type:r,target:this,originalEvent:t.originalEvent})}}_handleWheelAnimation(t){t?t.events.on("stopped",()=>{this._dispatchWheelAnimation()}):this._dispatchWheelAnimation()}_dispatchWheelAnimation(){const t="wheelended";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this})}_handlePlotUp(t){const e=this._downPoint;if(e&&(this.get("panX")||this.get("panY"))){let i=this.plotContainer.toLocal(t.point);if(i.x==e.x&&i.y==e.y){const a="pancancelled";this.events.isEnabled(a)&&this.events.dispatch(a,{type:a,target:this,originalEvent:t.originalEvent})}const s="panended";this.events.isEnabled(s)&&this.events.dispatch(s,{type:s,target:this,originalEvent:t.originalEvent})}this._downPoint=void 0,this.xAxes.each(i=>{i._isPanning=!1}),this.yAxes.each(i=>{i._isPanning=!1})}_handlePlotMove(t){const e=this.plotContainer;if(this.get("pinchZoomX")||this.get("pinchZoomY")){const s=t.originalEvent.pointerId;if(s&&(this._movePoints[s]=t.point,mt(e._downPoints).length>1))return void this._handlePinch()}let i=this._downPoint;if(i){i=e.toLocal(this._root.documentPointToRoot(i));let s=e.toLocal(t.point);const a=this.get("panX"),n=this.get("panY");if(a){let r=this.get("scrollbarX");r&&r.events.disableType("rangechanged"),this.xAxes.each(o=>{if(o.get("panX")){o._isPanning=!0;let l=o._panStart,c=o._panEnd,h=(c-l)*(i.x-s.x)/e.width();o.get("renderer").get("inversed")&&(h*=-1);let d=l+h,g=c+h;g-d<1+2*o.get("maxDeviation",1)&&(o.set("start",d),o.set("end",g))}}),r&&r.events.enableType("rangechanged")}if(n){let r=this.get("scrollbarY");r&&r.events.disableType("rangechanged"),this.yAxes.each(o=>{if(o.get("panY")){o._isPanning=!0;let l=o._panStart,c=o._panEnd,h=(c-l)*(i.y-s.y)/e.height();o.get("renderer").get("inversed")&&(h*=-1);let d=l-h,g=c-h;g-d<1+2*o.get("maxDeviation",1)&&(o.set("start",d),o.set("end",g))}}),r&&r.events.enableType("rangechanged")}}}_handlePinch(){const t=this.plotContainer;let e=0,i=[],s=[];if(gt(t._downPoints,(a,n)=>{i[e]=n;let r=this._movePoints[a];r&&(s[e]=r),e++}),i.length>1&&s.length>1){const a=t.width(),n=t.height();let r=i[0],o=i[1],l=s[0],c=s[1];if(r&&o&&l&&c){if(l=t.toLocal(l),c=t.toLocal(c),r=t.toLocal(r),o=t.toLocal(o),this.get("pinchZoomX")){const h=this._downStartX,d=this._downEndX;if(h!=null&&d!=null){r.x>o.x&&([r,o]=[o,r],[l,c]=[c,l]);let g=h+r.x/a*(d-h),p=h+o.x/a*(d-h),m=h+l.x/a*(d-h),u=h+c.x/a*(d-h),_=Math.max(.001,p-g)/Math.max(.001,u-m),f=h*_+g-m*_,x=d*_+p-u*_;this.xAxes.each(b=>{let y=b.fixPosition(f),A=b.fixPosition(x);b.zoom(y,A,0)})}}if(this.get("pinchZoomY")){const h=this._downStartY,d=this._downEndY;if(h!=null&&d!=null){r.y{let y=b.fixPosition(f),A=b.fixPosition(x);b.zoom(y,A,0)})}}}}}_handleCursorPosition(){const t=this.get("cursor");if(t){const e=t.getPrivate("point");let i=t.get("snapToSeries");if(t._downPoint&&(i=void 0),i&&e){const s=t.get("snapToSeriesBy"),a=[];w(i,o=>{if(!o.isHidden()&&!o.isHiding())if(s!="x!"&&s!="y!"){const l=o.startIndex(),c=o.endIndex();for(let h=l;h{const l=o.get("point");if(l){let c=0;c=s=="x"||s=="x!"?Math.abs(e.x-l.x):s=="y"||s=="y!"?Math.abs(e.y-l.y):Math.hypot(e.x-l.x,e.y-l.y),c{const l=o.get("tooltip");l&&l._setDataItem(void 0)}),n){let o=n.component;o.showDataItemTooltip(n);const l=n.get("point");l&&t.handleMove(o.toGlobal({x:l.x-o.x(),y:l.y-o.y()}),!0)}}}}_updateCursor(){let t=this.get("cursor");t&&t.updateCursor()}_addCursor(t){this.plotContainer.children.push(t)}_prepareChildren(){if(super._prepareChildren(),this.series.each(t=>{this._colorize(t)}),(this.isDirty("wheelX")||this.isDirty("wheelY"))&&this._handleSetWheel(),this.isDirty("cursor")){const t=this._prevSettings.cursor,e=this.get("cursor");e!==t&&(this._disposeProperty("cursor"),t&&t.dispose(),e&&(e._setChart(this),this._addCursor(e),this._pushPropertyDisposer("cursor",e.events.on("selectended",()=>{this._handleCursorSelectEnd()}))),this._prevSettings.cursor=e)}if(this.isDirty("scrollbarX")){const t=this._prevSettings.scrollbarX,e=this.get("scrollbarX");e!==t&&(this._disposeProperty("scrollbarX"),t&&t.dispose(),e&&(e.parent||this.topAxesContainer.children.push(e),this._pushPropertyDisposer("scrollbarX",e.events.on("rangechanged",i=>{this._handleScrollbar(this.xAxes,i.start,i.end,i.grip)})),e.setPrivate("positionTextFunction",i=>{const s=this.xAxes.getIndex(0);return s&&s.getTooltipText(i,!1)||""})),this._prevSettings.scrollbarX=e)}if(this.isDirty("scrollbarY")){const t=this._prevSettings.scrollbarY,e=this.get("scrollbarY");e!==t&&(this._disposeProperty("scrollbarY"),t&&t.dispose(),e&&(e.parent||this.rightAxesContainer.children.push(e),this._pushPropertyDisposer("scrollbarY",e.events.on("rangechanged",i=>{this._handleScrollbar(this.yAxes,i.start,i.end,i.grip)})),e.setPrivate("positionTextFunction",i=>{const s=this.yAxes.getIndex(0);return s&&s.getTooltipText(i,!1)||""})),this._prevSettings.scrollbarY=e)}this._handleZoomOut()}_processSeries(t){super._processSeries(t);const e=t.get("xAxis"),i=t.get("yAxis");Ct(e.series,t),Ct(i.series,t),t._posXDp=t.addDisposer(e.events.on("positionchanged",()=>{t._fixPosition()})),t._posXDp=t.addDisposer(i.events.on("positionchanged",()=>{t._fixPosition()})),t.get("baseAxis")||(i.isType("CategoryAxis")||i.isType("DateAxis")?t.set("baseAxis",i):t.set("baseAxis",e)),t.get("stacked")&&(t._markDirtyKey("stacked"),w(t.dataItems,s=>{s.set("stackToItemY",void 0),s.set("stackToItemX",void 0)})),t._markDirtyAxes(),i.markDirtyExtremes(),e.markDirtyExtremes(),e._seriesAdded=!0,i._seriesAdded=!0,this._colorize(t)}_colorize(t){const e=this.get("colors");if(e&&t.get("fill")==null){const i=e.next();t._setSoft("stroke",i),t._setSoft("fill",i)}}_handleCursorSelectEnd(){const t=this.get("cursor"),e=t.get("behavior"),i=t.getPrivate("downPositionX",0),s=t.getPrivate("downPositionY",0),a=Math.min(1,Math.max(0,t.getPrivate("positionX",.5))),n=Math.min(1,Math.max(0,t.getPrivate("positionY",.5)));this.xAxes.each(r=>{if(e==="zoomX"||e==="zoomXY"){let o=r.toAxisPosition(i),l=r.toAxisPosition(a);r.zoom(o,l)}r.setPrivate("updateScrollbar",!0)}),this.yAxes.each(r=>{if(e==="zoomY"||e==="zoomXY"){let o=r.toAxisPosition(s),l=r.toAxisPosition(n);r.zoom(o,l)}r.setPrivate("updateScrollbar",!0)})}_handleScrollbar(t,e,i,s){t.each(a=>{let n=a.fixPosition(e),r=a.fixPosition(i),o=a.zoom(n,r,void 0,s);const l="updateScrollbar";a.setPrivateRaw(l,!1),o?o.events.on("stopped",()=>{a.setPrivateRaw(l,!0)}):a.setPrivateRaw(l,!0)})}_processAxis(t,e){return t.events.onAll(i=>{if(i.type==="clear")w(i.oldValues,s=>{this._removeAxis(s)});else if(i.type==="push")e.children.push(i.newValue),i.newValue.processChart(this);else if(i.type==="setIndex")e.children.setIndex(i.index,i.newValue),i.newValue.processChart(this);else if(i.type==="insertIndex")e.children.insertIndex(i.index,i.newValue),i.newValue.processChart(this);else if(i.type==="removeIndex")this._removeAxis(i.oldValue);else{if(i.type!=="moveIndex")throw new Error("Unknown IListEvent type");e.children.moveValue(i.value,i.newIndex),i.value.processChart(this)}})}_removeAxis(t){if(!t.isDisposed()){const e=t.parent;e&&e.children.removeValue(t);const i=t.gridContainer,s=i.parent;s&&s.children.removeValue(i);const a=t.topGridContainer,n=a.parent;n&&n.children.removeValue(a)}}_updateChartLayout(){const t=this.leftAxesContainer.width(),e=this.rightAxesContainer.width(),i=this.bottomAxesContainer;i.set("paddingLeft",t),i.set("paddingRight",e);const s=this.topAxesContainer;s.set("paddingLeft",t),s.set("paddingRight",e)}processAxis(t){this.get("cursor")&&(this.addDisposer(t.on("start",()=>{this._updateCursor()})),this.addDisposer(t.on("end",()=>{this._updateCursor()})))}_handleAxisSelection(t,e){let i=t.fixPosition(t.get("start",0)),s=t.fixPosition(t.get("end",1));if(i>s&&([i,s]=[s,i]),this.xAxes.indexOf(t)!=-1){if(e||t.getPrivate("updateScrollbar")){let a=this.get("scrollbarX");!a||a.getPrivate("isBusy")&&!e||(a.setRaw("start",i),a.setRaw("end",s),a.updateGrips())}}else if(this.yAxes.indexOf(t)!=-1&&(e||t.getPrivate("updateScrollbar"))){let a=this.get("scrollbarY");!a||a.getPrivate("isBusy")&&!e||(a.setRaw("start",i),a.setRaw("end",s),a.updateGrips())}this._handleZoomOut()}_handleZoomOut(){let t=this.zoomOutButton;if(t&&t.parent){let e=!1;this.xAxes.each(i=>{i.get("start")==0&&i.get("end")==1||(e=!0)}),this.yAxes.each(i=>{i.get("start")==0&&i.get("end")==1||(e=!0)}),e?t.isHidden()&&t.show():t.hide()}}inPlot(t){const e=this.plotContainer,i=this.getPrivate("otherCharts",this._otherCharts),s=e.toGlobal(t);if(t.x>=-.5&&t.y>=-.5&&t.x<=e.width()+.5&&t.y<=e.height()+.5)return!0;if(i)for(let a=i.length-1;a>=0;a--){const n=i[a];if(n!=this){const r=n.plotContainer,o=this._root.rootPointToDocument(s),l=n._root.documentPointToRoot(o),c=r.toLocal(l);if(c.x>=-.1&&c.y>=-.1&&c.x<=r.width()+.1&&c.y<=r.height()+.1)return!0}}return!1}arrangeTooltips(){const t=this.plotContainer,e=t.width(),i=t.height(),s=this.height();let a=t._display.toGlobal({x:0,y:0}),n=t._display.toGlobal({x:e,y:i});const r=[];let o,l,c=0,h=1/0,d=this._movePoint,g=this.get("maxTooltipDistance"),p=this.get("maxTooltipDistanceBy","xy");v(g)&&this.series.each(u=>{if(!u.isHidden()){const _=u.get("tooltip");if(_){let f=_.get("pointTo");if(f){let x=Math.hypot(d.x-f.x,d.y-f.y);p=="x"?x=Math.abs(d.x-f.x):p=="y"&&(x=Math.abs(d.y-f.y)),x{const _=u.get("tooltip");if(_&&!_.get("forceHidden")){let f=!1,x=_.get("pointTo");if(x){if(g>=0){let b=_.get("pointTo");if(b&&l&&u!=o){let y=Math.hypot(l.x-b.x,l.y-b.y);p=="x"?y=Math.abs(l.x-b.x):p=="y"&&(y=Math.abs(l.y-b.y)),y>g&&(f=!0)}}else g==-1&&u!=o&&(f=!0);this.inPlot(this._tooltipToLocal(x))&&_.dataItem?f||(c+=x.y):f=!0,f||u.isHidden()||u.isHiding()?_.hide(0):(_.show(),r.push(_),m.push(u))}}}),this.setPrivate("tooltipSeries",m),this.get("arrangeTooltips")){const u=this._root.tooltipContainer,_=r.length;if(c/_>i/2+a.y){r.sort((x,b)=>Ot(b.get("pointTo").y,x.get("pointTo").y));let f=n.y;if(w(r,x=>{let b=x.height(),y=x.get("centerY");y instanceof et&&(b*=y.value),b+=x.get("marginBottom",0),x.set("bounds",{left:a.x,top:a.y,right:n.x,bottom:f}),x.setPrivate("customData",{left:a.x,top:a.y,right:n.x,bottom:f}),f=Math.min(f-b,x._fy-b),x.parent==u&&u.children.moveValue(x,0)}),f<0){r.reverse();let x=f;w(r,b=>{let y=b.get("bounds");if(y){let A=y.top-f,I=y.bottom-f;AOt(x.get("pointTo").y,b.get("pointTo").y));let f=0;if(w(r,x=>{let b=x.height(),y=x.get("centerY");y instanceof et&&(b*=y.value),b+=x.get("marginBottom",0),x.set("bounds",{left:a.x,top:f,right:n.x,bottom:Math.max(a.y+s,f+b)}),x.parent==u&&u.children.moveValue(x,0),f=Math.max(f+b,x._fy+b)}),f>s){r.reverse();let x=s;w(r,b=>{let y=b.get("bounds");if(y){let A=y.top-(s-f),I=y.bottom-(s-f);I>x&&(I=x,A=I-b.height()),b.set("bounds",{left:y.left,top:A,right:y.right,bottom:I}),x=I-b.height()-b.get("marginBottom",0)}})}}}}_tooltipToLocal(t){return this.plotContainer.toLocal(t)}zoomOut(){this.xAxes.each(t=>{t.setPrivate("updateScrollbar",!0),t.zoom(0,1)}),this.yAxes.each(t=>{t.setPrivate("updateScrollbar",!0),t.zoom(0,1)})}}Object.defineProperty(ft,"className",{enumerable:!0,configurable:!0,writable:!0,value:"XYChart"}),Object.defineProperty(ft,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Nt.classNames.concat([ft.className])});class st extends G{_beforeChanged(){super._beforeChanged(),(this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&(this._clear=!0)}}Object.defineProperty(st,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Grid"}),Object.defineProperty(st,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:G.classNames.concat([st.className])});class vt extends S{constructor(){super(...arguments),Object.defineProperty(this,"lineX",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(st.new(this._root,{themeTags:["x"]}))}),Object.defineProperty(this,"lineY",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(st.new(this._root,{themeTags:["y"]}))}),Object.defineProperty(this,"selection",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(G.new(this._root,{themeTags:["selection","cursor"],layer:30}))}),Object.defineProperty(this,"_movePoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_lastPoint",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0}}),Object.defineProperty(this,"_tooltipX",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_tooltipY",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"chart",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_toX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_toY",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){this._settings.themeTags=F(this._settings.themeTags,["xy","cursor"]),super._afterNew(),this.setAll({width:k,height:k,isMeasured:!0,position:"absolute"}),this.states.create("hidden",{visible:!0,opacity:0}),this._drawLines(),this.setPrivateRaw("visible",!1),this._disposers.push(this.setTimeout(()=>{this.setPrivate("visible",!0)},500)),this._disposers.push(this.lineX.events.on("positionchanged",()=>{this._handleXLine()})),this._disposers.push(this.lineY.events.on("positionchanged",()=>{this._handleYLine()})),this._disposers.push(this.lineX.events.on("focus",t=>this._handleLineFocus(t.target))),this._disposers.push(this.lineX.events.on("blur",t=>this._handleLineBlur(t.target))),this._disposers.push(this.lineY.events.on("focus",t=>this._handleLineFocus(t.target))),this._disposers.push(this.lineY.events.on("blur",t=>this._handleLineBlur(t.target))),Xt("keyboardevents")&&this._disposers.push(ie(document,"keydown",t=>{this._handleLineMove(t.keyCode)}))}_setUpTouch(){const t=this.chart;t&&(t.plotContainer._display.cancelTouch=this.get("behavior")!="none")}_handleXLine(){let t=this.lineX.x(),e=!0;(t<0||t>this.width())&&(e=!1),this.lineX.setPrivate("visible",e)}_handleYLine(){let t=this.lineY.y(),e=!0;(t<0||t>this.height())&&(e=!1),this.lineY.setPrivate("visible",e)}_handleLineMove(t){let e="",i=0,s=.1;const a=this.chart;this._root.focused(this.lineX)?(a&&a.xAxes.length&&(s=a.xAxes.getIndex(0).getCellWidthPosition()),i=this.getPrivate("positionX",0),e="positionX",t==37?i-=s:t==39&&(i+=s)):this._root.focused(this.lineY)&&(a&&a.yAxes.length&&(s=a.yAxes.getIndex(0).getCellWidthPosition()),i=this.getPrivate("positionY",0),e="positionY",t==38?i-=s:t==40&&(i+=s)),i<0?i=0:i>1&&(i=1),e!=""&&this.set(e,i)}_handleLineFocus(t){this.setAll({positionX:this.getPrivate("positionX"),positionY:this.getPrivate("positionY"),alwaysShow:!0})}_handleLineBlur(t){this.setAll({positionX:void 0,positionY:void 0,alwaysShow:!1})}_prepareChildren(){if(super._prepareChildren(),this.isDirty("xAxis")){this._tooltipX=!1;const t=this.get("xAxis");if(t){const e=t.get("tooltip");e&&(this._tooltipX=!0,this._disposers.push(e.on("pointTo",()=>{this._updateXLine(e)})))}}if(this.isDirty("yAxis")){this._tooltipY=!1;const t=this.get("yAxis");if(t){const e=t.get("tooltip");e&&(this._tooltipY=!0,this._disposers.push(e.on("pointTo",()=>{this._updateYLine(e)})))}}}_handleSyncWith(){const t=this.chart;if(t){const e=this.get("syncWith"),i=[];e&&w(e,s=>{const a=s.chart;a&&i.push(a)}),t._otherCharts=i}}_updateChildren(){if(super._updateChildren(),this._handleSyncWith(),this.isDirty("positionX")||this.isDirty("positionY")){const t=this.get("positionX"),e=this.get("positionY");t==null&&e==null?this.hide(0):(this._movePoint=this.toGlobal(this._getPoint(this.get("positionX",0),this.get("positionY",0))),this.handleMove())}}_updateXLine(t){let e=j(this._display.toLocal(t.get("pointTo",{x:0,y:0})).x,2);this._toX!=e&&(this.lineX.animate({key:"x",to:e,duration:t.get("animationDuration",0),easing:t.get("animationEasing")}),this._toX=e)}_updateYLine(t){let e=j(this._display.toLocal(t.get("pointTo",{x:0,y:0})).y,2);this._toY!=e&&(this.lineY.animate({key:"y",to:e,duration:t.get("animationDuration",0),easing:t.get("animationEasing")}),this._toY=e)}_drawLines(){this.lineX.set("draw",t=>{t.moveTo(0,0),t.lineTo(0,this.height())}),this.lineY.set("draw",t=>{t.moveTo(0,0),t.lineTo(this.width(),0)})}updateCursor(){this.get("alwaysShow")&&(this._movePoint=this.toGlobal(this._getPoint(this.get("positionX",0),this.get("positionY",0)))),this.handleMove()}_setChart(t){this.chart=t,this._handleSyncWith();const e=t.plotContainer;this.events.on("boundschanged",()=>{this._disposers.push(this.setTimeout(()=>{this.updateCursor()},50))}),Xt("touchevents")&&(this._disposers.push(e.events.on("click",s=>{se(s.originalEvent)&&this._handleMove(s)})),this._setUpTouch()),this._disposers.push(e.events.on("pointerdown",s=>{this._handleCursorDown(s)})),this._disposers.push(e.events.on("globalpointerup",s=>{this._handleCursorUp(s),s.native||this.isHidden()||this._handleMove(s)})),this._disposers.push(e.events.on("globalpointermove",s=>{(this.get("syncWith")||mt(e._downPoints).length!=0||s.native||!this.isHidden())&&this._handleMove(s)}));const i=this.parent;i&&i.children.moveValue(this.selection)}_inPlot(t){const e=this.chart;return!!e&&e.inPlot(t)}_handleCursorDown(t){if(t.originalEvent.button==2)return;const e=t.point;let i=this._display.toLocal(e);const s=this.chart;if(this.selection.set("draw",()=>{}),s&&this._inPlot(i)){if(this._downPoint=i,this.get("behavior")!="none"){this.selection.show();const r="selectstarted";this.events.isEnabled(r)&&this.events.dispatch(r,{type:r,target:this,originalEvent:t.originalEvent})}let a=this._getPosition(i).x,n=this._getPosition(i).y;this.setPrivate("downPositionX",a),this.setPrivate("downPositionY",n)}}_handleCursorUp(t){if(this._downPoint){const e=this.get("behavior","none");if(e!="none"){e.charAt(0)==="z"&&this.selection.hide();const i=t.point;let s=this._display.toLocal(i);const a=this._downPoint,n=this.get("moveThreshold",1);if(s&&a){let r=!1;if(e!=="zoomX"&&e!=="zoomXY"&&e!=="selectX"&&e!=="selectXY"||Math.abs(s.x-a.x)>n&&(r=!0),e!=="zoomY"&&e!=="zoomXY"&&e!=="selectY"&&e!=="selectXY"||Math.abs(s.y-a.y)>n&&(r=!0),r){const o="selectended";this.events.isEnabled(o)&&this.events.dispatch(o,{type:o,target:this,originalEvent:t.originalEvent})}else{const o="selectcancelled";this.events.isEnabled(o)&&this.events.dispatch(o,{type:o,target:this,originalEvent:t.originalEvent})}}}}this._downPoint=void 0}_handleMove(t){if(this.getPrivate("visible")){const e=this.chart;if(e&&mt(e.plotContainer._downPoints).length>1)return void this.set("forceHidden",!0);this.set("forceHidden",!1);const i=t.point,s=this._lastPoint;if(Math.round(s.x)===Math.round(i.x)&&Math.round(s.y)===Math.round(i.y))return;this._lastPoint=i,this.setPrivate("lastPoint",i),this.handleMove({x:i.x,y:i.y},!1,t.originalEvent)}}_getPosition(t){return{x:t.x/this.width(),y:t.y/this.height()}}handleMove(t,e,i){t||(t=this._movePoint);const s=this.get("alwaysShow");if(!t)return void this.hide(0);this._movePoint=t;let a=this._display.toLocal(t),n=this.chart;if(n&&(this._inPlot(a)||this._downPoint)){n._movePoint=t,this.isHidden()&&(this.show(),this.get("behavior","").charAt(0)=="z"&&this.selection.set("draw",()=>{}));let r=a.x,o=a.y,l=this._getPosition(a);this.setPrivate("point",a);let c=this.get("snapToSeries");this._downPoint&&(c=void 0);let h=this.get("positionX"),d=l.x;v(h)&&(d=h);let g=this.get("positionY"),p=l.y;v(g)&&(p=g),this.setPrivate("positionX",d),this.setPrivate("positionY",p);const m=this._getPoint(d,p);if(r=m.x,o=m.y,n.xAxes.each(u=>{u._handleCursorPosition(d,c),s&&u.handleCursorShow()}),n.yAxes.each(u=>{u._handleCursorPosition(p,c),s&&u.handleCursorShow()}),!e){n._handleCursorPosition();const u="cursormoved";this.events.isEnabled(u)&&this.events.dispatch(u,{type:u,target:this,point:t,originalEvent:i})}this._updateLines(r,o),n.arrangeTooltips()}else if(!this._downPoint&&!s){this.hide(0);const r="cursorhidden";this.events.isEnabled(r)&&this.events.dispatch(r,{type:r,target:this})}this._downPoint&&this.get("behavior")!="none"&&this._updateSelection(a)}_getPoint(t,e){return{x:this.width()*t,y:this.height()*e}}_updateLines(t,e){this._tooltipX||this.lineX.set("x",t),this._tooltipY||this.lineY.set("y",e),this._drawLines()}_updateSelection(t){const e=this.selection,i=this.get("behavior"),s=this.width(),a=this.height();t.x<0&&(t.x=0),t.x>s&&(t.x=s),t.y<0&&(t.y=0),t.y>a&&(t.y=a),e.set("draw",n=>{const r=this._downPoint;r&&(i==="zoomXY"||i==="selectXY"?(n.moveTo(r.x,r.y),n.lineTo(r.x,t.y),n.lineTo(t.x,t.y),n.lineTo(t.x,r.y),n.lineTo(r.x,r.y)):i==="zoomX"||i==="selectX"?(n.moveTo(r.x,0),n.lineTo(r.x,a),n.lineTo(t.x,a),n.lineTo(t.x,0),n.lineTo(r.x,0)):i!=="zoomY"&&i!=="selectY"||(n.moveTo(0,r.y),n.lineTo(s,r.y),n.lineTo(s,t.y),n.lineTo(0,t.y),n.lineTo(0,r.y)))})}_onHide(){if(this.isHidden()){let t=this.chart;t&&(t.xAxes.each(e=>{e.handleCursorHide()}),t.yAxes.each(e=>{e.handleCursorHide()}),t.series.each(e=>{e.handleCursorHide()}))}super._onHide()}_onShow(){if(!this.isHidden()){let t=this.chart;t&&(t.xAxes.each(e=>{e.handleCursorShow()}),t.yAxes.each(e=>{e.handleCursorShow()}))}super._onShow()}_dispose(){super._dispose(),this.selection.dispose()}}function pe(P,t){return P==null?t:t==null?P:tP?t:P}Object.defineProperty(vt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"XYCursor"}),Object.defineProperty(vt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:S.classNames.concat([vt.className])});class U extends zt{constructor(){super(...arguments),Object.defineProperty(this,"_xField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_yField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_xOpenField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_yOpenField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_xLowField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_xHighField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_yLowField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_yHighField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_axesDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_stackDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_selectionProcessed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataSets",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_mainContainerMask",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_y",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_bullets",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"mainContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(S.new(this._root,{}))}),Object.defineProperty(this,"axisRanges",{enumerable:!0,configurable:!0,writable:!0,value:new Et}),Object.defineProperty(this,"_skipped",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_couldStackTo",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_reallyStackedTo",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_stackedSeries",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_aLocationX0",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_aLocationX1",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_aLocationY0",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_aLocationY1",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_showBullets",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"valueXFields",{enumerable:!0,configurable:!0,writable:!0,value:["valueX","openValueX","lowValueX","highValueX"]}),Object.defineProperty(this,"valueYFields",{enumerable:!0,configurable:!0,writable:!0,value:["valueY","openValueY","lowValueY","highValueY"]}),Object.defineProperty(this,"_valueXFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueYFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueXShowFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueYShowFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"__valueXShowFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"__valueYShowFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_emptyDataItem",{enumerable:!0,configurable:!0,writable:!0,value:new ot(this,void 0,{})}),Object.defineProperty(this,"_dataSetId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipFieldX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipFieldY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_posXDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_posYDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){this.fields.push("categoryX","categoryY","openCategoryX","openCategoryY"),this.valueFields.push("valueX","valueY","openValueX","openValueY","lowValueX","lowValueY","highValueX","highValueY"),this._setRawDefault("vcx",1),this._setRawDefault("vcy",1),this._setRawDefault("valueXShow","valueXWorking"),this._setRawDefault("valueYShow","valueYWorking"),this._setRawDefault("openValueXShow","openValueXWorking"),this._setRawDefault("openValueYShow","openValueYWorking"),this._setRawDefault("lowValueXShow","lowValueXWorking"),this._setRawDefault("lowValueYShow","lowValueYWorking"),this._setRawDefault("highValueXShow","highValueXWorking"),this._setRawDefault("highValueYShow","highValueYWorking"),this._setRawDefault("lowValueXGrouped","low"),this._setRawDefault("lowValueYGrouped","low"),this._setRawDefault("highValueXGrouped","high"),this._setRawDefault("highValueYGrouped","high"),super._afterNew(),this.set("maskContent",!0),this._disposers.push(this.axisRanges.events.onAll(t=>{if(t.type==="clear")w(t.oldValues,e=>{this._removeAxisRange(e)});else if(t.type==="push")this._processAxisRange(t.newValue);else if(t.type==="setIndex")this._processAxisRange(t.newValue);else if(t.type==="insertIndex")this._processAxisRange(t.newValue);else if(t.type==="removeIndex")this._removeAxisRange(t.oldValue);else{if(t.type!=="moveIndex")throw new Error("Unknown IStreamEvent type");this._processAxisRange(t.value)}})),this.states.create("hidden",{opacity:1,visible:!1}),this.onPrivate("startIndex",()=>{this.updateLegendValue()}),this.onPrivate("endIndex",()=>{this.updateLegendValue()}),this._makeFieldNames()}_processAxisRange(t){const e=S.new(this._root,{});t.container=e,this.children.push(e),t.series=this;const i=t.axisDataItem;i.setRaw("isRange",!0);const s=i.component;if(s){s._processAxisRange(i,["range","series"]);const a=i.get("bullet");if(a){const r=a.get("sprite");r&&r.setPrivate("visible",!1)}const n=i.get("axisFill");n&&e.set("mask",n),s._seriesAxisRanges.push(i)}}_removeAxisRange(t){const e=t.axisDataItem,i=e.component;i.disposeDataItem(e),ct(i._seriesAxisRanges,e);const s=t.container;s&&s.dispose()}_updateFields(){super._updateFields(),this._valueXFields=[],this._valueYFields=[],this._valueXShowFields=[],this._valueYShowFields=[],this.__valueXShowFields=[],this.__valueYShowFields=[],this.valueXFields&&w(this.valueXFields,t=>{if(this.get(t+"Field")){this._valueXFields.push(t);let e=this.get(t+"Show");this.__valueXShowFields.push(e),e.indexOf("Working")!=-1?this._valueXShowFields.push(e.split("Working")[0]):this._valueXShowFields.push(e)}}),this.valueYFields&&w(this.valueYFields,t=>{if(this.get(t+"Field")){this._valueYFields.push(t);let e=this.get(t+"Show");this.__valueYShowFields.push(e),e.indexOf("Working")!=-1?this._valueYShowFields.push(e.split("Working")[0]):this._valueYShowFields.push(e)}})}_dispose(){super._dispose(),this._bullets={};const t=this.chart;t&&t.series.removeValue(this),St(this.get("xAxis").series,this),St(this.get("yAxis").series,this)}_min(t,e){let i=pe(this.getPrivate(t),e);this.setPrivate(t,i)}_max(t,e){let i=me(this.getPrivate(t),e);this.setPrivate(t,i)}_shouldMakeBullet(t){const e=this.get("xAxis"),i=this.get("yAxis"),s=this.get("baseAxis");if(!e.inited||!i.inited)return!1;const a=this.get("minBulletDistance",0);if(a>0){let n=this.startIndex(),r=this.endIndex()-n;if(e==s){if(e.get("renderer").axisLength()/r{w(this._valueXShowFields,o=>{let l=r.get(o);l!=null&&(n&&(l+=this.getStackedXValue(r,o)),this._min("minX",l),this._max("maxX",l))}),w(this._valueYShowFields,o=>{let l=r.get(o);l!=null&&(n&&(l+=this.getStackedYValue(r,o)),this._min("minY",l),this._max("maxY",l))}),t.processSeriesDataItem(r,this._valueXFields),e.processSeriesDataItem(r,this._valueYFields)}),t._seriesValuesDirty=!0,e._seriesValuesDirty=!0,this.get("ignoreMinMax")||((this.isPrivateDirty("minX")||this.isPrivateDirty("maxX"))&&t.markDirtyExtremes(),(this.isPrivateDirty("minY")||this.isPrivateDirty("maxY"))&&e.markDirtyExtremes()),this._markStakedDirtyStack(),this.get("tooltipDataItem")||this.updateLegendValue(void 0)),(this.isDirty("vcx")||this.isDirty("vcy"))&&this._markStakedDirtyStack(),this._dataGrouped||(t._groupSeriesData(this),e._groupSeriesData(this),this._dataGrouped=!0),this._valuesDirty||this.isPrivateDirty("startIndex")||this.isPrivateDirty("adjustedStartIndex")||this.isPrivateDirty("endIndex")||this.isDirty("vcx")||this.isDirty("vcy")||this._stackDirty||this._sizeDirty){let r=this.startIndex(),o=this.endIndex(),l=this.get("minBulletDistance",0);if(l>0&&i&&(i.get("renderer").axisLength()/(o-r)>l?this._showBullets=!0:this._showBullets=!1),(this._psi!=r||this._pei!=o||this.isDirty("vcx")||this.isDirty("vcy")||this.isPrivateDirty("adjustedStartIndex")||this._stackDirty||this._valuesDirty)&&!this._selectionProcessed){this._selectionProcessed=!0;const c=this.get("vcx",1),h=this.get("vcy",1),d=this.get("stacked",!1),g=this.getPrivate("outOfSelection");if(i===t||!i)if(e._calculateTotals(),this.setPrivateRaw("selectionMinY",void 0),this.setPrivateRaw("selectionMaxY",void 0),g)e.markDirtySelectionExtremes();else for(let p=r;p0){let t=this._mainContainerMask;t==null&&(t=this.children.push(G.new(this._root,{})),this._mainContainerMask=t,t.set("draw",(e,i)=>{const s=this.parent;if(s){const a=this._root.container.width(),n=this._root.container.height();e.moveTo(-a,-n),e.lineTo(-a,2*n),e.lineTo(2*a,2*n),e.lineTo(2*a,-n),e.lineTo(-a,-n),this.axisRanges.each(r=>{const o=r.axisDataItem.get("axisFill");if(s&&o){let l=o.get("draw");l&&l(e,i)}})}this.mainContainer._display.mask=t._display})),t.markDirty(),t._markDirtyKey("fill")}else this.mainContainer._display.mask=null}_updateChildren(){super._updateChildren(),this._x=this.x(),this._y=this.y(),this._makeRangeMask()}_stack(){const t=this.chart;if(t){const e=t.series.indexOf(this);if(this._couldStackTo=[],e>0){let i;for(let s=e-1;s>=0&&(i=t.series.getIndex(s),i.get("xAxis")!==this.get("xAxis")||i.get("yAxis")!==this.get("yAxis")||i.className!==this.className||(this._couldStackTo.push(i),i.get("stacked")));s--);}this._stackDataItems()}}_unstack(){gt(this._reallyStackedTo,(t,e)=>{delete e._stackedSeries[this.uid]}),this._reallyStackedTo={},w(this.dataItems,t=>{t.setRaw("stackToItemY",void 0),t.setRaw("stackToItemX",void 0)})}_stackDataItems(){const t=this.get("baseAxis"),e=this.get("xAxis"),i=this.get("yAxis");let s,a;t===e?(s="valueY",a="stackToItemY"):t===i&&(s="valueX",a="stackToItemX");let n=this._couldStackTo.length,r=0;const o=this.get("stackToNegative");this._reallyStackedTo={},w(this.dataItems,l=>{for(let c=0;c=0&&p>=0){l.setRaw(a,d),this._reallyStackedTo[h.uid]=h,h._stackedSeries[this.uid]=this;break}if(g<0&&p<0){l.setRaw(a,d),this._reallyStackedTo[h.uid]=h,h._stackedSeries[this.uid]=this;break}}}else if(v(g)&&v(p)){l.setRaw(a,d),this._reallyStackedTo[h.uid]=h,h._stackedSeries[this.uid]=this;break}}}r++})}processXSelectionDataItem(t,e,i){w(this.__valueXShowFields,s=>{let a=t.get(s);a!=null&&(i&&(a+=this.getStackedXValueWorking(t,s)),this._min("selectionMinX",a),this._max("selectionMaxX",a*e))})}processYSelectionDataItem(t,e,i){w(this.__valueYShowFields,s=>{let a=t.get(s);a!=null&&(i&&(a+=this.getStackedYValueWorking(t,s)),this._min("selectionMinY",a),this._max("selectionMaxY",a*e))})}getStackedYValueWorking(t,e){const i=t.get("stackToItemY");if(i){const s=i.component;return i.get(e,0)*s.get("vcy",1)+this.getStackedYValueWorking(i,e)}return 0}getStackedXValueWorking(t,e){const i=t.get("stackToItemX");if(i){const s=i.component;return i.get(e,0)*s.get("vcx",1)+this.getStackedXValueWorking(i,e)}return 0}getStackedYValue(t,e){const i=t.get("stackToItemY");return i?i.get(e,0)+this.getStackedYValue(i,e):0}getStackedXValue(t,e){const i=t.get("stackToItemX");return i?i.get(e,0)+this.getStackedXValue(i,e):0}createLegendMarker(t){this.updateLegendMarker()}_markDirtyAxes(){this._axesDirty=!0,this.markDirty()}_markDataSetDirty(){this._afterDataChange(),this._valuesDirty=!0,this._dataProcessed=!1,this._aggregatesCalculated=!1,this.markDirty()}_clearDirty(){super._clearDirty(),this._axesDirty=!1,this._selectionProcessed=!1,this._stackDirty=!1,this._dataProcessed=!1}_positionBullet(t){let e=t.get("sprite");if(e){let i=e.dataItem,s=t.get("locationX",i.get("locationX",.5)),a=t.get("locationY",i.get("locationY",.5)),n=this.get("xAxis"),r=this.get("yAxis"),o=n.getDataItemPositionX(i,this._xField,s,this.get("vcx",1)),l=r.getDataItemPositionY(i,this._yField,a,this.get("vcy",1)),c=this.getPoint(o,l),h=i.get("left",c.x),d=i.get("right",c.x),g=i.get("top",c.y),p=i.get("bottom",c.y),m=0,u=0,_=d-h,f=p-g;if(this._shouldShowBullet(o,l)){e.setPrivate("visible",!t.getPrivate("hidden"));let x=t.get("field");const b=this.get("baseAxis"),y=this.get("xAxis"),A=this.get("yAxis");if(x!=null){let D;b==y?(x=="value"?D=this._yField:x=="open"?D=this._yOpenField:x=="high"?D=this._yHighField:x=="low"&&(D=this._yLowField),D&&(l=A.getDataItemPositionY(i,D,0,this.get("vcy",1)),c=A.get("renderer").positionToPoint(l),u=c.y,m=h+_*s)):(x=="value"?D=this._xField:x=="open"?D=this._xOpenField:x=="high"?D=this._xHighField:x=="low"&&(D=this._xLowField),D&&(o=y.getDataItemPositionX(i,D,0,this.get("vcx",1)),c=y.get("renderer").positionToPoint(o),m=c.x,u=p-f*a))}else m=h+_*s,u=p-f*a;const I=t.get("stacked");if(I){const D=this.chart;if(b==y){let O=this._bullets[o+"_"+l];if(O){let T=O.bounds(),C=e.localBounds(),N=u;u=T.top,I=="down"?u=T.bottom-C.top:I=="auto"?D&&(N{e!=this._mainDataItems&&w(e,i=>{this.disposeDataItem(i)})}),this._dataSets={},this._dataItems=this.mainDataItems}_handleDataSetChange(){w(this._dataItems,t=>{let e=t.bullets;e&&w(e,i=>{if(i){let s=i.get("sprite");s&&s.setPrivate("visible",!1)}})}),this._selectionProcessed=!1}show(t){const e=Object.create(null,{show:{get:()=>super.show}});return it(this,void 0,void 0,function*(){this._fixVC();let i=[];i.push(e.show.call(this,t).then(()=>{this._isShowing=!1;let s=this.get("xAxis"),a=this.get("yAxis"),n=this.get("baseAxis");a!==n&&a.markDirtySelectionExtremes(),s!==n&&s.markDirtySelectionExtremes()})),i.push(this.bulletsContainer.show(t)),i.push(this._sequencedShowHide(!0,t)),yield Promise.all(i)})}hide(t){const e=Object.create(null,{hide:{get:()=>super.hide}});return it(this,void 0,void 0,function*(){this._fixVC();let i=[];i.push(e.hide.call(this,t).then(()=>{this._isHiding=!1})),i.push(this.bulletsContainer.hide(t)),i.push(this._sequencedShowHide(!1,t)),yield Promise.all(i)})}showDataItem(t,e){const i=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return it(this,void 0,void 0,function*(){const s=[i.showDataItem.call(this,t,e)];v(e)||(e=this.get("stateAnimationDuration",0));const a=this.get("stateAnimationEasing");w(this._valueFields,n=>{s.push(t.animate({key:n+"Working",to:t.get(n),duration:e,easing:a}).waitForStop())}),yield Promise.all(s)})}hideDataItem(t,e){const i=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return it(this,void 0,void 0,function*(){const s=[i.hideDataItem.call(this,t,e)],a=this.states.create("hidden",{});v(e)||(e=a.get("stateAnimationDuration",this.get("stateAnimationDuration",0)));const n=a.get("stateAnimationEasing",this.get("stateAnimationEasing")),r=this.get("xAxis"),o=this.get("yAxis"),l=this.get("baseAxis"),c=this.get("stacked");if(l!==r&&l||w(this._valueYFields,h=>{let d=o.getPrivate("min"),g=o.baseValue();v(d)&&d>g&&(g=d),c&&(g=0),t.get(h)!=null&&s.push(t.animate({key:h+"Working",to:g,duration:e,easing:n}).waitForStop())}),l===o||!l){let h=r.getPrivate("min"),d=r.baseValue();v(h)&&h>d&&(d=h),c&&(d=0),w(this._valueXFields,g=>{t.get(g)!=null&&s.push(t.animate({key:g+"Working",to:d,duration:e,easing:n}).waitForStop())})}yield Promise.all(s)})}_markDirtyStack(){this._stackDirty=!0,this.markDirty(),this._markStakedDirtyStack()}_markStakedDirtyStack(){const t=this._stackedSeries;t&>(t,(e,i)=>{i._stackDirty||i._markDirtyStack()})}_afterChanged(){super._afterChanged(),this._skipped&&(this._markDirtyAxes(),this._skipped=!1)}showDataItemTooltip(t){this.getPrivate("doNotUpdateLegend")||(this.updateLegendMarker(t),this.updateLegendValue(t));const e=this.get("tooltip");if(e){if(this.isHidden())this.hideTooltip();else if(e._setDataItem(t),t){let i=this.get("locationX",0),s=this.get("locationY",1),a=t.get("locationX",i),n=t.get("locationY",s);const r=this.get("xAxis"),o=this.get("yAxis"),l=this.get("vcx",1),c=this.get("vcy",1),h=r.getDataItemPositionX(t,this._tooltipFieldX,this._aLocationX0+(this._aLocationX1-this._aLocationX0)*a,l),d=o.getDataItemPositionY(t,this._tooltipFieldY,this._aLocationY0+(this._aLocationY1-this._aLocationY0)*n,c),g=this.getPoint(h,d);let p=!0;if(w(this._valueFields,m=>{t.get(m)==null&&(p=!1)}),p){const m=this.chart;m&&m.inPlot(g)?(e.label.text.markDirtyText(),e.set("tooltipTarget",this._getTooltipTarget(t)),e.set("pointTo",this._display.toGlobal({x:g.x,y:g.y}))):e._setDataItem(void 0)}else e._setDataItem(void 0)}}}hideTooltip(){const t=this.get("tooltip");return t&&t.set("tooltipTarget",this),super.hideTooltip()}_getTooltipTarget(t){if(this.get("seriesTooltipTarget")=="bullet"){const e=t.bullets;if(e&&e.length>0){const i=e[0].get("sprite");if(i)return i}}return this}updateLegendValue(t){const e=this.get("legendDataItem");if(e){const i=e.get("label");if(i){let a="";t?(i._setDataItem(t),a=this.get("legendLabelText",i.get("text",this.get("name","")))):(i._setDataItem(this._emptyDataItem),a=this.get("legendRangeLabelText",this.get("legendLabelText",i.get("text",this.get("name",""))))),i.set("text",a)}const s=e.get("valueLabel");if(s){let a="";t?(s._setDataItem(t),a=this.get("legendValueText",s.get("text",""))):(s._setDataItem(this._emptyDataItem),a=this.get("legendRangeValueText",s.get("text",""))),s.set("text",a)}}}_getItemReaderLabel(){let t="X: {"+this._xField;return this.get("xAxis").isType("DateAxis")&&(t+=".formatDate()"),t+="}; Y: {"+this._yField,this.get("yAxis").isType("DateAxis")&&(t+=".formatDate()"),t+="}",t}getPoint(t,e){let i=this.get("xAxis").get("renderer").positionToCoordinate(t),s=this.get("yAxis").get("renderer").positionToCoordinate(e),a=999999999;return s<-a&&(s=-a),s>a&&(s=a),i<-a&&(i=-a),i>a&&(i=a),{x:i,y:s}}_shouldInclude(t){return!0}handleCursorHide(){this.hideTooltip(),this.updateLegendValue(void 0),this.updateLegendMarker(void 0)}_afterDataChange(){super._afterDataChange(),this.get("xAxis")._markDirtyKey("start"),this.get("yAxis")._markDirtyKey("start"),this.resetExtremes()}resetExtremes(){this.setPrivate("selectionMinX",void 0),this.setPrivate("selectionMaxX",void 0),this.setPrivate("selectionMinY",void 0),this.setPrivate("selectionMaxY",void 0),this.setPrivate("minX",void 0),this.setPrivate("minY",void 0),this.setPrivate("maxX",void 0),this.setPrivate("maxY",void 0)}createAxisRange(t){return this.axisRanges.push({axisDataItem:t})}get mainDataItems(){return this._mainDataItems}_adjustStartIndex(t){const e=this.get("xAxis");if(this.get("baseAxis")==e&&e.isType("DateAxis")){const i=e.baseDuration(),s=e.getPrivate("selectionMin",e.getPrivate("min",0)),a=i*this.get("locationX",.5);let n=-1/0;for(;n{if(e.type==="clear")w(e.oldValues,i=>{this.disposeDataItem(i)});else if(e.type==="push")this._processAxisRange(e.newValue,["range"]);else if(e.type==="setIndex")this._processAxisRange(e.newValue,["range"]);else if(e.type==="insertIndex")this._processAxisRange(e.newValue,["range"]);else if(e.type==="removeIndex")this.disposeDataItem(e.oldValue);else{if(e.type!=="moveIndex")throw new Error("Unknown IStreamEvent type");this._processAxisRange(e.value,["range"])}}));const t=this.get("renderer");t&&(t.axis=this,t.processAxis()),this.children.push(t),this.ghostLabel=t.makeLabel(new ot(this,void 0,{}),[]),this.ghostLabel.adapters.disable("text"),this.ghostLabel.setAll({opacity:0,tooltipText:void 0,tooltipHTML:void 0,interactive:!1}),this.ghostLabel.events.disable()}_updateFinals(t,e){}zoom(t,e,i,s){if(this.get("zoomable",!0))if(this._updateFinals(t,e),this.get("start")!==t||this.get("end")!=e){let a=this._sAnimation,n=this._eAnimation,r=this.get("maxDeviation",.5)*Math.min(1,e-t);t<-r&&(t=-r),e>1+r&&(e=1+r),t>e&&([t,e]=[e,t]),v(i)||(i=this.get("interpolationDuration",0)),s||(s="end");let o=this.getPrivate("maxZoomFactor",this.get("maxZoomFactor",100)),l=o;e===1&&t!==0&&(s=tthis.get("end",1)?"end":"start");let c=this.get("minZoomCount",0),h=this.get("maxZoomCount",1/0);v(c)&&(o=l/c);let d=1;if(v(h)&&(d=l/h),s==="start"?(h>0&&1/(e-t)o&&(e=t+1/o),e>1&&e-t<1/o&&(t=e-1/o)):(h>0&&1/(e-t)o&&(t=e-1/o),t<0&&e-t<1/o&&(e=t+1/o)),1/(e-t)>o&&(e=t+1/o),1/(e-t)>o&&(t=e-1/o),h!=null&&c!=null&&t==this.get("start")&&e==this.get("end")){const g=this.chart;g&&g._handleAxisSelection(this,!0)}if((a&&a.playing&&a.to==t||this.get("start")==t)&&(n&&n.playing&&n.to==e||this.get("end")==e))return;if(i>0){let g,p,m=this.get("interpolationEasing");if(this.get("start")!=t&&(g=this.animate({key:"start",to:t,duration:i,easing:m})),this.get("end")!=e&&(p=this.animate({key:"end",to:e,duration:i,easing:m})),this._sAnimation=g,this._eAnimation=p,g)return g;if(p)return p}else this.set("start",t),this.set("end",e),this._root.events.once("frameended",()=>{this._markDirtyKey("start"),this._root._markDirty()})}else this._sAnimation&&this._sAnimation.stop(),this._eAnimation&&this._eAnimation.stop()}get series(){return this._series}_processAxisRange(t,e){t.setRaw("isRange",!0),this._createAssets(t,e),this._rangesDirty=!0,this._prepareDataItem(t);const i=t.get("above"),s=this.topGridContainer,a=t.get("grid");i&&a&&s.children.moveValue(a);const n=t.get("axisFill");i&&n&&s.children.moveValue(n)}_prepareDataItem(t,e){}markDirtyExtremes(){}markDirtySelectionExtremes(){}_calculateTotals(){}_updateAxisRanges(){this._bullets={},this.axisRanges.each(t=>{this._prepareDataItem(t)}),w(this._seriesAxisRanges,t=>{this._prepareDataItem(t)})}_prepareChildren(){if(super._prepareChildren(),this.get("fixAxisSize")?this.ghostLabel.set("visible",!0):this.ghostLabel.set("visible",!1),this.isDirty("start")||this.isDirty("end")){const e=this.chart;e&&e._updateCursor();let i=this.get("start",0),s=this.get("end",1),a=this.get("maxDeviation",.5)*Math.min(1,s-i);if(i<-a){let n=i+a;i=-a,this.setRaw("start",i),this.isDirty("end")&&this.setRaw("end",s-n)}if(s>1+a){let n=s-1-a;s=1+a,this.setRaw("end",s),this.isDirty("start")&&this.setRaw("start",i-n)}}const t=this.get("renderer");if(t._start=this.get("start"),t._end=this.get("end"),t._inversed=t.get("inversed",!1),t._axisLength=t.axisLength()/(t._end-t._start),t._updateLC(),this.isDirty("tooltip")){const e=this.get("tooltip");if(e){const i=t.get("themeTags");e.addTag("axis"),e.addTag(this.className.toLowerCase()),e._applyThemes(),i&&(e.set("themeTags",F(e.get("themeTags"),i)),e.label._applyThemes())}}}_updateTooltipBounds(){const t=this.get("tooltip");t&&this.get("renderer").updateTooltipBounds(t)}_updateBounds(){super._updateBounds(),this._updateTooltipBounds()}processChart(t){this.chart=t,this.get("renderer").chart=t,t.gridContainer.children.push(this.gridContainer),t.topGridContainer.children.push(this.topGridContainer),t.axisHeadersContainer.children.push(this.axisHeader),this.on("start",()=>{t._handleAxisSelection(this)}),this.on("end",()=>{t._handleAxisSelection(this)}),t.plotContainer.onPrivate("width",()=>{this.markDirtySize()}),t.plotContainer.onPrivate("height",()=>{this.markDirtySize()}),t.processAxis(this)}hideDataItem(t){return this._toggleFHDataItem(t,!0),super.hideDataItem(t)}showDataItem(t){return this._toggleFHDataItem(t,!1),super.showDataItem(t)}_toggleFHDataItem(t,e){const i="forceHidden",s=t.get("label");s&&s.set(i,e);const a=t.get("grid");a&&a.set(i,e);const n=t.get("tick");n&&n.set(i,e);const r=t.get("axisFill");r&&r.set(i,e);const o=t.get("bullet");if(o){const l=o.get("sprite");l&&l.set(i,e)}}_toggleDataItem(t,e){const i=t.get("label"),s="visible";i&&i.setPrivate(s,e);const a=t.get("grid");a&&a.setPrivate(s,e);const n=t.get("tick");n&&n.setPrivate(s,e);const r=t.get("axisFill");r&&r.setPrivate(s,e);const o=t.get("bullet");if(o){const l=o.get("sprite");l&&l.setPrivate(s,e)}}_createAssets(t,e,i){var s,a,n;const r=this.get("renderer");let o="minor";const l=t.get("label");if(l){let d=l.get("themeTags"),g=!1;i?(d==null?void 0:d.indexOf(o))==-1&&(g=!0):(d==null?void 0:d.indexOf(o))!=-1&&(g=!0),g&&((s=l.parent)===null||s===void 0||s.children.removeValue(l),r.makeLabel(t,e),l.dispose(),r.labels.removeValue(l))}else r.makeLabel(t,e);const c=t.get("grid");if(c){let d=c.get("themeTags"),g=!1;i?(d==null?void 0:d.indexOf(o))==-1&&(g=!0):(d==null?void 0:d.indexOf(o))!=-1&&(g=!0),g&&((a=c.parent)===null||a===void 0||a.children.removeValue(c),r.makeGrid(t,e),c.dispose(),r.grid.removeValue(c))}else r.makeGrid(t,e);const h=t.get("tick");if(h){let d=!1,g=h.get("themeTags");i?(g==null?void 0:g.indexOf(o))==-1&&(d=!0):(g==null?void 0:g.indexOf(o))!=-1&&(d=!0),d&&((n=h.parent)===null||n===void 0||n.children.removeValue(h),r.makeTick(t,e),h.dispose(),r.ticks.removeValue(h))}else r.makeTick(t,e);i||t.get("axisFill")||r.makeAxisFill(t,e),this._processBullet(t)}_processBullet(t){let e=t.get("bullet"),i=this.get("bullet");if(e||!i||t.get("isRange")||(e=i(this._root,this,t)),e){e.axis=this;const s=e.get("sprite");s&&(s._setDataItem(t),t.setRaw("bullet",e),s.parent||this.bulletsContainer.children.push(s))}}_afterChanged(){super._afterChanged();const t=this.chart;t&&(t._updateChartLayout(),t.axisHeadersContainer.markDirtySize()),this.get("renderer")._updatePositions(),this._seriesAdded=!1}disposeDataItem(t){super.disposeDataItem(t);const e=this.get("renderer"),i=t.get("label");i&&(e.labels.removeValue(i),i.dispose());const s=t.get("tick");s&&(e.ticks.removeValue(s),s.dispose());const a=t.get("grid");a&&(e.grid.removeValue(a),a.dispose());const n=t.get("axisFill");n&&(e.axisFills.removeValue(n),n.dispose());const r=t.get("bullet");r&&r.dispose()}_updateGhost(){this.setPrivate("cellWidth",this.getCellWidthPosition()*this.get("renderer").axisLength());const t=this.ghostLabel;if(!t.isHidden()){const s=t.localBounds(),a=Math.ceil(s.right-s.left);let n=t.get("text");w(this.dataItems,r=>{const o=r.get("label");if(o&&!o.isHidden()){const l=o.localBounds();Math.ceil(l.right-l.left)>a&&(n=o.text._getText())}}),t.set("text",n)}let e=this.get("start",0),i=this.get("end",1);this.get("renderer").updateLabel(t,e+.5*(i-e))}_handleCursorPosition(t,e){t=this.get("renderer").toAxisPosition(t),this._cursorPosition=t,this._snapToSeries=e,this.updateTooltip()}updateTooltip(){const t=this._snapToSeries;let e=this._cursorPosition;const i=this.get("tooltip"),s=this.get("renderer");v(e)&&(w(this.series,a=>{if(a.get("baseAxis")===this){const n=this.getSeriesItem(a,e,this.get("tooltipLocation"));a.setRaw("tooltipDataItem",n),t&&t.indexOf(a)!=-1?(a.updateLegendMarker(n),a.updateLegendValue(n)):a.showDataItemTooltip(n)}}),i&&(s.updateTooltipBounds(i),this.get("snapTooltip")&&(e=this.roundAxisPosition(e,this.get("tooltipLocation",.5))),q(e)?i.hide(0):(this.setPrivateRaw("tooltipPosition",e),this._updateTooltipText(i,e),s.positionTooltip(i,e),ethis.get("end",1)?i.hide(0):i.show(0))))}_updateTooltipText(t,e){t.label.set("text",this.getTooltipText(e))}roundAxisPosition(t,e){return t}handleCursorShow(){let t=this.get("tooltip");t&&t.show()}handleCursorHide(){let t=this.get("tooltip");t&&t.hide()}processSeriesDataItem(t,e){}_clearDirty(){super._clearDirty(),this._sizeDirty=!1,this._rangesDirty=!1}coordinateToPosition(t){const e=this.get("renderer");return e.toAxisPosition(t/e.axisLength())}toAxisPosition(t){return this.get("renderer").toAxisPosition(t)}toGlobalPosition(t){return this.get("renderer").toGlobalPosition(t)}fixPosition(t){return this.get("renderer").fixPosition(t)}shouldGap(t,e,i,s){return!1}createAxisRange(t){return this.axisRanges.push(t)}_groupSeriesData(t){}getCellWidthPosition(){return .05}}Object.defineProperty(H,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Axis"}),Object.defineProperty(H,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Bt.classNames.concat([H.className])});class yt extends H{constructor(){super(...arguments),Object.defineProperty(this,"_dirtyExtremes",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dirtySelectionExtremes",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_deltaMinMax",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_minReal",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_maxReal",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_baseValue",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_syncDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_minLogAdjusted",{enumerable:!0,configurable:!0,writable:!0,value:1})}markDirtyExtremes(){this._dirtyExtremes=!0,this.markDirty()}markDirtySelectionExtremes(){this._dirtySelectionExtremes=!0,this.markDirty()}_afterNew(){this._settings.themeTags=F(this._settings.themeTags,["axis"]),this.setPrivateRaw("name","value"),this.addTag("value"),super._afterNew()}_prepareChildren(){if(super._prepareChildren(),this.isDirty("syncWithAxis")){this._prevSettings.syncWithAxis&&this._syncDp&&this._syncDp.dispose();let e=this.get("syncWithAxis");e&&(this._syncDp=new ae([e.onPrivate("selectionMinFinal",()=>{this._dirtySelectionExtremes=!0}),e.onPrivate("selectionMaxFinal",()=>{this._dirtySelectionExtremes=!0})]))}let t=!1;(this.isDirty("min")||this.isDirty("max")||this.isDirty("maxPrecision")||this.isDirty("numberFormat"))&&(t=!0,this.ghostLabel.set("text","")),(this._sizeDirty||this._dirtyExtremes||this._valuesDirty||t||this.isPrivateDirty("width")||this.isPrivateDirty("height")||this.isDirty("extraMin")||this.isDirty("extraMax")||this.isDirty("logarithmic")||this.isDirty("treatZeroAs")||this.isDirty("baseValue")||this.isDirty("strictMinMax")||this.isDirty("strictMinMaxSelection"))&&(this._getMinMax(),this._dirtyExtremes=!1),this._dirtySelectionExtremes&&!this._isPanning&&this.get("autoZoom",!0)&&(this._getSelectionMinMax(),this._dirtySelectionExtremes=!1),this._groupData(),(this._sizeDirty||this._valuesDirty||this.isDirty("start")||this.isDirty("end")||this.isPrivateDirty("min")||this.isPrivateDirty("selectionMax")||this.isPrivateDirty("selectionMin")||this.isPrivateDirty("max")||this.isPrivateDirty("step")||this.isPrivateDirty("width")||this.isPrivateDirty("height")||this.isDirty("logarithmic"))&&(this._handleRangeChange(),this._prepareAxisItems(),this._updateAxisRanges()),this._baseValue=this.baseValue()}_groupData(){}_formatText(t){const e=this.get("numberFormat"),i=this.getNumberFormatter();let s="";return s=e?i.format(t,e):i.format(t,void 0,this.getPrivate("stepDecimalPlaces")),s}_prepareAxisItems(){const t=this.getPrivate("min"),e=this.getPrivate("max");if(v(t)&&v(e)){const i=this.get("logarithmic"),s=this.getPrivate("step"),a=this.getPrivate("selectionMin"),n=this.getPrivate("selectionMax")+s;let r=a-s,o=1,l=t;if(i){if(r=this._minLogAdjusted,r2&&(r=Math.pow(10,Math.log(l)*Math.LOG10E-5))}const c=this.get("renderer"),h=c.get("minorLabelsEnabled"),d=c.get("minorGridEnabled",h);let g=Math.pow(10,Math.floor(Math.log(Math.abs(s))*Math.LOG10E));const p=Math.round(s/g);let m=2;j(p/5,10)%1==0&&(m=5),j(p/10,10)%1==0&&(m=10);let u=s/m,_=0,f=0,x=-1/0;for(;r2?A=Math.pow(10,Math.log(l)*Math.LOG10E+_-5):A+=s,d){let D=r+u;for(i&&(o>2&&(u=this._adjustMinMax(r,A,10).step),D=r+u);D{b.inited&&b._markDirtyAxes()}),this._updateGhost()}}_prepareDataItem(t,e){let i=this.get("renderer"),s=t.get("value"),a=t.get("endValue"),n=this.valueToPosition(s),r=n,o=this.valueToPosition(s+this.getPrivate("step"));v(a)&&(r=this.valueToPosition(a),o=r),t.get("isRange")&&a==null&&(o=n);let l=r,c=t.get("labelEndValue");c!=null&&(l=this.valueToPosition(c)),i.updateLabel(t.get("label"),n,l,e);const h=t.get("grid");if(i.updateGrid(h,n,r),h&&(s==this.get("baseValue",0)?(h.addTag("base"),h._applyThemes()):h.hasTag("base")&&(h.removeTag("base"),h._applyThemes())),i.updateTick(t.get("tick"),n,l,e),i.updateFill(t.get("axisFill"),n,o),this._processBullet(t),i.updateBullet(t.get("bullet"),n,r),!t.get("isRange")){const d=this.get("fillRule");d&&d(t)}}_handleRangeChange(){let t=this.positionToValue(this.get("start",0)),e=this.positionToValue(this.get("end",1));const i=this.get("renderer").gridCount();let s=this._adjustMinMax(t,e,i,!0),a=oe(s.step);this.setPrivateRaw("stepDecimalPlaces",a),t=j(t,a),e=j(e,a),s=this._adjustMinMax(t,e,i,!0);let n=s.step;t=s.min,e=s.max,this.getPrivate("selectionMin")===t&&this.getPrivate("selectionMax")===e&&this.getPrivate("step")===n||(this.setPrivateRaw("selectionMin",t),this.setPrivateRaw("selectionMax",e),this.setPrivateRaw("step",n))}positionToValue(t){const e=this.getPrivate("min"),i=this.getPrivate("max");return this.get("logarithmic")?Math.pow(Math.E,(t*(Math.log(i)*Math.LOG10E-Math.log(e)*Math.LOG10E)+Math.log(e)*Math.LOG10E)/Math.LOG10E):t*(i-e)+e}valueToPosition(t){const e=this.getPrivate("min"),i=this.getPrivate("max");if(this.get("logarithmic")){if(t<=0){let s=this.get("treatZeroAs");v(s)&&(t=s)}return(Math.log(t)*Math.LOG10E-Math.log(e)*Math.LOG10E)/(Math.log(i)*Math.LOG10E-Math.log(e)*Math.LOG10E)}return(t-e)/(i-e)}valueToFinalPosition(t){const e=this.getPrivate("minFinal"),i=this.getPrivate("maxFinal");if(this.get("logarithmic")){if(t<=0){let s=this.get("treatZeroAs");v(s)&&(t=s)}return(Math.log(t)*Math.LOG10E-Math.log(e)*Math.LOG10E)/(Math.log(i)*Math.LOG10E-Math.log(e)*Math.LOG10E)}return(t-e)/(i-e)}getX(t,e,i){t=i+(t-i)*e;const s=this.valueToPosition(t);return this._settings.renderer.positionToCoordinate(s)}getY(t,e,i){t=i+(t-i)*e;const s=this.valueToPosition(t);return this._settings.renderer.positionToCoordinate(s)}getDataItemCoordinateX(t,e,i,s){return this._settings.renderer.positionToCoordinate(this.getDataItemPositionX(t,e,i,s))}getDataItemPositionX(t,e,i,s){let a=t.get(e);return t.get("stackToItemX")?a=a*s+t.component.getStackedXValueWorking(t,e):a=this._baseValue+(a-this._baseValue)*s,this.valueToPosition(a)}getDataItemCoordinateY(t,e,i,s){return this._settings.renderer.positionToCoordinate(this.getDataItemPositionY(t,e,i,s))}getDataItemPositionY(t,e,i,s){let a=t.get(e);return t.get("stackToItemY")?a=a*s+t.component.getStackedYValueWorking(t,e):a=this._baseValue+(a-this._baseValue)*s,this.valueToPosition(a)}basePosition(){return this.valueToPosition(this.baseValue())}baseValue(){const t=Math.min(this.getPrivate("minFinal",-1/0),this.getPrivate("selectionMin",-1/0)),e=Math.max(this.getPrivate("maxFinal",1/0),this.getPrivate("selectionMax",1/0));let i=this.get("baseValue",0);return ie&&(i=e),i}cellEndValue(t){return t}fixSmallStep(t){return 1+t===1?(t*=2,this.fixSmallStep(t)):t}_fixMin(t){return t}_fixMax(t){return t}_calculateTotals(){if(this.get("calculateTotals")){let t=this.series[0];if(t){let e=t.startIndex();if(t.dataItems.length>0){e>0&&e--;let i,s,a=t.endIndex();a{if(!c.get("excludeFromTotal")){let h=c.dataItems[r];if(h){let d=h.get(n)*c.get(s);q(d)||(o+=d,l+=Math.abs(d))}}}),w(this.series,c=>{if(!c.get("excludeFromTotal")){let h=c.dataItems[r];if(h){let d=h.get(n)*c.get(s);q(d)||(h.set(i+"Total",l),h.set(i+"Sum",o),h.set(i+"TotalPercent",d/l*100))}}})}}}}}_getSelectionMinMax(){const t=this.getPrivate("minFinal"),e=this.getPrivate("maxFinal"),i=this.get("min"),s=this.get("max");let a=this.get("extraMin",0),n=this.get("extraMax",0);this.get("logarithmic")&&(this.get("extraMin")==null&&(a=.1),this.get("extraMax")==null&&(n=.2));const r=this.get("renderer").gridCount(),o=this.get("strictMinMaxSelection");let l=this.get("strictMinMax");if(v(t)&&v(e)){let c=e,h=t;if(w(this.series,x=>{if(!x.get("ignoreMinMax")){let b,y;const A=x.getPrivate("outOfSelection");if(x.get("xAxis")===this){if(!A){let I=x.getPrivate("minX"),D=x.getPrivate("maxX");x.startIndex()==0&&x.endIndex()==x.dataItems.length||(I=void 0,D=void 0),b=x.getPrivate("selectionMinX",I),y=x.getPrivate("selectionMaxX",D)}}else if(x.get("yAxis")===this&&!A){let I=x.getPrivate("minY"),D=x.getPrivate("maxY");x.startIndex()==0&&x.endIndex()==x.dataItems.length||(I=void 0,D=void 0),b=x.getPrivate("selectionMinY",I),y=x.getPrivate("selectionMaxY",D)}x.isHidden()||x.isShowing()||(v(b)&&(c=Math.min(c,b)),v(y)&&(h=Math.max(h,y)))}}),this.axisRanges.each(x=>{if(x.get("affectsMinMax")){let b=x.get("value");b!=null&&(c=Math.min(c,b),h=Math.max(h,b)),b=x.get("endValue"),b!=null&&(c=Math.min(c,b),h=Math.max(h,b))}}),c>h&&([c,h]=[h,c]),v(i)?c=l?i:t:l&&v(this._minReal)&&(c=this._minReal),v(s)?h=l?s:e:l&&v(this._maxReal)&&(h=this._maxReal),c===h){let x=c;if(c-=this._deltaMinMax,h+=this._deltaMinMax,ce&&(h=e));let u=Math.min(20,Math.ceil(Math.log(this.getPrivate("maxZoomFactor",100)+1)/Math.LN10)+2),_=j(this.valueToFinalPosition(c),u),f=j(this.valueToFinalPosition(h),u);this.setPrivateRaw("selectionMinFinal",c),this.setPrivateRaw("selectionMaxFinal",h),this.setPrivateRaw("selectionStepFinal",p.step),this.zoom(_,f)}}_getMinMax(){let t=this.get("min"),e=this.get("max"),i=1/0,s=-1/0,a=this.get("extraMin",0),n=this.get("extraMax",0);this.get("logarithmic")&&(this.get("extraMin")==null&&(a=.1),this.get("extraMax")==null&&(n=.2));let r=1/0;if(w(this.series,x=>{if(!x.get("ignoreMinMax")){let b,y;if(x.get("xAxis")===this?(b=x.getPrivate("minX"),y=x.getPrivate("maxX")):x.get("yAxis")===this&&(b=x.getPrivate("minY"),y=x.getPrivate("maxY")),v(b)&&v(y)){i=Math.min(i,b),s=Math.max(s,y);let A=y-b;A<=0&&(A=Math.abs(y/100)),A{if(x.get("affectsMinMax")){let b=x.get("value");b!=null&&(i=Math.min(i,b),s=Math.max(s,b)),b=x.get("endValue"),b!=null&&(i=Math.min(i,b),s=Math.max(s,b))}}),this.get("logarithmic")){let x=this.get("treatZeroAs");v(x)&&i<=0&&(i=x)}if(i===0&&s===0&&(s=.9,i=-.9),v(t)&&(i=t),v(e)&&(s=e),i===1/0||s===-1/0)return this.setPrivate("minFinal",void 0),void this.setPrivate("maxFinal",void 0);const o=i,l=s;let c=this.adapters.fold("min",i),h=this.adapters.fold("max",s);v(c)&&(i=c),v(h)&&(s=h),i=this._fixMin(i),s=this._fixMax(s),s-i<=1/Math.pow(10,15)&&(s-i!=0?this._deltaMinMax=(s-i)/2:this._getDelta(s),i-=this._deltaMinMax,s+=this._deltaMinMax),i-=(s-i)*a,s+=(s-i)*n,this.get("logarithmic")&&(i<0&&o>=0&&(i=0),s>0&&l<=0&&(s=0)),this._minReal=i,this._maxReal=s;let d=this.get("strictMinMax"),g=this.get("strictMinMaxSelection",!1);g&&(d=g);let p=d;v(e)&&(p=!0);let m=this.get("renderer").gridCount(),u=this._adjustMinMax(i,s,m,p);i=u.min,s=u.max,u=this._adjustMinMax(i,s,m,!0),i=u.min,s=u.max,d&&(i=v(t)?t:this._minReal,s=v(e)?e:this._maxReal,s-i<=1e-8&&(i-=this._deltaMinMax,s+=this._deltaMinMax),i-=(s-i)*a,s+=(s-i)*n),c=this.adapters.fold("min",i),h=this.adapters.fold("max",s),v(c)&&(i=c),v(h)&&(s=h),r==1/0&&(r=s-i);let _=Math.round(Math.abs(Math.log(Math.abs(s-i))*Math.LOG10E))+5;i=j(i,_),s=j(s,_);const f=this.get("syncWithAxis");if(f&&(u=this._syncAxes(i,s,u.step,f.getPrivate("minFinal",f.getPrivate("min",0)),f.getPrivate("maxFinal",f.getPrivate("max",1)),f.getPrivate("step",1)),i=u.min,s=u.max),this.setPrivateRaw("maxZoomFactor",Math.max(1,Math.ceil((s-i)/r*this.get("maxZoomFactor",100)))),this._fixZoomFactor(),this.get("logarithmic")&&(this._minLogAdjusted=i,i=this._minReal,s=this._maxReal,i<=0&&(i=o*(1-Math.min(a,.99)))),v(i)&&v(s)&&(this.getPrivate("minFinal")!==i||this.getPrivate("maxFinal")!==s)){this.setPrivate("minFinal",i),this.setPrivate("maxFinal",s),this._saveMinMax(i,s);const x=this.get("interpolationDuration",0),b=this.get("interpolationEasing");this.animatePrivate({key:"min",to:i,duration:x,easing:b}),this.animatePrivate({key:"max",to:s,duration:x,easing:b})}}_fixZoomFactor(){}_getDelta(t){let e=Math.log(Math.abs(t))*Math.LOG10E,i=Math.pow(10,Math.floor(e));i/=10,this._deltaMinMax=i}_saveMinMax(t,e){}_adjustMinMax(t,e,i,s){i<=1&&(i=1),i=Math.round(i);let a=t,n=e,r=e-t;r===0&&(r=Math.abs(e));let o=Math.log(Math.abs(r))*Math.LOG10E,l=Math.pow(10,Math.floor(o));l/=10;let c=l;s&&(c=0),s?(t=Math.floor(t/l)*l,e=Math.ceil(e/l)*l):(t=Math.ceil(t/l)*l-c,e=Math.floor(e/l)*l+c),t<0&&a>=0&&(t=0),e>0&&n<=0&&(e=0),o=Math.log(Math.abs(r))*Math.LOG10E,l=Math.pow(10,Math.floor(o)),l/=100;let h=Math.ceil(r/i/l)*l,d=Math.pow(10,Math.floor(Math.log(Math.abs(h))*Math.LOG10E)),g=Math.ceil(h/d);g>5?g=10:g<=5&&g>2&&(g=5),h=Math.ceil(h/(d*g))*d*g;let p=this.get("maxPrecision");if(v(p)){let f=le(h,p);pa&&(t-=h),h=this.fixSmallStep(h),{min:t,max:e,step:h}}getTooltipText(t,e){const i=this.get("tooltipNumberFormat",this.get("numberFormat")),s=this.getNumberFormatter(),a=this.get("extraTooltipPrecision",0),n=this.getPrivate("stepDecimalPlaces",0)+a,r=j(this.positionToValue(t),n);return i?s.format(r,i):s.format(r,void 0,n)}getSeriesItem(t,e){let i,s,a=this.getPrivate("name")+this.get("renderer").getPrivate("letter"),n=this.positionToValue(e);if(w(t.dataItems,(r,o)=>{const l=Math.abs(r.get(a)-n);(i===void 0||l500&&(c=!0),c)t=g,e=p,i=m;else{h/3==Math.round(h/3)?(g=t-d*h,t>=0&&g<0&&(g=0)):(p=e+d*h,p<=0&&p>0&&(p=0));let u=this._adjustMinMax(g,p,l,!0);g=u.min,p=u.max,m=u.step}}}return{min:t,max:e,step:i}}_checkSync(t,e,i,s){let a=(e-t)/i;for(let n=1;npt._new(this._root,{themeTags:F(this.ticks.template.get("themeTags",[]),this.get("themeTags",[]))},[this.ticks.template]))}),Object.defineProperty(this,"grid",{enumerable:!0,configurable:!0,writable:!0,value:new B(E.new({}),()=>st._new(this._root,{themeTags:F(this.grid.template.get("themeTags",[]),this.get("themeTags",[]))},[this.grid.template]))}),Object.defineProperty(this,"axisFills",{enumerable:!0,configurable:!0,writable:!0,value:new B(E.new({}),()=>G._new(this._root,{themeTags:F(this.axisFills.template.get("themeTags",["axis","fill"]),this.get("themeTags",[]))},[this.axisFills.template]))}),Object.defineProperty(this,"labels",{enumerable:!0,configurable:!0,writable:!0,value:new B(E.new({}),()=>ut._new(this._root,{themeTags:F(this.labels.template.get("themeTags",[]),this.get("themeTags",[]))},[this.labels.template]))}),Object.defineProperty(this,"axis",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}makeTick(t,e){const i=this.ticks.make();return i._setDataItem(t),t.setRaw("tick",i),i.set("themeTags",F(i.get("themeTags"),e)),this.axis.labelsContainer.children.push(i),this.ticks.push(i),i}makeGrid(t,e){const i=this.grid.make();return i._setDataItem(t),t.setRaw("grid",i),i.set("themeTags",F(i.get("themeTags"),e)),this.axis.gridContainer.children.push(i),this.grid.push(i),i}makeAxisFill(t,e){const i=this.axisFills.make();return i._setDataItem(t),i.set("themeTags",F(i.get("themeTags"),e)),this.axis.gridContainer.children.push(i),t.setRaw("axisFill",i),this.axisFills.push(i),i}makeLabel(t,e){const i=this.labels.make();return i.set("themeTags",F(i.get("themeTags"),e)),this.axis.labelsContainer.children.moveValue(i,0),i._setDataItem(t),t.setRaw("label",i),this.labels.push(i),i}axisLength(){return 0}gridCount(){return this.axisLength()/this.get("minGridDistance",50)}_updatePositions(){}_afterNew(){super._afterNew(),this.set("isMeasured",!1);const t=this.thumb;t&&(this._disposers.push(t.events.on("pointerdown",e=>{this._handleThumbDown(e)})),this._disposers.push(t.events.on("globalpointerup",e=>{this._handleThumbUp(e)})),this._disposers.push(t.events.on("globalpointermove",e=>{this._handleThumbMove(e)})))}_beforeChanged(){super._beforeChanged(),this.isDirty("minGridDistance")&&this.root.events.once("frameended",()=>{this.axis.markDirtySize()})}_changed(){if(super._changed(),this.isDirty("pan")){const t=this.thumb;if(t){const e=this.axis.labelsContainer,i=this.get("pan");i=="zoom"?e.children.push(t):i=="none"&&e.children.removeValue(t)}}}_handleThumbDown(t){this._thumbDownPoint=this.toLocal(t.point);const e=this.axis;this._downStart=e.get("start"),this._downEnd=e.get("end")}_handleThumbUp(t){this._thumbDownPoint=void 0}_handleThumbMove(t){const e=this._thumbDownPoint;if(e){const i=this.toLocal(t.point),s=this._downStart,a=this._downEnd,n=this._getPan(i,e)*Math.min(1,a-s)/2;this.axis.zoom(s-n,a+n,0)}}_getPan(t,e){return 0}positionToCoordinate(t){return this._inversed?(this._end-t)*this._axisLength:(t-this._start)*this._axisLength}updateTooltipBounds(t){}_updateSize(){this.markDirty(),this._clear=!0}toAxisPosition(t){const e=this._start||0,i=this._end||1;return t*=i-e,t=this.get("inversed")?i-t:e+t}toGlobalPosition(t){const e=this._start||0,i=this._end||1;return this.get("inversed")?t=i-t:t-=e,t/=i-e}fixPosition(t){return this.get("inversed")?1-t:t}_updateLC(){}toggleVisibility(t,e,i,s){let a=this.axis;const n=a.get("start",0),r=a.get("end",1);en+(r-n)*(s+1e-4)?t.setPrivate("visible",!1):t.setPrivate("visible",!0)}_positionTooltip(t,e){const i=this.chart;i&&(t.set("pointTo",this._display.toGlobal(e)),i.inPlot(e)||t.hide())}processAxis(){}}Object.defineProperty(Z,"className",{enumerable:!0,configurable:!0,writable:!0,value:"AxisRenderer"}),Object.defineProperty(Z,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:G.classNames.concat([Z.className])});class Pt extends Z{constructor(){super(...arguments),Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:nt.new(this._root,{width:k,isMeasured:!1,themeTags:["axis","x","thumb"]})})}_afterNew(){this._settings.themeTags=F(this._settings.themeTags,["renderer","x"]),super._afterNew(),this.setPrivateRaw("letter","X");const t=this.grid.template;t.set("height",k),t.set("width",0),t.set("draw",(e,i)=>{e.moveTo(0,0),e.lineTo(0,i.height())}),this.set("draw",(e,i)=>{e.moveTo(0,0),e.lineTo(i.width(),0)})}_changed(){super._changed();const t=this.axis;t.ghostLabel.setPrivate("visible",!this.get("inside")),t.ghostLabel.set("x",-1e3);const e="opposite",i="inside";if(this.isDirty(e)||this.isDirty(i)){const s=this.chart,a=t.children;if(this.get(i)?t.addTag(i):t.removeTag(i),s){if(this.get(e)){const n=s.topAxesContainer.children;n.indexOf(t)==-1&&n.insertIndex(0,t),t.addTag(e),a.moveValue(this)}else{const n=s.bottomAxesContainer.children;n.indexOf(t)==-1&&n.moveValue(t),t.removeTag(e),a.moveValue(this,0)}t.ghostLabel._applyThemes(),this.labels.each(n=>{n._applyThemes()}),this.root._markDirtyRedraw()}t.markDirtySize()}this.thumb.setPrivate("height",t.labelsContainer.height())}_getPan(t,e){return(e.x-t.x)/this.width()}toAxisPosition(t){const e=this._start||0,i=this._end||1;return t=(t-=this._ls)*(i-e)/this._lc,t=this.get("inversed")?i-t:e+t}toGlobalPosition(t){const e=this._start||0,i=this._end||1;return this.get("inversed")?t=i-t:t-=e,t=t/(i-e)*this._lc,t+=this._ls}_updateLC(){const t=this.axis,e=t.parent;if(e){const i=e.innerWidth();this._lc=this.axisLength()/i,this._ls=(t.x()-e.get("paddingLeft",0))/i}}_updatePositions(){const t=this.axis,e=t.x()-_t(t.get("centerX",0),t.width())-t.parent.get("paddingLeft",0);t.gridContainer.set("x",e),t.topGridContainer.set("x",e),t.bulletsContainer.set("y",this.y());const i=t.chart;if(i){const s=i.plotContainer,a=t.axisHeader;let n=t.get("marginLeft",0),r=t.x()-n;const o=t.parent;o&&(r-=o.get("paddingLeft",0)),a.children.length>0?(n=t.axisHeader.width(),t.set("marginLeft",n+1)):a.set("width",n),a.setAll({x:r,y:-1,height:s.height()+2})}}processAxis(){super.processAxis();const t=this.axis;t.get("width")==null&&t.set("width",k);const e=this._root.verticalLayout;t.set("layout",e),t.labelsContainer.set("width",k),t.axisHeader.setAll({layout:e})}axisLength(){return this.axis.width()}positionToPoint(t){return{x:this.positionToCoordinate(t),y:0}}updateTick(t,e,i,s){if(t){v(e)||(e=0);let a=.5;a=v(s)&&s>1?t.get("multiLocation",a):t.get("location",a),v(i)&&i!=e&&(e+=(i-e)*a),t.set("x",this.positionToCoordinate(e));let n=t.get("length",0);const r=t.get("inside",this.get("inside",!1));this.get("opposite")?(t.set("y",k),r||(n*=-1)):(t.set("y",0),r&&(n*=-1)),t.set("draw",o=>{o.moveTo(0,0),o.lineTo(0,n)}),this.toggleVisibility(t,e,t.get("minPosition",0),t.get("maxPosition",1))}}updateLabel(t,e,i,s){if(t){let a=.5;a=v(s)&&s>1?t.get("multiLocation",a):t.get("location",a),v(e)||(e=0);const n=t.get("inside",this.get("inside",!1));this.get("opposite")?n?(t.set("position","absolute"),t.set("y",0)):(t.set("position","relative"),t.set("y",k)):n?(t.set("y",0),t.set("position","absolute")):(t.set("y",void 0),t.set("position","relative")),v(i)&&i!=e&&(e+=(i-e)*a),t.set("x",this.positionToCoordinate(e)),this.toggleVisibility(t,e,t.get("minPosition",0),t.get("maxPosition",1))}}updateGrid(t,e,i){if(t){v(e)||(e=0);let s=t.get("location",.5);v(i)&&i!=e&&(e+=(i-e)*s),t.set("x",this.positionToCoordinate(e)),this.toggleVisibility(t,e,0,1)}}updateBullet(t,e,i){if(t){const s=t.get("sprite");if(s){v(e)||(e=0);let a=t.get("location",.5);v(i)&&i!=e&&(e+=(i-e)*a);let n=this.axis.roundAxisPosition(e,a),r=this.axis._bullets[n],o=-1;if(this.get("opposite")&&(o=1),t.get("stacked"))if(r){let l=r.get("sprite");l&&s.set("y",l.y()+l.height()*o)}else s.set("y",0);this.axis._bullets[n]=t,s.set("x",this.positionToCoordinate(e)),this.toggleVisibility(s,e,0,1)}}}updateFill(t,e,i){if(t){v(e)||(e=0),v(i)||(i=1);let s=this.positionToCoordinate(e),a=this.positionToCoordinate(i);this.fillDrawMethod(t,s,a)}}fillDrawMethod(t,e,i){t.set("draw",s=>{const a=this.axis.gridContainer.height(),n=this.width();in||i<0||(s.moveTo(e,0),s.lineTo(i,0),s.lineTo(i,a),s.lineTo(e,a),s.lineTo(e,0))})}positionTooltip(t,e){this._positionTooltip(t,{x:this.positionToCoordinate(e),y:0})}updateTooltipBounds(t){const e=this.get("inside"),i=1e5;let s=this._display.toGlobal({x:0,y:0}),a=s.x,n=0,r=this.axisLength(),o=i,l="up";this.get("opposite")?e?(l="up",n=s.y,o=i):(l="down",n=s.y-i,o=i):e?(l="down",n=s.y-i,o=i):(l="up",n=s.y,o=i);const c={left:a,right:a+r,top:n,bottom:n+o},h=t.get("bounds");Gt(c,h)||(t.set("bounds",c),t.set("pointerOrientation",l))}}Object.defineProperty(Pt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"AxisRendererX"}),Object.defineProperty(Pt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Z.classNames.concat([Pt.className])});class wt extends Z{constructor(){super(...arguments),Object.defineProperty(this,"_downY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:nt.new(this._root,{height:k,isMeasured:!1,themeTags:["axis","y","thumb"]})})}_afterNew(){this._settings.themeTags=F(this._settings.themeTags,["renderer","y"]),this._settings.opposite&&this._settings.themeTags.push("opposite"),super._afterNew(),this.setPrivateRaw("letter","Y");const t=this.grid.template;t.set("width",k),t.set("height",0),t.set("draw",(e,i)=>{e.moveTo(0,0),e.lineTo(i.width(),0)}),this.set("draw",(e,i)=>{e.moveTo(0,0),e.lineTo(0,i.height())})}_getPan(t,e){return(t.y-e.y)/this.height()}_changed(){super._changed();const t=this.axis;t.ghostLabel.setPrivate("visible",!this.get("inside")),t.ghostLabel.set("y",-1e3);const e=this.thumb,i="opposite",s="inside",a=this.chart;if(this.isDirty(i)||this.isDirty(s)){const r=t.children;if(this.get(s)?t.addTag(s):t.removeTag(s),a){if(this.get(i)){const o=a.rightAxesContainer.children;o.indexOf(t)==-1&&o.moveValue(t,0),t.addTag(i),r.moveValue(this,0)}else{const o=a.leftAxesContainer.children;o.indexOf(t)==-1&&o.moveValue(t),t.removeTag(i),r.moveValue(this)}t.ghostLabel._applyThemes(),this.labels.each(o=>{o._applyThemes()}),this.root._markDirtyRedraw()}t.markDirtySize()}const n=t.labelsContainer.width();a&&(this.get(i)?e.set("centerX",0):e.set("centerX",n)),e.setPrivate("width",n)}processAxis(){super.processAxis();const t=this.axis;t.get("height")==null&&t.set("height",k);const e=this._root.horizontalLayout;t.set("layout",e),t.labelsContainer.set("height",k),t.axisHeader.set("layout",e)}_updatePositions(){const t=this.axis,e=t.y()-_t(t.get("centerY",0),t.height());t.gridContainer.set("y",e),t.topGridContainer.set("y",e),t.bulletsContainer.set("x",this.x());const i=t.chart;if(i){const s=i.plotContainer,a=t.axisHeader;let n=t.get("marginTop",0);a.children.length>0?(n=t.axisHeader.height(),t.set("marginTop",n+1)):a.set("height",n),a.setAll({y:t.y()-n,x:-1,width:s.width()+2})}}axisLength(){return this.axis.innerHeight()}positionToPoint(t){return{x:0,y:this.positionToCoordinate(t)}}updateLabel(t,e,i,s){if(t){v(e)||(e=0);let a=.5;a=v(s)&&s>1?t.get("multiLocation",a):t.get("location",a);const n=this.get("opposite"),r=t.get("inside",this.get("inside",!1));n?(t.set("x",0),r?t.set("position","absolute"):t.set("position","relative")):r?(t.set("x",0),t.set("position","absolute")):(t.set("x",void 0),t.set("position","relative")),v(i)&&i!=e&&(e+=(i-e)*a),t.set("y",this.positionToCoordinate(e)),this.toggleVisibility(t,e,t.get("minPosition",0),t.get("maxPosition",1))}}updateGrid(t,e,i){if(t){v(e)||(e=0);let s=t.get("location",.5);v(i)&&i!=e&&(e+=(i-e)*s),t.set("y",this.positionToCoordinate(e)),this.toggleVisibility(t,e,0,1)}}updateTick(t,e,i,s){if(t){v(e)||(e=0);let a=.5;a=v(s)&&s>1?t.get("multiLocation",a):t.get("location",a),v(i)&&i!=e&&(e+=(i-e)*a),t.set("y",this.positionToCoordinate(e));let n=t.get("length",0);const r=t.get("inside",this.get("inside",!1));this.get("opposite")?(t.set("x",0),r&&(n*=-1)):r||(n*=-1),t.set("draw",o=>{o.moveTo(0,0),o.lineTo(n,0)}),this.toggleVisibility(t,e,t.get("minPosition",0),t.get("maxPosition",1))}}updateBullet(t,e,i){if(t){const s=t.get("sprite");if(s){v(e)||(e=0);let a=t.get("location",.5);v(i)&&i!=e&&(e+=(i-e)*a);let n=this.axis.roundAxisPosition(e,a),r=this.axis._bullets[n],o=1;if(this.get("opposite")&&(o=-1),t.get("stacked"))if(r){let l=r.get("sprite");l&&s.set("x",l.x()+l.width()*o)}else s.set("x",0);this.axis._bullets[n]=t,s.set("y",this.positionToCoordinate(e)),this.toggleVisibility(s,e,0,1)}}}updateFill(t,e,i){if(t){v(e)||(e=0),v(i)||(i=1);let s=this.positionToCoordinate(e),a=this.positionToCoordinate(i);this.fillDrawMethod(t,s,a)}}fillDrawMethod(t,e,i){t.set("draw",s=>{const a=this.axis.gridContainer.width(),n=this.height();in||i<0||(s.moveTo(0,e),s.lineTo(a,e),s.lineTo(a,i),s.lineTo(0,i),s.lineTo(0,e))})}positionToCoordinate(t){return this._inversed?(t-this._start)*this._axisLength:(this._end-t)*this._axisLength}positionTooltip(t,e){this._positionTooltip(t,{x:0,y:this.positionToCoordinate(e)})}updateTooltipBounds(t){const e=this.get("inside"),i=1e5;let s=this._display.toGlobal({x:0,y:0}),a=s.y,n=0,r=this.axisLength(),o=i,l="right";this.get("opposite")?e?(l="right",n=s.x-i,o=i):(l="left",n=s.x,o=i):e?(l="left",n=s.x,o=i):(l="right",n=s.x-i,o=i);const c={left:n,right:n+o,top:a,bottom:a+r},h=t.get("bounds");Gt(c,h)||(t.set("bounds",c),t.set("pointerOrientation",l))}_updateLC(){const t=this.axis,e=t.parent;if(e){const i=e.innerHeight();this._lc=this.axisLength()/i,this._ls=t.y()/i}}toAxisPosition(t){const e=this._start||0,i=this._end||1;return t=(t-=this._ls)*(i-e)/this._lc,t=this.get("inversed")?e+t:i-t}toGlobalPosition(t){const e=this._start||0,i=this._end||1;return this.get("inversed")?t-=e:t=i-t,t=t/(i-e)*this._lc,t+=this._ls}fixPosition(t){return this.get("inversed")?t:1-t}}Object.defineProperty(wt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"AxisRendererY"}),Object.defineProperty(wt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Z.classNames.concat([wt.className])});class Dt extends U{constructor(){super(...arguments),Object.defineProperty(this,"_endIndex",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeGenerator",{enumerable:!0,configurable:!0,writable:!0,value:Jt()}),Object.defineProperty(this,"_fillGenerator",{enumerable:!0,configurable:!0,writable:!0,value:ge()}),Object.defineProperty(this,"_legendStroke",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_legendFill",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"strokes",{enumerable:!0,configurable:!0,writable:!0,value:new B(E.new({}),()=>G._new(this._root,{themeTags:F(this.strokes.template.get("themeTags",[]),["line","series","stroke"])},[this.strokes.template]))}),Object.defineProperty(this,"fills",{enumerable:!0,configurable:!0,writable:!0,value:new B(E.new({}),()=>G._new(this._root,{themeTags:F(this.strokes.template.get("themeTags",[]),["line","series","fill"])},[this.fills.template]))}),Object.defineProperty(this,"_fillTemplate",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeTemplate",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_previousPoint",{enumerable:!0,configurable:!0,writable:!0,value:[0,0,0,0]}),Object.defineProperty(this,"_dindex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_sindex",{enumerable:!0,configurable:!0,writable:!0,value:0})}_afterNew(){this._fillGenerator.y0(function(t){return t[3]}),this._fillGenerator.x0(function(t){return t[2]}),this._fillGenerator.y1(function(t){return t[1]}),this._fillGenerator.x1(function(t){return t[0]}),super._afterNew()}makeStroke(t){const e=this.mainContainer.children.push(t.make());return t.push(e),e}makeFill(t){const e=this.mainContainer.children.push(t.make());return t.push(e),e}_updateChildren(){this._strokeTemplate=void 0,this._fillTemplate=void 0;let t=this.get("xAxis"),e=this.get("yAxis");if(this.isDirty("stroke")){const i=this.get("stroke");this.strokes.template.set("stroke",i);const s=this._legendStroke;s&&s.states.lookup("default").set("stroke",i)}if(this.isDirty("fill")){const i=this.get("fill");this.fills.template.set("fill",i);const s=this._legendFill;s&&s.states.lookup("default").set("fill",i)}if(this.isDirty("curveFactory")){const i=this.get("curveFactory");i&&(this._strokeGenerator.curve(i),this._fillGenerator.curve(i))}if(t.inited&&e.inited){if(this._axesDirty||this._valuesDirty||this._stackDirty||this.isDirty("vcx")||this.isDirty("vcy")||this._sizeDirty||this.isDirty("connect")||this.isDirty("curveFactory")){this.fills.each(c=>{c.setPrivate("visible",!1)}),this.strokes.each(c=>{c.setPrivate("visible",!1)}),this.axisRanges.each(c=>{let h=c.fills;h&&h.each(g=>{g.setPrivate("visible",!1)});let d=c.strokes;d&&d.each(g=>{g.setPrivate("visible",!1)})});let i=this.startIndex(),s=this.strokes.template.get("templateField"),a=this.fills.template.get("templateField"),n=!0,r=!0;s&&(n=!1),a&&(r=!1);for(let c=i-1;c>=0;c--){let h=this.dataItems[c],d=!0,g=h.dataContext;if(s&&g[s]&&(n=!0),a&&g[a]&&(r=!0),w(this._valueFields,p=>{v(h.get(p))||(d=!1)}),d&&n&&r){i=c;break}}let o=this.dataItems.length,l=this.endIndex();if(l{v(h.get(g))||(d=!1)}),d){l=c+1;break}}}if(i>0&&i--,this._endIndex=l,this._clearGraphics(),this._sindex=0,this._dindex=i,this.dataItems.length==1)this._startSegment(0);else for(;this._dindex0&&(Tt=!0);let Mt=!1;(A||b||y)&&(Mt=!0);const xt={points:C,segments:T,stacked:A,getOpen:Mt,basePosX:I,basePosY:D,fillVisible:Tt,xField:u,yField:_,xOpenField:f,yOpenField:x,vcx:p,vcy:m,baseAxis:g,xAxis:h,yAxis:d,locationX:K,locationY:J,openLocationX:rt,openLocationY:L,minDistance:R};for(M=t;Mt){i=M;break}l.template=X}}if(W){let X=z.dataContext[W];if(X){if(X instanceof E||(X=E.new(X)),this._fillTemplate=X,M>t){i=M;break}n.template=X}}if(!a){let X=this.dataItems[M+1];X&&g.shouldGap(z,X,s,O)&&(C=[],T.push(C),xt.points=C)}}n.setRaw("userData",[t,M]),l.setRaw("userData",[t,M]),M===e&&this._endLine(C,T[0][0]),l&&this._drawStroke(l,T),n&&this._drawFill(n,T),this.axisRanges.each(z=>{const Q=z.container,bt=z.fills,X=this.makeFill(bt);Q&&Q.children.push(X),X.setPrivate("visible",!0),this._drawFill(X,T);const Qt=z.strokes,lt=this.makeStroke(Qt);Q&&Q.children.push(lt),lt.setPrivate("visible",!0),this._drawStroke(lt,T),X.setRaw("userData",[t,M]),lt.setRaw("userData",[t,M])})}_getPoints(t,e){let i=e.points,s=t.get("locationX",e.locationX),a=t.get("locationY",e.locationY),n=e.xAxis.getDataItemPositionX(t,e.xField,s,e.vcx),r=e.yAxis.getDataItemPositionY(t,e.yField,a,e.vcy);if(this._shouldInclude(n)){const o=this.getPoint(n,r),l=[o.x,o.y];if(o.x+=this._x,o.y+=this._y,t.set("point",o),e.fillVisible){let c=n,h=r;if(e.baseAxis===e.xAxis?h=e.basePosY:e.baseAxis===e.yAxis&&(c=e.basePosX),e.getOpen){let g=t.get(e.xOpenField),p=t.get(e.yOpenField);if(g!=null&&p!=null){let m=t.get("openLocationX",e.openLocationX),u=t.get("openLocationY",e.openLocationY);if(e.stacked){let _=t.get("stackToItemX"),f=t.get("stackToItemY");_?(c=e.xAxis.getDataItemPositionX(_,e.xField,m,_.component.get("vcx")),q(c)&&(c=e.basePosX)):c=e.yAxis===e.baseAxis?e.basePosX:e.xAxis.getDataItemPositionX(t,e.xOpenField,m,e.vcx),f?(h=e.yAxis.getDataItemPositionY(f,e.yField,u,f.component.get("vcy")),q(h)&&(h=e.basePosY)):h=e.xAxis===e.baseAxis?e.basePosY:e.yAxis.getDataItemPositionY(t,e.yOpenField,u,e.vcy)}else c=e.xAxis.getDataItemPositionX(t,e.xOpenField,m,e.vcx),h=e.yAxis.getDataItemPositionY(t,e.yOpenField,u,e.vcy)}}let d=this.getPoint(c,h);l[2]=d.x,l[3]=d.y}if(e.minDistance>0){const c=l[0],h=l[1],d=l[2],g=l[3],p=this._previousPoint,m=p[0],u=p[1],_=p[2],f=p[3];(Math.hypot(c-m,h-u)>e.minDistance||d&&g&&Math.hypot(d-_,g-f)>e.minDistance)&&(i.push(l),this._previousPoint=l)}else i.push(l)}}_endLine(t,e){}_drawStroke(t,e){t.get("visible")&&!t.get("forceHidden")&&t.set("draw",i=>{w(e,s=>{this._strokeGenerator.context(i),this._strokeGenerator(s)})})}_drawFill(t,e){t.get("visible")&&!t.get("forceHidden")&&t.set("draw",i=>{w(e,s=>{this._fillGenerator.context(i),this._fillGenerator(s)})})}_processAxisRange(t){super._processAxisRange(t),t.fills=new B(E.new({}),()=>G._new(this._root,{themeTags:F(t.fills.template.get("themeTags",[]),["line","series","fill"])},[this.fills.template,t.fills.template])),t.strokes=new B(E.new({}),()=>G._new(this._root,{themeTags:F(t.strokes.template.get("themeTags",[]),["line","series","stroke"])},[this.strokes.template,t.strokes.template]))}createLegendMarker(t){const e=this.get("legendDataItem");if(e){const i=e.get("marker"),s=e.get("markerRectangle");s&&s.setPrivate("visible",!1),i.set("background",nt.new(i._root,{fillOpacity:0,fill:ne(0)}));const a=i.children.push(G._new(i._root,{themeTags:["line","series","legend","marker","stroke"],interactive:!1},[this.strokes.template]));this._legendStroke=a;const n=i.children.push(G._new(i._root,{themeTags:["line","series","legend","marker","fill"]},[this.fills.template]));this._legendFill=n;const r=this._root.interfaceColors.get("disabled");if(a.states.create("disabled",{fill:r,stroke:r}),n.states.create("disabled",{fill:r,stroke:r}),this.bullets.length>0){const o=this.bullets.getIndex(0);if(o){const l=o(i._root,this,new ot(this,{legend:!0},{}));if(l){const c=l.get("sprite");c instanceof G&&c.states.create("disabled",{fill:r,stroke:r}),c&&(c.set("tooltipText",void 0),c.set("tooltipHTML",void 0),i.children.push(c),c.setAll({x:i.width()/2,y:i.height()/2}),i.events.on("boundschanged",()=>{c.setAll({x:i.width()/2,y:i.height()/2})}))}}}}}}Object.defineProperty(Dt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"LineSeries"}),Object.defineProperty(Dt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:U.classNames.concat([Dt.className])});class $ extends U{constructor(){super(...arguments),Object.defineProperty(this,"_ph",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_pw",{enumerable:!0,configurable:!0,writable:!0,value:0})}_makeGraphics(t,e){return this.makeColumn(e,t)}_makeFieldNames(){super._makeFieldNames();const t=this.get("xAxis"),e=this.get("yAxis"),i="CategoryAxis",s="ValueAxis";t.isType(i)&&(this.get("openCategoryXField")||(this._xOpenField=this._xField)),t.isType(s)&&(this.get("openValueXField")||(this._xOpenField=this._xField)),e.isType(i)&&(this.get("openCategoryYField")||(this._yOpenField=this._yField)),e.isType(s)&&(this.get("openValueYField")||(this._yOpenField=this._yField))}_prepareChildren(){super._prepareChildren();const t=this.get("xAxis"),e=this.get("yAxis"),i=this.dataItems.length,s=Math.max(0,this.startIndex()-2),a=Math.min(this.endIndex()+2,i-1);if(t.inited&&e.inited)for(let n=s;n<=a;n++){let r=this.dataItems[n];this._createGraphics(r)}}_updateChildren(){const t=this.chart;t&&(this._ph=t.plotContainer.height(),this._pw=t.plotContainer.width());const e=this.get("xAxis"),i=this.get("yAxis"),s=this.get("baseAxis"),a=this.columns.template;this.isDirty("fill")&&a.get("fill")==null&&a.set("fill",this.get("fill")),this.isDirty("stroke")&&a.get("stroke")==null&&a.set("stroke",this.get("stroke"));let n=0,r=0,o=0;w(s.series,_=>{if(_ instanceof $){const f=_.get("stacked");f&&o==0&&r++,!f&&_.get("clustered")&&r++}_===this&&(n=r-1),o++}),this.get("clustered")||(n=0,r=1),r===0&&(r=1,n=0);const l=e.get("renderer"),c=i.get("renderer"),h="cellStartLocation",d="cellEndLocation",g=l.get(h,0),p=l.get(d,1),m=c.get(h,0),u=c.get(d,1);if(this._aLocationX0=g+n/r*(p-g),this._aLocationX1=g+(n+1)/r*(p-g),this._aLocationY0=m+n/r*(u-m),this._aLocationY1=m+(n+1)/r*(u-m),e.inited&&i.inited){if(this._axesDirty||this._valuesDirty||this._stackDirty||this.isDirty("vcx")||this.isDirty("vcy")||this._sizeDirty){const _=this.dataItems.length;let f=Math.max(0,this.startIndex()-2),x=Math.min(this.endIndex()+2,_-1);for(let y=0;y0&&f>0)for(let I=y-1;I>=0;I--){let D=this.dataItems[I];if(D.get("valueX")!=null&&D.get("valueY")!=null){b=D;break}}break}this._toggleColumn(A,!1)}for(let y=f;y<=x;y++){let A=this.dataItems[y];this._updateGraphics(A,b),A.get("valueX")!=null&&A.get("valueY")!=null&&(b=A)}for(let y=x+1;y<_;y++)this._toggleColumn(this.dataItems[y],!1)}}else this._skipped=!0;this.updateLegendMarker(this.get("tooltipDataItem")),super._updateChildren()}_createGraphics(t){let e=t.get("graphics");if(!e){e=this._makeGraphics(this.columns,t),t.set("graphics",e),e._setDataItem(t);const i=t.get("legendDataItem");if(i){const a=i.get("markerRectangle");if(a){const n=a.states.lookup("default");w(Lt,r=>{const o=e.get(r,this.get(r));a.set(r,o),n.set(r,o)})}}let s=t.get("rangeGraphics");s&&w(s,a=>{a.dispose()}),s=[],t.setRaw("rangeGraphics",s),this.axisRanges.each(a=>{const n=a.container,r=this._makeGraphics(a.columns,t);s&&s.push(r),r.setPrivate("list",a.columns),n.children.push(r)})}}createAxisRange(t){return w(this.dataItems,e=>{const i=e.get("graphics");i&&(i.dispose(),e.set("graphics",void 0))}),super.createAxisRange(t)}_updateGraphics(t,e){let i=t.get("graphics");const s=this._xField,a=this._yField,n=t.get(s),r=t.get(a);if(n!=null&&r!=null){const o=this._xOpenField,l=this._yOpenField,c=this.get("locationX",t.get("locationX",.5)),h=this.get("locationY",t.get("locationY",.5)),d=this.get("openLocationX",t.get("openLocationX",c)),g=this.get("openLocationY",t.get("openLocationY",h)),p=i.get("width"),m=i.get("height"),u=this.get("stacked"),_=this.get("xAxis"),f=this.get("yAxis"),x=this.get("baseAxis"),b=_.get("start"),y=_.get("end"),A=f.get("start"),I=f.get("end");let D,O,T,C,N=this.get("vcy",1),W=this.get("vcx",1),K=!1,J=!1;if(f.isType("CategoryAxis")&&_.isType("CategoryAxis")){let L=this._aLocationX0+d-.5,R=this._aLocationX1+c-.5;if(p instanceof et){let M=(R-L)*(1-p.value)/2;L+=M,R-=M}if(D=_.getDataItemPositionX(t,o,L,W),O=_.getDataItemPositionX(t,s,R,W),L=this._aLocationY0+g-.5,R=this._aLocationY1+h-.5,m instanceof et){let M=(R-L)*(1-m.value)/2;L+=M,R-=M}T=f.getDataItemPositionY(t,l,L,N),C=f.getDataItemPositionY(t,a,R,N),t.setRaw("point",{x:D+(O-D)/2,y:T+(C-T)/2})}else if(_===x){let L=this._aLocationX0+d-.5,R=this._aLocationX1+c-.5;if(p instanceof et){let M=(R-L)*(1-p.value)/2;L+=M,R-=M}if(D=_.getDataItemPositionX(t,o,L,W),O=_.getDataItemPositionX(t,s,R,W),T=f.getDataItemPositionY(t,a,h,N),this._yOpenField!==this._yField)C=f.getDataItemPositionY(t,l,g,N);else if(u){let M=t.get("stackToItemY");C=M?f.getDataItemPositionY(M,a,g,M.component.get("vcy")):f.basePosition()}else C=f.basePosition();t.setRaw("point",{x:D+(O-D)/2,y:T}),J=!0}else if(f===x){let L=this._aLocationY0+g-.5,R=this._aLocationY1+h-.5;if(m instanceof et){let M=(R-L)*(1-m.value)/2;L+=M,R-=M}if(T=f.getDataItemPositionY(t,l,L,N),C=f.getDataItemPositionY(t,a,R,N),O=_.getDataItemPositionX(t,s,c,W),this._xOpenField!==this._xField)D=_.getDataItemPositionX(t,o,d,W);else if(u){let M=t.get("stackToItemX");D=M?_.getDataItemPositionX(M,s,d,M.component.get("vcx")):_.basePosition()}else D=_.basePosition();K=!0,t.setRaw("point",{x:O,y:T+(C-T)/2})}this._updateSeriesGraphics(t,i,D,O,T,C,K,J),Dy&&O>y||T=I&&C>I||q(D)||q(T)?this._toggleColumn(t,!1):this._toggleColumn(t,!0);let rt=t.get("rangeGraphics");rt&&w(rt,L=>{this._updateSeriesGraphics(t,L,D,O,T,C,K,J)}),this._applyGraphicsStates(t,e)}}_updateSeriesGraphics(t,e,i,s,a,n,r,o){const l=e.get("width"),c=e.get("height"),h=e.get("maxWidth"),d=e.get("maxHeight"),g=this.getPoint(i,a),p=this.getPoint(s,n),m=t.get("point");if(m){const u=this.getPoint(m.x,m.y);m.x=u.x+this._x,m.y=u.y+this._y}if(i=g.x,s=p.x,a=g.y,n=p.y,v(l)){const u=(s-i-l)/2;i+=u,s-=u}if(v(h)&&h{this._toggleColumn(t,!1)})}_applyGraphicsStates(t,e){const i=t.get("graphics"),s=i.states.lookup("dropFromOpen"),a=i.states.lookup("riseFromOpen"),n=i.states.lookup("dropFromPrevious"),r=i.states.lookup("riseFromPrevious");if(s||n||a||r){const o=this.get("xAxis"),l=this.get("yAxis"),c=this.get("baseAxis");let h,d,g;c===o&&l.isType("ValueAxis")?(h=t.get(this._yOpenField),d=t.get(this._yField),g=e.get(this._yField)):c===l&&o.isType("ValueAxis")&&(h=t.get(this._xOpenField),d=t.get(this._xField),g=e.get(this._xField)),v(h)&&v(d)&&(d{const a=s.getPrivate("list");a&&a.removeValue(s),s.dispose()})}hideDataItem(t,e){const i=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return it(this,void 0,void 0,function*(){const s=[i.hideDataItem.call(this,t,e)],a=t.get("graphics");a&&s.push(a.hide(e));const n=t.get("rangeGraphics");n&&w(n,r=>{s.push(r.hide(e))}),yield Promise.all(s)})}_toggleColumn(t,e){const i=t.get("graphics");i&&i.setPrivate("visible",e);const s=t.get("rangeGraphics");s&&w(s,n=>{n.setPrivate("visible",e)});const a=t.bullets;a&&w(a,n=>{n.setPrivate("hidden",!e)})}showDataItem(t,e){const i=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return it(this,void 0,void 0,function*(){const s=[i.showDataItem.call(this,t,e)],a=t.get("graphics");a&&s.push(a.show(e));const n=t.get("rangeGraphics");n&&w(n,r=>{s.push(r.show(e))}),yield Promise.all(s)})}updateLegendMarker(t){let e=this.get("legendDataItem");if(this.get("useLastColorForLegendMarker")&&!t){const i=this.dataItems[this.endIndex()-1];i&&(t=i)}if(e){let i=this.columns.template;if(t){let a=t.get("graphics");a&&(i=a)}const s=e.get("markerRectangle");if(s&&!e.get("itemContainer").get("disabled")){const a=s.states.lookup("default");w(Lt,n=>{const r=i.get(n,this.get(n));s.set(n,r),a.set(n,r)})}}}_getTooltipTarget(t){return this.get("seriesTooltipTarget")=="bullet"?super._getTooltipTarget(t):t.get("graphics")||this}}Object.defineProperty($,"className",{enumerable:!0,configurable:!0,writable:!0,value:"BaseColumnSeries"}),Object.defineProperty($,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:U.classNames.concat([$.className])});class at extends H{constructor(){super(...arguments),Object.defineProperty(this,"_frequency",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_itemMap",{enumerable:!0,configurable:!0,writable:!0,value:{}})}_afterNew(){this._settings.themeTags=F(this._settings.themeTags,["axis"]),this.fields.push("category"),this.setPrivateRaw("name","category"),this.addTag("category"),super._afterNew()}_prepareChildren(){super._prepareChildren();const t=this.dataItems.length;let e=0;this._valuesDirty&&(this._itemMap={},w(this.dataItems,i=>{i.setRaw("index",e),this._itemMap[i.get("category")]=i,e++}),this.setPrivateRaw("maxZoomFactor",t)),this.setPrivateRaw("startIndex",Math.max(Math.round(this.get("start",0)*t),0)),this.setPrivateRaw("endIndex",Math.min(Math.round(this.get("end",1)*t),t)),(this._sizeDirty||this._valuesDirty||this.isDirty("start")||this.isDirty("end")||this.isPrivateDirty("endIndex")||this.isPrivateDirty("startIndex")||this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&this.dataItems.length>0&&(this._handleRangeChange(),this._prepareAxisItems(),this._updateAxisRanges())}_handleRangeChange(){w(this.series,t=>{let e=this.dataItems[this.startIndex()].get("category"),i=this.dataItems[this.endIndex()-1].get("category"),s=t.get("baseAxis"),a=t.get("xAxis"),n=t.get("yAxis");if(a instanceof at&&n instanceof at)t._markDirtyAxes();else if(s===this){let r,o,l=n;if(a===s?(t.get("categoryXField")&&(r="categoryX"),t.get("openCategoryXField")&&(o="openCategoryX")):n===s&&(t.get("categoryYField")&&(r="categoryY"),t.get("openCategoryYField")&&(o="openCategoryY"),l=a),l.className=="ValueAxis"&&(r||o)){let c,h;for(let m=0,u=t.dataItems.length;m=0;m--){let u=t.dataItems[m];if(r&&u.get(r)===i){h=u;break}if(o&&u.get(o)===i){h=u;break}}let d=0,g=t.dataItems.length;c&&(d=t.dataItems.indexOf(c)),h&&(g=t.dataItems.indexOf(h)+1),t.setPrivate("startIndex",d),t.setPrivate("endIndex",g);let p=!1;for(let m=d;m{u.get(_)!=null&&(p=!0)}),w(t.__valueYShowFields,_=>{u.get(_)!=null&&(p=!0)}),p)break}t.setPrivate("outOfSelection",!p)}t._markDirtyAxes()}})}_prepareAxisItems(){var t;const e=this.get("renderer"),i=this.dataItems.length;let s=this.startIndex();s>0&&s--;let a=this.endIndex();a0){let i=this.getPrivate("name")+this.get("renderer").getPrivate("letter"),s=this.axisPositionToIndex(e),a=t.dataItems[s],n=this.dataItems[s],r=n.get("category");if(a&&n&&a.get(i)===r)return a;for(let o=0,l=t.dataItems.length;ojt._new(this._root,{position:"absolute",themeTags:F(this.columns.template.get("themeTags",[]),["series","column"])},[this.columns.template]))})}makeColumn(t,e){const i=this.mainContainer.children.push(e.make());return i._setDataItem(t),e.push(i),i}_processAxisRange(t){super._processAxisRange(t),t.columns=new B(E.new({}),()=>jt._new(this._root,{position:"absolute",themeTags:F(t.columns.template.get("themeTags",[]),["series","column"])},[this.columns.template,t.columns.template]))}}Object.defineProperty(At,"className",{enumerable:!0,configurable:!0,writable:!0,value:"ColumnSeries"}),Object.defineProperty(At,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:$.classNames.concat([At.className])});export{Pt as AxisRendererXAm5,wt as AxisRendererYAm5,at as CategoryAxisAm5,At as ColumnSeriesAm5,Dt as LineSeriesAm5,yt as ValueAxisAm5,ft as XYChartAm5,vt as XYCursorAm5}; +import{aD as It,i as S,r as k,b as G,z as nt,a3 as te,h as ct,aE as ee,N as mt,W as gt,w,aF as Ct,C as v,aG as Ot,ak as F,q as Xt,c as ie,aH as j,aI as se,a6 as ae,aJ as oe,am as kt,al as Vt,ar as _t,aK as Gt,at as B,au as E,aL as q,K as ne,an as re,ap as ht,aa as Yt,F as dt,a as tt,ad as et,aA as Et,f as St,aM as Ft,aN as le,m as he,ay as Lt}from"./Theme-6HY29PEY.js";import{s as Rt}from"./ColorSet-wEWjQ87p.js";import{l as Y}from"./DefaultTheme-Ze4cVXuP.js";import{R as Nt,D as zt,_ as Bt,g as ot,U as Wt,V as Ut,k as V,I as de}from"./Tick-DedlQq8S.js";import{o as ce,n as jt}from"./Button-D2RihRUZ.js";import{ed as it}from"./index-BjUNJPVf.js";function Ht(P){return typeof P=="object"&&"length"in P?P:Array.from(P)}function Zt(P){this._context=P}function $t(P){return new Zt(P)}function qt(P){return P[0]}function Kt(P){return P[1]}function Jt(P,t){var e=V(!0),i=null,s=$t,a=null,n=Ut(r);function r(o){var l,c,h,d=(o=Ht(o)).length,g=!1;for(i==null&&(a=s(h=n())),l=0;l<=d;++l)!(l=g;--p)r.point(x[p],b[p]);r.lineEnd(),r.areaEnd()}f&&(x[d]=+P(m,d,h),b[d]=+t(m,d,h),r.point(i?+i(m,d,h):x[d],e?+e(m,d,h):b[d]))}if(u)return r=null,u+""||null}function c(){return Jt().defined(s).curve(n).context(a)}return P=typeof P=="function"?P:P===void 0?qt:V(+P),t=typeof t=="function"?t:V(t===void 0?0:+t),e=typeof e=="function"?e:e===void 0?Kt:V(+e),l.x=function(h){return arguments.length?(P=typeof h=="function"?h:V(+h),i=null,l):P},l.x0=function(h){return arguments.length?(P=typeof h=="function"?h:V(+h),l):P},l.x1=function(h){return arguments.length?(i=h==null?null:typeof h=="function"?h:V(+h),l):i},l.y=function(h){return arguments.length?(t=typeof h=="function"?h:V(+h),e=null,l):t},l.y0=function(h){return arguments.length?(t=typeof h=="function"?h:V(+h),l):t},l.y1=function(h){return arguments.length?(e=h==null?null:typeof h=="function"?h:V(+h),l):e},l.lineX0=l.lineY0=function(){return c().x(P).y(t)},l.lineY1=function(){return c().x(P).y(e)},l.lineX1=function(){return c().x(i).y(t)},l.defined=function(h){return arguments.length?(s=typeof h=="function"?h:V(!!h),l):s},l.curve=function(h){return arguments.length?(n=h,a!=null&&(r=n(a)),l):n},l.context=function(h){return arguments.length?(h==null?a=r=null:r=n(a=h),l):a},l}Zt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(P,t){switch(P=+P,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(P,t):this._context.moveTo(P,t);break;case 1:this._point=2;default:this._context.lineTo(P,t)}}};class ue extends re{setupDefaultRules(){super.setupDefaultRules();const t=this._root.interfaceColors,e=this._root.language,i=this.rule.bind(this);i("XYChart").setAll({colors:Rt.new(this._root,{}),paddingLeft:20,paddingRight:20,paddingTop:16,paddingBottom:16,panX:!1,panY:!1,wheelStep:.25,arrangeTooltips:!0,pinchZoomX:!1,pinchZoomY:!1}),i("XYSeries").setAll({legendLabelText:"{name}"}),i("XYChart",["scrollbar","chart"]).setAll({paddingBottom:0,paddingLeft:0,paddingTop:0,paddingRight:0,colors:Rt.new(this._root,{saturation:0})});{const o=i("Graphics",["scrollbar","overlay"]);o.setAll({fillOpacity:.5}),Y(o,"fill",t,"background")}i("RoundedRectangle",["xy","scrollbar","thumb"]).setAll({cornerRadiusTR:0,cornerRadiusTL:0,cornerRadiusBR:0,cornerRadiusBL:0,fillOpacity:0,focusable:!0}),i("RoundedRectangle",["xy","scrollbar","thumb"]).states.create("hover",{fillOpacity:.4}),i("RoundedRectangle",["xy","scrollbar","chart","background"]).setAll({cornerRadiusTL:0,cornerRadiusBL:0,cornerRadiusTR:0,cornerRadiusBR:0}),i("RoundedRectangle",["xy","scrollbar","chart","background","resize","button"]).setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),i("AxisRendererX",["xy","chart","scrollbar"]).setAll({strokeOpacity:0,inside:!0}),i("AxisRendererY",["xy","chart","scrollbar"]).setAll({strokeOpacity:0,inside:!0,minGridDistance:5}),i("AxisLabel",["xy","scrollbar","x"]).setAll({opacity:.5,centerY:k,minPosition:.01,maxPosition:.99,fontSize:"0.8em"}),i("AxisLabel",["category"]).setAll({text:"{category}",populateText:!0}),i("AxisLabel",["x"]).setAll({centerY:0}),i("AxisLabel",["x","inside"]).setAll({centerY:k}),i("AxisLabel",["x","inside","opposite"]).setAll({centerY:0}),i("AxisLabel",["x","opposite"]).setAll({centerY:k}),i("AxisLabel",["y"]).setAll({centerX:k}),i("AxisLabel",["y","inside"]).setAll({centerX:0}),i("AxisLabel",["y","inside","opposite"]).setAll({centerX:k}),i("AxisLabel",["y","opposite"]).setAll({centerX:0}),i("AxisLabel",["minor"]).setAll({fontSize:"0.6em"}),i("AxisLabel",["xy","scrollbar","y"]).setAll({visible:!1}),i("Grid",["xy","scrollbar","y"]).setAll({visible:!1}),i("Grid",["xy","scrollbar","x"]).setAll({opacity:.5}),i("XYCursor").setAll({behavior:"none",layer:30,exportable:!1,snapToSeriesBy:"xy",moveThreshold:1});{const o=i("Grid",["cursor","x"]);o.setAll({strokeOpacity:.8,strokeDasharray:[2,2],ariaLabel:e.translate("Use left and right arrows to move selection")}),Y(o,"stroke",t,"alternativeBackground")}{const o=i("Grid",["cursor","y"]);o.setAll({strokeOpacity:.8,strokeDasharray:[2,2],ariaLabel:e.translate("Use up and down arrows to move selection")}),Y(o,"stroke",t,"alternativeBackground")}{const o=i("Graphics",["cursor","selection"]);o.setAll({fillOpacity:.15}),Y(o,"fill",t,"alternativeBackground")}i("Axis").setAll({start:0,end:1,minZoomCount:1,maxZoomCount:1/0,maxZoomFactor:1e3,maxDeviation:.1,snapTooltip:!0,tooltipLocation:.5,panX:!0,panY:!0,zoomX:!0,zoomY:!0,fixAxisSize:!0}),i("AxisLabel").setAll({location:.5,multiLocation:0,centerX:ht,centerY:ht,paddingTop:3,paddingBottom:3,paddingLeft:5,paddingRight:5}),i("Container",["axis","header"]).setAll({layer:30}),i("Rectangle",["axis","header","background"]).setAll({crisp:!0});{const o=i("AxisRenderer");o.setAll({crisp:!0,strokeOpacity:0}),Y(o,"stroke",t,"grid")}i("AxisRendererX").setAll({minGridDistance:120,opposite:!1,inversed:!1,cellStartLocation:0,cellEndLocation:1,width:k}),i("AxisRendererY").setAll({minGridDistance:40,opposite:!1,inversed:!1,cellStartLocation:0,cellEndLocation:1,height:k});{const o=i("Rectangle",["axis","thumb"]);o.setAll({fillOpacity:0}),Y(o,"fill",t,"alternativeBackground"),o.states.create("hover",{fillOpacity:.1})}i("Rectangle",["axis","thumb","x"]).setAll({cursorOverStyle:"ew-resize"}),i("Rectangle",["axis","thumb","y"]).setAll({cursorOverStyle:"ns-resize"});{const o=i("Grid");o.setAll({location:0,strokeOpacity:.15,crisp:!0}),Y(o,"stroke",t,"grid")}{const o=i("Grid",["minor"]);o.setAll({location:0,strokeOpacity:.07,crisp:!0}),Y(o,"stroke",t,"grid")}i("Grid",["base"]).setAll({strokeOpacity:.3});{const o=i("Graphics",["axis","fill"]);o.setAll({visible:!1,isMeasured:!1,position:"absolute",fillOpacity:.05}),Y(o,"fill",t,"alternativeBackground")}i("Graphics",["axis","fill","range"]).setAll({isMeasured:!0}),i("Graphics",["series","fill","range"]).setAll({visible:!1,isMeasured:!0}),i("Grid",["series","range"]).setAll({visible:!1}),i("AxisTick",["series","range"]).setAll({visible:!1}),i("AxisLabel",["series","range"]).setAll({visible:!1});{const o=i("AxisTick");o.setAll({location:.5,multiLocation:0,strokeOpacity:1,isMeasured:!1,position:"absolute",visible:!1}),Y(o,"stroke",t,"grid")}i("CategoryAxis").setAll({startLocation:0,endLocation:1,fillRule:(o,l)=>{const c=o.get("axisFill");c&&(v(l)&&l%2!=0?c.setPrivate("visible",!1):c.setPrivate("visible",!0))}});const s=[{timeUnit:"millisecond",count:1},{timeUnit:"millisecond",count:5},{timeUnit:"millisecond",count:10},{timeUnit:"millisecond",count:50},{timeUnit:"millisecond",count:100},{timeUnit:"millisecond",count:500},{timeUnit:"second",count:1},{timeUnit:"second",count:5},{timeUnit:"second",count:10},{timeUnit:"second",count:30},{timeUnit:"minute",count:1},{timeUnit:"minute",count:5},{timeUnit:"minute",count:10},{timeUnit:"minute",count:15},{timeUnit:"minute",count:30},{timeUnit:"hour",count:1},{timeUnit:"hour",count:3},{timeUnit:"hour",count:6},{timeUnit:"hour",count:12},{timeUnit:"day",count:1},{timeUnit:"day",count:2},{timeUnit:"day",count:3},{timeUnit:"day",count:4},{timeUnit:"day",count:5},{timeUnit:"week",count:1},{timeUnit:"month",count:1},{timeUnit:"month",count:2},{timeUnit:"month",count:3},{timeUnit:"month",count:6},{timeUnit:"year",count:1},{timeUnit:"year",count:2},{timeUnit:"year",count:5},{timeUnit:"year",count:10},{timeUnit:"year",count:50},{timeUnit:"year",count:100},{timeUnit:"year",count:200},{timeUnit:"year",count:500},{timeUnit:"year",count:1e3},{timeUnit:"year",count:2e3},{timeUnit:"year",count:5e3},{timeUnit:"year",count:1e4},{timeUnit:"year",count:1e5}],a={millisecond:e.translate("_date_millisecond"),second:e.translate("_date_second"),minute:e.translate("_date_minute"),hour:e.translate("_date_hour"),day:e.translate("_date_day"),week:e.translate("_date_day"),month:e.translate("_date_month"),year:e.translate("_date_year")},n={millisecond:e.translate("_date_millisecond"),second:e.translate("_date_second"),minute:e.translate("_date_minute"),hour:e.translate("_date_day"),day:e.translate("_date_day"),week:e.translate("_date_day"),month:e.translate("_date_month")+" "+e.translate("_date_year"),year:e.translate("_date_year")},r={millisecond:e.translate("_date_millisecond_full"),second:e.translate("_date_second_full"),minute:e.translate("_date_minute_full"),hour:e.translate("_date_hour_full"),day:e.translate("_date_day_full"),week:e.translate("_date_week_full"),month:e.translate("_date_month_full"),year:e.translate("_date_year")};i("CategoryDateAxis").setAll({markUnitChange:!0,gridIntervals:Yt(s),dateFormats:dt(a),periodChangeDateFormats:dt(n)}),i("DateAxis").setAll({maxZoomFactor:null,strictMinMax:!0,startLocation:0,endLocation:1,markUnitChange:!0,groupData:!1,groupCount:500,gridIntervals:Yt(s),dateFormats:dt(a),periodChangeDateFormats:dt(n),tooltipDateFormats:r,groupIntervals:[{timeUnit:"millisecond",count:1},{timeUnit:"millisecond",count:10},{timeUnit:"millisecond",count:100},{timeUnit:"second",count:1},{timeUnit:"second",count:10},{timeUnit:"minute",count:1},{timeUnit:"minute",count:10},{timeUnit:"hour",count:1},{timeUnit:"day",count:1},{timeUnit:"week",count:1},{timeUnit:"month",count:1},{timeUnit:"year",count:1}],fillRule:o=>{const l=o.get("axisFill");if(l){const c=o.component,h=o.get("value"),d=o.get("endValue"),g=c.intervalDuration(),p=c.getPrivate("baseInterval"),m=c.getPrivate("gridInterval",p);let u=c.getPrivate("min",0);if(u=de(new Date(u),m.timeUnit,m.count,this._root.locale.firstDayOfWeek,this._root.utc,void 0,this._root.timezone).getTime(),h!=null&&d!=null){const _=Math.round(Math.round((h-u)/g))/2;_==Math.round(_)?l.setPrivate("visible",!0):l.setPrivate("visible",!1)}}}}),i("GaplessDateAxis").setAll({fillRule:o=>{const l=o.get("axisFill");if(l){const c=o.get("index");let h=!1;v(c)&&c%2!=0||(h=!0),l.setPrivate("visible",h)}}}),i("ValueAxis").setAll({baseValue:0,logarithmic:!1,strictMinMax:!1,autoZoom:!0,fillRule:o=>{const l=o.get("axisFill");if(l){const c=o.component,h=o.get("value"),d=c.getPrivate("step");v(h)&&v(d)&&(j(h/d/2,5)==Math.round(h/d/2)?l.setPrivate("visible",!1):l.setPrivate("visible",!0))}}}),i("DurationAxis").setAll({baseUnit:"second"}),i("XYSeries").setAll({maskBullets:!0,stackToNegative:!0,locationX:.5,locationY:.5,snapTooltip:!1,openValueXGrouped:"open",openValueYGrouped:"open",valueXGrouped:"close",valueYGrouped:"close",seriesTooltipTarget:"series"}),i("BaseColumnSeries").setAll({adjustBulletPosition:!0}),i("ColumnSeries").setAll({clustered:!0}),i("RoundedRectangle",["series","column"]).setAll({position:"absolute",isMeasured:!1,width:tt(70),height:tt(70),strokeWidth:1,strokeOpacity:1,cornerRadiusBL:0,cornerRadiusTL:0,cornerRadiusBR:0,cornerRadiusTR:0,fillOpacity:1,role:"figure"}),i("LineSeries").setAll({connect:!0,autoGapCount:1.1,stackToNegative:!1}),i("Graphics",["series","stroke"]).setAll({position:"absolute",strokeWidth:1,strokeOpacity:1,isMeasured:!1}),i("Graphics",["series","fill"]).setAll({visible:!1,fillOpacity:0,position:"absolute",strokeWidth:0,strokeOpacity:0,isMeasured:!1}),i("Graphics",["line","series","legend","marker","stroke"]).setAll({draw:(o,l)=>{const c=l.parent;if(c){const h=c.height(),d=c.width();o.moveTo(0,h/2),o.lineTo(d,h/2)}}});{const o=i("Graphics",["line","series","legend","marker","stroke"]).states.create("disabled",{});Y(o,"stroke",t,"disabled")}i("Graphics",["line","series","legend","marker","fill"]).setAll({draw:(o,l)=>{const c=l.parent;if(c){const h=c.height(),d=c.width();o.moveTo(0,0),o.lineTo(d,0),o.lineTo(d,h),o.lineTo(0,h),o.lineTo(0,0)}}});{const o=i("Graphics",["line","series","legend","marker","fill"]).states.create("disabled",{});Y(o,"stroke",t,"disabled")}i("SmoothedXYLineSeries").setAll({tension:.5}),i("SmoothedXLineSeries").setAll({tension:.5}),i("SmoothedYLineSeries").setAll({tension:.5}),i("Candlestick").setAll({position:"absolute",isMeasured:!1,width:tt(50),height:tt(50),strokeWidth:1,strokeOpacity:1,cornerRadiusBL:0,cornerRadiusTL:0,cornerRadiusBR:0,cornerRadiusTR:0,fillOpacity:1,role:"figure"}),i("OHLC").setAll({width:tt(80),height:tt(80)}),i("CandlestickSeries").setAll({lowValueXGrouped:"low",lowValueYGrouped:"low",highValueXGrouped:"high",highValueYGrouped:"high",openValueXGrouped:"open",openValueYGrouped:"open",valueXGrouped:"close",valueYGrouped:"close"});{const o=i("Rectangle",["column","autocolor"]).states.create("riseFromOpen",{});Y(o,"fill",t,"positive"),Y(o,"stroke",t,"positive")}{const o=i("Rectangle",["column","autocolor"]).states.create("dropFromOpen",{});Y(o,"fill",t,"negative"),Y(o,"stroke",t,"negative")}i("Rectangle",["column","autocolor","pro"]).states.create("riseFromOpen",{fillOpacity:0}),i("Rectangle",["column","autocolor","pro"]).states.create("dropFromOpen",{fillOpacity:1});{const o=i("Rectangle",["column","autocolor","pro"]).states.create("riseFromPrevious",{});Y(o,"fill",t,"positive"),Y(o,"stroke",t,"positive")}{const o=i("Rectangle",["column","autocolor","pro"]).states.create("dropFromPrevious",{});Y(o,"fill",t,"negative"),Y(o,"stroke",t,"negative")}i("RoundedRectangle",["rangegrip"]).setAll({strokeOpacity:0,fillOpacity:0,strokeWidth:1,width:12,height:12});{const o=i("Graphics",["rangegrip","button","icon"]);o.setAll({interactive:!1,crisp:!0,strokeOpacity:.5,draw:l=>{l.moveTo(0,.5),l.lineTo(0,12.5),l.moveTo(2,.5),l.lineTo(2,12.5),l.moveTo(4,.5),l.lineTo(4,12.5)}}),Y(o,"stroke",t,"secondaryButtonText")}i("Button",["rangegrip"]).setAll({draggable:!0,paddingTop:0,paddingBottom:0}),i("Button",["rangegrip","vertical"]).setAll({rotation:90,cursorOverStyle:"ns-resize",centerX:ht}),i("Button",["rangegrip","horizontal"]).setAll({cursorOverStyle:"ew-resize",centerX:ht}),i("Button",["rangegrip","vertical","left"]).setAll({centerY:k}),i("Button",["rangegrip","vertical","right"]).setAll({centerY:0}),i("Button",["rangegrip","horizontal","top"]).setAll({centerY:0}),i("Button",["rangegrip","horizontal","bottom"]).setAll({centerY:k})}}class ft extends Nt{constructor(){super(...arguments),Object.defineProperty(this,"xAxes",{enumerable:!0,configurable:!0,writable:!0,value:new It}),Object.defineProperty(this,"yAxes",{enumerable:!0,configurable:!0,writable:!0,value:new It}),Object.defineProperty(this,"topAxesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.chartContainer.children.push(S.new(this._root,{width:k,layout:this._root.verticalLayout}))}),Object.defineProperty(this,"yAxesAndPlotContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.chartContainer.children.push(S.new(this._root,{width:k,height:k,layout:this._root.horizontalLayout}))}),Object.defineProperty(this,"bottomAxesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.chartContainer.children.push(S.new(this._root,{width:k,layout:this._root.verticalLayout}))}),Object.defineProperty(this,"leftAxesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.yAxesAndPlotContainer.children.push(S.new(this._root,{height:k,layout:this._root.horizontalLayout}))}),Object.defineProperty(this,"plotsContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.yAxesAndPlotContainer.children.push(S.new(this._root,{width:k,height:k,maskContent:!1}))}),Object.defineProperty(this,"plotContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.plotsContainer.children.push(S.new(this._root,{width:k,height:k}))}),Object.defineProperty(this,"topPlotContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.plotsContainer.children.push(S.new(this._root,{width:k,height:k}))}),Object.defineProperty(this,"gridContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.plotContainer.children.push(S.new(this._root,{width:k,height:k,isMeasured:!1}))}),Object.defineProperty(this,"topGridContainer",{enumerable:!0,configurable:!0,writable:!0,value:S.new(this._root,{width:k,height:k,isMeasured:!1})}),Object.defineProperty(this,"rightAxesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.yAxesAndPlotContainer.children.push(S.new(this._root,{height:k,layout:this._root.horizontalLayout}))}),Object.defineProperty(this,"axisHeadersContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.plotContainer.children.push(S.new(this._root,{}))}),Object.defineProperty(this,"zoomOutButton",{enumerable:!0,configurable:!0,writable:!0,value:this.topPlotContainer.children.push(ce.new(this._root,{themeTags:["zoom"],icon:G.new(this._root,{themeTags:["button","icon"]})}))}),Object.defineProperty(this,"_movePoint",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0}}),Object.defineProperty(this,"_wheelDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_otherCharts",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_movePoints",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_downStartX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downEndX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downStartY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downEndY",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){this._defaultThemes.push(ue.new(this._root)),super._afterNew(),this._disposers.push(this.xAxes),this._disposers.push(this.yAxes);const t=this._root;let e=this._root.verticalLayout;const i=this.zoomOutButton;i.events.on("click",()=>{this.zoomOut()}),i.hide(0),i.states.lookup("default").set("opacity",1),this.chartContainer.set("layout",e);const s=this.plotContainer;s.children.push(this.seriesContainer),this._disposers.push(this._processAxis(this.xAxes,this.bottomAxesContainer)),this._disposers.push(this._processAxis(this.yAxes,this.leftAxesContainer)),s.children.push(this.topGridContainer),s.children.push(this.bulletsContainer),s.set("interactive",!0),s.set("interactiveChildren",!1),s.set("background",nt.new(t,{themeTags:["xy","background"],fill:te.fromHex(0),fillOpacity:0})),this._disposers.push(s.events.on("pointerdown",a=>{this._handlePlotDown(a)})),this._disposers.push(s.events.on("globalpointerup",a=>{this._handlePlotUp(a)})),this._disposers.push(s.events.on("globalpointermove",a=>{this._handlePlotMove(a)})),this._maskGrid(),this._setUpTouch()}_beforeChanged(){super._beforeChanged(),(this.isDirty("pinchZoomX")||this.isDirty("pinchZoomY")||this.get("panX")||this.get("panY"))&&this._setUpTouch()}_setUpTouch(){this.plotContainer._display.cancelTouch||(this.plotContainer._display.cancelTouch=!!(this.get("pinchZoomX")||this.get("pinchZoomY")||this.get("panX")||this.get("panY")))}_maskGrid(){this.gridContainer.set("maskContent",!0),this.topGridContainer.set("maskContent",!0)}_removeSeries(t){t._unstack(),t._posXDp&&t._posXDp.dispose(),t._posYDp&&t._posYDp.dispose(),t.set("baseAxis",void 0);const e=t.get("xAxis");e&&(ct(e.series,t),e.markDirtyExtremes());const i=t.get("yAxis");i&&(ct(i.series,t),i.markDirtyExtremes());const s=this.get("cursor");if(s){const a=s.get("snapToSeries");a&&ct(a,t)}super._removeSeries(t)}handleWheel(t){const e=this.get("wheelX"),i=this.get("wheelY"),s=this.plotContainer,a=t.originalEvent;if(!ee(a,this))return;a.preventDefault();const n=s.toLocal(t.point),r=this.get("wheelStep",.2),o=a.deltaY/100,l=a.deltaX/100,c=this.get("wheelZoomPositionX"),h=this.get("wheelZoomPositionY");e!=="zoomX"&&e!=="zoomXY"||l==0||this.xAxes.each(d=>{if(d.get("zoomX")){let g=d.get("start"),p=d.get("end"),m=d.fixPosition(n.x/s.width());c!=null&&(m=c);let u=g-r*(p-g)*l*m,_=p+r*(p-g)*l*(1-m);1/(_-u){if(d.get("zoomX")){let g=d.get("start"),p=d.get("end"),m=d.fixPosition(n.x/s.width());c!=null&&(m=c);let u=g-r*(p-g)*o*m,_=p+r*(p-g)*o*(1-m);1/(_-u){if(d.get("zoomY")){let g=d.get("start"),p=d.get("end"),m=d.fixPosition(n.y/s.height());h!=null&&(m=h);let u=g-r*(p-g)*l*m,_=p+r*(p-g)*l*(1-m);1/(_-u){if(d.get("zoomY")){let g=d.get("start"),p=d.get("end"),m=d.fixPosition(n.y/s.height());h!=null&&(m=h);let u=g-r*(p-g)*o*m,_=p+r*(p-g)*o*(1-m);1/(_-u){if(d.get("panX")){let g=d.get("start"),p=d.get("end"),m=this._getWheelSign(d)*r*(p-g)*l,u=g+m,_=p+m,f=this._fixWheel(u,_);u=f[0],_=f[1],this._handleWheelAnimation(d.zoom(u,_))}}),i!=="panX"&&i!=="panXY"||o==0||this.xAxes.each(d=>{if(d.get("panX")){let g=d.get("start"),p=d.get("end"),m=this._getWheelSign(d)*r*(p-g)*o,u=g+m,_=p+m,f=this._fixWheel(u,_);u=f[0],_=f[1],this._handleWheelAnimation(d.zoom(u,_))}}),e!=="panY"&&e!=="panXY"||l==0||this.yAxes.each(d=>{if(d.get("panY")){let g=d.get("start"),p=d.get("end"),m=this._getWheelSign(d)*r*(p-g)*l,u=g+m,_=p+m,f=this._fixWheel(u,_);u=f[0],_=f[1],this._handleWheelAnimation(d.zoom(u,_))}}),i!=="panY"&&i!=="panXY"||o==0||this.yAxes.each(d=>{if(d.get("panY")){let g=d.get("start"),p=d.get("end"),m=this._getWheelSign(d)*r*(p-g)*o,u=g-m,_=p-m,f=this._fixWheel(u,_);u=f[0],_=f[1],this._handleWheelAnimation(d.zoom(u,_))}})}_handleSetWheel(){const t=this.get("wheelX"),e=this.get("wheelY"),i=this.plotContainer;t!=="none"||e!=="none"?(this._wheelDp=i.events.on("wheel",s=>{const a=s.originalEvent;(t!=="none"&&Math.abs(a.deltaX)!=0||e!=="none"&&Math.abs(a.deltaY)!=0)&&this.handleWheel(s)}),this._disposers.push(this._wheelDp)):this._wheelDp&&this._wheelDp.dispose()}_getWheelSign(t){let e=1;return t.get("renderer").get("inversed")&&(e=-1),e}_fixWheel(t,e){const i=e-t;return t<0&&(e=(t=0)+i),e>1&&(t=(e=1)-i),[t,e]}_handlePlotDown(t){const e=t.originalEvent;if(e.button==2)return;const i=this.plotContainer;let s=i.toLocal(t.point);if((this.get("pinchZoomX")||this.get("pinchZoomY"))&&e.pointerId&&mt(i._downPoints).length>0){const a=this.xAxes.getIndex(0),n=this.yAxes.getIndex(0);a&&(this._downStartX=a.get("start",0),this._downEndX=a.get("end",1)),n&&(this._downStartY=n.get("start",0),this._downEndY=n.get("end",1))}if((this.get("panX")||this.get("panY"))&&s.x>=0&&s.y>=0&&s.x<=i.width()&&s.y<=this.height()){this._downPoint={x:e.clientX,y:e.clientY};const a=this.get("panX"),n=this.get("panY");a&&this.xAxes.each(o=>{o._panStart=o.get("start"),o._panEnd=o.get("end")}),n&&this.yAxes.each(o=>{o._panStart=o.get("start"),o._panEnd=o.get("end")});const r="panstarted";this.events.isEnabled(r)&&this.events.dispatch(r,{type:r,target:this,originalEvent:t.originalEvent})}}_handleWheelAnimation(t){t?t.events.on("stopped",()=>{this._dispatchWheelAnimation()}):this._dispatchWheelAnimation()}_dispatchWheelAnimation(){const t="wheelended";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this})}_handlePlotUp(t){const e=this._downPoint;if(e&&(this.get("panX")||this.get("panY"))){let i=this.plotContainer.toLocal(t.point);if(i.x==e.x&&i.y==e.y){const a="pancancelled";this.events.isEnabled(a)&&this.events.dispatch(a,{type:a,target:this,originalEvent:t.originalEvent})}const s="panended";this.events.isEnabled(s)&&this.events.dispatch(s,{type:s,target:this,originalEvent:t.originalEvent})}this._downPoint=void 0,this.xAxes.each(i=>{i._isPanning=!1}),this.yAxes.each(i=>{i._isPanning=!1})}_handlePlotMove(t){const e=this.plotContainer;if(this.get("pinchZoomX")||this.get("pinchZoomY")){const s=t.originalEvent.pointerId;if(s&&(this._movePoints[s]=t.point,mt(e._downPoints).length>1))return void this._handlePinch()}let i=this._downPoint;if(i){i=e.toLocal(this._root.documentPointToRoot(i));let s=e.toLocal(t.point);const a=this.get("panX"),n=this.get("panY");if(a){let r=this.get("scrollbarX");r&&r.events.disableType("rangechanged"),this.xAxes.each(o=>{if(o.get("panX")){o._isPanning=!0;let l=o._panStart,c=o._panEnd,h=(c-l)*(i.x-s.x)/e.width();o.get("renderer").get("inversed")&&(h*=-1);let d=l+h,g=c+h;g-d<1+2*o.get("maxDeviation",1)&&(o.set("start",d),o.set("end",g))}}),r&&r.events.enableType("rangechanged")}if(n){let r=this.get("scrollbarY");r&&r.events.disableType("rangechanged"),this.yAxes.each(o=>{if(o.get("panY")){o._isPanning=!0;let l=o._panStart,c=o._panEnd,h=(c-l)*(i.y-s.y)/e.height();o.get("renderer").get("inversed")&&(h*=-1);let d=l-h,g=c-h;g-d<1+2*o.get("maxDeviation",1)&&(o.set("start",d),o.set("end",g))}}),r&&r.events.enableType("rangechanged")}}}_handlePinch(){const t=this.plotContainer;let e=0,i=[],s=[];if(gt(t._downPoints,(a,n)=>{i[e]=n;let r=this._movePoints[a];r&&(s[e]=r),e++}),i.length>1&&s.length>1){const a=t.width(),n=t.height();let r=i[0],o=i[1],l=s[0],c=s[1];if(r&&o&&l&&c){if(l=t.toLocal(l),c=t.toLocal(c),r=t.toLocal(r),o=t.toLocal(o),this.get("pinchZoomX")){const h=this._downStartX,d=this._downEndX;if(h!=null&&d!=null){r.x>o.x&&([r,o]=[o,r],[l,c]=[c,l]);let g=h+r.x/a*(d-h),p=h+o.x/a*(d-h),m=h+l.x/a*(d-h),u=h+c.x/a*(d-h),_=Math.max(.001,p-g)/Math.max(.001,u-m),f=h*_+g-m*_,x=d*_+p-u*_;this.xAxes.each(b=>{let y=b.fixPosition(f),A=b.fixPosition(x);b.zoom(y,A,0)})}}if(this.get("pinchZoomY")){const h=this._downStartY,d=this._downEndY;if(h!=null&&d!=null){r.y{let y=b.fixPosition(f),A=b.fixPosition(x);b.zoom(y,A,0)})}}}}}_handleCursorPosition(){const t=this.get("cursor");if(t){const e=t.getPrivate("point");let i=t.get("snapToSeries");if(t._downPoint&&(i=void 0),i&&e){const s=t.get("snapToSeriesBy"),a=[];w(i,o=>{if(!o.isHidden()&&!o.isHiding())if(s!="x!"&&s!="y!"){const l=o.startIndex(),c=o.endIndex();for(let h=l;h{const l=o.get("point");if(l){let c=0;c=s=="x"||s=="x!"?Math.abs(e.x-l.x):s=="y"||s=="y!"?Math.abs(e.y-l.y):Math.hypot(e.x-l.x,e.y-l.y),c{const l=o.get("tooltip");l&&l._setDataItem(void 0)}),n){let o=n.component;o.showDataItemTooltip(n);const l=n.get("point");l&&t.handleMove(o.toGlobal({x:l.x-o.x(),y:l.y-o.y()}),!0)}}}}_updateCursor(){let t=this.get("cursor");t&&t.updateCursor()}_addCursor(t){this.plotContainer.children.push(t)}_prepareChildren(){if(super._prepareChildren(),this.series.each(t=>{this._colorize(t)}),(this.isDirty("wheelX")||this.isDirty("wheelY"))&&this._handleSetWheel(),this.isDirty("cursor")){const t=this._prevSettings.cursor,e=this.get("cursor");e!==t&&(this._disposeProperty("cursor"),t&&t.dispose(),e&&(e._setChart(this),this._addCursor(e),this._pushPropertyDisposer("cursor",e.events.on("selectended",()=>{this._handleCursorSelectEnd()}))),this._prevSettings.cursor=e)}if(this.isDirty("scrollbarX")){const t=this._prevSettings.scrollbarX,e=this.get("scrollbarX");e!==t&&(this._disposeProperty("scrollbarX"),t&&t.dispose(),e&&(e.parent||this.topAxesContainer.children.push(e),this._pushPropertyDisposer("scrollbarX",e.events.on("rangechanged",i=>{this._handleScrollbar(this.xAxes,i.start,i.end,i.grip)})),e.setPrivate("positionTextFunction",i=>{const s=this.xAxes.getIndex(0);return s&&s.getTooltipText(i,!1)||""})),this._prevSettings.scrollbarX=e)}if(this.isDirty("scrollbarY")){const t=this._prevSettings.scrollbarY,e=this.get("scrollbarY");e!==t&&(this._disposeProperty("scrollbarY"),t&&t.dispose(),e&&(e.parent||this.rightAxesContainer.children.push(e),this._pushPropertyDisposer("scrollbarY",e.events.on("rangechanged",i=>{this._handleScrollbar(this.yAxes,i.start,i.end,i.grip)})),e.setPrivate("positionTextFunction",i=>{const s=this.yAxes.getIndex(0);return s&&s.getTooltipText(i,!1)||""})),this._prevSettings.scrollbarY=e)}this._handleZoomOut()}_processSeries(t){super._processSeries(t);const e=t.get("xAxis"),i=t.get("yAxis");Ct(e.series,t),Ct(i.series,t),t._posXDp=t.addDisposer(e.events.on("positionchanged",()=>{t._fixPosition()})),t._posXDp=t.addDisposer(i.events.on("positionchanged",()=>{t._fixPosition()})),t.get("baseAxis")||(i.isType("CategoryAxis")||i.isType("DateAxis")?t.set("baseAxis",i):t.set("baseAxis",e)),t.get("stacked")&&(t._markDirtyKey("stacked"),w(t.dataItems,s=>{s.set("stackToItemY",void 0),s.set("stackToItemX",void 0)})),t._markDirtyAxes(),i.markDirtyExtremes(),e.markDirtyExtremes(),e._seriesAdded=!0,i._seriesAdded=!0,this._colorize(t)}_colorize(t){const e=this.get("colors");if(e&&t.get("fill")==null){const i=e.next();t._setSoft("stroke",i),t._setSoft("fill",i)}}_handleCursorSelectEnd(){const t=this.get("cursor"),e=t.get("behavior"),i=t.getPrivate("downPositionX",0),s=t.getPrivate("downPositionY",0),a=Math.min(1,Math.max(0,t.getPrivate("positionX",.5))),n=Math.min(1,Math.max(0,t.getPrivate("positionY",.5)));this.xAxes.each(r=>{if(e==="zoomX"||e==="zoomXY"){let o=r.toAxisPosition(i),l=r.toAxisPosition(a);r.zoom(o,l)}r.setPrivate("updateScrollbar",!0)}),this.yAxes.each(r=>{if(e==="zoomY"||e==="zoomXY"){let o=r.toAxisPosition(s),l=r.toAxisPosition(n);r.zoom(o,l)}r.setPrivate("updateScrollbar",!0)})}_handleScrollbar(t,e,i,s){t.each(a=>{let n=a.fixPosition(e),r=a.fixPosition(i),o=a.zoom(n,r,void 0,s);const l="updateScrollbar";a.setPrivateRaw(l,!1),o?o.events.on("stopped",()=>{a.setPrivateRaw(l,!0)}):a.setPrivateRaw(l,!0)})}_processAxis(t,e){return t.events.onAll(i=>{if(i.type==="clear")w(i.oldValues,s=>{this._removeAxis(s)});else if(i.type==="push")e.children.push(i.newValue),i.newValue.processChart(this);else if(i.type==="setIndex")e.children.setIndex(i.index,i.newValue),i.newValue.processChart(this);else if(i.type==="insertIndex")e.children.insertIndex(i.index,i.newValue),i.newValue.processChart(this);else if(i.type==="removeIndex")this._removeAxis(i.oldValue);else{if(i.type!=="moveIndex")throw new Error("Unknown IListEvent type");e.children.moveValue(i.value,i.newIndex),i.value.processChart(this)}})}_removeAxis(t){if(!t.isDisposed()){const e=t.parent;e&&e.children.removeValue(t);const i=t.gridContainer,s=i.parent;s&&s.children.removeValue(i);const a=t.topGridContainer,n=a.parent;n&&n.children.removeValue(a)}}_updateChartLayout(){const t=this.leftAxesContainer.width(),e=this.rightAxesContainer.width(),i=this.bottomAxesContainer;i.set("paddingLeft",t),i.set("paddingRight",e);const s=this.topAxesContainer;s.set("paddingLeft",t),s.set("paddingRight",e)}processAxis(t){this.get("cursor")&&(this.addDisposer(t.on("start",()=>{this._updateCursor()})),this.addDisposer(t.on("end",()=>{this._updateCursor()})))}_handleAxisSelection(t,e){let i=t.fixPosition(t.get("start",0)),s=t.fixPosition(t.get("end",1));if(i>s&&([i,s]=[s,i]),this.xAxes.indexOf(t)!=-1){if(e||t.getPrivate("updateScrollbar")){let a=this.get("scrollbarX");!a||a.getPrivate("isBusy")&&!e||(a.setRaw("start",i),a.setRaw("end",s),a.updateGrips())}}else if(this.yAxes.indexOf(t)!=-1&&(e||t.getPrivate("updateScrollbar"))){let a=this.get("scrollbarY");!a||a.getPrivate("isBusy")&&!e||(a.setRaw("start",i),a.setRaw("end",s),a.updateGrips())}this._handleZoomOut()}_handleZoomOut(){let t=this.zoomOutButton;if(t&&t.parent){let e=!1;this.xAxes.each(i=>{i.get("start")==0&&i.get("end")==1||(e=!0)}),this.yAxes.each(i=>{i.get("start")==0&&i.get("end")==1||(e=!0)}),e?t.isHidden()&&t.show():t.hide()}}inPlot(t){const e=this.plotContainer,i=this.getPrivate("otherCharts",this._otherCharts),s=e.toGlobal(t);if(t.x>=-.5&&t.y>=-.5&&t.x<=e.width()+.5&&t.y<=e.height()+.5)return!0;if(i)for(let a=i.length-1;a>=0;a--){const n=i[a];if(n!=this){const r=n.plotContainer,o=this._root.rootPointToDocument(s),l=n._root.documentPointToRoot(o),c=r.toLocal(l);if(c.x>=-.1&&c.y>=-.1&&c.x<=r.width()+.1&&c.y<=r.height()+.1)return!0}}return!1}arrangeTooltips(){const t=this.plotContainer,e=t.width(),i=t.height(),s=this.height();let a=t._display.toGlobal({x:0,y:0}),n=t._display.toGlobal({x:e,y:i});const r=[];let o,l,c=0,h=1/0,d=this._movePoint,g=this.get("maxTooltipDistance"),p=this.get("maxTooltipDistanceBy","xy");v(g)&&this.series.each(u=>{if(!u.isHidden()){const _=u.get("tooltip");if(_){let f=_.get("pointTo");if(f){let x=Math.hypot(d.x-f.x,d.y-f.y);p=="x"?x=Math.abs(d.x-f.x):p=="y"&&(x=Math.abs(d.y-f.y)),x{const _=u.get("tooltip");if(_&&!_.get("forceHidden")){let f=!1,x=_.get("pointTo");if(x){if(g>=0){let b=_.get("pointTo");if(b&&l&&u!=o){let y=Math.hypot(l.x-b.x,l.y-b.y);p=="x"?y=Math.abs(l.x-b.x):p=="y"&&(y=Math.abs(l.y-b.y)),y>g&&(f=!0)}}else g==-1&&u!=o&&(f=!0);this.inPlot(this._tooltipToLocal(x))&&_.dataItem?f||(c+=x.y):f=!0,f||u.isHidden()||u.isHiding()?_.hide(0):(_.show(),r.push(_),m.push(u))}}}),this.setPrivate("tooltipSeries",m),this.get("arrangeTooltips")){const u=this._root.tooltipContainer,_=r.length;if(c/_>i/2+a.y){r.sort((x,b)=>Ot(b.get("pointTo").y,x.get("pointTo").y));let f=n.y;if(w(r,x=>{let b=x.height(),y=x.get("centerY");y instanceof et&&(b*=y.value),b+=x.get("marginBottom",0),x.set("bounds",{left:a.x,top:a.y,right:n.x,bottom:f}),x.setPrivate("customData",{left:a.x,top:a.y,right:n.x,bottom:f}),f=Math.min(f-b,x._fy-b),x.parent==u&&u.children.moveValue(x,0)}),f<0){r.reverse();let x=f;w(r,b=>{let y=b.get("bounds");if(y){let A=y.top-f,I=y.bottom-f;AOt(x.get("pointTo").y,b.get("pointTo").y));let f=0;if(w(r,x=>{let b=x.height(),y=x.get("centerY");y instanceof et&&(b*=y.value),b+=x.get("marginBottom",0),x.set("bounds",{left:a.x,top:f,right:n.x,bottom:Math.max(a.y+s,f+b)}),x.parent==u&&u.children.moveValue(x,0),f=Math.max(f+b,x._fy+b)}),f>s){r.reverse();let x=s;w(r,b=>{let y=b.get("bounds");if(y){let A=y.top-(s-f),I=y.bottom-(s-f);I>x&&(I=x,A=I-b.height()),b.set("bounds",{left:y.left,top:A,right:y.right,bottom:I}),x=I-b.height()-b.get("marginBottom",0)}})}}}}_tooltipToLocal(t){return this.plotContainer.toLocal(t)}zoomOut(){this.xAxes.each(t=>{t.setPrivate("updateScrollbar",!0),t.zoom(0,1)}),this.yAxes.each(t=>{t.setPrivate("updateScrollbar",!0),t.zoom(0,1)})}}Object.defineProperty(ft,"className",{enumerable:!0,configurable:!0,writable:!0,value:"XYChart"}),Object.defineProperty(ft,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Nt.classNames.concat([ft.className])});class st extends G{_beforeChanged(){super._beforeChanged(),(this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&(this._clear=!0)}}Object.defineProperty(st,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Grid"}),Object.defineProperty(st,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:G.classNames.concat([st.className])});class vt extends S{constructor(){super(...arguments),Object.defineProperty(this,"lineX",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(st.new(this._root,{themeTags:["x"]}))}),Object.defineProperty(this,"lineY",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(st.new(this._root,{themeTags:["y"]}))}),Object.defineProperty(this,"selection",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(G.new(this._root,{themeTags:["selection","cursor"],layer:30}))}),Object.defineProperty(this,"_movePoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_lastPoint",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0}}),Object.defineProperty(this,"_tooltipX",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_tooltipY",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"chart",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_toX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_toY",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){this._settings.themeTags=F(this._settings.themeTags,["xy","cursor"]),super._afterNew(),this.setAll({width:k,height:k,isMeasured:!0,position:"absolute"}),this.states.create("hidden",{visible:!0,opacity:0}),this._drawLines(),this.setPrivateRaw("visible",!1),this._disposers.push(this.setTimeout(()=>{this.setPrivate("visible",!0)},500)),this._disposers.push(this.lineX.events.on("positionchanged",()=>{this._handleXLine()})),this._disposers.push(this.lineY.events.on("positionchanged",()=>{this._handleYLine()})),this._disposers.push(this.lineX.events.on("focus",t=>this._handleLineFocus(t.target))),this._disposers.push(this.lineX.events.on("blur",t=>this._handleLineBlur(t.target))),this._disposers.push(this.lineY.events.on("focus",t=>this._handleLineFocus(t.target))),this._disposers.push(this.lineY.events.on("blur",t=>this._handleLineBlur(t.target))),Xt("keyboardevents")&&this._disposers.push(ie(document,"keydown",t=>{this._handleLineMove(t.keyCode)}))}_setUpTouch(){const t=this.chart;t&&(t.plotContainer._display.cancelTouch=this.get("behavior")!="none")}_handleXLine(){let t=this.lineX.x(),e=!0;(t<0||t>this.width())&&(e=!1),this.lineX.setPrivate("visible",e)}_handleYLine(){let t=this.lineY.y(),e=!0;(t<0||t>this.height())&&(e=!1),this.lineY.setPrivate("visible",e)}_handleLineMove(t){let e="",i=0,s=.1;const a=this.chart;this._root.focused(this.lineX)?(a&&a.xAxes.length&&(s=a.xAxes.getIndex(0).getCellWidthPosition()),i=this.getPrivate("positionX",0),e="positionX",t==37?i-=s:t==39&&(i+=s)):this._root.focused(this.lineY)&&(a&&a.yAxes.length&&(s=a.yAxes.getIndex(0).getCellWidthPosition()),i=this.getPrivate("positionY",0),e="positionY",t==38?i-=s:t==40&&(i+=s)),i<0?i=0:i>1&&(i=1),e!=""&&this.set(e,i)}_handleLineFocus(t){this.setAll({positionX:this.getPrivate("positionX"),positionY:this.getPrivate("positionY"),alwaysShow:!0})}_handleLineBlur(t){this.setAll({positionX:void 0,positionY:void 0,alwaysShow:!1})}_prepareChildren(){if(super._prepareChildren(),this.isDirty("xAxis")){this._tooltipX=!1;const t=this.get("xAxis");if(t){const e=t.get("tooltip");e&&(this._tooltipX=!0,this._disposers.push(e.on("pointTo",()=>{this._updateXLine(e)})))}}if(this.isDirty("yAxis")){this._tooltipY=!1;const t=this.get("yAxis");if(t){const e=t.get("tooltip");e&&(this._tooltipY=!0,this._disposers.push(e.on("pointTo",()=>{this._updateYLine(e)})))}}}_handleSyncWith(){const t=this.chart;if(t){const e=this.get("syncWith"),i=[];e&&w(e,s=>{const a=s.chart;a&&i.push(a)}),t._otherCharts=i}}_updateChildren(){if(super._updateChildren(),this._handleSyncWith(),this.isDirty("positionX")||this.isDirty("positionY")){const t=this.get("positionX"),e=this.get("positionY");t==null&&e==null?this.hide(0):(this._movePoint=this.toGlobal(this._getPoint(this.get("positionX",0),this.get("positionY",0))),this.handleMove())}}_updateXLine(t){let e=j(this._display.toLocal(t.get("pointTo",{x:0,y:0})).x,2);this._toX!=e&&(this.lineX.animate({key:"x",to:e,duration:t.get("animationDuration",0),easing:t.get("animationEasing")}),this._toX=e)}_updateYLine(t){let e=j(this._display.toLocal(t.get("pointTo",{x:0,y:0})).y,2);this._toY!=e&&(this.lineY.animate({key:"y",to:e,duration:t.get("animationDuration",0),easing:t.get("animationEasing")}),this._toY=e)}_drawLines(){this.lineX.set("draw",t=>{t.moveTo(0,0),t.lineTo(0,this.height())}),this.lineY.set("draw",t=>{t.moveTo(0,0),t.lineTo(this.width(),0)})}updateCursor(){this.get("alwaysShow")&&(this._movePoint=this.toGlobal(this._getPoint(this.get("positionX",0),this.get("positionY",0)))),this.handleMove()}_setChart(t){this.chart=t,this._handleSyncWith();const e=t.plotContainer;this.events.on("boundschanged",()=>{this._disposers.push(this.setTimeout(()=>{this.updateCursor()},50))}),Xt("touchevents")&&(this._disposers.push(e.events.on("click",s=>{se(s.originalEvent)&&this._handleMove(s)})),this._setUpTouch()),this._disposers.push(e.events.on("pointerdown",s=>{this._handleCursorDown(s)})),this._disposers.push(e.events.on("globalpointerup",s=>{this._handleCursorUp(s),s.native||this.isHidden()||this._handleMove(s)})),this._disposers.push(e.events.on("globalpointermove",s=>{(this.get("syncWith")||mt(e._downPoints).length!=0||s.native||!this.isHidden())&&this._handleMove(s)}));const i=this.parent;i&&i.children.moveValue(this.selection)}_inPlot(t){const e=this.chart;return!!e&&e.inPlot(t)}_handleCursorDown(t){if(t.originalEvent.button==2)return;const e=t.point;let i=this._display.toLocal(e);const s=this.chart;if(this.selection.set("draw",()=>{}),s&&this._inPlot(i)){if(this._downPoint=i,this.get("behavior")!="none"){this.selection.show();const r="selectstarted";this.events.isEnabled(r)&&this.events.dispatch(r,{type:r,target:this,originalEvent:t.originalEvent})}let a=this._getPosition(i).x,n=this._getPosition(i).y;this.setPrivate("downPositionX",a),this.setPrivate("downPositionY",n)}}_handleCursorUp(t){if(this._downPoint){const e=this.get("behavior","none");if(e!="none"){e.charAt(0)==="z"&&this.selection.hide();const i=t.point;let s=this._display.toLocal(i);const a=this._downPoint,n=this.get("moveThreshold",1);if(s&&a){let r=!1;if(e!=="zoomX"&&e!=="zoomXY"&&e!=="selectX"&&e!=="selectXY"||Math.abs(s.x-a.x)>n&&(r=!0),e!=="zoomY"&&e!=="zoomXY"&&e!=="selectY"&&e!=="selectXY"||Math.abs(s.y-a.y)>n&&(r=!0),r){const o="selectended";this.events.isEnabled(o)&&this.events.dispatch(o,{type:o,target:this,originalEvent:t.originalEvent})}else{const o="selectcancelled";this.events.isEnabled(o)&&this.events.dispatch(o,{type:o,target:this,originalEvent:t.originalEvent})}}}}this._downPoint=void 0}_handleMove(t){if(this.getPrivate("visible")){const e=this.chart;if(e&&mt(e.plotContainer._downPoints).length>1)return void this.set("forceHidden",!0);this.set("forceHidden",!1);const i=t.point,s=this._lastPoint;if(Math.round(s.x)===Math.round(i.x)&&Math.round(s.y)===Math.round(i.y))return;this._lastPoint=i,this.setPrivate("lastPoint",i),this.handleMove({x:i.x,y:i.y},!1,t.originalEvent)}}_getPosition(t){return{x:t.x/this.width(),y:t.y/this.height()}}handleMove(t,e,i){t||(t=this._movePoint);const s=this.get("alwaysShow");if(!t)return void this.hide(0);this._movePoint=t;let a=this._display.toLocal(t),n=this.chart;if(n&&(this._inPlot(a)||this._downPoint)){n._movePoint=t,this.isHidden()&&(this.show(),this.get("behavior","").charAt(0)=="z"&&this.selection.set("draw",()=>{}));let r=a.x,o=a.y,l=this._getPosition(a);this.setPrivate("point",a);let c=this.get("snapToSeries");this._downPoint&&(c=void 0);let h=this.get("positionX"),d=l.x;v(h)&&(d=h);let g=this.get("positionY"),p=l.y;v(g)&&(p=g),this.setPrivate("positionX",d),this.setPrivate("positionY",p);const m=this._getPoint(d,p);if(r=m.x,o=m.y,n.xAxes.each(u=>{u._handleCursorPosition(d,c),s&&u.handleCursorShow()}),n.yAxes.each(u=>{u._handleCursorPosition(p,c),s&&u.handleCursorShow()}),!e){n._handleCursorPosition();const u="cursormoved";this.events.isEnabled(u)&&this.events.dispatch(u,{type:u,target:this,point:t,originalEvent:i})}this._updateLines(r,o),n.arrangeTooltips()}else if(!this._downPoint&&!s){this.hide(0);const r="cursorhidden";this.events.isEnabled(r)&&this.events.dispatch(r,{type:r,target:this})}this._downPoint&&this.get("behavior")!="none"&&this._updateSelection(a)}_getPoint(t,e){return{x:this.width()*t,y:this.height()*e}}_updateLines(t,e){this._tooltipX||this.lineX.set("x",t),this._tooltipY||this.lineY.set("y",e),this._drawLines()}_updateSelection(t){const e=this.selection,i=this.get("behavior"),s=this.width(),a=this.height();t.x<0&&(t.x=0),t.x>s&&(t.x=s),t.y<0&&(t.y=0),t.y>a&&(t.y=a),e.set("draw",n=>{const r=this._downPoint;r&&(i==="zoomXY"||i==="selectXY"?(n.moveTo(r.x,r.y),n.lineTo(r.x,t.y),n.lineTo(t.x,t.y),n.lineTo(t.x,r.y),n.lineTo(r.x,r.y)):i==="zoomX"||i==="selectX"?(n.moveTo(r.x,0),n.lineTo(r.x,a),n.lineTo(t.x,a),n.lineTo(t.x,0),n.lineTo(r.x,0)):i!=="zoomY"&&i!=="selectY"||(n.moveTo(0,r.y),n.lineTo(s,r.y),n.lineTo(s,t.y),n.lineTo(0,t.y),n.lineTo(0,r.y)))})}_onHide(){if(this.isHidden()){let t=this.chart;t&&(t.xAxes.each(e=>{e.handleCursorHide()}),t.yAxes.each(e=>{e.handleCursorHide()}),t.series.each(e=>{e.handleCursorHide()}))}super._onHide()}_onShow(){if(!this.isHidden()){let t=this.chart;t&&(t.xAxes.each(e=>{e.handleCursorShow()}),t.yAxes.each(e=>{e.handleCursorShow()}))}super._onShow()}_dispose(){super._dispose(),this.selection.dispose()}}function pe(P,t){return P==null?t:t==null?P:tP?t:P}Object.defineProperty(vt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"XYCursor"}),Object.defineProperty(vt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:S.classNames.concat([vt.className])});class U extends zt{constructor(){super(...arguments),Object.defineProperty(this,"_xField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_yField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_xOpenField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_yOpenField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_xLowField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_xHighField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_yLowField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_yHighField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_axesDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_stackDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_selectionProcessed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataSets",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_mainContainerMask",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_y",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_bullets",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"mainContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(S.new(this._root,{}))}),Object.defineProperty(this,"axisRanges",{enumerable:!0,configurable:!0,writable:!0,value:new Et}),Object.defineProperty(this,"_skipped",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_couldStackTo",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_reallyStackedTo",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_stackedSeries",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_aLocationX0",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_aLocationX1",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_aLocationY0",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_aLocationY1",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_showBullets",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"valueXFields",{enumerable:!0,configurable:!0,writable:!0,value:["valueX","openValueX","lowValueX","highValueX"]}),Object.defineProperty(this,"valueYFields",{enumerable:!0,configurable:!0,writable:!0,value:["valueY","openValueY","lowValueY","highValueY"]}),Object.defineProperty(this,"_valueXFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueYFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueXShowFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueYShowFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"__valueXShowFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"__valueYShowFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_emptyDataItem",{enumerable:!0,configurable:!0,writable:!0,value:new ot(this,void 0,{})}),Object.defineProperty(this,"_dataSetId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipFieldX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipFieldY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_posXDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_posYDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){this.fields.push("categoryX","categoryY","openCategoryX","openCategoryY"),this.valueFields.push("valueX","valueY","openValueX","openValueY","lowValueX","lowValueY","highValueX","highValueY"),this._setRawDefault("vcx",1),this._setRawDefault("vcy",1),this._setRawDefault("valueXShow","valueXWorking"),this._setRawDefault("valueYShow","valueYWorking"),this._setRawDefault("openValueXShow","openValueXWorking"),this._setRawDefault("openValueYShow","openValueYWorking"),this._setRawDefault("lowValueXShow","lowValueXWorking"),this._setRawDefault("lowValueYShow","lowValueYWorking"),this._setRawDefault("highValueXShow","highValueXWorking"),this._setRawDefault("highValueYShow","highValueYWorking"),this._setRawDefault("lowValueXGrouped","low"),this._setRawDefault("lowValueYGrouped","low"),this._setRawDefault("highValueXGrouped","high"),this._setRawDefault("highValueYGrouped","high"),super._afterNew(),this.set("maskContent",!0),this._disposers.push(this.axisRanges.events.onAll(t=>{if(t.type==="clear")w(t.oldValues,e=>{this._removeAxisRange(e)});else if(t.type==="push")this._processAxisRange(t.newValue);else if(t.type==="setIndex")this._processAxisRange(t.newValue);else if(t.type==="insertIndex")this._processAxisRange(t.newValue);else if(t.type==="removeIndex")this._removeAxisRange(t.oldValue);else{if(t.type!=="moveIndex")throw new Error("Unknown IStreamEvent type");this._processAxisRange(t.value)}})),this.states.create("hidden",{opacity:1,visible:!1}),this.onPrivate("startIndex",()=>{this.updateLegendValue()}),this.onPrivate("endIndex",()=>{this.updateLegendValue()}),this._makeFieldNames()}_processAxisRange(t){const e=S.new(this._root,{});t.container=e,this.children.push(e),t.series=this;const i=t.axisDataItem;i.setRaw("isRange",!0);const s=i.component;if(s){s._processAxisRange(i,["range","series"]);const a=i.get("bullet");if(a){const r=a.get("sprite");r&&r.setPrivate("visible",!1)}const n=i.get("axisFill");n&&e.set("mask",n),s._seriesAxisRanges.push(i)}}_removeAxisRange(t){const e=t.axisDataItem,i=e.component;i.disposeDataItem(e),ct(i._seriesAxisRanges,e);const s=t.container;s&&s.dispose()}_updateFields(){super._updateFields(),this._valueXFields=[],this._valueYFields=[],this._valueXShowFields=[],this._valueYShowFields=[],this.__valueXShowFields=[],this.__valueYShowFields=[],this.valueXFields&&w(this.valueXFields,t=>{if(this.get(t+"Field")){this._valueXFields.push(t);let e=this.get(t+"Show");this.__valueXShowFields.push(e),e.indexOf("Working")!=-1?this._valueXShowFields.push(e.split("Working")[0]):this._valueXShowFields.push(e)}}),this.valueYFields&&w(this.valueYFields,t=>{if(this.get(t+"Field")){this._valueYFields.push(t);let e=this.get(t+"Show");this.__valueYShowFields.push(e),e.indexOf("Working")!=-1?this._valueYShowFields.push(e.split("Working")[0]):this._valueYShowFields.push(e)}})}_dispose(){super._dispose(),this._bullets={};const t=this.chart;t&&t.series.removeValue(this),St(this.get("xAxis").series,this),St(this.get("yAxis").series,this)}_min(t,e){let i=pe(this.getPrivate(t),e);this.setPrivate(t,i)}_max(t,e){let i=me(this.getPrivate(t),e);this.setPrivate(t,i)}_shouldMakeBullet(t){const e=this.get("xAxis"),i=this.get("yAxis"),s=this.get("baseAxis");if(!e.inited||!i.inited)return!1;const a=this.get("minBulletDistance",0);if(a>0){let n=this.startIndex(),r=this.endIndex()-n;if(e==s){if(e.get("renderer").axisLength()/r{w(this._valueXShowFields,o=>{let l=r.get(o);l!=null&&(n&&(l+=this.getStackedXValue(r,o)),this._min("minX",l),this._max("maxX",l))}),w(this._valueYShowFields,o=>{let l=r.get(o);l!=null&&(n&&(l+=this.getStackedYValue(r,o)),this._min("minY",l),this._max("maxY",l))}),t.processSeriesDataItem(r,this._valueXFields),e.processSeriesDataItem(r,this._valueYFields)}),t._seriesValuesDirty=!0,e._seriesValuesDirty=!0,this.get("ignoreMinMax")||((this.isPrivateDirty("minX")||this.isPrivateDirty("maxX"))&&t.markDirtyExtremes(),(this.isPrivateDirty("minY")||this.isPrivateDirty("maxY"))&&e.markDirtyExtremes()),this._markStakedDirtyStack(),this.get("tooltipDataItem")||this.updateLegendValue(void 0)),(this.isDirty("vcx")||this.isDirty("vcy"))&&this._markStakedDirtyStack(),this._dataGrouped||(t._groupSeriesData(this),e._groupSeriesData(this),this._dataGrouped=!0),this._valuesDirty||this.isPrivateDirty("startIndex")||this.isPrivateDirty("adjustedStartIndex")||this.isPrivateDirty("endIndex")||this.isDirty("vcx")||this.isDirty("vcy")||this._stackDirty||this._sizeDirty){let r=this.startIndex(),o=this.endIndex(),l=this.get("minBulletDistance",0);if(l>0&&i&&(i.get("renderer").axisLength()/(o-r)>l?this._showBullets=!0:this._showBullets=!1),(this._psi!=r||this._pei!=o||this.isDirty("vcx")||this.isDirty("vcy")||this.isPrivateDirty("adjustedStartIndex")||this._stackDirty||this._valuesDirty)&&!this._selectionProcessed){this._selectionProcessed=!0;const c=this.get("vcx",1),h=this.get("vcy",1),d=this.get("stacked",!1),g=this.getPrivate("outOfSelection");if(i===t||!i)if(e._calculateTotals(),this.setPrivateRaw("selectionMinY",void 0),this.setPrivateRaw("selectionMaxY",void 0),g)e.markDirtySelectionExtremes();else for(let p=r;p0){let t=this._mainContainerMask;t==null&&(t=this.children.push(G.new(this._root,{})),this._mainContainerMask=t,t.set("draw",(e,i)=>{const s=this.parent;if(s){const a=this._root.container.width(),n=this._root.container.height();e.moveTo(-a,-n),e.lineTo(-a,2*n),e.lineTo(2*a,2*n),e.lineTo(2*a,-n),e.lineTo(-a,-n),this.axisRanges.each(r=>{const o=r.axisDataItem.get("axisFill");if(s&&o){let l=o.get("draw");l&&l(e,i)}})}this.mainContainer._display.mask=t._display})),t.markDirty(),t._markDirtyKey("fill")}else this.mainContainer._display.mask=null}_updateChildren(){super._updateChildren(),this._x=this.x(),this._y=this.y(),this._makeRangeMask()}_stack(){const t=this.chart;if(t){const e=t.series.indexOf(this);if(this._couldStackTo=[],e>0){let i;for(let s=e-1;s>=0&&(i=t.series.getIndex(s),i.get("xAxis")!==this.get("xAxis")||i.get("yAxis")!==this.get("yAxis")||i.className!==this.className||(this._couldStackTo.push(i),i.get("stacked")));s--);}this._stackDataItems()}}_unstack(){gt(this._reallyStackedTo,(t,e)=>{delete e._stackedSeries[this.uid]}),this._reallyStackedTo={},w(this.dataItems,t=>{t.setRaw("stackToItemY",void 0),t.setRaw("stackToItemX",void 0)})}_stackDataItems(){const t=this.get("baseAxis"),e=this.get("xAxis"),i=this.get("yAxis");let s,a;t===e?(s="valueY",a="stackToItemY"):t===i&&(s="valueX",a="stackToItemX");let n=this._couldStackTo.length,r=0;const o=this.get("stackToNegative");this._reallyStackedTo={},w(this.dataItems,l=>{for(let c=0;c=0&&p>=0){l.setRaw(a,d),this._reallyStackedTo[h.uid]=h,h._stackedSeries[this.uid]=this;break}if(g<0&&p<0){l.setRaw(a,d),this._reallyStackedTo[h.uid]=h,h._stackedSeries[this.uid]=this;break}}}else if(v(g)&&v(p)){l.setRaw(a,d),this._reallyStackedTo[h.uid]=h,h._stackedSeries[this.uid]=this;break}}}r++})}processXSelectionDataItem(t,e,i){w(this.__valueXShowFields,s=>{let a=t.get(s);a!=null&&(i&&(a+=this.getStackedXValueWorking(t,s)),this._min("selectionMinX",a),this._max("selectionMaxX",a*e))})}processYSelectionDataItem(t,e,i){w(this.__valueYShowFields,s=>{let a=t.get(s);a!=null&&(i&&(a+=this.getStackedYValueWorking(t,s)),this._min("selectionMinY",a),this._max("selectionMaxY",a*e))})}getStackedYValueWorking(t,e){const i=t.get("stackToItemY");if(i){const s=i.component;return i.get(e,0)*s.get("vcy",1)+this.getStackedYValueWorking(i,e)}return 0}getStackedXValueWorking(t,e){const i=t.get("stackToItemX");if(i){const s=i.component;return i.get(e,0)*s.get("vcx",1)+this.getStackedXValueWorking(i,e)}return 0}getStackedYValue(t,e){const i=t.get("stackToItemY");return i?i.get(e,0)+this.getStackedYValue(i,e):0}getStackedXValue(t,e){const i=t.get("stackToItemX");return i?i.get(e,0)+this.getStackedXValue(i,e):0}createLegendMarker(t){this.updateLegendMarker()}_markDirtyAxes(){this._axesDirty=!0,this.markDirty()}_markDataSetDirty(){this._afterDataChange(),this._valuesDirty=!0,this._dataProcessed=!1,this._aggregatesCalculated=!1,this.markDirty()}_clearDirty(){super._clearDirty(),this._axesDirty=!1,this._selectionProcessed=!1,this._stackDirty=!1,this._dataProcessed=!1}_positionBullet(t){let e=t.get("sprite");if(e){let i=e.dataItem,s=t.get("locationX",i.get("locationX",.5)),a=t.get("locationY",i.get("locationY",.5)),n=this.get("xAxis"),r=this.get("yAxis"),o=n.getDataItemPositionX(i,this._xField,s,this.get("vcx",1)),l=r.getDataItemPositionY(i,this._yField,a,this.get("vcy",1)),c=this.getPoint(o,l),h=i.get("left",c.x),d=i.get("right",c.x),g=i.get("top",c.y),p=i.get("bottom",c.y),m=0,u=0,_=d-h,f=p-g;if(this._shouldShowBullet(o,l)){e.setPrivate("visible",!t.getPrivate("hidden"));let x=t.get("field");const b=this.get("baseAxis"),y=this.get("xAxis"),A=this.get("yAxis");if(x!=null){let D;b==y?(x=="value"?D=this._yField:x=="open"?D=this._yOpenField:x=="high"?D=this._yHighField:x=="low"&&(D=this._yLowField),D&&(l=A.getDataItemPositionY(i,D,0,this.get("vcy",1)),c=A.get("renderer").positionToPoint(l),u=c.y,m=h+_*s)):(x=="value"?D=this._xField:x=="open"?D=this._xOpenField:x=="high"?D=this._xHighField:x=="low"&&(D=this._xLowField),D&&(o=y.getDataItemPositionX(i,D,0,this.get("vcx",1)),c=y.get("renderer").positionToPoint(o),m=c.x,u=p-f*a))}else m=h+_*s,u=p-f*a;const I=t.get("stacked");if(I){const D=this.chart;if(b==y){let O=this._bullets[o+"_"+l];if(O){let T=O.bounds(),C=e.localBounds(),N=u;u=T.top,I=="down"?u=T.bottom-C.top:I=="auto"?D&&(N{e!=this._mainDataItems&&w(e,i=>{this.disposeDataItem(i)})}),this._dataSets={},this._dataItems=this.mainDataItems}_handleDataSetChange(){w(this._dataItems,t=>{let e=t.bullets;e&&w(e,i=>{if(i){let s=i.get("sprite");s&&s.setPrivate("visible",!1)}})}),this._selectionProcessed=!1}show(t){const e=Object.create(null,{show:{get:()=>super.show}});return it(this,void 0,void 0,function*(){this._fixVC();let i=[];i.push(e.show.call(this,t).then(()=>{this._isShowing=!1;let s=this.get("xAxis"),a=this.get("yAxis"),n=this.get("baseAxis");a!==n&&a.markDirtySelectionExtremes(),s!==n&&s.markDirtySelectionExtremes()})),i.push(this.bulletsContainer.show(t)),i.push(this._sequencedShowHide(!0,t)),yield Promise.all(i)})}hide(t){const e=Object.create(null,{hide:{get:()=>super.hide}});return it(this,void 0,void 0,function*(){this._fixVC();let i=[];i.push(e.hide.call(this,t).then(()=>{this._isHiding=!1})),i.push(this.bulletsContainer.hide(t)),i.push(this._sequencedShowHide(!1,t)),yield Promise.all(i)})}showDataItem(t,e){const i=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return it(this,void 0,void 0,function*(){const s=[i.showDataItem.call(this,t,e)];v(e)||(e=this.get("stateAnimationDuration",0));const a=this.get("stateAnimationEasing");w(this._valueFields,n=>{s.push(t.animate({key:n+"Working",to:t.get(n),duration:e,easing:a}).waitForStop())}),yield Promise.all(s)})}hideDataItem(t,e){const i=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return it(this,void 0,void 0,function*(){const s=[i.hideDataItem.call(this,t,e)],a=this.states.create("hidden",{});v(e)||(e=a.get("stateAnimationDuration",this.get("stateAnimationDuration",0)));const n=a.get("stateAnimationEasing",this.get("stateAnimationEasing")),r=this.get("xAxis"),o=this.get("yAxis"),l=this.get("baseAxis"),c=this.get("stacked");if(l!==r&&l||w(this._valueYFields,h=>{let d=o.getPrivate("min"),g=o.baseValue();v(d)&&d>g&&(g=d),c&&(g=0),t.get(h)!=null&&s.push(t.animate({key:h+"Working",to:g,duration:e,easing:n}).waitForStop())}),l===o||!l){let h=r.getPrivate("min"),d=r.baseValue();v(h)&&h>d&&(d=h),c&&(d=0),w(this._valueXFields,g=>{t.get(g)!=null&&s.push(t.animate({key:g+"Working",to:d,duration:e,easing:n}).waitForStop())})}yield Promise.all(s)})}_markDirtyStack(){this._stackDirty=!0,this.markDirty(),this._markStakedDirtyStack()}_markStakedDirtyStack(){const t=this._stackedSeries;t&>(t,(e,i)=>{i._stackDirty||i._markDirtyStack()})}_afterChanged(){super._afterChanged(),this._skipped&&(this._markDirtyAxes(),this._skipped=!1)}showDataItemTooltip(t){this.getPrivate("doNotUpdateLegend")||(this.updateLegendMarker(t),this.updateLegendValue(t));const e=this.get("tooltip");if(e){if(this.isHidden())this.hideTooltip();else if(e._setDataItem(t),t){let i=this.get("locationX",0),s=this.get("locationY",1),a=t.get("locationX",i),n=t.get("locationY",s);const r=this.get("xAxis"),o=this.get("yAxis"),l=this.get("vcx",1),c=this.get("vcy",1),h=r.getDataItemPositionX(t,this._tooltipFieldX,this._aLocationX0+(this._aLocationX1-this._aLocationX0)*a,l),d=o.getDataItemPositionY(t,this._tooltipFieldY,this._aLocationY0+(this._aLocationY1-this._aLocationY0)*n,c),g=this.getPoint(h,d);let p=!0;if(w(this._valueFields,m=>{t.get(m)==null&&(p=!1)}),p){const m=this.chart;m&&m.inPlot(g)?(e.label.text.markDirtyText(),e.set("tooltipTarget",this._getTooltipTarget(t)),e.set("pointTo",this._display.toGlobal({x:g.x,y:g.y}))):e._setDataItem(void 0)}else e._setDataItem(void 0)}}}hideTooltip(){const t=this.get("tooltip");return t&&t.set("tooltipTarget",this),super.hideTooltip()}_getTooltipTarget(t){if(this.get("seriesTooltipTarget")=="bullet"){const e=t.bullets;if(e&&e.length>0){const i=e[0].get("sprite");if(i)return i}}return this}updateLegendValue(t){const e=this.get("legendDataItem");if(e){const i=e.get("label");if(i){let a="";t?(i._setDataItem(t),a=this.get("legendLabelText",i.get("text",this.get("name","")))):(i._setDataItem(this._emptyDataItem),a=this.get("legendRangeLabelText",this.get("legendLabelText",i.get("text",this.get("name",""))))),i.set("text",a)}const s=e.get("valueLabel");if(s){let a="";t?(s._setDataItem(t),a=this.get("legendValueText",s.get("text",""))):(s._setDataItem(this._emptyDataItem),a=this.get("legendRangeValueText",s.get("text",""))),s.set("text",a)}}}_getItemReaderLabel(){let t="X: {"+this._xField;return this.get("xAxis").isType("DateAxis")&&(t+=".formatDate()"),t+="}; Y: {"+this._yField,this.get("yAxis").isType("DateAxis")&&(t+=".formatDate()"),t+="}",t}getPoint(t,e){let i=this.get("xAxis").get("renderer").positionToCoordinate(t),s=this.get("yAxis").get("renderer").positionToCoordinate(e),a=999999999;return s<-a&&(s=-a),s>a&&(s=a),i<-a&&(i=-a),i>a&&(i=a),{x:i,y:s}}_shouldInclude(t){return!0}handleCursorHide(){this.hideTooltip(),this.updateLegendValue(void 0),this.updateLegendMarker(void 0)}_afterDataChange(){super._afterDataChange(),this.get("xAxis")._markDirtyKey("start"),this.get("yAxis")._markDirtyKey("start"),this.resetExtremes()}resetExtremes(){this.setPrivate("selectionMinX",void 0),this.setPrivate("selectionMaxX",void 0),this.setPrivate("selectionMinY",void 0),this.setPrivate("selectionMaxY",void 0),this.setPrivate("minX",void 0),this.setPrivate("minY",void 0),this.setPrivate("maxX",void 0),this.setPrivate("maxY",void 0)}createAxisRange(t){return this.axisRanges.push({axisDataItem:t})}get mainDataItems(){return this._mainDataItems}_adjustStartIndex(t){const e=this.get("xAxis");if(this.get("baseAxis")==e&&e.isType("DateAxis")){const i=e.baseDuration(),s=e.getPrivate("selectionMin",e.getPrivate("min",0)),a=i*this.get("locationX",.5);let n=-1/0;for(;n{if(e.type==="clear")w(e.oldValues,i=>{this.disposeDataItem(i)});else if(e.type==="push")this._processAxisRange(e.newValue,["range"]);else if(e.type==="setIndex")this._processAxisRange(e.newValue,["range"]);else if(e.type==="insertIndex")this._processAxisRange(e.newValue,["range"]);else if(e.type==="removeIndex")this.disposeDataItem(e.oldValue);else{if(e.type!=="moveIndex")throw new Error("Unknown IStreamEvent type");this._processAxisRange(e.value,["range"])}}));const t=this.get("renderer");t&&(t.axis=this,t.processAxis()),this.children.push(t),this.ghostLabel=t.makeLabel(new ot(this,void 0,{}),[]),this.ghostLabel.adapters.disable("text"),this.ghostLabel.setAll({opacity:0,tooltipText:void 0,tooltipHTML:void 0,interactive:!1}),this.ghostLabel.events.disable()}_updateFinals(t,e){}zoom(t,e,i,s){if(this.get("zoomable",!0))if(this._updateFinals(t,e),this.get("start")!==t||this.get("end")!=e){let a=this._sAnimation,n=this._eAnimation,r=this.get("maxDeviation",.5)*Math.min(1,e-t);t<-r&&(t=-r),e>1+r&&(e=1+r),t>e&&([t,e]=[e,t]),v(i)||(i=this.get("interpolationDuration",0)),s||(s="end");let o=this.getPrivate("maxZoomFactor",this.get("maxZoomFactor",100)),l=o;e===1&&t!==0&&(s=tthis.get("end",1)?"end":"start");let c=this.get("minZoomCount",0),h=this.get("maxZoomCount",1/0);v(c)&&(o=l/c);let d=1;if(v(h)&&(d=l/h),s==="start"?(h>0&&1/(e-t)o&&(e=t+1/o),e>1&&e-t<1/o&&(t=e-1/o)):(h>0&&1/(e-t)o&&(t=e-1/o),t<0&&e-t<1/o&&(e=t+1/o)),1/(e-t)>o&&(e=t+1/o),1/(e-t)>o&&(t=e-1/o),h!=null&&c!=null&&t==this.get("start")&&e==this.get("end")){const g=this.chart;g&&g._handleAxisSelection(this,!0)}if((a&&a.playing&&a.to==t||this.get("start")==t)&&(n&&n.playing&&n.to==e||this.get("end")==e))return;if(i>0){let g,p,m=this.get("interpolationEasing");if(this.get("start")!=t&&(g=this.animate({key:"start",to:t,duration:i,easing:m})),this.get("end")!=e&&(p=this.animate({key:"end",to:e,duration:i,easing:m})),this._sAnimation=g,this._eAnimation=p,g)return g;if(p)return p}else this.set("start",t),this.set("end",e),this._root.events.once("frameended",()=>{this._markDirtyKey("start"),this._root._markDirty()})}else this._sAnimation&&this._sAnimation.stop(),this._eAnimation&&this._eAnimation.stop()}get series(){return this._series}_processAxisRange(t,e){t.setRaw("isRange",!0),this._createAssets(t,e),this._rangesDirty=!0,this._prepareDataItem(t);const i=t.get("above"),s=this.topGridContainer,a=t.get("grid");i&&a&&s.children.moveValue(a);const n=t.get("axisFill");i&&n&&s.children.moveValue(n)}_prepareDataItem(t,e){}markDirtyExtremes(){}markDirtySelectionExtremes(){}_calculateTotals(){}_updateAxisRanges(){this._bullets={},this.axisRanges.each(t=>{this._prepareDataItem(t)}),w(this._seriesAxisRanges,t=>{this._prepareDataItem(t)})}_prepareChildren(){if(super._prepareChildren(),this.get("fixAxisSize")?this.ghostLabel.set("visible",!0):this.ghostLabel.set("visible",!1),this.isDirty("start")||this.isDirty("end")){const e=this.chart;e&&e._updateCursor();let i=this.get("start",0),s=this.get("end",1),a=this.get("maxDeviation",.5)*Math.min(1,s-i);if(i<-a){let n=i+a;i=-a,this.setRaw("start",i),this.isDirty("end")&&this.setRaw("end",s-n)}if(s>1+a){let n=s-1-a;s=1+a,this.setRaw("end",s),this.isDirty("start")&&this.setRaw("start",i-n)}}const t=this.get("renderer");if(t._start=this.get("start"),t._end=this.get("end"),t._inversed=t.get("inversed",!1),t._axisLength=t.axisLength()/(t._end-t._start),t._updateLC(),this.isDirty("tooltip")){const e=this.get("tooltip");if(e){const i=t.get("themeTags");e.addTag("axis"),e.addTag(this.className.toLowerCase()),e._applyThemes(),i&&(e.set("themeTags",F(e.get("themeTags"),i)),e.label._applyThemes())}}}_updateTooltipBounds(){const t=this.get("tooltip");t&&this.get("renderer").updateTooltipBounds(t)}_updateBounds(){super._updateBounds(),this._updateTooltipBounds()}processChart(t){this.chart=t,this.get("renderer").chart=t,t.gridContainer.children.push(this.gridContainer),t.topGridContainer.children.push(this.topGridContainer),t.axisHeadersContainer.children.push(this.axisHeader),this.on("start",()=>{t._handleAxisSelection(this)}),this.on("end",()=>{t._handleAxisSelection(this)}),t.plotContainer.onPrivate("width",()=>{this.markDirtySize()}),t.plotContainer.onPrivate("height",()=>{this.markDirtySize()}),t.processAxis(this)}hideDataItem(t){return this._toggleFHDataItem(t,!0),super.hideDataItem(t)}showDataItem(t){return this._toggleFHDataItem(t,!1),super.showDataItem(t)}_toggleFHDataItem(t,e){const i="forceHidden",s=t.get("label");s&&s.set(i,e);const a=t.get("grid");a&&a.set(i,e);const n=t.get("tick");n&&n.set(i,e);const r=t.get("axisFill");r&&r.set(i,e);const o=t.get("bullet");if(o){const l=o.get("sprite");l&&l.set(i,e)}}_toggleDataItem(t,e){const i=t.get("label"),s="visible";i&&i.setPrivate(s,e);const a=t.get("grid");a&&a.setPrivate(s,e);const n=t.get("tick");n&&n.setPrivate(s,e);const r=t.get("axisFill");r&&r.setPrivate(s,e);const o=t.get("bullet");if(o){const l=o.get("sprite");l&&l.setPrivate(s,e)}}_createAssets(t,e,i){var s,a,n;const r=this.get("renderer");let o="minor";const l=t.get("label");if(l){let d=l.get("themeTags"),g=!1;i?(d==null?void 0:d.indexOf(o))==-1&&(g=!0):(d==null?void 0:d.indexOf(o))!=-1&&(g=!0),g&&((s=l.parent)===null||s===void 0||s.children.removeValue(l),r.makeLabel(t,e),l.dispose(),r.labels.removeValue(l))}else r.makeLabel(t,e);const c=t.get("grid");if(c){let d=c.get("themeTags"),g=!1;i?(d==null?void 0:d.indexOf(o))==-1&&(g=!0):(d==null?void 0:d.indexOf(o))!=-1&&(g=!0),g&&((a=c.parent)===null||a===void 0||a.children.removeValue(c),r.makeGrid(t,e),c.dispose(),r.grid.removeValue(c))}else r.makeGrid(t,e);const h=t.get("tick");if(h){let d=!1,g=h.get("themeTags");i?(g==null?void 0:g.indexOf(o))==-1&&(d=!0):(g==null?void 0:g.indexOf(o))!=-1&&(d=!0),d&&((n=h.parent)===null||n===void 0||n.children.removeValue(h),r.makeTick(t,e),h.dispose(),r.ticks.removeValue(h))}else r.makeTick(t,e);i||t.get("axisFill")||r.makeAxisFill(t,e),this._processBullet(t)}_processBullet(t){let e=t.get("bullet"),i=this.get("bullet");if(e||!i||t.get("isRange")||(e=i(this._root,this,t)),e){e.axis=this;const s=e.get("sprite");s&&(s._setDataItem(t),t.setRaw("bullet",e),s.parent||this.bulletsContainer.children.push(s))}}_afterChanged(){super._afterChanged();const t=this.chart;t&&(t._updateChartLayout(),t.axisHeadersContainer.markDirtySize()),this.get("renderer")._updatePositions(),this._seriesAdded=!1}disposeDataItem(t){super.disposeDataItem(t);const e=this.get("renderer"),i=t.get("label");i&&(e.labels.removeValue(i),i.dispose());const s=t.get("tick");s&&(e.ticks.removeValue(s),s.dispose());const a=t.get("grid");a&&(e.grid.removeValue(a),a.dispose());const n=t.get("axisFill");n&&(e.axisFills.removeValue(n),n.dispose());const r=t.get("bullet");r&&r.dispose()}_updateGhost(){this.setPrivate("cellWidth",this.getCellWidthPosition()*this.get("renderer").axisLength());const t=this.ghostLabel;if(!t.isHidden()){const s=t.localBounds(),a=Math.ceil(s.right-s.left);let n=t.get("text");w(this.dataItems,r=>{const o=r.get("label");if(o&&!o.isHidden()){const l=o.localBounds();Math.ceil(l.right-l.left)>a&&(n=o.text._getText())}}),t.set("text",n)}let e=this.get("start",0),i=this.get("end",1);this.get("renderer").updateLabel(t,e+.5*(i-e))}_handleCursorPosition(t,e){t=this.get("renderer").toAxisPosition(t),this._cursorPosition=t,this._snapToSeries=e,this.updateTooltip()}updateTooltip(){const t=this._snapToSeries;let e=this._cursorPosition;const i=this.get("tooltip"),s=this.get("renderer");v(e)&&(w(this.series,a=>{if(a.get("baseAxis")===this){const n=this.getSeriesItem(a,e,this.get("tooltipLocation"));a.setRaw("tooltipDataItem",n),t&&t.indexOf(a)!=-1?(a.updateLegendMarker(n),a.updateLegendValue(n)):a.showDataItemTooltip(n)}}),i&&(s.updateTooltipBounds(i),this.get("snapTooltip")&&(e=this.roundAxisPosition(e,this.get("tooltipLocation",.5))),q(e)?i.hide(0):(this.setPrivateRaw("tooltipPosition",e),this._updateTooltipText(i,e),s.positionTooltip(i,e),ethis.get("end",1)?i.hide(0):i.show(0))))}_updateTooltipText(t,e){t.label.set("text",this.getTooltipText(e))}roundAxisPosition(t,e){return t}handleCursorShow(){let t=this.get("tooltip");t&&t.show()}handleCursorHide(){let t=this.get("tooltip");t&&t.hide()}processSeriesDataItem(t,e){}_clearDirty(){super._clearDirty(),this._sizeDirty=!1,this._rangesDirty=!1}coordinateToPosition(t){const e=this.get("renderer");return e.toAxisPosition(t/e.axisLength())}toAxisPosition(t){return this.get("renderer").toAxisPosition(t)}toGlobalPosition(t){return this.get("renderer").toGlobalPosition(t)}fixPosition(t){return this.get("renderer").fixPosition(t)}shouldGap(t,e,i,s){return!1}createAxisRange(t){return this.axisRanges.push(t)}_groupSeriesData(t){}getCellWidthPosition(){return .05}}Object.defineProperty(H,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Axis"}),Object.defineProperty(H,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Bt.classNames.concat([H.className])});class yt extends H{constructor(){super(...arguments),Object.defineProperty(this,"_dirtyExtremes",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dirtySelectionExtremes",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_deltaMinMax",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_minReal",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_maxReal",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_baseValue",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_syncDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_minLogAdjusted",{enumerable:!0,configurable:!0,writable:!0,value:1})}markDirtyExtremes(){this._dirtyExtremes=!0,this.markDirty()}markDirtySelectionExtremes(){this._dirtySelectionExtremes=!0,this.markDirty()}_afterNew(){this._settings.themeTags=F(this._settings.themeTags,["axis"]),this.setPrivateRaw("name","value"),this.addTag("value"),super._afterNew()}_prepareChildren(){if(super._prepareChildren(),this.isDirty("syncWithAxis")){this._prevSettings.syncWithAxis&&this._syncDp&&this._syncDp.dispose();let e=this.get("syncWithAxis");e&&(this._syncDp=new ae([e.onPrivate("selectionMinFinal",()=>{this._dirtySelectionExtremes=!0}),e.onPrivate("selectionMaxFinal",()=>{this._dirtySelectionExtremes=!0})]))}let t=!1;(this.isDirty("min")||this.isDirty("max")||this.isDirty("maxPrecision")||this.isDirty("numberFormat"))&&(t=!0,this.ghostLabel.set("text","")),(this._sizeDirty||this._dirtyExtremes||this._valuesDirty||t||this.isPrivateDirty("width")||this.isPrivateDirty("height")||this.isDirty("extraMin")||this.isDirty("extraMax")||this.isDirty("logarithmic")||this.isDirty("treatZeroAs")||this.isDirty("baseValue")||this.isDirty("strictMinMax")||this.isDirty("strictMinMaxSelection"))&&(this._getMinMax(),this._dirtyExtremes=!1),this._dirtySelectionExtremes&&!this._isPanning&&this.get("autoZoom",!0)&&(this._getSelectionMinMax(),this._dirtySelectionExtremes=!1),this._groupData(),(this._sizeDirty||this._valuesDirty||this.isDirty("start")||this.isDirty("end")||this.isPrivateDirty("min")||this.isPrivateDirty("selectionMax")||this.isPrivateDirty("selectionMin")||this.isPrivateDirty("max")||this.isPrivateDirty("step")||this.isPrivateDirty("width")||this.isPrivateDirty("height")||this.isDirty("logarithmic"))&&(this._handleRangeChange(),this._prepareAxisItems(),this._updateAxisRanges()),this._baseValue=this.baseValue()}_groupData(){}_formatText(t){const e=this.get("numberFormat"),i=this.getNumberFormatter();let s="";return s=e?i.format(t,e):i.format(t,void 0,this.getPrivate("stepDecimalPlaces")),s}_prepareAxisItems(){const t=this.getPrivate("min"),e=this.getPrivate("max");if(v(t)&&v(e)){const i=this.get("logarithmic"),s=this.getPrivate("step"),a=this.getPrivate("selectionMin"),n=this.getPrivate("selectionMax")+s;let r=a-s,o=1,l=t;if(i){if(r=this._minLogAdjusted,r2&&(r=Math.pow(10,Math.log(l)*Math.LOG10E-5))}const c=this.get("renderer"),h=c.get("minorLabelsEnabled"),d=c.get("minorGridEnabled",h);let g=Math.pow(10,Math.floor(Math.log(Math.abs(s))*Math.LOG10E));const p=Math.round(s/g);let m=2;j(p/5,10)%1==0&&(m=5),j(p/10,10)%1==0&&(m=10);let u=s/m,_=0,f=0,x=-1/0;for(;r2?A=Math.pow(10,Math.log(l)*Math.LOG10E+_-5):A+=s,d){let D=r+u;for(i&&(o>2&&(u=this._adjustMinMax(r,A,10).step),D=r+u);D{b.inited&&b._markDirtyAxes()}),this._updateGhost()}}_prepareDataItem(t,e){let i=this.get("renderer"),s=t.get("value"),a=t.get("endValue"),n=this.valueToPosition(s),r=n,o=this.valueToPosition(s+this.getPrivate("step"));v(a)&&(r=this.valueToPosition(a),o=r),t.get("isRange")&&a==null&&(o=n);let l=r,c=t.get("labelEndValue");c!=null&&(l=this.valueToPosition(c)),i.updateLabel(t.get("label"),n,l,e);const h=t.get("grid");if(i.updateGrid(h,n,r),h&&(s==this.get("baseValue",0)?(h.addTag("base"),h._applyThemes()):h.hasTag("base")&&(h.removeTag("base"),h._applyThemes())),i.updateTick(t.get("tick"),n,l,e),i.updateFill(t.get("axisFill"),n,o),this._processBullet(t),i.updateBullet(t.get("bullet"),n,r),!t.get("isRange")){const d=this.get("fillRule");d&&d(t)}}_handleRangeChange(){let t=this.positionToValue(this.get("start",0)),e=this.positionToValue(this.get("end",1));const i=this.get("renderer").gridCount();let s=this._adjustMinMax(t,e,i,!0),a=oe(s.step);this.setPrivateRaw("stepDecimalPlaces",a),t=j(t,a),e=j(e,a),s=this._adjustMinMax(t,e,i,!0);let n=s.step;t=s.min,e=s.max,this.getPrivate("selectionMin")===t&&this.getPrivate("selectionMax")===e&&this.getPrivate("step")===n||(this.setPrivateRaw("selectionMin",t),this.setPrivateRaw("selectionMax",e),this.setPrivateRaw("step",n))}positionToValue(t){const e=this.getPrivate("min"),i=this.getPrivate("max");return this.get("logarithmic")?Math.pow(Math.E,(t*(Math.log(i)*Math.LOG10E-Math.log(e)*Math.LOG10E)+Math.log(e)*Math.LOG10E)/Math.LOG10E):t*(i-e)+e}valueToPosition(t){const e=this.getPrivate("min"),i=this.getPrivate("max");if(this.get("logarithmic")){if(t<=0){let s=this.get("treatZeroAs");v(s)&&(t=s)}return(Math.log(t)*Math.LOG10E-Math.log(e)*Math.LOG10E)/(Math.log(i)*Math.LOG10E-Math.log(e)*Math.LOG10E)}return(t-e)/(i-e)}valueToFinalPosition(t){const e=this.getPrivate("minFinal"),i=this.getPrivate("maxFinal");if(this.get("logarithmic")){if(t<=0){let s=this.get("treatZeroAs");v(s)&&(t=s)}return(Math.log(t)*Math.LOG10E-Math.log(e)*Math.LOG10E)/(Math.log(i)*Math.LOG10E-Math.log(e)*Math.LOG10E)}return(t-e)/(i-e)}getX(t,e,i){t=i+(t-i)*e;const s=this.valueToPosition(t);return this._settings.renderer.positionToCoordinate(s)}getY(t,e,i){t=i+(t-i)*e;const s=this.valueToPosition(t);return this._settings.renderer.positionToCoordinate(s)}getDataItemCoordinateX(t,e,i,s){return this._settings.renderer.positionToCoordinate(this.getDataItemPositionX(t,e,i,s))}getDataItemPositionX(t,e,i,s){let a=t.get(e);return t.get("stackToItemX")?a=a*s+t.component.getStackedXValueWorking(t,e):a=this._baseValue+(a-this._baseValue)*s,this.valueToPosition(a)}getDataItemCoordinateY(t,e,i,s){return this._settings.renderer.positionToCoordinate(this.getDataItemPositionY(t,e,i,s))}getDataItemPositionY(t,e,i,s){let a=t.get(e);return t.get("stackToItemY")?a=a*s+t.component.getStackedYValueWorking(t,e):a=this._baseValue+(a-this._baseValue)*s,this.valueToPosition(a)}basePosition(){return this.valueToPosition(this.baseValue())}baseValue(){const t=Math.min(this.getPrivate("minFinal",-1/0),this.getPrivate("selectionMin",-1/0)),e=Math.max(this.getPrivate("maxFinal",1/0),this.getPrivate("selectionMax",1/0));let i=this.get("baseValue",0);return ie&&(i=e),i}cellEndValue(t){return t}fixSmallStep(t){return 1+t===1?(t*=2,this.fixSmallStep(t)):t}_fixMin(t){return t}_fixMax(t){return t}_calculateTotals(){if(this.get("calculateTotals")){let t=this.series[0];if(t){let e=t.startIndex();if(t.dataItems.length>0){e>0&&e--;let i,s,a=t.endIndex();a{if(!c.get("excludeFromTotal")){let h=c.dataItems[r];if(h){let d=h.get(n)*c.get(s);q(d)||(o+=d,l+=Math.abs(d))}}}),w(this.series,c=>{if(!c.get("excludeFromTotal")){let h=c.dataItems[r];if(h){let d=h.get(n)*c.get(s);q(d)||(h.set(i+"Total",l),h.set(i+"Sum",o),h.set(i+"TotalPercent",d/l*100))}}})}}}}}_getSelectionMinMax(){const t=this.getPrivate("minFinal"),e=this.getPrivate("maxFinal"),i=this.get("min"),s=this.get("max");let a=this.get("extraMin",0),n=this.get("extraMax",0);this.get("logarithmic")&&(this.get("extraMin")==null&&(a=.1),this.get("extraMax")==null&&(n=.2));const r=this.get("renderer").gridCount(),o=this.get("strictMinMaxSelection");let l=this.get("strictMinMax");if(v(t)&&v(e)){let c=e,h=t;if(w(this.series,x=>{if(!x.get("ignoreMinMax")){let b,y;const A=x.getPrivate("outOfSelection");if(x.get("xAxis")===this){if(!A){let I=x.getPrivate("minX"),D=x.getPrivate("maxX");x.startIndex()==0&&x.endIndex()==x.dataItems.length||(I=void 0,D=void 0),b=x.getPrivate("selectionMinX",I),y=x.getPrivate("selectionMaxX",D)}}else if(x.get("yAxis")===this&&!A){let I=x.getPrivate("minY"),D=x.getPrivate("maxY");x.startIndex()==0&&x.endIndex()==x.dataItems.length||(I=void 0,D=void 0),b=x.getPrivate("selectionMinY",I),y=x.getPrivate("selectionMaxY",D)}x.isHidden()||x.isShowing()||(v(b)&&(c=Math.min(c,b)),v(y)&&(h=Math.max(h,y)))}}),this.axisRanges.each(x=>{if(x.get("affectsMinMax")){let b=x.get("value");b!=null&&(c=Math.min(c,b),h=Math.max(h,b)),b=x.get("endValue"),b!=null&&(c=Math.min(c,b),h=Math.max(h,b))}}),c>h&&([c,h]=[h,c]),v(i)?c=l?i:t:l&&v(this._minReal)&&(c=this._minReal),v(s)?h=l?s:e:l&&v(this._maxReal)&&(h=this._maxReal),c===h){let x=c;if(c-=this._deltaMinMax,h+=this._deltaMinMax,ce&&(h=e));let u=Math.min(20,Math.ceil(Math.log(this.getPrivate("maxZoomFactor",100)+1)/Math.LN10)+2),_=j(this.valueToFinalPosition(c),u),f=j(this.valueToFinalPosition(h),u);this.setPrivateRaw("selectionMinFinal",c),this.setPrivateRaw("selectionMaxFinal",h),this.setPrivateRaw("selectionStepFinal",p.step),this.zoom(_,f)}}_getMinMax(){let t=this.get("min"),e=this.get("max"),i=1/0,s=-1/0,a=this.get("extraMin",0),n=this.get("extraMax",0);this.get("logarithmic")&&(this.get("extraMin")==null&&(a=.1),this.get("extraMax")==null&&(n=.2));let r=1/0;if(w(this.series,x=>{if(!x.get("ignoreMinMax")){let b,y;if(x.get("xAxis")===this?(b=x.getPrivate("minX"),y=x.getPrivate("maxX")):x.get("yAxis")===this&&(b=x.getPrivate("minY"),y=x.getPrivate("maxY")),v(b)&&v(y)){i=Math.min(i,b),s=Math.max(s,y);let A=y-b;A<=0&&(A=Math.abs(y/100)),A{if(x.get("affectsMinMax")){let b=x.get("value");b!=null&&(i=Math.min(i,b),s=Math.max(s,b)),b=x.get("endValue"),b!=null&&(i=Math.min(i,b),s=Math.max(s,b))}}),this.get("logarithmic")){let x=this.get("treatZeroAs");v(x)&&i<=0&&(i=x)}if(i===0&&s===0&&(s=.9,i=-.9),v(t)&&(i=t),v(e)&&(s=e),i===1/0||s===-1/0)return this.setPrivate("minFinal",void 0),void this.setPrivate("maxFinal",void 0);const o=i,l=s;let c=this.adapters.fold("min",i),h=this.adapters.fold("max",s);v(c)&&(i=c),v(h)&&(s=h),i=this._fixMin(i),s=this._fixMax(s),s-i<=1/Math.pow(10,15)&&(s-i!=0?this._deltaMinMax=(s-i)/2:this._getDelta(s),i-=this._deltaMinMax,s+=this._deltaMinMax),i-=(s-i)*a,s+=(s-i)*n,this.get("logarithmic")&&(i<0&&o>=0&&(i=0),s>0&&l<=0&&(s=0)),this._minReal=i,this._maxReal=s;let d=this.get("strictMinMax"),g=this.get("strictMinMaxSelection",!1);g&&(d=g);let p=d;v(e)&&(p=!0);let m=this.get("renderer").gridCount(),u=this._adjustMinMax(i,s,m,p);i=u.min,s=u.max,u=this._adjustMinMax(i,s,m,!0),i=u.min,s=u.max,d&&(i=v(t)?t:this._minReal,s=v(e)?e:this._maxReal,s-i<=1e-8&&(i-=this._deltaMinMax,s+=this._deltaMinMax),i-=(s-i)*a,s+=(s-i)*n),c=this.adapters.fold("min",i),h=this.adapters.fold("max",s),v(c)&&(i=c),v(h)&&(s=h),r==1/0&&(r=s-i);let _=Math.round(Math.abs(Math.log(Math.abs(s-i))*Math.LOG10E))+5;i=j(i,_),s=j(s,_);const f=this.get("syncWithAxis");if(f&&(u=this._syncAxes(i,s,u.step,f.getPrivate("minFinal",f.getPrivate("min",0)),f.getPrivate("maxFinal",f.getPrivate("max",1)),f.getPrivate("step",1)),i=u.min,s=u.max),this.setPrivateRaw("maxZoomFactor",Math.max(1,Math.ceil((s-i)/r*this.get("maxZoomFactor",100)))),this._fixZoomFactor(),this.get("logarithmic")&&(this._minLogAdjusted=i,i=this._minReal,s=this._maxReal,i<=0&&(i=o*(1-Math.min(a,.99)))),v(i)&&v(s)&&(this.getPrivate("minFinal")!==i||this.getPrivate("maxFinal")!==s)){this.setPrivate("minFinal",i),this.setPrivate("maxFinal",s),this._saveMinMax(i,s);const x=this.get("interpolationDuration",0),b=this.get("interpolationEasing");this.animatePrivate({key:"min",to:i,duration:x,easing:b}),this.animatePrivate({key:"max",to:s,duration:x,easing:b})}}_fixZoomFactor(){}_getDelta(t){let e=Math.log(Math.abs(t))*Math.LOG10E,i=Math.pow(10,Math.floor(e));i/=10,this._deltaMinMax=i}_saveMinMax(t,e){}_adjustMinMax(t,e,i,s){i<=1&&(i=1),i=Math.round(i);let a=t,n=e,r=e-t;r===0&&(r=Math.abs(e));let o=Math.log(Math.abs(r))*Math.LOG10E,l=Math.pow(10,Math.floor(o));l/=10;let c=l;s&&(c=0),s?(t=Math.floor(t/l)*l,e=Math.ceil(e/l)*l):(t=Math.ceil(t/l)*l-c,e=Math.floor(e/l)*l+c),t<0&&a>=0&&(t=0),e>0&&n<=0&&(e=0),o=Math.log(Math.abs(r))*Math.LOG10E,l=Math.pow(10,Math.floor(o)),l/=100;let h=Math.ceil(r/i/l)*l,d=Math.pow(10,Math.floor(Math.log(Math.abs(h))*Math.LOG10E)),g=Math.ceil(h/d);g>5?g=10:g<=5&&g>2&&(g=5),h=Math.ceil(h/(d*g))*d*g;let p=this.get("maxPrecision");if(v(p)){let f=le(h,p);pa&&(t-=h),h=this.fixSmallStep(h),{min:t,max:e,step:h}}getTooltipText(t,e){const i=this.get("tooltipNumberFormat",this.get("numberFormat")),s=this.getNumberFormatter(),a=this.get("extraTooltipPrecision",0),n=this.getPrivate("stepDecimalPlaces",0)+a,r=j(this.positionToValue(t),n);return i?s.format(r,i):s.format(r,void 0,n)}getSeriesItem(t,e){let i,s,a=this.getPrivate("name")+this.get("renderer").getPrivate("letter"),n=this.positionToValue(e);if(w(t.dataItems,(r,o)=>{const l=Math.abs(r.get(a)-n);(i===void 0||l500&&(c=!0),c)t=g,e=p,i=m;else{h/3==Math.round(h/3)?(g=t-d*h,t>=0&&g<0&&(g=0)):(p=e+d*h,p<=0&&p>0&&(p=0));let u=this._adjustMinMax(g,p,l,!0);g=u.min,p=u.max,m=u.step}}}return{min:t,max:e,step:i}}_checkSync(t,e,i,s){let a=(e-t)/i;for(let n=1;npt._new(this._root,{themeTags:F(this.ticks.template.get("themeTags",[]),this.get("themeTags",[]))},[this.ticks.template]))}),Object.defineProperty(this,"grid",{enumerable:!0,configurable:!0,writable:!0,value:new B(E.new({}),()=>st._new(this._root,{themeTags:F(this.grid.template.get("themeTags",[]),this.get("themeTags",[]))},[this.grid.template]))}),Object.defineProperty(this,"axisFills",{enumerable:!0,configurable:!0,writable:!0,value:new B(E.new({}),()=>G._new(this._root,{themeTags:F(this.axisFills.template.get("themeTags",["axis","fill"]),this.get("themeTags",[]))},[this.axisFills.template]))}),Object.defineProperty(this,"labels",{enumerable:!0,configurable:!0,writable:!0,value:new B(E.new({}),()=>ut._new(this._root,{themeTags:F(this.labels.template.get("themeTags",[]),this.get("themeTags",[]))},[this.labels.template]))}),Object.defineProperty(this,"axis",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}makeTick(t,e){const i=this.ticks.make();return i._setDataItem(t),t.setRaw("tick",i),i.set("themeTags",F(i.get("themeTags"),e)),this.axis.labelsContainer.children.push(i),this.ticks.push(i),i}makeGrid(t,e){const i=this.grid.make();return i._setDataItem(t),t.setRaw("grid",i),i.set("themeTags",F(i.get("themeTags"),e)),this.axis.gridContainer.children.push(i),this.grid.push(i),i}makeAxisFill(t,e){const i=this.axisFills.make();return i._setDataItem(t),i.set("themeTags",F(i.get("themeTags"),e)),this.axis.gridContainer.children.push(i),t.setRaw("axisFill",i),this.axisFills.push(i),i}makeLabel(t,e){const i=this.labels.make();return i.set("themeTags",F(i.get("themeTags"),e)),this.axis.labelsContainer.children.moveValue(i,0),i._setDataItem(t),t.setRaw("label",i),this.labels.push(i),i}axisLength(){return 0}gridCount(){return this.axisLength()/this.get("minGridDistance",50)}_updatePositions(){}_afterNew(){super._afterNew(),this.set("isMeasured",!1);const t=this.thumb;t&&(this._disposers.push(t.events.on("pointerdown",e=>{this._handleThumbDown(e)})),this._disposers.push(t.events.on("globalpointerup",e=>{this._handleThumbUp(e)})),this._disposers.push(t.events.on("globalpointermove",e=>{this._handleThumbMove(e)})))}_beforeChanged(){super._beforeChanged(),this.isDirty("minGridDistance")&&this.root.events.once("frameended",()=>{this.axis.markDirtySize()})}_changed(){if(super._changed(),this.isDirty("pan")){const t=this.thumb;if(t){const e=this.axis.labelsContainer,i=this.get("pan");i=="zoom"?e.children.push(t):i=="none"&&e.children.removeValue(t)}}}_handleThumbDown(t){this._thumbDownPoint=this.toLocal(t.point);const e=this.axis;this._downStart=e.get("start"),this._downEnd=e.get("end")}_handleThumbUp(t){this._thumbDownPoint=void 0}_handleThumbMove(t){const e=this._thumbDownPoint;if(e){const i=this.toLocal(t.point),s=this._downStart,a=this._downEnd,n=this._getPan(i,e)*Math.min(1,a-s)/2;this.axis.zoom(s-n,a+n,0)}}_getPan(t,e){return 0}positionToCoordinate(t){return this._inversed?(this._end-t)*this._axisLength:(t-this._start)*this._axisLength}updateTooltipBounds(t){}_updateSize(){this.markDirty(),this._clear=!0}toAxisPosition(t){const e=this._start||0,i=this._end||1;return t*=i-e,t=this.get("inversed")?i-t:e+t}toGlobalPosition(t){const e=this._start||0,i=this._end||1;return this.get("inversed")?t=i-t:t-=e,t/=i-e}fixPosition(t){return this.get("inversed")?1-t:t}_updateLC(){}toggleVisibility(t,e,i,s){let a=this.axis;const n=a.get("start",0),r=a.get("end",1);en+(r-n)*(s+1e-4)?t.setPrivate("visible",!1):t.setPrivate("visible",!0)}_positionTooltip(t,e){const i=this.chart;i&&(t.set("pointTo",this._display.toGlobal(e)),i.inPlot(e)||t.hide())}processAxis(){}}Object.defineProperty(Z,"className",{enumerable:!0,configurable:!0,writable:!0,value:"AxisRenderer"}),Object.defineProperty(Z,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:G.classNames.concat([Z.className])});class Pt extends Z{constructor(){super(...arguments),Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:nt.new(this._root,{width:k,isMeasured:!1,themeTags:["axis","x","thumb"]})})}_afterNew(){this._settings.themeTags=F(this._settings.themeTags,["renderer","x"]),super._afterNew(),this.setPrivateRaw("letter","X");const t=this.grid.template;t.set("height",k),t.set("width",0),t.set("draw",(e,i)=>{e.moveTo(0,0),e.lineTo(0,i.height())}),this.set("draw",(e,i)=>{e.moveTo(0,0),e.lineTo(i.width(),0)})}_changed(){super._changed();const t=this.axis;t.ghostLabel.setPrivate("visible",!this.get("inside")),t.ghostLabel.set("x",-1e3);const e="opposite",i="inside";if(this.isDirty(e)||this.isDirty(i)){const s=this.chart,a=t.children;if(this.get(i)?t.addTag(i):t.removeTag(i),s){if(this.get(e)){const n=s.topAxesContainer.children;n.indexOf(t)==-1&&n.insertIndex(0,t),t.addTag(e),a.moveValue(this)}else{const n=s.bottomAxesContainer.children;n.indexOf(t)==-1&&n.moveValue(t),t.removeTag(e),a.moveValue(this,0)}t.ghostLabel._applyThemes(),this.labels.each(n=>{n._applyThemes()}),this.root._markDirtyRedraw()}t.markDirtySize()}this.thumb.setPrivate("height",t.labelsContainer.height())}_getPan(t,e){return(e.x-t.x)/this.width()}toAxisPosition(t){const e=this._start||0,i=this._end||1;return t=(t-=this._ls)*(i-e)/this._lc,t=this.get("inversed")?i-t:e+t}toGlobalPosition(t){const e=this._start||0,i=this._end||1;return this.get("inversed")?t=i-t:t-=e,t=t/(i-e)*this._lc,t+=this._ls}_updateLC(){const t=this.axis,e=t.parent;if(e){const i=e.innerWidth();this._lc=this.axisLength()/i,this._ls=(t.x()-e.get("paddingLeft",0))/i}}_updatePositions(){const t=this.axis,e=t.x()-_t(t.get("centerX",0),t.width())-t.parent.get("paddingLeft",0);t.gridContainer.set("x",e),t.topGridContainer.set("x",e),t.bulletsContainer.set("y",this.y());const i=t.chart;if(i){const s=i.plotContainer,a=t.axisHeader;let n=t.get("marginLeft",0),r=t.x()-n;const o=t.parent;o&&(r-=o.get("paddingLeft",0)),a.children.length>0?(n=t.axisHeader.width(),t.set("marginLeft",n+1)):a.set("width",n),a.setAll({x:r,y:-1,height:s.height()+2})}}processAxis(){super.processAxis();const t=this.axis;t.get("width")==null&&t.set("width",k);const e=this._root.verticalLayout;t.set("layout",e),t.labelsContainer.set("width",k),t.axisHeader.setAll({layout:e})}axisLength(){return this.axis.width()}positionToPoint(t){return{x:this.positionToCoordinate(t),y:0}}updateTick(t,e,i,s){if(t){v(e)||(e=0);let a=.5;a=v(s)&&s>1?t.get("multiLocation",a):t.get("location",a),v(i)&&i!=e&&(e+=(i-e)*a),t.set("x",this.positionToCoordinate(e));let n=t.get("length",0);const r=t.get("inside",this.get("inside",!1));this.get("opposite")?(t.set("y",k),r||(n*=-1)):(t.set("y",0),r&&(n*=-1)),t.set("draw",o=>{o.moveTo(0,0),o.lineTo(0,n)}),this.toggleVisibility(t,e,t.get("minPosition",0),t.get("maxPosition",1))}}updateLabel(t,e,i,s){if(t){let a=.5;a=v(s)&&s>1?t.get("multiLocation",a):t.get("location",a),v(e)||(e=0);const n=t.get("inside",this.get("inside",!1));this.get("opposite")?n?(t.set("position","absolute"),t.set("y",0)):(t.set("position","relative"),t.set("y",k)):n?(t.set("y",0),t.set("position","absolute")):(t.set("y",void 0),t.set("position","relative")),v(i)&&i!=e&&(e+=(i-e)*a),t.set("x",this.positionToCoordinate(e)),this.toggleVisibility(t,e,t.get("minPosition",0),t.get("maxPosition",1))}}updateGrid(t,e,i){if(t){v(e)||(e=0);let s=t.get("location",.5);v(i)&&i!=e&&(e+=(i-e)*s),t.set("x",this.positionToCoordinate(e)),this.toggleVisibility(t,e,0,1)}}updateBullet(t,e,i){if(t){const s=t.get("sprite");if(s){v(e)||(e=0);let a=t.get("location",.5);v(i)&&i!=e&&(e+=(i-e)*a);let n=this.axis.roundAxisPosition(e,a),r=this.axis._bullets[n],o=-1;if(this.get("opposite")&&(o=1),t.get("stacked"))if(r){let l=r.get("sprite");l&&s.set("y",l.y()+l.height()*o)}else s.set("y",0);this.axis._bullets[n]=t,s.set("x",this.positionToCoordinate(e)),this.toggleVisibility(s,e,0,1)}}}updateFill(t,e,i){if(t){v(e)||(e=0),v(i)||(i=1);let s=this.positionToCoordinate(e),a=this.positionToCoordinate(i);this.fillDrawMethod(t,s,a)}}fillDrawMethod(t,e,i){t.set("draw",s=>{const a=this.axis.gridContainer.height(),n=this.width();in||i<0||(s.moveTo(e,0),s.lineTo(i,0),s.lineTo(i,a),s.lineTo(e,a),s.lineTo(e,0))})}positionTooltip(t,e){this._positionTooltip(t,{x:this.positionToCoordinate(e),y:0})}updateTooltipBounds(t){const e=this.get("inside"),i=1e5;let s=this._display.toGlobal({x:0,y:0}),a=s.x,n=0,r=this.axisLength(),o=i,l="up";this.get("opposite")?e?(l="up",n=s.y,o=i):(l="down",n=s.y-i,o=i):e?(l="down",n=s.y-i,o=i):(l="up",n=s.y,o=i);const c={left:a,right:a+r,top:n,bottom:n+o},h=t.get("bounds");Gt(c,h)||(t.set("bounds",c),t.set("pointerOrientation",l))}}Object.defineProperty(Pt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"AxisRendererX"}),Object.defineProperty(Pt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Z.classNames.concat([Pt.className])});class wt extends Z{constructor(){super(...arguments),Object.defineProperty(this,"_downY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:nt.new(this._root,{height:k,isMeasured:!1,themeTags:["axis","y","thumb"]})})}_afterNew(){this._settings.themeTags=F(this._settings.themeTags,["renderer","y"]),this._settings.opposite&&this._settings.themeTags.push("opposite"),super._afterNew(),this.setPrivateRaw("letter","Y");const t=this.grid.template;t.set("width",k),t.set("height",0),t.set("draw",(e,i)=>{e.moveTo(0,0),e.lineTo(i.width(),0)}),this.set("draw",(e,i)=>{e.moveTo(0,0),e.lineTo(0,i.height())})}_getPan(t,e){return(t.y-e.y)/this.height()}_changed(){super._changed();const t=this.axis;t.ghostLabel.setPrivate("visible",!this.get("inside")),t.ghostLabel.set("y",-1e3);const e=this.thumb,i="opposite",s="inside",a=this.chart;if(this.isDirty(i)||this.isDirty(s)){const r=t.children;if(this.get(s)?t.addTag(s):t.removeTag(s),a){if(this.get(i)){const o=a.rightAxesContainer.children;o.indexOf(t)==-1&&o.moveValue(t,0),t.addTag(i),r.moveValue(this,0)}else{const o=a.leftAxesContainer.children;o.indexOf(t)==-1&&o.moveValue(t),t.removeTag(i),r.moveValue(this)}t.ghostLabel._applyThemes(),this.labels.each(o=>{o._applyThemes()}),this.root._markDirtyRedraw()}t.markDirtySize()}const n=t.labelsContainer.width();a&&(this.get(i)?e.set("centerX",0):e.set("centerX",n)),e.setPrivate("width",n)}processAxis(){super.processAxis();const t=this.axis;t.get("height")==null&&t.set("height",k);const e=this._root.horizontalLayout;t.set("layout",e),t.labelsContainer.set("height",k),t.axisHeader.set("layout",e)}_updatePositions(){const t=this.axis,e=t.y()-_t(t.get("centerY",0),t.height());t.gridContainer.set("y",e),t.topGridContainer.set("y",e),t.bulletsContainer.set("x",this.x());const i=t.chart;if(i){const s=i.plotContainer,a=t.axisHeader;let n=t.get("marginTop",0);a.children.length>0?(n=t.axisHeader.height(),t.set("marginTop",n+1)):a.set("height",n),a.setAll({y:t.y()-n,x:-1,width:s.width()+2})}}axisLength(){return this.axis.innerHeight()}positionToPoint(t){return{x:0,y:this.positionToCoordinate(t)}}updateLabel(t,e,i,s){if(t){v(e)||(e=0);let a=.5;a=v(s)&&s>1?t.get("multiLocation",a):t.get("location",a);const n=this.get("opposite"),r=t.get("inside",this.get("inside",!1));n?(t.set("x",0),r?t.set("position","absolute"):t.set("position","relative")):r?(t.set("x",0),t.set("position","absolute")):(t.set("x",void 0),t.set("position","relative")),v(i)&&i!=e&&(e+=(i-e)*a),t.set("y",this.positionToCoordinate(e)),this.toggleVisibility(t,e,t.get("minPosition",0),t.get("maxPosition",1))}}updateGrid(t,e,i){if(t){v(e)||(e=0);let s=t.get("location",.5);v(i)&&i!=e&&(e+=(i-e)*s),t.set("y",this.positionToCoordinate(e)),this.toggleVisibility(t,e,0,1)}}updateTick(t,e,i,s){if(t){v(e)||(e=0);let a=.5;a=v(s)&&s>1?t.get("multiLocation",a):t.get("location",a),v(i)&&i!=e&&(e+=(i-e)*a),t.set("y",this.positionToCoordinate(e));let n=t.get("length",0);const r=t.get("inside",this.get("inside",!1));this.get("opposite")?(t.set("x",0),r&&(n*=-1)):r||(n*=-1),t.set("draw",o=>{o.moveTo(0,0),o.lineTo(n,0)}),this.toggleVisibility(t,e,t.get("minPosition",0),t.get("maxPosition",1))}}updateBullet(t,e,i){if(t){const s=t.get("sprite");if(s){v(e)||(e=0);let a=t.get("location",.5);v(i)&&i!=e&&(e+=(i-e)*a);let n=this.axis.roundAxisPosition(e,a),r=this.axis._bullets[n],o=1;if(this.get("opposite")&&(o=-1),t.get("stacked"))if(r){let l=r.get("sprite");l&&s.set("x",l.x()+l.width()*o)}else s.set("x",0);this.axis._bullets[n]=t,s.set("y",this.positionToCoordinate(e)),this.toggleVisibility(s,e,0,1)}}}updateFill(t,e,i){if(t){v(e)||(e=0),v(i)||(i=1);let s=this.positionToCoordinate(e),a=this.positionToCoordinate(i);this.fillDrawMethod(t,s,a)}}fillDrawMethod(t,e,i){t.set("draw",s=>{const a=this.axis.gridContainer.width(),n=this.height();in||i<0||(s.moveTo(0,e),s.lineTo(a,e),s.lineTo(a,i),s.lineTo(0,i),s.lineTo(0,e))})}positionToCoordinate(t){return this._inversed?(t-this._start)*this._axisLength:(this._end-t)*this._axisLength}positionTooltip(t,e){this._positionTooltip(t,{x:0,y:this.positionToCoordinate(e)})}updateTooltipBounds(t){const e=this.get("inside"),i=1e5;let s=this._display.toGlobal({x:0,y:0}),a=s.y,n=0,r=this.axisLength(),o=i,l="right";this.get("opposite")?e?(l="right",n=s.x-i,o=i):(l="left",n=s.x,o=i):e?(l="left",n=s.x,o=i):(l="right",n=s.x-i,o=i);const c={left:n,right:n+o,top:a,bottom:a+r},h=t.get("bounds");Gt(c,h)||(t.set("bounds",c),t.set("pointerOrientation",l))}_updateLC(){const t=this.axis,e=t.parent;if(e){const i=e.innerHeight();this._lc=this.axisLength()/i,this._ls=t.y()/i}}toAxisPosition(t){const e=this._start||0,i=this._end||1;return t=(t-=this._ls)*(i-e)/this._lc,t=this.get("inversed")?e+t:i-t}toGlobalPosition(t){const e=this._start||0,i=this._end||1;return this.get("inversed")?t-=e:t=i-t,t=t/(i-e)*this._lc,t+=this._ls}fixPosition(t){return this.get("inversed")?t:1-t}}Object.defineProperty(wt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"AxisRendererY"}),Object.defineProperty(wt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Z.classNames.concat([wt.className])});class Dt extends U{constructor(){super(...arguments),Object.defineProperty(this,"_endIndex",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeGenerator",{enumerable:!0,configurable:!0,writable:!0,value:Jt()}),Object.defineProperty(this,"_fillGenerator",{enumerable:!0,configurable:!0,writable:!0,value:ge()}),Object.defineProperty(this,"_legendStroke",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_legendFill",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"strokes",{enumerable:!0,configurable:!0,writable:!0,value:new B(E.new({}),()=>G._new(this._root,{themeTags:F(this.strokes.template.get("themeTags",[]),["line","series","stroke"])},[this.strokes.template]))}),Object.defineProperty(this,"fills",{enumerable:!0,configurable:!0,writable:!0,value:new B(E.new({}),()=>G._new(this._root,{themeTags:F(this.strokes.template.get("themeTags",[]),["line","series","fill"])},[this.fills.template]))}),Object.defineProperty(this,"_fillTemplate",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeTemplate",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_previousPoint",{enumerable:!0,configurable:!0,writable:!0,value:[0,0,0,0]}),Object.defineProperty(this,"_dindex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_sindex",{enumerable:!0,configurable:!0,writable:!0,value:0})}_afterNew(){this._fillGenerator.y0(function(t){return t[3]}),this._fillGenerator.x0(function(t){return t[2]}),this._fillGenerator.y1(function(t){return t[1]}),this._fillGenerator.x1(function(t){return t[0]}),super._afterNew()}makeStroke(t){const e=this.mainContainer.children.push(t.make());return t.push(e),e}makeFill(t){const e=this.mainContainer.children.push(t.make());return t.push(e),e}_updateChildren(){this._strokeTemplate=void 0,this._fillTemplate=void 0;let t=this.get("xAxis"),e=this.get("yAxis");if(this.isDirty("stroke")){const i=this.get("stroke");this.strokes.template.set("stroke",i);const s=this._legendStroke;s&&s.states.lookup("default").set("stroke",i)}if(this.isDirty("fill")){const i=this.get("fill");this.fills.template.set("fill",i);const s=this._legendFill;s&&s.states.lookup("default").set("fill",i)}if(this.isDirty("curveFactory")){const i=this.get("curveFactory");i&&(this._strokeGenerator.curve(i),this._fillGenerator.curve(i))}if(t.inited&&e.inited){if(this._axesDirty||this._valuesDirty||this._stackDirty||this.isDirty("vcx")||this.isDirty("vcy")||this._sizeDirty||this.isDirty("connect")||this.isDirty("curveFactory")){this.fills.each(c=>{c.setPrivate("visible",!1)}),this.strokes.each(c=>{c.setPrivate("visible",!1)}),this.axisRanges.each(c=>{let h=c.fills;h&&h.each(g=>{g.setPrivate("visible",!1)});let d=c.strokes;d&&d.each(g=>{g.setPrivate("visible",!1)})});let i=this.startIndex(),s=this.strokes.template.get("templateField"),a=this.fills.template.get("templateField"),n=!0,r=!0;s&&(n=!1),a&&(r=!1);for(let c=i-1;c>=0;c--){let h=this.dataItems[c],d=!0,g=h.dataContext;if(s&&g[s]&&(n=!0),a&&g[a]&&(r=!0),w(this._valueFields,p=>{v(h.get(p))||(d=!1)}),d&&n&&r){i=c;break}}let o=this.dataItems.length,l=this.endIndex();if(l{v(h.get(g))||(d=!1)}),d){l=c+1;break}}}if(i>0&&i--,this._endIndex=l,this._clearGraphics(),this._sindex=0,this._dindex=i,this.dataItems.length==1)this._startSegment(0);else for(;this._dindex0&&(Tt=!0);let Mt=!1;(A||b||y)&&(Mt=!0);const xt={points:C,segments:T,stacked:A,getOpen:Mt,basePosX:I,basePosY:D,fillVisible:Tt,xField:u,yField:_,xOpenField:f,yOpenField:x,vcx:p,vcy:m,baseAxis:g,xAxis:h,yAxis:d,locationX:K,locationY:J,openLocationX:rt,openLocationY:L,minDistance:R};for(M=t;Mt){i=M;break}l.template=X}}if(W){let X=z.dataContext[W];if(X){if(X instanceof E||(X=E.new(X)),this._fillTemplate=X,M>t){i=M;break}n.template=X}}if(!a){let X=this.dataItems[M+1];X&&g.shouldGap(z,X,s,O)&&(C=[],T.push(C),xt.points=C)}}n.setRaw("userData",[t,M]),l.setRaw("userData",[t,M]),M===e&&this._endLine(C,T[0][0]),l&&this._drawStroke(l,T),n&&this._drawFill(n,T),this.axisRanges.each(z=>{const Q=z.container,bt=z.fills,X=this.makeFill(bt);Q&&Q.children.push(X),X.setPrivate("visible",!0),this._drawFill(X,T);const Qt=z.strokes,lt=this.makeStroke(Qt);Q&&Q.children.push(lt),lt.setPrivate("visible",!0),this._drawStroke(lt,T),X.setRaw("userData",[t,M]),lt.setRaw("userData",[t,M])})}_getPoints(t,e){let i=e.points,s=t.get("locationX",e.locationX),a=t.get("locationY",e.locationY),n=e.xAxis.getDataItemPositionX(t,e.xField,s,e.vcx),r=e.yAxis.getDataItemPositionY(t,e.yField,a,e.vcy);if(this._shouldInclude(n)){const o=this.getPoint(n,r),l=[o.x,o.y];if(o.x+=this._x,o.y+=this._y,t.set("point",o),e.fillVisible){let c=n,h=r;if(e.baseAxis===e.xAxis?h=e.basePosY:e.baseAxis===e.yAxis&&(c=e.basePosX),e.getOpen){let g=t.get(e.xOpenField),p=t.get(e.yOpenField);if(g!=null&&p!=null){let m=t.get("openLocationX",e.openLocationX),u=t.get("openLocationY",e.openLocationY);if(e.stacked){let _=t.get("stackToItemX"),f=t.get("stackToItemY");_?(c=e.xAxis.getDataItemPositionX(_,e.xField,m,_.component.get("vcx")),q(c)&&(c=e.basePosX)):c=e.yAxis===e.baseAxis?e.basePosX:e.xAxis.getDataItemPositionX(t,e.xOpenField,m,e.vcx),f?(h=e.yAxis.getDataItemPositionY(f,e.yField,u,f.component.get("vcy")),q(h)&&(h=e.basePosY)):h=e.xAxis===e.baseAxis?e.basePosY:e.yAxis.getDataItemPositionY(t,e.yOpenField,u,e.vcy)}else c=e.xAxis.getDataItemPositionX(t,e.xOpenField,m,e.vcx),h=e.yAxis.getDataItemPositionY(t,e.yOpenField,u,e.vcy)}}let d=this.getPoint(c,h);l[2]=d.x,l[3]=d.y}if(e.minDistance>0){const c=l[0],h=l[1],d=l[2],g=l[3],p=this._previousPoint,m=p[0],u=p[1],_=p[2],f=p[3];(Math.hypot(c-m,h-u)>e.minDistance||d&&g&&Math.hypot(d-_,g-f)>e.minDistance)&&(i.push(l),this._previousPoint=l)}else i.push(l)}}_endLine(t,e){}_drawStroke(t,e){t.get("visible")&&!t.get("forceHidden")&&t.set("draw",i=>{w(e,s=>{this._strokeGenerator.context(i),this._strokeGenerator(s)})})}_drawFill(t,e){t.get("visible")&&!t.get("forceHidden")&&t.set("draw",i=>{w(e,s=>{this._fillGenerator.context(i),this._fillGenerator(s)})})}_processAxisRange(t){super._processAxisRange(t),t.fills=new B(E.new({}),()=>G._new(this._root,{themeTags:F(t.fills.template.get("themeTags",[]),["line","series","fill"])},[this.fills.template,t.fills.template])),t.strokes=new B(E.new({}),()=>G._new(this._root,{themeTags:F(t.strokes.template.get("themeTags",[]),["line","series","stroke"])},[this.strokes.template,t.strokes.template]))}createLegendMarker(t){const e=this.get("legendDataItem");if(e){const i=e.get("marker"),s=e.get("markerRectangle");s&&s.setPrivate("visible",!1),i.set("background",nt.new(i._root,{fillOpacity:0,fill:ne(0)}));const a=i.children.push(G._new(i._root,{themeTags:["line","series","legend","marker","stroke"],interactive:!1},[this.strokes.template]));this._legendStroke=a;const n=i.children.push(G._new(i._root,{themeTags:["line","series","legend","marker","fill"]},[this.fills.template]));this._legendFill=n;const r=this._root.interfaceColors.get("disabled");if(a.states.create("disabled",{fill:r,stroke:r}),n.states.create("disabled",{fill:r,stroke:r}),this.bullets.length>0){const o=this.bullets.getIndex(0);if(o){const l=o(i._root,this,new ot(this,{legend:!0},{}));if(l){const c=l.get("sprite");c instanceof G&&c.states.create("disabled",{fill:r,stroke:r}),c&&(c.set("tooltipText",void 0),c.set("tooltipHTML",void 0),i.children.push(c),c.setAll({x:i.width()/2,y:i.height()/2}),i.events.on("boundschanged",()=>{c.setAll({x:i.width()/2,y:i.height()/2})}))}}}}}}Object.defineProperty(Dt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"LineSeries"}),Object.defineProperty(Dt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:U.classNames.concat([Dt.className])});class $ extends U{constructor(){super(...arguments),Object.defineProperty(this,"_ph",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_pw",{enumerable:!0,configurable:!0,writable:!0,value:0})}_makeGraphics(t,e){return this.makeColumn(e,t)}_makeFieldNames(){super._makeFieldNames();const t=this.get("xAxis"),e=this.get("yAxis"),i="CategoryAxis",s="ValueAxis";t.isType(i)&&(this.get("openCategoryXField")||(this._xOpenField=this._xField)),t.isType(s)&&(this.get("openValueXField")||(this._xOpenField=this._xField)),e.isType(i)&&(this.get("openCategoryYField")||(this._yOpenField=this._yField)),e.isType(s)&&(this.get("openValueYField")||(this._yOpenField=this._yField))}_prepareChildren(){super._prepareChildren();const t=this.get("xAxis"),e=this.get("yAxis"),i=this.dataItems.length,s=Math.max(0,this.startIndex()-2),a=Math.min(this.endIndex()+2,i-1);if(t.inited&&e.inited)for(let n=s;n<=a;n++){let r=this.dataItems[n];this._createGraphics(r)}}_updateChildren(){const t=this.chart;t&&(this._ph=t.plotContainer.height(),this._pw=t.plotContainer.width());const e=this.get("xAxis"),i=this.get("yAxis"),s=this.get("baseAxis"),a=this.columns.template;this.isDirty("fill")&&a.get("fill")==null&&a.set("fill",this.get("fill")),this.isDirty("stroke")&&a.get("stroke")==null&&a.set("stroke",this.get("stroke"));let n=0,r=0,o=0;w(s.series,_=>{if(_ instanceof $){const f=_.get("stacked");f&&o==0&&r++,!f&&_.get("clustered")&&r++}_===this&&(n=r-1),o++}),this.get("clustered")||(n=0,r=1),r===0&&(r=1,n=0);const l=e.get("renderer"),c=i.get("renderer"),h="cellStartLocation",d="cellEndLocation",g=l.get(h,0),p=l.get(d,1),m=c.get(h,0),u=c.get(d,1);if(this._aLocationX0=g+n/r*(p-g),this._aLocationX1=g+(n+1)/r*(p-g),this._aLocationY0=m+n/r*(u-m),this._aLocationY1=m+(n+1)/r*(u-m),e.inited&&i.inited){if(this._axesDirty||this._valuesDirty||this._stackDirty||this.isDirty("vcx")||this.isDirty("vcy")||this._sizeDirty){const _=this.dataItems.length;let f=Math.max(0,this.startIndex()-2),x=Math.min(this.endIndex()+2,_-1);for(let y=0;y0&&f>0)for(let I=y-1;I>=0;I--){let D=this.dataItems[I];if(D.get("valueX")!=null&&D.get("valueY")!=null){b=D;break}}break}this._toggleColumn(A,!1)}for(let y=f;y<=x;y++){let A=this.dataItems[y];this._updateGraphics(A,b),A.get("valueX")!=null&&A.get("valueY")!=null&&(b=A)}for(let y=x+1;y<_;y++)this._toggleColumn(this.dataItems[y],!1)}}else this._skipped=!0;this.updateLegendMarker(this.get("tooltipDataItem")),super._updateChildren()}_createGraphics(t){let e=t.get("graphics");if(!e){e=this._makeGraphics(this.columns,t),t.set("graphics",e),e._setDataItem(t);const i=t.get("legendDataItem");if(i){const a=i.get("markerRectangle");if(a){const n=a.states.lookup("default");w(Lt,r=>{const o=e.get(r,this.get(r));a.set(r,o),n.set(r,o)})}}let s=t.get("rangeGraphics");s&&w(s,a=>{a.dispose()}),s=[],t.setRaw("rangeGraphics",s),this.axisRanges.each(a=>{const n=a.container,r=this._makeGraphics(a.columns,t);s&&s.push(r),r.setPrivate("list",a.columns),n.children.push(r)})}}createAxisRange(t){return w(this.dataItems,e=>{const i=e.get("graphics");i&&(i.dispose(),e.set("graphics",void 0))}),super.createAxisRange(t)}_updateGraphics(t,e){let i=t.get("graphics");const s=this._xField,a=this._yField,n=t.get(s),r=t.get(a);if(n!=null&&r!=null){const o=this._xOpenField,l=this._yOpenField,c=this.get("locationX",t.get("locationX",.5)),h=this.get("locationY",t.get("locationY",.5)),d=this.get("openLocationX",t.get("openLocationX",c)),g=this.get("openLocationY",t.get("openLocationY",h)),p=i.get("width"),m=i.get("height"),u=this.get("stacked"),_=this.get("xAxis"),f=this.get("yAxis"),x=this.get("baseAxis"),b=_.get("start"),y=_.get("end"),A=f.get("start"),I=f.get("end");let D,O,T,C,N=this.get("vcy",1),W=this.get("vcx",1),K=!1,J=!1;if(f.isType("CategoryAxis")&&_.isType("CategoryAxis")){let L=this._aLocationX0+d-.5,R=this._aLocationX1+c-.5;if(p instanceof et){let M=(R-L)*(1-p.value)/2;L+=M,R-=M}if(D=_.getDataItemPositionX(t,o,L,W),O=_.getDataItemPositionX(t,s,R,W),L=this._aLocationY0+g-.5,R=this._aLocationY1+h-.5,m instanceof et){let M=(R-L)*(1-m.value)/2;L+=M,R-=M}T=f.getDataItemPositionY(t,l,L,N),C=f.getDataItemPositionY(t,a,R,N),t.setRaw("point",{x:D+(O-D)/2,y:T+(C-T)/2})}else if(_===x){let L=this._aLocationX0+d-.5,R=this._aLocationX1+c-.5;if(p instanceof et){let M=(R-L)*(1-p.value)/2;L+=M,R-=M}if(D=_.getDataItemPositionX(t,o,L,W),O=_.getDataItemPositionX(t,s,R,W),T=f.getDataItemPositionY(t,a,h,N),this._yOpenField!==this._yField)C=f.getDataItemPositionY(t,l,g,N);else if(u){let M=t.get("stackToItemY");C=M?f.getDataItemPositionY(M,a,g,M.component.get("vcy")):f.basePosition()}else C=f.basePosition();t.setRaw("point",{x:D+(O-D)/2,y:T}),J=!0}else if(f===x){let L=this._aLocationY0+g-.5,R=this._aLocationY1+h-.5;if(m instanceof et){let M=(R-L)*(1-m.value)/2;L+=M,R-=M}if(T=f.getDataItemPositionY(t,l,L,N),C=f.getDataItemPositionY(t,a,R,N),O=_.getDataItemPositionX(t,s,c,W),this._xOpenField!==this._xField)D=_.getDataItemPositionX(t,o,d,W);else if(u){let M=t.get("stackToItemX");D=M?_.getDataItemPositionX(M,s,d,M.component.get("vcx")):_.basePosition()}else D=_.basePosition();K=!0,t.setRaw("point",{x:O,y:T+(C-T)/2})}this._updateSeriesGraphics(t,i,D,O,T,C,K,J),Dy&&O>y||T=I&&C>I||q(D)||q(T)?this._toggleColumn(t,!1):this._toggleColumn(t,!0);let rt=t.get("rangeGraphics");rt&&w(rt,L=>{this._updateSeriesGraphics(t,L,D,O,T,C,K,J)}),this._applyGraphicsStates(t,e)}}_updateSeriesGraphics(t,e,i,s,a,n,r,o){const l=e.get("width"),c=e.get("height"),h=e.get("maxWidth"),d=e.get("maxHeight"),g=this.getPoint(i,a),p=this.getPoint(s,n),m=t.get("point");if(m){const u=this.getPoint(m.x,m.y);m.x=u.x+this._x,m.y=u.y+this._y}if(i=g.x,s=p.x,a=g.y,n=p.y,v(l)){const u=(s-i-l)/2;i+=u,s-=u}if(v(h)&&h{this._toggleColumn(t,!1)})}_applyGraphicsStates(t,e){const i=t.get("graphics"),s=i.states.lookup("dropFromOpen"),a=i.states.lookup("riseFromOpen"),n=i.states.lookup("dropFromPrevious"),r=i.states.lookup("riseFromPrevious");if(s||n||a||r){const o=this.get("xAxis"),l=this.get("yAxis"),c=this.get("baseAxis");let h,d,g;c===o&&l.isType("ValueAxis")?(h=t.get(this._yOpenField),d=t.get(this._yField),g=e.get(this._yField)):c===l&&o.isType("ValueAxis")&&(h=t.get(this._xOpenField),d=t.get(this._xField),g=e.get(this._xField)),v(h)&&v(d)&&(d{const a=s.getPrivate("list");a&&a.removeValue(s),s.dispose()})}hideDataItem(t,e){const i=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return it(this,void 0,void 0,function*(){const s=[i.hideDataItem.call(this,t,e)],a=t.get("graphics");a&&s.push(a.hide(e));const n=t.get("rangeGraphics");n&&w(n,r=>{s.push(r.hide(e))}),yield Promise.all(s)})}_toggleColumn(t,e){const i=t.get("graphics");i&&i.setPrivate("visible",e);const s=t.get("rangeGraphics");s&&w(s,n=>{n.setPrivate("visible",e)});const a=t.bullets;a&&w(a,n=>{n.setPrivate("hidden",!e)})}showDataItem(t,e){const i=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return it(this,void 0,void 0,function*(){const s=[i.showDataItem.call(this,t,e)],a=t.get("graphics");a&&s.push(a.show(e));const n=t.get("rangeGraphics");n&&w(n,r=>{s.push(r.show(e))}),yield Promise.all(s)})}updateLegendMarker(t){let e=this.get("legendDataItem");if(this.get("useLastColorForLegendMarker")&&!t){const i=this.dataItems[this.endIndex()-1];i&&(t=i)}if(e){let i=this.columns.template;if(t){let a=t.get("graphics");a&&(i=a)}const s=e.get("markerRectangle");if(s&&!e.get("itemContainer").get("disabled")){const a=s.states.lookup("default");w(Lt,n=>{const r=i.get(n,this.get(n));s.set(n,r),a.set(n,r)})}}}_getTooltipTarget(t){return this.get("seriesTooltipTarget")=="bullet"?super._getTooltipTarget(t):t.get("graphics")||this}}Object.defineProperty($,"className",{enumerable:!0,configurable:!0,writable:!0,value:"BaseColumnSeries"}),Object.defineProperty($,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:U.classNames.concat([$.className])});class at extends H{constructor(){super(...arguments),Object.defineProperty(this,"_frequency",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_itemMap",{enumerable:!0,configurable:!0,writable:!0,value:{}})}_afterNew(){this._settings.themeTags=F(this._settings.themeTags,["axis"]),this.fields.push("category"),this.setPrivateRaw("name","category"),this.addTag("category"),super._afterNew()}_prepareChildren(){super._prepareChildren();const t=this.dataItems.length;let e=0;this._valuesDirty&&(this._itemMap={},w(this.dataItems,i=>{i.setRaw("index",e),this._itemMap[i.get("category")]=i,e++}),this.setPrivateRaw("maxZoomFactor",t)),this.setPrivateRaw("startIndex",Math.max(Math.round(this.get("start",0)*t),0)),this.setPrivateRaw("endIndex",Math.min(Math.round(this.get("end",1)*t),t)),(this._sizeDirty||this._valuesDirty||this.isDirty("start")||this.isDirty("end")||this.isPrivateDirty("endIndex")||this.isPrivateDirty("startIndex")||this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&this.dataItems.length>0&&(this._handleRangeChange(),this._prepareAxisItems(),this._updateAxisRanges())}_handleRangeChange(){w(this.series,t=>{let e=this.dataItems[this.startIndex()].get("category"),i=this.dataItems[this.endIndex()-1].get("category"),s=t.get("baseAxis"),a=t.get("xAxis"),n=t.get("yAxis");if(a instanceof at&&n instanceof at)t._markDirtyAxes();else if(s===this){let r,o,l=n;if(a===s?(t.get("categoryXField")&&(r="categoryX"),t.get("openCategoryXField")&&(o="openCategoryX")):n===s&&(t.get("categoryYField")&&(r="categoryY"),t.get("openCategoryYField")&&(o="openCategoryY"),l=a),l.className=="ValueAxis"&&(r||o)){let c,h;for(let m=0,u=t.dataItems.length;m=0;m--){let u=t.dataItems[m];if(r&&u.get(r)===i){h=u;break}if(o&&u.get(o)===i){h=u;break}}let d=0,g=t.dataItems.length;c&&(d=t.dataItems.indexOf(c)),h&&(g=t.dataItems.indexOf(h)+1),t.setPrivate("startIndex",d),t.setPrivate("endIndex",g);let p=!1;for(let m=d;m{u.get(_)!=null&&(p=!0)}),w(t.__valueYShowFields,_=>{u.get(_)!=null&&(p=!0)}),p)break}t.setPrivate("outOfSelection",!p)}t._markDirtyAxes()}})}_prepareAxisItems(){var t;const e=this.get("renderer"),i=this.dataItems.length;let s=this.startIndex();s>0&&s--;let a=this.endIndex();a0){let i=this.getPrivate("name")+this.get("renderer").getPrivate("letter"),s=this.axisPositionToIndex(e),a=t.dataItems[s],n=this.dataItems[s],r=n.get("category");if(a&&n&&a.get(i)===r)return a;for(let o=0,l=t.dataItems.length;ojt._new(this._root,{position:"absolute",themeTags:F(this.columns.template.get("themeTags",[]),["series","column"])},[this.columns.template]))})}makeColumn(t,e){const i=this.mainContainer.children.push(e.make());return i._setDataItem(t),e.push(i),i}_processAxisRange(t){super._processAxisRange(t),t.columns=new B(E.new({}),()=>jt._new(this._root,{position:"absolute",themeTags:F(t.columns.template.get("themeTags",[]),["series","column"])},[this.columns.template,t.columns.template]))}}Object.defineProperty(At,"className",{enumerable:!0,configurable:!0,writable:!0,value:"ColumnSeries"}),Object.defineProperty(At,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:$.classNames.concat([At.className])});export{Pt as AxisRendererXAm5,wt as AxisRendererYAm5,at as CategoryAxisAm5,At as ColumnSeriesAm5,Dt as LineSeriesAm5,yt as ValueAxisAm5,ft as XYChartAm5,vt as XYCursorAm5}; diff --git a/index.html b/index.html index 065c5b0..edaa17f 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ Esri and Mapbox Vector Tiles Style Converter - +